Built motion from commit f296b652.|2.6.15
authorsupport <support@xcally.com>
Thu, 8 Sep 2022 14:56:39 +0000 (14:56 +0000)
committersupport <support@xcally.com>
Thu, 8 Sep 2022 14:56:39 +0000 (14:56 +0000)
1204 files changed:
apidoc/api_project.js
apidoc/api_project.json
package.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/index.js
server/services/ami/dialer/models/action.js
server/services/ami/dialer/models/agentComplete.js
server/services/ami/dialer/models/final.js
server/services/ami/dialer/models/hangup.js
server/services/ami/dialer/models/history.js
server/services/ami/dialer/models/queueCallerAbandon.js
server/services/ami/dialer/utils/hopper.js
server/services/ami/dialer/utils/index.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/interval.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/iftime.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js
server/utils/update-app-config.js

index ae9ee54..c2ba2b1 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-09-08T13:30:55.562Z",
+    "time": "2022-09-08T14:48:49.478Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 300af21..7257d1f 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-09-08T13:30:55.562Z",
+    "time": "2022-09-08T14:48:49.478Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 3ccea66..6d6dbe7 100644 (file)
@@ -44,9 +44,7 @@
     "prettier:write": "prettier --write './**/*'",
     "format-all": "npm run js-beautify && npm run prettier:write",
     "test": "mocha server/test --timeout 5000",
-    "aux-containers": "docker-compose up -d database cache",
-    "db-dump": "docker-compose exec -u root database /xmotion_mysql_bk.sh dump",
-    "db-restore": "docker-compose exec -u root database /xmotion_mysql_bk.sh restore"
+    "aux-containers": "docker-compose up -d database cache"
   },
   "dependencies": {
     "@types/express-serve-static-core": "4.17.28",
index f64a900..064d77a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc07=['jscripty','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0x1c2d4d,_0xd84c99){var _0x5a1837=function(_0xe8a1bf){while(--_0xe8a1bf){_0x1c2d4d['push'](_0x1c2d4d['shift']());}};_0x5a1837(++_0xd84c99);}(_0xbc07,0xa3));var _0x7bc0=function(_0x330ac5,_0x3d3fb1){_0x330ac5=_0x330ac5-0x0;var _0x3e7ea1=_0xbc07[_0x330ac5];return _0x3e7ea1;};'use strict';var Sequelize=require(_0x7bc0('0x0'));module[_0x7bc0('0x1')]={'name':{'type':Sequelize[_0x7bc0('0x2')],'get':function(_0x467c13){return this['getDataValue'](_0x7bc0('0x3'));}},'action':{'type':Sequelize[_0x7bc0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7bc0('0x5'),_0x7bc0('0x6'),'motionbar',_0x7bc0('0x7'),'urlForward','browser',_0x7bc0('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x7bc0('0x9')},'data1':{'type':Sequelize[_0x7bc0('0x4')](0x1000),'comment':_0x7bc0('0xa')},'data2':{'type':Sequelize[_0x7bc0('0x4')](0x1000),'comment':_0x7bc0('0xb')},'data3':{'type':Sequelize[_0x7bc0('0x4')](0x1000),'comment':_0x7bc0('0xc')},'data4':{'type':Sequelize[_0x7bc0('0x4')](0x1000),'comments':_0x7bc0('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7bc0('0xe')},'data6':{'type':Sequelize[_0x7bc0('0x4')],'comments':_0x7bc0('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x7bc0('0x10')}};
\ No newline at end of file
+var _0x30d3=['integration','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager'];(function(_0x2e04e8,_0x21532f){var _0x2e9994=function(_0x5e69df){while(--_0x5e69df){_0x2e04e8['push'](_0x2e04e8['shift']());}};_0x2e9994(++_0x21532f);}(_0x30d3,0xc6));var _0x330d=function(_0xe178b5,_0x2dffe2){_0xe178b5=_0xe178b5-0x0;var _0x52a9a4=_0x30d3[_0xe178b5];return _0x52a9a4;};'use strict';var Sequelize=require(_0x330d('0x0'));module[_0x330d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4fe0af){return this[_0x330d('0x2')](_0x330d('0x3'));}},'action':{'type':Sequelize[_0x330d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x330d('0x5'),_0x330d('0x6'),'motionbar','jscripty',_0x330d('0x7'),_0x330d('0x8'),_0x330d('0x9'),_0x330d('0xa')]],'msg':_0x330d('0xb')}},'comment':_0x330d('0xb')},'data1':{'type':Sequelize[_0x330d('0x4')](0x1000),'comment':_0x330d('0xc')},'data2':{'type':Sequelize[_0x330d('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x330d('0x4')](0x1000),'comment':_0x330d('0xd')},'data4':{'type':Sequelize[_0x330d('0x4')](0x1000),'comments':_0x330d('0xe')},'data5':{'type':Sequelize[_0x330d('0x4')](0x1000),'comments':_0x330d('0xf')},'data6':{'type':Sequelize[_0x330d('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x330d('0x10')}};
\ No newline at end of file
index 85f6779..dc0f091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x323f=['fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir'];(function(_0x26f63d,_0xecee3){var _0x3b7594=function(_0x5327c1){while(--_0x5327c1){_0x26f63d['push'](_0x26f63d['shift']());}};_0x3b7594(++_0xecee3);}(_0x323f,0xd9));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xf323('0x0'));var rimraf=require(_0xf323('0x1'));var zipdir=require(_0xf323('0x2'));var jsonpatch=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var moment=require(_0xf323('0x5'));var BPromise=require(_0xf323('0x6'));var Mustache=require(_0xf323('0x7'));var util=require(_0xf323('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf323('0x9'));var fs=require('fs');var fs_extra=require(_0xf323('0xa'));var _=require(_0xf323('0xb'));var squel=require('squel');var crypto=require(_0xf323('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf323('0xd'));var toCsv=require(_0xf323('0xe'));var querystring=require(_0xf323('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf323('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf323('0x11'));var logger=require(_0xf323('0x12'))(_0xf323('0x13'));var utils=require(_0xf323('0x14'));var config=require(_0xf323('0x15'));var licenseUtil=require(_0xf323('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x958999,_0x44e0ce){_0x44e0ce=_0x44e0ce||0xcc;return function(_0x4da769){if(_0x4da769){return _0x958999[_0xf323('0x17')](_0x44e0ce);}return _0x958999[_0xf323('0x18')](_0x44e0ce)[_0xf323('0x19')]();};}function respondWithResult(_0x36f191,_0x3ec7cc){_0x3ec7cc=_0x3ec7cc||0xc8;return function(_0xa5bb2b){if(_0xa5bb2b){return _0x36f191[_0xf323('0x18')](_0x3ec7cc)[_0xf323('0x1a')](_0xa5bb2b);}};}function respondWithFilteredResult(_0x10874c,_0x207788){return function(_0x1a34cc){if(_0x1a34cc){var _0x2d95b9=typeof _0x207788['offset']===_0xf323('0x1b')&&typeof _0x207788[_0xf323('0x1c')]===_0xf323('0x1b');var _0x40e702=_0x1a34cc[_0xf323('0x1d')];var _0x1265fe=_0x2d95b9?0x0:_0x207788['offset'];var _0x326fc6=_0x2d95b9?_0x1a34cc[_0xf323('0x1d')]:_0x207788[_0xf323('0x1e')]+_0x207788[_0xf323('0x1c')];var _0x20af43;if(_0x326fc6>=_0x40e702){_0x326fc6=_0x40e702;_0x20af43=0xc8;}else{_0x20af43=0xce;}_0x10874c[_0xf323('0x18')](_0x20af43);return _0x10874c[_0xf323('0x1f')]('Content-Range',_0x1265fe+'-'+_0x326fc6+'/'+_0x40e702)[_0xf323('0x1a')](_0x1a34cc);}return null;};}function patchUpdates(_0x4d9fc7){return function(_0x2b48ad){try{jsonpatch[_0xf323('0x20')](_0x2b48ad,_0x4d9fc7,!![]);}catch(_0x1003f3){return BPromise['reject'](_0x1003f3);}return _0x2b48ad[_0xf323('0x21')]();};}function saveUpdates(_0x5b0f4b,_0x2852af){return function(_0x1afea9){if(_0x1afea9){return _0x1afea9[_0xf323('0x22')](_0x5b0f4b)[_0xf323('0x23')](function(_0x50f832){return _0x50f832;});}return null;};}function removeEntity(_0x8393e6,_0x52b3bb){return function(_0x5f625b){if(_0x5f625b){return _0x5f625b[_0xf323('0x24')]()[_0xf323('0x23')](function(){_0x8393e6['status'](0xcc)[_0xf323('0x19')]();});}};}function handleEntityNotFound(_0x3fe136,_0x10192f){return function(_0x381b12){if(!_0x381b12){_0x3fe136[_0xf323('0x17')](0x194);}return _0x381b12;};}function handleError(_0x502b33,_0x15874c){_0x15874c=_0x15874c||0x1f4;return function(_0x203425){logger['error'](_0x203425['stack']);if(_0x203425[_0xf323('0x25')]){delete _0x203425[_0xf323('0x25')];}_0x502b33[_0xf323('0x18')](_0x15874c)[_0xf323('0x26')](_0x203425);};}exports[_0xf323('0x22')]=function(_0x2ad963,_0x3813d5){if(_0x2ad963[_0xf323('0x27')]['id']){delete _0x2ad963[_0xf323('0x27')]['id'];}return db[_0xf323('0x28')][_0xf323('0x29')]({'where':{'id':_0x2ad963[_0xf323('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3813d5,null))[_0xf323('0x23')](saveUpdates(_0x2ad963[_0xf323('0x27')],null))[_0xf323('0x23')](respondWithResult(_0x3813d5,null))[_0xf323('0x2b')](handleError(_0x3813d5,null));};exports['destroy']=function(_0x4d0eaf,_0x2eddaa){return db[_0xf323('0x28')][_0xf323('0x29')]({'where':{'id':_0x4d0eaf[_0xf323('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2eddaa,null))['then'](removeEntity(_0x2eddaa,null))[_0xf323('0x2b')](handleError(_0x2eddaa,null));};
\ No newline at end of file
+var _0x8e7d=['params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','body','Action','find'];(function(_0x3c7c43,_0x387074){var _0xb0c939=function(_0xbb87d8){while(--_0xbb87d8){_0x3c7c43['push'](_0x3c7c43['shift']());}};_0xb0c939(++_0x387074);}(_0x8e7d,0x1ce));var _0xd8e7=function(_0x317097,_0x4b8a5c){_0x317097=_0x317097-0x0;var _0x9b917c=_0x8e7d[_0x317097];return _0x9b917c;};'use strict';var emlformat=require(_0xd8e7('0x0'));var rimraf=require(_0xd8e7('0x1'));var zipdir=require(_0xd8e7('0x2'));var jsonpatch=require(_0xd8e7('0x3'));var rp=require(_0xd8e7('0x4'));var moment=require('moment');var BPromise=require(_0xd8e7('0x5'));var Mustache=require(_0xd8e7('0x6'));var util=require(_0xd8e7('0x7'));var path=require('path');var sox=require(_0xd8e7('0x8'));var csv=require(_0xd8e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8e7('0xa'));var _=require(_0xd8e7('0xb'));var squel=require('squel');var crypto=require(_0xd8e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd8e7('0xd'));var toCsv=require(_0xd8e7('0x9'));var querystring=require(_0xd8e7('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8e7('0xf'));var authService=require(_0xd8e7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e7('0x11'));var hardwareService=require(_0xd8e7('0x12'));var logger=require(_0xd8e7('0x13'))(_0xd8e7('0x14'));var utils=require('../../config/utils');var config=require(_0xd8e7('0x15'));var licenseUtil=require(_0xd8e7('0x16'));var db=require(_0xd8e7('0x17'))['db'];function respondWithStatusCode(_0x250887,_0x3d9a83){_0x3d9a83=_0x3d9a83||0xcc;return function(_0x458a78){if(_0x458a78){return _0x250887[_0xd8e7('0x18')](_0x3d9a83);}return _0x250887['status'](_0x3d9a83)[_0xd8e7('0x19')]();};}function respondWithResult(_0x2b7852,_0x261a0e){_0x261a0e=_0x261a0e||0xc8;return function(_0x373f01){if(_0x373f01){return _0x2b7852[_0xd8e7('0x1a')](_0x261a0e)['json'](_0x373f01);}};}function respondWithFilteredResult(_0x42ba06,_0x3e47cd){return function(_0x2f0fe9){if(_0x2f0fe9){var _0x5b66cd=typeof _0x3e47cd['offset']==='undefined'&&typeof _0x3e47cd[_0xd8e7('0x1b')]==='undefined';var _0x2eae48=_0x2f0fe9[_0xd8e7('0x1c')];var _0x21a615=_0x5b66cd?0x0:_0x3e47cd[_0xd8e7('0x1d')];var _0x4a338c=_0x5b66cd?_0x2f0fe9['count']:_0x3e47cd['offset']+_0x3e47cd['limit'];var _0x40a1cc;if(_0x4a338c>=_0x2eae48){_0x4a338c=_0x2eae48;_0x40a1cc=0xc8;}else{_0x40a1cc=0xce;}_0x42ba06[_0xd8e7('0x1a')](_0x40a1cc);return _0x42ba06[_0xd8e7('0x1e')](_0xd8e7('0x1f'),_0x21a615+'-'+_0x4a338c+'/'+_0x2eae48)[_0xd8e7('0x20')](_0x2f0fe9);}return null;};}function patchUpdates(_0x3b7389){return function(_0x1e41b6){try{jsonpatch[_0xd8e7('0x21')](_0x1e41b6,_0x3b7389,!![]);}catch(_0x476531){return BPromise['reject'](_0x476531);}return _0x1e41b6[_0xd8e7('0x22')]();};}function saveUpdates(_0x3d328a,_0x32e475){return function(_0x406e59){if(_0x406e59){return _0x406e59[_0xd8e7('0x23')](_0x3d328a)[_0xd8e7('0x24')](function(_0x3859d4){return _0x3859d4;});}return null;};}function removeEntity(_0x3152db,_0x497b2d){return function(_0x2d5f73){if(_0x2d5f73){return _0x2d5f73[_0xd8e7('0x25')]()[_0xd8e7('0x24')](function(){_0x3152db[_0xd8e7('0x1a')](0xcc)[_0xd8e7('0x19')]();});}};}function handleEntityNotFound(_0x4db2f,_0x10bfa8){return function(_0x269be3){if(!_0x269be3){_0x4db2f[_0xd8e7('0x18')](0x194);}return _0x269be3;};}function handleError(_0x138e6e,_0x4cb8a9){_0x4cb8a9=_0x4cb8a9||0x1f4;return function(_0x50e064){logger['error'](_0x50e064[_0xd8e7('0x26')]);if(_0x50e064[_0xd8e7('0x27')]){delete _0x50e064[_0xd8e7('0x27')];}_0x138e6e['status'](_0x4cb8a9)[_0xd8e7('0x28')](_0x50e064);};}exports[_0xd8e7('0x23')]=function(_0x5e2668,_0x3baf58){if(_0x5e2668[_0xd8e7('0x29')]['id']){delete _0x5e2668[_0xd8e7('0x29')]['id'];}return db[_0xd8e7('0x2a')][_0xd8e7('0x2b')]({'where':{'id':_0x5e2668[_0xd8e7('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3baf58,null))[_0xd8e7('0x24')](saveUpdates(_0x5e2668[_0xd8e7('0x29')],null))[_0xd8e7('0x24')](respondWithResult(_0x3baf58,null))['catch'](handleError(_0x3baf58,null));};exports[_0xd8e7('0x25')]=function(_0xf33e77,_0x5275bb){return db[_0xd8e7('0x2a')][_0xd8e7('0x2b')]({'where':{'id':_0xf33e77[_0xd8e7('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5275bb,null))['then'](removeEntity(_0x5275bb,null))[_0xd8e7('0x2d')](handleError(_0x5275bb,null));};
\ No newline at end of file
index 874603b..518138b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30fc=['moment','request-promise','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x30fc,0xfa));var _0xc30f=function(_0x7629e,_0x40c972){_0x7629e=_0x7629e-0x0;var _0x19569b=_0x30fc[_0x7629e];return _0x19569b;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var logger=require('../../config/logger')(_0xc30f('0x2'));var moment=require(_0xc30f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc30f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc30f('0x5'));var attributes=require(_0xc30f('0x6'));module[_0xc30f('0x7')]=function(_0x3c6fbf,_0x3986b4){return _0x3c6fbf[_0xc30f('0x8')](_0xc30f('0x9'),attributes,{'tableName':_0xc30f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x880e=['moment','bluebird','path','../../config/environment','./action.attributes','Action','lodash','../../config/logger','api'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0x880e,0x180));var _0xe880=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x880e[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0xe880('0x0'));var util=require('util');var logger=require(_0xe880('0x1'))(_0xe880('0x2'));var moment=require(_0xe880('0x3'));var BPromise=require(_0xe880('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe880('0x5'));var rimraf=require('rimraf');var config=require(_0xe880('0x6'));var attributes=require(_0xe880('0x7'));module['exports']=function(_0x26739b,_0x475649){return _0x26739b['define'](_0xe880('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8145a76..10f9692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2a6c47,_0x41f2de){var _0x4bb4c6=function(_0x13936b){while(--_0x13936b){_0x2a6c47['push'](_0x2a6c47['shift']());}};_0x4bb4c6(++_0x41f2de);}(_0xabce,0x103));var _0xeabc=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xabce[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+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(_0x305245,_0x16436){var _0x209d05=function(_0x5a66ba){while(--_0x5a66ba){_0x305245['push'](_0x305245['shift']());}};_0x209d05(++_0x16436);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x49a2f7,_0x1602a3){_0x49a2f7=_0x49a2f7-0x0;var _0x1d015b=_0x7fbe[_0x49a2f7];return _0x1d015b;};'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 3f14bab..cf8616c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f11=['../../config/environment','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x453dac,_0x21c953){var _0x4a9ebe=function(_0x1dd612){while(--_0x1dd612){_0x453dac['push'](_0x453dac['shift']());}};_0x4a9ebe(++_0x21c953);}(_0x6f11,0xd8));var _0x16f1=function(_0x2613b7,_0x124702){_0x2613b7=_0x2613b7-0x0;var _0x206d3e=_0x6f11[_0x2613b7];return _0x206d3e;};'use strict';var multer=require(_0x16f1('0x0'));var util=require(_0x16f1('0x1'));var path=require(_0x16f1('0x2'));var timeout=require(_0x16f1('0x3'));var express=require(_0x16f1('0x4'));var router=express[_0x16f1('0x5')]();var fs_extra=require(_0x16f1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x16f1('0x7'));var config=require(_0x16f1('0x8'));var controller=require('./action.controller');router['put'](_0x16f1('0x9'),auth[_0x16f1('0xa')](),controller['update']);router[_0x16f1('0xb')](_0x16f1('0x9'),auth[_0x16f1('0xa')](),controller[_0x16f1('0xc')]);module[_0x16f1('0xd')]=router;
\ No newline at end of file
+var _0x2083=['update','delete','isAuthenticated','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x415ccf,_0xe2f752){var _0x5603ad=function(_0x25a03c){while(--_0x25a03c){_0x415ccf['push'](_0x415ccf['shift']());}};_0x5603ad(++_0xe2f752);}(_0x2083,0x1a8));var _0x3208=function(_0x5a8d27,_0x188425){_0x5a8d27=_0x5a8d27-0x0;var _0x52dfa5=_0x2083[_0x5a8d27];return _0x52dfa5;};'use strict';var multer=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));var path=require(_0x3208('0x2'));var timeout=require(_0x3208('0x3'));var express=require(_0x3208('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3208('0x5'));var interaction=require(_0x3208('0x6'));var config=require(_0x3208('0x7'));var controller=require(_0x3208('0x8'));router[_0x3208('0x9')](_0x3208('0xa'),auth['isAuthenticated'](),controller[_0x3208('0xb')]);router[_0x3208('0xc')](_0x3208('0xa'),auth[_0x3208('0xd')](),controller[_0x3208('0xe')]);module['exports']=router;
\ No newline at end of file
index 64b002a..c5021f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0xafc4,0x69));var _0x4afc=function(_0x20663b,_0x56840f){_0x20663b=_0x20663b-0x0;var _0x1f502b=_0xafc4[_0x20663b];return _0x1f502b;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x3d12ef,_0x70f9f7){var _0x44ec06=function(_0x425065){while(--_0x425065){_0x3d12ef['push'](_0x3d12ef['shift']());}};_0x44ec06(++_0x70f9f7);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
index eee8c77..50c12be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b7=['SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','merge','options','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Please\x20insert\x20at\x20least\x20one\x20field','metric','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CustomReports','UserProfileResource','error','stack','name','send','AnalyticCustomReport','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'];(function(_0xac3da1,_0x5e341e){var _0x32992f=function(_0x298f61){while(--_0x298f61){_0xac3da1['push'](_0xac3da1['shift']());}};_0x32992f(++_0x5e341e);}(_0x86b7,0xf2));var _0x786b=function(_0x593b4a,_0x227f70){_0x593b4a=_0x593b4a-0x0;var _0x39aec0=_0x86b7[_0x593b4a];return _0x39aec0;};'use strict';var emlformat=require(_0x786b('0x0'));var rimraf=require(_0x786b('0x1'));var zipdir=require(_0x786b('0x2'));var jsonpatch=require(_0x786b('0x3'));var rp=require(_0x786b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x786b('0x5'));var util=require(_0x786b('0x6'));var path=require('path');var sox=require(_0x786b('0x7'));var csv=require(_0x786b('0x8'));var ejs=require(_0x786b('0x9'));var fs=require('fs');var fs_extra=require(_0x786b('0xa'));var _=require(_0x786b('0xb'));var squel=require('squel');var crypto=require(_0x786b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x786b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x786b('0xe'));var Redis=require('ioredis');var authService=require(_0x786b('0xf'));var qs=require(_0x786b('0x10'));var as=require(_0x786b('0x11'));var hardwareService=require(_0x786b('0x12'));var logger=require('../../config/logger')(_0x786b('0x13'));var utils=require(_0x786b('0x14'));var config=require(_0x786b('0x15'));var licenseUtil=require(_0x786b('0x16'));var db=require(_0x786b('0x17'))['db'];var dbH=require(_0x786b('0x17'))[_0x786b('0x18')];function respondWithStatusCode(_0x43ae4e,_0x2c6a5d){_0x2c6a5d=_0x2c6a5d||0xcc;return function(_0x1d24d3){if(_0x1d24d3){return _0x43ae4e[_0x786b('0x19')](_0x2c6a5d);}return _0x43ae4e['status'](_0x2c6a5d)[_0x786b('0x1a')]();};}function respondWithResult(_0x2a738e,_0x4c454e){_0x4c454e=_0x4c454e||0xc8;return function(_0x53d2b7){if(_0x53d2b7){return _0x2a738e[_0x786b('0x1b')](_0x4c454e)[_0x786b('0x1c')](_0x53d2b7);}};}function respondWithFilteredResult(_0x2e1a2f,_0x459160){return function(_0x47000b){if(_0x47000b){var _0x261e1c=typeof _0x459160[_0x786b('0x1d')]===_0x786b('0x1e')&&typeof _0x459160[_0x786b('0x1f')]==='undefined';var _0xccbec0=_0x47000b[_0x786b('0x20')];var _0x193240=_0x261e1c?0x0:_0x459160[_0x786b('0x1d')];var _0x74828=_0x261e1c?_0x47000b[_0x786b('0x20')]:_0x459160[_0x786b('0x1d')]+_0x459160[_0x786b('0x1f')];var _0x1baee4;if(_0x74828>=_0xccbec0){_0x74828=_0xccbec0;_0x1baee4=0xc8;}else{_0x1baee4=0xce;}_0x2e1a2f[_0x786b('0x1b')](_0x1baee4);return _0x2e1a2f[_0x786b('0x21')](_0x786b('0x22'),_0x193240+'-'+_0x74828+'/'+_0xccbec0)[_0x786b('0x1c')](_0x47000b);}return null;};}function patchUpdates(_0x162b7d){return function(_0x1485ec){try{jsonpatch[_0x786b('0x23')](_0x1485ec,_0x162b7d,!![]);}catch(_0x5053f3){return BPromise[_0x786b('0x24')](_0x5053f3);}return _0x1485ec[_0x786b('0x25')]();};}function saveUpdates(_0x1195b9,_0x41b785){return function(_0x249c4e){if(_0x249c4e){return _0x249c4e[_0x786b('0x26')](_0x1195b9)[_0x786b('0x27')](function(_0x1840d6){return _0x1840d6;});}return null;};}function removeEntity(_0x39090d,_0x162b12){return function(_0x27d985){if(_0x27d985){return _0x27d985['destroy']()[_0x786b('0x27')](function(){var _0x59bf63=_0x27d985[_0x786b('0x28')]({'plain':!![]});var _0x349130=_0x786b('0x29');return db[_0x786b('0x2a')]['destroy']({'where':{'type':_0x349130,'resourceId':_0x59bf63['id']}})[_0x786b('0x27')](function(){return _0x27d985;});})[_0x786b('0x27')](function(){_0x39090d[_0x786b('0x1b')](0xcc)[_0x786b('0x1a')]();});}};}function handleEntityNotFound(_0x180f31,_0x5471a4){return function(_0x456078){if(!_0x456078){_0x180f31[_0x786b('0x19')](0x194);}return _0x456078;};}function handleError(_0x3a7fa9,_0x4edf02){_0x4edf02=_0x4edf02||0x1f4;return function(_0x71f03c){logger[_0x786b('0x2b')](_0x71f03c[_0x786b('0x2c')]);if(_0x71f03c[_0x786b('0x2d')]){delete _0x71f03c[_0x786b('0x2d')];}_0x3a7fa9[_0x786b('0x1b')](_0x4edf02)[_0x786b('0x2e')](_0x71f03c);};}exports['index']=function(_0x58a610,_0x451df3){var _0x49dff2={},_0x2013f3={},_0x4718b6={'count':0x0,'rows':[]};var _0x43aef6=_['map'](db[_0x786b('0x2f')]['rawAttributes'],function(_0x7347fe){return{'name':_0x7347fe[_0x786b('0x30')],'type':_0x7347fe[_0x786b('0x31')][_0x786b('0x32')]};});_0x2013f3[_0x786b('0x33')]=_[_0x786b('0x34')](_0x43aef6,'name');_0x2013f3[_0x786b('0x35')]=_[_0x786b('0x36')](_0x58a610[_0x786b('0x35')]);_0x2013f3[_0x786b('0x37')]=_['intersection'](_0x2013f3[_0x786b('0x33')],_0x2013f3[_0x786b('0x35')]);_0x49dff2[_0x786b('0x38')]=_[_0x786b('0x39')](_0x2013f3[_0x786b('0x33')],qs[_0x786b('0x3a')](_0x58a610[_0x786b('0x35')][_0x786b('0x3a')]));_0x49dff2[_0x786b('0x38')]=_0x49dff2[_0x786b('0x38')]['length']?_0x49dff2[_0x786b('0x38')]:_0x2013f3[_0x786b('0x33')];if(!_0x58a610[_0x786b('0x35')][_0x786b('0x3b')](_0x786b('0x3c'))){_0x49dff2[_0x786b('0x1f')]=qs[_0x786b('0x1f')](_0x58a610[_0x786b('0x35')][_0x786b('0x1f')]);_0x49dff2[_0x786b('0x1d')]=qs[_0x786b('0x1d')](_0x58a610['query'][_0x786b('0x1d')]);}_0x49dff2[_0x786b('0x3d')]=qs[_0x786b('0x3e')](_0x58a610[_0x786b('0x35')][_0x786b('0x3e')]);_0x49dff2[_0x786b('0x3f')]=qs[_0x786b('0x37')](_['pick'](_0x58a610[_0x786b('0x35')],_0x2013f3[_0x786b('0x37')]),_0x43aef6);if(_0x58a610[_0x786b('0x35')][_0x786b('0x40')]){_0x49dff2[_0x786b('0x3f')]=_['merge'](_0x49dff2[_0x786b('0x3f')],{'$or':_['map'](_0x43aef6,function(_0x55500b){if(_0x55500b[_0x786b('0x31')]!==_0x786b('0x41')){var _0x19bcb0={};_0x19bcb0[_0x55500b[_0x786b('0x2d')]]={'$like':'%'+_0x58a610['query'][_0x786b('0x40')]+'%'};return _0x19bcb0;}})});}_0x49dff2=_['merge']({},_0x49dff2,_0x58a610['options']);var _0x2b853c={'where':_0x49dff2[_0x786b('0x3f')]};return db['AnalyticCustomReport'][_0x786b('0x20')](_0x2b853c)[_0x786b('0x27')](function(_0x45e4bd){_0x4718b6['count']=_0x45e4bd;if(_0x58a610[_0x786b('0x35')][_0x786b('0x42')]){_0x49dff2[_0x786b('0x43')]=[{'all':!![]}];}return db[_0x786b('0x2f')]['findAll'](_0x49dff2);})[_0x786b('0x27')](function(_0x2c33d7){_0x4718b6['rows']=_0x2c33d7;return _0x4718b6;})[_0x786b('0x27')](respondWithFilteredResult(_0x451df3,_0x49dff2))['catch'](handleError(_0x451df3,null));};exports[_0x786b('0x44')]=function(_0x35ab77,_0x4f4083){var _0x1ad0c3={'raw':![],'where':{'id':_0x35ab77[_0x786b('0x45')]['id']}},_0x1d6a0e={};_0x1d6a0e[_0x786b('0x33')]=_['keys'](db[_0x786b('0x2f')]['rawAttributes']);_0x1d6a0e['query']=_[_0x786b('0x36')](_0x35ab77[_0x786b('0x35')]);_0x1d6a0e[_0x786b('0x37')]=_[_0x786b('0x39')](_0x1d6a0e[_0x786b('0x33')],_0x1d6a0e[_0x786b('0x35')]);_0x1ad0c3[_0x786b('0x38')]=_[_0x786b('0x39')](_0x1d6a0e[_0x786b('0x33')],qs[_0x786b('0x3a')](_0x35ab77[_0x786b('0x35')][_0x786b('0x3a')]));_0x1ad0c3[_0x786b('0x38')]=_0x1ad0c3['attributes'][_0x786b('0x46')]?_0x1ad0c3[_0x786b('0x38')]:_0x1d6a0e[_0x786b('0x33')];if(_0x35ab77['query'][_0x786b('0x42')]){_0x1ad0c3[_0x786b('0x43')]=[{'all':!![]}];}_0x1ad0c3=_['merge']({},_0x1ad0c3,_0x35ab77['options']);return db[_0x786b('0x2f')][_0x786b('0x47')](_0x1ad0c3)[_0x786b('0x27')](handleEntityNotFound(_0x4f4083,null))[_0x786b('0x27')](respondWithResult(_0x4f4083,null))['catch'](handleError(_0x4f4083,null));};exports[_0x786b('0x48')]=function(_0x4356ff,_0x3e73c0){return db[_0x786b('0x2f')]['create'](_0x4356ff[_0x786b('0x49')],{})[_0x786b('0x27')](function(_0x412a9c){var _0x514774=_0x4356ff[_0x786b('0x4a')][_0x786b('0x28')]({'plain':!![]});if(!_0x514774)throw new Error(_0x786b('0x4b'));if(_0x514774[_0x786b('0x4c')]==='user'){var _0x11a486=_0x412a9c[_0x786b('0x28')]({'plain':!![]});var _0x8b9dbf=_0x786b('0x4d');return db[_0x786b('0x4e')]['find']({'where':{'name':_0x8b9dbf,'userProfileId':_0x514774['userProfileId']},'raw':!![]})[_0x786b('0x27')](function(_0xda3a05){if(_0xda3a05&&_0xda3a05[_0x786b('0x4f')]===0x0){return db[_0x786b('0x2a')]['create']({'name':_0x11a486['name'],'resourceId':_0x11a486['id'],'type':_0x786b('0x29'),'sectionId':_0xda3a05['id']},{})[_0x786b('0x27')](function(){return _0x412a9c;});}else{return _0x412a9c;}})[_0x786b('0x50')](function(_0x45a7d4){logger['error'](_0x786b('0x51'),_0x45a7d4);throw _0x45a7d4;});}return _0x412a9c;})[_0x786b('0x27')](respondWithResult(_0x3e73c0,0xc9))[_0x786b('0x50')](handleError(_0x3e73c0,null));};exports['update']=function(_0x455eb8,_0x11e5c7){if(_0x455eb8[_0x786b('0x49')]['id']){delete _0x455eb8['body']['id'];}return db['AnalyticCustomReport'][_0x786b('0x47')]({'where':{'id':_0x455eb8['params']['id']}})['then'](handleEntityNotFound(_0x11e5c7,null))[_0x786b('0x27')](saveUpdates(_0x455eb8[_0x786b('0x49')],null))[_0x786b('0x27')](respondWithResult(_0x11e5c7,null))['catch'](handleError(_0x11e5c7,null));};exports[_0x786b('0x52')]=function(_0x43fc36,_0x454f1d){return db[_0x786b('0x2f')][_0x786b('0x47')]({'where':{'id':_0x43fc36[_0x786b('0x45')]['id']}})['then'](handleEntityNotFound(_0x454f1d,null))[_0x786b('0x27')](removeEntity(_0x454f1d,null))['catch'](handleError(_0x454f1d,null));};exports[_0x786b('0x53')]=function(_0xab1cde,_0x4285fb){var _0x25e764=0xa;var _0x1b608d=[_0x786b('0x54'),_0x786b('0x55'),_0x786b('0x56'),_0x786b('0x57')];var _0x2e2782={'SUM':_0x786b('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x786b('0x59'),'MAX':_0x786b('0x5a'),'MIN':_0x786b('0x5b'),'AVG':_0x786b('0x5c'),'GROUP_CONCAT':_0x786b('0x5d'),'GROUP_CONCAT ASC':_0x786b('0x5e'),'GROUP_CONCAT DESC':_0x786b('0x5f')};var _0x4a25c8={'SEC_TO_TIME':_0x786b('0x60'),'DATE':'DATE(%s)','HOUR':_0x786b('0x61'),'ROUND':_0x786b('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5f2aaf=function(_0x1d2d2d){return!_[_0x786b('0x63')]([_0x786b('0x64'),_0x786b('0x65'),_0x786b('0x66'),'IS\x20NOT\x20EMPTY'],_0x1d2d2d);};var _0x1be7a1=function(_0x51ca24){if(!_0x51ca24||!_0x51ca24['rules'][_0x786b('0x46')]){return'';}for(var _0xec13a4='(',_0x59d109=0x0;_0x59d109<_0x51ca24[_0x786b('0x67')][_0x786b('0x46')];_0x59d109+=0x1){_0x59d109>0x0&&(_0xec13a4+='\x20'+_0x51ca24['operator']+'\x20');_0xec13a4+=_0x51ca24[_0x786b('0x67')][_0x59d109][_0x786b('0x68')]?_0x1be7a1(_0x51ca24[_0x786b('0x67')][_0x59d109][_0x786b('0x68')]):_0x51ca24[_0x786b('0x67')][_0x59d109]['field']+'\x20'+_0x51ca24[_0x786b('0x67')][_0x59d109][_0x786b('0x69')]+(_0x5f2aaf(_0x51ca24[_0x786b('0x67')][_0x59d109]['condition'])?'\x20'+_0x51ca24[_0x786b('0x67')][_0x59d109][_0x786b('0x6a')]:'');}return _0xec13a4+')';};var _0x5a0859={'where':{'id':_0xab1cde[_0x786b('0x45')]['id']}},_0x3567d8,_0x29c6c4,_0x45d4b0,_0x1bbfc2,_0x12babb;_0x5a0859=_[_0x786b('0x6b')]({},_0x5a0859,_0xab1cde[_0x786b('0x6c')]);return db[_0x786b('0x2f')][_0x786b('0x47')](_0x5a0859)['then'](function(_0x3f5285){if(_0x3f5285){_0x3567d8=_0x3f5285;return _0x3f5285[_0x786b('0x6d')]();}return null;})[_0x786b('0x27')](function(_0x5da0f3){if(_0x5da0f3){if(!_0x5da0f3[_0x786b('0x46')]){throw new db[(_0x786b('0x6e'))][(_0x786b('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x29c6c4=_0x5da0f3;return db[_0x786b('0x70')][_0x786b('0x71')]({'raw':!![]});}return null;})[_0x786b('0x27')](function(_0x22ae35){if(_0x22ae35){_0x45d4b0=_[_0x786b('0x72')](_0x22ae35,'id');var _0x132c11;var _0x3dad5a=squel[_0x786b('0x73')]();_0x3dad5a[_0x786b('0x74')](_0x3567d8[_0x786b('0x75')]);for(var _0x3016a0=0x0;_0x3016a0<_0x29c6c4['length'];_0x3016a0+=0x1){_0x132c11=_0x29c6c4[_0x3016a0][_0x786b('0x76')]?_0x45d4b0[_0x29c6c4[_0x3016a0][_0x786b('0x76')]]['metric']:_0x29c6c4[_0x3016a0][_0x786b('0x77')];_0x132c11=_0x29c6c4[_0x3016a0][_0x786b('0x78')]?_[_0x786b('0x79')](_0x2e2782[_0x29c6c4[_0x3016a0][_0x786b('0x78')]],'%s',_0x132c11):_0x132c11;_0x132c11=_0x29c6c4[_0x3016a0][_0x786b('0x7a')]?_[_0x786b('0x79')](_0x4a25c8[_0x29c6c4[_0x3016a0][_0x786b('0x7a')]],'%s',_0x132c11):_0x132c11;if(_0x29c6c4[_0x3016a0][_0x786b('0x7b')]){_0x3dad5a[_0x786b('0x68')](_0x132c11);}_0x29c6c4[_0x3016a0][_0x786b('0x7c')]&&_0x3dad5a[_0x786b('0x3d')](_0x132c11,_0x29c6c4[_0x3016a0][_0x786b('0x7c')]===_0x786b('0x7d')?![]:!![]);_0x3dad5a[_0x786b('0x77')](_0x132c11,_0x29c6c4[_0x3016a0][_0x786b('0x7e')]||_0x132c11);}if(_0x3567d8['joins']){_0x3567d8[_0x786b('0x7f')]=JSON['parse'](_0x3567d8[_0x786b('0x7f')]);for(var _0x5c5280=0x0;_0x5c5280<_0x3567d8[_0x786b('0x7f')][_0x786b('0x46')];_0x5c5280+=0x1){if(_0x3567d8[_0x786b('0x7f')][_0x5c5280][_0x786b('0x31')]&&_['includes'](_0x1b608d,_0x3567d8['joins'][_0x5c5280]['type'])&&_0x3567d8[_0x786b('0x7f')][_0x5c5280][_0x786b('0x80')]&&_0x3567d8[_0x786b('0x7f')][_0x5c5280]['foreignTable']&&_0x3567d8['joins'][_0x5c5280][_0x786b('0x81')]){_0x3dad5a[_0x3567d8[_0x786b('0x7f')][_0x5c5280][_0x786b('0x31')]](_0x3567d8[_0x786b('0x7f')][_0x5c5280][_0x786b('0x82')],null,util[_0x786b('0x7a')](_0x786b('0x83'),_0x3567d8[_0x786b('0x75')],_0x3567d8[_0x786b('0x7f')][_0x5c5280][_0x786b('0x80')],_0x3567d8['joins'][_0x5c5280][_0x786b('0x82')],_0x3567d8['joins'][_0x5c5280]['foreignKey']));}}}if(_0x3567d8[_0x786b('0x84')]){_0x3567d8[_0x786b('0x84')]=JSON[_0x786b('0x85')](_0x3567d8[_0x786b('0x84')]);_0x3dad5a[_0x786b('0x3f')](_0x1be7a1(_0x3567d8[_0x786b('0x84')]['group']));}_0x12babb=_0x3dad5a[_0x786b('0x86')]();_0x3dad5a['limit'](_0x25e764);_0x3dad5a[_0x786b('0x1d')](0x0);logger[_0x786b('0x87')](_0x786b('0x88'),_0x3dad5a[_0x786b('0x89')]());return dbH['sequelize'][_0x786b('0x35')](_0x3dad5a[_0x786b('0x89')](),{'type':dbH[_0x786b('0x8a')][_0x786b('0x8b')][_0x786b('0x8c')]});}})[_0x786b('0x27')](respondWithResult(_0x4285fb,null))['catch'](handleError(_0x4285fb,null));};function runReport(_0x30b013,_0x212ccc,_0x18ceee){var _0x122311=_0x212ccc[_0x786b('0x2d')];var _0x691828=0xa;var _0x485159=[_0x786b('0x54'),_0x786b('0x55'),_0x786b('0x56'),_0x786b('0x57')];var _0x352cd4={'SUM':_0x786b('0x58'),'COUNT':_0x786b('0x8d'),'COUNT DISTINCT':_0x786b('0x59'),'MAX':_0x786b('0x5a'),'MIN':_0x786b('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x786b('0x5d'),'GROUP_CONCAT ASC':_0x786b('0x5e'),'GROUP_CONCAT DESC':_0x786b('0x5f')};var _0x14a7a7={'SEC_TO_TIME':_0x786b('0x60'),'DATE':_0x786b('0x8e'),'HOUR':_0x786b('0x61'),'ROUND':_0x786b('0x62'),'UNIX_TIMESTAMP':_0x786b('0x8f')};var _0x22db5e=function(_0x4940e5){return!_['includes']([_0x786b('0x64'),_0x786b('0x65'),_0x786b('0x66'),_0x786b('0x90')],_0x4940e5);};var _0x2c7571=function(_0x5503ad){if(!_0x5503ad||!_0x5503ad[_0x786b('0x67')]['length']){return'';}for(var _0x5e3488='(',_0x2b986b=0x0;_0x2b986b<_0x5503ad[_0x786b('0x67')][_0x786b('0x46')];_0x2b986b+=0x1){_0x2b986b>0x0&&(_0x5e3488+='\x20'+_0x5503ad[_0x786b('0x91')]+'\x20');_0x5e3488+=_0x5503ad[_0x786b('0x67')][_0x2b986b][_0x786b('0x68')]?_0x2c7571(_0x5503ad[_0x786b('0x67')][_0x2b986b][_0x786b('0x68')]):_0x5503ad[_0x786b('0x67')][_0x2b986b]['field']+'\x20'+_0x5503ad[_0x786b('0x67')][_0x2b986b][_0x786b('0x69')]+(_0x22db5e(_0x5503ad['rules'][_0x2b986b][_0x786b('0x69')])?'\x20'+_0x5503ad[_0x786b('0x67')][_0x2b986b][_0x786b('0x6a')]:'');}return _0x5e3488+')';};var _0x4779a6={'where':{'id':_0x30b013['id']}},_0x5ecd99,_0x4832de,_0x447579,_0x2abe5c,_0x22cd8e;_0x4779a6=_[_0x786b('0x6b')]({},_0x4779a6,_0x18ceee);return db[_0x786b('0x2f')][_0x786b('0x47')](_0x4779a6)[_0x786b('0x27')](function(_0x3ac7d6){if(_0x3ac7d6){_0x5ecd99=_0x3ac7d6;return _0x3ac7d6[_0x786b('0x6d')]();}return null;})[_0x786b('0x27')](function(_0x569163){if(_0x569163){if(!_0x569163[_0x786b('0x46')]){throw new db[(_0x786b('0x6e'))]['ValidationErrorItem'](_0x786b('0x92'),0x193);}_0x4832de=_0x569163;return db[_0x786b('0x70')]['findAll']({'raw':!![]});}return null;})[_0x786b('0x27')](function(_0x2c2be4){if(_0x2c2be4){_0x447579=_['keyBy'](_0x2c2be4,'id');var _0x3ee230;var _0x211720=squel[_0x786b('0x73')]();_0x211720[_0x786b('0x74')](_0x5ecd99['table']);for(var _0x5cea31=0x0;_0x5cea31<_0x4832de[_0x786b('0x46')];_0x5cea31+=0x1){_0x3ee230=_0x4832de[_0x5cea31][_0x786b('0x76')]?_0x447579[_0x4832de[_0x5cea31][_0x786b('0x76')]][_0x786b('0x93')]:_0x4832de[_0x5cea31][_0x786b('0x77')];_0x3ee230=_0x4832de[_0x5cea31][_0x786b('0x78')]?_[_0x786b('0x79')](_0x352cd4[_0x4832de[_0x5cea31]['function']],'%s',_0x3ee230):_0x3ee230;_0x3ee230=_0x4832de[_0x5cea31][_0x786b('0x7a')]?_['replace'](_0x14a7a7[_0x4832de[_0x5cea31][_0x786b('0x7a')]],'%s',_0x3ee230):_0x3ee230;if(_0x4832de[_0x5cea31][_0x786b('0x7b')]){_0x211720['group'](_0x3ee230);}_0x4832de[_0x5cea31][_0x786b('0x7c')]&&_0x211720['order'](_0x3ee230,_0x4832de[_0x5cea31][_0x786b('0x7c')]===_0x786b('0x7d')?![]:!![]);_0x211720[_0x786b('0x77')](_0x3ee230,_0x4832de[_0x5cea31][_0x786b('0x7e')]||_0x3ee230);}if(_0x5ecd99[_0x786b('0x7f')]){_0x5ecd99[_0x786b('0x7f')]=JSON[_0x786b('0x85')](_0x5ecd99[_0x786b('0x7f')]);for(var _0x3c21e3=0x0;_0x3c21e3<_0x5ecd99[_0x786b('0x7f')]['length'];_0x3c21e3+=0x1){if(_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x31')]&&_[_0x786b('0x63')](_0x485159,_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x31')])&&_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x80')]&&_0x5ecd99[_0x786b('0x7f')][_0x3c21e3]['foreignTable']&&_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x81')]){_0x211720[_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x31')]](_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x82')],null,util[_0x786b('0x7a')](_0x786b('0x83'),_0x5ecd99[_0x786b('0x75')],_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x80')],_0x5ecd99[_0x786b('0x7f')][_0x3c21e3]['foreignTable'],_0x5ecd99[_0x786b('0x7f')][_0x3c21e3][_0x786b('0x81')]));}}}if(_0x5ecd99[_0x786b('0x84')]){_0x5ecd99[_0x786b('0x84')]=JSON[_0x786b('0x85')](_0x5ecd99[_0x786b('0x84')]);_0x211720['where'](_0x2c7571(_0x5ecd99[_0x786b('0x84')]['group']));}_0x22cd8e=_0x211720[_0x786b('0x86')]();_0x211720[_0x786b('0x1f')](_0x691828);_0x211720[_0x786b('0x1d')](0x0);return;}})[_0x786b('0x27')](function(){if(_0x212ccc[_0x786b('0x94')]===_0x786b('0x95')){return null;}var _0x31d622=_['merge'](_0x212ccc,{'name':_0x212ccc[_0x786b('0x96')]||_0x212ccc['name']||_0x5ecd99[_0x786b('0x2d')],'basename':_0x122311,'savename':util['format']('%s-%s.%s',_0x212ccc[_0x786b('0x2d')]||_0x5ecd99[_0x786b('0x2d')],require(_0x786b('0x97'))[_0x786b('0x98')](0x4),_0x212ccc['output']||_0x786b('0x99')),'reportId':_0x5ecd99['id'],'reportType':'custom'});return db[_0x786b('0x9a')]['create'](_0x31d622,{'raw':!![]});})[_0x786b('0x27')](function(_0x5408fb){if(_0x5ecd99[_0x786b('0x75')]===_0x786b('0x9b')){_0x22cd8e['where'](_0x5ecd99[_0x786b('0x75')]+_0x786b('0x9c'),_0x212ccc['startDate'],_0x212ccc['endDate']);}else{_0x22cd8e[_0x786b('0x3f')](_0x5ecd99[_0x786b('0x75')]+_0x786b('0x9d'),_0x212ccc[_0x786b('0x9e')],_0x212ccc[_0x786b('0x9f')]);}if(_0x5408fb){logger[_0x786b('0xa0')](_0x786b('0xa1'),_0x22cd8e[_0x786b('0x89')]());require(_0x786b('0xa2'))['fork'](path['join'](__dirname,_0x786b('0xa3'),_0x5408fb[_0x786b('0x94')]),[_0x5408fb['id'],_0x22cd8e[_0x786b('0x89')](),path[_0x786b('0x54')](__dirname,_0x786b('0xa4'),_0x5408fb[_0x786b('0xa5')]),_0x122311]);return _0x5408fb;}else{var _0xb9d638=squel[_0x786b('0x73')]();_0xb9d638[_0x786b('0x74')]('('+_0x22cd8e['toString']()+')',_0x786b('0xa6'));_0xb9d638[_0x786b('0x77')](_0x786b('0xa7'),_0x786b('0x20'));_0x22cd8e[_0x786b('0x1f')](_0x212ccc['limit']||_0x691828);_0x22cd8e[_0x786b('0x1d')](_0x212ccc[_0x786b('0x1d')]||0x0);return dbH[_0x786b('0x8a')][_0x786b('0x35')](_0xb9d638[_0x786b('0x89')](),{'type':dbH[_0x786b('0x8a')][_0x786b('0x8b')][_0x786b('0x8c')]})[_0x786b('0x27')](function(_0x4204e2){if(!_0x4204e2[_0x786b('0x46')]){_0x2abe5c=0x0;}else{_0x2abe5c=_0x4204e2[0x0][_0x786b('0x20')]||0x0;}return dbH[_0x786b('0x8a')][_0x786b('0x35')](_0x22cd8e['toString'](),{'type':dbH[_0x786b('0x8a')][_0x786b('0x8b')][_0x786b('0x8c')]});})['then'](function(_0x236085){return{'rows':_0x236085||[],'count':_0x2abe5c};});}});}exports['run']=function(_0x32c10e,_0x49846c){return runReport(_0x32c10e[_0x786b('0x45')],_0x32c10e[_0x786b('0x35')],_0x32c10e['options'])['then'](respondWithResult(_0x49846c,null))[_0x786b('0x50')](handleError(_0x49846c,null));};exports[_0x786b('0xa8')]=runReport;exports[_0x786b('0x35')]=function(_0x19d0d4,_0x5add65){var _0x524ccb=0xa;var _0x1d0605=[_0x786b('0x54'),_0x786b('0x55'),_0x786b('0x56'),_0x786b('0x57')];var _0x4423d0={'SUM':'SUM(%s)','COUNT':_0x786b('0x8d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x786b('0x5a'),'MIN':'MIN(%s)','AVG':_0x786b('0x5c'),'GROUP_CONCAT':_0x786b('0x5d'),'GROUP_CONCAT ASC':_0x786b('0x5e'),'GROUP_CONCAT DESC':_0x786b('0x5f')};var _0x443bfa={'SEC_TO_TIME':_0x786b('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x786b('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4ef421=function(_0xea6c72){return!_[_0x786b('0x63')]([_0x786b('0x64'),_0x786b('0x65'),_0x786b('0x66'),_0x786b('0x90')],_0xea6c72);};var _0x89e75b=function(_0x5896b9){if(!_0x5896b9||!_0x5896b9['rules'][_0x786b('0x46')]){return'';}for(var _0x3bd539='(',_0x2fc8eb=0x0;_0x2fc8eb<_0x5896b9[_0x786b('0x67')][_0x786b('0x46')];_0x2fc8eb+=0x1){_0x2fc8eb>0x0&&(_0x3bd539+='\x20'+_0x5896b9[_0x786b('0x91')]+'\x20');_0x3bd539+=_0x5896b9[_0x786b('0x67')][_0x2fc8eb]['group']?_0x89e75b(_0x5896b9[_0x786b('0x67')][_0x2fc8eb]['group']):_0x5896b9[_0x786b('0x67')][_0x2fc8eb][_0x786b('0x77')]+'\x20'+_0x5896b9[_0x786b('0x67')][_0x2fc8eb][_0x786b('0x69')]+(_0x4ef421(_0x5896b9[_0x786b('0x67')][_0x2fc8eb][_0x786b('0x69')])?'\x20'+_0x5896b9[_0x786b('0x67')][_0x2fc8eb]['value']:'');}return _0x3bd539+')';};var _0x115c1d={'where':{'id':_0x19d0d4[_0x786b('0x45')]['id']}},_0x151b5d,_0x3e163a,_0x1375d1,_0x4df175,_0x313fd2;_0x115c1d=_['merge']({},_0x115c1d,_0x19d0d4[_0x786b('0x6c')]);return db[_0x786b('0x2f')][_0x786b('0x47')](_0x115c1d)[_0x786b('0x27')](function(_0xe5cb9a){if(_0xe5cb9a){_0x151b5d=_0xe5cb9a;return _0xe5cb9a[_0x786b('0x6d')]();}return null;})[_0x786b('0x27')](function(_0x45cd37){if(_0x45cd37){if(!_0x45cd37[_0x786b('0x46')]){throw new db[(_0x786b('0x6e'))][(_0x786b('0x6f'))](_0x786b('0x92'),0x193);}_0x3e163a=_0x45cd37;return db[_0x786b('0x70')][_0x786b('0x71')]({'raw':!![]});}return null;})[_0x786b('0x27')](function(_0x4ab96c){if(_0x4ab96c){_0x1375d1=_[_0x786b('0x72')](_0x4ab96c,'id');var _0x593c47;var _0x53a3e5=squel[_0x786b('0x73')]();_0x53a3e5[_0x786b('0x74')](_0x151b5d[_0x786b('0x75')]);for(var _0x168713=0x0;_0x168713<_0x3e163a[_0x786b('0x46')];_0x168713+=0x1){_0x593c47=_0x3e163a[_0x168713]['MetricId']?_0x1375d1[_0x3e163a[_0x168713]['MetricId']][_0x786b('0x93')]:_0x3e163a[_0x168713][_0x786b('0x77')];_0x593c47=_0x3e163a[_0x168713][_0x786b('0x78')]?_['replace'](_0x4423d0[_0x3e163a[_0x168713]['function']],'%s',_0x593c47):_0x593c47;_0x593c47=_0x3e163a[_0x168713]['format']?_[_0x786b('0x79')](_0x443bfa[_0x3e163a[_0x168713]['format']],'%s',_0x593c47):_0x593c47;if(_0x3e163a[_0x168713][_0x786b('0x7b')]){_0x53a3e5[_0x786b('0x68')](_0x593c47);}_0x3e163a[_0x168713]['orderBy']&&_0x53a3e5[_0x786b('0x3d')](_0x593c47,_0x3e163a[_0x168713][_0x786b('0x7c')]===_0x786b('0x7d')?![]:!![]);_0x53a3e5[_0x786b('0x77')](_0x593c47,_0x3e163a[_0x168713][_0x786b('0x7e')]||_0x593c47);}if(_0x151b5d[_0x786b('0x7f')]){_0x151b5d[_0x786b('0x7f')]=JSON[_0x786b('0x85')](_0x151b5d[_0x786b('0x7f')]);for(var _0x141bc1=0x0;_0x141bc1<_0x151b5d[_0x786b('0x7f')]['length'];_0x141bc1+=0x1){if(_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x31')]&&_[_0x786b('0x63')](_0x1d0605,_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x31')])&&_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x80')]&&_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x82')]&&_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x81')]){_0x53a3e5[_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x31')]](_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x82')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x151b5d[_0x786b('0x75')],_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x80')],_0x151b5d[_0x786b('0x7f')][_0x141bc1][_0x786b('0x82')],_0x151b5d[_0x786b('0x7f')][_0x141bc1]['foreignKey']));}}}if(_0x151b5d[_0x786b('0x84')]){_0x151b5d[_0x786b('0x84')]=JSON[_0x786b('0x85')](_0x151b5d[_0x786b('0x84')]);_0x53a3e5[_0x786b('0x3f')](_0x89e75b(_0x151b5d[_0x786b('0x84')][_0x786b('0x68')]));}_0x313fd2=_0x53a3e5['clone']();_0x53a3e5[_0x786b('0x1f')](_0x524ccb);_0x53a3e5[_0x786b('0x1d')](0x0);logger[_0x786b('0x87')]('Limited\x20Query:',_0x53a3e5['toString']());return dbH[_0x786b('0x8a')][_0x786b('0x35')](_0x53a3e5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x786b('0x8c')]});}})[_0x786b('0x27')](function(){return{'sql':_0x313fd2[_0x786b('0x89')]()};})[_0x786b('0x27')](respondWithResult(_0x5add65,null))['catch'](handleError(_0x5add65,null));};
\ No newline at end of file
+var _0x23c6=['key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','includeAll','rows','show','include','options','catch','create','user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','function','replace','format','groupBy','DESC','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','MIN(%s)','includes','IS\x20EMPTY','operator','value','ValidationErrorItem','metric','orderBy','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','runReport','IS\x20NULL','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','AnalyticCustomReport','rawAttributes','fieldName','type'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x23c6,0x118));var _0x623c=function(_0x5a29fd,_0x804af5){_0x5a29fd=_0x5a29fd-0x0;var _0x1c60e2=_0x23c6[_0x5a29fd];return _0x1c60e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x623c('0x0'));var zipdir=require(_0x623c('0x1'));var jsonpatch=require(_0x623c('0x2'));var rp=require(_0x623c('0x3'));var moment=require(_0x623c('0x4'));var BPromise=require(_0x623c('0x5'));var Mustache=require(_0x623c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x623c('0x7'));var ejs=require(_0x623c('0x8'));var fs=require('fs');var fs_extra=require(_0x623c('0x9'));var _=require('lodash');var squel=require(_0x623c('0xa'));var crypto=require(_0x623c('0xb'));var jsforce=require(_0x623c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x623c('0x7'));var querystring=require(_0x623c('0xd'));var Papa=require(_0x623c('0xe'));var Redis=require(_0x623c('0xf'));var authService=require(_0x623c('0x10'));var qs=require(_0x623c('0x11'));var as=require(_0x623c('0x12'));var hardwareService=require(_0x623c('0x13'));var logger=require(_0x623c('0x14'))(_0x623c('0x15'));var utils=require(_0x623c('0x16'));var config=require(_0x623c('0x17'));var licenseUtil=require(_0x623c('0x18'));var db=require(_0x623c('0x19'))['db'];var dbH=require(_0x623c('0x19'))['dbH'];function respondWithStatusCode(_0x50e490,_0x262626){_0x262626=_0x262626||0xcc;return function(_0x136b37){if(_0x136b37){return _0x50e490['sendStatus'](_0x262626);}return _0x50e490[_0x623c('0x1a')](_0x262626)['end']();};}function respondWithResult(_0x464adf,_0x332bde){_0x332bde=_0x332bde||0xc8;return function(_0x3e9ba8){if(_0x3e9ba8){return _0x464adf[_0x623c('0x1a')](_0x332bde)['json'](_0x3e9ba8);}};}function respondWithFilteredResult(_0x38794c,_0x4c0e71){return function(_0x243d2a){if(_0x243d2a){var _0x5b4ada=typeof _0x4c0e71[_0x623c('0x1b')]===_0x623c('0x1c')&&typeof _0x4c0e71[_0x623c('0x1d')]===_0x623c('0x1c');var _0x218cf1=_0x243d2a['count'];var _0x16b13f=_0x5b4ada?0x0:_0x4c0e71[_0x623c('0x1b')];var _0x190f9c=_0x5b4ada?_0x243d2a[_0x623c('0x1e')]:_0x4c0e71['offset']+_0x4c0e71[_0x623c('0x1d')];var _0x55b6e6;if(_0x190f9c>=_0x218cf1){_0x190f9c=_0x218cf1;_0x55b6e6=0xc8;}else{_0x55b6e6=0xce;}_0x38794c['status'](_0x55b6e6);return _0x38794c[_0x623c('0x1f')]('Content-Range',_0x16b13f+'-'+_0x190f9c+'/'+_0x218cf1)[_0x623c('0x20')](_0x243d2a);}return null;};}function patchUpdates(_0x4461b8){return function(_0x5733b7){try{jsonpatch[_0x623c('0x21')](_0x5733b7,_0x4461b8,!![]);}catch(_0x98d530){return BPromise[_0x623c('0x22')](_0x98d530);}return _0x5733b7[_0x623c('0x23')]();};}function saveUpdates(_0x4355af,_0x53ee21){return function(_0x13cfaa){if(_0x13cfaa){return _0x13cfaa[_0x623c('0x24')](_0x4355af)[_0x623c('0x25')](function(_0x135585){return _0x135585;});}return null;};}function removeEntity(_0x1acb55,_0x10b663){return function(_0x3fdc45){if(_0x3fdc45){return _0x3fdc45[_0x623c('0x26')]()[_0x623c('0x25')](function(){var _0x47e508=_0x3fdc45[_0x623c('0x27')]({'plain':!![]});var _0x17016b=_0x623c('0x28');return db[_0x623c('0x29')][_0x623c('0x26')]({'where':{'type':_0x17016b,'resourceId':_0x47e508['id']}})['then'](function(){return _0x3fdc45;});})['then'](function(){_0x1acb55[_0x623c('0x1a')](0xcc)[_0x623c('0x2a')]();});}};}function handleEntityNotFound(_0x5ec397,_0x393af5){return function(_0x2117d2){if(!_0x2117d2){_0x5ec397['sendStatus'](0x194);}return _0x2117d2;};}function handleError(_0x4725d8,_0x249895){_0x249895=_0x249895||0x1f4;return function(_0x1e2cf5){logger[_0x623c('0x2b')](_0x1e2cf5[_0x623c('0x2c')]);if(_0x1e2cf5[_0x623c('0x2d')]){delete _0x1e2cf5[_0x623c('0x2d')];}_0x4725d8['status'](_0x249895)['send'](_0x1e2cf5);};}exports['index']=function(_0x4a27f6,_0x37ad36){var _0x2e3ad9={},_0x47edff={},_0x26bd90={'count':0x0,'rows':[]};var _0x51df92=_['map'](db[_0x623c('0x2e')][_0x623c('0x2f')],function(_0x4a0e0c){return{'name':_0x4a0e0c[_0x623c('0x30')],'type':_0x4a0e0c[_0x623c('0x31')][_0x623c('0x32')]};});_0x47edff[_0x623c('0x33')]=_['map'](_0x51df92,_0x623c('0x2d'));_0x47edff[_0x623c('0x34')]=_[_0x623c('0x35')](_0x4a27f6['query']);_0x47edff['filters']=_[_0x623c('0x36')](_0x47edff[_0x623c('0x33')],_0x47edff[_0x623c('0x34')]);_0x2e3ad9['attributes']=_[_0x623c('0x36')](_0x47edff['model'],qs[_0x623c('0x37')](_0x4a27f6['query'][_0x623c('0x37')]));_0x2e3ad9[_0x623c('0x38')]=_0x2e3ad9[_0x623c('0x38')][_0x623c('0x39')]?_0x2e3ad9[_0x623c('0x38')]:_0x47edff['model'];if(!_0x4a27f6[_0x623c('0x34')][_0x623c('0x3a')](_0x623c('0x3b'))){_0x2e3ad9[_0x623c('0x1d')]=qs['limit'](_0x4a27f6['query'][_0x623c('0x1d')]);_0x2e3ad9[_0x623c('0x1b')]=qs['offset'](_0x4a27f6[_0x623c('0x34')]['offset']);}_0x2e3ad9[_0x623c('0x3c')]=qs[_0x623c('0x3d')](_0x4a27f6[_0x623c('0x34')][_0x623c('0x3d')]);_0x2e3ad9[_0x623c('0x3e')]=qs[_0x623c('0x3f')](_[_0x623c('0x40')](_0x4a27f6[_0x623c('0x34')],_0x47edff['filters']),_0x51df92);if(_0x4a27f6[_0x623c('0x34')][_0x623c('0x41')]){_0x2e3ad9[_0x623c('0x3e')]=_[_0x623c('0x42')](_0x2e3ad9[_0x623c('0x3e')],{'$or':_[_0x623c('0x43')](_0x51df92,function(_0x173690){if(_0x173690[_0x623c('0x31')]!=='VIRTUAL'){var _0xd8b4e2={};_0xd8b4e2[_0x173690['name']]={'$like':'%'+_0x4a27f6[_0x623c('0x34')][_0x623c('0x41')]+'%'};return _0xd8b4e2;}})});}_0x2e3ad9=_['merge']({},_0x2e3ad9,_0x4a27f6['options']);var _0x12b377={'where':_0x2e3ad9[_0x623c('0x3e')]};return db[_0x623c('0x2e')][_0x623c('0x1e')](_0x12b377)[_0x623c('0x25')](function(_0x52132c){_0x26bd90[_0x623c('0x1e')]=_0x52132c;if(_0x4a27f6['query'][_0x623c('0x44')]){_0x2e3ad9['include']=[{'all':!![]}];}return db[_0x623c('0x2e')]['findAll'](_0x2e3ad9);})[_0x623c('0x25')](function(_0x3f0a1d){_0x26bd90[_0x623c('0x45')]=_0x3f0a1d;return _0x26bd90;})[_0x623c('0x25')](respondWithFilteredResult(_0x37ad36,_0x2e3ad9))['catch'](handleError(_0x37ad36,null));};exports[_0x623c('0x46')]=function(_0x46251d,_0x276193){var _0xa96730={'raw':![],'where':{'id':_0x46251d['params']['id']}},_0x486dd9={};_0x486dd9[_0x623c('0x33')]=_[_0x623c('0x35')](db[_0x623c('0x2e')][_0x623c('0x2f')]);_0x486dd9[_0x623c('0x34')]=_[_0x623c('0x35')](_0x46251d[_0x623c('0x34')]);_0x486dd9[_0x623c('0x3f')]=_[_0x623c('0x36')](_0x486dd9[_0x623c('0x33')],_0x486dd9[_0x623c('0x34')]);_0xa96730[_0x623c('0x38')]=_[_0x623c('0x36')](_0x486dd9[_0x623c('0x33')],qs['fields'](_0x46251d['query']['fields']));_0xa96730['attributes']=_0xa96730[_0x623c('0x38')][_0x623c('0x39')]?_0xa96730[_0x623c('0x38')]:_0x486dd9[_0x623c('0x33')];if(_0x46251d[_0x623c('0x34')][_0x623c('0x44')]){_0xa96730[_0x623c('0x47')]=[{'all':!![]}];}_0xa96730=_[_0x623c('0x42')]({},_0xa96730,_0x46251d[_0x623c('0x48')]);return db[_0x623c('0x2e')]['find'](_0xa96730)[_0x623c('0x25')](handleEntityNotFound(_0x276193,null))[_0x623c('0x25')](respondWithResult(_0x276193,null))[_0x623c('0x49')](handleError(_0x276193,null));};exports[_0x623c('0x4a')]=function(_0x4cd015,_0x12cc37){return db['AnalyticCustomReport'][_0x623c('0x4a')](_0x4cd015['body'],{})['then'](function(_0x3d9ab2){var _0x1e0ca0=_0x4cd015[_0x623c('0x4b')]['get']({'plain':!![]});if(!_0x1e0ca0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e0ca0[_0x623c('0x4c')]===_0x623c('0x4b')){var _0x231e28=_0x3d9ab2['get']({'plain':!![]});var _0x3de2c2=_0x623c('0x4d');return db[_0x623c('0x4e')][_0x623c('0x4f')]({'where':{'name':_0x3de2c2,'userProfileId':_0x1e0ca0[_0x623c('0x50')]},'raw':!![]})[_0x623c('0x25')](function(_0x57d77b){if(_0x57d77b&&_0x57d77b[_0x623c('0x51')]===0x0){return db['UserProfileResource'][_0x623c('0x4a')]({'name':_0x231e28[_0x623c('0x2d')],'resourceId':_0x231e28['id'],'type':_0x623c('0x28'),'sectionId':_0x57d77b['id']},{})['then'](function(){return _0x3d9ab2;});}else{return _0x3d9ab2;}})[_0x623c('0x49')](function(_0x5ce04d){logger[_0x623c('0x2b')](_0x623c('0x52'),_0x5ce04d);throw _0x5ce04d;});}return _0x3d9ab2;})['then'](respondWithResult(_0x12cc37,0xc9))[_0x623c('0x49')](handleError(_0x12cc37,null));};exports[_0x623c('0x24')]=function(_0x5b73a2,_0x3d336d){if(_0x5b73a2[_0x623c('0x53')]['id']){delete _0x5b73a2['body']['id'];}return db['AnalyticCustomReport'][_0x623c('0x4f')]({'where':{'id':_0x5b73a2[_0x623c('0x54')]['id']}})[_0x623c('0x25')](handleEntityNotFound(_0x3d336d,null))[_0x623c('0x25')](saveUpdates(_0x5b73a2[_0x623c('0x53')],null))[_0x623c('0x25')](respondWithResult(_0x3d336d,null))['catch'](handleError(_0x3d336d,null));};exports[_0x623c('0x26')]=function(_0x27f353,_0x262b29){return db[_0x623c('0x2e')][_0x623c('0x4f')]({'where':{'id':_0x27f353[_0x623c('0x54')]['id']}})[_0x623c('0x25')](handleEntityNotFound(_0x262b29,null))['then'](removeEntity(_0x262b29,null))[_0x623c('0x49')](handleError(_0x262b29,null));};exports[_0x623c('0x55')]=function(_0x45806a,_0x443791){var _0x549aa0=0xa;var _0x1505c0=[_0x623c('0x56'),'left_join',_0x623c('0x57'),_0x623c('0x58')];var _0x3fc1cd={'SUM':_0x623c('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x623c('0x5a'),'MAX':_0x623c('0x5b'),'MIN':'MIN(%s)','AVG':_0x623c('0x5c'),'GROUP_CONCAT':_0x623c('0x5d'),'GROUP_CONCAT ASC':_0x623c('0x5e'),'GROUP_CONCAT DESC':_0x623c('0x5f')};var _0x3ae0ed={'SEC_TO_TIME':_0x623c('0x60'),'DATE':_0x623c('0x61'),'HOUR':_0x623c('0x62'),'ROUND':_0x623c('0x63'),'UNIX_TIMESTAMP':_0x623c('0x64')};var _0x32cd1b=function(_0x11377e){return!_['includes'](['IS\x20NULL',_0x623c('0x65'),'IS\x20EMPTY',_0x623c('0x66')],_0x11377e);};var _0x1c1f19=function(_0x5535f1){if(!_0x5535f1||!_0x5535f1[_0x623c('0x67')][_0x623c('0x39')]){return'';}for(var _0x44c611='(',_0x12d9c0=0x0;_0x12d9c0<_0x5535f1['rules'][_0x623c('0x39')];_0x12d9c0+=0x1){_0x12d9c0>0x0&&(_0x44c611+='\x20'+_0x5535f1['operator']+'\x20');_0x44c611+=_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x68')]?_0x1c1f19(_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x68')]):_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x69')]+'\x20'+_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x6a')]+(_0x32cd1b(_0x5535f1[_0x623c('0x67')][_0x12d9c0][_0x623c('0x6a')])?'\x20'+_0x5535f1[_0x623c('0x67')][_0x12d9c0]['value']:'');}return _0x44c611+')';};var _0x54eae6={'where':{'id':_0x45806a[_0x623c('0x54')]['id']}},_0x25dac9,_0x391757,_0x11e52d,_0xb19406,_0x27df96;_0x54eae6=_['merge']({},_0x54eae6,_0x45806a[_0x623c('0x48')]);return db[_0x623c('0x2e')][_0x623c('0x4f')](_0x54eae6)['then'](function(_0xcffd6f){if(_0xcffd6f){_0x25dac9=_0xcffd6f;return _0xcffd6f[_0x623c('0x6b')]();}return null;})[_0x623c('0x25')](function(_0x1ddee3){if(_0x1ddee3){if(!_0x1ddee3['length']){throw new db[(_0x623c('0x6c'))]['ValidationErrorItem'](_0x623c('0x6d'),0x193);}_0x391757=_0x1ddee3;return db[_0x623c('0x6e')][_0x623c('0x6f')]({'raw':!![]});}return null;})[_0x623c('0x25')](function(_0x50dd1e){if(_0x50dd1e){_0x11e52d=_[_0x623c('0x70')](_0x50dd1e,'id');var _0x108f8a;var _0x1ac25c=squel[_0x623c('0x71')]();_0x1ac25c[_0x623c('0x72')](_0x25dac9[_0x623c('0x73')]);for(var _0x5d5d39=0x0;_0x5d5d39<_0x391757['length'];_0x5d5d39+=0x1){_0x108f8a=_0x391757[_0x5d5d39][_0x623c('0x74')]?_0x11e52d[_0x391757[_0x5d5d39][_0x623c('0x74')]]['metric']:_0x391757[_0x5d5d39][_0x623c('0x69')];_0x108f8a=_0x391757[_0x5d5d39][_0x623c('0x75')]?_['replace'](_0x3fc1cd[_0x391757[_0x5d5d39]['function']],'%s',_0x108f8a):_0x108f8a;_0x108f8a=_0x391757[_0x5d5d39]['format']?_[_0x623c('0x76')](_0x3ae0ed[_0x391757[_0x5d5d39][_0x623c('0x77')]],'%s',_0x108f8a):_0x108f8a;if(_0x391757[_0x5d5d39][_0x623c('0x78')]){_0x1ac25c['group'](_0x108f8a);}_0x391757[_0x5d5d39]['orderBy']&&_0x1ac25c['order'](_0x108f8a,_0x391757[_0x5d5d39]['orderBy']===_0x623c('0x79')?![]:!![]);_0x1ac25c[_0x623c('0x69')](_0x108f8a,_0x391757[_0x5d5d39][_0x623c('0x7a')]||_0x108f8a);}if(_0x25dac9['joins']){_0x25dac9['joins']=JSON[_0x623c('0x7b')](_0x25dac9[_0x623c('0x7c')]);for(var _0x3791bb=0x0;_0x3791bb<_0x25dac9['joins']['length'];_0x3791bb+=0x1){if(_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x31')]&&_['includes'](_0x1505c0,_0x25dac9[_0x623c('0x7c')][_0x3791bb]['type'])&&_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7d')]&&_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7e')]&&_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7f')]){_0x1ac25c[_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x31')]](_0x25dac9[_0x623c('0x7c')][_0x3791bb]['foreignTable'],null,util[_0x623c('0x77')](_0x623c('0x80'),_0x25dac9['table'],_0x25dac9['joins'][_0x3791bb][_0x623c('0x7d')],_0x25dac9['joins'][_0x3791bb][_0x623c('0x7e')],_0x25dac9[_0x623c('0x7c')][_0x3791bb][_0x623c('0x7f')]));}}}if(_0x25dac9[_0x623c('0x81')]){_0x25dac9[_0x623c('0x81')]=JSON[_0x623c('0x7b')](_0x25dac9[_0x623c('0x81')]);_0x1ac25c[_0x623c('0x3e')](_0x1c1f19(_0x25dac9[_0x623c('0x81')]['group']));}_0x27df96=_0x1ac25c[_0x623c('0x82')]();_0x1ac25c['limit'](_0x549aa0);_0x1ac25c[_0x623c('0x1b')](0x0);logger[_0x623c('0x83')](_0x623c('0x84'),_0x1ac25c[_0x623c('0x85')]());return dbH['sequelize'][_0x623c('0x34')](_0x1ac25c[_0x623c('0x85')](),{'type':dbH[_0x623c('0x86')][_0x623c('0x87')][_0x623c('0x88')]});}})[_0x623c('0x25')](respondWithResult(_0x443791,null))[_0x623c('0x49')](handleError(_0x443791,null));};function runReport(_0x5bbca8,_0x40ed23,_0x11e303){var _0x42321d=_0x40ed23['name'];var _0x5d398a=0xa;var _0x3ae76b=['join',_0x623c('0x89'),_0x623c('0x57'),'cross_join'];var _0x805993={'SUM':'SUM(%s)','COUNT':_0x623c('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x623c('0x5b'),'MIN':_0x623c('0x8b'),'AVG':_0x623c('0x5c'),'GROUP_CONCAT':_0x623c('0x5d'),'GROUP_CONCAT ASC':_0x623c('0x5e'),'GROUP_CONCAT DESC':_0x623c('0x5f')};var _0x506458={'SEC_TO_TIME':_0x623c('0x60'),'DATE':_0x623c('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x623c('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x520373=function(_0x5ecd2c){return!_[_0x623c('0x8c')](['IS\x20NULL',_0x623c('0x65'),_0x623c('0x8d'),_0x623c('0x66')],_0x5ecd2c);};var _0x1d0466=function(_0x988a77){if(!_0x988a77||!_0x988a77[_0x623c('0x67')][_0x623c('0x39')]){return'';}for(var _0x1602dc='(',_0x2b9694=0x0;_0x2b9694<_0x988a77['rules']['length'];_0x2b9694+=0x1){_0x2b9694>0x0&&(_0x1602dc+='\x20'+_0x988a77[_0x623c('0x8e')]+'\x20');_0x1602dc+=_0x988a77['rules'][_0x2b9694][_0x623c('0x68')]?_0x1d0466(_0x988a77[_0x623c('0x67')][_0x2b9694][_0x623c('0x68')]):_0x988a77['rules'][_0x2b9694][_0x623c('0x69')]+'\x20'+_0x988a77['rules'][_0x2b9694][_0x623c('0x6a')]+(_0x520373(_0x988a77[_0x623c('0x67')][_0x2b9694][_0x623c('0x6a')])?'\x20'+_0x988a77[_0x623c('0x67')][_0x2b9694][_0x623c('0x8f')]:'');}return _0x1602dc+')';};var _0x4c59c8={'where':{'id':_0x5bbca8['id']}},_0x90418e,_0x363e30,_0x5888ff,_0x28b9c3,_0x13bcd6;_0x4c59c8=_['merge']({},_0x4c59c8,_0x11e303);return db[_0x623c('0x2e')][_0x623c('0x4f')](_0x4c59c8)[_0x623c('0x25')](function(_0x29beff){if(_0x29beff){_0x90418e=_0x29beff;return _0x29beff[_0x623c('0x6b')]();}return null;})[_0x623c('0x25')](function(_0xbf90da){if(_0xbf90da){if(!_0xbf90da[_0x623c('0x39')]){throw new db[(_0x623c('0x6c'))][(_0x623c('0x90'))](_0x623c('0x6d'),0x193);}_0x363e30=_0xbf90da;return db[_0x623c('0x6e')][_0x623c('0x6f')]({'raw':!![]});}return null;})[_0x623c('0x25')](function(_0x1f743e){if(_0x1f743e){_0x5888ff=_[_0x623c('0x70')](_0x1f743e,'id');var _0x2b7f25;var _0x287e87=squel['select']();_0x287e87[_0x623c('0x72')](_0x90418e[_0x623c('0x73')]);for(var _0x38b83c=0x0;_0x38b83c<_0x363e30['length'];_0x38b83c+=0x1){_0x2b7f25=_0x363e30[_0x38b83c][_0x623c('0x74')]?_0x5888ff[_0x363e30[_0x38b83c][_0x623c('0x74')]][_0x623c('0x91')]:_0x363e30[_0x38b83c][_0x623c('0x69')];_0x2b7f25=_0x363e30[_0x38b83c]['function']?_[_0x623c('0x76')](_0x805993[_0x363e30[_0x38b83c][_0x623c('0x75')]],'%s',_0x2b7f25):_0x2b7f25;_0x2b7f25=_0x363e30[_0x38b83c][_0x623c('0x77')]?_[_0x623c('0x76')](_0x506458[_0x363e30[_0x38b83c][_0x623c('0x77')]],'%s',_0x2b7f25):_0x2b7f25;if(_0x363e30[_0x38b83c][_0x623c('0x78')]){_0x287e87['group'](_0x2b7f25);}_0x363e30[_0x38b83c]['orderBy']&&_0x287e87['order'](_0x2b7f25,_0x363e30[_0x38b83c][_0x623c('0x92')]===_0x623c('0x79')?![]:!![]);_0x287e87['field'](_0x2b7f25,_0x363e30[_0x38b83c]['alias']||_0x2b7f25);}if(_0x90418e[_0x623c('0x7c')]){_0x90418e[_0x623c('0x7c')]=JSON[_0x623c('0x7b')](_0x90418e[_0x623c('0x7c')]);for(var _0x412fba=0x0;_0x412fba<_0x90418e[_0x623c('0x7c')]['length'];_0x412fba+=0x1){if(_0x90418e['joins'][_0x412fba][_0x623c('0x31')]&&_[_0x623c('0x8c')](_0x3ae76b,_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x31')])&&_0x90418e[_0x623c('0x7c')][_0x412fba]['parentKey']&&_0x90418e[_0x623c('0x7c')][_0x412fba]['foreignTable']&&_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x7f')]){_0x287e87[_0x90418e['joins'][_0x412fba]['type']](_0x90418e['joins'][_0x412fba][_0x623c('0x7e')],null,util[_0x623c('0x77')](_0x623c('0x80'),_0x90418e[_0x623c('0x73')],_0x90418e['joins'][_0x412fba][_0x623c('0x7d')],_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x7e')],_0x90418e[_0x623c('0x7c')][_0x412fba][_0x623c('0x7f')]));}}}if(_0x90418e[_0x623c('0x81')]){_0x90418e['conditions']=JSON['parse'](_0x90418e[_0x623c('0x81')]);_0x287e87[_0x623c('0x3e')](_0x1d0466(_0x90418e[_0x623c('0x81')][_0x623c('0x68')]));}_0x13bcd6=_0x287e87['clone']();_0x287e87['limit'](_0x5d398a);_0x287e87['offset'](0x0);return;}})[_0x623c('0x25')](function(){if(_0x40ed23[_0x623c('0x93')]===_0x623c('0x94')){return null;}var _0x4a8ae5=_['merge'](_0x40ed23,{'name':_0x40ed23[_0x623c('0x95')]||_0x40ed23['name']||_0x90418e['name'],'basename':_0x42321d,'savename':util['format'](_0x623c('0x96'),_0x40ed23[_0x623c('0x2d')]||_0x90418e[_0x623c('0x2d')],require('randomstring')['generate'](0x4),_0x40ed23[_0x623c('0x93')]||_0x623c('0x97')),'reportId':_0x90418e['id'],'reportType':_0x623c('0x98')});return db[_0x623c('0x99')][_0x623c('0x4a')](_0x4a8ae5,{'raw':!![]});})[_0x623c('0x25')](function(_0x5392ae){if(_0x90418e[_0x623c('0x73')]==='cdr'){_0x13bcd6[_0x623c('0x3e')](_0x90418e[_0x623c('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x40ed23['startDate'],_0x40ed23[_0x623c('0x9a')]);}else{_0x13bcd6['where'](_0x90418e[_0x623c('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x40ed23['startDate'],_0x40ed23[_0x623c('0x9a')]);}if(_0x5392ae){logger[_0x623c('0x9b')](_0x623c('0x9c'),_0x13bcd6['toString']());require(_0x623c('0x9d'))[_0x623c('0x9e')](path['join'](__dirname,_0x623c('0x9f'),_0x5392ae[_0x623c('0x93')]),[_0x5392ae['id'],_0x13bcd6[_0x623c('0x85')](),path[_0x623c('0x56')](__dirname,_0x623c('0xa0'),_0x5392ae[_0x623c('0xa1')]),_0x42321d]);return _0x5392ae;}else{var _0x37eeed=squel['select']();_0x37eeed[_0x623c('0x72')]('('+_0x13bcd6[_0x623c('0x85')]()+')',_0x623c('0xa2'));_0x37eeed['field']('COUNT(*)',_0x623c('0x1e'));_0x13bcd6[_0x623c('0x1d')](_0x40ed23[_0x623c('0x1d')]||_0x5d398a);_0x13bcd6[_0x623c('0x1b')](_0x40ed23[_0x623c('0x1b')]||0x0);return dbH['sequelize'][_0x623c('0x34')](_0x37eeed[_0x623c('0x85')](),{'type':dbH['sequelize'][_0x623c('0x87')]['SELECT']})[_0x623c('0x25')](function(_0x14ab16){if(!_0x14ab16['length']){_0x28b9c3=0x0;}else{_0x28b9c3=_0x14ab16[0x0][_0x623c('0x1e')]||0x0;}return dbH['sequelize'][_0x623c('0x34')](_0x13bcd6[_0x623c('0x85')](),{'type':dbH[_0x623c('0x86')]['QueryTypes'][_0x623c('0x88')]});})[_0x623c('0x25')](function(_0x2c69d1){return{'rows':_0x2c69d1||[],'count':_0x28b9c3};});}});}exports['run']=function(_0x883579,_0x38aaeb){return runReport(_0x883579[_0x623c('0x54')],_0x883579[_0x623c('0x34')],_0x883579[_0x623c('0x48')])['then'](respondWithResult(_0x38aaeb,null))[_0x623c('0x49')](handleError(_0x38aaeb,null));};exports[_0x623c('0xa3')]=runReport;exports[_0x623c('0x34')]=function(_0x1d496f,_0x568b65){var _0x404d99=0xa;var _0x1fde7c=['join',_0x623c('0x89'),'right_join',_0x623c('0x58')];var _0x3b1bf4={'SUM':_0x623c('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x623c('0x5a'),'MAX':_0x623c('0x5b'),'MIN':_0x623c('0x8b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x623c('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x17e56b={'SEC_TO_TIME':_0x623c('0x60'),'DATE':_0x623c('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x623c('0x63'),'UNIX_TIMESTAMP':_0x623c('0x64')};var _0x37038b=function(_0x4b6102){return!_[_0x623c('0x8c')]([_0x623c('0xa4'),_0x623c('0x65'),'IS\x20EMPTY',_0x623c('0x66')],_0x4b6102);};var _0x592bec=function(_0x169108){if(!_0x169108||!_0x169108[_0x623c('0x67')]['length']){return'';}for(var _0x43617f='(',_0x207c1c=0x0;_0x207c1c<_0x169108['rules'][_0x623c('0x39')];_0x207c1c+=0x1){_0x207c1c>0x0&&(_0x43617f+='\x20'+_0x169108['operator']+'\x20');_0x43617f+=_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x68')]?_0x592bec(_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x68')]):_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x69')]+'\x20'+_0x169108['rules'][_0x207c1c][_0x623c('0x6a')]+(_0x37038b(_0x169108[_0x623c('0x67')][_0x207c1c]['condition'])?'\x20'+_0x169108[_0x623c('0x67')][_0x207c1c][_0x623c('0x8f')]:'');}return _0x43617f+')';};var _0x1d5890={'where':{'id':_0x1d496f['params']['id']}},_0x2e54d4,_0x10094c,_0x4b2738,_0x57a449,_0x2bb0e1;_0x1d5890=_[_0x623c('0x42')]({},_0x1d5890,_0x1d496f[_0x623c('0x48')]);return db['AnalyticCustomReport']['find'](_0x1d5890)['then'](function(_0x5acd64){if(_0x5acd64){_0x2e54d4=_0x5acd64;return _0x5acd64['getFields']();}return null;})[_0x623c('0x25')](function(_0x116257){if(_0x116257){if(!_0x116257[_0x623c('0x39')]){throw new db[(_0x623c('0x6c'))][(_0x623c('0x90'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10094c=_0x116257;return db[_0x623c('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x623c('0x25')](function(_0x44fac5){if(_0x44fac5){_0x4b2738=_['keyBy'](_0x44fac5,'id');var _0x4506a2;var _0x17e9cd=squel['select']();_0x17e9cd[_0x623c('0x72')](_0x2e54d4[_0x623c('0x73')]);for(var _0x15983a=0x0;_0x15983a<_0x10094c[_0x623c('0x39')];_0x15983a+=0x1){_0x4506a2=_0x10094c[_0x15983a]['MetricId']?_0x4b2738[_0x10094c[_0x15983a][_0x623c('0x74')]][_0x623c('0x91')]:_0x10094c[_0x15983a][_0x623c('0x69')];_0x4506a2=_0x10094c[_0x15983a]['function']?_[_0x623c('0x76')](_0x3b1bf4[_0x10094c[_0x15983a][_0x623c('0x75')]],'%s',_0x4506a2):_0x4506a2;_0x4506a2=_0x10094c[_0x15983a]['format']?_[_0x623c('0x76')](_0x17e56b[_0x10094c[_0x15983a][_0x623c('0x77')]],'%s',_0x4506a2):_0x4506a2;if(_0x10094c[_0x15983a][_0x623c('0x78')]){_0x17e9cd[_0x623c('0x68')](_0x4506a2);}_0x10094c[_0x15983a][_0x623c('0x92')]&&_0x17e9cd['order'](_0x4506a2,_0x10094c[_0x15983a][_0x623c('0x92')]===_0x623c('0x79')?![]:!![]);_0x17e9cd[_0x623c('0x69')](_0x4506a2,_0x10094c[_0x15983a]['alias']||_0x4506a2);}if(_0x2e54d4['joins']){_0x2e54d4['joins']=JSON[_0x623c('0x7b')](_0x2e54d4[_0x623c('0x7c')]);for(var _0x4fbd10=0x0;_0x4fbd10<_0x2e54d4['joins'][_0x623c('0x39')];_0x4fbd10+=0x1){if(_0x2e54d4[_0x623c('0x7c')][_0x4fbd10]['type']&&_[_0x623c('0x8c')](_0x1fde7c,_0x2e54d4[_0x623c('0x7c')][_0x4fbd10][_0x623c('0x31')])&&_0x2e54d4['joins'][_0x4fbd10]['parentKey']&&_0x2e54d4[_0x623c('0x7c')][_0x4fbd10][_0x623c('0x7e')]&&_0x2e54d4[_0x623c('0x7c')][_0x4fbd10][_0x623c('0x7f')]){_0x17e9cd[_0x2e54d4['joins'][_0x4fbd10][_0x623c('0x31')]](_0x2e54d4['joins'][_0x4fbd10][_0x623c('0x7e')],null,util['format'](_0x623c('0x80'),_0x2e54d4[_0x623c('0x73')],_0x2e54d4['joins'][_0x4fbd10]['parentKey'],_0x2e54d4['joins'][_0x4fbd10]['foreignTable'],_0x2e54d4[_0x623c('0x7c')][_0x4fbd10]['foreignKey']));}}}if(_0x2e54d4['conditions']){_0x2e54d4['conditions']=JSON['parse'](_0x2e54d4[_0x623c('0x81')]);_0x17e9cd[_0x623c('0x3e')](_0x592bec(_0x2e54d4[_0x623c('0x81')][_0x623c('0x68')]));}_0x2bb0e1=_0x17e9cd['clone']();_0x17e9cd['limit'](_0x404d99);_0x17e9cd[_0x623c('0x1b')](0x0);logger[_0x623c('0x83')](_0x623c('0x84'),_0x17e9cd[_0x623c('0x85')]());return dbH[_0x623c('0x86')][_0x623c('0x34')](_0x17e9cd[_0x623c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x623c('0x88')]});}})[_0x623c('0x25')](function(){return{'sql':_0x2bb0e1[_0x623c('0x85')]()};})[_0x623c('0x25')](respondWithResult(_0x568b65,null))[_0x623c('0x49')](handleError(_0x568b65,null));};
\ No newline at end of file
index c4f239e..bc2b2bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7167=['request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','../../config/logger','moment','bluebird'];(function(_0x2aa90f,_0x2bf13c){var _0x51c90d=function(_0x440c2d){while(--_0x440c2d){_0x2aa90f['push'](_0x2aa90f['shift']());}};_0x51c90d(++_0x2bf13c);}(_0x7167,0x189));var _0x7716=function(_0x4d593e,_0x131776){_0x4d593e=_0x4d593e-0x0;var _0x31e2df=_0x7167[_0x4d593e];return _0x31e2df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7716('0x0'))('api');var moment=require(_0x7716('0x1'));var BPromise=require(_0x7716('0x2'));var rp=require(_0x7716('0x3'));var fs=require('fs');var path=require(_0x7716('0x4'));var rimraf=require(_0x7716('0x5'));var config=require('../../config/environment');var attributes=require(_0x7716('0x6'));module[_0x7716('0x7')]=function(_0x449088,_0x5ee1bc){return _0x449088[_0x7716('0x8')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4d2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4d2,0x144));var _0x2c4d=function(_0x5ee6ed,_0xa13bc2){_0x5ee6ed=_0x5ee6ed-0x0;var _0x1177b2=_0xc4d2[_0x5ee6ed];return _0x1177b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c4d('0x0'))(_0x2c4d('0x1'));var moment=require(_0x2c4d('0x2'));var BPromise=require(_0x2c4d('0x3'));var rp=require(_0x2c4d('0x4'));var fs=require('fs');var path=require(_0x2c4d('0x5'));var rimraf=require(_0x2c4d('0x6'));var config=require(_0x2c4d('0x7'));var attributes=require(_0x2c4d('0x8'));module[_0x2c4d('0x9')]=function(_0x308cb5,_0x512542){return _0x308cb5[_0x2c4d('0xa')](_0x2c4d('0xb'),attributes,{'tableName':_0x2c4d('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53b4ec3..bcf362a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaa5=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x44c224,_0x409ecd){var _0x24fba7=function(_0x1cac8f){while(--_0x1cac8f){_0x44c224['push'](_0x44c224['shift']());}};_0x24fba7(++_0x409ecd);}(_0xdaa5,0x65));var _0x5daa=function(_0x50a4df,_0x3cbe3d){_0x50a4df=_0x50a4df-0x0;var _0x4d84a9=_0xdaa5[_0x50a4df];return _0x4d84a9;};'use strict';var _=require(_0x5daa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5daa('0x1'));var rs=require(_0x5daa('0x2'));var fs=require('fs');var Redis=require(_0x5daa('0x3'));var db=require(_0x5daa('0x4'))['db'];var utils=require(_0x5daa('0x5'));var logger=require(_0x5daa('0x6'))('rpc');var config=require(_0x5daa('0x7'));var jayson=require(_0x5daa('0x8'));var client=jayson['client'][_0x5daa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bcbee,_0x5ad4dd,_0x9add0c){return new BPromise(function(_0x410ccf,_0x1cf1cc){return client[_0x5daa('0xa')](_0x1bcbee,_0x9add0c)[_0x5daa('0xb')](function(_0x565fe7){logger[_0x5daa('0xc')](_0x5daa('0xd'),_0x5ad4dd,_0x5daa('0xe'));logger[_0x5daa('0xf')](_0x5daa('0x10'),_0x5ad4dd,_0x5daa('0xe'),JSON[_0x5daa('0x11')](_0x565fe7));if(_0x565fe7[_0x5daa('0x12')]){if(_0x565fe7[_0x5daa('0x12')][_0x5daa('0x13')]===0x1f4){logger[_0x5daa('0x12')](_0x5daa('0xd'),_0x5ad4dd,_0x565fe7[_0x5daa('0x12')][_0x5daa('0x14')]);return _0x1cf1cc(_0x565fe7[_0x5daa('0x12')][_0x5daa('0x14')]);}logger[_0x5daa('0x12')](_0x5daa('0xd'),_0x5ad4dd,_0x565fe7[_0x5daa('0x12')][_0x5daa('0x14')]);return _0x410ccf(_0x565fe7[_0x5daa('0x12')][_0x5daa('0x14')]);}else{logger[_0x5daa('0xc')](_0x5daa('0xd'),_0x5ad4dd,_0x5daa('0xe'));_0x410ccf(_0x565fe7[_0x5daa('0x15')][_0x5daa('0x14')]);}})[_0x5daa('0x16')](function(_0x323e71){logger[_0x5daa('0x12')](_0x5daa('0xd'),_0x5ad4dd,_0x323e71);_0x1cf1cc(_0x323e71);});});}
\ No newline at end of file
+var _0x8de6=['catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x5e9631,_0xc91d9a){var _0x27fc53=function(_0x4991e9){while(--_0x4991e9){_0x5e9631['push'](_0x5e9631['shift']());}};_0x27fc53(++_0xc91d9a);}(_0x8de6,0x19f));var _0x68de=function(_0x18cf8a,_0xcc5571){_0x18cf8a=_0x18cf8a-0x0;var _0x1f13c9=_0x8de6[_0x18cf8a];return _0x1f13c9;};'use strict';var _=require('lodash');var util=require(_0x68de('0x0'));var moment=require(_0x68de('0x1'));var BPromise=require(_0x68de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68de('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x68de('0x4'))(_0x68de('0x5'));var config=require(_0x68de('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1349d2,_0x4b501c,_0x142484){return new BPromise(function(_0x578df6,_0x33aaf1){return client[_0x68de('0x7')](_0x1349d2,_0x142484)[_0x68de('0x8')](function(_0x36cc04){logger['info'](_0x68de('0x9'),_0x4b501c,_0x68de('0xa'));logger['debug'](_0x68de('0xb'),_0x4b501c,_0x68de('0xa'),JSON['stringify'](_0x36cc04));if(_0x36cc04[_0x68de('0xc')]){if(_0x36cc04[_0x68de('0xc')][_0x68de('0xd')]===0x1f4){logger[_0x68de('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b501c,_0x36cc04[_0x68de('0xc')][_0x68de('0xe')]);return _0x33aaf1(_0x36cc04[_0x68de('0xc')]['message']);}logger[_0x68de('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b501c,_0x36cc04['error']['message']);return _0x578df6(_0x36cc04[_0x68de('0xc')][_0x68de('0xe')]);}else{logger[_0x68de('0xf')](_0x68de('0x9'),_0x4b501c,_0x68de('0xa'));_0x578df6(_0x36cc04[_0x68de('0x10')]['message']);}})[_0x68de('0x11')](function(_0x22ce71){logger['error'](_0x68de('0x9'),_0x4b501c,_0x22ce71);_0x33aaf1(_0x22ce71);});});}
\ No newline at end of file
index 17b0402..29d2202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3328=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','put','update'];(function(_0x1e56c7,_0x4e833f){var _0x1a6990=function(_0x245694){while(--_0x245694){_0x1e56c7['push'](_0x1e56c7['shift']());}};_0x1a6990(++_0x4e833f);}(_0x3328,0x10b));var _0x8332=function(_0xa377e2,_0xbd1623){_0xa377e2=_0xa377e2-0x0;var _0x95fff7=_0x3328[_0xa377e2];return _0x95fff7;};'use strict';var multer=require('multer');var util=require(_0x8332('0x0'));var path=require(_0x8332('0x1'));var timeout=require(_0x8332('0x2'));var express=require(_0x8332('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8332('0x4'));var interaction=require(_0x8332('0x5'));var config=require(_0x8332('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x8332('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8332('0x7')](_0x8332('0x8'),auth[_0x8332('0x9')](),controller[_0x8332('0xa')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x8332('0xb')]);router['get'](_0x8332('0xc'),auth['isAuthenticated'](),controller[_0x8332('0xd')]);router[_0x8332('0x7')](_0x8332('0xe'),auth['isAuthenticated'](),controller[_0x8332('0xf')]);router[_0x8332('0x10')]('/',auth[_0x8332('0x9')](),controller['create']);router[_0x8332('0x11')](_0x8332('0x8'),auth['isAuthenticated'](),controller[_0x8332('0x12')]);router[_0x8332('0x13')](_0x8332('0x8'),auth[_0x8332('0x9')](),controller[_0x8332('0x14')]);module[_0x8332('0x15')]=router;
\ No newline at end of file
+var _0x9a16=['multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','create','update','destroy'];(function(_0x296fe2,_0x2257b8){var _0x1a05eb=function(_0x4462db){while(--_0x4462db){_0x296fe2['push'](_0x296fe2['shift']());}};_0x1a05eb(++_0x2257b8);}(_0x9a16,0x1a2));var _0x69a1=function(_0x467843,_0x372b3b){_0x467843=_0x467843-0x0;var _0x9c5ce=_0x9a16[_0x467843];return _0x9c5ce;};'use strict';var multer=require(_0x69a1('0x0'));var util=require('util');var path=require(_0x69a1('0x1'));var timeout=require(_0x69a1('0x2'));var express=require(_0x69a1('0x3'));var router=express[_0x69a1('0x4')]();var fs_extra=require(_0x69a1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x69a1('0x6'));var controller=require(_0x69a1('0x7'));router[_0x69a1('0x8')]('/',auth[_0x69a1('0x9')](),controller[_0x69a1('0xa')]);router[_0x69a1('0x8')](_0x69a1('0xb'),auth[_0x69a1('0x9')](),controller[_0x69a1('0xc')]);router[_0x69a1('0x8')](_0x69a1('0xd'),auth[_0x69a1('0x9')](),controller[_0x69a1('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x69a1('0xf')]);router[_0x69a1('0x8')]('/:id/query',auth[_0x69a1('0x9')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller[_0x69a1('0x10')]);router['put'](_0x69a1('0xb'),auth[_0x69a1('0x9')](),controller[_0x69a1('0x11')]);router['delete'](_0x69a1('0xb'),auth[_0x69a1('0x9')](),controller[_0x69a1('0x12')]);module['exports']=router;
\ No newline at end of file
index 79ce535..8a7f6d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['TEXT','exports','STRING'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0x4819,0xcd));var _0x9481=function(_0x28383d,_0x4c101e){_0x28383d=_0x28383d-0x0;var _0x2e919e=_0x4819[_0x28383d];return _0x2e919e;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x44822c,_0x2288af){var _0x4e57a2=function(_0x5a3d25){while(--_0x5a3d25){_0x44822c['push'](_0x44822c['shift']());}};_0x4e57a2(++_0x2288af);}(_0xd8fb,0x99));var _0xbd8f=function(_0x6191c2,_0x40f384){_0x6191c2=_0x6191c2-0x0;var _0x31dd43=_0xd8fb[_0x6191c2];return _0x31dd43;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
index f084ca0..8594d7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x298d3d,_0x220ba9){var _0x5931e1=function(_0x48fabd){while(--_0x48fabd){_0x298d3d['push'](_0x298d3d['shift']());}};_0x5931e1(++_0x220ba9);}(_0x187d,0x93));var _0xd187=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x187d[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x1ad8c3,_0x451bed){var _0x4043a2=function(_0x4b6a50){while(--_0x4b6a50){_0x1ad8c3['push'](_0x1ad8c3['shift']());}};_0x4043a2(++_0x451bed);}(_0x53ec,0x192));var _0xc53e=function(_0x4727b7,_0x585a61){_0x4727b7=_0x4727b7-0x0;var _0xce9394=_0x53ec[_0x4727b7];return _0xce9394;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
index 8c02def..a422551 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6cb=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0xb6cb,0x1ce));var _0xbb6c=function(_0x323c7e,_0x3d16ec){_0x323c7e=_0x323c7e-0x0;var _0x2b0f72=_0xb6cb[_0x323c7e];return _0x2b0f72;};'use strict';var _=require(_0xbb6c('0x0'));var util=require(_0xbb6c('0x1'));var logger=require(_0xbb6c('0x2'))(_0xbb6c('0x3'));var moment=require(_0xbb6c('0x4'));var BPromise=require(_0xbb6c('0x5'));var rp=require(_0xbb6c('0x6'));var fs=require('fs');var path=require(_0xbb6c('0x7'));var rimraf=require(_0xbb6c('0x8'));var config=require(_0xbb6c('0x9'));var attributes=require(_0xbb6c('0xa'));module['exports']=function(_0xa7182b,_0x467be2){return _0xa7182b[_0xbb6c('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xbb6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x92bb=['define','analytics_default_reports','lodash','util','../../config/logger','api','moment','path','./analyticDefaultReport.attributes','exports'];(function(_0x29510c,_0x554dc6){var _0x43c39f=function(_0x47e9dd){while(--_0x47e9dd){_0x29510c['push'](_0x29510c['shift']());}};_0x43c39f(++_0x554dc6);}(_0x92bb,0x70));var _0xb92b=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x92bb[_0x3ee55a];return _0x581800;};'use strict';var _=require(_0xb92b('0x0'));var util=require(_0xb92b('0x1'));var logger=require(_0xb92b('0x2'))(_0xb92b('0x3'));var moment=require(_0xb92b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb92b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb92b('0x6'));module[_0xb92b('0x7')]=function(_0x2fd9b7,_0x2d376b){return _0x2fd9b7[_0xb92b('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xb92b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bb6a453..9b4b925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae3d=['http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xae3d,0x120));var _0xdae3=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xae3d[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0xdae3('0x0'));var util=require(_0xdae3('0x1'));var moment=require('moment');var BPromise=require(_0xdae3('0x2'));var rs=require(_0xdae3('0x3'));var fs=require('fs');var Redis=require(_0xdae3('0x4'));var db=require(_0xdae3('0x5'))['db'];var utils=require(_0xdae3('0x6'));var logger=require(_0xdae3('0x7'))(_0xdae3('0x8'));var config=require('../../config/environment');var jayson=require(_0xdae3('0x9'));var client=jayson[_0xdae3('0xa')][_0xdae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x278797,_0x29fb61,_0x36dfbc){return new BPromise(function(_0x4aa772,_0x2c06fa){return client[_0xdae3('0xc')](_0x278797,_0x36dfbc)[_0xdae3('0xd')](function(_0x217692){logger[_0xdae3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x29fb61,_0xdae3('0xf'));logger['debug'](_0xdae3('0x10'),_0x29fb61,'request\x20sent',JSON[_0xdae3('0x11')](_0x217692));if(_0x217692[_0xdae3('0x12')]){if(_0x217692['error']['code']===0x1f4){logger[_0xdae3('0x12')](_0xdae3('0x13'),_0x29fb61,_0x217692[_0xdae3('0x12')]['message']);return _0x2c06fa(_0x217692['error'][_0xdae3('0x14')]);}logger[_0xdae3('0x12')](_0xdae3('0x13'),_0x29fb61,_0x217692[_0xdae3('0x12')][_0xdae3('0x14')]);return _0x4aa772(_0x217692[_0xdae3('0x12')][_0xdae3('0x14')]);}else{logger['info'](_0xdae3('0x13'),_0x29fb61,_0xdae3('0xf'));_0x4aa772(_0x217692[_0xdae3('0x15')][_0xdae3('0x14')]);}})[_0xdae3('0x16')](function(_0x18fc44){logger[_0xdae3('0x12')](_0xdae3('0x13'),_0x29fb61,_0x18fc44);_0x2c06fa(_0x18fc44);});});}
\ No newline at end of file
+var _0x9c3a=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x5384b9,_0x535d02){var _0x21bc21=function(_0x2ec201){while(--_0x2ec201){_0x5384b9['push'](_0x5384b9['shift']());}};_0x21bc21(++_0x535d02);}(_0x9c3a,0x1be));var _0xa9c3=function(_0x3053a1,_0x50ecea){_0x3053a1=_0x3053a1-0x0;var _0x3a78a3=_0x9c3a[_0x3053a1];return _0x3a78a3;};'use strict';var _=require(_0xa9c3('0x0'));var util=require('util');var moment=require(_0xa9c3('0x1'));var BPromise=require(_0xa9c3('0x2'));var rs=require(_0xa9c3('0x3'));var fs=require('fs');var Redis=require(_0xa9c3('0x4'));var db=require(_0xa9c3('0x5'))['db'];var utils=require(_0xa9c3('0x6'));var logger=require('../../config/logger')(_0xa9c3('0x7'));var config=require(_0xa9c3('0x8'));var jayson=require(_0xa9c3('0x9'));var client=jayson[_0xa9c3('0xa')][_0xa9c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd4f3,_0xf11c3d,_0x86bed4){return new BPromise(function(_0x29c0d7,_0x335754){return client[_0xa9c3('0xc')](_0x3fd4f3,_0x86bed4)[_0xa9c3('0xd')](function(_0x98cb27){logger[_0xa9c3('0xe')](_0xa9c3('0xf'),_0xf11c3d,_0xa9c3('0x10'));logger['debug'](_0xa9c3('0x11'),_0xf11c3d,_0xa9c3('0x10'),JSON['stringify'](_0x98cb27));if(_0x98cb27[_0xa9c3('0x12')]){if(_0x98cb27[_0xa9c3('0x12')]['code']===0x1f4){logger[_0xa9c3('0x12')](_0xa9c3('0xf'),_0xf11c3d,_0x98cb27[_0xa9c3('0x12')]['message']);return _0x335754(_0x98cb27[_0xa9c3('0x12')]['message']);}logger[_0xa9c3('0x12')](_0xa9c3('0xf'),_0xf11c3d,_0x98cb27[_0xa9c3('0x12')][_0xa9c3('0x13')]);return _0x29c0d7(_0x98cb27[_0xa9c3('0x12')][_0xa9c3('0x13')]);}else{logger[_0xa9c3('0xe')](_0xa9c3('0xf'),_0xf11c3d,_0xa9c3('0x10'));_0x29c0d7(_0x98cb27[_0xa9c3('0x14')][_0xa9c3('0x13')]);}})[_0xa9c3('0x15')](function(_0x46c3ef){logger[_0xa9c3('0x12')](_0xa9c3('0xf'),_0xf11c3d,_0x46c3ef);_0x335754(_0x46c3ef);});});}
\ No newline at end of file
index 45a8c90..c055c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a6=['isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6a6,0x1a6));var _0x6c6a=function(_0x3ee61f,_0x5c0cdc){_0x3ee61f=_0x3ee61f-0x0;var _0x444e74=_0xc6a6[_0x3ee61f];return _0x444e74;};'use strict';var multer=require('multer');var util=require(_0x6c6a('0x0'));var path=require(_0x6c6a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c6a('0x2'));var router=express[_0x6c6a('0x3')]();var fs_extra=require(_0x6c6a('0x4'));var auth=require(_0x6c6a('0x5'));var interaction=require(_0x6c6a('0x6'));var config=require(_0x6c6a('0x7'));var controller=require(_0x6c6a('0x8'));router[_0x6c6a('0x9')]('/',auth[_0x6c6a('0xa')](),controller[_0x6c6a('0xb')]);router[_0x6c6a('0x9')](_0x6c6a('0xc'),auth[_0x6c6a('0xa')](),controller['show']);router[_0x6c6a('0x9')](_0x6c6a('0xd'),auth[_0x6c6a('0xa')](),controller[_0x6c6a('0xe')]);router[_0x6c6a('0x9')](_0x6c6a('0xf'),auth[_0x6c6a('0xa')](),controller['run']);router[_0x6c6a('0x9')](_0x6c6a('0x10'),auth['isAuthenticated'](),controller[_0x6c6a('0x11')]);router[_0x6c6a('0x12')]('/',auth['isAuthenticated'](),controller[_0x6c6a('0x13')]);router[_0x6c6a('0x14')](_0x6c6a('0xc'),auth['isAuthenticated'](),controller[_0x6c6a('0x15')]);router[_0x6c6a('0x16')]('/:id',auth[_0x6c6a('0xa')](),controller['destroy']);module[_0x6c6a('0x17')]=router;
\ No newline at end of file
+var _0x1574=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x1574,0x148));var _0x4157=function(_0x4a5065,_0x4820f7){_0x4a5065=_0x4a5065-0x0;var _0x122c97=_0x1574[_0x4a5065];return _0x122c97;};'use strict';var multer=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var path=require(_0x4157('0x2'));var timeout=require(_0x4157('0x3'));var express=require('express');var router=express[_0x4157('0x4')]();var fs_extra=require(_0x4157('0x5'));var auth=require(_0x4157('0x6'));var interaction=require(_0x4157('0x7'));var config=require(_0x4157('0x8'));var controller=require(_0x4157('0x9'));router[_0x4157('0xa')]('/',auth[_0x4157('0xb')](),controller[_0x4157('0xc')]);router[_0x4157('0xa')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0xe')]);router[_0x4157('0xa')](_0x4157('0xf'),auth['isAuthenticated'](),controller[_0x4157('0x10')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x4157('0x11')]);router[_0x4157('0xa')](_0x4157('0x12'),auth['isAuthenticated'](),controller[_0x4157('0x13')]);router[_0x4157('0x14')]('/',auth[_0x4157('0xb')](),controller[_0x4157('0x15')]);router[_0x4157('0x16')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0x17')]);router[_0x4157('0x18')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0x19')]);module['exports']=router;
\ No newline at end of file
index 7fca5c6..8b9a8c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacfa=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','manual','scheduled','INTEGER'];(function(_0x2825fc,_0x1d128e){var _0x49586f=function(_0x5210b2){while(--_0x5210b2){_0x2825fc['push'](_0x2825fc['shift']());}};_0x49586f(++_0x1d128e);}(_0xacfa,0x1bd));var _0xaacf=function(_0x1a219d,_0x405933){_0x1a219d=_0x1a219d-0x0;var _0x5f133b=_0xacfa[_0x1a219d];return _0x5f133b;};'use strict';var Sequelize=require(_0xaacf('0x0'));var moment=require(_0xaacf('0x1'));module[_0xaacf('0x2')]={'name':{'type':Sequelize[_0xaacf('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xaacf('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xaacf('0x4')](_0xaacf('0x5'),'pdf',_0xaacf('0x6')),'allowNull':![],'defaultValue':_0xaacf('0x5')},'savename':{'type':Sequelize[_0xaacf('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xaacf('0x7')]},'endDate':{'type':Sequelize[_0xaacf('0x7')]},'status':{'type':Sequelize[_0xaacf('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xaacf('0x4')](_0xaacf('0x8'),_0xaacf('0x9')),'allowNull':![],'defaultValue':_0xaacf('0x8')},'reportId':{'type':Sequelize[_0xaacf('0xa')](0xb)[_0xaacf('0xb')]},'reportType':{'type':Sequelize[_0xaacf('0x3')]}};
\ No newline at end of file
+var _0xf463=['STRING','ENUM','csv','xlsx','DATE','Loading','manual','INTEGER','sequelize','moment','exports'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0xf463,0x13c));var _0x3f46=function(_0x471878,_0x593a5a){_0x471878=_0x471878-0x0;var _0x4fd0bf=_0xf463[_0x471878];return _0x4fd0bf;};'use strict';var Sequelize=require(_0x3f46('0x0'));var moment=require(_0x3f46('0x1'));module[_0x3f46('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3f46('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3f46('0x4')](_0x3f46('0x5'),'pdf',_0x3f46('0x6')),'allowNull':![],'defaultValue':_0x3f46('0x5')},'savename':{'type':Sequelize[_0x3f46('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3f46('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x3f46('0x3')],'defaultValue':_0x3f46('0x8')},'type':{'type':Sequelize[_0x3f46('0x4')](_0x3f46('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x3f46('0x9')},'reportId':{'type':Sequelize[_0x3f46('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x3f46('0x3')]}};
\ No newline at end of file
index b1bc27f..84ea0c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b7=['root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0x61b7,0x129));var _0x761b=function(_0x5e2896,_0x10072d){_0x5e2896=_0x5e2896-0x0;var _0x87f900=_0x61b7[_0x5e2896];return _0x87f900;};'use strict';var emlformat=require(_0x761b('0x0'));var rimraf=require(_0x761b('0x1'));var zipdir=require(_0x761b('0x2'));var jsonpatch=require(_0x761b('0x3'));var rp=require(_0x761b('0x4'));var moment=require(_0x761b('0x5'));var BPromise=require(_0x761b('0x6'));var Mustache=require(_0x761b('0x7'));var util=require(_0x761b('0x8'));var path=require(_0x761b('0x9'));var sox=require(_0x761b('0xa'));var csv=require(_0x761b('0xb'));var ejs=require(_0x761b('0xc'));var fs=require('fs');var fs_extra=require(_0x761b('0xd'));var _=require(_0x761b('0xe'));var squel=require(_0x761b('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x761b('0xb'));var querystring=require(_0x761b('0x10'));var Papa=require(_0x761b('0x11'));var Redis=require(_0x761b('0x12'));var authService=require(_0x761b('0x13'));var qs=require(_0x761b('0x14'));var as=require(_0x761b('0x15'));var hardwareService=require(_0x761b('0x16'));var logger=require(_0x761b('0x17'))(_0x761b('0x18'));var utils=require(_0x761b('0x19'));var config=require(_0x761b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x761b('0x1b'))['db'];function respondWithStatusCode(_0x463a5f,_0x29ccf6){_0x29ccf6=_0x29ccf6||0xcc;return function(_0x14e3e7){if(_0x14e3e7){return _0x463a5f[_0x761b('0x1c')](_0x29ccf6);}return _0x463a5f[_0x761b('0x1d')](_0x29ccf6)[_0x761b('0x1e')]();};}function respondWithResult(_0x237bf9,_0x3f6bab){_0x3f6bab=_0x3f6bab||0xc8;return function(_0x3cbc2c){if(_0x3cbc2c){return _0x237bf9[_0x761b('0x1d')](_0x3f6bab)[_0x761b('0x1f')](_0x3cbc2c);}};}function respondWithFilteredResult(_0x35a962,_0x207194){return function(_0x15a937){if(_0x15a937){var _0x24dc5c=typeof _0x207194['offset']===_0x761b('0x20')&&typeof _0x207194[_0x761b('0x21')]===_0x761b('0x20');var _0x474700=_0x15a937['count'];var _0x1a4566=_0x24dc5c?0x0:_0x207194['offset'];var _0x4ff09c=_0x24dc5c?_0x15a937[_0x761b('0x22')]:_0x207194[_0x761b('0x23')]+_0x207194['limit'];var _0x5217d2;if(_0x4ff09c>=_0x474700){_0x4ff09c=_0x474700;_0x5217d2=0xc8;}else{_0x5217d2=0xce;}_0x35a962[_0x761b('0x1d')](_0x5217d2);return _0x35a962['set'](_0x761b('0x24'),_0x1a4566+'-'+_0x4ff09c+'/'+_0x474700)[_0x761b('0x1f')](_0x15a937);}return null;};}function patchUpdates(_0x4f1e5e){return function(_0x1b431f){try{jsonpatch[_0x761b('0x25')](_0x1b431f,_0x4f1e5e,!![]);}catch(_0x321289){return BPromise[_0x761b('0x26')](_0x321289);}return _0x1b431f[_0x761b('0x27')]();};}function saveUpdates(_0x49f4ea,_0x863c7d){return function(_0x250c97){if(_0x250c97){return _0x250c97['update'](_0x49f4ea)[_0x761b('0x28')](function(_0x464443){return _0x464443;});}return null;};}function removeEntity(_0x4191ab,_0x18d32c){return function(_0x286966){if(_0x286966){return _0x286966[_0x761b('0x29')]()[_0x761b('0x28')](function(){var _0x31ed73=_0x286966[_0x761b('0x2a')]({'plain':!![]});var _0x2832af='ExtractedReports';return db[_0x761b('0x2b')]['destroy']({'where':{'type':_0x2832af,'resourceId':_0x31ed73['id']}})[_0x761b('0x28')](function(){return _0x286966;});})[_0x761b('0x28')](function(){_0x4191ab[_0x761b('0x1d')](0xcc)[_0x761b('0x1e')]();});}};}function handleEntityNotFound(_0x29eabf,_0x12f369){return function(_0x1ef480){if(!_0x1ef480){_0x29eabf[_0x761b('0x1c')](0x194);}return _0x1ef480;};}function handleError(_0x95a573,_0x4dcf99){_0x4dcf99=_0x4dcf99||0x1f4;return function(_0x69e93d){logger[_0x761b('0x2c')](_0x69e93d['stack']);if(_0x69e93d[_0x761b('0x2d')]){delete _0x69e93d['name'];}_0x95a573[_0x761b('0x1d')](_0x4dcf99)[_0x761b('0x2e')](_0x69e93d);};}exports['index']=function(_0x16021c,_0x1f9c3e){var _0x19de8b={},_0x10816d={},_0x312251={'count':0x0,'rows':[]};var _0x156005=_[_0x761b('0x2f')](db[_0x761b('0x30')][_0x761b('0x31')],function(_0x1a9cd1){return{'name':_0x1a9cd1[_0x761b('0x32')],'type':_0x1a9cd1[_0x761b('0x33')][_0x761b('0x34')]};});_0x10816d[_0x761b('0x35')]=_['map'](_0x156005,_0x761b('0x2d'));_0x10816d[_0x761b('0x36')]=_['keys'](_0x16021c[_0x761b('0x36')]);_0x10816d[_0x761b('0x37')]=_[_0x761b('0x38')](_0x10816d['model'],_0x10816d['query']);_0x19de8b[_0x761b('0x39')]=_['intersection'](_0x10816d[_0x761b('0x35')],qs[_0x761b('0x3a')](_0x16021c[_0x761b('0x36')]['fields']));_0x19de8b[_0x761b('0x39')]=_0x19de8b['attributes']['length']?_0x19de8b[_0x761b('0x39')]:_0x10816d[_0x761b('0x35')];if(!_0x16021c[_0x761b('0x36')]['hasOwnProperty'](_0x761b('0x3b'))){_0x19de8b[_0x761b('0x21')]=qs[_0x761b('0x21')](_0x16021c[_0x761b('0x36')][_0x761b('0x21')]);_0x19de8b['offset']=qs['offset'](_0x16021c[_0x761b('0x36')][_0x761b('0x23')]);}_0x19de8b[_0x761b('0x3c')]=qs[_0x761b('0x3d')](_0x16021c[_0x761b('0x36')][_0x761b('0x3d')]);_0x19de8b[_0x761b('0x3e')]=qs[_0x761b('0x37')](_['pick'](_0x16021c['query'],_0x10816d[_0x761b('0x37')]),_0x156005);if(_0x16021c[_0x761b('0x36')][_0x761b('0x3f')]){_0x19de8b['where']=_[_0x761b('0x40')](_0x19de8b[_0x761b('0x3e')],{'$or':_[_0x761b('0x2f')](_0x156005,function(_0xb202b9){if(_0xb202b9['type']!=='VIRTUAL'){var _0x383698={};_0x383698[_0xb202b9[_0x761b('0x2d')]]={'$like':'%'+_0x16021c[_0x761b('0x36')]['filter']+'%'};return _0x383698;}})});}_0x19de8b=_['merge']({},_0x19de8b,_0x16021c[_0x761b('0x41')]);var _0x214fe0={'where':_0x19de8b[_0x761b('0x3e')]};return db['AnalyticExtractedReport'][_0x761b('0x22')](_0x214fe0)[_0x761b('0x28')](function(_0xa046c0){_0x312251[_0x761b('0x22')]=_0xa046c0;if(_0x16021c[_0x761b('0x36')]['includeAll']){_0x19de8b[_0x761b('0x42')]=[{'all':!![]}];}return db[_0x761b('0x30')][_0x761b('0x43')](_0x19de8b);})['then'](function(_0x48c352){_0x312251['rows']=_0x48c352;return _0x312251;})[_0x761b('0x28')](respondWithFilteredResult(_0x1f9c3e,_0x19de8b))[_0x761b('0x44')](handleError(_0x1f9c3e,null));};exports['show']=function(_0x4fbc7a,_0x3cc94d){var _0x16c0c3={'raw':!![],'where':{'id':_0x4fbc7a[_0x761b('0x45')]['id']}},_0x89c2ea={};_0x89c2ea[_0x761b('0x35')]=_[_0x761b('0x46')](db[_0x761b('0x30')]['rawAttributes']);_0x89c2ea[_0x761b('0x36')]=_[_0x761b('0x46')](_0x4fbc7a[_0x761b('0x36')]);_0x89c2ea['filters']=_['intersection'](_0x89c2ea['model'],_0x89c2ea[_0x761b('0x36')]);_0x16c0c3[_0x761b('0x39')]=_['intersection'](_0x89c2ea[_0x761b('0x35')],qs[_0x761b('0x3a')](_0x4fbc7a[_0x761b('0x36')][_0x761b('0x3a')]));_0x16c0c3[_0x761b('0x39')]=_0x16c0c3[_0x761b('0x39')]['length']?_0x16c0c3[_0x761b('0x39')]:_0x89c2ea[_0x761b('0x35')];if(_0x4fbc7a[_0x761b('0x36')][_0x761b('0x47')]){_0x16c0c3[_0x761b('0x42')]=[{'all':!![]}];}_0x16c0c3=_['merge']({},_0x16c0c3,_0x4fbc7a[_0x761b('0x41')]);return db[_0x761b('0x30')][_0x761b('0x48')](_0x16c0c3)['then'](handleEntityNotFound(_0x3cc94d,null))[_0x761b('0x28')](respondWithResult(_0x3cc94d,null))[_0x761b('0x44')](handleError(_0x3cc94d,null));};exports[_0x761b('0x49')]=function(_0x26e9ea,_0x1c2b3a){return db['AnalyticExtractedReport'][_0x761b('0x49')](_0x26e9ea[_0x761b('0x4a')],{})['then'](function(_0x29376e){var _0x2c5997=_0x26e9ea[_0x761b('0x4b')][_0x761b('0x2a')]({'plain':!![]});if(!_0x2c5997)throw new Error(_0x761b('0x4c'));if(_0x2c5997[_0x761b('0x4d')]===_0x761b('0x4b')){var _0x1396b5=_0x29376e[_0x761b('0x2a')]({'plain':!![]});var _0x34ef71=_0x761b('0x4e');return db['UserProfileSection'][_0x761b('0x48')]({'where':{'name':_0x34ef71,'userProfileId':_0x2c5997[_0x761b('0x4f')]},'raw':!![]})[_0x761b('0x28')](function(_0xeaded9){if(_0xeaded9&&_0xeaded9['autoAssociation']===0x0){return db[_0x761b('0x2b')][_0x761b('0x49')]({'name':_0x1396b5[_0x761b('0x2d')],'resourceId':_0x1396b5['id'],'type':_0xeaded9[_0x761b('0x2d')],'sectionId':_0xeaded9['id']},{})[_0x761b('0x28')](function(){return _0x29376e;});}else{return _0x29376e;}})[_0x761b('0x44')](function(_0x53b4b0){logger[_0x761b('0x2c')](_0x761b('0x50'),_0x53b4b0);throw _0x53b4b0;});}return _0x29376e;})['then'](respondWithResult(_0x1c2b3a,0xc9))[_0x761b('0x44')](handleError(_0x1c2b3a,null));};exports[_0x761b('0x51')]=function(_0x1421ea,_0x4b7502){if(_0x1421ea[_0x761b('0x4a')]['id']){delete _0x1421ea[_0x761b('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x761b('0x48')]({'where':{'id':_0x1421ea['params']['id']}})[_0x761b('0x28')](handleEntityNotFound(_0x4b7502,null))[_0x761b('0x28')](saveUpdates(_0x1421ea[_0x761b('0x4a')],null))[_0x761b('0x28')](respondWithResult(_0x4b7502,null))[_0x761b('0x44')](handleError(_0x4b7502,null));};exports['destroy']=function(_0x266625,_0x515e51){return db[_0x761b('0x30')][_0x761b('0x48')]({'where':{'id':_0x266625[_0x761b('0x45')]['id']}})['then'](handleEntityNotFound(_0x515e51,null))['then'](removeEntity(_0x515e51,null))['catch'](handleError(_0x515e51,null));};exports[_0x761b('0x52')]=function(_0x27f47c,_0x30bd96,_0x1a182e){return db['AnalyticExtractedReport'][_0x761b('0x48')]({'where':{'id':_0x27f47c['params']['id']},'attributes':[_0x761b('0x2d'),_0x761b('0x53'),_0x761b('0x54'),_0x761b('0x55')],'raw':!![]})[_0x761b('0x28')](handleEntityNotFound(_0x30bd96,null))[_0x761b('0x28')](function(_0x39e433){if(_0x39e433){if(!fs[_0x761b('0x56')](path['join'](config[_0x761b('0x57')],_0x761b('0x58'),_0x39e433[_0x761b('0x54')]))){throw new db[(_0x761b('0x59'))][(_0x761b('0x5a'))](_0x761b('0x5b'));}if(_0x27f47c[_0x761b('0x36')][_0x761b('0x5c')]){return _0x30bd96[_0x761b('0x1c')](0xc8);}return _0x30bd96['download'](path['join'](config['root'],_0x761b('0x58'),_0x39e433[_0x761b('0x54')]),util[_0x761b('0x5d')](_0x761b('0x5e'),_0x39e433[_0x761b('0x53')]||_0x39e433['name'],_0x39e433['output'][_0x761b('0x5f')]()));}})[_0x761b('0x44')](handleError(_0x30bd96,null));};
\ No newline at end of file
+var _0xc6fd=['rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','toLowerCase','eml-format'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc6fd,0x1d5));var _0xdc6f=function(_0x2ab14a,_0x49617e){_0x2ab14a=_0x2ab14a-0x0;var _0x10059c=_0xc6fd[_0x2ab14a];return _0x10059c;};'use strict';var emlformat=require(_0xdc6f('0x0'));var rimraf=require(_0xdc6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc6f('0x2'));var rp=require(_0xdc6f('0x3'));var moment=require(_0xdc6f('0x4'));var BPromise=require(_0xdc6f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdc6f('0x6'));var sox=require(_0xdc6f('0x7'));var csv=require(_0xdc6f('0x8'));var ejs=require(_0xdc6f('0x9'));var fs=require('fs');var fs_extra=require(_0xdc6f('0xa'));var _=require(_0xdc6f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc6f('0xc'));var deskjs=require(_0xdc6f('0xd'));var toCsv=require(_0xdc6f('0x8'));var querystring=require(_0xdc6f('0xe'));var Papa=require(_0xdc6f('0xf'));var Redis=require('ioredis');var authService=require(_0xdc6f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdc6f('0x11'));var hardwareService=require(_0xdc6f('0x12'));var logger=require(_0xdc6f('0x13'))(_0xdc6f('0x14'));var utils=require(_0xdc6f('0x15'));var config=require(_0xdc6f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x441e8,_0xe184d7){_0xe184d7=_0xe184d7||0xcc;return function(_0x4d4d3c){if(_0x4d4d3c){return _0x441e8[_0xdc6f('0x17')](_0xe184d7);}return _0x441e8[_0xdc6f('0x18')](_0xe184d7)[_0xdc6f('0x19')]();};}function respondWithResult(_0x5b47c3,_0x1c0d17){_0x1c0d17=_0x1c0d17||0xc8;return function(_0x25c879){if(_0x25c879){return _0x5b47c3[_0xdc6f('0x18')](_0x1c0d17)[_0xdc6f('0x1a')](_0x25c879);}};}function respondWithFilteredResult(_0x414e38,_0x1ca5dc){return function(_0xb607bb){if(_0xb607bb){var _0x12263c=typeof _0x1ca5dc['offset']===_0xdc6f('0x1b')&&typeof _0x1ca5dc[_0xdc6f('0x1c')]===_0xdc6f('0x1b');var _0xee96dc=_0xb607bb[_0xdc6f('0x1d')];var _0x2d930c=_0x12263c?0x0:_0x1ca5dc['offset'];var _0x5e4ac0=_0x12263c?_0xb607bb[_0xdc6f('0x1d')]:_0x1ca5dc[_0xdc6f('0x1e')]+_0x1ca5dc[_0xdc6f('0x1c')];var _0x410e6a;if(_0x5e4ac0>=_0xee96dc){_0x5e4ac0=_0xee96dc;_0x410e6a=0xc8;}else{_0x410e6a=0xce;}_0x414e38[_0xdc6f('0x18')](_0x410e6a);return _0x414e38[_0xdc6f('0x1f')](_0xdc6f('0x20'),_0x2d930c+'-'+_0x5e4ac0+'/'+_0xee96dc)['json'](_0xb607bb);}return null;};}function patchUpdates(_0x31c6bf){return function(_0x2eacb1){try{jsonpatch[_0xdc6f('0x21')](_0x2eacb1,_0x31c6bf,!![]);}catch(_0x1e7de5){return BPromise[_0xdc6f('0x22')](_0x1e7de5);}return _0x2eacb1['save']();};}function saveUpdates(_0x20fec9,_0x10d791){return function(_0x51c2fb){if(_0x51c2fb){return _0x51c2fb[_0xdc6f('0x23')](_0x20fec9)['then'](function(_0x4810f3){return _0x4810f3;});}return null;};}function removeEntity(_0x6a0877,_0x1f07a6){return function(_0x205f23){if(_0x205f23){return _0x205f23[_0xdc6f('0x24')]()[_0xdc6f('0x25')](function(){var _0x1d9098=_0x205f23['get']({'plain':!![]});var _0xf8ca='ExtractedReports';return db[_0xdc6f('0x26')]['destroy']({'where':{'type':_0xf8ca,'resourceId':_0x1d9098['id']}})[_0xdc6f('0x25')](function(){return _0x205f23;});})[_0xdc6f('0x25')](function(){_0x6a0877['status'](0xcc)[_0xdc6f('0x19')]();});}};}function handleEntityNotFound(_0x30571b,_0x5ca47e){return function(_0x173cfe){if(!_0x173cfe){_0x30571b['sendStatus'](0x194);}return _0x173cfe;};}function handleError(_0x4b19d9,_0x2089da){_0x2089da=_0x2089da||0x1f4;return function(_0x399ada){logger[_0xdc6f('0x27')](_0x399ada['stack']);if(_0x399ada[_0xdc6f('0x28')]){delete _0x399ada[_0xdc6f('0x28')];}_0x4b19d9[_0xdc6f('0x18')](_0x2089da)[_0xdc6f('0x29')](_0x399ada);};}exports[_0xdc6f('0x2a')]=function(_0x353cf9,_0x1527a6){var _0x1b4b9b={},_0x2024c4={},_0x583e7b={'count':0x0,'rows':[]};var _0x3c3d05=_[_0xdc6f('0x2b')](db['AnalyticExtractedReport'][_0xdc6f('0x2c')],function(_0x4c53bb){return{'name':_0x4c53bb['fieldName'],'type':_0x4c53bb[_0xdc6f('0x2d')][_0xdc6f('0x2e')]};});_0x2024c4[_0xdc6f('0x2f')]=_[_0xdc6f('0x2b')](_0x3c3d05,_0xdc6f('0x28'));_0x2024c4[_0xdc6f('0x30')]=_[_0xdc6f('0x31')](_0x353cf9[_0xdc6f('0x30')]);_0x2024c4[_0xdc6f('0x32')]=_['intersection'](_0x2024c4[_0xdc6f('0x2f')],_0x2024c4[_0xdc6f('0x30')]);_0x1b4b9b['attributes']=_[_0xdc6f('0x33')](_0x2024c4[_0xdc6f('0x2f')],qs[_0xdc6f('0x34')](_0x353cf9['query'][_0xdc6f('0x34')]));_0x1b4b9b[_0xdc6f('0x35')]=_0x1b4b9b[_0xdc6f('0x35')][_0xdc6f('0x36')]?_0x1b4b9b[_0xdc6f('0x35')]:_0x2024c4['model'];if(!_0x353cf9[_0xdc6f('0x30')]['hasOwnProperty'](_0xdc6f('0x37'))){_0x1b4b9b['limit']=qs[_0xdc6f('0x1c')](_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x1c')]);_0x1b4b9b[_0xdc6f('0x1e')]=qs[_0xdc6f('0x1e')](_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x1e')]);}_0x1b4b9b[_0xdc6f('0x38')]=qs['sort'](_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x39')]);_0x1b4b9b[_0xdc6f('0x3a')]=qs[_0xdc6f('0x32')](_['pick'](_0x353cf9[_0xdc6f('0x30')],_0x2024c4[_0xdc6f('0x32')]),_0x3c3d05);if(_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x3b')]){_0x1b4b9b[_0xdc6f('0x3a')]=_['merge'](_0x1b4b9b['where'],{'$or':_[_0xdc6f('0x2b')](_0x3c3d05,function(_0x18a3f9){if(_0x18a3f9[_0xdc6f('0x2d')]!==_0xdc6f('0x3c')){var _0x472c50={};_0x472c50[_0x18a3f9[_0xdc6f('0x28')]]={'$like':'%'+_0x353cf9[_0xdc6f('0x30')]['filter']+'%'};return _0x472c50;}})});}_0x1b4b9b=_[_0xdc6f('0x3d')]({},_0x1b4b9b,_0x353cf9[_0xdc6f('0x3e')]);var _0x4c7a7e={'where':_0x1b4b9b[_0xdc6f('0x3a')]};return db[_0xdc6f('0x3f')]['count'](_0x4c7a7e)[_0xdc6f('0x25')](function(_0x437cfb){_0x583e7b['count']=_0x437cfb;if(_0x353cf9[_0xdc6f('0x30')][_0xdc6f('0x40')]){_0x1b4b9b['include']=[{'all':!![]}];}return db[_0xdc6f('0x3f')][_0xdc6f('0x41')](_0x1b4b9b);})[_0xdc6f('0x25')](function(_0x1b51c7){_0x583e7b[_0xdc6f('0x42')]=_0x1b51c7;return _0x583e7b;})[_0xdc6f('0x25')](respondWithFilteredResult(_0x1527a6,_0x1b4b9b))[_0xdc6f('0x43')](handleError(_0x1527a6,null));};exports[_0xdc6f('0x44')]=function(_0x1d8c32,_0x2d94ce){var _0x136c17={'raw':!![],'where':{'id':_0x1d8c32[_0xdc6f('0x45')]['id']}},_0x1a4cff={};_0x1a4cff[_0xdc6f('0x2f')]=_[_0xdc6f('0x31')](db['AnalyticExtractedReport'][_0xdc6f('0x2c')]);_0x1a4cff[_0xdc6f('0x30')]=_['keys'](_0x1d8c32['query']);_0x1a4cff[_0xdc6f('0x32')]=_[_0xdc6f('0x33')](_0x1a4cff[_0xdc6f('0x2f')],_0x1a4cff['query']);_0x136c17[_0xdc6f('0x35')]=_['intersection'](_0x1a4cff[_0xdc6f('0x2f')],qs[_0xdc6f('0x34')](_0x1d8c32['query'][_0xdc6f('0x34')]));_0x136c17[_0xdc6f('0x35')]=_0x136c17[_0xdc6f('0x35')]['length']?_0x136c17[_0xdc6f('0x35')]:_0x1a4cff[_0xdc6f('0x2f')];if(_0x1d8c32[_0xdc6f('0x30')][_0xdc6f('0x40')]){_0x136c17[_0xdc6f('0x46')]=[{'all':!![]}];}_0x136c17=_[_0xdc6f('0x3d')]({},_0x136c17,_0x1d8c32[_0xdc6f('0x3e')]);return db[_0xdc6f('0x3f')][_0xdc6f('0x47')](_0x136c17)['then'](handleEntityNotFound(_0x2d94ce,null))[_0xdc6f('0x25')](respondWithResult(_0x2d94ce,null))[_0xdc6f('0x43')](handleError(_0x2d94ce,null));};exports[_0xdc6f('0x48')]=function(_0x4f48cc,_0x3160c4){return db[_0xdc6f('0x3f')]['create'](_0x4f48cc[_0xdc6f('0x49')],{})[_0xdc6f('0x25')](function(_0xcbe954){var _0x39c151=_0x4f48cc[_0xdc6f('0x4a')][_0xdc6f('0x4b')]({'plain':!![]});if(!_0x39c151)throw new Error(_0xdc6f('0x4c'));if(_0x39c151['role']==='user'){var _0xa7e5ca=_0xcbe954[_0xdc6f('0x4b')]({'plain':!![]});var _0x220268=_0xdc6f('0x4d');return db['UserProfileSection'][_0xdc6f('0x47')]({'where':{'name':_0x220268,'userProfileId':_0x39c151[_0xdc6f('0x4e')]},'raw':!![]})[_0xdc6f('0x25')](function(_0x5a462d){if(_0x5a462d&&_0x5a462d[_0xdc6f('0x4f')]===0x0){return db[_0xdc6f('0x26')][_0xdc6f('0x48')]({'name':_0xa7e5ca[_0xdc6f('0x28')],'resourceId':_0xa7e5ca['id'],'type':_0x5a462d['name'],'sectionId':_0x5a462d['id']},{})[_0xdc6f('0x25')](function(){return _0xcbe954;});}else{return _0xcbe954;}})['catch'](function(_0x1c52d0){logger['error'](_0xdc6f('0x50'),_0x1c52d0);throw _0x1c52d0;});}return _0xcbe954;})[_0xdc6f('0x25')](respondWithResult(_0x3160c4,0xc9))[_0xdc6f('0x43')](handleError(_0x3160c4,null));};exports[_0xdc6f('0x23')]=function(_0x10e3a3,_0x48264f){if(_0x10e3a3['body']['id']){delete _0x10e3a3['body']['id'];}return db[_0xdc6f('0x3f')][_0xdc6f('0x47')]({'where':{'id':_0x10e3a3[_0xdc6f('0x45')]['id']}})[_0xdc6f('0x25')](handleEntityNotFound(_0x48264f,null))[_0xdc6f('0x25')](saveUpdates(_0x10e3a3[_0xdc6f('0x49')],null))['then'](respondWithResult(_0x48264f,null))[_0xdc6f('0x43')](handleError(_0x48264f,null));};exports[_0xdc6f('0x24')]=function(_0x449e9f,_0x4ce08c){return db[_0xdc6f('0x3f')][_0xdc6f('0x47')]({'where':{'id':_0x449e9f['params']['id']}})[_0xdc6f('0x25')](handleEntityNotFound(_0x4ce08c,null))[_0xdc6f('0x25')](removeEntity(_0x4ce08c,null))[_0xdc6f('0x43')](handleError(_0x4ce08c,null));};exports['download']=function(_0x1c7875,_0x3a06a2,_0x2fcab1){return db[_0xdc6f('0x3f')][_0xdc6f('0x47')]({'where':{'id':_0x1c7875[_0xdc6f('0x45')]['id']},'attributes':[_0xdc6f('0x28'),_0xdc6f('0x51'),'savename',_0xdc6f('0x52')],'raw':!![]})[_0xdc6f('0x25')](handleEntityNotFound(_0x3a06a2,null))[_0xdc6f('0x25')](function(_0x4be902){if(_0x4be902){if(!fs[_0xdc6f('0x53')](path['join'](config[_0xdc6f('0x54')],_0xdc6f('0x55'),_0x4be902[_0xdc6f('0x56')]))){throw new db['Sequelize'][(_0xdc6f('0x57'))](_0xdc6f('0x58'));}if(_0x1c7875[_0xdc6f('0x30')][_0xdc6f('0x59')]){return _0x3a06a2['sendStatus'](0xc8);}return _0x3a06a2['download'](path[_0xdc6f('0x5a')](config[_0xdc6f('0x54')],_0xdc6f('0x55'),_0x4be902[_0xdc6f('0x56')]),util[_0xdc6f('0x5b')](_0xdc6f('0x5c'),_0x4be902[_0xdc6f('0x51')]||_0x4be902[_0xdc6f('0x28')],_0x4be902[_0xdc6f('0x52')][_0xdc6f('0x5d')]()));}})['catch'](handleError(_0x3a06a2,null));};
\ No newline at end of file
index b067197..ab54808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d0=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0x78d0,0xc0));var _0x078d=function(_0x5bb12c,_0x579fba){_0x5bb12c=_0x5bb12c-0x0;var _0x541e9e=_0x78d0[_0x5bb12c];return _0x541e9e;};'use strict';var _=require(_0x078d('0x0'));var util=require(_0x078d('0x1'));var logger=require(_0x078d('0x2'))(_0x078d('0x3'));var moment=require(_0x078d('0x4'));var BPromise=require('bluebird');var rp=require(_0x078d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x078d('0x6'));var attributes=require(_0x078d('0x7'));module[_0x078d('0x8')]=function(_0xd0a726,_0x2634bc){return _0xd0a726[_0x078d('0x9')](_0x078d('0xa'),attributes,{'tableName':_0x078d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c3f=['request-promise','path','rimraf','./analyticExtractedReport.attributes','lodash','util','../../config/logger','moment','bluebird'];(function(_0x348b2f,_0x1c19a2){var _0x8beda=function(_0x3f7a63){while(--_0x3f7a63){_0x348b2f['push'](_0x348b2f['shift']());}};_0x8beda(++_0x1c19a2);}(_0x1c3f,0xd3));var _0xf1c3=function(_0x13659a,_0x41453c){_0x13659a=_0x13659a-0x0;var _0x4b1c49=_0x1c3f[_0x13659a];return _0x4b1c49;};'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(_0xf1c3('0x4'));var rp=require(_0xf1c3('0x5'));var fs=require('fs');var path=require(_0xf1c3('0x6'));var rimraf=require(_0xf1c3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1c3('0x8'));module['exports']=function(_0x1a143a,_0x4e9f92){return _0x1a143a['define']('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 150a28c..540ea73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf485=['rpc','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x62c5b9,_0x1039c7){var _0x56d320=function(_0x440ea1){while(--_0x440ea1){_0x62c5b9['push'](_0x62c5b9['shift']());}};_0x56d320(++_0x1039c7);}(_0xf485,0x1af));var _0x5f48=function(_0x46a0a8,_0x2a63d0){_0x46a0a8=_0x46a0a8-0x0;var _0x454218=_0xf485[_0x46a0a8];return _0x454218;};'use strict';var _=require(_0x5f48('0x0'));var util=require('util');var moment=require(_0x5f48('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f48('0x2'));var fs=require('fs');var Redis=require(_0x5f48('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f48('0x4'));var logger=require(_0x5f48('0x5'))(_0x5f48('0x6'));var config=require('../../config/environment');var jayson=require(_0x5f48('0x7'));var client=jayson[_0x5f48('0x8')][_0x5f48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427713,_0x2013b2,_0x475a1a){return new BPromise(function(_0x1c33dd,_0x3ea948){return client[_0x5f48('0xa')](_0x427713,_0x475a1a)['then'](function(_0x1cfc7f){logger[_0x5f48('0xb')](_0x5f48('0xc'),_0x2013b2,_0x5f48('0xd'));logger[_0x5f48('0xe')](_0x5f48('0xf'),_0x2013b2,_0x5f48('0xd'),JSON['stringify'](_0x1cfc7f));if(_0x1cfc7f[_0x5f48('0x10')]){if(_0x1cfc7f[_0x5f48('0x10')]['code']===0x1f4){logger[_0x5f48('0x10')](_0x5f48('0xc'),_0x2013b2,_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);return _0x3ea948(_0x1cfc7f[_0x5f48('0x10')]['message']);}logger['error'](_0x5f48('0xc'),_0x2013b2,_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);return _0x1c33dd(_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);}else{logger[_0x5f48('0xb')](_0x5f48('0xc'),_0x2013b2,_0x5f48('0xd'));_0x1c33dd(_0x1cfc7f['result'][_0x5f48('0x11')]);}})[_0x5f48('0x12')](function(_0x29adc2){logger[_0x5f48('0x10')](_0x5f48('0xc'),_0x2013b2,_0x29adc2);_0x3ea948(_0x29adc2);});});}
\ No newline at end of file
+var _0xad1b=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad1b,0x1b0));var _0xbad1=function(_0x202067,_0x25e057){_0x202067=_0x202067-0x0;var _0x4c792e=_0xad1b[_0x202067];return _0x4c792e;};'use strict';var _=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var moment=require(_0xbad1('0x2'));var BPromise=require(_0xbad1('0x3'));var rs=require(_0xbad1('0x4'));var fs=require('fs');var Redis=require(_0xbad1('0x5'));var db=require(_0xbad1('0x6'))['db'];var utils=require(_0xbad1('0x7'));var logger=require(_0xbad1('0x8'))(_0xbad1('0x9'));var config=require(_0xbad1('0xa'));var jayson=require(_0xbad1('0xb'));var client=jayson[_0xbad1('0xc')][_0xbad1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x105a91,_0x321c32,_0x32790e){return new BPromise(function(_0x9fc7b4,_0x5e4932){return client['request'](_0x105a91,_0x32790e)[_0xbad1('0xe')](function(_0x413873){logger['info'](_0xbad1('0xf'),_0x321c32,_0xbad1('0x10'));logger[_0xbad1('0x11')](_0xbad1('0x12'),_0x321c32,_0xbad1('0x10'),JSON[_0xbad1('0x13')](_0x413873));if(_0x413873[_0xbad1('0x14')]){if(_0x413873[_0xbad1('0x14')][_0xbad1('0x15')]===0x1f4){logger[_0xbad1('0x14')](_0xbad1('0xf'),_0x321c32,_0x413873[_0xbad1('0x14')][_0xbad1('0x16')]);return _0x5e4932(_0x413873[_0xbad1('0x14')][_0xbad1('0x16')]);}logger[_0xbad1('0x14')](_0xbad1('0xf'),_0x321c32,_0x413873[_0xbad1('0x14')]['message']);return _0x9fc7b4(_0x413873['error'][_0xbad1('0x16')]);}else{logger[_0xbad1('0x17')](_0xbad1('0xf'),_0x321c32,_0xbad1('0x10'));_0x9fc7b4(_0x413873['result']['message']);}})[_0xbad1('0x18')](function(_0x4614b3){logger[_0xbad1('0x14')](_0xbad1('0xf'),_0x321c32,_0x4614b3);_0x5e4932(_0x4614b3);});});}
\ No newline at end of file
index a800e8f..ee28e64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea15=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/download'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xea15,0x66));var _0x5ea1=function(_0x3a55da,_0x1756c6){_0x3a55da=_0x3a55da-0x0;var _0x4d60f4=_0xea15[_0x3a55da];return _0x4d60f4;};'use strict';var multer=require(_0x5ea1('0x0'));var util=require('util');var path=require(_0x5ea1('0x1'));var timeout=require(_0x5ea1('0x2'));var express=require(_0x5ea1('0x3'));var router=express[_0x5ea1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ea1('0x5'));var interaction=require(_0x5ea1('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x5ea1('0x7')]('/',auth[_0x5ea1('0x8')](),controller['index']);router[_0x5ea1('0x7')](_0x5ea1('0x9'),auth[_0x5ea1('0x8')](),controller[_0x5ea1('0xa')]);router[_0x5ea1('0x7')](_0x5ea1('0xb'),auth[_0x5ea1('0x8')](),controller['download']);router[_0x5ea1('0xc')]('/',auth[_0x5ea1('0x8')](),controller[_0x5ea1('0xd')]);router[_0x5ea1('0xe')](_0x5ea1('0x9'),auth[_0x5ea1('0x8')](),controller[_0x5ea1('0xf')]);router[_0x5ea1('0x10')]('/:id',auth[_0x5ea1('0x8')](),controller[_0x5ea1('0x11')]);module[_0x5ea1('0x12')]=router;
\ No newline at end of file
+var _0x87ee=['put','/:id','update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create'];(function(_0x53d147,_0x259f9e){var _0x3bc064=function(_0x2ef6d5){while(--_0x2ef6d5){_0x53d147['push'](_0x53d147['shift']());}};_0x3bc064(++_0x259f9e);}(_0x87ee,0xe8));var _0xe87e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x87ee[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0xe87e('0x0'));var path=require(_0xe87e('0x1'));var timeout=require(_0xe87e('0x2'));var express=require(_0xe87e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe87e('0x4'));var interaction=require(_0xe87e('0x5'));var config=require('../../config/environment');var controller=require(_0xe87e('0x6'));router[_0xe87e('0x7')]('/',auth[_0xe87e('0x8')](),controller[_0xe87e('0x9')]);router[_0xe87e('0x7')]('/:id',auth[_0xe87e('0x8')](),controller[_0xe87e('0xa')]);router[_0xe87e('0x7')](_0xe87e('0xb'),auth[_0xe87e('0x8')](),controller[_0xe87e('0xc')]);router[_0xe87e('0xd')]('/',auth[_0xe87e('0x8')](),controller[_0xe87e('0xe')]);router[_0xe87e('0xf')](_0xe87e('0x10'),auth[_0xe87e('0x8')](),controller[_0xe87e('0x11')]);router['delete'](_0xe87e('0x10'),auth[_0xe87e('0x8')](),controller['destroy']);module[_0xe87e('0x12')]=router;
\ No newline at end of file
index 92b0b8d..e0abf0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0dd=['TEXT','STRING','sequelize','exports'];(function(_0x1c8c2f,_0x1d99fe){var _0x24fa67=function(_0x15fd50){while(--_0x15fd50){_0x1c8c2f['push'](_0x1c8c2f['shift']());}};_0x24fa67(++_0x1d99fe);}(_0xe0dd,0xa6));var _0xde0d=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xe0dd[_0x127a60];return _0xc1f6a3;};'use strict';var Sequelize=require(_0xde0d('0x0'));module[_0xde0d('0x1')]={'field':{'type':Sequelize[_0xde0d('0x2')]},'alias':{'type':Sequelize[_0xde0d('0x3')]},'function':{'type':Sequelize[_0xde0d('0x3')]},'format':{'type':Sequelize[_0xde0d('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x55f2=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x818d8f,_0x173813){var _0x1bb382=function(_0x1774e9){while(--_0x1774e9){_0x818d8f['push'](_0x818d8f['shift']());}};_0x1bb382(++_0x173813);}(_0x55f2,0x13c));var _0x255f=function(_0x3852b0,_0x45dbf1){_0x3852b0=_0x3852b0-0x0;var _0x2a307a=_0x55f2[_0x3852b0];return _0x2a307a;};'use strict';var Sequelize=require(_0x255f('0x0'));module[_0x255f('0x1')]={'field':{'type':Sequelize[_0x255f('0x2')]},'alias':{'type':Sequelize[_0x255f('0x3')]},'function':{'type':Sequelize[_0x255f('0x3')]},'format':{'type':Sequelize[_0x255f('0x3')]},'groupBy':{'type':Sequelize[_0x255f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x255f('0x3')]},'custom':{'type':Sequelize[_0x255f('0x4')],'defaultValue':![]}};
\ No newline at end of file
index b2122ed..2b9fb27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0eb=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','intersection','attributes','model','fields','nolimit'];(function(_0xb8f994,_0x4c9090){var _0x5a3088=function(_0x34265d){while(--_0x34265d){_0xb8f994['push'](_0xb8f994['shift']());}};_0x5a3088(++_0x4c9090);}(_0xe0eb,0x117));var _0xbe0e=function(_0x1aa289,_0x47d758){_0x1aa289=_0x1aa289-0x0;var _0xb7f13f=_0xe0eb[_0x1aa289];return _0xb7f13f;};'use strict';var emlformat=require(_0xbe0e('0x0'));var rimraf=require(_0xbe0e('0x1'));var zipdir=require(_0xbe0e('0x2'));var jsonpatch=require(_0xbe0e('0x3'));var rp=require(_0xbe0e('0x4'));var moment=require(_0xbe0e('0x5'));var BPromise=require(_0xbe0e('0x6'));var Mustache=require('mustache');var util=require(_0xbe0e('0x7'));var path=require(_0xbe0e('0x8'));var sox=require(_0xbe0e('0x9'));var csv=require(_0xbe0e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe0e('0xb'));var _=require('lodash');var squel=require(_0xbe0e('0xc'));var crypto=require(_0xbe0e('0xd'));var jsforce=require(_0xbe0e('0xe'));var deskjs=require(_0xbe0e('0xf'));var toCsv=require(_0xbe0e('0xa'));var querystring=require('querystring');var Papa=require(_0xbe0e('0x10'));var Redis=require(_0xbe0e('0x11'));var authService=require(_0xbe0e('0x12'));var qs=require(_0xbe0e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe0e('0x14'));var logger=require(_0xbe0e('0x15'))(_0xbe0e('0x16'));var utils=require(_0xbe0e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbe0e('0x18'));var db=require(_0xbe0e('0x19'))['db'];function respondWithStatusCode(_0x514fc6,_0x14b24f){_0x14b24f=_0x14b24f||0xcc;return function(_0x42dbdf){if(_0x42dbdf){return _0x514fc6[_0xbe0e('0x1a')](_0x14b24f);}return _0x514fc6[_0xbe0e('0x1b')](_0x14b24f)['end']();};}function respondWithResult(_0x38fcf9,_0x21b545){_0x21b545=_0x21b545||0xc8;return function(_0x4d79dc){if(_0x4d79dc){return _0x38fcf9['status'](_0x21b545)[_0xbe0e('0x1c')](_0x4d79dc);}};}function respondWithFilteredResult(_0x44bd77,_0x5556d0){return function(_0x1679e4){if(_0x1679e4){var _0x25b2be=typeof _0x5556d0[_0xbe0e('0x1d')]===_0xbe0e('0x1e')&&typeof _0x5556d0['limit']==='undefined';var _0x55d8ba=_0x1679e4['count'];var _0x490099=_0x25b2be?0x0:_0x5556d0['offset'];var _0x1883fe=_0x25b2be?_0x1679e4[_0xbe0e('0x1f')]:_0x5556d0[_0xbe0e('0x1d')]+_0x5556d0[_0xbe0e('0x20')];var _0x5001ba;if(_0x1883fe>=_0x55d8ba){_0x1883fe=_0x55d8ba;_0x5001ba=0xc8;}else{_0x5001ba=0xce;}_0x44bd77[_0xbe0e('0x1b')](_0x5001ba);return _0x44bd77[_0xbe0e('0x21')]('Content-Range',_0x490099+'-'+_0x1883fe+'/'+_0x55d8ba)[_0xbe0e('0x1c')](_0x1679e4);}return null;};}function patchUpdates(_0x37f333){return function(_0x16eb03){try{jsonpatch[_0xbe0e('0x22')](_0x16eb03,_0x37f333,!![]);}catch(_0x53fed4){return BPromise[_0xbe0e('0x23')](_0x53fed4);}return _0x16eb03[_0xbe0e('0x24')]();};}function saveUpdates(_0x61de29,_0x40cda5){return function(_0x315496){if(_0x315496){return _0x315496[_0xbe0e('0x25')](_0x61de29)[_0xbe0e('0x26')](function(_0x1eba94){return _0x1eba94;});}return null;};}function removeEntity(_0x992140,_0x3d00a2){return function(_0x218df7){if(_0x218df7){return _0x218df7[_0xbe0e('0x27')]()[_0xbe0e('0x26')](function(){_0x992140['status'](0xcc)[_0xbe0e('0x28')]();});}};}function handleEntityNotFound(_0x2b6c14,_0x215081){return function(_0x3d694e){if(!_0x3d694e){_0x2b6c14['sendStatus'](0x194);}return _0x3d694e;};}function handleError(_0x1c8357,_0x5cf521){_0x5cf521=_0x5cf521||0x1f4;return function(_0x4e308b){logger['error'](_0x4e308b[_0xbe0e('0x29')]);if(_0x4e308b[_0xbe0e('0x2a')]){delete _0x4e308b[_0xbe0e('0x2a')];}_0x1c8357[_0xbe0e('0x1b')](_0x5cf521)[_0xbe0e('0x2b')](_0x4e308b);};}exports[_0xbe0e('0x2c')]=function(_0x372a5b,_0x347d82){var _0x3fed65={},_0x2008a7={},_0x1760da={'count':0x0,'rows':[]};var _0x42e357=_['map'](db[_0xbe0e('0x2d')][_0xbe0e('0x2e')],function(_0x27daca){return{'name':_0x27daca[_0xbe0e('0x2f')],'type':_0x27daca[_0xbe0e('0x30')][_0xbe0e('0x31')]};});_0x2008a7['model']=_[_0xbe0e('0x32')](_0x42e357,_0xbe0e('0x2a'));_0x2008a7[_0xbe0e('0x33')]=_['keys'](_0x372a5b[_0xbe0e('0x33')]);_0x2008a7['filters']=_[_0xbe0e('0x34')](_0x2008a7['model'],_0x2008a7[_0xbe0e('0x33')]);_0x3fed65[_0xbe0e('0x35')]=_[_0xbe0e('0x34')](_0x2008a7[_0xbe0e('0x36')],qs[_0xbe0e('0x37')](_0x372a5b[_0xbe0e('0x33')][_0xbe0e('0x37')]));_0x3fed65[_0xbe0e('0x35')]=_0x3fed65['attributes']['length']?_0x3fed65[_0xbe0e('0x35')]:_0x2008a7[_0xbe0e('0x36')];if(!_0x372a5b[_0xbe0e('0x33')]['hasOwnProperty'](_0xbe0e('0x38'))){_0x3fed65[_0xbe0e('0x20')]=qs[_0xbe0e('0x20')](_0x372a5b[_0xbe0e('0x33')]['limit']);_0x3fed65[_0xbe0e('0x1d')]=qs[_0xbe0e('0x1d')](_0x372a5b['query'][_0xbe0e('0x1d')]);}_0x3fed65[_0xbe0e('0x39')]=qs['sort'](_0x372a5b[_0xbe0e('0x33')][_0xbe0e('0x3a')]);_0x3fed65[_0xbe0e('0x3b')]=qs[_0xbe0e('0x3c')](_[_0xbe0e('0x3d')](_0x372a5b[_0xbe0e('0x33')],_0x2008a7[_0xbe0e('0x3c')]),_0x42e357);if(_0x372a5b['query'][_0xbe0e('0x3e')]){_0x3fed65[_0xbe0e('0x3b')]=_[_0xbe0e('0x3f')](_0x3fed65[_0xbe0e('0x3b')],{'$or':_[_0xbe0e('0x32')](_0x42e357,function(_0x31643b){if(_0x31643b['type']!==_0xbe0e('0x40')){var _0x1c4a52={};_0x1c4a52[_0x31643b[_0xbe0e('0x2a')]]={'$like':'%'+_0x372a5b[_0xbe0e('0x33')][_0xbe0e('0x3e')]+'%'};return _0x1c4a52;}})});}_0x3fed65=_[_0xbe0e('0x3f')]({},_0x3fed65,_0x372a5b[_0xbe0e('0x41')]);var _0x6cf9b3={'where':_0x3fed65[_0xbe0e('0x3b')]};return db[_0xbe0e('0x2d')][_0xbe0e('0x1f')](_0x6cf9b3)[_0xbe0e('0x26')](function(_0x288343){_0x1760da['count']=_0x288343;if(_0x372a5b[_0xbe0e('0x33')][_0xbe0e('0x42')]){_0x3fed65[_0xbe0e('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x3fed65);})[_0xbe0e('0x26')](function(_0xe27fba){_0x1760da['rows']=_0xe27fba;return _0x1760da;})[_0xbe0e('0x26')](respondWithFilteredResult(_0x347d82,_0x3fed65))[_0xbe0e('0x44')](handleError(_0x347d82,null));};exports[_0xbe0e('0x45')]=function(_0x403748,_0x49414f){var _0x3cb3dc={'raw':![],'where':{'id':_0x403748['params']['id']}},_0x11cfdc={};_0x11cfdc[_0xbe0e('0x36')]=_[_0xbe0e('0x46')](db[_0xbe0e('0x2d')]['rawAttributes']);_0x11cfdc['query']=_[_0xbe0e('0x46')](_0x403748[_0xbe0e('0x33')]);_0x11cfdc[_0xbe0e('0x3c')]=_[_0xbe0e('0x34')](_0x11cfdc[_0xbe0e('0x36')],_0x11cfdc[_0xbe0e('0x33')]);_0x3cb3dc[_0xbe0e('0x35')]=_['intersection'](_0x11cfdc['model'],qs[_0xbe0e('0x37')](_0x403748[_0xbe0e('0x33')][_0xbe0e('0x37')]));_0x3cb3dc[_0xbe0e('0x35')]=_0x3cb3dc['attributes']['length']?_0x3cb3dc[_0xbe0e('0x35')]:_0x11cfdc[_0xbe0e('0x36')];if(_0x403748[_0xbe0e('0x33')][_0xbe0e('0x42')]){_0x3cb3dc[_0xbe0e('0x43')]=[{'all':!![]}];}_0x3cb3dc=_[_0xbe0e('0x3f')]({},_0x3cb3dc,_0x403748[_0xbe0e('0x41')]);return db['AnalyticFieldReport'][_0xbe0e('0x47')](_0x3cb3dc)[_0xbe0e('0x26')](handleEntityNotFound(_0x49414f,null))[_0xbe0e('0x26')](respondWithResult(_0x49414f,null))[_0xbe0e('0x44')](handleError(_0x49414f,null));};exports[_0xbe0e('0x48')]=function(_0x586b5a,_0x14c82e){return db[_0xbe0e('0x2d')][_0xbe0e('0x48')](_0x586b5a[_0xbe0e('0x49')],{})[_0xbe0e('0x26')](respondWithResult(_0x14c82e,0xc9))[_0xbe0e('0x44')](handleError(_0x14c82e,null));};exports[_0xbe0e('0x4a')]=function(_0x10232b,_0x18552a){return db[_0xbe0e('0x2d')][_0xbe0e('0x4a')](_0x10232b[_0xbe0e('0x49')],{'raw':![],'individualHooks':!![]})[_0xbe0e('0x26')](respondWithResult(_0x18552a,0xc9))['catch'](handleError(_0x18552a,null));};exports[_0xbe0e('0x25')]=function(_0x1a1970,_0x449568){if(_0x1a1970[_0xbe0e('0x49')]['id']){delete _0x1a1970[_0xbe0e('0x49')]['id'];}return db[_0xbe0e('0x2d')][_0xbe0e('0x47')]({'where':{'id':_0x1a1970[_0xbe0e('0x4b')]['id']}})[_0xbe0e('0x26')](handleEntityNotFound(_0x449568,null))[_0xbe0e('0x26')](saveUpdates(_0x1a1970[_0xbe0e('0x49')],null))['then'](respondWithResult(_0x449568,null))[_0xbe0e('0x44')](handleError(_0x449568,null));};exports[_0xbe0e('0x27')]=function(_0x35bf17,_0x429d7a){return db[_0xbe0e('0x2d')]['find']({'where':{'id':_0x35bf17['params']['id']}})[_0xbe0e('0x26')](handleEntityNotFound(_0x429d7a,null))[_0xbe0e('0x26')](removeEntity(_0x429d7a,null))[_0xbe0e('0x44')](handleError(_0x429d7a,null));};exports[_0xbe0e('0x4c')]=function(_0xb19dbd,_0x4c572d){return db['AnalyticFieldReport'][_0xbe0e('0x27')]({'where':{'id':_0xb19dbd[_0xbe0e('0x33')][_0xbe0e('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xbe0e('0x26')](respondWithResult(_0x4c572d,0xcc))[_0xbe0e('0x44')](handleError(_0x4c572d,null));};exports[_0xbe0e('0x4e')]=function(_0x10b97a,_0x13d7b8,_0xce30a){return db[_0xbe0e('0x4f')][_0xbe0e('0x50')]({'where':{'id':_0x10b97a[_0xbe0e('0x4b')]['id']}})[_0xbe0e('0x26')](handleEntityNotFound(_0x13d7b8,null))[_0xbe0e('0x26')](function(_0x2c9631){if(_0x2c9631){return db[_0xbe0e('0x51')]['transaction'](function(_0xeddc06){return db[_0xbe0e('0x2d')][_0xbe0e('0x27')]({'where':{'CustomReportId':_0x10b97a[_0xbe0e('0x4b')]['id']},'transaction':_0xeddc06})['then'](function(_0x49da6a){var _0x18fe06=_['map'](_0x10b97a[_0xbe0e('0x49')],function(_0x3c0574){delete _0x3c0574['id'];_0x3c0574[_0xbe0e('0x52')]=_0x10b97a['params']['id'];return _0x3c0574;});return db[_0xbe0e('0x2d')][_0xbe0e('0x4a')](_0x18fe06,{'transaction':_0xeddc06});});})[_0xbe0e('0x26')](function(){return db[_0xbe0e('0x2d')][_0xbe0e('0x53')]({'where':{'CustomReportId':_0x10b97a['params']['id']}});});}})[_0xbe0e('0x26')](respondWithResult(_0x13d7b8,null))[_0xbe0e('0x44')](handleError(_0x13d7b8,null));};
\ No newline at end of file
+var _0x8efe=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','include','findAll','rows','catch','params','options','find','create','body','bulkCreate','bulkDestroy','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','squel','jsforce'];(function(_0x491e18,_0x38a578){var _0x309378=function(_0x1afe47){while(--_0x1afe47){_0x491e18['push'](_0x491e18['shift']());}};_0x309378(++_0x38a578);}(_0x8efe,0x90));var _0xe8ef=function(_0x4da1ec,_0x3039b8){_0x4da1ec=_0x4da1ec-0x0;var _0x3fc0cc=_0x8efe[_0x4da1ec];return _0x3fc0cc;};'use strict';var emlformat=require(_0xe8ef('0x0'));var rimraf=require(_0xe8ef('0x1'));var zipdir=require(_0xe8ef('0x2'));var jsonpatch=require(_0xe8ef('0x3'));var rp=require(_0xe8ef('0x4'));var moment=require(_0xe8ef('0x5'));var BPromise=require(_0xe8ef('0x6'));var Mustache=require(_0xe8ef('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8ef('0x8'));var _=require(_0xe8ef('0x9'));var squel=require(_0xe8ef('0xa'));var crypto=require('crypto');var jsforce=require(_0xe8ef('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe8ef('0xc'));var querystring=require(_0xe8ef('0xd'));var Papa=require(_0xe8ef('0xe'));var Redis=require(_0xe8ef('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe8ef('0x10'));var as=require(_0xe8ef('0x11'));var hardwareService=require(_0xe8ef('0x12'));var logger=require('../../config/logger')(_0xe8ef('0x13'));var utils=require(_0xe8ef('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe8ef('0x15'));var db=require(_0xe8ef('0x16'))['db'];function respondWithStatusCode(_0x28d858,_0x1d0b63){_0x1d0b63=_0x1d0b63||0xcc;return function(_0x17b41c){if(_0x17b41c){return _0x28d858[_0xe8ef('0x17')](_0x1d0b63);}return _0x28d858['status'](_0x1d0b63)['end']();};}function respondWithResult(_0x7791f3,_0x53dab6){_0x53dab6=_0x53dab6||0xc8;return function(_0x84de69){if(_0x84de69){return _0x7791f3[_0xe8ef('0x18')](_0x53dab6)[_0xe8ef('0x19')](_0x84de69);}};}function respondWithFilteredResult(_0x26db6c,_0x323e7a){return function(_0xfbfa4e){if(_0xfbfa4e){var _0x47f50a=typeof _0x323e7a[_0xe8ef('0x1a')]===_0xe8ef('0x1b')&&typeof _0x323e7a['limit']===_0xe8ef('0x1b');var _0x544c3a=_0xfbfa4e[_0xe8ef('0x1c')];var _0x11f5e6=_0x47f50a?0x0:_0x323e7a['offset'];var _0xba9dd5=_0x47f50a?_0xfbfa4e['count']:_0x323e7a[_0xe8ef('0x1a')]+_0x323e7a[_0xe8ef('0x1d')];var _0x44a169;if(_0xba9dd5>=_0x544c3a){_0xba9dd5=_0x544c3a;_0x44a169=0xc8;}else{_0x44a169=0xce;}_0x26db6c['status'](_0x44a169);return _0x26db6c[_0xe8ef('0x1e')](_0xe8ef('0x1f'),_0x11f5e6+'-'+_0xba9dd5+'/'+_0x544c3a)[_0xe8ef('0x19')](_0xfbfa4e);}return null;};}function patchUpdates(_0x809943){return function(_0x4e219c){try{jsonpatch[_0xe8ef('0x20')](_0x4e219c,_0x809943,!![]);}catch(_0x4731e8){return BPromise[_0xe8ef('0x21')](_0x4731e8);}return _0x4e219c[_0xe8ef('0x22')]();};}function saveUpdates(_0x142bc6,_0x406ed7){return function(_0x99a482){if(_0x99a482){return _0x99a482[_0xe8ef('0x23')](_0x142bc6)[_0xe8ef('0x24')](function(_0x2c3261){return _0x2c3261;});}return null;};}function removeEntity(_0x15a6f4,_0x3e4d9){return function(_0x47b3d7){if(_0x47b3d7){return _0x47b3d7[_0xe8ef('0x25')]()[_0xe8ef('0x24')](function(){_0x15a6f4[_0xe8ef('0x18')](0xcc)[_0xe8ef('0x26')]();});}};}function handleEntityNotFound(_0x58a945,_0x13a835){return function(_0x44f87a){if(!_0x44f87a){_0x58a945[_0xe8ef('0x17')](0x194);}return _0x44f87a;};}function handleError(_0x37c1a0,_0x362244){_0x362244=_0x362244||0x1f4;return function(_0x51d977){logger['error'](_0x51d977['stack']);if(_0x51d977[_0xe8ef('0x27')]){delete _0x51d977[_0xe8ef('0x27')];}_0x37c1a0[_0xe8ef('0x18')](_0x362244)['send'](_0x51d977);};}exports[_0xe8ef('0x28')]=function(_0x1f1eac,_0x4cea44){var _0x4e2330={},_0x3a25c6={},_0x487982={'count':0x0,'rows':[]};var _0x1918c9=_[_0xe8ef('0x29')](db[_0xe8ef('0x2a')][_0xe8ef('0x2b')],function(_0x52ea2c){return{'name':_0x52ea2c[_0xe8ef('0x2c')],'type':_0x52ea2c['type'][_0xe8ef('0x2d')]};});_0x3a25c6[_0xe8ef('0x2e')]=_['map'](_0x1918c9,_0xe8ef('0x27'));_0x3a25c6[_0xe8ef('0x2f')]=_[_0xe8ef('0x30')](_0x1f1eac[_0xe8ef('0x2f')]);_0x3a25c6[_0xe8ef('0x31')]=_[_0xe8ef('0x32')](_0x3a25c6['model'],_0x3a25c6['query']);_0x4e2330[_0xe8ef('0x33')]=_[_0xe8ef('0x32')](_0x3a25c6[_0xe8ef('0x2e')],qs[_0xe8ef('0x34')](_0x1f1eac[_0xe8ef('0x2f')][_0xe8ef('0x34')]));_0x4e2330['attributes']=_0x4e2330[_0xe8ef('0x33')][_0xe8ef('0x35')]?_0x4e2330[_0xe8ef('0x33')]:_0x3a25c6[_0xe8ef('0x2e')];if(!_0x1f1eac['query'][_0xe8ef('0x36')](_0xe8ef('0x37'))){_0x4e2330[_0xe8ef('0x1d')]=qs[_0xe8ef('0x1d')](_0x1f1eac[_0xe8ef('0x2f')][_0xe8ef('0x1d')]);_0x4e2330['offset']=qs[_0xe8ef('0x1a')](_0x1f1eac['query']['offset']);}_0x4e2330[_0xe8ef('0x38')]=qs[_0xe8ef('0x39')](_0x1f1eac['query']['sort']);_0x4e2330['where']=qs[_0xe8ef('0x31')](_[_0xe8ef('0x3a')](_0x1f1eac[_0xe8ef('0x2f')],_0x3a25c6['filters']),_0x1918c9);if(_0x1f1eac['query'][_0xe8ef('0x3b')]){_0x4e2330['where']=_[_0xe8ef('0x3c')](_0x4e2330['where'],{'$or':_[_0xe8ef('0x29')](_0x1918c9,function(_0x379332){if(_0x379332['type']!==_0xe8ef('0x3d')){var _0xd596ab={};_0xd596ab[_0x379332[_0xe8ef('0x27')]]={'$like':'%'+_0x1f1eac[_0xe8ef('0x2f')][_0xe8ef('0x3b')]+'%'};return _0xd596ab;}})});}_0x4e2330=_['merge']({},_0x4e2330,_0x1f1eac['options']);var _0x1ac927={'where':_0x4e2330[_0xe8ef('0x3e')]};return db['AnalyticFieldReport']['count'](_0x1ac927)[_0xe8ef('0x24')](function(_0x5dcb82){_0x487982[_0xe8ef('0x1c')]=_0x5dcb82;if(_0x1f1eac['query']['includeAll']){_0x4e2330[_0xe8ef('0x3f')]=[{'all':!![]}];}return db[_0xe8ef('0x2a')][_0xe8ef('0x40')](_0x4e2330);})[_0xe8ef('0x24')](function(_0x484d70){_0x487982[_0xe8ef('0x41')]=_0x484d70;return _0x487982;})[_0xe8ef('0x24')](respondWithFilteredResult(_0x4cea44,_0x4e2330))[_0xe8ef('0x42')](handleError(_0x4cea44,null));};exports['show']=function(_0x87e46e,_0xaa29ba){var _0x4005a0={'raw':![],'where':{'id':_0x87e46e[_0xe8ef('0x43')]['id']}},_0x1ddc98={};_0x1ddc98[_0xe8ef('0x2e')]=_[_0xe8ef('0x30')](db[_0xe8ef('0x2a')][_0xe8ef('0x2b')]);_0x1ddc98['query']=_[_0xe8ef('0x30')](_0x87e46e['query']);_0x1ddc98['filters']=_['intersection'](_0x1ddc98[_0xe8ef('0x2e')],_0x1ddc98[_0xe8ef('0x2f')]);_0x4005a0['attributes']=_[_0xe8ef('0x32')](_0x1ddc98['model'],qs['fields'](_0x87e46e[_0xe8ef('0x2f')][_0xe8ef('0x34')]));_0x4005a0[_0xe8ef('0x33')]=_0x4005a0['attributes']['length']?_0x4005a0['attributes']:_0x1ddc98[_0xe8ef('0x2e')];if(_0x87e46e[_0xe8ef('0x2f')]['includeAll']){_0x4005a0['include']=[{'all':!![]}];}_0x4005a0=_[_0xe8ef('0x3c')]({},_0x4005a0,_0x87e46e[_0xe8ef('0x44')]);return db[_0xe8ef('0x2a')][_0xe8ef('0x45')](_0x4005a0)[_0xe8ef('0x24')](handleEntityNotFound(_0xaa29ba,null))[_0xe8ef('0x24')](respondWithResult(_0xaa29ba,null))[_0xe8ef('0x42')](handleError(_0xaa29ba,null));};exports[_0xe8ef('0x46')]=function(_0x2ec408,_0x3f513e){return db[_0xe8ef('0x2a')]['create'](_0x2ec408[_0xe8ef('0x47')],{})[_0xe8ef('0x24')](respondWithResult(_0x3f513e,0xc9))['catch'](handleError(_0x3f513e,null));};exports[_0xe8ef('0x48')]=function(_0x113dd8,_0x2d1143){return db[_0xe8ef('0x2a')][_0xe8ef('0x48')](_0x113dd8[_0xe8ef('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2d1143,0xc9))['catch'](handleError(_0x2d1143,null));};exports['update']=function(_0x1797b0,_0x430957){if(_0x1797b0[_0xe8ef('0x47')]['id']){delete _0x1797b0[_0xe8ef('0x47')]['id'];}return db[_0xe8ef('0x2a')][_0xe8ef('0x45')]({'where':{'id':_0x1797b0['params']['id']}})['then'](handleEntityNotFound(_0x430957,null))[_0xe8ef('0x24')](saveUpdates(_0x1797b0[_0xe8ef('0x47')],null))[_0xe8ef('0x24')](respondWithResult(_0x430957,null))[_0xe8ef('0x42')](handleError(_0x430957,null));};exports[_0xe8ef('0x25')]=function(_0x3e27d5,_0x26a4b4){return db[_0xe8ef('0x2a')][_0xe8ef('0x45')]({'where':{'id':_0x3e27d5[_0xe8ef('0x43')]['id']}})[_0xe8ef('0x24')](handleEntityNotFound(_0x26a4b4,null))[_0xe8ef('0x24')](removeEntity(_0x26a4b4,null))[_0xe8ef('0x42')](handleError(_0x26a4b4,null));};exports[_0xe8ef('0x49')]=function(_0x425031,_0xcb0940){return db[_0xe8ef('0x2a')][_0xe8ef('0x25')]({'where':{'id':_0x425031['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xe8ef('0x24')](respondWithResult(_0xcb0940,0xcc))[_0xe8ef('0x42')](handleError(_0xcb0940,null));};exports['addFields']=function(_0x40772b,_0x430710,_0x5c29fc){return db[_0xe8ef('0x4a')][_0xe8ef('0x4b')]({'where':{'id':_0x40772b[_0xe8ef('0x43')]['id']}})['then'](handleEntityNotFound(_0x430710,null))[_0xe8ef('0x24')](function(_0x3e4788){if(_0x3e4788){return db['sequelize'][_0xe8ef('0x4c')](function(_0x360358){return db[_0xe8ef('0x2a')][_0xe8ef('0x25')]({'where':{'CustomReportId':_0x40772b[_0xe8ef('0x43')]['id']},'transaction':_0x360358})[_0xe8ef('0x24')](function(_0x23205b){var _0x326a64=_['map'](_0x40772b[_0xe8ef('0x47')],function(_0x16720b){delete _0x16720b['id'];_0x16720b[_0xe8ef('0x4d')]=_0x40772b[_0xe8ef('0x43')]['id'];return _0x16720b;});return db[_0xe8ef('0x2a')][_0xe8ef('0x48')](_0x326a64,{'transaction':_0x360358});});})['then'](function(){return db['AnalyticFieldReport'][_0xe8ef('0x40')]({'where':{'CustomReportId':_0x40772b[_0xe8ef('0x43')]['id']}});});}})[_0xe8ef('0x24')](respondWithResult(_0x430710,null))['catch'](handleError(_0x430710,null));};
\ No newline at end of file
index 0c38afc..1b1e8b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c34=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x4c34,0x180));var _0x44c3=function(_0x15508b,_0xadde73){_0x15508b=_0x15508b-0x0;var _0x4b42f3=_0x4c34[_0x15508b];return _0x4b42f3;};'use strict';var _=require('lodash');var util=require(_0x44c3('0x0'));var logger=require(_0x44c3('0x1'))(_0x44c3('0x2'));var moment=require(_0x44c3('0x3'));var BPromise=require(_0x44c3('0x4'));var rp=require(_0x44c3('0x5'));var fs=require('fs');var path=require(_0x44c3('0x6'));var rimraf=require(_0x44c3('0x7'));var config=require(_0x44c3('0x8'));var attributes=require(_0x44c3('0x9'));module[_0x44c3('0xa')]=function(_0x44151f,_0x24b550){return _0x44151f[_0x44c3('0xb')](_0x44c3('0xc'),attributes,{'tableName':_0x44c3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7f5=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd7f5,0x1bd));var _0x5d7f=function(_0x51d3ac,_0x2cdcfc){_0x51d3ac=_0x51d3ac-0x0;var _0x29b333=_0xd7f5[_0x51d3ac];return _0x29b333;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d7f('0x0'))(_0x5d7f('0x1'));var moment=require(_0x5d7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d7f('0x3'));var fs=require('fs');var path=require(_0x5d7f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d7f('0x5'));module[_0x5d7f('0x6')]=function(_0x1efba9,_0x36f1a8){return _0x1efba9['define'](_0x5d7f('0x7'),attributes,{'tableName':_0x5d7f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e8cd4bf..25e7f54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ec4=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x374141,_0x1b355a){var _0x4b9b1d=function(_0x4d97fc){while(--_0x4d97fc){_0x374141['push'](_0x374141['shift']());}};_0x4b9b1d(++_0x1b355a);}(_0x7ec4,0x1b4));var _0x47ec=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7ec4[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x47ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x47ec('0x1'));var fs=require('fs');var Redis=require(_0x47ec('0x2'));var db=require(_0x47ec('0x3'))['db'];var utils=require(_0x47ec('0x4'));var logger=require(_0x47ec('0x5'))(_0x47ec('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x47ec('0x7')][_0x47ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x565fdd,_0x130f0a,_0x135fce){return new BPromise(function(_0x526766,_0x1acb8f){return client[_0x47ec('0x9')](_0x565fdd,_0x135fce)[_0x47ec('0xa')](function(_0x4d92e4){logger[_0x47ec('0xb')](_0x47ec('0xc'),_0x130f0a,_0x47ec('0xd'));logger[_0x47ec('0xe')](_0x47ec('0xf'),_0x130f0a,_0x47ec('0xd'),JSON[_0x47ec('0x10')](_0x4d92e4));if(_0x4d92e4[_0x47ec('0x11')]){if(_0x4d92e4[_0x47ec('0x11')][_0x47ec('0x12')]===0x1f4){logger[_0x47ec('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x130f0a,_0x4d92e4[_0x47ec('0x11')]['message']);return _0x1acb8f(_0x4d92e4[_0x47ec('0x11')][_0x47ec('0x13')]);}logger[_0x47ec('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x130f0a,_0x4d92e4[_0x47ec('0x11')][_0x47ec('0x13')]);return _0x526766(_0x4d92e4[_0x47ec('0x11')][_0x47ec('0x13')]);}else{logger[_0x47ec('0xb')](_0x47ec('0xc'),_0x130f0a,_0x47ec('0xd'));_0x526766(_0x4d92e4['result'][_0x47ec('0x13')]);}})['catch'](function(_0x1a2927){logger['error'](_0x47ec('0xc'),_0x130f0a,_0x1a2927);_0x1acb8f(_0x1a2927);});});}
\ No newline at end of file
+var _0x02b6=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x02b6,0xf0));var _0x602b=function(_0x379411,_0x20ad86){_0x379411=_0x379411-0x0;var _0x5a94d6=_0x02b6[_0x379411];return _0x5a94d6;};'use strict';var _=require(_0x602b('0x0'));var util=require(_0x602b('0x1'));var moment=require(_0x602b('0x2'));var BPromise=require(_0x602b('0x3'));var rs=require(_0x602b('0x4'));var fs=require('fs');var Redis=require(_0x602b('0x5'));var db=require(_0x602b('0x6'))['db'];var utils=require(_0x602b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x602b('0x8'));var jayson=require(_0x602b('0x9'));var client=jayson[_0x602b('0xa')][_0x602b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32b20b,_0x7f2bd3,_0xbde44f){return new BPromise(function(_0x577809,_0x1ed58d){return client[_0x602b('0xc')](_0x32b20b,_0xbde44f)['then'](function(_0x5d3803){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x7f2bd3,_0x602b('0xd'));logger[_0x602b('0xe')](_0x602b('0xf'),_0x7f2bd3,'request\x20sent',JSON[_0x602b('0x10')](_0x5d3803));if(_0x5d3803[_0x602b('0x11')]){if(_0x5d3803['error'][_0x602b('0x12')]===0x1f4){logger[_0x602b('0x11')](_0x602b('0x13'),_0x7f2bd3,_0x5d3803[_0x602b('0x11')]['message']);return _0x1ed58d(_0x5d3803[_0x602b('0x11')][_0x602b('0x14')]);}logger[_0x602b('0x11')](_0x602b('0x13'),_0x7f2bd3,_0x5d3803[_0x602b('0x11')][_0x602b('0x14')]);return _0x577809(_0x5d3803[_0x602b('0x11')][_0x602b('0x14')]);}else{logger[_0x602b('0x15')](_0x602b('0x13'),_0x7f2bd3,_0x602b('0xd'));_0x577809(_0x5d3803[_0x602b('0x16')][_0x602b('0x14')]);}})[_0x602b('0x17')](function(_0x3a88aa){logger[_0x602b('0x11')](_0x602b('0x13'),_0x7f2bd3,_0x3a88aa);_0x1ed58d(_0x3a88aa);});});}
\ No newline at end of file
index 7f552a7..8b7cc58 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(_0x155ac2,_0x184223){var _0x21b404=function(_0x250bbd){while(--_0x250bbd){_0x155ac2['push'](_0x155ac2['shift']());}};_0x21b404(++_0x184223);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x2a0926,_0x369af6){var _0xd54864=function(_0x1f3685){while(--_0x1f3685){_0x2a0926['push'](_0x2a0926['shift']());}};_0xd54864(++_0x369af6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 9c1a54a..9b8563f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x566f=['name','TEXT','sequelize','exports','STRING'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x566f,0x124));var _0xf566=function(_0x5378e8,_0x228c0a){_0x5378e8=_0x5378e8-0x0;var _0x3cfb63=_0x566f[_0x5378e8];return _0x3cfb63;};'use strict';var Sequelize=require(_0xf566('0x0'));module[_0xf566('0x1')]={'name':{'type':Sequelize[_0xf566('0x2')],'allowNull':![],'unique':_0xf566('0x3')},'table':{'type':Sequelize[_0xf566('0x2')]},'metric':{'type':Sequelize[_0xf566('0x4')]},'description':{'type':Sequelize[_0xf566('0x2')]}};
\ No newline at end of file
+var _0x2b4f=['STRING','TEXT','exports','name'];(function(_0x2ec905,_0x442fb6){var _0xc98bd=function(_0x363b91){while(--_0x363b91){_0x2ec905['push'](_0x2ec905['shift']());}};_0xc98bd(++_0x442fb6);}(_0x2b4f,0x142));var _0xf2b4=function(_0xabbde1,_0x4e8c81){_0xabbde1=_0xabbde1-0x0;var _0x428696=_0x2b4f[_0xabbde1];return _0x428696;};'use strict';var Sequelize=require('sequelize');module[_0xf2b4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf2b4('0x1')},'table':{'type':Sequelize[_0xf2b4('0x2')]},'metric':{'type':Sequelize[_0xf2b4('0x3')]},'description':{'type':Sequelize[_0xf2b4('0x2')]}};
\ No newline at end of file
index 9ae2a33..6ceda20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x25ccb6,_0x429ba4){var _0x3c8292=function(_0x15a7cf){while(--_0x15a7cf){_0x25ccb6['push'](_0x25ccb6['shift']());}};_0x3c8292(++_0x429ba4);}(_0x4b84,0x1cc));var _0x44b8=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x4b84[_0x220dbb];return _0x2b77de;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0xce3e5c,_0x5ef695){var _0x5ac033=function(_0x3e38f3){while(--_0x3e38f3){_0xce3e5c['push'](_0xce3e5c['shift']());}};_0x5ac033(++_0x5ef695);}(_0x425d,0x1e0));var _0xd425=function(_0x52a073,_0x225c33){_0x52a073=_0x52a073-0x0;var _0x14c817=_0x425d[_0x52a073];return _0x14c817;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
index 6086239..dff2fc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77f7=['request-promise','path','rimraf','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4ff39f,_0x5e020a){var _0x55698c=function(_0x1805ca){while(--_0x1805ca){_0x4ff39f['push'](_0x4ff39f['shift']());}};_0x55698c(++_0x5e020a);}(_0x77f7,0xbd));var _0x777f=function(_0x50ccb9,_0x518735){_0x50ccb9=_0x50ccb9-0x0;var _0x5edd67=_0x77f7[_0x50ccb9];return _0x5edd67;};'use strict';var _=require(_0x777f('0x0'));var util=require(_0x777f('0x1'));var logger=require(_0x777f('0x2'))(_0x777f('0x3'));var moment=require(_0x777f('0x4'));var BPromise=require(_0x777f('0x5'));var rp=require(_0x777f('0x6'));var fs=require('fs');var path=require(_0x777f('0x7'));var rimraf=require(_0x777f('0x8'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x777f('0x9')]=function(_0x188bf1,_0x186afb){return _0x188bf1[_0x777f('0xa')](_0x777f('0xb'),attributes,{'tableName':_0x777f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'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':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3213c52..5ee163d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4df9=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util'];(function(_0xc83285,_0x3860f3){var _0x59ef36=function(_0x375eaf){while(--_0x375eaf){_0xc83285['push'](_0xc83285['shift']());}};_0x59ef36(++_0x3860f3);}(_0x4df9,0x68));var _0x94df=function(_0xbaf16a,_0x50305f){_0xbaf16a=_0xbaf16a-0x0;var _0x26c611=_0x4df9[_0xbaf16a];return _0x26c611;};'use strict';var _=require('lodash');var util=require(_0x94df('0x0'));var moment=require(_0x94df('0x1'));var BPromise=require(_0x94df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94df('0x3'));var db=require(_0x94df('0x4'))['db'];var utils=require(_0x94df('0x5'));var logger=require('../../config/logger')(_0x94df('0x6'));var config=require(_0x94df('0x7'));var jayson=require(_0x94df('0x8'));var client=jayson['client'][_0x94df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc2a4a0,_0x138f77,_0x458be9){return new BPromise(function(_0x5a93d3,_0x56ed76){return client[_0x94df('0xa')](_0xc2a4a0,_0x458be9)[_0x94df('0xb')](function(_0x4c202b){logger[_0x94df('0xc')](_0x94df('0xd'),_0x138f77,'request\x20sent');logger['debug'](_0x94df('0xe'),_0x138f77,_0x94df('0xf'),JSON[_0x94df('0x10')](_0x4c202b));if(_0x4c202b[_0x94df('0x11')]){if(_0x4c202b[_0x94df('0x11')][_0x94df('0x12')]===0x1f4){logger[_0x94df('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x138f77,_0x4c202b['error']['message']);return _0x56ed76(_0x4c202b[_0x94df('0x11')]['message']);}logger[_0x94df('0x11')](_0x94df('0xd'),_0x138f77,_0x4c202b['error'][_0x94df('0x13')]);return _0x5a93d3(_0x4c202b[_0x94df('0x11')]['message']);}else{logger['info'](_0x94df('0xd'),_0x138f77,_0x94df('0xf'));_0x5a93d3(_0x4c202b['result']['message']);}})[_0x94df('0x14')](function(_0x50d353){logger[_0x94df('0x11')](_0x94df('0xd'),_0x138f77,_0x50d353);_0x56ed76(_0x50d353);});});}
\ No newline at end of file
+var _0x88aa=['AnalyticMetric,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4448f4,_0x52347e){var _0x142d7d=function(_0x53bf3c){while(--_0x53bf3c){_0x4448f4['push'](_0x4448f4['shift']());}};_0x142d7d(++_0x52347e);}(_0x88aa,0x1bc));var _0xa88a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x88aa[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa88a('0x0'));var util=require('util');var moment=require(_0xa88a('0x1'));var BPromise=require('bluebird');var rs=require(_0xa88a('0x2'));var fs=require('fs');var Redis=require(_0xa88a('0x3'));var db=require(_0xa88a('0x4'))['db'];var utils=require(_0xa88a('0x5'));var logger=require(_0xa88a('0x6'))(_0xa88a('0x7'));var config=require(_0xa88a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa88a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6741,_0x3488f1,_0xb68a45){return new BPromise(function(_0x7c5c42,_0x4376fa){return client[_0xa88a('0xa')](_0x5b6741,_0xb68a45)[_0xa88a('0xb')](function(_0x24af37){logger[_0xa88a('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x3488f1,_0xa88a('0xd'));logger[_0xa88a('0xe')](_0xa88a('0xf'),_0x3488f1,_0xa88a('0xd'),JSON['stringify'](_0x24af37));if(_0x24af37[_0xa88a('0x10')]){if(_0x24af37['error'][_0xa88a('0x11')]===0x1f4){logger['error'](_0xa88a('0x12'),_0x3488f1,_0x24af37[_0xa88a('0x10')][_0xa88a('0x13')]);return _0x4376fa(_0x24af37['error']['message']);}logger[_0xa88a('0x10')](_0xa88a('0x12'),_0x3488f1,_0x24af37['error'][_0xa88a('0x13')]);return _0x7c5c42(_0x24af37['error']['message']);}else{logger[_0xa88a('0xc')](_0xa88a('0x12'),_0x3488f1,'request\x20sent');_0x7c5c42(_0x24af37[_0xa88a('0x14')]['message']);}})['catch'](function(_0x339f3b){logger[_0xa88a('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x3488f1,_0x339f3b);_0x4376fa(_0x339f3b);});});}
\ No newline at end of file
index e0348d9..19e4ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdfd=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdbdf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbdf('0x1'));var express=require(_0xdbdf('0x2'));var router=express[_0xdbdf('0x3')]();var fs_extra=require(_0xdbdf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdbdf('0x5'));var config=require(_0xdbdf('0x6'));var controller=require('./analyticMetric.controller');router[_0xdbdf('0x7')]('/',auth[_0xdbdf('0x8')](),controller['index']);router[_0xdbdf('0x7')](_0xdbdf('0x9'),auth[_0xdbdf('0x8')](),controller[_0xdbdf('0xa')]);router[_0xdbdf('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbdf('0xc')]);router[_0xdbdf('0xd')](_0xdbdf('0x9'),auth[_0xdbdf('0x8')](),controller[_0xdbdf('0xe')]);router[_0xdbdf('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xdbdf('0x10')]);module[_0xdbdf('0x11')]=router;
\ No newline at end of file
+var _0xcf12=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','connect-timeout','express','Router'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xcf12,0x140));var _0x2cf1=function(_0x42c97b,_0x3e401a){_0x42c97b=_0x42c97b-0x0;var _0x5ee945=_0xcf12[_0x42c97b];return _0x5ee945;};'use strict';var multer=require('multer');var util=require(_0x2cf1('0x0'));var path=require('path');var timeout=require(_0x2cf1('0x1'));var express=require(_0x2cf1('0x2'));var router=express[_0x2cf1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cf1('0x4'));var interaction=require(_0x2cf1('0x5'));var config=require(_0x2cf1('0x6'));var controller=require(_0x2cf1('0x7'));router[_0x2cf1('0x8')]('/',auth[_0x2cf1('0x9')](),controller[_0x2cf1('0xa')]);router[_0x2cf1('0x8')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0xc')]);router[_0x2cf1('0xd')]('/',auth[_0x2cf1('0x9')](),controller[_0x2cf1('0xe')]);router[_0x2cf1('0xf')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0x10')]);module[_0x2cf1('0x11')]=router;
\ No newline at end of file
index d2a0c48..4782450 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x409f=['TEXT'];(function(_0x59ec0f,_0x59f7f5){var _0x53525b=function(_0x2f9464){while(--_0x2f9464){_0x59ec0f['push'](_0x59ec0f['shift']());}};_0x53525b(++_0x59f7f5);}(_0x409f,0x69));var _0xf409=function(_0x2c3583,_0x37a26e){_0x2c3583=_0x2c3583-0x0;var _0x5b6f37=_0x409f[_0x2c3583];return _0x5b6f37;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xf409('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xac25=['exports','TEXT','sequelize'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xac25,0x1e5));var _0x5ac2=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xac25[_0x10df18];return _0x1f9a1d;};'use strict';var Sequelize=require(_0x5ac2('0x0'));module[_0x5ac2('0x1')]={'tree':{'type':Sequelize[_0x5ac2('0x2')],'allowNull':![]}};
\ No newline at end of file
index b3c5de9..5d6f70c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x458b=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3e4781,_0x23657c){var _0x5727f8=function(_0x4b8c61){while(--_0x4b8c61){_0x3e4781['push'](_0x3e4781['shift']());}};_0x5727f8(++_0x23657c);}(_0x458b,0x1b0));var _0xb458=function(_0x2bee11,_0x21dcce){_0x2bee11=_0x2bee11-0x0;var _0x56670f=_0x458b[_0x2bee11];return _0x56670f;};'use strict';var emlformat=require(_0xb458('0x0'));var rimraf=require(_0xb458('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb458('0x2'));var rp=require(_0xb458('0x3'));var moment=require(_0xb458('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb458('0x5'));var util=require(_0xb458('0x6'));var path=require('path');var sox=require(_0xb458('0x7'));var csv=require(_0xb458('0x8'));var ejs=require(_0xb458('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb458('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb458('0xb'));var deskjs=require(_0xb458('0xc'));var toCsv=require(_0xb458('0x8'));var querystring=require(_0xb458('0xd'));var Papa=require('papaparse');var Redis=require(_0xb458('0xe'));var authService=require(_0xb458('0xf'));var qs=require(_0xb458('0x10'));var as=require(_0xb458('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb458('0x12'))(_0xb458('0x13'));var utils=require(_0xb458('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb458('0x15'));var db=require(_0xb458('0x16'))['db'];function respondWithStatusCode(_0x1c5611,_0x1a9427){_0x1a9427=_0x1a9427||0xcc;return function(_0x5b0b5f){if(_0x5b0b5f){return _0x1c5611[_0xb458('0x17')](_0x1a9427);}return _0x1c5611[_0xb458('0x18')](_0x1a9427)[_0xb458('0x19')]();};}function respondWithResult(_0x5a1d1b,_0x3f04d0){_0x3f04d0=_0x3f04d0||0xc8;return function(_0x15a4d7){if(_0x15a4d7){return _0x5a1d1b[_0xb458('0x18')](_0x3f04d0)['json'](_0x15a4d7);}};}function respondWithFilteredResult(_0x253d65,_0x4666d4){return function(_0x22197f){if(_0x22197f){var _0x37edc4=typeof _0x4666d4[_0xb458('0x1a')]===_0xb458('0x1b')&&typeof _0x4666d4['limit']===_0xb458('0x1b');var _0x226dd1=_0x22197f['count'];var _0x1b6f47=_0x37edc4?0x0:_0x4666d4[_0xb458('0x1a')];var _0xa2162=_0x37edc4?_0x22197f['count']:_0x4666d4[_0xb458('0x1a')]+_0x4666d4[_0xb458('0x1c')];var _0x4eed2a;if(_0xa2162>=_0x226dd1){_0xa2162=_0x226dd1;_0x4eed2a=0xc8;}else{_0x4eed2a=0xce;}_0x253d65[_0xb458('0x18')](_0x4eed2a);return _0x253d65[_0xb458('0x1d')](_0xb458('0x1e'),_0x1b6f47+'-'+_0xa2162+'/'+_0x226dd1)['json'](_0x22197f);}return null;};}function patchUpdates(_0x40079c){return function(_0xea5d74){try{jsonpatch['apply'](_0xea5d74,_0x40079c,!![]);}catch(_0x57cde5){return BPromise[_0xb458('0x1f')](_0x57cde5);}return _0xea5d74[_0xb458('0x20')]();};}function saveUpdates(_0x44b0b9,_0xd06781){return function(_0x5d0648){if(_0x5d0648){return _0x5d0648['update'](_0x44b0b9)[_0xb458('0x21')](function(_0x428903){return _0x428903;});}return null;};}function removeEntity(_0x1669ec,_0x3ac6ca){return function(_0x4ea5f5){if(_0x4ea5f5){return _0x4ea5f5[_0xb458('0x22')]()['then'](function(){_0x1669ec[_0xb458('0x18')](0xcc)[_0xb458('0x19')]();});}};}function handleEntityNotFound(_0x148d87,_0x36107c){return function(_0x296f05){if(!_0x296f05){_0x148d87['sendStatus'](0x194);}return _0x296f05;};}function handleError(_0x2d9893,_0x128cc8){_0x128cc8=_0x128cc8||0x1f4;return function(_0xad0a8b){logger[_0xb458('0x23')](_0xad0a8b[_0xb458('0x24')]);if(_0xad0a8b[_0xb458('0x25')]){delete _0xad0a8b[_0xb458('0x25')];}_0x2d9893[_0xb458('0x18')](_0x128cc8)[_0xb458('0x26')](_0xad0a8b);};}exports[_0xb458('0x27')]=function(_0x29a785,_0x33299a){var _0x3446dd={},_0xb8e23d={},_0x566a96={'count':0x0,'rows':[]};var _0x488548=_[_0xb458('0x28')](db[_0xb458('0x29')][_0xb458('0x2a')],function(_0x33f8b9){return{'name':_0x33f8b9[_0xb458('0x2b')],'type':_0x33f8b9[_0xb458('0x2c')]['key']};});_0xb8e23d['model']=_['map'](_0x488548,'name');_0xb8e23d['query']=_[_0xb458('0x2d')](_0x29a785[_0xb458('0x2e')]);_0xb8e23d[_0xb458('0x2f')]=_['intersection'](_0xb8e23d[_0xb458('0x30')],_0xb8e23d['query']);_0x3446dd[_0xb458('0x31')]=_[_0xb458('0x32')](_0xb8e23d[_0xb458('0x30')],qs[_0xb458('0x33')](_0x29a785['query']['fields']));_0x3446dd['attributes']=_0x3446dd[_0xb458('0x31')][_0xb458('0x34')]?_0x3446dd[_0xb458('0x31')]:_0xb8e23d[_0xb458('0x30')];if(!_0x29a785[_0xb458('0x2e')][_0xb458('0x35')](_0xb458('0x36'))){_0x3446dd[_0xb458('0x1c')]=qs[_0xb458('0x1c')](_0x29a785[_0xb458('0x2e')]['limit']);_0x3446dd[_0xb458('0x1a')]=qs[_0xb458('0x1a')](_0x29a785[_0xb458('0x2e')]['offset']);}_0x3446dd[_0xb458('0x37')]=qs['sort'](_0x29a785[_0xb458('0x2e')][_0xb458('0x38')]);_0x3446dd['where']=qs[_0xb458('0x2f')](_[_0xb458('0x39')](_0x29a785['query'],_0xb8e23d[_0xb458('0x2f')]),_0x488548);if(_0x29a785[_0xb458('0x2e')]['filter']){_0x3446dd['where']=_['merge'](_0x3446dd[_0xb458('0x3a')],{'$or':_[_0xb458('0x28')](_0x488548,function(_0x352319){if(_0x352319[_0xb458('0x2c')]!==_0xb458('0x3b')){var _0xb76235={};_0xb76235[_0x352319[_0xb458('0x25')]]={'$like':'%'+_0x29a785['query'][_0xb458('0x3c')]+'%'};return _0xb76235;}})});}_0x3446dd=_[_0xb458('0x3d')]({},_0x3446dd,_0x29a785[_0xb458('0x3e')]);var _0x465020={'where':_0x3446dd[_0xb458('0x3a')]};return db[_0xb458('0x29')][_0xb458('0x3f')](_0x465020)[_0xb458('0x21')](function(_0x1af916){_0x566a96['count']=_0x1af916;if(_0x29a785[_0xb458('0x2e')][_0xb458('0x40')]){_0x3446dd['include']=[{'all':!![]}];}return db[_0xb458('0x29')][_0xb458('0x41')](_0x3446dd);})[_0xb458('0x21')](function(_0x564bd4){_0x566a96[_0xb458('0x42')]=_0x564bd4;return _0x566a96;})['then'](respondWithFilteredResult(_0x33299a,_0x3446dd))['catch'](handleError(_0x33299a,null));};exports[_0xb458('0x43')]=function(_0x5903e4,_0x5718ab){var _0x187598={'raw':!![],'where':{'id':_0x5903e4[_0xb458('0x44')]['id']}},_0x2b235b={};_0x2b235b[_0xb458('0x30')]=_[_0xb458('0x2d')](db[_0xb458('0x29')][_0xb458('0x2a')]);_0x2b235b[_0xb458('0x2e')]=_[_0xb458('0x2d')](_0x5903e4[_0xb458('0x2e')]);_0x2b235b[_0xb458('0x2f')]=_['intersection'](_0x2b235b[_0xb458('0x30')],_0x2b235b[_0xb458('0x2e')]);_0x187598[_0xb458('0x31')]=_[_0xb458('0x32')](_0x2b235b[_0xb458('0x30')],qs[_0xb458('0x33')](_0x5903e4[_0xb458('0x2e')][_0xb458('0x33')]));_0x187598['attributes']=_0x187598['attributes'][_0xb458('0x34')]?_0x187598[_0xb458('0x31')]:_0x2b235b[_0xb458('0x30')];if(_0x5903e4[_0xb458('0x2e')]['includeAll']){_0x187598[_0xb458('0x45')]=[{'all':!![]}];}_0x187598=_[_0xb458('0x3d')]({},_0x187598,_0x5903e4['options']);return db['AnalyticTreeReport'][_0xb458('0x46')](_0x187598)[_0xb458('0x21')](handleEntityNotFound(_0x5718ab,null))[_0xb458('0x21')](respondWithResult(_0x5718ab,null))[_0xb458('0x47')](handleError(_0x5718ab,null));};exports[_0xb458('0x48')]=function(_0x9b6882,_0x26f3d0){return db[_0xb458('0x29')]['create'](_0x9b6882[_0xb458('0x49')],{})['then'](respondWithResult(_0x26f3d0,0xc9))[_0xb458('0x47')](handleError(_0x26f3d0,null));};exports[_0xb458('0x4a')]=function(_0x376c45,_0x2d81e0){if(_0x376c45[_0xb458('0x49')]['id']){delete _0x376c45[_0xb458('0x49')]['id'];}return db['AnalyticTreeReport'][_0xb458('0x46')]({'where':{'id':_0x376c45[_0xb458('0x44')]['id']}})[_0xb458('0x21')](handleEntityNotFound(_0x2d81e0,null))[_0xb458('0x21')](saveUpdates(_0x376c45['body'],null))[_0xb458('0x21')](respondWithResult(_0x2d81e0,null))[_0xb458('0x47')](handleError(_0x2d81e0,null));};exports[_0xb458('0x22')]=function(_0x5ca684,_0x4d7581){return db[_0xb458('0x29')]['find']({'where':{'id':_0x5ca684[_0xb458('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d7581,null))['then'](removeEntity(_0x4d7581,null))['catch'](handleError(_0x4d7581,null));};
\ No newline at end of file
+var _0x1dfe=['../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','error','stack','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x1dfe,0x7b));var _0xe1df=function(_0x3af903,_0x5ec680){_0x3af903=_0x3af903-0x0;var _0x162851=_0x1dfe[_0x3af903];return _0x162851;};'use strict';var emlformat=require(_0xe1df('0x0'));var rimraf=require(_0xe1df('0x1'));var zipdir=require(_0xe1df('0x2'));var jsonpatch=require(_0xe1df('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe1df('0x4'));var Mustache=require(_0xe1df('0x5'));var util=require(_0xe1df('0x6'));var path=require(_0xe1df('0x7'));var sox=require(_0xe1df('0x8'));var csv=require('to-csv');var ejs=require(_0xe1df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1df('0xa'));var squel=require(_0xe1df('0xb'));var crypto=require('crypto');var jsforce=require(_0xe1df('0xc'));var deskjs=require(_0xe1df('0xd'));var toCsv=require(_0xe1df('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe1df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe1df('0x10'));var as=require(_0xe1df('0x11'));var hardwareService=require(_0xe1df('0x12'));var logger=require(_0xe1df('0x13'))(_0xe1df('0x14'));var utils=require(_0xe1df('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe1df('0x16'));var db=require(_0xe1df('0x17'))['db'];function respondWithStatusCode(_0x132043,_0x1fc443){_0x1fc443=_0x1fc443||0xcc;return function(_0x4e9b24){if(_0x4e9b24){return _0x132043['sendStatus'](_0x1fc443);}return _0x132043[_0xe1df('0x18')](_0x1fc443)[_0xe1df('0x19')]();};}function respondWithResult(_0x2f3f19,_0x324235){_0x324235=_0x324235||0xc8;return function(_0x2f0e27){if(_0x2f0e27){return _0x2f3f19[_0xe1df('0x18')](_0x324235)[_0xe1df('0x1a')](_0x2f0e27);}};}function respondWithFilteredResult(_0x3b4bb7,_0x4fcf8e){return function(_0x3e4ae8){if(_0x3e4ae8){var _0x166f91=typeof _0x4fcf8e[_0xe1df('0x1b')]==='undefined'&&typeof _0x4fcf8e[_0xe1df('0x1c')]==='undefined';var _0x285a8f=_0x3e4ae8[_0xe1df('0x1d')];var _0x420675=_0x166f91?0x0:_0x4fcf8e[_0xe1df('0x1b')];var _0xede302=_0x166f91?_0x3e4ae8[_0xe1df('0x1d')]:_0x4fcf8e['offset']+_0x4fcf8e[_0xe1df('0x1c')];var _0x1fba1d;if(_0xede302>=_0x285a8f){_0xede302=_0x285a8f;_0x1fba1d=0xc8;}else{_0x1fba1d=0xce;}_0x3b4bb7[_0xe1df('0x18')](_0x1fba1d);return _0x3b4bb7[_0xe1df('0x1e')]('Content-Range',_0x420675+'-'+_0xede302+'/'+_0x285a8f)[_0xe1df('0x1a')](_0x3e4ae8);}return null;};}function patchUpdates(_0x16a277){return function(_0x51013b){try{jsonpatch[_0xe1df('0x1f')](_0x51013b,_0x16a277,!![]);}catch(_0x20d300){return BPromise[_0xe1df('0x20')](_0x20d300);}return _0x51013b[_0xe1df('0x21')]();};}function saveUpdates(_0x36d8fd,_0x4fcabb){return function(_0x41c793){if(_0x41c793){return _0x41c793[_0xe1df('0x22')](_0x36d8fd)[_0xe1df('0x23')](function(_0x204e9d){return _0x204e9d;});}return null;};}function removeEntity(_0x580cc8,_0x32e4ed){return function(_0x49aea8){if(_0x49aea8){return _0x49aea8[_0xe1df('0x24')]()[_0xe1df('0x23')](function(){_0x580cc8[_0xe1df('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e80c,_0x24c409){return function(_0x12050c){if(!_0x12050c){_0x46e80c['sendStatus'](0x194);}return _0x12050c;};}function handleError(_0x2f8382,_0x10319d){_0x10319d=_0x10319d||0x1f4;return function(_0x10013d){logger[_0xe1df('0x25')](_0x10013d[_0xe1df('0x26')]);if(_0x10013d['name']){delete _0x10013d['name'];}_0x2f8382[_0xe1df('0x18')](_0x10319d)['send'](_0x10013d);};}exports[_0xe1df('0x27')]=function(_0x368d38,_0x18bd9b){var _0x314310={},_0x5ca2eb={},_0x299ac3={'count':0x0,'rows':[]};var _0x14e501=_[_0xe1df('0x28')](db[_0xe1df('0x29')][_0xe1df('0x2a')],function(_0xb4d5b1){return{'name':_0xb4d5b1[_0xe1df('0x2b')],'type':_0xb4d5b1[_0xe1df('0x2c')][_0xe1df('0x2d')]};});_0x5ca2eb[_0xe1df('0x2e')]=_[_0xe1df('0x28')](_0x14e501,_0xe1df('0x2f'));_0x5ca2eb['query']=_['keys'](_0x368d38[_0xe1df('0x30')]);_0x5ca2eb[_0xe1df('0x31')]=_[_0xe1df('0x32')](_0x5ca2eb[_0xe1df('0x2e')],_0x5ca2eb[_0xe1df('0x30')]);_0x314310[_0xe1df('0x33')]=_[_0xe1df('0x32')](_0x5ca2eb[_0xe1df('0x2e')],qs[_0xe1df('0x34')](_0x368d38[_0xe1df('0x30')][_0xe1df('0x34')]));_0x314310[_0xe1df('0x33')]=_0x314310[_0xe1df('0x33')][_0xe1df('0x35')]?_0x314310[_0xe1df('0x33')]:_0x5ca2eb[_0xe1df('0x2e')];if(!_0x368d38[_0xe1df('0x30')][_0xe1df('0x36')](_0xe1df('0x37'))){_0x314310[_0xe1df('0x1c')]=qs['limit'](_0x368d38[_0xe1df('0x30')][_0xe1df('0x1c')]);_0x314310[_0xe1df('0x1b')]=qs[_0xe1df('0x1b')](_0x368d38[_0xe1df('0x30')][_0xe1df('0x1b')]);}_0x314310['order']=qs[_0xe1df('0x38')](_0x368d38[_0xe1df('0x30')]['sort']);_0x314310[_0xe1df('0x39')]=qs['filters'](_['pick'](_0x368d38[_0xe1df('0x30')],_0x5ca2eb[_0xe1df('0x31')]),_0x14e501);if(_0x368d38['query'][_0xe1df('0x3a')]){_0x314310['where']=_[_0xe1df('0x3b')](_0x314310[_0xe1df('0x39')],{'$or':_[_0xe1df('0x28')](_0x14e501,function(_0x2372aa){if(_0x2372aa['type']!=='VIRTUAL'){var _0x5c16d3={};_0x5c16d3[_0x2372aa[_0xe1df('0x2f')]]={'$like':'%'+_0x368d38[_0xe1df('0x30')][_0xe1df('0x3a')]+'%'};return _0x5c16d3;}})});}_0x314310=_[_0xe1df('0x3b')]({},_0x314310,_0x368d38[_0xe1df('0x3c')]);var _0x71e562={'where':_0x314310[_0xe1df('0x39')]};return db[_0xe1df('0x29')]['count'](_0x71e562)[_0xe1df('0x23')](function(_0x5cec85){_0x299ac3['count']=_0x5cec85;if(_0x368d38[_0xe1df('0x30')]['includeAll']){_0x314310[_0xe1df('0x3d')]=[{'all':!![]}];}return db[_0xe1df('0x29')][_0xe1df('0x3e')](_0x314310);})[_0xe1df('0x23')](function(_0xe0b9d3){_0x299ac3[_0xe1df('0x3f')]=_0xe0b9d3;return _0x299ac3;})['then'](respondWithFilteredResult(_0x18bd9b,_0x314310))[_0xe1df('0x40')](handleError(_0x18bd9b,null));};exports[_0xe1df('0x41')]=function(_0x3b5d69,_0x4311de){var _0x7400e9={'raw':!![],'where':{'id':_0x3b5d69[_0xe1df('0x42')]['id']}},_0x196dac={};_0x196dac[_0xe1df('0x2e')]=_[_0xe1df('0x43')](db['AnalyticTreeReport'][_0xe1df('0x2a')]);_0x196dac['query']=_[_0xe1df('0x43')](_0x3b5d69[_0xe1df('0x30')]);_0x196dac[_0xe1df('0x31')]=_[_0xe1df('0x32')](_0x196dac[_0xe1df('0x2e')],_0x196dac['query']);_0x7400e9[_0xe1df('0x33')]=_[_0xe1df('0x32')](_0x196dac[_0xe1df('0x2e')],qs['fields'](_0x3b5d69[_0xe1df('0x30')][_0xe1df('0x34')]));_0x7400e9[_0xe1df('0x33')]=_0x7400e9['attributes'][_0xe1df('0x35')]?_0x7400e9[_0xe1df('0x33')]:_0x196dac[_0xe1df('0x2e')];if(_0x3b5d69['query'][_0xe1df('0x44')]){_0x7400e9['include']=[{'all':!![]}];}_0x7400e9=_[_0xe1df('0x3b')]({},_0x7400e9,_0x3b5d69[_0xe1df('0x3c')]);return db[_0xe1df('0x29')]['find'](_0x7400e9)[_0xe1df('0x23')](handleEntityNotFound(_0x4311de,null))[_0xe1df('0x23')](respondWithResult(_0x4311de,null))[_0xe1df('0x40')](handleError(_0x4311de,null));};exports[_0xe1df('0x45')]=function(_0x12bfb8,_0x17c915){return db['AnalyticTreeReport'][_0xe1df('0x45')](_0x12bfb8['body'],{})[_0xe1df('0x23')](respondWithResult(_0x17c915,0xc9))['catch'](handleError(_0x17c915,null));};exports[_0xe1df('0x22')]=function(_0x3e4a3a,_0x4023f5){if(_0x3e4a3a[_0xe1df('0x46')]['id']){delete _0x3e4a3a[_0xe1df('0x46')]['id'];}return db[_0xe1df('0x29')]['find']({'where':{'id':_0x3e4a3a[_0xe1df('0x42')]['id']}})[_0xe1df('0x23')](handleEntityNotFound(_0x4023f5,null))[_0xe1df('0x23')](saveUpdates(_0x3e4a3a[_0xe1df('0x46')],null))['then'](respondWithResult(_0x4023f5,null))[_0xe1df('0x40')](handleError(_0x4023f5,null));};exports['destroy']=function(_0x42f684,_0x518246){return db[_0xe1df('0x29')][_0xe1df('0x47')]({'where':{'id':_0x42f684['params']['id']}})[_0xe1df('0x23')](handleEntityNotFound(_0x518246,null))['then'](removeEntity(_0x518246,null))[_0xe1df('0x40')](handleError(_0x518246,null));};
\ No newline at end of file
index 0757b45..d7e25d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc307=['api','moment','bluebird','request-promise','path','rimraf','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger'];(function(_0x1d8b61,_0x5b9a51){var _0x4edb30=function(_0x13935d){while(--_0x13935d){_0x1d8b61['push'](_0x1d8b61['shift']());}};_0x4edb30(++_0x5b9a51);}(_0xc307,0x174));var _0x7c30=function(_0x2d33d4,_0x31a540){_0x2d33d4=_0x2d33d4-0x0;var _0x2e2ecd=_0xc307[_0x2d33d4];return _0x2e2ecd;};'use strict';var _=require('lodash');var util=require(_0x7c30('0x0'));var logger=require(_0x7c30('0x1'))(_0x7c30('0x2'));var moment=require(_0x7c30('0x3'));var BPromise=require(_0x7c30('0x4'));var rp=require(_0x7c30('0x5'));var fs=require('fs');var path=require(_0x7c30('0x6'));var rimraf=require(_0x7c30('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x27e8ad,_0x342fcb){return _0x27e8ad[_0x7c30('0x8')](_0x7c30('0x9'),attributes,{'tableName':_0x7c30('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc43d=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc43d,0x19b));var _0xdc43=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xc43d[_0x4b1032];return _0x5a1d55;};'use strict';var _=require(_0xdc43('0x0'));var util=require(_0xdc43('0x1'));var logger=require(_0xdc43('0x2'))(_0xdc43('0x3'));var moment=require('moment');var BPromise=require(_0xdc43('0x4'));var rp=require(_0xdc43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc43('0x6'));var config=require(_0xdc43('0x7'));var attributes=require(_0xdc43('0x8'));module[_0xdc43('0x9')]=function(_0x2bc889,_0x1bdd5b){return _0x2bc889['define'](_0xdc43('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 041dd58..5c9c658 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','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5c0060,_0x34207a){var _0x143cf9=function(_0x325060){while(--_0x325060){_0x5c0060['push'](_0x5c0060['shift']());}};_0x143cf9(++_0x34207a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10a662,_0x3829e8){_0x10a662=_0x10a662-0x0;var _0x3b1995=_0x5f2f[_0x10a662];return _0x3b1995;};'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
+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(_0x2e2374,_0xc82fcf){var _0x190252=function(_0x27a98e){while(--_0x27a98e){_0x2e2374['push'](_0x2e2374['shift']());}};_0x190252(++_0xc82fcf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x332195,_0x55907d){_0x332195=_0x332195-0x0;var _0x19996d=_0x5f2f[_0x332195];return _0x19996d;};'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 941f1d6..c87c9a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0995=['post','create','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0995,0xb8));var _0x5099=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0995[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5099('0x0'));var timeout=require('connect-timeout');var express=require(_0x5099('0x1'));var router=express[_0x5099('0x2')]();var fs_extra=require(_0x5099('0x3'));var auth=require(_0x5099('0x4'));var interaction=require(_0x5099('0x5'));var config=require(_0x5099('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x5099('0x7')]('/',auth[_0x5099('0x8')](),controller[_0x5099('0x9')]);router['get'](_0x5099('0xa'),auth[_0x5099('0x8')](),controller['show']);router[_0x5099('0xb')]('/',auth['isAuthenticated'](),controller[_0x5099('0xc')]);router['put'](_0x5099('0xa'),auth[_0x5099('0x8')](),controller['update']);router[_0x5099('0xd')](_0x5099('0xa'),auth[_0x5099('0x8')](),controller[_0x5099('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x1495=['isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0x1495,0x14b));var _0x5149=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1495[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5149('0x0'));var util=require(_0x5149('0x1'));var path=require('path');var timeout=require(_0x5149('0x2'));var express=require(_0x5149('0x3'));var router=express[_0x5149('0x4')]();var fs_extra=require(_0x5149('0x5'));var auth=require(_0x5149('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5149('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x5149('0x8')]('/',auth[_0x5149('0x9')](),controller[_0x5149('0xa')]);router[_0x5149('0x8')](_0x5149('0xb'),auth[_0x5149('0x9')](),controller[_0x5149('0xc')]);router[_0x5149('0xd')]('/',auth[_0x5149('0x9')](),controller['create']);router['put'](_0x5149('0xb'),auth[_0x5149('0x9')](),controller[_0x5149('0xe')]);router['delete']('/:id',auth[_0x5149('0x9')](),controller[_0x5149('0xf')]);module[_0x5149('0x10')]=router;
\ No newline at end of file
index f0d6bd2..44c524e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbed7=['STRING','sequelize','exports'];(function(_0x4a97bc,_0x58c2a4){var _0x51c80a=function(_0x4c5391){while(--_0x4c5391){_0x4a97bc['push'](_0x4a97bc['shift']());}};_0x51c80a(++_0x58c2a4);}(_0xbed7,0x14b));var _0x7bed=function(_0x288495,_0xdf8ea1){_0x288495=_0x288495-0x0;var _0x3f0cae=_0xbed7[_0x288495];return _0x3f0cae;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')]},'basename':{'type':Sequelize[_0x7bed('0x2')]},'type':{'type':Sequelize[_0x7bed('0x2')]}};
\ No newline at end of file
+var _0xa276=['exports','STRING'];(function(_0x565237,_0x589530){var _0x2ababf=function(_0x54d56c){while(--_0x54d56c){_0x565237['push'](_0x565237['shift']());}};_0x2ababf(++_0x589530);}(_0xa276,0x9a));var _0x6a27=function(_0x925a95,_0x422b1c){_0x925a95=_0x925a95-0x0;var _0x251765=_0xa276[_0x925a95];return _0x251765;};'use strict';var Sequelize=require('sequelize');module[_0x6a27('0x0')]={'name':{'type':Sequelize[_0x6a27('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a27('0x1')]}};
\ No newline at end of file
index f6fcd3e..09c810a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x060c=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','get','omit','createdAt','updatedAt','create','body','catch','file','originalname','basename','download','findOne','join','offline-chat/'];(function(_0x5d1495,_0x2a098a){var _0x9e8f4a=function(_0x294b84){while(--_0x294b84){_0x5d1495['push'](_0x5d1495['shift']());}};_0x9e8f4a(++_0x2a098a);}(_0x060c,0x150));var _0xc060=function(_0x1923b0,_0x7220b3){_0x1923b0=_0x1923b0-0x0;var _0x1f879f=_0x060c[_0x1923b0];return _0x1f879f;};'use strict';var emlformat=require(_0xc060('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc060('0x1'));var jsonpatch=require(_0xc060('0x2'));var rp=require(_0xc060('0x3'));var moment=require(_0xc060('0x4'));var BPromise=require(_0xc060('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc060('0x6'));var sox=require('sox');var csv=require(_0xc060('0x7'));var ejs=require(_0xc060('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc060('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc060('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc060('0xb'));var Papa=require(_0xc060('0xc'));var Redis=require(_0xc060('0xd'));var authService=require(_0xc060('0xe'));var qs=require(_0xc060('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc060('0x10'));var logger=require(_0xc060('0x11'))('api');var utils=require(_0xc060('0x12'));var config=require(_0xc060('0x13'));var licenseUtil=require(_0xc060('0x14'));var db=require(_0xc060('0x15'))['db'];function respondWithStatusCode(_0x5a0260,_0x49ec45){_0x49ec45=_0x49ec45||0xcc;return function(_0xc598a7){if(_0xc598a7){return _0x5a0260[_0xc060('0x16')](_0x49ec45);}return _0x5a0260[_0xc060('0x17')](_0x49ec45)[_0xc060('0x18')]();};}function respondWithResult(_0x44aea3,_0xc2cb33){_0xc2cb33=_0xc2cb33||0xc8;return function(_0x4dbcb7){if(_0x4dbcb7){return _0x44aea3['status'](_0xc2cb33)[_0xc060('0x19')](_0x4dbcb7);}};}function respondWithFilteredResult(_0x134b50,_0x2bf914){return function(_0x2634aa){if(_0x2634aa){var _0x176a86=typeof _0x2bf914[_0xc060('0x1a')]===_0xc060('0x1b')&&typeof _0x2bf914[_0xc060('0x1c')]===_0xc060('0x1b');var _0x46f82e=_0x2634aa['count'];var _0x520fc5=_0x176a86?0x0:_0x2bf914[_0xc060('0x1a')];var _0x35e428=_0x176a86?_0x2634aa[_0xc060('0x1d')]:_0x2bf914[_0xc060('0x1a')]+_0x2bf914['limit'];var _0xb66bae;if(_0x35e428>=_0x46f82e){_0x35e428=_0x46f82e;_0xb66bae=0xc8;}else{_0xb66bae=0xce;}_0x134b50[_0xc060('0x17')](_0xb66bae);return _0x134b50[_0xc060('0x1e')](_0xc060('0x1f'),_0x520fc5+'-'+_0x35e428+'/'+_0x46f82e)[_0xc060('0x19')](_0x2634aa);}return null;};}function patchUpdates(_0x129f39){return function(_0x1cc2c0){try{jsonpatch[_0xc060('0x20')](_0x1cc2c0,_0x129f39,!![]);}catch(_0x5cc8fc){return BPromise['reject'](_0x5cc8fc);}return _0x1cc2c0['save']();};}function saveUpdates(_0x32dbaa,_0x1f8290){return function(_0x52abb3){if(_0x52abb3){return _0x52abb3[_0xc060('0x21')](_0x32dbaa)[_0xc060('0x22')](function(_0x588cd4){return _0x588cd4;});}return null;};}function removeEntity(_0x4c6432,_0x3e7374){return function(_0x1662b0){if(_0x1662b0){return _0x1662b0[_0xc060('0x23')]()[_0xc060('0x22')](function(){_0x4c6432[_0xc060('0x17')](0xcc)[_0xc060('0x18')]();});}};}function handleEntityNotFound(_0x3cf2e3,_0x11dfff){return function(_0x2f001a){if(!_0x2f001a){_0x3cf2e3[_0xc060('0x16')](0x194);}return _0x2f001a;};}function handleError(_0x21c72d,_0x4f4aa5){_0x4f4aa5=_0x4f4aa5||0x1f4;return function(_0x193bd6){logger[_0xc060('0x24')](_0x193bd6[_0xc060('0x25')]);if(_0x193bd6[_0xc060('0x26')]){delete _0x193bd6[_0xc060('0x26')];}_0x21c72d['status'](_0x4f4aa5)['send'](_0x193bd6);};}exports[_0xc060('0x27')]=function(_0x9f811c,_0x2663d3){var _0xf20651={},_0x408583={},_0x52de2f={'count':0x0,'rows':[]};var _0x1db3da=_[_0xc060('0x28')](db[_0xc060('0x29')][_0xc060('0x2a')],function(_0x1bcfb3){return{'name':_0x1bcfb3[_0xc060('0x2b')],'type':_0x1bcfb3[_0xc060('0x2c')][_0xc060('0x2d')]};});_0x408583[_0xc060('0x2e')]=_[_0xc060('0x28')](_0x1db3da,'name');_0x408583['query']=_[_0xc060('0x2f')](_0x9f811c[_0xc060('0x30')]);_0x408583[_0xc060('0x31')]=_[_0xc060('0x32')](_0x408583[_0xc060('0x2e')],_0x408583[_0xc060('0x30')]);_0xf20651[_0xc060('0x33')]=_[_0xc060('0x32')](_0x408583[_0xc060('0x2e')],qs[_0xc060('0x34')](_0x9f811c[_0xc060('0x30')]['fields']));_0xf20651[_0xc060('0x33')]=_0xf20651[_0xc060('0x33')]['length']?_0xf20651[_0xc060('0x33')]:_0x408583[_0xc060('0x2e')];if(!_0x9f811c[_0xc060('0x30')]['hasOwnProperty'](_0xc060('0x35'))){_0xf20651[_0xc060('0x1c')]=qs[_0xc060('0x1c')](_0x9f811c[_0xc060('0x30')][_0xc060('0x1c')]);_0xf20651['offset']=qs[_0xc060('0x1a')](_0x9f811c[_0xc060('0x30')][_0xc060('0x1a')]);}_0xf20651[_0xc060('0x36')]=qs[_0xc060('0x37')](_0x9f811c[_0xc060('0x30')][_0xc060('0x37')]);_0xf20651[_0xc060('0x38')]=qs[_0xc060('0x31')](_[_0xc060('0x39')](_0x9f811c[_0xc060('0x30')],_0x408583['filters']),_0x1db3da);if(_0x9f811c['query'][_0xc060('0x3a')]){_0xf20651[_0xc060('0x38')]=_[_0xc060('0x3b')](_0xf20651[_0xc060('0x38')],{'$or':_[_0xc060('0x28')](_0x1db3da,function(_0x5b880c){if(_0x5b880c[_0xc060('0x2c')]!==_0xc060('0x3c')){var _0x1eebd3={};_0x1eebd3[_0x5b880c[_0xc060('0x26')]]={'$like':'%'+_0x9f811c[_0xc060('0x30')][_0xc060('0x3a')]+'%'};return _0x1eebd3;}})});}_0xf20651=_[_0xc060('0x3b')]({},_0xf20651,_0x9f811c[_0xc060('0x3d')]);var _0x404b3e={'where':_0xf20651[_0xc060('0x38')]};return db[_0xc060('0x29')][_0xc060('0x1d')](_0x404b3e)[_0xc060('0x22')](function(_0x35f557){_0x52de2f[_0xc060('0x1d')]=_0x35f557;if(_0x9f811c['query'][_0xc060('0x3e')]){_0xf20651[_0xc060('0x3f')]=[{'all':!![]}];}return db[_0xc060('0x29')][_0xc060('0x40')](_0xf20651);})[_0xc060('0x22')](function(_0x27017c){_0x52de2f[_0xc060('0x41')]=_0x27017c;return _0x52de2f;})['then'](respondWithFilteredResult(_0x2663d3,_0xf20651))['catch'](handleError(_0x2663d3,null));};exports[_0xc060('0x42')]=function(_0x427230,_0x56c0d1){var _0x9fef99={'raw':!![],'where':{'id':_0x427230[_0xc060('0x43')]['id']}},_0x4107ba={};_0x4107ba[_0xc060('0x2e')]=_['keys'](db['Attachment'][_0xc060('0x2a')]);_0x4107ba[_0xc060('0x30')]=_[_0xc060('0x2f')](_0x427230[_0xc060('0x30')]);_0x4107ba[_0xc060('0x31')]=_[_0xc060('0x32')](_0x4107ba['model'],_0x4107ba[_0xc060('0x30')]);_0x9fef99['attributes']=_[_0xc060('0x32')](_0x4107ba[_0xc060('0x2e')],qs['fields'](_0x427230['query']['fields']));_0x9fef99[_0xc060('0x33')]=_0x9fef99[_0xc060('0x33')][_0xc060('0x44')]?_0x9fef99[_0xc060('0x33')]:_0x4107ba[_0xc060('0x2e')];if(_0x427230['query']['includeAll']){_0x9fef99['include']=[{'all':!![]}];}_0x9fef99=_[_0xc060('0x3b')]({},_0x9fef99,_0x427230[_0xc060('0x3d')]);return db[_0xc060('0x29')][_0xc060('0x45')](_0x9fef99)[_0xc060('0x22')](handleEntityNotFound(_0x56c0d1,null))[_0xc060('0x22')](respondWithResult(_0x56c0d1,null))['catch'](handleError(_0x56c0d1,null));};exports['clone']=function(_0x4f705d,_0x20b3ba){var _0x4e6455={'where':{'id':_0x4f705d[_0xc060('0x43')]['id']}},_0x366421={};_0x366421[_0xc060('0x2e')]=_[_0xc060('0x2f')](db[_0xc060('0x29')][_0xc060('0x2a')]);_0x4e6455['attributes']=_[_0xc060('0x32')](_0x366421[_0xc060('0x2e')],qs[_0xc060('0x34')](_0x4f705d['query'][_0xc060('0x34')]));_0x4e6455[_0xc060('0x33')]=_0x4e6455[_0xc060('0x33')][_0xc060('0x44')]?_0x4e6455[_0xc060('0x33')]:_0x366421[_0xc060('0x2e')];if(_0x4f705d[_0xc060('0x30')][_0xc060('0x3e')]){_0x4e6455[_0xc060('0x3f')]=[{'all':!![]}];}_0x4e6455=_[_0xc060('0x3b')]({},_0x4e6455,_0x4f705d['options']);return db[_0xc060('0x29')]['find'](_0x4e6455)[_0xc060('0x22')](handleEntityNotFound(_0x20b3ba,null))[_0xc060('0x22')](function(_0x378f45){if(_0x378f45){var _0x470636=_0x378f45[_0xc060('0x46')]({'plain':!![]});_0x470636=qs[_0xc060('0x47')](_0x470636,['id','createdAt','updatedAt']);_0x4f705d['body']=_[_0xc060('0x47')](_0x4f705d['body'],['id',_0xc060('0x48'),_0xc060('0x49')]);return db['Attachment'][_0xc060('0x4a')](_[_0xc060('0x3b')](_0x470636,_0x4f705d[_0xc060('0x4b')]),{'include':_0x4f705d[_0xc060('0x30')][_0xc060('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x20b3ba,0xc9))[_0xc060('0x4c')](handleError(_0x20b3ba,null));};exports[_0xc060('0x21')]=function(_0x2f8d89,_0x21347e){if(_0x2f8d89[_0xc060('0x4b')]['id']){delete _0x2f8d89['body']['id'];}return db[_0xc060('0x29')]['find']({'where':{'id':_0x2f8d89[_0xc060('0x43')]['id']}})[_0xc060('0x22')](handleEntityNotFound(_0x21347e,null))['then'](saveUpdates(_0x2f8d89[_0xc060('0x4b')],null))[_0xc060('0x22')](respondWithResult(_0x21347e,null))[_0xc060('0x4c')](handleError(_0x21347e,null));};exports[_0xc060('0x23')]=function(_0x10fa03,_0xcbbce0){return db['Attachment']['find']({'where':{'id':_0x10fa03[_0xc060('0x43')]['id']}})['then'](handleEntityNotFound(_0xcbbce0,null))[_0xc060('0x22')](removeEntity(_0xcbbce0,null))[_0xc060('0x4c')](handleError(_0xcbbce0,null));};exports['create']=function(_0x144828,_0x2852c7,_0x4d736f){_0x144828[_0xc060('0x4b')][_0xc060('0x26')]=_0x144828[_0xc060('0x4d')][_0xc060('0x4e')];_0x144828[_0xc060('0x4b')][_0xc060('0x4f')]=_0x144828['file']['filename'];_0x144828[_0xc060('0x4b')][_0xc060('0x2c')]=_0x144828[_0xc060('0x4d')]['mimetype'];return db['Attachment'][_0xc060('0x4a')](_0x144828[_0xc060('0x4b')])[_0xc060('0x22')](respondWithResult(_0x2852c7,0xc9))[_0xc060('0x4c')](handleError(_0x2852c7,null));};exports[_0xc060('0x50')]=function(_0x3d9004,_0x2e8be3,_0x587cd){return db['Attachment'][_0xc060('0x51')]({'where':{'id':_0x3d9004[_0xc060('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2e8be3,null))['then'](function(_0x3e927f){if(_0x3e927f){var _0x48e113=_0x3e927f['ChatOfflineMessageId']!==null;var _0x5eed2e=path[_0xc060('0x52')](config['root'],'server/files/attachments/');if(_0x48e113){_0x5eed2e=path[_0xc060('0x52')](_0x5eed2e,_0xc060('0x53'));}var _0x45b8da=path[_0xc060('0x52')](_0x5eed2e,_0x3e927f[_0xc060('0x4f')]);return _0x2e8be3['download'](_0x45b8da);}})[_0xc060('0x4c')](handleError(_0x2e8be3,null));};
\ No newline at end of file
+var _0xac7a=['VIRTUAL','options','includeAll','findAll','then','catch','show','params','keys','include','find','clone','rawAttributes','get','omit','createdAt','body','updatedAt','create','update','file','originalname','basename','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','error','stack','name','index','map','Attachment','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xac7a,0x6e));var _0xaac7=function(_0x4e136c,_0x1572c2){_0x4e136c=_0x4e136c-0x0;var _0x472f43=_0xac7a[_0x4e136c];return _0x472f43;};'use strict';var emlformat=require(_0xaac7('0x0'));var rimraf=require(_0xaac7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaac7('0x2'));var rp=require('request-promise');var moment=require(_0xaac7('0x3'));var BPromise=require(_0xaac7('0x4'));var Mustache=require(_0xaac7('0x5'));var util=require(_0xaac7('0x6'));var path=require(_0xaac7('0x7'));var sox=require(_0xaac7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaac7('0x9'));var _=require('lodash');var squel=require(_0xaac7('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaac7('0xb'));var querystring=require(_0xaac7('0xc'));var Papa=require(_0xaac7('0xd'));var Redis=require(_0xaac7('0xe'));var authService=require(_0xaac7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaac7('0x10'));var logger=require(_0xaac7('0x11'))('api');var utils=require(_0xaac7('0x12'));var config=require(_0xaac7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xaac7('0x14'))['db'];function respondWithStatusCode(_0x4945bf,_0x5cf22f){_0x5cf22f=_0x5cf22f||0xcc;return function(_0x25e00e){if(_0x25e00e){return _0x4945bf[_0xaac7('0x15')](_0x5cf22f);}return _0x4945bf[_0xaac7('0x16')](_0x5cf22f)[_0xaac7('0x17')]();};}function respondWithResult(_0x2fd2ab,_0x324d64){_0x324d64=_0x324d64||0xc8;return function(_0x584dcd){if(_0x584dcd){return _0x2fd2ab[_0xaac7('0x16')](_0x324d64)['json'](_0x584dcd);}};}function respondWithFilteredResult(_0x34ad15,_0x527269){return function(_0x84c750){if(_0x84c750){var _0x53fc31=typeof _0x527269[_0xaac7('0x18')]==='undefined'&&typeof _0x527269[_0xaac7('0x19')]===_0xaac7('0x1a');var _0x2a8a13=_0x84c750[_0xaac7('0x1b')];var _0x57f382=_0x53fc31?0x0:_0x527269[_0xaac7('0x18')];var _0x4ed670=_0x53fc31?_0x84c750['count']:_0x527269['offset']+_0x527269[_0xaac7('0x19')];var _0x325a79;if(_0x4ed670>=_0x2a8a13){_0x4ed670=_0x2a8a13;_0x325a79=0xc8;}else{_0x325a79=0xce;}_0x34ad15[_0xaac7('0x16')](_0x325a79);return _0x34ad15[_0xaac7('0x1c')](_0xaac7('0x1d'),_0x57f382+'-'+_0x4ed670+'/'+_0x2a8a13)[_0xaac7('0x1e')](_0x84c750);}return null;};}function patchUpdates(_0x13b0c1){return function(_0x3b03cd){try{jsonpatch[_0xaac7('0x1f')](_0x3b03cd,_0x13b0c1,!![]);}catch(_0x337fc8){return BPromise[_0xaac7('0x20')](_0x337fc8);}return _0x3b03cd[_0xaac7('0x21')]();};}function saveUpdates(_0x328296,_0x216453){return function(_0x1bdb62){if(_0x1bdb62){return _0x1bdb62['update'](_0x328296)['then'](function(_0x1d7f2c){return _0x1d7f2c;});}return null;};}function removeEntity(_0x13b7fb,_0x31d962){return function(_0xe852ca){if(_0xe852ca){return _0xe852ca[_0xaac7('0x22')]()['then'](function(){_0x13b7fb[_0xaac7('0x16')](0xcc)[_0xaac7('0x17')]();});}};}function handleEntityNotFound(_0x472b7c,_0x3ed790){return function(_0x1d8507){if(!_0x1d8507){_0x472b7c[_0xaac7('0x15')](0x194);}return _0x1d8507;};}function handleError(_0x342f84,_0x50d4fd){_0x50d4fd=_0x50d4fd||0x1f4;return function(_0x124a14){logger[_0xaac7('0x23')](_0x124a14[_0xaac7('0x24')]);if(_0x124a14[_0xaac7('0x25')]){delete _0x124a14[_0xaac7('0x25')];}_0x342f84[_0xaac7('0x16')](_0x50d4fd)['send'](_0x124a14);};}exports[_0xaac7('0x26')]=function(_0xf8e27b,_0x2f4c37){var _0x39451e={},_0x24f898={},_0x374244={'count':0x0,'rows':[]};var _0x4e3b88=_[_0xaac7('0x27')](db[_0xaac7('0x28')]['rawAttributes'],function(_0x1cfe11){return{'name':_0x1cfe11['fieldName'],'type':_0x1cfe11[_0xaac7('0x29')]['key']};});_0x24f898[_0xaac7('0x2a')]=_[_0xaac7('0x27')](_0x4e3b88,_0xaac7('0x25'));_0x24f898['query']=_['keys'](_0xf8e27b[_0xaac7('0x2b')]);_0x24f898[_0xaac7('0x2c')]=_[_0xaac7('0x2d')](_0x24f898[_0xaac7('0x2a')],_0x24f898[_0xaac7('0x2b')]);_0x39451e[_0xaac7('0x2e')]=_['intersection'](_0x24f898[_0xaac7('0x2a')],qs[_0xaac7('0x2f')](_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x2f')]));_0x39451e['attributes']=_0x39451e[_0xaac7('0x2e')][_0xaac7('0x30')]?_0x39451e['attributes']:_0x24f898[_0xaac7('0x2a')];if(!_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x31')](_0xaac7('0x32'))){_0x39451e[_0xaac7('0x19')]=qs[_0xaac7('0x19')](_0xf8e27b[_0xaac7('0x2b')]['limit']);_0x39451e[_0xaac7('0x18')]=qs[_0xaac7('0x18')](_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x18')]);}_0x39451e['order']=qs[_0xaac7('0x33')](_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x33')]);_0x39451e[_0xaac7('0x34')]=qs[_0xaac7('0x2c')](_[_0xaac7('0x35')](_0xf8e27b[_0xaac7('0x2b')],_0x24f898[_0xaac7('0x2c')]),_0x4e3b88);if(_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x36')]){_0x39451e[_0xaac7('0x34')]=_[_0xaac7('0x37')](_0x39451e[_0xaac7('0x34')],{'$or':_[_0xaac7('0x27')](_0x4e3b88,function(_0x42bf4e){if(_0x42bf4e['type']!==_0xaac7('0x38')){var _0x25872f={};_0x25872f[_0x42bf4e[_0xaac7('0x25')]]={'$like':'%'+_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x36')]+'%'};return _0x25872f;}})});}_0x39451e=_[_0xaac7('0x37')]({},_0x39451e,_0xf8e27b[_0xaac7('0x39')]);var _0x24f97f={'where':_0x39451e[_0xaac7('0x34')]};return db['Attachment'][_0xaac7('0x1b')](_0x24f97f)['then'](function(_0x112fe1){_0x374244[_0xaac7('0x1b')]=_0x112fe1;if(_0xf8e27b[_0xaac7('0x2b')][_0xaac7('0x3a')]){_0x39451e['include']=[{'all':!![]}];}return db[_0xaac7('0x28')][_0xaac7('0x3b')](_0x39451e);})['then'](function(_0x44bb32){_0x374244['rows']=_0x44bb32;return _0x374244;})[_0xaac7('0x3c')](respondWithFilteredResult(_0x2f4c37,_0x39451e))[_0xaac7('0x3d')](handleError(_0x2f4c37,null));};exports[_0xaac7('0x3e')]=function(_0x21af3e,_0x92bc88){var _0x17d20b={'raw':!![],'where':{'id':_0x21af3e[_0xaac7('0x3f')]['id']}},_0x1c48fc={};_0x1c48fc[_0xaac7('0x2a')]=_[_0xaac7('0x40')](db[_0xaac7('0x28')]['rawAttributes']);_0x1c48fc[_0xaac7('0x2b')]=_[_0xaac7('0x40')](_0x21af3e[_0xaac7('0x2b')]);_0x1c48fc[_0xaac7('0x2c')]=_[_0xaac7('0x2d')](_0x1c48fc[_0xaac7('0x2a')],_0x1c48fc[_0xaac7('0x2b')]);_0x17d20b[_0xaac7('0x2e')]=_['intersection'](_0x1c48fc['model'],qs[_0xaac7('0x2f')](_0x21af3e[_0xaac7('0x2b')][_0xaac7('0x2f')]));_0x17d20b[_0xaac7('0x2e')]=_0x17d20b['attributes'][_0xaac7('0x30')]?_0x17d20b['attributes']:_0x1c48fc[_0xaac7('0x2a')];if(_0x21af3e['query'][_0xaac7('0x3a')]){_0x17d20b[_0xaac7('0x41')]=[{'all':!![]}];}_0x17d20b=_[_0xaac7('0x37')]({},_0x17d20b,_0x21af3e[_0xaac7('0x39')]);return db['Attachment'][_0xaac7('0x42')](_0x17d20b)['then'](handleEntityNotFound(_0x92bc88,null))[_0xaac7('0x3c')](respondWithResult(_0x92bc88,null))[_0xaac7('0x3d')](handleError(_0x92bc88,null));};exports[_0xaac7('0x43')]=function(_0x3ac9b9,_0x411ace){var _0x4ee50b={'where':{'id':_0x3ac9b9['params']['id']}},_0x1d1dbb={};_0x1d1dbb[_0xaac7('0x2a')]=_[_0xaac7('0x40')](db[_0xaac7('0x28')][_0xaac7('0x44')]);_0x4ee50b[_0xaac7('0x2e')]=_[_0xaac7('0x2d')](_0x1d1dbb[_0xaac7('0x2a')],qs[_0xaac7('0x2f')](_0x3ac9b9[_0xaac7('0x2b')][_0xaac7('0x2f')]));_0x4ee50b[_0xaac7('0x2e')]=_0x4ee50b[_0xaac7('0x2e')]['length']?_0x4ee50b[_0xaac7('0x2e')]:_0x1d1dbb[_0xaac7('0x2a')];if(_0x3ac9b9[_0xaac7('0x2b')]['includeAll']){_0x4ee50b[_0xaac7('0x41')]=[{'all':!![]}];}_0x4ee50b=_[_0xaac7('0x37')]({},_0x4ee50b,_0x3ac9b9[_0xaac7('0x39')]);return db[_0xaac7('0x28')][_0xaac7('0x42')](_0x4ee50b)['then'](handleEntityNotFound(_0x411ace,null))[_0xaac7('0x3c')](function(_0x5ab07f){if(_0x5ab07f){var _0x3e9748=_0x5ab07f[_0xaac7('0x45')]({'plain':!![]});_0x3e9748=qs[_0xaac7('0x46')](_0x3e9748,['id',_0xaac7('0x47'),'updatedAt']);_0x3ac9b9[_0xaac7('0x48')]=_[_0xaac7('0x46')](_0x3ac9b9[_0xaac7('0x48')],['id',_0xaac7('0x47'),_0xaac7('0x49')]);return db[_0xaac7('0x28')][_0xaac7('0x4a')](_[_0xaac7('0x37')](_0x3e9748,_0x3ac9b9['body']),{'include':_0x3ac9b9[_0xaac7('0x2b')][_0xaac7('0x3a')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x411ace,0xc9))[_0xaac7('0x3d')](handleError(_0x411ace,null));};exports[_0xaac7('0x4b')]=function(_0x26ca88,_0x3aa8dd){if(_0x26ca88[_0xaac7('0x48')]['id']){delete _0x26ca88['body']['id'];}return db[_0xaac7('0x28')][_0xaac7('0x42')]({'where':{'id':_0x26ca88[_0xaac7('0x3f')]['id']}})[_0xaac7('0x3c')](handleEntityNotFound(_0x3aa8dd,null))[_0xaac7('0x3c')](saveUpdates(_0x26ca88['body'],null))[_0xaac7('0x3c')](respondWithResult(_0x3aa8dd,null))[_0xaac7('0x3d')](handleError(_0x3aa8dd,null));};exports[_0xaac7('0x22')]=function(_0xdd01c5,_0x47b5a8){return db[_0xaac7('0x28')][_0xaac7('0x42')]({'where':{'id':_0xdd01c5['params']['id']}})['then'](handleEntityNotFound(_0x47b5a8,null))[_0xaac7('0x3c')](removeEntity(_0x47b5a8,null))[_0xaac7('0x3d')](handleError(_0x47b5a8,null));};exports['create']=function(_0x313a73,_0x164519,_0x48345d){_0x313a73[_0xaac7('0x48')][_0xaac7('0x25')]=_0x313a73[_0xaac7('0x4c')][_0xaac7('0x4d')];_0x313a73[_0xaac7('0x48')][_0xaac7('0x4e')]=_0x313a73[_0xaac7('0x4c')]['filename'];_0x313a73[_0xaac7('0x48')][_0xaac7('0x29')]=_0x313a73['file']['mimetype'];return db['Attachment'][_0xaac7('0x4a')](_0x313a73[_0xaac7('0x48')])[_0xaac7('0x3c')](respondWithResult(_0x164519,0xc9))[_0xaac7('0x3d')](handleError(_0x164519,null));};exports['download']=function(_0x4f9b5e,_0x5bc6aa,_0x109998){return db['Attachment']['findOne']({'where':{'id':_0x4f9b5e[_0xaac7('0x3f')]['id']},'raw':!![]})[_0xaac7('0x3c')](handleEntityNotFound(_0x5bc6aa,null))[_0xaac7('0x3c')](function(_0x48240d){if(_0x48240d){var _0x316719=_0x48240d['ChatOfflineMessageId']!==null;var _0x14354b=path['join'](config[_0xaac7('0x4f')],_0xaac7('0x50'));if(_0x316719){_0x14354b=path[_0xaac7('0x51')](_0x14354b,_0xaac7('0x52'));}var _0x1c58b6=path['join'](_0x14354b,_0x48240d[_0xaac7('0x4e')]);return _0x5bc6aa['download'](_0x1c58b6);}})['catch'](handleError(_0x5bc6aa,null));};
\ No newline at end of file
index eb39d3c..c450ac5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1237=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','../../config/logger','api','moment'];(function(_0xc116ad,_0x340192){var _0x164dc5=function(_0xbd2309){while(--_0xbd2309){_0xc116ad['push'](_0xc116ad['shift']());}};_0x164dc5(++_0x340192);}(_0x1237,0x14f));var _0x7123=function(_0x3ecee9,_0x5dd655){_0x3ecee9=_0x3ecee9-0x0;var _0x48a055=_0x1237[_0x3ecee9];return _0x48a055;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7123('0x0'))(_0x7123('0x1'));var moment=require(_0x7123('0x2'));var BPromise=require(_0x7123('0x3'));var rp=require(_0x7123('0x4'));var fs=require('fs');var path=require(_0x7123('0x5'));var rimraf=require(_0x7123('0x6'));var config=require(_0x7123('0x7'));var attributes=require(_0x7123('0x8'));module[_0x7123('0x9')]=function(_0x280007,_0x236e57){return _0x280007[_0x7123('0xa')](_0x7123('0xb'),attributes,{'tableName':_0x7123('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfce4=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x2b23d8,_0x4bacbb){var _0x2bf397=function(_0x30ba12){while(--_0x30ba12){_0x2b23d8['push'](_0x2b23d8['shift']());}};_0x2bf397(++_0x4bacbb);}(_0xfce4,0x134));var _0x4fce=function(_0x295ea9,_0x19d658){_0x295ea9=_0x295ea9-0x0;var _0x59a3fe=_0xfce4[_0x295ea9];return _0x59a3fe;};'use strict';var _=require('lodash');var util=require(_0x4fce('0x0'));var logger=require(_0x4fce('0x1'))(_0x4fce('0x2'));var moment=require(_0x4fce('0x3'));var BPromise=require(_0x4fce('0x4'));var rp=require(_0x4fce('0x5'));var fs=require('fs');var path=require(_0x4fce('0x6'));var rimraf=require(_0x4fce('0x7'));var config=require(_0x4fce('0x8'));var attributes=require(_0x4fce('0x9'));module[_0x4fce('0xa')]=function(_0x52acfb,_0x2d004c){return _0x52acfb[_0x4fce('0xb')]('Attachment',attributes,{'tableName':_0x4fce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 554665b..4bbedc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','stringify','lodash','util','moment','bluebird'];(function(_0x5a2e06,_0x8ac638){var _0x4b51fa=function(_0x351303){while(--_0x351303){_0x5a2e06['push'](_0x5a2e06['shift']());}};_0x4b51fa(++_0x8ac638);}(_0x55e0,0xdc));var _0x055e=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x55e0[_0x412e27];return _0x53da42;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});}exports[_0x055e('0x16')]=function(_0x4c85dd){var _0x36ef10=this;return new Promise(function(_0x2cf3de,_0x2f4a06){return db[_0x055e('0x17')]['create'](_0x4c85dd[_0x055e('0x18')],{'raw':_0x4c85dd[_0x055e('0x19')]?_0x4c85dd['options'][_0x055e('0x1a')]===undefined?!![]:![]:!![]})[_0x055e('0xb')](function(_0x10258f){logger[_0x055e('0xc')](_0x055e('0x16'),_0x4c85dd);logger[_0x055e('0xf')]('CreateAttachment',_0x4c85dd,JSON[_0x055e('0x1b')](_0x10258f));_0x2cf3de(_0x10258f);})[_0x055e('0x15')](function(_0x211594){logger['error'](_0x055e('0x16'),_0x211594[_0x055e('0x13')],_0x4c85dd);_0x2f4a06(_0x36ef10[_0x055e('0x11')](0x1f4,_0x211594[_0x055e('0x13')]));});});};
\ No newline at end of file
+var _0x24cf=['code','message','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x3c31e9,_0x1f2046){var _0x419260=function(_0x2a87c5){while(--_0x2a87c5){_0x3c31e9['push'](_0x3c31e9['shift']());}};_0x419260(++_0x1f2046);}(_0x24cf,0x1d5));var _0xf24c=function(_0x1f222d,_0x3fed85){_0x1f222d=_0x1f222d-0x0;var _0x26dca0=_0x24cf[_0x1f222d];return _0x26dca0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});}exports[_0xf24c('0x14')]=function(_0x2d9015){var _0x3eb8e1=this;return new Promise(function(_0x1a17c6,_0x3a0b61){return db[_0xf24c('0x15')][_0xf24c('0x16')](_0x2d9015[_0xf24c('0x17')],{'raw':_0x2d9015[_0xf24c('0x18')]?_0x2d9015[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x24bf58){logger[_0xf24c('0xb')]('CreateAttachment',_0x2d9015);logger[_0xf24c('0xe')](_0xf24c('0x14'),_0x2d9015,JSON[_0xf24c('0x1a')](_0x24bf58));_0x1a17c6(_0x24bf58);})['catch'](function(_0x5885a5){logger['error'](_0xf24c('0x14'),_0x5885a5[_0xf24c('0x12')],_0x2d9015);_0x3a0b61(_0x3eb8e1['error'](0x1f4,_0x5885a5[_0xf24c('0x12')]));});});};
\ No newline at end of file
index bbfc622..9bf3e11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x391cb1,_0x32948f){var _0x38e12d=function(_0x2cafb8){while(--_0x2cafb8){_0x391cb1['push'](_0x391cb1['shift']());}};_0x38e12d(++_0x32948f);}(_0x757a,0xde));var _0xa757=function(_0x60e62a,_0x273f81){_0x60e62a=_0x60e62a-0x0;var _0x333992=_0x757a[_0x60e62a];return _0x333992;};'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['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5df0e6,_0xa65e2){var _0x370c8f=function(_0x2fa3ab){while(--_0x2fa3ab){_0x5df0e6['push'](_0x5df0e6['shift']());}};_0x370c8f(++_0xa65e2);}(_0x2032,0xd9));var _0x2203=function(_0x480d6d,_0x5392d2){_0x480d6d=_0x480d6d-0x0;var _0x4169e0=_0x2032[_0x480d6d];return _0x4169e0;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
index fe5e0de..6237f40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27e1=['activedirectory2','util','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','online','admin','user','agent','disabled','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','ad-login','json','use','passport','passport-local','Strategy','moment'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x27e1,0x137));var _0x127e=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x27e1[_0x235f49];return _0x551139;};'use strict';var passport=require(_0x127e('0x0'));var LocalStrategy=require(_0x127e('0x1'))[_0x127e('0x2')];var moment=require(_0x127e('0x3'));var ActiveDirectory=require(_0x127e('0x4'));var BPromise=require('bluebird');var util=require(_0x127e('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x127e('0x6'))(_0x127e('0x7'));function isActiveDirectoryConfigured(_0x17f407){var _0x42778a=![];if(typeof _0x17f407[_0x127e('0x8')]!==_0x127e('0x9')){_0x42778a=_0x17f407['activedirectory']['baseDN']&&_0x17f407[_0x127e('0x8')][_0x127e('0xa')]&&_0x17f407['activedirectory'][_0x127e('0xb')];}return _0x42778a;}function adAuthenticate(_0x51b9ea,_0x41f34f,_0xdacb47){return new BPromise(function(_0x34f90b,_0x43bd8d){try{var _0x55b6e6=new ActiveDirectory(_0x51b9ea);_0x55b6e6[_0x127e('0xc')](_0x41f34f,_0xdacb47,function(_0x329df1,_0xeec4da){if(_0x329df1){logger[_0x127e('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x41f34f,util[_0x127e('0xe')](_0x329df1,{'showHidden':![],'depth':null}));_0x43bd8d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0xeec4da){logger['error'](_0x127e('0xf'),_0x41f34f);_0x43bd8d(_0x127e('0x10'));}else{_0x34f90b(_0xeec4da);}});}catch(_0x5dabac){_0x43bd8d(_0x5dabac);}});}function ActiveDirectoryAuthenticate(_0x38a05b,_0x3dc215,_0x4acf8d,_0x745e2){var _0x464bb7,_0x45cd7b;if(!isActiveDirectoryConfigured(config)){logger[_0x127e('0xd')](_0x127e('0x11'),_0x3dc215);return _0x745e2(null,![],{'message':_0x127e('0x10')});}return db[_0x127e('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x127e('0x13'),_0x127e('0x14')],'raw':!![]})[_0x127e('0x15')](function(_0x29e7d7){_0x464bb7=_0x29e7d7;if(!_0x464bb7[_0x127e('0x13')]){logger[_0x127e('0xd')](_0x127e('0x16'),_0x3dc215);throw new Error(_0x127e('0x10'));}return _0x38a05b['findOne']({'attributes':['id',_0x127e('0x17'),_0x127e('0x18'),_0x127e('0x19'),_0x127e('0x1a'),'disabled',_0x127e('0x1b'),'blockedAt',_0x127e('0x1c')],'where':{'name':_0x3dc215,'role':{'$or':[_0x127e('0x1d'),_0x127e('0x1e'),_0x127e('0x1f')]},'adSsoEnabled':!![]}});})[_0x127e('0x15')](function(_0x23a11f){if(!_0x23a11f||_0x23a11f&&_0x23a11f[_0x127e('0x17')]!==_0x3dc215){throw new Error(_0x127e('0x10'));}_0x45cd7b=_0x23a11f;var _0x2fc0d5=_0x45cd7b[_0x127e('0x17')]+'@'+config[_0x127e('0x8')][_0x127e('0xb')];return adAuthenticate(config[_0x127e('0x8')],_0x2fc0d5,_0x4acf8d);})[_0x127e('0x15')](function(_0x1fe81d){if(_0x45cd7b[_0x127e('0x20')]){throw new Error(_0x127e('0x10'));}if(_0x464bb7[_0x127e('0x14')]>0x0){if(_0x45cd7b[_0x127e('0x1b')]){if(moment(_0x45cd7b[_0x127e('0x21')])[_0x127e('0x22')](_0x464bb7[_0x127e('0x14')],_0x127e('0x23'))>moment()){throw new Error(_0x127e('0x10'));}return utils[_0x127e('0x24')](_0x45cd7b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x45cd7b);})[_0x127e('0x15')](function(){return _0x745e2(null,_0x45cd7b);});}else{return utils[_0x127e('0x25')](_0x45cd7b)[_0x127e('0x15')](function(){return _0x745e2(null,_0x45cd7b);});}}else{return utils[_0x127e('0x25')](_0x45cd7b)[_0x127e('0x15')](function(){return _0x745e2(null,_0x45cd7b);});}})[_0x127e('0x26')](function(_0x2271f2){return _0x745e2(null,![],_0x2271f2);});}function handleError(_0x33fd54,_0x5b5d78,_0x23d4b9){return _0x33fd54[_0x127e('0x27')](_0x5b5d78||0x1f4)[_0x127e('0x28')]({'message':_0x23d4b9?_0x23d4b9[_0x127e('0x29')]||_0x23d4b9:''});}exports['login']=function(_0x1611f6,_0x504a08,_0x50426e){passport[_0x127e('0xc')](_0x127e('0x2a'),function(_0x5e75c7,_0x569315,_0x44351f){var _0x56f28e=_0x5e75c7||_0x44351f;if(_0x56f28e){return handleError(_0x504a08,0x191,_0x56f28e);}if(!_0x569315){return handleError(_0x504a08,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x493e58={'payload':{'id':_0x569315['id'],'role':_0x569315[_0x127e('0x1a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x493e58)[_0x127e('0x15')](function(_0x38a1ad){_0x504a08[_0x127e('0x2b')]({'id':_0x569315['id'],'token':_0x38a1ad,'statusCall':'','isAlreadyLogged':_0x569315[_0x127e('0x1c')]});});}})(_0x1611f6,_0x504a08,_0x50426e);};passport[_0x127e('0x2c')]('ad-login',new LocalStrategy({'usernameField':_0x127e('0x17'),'passwordField':_0x127e('0x18')},function(_0x13948f,_0x25c7f6,_0x55ecb8){return ActiveDirectoryAuthenticate(db['User'],_0x13948f,_0x25c7f6,_0x55ecb8);}));
\ No newline at end of file
+var _0x1fd9=['url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','password','disabled','blocked','blockedAt','online','admin','user','name','add','clearBlockUser','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/logger','api','activedirectory','undefined','baseDN'];(function(_0x562163,_0x264e2a){var _0x551eed=function(_0x5ecde8){while(--_0x5ecde8){_0x562163['push'](_0x562163['shift']());}};_0x551eed(++_0x264e2a);}(_0x1fd9,0x19b));var _0x91fd=function(_0x1fbbb6,_0x5d0e64){_0x1fbbb6=_0x1fbbb6-0x0;var _0x212b5e=_0x1fd9[_0x1fbbb6];return _0x212b5e;};'use strict';var passport=require(_0x91fd('0x0'));var LocalStrategy=require(_0x91fd('0x1'))[_0x91fd('0x2')];var moment=require(_0x91fd('0x3'));var ActiveDirectory=require(_0x91fd('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x91fd('0x5'))['db'];var authService=require(_0x91fd('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x91fd('0x7'))(_0x91fd('0x8'));function isActiveDirectoryConfigured(_0x1eaa48){var _0xe0364f=![];if(typeof _0x1eaa48[_0x91fd('0x9')]!==_0x91fd('0xa')){_0xe0364f=_0x1eaa48['activedirectory'][_0x91fd('0xb')]&&_0x1eaa48['activedirectory'][_0x91fd('0xc')]&&_0x1eaa48[_0x91fd('0x9')][_0x91fd('0xd')];}return _0xe0364f;}function adAuthenticate(_0x14f69c,_0x5b4d56,_0x4f711a){return new BPromise(function(_0x1ce670,_0x17e508){try{var _0x3748d3=new ActiveDirectory(_0x14f69c);_0x3748d3[_0x91fd('0xe')](_0x5b4d56,_0x4f711a,function(_0x55542c,_0x3bd698){if(_0x55542c){logger[_0x91fd('0xf')](_0x91fd('0x10'),_0x5b4d56,util[_0x91fd('0x11')](_0x55542c,{'showHidden':![],'depth':null}));_0x17e508(_0x91fd('0x12'));}else if(!_0x3bd698){logger[_0x91fd('0xf')](_0x91fd('0x13'),_0x5b4d56);_0x17e508('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1ce670(_0x3bd698);}});}catch(_0x281216){_0x17e508(_0x281216);}});}function ActiveDirectoryAuthenticate(_0x6d6fbf,_0x5b0304,_0x18f348,_0x4858f3){var _0x4d22e3,_0x4437c2;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x91fd('0x14'),_0x5b0304);return _0x4858f3(null,![],{'message':_0x91fd('0x12')});}return db[_0x91fd('0x15')][_0x91fd('0x16')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x91fd('0x17')],'raw':!![]})[_0x91fd('0x18')](function(_0x1892e6){_0x4d22e3=_0x1892e6;if(!_0x4d22e3[_0x91fd('0x19')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x5b0304);throw new Error(_0x91fd('0x12'));}return _0x6d6fbf[_0x91fd('0x16')]({'attributes':['id','name',_0x91fd('0x1a'),'salt','role',_0x91fd('0x1b'),_0x91fd('0x1c'),_0x91fd('0x1d'),_0x91fd('0x1e')],'where':{'name':_0x5b0304,'role':{'$or':[_0x91fd('0x1f'),_0x91fd('0x20'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x3e325f){if(!_0x3e325f||_0x3e325f&&_0x3e325f[_0x91fd('0x21')]!==_0x5b0304){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4437c2=_0x3e325f;var _0x10225e=_0x4437c2[_0x91fd('0x21')]+'@'+config[_0x91fd('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x10225e,_0x18f348);})[_0x91fd('0x18')](function(_0x5a4bba){if(_0x4437c2['disabled']){throw new Error(_0x91fd('0x12'));}if(_0x4d22e3[_0x91fd('0x17')]>0x0){if(_0x4437c2['blocked']){if(moment(_0x4437c2[_0x91fd('0x1d')])[_0x91fd('0x22')](_0x4d22e3['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x91fd('0x23')](_0x4437c2,0x0,![],null)[_0x91fd('0x18')](function(){return utils[_0x91fd('0x24')](_0x4437c2);})['then'](function(){return _0x4858f3(null,_0x4437c2);});}else{return utils['getLicense'](_0x4437c2)[_0x91fd('0x18')](function(){return _0x4858f3(null,_0x4437c2);});}}else{return utils[_0x91fd('0x24')](_0x4437c2)[_0x91fd('0x18')](function(){return _0x4858f3(null,_0x4437c2);});}})[_0x91fd('0x25')](function(_0xf27df8){return _0x4858f3(null,![],_0xf27df8);});}function handleError(_0xdd1249,_0x566bcb,_0x399728){return _0xdd1249['status'](_0x566bcb||0x1f4)[_0x91fd('0x26')]({'message':_0x399728?_0x399728[_0x91fd('0x27')]||_0x399728:''});}exports['login']=function(_0x23b083,_0x239485,_0x584298){passport[_0x91fd('0xe')]('ad-login',function(_0x32c248,_0x35c57a,_0x437166){var _0x54dbe2=_0x32c248||_0x437166;if(_0x54dbe2){return handleError(_0x239485,0x191,_0x54dbe2);}if(!_0x35c57a){return handleError(_0x239485,0x194,{'message':_0x91fd('0x28')});}else{var _0x3c4988={'payload':{'id':_0x35c57a['id'],'role':_0x35c57a[_0x91fd('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0x91fd('0x2a')](_0x3c4988)[_0x91fd('0x18')](function(_0x510e5a){_0x239485[_0x91fd('0x2b')]({'id':_0x35c57a['id'],'token':_0x510e5a,'statusCall':'','isAlreadyLogged':_0x35c57a['online']});});}})(_0x23b083,_0x239485,_0x584298);};passport[_0x91fd('0x2c')](_0x91fd('0x2d'),new LocalStrategy({'usernameField':_0x91fd('0x21'),'passwordField':_0x91fd('0x1a')},function(_0x5c4f91,_0x1ba9f8,_0x55301a){return ActiveDirectoryAuthenticate(db[_0x91fd('0x2e')],_0x5c4f91,_0x1ba9f8,_0x55301a);}));
\ No newline at end of file
index 864cb9f..bb2309c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9cf=['post','login','exports'];(function(_0x263843,_0x2588b7){var _0x3b11eb=function(_0xed7a20){while(--_0xed7a20){_0x263843['push'](_0x263843['shift']());}};_0x3b11eb(++_0x2588b7);}(_0xb9cf,0x165));var _0xfb9c=function(_0x5b0db9,_0x551089){_0x5b0db9=_0x5b0db9-0x0;var _0x224e52=_0xb9cf[_0x5b0db9];return _0x224e52;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0xfb9c('0x0')]('/',controller[_0xfb9c('0x1')]);module[_0xfb9c('0x2')]=router;
\ No newline at end of file
+var _0xebe0=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x9f9b55,_0x39a274){var _0x3b10c4=function(_0x44ebf8){while(--_0x44ebf8){_0x9f9b55['push'](_0x9f9b55['shift']());}};_0x3b10c4(++_0x39a274);}(_0xebe0,0xe7));var _0x0ebe=function(_0x315d14,_0x231788){_0x315d14=_0x315d14-0x0;var _0x479f4f=_0xebe0[_0x315d14];return _0x479f4f;};'use strict';var express=require(_0x0ebe('0x0'));var router=express['Router']();var controller=require(_0x0ebe('0x1'));router[_0x0ebe('0x2')]('/',controller[_0x0ebe('0x3')]);module[_0x0ebe('0x4')]=router;
\ No newline at end of file
index faf3250..78b4c9d 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(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7a54,0x106));var _0x47a5=function(_0x389147,_0x5a7b5b){_0x389147=_0x389147-0x0;var _0x154ada=_0x7a54[_0x389147];return _0x154ada;};'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 _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(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x7a54,0x106));var _0x47a5=function(_0x30dfaf,_0x19d6bc){_0x30dfaf=_0x30dfaf-0x0;var _0x26c17d=_0x7a54[_0x30dfaf];return _0x26c17d;};'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
index 3a980ad..1aaf2bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d8=['../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','passport','Router'];(function(_0x9bb596,_0x29d5bc){var _0x1bb9ce=function(_0x3705b4){while(--_0x3705b4){_0x9bb596['push'](_0x9bb596['shift']());}};_0x1bb9ce(++_0x29d5bc);}(_0xc8d8,0x6c));var _0x8c8d=function(_0x3f7a0d,_0x29e65b){_0x3f7a0d=_0x3f7a0d-0x0;var _0x2f9129=_0xc8d8[_0x3f7a0d];return _0x2f9129;};'use strict';var express=require('express');var passport=require(_0x8c8d('0x0'));var router=express[_0x8c8d('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x8c8d('0x2'));var authService=require(_0x8c8d('0x3'));router[_0x8c8d('0x4')]('/',controller[_0x8c8d('0x5')]);router[_0x8c8d('0x4')]('/callback',controller[_0x8c8d('0x6')],authService[_0x8c8d('0x7')],userController[_0x8c8d('0x5')],authService[_0x8c8d('0x8')]);module[_0x8c8d('0x9')]=router;
\ No newline at end of file
+var _0x7118=['/callback','callback','isMiddleware','setTokenCookie','exports','Router','./authGoogle.controller','../../components/auth/service','get','login'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x7118,0x159));var _0x8711=function(_0x1e6e52,_0x507b9a){_0x1e6e52=_0x1e6e52-0x0;var _0x216ff8=_0x7118[_0x1e6e52];return _0x216ff8;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x8711('0x0')]();var controller=require(_0x8711('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x8711('0x2'));router[_0x8711('0x3')]('/',controller[_0x8711('0x4')]);router[_0x8711('0x3')](_0x8711('0x5'),controller[_0x8711('0x6')],authService[_0x8711('0x7')],userController['login'],authService[_0x8711('0x8')]);module[_0x8711('0x9')]=router;
\ No newline at end of file
index 89ce293..9cda3b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x561f=['local-login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','util','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','merge','format','\x22%s\x22\x20<%s>','user','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate'];(function(_0xe5a7d2,_0x2ae5b6){var _0x4f8ece=function(_0x1aa129){while(--_0x1aa129){_0xe5a7d2['push'](_0xe5a7d2['shift']());}};_0x4f8ece(++_0x2ae5b6);}(_0x561f,0xc3));var _0xf561=function(_0x5c62eb,_0x2e69a0){_0x5c62eb=_0x5c62eb-0x0;var _0xe164a=_0x561f[_0x5c62eb];return _0xe164a;};'use strict';var util=require(_0xf561('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf561('0x1'))[_0xf561('0x2')];var jayson=require(_0xf561('0x3'));var _=require(_0xf561('0x4'));var rs=require('randomstring');var moment=require(_0xf561('0x5'));var db=require(_0xf561('0x6'))['db'];var authService=require(_0xf561('0x7'));var utils=require(_0xf561('0x8'));var client=jayson[_0xf561('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x31d1a2,_0x3e2b73,_0x3d8cd3,_0x2a12c5){var _0x5720c0,_0x21ed57;return db[_0xf561('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf561('0xb'),_0xf561('0xc')],'raw':!![]})[_0xf561('0xd')](function(_0x224f30){_0x5720c0=_0x224f30;return _0x31d1a2[_0xf561('0xe')]({'attributes':['id',_0xf561('0xf'),_0xf561('0x10'),_0xf561('0x11'),_0xf561('0x12'),_0xf561('0x13'),_0xf561('0x14'),_0xf561('0x15'),_0xf561('0x16')],'where':{'name':_0x3e2b73,'role':{'$or':[_0xf561('0x17'),'user',_0xf561('0x18')]}}});})[_0xf561('0xd')](function(_0x37e8df){if(!_0x37e8df||_0x37e8df&&_0x37e8df['name']!==_0x3e2b73){throw new Error(_0xf561('0x19'));}else{_0x21ed57=_0x37e8df;return _0x21ed57;}})[_0xf561('0xd')](function(){_0x21ed57['authenticate'](_0x3d8cd3,function(_0x281cee,_0x255947){var _0x39db4e=_0x21ed57[_0xf561('0x16')]+0x1;if(_0x281cee){return _0x2a12c5(_0x281cee);}else if(!_0x255947){if(_0x21ed57['disabled']){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}else if(_0x5720c0[_0xf561('0xb')]>0x0){if(_0x21ed57[_0xf561('0x14')]){if(_0x5720c0[_0xf561('0xc')]>0x0){if(moment(_0x21ed57['blockedAt'])['add'](_0x5720c0[_0xf561('0xc')],_0xf561('0x1a'))>moment()){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}else{return utils[_0xf561('0x1b')](_0x21ed57,_0x39db4e,![],null)[_0xf561('0xd')](function(){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});});}}else{return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}}else{if(_0x39db4e>=_0x5720c0['allowedLoginAttempts']){return utils['clearBlockUser'](_0x21ed57,0x0,!![],moment())[_0xf561('0xd')](function(){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});});}else{return utils[_0xf561('0x1b')](_0x21ed57,_0x39db4e,![],null)[_0xf561('0xd')](function(){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});});}}}else{return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}}else{if(_0x21ed57[_0xf561('0x13')]){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}else if(_0x5720c0[_0xf561('0xb')]>0x0){if(_0x21ed57[_0xf561('0x14')]){if(_0x5720c0['blockDuration']>0x0){if(moment(_0x21ed57['blockedAt'])['add'](_0x5720c0[_0xf561('0xc')],_0xf561('0x1a'))>moment()){return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}else{return utils['clearBlockUser'](_0x21ed57,0x0,![],null)['then'](function(){return utils[_0xf561('0x1c')](_0x21ed57);})[_0xf561('0xd')](function(){return _0x2a12c5(null,_0x21ed57);});}}else{return _0x2a12c5(null,![],{'message':_0xf561('0x19')});}}else{return utils[_0xf561('0x1b')](_0x21ed57,0x0,![],null)['then'](function(){return utils[_0xf561('0x1c')](_0x21ed57);})['then'](function(){return _0x2a12c5(null,_0x21ed57);})[_0xf561('0x1d')](function(_0x3cb09f){return _0x2a12c5(null,![],_0x3cb09f);});}}else{if(_0x21ed57[_0xf561('0x14')]){return _0x2a12c5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x21ed57)[_0xf561('0xd')](function(){return _0x2a12c5(null,_0x21ed57);});}}}});})[_0xf561('0x1d')](function(_0x540a6d){return _0x2a12c5(null,![],_0x540a6d);});}function sendServiceMail(_0x2c7630){return db[_0xf561('0x1e')][_0xf561('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf561('0xf'),_0xf561('0x20')],'include':[{'model':db[_0xf561('0x21')],'as':_0xf561('0x22'),'include':[{'model':db[_0xf561('0x23')],'as':_0xf561('0x23')}]}]})[_0xf561('0xd')](function(_0x10d80b){if(!_0x10d80b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4121dd=_0x10d80b['getSmtpOptions']();var _0x3afde5={'account':_0x4121dd,'message':_[_0xf561('0x24')]({'from':util[_0xf561('0x25')](_0xf561('0x26'),_0x10d80b[_0xf561('0xf')],_0x10d80b['email']||_0x10d80b[_0xf561('0x22')][_0xf561('0x27')])},_0x2c7630)};return client['request'](_0xf561('0x28'),_0x3afde5);})['then'](function(_0x2224bd){if(_0x2224bd['error']){throw new Error(util[_0xf561('0x25')](_0xf561('0x29'),_0x2224bd['error'][_0xf561('0x2a')]||JSON[_0xf561('0x2b')](_0x2224bd['error'])));}return!![];});}function handleError(_0x3a2c86,_0x2d6b80,_0x3d6f70){return _0x3a2c86[_0xf561('0x2c')](_0x2d6b80||0x1f4)[_0xf561('0x2d')]({'message':_0x3d6f70?_0x3d6f70[_0xf561('0x2a')]||_0x3d6f70:''});}exports[_0xf561('0x2e')]=function(_0x49a17d,_0x44fc1b,_0xb12fb3){passport[_0xf561('0x2f')](_0xf561('0x30'),function(_0x49b555,_0x33805a,_0x2afb56){var _0x332f35=_0x49b555||_0x2afb56;if(_0x332f35){return handleError(_0x44fc1b,0x191,_0x332f35);}if(!_0x33805a){return handleError(_0x44fc1b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1227fe={'payload':{'id':_0x33805a['id'],'role':_0x33805a[_0xf561('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xf561('0x31')](_0x1227fe)[_0xf561('0xd')](function(_0x3fbdd9){_0x44fc1b['json']({'id':_0x33805a['id'],'token':_0x3fbdd9,'statusCall':'','isAlreadyLogged':_0x33805a[_0xf561('0x32')]});});}})(_0x49a17d,_0x44fc1b,_0xb12fb3);};exports[_0xf561('0x33')]=function(_0x3b5849,_0x36356){if(!_0x3b5849[_0xf561('0x34')][_0xf561('0x20')]){return handleError(_0x36356,0x1f4,{'message':_0xf561('0x35')});}var _0x47753f=rs[_0xf561('0x36')]();_0x3b5849[_0xf561('0x34')]['email']=_0x3b5849['body'][_0xf561('0x20')]['trim']()[_0xf561('0x37')]();var _0x2a2f33;return db['Setting'][_0xf561('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf561('0xd')](function(_0xfada34){_0x2a2f33=_0xfada34;return db[_0xf561('0x38')]['find']({'where':{'email':_0x3b5849[_0xf561('0x34')]['email']}});})[_0xf561('0xd')](function(_0x284a29){if(!_0x284a29){throw new Error(_0xf561('0x39'));}if(_0x284a29['disabled']){throw new Error(_0xf561('0x3a'));}if(_0x284a29[_0xf561('0x14')]){if(moment(_0x284a29['blockedAt'])[_0xf561('0x3b')](_0x2a2f33[_0xf561('0xc')],_0xf561('0x1a'))>moment()){throw new Error(_0xf561('0x3c'));}else{_0x284a29[_0xf561('0x14')]=![];_0x284a29[_0xf561('0x15')]=null;}}_0x284a29[_0xf561('0x3d')]=_0x47753f;_0x284a29[_0xf561('0x3e')]=Date[_0xf561('0x3f')]()+0x36ee80;return _0x284a29[_0xf561('0x40')]();})[_0xf561('0xd')](function(){return sendServiceMail({'to':_0x3b5849['body'][_0xf561('0x20')],'subject':_0xf561('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf561('0x42')+_0x3b5849[_0xf561('0x43')]['host']+_0xf561('0x44')+_0x47753f+'\x0a\x0a'+_0xf561('0x45')});})['then'](function(){_0x36356[_0xf561('0x2c')](0xc8)[_0xf561('0x2d')]({'message':_0xf561('0x46')});})[_0xf561('0x1d')](function(_0x309636){return handleError(_0x36356,0x1f4,_0x309636);});};exports['reset']=function(_0x5bb633,_0x251cb9){return db[_0xf561('0x38')][_0xf561('0x1f')]({'where':{'resetPasswordToken':_0x5bb633[_0xf561('0x47')][_0xf561('0x48')],'resetPasswordExpires':{'$gt':Date[_0xf561('0x3f')]()}}})[_0xf561('0xd')](function(_0x4dd841){if(!_0x4dd841){throw new Error(_0xf561('0x49'));}return db['Setting'][_0xf561('0xe')]({'attributes':['id',_0xf561('0x4a'),_0xf561('0x4b'),'passwordHistoryLimit']})[_0xf561('0xd')](function(_0x2dafb5){if(_0x2dafb5['securePassword'])authService[_0xf561('0x4c')](_0x5bb633['body'][_0xf561('0x10')]);if(!_0x2dafb5['enforcePasswordHistory']||!_0x4dd841[_0xf561('0x4d')])return _0x4dd841;authService[_0xf561('0x4e')](_0x5bb633['body']['password'],_0x4dd841[_0xf561('0x4d')],_0x2dafb5[_0xf561('0x4f')]);return _0x4dd841;})[_0xf561('0xd')](function(){_0x4dd841[_0xf561('0x10')]=_0x5bb633[_0xf561('0x34')][_0xf561('0x10')];_0x4dd841['resetPasswordToken']=null;_0x4dd841[_0xf561('0x3e')]=null;return _0x4dd841['save']();});})['then'](function(){_0x251cb9[_0xf561('0x2c')](0xc8)[_0xf561('0x2d')]({'message':_0xf561('0x50')});})[_0xf561('0x1d')](function(_0x39ffd4){return handleError(_0x251cb9,0x1f4,_0x39ffd4);});};passport['use'](_0xf561('0x30'),new LocalStrategy({'usernameField':_0xf561('0xf'),'passwordField':_0xf561('0x10')},function(_0x25ebe0,_0xd66ce1,_0x1ff4eb){return localAuthenticate(db[_0xf561('0x38')],_0x25ebe0,_0xd66ce1,_0x1ff4eb);}));
\ No newline at end of file
+var _0x69cf=['lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','use','util','passport','passport-local','Strategy','jayson/promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x69cf,0xa3));var _0xf69c=function(_0x2d16d8,_0x295ba2){_0x2d16d8=_0x2d16d8-0x0;var _0x40e2bf=_0x69cf[_0x2d16d8];return _0x40e2bf;};'use strict';var util=require(_0xf69c('0x0'));var passport=require(_0xf69c('0x1'));var LocalStrategy=require(_0xf69c('0x2'))[_0xf69c('0x3')];var jayson=require(_0xf69c('0x4'));var _=require(_0xf69c('0x5'));var rs=require('randomstring');var moment=require(_0xf69c('0x6'));var db=require(_0xf69c('0x7'))['db'];var authService=require(_0xf69c('0x8'));var utils=require(_0xf69c('0x9'));var client=jayson[_0xf69c('0xa')][_0xf69c('0xb')]({'port':0x232b});function localAuthenticate(_0x9afa08,_0x7d12de,_0x401d16,_0x572d57){var _0x33c094,_0x3ebe1f;return db['Setting'][_0xf69c('0xc')]({'where':{'id':0x1},'attributes':[_0xf69c('0xd'),_0xf69c('0xe')],'raw':!![]})[_0xf69c('0xf')](function(_0x35f5d8){_0x33c094=_0x35f5d8;return _0x9afa08[_0xf69c('0xc')]({'attributes':['id','name','password','salt',_0xf69c('0x10'),_0xf69c('0x11'),_0xf69c('0x12'),_0xf69c('0x13'),_0xf69c('0x14')],'where':{'name':_0x7d12de,'role':{'$or':[_0xf69c('0x15'),_0xf69c('0x16'),_0xf69c('0x17')]}}});})[_0xf69c('0xf')](function(_0x23457a){if(!_0x23457a||_0x23457a&&_0x23457a[_0xf69c('0x18')]!==_0x7d12de){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3ebe1f=_0x23457a;return _0x3ebe1f;}})[_0xf69c('0xf')](function(){_0x3ebe1f['authenticate'](_0x401d16,function(_0x5ed183,_0x48f78c){var _0x1a2a40=_0x3ebe1f[_0xf69c('0x14')]+0x1;if(_0x5ed183){return _0x572d57(_0x5ed183);}else if(!_0x48f78c){if(_0x3ebe1f['disabled']){return _0x572d57(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x33c094[_0xf69c('0xd')]>0x0){if(_0x3ebe1f[_0xf69c('0x12')]){if(_0x33c094['blockDuration']>0x0){if(moment(_0x3ebe1f[_0xf69c('0x13')])[_0xf69c('0x19')](_0x33c094['blockDuration'],_0xf69c('0x1a'))>moment()){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}else{return utils['clearBlockUser'](_0x3ebe1f,_0x1a2a40,![],null)[_0xf69c('0xf')](function(){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});});}}else{return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}}else{if(_0x1a2a40>=_0x33c094['allowedLoginAttempts']){return utils[_0xf69c('0x1c')](_0x3ebe1f,0x0,!![],moment())['then'](function(){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});});}else{return utils[_0xf69c('0x1c')](_0x3ebe1f,_0x1a2a40,![],null)['then'](function(){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});});}}}else{return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}}else{if(_0x3ebe1f[_0xf69c('0x11')]){return _0x572d57(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x33c094[_0xf69c('0xd')]>0x0){if(_0x3ebe1f[_0xf69c('0x12')]){if(_0x33c094[_0xf69c('0xe')]>0x0){if(moment(_0x3ebe1f[_0xf69c('0x13')])['add'](_0x33c094['blockDuration'],_0xf69c('0x1a'))>moment()){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}else{return utils[_0xf69c('0x1c')](_0x3ebe1f,0x0,![],null)[_0xf69c('0xf')](function(){return utils['getLicense'](_0x3ebe1f);})['then'](function(){return _0x572d57(null,_0x3ebe1f);});}}else{return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}}else{return utils[_0xf69c('0x1c')](_0x3ebe1f,0x0,![],null)[_0xf69c('0xf')](function(){return utils[_0xf69c('0x1d')](_0x3ebe1f);})[_0xf69c('0xf')](function(){return _0x572d57(null,_0x3ebe1f);})[_0xf69c('0x1e')](function(_0x48d511){return _0x572d57(null,![],_0x48d511);});}}else{if(_0x3ebe1f[_0xf69c('0x12')]){return _0x572d57(null,![],{'message':_0xf69c('0x1b')});}else{return utils['getLicense'](_0x3ebe1f)['then'](function(){return _0x572d57(null,_0x3ebe1f);});}}}});})[_0xf69c('0x1e')](function(_0x483474){return _0x572d57(null,![],_0x483474);});}function sendServiceMail(_0x4b094d){return db[_0xf69c('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0xf69c('0x18'),_0xf69c('0x20')],'include':[{'model':db[_0xf69c('0x21')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xf69c('0x22')}]}]})['then'](function(_0x854726){if(!_0x854726){throw new Error(_0xf69c('0x23'));}var _0x178451=_0x854726['getSmtpOptions']();var _0x2fad15={'account':_0x178451,'message':_['merge']({'from':util[_0xf69c('0x24')](_0xf69c('0x25'),_0x854726[_0xf69c('0x18')],_0x854726[_0xf69c('0x20')]||_0x854726[_0xf69c('0x26')][_0xf69c('0x16')])},_0x4b094d)};return client[_0xf69c('0x27')](_0xf69c('0x28'),_0x2fad15);})[_0xf69c('0xf')](function(_0x1064ca){if(_0x1064ca[_0xf69c('0x29')]){throw new Error(util[_0xf69c('0x24')](_0xf69c('0x2a'),_0x1064ca[_0xf69c('0x29')][_0xf69c('0x2b')]||JSON[_0xf69c('0x2c')](_0x1064ca[_0xf69c('0x29')])));}return!![];});}function handleError(_0x8b7fc9,_0x3413b6,_0x1378fa){return _0x8b7fc9[_0xf69c('0x2d')](_0x3413b6||0x1f4)[_0xf69c('0x2e')]({'message':_0x1378fa?_0x1378fa['message']||_0x1378fa:''});}exports[_0xf69c('0x2f')]=function(_0x5722e4,_0x41f80f,_0x185116){passport[_0xf69c('0x30')](_0xf69c('0x31'),function(_0x46e307,_0x155d83,_0x32875){var _0x374b9c=_0x46e307||_0x32875;if(_0x374b9c){return handleError(_0x41f80f,0x191,_0x374b9c);}if(!_0x155d83){return handleError(_0x41f80f,0x194,{'message':_0xf69c('0x32')});}else{var _0x54cd81={'payload':{'id':_0x155d83['id'],'role':_0x155d83[_0xf69c('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf69c('0x33')](_0x54cd81)[_0xf69c('0xf')](function(_0x38080c){_0x41f80f[_0xf69c('0x34')]({'id':_0x155d83['id'],'token':_0x38080c,'statusCall':'','isAlreadyLogged':_0x155d83[_0xf69c('0x35')]});});}})(_0x5722e4,_0x41f80f,_0x185116);};exports['forgot']=function(_0x2c8d08,_0x2e9462){if(!_0x2c8d08['body'][_0xf69c('0x20')]){return handleError(_0x2e9462,0x1f4,{'message':_0xf69c('0x36')});}var _0x2ce82d=rs[_0xf69c('0x37')]();_0x2c8d08[_0xf69c('0x38')][_0xf69c('0x20')]=_0x2c8d08[_0xf69c('0x38')]['email'][_0xf69c('0x39')]()['toLowerCase']();var _0x441c52;return db['Setting'][_0xf69c('0xc')]({'where':{'id':0x1},'attributes':[_0xf69c('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x3d7572){_0x441c52=_0x3d7572;return db[_0xf69c('0x3a')][_0xf69c('0x3b')]({'where':{'email':_0x2c8d08['body'][_0xf69c('0x20')]}});})[_0xf69c('0xf')](function(_0x1f4971){if(!_0x1f4971){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1f4971[_0xf69c('0x11')]){throw new Error(_0xf69c('0x3c'));}if(_0x1f4971['blocked']){if(moment(_0x1f4971[_0xf69c('0x13')])[_0xf69c('0x19')](_0x441c52[_0xf69c('0xe')],_0xf69c('0x1a'))>moment()){throw new Error(_0xf69c('0x3d'));}else{_0x1f4971[_0xf69c('0x12')]=![];_0x1f4971[_0xf69c('0x13')]=null;}}_0x1f4971['resetPasswordToken']=_0x2ce82d;_0x1f4971[_0xf69c('0x3e')]=Date[_0xf69c('0x3f')]()+0x36ee80;return _0x1f4971['save']();})[_0xf69c('0xf')](function(){return sendServiceMail({'to':_0x2c8d08[_0xf69c('0x38')][_0xf69c('0x20')],'subject':_0xf69c('0x40'),'text':_0xf69c('0x41')+_0xf69c('0x42')+_0xf69c('0x43')+_0x2c8d08[_0xf69c('0x44')][_0xf69c('0x45')]+_0xf69c('0x46')+_0x2ce82d+'\x0a\x0a'+_0xf69c('0x47')});})[_0xf69c('0xf')](function(){_0x2e9462[_0xf69c('0x2d')](0xc8)[_0xf69c('0x2e')]({'message':_0xf69c('0x48')});})['catch'](function(_0x4c1428){return handleError(_0x2e9462,0x1f4,_0x4c1428);});};exports[_0xf69c('0x49')]=function(_0x187ce9,_0x458442){return db[_0xf69c('0x3a')][_0xf69c('0x3b')]({'where':{'resetPasswordToken':_0x187ce9[_0xf69c('0x4a')][_0xf69c('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xf69c('0x3f')]()}}})[_0xf69c('0xf')](function(_0x549a79){if(!_0x549a79){throw new Error(_0xf69c('0x4c'));}return db['Setting'][_0xf69c('0xc')]({'attributes':['id',_0xf69c('0x4d'),_0xf69c('0x4e'),_0xf69c('0x4f')]})['then'](function(_0x52f200){if(_0x52f200[_0xf69c('0x4d')])authService[_0xf69c('0x50')](_0x187ce9[_0xf69c('0x38')][_0xf69c('0x51')]);if(!_0x52f200['enforcePasswordHistory']||!_0x549a79[_0xf69c('0x52')])return _0x549a79;authService['validatePasswordHistory'](_0x187ce9[_0xf69c('0x38')][_0xf69c('0x51')],_0x549a79[_0xf69c('0x52')],_0x52f200[_0xf69c('0x4f')]);return _0x549a79;})['then'](function(){_0x549a79[_0xf69c('0x51')]=_0x187ce9[_0xf69c('0x38')]['password'];_0x549a79['resetPasswordToken']=null;_0x549a79[_0xf69c('0x3e')]=null;return _0x549a79['save']();});})[_0xf69c('0xf')](function(){_0x458442['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0xf69c('0x1e')](function(_0xa22e1e){return handleError(_0x458442,0x1f4,_0xa22e1e);});};passport[_0xf69c('0x53')](_0xf69c('0x31'),new LocalStrategy({'usernameField':_0xf69c('0x18'),'passwordField':_0xf69c('0x51')},function(_0xcdb718,_0x5a67ee,_0x1ea916){return localAuthenticate(db[_0xf69c('0x3a')],_0xcdb718,_0x5a67ee,_0x1ea916);}));
\ No newline at end of file
index d37de94..abc8568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5758=['forgot','/reset/:token','exports','express','Router','./authLocal.controller','login','post','/forgot'];(function(_0xe69aed,_0x23cd08){var _0x1fa2aa=function(_0x4a10b0){while(--_0x4a10b0){_0xe69aed['push'](_0xe69aed['shift']());}};_0x1fa2aa(++_0x23cd08);}(_0x5758,0x1aa));var _0x8575=function(_0x437eeb,_0x3de58c){_0x437eeb=_0x437eeb-0x0;var _0x2cdb75=_0x5758[_0x437eeb];return _0x2cdb75;};'use strict';var express=require(_0x8575('0x0'));var router=express[_0x8575('0x1')]();var controller=require(_0x8575('0x2'));router['post']('/',controller[_0x8575('0x3')]);router[_0x8575('0x4')](_0x8575('0x5'),controller[_0x8575('0x6')]);router[_0x8575('0x4')](_0x8575('0x7'),controller['reset']);module[_0x8575('0x8')]=router;
\ No newline at end of file
+var _0x603b=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','Router'];(function(_0x1d64d2,_0x1219df){var _0x3ed909=function(_0x11fb58){while(--_0x11fb58){_0x1d64d2['push'](_0x1d64d2['shift']());}};_0x3ed909(++_0x1219df);}(_0x603b,0xbc));var _0xb603=function(_0x2da020,_0x3db0ec){_0x2da020=_0x2da020-0x0;var _0x368846=_0x603b[_0x2da020];return _0x368846;};'use strict';var express=require('express');var router=express[_0xb603('0x0')]();var controller=require(_0xb603('0x1'));router[_0xb603('0x2')]('/',controller[_0xb603('0x3')]);router[_0xb603('0x2')](_0xb603('0x4'),controller[_0xb603('0x5')]);router['post'](_0xb603('0x6'),controller[_0xb603('0x7')]);module[_0xb603('0x8')]=router;
\ No newline at end of file
index 65ff80e..0ea2800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68c4=['sequelize','exports','STRING','INTEGER'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x68c4,0x1d8));var _0x468c=function(_0x524b2a,_0x13e281){_0x524b2a=_0x524b2a-0x0;var _0x176cc5=_0x68c4[_0x524b2a];return _0x176cc5;};'use strict';var Sequelize=require(_0x468c('0x0'));module[_0x468c('0x1')]={'name':{'type':Sequelize[_0x468c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x468c('0x2')]},'description':{'type':Sequelize[_0x468c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x468c('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x98a9=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x98a9,0x180));var _0x998a=function(_0x348310,_0x462221){_0x348310=_0x348310-0x0;var _0x5122b6=_0x98a9[_0x348310];return _0x5122b6;};'use strict';var Sequelize=require('sequelize');module[_0x998a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x998a('0x1')]},'description':{'type':Sequelize[_0x998a('0x1')]},'status':{'type':Sequelize[_0x998a('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x998a('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index a394b83..323de06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99f6=['hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x99f6,0x1a0));var _0x699f=function(_0x4f8f9c,_0x20d8c0){_0x4f8f9c=_0x4f8f9c-0x0;var _0x2425d4=_0x99f6[_0x4f8f9c];return _0x2425d4;};'use strict';var emlformat=require(_0x699f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x699f('0x1'));var jsonpatch=require(_0x699f('0x2'));var rp=require(_0x699f('0x3'));var moment=require(_0x699f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x699f('0x5'));var util=require('util');var path=require(_0x699f('0x6'));var sox=require('sox');var csv=require(_0x699f('0x7'));var ejs=require(_0x699f('0x8'));var fs=require('fs');var fs_extra=require(_0x699f('0x9'));var _=require(_0x699f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x699f('0xb'));var deskjs=require(_0x699f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x699f('0xd'));var Papa=require(_0x699f('0xe'));var Redis=require(_0x699f('0xf'));var authService=require(_0x699f('0x10'));var qs=require(_0x699f('0x11'));var as=require(_0x699f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x699f('0x13'));var config=require(_0x699f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x699f('0x15'))['db'];function respondWithStatusCode(_0x53fbe7,_0x15bbad){_0x15bbad=_0x15bbad||0xcc;return function(_0x2e9361){if(_0x2e9361){return _0x53fbe7[_0x699f('0x16')](_0x15bbad);}return _0x53fbe7['status'](_0x15bbad)['end']();};}function respondWithResult(_0x17160e,_0x5c08e0){_0x5c08e0=_0x5c08e0||0xc8;return function(_0x464a75){if(_0x464a75){return _0x17160e[_0x699f('0x17')](_0x5c08e0)[_0x699f('0x18')](_0x464a75);}};}function respondWithFilteredResult(_0x59fc78,_0x50a4d9){return function(_0x447ee8){if(_0x447ee8){var _0x528fc6=typeof _0x50a4d9[_0x699f('0x19')]===_0x699f('0x1a')&&typeof _0x50a4d9[_0x699f('0x1b')]===_0x699f('0x1a');var _0x49a464=_0x447ee8[_0x699f('0x1c')];var _0xb33e5e=_0x528fc6?0x0:_0x50a4d9['offset'];var _0x121934=_0x528fc6?_0x447ee8['count']:_0x50a4d9[_0x699f('0x19')]+_0x50a4d9[_0x699f('0x1b')];var _0x498985;if(_0x121934>=_0x49a464){_0x121934=_0x49a464;_0x498985=0xc8;}else{_0x498985=0xce;}_0x59fc78[_0x699f('0x17')](_0x498985);return _0x59fc78['set']('Content-Range',_0xb33e5e+'-'+_0x121934+'/'+_0x49a464)[_0x699f('0x18')](_0x447ee8);}return null;};}function patchUpdates(_0x209f2a){return function(_0x25c958){try{jsonpatch[_0x699f('0x1d')](_0x25c958,_0x209f2a,!![]);}catch(_0x5666a3){return BPromise[_0x699f('0x1e')](_0x5666a3);}return _0x25c958[_0x699f('0x1f')]();};}function saveUpdates(_0xd7e5e0,_0x24cfcf){return function(_0x4956ec){if(_0x4956ec){return _0x4956ec[_0x699f('0x20')](_0xd7e5e0)[_0x699f('0x21')](function(_0x4b0040){return _0x4b0040;});}return null;};}function removeEntity(_0x4f961d,_0x20d891){return function(_0x2f565c){if(_0x2f565c){return _0x2f565c[_0x699f('0x22')]()[_0x699f('0x21')](function(){_0x4f961d[_0x699f('0x17')](0xcc)[_0x699f('0x23')]();});}};}function handleEntityNotFound(_0x4470b0,_0x13b9d6){return function(_0x41c52b){if(!_0x41c52b){_0x4470b0[_0x699f('0x16')](0x194);}return _0x41c52b;};}function handleError(_0x17e0f5,_0x40c796){_0x40c796=_0x40c796||0x1f4;return function(_0x4b1b3f){logger[_0x699f('0x24')](_0x4b1b3f[_0x699f('0x25')]);if(_0x4b1b3f[_0x699f('0x26')]){delete _0x4b1b3f[_0x699f('0x26')];}_0x17e0f5[_0x699f('0x17')](_0x40c796)[_0x699f('0x27')](_0x4b1b3f);};}exports[_0x699f('0x28')]=function(_0xd7af7,_0x4d5d21){var _0x1a7860={},_0x462641={},_0x3bc968={'count':0x0,'rows':[]};var _0x33e4d5=_[_0x699f('0x29')](db[_0x699f('0x2a')][_0x699f('0x2b')],function(_0x38a197){return{'name':_0x38a197[_0x699f('0x2c')],'type':_0x38a197[_0x699f('0x2d')][_0x699f('0x2e')]};});_0x462641[_0x699f('0x2f')]=_['map'](_0x33e4d5,'name');_0x462641[_0x699f('0x30')]=_['keys'](_0xd7af7[_0x699f('0x30')]);_0x462641['filters']=_['intersection'](_0x462641[_0x699f('0x2f')],_0x462641[_0x699f('0x30')]);_0x1a7860[_0x699f('0x31')]=_[_0x699f('0x32')](_0x462641['model'],qs[_0x699f('0x33')](_0xd7af7[_0x699f('0x30')]['fields']));_0x1a7860[_0x699f('0x31')]=_0x1a7860[_0x699f('0x31')][_0x699f('0x34')]?_0x1a7860[_0x699f('0x31')]:_0x462641[_0x699f('0x2f')];if(!_0xd7af7['query']['hasOwnProperty'](_0x699f('0x35'))){_0x1a7860[_0x699f('0x1b')]=qs['limit'](_0xd7af7[_0x699f('0x30')][_0x699f('0x1b')]);_0x1a7860['offset']=qs['offset'](_0xd7af7[_0x699f('0x30')][_0x699f('0x19')]);}_0x1a7860[_0x699f('0x36')]=qs['sort'](_0xd7af7[_0x699f('0x30')][_0x699f('0x37')]);_0x1a7860[_0x699f('0x38')]=qs[_0x699f('0x39')](_[_0x699f('0x3a')](_0xd7af7[_0x699f('0x30')],_0x462641[_0x699f('0x39')]),_0x33e4d5);if(_0xd7af7[_0x699f('0x30')][_0x699f('0x3b')]){_0x1a7860['where']=_['merge'](_0x1a7860[_0x699f('0x38')],{'$or':_[_0x699f('0x29')](_0x33e4d5,function(_0x3b773c){if(_0x3b773c[_0x699f('0x2d')]!==_0x699f('0x3c')){var _0x132ef0={};_0x132ef0[_0x3b773c[_0x699f('0x26')]]={'$like':'%'+_0xd7af7['query'][_0x699f('0x3b')]+'%'};return _0x132ef0;}})});}_0x1a7860=_[_0x699f('0x3d')]({},_0x1a7860,_0xd7af7[_0x699f('0x3e')]);var _0x59a41d={'where':_0x1a7860[_0x699f('0x38')]};return db['Automation']['count'](_0x59a41d)[_0x699f('0x21')](function(_0x45fa8){_0x3bc968[_0x699f('0x1c')]=_0x45fa8;if(_0xd7af7[_0x699f('0x30')][_0x699f('0x3f')]){_0x1a7860[_0x699f('0x40')]=[{'all':!![]}];}return db[_0x699f('0x2a')][_0x699f('0x41')](_0x1a7860);})['then'](function(_0x543e50){_0x3bc968['rows']=_0x543e50;return _0x3bc968;})['then'](respondWithFilteredResult(_0x4d5d21,_0x1a7860))['catch'](handleError(_0x4d5d21,null));};exports[_0x699f('0x42')]=function(_0x20cf3c,_0x4ee0c6){var _0x30eae9={'raw':![],'where':{'id':_0x20cf3c[_0x699f('0x43')]['id']}},_0x4257b4={};_0x4257b4['model']=_[_0x699f('0x44')](db[_0x699f('0x2a')][_0x699f('0x2b')]);_0x4257b4[_0x699f('0x30')]=_[_0x699f('0x44')](_0x20cf3c[_0x699f('0x30')]);_0x4257b4[_0x699f('0x39')]=_[_0x699f('0x32')](_0x4257b4[_0x699f('0x2f')],_0x4257b4[_0x699f('0x30')]);_0x30eae9[_0x699f('0x31')]=_[_0x699f('0x32')](_0x4257b4[_0x699f('0x2f')],qs[_0x699f('0x33')](_0x20cf3c[_0x699f('0x30')]['fields']));_0x30eae9[_0x699f('0x31')]=_0x30eae9[_0x699f('0x31')]['length']?_0x30eae9['attributes']:_0x4257b4['model'];if(_0x20cf3c['query'][_0x699f('0x3f')]){_0x30eae9['include']=[{'all':!![]}];}_0x30eae9=_['merge']({},_0x30eae9,_0x20cf3c[_0x699f('0x3e')]);return db[_0x699f('0x2a')][_0x699f('0x45')](_0x30eae9)[_0x699f('0x21')](handleEntityNotFound(_0x4ee0c6,null))[_0x699f('0x21')](respondWithResult(_0x4ee0c6,null))[_0x699f('0x46')](handleError(_0x4ee0c6,null));};exports[_0x699f('0x47')]=function(_0x48a32c,_0x231601){return db[_0x699f('0x2a')][_0x699f('0x47')](_0x48a32c[_0x699f('0x48')],{})[_0x699f('0x21')](respondWithResult(_0x231601,0xc9))['catch'](handleError(_0x231601,null));};exports[_0x699f('0x20')]=function(_0x455f35,_0x4cdbbf){if(_0x455f35[_0x699f('0x48')]['id']){delete _0x455f35[_0x699f('0x48')]['id'];}return db[_0x699f('0x2a')][_0x699f('0x45')]({'where':{'id':_0x455f35[_0x699f('0x43')]['id']}})[_0x699f('0x21')](handleEntityNotFound(_0x4cdbbf,null))[_0x699f('0x21')](saveUpdates(_0x455f35[_0x699f('0x48')],null))[_0x699f('0x21')](respondWithResult(_0x4cdbbf,null))['catch'](handleError(_0x4cdbbf,null));};exports['destroy']=function(_0x397320,_0x480892){return db[_0x699f('0x2a')][_0x699f('0x45')]({'where':{'id':_0x397320[_0x699f('0x43')]['id']}})[_0x699f('0x21')](handleEntityNotFound(_0x480892,null))[_0x699f('0x21')](removeEntity(_0x480892,null))['catch'](handleError(_0x480892,null));};exports[_0x699f('0x49')]=function(_0x5c23f8,_0x4181dd,_0x5278de){return db[_0x699f('0x4a')][_0x699f('0x45')]({'where':{'id':_0x5c23f8[_0x699f('0x43')]['id']}})['then'](handleEntityNotFound(_0x4181dd,null))[_0x699f('0x21')](function(_0x253da2){if(_0x253da2){return _0x253da2[_0x699f('0x49')](_0x5c23f8[_0x699f('0x48')][_0x699f('0x4b')],_['omit'](_0x5c23f8[_0x699f('0x48')],[_0x699f('0x4b'),'id'])||{});}})[_0x699f('0x21')](respondWithResult(_0x4181dd,null))[_0x699f('0x46')](handleError(_0x4181dd,null));};exports[_0x699f('0x4c')]=function(_0x511d98,_0x13a598,_0x25a334){var _0x578068={};var _0x337c44={};var _0x1f08b8;var _0xd6ea51;return db[_0x699f('0x2a')][_0x699f('0x4d')]({'where':{'id':_0x511d98[_0x699f('0x43')]['id']}})[_0x699f('0x21')](handleEntityNotFound(_0x13a598,null))[_0x699f('0x21')](function(_0x407888){if(_0x407888){_0x1f08b8=_0x407888;_0x337c44[_0x699f('0x2f')]=_[_0x699f('0x44')](db['Condition'][_0x699f('0x2b')]);_0x337c44[_0x699f('0x30')]=_[_0x699f('0x44')](_0x511d98[_0x699f('0x30')]);_0x337c44[_0x699f('0x39')]=_[_0x699f('0x32')](_0x337c44[_0x699f('0x2f')],_0x337c44['query']);_0x578068[_0x699f('0x31')]=_[_0x699f('0x32')](_0x337c44[_0x699f('0x2f')],qs[_0x699f('0x33')](_0x511d98[_0x699f('0x30')][_0x699f('0x33')]));_0x578068[_0x699f('0x31')]=_0x578068['attributes'][_0x699f('0x34')]?_0x578068[_0x699f('0x31')]:_0x337c44[_0x699f('0x2f')];_0x578068[_0x699f('0x36')]=qs[_0x699f('0x37')](_0x511d98[_0x699f('0x30')][_0x699f('0x37')]);_0x578068['where']=qs[_0x699f('0x39')](_['pick'](_0x511d98[_0x699f('0x30')],_0x337c44['filters']));if(_0x511d98[_0x699f('0x30')][_0x699f('0x3b')]){_0x578068[_0x699f('0x38')]=_[_0x699f('0x3d')](_0x578068['where'],{'$or':_['map'](_0x578068[_0x699f('0x31')],function(_0x2fa529){var _0x53f603={};_0x53f603[_0x2fa529]={'$like':'%'+_0x511d98['query'][_0x699f('0x3b')]+'%'};return _0x53f603;})});}_0x578068=_[_0x699f('0x3d')]({},_0x578068,_0x511d98[_0x699f('0x3e')]);return _0x1f08b8[_0x699f('0x4c')](_0x578068);}})[_0x699f('0x21')](function(_0x57ebdf){if(_0x57ebdf){_0xd6ea51=_0x57ebdf['length'];if(!_0x511d98['query']['hasOwnProperty'](_0x699f('0x35'))){_0x578068[_0x699f('0x1b')]=qs[_0x699f('0x1b')](_0x511d98[_0x699f('0x30')][_0x699f('0x1b')]);_0x578068[_0x699f('0x19')]=qs[_0x699f('0x19')](_0x511d98[_0x699f('0x30')][_0x699f('0x19')]);}return _0x1f08b8['getConditions'](_0x578068);}})[_0x699f('0x21')](function(_0x1aff97){if(_0x1aff97){return _0x1aff97?{'count':_0xd6ea51,'rows':_0x1aff97}:null;}})['then'](respondWithResult(_0x13a598,null))['catch'](handleError(_0x13a598,null));};exports[_0x699f('0x4e')]=function(_0x40bd8d,_0x1073aa,_0xe91fa6){return db[_0x699f('0x4f')]['find']({'where':{'id':_0x40bd8d[_0x699f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1073aa,null))['then'](function(_0x515e19){if(_0x515e19){return _0x515e19[_0x699f('0x4e')](_0x40bd8d[_0x699f('0x48')][_0x699f('0x4b')],_[_0x699f('0x50')](_0x40bd8d['body'],[_0x699f('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1073aa,null))[_0x699f('0x46')](handleError(_0x1073aa,null));};exports[_0x699f('0x51')]=function(_0x3600f7,_0x1704bd,_0x2cd514){var _0x28424e={};var _0x25f519={};var _0xfda8a4;var _0x6da4e;return db[_0x699f('0x2a')][_0x699f('0x4d')]({'where':{'id':_0x3600f7[_0x699f('0x43')]['id']}})[_0x699f('0x21')](handleEntityNotFound(_0x1704bd,null))[_0x699f('0x21')](function(_0x344f67){if(_0x344f67){_0xfda8a4=_0x344f67;_0x25f519[_0x699f('0x2f')]=_[_0x699f('0x44')](db[_0x699f('0x4f')][_0x699f('0x2b')]);_0x25f519[_0x699f('0x30')]=_[_0x699f('0x44')](_0x3600f7[_0x699f('0x30')]);_0x25f519[_0x699f('0x39')]=_[_0x699f('0x32')](_0x25f519[_0x699f('0x2f')],_0x25f519['query']);_0x28424e[_0x699f('0x31')]=_[_0x699f('0x32')](_0x25f519[_0x699f('0x2f')],qs['fields'](_0x3600f7[_0x699f('0x30')][_0x699f('0x33')]));_0x28424e[_0x699f('0x31')]=_0x28424e[_0x699f('0x31')][_0x699f('0x34')]?_0x28424e[_0x699f('0x31')]:_0x25f519[_0x699f('0x2f')];_0x28424e['order']=qs[_0x699f('0x37')](_0x3600f7[_0x699f('0x30')]['sort']);_0x28424e[_0x699f('0x38')]=qs[_0x699f('0x39')](_[_0x699f('0x3a')](_0x3600f7[_0x699f('0x30')],_0x25f519[_0x699f('0x39')]));if(_0x3600f7['query'][_0x699f('0x3b')]){_0x28424e['where']=_[_0x699f('0x3d')](_0x28424e[_0x699f('0x38')],{'$or':_[_0x699f('0x29')](_0x28424e[_0x699f('0x31')],function(_0x426b06){var _0x5b91a3={};_0x5b91a3[_0x426b06]={'$like':'%'+_0x3600f7[_0x699f('0x30')]['filter']+'%'};return _0x5b91a3;})});}_0x28424e=_[_0x699f('0x3d')]({},_0x28424e,_0x3600f7[_0x699f('0x3e')]);return _0xfda8a4[_0x699f('0x51')](_0x28424e);}})['then'](function(_0x25dc26){if(_0x25dc26){_0x6da4e=_0x25dc26[_0x699f('0x34')];if(!_0x3600f7[_0x699f('0x30')][_0x699f('0x52')](_0x699f('0x35'))){_0x28424e[_0x699f('0x1b')]=qs['limit'](_0x3600f7[_0x699f('0x30')][_0x699f('0x1b')]);_0x28424e[_0x699f('0x19')]=qs[_0x699f('0x19')](_0x3600f7[_0x699f('0x30')][_0x699f('0x19')]);}return _0xfda8a4['getActions'](_0x28424e);}})['then'](function(_0xd756f9){if(_0xd756f9){return _0xd756f9?{'count':_0x6da4e,'rows':_0xd756f9}:null;}})['then'](respondWithResult(_0x1704bd,null))['catch'](handleError(_0x1704bd,null));};
\ No newline at end of file
+var _0x663a=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','length','include','find','create','body','params','destroy','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x663a,0x92));var _0xa663=function(_0x4286d3,_0x5e133f){_0x4286d3=_0x4286d3-0x0;var _0x41e58d=_0x663a[_0x4286d3];return _0x41e58d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa663('0x0'));var zipdir=require(_0xa663('0x1'));var jsonpatch=require(_0xa663('0x2'));var rp=require(_0xa663('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa663('0x4'));var util=require(_0xa663('0x5'));var path=require('path');var sox=require(_0xa663('0x6'));var csv=require(_0xa663('0x7'));var ejs=require(_0xa663('0x8'));var fs=require('fs');var fs_extra=require(_0xa663('0x9'));var _=require(_0xa663('0xa'));var squel=require(_0xa663('0xb'));var crypto=require(_0xa663('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa663('0xd'));var toCsv=require(_0xa663('0x7'));var querystring=require('querystring');var Papa=require(_0xa663('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa663('0xf'));var as=require(_0xa663('0x10'));var hardwareService=require(_0xa663('0x11'));var logger=require(_0xa663('0x12'))(_0xa663('0x13'));var utils=require('../../config/utils');var config=require(_0xa663('0x14'));var licenseUtil=require(_0xa663('0x15'));var db=require(_0xa663('0x16'))['db'];function respondWithStatusCode(_0x89c467,_0x3c106f){_0x3c106f=_0x3c106f||0xcc;return function(_0x5ab340){if(_0x5ab340){return _0x89c467[_0xa663('0x17')](_0x3c106f);}return _0x89c467[_0xa663('0x18')](_0x3c106f)['end']();};}function respondWithResult(_0x20cfab,_0x185e60){_0x185e60=_0x185e60||0xc8;return function(_0x2ea37e){if(_0x2ea37e){return _0x20cfab[_0xa663('0x18')](_0x185e60)[_0xa663('0x19')](_0x2ea37e);}};}function respondWithFilteredResult(_0x22c44b,_0x3e05cf){return function(_0x3e8d3e){if(_0x3e8d3e){var _0x4a030f=typeof _0x3e05cf[_0xa663('0x1a')]===_0xa663('0x1b')&&typeof _0x3e05cf[_0xa663('0x1c')]===_0xa663('0x1b');var _0x1a08a6=_0x3e8d3e[_0xa663('0x1d')];var _0x4df8ae=_0x4a030f?0x0:_0x3e05cf[_0xa663('0x1a')];var _0xe121cd=_0x4a030f?_0x3e8d3e[_0xa663('0x1d')]:_0x3e05cf['offset']+_0x3e05cf[_0xa663('0x1c')];var _0x4da88c;if(_0xe121cd>=_0x1a08a6){_0xe121cd=_0x1a08a6;_0x4da88c=0xc8;}else{_0x4da88c=0xce;}_0x22c44b[_0xa663('0x18')](_0x4da88c);return _0x22c44b[_0xa663('0x1e')](_0xa663('0x1f'),_0x4df8ae+'-'+_0xe121cd+'/'+_0x1a08a6)[_0xa663('0x19')](_0x3e8d3e);}return null;};}function patchUpdates(_0x3d8dfd){return function(_0x5c8d02){try{jsonpatch[_0xa663('0x20')](_0x5c8d02,_0x3d8dfd,!![]);}catch(_0x5ed504){return BPromise[_0xa663('0x21')](_0x5ed504);}return _0x5c8d02[_0xa663('0x22')]();};}function saveUpdates(_0x87d01a,_0x14f38d){return function(_0x168128){if(_0x168128){return _0x168128[_0xa663('0x23')](_0x87d01a)[_0xa663('0x24')](function(_0x950813){return _0x950813;});}return null;};}function removeEntity(_0x456a61,_0x4cfe91){return function(_0x18590e){if(_0x18590e){return _0x18590e['destroy']()[_0xa663('0x24')](function(){_0x456a61['status'](0xcc)[_0xa663('0x25')]();});}};}function handleEntityNotFound(_0x23ac51,_0x4b693e){return function(_0x42b66b){if(!_0x42b66b){_0x23ac51[_0xa663('0x17')](0x194);}return _0x42b66b;};}function handleError(_0x5a3349,_0x3ffce0){_0x3ffce0=_0x3ffce0||0x1f4;return function(_0x538991){logger[_0xa663('0x26')](_0x538991[_0xa663('0x27')]);if(_0x538991[_0xa663('0x28')]){delete _0x538991[_0xa663('0x28')];}_0x5a3349[_0xa663('0x18')](_0x3ffce0)[_0xa663('0x29')](_0x538991);};}exports[_0xa663('0x2a')]=function(_0x43ad88,_0x40174c){var _0x2ccead={},_0x278559={},_0x66ae71={'count':0x0,'rows':[]};var _0xe846d9=_['map'](db[_0xa663('0x2b')][_0xa663('0x2c')],function(_0x4d512f){return{'name':_0x4d512f[_0xa663('0x2d')],'type':_0x4d512f[_0xa663('0x2e')][_0xa663('0x2f')]};});_0x278559['model']=_[_0xa663('0x30')](_0xe846d9,_0xa663('0x28'));_0x278559[_0xa663('0x31')]=_[_0xa663('0x32')](_0x43ad88[_0xa663('0x31')]);_0x278559[_0xa663('0x33')]=_['intersection'](_0x278559[_0xa663('0x34')],_0x278559[_0xa663('0x31')]);_0x2ccead[_0xa663('0x35')]=_[_0xa663('0x36')](_0x278559[_0xa663('0x34')],qs[_0xa663('0x37')](_0x43ad88[_0xa663('0x31')][_0xa663('0x37')]));_0x2ccead['attributes']=_0x2ccead['attributes']['length']?_0x2ccead[_0xa663('0x35')]:_0x278559[_0xa663('0x34')];if(!_0x43ad88['query'][_0xa663('0x38')](_0xa663('0x39'))){_0x2ccead[_0xa663('0x1c')]=qs[_0xa663('0x1c')](_0x43ad88[_0xa663('0x31')][_0xa663('0x1c')]);_0x2ccead['offset']=qs[_0xa663('0x1a')](_0x43ad88[_0xa663('0x31')]['offset']);}_0x2ccead[_0xa663('0x3a')]=qs['sort'](_0x43ad88[_0xa663('0x31')][_0xa663('0x3b')]);_0x2ccead[_0xa663('0x3c')]=qs['filters'](_[_0xa663('0x3d')](_0x43ad88[_0xa663('0x31')],_0x278559[_0xa663('0x33')]),_0xe846d9);if(_0x43ad88[_0xa663('0x31')][_0xa663('0x3e')]){_0x2ccead[_0xa663('0x3c')]=_[_0xa663('0x3f')](_0x2ccead[_0xa663('0x3c')],{'$or':_['map'](_0xe846d9,function(_0x636305){if(_0x636305[_0xa663('0x2e')]!==_0xa663('0x40')){var _0x196df2={};_0x196df2[_0x636305['name']]={'$like':'%'+_0x43ad88[_0xa663('0x31')][_0xa663('0x3e')]+'%'};return _0x196df2;}})});}_0x2ccead=_[_0xa663('0x3f')]({},_0x2ccead,_0x43ad88[_0xa663('0x41')]);var _0x4c0941={'where':_0x2ccead['where']};return db[_0xa663('0x2b')]['count'](_0x4c0941)[_0xa663('0x24')](function(_0x52e917){_0x66ae71['count']=_0x52e917;if(_0x43ad88[_0xa663('0x31')][_0xa663('0x42')]){_0x2ccead['include']=[{'all':!![]}];}return db[_0xa663('0x2b')]['findAll'](_0x2ccead);})['then'](function(_0x28a528){_0x66ae71['rows']=_0x28a528;return _0x66ae71;})[_0xa663('0x24')](respondWithFilteredResult(_0x40174c,_0x2ccead))[_0xa663('0x43')](handleError(_0x40174c,null));};exports[_0xa663('0x44')]=function(_0x36b759,_0xd656d7){var _0x5f21b4={'raw':![],'where':{'id':_0x36b759['params']['id']}},_0x412ff7={};_0x412ff7['model']=_['keys'](db[_0xa663('0x2b')]['rawAttributes']);_0x412ff7[_0xa663('0x31')]=_[_0xa663('0x32')](_0x36b759[_0xa663('0x31')]);_0x412ff7[_0xa663('0x33')]=_[_0xa663('0x36')](_0x412ff7['model'],_0x412ff7[_0xa663('0x31')]);_0x5f21b4[_0xa663('0x35')]=_[_0xa663('0x36')](_0x412ff7[_0xa663('0x34')],qs[_0xa663('0x37')](_0x36b759[_0xa663('0x31')][_0xa663('0x37')]));_0x5f21b4['attributes']=_0x5f21b4[_0xa663('0x35')][_0xa663('0x45')]?_0x5f21b4[_0xa663('0x35')]:_0x412ff7['model'];if(_0x36b759['query'][_0xa663('0x42')]){_0x5f21b4[_0xa663('0x46')]=[{'all':!![]}];}_0x5f21b4=_[_0xa663('0x3f')]({},_0x5f21b4,_0x36b759['options']);return db['Automation'][_0xa663('0x47')](_0x5f21b4)[_0xa663('0x24')](handleEntityNotFound(_0xd656d7,null))['then'](respondWithResult(_0xd656d7,null))[_0xa663('0x43')](handleError(_0xd656d7,null));};exports[_0xa663('0x48')]=function(_0x507eb1,_0x7dada6){return db[_0xa663('0x2b')][_0xa663('0x48')](_0x507eb1['body'],{})[_0xa663('0x24')](respondWithResult(_0x7dada6,0xc9))[_0xa663('0x43')](handleError(_0x7dada6,null));};exports[_0xa663('0x23')]=function(_0x317996,_0x3085ed){if(_0x317996[_0xa663('0x49')]['id']){delete _0x317996['body']['id'];}return db[_0xa663('0x2b')][_0xa663('0x47')]({'where':{'id':_0x317996[_0xa663('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3085ed,null))['then'](saveUpdates(_0x317996['body'],null))[_0xa663('0x24')](respondWithResult(_0x3085ed,null))[_0xa663('0x43')](handleError(_0x3085ed,null));};exports[_0xa663('0x4b')]=function(_0x15ccc0,_0x5e8f6a){return db['Automation'][_0xa663('0x47')]({'where':{'id':_0x15ccc0['params']['id']}})[_0xa663('0x24')](handleEntityNotFound(_0x5e8f6a,null))[_0xa663('0x24')](removeEntity(_0x5e8f6a,null))[_0xa663('0x43')](handleError(_0x5e8f6a,null));};exports[_0xa663('0x4c')]=function(_0x3e8b5a,_0x580ce8,_0x4381f0){return db[_0xa663('0x4d')]['find']({'where':{'id':_0x3e8b5a[_0xa663('0x4a')]['id']}})[_0xa663('0x24')](handleEntityNotFound(_0x580ce8,null))[_0xa663('0x24')](function(_0x37f938){if(_0x37f938){return _0x37f938['addConditions'](_0x3e8b5a['body'][_0xa663('0x4e')],_[_0xa663('0x4f')](_0x3e8b5a[_0xa663('0x49')],['ids','id'])||{});}})['then'](respondWithResult(_0x580ce8,null))[_0xa663('0x43')](handleError(_0x580ce8,null));};exports['getConditions']=function(_0x4362ec,_0x56ee73,_0x542bdd){var _0x7029d0={};var _0x436430={};var _0x40c214;var _0x230626;return db[_0xa663('0x2b')][_0xa663('0x50')]({'where':{'id':_0x4362ec[_0xa663('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56ee73,null))[_0xa663('0x24')](function(_0x235c90){if(_0x235c90){_0x40c214=_0x235c90;_0x436430[_0xa663('0x34')]=_[_0xa663('0x32')](db['Condition'][_0xa663('0x2c')]);_0x436430[_0xa663('0x31')]=_[_0xa663('0x32')](_0x4362ec[_0xa663('0x31')]);_0x436430[_0xa663('0x33')]=_[_0xa663('0x36')](_0x436430[_0xa663('0x34')],_0x436430['query']);_0x7029d0['attributes']=_[_0xa663('0x36')](_0x436430[_0xa663('0x34')],qs[_0xa663('0x37')](_0x4362ec['query'][_0xa663('0x37')]));_0x7029d0[_0xa663('0x35')]=_0x7029d0[_0xa663('0x35')][_0xa663('0x45')]?_0x7029d0['attributes']:_0x436430[_0xa663('0x34')];_0x7029d0[_0xa663('0x3a')]=qs[_0xa663('0x3b')](_0x4362ec[_0xa663('0x31')][_0xa663('0x3b')]);_0x7029d0['where']=qs[_0xa663('0x33')](_[_0xa663('0x3d')](_0x4362ec['query'],_0x436430[_0xa663('0x33')]));if(_0x4362ec[_0xa663('0x31')]['filter']){_0x7029d0[_0xa663('0x3c')]=_['merge'](_0x7029d0[_0xa663('0x3c')],{'$or':_[_0xa663('0x30')](_0x7029d0['attributes'],function(_0x404b3d){var _0x953b3c={};_0x953b3c[_0x404b3d]={'$like':'%'+_0x4362ec[_0xa663('0x31')]['filter']+'%'};return _0x953b3c;})});}_0x7029d0=_['merge']({},_0x7029d0,_0x4362ec[_0xa663('0x41')]);return _0x40c214[_0xa663('0x51')](_0x7029d0);}})[_0xa663('0x24')](function(_0x168f31){if(_0x168f31){_0x230626=_0x168f31['length'];if(!_0x4362ec['query'][_0xa663('0x38')](_0xa663('0x39'))){_0x7029d0[_0xa663('0x1c')]=qs['limit'](_0x4362ec[_0xa663('0x31')]['limit']);_0x7029d0[_0xa663('0x1a')]=qs[_0xa663('0x1a')](_0x4362ec[_0xa663('0x31')][_0xa663('0x1a')]);}return _0x40c214[_0xa663('0x51')](_0x7029d0);}})['then'](function(_0x3ec1db){if(_0x3ec1db){return _0x3ec1db?{'count':_0x230626,'rows':_0x3ec1db}:null;}})[_0xa663('0x24')](respondWithResult(_0x56ee73,null))['catch'](handleError(_0x56ee73,null));};exports[_0xa663('0x52')]=function(_0x20c340,_0x410140,_0x282c13){return db[_0xa663('0x53')][_0xa663('0x47')]({'where':{'id':_0x20c340[_0xa663('0x4a')]['id']}})['then'](handleEntityNotFound(_0x410140,null))[_0xa663('0x24')](function(_0x2109eb){if(_0x2109eb){return _0x2109eb[_0xa663('0x52')](_0x20c340[_0xa663('0x49')]['ids'],_[_0xa663('0x4f')](_0x20c340[_0xa663('0x49')],[_0xa663('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x410140,null))[_0xa663('0x43')](handleError(_0x410140,null));};exports['getActions']=function(_0x53691b,_0xb15937,_0x1b50e9){var _0x369461={};var _0x287829={};var _0x579c84;var _0xa15f6b;return db[_0xa663('0x2b')][_0xa663('0x50')]({'where':{'id':_0x53691b['params']['id']}})[_0xa663('0x24')](handleEntityNotFound(_0xb15937,null))[_0xa663('0x24')](function(_0x25e1ce){if(_0x25e1ce){_0x579c84=_0x25e1ce;_0x287829[_0xa663('0x34')]=_[_0xa663('0x32')](db['Action'][_0xa663('0x2c')]);_0x287829[_0xa663('0x31')]=_[_0xa663('0x32')](_0x53691b[_0xa663('0x31')]);_0x287829['filters']=_[_0xa663('0x36')](_0x287829[_0xa663('0x34')],_0x287829[_0xa663('0x31')]);_0x369461[_0xa663('0x35')]=_[_0xa663('0x36')](_0x287829[_0xa663('0x34')],qs['fields'](_0x53691b[_0xa663('0x31')][_0xa663('0x37')]));_0x369461['attributes']=_0x369461[_0xa663('0x35')][_0xa663('0x45')]?_0x369461[_0xa663('0x35')]:_0x287829['model'];_0x369461['order']=qs[_0xa663('0x3b')](_0x53691b['query'][_0xa663('0x3b')]);_0x369461['where']=qs[_0xa663('0x33')](_[_0xa663('0x3d')](_0x53691b[_0xa663('0x31')],_0x287829[_0xa663('0x33')]));if(_0x53691b['query'][_0xa663('0x3e')]){_0x369461['where']=_[_0xa663('0x3f')](_0x369461[_0xa663('0x3c')],{'$or':_['map'](_0x369461['attributes'],function(_0x18c0a9){var _0x2f4942={};_0x2f4942[_0x18c0a9]={'$like':'%'+_0x53691b[_0xa663('0x31')][_0xa663('0x3e')]+'%'};return _0x2f4942;})});}_0x369461=_['merge']({},_0x369461,_0x53691b[_0xa663('0x41')]);return _0x579c84[_0xa663('0x54')](_0x369461);}})[_0xa663('0x24')](function(_0x36bc3d){if(_0x36bc3d){_0xa15f6b=_0x36bc3d[_0xa663('0x45')];if(!_0x53691b[_0xa663('0x31')][_0xa663('0x38')]('nolimit')){_0x369461['limit']=qs[_0xa663('0x1c')](_0x53691b[_0xa663('0x31')][_0xa663('0x1c')]);_0x369461[_0xa663('0x1a')]=qs[_0xa663('0x1a')](_0x53691b[_0xa663('0x31')]['offset']);}return _0x579c84[_0xa663('0x54')](_0x369461);}})[_0xa663('0x24')](function(_0x451c68){if(_0x451c68){return _0x451c68?{'count':_0xa15f6b,'rows':_0x451c68}:null;}})[_0xa663('0x24')](respondWithResult(_0xb15937,null))[_0xa663('0x43')](handleError(_0xb15937,null));};
\ No newline at end of file
index e04fbcd..ac4b1d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1846=['exports','Automation','tools_automations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x1846,0xdb));var _0x6184=function(_0x6bb8ca,_0x1b4019){_0x6bb8ca=_0x6bb8ca-0x0;var _0x5f4bf5=_0x1846[_0x6bb8ca];return _0x5f4bf5;};'use strict';var _=require(_0x6184('0x0'));var util=require(_0x6184('0x1'));var logger=require(_0x6184('0x2'))(_0x6184('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6184('0x4'));var fs=require('fs');var path=require(_0x6184('0x5'));var rimraf=require(_0x6184('0x6'));var config=require(_0x6184('0x7'));var attributes=require(_0x6184('0x8'));module[_0x6184('0x9')]=function(_0x2b78d0,_0x53801c){return _0x2b78d0['define'](_0x6184('0xa'),attributes,{'tableName':_0x6184('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ed6=['Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x333969,_0x2fed30){var _0x5daea9=function(_0x1e7ecd){while(--_0x1e7ecd){_0x333969['push'](_0x333969['shift']());}};_0x5daea9(++_0x2fed30);}(_0x7ed6,0x151));var _0x67ed=function(_0x1c7e47,_0x40b6bd){_0x1c7e47=_0x1c7e47-0x0;var _0x57ba61=_0x7ed6[_0x1c7e47];return _0x57ba61;};'use strict';var _=require(_0x67ed('0x0'));var util=require(_0x67ed('0x1'));var logger=require(_0x67ed('0x2'))(_0x67ed('0x3'));var moment=require(_0x67ed('0x4'));var BPromise=require(_0x67ed('0x5'));var rp=require(_0x67ed('0x6'));var fs=require('fs');var path=require(_0x67ed('0x7'));var rimraf=require(_0x67ed('0x8'));var config=require(_0x67ed('0x9'));var attributes=require(_0x67ed('0xa'));module[_0x67ed('0xb')]=function(_0x1a39ea,_0x2b0492){return _0x1a39ea[_0x67ed('0xc')](_0x67ed('0xd'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5dc34cc..dc0416f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d14=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x1e9ae9,_0x25352a){var _0x207d8d=function(_0x1effa6){while(--_0x1effa6){_0x1e9ae9['push'](_0x1e9ae9['shift']());}};_0x207d8d(++_0x25352a);}(_0x7d14,0x6d));var _0x47d1=function(_0x2ae8b1,_0x4f8c6d){_0x2ae8b1=_0x2ae8b1-0x0;var _0x2ece31=_0x7d14[_0x2ae8b1];return _0x2ece31;};'use strict';var _=require(_0x47d1('0x0'));var util=require(_0x47d1('0x1'));var moment=require('moment');var BPromise=require(_0x47d1('0x2'));var rs=require(_0x47d1('0x3'));var fs=require('fs');var Redis=require(_0x47d1('0x4'));var db=require(_0x47d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47d1('0x6'))(_0x47d1('0x7'));var config=require(_0x47d1('0x8'));var jayson=require(_0x47d1('0x9'));var client=jayson[_0x47d1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533402,_0x594860,_0x38e165){return new BPromise(function(_0x57d410,_0x422ade){return client[_0x47d1('0xb')](_0x533402,_0x38e165)[_0x47d1('0xc')](function(_0x175dd2){logger[_0x47d1('0xd')](_0x47d1('0xe'),_0x594860,_0x47d1('0xf'));logger[_0x47d1('0x10')](_0x47d1('0x11'),_0x594860,_0x47d1('0xf'),JSON[_0x47d1('0x12')](_0x175dd2));if(_0x175dd2[_0x47d1('0x13')]){if(_0x175dd2[_0x47d1('0x13')]['code']===0x1f4){logger[_0x47d1('0x13')](_0x47d1('0xe'),_0x594860,_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);return _0x422ade(_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);}logger[_0x47d1('0x13')](_0x47d1('0xe'),_0x594860,_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);return _0x57d410(_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);}else{logger[_0x47d1('0xd')](_0x47d1('0xe'),_0x594860,_0x47d1('0xf'));_0x57d410(_0x175dd2[_0x47d1('0x15')]['message']);}})['catch'](function(_0x3d660f){logger[_0x47d1('0x13')]('Automation,\x20%s,\x20%s',_0x594860,_0x3d660f);_0x422ade(_0x3d660f);});});}
\ No newline at end of file
+var _0xa3db=['client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xa3db,0x10c));var _0xba3d=function(_0x4bdb73,_0x2e6916){_0x4bdb73=_0x4bdb73-0x0;var _0x56a18a=_0xa3db[_0x4bdb73];return _0x56a18a;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('Automation,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('Automation,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});}
\ No newline at end of file
index 59c611c..55eaedc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd9=['fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0xecd9,0x13f));var _0x9ecd=function(_0x2a159f,_0x57fdfb){_0x2a159f=_0x2a159f-0x0;var _0x1cc46e=_0xecd9[_0x2a159f];return _0x1cc46e;};'use strict';var multer=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var path=require(_0x9ecd('0x2'));var timeout=require(_0x9ecd('0x3'));var express=require(_0x9ecd('0x4'));var router=express[_0x9ecd('0x5')]();var fs_extra=require(_0x9ecd('0x6'));var auth=require(_0x9ecd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9ecd('0x8'));var controller=require(_0x9ecd('0x9'));router[_0x9ecd('0xa')]('/',auth[_0x9ecd('0xb')](),controller[_0x9ecd('0xc')]);router['get'](_0x9ecd('0xd'),auth[_0x9ecd('0xb')](),controller[_0x9ecd('0xe')]);router[_0x9ecd('0xa')](_0x9ecd('0xf'),auth[_0x9ecd('0xb')](),controller[_0x9ecd('0x10')]);router[_0x9ecd('0xa')](_0x9ecd('0x11'),auth[_0x9ecd('0xb')](),controller[_0x9ecd('0x12')]);router[_0x9ecd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9ecd('0x13')]('/:id/conditions',auth[_0x9ecd('0xb')](),controller[_0x9ecd('0x14')]);router[_0x9ecd('0x13')](_0x9ecd('0x11'),auth['isAuthenticated'](),controller[_0x9ecd('0x15')]);router[_0x9ecd('0x16')](_0x9ecd('0xd'),auth[_0x9ecd('0xb')](),controller['update']);router[_0x9ecd('0x17')](_0x9ecd('0xd'),auth[_0x9ecd('0xb')](),controller['destroy']);module[_0x9ecd('0x18')]=router;
\ No newline at end of file
+var _0xc078=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','addConditions','post','put'];(function(_0xf97e38,_0x54e286){var _0x1edd6b=function(_0x35acc8){while(--_0x35acc8){_0xf97e38['push'](_0xf97e38['shift']());}};_0x1edd6b(++_0x54e286);}(_0xc078,0xfd));var _0x8c07=function(_0x1b51b0,_0x45a38d){_0x1b51b0=_0x1b51b0-0x0;var _0x263ec3=_0xc078[_0x1b51b0];return _0x263ec3;};'use strict';var multer=require('multer');var util=require(_0x8c07('0x0'));var path=require(_0x8c07('0x1'));var timeout=require(_0x8c07('0x2'));var express=require(_0x8c07('0x3'));var router=express[_0x8c07('0x4')]();var fs_extra=require(_0x8c07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c07('0x6'));var config=require(_0x8c07('0x7'));var controller=require(_0x8c07('0x8'));router[_0x8c07('0x9')]('/',auth[_0x8c07('0xa')](),controller['index']);router['get'](_0x8c07('0xb'),auth[_0x8c07('0xa')](),controller[_0x8c07('0xc')]);router['get'](_0x8c07('0xd'),auth[_0x8c07('0xa')](),controller[_0x8c07('0xe')]);router[_0x8c07('0x9')](_0x8c07('0xf'),auth[_0x8c07('0xa')](),controller[_0x8c07('0x10')]);router['post']('/',auth[_0x8c07('0xa')](),controller['create']);router['post'](_0x8c07('0xd'),auth[_0x8c07('0xa')](),controller[_0x8c07('0x11')]);router[_0x8c07('0x12')](_0x8c07('0xf'),auth['isAuthenticated'](),controller['addActions']);router[_0x8c07('0x13')]('/:id',auth[_0x8c07('0xa')](),controller['update']);router['delete'](_0x8c07('0xb'),auth[_0x8c07('0xa')](),controller['destroy']);module[_0x8c07('0x14')]=router;
\ No newline at end of file
index e6f913f..f3a7eee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaee=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING'];(function(_0x7c8431,_0x3837d3){var _0x2e27eb=function(_0x58d616){while(--_0x58d616){_0x7c8431['push'](_0x7c8431['shift']());}};_0x2e27eb(++_0x3837d3);}(_0xaaee,0x1be));var _0xeaae=function(_0x456f3f,_0x16eded){_0x456f3f=_0x456f3f-0x0;var _0x61c312=_0xaaee[_0x456f3f];return _0x61c312;};'use strict';var Sequelize=require(_0xeaae('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xeaae('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xeaae('0x2')](_0xeaae('0x3')),'allowNull':![],'defaultValue':_0xeaae('0x3')},'description':{'type':Sequelize[_0xeaae('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xeaae('0x5')},'limitCalls':{'type':Sequelize[_0xeaae('0x6')](0x4)[_0xeaae('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeaae('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xeaae('0x6')](0x3)[_0xeaae('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xeaae('0x6')](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xeaae('0x6')](0x3)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeaae('0xe')},'dialTimezone':{'type':Sequelize[_0xeaae('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeaae('0x4')],'defaultValue':_0xeaae('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xeaae('0x10'),_0xeaae('0x11'),_0xeaae('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xeaae('0x13')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xeaae('0x6')](0x9)[_0xeaae('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xeaae('0x6')](0x9)[_0xeaae('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xeaae('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xeaae('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xeaae('0x6')](0x9)[_0xeaae('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeaae('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xeaae('0x6')](0x9)[_0xeaae('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xeaae('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeaae('0x6')](0x9)[_0xeaae('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeaae('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xeaae('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xeaae('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xeaae('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xeaae('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeaae('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xeaae('0x2')](_0xeaae('0x1b'),_0xeaae('0x1c')),'defaultValue':_0xeaae('0x1b')},'dialPrefix':{'type':Sequelize[_0xeaae('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xeaae('0x6')](0x3)[_0xeaae('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeaae('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xeaae('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeaae('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xeaae('0x6')](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xeaae('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xeaae('0x6')](0x3)[_0xeaae('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeaae('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xeaae('0x6')](0x5)[_0xeaae('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeaae('0x28')}};
\ No newline at end of file
+var _0xb3bb=['STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x2aeee8,_0x707070){var _0x3aeef5=function(_0x25c910){while(--_0x25c910){_0x2aeee8['push'](_0x2aeee8['shift']());}};_0x3aeef5(++_0x707070);}(_0xb3bb,0x1ed));var _0xbb3b=function(_0x57e165,_0x4d6b88){_0x57e165=_0x57e165-0x0;var _0x2fbb4a=_0xb3bb[_0x57e165];return _0x2fbb4a;};'use strict';var Sequelize=require(_0xbb3b('0x0'));module[_0xbb3b('0x1')]={'name':{'type':Sequelize[_0xbb3b('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xbb3b('0x3')},'description':{'type':Sequelize[_0xbb3b('0x2')]},'active':{'type':Sequelize[_0xbb3b('0x4')],'defaultValue':0x0,'comment':_0xbb3b('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xbb3b('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbb3b('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbb3b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbb3b('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbb3b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbb3b('0xd')},'dialTimezone':{'type':Sequelize[_0xbb3b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbb3b('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xbb3b('0xe')](_0xbb3b('0xf'),'never',_0xbb3b('0x10')),'defaultValue':_0xbb3b('0xf')},'dialAMDActive':{'type':Sequelize[_0xbb3b('0x4')],'defaultValue':0x0,'comment':_0xbb3b('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbb3b('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbb3b('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xbb3b('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbb3b('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbb3b('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbb3b('0x8')](0x9)[_0xbb3b('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xbb3b('0xe')](_0xbb3b('0x15'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xbb3b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbb3b('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb3b('0x16')},'dialCutDigit':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb3b('0x17')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x18')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbb3b('0x8')](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbb3b('0x8')](0x3)[_0xbb3b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb3b('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbb3b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb3b('0x20')}};
\ No newline at end of file
index f7c8c10..79ee4bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1eb=['findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','OrderBy','h.id','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','createdAt','updatedAt','role','userProfileId','autoAssociation','getHoppers'];(function(_0x467f2e,_0x3b150f){var _0x3b978c=function(_0x3f758e){while(--_0x3f758e){_0x467f2e['push'](_0x467f2e['shift']());}};_0x3b978c(++_0x3b150f);}(_0xd1eb,0xc3));var _0xbd1e=function(_0x10129e,_0x5a5d5c){_0x10129e=_0x10129e-0x0;var _0x408b58=_0xd1eb[_0x10129e];return _0x408b58;};'use strict';var emlformat=require(_0xbd1e('0x0'));var rimraf=require(_0xbd1e('0x1'));var zipdir=require(_0xbd1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd1e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd1e('0x4'));var util=require(_0xbd1e('0x5'));var path=require(_0xbd1e('0x6'));var sox=require(_0xbd1e('0x7'));var csv=require(_0xbd1e('0x8'));var ejs=require(_0xbd1e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbd1e('0xa'));var crypto=require(_0xbd1e('0xb'));var jsforce=require(_0xbd1e('0xc'));var deskjs=require(_0xbd1e('0xd'));var toCsv=require(_0xbd1e('0x8'));var querystring=require(_0xbd1e('0xe'));var Papa=require(_0xbd1e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd1e('0x10'));var as=require(_0xbd1e('0x11'));var hardwareService=require(_0xbd1e('0x12'));var logger=require(_0xbd1e('0x13'))('api');var utils=require(_0xbd1e('0x14'));var config=require(_0xbd1e('0x15'));var licenseUtil=require(_0xbd1e('0x16'));var db=require(_0xbd1e('0x17'))['db'];function respondWithStatusCode(_0x283446,_0xfcab78){_0xfcab78=_0xfcab78||0xcc;return function(_0x2f1f1e){if(_0x2f1f1e){return _0x283446[_0xbd1e('0x18')](_0xfcab78);}return _0x283446[_0xbd1e('0x19')](_0xfcab78)[_0xbd1e('0x1a')]();};}function respondWithResult(_0x9cf4a7,_0x44588a){_0x44588a=_0x44588a||0xc8;return function(_0x1d4a68){if(_0x1d4a68){return _0x9cf4a7[_0xbd1e('0x19')](_0x44588a)[_0xbd1e('0x1b')](_0x1d4a68);}};}function respondWithFilteredResult(_0x1e1484,_0x5526c7){return function(_0xf2f0b4){if(_0xf2f0b4){var _0x5a5dcf=typeof _0x5526c7[_0xbd1e('0x1c')]===_0xbd1e('0x1d')&&typeof _0x5526c7['limit']===_0xbd1e('0x1d');var _0x1734bf=_0xf2f0b4[_0xbd1e('0x1e')];var _0x211978=_0x5a5dcf?0x0:_0x5526c7['offset'];var _0x1fb242=_0x5a5dcf?_0xf2f0b4['count']:_0x5526c7[_0xbd1e('0x1c')]+_0x5526c7[_0xbd1e('0x1f')];var _0x315288;if(_0x1fb242>=_0x1734bf){_0x1fb242=_0x1734bf;_0x315288=0xc8;}else{_0x315288=0xce;}_0x1e1484[_0xbd1e('0x19')](_0x315288);return _0x1e1484[_0xbd1e('0x20')]('Content-Range',_0x211978+'-'+_0x1fb242+'/'+_0x1734bf)[_0xbd1e('0x1b')](_0xf2f0b4);}return null;};}function patchUpdates(_0x3c8e6d){return function(_0x13f2eb){try{jsonpatch[_0xbd1e('0x21')](_0x13f2eb,_0x3c8e6d,!![]);}catch(_0x1249a4){return BPromise[_0xbd1e('0x22')](_0x1249a4);}return _0x13f2eb[_0xbd1e('0x23')]();};}function saveUpdates(_0x20196f,_0x208932){return function(_0x37d13c){if(_0x37d13c){return _0x37d13c[_0xbd1e('0x24')](_0x20196f)[_0xbd1e('0x25')](function(_0x4bd84a){return _0x4bd84a;});}return null;};}function removeEntity(_0x499ec0,_0x389c79){return function(_0x3011bd){if(_0x3011bd){return _0x3011bd[_0xbd1e('0x26')]()[_0xbd1e('0x25')](function(){var _0x4a2353=_0x3011bd[_0xbd1e('0x27')]({'plain':!![]});var _0x560217=_0xbd1e('0x28');return db[_0xbd1e('0x29')][_0xbd1e('0x26')]({'where':{'type':_0x560217,'resourceId':_0x4a2353['id']}})['then'](function(){return _0x3011bd;});})[_0xbd1e('0x25')](function(){_0x499ec0['status'](0xcc)[_0xbd1e('0x1a')]();});}};}function handleEntityNotFound(_0x5b4a50,_0x43d648){return function(_0x57caca){if(!_0x57caca){_0x5b4a50['sendStatus'](0x194);}return _0x57caca;};}function handleError(_0x35df17,_0x161f39){_0x161f39=_0x161f39||0x1f4;return function(_0x3feb5e){logger['error'](_0x3feb5e[_0xbd1e('0x2a')]);if(_0x3feb5e['name']){delete _0x3feb5e[_0xbd1e('0x2b')];}_0x35df17['status'](_0x161f39)[_0xbd1e('0x2c')](_0x3feb5e);};}exports[_0xbd1e('0x2d')]=function(_0x17794c,_0x28ebc4){var _0x3c0580={},_0x93e3ba={},_0x1004b0={'count':0x0,'rows':[]};var _0x26184a=_[_0xbd1e('0x2e')](db[_0xbd1e('0x2f')][_0xbd1e('0x30')],function(_0x209b61){return{'name':_0x209b61[_0xbd1e('0x31')],'type':_0x209b61['type'][_0xbd1e('0x32')]};});_0x93e3ba[_0xbd1e('0x33')]=_['map'](_0x26184a,_0xbd1e('0x2b'));_0x93e3ba['query']=_['keys'](_0x17794c[_0xbd1e('0x34')]);_0x93e3ba[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x93e3ba[_0xbd1e('0x33')],_0x93e3ba['query']);_0x3c0580[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x93e3ba[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x17794c[_0xbd1e('0x34')]['fields']));_0x3c0580[_0xbd1e('0x37')]=_0x3c0580[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x3c0580[_0xbd1e('0x37')]:_0x93e3ba[_0xbd1e('0x33')];if(!_0x17794c[_0xbd1e('0x34')][_0xbd1e('0x3a')]('nolimit')){_0x3c0580['limit']=qs['limit'](_0x17794c['query'][_0xbd1e('0x1f')]);_0x3c0580['offset']=qs[_0xbd1e('0x1c')](_0x17794c[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x3c0580[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x17794c[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x3c0580[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_[_0xbd1e('0x3e')](_0x17794c[_0xbd1e('0x34')],_0x93e3ba[_0xbd1e('0x35')]),_0x26184a);if(_0x17794c['query'][_0xbd1e('0x3f')]){_0x3c0580[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x3c0580[_0xbd1e('0x3d')],{'$or':_['map'](_0x26184a,function(_0x5f0916){if(_0x5f0916['type']!=='VIRTUAL'){var _0x164060={};_0x164060[_0x5f0916[_0xbd1e('0x2b')]]={'$like':'%'+_0x17794c['query'][_0xbd1e('0x3f')]+'%'};return _0x164060;}})});}_0x3c0580=_[_0xbd1e('0x40')]({},_0x3c0580,_0x17794c[_0xbd1e('0x41')]);var _0x9254d9={'where':_0x3c0580[_0xbd1e('0x3d')]};return db['Campaign']['count'](_0x9254d9)['then'](function(_0x86a7ae){_0x1004b0[_0xbd1e('0x1e')]=_0x86a7ae;if(_0x17794c[_0xbd1e('0x34')]['includeAll']){_0x3c0580[_0xbd1e('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xbd1e('0x43')](_0x3c0580);})['then'](function(_0x1ab70b){_0x1004b0[_0xbd1e('0x44')]=_0x1ab70b;return _0x1004b0;})[_0xbd1e('0x25')](respondWithFilteredResult(_0x28ebc4,_0x3c0580))['catch'](handleError(_0x28ebc4,null));};exports[_0xbd1e('0x45')]=function(_0x63e762,_0x2a7a1b){var _0x108840={'raw':![],'where':{'id':_0x63e762[_0xbd1e('0x46')]['id']}},_0x3fed92={};_0x3fed92['model']=_[_0xbd1e('0x47')](db[_0xbd1e('0x2f')]['rawAttributes']);_0x3fed92['query']=_['keys'](_0x63e762[_0xbd1e('0x34')]);_0x3fed92[_0xbd1e('0x35')]=_['intersection'](_0x3fed92[_0xbd1e('0x33')],_0x3fed92[_0xbd1e('0x34')]);_0x108840[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x3fed92[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x63e762['query'][_0xbd1e('0x38')]));_0x108840[_0xbd1e('0x37')]=_0x108840[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x108840[_0xbd1e('0x37')]:_0x3fed92['model'];if(_0x63e762[_0xbd1e('0x34')]['includeAll']){_0x108840[_0xbd1e('0x42')]=[{'all':!![]}];}_0x108840=_['merge']({},_0x108840,_0x63e762['options']);return db[_0xbd1e('0x2f')][_0xbd1e('0x48')](_0x108840)[_0xbd1e('0x25')](handleEntityNotFound(_0x2a7a1b,null))[_0xbd1e('0x25')](respondWithResult(_0x2a7a1b,null))[_0xbd1e('0x49')](handleError(_0x2a7a1b,null));};exports[_0xbd1e('0x4a')]=function(_0x31c687,_0x1fc9b7){return db['Campaign'][_0xbd1e('0x4a')](_0x31c687[_0xbd1e('0x4b')],{})['then'](function(_0x2196d2){var _0x3904f7=_0x31c687[_0xbd1e('0x4c')][_0xbd1e('0x27')]({'plain':!![]});if(!_0x3904f7)throw new Error(_0xbd1e('0x4d'));if(_0x3904f7['role']===_0xbd1e('0x4c')){var _0x1a2c58=_0x2196d2['get']({'plain':!![]});var _0x4f04fa=_0xbd1e('0x28');return db[_0xbd1e('0x4e')][_0xbd1e('0x48')]({'where':{'name':_0x4f04fa,'userProfileId':_0x3904f7['userProfileId']},'raw':!![]})[_0xbd1e('0x25')](function(_0x3cb005){if(_0x3cb005&&_0x3cb005['autoAssociation']===0x0){return db[_0xbd1e('0x29')][_0xbd1e('0x4a')]({'name':_0x1a2c58[_0xbd1e('0x2b')],'resourceId':_0x1a2c58['id'],'type':_0x3cb005['name'],'sectionId':_0x3cb005['id']},{})[_0xbd1e('0x25')](function(){return _0x2196d2;});}else{return _0x2196d2;}})['catch'](function(_0x190449){logger[_0xbd1e('0x4f')](_0xbd1e('0x50'),_0x190449);throw _0x190449;});}return _0x2196d2;})[_0xbd1e('0x25')](respondWithResult(_0x1fc9b7,0xc9))['catch'](handleError(_0x1fc9b7,null));};exports['clone']=function(_0x337ef8,_0x283ac4){var _0x17899c={'where':{'id':_0x337ef8[_0xbd1e('0x46')]['id']}},_0x5b70fb={};_0x5b70fb[_0xbd1e('0x33')]=_['keys'](db[_0xbd1e('0x2f')][_0xbd1e('0x30')]);_0x17899c[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x5b70fb[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x337ef8[_0xbd1e('0x34')][_0xbd1e('0x38')]));_0x17899c['attributes']=_0x17899c[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x17899c[_0xbd1e('0x37')]:_0x5b70fb[_0xbd1e('0x33')];if(_0x337ef8['query'][_0xbd1e('0x51')]){_0x17899c[_0xbd1e('0x42')]=[{'all':!![]}];}_0x17899c=_['merge']({},_0x17899c,_0x337ef8[_0xbd1e('0x41')]);return db[_0xbd1e('0x2f')][_0xbd1e('0x48')](_0x17899c)[_0xbd1e('0x25')](handleEntityNotFound(_0x283ac4,null))[_0xbd1e('0x25')](function(_0x26a390){if(_0x26a390){var _0x41d46d=_0x26a390['get']({'plain':!![]});_0x41d46d=qs[_0xbd1e('0x52')](_0x41d46d,['id',_0xbd1e('0x53'),_0xbd1e('0x54')]);_0x337ef8['body']=_[_0xbd1e('0x52')](_0x337ef8[_0xbd1e('0x4b')],['id',_0xbd1e('0x53'),_0xbd1e('0x54')]);return db[_0xbd1e('0x2f')][_0xbd1e('0x4a')](_[_0xbd1e('0x40')](_0x41d46d,_0x337ef8[_0xbd1e('0x4b')]),{'include':_0x337ef8[_0xbd1e('0x34')][_0xbd1e('0x51')]?[{'all':!![]}]:undefined})[_0xbd1e('0x25')](function(_0x80a069){var _0x266221=_0x337ef8[_0xbd1e('0x4c')][_0xbd1e('0x27')]({'plain':!![]});if(!_0x266221)throw new Error(_0xbd1e('0x4d'));if(_0x266221[_0xbd1e('0x55')]===_0xbd1e('0x4c')){var _0x18237c=_0x80a069[_0xbd1e('0x27')]({'plain':!![]});var _0x537d47=_0xbd1e('0x28');return db[_0xbd1e('0x4e')][_0xbd1e('0x48')]({'where':{'name':_0x537d47,'userProfileId':_0x266221[_0xbd1e('0x56')]},'raw':!![]})[_0xbd1e('0x25')](function(_0x555c49){if(_0x555c49&&_0x555c49[_0xbd1e('0x57')]===0x0){return db['UserProfileResource'][_0xbd1e('0x4a')]({'name':_0x18237c['name'],'resourceId':_0x18237c['id'],'type':_0x555c49[_0xbd1e('0x2b')],'sectionId':_0x555c49['id']},{})[_0xbd1e('0x25')](function(){return _0x80a069;});}else{return _0x80a069;}})['catch'](function(_0x4a5471){logger[_0xbd1e('0x4f')](_0xbd1e('0x50'),_0x4a5471);throw _0x4a5471;});}return _0x80a069;});}})[_0xbd1e('0x25')](respondWithResult(_0x283ac4,0xc9))[_0xbd1e('0x49')](handleError(_0x283ac4,null));};exports['update']=function(_0x43e757,_0x1c9fdc){if(_0x43e757[_0xbd1e('0x4b')]['id']){delete _0x43e757['body']['id'];}return db[_0xbd1e('0x2f')]['find']({'where':{'id':_0x43e757[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x1c9fdc,null))[_0xbd1e('0x25')](saveUpdates(_0x43e757[_0xbd1e('0x4b')],null))[_0xbd1e('0x25')](respondWithResult(_0x1c9fdc,null))[_0xbd1e('0x49')](handleError(_0x1c9fdc,null));};exports[_0xbd1e('0x26')]=function(_0x3c3de5,_0x4df163){return db[_0xbd1e('0x2f')][_0xbd1e('0x48')]({'where':{'id':_0x3c3de5[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x4df163,null))[_0xbd1e('0x25')](removeEntity(_0x4df163,null))['catch'](handleError(_0x4df163,null));};exports[_0xbd1e('0x58')]=function(_0x11aa66,_0x2a3e98,_0x4ff2b3){var _0x374dd7={'raw':!![],'where':{}};var _0x50729b={};var _0x580303={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x11aa66['params']['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x2a3e98,null))[_0xbd1e('0x25')](function(_0x590ba0){if(_0x590ba0){_0x50729b[_0xbd1e('0x33')]=_[_0xbd1e('0x47')](db[_0xbd1e('0x5a')]['rawAttributes']);_0x50729b[_0xbd1e('0x34')]=_[_0xbd1e('0x47')](_0x11aa66[_0xbd1e('0x34')]);_0x50729b['filters']=_[_0xbd1e('0x36')](_0x50729b[_0xbd1e('0x33')],_0x50729b['query']);_0x374dd7[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x50729b[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x11aa66['query'][_0xbd1e('0x38')]));_0x374dd7[_0xbd1e('0x37')]=_0x374dd7[_0xbd1e('0x37')]['length']?_0x374dd7['attributes']:_0x50729b[_0xbd1e('0x33')];if(!_0x11aa66['query']['hasOwnProperty'](_0xbd1e('0x5b'))){_0x374dd7[_0xbd1e('0x1f')]=qs['limit'](_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x374dd7[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x374dd7[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x374dd7[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_[_0xbd1e('0x3e')](_0x11aa66[_0xbd1e('0x34')],_0x50729b[_0xbd1e('0x35')]));_0x374dd7[_0xbd1e('0x3d')]['CampaignId']=_0x590ba0['id'];if(_0x11aa66[_0xbd1e('0x34')]['filter']){_0x374dd7[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x374dd7['where'],{'$or':_[_0xbd1e('0x2e')](_0x374dd7[_0xbd1e('0x37')],function(_0x18d81f){var _0x390917={};_0x390917[_0x18d81f]={'$like':'%'+_0x11aa66[_0xbd1e('0x34')]['filter']+'%'};return _0x390917;})});}_0x374dd7=_[_0xbd1e('0x40')]({},_0x374dd7,_0x11aa66['options']);return db[_0xbd1e('0x5a')][_0xbd1e('0x1e')]({'where':_0x374dd7['where']})['then'](function(_0x26d2ee){_0x580303[_0xbd1e('0x1e')]=_0x26d2ee;if(_0x11aa66[_0xbd1e('0x34')][_0xbd1e('0x51')]){_0x374dd7[_0xbd1e('0x42')]=[{'all':!![]}];}return db[_0xbd1e('0x5a')][_0xbd1e('0x43')](_0x374dd7);})[_0xbd1e('0x25')](function(_0x3e65ee){_0x580303['rows']=_0x3e65ee;return _0x580303;});}})['then'](respondWithFilteredResult(_0x2a3e98,_0x374dd7))[_0xbd1e('0x49')](handleError(_0x2a3e98,null));};exports[_0xbd1e('0x5c')]=function(_0x5d5f63,_0x2a8d61,_0x2c7bef){var _0x3528ea={'raw':!![],'where':{}};var _0x5393a2={};var _0x5ae4ac={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x5d5f63[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x2a8d61,null))[_0xbd1e('0x25')](function(_0x1b6728){if(_0x1b6728){_0x5393a2[_0xbd1e('0x33')]=_['keys'](db[_0xbd1e('0x5d')]['rawAttributes']);_0x5393a2[_0xbd1e('0x34')]=_[_0xbd1e('0x47')](_0x5d5f63[_0xbd1e('0x34')]);_0x5393a2[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x5393a2[_0xbd1e('0x33')],_0x5393a2[_0xbd1e('0x34')]);_0x3528ea[_0xbd1e('0x37')]=_['intersection'](_0x5393a2['model'],qs[_0xbd1e('0x38')](_0x5d5f63[_0xbd1e('0x34')]['fields']));_0x3528ea[_0xbd1e('0x37')]=_0x3528ea['attributes'][_0xbd1e('0x39')]?_0x3528ea[_0xbd1e('0x37')]:_0x5393a2[_0xbd1e('0x33')];if(!_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x3a')](_0xbd1e('0x5b'))){_0x3528ea[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x5d5f63['query'][_0xbd1e('0x1f')]);_0x3528ea[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x3528ea['order']=qs[_0xbd1e('0x3c')](_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x3528ea[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_['pick'](_0x5d5f63[_0xbd1e('0x34')],_0x5393a2[_0xbd1e('0x35')]));_0x3528ea['where'][_0xbd1e('0x5e')]=_0x1b6728['id'];if(_0x5d5f63['query'][_0xbd1e('0x3f')]){_0x3528ea[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x3528ea[_0xbd1e('0x3d')],{'$or':_[_0xbd1e('0x2e')](_0x3528ea['attributes'],function(_0x4ca3cc){var _0x224be9={};_0x224be9[_0x4ca3cc]={'$like':'%'+_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x3f')]+'%'};return _0x224be9;})});}_0x3528ea=_[_0xbd1e('0x40')]({},_0x3528ea,_0x5d5f63[_0xbd1e('0x41')]);return db[_0xbd1e('0x5d')]['count']({'where':_0x3528ea[_0xbd1e('0x3d')]})[_0xbd1e('0x25')](function(_0x4c26ed){_0x5ae4ac[_0xbd1e('0x1e')]=_0x4c26ed;if(_0x5d5f63[_0xbd1e('0x34')][_0xbd1e('0x51')]){_0x3528ea['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3528ea);})[_0xbd1e('0x25')](function(_0x46fea5){_0x5ae4ac[_0xbd1e('0x44')]=_0x46fea5;return _0x5ae4ac;});}})[_0xbd1e('0x25')](respondWithFilteredResult(_0x2a8d61,_0x3528ea))[_0xbd1e('0x49')](handleError(_0x2a8d61,null));};exports[_0xbd1e('0x5f')]=function(_0x4f3aaf,_0x51e29d,_0x2df9ef){var _0x2ec696={'raw':!![],'where':{}};var _0x2fec5f={};var _0x229553={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x4f3aaf['params']['id']}})['then'](handleEntityNotFound(_0x51e29d,null))[_0xbd1e('0x25')](function(_0x4a96fc){if(_0x4a96fc){_0x2fec5f[_0xbd1e('0x33')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x2fec5f[_0xbd1e('0x34')]=_[_0xbd1e('0x47')](_0x4f3aaf['query']);_0x2fec5f[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x2fec5f[_0xbd1e('0x33')],_0x2fec5f[_0xbd1e('0x34')]);_0x2ec696[_0xbd1e('0x37')]=_['intersection'](_0x2fec5f[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x38')]));_0x2ec696[_0xbd1e('0x37')]=_0x2ec696[_0xbd1e('0x37')]['length']?_0x2ec696[_0xbd1e('0x37')]:_0x2fec5f[_0xbd1e('0x33')];if(!_0x4f3aaf['query'][_0xbd1e('0x3a')]('nolimit')){_0x2ec696[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x2ec696['offset']=qs[_0xbd1e('0x1c')](_0x4f3aaf['query'][_0xbd1e('0x1c')]);}_0x2ec696['order']=qs[_0xbd1e('0x3c')](_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x2ec696['where']=qs[_0xbd1e('0x35')](_['pick'](_0x4f3aaf[_0xbd1e('0x34')],_0x2fec5f['filters']));_0x2ec696[_0xbd1e('0x3d')][_0xbd1e('0x5e')]=_0x4a96fc['id'];if(_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x2ec696[_0xbd1e('0x3d')]=_['merge'](_0x2ec696[_0xbd1e('0x3d')],{'$or':_['map'](_0x2ec696[_0xbd1e('0x37')],function(_0xdd7b5){var _0x606b2e={};_0x606b2e[_0xdd7b5]={'$like':'%'+_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x3f')]+'%'};return _0x606b2e;})});}_0x2ec696=_['merge']({},_0x2ec696,_0x4f3aaf[_0xbd1e('0x41')]);return db['CmHopperFinal'][_0xbd1e('0x1e')]({'where':_0x2ec696[_0xbd1e('0x3d')]})[_0xbd1e('0x25')](function(_0x350fb3){_0x229553['count']=_0x350fb3;if(_0x4f3aaf[_0xbd1e('0x34')][_0xbd1e('0x51')]){_0x2ec696[_0xbd1e('0x42')]=[{'all':!![]}];}return db[_0xbd1e('0x60')][_0xbd1e('0x43')](_0x2ec696);})[_0xbd1e('0x25')](function(_0x3349d9){_0x229553[_0xbd1e('0x44')]=_0x3349d9;return _0x229553;});}})[_0xbd1e('0x25')](respondWithFilteredResult(_0x51e29d,_0x2ec696))[_0xbd1e('0x49')](handleError(_0x51e29d,null));};exports['getHopperBlacks']=function(_0x28119c,_0x252423,_0x16d4c0){var _0x45b415={'raw':!![],'where':{}};var _0x2d3f95={};var _0x42eb83={'count':0x0,'rows':[]};return db[_0xbd1e('0x2f')][_0xbd1e('0x59')]({'where':{'id':_0x28119c[_0xbd1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x252423,null))[_0xbd1e('0x25')](function(_0x286673){if(_0x286673){_0x2d3f95[_0xbd1e('0x33')]=_[_0xbd1e('0x47')](db['CmHopperBlack']['rawAttributes']);_0x2d3f95[_0xbd1e('0x34')]=_['keys'](_0x28119c['query']);_0x2d3f95[_0xbd1e('0x35')]=_[_0xbd1e('0x36')](_0x2d3f95[_0xbd1e('0x33')],_0x2d3f95[_0xbd1e('0x34')]);_0x45b415[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x2d3f95[_0xbd1e('0x33')],qs[_0xbd1e('0x38')](_0x28119c['query'][_0xbd1e('0x38')]));_0x45b415[_0xbd1e('0x37')]=_0x45b415['attributes'][_0xbd1e('0x39')]?_0x45b415[_0xbd1e('0x37')]:_0x2d3f95['model'];if(!_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x3a')]('nolimit')){_0x45b415[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x28119c['query'][_0xbd1e('0x1f')]);_0x45b415[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}_0x45b415[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x28119c['query'][_0xbd1e('0x3c')]);_0x45b415[_0xbd1e('0x3d')]=qs['filters'](_['pick'](_0x28119c['query'],_0x2d3f95[_0xbd1e('0x35')]));_0x45b415['where']['CampaignId']=_0x286673['id'];if(_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x45b415[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x45b415['where'],{'$or':_[_0xbd1e('0x2e')](_0x45b415[_0xbd1e('0x37')],function(_0x1a83b2){var _0x41a672={};_0x41a672[_0x1a83b2]={'$like':'%'+_0x28119c[_0xbd1e('0x34')][_0xbd1e('0x3f')]+'%'};return _0x41a672;})});}_0x45b415=_[_0xbd1e('0x40')]({},_0x45b415,_0x28119c[_0xbd1e('0x41')]);return db[_0xbd1e('0x61')]['count']({'where':_0x45b415[_0xbd1e('0x3d')]})[_0xbd1e('0x25')](function(_0x25b1cf){_0x42eb83[_0xbd1e('0x1e')]=_0x25b1cf;if(_0x28119c[_0xbd1e('0x34')]['includeAll']){_0x45b415[_0xbd1e('0x42')]=[{'all':!![]}];}return db[_0xbd1e('0x61')]['findAll'](_0x45b415);})[_0xbd1e('0x25')](function(_0x4b635d){_0x42eb83[_0xbd1e('0x44')]=_0x4b635d;return _0x42eb83;});}})[_0xbd1e('0x25')](respondWithFilteredResult(_0x252423,_0x45b415))['catch'](handleError(_0x252423,null));};exports[_0xbd1e('0x62')]=function(_0x4576dd,_0x366f13,_0x20f8b1){var _0x28ea64={};var _0x5b7592={};var _0x106899;var _0x5b8d30;return db[_0xbd1e('0x2f')]['findOne']({'where':{'id':_0x4576dd[_0xbd1e('0x46')]['id']}})['then'](handleEntityNotFound(_0x366f13,null))[_0xbd1e('0x25')](function(_0x220d55){if(_0x220d55){_0x106899=_0x220d55;_0x5b7592[_0xbd1e('0x33')]=_[_0xbd1e('0x47')](db[_0xbd1e('0x63')]['rawAttributes']);_0x5b7592[_0xbd1e('0x34')]=_['keys'](_0x4576dd[_0xbd1e('0x34')]);_0x5b7592[_0xbd1e('0x35')]=_['intersection'](_0x5b7592['model'],_0x5b7592[_0xbd1e('0x34')]);_0x28ea64[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x5b7592[_0xbd1e('0x33')],qs['fields'](_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x38')]));_0x28ea64[_0xbd1e('0x37')]=_0x28ea64['attributes'][_0xbd1e('0x39')]?_0x28ea64[_0xbd1e('0x37')]:_0x5b7592['model'];_0x28ea64[_0xbd1e('0x3b')]=qs['sort'](_0x4576dd[_0xbd1e('0x34')]['sort']);_0x28ea64[_0xbd1e('0x3d')]=qs[_0xbd1e('0x35')](_[_0xbd1e('0x3e')](_0x4576dd['query'],_0x5b7592['filters']));if(_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x28ea64[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x28ea64[_0xbd1e('0x3d')],{'$or':_[_0xbd1e('0x2e')](_0x28ea64['attributes'],function(_0x24ce7d){var _0x24e9b4={};_0x24e9b4[_0x24ce7d]={'$like':'%'+_0x4576dd[_0xbd1e('0x34')]['filter']+'%'};return _0x24e9b4;})});}_0x28ea64=_[_0xbd1e('0x40')]({},_0x28ea64,_0x4576dd[_0xbd1e('0x41')]);return _0x106899[_0xbd1e('0x62')](_0x28ea64);}})[_0xbd1e('0x25')](function(_0x1c2e0a){if(_0x1c2e0a){_0x5b8d30=_0x1c2e0a['length'];if(!_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x3a')](_0xbd1e('0x5b'))){_0x28ea64[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x28ea64['offset']=qs['offset'](_0x4576dd[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}return _0x106899[_0xbd1e('0x62')](_0x28ea64);}})[_0xbd1e('0x25')](function(_0x574f74){if(_0x574f74){return _0x574f74?{'count':_0x5b8d30,'rows':_0x574f74}:null;}})[_0xbd1e('0x25')](respondWithResult(_0x366f13,null))[_0xbd1e('0x49')](handleError(_0x366f13,null));};exports[_0xbd1e('0x64')]=function(_0x16180e,_0x44cf7a,_0x39bbab){var _0xa0da91,_0x466e8e;var _0x389535=[];var _0x355edf=moment()[_0xbd1e('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xbd1e('0x2f')][_0xbd1e('0x48')]({'where':{'id':_0x16180e['params']['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x44cf7a,null))[_0xbd1e('0x25')](function(_0x403188){if(_0x403188){_0x466e8e=_0x403188;return _0x403188['addLists'](_0x16180e[_0xbd1e('0x4b')][_0xbd1e('0x66')],_[_0xbd1e('0x52')](_0x16180e[_0xbd1e('0x4b')],[_0xbd1e('0x66'),'id'])||{});}return null;})['spread'](function(_0x20f7db){var _0x205661;var _0x2910b6;_0xa0da91=_0x20f7db||[];var _0xd658d8=[];if(_0x20f7db){for(var _0x492a7f=0x0;_0x492a7f<_0x20f7db['length'];_0x492a7f+=0x1){var _0x50db07=_0x20f7db[_0x492a7f]['get']({'plain':!![]});_0x466e8e['dialCheckDuplicateType']=_0x16180e['body'][_0xbd1e('0x67')]?_0x16180e[_0xbd1e('0x4b')][_0xbd1e('0x67')]:_0x466e8e[_0xbd1e('0x67')];switch(_0x466e8e[_0xbd1e('0x67')]){case'always':_0x205661=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')](_0xbd1e('0x6a'))[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6d'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel['select']()[_0xbd1e('0x70')]('phone',_0xbd1e('0x6c'))[_0xbd1e('0x70')](_0xbd1e('0x71'),_0xbd1e('0x6d'))['field']('id',_0xbd1e('0x6e'))[_0xbd1e('0x70')](_0x50db07[_0xbd1e('0x72')]['toString'](),'ListId')[_0xbd1e('0x70')](_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')](),'CampaignId')[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27','createdAt')['field']('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))[_0xbd1e('0x74')]('cm_contacts')['where'](_0xbd1e('0x75'))[_0xbd1e('0x3d')](_0xbd1e('0x76'),_0x50db07[_0xbd1e('0x72')]['toString']())[_0xbd1e('0x3d')](_0xbd1e('0x77'))[_0xbd1e('0x3d')](_0xbd1e('0x78'),squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x7a'))['from'](_0xbd1e('0x7b'))[_0xbd1e('0x3d')](_0xbd1e('0x7c'),_0x16180e['params']['id'][_0xbd1e('0x73')]()))[_0xbd1e('0x3d')](_0xbd1e('0x78'),squel[_0xbd1e('0x79')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xbd1e('0x3d')](_0xbd1e('0x7c'),_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')]())))['toString']();break;case _0xbd1e('0x7d'):_0x205661=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')](_0xbd1e('0x6a'))[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6d'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),'createdAt',_0xbd1e('0x54')],squel['select']()['field']('phone',_0xbd1e('0x6c'))['field']('NOW()',_0xbd1e('0x6d'))[_0xbd1e('0x70')]('id',_0xbd1e('0x6e'))[_0xbd1e('0x70')](_0x50db07['CmListId'][_0xbd1e('0x73')](),_0xbd1e('0x6f'))[_0xbd1e('0x70')](_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')](),_0xbd1e('0x5e'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x53'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))['from'](_0xbd1e('0x7e'))[_0xbd1e('0x3d')](_0xbd1e('0x75'))[_0xbd1e('0x3d')](_0xbd1e('0x76'),_0x50db07[_0xbd1e('0x72')][_0xbd1e('0x73')]())[_0xbd1e('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xbd1e('0x3d')](_0xbd1e('0x78'),squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x7f'))[_0xbd1e('0x74')]('cm_hopper')[_0xbd1e('0x3d')](_0xbd1e('0x7c'),_0x16180e[_0xbd1e('0x46')]['id'][_0xbd1e('0x73')]())))[_0xbd1e('0x73')]();break;default:_0x205661=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')](_0xbd1e('0x6a'))[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6d'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel[_0xbd1e('0x79')]()['field'](_0xbd1e('0x6c'),_0xbd1e('0x6c'))['field']('NOW()',_0xbd1e('0x6d'))[_0xbd1e('0x70')]('id',_0xbd1e('0x6e'))[_0xbd1e('0x70')](_0x50db07[_0xbd1e('0x72')]['toString'](),_0xbd1e('0x6f'))['field'](_0x16180e[_0xbd1e('0x46')]['id']['toString'](),_0xbd1e('0x5e'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x53'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))['from'](_0xbd1e('0x7e'))[_0xbd1e('0x3d')](_0xbd1e('0x75'))['where'](_0xbd1e('0x76'),_0x50db07[_0xbd1e('0x72')][_0xbd1e('0x73')]())[_0xbd1e('0x3d')](_0xbd1e('0x77')))[_0xbd1e('0x73')]();}_0x2910b6=squel[_0xbd1e('0x68')]()[_0xbd1e('0x69')]('cm_hopper_additional_phones')[_0xbd1e('0x6b')](['cmHopperId','scheduledAt',_0xbd1e('0x6c'),_0xbd1e('0x80'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x81'),'id')[_0xbd1e('0x70')](_0xbd1e('0x71'),_0xbd1e('0x6d'))[_0xbd1e('0x70')]('ci.item',_0xbd1e('0x6c'))['field']('ci.OrderBY',_0xbd1e('0x80'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x53'))[_0xbd1e('0x70')]('\x27'+_0x355edf+'\x27',_0xbd1e('0x54'))[_0xbd1e('0x74')](_0xbd1e('0x82'),'ci')[_0xbd1e('0x83')](_0xbd1e('0x6a'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xbd1e('0x3d')](_0xbd1e('0x84'),_0x50db07[_0xbd1e('0x72')][_0xbd1e('0x73')]())[_0xbd1e('0x3d')](_0xbd1e('0x85'),_0x16180e['params']['id'][_0xbd1e('0x73')]())[_0xbd1e('0x3d')]('h.createdAt\x20=\x20?',_0x355edf))[_0xbd1e('0x73')]();_0xd658d8[_0xbd1e('0x86')](db[_0xbd1e('0x87')][_0xbd1e('0x34')](_0x205661));_0x389535[_0xbd1e('0x86')](db[_0xbd1e('0x87')][_0xbd1e('0x34')](_0x2910b6));}return BPromise[_0xbd1e('0x88')](_0xd658d8);}})[_0xbd1e('0x25')](function(){return BPromise[_0xbd1e('0x88')](_0x389535);})[_0xbd1e('0x25')](function(){return _0xa0da91;})[_0xbd1e('0x25')](respondWithResult(_0x44cf7a,null))[_0xbd1e('0x49')](handleError(_0x44cf7a,null));};exports[_0xbd1e('0x89')]=function(_0x2a27b5,_0x418248,_0x11c401){return db[_0xbd1e('0x2f')]['find']({'where':{'id':_0x2a27b5[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x418248,null))['then'](function(_0x11dfd8){if(_0x11dfd8){return _0x11dfd8[_0xbd1e('0x89')](_0x2a27b5['query'][_0xbd1e('0x66')]);}})[_0xbd1e('0x25')](function(_0x171730){if(_0x171730){return db[_0xbd1e('0x5a')][_0xbd1e('0x26')]({'where':{'ListId':_0x2a27b5[_0xbd1e('0x34')][_0xbd1e('0x66')],'CampaignId':_0x2a27b5[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](function(){return _0x171730;});}})[_0xbd1e('0x25')](respondWithStatusCode(_0x418248,null))['catch'](handleError(_0x418248,null));};exports[_0xbd1e('0x8a')]=function(_0x39302b,_0x36b677,_0x2f2421){var _0x2c61d3={};var _0x5c32b4={};var _0x146c02;var _0x2780e6;return db['Campaign'][_0xbd1e('0x59')]({'where':{'id':_0x39302b['params']['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x36b677,null))[_0xbd1e('0x25')](function(_0x4c45aa){if(_0x4c45aa){_0x146c02=_0x4c45aa;_0x5c32b4[_0xbd1e('0x33')]=_['keys'](db[_0xbd1e('0x63')][_0xbd1e('0x30')]);_0x5c32b4['query']=_[_0xbd1e('0x47')](_0x39302b['query']);_0x5c32b4[_0xbd1e('0x35')]=_['intersection'](_0x5c32b4[_0xbd1e('0x33')],_0x5c32b4['query']);_0x2c61d3[_0xbd1e('0x37')]=_[_0xbd1e('0x36')](_0x5c32b4['model'],qs[_0xbd1e('0x38')](_0x39302b['query'][_0xbd1e('0x38')]));_0x2c61d3['attributes']=_0x2c61d3[_0xbd1e('0x37')][_0xbd1e('0x39')]?_0x2c61d3[_0xbd1e('0x37')]:_0x5c32b4[_0xbd1e('0x33')];_0x2c61d3[_0xbd1e('0x3b')]=qs[_0xbd1e('0x3c')](_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x3c')]);_0x2c61d3[_0xbd1e('0x3d')]=qs['filters'](_['pick'](_0x39302b[_0xbd1e('0x34')],_0x5c32b4['filters']));if(_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x3f')]){_0x2c61d3[_0xbd1e('0x3d')]=_[_0xbd1e('0x40')](_0x2c61d3[_0xbd1e('0x3d')],{'$or':_[_0xbd1e('0x2e')](_0x2c61d3[_0xbd1e('0x37')],function(_0x3e2095){var _0x26fa87={};_0x26fa87[_0x3e2095]={'$like':'%'+_0x39302b['query'][_0xbd1e('0x3f')]+'%'};return _0x26fa87;})});}_0x2c61d3=_[_0xbd1e('0x40')]({},_0x2c61d3,_0x39302b['options']);return _0x146c02[_0xbd1e('0x8a')](_0x2c61d3);}})[_0xbd1e('0x25')](function(_0x3c1952){if(_0x3c1952){_0x2780e6=_0x3c1952[_0xbd1e('0x39')];if(!_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x3a')](_0xbd1e('0x5b'))){_0x2c61d3[_0xbd1e('0x1f')]=qs[_0xbd1e('0x1f')](_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x1f')]);_0x2c61d3[_0xbd1e('0x1c')]=qs[_0xbd1e('0x1c')](_0x39302b[_0xbd1e('0x34')][_0xbd1e('0x1c')]);}return _0x146c02[_0xbd1e('0x8a')](_0x2c61d3);}})[_0xbd1e('0x25')](function(_0x2dc52f){if(_0x2dc52f){return _0x2dc52f?{'count':_0x2780e6,'rows':_0x2dc52f}:null;}})[_0xbd1e('0x25')](respondWithResult(_0x36b677,null))[_0xbd1e('0x49')](handleError(_0x36b677,null));};exports[_0xbd1e('0x8b')]=function(_0x2d562f,_0x3ec647,_0x186fea){var _0x1f0106,_0x54b9c5;var _0x25abdc=[];var _0x3bded5=moment()[_0xbd1e('0x65')](_0xbd1e('0x8c'));return db[_0xbd1e('0x2f')][_0xbd1e('0x48')]({'where':{'id':_0x2d562f[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x3ec647,null))[_0xbd1e('0x25')](function(_0x15aca5){if(_0x15aca5){_0x54b9c5=_0x15aca5;return _0x15aca5[_0xbd1e('0x8b')](_0x2d562f[_0xbd1e('0x4b')][_0xbd1e('0x66')],_['omit'](_0x2d562f[_0xbd1e('0x4b')],[_0xbd1e('0x66'),'id'])||{});}return null;})['spread'](function(_0xb79cad){var _0x45698c;var _0x58feee;_0x1f0106=_0xb79cad||[];var _0x115abd=[];if(_0xb79cad){for(var _0x1417c3=0x0;_0x1417c3<_0xb79cad[_0xbd1e('0x39')];_0x1417c3+=0x1){var _0x225fe8=_0xb79cad[_0x1417c3][_0xbd1e('0x27')]({'plain':!![]});_0x45698c=squel['insert']()[_0xbd1e('0x69')]('cm_hopper_black')[_0xbd1e('0x6b')]([_0xbd1e('0x6c'),_0xbd1e('0x6e'),_0xbd1e('0x6f'),_0xbd1e('0x5e'),_0xbd1e('0x53'),_0xbd1e('0x54')],squel[_0xbd1e('0x79')]()[_0xbd1e('0x70')](_0xbd1e('0x6c'),_0xbd1e('0x6c'))[_0xbd1e('0x70')]('id','ContactId')['field'](_0x225fe8[_0xbd1e('0x72')][_0xbd1e('0x73')](),'ListId')['field'](_0x2d562f['params']['id'][_0xbd1e('0x73')](),'CampaignId')[_0xbd1e('0x70')](_0xbd1e('0x71'),_0xbd1e('0x53'))['field']('NOW()','updatedAt')['from'](_0xbd1e('0x7e'))[_0xbd1e('0x3d')]('deletedAt\x20IS\x20NULL')[_0xbd1e('0x3d')](_0xbd1e('0x76'),_0x225fe8[_0xbd1e('0x72')]['toString']())['where'](_0xbd1e('0x77')))['toString']();_0x115abd[_0xbd1e('0x86')](db[_0xbd1e('0x87')][_0xbd1e('0x34')](_0x45698c));}return BPromise['all'](_0x115abd);}})[_0xbd1e('0x25')](function(){return _0x1f0106;})[_0xbd1e('0x25')](respondWithResult(_0x3ec647,null))['catch'](handleError(_0x3ec647,null));};exports[_0xbd1e('0x8d')]=function(_0x5b067b,_0x2f1241,_0x496831){return db['Campaign']['find']({'where':{'id':_0x5b067b[_0xbd1e('0x46')]['id']}})[_0xbd1e('0x25')](handleEntityNotFound(_0x2f1241,null))[_0xbd1e('0x25')](function(_0x239f99){if(_0x239f99){return _0x239f99[_0xbd1e('0x8d')](_0x5b067b[_0xbd1e('0x34')][_0xbd1e('0x66')]);}})['then'](function(_0x52c166){if(_0x52c166){return db[_0xbd1e('0x61')][_0xbd1e('0x26')]({'where':{'ListId':_0x5b067b[_0xbd1e('0x34')][_0xbd1e('0x66')],'CampaignId':_0x5b067b[_0xbd1e('0x46')]['id']}})['then'](function(){return _0x52c166;});}})[_0xbd1e('0x25')](respondWithStatusCode(_0x2f1241,null))['catch'](handleError(_0x2f1241,null));};
\ No newline at end of file
+var _0x4b07=['NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','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','error','stack','name','send','index','Campaign','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','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','body','getHoppers','findOne','CmHopper','CampaignId','include','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x4b07,0x1d6));var _0x74b0=function(_0x12c1c4,_0x5493a1){_0x12c1c4=_0x12c1c4-0x0;var _0x159e2a=_0x4b07[_0x12c1c4];return _0x159e2a;};'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='IvrCampaigns';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['Campaign'][_0x74b0('0x1d')](_0x145f01)[_0x74b0('0x23')](function(_0x409c65){_0x5e0560[_0x74b0('0x1d')]=_0x409c65;if(_0x4dfbdb[_0x74b0('0x35')]['includeAll']){_0x25db17['include']=[{'all':!![]}];}return db['Campaign'][_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['clone']=function(_0x5235d4,_0x239a1){var _0x4f433a={'where':{'id':_0x5235d4[_0x74b0('0x47')]['id']}},_0x9b5c32={};_0x9b5c32[_0x74b0('0x32')]=_[_0x74b0('0x34')](db['Campaign']['rawAttributes']);_0x4f433a[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x9b5c32[_0x74b0('0x32')],qs['fields'](_0x5235d4[_0x74b0('0x35')]['fields']));_0x4f433a[_0x74b0('0x39')]=_0x4f433a[_0x74b0('0x39')]['length']?_0x4f433a['attributes']:_0x9b5c32[_0x74b0('0x32')];if(_0x5235d4[_0x74b0('0x35')][_0x74b0('0x49')]){_0x4f433a['include']=[{'all':!![]}];}_0x4f433a=_['merge']({},_0x4f433a,_0x5235d4['options']);return db[_0x74b0('0x2d')][_0x74b0('0x4a')](_0x4f433a)[_0x74b0('0x23')](handleEntityNotFound(_0x239a1,null))[_0x74b0('0x23')](function(_0x187904){if(_0x187904){var _0x52c185=_0x187904[_0x74b0('0x25')]({'plain':!![]});_0x52c185=qs[_0x74b0('0x54')](_0x52c185,['id','createdAt',_0x74b0('0x55')]);_0x5235d4['body']=_['omit'](_0x5235d4['body'],['id',_0x74b0('0x56'),'updatedAt']);return db[_0x74b0('0x2d')][_0x74b0('0x4b')](_[_0x74b0('0x41')](_0x52c185,_0x5235d4['body']),{'include':_0x5235d4[_0x74b0('0x35')][_0x74b0('0x49')]?[{'all':!![]}]:undefined})[_0x74b0('0x23')](function(_0x3cb5f6){var _0x59d4b1=_0x5235d4[_0x74b0('0x4e')]['get']({'plain':!![]});if(!_0x59d4b1)throw new Error(_0x74b0('0x4c'));if(_0x59d4b1['role']===_0x74b0('0x4e')){var _0x1c1881=_0x3cb5f6[_0x74b0('0x25')]({'plain':!![]});var _0x7e7b11='IvrCampaigns';return db[_0x74b0('0x50')][_0x74b0('0x4a')]({'where':{'name':_0x7e7b11,'userProfileId':_0x59d4b1[_0x74b0('0x51')]},'raw':!![]})[_0x74b0('0x23')](function(_0x5a928f){if(_0x5a928f&&_0x5a928f[_0x74b0('0x52')]===0x0){return db[_0x74b0('0x26')][_0x74b0('0x4b')]({'name':_0x1c1881['name'],'resourceId':_0x1c1881['id'],'type':_0x5a928f['name'],'sectionId':_0x5a928f['id']},{})[_0x74b0('0x23')](function(){return _0x3cb5f6;});}else{return _0x3cb5f6;}})[_0x74b0('0x45')](function(_0x5ad44f){logger['error'](_0x74b0('0x53'),_0x5ad44f);throw _0x5ad44f;});}return _0x3cb5f6;});}})[_0x74b0('0x23')](respondWithResult(_0x239a1,0xc9))[_0x74b0('0x45')](handleError(_0x239a1,null));};exports[_0x74b0('0x22')]=function(_0x12124f,_0x2a39bf){if(_0x12124f[_0x74b0('0x57')]['id']){delete _0x12124f['body']['id'];}return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x12124f['params']['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x2a39bf,null))[_0x74b0('0x23')](saveUpdates(_0x12124f[_0x74b0('0x57')],null))['then'](respondWithResult(_0x2a39bf,null))[_0x74b0('0x45')](handleError(_0x2a39bf,null));};exports[_0x74b0('0x24')]=function(_0x259b37,_0x5c4e42){return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x259b37[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c4e42,null))[_0x74b0('0x23')](removeEntity(_0x5c4e42,null))['catch'](handleError(_0x5c4e42,null));};exports[_0x74b0('0x58')]=function(_0x564701,_0x2774fc,_0xc7ded0){var _0x56657e={'raw':!![],'where':{}};var _0x4bf99b={};var _0x33682e={'count':0x0,'rows':[]};return db[_0x74b0('0x2d')][_0x74b0('0x59')]({'where':{'id':_0x564701[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x2774fc,null))[_0x74b0('0x23')](function(_0x101d0c){if(_0x101d0c){_0x4bf99b[_0x74b0('0x32')]=_[_0x74b0('0x34')](db[_0x74b0('0x5a')][_0x74b0('0x2e')]);_0x4bf99b[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x564701[_0x74b0('0x35')]);_0x4bf99b['filters']=_[_0x74b0('0x37')](_0x4bf99b[_0x74b0('0x32')],_0x4bf99b['query']);_0x56657e['attributes']=_[_0x74b0('0x37')](_0x4bf99b[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x564701['query'][_0x74b0('0x38')]));_0x56657e[_0x74b0('0x39')]=_0x56657e[_0x74b0('0x39')][_0x74b0('0x48')]?_0x56657e[_0x74b0('0x39')]:_0x4bf99b[_0x74b0('0x32')];if(!_0x564701[_0x74b0('0x35')][_0x74b0('0x3a')]('nolimit')){_0x56657e[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x564701[_0x74b0('0x35')]['limit']);_0x56657e[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x564701[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x56657e[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x564701[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x56657e[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x564701['query'],_0x4bf99b[_0x74b0('0x36')]));_0x56657e[_0x74b0('0x3e')][_0x74b0('0x5b')]=_0x101d0c['id'];if(_0x564701['query'][_0x74b0('0x40')]){_0x56657e[_0x74b0('0x3e')]=_['merge'](_0x56657e[_0x74b0('0x3e')],{'$or':_[_0x74b0('0x33')](_0x56657e[_0x74b0('0x39')],function(_0xc671b){var _0x35a3e6={};_0x35a3e6[_0xc671b]={'$like':'%'+_0x564701[_0x74b0('0x35')]['filter']+'%'};return _0x35a3e6;})});}_0x56657e=_['merge']({},_0x56657e,_0x564701[_0x74b0('0x42')]);return db[_0x74b0('0x5a')][_0x74b0('0x1d')]({'where':_0x56657e[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x5d5339){_0x33682e['count']=_0x5d5339;if(_0x564701[_0x74b0('0x35')][_0x74b0('0x49')]){_0x56657e[_0x74b0('0x5c')]=[{'all':!![]}];}return db['CmHopper'][_0x74b0('0x43')](_0x56657e);})['then'](function(_0x4e9abd){_0x33682e['rows']=_0x4e9abd;return _0x33682e;});}})[_0x74b0('0x23')](respondWithFilteredResult(_0x2774fc,_0x56657e))[_0x74b0('0x45')](handleError(_0x2774fc,null));};exports[_0x74b0('0x5d')]=function(_0x3b6a69,_0x23bc89,_0x316c58){var _0x4cbfc5={'raw':!![],'where':{}};var _0x29bb53={};var _0x388891={'count':0x0,'rows':[]};return db[_0x74b0('0x2d')]['findOne']({'where':{'id':_0x3b6a69['params']['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x23bc89,null))['then'](function(_0x16b216){if(_0x16b216){_0x29bb53['model']=_[_0x74b0('0x34')](db[_0x74b0('0x5e')][_0x74b0('0x2e')]);_0x29bb53[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x3b6a69['query']);_0x29bb53[_0x74b0('0x36')]=_[_0x74b0('0x37')](_0x29bb53[_0x74b0('0x32')],_0x29bb53['query']);_0x4cbfc5['attributes']=_['intersection'](_0x29bb53['model'],qs[_0x74b0('0x38')](_0x3b6a69['query'][_0x74b0('0x38')]));_0x4cbfc5[_0x74b0('0x39')]=_0x4cbfc5['attributes'][_0x74b0('0x48')]?_0x4cbfc5[_0x74b0('0x39')]:_0x29bb53[_0x74b0('0x32')];if(!_0x3b6a69['query']['hasOwnProperty'](_0x74b0('0x3b'))){_0x4cbfc5[_0x74b0('0x1b')]=qs['limit'](_0x3b6a69[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x4cbfc5[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x3b6a69['query']['offset']);}_0x4cbfc5[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x3b6a69['query'][_0x74b0('0x3d')]);_0x4cbfc5['where']=qs[_0x74b0('0x36')](_['pick'](_0x3b6a69['query'],_0x29bb53[_0x74b0('0x36')]));_0x4cbfc5[_0x74b0('0x3e')][_0x74b0('0x5b')]=_0x16b216['id'];if(_0x3b6a69['query']['filter']){_0x4cbfc5['where']=_[_0x74b0('0x41')](_0x4cbfc5[_0x74b0('0x3e')],{'$or':_['map'](_0x4cbfc5['attributes'],function(_0x1f9e24){var _0x76cc1c={};_0x76cc1c[_0x1f9e24]={'$like':'%'+_0x3b6a69['query']['filter']+'%'};return _0x76cc1c;})});}_0x4cbfc5=_[_0x74b0('0x41')]({},_0x4cbfc5,_0x3b6a69['options']);return db[_0x74b0('0x5e')][_0x74b0('0x1d')]({'where':_0x4cbfc5[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x22f981){_0x388891[_0x74b0('0x1d')]=_0x22f981;if(_0x3b6a69[_0x74b0('0x35')]['includeAll']){_0x4cbfc5[_0x74b0('0x5c')]=[{'all':!![]}];}return db[_0x74b0('0x5e')]['findAll'](_0x4cbfc5);})[_0x74b0('0x23')](function(_0x17cf1a){_0x388891[_0x74b0('0x44')]=_0x17cf1a;return _0x388891;});}})['then'](respondWithFilteredResult(_0x23bc89,_0x4cbfc5))['catch'](handleError(_0x23bc89,null));};exports['getHopperFinals']=function(_0x23970,_0x1a2bb2,_0x228b62){var _0x34e1ef={'raw':!![],'where':{}};var _0x504157={};var _0xcafc5b={'count':0x0,'rows':[]};return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x23970[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x1a2bb2,null))[_0x74b0('0x23')](function(_0x18e4e2){if(_0x18e4e2){_0x504157[_0x74b0('0x32')]=_['keys'](db[_0x74b0('0x5f')]['rawAttributes']);_0x504157[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x23970[_0x74b0('0x35')]);_0x504157['filters']=_['intersection'](_0x504157[_0x74b0('0x32')],_0x504157['query']);_0x34e1ef[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x504157[_0x74b0('0x32')],qs[_0x74b0('0x38')](_0x23970[_0x74b0('0x35')][_0x74b0('0x38')]));_0x34e1ef[_0x74b0('0x39')]=_0x34e1ef['attributes']['length']?_0x34e1ef[_0x74b0('0x39')]:_0x504157[_0x74b0('0x32')];if(!_0x23970['query'][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x34e1ef[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x23970[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x34e1ef[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x23970[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x34e1ef[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x23970[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x34e1ef[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x23970[_0x74b0('0x35')],_0x504157[_0x74b0('0x36')]));_0x34e1ef[_0x74b0('0x3e')][_0x74b0('0x5b')]=_0x18e4e2['id'];if(_0x23970[_0x74b0('0x35')][_0x74b0('0x40')]){_0x34e1ef[_0x74b0('0x3e')]=_[_0x74b0('0x41')](_0x34e1ef[_0x74b0('0x3e')],{'$or':_['map'](_0x34e1ef[_0x74b0('0x39')],function(_0x574491){var _0xbf0283={};_0xbf0283[_0x574491]={'$like':'%'+_0x23970[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0xbf0283;})});}_0x34e1ef=_['merge']({},_0x34e1ef,_0x23970[_0x74b0('0x42')]);return db[_0x74b0('0x5f')][_0x74b0('0x1d')]({'where':_0x34e1ef[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x2243ea){_0xcafc5b[_0x74b0('0x1d')]=_0x2243ea;if(_0x23970[_0x74b0('0x35')][_0x74b0('0x49')]){_0x34e1ef[_0x74b0('0x5c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x74b0('0x43')](_0x34e1ef);})[_0x74b0('0x23')](function(_0x2841dc){_0xcafc5b['rows']=_0x2841dc;return _0xcafc5b;});}})['then'](respondWithFilteredResult(_0x1a2bb2,_0x34e1ef))['catch'](handleError(_0x1a2bb2,null));};exports[_0x74b0('0x60')]=function(_0x49816e,_0x16692c,_0xb62734){var _0x419b2d={'raw':!![],'where':{}};var _0x38ef7f={};var _0x5a32be={'count':0x0,'rows':[]};return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x49816e[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x16692c,null))[_0x74b0('0x23')](function(_0x829bdb){if(_0x829bdb){_0x38ef7f[_0x74b0('0x32')]=_[_0x74b0('0x34')](db[_0x74b0('0x61')][_0x74b0('0x2e')]);_0x38ef7f[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x49816e['query']);_0x38ef7f['filters']=_[_0x74b0('0x37')](_0x38ef7f[_0x74b0('0x32')],_0x38ef7f[_0x74b0('0x35')]);_0x419b2d['attributes']=_['intersection'](_0x38ef7f['model'],qs['fields'](_0x49816e[_0x74b0('0x35')]['fields']));_0x419b2d['attributes']=_0x419b2d['attributes']['length']?_0x419b2d[_0x74b0('0x39')]:_0x38ef7f[_0x74b0('0x32')];if(!_0x49816e[_0x74b0('0x35')][_0x74b0('0x3a')](_0x74b0('0x3b'))){_0x419b2d[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x49816e[_0x74b0('0x35')][_0x74b0('0x1b')]);_0x419b2d[_0x74b0('0x1a')]=qs['offset'](_0x49816e[_0x74b0('0x35')][_0x74b0('0x1a')]);}_0x419b2d['order']=qs[_0x74b0('0x3d')](_0x49816e['query'][_0x74b0('0x3d')]);_0x419b2d[_0x74b0('0x3e')]=qs['filters'](_[_0x74b0('0x3f')](_0x49816e['query'],_0x38ef7f[_0x74b0('0x36')]));_0x419b2d['where'][_0x74b0('0x5b')]=_0x829bdb['id'];if(_0x49816e[_0x74b0('0x35')][_0x74b0('0x40')]){_0x419b2d['where']=_[_0x74b0('0x41')](_0x419b2d['where'],{'$or':_['map'](_0x419b2d['attributes'],function(_0x371f52){var _0x3ec87c={};_0x3ec87c[_0x371f52]={'$like':'%'+_0x49816e['query'][_0x74b0('0x40')]+'%'};return _0x3ec87c;})});}_0x419b2d=_[_0x74b0('0x41')]({},_0x419b2d,_0x49816e[_0x74b0('0x42')]);return db[_0x74b0('0x61')][_0x74b0('0x1d')]({'where':_0x419b2d[_0x74b0('0x3e')]})[_0x74b0('0x23')](function(_0x5d3ef7){_0x5a32be[_0x74b0('0x1d')]=_0x5d3ef7;if(_0x49816e[_0x74b0('0x35')][_0x74b0('0x49')]){_0x419b2d[_0x74b0('0x5c')]=[{'all':!![]}];}return db[_0x74b0('0x61')][_0x74b0('0x43')](_0x419b2d);})[_0x74b0('0x23')](function(_0x2881e1){_0x5a32be[_0x74b0('0x44')]=_0x2881e1;return _0x5a32be;});}})[_0x74b0('0x23')](respondWithFilteredResult(_0x16692c,_0x419b2d))['catch'](handleError(_0x16692c,null));};exports[_0x74b0('0x62')]=function(_0x1ee531,_0x4aab75,_0x5c614f){var _0x537b47={};var _0x1f68c5={};var _0x4d4a98;var _0x3187e;return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x1ee531[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4aab75,null))['then'](function(_0x2a4126){if(_0x2a4126){_0x4d4a98=_0x2a4126;_0x1f68c5[_0x74b0('0x32')]=_[_0x74b0('0x34')](db[_0x74b0('0x63')]['rawAttributes']);_0x1f68c5['query']=_[_0x74b0('0x34')](_0x1ee531[_0x74b0('0x35')]);_0x1f68c5[_0x74b0('0x36')]=_['intersection'](_0x1f68c5[_0x74b0('0x32')],_0x1f68c5[_0x74b0('0x35')]);_0x537b47[_0x74b0('0x39')]=_[_0x74b0('0x37')](_0x1f68c5[_0x74b0('0x32')],qs['fields'](_0x1ee531[_0x74b0('0x35')][_0x74b0('0x38')]));_0x537b47[_0x74b0('0x39')]=_0x537b47[_0x74b0('0x39')][_0x74b0('0x48')]?_0x537b47[_0x74b0('0x39')]:_0x1f68c5['model'];_0x537b47['order']=qs[_0x74b0('0x3d')](_0x1ee531[_0x74b0('0x35')]['sort']);_0x537b47[_0x74b0('0x3e')]=qs[_0x74b0('0x36')](_[_0x74b0('0x3f')](_0x1ee531[_0x74b0('0x35')],_0x1f68c5[_0x74b0('0x36')]));if(_0x1ee531[_0x74b0('0x35')]['filter']){_0x537b47['where']=_[_0x74b0('0x41')](_0x537b47[_0x74b0('0x3e')],{'$or':_[_0x74b0('0x33')](_0x537b47[_0x74b0('0x39')],function(_0x3e10f7){var _0x28cb2e={};_0x28cb2e[_0x3e10f7]={'$like':'%'+_0x1ee531[_0x74b0('0x35')][_0x74b0('0x40')]+'%'};return _0x28cb2e;})});}_0x537b47=_[_0x74b0('0x41')]({},_0x537b47,_0x1ee531[_0x74b0('0x42')]);return _0x4d4a98[_0x74b0('0x62')](_0x537b47);}})[_0x74b0('0x23')](function(_0xfdd8a1){if(_0xfdd8a1){_0x3187e=_0xfdd8a1[_0x74b0('0x48')];if(!_0x1ee531['query'][_0x74b0('0x3a')]('nolimit')){_0x537b47[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x1ee531[_0x74b0('0x35')]['limit']);_0x537b47[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x1ee531[_0x74b0('0x35')]['offset']);}return _0x4d4a98[_0x74b0('0x62')](_0x537b47);}})[_0x74b0('0x23')](function(_0x45feb3){if(_0x45feb3){return _0x45feb3?{'count':_0x3187e,'rows':_0x45feb3}:null;}})[_0x74b0('0x23')](respondWithResult(_0x4aab75,null))['catch'](handleError(_0x4aab75,null));};exports[_0x74b0('0x64')]=function(_0x243468,_0x4b6174,_0x43452f){var _0x3dae36,_0x490fa8;var _0x21e057=[];var _0x2b9391=moment()[_0x74b0('0x65')](_0x74b0('0x66'));return db[_0x74b0('0x2d')]['find']({'where':{'id':_0x243468[_0x74b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b6174,null))['then'](function(_0xf3fc16){if(_0xf3fc16){_0x490fa8=_0xf3fc16;return _0xf3fc16[_0x74b0('0x64')](_0x243468['body'][_0x74b0('0x67')],_[_0x74b0('0x54')](_0x243468['body'],[_0x74b0('0x67'),'id'])||{});}return null;})[_0x74b0('0x68')](function(_0x22ac25){var _0x3df996;var _0x393323;_0x3dae36=_0x22ac25||[];var _0x454fd6=[];if(_0x22ac25){for(var _0x2b755c=0x0;_0x2b755c<_0x22ac25[_0x74b0('0x48')];_0x2b755c+=0x1){var _0x58e0d1=_0x22ac25[_0x2b755c][_0x74b0('0x25')]({'plain':!![]});_0x490fa8['dialCheckDuplicateType']=_0x243468['body'][_0x74b0('0x69')]?_0x243468['body']['dialCheckDuplicateType']:_0x490fa8['dialCheckDuplicateType'];switch(_0x490fa8[_0x74b0('0x69')]){case'always':_0x3df996=squel['insert']()[_0x74b0('0x6a')](_0x74b0('0x6b'))[_0x74b0('0x6c')](['phone',_0x74b0('0x6d'),_0x74b0('0x6e'),'ListId',_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel[_0x74b0('0x6f')]()[_0x74b0('0x70')]('phone',_0x74b0('0x71'))['field'](_0x74b0('0x72'),_0x74b0('0x6d'))[_0x74b0('0x70')]('id',_0x74b0('0x6e'))[_0x74b0('0x70')](_0x58e0d1[_0x74b0('0x73')][_0x74b0('0x74')](),'ListId')[_0x74b0('0x70')](_0x243468['params']['id'][_0x74b0('0x74')](),_0x74b0('0x5b'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27','createdAt')[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x55'))[_0x74b0('0x75')](_0x74b0('0x76'))['where'](_0x74b0('0x77'))[_0x74b0('0x3e')](_0x74b0('0x78'),_0x58e0d1[_0x74b0('0x73')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x74b0('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x79'))[_0x74b0('0x75')]('cm_hopper_final')[_0x74b0('0x3e')](_0x74b0('0x7a'),_0x243468[_0x74b0('0x47')]['id'][_0x74b0('0x74')]()))[_0x74b0('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x74b0('0x6f')]()['field'](_0x74b0('0x7b'))[_0x74b0('0x75')](_0x74b0('0x6b'))['where'](_0x74b0('0x7a'),_0x243468['params']['id'][_0x74b0('0x74')]())))[_0x74b0('0x74')]();break;case _0x74b0('0x7c'):_0x3df996=squel[_0x74b0('0x7d')]()['into'](_0x74b0('0x6b'))['fromQuery']([_0x74b0('0x71'),_0x74b0('0x6d'),'ContactId',_0x74b0('0x7e'),_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x71'),_0x74b0('0x71'))['field'](_0x74b0('0x72'),_0x74b0('0x6d'))[_0x74b0('0x70')]('id',_0x74b0('0x6e'))['field'](_0x58e0d1[_0x74b0('0x73')][_0x74b0('0x74')](),_0x74b0('0x7e'))['field'](_0x243468[_0x74b0('0x47')]['id']['toString'](),_0x74b0('0x5b'))['field']('\x27'+_0x2b9391+'\x27',_0x74b0('0x56'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x55'))[_0x74b0('0x75')]('cm_contacts')[_0x74b0('0x3e')](_0x74b0('0x77'))[_0x74b0('0x3e')](_0x74b0('0x78'),_0x58e0d1['CmListId'][_0x74b0('0x74')]())[_0x74b0('0x3e')](_0x74b0('0x7f'))[_0x74b0('0x3e')](_0x74b0('0x80'),squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x7b'))[_0x74b0('0x75')](_0x74b0('0x6b'))['where'](_0x74b0('0x7a'),_0x243468[_0x74b0('0x47')]['id']['toString']())))['toString']();break;default:_0x3df996=squel[_0x74b0('0x7d')]()[_0x74b0('0x6a')]('cm_hopper')[_0x74b0('0x6c')]([_0x74b0('0x71'),'scheduledAt',_0x74b0('0x6e'),_0x74b0('0x7e'),_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel['select']()[_0x74b0('0x70')]('phone',_0x74b0('0x71'))[_0x74b0('0x70')]('NOW()',_0x74b0('0x6d'))[_0x74b0('0x70')]('id','ContactId')[_0x74b0('0x70')](_0x58e0d1['CmListId'][_0x74b0('0x74')](),_0x74b0('0x7e'))['field'](_0x243468['params']['id']['toString'](),_0x74b0('0x5b'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x56'))[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27','updatedAt')[_0x74b0('0x75')]('cm_contacts')[_0x74b0('0x3e')](_0x74b0('0x77'))['where']('ListId\x20=\x20?',_0x58e0d1[_0x74b0('0x73')][_0x74b0('0x74')]())[_0x74b0('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x74b0('0x74')]();}_0x393323=squel[_0x74b0('0x7d')]()[_0x74b0('0x6a')](_0x74b0('0x81'))[_0x74b0('0x6c')]([_0x74b0('0x82'),_0x74b0('0x6d'),_0x74b0('0x71'),_0x74b0('0x83'),'createdAt','updatedAt'],squel[_0x74b0('0x6f')]()[_0x74b0('0x70')](_0x74b0('0x84'),'id')[_0x74b0('0x70')](_0x74b0('0x72'),_0x74b0('0x6d'))['field'](_0x74b0('0x85'),'phone')[_0x74b0('0x70')](_0x74b0('0x86'),'OrderBy')[_0x74b0('0x70')]('\x27'+_0x2b9391+'\x27',_0x74b0('0x56'))['field']('\x27'+_0x2b9391+'\x27','updatedAt')[_0x74b0('0x75')](_0x74b0('0x87'),'ci')[_0x74b0('0x88')](_0x74b0('0x6b'),'h','h.ContactId\x20=\x20ci.CmContactId')['where']('h.ListId\x20=\x20?',_0x58e0d1['CmListId'][_0x74b0('0x74')]())[_0x74b0('0x3e')](_0x74b0('0x89'),_0x243468['params']['id'][_0x74b0('0x74')]())[_0x74b0('0x3e')]('h.createdAt\x20=\x20?',_0x2b9391))[_0x74b0('0x74')]();_0x454fd6[_0x74b0('0x8a')](db['sequelize'][_0x74b0('0x35')](_0x3df996));_0x21e057['push'](db[_0x74b0('0x8b')]['query'](_0x393323));}return BPromise[_0x74b0('0x8c')](_0x454fd6);}})[_0x74b0('0x23')](function(){return BPromise[_0x74b0('0x8c')](_0x21e057);})[_0x74b0('0x23')](function(){return _0x3dae36;})['then'](respondWithResult(_0x4b6174,null))[_0x74b0('0x45')](handleError(_0x4b6174,null));};exports['removeLists']=function(_0x810174,_0x92aa60,_0x36b312){return db[_0x74b0('0x2d')]['find']({'where':{'id':_0x810174[_0x74b0('0x47')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x92aa60,null))[_0x74b0('0x23')](function(_0x57d79e){if(_0x57d79e){return _0x57d79e[_0x74b0('0x8d')](_0x810174[_0x74b0('0x35')]['ids']);}})[_0x74b0('0x23')](function(_0x1e7dc4){if(_0x1e7dc4){return db[_0x74b0('0x5a')]['destroy']({'where':{'ListId':_0x810174[_0x74b0('0x35')]['ids'],'CampaignId':_0x810174[_0x74b0('0x47')]['id']}})['then'](function(){return _0x1e7dc4;});}})[_0x74b0('0x23')](respondWithStatusCode(_0x92aa60,null))[_0x74b0('0x45')](handleError(_0x92aa60,null));};exports[_0x74b0('0x8e')]=function(_0x2db002,_0x37e172,_0x625064){var _0x43fa6c={};var _0x2edd85={};var _0x57769d;var _0x43b46;return db['Campaign'][_0x74b0('0x59')]({'where':{'id':_0x2db002['params']['id']}})['then'](handleEntityNotFound(_0x37e172,null))[_0x74b0('0x23')](function(_0x30e49f){if(_0x30e49f){_0x57769d=_0x30e49f;_0x2edd85['model']=_[_0x74b0('0x34')](db[_0x74b0('0x63')][_0x74b0('0x2e')]);_0x2edd85[_0x74b0('0x35')]=_[_0x74b0('0x34')](_0x2db002[_0x74b0('0x35')]);_0x2edd85['filters']=_[_0x74b0('0x37')](_0x2edd85[_0x74b0('0x32')],_0x2edd85['query']);_0x43fa6c['attributes']=_['intersection'](_0x2edd85['model'],qs[_0x74b0('0x38')](_0x2db002[_0x74b0('0x35')][_0x74b0('0x38')]));_0x43fa6c[_0x74b0('0x39')]=_0x43fa6c['attributes'][_0x74b0('0x48')]?_0x43fa6c[_0x74b0('0x39')]:_0x2edd85[_0x74b0('0x32')];_0x43fa6c[_0x74b0('0x3c')]=qs[_0x74b0('0x3d')](_0x2db002[_0x74b0('0x35')][_0x74b0('0x3d')]);_0x43fa6c['where']=qs[_0x74b0('0x36')](_['pick'](_0x2db002['query'],_0x2edd85[_0x74b0('0x36')]));if(_0x2db002[_0x74b0('0x35')][_0x74b0('0x40')]){_0x43fa6c['where']=_[_0x74b0('0x41')](_0x43fa6c['where'],{'$or':_['map'](_0x43fa6c[_0x74b0('0x39')],function(_0x47364d){var _0x189918={};_0x189918[_0x47364d]={'$like':'%'+_0x2db002['query'][_0x74b0('0x40')]+'%'};return _0x189918;})});}_0x43fa6c=_[_0x74b0('0x41')]({},_0x43fa6c,_0x2db002[_0x74b0('0x42')]);return _0x57769d[_0x74b0('0x8e')](_0x43fa6c);}})['then'](function(_0x21e73c){if(_0x21e73c){_0x43b46=_0x21e73c[_0x74b0('0x48')];if(!_0x2db002[_0x74b0('0x35')][_0x74b0('0x3a')]('nolimit')){_0x43fa6c[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x2db002[_0x74b0('0x35')]['limit']);_0x43fa6c[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x2db002[_0x74b0('0x35')][_0x74b0('0x1a')]);}return _0x57769d[_0x74b0('0x8e')](_0x43fa6c);}})[_0x74b0('0x23')](function(_0x322a3c){if(_0x322a3c){return _0x322a3c?{'count':_0x43b46,'rows':_0x322a3c}:null;}})[_0x74b0('0x23')](respondWithResult(_0x37e172,null))[_0x74b0('0x45')](handleError(_0x37e172,null));};exports['addBlackLists']=function(_0x349586,_0x536583,_0x583bbf){var _0xc03b33,_0x2678da;var _0x5da5d2=[];var _0x54f899=moment()['format'](_0x74b0('0x66'));return db[_0x74b0('0x2d')][_0x74b0('0x4a')]({'where':{'id':_0x349586['params']['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x536583,null))[_0x74b0('0x23')](function(_0x1d83db){if(_0x1d83db){_0x2678da=_0x1d83db;return _0x1d83db[_0x74b0('0x8f')](_0x349586[_0x74b0('0x57')][_0x74b0('0x67')],_[_0x74b0('0x54')](_0x349586[_0x74b0('0x57')],['ids','id'])||{});}return null;})[_0x74b0('0x68')](function(_0x37bf70){var _0x502f10;var _0x15c4cc;_0xc03b33=_0x37bf70||[];var _0x240087=[];if(_0x37bf70){for(var _0xd8d8f3=0x0;_0xd8d8f3<_0x37bf70[_0x74b0('0x48')];_0xd8d8f3+=0x1){var _0x2a4fe7=_0x37bf70[_0xd8d8f3][_0x74b0('0x25')]({'plain':!![]});_0x502f10=squel[_0x74b0('0x7d')]()[_0x74b0('0x6a')](_0x74b0('0x90'))[_0x74b0('0x6c')]([_0x74b0('0x71'),_0x74b0('0x6e'),'ListId',_0x74b0('0x5b'),_0x74b0('0x56'),_0x74b0('0x55')],squel[_0x74b0('0x6f')]()['field'](_0x74b0('0x71'),_0x74b0('0x71'))[_0x74b0('0x70')]('id',_0x74b0('0x6e'))['field'](_0x2a4fe7[_0x74b0('0x73')][_0x74b0('0x74')](),_0x74b0('0x7e'))[_0x74b0('0x70')](_0x349586[_0x74b0('0x47')]['id'][_0x74b0('0x74')](),'CampaignId')['field'](_0x74b0('0x72'),_0x74b0('0x56'))[_0x74b0('0x70')](_0x74b0('0x72'),'updatedAt')[_0x74b0('0x75')](_0x74b0('0x76'))[_0x74b0('0x3e')](_0x74b0('0x77'))[_0x74b0('0x3e')](_0x74b0('0x78'),_0x2a4fe7['CmListId']['toString']())[_0x74b0('0x3e')](_0x74b0('0x7f')))[_0x74b0('0x74')]();_0x240087[_0x74b0('0x8a')](db[_0x74b0('0x8b')][_0x74b0('0x35')](_0x502f10));}return BPromise['all'](_0x240087);}})[_0x74b0('0x23')](function(){return _0xc03b33;})[_0x74b0('0x23')](respondWithResult(_0x536583,null))['catch'](handleError(_0x536583,null));};exports[_0x74b0('0x91')]=function(_0x36dd0a,_0x550108,_0x578110){return db[_0x74b0('0x2d')]['find']({'where':{'id':_0x36dd0a['params']['id']}})['then'](handleEntityNotFound(_0x550108,null))[_0x74b0('0x23')](function(_0x38726b){if(_0x38726b){return _0x38726b[_0x74b0('0x91')](_0x36dd0a['query']['ids']);}})[_0x74b0('0x23')](function(_0x34a597){if(_0x34a597){return db['CmHopperBlack'][_0x74b0('0x24')]({'where':{'ListId':_0x36dd0a[_0x74b0('0x35')][_0x74b0('0x67')],'CampaignId':_0x36dd0a[_0x74b0('0x47')]['id']}})['then'](function(){return _0x34a597;});}})[_0x74b0('0x23')](respondWithStatusCode(_0x550108,null))['catch'](handleError(_0x550108,null));};
\ No newline at end of file
index 76b441e..567b198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 b43694f..6eb2a9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe356=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','model','include','then','stringify','catch','lodash'];(function(_0x18e2f3,_0xfea2ca){var _0x1ef3cb=function(_0x6bb00d){while(--_0x6bb00d){_0x18e2f3['push'](_0x18e2f3['shift']());}};_0x1ef3cb(++_0xfea2ca);}(_0xe356,0x1ee));var _0x6e35=function(_0x359c77,_0x3ce78c){_0x359c77=_0x359c77-0x0;var _0x2b61bc=_0xe356[_0x359c77];return _0x2b61bc;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var moment=require(_0x6e35('0x2'));var BPromise=require(_0x6e35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e35('0x5'));var logger=require(_0x6e35('0x6'))(_0x6e35('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e35('0x8'));var client=jayson[_0x6e35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389ae2,_0xba948e,_0x114b4c){return new BPromise(function(_0x1da99b,_0x5119fa){return client[_0x6e35('0xa')](_0x389ae2,_0x114b4c)['then'](function(_0x3b3c16){logger['info'](_0x6e35('0xb'),_0xba948e,'request\x20sent');logger['debug'](_0x6e35('0xc'),_0xba948e,_0x6e35('0xd'),JSON['stringify'](_0x3b3c16));if(_0x3b3c16['error']){if(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0xf')]===0x1f4){logger[_0x6e35('0xe')]('Campaign,\x20%s,\x20%s',_0xba948e,_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);return _0x5119fa(_0x3b3c16[_0x6e35('0xe')]['message']);}logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3b3c16[_0x6e35('0xe')]['message']);return _0x1da99b(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);}else{logger[_0x6e35('0x11')]('Campaign,\x20%s,\x20%s',_0xba948e,_0x6e35('0xd'));_0x1da99b(_0x3b3c16[_0x6e35('0x12')][_0x6e35('0x10')]);}})['catch'](function(_0x3e7e7a){logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3e7e7a);_0x5119fa(_0x3e7e7a);});});}exports[_0x6e35('0x13')]=function(_0x58a622){var _0x408504=this;return new Promise(function(_0x2bd771,_0x53e26d){return db[_0x6e35('0x14')][_0x6e35('0x15')]({'raw':_0x58a622[_0x6e35('0x16')]?_0x58a622[_0x6e35('0x16')][_0x6e35('0x17')]===undefined?!![]:![]:!![],'where':_0x58a622[_0x6e35('0x16')]?_0x58a622['options'][_0x6e35('0x18')]||null:null,'attributes':_0x58a622[_0x6e35('0x16')]?_0x58a622[_0x6e35('0x16')][_0x6e35('0x19')]||null:null,'limit':_0x58a622[_0x6e35('0x16')]?_0x58a622[_0x6e35('0x16')][_0x6e35('0x1a')]||null:null,'include':_0x58a622[_0x6e35('0x16')]?_0x58a622[_0x6e35('0x16')]['include']?_[_0x6e35('0x1b')](_0x58a622['options']['include'],function(_0x301c39){return{'model':db[_0x301c39[_0x6e35('0x1c')]],'as':_0x301c39['as'],'attributes':_0x301c39[_0x6e35('0x19')],'include':_0x301c39['include']?_[_0x6e35('0x1b')](_0x301c39[_0x6e35('0x1d')],function(_0x24afad){return{'model':db[_0x24afad[_0x6e35('0x1c')]],'as':_0x24afad['as'],'attributes':_0x24afad[_0x6e35('0x19')],'include':_0x24afad[_0x6e35('0x1d')]?_[_0x6e35('0x1b')](_0x24afad[_0x6e35('0x1d')],function(_0x353bfb){return{'model':db[_0x353bfb[_0x6e35('0x1c')]],'as':_0x353bfb['as'],'attributes':_0x353bfb['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e35('0x1e')](function(_0x30ae66){logger[_0x6e35('0x11')]('GetCampaign',_0x58a622);logger['debug'](_0x6e35('0x13'),_0x58a622,JSON[_0x6e35('0x1f')](_0x30ae66));_0x2bd771(_0x30ae66);})[_0x6e35('0x20')](function(_0x4f4514){logger['error'](_0x6e35('0x13'),_0x4f4514[_0x6e35('0x10')],_0x58a622);_0x53e26d(_0x408504[_0x6e35('0xe')](0x1f4,_0x4f4514['message']));});});};
\ No newline at end of file
+var _0x57d4=['Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','info','catch','GetCampaign','Campaign','options','raw','where','attributes','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x57d4,0x78));var _0x457d=function(_0x4bb702,_0x4a860c){_0x4bb702=_0x4bb702-0x0;var _0x5eca00=_0x57d4[_0x4bb702];return _0x5eca00;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var moment=require('moment');var BPromise=require(_0x457d('0x2'));var rs=require(_0x457d('0x3'));var fs=require('fs');var Redis=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];var utils=require(_0x457d('0x6'));var logger=require(_0x457d('0x7'))(_0x457d('0x8'));var config=require(_0x457d('0x9'));var jayson=require(_0x457d('0xa'));var client=jayson[_0x457d('0xb')][_0x457d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6816,_0x1fc199,_0x381e22){return new BPromise(function(_0x4e32c0,_0x5dff56){return client[_0x457d('0xd')](_0x5c6816,_0x381e22)[_0x457d('0xe')](function(_0x127b89){logger['info']('Campaign,\x20%s,\x20%s',_0x1fc199,'request\x20sent');logger[_0x457d('0xf')](_0x457d('0x10'),_0x1fc199,_0x457d('0x11'),JSON[_0x457d('0x12')](_0x127b89));if(_0x127b89[_0x457d('0x13')]){if(_0x127b89[_0x457d('0x13')][_0x457d('0x14')]===0x1f4){logger[_0x457d('0x13')](_0x457d('0x15'),_0x1fc199,_0x127b89['error'][_0x457d('0x16')]);return _0x5dff56(_0x127b89[_0x457d('0x13')]['message']);}logger['error'](_0x457d('0x15'),_0x1fc199,_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);return _0x4e32c0(_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);}else{logger[_0x457d('0x17')](_0x457d('0x15'),_0x1fc199,_0x457d('0x11'));_0x4e32c0(_0x127b89['result'][_0x457d('0x16')]);}})[_0x457d('0x18')](function(_0x2c05ca){logger['error']('Campaign,\x20%s,\x20%s',_0x1fc199,_0x2c05ca);_0x5dff56(_0x2c05ca);});});}exports[_0x457d('0x19')]=function(_0x4d988f){var _0x151416=this;return new Promise(function(_0x802f2b,_0x50e78f){return db[_0x457d('0x1a')]['findAll']({'raw':_0x4d988f['options']?_0x4d988f[_0x457d('0x1b')][_0x457d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d988f[_0x457d('0x1b')]?_0x4d988f[_0x457d('0x1b')][_0x457d('0x1d')]||null:null,'attributes':_0x4d988f[_0x457d('0x1b')]?_0x4d988f[_0x457d('0x1b')][_0x457d('0x1e')]||null:null,'limit':_0x4d988f[_0x457d('0x1b')]?_0x4d988f[_0x457d('0x1b')]['limit']||null:null,'include':_0x4d988f['options']?_0x4d988f['options'][_0x457d('0x1f')]?_['map'](_0x4d988f['options']['include'],function(_0x206fdc){return{'model':db[_0x206fdc[_0x457d('0x20')]],'as':_0x206fdc['as'],'attributes':_0x206fdc['attributes'],'include':_0x206fdc[_0x457d('0x1f')]?_[_0x457d('0x21')](_0x206fdc[_0x457d('0x1f')],function(_0x152cfc){return{'model':db[_0x152cfc['model']],'as':_0x152cfc['as'],'attributes':_0x152cfc['attributes'],'include':_0x152cfc[_0x457d('0x1f')]?_['map'](_0x152cfc[_0x457d('0x1f')],function(_0x21a102){return{'model':db[_0x21a102[_0x457d('0x20')]],'as':_0x21a102['as'],'attributes':_0x21a102[_0x457d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x298dd4){logger['info']('GetCampaign',_0x4d988f);logger[_0x457d('0xf')](_0x457d('0x19'),_0x4d988f,JSON['stringify'](_0x298dd4));_0x802f2b(_0x298dd4);})[_0x457d('0x18')](function(_0x2d69d2){logger['error'](_0x457d('0x19'),_0x2d69d2[_0x457d('0x16')],_0x4d988f);_0x50e78f(_0x151416[_0x457d('0x13')](0x1f4,_0x2d69d2[_0x457d('0x16')]));});});};
\ No newline at end of file
index b4bee8d..f0cda2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6325=['addLists','addBlackLists','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6325,0xe8));var _0x5632=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6325[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x5632('0x0'));var util=require(_0x5632('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5632('0x2'));var router=express[_0x5632('0x3')]();var fs_extra=require(_0x5632('0x4'));var auth=require(_0x5632('0x5'));var interaction=require(_0x5632('0x6'));var config=require(_0x5632('0x7'));var controller=require('./campaign.controller');router[_0x5632('0x8')]('/',auth[_0x5632('0x9')](),controller[_0x5632('0xa')]);router[_0x5632('0x8')]('/:id',auth[_0x5632('0x9')](),controller[_0x5632('0xb')]);router[_0x5632('0x8')](_0x5632('0xc'),auth[_0x5632('0x9')](),controller['getHoppers']);router[_0x5632('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x5632('0xd')]);router[_0x5632('0x8')](_0x5632('0xe'),auth[_0x5632('0x9')](),controller[_0x5632('0xf')]);router[_0x5632('0x8')](_0x5632('0x10'),auth['isAuthenticated'](),controller[_0x5632('0x11')]);router[_0x5632('0x8')](_0x5632('0x12'),auth[_0x5632('0x9')](),controller[_0x5632('0x13')]);router[_0x5632('0x8')](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x15')]);router[_0x5632('0x16')]('/',auth[_0x5632('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x5632('0x9')](),controller[_0x5632('0x17')]);router[_0x5632('0x16')](_0x5632('0x12'),auth[_0x5632('0x9')](),controller[_0x5632('0x18')]);router[_0x5632('0x16')](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x19')]);router['put'](_0x5632('0x1a'),auth[_0x5632('0x9')](),controller[_0x5632('0x1b')]);router[_0x5632('0x1c')](_0x5632('0x1a'),auth[_0x5632('0x9')](),controller['destroy']);router[_0x5632('0x1c')](_0x5632('0x12'),auth[_0x5632('0x9')](),controller[_0x5632('0x1d')]);router[_0x5632('0x1c')](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x1e')]);module[_0x5632('0x1f')]=router;
\ No newline at end of file
+var _0xda62=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x29581c,_0x3cf545){var _0x25884b=function(_0x38da2b){while(--_0x38da2b){_0x29581c['push'](_0x29581c['shift']());}};_0x25884b(++_0x3cf545);}(_0xda62,0x1ba));var _0x2da6=function(_0xaff9d6,_0x4e3df1){_0xaff9d6=_0xaff9d6-0x0;var _0xdeacd5=_0xda62[_0xaff9d6];return _0xdeacd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2da6('0x0'));var timeout=require('connect-timeout');var express=require(_0x2da6('0x1'));var router=express[_0x2da6('0x2')]();var fs_extra=require(_0x2da6('0x3'));var auth=require(_0x2da6('0x4'));var interaction=require(_0x2da6('0x5'));var config=require(_0x2da6('0x6'));var controller=require(_0x2da6('0x7'));router[_0x2da6('0x8')]('/',auth[_0x2da6('0x9')](),controller[_0x2da6('0xa')]);router[_0x2da6('0x8')](_0x2da6('0xb'),auth[_0x2da6('0x9')](),controller['show']);router[_0x2da6('0x8')](_0x2da6('0xc'),auth[_0x2da6('0x9')](),controller[_0x2da6('0xd')]);router[_0x2da6('0x8')](_0x2da6('0xe'),auth[_0x2da6('0x9')](),controller['getHopperHistories']);router[_0x2da6('0x8')](_0x2da6('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x2da6('0x8')](_0x2da6('0x10'),auth['isAuthenticated'](),controller[_0x2da6('0x11')]);router[_0x2da6('0x8')](_0x2da6('0x12'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x13')]);router[_0x2da6('0x8')](_0x2da6('0x14'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x15')]);router[_0x2da6('0x16')]('/',auth[_0x2da6('0x9')](),controller[_0x2da6('0x17')]);router[_0x2da6('0x16')](_0x2da6('0x18'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x19')]);router[_0x2da6('0x16')]('/:id/lists',auth[_0x2da6('0x9')](),controller[_0x2da6('0x1a')]);router['post'](_0x2da6('0x14'),auth['isAuthenticated'](),controller[_0x2da6('0x1b')]);router[_0x2da6('0x1c')](_0x2da6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2da6('0x1d')](_0x2da6('0xb'),auth['isAuthenticated'](),controller[_0x2da6('0x1e')]);router[_0x2da6('0x1d')](_0x2da6('0x12'),auth[_0x2da6('0x9')](),controller[_0x2da6('0x1f')]);router[_0x2da6('0x1d')](_0x2da6('0x14'),auth['isAuthenticated'](),controller[_0x2da6('0x20')]);module[_0x2da6('0x21')]=router;
\ No newline at end of file
index d7b9e3a..56d2943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10e1=['VIRTUAL','sequelize','exports','STRING','TEXT'];(function(_0x21f871,_0x2196ac){var _0x3d2c52=function(_0x4f7f43){while(--_0x4f7f43){_0x21f871['push'](_0x21f871['shift']());}};_0x3d2c52(++_0x2196ac);}(_0x10e1,0x10a));var _0x110e=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x10e1[_0x25d386];return _0x857f4a;};'use strict';var Sequelize=require(_0x110e('0x0'));module[_0x110e('0x1')]={'key':{'type':Sequelize[_0x110e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x110e('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x110e('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0xb392=['exports','TEXT','VIRTUAL','getDataValue'];(function(_0x3c6c36,_0x27fad9){var _0x2670ae=function(_0x545097){while(--_0x545097){_0x3c6c36['push'](_0x3c6c36['shift']());}};_0x2670ae(++_0x27fad9);}(_0xb392,0xc4));var _0x2b39=function(_0xf82a6e,_0x344ee1){_0xf82a6e=_0xf82a6e-0x0;var _0x44f2e3=_0xb392[_0xf82a6e];return _0x44f2e3;};'use strict';var Sequelize=require('sequelize');module[_0x2b39('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2b39('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2b39('0x2')],'get':function(){return this[_0x2b39('0x3')]('key');}}};
\ No newline at end of file
index d51dfb0..1876450 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60a6=['body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','set','reject','save','then','get','CannedAnswers','UserProfileResource','destroy','name','index','CannedAnswer','rawAttributes','key','model','map','query','keys','filters','attributes','fields','length','nolimit','offset','order','pick','merge','where','filter','count','include','rows','catch','params','intersection','includeAll','options','update','find'];(function(_0x39f417,_0x976d47){var _0x5050e5=function(_0x6049f){while(--_0x6049f){_0x39f417['push'](_0x39f417['shift']());}};_0x5050e5(++_0x976d47);}(_0x60a6,0xb4));var _0x660a=function(_0x236333,_0x147794){_0x236333=_0x236333-0x0;var _0x411c10=_0x60a6[_0x236333];return _0x411c10;};'use strict';var emlformat=require(_0x660a('0x0'));var rimraf=require(_0x660a('0x1'));var zipdir=require(_0x660a('0x2'));var jsonpatch=require(_0x660a('0x3'));var rp=require(_0x660a('0x4'));var moment=require(_0x660a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x660a('0x6'));var util=require(_0x660a('0x7'));var path=require(_0x660a('0x8'));var sox=require('sox');var csv=require(_0x660a('0x9'));var ejs=require(_0x660a('0xa'));var fs=require('fs');var fs_extra=require(_0x660a('0xb'));var _=require('lodash');var squel=require(_0x660a('0xc'));var crypto=require(_0x660a('0xd'));var jsforce=require(_0x660a('0xe'));var deskjs=require(_0x660a('0xf'));var toCsv=require(_0x660a('0x9'));var querystring=require(_0x660a('0x10'));var Papa=require(_0x660a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x660a('0x12'));var as=require(_0x660a('0x13'));var hardwareService=require(_0x660a('0x14'));var logger=require('../../config/logger')(_0x660a('0x15'));var utils=require(_0x660a('0x16'));var config=require(_0x660a('0x17'));var licenseUtil=require(_0x660a('0x18'));var db=require(_0x660a('0x19'))['db'];function respondWithStatusCode(_0x24539f,_0x20626b){_0x20626b=_0x20626b||0xcc;return function(_0x2fcf5f){if(_0x2fcf5f){return _0x24539f[_0x660a('0x1a')](_0x20626b);}return _0x24539f[_0x660a('0x1b')](_0x20626b)[_0x660a('0x1c')]();};}function respondWithResult(_0x18ea9e,_0x2ef417){_0x2ef417=_0x2ef417||0xc8;return function(_0xc3ef59){if(_0xc3ef59){return _0x18ea9e[_0x660a('0x1b')](_0x2ef417)[_0x660a('0x1d')](_0xc3ef59);}};}function respondWithFilteredResult(_0x2b9042,_0x2bbf92){return function(_0x5745c9){if(_0x5745c9){var _0x1a1097=typeof _0x2bbf92['offset']==='undefined'&&typeof _0x2bbf92['limit']==='undefined';var _0x17c573=_0x5745c9['count'];var _0x2fac81=_0x1a1097?0x0:_0x2bbf92['offset'];var _0x3fd489=_0x1a1097?_0x5745c9['count']:_0x2bbf92['offset']+_0x2bbf92[_0x660a('0x1e')];var _0x28eed9;if(_0x3fd489>=_0x17c573){_0x3fd489=_0x17c573;_0x28eed9=0xc8;}else{_0x28eed9=0xce;}_0x2b9042[_0x660a('0x1b')](_0x28eed9);return _0x2b9042[_0x660a('0x1f')]('Content-Range',_0x2fac81+'-'+_0x3fd489+'/'+_0x17c573)['json'](_0x5745c9);}return null;};}function patchUpdates(_0x2510c6){return function(_0x391fe4){try{jsonpatch['apply'](_0x391fe4,_0x2510c6,!![]);}catch(_0x5d5248){return BPromise[_0x660a('0x20')](_0x5d5248);}return _0x391fe4[_0x660a('0x21')]();};}function saveUpdates(_0x2e0d73,_0xb5c09e){return function(_0x12205a){if(_0x12205a){return _0x12205a['update'](_0x2e0d73)[_0x660a('0x22')](function(_0x4525ee){return _0x4525ee;});}return null;};}function removeEntity(_0x30dc5b,_0x5b8307){return function(_0x106996){if(_0x106996){return _0x106996['destroy']()['then'](function(){var _0x206b4b=_0x106996[_0x660a('0x23')]({'plain':!![]});var _0x28df6b=_0x660a('0x24');return db[_0x660a('0x25')][_0x660a('0x26')]({'where':{'type':_0x28df6b,'resourceId':_0x206b4b['id']}})[_0x660a('0x22')](function(){return _0x106996;});})[_0x660a('0x22')](function(){_0x30dc5b[_0x660a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a46e3,_0x2fc87f){return function(_0x582777){if(!_0x582777){_0x3a46e3[_0x660a('0x1a')](0x194);}return _0x582777;};}function handleError(_0x1d0438,_0x175acc){_0x175acc=_0x175acc||0x1f4;return function(_0x415ff2){logger['error'](_0x415ff2['stack']);if(_0x415ff2[_0x660a('0x27')]){delete _0x415ff2['name'];}_0x1d0438[_0x660a('0x1b')](_0x175acc)['send'](_0x415ff2);};}exports[_0x660a('0x28')]=function(_0x2626bc,_0x3dc95d){var _0x3a6696={},_0x3c5508={},_0x5a6798={'count':0x0,'rows':[]};var _0xee922f=_['map'](db[_0x660a('0x29')][_0x660a('0x2a')],function(_0x3877f1){return{'name':_0x3877f1['fieldName'],'type':_0x3877f1['type'][_0x660a('0x2b')]};});_0x3c5508[_0x660a('0x2c')]=_[_0x660a('0x2d')](_0xee922f,'name');_0x3c5508[_0x660a('0x2e')]=_[_0x660a('0x2f')](_0x2626bc[_0x660a('0x2e')]);_0x3c5508[_0x660a('0x30')]=_['intersection'](_0x3c5508[_0x660a('0x2c')],_0x3c5508[_0x660a('0x2e')]);_0x3a6696[_0x660a('0x31')]=_['intersection'](_0x3c5508[_0x660a('0x2c')],qs['fields'](_0x2626bc[_0x660a('0x2e')][_0x660a('0x32')]));_0x3a6696['attributes']=_0x3a6696[_0x660a('0x31')][_0x660a('0x33')]?_0x3a6696[_0x660a('0x31')]:_0x3c5508[_0x660a('0x2c')];if(!_0x2626bc[_0x660a('0x2e')]['hasOwnProperty'](_0x660a('0x34'))){_0x3a6696[_0x660a('0x1e')]=qs[_0x660a('0x1e')](_0x2626bc[_0x660a('0x2e')][_0x660a('0x1e')]);_0x3a6696[_0x660a('0x35')]=qs[_0x660a('0x35')](_0x2626bc[_0x660a('0x2e')][_0x660a('0x35')]);}_0x3a6696[_0x660a('0x36')]=qs['sort'](_0x2626bc['query']['sort']);_0x3a6696['where']=qs[_0x660a('0x30')](_[_0x660a('0x37')](_0x2626bc[_0x660a('0x2e')],_0x3c5508[_0x660a('0x30')]),_0xee922f);if(_0x2626bc[_0x660a('0x2e')]['filter']){_0x3a6696['where']=_[_0x660a('0x38')](_0x3a6696[_0x660a('0x39')],{'$or':[{'key':{'$like':'%'+_0x2626bc[_0x660a('0x2e')]['filter']+'%'}},{'value':{'$like':'%'+_0x2626bc[_0x660a('0x2e')][_0x660a('0x3a')]+'%'}}]});}_0x3a6696=_['merge']({},_0x3a6696,_0x2626bc['options']);var _0x4b7370={'where':_0x3a6696['where']};return db['CannedAnswer']['count'](_0x4b7370)[_0x660a('0x22')](function(_0x5baa16){_0x5a6798[_0x660a('0x3b')]=_0x5baa16;if(_0x2626bc[_0x660a('0x2e')]['includeAll']){_0x3a6696[_0x660a('0x3c')]=[{'all':!![]}];}return db[_0x660a('0x29')]['findAll'](_0x3a6696);})[_0x660a('0x22')](function(_0x423f5a){_0x5a6798[_0x660a('0x3d')]=_0x423f5a;return _0x5a6798;})[_0x660a('0x22')](respondWithFilteredResult(_0x3dc95d,_0x3a6696))[_0x660a('0x3e')](handleError(_0x3dc95d,null));};exports['show']=function(_0x5e5135,_0x5692d1){var _0x2e2ab4={'raw':!![],'where':{'id':_0x5e5135[_0x660a('0x3f')]['id']}},_0x34dad3={};_0x34dad3['model']=_[_0x660a('0x2f')](db[_0x660a('0x29')]['rawAttributes']);_0x34dad3['query']=_[_0x660a('0x2f')](_0x5e5135[_0x660a('0x2e')]);_0x34dad3['filters']=_['intersection'](_0x34dad3[_0x660a('0x2c')],_0x34dad3[_0x660a('0x2e')]);_0x2e2ab4['attributes']=_[_0x660a('0x40')](_0x34dad3[_0x660a('0x2c')],qs['fields'](_0x5e5135['query'][_0x660a('0x32')]));_0x2e2ab4[_0x660a('0x31')]=_0x2e2ab4[_0x660a('0x31')][_0x660a('0x33')]?_0x2e2ab4[_0x660a('0x31')]:_0x34dad3['model'];if(_0x5e5135[_0x660a('0x2e')][_0x660a('0x41')]){_0x2e2ab4[_0x660a('0x3c')]=[{'all':!![]}];}_0x2e2ab4=_[_0x660a('0x38')]({},_0x2e2ab4,_0x5e5135[_0x660a('0x42')]);return db[_0x660a('0x29')]['find'](_0x2e2ab4)['then'](handleEntityNotFound(_0x5692d1,null))[_0x660a('0x22')](respondWithResult(_0x5692d1,null))[_0x660a('0x3e')](handleError(_0x5692d1,null));};exports[_0x660a('0x43')]=function(_0xdc767b,_0x423e8a){if(_0xdc767b['body']['id']){delete _0xdc767b['body']['id'];}return db[_0x660a('0x29')][_0x660a('0x44')]({'where':{'id':_0xdc767b[_0x660a('0x3f')]['id']}})[_0x660a('0x22')](handleEntityNotFound(_0x423e8a,null))[_0x660a('0x22')](saveUpdates(_0xdc767b[_0x660a('0x45')],null))['then'](respondWithResult(_0x423e8a,null))['catch'](handleError(_0x423e8a,null));};exports[_0x660a('0x26')]=function(_0x2027e7,_0x291c4b){return db[_0x660a('0x29')][_0x660a('0x44')]({'where':{'id':_0x2027e7[_0x660a('0x3f')]['id']}})[_0x660a('0x22')](handleEntityNotFound(_0x291c4b,null))[_0x660a('0x22')](removeEntity(_0x291c4b,null))[_0x660a('0x3e')](handleError(_0x291c4b,null));};exports['create']=function(_0x83f213,_0x39a702){var _0x164632={'key':_0x83f213['body'][_0x660a('0x2b')]};if(_0x83f213[_0x660a('0x45')][_0x660a('0x46')]){_0x164632[_0x660a('0x46')]=_0x83f213[_0x660a('0x45')][_0x660a('0x46')];}else if(_0x83f213[_0x660a('0x45')][_0x660a('0x47')]){_0x164632[_0x660a('0x47')]=_0x83f213[_0x660a('0x45')][_0x660a('0x47')];}else if(_0x83f213['body'][_0x660a('0x48')]){_0x164632[_0x660a('0x48')]=_0x83f213['body'][_0x660a('0x48')];}else if(_0x83f213[_0x660a('0x45')]['ChatWebsiteId']){_0x164632[_0x660a('0x49')]=_0x83f213[_0x660a('0x45')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x164632})[_0x660a('0x22')](function(_0x4784b7){if(_0x4784b7){throw new db[(_0x660a('0x4a'))][(_0x660a('0x4b'))](_0x660a('0x4c'));}return db[_0x660a('0x29')][_0x660a('0x4d')](_0x83f213[_0x660a('0x45')]);})[_0x660a('0x22')](function(_0x5a71ce){var _0x35754a=_0x83f213[_0x660a('0x4e')][_0x660a('0x23')]({'plain':!![]});if(!_0x35754a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35754a['role']===_0x660a('0x4e')){var _0x33811e=_0x5a71ce['get']({'plain':!![]});return db[_0x660a('0x4f')][_0x660a('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x35754a[_0x660a('0x50')]},'raw':!![]})['then'](function(_0x4267ba){if(_0x4267ba&&_0x4267ba[_0x660a('0x51')]===0x0){return db[_0x660a('0x25')][_0x660a('0x4d')]({'name':_0x33811e[_0x660a('0x27')],'resourceId':_0x33811e['id'],'type':_0x4267ba[_0x660a('0x27')],'sectionId':_0x4267ba['id']},{})[_0x660a('0x22')](function(){return _0x5a71ce;});}else{return _0x5a71ce;}})['catch'](function(_0x5c64ff){logger[_0x660a('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c64ff);throw _0x5c64ff;});}return _0x5a71ce;})['then'](respondWithResult(_0x39a702,0xc9))[_0x660a('0x3e')](handleError(_0x39a702,null));};
\ No newline at end of file
+var _0x05f0=['attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','rows','catch','params','keys','fields','includeAll','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','CannedAnswers','destroy','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','filters','intersection','query'];(function(_0x19c7a8,_0x10508d){var _0x1462ce=function(_0x33f2c8){while(--_0x33f2c8){_0x19c7a8['push'](_0x19c7a8['shift']());}};_0x1462ce(++_0x10508d);}(_0x05f0,0x12d));var _0x005f=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x05f0[_0x44dba1];return _0x2fbd3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x005f('0x0'));var zipdir=require(_0x005f('0x1'));var jsonpatch=require(_0x005f('0x2'));var rp=require(_0x005f('0x3'));var moment=require(_0x005f('0x4'));var BPromise=require(_0x005f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x005f('0x6'));var sox=require(_0x005f('0x7'));var csv=require(_0x005f('0x8'));var ejs=require(_0x005f('0x9'));var fs=require('fs');var fs_extra=require(_0x005f('0xa'));var _=require(_0x005f('0xb'));var squel=require('squel');var crypto=require(_0x005f('0xc'));var jsforce=require(_0x005f('0xd'));var deskjs=require(_0x005f('0xe'));var toCsv=require(_0x005f('0x8'));var querystring=require(_0x005f('0xf'));var Papa=require('papaparse');var Redis=require(_0x005f('0x10'));var authService=require(_0x005f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x005f('0x12'));var hardwareService=require(_0x005f('0x13'));var logger=require(_0x005f('0x14'))(_0x005f('0x15'));var utils=require(_0x005f('0x16'));var config=require(_0x005f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x005f('0x18'))['db'];function respondWithStatusCode(_0x309b3b,_0x2b96da){_0x2b96da=_0x2b96da||0xcc;return function(_0x219f57){if(_0x219f57){return _0x309b3b[_0x005f('0x19')](_0x2b96da);}return _0x309b3b['status'](_0x2b96da)[_0x005f('0x1a')]();};}function respondWithResult(_0x17a0e8,_0x4beebc){_0x4beebc=_0x4beebc||0xc8;return function(_0x32fd16){if(_0x32fd16){return _0x17a0e8[_0x005f('0x1b')](_0x4beebc)[_0x005f('0x1c')](_0x32fd16);}};}function respondWithFilteredResult(_0x2875d9,_0x2fe32c){return function(_0x37d808){if(_0x37d808){var _0x119d0e=typeof _0x2fe32c[_0x005f('0x1d')]===_0x005f('0x1e')&&typeof _0x2fe32c[_0x005f('0x1f')]===_0x005f('0x1e');var _0x2e931b=_0x37d808['count'];var _0x41709e=_0x119d0e?0x0:_0x2fe32c[_0x005f('0x1d')];var _0x211bc8=_0x119d0e?_0x37d808[_0x005f('0x20')]:_0x2fe32c[_0x005f('0x1d')]+_0x2fe32c[_0x005f('0x1f')];var _0x12fa93;if(_0x211bc8>=_0x2e931b){_0x211bc8=_0x2e931b;_0x12fa93=0xc8;}else{_0x12fa93=0xce;}_0x2875d9[_0x005f('0x1b')](_0x12fa93);return _0x2875d9[_0x005f('0x21')]('Content-Range',_0x41709e+'-'+_0x211bc8+'/'+_0x2e931b)[_0x005f('0x1c')](_0x37d808);}return null;};}function patchUpdates(_0x31cc99){return function(_0x3df156){try{jsonpatch[_0x005f('0x22')](_0x3df156,_0x31cc99,!![]);}catch(_0x3a3158){return BPromise[_0x005f('0x23')](_0x3a3158);}return _0x3df156[_0x005f('0x24')]();};}function saveUpdates(_0x673b51,_0x3ea6e2){return function(_0x46b105){if(_0x46b105){return _0x46b105[_0x005f('0x25')](_0x673b51)[_0x005f('0x26')](function(_0xcb52e){return _0xcb52e;});}return null;};}function removeEntity(_0x4835c1,_0x14ea58){return function(_0x19cccc){if(_0x19cccc){return _0x19cccc['destroy']()[_0x005f('0x26')](function(){var _0x88d408=_0x19cccc[_0x005f('0x27')]({'plain':!![]});var _0x334321=_0x005f('0x28');return db['UserProfileResource'][_0x005f('0x29')]({'where':{'type':_0x334321,'resourceId':_0x88d408['id']}})['then'](function(){return _0x19cccc;});})[_0x005f('0x26')](function(){_0x4835c1[_0x005f('0x1b')](0xcc)[_0x005f('0x1a')]();});}};}function handleEntityNotFound(_0x25bd2a,_0x3001b6){return function(_0x49156a){if(!_0x49156a){_0x25bd2a[_0x005f('0x19')](0x194);}return _0x49156a;};}function handleError(_0x27dc8b,_0x1c5082){_0x1c5082=_0x1c5082||0x1f4;return function(_0x1b3386){logger['error'](_0x1b3386['stack']);if(_0x1b3386[_0x005f('0x2a')]){delete _0x1b3386[_0x005f('0x2a')];}_0x27dc8b['status'](_0x1c5082)[_0x005f('0x2b')](_0x1b3386);};}exports[_0x005f('0x2c')]=function(_0x4fd3a7,_0x433a75){var _0x1334b4={},_0x3e09e5={},_0x59aab9={'count':0x0,'rows':[]};var _0x27f869=_[_0x005f('0x2d')](db[_0x005f('0x2e')][_0x005f('0x2f')],function(_0x3bfd57){return{'name':_0x3bfd57[_0x005f('0x30')],'type':_0x3bfd57[_0x005f('0x31')][_0x005f('0x32')]};});_0x3e09e5[_0x005f('0x33')]=_[_0x005f('0x2d')](_0x27f869,_0x005f('0x2a'));_0x3e09e5['query']=_['keys'](_0x4fd3a7['query']);_0x3e09e5[_0x005f('0x34')]=_[_0x005f('0x35')](_0x3e09e5['model'],_0x3e09e5[_0x005f('0x36')]);_0x1334b4['attributes']=_['intersection'](_0x3e09e5[_0x005f('0x33')],qs['fields'](_0x4fd3a7[_0x005f('0x36')]['fields']));_0x1334b4['attributes']=_0x1334b4[_0x005f('0x37')][_0x005f('0x38')]?_0x1334b4[_0x005f('0x37')]:_0x3e09e5[_0x005f('0x33')];if(!_0x4fd3a7['query'][_0x005f('0x39')]('nolimit')){_0x1334b4[_0x005f('0x1f')]=qs[_0x005f('0x1f')](_0x4fd3a7[_0x005f('0x36')][_0x005f('0x1f')]);_0x1334b4[_0x005f('0x1d')]=qs[_0x005f('0x1d')](_0x4fd3a7[_0x005f('0x36')][_0x005f('0x1d')]);}_0x1334b4['order']=qs[_0x005f('0x3a')](_0x4fd3a7['query']['sort']);_0x1334b4[_0x005f('0x3b')]=qs['filters'](_[_0x005f('0x3c')](_0x4fd3a7['query'],_0x3e09e5[_0x005f('0x34')]),_0x27f869);if(_0x4fd3a7['query'][_0x005f('0x3d')]){_0x1334b4[_0x005f('0x3b')]=_[_0x005f('0x3e')](_0x1334b4['where'],{'$or':[{'key':{'$like':'%'+_0x4fd3a7['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4fd3a7[_0x005f('0x36')][_0x005f('0x3d')]+'%'}}]});}_0x1334b4=_['merge']({},_0x1334b4,_0x4fd3a7[_0x005f('0x3f')]);var _0x2b228b={'where':_0x1334b4['where']};return db[_0x005f('0x2e')]['count'](_0x2b228b)[_0x005f('0x26')](function(_0x5b149b){_0x59aab9['count']=_0x5b149b;if(_0x4fd3a7[_0x005f('0x36')]['includeAll']){_0x1334b4[_0x005f('0x40')]=[{'all':!![]}];}return db[_0x005f('0x2e')]['findAll'](_0x1334b4);})[_0x005f('0x26')](function(_0x56db30){_0x59aab9[_0x005f('0x41')]=_0x56db30;return _0x59aab9;})[_0x005f('0x26')](respondWithFilteredResult(_0x433a75,_0x1334b4))[_0x005f('0x42')](handleError(_0x433a75,null));};exports['show']=function(_0x295130,_0x182b18){var _0x5dfad7={'raw':!![],'where':{'id':_0x295130[_0x005f('0x43')]['id']}},_0x5a1964={};_0x5a1964['model']=_['keys'](db[_0x005f('0x2e')][_0x005f('0x2f')]);_0x5a1964[_0x005f('0x36')]=_[_0x005f('0x44')](_0x295130[_0x005f('0x36')]);_0x5a1964['filters']=_[_0x005f('0x35')](_0x5a1964[_0x005f('0x33')],_0x5a1964['query']);_0x5dfad7['attributes']=_[_0x005f('0x35')](_0x5a1964[_0x005f('0x33')],qs['fields'](_0x295130[_0x005f('0x36')][_0x005f('0x45')]));_0x5dfad7[_0x005f('0x37')]=_0x5dfad7[_0x005f('0x37')]['length']?_0x5dfad7['attributes']:_0x5a1964['model'];if(_0x295130[_0x005f('0x36')][_0x005f('0x46')]){_0x5dfad7[_0x005f('0x40')]=[{'all':!![]}];}_0x5dfad7=_[_0x005f('0x3e')]({},_0x5dfad7,_0x295130['options']);return db[_0x005f('0x2e')]['find'](_0x5dfad7)['then'](handleEntityNotFound(_0x182b18,null))[_0x005f('0x26')](respondWithResult(_0x182b18,null))[_0x005f('0x42')](handleError(_0x182b18,null));};exports[_0x005f('0x25')]=function(_0x5ae144,_0x345db1){if(_0x5ae144['body']['id']){delete _0x5ae144[_0x005f('0x47')]['id'];}return db[_0x005f('0x2e')][_0x005f('0x48')]({'where':{'id':_0x5ae144[_0x005f('0x43')]['id']}})[_0x005f('0x26')](handleEntityNotFound(_0x345db1,null))[_0x005f('0x26')](saveUpdates(_0x5ae144[_0x005f('0x47')],null))[_0x005f('0x26')](respondWithResult(_0x345db1,null))['catch'](handleError(_0x345db1,null));};exports[_0x005f('0x29')]=function(_0xa51057,_0x2ca944){return db[_0x005f('0x2e')][_0x005f('0x48')]({'where':{'id':_0xa51057[_0x005f('0x43')]['id']}})[_0x005f('0x26')](handleEntityNotFound(_0x2ca944,null))[_0x005f('0x26')](removeEntity(_0x2ca944,null))[_0x005f('0x42')](handleError(_0x2ca944,null));};exports[_0x005f('0x49')]=function(_0x30ccbf,_0x163240){var _0x299430={'key':_0x30ccbf[_0x005f('0x47')]['key']};if(_0x30ccbf[_0x005f('0x47')][_0x005f('0x4a')]){_0x299430[_0x005f('0x4a')]=_0x30ccbf[_0x005f('0x47')][_0x005f('0x4a')];}else if(_0x30ccbf[_0x005f('0x47')][_0x005f('0x4b')]){_0x299430[_0x005f('0x4b')]=_0x30ccbf[_0x005f('0x47')][_0x005f('0x4b')];}else if(_0x30ccbf[_0x005f('0x47')]['OpenchannelAccountId']){_0x299430[_0x005f('0x4c')]=_0x30ccbf['body']['OpenchannelAccountId'];}else if(_0x30ccbf[_0x005f('0x47')][_0x005f('0x4d')]){_0x299430[_0x005f('0x4d')]=_0x30ccbf[_0x005f('0x47')][_0x005f('0x4d')];}return db[_0x005f('0x2e')][_0x005f('0x48')]({'where':_0x299430})[_0x005f('0x26')](function(_0x4e0dc2){if(_0x4e0dc2){throw new db[(_0x005f('0x4e'))][(_0x005f('0x4f'))](_0x005f('0x50'));}return db[_0x005f('0x2e')][_0x005f('0x49')](_0x30ccbf[_0x005f('0x47')]);})[_0x005f('0x26')](function(_0x531f3e){var _0x3a4fcd=_0x30ccbf[_0x005f('0x51')][_0x005f('0x27')]({'plain':!![]});if(!_0x3a4fcd)throw new Error(_0x005f('0x52'));if(_0x3a4fcd[_0x005f('0x53')]===_0x005f('0x51')){var _0x4f40d6=_0x531f3e[_0x005f('0x27')]({'plain':!![]});return db[_0x005f('0x54')]['find']({'where':{'name':_0x005f('0x28'),'userProfileId':_0x3a4fcd[_0x005f('0x55')]},'raw':!![]})[_0x005f('0x26')](function(_0x19d031){if(_0x19d031&&_0x19d031[_0x005f('0x56')]===0x0){return db[_0x005f('0x57')]['create']({'name':_0x4f40d6[_0x005f('0x2a')],'resourceId':_0x4f40d6['id'],'type':_0x19d031[_0x005f('0x2a')],'sectionId':_0x19d031['id']},{})[_0x005f('0x26')](function(){return _0x531f3e;});}else{return _0x531f3e;}})['catch'](function(_0x2ea0b0){logger['error'](_0x005f('0x58'),_0x2ea0b0);throw _0x2ea0b0;});}return _0x531f3e;})['then'](respondWithResult(_0x163240,0xc9))[_0x005f('0x42')](handleError(_0x163240,null));};
\ No newline at end of file
index b1c7e3e..5ed2be1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e13=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1508d0,_0x2ddb0c){var _0x382ec2=function(_0xb7c62f){while(--_0xb7c62f){_0x1508d0['push'](_0x1508d0['shift']());}};_0x382ec2(++_0x2ddb0c);}(_0x5e13,0x64));var _0x35e1=function(_0x47afba,_0x290a9d){_0x47afba=_0x47afba-0x0;var _0x55d7b4=_0x5e13[_0x47afba];return _0x55d7b4;};'use strict';var _=require(_0x35e1('0x0'));var util=require(_0x35e1('0x1'));var logger=require(_0x35e1('0x2'))(_0x35e1('0x3'));var moment=require(_0x35e1('0x4'));var BPromise=require(_0x35e1('0x5'));var rp=require(_0x35e1('0x6'));var fs=require('fs');var path=require(_0x35e1('0x7'));var rimraf=require(_0x35e1('0x8'));var config=require(_0x35e1('0x9'));var attributes=require(_0x35e1('0xa'));module['exports']=function(_0x5d2d23,_0x522025){return _0x5d2d23[_0x35e1('0xb')]('CannedAnswer',attributes,{'tableName':_0x35e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x35e1('0xd'),'collate':_0x35e1('0xe')});};
\ No newline at end of file
+var _0xa769=['../../config/logger','api','moment','request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x396e90,_0x4c7718){var _0xaf7e4c=function(_0x2a96bc){while(--_0x2a96bc){_0x396e90['push'](_0x396e90['shift']());}};_0xaf7e4c(++_0x4c7718);}(_0xa769,0xfb));var _0x9a76=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa769[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x9a76('0x0'));var util=require('util');var logger=require(_0x9a76('0x1'))(_0x9a76('0x2'));var moment=require(_0x9a76('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a76('0x5'));var attributes=require(_0x9a76('0x6'));module['exports']=function(_0x24761d,_0x29af51){return _0x24761d[_0x9a76('0x7')](_0x9a76('0x8'),attributes,{'tableName':_0x9a76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a76('0xa'),'collate':_0x9a76('0xb')});};
\ No newline at end of file
index 0e2bbbf..231fc01 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(_0x22d44f,_0x1031a7){var _0x4da677=function(_0x3c50c8){while(--_0x3c50c8){_0x22d44f['push'](_0x22d44f['shift']());}};_0x4da677(++_0x1031a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});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(_0x51d11d,_0x16415b){var _0x27472b=function(_0xd6c976){while(--_0xd6c976){_0x51d11d['push'](_0x51d11d['shift']());}};_0x27472b(++_0x16415b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index c0446c6..435ba6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7140=['./cannedAnswer.controller','get','isAuthenticated','index','show','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7140,0x65));var _0x0714=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0x7140[_0xcfeff4];return _0xb2fadc;};'use strict';var multer=require(_0x0714('0x0'));var util=require(_0x0714('0x1'));var path=require('path');var timeout=require(_0x0714('0x2'));var express=require(_0x0714('0x3'));var router=express['Router']();var fs_extra=require(_0x0714('0x4'));var auth=require(_0x0714('0x5'));var interaction=require(_0x0714('0x6'));var config=require('../../config/environment');var controller=require(_0x0714('0x7'));router[_0x0714('0x8')]('/',auth[_0x0714('0x9')](),controller[_0x0714('0xa')]);router['get']('/:id',auth[_0x0714('0x9')](),controller[_0x0714('0xb')]);router['post']('/',auth[_0x0714('0x9')](),controller['create']);router[_0x0714('0xc')]('/:id',auth[_0x0714('0x9')](),controller[_0x0714('0xd')]);router[_0x0714('0xe')](_0x0714('0xf'),auth['isAuthenticated'](),controller[_0x0714('0x10')]);module[_0x0714('0x11')]=router;
\ No newline at end of file
+var _0x3c45=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','exports','multer'];(function(_0x87be39,_0x15f972){var _0x506e93=function(_0x579ce4){while(--_0x579ce4){_0x87be39['push'](_0x87be39['shift']());}};_0x506e93(++_0x15f972);}(_0x3c45,0x11c));var _0x53c4=function(_0x37fdd2,_0x44e51e){_0x37fdd2=_0x37fdd2-0x0;var _0x5c6b7c=_0x3c45[_0x37fdd2];return _0x5c6b7c;};'use strict';var multer=require(_0x53c4('0x0'));var util=require(_0x53c4('0x1'));var path=require('path');var timeout=require(_0x53c4('0x2'));var express=require(_0x53c4('0x3'));var router=express[_0x53c4('0x4')]();var fs_extra=require(_0x53c4('0x5'));var auth=require(_0x53c4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x53c4('0x7'));var controller=require(_0x53c4('0x8'));router['get']('/',auth[_0x53c4('0x9')](),controller[_0x53c4('0xa')]);router[_0x53c4('0xb')](_0x53c4('0xc'),auth[_0x53c4('0x9')](),controller['show']);router[_0x53c4('0xd')]('/',auth[_0x53c4('0x9')](),controller['create']);router[_0x53c4('0xe')](_0x53c4('0xc'),auth['isAuthenticated'](),controller[_0x53c4('0xf')]);router[_0x53c4('0x10')](_0x53c4('0xc'),auth[_0x53c4('0x9')](),controller[_0x53c4('0x11')]);module[_0x53c4('0x12')]=router;
\ No newline at end of file
index daad4c2..16711f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9756=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x9756,0x108));var _0x6975=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9756[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6975('0x0'));module[_0x6975('0x1')]={'calldate':{'type':Sequelize[_0x6975('0x2')],'allowNull':![],'defaultValue':_0x6975('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6975('0x4')]},'dst':{'type':Sequelize[_0x6975('0x4')]},'dcontext':{'type':Sequelize[_0x6975('0x4')]},'channel':{'type':Sequelize[_0x6975('0x4')]},'dstchannel':{'type':Sequelize[_0x6975('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6975('0x4')]},'duration':{'type':Sequelize[_0x6975('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6975('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x6975('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6975('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x6975('0x4')]},'peeraccount':{'type':Sequelize[_0x6975('0x4')]},'type':{'type':Sequelize[_0x6975('0x4')]},'tag':{'type':Sequelize[_0x6975('0x4')]}};
\ No newline at end of file
+var _0x3e0f=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x3e0f,0xfc));var _0xf3e0=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x3e0f[_0xcfeda9];return _0x4826c7;};'use strict';var Sequelize=require(_0xf3e0('0x0'));module[_0xf3e0('0x1')]={'calldate':{'type':Sequelize[_0xf3e0('0x2')],'allowNull':![],'defaultValue':_0xf3e0('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xf3e0('0x4')]},'dst':{'type':Sequelize[_0xf3e0('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf3e0('0x4')]},'dstchannel':{'type':Sequelize[_0xf3e0('0x4')]},'lastapp':{'type':Sequelize[_0xf3e0('0x4')]},'lastdata':{'type':Sequelize[_0xf3e0('0x4')]},'duration':{'type':Sequelize[_0xf3e0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf3e0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf3e0('0x4')]},'userfield':{'type':Sequelize[_0xf3e0('0x4')]},'uniqueid':{'type':Sequelize[_0xf3e0('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf3e0('0x4')]},'peeraccount':{'type':Sequelize[_0xf3e0('0x4')]},'type':{'type':Sequelize[_0xf3e0('0x4')]},'tag':{'type':Sequelize[_0xf3e0('0x4')]}};
\ No newline at end of file
index 5dc89b5..1d64f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x85d0,0x164));var _0x085d=function(_0x2e069c,_0x4006ca){_0x2e069c=_0x2e069c-0x0;var _0x459962=_0x85d0[_0x2e069c];return _0x459962;};'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(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));};
\ No newline at end of file
+var _0x29d4=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','fields','attributes','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','intersection','find','create','body','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1d309a,_0x3cb540){var _0x5c7317=function(_0x5c4bf5){while(--_0x5c4bf5){_0x1d309a['push'](_0x1d309a['shift']());}};_0x5c7317(++_0x3cb540);}(_0x29d4,0x1a1));var _0x429d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x29d4[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require(_0x429d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x429d('0x1'));var jsonpatch=require(_0x429d('0x2'));var rp=require(_0x429d('0x3'));var moment=require(_0x429d('0x4'));var BPromise=require(_0x429d('0x5'));var Mustache=require('mustache');var util=require(_0x429d('0x6'));var path=require(_0x429d('0x7'));var sox=require(_0x429d('0x8'));var csv=require(_0x429d('0x9'));var ejs=require(_0x429d('0xa'));var fs=require('fs');var fs_extra=require(_0x429d('0xb'));var _=require(_0x429d('0xc'));var squel=require(_0x429d('0xd'));var crypto=require('crypto');var jsforce=require(_0x429d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x429d('0x9'));var querystring=require(_0x429d('0xf'));var Papa=require(_0x429d('0x10'));var Redis=require('ioredis');var authService=require(_0x429d('0x11'));var qs=require(_0x429d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x429d('0x13'));var logger=require(_0x429d('0x14'))(_0x429d('0x15'));var utils=require('../../config/utils');var config=require(_0x429d('0x16'));var licenseUtil=require(_0x429d('0x17'));var db=require(_0x429d('0x18'))['db'];function respondWithStatusCode(_0x1cb1cf,_0x4843af){_0x4843af=_0x4843af||0xcc;return function(_0x1c542c){if(_0x1c542c){return _0x1cb1cf[_0x429d('0x19')](_0x4843af);}return _0x1cb1cf[_0x429d('0x1a')](_0x4843af)['end']();};}function respondWithResult(_0x315d8d,_0x5dc247){_0x5dc247=_0x5dc247||0xc8;return function(_0x5c32ab){if(_0x5c32ab){return _0x315d8d[_0x429d('0x1a')](_0x5dc247)[_0x429d('0x1b')](_0x5c32ab);}};}function respondWithFilteredResult(_0x1bfbdb,_0x2ee97b){return function(_0x8c8a15){if(_0x8c8a15){var _0x2363a0=typeof _0x2ee97b['offset']===_0x429d('0x1c')&&typeof _0x2ee97b['limit']===_0x429d('0x1c');var _0x35830e=_0x8c8a15[_0x429d('0x1d')];var _0x2dc57a=_0x2363a0?0x0:_0x2ee97b['offset'];var _0x240a7d=_0x2363a0?_0x8c8a15[_0x429d('0x1d')]:_0x2ee97b[_0x429d('0x1e')]+_0x2ee97b['limit'];var _0x329d67;if(_0x240a7d>=_0x35830e){_0x240a7d=_0x35830e;_0x329d67=0xc8;}else{_0x329d67=0xce;}_0x1bfbdb[_0x429d('0x1a')](_0x329d67);return _0x1bfbdb[_0x429d('0x1f')](_0x429d('0x20'),_0x2dc57a+'-'+_0x240a7d+'/'+_0x35830e)[_0x429d('0x1b')](_0x8c8a15);}return null;};}function patchUpdates(_0x4534bd){return function(_0x5a4093){try{jsonpatch[_0x429d('0x21')](_0x5a4093,_0x4534bd,!![]);}catch(_0x165e4d){return BPromise[_0x429d('0x22')](_0x165e4d);}return _0x5a4093['save']();};}function saveUpdates(_0x1492f1,_0x13fc71){return function(_0x452572){if(_0x452572){return _0x452572[_0x429d('0x23')](_0x1492f1)[_0x429d('0x24')](function(_0x1023e6){return _0x1023e6;});}return null;};}function removeEntity(_0x4c6d89,_0x28f84e){return function(_0x3a9a75){if(_0x3a9a75){return _0x3a9a75['destroy']()[_0x429d('0x24')](function(){_0x4c6d89[_0x429d('0x1a')](0xcc)[_0x429d('0x25')]();});}};}function handleEntityNotFound(_0x11c423,_0x5d2e06){return function(_0x3b12f6){if(!_0x3b12f6){_0x11c423[_0x429d('0x19')](0x194);}return _0x3b12f6;};}function handleError(_0x387639,_0x3896ee){_0x3896ee=_0x3896ee||0x1f4;return function(_0x3e4e73){logger['error'](_0x3e4e73[_0x429d('0x26')]);if(_0x3e4e73[_0x429d('0x27')]){delete _0x3e4e73[_0x429d('0x27')];}_0x387639[_0x429d('0x1a')](_0x3896ee)[_0x429d('0x28')](_0x3e4e73);};}exports[_0x429d('0x29')]=function(_0x2351c9,_0xdc7bf9){var _0x2ceb54={},_0x50ef02={},_0x31cae6={'count':0x0,'rows':[]};var _0x3ca640=_['map'](db[_0x429d('0x2a')][_0x429d('0x2b')],function(_0x2e95b5){return{'name':_0x2e95b5[_0x429d('0x2c')],'type':_0x2e95b5[_0x429d('0x2d')]['key']};});_0x50ef02[_0x429d('0x2e')]=_[_0x429d('0x2f')](_0x3ca640,_0x429d('0x27'));_0x50ef02[_0x429d('0x30')]=_[_0x429d('0x31')](_0x2351c9[_0x429d('0x30')]);_0x50ef02['filters']=_['intersection'](_0x50ef02[_0x429d('0x2e')],_0x50ef02[_0x429d('0x30')]);_0x2ceb54['attributes']=_['intersection'](_0x50ef02[_0x429d('0x2e')],qs['fields'](_0x2351c9[_0x429d('0x30')][_0x429d('0x32')]));_0x2ceb54[_0x429d('0x33')]=_0x2ceb54[_0x429d('0x33')]['length']?_0x2ceb54[_0x429d('0x33')]:_0x50ef02[_0x429d('0x2e')];if(!_0x2351c9['query']['hasOwnProperty']('nolimit')){_0x2ceb54['limit']=qs['limit'](_0x2351c9[_0x429d('0x30')]['limit']);_0x2ceb54['offset']=qs[_0x429d('0x1e')](_0x2351c9[_0x429d('0x30')][_0x429d('0x1e')]);}_0x2ceb54[_0x429d('0x34')]=qs[_0x429d('0x35')](_0x2351c9[_0x429d('0x30')]['sort']);_0x2ceb54[_0x429d('0x36')]=qs[_0x429d('0x37')](_[_0x429d('0x38')](_0x2351c9[_0x429d('0x30')],_0x50ef02[_0x429d('0x37')]),_0x3ca640);if(_0x2351c9[_0x429d('0x30')][_0x429d('0x39')]){_0x2ceb54[_0x429d('0x36')]=_[_0x429d('0x3a')](_0x2ceb54[_0x429d('0x36')],{'$or':_[_0x429d('0x2f')](_0x3ca640,function(_0x1e3924){if(_0x1e3924[_0x429d('0x2d')]!==_0x429d('0x3b')){var _0x1a80bc={};_0x1a80bc[_0x1e3924[_0x429d('0x27')]]={'$like':'%'+_0x2351c9['query']['filter']+'%'};return _0x1a80bc;}})});}_0x2ceb54=_[_0x429d('0x3a')]({},_0x2ceb54,_0x2351c9[_0x429d('0x3c')]);var _0x569811={'where':_0x2ceb54[_0x429d('0x36')]};return db[_0x429d('0x2a')][_0x429d('0x1d')](_0x569811)['then'](function(_0x50a907){_0x31cae6[_0x429d('0x1d')]=_0x50a907;if(_0x2351c9[_0x429d('0x30')]['includeAll']){_0x2ceb54[_0x429d('0x3d')]=[{'all':!![]}];}return db[_0x429d('0x2a')]['findAll'](_0x2ceb54);})[_0x429d('0x24')](function(_0x5182d3){_0x31cae6[_0x429d('0x3e')]=_0x5182d3;return _0x31cae6;})[_0x429d('0x24')](respondWithFilteredResult(_0xdc7bf9,_0x2ceb54))[_0x429d('0x3f')](handleError(_0xdc7bf9,null));};exports[_0x429d('0x40')]=function(_0x4da740,_0x34a79c){var _0x38b40c={'raw':!![],'where':{'id':_0x4da740['params']['id']}},_0x2a97c1={};_0x2a97c1['model']=_[_0x429d('0x31')](db[_0x429d('0x2a')][_0x429d('0x2b')]);_0x2a97c1[_0x429d('0x30')]=_['keys'](_0x4da740[_0x429d('0x30')]);_0x2a97c1[_0x429d('0x37')]=_[_0x429d('0x41')](_0x2a97c1[_0x429d('0x2e')],_0x2a97c1[_0x429d('0x30')]);_0x38b40c[_0x429d('0x33')]=_[_0x429d('0x41')](_0x2a97c1[_0x429d('0x2e')],qs[_0x429d('0x32')](_0x4da740[_0x429d('0x30')]['fields']));_0x38b40c[_0x429d('0x33')]=_0x38b40c['attributes']['length']?_0x38b40c['attributes']:_0x2a97c1[_0x429d('0x2e')];if(_0x4da740[_0x429d('0x30')]['includeAll']){_0x38b40c[_0x429d('0x3d')]=[{'all':!![]}];}_0x38b40c=_[_0x429d('0x3a')]({},_0x38b40c,_0x4da740['options']);return db[_0x429d('0x2a')][_0x429d('0x42')](_0x38b40c)[_0x429d('0x24')](handleEntityNotFound(_0x34a79c,null))[_0x429d('0x24')](respondWithResult(_0x34a79c,null))[_0x429d('0x3f')](handleError(_0x34a79c,null));};exports['create']=function(_0x29c7a2,_0xd9451b){return db[_0x429d('0x2a')][_0x429d('0x43')](_0x29c7a2['body'],{})[_0x429d('0x24')](respondWithResult(_0xd9451b,0xc9))[_0x429d('0x3f')](handleError(_0xd9451b,null));};exports[_0x429d('0x23')]=function(_0x58b6c7,_0x471ba5){if(_0x58b6c7['body']['id']){delete _0x58b6c7[_0x429d('0x44')]['id'];}return db[_0x429d('0x2a')][_0x429d('0x42')]({'where':{'id':_0x58b6c7['params']['id']}})['then'](handleEntityNotFound(_0x471ba5,null))[_0x429d('0x24')](saveUpdates(_0x58b6c7['body'],null))[_0x429d('0x24')](respondWithResult(_0x471ba5,null))[_0x429d('0x3f')](handleError(_0x471ba5,null));};exports[_0x429d('0x45')]=function(_0x25121e,_0x31d1e7){return db[_0x429d('0x2a')][_0x429d('0x42')]({'where':{'id':_0x25121e[_0x429d('0x46')]['id']}})['then'](handleEntityNotFound(_0x31d1e7,null))['then'](removeEntity(_0x31d1e7,null))[_0x429d('0x3f')](handleError(_0x31d1e7,null));};exports[_0x429d('0x47')]=function(_0x18f172,_0x3a15d1){return db['Cdr'][_0x429d('0x47')]()[_0x429d('0x24')](respondWithResult(_0x3a15d1,null))[_0x429d('0x3f')](handleError(_0x3a15d1,null));};
\ No newline at end of file
index a534943..c9a1c29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x426c21,_0x44b5db){var _0x592514=function(_0x5df40f){while(--_0x5df40f){_0x426c21['push'](_0x426c21['shift']());}};_0x592514(++_0x44b5db);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x62ce80,_0x3f4bf3){var _0x13129b=function(_0x3a48ce){while(--_0x3a48ce){_0x62ce80['push'](_0x62ce80['shift']());}};_0x13129b(++_0x3f4bf3);}(_0x7a54,0x106));var _0x47a5=function(_0x3b1833,_0xd05fd0){_0x3b1833=_0x3b1833-0x0;var _0x4b61aa=_0x7a54[_0x3b1833];return _0x4b61aa;};'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 51f3c02..07905d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba2c=['rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b457e,_0xa2b541){var _0x157feb=function(_0x3a60ba){while(--_0x3a60ba){_0x4b457e['push'](_0x4b457e['shift']());}};_0x157feb(++_0xa2b541);}(_0xba2c,0x124));var _0xcba2=function(_0xe42cfa,_0xbf5002){_0xe42cfa=_0xe42cfa-0x0;var _0xc71fa7=_0xba2c[_0xe42cfa];return _0xc71fa7;};'use strict';var _=require(_0xcba2('0x0'));var util=require('util');var moment=require(_0xcba2('0x1'));var BPromise=require(_0xcba2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcba2('0x3'));var db=require(_0xcba2('0x4'))['db'];var utils=require(_0xcba2('0x5'));var logger=require(_0xcba2('0x6'))(_0xcba2('0x7'));var config=require(_0xcba2('0x8'));var jayson=require(_0xcba2('0x9'));var client=jayson[_0xcba2('0xa')][_0xcba2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58372f,_0x4de423,_0x252797){return new BPromise(function(_0x266bcb,_0x12cdb2){return client[_0xcba2('0xc')](_0x58372f,_0x252797)[_0xcba2('0xd')](function(_0x3ba044){logger['info'](_0xcba2('0xe'),_0x4de423,_0xcba2('0xf'));logger[_0xcba2('0x10')](_0xcba2('0x11'),_0x4de423,_0xcba2('0xf'),JSON[_0xcba2('0x12')](_0x3ba044));if(_0x3ba044[_0xcba2('0x13')]){if(_0x3ba044[_0xcba2('0x13')][_0xcba2('0x14')]===0x1f4){logger[_0xcba2('0x13')]('Cdr,\x20%s,\x20%s',_0x4de423,_0x3ba044[_0xcba2('0x13')][_0xcba2('0x15')]);return _0x12cdb2(_0x3ba044[_0xcba2('0x13')][_0xcba2('0x15')]);}logger[_0xcba2('0x13')](_0xcba2('0xe'),_0x4de423,_0x3ba044[_0xcba2('0x13')][_0xcba2('0x15')]);return _0x266bcb(_0x3ba044['error'][_0xcba2('0x15')]);}else{logger['info'](_0xcba2('0xe'),_0x4de423,_0xcba2('0xf'));_0x266bcb(_0x3ba044[_0xcba2('0x16')]['message']);}})['catch'](function(_0x553db2){logger[_0xcba2('0x13')](_0xcba2('0xe'),_0x4de423,_0x553db2);_0x12cdb2(_0x553db2);});});}
\ No newline at end of file
+var _0x0d10=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','Cdr,\x20%s,\x20%s','message','result','catch'];(function(_0x30f967,_0xf75f39){var _0x760297=function(_0x275d2e){while(--_0x275d2e){_0x30f967['push'](_0x30f967['shift']());}};_0x760297(++_0xf75f39);}(_0x0d10,0x11e));var _0x00d1=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x0d10[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0x00d1('0x0'));var util=require(_0x00d1('0x1'));var moment=require(_0x00d1('0x2'));var BPromise=require(_0x00d1('0x3'));var rs=require(_0x00d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x00d1('0x5'));var logger=require(_0x00d1('0x6'))(_0x00d1('0x7'));var config=require('../../config/environment');var jayson=require(_0x00d1('0x8'));var client=jayson[_0x00d1('0x9')][_0x00d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fdb1,_0x1614c9,_0x21706a){return new BPromise(function(_0x314994,_0xa46464){return client[_0x00d1('0xb')](_0x44fdb1,_0x21706a)[_0x00d1('0xc')](function(_0x3aa197){logger[_0x00d1('0xd')]('Cdr,\x20%s,\x20%s',_0x1614c9,_0x00d1('0xe'));logger[_0x00d1('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1614c9,_0x00d1('0xe'),JSON[_0x00d1('0x10')](_0x3aa197));if(_0x3aa197[_0x00d1('0x11')]){if(_0x3aa197[_0x00d1('0x11')]['code']===0x1f4){logger[_0x00d1('0x11')](_0x00d1('0x12'),_0x1614c9,_0x3aa197[_0x00d1('0x11')]['message']);return _0xa46464(_0x3aa197[_0x00d1('0x11')][_0x00d1('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x1614c9,_0x3aa197[_0x00d1('0x11')]['message']);return _0x314994(_0x3aa197[_0x00d1('0x11')][_0x00d1('0x13')]);}else{logger[_0x00d1('0xd')](_0x00d1('0x12'),_0x1614c9,_0x00d1('0xe'));_0x314994(_0x3aa197[_0x00d1('0x14')][_0x00d1('0x13')]);}})[_0x00d1('0x15')](function(_0x119d8e){logger[_0x00d1('0x11')](_0x00d1('0x12'),_0x1614c9,_0x119d8e);_0xa46464(_0x119d8e);});});}
\ No newline at end of file
index 9faff09..8556cb3 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(_0x191c44,_0x20a896){var _0x1086cd=function(_0x2e2cac){while(--_0x2e2cac){_0x191c44['push'](_0x191c44['shift']());}};_0x1086cd(++_0x20a896);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x180763,_0x4b889d){var _0x991e0c=function(_0x2bef11){while(--_0x2bef11){_0x180763['push'](_0x180763['shift']());}};_0x991e0c(++_0x4b889d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index 8d7ce37..2b22936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd34=['sequelize','exports','noop','TEXT','STRING','*,*,*,*'];(function(_0xf482c1,_0x32cbca){var _0x184548=function(_0x2f8086){while(--_0x2f8086){_0xf482c1['push'](_0xf482c1['shift']());}};_0x184548(++_0x32cbca);}(_0xdd34,0x102));var _0x4dd3=function(_0x5ba967,_0x43fa40){_0x5ba967=_0x5ba967-0x0;var _0x39b7ed=_0xdd34[_0x5ba967];return _0x39b7ed;};'use strict';var Sequelize=require(_0x4dd3('0x0'));module[_0x4dd3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4dd3('0x2')},'appdata':{'type':Sequelize[_0x4dd3('0x3')]()},'description':{'type':Sequelize[_0x4dd3('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4dd3('0x5')}};
\ No newline at end of file
+var _0x7ea0=['STRING','noop','TEXT','exports'];(function(_0x526641,_0x2965d3){var _0x47b8a9=function(_0x3049f8){while(--_0x3049f8){_0x526641['push'](_0x526641['shift']());}};_0x47b8a9(++_0x2965d3);}(_0x7ea0,0x103));var _0x07ea=function(_0x36b6a8,_0x355a2a){_0x36b6a8=_0x36b6a8-0x0;var _0xb74659=_0x7ea0[_0x36b6a8];return _0xb74659;};'use strict';var Sequelize=require('sequelize');module[_0x07ea('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x07ea('0x1')],'allowNull':![],'defaultValue':_0x07ea('0x2')},'appdata':{'type':Sequelize[_0x07ea('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x07ea('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 4dca46f..2c7cc70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce25=['include','merge','find','catch','update','body','destroy','zip-dir','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x1c4161,_0x3c3b25){var _0x2e3f51=function(_0x293350){while(--_0x293350){_0x1c4161['push'](_0x1c4161['shift']());}};_0x2e3f51(++_0x3c3b25);}(_0xce25,0x196));var _0x5ce2=function(_0x4d2c63,_0x43d1cf){_0x4d2c63=_0x4d2c63-0x0;var _0x3aaf2e=_0xce25[_0x4d2c63];return _0x3aaf2e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ce2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ce2('0x1'));var Mustache=require(_0x5ce2('0x2'));var util=require('util');var path=require(_0x5ce2('0x3'));var sox=require(_0x5ce2('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce2('0x5'));var _=require(_0x5ce2('0x6'));var squel=require(_0x5ce2('0x7'));var crypto=require(_0x5ce2('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5ce2('0x9'));var toCsv=require(_0x5ce2('0xa'));var querystring=require(_0x5ce2('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ce2('0xc'));var authService=require(_0x5ce2('0xd'));var qs=require(_0x5ce2('0xe'));var as=require(_0x5ce2('0xf'));var hardwareService=require(_0x5ce2('0x10'));var logger=require(_0x5ce2('0x11'))('api');var utils=require(_0x5ce2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5ce2('0x13'));var db=require(_0x5ce2('0x14'))['db'];function respondWithStatusCode(_0x5387b2,_0x496c1e){_0x496c1e=_0x496c1e||0xcc;return function(_0x595d33){if(_0x595d33){return _0x5387b2['sendStatus'](_0x496c1e);}return _0x5387b2[_0x5ce2('0x15')](_0x496c1e)['end']();};}function respondWithResult(_0x5360b8,_0x3a69ec){_0x3a69ec=_0x3a69ec||0xc8;return function(_0x56bd1b){if(_0x56bd1b){return _0x5360b8[_0x5ce2('0x15')](_0x3a69ec)[_0x5ce2('0x16')](_0x56bd1b);}};}function respondWithFilteredResult(_0x24522c,_0x53e047){return function(_0x36a2a5){if(_0x36a2a5){var _0x2727c7=typeof _0x53e047[_0x5ce2('0x17')]==='undefined'&&typeof _0x53e047['limit']===_0x5ce2('0x18');var _0x2509c6=_0x36a2a5[_0x5ce2('0x19')];var _0x5369e7=_0x2727c7?0x0:_0x53e047[_0x5ce2('0x17')];var _0x30cb39=_0x2727c7?_0x36a2a5[_0x5ce2('0x19')]:_0x53e047[_0x5ce2('0x17')]+_0x53e047[_0x5ce2('0x1a')];var _0x2f9013;if(_0x30cb39>=_0x2509c6){_0x30cb39=_0x2509c6;_0x2f9013=0xc8;}else{_0x2f9013=0xce;}_0x24522c[_0x5ce2('0x15')](_0x2f9013);return _0x24522c[_0x5ce2('0x1b')](_0x5ce2('0x1c'),_0x5369e7+'-'+_0x30cb39+'/'+_0x2509c6)[_0x5ce2('0x16')](_0x36a2a5);}return null;};}function patchUpdates(_0x3519c4){return function(_0x2d32c9){try{jsonpatch[_0x5ce2('0x1d')](_0x2d32c9,_0x3519c4,!![]);}catch(_0x3cf781){return BPromise[_0x5ce2('0x1e')](_0x3cf781);}return _0x2d32c9[_0x5ce2('0x1f')]();};}function saveUpdates(_0x13d32d,_0x28899f){return function(_0x350fd9){if(_0x350fd9){return _0x350fd9['update'](_0x13d32d)['then'](function(_0x2e6251){return _0x2e6251;});}return null;};}function removeEntity(_0x2e9675,_0x3440b5){return function(_0x4f27aa){if(_0x4f27aa){return _0x4f27aa['destroy']()[_0x5ce2('0x20')](function(){_0x2e9675[_0x5ce2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3008af,_0x3ab8c8){return function(_0x25accf){if(!_0x25accf){_0x3008af[_0x5ce2('0x21')](0x194);}return _0x25accf;};}function handleError(_0x44c692,_0x208448){_0x208448=_0x208448||0x1f4;return function(_0x3a4bb9){logger[_0x5ce2('0x22')](_0x3a4bb9[_0x5ce2('0x23')]);if(_0x3a4bb9[_0x5ce2('0x24')]){delete _0x3a4bb9[_0x5ce2('0x24')];}_0x44c692[_0x5ce2('0x15')](_0x208448)[_0x5ce2('0x25')](_0x3a4bb9);};}exports[_0x5ce2('0x26')]=function(_0xf57c7e,_0x3ee0cd){var _0x33d83c={'raw':!![],'where':{'id':_0xf57c7e[_0x5ce2('0x27')]['id']}},_0x2898ae={};_0x2898ae[_0x5ce2('0x28')]=_[_0x5ce2('0x29')](db[_0x5ce2('0x2a')][_0x5ce2('0x2b')]);_0x2898ae[_0x5ce2('0x2c')]=_[_0x5ce2('0x29')](_0xf57c7e[_0x5ce2('0x2c')]);_0x2898ae[_0x5ce2('0x2d')]=_[_0x5ce2('0x2e')](_0x2898ae[_0x5ce2('0x28')],_0x2898ae[_0x5ce2('0x2c')]);_0x33d83c[_0x5ce2('0x2f')]=_[_0x5ce2('0x2e')](_0x2898ae['model'],qs[_0x5ce2('0x30')](_0xf57c7e[_0x5ce2('0x2c')][_0x5ce2('0x30')]));_0x33d83c['attributes']=_0x33d83c['attributes'][_0x5ce2('0x31')]?_0x33d83c[_0x5ce2('0x2f')]:_0x2898ae[_0x5ce2('0x28')];if(_0xf57c7e['query']['includeAll']){_0x33d83c[_0x5ce2('0x32')]=[{'all':!![]}];}_0x33d83c=_[_0x5ce2('0x33')]({},_0x33d83c,_0xf57c7e['options']);return db[_0x5ce2('0x2a')][_0x5ce2('0x34')](_0x33d83c)[_0x5ce2('0x20')](handleEntityNotFound(_0x3ee0cd,null))[_0x5ce2('0x20')](respondWithResult(_0x3ee0cd,null))[_0x5ce2('0x35')](handleError(_0x3ee0cd,null));};exports[_0x5ce2('0x36')]=function(_0x4f6a18,_0x1a7466){if(_0x4f6a18[_0x5ce2('0x37')]['id']){delete _0x4f6a18[_0x5ce2('0x37')]['id'];}return db[_0x5ce2('0x2a')]['find']({'where':{'id':_0x4f6a18['params']['id']}})['then'](handleEntityNotFound(_0x1a7466,null))['then'](saveUpdates(_0x4f6a18[_0x5ce2('0x37')],null))[_0x5ce2('0x20')](respondWithResult(_0x1a7466,null))[_0x5ce2('0x35')](handleError(_0x1a7466,null));};exports[_0x5ce2('0x38')]=function(_0x31b224,_0x21fa81){return db[_0x5ce2('0x2a')][_0x5ce2('0x34')]({'where':{'id':_0x31b224[_0x5ce2('0x27')]['id']}})[_0x5ce2('0x20')](handleEntityNotFound(_0x21fa81,null))[_0x5ce2('0x20')](removeEntity(_0x21fa81,null))[_0x5ce2('0x35')](handleError(_0x21fa81,null));};
\ No newline at end of file
+var _0x6c63=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','params','catch','eml-format','rimraf'];(function(_0x480453,_0x15d40c){var _0x12cb99=function(_0x25b871){while(--_0x25b871){_0x480453['push'](_0x480453['shift']());}};_0x12cb99(++_0x15d40c);}(_0x6c63,0x1ee));var _0x36c6=function(_0x5b811f,_0x2890c7){_0x5b811f=_0x5b811f-0x0;var _0x3eb33a=_0x6c63[_0x5b811f];return _0x3eb33a;};'use strict';var emlformat=require(_0x36c6('0x0'));var rimraf=require(_0x36c6('0x1'));var zipdir=require(_0x36c6('0x2'));var jsonpatch=require(_0x36c6('0x3'));var rp=require(_0x36c6('0x4'));var moment=require(_0x36c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x36c6('0x6'));var util=require(_0x36c6('0x7'));var path=require(_0x36c6('0x8'));var sox=require(_0x36c6('0x9'));var csv=require(_0x36c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36c6('0xb'));var _=require(_0x36c6('0xc'));var squel=require(_0x36c6('0xd'));var crypto=require(_0x36c6('0xe'));var jsforce=require(_0x36c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x36c6('0xa'));var querystring=require('querystring');var Papa=require(_0x36c6('0x10'));var Redis=require('ioredis');var authService=require(_0x36c6('0x11'));var qs=require(_0x36c6('0x12'));var as=require(_0x36c6('0x13'));var hardwareService=require(_0x36c6('0x14'));var logger=require(_0x36c6('0x15'))(_0x36c6('0x16'));var utils=require(_0x36c6('0x17'));var config=require(_0x36c6('0x18'));var licenseUtil=require(_0x36c6('0x19'));var db=require(_0x36c6('0x1a'))['db'];function respondWithStatusCode(_0x1e5a00,_0x1bbb1b){_0x1bbb1b=_0x1bbb1b||0xcc;return function(_0x20213a){if(_0x20213a){return _0x1e5a00[_0x36c6('0x1b')](_0x1bbb1b);}return _0x1e5a00['status'](_0x1bbb1b)[_0x36c6('0x1c')]();};}function respondWithResult(_0x1a2391,_0x1f9de1){_0x1f9de1=_0x1f9de1||0xc8;return function(_0x531c09){if(_0x531c09){return _0x1a2391[_0x36c6('0x1d')](_0x1f9de1)[_0x36c6('0x1e')](_0x531c09);}};}function respondWithFilteredResult(_0x3c5623,_0x25b30e){return function(_0x9e4cb6){if(_0x9e4cb6){var _0x56b28b=typeof _0x25b30e[_0x36c6('0x1f')]===_0x36c6('0x20')&&typeof _0x25b30e[_0x36c6('0x21')]===_0x36c6('0x20');var _0x5bac6c=_0x9e4cb6[_0x36c6('0x22')];var _0x499c50=_0x56b28b?0x0:_0x25b30e[_0x36c6('0x1f')];var _0x59ab0c=_0x56b28b?_0x9e4cb6[_0x36c6('0x22')]:_0x25b30e[_0x36c6('0x1f')]+_0x25b30e[_0x36c6('0x21')];var _0x539791;if(_0x59ab0c>=_0x5bac6c){_0x59ab0c=_0x5bac6c;_0x539791=0xc8;}else{_0x539791=0xce;}_0x3c5623[_0x36c6('0x1d')](_0x539791);return _0x3c5623[_0x36c6('0x23')](_0x36c6('0x24'),_0x499c50+'-'+_0x59ab0c+'/'+_0x5bac6c)[_0x36c6('0x1e')](_0x9e4cb6);}return null;};}function patchUpdates(_0x4097b1){return function(_0x6daa60){try{jsonpatch[_0x36c6('0x25')](_0x6daa60,_0x4097b1,!![]);}catch(_0x55898b){return BPromise['reject'](_0x55898b);}return _0x6daa60[_0x36c6('0x26')]();};}function saveUpdates(_0x32093d,_0x53911e){return function(_0x597570){if(_0x597570){return _0x597570[_0x36c6('0x27')](_0x32093d)[_0x36c6('0x28')](function(_0x3112af){return _0x3112af;});}return null;};}function removeEntity(_0xdd6931,_0x2e12f7){return function(_0x77240f){if(_0x77240f){return _0x77240f[_0x36c6('0x29')]()[_0x36c6('0x28')](function(){_0xdd6931['status'](0xcc)[_0x36c6('0x1c')]();});}};}function handleEntityNotFound(_0x3c5195,_0x13c266){return function(_0x599db1){if(!_0x599db1){_0x3c5195[_0x36c6('0x1b')](0x194);}return _0x599db1;};}function handleError(_0x41f46e,_0x2cfcdf){_0x2cfcdf=_0x2cfcdf||0x1f4;return function(_0x83612d){logger['error'](_0x83612d[_0x36c6('0x2a')]);if(_0x83612d['name']){delete _0x83612d[_0x36c6('0x2b')];}_0x41f46e[_0x36c6('0x1d')](_0x2cfcdf)['send'](_0x83612d);};}exports['show']=function(_0x539d99,_0x294c9b){var _0x26f4d4={'raw':!![],'where':{'id':_0x539d99['params']['id']}},_0x4eae9a={};_0x4eae9a[_0x36c6('0x2c')]=_[_0x36c6('0x2d')](db[_0x36c6('0x2e')][_0x36c6('0x2f')]);_0x4eae9a[_0x36c6('0x30')]=_[_0x36c6('0x2d')](_0x539d99[_0x36c6('0x30')]);_0x4eae9a[_0x36c6('0x31')]=_[_0x36c6('0x32')](_0x4eae9a[_0x36c6('0x2c')],_0x4eae9a[_0x36c6('0x30')]);_0x26f4d4[_0x36c6('0x33')]=_[_0x36c6('0x32')](_0x4eae9a['model'],qs[_0x36c6('0x34')](_0x539d99[_0x36c6('0x30')]['fields']));_0x26f4d4[_0x36c6('0x33')]=_0x26f4d4[_0x36c6('0x33')][_0x36c6('0x35')]?_0x26f4d4['attributes']:_0x4eae9a['model'];if(_0x539d99['query'][_0x36c6('0x36')]){_0x26f4d4[_0x36c6('0x37')]=[{'all':!![]}];}_0x26f4d4=_[_0x36c6('0x38')]({},_0x26f4d4,_0x539d99[_0x36c6('0x39')]);return db[_0x36c6('0x2e')][_0x36c6('0x3a')](_0x26f4d4)[_0x36c6('0x28')](handleEntityNotFound(_0x294c9b,null))[_0x36c6('0x28')](respondWithResult(_0x294c9b,null))['catch'](handleError(_0x294c9b,null));};exports['update']=function(_0x1d385d,_0x2b9786){if(_0x1d385d[_0x36c6('0x3b')]['id']){delete _0x1d385d[_0x36c6('0x3b')]['id'];}return db['ChatApplication'][_0x36c6('0x3a')]({'where':{'id':_0x1d385d['params']['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x2b9786,null))['then'](saveUpdates(_0x1d385d[_0x36c6('0x3b')],null))[_0x36c6('0x28')](respondWithResult(_0x2b9786,null))['catch'](handleError(_0x2b9786,null));};exports[_0x36c6('0x29')]=function(_0x59c43d,_0x460466){return db[_0x36c6('0x2e')][_0x36c6('0x3a')]({'where':{'id':_0x59c43d[_0x36c6('0x3c')]['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x460466,null))['then'](removeEntity(_0x460466,null))[_0x36c6('0x3d')](handleError(_0x460466,null));};
\ No newline at end of file
index 99b1201..e1751e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f13=['./chatApplication.attributes','exports','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0xf851af,_0x3f3bd8){var _0x454e01=function(_0x302772){while(--_0x302772){_0xf851af['push'](_0xf851af['shift']());}};_0x454e01(++_0x3f3bd8);}(_0x2f13,0x1f0));var _0x32f1=function(_0xd9943,_0x1d1c58){_0xd9943=_0xd9943-0x0;var _0x38936d=_0x2f13[_0xd9943];return _0x38936d;};'use strict';var _=require(_0x32f1('0x0'));var util=require(_0x32f1('0x1'));var logger=require(_0x32f1('0x2'))(_0x32f1('0x3'));var moment=require(_0x32f1('0x4'));var BPromise=require('bluebird');var rp=require(_0x32f1('0x5'));var fs=require('fs');var path=require(_0x32f1('0x6'));var rimraf=require('rimraf');var config=require(_0x32f1('0x7'));var attributes=require(_0x32f1('0x8'));module[_0x32f1('0x9')]=function(_0x259392,_0x1e0a84){return _0x259392['define'](_0x32f1('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x32f1('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x22d5=['exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x22d5,0xc5));var _0x522d=function(_0x4f8a14,_0x41bb12){_0x4f8a14=_0x4f8a14-0x0;var _0x1627d7=_0x22d5[_0x4f8a14];return _0x1627d7;};'use strict';var _=require(_0x522d('0x0'));var util=require(_0x522d('0x1'));var logger=require('../../config/logger')(_0x522d('0x2'));var moment=require('moment');var BPromise=require(_0x522d('0x3'));var rp=require(_0x522d('0x4'));var fs=require('fs');var path=require(_0x522d('0x5'));var rimraf=require('rimraf');var config=require(_0x522d('0x6'));var attributes=require('./chatApplication.attributes');module[_0x522d('0x7')]=function(_0x9cc76c,_0x427d43){return _0x9cc76c[_0x522d('0x8')](_0x522d('0x9'),attributes,{'tableName':_0x522d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x522d('0xb')});};
\ No newline at end of file
index 2de6ba1..707a703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6e1=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5eddd8,_0x31f541){var _0x2aaeda=function(_0x213faa){while(--_0x213faa){_0x5eddd8['push'](_0x5eddd8['shift']());}};_0x2aaeda(++_0x31f541);}(_0xa6e1,0xed));var _0x1a6e=function(_0x3d9948,_0x414a02){_0x3d9948=_0x3d9948-0x0;var _0x48ef37=_0xa6e1[_0x3d9948];return _0x48ef37;};'use strict';var _=require(_0x1a6e('0x0'));var util=require(_0x1a6e('0x1'));var moment=require('moment');var BPromise=require(_0x1a6e('0x2'));var rs=require(_0x1a6e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a6e('0x4'))(_0x1a6e('0x5'));var config=require(_0x1a6e('0x6'));var jayson=require(_0x1a6e('0x7'));var client=jayson['client'][_0x1a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19a7a4,_0x2ff54b,_0x19825d){return new BPromise(function(_0x4fec8a,_0x4c243a){return client[_0x1a6e('0x9')](_0x19a7a4,_0x19825d)[_0x1a6e('0xa')](function(_0x25c041){logger[_0x1a6e('0xb')](_0x1a6e('0xc'),_0x2ff54b,_0x1a6e('0xd'));logger[_0x1a6e('0xe')](_0x1a6e('0xf'),_0x2ff54b,_0x1a6e('0xd'),JSON['stringify'](_0x25c041));if(_0x25c041[_0x1a6e('0x10')]){if(_0x25c041[_0x1a6e('0x10')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2ff54b,_0x25c041[_0x1a6e('0x10')]['message']);return _0x4c243a(_0x25c041[_0x1a6e('0x10')]['message']);}logger[_0x1a6e('0x10')](_0x1a6e('0xc'),_0x2ff54b,_0x25c041[_0x1a6e('0x10')][_0x1a6e('0x11')]);return _0x4fec8a(_0x25c041['error'][_0x1a6e('0x11')]);}else{logger[_0x1a6e('0xb')](_0x1a6e('0xc'),_0x2ff54b,_0x1a6e('0xd'));_0x4fec8a(_0x25c041[_0x1a6e('0x12')][_0x1a6e('0x11')]);}})['catch'](function(_0x2e49bc){logger[_0x1a6e('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2ff54b,_0x2e49bc);_0x4c243a(_0x2e49bc);});});}
\ No newline at end of file
+var _0x9e3c=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a6007,_0x350755){var _0x120665=function(_0x51e6ba){while(--_0x51e6ba){_0x1a6007['push'](_0x1a6007['shift']());}};_0x120665(++_0x350755);}(_0x9e3c,0x12f));var _0xc9e3=function(_0x459fb4,_0x1659a3){_0x459fb4=_0x459fb4-0x0;var _0x10dd67=_0x9e3c[_0x459fb4];return _0x10dd67;};'use strict';var _=require(_0xc9e3('0x0'));var util=require(_0xc9e3('0x1'));var moment=require(_0xc9e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9e3('0x3'));var fs=require('fs');var Redis=require(_0xc9e3('0x4'));var db=require(_0xc9e3('0x5'))['db'];var utils=require(_0xc9e3('0x6'));var logger=require('../../config/logger')(_0xc9e3('0x7'));var config=require(_0xc9e3('0x8'));var jayson=require(_0xc9e3('0x9'));var client=jayson[_0xc9e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d1d9,_0x5cce0c,_0xe6d5ff){return new BPromise(function(_0x50880d,_0x25296d){return client['request'](_0x16d1d9,_0xe6d5ff)[_0xc9e3('0xb')](function(_0x26d94f){logger[_0xc9e3('0xc')](_0xc9e3('0xd'),_0x5cce0c,_0xc9e3('0xe'));logger[_0xc9e3('0xf')](_0xc9e3('0x10'),_0x5cce0c,_0xc9e3('0xe'),JSON[_0xc9e3('0x11')](_0x26d94f));if(_0x26d94f[_0xc9e3('0x12')]){if(_0x26d94f[_0xc9e3('0x12')][_0xc9e3('0x13')]===0x1f4){logger[_0xc9e3('0x12')](_0xc9e3('0xd'),_0x5cce0c,_0x26d94f['error'][_0xc9e3('0x14')]);return _0x25296d(_0x26d94f[_0xc9e3('0x12')][_0xc9e3('0x14')]);}logger[_0xc9e3('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5cce0c,_0x26d94f[_0xc9e3('0x12')]['message']);return _0x50880d(_0x26d94f['error']['message']);}else{logger[_0xc9e3('0xc')](_0xc9e3('0xd'),_0x5cce0c,_0xc9e3('0xe'));_0x50880d(_0x26d94f[_0xc9e3('0x15')][_0xc9e3('0x14')]);}})[_0xc9e3('0x16')](function(_0x46fc12){logger['error'](_0xc9e3('0xd'),_0x5cce0c,_0x46fc12);_0x25296d(_0x46fc12);});});}
\ No newline at end of file
index e178311..00743f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ebd=['delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update'];(function(_0x3051cd,_0x40c868){var _0x76facb=function(_0x2a3188){while(--_0x2a3188){_0x3051cd['push'](_0x3051cd['shift']());}};_0x76facb(++_0x40c868);}(_0x4ebd,0x1a2));var _0xd4eb=function(_0x416e5e,_0xb117d1){_0x416e5e=_0x416e5e-0x0;var _0x3b6b73=_0x4ebd[_0x416e5e];return _0x3b6b73;};'use strict';var multer=require(_0xd4eb('0x0'));var util=require(_0xd4eb('0x1'));var path=require(_0xd4eb('0x2'));var timeout=require(_0xd4eb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd4eb('0x4'));var auth=require(_0xd4eb('0x5'));var interaction=require(_0xd4eb('0x6'));var config=require('../../config/environment');var controller=require(_0xd4eb('0x7'));router[_0xd4eb('0x8')](_0xd4eb('0x9'),auth['isAuthenticated'](),controller[_0xd4eb('0xa')]);router[_0xd4eb('0xb')](_0xd4eb('0x9'),auth[_0xd4eb('0xc')](),controller[_0xd4eb('0xd')]);router[_0xd4eb('0xe')](_0xd4eb('0x9'),auth['isAuthenticated'](),controller[_0xd4eb('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x08e7=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','express'];(function(_0x19ee9e,_0x7156d2){var _0x1dcf68=function(_0x22d019){while(--_0x22d019){_0x19ee9e['push'](_0x19ee9e['shift']());}};_0x1dcf68(++_0x7156d2);}(_0x08e7,0xee));var _0x708e=function(_0x739c4e,_0x2b1a09){_0x739c4e=_0x739c4e-0x0;var _0x5673c8=_0x08e7[_0x739c4e];return _0x5673c8;};'use strict';var multer=require(_0x708e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x708e('0x1'));var router=express[_0x708e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x708e('0x3'));var interaction=require(_0x708e('0x4'));var config=require(_0x708e('0x5'));var controller=require(_0x708e('0x6'));router[_0x708e('0x7')](_0x708e('0x8'),auth[_0x708e('0x9')](),controller[_0x708e('0xa')]);router[_0x708e('0xb')](_0x708e('0x8'),auth[_0x708e('0x9')](),controller[_0x708e('0xc')]);router[_0x708e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x708e('0xe')]);module[_0x708e('0xf')]=router;
\ No newline at end of file
index 97fe603..eb5d89d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda91=['sequelize','STRING','BOOLEAN'];(function(_0x5980ec,_0x42d2ac){var _0x279af3=function(_0x30decf){while(--_0x30decf){_0x5980ec['push'](_0x5980ec['shift']());}};_0x279af3(++_0x42d2ac);}(_0xda91,0x72));var _0x1da9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xda91[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x1da9('0x0'));module['exports']={'name':{'type':Sequelize[_0x1da9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1da9('0x1')]},'write':{'type':Sequelize[_0x1da9('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','BOOLEAN','sequelize'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0x5fab,0x177));var _0xb5fa=function(_0x26a44e,_0x18c43f){_0x26a44e=_0x26a44e-0x0;var _0x566fc4=_0x5fab[_0x26a44e];return _0x566fc4;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'write':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 4787308..e7bf604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b3a=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','rawAttributes','length','create','update','body','params','catch','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','find','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','undefined','limit','count','offset','set','json','apply','then','destroy','end','error','stack','name','send','map','ChatGroup','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2c4d00,_0x4c7c6f){var _0xb2c2d9=function(_0x4af366){while(--_0x4af366){_0x2c4d00['push'](_0x2c4d00['shift']());}};_0xb2c2d9(++_0x4c7c6f);}(_0x2b3a,0x13b));var _0xa2b3=function(_0x4cdd3b,_0x17b464){_0x4cdd3b=_0x4cdd3b-0x0;var _0x5d6493=_0x2b3a[_0x4cdd3b];return _0x5d6493;};'use strict';var emlformat=require(_0xa2b3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2b3('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2b3('0x2'));var Mustache=require('mustache');var util=require(_0xa2b3('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xa2b3('0x4'));var ejs=require(_0xa2b3('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2b3('0x6'));var squel=require(_0xa2b3('0x7'));var crypto=require(_0xa2b3('0x8'));var jsforce=require(_0xa2b3('0x9'));var deskjs=require(_0xa2b3('0xa'));var toCsv=require(_0xa2b3('0x4'));var querystring=require(_0xa2b3('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa2b3('0xc'));var qs=require(_0xa2b3('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa2b3('0xe'));var logger=require(_0xa2b3('0xf'))('api');var utils=require(_0xa2b3('0x10'));var config=require(_0xa2b3('0x11'));var licenseUtil=require(_0xa2b3('0x12'));var db=require(_0xa2b3('0x13'))['db'];config[_0xa2b3('0x14')]=_['defaults'](config[_0xa2b3('0x14')],{'host':_0xa2b3('0x15'),'port':0x18eb});var socket=require(_0xa2b3('0x16'))(new Redis(config[_0xa2b3('0x14')]));require(_0xa2b3('0x17'))['register'](socket);function respondWithStatusCode(_0x4b4cde,_0x4191fc){_0x4191fc=_0x4191fc||0xcc;return function(_0x2c5ada){if(_0x2c5ada){return _0x4b4cde[_0xa2b3('0x18')](_0x4191fc);}return _0x4b4cde['status'](_0x4191fc)['end']();};}function respondWithResult(_0x53a238,_0x591d42){_0x591d42=_0x591d42||0xc8;return function(_0x47e2d2){if(_0x47e2d2){return _0x53a238[_0xa2b3('0x19')](_0x591d42)['json'](_0x47e2d2);}};}function respondWithFilteredResult(_0x333390,_0x322213){return function(_0x414a86){if(_0x414a86){var _0x59f944=typeof _0x322213['offset']===_0xa2b3('0x1a')&&typeof _0x322213[_0xa2b3('0x1b')]===_0xa2b3('0x1a');var _0x719231=_0x414a86[_0xa2b3('0x1c')];var _0xecfdf2=_0x59f944?0x0:_0x322213['offset'];var _0x19fc0a=_0x59f944?_0x414a86['count']:_0x322213[_0xa2b3('0x1d')]+_0x322213[_0xa2b3('0x1b')];var _0x42408b;if(_0x19fc0a>=_0x719231){_0x19fc0a=_0x719231;_0x42408b=0xc8;}else{_0x42408b=0xce;}_0x333390[_0xa2b3('0x19')](_0x42408b);return _0x333390[_0xa2b3('0x1e')]('Content-Range',_0xecfdf2+'-'+_0x19fc0a+'/'+_0x719231)[_0xa2b3('0x1f')](_0x414a86);}return null;};}function patchUpdates(_0x4abfc7){return function(_0x240f7e){try{jsonpatch[_0xa2b3('0x20')](_0x240f7e,_0x4abfc7,!![]);}catch(_0x43c80c){return BPromise['reject'](_0x43c80c);}return _0x240f7e['save']();};}function saveUpdates(_0x24d66a,_0x3d9da5){return function(_0x3b7804){if(_0x3b7804){return _0x3b7804['update'](_0x24d66a)[_0xa2b3('0x21')](function(_0x49991f){return _0x49991f;});}return null;};}function removeEntity(_0x38e522,_0xfe747b){return function(_0xd8a1b7){if(_0xd8a1b7){return _0xd8a1b7[_0xa2b3('0x22')]()[_0xa2b3('0x21')](function(){_0x38e522[_0xa2b3('0x19')](0xcc)[_0xa2b3('0x23')]();});}};}function handleEntityNotFound(_0x54592a,_0x182709){return function(_0x3c5e73){if(!_0x3c5e73){_0x54592a['sendStatus'](0x194);}return _0x3c5e73;};}function handleError(_0xf7b6fb,_0x3a986a){_0x3a986a=_0x3a986a||0x1f4;return function(_0x350a41){logger[_0xa2b3('0x24')](_0x350a41[_0xa2b3('0x25')]);if(_0x350a41[_0xa2b3('0x26')]){delete _0x350a41[_0xa2b3('0x26')];}_0xf7b6fb[_0xa2b3('0x19')](_0x3a986a)[_0xa2b3('0x27')](_0x350a41);};}exports['index']=function(_0x3dc962,_0x1937a0){var _0x20a727={},_0x286bbc={},_0x263d77={'count':0x0,'rows':[]};var _0x1c2e9c=_[_0xa2b3('0x28')](db[_0xa2b3('0x29')]['rawAttributes'],function(_0x492eb1){return{'name':_0x492eb1[_0xa2b3('0x2a')],'type':_0x492eb1[_0xa2b3('0x2b')]['key']};});_0x286bbc[_0xa2b3('0x2c')]=_[_0xa2b3('0x28')](_0x1c2e9c,_0xa2b3('0x26'));_0x286bbc['query']=_['keys'](_0x3dc962[_0xa2b3('0x2d')]);_0x286bbc[_0xa2b3('0x2e')]=_[_0xa2b3('0x2f')](_0x286bbc[_0xa2b3('0x2c')],_0x286bbc['query']);_0x20a727[_0xa2b3('0x30')]=_[_0xa2b3('0x2f')](_0x286bbc['model'],qs[_0xa2b3('0x31')](_0x3dc962['query']['fields']));_0x20a727[_0xa2b3('0x30')]=_0x20a727[_0xa2b3('0x30')]['length']?_0x20a727[_0xa2b3('0x30')]:_0x286bbc[_0xa2b3('0x2c')];if(!_0x3dc962[_0xa2b3('0x2d')][_0xa2b3('0x32')](_0xa2b3('0x33'))){_0x20a727[_0xa2b3('0x1b')]=qs[_0xa2b3('0x1b')](_0x3dc962['query'][_0xa2b3('0x1b')]);_0x20a727[_0xa2b3('0x1d')]=qs[_0xa2b3('0x1d')](_0x3dc962[_0xa2b3('0x2d')][_0xa2b3('0x1d')]);}_0x20a727[_0xa2b3('0x34')]=qs[_0xa2b3('0x35')](_0x3dc962[_0xa2b3('0x2d')][_0xa2b3('0x35')]);_0x20a727[_0xa2b3('0x36')]=qs[_0xa2b3('0x2e')](_[_0xa2b3('0x37')](_0x3dc962[_0xa2b3('0x2d')],_0x286bbc[_0xa2b3('0x2e')]),_0x1c2e9c);if(_0x3dc962[_0xa2b3('0x2d')][_0xa2b3('0x38')]){_0x20a727[_0xa2b3('0x36')]=_[_0xa2b3('0x39')](_0x20a727[_0xa2b3('0x36')],{'$or':_[_0xa2b3('0x28')](_0x1c2e9c,function(_0x42cad8){if(_0x42cad8['type']!==_0xa2b3('0x3a')){var _0x21b1b6={};_0x21b1b6[_0x42cad8[_0xa2b3('0x26')]]={'$like':'%'+_0x3dc962[_0xa2b3('0x2d')][_0xa2b3('0x38')]+'%'};return _0x21b1b6;}})});}_0x20a727=_[_0xa2b3('0x39')]({},_0x20a727,_0x3dc962[_0xa2b3('0x3b')]);var _0x59bf6a={'where':_0x20a727['where']};return db[_0xa2b3('0x29')][_0xa2b3('0x1c')](_0x59bf6a)[_0xa2b3('0x21')](function(_0x39bcc7){_0x263d77['count']=_0x39bcc7;if(_0x3dc962[_0xa2b3('0x2d')][_0xa2b3('0x3c')]){_0x20a727[_0xa2b3('0x3d')]=[{'all':!![]}];}return db[_0xa2b3('0x29')][_0xa2b3('0x3e')](_0x20a727);})[_0xa2b3('0x21')](function(_0x9aca9e){_0x263d77[_0xa2b3('0x3f')]=_0x9aca9e;return _0x263d77;})[_0xa2b3('0x21')](respondWithFilteredResult(_0x1937a0,_0x20a727))['catch'](handleError(_0x1937a0,null));};exports[_0xa2b3('0x40')]=function(_0x2426fb,_0xe4fe92){var _0x1cf1b3={'raw':!![],'where':{'id':_0x2426fb['params']['id']}},_0xd493bd={};_0xd493bd[_0xa2b3('0x2c')]=_[_0xa2b3('0x41')](db['ChatGroup'][_0xa2b3('0x42')]);_0xd493bd[_0xa2b3('0x2d')]=_[_0xa2b3('0x41')](_0x2426fb[_0xa2b3('0x2d')]);_0xd493bd[_0xa2b3('0x2e')]=_['intersection'](_0xd493bd[_0xa2b3('0x2c')],_0xd493bd[_0xa2b3('0x2d')]);_0x1cf1b3[_0xa2b3('0x30')]=_[_0xa2b3('0x2f')](_0xd493bd[_0xa2b3('0x2c')],qs[_0xa2b3('0x31')](_0x2426fb[_0xa2b3('0x2d')][_0xa2b3('0x31')]));_0x1cf1b3['attributes']=_0x1cf1b3['attributes'][_0xa2b3('0x43')]?_0x1cf1b3['attributes']:_0xd493bd[_0xa2b3('0x2c')];if(_0x2426fb[_0xa2b3('0x2d')][_0xa2b3('0x3c')]){_0x1cf1b3[_0xa2b3('0x3d')]=[{'all':!![]}];}_0x1cf1b3=_[_0xa2b3('0x39')]({},_0x1cf1b3,_0x2426fb[_0xa2b3('0x3b')]);return db[_0xa2b3('0x29')]['find'](_0x1cf1b3)[_0xa2b3('0x21')](handleEntityNotFound(_0xe4fe92,null))[_0xa2b3('0x21')](respondWithResult(_0xe4fe92,null))['catch'](handleError(_0xe4fe92,null));};exports[_0xa2b3('0x44')]=function(_0x29387a,_0x50a096){return db[_0xa2b3('0x29')][_0xa2b3('0x44')](_0x29387a['body'],{})[_0xa2b3('0x21')](respondWithResult(_0x50a096,0xc9))['catch'](handleError(_0x50a096,null));};exports[_0xa2b3('0x45')]=function(_0x4cf23a,_0x125423){if(_0x4cf23a[_0xa2b3('0x46')]['id']){delete _0x4cf23a[_0xa2b3('0x46')]['id'];}return db[_0xa2b3('0x29')]['find']({'where':{'id':_0x4cf23a[_0xa2b3('0x47')]['id']}})[_0xa2b3('0x21')](handleEntityNotFound(_0x125423,null))[_0xa2b3('0x21')](saveUpdates(_0x4cf23a[_0xa2b3('0x46')],null))[_0xa2b3('0x21')](respondWithResult(_0x125423,null))[_0xa2b3('0x48')](handleError(_0x125423,null));};exports[_0xa2b3('0x22')]=function(_0x306a6b,_0x1326e1){return db[_0xa2b3('0x29')]['find']({'where':{'id':_0x306a6b[_0xa2b3('0x47')]['id']}})[_0xa2b3('0x21')](handleEntityNotFound(_0x1326e1,null))['then'](removeEntity(_0x1326e1,null))[_0xa2b3('0x48')](handleError(_0x1326e1,null));};exports[_0xa2b3('0x49')]=function(_0x11a196,_0x2d51f2){return db[_0xa2b3('0x29')][_0xa2b3('0x49')]()[_0xa2b3('0x21')](respondWithResult(_0x2d51f2,null))[_0xa2b3('0x48')](handleError(_0x2d51f2,null));};exports[_0xa2b3('0x4a')]=function(_0x101d01,_0x53890b,_0x117dae){return db[_0xa2b3('0x4b')]['count']({'where':{'ChatGroupId':_0x101d01['params']['id'],'ToId':_0x101d01[_0xa2b3('0x4c')]['id'],'read':![]}})[_0xa2b3('0x21')](function(_0x460f8e){return{'id':_[_0xa2b3('0x4d')](_0x101d01[_0xa2b3('0x47')]['id']),'count':_0x460f8e};})[_0xa2b3('0x21')](respondWithResult(_0x53890b,null))[_0xa2b3('0x48')](handleError(_0x53890b,null));};exports[_0xa2b3('0x4e')]=function(_0x4223bb,_0x50894f,_0x4f5d65){return db[_0xa2b3('0x29')]['find']({'where':{'id':_0x4223bb[_0xa2b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x50894f,null))['then'](function(_0x5ac521){if(_0x5ac521){return _0x5ac521[_0xa2b3('0x4e')](_0x4223bb[_0xa2b3('0x46')][_0xa2b3('0x4f')],_[_0xa2b3('0x50')](_0x4223bb[_0xa2b3('0x46')],[_0xa2b3('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x50894f,null))['catch'](handleError(_0x50894f,null));};exports[_0xa2b3('0x51')]=function(_0x2071cd,_0x4548a9,_0x5a9b5b){var _0x309991={};var _0x59ba89={};var _0xacfb4c;var _0x407316;return db['ChatGroup'][_0xa2b3('0x52')]({'where':{'id':_0x2071cd[_0xa2b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x4548a9,null))[_0xa2b3('0x21')](function(_0x245358){if(_0x245358){_0xacfb4c=_0x245358;_0x59ba89[_0xa2b3('0x2c')]=_['keys'](db[_0xa2b3('0x53')]['rawAttributes']);_0x59ba89[_0xa2b3('0x2d')]=_[_0xa2b3('0x41')](_0x2071cd[_0xa2b3('0x2d')]);_0x59ba89[_0xa2b3('0x2e')]=_[_0xa2b3('0x2f')](_0x59ba89['model'],_0x59ba89[_0xa2b3('0x2d')]);_0x309991['attributes']=_[_0xa2b3('0x2f')](_0x59ba89[_0xa2b3('0x2c')],qs[_0xa2b3('0x31')](_0x2071cd[_0xa2b3('0x2d')][_0xa2b3('0x31')]));_0x309991['attributes']=_0x309991[_0xa2b3('0x30')][_0xa2b3('0x43')]?_0x309991[_0xa2b3('0x30')]:_0x59ba89[_0xa2b3('0x2c')];_0x309991[_0xa2b3('0x34')]=qs['sort'](_0x2071cd[_0xa2b3('0x2d')]['sort']);_0x309991['where']=qs['filters'](_['pick'](_0x2071cd[_0xa2b3('0x2d')],_0x59ba89[_0xa2b3('0x2e')]));if(_0x2071cd[_0xa2b3('0x2d')][_0xa2b3('0x38')]){_0x309991[_0xa2b3('0x36')]=_[_0xa2b3('0x39')](_0x309991[_0xa2b3('0x36')],{'$or':_['map'](_0x309991[_0xa2b3('0x30')],function(_0x360c88){var _0xcdc217={};_0xcdc217[_0x360c88]={'$like':'%'+_0x2071cd[_0xa2b3('0x2d')][_0xa2b3('0x38')]+'%'};return _0xcdc217;})});}_0x309991=_[_0xa2b3('0x39')]({},_0x309991,_0x2071cd[_0xa2b3('0x3b')]);return _0xacfb4c[_0xa2b3('0x51')](_0x309991);}})[_0xa2b3('0x21')](function(_0x1e94be){if(_0x1e94be){_0x407316=_0x1e94be[_0xa2b3('0x43')];if(!_0x2071cd[_0xa2b3('0x2d')]['hasOwnProperty'](_0xa2b3('0x33'))){_0x309991[_0xa2b3('0x1b')]=qs[_0xa2b3('0x1b')](_0x2071cd[_0xa2b3('0x2d')]['limit']);_0x309991[_0xa2b3('0x1d')]=qs[_0xa2b3('0x1d')](_0x2071cd[_0xa2b3('0x2d')][_0xa2b3('0x1d')]);}return _0xacfb4c[_0xa2b3('0x51')](_0x309991);}})['then'](function(_0x2abd13){if(_0x2abd13){return _0x2abd13?{'count':_0x407316,'rows':_0x2abd13}:null;}})[_0xa2b3('0x21')](respondWithResult(_0x4548a9,null))[_0xa2b3('0x48')](handleError(_0x4548a9,null));};exports[_0xa2b3('0x54')]=function(_0x51f21d,_0x5db6a9,_0x6debac){return db['ChatGroup'][_0xa2b3('0x55')]({'where':{'id':_0x51f21d[_0xa2b3('0x47')]['id']}})[_0xa2b3('0x21')](handleEntityNotFound(_0x5db6a9,null))[_0xa2b3('0x21')](function(_0x269989){if(_0x269989){return _0x269989[_0xa2b3('0x54')](_0x51f21d[_0xa2b3('0x2d')]['ids']);}})[_0xa2b3('0x21')](respondWithStatusCode(_0x5db6a9,null))[_0xa2b3('0x48')](handleError(_0x5db6a9,null));};exports[_0xa2b3('0x56')]=function(_0x1c1a19,_0x26adfb,_0x3f7130){if(_0x1c1a19['body']['id']){delete _0x1c1a19[_0xa2b3('0x46')]['id'];}return db[_0xa2b3('0x29')]['find']({'where':{'id':_0x1c1a19['params']['id']}})[_0xa2b3('0x21')](handleEntityNotFound(_0x26adfb,null))[_0xa2b3('0x21')](function(_0x3c3db8){if(_0x3c3db8){_0x1c1a19[_0xa2b3('0x46')][_0xa2b3('0x57')]=_0x3c3db8['id'];return db[_0xa2b3('0x4b')][_0xa2b3('0x44')](_0x1c1a19[_0xa2b3('0x46')]);}})[_0xa2b3('0x21')](respondWithResult(_0x26adfb,null))[_0xa2b3('0x48')](handleError(_0x26adfb,null));};exports[_0xa2b3('0x58')]=function(_0x5bb9f4,_0x4199ae,_0x321255){var _0x4a0fae={};var _0x39c272={};var _0x391381;var _0x51a96a;return db[_0xa2b3('0x29')][_0xa2b3('0x52')]({'where':{'id':_0x5bb9f4[_0xa2b3('0x47')]['id']}})[_0xa2b3('0x21')](handleEntityNotFound(_0x4199ae,null))['then'](function(_0x20c306){if(_0x20c306){_0x391381=_0x20c306;_0x39c272[_0xa2b3('0x2c')]=_[_0xa2b3('0x41')](db[_0xa2b3('0x4b')][_0xa2b3('0x42')]);_0x39c272[_0xa2b3('0x2d')]=_[_0xa2b3('0x41')](_0x5bb9f4['query']);_0x39c272[_0xa2b3('0x2e')]=_[_0xa2b3('0x2f')](_0x39c272[_0xa2b3('0x2c')],_0x39c272['query']);_0x4a0fae[_0xa2b3('0x30')]=_[_0xa2b3('0x2f')](_0x39c272[_0xa2b3('0x2c')],qs[_0xa2b3('0x31')](_0x5bb9f4[_0xa2b3('0x2d')]['fields']));_0x4a0fae[_0xa2b3('0x30')]=_0x4a0fae['attributes']['length']?_0x4a0fae[_0xa2b3('0x30')]:_0x39c272[_0xa2b3('0x2c')];_0x4a0fae[_0xa2b3('0x34')]=qs['sort'](_0x5bb9f4[_0xa2b3('0x2d')][_0xa2b3('0x35')]);_0x4a0fae['where']=qs[_0xa2b3('0x2e')](_[_0xa2b3('0x37')](_0x5bb9f4[_0xa2b3('0x2d')],_0x39c272[_0xa2b3('0x2e')]));if(_0x5bb9f4[_0xa2b3('0x2d')]['filter']){_0x4a0fae['where']=_[_0xa2b3('0x39')](_0x4a0fae[_0xa2b3('0x36')],{'$or':_[_0xa2b3('0x28')](_0x4a0fae['attributes'],function(_0x313bd9){var _0x100f2e={};_0x100f2e[_0x313bd9]={'$like':'%'+_0x5bb9f4['query']['filter']+'%'};return _0x100f2e;})});}if(_0x5bb9f4['query']['$gte']){var _0x21bfc0=_0x5bb9f4[_0xa2b3('0x2d')][_0xa2b3('0x59')][_0xa2b3('0x5a')](',');var _0x45b9a8={};_0x45b9a8[_0x21bfc0[0x0]]={'$gte':moment(_0x21bfc0[0x1])[_0xa2b3('0x5b')](_0xa2b3('0x5c'))};_0x4a0fae[_0xa2b3('0x36')]=_[_0xa2b3('0x39')](_0x4a0fae[_0xa2b3('0x36')],_0x45b9a8);}_0x4a0fae=_['merge']({},_0x4a0fae,_0x5bb9f4[_0xa2b3('0x3b')]);return _0x391381[_0xa2b3('0x58')](_0x4a0fae);}})[_0xa2b3('0x21')](function(_0xe7ab62){if(_0xe7ab62){_0x51a96a=_0xe7ab62[_0xa2b3('0x43')];if(!_0x5bb9f4[_0xa2b3('0x2d')][_0xa2b3('0x32')](_0xa2b3('0x33'))){_0x4a0fae[_0xa2b3('0x1b')]=qs['limit'](_0x5bb9f4['query'][_0xa2b3('0x1b')]);_0x4a0fae['offset']=qs[_0xa2b3('0x1d')](_0x5bb9f4['query'][_0xa2b3('0x1d')]);}return _0x391381[_0xa2b3('0x58')](_0x4a0fae);}})[_0xa2b3('0x21')](function(_0x33713c){if(_0x33713c){return _0x33713c?{'count':_0x51a96a,'rows':_0x33713c}:null;}})[_0xa2b3('0x21')](respondWithResult(_0x4199ae,null))[_0xa2b3('0x48')](handleError(_0x4199ae,null));};
\ No newline at end of file
+var _0xd7f0=['describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','error','stack','name','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','params','find','create','body','update'];(function(_0x22e626,_0x111a4d){var _0x3e8e50=function(_0x17302a){while(--_0x17302a){_0x22e626['push'](_0x22e626['shift']());}};_0x3e8e50(++_0x111a4d);}(_0xd7f0,0x6d));var _0x0d7f=function(_0x596388,_0x18ffc8){_0x596388=_0x596388-0x0;var _0x447936=_0xd7f0[_0x596388];return _0x447936;};'use strict';var emlformat=require(_0x0d7f('0x0'));var rimraf=require(_0x0d7f('0x1'));var zipdir=require(_0x0d7f('0x2'));var jsonpatch=require(_0x0d7f('0x3'));var rp=require(_0x0d7f('0x4'));var moment=require('moment');var BPromise=require(_0x0d7f('0x5'));var Mustache=require(_0x0d7f('0x6'));var util=require(_0x0d7f('0x7'));var path=require(_0x0d7f('0x8'));var sox=require('sox');var csv=require(_0x0d7f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d7f('0xa'));var _=require(_0x0d7f('0xb'));var squel=require(_0x0d7f('0xc'));var crypto=require(_0x0d7f('0xd'));var jsforce=require(_0x0d7f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d7f('0x9'));var querystring=require(_0x0d7f('0xf'));var Papa=require(_0x0d7f('0x10'));var Redis=require(_0x0d7f('0x11'));var authService=require(_0x0d7f('0x12'));var qs=require(_0x0d7f('0x13'));var as=require(_0x0d7f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0d7f('0x15'));var utils=require(_0x0d7f('0x16'));var config=require(_0x0d7f('0x17'));var licenseUtil=require(_0x0d7f('0x18'));var db=require('../../mysqldb')['db'];config[_0x0d7f('0x19')]=_[_0x0d7f('0x1a')](config[_0x0d7f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d7f('0x1b'))(new Redis(config[_0x0d7f('0x19')]));require(_0x0d7f('0x1c'))[_0x0d7f('0x1d')](socket);function respondWithStatusCode(_0x8f4dfb,_0x16a5c7){_0x16a5c7=_0x16a5c7||0xcc;return function(_0x45ba84){if(_0x45ba84){return _0x8f4dfb[_0x0d7f('0x1e')](_0x16a5c7);}return _0x8f4dfb[_0x0d7f('0x1f')](_0x16a5c7)[_0x0d7f('0x20')]();};}function respondWithResult(_0x50ac37,_0x551263){_0x551263=_0x551263||0xc8;return function(_0x1aae60){if(_0x1aae60){return _0x50ac37[_0x0d7f('0x1f')](_0x551263)[_0x0d7f('0x21')](_0x1aae60);}};}function respondWithFilteredResult(_0x1d8de1,_0x353154){return function(_0x456f12){if(_0x456f12){var _0x42b8c8=typeof _0x353154[_0x0d7f('0x22')]===_0x0d7f('0x23')&&typeof _0x353154[_0x0d7f('0x24')]===_0x0d7f('0x23');var _0x3adc37=_0x456f12[_0x0d7f('0x25')];var _0x1992b8=_0x42b8c8?0x0:_0x353154[_0x0d7f('0x22')];var _0x11d961=_0x42b8c8?_0x456f12[_0x0d7f('0x25')]:_0x353154[_0x0d7f('0x22')]+_0x353154['limit'];var _0x19355d;if(_0x11d961>=_0x3adc37){_0x11d961=_0x3adc37;_0x19355d=0xc8;}else{_0x19355d=0xce;}_0x1d8de1['status'](_0x19355d);return _0x1d8de1['set'](_0x0d7f('0x26'),_0x1992b8+'-'+_0x11d961+'/'+_0x3adc37)[_0x0d7f('0x21')](_0x456f12);}return null;};}function patchUpdates(_0x2debcc){return function(_0x3426db){try{jsonpatch['apply'](_0x3426db,_0x2debcc,!![]);}catch(_0xdda3cb){return BPromise[_0x0d7f('0x27')](_0xdda3cb);}return _0x3426db['save']();};}function saveUpdates(_0x5c5e4c,_0x1fb68c){return function(_0x248710){if(_0x248710){return _0x248710['update'](_0x5c5e4c)['then'](function(_0x2945b4){return _0x2945b4;});}return null;};}function removeEntity(_0x29b58d,_0x55edf8){return function(_0x5551c7){if(_0x5551c7){return _0x5551c7['destroy']()['then'](function(){_0x29b58d[_0x0d7f('0x1f')](0xcc)[_0x0d7f('0x20')]();});}};}function handleEntityNotFound(_0x2d9561,_0x43e3a9){return function(_0xd8884d){if(!_0xd8884d){_0x2d9561[_0x0d7f('0x1e')](0x194);}return _0xd8884d;};}function handleError(_0x4d940d,_0x39ec8d){_0x39ec8d=_0x39ec8d||0x1f4;return function(_0x31dbe5){logger[_0x0d7f('0x28')](_0x31dbe5[_0x0d7f('0x29')]);if(_0x31dbe5[_0x0d7f('0x2a')]){delete _0x31dbe5[_0x0d7f('0x2a')];}_0x4d940d[_0x0d7f('0x1f')](_0x39ec8d)['send'](_0x31dbe5);};}exports['index']=function(_0x5eed5c,_0x1c2360){var _0x4d069c={},_0x3b7411={},_0x519030={'count':0x0,'rows':[]};var _0x5acc2a=_[_0x0d7f('0x2b')](db[_0x0d7f('0x2c')][_0x0d7f('0x2d')],function(_0x5546a4){return{'name':_0x5546a4[_0x0d7f('0x2e')],'type':_0x5546a4[_0x0d7f('0x2f')]['key']};});_0x3b7411[_0x0d7f('0x30')]=_['map'](_0x5acc2a,_0x0d7f('0x2a'));_0x3b7411[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x5eed5c[_0x0d7f('0x31')]);_0x3b7411[_0x0d7f('0x33')]=_['intersection'](_0x3b7411[_0x0d7f('0x30')],_0x3b7411[_0x0d7f('0x31')]);_0x4d069c['attributes']=_[_0x0d7f('0x34')](_0x3b7411['model'],qs[_0x0d7f('0x35')](_0x5eed5c[_0x0d7f('0x31')][_0x0d7f('0x35')]));_0x4d069c[_0x0d7f('0x36')]=_0x4d069c[_0x0d7f('0x36')][_0x0d7f('0x37')]?_0x4d069c[_0x0d7f('0x36')]:_0x3b7411[_0x0d7f('0x30')];if(!_0x5eed5c[_0x0d7f('0x31')]['hasOwnProperty'](_0x0d7f('0x38'))){_0x4d069c['limit']=qs[_0x0d7f('0x24')](_0x5eed5c['query'][_0x0d7f('0x24')]);_0x4d069c[_0x0d7f('0x22')]=qs[_0x0d7f('0x22')](_0x5eed5c[_0x0d7f('0x31')][_0x0d7f('0x22')]);}_0x4d069c[_0x0d7f('0x39')]=qs[_0x0d7f('0x3a')](_0x5eed5c['query'][_0x0d7f('0x3a')]);_0x4d069c[_0x0d7f('0x3b')]=qs['filters'](_[_0x0d7f('0x3c')](_0x5eed5c['query'],_0x3b7411[_0x0d7f('0x33')]),_0x5acc2a);if(_0x5eed5c['query'][_0x0d7f('0x3d')]){_0x4d069c[_0x0d7f('0x3b')]=_['merge'](_0x4d069c[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x2b')](_0x5acc2a,function(_0x5ba94c){if(_0x5ba94c['type']!==_0x0d7f('0x3e')){var _0x53c2da={};_0x53c2da[_0x5ba94c['name']]={'$like':'%'+_0x5eed5c[_0x0d7f('0x31')]['filter']+'%'};return _0x53c2da;}})});}_0x4d069c=_[_0x0d7f('0x3f')]({},_0x4d069c,_0x5eed5c[_0x0d7f('0x40')]);var _0x1ec364={'where':_0x4d069c[_0x0d7f('0x3b')]};return db[_0x0d7f('0x2c')][_0x0d7f('0x25')](_0x1ec364)[_0x0d7f('0x41')](function(_0x350651){_0x519030[_0x0d7f('0x25')]=_0x350651;if(_0x5eed5c[_0x0d7f('0x31')][_0x0d7f('0x42')]){_0x4d069c[_0x0d7f('0x43')]=[{'all':!![]}];}return db[_0x0d7f('0x2c')][_0x0d7f('0x44')](_0x4d069c);})[_0x0d7f('0x41')](function(_0x2b74f5){_0x519030['rows']=_0x2b74f5;return _0x519030;})[_0x0d7f('0x41')](respondWithFilteredResult(_0x1c2360,_0x4d069c))[_0x0d7f('0x45')](handleError(_0x1c2360,null));};exports['show']=function(_0x4eaa5c,_0x3763ab){var _0x40fec5={'raw':!![],'where':{'id':_0x4eaa5c[_0x0d7f('0x46')]['id']}},_0x1b5e6e={};_0x1b5e6e['model']=_[_0x0d7f('0x32')](db[_0x0d7f('0x2c')][_0x0d7f('0x2d')]);_0x1b5e6e[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x4eaa5c[_0x0d7f('0x31')]);_0x1b5e6e[_0x0d7f('0x33')]=_[_0x0d7f('0x34')](_0x1b5e6e[_0x0d7f('0x30')],_0x1b5e6e[_0x0d7f('0x31')]);_0x40fec5[_0x0d7f('0x36')]=_[_0x0d7f('0x34')](_0x1b5e6e['model'],qs[_0x0d7f('0x35')](_0x4eaa5c[_0x0d7f('0x31')][_0x0d7f('0x35')]));_0x40fec5['attributes']=_0x40fec5['attributes'][_0x0d7f('0x37')]?_0x40fec5[_0x0d7f('0x36')]:_0x1b5e6e[_0x0d7f('0x30')];if(_0x4eaa5c['query'][_0x0d7f('0x42')]){_0x40fec5[_0x0d7f('0x43')]=[{'all':!![]}];}_0x40fec5=_['merge']({},_0x40fec5,_0x4eaa5c[_0x0d7f('0x40')]);return db[_0x0d7f('0x2c')][_0x0d7f('0x47')](_0x40fec5)['then'](handleEntityNotFound(_0x3763ab,null))['then'](respondWithResult(_0x3763ab,null))[_0x0d7f('0x45')](handleError(_0x3763ab,null));};exports[_0x0d7f('0x48')]=function(_0x9ffb8f,_0x157772){return db['ChatGroup'][_0x0d7f('0x48')](_0x9ffb8f[_0x0d7f('0x49')],{})[_0x0d7f('0x41')](respondWithResult(_0x157772,0xc9))[_0x0d7f('0x45')](handleError(_0x157772,null));};exports[_0x0d7f('0x4a')]=function(_0x4bd420,_0xfd30ff){if(_0x4bd420[_0x0d7f('0x49')]['id']){delete _0x4bd420[_0x0d7f('0x49')]['id'];}return db[_0x0d7f('0x2c')]['find']({'where':{'id':_0x4bd420[_0x0d7f('0x46')]['id']}})['then'](handleEntityNotFound(_0xfd30ff,null))[_0x0d7f('0x41')](saveUpdates(_0x4bd420['body'],null))[_0x0d7f('0x41')](respondWithResult(_0xfd30ff,null))[_0x0d7f('0x45')](handleError(_0xfd30ff,null));};exports['destroy']=function(_0x15f6a5,_0x3fcdb6){return db['ChatGroup'][_0x0d7f('0x47')]({'where':{'id':_0x15f6a5['params']['id']}})['then'](handleEntityNotFound(_0x3fcdb6,null))[_0x0d7f('0x41')](removeEntity(_0x3fcdb6,null))[_0x0d7f('0x45')](handleError(_0x3fcdb6,null));};exports['describe']=function(_0x2b6320,_0x394fb8){return db['ChatGroup'][_0x0d7f('0x4b')]()[_0x0d7f('0x41')](respondWithResult(_0x394fb8,null))[_0x0d7f('0x45')](handleError(_0x394fb8,null));};exports[_0x0d7f('0x4c')]=function(_0x101058,_0x2014f5,_0xe166ae){return db[_0x0d7f('0x4d')][_0x0d7f('0x25')]({'where':{'ChatGroupId':_0x101058['params']['id'],'ToId':_0x101058['user']['id'],'read':![]}})[_0x0d7f('0x41')](function(_0x5088c2){return{'id':_[_0x0d7f('0x4e')](_0x101058[_0x0d7f('0x46')]['id']),'count':_0x5088c2};})[_0x0d7f('0x41')](respondWithResult(_0x2014f5,null))[_0x0d7f('0x45')](handleError(_0x2014f5,null));};exports['addMembers']=function(_0x428b6f,_0x3a56ce,_0x46fd42){return db[_0x0d7f('0x2c')][_0x0d7f('0x47')]({'where':{'id':_0x428b6f['params']['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x3a56ce,null))['then'](function(_0x1bade3){if(_0x1bade3){return _0x1bade3[_0x0d7f('0x4f')](_0x428b6f[_0x0d7f('0x49')][_0x0d7f('0x50')],_[_0x0d7f('0x51')](_0x428b6f[_0x0d7f('0x49')],[_0x0d7f('0x50'),'id'])||{});}})['then'](respondWithResult(_0x3a56ce,null))['catch'](handleError(_0x3a56ce,null));};exports['getMembers']=function(_0x2a34b5,_0x151e2c,_0x1bb7d3){var _0x41d2d6={};var _0x1d453a={};var _0x2630bc;var _0x2e55a1;return db['ChatGroup']['findOne']({'where':{'id':_0x2a34b5[_0x0d7f('0x46')]['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x151e2c,null))[_0x0d7f('0x41')](function(_0x529bf4){if(_0x529bf4){_0x2630bc=_0x529bf4;_0x1d453a[_0x0d7f('0x30')]=_[_0x0d7f('0x32')](db[_0x0d7f('0x52')]['rawAttributes']);_0x1d453a[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x2a34b5[_0x0d7f('0x31')]);_0x1d453a[_0x0d7f('0x33')]=_[_0x0d7f('0x34')](_0x1d453a[_0x0d7f('0x30')],_0x1d453a[_0x0d7f('0x31')]);_0x41d2d6[_0x0d7f('0x36')]=_['intersection'](_0x1d453a[_0x0d7f('0x30')],qs['fields'](_0x2a34b5[_0x0d7f('0x31')][_0x0d7f('0x35')]));_0x41d2d6[_0x0d7f('0x36')]=_0x41d2d6[_0x0d7f('0x36')][_0x0d7f('0x37')]?_0x41d2d6[_0x0d7f('0x36')]:_0x1d453a[_0x0d7f('0x30')];_0x41d2d6[_0x0d7f('0x39')]=qs[_0x0d7f('0x3a')](_0x2a34b5[_0x0d7f('0x31')][_0x0d7f('0x3a')]);_0x41d2d6[_0x0d7f('0x3b')]=qs['filters'](_[_0x0d7f('0x3c')](_0x2a34b5[_0x0d7f('0x31')],_0x1d453a[_0x0d7f('0x33')]));if(_0x2a34b5[_0x0d7f('0x31')]['filter']){_0x41d2d6['where']=_[_0x0d7f('0x3f')](_0x41d2d6[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x2b')](_0x41d2d6[_0x0d7f('0x36')],function(_0x1a5d0e){var _0x4fcb97={};_0x4fcb97[_0x1a5d0e]={'$like':'%'+_0x2a34b5[_0x0d7f('0x31')]['filter']+'%'};return _0x4fcb97;})});}_0x41d2d6=_['merge']({},_0x41d2d6,_0x2a34b5[_0x0d7f('0x40')]);return _0x2630bc[_0x0d7f('0x53')](_0x41d2d6);}})['then'](function(_0x250cb8){if(_0x250cb8){_0x2e55a1=_0x250cb8[_0x0d7f('0x37')];if(!_0x2a34b5[_0x0d7f('0x31')]['hasOwnProperty']('nolimit')){_0x41d2d6['limit']=qs[_0x0d7f('0x24')](_0x2a34b5[_0x0d7f('0x31')][_0x0d7f('0x24')]);_0x41d2d6[_0x0d7f('0x22')]=qs[_0x0d7f('0x22')](_0x2a34b5['query'][_0x0d7f('0x22')]);}return _0x2630bc['getMembers'](_0x41d2d6);}})[_0x0d7f('0x41')](function(_0x5ac5e4){if(_0x5ac5e4){return _0x5ac5e4?{'count':_0x2e55a1,'rows':_0x5ac5e4}:null;}})[_0x0d7f('0x41')](respondWithResult(_0x151e2c,null))[_0x0d7f('0x45')](handleError(_0x151e2c,null));};exports[_0x0d7f('0x54')]=function(_0x43f7d0,_0x36bb1b,_0x35d9f7){return db[_0x0d7f('0x2c')][_0x0d7f('0x47')]({'where':{'id':_0x43f7d0[_0x0d7f('0x46')]['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x36bb1b,null))[_0x0d7f('0x41')](function(_0x176eb3){if(_0x176eb3){return _0x176eb3[_0x0d7f('0x54')](_0x43f7d0[_0x0d7f('0x31')][_0x0d7f('0x50')]);}})[_0x0d7f('0x41')](respondWithStatusCode(_0x36bb1b,null))['catch'](handleError(_0x36bb1b,null));};exports[_0x0d7f('0x55')]=function(_0x23a9ff,_0x441592,_0xfb53df){if(_0x23a9ff[_0x0d7f('0x49')]['id']){delete _0x23a9ff['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x23a9ff[_0x0d7f('0x46')]['id']}})[_0x0d7f('0x41')](handleEntityNotFound(_0x441592,null))['then'](function(_0x125bbe){if(_0x125bbe){_0x23a9ff['body'][_0x0d7f('0x56')]=_0x125bbe['id'];return db['ChatInternalMessage'][_0x0d7f('0x48')](_0x23a9ff[_0x0d7f('0x49')]);}})[_0x0d7f('0x41')](respondWithResult(_0x441592,null))[_0x0d7f('0x45')](handleError(_0x441592,null));};exports[_0x0d7f('0x57')]=function(_0x9e9474,_0x2b73d9,_0x3f0bf1){var _0xbefb1e={};var _0x42ef91={};var _0x36b182;var _0x1316ab;return db[_0x0d7f('0x2c')]['findOne']({'where':{'id':_0x9e9474[_0x0d7f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b73d9,null))[_0x0d7f('0x41')](function(_0x44d3c6){if(_0x44d3c6){_0x36b182=_0x44d3c6;_0x42ef91[_0x0d7f('0x30')]=_[_0x0d7f('0x32')](db[_0x0d7f('0x4d')][_0x0d7f('0x2d')]);_0x42ef91[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x9e9474['query']);_0x42ef91[_0x0d7f('0x33')]=_[_0x0d7f('0x34')](_0x42ef91[_0x0d7f('0x30')],_0x42ef91[_0x0d7f('0x31')]);_0xbefb1e[_0x0d7f('0x36')]=_[_0x0d7f('0x34')](_0x42ef91['model'],qs[_0x0d7f('0x35')](_0x9e9474['query'][_0x0d7f('0x35')]));_0xbefb1e[_0x0d7f('0x36')]=_0xbefb1e['attributes'][_0x0d7f('0x37')]?_0xbefb1e[_0x0d7f('0x36')]:_0x42ef91[_0x0d7f('0x30')];_0xbefb1e['order']=qs['sort'](_0x9e9474['query'][_0x0d7f('0x3a')]);_0xbefb1e[_0x0d7f('0x3b')]=qs['filters'](_[_0x0d7f('0x3c')](_0x9e9474[_0x0d7f('0x31')],_0x42ef91[_0x0d7f('0x33')]));if(_0x9e9474['query'][_0x0d7f('0x3d')]){_0xbefb1e['where']=_[_0x0d7f('0x3f')](_0xbefb1e[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x2b')](_0xbefb1e[_0x0d7f('0x36')],function(_0x5cfcac){var _0x1f2bf5={};_0x1f2bf5[_0x5cfcac]={'$like':'%'+_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x3d')]+'%'};return _0x1f2bf5;})});}if(_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x58')]){var _0x5f211e=_0x9e9474['query']['$gte'][_0x0d7f('0x59')](',');var _0x349523={};_0x349523[_0x5f211e[0x0]]={'$gte':moment(_0x5f211e[0x1])[_0x0d7f('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0xbefb1e[_0x0d7f('0x3b')]=_[_0x0d7f('0x3f')](_0xbefb1e[_0x0d7f('0x3b')],_0x349523);}_0xbefb1e=_[_0x0d7f('0x3f')]({},_0xbefb1e,_0x9e9474[_0x0d7f('0x40')]);return _0x36b182[_0x0d7f('0x57')](_0xbefb1e);}})['then'](function(_0x30b190){if(_0x30b190){_0x1316ab=_0x30b190['length'];if(!_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x5b')](_0x0d7f('0x38'))){_0xbefb1e['limit']=qs[_0x0d7f('0x24')](_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x24')]);_0xbefb1e[_0x0d7f('0x22')]=qs[_0x0d7f('0x22')](_0x9e9474[_0x0d7f('0x31')][_0x0d7f('0x22')]);}return _0x36b182[_0x0d7f('0x57')](_0xbefb1e);}})[_0x0d7f('0x41')](function(_0x151a5e){if(_0x151a5e){return _0x151a5e?{'count':_0x1316ab,'rows':_0x151a5e}:null;}})[_0x0d7f('0x41')](respondWithResult(_0x2b73d9,null))['catch'](handleError(_0x2b73d9,null));};
\ No newline at end of file
index 2da83ba..8fcea22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e25=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','save','update','remove'];(function(_0x2e4e42,_0x5cf446){var _0x21373d=function(_0x271ce7){while(--_0x271ce7){_0x2e4e42['push'](_0x2e4e42['shift']());}};_0x21373d(++_0x5cf446);}(_0x4e25,0x175));var _0x54e2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4e25[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x54e2('0x0'))['db'][_0x54e2('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54e2('0x2'),'afterUpdate':_0x54e2('0x3'),'afterDestroy':_0x54e2('0x4')};function emitEvent(_0x49225e){return function(_0x22416a,_0x4bb755,_0x2cdfd1){ChatGroupEvents[_0x54e2('0x5')](_0x49225e+':'+_0x22416a['id'],_0x22416a);ChatGroupEvents[_0x54e2('0x5')](_0x49225e,_0x22416a);_0x2cdfd1(null);};}for(var e in events){if(events[_0x54e2('0x6')](e)){var event=events[e];ChatGroup[_0x54e2('0x7')](e,emitEvent(event));}}module[_0x54e2('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x7d5d=['exports','../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty'];(function(_0x408a32,_0x5d7184){var _0x10a934=function(_0x5791e9){while(--_0x5791e9){_0x408a32['push'](_0x408a32['shift']());}};_0x10a934(++_0x5d7184);}(_0x7d5d,0x1dd));var _0xd7d5=function(_0x5669f6,_0x2b4029){_0x5669f6=_0x5669f6-0x0;var _0x1cf487=_0x7d5d[_0x5669f6];return _0x1cf487;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xd7d5('0x0'))['db'][_0xd7d5('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd7d5('0x2'),'afterDestroy':_0xd7d5('0x3')};function emitEvent(_0x2948ca){return function(_0x5ce3bf,_0x236433,_0x26fd7b){ChatGroupEvents[_0xd7d5('0x4')](_0x2948ca+':'+_0x5ce3bf['id'],_0x5ce3bf);ChatGroupEvents[_0xd7d5('0x4')](_0x2948ca,_0x5ce3bf);_0x26fd7b(null);};}for(var e in events){if(events[_0xd7d5('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd7d5('0x6')]=ChatGroupEvents;
\ No newline at end of file
index 14f224d..ee33ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3941=['bluebird','path','exports','define','chat_groups','lodash','../../config/logger','api','moment'];(function(_0x12fa20,_0x4e0bc9){var _0x5939e7=function(_0x5a0654){while(--_0x5a0654){_0x12fa20['push'](_0x12fa20['shift']());}};_0x5939e7(++_0x4e0bc9);}(_0x3941,0x8c));var _0x1394=function(_0x4b58a1,_0x2a3b72){_0x4b58a1=_0x4b58a1-0x0;var _0x2fa1ce=_0x3941[_0x4b58a1];return _0x2fa1ce;};'use strict';var _=require(_0x1394('0x0'));var util=require('util');var logger=require(_0x1394('0x1'))(_0x1394('0x2'));var moment=require(_0x1394('0x3'));var BPromise=require(_0x1394('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1394('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x1394('0x6')]=function(_0x2caefd,_0x411a7a){return _0x2caefd[_0x1394('0x7')]('ChatGroup',attributes,{'tableName':_0x1394('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d80=['path','rimraf','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d80,0x1e9));var _0x01d8=function(_0x56dbed,_0x3426c1){_0x56dbed=_0x56dbed-0x0;var _0x317998=_0x1d80[_0x56dbed];return _0x317998;};'use strict';var _=require(_0x01d8('0x0'));var util=require(_0x01d8('0x1'));var logger=require(_0x01d8('0x2'))(_0x01d8('0x3'));var moment=require(_0x01d8('0x4'));var BPromise=require(_0x01d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01d8('0x6'));var rimraf=require(_0x01d8('0x7'));var config=require('../../config/environment');var attributes=require(_0x01d8('0x8'));module['exports']=function(_0x5c9b9d,_0x4ca053){return _0x5c9b9d[_0x01d8('0x9')]('ChatGroup',attributes,{'tableName':_0x01d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bf4adf7..4be8bda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fb8=['redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x390179,_0x57d465){var _0x363afa=function(_0x42bc6e){while(--_0x42bc6e){_0x390179['push'](_0x390179['shift']());}};_0x363afa(++_0x57d465);}(_0x6fb8,0x104));var _0x86fb=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x6fb8[_0x3d5df9];return _0x50ba39;};'use strict';var _=require(_0x86fb('0x0'));var util=require('util');var moment=require(_0x86fb('0x1'));var BPromise=require(_0x86fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86fb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x86fb('0x4'))(_0x86fb('0x5'));var config=require(_0x86fb('0x6'));var jayson=require(_0x86fb('0x7'));var client=jayson[_0x86fb('0x8')][_0x86fb('0x9')]({'port':0x232a});config[_0x86fb('0xa')]=_[_0x86fb('0xb')](config[_0x86fb('0xa')],{'host':_0x86fb('0xc'),'port':0x18eb});var socket=require(_0x86fb('0xd'))(new Redis(config[_0x86fb('0xa')]));require(_0x86fb('0xe'))['register'](socket);function respondWithRpcPromise(_0x443829,_0x57a245,_0x441a58){return new BPromise(function(_0x2c35c8,_0x2abe66){return client['request'](_0x443829,_0x441a58)[_0x86fb('0xf')](function(_0x56e431){logger[_0x86fb('0x10')](_0x86fb('0x11'),_0x57a245,_0x86fb('0x12'));logger[_0x86fb('0x13')](_0x86fb('0x14'),_0x57a245,_0x86fb('0x12'),JSON[_0x86fb('0x15')](_0x56e431));if(_0x56e431[_0x86fb('0x16')]){if(_0x56e431[_0x86fb('0x16')][_0x86fb('0x17')]===0x1f4){logger['error'](_0x86fb('0x11'),_0x57a245,_0x56e431['error'][_0x86fb('0x18')]);return _0x2abe66(_0x56e431[_0x86fb('0x16')]['message']);}logger[_0x86fb('0x16')](_0x86fb('0x11'),_0x57a245,_0x56e431[_0x86fb('0x16')][_0x86fb('0x18')]);return _0x2c35c8(_0x56e431[_0x86fb('0x16')]['message']);}else{logger[_0x86fb('0x10')](_0x86fb('0x11'),_0x57a245,_0x86fb('0x12'));_0x2c35c8(_0x56e431[_0x86fb('0x19')][_0x86fb('0x18')]);}})[_0x86fb('0x1a')](function(_0x10fd7e){logger['error'](_0x86fb('0x11'),_0x57a245,_0x10fd7e);_0x2abe66(_0x10fd7e);});});}
\ No newline at end of file
+var _0x56e7=['defaults','localhost','./chatGroup.socket','register','request','info','debug','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x55383a,_0x5636bf){var _0x3ec492=function(_0x43574b){while(--_0x43574b){_0x55383a['push'](_0x55383a['shift']());}};_0x3ec492(++_0x5636bf);}(_0x56e7,0x7b));var _0x756e=function(_0x217864,_0x183226){_0x217864=_0x217864-0x0;var _0x58d26f=_0x56e7[_0x217864];return _0x58d26f;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var BPromise=require('bluebird');var rs=require(_0x756e('0x2'));var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});config[_0x756e('0xb')]=_[_0x756e('0xc')](config['redis'],{'host':_0x756e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x756e('0xb')]));require(_0x756e('0xe'))[_0x756e('0xf')](socket);function respondWithRpcPromise(_0x4738dc,_0x4adf8f,_0x5d5b90){return new BPromise(function(_0x324d36,_0x2be615){return client[_0x756e('0x10')](_0x4738dc,_0x5d5b90)['then'](function(_0x330076){logger[_0x756e('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4adf8f,'request\x20sent');logger[_0x756e('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4adf8f,_0x756e('0x13'),JSON[_0x756e('0x14')](_0x330076));if(_0x330076[_0x756e('0x15')]){if(_0x330076[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x2be615(_0x330076[_0x756e('0x15')]['message']);}logger['error'](_0x756e('0x18'),_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x324d36(_0x330076[_0x756e('0x15')][_0x756e('0x17')]);}else{logger[_0x756e('0x11')](_0x756e('0x18'),_0x4adf8f,_0x756e('0x13'));_0x324d36(_0x330076[_0x756e('0x19')]['message']);}})[_0x756e('0x1a')](function(_0x47c3c4){logger['error'](_0x756e('0x18'),_0x4adf8f,_0x47c3c4);_0x2be615(_0x47c3c4);});});}
\ No newline at end of file
index d82e709..7fd2fa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecdb=['save','emit','removeListener','length','./chatGroup.events'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xecdb,0x1e4));var _0xbecd=function(_0x916fd1,_0x195db2){_0x916fd1=_0x916fd1-0x0;var _0xd5cc30=_0xecdb[_0x916fd1];return _0xd5cc30;};'use strict';var ChatGroupEvents=require(_0xbecd('0x0'));var events=[_0xbecd('0x1'),'remove','update'];function createListener(_0x2acfe1,_0x50a1df){return function(_0x395a41){_0x50a1df[_0xbecd('0x2')](_0x2acfe1,_0x395a41);};}function removeListener(_0x52f700,_0x24d0c2){return function(){ChatGroupEvents[_0xbecd('0x3')](_0x52f700,_0x24d0c2);};}exports['register']=function(_0xee7ef){for(var _0x4f1c19=0x0,_0x28a089=events[_0xbecd('0x4')];_0x4f1c19<_0x28a089;_0x4f1c19++){var _0x31c82c=events[_0x4f1c19];var _0x34d9d1=createListener('chatGroup:'+_0x31c82c,_0xee7ef);ChatGroupEvents['on'](_0x31c82c,_0x34d9d1);}};
\ No newline at end of file
+var _0xcab1=['emit','register','./chatGroup.events','save','remove','update'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xcab1,0xe0));var _0x1cab=function(_0x4cc40f,_0x1ad2ed){_0x4cc40f=_0x4cc40f-0x0;var _0x335cc3=_0xcab1[_0x4cc40f];return _0x335cc3;};'use strict';var ChatGroupEvents=require(_0x1cab('0x0'));var events=[_0x1cab('0x1'),_0x1cab('0x2'),_0x1cab('0x3')];function createListener(_0x2019f1,_0xfd873b){return function(_0x1d6b04){_0xfd873b[_0x1cab('0x4')](_0x2019f1,_0x1d6b04);};}function removeListener(_0x4aa18e,_0x2d1856){return function(){ChatGroupEvents['removeListener'](_0x4aa18e,_0x2d1856);};}exports[_0x1cab('0x5')]=function(_0x5db393){for(var _0x22934a=0x0,_0x10341e=events['length'];_0x22934a<_0x10341e;_0x22934a++){var _0x57438b=events[_0x22934a];var _0x20343a=createListener('chatGroup:'+_0x57438b,_0x5db393);ChatGroupEvents['on'](_0x57438b,_0x20343a);}};
\ No newline at end of file
index 3409a03..d9cb415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd9=['show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','/:id'];(function(_0x5d22d2,_0x3035a6){var _0x475864=function(_0x51782a){while(--_0x51782a){_0x5d22d2['push'](_0x5d22d2['shift']());}};_0x475864(++_0x3035a6);}(_0xfcd9,0x77));var _0x9fcd=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0xfcd9[_0x541095];return _0x5a2c40;};'use strict';var multer=require(_0x9fcd('0x0'));var util=require(_0x9fcd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9fcd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9fcd('0x3'));var interaction=require(_0x9fcd('0x4'));var config=require(_0x9fcd('0x5'));var controller=require(_0x9fcd('0x6'));router[_0x9fcd('0x7')]('/',auth[_0x9fcd('0x8')](),controller['index']);router[_0x9fcd('0x7')](_0x9fcd('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x9fcd('0x7')](_0x9fcd('0xa'),auth[_0x9fcd('0x8')](),controller[_0x9fcd('0xb')]);router[_0x9fcd('0x7')](_0x9fcd('0xc'),auth[_0x9fcd('0x8')](),controller['getUnread']);router[_0x9fcd('0x7')](_0x9fcd('0xd'),auth[_0x9fcd('0x8')](),controller[_0x9fcd('0xe')]);router[_0x9fcd('0x7')](_0x9fcd('0xf'),auth['isAuthenticated'](),controller[_0x9fcd('0x10')]);router[_0x9fcd('0x11')]('/',auth['isAuthenticated'](),controller[_0x9fcd('0x12')]);router[_0x9fcd('0x11')](_0x9fcd('0xd'),auth['isAuthenticated'](),controller['addMembers']);router[_0x9fcd('0x11')](_0x9fcd('0xf'),auth[_0x9fcd('0x8')](),controller[_0x9fcd('0x13')]);router[_0x9fcd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9fcd('0x15')]);router[_0x9fcd('0x16')](_0x9fcd('0xa'),auth[_0x9fcd('0x8')](),controller[_0x9fcd('0x17')]);router[_0x9fcd('0x16')](_0x9fcd('0xd'),auth[_0x9fcd('0x8')](),controller[_0x9fcd('0x18')]);module[_0x9fcd('0x19')]=router;
\ No newline at end of file
+var _0x1e75=['index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x2392b4,_0x332bfa){var _0x5148ff=function(_0x5e6d4d){while(--_0x5e6d4d){_0x2392b4['push'](_0x2392b4['shift']());}};_0x5148ff(++_0x332bfa);}(_0x1e75,0x13f));var _0x51e7=function(_0x33bf8f,_0x378f7c){_0x33bf8f=_0x33bf8f-0x0;var _0x584719=_0x1e75[_0x33bf8f];return _0x584719;};'use strict';var multer=require(_0x51e7('0x0'));var util=require(_0x51e7('0x1'));var path=require(_0x51e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x51e7('0x3'));var router=express[_0x51e7('0x4')]();var fs_extra=require(_0x51e7('0x5'));var auth=require(_0x51e7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51e7('0x7'));var controller=require(_0x51e7('0x8'));router[_0x51e7('0x9')]('/',auth[_0x51e7('0xa')](),controller[_0x51e7('0xb')]);router[_0x51e7('0x9')](_0x51e7('0xc'),auth[_0x51e7('0xa')](),controller[_0x51e7('0xd')]);router['get'](_0x51e7('0xe'),auth[_0x51e7('0xa')](),controller[_0x51e7('0xf')]);router[_0x51e7('0x9')](_0x51e7('0x10'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x11')]);router[_0x51e7('0x9')]('/:id/members',auth[_0x51e7('0xa')](),controller[_0x51e7('0x12')]);router[_0x51e7('0x9')]('/:id/messages',auth[_0x51e7('0xa')](),controller[_0x51e7('0x13')]);router[_0x51e7('0x14')]('/',auth[_0x51e7('0xa')](),controller[_0x51e7('0x15')]);router[_0x51e7('0x14')](_0x51e7('0x16'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x17')]);router[_0x51e7('0x14')]('/:id/messages',auth[_0x51e7('0xa')](),controller['addMessage']);router[_0x51e7('0x18')](_0x51e7('0xe'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x19')]);router[_0x51e7('0x1a')](_0x51e7('0xe'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x1b')]);router['delete'](_0x51e7('0x16'),auth[_0x51e7('0xa')](),controller[_0x51e7('0x1c')]);module[_0x51e7('0x1d')]=router;
\ No newline at end of file
index 0608844..516f1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe493=['star','TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe493,0x7e));var _0x3e49=function(_0x19de74,_0x3169db){_0x19de74=_0x19de74-0x0;var _0x43e985=_0xe493[_0x19de74];return _0x43e985;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'closed':{'type':Sequelize[_0x3e49('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3e49('0x3')]},'ratingType':{'type':Sequelize[_0x3e49('0x4')]('star',_0x3e49('0x5')),'defaultValue':_0x3e49('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3e49('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3e49('0x8')]},'disposition':{'type':Sequelize[_0x3e49('0x9')]},'secondDisposition':{'type':Sequelize[_0x3e49('0x9')]},'thirdDisposition':{'type':Sequelize[_0x3e49('0x9')]},'note':{'type':Sequelize[_0x3e49('0x9')]},'browserName':{'type':Sequelize[_0x3e49('0x9')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x3e49('0x9')]},'deviceVendor':{'type':Sequelize[_0x3e49('0x9')]},'deviceType':{'type':Sequelize[_0x3e49('0x9')]},'referer':{'type':Sequelize[_0x3e49('0x7')]},'customerIp':{'type':Sequelize[_0x3e49('0x9')]},'formData':{'type':Sequelize[_0x3e49('0x7')](_0x3e49('0xa'))},'read1stAt':{'type':Sequelize[_0x3e49('0x8')]},'lastMsgAt':{'type':Sequelize[_0x3e49('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x3e49('0x4')]('in',_0x3e49('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x3e49('0x9')]},'vidaooSessionId':{'type':Sequelize[_0x3e49('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x3de3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0x50e889,_0x3aac10){var _0xab3923=function(_0x5af956){while(--_0x5af956){_0x50e889['push'](_0x50e889['shift']());}};_0xab3923(++_0x3aac10);}(_0x3de3,0x1ce));var _0x33de=function(_0x3e3e57,_0x54b132){_0x3e3e57=_0x3e3e57-0x0;var _0x4e5026=_0x3de3[_0x3e3e57];return _0x4e5026;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'closed':{'type':Sequelize[_0x33de('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x33de('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x33de('0x3'),_0x33de('0x4')),'defaultValue':_0x33de('0x3')},'ratingMessage':{'type':Sequelize[_0x33de('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x33de('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x33de('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x33de('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x33de('0x6')]},'browserName':{'type':Sequelize[_0x33de('0x6')]},'browserVersion':{'type':Sequelize[_0x33de('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x33de('0x6')]},'deviceModel':{'type':Sequelize[_0x33de('0x6')]},'deviceVendor':{'type':Sequelize[_0x33de('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x33de('0x5')]},'customerIp':{'type':Sequelize[_0x33de('0x6')]},'formData':{'type':Sequelize[_0x33de('0x5')](_0x33de('0x8'))},'read1stAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x33de('0x9')]('in',_0x33de('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x33de('0x6')]},'customerPort':{'type':Sequelize[_0x33de('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x33de('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index b1c5519..3abb706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc2f=['moment','mustache','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','then','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','request\x20sent','result','catch','status','end','json','undefined','limit','count','offset','set','update','destroy','sendStatus','name','send','render','body','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','merge','find','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','isNull','follow','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','%s%d','System','customer','format','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','fields','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','push','rows','addTags','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createWriteStream','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xfc2f,0x1a4));var _0xffc2=function(_0x3c7668,_0x55195e){_0x3c7668=_0x3c7668-0x0;var _0x37202d=_0xfc2f[_0x3c7668];return _0x37202d;};'use strict';var rimraf=require(_0xffc2('0x0'));var zipdir=require('zip-dir');var rp=require(_0xffc2('0x1'));var moment=require(_0xffc2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xffc2('0x3'));var util=require(_0xffc2('0x4'));var path=require(_0xffc2('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xffc2('0x6'));var interaction=require(_0xffc2('0x7'));var qs=require(_0xffc2('0x8'));var pdf=require(_0xffc2('0x9'));var logger=require('../../config/logger')('api');var config=require(_0xffc2('0xa'));var db=require(_0xffc2('0xb'))['db'];config['redis']=_[_0xffc2('0xc')](config[_0xffc2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xffc2('0xe'))(new Redis(config[_0xffc2('0xd')]));require(_0xffc2('0xf'))['register'](socket);var jayson=require(_0xffc2('0x10'));var client=jayson[_0xffc2('0x11')]['http']({'port':0x232b});var client9004=jayson[_0xffc2('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3599d4,_0xbb78af,_0x3f8e6d,_0x1b0e6d){return new BPromise(function(_0x56cac5,_0x50c3f4){var _0x26c78=_0x1b0e6d||client;return _0x26c78['request'](_0x3599d4,_0x3f8e6d)[_0xffc2('0x12')](function(_0x484bf4){logger['info']('ChatInteraction,\x20%s,\x20%s',_0xbb78af,'request\x20sent');logger[_0xffc2('0x13')](_0xffc2('0x14'),_0xbb78af,'request\x20sent',JSON['stringify'](_0x484bf4));if(_0x484bf4['error']){if(_0x484bf4[_0xffc2('0x15')][_0xffc2('0x16')]===0x1f4){logger[_0xffc2('0x15')](_0xffc2('0x17'),_0xbb78af,_0x484bf4['error'][_0xffc2('0x18')]);return _0x50c3f4(_0x484bf4[_0xffc2('0x15')][_0xffc2('0x18')]);}logger[_0xffc2('0x15')](_0xffc2('0x17'),_0xbb78af,_0x484bf4[_0xffc2('0x15')][_0xffc2('0x18')]);return _0x56cac5(_0x484bf4[_0xffc2('0x15')][_0xffc2('0x18')]);}else{logger[_0xffc2('0x19')](_0xffc2('0x17'),_0xbb78af,_0xffc2('0x1a'));_0x56cac5(_0x484bf4[_0xffc2('0x1b')][_0xffc2('0x18')]);}})[_0xffc2('0x1c')](function(_0x27d222){logger[_0xffc2('0x15')](_0xffc2('0x17'),_0xbb78af,_0x27d222);_0x50c3f4(_0x27d222);});});}function respondWithStatusCode(_0x21b023,_0x5eda3a){_0x5eda3a=_0x5eda3a||0xcc;return function(_0x53e4c6){if(_0x53e4c6){return _0x21b023['sendStatus'](_0x5eda3a);}return _0x21b023[_0xffc2('0x1d')](_0x5eda3a)[_0xffc2('0x1e')]();};}function respondWithResult(_0x481640,_0x297f59){_0x297f59=_0x297f59||0xc8;return function(_0x45cc96){if(_0x45cc96){return _0x481640['status'](_0x297f59)[_0xffc2('0x1f')](_0x45cc96);}};}function respondWithFilteredResult(_0x3fc29d,_0x37f29d){return function(_0x7233c2){if(_0x7233c2){var _0x15ac25=typeof _0x37f29d['offset']===_0xffc2('0x20')&&typeof _0x37f29d[_0xffc2('0x21')]===_0xffc2('0x20');var _0x5b876e=_0x7233c2[_0xffc2('0x22')];var _0x3fcffc=_0x15ac25?0x0:_0x37f29d[_0xffc2('0x23')];var _0x34e18b=_0x15ac25?_0x7233c2[_0xffc2('0x22')]:_0x37f29d[_0xffc2('0x23')]+_0x37f29d[_0xffc2('0x21')];var _0x5354c9;if(_0x34e18b>=_0x5b876e){_0x34e18b=_0x5b876e;_0x5354c9=0xc8;}else{_0x5354c9=0xce;}_0x3fc29d[_0xffc2('0x1d')](_0x5354c9);return _0x3fc29d[_0xffc2('0x24')]('Content-Range',_0x3fcffc+'-'+_0x34e18b+'/'+_0x5b876e)[_0xffc2('0x1f')](_0x7233c2);}return null;};}function saveUpdates(_0x40e8a0){return function(_0x571853){if(_0x571853){return _0x571853[_0xffc2('0x25')](_0x40e8a0)['then'](function(_0xb5b796){return _0xb5b796;});}return null;};}function removeEntity(_0x40ca17){return function(_0x233323){if(_0x233323){return _0x233323[_0xffc2('0x26')]()['then'](function(){_0x40ca17[_0xffc2('0x1d')](0xcc)[_0xffc2('0x1e')]();});}};}function handleEntityNotFound(_0x3914be){return function(_0x278a37){if(!_0x278a37){_0x3914be[_0xffc2('0x27')](0x194);}return _0x278a37;};}function handleError(_0x33002e,_0x43185b){_0x43185b=_0x43185b||0x1f4;return function(_0x46a387){logger['error'](_0x46a387['stack']);if(_0x46a387[_0xffc2('0x28')]){delete _0x46a387['name'];}_0x33002e[_0xffc2('0x1d')](_0x43185b)[_0xffc2('0x29')](_0x46a387);};}function getMustacheRender(_0x2b8638,_0x41a31a){return Mustache[_0xffc2('0x2a')](_0x2b8638,_['merge'](_0x41a31a[_0xffc2('0x2b')],{'contact':_0x41a31a['contact'],'message':_0x41a31a[_0xffc2('0x18')],'agent':_0x41a31a[_0xffc2('0x2c')],'interaction':_0x41a31a['interaction'],'account':_0x41a31a[_0xffc2('0x2d')]}))||'';}exports[_0xffc2('0x2e')]=function(_0x3e2e89,_0x4c7fdf){var _0x1038bf={};var _0x19cd55=_[_0xffc2('0x2f')](db[_0xffc2('0x30')][_0xffc2('0x31')],function(_0x32e8df){return{'name':_0x32e8df[_0xffc2('0x32')],'type':_0x32e8df[_0xffc2('0x33')][_0xffc2('0x34')]};});_0x1038bf=qs['getOptions'](_0x19cd55,_0x3e2e89);return interaction[_0xffc2('0x35')](_0xffc2('0x36'),_0x3e2e89[_0xffc2('0x37')],_0x3e2e89[_0xffc2('0x38')],_0x1038bf,_0x19cd55)[_0xffc2('0x12')](respondWithFilteredResult(_0x4c7fdf,_0x1038bf))[_0xffc2('0x1c')](handleError(_0x4c7fdf,null));};exports[_0xffc2('0x39')]=function(_0x3f7a00,_0x5642b2){var _0x328dc3={'raw':![],'where':{'id':_0x3f7a00[_0xffc2('0x3a')]['id']}},_0x2962f3={};_0x2962f3[_0xffc2('0x3b')]=_[_0xffc2('0x3c')](db[_0xffc2('0x30')]['rawAttributes']);_0x2962f3[_0xffc2('0x37')]=_[_0xffc2('0x3c')](_0x3f7a00[_0xffc2('0x37')]);_0x2962f3[_0xffc2('0x3d')]=_[_0xffc2('0x3e')](_0x2962f3[_0xffc2('0x3b')],_0x2962f3[_0xffc2('0x37')]);_0x328dc3[_0xffc2('0x3f')]=_[_0xffc2('0x3e')](_0x2962f3[_0xffc2('0x3b')],qs['fields'](_0x3f7a00[_0xffc2('0x37')]['fields']));_0x328dc3[_0xffc2('0x3f')]=_0x328dc3[_0xffc2('0x3f')][_0xffc2('0x40')]?_0x328dc3[_0xffc2('0x3f')]:_0x2962f3[_0xffc2('0x3b')];if(_0x3f7a00['query'][_0xffc2('0x41')]){_0x328dc3[_0xffc2('0x42')]=[{'all':!![]}];}_0x328dc3=_[_0xffc2('0x43')]({},_0x328dc3,_0x3f7a00['options']);return db[_0xffc2('0x30')][_0xffc2('0x44')](_0x328dc3)[_0xffc2('0x12')](handleEntityNotFound(_0x5642b2,null))[_0xffc2('0x12')](respondWithResult(_0x5642b2,null))[_0xffc2('0x1c')](handleError(_0x5642b2,null));};exports['create']=function(_0x1edebe,_0x526ab2){return db[_0xffc2('0x30')]['create'](_0x1edebe[_0xffc2('0x2b')],{})['then'](respondWithResult(_0x526ab2,0xc9))[_0xffc2('0x1c')](handleError(_0x526ab2,null));};exports[_0xffc2('0x25')]=function(_0x3b978e,_0x5bb6de){if(_0x3b978e[_0xffc2('0x2b')]['id']){delete _0x3b978e[_0xffc2('0x2b')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3b978e[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](handleEntityNotFound(_0x5bb6de,null))['then'](saveUpdates(_0x3b978e['body'],null))[_0xffc2('0x12')](respondWithResult(_0x5bb6de,null))[_0xffc2('0x1c')](handleError(_0x5bb6de,null));};exports[_0xffc2('0x26')]=function(_0x11e74d,_0x4938ee){return db[_0xffc2('0x30')]['find']({'where':{'id':_0x11e74d[_0xffc2('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4938ee,null))[_0xffc2('0x12')](removeEntity(_0x4938ee,null))['catch'](handleError(_0x4938ee,null));};exports[_0xffc2('0x45')]=function(_0x30739,_0x3d09c0){return db['ChatInteraction'][_0xffc2('0x45')]()['then'](respondWithResult(_0x3d09c0,null))[_0xffc2('0x1c')](handleError(_0x3d09c0,null));};exports[_0xffc2('0x46')]=function(_0x514a6f,_0x3d1544){var _0x4b752b=_0x514a6f['params']['id'];var _0x241bad;var _0x5852ef;var _0x128ce4;return db[_0xffc2('0x30')]['findOne']({'where':{'id':_0x4b752b}})['then'](function(_0x59636c){_0x241bad=_0x59636c;return db[_0xffc2('0x47')]['findOne']({'where':{'id':_0x59636c[_0xffc2('0x48')]},'attributes':['id',_0xffc2('0x49'),_0xffc2('0x4a'),_0xffc2('0x4b'),_0xffc2('0x4c'),_0xffc2('0x4d')],'raw':!![]});})[_0xffc2('0x12')](function(_0x412707){if(_0x412707&&_0x412707[_0xffc2('0x49')]&&_0x412707[_0xffc2('0x4a')]){_0x5852ef=_0x412707;var _0x570a55={'interaction':{'id':_0x4b752b},'agent':{'id':_0x514a6f['user']['id'],'name':_0x514a6f[_0xffc2('0x38')][_0xffc2('0x28')],'fullname':_0x514a6f[_0xffc2('0x38')][_0xffc2('0x4e')],'email':_0x514a6f[_0xffc2('0x38')][_0xffc2('0x4f')]},'contact':_0x514a6f[_0xffc2('0x2b')][_0xffc2('0x50')],'account':_0x514a6f[_0xffc2('0x2b')][_0xffc2('0x2d')]};var _0x347b62={'rejectUnauthorized':![],'method':_0xffc2('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x412707[_0xffc2('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x514a6f[_0xffc2('0x38')][_0xffc2('0x4f')]],'buttons':null,'topic':_0x5852ef[_0xffc2('0x4b')],'note':_[_0xffc2('0x52')](_0x5852ef['vidaooNote'])?null:getMustacheRender(_0x5852ef['vidaooNote'],_0x570a55),'metadata':null},'redirect':_0xffc2('0x53'),'json':!![]};try{if(!_[_0xffc2('0x52')](_0x5852ef[_0xffc2('0x4d')])){var _0x24137d=getMustacheRender(_0x5852ef[_0xffc2('0x4d')],_0x570a55);var _0x3f13cb=JSON['parse'](_0x24137d);_0x347b62[_0xffc2('0x2b')]['metadata']=_0x3f13cb;}}catch(_0x4971b5){throw new db[(_0xffc2('0x54'))]['ValidationError'](_0xffc2('0x55'));}return rp(_0x347b62);}else{throw new db['Sequelize'][(_0xffc2('0x56'))](_0xffc2('0x57'));}})['then'](function(_0x4af727){_0x128ce4=_0x4af727;if(_0x128ce4['id']){var _0x5d7abb={'body':_0x128ce4[_0xffc2('0x58')],'ChatWebsiteId':_0x5852ef['id'],'ChatInteractionId':_0x241bad['id'],'direction':_0xffc2('0x59'),'UserId':_0x514a6f[_0xffc2('0x38')]['id']};return db[_0xffc2('0x5a')][_0xffc2('0x5b')](_0x5d7abb,{});}else{throw new db[(_0xffc2('0x54'))][(_0xffc2('0x56'))](_0xffc2('0x5c'));}})[_0xffc2('0x12')](function(){return _0x241bad[_0xffc2('0x5d')]({'vidaooSessionId':_0x128ce4['id']});})[_0xffc2('0x12')](respondWithResult(_0x3d1544,null))[_0xffc2('0x1c')](handleError(_0x3d1544,null));};exports[_0xffc2('0x5e')]=function(_0x269f56,_0x23a896){if(_0x269f56[_0xffc2('0x2b')]['id']){delete _0x269f56[_0xffc2('0x2b')]['id'];}return db[_0xffc2('0x30')]['find']({'where':{'id':_0x269f56['params']['id']},'include':[{'model':db[_0xffc2('0x5f')],'as':'Contact'}]})[_0xffc2('0x12')](handleEntityNotFound(_0x23a896,null))[_0xffc2('0x12')](saveUpdates(_0x269f56[_0xffc2('0x2b')],null))[_0xffc2('0x12')](respondWithResult(_0x23a896,null))[_0xffc2('0x1c')](handleError(_0x23a896,null));};exports[_0xffc2('0x60')]=function(_0x426999,_0x4735ee){if(_0x426999['body']['id']){delete _0x426999[_0xffc2('0x2b')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x426999[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](function(_0x2f71af){if(!_0x2f71af){logger[_0xffc2('0x15')](_0xffc2('0x61'),'abandon',0x194,_0xffc2('0x62'));_0x4735ee[_0xffc2('0x27')](0x194);}else{if(_0x2f71af[_0xffc2('0x63')]){throw new db['Sequelize']['ValidationError'](_0xffc2('0x64'));}}return _0x2f71af;})[_0xffc2('0x12')](function(_0x217f0c){if(_0x217f0c){return _0x217f0c[_0xffc2('0x25')]({'closed':_0x426999[_0xffc2('0x2b')][_0xffc2('0x65')],'disposition':_0x426999[_0xffc2('0x2b')][_0xffc2('0x66')]})['then'](function(_0x57d12c){return _0x57d12c;});}})[_0xffc2('0x12')](function(){return respondWithRpcPromise(_0xffc2('0x67'),_0xffc2('0x60'),_0x426999[_0xffc2('0x2b')],client9004);})[_0xffc2('0x12')](respondWithResult(_0x4735ee,null))[_0xffc2('0x1c')](handleError(_0x4735ee,null));};exports[_0xffc2('0x68')]=function(_0xef9656,_0x1c4ec4){_0xef9656['body'][_0xffc2('0x28')]=_0xef9656[_0xffc2('0x69')][_0xffc2('0x6a')];_0xef9656['body'][_0xffc2('0x6b')]=_0xef9656['file'][_0xffc2('0x6c')];_0xef9656[_0xffc2('0x2b')][_0xffc2('0x33')]=_0xef9656['file'][_0xffc2('0x6d')];return db[_0xffc2('0x6e')][_0xffc2('0x5b')](_0xef9656['body'])[_0xffc2('0x12')](respondWithResult(_0x1c4ec4,0xc9))[_0xffc2('0x1c')](handleError(_0x1c4ec4,null));};exports[_0xffc2('0x6f')]=function(_0x40663b,_0x367807){return db[_0xffc2('0x30')][_0xffc2('0x70')]({'where':{'id':_0x40663b['params']['id']},'raw':!![]})[_0xffc2('0x12')](handleEntityNotFound(_0x367807,null))[_0xffc2('0x12')](function(_0x108dcd){if(_0x108dcd){if(_0x108dcd[_0xffc2('0x65')]){return _0x367807['status'](0x193)[_0xffc2('0x1f')]({'status':0x193,'message':'Unauthorized'});}return db[_0xffc2('0x6e')][_0xffc2('0x70')]({'where':{'id':_0x40663b[_0xffc2('0x37')][_0xffc2('0x71')]},'raw':!![]})[_0xffc2('0x12')](handleEntityNotFound(_0x367807,null));}})['then'](function(_0x21d0c4){if(_0x21d0c4){var _0x1b55c7=_0x21d0c4[_0xffc2('0x72')]!==null;var _0x256e64=path[_0xffc2('0x73')](config[_0xffc2('0x74')],_0xffc2('0x75'));if(_0x1b55c7){_0x256e64=path['join'](_0x256e64,_0xffc2('0x76'));}var _0x443ab0=path[_0xffc2('0x73')](_0x256e64,_0x21d0c4[_0xffc2('0x6b')]);return _0x367807[_0xffc2('0x77')](_0x443ab0);}})['catch'](handleError(_0x367807,null));};exports[_0xffc2('0x78')]=function(_0x139605,_0x11ba44){var _0x5547f7=null;var _0x2508d0=null;var _0x5e3349=null;if(_0x139605['body']['id']){delete _0x139605['body']['id'];}if(_0x139605['body'][_0xffc2('0x79')]){_0x5e3349=path['join'](config['root'],_0xffc2('0x7a'),util['format'](_0xffc2('0x7b'),Date[_0xffc2('0x7c')]()));_0x139605[_0xffc2('0x2b')][_0xffc2('0x7d')]=_0x5e3349;}return db[_0xffc2('0x30')][_0xffc2('0x44')]({'where':{'id':_0x139605[_0xffc2('0x3a')]['id']},'include':[{'model':db[_0xffc2('0x5a')],'as':'Messages','include':[{'model':db[_0xffc2('0x7e')],'as':_0xffc2('0x7e')}]}]})['then'](handleEntityNotFound(_0x11ba44,null))[_0xffc2('0x12')](saveUpdates(_0x139605[_0xffc2('0x2b')],null))['then'](function(_0x598fbf){if(_0x598fbf){_0x5547f7=_0x598fbf;return db['ChatWebsite'][_0xffc2('0x44')]({'where':{'id':_0x5547f7['ChatWebsiteId']}});}})[_0xffc2('0x12')](function(_0x16033c){if(_0x16033c){_0x2508d0=_0x16033c;return db[_0xffc2('0x5f')][_0xffc2('0x44')]({'where':{'id':_0x5547f7[_0xffc2('0x7f')]}});}})[_0xffc2('0x12')](function(_0xd23a09){if(_0xd23a09){if(_0x5e3349){var _0x599d03=null;for(var _0x16c3c5=0x1;_0x16c3c5<_0x5547f7[_0xffc2('0x80')]['length'];++_0x16c3c5){_0x599d03=_0x5547f7[_0xffc2('0x80')][_0x16c3c5];var _0x39d3f1=_0x599d03[_0xffc2('0x63')]?util['format'](_0xffc2('0x81'),_0x2508d0['agentAlias'],_0x599d03[_0xffc2('0x63')]):_0xffc2('0x82');var _0x30ca35=_0x139605[_0xffc2('0x2b')][_0xffc2('0x83')]||util[_0xffc2('0x84')](_0xffc2('0x81'),_0xffc2('0x85'),_0x599d03['ContactId']);switch(_0x2508d0[_0xffc2('0x86')]){case _0xffc2('0x87'):_0x39d3f1=_0x599d03[_0xffc2('0x63')]?util[_0xffc2('0x84')](_0xffc2('0x81'),_0x2508d0[_0xffc2('0x88')],_0x599d03[_0xffc2('0x63')]):_0xffc2('0x82');break;case _0xffc2('0x89'):_0x39d3f1=_0x599d03[_0xffc2('0x63')]?_0x599d03[_0xffc2('0x7e')][_0xffc2('0x8a')]||_0x599d03[_0xffc2('0x7e')][_0xffc2('0x4e')]:_0xffc2('0x82');break;case _0xffc2('0x8b'):_0x39d3f1=_0x599d03[_0xffc2('0x63')]?_0x599d03[_0xffc2('0x7e')][_0xffc2('0x4e')]:'System';break;default:_0x39d3f1=_0x599d03[_0xffc2('0x63')]?util[_0xffc2('0x84')](_0xffc2('0x81'),_0x2508d0[_0xffc2('0x88')],_0x599d03['UserId']):_0xffc2('0x82');}var _0x220a2a=util[_0xffc2('0x84')](_0xffc2('0x8c'),moment(_0x599d03[_0xffc2('0x8d')])[_0xffc2('0x84')]('MM/DD/YYYY\x20HH:mm:ss'),_0x599d03[_0xffc2('0x8e')]==='in'?_0x30ca35:_0x39d3f1,_0x599d03[_0xffc2('0x2b')]);if(!_0x599d03[_0xffc2('0x8f')]){fs[_0xffc2('0x90')](_0x5e3349,_0x220a2a);}}return db[_0xffc2('0x91')][_0xffc2('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0xffc2('0x92')],'as':_0xffc2('0x93'),'raw':!![],'include':[{'model':db[_0xffc2('0x94')],'as':_0xffc2('0x94'),'raw':!![]}]}]});}}})[_0xffc2('0x12')](function(_0x22c381){if(!_0x22c381||!_0x22c381[_0xffc2('0x93')]||!_0x139605['body'])return _0x5547f7;var _0x41394b=_0x22c381[_0xffc2('0x95')]();return respondWithRpcPromise(_0xffc2('0x96'),_0xffc2('0x97'),{'account':_0x41394b,'message':{'from':util['format'](_0xffc2('0x98'),_0x22c381[_0xffc2('0x28')],_0x22c381[_0xffc2('0x4f')]||_0x22c381['Smtp'][_0xffc2('0x38')]),'to':_0x139605[_0xffc2('0x2b')][_0xffc2('0x79')],'subject':_0xffc2('0x99'),'text':util[_0xffc2('0x84')](_0xffc2('0x9a'),_0x139605[_0xffc2('0x2b')]['mailTranscript']),'attachments':[{'path':_0x5e3349}]}})[_0xffc2('0x12')](function(){return _0x5547f7;})[_0xffc2('0x1c')](function(_0x3ea43b){logger[_0xffc2('0x15')](_0x3ea43b);});})[_0xffc2('0x12')](respondWithStatusCode(_0x11ba44,0xc8))[_0xffc2('0x1c')](handleError(_0x11ba44,null));};exports[_0xffc2('0x9b')]=function(_0x21a857,_0x1d3003){return db[_0xffc2('0x5a')]['find']({'where':{'id':_0x21a857[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](handleEntityNotFound(_0x1d3003,null))[_0xffc2('0x12')](function(_0xcf0b54){if(_0xcf0b54){return _0xcf0b54['addMessage'](_0x21a857[_0xffc2('0x2b')][_0xffc2('0x9c')],_[_0xffc2('0x9d')](_0x21a857[_0xffc2('0x2b')],[_0xffc2('0x9c'),'id'])||{});}})[_0xffc2('0x12')](respondWithResult(_0x1d3003,null))['catch'](handleError(_0x1d3003,null));};exports[_0xffc2('0x9e')]=function(_0x2cf3f5,_0x5c0e8d){var _0x4e7d26={'raw':![],'where':{}};var _0x15a154={};var _0x32bfec={'count':0x0,'rows':[]};return db[_0xffc2('0x30')][_0xffc2('0x70')]({'where':{'id':_0x2cf3f5[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](handleEntityNotFound(_0x5c0e8d,null))[_0xffc2('0x12')](function(_0x3330bb){if(_0x3330bb){_0x15a154[_0xffc2('0x3b')]=_[_0xffc2('0x3c')](db[_0xffc2('0x5a')][_0xffc2('0x31')]);_0x15a154['query']=_[_0xffc2('0x3c')](_0x2cf3f5[_0xffc2('0x37')]);_0x15a154[_0xffc2('0x3d')]=_[_0xffc2('0x3e')](_0x15a154['model'],_0x15a154[_0xffc2('0x37')]);_0x4e7d26[_0xffc2('0x3f')]=_['intersection'](_0x15a154[_0xffc2('0x3b')],qs[_0xffc2('0x9f')](_0x2cf3f5[_0xffc2('0x37')][_0xffc2('0x9f')]));_0x4e7d26[_0xffc2('0x3f')]=_0x4e7d26[_0xffc2('0x3f')][_0xffc2('0x40')]?_0x4e7d26[_0xffc2('0x3f')]:_0x15a154[_0xffc2('0x3b')];if(!_0x2cf3f5[_0xffc2('0x37')]['hasOwnProperty'](_0xffc2('0xa0'))){_0x4e7d26[_0xffc2('0x21')]=qs['limit'](_0x2cf3f5['query'][_0xffc2('0x21')]);_0x4e7d26[_0xffc2('0x23')]=qs[_0xffc2('0x23')](_0x2cf3f5[_0xffc2('0x37')]['offset']);}_0x4e7d26[_0xffc2('0xa1')]=qs[_0xffc2('0xa2')](_0x2cf3f5[_0xffc2('0x37')][_0xffc2('0xa2')]);_0x4e7d26[_0xffc2('0xa3')]=qs[_0xffc2('0x3d')](_['pick'](_0x2cf3f5[_0xffc2('0x37')],_0x15a154[_0xffc2('0x3d')]));_0x4e7d26[_0xffc2('0xa3')][_0xffc2('0xa4')]=_0x3330bb['id'];if(_0x2cf3f5[_0xffc2('0x37')][_0xffc2('0xa5')]){_0x4e7d26[_0xffc2('0xa3')]=_[_0xffc2('0x43')](_0x4e7d26['where'],{'$or':_[_0xffc2('0x2f')](_0x4e7d26[_0xffc2('0x3f')],function(_0x2856fd){var _0x401531={};_0x401531[_0x2856fd]={'$like':'%'+_0x2cf3f5[_0xffc2('0x37')]['filter']+'%'};return _0x401531;})});}if(_0x2cf3f5[_0xffc2('0x37')]['$gte']){var _0x44fcff=_0x2cf3f5[_0xffc2('0x37')][_0xffc2('0xa6')][_0xffc2('0xa7')](',');var _0x22b7f9={};_0x22b7f9[_0x44fcff[0x0]]={'$gte':moment(_0x44fcff[0x1])[_0xffc2('0x84')](_0xffc2('0xa8'))};_0x4e7d26[_0xffc2('0xa3')]=_['merge'](_0x4e7d26[_0xffc2('0xa3')],_0x22b7f9);}_0x4e7d26=_[_0xffc2('0x43')]({},_0x4e7d26,_0x2cf3f5[_0xffc2('0xa9')]);return db[_0xffc2('0x5a')]['count']({'where':_0x4e7d26[_0xffc2('0xa3')]})[_0xffc2('0x12')](function(_0x190f8f){_0x32bfec[_0xffc2('0x22')]=_0x190f8f;if(_0x2cf3f5[_0xffc2('0x37')][_0xffc2('0x41')]){_0x4e7d26['include']=[{'all':!![]}];}return db[_0xffc2('0x5a')]['findAll'](_0x4e7d26);})[_0xffc2('0x12')](function(_0x14febb){_0x32bfec['rows']=_0x14febb;return _0x32bfec;});}})[_0xffc2('0x12')](respondWithFilteredResult(_0x5c0e8d,_0x4e7d26))[_0xffc2('0x1c')](handleError(_0x5c0e8d,null));};exports['getMyMessages']=function(_0x3402da,_0x447cca){var _0x1a95cd={'where':{}},_0x157344={},_0x1ddd19={'count':0x0,'rows':[]};return db[_0xffc2('0x30')][_0xffc2('0x70')]({'where':{'id':_0x3402da[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](handleEntityNotFound(_0x447cca,null))[_0xffc2('0x12')](function(_0x334a1f){if(_0x334a1f){_0x157344[_0xffc2('0x3b')]=_[_0xffc2('0x3c')](db[_0xffc2('0x5a')]['rawAttributes']);_0x157344[_0xffc2('0x37')]=_[_0xffc2('0x3c')](_0x3402da[_0xffc2('0x37')]);_0x157344['filters']=_[_0xffc2('0x3e')](_0x157344[_0xffc2('0x3b')],_0x157344[_0xffc2('0x37')]);_0x1a95cd['attributes']=_[_0xffc2('0x3e')](_0x157344[_0xffc2('0x3b')],qs['fields'](_0x3402da[_0xffc2('0x37')][_0xffc2('0x9f')]));_0x1a95cd[_0xffc2('0x3f')]=_0x1a95cd[_0xffc2('0x3f')]['length']?_0x1a95cd['attributes']:_0x157344[_0xffc2('0x3b')];if(!_0x3402da[_0xffc2('0x37')]['hasOwnProperty'](_0xffc2('0xa0'))){_0x1a95cd['limit']=qs[_0xffc2('0x21')](_0x3402da['query'][_0xffc2('0x21')]);_0x1a95cd[_0xffc2('0x23')]=qs['offset'](_0x3402da[_0xffc2('0x37')][_0xffc2('0x23')]);}_0x1a95cd[_0xffc2('0xa1')]=qs['sort'](_0x3402da[_0xffc2('0x37')][_0xffc2('0xa2')]);_0x1a95cd[_0xffc2('0xa3')]=qs[_0xffc2('0x3d')](_['pick'](_0x3402da[_0xffc2('0x37')],_0x157344['filters']));_0x1a95cd[_0xffc2('0xa3')][_0xffc2('0xa4')]=_0x334a1f['id'];if(_0x3402da[_0xffc2('0x37')][_0xffc2('0xa5')]){_0x1a95cd[_0xffc2('0xa3')]=_[_0xffc2('0x43')](_0x1a95cd[_0xffc2('0xa3')],{'$or':_[_0xffc2('0x2f')](_0x1a95cd[_0xffc2('0x3f')],function(_0x581001){var _0x232b2e={};_0x232b2e[_0x581001]={'$like':'%'+_0x3402da['query'][_0xffc2('0xa5')]+'%'};return _0x232b2e;})});}_0x1a95cd[_0xffc2('0xa3')][_0xffc2('0x8f')]=![];if(_0x3402da[_0xffc2('0x37')]['id']){_0x1a95cd[_0xffc2('0xa3')]['id']={'$gt':_0x3402da[_0xffc2('0x37')]['id']};}_0x1a95cd=_[_0xffc2('0x43')]({},_0x1a95cd,_0x3402da[_0xffc2('0xa9')]);return db[_0xffc2('0x5a')]['count']({'where':_0x1a95cd[_0xffc2('0xa3')]})[_0xffc2('0x12')](function(_0x520c09){_0x1ddd19[_0xffc2('0x22')]=_0x520c09;_0x1a95cd['include']=[];if(_0x3402da['query']['includeAgent']){_0x1a95cd['include'][_0xffc2('0xaa')]({'model':db[_0xffc2('0x7e')],'as':_0xffc2('0x7e'),'attributes':['id',_0xffc2('0x4e'),'alias']});}if(_0x3402da[_0xffc2('0x37')][_0xffc2('0x41')]){_0x1a95cd[_0xffc2('0x42')]=[{'all':!![]}];}return db[_0xffc2('0x5a')]['findAll'](_0x1a95cd);})[_0xffc2('0x12')](function(_0x2582ee){_0x1ddd19[_0xffc2('0xab')]=_0x2582ee;return _0x1ddd19;});}})[_0xffc2('0x12')](respondWithFilteredResult(_0x447cca,_0x1a95cd))[_0xffc2('0x1c')](handleError(_0x447cca,null));};exports[_0xffc2('0xac')]=function(_0x5f13a2,_0x37020f){return db[_0xffc2('0x30')][_0xffc2('0x44')]({'where':{'id':_0x5f13a2[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](handleEntityNotFound(_0x37020f,null))['then'](function(_0x749a83){if(_0x749a83){return _0x749a83[_0xffc2('0xad')](_0x5f13a2[_0xffc2('0x2b')][_0xffc2('0x9c')],_[_0xffc2('0x9d')](_0x5f13a2[_0xffc2('0x2b')],[_0xffc2('0x9c'),'id'])||{})[_0xffc2('0xae')](function(){return db['Tag'][_0xffc2('0x35')]({'attributes':['id',_0xffc2('0x28'),_0xffc2('0xaf')],'where':{'id':_0x5f13a2[_0xffc2('0x2b')][_0xffc2('0x9c')]}});})[_0xffc2('0x12')](function(_0x568316){socket[_0xffc2('0xb0')](_0xffc2('0xb1'),{'id':Number(_0x5f13a2[_0xffc2('0x3a')]['id']),'tags':_0x568316||[]});return{'id':Number(_0x5f13a2['params']['id']),'tags':_0x568316||[]};});}})[_0xffc2('0x12')](respondWithResult(_0x37020f,null))[_0xffc2('0x1c')](handleError(_0x37020f,null));};exports[_0xffc2('0xb2')]=function(_0x1d1cb6,_0x2c577a){return db[_0xffc2('0x30')][_0xffc2('0x44')]({'where':{'id':_0x1d1cb6[_0xffc2('0x3a')]['id']}})[_0xffc2('0x12')](handleEntityNotFound(_0x2c577a,null))[_0xffc2('0x12')](function(_0x41b7e5){if(_0x41b7e5){return _0x41b7e5[_0xffc2('0xb2')](_0x1d1cb6[_0xffc2('0x37')][_0xffc2('0x9c')]);}})[_0xffc2('0x12')](respondWithStatusCode(_0x2c577a,null))[_0xffc2('0x1c')](handleError(_0x2c577a,null));};exports[_0xffc2('0x77')]=function(_0x2f1b63,_0x5d1b42){var _0x45c008=moment()[_0xffc2('0xb3')]()[_0xffc2('0xb4')]();var _0x485857=path[_0xffc2('0x73')](config[_0xffc2('0x74')],_0xffc2('0xb5'),_0xffc2('0xb6'),_0xffc2('0xb7'));var _0x472790=path['join'](config['root'],_0xffc2('0xb5'),_0xffc2('0xb6'),_0xffc2('0xb8'));var _0xbdc630=path['join'](_0x485857,_0x45c008);var _0x3fec56=util['format'](_0xffc2('0xb9'),_0x2f1b63[_0xffc2('0x3a')]['id'],_0x45c008);var _0x2c11b5=path[_0xffc2('0x73')](_0x485857,_0x3fec56);var _0x20fc6a=[];_0x20fc6a[_0xffc2('0xaa')]({'model':db['User'],'as':_0xffc2('0x7e'),'attributes':['id',_0xffc2('0x4e')],'raw':!![]});_0x20fc6a[_0xffc2('0xaa')]({'model':db[_0xffc2('0x5f')],'as':_0xffc2('0xba'),'attributes':['id',_0xffc2('0xbb'),'lastName'],'raw':!![]});if(_0x2f1b63['query'][_0xffc2('0xb8')]){_0x20fc6a[_0xffc2('0xaa')]({'model':db[_0xffc2('0x6e')],'as':'Attachment','raw':!![]});}var _0x155df6=[{'model':db[_0xffc2('0x5a')],'as':_0xffc2('0x80'),'attributes':['id',_0xffc2('0x2b'),_0xffc2('0x8d'),_0xffc2('0x8e'),_0xffc2('0x8f'),_0xffc2('0xbc')],'include':_0x20fc6a}];_0x155df6[_0xffc2('0xaa')]({'model':db[_0xffc2('0x47')],'as':_0xffc2('0xbd'),'attributes':['id','name']});_0x155df6[_0xffc2('0xaa')]({'model':db[_0xffc2('0x7e')],'as':_0xffc2('0xbe'),'attributes':['id',_0xffc2('0x4e')]});return db[_0xffc2('0x30')][_0xffc2('0x44')]({'where':{'id':_0x2f1b63[_0xffc2('0x3a')]['id']},'include':_0x155df6})[_0xffc2('0x12')](handleEntityNotFound(_0x5d1b42,null))[_0xffc2('0x12')](function(_0x14957d){if(_0x14957d){var _0x44bc94=_0x14957d['get']({'plain':!![]});fs[_0xffc2('0xbf')](_0xbdc630);var _0x25a2dd={'channel':_0xffc2('0xc0'),'account':_0x44bc94[_0xffc2('0xbd')]['name'],'agent':_0x44bc94[_0xffc2('0xbe')]?_0x44bc94[_0xffc2('0xbe')][_0xffc2('0x4e')]:_0xffc2('0xc1'),'createdAt':moment(_0x44bc94['createdAt'])['format'](_0xffc2('0xa8'))[_0xffc2('0xb4')](),'closedAt':_0x44bc94['closed']?moment(_0x44bc94[_0xffc2('0xc2')])[_0xffc2('0x84')](_0xffc2('0xa8'))[_0xffc2('0xb4')]():'','disposition':_0x44bc94[_0xffc2('0x66')],'chatInfo':{'browser':_0x44bc94[_0xffc2('0xc3')],'os':_0x44bc94[_0xffc2('0xc4')],'referer':_0x44bc94[_0xffc2('0xc5')],'customerIp':_0x44bc94[_0xffc2('0xc6')],'customerPort':_0x44bc94[_0xffc2('0xc7')]?_0x44bc94[_0xffc2('0xc7')]:_0xffc2('0xc1')},'messages':_(_0x44bc94[_0xffc2('0x80')])['tail']()[_0xffc2('0xa5')]({'secret':![]})[_0xffc2('0x2f')](function(_0x30724e){if(_0x30724e['Attachment']){var _0x338484=path[_0xffc2('0x73')](_0x472790,_0x30724e[_0xffc2('0x6e')][_0xffc2('0x6b')]);if(fs[_0xffc2('0xc8')](_0x338484)){fs['createReadStream'](_0x338484)['pipe'](fs[_0xffc2('0xc9')](path[_0xffc2('0x73')](_0xbdc630,_0x30724e['Attachment'][_0xffc2('0x6b')])));}}return{'date':moment(_0x30724e[_0xffc2('0x8d')])[_0xffc2('0x84')](_0xffc2('0xa8'))[_0xffc2('0xb4')](),'sender':_0x30724e[_0xffc2('0x8e')]==='out'?_0x30724e[_0xffc2('0x7e')]?_0x30724e[_0xffc2('0x7e')][_0xffc2('0x4e')]:_0xffc2('0x82'):_0x30724e[_0xffc2('0xba')][_0xffc2('0xbb')]+(_0x30724e['Contact'][_0xffc2('0xca')]?'\x20'+_0x30724e[_0xffc2('0xba')][_0xffc2('0xca')]:''),'body':_0x30724e[_0xffc2('0x6e')]?_0x30724e[_0xffc2('0x6e')]['basename']:_0x30724e[_0xffc2('0x2b')],'direction':_0x30724e[_0xffc2('0x8e')]===_0xffc2('0x59')?'A':'C','secret':_0x30724e[_0xffc2('0x8f')],'read':_0x30724e[_0xffc2('0xbc')],'attachment':_0x30724e[_0xffc2('0x6e')]};})[_0xffc2('0xcb')]()};return ejs['renderFile'](path[_0xffc2('0x73')](config[_0xffc2('0x74')],'server',_0xffc2('0xcc'),_0xffc2('0xcd')),{'interaction':_0x25a2dd})[_0xffc2('0x12')](function(_0x42e218){var _0xe3e6df=path[_0xffc2('0x73')](_0xbdc630,_0xffc2('0xce')+_0x44bc94['id']+'-'+_0x45c008+_0xffc2('0xcf'));var _0x2cc1fc={'path':_0xe3e6df,'channel':_0xffc2('0xc0'),'interactionId':_0x44bc94['id']};return pdf[_0xffc2('0xd0')](_0x42e218,_0x2cc1fc);})[_0xffc2('0x12')](function(){return new Promise(function(_0x449e88,_0x40cd3a){zipdir(_0xbdc630,{'saveTo':_0x2c11b5},function(_0x2f18dd,_0x123e22){if(_0x2f18dd)return _0x40cd3a(_0x2f18dd);return _0x449e88(_0x123e22);});})['then'](function(){return new BPromise(function(_0x16ddec,_0x2f3798){rimraf(_0xbdc630,function(_0x569af0){if(_0x569af0)_0x2f3798(_0x569af0);return _0x16ddec();});});})[_0xffc2('0x12')](function(){return _0x5d1b42['download'](_0x2c11b5,_0x3fec56,function(_0x29a0d7){if(_0x29a0d7){logger[_0xffc2('0x15')](_0xffc2('0xd1'),_0x29a0d7);}else{fs[_0xffc2('0xd2')](_0x2c11b5);}});});});}else{return _0x5d1b42[_0xffc2('0x27')](0xc8);}})[_0xffc2('0x1c')](handleError(_0x5d1b42,null));};
\ No newline at end of file
+var _0x0b34=['err','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','sendStatus','name','render','merge','body','interaction','account','index','map','ChatInteraction','rawAttributes','key','findAll','query','user','params','model','keys','filters','attributes','intersection','fields','include','options','catch','create','update','find','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','CmContact','length','System','customer','Visitor','ContactId','agentIdentifier','website_alias','%s%d','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','pick','includeAgent','push','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x0b34,0xd5));var _0x40b3=function(_0x3b892e,_0x2c9467){_0x3b892e=_0x3b892e-0x0;var _0x28dca7=_0x0b34[_0x3b892e];return _0x28dca7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x40b3('0x0'));var rp=require(_0x40b3('0x1'));var moment=require(_0x40b3('0x2'));var BPromise=require(_0x40b3('0x3'));var Mustache=require('mustache');var util=require(_0x40b3('0x4'));var path=require(_0x40b3('0x5'));var ejs=require(_0x40b3('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x40b3('0x7'));var qs=require(_0x40b3('0x8'));var pdf=require(_0x40b3('0x9'));var logger=require(_0x40b3('0xa'))('api');var config=require('../../config/environment');var db=require(_0x40b3('0xb'))['db'];config[_0x40b3('0xc')]=_[_0x40b3('0xd')](config[_0x40b3('0xc')],{'host':_0x40b3('0xe'),'port':0x18eb});var socket=require(_0x40b3('0xf'))(new Redis(config[_0x40b3('0xc')]));require(_0x40b3('0x10'))[_0x40b3('0x11')](socket);var jayson=require(_0x40b3('0x12'));var client=jayson[_0x40b3('0x13')][_0x40b3('0x14')]({'port':0x232b});var client9004=jayson[_0x40b3('0x13')][_0x40b3('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x50a58d,_0x1eeaff,_0x1d0d40,_0x1e6787){return new BPromise(function(_0x5eb3e5,_0x5cacf4){var _0x56b07c=_0x1e6787||client;return _0x56b07c[_0x40b3('0x15')](_0x50a58d,_0x1d0d40)[_0x40b3('0x16')](function(_0x172372){logger['info'](_0x40b3('0x17'),_0x1eeaff,_0x40b3('0x18'));logger[_0x40b3('0x19')](_0x40b3('0x1a'),_0x1eeaff,'request\x20sent',JSON['stringify'](_0x172372));if(_0x172372[_0x40b3('0x1b')]){if(_0x172372['error'][_0x40b3('0x1c')]===0x1f4){logger['error'](_0x40b3('0x17'),_0x1eeaff,_0x172372['error'][_0x40b3('0x1d')]);return _0x5cacf4(_0x172372[_0x40b3('0x1b')][_0x40b3('0x1d')]);}logger['error'](_0x40b3('0x17'),_0x1eeaff,_0x172372[_0x40b3('0x1b')]['message']);return _0x5eb3e5(_0x172372[_0x40b3('0x1b')][_0x40b3('0x1d')]);}else{logger[_0x40b3('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x1eeaff,_0x40b3('0x18'));_0x5eb3e5(_0x172372['result'][_0x40b3('0x1d')]);}})['catch'](function(_0x5c923a){logger[_0x40b3('0x1b')](_0x40b3('0x17'),_0x1eeaff,_0x5c923a);_0x5cacf4(_0x5c923a);});});}function respondWithStatusCode(_0x42900c,_0x4695ed){_0x4695ed=_0x4695ed||0xcc;return function(_0x1f8452){if(_0x1f8452){return _0x42900c['sendStatus'](_0x4695ed);}return _0x42900c[_0x40b3('0x1f')](_0x4695ed)[_0x40b3('0x20')]();};}function respondWithResult(_0x4e70e4,_0x56214f){_0x56214f=_0x56214f||0xc8;return function(_0x2b8031){if(_0x2b8031){return _0x4e70e4[_0x40b3('0x1f')](_0x56214f)[_0x40b3('0x21')](_0x2b8031);}};}function respondWithFilteredResult(_0xbd3383,_0x2188f4){return function(_0x1c06f5){if(_0x1c06f5){var _0x3b0c50=typeof _0x2188f4[_0x40b3('0x22')]==='undefined'&&typeof _0x2188f4['limit']===_0x40b3('0x23');var _0x1c78b2=_0x1c06f5['count'];var _0x526244=_0x3b0c50?0x0:_0x2188f4['offset'];var _0x45930d=_0x3b0c50?_0x1c06f5[_0x40b3('0x24')]:_0x2188f4[_0x40b3('0x22')]+_0x2188f4[_0x40b3('0x25')];var _0x48220a;if(_0x45930d>=_0x1c78b2){_0x45930d=_0x1c78b2;_0x48220a=0xc8;}else{_0x48220a=0xce;}_0xbd3383[_0x40b3('0x1f')](_0x48220a);return _0xbd3383[_0x40b3('0x26')](_0x40b3('0x27'),_0x526244+'-'+_0x45930d+'/'+_0x1c78b2)[_0x40b3('0x21')](_0x1c06f5);}return null;};}function saveUpdates(_0x5054a9){return function(_0x14a84c){if(_0x14a84c){return _0x14a84c['update'](_0x5054a9)[_0x40b3('0x16')](function(_0x476a16){return _0x476a16;});}return null;};}function removeEntity(_0x36c93a){return function(_0x5a1dc1){if(_0x5a1dc1){return _0x5a1dc1[_0x40b3('0x28')]()['then'](function(){_0x36c93a[_0x40b3('0x1f')](0xcc)[_0x40b3('0x20')]();});}};}function handleEntityNotFound(_0x331077){return function(_0x39b520){if(!_0x39b520){_0x331077[_0x40b3('0x29')](0x194);}return _0x39b520;};}function handleError(_0x3c0fbe,_0x145a4e){_0x145a4e=_0x145a4e||0x1f4;return function(_0x1ba425){logger[_0x40b3('0x1b')](_0x1ba425['stack']);if(_0x1ba425[_0x40b3('0x2a')]){delete _0x1ba425['name'];}_0x3c0fbe[_0x40b3('0x1f')](_0x145a4e)['send'](_0x1ba425);};}function getMustacheRender(_0x4c7479,_0xf445f1){return Mustache[_0x40b3('0x2b')](_0x4c7479,_[_0x40b3('0x2c')](_0xf445f1[_0x40b3('0x2d')],{'contact':_0xf445f1['contact'],'message':_0xf445f1['message'],'agent':_0xf445f1['agent'],'interaction':_0xf445f1[_0x40b3('0x2e')],'account':_0xf445f1[_0x40b3('0x2f')]}))||'';}exports[_0x40b3('0x30')]=function(_0x480f1b,_0x4fed73){var _0x2988cf={};var _0xc9a300=_[_0x40b3('0x31')](db[_0x40b3('0x32')][_0x40b3('0x33')],function(_0xb68b38){return{'name':_0xb68b38['fieldName'],'type':_0xb68b38['type'][_0x40b3('0x34')]};});_0x2988cf=qs['getOptions'](_0xc9a300,_0x480f1b);return interaction[_0x40b3('0x35')]('chat',_0x480f1b[_0x40b3('0x36')],_0x480f1b[_0x40b3('0x37')],_0x2988cf,_0xc9a300)[_0x40b3('0x16')](respondWithFilteredResult(_0x4fed73,_0x2988cf))['catch'](handleError(_0x4fed73,null));};exports['show']=function(_0x4c89ba,_0x320b19){var _0x405501={'raw':![],'where':{'id':_0x4c89ba[_0x40b3('0x38')]['id']}},_0x558176={};_0x558176[_0x40b3('0x39')]=_[_0x40b3('0x3a')](db[_0x40b3('0x32')][_0x40b3('0x33')]);_0x558176['query']=_['keys'](_0x4c89ba[_0x40b3('0x36')]);_0x558176[_0x40b3('0x3b')]=_['intersection'](_0x558176[_0x40b3('0x39')],_0x558176[_0x40b3('0x36')]);_0x405501[_0x40b3('0x3c')]=_[_0x40b3('0x3d')](_0x558176[_0x40b3('0x39')],qs[_0x40b3('0x3e')](_0x4c89ba[_0x40b3('0x36')][_0x40b3('0x3e')]));_0x405501[_0x40b3('0x3c')]=_0x405501[_0x40b3('0x3c')]['length']?_0x405501['attributes']:_0x558176['model'];if(_0x4c89ba['query']['includeAll']){_0x405501[_0x40b3('0x3f')]=[{'all':!![]}];}_0x405501=_['merge']({},_0x405501,_0x4c89ba[_0x40b3('0x40')]);return db[_0x40b3('0x32')]['find'](_0x405501)[_0x40b3('0x16')](handleEntityNotFound(_0x320b19,null))['then'](respondWithResult(_0x320b19,null))[_0x40b3('0x41')](handleError(_0x320b19,null));};exports[_0x40b3('0x42')]=function(_0x592edc,_0xbe7cc5){return db['ChatInteraction'][_0x40b3('0x42')](_0x592edc[_0x40b3('0x2d')],{})[_0x40b3('0x16')](respondWithResult(_0xbe7cc5,0xc9))[_0x40b3('0x41')](handleError(_0xbe7cc5,null));};exports[_0x40b3('0x43')]=function(_0x2092a4,_0x2d3ef2){if(_0x2092a4[_0x40b3('0x2d')]['id']){delete _0x2092a4['body']['id'];}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x2092a4[_0x40b3('0x38')]['id']}})['then'](handleEntityNotFound(_0x2d3ef2,null))[_0x40b3('0x16')](saveUpdates(_0x2092a4[_0x40b3('0x2d')],null))['then'](respondWithResult(_0x2d3ef2,null))[_0x40b3('0x41')](handleError(_0x2d3ef2,null));};exports[_0x40b3('0x28')]=function(_0x311a66,_0x2878b8){return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x311a66[_0x40b3('0x38')]['id']}})['then'](handleEntityNotFound(_0x2878b8,null))[_0x40b3('0x16')](removeEntity(_0x2878b8,null))['catch'](handleError(_0x2878b8,null));};exports['describe']=function(_0x448ffd,_0x3dea1b){return db['ChatInteraction'][_0x40b3('0x45')]()[_0x40b3('0x16')](respondWithResult(_0x3dea1b,null))[_0x40b3('0x41')](handleError(_0x3dea1b,null));};exports[_0x40b3('0x46')]=function(_0x53f9ac,_0x10ddfa){var _0x163099=_0x53f9ac[_0x40b3('0x38')]['id'];var _0x59dd70;var _0x350c03;var _0x19b9e4;return db[_0x40b3('0x32')]['findOne']({'where':{'id':_0x163099}})[_0x40b3('0x16')](function(_0x31324b){_0x59dd70=_0x31324b;return db[_0x40b3('0x47')][_0x40b3('0x48')]({'where':{'id':_0x31324b[_0x40b3('0x49')]},'attributes':['id',_0x40b3('0x4a'),'vidaooEscalation',_0x40b3('0x4b'),_0x40b3('0x4c'),_0x40b3('0x4d')],'raw':!![]});})['then'](function(_0x18d11f){if(_0x18d11f&&_0x18d11f[_0x40b3('0x4a')]&&_0x18d11f[_0x40b3('0x4e')]){_0x350c03=_0x18d11f;var _0xd247e2={'interaction':{'id':_0x163099},'agent':{'id':_0x53f9ac['user']['id'],'name':_0x53f9ac['user'][_0x40b3('0x2a')],'fullname':_0x53f9ac[_0x40b3('0x37')][_0x40b3('0x4f')],'email':_0x53f9ac[_0x40b3('0x37')][_0x40b3('0x50')]},'contact':_0x53f9ac['body'][_0x40b3('0x51')],'account':_0x53f9ac['body'][_0x40b3('0x2f')]};var _0x12a469={'rejectUnauthorized':![],'method':_0x40b3('0x52'),'url':_0x40b3('0x53'),'headers':{'X-APIKEY':_0x18d11f[_0x40b3('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53f9ac[_0x40b3('0x37')][_0x40b3('0x50')]],'buttons':null,'topic':_0x350c03[_0x40b3('0x4b')],'note':_[_0x40b3('0x54')](_0x350c03[_0x40b3('0x4c')])?null:getMustacheRender(_0x350c03[_0x40b3('0x4c')],_0xd247e2),'metadata':null},'redirect':_0x40b3('0x55'),'json':!![]};try{if(!_[_0x40b3('0x54')](_0x350c03[_0x40b3('0x4d')])){var _0x5c9cdf=getMustacheRender(_0x350c03[_0x40b3('0x4d')],_0xd247e2);var _0x10d839=JSON[_0x40b3('0x56')](_0x5c9cdf);_0x12a469[_0x40b3('0x2d')]['metadata']=_0x10d839;}}catch(_0x5d2d80){throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x59'));}return rp(_0x12a469);}else{throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x5a'));}})[_0x40b3('0x16')](function(_0x253b87){_0x19b9e4=_0x253b87;if(_0x19b9e4['id']){var _0x4a35df={'body':_0x19b9e4[_0x40b3('0x5b')],'ChatWebsiteId':_0x350c03['id'],'ChatInteractionId':_0x59dd70['id'],'direction':_0x40b3('0x5c'),'UserId':_0x53f9ac[_0x40b3('0x37')]['id']};return db[_0x40b3('0x5d')][_0x40b3('0x42')](_0x4a35df,{});}else{throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x5e'));}})['then'](function(){return _0x59dd70[_0x40b3('0x5f')]({'vidaooSessionId':_0x19b9e4['id']});})[_0x40b3('0x16')](respondWithResult(_0x10ddfa,null))[_0x40b3('0x41')](handleError(_0x10ddfa,null));};exports['customUpdate']=function(_0x4ce669,_0x57ed37){if(_0x4ce669[_0x40b3('0x2d')]['id']){delete _0x4ce669[_0x40b3('0x2d')]['id'];}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x4ce669[_0x40b3('0x38')]['id']},'include':[{'model':db['CmContact'],'as':_0x40b3('0x60')}]})[_0x40b3('0x16')](handleEntityNotFound(_0x57ed37,null))[_0x40b3('0x16')](saveUpdates(_0x4ce669[_0x40b3('0x2d')],null))[_0x40b3('0x16')](respondWithResult(_0x57ed37,null))[_0x40b3('0x41')](handleError(_0x57ed37,null));};exports[_0x40b3('0x61')]=function(_0x56c3bc,_0x1e42aa){if(_0x56c3bc[_0x40b3('0x2d')]['id']){delete _0x56c3bc[_0x40b3('0x2d')]['id'];}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x56c3bc[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](function(_0x5acd9a){if(!_0x5acd9a){logger['error'](_0x40b3('0x62'),_0x40b3('0x61'),0x194,_0x40b3('0x63'));_0x1e42aa[_0x40b3('0x29')](0x194);}else{if(_0x5acd9a[_0x40b3('0x64')]){throw new db[(_0x40b3('0x57'))][(_0x40b3('0x58'))](_0x40b3('0x65'));}}return _0x5acd9a;})['then'](function(_0x4d369f){if(_0x4d369f){return _0x4d369f['update']({'closed':_0x56c3bc[_0x40b3('0x2d')][_0x40b3('0x66')],'disposition':_0x56c3bc[_0x40b3('0x2d')]['disposition']})[_0x40b3('0x16')](function(_0x3603c0){return _0x3603c0;});}})[_0x40b3('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0x40b3('0x61'),_0x56c3bc[_0x40b3('0x2d')],client9004);})[_0x40b3('0x16')](respondWithResult(_0x1e42aa,null))[_0x40b3('0x41')](handleError(_0x1e42aa,null));};exports[_0x40b3('0x67')]=function(_0x2165ba,_0x176ed1){_0x2165ba[_0x40b3('0x2d')][_0x40b3('0x2a')]=_0x2165ba[_0x40b3('0x68')][_0x40b3('0x69')];_0x2165ba[_0x40b3('0x2d')][_0x40b3('0x6a')]=_0x2165ba[_0x40b3('0x68')][_0x40b3('0x6b')];_0x2165ba[_0x40b3('0x2d')][_0x40b3('0x6c')]=_0x2165ba[_0x40b3('0x68')][_0x40b3('0x6d')];return db[_0x40b3('0x6e')][_0x40b3('0x42')](_0x2165ba[_0x40b3('0x2d')])[_0x40b3('0x16')](respondWithResult(_0x176ed1,0xc9))['catch'](handleError(_0x176ed1,null));};exports[_0x40b3('0x6f')]=function(_0x5bbb20,_0x348e41){return db[_0x40b3('0x32')]['findOne']({'where':{'id':_0x5bbb20[_0x40b3('0x38')]['id']},'raw':!![]})[_0x40b3('0x16')](handleEntityNotFound(_0x348e41,null))[_0x40b3('0x16')](function(_0x1eb24c){if(_0x1eb24c){if(_0x1eb24c[_0x40b3('0x66')]){return _0x348e41[_0x40b3('0x1f')](0x193)['json']({'status':0x193,'message':_0x40b3('0x70')});}return db[_0x40b3('0x6e')][_0x40b3('0x48')]({'where':{'id':_0x5bbb20[_0x40b3('0x36')][_0x40b3('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x348e41,null));}})[_0x40b3('0x16')](function(_0x304bee){if(_0x304bee){var _0x188695=_0x304bee[_0x40b3('0x72')]!==null;var _0x28da93=path[_0x40b3('0x73')](config[_0x40b3('0x74')],_0x40b3('0x75'));if(_0x188695){_0x28da93=path[_0x40b3('0x73')](_0x28da93,_0x40b3('0x76'));}var _0x2727ef=path[_0x40b3('0x73')](_0x28da93,_0x304bee['basename']);return _0x348e41['download'](_0x2727ef);}})[_0x40b3('0x41')](handleError(_0x348e41,null));};exports[_0x40b3('0x77')]=function(_0x3f7806,_0x55542c){var _0x595ed9=null;var _0x4d8345=null;var _0x30135b=null;if(_0x3f7806[_0x40b3('0x2d')]['id']){delete _0x3f7806['body']['id'];}if(_0x3f7806[_0x40b3('0x2d')][_0x40b3('0x78')]){_0x30135b=path[_0x40b3('0x73')](config['root'],_0x40b3('0x79'),util[_0x40b3('0x7a')](_0x40b3('0x7b'),Date[_0x40b3('0x7c')]()));_0x3f7806[_0x40b3('0x2d')]['pathTranscript']=_0x30135b;}return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x3f7806[_0x40b3('0x38')]['id']},'include':[{'model':db[_0x40b3('0x5d')],'as':_0x40b3('0x7d'),'include':[{'model':db[_0x40b3('0x7e')],'as':'User'}]}]})[_0x40b3('0x16')](handleEntityNotFound(_0x55542c,null))[_0x40b3('0x16')](saveUpdates(_0x3f7806['body'],null))['then'](function(_0x39f600){if(_0x39f600){_0x595ed9=_0x39f600;return db[_0x40b3('0x47')][_0x40b3('0x44')]({'where':{'id':_0x595ed9[_0x40b3('0x49')]}});}})['then'](function(_0xac3d4){if(_0xac3d4){_0x4d8345=_0xac3d4;return db[_0x40b3('0x7f')]['find']({'where':{'id':_0x595ed9['ContactId']}});}})[_0x40b3('0x16')](function(_0x3d9b80){if(_0x3d9b80){if(_0x30135b){var _0x87e2c4=null;for(var _0x221542=0x1;_0x221542<_0x595ed9[_0x40b3('0x7d')][_0x40b3('0x80')];++_0x221542){_0x87e2c4=_0x595ed9['Messages'][_0x221542];var _0x2219f8=_0x87e2c4[_0x40b3('0x64')]?util[_0x40b3('0x7a')]('%s%d',_0x4d8345['agentAlias'],_0x87e2c4['UserId']):_0x40b3('0x81');var _0x3caaae=_0x3f7806[_0x40b3('0x2d')][_0x40b3('0x82')]||util[_0x40b3('0x7a')]('%s%d',_0x40b3('0x83'),_0x87e2c4[_0x40b3('0x84')]);switch(_0x4d8345[_0x40b3('0x85')]){case _0x40b3('0x86'):_0x2219f8=_0x87e2c4['UserId']?util[_0x40b3('0x7a')](_0x40b3('0x87'),_0x4d8345[_0x40b3('0x88')],_0x87e2c4[_0x40b3('0x64')]):_0x40b3('0x81');break;case _0x40b3('0x89'):_0x2219f8=_0x87e2c4[_0x40b3('0x64')]?_0x87e2c4[_0x40b3('0x7e')][_0x40b3('0x8a')]||_0x87e2c4[_0x40b3('0x7e')]['fullname']:_0x40b3('0x81');break;case'agent_fullname':_0x2219f8=_0x87e2c4[_0x40b3('0x64')]?_0x87e2c4[_0x40b3('0x7e')][_0x40b3('0x4f')]:_0x40b3('0x81');break;default:_0x2219f8=_0x87e2c4[_0x40b3('0x64')]?util['format'](_0x40b3('0x87'),_0x4d8345[_0x40b3('0x88')],_0x87e2c4['UserId']):_0x40b3('0x81');}var _0x5c06b9=util['format'](_0x40b3('0x8b'),moment(_0x87e2c4[_0x40b3('0x8c')])[_0x40b3('0x7a')](_0x40b3('0x8d')),_0x87e2c4[_0x40b3('0x8e')]==='in'?_0x3caaae:_0x2219f8,_0x87e2c4[_0x40b3('0x2d')]);if(!_0x87e2c4[_0x40b3('0x8f')]){fs[_0x40b3('0x90')](_0x30135b,_0x5c06b9);}}return db[_0x40b3('0x91')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x40b3('0x92')],'as':_0x40b3('0x93'),'raw':!![],'include':[{'model':db[_0x40b3('0x94')],'as':_0x40b3('0x94'),'raw':!![]}]}]});}}})[_0x40b3('0x16')](function(_0x688c8e){if(!_0x688c8e||!_0x688c8e[_0x40b3('0x93')]||!_0x3f7806[_0x40b3('0x2d')])return _0x595ed9;var _0x22a39d=_0x688c8e[_0x40b3('0x95')]();return respondWithRpcPromise(_0x40b3('0x96'),_0x40b3('0x97'),{'account':_0x22a39d,'message':{'from':util[_0x40b3('0x7a')](_0x40b3('0x98'),_0x688c8e[_0x40b3('0x2a')],_0x688c8e[_0x40b3('0x50')]||_0x688c8e[_0x40b3('0x93')][_0x40b3('0x37')]),'to':_0x3f7806[_0x40b3('0x2d')][_0x40b3('0x78')],'subject':_0x40b3('0x99'),'text':util['format'](_0x40b3('0x9a'),_0x3f7806['body'][_0x40b3('0x78')]),'attachments':[{'path':_0x30135b}]}})[_0x40b3('0x16')](function(){return _0x595ed9;})[_0x40b3('0x41')](function(_0x562aee){logger[_0x40b3('0x1b')](_0x562aee);});})[_0x40b3('0x16')](respondWithStatusCode(_0x55542c,0xc8))[_0x40b3('0x41')](handleError(_0x55542c,null));};exports[_0x40b3('0x9b')]=function(_0x5297fb,_0x3ba0e8){return db[_0x40b3('0x5d')][_0x40b3('0x44')]({'where':{'id':_0x5297fb[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0x3ba0e8,null))[_0x40b3('0x16')](function(_0x25b077){if(_0x25b077){return _0x25b077[_0x40b3('0x9b')](_0x5297fb[_0x40b3('0x2d')][_0x40b3('0x9c')],_[_0x40b3('0x9d')](_0x5297fb[_0x40b3('0x2d')],['ids','id'])||{});}})[_0x40b3('0x16')](respondWithResult(_0x3ba0e8,null))['catch'](handleError(_0x3ba0e8,null));};exports['getMessages']=function(_0x4588b9,_0x2ff308){var _0xe352ee={'raw':![],'where':{}};var _0x3e39b6={};var _0x1266ab={'count':0x0,'rows':[]};return db[_0x40b3('0x32')][_0x40b3('0x48')]({'where':{'id':_0x4588b9[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0x2ff308,null))[_0x40b3('0x16')](function(_0x402fab){if(_0x402fab){_0x3e39b6['model']=_['keys'](db[_0x40b3('0x5d')][_0x40b3('0x33')]);_0x3e39b6[_0x40b3('0x36')]=_[_0x40b3('0x3a')](_0x4588b9['query']);_0x3e39b6[_0x40b3('0x3b')]=_[_0x40b3('0x3d')](_0x3e39b6[_0x40b3('0x39')],_0x3e39b6[_0x40b3('0x36')]);_0xe352ee[_0x40b3('0x3c')]=_[_0x40b3('0x3d')](_0x3e39b6['model'],qs['fields'](_0x4588b9['query'][_0x40b3('0x3e')]));_0xe352ee[_0x40b3('0x3c')]=_0xe352ee[_0x40b3('0x3c')][_0x40b3('0x80')]?_0xe352ee[_0x40b3('0x3c')]:_0x3e39b6[_0x40b3('0x39')];if(!_0x4588b9[_0x40b3('0x36')][_0x40b3('0x9e')](_0x40b3('0x9f'))){_0xe352ee['limit']=qs[_0x40b3('0x25')](_0x4588b9['query'][_0x40b3('0x25')]);_0xe352ee[_0x40b3('0x22')]=qs[_0x40b3('0x22')](_0x4588b9[_0x40b3('0x36')][_0x40b3('0x22')]);}_0xe352ee[_0x40b3('0xa0')]=qs[_0x40b3('0xa1')](_0x4588b9[_0x40b3('0x36')]['sort']);_0xe352ee[_0x40b3('0xa2')]=qs[_0x40b3('0x3b')](_['pick'](_0x4588b9[_0x40b3('0x36')],_0x3e39b6['filters']));_0xe352ee['where'][_0x40b3('0xa3')]=_0x402fab['id'];if(_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa4')]){_0xe352ee['where']=_[_0x40b3('0x2c')](_0xe352ee[_0x40b3('0xa2')],{'$or':_[_0x40b3('0x31')](_0xe352ee[_0x40b3('0x3c')],function(_0x29110a){var _0x368f39={};_0x368f39[_0x29110a]={'$like':'%'+_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa4')]+'%'};return _0x368f39;})});}if(_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa5')]){var _0x48ff1e=_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa5')]['split'](',');var _0x373597={};_0x373597[_0x48ff1e[0x0]]={'$gte':moment(_0x48ff1e[0x1])['format'](_0x40b3('0xa6'))};_0xe352ee['where']=_[_0x40b3('0x2c')](_0xe352ee[_0x40b3('0xa2')],_0x373597);}_0xe352ee=_[_0x40b3('0x2c')]({},_0xe352ee,_0x4588b9[_0x40b3('0x40')]);return db[_0x40b3('0x5d')][_0x40b3('0x24')]({'where':_0xe352ee[_0x40b3('0xa2')]})['then'](function(_0x498875){_0x1266ab[_0x40b3('0x24')]=_0x498875;if(_0x4588b9[_0x40b3('0x36')][_0x40b3('0xa7')]){_0xe352ee[_0x40b3('0x3f')]=[{'all':!![]}];}return db[_0x40b3('0x5d')][_0x40b3('0x35')](_0xe352ee);})[_0x40b3('0x16')](function(_0x4f74c2){_0x1266ab[_0x40b3('0xa8')]=_0x4f74c2;return _0x1266ab;});}})[_0x40b3('0x16')](respondWithFilteredResult(_0x2ff308,_0xe352ee))[_0x40b3('0x41')](handleError(_0x2ff308,null));};exports[_0x40b3('0xa9')]=function(_0x1ab372,_0x54cccc){var _0x441595={'where':{}},_0x42d830={},_0x2943c5={'count':0x0,'rows':[]};return db[_0x40b3('0x32')]['findOne']({'where':{'id':_0x1ab372['params']['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0x54cccc,null))['then'](function(_0x478010){if(_0x478010){_0x42d830['model']=_[_0x40b3('0x3a')](db[_0x40b3('0x5d')]['rawAttributes']);_0x42d830[_0x40b3('0x36')]=_[_0x40b3('0x3a')](_0x1ab372[_0x40b3('0x36')]);_0x42d830[_0x40b3('0x3b')]=_['intersection'](_0x42d830[_0x40b3('0x39')],_0x42d830[_0x40b3('0x36')]);_0x441595[_0x40b3('0x3c')]=_[_0x40b3('0x3d')](_0x42d830[_0x40b3('0x39')],qs[_0x40b3('0x3e')](_0x1ab372[_0x40b3('0x36')]['fields']));_0x441595[_0x40b3('0x3c')]=_0x441595[_0x40b3('0x3c')][_0x40b3('0x80')]?_0x441595['attributes']:_0x42d830[_0x40b3('0x39')];if(!_0x1ab372[_0x40b3('0x36')]['hasOwnProperty'](_0x40b3('0x9f'))){_0x441595['limit']=qs[_0x40b3('0x25')](_0x1ab372[_0x40b3('0x36')][_0x40b3('0x25')]);_0x441595[_0x40b3('0x22')]=qs[_0x40b3('0x22')](_0x1ab372[_0x40b3('0x36')]['offset']);}_0x441595[_0x40b3('0xa0')]=qs[_0x40b3('0xa1')](_0x1ab372[_0x40b3('0x36')][_0x40b3('0xa1')]);_0x441595['where']=qs[_0x40b3('0x3b')](_[_0x40b3('0xaa')](_0x1ab372[_0x40b3('0x36')],_0x42d830[_0x40b3('0x3b')]));_0x441595[_0x40b3('0xa2')][_0x40b3('0xa3')]=_0x478010['id'];if(_0x1ab372[_0x40b3('0x36')][_0x40b3('0xa4')]){_0x441595['where']=_[_0x40b3('0x2c')](_0x441595[_0x40b3('0xa2')],{'$or':_['map'](_0x441595[_0x40b3('0x3c')],function(_0x2cc37b){var _0x9cfd7a={};_0x9cfd7a[_0x2cc37b]={'$like':'%'+_0x1ab372[_0x40b3('0x36')][_0x40b3('0xa4')]+'%'};return _0x9cfd7a;})});}_0x441595[_0x40b3('0xa2')][_0x40b3('0x8f')]=![];if(_0x1ab372[_0x40b3('0x36')]['id']){_0x441595['where']['id']={'$gt':_0x1ab372[_0x40b3('0x36')]['id']};}_0x441595=_['merge']({},_0x441595,_0x1ab372['options']);return db[_0x40b3('0x5d')][_0x40b3('0x24')]({'where':_0x441595[_0x40b3('0xa2')]})[_0x40b3('0x16')](function(_0x5e596a){_0x2943c5[_0x40b3('0x24')]=_0x5e596a;_0x441595[_0x40b3('0x3f')]=[];if(_0x1ab372[_0x40b3('0x36')][_0x40b3('0xab')]){_0x441595['include'][_0x40b3('0xac')]({'model':db['User'],'as':_0x40b3('0x7e'),'attributes':['id',_0x40b3('0x4f'),_0x40b3('0x8a')]});}if(_0x1ab372['query'][_0x40b3('0xa7')]){_0x441595['include']=[{'all':!![]}];}return db[_0x40b3('0x5d')][_0x40b3('0x35')](_0x441595);})[_0x40b3('0x16')](function(_0x12cea8){_0x2943c5[_0x40b3('0xa8')]=_0x12cea8;return _0x2943c5;});}})['then'](respondWithFilteredResult(_0x54cccc,_0x441595))['catch'](handleError(_0x54cccc,null));};exports['addTags']=function(_0x15941d,_0x235829){return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x15941d[_0x40b3('0x38')]['id']}})['then'](handleEntityNotFound(_0x235829,null))[_0x40b3('0x16')](function(_0x1e7b59){if(_0x1e7b59){return _0x1e7b59[_0x40b3('0xad')](_0x15941d[_0x40b3('0x2d')][_0x40b3('0x9c')],_[_0x40b3('0x9d')](_0x15941d['body'],[_0x40b3('0x9c'),'id'])||{})[_0x40b3('0xae')](function(){return db[_0x40b3('0xaf')][_0x40b3('0x35')]({'attributes':['id','name',_0x40b3('0xb0')],'where':{'id':_0x15941d[_0x40b3('0x2d')][_0x40b3('0x9c')]}});})[_0x40b3('0x16')](function(_0x18832d){socket[_0x40b3('0xb1')](_0x40b3('0xb2'),{'id':Number(_0x15941d[_0x40b3('0x38')]['id']),'tags':_0x18832d||[]});return{'id':Number(_0x15941d[_0x40b3('0x38')]['id']),'tags':_0x18832d||[]};});}})[_0x40b3('0x16')](respondWithResult(_0x235829,null))[_0x40b3('0x41')](handleError(_0x235829,null));};exports[_0x40b3('0xb3')]=function(_0x3ee907,_0xcdff5d){return db[_0x40b3('0x32')][_0x40b3('0x44')]({'where':{'id':_0x3ee907[_0x40b3('0x38')]['id']}})[_0x40b3('0x16')](handleEntityNotFound(_0xcdff5d,null))['then'](function(_0x59d69f){if(_0x59d69f){return _0x59d69f[_0x40b3('0xb3')](_0x3ee907['query']['ids']);}})['then'](respondWithStatusCode(_0xcdff5d,null))[_0x40b3('0x41')](handleError(_0xcdff5d,null));};exports[_0x40b3('0xb4')]=function(_0x529d67,_0x3fa8b9){var _0x311267=moment()['unix']()[_0x40b3('0xb5')]();var _0x49b485=path[_0x40b3('0x73')](config['root'],_0x40b3('0xb6'),_0x40b3('0xb7'),_0x40b3('0xb8'));var _0x4850de=path[_0x40b3('0x73')](config[_0x40b3('0x74')],_0x40b3('0xb6'),_0x40b3('0xb7'),'attachments');var _0x345353=path[_0x40b3('0x73')](_0x49b485,_0x311267);var _0x5d3718=util[_0x40b3('0x7a')](_0x40b3('0xb9'),_0x529d67['params']['id'],_0x311267);var _0xaa6c5b=path[_0x40b3('0x73')](_0x49b485,_0x5d3718);var _0x5d0979=[];_0x5d0979[_0x40b3('0xac')]({'model':db['User'],'as':_0x40b3('0x7e'),'attributes':['id',_0x40b3('0x4f')],'raw':!![]});_0x5d0979[_0x40b3('0xac')]({'model':db[_0x40b3('0x7f')],'as':_0x40b3('0x60'),'attributes':['id','firstName',_0x40b3('0xba')],'raw':!![]});if(_0x529d67[_0x40b3('0x36')][_0x40b3('0xbb')]){_0x5d0979[_0x40b3('0xac')]({'model':db[_0x40b3('0x6e')],'as':_0x40b3('0x6e'),'raw':!![]});}var _0x6ebd80=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body',_0x40b3('0x8c'),_0x40b3('0x8e'),_0x40b3('0x8f'),_0x40b3('0xbc')],'include':_0x5d0979}];_0x6ebd80[_0x40b3('0xac')]({'model':db[_0x40b3('0x47')],'as':_0x40b3('0xbd'),'attributes':['id',_0x40b3('0x2a')]});_0x6ebd80[_0x40b3('0xac')]({'model':db['User'],'as':_0x40b3('0xbe'),'attributes':['id',_0x40b3('0x4f')]});return db['ChatInteraction'][_0x40b3('0x44')]({'where':{'id':_0x529d67[_0x40b3('0x38')]['id']},'include':_0x6ebd80})[_0x40b3('0x16')](handleEntityNotFound(_0x3fa8b9,null))[_0x40b3('0x16')](function(_0x55a7f1){if(_0x55a7f1){var _0x147405=_0x55a7f1[_0x40b3('0xbf')]({'plain':!![]});fs[_0x40b3('0xc0')](_0x345353);var _0x53d1dd={'channel':'Chat','account':_0x147405['Account'][_0x40b3('0x2a')],'agent':_0x147405[_0x40b3('0xbe')]?_0x147405[_0x40b3('0xbe')]['fullname']:_0x40b3('0xc1'),'createdAt':moment(_0x147405[_0x40b3('0x8c')])['format'](_0x40b3('0xa6'))['toString'](),'closedAt':_0x147405[_0x40b3('0x66')]?moment(_0x147405[_0x40b3('0xc2')])[_0x40b3('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x40b3('0xb5')]():'','disposition':_0x147405[_0x40b3('0xc3')],'chatInfo':{'browser':_0x147405['browserName'],'os':_0x147405['osName'],'referer':_0x147405['referer'],'customerIp':_0x147405[_0x40b3('0xc4')],'customerPort':_0x147405[_0x40b3('0xc5')]?_0x147405[_0x40b3('0xc5')]:_0x40b3('0xc1')},'messages':_(_0x147405[_0x40b3('0x7d')])['tail']()[_0x40b3('0xa4')]({'secret':![]})[_0x40b3('0x31')](function(_0x43c7a6){if(_0x43c7a6['Attachment']){var _0x175581=path['join'](_0x4850de,_0x43c7a6[_0x40b3('0x6e')][_0x40b3('0x6a')]);if(fs[_0x40b3('0xc6')](_0x175581)){fs[_0x40b3('0xc7')](_0x175581)[_0x40b3('0xc8')](fs[_0x40b3('0xc9')](path[_0x40b3('0x73')](_0x345353,_0x43c7a6[_0x40b3('0x6e')][_0x40b3('0x6a')])));}}return{'date':moment(_0x43c7a6[_0x40b3('0x8c')])[_0x40b3('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x40b3('0xb5')](),'sender':_0x43c7a6[_0x40b3('0x8e')]==='out'?_0x43c7a6[_0x40b3('0x7e')]?_0x43c7a6[_0x40b3('0x7e')][_0x40b3('0x4f')]:_0x40b3('0x81'):_0x43c7a6[_0x40b3('0x60')][_0x40b3('0xca')]+(_0x43c7a6[_0x40b3('0x60')][_0x40b3('0xba')]?'\x20'+_0x43c7a6[_0x40b3('0x60')][_0x40b3('0xba')]:''),'body':_0x43c7a6[_0x40b3('0x6e')]?_0x43c7a6[_0x40b3('0x6e')][_0x40b3('0x6a')]:_0x43c7a6[_0x40b3('0x2d')],'direction':_0x43c7a6['direction']===_0x40b3('0x5c')?'A':'C','secret':_0x43c7a6[_0x40b3('0x8f')],'read':_0x43c7a6[_0x40b3('0xbc')],'attachment':_0x43c7a6['Attachment']};})['value']()};return ejs[_0x40b3('0xcb')](path[_0x40b3('0x73')](config[_0x40b3('0x74')],_0x40b3('0xb6'),'views',_0x40b3('0xcc')),{'interaction':_0x53d1dd})[_0x40b3('0x16')](function(_0x405902){var _0x328a65=path[_0x40b3('0x73')](_0x345353,_0x40b3('0xcd')+_0x147405['id']+'-'+_0x311267+_0x40b3('0xce'));var _0xa9a7fa={'path':_0x328a65,'channel':_0x40b3('0xcf'),'interactionId':_0x147405['id']};return pdf[_0x40b3('0xd0')](_0x405902,_0xa9a7fa);})['then'](function(){return new Promise(function(_0x2df45d,_0x1f8ec8){zipdir(_0x345353,{'saveTo':_0xaa6c5b},function(_0x2db24d,_0xb1d54c){if(_0x2db24d)return _0x1f8ec8(_0x2db24d);return _0x2df45d(_0xb1d54c);});})[_0x40b3('0x16')](function(){return new BPromise(function(_0x118ba4,_0x55fff2){rimraf(_0x345353,function(_0x4fc76a){if(_0x4fc76a)_0x55fff2(_0x4fc76a);return _0x118ba4();});});})[_0x40b3('0x16')](function(){return _0x3fa8b9[_0x40b3('0xb4')](_0xaa6c5b,_0x5d3718,function(_0x60beaa){if(_0x60beaa){logger['error'](_0x40b3('0xd1'),_0x60beaa);}else{fs[_0x40b3('0xd2')](_0xaa6c5b);}});});});}else{return _0x3fa8b9[_0x40b3('0x29')](0xc8);}})[_0x40b3('0x41')](handleError(_0x3fa8b9,null));};
\ No newline at end of file
index 3cb0153..0abf397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5671=['map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x280dd8,_0x5c8eb8){var _0x2a6aa6=function(_0x118d85){while(--_0x118d85){_0x280dd8['push'](_0x280dd8['shift']());}};_0x2a6aa6(++_0x5c8eb8);}(_0x5671,0x1b9));var _0x1567=function(_0x3a544a,_0x73a217){_0x3a544a=_0x3a544a-0x0;var _0x342f1e=_0x5671[_0x3a544a];return _0x342f1e;};'use strict';var EventEmitter=require(_0x1567('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x1567('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1567('0x2')](0x0);var events={'afterCreate':_0x1567('0x3'),'afterUpdate':_0x1567('0x4'),'afterDestroy':_0x1567('0x5')};function emitEvent(_0x30f32a){return function(_0x2e6a7f,_0x4031bb,_0x16ad65){_0x2e6a7f[_0x1567('0x6')]({'attributes':['id'],'raw':!![]})[_0x1567('0x7')](function(_0x3da798){_0x2e6a7f['setDataValue'](_0x1567('0x8'),_0x3da798[_0x1567('0x9')](function(_0x50a51c){return{'id':_0x50a51c['id']};}));return ChatMessage[_0x1567('0xa')]({'where':{'ChatInteractionId':_0x2e6a7f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1567('0x7')](function(_0x300e2a){_0x2e6a7f[_0x1567('0xb')](_0x1567('0xc'),_0x300e2a[_0x1567('0xd')]);ChatInteractionEvents['emit'](_0x30f32a+':'+_0x2e6a7f['id'],_0x2e6a7f);ChatInteractionEvents[_0x1567('0xe')](_0x30f32a,_0x2e6a7f);_0x16ad65(null);})[_0x1567('0xf')](_0x16ad65(null));};}for(var e in events){if(events[_0x1567('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x1567('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x8196=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x408b32,_0x792c51){var _0x4958c5=function(_0x4ea419){while(--_0x4ea419){_0x408b32['push'](_0x408b32['shift']());}};_0x4958c5(++_0x792c51);}(_0x8196,0x144));var _0x6819=function(_0x2ba04e,_0x594656){_0x2ba04e=_0x2ba04e-0x0;var _0x4cbd78=_0x8196[_0x2ba04e];return _0x4cbd78;};'use strict';var EventEmitter=require(_0x6819('0x0'));var ChatInteraction=require(_0x6819('0x1'))['db'][_0x6819('0x2')];var ChatMessage=require(_0x6819('0x1'))['db'][_0x6819('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6819('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6819('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50adac){return function(_0x4e3482,_0x462ceb,_0x4d021b){_0x4e3482[_0x6819('0x6')]({'attributes':['id'],'raw':!![]})[_0x6819('0x7')](function(_0x4a4175){_0x4e3482[_0x6819('0x8')](_0x6819('0x9'),_0x4a4175[_0x6819('0xa')](function(_0x25e279){return{'id':_0x25e279['id']};}));return ChatMessage[_0x6819('0xb')]({'where':{'ChatInteractionId':_0x4e3482['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6819('0x7')](function(_0x1558da){_0x4e3482['setDataValue'](_0x6819('0xc'),_0x1558da['length']);ChatInteractionEvents[_0x6819('0xd')](_0x50adac+':'+_0x4e3482['id'],_0x4e3482);ChatInteractionEvents['emit'](_0x50adac,_0x4e3482);_0x4d021b(null);})[_0x6819('0xe')](_0x4d021b(null));};}for(var e in events){if(events[_0x6819('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x6819('0x10')]=ChatInteractionEvents;
\ No newline at end of file
index 18f678f..922a59a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b3b=['rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0xe237e4,_0x5628ca){var _0x368fb5=function(_0xefd2c8){while(--_0xefd2c8){_0xe237e4['push'](_0xe237e4['shift']());}};_0x368fb5(++_0x5628ca);}(_0x3b3b,0xa4));var _0xb3b3=function(_0x3963bd,_0x7cbac0){_0x3963bd=_0x3963bd-0x0;var _0x3e129e=_0x3b3b[_0x3963bd];return _0x3e129e;};'use strict';var _=require(_0xb3b3('0x0'));var util=require(_0xb3b3('0x1'));var logger=require(_0xb3b3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb3b3('0x3'));var rp=require(_0xb3b3('0x4'));var fs=require('fs');var path=require(_0xb3b3('0x5'));var rimraf=require(_0xb3b3('0x6'));var config=require(_0xb3b3('0x7'));var attributes=require(_0xb3b3('0x8'));module[_0xb3b3('0x9')]=function(_0x51d6e0,_0x3fcedb){return _0x51d6e0['define']('ChatInteraction',attributes,{'tableName':_0xb3b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5bca40,_0x4f4018,_0x559250){if(_0x5bca40[_0xb3b3('0xb')](_0xb3b3('0xc'))){_0x5bca40['closedAt']=moment()[_0xb3b3('0xd')](_0xb3b3('0xe'));}_0x559250(null,_0x5bca40);}},'charset':_0xb3b3('0xf'),'collate':_0xb3b3('0x10')});};
\ No newline at end of file
+var _0x90fc=['request-promise','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90fc,0x1be));var _0xc90f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x90fc[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xc90f('0x0'));var util=require(_0xc90f('0x1'));var logger=require('../../config/logger')(_0xc90f('0x2'));var moment=require(_0xc90f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc90f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc90f('0x5'));var attributes=require(_0xc90f('0x6'));module['exports']=function(_0x19a870,_0x2c4f29){return _0x19a870[_0xc90f('0x7')](_0xc90f('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d69bd,_0x21e499,_0x328b){if(_0x4d69bd['changed'](_0xc90f('0x9'))){_0x4d69bd[_0xc90f('0xa')]=moment()[_0xc90f('0xb')](_0xc90f('0xc'));}_0x328b(null,_0x4d69bd);}},'charset':_0xc90f('0xd'),'collate':_0xc90f('0xe')});};
\ No newline at end of file
index 16b2b1a..5664dea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c4=['request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register'];(function(_0x2890d1,_0x484efd){var _0x44d6a2=function(_0x1f8fd7){while(--_0x1f8fd7){_0x2890d1['push'](_0x2890d1['shift']());}};_0x44d6a2(++_0x484efd);}(_0xb0c4,0x17b));var _0x4b0c=function(_0xc753c8,_0x5627ff){_0xc753c8=_0xc753c8-0x0;var _0xd02f5c=_0xb0c4[_0xc753c8];return _0xd02f5c;};'use strict';var _=require(_0x4b0c('0x0'));var util=require(_0x4b0c('0x1'));var moment=require(_0x4b0c('0x2'));var BPromise=require(_0x4b0c('0x3'));var rs=require(_0x4b0c('0x4'));var fs=require('fs');var Redis=require(_0x4b0c('0x5'));var db=require(_0x4b0c('0x6'))['db'];var utils=require(_0x4b0c('0x7'));var logger=require(_0x4b0c('0x8'))('rpc');var config=require(_0x4b0c('0x9'));var jayson=require(_0x4b0c('0xa'));var client=jayson[_0x4b0c('0xb')][_0x4b0c('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4b0c('0xd')],{'host':_0x4b0c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4b0c('0xf'))[_0x4b0c('0x10')](socket);function respondWithRpcPromise(_0x416146,_0x2f2af1,_0x4bdcd5){return new BPromise(function(_0x2f4181,_0x57452e){return client[_0x4b0c('0x11')](_0x416146,_0x4bdcd5)[_0x4b0c('0x12')](function(_0x2b1b56){logger[_0x4b0c('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x2f2af1,_0x4b0c('0x14'));logger[_0x4b0c('0x15')](_0x4b0c('0x16'),_0x2f2af1,'request\x20sent',JSON[_0x4b0c('0x17')](_0x2b1b56));if(_0x2b1b56[_0x4b0c('0x18')]){if(_0x2b1b56[_0x4b0c('0x18')][_0x4b0c('0x19')]===0x1f4){logger['error'](_0x4b0c('0x1a'),_0x2f2af1,_0x2b1b56[_0x4b0c('0x18')][_0x4b0c('0x1b')]);return _0x57452e(_0x2b1b56['error'][_0x4b0c('0x1b')]);}logger[_0x4b0c('0x18')](_0x4b0c('0x1a'),_0x2f2af1,_0x2b1b56[_0x4b0c('0x18')][_0x4b0c('0x1b')]);return _0x2f4181(_0x2b1b56[_0x4b0c('0x18')][_0x4b0c('0x1b')]);}else{logger[_0x4b0c('0x13')](_0x4b0c('0x1a'),_0x2f2af1,'request\x20sent');_0x2f4181(_0x2b1b56[_0x4b0c('0x1c')]['message']);}})[_0x4b0c('0x1d')](function(_0xb363d0){logger[_0x4b0c('0x18')](_0x4b0c('0x1a'),_0x2f2af1,_0xb363d0);_0x57452e(_0xb363d0);});});}exports['UpdateChatInteraction']=function(_0x111fa7){var _0x59d92b=this;return new Promise(function(_0x5ebae4,_0x4d7975){return db[_0x4b0c('0x1e')][_0x4b0c('0x1f')](_0x111fa7[_0x4b0c('0x20')],{'raw':_0x111fa7[_0x4b0c('0x21')]?_0x111fa7[_0x4b0c('0x21')][_0x4b0c('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x111fa7[_0x4b0c('0x21')]?_0x111fa7[_0x4b0c('0x21')][_0x4b0c('0x23')]||null:null,'attributes':_0x111fa7[_0x4b0c('0x21')]?_0x111fa7['options'][_0x4b0c('0x24')]||null:null,'limit':_0x111fa7['options']?_0x111fa7[_0x4b0c('0x21')][_0x4b0c('0x25')]||null:null})[_0x4b0c('0x12')](function(_0x3fcbfb){logger['info']('UpdateChatInteraction',_0x111fa7);logger[_0x4b0c('0x15')](_0x4b0c('0x26'),_0x111fa7,JSON[_0x4b0c('0x17')](_0x3fcbfb));_0x5ebae4(_0x3fcbfb);})[_0x4b0c('0x1d')](function(_0x2f868f){logger[_0x4b0c('0x18')]('UpdateChatInteraction',_0x2f868f['message'],_0x111fa7);_0x4d7975(_0x59d92b['error'](0x1f4,_0x2f868f['message']));});});};exports[_0x4b0c('0x27')]=function(_0x34aaa4){return new Promise(function(_0x5a723e,_0x185ccd){return db['ChatInteraction']['find']({'where':_0x34aaa4['options']?_0x34aaa4[_0x4b0c('0x21')]['where']||null:null})['then'](function(_0x146143){if(_0x146143){return _0x146143[_0x4b0c('0x28')](_0x34aaa4[_0x4b0c('0x20')][_0x4b0c('0x29')],_['omit'](_0x34aaa4[_0x4b0c('0x20')],[_0x4b0c('0x29'),'id'])||{});}})[_0x4b0c('0x2a')](function(_0x40cd9c){logger[_0x4b0c('0x13')](_0x4b0c('0x2b'),_0x34aaa4);logger['debug']('AddTags',_0x34aaa4,JSON[_0x4b0c('0x17')](_0x40cd9c));_0x5a723e(_0x40cd9c);})[_0x4b0c('0x1d')](function(_0x397fc2){logger[_0x4b0c('0x18')](_0x4b0c('0x2b'),_0x397fc2[_0x4b0c('0x1b')],_0x34aaa4);_0x185ccd(_this[_0x4b0c('0x18')](0x1f4,_0x397fc2[_0x4b0c('0x1b')]));});});};
\ No newline at end of file
+var _0x3ee5=['catch','ChatInteraction','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','AddTags','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x3ee5,0x18a));var _0x53ee=function(_0x1f7199,_0x144fbc){_0x1f7199=_0x1f7199-0x0;var _0x577298=_0x3ee5[_0x1f7199];return _0x577298;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53ee('0x0'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53ee('0x2'));var logger=require(_0x53ee('0x3'))(_0x53ee('0x4'));var config=require(_0x53ee('0x5'));var jayson=require(_0x53ee('0x6'));var client=jayson[_0x53ee('0x7')][_0x53ee('0x8')]({'port':0x232a});config[_0x53ee('0x9')]=_[_0x53ee('0xa')](config[_0x53ee('0x9')],{'host':_0x53ee('0xb'),'port':0x18eb});var socket=require(_0x53ee('0xc'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x53ee('0xd')](socket);function respondWithRpcPromise(_0x51b769,_0x530033,_0x25f854){return new BPromise(function(_0x56cda0,_0x851312){return client['request'](_0x51b769,_0x25f854)[_0x53ee('0xe')](function(_0x39e080){logger[_0x53ee('0xf')](_0x53ee('0x10'),_0x530033,'request\x20sent');logger[_0x53ee('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x530033,_0x53ee('0x12'),JSON[_0x53ee('0x13')](_0x39e080));if(_0x39e080['error']){if(_0x39e080[_0x53ee('0x14')][_0x53ee('0x15')]===0x1f4){logger['error'](_0x53ee('0x10'),_0x530033,_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);return _0x851312(_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);}logger[_0x53ee('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x530033,_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);return _0x56cda0(_0x39e080[_0x53ee('0x14')][_0x53ee('0x16')]);}else{logger[_0x53ee('0xf')](_0x53ee('0x10'),_0x530033,_0x53ee('0x12'));_0x56cda0(_0x39e080[_0x53ee('0x17')][_0x53ee('0x16')]);}})[_0x53ee('0x18')](function(_0x46831c){logger[_0x53ee('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x530033,_0x46831c);_0x851312(_0x46831c);});});}exports['UpdateChatInteraction']=function(_0x2c5332){var _0x4fe546=this;return new Promise(function(_0x401090,_0x2371bd){return db[_0x53ee('0x19')]['update'](_0x2c5332[_0x53ee('0x1a')],{'raw':_0x2c5332[_0x53ee('0x1b')]?_0x2c5332[_0x53ee('0x1b')][_0x53ee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5332['options']?_0x2c5332[_0x53ee('0x1b')][_0x53ee('0x1d')]||null:null,'attributes':_0x2c5332[_0x53ee('0x1b')]?_0x2c5332[_0x53ee('0x1b')][_0x53ee('0x1e')]||null:null,'limit':_0x2c5332[_0x53ee('0x1b')]?_0x2c5332['options'][_0x53ee('0x1f')]||null:null})[_0x53ee('0xe')](function(_0x2a65d0){logger[_0x53ee('0xf')](_0x53ee('0x20'),_0x2c5332);logger[_0x53ee('0x11')](_0x53ee('0x20'),_0x2c5332,JSON['stringify'](_0x2a65d0));_0x401090(_0x2a65d0);})[_0x53ee('0x18')](function(_0x46f391){logger[_0x53ee('0x14')](_0x53ee('0x20'),_0x46f391[_0x53ee('0x16')],_0x2c5332);_0x2371bd(_0x4fe546[_0x53ee('0x14')](0x1f4,_0x46f391['message']));});});};exports[_0x53ee('0x21')]=function(_0x3cd3bc){return new Promise(function(_0x362f9e,_0x113d31){return db[_0x53ee('0x19')][_0x53ee('0x22')]({'where':_0x3cd3bc[_0x53ee('0x1b')]?_0x3cd3bc[_0x53ee('0x1b')][_0x53ee('0x1d')]||null:null})['then'](function(_0x323a53){if(_0x323a53){return _0x323a53[_0x53ee('0x23')](_0x3cd3bc['body'][_0x53ee('0x24')],_['omit'](_0x3cd3bc['body'],[_0x53ee('0x24'),'id'])||{});}})['spread'](function(_0x4951b7){logger['info'](_0x53ee('0x25'),_0x3cd3bc);logger[_0x53ee('0x11')](_0x53ee('0x25'),_0x3cd3bc,JSON[_0x53ee('0x13')](_0x4951b7));_0x362f9e(_0x4951b7);})[_0x53ee('0x18')](function(_0x53aa99){logger[_0x53ee('0x14')](_0x53ee('0x25'),_0x53aa99[_0x53ee('0x16')],_0x3cd3bc);_0x113d31(_this[_0x53ee('0x14')](0x1f4,_0x53aa99[_0x53ee('0x16')]));});});};
\ No newline at end of file
index f0de51d..b8eb231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe8=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fe8,0x167));var _0x89fe=function(_0x4f0dd9,_0x1ac799){_0x4f0dd9=_0x4f0dd9-0x0;var _0x44daaf=_0x9fe8[_0x4f0dd9];return _0x44daaf;};'use strict';var ChatInteractionEvents=require(_0x89fe('0x0'));var events=[_0x89fe('0x1'),_0x89fe('0x2'),_0x89fe('0x3')];function createListener(_0x113495,_0x33beee){return function(_0x35b8da){_0x33beee[_0x89fe('0x4')](_0x113495,_0x35b8da);};}function removeListener(_0x230938,_0x51e359){return function(){ChatInteractionEvents['removeListener'](_0x230938,_0x51e359);};}exports['register']=function(_0x51ba6d){for(var _0x341c2a=0x0,_0x5aef2e=events[_0x89fe('0x5')];_0x341c2a<_0x5aef2e;_0x341c2a++){var _0xdcd116=events[_0x341c2a];var _0x56ccff=createListener(_0x89fe('0x6')+_0xdcd116,_0x51ba6d);ChatInteractionEvents['on'](_0xdcd116,_0x56ccff);}};
\ No newline at end of file
+var _0x4528=['save','remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x1a4807,_0xc2cf93){var _0x5b8beb=function(_0x3449d5){while(--_0x3449d5){_0x1a4807['push'](_0x1a4807['shift']());}};_0x5b8beb(++_0xc2cf93);}(_0x4528,0x197));var _0x8452=function(_0x355326,_0x380e8b){_0x355326=_0x355326-0x0;var _0x4eb4af=_0x4528[_0x355326];return _0x4eb4af;};'use strict';var ChatInteractionEvents=require(_0x8452('0x0'));var events=[_0x8452('0x1'),_0x8452('0x2'),_0x8452('0x3')];function createListener(_0x27f286,_0x45e9bf){return function(_0x4ae8eb){_0x45e9bf[_0x8452('0x4')](_0x27f286,_0x4ae8eb);};}function removeListener(_0x535065,_0x2e3b54){return function(){ChatInteractionEvents[_0x8452('0x5')](_0x535065,_0x2e3b54);};}exports['register']=function(_0x3e8e98){for(var _0x3b108f=0x0,_0x19d095=events[_0x8452('0x6')];_0x3b108f<_0x19d095;_0x3b108f++){var _0x4fe809=events[_0x3b108f];var _0x40b7e7=createListener(_0x8452('0x7')+_0x4fe809,_0x3e8e98);ChatInteractionEvents['on'](_0x4fe809,_0x40b7e7);}};
\ No newline at end of file
index 19b3420..1c93622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd98=['/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','createVidaooSession','root','server/files/attachments/','%s-%s','originalname','replace','post','/:id/attachment_upload','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon'];(function(_0x38925c,_0x33c1ea){var _0x57e2de=function(_0x271542){while(--_0x271542){_0x38925c['push'](_0x38925c['shift']());}};_0x57e2de(++_0x33c1ea);}(_0xfd98,0x17f));var _0x8fd9=function(_0x441eab,_0x583ba5){_0x441eab=_0x441eab-0x0;var _0xe6ff41=_0xfd98[_0x441eab];return _0xe6ff41;};'use strict';var multer=require('multer');var util=require(_0x8fd9('0x0'));var path=require(_0x8fd9('0x1'));var timeout=require(_0x8fd9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8fd9('0x3'));var interaction=require(_0x8fd9('0x4'));var config=require(_0x8fd9('0x5'));var controller=require(_0x8fd9('0x6'));router[_0x8fd9('0x7')]('/',auth[_0x8fd9('0x8')](),controller[_0x8fd9('0x9')]);router[_0x8fd9('0x7')](_0x8fd9('0xa'),auth[_0x8fd9('0x8')](),controller[_0x8fd9('0xb')]);router[_0x8fd9('0x7')](_0x8fd9('0xc'),auth[_0x8fd9('0xd')](),controller['show']);router[_0x8fd9('0x7')](_0x8fd9('0xe'),auth[_0x8fd9('0xd')](),controller['attachmentDownload']);router['get'](_0x8fd9('0xf'),auth[_0x8fd9('0x8')](),controller[_0x8fd9('0x10')]);router['get'](_0x8fd9('0x11'),auth[_0x8fd9('0xd')](),controller[_0x8fd9('0x12')]);router[_0x8fd9('0x7')](_0x8fd9('0x13'),auth['isAuthenticated'](),controller[_0x8fd9('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8fd9('0x15')]);router['post']('/:id/vidaoo',auth[_0x8fd9('0x8')](),controller[_0x8fd9('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c8710,_0x37d42e,_0x12be88){_0x12be88(null,path['join'](config[_0x8fd9('0x17')],_0x8fd9('0x18')));},'filename':function(_0x4b5e42,_0x1f991f,_0x1f6dd2){_0x1f6dd2(null,util['format'](_0x8fd9('0x19'),Date['now'](),_0x1f991f[_0x8fd9('0x1a')][_0x8fd9('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8fd9('0x1c')](_0x8fd9('0x1d'),upload['single']('file'),controller[_0x8fd9('0x1e')]);router['post'](_0x8fd9('0xf'),auth[_0x8fd9('0xd')](),controller['addMessage']);router[_0x8fd9('0x1c')]('/:id/tags',auth[_0x8fd9('0x8')](),interaction[_0x8fd9('0x1f')](_0x8fd9('0x20'),_0x8fd9('0x21')),controller[_0x8fd9('0x22')]);router[_0x8fd9('0x23')](_0x8fd9('0xc'),auth[_0x8fd9('0x8')](),interaction[_0x8fd9('0x1f')](_0x8fd9('0x20'),_0x8fd9('0x24')),controller[_0x8fd9('0x25')]);router['put'](_0x8fd9('0x26'),controller['customUpdate']);router['put'](_0x8fd9('0x27'),auth[_0x8fd9('0xd')](),controller['abandon']);router[_0x8fd9('0x23')](_0x8fd9('0x28'),controller[_0x8fd9('0x29')]);router[_0x8fd9('0x2a')](_0x8fd9('0xc'),auth[_0x8fd9('0x8')](),interaction[_0x8fd9('0x1f')](_0x8fd9('0x20'),_0x8fd9('0x2b')),controller[_0x8fd9('0x2c')]);router[_0x8fd9('0x2a')](_0x8fd9('0x2d'),auth['isAuthenticated'](),controller[_0x8fd9('0x2e')]);module['exports']=router;
\ No newline at end of file
+var _0x8fca=['root','server/files/attachments/','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8fca,0x12f));var _0xa8fc=function(_0x46dfe4,_0x5a4e9e){_0x46dfe4=_0x46dfe4-0x0;var _0x39c26f=_0x8fca[_0x46dfe4];return _0x39c26f;};'use strict';var multer=require(_0xa8fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa8fc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa8fc('0x2'));var auth=require(_0xa8fc('0x3'));var interaction=require(_0xa8fc('0x4'));var config=require('../../config/environment');var controller=require(_0xa8fc('0x5'));router[_0xa8fc('0x6')]('/',auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x8')]);router[_0xa8fc('0x6')](_0xa8fc('0x9'),auth['isAuthenticated'](),controller[_0xa8fc('0xa')]);router['get'](_0xa8fc('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa8fc('0xc')]);router[_0xa8fc('0x6')](_0xa8fc('0xd'),auth[_0xa8fc('0xe')](),controller[_0xa8fc('0xf')]);router[_0xa8fc('0x6')](_0xa8fc('0x10'),auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x11')]);router[_0xa8fc('0x6')](_0xa8fc('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xa8fc('0x13')]);router[_0xa8fc('0x6')](_0xa8fc('0x14'),auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x15')]);router[_0xa8fc('0x16')]('/',auth[_0xa8fc('0x7')](),controller[_0xa8fc('0x17')]);router['post'](_0xa8fc('0x18'),auth[_0xa8fc('0x7')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa8fc('0x19')]({'destination':function(_0x89b405,_0x57550c,_0x6ca5c0){_0x6ca5c0(null,path['join'](config[_0xa8fc('0x1a')],_0xa8fc('0x1b')));},'filename':function(_0x214629,_0x4c32f4,_0x5b2e94){_0x5b2e94(null,util['format']('%s-%s',Date['now'](),_0x4c32f4['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa8fc('0x16')](_0xa8fc('0x1c'),upload[_0xa8fc('0x1d')](_0xa8fc('0x1e')),controller[_0xa8fc('0x1f')]);router[_0xa8fc('0x16')](_0xa8fc('0x10'),auth[_0xa8fc('0xe')](),controller[_0xa8fc('0x20')]);router[_0xa8fc('0x16')]('/:id/tags',auth[_0xa8fc('0x7')](),interaction[_0xa8fc('0x21')](_0xa8fc('0x22'),_0xa8fc('0x23')),controller['addTags']);router[_0xa8fc('0x24')](_0xa8fc('0xb'),auth[_0xa8fc('0x7')](),interaction[_0xa8fc('0x21')](_0xa8fc('0x22'),_0xa8fc('0x25')),controller[_0xa8fc('0x26')]);router[_0xa8fc('0x24')](_0xa8fc('0x27'),controller[_0xa8fc('0x28')]);router['put']('/:id/abandon',auth[_0xa8fc('0xe')](),controller[_0xa8fc('0x29')]);router[_0xa8fc('0x24')]('/:id/close',controller[_0xa8fc('0x2a')]);router[_0xa8fc('0x2b')](_0xa8fc('0xb'),auth['isAuthenticated'](),interaction[_0xa8fc('0x21')](_0xa8fc('0x22'),_0xa8fc('0x2c')),controller[_0xa8fc('0x2d')]);router['delete'](_0xa8fc('0x2e'),auth[_0xa8fc('0x7')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 453c208..54bc7ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78b1=['medium','sequelize','exports','TEXT'];(function(_0x1d1c8a,_0x2cf2d8){var _0x3e10d3=function(_0x59b836){while(--_0x59b836){_0x1d1c8a['push'](_0x1d1c8a['shift']());}};_0x3e10d3(++_0x2cf2d8);}(_0x78b1,0xf9));var _0x178b=function(_0x3ed596,_0x5b5486){_0x3ed596=_0x3ed596-0x0;var _0xd0869=_0x78b1[_0x3ed596];return _0xd0869;};'use strict';var Sequelize=require(_0x178b('0x0'));module[_0x178b('0x1')]={'body':{'type':Sequelize[_0x178b('0x2')](_0x178b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1ff2=['exports','medium','sequelize'];(function(_0x411b68,_0x52e768){var _0x41ff90=function(_0x2ab602){while(--_0x2ab602){_0x411b68['push'](_0x411b68['shift']());}};_0x41ff90(++_0x52e768);}(_0x1ff2,0x6e));var _0x21ff=function(_0x504095,_0x56da2e){_0x504095=_0x504095-0x0;var _0x3a00be=_0x1ff2[_0x504095];return _0x3a00be;};'use strict';var Sequelize=require(_0x21ff('0x0'));module[_0x21ff('0x1')]={'body':{'type':Sequelize['TEXT'](_0x21ff('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 0e4846a..ca034c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe09d=['-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','map','ChatInternalMessage','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','count','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','resourceId','push','read'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xe09d,0xde));var _0xde09=function(_0x37397f,_0x2c26a0){_0x37397f=_0x37397f-0x0;var _0x1a34d1=_0xe09d[_0x37397f];return _0x1a34d1;};'use strict';var emlformat=require(_0xde09('0x0'));var rimraf=require(_0xde09('0x1'));var zipdir=require(_0xde09('0x2'));var jsonpatch=require(_0xde09('0x3'));var rp=require('request-promise');var moment=require(_0xde09('0x4'));var BPromise=require(_0xde09('0x5'));var Mustache=require(_0xde09('0x6'));var util=require(_0xde09('0x7'));var path=require(_0xde09('0x8'));var sox=require('sox');var csv=require(_0xde09('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde09('0xa'));var _=require('lodash');var squel=require(_0xde09('0xb'));var crypto=require(_0xde09('0xc'));var jsforce=require(_0xde09('0xd'));var deskjs=require(_0xde09('0xe'));var toCsv=require(_0xde09('0x9'));var querystring=require(_0xde09('0xf'));var Papa=require(_0xde09('0x10'));var Redis=require(_0xde09('0x11'));var authService=require(_0xde09('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde09('0x13'));var hardwareService=require(_0xde09('0x14'));var logger=require(_0xde09('0x15'))(_0xde09('0x16'));var utils=require(_0xde09('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde09('0x18'));var db=require(_0xde09('0x19'))['db'];config[_0xde09('0x1a')]=_['defaults'](config[_0xde09('0x1a')],{'host':_0xde09('0x1b'),'port':0x18eb});var socket=require(_0xde09('0x1c'))(new Redis(config[_0xde09('0x1a')]));require(_0xde09('0x1d'))[_0xde09('0x1e')](socket);function respondWithStatusCode(_0x1bdb17,_0x549ca5){_0x549ca5=_0x549ca5||0xcc;return function(_0x5b45df){if(_0x5b45df){return _0x1bdb17[_0xde09('0x1f')](_0x549ca5);}return _0x1bdb17['status'](_0x549ca5)['end']();};}function respondWithResult(_0x1b39cc,_0x22ad7d){_0x22ad7d=_0x22ad7d||0xc8;return function(_0x4c2c50){if(_0x4c2c50){return _0x1b39cc[_0xde09('0x20')](_0x22ad7d)['json'](_0x4c2c50);}};}function respondWithFilteredResult(_0x35095c,_0x4ba11a){return function(_0x4c9dcd){if(_0x4c9dcd){var _0x130187=typeof _0x4ba11a[_0xde09('0x21')]===_0xde09('0x22')&&typeof _0x4ba11a['limit']==='undefined';var _0x1204f1=_0x4c9dcd['count'];var _0x425a43=_0x130187?0x0:_0x4ba11a[_0xde09('0x21')];var _0x4a8d21=_0x130187?_0x4c9dcd['count']:_0x4ba11a[_0xde09('0x21')]+_0x4ba11a[_0xde09('0x23')];var _0x1b3dce;if(_0x4a8d21>=_0x1204f1){_0x4a8d21=_0x1204f1;_0x1b3dce=0xc8;}else{_0x1b3dce=0xce;}_0x35095c['status'](_0x1b3dce);return _0x35095c[_0xde09('0x24')](_0xde09('0x25'),_0x425a43+'-'+_0x4a8d21+'/'+_0x1204f1)['json'](_0x4c9dcd);}return null;};}function patchUpdates(_0xf24df0){return function(_0x49a18e){try{jsonpatch[_0xde09('0x26')](_0x49a18e,_0xf24df0,!![]);}catch(_0x127e5a){return BPromise[_0xde09('0x27')](_0x127e5a);}return _0x49a18e['save']();};}function saveUpdates(_0x20f4bc,_0x3f3d2b){return function(_0x5a094a){if(_0x5a094a){return _0x5a094a[_0xde09('0x28')](_0x20f4bc)['then'](function(_0x3616fe){return _0x3616fe;});}return null;};}function removeEntity(_0x44e731,_0x3bbd1e){return function(_0x3fed74){if(_0x3fed74){return _0x3fed74['destroy']()[_0xde09('0x29')](function(){_0x44e731[_0xde09('0x20')](0xcc)[_0xde09('0x2a')]();});}};}function handleEntityNotFound(_0x4189f,_0x58e32c){return function(_0xb18007){if(!_0xb18007){_0x4189f[_0xde09('0x1f')](0x194);}return _0xb18007;};}function handleError(_0x4ba32d,_0x51ebf9){_0x51ebf9=_0x51ebf9||0x1f4;return function(_0x4f1eda){logger[_0xde09('0x2b')](_0x4f1eda[_0xde09('0x2c')]);if(_0x4f1eda[_0xde09('0x2d')]){delete _0x4f1eda[_0xde09('0x2d')];}_0x4ba32d[_0xde09('0x20')](_0x51ebf9)['send'](_0x4f1eda);};}exports['index']=function(_0x376fed,_0x525658){var _0x4b1e42={},_0x4ff69c={},_0x26b9b6={'count':0x0,'rows':[]};var _0x32d8e6=_[_0xde09('0x2e')](db[_0xde09('0x2f')]['rawAttributes'],function(_0x4a11bd){return{'name':_0x4a11bd[_0xde09('0x30')],'type':_0x4a11bd['type'][_0xde09('0x31')]};});_0x4ff69c[_0xde09('0x32')]=_[_0xde09('0x2e')](_0x32d8e6,_0xde09('0x2d'));_0x4ff69c[_0xde09('0x33')]=_[_0xde09('0x34')](_0x376fed[_0xde09('0x33')]);_0x4ff69c[_0xde09('0x35')]=_[_0xde09('0x36')](_0x4ff69c[_0xde09('0x32')],_0x4ff69c['query']);_0x4b1e42[_0xde09('0x37')]=_[_0xde09('0x36')](_0x4ff69c['model'],qs[_0xde09('0x38')](_0x376fed['query'][_0xde09('0x38')]));_0x4b1e42['attributes']=_0x4b1e42[_0xde09('0x37')][_0xde09('0x39')]?_0x4b1e42[_0xde09('0x37')]:_0x4ff69c[_0xde09('0x32')];if(!_0x376fed['query'][_0xde09('0x3a')](_0xde09('0x3b'))){_0x4b1e42[_0xde09('0x23')]=qs[_0xde09('0x23')](_0x376fed['query'][_0xde09('0x23')]);_0x4b1e42['offset']=qs[_0xde09('0x21')](_0x376fed[_0xde09('0x33')][_0xde09('0x21')]);}_0x4b1e42[_0xde09('0x3c')]=qs['sort'](_0x376fed[_0xde09('0x33')][_0xde09('0x3d')]);_0x4b1e42[_0xde09('0x3e')]=qs['filters'](_[_0xde09('0x3f')](_0x376fed[_0xde09('0x33')],_0x4ff69c[_0xde09('0x35')]),_0x32d8e6);if(_0x376fed[_0xde09('0x33')][_0xde09('0x40')]){_0x4b1e42[_0xde09('0x3e')]=_[_0xde09('0x41')](_0x4b1e42[_0xde09('0x3e')],{'$or':_[_0xde09('0x2e')](_0x32d8e6,function(_0x22b0be){if(_0x22b0be[_0xde09('0x42')]!=='VIRTUAL'){var _0x3be995={};_0x3be995[_0x22b0be[_0xde09('0x2d')]]={'$like':'%'+_0x376fed[_0xde09('0x33')]['filter']+'%'};return _0x3be995;}})});}_0x4b1e42=_['merge']({},_0x4b1e42,_0x376fed['options']);var _0x16bba1={'where':_0x4b1e42['where']};return db[_0xde09('0x2f')][_0xde09('0x43')](_0x16bba1)[_0xde09('0x29')](function(_0x3dbd20){_0x26b9b6[_0xde09('0x43')]=_0x3dbd20;if(_0x376fed['query']['includeAll']){_0x4b1e42[_0xde09('0x44')]=[{'all':!![]}];}return db[_0xde09('0x2f')][_0xde09('0x45')](_0x4b1e42);})[_0xde09('0x29')](function(_0x572af4){_0x26b9b6[_0xde09('0x46')]=_0x572af4;return _0x26b9b6;})[_0xde09('0x29')](respondWithFilteredResult(_0x525658,_0x4b1e42))[_0xde09('0x47')](handleError(_0x525658,null));};exports[_0xde09('0x48')]=function(_0x2f47e0,_0x39c086){var _0x135773={'raw':!![],'where':{'id':_0x2f47e0[_0xde09('0x49')]['id']}},_0x26bd07={};_0x26bd07[_0xde09('0x32')]=_['keys'](db['ChatInternalMessage'][_0xde09('0x4a')]);_0x26bd07[_0xde09('0x33')]=_[_0xde09('0x34')](_0x2f47e0['query']);_0x26bd07[_0xde09('0x35')]=_[_0xde09('0x36')](_0x26bd07['model'],_0x26bd07[_0xde09('0x33')]);_0x135773['attributes']=_[_0xde09('0x36')](_0x26bd07['model'],qs['fields'](_0x2f47e0['query'][_0xde09('0x38')]));_0x135773[_0xde09('0x37')]=_0x135773['attributes'][_0xde09('0x39')]?_0x135773[_0xde09('0x37')]:_0x26bd07[_0xde09('0x32')];if(_0x2f47e0['query']['includeAll']){_0x135773[_0xde09('0x44')]=[{'all':!![]}];}_0x135773=_[_0xde09('0x41')]({},_0x135773,_0x2f47e0['options']);return db['ChatInternalMessage'][_0xde09('0x4b')](_0x135773)[_0xde09('0x29')](handleEntityNotFound(_0x39c086,null))[_0xde09('0x29')](respondWithResult(_0x39c086,null))[_0xde09('0x47')](handleError(_0x39c086,null));};exports[_0xde09('0x4c')]=function(_0x209d06,_0x327ce8){return db[_0xde09('0x2f')][_0xde09('0x4c')](_0x209d06[_0xde09('0x4d')],{})[_0xde09('0x29')](respondWithResult(_0x327ce8,0xc9))[_0xde09('0x47')](handleError(_0x327ce8,null));};exports[_0xde09('0x28')]=function(_0x256f27,_0xe690e6){if(_0x256f27[_0xde09('0x4d')]['id']){delete _0x256f27['body']['id'];}return db[_0xde09('0x2f')][_0xde09('0x4b')]({'where':{'id':_0x256f27[_0xde09('0x49')]['id']}})[_0xde09('0x29')](handleEntityNotFound(_0xe690e6,null))['then'](saveUpdates(_0x256f27[_0xde09('0x4d')],null))[_0xde09('0x29')](respondWithResult(_0xe690e6,null))['catch'](handleError(_0xe690e6,null));};exports['destroy']=function(_0x545434,_0x58696e){return db[_0xde09('0x2f')]['find']({'where':{'id':_0x545434[_0xde09('0x49')]['id']}})[_0xde09('0x29')](handleEntityNotFound(_0x58696e,null))[_0xde09('0x29')](removeEntity(_0x58696e,null))[_0xde09('0x47')](handleError(_0x58696e,null));};exports[_0xde09('0x4e')]=function(_0x59174e,_0x541471){return db['ChatInternalMessage'][_0xde09('0x4e')]()['then'](respondWithResult(_0x541471,null))['catch'](handleError(_0x541471,null));};function wrapUser(_0x4b64a3){return function(_0x476c07){var _0x595461=_0x4b64a3[_0xde09('0x4f')]({'plain':!![]});_0x595461[_0xde09('0x50')]=[];if(_0x476c07){_0x595461[_0xde09('0x51')]=_0x476c07[_0xde09('0x52')];_0x595461[_0xde09('0x53')]=_0x476c07;}else{_0x595461[_0xde09('0x51')]=moment(0x0)[_0xde09('0x54')](_0xde09('0x55'));_0x595461[_0xde09('0x53')]={};}return _0x595461;};}exports[_0xde09('0x56')]=function(_0x1112f0,_0x2fd602,_0x2e26d3){var _0x2f618d=[];return db[_0xde09('0x57')]['findAll']({'where':{'role':[_0xde09('0x58'),_0xde09('0x59'),_0xde09('0x5a')]},'attributes':['id','fullname',_0xde09('0x2d'),_0xde09('0x5b'),_0xde09('0x5c'),_0xde09('0x5d'),_0xde09('0x5e'),_0xde09('0x5f'),_0xde09('0x60'),'showWebBar'],'order':qs['sort'](_0xde09('0x61')),'include':[{'model':db[_0xde09('0x62')],'as':_0xde09('0x63'),'attributes':['id','name',_0xde09('0x42')],'through':{'attributes':[]}}]})[_0xde09('0x29')](function(_0x19d7e6){if(_0x19d7e6){var _0x573c87=_0x1112f0[_0xde09('0x5a')]['get']({'plain':!![]});if(!_0x573c87)throw new Error(_0xde09('0x64'));if(_0x573c87['role']==='user'){return db[_0xde09('0x65')]['find']({'where':{'name':_0xde09('0x66'),'userProfileId':_0x573c87['userProfileId']},'raw':!![]})[_0xde09('0x29')](function(_0x277744){if(_0x277744){if(_0x277744['autoAssociation']===0x0){return db[_0xde09('0x67')][_0xde09('0x45')]({'where':{'sectionId':_0x277744['id']},'raw':!![]})[_0xde09('0x29')](function(_0x322010){var _0x552a80=[];if(_[_0xde09('0x68')](_0x322010)){_0x552a80=_[_0xde09('0x40')](_0x19d7e6,function(_0x305ac4){if(_0x305ac4[_0xde09('0x5b')]!==_0xde09('0x58')){return _0x305ac4;}});return _0x552a80;}else{for(var _0x360e1d=0x0;_0x360e1d<_0x19d7e6[_0xde09('0x39')];_0x360e1d++){var _0x2d0500=_0x19d7e6[_0x360e1d];if(_0x2d0500['role']==='agent'){var _0x4aa4f3=_[_0xde09('0x4b')](_0x322010,function(_0x4aeb10){return _0x4aeb10[_0xde09('0x69')]===_0x2d0500['id'];});if(_0x4aa4f3)_0x552a80[_0xde09('0x6a')](_0x2d0500);}else{_0x552a80['push'](_0x2d0500);}}return _0x552a80;}});}else{return _0x19d7e6;}}else{var _0x4c7b95=_[_0xde09('0x40')](_0x19d7e6,function(_0x85dbf1){if(_0x85dbf1[_0xde09('0x5b')]!==_0xde09('0x58')){return _0x85dbf1;}});return _0x4c7b95;}});}else{return _0x19d7e6;}}})['then'](function(_0x338a83){var _0x497940=[];if(_0x338a83){_0x2f618d=_0x338a83;for(var _0x130be1=0x0;_0x130be1<_0x338a83['length'];_0x130be1+=0x1){_0x2f618d[_0x130be1][_0xde09('0x50')]=[];_0x497940[_0xde09('0x6a')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x1112f0['user']['id'],_0x338a83[_0x130be1]['id']],'ToId':[_0x1112f0['user']['id'],_0x338a83[_0x130be1]['id']],'ChatGroupId':null},'attributes':['id',_0xde09('0x52'),'FromId','ToId',_0xde09('0x6b'),_0xde09('0x4d')],'order':qs[_0xde09('0x3d')](_0xde09('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xde09('0x29')](wrapUser(_0x338a83[_0x130be1])));}return BPromise[_0xde09('0x6d')](_0x497940);}return[];})[_0xde09('0x29')](function(_0x226a92){return{'rows':_0x226a92,'count':_0x226a92['length']};})['then'](respondWithResult(_0x2fd602,null))['catch'](handleError(_0x2fd602,null));};
\ No newline at end of file
+var _0x5061=['hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','includeAll','include','findAll','rows','show','params','options','find','create','body','update','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','agent','admin','user','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','undefined','limit','count','offset','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length'];(function(_0x3b8311,_0x219685){var _0x2565bd=function(_0x40b4d){while(--_0x40b4d){_0x3b8311['push'](_0x3b8311['shift']());}};_0x2565bd(++_0x219685);}(_0x5061,0x114));var _0x1506=function(_0x3d56d5,_0x492dc9){_0x3d56d5=_0x3d56d5-0x0;var _0x50b4f3=_0x5061[_0x3d56d5];return _0x50b4f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1506('0x0'));var zipdir=require(_0x1506('0x1'));var jsonpatch=require(_0x1506('0x2'));var rp=require(_0x1506('0x3'));var moment=require(_0x1506('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1506('0x5'));var util=require(_0x1506('0x6'));var path=require(_0x1506('0x7'));var sox=require(_0x1506('0x8'));var csv=require(_0x1506('0x9'));var ejs=require(_0x1506('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1506('0xb'));var crypto=require(_0x1506('0xc'));var jsforce=require(_0x1506('0xd'));var deskjs=require(_0x1506('0xe'));var toCsv=require(_0x1506('0x9'));var querystring=require(_0x1506('0xf'));var Papa=require(_0x1506('0x10'));var Redis=require('ioredis');var authService=require(_0x1506('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1506('0x12'));var hardwareService=require(_0x1506('0x13'));var logger=require(_0x1506('0x14'))('api');var utils=require(_0x1506('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1506('0x16'));var db=require(_0x1506('0x17'))['db'];config[_0x1506('0x18')]=_[_0x1506('0x19')](config[_0x1506('0x18')],{'host':_0x1506('0x1a'),'port':0x18eb});var socket=require(_0x1506('0x1b'))(new Redis(config[_0x1506('0x18')]));require('./chatInternalMessage.socket')[_0x1506('0x1c')](socket);function respondWithStatusCode(_0x4b8abd,_0x4e3bf8){_0x4e3bf8=_0x4e3bf8||0xcc;return function(_0x276b4a){if(_0x276b4a){return _0x4b8abd['sendStatus'](_0x4e3bf8);}return _0x4b8abd[_0x1506('0x1d')](_0x4e3bf8)[_0x1506('0x1e')]();};}function respondWithResult(_0xebf3e4,_0x375c40){_0x375c40=_0x375c40||0xc8;return function(_0x2effac){if(_0x2effac){return _0xebf3e4[_0x1506('0x1d')](_0x375c40)['json'](_0x2effac);}};}function respondWithFilteredResult(_0x373a49,_0x4a6e71){return function(_0x30c043){if(_0x30c043){var _0x2a076f=typeof _0x4a6e71['offset']===_0x1506('0x1f')&&typeof _0x4a6e71[_0x1506('0x20')]===_0x1506('0x1f');var _0x35c7be=_0x30c043[_0x1506('0x21')];var _0x1b6f78=_0x2a076f?0x0:_0x4a6e71['offset'];var _0x33dfe9=_0x2a076f?_0x30c043[_0x1506('0x21')]:_0x4a6e71[_0x1506('0x22')]+_0x4a6e71[_0x1506('0x20')];var _0x20034e;if(_0x33dfe9>=_0x35c7be){_0x33dfe9=_0x35c7be;_0x20034e=0xc8;}else{_0x20034e=0xce;}_0x373a49[_0x1506('0x1d')](_0x20034e);return _0x373a49[_0x1506('0x23')]('Content-Range',_0x1b6f78+'-'+_0x33dfe9+'/'+_0x35c7be)[_0x1506('0x24')](_0x30c043);}return null;};}function patchUpdates(_0x3a4dc2){return function(_0x5d192c){try{jsonpatch[_0x1506('0x25')](_0x5d192c,_0x3a4dc2,!![]);}catch(_0x16ff84){return BPromise[_0x1506('0x26')](_0x16ff84);}return _0x5d192c[_0x1506('0x27')]();};}function saveUpdates(_0x5b4a6e,_0x422d23){return function(_0x243907){if(_0x243907){return _0x243907['update'](_0x5b4a6e)[_0x1506('0x28')](function(_0x515b23){return _0x515b23;});}return null;};}function removeEntity(_0x39e506,_0xefe97d){return function(_0x48a9b9){if(_0x48a9b9){return _0x48a9b9[_0x1506('0x29')]()['then'](function(){_0x39e506[_0x1506('0x1d')](0xcc)[_0x1506('0x1e')]();});}};}function handleEntityNotFound(_0xa58810,_0x3a8517){return function(_0x32579e){if(!_0x32579e){_0xa58810[_0x1506('0x2a')](0x194);}return _0x32579e;};}function handleError(_0x589818,_0x353790){_0x353790=_0x353790||0x1f4;return function(_0x3b9fe2){logger[_0x1506('0x2b')](_0x3b9fe2[_0x1506('0x2c')]);if(_0x3b9fe2[_0x1506('0x2d')]){delete _0x3b9fe2[_0x1506('0x2d')];}_0x589818[_0x1506('0x1d')](_0x353790)['send'](_0x3b9fe2);};}exports[_0x1506('0x2e')]=function(_0x260c6e,_0x1ddd1a){var _0x53761b={},_0x1177fe={},_0xacf270={'count':0x0,'rows':[]};var _0x25f561=_['map'](db[_0x1506('0x2f')][_0x1506('0x30')],function(_0x25d9c0){return{'name':_0x25d9c0[_0x1506('0x31')],'type':_0x25d9c0[_0x1506('0x32')][_0x1506('0x33')]};});_0x1177fe[_0x1506('0x34')]=_[_0x1506('0x35')](_0x25f561,_0x1506('0x2d'));_0x1177fe[_0x1506('0x36')]=_[_0x1506('0x37')](_0x260c6e[_0x1506('0x36')]);_0x1177fe['filters']=_[_0x1506('0x38')](_0x1177fe[_0x1506('0x34')],_0x1177fe[_0x1506('0x36')]);_0x53761b[_0x1506('0x39')]=_[_0x1506('0x38')](_0x1177fe['model'],qs['fields'](_0x260c6e[_0x1506('0x36')][_0x1506('0x3a')]));_0x53761b[_0x1506('0x39')]=_0x53761b['attributes'][_0x1506('0x3b')]?_0x53761b[_0x1506('0x39')]:_0x1177fe[_0x1506('0x34')];if(!_0x260c6e[_0x1506('0x36')][_0x1506('0x3c')](_0x1506('0x3d'))){_0x53761b['limit']=qs['limit'](_0x260c6e['query'][_0x1506('0x20')]);_0x53761b[_0x1506('0x22')]=qs['offset'](_0x260c6e['query'][_0x1506('0x22')]);}_0x53761b[_0x1506('0x3e')]=qs[_0x1506('0x3f')](_0x260c6e['query'][_0x1506('0x3f')]);_0x53761b['where']=qs[_0x1506('0x40')](_[_0x1506('0x41')](_0x260c6e[_0x1506('0x36')],_0x1177fe[_0x1506('0x40')]),_0x25f561);if(_0x260c6e[_0x1506('0x36')][_0x1506('0x42')]){_0x53761b['where']=_[_0x1506('0x43')](_0x53761b[_0x1506('0x44')],{'$or':_['map'](_0x25f561,function(_0x9cd739){if(_0x9cd739[_0x1506('0x32')]!=='VIRTUAL'){var _0x4a50fc={};_0x4a50fc[_0x9cd739[_0x1506('0x2d')]]={'$like':'%'+_0x260c6e[_0x1506('0x36')]['filter']+'%'};return _0x4a50fc;}})});}_0x53761b=_[_0x1506('0x43')]({},_0x53761b,_0x260c6e['options']);var _0x42b9b5={'where':_0x53761b[_0x1506('0x44')]};return db['ChatInternalMessage']['count'](_0x42b9b5)['then'](function(_0x48dc65){_0xacf270[_0x1506('0x21')]=_0x48dc65;if(_0x260c6e[_0x1506('0x36')][_0x1506('0x45')]){_0x53761b[_0x1506('0x46')]=[{'all':!![]}];}return db[_0x1506('0x2f')][_0x1506('0x47')](_0x53761b);})[_0x1506('0x28')](function(_0x1b5d78){_0xacf270[_0x1506('0x48')]=_0x1b5d78;return _0xacf270;})[_0x1506('0x28')](respondWithFilteredResult(_0x1ddd1a,_0x53761b))['catch'](handleError(_0x1ddd1a,null));};exports[_0x1506('0x49')]=function(_0x26c63e,_0xec1157){var _0x50689b={'raw':!![],'where':{'id':_0x26c63e[_0x1506('0x4a')]['id']}},_0x293934={};_0x293934['model']=_[_0x1506('0x37')](db[_0x1506('0x2f')][_0x1506('0x30')]);_0x293934['query']=_[_0x1506('0x37')](_0x26c63e[_0x1506('0x36')]);_0x293934[_0x1506('0x40')]=_['intersection'](_0x293934[_0x1506('0x34')],_0x293934['query']);_0x50689b[_0x1506('0x39')]=_[_0x1506('0x38')](_0x293934['model'],qs[_0x1506('0x3a')](_0x26c63e[_0x1506('0x36')]['fields']));_0x50689b['attributes']=_0x50689b[_0x1506('0x39')][_0x1506('0x3b')]?_0x50689b[_0x1506('0x39')]:_0x293934[_0x1506('0x34')];if(_0x26c63e[_0x1506('0x36')][_0x1506('0x45')]){_0x50689b['include']=[{'all':!![]}];}_0x50689b=_['merge']({},_0x50689b,_0x26c63e[_0x1506('0x4b')]);return db['ChatInternalMessage'][_0x1506('0x4c')](_0x50689b)[_0x1506('0x28')](handleEntityNotFound(_0xec1157,null))['then'](respondWithResult(_0xec1157,null))['catch'](handleError(_0xec1157,null));};exports[_0x1506('0x4d')]=function(_0x41bba5,_0x35ccd7){return db[_0x1506('0x2f')][_0x1506('0x4d')](_0x41bba5[_0x1506('0x4e')],{})[_0x1506('0x28')](respondWithResult(_0x35ccd7,0xc9))['catch'](handleError(_0x35ccd7,null));};exports[_0x1506('0x4f')]=function(_0x2106a4,_0x247fab){if(_0x2106a4['body']['id']){delete _0x2106a4[_0x1506('0x4e')]['id'];}return db[_0x1506('0x2f')][_0x1506('0x4c')]({'where':{'id':_0x2106a4['params']['id']}})['then'](handleEntityNotFound(_0x247fab,null))['then'](saveUpdates(_0x2106a4[_0x1506('0x4e')],null))['then'](respondWithResult(_0x247fab,null))[_0x1506('0x50')](handleError(_0x247fab,null));};exports[_0x1506('0x29')]=function(_0x5d047c,_0x1945e9){return db[_0x1506('0x2f')][_0x1506('0x4c')]({'where':{'id':_0x5d047c['params']['id']}})[_0x1506('0x28')](handleEntityNotFound(_0x1945e9,null))[_0x1506('0x28')](removeEntity(_0x1945e9,null))[_0x1506('0x50')](handleError(_0x1945e9,null));};exports['describe']=function(_0x3bcc09,_0x337108){return db['ChatInternalMessage'][_0x1506('0x51')]()[_0x1506('0x28')](respondWithResult(_0x337108,null))[_0x1506('0x50')](handleError(_0x337108,null));};function wrapUser(_0x13a269){return function(_0x3033e6){var _0x44d1e1=_0x13a269[_0x1506('0x52')]({'plain':!![]});_0x44d1e1[_0x1506('0x53')]=[];if(_0x3033e6){_0x44d1e1[_0x1506('0x54')]=_0x3033e6[_0x1506('0x55')];_0x44d1e1[_0x1506('0x56')]=_0x3033e6;}else{_0x44d1e1[_0x1506('0x54')]=moment(0x0)[_0x1506('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x44d1e1[_0x1506('0x56')]={};}return _0x44d1e1;};}exports[_0x1506('0x58')]=function(_0x1f15c4,_0x1d72ab,_0x4ac52d){var _0x9a8a8b=[];return db['User']['findAll']({'where':{'role':[_0x1506('0x59'),_0x1506('0x5a'),_0x1506('0x5b')]},'attributes':['id','fullname','name',_0x1506('0x5c'),_0x1506('0x5d'),'internal',_0x1506('0x5e'),'lastLoginAt',_0x1506('0x5f'),_0x1506('0x60')],'order':qs[_0x1506('0x3f')](_0x1506('0x61')),'include':[{'model':db[_0x1506('0x62')],'as':'VoiceQueues','attributes':['id',_0x1506('0x2d'),_0x1506('0x32')],'through':{'attributes':[]}}]})[_0x1506('0x28')](function(_0xec2225){if(_0xec2225){var _0x4804bf=_0x1f15c4[_0x1506('0x5b')][_0x1506('0x52')]({'plain':!![]});if(!_0x4804bf)throw new Error(_0x1506('0x63'));if(_0x4804bf[_0x1506('0x5c')]===_0x1506('0x5b')){return db[_0x1506('0x64')][_0x1506('0x4c')]({'where':{'name':_0x1506('0x65'),'userProfileId':_0x4804bf['userProfileId']},'raw':!![]})[_0x1506('0x28')](function(_0x50a1a4){if(_0x50a1a4){if(_0x50a1a4[_0x1506('0x66')]===0x0){return db[_0x1506('0x67')][_0x1506('0x47')]({'where':{'sectionId':_0x50a1a4['id']},'raw':!![]})[_0x1506('0x28')](function(_0x5d9807){var _0x51d94c=[];if(_[_0x1506('0x68')](_0x5d9807)){_0x51d94c=_[_0x1506('0x42')](_0xec2225,function(_0x2c2051){if(_0x2c2051[_0x1506('0x5c')]!=='agent'){return _0x2c2051;}});return _0x51d94c;}else{for(var _0x5361f3=0x0;_0x5361f3<_0xec2225[_0x1506('0x3b')];_0x5361f3++){var _0x4eea2f=_0xec2225[_0x5361f3];if(_0x4eea2f['role']===_0x1506('0x59')){var _0xb60122=_['find'](_0x5d9807,function(_0x7c0087){return _0x7c0087[_0x1506('0x69')]===_0x4eea2f['id'];});if(_0xb60122)_0x51d94c['push'](_0x4eea2f);}else{_0x51d94c[_0x1506('0x6a')](_0x4eea2f);}}return _0x51d94c;}});}else{return _0xec2225;}}else{var _0x38f525=_[_0x1506('0x42')](_0xec2225,function(_0x51ba58){if(_0x51ba58[_0x1506('0x5c')]!==_0x1506('0x59')){return _0x51ba58;}});return _0x38f525;}});}else{return _0xec2225;}}})[_0x1506('0x28')](function(_0x5757de){var _0x174ffa=[];if(_0x5757de){_0x9a8a8b=_0x5757de;for(var _0x33c050=0x0;_0x33c050<_0x5757de[_0x1506('0x3b')];_0x33c050+=0x1){_0x9a8a8b[_0x33c050]['messages']=[];_0x174ffa[_0x1506('0x6a')](db[_0x1506('0x2f')][_0x1506('0x4c')]({'where':{'FromId':[_0x1f15c4[_0x1506('0x5b')]['id'],_0x5757de[_0x33c050]['id']],'ToId':[_0x1f15c4[_0x1506('0x5b')]['id'],_0x5757de[_0x33c050]['id']],'ChatGroupId':null},'attributes':['id',_0x1506('0x55'),_0x1506('0x6b'),_0x1506('0x6c'),_0x1506('0x6d'),_0x1506('0x4e')],'order':qs[_0x1506('0x3f')](_0x1506('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1506('0x28')](wrapUser(_0x5757de[_0x33c050])));}return BPromise[_0x1506('0x6f')](_0x174ffa);}return[];})['then'](function(_0x4f76de){return{'rows':_0x4f76de,'count':_0x4f76de[_0x1506('0x3b')]};})['then'](respondWithResult(_0x1d72ab,null))[_0x1506('0x50')](handleError(_0x1d72ab,null));};
\ No newline at end of file
index ffbd77c..5afefe0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3c=['ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x663bf9,_0xf3ee78){var _0x510f7b=function(_0x33c41f){while(--_0x33c41f){_0x663bf9['push'](_0x663bf9['shift']());}};_0x510f7b(++_0xf3ee78);}(_0xed3c,0x1a6));var _0xced3=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0xed3c[_0x1ee9a1];return _0x21270f;};'use strict';var EventEmitter=require(_0xced3('0x0'));var ChatInternalMessage=require(_0xced3('0x1'))['db'][_0xced3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xced3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xced3('0x4'),'afterDestroy':_0xced3('0x5')};function emitEvent(_0x14488e){return function(_0x5f03e0,_0x51e500,_0x3d3aa0){ChatInternalMessageEvents[_0xced3('0x6')](_0x14488e+':'+_0x5f03e0['id'],_0x5f03e0);ChatInternalMessageEvents[_0xced3('0x6')](_0x14488e,_0x5f03e0);_0x3d3aa0(null);};}for(var e in events){if(events[_0xced3('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb0ee=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb0ee[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xeb0e('0x0'))['db'][_0xeb0e('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xeb0e('0x2')](0x0);var events={'afterCreate':_0xeb0e('0x3'),'afterUpdate':_0xeb0e('0x4'),'afterDestroy':_0xeb0e('0x5')};function emitEvent(_0xa22c37){return function(_0x470baf,_0x441f55,_0x16f417){ChatInternalMessageEvents['emit'](_0xa22c37+':'+_0x470baf['id'],_0x470baf);ChatInternalMessageEvents[_0xeb0e('0x6')](_0xa22c37,_0x470baf);_0x16f417(null);};}for(var e in events){if(events[_0xeb0e('0x7')](e)){var event=events[e];ChatInternalMessage[_0xeb0e('0x8')](e,emitEvent(event));}}module[_0xeb0e('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
index ee0e00d..5696e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x066a=['util','moment','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x1d6a6e,_0x43ab90){var _0x36234b=function(_0x38b732){while(--_0x38b732){_0x1d6a6e['push'](_0x1d6a6e['shift']());}};_0x36234b(++_0x43ab90);}(_0x066a,0x149));var _0xa066=function(_0x4c2996,_0x23af72){_0x4c2996=_0x4c2996-0x0;var _0x3f0181=_0x066a[_0x4c2996];return _0x3f0181;};'use strict';var _=require(_0xa066('0x0'));var util=require(_0xa066('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa066('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa066('0x3'));var rimraf=require(_0xa066('0x4'));var config=require(_0xa066('0x5'));var attributes=require(_0xa066('0x6'));module[_0xa066('0x7')]=function(_0x24aa34,_0x45aa3d){return _0x24aa34['define'](_0xa066('0x8'),attributes,{'tableName':_0xa066('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa066('0xa')});};
\ No newline at end of file
+var _0xacb9=['request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xacb9,0x1a9));var _0x9acb=function(_0xbf098b,_0x269d81){_0xbf098b=_0xbf098b-0x0;var _0x2f1446=_0xacb9[_0xbf098b];return _0x2f1446;};'use strict';var _=require('lodash');var util=require(_0x9acb('0x0'));var logger=require('../../config/logger')(_0x9acb('0x1'));var moment=require(_0x9acb('0x2'));var BPromise=require(_0x9acb('0x3'));var rp=require(_0x9acb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9acb('0x5'));var config=require(_0x9acb('0x6'));var attributes=require(_0x9acb('0x7'));module[_0x9acb('0x8')]=function(_0x2b06fb,_0x61e55e){return _0x2b06fb[_0x9acb('0x9')](_0x9acb('0xa'),attributes,{'tableName':_0x9acb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9acb('0xc')});};
\ No newline at end of file
index bf40d23..ff6e99e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x036b=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x31efce,_0xe45684){var _0x4f4d59=function(_0x3dcb5b){while(--_0x3dcb5b){_0x31efce['push'](_0x31efce['shift']());}};_0x4f4d59(++_0xe45684);}(_0x036b,0x145));var _0xb036=function(_0x2fbb95,_0x3a9af6){_0x2fbb95=_0x2fbb95-0x0;var _0x2b9ecb=_0x036b[_0x2fbb95];return _0x2b9ecb;};'use strict';var _=require(_0xb036('0x0'));var util=require(_0xb036('0x1'));var moment=require(_0xb036('0x2'));var BPromise=require('bluebird');var rs=require(_0xb036('0x3'));var fs=require('fs');var Redis=require(_0xb036('0x4'));var db=require(_0xb036('0x5'))['db'];var utils=require(_0xb036('0x6'));var logger=require(_0xb036('0x7'))('rpc');var config=require(_0xb036('0x8'));var jayson=require(_0xb036('0x9'));var client=jayson[_0xb036('0xa')][_0xb036('0xb')]({'port':0x232a});config[_0xb036('0xc')]=_[_0xb036('0xd')](config['redis'],{'host':_0xb036('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb036('0xc')]));require(_0xb036('0xf'))[_0xb036('0x10')](socket);function respondWithRpcPromise(_0x25a5d4,_0x18db0b,_0x2f371b){return new BPromise(function(_0x22f971,_0x42cf16){return client[_0xb036('0x11')](_0x25a5d4,_0x2f371b)[_0xb036('0x12')](function(_0x5ffd75){logger[_0xb036('0x13')](_0xb036('0x14'),_0x18db0b,_0xb036('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x18db0b,'request\x20sent',JSON[_0xb036('0x16')](_0x5ffd75));if(_0x5ffd75[_0xb036('0x17')]){if(_0x5ffd75['error'][_0xb036('0x18')]===0x1f4){logger[_0xb036('0x17')](_0xb036('0x14'),_0x18db0b,_0x5ffd75[_0xb036('0x17')]['message']);return _0x42cf16(_0x5ffd75[_0xb036('0x17')][_0xb036('0x19')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x18db0b,_0x5ffd75[_0xb036('0x17')][_0xb036('0x19')]);return _0x22f971(_0x5ffd75[_0xb036('0x17')][_0xb036('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x18db0b,_0xb036('0x15'));_0x22f971(_0x5ffd75['result'][_0xb036('0x19')]);}})[_0xb036('0x1a')](function(_0x42c1f5){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x18db0b,_0x42c1f5);_0x42cf16(_0x42c1f5);});});}
\ No newline at end of file
+var _0x79ea=['request\x20sent','error','code','result','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x79ea,0x1b6));var _0xa79e=function(_0x3e4db1,_0x385cd6){_0x3e4db1=_0x3e4db1-0x0;var _0x33ecd5=_0x79ea[_0x3e4db1];return _0x33ecd5;};'use strict';var _=require(_0xa79e('0x0'));var util=require(_0xa79e('0x1'));var moment=require(_0xa79e('0x2'));var BPromise=require(_0xa79e('0x3'));var rs=require(_0xa79e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa79e('0x5'))['db'];var utils=require(_0xa79e('0x6'));var logger=require('../../config/logger')(_0xa79e('0x7'));var config=require(_0xa79e('0x8'));var jayson=require(_0xa79e('0x9'));var client=jayson[_0xa79e('0xa')][_0xa79e('0xb')]({'port':0x232a});config[_0xa79e('0xc')]=_[_0xa79e('0xd')](config[_0xa79e('0xc')],{'host':_0xa79e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa79e('0xc')]));require(_0xa79e('0xf'))[_0xa79e('0x10')](socket);function respondWithRpcPromise(_0x2e1b82,_0x1d4f66,_0x209022){return new BPromise(function(_0x36f64e,_0x164e0a){return client[_0xa79e('0x11')](_0x2e1b82,_0x209022)[_0xa79e('0x12')](function(_0x312fc4){logger[_0xa79e('0x13')](_0xa79e('0x14'),_0x1d4f66,_0xa79e('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1d4f66,'request\x20sent',JSON['stringify'](_0x312fc4));if(_0x312fc4[_0xa79e('0x16')]){if(_0x312fc4[_0xa79e('0x16')][_0xa79e('0x17')]===0x1f4){logger[_0xa79e('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d4f66,_0x312fc4[_0xa79e('0x16')]['message']);return _0x164e0a(_0x312fc4['error']['message']);}logger[_0xa79e('0x16')](_0xa79e('0x14'),_0x1d4f66,_0x312fc4[_0xa79e('0x16')]['message']);return _0x36f64e(_0x312fc4[_0xa79e('0x16')]['message']);}else{logger[_0xa79e('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d4f66,_0xa79e('0x15'));_0x36f64e(_0x312fc4[_0xa79e('0x18')][_0xa79e('0x19')]);}})[_0xa79e('0x1a')](function(_0x18f49c){logger[_0xa79e('0x16')](_0xa79e('0x14'),_0x1d4f66,_0x18f49c);_0x164e0a(_0x18f49c);});});}
\ No newline at end of file
index 1c37c04..c51c0cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0472=['emit','length','chatInternalMessage:','save','update'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x0472,0xcb));var _0x2047=function(_0x455f52,_0x8ba1b6){_0x455f52=_0x455f52-0x0;var _0x553b90=_0x0472[_0x455f52];return _0x553b90;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x2047('0x0'),'remove',_0x2047('0x1')];function createListener(_0x17544f,_0x39e01f){return function(_0x59eb0a){_0x39e01f[_0x2047('0x2')](_0x17544f,_0x59eb0a);};}function removeListener(_0x15cb72,_0x309ca2){return function(){ChatInternalMessageEvents['removeListener'](_0x15cb72,_0x309ca2);};}exports['register']=function(_0x2665cc){for(var _0x24b30b=0x0,_0x5d8c4b=events[_0x2047('0x3')];_0x24b30b<_0x5d8c4b;_0x24b30b++){var _0x37e1d7=events[_0x24b30b];var _0x565031=createListener(_0x2047('0x4')+_0x37e1d7,_0x2665cc);ChatInternalMessageEvents['on'](_0x37e1d7,_0x565031);}};
\ No newline at end of file
+var _0xe487=['update','emit','removeListener','register','length','./chatInternalMessage.events','save','remove'];(function(_0x397446,_0x3f1304){var _0x33aff8=function(_0x488ced){while(--_0x488ced){_0x397446['push'](_0x397446['shift']());}};_0x33aff8(++_0x3f1304);}(_0xe487,0xcd));var _0x7e48=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe487[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x7e48('0x0'));var events=[_0x7e48('0x1'),_0x7e48('0x2'),_0x7e48('0x3')];function createListener(_0x2c4fda,_0x34ae14){return function(_0x1bb06a){_0x34ae14[_0x7e48('0x4')](_0x2c4fda,_0x1bb06a);};}function removeListener(_0x292bc9,_0x2f3264){return function(){ChatInternalMessageEvents[_0x7e48('0x5')](_0x292bc9,_0x2f3264);};}exports[_0x7e48('0x6')]=function(_0x21134b){for(var _0x56c5a5=0x0,_0xa39d36=events[_0x7e48('0x7')];_0x56c5a5<_0xa39d36;_0x56c5a5++){var _0x5073a4=events[_0x56c5a5];var _0x6cfa24=createListener('chatInternalMessage:'+_0x5073a4,_0x21134b);ChatInternalMessageEvents['on'](_0x5073a4,_0x6cfa24);}};
\ No newline at end of file
index b59c950..5c3f62a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa70c=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','show','post','create','/:id','update','delete'];(function(_0x4d3a1f,_0x1a2a64){var _0x461c85=function(_0x215d00){while(--_0x215d00){_0x4d3a1f['push'](_0x4d3a1f['shift']());}};_0x461c85(++_0x1a2a64);}(_0xa70c,0x189));var _0xca70=function(_0x31db2b,_0xb218b7){_0x31db2b=_0x31db2b-0x0;var _0x1459a0=_0xa70c[_0x31db2b];return _0x1459a0;};'use strict';var multer=require('multer');var util=require(_0xca70('0x0'));var path=require('path');var timeout=require(_0xca70('0x1'));var express=require(_0xca70('0x2'));var router=express[_0xca70('0x3')]();var fs_extra=require(_0xca70('0x4'));var auth=require(_0xca70('0x5'));var interaction=require(_0xca70('0x6'));var config=require(_0xca70('0x7'));var controller=require(_0xca70('0x8'));router[_0xca70('0x9')]('/',auth[_0xca70('0xa')](),controller[_0xca70('0xb')]);router[_0xca70('0x9')](_0xca70('0xc'),auth[_0xca70('0xa')](),controller[_0xca70('0xd')]);router[_0xca70('0x9')]('/users',auth[_0xca70('0xa')](),controller[_0xca70('0xe')]);router[_0xca70('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xca70('0xf')]);router[_0xca70('0x10')]('/',auth[_0xca70('0xa')](),controller[_0xca70('0x11')]);router['put'](_0xca70('0x12'),controller[_0xca70('0x13')]);router[_0xca70('0x14')](_0xca70('0x12'),auth[_0xca70('0xa')](),controller[_0xca70('0x15')]);module[_0xca70('0x16')]=router;
\ No newline at end of file
+var _0xfb62=['../../config/environment','isAuthenticated','index','get','/describe','describe','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb62,0x1f3));var _0x2fb6=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xfb62[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x2fb6('0x0'));var util=require(_0x2fb6('0x1'));var path=require(_0x2fb6('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb6('0x3'));var router=express[_0x2fb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fb6('0x5'));var interaction=require(_0x2fb6('0x6'));var config=require(_0x2fb6('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x2fb6('0x8')](),controller[_0x2fb6('0x9')]);router[_0x2fb6('0xa')](_0x2fb6('0xb'),auth['isAuthenticated'](),controller[_0x2fb6('0xc')]);router[_0x2fb6('0xa')]('/users',auth[_0x2fb6('0x8')](),controller[_0x2fb6('0xd')]);router[_0x2fb6('0xa')](_0x2fb6('0xe'),auth[_0x2fb6('0x8')](),controller[_0x2fb6('0xf')]);router[_0x2fb6('0x10')]('/',auth[_0x2fb6('0x8')](),controller[_0x2fb6('0x11')]);router['put'](_0x2fb6('0xe'),controller[_0x2fb6('0x12')]);router[_0x2fb6('0x13')](_0x2fb6('0xe'),auth['isAuthenticated'](),controller[_0x2fb6('0x14')]);module[_0x2fb6('0x15')]=router;
\ No newline at end of file
index 271173a..2dbbab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5fb=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xb5fb,0x172));var _0xbb5f=function(_0x517648,_0x3e4708){_0x517648=_0x517648-0x0;var _0xb5372a=_0xb5fb[_0x517648];return _0xb5372a;};'use strict';var Sequelize=require(_0xbb5f('0x0'));module[_0xbb5f('0x1')]={'body':{'type':Sequelize[_0xbb5f('0x2')](_0xbb5f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbb5f('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbb5f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbb5f('0x5')]('in',_0xbb5f('0x6')),'defaultValue':_0xbb5f('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbb5f('0x7')]},'providerName':{'type':Sequelize[_0xbb5f('0x8')]},'providerResponse':{'type':Sequelize[_0xbb5f('0x2')]}};
\ No newline at end of file
+var _0x7894=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x274ab5,_0x31e87d){var _0x545785=function(_0x58dc9d){while(--_0x58dc9d){_0x274ab5['push'](_0x274ab5['shift']());}};_0x545785(++_0x31e87d);}(_0x7894,0x170));var _0x4789=function(_0x47480f,_0x5d056a){_0x47480f=_0x47480f-0x0;var _0x3ad65c=_0x7894[_0x47480f];return _0x3ad65c;};'use strict';var Sequelize=require(_0x4789('0x0'));module[_0x4789('0x1')]={'body':{'type':Sequelize[_0x4789('0x2')](_0x4789('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4789('0x5')),'defaultValue':_0x4789('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4789('0x6')]},'providerResponse':{'type':Sequelize[_0x4789('0x2')]}};
\ No newline at end of file
index 983a6be..38a2118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b82=['count','includeAll','include','findAll','rows','show','params','length','create','body','update','describe','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','find','get','ChatInteraction','ChatInteractionId','isNil','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','format','channel','motionChannel','event','EventManager','acceptmessage','parse','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','catch','status','json','offset','limit','undefined','set','apply','reject','save','destroy','end','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','ChatMessage'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0x9b82,0x1cb));var _0x29b8=function(_0x1fe1af,_0x38693b){_0x1fe1af=_0x1fe1af-0x0;var _0x306d86=_0x9b82[_0x1fe1af];return _0x306d86;};'use strict';var emlformat=require(_0x29b8('0x0'));var rimraf=require(_0x29b8('0x1'));var zipdir=require(_0x29b8('0x2'));var jsonpatch=require(_0x29b8('0x3'));var rp=require('request-promise');var moment=require(_0x29b8('0x4'));var BPromise=require(_0x29b8('0x5'));var Mustache=require(_0x29b8('0x6'));var util=require(_0x29b8('0x7'));var path=require('path');var sox=require(_0x29b8('0x8'));var csv=require(_0x29b8('0x9'));var ejs=require(_0x29b8('0xa'));var fs=require('fs');var fs_extra=require(_0x29b8('0xb'));var _=require(_0x29b8('0xc'));var squel=require(_0x29b8('0xd'));var crypto=require(_0x29b8('0xe'));var jsforce=require(_0x29b8('0xf'));var deskjs=require(_0x29b8('0x10'));var toCsv=require(_0x29b8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29b8('0x11'));var authService=require(_0x29b8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x29b8('0x13'));var hardwareService=require(_0x29b8('0x14'));var logger=require(_0x29b8('0x15'))(_0x29b8('0x16'));var utils=require(_0x29b8('0x17'));var config=require(_0x29b8('0x18'));var licenseUtil=require(_0x29b8('0x19'));var db=require('../../mysqldb')['db'];config[_0x29b8('0x1a')]=_[_0x29b8('0x1b')](config[_0x29b8('0x1a')],{'host':_0x29b8('0x1c'),'port':0x18eb});var socket=require(_0x29b8('0x1d'))(new Redis(config[_0x29b8('0x1a')]));require(_0x29b8('0x1e'))[_0x29b8('0x1f')](socket);var jayson=require(_0x29b8('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x29b8('0x21')][_0x29b8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5e5780,_0x1f83f6,_0x1ee02b,_0xe81084){return new BPromise(function(_0x558697,_0x56e64a){var _0x1bfc32=_0xe81084||client;return _0x1bfc32[_0x29b8('0x23')](_0x5e5780,_0x1ee02b)[_0x29b8('0x24')](function(_0x931e57){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1f83f6,_0x29b8('0x25'));logger[_0x29b8('0x26')](_0x29b8('0x27'),_0x1f83f6,'request\x20sent',JSON[_0x29b8('0x28')](_0x931e57));if(_0x931e57[_0x29b8('0x29')]){if(_0x931e57[_0x29b8('0x29')][_0x29b8('0x2a')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1f83f6,_0x931e57[_0x29b8('0x29')][_0x29b8('0x2b')]);return _0x56e64a(_0x931e57[_0x29b8('0x29')][_0x29b8('0x2b')]);}logger[_0x29b8('0x29')](_0x29b8('0x2c'),_0x1f83f6,_0x931e57['error'][_0x29b8('0x2b')]);return _0x558697(_0x931e57['error'][_0x29b8('0x2b')]);}else{logger[_0x29b8('0x2d')](_0x29b8('0x2c'),_0x1f83f6,_0x29b8('0x25'));_0x558697(_0x931e57['result'][_0x29b8('0x2b')]);}})[_0x29b8('0x2e')](function(_0x52032e){logger[_0x29b8('0x29')]('ChatMessage,\x20%s,\x20%s',_0x1f83f6,_0x52032e);_0x56e64a(_0x52032e);});});}function respondWithStatusCode(_0x1b2c49,_0x48d284){_0x48d284=_0x48d284||0xcc;return function(_0x5479f8){if(_0x5479f8){return _0x1b2c49['sendStatus'](_0x48d284);}return _0x1b2c49[_0x29b8('0x2f')](_0x48d284)['end']();};}function respondWithResult(_0x4013de,_0x217103){_0x217103=_0x217103||0xc8;return function(_0x2d1c9a){if(_0x2d1c9a){return _0x4013de[_0x29b8('0x2f')](_0x217103)[_0x29b8('0x30')](_0x2d1c9a);}};}function respondWithFilteredResult(_0x59dad0,_0x248506){return function(_0x1fd8bd){if(_0x1fd8bd){var _0x3b83de=typeof _0x248506[_0x29b8('0x31')]==='undefined'&&typeof _0x248506[_0x29b8('0x32')]===_0x29b8('0x33');var _0x10545b=_0x1fd8bd['count'];var _0x36c6b3=_0x3b83de?0x0:_0x248506[_0x29b8('0x31')];var _0x30256b=_0x3b83de?_0x1fd8bd['count']:_0x248506[_0x29b8('0x31')]+_0x248506['limit'];var _0x1aaf41;if(_0x30256b>=_0x10545b){_0x30256b=_0x10545b;_0x1aaf41=0xc8;}else{_0x1aaf41=0xce;}_0x59dad0[_0x29b8('0x2f')](_0x1aaf41);return _0x59dad0[_0x29b8('0x34')]('Content-Range',_0x36c6b3+'-'+_0x30256b+'/'+_0x10545b)[_0x29b8('0x30')](_0x1fd8bd);}return null;};}function patchUpdates(_0x5a3fa3){return function(_0x22c395){try{jsonpatch[_0x29b8('0x35')](_0x22c395,_0x5a3fa3,!![]);}catch(_0x379d26){return BPromise[_0x29b8('0x36')](_0x379d26);}return _0x22c395[_0x29b8('0x37')]();};}function saveUpdates(_0x585674,_0x92760d){return function(_0x766185){if(_0x766185){return _0x766185['update'](_0x585674)['then'](function(_0x3910de){return _0x3910de;});}return null;};}function removeEntity(_0x4fca7b,_0x14d479){return function(_0x42d30e){if(_0x42d30e){return _0x42d30e[_0x29b8('0x38')]()[_0x29b8('0x24')](function(){_0x4fca7b[_0x29b8('0x2f')](0xcc)[_0x29b8('0x39')]();});}};}function handleEntityNotFound(_0x4ee2a4,_0x4d7d72){return function(_0x442f12){if(!_0x442f12){_0x4ee2a4['sendStatus'](0x194);}return _0x442f12;};}function handleError(_0x921aff,_0x1df22f){_0x1df22f=_0x1df22f||0x1f4;return function(_0x139659){logger[_0x29b8('0x29')](_0x139659['stack']);if(_0x139659[_0x29b8('0x3a')]){delete _0x139659[_0x29b8('0x3a')];}_0x921aff[_0x29b8('0x2f')](_0x1df22f)[_0x29b8('0x3b')](_0x139659);};}exports[_0x29b8('0x3c')]=function(_0x1e8a63,_0xb051fd){var _0x64886d={},_0x1ce17b={},_0x140dc7={'count':0x0,'rows':[]};var _0x3afee7=_['map'](db['ChatMessage'][_0x29b8('0x3d')],function(_0x5e0bc0){return{'name':_0x5e0bc0[_0x29b8('0x3e')],'type':_0x5e0bc0[_0x29b8('0x3f')]['key']};});_0x1ce17b[_0x29b8('0x40')]=_[_0x29b8('0x41')](_0x3afee7,_0x29b8('0x3a'));_0x1ce17b[_0x29b8('0x42')]=_[_0x29b8('0x43')](_0x1e8a63[_0x29b8('0x42')]);_0x1ce17b['filters']=_[_0x29b8('0x44')](_0x1ce17b[_0x29b8('0x40')],_0x1ce17b[_0x29b8('0x42')]);_0x64886d[_0x29b8('0x45')]=_[_0x29b8('0x44')](_0x1ce17b[_0x29b8('0x40')],qs['fields'](_0x1e8a63['query'][_0x29b8('0x46')]));_0x64886d[_0x29b8('0x45')]=_0x64886d[_0x29b8('0x45')]['length']?_0x64886d[_0x29b8('0x45')]:_0x1ce17b[_0x29b8('0x40')];if(!_0x1e8a63[_0x29b8('0x42')]['hasOwnProperty'](_0x29b8('0x47'))){_0x64886d[_0x29b8('0x32')]=qs[_0x29b8('0x32')](_0x1e8a63[_0x29b8('0x42')]['limit']);_0x64886d[_0x29b8('0x31')]=qs[_0x29b8('0x31')](_0x1e8a63['query'][_0x29b8('0x31')]);}_0x64886d[_0x29b8('0x48')]=qs['sort'](_0x1e8a63[_0x29b8('0x42')][_0x29b8('0x49')]);_0x64886d[_0x29b8('0x4a')]=qs[_0x29b8('0x4b')](_['pick'](_0x1e8a63[_0x29b8('0x42')],_0x1ce17b['filters']),_0x3afee7);if(_0x1e8a63['query'][_0x29b8('0x4c')]){_0x64886d['where']=_[_0x29b8('0x4d')](_0x64886d[_0x29b8('0x4a')],{'$or':_[_0x29b8('0x41')](_0x3afee7,function(_0x5cd656){if(_0x5cd656[_0x29b8('0x3f')]!==_0x29b8('0x4e')){var _0x58ca16={};_0x58ca16[_0x5cd656[_0x29b8('0x3a')]]={'$like':'%'+_0x1e8a63[_0x29b8('0x42')][_0x29b8('0x4c')]+'%'};return _0x58ca16;}})});}_0x64886d=_[_0x29b8('0x4d')]({},_0x64886d,_0x1e8a63[_0x29b8('0x4f')]);var _0x2e7705={'where':_0x64886d['where']};return db[_0x29b8('0x50')][_0x29b8('0x51')](_0x2e7705)[_0x29b8('0x24')](function(_0x4abb9c){_0x140dc7[_0x29b8('0x51')]=_0x4abb9c;if(_0x1e8a63[_0x29b8('0x42')][_0x29b8('0x52')]){_0x64886d[_0x29b8('0x53')]=[{'all':!![]}];}return db[_0x29b8('0x50')][_0x29b8('0x54')](_0x64886d);})['then'](function(_0x367cac){_0x140dc7[_0x29b8('0x55')]=_0x367cac;return _0x140dc7;})['then'](respondWithFilteredResult(_0xb051fd,_0x64886d))[_0x29b8('0x2e')](handleError(_0xb051fd,null));};exports[_0x29b8('0x56')]=function(_0x6a6bbc,_0x5a423d){var _0x321e86={'raw':!![],'where':{'id':_0x6a6bbc[_0x29b8('0x57')]['id']}},_0x2520a3={};_0x2520a3[_0x29b8('0x40')]=_[_0x29b8('0x43')](db[_0x29b8('0x50')]['rawAttributes']);_0x2520a3[_0x29b8('0x42')]=_[_0x29b8('0x43')](_0x6a6bbc[_0x29b8('0x42')]);_0x2520a3[_0x29b8('0x4b')]=_[_0x29b8('0x44')](_0x2520a3['model'],_0x2520a3[_0x29b8('0x42')]);_0x321e86[_0x29b8('0x45')]=_[_0x29b8('0x44')](_0x2520a3['model'],qs[_0x29b8('0x46')](_0x6a6bbc[_0x29b8('0x42')][_0x29b8('0x46')]));_0x321e86[_0x29b8('0x45')]=_0x321e86[_0x29b8('0x45')][_0x29b8('0x58')]?_0x321e86[_0x29b8('0x45')]:_0x2520a3[_0x29b8('0x40')];if(_0x6a6bbc[_0x29b8('0x42')]['includeAll']){_0x321e86[_0x29b8('0x53')]=[{'all':!![]}];}_0x321e86=_['merge']({},_0x321e86,_0x6a6bbc[_0x29b8('0x4f')]);return db['ChatMessage']['find'](_0x321e86)['then'](handleEntityNotFound(_0x5a423d,null))[_0x29b8('0x24')](respondWithResult(_0x5a423d,null))[_0x29b8('0x2e')](handleError(_0x5a423d,null));};exports[_0x29b8('0x59')]=function(_0x5a61ca,_0x50c95b){return db['ChatMessage'][_0x29b8('0x59')](_0x5a61ca[_0x29b8('0x5a')],{})[_0x29b8('0x24')](respondWithResult(_0x50c95b,0xc9))['catch'](handleError(_0x50c95b,null));};exports[_0x29b8('0x5b')]=function(_0x36105c,_0x19a983){if(_0x36105c[_0x29b8('0x5a')]['id']){delete _0x36105c[_0x29b8('0x5a')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x36105c[_0x29b8('0x57')]['id']}})['then'](handleEntityNotFound(_0x19a983,null))[_0x29b8('0x24')](saveUpdates(_0x36105c[_0x29b8('0x5a')],null))[_0x29b8('0x24')](respondWithResult(_0x19a983,null))[_0x29b8('0x2e')](handleError(_0x19a983,null));};exports[_0x29b8('0x38')]=function(_0x992750,_0xe1a2b4){return db['ChatMessage']['find']({'where':{'id':_0x992750['params']['id']}})['then'](handleEntityNotFound(_0xe1a2b4,null))[_0x29b8('0x24')](removeEntity(_0xe1a2b4,null))['catch'](handleError(_0xe1a2b4,null));};exports[_0x29b8('0x5c')]=function(_0x30b32e,_0x1a22b5){return db[_0x29b8('0x50')][_0x29b8('0x5c')]()[_0x29b8('0x24')](respondWithResult(_0x1a22b5,null))['catch'](handleError(_0x1a22b5,null));};var interaction_log=require(_0x29b8('0x15'))(_0x29b8('0x5d'));exports[_0x29b8('0x5e')]=function(_0x41d028,_0x25fc73,_0x298dd4){var _0x3dfe2e={'agent':{},'channel':_0x29b8('0x5f')};if(_0x41d028[_0x29b8('0x5a')]['id']){delete _0x41d028[_0x29b8('0x5a')]['id'];}_0x41d028[_0x29b8('0x5a')]['read']=!![];_0x41d028[_0x29b8('0x5a')][_0x29b8('0x60')]=moment()['format'](_0x29b8('0x61'));_0x41d028['body'][_0x29b8('0x62')]=_0x41d028[_0x29b8('0x5a')][_0x29b8('0x62')]||_0x41d028['user']['id'];_0x3dfe2e['agent']['id']=_0x41d028[_0x29b8('0x5a')][_0x29b8('0x62')];return db[_0x29b8('0x50')][_0x29b8('0x63')]({'where':{'id':_0x41d028['params']['id'],'UserId':null}})[_0x29b8('0x24')](handleEntityNotFound(_0x25fc73,null))[_0x29b8('0x24')](saveUpdates(_0x41d028[_0x29b8('0x5a')],null))['then'](function(_0x562194){if(_0x562194){_0x3dfe2e[_0x29b8('0x2b')]=_0x562194[_0x29b8('0x64')]({'plain':!![]});return db[_0x29b8('0x65')][_0x29b8('0x63')]({'where':{'id':_0x562194[_0x29b8('0x66')]}});}return null;})[_0x29b8('0x24')](handleEntityNotFound(_0x25fc73,null))[_0x29b8('0x24')](function(_0x45b300){if(_0x45b300){return _0x45b300['update']({'UserId':_0x41d028[_0x29b8('0x5a')]['UserId'],'read1stAt':_[_0x29b8('0x67')](_0x45b300['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x29b8('0x24')](function(_0x446f56){if(_0x446f56){_0x3dfe2e['interaction']=_0x446f56[_0x29b8('0x64')]({'plain':!![]});interaction_log['info'](_0x29b8('0x68'),_0x41d028['user']['id'],_0x41d028[_0x29b8('0x69')][_0x29b8('0x3a')],_0x41d028[_0x29b8('0x69')][_0x29b8('0x6a')],_0x3dfe2e['interaction']['id'],_0x41d028[_0x29b8('0x5a')]?JSON[_0x29b8('0x28')](_0x41d028['body']):_0x29b8('0x6b'));return respondWithRpcPromise(_0x29b8('0x6c'),_0x29b8('0x6d'),_0x3dfe2e);}return null;})[_0x29b8('0x24')](function(_0x2470c3){var _0x3226f1=_0x29b8('0x6e')+_0x2470c3['message'][_0x29b8('0x6f')];return db[_0x29b8('0x70')][_0x29b8('0x42')](_0x3226f1,{'type':db[_0x29b8('0x71')][_0x29b8('0x72')][_0x29b8('0x73')],'raw':!![]})['then'](function(_0x370567){return _0x370567;});})['then'](function(_0x55fbb9){if(_0x55fbb9){_0x3dfe2e[_0x29b8('0x2b')][_0x29b8('0x74')]=_0x55fbb9[0x0];if(!_0x41d028[_0x29b8('0x5a')][_0x29b8('0x62')])return;return db[_0x29b8('0x75')][_0x29b8('0x63')]({'where':{'id':_0x41d028['body']['UserId'],'role':_0x29b8('0x76')},'attributes':['id',_0x29b8('0x3a'),_0x29b8('0x77'),_0x29b8('0x78'),_0x29b8('0x79')],'raw':!![]});}return null;})[_0x29b8('0x24')](function(_0x2023cb){if(!_0x2023cb)return null;_0x3dfe2e['message'][_0x29b8('0x76')]=_0x2023cb;return _0x3dfe2e;})['then'](function(_0x47b16a){if(_0x47b16a){if(_0x41d028[_0x29b8('0x5a')]['manual']){_0x3dfe2e[_0x29b8('0x2b')][_0x29b8('0x7a')]=util[_0x29b8('0x7b')]('SIP/%s',_0x41d028[_0x29b8('0x69')][_0x29b8('0x3a')]);_0x3dfe2e[_0x29b8('0x2b')][_0x29b8('0x7c')]=_0x3dfe2e[_0x29b8('0x7c')];_0x3dfe2e[_0x29b8('0x2b')][_0x29b8('0x7d')]=_0x3dfe2e[_0x29b8('0x7c')];_0x3dfe2e[_0x29b8('0x2b')][_0x29b8('0x7e')]='accept';return respondWithRpcPromise(_0x29b8('0x7f'),_0x29b8('0x7f'),{'event':_0x29b8('0x80'),'message':_['merge'](_0x3dfe2e['message'],JSON[_0x29b8('0x81')](_0x3dfe2e[_0x29b8('0x82')][_0x29b8('0x83')]))},client9002)[_0x29b8('0x24')](function(){return _0x3dfe2e;});}return _0x3dfe2e;}return null;})[_0x29b8('0x24')](respondWithResult(_0x25fc73,null))[_0x29b8('0x2e')](handleError(_0x25fc73,null));};var interaction_log=require(_0x29b8('0x15'))(_0x29b8('0x5d'));exports[_0x29b8('0x36')]=function(_0x129284,_0x2b1573,_0x36bc13){var _0x4a328a={'agent':{},'channel':'chat'};if(_0x129284[_0x29b8('0x5a')]['id']){delete _0x129284['body']['id'];}_0x129284[_0x29b8('0x5a')][_0x29b8('0x62')]=_0x129284[_0x29b8('0x5a')]['UserId']||_0x129284['user']['id'];_0x4a328a['agent']['id']=_0x129284['body'][_0x29b8('0x62')];return db[_0x29b8('0x50')][_0x29b8('0x63')]({'where':{'id':_0x129284[_0x29b8('0x57')]['id'],'UserId':null}})[_0x29b8('0x24')](handleEntityNotFound(_0x2b1573,null))[_0x29b8('0x24')](function(_0x3ac626){if(_0x3ac626){_0x4a328a[_0x29b8('0x2b')]=_0x3ac626[_0x29b8('0x64')]({'plain':!![]});return db[_0x29b8('0x65')]['find']({'where':{'id':_0x3ac626[_0x29b8('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2b1573,null))[_0x29b8('0x24')](function(_0x41b9e6){if(_0x41b9e6){_0x4a328a[_0x29b8('0x82')]=_0x41b9e6[_0x29b8('0x64')]({'plain':!![]});interaction_log['info'](_0x29b8('0x84'),_0x129284[_0x29b8('0x69')]['id'],_0x129284[_0x29b8('0x69')]['name'],_0x129284[_0x29b8('0x69')]['role'],_0x4a328a['interaction']['id'],_0x129284[_0x29b8('0x5a')]?JSON[_0x29b8('0x28')](_0x129284['body']):_0x29b8('0x6b'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4a328a);}return null;})[_0x29b8('0x24')](function(_0x4602f0){var _0x3cf99f=_0x29b8('0x6e')+_0x4602f0['message']['ContactId'];return db[_0x29b8('0x70')][_0x29b8('0x42')](_0x3cf99f,{'type':db[_0x29b8('0x71')][_0x29b8('0x72')][_0x29b8('0x73')],'raw':!![]})['then'](function(_0x5d93eb){return _0x5d93eb;});})[_0x29b8('0x24')](function(_0xaa6da9){if(_0xaa6da9){_0x4a328a['message']['contact']=_0xaa6da9[0x0];if(!_0x129284['body'][_0x29b8('0x62')])return;return db[_0x29b8('0x75')][_0x29b8('0x63')]({'where':{'id':_0x129284[_0x29b8('0x5a')][_0x29b8('0x62')],'role':'agent'},'attributes':['id','name',_0x29b8('0x77'),_0x29b8('0x78'),_0x29b8('0x79')],'raw':!![]});}return null;})[_0x29b8('0x24')](function(_0x141a00){if(!_0x141a00)return null;_0x4a328a[_0x29b8('0x2b')][_0x29b8('0x76')]=_0x141a00;return _0x4a328a;})[_0x29b8('0x24')](function(_0x3aef98){if(_0x3aef98){_0x3aef98[_0x29b8('0x2b')]['interface']=util[_0x29b8('0x7b')](_0x29b8('0x85'),_0x129284[_0x29b8('0x69')][_0x29b8('0x3a')]);_0x3aef98[_0x29b8('0x2b')][_0x29b8('0x7c')]=_0x4a328a[_0x29b8('0x7c')];_0x3aef98[_0x29b8('0x2b')][_0x29b8('0x7d')]=_0x4a328a[_0x29b8('0x7c')];_0x3aef98[_0x29b8('0x2b')][_0x29b8('0x7e')]=_0x29b8('0x36');respondWithRpcPromise(_0x29b8('0x7f'),_0x29b8('0x7f'),{'event':_0x29b8('0x86'),'message':_['merge'](_0x4a328a[_0x29b8('0x2b')],JSON[_0x29b8('0x81')](_0x4a328a[_0x29b8('0x82')][_0x29b8('0x83')]))},client9002);return _0x4a328a;}return null;})[_0x29b8('0x24')](respondWithResult(_0x2b1573,null))['catch'](handleError(_0x2b1573,null));};
\ No newline at end of file
+var _0x56aa=['email','interface','channel','accept','EventManager','parse','formData','../../config/logger','ChatInteraction','ChatInteractionId','RejectMessage','rejectMessage','contact','internal','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','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','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','options','ChatMessage','includeAll','rows','params','fields','include','find','create','body','describe','chat-interactions','chat','read','readAt','UserId','user','agent','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x56aa,0x197));var _0xa56a=function(_0x304600,_0x4ecdfe){_0x304600=_0x304600-0x0;var _0x337878=_0x56aa[_0x304600];return _0x337878;};'use strict';var emlformat=require(_0xa56a('0x0'));var rimraf=require(_0xa56a('0x1'));var zipdir=require(_0xa56a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa56a('0x3'));var moment=require(_0xa56a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa56a('0x5'));var util=require('util');var path=require(_0xa56a('0x6'));var sox=require(_0xa56a('0x7'));var csv=require(_0xa56a('0x8'));var ejs=require(_0xa56a('0x9'));var fs=require('fs');var fs_extra=require(_0xa56a('0xa'));var _=require(_0xa56a('0xb'));var squel=require(_0xa56a('0xc'));var crypto=require(_0xa56a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa56a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa56a('0xf'));var Redis=require(_0xa56a('0x10'));var authService=require(_0xa56a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa56a('0x12'));var hardwareService=require(_0xa56a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa56a('0x14'));var config=require(_0xa56a('0x15'));var licenseUtil=require(_0xa56a('0x16'));var db=require(_0xa56a('0x17'))['db'];config[_0xa56a('0x18')]=_[_0xa56a('0x19')](config[_0xa56a('0x18')],{'host':_0xa56a('0x1a'),'port':0x18eb});var socket=require(_0xa56a('0x1b'))(new Redis(config[_0xa56a('0x18')]));require(_0xa56a('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa56a('0x1d')][_0xa56a('0x1e')]({'port':0x232c});var client9002=jayson[_0xa56a('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48fff4,_0x3d2354,_0xd3c04f,_0x5b0b76){return new BPromise(function(_0x2d4e38,_0x29c4cb){var _0x1730b5=_0x5b0b76||client;return _0x1730b5['request'](_0x48fff4,_0xd3c04f)[_0xa56a('0x1f')](function(_0xe00cd8){logger[_0xa56a('0x20')](_0xa56a('0x21'),_0x3d2354,_0xa56a('0x22'));logger[_0xa56a('0x23')](_0xa56a('0x24'),_0x3d2354,'request\x20sent',JSON[_0xa56a('0x25')](_0xe00cd8));if(_0xe00cd8['error']){if(_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x27')]===0x1f4){logger[_0xa56a('0x26')](_0xa56a('0x21'),_0x3d2354,_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x28')]);return _0x29c4cb(_0xe00cd8[_0xa56a('0x26')]['message']);}logger[_0xa56a('0x26')](_0xa56a('0x21'),_0x3d2354,_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x28')]);return _0x2d4e38(_0xe00cd8[_0xa56a('0x26')][_0xa56a('0x28')]);}else{logger[_0xa56a('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3d2354,_0xa56a('0x22'));_0x2d4e38(_0xe00cd8[_0xa56a('0x29')]['message']);}})[_0xa56a('0x2a')](function(_0x4dfcbb){logger[_0xa56a('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3d2354,_0x4dfcbb);_0x29c4cb(_0x4dfcbb);});});}function respondWithStatusCode(_0x5b1f72,_0x49eea5){_0x49eea5=_0x49eea5||0xcc;return function(_0x5c835e){if(_0x5c835e){return _0x5b1f72[_0xa56a('0x2b')](_0x49eea5);}return _0x5b1f72[_0xa56a('0x2c')](_0x49eea5)[_0xa56a('0x2d')]();};}function respondWithResult(_0x116032,_0x2a8cc4){_0x2a8cc4=_0x2a8cc4||0xc8;return function(_0xf8895a){if(_0xf8895a){return _0x116032[_0xa56a('0x2c')](_0x2a8cc4)[_0xa56a('0x2e')](_0xf8895a);}};}function respondWithFilteredResult(_0x5f1685,_0x32f313){return function(_0x29921b){if(_0x29921b){var _0x12a6ab=typeof _0x32f313[_0xa56a('0x2f')]===_0xa56a('0x30')&&typeof _0x32f313['limit']===_0xa56a('0x30');var _0x30db28=_0x29921b[_0xa56a('0x31')];var _0x36bf62=_0x12a6ab?0x0:_0x32f313[_0xa56a('0x2f')];var _0x1b864f=_0x12a6ab?_0x29921b[_0xa56a('0x31')]:_0x32f313['offset']+_0x32f313[_0xa56a('0x32')];var _0x3aad30;if(_0x1b864f>=_0x30db28){_0x1b864f=_0x30db28;_0x3aad30=0xc8;}else{_0x3aad30=0xce;}_0x5f1685[_0xa56a('0x2c')](_0x3aad30);return _0x5f1685[_0xa56a('0x33')](_0xa56a('0x34'),_0x36bf62+'-'+_0x1b864f+'/'+_0x30db28)[_0xa56a('0x2e')](_0x29921b);}return null;};}function patchUpdates(_0x3112c1){return function(_0x1922c0){try{jsonpatch['apply'](_0x1922c0,_0x3112c1,!![]);}catch(_0x25732d){return BPromise[_0xa56a('0x35')](_0x25732d);}return _0x1922c0[_0xa56a('0x36')]();};}function saveUpdates(_0x3fd1be,_0x43291d){return function(_0x5071ce){if(_0x5071ce){return _0x5071ce[_0xa56a('0x37')](_0x3fd1be)[_0xa56a('0x1f')](function(_0x1203b8){return _0x1203b8;});}return null;};}function removeEntity(_0x438bce,_0x2d79b2){return function(_0x4bb56c){if(_0x4bb56c){return _0x4bb56c[_0xa56a('0x38')]()[_0xa56a('0x1f')](function(){_0x438bce['status'](0xcc)[_0xa56a('0x2d')]();});}};}function handleEntityNotFound(_0x8cc858,_0x43af0e){return function(_0x5e65b5){if(!_0x5e65b5){_0x8cc858[_0xa56a('0x2b')](0x194);}return _0x5e65b5;};}function handleError(_0x5121ea,_0x2bbfd2){_0x2bbfd2=_0x2bbfd2||0x1f4;return function(_0x5557c2){logger['error'](_0x5557c2[_0xa56a('0x39')]);if(_0x5557c2[_0xa56a('0x3a')]){delete _0x5557c2[_0xa56a('0x3a')];}_0x5121ea['status'](_0x2bbfd2)[_0xa56a('0x3b')](_0x5557c2);};}exports[_0xa56a('0x3c')]=function(_0x467a49,_0xd3c84a){var _0x4fa52a={},_0x3d4e7e={},_0x15496f={'count':0x0,'rows':[]};var _0x43cc36=_[_0xa56a('0x3d')](db['ChatMessage'][_0xa56a('0x3e')],function(_0x35c375){return{'name':_0x35c375['fieldName'],'type':_0x35c375[_0xa56a('0x3f')][_0xa56a('0x40')]};});_0x3d4e7e[_0xa56a('0x41')]=_[_0xa56a('0x3d')](_0x43cc36,_0xa56a('0x3a'));_0x3d4e7e[_0xa56a('0x42')]=_[_0xa56a('0x43')](_0x467a49[_0xa56a('0x42')]);_0x3d4e7e[_0xa56a('0x44')]=_[_0xa56a('0x45')](_0x3d4e7e['model'],_0x3d4e7e['query']);_0x4fa52a[_0xa56a('0x46')]=_[_0xa56a('0x45')](_0x3d4e7e['model'],qs['fields'](_0x467a49[_0xa56a('0x42')]['fields']));_0x4fa52a[_0xa56a('0x46')]=_0x4fa52a['attributes'][_0xa56a('0x47')]?_0x4fa52a[_0xa56a('0x46')]:_0x3d4e7e[_0xa56a('0x41')];if(!_0x467a49[_0xa56a('0x42')][_0xa56a('0x48')](_0xa56a('0x49'))){_0x4fa52a[_0xa56a('0x32')]=qs['limit'](_0x467a49['query'][_0xa56a('0x32')]);_0x4fa52a[_0xa56a('0x2f')]=qs[_0xa56a('0x2f')](_0x467a49[_0xa56a('0x42')]['offset']);}_0x4fa52a['order']=qs['sort'](_0x467a49['query']['sort']);_0x4fa52a[_0xa56a('0x4a')]=qs['filters'](_[_0xa56a('0x4b')](_0x467a49[_0xa56a('0x42')],_0x3d4e7e[_0xa56a('0x44')]),_0x43cc36);if(_0x467a49[_0xa56a('0x42')]['filter']){_0x4fa52a[_0xa56a('0x4a')]=_[_0xa56a('0x4c')](_0x4fa52a[_0xa56a('0x4a')],{'$or':_['map'](_0x43cc36,function(_0x532dc7){if(_0x532dc7[_0xa56a('0x3f')]!==_0xa56a('0x4d')){var _0xba83ec={};_0xba83ec[_0x532dc7[_0xa56a('0x3a')]]={'$like':'%'+_0x467a49[_0xa56a('0x42')][_0xa56a('0x4e')]+'%'};return _0xba83ec;}})});}_0x4fa52a=_[_0xa56a('0x4c')]({},_0x4fa52a,_0x467a49[_0xa56a('0x4f')]);var _0x2de736={'where':_0x4fa52a[_0xa56a('0x4a')]};return db[_0xa56a('0x50')][_0xa56a('0x31')](_0x2de736)['then'](function(_0x3dd8ae){_0x15496f['count']=_0x3dd8ae;if(_0x467a49[_0xa56a('0x42')][_0xa56a('0x51')]){_0x4fa52a['include']=[{'all':!![]}];}return db[_0xa56a('0x50')]['findAll'](_0x4fa52a);})[_0xa56a('0x1f')](function(_0x5238b8){_0x15496f[_0xa56a('0x52')]=_0x5238b8;return _0x15496f;})[_0xa56a('0x1f')](respondWithFilteredResult(_0xd3c84a,_0x4fa52a))[_0xa56a('0x2a')](handleError(_0xd3c84a,null));};exports['show']=function(_0x339369,_0x101c95){var _0xfac16b={'raw':!![],'where':{'id':_0x339369[_0xa56a('0x53')]['id']}},_0x566119={};_0x566119[_0xa56a('0x41')]=_[_0xa56a('0x43')](db[_0xa56a('0x50')][_0xa56a('0x3e')]);_0x566119[_0xa56a('0x42')]=_['keys'](_0x339369[_0xa56a('0x42')]);_0x566119['filters']=_[_0xa56a('0x45')](_0x566119[_0xa56a('0x41')],_0x566119[_0xa56a('0x42')]);_0xfac16b[_0xa56a('0x46')]=_[_0xa56a('0x45')](_0x566119[_0xa56a('0x41')],qs[_0xa56a('0x54')](_0x339369[_0xa56a('0x42')][_0xa56a('0x54')]));_0xfac16b[_0xa56a('0x46')]=_0xfac16b[_0xa56a('0x46')][_0xa56a('0x47')]?_0xfac16b['attributes']:_0x566119[_0xa56a('0x41')];if(_0x339369[_0xa56a('0x42')][_0xa56a('0x51')]){_0xfac16b[_0xa56a('0x55')]=[{'all':!![]}];}_0xfac16b=_['merge']({},_0xfac16b,_0x339369[_0xa56a('0x4f')]);return db[_0xa56a('0x50')][_0xa56a('0x56')](_0xfac16b)[_0xa56a('0x1f')](handleEntityNotFound(_0x101c95,null))[_0xa56a('0x1f')](respondWithResult(_0x101c95,null))[_0xa56a('0x2a')](handleError(_0x101c95,null));};exports[_0xa56a('0x57')]=function(_0x3cf895,_0x3157cc){return db[_0xa56a('0x50')][_0xa56a('0x57')](_0x3cf895[_0xa56a('0x58')],{})['then'](respondWithResult(_0x3157cc,0xc9))[_0xa56a('0x2a')](handleError(_0x3157cc,null));};exports['update']=function(_0x1b5ef3,_0x1a2dd1){if(_0x1b5ef3[_0xa56a('0x58')]['id']){delete _0x1b5ef3[_0xa56a('0x58')]['id'];}return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x1b5ef3[_0xa56a('0x53')]['id']}})[_0xa56a('0x1f')](handleEntityNotFound(_0x1a2dd1,null))[_0xa56a('0x1f')](saveUpdates(_0x1b5ef3[_0xa56a('0x58')],null))[_0xa56a('0x1f')](respondWithResult(_0x1a2dd1,null))[_0xa56a('0x2a')](handleError(_0x1a2dd1,null));};exports[_0xa56a('0x38')]=function(_0x451423,_0x284f99){return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x451423[_0xa56a('0x53')]['id']}})['then'](handleEntityNotFound(_0x284f99,null))[_0xa56a('0x1f')](removeEntity(_0x284f99,null))[_0xa56a('0x2a')](handleError(_0x284f99,null));};exports[_0xa56a('0x59')]=function(_0x14ea80,_0x3c2ee2){return db[_0xa56a('0x50')][_0xa56a('0x59')]()[_0xa56a('0x1f')](respondWithResult(_0x3c2ee2,null))[_0xa56a('0x2a')](handleError(_0x3c2ee2,null));};var interaction_log=require('../../config/logger')(_0xa56a('0x5a'));exports['accept']=function(_0x4c632c,_0x596c3c,_0x4f4cad){var _0x43d454={'agent':{},'channel':_0xa56a('0x5b')};if(_0x4c632c[_0xa56a('0x58')]['id']){delete _0x4c632c[_0xa56a('0x58')]['id'];}_0x4c632c['body'][_0xa56a('0x5c')]=!![];_0x4c632c[_0xa56a('0x58')][_0xa56a('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c632c['body']['UserId']=_0x4c632c['body'][_0xa56a('0x5e')]||_0x4c632c[_0xa56a('0x5f')]['id'];_0x43d454[_0xa56a('0x60')]['id']=_0x4c632c[_0xa56a('0x58')][_0xa56a('0x5e')];return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x4c632c[_0xa56a('0x53')]['id'],'UserId':null}})[_0xa56a('0x1f')](handleEntityNotFound(_0x596c3c,null))['then'](saveUpdates(_0x4c632c[_0xa56a('0x58')],null))['then'](function(_0x2b0d00){if(_0x2b0d00){_0x43d454[_0xa56a('0x28')]=_0x2b0d00['get']({'plain':!![]});return db['ChatInteraction'][_0xa56a('0x56')]({'where':{'id':_0x2b0d00['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x596c3c,null))[_0xa56a('0x1f')](function(_0x5146bf){if(_0x5146bf){return _0x5146bf[_0xa56a('0x37')]({'UserId':_0x4c632c[_0xa56a('0x58')]['UserId'],'read1stAt':_['isNil'](_0x5146bf[_0xa56a('0x61')])?moment()[_0xa56a('0x62')](_0xa56a('0x63')):undefined});}return null;})[_0xa56a('0x1f')](function(_0xd62408){if(_0xd62408){_0x43d454[_0xa56a('0x64')]=_0xd62408[_0xa56a('0x65')]({'plain':!![]});interaction_log[_0xa56a('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c632c[_0xa56a('0x5f')]['id'],_0x4c632c[_0xa56a('0x5f')][_0xa56a('0x3a')],_0x4c632c[_0xa56a('0x5f')][_0xa56a('0x66')],_0x43d454[_0xa56a('0x64')]['id'],_0x4c632c[_0xa56a('0x58')]?JSON['stringify'](_0x4c632c[_0xa56a('0x58')]):_0xa56a('0x67'));return respondWithRpcPromise(_0xa56a('0x68'),_0xa56a('0x69'),_0x43d454);}return null;})[_0xa56a('0x1f')](function(_0x47c8db){var _0x46ddce=_0xa56a('0x6a')+_0x47c8db['message'][_0xa56a('0x6b')];return db[_0xa56a('0x6c')][_0xa56a('0x42')](_0x46ddce,{'type':db[_0xa56a('0x6d')][_0xa56a('0x6e')][_0xa56a('0x6f')],'raw':!![]})[_0xa56a('0x1f')](function(_0x947c90){return _0x947c90;});})[_0xa56a('0x1f')](function(_0x3f49f1){if(_0x3f49f1){_0x43d454[_0xa56a('0x28')]['contact']=_0x3f49f1[0x0];if(!_0x4c632c[_0xa56a('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4c632c[_0xa56a('0x58')][_0xa56a('0x5e')],'role':_0xa56a('0x60')},'attributes':['id',_0xa56a('0x3a'),_0xa56a('0x70'),_0xa56a('0x71'),'internal'],'raw':!![]});}return null;})[_0xa56a('0x1f')](function(_0x4e2a5b){if(!_0x4e2a5b)return null;_0x43d454[_0xa56a('0x28')]['agent']=_0x4e2a5b;return _0x43d454;})[_0xa56a('0x1f')](function(_0x3e3d3d){if(_0x3e3d3d){if(_0x4c632c['body']['manual']){_0x43d454['message'][_0xa56a('0x72')]=util[_0xa56a('0x62')]('SIP/%s',_0x4c632c[_0xa56a('0x5f')][_0xa56a('0x3a')]);_0x43d454[_0xa56a('0x28')]['channel']=_0x43d454[_0xa56a('0x73')];_0x43d454[_0xa56a('0x28')]['motionChannel']=_0x43d454[_0xa56a('0x73')];_0x43d454[_0xa56a('0x28')]['event']=_0xa56a('0x74');return respondWithRpcPromise(_0xa56a('0x75'),_0xa56a('0x75'),{'event':'acceptmessage','message':_['merge'](_0x43d454['message'],JSON[_0xa56a('0x76')](_0x43d454[_0xa56a('0x64')][_0xa56a('0x77')]))},client9002)['then'](function(){return _0x43d454;});}return _0x43d454;}return null;})[_0xa56a('0x1f')](respondWithResult(_0x596c3c,null))[_0xa56a('0x2a')](handleError(_0x596c3c,null));};var interaction_log=require(_0xa56a('0x78'))(_0xa56a('0x5a'));exports[_0xa56a('0x35')]=function(_0x526a4b,_0x53442e,_0x596349){var _0xcd17e4={'agent':{},'channel':_0xa56a('0x5b')};if(_0x526a4b[_0xa56a('0x58')]['id']){delete _0x526a4b[_0xa56a('0x58')]['id'];}_0x526a4b['body'][_0xa56a('0x5e')]=_0x526a4b[_0xa56a('0x58')][_0xa56a('0x5e')]||_0x526a4b[_0xa56a('0x5f')]['id'];_0xcd17e4[_0xa56a('0x60')]['id']=_0x526a4b['body']['UserId'];return db[_0xa56a('0x50')][_0xa56a('0x56')]({'where':{'id':_0x526a4b[_0xa56a('0x53')]['id'],'UserId':null}})[_0xa56a('0x1f')](handleEntityNotFound(_0x53442e,null))[_0xa56a('0x1f')](function(_0x3bd21d){if(_0x3bd21d){_0xcd17e4[_0xa56a('0x28')]=_0x3bd21d['get']({'plain':!![]});return db[_0xa56a('0x79')][_0xa56a('0x56')]({'where':{'id':_0x3bd21d[_0xa56a('0x7a')]}});}return null;})[_0xa56a('0x1f')](handleEntityNotFound(_0x53442e,null))[_0xa56a('0x1f')](function(_0x2c95e0){if(_0x2c95e0){_0xcd17e4[_0xa56a('0x64')]=_0x2c95e0[_0xa56a('0x65')]({'plain':!![]});interaction_log[_0xa56a('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x526a4b[_0xa56a('0x5f')]['id'],_0x526a4b['user']['name'],_0x526a4b[_0xa56a('0x5f')][_0xa56a('0x66')],_0xcd17e4[_0xa56a('0x64')]['id'],_0x526a4b['body']?JSON['stringify'](_0x526a4b[_0xa56a('0x58')]):_0xa56a('0x67'));return respondWithRpcPromise(_0xa56a('0x7b'),_0xa56a('0x7c'),_0xcd17e4);}return null;})[_0xa56a('0x1f')](function(_0x4d0ff3){var _0x33dcc5=_0xa56a('0x6a')+_0x4d0ff3['message'][_0xa56a('0x6b')];return db['sequelize'][_0xa56a('0x42')](_0x33dcc5,{'type':db['Sequelize'][_0xa56a('0x6e')][_0xa56a('0x6f')],'raw':!![]})[_0xa56a('0x1f')](function(_0x231e9a){return _0x231e9a;});})[_0xa56a('0x1f')](function(_0x2a4860){if(_0x2a4860){_0xcd17e4['message'][_0xa56a('0x7d')]=_0x2a4860[0x0];if(!_0x526a4b[_0xa56a('0x58')][_0xa56a('0x5e')])return;return db['User']['find']({'where':{'id':_0x526a4b[_0xa56a('0x58')]['UserId'],'role':_0xa56a('0x60')},'attributes':['id',_0xa56a('0x3a'),_0xa56a('0x70'),_0xa56a('0x71'),_0xa56a('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4fda54){if(!_0x4fda54)return null;_0xcd17e4[_0xa56a('0x28')][_0xa56a('0x60')]=_0x4fda54;return _0xcd17e4;})['then'](function(_0x248e7f){if(_0x248e7f){_0x248e7f[_0xa56a('0x28')][_0xa56a('0x72')]=util[_0xa56a('0x62')](_0xa56a('0x7f'),_0x526a4b['user']['name']);_0x248e7f['message'][_0xa56a('0x73')]=_0xcd17e4[_0xa56a('0x73')];_0x248e7f[_0xa56a('0x28')][_0xa56a('0x80')]=_0xcd17e4[_0xa56a('0x73')];_0x248e7f['message']['event']=_0xa56a('0x35');respondWithRpcPromise(_0xa56a('0x75'),_0xa56a('0x75'),{'event':_0xa56a('0x81'),'message':_[_0xa56a('0x4c')](_0xcd17e4[_0xa56a('0x28')],JSON[_0xa56a('0x76')](_0xcd17e4[_0xa56a('0x64')][_0xa56a('0x77')]))},client9002);return _0xcd17e4;}return null;})[_0xa56a('0x1f')](respondWithResult(_0x53442e,null))[_0xa56a('0x2a')](handleError(_0x53442e,null));};
\ No newline at end of file
index 356de60..bf35b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd07=['update','remove','emit','hasOwnProperty','setMaxListeners','save'];(function(_0xa6b126,_0xc2c63){var _0x2ff0bb=function(_0x141f78){while(--_0x141f78){_0xa6b126['push'](_0xa6b126['shift']());}};_0x2ff0bb(++_0xc2c63);}(_0xdd07,0x1c6));var _0x7dd0=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xdd07[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7dd0('0x0')](0x0);var events={'afterCreate':_0x7dd0('0x1'),'afterUpdate':_0x7dd0('0x2'),'afterDestroy':_0x7dd0('0x3')};function emitEvent(_0x5a1bc9){return function(_0x59913b,_0x126e03,_0x2ca0f0){ChatMessageEvents['emit'](_0x5a1bc9+':'+_0x59913b['id'],_0x59913b);ChatMessageEvents[_0x7dd0('0x4')](_0x5a1bc9,_0x59913b);_0x2ca0f0(null);};}for(var e in events){if(events[_0x7dd0('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x6857=['hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x3c7a54,_0x2e248f){var _0x14a3b=function(_0xe3b51a){while(--_0xe3b51a){_0x3c7a54['push'](_0x3c7a54['shift']());}};_0x14a3b(++_0x2e248f);}(_0x6857,0xc6));var _0x7685=function(_0x254dc2,_0x26c4e0){_0x254dc2=_0x254dc2-0x0;var _0x47ee1b=_0x6857[_0x254dc2];return _0x47ee1b;};'use strict';var EventEmitter=require(_0x7685('0x0'));var ChatMessage=require(_0x7685('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7685('0x2'),'afterUpdate':'update','afterDestroy':_0x7685('0x3')};function emitEvent(_0x26216e){return function(_0x310019,_0x3386d5,_0x1ae74f){ChatMessageEvents[_0x7685('0x4')](_0x26216e+':'+_0x310019['id'],_0x310019);ChatMessageEvents[_0x7685('0x4')](_0x26216e,_0x310019);_0x1ae74f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7685('0x5')](e,emitEvent(event));}}module[_0x7685('0x6')]=ChatMessageEvents;
\ No newline at end of file
index 3da6ccb..027127c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d70=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x2d70,0xd2));var _0x02d7=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x2d70[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x02d7('0x0'));var util=require('util');var logger=require(_0x02d7('0x1'))(_0x02d7('0x2'));var moment=require(_0x02d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x02d7('0x4'));var fs=require('fs');var path=require(_0x02d7('0x5'));var rimraf=require(_0x02d7('0x6'));var config=require(_0x02d7('0x7'));var attributes=require(_0x02d7('0x8'));module[_0x02d7('0x9')]=function(_0xb7ad71,_0x34e039){return _0xb7ad71[_0x02d7('0xa')](_0x02d7('0xb'),attributes,{'tableName':_0x02d7('0xc'),'paranoid':![],'indexes':[{'name':_0x02d7('0xd'),'fields':[_0x02d7('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17de46,_0x20edb3,_0x7118b5){var _0x48e258=_0xb7ad71[_0x02d7('0xf')];var _0x154b36=_0x17de46[_0x02d7('0x10')]({'plain':!![]});if(_0x154b36[_0x02d7('0x11')][_0x02d7('0x12')]()==='in'||_0x154b36[_0x02d7('0x11')][_0x02d7('0x12')]()===_0x02d7('0x13')&&!_0x154b36[_0x02d7('0x14')]&&!_[_0x02d7('0x15')](_0x154b36[_0x02d7('0x16')])){_0x48e258[_0x02d7('0x17')][_0x02d7('0x18')]({'where':{'id':_0x154b36[_0x02d7('0x19')]}})['then'](function(_0x3034ca){if(_0x3034ca){_0x3034ca[_0x02d7('0x1a')]({'lastMsgAt':_0x154b36[_0x02d7('0x1b')],'lastMsgDirection':_0x154b36[_0x02d7('0x11')]['toLowerCase']()});}})['catch'](function(_0x47d377){console[_0x02d7('0x1c')](_0x47d377);});}_0x7118b5();}},'charset':_0x02d7('0x1d'),'collate':_0x02d7('0x1e')});};
\ No newline at end of file
+var _0xb2ef=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out'];(function(_0xacaf13,_0x1ea63d){var _0x452ba7=function(_0xb3a3d0){while(--_0xb3a3d0){_0xacaf13['push'](_0xacaf13['shift']());}};_0x452ba7(++_0x1ea63d);}(_0xb2ef,0x121));var _0xfb2e=function(_0x2b34e0,_0x3d9ae8){_0x2b34e0=_0x2b34e0-0x0;var _0x1c15c5=_0xb2ef[_0x2b34e0];return _0x1c15c5;};'use strict';var _=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var logger=require(_0xfb2e('0x2'))(_0xfb2e('0x3'));var moment=require(_0xfb2e('0x4'));var BPromise=require(_0xfb2e('0x5'));var rp=require(_0xfb2e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2e('0x7'));var config=require(_0xfb2e('0x8'));var attributes=require(_0xfb2e('0x9'));module[_0xfb2e('0xa')]=function(_0x27c3fa,_0x216c25){return _0x27c3fa[_0xfb2e('0xb')](_0xfb2e('0xc'),attributes,{'tableName':_0xfb2e('0xd'),'paranoid':![],'indexes':[{'name':_0xfb2e('0xe'),'fields':[_0xfb2e('0xf')],'type':_0xfb2e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x161283,_0x14b0b8,_0xf81270){var _0x3b8e4a=_0x27c3fa[_0xfb2e('0x11')];var _0x244341=_0x161283['get']({'plain':!![]});if(_0x244341[_0xfb2e('0x12')][_0xfb2e('0x13')]()==='in'||_0x244341[_0xfb2e('0x12')][_0xfb2e('0x13')]()===_0xfb2e('0x14')&&!_0x244341['secret']&&!_[_0xfb2e('0x15')](_0x244341[_0xfb2e('0x16')])){_0x3b8e4a[_0xfb2e('0x17')][_0xfb2e('0x18')]({'where':{'id':_0x244341[_0xfb2e('0x19')]}})['then'](function(_0x4f96e9){if(_0x4f96e9){_0x4f96e9[_0xfb2e('0x1a')]({'lastMsgAt':_0x244341[_0xfb2e('0x1b')],'lastMsgDirection':_0x244341[_0xfb2e('0x12')][_0xfb2e('0x13')]()});}})[_0xfb2e('0x1c')](function(_0x364362){console['error'](_0x364362);});}_0xf81270();}},'charset':_0xfb2e('0x1d'),'collate':_0xfb2e('0x1e')});};
\ No newline at end of file
index ecbbd22..253a6b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6746=['http','redis','defaults','localhost','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','create','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x3c12f5,_0x2dd4b9){var _0x40fcad=function(_0x46b9f6){while(--_0x46b9f6){_0x3c12f5['push'](_0x3c12f5['shift']());}};_0x40fcad(++_0x2dd4b9);}(_0x6746,0xb5));var _0x6674=function(_0x2a6501,_0x9c5a0e){_0x2a6501=_0x2a6501-0x0;var _0x34d3ae=_0x6746[_0x2a6501];return _0x34d3ae;};'use strict';var _=require(_0x6674('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6674('0x1'));var rs=require(_0x6674('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6674('0x3'))['db'];var utils=require(_0x6674('0x4'));var logger=require(_0x6674('0x5'))(_0x6674('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6674('0x7')][_0x6674('0x8')]({'port':0x232a});config[_0x6674('0x9')]=_[_0x6674('0xa')](config[_0x6674('0x9')],{'host':_0x6674('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6674('0xc'))['register'](socket);function respondWithRpcPromise(_0x5ddc9d,_0x1c5827,_0x405520){return new BPromise(function(_0x445ce4,_0x5a4acf){return client['request'](_0x5ddc9d,_0x405520)[_0x6674('0xd')](function(_0x505574){logger[_0x6674('0xe')](_0x6674('0xf'),_0x1c5827,_0x6674('0x10'));logger[_0x6674('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1c5827,_0x6674('0x10'),JSON[_0x6674('0x12')](_0x505574));if(_0x505574[_0x6674('0x13')]){if(_0x505574['error']['code']===0x1f4){logger[_0x6674('0x13')](_0x6674('0xf'),_0x1c5827,_0x505574[_0x6674('0x13')][_0x6674('0x14')]);return _0x5a4acf(_0x505574[_0x6674('0x13')][_0x6674('0x14')]);}logger[_0x6674('0x13')](_0x6674('0xf'),_0x1c5827,_0x505574['error']['message']);return _0x445ce4(_0x505574['error'][_0x6674('0x14')]);}else{logger[_0x6674('0xe')](_0x6674('0xf'),_0x1c5827,'request\x20sent');_0x445ce4(_0x505574[_0x6674('0x15')]['message']);}})[_0x6674('0x16')](function(_0x3a83ac){logger['error'](_0x6674('0xf'),_0x1c5827,_0x3a83ac);_0x5a4acf(_0x3a83ac);});});}exports[_0x6674('0x17')]=function(_0x2dc4e2){var _0x548ee6=this;return new Promise(function(_0x51912b,_0xc73798){return db['ChatMessage'][_0x6674('0x18')](_0x2dc4e2['body'],{'raw':_0x2dc4e2[_0x6674('0x19')]?_0x2dc4e2[_0x6674('0x19')][_0x6674('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x32d0a8){logger['info']('CreateChatMessage',_0x2dc4e2);logger[_0x6674('0x11')]('CreateChatMessage',_0x2dc4e2,JSON['stringify'](_0x32d0a8));_0x51912b(_0x32d0a8);})[_0x6674('0x16')](function(_0x5769c6){logger[_0x6674('0x13')](_0x6674('0x17'),_0x5769c6[_0x6674('0x14')],_0x2dc4e2);_0xc73798(_0x548ee6[_0x6674('0x13')](0x1f4,_0x5769c6[_0x6674('0x14')]));});});};
\ No newline at end of file
+var _0xfb90=['create','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatMessage','ChatMessage'];(function(_0x494022,_0xdc326c){var _0xfb72f0=function(_0x10cd99){while(--_0x10cd99){_0x494022['push'](_0x494022['shift']());}};_0xfb72f0(++_0xdc326c);}(_0xfb90,0x18f));var _0x0fb9=function(_0xe2a1aa,_0x525d7b){_0xe2a1aa=_0xe2a1aa-0x0;var _0x5a8362=_0xfb90[_0xe2a1aa];return _0x5a8362;};'use strict';var _=require(_0x0fb9('0x0'));var util=require(_0x0fb9('0x1'));var moment=require('moment');var BPromise=require(_0x0fb9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fb9('0x3'));var db=require(_0x0fb9('0x4'))['db'];var utils=require(_0x0fb9('0x5'));var logger=require(_0x0fb9('0x6'))('rpc');var config=require(_0x0fb9('0x7'));var jayson=require(_0x0fb9('0x8'));var client=jayson[_0x0fb9('0x9')][_0x0fb9('0xa')]({'port':0x232a});config[_0x0fb9('0xb')]=_['defaults'](config[_0x0fb9('0xb')],{'host':_0x0fb9('0xc'),'port':0x18eb});var socket=require(_0x0fb9('0xd'))(new Redis(config[_0x0fb9('0xb')]));require(_0x0fb9('0xe'))['register'](socket);function respondWithRpcPromise(_0x4e753a,_0xa334a1,_0x5afb93){return new BPromise(function(_0x227262,_0x354221){return client[_0x0fb9('0xf')](_0x4e753a,_0x5afb93)[_0x0fb9('0x10')](function(_0x198b21){logger[_0x0fb9('0x11')](_0x0fb9('0x12'),_0xa334a1,'request\x20sent');logger[_0x0fb9('0x13')](_0x0fb9('0x14'),_0xa334a1,'request\x20sent',JSON[_0x0fb9('0x15')](_0x198b21));if(_0x198b21[_0x0fb9('0x16')]){if(_0x198b21[_0x0fb9('0x16')][_0x0fb9('0x17')]===0x1f4){logger[_0x0fb9('0x16')](_0x0fb9('0x12'),_0xa334a1,_0x198b21['error']['message']);return _0x354221(_0x198b21[_0x0fb9('0x16')]['message']);}logger[_0x0fb9('0x16')]('ChatMessage,\x20%s,\x20%s',_0xa334a1,_0x198b21['error'][_0x0fb9('0x18')]);return _0x227262(_0x198b21[_0x0fb9('0x16')][_0x0fb9('0x18')]);}else{logger['info'](_0x0fb9('0x12'),_0xa334a1,_0x0fb9('0x19'));_0x227262(_0x198b21[_0x0fb9('0x1a')][_0x0fb9('0x18')]);}})[_0x0fb9('0x1b')](function(_0x4fdf8d){logger[_0x0fb9('0x16')](_0x0fb9('0x12'),_0xa334a1,_0x4fdf8d);_0x354221(_0x4fdf8d);});});}exports[_0x0fb9('0x1c')]=function(_0x3506b3){var _0x4ffb21=this;return new Promise(function(_0xd0a5ef,_0x51e1f5){return db[_0x0fb9('0x1d')][_0x0fb9('0x1e')](_0x3506b3['body'],{'raw':_0x3506b3['options']?_0x3506b3[_0x0fb9('0x1f')][_0x0fb9('0x20')]===undefined?!![]:![]:!![]})[_0x0fb9('0x10')](function(_0x150044){logger[_0x0fb9('0x11')](_0x0fb9('0x1c'),_0x3506b3);logger[_0x0fb9('0x13')]('CreateChatMessage',_0x3506b3,JSON[_0x0fb9('0x15')](_0x150044));_0xd0a5ef(_0x150044);})[_0x0fb9('0x1b')](function(_0xf27877){logger[_0x0fb9('0x16')](_0x0fb9('0x1c'),_0xf27877[_0x0fb9('0x18')],_0x3506b3);_0x51e1f5(_0x4ffb21['error'](0x1f4,_0xf27877[_0x0fb9('0x18')]));});});};
\ No newline at end of file
index dc388f2..25784ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b27=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x7b27,0x186));var _0x77b2=function(_0x1595dc,_0x42046a){_0x1595dc=_0x1595dc-0x0;var _0x341020=_0x7b27[_0x1595dc];return _0x341020;};'use strict';var ChatMessageEvents=require(_0x77b2('0x0'));var events=['save',_0x77b2('0x1'),_0x77b2('0x2')];function createListener(_0x4000dd,_0x2f5a3a){return function(_0x511dfe){_0x2f5a3a[_0x77b2('0x3')](_0x4000dd,_0x511dfe);};}function removeListener(_0x47075b,_0x5e5289){return function(){ChatMessageEvents[_0x77b2('0x4')](_0x47075b,_0x5e5289);};}exports[_0x77b2('0x5')]=function(_0x243b61){for(var _0x569bce=0x0,_0x22bdcf=events[_0x77b2('0x6')];_0x569bce<_0x22bdcf;_0x569bce++){var _0x2f01a2=events[_0x569bce];var _0x1308f7=createListener('chatMessage:'+_0x2f01a2,_0x243b61);ChatMessageEvents['on'](_0x2f01a2,_0x1308f7);}};
\ No newline at end of file
+var _0x3d6d=['update','emit','removeListener','length','./chatMessage.events','save','remove'];(function(_0x4452e0,_0x20358b){var _0x1c9be0=function(_0xa95a17){while(--_0xa95a17){_0x4452e0['push'](_0x4452e0['shift']());}};_0x1c9be0(++_0x20358b);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x3d6d[_0x695b76];return _0x1dc21f;};'use strict';var ChatMessageEvents=require(_0xd3d6('0x0'));var events=[_0xd3d6('0x1'),_0xd3d6('0x2'),_0xd3d6('0x3')];function createListener(_0x380c09,_0x1e1915){return function(_0x366f41){_0x1e1915[_0xd3d6('0x4')](_0x380c09,_0x366f41);};}function removeListener(_0x297bd6,_0x3d5e37){return function(){ChatMessageEvents[_0xd3d6('0x5')](_0x297bd6,_0x3d5e37);};}exports['register']=function(_0x5400f8){for(var _0x3f36=0x0,_0x1f02f5=events[_0xd3d6('0x6')];_0x3f36<_0x1f02f5;_0x3f36++){var _0x3c2a9b=events[_0x3f36];var _0x4356b7=createListener('chatMessage:'+_0x3c2a9b,_0x5400f8);ChatMessageEvents['on'](_0x3c2a9b,_0x4356b7);}};
\ No newline at end of file
index 41c8112..f2d176a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x156a=['chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','tracked','chat'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x156a,0x1d6));var _0xa156=function(_0x2ad1c9,_0x3c37ac){_0x2ad1c9=_0x2ad1c9-0x0;var _0x1633cb=_0x156a[_0x2ad1c9];return _0x1633cb;};'use strict';var multer=require('multer');var util=require(_0xa156('0x0'));var path=require(_0xa156('0x1'));var timeout=require(_0xa156('0x2'));var express=require(_0xa156('0x3'));var router=express[_0xa156('0x4')]();var fs_extra=require(_0xa156('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa156('0x6'));var config=require(_0xa156('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xa156('0x8')](),controller[_0xa156('0x9')]);router[_0xa156('0xa')](_0xa156('0xb'),auth[_0xa156('0x8')](),controller['describe']);router[_0xa156('0xa')](_0xa156('0xc'),auth[_0xa156('0x8')](),controller[_0xa156('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa156('0xe')](_0xa156('0xf'),_0xa156('0x10')),controller[_0xa156('0x11')]);router['put'](_0xa156('0xc'),controller[_0xa156('0x12')]);router[_0xa156('0x13')](_0xa156('0x14'),auth[_0xa156('0x8')](),controller[_0xa156('0x15')]);router['put'](_0xa156('0x16'),auth[_0xa156('0x8')](),controller[_0xa156('0x17')]);router[_0xa156('0x18')](_0xa156('0xc'),auth[_0xa156('0x8')](),controller[_0xa156('0x19')]);module[_0xa156('0x1a')]=router;
\ No newline at end of file
+var _0xf436=['/describe','describe','/:id','tracked','chat','chatmessage:create','create','update','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated'];(function(_0xe111b0,_0x33b1cb){var _0x370295=function(_0x5945b1){while(--_0x5945b1){_0xe111b0['push'](_0xe111b0['shift']());}};_0x370295(++_0x33b1cb);}(_0xf436,0x1ee));var _0x6f43=function(_0x1b8561,_0xad7d74){_0x1b8561=_0x1b8561-0x0;var _0x4ec35a=_0xf436[_0x1b8561];return _0x4ec35a;};'use strict';var multer=require('multer');var util=require(_0x6f43('0x0'));var path=require('path');var timeout=require(_0x6f43('0x1'));var express=require(_0x6f43('0x2'));var router=express[_0x6f43('0x3')]();var fs_extra=require(_0x6f43('0x4'));var auth=require(_0x6f43('0x5'));var interaction=require(_0x6f43('0x6'));var config=require('../../config/environment');var controller=require(_0x6f43('0x7'));router[_0x6f43('0x8')]('/',auth[_0x6f43('0x9')](),controller['index']);router[_0x6f43('0x8')](_0x6f43('0xa'),auth[_0x6f43('0x9')](),controller[_0x6f43('0xb')]);router[_0x6f43('0x8')](_0x6f43('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6f43('0x9')](),interaction[_0x6f43('0xd')](_0x6f43('0xe'),_0x6f43('0xf')),controller[_0x6f43('0x10')]);router['put']('/:id',controller[_0x6f43('0x11')]);router[_0x6f43('0x12')](_0x6f43('0x13'),auth[_0x6f43('0x9')](),controller['accept']);router[_0x6f43('0x12')](_0x6f43('0x14'),auth[_0x6f43('0x9')](),controller[_0x6f43('0x15')]);router[_0x6f43('0x16')](_0x6f43('0xc'),auth[_0x6f43('0x9')](),controller[_0x6f43('0x17')]);module['exports']=router;
\ No newline at end of file
index befad7d..1da5490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0x58f428,_0x1365c7){var _0x42dcb5=function(_0x431a49){while(--_0x431a49){_0x58f428['push'](_0x58f428['shift']());}};_0x42dcb5(++_0x1365c7);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e06a1,_0x340f61){_0x5e06a1=_0x5e06a1-0x0;var _0x5b3253=_0xb10b[_0x5e06a1];return _0x5b3253;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x5695c9,_0x5ddd60){var _0x310254=function(_0x2a1c18){while(--_0x2a1c18){_0x5695c9['push'](_0x5695c9['shift']());}};_0x310254(++_0x5ddd60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
index 7281968..a23b5d9 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(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x7a54,0x106));var _0x47a5=function(_0x65d5af,_0x525c0a){_0x65d5af=_0x65d5af-0x0;var _0x117bd1=_0x7a54[_0x65d5af];return _0x117bd1;};'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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x2ad945,_0xa1b5ad){_0x2ad945=_0x2ad945-0x0;var _0x578e33=_0x7a54[_0x2ad945];return _0x578e33;};'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 cf84737..3b07a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb59=['ChatOfflineMessage','setMaxListeners','save','update','remove','hook','exports','../../mysqldb'];(function(_0x5ef90b,_0x4c8ba1){var _0x2d360c=function(_0x2dab85){while(--_0x2dab85){_0x5ef90b['push'](_0x5ef90b['shift']());}};_0x2d360c(++_0x4c8ba1);}(_0xbb59,0x167));var _0x9bb5=function(_0x27bac5,_0x1e5f74){_0x27bac5=_0x27bac5-0x0;var _0x5901d2=_0xbb59[_0x27bac5];return _0x5901d2;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9bb5('0x0'))['db'][_0x9bb5('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9bb5('0x2')](0x0);var events={'afterCreate':_0x9bb5('0x3'),'afterUpdate':_0x9bb5('0x4'),'afterDestroy':_0x9bb5('0x5')};function emitEvent(_0x1f288d){return function(_0x304809,_0x35a697,_0x311401){ChatOfflineMessageEvents['emit'](_0x1f288d+':'+_0x304809['id'],_0x304809);ChatOfflineMessageEvents['emit'](_0x1f288d,_0x304809);_0x311401(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9bb5('0x6')](e,emitEvent(event));}}module[_0x9bb5('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7166=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','save','update','remove'];(function(_0x13c304,_0x4791de){var _0x12696e=function(_0x2070d4){while(--_0x2070d4){_0x13c304['push'](_0x13c304['shift']());}};_0x12696e(++_0x4791de);}(_0x7166,0x90));var _0x6716=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x7166[_0x1b3a5c];return _0x2ae8cb;};'use strict';var EventEmitter=require(_0x6716('0x0'));var ChatOfflineMessage=require(_0x6716('0x1'))['db'][_0x6716('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6716('0x3'),'afterUpdate':_0x6716('0x4'),'afterDestroy':_0x6716('0x5')};function emitEvent(_0x55f69d){return function(_0x4bfa7f,_0x3b711d,_0x26d51b){ChatOfflineMessageEvents[_0x6716('0x6')](_0x55f69d+':'+_0x4bfa7f['id'],_0x4bfa7f);ChatOfflineMessageEvents[_0x6716('0x6')](_0x55f69d,_0x4bfa7f);_0x26d51b(null);};}for(var e in events){if(events[_0x6716('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x6716('0x8')](e,emitEvent(event));}}module[_0x6716('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
index e367334..3181ea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20fc=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x20fc,0x1ac));var _0xc20f=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0x20fc[_0xb83ec2];return _0x4d2fbf;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xc20f('0x0')]=function(_0x352d34){return _0x352d34[_0xc20f('0x1')](_0xc20f('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc20f('0x3'),'collate':_0xc20f('0x4')});};
\ No newline at end of file
+var _0x4f34=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x4f34,0xac));var _0x44f3=function(_0x1f5067,_0x2e995a){_0x1f5067=_0x1f5067-0x0;var _0x4c21d4=_0x4f34[_0x1f5067];return _0x4c21d4;};'use strict';var attributes=require(_0x44f3('0x0'));module[_0x44f3('0x1')]=function(_0x423849){return _0x423849[_0x44f3('0x2')](_0x44f3('0x3'),attributes,{'tableName':_0x44f3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44f3('0x5'),'collate':_0x44f3('0x6')});};
\ No newline at end of file
index 06d8271..f2928e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25f0=['rpc','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','ioredis','../../config/utils'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x25f0,0x10c));var _0x025f=function(_0x2028be,_0x1e933b){_0x2028be=_0x2028be-0x0;var _0x5146be=_0x25f0[_0x2028be];return _0x5146be;};'use strict';var _=require(_0x025f('0x0'));var util=require(_0x025f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x025f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x025f('0x3'));var logger=require('../../config/logger')(_0x025f('0x4'));var config=require('../../config/environment');var jayson=require(_0x025f('0x5'));var client=jayson['client'][_0x025f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x49e6d7,_0x558af4,_0x3a4f9e){return new BPromise(function(_0x37e351,_0xf47c52){return client[_0x025f('0x7')](_0x49e6d7,_0x3a4f9e)['then'](function(_0x381185){logger[_0x025f('0x8')](_0x025f('0x9'),_0x558af4,'request\x20sent');logger['debug'](_0x025f('0xa'),_0x558af4,'request\x20sent',JSON['stringify'](_0x381185));if(_0x381185[_0x025f('0xb')]){if(_0x381185[_0x025f('0xb')][_0x025f('0xc')]===0x1f4){logger[_0x025f('0xb')](_0x025f('0x9'),_0x558af4,_0x381185[_0x025f('0xb')][_0x025f('0xd')]);return _0xf47c52(_0x381185[_0x025f('0xb')][_0x025f('0xd')]);}logger[_0x025f('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x558af4,_0x381185[_0x025f('0xb')][_0x025f('0xd')]);return _0x37e351(_0x381185['error']['message']);}else{logger['info'](_0x025f('0x9'),_0x558af4,'request\x20sent');_0x37e351(_0x381185[_0x025f('0xe')]['message']);}})[_0x025f('0xf')](function(_0x4c8482){logger[_0x025f('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x558af4,_0x4c8482);_0xf47c52(_0x4c8482);});});}
\ No newline at end of file
+var _0xf776=['error','code','ChatOfflineMessage,\x20%s,\x20%s','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17c63b,_0x5f2190){var _0x412594=function(_0x31a240){while(--_0x31a240){_0x17c63b['push'](_0x17c63b['shift']());}};_0x412594(++_0x5f2190);}(_0xf776,0x169));var _0x6f77=function(_0x3fb1ec,_0x32d8cb){_0x3fb1ec=_0x3fb1ec-0x0;var _0x50535b=_0xf776[_0x3fb1ec];return _0x50535b;};'use strict';var _=require(_0x6f77('0x0'));var util=require('util');var moment=require(_0x6f77('0x1'));var BPromise=require(_0x6f77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f77('0x3'));var db=require(_0x6f77('0x4'))['db'];var utils=require(_0x6f77('0x5'));var logger=require(_0x6f77('0x6'))('rpc');var config=require(_0x6f77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f77('0x8')][_0x6f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36ffd2,_0x18a937,_0x545ba9){return new BPromise(function(_0x1dd52f,_0x5a83ba){return client[_0x6f77('0xa')](_0x36ffd2,_0x545ba9)[_0x6f77('0xb')](function(_0x14ea05){logger[_0x6f77('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x18a937,_0x6f77('0xd'));logger[_0x6f77('0xe')](_0x6f77('0xf'),_0x18a937,_0x6f77('0xd'),JSON[_0x6f77('0x10')](_0x14ea05));if(_0x14ea05[_0x6f77('0x11')]){if(_0x14ea05['error'][_0x6f77('0x12')]===0x1f4){logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x5a83ba(_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);}logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x1dd52f(_0x14ea05[_0x6f77('0x11')]['message']);}else{logger['info'](_0x6f77('0x13'),_0x18a937,_0x6f77('0xd'));_0x1dd52f(_0x14ea05['result'][_0x6f77('0x14')]);}})['catch'](function(_0xf36aa2){logger[_0x6f77('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x18a937,_0xf36aa2);_0x5a83ba(_0xf36aa2);});});}
\ No newline at end of file
index 9a8dc20..306dafd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dd9=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2e9bc3,_0x111efd){var _0x376487=function(_0x35888a){while(--_0x35888a){_0x2e9bc3['push'](_0x2e9bc3['shift']());}};_0x376487(++_0x111efd);}(_0x3dd9,0x150));var _0x93dd=function(_0x255f00,_0x112970){_0x255f00=_0x255f00-0x0;var _0x11c5cb=_0x3dd9[_0x255f00];return _0x11c5cb;};'use strict';var multer=require(_0x93dd('0x0'));var util=require('util');var path=require(_0x93dd('0x1'));var timeout=require(_0x93dd('0x2'));var express=require(_0x93dd('0x3'));var router=express[_0x93dd('0x4')]();var fs_extra=require(_0x93dd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x93dd('0x6'));var config=require(_0x93dd('0x7'));var controller=require(_0x93dd('0x8'));router[_0x93dd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x93dd('0xa'),auth['isAuthenticated'](),controller[_0x93dd('0xb')]);router[_0x93dd('0x9')](_0x93dd('0xc'),auth[_0x93dd('0xd')](),controller[_0x93dd('0xe')]);router[_0x93dd('0xf')]('/',auth[_0x93dd('0xd')](),controller['create']);router['put'](_0x93dd('0xc'),auth[_0x93dd('0xd')](),controller[_0x93dd('0x10')]);router[_0x93dd('0x11')]('/:id',auth[_0x93dd('0xd')](),controller['destroy']);module[_0x93dd('0x12')]=router;
\ No newline at end of file
+var _0x3d15=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d15,0x12a));var _0x53d1=function(_0x541f17,_0x8adfd1){_0x541f17=_0x541f17-0x0;var _0x4765f6=_0x3d15[_0x541f17];return _0x4765f6;};'use strict';var multer=require(_0x53d1('0x0'));var util=require(_0x53d1('0x1'));var path=require(_0x53d1('0x2'));var timeout=require(_0x53d1('0x3'));var express=require(_0x53d1('0x4'));var router=express['Router']();var fs_extra=require(_0x53d1('0x5'));var auth=require(_0x53d1('0x6'));var interaction=require(_0x53d1('0x7'));var config=require(_0x53d1('0x8'));var controller=require(_0x53d1('0x9'));router[_0x53d1('0xa')]('/',auth[_0x53d1('0xb')](),controller[_0x53d1('0xc')]);router[_0x53d1('0xa')]('/describe',auth[_0x53d1('0xb')](),controller[_0x53d1('0xd')]);router[_0x53d1('0xa')](_0x53d1('0xe'),auth[_0x53d1('0xb')](),controller['show']);router[_0x53d1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x53d1('0x10')](_0x53d1('0xe'),auth[_0x53d1('0xb')](),controller[_0x53d1('0x11')]);router[_0x53d1('0x12')](_0x53d1('0xe'),auth['isAuthenticated'](),controller[_0x53d1('0x13')]);module[_0x53d1('0x14')]=router;
\ No newline at end of file
index d11cfd1..32ae750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7701=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0x7701,0x13a));var _0x1770=function(_0x582f4b,_0xb757d8){_0x582f4b=_0x582f4b-0x0;var _0x5385be=_0x7701[_0x582f4b];return _0x5385be;};'use strict';var Sequelize=require(_0x1770('0x0'));module[_0x1770('0x1')]={'name':{'type':Sequelize[_0x1770('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1770('0x3')](_0x1770('0x4'),_0x1770('0x5')),'defaultValue':_0x1770('0x4')},'selector':{'type':Sequelize[_0x1770('0x2')]},'timeout':{'type':Sequelize[_0x1770('0x6')]}};
\ No newline at end of file
+var _0xdcbd=['mouseOver','timeout','INTEGER','STRING'];(function(_0x3712e2,_0x32d752){var _0x1faff4=function(_0x550dc0){while(--_0x550dc0){_0x3712e2['push'](_0x3712e2['shift']());}};_0x1faff4(++_0x32d752);}(_0xdcbd,0x107));var _0xddcb=function(_0x5e3769,_0x1befbe){_0x5e3769=_0x5e3769-0x0;var _0x566ca6=_0xdcbd[_0x5e3769];return _0x566ca6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xddcb('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xddcb('0x1'),_0xddcb('0x2')),'defaultValue':_0xddcb('0x1')},'selector':{'type':Sequelize[_0xddcb('0x0')]},'timeout':{'type':Sequelize[_0xddcb('0x3')]}};
\ No newline at end of file
index 915a775..fa0d389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe02=['desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x199177,_0x5b74e3){var _0x24c008=function(_0x5f316f){while(--_0x5f316f){_0x199177['push'](_0x199177['shift']());}};_0x24c008(++_0x5b74e3);}(_0xbe02,0x124));var _0x2be0=function(_0x59913e,_0x41a6c0){_0x59913e=_0x59913e-0x0;var _0x46098f=_0xbe02[_0x59913e];return _0x46098f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2be0('0x0'));var zipdir=require(_0x2be0('0x1'));var jsonpatch=require(_0x2be0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2be0('0x3'));var Mustache=require(_0x2be0('0x4'));var util=require('util');var path=require(_0x2be0('0x5'));var sox=require(_0x2be0('0x6'));var csv=require(_0x2be0('0x7'));var ejs=require(_0x2be0('0x8'));var fs=require('fs');var fs_extra=require(_0x2be0('0x9'));var _=require(_0x2be0('0xa'));var squel=require(_0x2be0('0xb'));var crypto=require('crypto');var jsforce=require(_0x2be0('0xc'));var deskjs=require(_0x2be0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2be0('0xe'));var Redis=require('ioredis');var authService=require(_0x2be0('0xf'));var qs=require(_0x2be0('0x10'));var as=require(_0x2be0('0x11'));var hardwareService=require(_0x2be0('0x12'));var logger=require(_0x2be0('0x13'))('api');var utils=require(_0x2be0('0x14'));var config=require(_0x2be0('0x15'));var licenseUtil=require(_0x2be0('0x16'));var db=require(_0x2be0('0x17'))['db'];function respondWithStatusCode(_0x550513,_0x57593f){_0x57593f=_0x57593f||0xcc;return function(_0x21c60b){if(_0x21c60b){return _0x550513[_0x2be0('0x18')](_0x57593f);}return _0x550513[_0x2be0('0x19')](_0x57593f)[_0x2be0('0x1a')]();};}function respondWithResult(_0x4ff137,_0x44d709){_0x44d709=_0x44d709||0xc8;return function(_0x44fb9f){if(_0x44fb9f){return _0x4ff137[_0x2be0('0x19')](_0x44d709)[_0x2be0('0x1b')](_0x44fb9f);}};}function respondWithFilteredResult(_0x818f20,_0x5c0807){return function(_0x4413e9){if(_0x4413e9){var _0x551203=typeof _0x5c0807[_0x2be0('0x1c')]===_0x2be0('0x1d')&&typeof _0x5c0807[_0x2be0('0x1e')]===_0x2be0('0x1d');var _0x3c247e=_0x4413e9['count'];var _0x22f37f=_0x551203?0x0:_0x5c0807['offset'];var _0x473c97=_0x551203?_0x4413e9[_0x2be0('0x1f')]:_0x5c0807[_0x2be0('0x1c')]+_0x5c0807[_0x2be0('0x1e')];var _0xc3b92a;if(_0x473c97>=_0x3c247e){_0x473c97=_0x3c247e;_0xc3b92a=0xc8;}else{_0xc3b92a=0xce;}_0x818f20[_0x2be0('0x19')](_0xc3b92a);return _0x818f20[_0x2be0('0x20')](_0x2be0('0x21'),_0x22f37f+'-'+_0x473c97+'/'+_0x3c247e)[_0x2be0('0x1b')](_0x4413e9);}return null;};}function patchUpdates(_0x4e530e){return function(_0x2ef0d4){try{jsonpatch[_0x2be0('0x22')](_0x2ef0d4,_0x4e530e,!![]);}catch(_0x2cba28){return BPromise[_0x2be0('0x23')](_0x2cba28);}return _0x2ef0d4['save']();};}function saveUpdates(_0x62f474,_0x114611){return function(_0x55ea94){if(_0x55ea94){return _0x55ea94['update'](_0x62f474)[_0x2be0('0x24')](function(_0x54b981){return _0x54b981;});}return null;};}function removeEntity(_0x20eb86,_0x4beef5){return function(_0x23f224){if(_0x23f224){return _0x23f224['destroy']()[_0x2be0('0x24')](function(){_0x20eb86[_0x2be0('0x19')](0xcc)[_0x2be0('0x1a')]();});}};}function handleEntityNotFound(_0x29bc1d,_0x3813c7){return function(_0x3f519f){if(!_0x3f519f){_0x29bc1d['sendStatus'](0x194);}return _0x3f519f;};}function handleError(_0x23ae3f,_0x378ce4){_0x378ce4=_0x378ce4||0x1f4;return function(_0x416e84){logger[_0x2be0('0x25')](_0x416e84[_0x2be0('0x26')]);if(_0x416e84[_0x2be0('0x27')]){delete _0x416e84[_0x2be0('0x27')];}_0x23ae3f[_0x2be0('0x19')](_0x378ce4)[_0x2be0('0x28')](_0x416e84);};}exports[_0x2be0('0x29')]=function(_0x131dfb,_0x412c71){var _0x1a9ca3={'raw':!![],'where':{'id':_0x131dfb[_0x2be0('0x2a')]['id']}},_0x295771={};_0x295771[_0x2be0('0x2b')]=_[_0x2be0('0x2c')](db[_0x2be0('0x2d')][_0x2be0('0x2e')]);_0x295771['query']=_['keys'](_0x131dfb[_0x2be0('0x2f')]);_0x295771[_0x2be0('0x30')]=_[_0x2be0('0x31')](_0x295771['model'],_0x295771['query']);_0x1a9ca3[_0x2be0('0x32')]=_['intersection'](_0x295771[_0x2be0('0x2b')],qs[_0x2be0('0x33')](_0x131dfb[_0x2be0('0x2f')][_0x2be0('0x33')]));_0x1a9ca3[_0x2be0('0x32')]=_0x1a9ca3[_0x2be0('0x32')][_0x2be0('0x34')]?_0x1a9ca3[_0x2be0('0x32')]:_0x295771['model'];if(_0x131dfb[_0x2be0('0x2f')]['includeAll']){_0x1a9ca3[_0x2be0('0x35')]=[{'all':!![]}];}_0x1a9ca3=_[_0x2be0('0x36')]({},_0x1a9ca3,_0x131dfb[_0x2be0('0x37')]);return db[_0x2be0('0x2d')][_0x2be0('0x38')](_0x1a9ca3)[_0x2be0('0x24')](handleEntityNotFound(_0x412c71,null))[_0x2be0('0x24')](respondWithResult(_0x412c71,null))[_0x2be0('0x39')](handleError(_0x412c71,null));};exports['create']=function(_0x533598,_0x2f6c22){return db['ChatProactiveAction'][_0x2be0('0x3a')](_0x533598[_0x2be0('0x3b')],{})['then'](respondWithResult(_0x2f6c22,0xc9))['catch'](handleError(_0x2f6c22,null));};exports[_0x2be0('0x3c')]=function(_0x111dc0,_0x4096b8){if(_0x111dc0[_0x2be0('0x3b')]['id']){delete _0x111dc0[_0x2be0('0x3b')]['id'];}return db[_0x2be0('0x2d')][_0x2be0('0x38')]({'where':{'id':_0x111dc0[_0x2be0('0x2a')]['id']}})[_0x2be0('0x24')](handleEntityNotFound(_0x4096b8,null))[_0x2be0('0x24')](saveUpdates(_0x111dc0['body'],null))[_0x2be0('0x24')](respondWithResult(_0x4096b8,null))['catch'](handleError(_0x4096b8,null));};exports['destroy']=function(_0x2759ce,_0x4278f6){return db[_0x2be0('0x2d')]['find']({'where':{'id':_0x2759ce[_0x2be0('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4278f6,null))[_0x2be0('0x24')](removeEntity(_0x4278f6,null))[_0x2be0('0x39')](handleError(_0x4278f6,null));};
\ No newline at end of file
+var _0x28e3=['reject','save','update','then','destroy','error','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x28e3,0x106));var _0x328e=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x28e3[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x328e('0x0'));var rimraf=require(_0x328e('0x1'));var zipdir=require(_0x328e('0x2'));var jsonpatch=require(_0x328e('0x3'));var rp=require('request-promise');var moment=require(_0x328e('0x4'));var BPromise=require(_0x328e('0x5'));var Mustache=require(_0x328e('0x6'));var util=require(_0x328e('0x7'));var path=require(_0x328e('0x8'));var sox=require(_0x328e('0x9'));var csv=require(_0x328e('0xa'));var ejs=require(_0x328e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x328e('0xc'));var jsforce=require(_0x328e('0xd'));var deskjs=require(_0x328e('0xe'));var toCsv=require(_0x328e('0xa'));var querystring=require(_0x328e('0xf'));var Papa=require('papaparse');var Redis=require(_0x328e('0x10'));var authService=require(_0x328e('0x11'));var qs=require(_0x328e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x328e('0x13'));var utils=require(_0x328e('0x14'));var config=require(_0x328e('0x15'));var licenseUtil=require(_0x328e('0x16'));var db=require(_0x328e('0x17'))['db'];function respondWithStatusCode(_0x45cda0,_0x4699ec){_0x4699ec=_0x4699ec||0xcc;return function(_0x39338e){if(_0x39338e){return _0x45cda0[_0x328e('0x18')](_0x4699ec);}return _0x45cda0[_0x328e('0x19')](_0x4699ec)[_0x328e('0x1a')]();};}function respondWithResult(_0x4abd75,_0x89600b){_0x89600b=_0x89600b||0xc8;return function(_0x1cddc3){if(_0x1cddc3){return _0x4abd75[_0x328e('0x19')](_0x89600b)[_0x328e('0x1b')](_0x1cddc3);}};}function respondWithFilteredResult(_0x29f8bf,_0x397b16){return function(_0x2a8096){if(_0x2a8096){var _0x3c5b37=typeof _0x397b16[_0x328e('0x1c')]==='undefined'&&typeof _0x397b16[_0x328e('0x1d')]===_0x328e('0x1e');var _0x116f46=_0x2a8096[_0x328e('0x1f')];var _0xf69c0f=_0x3c5b37?0x0:_0x397b16[_0x328e('0x1c')];var _0x41a6bb=_0x3c5b37?_0x2a8096['count']:_0x397b16[_0x328e('0x1c')]+_0x397b16[_0x328e('0x1d')];var _0x448f5a;if(_0x41a6bb>=_0x116f46){_0x41a6bb=_0x116f46;_0x448f5a=0xc8;}else{_0x448f5a=0xce;}_0x29f8bf[_0x328e('0x19')](_0x448f5a);return _0x29f8bf[_0x328e('0x20')]('Content-Range',_0xf69c0f+'-'+_0x41a6bb+'/'+_0x116f46)[_0x328e('0x1b')](_0x2a8096);}return null;};}function patchUpdates(_0x1c5551){return function(_0x3d876b){try{jsonpatch['apply'](_0x3d876b,_0x1c5551,!![]);}catch(_0x35da3b){return BPromise[_0x328e('0x21')](_0x35da3b);}return _0x3d876b[_0x328e('0x22')]();};}function saveUpdates(_0x273b45,_0x233bd3){return function(_0x1c43f8){if(_0x1c43f8){return _0x1c43f8[_0x328e('0x23')](_0x273b45)[_0x328e('0x24')](function(_0x3878d7){return _0x3878d7;});}return null;};}function removeEntity(_0x5cbc7f,_0x4e1d4c){return function(_0x139ef3){if(_0x139ef3){return _0x139ef3[_0x328e('0x25')]()[_0x328e('0x24')](function(){_0x5cbc7f[_0x328e('0x19')](0xcc)[_0x328e('0x1a')]();});}};}function handleEntityNotFound(_0x4a62a8,_0x23fda2){return function(_0x48a854){if(!_0x48a854){_0x4a62a8[_0x328e('0x18')](0x194);}return _0x48a854;};}function handleError(_0x476b6a,_0x28da22){_0x28da22=_0x28da22||0x1f4;return function(_0x2fab5a){logger[_0x328e('0x26')](_0x2fab5a['stack']);if(_0x2fab5a['name']){delete _0x2fab5a[_0x328e('0x27')];}_0x476b6a['status'](_0x28da22)['send'](_0x2fab5a);};}exports[_0x328e('0x28')]=function(_0x270d58,_0x5873d1){var _0x232ec7={'raw':!![],'where':{'id':_0x270d58['params']['id']}},_0x1fdc4d={};_0x1fdc4d[_0x328e('0x29')]=_[_0x328e('0x2a')](db[_0x328e('0x2b')][_0x328e('0x2c')]);_0x1fdc4d[_0x328e('0x2d')]=_['keys'](_0x270d58[_0x328e('0x2d')]);_0x1fdc4d[_0x328e('0x2e')]=_[_0x328e('0x2f')](_0x1fdc4d[_0x328e('0x29')],_0x1fdc4d[_0x328e('0x2d')]);_0x232ec7[_0x328e('0x30')]=_[_0x328e('0x2f')](_0x1fdc4d[_0x328e('0x29')],qs[_0x328e('0x31')](_0x270d58['query']['fields']));_0x232ec7[_0x328e('0x30')]=_0x232ec7[_0x328e('0x30')]['length']?_0x232ec7['attributes']:_0x1fdc4d['model'];if(_0x270d58[_0x328e('0x2d')][_0x328e('0x32')]){_0x232ec7[_0x328e('0x33')]=[{'all':!![]}];}_0x232ec7=_[_0x328e('0x34')]({},_0x232ec7,_0x270d58[_0x328e('0x35')]);return db[_0x328e('0x2b')][_0x328e('0x36')](_0x232ec7)['then'](handleEntityNotFound(_0x5873d1,null))[_0x328e('0x24')](respondWithResult(_0x5873d1,null))['catch'](handleError(_0x5873d1,null));};exports['create']=function(_0x25f1ba,_0x479bda){return db[_0x328e('0x2b')][_0x328e('0x37')](_0x25f1ba[_0x328e('0x38')],{})['then'](respondWithResult(_0x479bda,0xc9))[_0x328e('0x39')](handleError(_0x479bda,null));};exports['update']=function(_0x2ba70c,_0x38ebdc){if(_0x2ba70c[_0x328e('0x38')]['id']){delete _0x2ba70c[_0x328e('0x38')]['id'];}return db['ChatProactiveAction'][_0x328e('0x36')]({'where':{'id':_0x2ba70c['params']['id']}})[_0x328e('0x24')](handleEntityNotFound(_0x38ebdc,null))['then'](saveUpdates(_0x2ba70c['body'],null))[_0x328e('0x24')](respondWithResult(_0x38ebdc,null))['catch'](handleError(_0x38ebdc,null));};exports[_0x328e('0x25')]=function(_0x3c8a91,_0x1892e0){return db[_0x328e('0x2b')]['find']({'where':{'id':_0x3c8a91[_0x328e('0x3a')]['id']}})[_0x328e('0x24')](handleEntityNotFound(_0x1892e0,null))[_0x328e('0x24')](removeEntity(_0x1892e0,null))[_0x328e('0x39')](handleError(_0x1892e0,null));};
\ No newline at end of file
index 5111af0..6632261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1ce=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1acc57,_0x4db7df){var _0x4a2e45=function(_0x5960c5){while(--_0x5960c5){_0x1acc57['push'](_0x1acc57['shift']());}};_0x4a2e45(++_0x4db7df);}(_0xe1ce,0x1ac));var _0xee1c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe1ce[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var logger=require(_0xee1c('0x2'))(_0xee1c('0x3'));var moment=require(_0xee1c('0x4'));var BPromise=require('bluebird');var rp=require(_0xee1c('0x5'));var fs=require('fs');var path=require(_0xee1c('0x6'));var rimraf=require(_0xee1c('0x7'));var config=require(_0xee1c('0x8'));var attributes=require(_0xee1c('0x9'));module[_0xee1c('0xa')]=function(_0x265bd2,_0x1df3e6){return _0x265bd2[_0xee1c('0xb')](_0xee1c('0xc'),attributes,{'tableName':_0xee1c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdffc=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3371d7,_0xc5a179){var _0x53c402=function(_0x2f1001){while(--_0x2f1001){_0x3371d7['push'](_0x3371d7['shift']());}};_0x53c402(++_0xc5a179);}(_0xdffc,0x122));var _0xcdff=function(_0x8844fe,_0x52f601){_0x8844fe=_0x8844fe-0x0;var _0x281198=_0xdffc[_0x8844fe];return _0x281198;};'use strict';var _=require(_0xcdff('0x0'));var util=require(_0xcdff('0x1'));var logger=require(_0xcdff('0x2'))(_0xcdff('0x3'));var moment=require(_0xcdff('0x4'));var BPromise=require(_0xcdff('0x5'));var rp=require(_0xcdff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdff('0x7'));module['exports']=function(_0x467f42,_0x2f23af){return _0x467f42[_0xcdff('0x8')](_0xcdff('0x9'),attributes,{'tableName':_0xcdff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 78c24bf..9f4cba7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca4b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment'];(function(_0x1f9a1a,_0x394c8f){var _0x5bccae=function(_0x3a795c){while(--_0x3a795c){_0x1f9a1a['push'](_0x1f9a1a['shift']());}};_0x5bccae(++_0x394c8f);}(_0xca4b,0xfb));var _0xbca4=function(_0x1996df,_0x1f38c1){_0x1996df=_0x1996df-0x0;var _0x5c6497=_0xca4b[_0x1996df];return _0x5c6497;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbca4('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbca4('0x1'))['db'];var utils=require(_0xbca4('0x2'));var logger=require(_0xbca4('0x3'))(_0xbca4('0x4'));var config=require(_0xbca4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xbca4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa38a99,_0x2e3c5f,_0x12b69d){return new BPromise(function(_0x47151b,_0x3f4f00){return client[_0xbca4('0x7')](_0xa38a99,_0x12b69d)[_0xbca4('0x8')](function(_0x430b9f){logger[_0xbca4('0x9')](_0xbca4('0xa'),_0x2e3c5f,_0xbca4('0xb'));logger[_0xbca4('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2e3c5f,_0xbca4('0xb'),JSON[_0xbca4('0xd')](_0x430b9f));if(_0x430b9f[_0xbca4('0xe')]){if(_0x430b9f['error'][_0xbca4('0xf')]===0x1f4){logger['error'](_0xbca4('0xa'),_0x2e3c5f,_0x430b9f[_0xbca4('0xe')]['message']);return _0x3f4f00(_0x430b9f[_0xbca4('0xe')][_0xbca4('0x10')]);}logger[_0xbca4('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x2e3c5f,_0x430b9f[_0xbca4('0xe')][_0xbca4('0x10')]);return _0x47151b(_0x430b9f[_0xbca4('0xe')][_0xbca4('0x10')]);}else{logger[_0xbca4('0x9')](_0xbca4('0xa'),_0x2e3c5f,'request\x20sent');_0x47151b(_0x430b9f['result'][_0xbca4('0x10')]);}})[_0xbca4('0x11')](function(_0x3424ab){logger[_0xbca4('0xe')](_0xbca4('0xa'),_0x2e3c5f,_0x3424ab);_0x3f4f00(_0x3424ab);});});}
\ No newline at end of file
+var _0x8d70=['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','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x18f772,_0x555096){var _0xb0402e=function(_0x34d203){while(--_0x34d203){_0x18f772['push'](_0x18f772['shift']());}};_0xb0402e(++_0x555096);}(_0x8d70,0x168));var _0x08d7=function(_0x2fe931,_0x5c3ba9){_0x2fe931=_0x2fe931-0x0;var _0x476f82=_0x8d70[_0x2fe931];return _0x476f82;};'use strict';var _=require(_0x08d7('0x0'));var util=require('util');var moment=require(_0x08d7('0x1'));var BPromise=require(_0x08d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08d7('0x3'))['db'];var utils=require(_0x08d7('0x4'));var logger=require('../../config/logger')(_0x08d7('0x5'));var config=require(_0x08d7('0x6'));var jayson=require(_0x08d7('0x7'));var client=jayson[_0x08d7('0x8')][_0x08d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bac6c,_0x222c65,_0x2a685f){return new BPromise(function(_0x1f41e7,_0x22d06d){return client[_0x08d7('0xa')](_0x3bac6c,_0x2a685f)[_0x08d7('0xb')](function(_0x2767a4){logger[_0x08d7('0xc')](_0x08d7('0xd'),_0x222c65,_0x08d7('0xe'));logger[_0x08d7('0xf')](_0x08d7('0x10'),_0x222c65,_0x08d7('0xe'),JSON[_0x08d7('0x11')](_0x2767a4));if(_0x2767a4[_0x08d7('0x12')]){if(_0x2767a4['error'][_0x08d7('0x13')]===0x1f4){logger[_0x08d7('0x12')](_0x08d7('0xd'),_0x222c65,_0x2767a4['error'][_0x08d7('0x14')]);return _0x22d06d(_0x2767a4[_0x08d7('0x12')][_0x08d7('0x14')]);}logger[_0x08d7('0x12')](_0x08d7('0xd'),_0x222c65,_0x2767a4[_0x08d7('0x12')][_0x08d7('0x14')]);return _0x1f41e7(_0x2767a4[_0x08d7('0x12')][_0x08d7('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x222c65,_0x08d7('0xe'));_0x1f41e7(_0x2767a4[_0x08d7('0x15')][_0x08d7('0x14')]);}})[_0x08d7('0x16')](function(_0x54eb1b){logger[_0x08d7('0x12')](_0x08d7('0xd'),_0x222c65,_0x54eb1b);_0x22d06d(_0x54eb1b);});});}
\ No newline at end of file
index 3a68f56..86f0394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('0x11')]=router;
\ No newline at end of file
+var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb138,0x1dd));var _0x8b13=function(_0x306064,_0x88fccb){_0x306064=_0x306064-0x0;var _0x17d9a2=_0xb138[_0x306064];return _0x17d9a2;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
index 50a35ff..723c094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x375f=['name','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x32da16,_0x5a6af7){var _0x33ce71=function(_0x59a0a8){while(--_0x59a0a8){_0x32da16['push'](_0x32da16['shift']());}};_0x33ce71(++_0x5a6af7);}(_0x375f,0xdd));var _0xf375=function(_0x2847ee,_0x537d52){_0x2847ee=_0x2847ee-0x0;var _0x41b3f3=_0x375f[_0x2847ee];return _0x41b3f3;};'use strict';var Sequelize=require(_0xf375('0x0'));module[_0xf375('0x1')]={'name':{'type':Sequelize[_0xf375('0x2')],'unique':_0xf375('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf375('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf375('0x4')](_0xf375('0x5'),_0xf375('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xa053=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa053,0x10c));var _0x3a05=function(_0x36e1de,_0x4b88c4){_0x36e1de=_0x36e1de-0x0;var _0x2c1d8a=_0xa053[_0x36e1de];return _0x2c1d8a;};'use strict';var Sequelize=require(_0x3a05('0x0'));module[_0x3a05('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a05('0x2')]},'timeout':{'type':Sequelize[_0x3a05('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a05('0x4')](_0x3a05('0x5'),_0x3a05('0x6'),_0x3a05('0x7'))}};
\ No newline at end of file
index 1b18834..82ce5e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7787=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','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/environment','../../config/license/util','../../mysqldb','defaults','redis','./chatQueue.socket','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','send','index','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','ChatQueue','includeAll','include','findAll','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','rows','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format'];(function(_0x257558,_0x16d231){var _0x4c7050=function(_0x196949){while(--_0x196949){_0x257558['push'](_0x257558['shift']());}};_0x4c7050(++_0x16d231);}(_0x7787,0x95));var _0x7778=function(_0x333696,_0x67f6fc){_0x333696=_0x333696-0x0;var _0x509f15=_0x7787[_0x333696];return _0x509f15;};'use strict';var emlformat=require(_0x7778('0x0'));var rimraf=require(_0x7778('0x1'));var zipdir=require(_0x7778('0x2'));var jsonpatch=require(_0x7778('0x3'));var rp=require('request-promise');var moment=require(_0x7778('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7778('0x5'));var util=require(_0x7778('0x6'));var path=require(_0x7778('0x7'));var sox=require(_0x7778('0x8'));var csv=require(_0x7778('0x9'));var ejs=require(_0x7778('0xa'));var fs=require('fs');var fs_extra=require(_0x7778('0xb'));var _=require(_0x7778('0xc'));var squel=require(_0x7778('0xd'));var crypto=require(_0x7778('0xe'));var jsforce=require(_0x7778('0xf'));var deskjs=require(_0x7778('0x10'));var toCsv=require(_0x7778('0x9'));var querystring=require(_0x7778('0x11'));var Papa=require('papaparse');var Redis=require(_0x7778('0x12'));var authService=require(_0x7778('0x13'));var qs=require(_0x7778('0x14'));var as=require(_0x7778('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7778('0x16'))('api');var utils=require(_0x7778('0x17'));var config=require(_0x7778('0x18'));var licenseUtil=require(_0x7778('0x19'));var db=require(_0x7778('0x1a'))['db'];config['redis']=_[_0x7778('0x1b')](config[_0x7778('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7778('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7778('0x1e')][_0x7778('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2258aa,_0x348d7c,_0x594f70,_0x5080a1){return new BPromise(function(_0x4a340d,_0x3f365b){var _0x4dc4ff=_0x5080a1||client;return _0x4dc4ff[_0x7778('0x20')](_0x2258aa,_0x594f70)[_0x7778('0x21')](function(_0x3a2813){logger[_0x7778('0x22')](_0x7778('0x23'),_0x348d7c,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x348d7c,_0x7778('0x24'),JSON[_0x7778('0x25')](_0x3a2813));if(_0x3a2813[_0x7778('0x26')]){if(_0x3a2813[_0x7778('0x26')][_0x7778('0x27')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x348d7c,_0x3a2813[_0x7778('0x26')][_0x7778('0x28')]);return _0x3f365b(_0x3a2813['error'][_0x7778('0x28')]);}logger[_0x7778('0x26')](_0x7778('0x23'),_0x348d7c,_0x3a2813[_0x7778('0x26')][_0x7778('0x28')]);return _0x4a340d(_0x3a2813[_0x7778('0x26')][_0x7778('0x28')]);}else{logger['info'](_0x7778('0x23'),_0x348d7c,'request\x20sent');_0x4a340d(_0x3a2813['result'][_0x7778('0x28')]);}})['catch'](function(_0x111b60){logger[_0x7778('0x26')](_0x7778('0x23'),_0x348d7c,_0x111b60);_0x3f365b(_0x111b60);});});}function respondWithStatusCode(_0x5cad11,_0x1f8a0c){_0x1f8a0c=_0x1f8a0c||0xcc;return function(_0x4920f8){if(_0x4920f8){return _0x5cad11['sendStatus'](_0x1f8a0c);}return _0x5cad11[_0x7778('0x29')](_0x1f8a0c)[_0x7778('0x2a')]();};}function respondWithResult(_0xeb362f,_0x5ee8c5){_0x5ee8c5=_0x5ee8c5||0xc8;return function(_0x1dccea){if(_0x1dccea){return _0xeb362f[_0x7778('0x29')](_0x5ee8c5)['json'](_0x1dccea);}};}function respondWithFilteredResult(_0x5da325,_0x3c35ae){return function(_0x1514f3){if(_0x1514f3){var _0x55d10c=typeof _0x3c35ae[_0x7778('0x2b')]===_0x7778('0x2c')&&typeof _0x3c35ae[_0x7778('0x2d')]===_0x7778('0x2c');var _0x52fcac=_0x1514f3[_0x7778('0x2e')];var _0x4382f4=_0x55d10c?0x0:_0x3c35ae[_0x7778('0x2b')];var _0x4b14c5=_0x55d10c?_0x1514f3['count']:_0x3c35ae[_0x7778('0x2b')]+_0x3c35ae[_0x7778('0x2d')];var _0x49fbd7;if(_0x4b14c5>=_0x52fcac){_0x4b14c5=_0x52fcac;_0x49fbd7=0xc8;}else{_0x49fbd7=0xce;}_0x5da325[_0x7778('0x29')](_0x49fbd7);return _0x5da325[_0x7778('0x2f')](_0x7778('0x30'),_0x4382f4+'-'+_0x4b14c5+'/'+_0x52fcac)['json'](_0x1514f3);}return null;};}function patchUpdates(_0x30de37){return function(_0x43d2aa){try{jsonpatch[_0x7778('0x31')](_0x43d2aa,_0x30de37,!![]);}catch(_0x38a183){return BPromise[_0x7778('0x32')](_0x38a183);}return _0x43d2aa[_0x7778('0x33')]();};}function saveUpdates(_0x15a6bf,_0x52a815){return function(_0x9f87ed){if(_0x9f87ed){return _0x9f87ed[_0x7778('0x34')](_0x15a6bf)[_0x7778('0x21')](function(_0x52502a){return _0x52502a;});}return null;};}function removeEntity(_0x4a4131,_0x345be0){return function(_0x1a5629){if(_0x1a5629){return _0x1a5629[_0x7778('0x35')]()['then'](function(){var _0x4dc95b=_0x1a5629[_0x7778('0x36')]({'plain':!![]});var _0x37944d=_0x7778('0x37');return db[_0x7778('0x38')][_0x7778('0x35')]({'where':{'type':_0x37944d,'resourceId':_0x4dc95b['id']}})[_0x7778('0x21')](function(){return _0x1a5629;});})[_0x7778('0x21')](function(){_0x4a4131[_0x7778('0x29')](0xcc)[_0x7778('0x2a')]();});}};}function handleEntityNotFound(_0x16ecc2,_0x321786){return function(_0x1cf67e){if(!_0x1cf67e){_0x16ecc2[_0x7778('0x39')](0x194);}return _0x1cf67e;};}function handleError(_0x536068,_0x4b1f68){_0x4b1f68=_0x4b1f68||0x1f4;return function(_0x45d390){logger[_0x7778('0x26')](_0x45d390['stack']);if(_0x45d390[_0x7778('0x3a')]){delete _0x45d390[_0x7778('0x3a')];}_0x536068[_0x7778('0x29')](_0x4b1f68)[_0x7778('0x3b')](_0x45d390);};}exports[_0x7778('0x3c')]=function(_0x479e38,_0x2908f5){var _0x1e1c42={},_0x177d76={},_0xc77e26={'count':0x0,'rows':[]};var _0xc4bf36=_['map'](db['ChatQueue'][_0x7778('0x3d')],function(_0x373135){return{'name':_0x373135['fieldName'],'type':_0x373135['type'][_0x7778('0x3e')]};});_0x177d76[_0x7778('0x3f')]=_[_0x7778('0x40')](_0xc4bf36,_0x7778('0x3a'));_0x177d76[_0x7778('0x41')]=_[_0x7778('0x42')](_0x479e38[_0x7778('0x41')]);_0x177d76[_0x7778('0x43')]=_['intersection'](_0x177d76[_0x7778('0x3f')],_0x177d76[_0x7778('0x41')]);_0x1e1c42[_0x7778('0x44')]=_[_0x7778('0x45')](_0x177d76['model'],qs[_0x7778('0x46')](_0x479e38[_0x7778('0x41')]['fields']));_0x1e1c42['attributes']=_0x1e1c42[_0x7778('0x44')][_0x7778('0x47')]?_0x1e1c42[_0x7778('0x44')]:_0x177d76['model'];if(!_0x479e38[_0x7778('0x41')][_0x7778('0x48')](_0x7778('0x49'))){_0x1e1c42['limit']=qs[_0x7778('0x2d')](_0x479e38['query'][_0x7778('0x2d')]);_0x1e1c42[_0x7778('0x2b')]=qs[_0x7778('0x2b')](_0x479e38[_0x7778('0x41')]['offset']);}_0x1e1c42[_0x7778('0x4a')]=qs[_0x7778('0x4b')](_0x479e38['query'][_0x7778('0x4b')]);_0x1e1c42[_0x7778('0x4c')]=qs['filters'](_[_0x7778('0x4d')](_0x479e38[_0x7778('0x41')],_0x177d76[_0x7778('0x43')]),_0xc4bf36);if(_0x479e38[_0x7778('0x41')][_0x7778('0x4e')]){_0x1e1c42[_0x7778('0x4c')]=_[_0x7778('0x4f')](_0x1e1c42[_0x7778('0x4c')],{'$or':_[_0x7778('0x40')](_0xc4bf36,function(_0xfdff86){if(_0xfdff86[_0x7778('0x50')]!=='VIRTUAL'){var _0x154741={};_0x154741[_0xfdff86[_0x7778('0x3a')]]={'$like':'%'+_0x479e38[_0x7778('0x41')][_0x7778('0x4e')]+'%'};return _0x154741;}})});}_0x1e1c42=_[_0x7778('0x4f')]({},_0x1e1c42,_0x479e38[_0x7778('0x51')]);var _0x386258={'where':_0x1e1c42['where']};return db[_0x7778('0x52')]['count'](_0x386258)[_0x7778('0x21')](function(_0x4281ef){_0xc77e26['count']=_0x4281ef;if(_0x479e38[_0x7778('0x41')][_0x7778('0x53')]){_0x1e1c42[_0x7778('0x54')]=[{'all':!![]}];}return db['ChatQueue'][_0x7778('0x55')](_0x1e1c42);})[_0x7778('0x21')](function(_0x487d3c){_0xc77e26['rows']=_0x487d3c;return _0xc77e26;})[_0x7778('0x21')](respondWithFilteredResult(_0x2908f5,_0x1e1c42))[_0x7778('0x56')](handleError(_0x2908f5,null));};exports['show']=function(_0x152947,_0x2031a2){var _0x5a7668={'raw':!![],'where':{'id':_0x152947[_0x7778('0x57')]['id']}},_0x1b4d09={};_0x1b4d09[_0x7778('0x3f')]=_[_0x7778('0x42')](db[_0x7778('0x52')]['rawAttributes']);_0x1b4d09['query']=_[_0x7778('0x42')](_0x152947[_0x7778('0x41')]);_0x1b4d09['filters']=_[_0x7778('0x45')](_0x1b4d09[_0x7778('0x3f')],_0x1b4d09[_0x7778('0x41')]);_0x5a7668[_0x7778('0x44')]=_[_0x7778('0x45')](_0x1b4d09[_0x7778('0x3f')],qs[_0x7778('0x46')](_0x152947[_0x7778('0x41')][_0x7778('0x46')]));_0x5a7668[_0x7778('0x44')]=_0x5a7668['attributes'][_0x7778('0x47')]?_0x5a7668['attributes']:_0x1b4d09[_0x7778('0x3f')];if(_0x152947[_0x7778('0x41')]['includeAll']){_0x5a7668[_0x7778('0x54')]=[{'all':!![]}];}_0x5a7668=_[_0x7778('0x4f')]({},_0x5a7668,_0x152947[_0x7778('0x51')]);return db[_0x7778('0x52')][_0x7778('0x58')](_0x5a7668)[_0x7778('0x21')](handleEntityNotFound(_0x2031a2,null))['then'](respondWithResult(_0x2031a2,null))[_0x7778('0x56')](handleError(_0x2031a2,null));};exports['create']=function(_0x928bce,_0x5b501d){return db[_0x7778('0x52')]['create'](_0x928bce[_0x7778('0x59')],{})['then'](function(_0x581e13){var _0x38dc26=_0x928bce[_0x7778('0x5a')]['get']({'plain':!![]});if(!_0x38dc26)throw new Error(_0x7778('0x5b'));if(_0x38dc26[_0x7778('0x5c')]==='user'){var _0xf5af88=_0x581e13[_0x7778('0x36')]({'plain':!![]});var _0x4dbf8c=_0x7778('0x37');return db[_0x7778('0x5d')][_0x7778('0x58')]({'where':{'name':_0x4dbf8c,'userProfileId':_0x38dc26['userProfileId']},'raw':!![]})['then'](function(_0x475913){if(_0x475913&&_0x475913[_0x7778('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0xf5af88['name'],'resourceId':_0xf5af88['id'],'type':_0x475913[_0x7778('0x3a')],'sectionId':_0x475913['id']},{})[_0x7778('0x21')](function(){return _0x581e13;});}else{return _0x581e13;}})[_0x7778('0x56')](function(_0x43da3a){logger['error'](_0x7778('0x5f'),_0x43da3a);throw _0x43da3a;});}return _0x581e13;})['then'](respondWithResult(_0x5b501d,0xc9))[_0x7778('0x56')](handleError(_0x5b501d,null));};exports['update']=function(_0x5002d2,_0x2b4bc3){if(_0x5002d2[_0x7778('0x59')]['id']){delete _0x5002d2[_0x7778('0x59')]['id'];}return db[_0x7778('0x52')][_0x7778('0x58')]({'where':{'id':_0x5002d2[_0x7778('0x57')]['id']}})[_0x7778('0x21')](handleEntityNotFound(_0x2b4bc3,null))[_0x7778('0x21')](saveUpdates(_0x5002d2[_0x7778('0x59')],null))[_0x7778('0x21')](respondWithResult(_0x2b4bc3,null))['catch'](handleError(_0x2b4bc3,null));};exports['destroy']=function(_0x52c1bc,_0x1409f5){return db[_0x7778('0x52')][_0x7778('0x58')]({'where':{'id':_0x52c1bc[_0x7778('0x57')]['id']}})[_0x7778('0x21')](handleEntityNotFound(_0x1409f5,null))[_0x7778('0x21')](removeEntity(_0x1409f5,null))[_0x7778('0x56')](handleError(_0x1409f5,null));};exports[_0x7778('0x60')]=function(_0x50e92d,_0x3f8029){return db[_0x7778('0x52')]['describe']()['then'](respondWithResult(_0x3f8029,null))[_0x7778('0x56')](handleError(_0x3f8029,null));};exports[_0x7778('0x61')]=function(_0x3989a9,_0x578ecf,_0x51e218){var _0x5bcc2c={'raw':!![],'where':{}},_0x155b45={},_0x5470f9;return db[_0x7778('0x52')]['findOne']({'where':{'id':_0x3989a9[_0x7778('0x57')]['id']}})[_0x7778('0x21')](handleEntityNotFound(_0x578ecf,null))[_0x7778('0x21')](function(_0x2c80fc){if(_0x2c80fc){_0x5470f9=_0x2c80fc[_0x7778('0x36')]({'plain':!![]});_0x155b45[_0x7778('0x3f')]=_[_0x7778('0x42')](db['UserChatQueue'][_0x7778('0x3d')]);_0x155b45[_0x7778('0x41')]=_['keys'](_0x3989a9['query']);_0x155b45[_0x7778('0x43')]=_['intersection'](_0x155b45[_0x7778('0x3f')],_0x155b45[_0x7778('0x41')]);_0x5bcc2c[_0x7778('0x44')]=_[_0x7778('0x45')](_0x155b45['model'],qs['fields'](_0x3989a9[_0x7778('0x41')][_0x7778('0x46')]));_0x5bcc2c[_0x7778('0x44')]=_0x5bcc2c[_0x7778('0x44')]['length']?_0x5bcc2c[_0x7778('0x44')]:_0x155b45[_0x7778('0x3f')];if(!_0x3989a9[_0x7778('0x41')][_0x7778('0x48')]('nolimit')){_0x5bcc2c[_0x7778('0x2d')]=qs[_0x7778('0x2d')](_0x3989a9[_0x7778('0x41')][_0x7778('0x2d')]);_0x5bcc2c['offset']=qs[_0x7778('0x2b')](_0x3989a9[_0x7778('0x41')]['offset']);}_0x5bcc2c[_0x7778('0x4a')]=qs[_0x7778('0x4b')](_0x3989a9[_0x7778('0x41')][_0x7778('0x4b')]);_0x5bcc2c[_0x7778('0x4c')]=qs[_0x7778('0x43')](_[_0x7778('0x4d')](_0x3989a9[_0x7778('0x41')],_0x155b45[_0x7778('0x43')]));_0x5bcc2c[_0x7778('0x4c')][_0x7778('0x62')]=_0x2c80fc['id'];if(_0x3989a9[_0x7778('0x41')]['filter']){_0x5bcc2c[_0x7778('0x4c')]=_[_0x7778('0x4f')](_0x5bcc2c[_0x7778('0x4c')],{'$or':_[_0x7778('0x40')](_0x5bcc2c[_0x7778('0x44')],function(_0x1d49e9){var _0x21b78a={};_0x21b78a[_0x1d49e9]={'$like':'%'+_0x3989a9[_0x7778('0x41')]['filter']+'%'};return _0x21b78a;})});}_0x5bcc2c=_[_0x7778('0x4f')]({},_0x5bcc2c,_0x3989a9[_0x7778('0x51')]);return db[_0x7778('0x63')][_0x7778('0x55')](_0x5bcc2c);}})[_0x7778('0x21')](function(_0xbd0501){if(_0xbd0501){return db[_0x7778('0x64')]['findAndCountAll']({'where':{'id':_[_0x7778('0x40')](_0xbd0501,_0x7778('0x65')),'role':_0x7778('0x66')},'attributes':['id',_0x7778('0x3a'),_0x7778('0x67'),_0x7778('0x68'),_0x7778('0x69')]});}})[_0x7778('0x21')](function(_0x42cb18){if(_0x42cb18){return{'count':_0x42cb18[_0x7778('0x2e')],'rows':_[_0x7778('0x40')](_0x42cb18[_0x7778('0x6a')],function(_0xaafb0c){return{'membername':_0xaafb0c['name'],'UserId':_0xaafb0c['id'],'queue_name':_0x5470f9[_0x7778('0x3a')],'ChatQueueId':_0x5470f9['id'],'interface':util['format']('%s/%s',_0x7778('0x6b'),_0xaafb0c[_0x7778('0x3a')]),'penalty':0x0,'paused':_0xaafb0c['chatPause'],'createdAt':_0xaafb0c[_0x7778('0x69')],'updatedAt':_0xaafb0c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7778('0x21')](respondWithFilteredResult(_0x578ecf,_0x5bcc2c))['catch'](handleError(_0x578ecf,null));};exports[_0x7778('0x6c')]=function(_0x47dab6,_0x36d0ba,_0x4b207b){var _0x4d0fee={};var _0x22258c={};var _0x3073e8;var _0x15e786;return db[_0x7778('0x52')][_0x7778('0x6d')]({'where':{'id':_0x47dab6['params']['id']}})['then'](handleEntityNotFound(_0x36d0ba,null))[_0x7778('0x21')](function(_0x502d52){if(_0x502d52){_0x3073e8=_0x502d52;_0x22258c[_0x7778('0x3f')]=_[_0x7778('0x42')](db[_0x7778('0x6e')][_0x7778('0x3d')]);_0x22258c['query']=_['keys'](_0x47dab6['query']);_0x22258c[_0x7778('0x43')]=_[_0x7778('0x45')](_0x22258c[_0x7778('0x3f')],_0x22258c[_0x7778('0x41')]);_0x4d0fee[_0x7778('0x44')]=_[_0x7778('0x45')](_0x22258c[_0x7778('0x3f')],qs[_0x7778('0x46')](_0x47dab6['query'][_0x7778('0x46')]));_0x4d0fee[_0x7778('0x44')]=_0x4d0fee[_0x7778('0x44')][_0x7778('0x47')]?_0x4d0fee['attributes']:_0x22258c[_0x7778('0x3f')];_0x4d0fee[_0x7778('0x4a')]=qs['sort'](_0x47dab6[_0x7778('0x41')]['sort']);_0x4d0fee[_0x7778('0x4c')]=qs[_0x7778('0x43')](_['pick'](_0x47dab6[_0x7778('0x41')],_0x22258c[_0x7778('0x43')]));if(_0x47dab6[_0x7778('0x41')][_0x7778('0x4e')]){_0x4d0fee['where']=_[_0x7778('0x4f')](_0x4d0fee['where'],{'$or':_['map'](_0x4d0fee[_0x7778('0x44')],function(_0x198f6a){var _0x937012={};_0x937012[_0x198f6a]={'$like':'%'+_0x47dab6[_0x7778('0x41')][_0x7778('0x4e')]+'%'};return _0x937012;})});}_0x4d0fee=_[_0x7778('0x4f')]({},_0x4d0fee,_0x47dab6['options']);return _0x3073e8[_0x7778('0x6c')](_0x4d0fee);}})[_0x7778('0x21')](function(_0x425cbf){if(_0x425cbf){_0x15e786=_0x425cbf[_0x7778('0x47')];if(!_0x47dab6[_0x7778('0x41')][_0x7778('0x48')](_0x7778('0x49'))){_0x4d0fee[_0x7778('0x2d')]=qs['limit'](_0x47dab6[_0x7778('0x41')][_0x7778('0x2d')]);_0x4d0fee['offset']=qs['offset'](_0x47dab6['query']['offset']);}return _0x3073e8[_0x7778('0x6c')](_0x4d0fee);}})[_0x7778('0x21')](function(_0x39c856){if(_0x39c856){return _0x39c856?{'count':_0x15e786,'rows':_0x39c856}:null;}})[_0x7778('0x21')](respondWithResult(_0x36d0ba,null))[_0x7778('0x56')](handleError(_0x36d0ba,null));};exports[_0x7778('0x6f')]=function(_0x3f467b,_0x1162c0,_0x13003e){var _0x55c290=_0x3f467b[_0x7778('0x59')][_0x7778('0x70')];return db['Team'][_0x7778('0x55')]({'where':{'id':_0x55c290},'attributes':['id'],'include':[{'model':db[_0x7778('0x64')],'as':_0x7778('0x71'),'attributes':['id','name',_0x7778('0x72'),_0x7778('0x73'),'interface'],'raw':!![]}]})['then'](function(_0x568483){if(_0x568483){var _0x5b38e0=_[_0x7778('0x74')](_0x568483,function(_0x1d462f){var _0x5db580=_0x1d462f[_0x7778('0x36')]({'plain':!![]});return _0x5db580[_0x7778('0x71')];});return db[_0x7778('0x52')][_0x7778('0x58')]({'where':{'id':_0x3f467b[_0x7778('0x57')]['id']}})[_0x7778('0x21')](function(_0x4ee8a2){return db[_0x7778('0x75')][_0x7778('0x76')](function(_0x1910ea){return _0x4ee8a2[_0x7778('0x6f')](_0x55c290,{'transaction':_0x1910ea})[_0x7778('0x21')](function(){return BPromise[_0x7778('0x77')](_0x5b38e0,function(_0x96b5a1){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x96b5a1['id'],'ChatQueueId':_0x3f467b[_0x7778('0x57')]['id']},'transaction':_0x1910ea});});})[_0x7778('0x21')](function(){_0x5b38e0[_0x7778('0x78')](function(_0x40bcf7){socket['emit'](_0x7778('0x79'),{'UserId':_0x40bcf7['id'],'ChatQueueId':_0x4ee8a2['id']});});});});});}})[_0x7778('0x21')](respondWithStatusCode(_0x1162c0,null))['catch'](handleError(_0x1162c0,null));};exports[_0x7778('0x7a')]=function(_0x50b945,_0x579822,_0x2e9a4e){return db[_0x7778('0x6e')][_0x7778('0x55')]({'where':{'id':_0x50b945['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x7778('0x64')],'as':_0x7778('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7778('0x21')](handleEntityNotFound(_0x579822,null))[_0x7778('0x21')](function(_0x5897d5){var _0x3499a8=_[_0x7778('0x40')](_0x5897d5,'id');var _0x2fd407=[];var _0x4427ee=[];var _0x28c819=squel[_0x7778('0x7b')]();_0x28c819[_0x7778('0x7c')](_0x7778('0x7d'))[_0x7778('0x7e')](_0x7778('0x7f'),'tq')['join']('user_has_teams','ut',_0x7778('0x80'))[_0x7778('0x4c')](_0x7778('0x81'),_0x50b945[_0x7778('0x57')]['id']);for(var _0x1a04cb=0x0;_0x1a04cb<_0x5897d5[_0x7778('0x47')];_0x1a04cb+=0x1){let _0x509531=_0x5897d5[_0x1a04cb];for(var _0x49bb61=0x0;_0x49bb61<_0x509531[_0x7778('0x71')][_0x7778('0x47')];_0x49bb61+=0x1){let _0x2566a9=_0x509531[_0x7778('0x71')][_0x49bb61];var _0x839343=_0x28c819[_0x7778('0x82')]();_0x839343[_0x7778('0x4c')](_0x7778('0x83'),_0x2566a9['id']);_0x4427ee['push'](db[_0x7778('0x75')][_0x7778('0x41')](_0x839343[_0x7778('0x84')](),{'type':db[_0x7778('0x75')][_0x7778('0x85')][_0x7778('0x86')]})[_0x7778('0x21')](function(_0x26477a){if(_0x26477a[_0x7778('0x47')]===0x1){return _0x2566a9['id'];}else{var _0x4f3795=_['every'](_[_0x7778('0x40')](_0x26477a,_0x7778('0x87')),function(_0x25bed4){return _[_0x7778('0x88')](_0x3499a8,_0x25bed4);});if(_0x4f3795){return _0x2566a9['id'];}}}));}}return BPromise[_0x7778('0x89')](_0x4427ee)[_0x7778('0x21')](function(_0x43e503){_0x2fd407=_(_0x2fd407)[_0x7778('0x8a')](_0x43e503)[_0x7778('0x8b')]()[_0x7778('0x8c')]();return db[_0x7778('0x52')]['find']({'where':{'id':_0x50b945[_0x7778('0x57')]['id']}})[_0x7778('0x21')](function(_0x55fad1){return db[_0x7778('0x75')][_0x7778('0x76')](function(_0x498c1a){return _0x55fad1['removeTeams'](_0x50b945[_0x7778('0x41')]['ids'],{'transaction':_0x498c1a})[_0x7778('0x21')](function(){if(!_[_0x7778('0x8d')](_0x2fd407)){return _0x55fad1['removeAgents'](_0x2fd407,{'transaction':_0x498c1a});}})['then'](function(){_0x2fd407['forEach'](function(_0x886242){socket[_0x7778('0x8e')](_0x7778('0x8f'),{'UserId':_0x886242,'ChatQueueId':_0x55fad1['id']});});});});});});})[_0x7778('0x21')](respondWithStatusCode(_0x579822,null))[_0x7778('0x56')](handleError(_0x579822,null));};exports[_0x7778('0x90')]=function(_0x298d27,_0x1229dc,_0x568359){return db[_0x7778('0x52')][_0x7778('0x58')]({'where':{'id':_0x298d27[_0x7778('0x57')]['id']}})['then'](handleEntityNotFound(_0x1229dc,null))[_0x7778('0x21')](function(_0x3a7fe4){if(_0x3a7fe4){return _0x3a7fe4[_0x7778('0x90')](_0x298d27[_0x7778('0x59')]['ids'],_[_0x7778('0x91')](_0x298d27['body'],[_0x7778('0x70'),'id'])||{})[_0x7778('0x92')](function(_0x2e7ba3){for(var _0x3d2bd5=0x0;_0x3d2bd5<_0x298d27[_0x7778('0x59')]['ids'][_0x7778('0x47')];_0x3d2bd5+=0x1){socket[_0x7778('0x8e')](_0x7778('0x79'),{'UserId':Number(_0x298d27[_0x7778('0x59')][_0x7778('0x70')][_0x3d2bd5]),'ChatQueueId':Number(_0x298d27[_0x7778('0x57')]['id'])});}return _0x2e7ba3;});}})[_0x7778('0x21')](respondWithResult(_0x1229dc,null))[_0x7778('0x56')](handleError(_0x1229dc,null));};exports['removeAgents']=function(_0x3af3b3,_0x5ed51c,_0x2a3e03){return db['ChatQueue'][_0x7778('0x58')]({'where':{'id':_0x3af3b3[_0x7778('0x57')]['id']}})[_0x7778('0x21')](handleEntityNotFound(_0x5ed51c,null))[_0x7778('0x21')](function(_0x1d1a96){if(_0x1d1a96){return _0x1d1a96[_0x7778('0x93')](_0x3af3b3['query'][_0x7778('0x70')])[_0x7778('0x21')](function(){if(_[_0x7778('0x94')](_0x3af3b3[_0x7778('0x41')]['ids'])){for(var _0x14055d=0x0;_0x14055d<_0x3af3b3[_0x7778('0x41')][_0x7778('0x70')]['length'];_0x14055d+=0x1){socket['emit'](_0x7778('0x8f'),{'UserId':Number(_0x3af3b3['query']['ids'][_0x14055d]),'ChatQueueId':Number(_0x3af3b3[_0x7778('0x57')]['id'])});}}else{socket[_0x7778('0x8e')](_0x7778('0x8f'),{'UserId':Number(_0x3af3b3['query']['ids']),'ChatQueueId':Number(_0x3af3b3[_0x7778('0x57')]['id'])});}});}})[_0x7778('0x21')](respondWithStatusCode(_0x5ed51c,null))[_0x7778('0x56')](handleError(_0x5ed51c,null));};exports[_0x7778('0x95')]=function(_0x1173c4,_0x2cc8ad,_0xa86150){var _0x2d3b6d={};var _0xe241a3={};var _0x415fa4;var _0x18511c;return db['ChatQueue'][_0x7778('0x6d')]({'where':{'id':_0x1173c4[_0x7778('0x57')]['id']}})[_0x7778('0x21')](handleEntityNotFound(_0x2cc8ad,null))['then'](function(_0x3b5ec2){if(_0x3b5ec2){_0x415fa4=_0x3b5ec2;_0xe241a3['model']=_['keys'](db['User'][_0x7778('0x3d')]);_0xe241a3[_0x7778('0x41')]=_[_0x7778('0x42')](_0x1173c4['query']);_0xe241a3['filters']=_[_0x7778('0x45')](_0xe241a3[_0x7778('0x3f')],_0xe241a3['query']);_0x2d3b6d[_0x7778('0x44')]=_[_0x7778('0x45')](_0xe241a3[_0x7778('0x3f')],qs[_0x7778('0x46')](_0x1173c4[_0x7778('0x41')][_0x7778('0x46')]));_0x2d3b6d[_0x7778('0x44')]=_0x2d3b6d[_0x7778('0x44')][_0x7778('0x47')]?_0x2d3b6d['attributes']:_0xe241a3[_0x7778('0x3f')];_0x2d3b6d['order']=qs[_0x7778('0x4b')](_0x1173c4[_0x7778('0x41')][_0x7778('0x4b')]);_0x2d3b6d[_0x7778('0x4c')]=qs[_0x7778('0x43')](_[_0x7778('0x4d')](_0x1173c4[_0x7778('0x41')],_0xe241a3[_0x7778('0x43')]));if(_0x1173c4[_0x7778('0x41')][_0x7778('0x4e')]){_0x2d3b6d['where']=_[_0x7778('0x4f')](_0x2d3b6d[_0x7778('0x4c')],{'$or':_[_0x7778('0x40')](_0x2d3b6d[_0x7778('0x44')],function(_0x567351){var _0x1efeb7={};_0x1efeb7[_0x567351]={'$like':'%'+_0x1173c4[_0x7778('0x41')][_0x7778('0x4e')]+'%'};return _0x1efeb7;})});}_0x2d3b6d=_[_0x7778('0x4f')]({},_0x2d3b6d,_0x1173c4[_0x7778('0x51')]);return _0x415fa4[_0x7778('0x95')](_0x2d3b6d);}})['then'](function(_0x70a92b){if(_0x70a92b){_0x18511c=_0x70a92b['length'];if(!_0x1173c4[_0x7778('0x41')][_0x7778('0x48')](_0x7778('0x49'))){_0x2d3b6d[_0x7778('0x2d')]=qs[_0x7778('0x2d')](_0x1173c4[_0x7778('0x41')][_0x7778('0x2d')]);_0x2d3b6d[_0x7778('0x2b')]=qs[_0x7778('0x2b')](_0x1173c4[_0x7778('0x41')][_0x7778('0x2b')]);}return _0x415fa4['getAgents'](_0x2d3b6d);}})[_0x7778('0x21')](function(_0x4d4ded){if(_0x4d4ded){return _0x4d4ded?{'count':_0x18511c,'rows':_0x4d4ded}:null;}})[_0x7778('0x21')](respondWithResult(_0x2cc8ad,null))[_0x7778('0x56')](handleError(_0x2cc8ad,null));};
\ No newline at end of file
+var _0x4bee=['tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','value','removeAgents','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','find','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','updatedAt','format','%s/%s','SIP','chatPause','createdAt','getTeams','Team','ids','findAll','online','interface','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select'];(function(_0x32db14,_0x1acfef){var _0xa97506=function(_0x1c62a9){while(--_0x1c62a9){_0x32db14['push'](_0x32db14['shift']());}};_0xa97506(++_0x1acfef);}(_0x4bee,0xaa));var _0xe4be=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x4bee[_0x102ff9];return _0x24fa97;};'use strict';var emlformat=require(_0xe4be('0x0'));var rimraf=require(_0xe4be('0x1'));var zipdir=require(_0xe4be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe4be('0x3'));var BPromise=require(_0xe4be('0x4'));var Mustache=require(_0xe4be('0x5'));var util=require(_0xe4be('0x6'));var path=require(_0xe4be('0x7'));var sox=require(_0xe4be('0x8'));var csv=require(_0xe4be('0x9'));var ejs=require(_0xe4be('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4be('0xb'));var squel=require(_0xe4be('0xc'));var crypto=require('crypto');var jsforce=require(_0xe4be('0xd'));var deskjs=require(_0xe4be('0xe'));var toCsv=require(_0xe4be('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4be('0xf'));var authService=require(_0xe4be('0x10'));var qs=require(_0xe4be('0x11'));var as=require(_0xe4be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4be('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe4be('0x14'));var licenseUtil=require(_0xe4be('0x15'));var db=require(_0xe4be('0x16'))['db'];config[_0xe4be('0x17')]=_[_0xe4be('0x18')](config[_0xe4be('0x17')],{'host':_0xe4be('0x19'),'port':0x18eb});var socket=require(_0xe4be('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xe4be('0x1b')](socket);var jayson=require(_0xe4be('0x1c'));var client=jayson[_0xe4be('0x1d')][_0xe4be('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x29bd5d,_0x2a0f57,_0x5adaa6,_0x50ba2d){return new BPromise(function(_0x35f7af,_0x2e2b75){var _0x19aaf2=_0x50ba2d||client;return _0x19aaf2['request'](_0x29bd5d,_0x5adaa6)[_0xe4be('0x1f')](function(_0x45f6c2){logger[_0xe4be('0x20')](_0xe4be('0x21'),_0x2a0f57,_0xe4be('0x22'));logger[_0xe4be('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a0f57,_0xe4be('0x22'),JSON[_0xe4be('0x24')](_0x45f6c2));if(_0x45f6c2[_0xe4be('0x25')]){if(_0x45f6c2[_0xe4be('0x25')]['code']===0x1f4){logger['error'](_0xe4be('0x21'),_0x2a0f57,_0x45f6c2[_0xe4be('0x25')]['message']);return _0x2e2b75(_0x45f6c2[_0xe4be('0x25')][_0xe4be('0x26')]);}logger[_0xe4be('0x25')](_0xe4be('0x21'),_0x2a0f57,_0x45f6c2[_0xe4be('0x25')][_0xe4be('0x26')]);return _0x35f7af(_0x45f6c2[_0xe4be('0x25')][_0xe4be('0x26')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2a0f57,_0xe4be('0x22'));_0x35f7af(_0x45f6c2[_0xe4be('0x27')][_0xe4be('0x26')]);}})['catch'](function(_0x3fc583){logger[_0xe4be('0x25')](_0xe4be('0x21'),_0x2a0f57,_0x3fc583);_0x2e2b75(_0x3fc583);});});}function respondWithStatusCode(_0x3913ff,_0x215a22){_0x215a22=_0x215a22||0xcc;return function(_0x5af13c){if(_0x5af13c){return _0x3913ff[_0xe4be('0x28')](_0x215a22);}return _0x3913ff[_0xe4be('0x29')](_0x215a22)[_0xe4be('0x2a')]();};}function respondWithResult(_0x47858a,_0x348638){_0x348638=_0x348638||0xc8;return function(_0xefd0f2){if(_0xefd0f2){return _0x47858a[_0xe4be('0x29')](_0x348638)[_0xe4be('0x2b')](_0xefd0f2);}};}function respondWithFilteredResult(_0x23147c,_0x2a894e){return function(_0x3d663b){if(_0x3d663b){var _0x318d1f=typeof _0x2a894e[_0xe4be('0x2c')]==='undefined'&&typeof _0x2a894e['limit']===_0xe4be('0x2d');var _0x500af7=_0x3d663b['count'];var _0x215069=_0x318d1f?0x0:_0x2a894e[_0xe4be('0x2c')];var _0x49d818=_0x318d1f?_0x3d663b[_0xe4be('0x2e')]:_0x2a894e[_0xe4be('0x2c')]+_0x2a894e[_0xe4be('0x2f')];var _0x43c27f;if(_0x49d818>=_0x500af7){_0x49d818=_0x500af7;_0x43c27f=0xc8;}else{_0x43c27f=0xce;}_0x23147c['status'](_0x43c27f);return _0x23147c[_0xe4be('0x30')](_0xe4be('0x31'),_0x215069+'-'+_0x49d818+'/'+_0x500af7)[_0xe4be('0x2b')](_0x3d663b);}return null;};}function patchUpdates(_0x390226){return function(_0x2e529a){try{jsonpatch[_0xe4be('0x32')](_0x2e529a,_0x390226,!![]);}catch(_0x42068b){return BPromise[_0xe4be('0x33')](_0x42068b);}return _0x2e529a[_0xe4be('0x34')]();};}function saveUpdates(_0x5b25f6,_0x92b81c){return function(_0x59f484){if(_0x59f484){return _0x59f484[_0xe4be('0x35')](_0x5b25f6)[_0xe4be('0x1f')](function(_0x8a3ce2){return _0x8a3ce2;});}return null;};}function removeEntity(_0x4d7466,_0x4074c5){return function(_0x11a75b){if(_0x11a75b){return _0x11a75b[_0xe4be('0x36')]()[_0xe4be('0x1f')](function(){var _0xb22789=_0x11a75b['get']({'plain':!![]});var _0x5090d6='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x5090d6,'resourceId':_0xb22789['id']}})[_0xe4be('0x1f')](function(){return _0x11a75b;});})['then'](function(){_0x4d7466[_0xe4be('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a4a5,_0x40239b){return function(_0x5db688){if(!_0x5db688){_0x22a4a5[_0xe4be('0x28')](0x194);}return _0x5db688;};}function handleError(_0x49e4b3,_0x52c69d){_0x52c69d=_0x52c69d||0x1f4;return function(_0x48f782){logger[_0xe4be('0x25')](_0x48f782['stack']);if(_0x48f782['name']){delete _0x48f782[_0xe4be('0x37')];}_0x49e4b3[_0xe4be('0x29')](_0x52c69d)[_0xe4be('0x38')](_0x48f782);};}exports[_0xe4be('0x39')]=function(_0x412135,_0x25dd6e){var _0x582e5b={},_0x114e88={},_0x14f17b={'count':0x0,'rows':[]};var _0x277e60=_[_0xe4be('0x3a')](db[_0xe4be('0x3b')][_0xe4be('0x3c')],function(_0x3c0eb4){return{'name':_0x3c0eb4[_0xe4be('0x3d')],'type':_0x3c0eb4['type'][_0xe4be('0x3e')]};});_0x114e88[_0xe4be('0x3f')]=_['map'](_0x277e60,_0xe4be('0x37'));_0x114e88['query']=_[_0xe4be('0x40')](_0x412135[_0xe4be('0x41')]);_0x114e88[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x114e88['model'],_0x114e88[_0xe4be('0x41')]);_0x582e5b[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x114e88[_0xe4be('0x3f')],qs['fields'](_0x412135[_0xe4be('0x41')][_0xe4be('0x45')]));_0x582e5b[_0xe4be('0x44')]=_0x582e5b[_0xe4be('0x44')][_0xe4be('0x46')]?_0x582e5b[_0xe4be('0x44')]:_0x114e88[_0xe4be('0x3f')];if(!_0x412135[_0xe4be('0x41')][_0xe4be('0x47')](_0xe4be('0x48'))){_0x582e5b[_0xe4be('0x2f')]=qs['limit'](_0x412135[_0xe4be('0x41')][_0xe4be('0x2f')]);_0x582e5b['offset']=qs[_0xe4be('0x2c')](_0x412135[_0xe4be('0x41')]['offset']);}_0x582e5b[_0xe4be('0x49')]=qs[_0xe4be('0x4a')](_0x412135[_0xe4be('0x41')]['sort']);_0x582e5b[_0xe4be('0x4b')]=qs[_0xe4be('0x42')](_[_0xe4be('0x4c')](_0x412135[_0xe4be('0x41')],_0x114e88[_0xe4be('0x42')]),_0x277e60);if(_0x412135['query'][_0xe4be('0x4d')]){_0x582e5b[_0xe4be('0x4b')]=_['merge'](_0x582e5b[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x277e60,function(_0x11412e){if(_0x11412e[_0xe4be('0x4e')]!==_0xe4be('0x4f')){var _0x458129={};_0x458129[_0x11412e[_0xe4be('0x37')]]={'$like':'%'+_0x412135[_0xe4be('0x41')][_0xe4be('0x4d')]+'%'};return _0x458129;}})});}_0x582e5b=_[_0xe4be('0x50')]({},_0x582e5b,_0x412135[_0xe4be('0x51')]);var _0x274230={'where':_0x582e5b[_0xe4be('0x4b')]};return db['ChatQueue']['count'](_0x274230)[_0xe4be('0x1f')](function(_0x31bf17){_0x14f17b[_0xe4be('0x2e')]=_0x31bf17;if(_0x412135['query'][_0xe4be('0x52')]){_0x582e5b[_0xe4be('0x53')]=[{'all':!![]}];}return db[_0xe4be('0x3b')]['findAll'](_0x582e5b);})[_0xe4be('0x1f')](function(_0x351a75){_0x14f17b[_0xe4be('0x54')]=_0x351a75;return _0x14f17b;})['then'](respondWithFilteredResult(_0x25dd6e,_0x582e5b))[_0xe4be('0x55')](handleError(_0x25dd6e,null));};exports['show']=function(_0x5b2063,_0x3c7915){var _0x4ba8dd={'raw':!![],'where':{'id':_0x5b2063[_0xe4be('0x56')]['id']}},_0x5b6b53={};_0x5b6b53[_0xe4be('0x3f')]=_[_0xe4be('0x40')](db[_0xe4be('0x3b')][_0xe4be('0x3c')]);_0x5b6b53[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0x5b2063['query']);_0x5b6b53[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x5b6b53[_0xe4be('0x3f')],_0x5b6b53['query']);_0x4ba8dd[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x5b6b53[_0xe4be('0x3f')],qs['fields'](_0x5b2063[_0xe4be('0x41')][_0xe4be('0x45')]));_0x4ba8dd[_0xe4be('0x44')]=_0x4ba8dd[_0xe4be('0x44')]['length']?_0x4ba8dd[_0xe4be('0x44')]:_0x5b6b53[_0xe4be('0x3f')];if(_0x5b2063['query'][_0xe4be('0x52')]){_0x4ba8dd['include']=[{'all':!![]}];}_0x4ba8dd=_[_0xe4be('0x50')]({},_0x4ba8dd,_0x5b2063[_0xe4be('0x51')]);return db['ChatQueue']['find'](_0x4ba8dd)[_0xe4be('0x1f')](handleEntityNotFound(_0x3c7915,null))['then'](respondWithResult(_0x3c7915,null))[_0xe4be('0x55')](handleError(_0x3c7915,null));};exports[_0xe4be('0x57')]=function(_0x5def26,_0x1ba9a0){return db[_0xe4be('0x3b')][_0xe4be('0x57')](_0x5def26['body'],{})[_0xe4be('0x1f')](function(_0x2ec45a){var _0x171f8a=_0x5def26[_0xe4be('0x58')][_0xe4be('0x59')]({'plain':!![]});if(!_0x171f8a)throw new Error(_0xe4be('0x5a'));if(_0x171f8a[_0xe4be('0x5b')]===_0xe4be('0x58')){var _0x4f4689=_0x2ec45a[_0xe4be('0x59')]({'plain':!![]});var _0x326d03=_0xe4be('0x5c');return db[_0xe4be('0x5d')]['find']({'where':{'name':_0x326d03,'userProfileId':_0x171f8a[_0xe4be('0x5e')]},'raw':!![]})['then'](function(_0x339a46){if(_0x339a46&&_0x339a46[_0xe4be('0x5f')]===0x0){return db[_0xe4be('0x60')][_0xe4be('0x57')]({'name':_0x4f4689[_0xe4be('0x37')],'resourceId':_0x4f4689['id'],'type':_0x339a46[_0xe4be('0x37')],'sectionId':_0x339a46['id']},{})['then'](function(){return _0x2ec45a;});}else{return _0x2ec45a;}})[_0xe4be('0x55')](function(_0xf1fa17){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf1fa17);throw _0xf1fa17;});}return _0x2ec45a;})[_0xe4be('0x1f')](respondWithResult(_0x1ba9a0,0xc9))[_0xe4be('0x55')](handleError(_0x1ba9a0,null));};exports[_0xe4be('0x35')]=function(_0x508c8b,_0x262dc1){if(_0x508c8b[_0xe4be('0x61')]['id']){delete _0x508c8b[_0xe4be('0x61')]['id'];}return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0x508c8b[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x262dc1,null))[_0xe4be('0x1f')](saveUpdates(_0x508c8b[_0xe4be('0x61')],null))['then'](respondWithResult(_0x262dc1,null))[_0xe4be('0x55')](handleError(_0x262dc1,null));};exports[_0xe4be('0x36')]=function(_0x395b29,_0x4a2a55){return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0x395b29[_0xe4be('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a2a55,null))['then'](removeEntity(_0x4a2a55,null))[_0xe4be('0x55')](handleError(_0x4a2a55,null));};exports['describe']=function(_0x2546cd,_0x554d33){return db[_0xe4be('0x3b')]['describe']()[_0xe4be('0x1f')](respondWithResult(_0x554d33,null))[_0xe4be('0x55')](handleError(_0x554d33,null));};exports[_0xe4be('0x63')]=function(_0x592f46,_0x3033ce,_0x25e6fe){var _0x25a6a4={'raw':!![],'where':{}},_0x9f04d3={},_0x34fc29;return db[_0xe4be('0x3b')][_0xe4be('0x64')]({'where':{'id':_0x592f46[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x3033ce,null))[_0xe4be('0x1f')](function(_0x4132d0){if(_0x4132d0){_0x34fc29=_0x4132d0['get']({'plain':!![]});_0x9f04d3['model']=_['keys'](db['UserChatQueue'][_0xe4be('0x3c')]);_0x9f04d3[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0x592f46[_0xe4be('0x41')]);_0x9f04d3[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x9f04d3['model'],_0x9f04d3['query']);_0x25a6a4[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x9f04d3[_0xe4be('0x3f')],qs[_0xe4be('0x45')](_0x592f46[_0xe4be('0x41')]['fields']));_0x25a6a4[_0xe4be('0x44')]=_0x25a6a4['attributes'][_0xe4be('0x46')]?_0x25a6a4[_0xe4be('0x44')]:_0x9f04d3[_0xe4be('0x3f')];if(!_0x592f46[_0xe4be('0x41')][_0xe4be('0x47')](_0xe4be('0x48'))){_0x25a6a4[_0xe4be('0x2f')]=qs[_0xe4be('0x2f')](_0x592f46[_0xe4be('0x41')][_0xe4be('0x2f')]);_0x25a6a4['offset']=qs[_0xe4be('0x2c')](_0x592f46[_0xe4be('0x41')][_0xe4be('0x2c')]);}_0x25a6a4['order']=qs['sort'](_0x592f46['query'][_0xe4be('0x4a')]);_0x25a6a4[_0xe4be('0x4b')]=qs[_0xe4be('0x42')](_[_0xe4be('0x4c')](_0x592f46['query'],_0x9f04d3[_0xe4be('0x42')]));_0x25a6a4[_0xe4be('0x4b')][_0xe4be('0x65')]=_0x4132d0['id'];if(_0x592f46[_0xe4be('0x41')]['filter']){_0x25a6a4[_0xe4be('0x4b')]=_[_0xe4be('0x50')](_0x25a6a4[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x25a6a4[_0xe4be('0x44')],function(_0x133b51){var _0x421dd1={};_0x421dd1[_0x133b51]={'$like':'%'+_0x592f46['query'][_0xe4be('0x4d')]+'%'};return _0x421dd1;})});}_0x25a6a4=_[_0xe4be('0x50')]({},_0x25a6a4,_0x592f46[_0xe4be('0x51')]);return db[_0xe4be('0x66')]['findAll'](_0x25a6a4);}})[_0xe4be('0x1f')](function(_0x4273d3){if(_0x4273d3){return db[_0xe4be('0x67')][_0xe4be('0x68')]({'where':{'id':_[_0xe4be('0x3a')](_0x4273d3,_0xe4be('0x69')),'role':'agent'},'attributes':['id',_0xe4be('0x37'),'chatPause',_0xe4be('0x6a'),'createdAt']});}})[_0xe4be('0x1f')](function(_0x1354df){if(_0x1354df){return{'count':_0x1354df[_0xe4be('0x2e')],'rows':_['map'](_0x1354df[_0xe4be('0x54')],function(_0x529b06){return{'membername':_0x529b06['name'],'UserId':_0x529b06['id'],'queue_name':_0x34fc29[_0xe4be('0x37')],'ChatQueueId':_0x34fc29['id'],'interface':util[_0xe4be('0x6b')](_0xe4be('0x6c'),_0xe4be('0x6d'),_0x529b06[_0xe4be('0x37')]),'penalty':0x0,'paused':_0x529b06[_0xe4be('0x6e')],'createdAt':_0x529b06[_0xe4be('0x6f')],'updatedAt':_0x529b06[_0xe4be('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe4be('0x1f')](respondWithFilteredResult(_0x3033ce,_0x25a6a4))[_0xe4be('0x55')](handleError(_0x3033ce,null));};exports[_0xe4be('0x70')]=function(_0x48c915,_0x54a837,_0x3ce717){var _0x1ef052={};var _0x28deff={};var _0x34beec;var _0x1cc5c1;return db[_0xe4be('0x3b')][_0xe4be('0x64')]({'where':{'id':_0x48c915[_0xe4be('0x56')]['id']}})['then'](handleEntityNotFound(_0x54a837,null))['then'](function(_0x55fa70){if(_0x55fa70){_0x34beec=_0x55fa70;_0x28deff[_0xe4be('0x3f')]=_['keys'](db[_0xe4be('0x71')][_0xe4be('0x3c')]);_0x28deff[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0x48c915[_0xe4be('0x41')]);_0x28deff[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x28deff[_0xe4be('0x3f')],_0x28deff[_0xe4be('0x41')]);_0x1ef052[_0xe4be('0x44')]=_[_0xe4be('0x43')](_0x28deff[_0xe4be('0x3f')],qs['fields'](_0x48c915[_0xe4be('0x41')][_0xe4be('0x45')]));_0x1ef052[_0xe4be('0x44')]=_0x1ef052[_0xe4be('0x44')][_0xe4be('0x46')]?_0x1ef052[_0xe4be('0x44')]:_0x28deff[_0xe4be('0x3f')];_0x1ef052[_0xe4be('0x49')]=qs['sort'](_0x48c915['query']['sort']);_0x1ef052[_0xe4be('0x4b')]=qs[_0xe4be('0x42')](_[_0xe4be('0x4c')](_0x48c915[_0xe4be('0x41')],_0x28deff[_0xe4be('0x42')]));if(_0x48c915[_0xe4be('0x41')]['filter']){_0x1ef052['where']=_[_0xe4be('0x50')](_0x1ef052[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x1ef052[_0xe4be('0x44')],function(_0x5e8cf4){var _0x50a1b7={};_0x50a1b7[_0x5e8cf4]={'$like':'%'+_0x48c915[_0xe4be('0x41')][_0xe4be('0x4d')]+'%'};return _0x50a1b7;})});}_0x1ef052=_[_0xe4be('0x50')]({},_0x1ef052,_0x48c915['options']);return _0x34beec[_0xe4be('0x70')](_0x1ef052);}})[_0xe4be('0x1f')](function(_0xc5a333){if(_0xc5a333){_0x1cc5c1=_0xc5a333[_0xe4be('0x46')];if(!_0x48c915[_0xe4be('0x41')][_0xe4be('0x47')](_0xe4be('0x48'))){_0x1ef052[_0xe4be('0x2f')]=qs['limit'](_0x48c915['query'][_0xe4be('0x2f')]);_0x1ef052['offset']=qs[_0xe4be('0x2c')](_0x48c915['query']['offset']);}return _0x34beec['getTeams'](_0x1ef052);}})[_0xe4be('0x1f')](function(_0x2bebca){if(_0x2bebca){return _0x2bebca?{'count':_0x1cc5c1,'rows':_0x2bebca}:null;}})[_0xe4be('0x1f')](respondWithResult(_0x54a837,null))[_0xe4be('0x55')](handleError(_0x54a837,null));};exports['addTeams']=function(_0x5783c5,_0x4e116f,_0x54f3bd){var _0x257dc1=_0x5783c5[_0xe4be('0x61')][_0xe4be('0x72')];return db[_0xe4be('0x71')][_0xe4be('0x73')]({'where':{'id':_0x257dc1},'attributes':['id'],'include':[{'model':db[_0xe4be('0x67')],'as':'Agents','attributes':['id',_0xe4be('0x37'),_0xe4be('0x74'),'voicePause',_0xe4be('0x75')],'raw':!![]}]})[_0xe4be('0x1f')](function(_0x5eff14){if(_0x5eff14){var _0x385ab9=_['flatMap'](_0x5eff14,function(_0x4898e7){var _0x2f8db2=_0x4898e7[_0xe4be('0x59')]({'plain':!![]});return _0x2f8db2[_0xe4be('0x76')];});return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0x5783c5[_0xe4be('0x56')]['id']}})['then'](function(_0x1c5b43){return db[_0xe4be('0x77')][_0xe4be('0x78')](function(_0x3919c2){return _0x1c5b43[_0xe4be('0x79')](_0x257dc1,{'transaction':_0x3919c2})['then'](function(){return BPromise[_0xe4be('0x7a')](_0x385ab9,function(_0x145c6a){return db[_0xe4be('0x66')][_0xe4be('0x7b')]({'where':{'UserId':_0x145c6a['id'],'ChatQueueId':_0x5783c5[_0xe4be('0x56')]['id']},'transaction':_0x3919c2});});})[_0xe4be('0x1f')](function(){_0x385ab9[_0xe4be('0x7c')](function(_0x589d6d){socket['emit'](_0xe4be('0x7d'),{'UserId':_0x589d6d['id'],'ChatQueueId':_0x1c5b43['id']});});});});});}})['then'](respondWithStatusCode(_0x4e116f,null))[_0xe4be('0x55')](handleError(_0x4e116f,null));};exports[_0xe4be('0x7e')]=function(_0x4ce11e,_0x55248a,_0x358952){return db[_0xe4be('0x71')][_0xe4be('0x73')]({'where':{'id':_0x4ce11e[_0xe4be('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe4be('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x55248a,null))[_0xe4be('0x1f')](function(_0x243ed9){var _0x1d634c=_[_0xe4be('0x3a')](_0x243ed9,'id');var _0x21cf3c=[];var _0x1f6344=[];var _0x44a476=squel[_0xe4be('0x7f')]();_0x44a476['field'](_0xe4be('0x80'))[_0xe4be('0x81')](_0xe4be('0x82'),'tq')['join'](_0xe4be('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe4be('0x4b')](_0xe4be('0x84'),_0x4ce11e['params']['id']);for(var _0x3a722c=0x0;_0x3a722c<_0x243ed9[_0xe4be('0x46')];_0x3a722c+=0x1){let _0xbb65d2=_0x243ed9[_0x3a722c];for(var _0x48a413=0x0;_0x48a413<_0xbb65d2[_0xe4be('0x76')][_0xe4be('0x46')];_0x48a413+=0x1){let _0x27b486=_0xbb65d2[_0xe4be('0x76')][_0x48a413];var _0x31e984=_0x44a476['clone']();_0x31e984['where']('ut.UserId\x20=\x20?',_0x27b486['id']);_0x1f6344[_0xe4be('0x85')](db[_0xe4be('0x77')][_0xe4be('0x41')](_0x31e984[_0xe4be('0x86')](),{'type':db['sequelize'][_0xe4be('0x87')][_0xe4be('0x88')]})[_0xe4be('0x1f')](function(_0x581821){if(_0x581821[_0xe4be('0x46')]===0x1){return _0x27b486['id'];}else{var _0xd1bab3=_[_0xe4be('0x89')](_[_0xe4be('0x3a')](_0x581821,'TeamId'),function(_0x54019e){return _['includes'](_0x1d634c,_0x54019e);});if(_0xd1bab3){return _0x27b486['id'];}}}));}}return BPromise[_0xe4be('0x8a')](_0x1f6344)[_0xe4be('0x1f')](function(_0x541a09){_0x21cf3c=_(_0x21cf3c)[_0xe4be('0x8b')](_0x541a09)['compact']()[_0xe4be('0x8c')]();return db[_0xe4be('0x3b')]['find']({'where':{'id':_0x4ce11e[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](function(_0x1c16ab){return db[_0xe4be('0x77')][_0xe4be('0x78')](function(_0x1c6fab){return _0x1c16ab['removeTeams'](_0x4ce11e[_0xe4be('0x41')][_0xe4be('0x72')],{'transaction':_0x1c6fab})[_0xe4be('0x1f')](function(){if(!_['isEmpty'](_0x21cf3c)){return _0x1c16ab[_0xe4be('0x8d')](_0x21cf3c,{'transaction':_0x1c6fab});}})['then'](function(){_0x21cf3c[_0xe4be('0x7c')](function(_0x186764){socket[_0xe4be('0x8e')]('userChatQueue:remove',{'UserId':_0x186764,'ChatQueueId':_0x1c16ab['id']});});});});});});})[_0xe4be('0x1f')](respondWithStatusCode(_0x55248a,null))['catch'](handleError(_0x55248a,null));};exports[_0xe4be('0x8f')]=function(_0xf2aef1,_0x3237c9,_0x42e91f){return db[_0xe4be('0x3b')][_0xe4be('0x62')]({'where':{'id':_0xf2aef1['params']['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x3237c9,null))[_0xe4be('0x1f')](function(_0x29da5e){if(_0x29da5e){return _0x29da5e[_0xe4be('0x8f')](_0xf2aef1[_0xe4be('0x61')][_0xe4be('0x72')],_[_0xe4be('0x90')](_0xf2aef1[_0xe4be('0x61')],['ids','id'])||{})[_0xe4be('0x91')](function(_0x175884){for(var _0x466a24=0x0;_0x466a24<_0xf2aef1['body'][_0xe4be('0x72')][_0xe4be('0x46')];_0x466a24+=0x1){socket['emit'](_0xe4be('0x7d'),{'UserId':Number(_0xf2aef1[_0xe4be('0x61')][_0xe4be('0x72')][_0x466a24]),'ChatQueueId':Number(_0xf2aef1['params']['id'])});}return _0x175884;});}})[_0xe4be('0x1f')](respondWithResult(_0x3237c9,null))[_0xe4be('0x55')](handleError(_0x3237c9,null));};exports[_0xe4be('0x8d')]=function(_0x23f771,_0x18a23e,_0x1e1247){return db[_0xe4be('0x3b')]['find']({'where':{'id':_0x23f771['params']['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x18a23e,null))['then'](function(_0x272ecb){if(_0x272ecb){return _0x272ecb[_0xe4be('0x8d')](_0x23f771[_0xe4be('0x41')]['ids'])[_0xe4be('0x1f')](function(){if(_[_0xe4be('0x92')](_0x23f771[_0xe4be('0x41')][_0xe4be('0x72')])){for(var _0x348e62=0x0;_0x348e62<_0x23f771['query'][_0xe4be('0x72')]['length'];_0x348e62+=0x1){socket[_0xe4be('0x8e')](_0xe4be('0x93'),{'UserId':Number(_0x23f771[_0xe4be('0x41')][_0xe4be('0x72')][_0x348e62]),'ChatQueueId':Number(_0x23f771[_0xe4be('0x56')]['id'])});}}else{socket[_0xe4be('0x8e')]('userChatQueue:remove',{'UserId':Number(_0x23f771[_0xe4be('0x41')][_0xe4be('0x72')]),'ChatQueueId':Number(_0x23f771[_0xe4be('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x18a23e,null))[_0xe4be('0x55')](handleError(_0x18a23e,null));};exports[_0xe4be('0x94')]=function(_0xc22dbd,_0x16f6ea,_0x25e1fc){var _0x189adf={};var _0x365786={};var _0x105f93;var _0x2ea714;return db['ChatQueue']['findOne']({'where':{'id':_0xc22dbd[_0xe4be('0x56')]['id']}})[_0xe4be('0x1f')](handleEntityNotFound(_0x16f6ea,null))[_0xe4be('0x1f')](function(_0x1492e9){if(_0x1492e9){_0x105f93=_0x1492e9;_0x365786['model']=_[_0xe4be('0x40')](db[_0xe4be('0x67')][_0xe4be('0x3c')]);_0x365786[_0xe4be('0x41')]=_[_0xe4be('0x40')](_0xc22dbd[_0xe4be('0x41')]);_0x365786[_0xe4be('0x42')]=_[_0xe4be('0x43')](_0x365786[_0xe4be('0x3f')],_0x365786[_0xe4be('0x41')]);_0x189adf['attributes']=_[_0xe4be('0x43')](_0x365786[_0xe4be('0x3f')],qs[_0xe4be('0x45')](_0xc22dbd['query'][_0xe4be('0x45')]));_0x189adf[_0xe4be('0x44')]=_0x189adf[_0xe4be('0x44')][_0xe4be('0x46')]?_0x189adf[_0xe4be('0x44')]:_0x365786[_0xe4be('0x3f')];_0x189adf[_0xe4be('0x49')]=qs['sort'](_0xc22dbd['query'][_0xe4be('0x4a')]);_0x189adf[_0xe4be('0x4b')]=qs['filters'](_[_0xe4be('0x4c')](_0xc22dbd[_0xe4be('0x41')],_0x365786[_0xe4be('0x42')]));if(_0xc22dbd[_0xe4be('0x41')][_0xe4be('0x4d')]){_0x189adf[_0xe4be('0x4b')]=_[_0xe4be('0x50')](_0x189adf[_0xe4be('0x4b')],{'$or':_[_0xe4be('0x3a')](_0x189adf[_0xe4be('0x44')],function(_0x37bcee){var _0x55a83e={};_0x55a83e[_0x37bcee]={'$like':'%'+_0xc22dbd[_0xe4be('0x41')]['filter']+'%'};return _0x55a83e;})});}_0x189adf=_[_0xe4be('0x50')]({},_0x189adf,_0xc22dbd[_0xe4be('0x51')]);return _0x105f93[_0xe4be('0x94')](_0x189adf);}})['then'](function(_0x41e83f){if(_0x41e83f){_0x2ea714=_0x41e83f[_0xe4be('0x46')];if(!_0xc22dbd[_0xe4be('0x41')]['hasOwnProperty'](_0xe4be('0x48'))){_0x189adf['limit']=qs[_0xe4be('0x2f')](_0xc22dbd['query']['limit']);_0x189adf[_0xe4be('0x2c')]=qs[_0xe4be('0x2c')](_0xc22dbd[_0xe4be('0x41')][_0xe4be('0x2c')]);}return _0x105f93[_0xe4be('0x94')](_0x189adf);}})[_0xe4be('0x1f')](function(_0x1a0343){if(_0x1a0343){return _0x1a0343?{'count':_0x2ea714,'rows':_0x1a0343}:null;}})[_0xe4be('0x1f')](respondWithResult(_0x16f6ea,null))[_0xe4be('0x55')](handleError(_0x16f6ea,null));};
\ No newline at end of file
index bf47df8..4bc3d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cba=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatQueue','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cba,0x173));var _0xa6cb=function(_0x20e5d4,_0x4ae460){_0x20e5d4=_0x20e5d4-0x0;var _0x54d52a=_0x6cba[_0x20e5d4];return _0x54d52a;};'use strict';var EventEmitter=require(_0xa6cb('0x0'));var ChatQueue=require(_0xa6cb('0x1'))['db'][_0xa6cb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6cb('0x3'),'afterUpdate':_0xa6cb('0x4'),'afterDestroy':_0xa6cb('0x5')};function emitEvent(_0x42f723){return function(_0x23fff2,_0x317c34,_0xad437f){ChatQueueEvents[_0xa6cb('0x6')](_0x42f723+':'+_0x23fff2['id'],_0x23fff2);ChatQueueEvents[_0xa6cb('0x6')](_0x42f723,_0x23fff2);_0xad437f(null);};}for(var e in events){if(events[_0xa6cb('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x11c5=['../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x11c5,0xc5));var _0x511c=function(_0x3eaedf,_0xa1791f){_0x3eaedf=_0x3eaedf-0x0;var _0x2a0694=_0x11c5[_0x3eaedf];return _0x2a0694;};'use strict';var EventEmitter=require(_0x511c('0x0'));var ChatQueue=require(_0x511c('0x1'))['db'][_0x511c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x511c('0x3')](0x0);var events={'afterCreate':_0x511c('0x4'),'afterUpdate':'update','afterDestroy':_0x511c('0x5')};function emitEvent(_0x4cf942){return function(_0x3ff37f,_0xf1c46,_0x208b5b){ChatQueueEvents[_0x511c('0x6')](_0x4cf942+':'+_0x3ff37f['id'],_0x3ff37f);ChatQueueEvents['emit'](_0x4cf942,_0x3ff37f);_0x208b5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x511c('0x7')](e,emitEvent(event));}}module[_0x511c('0x8')]=ChatQueueEvents;
\ No newline at end of file
index 203b571..1de6cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccfa=['ChatQueue','chat_queues','lodash','../../config/logger','api','moment','request-promise','./chatQueue.attributes','exports'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xccfa,0x110));var _0xaccf=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xccfa[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xaccf('0x0'));var util=require('util');var logger=require(_0xaccf('0x1'))(_0xaccf('0x2'));var moment=require(_0xaccf('0x3'));var BPromise=require('bluebird');var rp=require(_0xaccf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaccf('0x5'));module[_0xaccf('0x6')]=function(_0x2fdd7c,_0x7f046f){return _0x2fdd7c['define'](_0xaccf('0x7'),attributes,{'tableName':_0xaccf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd085=['moment','bluebird','request-promise','path','rimraf','../../config/environment','chat_queues','util','../../config/logger','api'];(function(_0x4f59b3,_0x1daf6e){var _0x2956f1=function(_0x2000af){while(--_0x2000af){_0x4f59b3['push'](_0x4f59b3['shift']());}};_0x2956f1(++_0x1daf6e);}(_0xd085,0x89));var _0x5d08=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0xd085[_0x305486];return _0xa04940;};'use strict';var _=require('lodash');var util=require(_0x5d08('0x0'));var logger=require(_0x5d08('0x1'))(_0x5d08('0x2'));var moment=require(_0x5d08('0x3'));var BPromise=require(_0x5d08('0x4'));var rp=require(_0x5d08('0x5'));var fs=require('fs');var path=require(_0x5d08('0x6'));var rimraf=require(_0x5d08('0x7'));var config=require(_0x5d08('0x8'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x4668ab,_0x537284){return _0x4668ab['define']('ChatQueue',attributes,{'tableName':_0x5d08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b7b39b..0401a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae87=['ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','ChatQueue','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','stringify','ShowChatQueue','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xae87,0x1ce));var _0x7ae8=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xae87[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7ae8('0x0'));var fs=require('fs');var Redis=require(_0x7ae8('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ae8('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x7ae8('0x3'));var jayson=require(_0x7ae8('0x4'));var client=jayson[_0x7ae8('0x5')][_0x7ae8('0x6')]({'port':0x232a});config['redis']=_[_0x7ae8('0x7')](config[_0x7ae8('0x8')],{'host':_0x7ae8('0x9'),'port':0x18eb});var socket=require(_0x7ae8('0xa'))(new Redis(config[_0x7ae8('0x8')]));require(_0x7ae8('0xb'))[_0x7ae8('0xc')](socket);function respondWithRpcPromise(_0x48d84d,_0x4a63d6,_0x2cc5f6){return new BPromise(function(_0x334ae7,_0x595760){return client[_0x7ae8('0xd')](_0x48d84d,_0x2cc5f6)['then'](function(_0x4077e5){logger['info'](_0x7ae8('0xe'),_0x4a63d6,'request\x20sent');logger[_0x7ae8('0xf')](_0x7ae8('0x10'),_0x4a63d6,_0x7ae8('0x11'),JSON['stringify'](_0x4077e5));if(_0x4077e5[_0x7ae8('0x12')]){if(_0x4077e5[_0x7ae8('0x12')]['code']===0x1f4){logger[_0x7ae8('0x12')](_0x7ae8('0xe'),_0x4a63d6,_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);return _0x595760(_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);}logger[_0x7ae8('0x12')](_0x7ae8('0xe'),_0x4a63d6,_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);return _0x334ae7(_0x4077e5[_0x7ae8('0x12')][_0x7ae8('0x13')]);}else{logger['info'](_0x7ae8('0xe'),_0x4a63d6,_0x7ae8('0x11'));_0x334ae7(_0x4077e5['result'][_0x7ae8('0x13')]);}})[_0x7ae8('0x14')](function(_0x408e0b){logger[_0x7ae8('0x12')]('ChatQueue,\x20%s,\x20%s',_0x4a63d6,_0x408e0b);_0x595760(_0x408e0b);});});}exports['GetChatQueue']=function(_0x483b24){var _0x62392=this;return new Promise(function(_0x105b56,_0x587d0a){return db[_0x7ae8('0x15')]['findAll']({'raw':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x17')]===undefined?!![]:![]:!![],'where':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x18')]||null:null,'attributes':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x19')]||null:null,'limit':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x1a')]||null:null,'include':_0x483b24[_0x7ae8('0x16')]?_0x483b24[_0x7ae8('0x16')][_0x7ae8('0x1b')]?_['map'](_0x483b24['options'][_0x7ae8('0x1b')],function(_0x5d2ae3){return{'model':db[_0x5d2ae3['model']],'as':_0x5d2ae3['as'],'attributes':_0x5d2ae3[_0x7ae8('0x19')],'include':_0x5d2ae3['include']?_[_0x7ae8('0x1c')](_0x5d2ae3[_0x7ae8('0x1b')],function(_0x4e00c2){return{'model':db[_0x4e00c2[_0x7ae8('0x1d')]],'as':_0x4e00c2['as'],'attributes':_0x4e00c2[_0x7ae8('0x19')],'include':_0x4e00c2[_0x7ae8('0x1b')]?_[_0x7ae8('0x1c')](_0x4e00c2[_0x7ae8('0x1b')],function(_0xae4253){return{'model':db[_0xae4253['model']],'as':_0xae4253['as'],'attributes':_0xae4253[_0x7ae8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34baf9){logger[_0x7ae8('0x1e')](_0x7ae8('0x1f'),_0x483b24);logger['debug'](_0x7ae8('0x1f'),_0x483b24,JSON[_0x7ae8('0x20')](_0x34baf9));_0x105b56(_0x34baf9);})[_0x7ae8('0x14')](function(_0x4f5bdf){logger[_0x7ae8('0x12')](_0x7ae8('0x1f'),_0x4f5bdf[_0x7ae8('0x13')],_0x483b24);_0x587d0a(_0x62392[_0x7ae8('0x12')](0x1f4,_0x4f5bdf[_0x7ae8('0x13')]));});});};exports[_0x7ae8('0x21')]=function(_0x63cc2c){var _0x4c86e8=this;return new Promise(function(_0x2be8b7,_0x222507){return db[_0x7ae8('0x15')]['find']({'raw':_0x63cc2c[_0x7ae8('0x16')]?_0x63cc2c[_0x7ae8('0x16')][_0x7ae8('0x17')]===undefined?!![]:![]:!![],'where':_0x63cc2c['options']?_0x63cc2c[_0x7ae8('0x16')]['where']||null:null,'attributes':_0x63cc2c['options']?_0x63cc2c['options'][_0x7ae8('0x19')]||null:null,'include':_0x63cc2c[_0x7ae8('0x16')]?_0x63cc2c['options'][_0x7ae8('0x1b')]?_[_0x7ae8('0x1c')](_0x63cc2c[_0x7ae8('0x16')][_0x7ae8('0x1b')],function(_0x5c4076){return{'model':db[_0x5c4076[_0x7ae8('0x1d')]],'as':_0x5c4076['as'],'attributes':_0x5c4076[_0x7ae8('0x19')],'include':_0x5c4076[_0x7ae8('0x1b')]?_['map'](_0x5c4076[_0x7ae8('0x1b')],function(_0x5bd982){return{'model':db[_0x5bd982[_0x7ae8('0x1d')]],'as':_0x5bd982['as'],'attributes':_0x5bd982[_0x7ae8('0x19')],'include':_0x5bd982[_0x7ae8('0x1b')]?_[_0x7ae8('0x1c')](_0x5bd982['include'],function(_0x2aa1b6){return{'model':db[_0x2aa1b6[_0x7ae8('0x1d')]],'as':_0x2aa1b6['as'],'attributes':_0x2aa1b6[_0x7ae8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2257cc){logger['info']('ShowChatQueue',_0x63cc2c);logger[_0x7ae8('0xf')]('ShowChatQueue',_0x63cc2c,JSON['stringify'](_0x2257cc));_0x2be8b7(_0x2257cc);})[_0x7ae8('0x14')](function(_0x220285){logger['error'](_0x7ae8('0x21'),_0x220285[_0x7ae8('0x13')],_0x63cc2c);_0x222507(_0x4c86e8[_0x7ae8('0x12')](0x1f4,_0x220285['message']));});});};
\ No newline at end of file
+var _0x3d70=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowChatQueue','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x21f21d,_0x23f311){var _0x353a1f=function(_0x4794aa){while(--_0x4794aa){_0x21f21d['push'](_0x21f21d['shift']());}};_0x353a1f(++_0x23f311);}(_0x3d70,0xf6));var _0x03d7=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0x3d70[_0x1c208e];return _0x5104ff;};'use strict';var _=require('lodash');var util=require(_0x03d7('0x0'));var moment=require(_0x03d7('0x1'));var BPromise=require(_0x03d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x03d7('0x4'));var logger=require(_0x03d7('0x5'))('rpc');var config=require(_0x03d7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x03d7('0x7')][_0x03d7('0x8')]({'port':0x232a});config[_0x03d7('0x9')]=_[_0x03d7('0xa')](config['redis'],{'host':_0x03d7('0xb'),'port':0x18eb});var socket=require(_0x03d7('0xc'))(new Redis(config[_0x03d7('0x9')]));require('./chatQueue.socket')[_0x03d7('0xd')](socket);function respondWithRpcPromise(_0x4678d8,_0x556e42,_0x34d03a){return new BPromise(function(_0x19da37,_0x430718){return client[_0x03d7('0xe')](_0x4678d8,_0x34d03a)[_0x03d7('0xf')](function(_0x2fed0f){logger[_0x03d7('0x10')](_0x03d7('0x11'),_0x556e42,_0x03d7('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x556e42,_0x03d7('0x12'),JSON[_0x03d7('0x13')](_0x2fed0f));if(_0x2fed0f[_0x03d7('0x14')]){if(_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x15')]===0x1f4){logger[_0x03d7('0x14')](_0x03d7('0x11'),_0x556e42,_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x16')]);return _0x430718(_0x2fed0f[_0x03d7('0x14')]['message']);}logger['error'](_0x03d7('0x11'),_0x556e42,_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x16')]);return _0x19da37(_0x2fed0f[_0x03d7('0x14')][_0x03d7('0x16')]);}else{logger[_0x03d7('0x10')](_0x03d7('0x11'),_0x556e42,'request\x20sent');_0x19da37(_0x2fed0f['result']['message']);}})[_0x03d7('0x17')](function(_0x59237){logger[_0x03d7('0x14')](_0x03d7('0x11'),_0x556e42,_0x59237);_0x430718(_0x59237);});});}exports[_0x03d7('0x18')]=function(_0x1fa6d9){var _0x4da574=this;return new Promise(function(_0x539beb,_0x13aa1c){return db[_0x03d7('0x19')]['findAll']({'raw':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1c')]||null:null,'attributes':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1d')]||null:null,'limit':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1e')]||null:null,'include':_0x1fa6d9[_0x03d7('0x1a')]?_0x1fa6d9['options'][_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x1fa6d9[_0x03d7('0x1a')][_0x03d7('0x1f')],function(_0x1cdd49){return{'model':db[_0x1cdd49[_0x03d7('0x21')]],'as':_0x1cdd49['as'],'attributes':_0x1cdd49[_0x03d7('0x1d')],'include':_0x1cdd49[_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x1cdd49['include'],function(_0x58d170){return{'model':db[_0x58d170[_0x03d7('0x21')]],'as':_0x58d170['as'],'attributes':_0x58d170[_0x03d7('0x1d')],'include':_0x58d170[_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x58d170[_0x03d7('0x1f')],function(_0x745694){return{'model':db[_0x745694[_0x03d7('0x21')]],'as':_0x745694['as'],'attributes':_0x745694['attributes']};}):[]};}):[]};}):[]:[]})[_0x03d7('0xf')](function(_0xfc727f){logger['info'](_0x03d7('0x18'),_0x1fa6d9);logger[_0x03d7('0x22')]('GetChatQueue',_0x1fa6d9,JSON[_0x03d7('0x13')](_0xfc727f));_0x539beb(_0xfc727f);})[_0x03d7('0x17')](function(_0x30fb5f){logger['error'](_0x03d7('0x18'),_0x30fb5f[_0x03d7('0x16')],_0x1fa6d9);_0x13aa1c(_0x4da574['error'](0x1f4,_0x30fb5f['message']));});});};exports[_0x03d7('0x23')]=function(_0x1f2c24){var _0x24f749=this;return new Promise(function(_0x2655a0,_0x1d8b6c){return db[_0x03d7('0x19')]['find']({'raw':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24['options'][_0x03d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24[_0x03d7('0x1a')][_0x03d7('0x1c')]||null:null,'attributes':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24['options'][_0x03d7('0x1d')]||null:null,'include':_0x1f2c24[_0x03d7('0x1a')]?_0x1f2c24['options'][_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x1f2c24[_0x03d7('0x1a')][_0x03d7('0x1f')],function(_0x4a8754){return{'model':db[_0x4a8754[_0x03d7('0x21')]],'as':_0x4a8754['as'],'attributes':_0x4a8754[_0x03d7('0x1d')],'include':_0x4a8754[_0x03d7('0x1f')]?_[_0x03d7('0x20')](_0x4a8754[_0x03d7('0x1f')],function(_0x33e9ff){return{'model':db[_0x33e9ff[_0x03d7('0x21')]],'as':_0x33e9ff['as'],'attributes':_0x33e9ff[_0x03d7('0x1d')],'include':_0x33e9ff[_0x03d7('0x1f')]?_['map'](_0x33e9ff[_0x03d7('0x1f')],function(_0x34e985){return{'model':db[_0x34e985[_0x03d7('0x21')]],'as':_0x34e985['as'],'attributes':_0x34e985['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x343928){logger[_0x03d7('0x10')](_0x03d7('0x23'),_0x1f2c24);logger[_0x03d7('0x22')]('ShowChatQueue',_0x1f2c24,JSON[_0x03d7('0x13')](_0x343928));_0x2655a0(_0x343928);})[_0x03d7('0x17')](function(_0x128932){logger[_0x03d7('0x14')](_0x03d7('0x23'),_0x128932[_0x03d7('0x16')],_0x1f2c24);_0x1d8b6c(_0x24f749[_0x03d7('0x14')](0x1f4,_0x128932[_0x03d7('0x16')]));});});};
\ No newline at end of file
index f76eb29..d0de6e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x5c8cf8,_0x54b4c1){var _0xaa6bf8=function(_0x585184){while(--_0x585184){_0x5c8cf8['push'](_0x5c8cf8['shift']());}};_0xaa6bf8(++_0x54b4c1);}(_0x303a,0x1a0));var _0xa303=function(_0x3935d7,_0x39958f){_0x3935d7=_0x3935d7-0x0;var _0x2ca73e=_0x303a[_0x3935d7];return _0x2ca73e;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}};
\ No newline at end of file
+var _0x29d4=['removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x31a955,_0x145b94){var _0x34aa15=function(_0x4df822){while(--_0x4df822){_0x31a955['push'](_0x31a955['shift']());}};_0x34aa15(++_0x145b94);}(_0x29d4,0x1a1));var _0x429d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x29d4[_0x5bd426];return _0x23a7eb;};'use strict';var ChatQueueEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatQueueEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatQueue:'+_0x4befb9,_0x1c55aa);ChatQueueEvents['on'](_0x4befb9,_0x9fc337);}};
\ No newline at end of file
index afa830b..e3fe717 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3b2994,_0x1aa113){var _0x1913b3=function(_0x238b67){while(--_0x238b67){_0x3b2994['push'](_0x3b2994['shift']());}};_0x1913b3(++_0x1aa113);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x540b0d,_0x37bf42){_0x540b0d=_0x540b0d-0x0;var _0x1e06d9=_0x3e74[_0x540b0d];return _0x1e06d9;};'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/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
index 1e2499a..660a967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa87c=['sequelize','exports','STRING','DATE','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa87c,0x135));var _0xca87=function(_0x21125f,_0x8079f8){_0x21125f=_0x21125f-0x0;var _0x2f421d=_0xa87c[_0x21125f];return _0x2f421d;};'use strict';var moment=require(_0xca87('0x0'));var Sequelize=require(_0xca87('0x1'));module[_0xca87('0x2')]={'uniqueid':{'type':Sequelize[_0xca87('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xca87('0x4')]},'leaveAt':{'type':Sequelize[_0xca87('0x4')]},'acceptAt':{'type':Sequelize[_0xca87('0x4')]},'exitAt':{'type':Sequelize[_0xca87('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2a8e=['STRING','DATE','moment','sequelize','exports'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0x2a8e,0x156));var _0xe2a8=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x2a8e[_0x5a636f];return _0x6a8cfb;};'use strict';var moment=require(_0xe2a8('0x0'));var Sequelize=require(_0xe2a8('0x1'));module[_0xe2a8('0x2')]={'uniqueid':{'type':Sequelize[_0xe2a8('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe2a8('0x4')]},'leaveAt':{'type':Sequelize[_0xe2a8('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe2a8('0x4')]},'reason':{'type':Sequelize[_0xe2a8('0x3')]}};
\ No newline at end of file
index a8b7ea7..9d5030d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0024=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','ChatQueueReport','rawAttributes','key','model','map','query','keys'];(function(_0x45f4da,_0x5e38d7){var _0x1b39a5=function(_0x410806){while(--_0x410806){_0x45f4da['push'](_0x45f4da['shift']());}};_0x1b39a5(++_0x5e38d7);}(_0x0024,0xa8));var _0x4002=function(_0x588fbf,_0x367c67){_0x588fbf=_0x588fbf-0x0;var _0x3d3de5=_0x0024[_0x588fbf];return _0x3d3de5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4002('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4002('0x1'));var rp=require('request-promise');var moment=require(_0x4002('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4002('0x3'));var path=require(_0x4002('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4002('0x5'));var fs=require('fs');var fs_extra=require(_0x4002('0x6'));var _=require(_0x4002('0x7'));var squel=require(_0x4002('0x8'));var crypto=require('crypto');var jsforce=require(_0x4002('0x9'));var deskjs=require(_0x4002('0xa'));var toCsv=require(_0x4002('0xb'));var querystring=require(_0x4002('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4002('0xd'));var qs=require(_0x4002('0xe'));var as=require(_0x4002('0xf'));var hardwareService=require(_0x4002('0x10'));var logger=require(_0x4002('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4002('0x12'));var db=require(_0x4002('0x13'))['db'];function respondWithStatusCode(_0x1607e1,_0x29705c){_0x29705c=_0x29705c||0xcc;return function(_0x51c3cf){if(_0x51c3cf){return _0x1607e1[_0x4002('0x14')](_0x29705c);}return _0x1607e1[_0x4002('0x15')](_0x29705c)[_0x4002('0x16')]();};}function respondWithResult(_0x2db141,_0x46d1c1){_0x46d1c1=_0x46d1c1||0xc8;return function(_0x50a1a8){if(_0x50a1a8){return _0x2db141[_0x4002('0x15')](_0x46d1c1)['json'](_0x50a1a8);}};}function respondWithFilteredResult(_0x2f512d,_0x9631cb){return function(_0x213c05){if(_0x213c05){var _0x5813ff=typeof _0x9631cb[_0x4002('0x17')]==='undefined'&&typeof _0x9631cb['limit']===_0x4002('0x18');var _0x3facc1=_0x213c05['count'];var _0x1b3401=_0x5813ff?0x0:_0x9631cb['offset'];var _0x553918=_0x5813ff?_0x213c05['count']:_0x9631cb[_0x4002('0x17')]+_0x9631cb[_0x4002('0x19')];var _0x283708;if(_0x553918>=_0x3facc1){_0x553918=_0x3facc1;_0x283708=0xc8;}else{_0x283708=0xce;}_0x2f512d[_0x4002('0x15')](_0x283708);return _0x2f512d['set'](_0x4002('0x1a'),_0x1b3401+'-'+_0x553918+'/'+_0x3facc1)[_0x4002('0x1b')](_0x213c05);}return null;};}function patchUpdates(_0x172317){return function(_0x48ac6f){try{jsonpatch[_0x4002('0x1c')](_0x48ac6f,_0x172317,!![]);}catch(_0x51b709){return BPromise[_0x4002('0x1d')](_0x51b709);}return _0x48ac6f[_0x4002('0x1e')]();};}function saveUpdates(_0x2bc0c4,_0x5f29cb){return function(_0x52add8){if(_0x52add8){return _0x52add8[_0x4002('0x1f')](_0x2bc0c4)[_0x4002('0x20')](function(_0x254b67){return _0x254b67;});}return null;};}function removeEntity(_0x4c0ed7,_0x468d6e){return function(_0x27732c){if(_0x27732c){return _0x27732c[_0x4002('0x21')]()[_0x4002('0x20')](function(){_0x4c0ed7[_0x4002('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3396d8,_0x1dfb81){return function(_0x385c35){if(!_0x385c35){_0x3396d8[_0x4002('0x14')](0x194);}return _0x385c35;};}function handleError(_0x31c601,_0x2087d5){_0x2087d5=_0x2087d5||0x1f4;return function(_0x55aca1){logger[_0x4002('0x22')](_0x55aca1[_0x4002('0x23')]);if(_0x55aca1['name']){delete _0x55aca1[_0x4002('0x24')];}_0x31c601[_0x4002('0x15')](_0x2087d5)['send'](_0x55aca1);};}exports[_0x4002('0x25')]=function(_0x278907,_0x227fc8){var _0x13a8f7={},_0x6e9b00={},_0x37ee79={'count':0x0,'rows':[]};var _0x153f1f=_['map'](db[_0x4002('0x26')][_0x4002('0x27')],function(_0x237704){return{'name':_0x237704['fieldName'],'type':_0x237704['type'][_0x4002('0x28')]};});_0x6e9b00[_0x4002('0x29')]=_[_0x4002('0x2a')](_0x153f1f,_0x4002('0x24'));_0x6e9b00[_0x4002('0x2b')]=_[_0x4002('0x2c')](_0x278907[_0x4002('0x2b')]);_0x6e9b00[_0x4002('0x2d')]=_[_0x4002('0x2e')](_0x6e9b00[_0x4002('0x29')],_0x6e9b00['query']);_0x13a8f7[_0x4002('0x2f')]=_[_0x4002('0x2e')](_0x6e9b00[_0x4002('0x29')],qs['fields'](_0x278907[_0x4002('0x2b')][_0x4002('0x30')]));_0x13a8f7[_0x4002('0x2f')]=_0x13a8f7['attributes'][_0x4002('0x31')]?_0x13a8f7[_0x4002('0x2f')]:_0x6e9b00[_0x4002('0x29')];if(!_0x278907[_0x4002('0x2b')][_0x4002('0x32')](_0x4002('0x33'))){_0x13a8f7[_0x4002('0x19')]=qs['limit'](_0x278907[_0x4002('0x2b')][_0x4002('0x19')]);_0x13a8f7['offset']=qs['offset'](_0x278907[_0x4002('0x2b')][_0x4002('0x17')]);}_0x13a8f7[_0x4002('0x34')]=qs[_0x4002('0x35')](_0x278907[_0x4002('0x2b')][_0x4002('0x35')]);_0x13a8f7[_0x4002('0x36')]=qs[_0x4002('0x2d')](_['pick'](_0x278907[_0x4002('0x2b')],_0x6e9b00[_0x4002('0x2d')]),_0x153f1f);if(_0x278907[_0x4002('0x2b')]['filter']){_0x13a8f7[_0x4002('0x36')]=_['merge'](_0x13a8f7[_0x4002('0x36')],{'$or':_['map'](_0x153f1f,function(_0x499bb0){if(_0x499bb0['type']!==_0x4002('0x37')){var _0x51d828={};_0x51d828[_0x499bb0['name']]={'$like':'%'+_0x278907['query'][_0x4002('0x38')]+'%'};return _0x51d828;}})});}_0x13a8f7=_[_0x4002('0x39')]({},_0x13a8f7,_0x278907[_0x4002('0x3a')]);var _0x5d65c1={'where':_0x13a8f7[_0x4002('0x36')]};return db[_0x4002('0x26')][_0x4002('0x3b')](_0x5d65c1)[_0x4002('0x20')](function(_0x14f2f1){_0x37ee79[_0x4002('0x3b')]=_0x14f2f1;if(_0x278907['query'][_0x4002('0x3c')]){_0x13a8f7[_0x4002('0x3d')]=[{'all':!![]}];}return db[_0x4002('0x26')][_0x4002('0x3e')](_0x13a8f7);})[_0x4002('0x20')](function(_0x579e24){_0x37ee79[_0x4002('0x3f')]=_0x579e24;return _0x37ee79;})['then'](respondWithFilteredResult(_0x227fc8,_0x13a8f7))[_0x4002('0x40')](handleError(_0x227fc8,null));};exports[_0x4002('0x41')]=function(_0x488875,_0x5810b4){var _0x39dfba={'raw':!![],'where':{'id':_0x488875['params']['id']}},_0xb0bb62={};_0xb0bb62['model']=_[_0x4002('0x2c')](db[_0x4002('0x26')]['rawAttributes']);_0xb0bb62[_0x4002('0x2b')]=_[_0x4002('0x2c')](_0x488875[_0x4002('0x2b')]);_0xb0bb62[_0x4002('0x2d')]=_[_0x4002('0x2e')](_0xb0bb62[_0x4002('0x29')],_0xb0bb62[_0x4002('0x2b')]);_0x39dfba[_0x4002('0x2f')]=_['intersection'](_0xb0bb62['model'],qs['fields'](_0x488875[_0x4002('0x2b')]['fields']));_0x39dfba[_0x4002('0x2f')]=_0x39dfba['attributes'][_0x4002('0x31')]?_0x39dfba[_0x4002('0x2f')]:_0xb0bb62[_0x4002('0x29')];if(_0x488875['query'][_0x4002('0x3c')]){_0x39dfba['include']=[{'all':!![]}];}_0x39dfba=_['merge']({},_0x39dfba,_0x488875[_0x4002('0x3a')]);return db[_0x4002('0x26')][_0x4002('0x42')](_0x39dfba)[_0x4002('0x20')](handleEntityNotFound(_0x5810b4,null))['then'](respondWithResult(_0x5810b4,null))['catch'](handleError(_0x5810b4,null));};exports[_0x4002('0x43')]=function(_0x27bbb2,_0x424f9b){return db['ChatQueueReport'][_0x4002('0x43')](_0x27bbb2['body'],{})[_0x4002('0x20')](respondWithResult(_0x424f9b,0xc9))['catch'](handleError(_0x424f9b,null));};exports['update']=function(_0x25d4db,_0x2c95e2){if(_0x25d4db['body']['id']){delete _0x25d4db[_0x4002('0x44')]['id'];}return db[_0x4002('0x26')][_0x4002('0x42')]({'where':{'id':_0x25d4db[_0x4002('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c95e2,null))['then'](saveUpdates(_0x25d4db[_0x4002('0x44')],null))['then'](respondWithResult(_0x2c95e2,null))['catch'](handleError(_0x2c95e2,null));};exports['destroy']=function(_0xe374cb,_0x1ac24b){return db['ChatQueueReport'][_0x4002('0x42')]({'where':{'id':_0xe374cb[_0x4002('0x45')]['id']}})[_0x4002('0x20')](handleEntityNotFound(_0x1ac24b,null))[_0x4002('0x20')](removeEntity(_0x1ac24b,null))[_0x4002('0x40')](handleError(_0x1ac24b,null));};exports[_0x4002('0x46')]=function(_0x500af3,_0x450660){return db[_0x4002('0x26')]['describe']()[_0x4002('0x20')](respondWithResult(_0x450660,null))[_0x4002('0x40')](handleError(_0x450660,null));};
\ No newline at end of file
+var _0x2cd0=['status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count'];(function(_0x5b8b3d,_0x2200f0){var _0x47d2c7=function(_0x12faa6){while(--_0x12faa6){_0x5b8b3d['push'](_0x5b8b3d['shift']());}};_0x47d2c7(++_0x2200f0);}(_0x2cd0,0x10f));var _0x02cd=function(_0xfd5211,_0x490686){_0xfd5211=_0xfd5211-0x0;var _0x19797d=_0x2cd0[_0xfd5211];return _0x19797d;};'use strict';var emlformat=require(_0x02cd('0x0'));var rimraf=require(_0x02cd('0x1'));var zipdir=require(_0x02cd('0x2'));var jsonpatch=require(_0x02cd('0x3'));var rp=require(_0x02cd('0x4'));var moment=require(_0x02cd('0x5'));var BPromise=require(_0x02cd('0x6'));var Mustache=require(_0x02cd('0x7'));var util=require('util');var path=require(_0x02cd('0x8'));var sox=require(_0x02cd('0x9'));var csv=require(_0x02cd('0xa'));var ejs=require(_0x02cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02cd('0xc'));var squel=require(_0x02cd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02cd('0xa'));var querystring=require(_0x02cd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02cd('0xf'));var qs=require(_0x02cd('0x10'));var as=require(_0x02cd('0x11'));var hardwareService=require(_0x02cd('0x12'));var logger=require(_0x02cd('0x13'))(_0x02cd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x02cd('0x15'));var db=require(_0x02cd('0x16'))['db'];function respondWithStatusCode(_0x1bce6c,_0x1c5e82){_0x1c5e82=_0x1c5e82||0xcc;return function(_0x111dc6){if(_0x111dc6){return _0x1bce6c[_0x02cd('0x17')](_0x1c5e82);}return _0x1bce6c['status'](_0x1c5e82)[_0x02cd('0x18')]();};}function respondWithResult(_0x52bbe6,_0x203e9d){_0x203e9d=_0x203e9d||0xc8;return function(_0x583620){if(_0x583620){return _0x52bbe6['status'](_0x203e9d)['json'](_0x583620);}};}function respondWithFilteredResult(_0x24043b,_0x2cda2c){return function(_0x308ee3){if(_0x308ee3){var _0x15b6fe=typeof _0x2cda2c[_0x02cd('0x19')]===_0x02cd('0x1a')&&typeof _0x2cda2c[_0x02cd('0x1b')]===_0x02cd('0x1a');var _0xb4115c=_0x308ee3[_0x02cd('0x1c')];var _0x18c522=_0x15b6fe?0x0:_0x2cda2c[_0x02cd('0x19')];var _0xb57985=_0x15b6fe?_0x308ee3[_0x02cd('0x1c')]:_0x2cda2c[_0x02cd('0x19')]+_0x2cda2c[_0x02cd('0x1b')];var _0x4f448b;if(_0xb57985>=_0xb4115c){_0xb57985=_0xb4115c;_0x4f448b=0xc8;}else{_0x4f448b=0xce;}_0x24043b[_0x02cd('0x1d')](_0x4f448b);return _0x24043b[_0x02cd('0x1e')](_0x02cd('0x1f'),_0x18c522+'-'+_0xb57985+'/'+_0xb4115c)[_0x02cd('0x20')](_0x308ee3);}return null;};}function patchUpdates(_0x822204){return function(_0x33fb48){try{jsonpatch[_0x02cd('0x21')](_0x33fb48,_0x822204,!![]);}catch(_0xd6cc59){return BPromise[_0x02cd('0x22')](_0xd6cc59);}return _0x33fb48[_0x02cd('0x23')]();};}function saveUpdates(_0x1736be,_0x54453c){return function(_0x2b9809){if(_0x2b9809){return _0x2b9809[_0x02cd('0x24')](_0x1736be)[_0x02cd('0x25')](function(_0x2fb5af){return _0x2fb5af;});}return null;};}function removeEntity(_0x47dc25,_0x28f678){return function(_0x4e127f){if(_0x4e127f){return _0x4e127f[_0x02cd('0x26')]()[_0x02cd('0x25')](function(){_0x47dc25[_0x02cd('0x1d')](0xcc)[_0x02cd('0x18')]();});}};}function handleEntityNotFound(_0x40e7fa,_0x194c7e){return function(_0x3fd0b0){if(!_0x3fd0b0){_0x40e7fa['sendStatus'](0x194);}return _0x3fd0b0;};}function handleError(_0x134961,_0x1fce0c){_0x1fce0c=_0x1fce0c||0x1f4;return function(_0x51d6a2){logger[_0x02cd('0x27')](_0x51d6a2['stack']);if(_0x51d6a2[_0x02cd('0x28')]){delete _0x51d6a2[_0x02cd('0x28')];}_0x134961[_0x02cd('0x1d')](_0x1fce0c)[_0x02cd('0x29')](_0x51d6a2);};}exports[_0x02cd('0x2a')]=function(_0x205ee7,_0x16872f){var _0x256cb5={},_0x4adfb2={},_0x55c97b={'count':0x0,'rows':[]};var _0x87feaf=_[_0x02cd('0x2b')](db[_0x02cd('0x2c')][_0x02cd('0x2d')],function(_0x5f5283){return{'name':_0x5f5283['fieldName'],'type':_0x5f5283[_0x02cd('0x2e')][_0x02cd('0x2f')]};});_0x4adfb2[_0x02cd('0x30')]=_['map'](_0x87feaf,_0x02cd('0x28'));_0x4adfb2['query']=_[_0x02cd('0x31')](_0x205ee7['query']);_0x4adfb2[_0x02cd('0x32')]=_['intersection'](_0x4adfb2[_0x02cd('0x30')],_0x4adfb2[_0x02cd('0x33')]);_0x256cb5[_0x02cd('0x34')]=_[_0x02cd('0x35')](_0x4adfb2[_0x02cd('0x30')],qs['fields'](_0x205ee7[_0x02cd('0x33')]['fields']));_0x256cb5['attributes']=_0x256cb5[_0x02cd('0x34')][_0x02cd('0x36')]?_0x256cb5[_0x02cd('0x34')]:_0x4adfb2[_0x02cd('0x30')];if(!_0x205ee7['query']['hasOwnProperty'](_0x02cd('0x37'))){_0x256cb5[_0x02cd('0x1b')]=qs[_0x02cd('0x1b')](_0x205ee7[_0x02cd('0x33')][_0x02cd('0x1b')]);_0x256cb5[_0x02cd('0x19')]=qs[_0x02cd('0x19')](_0x205ee7['query'][_0x02cd('0x19')]);}_0x256cb5[_0x02cd('0x38')]=qs[_0x02cd('0x39')](_0x205ee7[_0x02cd('0x33')][_0x02cd('0x39')]);_0x256cb5[_0x02cd('0x3a')]=qs[_0x02cd('0x32')](_[_0x02cd('0x3b')](_0x205ee7[_0x02cd('0x33')],_0x4adfb2['filters']),_0x87feaf);if(_0x205ee7[_0x02cd('0x33')][_0x02cd('0x3c')]){_0x256cb5[_0x02cd('0x3a')]=_[_0x02cd('0x3d')](_0x256cb5[_0x02cd('0x3a')],{'$or':_[_0x02cd('0x2b')](_0x87feaf,function(_0x386cfa){if(_0x386cfa[_0x02cd('0x2e')]!==_0x02cd('0x3e')){var _0x16a1d3={};_0x16a1d3[_0x386cfa[_0x02cd('0x28')]]={'$like':'%'+_0x205ee7[_0x02cd('0x33')]['filter']+'%'};return _0x16a1d3;}})});}_0x256cb5=_[_0x02cd('0x3d')]({},_0x256cb5,_0x205ee7[_0x02cd('0x3f')]);var _0x4f185a={'where':_0x256cb5[_0x02cd('0x3a')]};return db['ChatQueueReport'][_0x02cd('0x1c')](_0x4f185a)[_0x02cd('0x25')](function(_0x9b65f4){_0x55c97b[_0x02cd('0x1c')]=_0x9b65f4;if(_0x205ee7[_0x02cd('0x33')][_0x02cd('0x40')]){_0x256cb5[_0x02cd('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x02cd('0x42')](_0x256cb5);})[_0x02cd('0x25')](function(_0x248f84){_0x55c97b[_0x02cd('0x43')]=_0x248f84;return _0x55c97b;})[_0x02cd('0x25')](respondWithFilteredResult(_0x16872f,_0x256cb5))['catch'](handleError(_0x16872f,null));};exports[_0x02cd('0x44')]=function(_0x180198,_0x5bae08){var _0x1abc13={'raw':!![],'where':{'id':_0x180198[_0x02cd('0x45')]['id']}},_0xdf71cf={};_0xdf71cf[_0x02cd('0x30')]=_[_0x02cd('0x31')](db['ChatQueueReport'][_0x02cd('0x2d')]);_0xdf71cf['query']=_[_0x02cd('0x31')](_0x180198[_0x02cd('0x33')]);_0xdf71cf[_0x02cd('0x32')]=_[_0x02cd('0x35')](_0xdf71cf['model'],_0xdf71cf[_0x02cd('0x33')]);_0x1abc13[_0x02cd('0x34')]=_[_0x02cd('0x35')](_0xdf71cf[_0x02cd('0x30')],qs[_0x02cd('0x46')](_0x180198[_0x02cd('0x33')]['fields']));_0x1abc13[_0x02cd('0x34')]=_0x1abc13[_0x02cd('0x34')][_0x02cd('0x36')]?_0x1abc13['attributes']:_0xdf71cf[_0x02cd('0x30')];if(_0x180198[_0x02cd('0x33')]['includeAll']){_0x1abc13['include']=[{'all':!![]}];}_0x1abc13=_[_0x02cd('0x3d')]({},_0x1abc13,_0x180198[_0x02cd('0x3f')]);return db[_0x02cd('0x2c')][_0x02cd('0x47')](_0x1abc13)[_0x02cd('0x25')](handleEntityNotFound(_0x5bae08,null))['then'](respondWithResult(_0x5bae08,null))[_0x02cd('0x48')](handleError(_0x5bae08,null));};exports['create']=function(_0x424c75,_0x1d91ca){return db[_0x02cd('0x2c')]['create'](_0x424c75[_0x02cd('0x49')],{})[_0x02cd('0x25')](respondWithResult(_0x1d91ca,0xc9))[_0x02cd('0x48')](handleError(_0x1d91ca,null));};exports[_0x02cd('0x24')]=function(_0x2be2f2,_0x25d6b9){if(_0x2be2f2[_0x02cd('0x49')]['id']){delete _0x2be2f2[_0x02cd('0x49')]['id'];}return db[_0x02cd('0x2c')][_0x02cd('0x47')]({'where':{'id':_0x2be2f2['params']['id']}})[_0x02cd('0x25')](handleEntityNotFound(_0x25d6b9,null))[_0x02cd('0x25')](saveUpdates(_0x2be2f2[_0x02cd('0x49')],null))[_0x02cd('0x25')](respondWithResult(_0x25d6b9,null))[_0x02cd('0x48')](handleError(_0x25d6b9,null));};exports['destroy']=function(_0x4dbb43,_0x203066){return db['ChatQueueReport'][_0x02cd('0x47')]({'where':{'id':_0x4dbb43[_0x02cd('0x45')]['id']}})[_0x02cd('0x25')](handleEntityNotFound(_0x203066,null))[_0x02cd('0x25')](removeEntity(_0x203066,null))['catch'](handleError(_0x203066,null));};exports[_0x02cd('0x4a')]=function(_0x10b1c1,_0x447f84){return db[_0x02cd('0x2c')]['describe']()[_0x02cd('0x25')](respondWithResult(_0x447f84,null))['catch'](handleError(_0x447f84,null));};
\ No newline at end of file
index 4cd4202..ac92809 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index c062740..d7a67fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7200=['where','attributes','limit','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7200,0x1a8));var _0x0720=function(_0x5926bd,_0x5c8ddf){_0x5926bd=_0x5926bd-0x0;var _0x2b1633=_0x7200[_0x5926bd];return _0x2b1633;};'use strict';var _=require(_0x0720('0x0'));var util=require('util');var moment=require(_0x0720('0x1'));var BPromise=require('bluebird');var rs=require(_0x0720('0x2'));var fs=require('fs');var Redis=require(_0x0720('0x3'));var db=require(_0x0720('0x4'))['db'];var utils=require(_0x0720('0x5'));var logger=require('../../config/logger')(_0x0720('0x6'));var config=require(_0x0720('0x7'));var jayson=require(_0x0720('0x8'));var client=jayson[_0x0720('0x9')][_0x0720('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x322d9f,_0x58b0e8,_0x361507){return new BPromise(function(_0x3327c3,_0x18ccdf){return client[_0x0720('0xb')](_0x322d9f,_0x361507)[_0x0720('0xc')](function(_0x280e0f){logger[_0x0720('0xd')](_0x0720('0xe'),_0x58b0e8,'request\x20sent');logger['debug'](_0x0720('0xf'),_0x58b0e8,'request\x20sent',JSON[_0x0720('0x10')](_0x280e0f));if(_0x280e0f[_0x0720('0x11')]){if(_0x280e0f[_0x0720('0x11')][_0x0720('0x12')]===0x1f4){logger[_0x0720('0x11')](_0x0720('0xe'),_0x58b0e8,_0x280e0f[_0x0720('0x11')][_0x0720('0x13')]);return _0x18ccdf(_0x280e0f[_0x0720('0x11')][_0x0720('0x13')]);}logger[_0x0720('0x11')](_0x0720('0xe'),_0x58b0e8,_0x280e0f[_0x0720('0x11')][_0x0720('0x13')]);return _0x3327c3(_0x280e0f[_0x0720('0x11')][_0x0720('0x13')]);}else{logger[_0x0720('0xd')](_0x0720('0xe'),_0x58b0e8,_0x0720('0x14'));_0x3327c3(_0x280e0f[_0x0720('0x15')]['message']);}})[_0x0720('0x16')](function(_0x3465ed){logger[_0x0720('0x11')](_0x0720('0xe'),_0x58b0e8,_0x3465ed);_0x18ccdf(_0x3465ed);});});}exports[_0x0720('0x17')]=function(_0x1a1d5c){var _0x10505a=this;return new Promise(function(_0x126a7d,_0x26b8b9){return db[_0x0720('0x18')][_0x0720('0x19')](_0x1a1d5c[_0x0720('0x1a')],{'raw':_0x1a1d5c[_0x0720('0x1b')]?_0x1a1d5c[_0x0720('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0720('0xc')](function(_0x179fef){logger['info'](_0x0720('0x17'),_0x1a1d5c);logger['debug'](_0x0720('0x17'),_0x1a1d5c,JSON['stringify'](_0x179fef));_0x126a7d(_0x179fef);})[_0x0720('0x16')](function(_0x1b5e11){logger[_0x0720('0x11')](_0x0720('0x17'),_0x1b5e11[_0x0720('0x13')],_0x1a1d5c);_0x26b8b9(_0x10505a['error'](0x1f4,_0x1b5e11[_0x0720('0x13')]));});});};exports[_0x0720('0x1c')]=function(_0x13d4e2){var _0x1c47c8=this;return new Promise(function(_0x4d8cbf,_0x322f60){return db['ChatQueueReport'][_0x0720('0x1d')](_0x13d4e2[_0x0720('0x1a')],{'raw':_0x13d4e2[_0x0720('0x1b')]?_0x13d4e2[_0x0720('0x1b')][_0x0720('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13d4e2[_0x0720('0x1b')]?_0x13d4e2[_0x0720('0x1b')][_0x0720('0x1f')]||null:null,'attributes':_0x13d4e2['options']?_0x13d4e2['options'][_0x0720('0x20')]||null:null,'limit':_0x13d4e2['options']?_0x13d4e2[_0x0720('0x1b')][_0x0720('0x21')]||null:null})[_0x0720('0xc')](function(_0x38ab22){logger[_0x0720('0xd')](_0x0720('0x1c'),_0x13d4e2);logger[_0x0720('0x22')](_0x0720('0x1c'),_0x13d4e2,JSON[_0x0720('0x10')](_0x38ab22));_0x4d8cbf(_0x38ab22);})[_0x0720('0x16')](function(_0xb54198){logger[_0x0720('0x11')](_0x0720('0x1c'),_0xb54198[_0x0720('0x13')],_0x13d4e2);_0x322f60(_0x1c47c8[_0x0720('0x11')](0x1f4,_0xb54198[_0x0720('0x13')]));});});};
\ No newline at end of file
+var _0x38fb=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','then','info'];(function(_0x55eedf,_0x343e2d){var _0x27c2a0=function(_0x3a1f57){while(--_0x3a1f57){_0x55eedf['push'](_0x55eedf['shift']());}};_0x27c2a0(++_0x343e2d);}(_0x38fb,0x74));var _0xb38f=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x38fb[_0x2891d1];return _0x486948;};'use strict';var _=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var moment=require(_0xb38f('0x2'));var BPromise=require(_0xb38f('0x3'));var rs=require(_0xb38f('0x4'));var fs=require('fs');var Redis=require(_0xb38f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb38f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb38f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb38f('0x8')][_0xb38f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ab33,_0x528bae,_0x4f5164){return new BPromise(function(_0x158bad,_0x32d37f){return client['request'](_0x50ab33,_0x4f5164)[_0xb38f('0xa')](function(_0x4bfbac){logger[_0xb38f('0xb')](_0xb38f('0xc'),_0x528bae,_0xb38f('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x528bae,'request\x20sent',JSON[_0xb38f('0xe')](_0x4bfbac));if(_0x4bfbac[_0xb38f('0xf')]){if(_0x4bfbac[_0xb38f('0xf')][_0xb38f('0x10')]===0x1f4){logger['error'](_0xb38f('0xc'),_0x528bae,_0x4bfbac['error'][_0xb38f('0x11')]);return _0x32d37f(_0x4bfbac['error'][_0xb38f('0x11')]);}logger[_0xb38f('0xf')](_0xb38f('0xc'),_0x528bae,_0x4bfbac[_0xb38f('0xf')][_0xb38f('0x11')]);return _0x158bad(_0x4bfbac[_0xb38f('0xf')][_0xb38f('0x11')]);}else{logger[_0xb38f('0xb')](_0xb38f('0xc'),_0x528bae,_0xb38f('0xd'));_0x158bad(_0x4bfbac[_0xb38f('0x12')][_0xb38f('0x11')]);}})[_0xb38f('0x13')](function(_0x47ecf5){logger[_0xb38f('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x528bae,_0x47ecf5);_0x32d37f(_0x47ecf5);});});}exports['CreateChatQueueReport']=function(_0x25dc8e){var _0x15c334=this;return new Promise(function(_0xc82bed,_0x19ce6d){return db[_0xb38f('0x14')][_0xb38f('0x15')](_0x25dc8e[_0xb38f('0x16')],{'raw':_0x25dc8e[_0xb38f('0x17')]?_0x25dc8e[_0xb38f('0x17')][_0xb38f('0x18')]===undefined?!![]:![]:!![]})[_0xb38f('0xa')](function(_0x3a6f29){logger[_0xb38f('0xb')](_0xb38f('0x19'),_0x25dc8e);logger[_0xb38f('0x1a')](_0xb38f('0x19'),_0x25dc8e,JSON['stringify'](_0x3a6f29));_0xc82bed(_0x3a6f29);})['catch'](function(_0x5ac11f){logger[_0xb38f('0xf')](_0xb38f('0x19'),_0x5ac11f[_0xb38f('0x11')],_0x25dc8e);_0x19ce6d(_0x15c334[_0xb38f('0xf')](0x1f4,_0x5ac11f[_0xb38f('0x11')]));});});};exports[_0xb38f('0x1b')]=function(_0x41881b){var _0x739b7f=this;return new Promise(function(_0x5823fa,_0x32c12a){return db[_0xb38f('0x14')][_0xb38f('0x1c')](_0x41881b[_0xb38f('0x16')],{'raw':_0x41881b[_0xb38f('0x17')]?_0x41881b[_0xb38f('0x17')][_0xb38f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41881b[_0xb38f('0x17')]?_0x41881b[_0xb38f('0x17')][_0xb38f('0x1d')]||null:null,'attributes':_0x41881b[_0xb38f('0x17')]?_0x41881b[_0xb38f('0x17')][_0xb38f('0x1e')]||null:null,'limit':_0x41881b[_0xb38f('0x17')]?_0x41881b['options'][_0xb38f('0x1f')]||null:null})[_0xb38f('0xa')](function(_0x2628bc){logger[_0xb38f('0xb')](_0xb38f('0x1b'),_0x41881b);logger[_0xb38f('0x1a')]('UpdateChatQueueReport',_0x41881b,JSON[_0xb38f('0xe')](_0x2628bc));_0x5823fa(_0x2628bc);})[_0xb38f('0x13')](function(_0x3d12fe){logger['error'](_0xb38f('0x1b'),_0x3d12fe[_0xb38f('0x11')],_0x41881b);_0x32c12a(_0x739b7f['error'](0x1f4,_0x3d12fe[_0xb38f('0x11')]));});});};
\ No newline at end of file
index 4055413..efaeb80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ea=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x464d78,_0x8c1e5e){var _0x1b4e38=function(_0x4357e6){while(--_0x4357e6){_0x464d78['push'](_0x464d78['shift']());}};_0x1b4e38(++_0x8c1e5e);}(_0x60ea,0x163));var _0xa60e=function(_0x3d183c,_0x40c6b8){_0x3d183c=_0x3d183c-0x0;var _0x276a68=_0x60ea[_0x3d183c];return _0x276a68;};'use strict';var multer=require('multer');var util=require(_0xa60e('0x0'));var path=require(_0xa60e('0x1'));var timeout=require(_0xa60e('0x2'));var express=require('express');var router=express[_0xa60e('0x3')]();var fs_extra=require(_0xa60e('0x4'));var auth=require(_0xa60e('0x5'));var interaction=require(_0xa60e('0x6'));var config=require(_0xa60e('0x7'));var controller=require(_0xa60e('0x8'));router[_0xa60e('0x9')]('/',auth[_0xa60e('0xa')](),controller['index']);router['get'](_0xa60e('0xb'),auth[_0xa60e('0xa')](),controller[_0xa60e('0xc')]);router[_0xa60e('0x9')](_0xa60e('0xd'),auth[_0xa60e('0xa')](),controller[_0xa60e('0xe')]);router[_0xa60e('0xf')]('/',auth[_0xa60e('0xa')](),controller[_0xa60e('0x10')]);router['put']('/:id',auth[_0xa60e('0xa')](),controller[_0xa60e('0x11')]);router[_0xa60e('0x12')]('/:id',auth[_0xa60e('0xa')](),controller['destroy']);module[_0xa60e('0x13')]=router;
\ No newline at end of file
+var _0x1cdf=['delete','/:id','destroy','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','describe','get','isAuthenticated','show','post','create','put'];(function(_0x3e299b,_0x66d53b){var _0x5475f9=function(_0x45ebe8){while(--_0x45ebe8){_0x3e299b['push'](_0x3e299b['shift']());}};_0x5475f9(++_0x66d53b);}(_0x1cdf,0x16c));var _0xf1cd=function(_0x3d8483,_0x3823a3){_0x3d8483=_0x3d8483-0x0;var _0x32b7f4=_0x1cdf[_0x3d8483];return _0x32b7f4;};'use strict';var multer=require(_0xf1cd('0x0'));var util=require('util');var path=require(_0xf1cd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf1cd('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf1cd('0x3'));var config=require(_0xf1cd('0x4'));var controller=require(_0xf1cd('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf1cd('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf1cd('0x7')]);router[_0xf1cd('0x8')]('/:id',auth[_0xf1cd('0x9')](),controller[_0xf1cd('0xa')]);router[_0xf1cd('0xb')]('/',auth[_0xf1cd('0x9')](),controller[_0xf1cd('0xc')]);router[_0xf1cd('0xd')]('/:id',auth[_0xf1cd('0x9')](),controller['update']);router[_0xf1cd('0xe')](_0xf1cd('0xf'),auth[_0xf1cd('0x9')](),controller[_0xf1cd('0x10')]);module[_0xf1cd('0x11')]=router;
\ No newline at end of file
index f15e199..c503ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x15cb42,_0x36ecf0){var _0x570c75=function(_0x534394){while(--_0x534394){_0x15cb42['push'](_0x15cb42['shift']());}};_0x570c75(++_0x36ecf0);}(_0xedd9,0xfc));var _0x9edd=function(_0x84172a,_0x237dc9){_0x84172a=_0x84172a-0x0;var _0x5db33d=_0xedd9[_0x84172a];return _0x5db33d;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3edeba,_0x1bac30){var _0x12e9b7=function(_0x2a610d){while(--_0x2a610d){_0x3edeba['push'](_0x3edeba['shift']());}};_0x12e9b7(++_0x1bac30);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
index 128a894..2fcc022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83f2=['catch','rawAttributes','length','merge','create','body','params','find','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','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','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows'];(function(_0x20792f,_0x439203){var _0x5de660=function(_0x218fa9){while(--_0x218fa9){_0x20792f['push'](_0x20792f['shift']());}};_0x5de660(++_0x439203);}(_0x83f2,0xa1));var _0x283f=function(_0x3d6217,_0x178c81){_0x3d6217=_0x3d6217-0x0;var _0x3671be=_0x83f2[_0x3d6217];return _0x3671be;};'use strict';var emlformat=require(_0x283f('0x0'));var rimraf=require(_0x283f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x283f('0x2'));var rp=require(_0x283f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x283f('0x4'));var util=require('util');var path=require(_0x283f('0x5'));var sox=require('sox');var csv=require(_0x283f('0x6'));var ejs=require(_0x283f('0x7'));var fs=require('fs');var fs_extra=require(_0x283f('0x8'));var _=require('lodash');var squel=require(_0x283f('0x9'));var crypto=require(_0x283f('0xa'));var jsforce=require(_0x283f('0xb'));var deskjs=require(_0x283f('0xc'));var toCsv=require(_0x283f('0x6'));var querystring=require('querystring');var Papa=require(_0x283f('0xd'));var Redis=require(_0x283f('0xe'));var authService=require(_0x283f('0xf'));var qs=require(_0x283f('0x10'));var as=require(_0x283f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x283f('0x12'))(_0x283f('0x13'));var utils=require(_0x283f('0x14'));var config=require(_0x283f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x283f('0x16'))['db'];function respondWithStatusCode(_0x3d1832,_0x2ff912){_0x2ff912=_0x2ff912||0xcc;return function(_0x44636e){if(_0x44636e){return _0x3d1832[_0x283f('0x17')](_0x2ff912);}return _0x3d1832[_0x283f('0x18')](_0x2ff912)[_0x283f('0x19')]();};}function respondWithResult(_0x40b0f2,_0x5aec6a){_0x5aec6a=_0x5aec6a||0xc8;return function(_0x2aaaad){if(_0x2aaaad){return _0x40b0f2['status'](_0x5aec6a)[_0x283f('0x1a')](_0x2aaaad);}};}function respondWithFilteredResult(_0x124f80,_0x507a2e){return function(_0x12d7f2){if(_0x12d7f2){var _0x69e659=typeof _0x507a2e[_0x283f('0x1b')]===_0x283f('0x1c')&&typeof _0x507a2e['limit']===_0x283f('0x1c');var _0xa88b98=_0x12d7f2[_0x283f('0x1d')];var _0x302d1b=_0x69e659?0x0:_0x507a2e['offset'];var _0x6ad1b=_0x69e659?_0x12d7f2[_0x283f('0x1d')]:_0x507a2e[_0x283f('0x1b')]+_0x507a2e[_0x283f('0x1e')];var _0x59917f;if(_0x6ad1b>=_0xa88b98){_0x6ad1b=_0xa88b98;_0x59917f=0xc8;}else{_0x59917f=0xce;}_0x124f80[_0x283f('0x18')](_0x59917f);return _0x124f80[_0x283f('0x1f')](_0x283f('0x20'),_0x302d1b+'-'+_0x6ad1b+'/'+_0xa88b98)[_0x283f('0x1a')](_0x12d7f2);}return null;};}function patchUpdates(_0x4385bf){return function(_0x1bca75){try{jsonpatch[_0x283f('0x21')](_0x1bca75,_0x4385bf,!![]);}catch(_0x246942){return BPromise[_0x283f('0x22')](_0x246942);}return _0x1bca75['save']();};}function saveUpdates(_0x470da,_0x157cdf){return function(_0x2dda33){if(_0x2dda33){return _0x2dda33[_0x283f('0x23')](_0x470da)[_0x283f('0x24')](function(_0x3eb5c8){return _0x3eb5c8;});}return null;};}function removeEntity(_0x1fbfdd,_0xc0c14d){return function(_0x51455d){if(_0x51455d){return _0x51455d[_0x283f('0x25')]()[_0x283f('0x24')](function(){_0x1fbfdd[_0x283f('0x18')](0xcc)[_0x283f('0x19')]();});}};}function handleEntityNotFound(_0x5cddc2,_0x408aef){return function(_0x3c583d){if(!_0x3c583d){_0x5cddc2[_0x283f('0x17')](0x194);}return _0x3c583d;};}function handleError(_0x8781c2,_0x5eaf2e){_0x5eaf2e=_0x5eaf2e||0x1f4;return function(_0x2b76df){logger[_0x283f('0x26')](_0x2b76df[_0x283f('0x27')]);if(_0x2b76df[_0x283f('0x28')]){delete _0x2b76df['name'];}_0x8781c2[_0x283f('0x18')](_0x5eaf2e)[_0x283f('0x29')](_0x2b76df);};}exports[_0x283f('0x2a')]=function(_0x3999da,_0x344178){var _0x1a616c={},_0x516b6d={},_0x43ccfa={'count':0x0,'rows':[]};var _0x135bc5=_[_0x283f('0x2b')](db[_0x283f('0x2c')]['rawAttributes'],function(_0x4ce541){return{'name':_0x4ce541[_0x283f('0x2d')],'type':_0x4ce541[_0x283f('0x2e')][_0x283f('0x2f')]};});_0x516b6d['model']=_['map'](_0x135bc5,'name');_0x516b6d[_0x283f('0x30')]=_[_0x283f('0x31')](_0x3999da['query']);_0x516b6d[_0x283f('0x32')]=_['intersection'](_0x516b6d[_0x283f('0x33')],_0x516b6d[_0x283f('0x30')]);_0x1a616c['attributes']=_[_0x283f('0x34')](_0x516b6d[_0x283f('0x33')],qs[_0x283f('0x35')](_0x3999da['query']['fields']));_0x1a616c[_0x283f('0x36')]=_0x1a616c['attributes']['length']?_0x1a616c['attributes']:_0x516b6d['model'];if(!_0x3999da[_0x283f('0x30')][_0x283f('0x37')](_0x283f('0x38'))){_0x1a616c[_0x283f('0x1e')]=qs['limit'](_0x3999da['query']['limit']);_0x1a616c['offset']=qs[_0x283f('0x1b')](_0x3999da[_0x283f('0x30')][_0x283f('0x1b')]);}_0x1a616c[_0x283f('0x39')]=qs[_0x283f('0x3a')](_0x3999da[_0x283f('0x30')][_0x283f('0x3a')]);_0x1a616c['where']=qs[_0x283f('0x32')](_[_0x283f('0x3b')](_0x3999da[_0x283f('0x30')],_0x516b6d['filters']),_0x135bc5);if(_0x3999da[_0x283f('0x30')][_0x283f('0x3c')]){_0x1a616c['where']=_['merge'](_0x1a616c[_0x283f('0x3d')],{'$or':_[_0x283f('0x2b')](_0x135bc5,function(_0x1e9fce){if(_0x1e9fce[_0x283f('0x2e')]!==_0x283f('0x3e')){var _0x4d92f7={};_0x4d92f7[_0x1e9fce[_0x283f('0x28')]]={'$like':'%'+_0x3999da[_0x283f('0x30')]['filter']+'%'};return _0x4d92f7;}})});}_0x1a616c=_['merge']({},_0x1a616c,_0x3999da[_0x283f('0x3f')]);var _0x186fdb={'where':_0x1a616c['where']};return db[_0x283f('0x2c')]['count'](_0x186fdb)[_0x283f('0x24')](function(_0x296b08){_0x43ccfa[_0x283f('0x1d')]=_0x296b08;if(_0x3999da[_0x283f('0x30')][_0x283f('0x40')]){_0x1a616c[_0x283f('0x41')]=[{'all':!![]}];}return db[_0x283f('0x2c')]['findAll'](_0x1a616c);})['then'](function(_0x51a7f3){_0x43ccfa[_0x283f('0x42')]=_0x51a7f3;return _0x43ccfa;})[_0x283f('0x24')](respondWithFilteredResult(_0x344178,_0x1a616c))[_0x283f('0x43')](handleError(_0x344178,null));};exports['show']=function(_0x2129c0,_0x471a7e){var _0x5d1866={'raw':!![],'where':{'id':_0x2129c0['params']['id']}},_0x3474ab={};_0x3474ab[_0x283f('0x33')]=_[_0x283f('0x31')](db['ChatTransferReport'][_0x283f('0x44')]);_0x3474ab[_0x283f('0x30')]=_[_0x283f('0x31')](_0x2129c0[_0x283f('0x30')]);_0x3474ab[_0x283f('0x32')]=_[_0x283f('0x34')](_0x3474ab[_0x283f('0x33')],_0x3474ab['query']);_0x5d1866[_0x283f('0x36')]=_['intersection'](_0x3474ab[_0x283f('0x33')],qs[_0x283f('0x35')](_0x2129c0[_0x283f('0x30')]['fields']));_0x5d1866[_0x283f('0x36')]=_0x5d1866['attributes'][_0x283f('0x45')]?_0x5d1866[_0x283f('0x36')]:_0x3474ab[_0x283f('0x33')];if(_0x2129c0[_0x283f('0x30')][_0x283f('0x40')]){_0x5d1866[_0x283f('0x41')]=[{'all':!![]}];}_0x5d1866=_[_0x283f('0x46')]({},_0x5d1866,_0x2129c0['options']);return db[_0x283f('0x2c')]['find'](_0x5d1866)[_0x283f('0x24')](handleEntityNotFound(_0x471a7e,null))[_0x283f('0x24')](respondWithResult(_0x471a7e,null))[_0x283f('0x43')](handleError(_0x471a7e,null));};exports[_0x283f('0x47')]=function(_0xb7f0f1,_0x49d3f7){return db['ChatTransferReport']['create'](_0xb7f0f1[_0x283f('0x48')],{})[_0x283f('0x24')](respondWithResult(_0x49d3f7,0xc9))[_0x283f('0x43')](handleError(_0x49d3f7,null));};exports['update']=function(_0x5b8135,_0x1ede9e){if(_0x5b8135[_0x283f('0x48')]['id']){delete _0x5b8135[_0x283f('0x48')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x5b8135[_0x283f('0x49')]['id']}})[_0x283f('0x24')](handleEntityNotFound(_0x1ede9e,null))[_0x283f('0x24')](saveUpdates(_0x5b8135['body'],null))[_0x283f('0x24')](respondWithResult(_0x1ede9e,null))[_0x283f('0x43')](handleError(_0x1ede9e,null));};exports[_0x283f('0x25')]=function(_0x4e1288,_0xdba406){return db['ChatTransferReport'][_0x283f('0x4a')]({'where':{'id':_0x4e1288['params']['id']}})[_0x283f('0x24')](handleEntityNotFound(_0xdba406,null))[_0x283f('0x24')](removeEntity(_0xdba406,null))[_0x283f('0x43')](handleError(_0xdba406,null));};exports['describe']=function(_0x595ab9,_0x449adc){return db['ChatTransferReport'][_0x283f('0x4b')]()[_0x283f('0x24')](respondWithResult(_0x449adc,null))[_0x283f('0x43')](handleError(_0x449adc,null));};
\ No newline at end of file
+var _0xeee3=['name','send','index','map','rawAttributes','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','type','VIRTUAL','options','ChatTransferReport','include','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','update','then','destroy','end','stack'];(function(_0x121cef,_0x22dd0c){var _0x4ef278=function(_0x241d7e){while(--_0x241d7e){_0x121cef['push'](_0x121cef['shift']());}};_0x4ef278(++_0x22dd0c);}(_0xeee3,0x146));var _0x3eee=function(_0x1c1225,_0x6ebf55){_0x1c1225=_0x1c1225-0x0;var _0x1bfc69=_0xeee3[_0x1c1225];return _0x1bfc69;};'use strict';var emlformat=require(_0x3eee('0x0'));var rimraf=require(_0x3eee('0x1'));var zipdir=require(_0x3eee('0x2'));var jsonpatch=require(_0x3eee('0x3'));var rp=require(_0x3eee('0x4'));var moment=require('moment');var BPromise=require(_0x3eee('0x5'));var Mustache=require(_0x3eee('0x6'));var util=require(_0x3eee('0x7'));var path=require(_0x3eee('0x8'));var sox=require(_0x3eee('0x9'));var csv=require('to-csv');var ejs=require(_0x3eee('0xa'));var fs=require('fs');var fs_extra=require(_0x3eee('0xb'));var _=require(_0x3eee('0xc'));var squel=require(_0x3eee('0xd'));var crypto=require('crypto');var jsforce=require(_0x3eee('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3eee('0xf'));var querystring=require('querystring');var Papa=require(_0x3eee('0x10'));var Redis=require(_0x3eee('0x11'));var authService=require(_0x3eee('0x12'));var qs=require(_0x3eee('0x13'));var as=require(_0x3eee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3eee('0x15'))(_0x3eee('0x16'));var utils=require(_0x3eee('0x17'));var config=require(_0x3eee('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3eee('0x19'))['db'];function respondWithStatusCode(_0x168adf,_0x50421c){_0x50421c=_0x50421c||0xcc;return function(_0x4f5423){if(_0x4f5423){return _0x168adf[_0x3eee('0x1a')](_0x50421c);}return _0x168adf[_0x3eee('0x1b')](_0x50421c)['end']();};}function respondWithResult(_0x367fcc,_0x564bc3){_0x564bc3=_0x564bc3||0xc8;return function(_0x81cedd){if(_0x81cedd){return _0x367fcc['status'](_0x564bc3)[_0x3eee('0x1c')](_0x81cedd);}};}function respondWithFilteredResult(_0x30e013,_0x155633){return function(_0xf9c74a){if(_0xf9c74a){var _0x2c7c55=typeof _0x155633[_0x3eee('0x1d')]===_0x3eee('0x1e')&&typeof _0x155633['limit']==='undefined';var _0x52c622=_0xf9c74a[_0x3eee('0x1f')];var _0x39a342=_0x2c7c55?0x0:_0x155633[_0x3eee('0x1d')];var _0x3db241=_0x2c7c55?_0xf9c74a[_0x3eee('0x1f')]:_0x155633[_0x3eee('0x1d')]+_0x155633['limit'];var _0x4390a6;if(_0x3db241>=_0x52c622){_0x3db241=_0x52c622;_0x4390a6=0xc8;}else{_0x4390a6=0xce;}_0x30e013[_0x3eee('0x1b')](_0x4390a6);return _0x30e013[_0x3eee('0x20')]('Content-Range',_0x39a342+'-'+_0x3db241+'/'+_0x52c622)[_0x3eee('0x1c')](_0xf9c74a);}return null;};}function patchUpdates(_0x1a383c){return function(_0x74a3b8){try{jsonpatch[_0x3eee('0x21')](_0x74a3b8,_0x1a383c,!![]);}catch(_0x278f05){return BPromise['reject'](_0x278f05);}return _0x74a3b8['save']();};}function saveUpdates(_0x4c946e,_0x165da6){return function(_0x3b2e49){if(_0x3b2e49){return _0x3b2e49[_0x3eee('0x22')](_0x4c946e)[_0x3eee('0x23')](function(_0x458eee){return _0x458eee;});}return null;};}function removeEntity(_0x34cf85,_0x160554){return function(_0xf46b3d){if(_0xf46b3d){return _0xf46b3d[_0x3eee('0x24')]()[_0x3eee('0x23')](function(){_0x34cf85['status'](0xcc)[_0x3eee('0x25')]();});}};}function handleEntityNotFound(_0x795b0,_0x3f49d2){return function(_0x2e2753){if(!_0x2e2753){_0x795b0['sendStatus'](0x194);}return _0x2e2753;};}function handleError(_0x4e9779,_0x3b5b89){_0x3b5b89=_0x3b5b89||0x1f4;return function(_0x52f37c){logger['error'](_0x52f37c[_0x3eee('0x26')]);if(_0x52f37c['name']){delete _0x52f37c[_0x3eee('0x27')];}_0x4e9779[_0x3eee('0x1b')](_0x3b5b89)[_0x3eee('0x28')](_0x52f37c);};}exports[_0x3eee('0x29')]=function(_0x44fa4b,_0x3401ae){var _0x1fe1fa={},_0x36cece={},_0x3c9feb={'count':0x0,'rows':[]};var _0x693677=_[_0x3eee('0x2a')](db['ChatTransferReport'][_0x3eee('0x2b')],function(_0xd94dfc){return{'name':_0xd94dfc['fieldName'],'type':_0xd94dfc['type'][_0x3eee('0x2c')]};});_0x36cece['model']=_['map'](_0x693677,_0x3eee('0x27'));_0x36cece[_0x3eee('0x2d')]=_[_0x3eee('0x2e')](_0x44fa4b['query']);_0x36cece[_0x3eee('0x2f')]=_['intersection'](_0x36cece[_0x3eee('0x30')],_0x36cece[_0x3eee('0x2d')]);_0x1fe1fa[_0x3eee('0x31')]=_['intersection'](_0x36cece[_0x3eee('0x30')],qs[_0x3eee('0x32')](_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x32')]));_0x1fe1fa[_0x3eee('0x31')]=_0x1fe1fa['attributes'][_0x3eee('0x33')]?_0x1fe1fa[_0x3eee('0x31')]:_0x36cece['model'];if(!_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x34')](_0x3eee('0x35'))){_0x1fe1fa[_0x3eee('0x36')]=qs[_0x3eee('0x36')](_0x44fa4b['query'][_0x3eee('0x36')]);_0x1fe1fa[_0x3eee('0x1d')]=qs[_0x3eee('0x1d')](_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x1d')]);}_0x1fe1fa[_0x3eee('0x37')]=qs[_0x3eee('0x38')](_0x44fa4b['query']['sort']);_0x1fe1fa['where']=qs[_0x3eee('0x2f')](_['pick'](_0x44fa4b['query'],_0x36cece[_0x3eee('0x2f')]),_0x693677);if(_0x44fa4b['query'][_0x3eee('0x39')]){_0x1fe1fa['where']=_[_0x3eee('0x3a')](_0x1fe1fa[_0x3eee('0x3b')],{'$or':_[_0x3eee('0x2a')](_0x693677,function(_0x3b9fb5){if(_0x3b9fb5[_0x3eee('0x3c')]!==_0x3eee('0x3d')){var _0x29caec={};_0x29caec[_0x3b9fb5[_0x3eee('0x27')]]={'$like':'%'+_0x44fa4b[_0x3eee('0x2d')][_0x3eee('0x39')]+'%'};return _0x29caec;}})});}_0x1fe1fa=_[_0x3eee('0x3a')]({},_0x1fe1fa,_0x44fa4b[_0x3eee('0x3e')]);var _0x3605a0={'where':_0x1fe1fa[_0x3eee('0x3b')]};return db[_0x3eee('0x3f')][_0x3eee('0x1f')](_0x3605a0)[_0x3eee('0x23')](function(_0x3881a9){_0x3c9feb['count']=_0x3881a9;if(_0x44fa4b['query']['includeAll']){_0x1fe1fa[_0x3eee('0x40')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x1fe1fa);})[_0x3eee('0x23')](function(_0x10a187){_0x3c9feb[_0x3eee('0x41')]=_0x10a187;return _0x3c9feb;})['then'](respondWithFilteredResult(_0x3401ae,_0x1fe1fa))[_0x3eee('0x42')](handleError(_0x3401ae,null));};exports[_0x3eee('0x43')]=function(_0x15aa89,_0x46918c){var _0x5502e3={'raw':!![],'where':{'id':_0x15aa89[_0x3eee('0x44')]['id']}},_0x48855f={};_0x48855f[_0x3eee('0x30')]=_[_0x3eee('0x2e')](db['ChatTransferReport'][_0x3eee('0x2b')]);_0x48855f[_0x3eee('0x2d')]=_[_0x3eee('0x2e')](_0x15aa89[_0x3eee('0x2d')]);_0x48855f[_0x3eee('0x2f')]=_['intersection'](_0x48855f[_0x3eee('0x30')],_0x48855f[_0x3eee('0x2d')]);_0x5502e3[_0x3eee('0x31')]=_['intersection'](_0x48855f[_0x3eee('0x30')],qs[_0x3eee('0x32')](_0x15aa89[_0x3eee('0x2d')]['fields']));_0x5502e3[_0x3eee('0x31')]=_0x5502e3[_0x3eee('0x31')][_0x3eee('0x33')]?_0x5502e3[_0x3eee('0x31')]:_0x48855f[_0x3eee('0x30')];if(_0x15aa89['query']['includeAll']){_0x5502e3[_0x3eee('0x40')]=[{'all':!![]}];}_0x5502e3=_[_0x3eee('0x3a')]({},_0x5502e3,_0x15aa89[_0x3eee('0x3e')]);return db[_0x3eee('0x3f')]['find'](_0x5502e3)[_0x3eee('0x23')](handleEntityNotFound(_0x46918c,null))[_0x3eee('0x23')](respondWithResult(_0x46918c,null))['catch'](handleError(_0x46918c,null));};exports[_0x3eee('0x45')]=function(_0x149b3a,_0x391621){return db[_0x3eee('0x3f')][_0x3eee('0x45')](_0x149b3a[_0x3eee('0x46')],{})[_0x3eee('0x23')](respondWithResult(_0x391621,0xc9))['catch'](handleError(_0x391621,null));};exports[_0x3eee('0x22')]=function(_0x2caae9,_0x3a72a1){if(_0x2caae9[_0x3eee('0x46')]['id']){delete _0x2caae9[_0x3eee('0x46')]['id'];}return db[_0x3eee('0x3f')][_0x3eee('0x47')]({'where':{'id':_0x2caae9[_0x3eee('0x44')]['id']}})[_0x3eee('0x23')](handleEntityNotFound(_0x3a72a1,null))[_0x3eee('0x23')](saveUpdates(_0x2caae9[_0x3eee('0x46')],null))[_0x3eee('0x23')](respondWithResult(_0x3a72a1,null))[_0x3eee('0x42')](handleError(_0x3a72a1,null));};exports[_0x3eee('0x24')]=function(_0x143131,_0x429441){return db[_0x3eee('0x3f')][_0x3eee('0x47')]({'where':{'id':_0x143131['params']['id']}})['then'](handleEntityNotFound(_0x429441,null))[_0x3eee('0x23')](removeEntity(_0x429441,null))[_0x3eee('0x42')](handleError(_0x429441,null));};exports['describe']=function(_0x5a11c0,_0x5e8567){return db['ChatTransferReport'][_0x3eee('0x48')]()['then'](respondWithResult(_0x5e8567,null))[_0x3eee('0x42')](handleError(_0x5e8567,null));};
\ No newline at end of file
index 7355cc9..9ad5a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6246=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6246,0x186));var _0x6624=function(_0x4dcbf7,_0x7eb697){_0x4dcbf7=_0x4dcbf7-0x0;var _0x10fe33=_0x6246[_0x4dcbf7];return _0x10fe33;};'use strict';var _=require(_0x6624('0x0'));var util=require(_0x6624('0x1'));var logger=require(_0x6624('0x2'))(_0x6624('0x3'));var moment=require(_0x6624('0x4'));var BPromise=require(_0x6624('0x5'));var rp=require(_0x6624('0x6'));var fs=require('fs');var path=require(_0x6624('0x7'));var rimraf=require(_0x6624('0x8'));var config=require('../../config/environment');var attributes=require(_0x6624('0x9'));module['exports']=function(_0x289bba,_0x599eb5){return _0x289bba['define'](_0x6624('0xa'),attributes,{'tableName':_0x6624('0xb'),'paranoid':![],'indexes':[{'name':_0x6624('0xc'),'fields':[_0x6624('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb4c=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x1ed2b,_0x5a9db8){var _0x2cd8d6=function(_0x3b5603){while(--_0x3b5603){_0x1ed2b['push'](_0x1ed2b['shift']());}};_0x2cd8d6(++_0x5a9db8);}(_0xfb4c,0x165));var _0xcfb4=function(_0x557ffe,_0x220b15){_0x557ffe=_0x557ffe-0x0;var _0x411fd5=_0xfb4c[_0x557ffe];return _0x411fd5;};'use strict';var _=require(_0xcfb4('0x0'));var util=require(_0xcfb4('0x1'));var logger=require('../../config/logger')(_0xcfb4('0x2'));var moment=require(_0xcfb4('0x3'));var BPromise=require(_0xcfb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfb4('0x5'));var rimraf=require(_0xcfb4('0x6'));var config=require(_0xcfb4('0x7'));var attributes=require(_0xcfb4('0x8'));module[_0xcfb4('0x9')]=function(_0x50a71b,_0x15ecbd){return _0x50a71b[_0xcfb4('0xa')](_0xcfb4('0xb'),attributes,{'tableName':_0xcfb4('0xc'),'paranoid':![],'indexes':[{'name':_0xcfb4('0xd'),'fields':[_0xcfb4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 436aab3..2970ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7578=['then','info','request\x20sent','debug','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','request'];(function(_0x1f5763,_0x3ed2c8){var _0x221aa4=function(_0x493595){while(--_0x493595){_0x1f5763['push'](_0x1f5763['shift']());}};_0x221aa4(++_0x3ed2c8);}(_0x7578,0x90));var _0x8757=function(_0x31903b,_0x1124d4){_0x31903b=_0x31903b-0x0;var _0x348f57=_0x7578[_0x31903b];return _0x348f57;};'use strict';var _=require(_0x8757('0x0'));var util=require(_0x8757('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8757('0x2'));var fs=require('fs');var Redis=require(_0x8757('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8757('0x4'));var logger=require(_0x8757('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8757('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x538bb8,_0xc4c0ea,_0x1b9b7d){return new BPromise(function(_0x4a1f6e,_0x469e97){return client[_0x8757('0x7')](_0x538bb8,_0x1b9b7d)[_0x8757('0x8')](function(_0x10194b){logger[_0x8757('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0xc4c0ea,_0x8757('0xa'));logger[_0x8757('0xb')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xc4c0ea,_0x8757('0xa'),JSON[_0x8757('0xc')](_0x10194b));if(_0x10194b[_0x8757('0xd')]){if(_0x10194b[_0x8757('0xd')][_0x8757('0xe')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc4c0ea,_0x10194b['error'][_0x8757('0xf')]);return _0x469e97(_0x10194b[_0x8757('0xd')][_0x8757('0xf')]);}logger['error'](_0x8757('0x10'),_0xc4c0ea,_0x10194b['error'][_0x8757('0xf')]);return _0x4a1f6e(_0x10194b['error'][_0x8757('0xf')]);}else{logger[_0x8757('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0xc4c0ea,_0x8757('0xa'));_0x4a1f6e(_0x10194b[_0x8757('0x11')][_0x8757('0xf')]);}})[_0x8757('0x12')](function(_0x5970ee){logger[_0x8757('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xc4c0ea,_0x5970ee);_0x469e97(_0x5970ee);});});}
\ No newline at end of file
+var _0xae9e=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c681e,_0x561ccd){var _0x596ab5=function(_0x40668b){while(--_0x40668b){_0x4c681e['push'](_0x4c681e['shift']());}};_0x596ab5(++_0x561ccd);}(_0xae9e,0xf5));var _0xeae9=function(_0x3d0e2b,_0x5caf34){_0x3d0e2b=_0x3d0e2b-0x0;var _0x2472bb=_0xae9e[_0x3d0e2b];return _0x2472bb;};'use strict';var _=require(_0xeae9('0x0'));var util=require(_0xeae9('0x1'));var moment=require('moment');var BPromise=require(_0xeae9('0x2'));var rs=require(_0xeae9('0x3'));var fs=require('fs');var Redis=require(_0xeae9('0x4'));var db=require(_0xeae9('0x5'))['db'];var utils=require(_0xeae9('0x6'));var logger=require(_0xeae9('0x7'))(_0xeae9('0x8'));var config=require(_0xeae9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeae9('0xa')][_0xeae9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x231b3d,_0x4e5ee9,_0x410542){return new BPromise(function(_0x10bd04,_0x2ef4cb){return client['request'](_0x231b3d,_0x410542)['then'](function(_0x20da0b){logger[_0xeae9('0xc')](_0xeae9('0xd'),_0x4e5ee9,_0xeae9('0xe'));logger[_0xeae9('0xf')](_0xeae9('0x10'),_0x4e5ee9,_0xeae9('0xe'),JSON[_0xeae9('0x11')](_0x20da0b));if(_0x20da0b[_0xeae9('0x12')]){if(_0x20da0b['error'][_0xeae9('0x13')]===0x1f4){logger['error'](_0xeae9('0xd'),_0x4e5ee9,_0x20da0b[_0xeae9('0x12')][_0xeae9('0x14')]);return _0x2ef4cb(_0x20da0b['error']['message']);}logger[_0xeae9('0x12')](_0xeae9('0xd'),_0x4e5ee9,_0x20da0b[_0xeae9('0x12')][_0xeae9('0x14')]);return _0x10bd04(_0x20da0b[_0xeae9('0x12')]['message']);}else{logger[_0xeae9('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4e5ee9,_0xeae9('0xe'));_0x10bd04(_0x20da0b[_0xeae9('0x15')][_0xeae9('0x14')]);}})['catch'](function(_0x10deff){logger[_0xeae9('0x12')](_0xeae9('0xd'),_0x4e5ee9,_0x10deff);_0x2ef4cb(_0x10deff);});});}
\ No newline at end of file
index 1cfacf0..00805de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf9d=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe'];(function(_0x4f0e84,_0x311da0){var _0x42d53a=function(_0x152a18){while(--_0x152a18){_0x4f0e84['push'](_0x4f0e84['shift']());}};_0x42d53a(++_0x311da0);}(_0xbf9d,0x16e));var _0xdbf9=function(_0x550c61,_0x38c528){_0x550c61=_0x550c61-0x0;var _0x9ec5be=_0xbf9d[_0x550c61];return _0x9ec5be;};'use strict';var multer=require(_0xdbf9('0x0'));var util=require(_0xdbf9('0x1'));var path=require('path');var timeout=require(_0xdbf9('0x2'));var express=require(_0xdbf9('0x3'));var router=express['Router']();var fs_extra=require(_0xdbf9('0x4'));var auth=require(_0xdbf9('0x5'));var interaction=require(_0xdbf9('0x6'));var config=require(_0xdbf9('0x7'));var controller=require(_0xdbf9('0x8'));router['get']('/',auth[_0xdbf9('0x9')](),controller[_0xdbf9('0xa')]);router['get'](_0xdbf9('0xb'),auth[_0xdbf9('0x9')](),controller[_0xdbf9('0xc')]);router['get'](_0xdbf9('0xd'),auth[_0xdbf9('0x9')](),controller['show']);router[_0xdbf9('0xe')]('/',auth['isAuthenticated'](),controller[_0xdbf9('0xf')]);router[_0xdbf9('0x10')](_0xdbf9('0xd'),auth[_0xdbf9('0x9')](),controller[_0xdbf9('0x11')]);router[_0xdbf9('0x12')](_0xdbf9('0xd'),auth[_0xdbf9('0x9')](),controller[_0xdbf9('0x13')]);module[_0xdbf9('0x14')]=router;
\ No newline at end of file
+var _0xc267=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x10486a,_0x4f7fc2){var _0x345a98=function(_0x43b447){while(--_0x43b447){_0x10486a['push'](_0x10486a['shift']());}};_0x345a98(++_0x4f7fc2);}(_0xc267,0x18a));var _0x7c26=function(_0x4e9a9,_0x31d38b){_0x4e9a9=_0x4e9a9-0x0;var _0x2aedbc=_0xc267[_0x4e9a9];return _0x2aedbc;};'use strict';var multer=require(_0x7c26('0x0'));var util=require(_0x7c26('0x1'));var path=require(_0x7c26('0x2'));var timeout=require(_0x7c26('0x3'));var express=require(_0x7c26('0x4'));var router=express['Router']();var fs_extra=require(_0x7c26('0x5'));var auth=require(_0x7c26('0x6'));var interaction=require(_0x7c26('0x7'));var config=require(_0x7c26('0x8'));var controller=require(_0x7c26('0x9'));router[_0x7c26('0xa')]('/',auth[_0x7c26('0xb')](),controller[_0x7c26('0xc')]);router[_0x7c26('0xa')](_0x7c26('0xd'),auth['isAuthenticated'](),controller[_0x7c26('0xe')]);router[_0x7c26('0xa')](_0x7c26('0xf'),auth[_0x7c26('0xb')](),controller[_0x7c26('0x10')]);router[_0x7c26('0x11')]('/',auth[_0x7c26('0xb')](),controller[_0x7c26('0x12')]);router[_0x7c26('0x13')](_0x7c26('0xf'),auth[_0x7c26('0xb')](),controller['update']);router[_0x7c26('0x14')](_0x7c26('0xf'),auth[_0x7c26('0xb')](),controller[_0x7c26('0x15')]);module[_0x7c26('0x16')]=router;
\ No newline at end of file
index f81e4cd..60754b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','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.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x44ae3e,_0x57f933){var _0x4cd04c=function(_0x21bc8e){while(--_0x21bc8e){_0x44ae3e['push'](_0x44ae3e['shift']());}};_0x4cd04c(++_0x57f933);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xb4e6[_0x5235dd];return _0x13059d;};'use strict';var Sequelize=require(_0x6b4e('0x0'));var rs=require('randomstring');module[_0x6b4e('0x1')]={'name':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![],'unique':_0x6b4e('0x3')},'description':{'type':Sequelize[_0x6b4e('0x2')]},'mapKey':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x6b4e('0x4')},'key':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b4e('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![],'defaultValue':_0x6b4e('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6b4e('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6b4e('0x2')]},'animation':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b4e('0x8')]('rounded',_0x6b4e('0x9')),'defaultValue':_0x6b4e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6b4e('0xb')},'start_chat_button':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0xc')},'offline_chat_button':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0xd')},'header_offline':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b4e('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x12')},'closingMessage':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x13')},'closingMessageButton':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0xd')},'skipMessageButton':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x14')},'conditionAgreement':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x15')},'ratingType':{'type':Sequelize[_0x6b4e('0x8')](_0x6b4e('0x16'),'thumb'),'defaultValue':_0x6b4e('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6b4e('0x17')],'defaultValue':function(){return JSON[_0x6b4e('0x18')]({'items':[{'type':_0x6b4e('0x19'),'variable':null,'config':{'placeholder':_0x6b4e('0x1a'),'type':_0x6b4e('0x1b'),'required':!![]},'props':{'title':_0x6b4e('0x1a'),'helpText':''}},{'type':_0x6b4e('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6b4e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b4e('0x1c')](_0x6b4e('0x1d'))?JSON[_0x6b4e('0x1e')](this[_0x6b4e('0x1c')]('onlineForm')):{};},'set':function(_0xec7d35){return this[_0x6b4e('0x1f')]('onlineForm',JSON[_0x6b4e('0x18')](_0xec7d35));}},'offlineForm':{'type':Sequelize[_0x6b4e('0x17')],'defaultValue':function(){return JSON[_0x6b4e('0x18')]({'items':[{'type':_0x6b4e('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6b4e('0x4'),'type':_0x6b4e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x6b4e('0x20')},'props':{'title':_0x6b4e('0x20'),'helpText':_0x6b4e('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x6b4e('0x1c')]('offlineForm')?JSON[_0x6b4e('0x1e')](this[_0x6b4e('0x1c')]('offlineForm')):{};},'set':function(_0x37d8bb){return this[_0x6b4e('0x1f')](_0x6b4e('0x22'),JSON['stringify'](_0x37d8bb));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6b4e('0x23')]();}},'autoclose':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6b4e('0x2')]},'forwardOffline':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6b4e('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[_0x6b4e('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6b4e('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6b4e('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6b4e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6b4e('0x17')],'defaultValue':function(){return _0x6b4e('0x27');}},'notificationSound':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b4e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x29')},'defaultTitle':{'type':Sequelize[_0x6b4e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6b4e('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b4e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b4e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':_0x6b4e('0x2a')},'systemAvatar':{'type':Sequelize[_0x6b4e('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b4e('0x6')],'comment':_0x6b4e('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![],'comment':_0x6b4e('0x2c'),'set':function(_0x1f2c38){if(!_0x1f2c38)this['setDataValue'](_0x6b4e('0x2d'),null);this[_0x6b4e('0x1f')]('mandatoryDisposition',_0x1f2c38);}},'vidaooEscalation':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6b4e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x6b4e('0x2')],'allowNull':![],'defaultValue':_0x6b4e('0x2e')},'vidaooNote':{'type':Sequelize[_0x6b4e('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xa74f=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','TEXT','stringify','input','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xa74f,0x9a));var _0xfa74=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0xa74f[_0x2e58c7];return _0x26eb00;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfa74('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa74('0x1')},'description':{'type':Sequelize[_0xfa74('0x2')]},'mapKey':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x4')},'customerAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa74('0x9')]('rounded',_0xfa74('0xa')),'defaultValue':_0xfa74('0xb')},'header_online':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0xd')},'offline_chat_button':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'header_offline':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x12')},'noteTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'skipMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x14')},'ratingType':{'type':Sequelize[_0xfa74('0x9')]('star','thumb'),'defaultValue':_0xfa74('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':_0xfa74('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xfa74('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfa74('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa74('0x1a')](_0xfa74('0x1b'))?JSON['parse'](this['getDataValue'](_0xfa74('0x1b'))):{};},'set':function(_0xeb6c11){return this['setDataValue'](_0xfa74('0x1b'),JSON['stringify'](_0xeb6c11));}},'offlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':'input','props':{'title':_0xfa74('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa74('0x3'),'type':_0xfa74('0x3')},'variable':null},{'type':_0xfa74('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xfa74('0x1d'),'helpText':_0xfa74('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xfa74('0x1a')]('offlineForm')?JSON['parse'](this[_0xfa74('0x1a')](_0xfa74('0x1f'))):{};},'set':function(_0x5df5cd){return this['setDataValue'](_0xfa74('0x1f'),JSON['stringify'](_0x5df5cd));}},'token':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa74('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa74('0x2')]},'waitingTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x20')},'waitingMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x24')},'skipUnmanaged':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfa74('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return _0xfa74('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x27')},'verticalAlignment':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x28')},'messagesAlignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x29')},'defaultTitle':{'type':Sequelize[_0xfa74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x2b')},'systemAvatar':{'type':Sequelize[_0xfa74('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfa74('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'comment':_0xfa74('0x2d'),'set':function(_0x35f252){if(!_0x35f252)this['setDataValue'](_0xfa74('0x2e'),null);this[_0xfa74('0x2f')](_0xfa74('0x30'),_0x35f252);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x31')},'vidaooNote':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return _0xfa74('0x32');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfa74('0x16')]}};
\ No newline at end of file
index d5c115c..0ac45fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf43d=['mapKeyOffline','includes','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Tag','color','tag','Command','timezone','interval','iftime\x20%s','true','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','getSnippet','Interval','Intervals','virtual','custom','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','Attachment','Attachments','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','bluebird','mustache','util','fs-extra','lodash','querystring','ioredis','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','offset','undefined','count','status','Content-Range','update','destroy','then','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf43d,0x64));var _0xdf43=function(_0x55bbf9,_0x14af92){_0x55bbf9=_0x55bbf9-0x0;var _0x17755c=_0xf43d[_0x55bbf9];return _0x17755c;};'use strict';var BPromise=require(_0xdf43('0x0'));var Mustache=require(_0xdf43('0x1'));var util=require(_0xdf43('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf43('0x3'));var _=require(_0xdf43('0x4'));var querystring=require(_0xdf43('0x5'));var Redis=require(_0xdf43('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xdf43('0x7'));var url=require('url');var db=require(_0xdf43('0x8'))['db'];config['redis']=_[_0xdf43('0x9')](config[_0xdf43('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf43('0xb'))(new Redis(config[_0xdf43('0xa')]));require(_0xdf43('0xc'))[_0xdf43('0xd')](socket);var htmlToText=require(_0xdf43('0xe'));var jayson=require('jayson/promise');var client=jayson[_0xdf43('0xf')][_0xdf43('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xdf43('0x10')]({'port':0x232a});var client9003=jayson[_0xdf43('0xf')][_0xdf43('0x10')]({'port':0x232b});var client9001=jayson[_0xdf43('0xf')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5c3e23,_0x51468f,_0x573da3,_0x520ce2){return new BPromise(function(_0x56af27,_0x1fc73f){var _0x1ec1db=_0x520ce2||client;return _0x1ec1db[_0xdf43('0x11')](_0x5c3e23,_0x573da3)['then'](function(_0x3d8fc4){logger[_0xdf43('0x12')](_0xdf43('0x13'),_0x51468f,_0xdf43('0x14'));logger[_0xdf43('0x15')](_0xdf43('0x16'),_0x51468f,_0xdf43('0x14'),JSON[_0xdf43('0x17')](_0x3d8fc4));if(_0x3d8fc4[_0xdf43('0x18')]){if(_0x3d8fc4[_0xdf43('0x18')]['code']===0x1f4){logger['error'](_0xdf43('0x13'),_0x51468f,_0x3d8fc4[_0xdf43('0x18')][_0xdf43('0x19')]);return _0x1fc73f(_0x3d8fc4['error'][_0xdf43('0x19')]);}logger[_0xdf43('0x18')](_0xdf43('0x13'),_0x51468f,_0x3d8fc4[_0xdf43('0x18')][_0xdf43('0x19')]);return _0x56af27(_0x3d8fc4[_0xdf43('0x18')][_0xdf43('0x19')]);}else{logger[_0xdf43('0x12')](_0xdf43('0x13'),_0x51468f,_0xdf43('0x14'));_0x56af27(_0x3d8fc4[_0xdf43('0x1a')][_0xdf43('0x19')]);}})[_0xdf43('0x1b')](function(_0x2324d7){logger['error'](_0xdf43('0x13'),_0x51468f,_0x2324d7);_0x1fc73f(_0x2324d7);});});}function respondWithStatusCode(_0x325bb9,_0x3a58ad){_0x3a58ad=_0x3a58ad||0xcc;return function(_0x22c53c){if(_0x22c53c){return _0x325bb9[_0xdf43('0x1c')](_0x3a58ad);}return _0x325bb9['status'](_0x3a58ad)[_0xdf43('0x1d')]();};}function respondWithResult(_0x13d2e1,_0x990329){_0x990329=_0x990329||0xc8;return function(_0xa2534f){if(_0xa2534f){return _0x13d2e1['status'](_0x990329)[_0xdf43('0x1e')](_0xa2534f);}};}function respondWithFilteredResult(_0x3db029,_0x59851d){return function(_0x591001){if(_0x591001){var _0x2cec7b=typeof _0x59851d[_0xdf43('0x1f')]===_0xdf43('0x20')&&typeof _0x59851d['limit']===_0xdf43('0x20');var _0x1590fe=_0x591001[_0xdf43('0x21')];var _0x27b2ea=_0x2cec7b?0x0:_0x59851d[_0xdf43('0x1f')];var _0x5e4be7=_0x2cec7b?_0x591001[_0xdf43('0x21')]:_0x59851d['offset']+_0x59851d['limit'];var _0x4fd8a7;if(_0x5e4be7>=_0x1590fe){_0x5e4be7=_0x1590fe;_0x4fd8a7=0xc8;}else{_0x4fd8a7=0xce;}_0x3db029[_0xdf43('0x22')](_0x4fd8a7);return _0x3db029['set'](_0xdf43('0x23'),_0x27b2ea+'-'+_0x5e4be7+'/'+_0x1590fe)[_0xdf43('0x1e')](_0x591001);}return null;};}function saveUpdates(_0x42a066){return function(_0x77d152){if(_0x77d152){return _0x77d152[_0xdf43('0x24')](_0x42a066)['then'](function(_0x58673e){return _0x58673e;});}return null;};}function removeEntity(_0x57b495){return function(_0x3eaaa7){if(_0x3eaaa7){return _0x3eaaa7[_0xdf43('0x25')]()[_0xdf43('0x26')](function(){var _0x619d7=_0x3eaaa7[_0xdf43('0x27')]({'plain':!![]});var _0xd1c4da=_0xdf43('0x28');return db[_0xdf43('0x29')][_0xdf43('0x25')]({'where':{'type':_0xd1c4da,'resourceId':_0x619d7['id']}})['then'](function(){return _0x3eaaa7;});})[_0xdf43('0x26')](function(){_0x57b495[_0xdf43('0x22')](0xcc)[_0xdf43('0x1d')]();});}};}function handleEntityNotFound(_0x11f971){return function(_0x5ef232){if(!_0x5ef232){_0x11f971['sendStatus'](0x194);}return _0x5ef232;};}function handleError(_0x3df443,_0xdd724f){_0xdd724f=_0xdd724f||0x1f4;return function(_0x3fc0c3){logger[_0xdf43('0x18')](_0x3fc0c3[_0xdf43('0x2a')]);if(_0x3fc0c3['name']){delete _0x3fc0c3[_0xdf43('0x2b')];}_0x3df443[_0xdf43('0x22')](_0xdd724f)[_0xdf43('0x2c')](_0x3fc0c3);};}exports[_0xdf43('0x2d')]=function(_0x4a24fa,_0x56fad){var _0x29eba6={'include':[{'model':db[_0xdf43('0x2e')],'as':_0xdf43('0x2f')}]},_0x536135={},_0xca2183={'count':0x0,'rows':[]};var _0x434ae3=_['map'](db[_0xdf43('0x30')][_0xdf43('0x31')],function(_0x1740c6){return{'name':_0x1740c6[_0xdf43('0x32')],'type':_0x1740c6[_0xdf43('0x33')][_0xdf43('0x34')]};});_0x536135[_0xdf43('0x35')]=_[_0xdf43('0x36')](_0x434ae3,_0xdf43('0x2b'));_0x536135[_0xdf43('0x37')]=_[_0xdf43('0x38')](_0x4a24fa[_0xdf43('0x37')]);_0x536135[_0xdf43('0x39')]=_[_0xdf43('0x3a')](_0x536135[_0xdf43('0x35')],_0x536135['query']);_0x29eba6[_0xdf43('0x3b')]=_['intersection'](_0x536135[_0xdf43('0x35')],qs[_0xdf43('0x3c')](_0x4a24fa[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x29eba6[_0xdf43('0x3b')]=_0x29eba6['attributes']['length']?_0x29eba6[_0xdf43('0x3b')]:_0x536135['model'];if(!_0x4a24fa[_0xdf43('0x37')][_0xdf43('0x3d')]('nolimit')){_0x29eba6[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0x4a24fa[_0xdf43('0x37')][_0xdf43('0x3e')]);_0x29eba6[_0xdf43('0x1f')]=qs[_0xdf43('0x1f')](_0x4a24fa[_0xdf43('0x37')][_0xdf43('0x1f')]);}_0x29eba6[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0x4a24fa['query'][_0xdf43('0x40')]);_0x29eba6[_0xdf43('0x41')]=qs[_0xdf43('0x39')](_[_0xdf43('0x42')](_0x4a24fa[_0xdf43('0x37')],_0x536135['filters']),_0x434ae3);if(_0x4a24fa[_0xdf43('0x37')]['filter']){_0x29eba6[_0xdf43('0x41')]=_[_0xdf43('0x43')](_0x29eba6[_0xdf43('0x41')],{'$or':_[_0xdf43('0x36')](_0x434ae3,function(_0x3e29ec){if(_0x3e29ec[_0xdf43('0x33')]!==_0xdf43('0x44')){var _0x2fbebd={};_0x2fbebd[_0x3e29ec[_0xdf43('0x2b')]]={'$like':'%'+_0x4a24fa[_0xdf43('0x37')][_0xdf43('0x45')]+'%'};return _0x2fbebd;}})});}_0x29eba6=_[_0xdf43('0x43')]({},_0x29eba6,_0x4a24fa['options']);var _0x229018={'where':_0x29eba6['where']};return db[_0xdf43('0x30')][_0xdf43('0x21')](_0x229018)[_0xdf43('0x26')](function(_0xbacd78){_0xca2183[_0xdf43('0x21')]=_0xbacd78;if(_0x4a24fa[_0xdf43('0x37')][_0xdf43('0x46')]){_0x29eba6[_0xdf43('0x47')]=[{'all':!![]}];}return db[_0xdf43('0x30')][_0xdf43('0x48')](_0x29eba6);})[_0xdf43('0x26')](function(_0x470bf6){_0xca2183[_0xdf43('0x49')]=_0x470bf6;return _0xca2183;})[_0xdf43('0x26')](respondWithFilteredResult(_0x56fad,_0x29eba6))[_0xdf43('0x1b')](handleError(_0x56fad,null));};exports[_0xdf43('0x4a')]=function(_0x2fcc41,_0x5520c7){var _0x2996a0={'raw':![],'where':{'id':_0x2fcc41[_0xdf43('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0xdf43('0x2f')}]},_0x2398cc={};_0x2398cc['model']=_['keys'](db[_0xdf43('0x30')]['rawAttributes']);_0x2398cc[_0xdf43('0x37')]=_['keys'](_0x2fcc41['query']);_0x2398cc['filters']=_[_0xdf43('0x3a')](_0x2398cc[_0xdf43('0x35')],_0x2398cc[_0xdf43('0x37')]);_0x2996a0[_0xdf43('0x3b')]=_[_0xdf43('0x3a')](_0x2398cc['model'],qs[_0xdf43('0x3c')](_0x2fcc41[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x2996a0[_0xdf43('0x3b')]=_0x2996a0['attributes'][_0xdf43('0x4c')]?_0x2996a0['attributes']:_0x2398cc[_0xdf43('0x35')];if(_0x2fcc41[_0xdf43('0x37')][_0xdf43('0x46')]){_0x2996a0[_0xdf43('0x47')]=[{'all':!![]}];}_0x2996a0=_['merge']({},_0x2996a0,_0x2fcc41[_0xdf43('0x4d')]);return db[_0xdf43('0x30')][_0xdf43('0x4e')](_0x2996a0)['then'](handleEntityNotFound(_0x5520c7,null))['then'](respondWithResult(_0x5520c7,null))[_0xdf43('0x1b')](handleError(_0x5520c7,null));};exports[_0xdf43('0x4f')]=function(_0x1aa346,_0x4478fa){return db[_0xdf43('0x30')]['create'](_0x1aa346[_0xdf43('0x50')],{})[_0xdf43('0x26')](function(_0x52effa){var _0x21c1a3=_0x1aa346['user'][_0xdf43('0x27')]({'plain':!![]});if(!_0x21c1a3)throw new Error(_0xdf43('0x51'));if(_0x21c1a3['role']===_0xdf43('0x52')){var _0x43f866=_0x52effa['get']({'plain':!![]});var _0x104828=_0xdf43('0x28');return db[_0xdf43('0x53')][_0xdf43('0x4e')]({'where':{'name':_0x104828,'userProfileId':_0x21c1a3[_0xdf43('0x54')]},'raw':!![]})['then'](function(_0x5b8ecb){if(_0x5b8ecb&&_0x5b8ecb['autoAssociation']===0x0){return db[_0xdf43('0x29')][_0xdf43('0x4f')]({'name':_0x43f866[_0xdf43('0x2b')],'resourceId':_0x43f866['id'],'type':_0x5b8ecb[_0xdf43('0x2b')],'sectionId':_0x5b8ecb['id']},{})[_0xdf43('0x26')](function(){return _0x52effa;});}else{return _0x52effa;}})[_0xdf43('0x1b')](function(_0x17570b){logger['error'](_0xdf43('0x55'),_0x17570b);throw _0x17570b;});}return _0x52effa;})[_0xdf43('0x26')](respondWithResult(_0x4478fa,0xc9))['catch'](handleError(_0x4478fa,null));};exports['update']=function(_0x5c7722,_0xdaf74b){if(_0x5c7722[_0xdf43('0x50')]['id']){delete _0x5c7722[_0xdf43('0x50')]['id'];}return db[_0xdf43('0x30')]['find']({'where':{'id':_0x5c7722[_0xdf43('0x4b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xdaf74b,null))[_0xdf43('0x26')](saveUpdates(_0x5c7722[_0xdf43('0x50')],null))[_0xdf43('0x26')](respondWithResult(_0xdaf74b,null))[_0xdf43('0x1b')](handleError(_0xdaf74b,null));};exports['destroy']=function(_0x377267,_0x1391a5){return db[_0xdf43('0x30')][_0xdf43('0x4e')]({'where':{'id':_0x377267[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x1391a5,null))[_0xdf43('0x26')](removeEntity(_0x1391a5,null))[_0xdf43('0x1b')](handleError(_0x1391a5,null));};exports[_0xdf43('0x56')]=function(_0xba6d61,_0x57c77b){return db['ChatWebsite'][_0xdf43('0x56')]()[_0xdf43('0x26')](respondWithResult(_0x57c77b,null))['catch'](handleError(_0x57c77b,null));};exports[_0xdf43('0x57')]=function(_0x58ee77,_0x5aaeda){if(_0x58ee77[_0xdf43('0x50')]['id']){delete _0x58ee77['body']['id'];}return db['ChatWebsite'][_0xdf43('0x4e')]({'where':{'id':_0x58ee77[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5aaeda,null))[_0xdf43('0x26')](function(_0x14a2fb){if(_0x14a2fb){_0x58ee77[_0xdf43('0x50')][_0xdf43('0x58')]=_0x14a2fb['id'];return db[_0xdf43('0x59')][_0xdf43('0x4f')](_0x58ee77[_0xdf43('0x50')]);}})[_0xdf43('0x26')](respondWithResult(_0x5aaeda,null))[_0xdf43('0x1b')](handleError(_0x5aaeda,null));};exports[_0xdf43('0x5a')]=function(_0xaa2fdf,_0x329d7a){var _0x3890cc={'raw':![],'where':{}};var _0x5cc533={};var _0x5de465={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdf43('0x5b')]({'where':{'id':_0xaa2fdf[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x329d7a,null))['then'](function(_0x4eac97){if(_0x4eac97){_0x5cc533['model']=_['keys'](db[_0xdf43('0x59')]['rawAttributes']);_0x5cc533[_0xdf43('0x37')]=_[_0xdf43('0x38')](_0xaa2fdf[_0xdf43('0x37')]);_0x5cc533[_0xdf43('0x39')]=_['intersection'](_0x5cc533['model'],_0x5cc533[_0xdf43('0x37')]);_0x3890cc[_0xdf43('0x3b')]=_[_0xdf43('0x3a')](_0x5cc533[_0xdf43('0x35')],qs[_0xdf43('0x3c')](_0xaa2fdf['query']['fields']));_0x3890cc[_0xdf43('0x3b')]=_0x3890cc[_0xdf43('0x3b')]['length']?_0x3890cc[_0xdf43('0x3b')]:_0x5cc533[_0xdf43('0x35')];if(!_0xaa2fdf[_0xdf43('0x37')][_0xdf43('0x3d')](_0xdf43('0x5c'))){_0x3890cc[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0xaa2fdf[_0xdf43('0x37')][_0xdf43('0x3e')]);_0x3890cc[_0xdf43('0x1f')]=qs[_0xdf43('0x1f')](_0xaa2fdf[_0xdf43('0x37')]['offset']);}_0x3890cc[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0xaa2fdf[_0xdf43('0x37')]['sort']);_0x3890cc[_0xdf43('0x41')]=qs['filters'](_['pick'](_0xaa2fdf[_0xdf43('0x37')],_0x5cc533[_0xdf43('0x39')]));_0x3890cc[_0xdf43('0x41')][_0xdf43('0x58')]=_0x4eac97['id'];if(_0xaa2fdf[_0xdf43('0x37')][_0xdf43('0x45')]){_0x3890cc[_0xdf43('0x41')]=_[_0xdf43('0x43')](_0x3890cc[_0xdf43('0x41')],{'$or':_[_0xdf43('0x36')](_0x3890cc[_0xdf43('0x3b')],function(_0x4326c1){var _0x50b6b0={};_0x50b6b0[_0x4326c1]={'$like':'%'+_0xaa2fdf[_0xdf43('0x37')]['filter']+'%'};return _0x50b6b0;})});}_0x3890cc=_[_0xdf43('0x43')]({},_0x3890cc,_0xaa2fdf[_0xdf43('0x4d')]);return db[_0xdf43('0x59')][_0xdf43('0x21')]({'where':_0x3890cc[_0xdf43('0x41')]})[_0xdf43('0x26')](function(_0x462b6c){_0x5de465[_0xdf43('0x21')]=_0x462b6c;if(_0xaa2fdf[_0xdf43('0x37')][_0xdf43('0x46')]){_0x3890cc[_0xdf43('0x47')]=[{'all':!![]}];}return db[_0xdf43('0x59')][_0xdf43('0x48')](_0x3890cc);})[_0xdf43('0x26')](function(_0x439f64){_0x5de465[_0xdf43('0x49')]=_0x439f64;return _0x5de465;});}})['then'](respondWithFilteredResult(_0x329d7a,_0x3890cc))[_0xdf43('0x1b')](handleError(_0x329d7a,null));};exports[_0xdf43('0x5d')]=function(_0x574634,_0x55d79e){return db[_0xdf43('0x30')][_0xdf43('0x4e')]({'where':{'id':_0x574634[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x55d79e,null))[_0xdf43('0x26')](function(_0x288878){if(_0x288878){return _0x288878[_0xdf43('0x5d')](_0x574634[_0xdf43('0x37')][_0xdf43('0x5e')]);}})[_0xdf43('0x26')](respondWithStatusCode(_0x55d79e,null))['catch'](handleError(_0x55d79e,null));};exports[_0xdf43('0x5f')]=function(_0xcb0ef9,_0x489a75){if(_0xcb0ef9['body']['id']){delete _0xcb0ef9['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xcb0ef9[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x489a75,null))[_0xdf43('0x26')](function(_0x35e46e){if(_0x35e46e){_0xcb0ef9[_0xdf43('0x50')][_0xdf43('0x58')]=_0x35e46e['id'];return db[_0xdf43('0x60')][_0xdf43('0x4f')](_0xcb0ef9[_0xdf43('0x50')]);}})[_0xdf43('0x26')](respondWithResult(_0x489a75,null))['catch'](handleError(_0x489a75,null));};exports[_0xdf43('0x61')]=function(_0xb6ee84,_0x533819){var _0x135fb3={'raw':![],'where':{}};var _0x251588={};var _0x4bf823={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdf43('0x5b')]({'where':{'id':_0xb6ee84[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x533819,null))[_0xdf43('0x26')](function(_0x359f63){if(_0x359f63){_0x251588[_0xdf43('0x35')]=_[_0xdf43('0x38')](db[_0xdf43('0x60')][_0xdf43('0x31')]);_0x251588[_0xdf43('0x37')]=_[_0xdf43('0x38')](_0xb6ee84[_0xdf43('0x37')]);_0x251588['filters']=_['intersection'](_0x251588[_0xdf43('0x35')],_0x251588[_0xdf43('0x37')]);_0x135fb3['attributes']=_[_0xdf43('0x3a')](_0x251588[_0xdf43('0x35')],qs[_0xdf43('0x3c')](_0xb6ee84[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x135fb3['attributes']=_0x135fb3[_0xdf43('0x3b')][_0xdf43('0x4c')]?_0x135fb3[_0xdf43('0x3b')]:_0x251588[_0xdf43('0x35')];if(!_0xb6ee84[_0xdf43('0x37')]['hasOwnProperty']('nolimit')){_0x135fb3[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0xb6ee84[_0xdf43('0x37')][_0xdf43('0x3e')]);_0x135fb3[_0xdf43('0x1f')]=qs['offset'](_0xb6ee84[_0xdf43('0x37')][_0xdf43('0x1f')]);}_0x135fb3[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0xb6ee84[_0xdf43('0x37')][_0xdf43('0x40')]);_0x135fb3[_0xdf43('0x41')]=qs[_0xdf43('0x39')](_[_0xdf43('0x42')](_0xb6ee84[_0xdf43('0x37')],_0x251588[_0xdf43('0x39')]));_0x135fb3[_0xdf43('0x41')][_0xdf43('0x58')]=_0x359f63['id'];if(_0xb6ee84[_0xdf43('0x37')][_0xdf43('0x45')]){_0x135fb3[_0xdf43('0x41')]=_[_0xdf43('0x43')](_0x135fb3['where'],{'$or':_[_0xdf43('0x36')](_0x135fb3[_0xdf43('0x3b')],function(_0x44394c){var _0x42dd2c={};_0x42dd2c[_0x44394c]={'$like':'%'+_0xb6ee84['query'][_0xdf43('0x45')]+'%'};return _0x42dd2c;})});}_0x135fb3=_[_0xdf43('0x43')]({},_0x135fb3,_0xb6ee84[_0xdf43('0x4d')]);return db['CannedAnswer'][_0xdf43('0x21')]({'where':_0x135fb3['where']})[_0xdf43('0x26')](function(_0x1b05e1){_0x4bf823[_0xdf43('0x21')]=_0x1b05e1;if(_0xb6ee84[_0xdf43('0x37')][_0xdf43('0x46')]){_0x135fb3[_0xdf43('0x47')]=[{'all':!![]}];}return db[_0xdf43('0x60')][_0xdf43('0x48')](_0x135fb3);})[_0xdf43('0x26')](function(_0x19c97c){_0x4bf823['rows']=_0x19c97c;return _0x4bf823;});}})[_0xdf43('0x26')](respondWithFilteredResult(_0x533819,_0x135fb3))[_0xdf43('0x1b')](handleError(_0x533819,null));};exports[_0xdf43('0x62')]=function(_0x5bae37,_0x3b31d4){return db[_0xdf43('0x30')][_0xdf43('0x4e')]({'where':{'id':_0x5bae37[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x3b31d4,null))['then'](function(_0x251f6b){if(_0x251f6b){return _0x251f6b['removeAnswers'](_0x5bae37[_0xdf43('0x37')][_0xdf43('0x5e')]);}})[_0xdf43('0x26')](respondWithStatusCode(_0x3b31d4,null))['catch'](handleError(_0x3b31d4,null));};exports[_0xdf43('0x63')]=function(_0x152fa7,_0x5136e7){_0x152fa7[_0xdf43('0x50')][_0xdf43('0x64')]=_0x152fa7[_0xdf43('0x65')][_0xdf43('0x66')];return db[_0xdf43('0x30')]['find']({'where':{'id':_0x152fa7[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5136e7,null))['then'](saveUpdates(_0x152fa7[_0xdf43('0x50')],null))[_0xdf43('0x26')](respondWithResult(_0x5136e7,null))['catch'](handleError(_0x5136e7,null));};exports[_0xdf43('0x67')]=function(_0x10e7da,_0x564777){_0x10e7da['body'][_0xdf43('0x68')]=_0x10e7da[_0xdf43('0x65')][_0xdf43('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x10e7da[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x564777,null))[_0xdf43('0x26')](saveUpdates(_0x10e7da[_0xdf43('0x50')],null))[_0xdf43('0x26')](respondWithResult(_0x564777,null))[_0xdf43('0x1b')](handleError(_0x564777,null));};exports[_0xdf43('0x69')]=function(_0x4c58b9,_0xa41070){_0x4c58b9['body']['customerAvatar']=_0x4c58b9['file'][_0xdf43('0x66')];return db[_0xdf43('0x30')][_0xdf43('0x4e')]({'where':{'id':_0x4c58b9['params']['id']}})['then'](handleEntityNotFound(_0xa41070,null))[_0xdf43('0x26')](saveUpdates(_0x4c58b9[_0xdf43('0x50')],null))[_0xdf43('0x26')](respondWithResult(_0xa41070,null))['catch'](handleError(_0xa41070,null));};exports[_0xdf43('0x6a')]=function(_0x1daacd,_0x263535){_0x1daacd[_0xdf43('0x50')][_0xdf43('0x6b')]=_0x1daacd[_0xdf43('0x65')][_0xdf43('0x66')];return db[_0xdf43('0x30')]['find']({'where':{'id':_0x1daacd[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x263535,null))[_0xdf43('0x26')](saveUpdates(_0x1daacd[_0xdf43('0x50')],null))['then'](respondWithResult(_0x263535,null))['catch'](handleError(_0x263535,null));};exports[_0xdf43('0x6c')]=function(_0x149710,_0x3120ff){var _0x2a5531=path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0x6f'));var _0x351ffe={'where':{'id':_0x149710[_0xdf43('0x4b')]['id']},'attributes':['id',_0xdf43('0x64')],'raw':!![]};var _0x14eda5=![];return require(_0xdf43('0x70'))[_0xdf43('0x71')]()[_0xdf43('0x26')](function(_0x54dc37){if(_0x54dc37){_0x14eda5=_0x54dc37['custom'];}})[_0xdf43('0x26')](function(){return db[_0xdf43('0x30')][_0xdf43('0x4e')](_0x351ffe);})[_0xdf43('0x26')](handleEntityNotFound(_0x3120ff,null))[_0xdf43('0x26')](function(_0x174115){if(_0x174115){if(!_['isNil'](_0x174115[_0xdf43('0x64')])){if(fs[_0xdf43('0x72')](path[_0xdf43('0x6d')](config['root'],_0xdf43('0x73'),_0x174115[_0xdf43('0x64')]))&&_0x14eda5){_0x2a5531=path['join'](config[_0xdf43('0x6e')],'server/files/images/logos/',_0x174115[_0xdf43('0x64')]);}}return _0x3120ff[_0xdf43('0x74')](_0x2a5531);}})[_0xdf43('0x1b')](handleError(_0x3120ff,null));};exports[_0xdf43('0x75')]=function(_0x1a7272,_0x19f267){var _0x272c4a=path['join'](config[_0xdf43('0x6e')],_0xdf43('0x76'));var _0x10fc72={'where':{'id':_0x1a7272[_0xdf43('0x4b')]['id']},'attributes':['id',_0xdf43('0x68')],'raw':!![]};return db[_0xdf43('0x30')][_0xdf43('0x4e')](_0x10fc72)[_0xdf43('0x26')](handleEntityNotFound(_0x19f267,null))[_0xdf43('0x26')](function(_0x28a9f0){if(_0x28a9f0){if(!_['isNil'](_0x28a9f0[_0xdf43('0x68')])){if(fs[_0xdf43('0x72')](path['join'](config[_0xdf43('0x6e')],_0xdf43('0x77'),_0x28a9f0[_0xdf43('0x68')]))){_0x272c4a=path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0x77'),_0x28a9f0[_0xdf43('0x68')]);}}return _0x19f267[_0xdf43('0x74')](_0x272c4a);}})['catch'](handleError(_0x19f267,null));};exports[_0xdf43('0x78')]=function(_0x35c57d,_0x283f6){var _0x3824b4=path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0x79'));var _0x54c84b={'where':{'id':_0x35c57d[_0xdf43('0x4b')]['id']},'attributes':['id',_0xdf43('0x7a'),_0xdf43('0x7b')],'raw':!![]};return db[_0xdf43('0x30')]['find'](_0x54c84b)[_0xdf43('0x26')](handleEntityNotFound(_0x283f6,null))[_0xdf43('0x26')](function(_0x20698c){if(_0x20698c){if(!_['isNil'](_0x20698c[_0xdf43('0x7a')])){if(fs[_0xdf43('0x72')](path['join'](config['root'],'server/files/images/avatars/',_0x20698c[_0xdf43('0x7a')]))&&_0x20698c[_0xdf43('0x7b')]){_0x3824b4=path['join'](config[_0xdf43('0x6e')],'server/files/images/avatars/',_0x20698c[_0xdf43('0x7a')]);}}return _0x283f6[_0xdf43('0x74')](_0x3824b4);}})[_0xdf43('0x1b')](handleError(_0x283f6,null));};exports[_0xdf43('0x7c')]=function(_0x477dd7,_0x55c43b){var _0x1eca6f=path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0x7d'));var _0x2ad43a={'where':{'id':_0x477dd7[_0xdf43('0x4b')]['id']},'attributes':['id',_0xdf43('0x6b')],'raw':!![]};return db[_0xdf43('0x30')][_0xdf43('0x4e')](_0x2ad43a)[_0xdf43('0x26')](handleEntityNotFound(_0x55c43b,null))[_0xdf43('0x26')](function(_0x56caae){if(_0x56caae){if(!_['isNil'](_0x56caae[_0xdf43('0x6b')])){if(fs['existsSync'](path[_0xdf43('0x6d')](config['root'],'server/files/images/avatars/',_0x56caae['systemAvatar']))){_0x1eca6f=path['join'](config[_0xdf43('0x6e')],_0xdf43('0x77'),_0x56caae[_0xdf43('0x6b')]);}}return _0x55c43b[_0xdf43('0x74')](_0x1eca6f);}})['catch'](handleError(_0x55c43b,null));};exports[_0xdf43('0x7e')]=function(_0x3b55ba,_0x16446d){var _0x492d97=require(_0xdf43('0x7f'));var _0xacd4a2=new _0x492d97();var _0x441a92=_0xacd4a2[_0xdf43('0x80')](_0x3b55ba[_0xdf43('0x81')]['user-agent'])['getResult']();var _0x179829={'body':_0x3b55ba[_0xdf43('0x50')],'channel':_0xdf43('0x82')};var _0x1ba616=[];var _0x368b4e=[];var _0x413483={};var _0x370a47=![];return db[_0xdf43('0x83')][_0xdf43('0x56')]()[_0xdf43('0x26')](function(_0x2bcad7){if(!_0x2bcad7){throw new db[(_0xdf43('0x84'))][(_0xdf43('0x85'))](_0xdf43('0x86'));}_0x1ba616=_[_0xdf43('0x87')](_[_0xdf43('0x38')](_0x2bcad7),[_0xdf43('0x88'),_0xdf43('0x89')]);_0x368b4e=_[_0xdf43('0x87')](_['keys'](_0x2bcad7),[_0xdf43('0x88'),_0xdf43('0x89'),_0xdf43('0x8a'),_0xdf43('0x8b')]);if(_0x3b55ba[_0xdf43('0x50')]['id']){delete _0x3b55ba[_0xdf43('0x50')]['id'];}if(_[_0xdf43('0x8c')](_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x8d')])){throw new db['Sequelize'][(_0xdf43('0x85'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3b55ba['body'][_0xdf43('0x50')])||_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x50')]===''){throw new db[(_0xdf43('0x84'))][(_0xdf43('0x85'))](_0xdf43('0x8e'));}if(_['isNil'](_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x8f')])){throw new db['Sequelize']['ValidationError'](_0xdf43('0x90')+_0x368b4e);}if(!_['includes'](_0x368b4e,_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x8f')])){throw new db[(_0xdf43('0x84'))][(_0xdf43('0x85'))](_0xdf43('0x91')+_0x368b4e);}_0x413483[_0x3b55ba[_0xdf43('0x50')]['mapKey']]=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x8d')];})[_0xdf43('0x26')](function(){return db[_0xdf43('0x30')][_0xdf43('0x4e')]({'where':{'id':_0x3b55ba[_0xdf43('0x4b')]['id']},'include':[{'model':db[_0xdf43('0x92')],'as':_0xdf43('0x93'),'include':[{'model':db['CmContact'],'as':_0xdf43('0x94'),'where':_0x413483,'limit':0x1,'order':[[_0xdf43('0x89'),_0xdf43('0x95')]]}]},{'model':db[_0xdf43('0x96')],'as':_0xdf43('0x97')}]});})[_0xdf43('0x26')](handleEntityNotFound(_0x16446d,null))['then'](function(_0x4a9dea){if(_0x4a9dea&&_0x4a9dea[_0xdf43('0x93')]){_0x179829[_0xdf43('0x98')]=_0x4a9dea;_0x179829[_0xdf43('0x99')]=_0x4a9dea[_0xdf43('0x97')];_0x179829[_0xdf43('0x9a')]=_0x4a9dea[_0xdf43('0x93')];_0x179829[_0xdf43('0x99')]=_[_0xdf43('0x9b')](_0x179829['applications'],[_0xdf43('0x9c')],[_0xdf43('0x9d')]);if(_0x179829[_0xdf43('0x98')][_0xdf43('0x97')]){delete _0x179829[_0xdf43('0x98')]['Applications'];}if(_0x179829[_0xdf43('0x98')]['List']&&_0x179829[_0xdf43('0x98')]['List'][_0xdf43('0x94')][_0xdf43('0x4c')]){return _0x179829[_0xdf43('0x98')][_0xdf43('0x93')][_0xdf43('0x94')][0x0];}var _0x7a713e=_['defaults'](_0x3b55ba[_0xdf43('0x50')],{'firstName':_0x3b55ba['body'][_0xdf43('0x8d')],'ListId':_0x4a9dea[_0xdf43('0x8b')]});_0x7a713e[_0x3b55ba[_0xdf43('0x50')]['mapKey']]=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x8d')];return db[_0xdf43('0x83')][_0xdf43('0x4f')](_0x7a713e,{'fields':_0x1ba616,'raw':!![]});}})[_0xdf43('0x26')](handleEntityNotFound(_0x16446d,null))[_0xdf43('0x26')](function(_0x505cfa){_0x179829['contact']=_0x505cfa;var _0x2e4400=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0x9e')];if(_0x3b55ba['headers'][_0xdf43('0x9f')]){_0x2e4400=_0x3b55ba[_0xdf43('0x81')][_0xdf43('0x9f')];}else if(_0x3b55ba[_0xdf43('0x81')][_0xdf43('0xa0')]){_0x2e4400=_['first'](_0x3b55ba[_0xdf43('0x81')][_0xdf43('0xa0')][_0xdf43('0xa1')](','));}if(_0x505cfa){var _0x121fd1={'ContactId':_0x505cfa['id'],'ChatWebsiteId':_0x3b55ba[_0xdf43('0x4b')]['id'],'from':(_0x505cfa[_0xdf43('0xa2')]||'')+'\x20'+(_0x505cfa[_0xdf43('0xa3')]||''),'customerIp':_0x2e4400,'customerPort':_0x3b55ba[_0xdf43('0x81')][_0xdf43('0xa4')]?_0x3b55ba[_0xdf43('0x81')][_0xdf43('0xa4')]:null,'referer':_0x3b55ba[_0xdf43('0x50')]['referer'],'browserName':_0x441a92[_0xdf43('0xa5')][_0xdf43('0x2b')]&&_0x441a92['browser']['version']?util['format']('%s\x20%s',_0x441a92[_0xdf43('0xa5')]['name'],_0x441a92[_0xdf43('0xa5')][_0xdf43('0xa6')]):'unknown','browserVersion':_0x441a92[_0xdf43('0xa5')][_0xdf43('0xa6')]||_0xdf43('0xa7'),'osName':util[_0xdf43('0xa8')](_0xdf43('0xa9'),_0x441a92['os'][_0xdf43('0x2b')],_0x441a92['os']['version']),'osVersion':_0x441a92['os'][_0xdf43('0xa6')],'deviceModel':_0x441a92[_0xdf43('0xaa')]['model']&&_0x441a92[_0xdf43('0xaa')]['vendor']?util[_0xdf43('0xa8')](_0xdf43('0xab'),_0x441a92[_0xdf43('0xaa')][_0xdf43('0x35')],_0x441a92[_0xdf43('0xaa')][_0xdf43('0xac')],_0x441a92[_0xdf43('0xaa')]['type']):null,'deviceVendor':_0x441a92[_0xdf43('0xaa')][_0xdf43('0xac')],'deviceType':_0x441a92[_0xdf43('0xaa')][_0xdf43('0x33')],'formData':JSON['stringify'](_0x3b55ba[_0xdf43('0x50')])};var _0x29475d={'ChatWebsiteId':_0x3b55ba['params']['id'],'closed':![]};if(_0x3b55ba[_0xdf43('0x50')]['threadId']){_0x29475d[_0xdf43('0xad')]=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xad')];return db[_0xdf43('0xae')]['find']({'where':_0x29475d})['then'](function(_0x29d154){if(_0x29d154){return[_0x29d154,![]];}_0x121fd1['threadId']=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xad')];_0x121fd1['externalUrl']=_0x3b55ba[_0xdf43('0x50')]['externalUrl'];return db[_0xdf43('0xae')][_0xdf43('0x4f')](_0x121fd1)[_0xdf43('0x26')](function(_0x4ee680){return[_0x4ee680,!![]];});});}_0x29475d['ContactId']=_0x505cfa['id'];if(_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xaf')]&&_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xaf')]['id']){_0x29475d['id']=_0x3b55ba[_0xdf43('0x50')]['interaction']['id'];return db[_0xdf43('0xae')][_0xdf43('0x4e')]({'where':_0x29475d})[_0xdf43('0x26')](function(_0x59052e){if(_0x59052e){return[_0x59052e,![]];}return db[_0xdf43('0xae')][_0xdf43('0x4f')](_0x121fd1)[_0xdf43('0x26')](function(_0x338c56){return[_0x338c56,!![]];});});}return db['ChatInteraction'][_0xdf43('0x4f')](_0x121fd1)[_0xdf43('0x26')](function(_0xe0d534){return[_0xe0d534,!![]];});}})[_0xdf43('0xb0')](function(_0x5aae7e,_0x103d9){if(_0x5aae7e){_0x370a47=_0x103d9;if(!_0x103d9){var _0x1e3a7e={'from':(_0x179829[_0xdf43('0xb1')][_0xdf43('0xa2')]||'')+'\x20'+(_0x179829[_0xdf43('0xb1')][_0xdf43('0xa3')]||'')};if(_0x3b55ba[_0xdf43('0x50')]['threadId']&&_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xb2')]&&_0x3b55ba['body'][_0xdf43('0xad')]!=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xb2')]){_0x1e3a7e[_0xdf43('0xad')]=_0x3b55ba[_0xdf43('0x50')][_0xdf43('0xb2')];}return _0x5aae7e[_0xdf43('0x24')](_0x1e3a7e);}else{return _0x5aae7e;}}})[_0xdf43('0x26')](function(_0x23eb82){_0x179829['interaction']=_0x23eb82['get']({'plain':!![]});_0x179829['interaction'][_0xdf43('0xb3')]=_0x370a47;if(_0x179829[_0xdf43('0xaf')]['created']){if(_0x179829[_0xdf43('0x98')][_0xdf43('0xb4')]){_0x179829[_0xdf43('0x99')][_0xdf43('0xb5')]({'id':0x0,'priority':_0x179829['applications']['length']+0x1,'app':_0xdf43('0xb6'),'appdata':_0xdf43('0xb7'),'interval':'*,*,*,*'});}}return db[_0xdf43('0xb8')][_0xdf43('0x4f')]({'body':_0x3b55ba[_0xdf43('0x50')]['body'],'ChatWebsiteId':_0x3b55ba[_0xdf43('0x4b')]['id'],'ChatInteractionId':_0x23eb82['id'],'direction':'in','ContactId':_0x179829['contact']['id'],'AttachmentId':_0x3b55ba['body'][_0xdf43('0xb9')]});})['then'](function(_0x401ad0){_0x179829[_0xdf43('0x19')]=_0x401ad0;if(_0x179829[_0xdf43('0xaf')][_0xdf43('0xba')]){return db[_0xdf43('0xbb')][_0xdf43('0x4e')]({'attributes':['id',_0xdf43('0x2b')],'where':{'id':_0x179829[_0xdf43('0xaf')]['UserId']}})[_0xdf43('0x26')](function(_0x644971){if(_0x644971){_0x179829[_0xdf43('0x99')]['unshift']({'id':0x0,'priority':0x0,'app':_0xdf43('0xbc'),'appdata':_0x644971['name']+','+(_0x179829['account'][_0xdf43('0xbd')]||0xa),'interval':_0xdf43('0xbe')});_0x179829[_0xdf43('0xbf')]=!![];}return respondWithRpcPromise(_0xdf43('0xc0'),_0xdf43('0xc1'),_0x179829);});}return respondWithRpcPromise(_0xdf43('0xc0'),_0xdf43('0xc1'),_0x179829);})['then'](function(_0x25cf83){respondWithRpcPromise(_0xdf43('0xc2'),'EventManager',{'event':_0xdf43('0x7e'),'message':_0x25cf83},client9002);return _0x25cf83;})[_0xdf43('0x26')](respondWithResult(_0x16446d,null))[_0xdf43('0x1b')](handleError(_0x16446d,null));};exports[_0xdf43('0xc3')]=function(_0x45615e,_0x233300){var _0xef3243,_0x163c60,_0x5849fe;var _0x290a04=[];var _0x2609ca={};var _0x50e5b0=_0x45615e[_0xdf43('0xc4')]||[];var _0x552bd7=[];var _0x2acd8d;return db[_0xdf43('0x83')][_0xdf43('0x56')]()[_0xdf43('0x26')](function(_0x3d1cc2){if(!_0x3d1cc2){throw new db[(_0xdf43('0x84'))][(_0xdf43('0x85'))]('no\x20available\x20attributes');}_0x290a04=_[_0xdf43('0x87')](_['keys'](_0x3d1cc2),[_0xdf43('0x88'),_0xdf43('0x89'),_0xdf43('0x8a'),_0xdf43('0x8b')]);if(_0x45615e['body']['id']){delete _0x45615e['body']['id'];}if(_[_0xdf43('0x8c')](_0x45615e[_0xdf43('0x50')][_0xdf43('0x8d')])){throw _0x233300['status'](0x1f4)['send'](new db['Sequelize'][(_0xdf43('0x85'))](_0xdf43('0xc5')));}if(_['isNil'](_0x45615e[_0xdf43('0x50')][_0xdf43('0x50')])||_0x45615e[_0xdf43('0x50')][_0xdf43('0x50')]===''){throw _0x233300['status'](0x1f4)[_0xdf43('0x2c')](new db['Sequelize']['ValidationError'](_0xdf43('0x8e')));}if(_[_0xdf43('0x8c')](_0x45615e[_0xdf43('0x50')][_0xdf43('0xc6')])){throw _0x233300[_0xdf43('0x22')](0x1f4)[_0xdf43('0x2c')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x290a04));}if(!_[_0xdf43('0xc7')](_0x290a04,_0x45615e[_0xdf43('0x50')]['mapKeyOffline'])){throw _0x233300['status'](0x1f4)[_0xdf43('0x2c')](new db[(_0xdf43('0x84'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x290a04));}_0x2609ca[_0x45615e[_0xdf43('0x50')][_0xdf43('0xc6')]]=_0x45615e[_0xdf43('0x50')]['from'];})[_0xdf43('0x26')](function(){return db[_0xdf43('0x30')]['find']({'where':{'id':_0x45615e['params']['id']},'include':[{'model':db['CmList'],'as':_0xdf43('0x93')},{'model':db['MailAccount'],'as':_0xdf43('0xc8')}]});})[_0xdf43('0x26')](handleEntityNotFound(_0x233300,null))[_0xdf43('0x26')](function(_0x523d5a){if(_0x523d5a&&_0x523d5a[_0xdf43('0x93')]){_0x163c60=_0x523d5a;var _0xf0337c=_['defaults'](_0x45615e[_0xdf43('0x50')],{'firstName':_0x45615e[_0xdf43('0x50')]['from'],'phone':_0x45615e[_0xdf43('0x50')]['from'],'ListId':_0x523d5a[_0xdf43('0x8b')]});_0xf0337c[_0x45615e[_0xdf43('0x50')]['mapKeyOffline']]=_0x45615e[_0xdf43('0x50')]['from'];return db['CmContact']['findOrCreate']({'where':_0x2609ca,'defaults':_0xf0337c});}})['spread'](function(_0x345bb3){if(_0x345bb3){_0x5849fe=_0x345bb3;var _0x12b881=fs[_0xdf43('0xc9')](path[_0xdf43('0x6d')](config['root'],_0xdf43('0xca')),_0xdf43('0xcb'));var _0x3b6711=ejs['render'](_0x12b881,{'body':_[_0xdf43('0xcc')](_0x45615e[_0xdf43('0x50')][_0xdf43('0x50')]),'bodyTitle':_0x163c60['offlineMessageBody']});return db['ChatOfflineMessage'][_0xdf43('0x4f')]({'body':_0x3b6711,'plainBody':htmlToText[_0xdf43('0xcd')](_0x3b6711),'ContactId':_0x345bb3['id'],'ChatWebsiteId':_0x163c60['id']});}})[_0xdf43('0x26')](function(_0x31f703){_0x2acd8d=_0x31f703;if(_0x50e5b0[_0xdf43('0x4c')]){var _0x4c30b2=_0x50e5b0['map'](function(_0x4cadaa){return{'name':_0x4cadaa[_0xdf43('0xce')],'basename':_0x4cadaa[_0xdf43('0x66')],'type':_0x4cadaa[_0xdf43('0xcf')],'ChatOfflineMessageId':_0x31f703['id']};});_0x552bd7=_0x4c30b2[_0xdf43('0x36')](_0x29e36a=>{var _0x23261b={'filename':_0x29e36a[_0xdf43('0x2b')],'path':path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0xd0'),_0xdf43('0xc4'),_0xdf43('0xd1'),_0xdf43('0xd2'),_0x29e36a[_0xdf43('0xd3')])};return _0x23261b;});if(!_0x163c60[_0xdf43('0xd4')]){return db[_0xdf43('0xd5')]['transaction'](function(_0x28220c){return db['Attachment'][_0xdf43('0xd6')](_0x4c30b2,{'transaction':_0x28220c});});}}})[_0xdf43('0x26')](function(){if(_0x2acd8d){_0xef3243=_0x2acd8d;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xdf43('0xd7'),'raw':!![],'include':[{'model':db[_0xdf43('0xd8')],'as':_0xdf43('0xd8'),'raw':!![]}]}]});}})['then'](function(_0x423e8b){if(_0x423e8b&&_0x423e8b['Smtp']&&_0x163c60['forwardOffline']&&_0x163c60[_0xdf43('0xd9')]){var _0x49b727=_0x423e8b[_0xdf43('0xda')]();return respondWithRpcPromise(_0xdf43('0xdb'),_0xdf43('0xdc'),{'account':_0x49b727,'message':{'from':util[_0xdf43('0xa8')]('\x22%s\x22\x20<%s>',_0x423e8b[_0xdf43('0x2b')],_0x423e8b[_0xdf43('0xdd')]||_0x423e8b[_0xdf43('0xd7')]['user']),'to':_0x163c60[_0xdf43('0xd9')],'subject':_0x163c60[_0xdf43('0xde')],'html':_0xef3243['body'],'attachments':_0x552bd7}},client9003)[_0xdf43('0x26')](function(){return _0xef3243;})[_0xdf43('0x1b')](function(_0x390665){logger[_0xdf43('0x18')](_0x390665);});}})[_0xdf43('0x26')](function(){if(_0x163c60&&_0x163c60[_0xdf43('0xd4')]&&_0x163c60[_0xdf43('0xdf')]){var _0x48b3d6=[];if(_0x50e5b0['length']){_0x48b3d6=_0x50e5b0[_0xdf43('0x36')](function(_0x2a4e0d){return{'name':_0x2a4e0d['originalname'],'basename':_0x2a4e0d[_0xdf43('0x66')],'type':_0x2a4e0d[_0xdf43('0xcf')],'ChatOfflineMessageId':_0x2acd8d['id']};});}var _0x59ff3b;if(!_['isNil'](_0x163c60['subjectOffline'])){var _0x20c642=_[_0xdf43('0x36')](_0x45615e['body'],function(_0x4698a0){return _0x4698a0;});var _0x547a65=_['toPairsIn'](_0x20c642)[0x0];var _0x43ed36=_[_0xdf43('0xe0')](_0x547a65,function(_0x4ea6e7){return _0x4ea6e7;});_0x59ff3b=_0x43ed36[0x1][_0x163c60[_0xdf43('0xe1')]];}var _0x17916d={'from':_0x5849fe[_0xdf43('0xdd')],'firstName':_0x5849fe['firstName'],'lastName':_0x5849fe[_0xdf43('0xa3')],'mapKey':_0xdf43('0xdd'),'message':{'from':_0x5849fe[_0xdf43('0xdd')],'to':_0x163c60['MailAccount']['email'],'cc':'','subject':_[_0xdf43('0x8c')](_0x59ff3b)?_0x163c60[_0xdf43('0xde')]:_0x59ff3b,'messageId':'','sentAt':new Date(),'attach':_0x48b3d6['length'],'attachments':_0x48b3d6,'originChannel':_0xdf43('0xe2'),'ChatWebsiteId':_0x163c60['id'],'ChatOfflineMessageId':_0xef3243['id'],'originTo':_0x163c60[_0xdf43('0xc8')][_0xdf43('0xdd')]},'body':_0xef3243['body']};var _0x6a1669={'account':{'id':_0x163c60[_0xdf43('0xdf')]},'body':_0x17916d,'log':_0xdf43('0xe3')};return respondWithRpcPromise('NotifyMailAccount',_0xdf43('0xe4'),_0x6a1669,client9001)[_0xdf43('0x26')](function(){return _0xef3243;})[_0xdf43('0x1b')](function(_0x27f1b9){logger[_0xdf43('0x18')](_0x27f1b9);});}return;})[_0xdf43('0x26')](function(){if(_0xef3243){return _0xef3243;}})['then'](respondWithResult(_0x233300,null))[_0xdf43('0x1b')](function(_0x1d2b1f){logger[_0xdf43('0x18')](_0xdf43('0x1b'),_0x1d2b1f);for(var _0x32765c of _0x50e5b0){var _0x2cb667=path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0xd0'),'files','attachments',_0xdf43('0xd2'),_0x32765c['filename']);fs_extra[_0xdf43('0xe5')](_0x2cb667)[_0xdf43('0x1b')](function(_0x18aebf){logger[_0xdf43('0x18')](_0xdf43('0xe6'),_0x2cb667,_0x18aebf);});}});};exports[_0xdf43('0xe7')]=function(_0x1e0804,_0x40277a){return db[_0xdf43('0xae')]['find']({'where':{'id':_0x1e0804[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x40277a,null))[_0xdf43('0x26')](function(_0x1f454f){if(_0x1f454f){return _0x1f454f[_0xdf43('0xe7')](_0x1e0804[_0xdf43('0x50')][_0xdf43('0x5e')],_['omit'](_0x1e0804[_0xdf43('0x50')],[_0xdf43('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x40277a,null))[_0xdf43('0x1b')](handleError(_0x40277a,null));};exports[_0xdf43('0xe8')]=function(_0x253ac9,_0x383d2e){var _0x17161b={'raw':![],'where':{}};var _0x32c8ac={};var _0x1128f9={'count':0x0,'rows':[]};return db[_0xdf43('0x30')][_0xdf43('0x5b')]({'where':{'id':_0x253ac9[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x383d2e,null))['then'](function(_0x4bb13b){if(_0x4bb13b){_0x32c8ac[_0xdf43('0x35')]=_[_0xdf43('0x38')](db[_0xdf43('0xae')]['rawAttributes']);_0x32c8ac[_0xdf43('0x37')]=_[_0xdf43('0x38')](_0x253ac9['query']);_0x32c8ac[_0xdf43('0x39')]=_[_0xdf43('0x3a')](_0x32c8ac[_0xdf43('0x35')],_0x32c8ac[_0xdf43('0x37')]);_0x17161b[_0xdf43('0x3b')]=_[_0xdf43('0x3a')](_0x32c8ac[_0xdf43('0x35')],qs[_0xdf43('0x3c')](_0x253ac9[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x17161b['attributes']=_0x17161b['attributes'][_0xdf43('0x4c')]?_0x17161b['attributes']:_0x32c8ac[_0xdf43('0x35')];if(!_0x253ac9[_0xdf43('0x37')][_0xdf43('0x3d')]('nolimit')){_0x17161b[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0x253ac9[_0xdf43('0x37')]['limit']);_0x17161b[_0xdf43('0x1f')]=qs[_0xdf43('0x1f')](_0x253ac9[_0xdf43('0x37')][_0xdf43('0x1f')]);}_0x17161b[_0xdf43('0x3f')]=qs['sort'](_0x253ac9['query'][_0xdf43('0x40')]);_0x17161b[_0xdf43('0x41')]=qs['filters'](_['pick'](_0x253ac9[_0xdf43('0x37')],_0x32c8ac[_0xdf43('0x39')]));_0x17161b['where'][_0xdf43('0x58')]=_0x4bb13b['id'];if(_0x253ac9[_0xdf43('0x37')][_0xdf43('0x45')]){_0x17161b[_0xdf43('0x41')]=_[_0xdf43('0x43')](_0x17161b[_0xdf43('0x41')],{'$or':_['map'](_0x17161b[_0xdf43('0x3b')],function(_0x2f171c){var _0x3da251={};_0x3da251[_0x2f171c]={'$like':'%'+_0x253ac9[_0xdf43('0x37')]['filter']+'%'};return _0x3da251;})});}_0x17161b=_['merge']({},_0x17161b,_0x253ac9[_0xdf43('0x4d')]);return db[_0xdf43('0xae')][_0xdf43('0x21')]({'where':_0x17161b[_0xdf43('0x41')]})[_0xdf43('0x26')](function(_0x347180){_0x1128f9['count']=_0x347180;if(_0x253ac9['query'][_0xdf43('0x46')]){_0x17161b[_0xdf43('0x47')]=[{'model':db[_0xdf43('0x83')],'as':_0xdf43('0xe9'),'required':![]},{'model':db[_0xdf43('0xbb')],'as':'Owner','attributes':[_0xdf43('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0xdf43('0xea')],'as':'Tags','attributes':['id',_0xdf43('0x2b'),_0xdf43('0xeb')],'where':_0x253ac9[_0xdf43('0x37')][_0xdf43('0xec')]?{'id':_0x253ac9[_0xdf43('0x37')][_0xdf43('0xec')]}:undefined,'required':_0x253ac9[_0xdf43('0x37')][_0xdf43('0xec')]?!![]:![]}];}return db[_0xdf43('0xae')][_0xdf43('0x48')](_0x17161b);})[_0xdf43('0x26')](function(_0x5bf9e4){_0x1128f9[_0xdf43('0x49')]=_0x5bf9e4;return _0x1128f9;});}})[_0xdf43('0x26')](respondWithFilteredResult(_0x383d2e,_0x17161b))[_0xdf43('0x1b')](handleError(_0x383d2e,null));};function iftimePromise(_0x3bca08,_0x1fe26b){return respondWithRpcPromise(_0xdf43('0xed'),'getSnippet',{'command':_0x1fe26b[_0xdf43('0xee')]?util[_0xdf43('0xa8')]('iftime\x20%s,%s',_0x3bca08[_0xdf43('0xef')],_0x1fe26b[_0xdf43('0xee')]):util[_0xdf43('0xa8')](_0xdf43('0xf0'),_0x3bca08[_0xdf43('0xef')])},client9002)['then'](function(_0x3d74c0){var _0x3fdeb0=_0x3d74c0&&_0x3d74c0['indexOf'](_0xdf43('0xf1'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1fe26b['id'],_0x3bca08['id'],_0x3bca08[_0xdf43('0xef')],_0x3fdeb0?'ONLINE':_0xdf43('0xf2'),_0x1fe26b[_0xdf43('0xee')]?_0x1fe26b[_0xdf43('0xee')]:'No\x20timezone');return _0x3fdeb0;})[_0xdf43('0x1b')](function(_0xc264a){logger[_0xdf43('0x18')](_0xdf43('0xf3'),_0x1fe26b['id'],_0x3bca08['id'],_0x3bca08['interval'],util[_0xdf43('0xf4')](_0xc264a,{'showHidden':![],'depth':null}),_0x1fe26b[_0xdf43('0xee')]?_0x1fe26b[_0xdf43('0xee')]:_0xdf43('0xf5'));return![];});}exports[_0xdf43('0xf6')]=function(_0x31a627,_0x2072ce){var _0x1e0ad3=0x0;var _0x30ba38=0x0;var _0x477893=![];var _0x32fb2b;var _0x3321fc;return db['ChatWebsite'][_0xdf43('0x4e')]({'where':{'id':_0x31a627[_0xdf43('0x4b')]['id']},'include':[{'model':db['Interval'],'as':_0xdf43('0xf7'),'include':[{'model':db[_0xdf43('0xf7')],'as':_0xdf43('0xf8'),'attributes':['id',_0xdf43('0xef')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2072ce,null))['then'](function(_0x2d6270){if(_0x2d6270){_0x32fb2b=_0x2d6270;return _0x2d6270['getProactiveActions']({'raw':!![]});}})[_0xdf43('0x26')](function(_0x3f001d){if(_0x32fb2b){if(_0x3f001d){_0x3321fc=_0x3f001d;}}return require(_0xdf43('0x70'))[_0xdf43('0x71')]();})['then'](function(_0x51e3be){if(_0x51e3be){_0x30ba38=_0x51e3be[_0xdf43('0xf9')];_0x477893=_0x51e3be[_0xdf43('0xfa')];}})['then'](function(){return db[_0xdf43('0xae')][_0xdf43('0x21')]({'where':{'closed':![]}});})['then'](function(_0x5af525){_0x1e0ad3=_0x5af525;if(_0x30ba38&&_0x5af525>_0x30ba38){return db[_0xdf43('0xfb')][_0xdf43('0x5b')]({'where':{'id':0x1}})[_0xdf43('0x26')](function(_0x5734e3){if(_0x5734e3){_0x5734e3['increment'](_0xdf43('0xfc'));}});}})[_0xdf43('0x26')](function(){if(_0x32fb2b[_0xdf43('0xf7')]&&_0x32fb2b[_0xdf43('0xf7')]['Intervals']){var _0x32ddbc=[];for(var _0x198178=0x0;_0x198178<_0x32fb2b['Interval'][_0xdf43('0xf8')][_0xdf43('0x4c')];_0x198178++){var _0x246f20=_0x32fb2b[_0xdf43('0xf7')][_0xdf43('0xf8')][_0x198178]['get']({'plain':!![]});_0x32ddbc[_0xdf43('0xb5')](iftimePromise(_0x246f20,_0x32fb2b));}return BPromise[_0xdf43('0xfd')](_0x32ddbc)['then'](function(_0x40ed77){return _[_0xdf43('0xfe')](_0x40ed77);});}else{return!![];}})[_0xdf43('0x26')](function(_0x1f52e4){var _0x3d5211=fs[_0xdf43('0xc9')](path[_0xdf43('0x6d')](config[_0xdf43('0x6e')],_0xdf43('0xff')),'utf8');var _0x919f04=new url[(_0xdf43('0x100'))](_0x32fb2b[_0xdf43('0x101')])[_0xdf43('0x102')];var _0x25c17b='3.1.0';var _0x227d7d=![];var _0x5f0b71={'chatVersion':_0x25c17b,'chatWebsiteAddressOrigin':_0x919f04,'remote':_0x32fb2b[_0xdf43('0x103')],'query':querystring[_0xdf43('0x17')](_[_0xdf43('0x43')](_0x32fb2b[_0xdf43('0x27')]({'plain':!![]}),{'customerIp':_0x31a627['headers'][_0xdf43('0xa0')]||_0x31a627[_0xdf43('0x81')][_0xdf43('0x104')]||_0x31a627[_0xdf43('0x105')][_0xdf43('0x106')]||_0x31a627['ip'],'referer':_0x31a627['headers']['referer'],'openedInteractions':_0x1e0ad3,'maxInteractions':_0x30ba38,'virtual':_0x477893[_0xdf43('0xf9')],'online':_0x1f52e4,'custom':_0x477893}))[_0xdf43('0x107')](/'/g,'\x5c\x27')};_0x2072ce[_0xdf43('0x2c')](ejs[_0xdf43('0x108')](Mustache[_0xdf43('0x108')](_0x3d5211,_0x5f0b71),{'proactiveActions':_0x3321fc,'alignment':_0x32fb2b[_0xdf43('0x109')],'verticalAlignment':_0x32fb2b['verticalAlignment'],'div_color':_0x32fb2b[_0xdf43('0xeb')],'labelText':_0x32fb2b[_0xdf43('0x10a')],'text_color':_0x32fb2b[_0xdf43('0x10b')],'text_button_color':_0x32fb2b[_0xdf43('0x10c')],'button_color':_0x32fb2b[_0xdf43('0x10d')],'background_color':_0x32fb2b['backgroundColor'],'hideWhenOffline':_0x32fb2b[_0xdf43('0x10e')],'intervalId':_0x32fb2b[_0xdf43('0x10f')],'isDevelopment':_0x227d7d,'chatVersion':_0x25c17b}));})['catch'](handleError(_0x2072ce,null));};exports[_0xdf43('0x110')]=function(_0x3d7800,_0x69675c){var _0x2b89c1=_0x3d7800[_0xdf43('0x4b')]['id'];var _0x2224ba=_0x3d7800[_0xdf43('0x50')];var _0x2b3d63=0xc8;var _0x52f451=null;return db['sequelize'][_0xdf43('0x111')]({'isolationLevel':db[_0xdf43('0xd5')]['Transaction'][_0xdf43('0x112')][_0xdf43('0x113')]},function(_0x18eeed){return db[_0xdf43('0x30')][_0xdf43('0x5b')]({'where':{'id':_0x2b89c1},'transaction':_0x18eeed})[_0xdf43('0x26')](function(_0x5610b8){if(_0x5610b8){return db[_0xdf43('0x96')][_0xdf43('0x25')]({'where':{'ChatWebsiteId':_0x2b89c1},'transaction':_0x18eeed})[_0xdf43('0x26')](function(){var _0x4268e4=_[_0xdf43('0x36')](_0x2224ba,function(_0x2aef6e){_0x2aef6e[_0xdf43('0x58')]=_0x2b89c1;return _0x2aef6e;});return db[_0xdf43('0x96')][_0xdf43('0xd6')](_0x4268e4,{'transaction':_0x18eeed});});}else{_0x2b3d63=0x194;_0x52f451=[];}});})[_0xdf43('0x26')](function(){if(_0x2b3d63!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x2b89c1},'order':_0xdf43('0x9c')})['then'](function(_0xf4a8be){_0x52f451=_0xf4a8be;});}})[_0xdf43('0x1b')](function(_0x138db0){_0x2b3d63=0x1f4;logger[_0xdf43('0x18')](_0x138db0['stack']);if(_0x138db0[_0xdf43('0x2b')]){delete _0x138db0[_0xdf43('0x2b')];}_0x52f451=_0x138db0;})[_0xdf43('0x114')](function(){if(_0x52f451===null){_0x69675c[_0xdf43('0x1c')](_0x2b3d63);}else{if(_0x2b3d63===0x1f4){_0x69675c[_0xdf43('0x22')](_0x2b3d63)[_0xdf43('0x2c')](_0x52f451);}else{_0x69675c[_0xdf43('0x22')](_0x2b3d63)['json'](_0x52f451);}}});};exports['getApplications']=function(_0x4d2e8c,_0x44a3fb){var _0x4c998c={};var _0x17352e={};var _0xaaa826;var _0x341178;return db[_0xdf43('0x30')][_0xdf43('0x5b')]({'where':{'id':_0x4d2e8c['params']['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x44a3fb,null))[_0xdf43('0x26')](function(_0x281e70){if(_0x281e70){_0xaaa826=_0x281e70;_0x17352e['model']=_[_0xdf43('0x38')](db[_0xdf43('0x96')][_0xdf43('0x31')]);_0x17352e['query']=_[_0xdf43('0x38')](_0x4d2e8c[_0xdf43('0x37')]);_0x17352e[_0xdf43('0x39')]=_[_0xdf43('0x3a')](_0x17352e[_0xdf43('0x35')],_0x17352e[_0xdf43('0x37')]);_0x4c998c[_0xdf43('0x3b')]=_['intersection'](_0x17352e['model'],qs['fields'](_0x4d2e8c[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x4c998c[_0xdf43('0x3b')]=_0x4c998c[_0xdf43('0x3b')][_0xdf43('0x4c')]?_0x4c998c['attributes']:_0x17352e['model'];_0x4c998c[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0x4d2e8c[_0xdf43('0x37')][_0xdf43('0x40')]);_0x4c998c['where']=qs[_0xdf43('0x39')](_[_0xdf43('0x42')](_0x4d2e8c[_0xdf43('0x37')],_0x17352e[_0xdf43('0x39')]));if(_0x4d2e8c[_0xdf43('0x37')][_0xdf43('0x45')]){_0x4c998c['where']=_[_0xdf43('0x43')](_0x4c998c['where'],{'$or':_[_0xdf43('0x36')](_0x4c998c[_0xdf43('0x3b')],function(_0x1bc75d){var _0x1eeaab={};_0x1eeaab[_0x1bc75d]={'$like':'%'+_0x4d2e8c[_0xdf43('0x37')][_0xdf43('0x45')]+'%'};return _0x1eeaab;})});}_0x4c998c=_[_0xdf43('0x43')]({},_0x4c998c,_0x4d2e8c[_0xdf43('0x4d')]);return _0xaaa826[_0xdf43('0x115')](_0x4c998c);}})[_0xdf43('0x26')](function(_0x216915){if(_0x216915){_0x341178=_0x216915[_0xdf43('0x4c')];if(!_0x4d2e8c['query']['hasOwnProperty'](_0xdf43('0x5c'))){_0x4c998c[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0x4d2e8c[_0xdf43('0x37')][_0xdf43('0x3e')]);_0x4c998c[_0xdf43('0x1f')]=qs['offset'](_0x4d2e8c[_0xdf43('0x37')][_0xdf43('0x1f')]);}return _0xaaa826[_0xdf43('0x115')](_0x4c998c);}})['then'](function(_0x25f3b7){if(_0x25f3b7){return _0x25f3b7?{'count':_0x341178,'rows':_0x25f3b7}:null;}})['then'](respondWithResult(_0x44a3fb,null))[_0xdf43('0x1b')](handleError(_0x44a3fb,null));};exports[_0xdf43('0x116')]=function(_0x37ea7d,_0x2e2fc2){return db[_0xdf43('0x117')][_0xdf43('0x4e')]({'where':{'id':_0x37ea7d['params']['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x2e2fc2,null))[_0xdf43('0x26')](function(_0x4a932b){if(_0x4a932b){return _0x4a932b[_0xdf43('0x116')](_0x37ea7d[_0xdf43('0x50')]['ids'],_[_0xdf43('0x118')](_0x37ea7d[_0xdf43('0x50')],[_0xdf43('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x2e2fc2,null))[_0xdf43('0x1b')](handleError(_0x2e2fc2,null));};exports[_0xdf43('0x119')]=function(_0x35a2d8,_0x3f50bd){var _0x3c7f78={};var _0xc09d3c={};var _0x2c2d27;var _0x3f4f02;return db[_0xdf43('0x30')][_0xdf43('0x5b')]({'where':{'id':_0x35a2d8[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f50bd,null))[_0xdf43('0x26')](function(_0xcb37b7){if(_0xcb37b7){_0x2c2d27=_0xcb37b7;_0xc09d3c[_0xdf43('0x35')]=_[_0xdf43('0x38')](db[_0xdf43('0x11a')][_0xdf43('0x31')]);_0xc09d3c[_0xdf43('0x37')]=_[_0xdf43('0x38')](_0x35a2d8['query']);_0xc09d3c[_0xdf43('0x39')]=_[_0xdf43('0x3a')](_0xc09d3c[_0xdf43('0x35')],_0xc09d3c['query']);_0x3c7f78[_0xdf43('0x3b')]=_[_0xdf43('0x3a')](_0xc09d3c[_0xdf43('0x35')],qs[_0xdf43('0x3c')](_0x35a2d8[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x3c7f78[_0xdf43('0x3b')]=_0x3c7f78['attributes'][_0xdf43('0x4c')]?_0x3c7f78[_0xdf43('0x3b')]:_0xc09d3c['model'];_0x3c7f78[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0x35a2d8['query']['sort']);_0x3c7f78['where']=qs[_0xdf43('0x39')](_[_0xdf43('0x42')](_0x35a2d8[_0xdf43('0x37')],_0xc09d3c[_0xdf43('0x39')]));if(_0x35a2d8[_0xdf43('0x37')][_0xdf43('0x45')]){_0x3c7f78['where']=_[_0xdf43('0x43')](_0x3c7f78[_0xdf43('0x41')],{'$or':_[_0xdf43('0x36')](_0x3c7f78['attributes'],function(_0xab0fa8){var _0x4ac061={};_0x4ac061[_0xab0fa8]={'$like':'%'+_0x35a2d8['query']['filter']+'%'};return _0x4ac061;})});}_0x3c7f78=_[_0xdf43('0x43')]({},_0x3c7f78,_0x35a2d8[_0xdf43('0x4d')]);return _0x2c2d27['getProactiveActions'](_0x3c7f78);}})[_0xdf43('0x26')](function(_0xadb27){if(_0xadb27){_0x3f4f02=_0xadb27['length'];if(!_0x35a2d8[_0xdf43('0x37')][_0xdf43('0x3d')](_0xdf43('0x5c'))){_0x3c7f78[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0x35a2d8[_0xdf43('0x37')]['limit']);_0x3c7f78[_0xdf43('0x1f')]=qs[_0xdf43('0x1f')](_0x35a2d8[_0xdf43('0x37')][_0xdf43('0x1f')]);}return _0x2c2d27['getProactiveActions'](_0x3c7f78);}})[_0xdf43('0x26')](function(_0x2501a6){if(_0x2501a6){return _0x2501a6?{'count':_0x3f4f02,'rows':_0x2501a6}:null;}})[_0xdf43('0x26')](respondWithResult(_0x3f50bd,null))['catch'](handleError(_0x3f50bd,null));};exports[_0xdf43('0x11b')]=function(_0x21c681,_0x1c8a64){var _0x3068be=_0x21c681[_0xdf43('0x37')][_0xdf43('0x11c')]===_0xdf43('0x11d')?'offlineForm':'onlineForm';return db[_0xdf43('0x30')][_0xdf43('0x4e')]({'attributes':['id',_0x3068be],'where':{'id':_0x21c681[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x1c8a64,null))[_0xdf43('0x26')](function(_0x3dcd20){if(_0x3dcd20){var _0xe6bb1=_0x3dcd20[_0x3068be];var _0x112478=_0xe6bb1&&_0xe6bb1['items']?_0xe6bb1[_0xdf43('0x11e')]:[];_0x1c8a64['send']({'fromKey':_['isNil'](_0xe6bb1[_0xdf43('0x11f')])?undefined:_0xe6bb1[_0xdf43('0x11f')],'count':_0x112478[_0xdf43('0x4c')],'rows':_0x112478});}})[_0xdf43('0x1b')](handleError(_0x1c8a64,null));};exports[_0xdf43('0x120')]=function(_0x51aedb,_0xbb6bdf){var _0x498ee2={'raw':![],'where':{}};var _0x5db9e1={};var _0x421f97={'count':0x0,'rows':[]};return db[_0xdf43('0x30')]['findOne']({'where':{'id':_0x51aedb[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0xbb6bdf,null))[_0xdf43('0x26')](function(_0x1adeb0){if(_0x1adeb0){_0x5db9e1[_0xdf43('0x35')]=_[_0xdf43('0x38')](db['ChatOfflineMessage']['rawAttributes']);_0x5db9e1[_0xdf43('0x37')]=_[_0xdf43('0x38')](_0x51aedb['query']);_0x5db9e1['filters']=_['intersection'](_0x5db9e1['model'],_0x5db9e1[_0xdf43('0x37')]);_0x498ee2[_0xdf43('0x3b')]=_[_0xdf43('0x3a')](_0x5db9e1[_0xdf43('0x35')],qs[_0xdf43('0x3c')](_0x51aedb[_0xdf43('0x37')][_0xdf43('0x3c')]));_0x498ee2[_0xdf43('0x3b')]=_0x498ee2[_0xdf43('0x3b')][_0xdf43('0x4c')]?_0x498ee2[_0xdf43('0x3b')]:_0x5db9e1['model'];if(!_0x51aedb[_0xdf43('0x37')][_0xdf43('0x3d')](_0xdf43('0x5c'))){_0x498ee2[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0x51aedb[_0xdf43('0x37')][_0xdf43('0x3e')]);_0x498ee2[_0xdf43('0x1f')]=qs[_0xdf43('0x1f')](_0x51aedb['query']['offset']);}_0x498ee2[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0x51aedb[_0xdf43('0x37')][_0xdf43('0x40')]);_0x498ee2['where']=qs[_0xdf43('0x39')](_['pick'](_0x51aedb['query'],_0x5db9e1['filters']));_0x498ee2[_0xdf43('0x41')][_0xdf43('0x58')]=_0x1adeb0['id'];if(_0x51aedb[_0xdf43('0x37')]['filter']){_0x498ee2[_0xdf43('0x41')]=_[_0xdf43('0x43')](_0x498ee2['where'],{'$or':_['map'](_0x498ee2['attributes'],function(_0x52a9b2){var _0x2d7520={};_0x2d7520[_0x52a9b2]={'$like':'%'+_0x51aedb['query'][_0xdf43('0x45')]+'%'};return _0x2d7520;})});}_0x498ee2=_[_0xdf43('0x43')]({},_0x498ee2,_0x51aedb['options']);return db['ChatOfflineMessage'][_0xdf43('0x21')]({'where':_0x498ee2[_0xdf43('0x41')]})['then'](function(_0x468f3b){_0x421f97[_0xdf43('0x21')]=_0x468f3b;if(_0x51aedb['query'][_0xdf43('0x46')]){_0x498ee2[_0xdf43('0x47')]=[{'all':!![]}];}else{_0x498ee2[_0xdf43('0x47')]=[{'model':db[_0xdf43('0x83')],'as':'Contact','required':![]},{'model':db[_0xdf43('0x121')],'as':_0xdf43('0x122'),'required':![]}];}return db[_0xdf43('0x123')][_0xdf43('0x48')](_0x498ee2);})[_0xdf43('0x26')](function(_0xdafc32){_0x421f97[_0xdf43('0x49')]=_0xdafc32;return _0x421f97;});}})['then'](respondWithFilteredResult(_0xbb6bdf,_0x498ee2))['catch'](handleError(_0xbb6bdf,null));};exports[_0xdf43('0x124')]=function(_0x173ca7,_0x2c1980){return db['ChatWebsite']['find']({'where':{'id':_0x173ca7[_0xdf43('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c1980,null))['then'](function(_0x1f23b4){if(_0x1f23b4){return _0x1f23b4[_0xdf43('0x124')](_0x173ca7['body'][_0xdf43('0x5e')],_['omit'](_0x173ca7[_0xdf43('0x50')],[_0xdf43('0x5e'),'id'])||{})[_0xdf43('0xb0')](function(_0x51b7fd){for(var _0x254dc8=0x0;_0x254dc8<_0x173ca7['body']['ids'][_0xdf43('0x4c')];_0x254dc8+=0x1){socket[_0xdf43('0x125')](_0xdf43('0x126'),{'UserId':Number(_0x173ca7['body'][_0xdf43('0x5e')][_0x254dc8]),'ChatWebsiteId':Number(_0x173ca7[_0xdf43('0x4b')]['id'])});}return _0x51b7fd;});}})[_0xdf43('0x26')](respondWithResult(_0x2c1980,null))['catch'](handleError(_0x2c1980,null));};exports[_0xdf43('0x127')]=function(_0x29a2ac,_0xcf7ea8){return db['ChatWebsite'][_0xdf43('0x4e')]({'where':{'id':_0x29a2ac[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0xcf7ea8,null))[_0xdf43('0x26')](function(_0x35d598){if(_0x35d598){return _0x35d598[_0xdf43('0x127')](_0x29a2ac['query'][_0xdf43('0x5e')])[_0xdf43('0x26')](function(){if(_[_0xdf43('0x128')](_0x29a2ac[_0xdf43('0x37')][_0xdf43('0x5e')])){for(var _0x19d4e1=0x0;_0x19d4e1<_0x29a2ac[_0xdf43('0x37')]['ids'][_0xdf43('0x4c')];_0x19d4e1+=0x1){socket[_0xdf43('0x125')](_0xdf43('0x129'),{'UserId':Number(_0x29a2ac['query']['ids'][_0x19d4e1]),'ChatWebsiteId':Number(_0x29a2ac[_0xdf43('0x4b')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x29a2ac[_0xdf43('0x37')][_0xdf43('0x5e')]),'ChatWebsiteId':Number(_0x29a2ac[_0xdf43('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0xcf7ea8,null))[_0xdf43('0x1b')](handleError(_0xcf7ea8,null));};exports['getAgents']=function(_0x764308,_0x2ea8fb){var _0xff95b5={};var _0x21c402={};var _0x371caa;var _0x577c22;return db[_0xdf43('0x30')]['findOne']({'where':{'id':_0x764308[_0xdf43('0x4b')]['id']}})[_0xdf43('0x26')](handleEntityNotFound(_0x2ea8fb,null))['then'](function(_0x47263d){if(_0x47263d){_0x371caa=_0x47263d;_0x21c402[_0xdf43('0x35')]=_['keys'](db[_0xdf43('0xbb')]['rawAttributes']);_0x21c402['query']=_[_0xdf43('0x38')](_0x764308[_0xdf43('0x37')]);_0x21c402['filters']=_[_0xdf43('0x3a')](_0x21c402[_0xdf43('0x35')],_0x21c402['query']);_0xff95b5[_0xdf43('0x3b')]=_[_0xdf43('0x3a')](_0x21c402[_0xdf43('0x35')],qs['fields'](_0x764308[_0xdf43('0x37')][_0xdf43('0x3c')]));_0xff95b5[_0xdf43('0x3b')]=_0xff95b5['attributes'][_0xdf43('0x4c')]?_0xff95b5[_0xdf43('0x3b')]:_0x21c402['model'];_0xff95b5[_0xdf43('0x3f')]=qs[_0xdf43('0x40')](_0x764308[_0xdf43('0x37')][_0xdf43('0x40')]);_0xff95b5[_0xdf43('0x41')]=qs[_0xdf43('0x39')](_[_0xdf43('0x42')](_0x764308[_0xdf43('0x37')],_0x21c402[_0xdf43('0x39')]));if(_0x764308[_0xdf43('0x37')][_0xdf43('0x45')]){_0xff95b5[_0xdf43('0x41')]=_[_0xdf43('0x43')](_0xff95b5[_0xdf43('0x41')],{'$or':_[_0xdf43('0x36')](_0xff95b5[_0xdf43('0x3b')],function(_0x385270){var _0x2d2544={};_0x2d2544[_0x385270]={'$like':'%'+_0x764308[_0xdf43('0x37')]['filter']+'%'};return _0x2d2544;})});}_0xff95b5=_['merge']({},_0xff95b5,_0x764308['options']);return _0x371caa['getAgents'](_0xff95b5);}})[_0xdf43('0x26')](function(_0x2dea93){if(_0x2dea93){_0x577c22=_0x2dea93[_0xdf43('0x4c')];if(!_0x764308[_0xdf43('0x37')]['hasOwnProperty']('nolimit')){_0xff95b5[_0xdf43('0x3e')]=qs[_0xdf43('0x3e')](_0x764308[_0xdf43('0x37')]['limit']);_0xff95b5['offset']=qs[_0xdf43('0x1f')](_0x764308[_0xdf43('0x37')][_0xdf43('0x1f')]);}return _0x371caa['getAgents'](_0xff95b5);}})[_0xdf43('0x26')](function(_0x2a7b04){if(_0x2a7b04){return _0x2a7b04?{'count':_0x577c22,'rows':_0x2a7b04}:null;}})[_0xdf43('0x26')](respondWithResult(_0x2ea8fb,null))[_0xdf43('0x1b')](handleError(_0x2ea8fb,null));};
\ No newline at end of file
+var _0xee0e=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','findAll','params','rawAttributes','include','options','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addLogo','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','sitepic','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','from','CmList','List','Contacts','DESC','account','applications','Applications','list','asc','contact','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','MailServerOut','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','forwardOfflineAddress','offlineMessageSubject','subjectOffline','toPairsIn','firstName','notifyMail','remove','addInteraction','omit','getInteractions','Owner','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','getProactiveActions','virtual','custom','License','Intervals','all','some','readFileSync','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','color','textColor','color_button','hideWhenOffline','IntervalId','sequelize','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','update','then','destroy','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite'];(function(_0x3c97cb,_0x43b68e){var _0x2529c2=function(_0x56120e){while(--_0x56120e){_0x3c97cb['push'](_0x3c97cb['shift']());}};_0x2529c2(++_0x43b68e);}(_0xee0e,0xf7));var _0xeee0=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xee0e[_0x26462c];return _0x509a42;};'use strict';var BPromise=require(_0xeee0('0x0'));var Mustache=require('mustache');var util=require(_0xeee0('0x1'));var path=require('path');var ejs=require(_0xeee0('0x2'));var fs=require('fs');var fs_extra=require(_0xeee0('0x3'));var _=require(_0xeee0('0x4'));var querystring=require(_0xeee0('0x5'));var Redis=require('ioredis');var qs=require(_0xeee0('0x6'));var logger=require('../../config/logger')(_0xeee0('0x7'));var config=require(_0xeee0('0x8'));var url=require(_0xeee0('0x9'));var db=require(_0xeee0('0xa'))['db'];config[_0xeee0('0xb')]=_[_0xeee0('0xc')](config[_0xeee0('0xb')],{'host':_0xeee0('0xd'),'port':0x18eb});var socket=require(_0xeee0('0xe'))(new Redis(config[_0xeee0('0xb')]));require('./chatWebsite.socket')[_0xeee0('0xf')](socket);var htmlToText=require(_0xeee0('0x10'));var jayson=require(_0xeee0('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xeee0('0x12')]['http']({'port':0x232a});var client9003=jayson['client'][_0xeee0('0x13')]({'port':0x232b});var client9001=jayson[_0xeee0('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x23b533,_0x4fc44b,_0x499982,_0x1383d5){return new BPromise(function(_0x484ab5,_0x4dc2b6){var _0x1f79b6=_0x1383d5||client;return _0x1f79b6[_0xeee0('0x14')](_0x23b533,_0x499982)['then'](function(_0x4e2f4d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4fc44b,_0xeee0('0x15'));logger[_0xeee0('0x16')](_0xeee0('0x17'),_0x4fc44b,_0xeee0('0x15'),JSON['stringify'](_0x4e2f4d));if(_0x4e2f4d[_0xeee0('0x18')]){if(_0x4e2f4d[_0xeee0('0x18')][_0xeee0('0x19')]===0x1f4){logger[_0xeee0('0x18')](_0xeee0('0x1a'),_0x4fc44b,_0x4e2f4d[_0xeee0('0x18')][_0xeee0('0x1b')]);return _0x4dc2b6(_0x4e2f4d[_0xeee0('0x18')]['message']);}logger[_0xeee0('0x18')](_0xeee0('0x1a'),_0x4fc44b,_0x4e2f4d[_0xeee0('0x18')]['message']);return _0x484ab5(_0x4e2f4d[_0xeee0('0x18')][_0xeee0('0x1b')]);}else{logger[_0xeee0('0x1c')](_0xeee0('0x1a'),_0x4fc44b,'request\x20sent');_0x484ab5(_0x4e2f4d[_0xeee0('0x1d')]['message']);}})[_0xeee0('0x1e')](function(_0x52b4a7){logger[_0xeee0('0x18')](_0xeee0('0x1a'),_0x4fc44b,_0x52b4a7);_0x4dc2b6(_0x52b4a7);});});}function respondWithStatusCode(_0x24c68f,_0xd6fe72){_0xd6fe72=_0xd6fe72||0xcc;return function(_0x52f49a){if(_0x52f49a){return _0x24c68f[_0xeee0('0x1f')](_0xd6fe72);}return _0x24c68f[_0xeee0('0x20')](_0xd6fe72)[_0xeee0('0x21')]();};}function respondWithResult(_0x4119e4,_0x43cba0){_0x43cba0=_0x43cba0||0xc8;return function(_0x543c93){if(_0x543c93){return _0x4119e4[_0xeee0('0x20')](_0x43cba0)[_0xeee0('0x22')](_0x543c93);}};}function respondWithFilteredResult(_0x1643f0,_0x1c912d){return function(_0x183691){if(_0x183691){var _0x25c1af=typeof _0x1c912d['offset']===_0xeee0('0x23')&&typeof _0x1c912d['limit']===_0xeee0('0x23');var _0x33624f=_0x183691[_0xeee0('0x24')];var _0x2f2ea4=_0x25c1af?0x0:_0x1c912d['offset'];var _0x59d3bf=_0x25c1af?_0x183691[_0xeee0('0x24')]:_0x1c912d['offset']+_0x1c912d[_0xeee0('0x25')];var _0x5817c8;if(_0x59d3bf>=_0x33624f){_0x59d3bf=_0x33624f;_0x5817c8=0xc8;}else{_0x5817c8=0xce;}_0x1643f0['status'](_0x5817c8);return _0x1643f0[_0xeee0('0x26')](_0xeee0('0x27'),_0x2f2ea4+'-'+_0x59d3bf+'/'+_0x33624f)['json'](_0x183691);}return null;};}function saveUpdates(_0x4d5bb7){return function(_0xb209e){if(_0xb209e){return _0xb209e[_0xeee0('0x28')](_0x4d5bb7)[_0xeee0('0x29')](function(_0xc59273){return _0xc59273;});}return null;};}function removeEntity(_0x4c9411){return function(_0xb1ec06){if(_0xb1ec06){return _0xb1ec06[_0xeee0('0x2a')]()[_0xeee0('0x29')](function(){var _0xdfff3b=_0xb1ec06['get']({'plain':!![]});var _0x469b0f=_0xeee0('0x2b');return db[_0xeee0('0x2c')][_0xeee0('0x2a')]({'where':{'type':_0x469b0f,'resourceId':_0xdfff3b['id']}})[_0xeee0('0x29')](function(){return _0xb1ec06;});})[_0xeee0('0x29')](function(){_0x4c9411[_0xeee0('0x20')](0xcc)[_0xeee0('0x21')]();});}};}function handleEntityNotFound(_0x46f116){return function(_0x10e524){if(!_0x10e524){_0x46f116[_0xeee0('0x1f')](0x194);}return _0x10e524;};}function handleError(_0x448832,_0x23ebf6){_0x23ebf6=_0x23ebf6||0x1f4;return function(_0xc38d18){logger[_0xeee0('0x18')](_0xc38d18[_0xeee0('0x2d')]);if(_0xc38d18['name']){delete _0xc38d18['name'];}_0x448832[_0xeee0('0x20')](_0x23ebf6)[_0xeee0('0x2e')](_0xc38d18);};}exports[_0xeee0('0x2f')]=function(_0x2e4870,_0x1df264){var _0x31c12c={'include':[{'model':db[_0xeee0('0x30')],'as':_0xeee0('0x31')}]},_0x4b9a92={},_0x2421dc={'count':0x0,'rows':[]};var _0x4df76b=_[_0xeee0('0x32')](db[_0xeee0('0x33')]['rawAttributes'],function(_0x4dce7f){return{'name':_0x4dce7f[_0xeee0('0x34')],'type':_0x4dce7f[_0xeee0('0x35')][_0xeee0('0x36')]};});_0x4b9a92[_0xeee0('0x37')]=_[_0xeee0('0x32')](_0x4df76b,'name');_0x4b9a92[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x2e4870[_0xeee0('0x38')]);_0x4b9a92[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x4b9a92[_0xeee0('0x37')],_0x4b9a92[_0xeee0('0x38')]);_0x31c12c[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x4b9a92[_0xeee0('0x37')],qs['fields'](_0x2e4870[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x31c12c['attributes']=_0x31c12c[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x31c12c[_0xeee0('0x3c')]:_0x4b9a92[_0xeee0('0x37')];if(!_0x2e4870[_0xeee0('0x38')][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x31c12c[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x2e4870[_0xeee0('0x38')][_0xeee0('0x25')]);_0x31c12c[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x2e4870[_0xeee0('0x38')][_0xeee0('0x41')]);}_0x31c12c[_0xeee0('0x42')]=qs['sort'](_0x2e4870['query'][_0xeee0('0x43')]);_0x31c12c[_0xeee0('0x44')]=qs[_0xeee0('0x3a')](_[_0xeee0('0x45')](_0x2e4870[_0xeee0('0x38')],_0x4b9a92[_0xeee0('0x3a')]),_0x4df76b);if(_0x2e4870[_0xeee0('0x38')][_0xeee0('0x46')]){_0x31c12c[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x31c12c[_0xeee0('0x44')],{'$or':_[_0xeee0('0x32')](_0x4df76b,function(_0x478647){if(_0x478647['type']!==_0xeee0('0x48')){var _0x13a94d={};_0x13a94d[_0x478647[_0xeee0('0x49')]]={'$like':'%'+_0x2e4870[_0xeee0('0x38')][_0xeee0('0x46')]+'%'};return _0x13a94d;}})});}_0x31c12c=_[_0xeee0('0x47')]({},_0x31c12c,_0x2e4870['options']);var _0x2bd9c0={'where':_0x31c12c[_0xeee0('0x44')]};return db['ChatWebsite'][_0xeee0('0x24')](_0x2bd9c0)[_0xeee0('0x29')](function(_0x16a386){_0x2421dc[_0xeee0('0x24')]=_0x16a386;if(_0x2e4870[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x31c12c['include']=[{'all':!![]}];}return db[_0xeee0('0x33')][_0xeee0('0x4b')](_0x31c12c);})[_0xeee0('0x29')](function(_0x3bd7b4){_0x2421dc['rows']=_0x3bd7b4;return _0x2421dc;})[_0xeee0('0x29')](respondWithFilteredResult(_0x1df264,_0x31c12c))[_0xeee0('0x1e')](handleError(_0x1df264,null));};exports['show']=function(_0x2966b0,_0xb2fcf){var _0x37bc2d={'raw':![],'where':{'id':_0x2966b0[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x30')],'as':'mandatoryDispositionPause'}]},_0x3e74eb={};_0x3e74eb[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0x33')][_0xeee0('0x4d')]);_0x3e74eb[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x2966b0[_0xeee0('0x38')]);_0x3e74eb['filters']=_[_0xeee0('0x3b')](_0x3e74eb[_0xeee0('0x37')],_0x3e74eb[_0xeee0('0x38')]);_0x37bc2d[_0xeee0('0x3c')]=_['intersection'](_0x3e74eb[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x2966b0[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x37bc2d[_0xeee0('0x3c')]=_0x37bc2d[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x37bc2d[_0xeee0('0x3c')]:_0x3e74eb[_0xeee0('0x37')];if(_0x2966b0[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x37bc2d[_0xeee0('0x4e')]=[{'all':!![]}];}_0x37bc2d=_['merge']({},_0x37bc2d,_0x2966b0[_0xeee0('0x4f')]);return db[_0xeee0('0x33')][_0xeee0('0x50')](_0x37bc2d)[_0xeee0('0x29')](handleEntityNotFound(_0xb2fcf,null))[_0xeee0('0x29')](respondWithResult(_0xb2fcf,null))['catch'](handleError(_0xb2fcf,null));};exports[_0xeee0('0x51')]=function(_0x39e52c,_0x320ec8){return db[_0xeee0('0x33')][_0xeee0('0x51')](_0x39e52c['body'],{})[_0xeee0('0x29')](function(_0x5335ab){var _0x1e59f3=_0x39e52c[_0xeee0('0x52')][_0xeee0('0x53')]({'plain':!![]});if(!_0x1e59f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e59f3[_0xeee0('0x54')]===_0xeee0('0x52')){var _0x502cf6=_0x5335ab[_0xeee0('0x53')]({'plain':!![]});var _0x366b47='ChatWebsites';return db[_0xeee0('0x55')]['find']({'where':{'name':_0x366b47,'userProfileId':_0x1e59f3[_0xeee0('0x56')]},'raw':!![]})[_0xeee0('0x29')](function(_0x4cec1d){if(_0x4cec1d&&_0x4cec1d[_0xeee0('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x502cf6[_0xeee0('0x49')],'resourceId':_0x502cf6['id'],'type':_0x4cec1d[_0xeee0('0x49')],'sectionId':_0x4cec1d['id']},{})['then'](function(){return _0x5335ab;});}else{return _0x5335ab;}})[_0xeee0('0x1e')](function(_0x6f8e8a){logger[_0xeee0('0x18')](_0xeee0('0x58'),_0x6f8e8a);throw _0x6f8e8a;});}return _0x5335ab;})['then'](respondWithResult(_0x320ec8,0xc9))[_0xeee0('0x1e')](handleError(_0x320ec8,null));};exports[_0xeee0('0x28')]=function(_0x52440f,_0x59aa86){if(_0x52440f['body']['id']){delete _0x52440f[_0xeee0('0x59')]['id'];}return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x52440f[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x30')],'as':_0xeee0('0x31')}]})['then'](handleEntityNotFound(_0x59aa86,null))['then'](saveUpdates(_0x52440f[_0xeee0('0x59')],null))[_0xeee0('0x29')](respondWithResult(_0x59aa86,null))['catch'](handleError(_0x59aa86,null));};exports['destroy']=function(_0x3f6287,_0x246ecf){return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x3f6287[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x246ecf,null))[_0xeee0('0x29')](removeEntity(_0x246ecf,null))[_0xeee0('0x1e')](handleError(_0x246ecf,null));};exports[_0xeee0('0x5a')]=function(_0x3118f2,_0x3ad981){return db[_0xeee0('0x33')][_0xeee0('0x5a')]()[_0xeee0('0x29')](respondWithResult(_0x3ad981,null))[_0xeee0('0x1e')](handleError(_0x3ad981,null));};exports[_0xeee0('0x5b')]=function(_0x51979b,_0x4438b9){if(_0x51979b['body']['id']){delete _0x51979b[_0xeee0('0x59')]['id'];}return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x51979b[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x4438b9,null))[_0xeee0('0x29')](function(_0x566d8d){if(_0x566d8d){_0x51979b[_0xeee0('0x59')][_0xeee0('0x5c')]=_0x566d8d['id'];return db[_0xeee0('0x5d')][_0xeee0('0x51')](_0x51979b[_0xeee0('0x59')]);}})[_0xeee0('0x29')](respondWithResult(_0x4438b9,null))[_0xeee0('0x1e')](handleError(_0x4438b9,null));};exports[_0xeee0('0x5e')]=function(_0x51375f,_0xabc6fe){var _0x52c2ab={'raw':![],'where':{}};var _0x63bfe9={};var _0x32e2a5={'count':0x0,'rows':[]};return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x51375f[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0xabc6fe,null))[_0xeee0('0x29')](function(_0x3cfc65){if(_0x3cfc65){_0x63bfe9[_0xeee0('0x37')]=_[_0xeee0('0x39')](db[_0xeee0('0x5d')][_0xeee0('0x4d')]);_0x63bfe9[_0xeee0('0x38')]=_['keys'](_0x51375f['query']);_0x63bfe9['filters']=_['intersection'](_0x63bfe9[_0xeee0('0x37')],_0x63bfe9['query']);_0x52c2ab[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x63bfe9['model'],qs[_0xeee0('0x3d')](_0x51375f['query']['fields']));_0x52c2ab[_0xeee0('0x3c')]=_0x52c2ab['attributes'][_0xeee0('0x3e')]?_0x52c2ab[_0xeee0('0x3c')]:_0x63bfe9[_0xeee0('0x37')];if(!_0x51375f[_0xeee0('0x38')][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x52c2ab[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x51375f[_0xeee0('0x38')][_0xeee0('0x25')]);_0x52c2ab[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x51375f[_0xeee0('0x38')][_0xeee0('0x41')]);}_0x52c2ab[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x51375f['query'][_0xeee0('0x43')]);_0x52c2ab[_0xeee0('0x44')]=qs['filters'](_[_0xeee0('0x45')](_0x51375f['query'],_0x63bfe9[_0xeee0('0x3a')]));_0x52c2ab[_0xeee0('0x44')][_0xeee0('0x5c')]=_0x3cfc65['id'];if(_0x51375f[_0xeee0('0x38')]['filter']){_0x52c2ab[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x52c2ab[_0xeee0('0x44')],{'$or':_['map'](_0x52c2ab[_0xeee0('0x3c')],function(_0x4e6a1c){var _0x40ee54={};_0x40ee54[_0x4e6a1c]={'$like':'%'+_0x51375f[_0xeee0('0x38')]['filter']+'%'};return _0x40ee54;})});}_0x52c2ab=_[_0xeee0('0x47')]({},_0x52c2ab,_0x51375f[_0xeee0('0x4f')]);return db[_0xeee0('0x5d')][_0xeee0('0x24')]({'where':_0x52c2ab[_0xeee0('0x44')]})['then'](function(_0x40ce48){_0x32e2a5['count']=_0x40ce48;if(_0x51375f[_0xeee0('0x38')]['includeAll']){_0x52c2ab[_0xeee0('0x4e')]=[{'all':!![]}];}return db[_0xeee0('0x5d')][_0xeee0('0x4b')](_0x52c2ab);})[_0xeee0('0x29')](function(_0x58fe54){_0x32e2a5['rows']=_0x58fe54;return _0x32e2a5;});}})[_0xeee0('0x29')](respondWithFilteredResult(_0xabc6fe,_0x52c2ab))[_0xeee0('0x1e')](handleError(_0xabc6fe,null));};exports[_0xeee0('0x60')]=function(_0x520658,_0x19aa2b){return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x520658[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x19aa2b,null))['then'](function(_0x46e351){if(_0x46e351){return _0x46e351[_0xeee0('0x60')](_0x520658[_0xeee0('0x38')][_0xeee0('0x61')]);}})[_0xeee0('0x29')](respondWithStatusCode(_0x19aa2b,null))['catch'](handleError(_0x19aa2b,null));};exports[_0xeee0('0x62')]=function(_0x24bbc2,_0x22137f){if(_0x24bbc2[_0xeee0('0x59')]['id']){delete _0x24bbc2[_0xeee0('0x59')]['id'];}return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x24bbc2['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x22137f,null))[_0xeee0('0x29')](function(_0x24ff3b){if(_0x24ff3b){_0x24bbc2['body'][_0xeee0('0x5c')]=_0x24ff3b['id'];return db[_0xeee0('0x63')]['create'](_0x24bbc2[_0xeee0('0x59')]);}})[_0xeee0('0x29')](respondWithResult(_0x22137f,null))[_0xeee0('0x1e')](handleError(_0x22137f,null));};exports['getAnswers']=function(_0x472080,_0x2cab82){var _0x1e7e9b={'raw':![],'where':{}};var _0x305c0f={};var _0x3c54e3={'count':0x0,'rows':[]};return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x472080[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x2cab82,null))[_0xeee0('0x29')](function(_0x1c604f){if(_0x1c604f){_0x305c0f[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0x63')][_0xeee0('0x4d')]);_0x305c0f[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x472080[_0xeee0('0x38')]);_0x305c0f[_0xeee0('0x3a')]=_['intersection'](_0x305c0f[_0xeee0('0x37')],_0x305c0f[_0xeee0('0x38')]);_0x1e7e9b['attributes']=_['intersection'](_0x305c0f[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x472080[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x1e7e9b[_0xeee0('0x3c')]=_0x1e7e9b[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x1e7e9b[_0xeee0('0x3c')]:_0x305c0f[_0xeee0('0x37')];if(!_0x472080[_0xeee0('0x38')]['hasOwnProperty'](_0xeee0('0x40'))){_0x1e7e9b[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x472080[_0xeee0('0x38')][_0xeee0('0x25')]);_0x1e7e9b[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x472080['query']['offset']);}_0x1e7e9b[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x472080[_0xeee0('0x38')][_0xeee0('0x43')]);_0x1e7e9b[_0xeee0('0x44')]=qs[_0xeee0('0x3a')](_[_0xeee0('0x45')](_0x472080[_0xeee0('0x38')],_0x305c0f['filters']));_0x1e7e9b[_0xeee0('0x44')][_0xeee0('0x5c')]=_0x1c604f['id'];if(_0x472080['query'][_0xeee0('0x46')]){_0x1e7e9b['where']=_['merge'](_0x1e7e9b['where'],{'$or':_['map'](_0x1e7e9b[_0xeee0('0x3c')],function(_0xae8350){var _0x572f91={};_0x572f91[_0xae8350]={'$like':'%'+_0x472080['query']['filter']+'%'};return _0x572f91;})});}_0x1e7e9b=_[_0xeee0('0x47')]({},_0x1e7e9b,_0x472080[_0xeee0('0x4f')]);return db[_0xeee0('0x63')]['count']({'where':_0x1e7e9b[_0xeee0('0x44')]})['then'](function(_0x77e7ce){_0x3c54e3[_0xeee0('0x24')]=_0x77e7ce;if(_0x472080[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x1e7e9b[_0xeee0('0x4e')]=[{'all':!![]}];}return db[_0xeee0('0x63')][_0xeee0('0x4b')](_0x1e7e9b);})[_0xeee0('0x29')](function(_0x753a8d){_0x3c54e3[_0xeee0('0x64')]=_0x753a8d;return _0x3c54e3;});}})['then'](respondWithFilteredResult(_0x2cab82,_0x1e7e9b))[_0xeee0('0x1e')](handleError(_0x2cab82,null));};exports[_0xeee0('0x65')]=function(_0x6a3436,_0x51790b){return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x6a3436[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51790b,null))[_0xeee0('0x29')](function(_0x4806d4){if(_0x4806d4){return _0x4806d4[_0xeee0('0x65')](_0x6a3436[_0xeee0('0x38')]['ids']);}})[_0xeee0('0x29')](respondWithStatusCode(_0x51790b,null))['catch'](handleError(_0x51790b,null));};exports[_0xeee0('0x66')]=function(_0x55c880,_0xff1731){_0x55c880[_0xeee0('0x59')]['sitepic']=_0x55c880['file'][_0xeee0('0x67')];return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x55c880['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0xff1731,null))['then'](saveUpdates(_0x55c880['body'],null))[_0xeee0('0x29')](respondWithResult(_0xff1731,null))[_0xeee0('0x1e')](handleError(_0xff1731,null));};exports[_0xeee0('0x68')]=function(_0x481b8d,_0x102107){_0x481b8d['body']['agentAvatar']=_0x481b8d[_0xeee0('0x69')]['filename'];return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x481b8d['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x102107,null))[_0xeee0('0x29')](saveUpdates(_0x481b8d['body'],null))['then'](respondWithResult(_0x102107,null))['catch'](handleError(_0x102107,null));};exports[_0xeee0('0x6a')]=function(_0x2fde7e,_0x1e18ca){_0x2fde7e[_0xeee0('0x59')][_0xeee0('0x6b')]=_0x2fde7e[_0xeee0('0x69')][_0xeee0('0x67')];return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x2fde7e[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x1e18ca,null))[_0xeee0('0x29')](saveUpdates(_0x2fde7e['body'],null))['then'](respondWithResult(_0x1e18ca,null))[_0xeee0('0x1e')](handleError(_0x1e18ca,null));};exports[_0xeee0('0x6c')]=function(_0x2333f1,_0x2323a4){_0x2333f1['body'][_0xeee0('0x6d')]=_0x2333f1[_0xeee0('0x69')][_0xeee0('0x67')];return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x2333f1['params']['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x2323a4,null))[_0xeee0('0x29')](saveUpdates(_0x2333f1[_0xeee0('0x59')],null))['then'](respondWithResult(_0x2323a4,null))['catch'](handleError(_0x2323a4,null));};exports[_0xeee0('0x6e')]=function(_0x441561,_0x116c1c){var _0x2205f4=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x71'));var _0x3eae00={'where':{'id':_0x441561['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x246a26=![];return require(_0xeee0('0x72'))[_0xeee0('0x73')]()[_0xeee0('0x29')](function(_0x134274){if(_0x134274){_0x246a26=_0x134274['custom'];}})[_0xeee0('0x29')](function(){return db[_0xeee0('0x33')][_0xeee0('0x50')](_0x3eae00);})[_0xeee0('0x29')](handleEntityNotFound(_0x116c1c,null))[_0xeee0('0x29')](function(_0x53d8cb){if(_0x53d8cb){if(!_[_0xeee0('0x74')](_0x53d8cb['sitepic'])){if(fs['existsSync'](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x75'),_0x53d8cb[_0xeee0('0x76')]))&&_0x246a26){_0x2205f4=path['join'](config[_0xeee0('0x70')],_0xeee0('0x75'),_0x53d8cb[_0xeee0('0x76')]);}}return _0x116c1c[_0xeee0('0x77')](_0x2205f4);}})[_0xeee0('0x1e')](handleError(_0x116c1c,null));};exports[_0xeee0('0x78')]=function(_0x4361bd,_0x58ef38){var _0x16e346=path[_0xeee0('0x6f')](config['root'],_0xeee0('0x79'));var _0x3877a9={'where':{'id':_0x4361bd['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x3877a9)[_0xeee0('0x29')](handleEntityNotFound(_0x58ef38,null))[_0xeee0('0x29')](function(_0x357c45){if(_0x357c45){if(!_[_0xeee0('0x74')](_0x357c45[_0xeee0('0x7a')])){if(fs[_0xeee0('0x7b')](path[_0xeee0('0x6f')](config['root'],_0xeee0('0x7c'),_0x357c45[_0xeee0('0x7a')]))){_0x16e346=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],'server/files/images/avatars/',_0x357c45['agentAvatar']);}}return _0x58ef38[_0xeee0('0x77')](_0x16e346);}})[_0xeee0('0x1e')](handleError(_0x58ef38,null));};exports[_0xeee0('0x7d')]=function(_0x80e4cf,_0x4bff33){var _0x255d36=path['join'](config[_0xeee0('0x70')],_0xeee0('0x7e'));var _0x210acc={'where':{'id':_0x80e4cf[_0xeee0('0x4c')]['id']},'attributes':['id',_0xeee0('0x6b'),'showCustomerAvatar'],'raw':!![]};return db[_0xeee0('0x33')][_0xeee0('0x50')](_0x210acc)[_0xeee0('0x29')](handleEntityNotFound(_0x4bff33,null))['then'](function(_0x5c05eb){if(_0x5c05eb){if(!_[_0xeee0('0x74')](_0x5c05eb[_0xeee0('0x6b')])){if(fs[_0xeee0('0x7b')](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x7c'),_0x5c05eb[_0xeee0('0x6b')]))&&_0x5c05eb[_0xeee0('0x7f')]){_0x255d36=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0x7c'),_0x5c05eb[_0xeee0('0x6b')]);}}return _0x4bff33[_0xeee0('0x77')](_0x255d36);}})['catch'](handleError(_0x4bff33,null));};exports[_0xeee0('0x80')]=function(_0x3f8d24,_0x31b836){var _0x271800=path['join'](config[_0xeee0('0x70')],'server/files/images/avatars/system_avatar.png');var _0x4a8722={'where':{'id':_0x3f8d24['params']['id']},'attributes':['id',_0xeee0('0x6d')],'raw':!![]};return db[_0xeee0('0x33')]['find'](_0x4a8722)[_0xeee0('0x29')](handleEntityNotFound(_0x31b836,null))[_0xeee0('0x29')](function(_0x257cff){if(_0x257cff){if(!_['isNil'](_0x257cff[_0xeee0('0x6d')])){if(fs[_0xeee0('0x7b')](path['join'](config[_0xeee0('0x70')],'server/files/images/avatars/',_0x257cff[_0xeee0('0x6d')]))){_0x271800=path['join'](config[_0xeee0('0x70')],_0xeee0('0x7c'),_0x257cff[_0xeee0('0x6d')]);}}return _0x31b836[_0xeee0('0x77')](_0x271800);}})[_0xeee0('0x1e')](handleError(_0x31b836,null));};exports[_0xeee0('0x81')]=function(_0x537e61,_0x3243e9){var _0x2f2fcb=require(_0xeee0('0x82'));var _0x5dbc8c=new _0x2f2fcb();var _0x5ca16d=_0x5dbc8c[_0xeee0('0x83')](_0x537e61[_0xeee0('0x84')][_0xeee0('0x85')])[_0xeee0('0x86')]();var _0x51a543={'body':_0x537e61['body'],'channel':_0xeee0('0x87')};var _0x222402=[];var _0x4f62ae=[];var _0xd30fc3={};var _0x23c690=![];return db[_0xeee0('0x88')][_0xeee0('0x5a')]()[_0xeee0('0x29')](function(_0xebe931){if(!_0xebe931){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0x8b'));}_0x222402=_[_0xeee0('0x8c')](_[_0xeee0('0x39')](_0xebe931),[_0xeee0('0x8d'),_0xeee0('0x8e')]);_0x4f62ae=_[_0xeee0('0x8c')](_['keys'](_0xebe931),['createdAt',_0xeee0('0x8e'),_0xeee0('0x8f'),_0xeee0('0x90')]);if(_0x537e61['body']['id']){delete _0x537e61['body']['id'];}if(_[_0xeee0('0x74')](_0x537e61[_0xeee0('0x59')]['from'])){throw new db[(_0xeee0('0x89'))]['ValidationError'](_0xeee0('0x91'));}if(_[_0xeee0('0x74')](_0x537e61[_0xeee0('0x59')][_0xeee0('0x59')])||_0x537e61['body'][_0xeee0('0x59')]===''){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0x92'));}if(_['isNil'](_0x537e61[_0xeee0('0x59')]['mapKey'])){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f62ae);}if(!_[_0xeee0('0x93')](_0x4f62ae,_0x537e61[_0xeee0('0x59')]['mapKey'])){throw new db[(_0xeee0('0x89'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f62ae);}_0xd30fc3[_0x537e61[_0xeee0('0x59')][_0xeee0('0x94')]]=_0x537e61[_0xeee0('0x59')][_0xeee0('0x95')];})['then'](function(){return db['ChatWebsite'][_0xeee0('0x50')]({'where':{'id':_0x537e61[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x96')],'as':_0xeee0('0x97'),'include':[{'model':db['CmContact'],'as':_0xeee0('0x98'),'where':_0xd30fc3,'limit':0x1,'order':[[_0xeee0('0x8e'),_0xeee0('0x99')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0xeee0('0x29')](handleEntityNotFound(_0x3243e9,null))[_0xeee0('0x29')](function(_0x31f899){if(_0x31f899&&_0x31f899[_0xeee0('0x97')]){_0x51a543[_0xeee0('0x9a')]=_0x31f899;_0x51a543[_0xeee0('0x9b')]=_0x31f899[_0xeee0('0x9c')];_0x51a543[_0xeee0('0x9d')]=_0x31f899['List'];_0x51a543[_0xeee0('0x9b')]=_['orderBy'](_0x51a543[_0xeee0('0x9b')],['priority'],[_0xeee0('0x9e')]);if(_0x51a543[_0xeee0('0x9a')][_0xeee0('0x9c')]){delete _0x51a543[_0xeee0('0x9a')][_0xeee0('0x9c')];}if(_0x51a543[_0xeee0('0x9a')][_0xeee0('0x97')]&&_0x51a543['account']['List'][_0xeee0('0x98')][_0xeee0('0x3e')]){return _0x51a543[_0xeee0('0x9a')][_0xeee0('0x97')][_0xeee0('0x98')][0x0];}var _0x1ad541=_[_0xeee0('0xc')](_0x537e61[_0xeee0('0x59')],{'firstName':_0x537e61[_0xeee0('0x59')][_0xeee0('0x95')],'ListId':_0x31f899[_0xeee0('0x90')]});_0x1ad541[_0x537e61[_0xeee0('0x59')]['mapKey']]=_0x537e61[_0xeee0('0x59')][_0xeee0('0x95')];return db['CmContact'][_0xeee0('0x51')](_0x1ad541,{'fields':_0x222402,'raw':!![]});}})[_0xeee0('0x29')](handleEntityNotFound(_0x3243e9,null))[_0xeee0('0x29')](function(_0xe3a476){_0x51a543[_0xeee0('0x9f')]=_0xe3a476;var _0x1ee22b=_0x537e61[_0xeee0('0x59')]['customerIp'];if(_0x537e61[_0xeee0('0x84')][_0xeee0('0xa0')]){_0x1ee22b=_0x537e61[_0xeee0('0x84')]['cf-connecting-ip'];}else if(_0x537e61['headers'][_0xeee0('0xa1')]){_0x1ee22b=_['first'](_0x537e61[_0xeee0('0x84')][_0xeee0('0xa1')]['split'](','));}if(_0xe3a476){var _0x4884b9={'ContactId':_0xe3a476['id'],'ChatWebsiteId':_0x537e61['params']['id'],'from':(_0xe3a476['firstName']||'')+'\x20'+(_0xe3a476[_0xeee0('0xa2')]||''),'customerIp':_0x1ee22b,'customerPort':_0x537e61['headers'][_0xeee0('0xa3')]?_0x537e61[_0xeee0('0x84')]['x-real-port']:null,'referer':_0x537e61[_0xeee0('0x59')][_0xeee0('0xa4')],'browserName':_0x5ca16d[_0xeee0('0xa5')][_0xeee0('0x49')]&&_0x5ca16d[_0xeee0('0xa5')][_0xeee0('0xa6')]?util[_0xeee0('0xa7')](_0xeee0('0xa8'),_0x5ca16d[_0xeee0('0xa5')]['name'],_0x5ca16d['browser'][_0xeee0('0xa6')]):'unknown','browserVersion':_0x5ca16d[_0xeee0('0xa5')][_0xeee0('0xa6')]||_0xeee0('0xa9'),'osName':util[_0xeee0('0xa7')]('%s\x20%s',_0x5ca16d['os']['name'],_0x5ca16d['os'][_0xeee0('0xa6')]),'osVersion':_0x5ca16d['os'][_0xeee0('0xa6')],'deviceModel':_0x5ca16d[_0xeee0('0xaa')]['model']&&_0x5ca16d['device'][_0xeee0('0xab')]?util[_0xeee0('0xa7')](_0xeee0('0xac'),_0x5ca16d[_0xeee0('0xaa')][_0xeee0('0x37')],_0x5ca16d[_0xeee0('0xaa')]['vendor'],_0x5ca16d['device']['type']):null,'deviceVendor':_0x5ca16d[_0xeee0('0xaa')][_0xeee0('0xab')],'deviceType':_0x5ca16d[_0xeee0('0xaa')][_0xeee0('0x35')],'formData':JSON[_0xeee0('0xad')](_0x537e61[_0xeee0('0x59')])};var _0x1a57e5={'ChatWebsiteId':_0x537e61['params']['id'],'closed':![]};if(_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')]){_0x1a57e5[_0xeee0('0xae')]=_0x537e61[_0xeee0('0x59')]['threadId'];return db['ChatInteraction'][_0xeee0('0x50')]({'where':_0x1a57e5})['then'](function(_0x4f32b2){if(_0x4f32b2){return[_0x4f32b2,![]];}_0x4884b9[_0xeee0('0xae')]=_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')];_0x4884b9['externalUrl']=_0x537e61[_0xeee0('0x59')][_0xeee0('0xaf')];return db[_0xeee0('0xb0')][_0xeee0('0x51')](_0x4884b9)['then'](function(_0x555f1a){return[_0x555f1a,!![]];});});}_0x1a57e5[_0xeee0('0xb1')]=_0xe3a476['id'];if(_0x537e61[_0xeee0('0x59')][_0xeee0('0xb2')]&&_0x537e61[_0xeee0('0x59')][_0xeee0('0xb2')]['id']){_0x1a57e5['id']=_0x537e61[_0xeee0('0x59')]['interaction']['id'];return db[_0xeee0('0xb0')][_0xeee0('0x50')]({'where':_0x1a57e5})[_0xeee0('0x29')](function(_0x3cb85e){if(_0x3cb85e){return[_0x3cb85e,![]];}return db['ChatInteraction'][_0xeee0('0x51')](_0x4884b9)[_0xeee0('0x29')](function(_0x3a582a){return[_0x3a582a,!![]];});});}return db[_0xeee0('0xb0')][_0xeee0('0x51')](_0x4884b9)[_0xeee0('0x29')](function(_0x209eb9){return[_0x209eb9,!![]];});}})['spread'](function(_0x5e7e13,_0x598250){if(_0x5e7e13){_0x23c690=_0x598250;if(!_0x598250){var _0xc178fc={'from':(_0x51a543[_0xeee0('0x9f')]['firstName']||'')+'\x20'+(_0x51a543[_0xeee0('0x9f')]['lastName']||'')};if(_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')]&&_0x537e61[_0xeee0('0x59')][_0xeee0('0xb3')]&&_0x537e61[_0xeee0('0x59')][_0xeee0('0xae')]!=_0x537e61[_0xeee0('0x59')][_0xeee0('0xb3')]){_0xc178fc['threadId']=_0x537e61['body']['messageId'];}return _0x5e7e13[_0xeee0('0x28')](_0xc178fc);}else{return _0x5e7e13;}}})[_0xeee0('0x29')](function(_0x3d938c){_0x51a543[_0xeee0('0xb2')]=_0x3d938c[_0xeee0('0x53')]({'plain':!![]});_0x51a543['interaction'][_0xeee0('0xb4')]=_0x23c690;if(_0x51a543['interaction']['created']){if(_0x51a543[_0xeee0('0x9a')]['autoclose']){_0x51a543[_0xeee0('0x9b')][_0xeee0('0xb5')]({'id':0x0,'priority':_0x51a543[_0xeee0('0x9b')][_0xeee0('0x3e')]+0x1,'app':_0xeee0('0xb6'),'appdata':_0xeee0('0xb7'),'interval':_0xeee0('0xb8')});}}return db['ChatMessage']['create']({'body':_0x537e61[_0xeee0('0x59')][_0xeee0('0x59')],'ChatWebsiteId':_0x537e61[_0xeee0('0x4c')]['id'],'ChatInteractionId':_0x3d938c['id'],'direction':'in','ContactId':_0x51a543[_0xeee0('0x9f')]['id'],'AttachmentId':_0x537e61[_0xeee0('0x59')][_0xeee0('0xb9')]});})['then'](function(_0x57afb9){_0x51a543[_0xeee0('0x1b')]=_0x57afb9;if(_0x51a543[_0xeee0('0xb2')][_0xeee0('0xba')]){return db[_0xeee0('0xbb')][_0xeee0('0x50')]({'attributes':['id',_0xeee0('0x49')],'where':{'id':_0x51a543['interaction']['UserId']}})[_0xeee0('0x29')](function(_0x34491f){if(_0x34491f){_0x51a543[_0xeee0('0x9b')][_0xeee0('0xbc')]({'id':0x0,'priority':0x0,'app':_0xeee0('0xbd'),'appdata':_0x34491f[_0xeee0('0x49')]+','+(_0x51a543['account'][_0xeee0('0xbe')]||0xa),'interval':_0xeee0('0xb8')});_0x51a543['forcedOwnership']=!![];}return respondWithRpcPromise(_0xeee0('0xbf'),'startRouting',_0x51a543);});}return respondWithRpcPromise(_0xeee0('0xbf'),_0xeee0('0xc0'),_0x51a543);})[_0xeee0('0x29')](function(_0x1d2f0f){respondWithRpcPromise(_0xeee0('0xc1'),_0xeee0('0xc1'),{'event':'notify','message':_0x1d2f0f},client9002);return _0x1d2f0f;})['then'](respondWithResult(_0x3243e9,null))[_0xeee0('0x1e')](handleError(_0x3243e9,null));};exports[_0xeee0('0xc2')]=function(_0x10f762,_0x491093){var _0x482e01,_0x2cb0ea,_0x33beb3;var _0x191b48=[];var _0x5c4e44={};var _0x2dec3d=_0x10f762[_0xeee0('0xc3')]||[];var _0x2235ed=[];var _0x4d6f13;return db[_0xeee0('0x88')][_0xeee0('0x5a')]()[_0xeee0('0x29')](function(_0x5eebb6){if(!_0x5eebb6){throw new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0x8b'));}_0x191b48=_[_0xeee0('0x8c')](_['keys'](_0x5eebb6),['createdAt',_0xeee0('0x8e'),'CompanyId',_0xeee0('0x90')]);if(_0x10f762[_0xeee0('0x59')]['id']){delete _0x10f762[_0xeee0('0x59')]['id'];}if(_[_0xeee0('0x74')](_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')])){throw _0x491093[_0xeee0('0x20')](0x1f4)[_0xeee0('0x2e')](new db['Sequelize'][(_0xeee0('0x8a'))](_0xeee0('0x91')));}if(_[_0xeee0('0x74')](_0x10f762[_0xeee0('0x59')][_0xeee0('0x59')])||_0x10f762[_0xeee0('0x59')][_0xeee0('0x59')]===''){throw _0x491093[_0xeee0('0x20')](0x1f4)['send'](new db[(_0xeee0('0x89'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xeee0('0x74')](_0x10f762[_0xeee0('0x59')]['mapKeyOffline'])){throw _0x491093['status'](0x1f4)[_0xeee0('0x2e')](new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x191b48));}if(!_[_0xeee0('0x93')](_0x191b48,_0x10f762[_0xeee0('0x59')][_0xeee0('0xc4')])){throw _0x491093['status'](0x1f4)['send'](new db[(_0xeee0('0x89'))][(_0xeee0('0x8a'))](_0xeee0('0xc5')+_0x191b48));}_0x5c4e44[_0x10f762['body'][_0xeee0('0xc4')]]=_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')];})[_0xeee0('0x29')](function(){return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x10f762[_0xeee0('0x4c')]['id']},'include':[{'model':db[_0xeee0('0x96')],'as':_0xeee0('0x97')},{'model':db[_0xeee0('0xc6')],'as':_0xeee0('0xc6')}]});})['then'](handleEntityNotFound(_0x491093,null))[_0xeee0('0x29')](function(_0x365edd){if(_0x365edd&&_0x365edd[_0xeee0('0x97')]){_0x2cb0ea=_0x365edd;var _0x20d9ed=_[_0xeee0('0xc')](_0x10f762[_0xeee0('0x59')],{'firstName':_0x10f762['body'][_0xeee0('0x95')],'phone':_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')],'ListId':_0x365edd[_0xeee0('0x90')]});_0x20d9ed[_0x10f762[_0xeee0('0x59')]['mapKeyOffline']]=_0x10f762[_0xeee0('0x59')][_0xeee0('0x95')];return db[_0xeee0('0x88')][_0xeee0('0xc7')]({'where':_0x5c4e44,'defaults':_0x20d9ed});}})[_0xeee0('0xc8')](function(_0x435608){if(_0x435608){_0x33beb3=_0x435608;var _0x4ac442=fs['readFileSync'](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0xc9')),_0xeee0('0xca'));var _0x20a62f=ejs['render'](_0x4ac442,{'body':_['toPairs'](_0x10f762[_0xeee0('0x59')]['body']),'bodyTitle':_0x2cb0ea[_0xeee0('0xcb')]});return db[_0xeee0('0xcc')][_0xeee0('0x51')]({'body':_0x20a62f,'plainBody':htmlToText[_0xeee0('0xcd')](_0x20a62f),'ContactId':_0x435608['id'],'ChatWebsiteId':_0x2cb0ea['id']});}})[_0xeee0('0x29')](function(_0x8cdeaa){_0x4d6f13=_0x8cdeaa;if(_0x2dec3d[_0xeee0('0x3e')]){var _0x2a52fb=_0x2dec3d[_0xeee0('0x32')](function(_0x3b4ed6){return{'name':_0x3b4ed6[_0xeee0('0xce')],'basename':_0x3b4ed6[_0xeee0('0x67')],'type':_0x3b4ed6[_0xeee0('0xcf')],'ChatOfflineMessageId':_0x8cdeaa['id']};});_0x2235ed=_0x2a52fb[_0xeee0('0x32')](_0x485833=>{var _0x356144={'filename':_0x485833[_0xeee0('0x49')],'path':path['join'](config[_0xeee0('0x70')],_0xeee0('0xd0'),'files',_0xeee0('0xd1'),_0xeee0('0xd2'),_0x485833['basename'])};return _0x356144;});if(!_0x2cb0ea[_0xeee0('0xd3')]){return db['sequelize'][_0xeee0('0xd4')](function(_0x5d9956){return db[_0xeee0('0xd5')]['bulkCreate'](_0x2a52fb,{'transaction':_0x5d9956});});}}})[_0xeee0('0x29')](function(){if(_0x4d6f13){_0x482e01=_0x4d6f13;return db[_0xeee0('0xc6')][_0xeee0('0x5f')]({'where':{'service':!![]},'include':[{'model':db[_0xeee0('0xd6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xeee0('0xd7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xeee0('0x29')](function(_0x33682c){if(_0x33682c&&_0x33682c['Smtp']&&_0x2cb0ea[_0xeee0('0xd8')]&&_0x2cb0ea['forwardOfflineAddress']){var _0x555cea=_0x33682c[_0xeee0('0xd9')]();return respondWithRpcPromise(_0xeee0('0xda'),_0xeee0('0xdb'),{'account':_0x555cea,'message':{'from':util['format'](_0xeee0('0xdc'),_0x33682c[_0xeee0('0x49')],_0x33682c[_0xeee0('0xdd')]||_0x33682c[_0xeee0('0xde')]['user']),'to':_0x2cb0ea[_0xeee0('0xdf')],'subject':_0x2cb0ea[_0xeee0('0xe0')],'html':_0x482e01[_0xeee0('0x59')],'attachments':_0x2235ed}},client9003)[_0xeee0('0x29')](function(){return _0x482e01;})[_0xeee0('0x1e')](function(_0xe7b1ee){logger[_0xeee0('0x18')](_0xe7b1ee);});}})[_0xeee0('0x29')](function(){if(_0x2cb0ea&&_0x2cb0ea[_0xeee0('0xd3')]&&_0x2cb0ea['MailAccountId']){var _0x4d8595=[];if(_0x2dec3d[_0xeee0('0x3e')]){_0x4d8595=_0x2dec3d[_0xeee0('0x32')](function(_0x2ac57c){return{'name':_0x2ac57c[_0xeee0('0xce')],'basename':_0x2ac57c['filename'],'type':_0x2ac57c[_0xeee0('0xcf')],'ChatOfflineMessageId':_0x4d6f13['id']};});}var _0x5824ef;if(!_[_0xeee0('0x74')](_0x2cb0ea[_0xeee0('0xe1')])){var _0x1f4379=_['map'](_0x10f762[_0xeee0('0x59')],function(_0xad477){return _0xad477;});var _0x1208f3=_[_0xeee0('0xe2')](_0x1f4379)[0x0];var _0x4b0e35=_['mapValues'](_0x1208f3,function(_0x5d86ab){return _0x5d86ab;});_0x5824ef=_0x4b0e35[0x1][_0x2cb0ea['subjectOffline']];}var _0x59428d={'from':_0x33beb3[_0xeee0('0xdd')],'firstName':_0x33beb3[_0xeee0('0xe3')],'lastName':_0x33beb3[_0xeee0('0xa2')],'mapKey':_0xeee0('0xdd'),'message':{'from':_0x33beb3[_0xeee0('0xdd')],'to':_0x2cb0ea[_0xeee0('0xc6')][_0xeee0('0xdd')],'cc':'','subject':_[_0xeee0('0x74')](_0x5824ef)?_0x2cb0ea[_0xeee0('0xe0')]:_0x5824ef,'messageId':'','sentAt':new Date(),'attach':_0x4d8595[_0xeee0('0x3e')],'attachments':_0x4d8595,'originChannel':'Chat','ChatWebsiteId':_0x2cb0ea['id'],'ChatOfflineMessageId':_0x482e01['id'],'originTo':_0x2cb0ea[_0xeee0('0xc6')][_0xeee0('0xdd')]},'body':_0x482e01[_0xeee0('0x59')]};var _0x57ec85={'account':{'id':_0x2cb0ea['MailAccountId']},'body':_0x59428d,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xeee0('0xe4'),_0x57ec85,client9001)['then'](function(){return _0x482e01;})[_0xeee0('0x1e')](function(_0x5b7a1b){logger[_0xeee0('0x18')](_0x5b7a1b);});}return;})[_0xeee0('0x29')](function(){if(_0x482e01){return _0x482e01;}})['then'](respondWithResult(_0x491093,null))[_0xeee0('0x1e')](function(_0x541e7e){logger[_0xeee0('0x18')](_0xeee0('0x1e'),_0x541e7e);for(var _0xafef87 of _0x2dec3d){var _0x309d0b=path[_0xeee0('0x6f')](config[_0xeee0('0x70')],_0xeee0('0xd0'),_0xeee0('0xc3'),_0xeee0('0xd1'),_0xeee0('0xd2'),_0xafef87[_0xeee0('0x67')]);fs_extra[_0xeee0('0xe5')](_0x309d0b)[_0xeee0('0x1e')](function(_0x24caea){logger[_0xeee0('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0x309d0b,_0x24caea);});}});};exports[_0xeee0('0xe6')]=function(_0x398b7a,_0x2753cf){return db[_0xeee0('0xb0')]['find']({'where':{'id':_0x398b7a[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x2753cf,null))[_0xeee0('0x29')](function(_0x2f3b73){if(_0x2f3b73){return _0x2f3b73[_0xeee0('0xe6')](_0x398b7a[_0xeee0('0x59')][_0xeee0('0x61')],_[_0xeee0('0xe7')](_0x398b7a['body'],[_0xeee0('0x61'),'id'])||{});}})[_0xeee0('0x29')](respondWithResult(_0x2753cf,null))[_0xeee0('0x1e')](handleError(_0x2753cf,null));};exports[_0xeee0('0xe8')]=function(_0x4aff06,_0xbb33e0){var _0x871bf3={'raw':![],'where':{}};var _0x40c6ca={};var _0x5a08a4={'count':0x0,'rows':[]};return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x4aff06[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0xbb33e0,null))[_0xeee0('0x29')](function(_0x2e4d6c){if(_0x2e4d6c){_0x40c6ca[_0xeee0('0x37')]=_[_0xeee0('0x39')](db[_0xeee0('0xb0')]['rawAttributes']);_0x40c6ca[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x4aff06[_0xeee0('0x38')]);_0x40c6ca[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x40c6ca['model'],_0x40c6ca['query']);_0x871bf3[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x40c6ca[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x4aff06['query']['fields']));_0x871bf3[_0xeee0('0x3c')]=_0x871bf3['attributes']['length']?_0x871bf3[_0xeee0('0x3c')]:_0x40c6ca[_0xeee0('0x37')];if(!_0x4aff06['query'][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x871bf3[_0xeee0('0x25')]=qs['limit'](_0x4aff06[_0xeee0('0x38')][_0xeee0('0x25')]);_0x871bf3[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x4aff06['query'][_0xeee0('0x41')]);}_0x871bf3[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x4aff06[_0xeee0('0x38')][_0xeee0('0x43')]);_0x871bf3['where']=qs['filters'](_[_0xeee0('0x45')](_0x4aff06[_0xeee0('0x38')],_0x40c6ca['filters']));_0x871bf3['where']['ChatWebsiteId']=_0x2e4d6c['id'];if(_0x4aff06['query']['filter']){_0x871bf3[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x871bf3['where'],{'$or':_['map'](_0x871bf3[_0xeee0('0x3c')],function(_0x11538c){var _0x3944d9={};_0x3944d9[_0x11538c]={'$like':'%'+_0x4aff06[_0xeee0('0x38')]['filter']+'%'};return _0x3944d9;})});}_0x871bf3=_[_0xeee0('0x47')]({},_0x871bf3,_0x4aff06['options']);return db['ChatInteraction'][_0xeee0('0x24')]({'where':_0x871bf3[_0xeee0('0x44')]})[_0xeee0('0x29')](function(_0x14aa61){_0x5a08a4[_0xeee0('0x24')]=_0x14aa61;if(_0x4aff06[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x871bf3[_0xeee0('0x4e')]=[{'model':db[_0xeee0('0x88')],'as':'Contact','required':![]},{'model':db[_0xeee0('0xbb')],'as':_0xeee0('0xe9'),'attributes':[_0xeee0('0x49'),'fullname',_0xeee0('0xea')],'required':![]},{'model':db[_0xeee0('0xeb')],'as':'Tags','attributes':['id',_0xeee0('0x49'),'color'],'where':_0x4aff06['query'][_0xeee0('0xec')]?{'id':_0x4aff06[_0xeee0('0x38')]['tag']}:undefined,'required':_0x4aff06['query'][_0xeee0('0xec')]?!![]:![]}];}return db[_0xeee0('0xb0')][_0xeee0('0x4b')](_0x871bf3);})[_0xeee0('0x29')](function(_0x17cac0){_0x5a08a4[_0xeee0('0x64')]=_0x17cac0;return _0x5a08a4;});}})['then'](respondWithFilteredResult(_0xbb33e0,_0x871bf3))[_0xeee0('0x1e')](handleError(_0xbb33e0,null));};function iftimePromise(_0x1977ae,_0x511c23){return respondWithRpcPromise(_0xeee0('0xed'),_0xeee0('0xee'),{'command':_0x511c23[_0xeee0('0xef')]?util[_0xeee0('0xa7')](_0xeee0('0xf0'),_0x1977ae[_0xeee0('0xf1')],_0x511c23[_0xeee0('0xef')]):util[_0xeee0('0xa7')](_0xeee0('0xf2'),_0x1977ae[_0xeee0('0xf1')])},client9002)[_0xeee0('0x29')](function(_0x1e7c2f){var _0x5cdbf8=_0x1e7c2f&&_0x1e7c2f[_0xeee0('0xf3')](_0xeee0('0xf4'))>=0x0?!![]:![];logger[_0xeee0('0x1c')](_0xeee0('0xf5'),_0x511c23['id'],_0x1977ae['id'],_0x1977ae['interval'],_0x5cdbf8?'ONLINE':_0xeee0('0xf6'),_0x511c23[_0xeee0('0xef')]?_0x511c23[_0xeee0('0xef')]:'No\x20timezone');return _0x5cdbf8;})[_0xeee0('0x1e')](function(_0xa1046c){logger[_0xeee0('0x18')](_0xeee0('0xf5'),_0x511c23['id'],_0x1977ae['id'],_0x1977ae[_0xeee0('0xf1')],util[_0xeee0('0xf7')](_0xa1046c,{'showHidden':![],'depth':null}),_0x511c23[_0xeee0('0xef')]?_0x511c23[_0xeee0('0xef')]:_0xeee0('0xf8'));return![];});}exports[_0xeee0('0xee')]=function(_0x163bfc,_0x1a23d2){var _0x1a7234=0x0;var _0x384843=0x0;var _0x130df5=![];var _0x279918;var _0x430158;return db[_0xeee0('0x33')][_0xeee0('0x50')]({'where':{'id':_0x163bfc['params']['id']},'include':[{'model':db['Interval'],'as':_0xeee0('0xf9'),'include':[{'model':db[_0xeee0('0xf9')],'as':'Intervals','attributes':['id',_0xeee0('0xf1')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1a23d2,null))[_0xeee0('0x29')](function(_0x874935){if(_0x874935){_0x279918=_0x874935;return _0x874935[_0xeee0('0xfa')]({'raw':!![]});}})['then'](function(_0x340bd1){if(_0x279918){if(_0x340bd1){_0x430158=_0x340bd1;}}return require(_0xeee0('0x72'))[_0xeee0('0x73')]();})[_0xeee0('0x29')](function(_0x5b7941){if(_0x5b7941){_0x384843=_0x5b7941[_0xeee0('0xfb')];_0x130df5=_0x5b7941[_0xeee0('0xfc')];}})[_0xeee0('0x29')](function(){return db['ChatInteraction'][_0xeee0('0x24')]({'where':{'closed':![]}});})[_0xeee0('0x29')](function(_0x46d237){_0x1a7234=_0x46d237;if(_0x384843&&_0x46d237>_0x384843){return db[_0xeee0('0xfd')][_0xeee0('0x5f')]({'where':{'id':0x1}})[_0xeee0('0x29')](function(_0x39bcf9){if(_0x39bcf9){_0x39bcf9['increment']('chatLicenseExceeded');}});}})[_0xeee0('0x29')](function(){if(_0x279918['Interval']&&_0x279918[_0xeee0('0xf9')][_0xeee0('0xfe')]){var _0x1f813e=[];for(var _0x15aef2=0x0;_0x15aef2<_0x279918['Interval'][_0xeee0('0xfe')][_0xeee0('0x3e')];_0x15aef2++){var _0x1a3e61=_0x279918[_0xeee0('0xf9')][_0xeee0('0xfe')][_0x15aef2]['get']({'plain':!![]});_0x1f813e[_0xeee0('0xb5')](iftimePromise(_0x1a3e61,_0x279918));}return BPromise[_0xeee0('0xff')](_0x1f813e)[_0xeee0('0x29')](function(_0x580847){return _[_0xeee0('0x100')](_0x580847);});}else{return!![];}})['then'](function(_0x1329b1){var _0x24a58c=fs[_0xeee0('0x101')](path[_0xeee0('0x6f')](config[_0xeee0('0x70')],'server/files/chat/iframe.ejs'),_0xeee0('0xca'));var _0x3b6584=new url['URL'](_0x279918[_0xeee0('0x102')])[_0xeee0('0x103')];var _0x276a05=_0xeee0('0x104');var _0x3c6a36=![];var _0x25d45a={'chatVersion':_0x276a05,'chatWebsiteAddressOrigin':_0x3b6584,'remote':_0x279918[_0xeee0('0x105')],'query':querystring['stringify'](_[_0xeee0('0x47')](_0x279918[_0xeee0('0x53')]({'plain':!![]}),{'customerIp':_0x163bfc[_0xeee0('0x84')]['x-forwarded-for']||_0x163bfc[_0xeee0('0x84')][_0xeee0('0x106')]||_0x163bfc[_0xeee0('0x107')][_0xeee0('0x108')]||_0x163bfc['ip'],'referer':_0x163bfc['headers']['referer'],'openedInteractions':_0x1a7234,'maxInteractions':_0x384843,'virtual':_0x130df5['virtual'],'online':_0x1329b1,'custom':_0x130df5}))['replace'](/'/g,'\x5c\x27')};_0x1a23d2[_0xeee0('0x2e')](ejs[_0xeee0('0x109')](Mustache[_0xeee0('0x109')](_0x24a58c,_0x25d45a),{'proactiveActions':_0x430158,'alignment':_0x279918[_0xeee0('0x10a')],'verticalAlignment':_0x279918[_0xeee0('0x10b')],'div_color':_0x279918[_0xeee0('0x10c')],'labelText':_0x279918['labelText'],'text_color':_0x279918[_0xeee0('0x10d')],'text_button_color':_0x279918['textButtonColor'],'button_color':_0x279918[_0xeee0('0x10e')],'background_color':_0x279918['backgroundColor'],'hideWhenOffline':_0x279918[_0xeee0('0x10f')],'intervalId':_0x279918[_0xeee0('0x110')],'isDevelopment':_0x3c6a36,'chatVersion':_0x276a05}));})['catch'](handleError(_0x1a23d2,null));};exports['addApplications']=function(_0x5574d4,_0x149246){var _0x3dedfe=_0x5574d4[_0xeee0('0x4c')]['id'];var _0x5f460a=_0x5574d4[_0xeee0('0x59')];var _0x3557d4=0xc8;var _0x300943=null;return db[_0xeee0('0x111')][_0xeee0('0xd4')]({'isolationLevel':db[_0xeee0('0x111')]['Transaction']['ISOLATION_LEVELS'][_0xeee0('0x112')]},function(_0x4dfb6c){return db['ChatWebsite'][_0xeee0('0x5f')]({'where':{'id':_0x3dedfe},'transaction':_0x4dfb6c})[_0xeee0('0x29')](function(_0x328c3a){if(_0x328c3a){return db[_0xeee0('0x113')][_0xeee0('0x2a')]({'where':{'ChatWebsiteId':_0x3dedfe},'transaction':_0x4dfb6c})['then'](function(){var _0x7466f9=_[_0xeee0('0x32')](_0x5f460a,function(_0x28e99e){_0x28e99e[_0xeee0('0x5c')]=_0x3dedfe;return _0x28e99e;});return db[_0xeee0('0x113')][_0xeee0('0x114')](_0x7466f9,{'transaction':_0x4dfb6c});});}else{_0x3557d4=0x194;_0x300943=[];}});})[_0xeee0('0x29')](function(){if(_0x3557d4!==0x194){return db[_0xeee0('0x113')][_0xeee0('0x115')]({'where':{'ChatWebsiteId':_0x3dedfe},'order':_0xeee0('0x116')})[_0xeee0('0x29')](function(_0x25facc){_0x300943=_0x25facc;});}})[_0xeee0('0x1e')](function(_0x352629){_0x3557d4=0x1f4;logger['error'](_0x352629[_0xeee0('0x2d')]);if(_0x352629[_0xeee0('0x49')]){delete _0x352629[_0xeee0('0x49')];}_0x300943=_0x352629;})[_0xeee0('0x117')](function(){if(_0x300943===null){_0x149246['sendStatus'](_0x3557d4);}else{if(_0x3557d4===0x1f4){_0x149246[_0xeee0('0x20')](_0x3557d4)[_0xeee0('0x2e')](_0x300943);}else{_0x149246[_0xeee0('0x20')](_0x3557d4)['json'](_0x300943);}}});};exports['getApplications']=function(_0x4a281b,_0x50fc61){var _0x49a108={};var _0x33329e={};var _0x53e80f;var _0x4ae2ff;return db[_0xeee0('0x33')]['findOne']({'where':{'id':_0x4a281b['params']['id']}})['then'](handleEntityNotFound(_0x50fc61,null))['then'](function(_0x154f14){if(_0x154f14){_0x53e80f=_0x154f14;_0x33329e[_0xeee0('0x37')]=_[_0xeee0('0x39')](db[_0xeee0('0x113')][_0xeee0('0x4d')]);_0x33329e['query']=_['keys'](_0x4a281b[_0xeee0('0x38')]);_0x33329e[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x33329e[_0xeee0('0x37')],_0x33329e[_0xeee0('0x38')]);_0x49a108['attributes']=_['intersection'](_0x33329e[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x4a281b['query']['fields']));_0x49a108['attributes']=_0x49a108[_0xeee0('0x3c')]['length']?_0x49a108[_0xeee0('0x3c')]:_0x33329e[_0xeee0('0x37')];_0x49a108[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x4a281b[_0xeee0('0x38')][_0xeee0('0x43')]);_0x49a108[_0xeee0('0x44')]=qs[_0xeee0('0x3a')](_['pick'](_0x4a281b[_0xeee0('0x38')],_0x33329e[_0xeee0('0x3a')]));if(_0x4a281b['query'][_0xeee0('0x46')]){_0x49a108[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x49a108[_0xeee0('0x44')],{'$or':_['map'](_0x49a108[_0xeee0('0x3c')],function(_0x3dbd36){var _0xa0b35a={};_0xa0b35a[_0x3dbd36]={'$like':'%'+_0x4a281b[_0xeee0('0x38')][_0xeee0('0x46')]+'%'};return _0xa0b35a;})});}_0x49a108=_[_0xeee0('0x47')]({},_0x49a108,_0x4a281b[_0xeee0('0x4f')]);return _0x53e80f[_0xeee0('0x118')](_0x49a108);}})['then'](function(_0x339c95){if(_0x339c95){_0x4ae2ff=_0x339c95[_0xeee0('0x3e')];if(!_0x4a281b[_0xeee0('0x38')][_0xeee0('0x3f')]('nolimit')){_0x49a108[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x4a281b[_0xeee0('0x38')][_0xeee0('0x25')]);_0x49a108['offset']=qs[_0xeee0('0x41')](_0x4a281b[_0xeee0('0x38')]['offset']);}return _0x53e80f[_0xeee0('0x118')](_0x49a108);}})['then'](function(_0x397faf){if(_0x397faf){return _0x397faf?{'count':_0x4ae2ff,'rows':_0x397faf}:null;}})['then'](respondWithResult(_0x50fc61,null))[_0xeee0('0x1e')](handleError(_0x50fc61,null));};exports[_0xeee0('0x119')]=function(_0x57380f,_0x4f7024){return db[_0xeee0('0x11a')][_0xeee0('0x50')]({'where':{'id':_0x57380f[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x4f7024,null))[_0xeee0('0x29')](function(_0x1e3d9b){if(_0x1e3d9b){return _0x1e3d9b[_0xeee0('0x119')](_0x57380f[_0xeee0('0x59')][_0xeee0('0x61')],_[_0xeee0('0xe7')](_0x57380f[_0xeee0('0x59')],[_0xeee0('0x61'),'id'])||{});}})[_0xeee0('0x29')](respondWithResult(_0x4f7024,null))[_0xeee0('0x1e')](handleError(_0x4f7024,null));};exports[_0xeee0('0xfa')]=function(_0x441858,_0x443f39){var _0x53d5bc={};var _0x58fbc0={};var _0x484b7a;var _0xb59ce7;return db['ChatWebsite']['findOne']({'where':{'id':_0x441858[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x443f39,null))['then'](function(_0x1c8edc){if(_0x1c8edc){_0x484b7a=_0x1c8edc;_0x58fbc0[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0x11b')][_0xeee0('0x4d')]);_0x58fbc0[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x441858[_0xeee0('0x38')]);_0x58fbc0[_0xeee0('0x3a')]=_[_0xeee0('0x3b')](_0x58fbc0[_0xeee0('0x37')],_0x58fbc0[_0xeee0('0x38')]);_0x53d5bc[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x58fbc0[_0xeee0('0x37')],qs[_0xeee0('0x3d')](_0x441858[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x53d5bc[_0xeee0('0x3c')]=_0x53d5bc['attributes'][_0xeee0('0x3e')]?_0x53d5bc['attributes']:_0x58fbc0[_0xeee0('0x37')];_0x53d5bc[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x441858[_0xeee0('0x38')][_0xeee0('0x43')]);_0x53d5bc[_0xeee0('0x44')]=qs['filters'](_[_0xeee0('0x45')](_0x441858[_0xeee0('0x38')],_0x58fbc0[_0xeee0('0x3a')]));if(_0x441858[_0xeee0('0x38')][_0xeee0('0x46')]){_0x53d5bc['where']=_[_0xeee0('0x47')](_0x53d5bc['where'],{'$or':_[_0xeee0('0x32')](_0x53d5bc[_0xeee0('0x3c')],function(_0x2eae89){var _0x383734={};_0x383734[_0x2eae89]={'$like':'%'+_0x441858['query'][_0xeee0('0x46')]+'%'};return _0x383734;})});}_0x53d5bc=_['merge']({},_0x53d5bc,_0x441858[_0xeee0('0x4f')]);return _0x484b7a[_0xeee0('0xfa')](_0x53d5bc);}})[_0xeee0('0x29')](function(_0x55195d){if(_0x55195d){_0xb59ce7=_0x55195d[_0xeee0('0x3e')];if(!_0x441858['query'][_0xeee0('0x3f')]('nolimit')){_0x53d5bc[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x441858[_0xeee0('0x38')][_0xeee0('0x25')]);_0x53d5bc[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x441858[_0xeee0('0x38')]['offset']);}return _0x484b7a[_0xeee0('0xfa')](_0x53d5bc);}})[_0xeee0('0x29')](function(_0x5bf9c5){if(_0x5bf9c5){return _0x5bf9c5?{'count':_0xb59ce7,'rows':_0x5bf9c5}:null;}})[_0xeee0('0x29')](respondWithResult(_0x443f39,null))['catch'](handleError(_0x443f39,null));};exports[_0xeee0('0x11c')]=function(_0x189474,_0x1fb3e3){var _0xf4e63d=_0x189474[_0xeee0('0x38')][_0xeee0('0x11d')]===_0xeee0('0x11e')?'offlineForm':_0xeee0('0x11f');return db[_0xeee0('0x33')][_0xeee0('0x50')]({'attributes':['id',_0xf4e63d],'where':{'id':_0x189474[_0xeee0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1fb3e3,null))[_0xeee0('0x29')](function(_0x22ed98){if(_0x22ed98){var _0x19b578=_0x22ed98[_0xf4e63d];var _0x164da0=_0x19b578&&_0x19b578[_0xeee0('0x120')]?_0x19b578[_0xeee0('0x120')]:[];_0x1fb3e3[_0xeee0('0x2e')]({'fromKey':_[_0xeee0('0x74')](_0x19b578[_0xeee0('0x121')])?undefined:_0x19b578['fromKey'],'count':_0x164da0[_0xeee0('0x3e')],'rows':_0x164da0});}})[_0xeee0('0x1e')](handleError(_0x1fb3e3,null));};exports[_0xeee0('0x122')]=function(_0x19771a,_0x18d18c){var _0x32700a={'raw':![],'where':{}};var _0x3148df={};var _0x6263a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xeee0('0x5f')]({'where':{'id':_0x19771a[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x18d18c,null))[_0xeee0('0x29')](function(_0x308de4){if(_0x308de4){_0x3148df[_0xeee0('0x37')]=_['keys'](db[_0xeee0('0xcc')][_0xeee0('0x4d')]);_0x3148df[_0xeee0('0x38')]=_['keys'](_0x19771a[_0xeee0('0x38')]);_0x3148df['filters']=_[_0xeee0('0x3b')](_0x3148df[_0xeee0('0x37')],_0x3148df[_0xeee0('0x38')]);_0x32700a[_0xeee0('0x3c')]=_[_0xeee0('0x3b')](_0x3148df[_0xeee0('0x37')],qs['fields'](_0x19771a[_0xeee0('0x38')]['fields']));_0x32700a[_0xeee0('0x3c')]=_0x32700a[_0xeee0('0x3c')]['length']?_0x32700a[_0xeee0('0x3c')]:_0x3148df[_0xeee0('0x37')];if(!_0x19771a['query'][_0xeee0('0x3f')](_0xeee0('0x40'))){_0x32700a[_0xeee0('0x25')]=qs['limit'](_0x19771a[_0xeee0('0x38')][_0xeee0('0x25')]);_0x32700a[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x19771a[_0xeee0('0x38')][_0xeee0('0x41')]);}_0x32700a[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x19771a[_0xeee0('0x38')][_0xeee0('0x43')]);_0x32700a[_0xeee0('0x44')]=qs['filters'](_[_0xeee0('0x45')](_0x19771a[_0xeee0('0x38')],_0x3148df[_0xeee0('0x3a')]));_0x32700a['where']['ChatWebsiteId']=_0x308de4['id'];if(_0x19771a[_0xeee0('0x38')][_0xeee0('0x46')]){_0x32700a['where']=_[_0xeee0('0x47')](_0x32700a['where'],{'$or':_['map'](_0x32700a[_0xeee0('0x3c')],function(_0x11bf10){var _0x21f737={};_0x21f737[_0x11bf10]={'$like':'%'+_0x19771a[_0xeee0('0x38')]['filter']+'%'};return _0x21f737;})});}_0x32700a=_[_0xeee0('0x47')]({},_0x32700a,_0x19771a['options']);return db[_0xeee0('0xcc')]['count']({'where':_0x32700a['where']})[_0xeee0('0x29')](function(_0x1680ba){_0x6263a[_0xeee0('0x24')]=_0x1680ba;if(_0x19771a[_0xeee0('0x38')][_0xeee0('0x4a')]){_0x32700a[_0xeee0('0x4e')]=[{'all':!![]}];}else{_0x32700a[_0xeee0('0x4e')]=[{'model':db[_0xeee0('0x88')],'as':_0xeee0('0x123'),'required':![]},{'model':db[_0xeee0('0xd5')],'as':_0xeee0('0x124'),'required':![]}];}return db[_0xeee0('0xcc')][_0xeee0('0x4b')](_0x32700a);})[_0xeee0('0x29')](function(_0x7f633c){_0x6263a['rows']=_0x7f633c;return _0x6263a;});}})[_0xeee0('0x29')](respondWithFilteredResult(_0x18d18c,_0x32700a))['catch'](handleError(_0x18d18c,null));};exports['addAgents']=function(_0x547d12,_0x5f1b72){return db['ChatWebsite']['find']({'where':{'id':_0x547d12[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x5f1b72,null))[_0xeee0('0x29')](function(_0x2cda8b){if(_0x2cda8b){return _0x2cda8b['addAgents'](_0x547d12['body'][_0xeee0('0x61')],_[_0xeee0('0xe7')](_0x547d12[_0xeee0('0x59')],[_0xeee0('0x61'),'id'])||{})[_0xeee0('0xc8')](function(_0x90816d){for(var _0x1a9fa6=0x0;_0x1a9fa6<_0x547d12['body']['ids'][_0xeee0('0x3e')];_0x1a9fa6+=0x1){socket[_0xeee0('0x125')](_0xeee0('0x126'),{'UserId':Number(_0x547d12[_0xeee0('0x59')]['ids'][_0x1a9fa6]),'ChatWebsiteId':Number(_0x547d12[_0xeee0('0x4c')]['id'])});}return _0x90816d;});}})['then'](respondWithResult(_0x5f1b72,null))[_0xeee0('0x1e')](handleError(_0x5f1b72,null));};exports[_0xeee0('0x127')]=function(_0x3900e4,_0x282c84){return db[_0xeee0('0x33')]['find']({'where':{'id':_0x3900e4['params']['id']}})['then'](handleEntityNotFound(_0x282c84,null))[_0xeee0('0x29')](function(_0xbaf15c){if(_0xbaf15c){return _0xbaf15c['removeAgents'](_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')])['then'](function(){if(_[_0xeee0('0x128')](_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')])){for(var _0x31115e=0x0;_0x31115e<_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')][_0xeee0('0x3e')];_0x31115e+=0x1){socket[_0xeee0('0x125')](_0xeee0('0x129'),{'UserId':Number(_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')][_0x31115e]),'ChatWebsiteId':Number(_0x3900e4[_0xeee0('0x4c')]['id'])});}}else{socket['emit'](_0xeee0('0x129'),{'UserId':Number(_0x3900e4[_0xeee0('0x38')][_0xeee0('0x61')]),'ChatWebsiteId':Number(_0x3900e4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x282c84,null))[_0xeee0('0x1e')](handleError(_0x282c84,null));};exports['getAgents']=function(_0x5c407c,_0x7b9786){var _0x4b1e9={};var _0x484d4c={};var _0x861521;var _0x14ba9c;return db[_0xeee0('0x33')][_0xeee0('0x5f')]({'where':{'id':_0x5c407c[_0xeee0('0x4c')]['id']}})[_0xeee0('0x29')](handleEntityNotFound(_0x7b9786,null))[_0xeee0('0x29')](function(_0x13b2a4){if(_0x13b2a4){_0x861521=_0x13b2a4;_0x484d4c['model']=_['keys'](db[_0xeee0('0xbb')][_0xeee0('0x4d')]);_0x484d4c[_0xeee0('0x38')]=_[_0xeee0('0x39')](_0x5c407c[_0xeee0('0x38')]);_0x484d4c['filters']=_[_0xeee0('0x3b')](_0x484d4c['model'],_0x484d4c[_0xeee0('0x38')]);_0x4b1e9[_0xeee0('0x3c')]=_['intersection'](_0x484d4c[_0xeee0('0x37')],qs['fields'](_0x5c407c[_0xeee0('0x38')][_0xeee0('0x3d')]));_0x4b1e9['attributes']=_0x4b1e9[_0xeee0('0x3c')][_0xeee0('0x3e')]?_0x4b1e9[_0xeee0('0x3c')]:_0x484d4c[_0xeee0('0x37')];_0x4b1e9[_0xeee0('0x42')]=qs[_0xeee0('0x43')](_0x5c407c[_0xeee0('0x38')]['sort']);_0x4b1e9['where']=qs[_0xeee0('0x3a')](_[_0xeee0('0x45')](_0x5c407c[_0xeee0('0x38')],_0x484d4c[_0xeee0('0x3a')]));if(_0x5c407c[_0xeee0('0x38')][_0xeee0('0x46')]){_0x4b1e9[_0xeee0('0x44')]=_[_0xeee0('0x47')](_0x4b1e9[_0xeee0('0x44')],{'$or':_['map'](_0x4b1e9['attributes'],function(_0x21485d){var _0x5af470={};_0x5af470[_0x21485d]={'$like':'%'+_0x5c407c[_0xeee0('0x38')]['filter']+'%'};return _0x5af470;})});}_0x4b1e9=_[_0xeee0('0x47')]({},_0x4b1e9,_0x5c407c[_0xeee0('0x4f')]);return _0x861521[_0xeee0('0x12a')](_0x4b1e9);}})[_0xeee0('0x29')](function(_0x5a60fd){if(_0x5a60fd){_0x14ba9c=_0x5a60fd[_0xeee0('0x3e')];if(!_0x5c407c[_0xeee0('0x38')][_0xeee0('0x3f')]('nolimit')){_0x4b1e9[_0xeee0('0x25')]=qs[_0xeee0('0x25')](_0x5c407c[_0xeee0('0x38')][_0xeee0('0x25')]);_0x4b1e9[_0xeee0('0x41')]=qs[_0xeee0('0x41')](_0x5c407c['query']['offset']);}return _0x861521[_0xeee0('0x12a')](_0x4b1e9);}})['then'](function(_0x2af580){if(_0x2af580){return _0x2af580?{'count':_0x14ba9c,'rows':_0x2af580}:null;}})[_0xeee0('0x29')](respondWithResult(_0x7b9786,null))[_0xeee0('0x1e')](handleError(_0x7b9786,null));};
\ No newline at end of file
index 6a1ccaa..8bd88f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x423b=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x38469a,_0x2570df){var _0xbec51b=function(_0x40fa4a){while(--_0x40fa4a){_0x38469a['push'](_0x38469a['shift']());}};_0xbec51b(++_0x2570df);}(_0x423b,0x12b));var _0xb423=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x423b[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xb423('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb423('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb423('0x2'),'afterDestroy':'remove'};function emitEvent(_0x57cd26){return function(_0x50f31a,_0x2fa5da,_0x5f207d){ChatWebsiteEvents['emit'](_0x57cd26+':'+_0x50f31a['id'],_0x50f31a);ChatWebsiteEvents[_0xb423('0x3')](_0x57cd26,_0x50f31a);_0x5f207d(null);};}for(var e in events){if(events[_0xb423('0x4')](e)){var event=events[e];ChatWebsite[_0xb423('0x5')](e,emitEvent(event));}}module[_0xb423('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x5ed2=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners'];(function(_0x42abaa,_0x283a90){var _0x1e44fe=function(_0x1e52ed){while(--_0x1e52ed){_0x42abaa['push'](_0x42abaa['shift']());}};_0x1e44fe(++_0x283a90);}(_0x5ed2,0x114));var _0x25ed=function(_0x25831a,_0x3027d1){_0x25831a=_0x25831a-0x0;var _0x141686=_0x5ed2[_0x25831a];return _0x141686;};'use strict';var EventEmitter=require(_0x25ed('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x25ed('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x25ed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25ed('0x3'),'afterDestroy':_0x25ed('0x4')};function emitEvent(_0x591e52){return function(_0x1ce8d8,_0x2e6fb6,_0xbebea9){ChatWebsiteEvents[_0x25ed('0x5')](_0x591e52+':'+_0x1ce8d8['id'],_0x1ce8d8);ChatWebsiteEvents['emit'](_0x591e52,_0x1ce8d8);_0xbebea9(null);};}for(var e in events){if(events[_0x25ed('0x6')](e)){var event=events[e];ChatWebsite[_0x25ed('0x7')](e,emitEvent(event));}}module[_0x25ed('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
index 75cbabf..53a1327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84f0=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api'];(function(_0x5b36ac,_0x4767aa){var _0x512bc2=function(_0x312285){while(--_0x312285){_0x5b36ac['push'](_0x5b36ac['shift']());}};_0x512bc2(++_0x4767aa);}(_0x84f0,0x128));var _0x084f=function(_0x3681ba,_0x2b302e){_0x3681ba=_0x3681ba-0x0;var _0x26a4fd=_0x84f0[_0x3681ba];return _0x26a4fd;};'use strict';var _=require(_0x084f('0x0'));var util=require('util');var logger=require(_0x084f('0x1'))(_0x084f('0x2'));var moment=require(_0x084f('0x3'));var BPromise=require(_0x084f('0x4'));var rp=require(_0x084f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x084f('0x6'));var config=require(_0x084f('0x7'));var attributes=require(_0x084f('0x8'));module[_0x084f('0x9')]=function(_0x55ac14,_0x331c2e){return _0x55ac14[_0x084f('0xa')](_0x084f('0xb'),attributes,{'tableName':_0x084f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xca40=['../../config/environment','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x24f0ab,_0x2cc3db){var _0x4dc05e=function(_0x12d1c2){while(--_0x12d1c2){_0x24f0ab['push'](_0x24f0ab['shift']());}};_0x4dc05e(++_0x2cc3db);}(_0xca40,0x13c));var _0x0ca4=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xca40[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x0ca4('0x0'));var util=require(_0x0ca4('0x1'));var logger=require(_0x0ca4('0x2'))(_0x0ca4('0x3'));var moment=require(_0x0ca4('0x4'));var BPromise=require(_0x0ca4('0x5'));var rp=require(_0x0ca4('0x6'));var fs=require('fs');var path=require(_0x0ca4('0x7'));var rimraf=require(_0x0ca4('0x8'));var config=require(_0x0ca4('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x4125e7,_0x2bb9e0){return _0x4125e7[_0x0ca4('0xa')](_0x0ca4('0xb'),attributes,{'tableName':_0x0ca4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cd0be26..90b44c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6afa=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x567f4d,_0x2ccd40){var _0x51f1f0=function(_0x4e8a67){while(--_0x4e8a67){_0x567f4d['push'](_0x567f4d['shift']());}};_0x51f1f0(++_0x2ccd40);}(_0x6afa,0x12c));var _0xa6af=function(_0x218663,_0x11c420){_0x218663=_0x218663-0x0;var _0x1b452a=_0x6afa[_0x218663];return _0x1b452a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa6af('0x0'));var BPromise=require(_0xa6af('0x1'));var rs=require(_0xa6af('0x2'));var fs=require('fs');var Redis=require(_0xa6af('0x3'));var db=require(_0xa6af('0x4'))['db'];var utils=require(_0xa6af('0x5'));var logger=require(_0xa6af('0x6'))(_0xa6af('0x7'));var config=require(_0xa6af('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa6af('0x9')]['http']({'port':0x232a});config[_0xa6af('0xa')]=_[_0xa6af('0xb')](config[_0xa6af('0xa')],{'host':_0xa6af('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0xa6af('0xd')](socket);function respondWithRpcPromise(_0x4ad492,_0x1a28d2,_0x5d8175){return new BPromise(function(_0x223612,_0x159e91){return client[_0xa6af('0xe')](_0x4ad492,_0x5d8175)[_0xa6af('0xf')](function(_0x1c80b6){logger['info'](_0xa6af('0x10'),_0x1a28d2,_0xa6af('0x11'));logger[_0xa6af('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a28d2,_0xa6af('0x11'),JSON[_0xa6af('0x13')](_0x1c80b6));if(_0x1c80b6[_0xa6af('0x14')]){if(_0x1c80b6[_0xa6af('0x14')][_0xa6af('0x15')]===0x1f4){logger[_0xa6af('0x14')](_0xa6af('0x10'),_0x1a28d2,_0x1c80b6[_0xa6af('0x14')][_0xa6af('0x16')]);return _0x159e91(_0x1c80b6[_0xa6af('0x14')][_0xa6af('0x16')]);}logger['error'](_0xa6af('0x10'),_0x1a28d2,_0x1c80b6[_0xa6af('0x14')][_0xa6af('0x16')]);return _0x223612(_0x1c80b6[_0xa6af('0x14')][_0xa6af('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a28d2,_0xa6af('0x11'));_0x223612(_0x1c80b6[_0xa6af('0x17')][_0xa6af('0x16')]);}})[_0xa6af('0x18')](function(_0x2540a2){logger[_0xa6af('0x14')](_0xa6af('0x10'),_0x1a28d2,_0x2540a2);_0x159e91(_0x2540a2);});});}
\ No newline at end of file
+var _0x66e9=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66e9,0xc7));var _0x966e=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x66e9[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x966e('0x0'));var util=require(_0x966e('0x1'));var moment=require(_0x966e('0x2'));var BPromise=require('bluebird');var rs=require(_0x966e('0x3'));var fs=require('fs');var Redis=require(_0x966e('0x4'));var db=require(_0x966e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x966e('0x6'));var config=require(_0x966e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x966e('0x8')]['http']({'port':0x232a});config['redis']=_[_0x966e('0x9')](config[_0x966e('0xa')],{'host':_0x966e('0xb'),'port':0x18eb});var socket=require(_0x966e('0xc'))(new Redis(config[_0x966e('0xa')]));require(_0x966e('0xd'))[_0x966e('0xe')](socket);function respondWithRpcPromise(_0x146db2,_0x472970,_0x3b0f0f){return new BPromise(function(_0x440113,_0x417d66){return client[_0x966e('0xf')](_0x146db2,_0x3b0f0f)[_0x966e('0x10')](function(_0x967825){logger['info'](_0x966e('0x11'),_0x472970,'request\x20sent');logger[_0x966e('0x12')](_0x966e('0x13'),_0x472970,_0x966e('0x14'),JSON[_0x966e('0x15')](_0x967825));if(_0x967825['error']){if(_0x967825[_0x966e('0x16')][_0x966e('0x17')]===0x1f4){logger[_0x966e('0x16')](_0x966e('0x11'),_0x472970,_0x967825[_0x966e('0x16')][_0x966e('0x18')]);return _0x417d66(_0x967825[_0x966e('0x16')][_0x966e('0x18')]);}logger[_0x966e('0x16')](_0x966e('0x11'),_0x472970,_0x967825[_0x966e('0x16')][_0x966e('0x18')]);return _0x440113(_0x967825[_0x966e('0x16')][_0x966e('0x18')]);}else{logger[_0x966e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x472970,'request\x20sent');_0x440113(_0x967825[_0x966e('0x1a')][_0x966e('0x18')]);}})[_0x966e('0x1b')](function(_0x250def){logger[_0x966e('0x16')](_0x966e('0x11'),_0x472970,_0x250def);_0x417d66(_0x250def);});});}
\ No newline at end of file
index fe18ddb..df9aa74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa777=['length','save','remove','update','emit','removeListener','register'];(function(_0x42600d,_0x406d4d){var _0x5f26c2=function(_0x1e645f){while(--_0x1e645f){_0x42600d['push'](_0x42600d['shift']());}};_0x5f26c2(++_0x406d4d);}(_0xa777,0xfd));var _0x7a77=function(_0x1c2f7f,_0x24dc42){_0x1c2f7f=_0x1c2f7f-0x0;var _0x1be462=_0xa777[_0x1c2f7f];return _0x1be462;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7a77('0x0'),_0x7a77('0x1'),_0x7a77('0x2')];function createListener(_0x3b09c7,_0x4eb898){return function(_0x376aa7){_0x4eb898[_0x7a77('0x3')](_0x3b09c7,_0x376aa7);};}function removeListener(_0x32f3b1,_0x465bdf){return function(){ChatWebsiteEvents[_0x7a77('0x4')](_0x32f3b1,_0x465bdf);};}exports[_0x7a77('0x5')]=function(_0x295e63){for(var _0x418b49=0x0,_0x199091=events[_0x7a77('0x6')];_0x418b49<_0x199091;_0x418b49++){var _0x2beb19=events[_0x418b49];var _0x2d80ab=createListener('chatWebsite:'+_0x2beb19,_0x295e63);ChatWebsiteEvents['on'](_0x2beb19,_0x2d80ab);}};
\ No newline at end of file
+var _0xdd0c=['removeListener','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x374888,_0x4fe130){var _0x39fc0a=function(_0x1ddf3b){while(--_0x1ddf3b){_0x374888['push'](_0x374888['shift']());}};_0x39fc0a(++_0x4fe130);}(_0xdd0c,0x1a7));var _0xcdd0=function(_0x24e1a0,_0x5c4ce9){_0x24e1a0=_0x24e1a0-0x0;var _0x1b270f=_0xdd0c[_0x24e1a0];return _0x1b270f;};'use strict';var ChatWebsiteEvents=require(_0xcdd0('0x0'));var events=[_0xcdd0('0x1'),'remove','update'];function createListener(_0x35dc9d,_0x25803f){return function(_0x183f84){_0x25803f['emit'](_0x35dc9d,_0x183f84);};}function removeListener(_0x4533f3,_0x23460d){return function(){ChatWebsiteEvents[_0xcdd0('0x2')](_0x4533f3,_0x23460d);};}exports[_0xcdd0('0x3')]=function(_0x242ccf){for(var _0x22f060=0x0,_0x1fd31c=events['length'];_0x22f060<_0x1fd31c;_0x22f060++){var _0x39ace0=events[_0x22f060];var _0xf3476=createListener(_0xcdd0('0x4')+_0x39ace0,_0x242ccf);ChatWebsiteEvents['on'](_0x39ace0,_0xf3476);}};
\ No newline at end of file
index c4b4ac1..d77cdcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97e8=['delete','destroy','removeDispositions','removeAgents','exports','multer','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','getProactiveActions','/:id/fields','getOfflineMessages','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','/:id/logo','single','file','addLogo','originalname','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','/:id/applications','addApplications','/:id/proactive_actions','/:id/users','addAgents','put','update'];(function(_0x53bb55,_0x54bf6b){var _0x17d773=function(_0x3dd55c){while(--_0x3dd55c){_0x53bb55['push'](_0x53bb55['shift']());}};_0x17d773(++_0x54bf6b);}(_0x97e8,0xc8));var _0x897e=function(_0x5edb71,_0x2430ed){_0x5edb71=_0x5edb71-0x0;var _0x2ec8a9=_0x97e8[_0x5edb71];return _0x2ec8a9;};'use strict';var multer=require(_0x897e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x897e('0x1'));var express=require(_0x897e('0x2'));var router=express[_0x897e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x897e('0x4'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x897e('0x5')](),controller[_0x897e('0x6')]);router['get'](_0x897e('0x7'),auth['isAuthenticated'](),controller[_0x897e('0x8')]);router[_0x897e('0x9')](_0x897e('0xa'),auth[_0x897e('0x5')](),controller[_0x897e('0xb')]);router[_0x897e('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x897e('0xc')]);router[_0x897e('0x9')](_0x897e('0xd'),auth[_0x897e('0x5')](),controller['getAnswers']);router[_0x897e('0x9')]('/:id/logo',controller[_0x897e('0xe')]);router[_0x897e('0x9')](_0x897e('0xf'),controller[_0x897e('0x10')]);router['get'](_0x897e('0x11'),controller[_0x897e('0x12')]);router[_0x897e('0x9')](_0x897e('0x13'),controller[_0x897e('0x14')]);router[_0x897e('0x9')](_0x897e('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x897e('0x9')]('/:id/snippet',controller[_0x897e('0x16')]);router['get']('/:id/applications',auth[_0x897e('0x5')](),controller['getApplications']);router[_0x897e('0x9')]('/:id/proactive_actions',auth[_0x897e('0x5')](),controller[_0x897e('0x17')]);router[_0x897e('0x9')](_0x897e('0x18'),controller['getFields']);router[_0x897e('0x9')]('/:id/offline_messages',auth[_0x897e('0x5')](),controller[_0x897e('0x19')]);router['get']('/:id/users',auth[_0x897e('0x5')](),controller[_0x897e('0x1a')]);router['post']('/',auth[_0x897e('0x5')](),controller[_0x897e('0x1b')]);router[_0x897e('0x1c')](_0x897e('0x1d'),auth[_0x897e('0x5')](),controller[_0x897e('0x1e')]);router[_0x897e('0x1c')](_0x897e('0xd'),auth['isAuthenticated'](),controller[_0x897e('0x1f')]);var upload=multer({'storage':multer[_0x897e('0x20')]({'destination':function(_0x1528e7,_0x46acf9,_0x575b89){_0x575b89(null,path[_0x897e('0x21')](config[_0x897e('0x22')],'server/files/images/logos/'));},'filename':function(_0x7612da,_0x1d11ca,_0xc116b5){_0xc116b5(null,util[_0x897e('0x23')](_0x897e('0x24'),Date[_0x897e('0x25')](),_0x1d11ca['originalname']));}})});router[_0x897e('0x1c')](_0x897e('0x26'),upload[_0x897e('0x27')](_0x897e('0x28')),controller[_0x897e('0x29')]);var upload=multer({'storage':multer[_0x897e('0x20')]({'destination':function(_0x5664b9,_0x59a7b3,_0x36f650){_0x36f650(null,path[_0x897e('0x21')](config[_0x897e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x48fe70,_0x4e6bc4,_0x507db5){_0x507db5(null,util[_0x897e('0x23')]('%s-%s',Date[_0x897e('0x25')](),_0x4e6bc4[_0x897e('0x2a')]));}})});router[_0x897e('0x1c')](_0x897e('0xf'),upload['single'](_0x897e('0x28')),controller['addAvatar']);var upload=multer({'storage':multer[_0x897e('0x20')]({'destination':function(_0x3bd57d,_0x4898cb,_0x19d6c0){_0x19d6c0(null,path[_0x897e('0x21')](config['root'],_0x897e('0x2b')));},'filename':function(_0x150b55,_0x1c2fcc,_0x1bbeac){_0x1bbeac(null,util[_0x897e('0x23')](_0x897e('0x24'),Date['now'](),_0x1c2fcc['originalname']));}})});router[_0x897e('0x1c')](_0x897e('0x11'),upload[_0x897e('0x27')](_0x897e('0x28')),controller[_0x897e('0x2c')]);var upload=multer({'storage':multer[_0x897e('0x20')]({'destination':function(_0x2f53b1,_0x145aa2,_0x463187){_0x463187(null,path['join'](config[_0x897e('0x22')],_0x897e('0x2b')));},'filename':function(_0x5d52f7,_0x32b410,_0x2464aa){_0x2464aa(null,util[_0x897e('0x23')](_0x897e('0x24'),Date[_0x897e('0x25')](),_0x32b410[_0x897e('0x2a')]));}})});router[_0x897e('0x1c')](_0x897e('0x13'),upload[_0x897e('0x27')]('file'),controller[_0x897e('0x2d')]);router[_0x897e('0x1c')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x897e('0x20')]({'destination':function(_0x51df55,_0x278d4a,_0x56ef3d){const _0x2a9c84=path[_0x897e('0x21')](config[_0x897e('0x22')],'server/files',_0x897e('0x2e'),_0x897e('0x2f'));fs_extra[_0x897e('0x30')](_0x2a9c84,function(){_0x56ef3d(null,_0x2a9c84);});},'filename':function(_0x3ae2cc,_0x4b15a9,_0x335a3e){const _0x37dd35=_0x4b15a9['originalname'][_0x897e('0x31')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1c613f=path[_0x897e('0x32')](_0x37dd35);const _0x4ff053=Date[_0x897e('0x25')]()+'-'+_0x37dd35[_0x897e('0x31')](_0x1c613f,'')+_0x1c613f;_0x335a3e(null,_0x4ff053);}})});router[_0x897e('0x1c')](_0x897e('0x33'),offlineUploadMulter[_0x897e('0x34')](),controller['offline']);router[_0x897e('0x1c')](_0x897e('0x15'),auth[_0x897e('0x5')](),controller['addInteraction']);router[_0x897e('0x1c')](_0x897e('0x35'),auth[_0x897e('0x5')](),controller[_0x897e('0x36')]);router[_0x897e('0x1c')](_0x897e('0x37'),auth[_0x897e('0x5')](),controller['addProactiveActions']);router[_0x897e('0x1c')](_0x897e('0x38'),auth[_0x897e('0x5')](),controller[_0x897e('0x39')]);router[_0x897e('0x3a')](_0x897e('0xa'),auth[_0x897e('0x5')](),controller[_0x897e('0x3b')]);router[_0x897e('0x3c')]('/:id',auth[_0x897e('0x5')](),controller[_0x897e('0x3d')]);router[_0x897e('0x3c')](_0x897e('0x1d'),auth[_0x897e('0x5')](),controller[_0x897e('0x3e')]);router[_0x897e('0x3c')](_0x897e('0xd'),auth[_0x897e('0x5')](),controller['removeAnswers']);router[_0x897e('0x3c')]('/:id/users',auth[_0x897e('0x5')](),controller[_0x897e('0x3f')]);module[_0x897e('0x40')]=router;
\ No newline at end of file
+var _0x450d=['/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','diskStorage','server/files/images/avatars/','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x36f5cb,_0x2a720f){var _0x58d6ce=function(_0x1adfb5){while(--_0x1adfb5){_0x36f5cb['push'](_0x36f5cb['shift']());}};_0x58d6ce(++_0x2a720f);}(_0x450d,0x113));var _0xd450=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x450d[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xd450('0x0'));var util=require(_0xd450('0x1'));var path=require(_0xd450('0x2'));var timeout=require(_0xd450('0x3'));var express=require('express');var router=express[_0xd450('0x4')]();var fs_extra=require(_0xd450('0x5'));var auth=require(_0xd450('0x6'));var interaction=require(_0xd450('0x7'));var config=require(_0xd450('0x8'));var controller=require(_0xd450('0x9'));router[_0xd450('0xa')]('/',auth[_0xd450('0xb')](),controller['index']);router[_0xd450('0xa')]('/describe',auth[_0xd450('0xb')](),controller[_0xd450('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd450('0xd')]);router['get']('/:id/dispositions',auth[_0xd450('0xb')](),controller[_0xd450('0xe')]);router[_0xd450('0xa')](_0xd450('0xf'),auth[_0xd450('0xb')](),controller['getAnswers']);router[_0xd450('0xa')](_0xd450('0x10'),controller['getLogo']);router['get'](_0xd450('0x11'),controller[_0xd450('0x12')]);router[_0xd450('0xa')](_0xd450('0x13'),controller[_0xd450('0x14')]);router['get'](_0xd450('0x15'),controller['getSystemAvatar']);router['get'](_0xd450('0x16'),auth[_0xd450('0xb')](),controller['getInteractions']);router[_0xd450('0xa')](_0xd450('0x17'),controller[_0xd450('0x18')]);router['get'](_0xd450('0x19'),auth[_0xd450('0xb')](),controller[_0xd450('0x1a')]);router[_0xd450('0xa')]('/:id/proactive_actions',auth[_0xd450('0xb')](),controller[_0xd450('0x1b')]);router['get'](_0xd450('0x1c'),controller[_0xd450('0x1d')]);router[_0xd450('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xd450('0x1e')]);router[_0xd450('0xa')](_0xd450('0x1f'),auth['isAuthenticated'](),controller[_0xd450('0x20')]);router[_0xd450('0x21')]('/',auth[_0xd450('0xb')](),controller['create']);router['post'](_0xd450('0x22'),auth[_0xd450('0xb')](),controller[_0xd450('0x23')]);router['post'](_0xd450('0xf'),auth[_0xd450('0xb')](),controller[_0xd450('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5382fd,_0x255719,_0x1c32c4){_0x1c32c4(null,path['join'](config[_0xd450('0x25')],_0xd450('0x26')));},'filename':function(_0x4e9017,_0x3bc053,_0x5a0f92){_0x5a0f92(null,util[_0xd450('0x27')](_0xd450('0x28'),Date[_0xd450('0x29')](),_0x3bc053[_0xd450('0x2a')]));}})});router['post'](_0xd450('0x10'),upload[_0xd450('0x2b')](_0xd450('0x2c')),controller[_0xd450('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21922c,_0x5d1128,_0x1f7261){_0x1f7261(null,path[_0xd450('0x2e')](config[_0xd450('0x25')],'server/files/images/avatars/'));},'filename':function(_0x2ff51f,_0x41d9be,_0x184c68){_0x184c68(null,util['format']('%s-%s',Date['now'](),_0x41d9be[_0xd450('0x2a')]));}})});router[_0xd450('0x21')](_0xd450('0x11'),upload[_0xd450('0x2b')](_0xd450('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0xd450('0x2f')]({'destination':function(_0x5c588a,_0x1c1e84,_0x407a96){_0x407a96(null,path[_0xd450('0x2e')](config[_0xd450('0x25')],_0xd450('0x30')));},'filename':function(_0x31296b,_0x122bd3,_0x160d8f){_0x160d8f(null,util[_0xd450('0x27')](_0xd450('0x28'),Date[_0xd450('0x29')](),_0x122bd3[_0xd450('0x2a')]));}})});router[_0xd450('0x21')](_0xd450('0x13'),upload[_0xd450('0x2b')]('file'),controller[_0xd450('0x31')]);var upload=multer({'storage':multer[_0xd450('0x2f')]({'destination':function(_0x46b79c,_0x487fb8,_0x45cbb8){_0x45cbb8(null,path['join'](config[_0xd450('0x25')],'server/files/images/avatars/'));},'filename':function(_0x6cfc76,_0x3c9e9e,_0x3820d8){_0x3820d8(null,util[_0xd450('0x27')]('%s-%s',Date[_0xd450('0x29')](),_0x3c9e9e[_0xd450('0x2a')]));}})});router[_0xd450('0x21')](_0xd450('0x15'),upload[_0xd450('0x2b')](_0xd450('0x2c')),controller['addSystemAvatar']);router['post'](_0xd450('0x32'),controller[_0xd450('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x42f439,_0x2cb906,_0x139b1c){const _0x443c34=path['join'](config[_0xd450('0x25')],_0xd450('0x34'),'attachments',_0xd450('0x35'));fs_extra[_0xd450('0x36')](_0x443c34,function(){_0x139b1c(null,_0x443c34);});},'filename':function(_0x54dd28,_0x4ae78a,_0x20c499){const _0x29f088=_0x4ae78a[_0xd450('0x2a')][_0xd450('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x25c441=path[_0xd450('0x38')](_0x29f088);const _0x5ac0d2=Date['now']()+'-'+_0x29f088[_0xd450('0x37')](_0x25c441,'')+_0x25c441;_0x20c499(null,_0x5ac0d2);}})});router[_0xd450('0x21')](_0xd450('0x39'),offlineUploadMulter[_0xd450('0x3a')](),controller[_0xd450('0x3b')]);router[_0xd450('0x21')](_0xd450('0x16'),auth[_0xd450('0xb')](),controller[_0xd450('0x3c')]);router['post'](_0xd450('0x19'),auth[_0xd450('0xb')](),controller[_0xd450('0x3d')]);router['post'](_0xd450('0x3e'),auth[_0xd450('0xb')](),controller[_0xd450('0x3f')]);router[_0xd450('0x21')](_0xd450('0x1f'),auth[_0xd450('0xb')](),controller[_0xd450('0x40')]);router[_0xd450('0x41')](_0xd450('0x42'),auth[_0xd450('0xb')](),controller[_0xd450('0x43')]);router[_0xd450('0x44')](_0xd450('0x42'),auth[_0xd450('0xb')](),controller[_0xd450('0x45')]);router[_0xd450('0x44')](_0xd450('0x22'),auth['isAuthenticated'](),controller[_0xd450('0x46')]);router[_0xd450('0x44')](_0xd450('0xf'),auth[_0xd450('0xb')](),controller[_0xd450('0x47')]);router[_0xd450('0x44')](_0xd450('0x1f'),auth[_0xd450('0xb')](),controller[_0xd450('0x48')]);module[_0xd450('0x49')]=router;
\ No newline at end of file
index 5e34f27..9ff1917 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5f5=['production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xd5f5,0x1d4));var _0x5d5f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd5f5[_0x4b369d];return _0x571a98;};var beaverLogger=require(_0x5d5f('0x0'));var express=require(_0x5d5f('0x1'));var auth=require('../components/auth/service');var config=require(_0x5d5f('0x2'));var router=express[_0x5d5f('0x3')]();var isProduction=config[_0x5d5f('0x4')]===_0x5d5f('0x5')||![];function clientSideLogs(_0xda01a9,_0x189075,_0x4de1c9){var _0x318781=_0xda01a9['app'][_0x5d5f('0x6')](_0x5d5f('0x7'));if(!_0x318781){throw new Error(_0x5d5f('0x8'));}return beaverLogger[_0x5d5f('0x9')]({'uri':'/client-logs','logger':_0x318781,'enableCors':!isProduction})(_0xda01a9,_0x189075,_0x4de1c9);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x5d5f('0xa')]=router;
\ No newline at end of file
+var _0x1b40=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../config/environment','Router','env','app'];(function(_0x479385,_0x26c872){var _0x2a307=function(_0x2a6a24){while(--_0x2a6a24){_0x479385['push'](_0x479385['shift']());}};_0x2a307(++_0x26c872);}(_0x1b40,0x67));var _0x01b4=function(_0x12d6de,_0xccc040){_0x12d6de=_0x12d6de-0x0;var _0x32923b=_0x1b40[_0x12d6de];return _0x32923b;};var beaverLogger=require('beaver-logger/server');var express=require(_0x01b4('0x0'));var auth=require('../components/auth/service');var config=require(_0x01b4('0x1'));var router=express[_0x01b4('0x2')]();var isProduction=config[_0x01b4('0x3')]==='production'||![];function clientSideLogs(_0x312a45,_0x36f7ed,_0x4ff973){var _0x1b35df=_0x312a45[_0x01b4('0x4')][_0x01b4('0x5')](_0x01b4('0x6'));if(!_0x1b35df){throw new Error(_0x01b4('0x7'));}return beaverLogger[_0x01b4('0x8')]({'uri':_0x01b4('0x9'),'logger':_0x1b35df,'enableCors':!isProduction})(_0x312a45,_0x36f7ed,_0x4ff973);}router['use'](auth[_0x01b4('0xa')](),clientSideLogs);module[_0x01b4('0xb')]=router;
\ No newline at end of file
index 07cd1d1..443622d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5904=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x17c6d3,_0x418bf3){var _0x3a6278=function(_0x3ebaa0){while(--_0x3ebaa0){_0x17c6d3['push'](_0x17c6d3['shift']());}};_0x3a6278(++_0x418bf3);}(_0x5904,0x144));var _0x4590=function(_0x12dc1f,_0x27e51b){_0x12dc1f=_0x12dc1f-0x0;var _0x546269=_0x5904[_0x12dc1f];return _0x546269;};'use strict';var Sequelize=require('sequelize');module[_0x4590('0x0')]={'name':{'type':Sequelize[_0x4590('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4590('0x2')](_0x4590('0x3'),_0x4590('0x4'),_0x4590('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4590('0x2')](_0x4590('0x6'),_0x4590('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x4590('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x4590('0x1')],'comment':_0x4590('0x8')},'data4':{'type':Sequelize[_0x4590('0x1')],'comment':_0x4590('0x9')},'data5':{'type':Sequelize[_0x4590('0xa')],'comment':_0x4590('0xb')},'data6':{'type':Sequelize[_0x4590('0xa')],'comment':_0x4590('0xc')},'data7':{'type':Sequelize[_0x4590('0xa')],'comment':_0x4590('0xd')}};
\ No newline at end of file
+var _0x9c83=['MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x57d773,_0xf4b81b){var _0x57e209=function(_0xd96560){while(--_0xd96560){_0x57d773['push'](_0x57d773['shift']());}};_0x57e209(++_0xf4b81b);}(_0x9c83,0x1d2));var _0x39c8=function(_0x3ca991,_0x53a5bd){_0x3ca991=_0x3ca991-0x0;var _0x271da1=_0x9c83[_0x3ca991];return _0x271da1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x39c8('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x39c8('0x1')](_0x39c8('0x2'),'Google',_0x39c8('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x39c8('0x4'),_0x39c8('0x5'))},'data1':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x6')},'data2':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x7')},'data3':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x8')},'data4':{'type':Sequelize[_0x39c8('0x0')],'comment':_0x39c8('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x39c8('0xa')},'data6':{'type':Sequelize[_0x39c8('0xb')],'comment':_0x39c8('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x39c8('0xd')}};
\ No newline at end of file
index 091e3ab..d37d2b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4e7=['length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','filter','options','CloudProvider','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','rawAttributes','include','find','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','params','encryptString','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','end','status','json','offset','undefined','count','limit','set','update','then','destroy','stack','name','padEnd','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x718365,_0xb9e43f){var _0x3fff9e=function(_0x1a20e5){while(--_0x1a20e5){_0x718365['push'](_0x718365['shift']());}};_0x3fff9e(++_0xb9e43f);}(_0xe4e7,0x1b3));var _0x7e4e=function(_0x117881,_0xcac659){_0x117881=_0x117881-0x0;var _0x4a8598=_0xe4e7[_0x117881];return _0x4a8598;};'use strict';var _=require(_0x7e4e('0x0'));var Redis=require(_0x7e4e('0x1'));var qs=require(_0x7e4e('0x2'));var encryptor=require(_0x7e4e('0x3'));var config=require(_0x7e4e('0x4'));var logger=require(_0x7e4e('0x5'))('api');var db=require(_0x7e4e('0x6'))['db'];var oauth=require(_0x7e4e('0x7'));config['redis']=_[_0x7e4e('0x8')](config[_0x7e4e('0x9')],{'host':_0x7e4e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x7e4e('0x9')]);function respondWithStatusCode(_0x4bf1d5,_0x10fda4){_0x10fda4=_0x10fda4||0xcc;return function(_0x42a648){if(_0x42a648){return _0x4bf1d5[_0x7e4e('0xb')](_0x10fda4);}return _0x4bf1d5['status'](_0x10fda4)[_0x7e4e('0xc')]();};}function respondWithResult(_0x363d44,_0x31acce){_0x31acce=_0x31acce||0xc8;return function(_0x388d93){if(_0x388d93){return _0x363d44[_0x7e4e('0xd')](_0x31acce)[_0x7e4e('0xe')](_0x388d93);}};}function respondWithFilteredResult(_0x386a8f,_0x34b480){return function(_0x504d37){if(_0x504d37){var _0xd2d1fe=typeof _0x34b480[_0x7e4e('0xf')]==='undefined'&&typeof _0x34b480['limit']===_0x7e4e('0x10');var _0x32f4e1=_0x504d37[_0x7e4e('0x11')];var _0x1297ad=_0xd2d1fe?0x0:_0x34b480[_0x7e4e('0xf')];var _0x52d7f5=_0xd2d1fe?_0x504d37[_0x7e4e('0x11')]:_0x34b480[_0x7e4e('0xf')]+_0x34b480[_0x7e4e('0x12')];var _0x3d5400;if(_0x52d7f5>=_0x32f4e1){_0x52d7f5=_0x32f4e1;_0x3d5400=0xc8;}else{_0x3d5400=0xce;}_0x386a8f[_0x7e4e('0xd')](_0x3d5400);return _0x386a8f[_0x7e4e('0x13')]('Content-Range',_0x1297ad+'-'+_0x52d7f5+'/'+_0x32f4e1)['json'](_0x504d37);}return null;};}function saveUpdates(_0x1c62bf){return function(_0x440743){if(_0x440743){return _0x440743[_0x7e4e('0x14')](_0x1c62bf)[_0x7e4e('0x15')](function(_0x438df3){return _0x438df3;});}return null;};}function removeEntity(_0x245e20){return function(_0x53fbe3){if(_0x53fbe3){return _0x53fbe3[_0x7e4e('0x16')]()['then'](function(){_0x245e20[_0x7e4e('0xd')](0xcc)[_0x7e4e('0xc')]();});}};}function handleEntityNotFound(_0x322707){return function(_0x3a7f51){if(!_0x3a7f51){_0x322707[_0x7e4e('0xb')](0x194);}return _0x3a7f51;};}function handleError(_0x205b1a,_0x3cf117){_0x3cf117=_0x3cf117||0x1f4;return function(_0x456592){logger['error'](_0x456592[_0x7e4e('0x17')]);if(_0x456592[_0x7e4e('0x18')]){delete _0x456592[_0x7e4e('0x18')];}_0x205b1a[_0x7e4e('0xd')](_0x3cf117)['send'](_0x456592);};}function maskClientSecret(_0x5ecd88){return _[_0x7e4e('0x19')](_0x5ecd88['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x17d8a0,_0xee6df5){var _0x3101b8={},_0x100e35={},_0x55b6ce={'count':0x0,'rows':[]};var _0x1b87d4=_['map'](db['CloudProvider']['rawAttributes'],function(_0x586440){return{'name':_0x586440[_0x7e4e('0x1a')],'type':_0x586440[_0x7e4e('0x1b')]['key']};});_0x100e35[_0x7e4e('0x1c')]=_['map'](_0x1b87d4,_0x7e4e('0x18'));_0x100e35[_0x7e4e('0x1d')]=_[_0x7e4e('0x1e')](_0x17d8a0['query']);_0x100e35[_0x7e4e('0x1f')]=_[_0x7e4e('0x20')](_0x100e35[_0x7e4e('0x1c')],_0x100e35[_0x7e4e('0x1d')]);_0x3101b8[_0x7e4e('0x21')]=_[_0x7e4e('0x20')](_0x100e35[_0x7e4e('0x1c')],qs[_0x7e4e('0x22')](_0x17d8a0[_0x7e4e('0x1d')][_0x7e4e('0x22')]));_0x3101b8[_0x7e4e('0x21')]=_0x3101b8['attributes'][_0x7e4e('0x23')]?_0x3101b8[_0x7e4e('0x21')]:_0x100e35[_0x7e4e('0x1c')];if(!_0x17d8a0['query'][_0x7e4e('0x24')](_0x7e4e('0x25'))){_0x3101b8['limit']=qs[_0x7e4e('0x12')](_0x17d8a0[_0x7e4e('0x1d')][_0x7e4e('0x12')]);_0x3101b8[_0x7e4e('0xf')]=qs[_0x7e4e('0xf')](_0x17d8a0[_0x7e4e('0x1d')]['offset']);}_0x3101b8[_0x7e4e('0x26')]=qs['sort'](_0x17d8a0[_0x7e4e('0x1d')][_0x7e4e('0x27')]);_0x3101b8['where']=qs[_0x7e4e('0x1f')](_[_0x7e4e('0x28')](_0x17d8a0[_0x7e4e('0x1d')],_0x100e35[_0x7e4e('0x1f')]),_0x1b87d4);if(_0x17d8a0[_0x7e4e('0x1d')]['filter']){_0x3101b8[_0x7e4e('0x29')]=_[_0x7e4e('0x2a')](_0x3101b8[_0x7e4e('0x29')],{'$or':_[_0x7e4e('0x2b')](_0x1b87d4,function(_0x6d3a8e){if(_0x6d3a8e['type']!=='VIRTUAL'){var _0x7dcf37={};_0x7dcf37[_0x6d3a8e['name']]={'$like':'%'+_0x17d8a0[_0x7e4e('0x1d')][_0x7e4e('0x2c')]+'%'};return _0x7dcf37;}})});}_0x3101b8=_[_0x7e4e('0x2a')]({},_0x3101b8,_0x17d8a0[_0x7e4e('0x2d')]);var _0x5cc505={'where':_0x3101b8[_0x7e4e('0x29')]};return db[_0x7e4e('0x2e')][_0x7e4e('0x11')](_0x5cc505)['then'](function(_0x274da8){_0x55b6ce['count']=_0x274da8;if(_0x17d8a0[_0x7e4e('0x1d')][_0x7e4e('0x2f')]){_0x3101b8['include']=[{'all':!![]}];}return db[_0x7e4e('0x2e')][_0x7e4e('0x30')](_0x3101b8);})['then'](function(_0x1ff774){_0x55b6ce[_0x7e4e('0x31')]=_['map'](_0x1ff774,function(_0x4a763e){if(_0x4a763e[_0x7e4e('0x32')]===_0x7e4e('0x33')){var _0x5c0a67=encryptor[_0x7e4e('0x34')](_0x4a763e[_0x7e4e('0x35')]);_0x4a763e['data3']=maskClientSecret(_0x5c0a67);}return _0x4a763e;});return _0x55b6ce;})['then'](respondWithFilteredResult(_0xee6df5,_0x3101b8))[_0x7e4e('0x36')](handleError(_0xee6df5,null));};exports['show']=function(_0x3cb7d3,_0x1aaa77){var _0x12d6f1={'raw':!![],'where':{'id':_0x3cb7d3['params']['id']}},_0x505b8={};_0x505b8[_0x7e4e('0x1c')]=_[_0x7e4e('0x1e')](db[_0x7e4e('0x2e')][_0x7e4e('0x37')]);_0x505b8[_0x7e4e('0x1d')]=_['keys'](_0x3cb7d3[_0x7e4e('0x1d')]);_0x505b8[_0x7e4e('0x1f')]=_[_0x7e4e('0x20')](_0x505b8[_0x7e4e('0x1c')],_0x505b8[_0x7e4e('0x1d')]);_0x12d6f1[_0x7e4e('0x21')]=_[_0x7e4e('0x20')](_0x505b8[_0x7e4e('0x1c')],qs[_0x7e4e('0x22')](_0x3cb7d3[_0x7e4e('0x1d')][_0x7e4e('0x22')]));_0x12d6f1['attributes']=_0x12d6f1[_0x7e4e('0x21')][_0x7e4e('0x23')]?_0x12d6f1['attributes']:_0x505b8['model'];if(_0x3cb7d3[_0x7e4e('0x1d')][_0x7e4e('0x2f')]){_0x12d6f1[_0x7e4e('0x38')]=[{'all':!![]}];}_0x12d6f1=_['merge']({},_0x12d6f1,_0x3cb7d3[_0x7e4e('0x2d')]);return db[_0x7e4e('0x2e')][_0x7e4e('0x39')](_0x12d6f1)[_0x7e4e('0x15')](handleEntityNotFound(_0x1aaa77,null))[_0x7e4e('0x15')](function(_0x28f39d){if(_0x28f39d[_0x7e4e('0x32')]===_0x7e4e('0x33')){var _0x25455e=encryptor['decryptString'](_0x28f39d[_0x7e4e('0x35')]);_0x28f39d[_0x7e4e('0x35')]=maskClientSecret(_0x25455e);}return _0x28f39d;})[_0x7e4e('0x15')](respondWithResult(_0x1aaa77,null))[_0x7e4e('0x36')](handleError(_0x1aaa77,null));};exports[_0x7e4e('0x3a')]=function(_0x5b3e41,_0x35aa34){if(!_0x5b3e41['body'][_0x7e4e('0x18')])throw new Error(_0x7e4e('0x3b'));if(!_0x5b3e41[_0x7e4e('0x3c')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3b9a59=db[_0x7e4e('0x2e')][_0x7e4e('0x37')][_0x7e4e('0x32')][_0x7e4e('0x3d')];if(!_0x3b9a59[_0x7e4e('0x3e')](_0x5b3e41[_0x7e4e('0x3c')][_0x7e4e('0x32')]))throw new Error(_0x7e4e('0x3f')+_0x3b9a59[_0x7e4e('0x40')](',\x20'));if(_0x5b3e41['body'][_0x7e4e('0x32')]===_0x7e4e('0x33')&&_0x5b3e41[_0x7e4e('0x3c')][_0x7e4e('0x35')]){_0x5b3e41[_0x7e4e('0x3c')][_0x7e4e('0x35')]=encryptor['encryptString'](_0x5b3e41[_0x7e4e('0x3c')]['data3']);}return db[_0x7e4e('0x2e')][_0x7e4e('0x3a')](_0x5b3e41[_0x7e4e('0x3c')],{})[_0x7e4e('0x15')](respondWithResult(_0x35aa34,0xc9))['catch'](handleError(_0x35aa34,null));};exports[_0x7e4e('0x14')]=function(_0x2c7bbb,_0x354424){if(_0x2c7bbb['body']['id']){delete _0x2c7bbb[_0x7e4e('0x3c')]['id'];}return db['CloudProvider'][_0x7e4e('0x39')]({'where':{'id':_0x2c7bbb[_0x7e4e('0x41')]['id']}})[_0x7e4e('0x15')](handleEntityNotFound(_0x354424,null))['then'](function(_0xd8ba26){if(_0xd8ba26['service']===_0x7e4e('0x33')&&_0x2c7bbb['body']['data3']){_0x2c7bbb[_0x7e4e('0x3c')][_0x7e4e('0x35')]=encryptor[_0x7e4e('0x42')](_0x2c7bbb['body'][_0x7e4e('0x35')]);}return _0xd8ba26;})[_0x7e4e('0x15')](saveUpdates(_0x2c7bbb[_0x7e4e('0x3c')],null))[_0x7e4e('0x15')](respondWithResult(_0x354424,null))['catch'](handleError(_0x354424,null));};exports[_0x7e4e('0x16')]=function(_0x59862e,_0x21d256){return db[_0x7e4e('0x2e')][_0x7e4e('0x39')]({'where':{'id':_0x59862e['params']['id']}})[_0x7e4e('0x15')](handleEntityNotFound(_0x21d256,null))[_0x7e4e('0x15')](removeEntity(_0x21d256,null))[_0x7e4e('0x36')](handleError(_0x21d256,null));};exports[_0x7e4e('0x43')]=function(_0x48cc05,_0x11cdc8){return db[_0x7e4e('0x2e')][_0x7e4e('0x44')]({'where':{'id':_0x48cc05[_0x7e4e('0x41')]['id']},'raw':!![]})[_0x7e4e('0x15')](function(_0x127f0c){if(!_0x127f0c)return _0x11cdc8[_0x7e4e('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x127f0c,_0x48cc05['user']['id'])};})[_0x7e4e('0x15')](respondWithResult(_0x11cdc8,null))[_0x7e4e('0x36')](handleError(_0x11cdc8,null));};exports[_0x7e4e('0x45')]=function(_0x5e8690,_0x28c545){var _0x5d4cc4=_0x5e8690[_0x7e4e('0x3c')];var _0x3f5bc2;var _0x2ce638;if(_0x5d4cc4[_0x7e4e('0x46')])throw _0x5d4cc4;redis[_0x7e4e('0x47')](_0x5d4cc4[_0x7e4e('0x48')])[_0x7e4e('0x15')](function(_0x2a97e3){if(!_0x2a97e3)throw new Error(_0x7e4e('0x49'));_0x3f5bc2=JSON[_0x7e4e('0x4a')](_0x2a97e3);var _0x589e2e=Buffer[_0x7e4e('0x4b')](_0x5d4cc4[_0x7e4e('0x48')],_0x7e4e('0x4c'))[_0x7e4e('0x4d')](_0x7e4e('0x4e'));_0x2ce638=JSON[_0x7e4e('0x4a')](_0x589e2e);if(!oauth[_0x7e4e('0x4f')](_0x5d4cc4['id_token'],_0x3f5bc2[_0x7e4e('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x5d4cc4[_0x7e4e('0x48')]);return oauth[_0x7e4e('0x51')](_0x5d4cc4[_0x7e4e('0x52')],_0x3f5bc2);})[_0x7e4e('0x15')](function(_0x44fca7){_0x3f5bc2[_0x7e4e('0x53')]=_0x44fca7[_0x7e4e('0x54')];_0x3f5bc2['data6']=_0x44fca7[_0x7e4e('0x55')];return db['CloudProvider'][_0x7e4e('0x14')]({'data5':_0x3f5bc2['data5'],'data6':_0x3f5bc2[_0x7e4e('0x56')]},{'where':{'id':_0x3f5bc2['id']}});})[_0x7e4e('0x15')](function(){oauth[_0x7e4e('0x57')](_0x3f5bc2);socket[_0x7e4e('0x58')]('microsoftAuthorization:success',{'id':_0x2ce638['id']});return;})['then'](respondWithStatusCode(_0x28c545,null))['catch'](function(_0x2ea259){if(_0x2ce638){socket[_0x7e4e('0x58')](_0x7e4e('0x59'),{'id':_0x2ce638['id']});}if(!_0x3f5bc2){logger['error'](_0x7e4e('0x5a'),_0x2ea259);return _0x28c545[_0x7e4e('0xd')](0x1f4)['send'](_0x2ea259[_0x7e4e('0x5b')]);}logger[_0x7e4e('0x46')](_0x7e4e('0x5c'),_0x3f5bc2['id'],JSON[_0x7e4e('0x5d')](_0x2ea259));});};
\ No newline at end of file
+var _0x450c=['localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','access_token','refresh_token','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis'];(function(_0x2db3e3,_0x198d5c){var _0x3acd90=function(_0x5c6cf6){while(--_0x5c6cf6){_0x2db3e3['push'](_0x2db3e3['shift']());}};_0x3acd90(++_0x198d5c);}(_0x450c,0x125));var _0xc450=function(_0x531222,_0x95c7a2){_0x531222=_0x531222-0x0;var _0x3486bb=_0x450c[_0x531222];return _0x3486bb;};'use strict';var _=require('lodash');var Redis=require(_0xc450('0x0'));var qs=require(_0xc450('0x1'));var encryptor=require(_0xc450('0x2'));var config=require(_0xc450('0x3'));var logger=require('../../config/logger')('api');var db=require(_0xc450('0x4'))['db'];var oauth=require(_0xc450('0x5'));config['redis']=_['defaults'](config[_0xc450('0x6')],{'host':_0xc450('0x7'),'port':0x18eb});var socket=require(_0xc450('0x8'))(new Redis(config[_0xc450('0x6')]));var redis=new Redis(config[_0xc450('0x6')]);function respondWithStatusCode(_0x2bc709,_0x5e3ac3){_0x5e3ac3=_0x5e3ac3||0xcc;return function(_0x165f99){if(_0x165f99){return _0x2bc709[_0xc450('0x9')](_0x5e3ac3);}return _0x2bc709[_0xc450('0xa')](_0x5e3ac3)[_0xc450('0xb')]();};}function respondWithResult(_0x2f5b83,_0x47f606){_0x47f606=_0x47f606||0xc8;return function(_0x3b8e64){if(_0x3b8e64){return _0x2f5b83[_0xc450('0xa')](_0x47f606)[_0xc450('0xc')](_0x3b8e64);}};}function respondWithFilteredResult(_0x40619d,_0x348c89){return function(_0x46b080){if(_0x46b080){var _0x309d=typeof _0x348c89[_0xc450('0xd')]==='undefined'&&typeof _0x348c89[_0xc450('0xe')]===_0xc450('0xf');var _0x4f59d6=_0x46b080[_0xc450('0x10')];var _0x20627e=_0x309d?0x0:_0x348c89[_0xc450('0xd')];var _0xd2509c=_0x309d?_0x46b080[_0xc450('0x10')]:_0x348c89['offset']+_0x348c89[_0xc450('0xe')];var _0x5c30d1;if(_0xd2509c>=_0x4f59d6){_0xd2509c=_0x4f59d6;_0x5c30d1=0xc8;}else{_0x5c30d1=0xce;}_0x40619d['status'](_0x5c30d1);return _0x40619d[_0xc450('0x11')]('Content-Range',_0x20627e+'-'+_0xd2509c+'/'+_0x4f59d6)['json'](_0x46b080);}return null;};}function saveUpdates(_0x2e139b){return function(_0x4080a4){if(_0x4080a4){return _0x4080a4[_0xc450('0x12')](_0x2e139b)[_0xc450('0x13')](function(_0x491f71){return _0x491f71;});}return null;};}function removeEntity(_0x272bd2){return function(_0x5a25cc){if(_0x5a25cc){return _0x5a25cc[_0xc450('0x14')]()[_0xc450('0x13')](function(){_0x272bd2[_0xc450('0xa')](0xcc)[_0xc450('0xb')]();});}};}function handleEntityNotFound(_0x420544){return function(_0x4fa032){if(!_0x4fa032){_0x420544[_0xc450('0x9')](0x194);}return _0x4fa032;};}function handleError(_0x4061d4,_0x5c8f97){_0x5c8f97=_0x5c8f97||0x1f4;return function(_0x4aa7cd){logger[_0xc450('0x15')](_0x4aa7cd[_0xc450('0x16')]);if(_0x4aa7cd[_0xc450('0x17')]){delete _0x4aa7cd[_0xc450('0x17')];}_0x4061d4[_0xc450('0xa')](_0x5c8f97)[_0xc450('0x18')](_0x4aa7cd);};}function maskClientSecret(_0x175b29){return _[_0xc450('0x19')](_0x175b29[_0xc450('0x1a')](0x0,0x3),0x14,'*');}exports[_0xc450('0x1b')]=function(_0x3deab7,_0x9b4872){var _0x548a8a={},_0x316adc={},_0x20e425={'count':0x0,'rows':[]};var _0x926f85=_[_0xc450('0x1c')](db[_0xc450('0x1d')][_0xc450('0x1e')],function(_0x233a0c){return{'name':_0x233a0c[_0xc450('0x1f')],'type':_0x233a0c[_0xc450('0x20')][_0xc450('0x21')]};});_0x316adc[_0xc450('0x22')]=_[_0xc450('0x1c')](_0x926f85,'name');_0x316adc['query']=_[_0xc450('0x23')](_0x3deab7[_0xc450('0x24')]);_0x316adc['filters']=_['intersection'](_0x316adc[_0xc450('0x22')],_0x316adc[_0xc450('0x24')]);_0x548a8a[_0xc450('0x25')]=_[_0xc450('0x26')](_0x316adc[_0xc450('0x22')],qs[_0xc450('0x27')](_0x3deab7[_0xc450('0x24')][_0xc450('0x27')]));_0x548a8a[_0xc450('0x25')]=_0x548a8a[_0xc450('0x25')][_0xc450('0x28')]?_0x548a8a[_0xc450('0x25')]:_0x316adc[_0xc450('0x22')];if(!_0x3deab7['query'][_0xc450('0x29')](_0xc450('0x2a'))){_0x548a8a['limit']=qs['limit'](_0x3deab7[_0xc450('0x24')][_0xc450('0xe')]);_0x548a8a['offset']=qs['offset'](_0x3deab7['query'][_0xc450('0xd')]);}_0x548a8a[_0xc450('0x2b')]=qs['sort'](_0x3deab7[_0xc450('0x24')][_0xc450('0x2c')]);_0x548a8a[_0xc450('0x2d')]=qs[_0xc450('0x2e')](_[_0xc450('0x2f')](_0x3deab7[_0xc450('0x24')],_0x316adc['filters']),_0x926f85);if(_0x3deab7[_0xc450('0x24')][_0xc450('0x30')]){_0x548a8a[_0xc450('0x2d')]=_[_0xc450('0x31')](_0x548a8a[_0xc450('0x2d')],{'$or':_['map'](_0x926f85,function(_0x3838bc){if(_0x3838bc['type']!==_0xc450('0x32')){var _0x1d2073={};_0x1d2073[_0x3838bc[_0xc450('0x17')]]={'$like':'%'+_0x3deab7['query'][_0xc450('0x30')]+'%'};return _0x1d2073;}})});}_0x548a8a=_[_0xc450('0x31')]({},_0x548a8a,_0x3deab7['options']);var _0x2b8680={'where':_0x548a8a[_0xc450('0x2d')]};return db['CloudProvider'][_0xc450('0x10')](_0x2b8680)[_0xc450('0x13')](function(_0x3e2cac){_0x20e425[_0xc450('0x10')]=_0x3e2cac;if(_0x3deab7[_0xc450('0x24')][_0xc450('0x33')]){_0x548a8a[_0xc450('0x34')]=[{'all':!![]}];}return db['CloudProvider'][_0xc450('0x35')](_0x548a8a);})[_0xc450('0x13')](function(_0x3d2287){_0x20e425[_0xc450('0x36')]=_[_0xc450('0x1c')](_0x3d2287,function(_0x18d19f){if(_0x18d19f[_0xc450('0x37')]===_0xc450('0x38')){var _0x105f56=encryptor[_0xc450('0x39')](_0x18d19f[_0xc450('0x3a')]);_0x18d19f['data3']=maskClientSecret(_0x105f56);}return _0x18d19f;});return _0x20e425;})[_0xc450('0x13')](respondWithFilteredResult(_0x9b4872,_0x548a8a))[_0xc450('0x3b')](handleError(_0x9b4872,null));};exports[_0xc450('0x3c')]=function(_0x4c7e9e,_0x383407){var _0xa606b6={'raw':!![],'where':{'id':_0x4c7e9e[_0xc450('0x3d')]['id']}},_0x5462a5={};_0x5462a5['model']=_[_0xc450('0x23')](db[_0xc450('0x1d')][_0xc450('0x1e')]);_0x5462a5[_0xc450('0x24')]=_[_0xc450('0x23')](_0x4c7e9e[_0xc450('0x24')]);_0x5462a5[_0xc450('0x2e')]=_[_0xc450('0x26')](_0x5462a5[_0xc450('0x22')],_0x5462a5[_0xc450('0x24')]);_0xa606b6[_0xc450('0x25')]=_[_0xc450('0x26')](_0x5462a5[_0xc450('0x22')],qs['fields'](_0x4c7e9e['query'][_0xc450('0x27')]));_0xa606b6[_0xc450('0x25')]=_0xa606b6['attributes'][_0xc450('0x28')]?_0xa606b6[_0xc450('0x25')]:_0x5462a5[_0xc450('0x22')];if(_0x4c7e9e[_0xc450('0x24')][_0xc450('0x33')]){_0xa606b6[_0xc450('0x34')]=[{'all':!![]}];}_0xa606b6=_[_0xc450('0x31')]({},_0xa606b6,_0x4c7e9e[_0xc450('0x3e')]);return db[_0xc450('0x1d')][_0xc450('0x3f')](_0xa606b6)[_0xc450('0x13')](handleEntityNotFound(_0x383407,null))[_0xc450('0x13')](function(_0x1dbdf5){if(_0x1dbdf5[_0xc450('0x37')]===_0xc450('0x38')){var _0x4d6c6f=encryptor[_0xc450('0x39')](_0x1dbdf5[_0xc450('0x3a')]);_0x1dbdf5[_0xc450('0x3a')]=maskClientSecret(_0x4d6c6f);}return _0x1dbdf5;})[_0xc450('0x13')](respondWithResult(_0x383407,null))[_0xc450('0x3b')](handleError(_0x383407,null));};exports[_0xc450('0x40')]=function(_0x169a21,_0x4f9f3c){if(!_0x169a21[_0xc450('0x41')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x169a21['body'][_0xc450('0x37')])throw new Error(_0xc450('0x42'));var _0x3f3258=db['CloudProvider'][_0xc450('0x1e')][_0xc450('0x37')][_0xc450('0x43')];if(!_0x3f3258[_0xc450('0x44')](_0x169a21['body']['service']))throw new Error(_0xc450('0x45')+_0x3f3258['join'](',\x20'));if(_0x169a21[_0xc450('0x41')][_0xc450('0x37')]===_0xc450('0x38')&&_0x169a21['body'][_0xc450('0x3a')]){_0x169a21[_0xc450('0x41')][_0xc450('0x3a')]=encryptor[_0xc450('0x46')](_0x169a21['body'][_0xc450('0x3a')]);}return db[_0xc450('0x1d')]['create'](_0x169a21['body'],{})[_0xc450('0x13')](respondWithResult(_0x4f9f3c,0xc9))[_0xc450('0x3b')](handleError(_0x4f9f3c,null));};exports['update']=function(_0x3a8ad8,_0xd387f6){if(_0x3a8ad8[_0xc450('0x41')]['id']){delete _0x3a8ad8[_0xc450('0x41')]['id'];}return db[_0xc450('0x1d')][_0xc450('0x3f')]({'where':{'id':_0x3a8ad8['params']['id']}})['then'](handleEntityNotFound(_0xd387f6,null))[_0xc450('0x13')](function(_0x3d48db){if(_0x3d48db[_0xc450('0x37')]==='MicrosoftAzure'&&_0x3a8ad8['body'][_0xc450('0x3a')]){_0x3a8ad8[_0xc450('0x41')][_0xc450('0x3a')]=encryptor[_0xc450('0x46')](_0x3a8ad8[_0xc450('0x41')][_0xc450('0x3a')]);}return _0x3d48db;})[_0xc450('0x13')](saveUpdates(_0x3a8ad8['body'],null))[_0xc450('0x13')](respondWithResult(_0xd387f6,null))[_0xc450('0x3b')](handleError(_0xd387f6,null));};exports[_0xc450('0x14')]=function(_0x28dbe5,_0x18ba56){return db['CloudProvider'][_0xc450('0x3f')]({'where':{'id':_0x28dbe5['params']['id']}})['then'](handleEntityNotFound(_0x18ba56,null))['then'](removeEntity(_0x18ba56,null))['catch'](handleError(_0x18ba56,null));};exports[_0xc450('0x47')]=function(_0x133c97,_0x4f7f8b){return db[_0xc450('0x1d')][_0xc450('0x48')]({'where':{'id':_0x133c97[_0xc450('0x3d')]['id']},'raw':!![]})[_0xc450('0x13')](function(_0x43ce70){if(!_0x43ce70)return _0x4f7f8b[_0xc450('0x9')](0x194);return{'url':oauth[_0xc450('0x49')](_0x43ce70,_0x133c97[_0xc450('0x4a')]['id'])};})[_0xc450('0x13')](respondWithResult(_0x4f7f8b,null))[_0xc450('0x3b')](handleError(_0x4f7f8b,null));};exports[_0xc450('0x4b')]=function(_0x266855,_0x34b470){var _0x307315=_0x266855[_0xc450('0x41')];var _0x29221d;var _0x3c7345;if(_0x307315[_0xc450('0x15')])throw _0x307315;redis[_0xc450('0x4c')](_0x307315['state'])[_0xc450('0x13')](function(_0x347092){if(!_0x347092)throw new Error('Invalid\x20state\x20parameter');_0x29221d=JSON[_0xc450('0x4d')](_0x347092);var _0x7da5d4=Buffer[_0xc450('0x4e')](_0x307315[_0xc450('0x4f')],_0xc450('0x50'))[_0xc450('0x51')](_0xc450('0x52'));_0x3c7345=JSON[_0xc450('0x4d')](_0x7da5d4);if(!oauth[_0xc450('0x53')](_0x307315[_0xc450('0x54')],_0x29221d[_0xc450('0x55')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xc450('0x56')](_0x307315['state']);return oauth[_0xc450('0x57')](_0x307315['code'],_0x29221d);})[_0xc450('0x13')](function(_0x380941){_0x29221d['data5']=_0x380941[_0xc450('0x58')];_0x29221d['data6']=_0x380941[_0xc450('0x59')];return db[_0xc450('0x1d')][_0xc450('0x12')]({'data5':_0x29221d[_0xc450('0x5a')],'data6':_0x29221d[_0xc450('0x5b')]},{'where':{'id':_0x29221d['id']}});})[_0xc450('0x13')](function(){oauth[_0xc450('0x5c')](_0x29221d);socket[_0xc450('0x5d')](_0xc450('0x5e'),{'id':_0x3c7345['id']});return;})[_0xc450('0x13')](respondWithStatusCode(_0x34b470,null))[_0xc450('0x3b')](function(_0x2df6dd){if(_0x3c7345){socket[_0xc450('0x5d')](_0xc450('0x5f'),{'id':_0x3c7345['id']});}if(!_0x29221d){logger[_0xc450('0x15')](_0xc450('0x60'),_0x2df6dd);return _0x34b470[_0xc450('0xa')](0x1f4)[_0xc450('0x18')](_0x2df6dd[_0xc450('0x61')]);}logger[_0xc450('0x15')](_0xc450('0x62'),_0x29221d['id'],JSON[_0xc450('0x63')](_0x2df6dd));});};
\ No newline at end of file
index 3abb0a7..6584d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e33=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','cloud_providers','lodash'];(function(_0x1dc4fd,_0x47c249){var _0x5631c1=function(_0x185da0){while(--_0x185da0){_0x1dc4fd['push'](_0x1dc4fd['shift']());}};_0x5631c1(++_0x47c249);}(_0x2e33,0x1a1));var _0x32e3=function(_0x356a56,_0x6f035){_0x356a56=_0x356a56-0x0;var _0x37ed43=_0x2e33[_0x356a56];return _0x37ed43;};'use strict';var _=require(_0x32e3('0x0'));var util=require(_0x32e3('0x1'));var logger=require(_0x32e3('0x2'))(_0x32e3('0x3'));var moment=require(_0x32e3('0x4'));var BPromise=require(_0x32e3('0x5'));var rp=require(_0x32e3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32e3('0x7'));var config=require(_0x32e3('0x8'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x50113c,_0x3ce73b){return _0x50113c[_0x32e3('0x9')]('CloudProvider',attributes,{'tableName':_0x32e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5bf=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x586b36,_0x510770){var _0x1bde1c=function(_0x50a8a6){while(--_0x50a8a6){_0x586b36['push'](_0x586b36['shift']());}};_0x1bde1c(++_0x510770);}(_0xa5bf,0x1d5));var _0xfa5b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa5bf[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xfa5b('0x0'));var util=require(_0xfa5b('0x1'));var logger=require(_0xfa5b('0x2'))(_0xfa5b('0x3'));var moment=require('moment');var BPromise=require(_0xfa5b('0x4'));var rp=require(_0xfa5b('0x5'));var fs=require('fs');var path=require(_0xfa5b('0x6'));var rimraf=require(_0xfa5b('0x7'));var config=require(_0xfa5b('0x8'));var attributes=require(_0xfa5b('0x9'));module[_0xfa5b('0xa')]=function(_0x3f97c1,_0x1cb1cb){return _0x3f97c1[_0xfa5b('0xb')](_0xfa5b('0xc'),attributes,{'tableName':_0xfa5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da07a2d..523aed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x925c=['unix','then','data3','CloudProvider','findOne','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','ioredis','request-promise','../../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','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','response_mode','form_post','state','prompt','key','value','set','decode','payload','iss','aud','audience'];(function(_0x32689c,_0x1e5ad2){var _0xce38dd=function(_0x3945d8){while(--_0x3945d8){_0x32689c['push'](_0x32689c['shift']());}};_0xce38dd(++_0x1e5ad2);}(_0x925c,0x1cb));var _0xc925=function(_0xc085a3,_0x3a72e9){_0xc085a3=_0xc085a3-0x0;var _0x54e881=_0x925c[_0xc085a3];return _0x54e881;};'use strict';var _=require('lodash');var crypto=require(_0xc925('0x0'));var jwt=require(_0xc925('0x1'));var moment=require('moment');var Redis=require(_0xc925('0x2'));var rp=require(_0xc925('0x3'));var util=require('util');var encryptor=require(_0xc925('0x4'));var config=require(_0xc925('0x5'));var logger=require(_0xc925('0x6'))(_0xc925('0x7'));var schedule=require(_0xc925('0x8'));var db=require(_0xc925('0x9'))['db'];config[_0xc925('0xa')]=_[_0xc925('0xb')](config[_0xc925('0xa')],{'host':_0xc925('0xc'),'port':0x18eb});var redis=new Redis(config[_0xc925('0xa')]);var MICROSOFT_AUTH_URL=_0xc925('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc925('0xe'),'profile',_0xc925('0xf'),_0xc925('0x10'),_0xc925('0x11'),_0xc925('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xc925('0xe'),_0xc925('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x37e822){var _0x7a8371=_[_0xc925('0x13')](AZURE_AUTH_SCOPES[_0x37e822[_0xc925('0x14')]]);if(_0x37e822[_0xc925('0x14')]===_0xc925('0x15'))_0x7a8371[_0xc925('0x16')](_0x37e822[_0xc925('0x17')]+_0xc925('0x18'));return _0x7a8371[_0xc925('0x19')]('\x20');}function getAccessTokenScope(_0x97a775){if(_0x97a775[_0xc925('0x14')]===_0xc925('0x1a'))return _0xc925('0x11');if(_0x97a775['type']==='Dynamics365')return _0x97a775[_0xc925('0x17')]+_0xc925('0x18');}function generateMicrosoftAuthorizationUrl(_0x14e22a,_0x417875){var _0x5c2791=MICROSOFT_AUTH_URL[_0xc925('0x1b')]('{TENANT_ID}',_0x14e22a[_0xc925('0x1c')]);var _0x24bd40=[_0xc925('0x1d'),_0xc925('0x1e')];var _0x1a18c4=Buffer['from'](JSON[_0xc925('0x1f')]({'id':_0x417875}))[_0xc925('0x20')](_0xc925('0x21'));var _0x3bc872=crypto[_0xc925('0x22')](0x10)['toString'](_0xc925('0x23'));var _0x3e1b77=getAuthorizationScopes(_0x14e22a);var _0xc7cba4=[{'key':_0xc925('0x24'),'value':_0x14e22a[_0xc925('0x25')]},{'key':_0xc925('0x26'),'value':encodeURIComponent(_0x24bd40[_0xc925('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x14e22a[_0xc925('0x27')]},{'key':_0xc925('0x28'),'value':_0xc925('0x29')},{'key':'scope','value':encodeURIComponent(_0x3e1b77)},{'key':_0xc925('0x2a'),'value':_0x1a18c4},{'key':'nonce','value':_0x3bc872},{'key':_0xc925('0x2b'),'value':'login'}];var _0x67fbaa=_0x5c2791+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc925('0x13')](_0xc7cba4,function(_0x748005){return _0x748005[_0xc925('0x2c')]+'='+_0x748005[_0xc925('0x2d')];})[_0xc925('0x19')]('&');_0x14e22a['oauth2Claims']={'issuer':_0x5c2791[_0xc925('0x1b')]('oauth2/',''),'audience':_0x14e22a[_0xc925('0x25')],'state':_0x1a18c4,'nonce':_0x3bc872};redis[_0xc925('0x2e')](_0x1a18c4,JSON[_0xc925('0x1f')](_0x14e22a));return _0x67fbaa;}function isValidIdToken(_0x10d31e,_0x36c443){try{var _0x52850e=jwt[_0xc925('0x2f')](_0x10d31e,{'complete':!![]});var _0x3c81f2=_0x52850e[_0xc925('0x30')];if(_0x3c81f2[_0xc925('0x31')]!==_0x36c443['issuer'])return![];if(_0x3c81f2[_0xc925('0x32')]!==_0x36c443[_0xc925('0x33')])return![];if(_0x3c81f2['nonce']!==_0x36c443['nonce'])return![];if(moment()['isAfter'](moment[_0xc925('0x34')](_0x3c81f2['exp'])))return![];return!![];}catch(_0x416f51){throw _0x416f51;}}function refreshOauth2MicrosoftAccessToken(_0x37a5d6){return Promise['resolve']()[_0xc925('0x35')](function(){if(_0x37a5d6[_0xc925('0x36')])return _0x37a5d6;return db[_0xc925('0x37')][_0xc925('0x38')]({'where':{'id':_0x37a5d6['id']},'raw':!![]});})[_0xc925('0x35')](function(_0x55ae03){var _0x300582={'grant_type':_0xc925('0x39'),'refresh_token':_0x55ae03[_0xc925('0x3a')],'scope':getAccessTokenScope(_0x55ae03),'redirect_uri':_0x55ae03[_0xc925('0x27')],'client_id':_0x55ae03[_0xc925('0x25')],'client_secret':encryptor['decryptString'](_0x55ae03[_0xc925('0x36')])};var _0x4a6a06={'method':_0xc925('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xc925('0x1b')](_0xc925('0x3c'),_0x55ae03[_0xc925('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x300582,'json':!![]};return rp(_0x4a6a06);})['then'](function(_0x510e43){_0x37a5d6[_0xc925('0x3d')]=_0x510e43[_0xc925('0x3e')];_0x37a5d6[_0xc925('0x3a')]=_0x510e43[_0xc925('0x39')];return db[_0xc925('0x37')]['update']({'data5':_0x37a5d6['data5'],'data6':_0x37a5d6[_0xc925('0x3a')]},{'where':{'id':_0x37a5d6['id']}});})[_0xc925('0x35')](function(){return _0x37a5d6;})[_0xc925('0x3f')](function(_0x279b30){logger[_0xc925('0x40')](_0xc925('0x41'),_0x37a5d6['id'],_0x279b30);});}function getOauth2MicrosoftAccessToken(_0x591d98,_0x551cfa){var _0x31aa1b={'grant_type':_0xc925('0x42'),'code':_0x591d98,'scope':getAccessTokenScope(_0x551cfa),'redirect_uri':_0x551cfa['data4'],'client_id':_0x551cfa[_0xc925('0x25')],'client_secret':encryptor[_0xc925('0x43')](_0x551cfa[_0xc925('0x36')])};var _0x4a6779={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xc925('0x1b')](_0xc925('0x3c'),_0x551cfa['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31aa1b,'json':!![]};return rp(_0x4a6779);}function startRefreshInterval(_0x2b2021){var _0x43c832=schedule[_0xc925('0x44')];if(_0x43c832[_0x2b2021['id']])clearInterval(_0x43c832[_0x2b2021['id']]);_0x43c832[_0x2b2021['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc925('0x45')](this,{'id':_0x2b2021['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc925('0x44')]=_0x43c832;}function startAllRefreshIntervals(){return db[_0xc925('0x37')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc925('0x35')](function(_0x1199cf){var _0x282ca2=_0x1199cf['map'](function(_0xc349ee){return refreshOauth2MicrosoftAccessToken(_0xc349ee)[_0xc925('0x35')](function(_0x4ccc76){startRefreshInterval(_0x4ccc76);});});return Promise[_0xc925('0x46')](_0x282ca2);})[_0xc925('0x3f')](function(_0xeaa2cc){var _0x41f601=_0xeaa2cc?util[_0xc925('0x47')](_0xeaa2cc,{'showHidden':![],'depth':null}):'';logger[_0xc925('0x40')](_0xc925('0x48'),_0x41f601);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xc109=['ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','isAfter','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment'];(function(_0x39567e,_0x5686b1){var _0xfe26f9=function(_0x51bd8f){while(--_0x51bd8f){_0x39567e['push'](_0x39567e['shift']());}};_0xfe26f9(++_0x5686b1);}(_0xc109,0x1dd));var _0x9c10=function(_0x4a9f22,_0x439a61){_0x4a9f22=_0x4a9f22-0x0;var _0x2511ff=_0xc109[_0x4a9f22];return _0x2511ff;};'use strict';var _=require('lodash');var crypto=require(_0x9c10('0x0'));var jwt=require(_0x9c10('0x1'));var moment=require(_0x9c10('0x2'));var Redis=require(_0x9c10('0x3'));var rp=require(_0x9c10('0x4'));var util=require(_0x9c10('0x5'));var encryptor=require(_0x9c10('0x6'));var config=require('../../config/environment');var logger=require(_0x9c10('0x7'))(_0x9c10('0x8'));var schedule=require(_0x9c10('0x9'));var db=require(_0x9c10('0xa'))['db'];config['redis']=_[_0x9c10('0xb')](config[_0x9c10('0xc')],{'host':_0x9c10('0xd'),'port':0x18eb});var redis=new Redis(config[_0x9c10('0xc')]);var MICROSOFT_AUTH_URL=_0x9c10('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9c10('0xf'),_0x9c10('0x10'),_0x9c10('0x11'),_0x9c10('0x12'),_0x9c10('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9c10('0x14'),_0x9c10('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9c10('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x9c10('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x31728c){var _0x512197=_[_0x9c10('0x17')](AZURE_AUTH_SCOPES[_0x31728c[_0x9c10('0x18')]]);if(_0x31728c[_0x9c10('0x18')]===_0x9c10('0x19'))_0x512197[_0x9c10('0x1a')](_0x31728c[_0x9c10('0x1b')]+'/.default');return _0x512197[_0x9c10('0x1c')]('\x20');}function getAccessTokenScope(_0x83e991){if(_0x83e991[_0x9c10('0x18')]===_0x9c10('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x83e991[_0x9c10('0x18')]===_0x9c10('0x19'))return _0x83e991[_0x9c10('0x1b')]+_0x9c10('0x1e');}function generateMicrosoftAuthorizationUrl(_0x54f150,_0x396799){var _0x4fa313=MICROSOFT_AUTH_URL[_0x9c10('0x1f')](_0x9c10('0x20'),_0x54f150[_0x9c10('0x21')]);var _0x16bc06=[_0x9c10('0x22'),_0x9c10('0x23')];var _0x48a8d8=Buffer[_0x9c10('0x24')](JSON[_0x9c10('0x25')]({'id':_0x396799}))[_0x9c10('0x26')]('base64');var _0x30efcf=crypto[_0x9c10('0x27')](0x10)['toString'](_0x9c10('0x28'));var _0x458d4f=getAuthorizationScopes(_0x54f150);var _0x3451e8=[{'key':'client_id','value':_0x54f150['data1']},{'key':_0x9c10('0x29'),'value':encodeURIComponent(_0x16bc06[_0x9c10('0x1c')]('\x20'))},{'key':_0x9c10('0x2a'),'value':_0x54f150[_0x9c10('0x2b')]},{'key':_0x9c10('0x2c'),'value':_0x9c10('0x2d')},{'key':_0x9c10('0x2e'),'value':encodeURIComponent(_0x458d4f)},{'key':_0x9c10('0x2f'),'value':_0x48a8d8},{'key':_0x9c10('0x30'),'value':_0x30efcf},{'key':'prompt','value':'login'}];var _0x441450=_0x4fa313+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3451e8,function(_0x3fa151){return _0x3fa151[_0x9c10('0x31')]+'='+_0x3fa151[_0x9c10('0x32')];})[_0x9c10('0x1c')]('&');_0x54f150[_0x9c10('0x33')]={'issuer':_0x4fa313[_0x9c10('0x1f')](_0x9c10('0x34'),''),'audience':_0x54f150[_0x9c10('0x35')],'state':_0x48a8d8,'nonce':_0x30efcf};redis[_0x9c10('0x36')](_0x48a8d8,JSON[_0x9c10('0x25')](_0x54f150));return _0x441450;}function isValidIdToken(_0x30b048,_0x36aa94){try{var _0x561bf2=jwt[_0x9c10('0x37')](_0x30b048,{'complete':!![]});var _0x37e322=_0x561bf2[_0x9c10('0x38')];if(_0x37e322[_0x9c10('0x39')]!==_0x36aa94['issuer'])return![];if(_0x37e322['aud']!==_0x36aa94['audience'])return![];if(_0x37e322['nonce']!==_0x36aa94['nonce'])return![];if(moment()[_0x9c10('0x3a')](moment['unix'](_0x37e322[_0x9c10('0x3b')])))return![];return!![];}catch(_0x24277f){throw _0x24277f;}}function refreshOauth2MicrosoftAccessToken(_0x1d0ee7){return Promise[_0x9c10('0x3c')]()[_0x9c10('0x3d')](function(){if(_0x1d0ee7[_0x9c10('0x3e')])return _0x1d0ee7;return db[_0x9c10('0x3f')]['findOne']({'where':{'id':_0x1d0ee7['id']},'raw':!![]});})[_0x9c10('0x3d')](function(_0x9d3be7){var _0x113734={'grant_type':_0x9c10('0x40'),'refresh_token':_0x9d3be7[_0x9c10('0x41')],'scope':getAccessTokenScope(_0x9d3be7),'redirect_uri':_0x9d3be7[_0x9c10('0x2b')],'client_id':_0x9d3be7['data1'],'client_secret':encryptor[_0x9c10('0x42')](_0x9d3be7[_0x9c10('0x3e')])};var _0x3b5753={'method':_0x9c10('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9c10('0x1f')](_0x9c10('0x20'),_0x9d3be7[_0x9c10('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x113734,'json':!![]};return rp(_0x3b5753);})['then'](function(_0x11f412){_0x1d0ee7[_0x9c10('0x44')]=_0x11f412[_0x9c10('0x45')];_0x1d0ee7[_0x9c10('0x41')]=_0x11f412['refresh_token'];return db[_0x9c10('0x3f')][_0x9c10('0x46')]({'data5':_0x1d0ee7[_0x9c10('0x44')],'data6':_0x1d0ee7[_0x9c10('0x41')]},{'where':{'id':_0x1d0ee7['id']}});})['then'](function(){return _0x1d0ee7;})['catch'](function(_0x29474c){logger[_0x9c10('0x47')](_0x9c10('0x48'),_0x1d0ee7['id'],_0x29474c);});}function getOauth2MicrosoftAccessToken(_0x18d909,_0x5a21a7){var _0x1a5f27={'grant_type':_0x9c10('0x49'),'code':_0x18d909,'scope':getAccessTokenScope(_0x5a21a7),'redirect_uri':_0x5a21a7[_0x9c10('0x2b')],'client_id':_0x5a21a7['data1'],'client_secret':encryptor[_0x9c10('0x42')](_0x5a21a7['data3'])};var _0x5819e2={'method':_0x9c10('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9c10('0x1f')](_0x9c10('0x20'),_0x5a21a7['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a5f27,'json':!![]};return rp(_0x5819e2);}function startRefreshInterval(_0x500257){var _0x44c710=schedule[_0x9c10('0x4a')];if(_0x44c710[_0x500257['id']])clearInterval(_0x44c710[_0x500257['id']]);_0x44c710[_0x500257['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x500257['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x44c710;}function startAllRefreshIntervals(){return db[_0x9c10('0x3f')][_0x9c10('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9c10('0x3d')](function(_0x502726){var _0xea74b0=_0x502726['map'](function(_0x51e6d4){return refreshOauth2MicrosoftAccessToken(_0x51e6d4)[_0x9c10('0x3d')](function(_0x3c558c){startRefreshInterval(_0x3c558c);});});return Promise[_0x9c10('0x4c')](_0xea74b0);})[_0x9c10('0x4d')](function(_0x181ce0){var _0x1f5765=_0x181ce0?util['inspect'](_0x181ce0,{'showHidden':![],'depth':null}):'';logger[_0x9c10('0x47')](_0x9c10('0x4e'),_0x1f5765);});}module[_0x9c10('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 3c848ca..344fb25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35d=['rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x104b2a,_0x2bf77a){var _0x176bd8=function(_0x3d0b5f){while(--_0x3d0b5f){_0x104b2a['push'](_0x104b2a['shift']());}};_0x176bd8(++_0x2bf77a);}(_0xe35d,0xd5));var _0xde35=function(_0x59770e,_0x305cf7){_0x59770e=_0x59770e-0x0;var _0x9b25b7=_0xe35d[_0x59770e];return _0x9b25b7;};'use strict';var _=require(_0xde35('0x0'));var util=require(_0xde35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde35('0x2'));var fs=require('fs');var Redis=require(_0xde35('0x3'));var db=require(_0xde35('0x4'))['db'];var utils=require(_0xde35('0x5'));var logger=require(_0xde35('0x6'))(_0xde35('0x7'));var config=require(_0xde35('0x8'));var jayson=require(_0xde35('0x9'));var client=jayson[_0xde35('0xa')][_0xde35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57c5a7,_0x1f0541,_0xe542e){return new BPromise(function(_0x3200e1,_0x25c8a1){return client[_0xde35('0xc')](_0x57c5a7,_0xe542e)['then'](function(_0xa3af60){logger[_0xde35('0xd')](_0xde35('0xe'),_0x1f0541,'request\x20sent');logger[_0xde35('0xf')](_0xde35('0x10'),_0x1f0541,'request\x20sent',JSON[_0xde35('0x11')](_0xa3af60));if(_0xa3af60['error']){if(_0xa3af60[_0xde35('0x12')]['code']===0x1f4){logger[_0xde35('0x12')]('CloudProvider,\x20%s,\x20%s',_0x1f0541,_0xa3af60['error']['message']);return _0x25c8a1(_0xa3af60['error']['message']);}logger[_0xde35('0x12')](_0xde35('0xe'),_0x1f0541,_0xa3af60['error']['message']);return _0x3200e1(_0xa3af60[_0xde35('0x12')][_0xde35('0x13')]);}else{logger[_0xde35('0xd')](_0xde35('0xe'),_0x1f0541,_0xde35('0x14'));_0x3200e1(_0xa3af60['result'][_0xde35('0x13')]);}})[_0xde35('0x15')](function(_0x274de6){logger[_0xde35('0x12')](_0xde35('0xe'),_0x1f0541,_0x274de6);_0x25c8a1(_0x274de6);});});}
\ No newline at end of file
+var _0x565e=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x3e2a9b,_0x2cd62f){var _0x1fe73a=function(_0x15e87c){while(--_0x15e87c){_0x3e2a9b['push'](_0x3e2a9b['shift']());}};_0x1fe73a(++_0x2cd62f);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require('util');var moment=require(_0xe565('0x1'));var BPromise=require(_0xe565('0x2'));var rs=require(_0xe565('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe565('0x4'));var logger=require(_0xe565('0x5'))(_0xe565('0x6'));var config=require(_0xe565('0x7'));var jayson=require(_0xe565('0x8'));var client=jayson[_0xe565('0x9')][_0xe565('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9d48,_0x470daf,_0x359a05){return new BPromise(function(_0x1204c8,_0x14f3df){return client[_0xe565('0xb')](_0x1a9d48,_0x359a05)[_0xe565('0xc')](function(_0x1d3d48){logger[_0xe565('0xd')]('CloudProvider,\x20%s,\x20%s',_0x470daf,_0xe565('0xe'));logger[_0xe565('0xf')](_0xe565('0x10'),_0x470daf,'request\x20sent',JSON[_0xe565('0x11')](_0x1d3d48));if(_0x1d3d48[_0xe565('0x12')]){if(_0x1d3d48[_0xe565('0x12')][_0xe565('0x13')]===0x1f4){logger['error'](_0xe565('0x14'),_0x470daf,_0x1d3d48['error'][_0xe565('0x15')]);return _0x14f3df(_0x1d3d48['error'][_0xe565('0x15')]);}logger[_0xe565('0x12')](_0xe565('0x14'),_0x470daf,_0x1d3d48['error'][_0xe565('0x15')]);return _0x1204c8(_0x1d3d48[_0xe565('0x12')][_0xe565('0x15')]);}else{logger[_0xe565('0xd')]('CloudProvider,\x20%s,\x20%s',_0x470daf,_0xe565('0xe'));_0x1204c8(_0x1d3d48[_0xe565('0x16')][_0xe565('0x15')]);}})[_0xe565('0x17')](function(_0x3899de){logger[_0xe565('0x12')]('CloudProvider,\x20%s,\x20%s',_0x470daf,_0x3899de);_0x14f3df(_0x3899de);});});}
\ No newline at end of file
index 3b8b705..c4d7aee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x5f2f[_0x274dd7];return _0x148829;};'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')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x16b9a2,_0x238e9e){var _0x34f907=function(_0x2bdc77){while(--_0x2bdc77){_0x16b9a2['push'](_0x16b9a2['shift']());}};_0x34f907(++_0x238e9e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
index de0fc19..64c6d63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24d3=['exports','STRING','name','sequelize'];(function(_0x77c92d,_0x46a33b){var _0x5ef007=function(_0x2189dc){while(--_0x2189dc){_0x77c92d['push'](_0x77c92d['shift']());}};_0x5ef007(++_0x46a33b);}(_0x24d3,0xcf));var _0x324d=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0x24d3[_0x58a4fe];return _0x697de2;};'use strict';var Sequelize=require(_0x324d('0x0'));module[_0x324d('0x1')]={'name':{'type':Sequelize[_0x324d('0x2')],'unique':_0x324d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x324d('0x2')]},'companyId':{'type':Sequelize[_0x324d('0x2')]},'website':{'type':Sequelize[_0x324d('0x2')]},'phone':{'type':Sequelize[_0x324d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x324d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x324d('0x2')]},'city':{'type':Sequelize[_0x324d('0x2')]},'country':{'type':Sequelize[_0x324d('0x2')]},'email':{'type':Sequelize[_0x324d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x324d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x324d('0x2')]},'sCity':{'type':Sequelize[_0x324d('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb102=['STRING','name','sequelize'];(function(_0x1e767d,_0x398fc9){var _0x4b631b=function(_0xf78d76){while(--_0xf78d76){_0x1e767d['push'](_0x1e767d['shift']());}};_0x4b631b(++_0x398fc9);}(_0xb102,0x16d));var _0x2b10=function(_0x4c71fa,_0x14b8f7){_0x4c71fa=_0x4c71fa-0x0;var _0x46621e=_0xb102[_0x4c71fa];return _0x46621e;};'use strict';var Sequelize=require(_0x2b10('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b10('0x1')],'unique':_0x2b10('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2b10('0x1')]},'companyId':{'type':Sequelize[_0x2b10('0x1')]},'website':{'type':Sequelize[_0x2b10('0x1')]},'phone':{'type':Sequelize[_0x2b10('0x1')]},'fax':{'type':Sequelize[_0x2b10('0x1')]},'type':{'type':Sequelize[_0x2b10('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2b10('0x1')]},'city':{'type':Sequelize[_0x2b10('0x1')]},'country':{'type':Sequelize[_0x2b10('0x1')]},'email':{'type':Sequelize[_0x2b10('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2b10('0x1')]},'sPostalCode':{'type':Sequelize[_0x2b10('0x1')]},'sCity':{'type':Sequelize[_0x2b10('0x1')]},'sCountry':{'type':Sequelize[_0x2b10('0x1')]},'description':{'type':Sequelize[_0x2b10('0x1')]}};
\ No newline at end of file
index a90d6dc..62ec86a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f18=['order','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Companies','UserProfileResource','destroy','error','name','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','merge','map','CmCompany','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addContacts','CmContact','ids','omit','getContacts','length'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6f18,0xa5));var _0x86f1=function(_0x2b29d3,_0x5dc631){_0x2b29d3=_0x2b29d3-0x0;var _0x12ef78=_0x6f18[_0x2b29d3];return _0x12ef78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86f1('0x0'));var zipdir=require(_0x86f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86f1('0x2'));var moment=require('moment');var BPromise=require(_0x86f1('0x3'));var Mustache=require(_0x86f1('0x4'));var util=require('util');var path=require(_0x86f1('0x5'));var sox=require(_0x86f1('0x6'));var csv=require(_0x86f1('0x7'));var ejs=require(_0x86f1('0x8'));var fs=require('fs');var fs_extra=require(_0x86f1('0x9'));var _=require(_0x86f1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86f1('0xb'));var deskjs=require(_0x86f1('0xc'));var toCsv=require(_0x86f1('0x7'));var querystring=require('querystring');var Papa=require(_0x86f1('0xd'));var Redis=require(_0x86f1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x86f1('0xf'));var as=require(_0x86f1('0x10'));var hardwareService=require(_0x86f1('0x11'));var logger=require(_0x86f1('0x12'))(_0x86f1('0x13'));var utils=require('../../config/utils');var config=require(_0x86f1('0x14'));var licenseUtil=require(_0x86f1('0x15'));var db=require(_0x86f1('0x16'))['db'];function respondWithStatusCode(_0xdab3af,_0x327472){_0x327472=_0x327472||0xcc;return function(_0x5b7bd7){if(_0x5b7bd7){return _0xdab3af[_0x86f1('0x17')](_0x327472);}return _0xdab3af['status'](_0x327472)[_0x86f1('0x18')]();};}function respondWithResult(_0x17885d,_0x4f20c4){_0x4f20c4=_0x4f20c4||0xc8;return function(_0x17b197){if(_0x17b197){return _0x17885d[_0x86f1('0x19')](_0x4f20c4)[_0x86f1('0x1a')](_0x17b197);}};}function respondWithFilteredResult(_0x1b7816,_0x1dc2ec){return function(_0x4121c5){if(_0x4121c5){var _0x481d1a=typeof _0x1dc2ec[_0x86f1('0x1b')]===_0x86f1('0x1c')&&typeof _0x1dc2ec[_0x86f1('0x1d')]===_0x86f1('0x1c');var _0x276cee=_0x4121c5[_0x86f1('0x1e')];var _0x4ed981=_0x481d1a?0x0:_0x1dc2ec[_0x86f1('0x1b')];var _0x3a2b38=_0x481d1a?_0x4121c5['count']:_0x1dc2ec[_0x86f1('0x1b')]+_0x1dc2ec[_0x86f1('0x1d')];var _0x5a10c9;if(_0x3a2b38>=_0x276cee){_0x3a2b38=_0x276cee;_0x5a10c9=0xc8;}else{_0x5a10c9=0xce;}_0x1b7816[_0x86f1('0x19')](_0x5a10c9);return _0x1b7816[_0x86f1('0x1f')](_0x86f1('0x20'),_0x4ed981+'-'+_0x3a2b38+'/'+_0x276cee)['json'](_0x4121c5);}return null;};}function patchUpdates(_0x2e8ba8){return function(_0x4c616a){try{jsonpatch[_0x86f1('0x21')](_0x4c616a,_0x2e8ba8,!![]);}catch(_0x49b47d){return BPromise['reject'](_0x49b47d);}return _0x4c616a[_0x86f1('0x22')]();};}function saveUpdates(_0x6df268,_0x36b1a1){return function(_0x2a4418){if(_0x2a4418){return _0x2a4418[_0x86f1('0x23')](_0x6df268)[_0x86f1('0x24')](function(_0x323f1e){return _0x323f1e;});}return null;};}function removeEntity(_0x8160bf,_0x52199e){return function(_0x4a9cd4){if(_0x4a9cd4){return _0x4a9cd4['destroy']()[_0x86f1('0x24')](function(){var _0x3282bf=_0x4a9cd4[_0x86f1('0x25')]({'plain':!![]});var _0x1f5b34=_0x86f1('0x26');return db[_0x86f1('0x27')][_0x86f1('0x28')]({'where':{'type':_0x1f5b34,'resourceId':_0x3282bf['id']}})[_0x86f1('0x24')](function(){return _0x4a9cd4;});})[_0x86f1('0x24')](function(){_0x8160bf[_0x86f1('0x19')](0xcc)[_0x86f1('0x18')]();});}};}function handleEntityNotFound(_0x5e32f4,_0x119f7b){return function(_0x13837e){if(!_0x13837e){_0x5e32f4['sendStatus'](0x194);}return _0x13837e;};}function handleError(_0x3e1f96,_0x21de97){_0x21de97=_0x21de97||0x1f4;return function(_0x521f0b){logger[_0x86f1('0x29')](_0x521f0b['stack']);if(_0x521f0b[_0x86f1('0x2a')]){delete _0x521f0b[_0x86f1('0x2a')];}_0x3e1f96['status'](_0x21de97)['send'](_0x521f0b);};}exports['index']=function(_0x28b6a2,_0x31d6e2){var _0x26a139={},_0x1d1b40={},_0x1a80f1={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0xc05326){_0x1d1b40[_0x86f1('0x2b')]=_[_0x86f1('0x2c')](_0xc05326);_0x1d1b40['query']=_[_0x86f1('0x2c')](_0x28b6a2[_0x86f1('0x2d')]);_0x1d1b40[_0x86f1('0x2e')]=_[_0x86f1('0x2f')](_0x1d1b40[_0x86f1('0x2b')],_0x1d1b40['query']);_0x26a139[_0x86f1('0x30')]=_['intersection'](_0x1d1b40['model'],qs[_0x86f1('0x31')](_0x28b6a2[_0x86f1('0x2d')]['fields']));_0x26a139[_0x86f1('0x30')]=_0x26a139[_0x86f1('0x30')]['length']?_0x26a139[_0x86f1('0x30')]:_0x1d1b40[_0x86f1('0x2b')];if(!_0x28b6a2[_0x86f1('0x2d')]['hasOwnProperty']('nolimit')){_0x26a139[_0x86f1('0x1d')]=qs['limit'](_0x28b6a2[_0x86f1('0x2d')][_0x86f1('0x1d')]);_0x26a139[_0x86f1('0x1b')]=qs['offset'](_0x28b6a2['query'][_0x86f1('0x1b')]);}_0x26a139['order']=qs['sort'](_0x28b6a2['query'][_0x86f1('0x32')]);_0x26a139[_0x86f1('0x33')]=qs[_0x86f1('0x2e')](_[_0x86f1('0x34')](_0x28b6a2['query'],_0x1d1b40[_0x86f1('0x2e')]),_0xc05326);if(_0x28b6a2[_0x86f1('0x2d')][_0x86f1('0x35')]){_0x26a139['where']=_[_0x86f1('0x36')](_0x26a139[_0x86f1('0x33')],{'$or':_[_0x86f1('0x37')](_0x26a139[_0x86f1('0x30')],function(_0x13717e){var _0x31be26={};_0x31be26[_0x13717e]={'$like':'%'+_0x28b6a2[_0x86f1('0x2d')]['filter']+'%'};return _0x31be26;})});}_0x26a139=_[_0x86f1('0x36')]({},_0x26a139,_0x28b6a2['options']);var _0x368b15={'where':_0x26a139[_0x86f1('0x33')]};return db[_0x86f1('0x38')][_0x86f1('0x1e')](_0x368b15)[_0x86f1('0x24')](function(_0xa0922e){_0x1a80f1[_0x86f1('0x1e')]=_0xa0922e;if(_0x28b6a2[_0x86f1('0x2d')][_0x86f1('0x39')]){_0x26a139['include']=[{'all':!![]}];}return db['CmCompany'][_0x86f1('0x3a')](_0x26a139);})[_0x86f1('0x24')](function(_0x3299c6){_0x1a80f1[_0x86f1('0x3b')]=_0x3299c6;return _0x1a80f1;})['then'](respondWithFilteredResult(_0x31d6e2,_0x26a139))[_0x86f1('0x3c')](handleError(_0x31d6e2,null));})[_0x86f1('0x3c')](handleError(_0x31d6e2,null));};exports[_0x86f1('0x3d')]=function(_0x23fcfc,_0x36aa58){var _0x4f9651={'raw':![],'where':{'id':_0x23fcfc['params']['id']}},_0x48acfd={};_0x48acfd['model']=_[_0x86f1('0x2c')](db[_0x86f1('0x38')][_0x86f1('0x3e')]);_0x48acfd['query']=_['keys'](_0x23fcfc['query']);_0x48acfd[_0x86f1('0x2e')]=_['intersection'](_0x48acfd[_0x86f1('0x2b')],_0x48acfd[_0x86f1('0x2d')]);_0x4f9651['attributes']=_[_0x86f1('0x2f')](_0x48acfd['model'],qs[_0x86f1('0x31')](_0x23fcfc[_0x86f1('0x2d')][_0x86f1('0x31')]));_0x4f9651[_0x86f1('0x30')]=_0x4f9651[_0x86f1('0x30')]['length']?_0x4f9651[_0x86f1('0x30')]:_0x48acfd[_0x86f1('0x2b')];if(_0x23fcfc[_0x86f1('0x2d')][_0x86f1('0x39')]){_0x4f9651[_0x86f1('0x3f')]=[{'all':!![]}];}_0x4f9651=_[_0x86f1('0x36')]({},_0x4f9651,_0x23fcfc[_0x86f1('0x40')]);return db[_0x86f1('0x38')][_0x86f1('0x41')](_0x4f9651)[_0x86f1('0x24')](handleEntityNotFound(_0x36aa58,null))[_0x86f1('0x24')](respondWithResult(_0x36aa58,null))[_0x86f1('0x3c')](handleError(_0x36aa58,null));};exports[_0x86f1('0x42')]=function(_0x380e62,_0x3f2beb){return db['CmCompany'][_0x86f1('0x42')](_0x380e62['body'],{})[_0x86f1('0x24')](function(_0x3ff45b){var _0x46e3b1=_0x380e62['user'][_0x86f1('0x25')]({'plain':!![]});if(!_0x46e3b1)throw new Error(_0x86f1('0x43'));if(_0x46e3b1['role']===_0x86f1('0x44')){var _0x7df4b6=_0x3ff45b['get']({'plain':!![]});var _0x46b281='Companies';return db[_0x86f1('0x45')][_0x86f1('0x41')]({'where':{'name':_0x46b281,'userProfileId':_0x46e3b1[_0x86f1('0x46')]},'raw':!![]})[_0x86f1('0x24')](function(_0x54f233){if(_0x54f233&&_0x54f233['autoAssociation']===0x0){return db[_0x86f1('0x27')]['create']({'name':_0x7df4b6['name'],'resourceId':_0x7df4b6['id'],'type':_0x54f233[_0x86f1('0x2a')],'sectionId':_0x54f233['id']},{})[_0x86f1('0x24')](function(){return _0x3ff45b;});}else{return _0x3ff45b;}})[_0x86f1('0x3c')](function(_0x4fd25d){logger[_0x86f1('0x29')](_0x86f1('0x47'),_0x4fd25d);throw _0x4fd25d;});}return _0x3ff45b;})[_0x86f1('0x24')](respondWithResult(_0x3f2beb,0xc9))['catch'](handleError(_0x3f2beb,null));};exports['update']=function(_0x236943,_0x5e9842){if(_0x236943[_0x86f1('0x48')]['id']){delete _0x236943[_0x86f1('0x48')]['id'];}return db['CmCompany'][_0x86f1('0x41')]({'where':{'id':_0x236943[_0x86f1('0x49')]['id']}})[_0x86f1('0x24')](handleEntityNotFound(_0x5e9842,null))[_0x86f1('0x24')](saveUpdates(_0x236943['body'],null))[_0x86f1('0x24')](respondWithResult(_0x5e9842,null))[_0x86f1('0x3c')](handleError(_0x5e9842,null));};exports[_0x86f1('0x28')]=function(_0x12fad0,_0x271619){return db[_0x86f1('0x38')][_0x86f1('0x41')]({'where':{'id':_0x12fad0[_0x86f1('0x49')]['id']}})[_0x86f1('0x24')](handleEntityNotFound(_0x271619,null))[_0x86f1('0x24')](removeEntity(_0x271619,null))[_0x86f1('0x3c')](handleError(_0x271619,null));};exports[_0x86f1('0x4a')]=function(_0x18e6ff,_0x235e28){return db[_0x86f1('0x38')]['describe']()[_0x86f1('0x24')](respondWithResult(_0x235e28,null))[_0x86f1('0x3c')](handleError(_0x235e28,null));};exports[_0x86f1('0x4b')]=function(_0x5b61a5,_0x3450bd,_0xc141ff){return db[_0x86f1('0x4c')][_0x86f1('0x41')]({'where':{'id':_0x5b61a5[_0x86f1('0x49')]['id']}})[_0x86f1('0x24')](handleEntityNotFound(_0x3450bd,null))[_0x86f1('0x24')](function(_0x1436f7){if(_0x1436f7){return _0x1436f7[_0x86f1('0x4b')](_0x5b61a5['body'][_0x86f1('0x4d')],_[_0x86f1('0x4e')](_0x5b61a5[_0x86f1('0x48')],[_0x86f1('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x3450bd,null))[_0x86f1('0x3c')](handleError(_0x3450bd,null));};exports[_0x86f1('0x4f')]=function(_0x273f7e,_0x9ce6c5,_0x151f3f){var _0x1da557={};var _0xd2dfff={};var _0x155171;var _0x385757;return db[_0x86f1('0x38')]['findOne']({'where':{'id':_0x273f7e[_0x86f1('0x49')]['id']}})[_0x86f1('0x24')](handleEntityNotFound(_0x9ce6c5,null))['then'](function(_0x19c4e3){if(_0x19c4e3){_0x155171=_0x19c4e3;_0xd2dfff[_0x86f1('0x2b')]=_[_0x86f1('0x2c')](db[_0x86f1('0x4c')][_0x86f1('0x3e')]);_0xd2dfff[_0x86f1('0x2d')]=_['keys'](_0x273f7e[_0x86f1('0x2d')]);_0xd2dfff['filters']=_[_0x86f1('0x2f')](_0xd2dfff['model'],_0xd2dfff[_0x86f1('0x2d')]);_0x1da557[_0x86f1('0x30')]=_[_0x86f1('0x2f')](_0xd2dfff[_0x86f1('0x2b')],qs[_0x86f1('0x31')](_0x273f7e[_0x86f1('0x2d')][_0x86f1('0x31')]));_0x1da557[_0x86f1('0x30')]=_0x1da557[_0x86f1('0x30')][_0x86f1('0x50')]?_0x1da557[_0x86f1('0x30')]:_0xd2dfff[_0x86f1('0x2b')];_0x1da557[_0x86f1('0x51')]=qs['sort'](_0x273f7e[_0x86f1('0x2d')][_0x86f1('0x32')]);_0x1da557[_0x86f1('0x33')]=qs[_0x86f1('0x2e')](_['pick'](_0x273f7e[_0x86f1('0x2d')],_0xd2dfff[_0x86f1('0x2e')]));if(_0x273f7e[_0x86f1('0x2d')][_0x86f1('0x35')]){_0x1da557[_0x86f1('0x33')]=_[_0x86f1('0x36')](_0x1da557[_0x86f1('0x33')],{'$or':_['map'](_0x1da557['attributes'],function(_0x424a83){var _0x22ffdd={};_0x22ffdd[_0x424a83]={'$like':'%'+_0x273f7e[_0x86f1('0x2d')][_0x86f1('0x35')]+'%'};return _0x22ffdd;})});}_0x1da557=_['merge']({},_0x1da557,_0x273f7e[_0x86f1('0x40')]);return _0x155171[_0x86f1('0x4f')](_0x1da557);}})[_0x86f1('0x24')](function(_0x384184){if(_0x384184){_0x385757=_0x384184[_0x86f1('0x50')];if(!_0x273f7e['query']['hasOwnProperty']('nolimit')){_0x1da557['limit']=qs['limit'](_0x273f7e[_0x86f1('0x2d')][_0x86f1('0x1d')]);_0x1da557[_0x86f1('0x1b')]=qs[_0x86f1('0x1b')](_0x273f7e[_0x86f1('0x2d')]['offset']);}return _0x155171[_0x86f1('0x4f')](_0x1da557);}})['then'](function(_0x4ccd31){if(_0x4ccd31){return _0x4ccd31?{'count':_0x385757,'rows':_0x4ccd31}:null;}})[_0x86f1('0x24')](respondWithResult(_0x9ce6c5,null))['catch'](handleError(_0x9ce6c5,null));};
\ No newline at end of file
+var _0x4dea=['then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','filters','intersection','attributes','query','fields','nolimit','order','pick','filter','where','map','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','sort','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x1927d7,_0x21a071){var _0x1eb2bf=function(_0x485975){while(--_0x485975){_0x1927d7['push'](_0x1927d7['shift']());}};_0x1eb2bf(++_0x21a071);}(_0x4dea,0x88));var _0xa4de=function(_0x3086e5,_0x5364e7){_0x3086e5=_0x3086e5-0x0;var _0x27f951=_0x4dea[_0x3086e5];return _0x27f951;};'use strict';var emlformat=require(_0xa4de('0x0'));var rimraf=require(_0xa4de('0x1'));var zipdir=require(_0xa4de('0x2'));var jsonpatch=require(_0xa4de('0x3'));var rp=require('request-promise');var moment=require(_0xa4de('0x4'));var BPromise=require(_0xa4de('0x5'));var Mustache=require(_0xa4de('0x6'));var util=require(_0xa4de('0x7'));var path=require(_0xa4de('0x8'));var sox=require('sox');var csv=require(_0xa4de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4de('0xa'));var _=require(_0xa4de('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa4de('0xc'));var deskjs=require(_0xa4de('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa4de('0xe'));var Papa=require(_0xa4de('0xf'));var Redis=require('ioredis');var authService=require(_0xa4de('0x10'));var qs=require(_0xa4de('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4de('0x12'));var logger=require('../../config/logger')(_0xa4de('0x13'));var utils=require(_0xa4de('0x14'));var config=require(_0xa4de('0x15'));var licenseUtil=require(_0xa4de('0x16'));var db=require(_0xa4de('0x17'))['db'];function respondWithStatusCode(_0x18db03,_0x1f8dfd){_0x1f8dfd=_0x1f8dfd||0xcc;return function(_0x271377){if(_0x271377){return _0x18db03[_0xa4de('0x18')](_0x1f8dfd);}return _0x18db03['status'](_0x1f8dfd)[_0xa4de('0x19')]();};}function respondWithResult(_0x4f4517,_0x3fb89c){_0x3fb89c=_0x3fb89c||0xc8;return function(_0x38309e){if(_0x38309e){return _0x4f4517[_0xa4de('0x1a')](_0x3fb89c)['json'](_0x38309e);}};}function respondWithFilteredResult(_0x1fe7cd,_0x524a6d){return function(_0x426575){if(_0x426575){var _0x52e9ad=typeof _0x524a6d[_0xa4de('0x1b')]==='undefined'&&typeof _0x524a6d[_0xa4de('0x1c')]===_0xa4de('0x1d');var _0x36c6c3=_0x426575[_0xa4de('0x1e')];var _0x275030=_0x52e9ad?0x0:_0x524a6d[_0xa4de('0x1b')];var _0x3f9a0a=_0x52e9ad?_0x426575[_0xa4de('0x1e')]:_0x524a6d[_0xa4de('0x1b')]+_0x524a6d[_0xa4de('0x1c')];var _0x90ba8b;if(_0x3f9a0a>=_0x36c6c3){_0x3f9a0a=_0x36c6c3;_0x90ba8b=0xc8;}else{_0x90ba8b=0xce;}_0x1fe7cd[_0xa4de('0x1a')](_0x90ba8b);return _0x1fe7cd[_0xa4de('0x1f')](_0xa4de('0x20'),_0x275030+'-'+_0x3f9a0a+'/'+_0x36c6c3)[_0xa4de('0x21')](_0x426575);}return null;};}function patchUpdates(_0x4fe8ff){return function(_0x3a654e){try{jsonpatch[_0xa4de('0x22')](_0x3a654e,_0x4fe8ff,!![]);}catch(_0x293f8b){return BPromise[_0xa4de('0x23')](_0x293f8b);}return _0x3a654e[_0xa4de('0x24')]();};}function saveUpdates(_0x354bf2,_0x3f0455){return function(_0x1335ac){if(_0x1335ac){return _0x1335ac[_0xa4de('0x25')](_0x354bf2)[_0xa4de('0x26')](function(_0x4b647a){return _0x4b647a;});}return null;};}function removeEntity(_0x32436f,_0x44b83a){return function(_0x5750f8){if(_0x5750f8){return _0x5750f8[_0xa4de('0x27')]()[_0xa4de('0x26')](function(){var _0x331896=_0x5750f8[_0xa4de('0x28')]({'plain':!![]});var _0x2d38fd=_0xa4de('0x29');return db[_0xa4de('0x2a')][_0xa4de('0x27')]({'where':{'type':_0x2d38fd,'resourceId':_0x331896['id']}})['then'](function(){return _0x5750f8;});})['then'](function(){_0x32436f[_0xa4de('0x1a')](0xcc)[_0xa4de('0x19')]();});}};}function handleEntityNotFound(_0x4d93f4,_0x4aa0e1){return function(_0x59043d){if(!_0x59043d){_0x4d93f4[_0xa4de('0x18')](0x194);}return _0x59043d;};}function handleError(_0x51472c,_0x33bfb0){_0x33bfb0=_0x33bfb0||0x1f4;return function(_0x51e9a0){logger[_0xa4de('0x2b')](_0x51e9a0[_0xa4de('0x2c')]);if(_0x51e9a0[_0xa4de('0x2d')]){delete _0x51e9a0[_0xa4de('0x2d')];}_0x51472c['status'](_0x33bfb0)['send'](_0x51e9a0);};}exports[_0xa4de('0x2e')]=function(_0x9aa3df,_0x32be3a){var _0x55c300={},_0x46906b={},_0x5a3b21={'count':0x0,'rows':[]};return db[_0xa4de('0x2f')][_0xa4de('0x30')]()[_0xa4de('0x26')](function(_0x20037b){_0x46906b[_0xa4de('0x31')]=_['keys'](_0x20037b);_0x46906b['query']=_[_0xa4de('0x32')](_0x9aa3df['query']);_0x46906b[_0xa4de('0x33')]=_[_0xa4de('0x34')](_0x46906b[_0xa4de('0x31')],_0x46906b['query']);_0x55c300[_0xa4de('0x35')]=_[_0xa4de('0x34')](_0x46906b[_0xa4de('0x31')],qs['fields'](_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x37')]));_0x55c300[_0xa4de('0x35')]=_0x55c300[_0xa4de('0x35')]['length']?_0x55c300[_0xa4de('0x35')]:_0x46906b[_0xa4de('0x31')];if(!_0x9aa3df[_0xa4de('0x36')]['hasOwnProperty'](_0xa4de('0x38'))){_0x55c300['limit']=qs['limit'](_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x1c')]);_0x55c300['offset']=qs[_0xa4de('0x1b')](_0x9aa3df['query'][_0xa4de('0x1b')]);}_0x55c300[_0xa4de('0x39')]=qs['sort'](_0x9aa3df[_0xa4de('0x36')]['sort']);_0x55c300['where']=qs[_0xa4de('0x33')](_[_0xa4de('0x3a')](_0x9aa3df[_0xa4de('0x36')],_0x46906b[_0xa4de('0x33')]),_0x20037b);if(_0x9aa3df['query'][_0xa4de('0x3b')]){_0x55c300[_0xa4de('0x3c')]=_['merge'](_0x55c300[_0xa4de('0x3c')],{'$or':_[_0xa4de('0x3d')](_0x55c300[_0xa4de('0x35')],function(_0x26608f){var _0x26d13e={};_0x26d13e[_0x26608f]={'$like':'%'+_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x3b')]+'%'};return _0x26d13e;})});}_0x55c300=_[_0xa4de('0x3e')]({},_0x55c300,_0x9aa3df[_0xa4de('0x3f')]);var _0x2331dd={'where':_0x55c300[_0xa4de('0x3c')]};return db[_0xa4de('0x2f')][_0xa4de('0x1e')](_0x2331dd)[_0xa4de('0x26')](function(_0x20a27d){_0x5a3b21['count']=_0x20a27d;if(_0x9aa3df[_0xa4de('0x36')][_0xa4de('0x40')]){_0x55c300['include']=[{'all':!![]}];}return db[_0xa4de('0x2f')][_0xa4de('0x41')](_0x55c300);})[_0xa4de('0x26')](function(_0x300764){_0x5a3b21[_0xa4de('0x42')]=_0x300764;return _0x5a3b21;})[_0xa4de('0x26')](respondWithFilteredResult(_0x32be3a,_0x55c300))[_0xa4de('0x43')](handleError(_0x32be3a,null));})[_0xa4de('0x43')](handleError(_0x32be3a,null));};exports[_0xa4de('0x44')]=function(_0x4b5770,_0x3070f2){var _0x10fc66={'raw':![],'where':{'id':_0x4b5770[_0xa4de('0x45')]['id']}},_0x3c83ca={};_0x3c83ca[_0xa4de('0x31')]=_[_0xa4de('0x32')](db['CmCompany'][_0xa4de('0x46')]);_0x3c83ca['query']=_[_0xa4de('0x32')](_0x4b5770['query']);_0x3c83ca[_0xa4de('0x33')]=_[_0xa4de('0x34')](_0x3c83ca[_0xa4de('0x31')],_0x3c83ca[_0xa4de('0x36')]);_0x10fc66[_0xa4de('0x35')]=_[_0xa4de('0x34')](_0x3c83ca['model'],qs[_0xa4de('0x37')](_0x4b5770[_0xa4de('0x36')]['fields']));_0x10fc66[_0xa4de('0x35')]=_0x10fc66['attributes'][_0xa4de('0x47')]?_0x10fc66[_0xa4de('0x35')]:_0x3c83ca[_0xa4de('0x31')];if(_0x4b5770[_0xa4de('0x36')][_0xa4de('0x40')]){_0x10fc66['include']=[{'all':!![]}];}_0x10fc66=_[_0xa4de('0x3e')]({},_0x10fc66,_0x4b5770[_0xa4de('0x3f')]);return db[_0xa4de('0x2f')][_0xa4de('0x48')](_0x10fc66)['then'](handleEntityNotFound(_0x3070f2,null))[_0xa4de('0x26')](respondWithResult(_0x3070f2,null))[_0xa4de('0x43')](handleError(_0x3070f2,null));};exports['create']=function(_0x1afd3f,_0x5a2032){return db['CmCompany'][_0xa4de('0x49')](_0x1afd3f[_0xa4de('0x4a')],{})['then'](function(_0x36bf7b){var _0x2442de=_0x1afd3f['user'][_0xa4de('0x28')]({'plain':!![]});if(!_0x2442de)throw new Error(_0xa4de('0x4b'));if(_0x2442de[_0xa4de('0x4c')]===_0xa4de('0x4d')){var _0x4f3ac4=_0x36bf7b[_0xa4de('0x28')]({'plain':!![]});var _0x48981d=_0xa4de('0x29');return db['UserProfileSection'][_0xa4de('0x48')]({'where':{'name':_0x48981d,'userProfileId':_0x2442de['userProfileId']},'raw':!![]})['then'](function(_0x125fee){if(_0x125fee&&_0x125fee[_0xa4de('0x4e')]===0x0){return db[_0xa4de('0x2a')]['create']({'name':_0x4f3ac4[_0xa4de('0x2d')],'resourceId':_0x4f3ac4['id'],'type':_0x125fee[_0xa4de('0x2d')],'sectionId':_0x125fee['id']},{})['then'](function(){return _0x36bf7b;});}else{return _0x36bf7b;}})[_0xa4de('0x43')](function(_0x3b0cda){logger[_0xa4de('0x2b')](_0xa4de('0x4f'),_0x3b0cda);throw _0x3b0cda;});}return _0x36bf7b;})[_0xa4de('0x26')](respondWithResult(_0x5a2032,0xc9))['catch'](handleError(_0x5a2032,null));};exports[_0xa4de('0x25')]=function(_0x3eebd3,_0x51a44e){if(_0x3eebd3[_0xa4de('0x4a')]['id']){delete _0x3eebd3['body']['id'];}return db['CmCompany'][_0xa4de('0x48')]({'where':{'id':_0x3eebd3[_0xa4de('0x45')]['id']}})['then'](handleEntityNotFound(_0x51a44e,null))['then'](saveUpdates(_0x3eebd3['body'],null))[_0xa4de('0x26')](respondWithResult(_0x51a44e,null))[_0xa4de('0x43')](handleError(_0x51a44e,null));};exports['destroy']=function(_0x3c39f9,_0x3ccc6d){return db[_0xa4de('0x2f')][_0xa4de('0x48')]({'where':{'id':_0x3c39f9['params']['id']}})[_0xa4de('0x26')](handleEntityNotFound(_0x3ccc6d,null))[_0xa4de('0x26')](removeEntity(_0x3ccc6d,null))['catch'](handleError(_0x3ccc6d,null));};exports[_0xa4de('0x30')]=function(_0x4e597f,_0x345a4c){return db[_0xa4de('0x2f')]['describe']()[_0xa4de('0x26')](respondWithResult(_0x345a4c,null))['catch'](handleError(_0x345a4c,null));};exports['addContacts']=function(_0x51ca90,_0x444d6c,_0x3dd418){return db[_0xa4de('0x50')]['find']({'where':{'id':_0x51ca90['params']['id']}})[_0xa4de('0x26')](handleEntityNotFound(_0x444d6c,null))[_0xa4de('0x26')](function(_0x494c60){if(_0x494c60){return _0x494c60[_0xa4de('0x51')](_0x51ca90[_0xa4de('0x4a')][_0xa4de('0x52')],_[_0xa4de('0x53')](_0x51ca90[_0xa4de('0x4a')],['ids','id'])||{});}})[_0xa4de('0x26')](respondWithResult(_0x444d6c,null))[_0xa4de('0x43')](handleError(_0x444d6c,null));};exports[_0xa4de('0x54')]=function(_0x5d104b,_0x140929,_0x197747){var _0x40a843={};var _0x594edf={};var _0x15d59d;var _0x4a06d4;return db[_0xa4de('0x2f')]['findOne']({'where':{'id':_0x5d104b[_0xa4de('0x45')]['id']}})['then'](handleEntityNotFound(_0x140929,null))[_0xa4de('0x26')](function(_0x44035b){if(_0x44035b){_0x15d59d=_0x44035b;_0x594edf[_0xa4de('0x31')]=_[_0xa4de('0x32')](db[_0xa4de('0x50')][_0xa4de('0x46')]);_0x594edf['query']=_[_0xa4de('0x32')](_0x5d104b[_0xa4de('0x36')]);_0x594edf[_0xa4de('0x33')]=_[_0xa4de('0x34')](_0x594edf['model'],_0x594edf[_0xa4de('0x36')]);_0x40a843[_0xa4de('0x35')]=_[_0xa4de('0x34')](_0x594edf[_0xa4de('0x31')],qs[_0xa4de('0x37')](_0x5d104b[_0xa4de('0x36')][_0xa4de('0x37')]));_0x40a843[_0xa4de('0x35')]=_0x40a843['attributes'][_0xa4de('0x47')]?_0x40a843[_0xa4de('0x35')]:_0x594edf['model'];_0x40a843[_0xa4de('0x39')]=qs[_0xa4de('0x55')](_0x5d104b[_0xa4de('0x36')][_0xa4de('0x55')]);_0x40a843[_0xa4de('0x3c')]=qs[_0xa4de('0x33')](_[_0xa4de('0x3a')](_0x5d104b[_0xa4de('0x36')],_0x594edf[_0xa4de('0x33')]));if(_0x5d104b['query'][_0xa4de('0x3b')]){_0x40a843[_0xa4de('0x3c')]=_[_0xa4de('0x3e')](_0x40a843['where'],{'$or':_[_0xa4de('0x3d')](_0x40a843[_0xa4de('0x35')],function(_0x3f1a39){var _0x229bec={};_0x229bec[_0x3f1a39]={'$like':'%'+_0x5d104b[_0xa4de('0x36')][_0xa4de('0x3b')]+'%'};return _0x229bec;})});}_0x40a843=_[_0xa4de('0x3e')]({},_0x40a843,_0x5d104b[_0xa4de('0x3f')]);return _0x15d59d[_0xa4de('0x54')](_0x40a843);}})[_0xa4de('0x26')](function(_0x431471){if(_0x431471){_0x4a06d4=_0x431471[_0xa4de('0x47')];if(!_0x5d104b['query'][_0xa4de('0x56')]('nolimit')){_0x40a843[_0xa4de('0x1c')]=qs[_0xa4de('0x1c')](_0x5d104b['query'][_0xa4de('0x1c')]);_0x40a843[_0xa4de('0x1b')]=qs[_0xa4de('0x1b')](_0x5d104b[_0xa4de('0x36')][_0xa4de('0x1b')]);}return _0x15d59d[_0xa4de('0x54')](_0x40a843);}})[_0xa4de('0x26')](function(_0x190cea){if(_0x190cea){return _0x190cea?{'count':_0x4a06d4,'rows':_0x190cea}:null;}})[_0xa4de('0x26')](respondWithResult(_0x140929,null))[_0xa4de('0x43')](handleError(_0x140929,null));};
\ No newline at end of file
index 95e386d..eef0f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed74=['CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x38b58f,_0x4b198b){var _0x2fd2db=function(_0x52638e){while(--_0x52638e){_0x38b58f['push'](_0x38b58f['shift']());}};_0x2fd2db(++_0x4b198b);}(_0xed74,0x10a));var _0x4ed7=function(_0x536bc2,_0x35c4bf){_0x536bc2=_0x536bc2-0x0;var _0x551b56=_0xed74[_0x536bc2];return _0x551b56;};'use strict';var _=require(_0x4ed7('0x0'));var util=require(_0x4ed7('0x1'));var logger=require(_0x4ed7('0x2'))(_0x4ed7('0x3'));var moment=require('moment');var BPromise=require(_0x4ed7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ed7('0x5'));var rimraf=require(_0x4ed7('0x6'));var config=require(_0x4ed7('0x7'));var attributes=require('./cmCompany.attributes');module[_0x4ed7('0x8')]=function(_0xaa1ea9,_0x5d5090){return _0xaa1ea9['define'](_0x4ed7('0x9'),attributes,{'tableName':_0x4ed7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf75d=['exports','define','CmCompany','api','moment','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x4604fb,_0x16b1ae){var _0x45b5f1=function(_0x490d8e){while(--_0x490d8e){_0x4604fb['push'](_0x4604fb['shift']());}};_0x45b5f1(++_0x16b1ae);}(_0xf75d,0x1e9));var _0xdf75=function(_0xa92146,_0x57b211){_0xa92146=_0xa92146-0x0;var _0x4687b9=_0xf75d[_0xa92146];return _0x4687b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdf75('0x0'));var moment=require(_0xdf75('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf75('0x2'));var rimraf=require(_0xdf75('0x3'));var config=require(_0xdf75('0x4'));var attributes=require(_0xdf75('0x5'));module[_0xdf75('0x6')]=function(_0x24cbd1,_0x504a42){return _0x24cbd1[_0xdf75('0x7')](_0xdf75('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ccf5e7f..8657b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa996=['client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0xa996,0x81));var _0x6a99=function(_0x4a15a1,_0x54f95e){_0x4a15a1=_0x4a15a1-0x0;var _0x1f572b=_0xa996[_0x4a15a1];return _0x1f572b;};'use strict';var _=require(_0x6a99('0x0'));var util=require('util');var moment=require(_0x6a99('0x1'));var BPromise=require(_0x6a99('0x2'));var rs=require(_0x6a99('0x3'));var fs=require('fs');var Redis=require(_0x6a99('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a99('0x5'));var logger=require('../../config/logger')(_0x6a99('0x6'));var config=require(_0x6a99('0x7'));var jayson=require(_0x6a99('0x8'));var client=jayson[_0x6a99('0x9')][_0x6a99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197909,_0x5b4f89,_0x87465d){return new BPromise(function(_0x2d431f,_0xeb8bdc){return client[_0x6a99('0xb')](_0x197909,_0x87465d)[_0x6a99('0xc')](function(_0x5d9afe){logger['info'](_0x6a99('0xd'),_0x5b4f89,_0x6a99('0xe'));logger[_0x6a99('0xf')](_0x6a99('0x10'),_0x5b4f89,_0x6a99('0xe'),JSON[_0x6a99('0x11')](_0x5d9afe));if(_0x5d9afe[_0x6a99('0x12')]){if(_0x5d9afe['error']['code']===0x1f4){logger[_0x6a99('0x12')](_0x6a99('0xd'),_0x5b4f89,_0x5d9afe[_0x6a99('0x12')]['message']);return _0xeb8bdc(_0x5d9afe[_0x6a99('0x12')][_0x6a99('0x13')]);}logger[_0x6a99('0x12')](_0x6a99('0xd'),_0x5b4f89,_0x5d9afe[_0x6a99('0x12')][_0x6a99('0x13')]);return _0x2d431f(_0x5d9afe[_0x6a99('0x12')][_0x6a99('0x13')]);}else{logger[_0x6a99('0x14')]('CmCompany,\x20%s,\x20%s',_0x5b4f89,_0x6a99('0xe'));_0x2d431f(_0x5d9afe[_0x6a99('0x15')][_0x6a99('0x13')]);}})[_0x6a99('0x16')](function(_0x400df7){logger['error']('CmCompany,\x20%s,\x20%s',_0x5b4f89,_0x400df7);_0xeb8bdc(_0x400df7);});});}
\ No newline at end of file
+var _0x29fc=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x4b5075,_0xee1fb9){var _0x234617=function(_0x39aef7){while(--_0x39aef7){_0x4b5075['push'](_0x4b5075['shift']());}};_0x234617(++_0xee1fb9);}(_0x29fc,0x8d));var _0xc29f=function(_0x316628,_0x31e805){_0x316628=_0x316628-0x0;var _0x4bdf91=_0x29fc[_0x316628];return _0x4bdf91;};'use strict';var _=require(_0xc29f('0x0'));var util=require(_0xc29f('0x1'));var moment=require(_0xc29f('0x2'));var BPromise=require(_0xc29f('0x3'));var rs=require(_0xc29f('0x4'));var fs=require('fs');var Redis=require(_0xc29f('0x5'));var db=require(_0xc29f('0x6'))['db'];var utils=require(_0xc29f('0x7'));var logger=require(_0xc29f('0x8'))(_0xc29f('0x9'));var config=require(_0xc29f('0xa'));var jayson=require(_0xc29f('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41cae7,_0x4d0ca9,_0x19bff2){return new BPromise(function(_0x221780,_0x1d02e7){return client['request'](_0x41cae7,_0x19bff2)[_0xc29f('0xc')](function(_0x2b3ce9){logger[_0xc29f('0xd')](_0xc29f('0xe'),_0x4d0ca9,_0xc29f('0xf'));logger[_0xc29f('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4d0ca9,'request\x20sent',JSON[_0xc29f('0x11')](_0x2b3ce9));if(_0x2b3ce9[_0xc29f('0x12')]){if(_0x2b3ce9['error'][_0xc29f('0x13')]===0x1f4){logger[_0xc29f('0x12')](_0xc29f('0xe'),_0x4d0ca9,_0x2b3ce9[_0xc29f('0x12')][_0xc29f('0x14')]);return _0x1d02e7(_0x2b3ce9[_0xc29f('0x12')][_0xc29f('0x14')]);}logger[_0xc29f('0x12')](_0xc29f('0xe'),_0x4d0ca9,_0x2b3ce9['error'][_0xc29f('0x14')]);return _0x221780(_0x2b3ce9['error']['message']);}else{logger[_0xc29f('0xd')](_0xc29f('0xe'),_0x4d0ca9,'request\x20sent');_0x221780(_0x2b3ce9[_0xc29f('0x15')][_0xc29f('0x14')]);}})['catch'](function(_0x39891f){logger[_0xc29f('0x12')](_0xc29f('0xe'),_0x4d0ca9,_0x39891f);_0x1d02e7(_0x39891f);});});}
\ No newline at end of file
index cf5c8d8..c6c9a7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0cf=['show','/:id/contacts','getContacts','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x1187f0,_0x4f957a){var _0x1c4efc=function(_0x641acb){while(--_0x641acb){_0x1187f0['push'](_0x1187f0['shift']());}};_0x1c4efc(++_0x4f957a);}(_0xa0cf,0x1e9));var _0xfa0c=function(_0x2f2cb6,_0x5f5576){_0x2f2cb6=_0x2f2cb6-0x0;var _0x33c4a7=_0xa0cf[_0x2f2cb6];return _0x33c4a7;};'use strict';var multer=require(_0xfa0c('0x0'));var util=require(_0xfa0c('0x1'));var path=require(_0xfa0c('0x2'));var timeout=require(_0xfa0c('0x3'));var express=require('express');var router=express[_0xfa0c('0x4')]();var fs_extra=require(_0xfa0c('0x5'));var auth=require(_0xfa0c('0x6'));var interaction=require(_0xfa0c('0x7'));var config=require(_0xfa0c('0x8'));var controller=require(_0xfa0c('0x9'));router[_0xfa0c('0xa')]('/',auth[_0xfa0c('0xb')](),controller[_0xfa0c('0xc')]);router[_0xfa0c('0xa')]('/describe',auth[_0xfa0c('0xb')](),controller[_0xfa0c('0xd')]);router[_0xfa0c('0xa')](_0xfa0c('0xe'),auth[_0xfa0c('0xb')](),controller[_0xfa0c('0xf')]);router[_0xfa0c('0xa')](_0xfa0c('0x10'),auth[_0xfa0c('0xb')](),controller[_0xfa0c('0x11')]);router[_0xfa0c('0x12')]('/',auth[_0xfa0c('0xb')](),controller[_0xfa0c('0x13')]);router['post'](_0xfa0c('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0xfa0c('0x14')](_0xfa0c('0xe'),auth[_0xfa0c('0xb')](),controller[_0xfa0c('0x15')]);router[_0xfa0c('0x16')](_0xfa0c('0xe'),auth[_0xfa0c('0xb')](),controller['destroy']);module[_0xfa0c('0x17')]=router;
\ No newline at end of file
+var _0x53a8=['isAuthenticated','index','/:id','/:id/contacts','getContacts','post','create','addContacts','put','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x4d4e7c,_0x1a8689){var _0x408125=function(_0x4db103){while(--_0x4db103){_0x4d4e7c['push'](_0x4d4e7c['shift']());}};_0x408125(++_0x1a8689);}(_0x53a8,0x11c));var _0x853a=function(_0x38c5d7,_0x45ab69){_0x38c5d7=_0x38c5d7-0x0;var _0x23750e=_0x53a8[_0x38c5d7];return _0x23750e;};'use strict';var multer=require(_0x853a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x853a('0x1'));var express=require(_0x853a('0x2'));var router=express[_0x853a('0x3')]();var fs_extra=require(_0x853a('0x4'));var auth=require(_0x853a('0x5'));var interaction=require(_0x853a('0x6'));var config=require(_0x853a('0x7'));var controller=require(_0x853a('0x8'));router[_0x853a('0x9')]('/',auth[_0x853a('0xa')](),controller[_0x853a('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x853a('0x9')](_0x853a('0xc'),auth[_0x853a('0xa')](),controller['show']);router['get'](_0x853a('0xd'),auth[_0x853a('0xa')](),controller[_0x853a('0xe')]);router[_0x853a('0xf')]('/',auth[_0x853a('0xa')](),controller[_0x853a('0x10')]);router[_0x853a('0xf')](_0x853a('0xd'),auth['isAuthenticated'](),controller[_0x853a('0x11')]);router[_0x853a('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x853a('0xa')](),controller[_0x853a('0x13')]);module[_0x853a('0x14')]=router;
\ No newline at end of file
index 5416bbe..e607916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcef=['UNSIGNED','DATE','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x3c3e09,_0x29c9bb){var _0x32d340=function(_0x51f33a){while(--_0x51f33a){_0x3c3e09['push'](_0x3c3e09['shift']());}};_0x32d340(++_0x29c9bb);}(_0xdcef,0x1c3));var _0xfdce=function(_0xde530,_0x3a30b8){_0xde530=_0xde530-0x0;var _0x2b69ce=_0xdcef[_0xde530];return _0x2b69ce;};'use strict';var _=require(_0xfdce('0x0'));var Sequelize=require('sequelize');module[_0xfdce('0x1')]={'firstName':{'type':Sequelize[_0xfdce('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xfdce('0x2')]},'street':{'type':Sequelize[_0xfdce('0x2')]},'postalCode':{'type':Sequelize[_0xfdce('0x2')]},'city':{'type':Sequelize[_0xfdce('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfdce('0x3')]},'phone':{'type':Sequelize[_0xfdce('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfdce('0x2')]},'email':{'type':Sequelize[_0xfdce('0x2')]},'url':{'type':Sequelize[_0xfdce('0x2')]},'facebook':{'type':Sequelize[_0xfdce('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xfdce('0x2')]},'skype':{'type':Sequelize[_0xfdce('0x2')]},'teams':{'type':Sequelize[_0xfdce('0x2')]},'viber':{'type':Sequelize[_0xfdce('0x2')]},'line':{'type':Sequelize[_0xfdce('0x2')]},'wechat':{'type':Sequelize[_0xfdce('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xfdce('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xfdce('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xfdce('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfdce('0x6')],'defaultValue':Sequelize[_0xfdce('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xfdce('0x4')]}};
\ No newline at end of file
+var _0x5a06=['STRING','TEXT','INTEGER','lodash','exports'];(function(_0x11da31,_0x5d576f){var _0x6bb4c8=function(_0x1680a3){while(--_0x1680a3){_0x11da31['push'](_0x11da31['shift']());}};_0x6bb4c8(++_0x5d576f);}(_0x5a06,0x1c5));var _0x65a0=function(_0x26a62b,_0x4ce537){_0x26a62b=_0x26a62b-0x0;var _0x213992=_0x5a06[_0x26a62b];return _0x213992;};'use strict';var _=require(_0x65a0('0x0'));var Sequelize=require('sequelize');module[_0x65a0('0x1')]={'firstName':{'type':Sequelize[_0x65a0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x65a0('0x2')]},'city':{'type':Sequelize[_0x65a0('0x2')]},'country':{'type':Sequelize[_0x65a0('0x2')]},'dateOfBirth':{'type':Sequelize[_0x65a0('0x2')]},'description':{'type':Sequelize[_0x65a0('0x3')]},'phone':{'type':Sequelize[_0x65a0('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x65a0('0x2')]},'fb_data':{'type':Sequelize[_0x65a0('0x2')]},'twitter':{'type':Sequelize[_0x65a0('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x65a0('0x2')]},'viber':{'type':Sequelize[_0x65a0('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65a0('0x2')]},'telegram':{'type':Sequelize[_0x65a0('0x2')]},'UserId':{'type':Sequelize[_0x65a0('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x65a0('0x2')]},'priority':{'type':Sequelize[_0x65a0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x65a0('0x2')]},'utcOffset':{'type':Sequelize[_0x65a0('0x4')]}};
\ No newline at end of file
index 828ebf6..9f166d5 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(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 _0x710e=['sequelize','literal','$and','map','omit','pickBy','format','cf_%d','isEmpty','table','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','filters','intersection','attributes','fields','order','sort','filter','options','nolimit','setTags','ids','setAdditionalPhones','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','rawAttributes','pick','ContactId','include','rows','getHopperHistories','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','meta','User','agent','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','child_process','../../components/import/cm/csvUpdates','exit','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','Website','Account','closedAt','secondDisposition','thirdDisposition','key','Tags','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','threadId','startCase','Owner','sortBy','reverse','value','slice','moment','bluebird','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','set','Content-Range','then','status','end','sendStatus','error','name','send','describe','getOptions','findAll','query','user','destroy','CmContact','find','params','catch','tags','length','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','alias','custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','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','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','spread','contact','all','show','Tag','color','tag','ContactItemType'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x710e,0x93));var _0xe710=function(_0x562315,_0x48ace2){_0x562315=_0x562315-0x0;var _0x48ed27=_0x710e[_0x562315];return _0x48ed27;};'use strict';var moment=require(_0xe710('0x0'));var BPromise=require(_0xe710('0x1'));var util=require('util');var path=require(_0xe710('0x2'));var fs=require('fs');var _=require(_0xe710('0x3'));var squel=require(_0xe710('0x4'));var Papa=require('papaparse');var Redis=require(_0xe710('0x5'));var contacts=require(_0xe710('0x6'));var qs=require(_0xe710('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xe710('0x8'));var shared=require(_0xe710('0x9'));var db=require(_0xe710('0xa'))['db'];config[_0xe710('0xb')]=_[_0xe710('0xc')](config[_0xe710('0xb')],{'host':_0xe710('0xd'),'port':0x18eb});var socket=require(_0xe710('0xe'))(new Redis(config[_0xe710('0xb')]));require(_0xe710('0xf'))[_0xe710('0x10')](socket);function respondWithResult(_0x3c807d,_0x51c0bd){_0x51c0bd=_0x51c0bd||0xc8;return function(_0x28d19d){if(_0x28d19d){return _0x3c807d['status'](_0x51c0bd)[_0xe710('0x11')](_0x28d19d);}};}function respondWithFilteredResult(_0x22de24,_0x1ea3ef){return function(_0x328d3b){if(_0x328d3b){var _0xb8a1a3=typeof _0x1ea3ef[_0xe710('0x12')]===_0xe710('0x13')&&typeof _0x1ea3ef[_0xe710('0x14')]===_0xe710('0x13');var _0x2dca1c=_0x328d3b[_0xe710('0x15')];var _0x238130=_0xb8a1a3?0x0:_0x1ea3ef['offset'];var _0x330b5e=_0xb8a1a3?_0x328d3b[_0xe710('0x15')]:_0x1ea3ef[_0xe710('0x12')]+_0x1ea3ef[_0xe710('0x14')];var _0x349169;if(_0x330b5e>=_0x2dca1c){_0x330b5e=_0x2dca1c;_0x349169=0xc8;}else{_0x349169=0xce;}_0x22de24['status'](_0x349169);return _0x22de24[_0xe710('0x16')](_0xe710('0x17'),_0x238130+'-'+_0x330b5e+'/'+_0x2dca1c)[_0xe710('0x11')](_0x328d3b);}return null;};}function saveUpdates(_0x844aa0){return function(_0x1ff0be){if(_0x1ff0be){return _0x1ff0be['update'](_0x844aa0)[_0xe710('0x18')](function(_0x7444c4){return _0x7444c4;});}return null;};}function removeEntity(_0x40af5b){return function(_0x18df73){if(_0x18df73){return _0x18df73['destroy']()[_0xe710('0x18')](function(){_0x40af5b[_0xe710('0x19')](0xcc)[_0xe710('0x1a')]();});}};}function handleEntityNotFound(_0x5413c2){return function(_0x59d413){if(!_0x59d413){_0x5413c2[_0xe710('0x1b')](0x194);}return _0x59d413;};}function handleError(_0x2941b6,_0x3a1cfc){_0x3a1cfc=_0x3a1cfc||0x1f4;return function(_0x17cb16){logger[_0xe710('0x1c')](_0x17cb16['stack']);if(_0x17cb16[_0xe710('0x1d')]){delete _0x17cb16[_0xe710('0x1d')];}_0x2941b6[_0xe710('0x19')](_0x3a1cfc)[_0xe710('0x1e')](_0x17cb16);};}exports['index']=function(_0x965304,_0x280668){var _0x32d35e={};return contacts[_0xe710('0x1f')]()[_0xe710('0x18')](function(_0x4bf8e5){_0x32d35e=qs[_0xe710('0x20')](_0x4bf8e5,_0x965304);return contacts[_0xe710('0x21')](_0x965304[_0xe710('0x22')],_0x965304[_0xe710('0x23')],_0x32d35e,_0x4bf8e5);})['then'](respondWithFilteredResult(_0x280668,_0x32d35e))['catch'](handleError(_0x280668,null));};exports[_0xe710('0x24')]=function(_0x4b75a4,_0x310ea5){return db[_0xe710('0x25')][_0xe710('0x26')]({'where':{'id':_0x4b75a4[_0xe710('0x27')]['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x310ea5,null))['then'](removeEntity(_0x310ea5,null))[_0xe710('0x28')](handleError(_0x310ea5,null));};exports[_0xe710('0x1f')]=function(_0x276ba1,_0x275611){return db[_0xe710('0x25')][_0xe710('0x1f')]()[_0xe710('0x18')](function(_0x3d66d5){delete _0x3d66d5[_0xe710('0x29')];for(var _0x461b87=0x0;_0x461b87<Object['keys'](_0x3d66d5)[_0xe710('0x2a')];_0x461b87++){var _0x5cff39=Object[_0xe710('0x2b')](_0x3d66d5)[_0x461b87];if(!_[_0xe710('0x2c')](_0x5cff39,_0xe710('0x2d'))){_0x3d66d5[_0x5cff39][_0xe710('0x2e')]=_0x5cff39;_0x3d66d5[_0x5cff39][_0xe710('0x2f')]=_0x5cff39;}}return _0x3d66d5;})[_0xe710('0x18')](function(_0x52c1a8){var _0x502b2a={'where':Boolean(_0x276ba1['query'][_0xe710('0x30')])===!![]?undefined:{'$or':[{'ListId':_0x276ba1[_0xe710('0x22')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xe710('0x31')][_0xe710('0x21')](_0x502b2a)[_0xe710('0x18')](function(_0x3e830c){for(var _0x4ba9f3=0x0;_0x4ba9f3<_0x3e830c[_0xe710('0x2a')];_0x4ba9f3++){var _0x3bf4c8=_0xe710('0x2d')+_0x3e830c[_0x4ba9f3]['id'];if(_0x52c1a8[_0x3bf4c8]){_0x52c1a8[_0x3bf4c8][_0xe710('0x2e')]=_0x3bf4c8;_0x52c1a8[_0x3bf4c8][_0xe710('0x2f')]=_0x3e830c[_0x4ba9f3][_0xe710('0x32')];_0x52c1a8[_0x3bf4c8][_0xe710('0x33')]={'type':_0x3e830c[_0x4ba9f3][_0xe710('0x34')],'values':_0x3e830c[_0x4ba9f3][_0xe710('0x35')]};}else{logger['info'](_0xe710('0x36'),_0x3bf4c8);}}Object[_0xe710('0x2b')](_0x52c1a8)[_0xe710('0x37')](function(_0x4d857a){if(!_0x52c1a8[_0x4d857a][_0xe710('0x38')](_0xe710('0x2e'))){delete _0x52c1a8[_0x4d857a];}});return _0x52c1a8;});})[_0xe710('0x18')](respondWithResult(_0x275611,null))[_0xe710('0x28')](handleError(_0x275611,null));};exports[_0xe710('0x39')]=function(_0xf3c459,_0x50fa09){var _0x3b32c2;var _0x52a367;var _0x4abc3c;if(_0xf3c459[_0xe710('0x3a')]['id']){delete _0xf3c459[_0xe710('0x3a')]['id'];}return db[_0xe710('0x25')][_0xe710('0x21')]({'where':{'id':[_0xf3c459[_0xe710('0x3a')]['to'],_0xf3c459[_0xe710('0x3a')][_0xe710('0x3b')]]}})['then'](function(_0xe0b75c){if(_0xe0b75c){if(_0xe0b75c['length']!==0x2){return null;}_0xe0b75c[0x0]=_0xe0b75c[0x0][_0xe710('0x3c')]({'plain':!![]});_0xe0b75c[0x1]=_0xe0b75c[0x1][_0xe710('0x3c')]({'plain':!![]});delete _0xe0b75c[0x0]['id'];delete _0xe0b75c[0x1]['id'];return _[_0xe710('0x3d')](_0xe0b75c[0x0],_0xe0b75c[0x1],function(_0x3f30e1,_0x51241c){if(Array[_0xe710('0x3e')](_0x51241c)&&!_0x51241c[_0xe710('0x2a')]){return _0x3f30e1;}else if(!_0x51241c){return _0x3f30e1;}});}})[_0xe710('0x18')](handleEntityNotFound(_0x50fa09,null))[_0xe710('0x18')](function(_0x2cdd98){if(_0x2cdd98){if(_0x2cdd98['tags']&&_['isArray'](_0x2cdd98['tags'])){_0x2cdd98[_0xe710('0x29')]=_0x2cdd98[_0xe710('0x29')][_0xe710('0x3f')]();}logger[_0xe710('0x40')](_0xe710('0x41'),_0xf3c459[_0xe710('0x3a')]['to'],_0xf3c459['body'][_0xe710('0x3b')]);return db[_0xe710('0x42')]['destroy']({'where':{'ContactId':[_0xf3c459[_0xe710('0x3a')]['to'],_0xf3c459[_0xe710('0x3a')][_0xe710('0x3b')]]}})[_0xe710('0x18')](function(_0x50013a){logger[_0xe710('0x40')](_0xe710('0x43'),_0x50013a);return db[_0xe710('0x44')][_0xe710('0x24')]({'where':{'ContactId':[_0xf3c459[_0xe710('0x3a')]['to'],_0xf3c459[_0xe710('0x3a')]['from']]}})['then'](function(_0x11311f){logger[_0xe710('0x40')](_0xe710('0x45'),_0x11311f);return db[_0xe710('0x25')][_0xe710('0x46')](_0x2cdd98);});});}})[_0xe710('0x18')](function(_0x32a59e){if(_0x32a59e){_0x3b32c2=_0x32a59e;_0x52a367={'ContactId':_0x3b32c2['id']};_0x4abc3c={'where':{'ContactId':[_0xf3c459[_0xe710('0x3a')]['to'],_0xf3c459[_0xe710('0x3a')]['from']]}};return db[_0xe710('0x47')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x49')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db[_0xe710('0x4a')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x4b')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x4c')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x4b')]['update'](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x4c')]['update'](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db[_0xe710('0x4d')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db['SmsMessage']['update'](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x4e')]['update'](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x4f')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x50')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x51')]['update'](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db['CmContactHasItem'][_0xe710('0x48')]({'CmContactId':_0x3b32c2['id']},{'where':{'CmContactId':[_0xf3c459['body']['to'],_0xf3c459['body'][_0xe710('0x3b')]]}});}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x52')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db[_0xe710('0x53')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x54')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x55')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x56')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db['FaxQueueReport'][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db['MailQueueReport'][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x57')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db[_0xe710('0x58')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x59')]['update'](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x5a')]['update'](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db[_0xe710('0x5b')]['update'](_0x52a367,_0x4abc3c);}})[_0xe710('0x18')](function(){if(_0x3b32c2){return db[_0xe710('0x5c')][_0xe710('0x48')](_0x52a367,_0x4abc3c);}})['then'](function(){if(_0x3b32c2){return db[_0xe710('0x25')]['destroy']({'where':{'id':[_0xf3c459[_0xe710('0x3a')]['to'],_0xf3c459[_0xe710('0x3a')][_0xe710('0x3b')]]}});}})[_0xe710('0x18')](function(){if(_0x3b32c2){return _0x3b32c2;}})[_0xe710('0x18')](respondWithResult(_0x50fa09,null))[_0xe710('0x28')](handleError(_0x50fa09,null));};exports[_0xe710('0x46')]=function(_0x25e8e1,_0x2370eb){return db[_0xe710('0x25')][_0xe710('0x1f')]()['then'](function(_0xd6238d){if(_0x25e8e1[_0xe710('0x3a')][_0xe710('0x29')]&&_[_0xe710('0x3e')](_0x25e8e1[_0xe710('0x3a')][_0xe710('0x29')])){if(_0x25e8e1[_0xe710('0x3a')][_0xe710('0x29')][_0xe710('0x2a')]){_0x25e8e1[_0xe710('0x3a')]['tags']=_0x25e8e1[_0xe710('0x3a')]['tags'][_0xe710('0x3f')](';')+';';}else{_0x25e8e1[_0xe710('0x3a')][_0xe710('0x29')]=null;}}else{_0x25e8e1[_0xe710('0x3a')][_0xe710('0x29')]=null;}if(!_[_0xe710('0x5d')](_0x25e8e1['body'][_0xe710('0x5e')])){var _0x595a6d=_0x25e8e1[_0xe710('0x3a')]['dialTimezone'];if(!_['isNil'](shared['timezones'][_0x595a6d]))_0x25e8e1[_0xe710('0x3a')][_0xe710('0x5f')]=shared[_0xe710('0x60')][_0x595a6d][_0xe710('0x5f')];}return db['CmContact'][_0xe710('0x46')](_0x25e8e1[_0xe710('0x3a')],{'fields':_['keys'](_0xd6238d),'raw':!![]});})[_0xe710('0x18')](function(_0x2896bd){if(_0x25e8e1[_0xe710('0x3a')][_0xe710('0x61')]){return insertAdditionalPhones(_0x2896bd,_0x25e8e1[_0xe710('0x3a')][_0xe710('0x61')]);}else{return _0x2896bd;}})[_0xe710('0x18')](respondWithResult(_0x2370eb,0xc9))[_0xe710('0x28')](handleError(_0x2370eb,null));};exports[_0xe710('0x62')]=function(_0x2d6287,_0x1c72db){var _0xebb4ac=0x0;var _0x13297b=0x0;var _0x240985=0x0;var _0x15540d=[];return db['CmContact'][_0xe710('0x1f')]()[_0xe710('0x18')](function(_0x23802f){return BPromise[_0xe710('0x63')](_0x2d6287['body'],function(_0x57f39f){var _0x164a70={'where':{'$or':[]},'defaults':_0x57f39f,'fields':_[_0xe710('0x2b')](_0x23802f),'raw':!![]};if(_0x57f39f['duplicates']){for(var _0x37d8d7=0x0;_0x37d8d7<_0x57f39f['duplicates'][_0xe710('0x2a')];_0x37d8d7++){var _0x2cf12b={};_0x2cf12b[_0x57f39f[_0xe710('0x64')][_0x37d8d7]]=_0x57f39f[_0x57f39f[_0xe710('0x64')][_0x37d8d7]];_0x164a70[_0xe710('0x65')][_0xe710('0x66')][_0xe710('0x67')](_0x2cf12b);}_0x164a70['where'][_0xe710('0x68')]=_0x57f39f[_0xe710('0x68')];}return db[_0xe710('0x25')]['findOrCreate'](_0x164a70)[_0xe710('0x69')](function(_0x47d8e5,_0x5c1c54){if(_0x5c1c54){if(_0x57f39f[_0xe710('0x38')](_0xe710('0x61'))){_0x15540d['push']({'contact':_0x47d8e5,'additionalPhones':_0x57f39f[_0xe710('0x61')]});}_0xebb4ac++;}else{_0x240985++;}})['catch'](function(){_0x13297b++;});});})[_0xe710('0x18')](function(_0x107f4f){if(_0x107f4f){if(_0x15540d[_0xe710('0x2a')]>0x0){return new Promise(function(_0x7faa5b){var _0xa6e85d=[];for(var _0x590fde=0x0;_0x590fde<_0x15540d[_0xe710('0x2a')];_0x590fde++){_0xa6e85d[_0xe710('0x67')](insertAdditionalPhones(_0x15540d[_0x590fde][_0xe710('0x6a')],_0x15540d[_0x590fde]['additionalPhones']));}Promise[_0xe710('0x6b')](_0xa6e85d)['then'](function(){_0x7faa5b(0x1);});})[_0xe710('0x18')](function(){return{'success':_0xebb4ac,'failure':_0x13297b,'duplicates':_0x240985};});}else{return{'success':_0xebb4ac,'failure':_0x13297b,'duplicates':_0x240985};}}})[_0xe710('0x18')](respondWithResult(_0x1c72db,0xc9))[_0xe710('0x28')](handleError(_0x1c72db,null));};exports[_0xe710('0x6c')]=function(_0x7ff5f9,_0x59b000){var _0x3e3299;return db[_0xe710('0x25')]['describe']()[_0xe710('0x18')](function(_0x1c1325){return db[_0xe710('0x25')]['find']({'where':{'id':_0x7ff5f9[_0xe710('0x27')]['id']},'include':[{'model':db[_0xe710('0x6d')],'as':'Tags','attributes':['id',_0xe710('0x1d'),_0xe710('0x6e')],'required':_0x7ff5f9[_0xe710('0x22')][_0xe710('0x6f')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x7ff5f9[_0xe710('0x27')]['id']},'required':![],'include':[{'model':db[_0xe710('0x70')],'as':'ItemType'}]}],'order':[db[_0xe710('0x71')][_0xe710('0x72')]('Phones.OrderBy')],'attributes':_[_0xe710('0x2b')](_0x1c1325)});})['then'](function(_0x85fdde){if(!_['isNil'](_0x85fdde)){_0x3e3299=_0x85fdde[_0xe710('0x3c')]({'plain':!![]});var _0x47ee8f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x85fdde&&_0x85fdde[_0xe710('0x68')]){if(_0x85fdde[_0xe710('0x68')]){_0x47ee8f[_0xe710('0x65')][_0xe710('0x73')][_0xe710('0x67')]({'ListId':{'$ne':_0x85fdde['ListId']}});}}return db['CmCustomField'][_0xe710('0x21')](_0x47ee8f);}})[_0xe710('0x18')](function(_0x4657d9){if(!_[_0xe710('0x5d')](_0x4657d9)){return _['omit'](_0x3e3299,_[_0xe710('0x74')](_0x4657d9,function(_0x594391){return util['format']('cf_%d',_0x594391['id']);}));}})['then'](handleEntityNotFound(_0x59b000,null))[_0xe710('0x18')](respondWithResult(_0x59b000,null))['catch'](handleError(_0x59b000,null));};exports['update']=function(_0x946399,_0x6a8a6a){var _0x5abe01;if(_0x946399[_0xe710('0x3a')]['id']){delete _0x946399['body']['id'];}if(!_['isNil'](_0x946399[_0xe710('0x3a')]['dialTimezone'])){var _0x53f76d=_0x946399[_0xe710('0x3a')][_0xe710('0x5e')];if(!_[_0xe710('0x5d')](shared[_0xe710('0x60')][_0x53f76d]))_0x946399['body'][_0xe710('0x5f')]=shared['timezones'][_0x53f76d][_0xe710('0x5f')];}return db[_0xe710('0x25')][_0xe710('0x26')]({'where':{'id':_0x946399[_0xe710('0x27')]['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x6a8a6a,null))['then'](saveUpdates(_0x946399[_0xe710('0x3a')],null))[_0xe710('0x18')](function(_0x452993){_0x5abe01=_0x452993;var _0x593509={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x452993&&_0x452993[_0xe710('0x68')]){if(_0x452993[_0xe710('0x68')]){_0x593509[_0xe710('0x65')][_0xe710('0x73')][_0xe710('0x67')]({'ListId':{'$ne':_0x452993[_0xe710('0x68')]}});}}return db['CmCustomField']['findAll'](_0x593509);})['then'](function(_0x26e289){if(_0x26e289){return _[_0xe710('0x75')](_[_0xe710('0x76')](_0x946399[_0xe710('0x3a')],function(_0x97b638,_0x4f7a53){return _[_0xe710('0x2c')](_0x4f7a53,_0xe710('0x2d'));}),_[_0xe710('0x74')](_0x26e289,function(_0x41787e){return util[_0xe710('0x77')](_0xe710('0x78'),_0x41787e['id']);}));}})['then'](function(_0x2e9540){if(_0x2e9540&&!_[_0xe710('0x79')](_0x2e9540)){var _0x3c2887=squel[_0xe710('0x48')]()[_0xe710('0x7a')]('cm_contacts')['setFields'](_0x2e9540)[_0xe710('0x65')](_0xe710('0x7b'),_0x946399['params']['id'])[_0xe710('0x7c')]();return db['sequelize'][_0xe710('0x22')](_0x3c2887[_0xe710('0x7d')],{'replacements':_0x3c2887[_0xe710('0x35')]});}})['then'](function(){if(_0x946399[_0xe710('0x3a')][_0xe710('0x7e')]&&_0x5abe01){return db[_0xe710('0x42')][_0xe710('0x48')]({'phone':_0x946399[_0xe710('0x3a')][_0xe710('0x7e')],'OrderBy':0x0},{'where':{'ContactId':_0x5abe01['id']}});}})['then'](function(){return _0x5abe01;})[_0xe710('0x18')](respondWithResult(_0x6a8a6a,null))[_0xe710('0x28')](handleError(_0x6a8a6a,null));};exports[_0xe710('0x7f')]=function(_0x45f935,_0x1e7143){var _0x54ef0b={};var _0x4c56cd={};var _0x454ae6;var _0x130cc1;return db[_0xe710('0x25')][_0xe710('0x80')]({'where':{'id':_0x45f935[_0xe710('0x27')]['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x1e7143,null))[_0xe710('0x18')](function(_0xf64606){if(_0xf64606){_0x454ae6=_0xf64606;_0x4c56cd[_0xe710('0x81')]=_[_0xe710('0x2b')](db[_0xe710('0x6d')]['rawAttributes']);_0x4c56cd['query']=_[_0xe710('0x2b')](_0x45f935[_0xe710('0x22')]);_0x4c56cd[_0xe710('0x82')]=_[_0xe710('0x83')](_0x4c56cd[_0xe710('0x81')],_0x4c56cd[_0xe710('0x22')]);_0x54ef0b[_0xe710('0x84')]=_[_0xe710('0x83')](_0x4c56cd[_0xe710('0x81')],qs[_0xe710('0x85')](_0x45f935[_0xe710('0x22')]['fields']));_0x54ef0b[_0xe710('0x84')]=_0x54ef0b[_0xe710('0x84')][_0xe710('0x2a')]?_0x54ef0b[_0xe710('0x84')]:_0x4c56cd[_0xe710('0x81')];_0x54ef0b[_0xe710('0x86')]=qs[_0xe710('0x87')](_0x45f935[_0xe710('0x22')][_0xe710('0x87')]);_0x54ef0b[_0xe710('0x65')]=qs[_0xe710('0x82')](_['pick'](_0x45f935[_0xe710('0x22')],_0x4c56cd[_0xe710('0x82')]));if(_0x45f935[_0xe710('0x22')][_0xe710('0x88')]){_0x54ef0b[_0xe710('0x65')]=_[_0xe710('0x39')](_0x54ef0b['where'],{'$or':_[_0xe710('0x74')](_0x54ef0b['attributes'],function(_0x3e844a){var _0x5ef8d6={};_0x5ef8d6[_0x3e844a]={'$like':'%'+_0x45f935[_0xe710('0x22')][_0xe710('0x88')]+'%'};return _0x5ef8d6;})});}_0x54ef0b=_['merge']({},_0x54ef0b,_0x45f935[_0xe710('0x89')]);return _0x454ae6[_0xe710('0x7f')](_0x54ef0b);}})['then'](function(_0x273a13){if(_0x273a13){_0x130cc1=_0x273a13[_0xe710('0x2a')];if(!_0x45f935[_0xe710('0x22')][_0xe710('0x38')](_0xe710('0x8a'))){_0x54ef0b['limit']=qs[_0xe710('0x14')](_0x45f935[_0xe710('0x22')][_0xe710('0x14')]);_0x54ef0b['offset']=qs[_0xe710('0x12')](_0x45f935[_0xe710('0x22')][_0xe710('0x12')]);}return _0x454ae6[_0xe710('0x7f')](_0x54ef0b);}})[_0xe710('0x18')](function(_0x443a14){if(_0x443a14){return _0x443a14?{'count':_0x130cc1,'rows':_0x443a14}:null;}})['then'](respondWithResult(_0x1e7143,null))['catch'](handleError(_0x1e7143,null));};exports[_0xe710('0x8b')]=function(_0x37b33b,_0x27b799){if(_0x37b33b[_0xe710('0x3a')]['id']){delete _0x37b33b[_0xe710('0x3a')]['id'];}return db['CmContact'][_0xe710('0x80')]({'where':{'id':_0x37b33b['params']['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x27b799,null))[_0xe710('0x18')](function(_0x24f288){if(_0x24f288){return _0x24f288[_0xe710('0x8b')](_0x37b33b[_0xe710('0x3a')][_0xe710('0x8c')]||[]);}return null;})[_0xe710('0x18')](respondWithResult(_0x27b799,null))['catch'](handleError(_0x27b799,null));};exports[_0xe710('0x8d')]=function(_0x363787,_0x705be6){var _0xb8c391=[];_0xb8c391[_0xe710('0x67')](addAdditionalPhones(_0x363787[_0xe710('0x3a')]));Promise['all'](_0xb8c391)[_0xe710('0x18')](function(){_0xb8c391=[];_0xb8c391[_0xe710('0x67')](deleteCmHopperPhones(_0x363787[_0xe710('0x3a')]['id']));_0xb8c391[_0xe710('0x67')](addCmHopperPhones(_0x363787[_0xe710('0x3a')]['id']));Promise[_0xe710('0x6b')](_0xb8c391)[_0xe710('0x18')](function(){return[0x1];})[_0xe710('0x18')](respondWithResult(_0x705be6,null));});};function addAdditionalPhones(_0x44f448){var _0x38d7c7;return new Promise(function(_0x10ddd6){return db[_0xe710('0x8e')][_0xe710('0x24')]({'where':{'CmContactId':_0x44f448['id']}})[_0xe710('0x18')](function(){db['ContactItemType'][_0xe710('0x21')]({'raw':!![],'attributes':['id',_0xe710('0x8f')]})[_0xe710('0x18')](function(_0xccbe52){var _0x1b2d9f=[];for(var _0x1fac7f=0x0;_0x1fac7f<_0x44f448[_0xe710('0x90')]['length'];_0x1fac7f++){var _0x27c30a=_0x44f448[_0xe710('0x91')]?_['isNil'](_0x44f448['item_types'][_0x1fac7f])?'':_0x44f448[_0xe710('0x91')][_0x1fac7f]:_0x44f448[_0xe710('0x90')][_0x1fac7f][_0xe710('0x92')]?_0x44f448[_0xe710('0x90')][_0x1fac7f]['ItemTypeId']:'';var _0x370399=_['isNil'](_0x44f448['items'][_0x1fac7f][_0xe710('0x93')])?'':_0x44f448[_0xe710('0x90')][_0x1fac7f]['description'];var _0x401e20=_0x27c30a+':'+_0x44f448[_0xe710('0x90')][_0x1fac7f][_0xe710('0x7e')]+'§'+_0x370399;if(_[_0xe710('0x5d')](_0x38d7c7))_0x38d7c7=_0x401e20;else _0x38d7c7+=';'+_0x401e20;var _0x578de3=null;var _0x29bea9=null;if(_0x44f448[_0xe710('0x91')]){if(!_[_0xe710('0x5d')](_0x44f448[_0xe710('0x91')][_0x1fac7f])){_0x29bea9=_[_0xe710('0x26')](_0xccbe52,function(_0x52b5ed){return _0x52b5ed['id']===_0x44f448['item_types'][_0x1fac7f];});if(!_[_0xe710('0x5d')](_0x29bea9)){_0x578de3=_0x29bea9[_0xe710('0x8f')];}}}else{if(!_[_0xe710('0x5d')](_0x44f448[_0xe710('0x90')][_0x1fac7f])){_0x29bea9=_[_0xe710('0x26')](_0xccbe52,function(_0x2dc9fc){return _0x2dc9fc['id']===_0x44f448[_0xe710('0x90')][_0x1fac7f][_0xe710('0x92')];});if(!_[_0xe710('0x5d')](_0x29bea9)){_0x578de3=_0x1fac7f;}}}if(_['isNil'](_0x578de3)){_0x578de3=0x64;}_0x1b2d9f['push'](addAdditionalPhone(_0x44f448['id'],_0x44f448[_0xe710('0x90')][_0x1fac7f][_0xe710('0x7e')],_0x44f448[_0xe710('0x91')]?_[_0xe710('0x5d')](_0x44f448[_0xe710('0x91')][_0x1fac7f])?null:_0x44f448['item_types'][_0x1fac7f]:_0x44f448[_0xe710('0x90')][_0x1fac7f][_0xe710('0x92')]?_0x44f448['items'][_0x1fac7f][_0xe710('0x92')]:null,_0x578de3,_0x370399));}Promise[_0xe710('0x6b')](_0x1b2d9f)[_0xe710('0x18')](function(){db[_0xe710('0x25')]['update']({'AdditionalPhones':_0x38d7c7},{'where':{'id':_0x44f448['id']}})['then'](function(){_0x10ddd6(0x1);});});});});});}function addAdditionalPhone(_0x408a7c,_0x589070,_0x9cb046,_0x1b9777,_0x1fba58){return db[_0xe710('0x8e')][_0xe710('0x26')]({'where':{'CmContactId':_0x408a7c,'item':_0x589070}})[_0xe710('0x18')](function(_0x45aaab){if(_0x45aaab)logger[_0xe710('0x40')](_0xe710('0x94'),_0x45aaab);else{db[_0xe710('0x8e')]['create']({'CmContactId':_0x408a7c,'item':_0x589070,'ItemTypeId':_0x9cb046,'OrderBy':_0x1b9777,'ItemClass':_0xe710('0x95'),'description':_0x1fba58});}});}function deleteCmHopperPhones(_0x2ca96c){return new Promise(function(_0x1472e3){return db[_0xe710('0x42')][_0xe710('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2ca96c}})['then'](function(_0xeb2678){db[_0xe710('0x96')]['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0xeb2678,'id')}}});})[_0xe710('0x18')](function(){_0x1472e3(0x1);});});}function addCmHopperPhones(_0x461533){return new Promise(function(_0x1eab51){return db[_0xe710('0x42')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x461533}})[_0xe710('0x18')](function(_0x136a1a){var _0xf60805=[];_[_0xe710('0x74')](_0x136a1a,function(_0x4ee2cb){_0xf60805[_0xe710('0x67')](createCmHopperPhone(_0x461533,_0x4ee2cb['id']));});Promise['all'](_0xf60805)[_0xe710('0x18')](function(){_0x1eab51(0x1);});});});}function createCmHopperPhone(_0x588e0f,_0x2088c4){return new Promise(function(_0x55b539){db[_0xe710('0x8e')][_0xe710('0x21')]({'raw':!![],'attributes':[_0xe710('0x97'),_0xe710('0x8f')],'where':{'CmContactId':_0x588e0f,'ItemClass':_0xe710('0x95')},'include':[{'model':db[_0xe710('0x70')],'attributes':[_0xe710('0x8f')],'as':_0xe710('0x98')}],'order':[_0xe710('0x8f'),db[_0xe710('0x71')][_0xe710('0x72')](_0xe710('0x99'))]})[_0xe710('0x18')](function(_0x299096){var _0x291a98=0x1;var _0x4cba1f=_[_0xe710('0x74')](_0x299096,function(_0x29979d){_0x29979d[_0xe710('0x9a')]=_0x2088c4;_0x29979d[_0xe710('0x7e')]=_0x29979d['item'];_0x29979d[_0xe710('0x8f')]=_0x291a98;delete _0x29979d[_0xe710('0x9b')];_0x291a98=_0x291a98+0x1;return _0x29979d;});return db['CmHopperAdditionalPhone']['bulkCreate'](_0x4cba1f,{});})[_0xe710('0x18')](function(){_0x55b539(0x1);});});}function insertAdditionalPhones(_0x20913c,_0x281daf){return new Promise(function(_0x579cb2){var _0x46bc34=[];for(var _0x54194d=0x0;_0x54194d<_0x281daf['length'];_0x54194d++){var _0x5d4bd2=_0x281daf[_0x54194d];_0x46bc34[_0xe710('0x67')](parseContactItemType(_0x5d4bd2));}Promise[_0xe710('0x6b')](_0x46bc34)['then'](function(){var _0x2b8797={'id':_0x20913c['id'],'items':_0x281daf};return addAdditionalPhones(_0x2b8797)['then'](function(){return addCmHopperPhones(_0x20913c['id']);});})[_0xe710('0x18')](function(){_0x579cb2(_0x20913c);});});}function parseContactItemType(_0xf92c91){return new Promise(function(_0x292deb){if(_0xf92c91['hasOwnProperty'](_0xe710('0x92'))){_0x292deb(_0xf92c91);}else{return db[_0xe710('0x70')][_0xe710('0x26')]({'where':{'name':_0xf92c91[_0xe710('0x98')]}})['then'](function(_0x178db2){if(_['isNil'](_0x178db2))_0xf92c91[_0xe710('0x92')]=null;else _0xf92c91['ItemTypeId']=_0x178db2['id'];_0x292deb(_0xf92c91);});}});}exports['getAdditionalPhones']=function(_0x24a310,_0x50dcec){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x24a310['params']['id'],'ItemClass':_0xe710('0x95')},'include':[{'model':db[_0xe710('0x70')],'as':_0xe710('0x98')}],'order':[[_0xe710('0x8f')],[db['sequelize']['literal'](_0xe710('0x99'))]]})['then'](function(_0x2f8a26){return _0x2f8a26;})[_0xe710('0x18')](respondWithResult(_0x50dcec,null))[_0xe710('0x28')](handleError(_0x50dcec,null));};exports['duplicateAdditionalPhones']=function(_0x1fcfe1,_0x453c1c){return db['CmContactHasItem'][_0xe710('0x21')]({'raw':!![],'where':{'CmContactId':_0x1fcfe1[_0xe710('0x3a')][_0xe710('0x9c')]}})['then'](function(_0x5eb1ba){var _0x59f6ba=_[_0xe710('0x74')](_0x5eb1ba,function(_0xc387f6){_0xc387f6[_0xe710('0x9d')]=_0x1fcfe1[_0xe710('0x3a')][_0xe710('0x9e')];return _0xc387f6;});return db[_0xe710('0x8e')][_0xe710('0x62')](_0x59f6ba,{});})['then'](function(){return addCmHopperPhones(_0x1fcfe1[_0xe710('0x3a')][_0xe710('0x9e')]);})[_0xe710('0x18')](function(){return['ok'];})[_0xe710('0x18')](respondWithResult(_0x453c1c,null))[_0xe710('0x28')](handleError(_0x453c1c,null));};exports[_0xe710('0x9f')]=function(_0x43f323,_0x52efed){var _0x282fd9=[];_0x282fd9[_0xe710('0x67')](createCmHopperPhone(_0x43f323['body']['id'],_0x43f323['body']['hopperId']));Promise[_0xe710('0x6b')](_0x282fd9)[_0xe710('0x18')](function(){return[0x1];})['then'](respondWithResult(_0x52efed,null));};exports[_0xe710('0xa0')]=function(_0x59f337,_0x13473b){var _0x5c492a={'raw':![],'where':{}};var _0x169bde={};var _0xc0988e={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x59f337[_0xe710('0x27')]['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x13473b,null))[_0xe710('0x18')](function(_0x4a3f75){if(_0x4a3f75){_0x169bde['model']=_[_0xe710('0x2b')](db[_0xe710('0x42')][_0xe710('0xa1')]);_0x169bde[_0xe710('0x22')]=_['keys'](_0x59f337['query']);_0x169bde[_0xe710('0x82')]=_['intersection'](_0x169bde[_0xe710('0x81')],_0x169bde['query']);_0x5c492a[_0xe710('0x84')]=_[_0xe710('0x83')](_0x169bde['model'],qs[_0xe710('0x85')](_0x59f337['query'][_0xe710('0x85')]));_0x5c492a[_0xe710('0x84')]=_0x5c492a[_0xe710('0x84')]['length']?_0x5c492a[_0xe710('0x84')]:_0x169bde[_0xe710('0x81')];if(!_0x59f337['query']['hasOwnProperty']('nolimit')){_0x5c492a[_0xe710('0x14')]=qs['limit'](_0x59f337[_0xe710('0x22')][_0xe710('0x14')]);_0x5c492a[_0xe710('0x12')]=qs[_0xe710('0x12')](_0x59f337[_0xe710('0x22')][_0xe710('0x12')]);}_0x5c492a[_0xe710('0x86')]=qs[_0xe710('0x87')](_0x59f337[_0xe710('0x22')]['sort']);_0x5c492a[_0xe710('0x65')]=qs[_0xe710('0x82')](_[_0xe710('0xa2')](_0x59f337[_0xe710('0x22')],_0x169bde['filters']));_0x5c492a[_0xe710('0x65')][_0xe710('0xa3')]=_0x4a3f75['id'];if(_0x59f337['query'][_0xe710('0x88')]){_0x5c492a[_0xe710('0x65')]=_[_0xe710('0x39')](_0x5c492a[_0xe710('0x65')],{'$or':_[_0xe710('0x74')](_0x5c492a[_0xe710('0x84')],function(_0xbd3618){var _0x5b2eff={};_0x5b2eff[_0xbd3618]={'$like':'%'+_0x59f337['query']['filter']+'%'};return _0x5b2eff;})});}_0x5c492a=_[_0xe710('0x39')]({},_0x5c492a,_0x59f337[_0xe710('0x89')]);return db[_0xe710('0x42')][_0xe710('0x15')]({'where':_0x5c492a[_0xe710('0x65')]})['then'](function(_0x58f1ed){_0xc0988e['count']=_0x58f1ed;if(_0x59f337[_0xe710('0x22')]['includeAll']){_0x5c492a[_0xe710('0xa4')]=[{'all':!![]}];}return db[_0xe710('0x42')][_0xe710('0x21')](_0x5c492a);})['then'](function(_0x5102fa){_0xc0988e[_0xe710('0xa5')]=_0x5102fa;return _0xc0988e;});}})['then'](respondWithFilteredResult(_0x13473b,_0x5c492a))[_0xe710('0x28')](handleError(_0x13473b,null));};exports[_0xe710('0xa6')]=function(_0x95a6e6,_0x133d8a){var _0x42104c={'raw':!![],'where':{}};var _0x3eb0c2={};var _0x2478eb={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x95a6e6[_0xe710('0x27')]['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x133d8a,null))[_0xe710('0x18')](function(_0x1b3c74){if(_0x1b3c74){_0x3eb0c2[_0xe710('0x81')]=_[_0xe710('0x2b')](db[_0xe710('0x53')]['rawAttributes']);_0x3eb0c2[_0xe710('0x22')]=_[_0xe710('0x2b')](_0x95a6e6[_0xe710('0x22')]);_0x3eb0c2[_0xe710('0x82')]=_[_0xe710('0x83')](_0x3eb0c2[_0xe710('0x81')],_0x3eb0c2['query']);_0x42104c['attributes']=_[_0xe710('0x83')](_0x3eb0c2[_0xe710('0x81')],qs[_0xe710('0x85')](_0x95a6e6['query'][_0xe710('0x85')]));_0x42104c['attributes']=_0x42104c['attributes'][_0xe710('0x2a')]?_0x42104c[_0xe710('0x84')]:_0x3eb0c2[_0xe710('0x81')];if(!_0x95a6e6[_0xe710('0x22')]['hasOwnProperty'](_0xe710('0x8a'))){_0x42104c[_0xe710('0x14')]=qs['limit'](_0x95a6e6['query'][_0xe710('0x14')]);_0x42104c[_0xe710('0x12')]=qs['offset'](_0x95a6e6['query'][_0xe710('0x12')]);}_0x42104c[_0xe710('0x86')]=qs[_0xe710('0x87')](_0x95a6e6[_0xe710('0x22')][_0xe710('0x87')]);_0x42104c[_0xe710('0x65')]=qs[_0xe710('0x82')](_[_0xe710('0xa2')](_0x95a6e6[_0xe710('0x22')],_0x3eb0c2['filters']));_0x42104c[_0xe710('0x65')][_0xe710('0xa3')]=_0x1b3c74['id'];if(_0x95a6e6[_0xe710('0x22')][_0xe710('0x88')]){_0x42104c['where']=_['merge'](_0x42104c[_0xe710('0x65')],{'$or':_[_0xe710('0x74')](_0x42104c[_0xe710('0x84')],function(_0x372b46){var _0x3a4c64={};_0x3a4c64[_0x372b46]={'$like':'%'+_0x95a6e6[_0xe710('0x22')]['filter']+'%'};return _0x3a4c64;})});}_0x42104c=_[_0xe710('0x39')]({},_0x42104c,_0x95a6e6[_0xe710('0x89')]);return db[_0xe710('0x53')][_0xe710('0x15')]({'where':_0x42104c[_0xe710('0x65')]})['then'](function(_0x1102a5){_0x2478eb[_0xe710('0x15')]=_0x1102a5;if(_0x95a6e6[_0xe710('0x22')][_0xe710('0xa7')]){_0x42104c[_0xe710('0xa4')]=[{'all':!![]}];}return db[_0xe710('0x53')][_0xe710('0x21')](_0x42104c);})[_0xe710('0x18')](function(_0x4eb0c1){_0x2478eb['rows']=_0x4eb0c1;return _0x2478eb;});}})[_0xe710('0x18')](respondWithFilteredResult(_0x133d8a,_0x42104c))[_0xe710('0x28')](handleError(_0x133d8a,null));};exports['getHopperFinals']=function(_0x1411c1,_0x2e6352){var _0x3d4723={'raw':!![],'where':{}};var _0x5878bc={};var _0x2fa295={'count':0x0,'rows':[]};return db[_0xe710('0x25')]['findOne']({'where':{'id':_0x1411c1['params']['id']}})[_0xe710('0x18')](handleEntityNotFound(_0x2e6352,null))['then'](function(_0x176192){if(_0x176192){_0x5878bc['model']=_[_0xe710('0x2b')](db[_0xe710('0x52')][_0xe710('0xa1')]);_0x5878bc[_0xe710('0x22')]=_[_0xe710('0x2b')](_0x1411c1['query']);_0x5878bc[_0xe710('0x82')]=_[_0xe710('0x83')](_0x5878bc[_0xe710('0x81')],_0x5878bc[_0xe710('0x22')]);_0x3d4723[_0xe710('0x84')]=_[_0xe710('0x83')](_0x5878bc[_0xe710('0x81')],qs[_0xe710('0x85')](_0x1411c1[_0xe710('0x22')][_0xe710('0x85')]));_0x3d4723[_0xe710('0x84')]=_0x3d4723[_0xe710('0x84')]['length']?_0x3d4723[_0xe710('0x84')]:_0x5878bc['model'];if(!_0x1411c1[_0xe710('0x22')][_0xe710('0x38')](_0xe710('0x8a'))){_0x3d4723[_0xe710('0x14')]=qs[_0xe710('0x14')](_0x1411c1[_0xe710('0x22')][_0xe710('0x14')]);_0x3d4723[_0xe710('0x12')]=qs[_0xe710('0x12')](_0x1411c1['query']['offset']);}_0x3d4723[_0xe710('0x86')]=qs[_0xe710('0x87')](_0x1411c1[_0xe710('0x22')][_0xe710('0x87')]);_0x3d4723['where']=qs[_0xe710('0x82')](_['pick'](_0x1411c1[_0xe710('0x22')],_0x5878bc['filters']));_0x3d4723[_0xe710('0x65')][_0xe710('0xa3')]=_0x176192['id'];if(_0x1411c1['query'][_0xe710('0x88')]){_0x3d4723['where']=_['merge'](_0x3d4723[_0xe710('0x65')],{'$or':_[_0xe710('0x74')](_0x3d4723[_0xe710('0x84')],function(_0x2b4abc){var _0x53dd8b={};_0x53dd8b[_0x2b4abc]={'$like':'%'+_0x1411c1[_0xe710('0x22')]['filter']+'%'};return _0x53dd8b;})});}_0x3d4723=_['merge']({},_0x3d4723,_0x1411c1['options']);return db[_0xe710('0x52')][_0xe710('0x15')]({'where':_0x3d4723[_0xe710('0x65')]})['then'](function(_0x561f68){_0x2fa295[_0xe710('0x15')]=_0x561f68;if(_0x1411c1[_0xe710('0x22')][_0xe710('0xa7')]){_0x3d4723['include']=[{'all':!![]}];}return db[_0xe710('0x52')][_0xe710('0x21')](_0x3d4723);})['then'](function(_0x936e93){_0x2fa295[_0xe710('0xa5')]=_0x936e93;return _0x2fa295;});}})['then'](respondWithFilteredResult(_0x2e6352,_0x3d4723))[_0xe710('0x28')](handleError(_0x2e6352,null));};exports[_0xe710('0xa8')]=function(_0xc140e9,_0x25c40b){var _0x232ce7={'raw':!![],'where':{}};var _0x30fc98={};var _0x10c88a={'count':0x0,'rows':[]};return db[_0xe710('0x25')][_0xe710('0x80')]({'where':{'id':_0xc140e9[_0xe710('0x27')]['id']}})['then'](handleEntityNotFound(_0x25c40b,null))['then'](function(_0x184bb5){if(_0x184bb5){_0x30fc98[_0xe710('0x81')]=_[_0xe710('0x2b')](db[_0xe710('0x59')][_0xe710('0xa1')]);_0x30fc98['query']=_[_0xe710('0x2b')](_0xc140e9[_0xe710('0x22')]);_0x30fc98[_0xe710('0x82')]=_[_0xe710('0x83')](_0x30fc98[_0xe710('0x81')],_0x30fc98['query']);_0x232ce7[_0xe710('0x84')]=_[_0xe710('0x83')](_0x30fc98['model'],qs['fields'](_0xc140e9[_0xe710('0x22')][_0xe710('0x85')]));_0x232ce7['attributes']=_0x232ce7[_0xe710('0x84')][_0xe710('0x2a')]?_0x232ce7[_0xe710('0x84')]:_0x30fc98[_0xe710('0x81')];if(!_0xc140e9[_0xe710('0x22')]['hasOwnProperty'](_0xe710('0x8a'))){_0x232ce7[_0xe710('0x14')]=qs[_0xe710('0x14')](_0xc140e9[_0xe710('0x22')][_0xe710('0x14')]);_0x232ce7['offset']=qs[_0xe710('0x12')](_0xc140e9[_0xe710('0x22')][_0xe710('0x12')]);}_0x232ce7[_0xe710('0x86')]=qs[_0xe710('0x87')](_0xc140e9[_0xe710('0x22')]['sort']);_0x232ce7[_0xe710('0x65')]=qs[_0xe710('0x82')](_[_0xe710('0xa2')](_0xc140e9[_0xe710('0x22')],_0x30fc98[_0xe710('0x82')]));_0x232ce7[_0xe710('0x65')]['ContactId']=_0x184bb5['id'];if(_0xc140e9[_0xe710('0x22')]['filter']){_0x232ce7[_0xe710('0x65')]=_[_0xe710('0x39')](_0x232ce7[_0xe710('0x65')],{'$or':_[_0xe710('0x74')](_0x232ce7[_0xe710('0x84')],function(_0x3962ee){var _0xac1da0={};_0xac1da0[_0x3962ee]={'$like':'%'+_0xc140e9[_0xe710('0x22')][_0xe710('0x88')]+'%'};return _0xac1da0;})});}_0x232ce7=_[_0xe710('0x39')]({},_0x232ce7,_0xc140e9[_0xe710('0x89')]);return db[_0xe710('0x59')][_0xe710('0x15')]({'where':_0x232ce7[_0xe710('0x65')]})['then'](function(_0x164c1b){_0x10c88a['count']=_0x164c1b;if(_0xc140e9[_0xe710('0x22')]['includeAll']){_0x232ce7[_0xe710('0xa4')]=[{'all':!![]}];}return db[_0xe710('0x59')][_0xe710('0x21')](_0x232ce7);})[_0xe710('0x18')](function(_0x26fb6e){_0x10c88a[_0xe710('0xa5')]=_0x26fb6e;return _0x10c88a;});}})[_0xe710('0x18')](respondWithFilteredResult(_0x25c40b,_0x232ce7))[_0xe710('0x28')](handleError(_0x25c40b,null));};exports[_0xe710('0xa9')]=function(_0x42fe9f,_0xa1d49e){try{if(!_0x42fe9f[_0xe710('0x3a')][_0xe710('0x68')]){throw new Error(_0xe710('0xaa'));}if(!_0x42fe9f[_0xe710('0x3a')]['binding_keys']){throw new Error(_0xe710('0xab'));}if(!_0x42fe9f[_0xe710('0x3a')][_0xe710('0xac')]){throw new Error(_0xe710('0xad'));}if(!_0x42fe9f['body'][_0xe710('0xae')]){throw new Error(_0xe710('0xaf'));}var _0x5e2b6c=_0x42fe9f[_0xe710('0x3a')][_0xe710('0xb0')][_0xe710('0xb1')](',');var _0x4d1376=_0x42fe9f[_0xe710('0x3a')][_0xe710('0xac')][_0xe710('0xb1')](',');if(!_0x5e2b6c[_0xe710('0x2a')]||!_0x4d1376[_0xe710('0x2a')]||_0x5e2b6c[_0xe710('0x2a')]!==_0x4d1376[_0xe710('0x2a')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x42fe9f[_0xe710('0x3a')]['fields']=_[_0xe710('0xb2')](_0x5e2b6c,_0x4d1376);if(!_0x42fe9f[_0xe710('0x3a')][_0xe710('0x85')][_0xe710('0x7e')]){throw new Error(_0xe710('0xb3'));}if(!_0x42fe9f[_0xe710('0x3a')][_0xe710('0x85')]['firstName']){throw new Error(_0xe710('0xb4'));}var _0x178180=path['join'](config[_0xe710('0xb5')],_0xe710('0xb6'),_0x42fe9f['file']['filename']);fs[_0xe710('0xb7')](_0x178180,parseInt(_0xe710('0xb8'),0x8));var _0x529153=require('child_process')[_0xe710('0xb9')](path['join'](__dirname,'../../components/import/cm/csv'),[_0x178180,_0x42fe9f[_0xe710('0x3a')][_0xe710('0xb0')],_0x42fe9f[_0xe710('0x3a')][_0xe710('0xac')],_0x42fe9f[_0xe710('0x3a')]['ListId'],_0x42fe9f[_0xe710('0x3a')][_0xe710('0xba')],_0x42fe9f[_0xe710('0x3a')]['duplicates'],_0x42fe9f[_0xe710('0x3a')][_0xe710('0xae')]]);return _0xa1d49e[_0xe710('0x19')](0xc8)['json']({'message':_0xe710('0xbb'),'pid':_0x529153[_0xe710('0xbc')]});}catch(_0x5ad274){return _0xa1d49e[_0xe710('0x19')](0x1f4)[_0xe710('0x1e')](_0x5ad274);}};exports[_0xe710('0xbd')]=function(_0x59a134,_0x11debf){var _0x133617=fs[_0xe710('0xbe')](_0x59a134[_0xe710('0xbf')][_0xe710('0x2')]);Papa['parse'](_0x133617,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x34b21c){return _0x11debf[_0xe710('0x19')](0xc8)[_0xe710('0x11')]({'file':_0x59a134['file'],'fields':_0x34b21c[_0xe710('0xc0')][_0xe710('0x85')]});}});};exports['import']=function(_0x59034c,_0x1f26df){return db[_0xe710('0xc1')][_0xe710('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0xe710('0xc2')}})['then'](function(_0x46000e){var _0x30ad6e=![];if(!_0x59034c[_0xe710('0x3a')][_0xe710('0x68')]){throw new Error(_0xe710('0xaa'));}if(!_0x59034c[_0xe710('0x3a')][_0xe710('0xc3')][_0xe710('0x7e')]){throw new Error(_0xe710('0xb3'));}if(!_0x59034c[_0xe710('0x3a')]['binding'][_0xe710('0xc4')]){throw new Error(_0xe710('0xb4'));}if(!_0x59034c['body']['socket_timestamp']){throw new Error(_0xe710('0xaf'));}var _0x24665b=require('child_process')[_0xe710('0xb9')](path[_0xe710('0x3f')](__dirname,_0xe710('0xc5')),[_0x59034c[_0xe710('0x27')]['id'],JSON[_0xe710('0xc6')](_0x59034c[_0xe710('0x3a')]),JSON[_0xe710('0xc6')](_0x46000e)]);_0x24665b['on'](_0xe710('0xc7'),function(){_0x30ad6e=!![];return _0x1f26df['status'](0xc8)['json']({'message':_0xe710('0xc8'),'pid':_0x24665b[_0xe710('0xbc')]});});_0x24665b['on']('exit',function(_0x1e5e8f){if(_0x1e5e8f&&!_0x30ad6e){return _0x1f26df[_0xe710('0x19')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x24665b[_0xe710('0xbc')]});}});})['catch'](handleError(_0x1f26df,null));};exports[_0xe710('0xc9')]=function(_0x29073b,_0x5aa08d){return db[_0xe710('0xc1')][_0xe710('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0xe710('0xc2')}})['then'](function(_0x10fcb6){var _0x568aa4=![];if(!_0x29073b['body'][_0xe710('0x68')]){throw new Error('No\x20ListId\x20specified');}if(!_0x29073b[_0xe710('0x3a')][_0xe710('0xc3')][_0xe710('0x7e')]){throw new Error(_0xe710('0xb3'));}if(!_0x29073b[_0xe710('0x3a')][_0xe710('0xc3')]['firstName']){throw new Error(_0xe710('0xb4'));}if(!_0x29073b[_0xe710('0x3a')][_0xe710('0xae')]){throw new Error(_0xe710('0xaf'));}var _0x463ff7=require(_0xe710('0xca'))[_0xe710('0xb9')](path[_0xe710('0x3f')](__dirname,_0xe710('0xcb')),[_0x29073b[_0xe710('0x27')]['id'],JSON[_0xe710('0xc6')](_0x29073b['body']),JSON[_0xe710('0xc6')](_0x10fcb6)]);_0x463ff7['on'](_0xe710('0xc7'),function(){_0x568aa4=!![];return _0x5aa08d['status'](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x463ff7[_0xe710('0xbc')]});});_0x463ff7['on'](_0xe710('0xcc'),function(_0x3323ec){if(_0x3323ec&&!_0x568aa4){return _0x5aa08d[_0xe710('0x19')](0x1f4)['json']({'message':_0xe710('0xcd'),'pid':_0x463ff7['pid']});}});})[_0xe710('0x28')](handleError(_0x5aa08d,null));};exports[_0xe710('0xce')]=function(_0x2ba2f5,_0xdb352e){var _0x9af911=['mail',_0xe710('0xcf'),'sms',_0xe710('0xd0'),_0xe710('0xd1'),_0xe710('0xd2'),_0xe710('0xd3')];var _0x4dc314={'offset':0x0,'order':qs['sort'](_0xe710('0xd4'))},_0x48c458={'count':0x0,'rows':[]};Promise['resolve']()[_0xe710('0x18')](function(){if(_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd5')]){if(!_[_0xe710('0xd6')](_0x9af911,_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd5')][_0xe710('0xd7')]())){throw new Error(_0xe710('0xd8'));}_0x9af911=[_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd5')][_0xe710('0xd7')]()];}if(_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd9')]){try{var _0x1c1537=JSON[_0xe710('0xda')](_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd9')]);if(!moment(_0x1c1537[_0xe710('0x3b')])[_0xe710('0xdb')]()){throw new Error(_0xe710('0xdc'));}if(!moment(_0x1c1537['to'])[_0xe710('0xdb')]()){throw new Error(_0xe710('0xdd'));}}catch(_0x1f259b){throw new Error(_0xe710('0xde'));}}if(!_0x2ba2f5[_0xe710('0x22')]['hasOwnProperty']('nolimit')){_0x4dc314[_0xe710('0x14')]=qs[_0xe710('0x14')](_0x2ba2f5[_0xe710('0x22')][_0xe710('0x14')]||0xa);_0x4dc314[_0xe710('0x12')]=qs[_0xe710('0x12')](_0x2ba2f5['query'][_0xe710('0x12')]);}var _0x290b6c=_0x9af911[_0xe710('0x74')](function(_0x34d6ff){if(_0x34d6ff==='voice'){var _0x33d2fd={'attributes':['id','uniqueid',_0xe710('0x34'),_0xe710('0xdf'),_0xe710('0xe0'),_0xe710('0xe1'),_0xe710('0xe2'),_0xe710('0xe3'),_0xe710('0xe4'),_0xe710('0xe5'),_0xe710('0xe6'),_0xe710('0xe7'),_0xe710('0xe8'),'userThirdDisposition',_0xe710('0xe9')],'where':{'ContactId':_0x2ba2f5[_0xe710('0x27')]['id']},'include':[{'model':db['User'],'as':_0xe710('0xc1'),'attributes':['id',_0xe710('0x1d'),_0xe710('0xea'),_0xe710('0x32')]}],'order':[['createdAt','DESC']]};if(_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd9')]){_0x33d2fd[_0xe710('0x65')][_0xe710('0xe6')]={'$gte':_0x1c1537[_0xe710('0x3b')],'$lte':_0x1c1537['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x33d2fd)['then'](function(_0x152c20){_0x48c458[_0xe710('0x15')]+=_0x152c20[_0xe710('0x15')];return _[_0xe710('0x74')](_0x152c20['rows'],function(_0x2e209e){var _0x5f46d0=_0x2e209e[_0xe710('0x3c')]({'plain':!![]});_0x5f46d0['channel']=_0x34d6ff;if(_0x5f46d0[_0xe710('0xc1')]){_0x5f46d0[_0xe710('0xc1')]={'id':_0x5f46d0[_0xe710('0xc1')]['id'],'name':_0x5f46d0[_0xe710('0xc1')][_0xe710('0x1d')],'fullname':_0x5f46d0[_0xe710('0xc1')]['fullname'],'alias':_0x5f46d0[_0xe710('0xc1')][_0xe710('0x32')]};}return _0x5f46d0;});});}else{var _0x3cf833=_['startCase'](_0x34d6ff)+(_0x34d6ff==='chat'?_0xe710('0xeb'):_0xe710('0xec'));var _0x5a54ab={'attributes':['id','closed',_0xe710('0xed'),_0xe710('0xe6'),_0xe710('0xe5'),'disposition',_0xe710('0xee'),_0xe710('0xef'),_0xe710('0xe9'),_0x3cf833+'Id'],'where':{'ContactId':_0x2ba2f5[_0xe710('0x27')]['id']},'include':[{'model':db[_0x3cf833],'as':_0xe710('0xec'),'attributes':['id',_0xe710('0x1d'),_0xe710('0xf0')]},{'model':db[_0xe710('0xc1')],'as':'Owner','attributes':['id',_0xe710('0x1d'),_0xe710('0xea')]},{'model':db[_0xe710('0x6d')],'as':_0xe710('0xf1'),'attributes':['id','name',_0xe710('0x6e')],'through':{'attributes':[]}}],'order':[[_0xe710('0xe6'),_0xe710('0xf2')]]};if(_0x2ba2f5[_0xe710('0x22')][_0xe710('0xd9')]){_0x5a54ab[_0xe710('0x65')][_0xe710('0xe6')]={'$gte':_0x1c1537[_0xe710('0x3b')],'$lte':_0x1c1537['to']};}switch(_0x34d6ff){case _0xe710('0xcf'):_0x5a54ab[_0xe710('0x84')][_0xe710('0x67')](_0xe710('0xf3'),_0xe710('0xf4'),_0xe710('0xf5'),_0xe710('0xf6'),_0xe710('0xf7'),'ratingMessage',_0xe710('0xf8'),_0xe710('0xf9'),_0xe710('0xfa'));break;case'mail':_0x5a54ab['attributes'][_0xe710('0x67')]('subject',_0xe710('0xfb'));break;case _0xe710('0xd0'):_0x5a54ab[_0xe710('0x84')]['push'](_0xe710('0xfc'),_0xe710('0xfd'));break;}return db[_[_0xe710('0xfe')](_0x34d6ff)+'Interaction']['findAndCountAll'](_0x5a54ab)[_0xe710('0x18')](function(_0x1e432f){_0x48c458[_0xe710('0x15')]+=_0x1e432f['count'];return _[_0xe710('0x74')](_0x1e432f['rows'],function(_0x2394c6){var _0x58f092=_0x2394c6['get']({'plain':!![]});_0x58f092[_0xe710('0xd5')]=_0x34d6ff;if(_0x58f092[_0xe710('0xff')]){_0x58f092['Owner']={'id':_0x58f092[_0xe710('0xff')]['id'],'name':_0x58f092[_0xe710('0xff')]['name'],'fullname':_0x58f092[_0xe710('0xff')][_0xe710('0xea')]};}return _0x58f092;});});}});return Promise[_0xe710('0x6b')](_0x290b6c);})[_0xe710('0x18')](function(_0x17d313){return _(_0x17d313)['flatten']()[_0xe710('0x100')](_0xe710('0xe6'))[_0xe710('0x101')]()[_0xe710('0x102')]();})[_0xe710('0x18')](function(_0x1b7973){_0x48c458[_0xe710('0xa5')]=_0x4dc314['limit']?_0x1b7973[_0xe710('0x103')](_0x4dc314[_0xe710('0x12')],_0x4dc314['offset']+_0x4dc314['limit']):_0x1b7973;return _0x48c458;})[_0xe710('0x18')](respondWithFilteredResult(_0xdb352e,_0x4dc314))['catch'](handleError(_0xdb352e,null));};
\ No newline at end of file
index 4be1a84..db97f83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ac=['hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','save','emit'];(function(_0x744b7c,_0x10d9e9){var _0x1b3ba6=function(_0x3ec274){while(--_0x3ec274){_0x744b7c['push'](_0x744b7c['shift']());}};_0x1b3ba6(++_0x10d9e9);}(_0x48ac,0xdb));var _0xc48a=function(_0x18e22b,_0x2b4802){_0x18e22b=_0x18e22b-0x0;var _0x4895fd=_0x48ac[_0x18e22b];return _0x4895fd;};'use strict';var EventEmitter=require(_0xc48a('0x0'));var CmContact=require(_0xc48a('0x1'))['db'][_0xc48a('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xc48a('0x3')](0x0);var events={'afterCreate':_0xc48a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xfe8737){return function(_0x238fc0,_0x55192d,_0x1b2484){CmContactEvents[_0xc48a('0x5')](_0xfe8737+':'+_0x238fc0['id'],_0x238fc0);CmContactEvents[_0xc48a('0x5')](_0xfe8737,_0x238fc0);_0x1b2484(null);};}for(var e in events){if(events[_0xc48a('0x6')](e)){var event=events[e];CmContact[_0xc48a('0x7')](e,emitEvent(event));}}module[_0xc48a('0x8')]=CmContactEvents;
\ No newline at end of file
+var _0x3a27=['remove','emit','hasOwnProperty','exports','events','CmContact','setMaxListeners','save'];(function(_0x5dcd95,_0x1e72d4){var _0x271b17=function(_0x57b81b){while(--_0x57b81b){_0x5dcd95['push'](_0x5dcd95['shift']());}};_0x271b17(++_0x1e72d4);}(_0x3a27,0x1bc));var _0x73a2=function(_0x49f84c,_0x2ec4dc){_0x49f84c=_0x49f84c-0x0;var _0x1a963a=_0x3a27[_0x49f84c];return _0x1a963a;};'use strict';var EventEmitter=require(_0x73a2('0x0'));var CmContact=require('../../mysqldb')['db'][_0x73a2('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x73a2('0x2')](0x0);var events={'afterCreate':_0x73a2('0x3'),'afterUpdate':'update','afterDestroy':_0x73a2('0x4')};function emitEvent(_0x5ca558){return function(_0x19c149,_0x134125,_0x4c360b){CmContactEvents['emit'](_0x5ca558+':'+_0x19c149['id'],_0x19c149);CmContactEvents[_0x73a2('0x5')](_0x5ca558,_0x19c149);_0x4c360b(null);};}for(var e in events){if(events[_0x73a2('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x73a2('0x7')]=CmContactEvents;
\ No newline at end of file
index bf7abb1..e9675e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1db0=['all','info','[CmContact][afterDestroy][Succesfull]','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','timezones','utcOffset','add','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','BlackLists','CmHopperBlack','message','Campaign','onlyIfOpen','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId'];(function(_0x53999f,_0x2373c6){var _0x9a55ee=function(_0x32be0e){while(--_0x32be0e){_0x53999f['push'](_0x53999f['shift']());}};_0x9a55ee(++_0x2373c6);}(_0x1db0,0x1b9));var _0x01db=function(_0x206adf,_0x2ba1a3){_0x206adf=_0x206adf-0x0;var _0x171caa=_0x1db0[_0x206adf];return _0x171caa;};'use strict';var _=require(_0x01db('0x0'));var util=require('util');var logger=require(_0x01db('0x1'))('api');var moment=require(_0x01db('0x2'));var BPromise=require(_0x01db('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01db('0x4'));var rimraf=require(_0x01db('0x5'));var config=require(_0x01db('0x6'));var shared=require(_0x01db('0x7'));var attributes=require(_0x01db('0x8'));module[_0x01db('0x9')]=function(_0x53ee69,_0x26af9a){return _0x53ee69[_0x01db('0xa')](_0x01db('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x01db('0xc'),'fields':[_0x01db('0xc')]},{'name':'fti_cm_contacts','fields':[_0x01db('0xd'),_0x01db('0xe'),_0x01db('0xc'),_0x01db('0xf'),'fax',_0x01db('0x10')],'type':_0x01db('0x11')}],'timestamps':!![],'charset':_0x01db('0x12'),'collate':_0x01db('0x13'),'hooks':{'afterCreate':function(_0x1fa07c,_0x1627e6,_0x368f60){var _0x1aca29=_0x53ee69[_0x01db('0x14')];var _0x3caaf9=_0x1fa07c[_0x01db('0x15')]({'plain':!![]});function _0x5dbafb(){return function(_0x15f73f){logger[_0x01db('0x16')](_0x01db('0x17'),_0x01db('0x18'),util[_0x01db('0x19')](_0x15f73f,{'showHidden':![],'depth':null}));};}function _0x37785b(_0x57ca35,_0x24f5a1){var _0x27727b=_0x24f5a1[_0x01db('0x1a')]?_0x24f5a1[_0x01db('0x1a')]:moment()[_0x01db('0x1b')](_0x01db('0x1c'));return new BPromise(function(_0x215c6b,_0x121514){if(_[_0x01db('0x1d')](_0x24f5a1[_0x01db('0x1e')])){_0x215c6b({'ret':_0x27727b});}else{_0x1aca29['VoiceQueue'][_0x01db('0x1f')]({'where':{'id':_0x57ca35['id']}})[_0x01db('0x20')](function(_0x4ebb30){if(!_[_0x01db('0x1d')](_0x4ebb30)){var _0x49f101=_0x4ebb30[_0x01db('0x1e')];if(!_['isNil'](_0x49f101)){var _0x308c47=shared[_0x01db('0x21')];var _0xed1cd0=_0x308c47[_0x49f101];var _0x57bc12=_0x308c47[_0x24f5a1['dialTimezone']];if(!_['isNil'](_0xed1cd0)&&!_[_0x01db('0x1d')](_0x57bc12)){var _0x544dce=_0xed1cd0[_0x01db('0x22')]-_0x57bc12[_0x01db('0x22')];_0x27727b=_0x24f5a1[_0x01db('0x1a')]?_0x24f5a1[_0x01db('0x1a')]:moment();var _0x30bdd7=moment(_0x27727b)[_0x01db('0x23')](_0x544dce,'minutes');_0x215c6b({'ret':_0x30bdd7[_0x01db('0x1b')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x215c6b({'ret':_0x27727b});}else _0x215c6b({'ret':_0x27727b});}else{_0x215c6b({'ret':_0x27727b});}});}});return 0xa;}var _0x4554bb=function(_0x11a483){return new BPromise(function(_0x2f2c78,_0x19b337){_0x37785b(_0x11a483,_0x3caaf9)[_0x01db('0x20')](function(_0x502758){_0x3caaf9[_0x01db('0x1a')]=_0x502758[_0x01db('0x24')];_0x1aca29['CmHopper'][_0x01db('0x1f')]({'where':{'phone':_0x3caaf9[_0x01db('0xc')],'VoiceQueueId':_0x11a483['id']}})[_0x01db('0x20')](function(_0x450aae){if(!_['isNil'](_0x450aae)){throw new Error(_0x01db('0x25')+_0x3caaf9[_0x01db('0xc')]+_0x01db('0x26')+_0x11a483['id']);}return _0x1aca29[_0x01db('0x27')][_0x01db('0x28')]({'phone':_0x3caaf9[_0x01db('0xc')],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9[_0x01db('0x29')],'priority':_0x3caaf9[_0x01db('0x2a')]?_0x3caaf9[_0x01db('0x2a')]:0x2,'scheduledat':_0x3caaf9[_0x01db('0x1a')]?_0x3caaf9['scheduledat']:moment()['format'](_0x01db('0x1c')),'callback':_0x3caaf9[_0x01db('0x2b')]?!![]:![],'callbackuniqueid':_0x3caaf9[_0x01db('0x2b')]?_0x3caaf9[_0x01db('0x2b')]:undefined,'callbackat':_0x3caaf9[_0x01db('0x2b')]?moment()[_0x01db('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x11a483['id']});})['catch'](function(_0x3101da){_0x19b337(_0x3101da);});});});};var _0x49c17c=function(_0x5c37d2){return new BPromise(function(_0x212d27,_0x11fe32){_0x37785b(_0x5c37d2,_0x3caaf9)[_0x01db('0x20')](function(_0x480b6a){_0x3caaf9[_0x01db('0x1a')]=_0x480b6a[_0x01db('0x24')];_0x1aca29[_0x01db('0x27')][_0x01db('0x1f')]({'where':{'phone':_0x3caaf9[_0x01db('0xc')],'VoiceQueueId':_0x5c37d2['id']}})['then'](function(_0x1f7ec4){if(!_[_0x01db('0x1d')](_0x1f7ec4)){throw new Error(_0x01db('0x25')+_0x3caaf9[_0x01db('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5c37d2['id']);}return _0x1aca29[_0x01db('0x2c')][_0x01db('0x1f')]({'where':{'calleridnum':_0x3caaf9['phone'],'VoiceQueueId':_0x5c37d2['id']}});})[_0x01db('0x20')](function(_0x5df2d6){if(!_[_0x01db('0x1d')](_0x5df2d6)){throw new Error(_0x01db('0x2d')+_0x3caaf9[_0x01db('0xc')]+_0x01db('0x2e')+_0x5c37d2['id']);}return _0x1aca29[_0x01db('0x27')][_0x01db('0x28')]({'phone':_0x3caaf9[_0x01db('0xc')],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9[_0x01db('0x29')],'priority':_0x3caaf9['priority']?_0x3caaf9[_0x01db('0x2a')]:0x2,'scheduledat':_0x3caaf9[_0x01db('0x1a')]?_0x3caaf9[_0x01db('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3caaf9[_0x01db('0x2b')]?!![]:![],'callbackuniqueid':_0x3caaf9['callbackUniqueid']?_0x3caaf9['callbackUniqueid']:undefined,'callbackat':_0x3caaf9[_0x01db('0x2b')]?moment()[_0x01db('0x1b')](_0x01db('0x1c')):undefined,'VoiceQueueId':_0x5c37d2['id']});})[_0x01db('0x2f')](function(_0x1b5861){_0x11fe32(_0x1b5861);});});});};function _0x18c676(){return function(_0x515f74){logger[_0x01db('0x16')](_0x01db('0x17'),_0x01db('0x18'),util[_0x01db('0x19')](_0x515f74,{'showHidden':![],'depth':null}));};}function _0x5dafcc(_0x326abc,_0x2d9a5d){var _0x37edbf=_0x2d9a5d[_0x01db('0x1a')]?_0x2d9a5d[_0x01db('0x1a')]:moment()[_0x01db('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x5f3750,_0x37a64e){if(_[_0x01db('0x1d')](_0x2d9a5d[_0x01db('0x1e')])){_0x5f3750({'ret':_0x37edbf});}else{_0x1aca29['Campaign']['findOne']({'where':{'id':_0x326abc['id']}})[_0x01db('0x20')](function(_0x2f208b){if(!_['isNil'](_0x2f208b)){var _0x15e907=_0x2f208b[_0x01db('0x1e')];if(!_[_0x01db('0x1d')](_0x15e907)){var _0x4fe4c6=shared['timezones'];var _0x6da1b2=_0x4fe4c6[_0x15e907];var _0x222900=_0x4fe4c6[_0x2d9a5d[_0x01db('0x1e')]];if(!_[_0x01db('0x1d')](_0x6da1b2)&&!_[_0x01db('0x1d')](_0x222900)){var _0x556fa3=_0x6da1b2[_0x01db('0x22')]-_0x222900[_0x01db('0x22')];_0x37edbf=_0x2d9a5d[_0x01db('0x1a')]?_0x2d9a5d[_0x01db('0x1a')]:moment();var _0x2d630e=moment(_0x37edbf)[_0x01db('0x23')](_0x556fa3,_0x01db('0x30'));_0x5f3750({'ret':_0x2d630e['format'](_0x01db('0x1c'))});}else _0x5f3750({'ret':_0x37edbf});}else _0x5f3750({'ret':_0x37edbf});}else{_0x5f3750({'ret':_0x37edbf});}});}});return 0xa;}var _0x8e7102=function(_0x3199d0){return new BPromise(function(_0x4b4f44,_0x3d2e8b){_0x5dafcc(_0x3199d0,_0x3caaf9)[_0x01db('0x20')](function(_0x2bf4e4){_0x3caaf9['scheduledat']=_0x2bf4e4[_0x01db('0x24')];_0x1aca29[_0x01db('0x27')][_0x01db('0x1f')]({'where':{'phone':_0x3caaf9[_0x01db('0xc')],'CampaignId':_0x3199d0['id']}})['then'](function(_0x14a4ac){if(!_[_0x01db('0x1d')](_0x14a4ac)){throw new Error(_0x01db('0x25')+_0x3caaf9[_0x01db('0xc')]+_0x01db('0x31')+_0x3199d0['id']);}return _0x1aca29[_0x01db('0x27')][_0x01db('0x28')]({'phone':_0x3caaf9[_0x01db('0xc')],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9['ListId'],'priority':_0x3caaf9['priority']?_0x3caaf9['priority']:0x2,'scheduledat':_0x3caaf9[_0x01db('0x1a')]?_0x3caaf9[_0x01db('0x1a')]:moment()[_0x01db('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3caaf9[_0x01db('0x2b')]?!![]:![],'callbackuniqueid':_0x3caaf9[_0x01db('0x2b')]?_0x3caaf9[_0x01db('0x2b')]:undefined,'callbackat':_0x3caaf9[_0x01db('0x2b')]?moment()[_0x01db('0x1b')](_0x01db('0x1c')):undefined,'CampaignId':_0x3199d0['id']});})[_0x01db('0x2f')](function(_0x2a89b9){_0x3d2e8b(_0x2a89b9);});});});};var _0x5a10b6=function(_0x95868f){return new BPromise(function(_0x1df6df,_0x1db1d6){_0x5dafcc(_0x95868f,_0x3caaf9)[_0x01db('0x20')](function(_0x281ea6){_0x3caaf9[_0x01db('0x1a')]=_0x281ea6[_0x01db('0x24')];_0x1aca29['CmHopper']['findOne']({'where':{'phone':_0x3caaf9[_0x01db('0xc')],'CampaignId':_0x95868f['id']}})['then'](function(_0x464913){if(!_[_0x01db('0x1d')](_0x464913)){throw new Error(_0x01db('0x25')+_0x3caaf9[_0x01db('0xc')]+_0x01db('0x32')+_0x95868f['id']);}return _0x1aca29['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x3caaf9['phone'],'CampaignId':_0x95868f['id']}});})[_0x01db('0x20')](function(_0x2e4657){if(!_[_0x01db('0x1d')](_0x2e4657)){throw new Error(_0x01db('0x2d')+_0x3caaf9[_0x01db('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x95868f['id']);}return _0x1aca29[_0x01db('0x27')][_0x01db('0x28')]({'phone':_0x3caaf9['phone'],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9[_0x01db('0x29')],'priority':_0x3caaf9[_0x01db('0x2a')]?_0x3caaf9[_0x01db('0x2a')]:0x2,'scheduledat':_0x3caaf9[_0x01db('0x1a')]?_0x3caaf9[_0x01db('0x1a')]:moment()[_0x01db('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3caaf9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3caaf9[_0x01db('0x2b')]?_0x3caaf9['callbackUniqueid']:undefined,'callbackat':_0x3caaf9['callbackUniqueid']?moment()[_0x01db('0x1b')](_0x01db('0x1c')):undefined,'CampaignId':_0x95868f['id']});})[_0x01db('0x2f')](function(_0x34267e){_0x1db1d6(_0x34267e);});});});};if(_0x3caaf9['ListId']){_0x1aca29[_0x01db('0x33')][_0x01db('0x34')]({'where':{'type':_0x01db('0x35')},'attributes':['id',_0x01db('0x36'),_0x01db('0x1e')],'include':[{'model':_0x1aca29[_0x01db('0x37')],'as':_0x01db('0x38'),'where':{'id':_0x3caaf9[_0x01db('0x29')]}}]})[_0x01db('0x20')](function(_0x4e674e){if(_0x4e674e){var _0x37d36e=[];for(var _0x232dc5=0x0,_0xf2d0ad;_0x232dc5<_0x4e674e[_0x01db('0x39')];_0x232dc5+=0x1){_0xf2d0ad=_0x4e674e[_0x232dc5]['get']({'plain':!![]});switch(_0xf2d0ad['dialCheckDuplicateType']){case _0x01db('0x3a'):_0x49c17c(_0xf2d0ad)[_0x01db('0x2f')](_0x5dbafb());break;case'onlyIfOpen':_0x4554bb(_0xf2d0ad)[_0x01db('0x2f')](_0x5dbafb());break;default:_0x5dafcc(_0xf2d0ad,_0x3caaf9)['then'](function(_0x1c4ce6){_0x3caaf9[_0x01db('0x1a')]=_0x1c4ce6['ret'];_0x1aca29[_0x01db('0x27')][_0x01db('0x28')]({'phone':_0x3caaf9['phone'],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9[_0x01db('0x29')],'scheduledat':_0x3caaf9['scheduledat']?_0x3caaf9[_0x01db('0x1a')]:moment()[_0x01db('0x1b')](_0x01db('0x1c')),'priority':_0x3caaf9[_0x01db('0x2a')]?_0x3caaf9[_0x01db('0x2a')]:0x2,'callback':_0x3caaf9[_0x01db('0x2b')]?!![]:![],'callbackuniqueid':_0x3caaf9[_0x01db('0x2b')]?_0x3caaf9[_0x01db('0x2b')]:undefined,'callbackat':_0x3caaf9['callbackUniqueid']?moment()[_0x01db('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xf2d0ad['id']})[_0x01db('0x2f')](_0x5dbafb());});}}}})[_0x01db('0x20')](function(){return _0x1aca29[_0x01db('0x33')][_0x01db('0x34')]({'where':{'type':_0x01db('0x35')},'attributes':['id'],'include':[{'model':_0x1aca29[_0x01db('0x37')],'as':_0x01db('0x3b'),'where':{'id':_0x3caaf9[_0x01db('0x29')]}}]})[_0x01db('0x20')](function(_0x231c32){if(_0x231c32){var _0x333b74=[];for(var _0x25a9bf=0x0,_0x25109c;_0x25a9bf<_0x231c32[_0x01db('0x39')];_0x25a9bf+=0x1){_0x25109c=_0x231c32[_0x25a9bf][_0x01db('0x15')]({'plain':!![]});_0x1aca29[_0x01db('0x3c')][_0x01db('0x28')]({'phone':_0x3caaf9[_0x01db('0xc')],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9['ListId'],'VoiceQueueId':_0x25109c['id']})[_0x01db('0x2f')](function(_0x32c5ba){logger[_0x01db('0x16')]('cmContact,\x20%s,\x20%s',_0x01db('0x18'),_0x32c5ba[_0x01db('0x3d')]);});}}});})[_0x01db('0x20')](function(){return _0x1aca29[_0x01db('0x3e')][_0x01db('0x34')]({'attributes':['id',_0x01db('0x36'),'dialTimezone'],'include':[{'model':_0x1aca29['CmList'],'as':'Lists','where':{'id':_0x3caaf9[_0x01db('0x29')]}}]})['then'](function(_0x364af9){if(_0x364af9){var _0x317c21=[];for(var _0x5cede2=0x0,_0x2c6e21;_0x5cede2<_0x364af9[_0x01db('0x39')];_0x5cede2+=0x1){_0x2c6e21=_0x364af9[_0x5cede2][_0x01db('0x15')]({'plain':!![]});switch(_0x2c6e21['dialCheckDuplicateType']){case'always':_0x5a10b6(_0x2c6e21)[_0x01db('0x2f')](_0x18c676());break;case _0x01db('0x3f'):_0x8e7102(_0x2c6e21)[_0x01db('0x2f')](_0x18c676());break;default:_0x1aca29[_0x01db('0x27')][_0x01db('0x28')]({'phone':_0x3caaf9[_0x01db('0xc')],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9['ListId'],'scheduledat':_0x3caaf9[_0x01db('0x1a')]?_0x3caaf9[_0x01db('0x1a')]:moment()[_0x01db('0x1b')](_0x01db('0x1c')),'priority':_0x3caaf9['priority']?_0x3caaf9[_0x01db('0x2a')]:0x2,'callback':_0x3caaf9[_0x01db('0x2b')]?!![]:![],'callbackuniqueid':_0x3caaf9['callbackUniqueid']?_0x3caaf9[_0x01db('0x2b')]:undefined,'callbackat':_0x3caaf9[_0x01db('0x2b')]?moment()[_0x01db('0x1b')](_0x01db('0x1c')):undefined,'CampaignId':_0x2c6e21['id']})[_0x01db('0x2f')](_0x18c676());}}}});})[_0x01db('0x20')](function(){return _0x1aca29['Campaign'][_0x01db('0x34')]({'attributes':['id'],'include':[{'model':_0x1aca29[_0x01db('0x37')],'as':_0x01db('0x3b'),'where':{'id':_0x3caaf9[_0x01db('0x29')]}}]})[_0x01db('0x20')](function(_0x22c100){if(_0x22c100){var _0x379f52=[];for(var _0x4a274b=0x0,_0x5f40ae;_0x4a274b<_0x22c100['length'];_0x4a274b+=0x1){_0x5f40ae=_0x22c100[_0x4a274b]['get']({'plain':!![]});_0x1aca29[_0x01db('0x3c')]['create']({'phone':_0x3caaf9[_0x01db('0xc')],'ContactId':_0x3caaf9['id'],'ListId':_0x3caaf9['ListId'],'CampaignId':_0x5f40ae['id']})['catch'](function(_0x26ae2d){logger['error'](_0x01db('0x40'),_0x01db('0x18'),_0x26ae2d[_0x01db('0x3d')]);});}}});})[_0x01db('0x20')](function(){_0x368f60();})[_0x01db('0x2f')](function(_0x2a736d){logger[_0x01db('0x16')](_0x01db('0x40'),'afterCreate',_0x2a736d[_0x01db('0x3d')]);_0x368f60(_0x2a736d);});}else{_0x368f60(new Error(_0x01db('0x41')));}},'afterDestroy':function(_0xbd5032,_0x42052c,_0x539c5d){var _0x42e721=_0x53ee69[_0x01db('0x14')];var _0x449dcb=_0xbd5032['get']({'plain':!![]});return _0x42e721['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x449dcb[_0x01db('0x29')],'ContactId':_0x449dcb['id']}})[_0x01db('0x20')](function(_0xcfafe6){if(!_[_0x01db('0x42')](_0xcfafe6)){var _0x4cbc9f=[];for(var _0x3d3b76=0x0;_0x3d3b76<_0xcfafe6[_0x01db('0x39')];_0x3d3b76+=0x1){var _0x324662=_0x42e721['CmHopper'][_0x01db('0x43')]({'where':{'ListId':_0xcfafe6[_0x3d3b76][_0x01db('0x29')],'ContactId':_0xcfafe6[_0x3d3b76][_0x01db('0x44')],'VoiceQueueId':_0xcfafe6[_0x3d3b76][_0x01db('0x45')],'CampaignId':_0xcfafe6[_0x3d3b76]['CampaignId']}});_0x4cbc9f['push'](_0x324662);}return BPromise[_0x01db('0x46')](_0x4cbc9f);}})[_0x01db('0x20')](function(_0x35730f){logger[_0x01db('0x47')](_0x01db('0x48'),util['inspect'](_0x35730f,{'showHidden':![],'depth':null}));_0x539c5d();})[_0x01db('0x2f')](function(_0x3e4a29){logger['error']('[CmContact][afterDestroy][Error]',util['inspect'](_0x3e4a29,{'showHidden':![],'depth':null}));_0x539c5d(_0x3e4a29);});}}});};
\ No newline at end of file
+var _0x066d=['List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','format','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','CmList','BlackLists','get','CmHopperBlack','cmContact,\x20%s,\x20%s','message'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x066d,0x13d));var _0xd066=function(_0x417094,_0x37fb9c){_0x417094=_0x417094-0x0;var _0x4b3f71=_0x066d[_0x417094];return _0x4b3f71;};'use strict';var _=require(_0xd066('0x0'));var util=require(_0xd066('0x1'));var logger=require(_0xd066('0x2'))(_0xd066('0x3'));var moment=require(_0xd066('0x4'));var BPromise=require(_0xd066('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd066('0x6'));var rimraf=require(_0xd066('0x7'));var config=require(_0xd066('0x8'));var shared=require(_0xd066('0x9'));var attributes=require(_0xd066('0xa'));module[_0xd066('0xb')]=function(_0x35a51a,_0x12f221){return _0x35a51a[_0xd066('0xc')](_0xd066('0xd'),attributes,{'tableName':_0xd066('0xe'),'paranoid':!![],'indexes':[{'name':_0xd066('0xf'),'fields':[_0xd066('0xf')]},{'name':_0xd066('0x10'),'fields':[_0xd066('0x11'),_0xd066('0x12'),_0xd066('0xf'),_0xd066('0x13'),'fax',_0xd066('0x14')],'type':_0xd066('0x15')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xd066('0x16'),'hooks':{'afterCreate':function(_0x38cdd0,_0x50d48b,_0x2d3f62){var _0xc150a4=_0x35a51a[_0xd066('0x17')];var _0x3b864a=_0x38cdd0['get']({'plain':!![]});function _0x1daf97(){return function(_0x5bbdd0){logger[_0xd066('0x18')](_0xd066('0x19'),_0xd066('0x1a'),util[_0xd066('0x1b')](_0x5bbdd0,{'showHidden':![],'depth':null}));};}function _0x3b3501(_0x14d873,_0x44bd31){var _0x594ac8=_0x44bd31[_0xd066('0x1c')]?_0x44bd31[_0xd066('0x1c')]:moment()['format'](_0xd066('0x1d'));return new BPromise(function(_0x54a1f8,_0x18891c){if(_[_0xd066('0x1e')](_0x44bd31[_0xd066('0x1f')])){_0x54a1f8({'ret':_0x594ac8});}else{_0xc150a4[_0xd066('0x20')][_0xd066('0x21')]({'where':{'id':_0x14d873['id']}})[_0xd066('0x22')](function(_0x5a9ad3){if(!_['isNil'](_0x5a9ad3)){var _0x3a430c=_0x5a9ad3[_0xd066('0x1f')];if(!_[_0xd066('0x1e')](_0x3a430c)){var _0xc1c194=shared[_0xd066('0x23')];var _0x50c915=_0xc1c194[_0x3a430c];var _0x50d59b=_0xc1c194[_0x44bd31[_0xd066('0x1f')]];if(!_['isNil'](_0x50c915)&&!_[_0xd066('0x1e')](_0x50d59b)){var _0x4ed70e=_0x50c915[_0xd066('0x24')]-_0x50d59b['utcOffset'];_0x594ac8=_0x44bd31[_0xd066('0x1c')]?_0x44bd31['scheduledat']:moment();var _0x595a20=moment(_0x594ac8)['add'](_0x4ed70e,_0xd066('0x25'));_0x54a1f8({'ret':_0x595a20[_0xd066('0x26')](_0xd066('0x1d'))});}else _0x54a1f8({'ret':_0x594ac8});}else _0x54a1f8({'ret':_0x594ac8});}else{_0x54a1f8({'ret':_0x594ac8});}});}});return 0xa;}var _0x354b62=function(_0x1fbda6){return new BPromise(function(_0x425786,_0x5ab05e){_0x3b3501(_0x1fbda6,_0x3b864a)[_0xd066('0x22')](function(_0x2841f5){_0x3b864a[_0xd066('0x1c')]=_0x2841f5[_0xd066('0x27')];_0xc150a4['CmHopper'][_0xd066('0x21')]({'where':{'phone':_0x3b864a[_0xd066('0xf')],'VoiceQueueId':_0x1fbda6['id']}})[_0xd066('0x22')](function(_0x2c7133){if(!_[_0xd066('0x1e')](_0x2c7133)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3b864a[_0xd066('0xf')]+_0xd066('0x28')+_0x1fbda6['id']);}return _0xc150a4[_0xd066('0x29')]['create']({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a[_0xd066('0x2a')],'priority':_0x3b864a[_0xd066('0x2b')]?_0x3b864a[_0xd066('0x2b')]:0x2,'scheduledat':_0x3b864a[_0xd066('0x1c')]?_0x3b864a[_0xd066('0x1c')]:moment()[_0xd066('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3b864a[_0xd066('0x2c')]?!![]:![],'callbackuniqueid':_0x3b864a[_0xd066('0x2c')]?_0x3b864a[_0xd066('0x2c')]:undefined,'callbackat':_0x3b864a[_0xd066('0x2c')]?moment()[_0xd066('0x26')](_0xd066('0x1d')):undefined,'VoiceQueueId':_0x1fbda6['id']});})[_0xd066('0x2d')](function(_0x2f812e){_0x5ab05e(_0x2f812e);});});});};var _0x27a7db=function(_0x1a187e){return new BPromise(function(_0x48f0e6,_0x431985){_0x3b3501(_0x1a187e,_0x3b864a)['then'](function(_0x3dc820){_0x3b864a[_0xd066('0x1c')]=_0x3dc820[_0xd066('0x27')];_0xc150a4['CmHopper'][_0xd066('0x21')]({'where':{'phone':_0x3b864a[_0xd066('0xf')],'VoiceQueueId':_0x1a187e['id']}})[_0xd066('0x22')](function(_0x20f1a1){if(!_[_0xd066('0x1e')](_0x20f1a1)){throw new Error(_0xd066('0x2e')+_0x3b864a['phone']+_0xd066('0x2f')+_0x1a187e['id']);}return _0xc150a4[_0xd066('0x30')][_0xd066('0x21')]({'where':{'calleridnum':_0x3b864a[_0xd066('0xf')],'VoiceQueueId':_0x1a187e['id']}});})[_0xd066('0x22')](function(_0x35dbc3){if(!_['isNil'](_0x35dbc3)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3b864a['phone']+_0xd066('0x31')+_0x1a187e['id']);}return _0xc150a4[_0xd066('0x29')][_0xd066('0x32')]({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a['ListId'],'priority':_0x3b864a[_0xd066('0x2b')]?_0x3b864a[_0xd066('0x2b')]:0x2,'scheduledat':_0x3b864a[_0xd066('0x1c')]?_0x3b864a[_0xd066('0x1c')]:moment()['format'](_0xd066('0x1d')),'callback':_0x3b864a[_0xd066('0x2c')]?!![]:![],'callbackuniqueid':_0x3b864a[_0xd066('0x2c')]?_0x3b864a[_0xd066('0x2c')]:undefined,'callbackat':_0x3b864a['callbackUniqueid']?moment()[_0xd066('0x26')](_0xd066('0x1d')):undefined,'VoiceQueueId':_0x1a187e['id']});})[_0xd066('0x2d')](function(_0x1a1bab){_0x431985(_0x1a1bab);});});});};function _0x1f1f0a(){return function(_0x310f4f){logger[_0xd066('0x18')](_0xd066('0x19'),_0xd066('0x1a'),util[_0xd066('0x1b')](_0x310f4f,{'showHidden':![],'depth':null}));};}function _0x1a15b9(_0x60303d,_0xa7ccb){var _0x765778=_0xa7ccb[_0xd066('0x1c')]?_0xa7ccb[_0xd066('0x1c')]:moment()[_0xd066('0x26')](_0xd066('0x1d'));return new BPromise(function(_0x4c92f1,_0xee25c1){if(_[_0xd066('0x1e')](_0xa7ccb[_0xd066('0x1f')])){_0x4c92f1({'ret':_0x765778});}else{_0xc150a4[_0xd066('0x33')][_0xd066('0x21')]({'where':{'id':_0x60303d['id']}})[_0xd066('0x22')](function(_0x3554e9){if(!_[_0xd066('0x1e')](_0x3554e9)){var _0x2e1258=_0x3554e9[_0xd066('0x1f')];if(!_['isNil'](_0x2e1258)){var _0x31c1da=shared[_0xd066('0x23')];var _0x8579ea=_0x31c1da[_0x2e1258];var _0x14596a=_0x31c1da[_0xa7ccb[_0xd066('0x1f')]];if(!_[_0xd066('0x1e')](_0x8579ea)&&!_[_0xd066('0x1e')](_0x14596a)){var _0x2db170=_0x8579ea[_0xd066('0x24')]-_0x14596a[_0xd066('0x24')];_0x765778=_0xa7ccb['scheduledat']?_0xa7ccb[_0xd066('0x1c')]:moment();var _0x1a1996=moment(_0x765778)['add'](_0x2db170,_0xd066('0x25'));_0x4c92f1({'ret':_0x1a1996['format'](_0xd066('0x1d'))});}else _0x4c92f1({'ret':_0x765778});}else _0x4c92f1({'ret':_0x765778});}else{_0x4c92f1({'ret':_0x765778});}});}});return 0xa;}var _0x79873d=function(_0x3e6c58){return new BPromise(function(_0x5a19c5,_0x254ac9){_0x1a15b9(_0x3e6c58,_0x3b864a)['then'](function(_0x4bbba5){_0x3b864a[_0xd066('0x1c')]=_0x4bbba5['ret'];_0xc150a4[_0xd066('0x29')][_0xd066('0x21')]({'where':{'phone':_0x3b864a[_0xd066('0xf')],'CampaignId':_0x3e6c58['id']}})[_0xd066('0x22')](function(_0x31d02d){if(!_['isNil'](_0x31d02d)){throw new Error(_0xd066('0x2e')+_0x3b864a[_0xd066('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3e6c58['id']);}return _0xc150a4[_0xd066('0x29')]['create']({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a[_0xd066('0x2a')],'priority':_0x3b864a[_0xd066('0x2b')]?_0x3b864a['priority']:0x2,'scheduledat':_0x3b864a[_0xd066('0x1c')]?_0x3b864a[_0xd066('0x1c')]:moment()[_0xd066('0x26')](_0xd066('0x1d')),'callback':_0x3b864a[_0xd066('0x2c')]?!![]:![],'callbackuniqueid':_0x3b864a[_0xd066('0x2c')]?_0x3b864a[_0xd066('0x2c')]:undefined,'callbackat':_0x3b864a['callbackUniqueid']?moment()[_0xd066('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3e6c58['id']});})[_0xd066('0x2d')](function(_0x3c8920){_0x254ac9(_0x3c8920);});});});};var _0x509ddf=function(_0x11901b){return new BPromise(function(_0x18676d,_0x4535da){_0x1a15b9(_0x11901b,_0x3b864a)[_0xd066('0x22')](function(_0x34ffe6){_0x3b864a[_0xd066('0x1c')]=_0x34ffe6[_0xd066('0x27')];_0xc150a4['CmHopper'][_0xd066('0x21')]({'where':{'phone':_0x3b864a[_0xd066('0xf')],'CampaignId':_0x11901b['id']}})[_0xd066('0x22')](function(_0x46e51f){if(!_[_0xd066('0x1e')](_0x46e51f)){throw new Error(_0xd066('0x2e')+_0x3b864a[_0xd066('0xf')]+_0xd066('0x34')+_0x11901b['id']);}return _0xc150a4[_0xd066('0x30')][_0xd066('0x21')]({'where':{'calleridnum':_0x3b864a['phone'],'CampaignId':_0x11901b['id']}});})[_0xd066('0x22')](function(_0x51b237){if(!_[_0xd066('0x1e')](_0x51b237)){throw new Error(_0xd066('0x35')+_0x3b864a[_0xd066('0xf')]+_0xd066('0x36')+_0x11901b['id']);}return _0xc150a4['CmHopper'][_0xd066('0x32')]({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a[_0xd066('0x2a')],'priority':_0x3b864a[_0xd066('0x2b')]?_0x3b864a[_0xd066('0x2b')]:0x2,'scheduledat':_0x3b864a['scheduledat']?_0x3b864a[_0xd066('0x1c')]:moment()[_0xd066('0x26')](_0xd066('0x1d')),'callback':_0x3b864a[_0xd066('0x2c')]?!![]:![],'callbackuniqueid':_0x3b864a[_0xd066('0x2c')]?_0x3b864a[_0xd066('0x2c')]:undefined,'callbackat':_0x3b864a[_0xd066('0x2c')]?moment()[_0xd066('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x11901b['id']});})['catch'](function(_0x32b79f){_0x4535da(_0x32b79f);});});});};if(_0x3b864a[_0xd066('0x2a')]){_0xc150a4['VoiceQueue'][_0xd066('0x37')]({'where':{'type':_0xd066('0x38')},'attributes':['id','dialCheckDuplicateType',_0xd066('0x1f')],'include':[{'model':_0xc150a4['CmList'],'as':_0xd066('0x39'),'where':{'id':_0x3b864a[_0xd066('0x2a')]}}]})['then'](function(_0x5d2d7c){if(_0x5d2d7c){var _0x41e2b2=[];for(var _0x4f8388=0x0,_0x41777b;_0x4f8388<_0x5d2d7c[_0xd066('0x3a')];_0x4f8388+=0x1){_0x41777b=_0x5d2d7c[_0x4f8388]['get']({'plain':!![]});switch(_0x41777b[_0xd066('0x3b')]){case _0xd066('0x3c'):_0x27a7db(_0x41777b)[_0xd066('0x2d')](_0x1daf97());break;case _0xd066('0x3d'):_0x354b62(_0x41777b)[_0xd066('0x2d')](_0x1daf97());break;default:_0x1a15b9(_0x41777b,_0x3b864a)[_0xd066('0x22')](function(_0x5633eb){_0x3b864a['scheduledat']=_0x5633eb[_0xd066('0x27')];_0xc150a4['CmHopper'][_0xd066('0x32')]({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a[_0xd066('0x2a')],'scheduledat':_0x3b864a[_0xd066('0x1c')]?_0x3b864a[_0xd066('0x1c')]:moment()[_0xd066('0x26')](_0xd066('0x1d')),'priority':_0x3b864a[_0xd066('0x2b')]?_0x3b864a[_0xd066('0x2b')]:0x2,'callback':_0x3b864a[_0xd066('0x2c')]?!![]:![],'callbackuniqueid':_0x3b864a[_0xd066('0x2c')]?_0x3b864a[_0xd066('0x2c')]:undefined,'callbackat':_0x3b864a[_0xd066('0x2c')]?moment()['format'](_0xd066('0x1d')):undefined,'VoiceQueueId':_0x41777b['id']})['catch'](_0x1daf97());});}}}})[_0xd066('0x22')](function(){return _0xc150a4['VoiceQueue']['findAll']({'where':{'type':_0xd066('0x38')},'attributes':['id'],'include':[{'model':_0xc150a4[_0xd066('0x3e')],'as':_0xd066('0x3f'),'where':{'id':_0x3b864a[_0xd066('0x2a')]}}]})['then'](function(_0x574138){if(_0x574138){var _0x2deec3=[];for(var _0x4015b4=0x0,_0x32f30d;_0x4015b4<_0x574138[_0xd066('0x3a')];_0x4015b4+=0x1){_0x32f30d=_0x574138[_0x4015b4][_0xd066('0x40')]({'plain':!![]});_0xc150a4[_0xd066('0x41')][_0xd066('0x32')]({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a[_0xd066('0x2a')],'VoiceQueueId':_0x32f30d['id']})['catch'](function(_0x15b3f6){logger[_0xd066('0x18')](_0xd066('0x42'),_0xd066('0x1a'),_0x15b3f6['message']);});}}});})[_0xd066('0x22')](function(){return _0xc150a4[_0xd066('0x33')][_0xd066('0x37')]({'attributes':['id',_0xd066('0x3b'),_0xd066('0x1f')],'include':[{'model':_0xc150a4[_0xd066('0x3e')],'as':_0xd066('0x39'),'where':{'id':_0x3b864a[_0xd066('0x2a')]}}]})[_0xd066('0x22')](function(_0x50fb83){if(_0x50fb83){var _0x5bb03d=[];for(var _0x47a8ff=0x0,_0x23f15c;_0x47a8ff<_0x50fb83[_0xd066('0x3a')];_0x47a8ff+=0x1){_0x23f15c=_0x50fb83[_0x47a8ff][_0xd066('0x40')]({'plain':!![]});switch(_0x23f15c[_0xd066('0x3b')]){case _0xd066('0x3c'):_0x509ddf(_0x23f15c)[_0xd066('0x2d')](_0x1f1f0a());break;case _0xd066('0x3d'):_0x79873d(_0x23f15c)[_0xd066('0x2d')](_0x1f1f0a());break;default:_0xc150a4[_0xd066('0x29')]['create']({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a['ListId'],'scheduledat':_0x3b864a[_0xd066('0x1c')]?_0x3b864a['scheduledat']:moment()[_0xd066('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x3b864a[_0xd066('0x2b')]?_0x3b864a['priority']:0x2,'callback':_0x3b864a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3b864a[_0xd066('0x2c')]?_0x3b864a[_0xd066('0x2c')]:undefined,'callbackat':_0x3b864a[_0xd066('0x2c')]?moment()[_0xd066('0x26')](_0xd066('0x1d')):undefined,'CampaignId':_0x23f15c['id']})['catch'](_0x1f1f0a());}}}});})['then'](function(){return _0xc150a4[_0xd066('0x33')][_0xd066('0x37')]({'attributes':['id'],'include':[{'model':_0xc150a4[_0xd066('0x3e')],'as':_0xd066('0x3f'),'where':{'id':_0x3b864a[_0xd066('0x2a')]}}]})['then'](function(_0x3785e0){if(_0x3785e0){var _0x7f7aa3=[];for(var _0x1a3d52=0x0,_0x330135;_0x1a3d52<_0x3785e0[_0xd066('0x3a')];_0x1a3d52+=0x1){_0x330135=_0x3785e0[_0x1a3d52]['get']({'plain':!![]});_0xc150a4['CmHopperBlack']['create']({'phone':_0x3b864a[_0xd066('0xf')],'ContactId':_0x3b864a['id'],'ListId':_0x3b864a[_0xd066('0x2a')],'CampaignId':_0x330135['id']})[_0xd066('0x2d')](function(_0x203eaa){logger['error']('cmContact,\x20%s,\x20%s',_0xd066('0x1a'),_0x203eaa[_0xd066('0x43')]);});}}});})[_0xd066('0x22')](function(){_0x2d3f62();})[_0xd066('0x2d')](function(_0x46d2ef){logger[_0xd066('0x18')](_0xd066('0x42'),_0xd066('0x1a'),_0x46d2ef[_0xd066('0x43')]);_0x2d3f62(_0x46d2ef);});}else{_0x2d3f62(new Error(_0xd066('0x44')));}},'afterDestroy':function(_0x183d1d,_0x446f0b,_0x4d7c96){var _0x6c177=_0x35a51a['models'];var _0x453c1e=_0x183d1d[_0xd066('0x40')]({'plain':!![]});return _0x6c177[_0xd066('0x29')][_0xd066('0x37')]({'raw':!![],'where':{'ListId':_0x453c1e[_0xd066('0x2a')],'ContactId':_0x453c1e['id']}})[_0xd066('0x22')](function(_0x509c78){if(!_[_0xd066('0x45')](_0x509c78)){var _0x453b4c=[];for(var _0x37556d=0x0;_0x37556d<_0x509c78[_0xd066('0x3a')];_0x37556d+=0x1){var _0x749b67=_0x6c177[_0xd066('0x29')][_0xd066('0x46')]({'where':{'ListId':_0x509c78[_0x37556d][_0xd066('0x2a')],'ContactId':_0x509c78[_0x37556d][_0xd066('0x47')],'VoiceQueueId':_0x509c78[_0x37556d]['VoiceQueueId'],'CampaignId':_0x509c78[_0x37556d][_0xd066('0x48')]}});_0x453b4c[_0xd066('0x49')](_0x749b67);}return BPromise[_0xd066('0x4a')](_0x453b4c);}})['then'](function(_0x35081c){logger[_0xd066('0x4b')]('[CmContact][afterDestroy][Succesfull]',util[_0xd066('0x1b')](_0x35081c,{'showHidden':![],'depth':null}));_0x4d7c96();})[_0xd066('0x2d')](function(_0x2d2911){logger['error'](_0xd066('0x4c'),util[_0xd066('0x1b')](_0x2d2911,{'showHidden':![],'depth':null}));_0x4d7c96(_0x2d2911);});}}});};
\ No newline at end of file
index d45f7f0..76029da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x23492e,_0x1de867){var _0x202ff4=function(_0x124ee2){while(--_0x124ee2){_0x23492e['push'](_0x23492e['shift']());}};_0x202ff4(++_0x1de867);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
+var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x14023e,_0x462e82){var _0x25c26f=function(_0x26abb9){while(--_0x26abb9){_0x14023e['push'](_0x14023e['shift']());}};_0x25c26f(++_0x462e82);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
index 7e75511..0905e24 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 d62ccac..3669a52 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(_0xe648dd,_0x3351bb){var _0x14bf72=function(_0x464421){while(--_0x464421){_0xe648dd['push'](_0xe648dd['shift']());}};_0x14bf72(++_0x3351bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x10fa52,_0x55aef1){var _0x15c609=function(_0x4ac6aa){while(--_0x4ac6aa){_0x10fa52['push'](_0x10fa52['shift']());}};_0x15c609(++_0x55aef1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 effc72b..3998479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9a=['STRING','INTEGER','PHONE','exports'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x0a9a,0x183));var _0xa0a9=function(_0x546147,_0x952918){_0x546147=_0x546147-0x0;var _0x116457=_0x0a9a[_0x546147];return _0x116457;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa0a9('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':null}};
\ No newline at end of file
+var _0x6b61=['STRING','PHONE','sequelize','INTEGER'];(function(_0x56c21e,_0x46b403){var _0x43d2f9=function(_0x594cdb){while(--_0x594cdb){_0x56c21e['push'](_0x56c21e['shift']());}};_0x43d2f9(++_0x46b403);}(_0x6b61,0x16a));var _0x16b6=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x6b61[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x16b6('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x16b6('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x16b6('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x16b6('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x16b6('0x2')],'defaultValue':_0x16b6('0x3')},'OrderBy':{'type':Sequelize[_0x16b6('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x16b6('0x2')],'defaultValue':null}};
\ No newline at end of file
index 08b597d..2622fb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe03=['status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','CmContactHasItems','UserProfileResource','destroy','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3f12dd,_0x1ba7ce){var _0x39f35d=function(_0x4eefed){while(--_0x4eefed){_0x3f12dd['push'](_0x3f12dd['shift']());}};_0x39f35d(++_0x1ba7ce);}(_0xbe03,0x8d));var _0x3be0=function(_0x25e7f2,_0x54dd04){_0x25e7f2=_0x25e7f2-0x0;var _0xd47684=_0xbe03[_0x25e7f2];return _0xd47684;};'use strict';var emlformat=require(_0x3be0('0x0'));var rimraf=require(_0x3be0('0x1'));var zipdir=require(_0x3be0('0x2'));var jsonpatch=require(_0x3be0('0x3'));var rp=require(_0x3be0('0x4'));var moment=require(_0x3be0('0x5'));var BPromise=require(_0x3be0('0x6'));var Mustache=require(_0x3be0('0x7'));var util=require(_0x3be0('0x8'));var path=require(_0x3be0('0x9'));var sox=require('sox');var csv=require(_0x3be0('0xa'));var ejs=require(_0x3be0('0xb'));var fs=require('fs');var fs_extra=require(_0x3be0('0xc'));var _=require(_0x3be0('0xd'));var squel=require(_0x3be0('0xe'));var crypto=require(_0x3be0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3be0('0x10'));var toCsv=require(_0x3be0('0xa'));var querystring=require(_0x3be0('0x11'));var Papa=require(_0x3be0('0x12'));var Redis=require(_0x3be0('0x13'));var authService=require(_0x3be0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3be0('0x15'));var hardwareService=require(_0x3be0('0x16'));var logger=require(_0x3be0('0x17'))(_0x3be0('0x18'));var utils=require('../../config/utils');var config=require(_0x3be0('0x19'));var licenseUtil=require(_0x3be0('0x1a'));var db=require(_0x3be0('0x1b'))['db'];function respondWithStatusCode(_0x4ecd4a,_0x24d5d9){_0x24d5d9=_0x24d5d9||0xcc;return function(_0x42d135){if(_0x42d135){return _0x4ecd4a[_0x3be0('0x1c')](_0x24d5d9);}return _0x4ecd4a[_0x3be0('0x1d')](_0x24d5d9)[_0x3be0('0x1e')]();};}function respondWithResult(_0x40496c,_0x555b0d){_0x555b0d=_0x555b0d||0xc8;return function(_0x3cf532){if(_0x3cf532){return _0x40496c[_0x3be0('0x1d')](_0x555b0d)[_0x3be0('0x1f')](_0x3cf532);}};}function respondWithFilteredResult(_0x3af81b,_0x51dfac){return function(_0x1d3b06){if(_0x1d3b06){var _0x3a9f78=typeof _0x51dfac[_0x3be0('0x20')]==='undefined'&&typeof _0x51dfac[_0x3be0('0x21')]===_0x3be0('0x22');var _0x7e2b73=_0x1d3b06['count'];var _0x1764b=_0x3a9f78?0x0:_0x51dfac[_0x3be0('0x20')];var _0xe14427=_0x3a9f78?_0x1d3b06[_0x3be0('0x23')]:_0x51dfac[_0x3be0('0x20')]+_0x51dfac[_0x3be0('0x21')];var _0x863a6e;if(_0xe14427>=_0x7e2b73){_0xe14427=_0x7e2b73;_0x863a6e=0xc8;}else{_0x863a6e=0xce;}_0x3af81b[_0x3be0('0x1d')](_0x863a6e);return _0x3af81b[_0x3be0('0x24')]('Content-Range',_0x1764b+'-'+_0xe14427+'/'+_0x7e2b73)[_0x3be0('0x1f')](_0x1d3b06);}return null;};}function patchUpdates(_0x3d1833){return function(_0x30bb31){try{jsonpatch[_0x3be0('0x25')](_0x30bb31,_0x3d1833,!![]);}catch(_0x4766df){return BPromise[_0x3be0('0x26')](_0x4766df);}return _0x30bb31['save']();};}function saveUpdates(_0x382bab,_0x218c53){return function(_0x55555f){if(_0x55555f){return _0x55555f[_0x3be0('0x27')](_0x382bab)[_0x3be0('0x28')](function(_0x50008b){return _0x50008b;});}return null;};}function removeEntity(_0x30deb2,_0x563989){return function(_0x5229e6){if(_0x5229e6){return _0x5229e6['destroy']()[_0x3be0('0x28')](function(){var _0x375c46=_0x5229e6['get']({'plain':!![]});var _0x4c4e47=_0x3be0('0x29');return db[_0x3be0('0x2a')][_0x3be0('0x2b')]({'where':{'type':_0x4c4e47,'resourceId':_0x375c46['id']}})[_0x3be0('0x28')](function(){return _0x5229e6;});})[_0x3be0('0x28')](function(){_0x30deb2[_0x3be0('0x1d')](0xcc)[_0x3be0('0x1e')]();});}};}function handleEntityNotFound(_0x1e44a5,_0x563e0f){return function(_0x4dd98c){if(!_0x4dd98c){_0x1e44a5['sendStatus'](0x194);}return _0x4dd98c;};}function handleError(_0x4d72f5,_0x2a3540){_0x2a3540=_0x2a3540||0x1f4;return function(_0x80f98a){logger[_0x3be0('0x2c')](_0x80f98a[_0x3be0('0x2d')]);if(_0x80f98a[_0x3be0('0x2e')]){delete _0x80f98a[_0x3be0('0x2e')];}_0x4d72f5[_0x3be0('0x1d')](_0x2a3540)[_0x3be0('0x2f')](_0x80f98a);};}exports[_0x3be0('0x30')]=function(_0x55824d,_0x50674f){var _0x592674={},_0x12b6b6={},_0x341438={'count':0x0,'rows':[]};var _0x19b409=_[_0x3be0('0x31')](db[_0x3be0('0x32')][_0x3be0('0x33')],function(_0x488a5a){return{'name':_0x488a5a[_0x3be0('0x34')],'type':_0x488a5a[_0x3be0('0x35')]['key']};});_0x12b6b6[_0x3be0('0x36')]=_[_0x3be0('0x31')](_0x19b409,'name');_0x12b6b6[_0x3be0('0x37')]=_[_0x3be0('0x38')](_0x55824d['query']);_0x12b6b6[_0x3be0('0x39')]=_[_0x3be0('0x3a')](_0x12b6b6['model'],_0x12b6b6[_0x3be0('0x37')]);_0x592674[_0x3be0('0x3b')]=_[_0x3be0('0x3a')](_0x12b6b6[_0x3be0('0x36')],qs[_0x3be0('0x3c')](_0x55824d[_0x3be0('0x37')][_0x3be0('0x3c')]));_0x592674['attributes']=_0x592674['attributes'][_0x3be0('0x3d')]?_0x592674[_0x3be0('0x3b')]:_0x12b6b6[_0x3be0('0x36')];if(!_0x55824d['query'][_0x3be0('0x3e')](_0x3be0('0x3f'))){_0x592674[_0x3be0('0x21')]=qs['limit'](_0x55824d['query'][_0x3be0('0x21')]);_0x592674[_0x3be0('0x20')]=qs[_0x3be0('0x20')](_0x55824d['query'][_0x3be0('0x20')]);}_0x592674['order']=qs[_0x3be0('0x40')](_0x55824d[_0x3be0('0x37')][_0x3be0('0x40')]);_0x592674[_0x3be0('0x41')]=qs[_0x3be0('0x39')](_[_0x3be0('0x42')](_0x55824d[_0x3be0('0x37')],_0x12b6b6[_0x3be0('0x39')]),_0x19b409);if(_0x55824d[_0x3be0('0x37')][_0x3be0('0x43')]){_0x592674['where']=_[_0x3be0('0x44')](_0x592674[_0x3be0('0x41')],{'$or':_[_0x3be0('0x31')](_0x19b409,function(_0x392f9d){if(_0x392f9d[_0x3be0('0x35')]!=='VIRTUAL'){var _0x5411c7={};_0x5411c7[_0x392f9d[_0x3be0('0x2e')]]={'$like':'%'+_0x55824d[_0x3be0('0x37')][_0x3be0('0x43')]+'%'};return _0x5411c7;}})});}_0x592674=_['merge']({},_0x592674,_0x55824d['options']);var _0x3d3257={'where':_0x592674['where']};return db['CmContactHasItem']['count'](_0x3d3257)[_0x3be0('0x28')](function(_0x52161f){_0x341438[_0x3be0('0x23')]=_0x52161f;if(_0x55824d[_0x3be0('0x37')][_0x3be0('0x45')]){_0x592674['include']=[{'all':!![]}];}return db[_0x3be0('0x32')]['findAll'](_0x592674);})[_0x3be0('0x28')](function(_0xd3c97b){_0x341438[_0x3be0('0x46')]=_0xd3c97b;return _0x341438;})[_0x3be0('0x28')](respondWithFilteredResult(_0x50674f,_0x592674))[_0x3be0('0x47')](handleError(_0x50674f,null));};exports[_0x3be0('0x48')]=function(_0x420f0b,_0x486f25){var _0x1b9a57={'raw':!![],'where':{'id':_0x420f0b[_0x3be0('0x49')]['id']}},_0x105e54={};_0x105e54[_0x3be0('0x36')]=_[_0x3be0('0x38')](db[_0x3be0('0x32')]['rawAttributes']);_0x105e54[_0x3be0('0x37')]=_[_0x3be0('0x38')](_0x420f0b['query']);_0x105e54[_0x3be0('0x39')]=_[_0x3be0('0x3a')](_0x105e54['model'],_0x105e54[_0x3be0('0x37')]);_0x1b9a57['attributes']=_[_0x3be0('0x3a')](_0x105e54[_0x3be0('0x36')],qs[_0x3be0('0x3c')](_0x420f0b[_0x3be0('0x37')][_0x3be0('0x3c')]));_0x1b9a57[_0x3be0('0x3b')]=_0x1b9a57[_0x3be0('0x3b')][_0x3be0('0x3d')]?_0x1b9a57[_0x3be0('0x3b')]:_0x105e54[_0x3be0('0x36')];if(_0x420f0b['query'][_0x3be0('0x45')]){_0x1b9a57[_0x3be0('0x4a')]=[{'all':!![]}];}_0x1b9a57=_[_0x3be0('0x44')]({},_0x1b9a57,_0x420f0b[_0x3be0('0x4b')]);return db[_0x3be0('0x32')][_0x3be0('0x4c')](_0x1b9a57)[_0x3be0('0x28')](handleEntityNotFound(_0x486f25,null))[_0x3be0('0x28')](respondWithResult(_0x486f25,null))[_0x3be0('0x47')](handleError(_0x486f25,null));};exports[_0x3be0('0x4d')]=function(_0x3208fd,_0xac6864){return db[_0x3be0('0x32')][_0x3be0('0x4d')](_0x3208fd['body'],{})['then'](function(_0x3c883b){var _0x425962=_0x3208fd[_0x3be0('0x4e')][_0x3be0('0x4f')]({'plain':!![]});if(!_0x425962)throw new Error(_0x3be0('0x50'));if(_0x425962[_0x3be0('0x51')]===_0x3be0('0x4e')){var _0x68b3c0=_0x3c883b['get']({'plain':!![]});var _0x29415f=_0x3be0('0x29');return db['UserProfileSection'][_0x3be0('0x4c')]({'where':{'name':_0x29415f,'userProfileId':_0x425962[_0x3be0('0x52')]},'raw':!![]})[_0x3be0('0x28')](function(_0x92e50f){if(_0x92e50f&&_0x92e50f[_0x3be0('0x53')]===0x0){return db[_0x3be0('0x2a')][_0x3be0('0x4d')]({'name':_0x68b3c0[_0x3be0('0x2e')],'resourceId':_0x68b3c0['id'],'type':_0x92e50f[_0x3be0('0x2e')],'sectionId':_0x92e50f['id']},{})[_0x3be0('0x28')](function(){return _0x3c883b;});}else{return _0x3c883b;}})[_0x3be0('0x47')](function(_0x558858){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x558858);throw _0x558858;});}return _0x3c883b;})[_0x3be0('0x28')](respondWithResult(_0xac6864,0xc9))[_0x3be0('0x47')](handleError(_0xac6864,null));};exports[_0x3be0('0x27')]=function(_0x391859,_0x2e3565){if(_0x391859['body']['id']){delete _0x391859[_0x3be0('0x54')]['id'];}return db[_0x3be0('0x32')][_0x3be0('0x4c')]({'where':{'id':_0x391859[_0x3be0('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e3565,null))[_0x3be0('0x28')](saveUpdates(_0x391859[_0x3be0('0x54')],null))['then'](respondWithResult(_0x2e3565,null))[_0x3be0('0x47')](handleError(_0x2e3565,null));};exports[_0x3be0('0x2b')]=function(_0xbb013f,_0x1aefe1){return db['CmContactHasItem'][_0x3be0('0x4c')]({'where':{'id':_0xbb013f[_0x3be0('0x49')]['id']}})[_0x3be0('0x28')](handleEntityNotFound(_0x1aefe1,null))[_0x3be0('0x28')](removeEntity(_0x1aefe1,null))[_0x3be0('0x47')](handleError(_0x1aefe1,null));};
\ No newline at end of file
+var _0x0f8d=['rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','reject','save','then','CmContactHasItems','UserProfileResource','error','stack','name','send','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll'];(function(_0x22c78a,_0x7e9473){var _0x24838c=function(_0x42826d){while(--_0x42826d){_0x22c78a['push'](_0x22c78a['shift']());}};_0x24838c(++_0x7e9473);}(_0x0f8d,0x1b9));var _0xd0f8=function(_0x85ad08,_0x511c2a){_0x85ad08=_0x85ad08-0x0;var _0x57746c=_0x0f8d[_0x85ad08];return _0x57746c;};'use strict';var emlformat=require(_0xd0f8('0x0'));var rimraf=require(_0xd0f8('0x1'));var zipdir=require(_0xd0f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0f8('0x3'));var moment=require(_0xd0f8('0x4'));var BPromise=require(_0xd0f8('0x5'));var Mustache=require(_0xd0f8('0x6'));var util=require(_0xd0f8('0x7'));var path=require(_0xd0f8('0x8'));var sox=require(_0xd0f8('0x9'));var csv=require(_0xd0f8('0xa'));var ejs=require(_0xd0f8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0f8('0xc'));var squel=require('squel');var crypto=require(_0xd0f8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd0f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd0f8('0xf'));var Papa=require(_0xd0f8('0x10'));var Redis=require(_0xd0f8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd0f8('0x12'));var hardwareService=require(_0xd0f8('0x13'));var logger=require(_0xd0f8('0x14'))(_0xd0f8('0x15'));var utils=require('../../config/utils');var config=require(_0xd0f8('0x16'));var licenseUtil=require(_0xd0f8('0x17'));var db=require(_0xd0f8('0x18'))['db'];function respondWithStatusCode(_0xc30fae,_0x1ce3c9){_0x1ce3c9=_0x1ce3c9||0xcc;return function(_0x4e58df){if(_0x4e58df){return _0xc30fae[_0xd0f8('0x19')](_0x1ce3c9);}return _0xc30fae['status'](_0x1ce3c9)[_0xd0f8('0x1a')]();};}function respondWithResult(_0x318230,_0x41703b){_0x41703b=_0x41703b||0xc8;return function(_0x1acd5d){if(_0x1acd5d){return _0x318230[_0xd0f8('0x1b')](_0x41703b)[_0xd0f8('0x1c')](_0x1acd5d);}};}function respondWithFilteredResult(_0x860c19,_0x1aa6a0){return function(_0x53f4db){if(_0x53f4db){var _0x46c39d=typeof _0x1aa6a0['offset']==='undefined'&&typeof _0x1aa6a0[_0xd0f8('0x1d')]===_0xd0f8('0x1e');var _0x13ff35=_0x53f4db['count'];var _0x1bd6a0=_0x46c39d?0x0:_0x1aa6a0[_0xd0f8('0x1f')];var _0x51d63c=_0x46c39d?_0x53f4db[_0xd0f8('0x20')]:_0x1aa6a0[_0xd0f8('0x1f')]+_0x1aa6a0[_0xd0f8('0x1d')];var _0x391cf5;if(_0x51d63c>=_0x13ff35){_0x51d63c=_0x13ff35;_0x391cf5=0xc8;}else{_0x391cf5=0xce;}_0x860c19[_0xd0f8('0x1b')](_0x391cf5);return _0x860c19[_0xd0f8('0x21')](_0xd0f8('0x22'),_0x1bd6a0+'-'+_0x51d63c+'/'+_0x13ff35)[_0xd0f8('0x1c')](_0x53f4db);}return null;};}function patchUpdates(_0x2e0c0a){return function(_0x583640){try{jsonpatch['apply'](_0x583640,_0x2e0c0a,!![]);}catch(_0x3280d1){return BPromise[_0xd0f8('0x23')](_0x3280d1);}return _0x583640[_0xd0f8('0x24')]();};}function saveUpdates(_0x4d4c4f,_0x4c7d59){return function(_0x7e5d41){if(_0x7e5d41){return _0x7e5d41['update'](_0x4d4c4f)['then'](function(_0x4bc59c){return _0x4bc59c;});}return null;};}function removeEntity(_0xf883a4,_0x1b17cf){return function(_0x56ec03){if(_0x56ec03){return _0x56ec03['destroy']()[_0xd0f8('0x25')](function(){var _0x18a98d=_0x56ec03['get']({'plain':!![]});var _0x3c1e86=_0xd0f8('0x26');return db[_0xd0f8('0x27')]['destroy']({'where':{'type':_0x3c1e86,'resourceId':_0x18a98d['id']}})[_0xd0f8('0x25')](function(){return _0x56ec03;});})[_0xd0f8('0x25')](function(){_0xf883a4[_0xd0f8('0x1b')](0xcc)[_0xd0f8('0x1a')]();});}};}function handleEntityNotFound(_0x105c95,_0xb35a52){return function(_0x4df692){if(!_0x4df692){_0x105c95[_0xd0f8('0x19')](0x194);}return _0x4df692;};}function handleError(_0x28a283,_0x3bccf6){_0x3bccf6=_0x3bccf6||0x1f4;return function(_0x659090){logger[_0xd0f8('0x28')](_0x659090[_0xd0f8('0x29')]);if(_0x659090['name']){delete _0x659090[_0xd0f8('0x2a')];}_0x28a283[_0xd0f8('0x1b')](_0x3bccf6)[_0xd0f8('0x2b')](_0x659090);};}exports['index']=function(_0x1b720b,_0x48d174){var _0x135872={},_0x1af9e6={},_0x2a58a8={'count':0x0,'rows':[]};var _0x173a3b=_[_0xd0f8('0x2c')](db[_0xd0f8('0x2d')][_0xd0f8('0x2e')],function(_0x242c8e){return{'name':_0x242c8e[_0xd0f8('0x2f')],'type':_0x242c8e[_0xd0f8('0x30')][_0xd0f8('0x31')]};});_0x1af9e6[_0xd0f8('0x32')]=_[_0xd0f8('0x2c')](_0x173a3b,'name');_0x1af9e6[_0xd0f8('0x33')]=_['keys'](_0x1b720b[_0xd0f8('0x33')]);_0x1af9e6[_0xd0f8('0x34')]=_['intersection'](_0x1af9e6[_0xd0f8('0x32')],_0x1af9e6[_0xd0f8('0x33')]);_0x135872[_0xd0f8('0x35')]=_[_0xd0f8('0x36')](_0x1af9e6[_0xd0f8('0x32')],qs[_0xd0f8('0x37')](_0x1b720b['query'][_0xd0f8('0x37')]));_0x135872[_0xd0f8('0x35')]=_0x135872['attributes'][_0xd0f8('0x38')]?_0x135872[_0xd0f8('0x35')]:_0x1af9e6['model'];if(!_0x1b720b['query'][_0xd0f8('0x39')](_0xd0f8('0x3a'))){_0x135872[_0xd0f8('0x1d')]=qs['limit'](_0x1b720b[_0xd0f8('0x33')][_0xd0f8('0x1d')]);_0x135872[_0xd0f8('0x1f')]=qs[_0xd0f8('0x1f')](_0x1b720b['query'][_0xd0f8('0x1f')]);}_0x135872[_0xd0f8('0x3b')]=qs[_0xd0f8('0x3c')](_0x1b720b['query'][_0xd0f8('0x3c')]);_0x135872[_0xd0f8('0x3d')]=qs['filters'](_[_0xd0f8('0x3e')](_0x1b720b[_0xd0f8('0x33')],_0x1af9e6[_0xd0f8('0x34')]),_0x173a3b);if(_0x1b720b[_0xd0f8('0x33')][_0xd0f8('0x3f')]){_0x135872[_0xd0f8('0x3d')]=_[_0xd0f8('0x40')](_0x135872[_0xd0f8('0x3d')],{'$or':_[_0xd0f8('0x2c')](_0x173a3b,function(_0x1d6fe6){if(_0x1d6fe6['type']!=='VIRTUAL'){var _0x2c336b={};_0x2c336b[_0x1d6fe6['name']]={'$like':'%'+_0x1b720b[_0xd0f8('0x33')][_0xd0f8('0x3f')]+'%'};return _0x2c336b;}})});}_0x135872=_[_0xd0f8('0x40')]({},_0x135872,_0x1b720b[_0xd0f8('0x41')]);var _0x380e27={'where':_0x135872[_0xd0f8('0x3d')]};return db[_0xd0f8('0x2d')][_0xd0f8('0x20')](_0x380e27)[_0xd0f8('0x25')](function(_0x2f069f){_0x2a58a8[_0xd0f8('0x20')]=_0x2f069f;if(_0x1b720b['query'][_0xd0f8('0x42')]){_0x135872[_0xd0f8('0x43')]=[{'all':!![]}];}return db[_0xd0f8('0x2d')][_0xd0f8('0x44')](_0x135872);})[_0xd0f8('0x25')](function(_0x534c09){_0x2a58a8[_0xd0f8('0x45')]=_0x534c09;return _0x2a58a8;})[_0xd0f8('0x25')](respondWithFilteredResult(_0x48d174,_0x135872))[_0xd0f8('0x46')](handleError(_0x48d174,null));};exports[_0xd0f8('0x47')]=function(_0x10244e,_0x30e621){var _0xb33275={'raw':!![],'where':{'id':_0x10244e[_0xd0f8('0x48')]['id']}},_0x77e48d={};_0x77e48d[_0xd0f8('0x32')]=_[_0xd0f8('0x49')](db[_0xd0f8('0x2d')][_0xd0f8('0x2e')]);_0x77e48d[_0xd0f8('0x33')]=_[_0xd0f8('0x49')](_0x10244e[_0xd0f8('0x33')]);_0x77e48d[_0xd0f8('0x34')]=_['intersection'](_0x77e48d[_0xd0f8('0x32')],_0x77e48d['query']);_0xb33275['attributes']=_['intersection'](_0x77e48d[_0xd0f8('0x32')],qs[_0xd0f8('0x37')](_0x10244e[_0xd0f8('0x33')]['fields']));_0xb33275[_0xd0f8('0x35')]=_0xb33275['attributes'][_0xd0f8('0x38')]?_0xb33275[_0xd0f8('0x35')]:_0x77e48d[_0xd0f8('0x32')];if(_0x10244e['query'][_0xd0f8('0x42')]){_0xb33275[_0xd0f8('0x43')]=[{'all':!![]}];}_0xb33275=_['merge']({},_0xb33275,_0x10244e[_0xd0f8('0x41')]);return db['CmContactHasItem'][_0xd0f8('0x4a')](_0xb33275)['then'](handleEntityNotFound(_0x30e621,null))[_0xd0f8('0x25')](respondWithResult(_0x30e621,null))[_0xd0f8('0x46')](handleError(_0x30e621,null));};exports['create']=function(_0x3e5bb3,_0x12e84d){return db['CmContactHasItem'][_0xd0f8('0x4b')](_0x3e5bb3['body'],{})[_0xd0f8('0x25')](function(_0xa253f){var _0x2c0530=_0x3e5bb3['user']['get']({'plain':!![]});if(!_0x2c0530)throw new Error(_0xd0f8('0x4c'));if(_0x2c0530[_0xd0f8('0x4d')]===_0xd0f8('0x4e')){var _0x159644=_0xa253f[_0xd0f8('0x4f')]({'plain':!![]});var _0x1f4833='CmContactHasItems';return db[_0xd0f8('0x50')][_0xd0f8('0x4a')]({'where':{'name':_0x1f4833,'userProfileId':_0x2c0530[_0xd0f8('0x51')]},'raw':!![]})['then'](function(_0x581dfe){if(_0x581dfe&&_0x581dfe[_0xd0f8('0x52')]===0x0){return db[_0xd0f8('0x27')][_0xd0f8('0x4b')]({'name':_0x159644[_0xd0f8('0x2a')],'resourceId':_0x159644['id'],'type':_0x581dfe[_0xd0f8('0x2a')],'sectionId':_0x581dfe['id']},{})[_0xd0f8('0x25')](function(){return _0xa253f;});}else{return _0xa253f;}})['catch'](function(_0x52528e){logger['error'](_0xd0f8('0x53'),_0x52528e);throw _0x52528e;});}return _0xa253f;})['then'](respondWithResult(_0x12e84d,0xc9))[_0xd0f8('0x46')](handleError(_0x12e84d,null));};exports['update']=function(_0x3a6ee1,_0x4206bd){if(_0x3a6ee1[_0xd0f8('0x54')]['id']){delete _0x3a6ee1[_0xd0f8('0x54')]['id'];}return db[_0xd0f8('0x2d')][_0xd0f8('0x4a')]({'where':{'id':_0x3a6ee1[_0xd0f8('0x48')]['id']}})[_0xd0f8('0x25')](handleEntityNotFound(_0x4206bd,null))[_0xd0f8('0x25')](saveUpdates(_0x3a6ee1[_0xd0f8('0x54')],null))[_0xd0f8('0x25')](respondWithResult(_0x4206bd,null))[_0xd0f8('0x46')](handleError(_0x4206bd,null));};exports['destroy']=function(_0x2fcccd,_0x37b912){return db['CmContactHasItem'][_0xd0f8('0x4a')]({'where':{'id':_0x2fcccd[_0xd0f8('0x48')]['id']}})[_0xd0f8('0x25')](handleEntityNotFound(_0x37b912,null))[_0xd0f8('0x25')](removeEntity(_0x37b912,null))[_0xd0f8('0x46')](handleError(_0x37b912,null));};
\ No newline at end of file
index 0990cba..3a41c38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5617=['exports','define','CmContactHasItem','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x4e4c6e,_0x17bf5b){var _0x49cee5=function(_0x262a79){while(--_0x262a79){_0x4e4c6e['push'](_0x4e4c6e['shift']());}};_0x49cee5(++_0x17bf5b);}(_0x5617,0x162));var _0x7561=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x5617[_0x337537];return _0x4fdd67;};'use strict';var _=require(_0x7561('0x0'));var util=require('util');var logger=require(_0x7561('0x1'))(_0x7561('0x2'));var moment=require(_0x7561('0x3'));var BPromise=require(_0x7561('0x4'));var rp=require(_0x7561('0x5'));var fs=require('fs');var path=require(_0x7561('0x6'));var rimraf=require(_0x7561('0x7'));var config=require(_0x7561('0x8'));var attributes=require(_0x7561('0x9'));module[_0x7561('0xa')]=function(_0x5cc98c,_0x16f060){return _0x5cc98c[_0x7561('0xb')](_0x7561('0xc'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5965=['request-promise','path','rimraf','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1955e3,_0x44b0f4){var _0x278cf6=function(_0x186b24){while(--_0x186b24){_0x1955e3['push'](_0x1955e3['shift']());}};_0x278cf6(++_0x44b0f4);}(_0x5965,0x1ac));var _0x5596=function(_0xdd782c,_0x2c8a6b){_0xdd782c=_0xdd782c-0x0;var _0xefb5cc=_0x5965[_0xdd782c];return _0xefb5cc;};'use strict';var _=require(_0x5596('0x0'));var util=require(_0x5596('0x1'));var logger=require(_0x5596('0x2'))(_0x5596('0x3'));var moment=require(_0x5596('0x4'));var BPromise=require(_0x5596('0x5'));var rp=require(_0x5596('0x6'));var fs=require('fs');var path=require(_0x5596('0x7'));var rimraf=require(_0x5596('0x8'));var config=require(_0x5596('0x9'));var attributes=require('./cmContactHasItem.attributes');module[_0x5596('0xa')]=function(_0x2002e5,_0x5700e7){return _0x2002e5[_0x5596('0xb')](_0x5596('0xc'),attributes,{'tableName':_0x5596('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 029ec0e..84c55de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb675=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x538553,_0x3fa332){var _0x1e90a1=function(_0x448e68){while(--_0x448e68){_0x538553['push'](_0x538553['shift']());}};_0x1e90a1(++_0x3fa332);}(_0xb675,0x10e));var _0x5b67=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xb675[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require('lodash');var util=require(_0x5b67('0x0'));var moment=require(_0x5b67('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b67('0x2'));var fs=require('fs');var Redis=require(_0x5b67('0x3'));var db=require(_0x5b67('0x4'))['db'];var utils=require(_0x5b67('0x5'));var logger=require(_0x5b67('0x6'))(_0x5b67('0x7'));var config=require(_0x5b67('0x8'));var jayson=require(_0x5b67('0x9'));var client=jayson[_0x5b67('0xa')][_0x5b67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x176f26,_0x4105b7,_0x3bda87){return new BPromise(function(_0x172c8f,_0x316d4b){return client[_0x5b67('0xc')](_0x176f26,_0x3bda87)['then'](function(_0x95eb95){logger['info'](_0x5b67('0xd'),_0x4105b7,_0x5b67('0xe'));logger[_0x5b67('0xf')](_0x5b67('0x10'),_0x4105b7,_0x5b67('0xe'),JSON['stringify'](_0x95eb95));if(_0x95eb95[_0x5b67('0x11')]){if(_0x95eb95[_0x5b67('0x11')][_0x5b67('0x12')]===0x1f4){logger[_0x5b67('0x11')](_0x5b67('0xd'),_0x4105b7,_0x95eb95[_0x5b67('0x11')][_0x5b67('0x13')]);return _0x316d4b(_0x95eb95['error'][_0x5b67('0x13')]);}logger['error'](_0x5b67('0xd'),_0x4105b7,_0x95eb95[_0x5b67('0x11')][_0x5b67('0x13')]);return _0x172c8f(_0x95eb95['error'][_0x5b67('0x13')]);}else{logger[_0x5b67('0x14')]('CmContactHasItem,\x20%s,\x20%s',_0x4105b7,_0x5b67('0xe'));_0x172c8f(_0x95eb95[_0x5b67('0x15')][_0x5b67('0x13')]);}})[_0x5b67('0x16')](function(_0x29dc48){logger[_0x5b67('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x4105b7,_0x29dc48);_0x316d4b(_0x29dc48);});});}
\ No newline at end of file
+var _0xf762=['CmContactHasItem,\x20%s,\x20%s','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x29184b,_0xb55b72){var _0x2fefd9=function(_0x598549){while(--_0x598549){_0x29184b['push'](_0x29184b['shift']());}};_0x2fefd9(++_0xb55b72);}(_0xf762,0x193));var _0x2f76=function(_0x15166f,_0x4299b1){_0x15166f=_0x15166f-0x0;var _0x4ace45=_0xf762[_0x15166f];return _0x4ace45;};'use strict';var _=require(_0x2f76('0x0'));var util=require(_0x2f76('0x1'));var moment=require(_0x2f76('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f76('0x3'));var db=require(_0x2f76('0x4'))['db'];var utils=require(_0x2f76('0x5'));var logger=require('../../config/logger')(_0x2f76('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f76('0x7'));var client=jayson[_0x2f76('0x8')][_0x2f76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e6682,_0x12c1f6,_0x253507){return new BPromise(function(_0x227dd4,_0x40efff){return client[_0x2f76('0xa')](_0x3e6682,_0x253507)['then'](function(_0x51ba35){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x12c1f6,_0x2f76('0xb'));logger['debug'](_0x2f76('0xc'),_0x12c1f6,_0x2f76('0xb'),JSON[_0x2f76('0xd')](_0x51ba35));if(_0x51ba35['error']){if(_0x51ba35[_0x2f76('0xe')][_0x2f76('0xf')]===0x1f4){logger[_0x2f76('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x12c1f6,_0x51ba35[_0x2f76('0xe')][_0x2f76('0x10')]);return _0x40efff(_0x51ba35[_0x2f76('0xe')][_0x2f76('0x10')]);}logger[_0x2f76('0xe')](_0x2f76('0x11'),_0x12c1f6,_0x51ba35[_0x2f76('0xe')][_0x2f76('0x10')]);return _0x227dd4(_0x51ba35[_0x2f76('0xe')][_0x2f76('0x10')]);}else{logger[_0x2f76('0x12')](_0x2f76('0x11'),_0x12c1f6,_0x2f76('0xb'));_0x227dd4(_0x51ba35[_0x2f76('0x13')][_0x2f76('0x10')]);}})[_0x2f76('0x14')](function(_0x159404){logger[_0x2f76('0xe')](_0x2f76('0x11'),_0x12c1f6,_0x159404);_0x40efff(_0x159404);});});}
\ No newline at end of file
index cbecb7d..6b8ef50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe791=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','destroy','multer','util','express','fs-extra'];(function(_0x2f6ebe,_0x3650cf){var _0x5fe12=function(_0x464e43){while(--_0x464e43){_0x2f6ebe['push'](_0x2f6ebe['shift']());}};_0x5fe12(++_0x3650cf);}(_0xe791,0x1be));var _0x1e79=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xe791[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0x1e79('0x0'));var util=require(_0x1e79('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e79('0x2'));var router=express['Router']();var fs_extra=require(_0x1e79('0x3'));var auth=require(_0x1e79('0x4'));var interaction=require(_0x1e79('0x5'));var config=require(_0x1e79('0x6'));var controller=require('./cmContactHasItem.controller');router[_0x1e79('0x7')]('/',auth[_0x1e79('0x8')](),controller[_0x1e79('0x9')]);router[_0x1e79('0x7')](_0x1e79('0xa'),auth['isAuthenticated'](),controller[_0x1e79('0xb')]);router[_0x1e79('0xc')]('/',auth[_0x1e79('0x8')](),controller['create']);router[_0x1e79('0xd')](_0x1e79('0xa'),auth[_0x1e79('0x8')](),controller['update']);router['delete'](_0x1e79('0xa'),auth[_0x1e79('0x8')](),controller[_0x1e79('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x098b=['update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','post','create'];(function(_0x4bf27a,_0x435cc2){var _0x22a0ba=function(_0x4b442e){while(--_0x4b442e){_0x4bf27a['push'](_0x4bf27a['shift']());}};_0x22a0ba(++_0x435cc2);}(_0x098b,0x6c));var _0xb098=function(_0x1ce4de,_0x23e140){_0x1ce4de=_0x1ce4de-0x0;var _0xb38210=_0x098b[_0x1ce4de];return _0xb38210;};'use strict';var multer=require(_0xb098('0x0'));var util=require(_0xb098('0x1'));var path=require('path');var timeout=require(_0xb098('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb098('0x3'));var interaction=require(_0xb098('0x4'));var config=require(_0xb098('0x5'));var controller=require(_0xb098('0x6'));router[_0xb098('0x7')]('/',auth[_0xb098('0x8')](),controller['index']);router[_0xb098('0x7')](_0xb098('0x9'),auth[_0xb098('0x8')](),controller['show']);router[_0xb098('0xa')]('/',auth['isAuthenticated'](),controller[_0xb098('0xb')]);router['put']('/:id',auth[_0xb098('0x8')](),controller[_0xb098('0xc')]);router[_0xb098('0xd')](_0xb098('0x9'),auth[_0xb098('0x8')](),controller[_0xb098('0xe')]);module['exports']=router;
\ No newline at end of file
index 732ed43..276de1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb470=['exports','VIRTUAL','getDataValue','STRING','name','TEXT','long','select','values','isArray','setDataValue','stringify','BOOLEAN','voice','sequelize'];(function(_0x50e1cf,_0x5b8361){var _0x39104f=function(_0x342287){while(--_0x342287){_0x50e1cf['push'](_0x50e1cf['shift']());}};_0x39104f(++_0x5b8361);}(_0xb470,0x194));var _0x0b47=function(_0x1382d6,_0x4130e3){_0x1382d6=_0x1382d6-0x0;var _0x31c787=_0xb470[_0x1382d6];return _0x31c787;};'use strict';var Sequelize=require(_0x0b47('0x0'));var _=require('lodash');module[_0x0b47('0x1')]={'name':{'type':Sequelize[_0x0b47('0x2')],'get':function(_0x32615c){return this[_0x0b47('0x3')]('alias');}},'alias':{'type':Sequelize[_0x0b47('0x4')],'allowNull':![],'set':function(_0x3042ff){this['setDataValue']('alias',_0x3042ff?_0x3042ff:this[_0x0b47('0x3')](_0x0b47('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x0b47('0x6')](_0x0b47('0x7')),'get':function(){if(this[_0x0b47('0x3')]('type')===_0x0b47('0x8')){return JSON['parse'](this[_0x0b47('0x3')](_0x0b47('0x9')));}else{return this[_0x0b47('0x3')]('values');}},'set':function(_0x4df0e8){if(Array[_0x0b47('0xa')](_0x4df0e8)){this[_0x0b47('0xb')](_0x0b47('0x9'),JSON[_0x0b47('0xc')](_0x4df0e8));}else{this[_0x0b47('0xb')](_0x0b47('0x9'),_0x4df0e8);}}},'required':{'type':Sequelize[_0x0b47('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0b47('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x0b47('0xe'))}};
\ No newline at end of file
+var _0xe39e=['exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash'];(function(_0xa11295,_0x4a4cc4){var _0x37d802=function(_0x381f4c){while(--_0x381f4c){_0xa11295['push'](_0xa11295['shift']());}};_0x37d802(++_0x4a4cc4);}(_0xe39e,0xbc));var _0xee39=function(_0x201920,_0x23a42e){_0x201920=_0x201920-0x0;var _0x11ca83=_0xe39e[_0x201920];return _0x11ca83;};'use strict';var Sequelize=require(_0xee39('0x0'));var _=require(_0xee39('0x1'));module[_0xee39('0x2')]={'name':{'type':Sequelize[_0xee39('0x3')],'get':function(_0x4fff47){return this[_0xee39('0x4')](_0xee39('0x5'));}},'alias':{'type':Sequelize[_0xee39('0x6')],'allowNull':![],'set':function(_0x488305){this[_0xee39('0x7')](_0xee39('0x5'),_0x488305?_0x488305:this['getDataValue'](_0xee39('0x8')));}},'type':{'type':Sequelize[_0xee39('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xee39('0x9')](_0xee39('0xa')),'get':function(){if(this[_0xee39('0x4')](_0xee39('0xb'))===_0xee39('0xc')){return JSON[_0xee39('0xd')](this[_0xee39('0x4')](_0xee39('0xe')));}else{return this['getDataValue'](_0xee39('0xe'));}},'set':function(_0xe62bf){if(Array[_0xee39('0xf')](_0xe62bf)){this['setDataValue']('values',JSON[_0xee39('0x10')](_0xe62bf));}else{this[_0xee39('0x7')]('values',_0xe62bf);}}},'required':{'type':Sequelize[_0xee39('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xee39('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xee39('0x12')]('voice')}};
\ No newline at end of file
index 7eecd1b..176ddf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b07=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../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','error','stack','name','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','params','find','body','create','transaction','TEXT','text','Sequelize','number','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x58d0ed,_0x415e0c){var _0x25ae6d=function(_0x7fcbde){while(--_0x7fcbde){_0x58d0ed['push'](_0x58d0ed['shift']());}};_0x25ae6d(++_0x415e0c);}(_0x1b07,0x198));var _0x71b0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1b07[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x71b0('0x0'));var rimraf=require(_0x71b0('0x1'));var zipdir=require(_0x71b0('0x2'));var jsonpatch=require(_0x71b0('0x3'));var rp=require('request-promise');var moment=require(_0x71b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x71b0('0x5'));var util=require(_0x71b0('0x6'));var path=require(_0x71b0('0x7'));var sox=require(_0x71b0('0x8'));var csv=require(_0x71b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71b0('0xa'));var _=require('lodash');var squel=require(_0x71b0('0xb'));var crypto=require(_0x71b0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x71b0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x71b0('0xe'));var Papa=require(_0x71b0('0xf'));var Redis=require(_0x71b0('0x10'));var authService=require(_0x71b0('0x11'));var qs=require(_0x71b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71b0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x71b0('0x14'));var config=require(_0x71b0('0x15'));var licenseUtil=require(_0x71b0('0x16'));var db=require(_0x71b0('0x17'))['db'];function respondWithStatusCode(_0x88f3f9,_0x2200d3){_0x2200d3=_0x2200d3||0xcc;return function(_0xcc71b9){if(_0xcc71b9){return _0x88f3f9[_0x71b0('0x18')](_0x2200d3);}return _0x88f3f9[_0x71b0('0x19')](_0x2200d3)[_0x71b0('0x1a')]();};}function respondWithResult(_0x500ddc,_0x1833a2){_0x1833a2=_0x1833a2||0xc8;return function(_0x38c588){if(_0x38c588){return _0x500ddc['status'](_0x1833a2)[_0x71b0('0x1b')](_0x38c588);}};}function respondWithFilteredResult(_0x5285b0,_0x156e65){return function(_0xdd97){if(_0xdd97){var _0x4832ee=typeof _0x156e65[_0x71b0('0x1c')]==='undefined'&&typeof _0x156e65[_0x71b0('0x1d')]===_0x71b0('0x1e');var _0x24cf0b=_0xdd97[_0x71b0('0x1f')];var _0x1a2934=_0x4832ee?0x0:_0x156e65[_0x71b0('0x1c')];var _0x36ff46=_0x4832ee?_0xdd97[_0x71b0('0x1f')]:_0x156e65[_0x71b0('0x1c')]+_0x156e65[_0x71b0('0x1d')];var _0x5c7359;if(_0x36ff46>=_0x24cf0b){_0x36ff46=_0x24cf0b;_0x5c7359=0xc8;}else{_0x5c7359=0xce;}_0x5285b0[_0x71b0('0x19')](_0x5c7359);return _0x5285b0[_0x71b0('0x20')](_0x71b0('0x21'),_0x1a2934+'-'+_0x36ff46+'/'+_0x24cf0b)[_0x71b0('0x1b')](_0xdd97);}return null;};}function patchUpdates(_0x4f7de1){return function(_0x5c7a15){try{jsonpatch[_0x71b0('0x22')](_0x5c7a15,_0x4f7de1,!![]);}catch(_0x162846){return BPromise[_0x71b0('0x23')](_0x162846);}return _0x5c7a15[_0x71b0('0x24')]();};}function saveUpdates(_0x2587d3,_0x272882){return function(_0xf6b808){if(_0xf6b808){return _0xf6b808[_0x71b0('0x25')](_0x2587d3)[_0x71b0('0x26')](function(_0x4faad1){return _0x4faad1;});}return null;};}function removeEntity(_0x388883,_0x158e59){return function(_0x94e361){if(_0x94e361){return _0x94e361[_0x71b0('0x27')]()[_0x71b0('0x26')](function(){_0x388883[_0x71b0('0x19')](0xcc)[_0x71b0('0x1a')]();});}};}function handleEntityNotFound(_0x1b4921,_0x2191f4){return function(_0x1ec02b){if(!_0x1ec02b){_0x1b4921['sendStatus'](0x194);}return _0x1ec02b;};}function handleError(_0x593fcb,_0xc9b7c8){_0xc9b7c8=_0xc9b7c8||0x1f4;return function(_0x3f54ab){logger[_0x71b0('0x28')](_0x3f54ab[_0x71b0('0x29')]);if(_0x3f54ab[_0x71b0('0x2a')]){delete _0x3f54ab[_0x71b0('0x2a')];}_0x593fcb[_0x71b0('0x19')](_0xc9b7c8)['send'](_0x3f54ab);};}exports[_0x71b0('0x2b')]=function(_0x547806,_0x2c8e89){var _0x309052={},_0x3062b3={},_0x53ca45={'count':0x0,'rows':[]};var _0x4ea622=_[_0x71b0('0x2c')](db[_0x71b0('0x2d')][_0x71b0('0x2e')],function(_0x3c750b){return{'name':_0x3c750b['fieldName'],'type':_0x3c750b[_0x71b0('0x2f')][_0x71b0('0x30')]};});_0x3062b3[_0x71b0('0x31')]=_[_0x71b0('0x32')](_[_0x71b0('0x2c')](_0x4ea622,_0x71b0('0x2a')),[_0x71b0('0x2a')]);_0x3062b3[_0x71b0('0x33')]=_[_0x71b0('0x34')](_0x547806[_0x71b0('0x33')]);_0x3062b3['filters']=_['intersection'](_0x3062b3[_0x71b0('0x31')],_0x3062b3[_0x71b0('0x33')]);_0x309052[_0x71b0('0x35')]=_[_0x71b0('0x36')](_0x3062b3[_0x71b0('0x31')],qs[_0x71b0('0x37')](_0x547806[_0x71b0('0x33')]['fields']));_0x309052[_0x71b0('0x35')]=_0x309052[_0x71b0('0x35')][_0x71b0('0x38')]?_0x309052[_0x71b0('0x35')]:_0x3062b3[_0x71b0('0x31')];if(!_0x547806[_0x71b0('0x33')][_0x71b0('0x39')]('nolimit')){_0x309052['limit']=qs[_0x71b0('0x1d')](_0x547806[_0x71b0('0x33')]['limit']);_0x309052[_0x71b0('0x1c')]=qs[_0x71b0('0x1c')](_0x547806[_0x71b0('0x33')]['offset']);}_0x309052[_0x71b0('0x3a')]=qs['sort'](_0x547806[_0x71b0('0x33')]['sort']);_0x309052[_0x71b0('0x3b')]=qs['filters'](_[_0x71b0('0x3c')](_0x547806['query'],_0x3062b3[_0x71b0('0x3d')]),_0x4ea622);if(_0x547806[_0x71b0('0x33')][_0x71b0('0x3e')]){_0x309052['where']=_[_0x71b0('0x3f')](_0x309052['where'],{'$or':_[_0x71b0('0x2c')](_0x4ea622,function(_0xe10c1){if(_0xe10c1[_0x71b0('0x2f')]!=='VIRTUAL'){var _0x4920a8={};_0x4920a8[_0xe10c1[_0x71b0('0x2a')]]={'$like':'%'+_0x547806[_0x71b0('0x33')][_0x71b0('0x3e')]+'%'};return _0x4920a8;}})});}_0x309052=_[_0x71b0('0x3f')]({},_0x309052,_0x547806[_0x71b0('0x40')]);var _0x45bdb6={'where':_0x309052['where']};return db[_0x71b0('0x2d')][_0x71b0('0x1f')](_0x45bdb6)['then'](function(_0x3d054b){_0x53ca45[_0x71b0('0x1f')]=_0x3d054b;if(_0x547806['query'][_0x71b0('0x41')]){_0x309052[_0x71b0('0x42')]=[{'all':!![]}];}return db[_0x71b0('0x2d')]['findAll'](_0x309052);})['then'](function(_0x3976b3){_0x53ca45[_0x71b0('0x43')]=_0x3976b3;return _0x53ca45;})['then'](respondWithFilteredResult(_0x2c8e89,_0x309052))[_0x71b0('0x44')](handleError(_0x2c8e89,null));};exports['show']=function(_0x504891,_0x4dcfd1){var _0x2dfaa8={'raw':!![],'where':{'id':_0x504891[_0x71b0('0x45')]['id']}},_0xdfd19f={};_0xdfd19f['model']=_['keys'](db[_0x71b0('0x2d')][_0x71b0('0x2e')]);_0xdfd19f['query']=_['keys'](_0x504891['query']);_0xdfd19f[_0x71b0('0x3d')]=_[_0x71b0('0x36')](_0xdfd19f[_0x71b0('0x31')],_0xdfd19f[_0x71b0('0x33')]);_0x2dfaa8[_0x71b0('0x35')]=_[_0x71b0('0x36')](_0xdfd19f[_0x71b0('0x31')],qs[_0x71b0('0x37')](_0x504891['query'][_0x71b0('0x37')]));_0x2dfaa8['attributes']=_0x2dfaa8[_0x71b0('0x35')][_0x71b0('0x38')]?_0x2dfaa8['attributes']:_0xdfd19f['model'];if(_0x504891[_0x71b0('0x33')][_0x71b0('0x41')]){_0x2dfaa8[_0x71b0('0x42')]=[{'all':!![]}];}_0x2dfaa8=_[_0x71b0('0x3f')]({},_0x2dfaa8,_0x504891[_0x71b0('0x40')]);return db[_0x71b0('0x2d')][_0x71b0('0x46')](_0x2dfaa8)[_0x71b0('0x26')](handleEntityNotFound(_0x4dcfd1,null))[_0x71b0('0x26')](respondWithResult(_0x4dcfd1,null))[_0x71b0('0x44')](handleError(_0x4dcfd1,null));};exports[_0x71b0('0x25')]=function(_0x22297e,_0x192e6c){if(_0x22297e[_0x71b0('0x47')]['id']){delete _0x22297e[_0x71b0('0x47')]['id'];}return db[_0x71b0('0x2d')][_0x71b0('0x46')]({'where':{'id':_0x22297e[_0x71b0('0x45')]['id']}})[_0x71b0('0x26')](handleEntityNotFound(_0x192e6c,null))[_0x71b0('0x26')](saveUpdates(_0x22297e['body'],null))['then'](respondWithResult(_0x192e6c,null))[_0x71b0('0x44')](handleError(_0x192e6c,null));};exports[_0x71b0('0x27')]=function(_0x2e1b82,_0x443744){return db['CmCustomField'][_0x71b0('0x46')]({'where':{'id':_0x2e1b82[_0x71b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x443744,null))[_0x71b0('0x26')](removeEntity(_0x443744,null))[_0x71b0('0x44')](handleError(_0x443744,null));};exports[_0x71b0('0x48')]=function(_0x31ea0f,_0x41cd53){var _0x1c5fa2;return db['sequelize'][_0x71b0('0x49')](function(_0x168577){return db[_0x71b0('0x2d')][_0x71b0('0x48')](_0x31ea0f[_0x71b0('0x47')],{'transaction':_0x168577})['then'](function(_0x4c1ab5){_0x1c5fa2=_0x4c1ab5;var _0x1b6208={'type':db['Sequelize'][_0x71b0('0x4a')],'transaction':_0x168577};switch(_0x31ea0f[_0x71b0('0x47')][_0x71b0('0x2f')]){case _0x71b0('0x4b'):_0x1b6208[_0x71b0('0x2f')]=db[_0x71b0('0x4c')][_0x71b0('0x4a')];break;case _0x71b0('0x4d'):_0x1b6208[_0x71b0('0x2f')]=db[_0x71b0('0x4c')]['INTEGER'];break;case _0x71b0('0x4e'):_0x1b6208[_0x71b0('0x2f')]=db['Sequelize']['BOOLEAN'];_0x1b6208[_0x71b0('0x4f')]=![];break;default:}return db[_0x71b0('0x50')][_0x71b0('0x51')][_0x71b0('0x52')](_0x71b0('0x53'),util[_0x71b0('0x54')]('cf_%d',_0x1c5fa2['id']),_0x1b6208);})[_0x71b0('0x26')](function(){return _0x1c5fa2;});})['then'](respondWithResult(_0x41cd53,0xc9))['catch'](handleError(_0x41cd53,null));};
\ No newline at end of file
+var _0x4887=['INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','body','find','create','transaction','Sequelize','TEXT','text','number'];(function(_0x3d370e,_0x1fa7f1){var _0x915da8=function(_0x781b57){while(--_0x781b57){_0x3d370e['push'](_0x3d370e['shift']());}};_0x915da8(++_0x1fa7f1);}(_0x4887,0x64));var _0x7488=function(_0x540092,_0x4e7f69){_0x540092=_0x540092-0x0;var _0x2ffa11=_0x4887[_0x540092];return _0x2ffa11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7488('0x0'));var zipdir=require(_0x7488('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7488('0x2'));var Mustache=require(_0x7488('0x3'));var util=require(_0x7488('0x4'));var path=require(_0x7488('0x5'));var sox=require(_0x7488('0x6'));var csv=require(_0x7488('0x7'));var ejs=require(_0x7488('0x8'));var fs=require('fs');var fs_extra=require(_0x7488('0x9'));var _=require(_0x7488('0xa'));var squel=require(_0x7488('0xb'));var crypto=require('crypto');var jsforce=require(_0x7488('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7488('0x7'));var querystring=require(_0x7488('0xd'));var Papa=require(_0x7488('0xe'));var Redis=require('ioredis');var authService=require(_0x7488('0xf'));var qs=require(_0x7488('0x10'));var as=require(_0x7488('0x11'));var hardwareService=require(_0x7488('0x12'));var logger=require(_0x7488('0x13'))(_0x7488('0x14'));var utils=require(_0x7488('0x15'));var config=require(_0x7488('0x16'));var licenseUtil=require(_0x7488('0x17'));var db=require(_0x7488('0x18'))['db'];function respondWithStatusCode(_0x54bdbb,_0xfc15ea){_0xfc15ea=_0xfc15ea||0xcc;return function(_0x17f639){if(_0x17f639){return _0x54bdbb['sendStatus'](_0xfc15ea);}return _0x54bdbb['status'](_0xfc15ea)['end']();};}function respondWithResult(_0x2426ab,_0x3e7b87){_0x3e7b87=_0x3e7b87||0xc8;return function(_0x1d593b){if(_0x1d593b){return _0x2426ab[_0x7488('0x19')](_0x3e7b87)['json'](_0x1d593b);}};}function respondWithFilteredResult(_0x19ca14,_0x47d62d){return function(_0x3ed471){if(_0x3ed471){var _0x4b4f6c=typeof _0x47d62d[_0x7488('0x1a')]===_0x7488('0x1b')&&typeof _0x47d62d[_0x7488('0x1c')]===_0x7488('0x1b');var _0x5a88ac=_0x3ed471['count'];var _0x4776de=_0x4b4f6c?0x0:_0x47d62d[_0x7488('0x1a')];var _0x1380d6=_0x4b4f6c?_0x3ed471[_0x7488('0x1d')]:_0x47d62d['offset']+_0x47d62d[_0x7488('0x1c')];var _0x46a847;if(_0x1380d6>=_0x5a88ac){_0x1380d6=_0x5a88ac;_0x46a847=0xc8;}else{_0x46a847=0xce;}_0x19ca14[_0x7488('0x19')](_0x46a847);return _0x19ca14[_0x7488('0x1e')]('Content-Range',_0x4776de+'-'+_0x1380d6+'/'+_0x5a88ac)[_0x7488('0x1f')](_0x3ed471);}return null;};}function patchUpdates(_0xdee122){return function(_0x432407){try{jsonpatch[_0x7488('0x20')](_0x432407,_0xdee122,!![]);}catch(_0x163783){return BPromise[_0x7488('0x21')](_0x163783);}return _0x432407[_0x7488('0x22')]();};}function saveUpdates(_0x551cef,_0x39bb63){return function(_0x28607d){if(_0x28607d){return _0x28607d[_0x7488('0x23')](_0x551cef)[_0x7488('0x24')](function(_0x1aa51e){return _0x1aa51e;});}return null;};}function removeEntity(_0x4ff7a6,_0x4b3bf3){return function(_0x2cd867){if(_0x2cd867){return _0x2cd867[_0x7488('0x25')]()[_0x7488('0x24')](function(){_0x4ff7a6['status'](0xcc)[_0x7488('0x26')]();});}};}function handleEntityNotFound(_0x14e526,_0x608a3e){return function(_0x15d291){if(!_0x15d291){_0x14e526[_0x7488('0x27')](0x194);}return _0x15d291;};}function handleError(_0x13469c,_0x2ad15d){_0x2ad15d=_0x2ad15d||0x1f4;return function(_0x1434c7){logger[_0x7488('0x28')](_0x1434c7[_0x7488('0x29')]);if(_0x1434c7[_0x7488('0x2a')]){delete _0x1434c7[_0x7488('0x2a')];}_0x13469c[_0x7488('0x19')](_0x2ad15d)[_0x7488('0x2b')](_0x1434c7);};}exports[_0x7488('0x2c')]=function(_0x1ae73d,_0x506397){var _0x525fb7={},_0x31af47={},_0x40cb41={'count':0x0,'rows':[]};var _0x1e56a7=_[_0x7488('0x2d')](db[_0x7488('0x2e')]['rawAttributes'],function(_0x14503e){return{'name':_0x14503e[_0x7488('0x2f')],'type':_0x14503e[_0x7488('0x30')][_0x7488('0x31')]};});_0x31af47[_0x7488('0x32')]=_['differenceBy'](_['map'](_0x1e56a7,_0x7488('0x2a')),[_0x7488('0x2a')]);_0x31af47[_0x7488('0x33')]=_[_0x7488('0x34')](_0x1ae73d[_0x7488('0x33')]);_0x31af47[_0x7488('0x35')]=_[_0x7488('0x36')](_0x31af47[_0x7488('0x32')],_0x31af47[_0x7488('0x33')]);_0x525fb7[_0x7488('0x37')]=_[_0x7488('0x36')](_0x31af47[_0x7488('0x32')],qs[_0x7488('0x38')](_0x1ae73d['query'][_0x7488('0x38')]));_0x525fb7[_0x7488('0x37')]=_0x525fb7['attributes'][_0x7488('0x39')]?_0x525fb7[_0x7488('0x37')]:_0x31af47['model'];if(!_0x1ae73d[_0x7488('0x33')][_0x7488('0x3a')](_0x7488('0x3b'))){_0x525fb7[_0x7488('0x1c')]=qs[_0x7488('0x1c')](_0x1ae73d[_0x7488('0x33')][_0x7488('0x1c')]);_0x525fb7[_0x7488('0x1a')]=qs[_0x7488('0x1a')](_0x1ae73d['query'][_0x7488('0x1a')]);}_0x525fb7[_0x7488('0x3c')]=qs[_0x7488('0x3d')](_0x1ae73d[_0x7488('0x33')]['sort']);_0x525fb7[_0x7488('0x3e')]=qs[_0x7488('0x35')](_[_0x7488('0x3f')](_0x1ae73d[_0x7488('0x33')],_0x31af47[_0x7488('0x35')]),_0x1e56a7);if(_0x1ae73d[_0x7488('0x33')][_0x7488('0x40')]){_0x525fb7['where']=_[_0x7488('0x41')](_0x525fb7['where'],{'$or':_[_0x7488('0x2d')](_0x1e56a7,function(_0x4e6e2e){if(_0x4e6e2e['type']!==_0x7488('0x42')){var _0x31fdde={};_0x31fdde[_0x4e6e2e[_0x7488('0x2a')]]={'$like':'%'+_0x1ae73d[_0x7488('0x33')][_0x7488('0x40')]+'%'};return _0x31fdde;}})});}_0x525fb7=_[_0x7488('0x41')]({},_0x525fb7,_0x1ae73d[_0x7488('0x43')]);var _0x28ffee={'where':_0x525fb7[_0x7488('0x3e')]};return db[_0x7488('0x2e')][_0x7488('0x1d')](_0x28ffee)[_0x7488('0x24')](function(_0xdde359){_0x40cb41[_0x7488('0x1d')]=_0xdde359;if(_0x1ae73d['query'][_0x7488('0x44')]){_0x525fb7[_0x7488('0x45')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x525fb7);})[_0x7488('0x24')](function(_0x300986){_0x40cb41[_0x7488('0x46')]=_0x300986;return _0x40cb41;})[_0x7488('0x24')](respondWithFilteredResult(_0x506397,_0x525fb7))[_0x7488('0x47')](handleError(_0x506397,null));};exports[_0x7488('0x48')]=function(_0x16ec82,_0x37f6ac){var _0x51f2a7={'raw':!![],'where':{'id':_0x16ec82[_0x7488('0x49')]['id']}},_0x955d05={};_0x955d05[_0x7488('0x32')]=_[_0x7488('0x34')](db[_0x7488('0x2e')]['rawAttributes']);_0x955d05[_0x7488('0x33')]=_[_0x7488('0x34')](_0x16ec82[_0x7488('0x33')]);_0x955d05[_0x7488('0x35')]=_[_0x7488('0x36')](_0x955d05[_0x7488('0x32')],_0x955d05[_0x7488('0x33')]);_0x51f2a7[_0x7488('0x37')]=_['intersection'](_0x955d05[_0x7488('0x32')],qs[_0x7488('0x38')](_0x16ec82[_0x7488('0x33')]['fields']));_0x51f2a7[_0x7488('0x37')]=_0x51f2a7['attributes'][_0x7488('0x39')]?_0x51f2a7[_0x7488('0x37')]:_0x955d05[_0x7488('0x32')];if(_0x16ec82['query']['includeAll']){_0x51f2a7[_0x7488('0x45')]=[{'all':!![]}];}_0x51f2a7=_[_0x7488('0x41')]({},_0x51f2a7,_0x16ec82[_0x7488('0x43')]);return db[_0x7488('0x2e')]['find'](_0x51f2a7)[_0x7488('0x24')](handleEntityNotFound(_0x37f6ac,null))[_0x7488('0x24')](respondWithResult(_0x37f6ac,null))[_0x7488('0x47')](handleError(_0x37f6ac,null));};exports[_0x7488('0x23')]=function(_0x2fab27,_0x28c63a){if(_0x2fab27['body']['id']){delete _0x2fab27[_0x7488('0x4a')]['id'];}return db[_0x7488('0x2e')]['find']({'where':{'id':_0x2fab27[_0x7488('0x49')]['id']}})[_0x7488('0x24')](handleEntityNotFound(_0x28c63a,null))[_0x7488('0x24')](saveUpdates(_0x2fab27[_0x7488('0x4a')],null))[_0x7488('0x24')](respondWithResult(_0x28c63a,null))[_0x7488('0x47')](handleError(_0x28c63a,null));};exports['destroy']=function(_0x15da16,_0x355e6d){return db[_0x7488('0x2e')][_0x7488('0x4b')]({'where':{'id':_0x15da16[_0x7488('0x49')]['id']}})[_0x7488('0x24')](handleEntityNotFound(_0x355e6d,null))[_0x7488('0x24')](removeEntity(_0x355e6d,null))[_0x7488('0x47')](handleError(_0x355e6d,null));};exports[_0x7488('0x4c')]=function(_0x572a1b,_0x42ea67){var _0x3d3960;return db['sequelize'][_0x7488('0x4d')](function(_0xaa14eb){return db[_0x7488('0x2e')][_0x7488('0x4c')](_0x572a1b[_0x7488('0x4a')],{'transaction':_0xaa14eb})[_0x7488('0x24')](function(_0x583187){_0x3d3960=_0x583187;var _0x291bce={'type':db[_0x7488('0x4e')][_0x7488('0x4f')],'transaction':_0xaa14eb};switch(_0x572a1b['body']['type']){case _0x7488('0x50'):_0x291bce[_0x7488('0x30')]=db[_0x7488('0x4e')][_0x7488('0x4f')];break;case _0x7488('0x51'):_0x291bce['type']=db[_0x7488('0x4e')][_0x7488('0x52')];break;case _0x7488('0x53'):_0x291bce['type']=db['Sequelize']['BOOLEAN'];_0x291bce[_0x7488('0x54')]=![];break;default:}return db[_0x7488('0x55')][_0x7488('0x56')][_0x7488('0x57')](_0x7488('0x58'),util[_0x7488('0x59')](_0x7488('0x5a'),_0x3d3960['id']),_0x291bce);})[_0x7488('0x24')](function(){return _0x3d3960;});})[_0x7488('0x24')](respondWithResult(_0x42ea67,0xc9))[_0x7488('0x47')](handleError(_0x42ea67,null));};
\ No newline at end of file
index 96f39ef..44deb69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde8c=['../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xde8c,0x1a9));var _0xcde8=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xde8c[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0xcde8('0x0'));var util=require(_0xcde8('0x1'));var logger=require(_0xcde8('0x2'))(_0xcde8('0x3'));var moment=require(_0xcde8('0x4'));var BPromise=require(_0xcde8('0x5'));var rp=require(_0xcde8('0x6'));var fs=require('fs');var path=require(_0xcde8('0x7'));var rimraf=require(_0xcde8('0x8'));var config=require(_0xcde8('0x9'));var attributes=require(_0xcde8('0xa'));module[_0xcde8('0xb')]=function(_0x3f0483,_0x488f88){return _0x3f0483['define'](_0xcde8('0xc'),attributes,{'tableName':_0xcde8('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8aaa=['util','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x122dfa,_0xa0a89e){var _0x506d31=function(_0x27fe6e){while(--_0x27fe6e){_0x122dfa['push'](_0x122dfa['shift']());}};_0x506d31(++_0xa0a89e);}(_0x8aaa,0xdc));var _0xa8aa=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x8aaa[_0x1b8d87];return _0x182b74;};'use strict';var _=require(_0xa8aa('0x0'));var util=require(_0xa8aa('0x1'));var logger=require('../../config/logger')(_0xa8aa('0x2'));var moment=require(_0xa8aa('0x3'));var BPromise=require(_0xa8aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8aa('0x5'));var rimraf=require(_0xa8aa('0x6'));var config=require(_0xa8aa('0x7'));var attributes=require(_0xa8aa('0x8'));module[_0xa8aa('0x9')]=function(_0x2eb6ed,_0x182ffc){return _0x2eb6ed[_0xa8aa('0xa')](_0xa8aa('0xb'),attributes,{'tableName':_0xa8aa('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2262e42..c68b98e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x767b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0x767b,0x124));var _0xb767=function(_0x2eb898,_0x43c47b){_0x2eb898=_0x2eb898-0x0;var _0x58974f=_0x767b[_0x2eb898];return _0x58974f;};'use strict';var _=require(_0xb767('0x0'));var util=require(_0xb767('0x1'));var moment=require(_0xb767('0x2'));var BPromise=require(_0xb767('0x3'));var rs=require(_0xb767('0x4'));var fs=require('fs');var Redis=require(_0xb767('0x5'));var db=require(_0xb767('0x6'))['db'];var utils=require(_0xb767('0x7'));var logger=require(_0xb767('0x8'))(_0xb767('0x9'));var config=require(_0xb767('0xa'));var jayson=require(_0xb767('0xb'));var client=jayson[_0xb767('0xc')][_0xb767('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2366bb,_0x5960fa,_0x412def){return new BPromise(function(_0xade97c,_0x1da0eb){return client[_0xb767('0xe')](_0x2366bb,_0x412def)[_0xb767('0xf')](function(_0x12cf4){logger[_0xb767('0x10')](_0xb767('0x11'),_0x5960fa,_0xb767('0x12'));logger['debug'](_0xb767('0x13'),_0x5960fa,_0xb767('0x12'),JSON[_0xb767('0x14')](_0x12cf4));if(_0x12cf4[_0xb767('0x15')]){if(_0x12cf4[_0xb767('0x15')][_0xb767('0x16')]===0x1f4){logger[_0xb767('0x15')](_0xb767('0x11'),_0x5960fa,_0x12cf4[_0xb767('0x15')]['message']);return _0x1da0eb(_0x12cf4[_0xb767('0x15')][_0xb767('0x17')]);}logger[_0xb767('0x15')]('CmCustomField,\x20%s,\x20%s',_0x5960fa,_0x12cf4[_0xb767('0x15')][_0xb767('0x17')]);return _0xade97c(_0x12cf4['error'][_0xb767('0x17')]);}else{logger[_0xb767('0x10')](_0xb767('0x11'),_0x5960fa,'request\x20sent');_0xade97c(_0x12cf4['result'][_0xb767('0x17')]);}})[_0xb767('0x18')](function(_0x14323b){logger[_0xb767('0x15')](_0xb767('0x11'),_0x5960fa,_0x14323b);_0x1da0eb(_0x14323b);});});}
\ No newline at end of file
+var _0xc855=['CmCustomField,\x20%s,\x20%s,\x20%s','error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug'];(function(_0x3d4730,_0x26f393){var _0x1a0f3e=function(_0x81b68f){while(--_0x81b68f){_0x3d4730['push'](_0x3d4730['shift']());}};_0x1a0f3e(++_0x26f393);}(_0xc855,0x126));var _0x5c85=function(_0x36de68,_0x532590){_0x36de68=_0x36de68-0x0;var _0xc7af31=_0xc855[_0x36de68];return _0xc7af31;};'use strict';var _=require(_0x5c85('0x0'));var util=require(_0x5c85('0x1'));var moment=require('moment');var BPromise=require(_0x5c85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c85('0x3'));var db=require(_0x5c85('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c85('0x5'))('rpc');var config=require(_0x5c85('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5c85('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x307ada,_0x3d4dfa,_0x400fd4){return new BPromise(function(_0x4995ce,_0xd3b659){return client['request'](_0x307ada,_0x400fd4)[_0x5c85('0x8')](function(_0x198b27){logger[_0x5c85('0x9')]('CmCustomField,\x20%s,\x20%s',_0x3d4dfa,_0x5c85('0xa'));logger[_0x5c85('0xb')](_0x5c85('0xc'),_0x3d4dfa,_0x5c85('0xa'),JSON['stringify'](_0x198b27));if(_0x198b27[_0x5c85('0xd')]){if(_0x198b27['error']['code']===0x1f4){logger[_0x5c85('0xd')](_0x5c85('0xe'),_0x3d4dfa,_0x198b27[_0x5c85('0xd')][_0x5c85('0xf')]);return _0xd3b659(_0x198b27[_0x5c85('0xd')][_0x5c85('0xf')]);}logger[_0x5c85('0xd')](_0x5c85('0xe'),_0x3d4dfa,_0x198b27['error'][_0x5c85('0xf')]);return _0x4995ce(_0x198b27[_0x5c85('0xd')]['message']);}else{logger[_0x5c85('0x9')]('CmCustomField,\x20%s,\x20%s',_0x3d4dfa,_0x5c85('0xa'));_0x4995ce(_0x198b27[_0x5c85('0x10')][_0x5c85('0xf')]);}})[_0x5c85('0x11')](function(_0x3456b8){logger[_0x5c85('0xd')]('CmCustomField,\x20%s,\x20%s',_0x3d4dfa,_0x3456b8);_0xd3b659(_0x3456b8);});});}
\ No newline at end of file
index e420037..89e259a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x853e=['show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','/:id','isAuthenticated'];(function(_0x2eb860,_0x224816){var _0x181bcf=function(_0x5e829b){while(--_0x5e829b){_0x2eb860['push'](_0x2eb860['shift']());}};_0x181bcf(++_0x224816);}(_0x853e,0xea));var _0xe853=function(_0x47eaee,_0x467e6d){_0x47eaee=_0x47eaee-0x0;var _0x20d44f=_0x853e[_0x47eaee];return _0x20d44f;};'use strict';var multer=require(_0xe853('0x0'));var util=require(_0xe853('0x1'));var path=require(_0xe853('0x2'));var timeout=require(_0xe853('0x3'));var express=require(_0xe853('0x4'));var router=express['Router']();var fs_extra=require(_0xe853('0x5'));var auth=require(_0xe853('0x6'));var interaction=require(_0xe853('0x7'));var config=require(_0xe853('0x8'));var controller=require(_0xe853('0x9'));router[_0xe853('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe853('0xb'),auth[_0xe853('0xc')](),controller[_0xe853('0xd')]);router[_0xe853('0xe')]('/',auth[_0xe853('0xc')](),controller['create']);router[_0xe853('0xf')](_0xe853('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe853('0x10')](_0xe853('0xb'),auth[_0xe853('0xc')](),controller[_0xe853('0x11')]);module[_0xe853('0x12')]=router;
\ No newline at end of file
+var _0x088e=['../../config/environment','./cmCustomField.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x42ee3d,_0x52bd90){var _0x2373d0=function(_0x59f705){while(--_0x59f705){_0x42ee3d['push'](_0x42ee3d['shift']());}};_0x2373d0(++_0x52bd90);}(_0x088e,0x172));var _0xe088=function(_0x4935b1,_0x2c6114){_0x4935b1=_0x4935b1-0x0;var _0x3354c1=_0x088e[_0x4935b1];return _0x3354c1;};'use strict';var multer=require(_0xe088('0x0'));var util=require(_0xe088('0x1'));var path=require(_0xe088('0x2'));var timeout=require('connect-timeout');var express=require(_0xe088('0x3'));var router=express[_0xe088('0x4')]();var fs_extra=require(_0xe088('0x5'));var auth=require(_0xe088('0x6'));var interaction=require(_0xe088('0x7'));var config=require(_0xe088('0x8'));var controller=require(_0xe088('0x9'));router['get']('/',auth[_0xe088('0xa')](),controller[_0xe088('0xb')]);router['get'](_0xe088('0xc'),auth[_0xe088('0xa')](),controller[_0xe088('0xd')]);router[_0xe088('0xe')]('/',auth['isAuthenticated'](),controller[_0xe088('0xf')]);router[_0xe088('0x10')](_0xe088('0xc'),auth['isAuthenticated'](),controller[_0xe088('0x11')]);router[_0xe088('0x12')](_0xe088('0xc'),auth[_0xe088('0xa')](),controller[_0xe088('0x13')]);module[_0xe088('0x14')]=router;
\ No newline at end of file
index cba730e..180f726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x893d=['contactListQueue','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x893d,0xe8));var _0xd893=function(_0xe8c198,_0x38dd58){_0xe8c198=_0xe8c198-0x0;var _0x41c3a5=_0x893d[_0xe8c198];return _0x41c3a5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xd893('0x0')],'allowNull':![]},'active':{'type':Sequelize[_0xd893('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xd893('0x2')](_0xd893('0x3'))},'countbusyretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd893('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd893('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd893('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd893('0x4')],'unique':_0xd893('0x6')},'ListId':{'type':Sequelize[_0xd893('0x4')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xd893('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xd893('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd893('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd893('0x0')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0xc63c=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize'];(function(_0x44585b,_0x5c43fc){var _0x173bf9=function(_0x21787c){while(--_0x21787c){_0x44585b['push'](_0x44585b['shift']());}};_0x173bf9(++_0x5c43fc);}(_0xc63c,0x1e5));var _0xcc63=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xc63c[_0x35181c];return _0xe14bf9;};'use strict';var moment=require('moment');var Sequelize=require(_0xcc63('0x0'));module['exports']={'phone':{'type':Sequelize[_0xcc63('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xcc63('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xcc63('0x3')],'defaultValue':moment()[_0xcc63('0x4')](_0xcc63('0x5'))},'countbusyretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcc63('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcc63('0x3')]},'priority':{'type':Sequelize[_0xcc63('0x6')](0x2)[_0xcc63('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xcc63('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xcc63('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xcc63('0x8')},'UserId':{'type':Sequelize[_0xcc63('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xcc63('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xcc63('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcc63('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xcc63('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcc63('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0xcc63('0x3')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 6f385a4..401925d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['show','includeAll','create','body','find','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','getVoiceQueues','preview','dialPreviewAutoRecallMe','transaction','value','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','UPDATE','CmCompany','CmList','List','dialActive','findOne','LOCK','Contact','Company','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','utcOffset','getTimezone','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','undefined','limit','count','offset','set','json','update','then','sendStatus','name','status','send','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$iLike','$notILike','$like','$overlap','$contains','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch'];(function(_0x5cc2cd,_0x4b74bb){var _0xab7f73=function(_0xcd90a7){while(--_0xcd90a7){_0x5cc2cd['push'](_0x5cc2cd['shift']());}};_0xab7f73(++_0x4b74bb);}(_0x207c,0x1e8));var _0xc207=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x207c[_0x1428d9];return _0x438019;};'use strict';var moment=require('moment');var _=require(_0xc207('0x0'));var qs=require(_0xc207('0x1'));var logger=require(_0xc207('0x2'))(_0xc207('0x3'));var shared=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];function respondWithResult(_0x1dd107,_0x4b9daa){_0x4b9daa=_0x4b9daa||0xc8;return function(_0x38ff02){if(_0x38ff02){return _0x1dd107['status'](_0x4b9daa)['json'](_0x38ff02);}};}function respondWithFilteredResult(_0x55023e,_0xc88789){return function(_0x314561){if(_0x314561){var _0x3395e4=typeof _0xc88789['offset']===_0xc207('0x6')&&typeof _0xc88789[_0xc207('0x7')]===_0xc207('0x6');var _0x4e10e8=_0x314561[_0xc207('0x8')];var _0x817576=_0x3395e4?0x0:_0xc88789[_0xc207('0x9')];var _0x13ec41=_0x3395e4?_0x314561[_0xc207('0x8')]:_0xc88789[_0xc207('0x9')]+_0xc88789['limit'];var _0x574425;if(_0x13ec41>=_0x4e10e8){_0x13ec41=_0x4e10e8;_0x574425=0xc8;}else{_0x574425=0xce;}_0x55023e['status'](_0x574425);return _0x55023e[_0xc207('0xa')]('Content-Range',_0x817576+'-'+_0x13ec41+'/'+_0x4e10e8)[_0xc207('0xb')](_0x314561);}return null;};}function saveUpdates(_0x2782ce,_0x59d401){return function(_0x3e1108){if(_0x3e1108){return _0x3e1108[_0xc207('0xc')](_0x2782ce)[_0xc207('0xd')](function(_0x32acbf){return _0x32acbf;});}return null;};}function handleEntityNotFound(_0xe993a0,_0x51e967){return function(_0xc62672){if(!_0xc62672){_0xe993a0[_0xc207('0xe')](0x194);}return _0xc62672;};}function handleError(_0x274bbd,_0x4031ad){_0x4031ad=_0x4031ad||0x1f4;return function(_0x4ef6c4){logger['error'](_0x4ef6c4['stack']);if(_0x4ef6c4[_0xc207('0xf')]){delete _0x4ef6c4[_0xc207('0xf')];}_0x274bbd[_0xc207('0x10')](_0x4031ad)[_0xc207('0x11')](_0x4ef6c4);};}exports['index']=function(_0x1bc70c,_0x282595){var _0x217d5e={},_0x5f288e={},_0x4129b8={'count':0x0,'rows':[]};var _0x488cc0=_[_0xc207('0x12')](db[_0xc207('0x13')][_0xc207('0x14')],function(_0x461f6a){return{'name':_0x461f6a[_0xc207('0x15')],'type':_0x461f6a[_0xc207('0x16')][_0xc207('0x17')]};});_0x5f288e[_0xc207('0x18')]=_[_0xc207('0x12')](_0x488cc0,_0xc207('0xf'));_0x5f288e[_0xc207('0x19')]=_[_0xc207('0x1a')](_0x1bc70c[_0xc207('0x19')]);_0x5f288e['filters']=_[_0xc207('0x1b')](_0x5f288e['model'],_0x5f288e[_0xc207('0x19')]);_0x5f288e[_0xc207('0x1c')]=_[_0xc207('0x1d')](_0x5f288e[_0xc207('0x1c')],[_0xc207('0x1e'),_0xc207('0x1f'),_0xc207('0x20'),_0xc207('0x21'),_0xc207('0x22'),_0xc207('0x23'),_0xc207('0x24'),_0xc207('0x25'),_0xc207('0x26'),_0xc207('0x27'),_0xc207('0x28'),'$in',_0xc207('0x29'),'$like','$notLike',_0xc207('0x2a'),_0xc207('0x2b'),_0xc207('0x2c'),_0xc207('0x2d'),_0xc207('0x2e'),'$contained',_0xc207('0x2f')]);_0x217d5e[_0xc207('0x30')]=_[_0xc207('0x1b')](_0x5f288e[_0xc207('0x18')],qs[_0xc207('0x31')](_0x1bc70c[_0xc207('0x19')][_0xc207('0x31')]));_0x217d5e[_0xc207('0x30')]=_0x217d5e[_0xc207('0x30')][_0xc207('0x32')]?_0x217d5e[_0xc207('0x30')]:_0x5f288e[_0xc207('0x18')];if(!_0x1bc70c[_0xc207('0x19')]['hasOwnProperty'](_0xc207('0x33'))){_0x217d5e[_0xc207('0x7')]=qs[_0xc207('0x7')](_0x1bc70c[_0xc207('0x19')][_0xc207('0x7')]);_0x217d5e[_0xc207('0x9')]=qs['offset'](_0x1bc70c[_0xc207('0x19')][_0xc207('0x9')]);}_0x217d5e[_0xc207('0x34')]=qs[_0xc207('0x35')](_0x1bc70c['query'][_0xc207('0x35')]);_0x217d5e[_0xc207('0x36')]=qs[_0xc207('0x1c')](_[_0xc207('0x37')](_0x1bc70c[_0xc207('0x19')],_0x5f288e[_0xc207('0x1c')]),_0x488cc0);if(_0x1bc70c[_0xc207('0x19')][_0xc207('0x38')]){_0x217d5e[_0xc207('0x36')]=_['merge'](_0x217d5e['where'],{'$or':_[_0xc207('0x12')](_0x488cc0,function(_0x2a9701){if(_0x2a9701[_0xc207('0x16')]!==_0xc207('0x39')){var _0x591a7f={};_0x591a7f[_0x2a9701[_0xc207('0xf')]]={'$like':'%'+_0x1bc70c[_0xc207('0x19')][_0xc207('0x38')]+'%'};return _0x591a7f;}})});}_0x217d5e=_[_0xc207('0x3a')]({},_0x217d5e,_0x1bc70c[_0xc207('0x3b')]);var _0x5e3177={'where':_0x217d5e[_0xc207('0x36')]};return db[_0xc207('0x13')]['count'](_0x5e3177)[_0xc207('0xd')](function(_0x49bada){_0x4129b8[_0xc207('0x8')]=_0x49bada;if(_0x1bc70c[_0xc207('0x19')]['includeAll']){_0x217d5e[_0xc207('0x3c')]=[{'all':!![]}];}return db[_0xc207('0x13')][_0xc207('0x3d')](_0x217d5e);})['then'](function(_0x5b3041){_0x4129b8[_0xc207('0x3e')]=_0x5b3041;return _0x4129b8;})[_0xc207('0xd')](respondWithFilteredResult(_0x282595,_0x217d5e))[_0xc207('0x3f')](handleError(_0x282595,null));};exports[_0xc207('0x40')]=function(_0x4c3e29,_0x3a6f45){var _0x47cdc4={'raw':!![],'where':{'id':_0x4c3e29['params']['id']}},_0x4cce4f={};_0x4cce4f['model']=_[_0xc207('0x1a')](db[_0xc207('0x13')][_0xc207('0x14')]);_0x4cce4f['query']=_[_0xc207('0x1a')](_0x4c3e29[_0xc207('0x19')]);_0x4cce4f[_0xc207('0x1c')]=_[_0xc207('0x1b')](_0x4cce4f['model'],_0x4cce4f[_0xc207('0x19')]);_0x47cdc4[_0xc207('0x30')]=_[_0xc207('0x1b')](_0x4cce4f[_0xc207('0x18')],qs[_0xc207('0x31')](_0x4c3e29['query'][_0xc207('0x31')]));_0x47cdc4[_0xc207('0x30')]=_0x47cdc4[_0xc207('0x30')][_0xc207('0x32')]?_0x47cdc4[_0xc207('0x30')]:_0x4cce4f[_0xc207('0x18')];if(_0x4c3e29[_0xc207('0x19')][_0xc207('0x41')]){_0x47cdc4[_0xc207('0x3c')]=[{'all':!![]}];}_0x47cdc4=_['merge']({},_0x47cdc4,_0x4c3e29[_0xc207('0x3b')]);return db[_0xc207('0x13')]['find'](_0x47cdc4)[_0xc207('0xd')](handleEntityNotFound(_0x3a6f45,null))[_0xc207('0xd')](respondWithResult(_0x3a6f45,null))[_0xc207('0x3f')](handleError(_0x3a6f45,null));};exports[_0xc207('0x42')]=function(_0x3ce5a3,_0x5b663f){return db[_0xc207('0x13')][_0xc207('0x42')](_0x3ce5a3[_0xc207('0x43')],{})['then'](respondWithResult(_0x5b663f,0xc9))[_0xc207('0x3f')](handleError(_0x5b663f,null));};exports[_0xc207('0xc')]=function(_0x2967ad,_0x45536e){if(_0x2967ad['body']['id']){delete _0x2967ad['body']['id'];}return db[_0xc207('0x13')][_0xc207('0x44')]({'where':{'id':_0x2967ad[_0xc207('0x45')]['id']}})[_0xc207('0xd')](handleEntityNotFound(_0x45536e,null))[_0xc207('0xd')](saveUpdates(_0x2967ad[_0xc207('0x43')],null))[_0xc207('0xd')](respondWithResult(_0x45536e,null))[_0xc207('0x3f')](handleError(_0x45536e,null));};exports[_0xc207('0x46')]=function(_0x212552,_0x2afcd1){return db[_0xc207('0x13')]['describe']()['then'](respondWithResult(_0x2afcd1,null))[_0xc207('0x3f')](handleError(_0x2afcd1,null));};exports[_0xc207('0x47')]=function(_0x2468d0,_0x480f12){var _0x2b89e0;var _0x3f712d=_0x2468d0[_0xc207('0x45')]['id'];return db[_0xc207('0x13')]['find']({'where':{'id':_0x2468d0[_0xc207('0x45')]['id']}})['then'](handleEntityNotFound(_0x480f12,null))[_0xc207('0xd')](function(_0x50a504){if(_0x50a504){return _0x50a504['destroy']()[_0xc207('0xd')](function(_0x30f02e){return _0x30f02e;});}})['then'](function(_0x552edd){_0x2b89e0=_0x552edd;if(_0x552edd){if(_0x552edd['VoiceQueueId']||_0x552edd[_0xc207('0x48')]){return db[_0x552edd[_0xc207('0x49')]?_0xc207('0x4a'):_0xc207('0x4b')][_0xc207('0x44')]({'where':{'id':_0x552edd[_0xc207('0x49')]?_0x552edd[_0xc207('0x49')]:_0x552edd[_0xc207('0x48')]},'attributes':['id','name'],'raw':!![]});}}})[_0xc207('0xd')](function(_0x1435a9){var _0x5aedd3={};if(_0x1435a9){_['merge'](_0x5aedd3,_[_0xc207('0x4c')](_0x2b89e0['dataValues'],['createdAt',_0xc207('0x4d'),'id']));_0x5aedd3[_0xc207('0x4e')]=0x15;_0x5aedd3[_0xc207('0x4f')]=_0xc207('0x50');_0x5aedd3[_0xc207('0x51')]=_0x1435a9[_0xc207('0xf')];_0x5aedd3[_0xc207('0x52')]=_0x2468d0[_0xc207('0x53')][_0xc207('0xf')];_0x5aedd3[_0xc207('0x54')]=_0x2468d0[_0xc207('0x53')]['id'];_0x5aedd3['deleted']=!![];_0x5aedd3['deletedat']=moment()[_0xc207('0x55')](_0xc207('0x56'));_0x5aedd3[_0xc207('0x57')]=_0x2b89e0[_0xc207('0x58')];_0x5aedd3[_0xc207('0x59')]=_0x2b89e0[_0xc207('0x49')]?_0xc207('0x5a'):_0xc207('0x5b');return db[_0xc207('0x5c')]['find']({'where':{'id':_0x5aedd3[_0xc207('0x5d')]},'attributes':[_0xc207('0x5e'),_0xc207('0x5f')]})[_0xc207('0xd')](function(_0x569c85){if(!_[_0xc207('0x60')](_0x480f12)&&!_[_0xc207('0x60')](_0x569c85[_0xc207('0x5e')])){_0x5aedd3[_0xc207('0x61')]=_0x569c85[_0xc207('0x5e')];if(!_[_0xc207('0x60')](_0x569c85[_0xc207('0x5f')])){_0x5aedd3['calleridname']+='\x20'+_0x569c85[_0xc207('0x5f')];}}})[_0xc207('0x62')](function(){return db[_0xc207('0x63')][_0xc207('0x42')](_0x5aedd3);});}})['then'](function(_0xc7812){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x3f712d}});})[_0xc207('0xd')](function(){return _0x480f12[_0xc207('0x10')](0xcc)[_0xc207('0x64')]();})[_0xc207('0x3f')](handleError(_0x480f12,null));};exports[_0xc207('0x65')]=function(_0x3b1b4c,_0x35a0d8){var _0x33c372=[];return db[_0xc207('0x5c')][_0xc207('0x46')]()[_0xc207('0xd')](function(_0x2f97bf){_0x33c372=_[_0xc207('0x1a')](_0x2f97bf);return _0x3b1b4c[_0xc207('0x53')][_0xc207('0x66')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xc207('0x67')},'attributes':['id','dialOrderByScheduledAt',_0xc207('0x68')],'raw':!![]});})[_0xc207('0xd')](function(_0x2ade23){if(_0x2ade23&&_0x2ade23['length']){return db['sequelize'][_0xc207('0x69')](function(_0x3ac0dd){var _0x2f18a2={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xc207('0x56'))},'VoiceQueueId':{'$in':_[_0xc207('0x12')](_0x2ade23,'id')},'$or':[{'UserId':null},{'UserId':_0x3b1b4c[_0xc207('0x53')]['id']}]};var _0x4967b4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2ade23)['filter']([_0xc207('0x68'),0x0])['map']('id')[_0xc207('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x3b1b4c[_0xc207('0x53')]['id']}]};var _0x3cca53={'$or':[_0x2f18a2,_0x4967b4]};var _0x4b197=[];if(_0x3b1b4c[_0xc207('0x43')][_0xc207('0x6b')]&&_0x3b1b4c[_0xc207('0x43')][_0xc207('0x6b')]==='prev'){if(!_[_0xc207('0x6c')](_0x3b1b4c[_0xc207('0x43')][_0xc207('0x6d')])){_0x3cca53['id']={'$in':_0x3b1b4c[_0xc207('0x43')][_0xc207('0x6d')]};}_0x4b197=[[_0xc207('0x6e'),_0xc207('0x6f')],[_0xc207('0x70'),_0x2ade23[0x0][_0xc207('0x71')]===_0xc207('0x6f')?_0xc207('0x72'):'ASC'],db[_0xc207('0x73')][_0xc207('0x74')](_0xc207('0x75')),['id',_0xc207('0x72')]];}else{if(!_['isEmpty'](_0x3b1b4c['body'][_0xc207('0x6d')])){_0x3cca53['id']={'$notIn':_0x3b1b4c[_0xc207('0x43')][_0xc207('0x6d')]};}_0x4b197=[[_0xc207('0x6e'),'DESC'],[_0xc207('0x70'),_0x2ade23[0x0][_0xc207('0x71')]],db[_0xc207('0x73')]['literal'](_0xc207('0x76')),['id',_0xc207('0x6f')]];}return db[_0xc207('0x13')]['findOne']({'attributes':['id',_0xc207('0x77'),'phone',_0xc207('0x78')],'where':_0x3cca53,'order':_0x4b197,'transaction':_0x3ac0dd,'lock':_0x3ac0dd['LOCK'][_0xc207('0x79')],'include':[{'model':db[_0xc207('0x5c')],'as':'Contact','attributes':_0x33c372,'include':[{'model':db[_0xc207('0x7a')],'as':'Company','attributes':['id',_0xc207('0xf')]}]},{'model':db[_0xc207('0x7b')],'as':_0xc207('0x7c'),'attributes':['id',_0xc207('0xf')]},{'model':db[_0xc207('0x4a')],'as':'Queue','attributes':['id','name',_0xc207('0x7d')]}]})[_0xc207('0xd')](function(_0x5320a9){if(_0x5320a9){return _0x5320a9[_0xc207('0xc')]({'UserId':_0x3b1b4c[_0xc207('0x53')]['id']},{'transaction':_0x3ac0dd});}});});}})['then'](handleEntityNotFound(_0x35a0d8,null))[_0xc207('0xd')](respondWithResult(_0x35a0d8,null))[_0xc207('0x3f')](handleError(_0x35a0d8,null));};exports['getPreviewRecall']=function(_0x2f5938,_0x2548bd,_0x3748de){var _0x1d550d=[];var _0x13c415=_0x2f5938[_0xc207('0x45')]['id'];var _0x5be1e7=_0x2f5938['user']['id'];return db[_0xc207('0x5c')][_0xc207('0x46')]()[_0xc207('0xd')](function(_0x15b13d){_0x1d550d=_[_0xc207('0x1a')](_0x15b13d);return db['sequelize'][_0xc207('0x69')](function(_0x4f79b3){const _0x6b1089={'id':_0x13c415};return db[_0xc207('0x13')][_0xc207('0x7e')]({'attributes':['id',_0xc207('0x77'),_0xc207('0x78')],'where':_0x6b1089,'transaction':_0x4f79b3,'lock':_0x4f79b3[_0xc207('0x7f')]['UPDATE'],'include':[{'model':db[_0xc207('0x5c')],'as':_0xc207('0x80'),'attributes':_0x1d550d,'include':[{'model':db['CmCompany'],'as':_0xc207('0x81'),'attributes':['id',_0xc207('0xf')]}]},{'model':db[_0xc207('0x7b')],'as':_0xc207('0x7c'),'attributes':['id',_0xc207('0xf')]},{'model':db[_0xc207('0x4a')],'as':_0xc207('0x82'),'attributes':['id',_0xc207('0xf'),_0xc207('0x7d')]}]})[_0xc207('0xd')](function(_0x473560){if(_0x473560){return _0x473560[_0xc207('0xc')]({'UserId':_0x5be1e7},{'transaction':_0x4f79b3});}});});})[_0xc207('0xd')](handleEntityNotFound(_0x2548bd,null))['then'](respondWithResult(_0x2548bd,null))[_0xc207('0x3f')](handleError(_0x2548bd,null));};exports[_0xc207('0x83')]=function(_0x2f4efd,_0x266e65){return _0x2f4efd['user'][_0xc207('0x66')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xc207('0x67')},'attributes':['id'],'raw':!![]})['then'](function(_0x53cb21){if(_0x53cb21&&_0x53cb21[_0xc207('0x32')]){return db[_0xc207('0x13')][_0xc207('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc207('0x55')](_0xc207('0x56'))},'VoiceQueueId':{'$in':_[_0xc207('0x12')](_0x53cb21,'id')},'$or':[{'UserId':null},{'UserId':_0x2f4efd['user']['id']}]}});}return 0x0;})[_0xc207('0xd')](function(_0x503f62){if(!_[_0xc207('0x60')](_0x503f62)&&_[_0xc207('0x84')](_0x503f62)){return _0x266e65[_0xc207('0x10')](0xc8)[_0xc207('0xb')]({'contacts':_0x503f62});}else{logger['error'](_0xc207('0x85'),_0xc207('0x83'),0x194,'entity\x20not\x20found');_0x266e65[_0xc207('0xe')](0x194);}})[_0xc207('0x3f')](handleError(_0x266e65,null));};exports[_0xc207('0x86')]=function(_0x1365f4,_0x5af9f6){var _0xc814f3=shared[_0xc207('0x87')];var _0x2c00fb=[];_[_0xc207('0x12')](_0xc814f3,function(_0x511bd9){_0x2c00fb['push']({'id':_0x511bd9['name'],'name':_0x511bd9['name'],'utcOffset':_0x511bd9[_0xc207('0x88')]});});return _0x5af9f6[_0xc207('0x10')](0xc8)[_0xc207('0xb')]({'tz':_0x2c00fb});};exports[_0xc207('0x89')]=function(_0x504c6b,_0x4f928b){var _0x341c95=shared['timezones'];var _0x50f110={};if(!_[_0xc207('0x60')](_0x341c95[_0x504c6b[_0xc207('0x43')]['id']]))_0x50f110=_0x341c95[_0x504c6b[_0xc207('0x43')]['id']];return _0x4f928b[_0xc207('0x10')](0xc8)[_0xc207('0xb')](_0x50f110);};
\ No newline at end of file
+var _0x57d4=['offset','undefined','count','limit','set','Content-Range','update','sendStatus','error','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','$and','$gt','$gte','$lt','$lte','$not','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','CmHopper','then','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','getVoiceQueues','outbound','preview','sequelize','transaction','direction','hopperIds','priority','ASC','scheduledAt','DESC','literal','isEmpty','dialOrderByScheduledAt','findOne','scheduledat','UPDATE','CmCompany','Company','CmList','List','Queue','getPreviewRecall','LOCK','Contact','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','timezones','moment','lodash','../../config/logger','api','../../config/environment','../../mysqldb','status','json'];(function(_0x5e2d54,_0xee3f58){var _0x2da51f=function(_0x5b766b){while(--_0x5b766b){_0x5e2d54['push'](_0x5e2d54['shift']());}};_0x2da51f(++_0xee3f58);}(_0x57d4,0x78));var _0x457d=function(_0x583a01,_0x1d1af4){_0x583a01=_0x583a01-0x0;var _0x38d93d=_0x57d4[_0x583a01];return _0x38d93d;};'use strict';var moment=require(_0x457d('0x0'));var _=require(_0x457d('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x457d('0x2'))(_0x457d('0x3'));var shared=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];function respondWithResult(_0x1219e1,_0x3c89b2){_0x3c89b2=_0x3c89b2||0xc8;return function(_0x3e2239){if(_0x3e2239){return _0x1219e1[_0x457d('0x6')](_0x3c89b2)[_0x457d('0x7')](_0x3e2239);}};}function respondWithFilteredResult(_0x247ec7,_0x3fd867){return function(_0x5c6816){if(_0x5c6816){var _0x1fc199=typeof _0x3fd867[_0x457d('0x8')]==='undefined'&&typeof _0x3fd867['limit']===_0x457d('0x9');var _0x254453=_0x5c6816[_0x457d('0xa')];var _0x559024=_0x1fc199?0x0:_0x3fd867['offset'];var _0x568a59=_0x1fc199?_0x5c6816[_0x457d('0xa')]:_0x3fd867[_0x457d('0x8')]+_0x3fd867[_0x457d('0xb')];var _0x128e09;if(_0x568a59>=_0x254453){_0x568a59=_0x254453;_0x128e09=0xc8;}else{_0x128e09=0xce;}_0x247ec7[_0x457d('0x6')](_0x128e09);return _0x247ec7[_0x457d('0xc')](_0x457d('0xd'),_0x559024+'-'+_0x568a59+'/'+_0x254453)[_0x457d('0x7')](_0x5c6816);}return null;};}function saveUpdates(_0xe7d200,_0x5abf49){return function(_0x239a20){if(_0x239a20){return _0x239a20[_0x457d('0xe')](_0xe7d200)['then'](function(_0x5e1841){return _0x5e1841;});}return null;};}function handleEntityNotFound(_0x44740f,_0x19ac04){return function(_0x3e59d9){if(!_0x3e59d9){_0x44740f[_0x457d('0xf')](0x194);}return _0x3e59d9;};}function handleError(_0x2ac416,_0x3e62f8){_0x3e62f8=_0x3e62f8||0x1f4;return function(_0xeac953){logger[_0x457d('0x10')](_0xeac953['stack']);if(_0xeac953[_0x457d('0x11')]){delete _0xeac953[_0x457d('0x11')];}_0x2ac416[_0x457d('0x6')](_0x3e62f8)['send'](_0xeac953);};}exports['index']=function(_0xc0751f,_0x4d988f){var _0x151416={},_0x802f2b={},_0x50e78f={'count':0x0,'rows':[]};var _0x2a22b6=_['map'](db['CmHopper'][_0x457d('0x12')],function(_0xe6cfcc){return{'name':_0xe6cfcc[_0x457d('0x13')],'type':_0xe6cfcc[_0x457d('0x14')][_0x457d('0x15')]};});_0x802f2b[_0x457d('0x16')]=_[_0x457d('0x17')](_0x2a22b6,_0x457d('0x11'));_0x802f2b[_0x457d('0x18')]=_[_0x457d('0x19')](_0xc0751f['query']);_0x802f2b['filters']=_['intersection'](_0x802f2b[_0x457d('0x16')],_0x802f2b['query']);_0x802f2b['filters']=_['concat'](_0x802f2b[_0x457d('0x1a')],[_0x457d('0x1b'),'$or',_0x457d('0x1c'),_0x457d('0x1d'),_0x457d('0x1e'),_0x457d('0x1f'),'$ne','$eq',_0x457d('0x20'),'$between',_0x457d('0x21'),_0x457d('0x22'),_0x457d('0x23'),_0x457d('0x24'),'$notLike',_0x457d('0x25'),'$notILike','$like',_0x457d('0x26'),_0x457d('0x27'),'$contained',_0x457d('0x28')]);_0x151416[_0x457d('0x29')]=_['intersection'](_0x802f2b[_0x457d('0x16')],qs[_0x457d('0x2a')](_0xc0751f[_0x457d('0x18')][_0x457d('0x2a')]));_0x151416[_0x457d('0x29')]=_0x151416[_0x457d('0x29')][_0x457d('0x2b')]?_0x151416[_0x457d('0x29')]:_0x802f2b[_0x457d('0x16')];if(!_0xc0751f[_0x457d('0x18')][_0x457d('0x2c')](_0x457d('0x2d'))){_0x151416[_0x457d('0xb')]=qs[_0x457d('0xb')](_0xc0751f[_0x457d('0x18')][_0x457d('0xb')]);_0x151416[_0x457d('0x8')]=qs[_0x457d('0x8')](_0xc0751f['query'][_0x457d('0x8')]);}_0x151416[_0x457d('0x2e')]=qs['sort'](_0xc0751f['query'][_0x457d('0x2f')]);_0x151416[_0x457d('0x30')]=qs['filters'](_[_0x457d('0x31')](_0xc0751f[_0x457d('0x18')],_0x802f2b[_0x457d('0x1a')]),_0x2a22b6);if(_0xc0751f[_0x457d('0x18')][_0x457d('0x32')]){_0x151416[_0x457d('0x30')]=_[_0x457d('0x33')](_0x151416[_0x457d('0x30')],{'$or':_[_0x457d('0x17')](_0x2a22b6,function(_0xde9836){if(_0xde9836[_0x457d('0x14')]!==_0x457d('0x34')){var _0x237be1={};_0x237be1[_0xde9836[_0x457d('0x11')]]={'$like':'%'+_0xc0751f[_0x457d('0x18')]['filter']+'%'};return _0x237be1;}})});}_0x151416=_[_0x457d('0x33')]({},_0x151416,_0xc0751f['options']);var _0x5a3db2={'where':_0x151416['where']};return db[_0x457d('0x35')]['count'](_0x5a3db2)[_0x457d('0x36')](function(_0x55e580){_0x50e78f['count']=_0x55e580;if(_0xc0751f[_0x457d('0x18')][_0x457d('0x37')]){_0x151416[_0x457d('0x38')]=[{'all':!![]}];}return db[_0x457d('0x35')][_0x457d('0x39')](_0x151416);})[_0x457d('0x36')](function(_0x23a9ee){_0x50e78f[_0x457d('0x3a')]=_0x23a9ee;return _0x50e78f;})[_0x457d('0x36')](respondWithFilteredResult(_0x4d988f,_0x151416))[_0x457d('0x3b')](handleError(_0x4d988f,null));};exports[_0x457d('0x3c')]=function(_0x160755,_0x1cad8c){var _0x330af1={'raw':!![],'where':{'id':_0x160755[_0x457d('0x3d')]['id']}},_0x3b6a8b={};_0x3b6a8b[_0x457d('0x16')]=_['keys'](db[_0x457d('0x35')]['rawAttributes']);_0x3b6a8b[_0x457d('0x18')]=_[_0x457d('0x19')](_0x160755[_0x457d('0x18')]);_0x3b6a8b[_0x457d('0x1a')]=_[_0x457d('0x3e')](_0x3b6a8b['model'],_0x3b6a8b['query']);_0x330af1[_0x457d('0x29')]=_['intersection'](_0x3b6a8b[_0x457d('0x16')],qs[_0x457d('0x2a')](_0x160755[_0x457d('0x18')]['fields']));_0x330af1[_0x457d('0x29')]=_0x330af1[_0x457d('0x29')][_0x457d('0x2b')]?_0x330af1[_0x457d('0x29')]:_0x3b6a8b[_0x457d('0x16')];if(_0x160755[_0x457d('0x18')][_0x457d('0x37')]){_0x330af1[_0x457d('0x38')]=[{'all':!![]}];}_0x330af1=_[_0x457d('0x33')]({},_0x330af1,_0x160755['options']);return db['CmHopper'][_0x457d('0x3f')](_0x330af1)[_0x457d('0x36')](handleEntityNotFound(_0x1cad8c,null))[_0x457d('0x36')](respondWithResult(_0x1cad8c,null))[_0x457d('0x3b')](handleError(_0x1cad8c,null));};exports[_0x457d('0x40')]=function(_0x183476,_0x5daa2c){return db[_0x457d('0x35')][_0x457d('0x40')](_0x183476[_0x457d('0x41')],{})['then'](respondWithResult(_0x5daa2c,0xc9))[_0x457d('0x3b')](handleError(_0x5daa2c,null));};exports[_0x457d('0xe')]=function(_0x1ac53f,_0x4d0507){if(_0x1ac53f[_0x457d('0x41')]['id']){delete _0x1ac53f[_0x457d('0x41')]['id'];}return db[_0x457d('0x35')][_0x457d('0x3f')]({'where':{'id':_0x1ac53f['params']['id']}})[_0x457d('0x36')](handleEntityNotFound(_0x4d0507,null))[_0x457d('0x36')](saveUpdates(_0x1ac53f[_0x457d('0x41')],null))[_0x457d('0x36')](respondWithResult(_0x4d0507,null))[_0x457d('0x3b')](handleError(_0x4d0507,null));};exports[_0x457d('0x42')]=function(_0x13787f,_0x3f7efa){return db[_0x457d('0x35')][_0x457d('0x42')]()['then'](respondWithResult(_0x3f7efa,null))[_0x457d('0x3b')](handleError(_0x3f7efa,null));};exports[_0x457d('0x43')]=function(_0x7abdf1,_0x545e67){var _0x481a89;var _0x450ad7=_0x7abdf1[_0x457d('0x3d')]['id'];return db[_0x457d('0x35')][_0x457d('0x3f')]({'where':{'id':_0x7abdf1[_0x457d('0x3d')]['id']}})[_0x457d('0x36')](handleEntityNotFound(_0x545e67,null))[_0x457d('0x36')](function(_0x7a1e61){if(_0x7a1e61){return _0x7a1e61['destroy']()['then'](function(_0xec7449){return _0xec7449;});}})[_0x457d('0x36')](function(_0x3e33c6){_0x481a89=_0x3e33c6;if(_0x3e33c6){if(_0x3e33c6[_0x457d('0x44')]||_0x3e33c6[_0x457d('0x45')]){return db[_0x3e33c6[_0x457d('0x44')]?_0x457d('0x46'):_0x457d('0x47')][_0x457d('0x3f')]({'where':{'id':_0x3e33c6[_0x457d('0x44')]?_0x3e33c6[_0x457d('0x44')]:_0x3e33c6[_0x457d('0x45')]},'attributes':['id',_0x457d('0x11')],'raw':!![]});}}})[_0x457d('0x36')](function(_0x4fe2f3){var _0x36e057={};if(_0x4fe2f3){_[_0x457d('0x33')](_0x36e057,_[_0x457d('0x48')](_0x481a89[_0x457d('0x49')],['createdAt',_0x457d('0x4a'),'id']));_0x36e057[_0x457d('0x4b')]=0x15;_0x36e057['statedesc']=_0x457d('0x4c');_0x36e057[_0x457d('0x4d')]=_0x4fe2f3[_0x457d('0x11')];_0x36e057['membername']=_0x7abdf1['user'][_0x457d('0x11')];_0x36e057['UserId']=_0x7abdf1[_0x457d('0x4e')]['id'];_0x36e057[_0x457d('0x4c')]=!![];_0x36e057[_0x457d('0x4f')]=moment()[_0x457d('0x50')](_0x457d('0x51'));_0x36e057[_0x457d('0x52')]=_0x481a89[_0x457d('0x53')];_0x36e057[_0x457d('0x54')]=_0x481a89[_0x457d('0x44')]?_0x457d('0x55'):_0x457d('0x56');return db[_0x457d('0x57')][_0x457d('0x3f')]({'where':{'id':_0x36e057[_0x457d('0x58')]},'attributes':['firstName',_0x457d('0x59')]})[_0x457d('0x36')](function(_0x4e865a){if(!_[_0x457d('0x5a')](_0x545e67)&&!_['isNil'](_0x4e865a[_0x457d('0x5b')])){_0x36e057[_0x457d('0x5c')]=_0x4e865a['firstName'];if(!_[_0x457d('0x5a')](_0x4e865a[_0x457d('0x59')])){_0x36e057[_0x457d('0x5c')]+='\x20'+_0x4e865a[_0x457d('0x59')];}}})['finally'](function(){return db[_0x457d('0x5d')]['create'](_0x36e057);});}})[_0x457d('0x36')](function(_0x58169c){return db[_0x457d('0x5e')][_0x457d('0x43')]({'where':{'CmHopperId':_0x450ad7}});})['then'](function(){return _0x545e67[_0x457d('0x6')](0xcc)['end']();})['catch'](handleError(_0x545e67,null));};exports['getPreview']=function(_0x3bef1c,_0x123a54){var _0x592ba9=[];return db[_0x457d('0x57')][_0x457d('0x42')]()[_0x457d('0x36')](function(_0x6eef82){_0x592ba9=_[_0x457d('0x19')](_0x6eef82);return _0x3bef1c[_0x457d('0x4e')][_0x457d('0x5f')]({'where':{'type':_0x457d('0x60'),'dialActive':!![],'dialMethod':_0x457d('0x61')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x457d('0x36')](function(_0x1230cf){if(_0x1230cf&&_0x1230cf[_0x457d('0x2b')]){return db[_0x457d('0x62')][_0x457d('0x63')](function(_0x3e80cf){var _0x420bb8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x457d('0x50')](_0x457d('0x51'))},'VoiceQueueId':{'$in':_[_0x457d('0x17')](_0x1230cf,'id')},'$or':[{'UserId':null},{'UserId':_0x3bef1c['user']['id']}]};var _0x57316a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1230cf)[_0x457d('0x32')](['dialPreviewAutoRecallMe',0x0])[_0x457d('0x17')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3bef1c[_0x457d('0x4e')]['id']}]};var _0x37b918={'$or':[_0x420bb8,_0x57316a]};var _0x97ebe7=[];if(_0x3bef1c['body']['direction']&&_0x3bef1c[_0x457d('0x41')][_0x457d('0x64')]==='prev'){if(!_['isEmpty'](_0x3bef1c[_0x457d('0x41')][_0x457d('0x65')])){_0x37b918['id']={'$in':_0x3bef1c['body'][_0x457d('0x65')]};}_0x97ebe7=[[_0x457d('0x66'),_0x457d('0x67')],[_0x457d('0x68'),_0x1230cf[0x0]['dialOrderByScheduledAt']===_0x457d('0x67')?_0x457d('0x69'):_0x457d('0x67')],db[_0x457d('0x62')][_0x457d('0x6a')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x457d('0x69')]];}else{if(!_[_0x457d('0x6b')](_0x3bef1c['body']['hopperIds'])){_0x37b918['id']={'$notIn':_0x3bef1c[_0x457d('0x41')][_0x457d('0x65')]};}_0x97ebe7=[[_0x457d('0x66'),_0x457d('0x69')],[_0x457d('0x68'),_0x1230cf[0x0][_0x457d('0x6c')]],db[_0x457d('0x62')][_0x457d('0x6a')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x457d('0x67')]];}return db[_0x457d('0x35')][_0x457d('0x6d')]({'attributes':['id',_0x457d('0x6e'),_0x457d('0x53'),'recallme'],'where':_0x37b918,'order':_0x97ebe7,'transaction':_0x3e80cf,'lock':_0x3e80cf['LOCK'][_0x457d('0x6f')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x592ba9,'include':[{'model':db[_0x457d('0x70')],'as':_0x457d('0x71'),'attributes':['id',_0x457d('0x11')]}]},{'model':db[_0x457d('0x72')],'as':_0x457d('0x73'),'attributes':['id',_0x457d('0x11')]},{'model':db[_0x457d('0x46')],'as':_0x457d('0x74'),'attributes':['id','name','dialActive']}]})[_0x457d('0x36')](function(_0x56e002){if(_0x56e002){return _0x56e002[_0x457d('0xe')]({'UserId':_0x3bef1c[_0x457d('0x4e')]['id']},{'transaction':_0x3e80cf});}});});}})[_0x457d('0x36')](handleEntityNotFound(_0x123a54,null))[_0x457d('0x36')](respondWithResult(_0x123a54,null))['catch'](handleError(_0x123a54,null));};exports[_0x457d('0x75')]=function(_0x4b4cac,_0x5758ec,_0x474599){var _0x49ceab=[];var _0x1d4181=_0x4b4cac[_0x457d('0x3d')]['id'];var _0x138abc=_0x4b4cac[_0x457d('0x4e')]['id'];return db[_0x457d('0x57')][_0x457d('0x42')]()[_0x457d('0x36')](function(_0x2ef13f){_0x49ceab=_['keys'](_0x2ef13f);return db[_0x457d('0x62')][_0x457d('0x63')](function(_0x357077){const _0x33f6fb={'id':_0x1d4181};return db['CmHopper']['findOne']({'attributes':['id','scheduledat','recallme'],'where':_0x33f6fb,'transaction':_0x357077,'lock':_0x357077[_0x457d('0x76')]['UPDATE'],'include':[{'model':db[_0x457d('0x57')],'as':_0x457d('0x77'),'attributes':_0x49ceab,'include':[{'model':db[_0x457d('0x70')],'as':_0x457d('0x71'),'attributes':['id',_0x457d('0x11')]}]},{'model':db[_0x457d('0x72')],'as':_0x457d('0x73'),'attributes':['id','name']},{'model':db[_0x457d('0x46')],'as':_0x457d('0x74'),'attributes':['id','name','dialActive']}]})[_0x457d('0x36')](function(_0x233572){if(_0x233572){return _0x233572[_0x457d('0xe')]({'UserId':_0x138abc},{'transaction':_0x357077});}});});})['then'](handleEntityNotFound(_0x5758ec,null))[_0x457d('0x36')](respondWithResult(_0x5758ec,null))[_0x457d('0x3b')](handleError(_0x5758ec,null));};exports[_0x457d('0x78')]=function(_0x3086bb,_0x3065b7){return _0x3086bb['user'][_0x457d('0x5f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x457d('0x61')},'attributes':['id'],'raw':!![]})[_0x457d('0x36')](function(_0x14d449){if(_0x14d449&&_0x14d449['length']){return db[_0x457d('0x35')][_0x457d('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x457d('0x50')](_0x457d('0x51'))},'VoiceQueueId':{'$in':_['map'](_0x14d449,'id')},'$or':[{'UserId':null},{'UserId':_0x3086bb[_0x457d('0x4e')]['id']}]}});}return 0x0;})[_0x457d('0x36')](function(_0x312757){if(!_[_0x457d('0x5a')](_0x312757)&&_[_0x457d('0x79')](_0x312757)){return _0x3065b7[_0x457d('0x6')](0xc8)[_0x457d('0x7')]({'contacts':_0x312757});}else{logger['error'](_0x457d('0x7a'),'getOpenContacts',0x194,_0x457d('0x7b'));_0x3065b7[_0x457d('0xf')](0x194);}})[_0x457d('0x3b')](handleError(_0x3065b7,null));};exports[_0x457d('0x7c')]=function(_0x9c2df,_0x218b80){var _0x308916=shared['timezones'];var _0x3aac80=[];_[_0x457d('0x17')](_0x308916,function(_0x30a4f3){_0x3aac80[_0x457d('0x7d')]({'id':_0x30a4f3['name'],'name':_0x30a4f3['name'],'utcOffset':_0x30a4f3[_0x457d('0x7e')]});});return _0x218b80[_0x457d('0x6')](0xc8)[_0x457d('0x7')]({'tz':_0x3aac80});};exports['getTimezone']=function(_0x497739,_0x445215){var _0x5b65f3=shared[_0x457d('0x7f')];var _0x36efe4={};if(!_[_0x457d('0x5a')](_0x5b65f3[_0x497739['body']['id']]))_0x36efe4=_0x5b65f3[_0x497739[_0x457d('0x41')]['id']];return _0x445215['status'](0xc8)[_0x457d('0x7')](_0x36efe4);};
\ No newline at end of file
index 04bda94..427dc08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x16ae34,_0x1dc6d){var _0x184836=function(_0x1e48b7){while(--_0x1e48b7){_0x16ae34['push'](_0x16ae34['shift']());}};_0x184836(++_0x1dc6d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3bb66b,_0xa516e1){_0x3bb66b=_0x3bb66b-0x0;var _0x27ab0a=_0xbd51[_0x3bb66b];return _0x27ab0a;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x3f9fc8,_0x3bdb87){var _0x5f199c=function(_0x91fc6d){while(--_0x91fc6d){_0x3f9fc8['push'](_0x3f9fc8['shift']());}};_0x5f199c(++_0x3bdb87);}(_0xeff8,0x186));var _0x8eff=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xeff8[_0x37b7b6];return _0x10c4c3;};'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
index e0a91d9..e5bf72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x900f=['util','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','info','stringify','catch','error','message','find','ShowCmHopper','debug','CreateCmHopper','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','UserId','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','CmHopperFinal','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','CountReScheduled','GetContactRecallMe','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','User','CmList','List','lodash'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x900f,0x18a));var _0xf900=function(_0x3a3a6a,_0x5eb6a9){_0x3a3a6a=_0x3a3a6a-0x0;var _0xa89294=_0x900f[_0x3a3a6a];return _0xa89294;};'use strict';var _=require(_0xf900('0x0'));var util=require(_0xf900('0x1'));var moment=require('moment');var BPromise=require(_0xf900('0x2'));var db=require(_0xf900('0x3'))['db'];var logger=require(_0xf900('0x4'))(_0xf900('0x5'));exports[_0xf900('0x6')]=function(_0x29b960){var _0x594ce8=this;return new Promise(function(_0x2a164c,_0x471fe9){return db[_0xf900('0x7')][_0xf900('0x8')]({'raw':_0x29b960[_0xf900('0x9')]?_0x29b960['options'][_0xf900('0xa')]===undefined?!![]:![]:!![],'where':_0x29b960['options']?_0x29b960[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':_0x29b960[_0xf900('0x9')]?_0x29b960['options'][_0xf900('0xc')]||null:null,'limit':_0x29b960[_0xf900('0x9')]?_0x29b960[_0xf900('0x9')]['limit']||null:null,'include':_0x29b960[_0xf900('0x9')]?_0x29b960[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x29b960['options'][_0xf900('0xd')],function(_0x209f65){return{'model':db[_0x209f65[_0xf900('0xf')]],'as':_0x209f65['as'],'attributes':_0x209f65['attributes'],'include':_0x209f65[_0xf900('0xd')]?_[_0xf900('0xe')](_0x209f65['include'],function(_0x2157ce){return{'model':db[_0x2157ce[_0xf900('0xf')]],'as':_0x2157ce['as'],'attributes':_0x2157ce[_0xf900('0xc')],'include':_0x2157ce['include']?_[_0xf900('0xe')](_0x2157ce[_0xf900('0xd')],function(_0x13e667){return{'model':db[_0x13e667['model']],'as':_0x13e667['as'],'attributes':_0x13e667[_0xf900('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0x3e5339){logger[_0xf900('0x11')](_0xf900('0x6'),_0x29b960);logger['debug']('GetCmHopper',_0x29b960,JSON[_0xf900('0x12')](_0x3e5339));_0x2a164c(_0x3e5339);})[_0xf900('0x13')](function(_0x3a6afe){logger[_0xf900('0x14')]('GetCmHopper',_0x3a6afe[_0xf900('0x15')],_0x29b960);_0x471fe9(_0x594ce8['error'](0x1f4,_0x3a6afe[_0xf900('0x15')]));});});};exports['ShowCmHopper']=function(_0x212d42){var _0x4868ea=this;return new Promise(function(_0x281c4c,_0x3d116d){return db[_0xf900('0x7')][_0xf900('0x16')]({'raw':_0x212d42['options']?_0x212d42[_0xf900('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x212d42['options']?_0x212d42['options'][_0xf900('0xb')]||null:null,'attributes':_0x212d42[_0xf900('0x9')]?_0x212d42['options']['attributes']||null:null,'include':_0x212d42['options']?_0x212d42[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x212d42[_0xf900('0x9')]['include'],function(_0xa1c1cb){return{'model':db[_0xa1c1cb[_0xf900('0xf')]],'as':_0xa1c1cb['as'],'attributes':_0xa1c1cb['attributes'],'include':_0xa1c1cb[_0xf900('0xd')]?_[_0xf900('0xe')](_0xa1c1cb[_0xf900('0xd')],function(_0x5e7a66){return{'model':db[_0x5e7a66[_0xf900('0xf')]],'as':_0x5e7a66['as'],'attributes':_0x5e7a66['attributes'],'include':_0x5e7a66[_0xf900('0xd')]?_[_0xf900('0xe')](_0x5e7a66[_0xf900('0xd')],function(_0x33a66c){return{'model':db[_0x33a66c[_0xf900('0xf')]],'as':_0x33a66c['as'],'attributes':_0x33a66c[_0xf900('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0xa6f659){logger[_0xf900('0x11')](_0xf900('0x17'),_0x212d42);logger[_0xf900('0x18')](_0xf900('0x17'),_0x212d42,JSON[_0xf900('0x12')](_0xa6f659));_0x281c4c(_0xa6f659);})[_0xf900('0x13')](function(_0x1e44f3){logger[_0xf900('0x14')](_0xf900('0x17'),_0x1e44f3[_0xf900('0x15')],_0x212d42);_0x3d116d(_0x4868ea[_0xf900('0x14')](0x1f4,_0x1e44f3[_0xf900('0x15')]));});});};exports[_0xf900('0x19')]=function(_0x24bb0a){var _0x68308d=this;return new Promise(function(_0x5e5782,_0x59ad38){return db[_0xf900('0x7')]['create'](_0x24bb0a[_0xf900('0x1a')],{'raw':_0x24bb0a[_0xf900('0x9')]?_0x24bb0a[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![]})[_0xf900('0x10')](function(_0x552be2){logger['info'](_0xf900('0x19'),_0x24bb0a);logger['debug'](_0xf900('0x19'),_0x24bb0a,JSON[_0xf900('0x12')](_0x552be2));_0x5e5782(_0x552be2);})[_0xf900('0x13')](function(_0x481865){logger[_0xf900('0x14')](_0xf900('0x19'),_0x481865[_0xf900('0x15')],_0x24bb0a);_0x59ad38(_0x68308d['error'](0x1f4,_0x481865[_0xf900('0x15')]));});});};exports[_0xf900('0x1b')]=function(_0x1a93b0){var _0x314105=this;return new Promise(function(_0x42fcfc,_0x4493ce){return db['CmHopper'][_0xf900('0x1c')](_0x1a93b0[_0xf900('0x1a')],{'raw':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0['options'][_0xf900('0xc')]||null:null,'limit':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0[_0xf900('0x9')][_0xf900('0x1d')]||null:null})[_0xf900('0x10')](function(_0x5f00be){logger[_0xf900('0x11')](_0xf900('0x1b'),_0x1a93b0);logger[_0xf900('0x11')](_0xf900('0x1e'),JSON[_0xf900('0x12')](_0x1a93b0['options'][_0xf900('0xb')]),_0x1a93b0[_0xf900('0x1a')]['active']);logger['debug'](_0xf900('0x1b'),_0x1a93b0,JSON[_0xf900('0x12')](_0x5f00be));_0x42fcfc(_0x5f00be);})[_0xf900('0x13')](function(_0x12ee0f){logger[_0xf900('0x14')](_0xf900('0x1b'),_0x12ee0f[_0xf900('0x15')],_0x1a93b0);_0x4493ce(_0x314105[_0xf900('0x14')](0x1f4,_0x12ee0f[_0xf900('0x15')]));});});};exports['DestroyCmHopper']=function(_0x17f81c){var _0x252c0a=this;return new Promise(function(_0x32559c,_0x194f97){return db[_0xf900('0x7')][_0xf900('0x1f')]({'where':_0x17f81c[_0xf900('0x9')]?_0x17f81c[_0xf900('0x9')][_0xf900('0xb')]||null:null})[_0xf900('0x10')](function(_0x42cd20){logger[_0xf900('0x11')]('DestroyCmHopper',_0x17f81c);logger[_0xf900('0x18')](_0xf900('0x20'),_0x17f81c,JSON['stringify'](_0x42cd20));_0x32559c(_0x42cd20);})[_0xf900('0x13')](function(_0x5b1cc4){logger[_0xf900('0x14')](_0xf900('0x20'),_0x5b1cc4['message'],_0x17f81c);_0x194f97(_0x252c0a[_0xf900('0x14')](0x1f4,_0x5b1cc4[_0xf900('0x15')]));});});};exports[_0xf900('0x21')]=function(_0x28051e){var _0x161559=this;return new Promise(function(_0x2fce40,_0xb749ed){return db[_0xf900('0x22')][_0xf900('0x23')]()[_0xf900('0x10')](function(_0x6cf7a1){return db[_0xf900('0x24')][_0xf900('0x25')](function(_0x1fba41){return db[_0xf900('0x7')][_0xf900('0x8')]({'where':_0x28051e['options']?_0x28051e[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':_0x28051e[_0xf900('0x9')]?_0x28051e[_0xf900('0x9')]['attributes']||null:null,'limit':_0x28051e[_0xf900('0x9')]?_0x28051e['options']['limit']||null:null,'order':_0x28051e[_0xf900('0x9')]?_0x28051e[_0xf900('0x9')]['order']||null:null,'transaction':_0x1fba41,'lock':_0x1fba41[_0xf900('0x26')][_0xf900('0x27')],'include':[{'model':db[_0xf900('0x22')],'as':_0xf900('0x28'),'attributes':_[_0xf900('0x29')](_0x6cf7a1)},{'model':db['User'],'as':_0xf900('0x2a'),'attributes':['id',_0xf900('0x2b'),_0xf900('0x2c')]}]})[_0xf900('0x10')](function(_0x4a67ea){var _0x680ab2=[];var _0x3c82ea=[];for(var _0x32771d=0x0;_0x32771d<_0x4a67ea['length'];_0x32771d+=0x1){var _0x9cc65=_0x4a67ea[_0x32771d][_0xf900('0x2d')];if(_0x9cc65===null){_0x680ab2[_0xf900('0x2e')](_0x4a67ea[_0x32771d][_0xf900('0x1c')](_0x28051e[_0xf900('0x1a')],{'transaction':_0x1fba41}));}else if(!_0x3c82ea[_0xf900('0x2f')](_0x9cc65)){_0x3c82ea[_0xf900('0x2e')](_0x9cc65);_0x680ab2[_0xf900('0x2e')](_0x4a67ea[_0x32771d][_0xf900('0x1c')](_0x28051e[_0xf900('0x1a')],{'transaction':_0x1fba41}));}}return BPromise[_0xf900('0x30')](_0x680ab2);});})['then'](function(_0x2d43d8){logger['info'](_0xf900('0x21'),_0x28051e);if(_0x2d43d8[_0xf900('0x31')]>0x0){logger[_0xf900('0x11')](_0xf900('0x32'),_0x2d43d8[0x0][_0xf900('0x33')]['id'],_0x2d43d8[0x0][_0xf900('0x33')][_0xf900('0x34')],_0x2d43d8[0x0][_0xf900('0x33')][_0xf900('0x35')]);}logger['debug'](_0xf900('0x21'),_0x28051e,JSON[_0xf900('0x12')](_0x2d43d8));_0x2fce40(_0x2d43d8);})['catch'](function(_0x18720c){logger[_0xf900('0x14')](_0xf900('0x21'),_0x18720c[_0xf900('0x15')],_0x28051e);_0xb749ed(_0x161559[_0xf900('0x14')](0x1f4,_0x18720c[_0xf900('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0xe7b082){var _0x4c2cc5=this;return new Promise(function(_0x58f2e3,_0xd8a730){return db[_0xf900('0x24')][_0xf900('0x25')](function(_0x52b37e){return db[_0xf900('0x36')]['create'](_0xe7b082['body'],{'raw':_0xe7b082[_0xf900('0x9')]?_0xe7b082[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'transaction':_0x52b37e})[_0xf900('0x10')](function(){logger[_0xf900('0x11')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xe7b082[_0xf900('0x9')][_0xf900('0xb')]),_0xe7b082[_0xf900('0x9')][_0xf900('0xb')][_0xf900('0x35')]);return db[_0xf900('0x7')][_0xf900('0x1f')]({'where':_0xe7b082[_0xf900('0x9')]?_0xe7b082[_0xf900('0x9')][_0xf900('0xb')]||null:null,'transaction':_0x52b37e});});})[_0xf900('0x10')](function(_0x298a31){logger[_0xf900('0x11')](_0xf900('0x37'),_0xe7b082);logger[_0xf900('0x18')](_0xf900('0x37'),_0xe7b082,JSON[_0xf900('0x12')](_0x298a31));_0x58f2e3(_0x298a31);})['catch'](function(_0x1f393f){logger[_0xf900('0x14')](_0xf900('0x37'),_0x1f393f['message'],_0xe7b082);_0xd8a730(_0x4c2cc5[_0xf900('0x14')](0x1f4,_0x1f393f['message']));});});};exports['CountReScheduled']=function(_0x1591b6){var _0x1f4e86=this;return new Promise(function(_0x352580,_0x9b5fd8){return db[_0xf900('0x7')][_0xf900('0x8')]({'raw':_0x1591b6['options']?_0x1591b6[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'where':_0x1591b6[_0xf900('0x9')]?_0x1591b6[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':[[db[_0xf900('0x24')]['fn'](_0xf900('0x38'),db[_0xf900('0x24')]['fn']('IF',db[_0xf900('0x24')]['literal'](_0xf900('0x39')+util[_0xf900('0x3a')](_0xf900('0x3b'),moment()[_0xf900('0x3a')](_0xf900('0x3c')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xf900('0x10')](function(_0x525995){logger['info'](_0xf900('0x3d'),_0x1591b6);logger['debug'](_0xf900('0x3d'),_0x1591b6,JSON[_0xf900('0x12')](_0x525995));_0x352580(_0x525995);})[_0xf900('0x13')](function(_0x63e71f){logger[_0xf900('0x14')](_0xf900('0x3d'),_0x63e71f[_0xf900('0x15')],_0x1591b6);_0x9b5fd8(_0x1f4e86[_0xf900('0x14')](0x1f4,_0x63e71f[_0xf900('0x15')]));});});};exports[_0xf900('0x3e')]=function(_0x9b7654){var _0x19991a=this;return new Promise(function(_0x280d64,_0x37488d){return db['CmContact'][_0xf900('0x23')]()[_0xf900('0x10')](function(){return db[_0xf900('0x24')][_0xf900('0x25')](function(_0x3efefd){return db[_0xf900('0x7')][_0xf900('0x8')]({'where':_0x9b7654[_0xf900('0x9')]?_0x9b7654[_0xf900('0x9')]['where']||null:null,'attributes':_0x9b7654[_0xf900('0x9')]?_0x9b7654[_0xf900('0x9')][_0xf900('0xc')]||null:null,'limit':0x1,'order':_0x9b7654[_0xf900('0x9')]?_0x9b7654['options']['order']||null:null,'group':db[_0xf900('0x7')]['UserId'],'transaction':_0x3efefd,'lock':_0x3efefd[_0xf900('0x26')]['UPDATE'],'include':_0x9b7654[_0xf900('0x9')]?_0x9b7654[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x9b7654[_0xf900('0x9')][_0xf900('0xd')],function(_0x484066){return{'model':db[_0x484066['model']],'as':_0x484066['as'],'attributes':_0x484066[_0xf900('0xc')],'include':_0x484066[_0xf900('0xd')]?_[_0xf900('0xe')](_0x484066[_0xf900('0xd')],function(_0x405557){return{'model':db[_0x405557[_0xf900('0xf')]],'as':_0x405557['as'],'attributes':_0x405557[_0xf900('0xc')],'include':_0x405557[_0xf900('0xd')]?_[_0xf900('0xe')](_0x405557['include'],function(_0x2a4d4b){return{'model':db[_0x2a4d4b['model']],'as':_0x2a4d4b['as'],'attributes':_0x2a4d4b[_0xf900('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0xb40a0b){var _0x335668=[];for(var _0x3ad88b=0x0;_0x3ad88b<_0xb40a0b[_0xf900('0x31')];_0x3ad88b+=0x1){_0x335668['push'](_0xb40a0b[_0x3ad88b][_0xf900('0x1c')](_0x9b7654['body'],{'transaction':_0x3efefd}));}return BPromise['all'](_0x335668);});})[_0xf900('0x10')](function(_0x16b67e){logger[_0xf900('0x11')]('GetContactRecallMe',_0x9b7654);logger[_0xf900('0x18')](_0xf900('0x3e'),_0x9b7654,JSON[_0xf900('0x12')](_0x16b67e));_0x280d64(_0x16b67e);})[_0xf900('0x13')](function(_0xd3fdf){logger['error']('GetContactRecallMe',_0xd3fdf[_0xf900('0x15')],_0x9b7654);_0x37488d(_0x19991a[_0xf900('0x14')](0x1f4,_0xd3fdf[_0xf900('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x555530){var _0x154523=this;return new Promise(function(_0x353140,_0xbe90ed){db[_0xf900('0x22')][_0xf900('0x23')]()['then'](function(_0x2cf12e){return db[_0xf900('0x7')][_0xf900('0x8')]({'raw':_0x555530[_0xf900('0x9')]?_0x555530[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'where':_0x555530[_0xf900('0x9')]?_0x555530['options'][_0xf900('0xb')]||null:null,'attributes':_0x555530[_0xf900('0x9')]?_0x555530[_0xf900('0x9')][_0xf900('0xc')]||null:null,'limit':_0x555530[_0xf900('0x9')]?_0x555530['options'][_0xf900('0x1d')]||null:null,'include':_0x555530[_0xf900('0x9')]?_0x555530[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x555530[_0xf900('0x9')][_0xf900('0xd')],function(_0x2acf21){return{'model':db[_0x2acf21['model']],'as':_0x2acf21['as'],'attributes':_0x2acf21['as']===_0xf900('0x28')?_[_0xf900('0x29')](_0x2cf12e):_0x2acf21[_0xf900('0xc')],'include':_0x2acf21['include']?_['map'](_0x2acf21['include'],function(_0x94c3f1){return{'model':db[_0x94c3f1['model']],'as':_0x94c3f1['as'],'attributes':_0x94c3f1[_0xf900('0xc')],'include':_0x94c3f1[_0xf900('0xd')]?_['map'](_0x94c3f1[_0xf900('0xd')],function(_0x1c8d51){return{'model':db[_0x1c8d51[_0xf900('0xf')]],'as':_0x1c8d51['as'],'attributes':_0x1c8d51['attributes']};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0x1ad422){logger['info']('GetCmHopper',_0x555530);logger['debug']('GetCmHopper',_0x555530,JSON[_0xf900('0x12')](_0x1ad422));_0x353140(_0x1ad422);})[_0xf900('0x13')](function(_0x477a72){logger[_0xf900('0x14')](_0xf900('0x6'),_0x477a72[_0xf900('0x15')],_0x555530);_0xbe90ed(_0x154523[_0xf900('0x14')](0x1f4,_0x477a72['message']));});});});};exports[_0xf900('0x3f')]=function(_0x46f3b3){var _0x40f6c8=this;return new Promise(function(_0x2a5462,_0x64f93f){return db[_0xf900('0x22')][_0xf900('0x40')]({'raw':!![],'where':{'phone':_0x46f3b3[_0xf900('0x9')][_0xf900('0xb')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xf900('0x41')]]})[_0xf900('0x10')](function(_0x21a7a5){logger[_0xf900('0x11')]('getContactByPhone',_0x46f3b3);logger[_0xf900('0x18')](_0xf900('0x42'),_0x46f3b3,JSON[_0xf900('0x12')](_0x21a7a5));_0x2a5462(_0x21a7a5);})[_0xf900('0x13')](function(_0x507c33){logger[_0xf900('0x14')](_0xf900('0x42'),_0x507c33[_0xf900('0x15')],_0x46f3b3);_0x64f93f(_0x40f6c8['error'](0x1f4,_0x507c33[_0xf900('0x15')]));});});};exports[_0xf900('0x43')]=function(_0x5d6760){var _0x5afe23=this;return new Promise(function(_0x5bcf9d,_0x5e57a0){return db[_0xf900('0x24')]['transaction'](function(_0x8431c8){var _0x3c3f4e=_0x5d6760[_0xf900('0x9')]&&_0x5d6760[_0xf900('0x9')][_0xf900('0xb')]?_0x5d6760[_0xf900('0x9')][_0xf900('0xb')]:{};return db[_0xf900('0x7')][_0xf900('0x1c')](_0x5d6760[_0xf900('0x1a')],{'where':_0x3c3f4e,'transaction':_0x8431c8})[_0xf900('0x10')](function(_0x416918){logger[_0xf900('0x11')]('ResetActiveCalls',_0x5d6760);logger[_0xf900('0x18')]('ResetActiveCalls',_0x5d6760,JSON[_0xf900('0x12')](_0x416918));_0x5bcf9d(_0x416918);})[_0xf900('0x13')](function(_0x534292){logger['error'](_0xf900('0x43'),_0x534292[_0xf900('0x15')],_0x5d6760);_0x5e57a0(_0x5afe23[_0xf900('0x14')](0x1f4,_0x534292[_0xf900('0x15')]));});});});};exports[_0xf900('0x44')]=function(_0x25fb0e){var _0x3c559a=this;var _0x456e3f=_0x25fb0e[_0xf900('0x1a')][_0xf900('0xb')][_0xf900('0x45')];var _0x16d50f=_0x25fb0e[_0xf900('0x1a')]['where'][_0xf900('0x46')];var _0x15e5e1=_0x25fb0e[_0xf900('0x1a')][_0xf900('0xb')][_0xf900('0x47')];return new Promise(function(_0x558b13,_0x46b815){return db[_0xf900('0x7')][_0xf900('0x8')]({'where':{'voiceQueueId':{'$in':_0x456e3f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf900('0x24')]['literal'](_0xf900('0x48')+_0x16d50f+_0xf900('0x49')),'$gt':db['sequelize'][_0xf900('0x4a')](_0xf900('0x4b'))}},'UserId':{'$in':_0x15e5e1}},'include':[{'model':db['CmContact'],'as':_0xf900('0x28')},{'model':db[_0xf900('0x4c')],'as':'Agent','attributes':['id','name',_0xf900('0x2c')]},{'model':db[_0xf900('0x4d')],'as':_0xf900('0x4e')}]})[_0xf900('0x10')](function(_0x2dd713){if(_0x2dd713['length']>0x0){return db['sequelize']['transaction'](function(_0x23302f){return db[_0xf900('0x7')][_0xf900('0x1c')]({'recallmeNotifiedDate':db[_0xf900('0x24')][_0xf900('0x4a')](_0xf900('0x4b'))},{'where':{'id':{'$in':_[_0xf900('0xe')](_0x2dd713,'id')}},'transaction':_0x23302f})[_0xf900('0x10')](function(){_0x558b13(_0x2dd713);})[_0xf900('0x13')](function(_0x212b55){logger['error'](_0xf900('0x44'),_0x212b55[_0xf900('0x15')],_0x25fb0e);_0x46b815(_0x3c559a[_0xf900('0x14')](0x1f4,_0x212b55[_0xf900('0x15')]));});})[_0xf900('0x13')](function(_0x1fcdb7){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x1fcdb7[_0xf900('0x15')],_0x25fb0e);_0x46b815(_0x3c559a[_0xf900('0x14')](0x1f4,_0x1fcdb7[_0xf900('0x15')]));});}else{_0x558b13(_0x2dd713);}});});};
\ No newline at end of file
+var _0xb17e=['where','attributes','limit','include','model','map','then','info','stringify','catch','error','message','ShowCmHopper','find','debug','CreateCmHopper','body','update','UpdateCmHopper','active','destroy','DestroyCmHopper','GetContactDialer','describe','transaction','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','UserId','push','includes','all','length','dataValues','ContactId','sequelize','CmHopperFinal','create','MoveContactManagedDialer','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xb17e,0xdc));var _0xeb17=function(_0x54fe18,_0x57da31){_0x54fe18=_0x54fe18-0x0;var _0x2a7ce8=_0xb17e[_0x54fe18];return _0x2a7ce8;};'use strict';var _=require(_0xeb17('0x0'));var util=require(_0xeb17('0x1'));var moment=require(_0xeb17('0x2'));var BPromise=require('bluebird');var db=require(_0xeb17('0x3'))['db'];var logger=require(_0xeb17('0x4'))(_0xeb17('0x5'));exports[_0xeb17('0x6')]=function(_0x2bdf87){var _0x36d65b=this;return new Promise(function(_0x13f5e4,_0x580a57){return db[_0xeb17('0x7')][_0xeb17('0x8')]({'raw':_0x2bdf87[_0xeb17('0x9')]?_0x2bdf87[_0xeb17('0x9')][_0xeb17('0xa')]===undefined?!![]:![]:!![],'where':_0x2bdf87[_0xeb17('0x9')]?_0x2bdf87[_0xeb17('0x9')][_0xeb17('0xb')]||null:null,'attributes':_0x2bdf87[_0xeb17('0x9')]?_0x2bdf87['options'][_0xeb17('0xc')]||null:null,'limit':_0x2bdf87[_0xeb17('0x9')]?_0x2bdf87[_0xeb17('0x9')][_0xeb17('0xd')]||null:null,'include':_0x2bdf87[_0xeb17('0x9')]?_0x2bdf87['options'][_0xeb17('0xe')]?_['map'](_0x2bdf87[_0xeb17('0x9')][_0xeb17('0xe')],function(_0x291d3d){return{'model':db[_0x291d3d[_0xeb17('0xf')]],'as':_0x291d3d['as'],'attributes':_0x291d3d[_0xeb17('0xc')],'include':_0x291d3d[_0xeb17('0xe')]?_[_0xeb17('0x10')](_0x291d3d[_0xeb17('0xe')],function(_0x258795){return{'model':db[_0x258795[_0xeb17('0xf')]],'as':_0x258795['as'],'attributes':_0x258795['attributes'],'include':_0x258795[_0xeb17('0xe')]?_[_0xeb17('0x10')](_0x258795[_0xeb17('0xe')],function(_0x2a17be){return{'model':db[_0x2a17be[_0xeb17('0xf')]],'as':_0x2a17be['as'],'attributes':_0x2a17be[_0xeb17('0xc')]};}):[]};}):[]};}):[]:[]})[_0xeb17('0x11')](function(_0x1aed89){logger[_0xeb17('0x12')](_0xeb17('0x6'),_0x2bdf87);logger['debug'](_0xeb17('0x6'),_0x2bdf87,JSON[_0xeb17('0x13')](_0x1aed89));_0x13f5e4(_0x1aed89);})[_0xeb17('0x14')](function(_0x41f544){logger[_0xeb17('0x15')](_0xeb17('0x6'),_0x41f544['message'],_0x2bdf87);_0x580a57(_0x36d65b['error'](0x1f4,_0x41f544[_0xeb17('0x16')]));});});};exports[_0xeb17('0x17')]=function(_0x3100e8){var _0xe95b2e=this;return new Promise(function(_0x34cc82,_0x528df4){return db[_0xeb17('0x7')][_0xeb17('0x18')]({'raw':_0x3100e8['options']?_0x3100e8[_0xeb17('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x3100e8[_0xeb17('0x9')]?_0x3100e8[_0xeb17('0x9')][_0xeb17('0xb')]||null:null,'attributes':_0x3100e8[_0xeb17('0x9')]?_0x3100e8['options'][_0xeb17('0xc')]||null:null,'include':_0x3100e8[_0xeb17('0x9')]?_0x3100e8['options'][_0xeb17('0xe')]?_[_0xeb17('0x10')](_0x3100e8[_0xeb17('0x9')][_0xeb17('0xe')],function(_0x338265){return{'model':db[_0x338265[_0xeb17('0xf')]],'as':_0x338265['as'],'attributes':_0x338265[_0xeb17('0xc')],'include':_0x338265[_0xeb17('0xe')]?_[_0xeb17('0x10')](_0x338265[_0xeb17('0xe')],function(_0x3c55c8){return{'model':db[_0x3c55c8['model']],'as':_0x3c55c8['as'],'attributes':_0x3c55c8[_0xeb17('0xc')],'include':_0x3c55c8['include']?_[_0xeb17('0x10')](_0x3c55c8[_0xeb17('0xe')],function(_0x6b56c9){return{'model':db[_0x6b56c9[_0xeb17('0xf')]],'as':_0x6b56c9['as'],'attributes':_0x6b56c9[_0xeb17('0xc')]};}):[]};}):[]};}):[]:[]})[_0xeb17('0x11')](function(_0x2764fd){logger[_0xeb17('0x12')](_0xeb17('0x17'),_0x3100e8);logger[_0xeb17('0x19')](_0xeb17('0x17'),_0x3100e8,JSON[_0xeb17('0x13')](_0x2764fd));_0x34cc82(_0x2764fd);})['catch'](function(_0x4a2512){logger['error']('ShowCmHopper',_0x4a2512[_0xeb17('0x16')],_0x3100e8);_0x528df4(_0xe95b2e[_0xeb17('0x15')](0x1f4,_0x4a2512[_0xeb17('0x16')]));});});};exports[_0xeb17('0x1a')]=function(_0x38e44b){var _0xc0333c=this;return new Promise(function(_0xb55485,_0x37d976){return db['CmHopper']['create'](_0x38e44b[_0xeb17('0x1b')],{'raw':_0x38e44b[_0xeb17('0x9')]?_0x38e44b[_0xeb17('0x9')][_0xeb17('0xa')]===undefined?!![]:![]:!![]})[_0xeb17('0x11')](function(_0x51e097){logger[_0xeb17('0x12')](_0xeb17('0x1a'),_0x38e44b);logger[_0xeb17('0x19')]('CreateCmHopper',_0x38e44b,JSON[_0xeb17('0x13')](_0x51e097));_0xb55485(_0x51e097);})[_0xeb17('0x14')](function(_0x29efa6){logger[_0xeb17('0x15')](_0xeb17('0x1a'),_0x29efa6[_0xeb17('0x16')],_0x38e44b);_0x37d976(_0xc0333c['error'](0x1f4,_0x29efa6[_0xeb17('0x16')]));});});};exports['UpdateCmHopper']=function(_0x4093eb){var _0x4620d6=this;return new Promise(function(_0x2217f4,_0x13b3b0){return db['CmHopper'][_0xeb17('0x1c')](_0x4093eb[_0xeb17('0x1b')],{'raw':_0x4093eb[_0xeb17('0x9')]?_0x4093eb[_0xeb17('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4093eb['options']?_0x4093eb['options'][_0xeb17('0xb')]||null:null,'attributes':_0x4093eb[_0xeb17('0x9')]?_0x4093eb[_0xeb17('0x9')]['attributes']||null:null,'limit':_0x4093eb['options']?_0x4093eb[_0xeb17('0x9')][_0xeb17('0xd')]||null:null})[_0xeb17('0x11')](function(_0x17aa00){logger[_0xeb17('0x12')](_0xeb17('0x1d'),_0x4093eb);logger[_0xeb17('0x12')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xeb17('0x13')](_0x4093eb[_0xeb17('0x9')][_0xeb17('0xb')]),_0x4093eb['body'][_0xeb17('0x1e')]);logger['debug'](_0xeb17('0x1d'),_0x4093eb,JSON['stringify'](_0x17aa00));_0x2217f4(_0x17aa00);})[_0xeb17('0x14')](function(_0x31264a){logger[_0xeb17('0x15')](_0xeb17('0x1d'),_0x31264a[_0xeb17('0x16')],_0x4093eb);_0x13b3b0(_0x4620d6[_0xeb17('0x15')](0x1f4,_0x31264a['message']));});});};exports['DestroyCmHopper']=function(_0x5a465b){var _0x55f6fa=this;return new Promise(function(_0x51047e,_0x4a8a19){return db[_0xeb17('0x7')][_0xeb17('0x1f')]({'where':_0x5a465b['options']?_0x5a465b['options'][_0xeb17('0xb')]||null:null})[_0xeb17('0x11')](function(_0x2bca78){logger[_0xeb17('0x12')](_0xeb17('0x20'),_0x5a465b);logger[_0xeb17('0x19')](_0xeb17('0x20'),_0x5a465b,JSON[_0xeb17('0x13')](_0x2bca78));_0x51047e(_0x2bca78);})[_0xeb17('0x14')](function(_0x42eb80){logger[_0xeb17('0x15')](_0xeb17('0x20'),_0x42eb80[_0xeb17('0x16')],_0x5a465b);_0x4a8a19(_0x55f6fa[_0xeb17('0x15')](0x1f4,_0x42eb80[_0xeb17('0x16')]));});});};exports[_0xeb17('0x21')]=function(_0x4f1bb7){var _0x5c3600=this;return new Promise(function(_0xf2a658,_0x17b652){return db['CmContact'][_0xeb17('0x22')]()[_0xeb17('0x11')](function(_0x152156){return db['sequelize'][_0xeb17('0x23')](function(_0x1d0285){return db[_0xeb17('0x7')][_0xeb17('0x8')]({'where':_0x4f1bb7[_0xeb17('0x9')]?_0x4f1bb7[_0xeb17('0x9')][_0xeb17('0xb')]||null:null,'attributes':_0x4f1bb7[_0xeb17('0x9')]?_0x4f1bb7[_0xeb17('0x9')][_0xeb17('0xc')]||null:null,'limit':_0x4f1bb7[_0xeb17('0x9')]?_0x4f1bb7[_0xeb17('0x9')][_0xeb17('0xd')]||null:null,'order':_0x4f1bb7[_0xeb17('0x9')]?_0x4f1bb7['options'][_0xeb17('0x24')]||null:null,'transaction':_0x1d0285,'lock':_0x1d0285[_0xeb17('0x25')][_0xeb17('0x26')],'include':[{'model':db[_0xeb17('0x27')],'as':_0xeb17('0x28'),'attributes':_[_0xeb17('0x29')](_0x152156)},{'model':db[_0xeb17('0x2a')],'as':_0xeb17('0x2b'),'attributes':['id',_0xeb17('0x2c'),_0xeb17('0x2d')]}]})[_0xeb17('0x11')](function(_0x393bce){var _0x400b21=[];var _0x856052=[];for(var _0x29ed70=0x0;_0x29ed70<_0x393bce['length'];_0x29ed70+=0x1){var _0x26f398=_0x393bce[_0x29ed70][_0xeb17('0x2e')];if(_0x26f398===null){_0x400b21[_0xeb17('0x2f')](_0x393bce[_0x29ed70][_0xeb17('0x1c')](_0x4f1bb7[_0xeb17('0x1b')],{'transaction':_0x1d0285}));}else if(!_0x856052[_0xeb17('0x30')](_0x26f398)){_0x856052['push'](_0x26f398);_0x400b21['push'](_0x393bce[_0x29ed70]['update'](_0x4f1bb7['body'],{'transaction':_0x1d0285}));}}return BPromise[_0xeb17('0x31')](_0x400b21);});})[_0xeb17('0x11')](function(_0x44a9ae){logger[_0xeb17('0x12')](_0xeb17('0x21'),_0x4f1bb7);if(_0x44a9ae[_0xeb17('0x32')]>0x0){logger[_0xeb17('0x12')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x44a9ae[0x0][_0xeb17('0x33')]['id'],_0x44a9ae[0x0]['dataValues'][_0xeb17('0x34')],_0x44a9ae[0x0][_0xeb17('0x33')]['active']);}logger[_0xeb17('0x19')]('GetContactDialer',_0x4f1bb7,JSON[_0xeb17('0x13')](_0x44a9ae));_0xf2a658(_0x44a9ae);})[_0xeb17('0x14')](function(_0x236328){logger[_0xeb17('0x15')](_0xeb17('0x21'),_0x236328['message'],_0x4f1bb7);_0x17b652(_0x5c3600[_0xeb17('0x15')](0x1f4,_0x236328[_0xeb17('0x16')]));});});});};exports['MoveContactManagedDialer']=function(_0x57285e){var _0x4aa240=this;return new Promise(function(_0xe4683c,_0x39d3e){return db[_0xeb17('0x35')]['transaction'](function(_0x19a179){return db[_0xeb17('0x36')][_0xeb17('0x37')](_0x57285e['body'],{'raw':_0x57285e[_0xeb17('0x9')]?_0x57285e[_0xeb17('0x9')][_0xeb17('0xa')]===undefined?!![]:![]:!![],'transaction':_0x19a179})[_0xeb17('0x11')](function(){logger[_0xeb17('0x12')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xeb17('0x13')](_0x57285e['options']['where']),_0x57285e[_0xeb17('0x9')][_0xeb17('0xb')][_0xeb17('0x1e')]);return db[_0xeb17('0x7')]['destroy']({'where':_0x57285e[_0xeb17('0x9')]?_0x57285e['options'][_0xeb17('0xb')]||null:null,'transaction':_0x19a179});});})['then'](function(_0x1ab139){logger[_0xeb17('0x12')](_0xeb17('0x38'),_0x57285e);logger[_0xeb17('0x19')]('MoveContactManagedDialer',_0x57285e,JSON[_0xeb17('0x13')](_0x1ab139));_0xe4683c(_0x1ab139);})[_0xeb17('0x14')](function(_0x3211d2){logger[_0xeb17('0x15')]('MoveContactManagedDialer',_0x3211d2[_0xeb17('0x16')],_0x57285e);_0x39d3e(_0x4aa240['error'](0x1f4,_0x3211d2['message']));});});};exports[_0xeb17('0x39')]=function(_0x8c3071){var _0x203b21=this;return new Promise(function(_0x342ec5,_0x41dad7){return db[_0xeb17('0x7')][_0xeb17('0x8')]({'raw':_0x8c3071['options']?_0x8c3071['options'][_0xeb17('0xa')]===undefined?!![]:![]:!![],'where':_0x8c3071[_0xeb17('0x9')]?_0x8c3071[_0xeb17('0x9')]['where']||null:null,'attributes':[[db[_0xeb17('0x35')]['fn'](_0xeb17('0x3a'),db[_0xeb17('0x35')]['fn']('IF',db[_0xeb17('0x35')][_0xeb17('0x3b')]('`scheduledat`\x20>=\x20'+util[_0xeb17('0x3c')](_0xeb17('0x3d'),moment()[_0xeb17('0x3c')](_0xeb17('0x3e')))+'\x20,\x201,\x20null'))),_0xeb17('0x3f')]]})[_0xeb17('0x11')](function(_0x4d38cf){logger[_0xeb17('0x12')](_0xeb17('0x39'),_0x8c3071);logger[_0xeb17('0x19')](_0xeb17('0x39'),_0x8c3071,JSON[_0xeb17('0x13')](_0x4d38cf));_0x342ec5(_0x4d38cf);})[_0xeb17('0x14')](function(_0x143905){logger['error'](_0xeb17('0x39'),_0x143905['message'],_0x8c3071);_0x41dad7(_0x203b21['error'](0x1f4,_0x143905[_0xeb17('0x16')]));});});};exports[_0xeb17('0x40')]=function(_0x3e6de6){var _0x1cf6b7=this;return new Promise(function(_0x5bf965,_0x36191e){return db[_0xeb17('0x27')][_0xeb17('0x22')]()[_0xeb17('0x11')](function(){return db['sequelize'][_0xeb17('0x23')](function(_0x46e650){return db[_0xeb17('0x7')][_0xeb17('0x8')]({'where':_0x3e6de6['options']?_0x3e6de6[_0xeb17('0x9')][_0xeb17('0xb')]||null:null,'attributes':_0x3e6de6[_0xeb17('0x9')]?_0x3e6de6[_0xeb17('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x3e6de6[_0xeb17('0x9')]?_0x3e6de6[_0xeb17('0x9')][_0xeb17('0x24')]||null:null,'group':db[_0xeb17('0x7')][_0xeb17('0x2e')],'transaction':_0x46e650,'lock':_0x46e650['LOCK'][_0xeb17('0x26')],'include':_0x3e6de6['options']?_0x3e6de6[_0xeb17('0x9')][_0xeb17('0xe')]?_['map'](_0x3e6de6[_0xeb17('0x9')][_0xeb17('0xe')],function(_0x3f6f51){return{'model':db[_0x3f6f51[_0xeb17('0xf')]],'as':_0x3f6f51['as'],'attributes':_0x3f6f51['attributes'],'include':_0x3f6f51[_0xeb17('0xe')]?_[_0xeb17('0x10')](_0x3f6f51[_0xeb17('0xe')],function(_0x37713c){return{'model':db[_0x37713c[_0xeb17('0xf')]],'as':_0x37713c['as'],'attributes':_0x37713c[_0xeb17('0xc')],'include':_0x37713c[_0xeb17('0xe')]?_['map'](_0x37713c[_0xeb17('0xe')],function(_0x3e9c90){return{'model':db[_0x3e9c90[_0xeb17('0xf')]],'as':_0x3e9c90['as'],'attributes':_0x3e9c90['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb17('0x11')](function(_0x2145e2){var _0x408e2e=[];for(var _0x28e38c=0x0;_0x28e38c<_0x2145e2[_0xeb17('0x32')];_0x28e38c+=0x1){_0x408e2e['push'](_0x2145e2[_0x28e38c]['update'](_0x3e6de6['body'],{'transaction':_0x46e650}));}return BPromise['all'](_0x408e2e);});})['then'](function(_0xab97f8){logger[_0xeb17('0x12')](_0xeb17('0x40'),_0x3e6de6);logger[_0xeb17('0x19')](_0xeb17('0x40'),_0x3e6de6,JSON[_0xeb17('0x13')](_0xab97f8));_0x5bf965(_0xab97f8);})['catch'](function(_0x43b054){logger[_0xeb17('0x15')](_0xeb17('0x40'),_0x43b054[_0xeb17('0x16')],_0x3e6de6);_0x36191e(_0x1cf6b7[_0xeb17('0x15')](0x1f4,_0x43b054[_0xeb17('0x16')]));});});});};exports[_0xeb17('0x41')]=function(_0x4154d8){var _0x1cc4df=this;return new Promise(function(_0x43a24e,_0x120437){db[_0xeb17('0x27')]['describe']()['then'](function(_0x197248){return db[_0xeb17('0x7')][_0xeb17('0x8')]({'raw':_0x4154d8[_0xeb17('0x9')]?_0x4154d8[_0xeb17('0x9')][_0xeb17('0xa')]===undefined?!![]:![]:!![],'where':_0x4154d8[_0xeb17('0x9')]?_0x4154d8[_0xeb17('0x9')][_0xeb17('0xb')]||null:null,'attributes':_0x4154d8[_0xeb17('0x9')]?_0x4154d8[_0xeb17('0x9')]['attributes']||null:null,'limit':_0x4154d8[_0xeb17('0x9')]?_0x4154d8[_0xeb17('0x9')][_0xeb17('0xd')]||null:null,'include':_0x4154d8[_0xeb17('0x9')]?_0x4154d8[_0xeb17('0x9')][_0xeb17('0xe')]?_['map'](_0x4154d8[_0xeb17('0x9')]['include'],function(_0x29ce10){return{'model':db[_0x29ce10[_0xeb17('0xf')]],'as':_0x29ce10['as'],'attributes':_0x29ce10['as']==='Contact'?_[_0xeb17('0x29')](_0x197248):_0x29ce10['attributes'],'include':_0x29ce10['include']?_['map'](_0x29ce10[_0xeb17('0xe')],function(_0x3398d7){return{'model':db[_0x3398d7[_0xeb17('0xf')]],'as':_0x3398d7['as'],'attributes':_0x3398d7[_0xeb17('0xc')],'include':_0x3398d7['include']?_[_0xeb17('0x10')](_0x3398d7['include'],function(_0x1a541f){return{'model':db[_0x1a541f[_0xeb17('0xf')]],'as':_0x1a541f['as'],'attributes':_0x1a541f[_0xeb17('0xc')]};}):[]};}):[]};}):[]:[]})[_0xeb17('0x11')](function(_0x227e33){logger[_0xeb17('0x12')](_0xeb17('0x6'),_0x4154d8);logger[_0xeb17('0x19')](_0xeb17('0x6'),_0x4154d8,JSON['stringify'](_0x227e33));_0x43a24e(_0x227e33);})[_0xeb17('0x14')](function(_0x5c3b97){logger['error'](_0xeb17('0x6'),_0x5c3b97[_0xeb17('0x16')],_0x4154d8);_0x120437(_0x1cc4df[_0xeb17('0x15')](0x1f4,_0x5c3b97[_0xeb17('0x16')]));});});});};exports[_0xeb17('0x42')]=function(_0xeffc6a){var _0x4d36e2=this;return new Promise(function(_0x3e0916,_0x237709){return db['CmContact'][_0xeb17('0x43')]({'raw':!![],'where':{'phone':_0xeffc6a[_0xeb17('0x9')]['where'][_0xeb17('0x44')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0xeb17('0x11')](function(_0xe611e7){logger[_0xeb17('0x12')](_0xeb17('0x45'),_0xeffc6a);logger[_0xeb17('0x19')](_0xeb17('0x45'),_0xeffc6a,JSON['stringify'](_0xe611e7));_0x3e0916(_0xe611e7);})[_0xeb17('0x14')](function(_0x3a6cfa){logger[_0xeb17('0x15')]('getContactByPhone',_0x3a6cfa[_0xeb17('0x16')],_0xeffc6a);_0x237709(_0x4d36e2[_0xeb17('0x15')](0x1f4,_0x3a6cfa[_0xeb17('0x16')]));});});};exports['ResetActiveCalls']=function(_0x184059){var _0x338cf2=this;return new Promise(function(_0x7ac544,_0xc0e126){return db[_0xeb17('0x35')][_0xeb17('0x23')](function(_0x53b442){var _0x17a3ec=_0x184059[_0xeb17('0x9')]&&_0x184059[_0xeb17('0x9')]['where']?_0x184059[_0xeb17('0x9')][_0xeb17('0xb')]:{};return db[_0xeb17('0x7')][_0xeb17('0x1c')](_0x184059[_0xeb17('0x1b')],{'where':_0x17a3ec,'transaction':_0x53b442})['then'](function(_0x501088){logger[_0xeb17('0x12')](_0xeb17('0x46'),_0x184059);logger[_0xeb17('0x19')](_0xeb17('0x46'),_0x184059,JSON[_0xeb17('0x13')](_0x501088));_0x7ac544(_0x501088);})[_0xeb17('0x14')](function(_0x467f6e){logger[_0xeb17('0x15')]('ResetActiveCalls',_0x467f6e[_0xeb17('0x16')],_0x184059);_0xc0e126(_0x338cf2[_0xeb17('0x15')](0x1f4,_0x467f6e[_0xeb17('0x16')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0xeb2f78){var _0x62dfea=this;var _0x47ff03=_0xeb2f78[_0xeb17('0x1b')][_0xeb17('0xb')]['voiceQueueIds'];var _0x3e0d8e=_0xeb2f78['body']['where'][_0xeb17('0x47')];var _0x357746=_0xeb2f78[_0xeb17('0x1b')][_0xeb17('0xb')][_0xeb17('0x48')];return new Promise(function(_0x5b26ee,_0x290d6f){return db[_0xeb17('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x47ff03},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xeb17('0x35')][_0xeb17('0x3b')]('NOW()\x20+\x20INTERVAL\x20'+_0x3e0d8e+'\x20MINUTE'),'$gt':db[_0xeb17('0x35')][_0xeb17('0x3b')](_0xeb17('0x49'))}},'UserId':{'$in':_0x357746}},'include':[{'model':db['CmContact'],'as':_0xeb17('0x28')},{'model':db['User'],'as':_0xeb17('0x2b'),'attributes':['id',_0xeb17('0x2c'),_0xeb17('0x2d')]},{'model':db[_0xeb17('0x4a')],'as':_0xeb17('0x4b')}]})['then'](function(_0x22d491){if(_0x22d491['length']>0x0){return db[_0xeb17('0x35')]['transaction'](function(_0x5516a9){return db['CmHopper'][_0xeb17('0x1c')]({'recallmeNotifiedDate':db[_0xeb17('0x35')][_0xeb17('0x3b')](_0xeb17('0x49'))},{'where':{'id':{'$in':_[_0xeb17('0x10')](_0x22d491,'id')}},'transaction':_0x5516a9})[_0xeb17('0x11')](function(){_0x5b26ee(_0x22d491);})[_0xeb17('0x14')](function(_0x5d7bb7){logger['error'](_0xeb17('0x4c'),_0x5d7bb7['message'],_0xeb2f78);_0x290d6f(_0x62dfea[_0xeb17('0x15')](0x1f4,_0x5d7bb7[_0xeb17('0x16')]));});})[_0xeb17('0x14')](function(_0x4b19ad){logger[_0xeb17('0x15')](_0xeb17('0x4c'),_0x4b19ad[_0xeb17('0x16')],_0xeb2f78);_0x290d6f(_0x62dfea[_0xeb17('0x15')](0x1f4,_0x4b19ad[_0xeb17('0x16')]));});}else{_0x5b26ee(_0x22d491);}});});};
\ No newline at end of file
index 0fc2140..7b6a239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd77e=['/timezone','getTimezone','update','delete','exports','express','Router','../../components/auth/service','get','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','create','post','/preview','getPreview'];(function(_0x252884,_0x117ddf){var _0x4de0e6=function(_0x442519){while(--_0x442519){_0x252884['push'](_0x252884['shift']());}};_0x4de0e6(++_0x117ddf);}(_0xd77e,0xa6));var _0xed77=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd77e[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0xed77('0x0'));var router=express[_0xed77('0x1')]();var auth=require(_0xed77('0x2'));var controller=require('./cmHopper.controller');router[_0xed77('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0xed77('0x3')](_0xed77('0x4'),auth[_0xed77('0x5')](),controller[_0xed77('0x6')]);router[_0xed77('0x3')](_0xed77('0x7'),auth['isAuthenticated'](),controller[_0xed77('0x8')]);router['get'](_0xed77('0x9'),auth[_0xed77('0x5')](),controller[_0xed77('0xa')]);router['get'](_0xed77('0xb'),auth[_0xed77('0x5')](),controller['show']);router[_0xed77('0x3')](_0xed77('0xc'),auth[_0xed77('0x5')](),controller[_0xed77('0xd')]);router['post']('/',auth[_0xed77('0x5')](),controller[_0xed77('0xe')]);router[_0xed77('0xf')](_0xed77('0x10'),auth['isAuthenticated'](),controller[_0xed77('0x11')]);router[_0xed77('0xf')](_0xed77('0x12'),auth[_0xed77('0x5')](),controller[_0xed77('0x13')]);router['put'](_0xed77('0xb'),auth[_0xed77('0x5')](),controller[_0xed77('0x14')]);router[_0xed77('0x15')]('/:id',auth[_0xed77('0x5')](),controller['destroy']);module[_0xed77('0x16')]=router;
\ No newline at end of file
+var _0x9459=['getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','index','/describe','isAuthenticated','describe','get','/opencontacts'];(function(_0x554daa,_0x19ff09){var _0x4d3d17=function(_0x52714d){while(--_0x52714d){_0x554daa['push'](_0x554daa['shift']());}};_0x4d3d17(++_0x19ff09);}(_0x9459,0x16d));var _0x9945=function(_0x1d4604,_0x3fe2e5){_0x1d4604=_0x1d4604-0x0;var _0x40356d=_0x9459[_0x1d4604];return _0x40356d;};'use strict';var express=require(_0x9945('0x0'));var router=express[_0x9945('0x1')]();var auth=require(_0x9945('0x2'));var controller=require(_0x9945('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x9945('0x4')]);router['get'](_0x9945('0x5'),auth[_0x9945('0x6')](),controller[_0x9945('0x7')]);router[_0x9945('0x8')](_0x9945('0x9'),auth[_0x9945('0x6')](),controller[_0x9945('0xa')]);router[_0x9945('0x8')](_0x9945('0xb'),auth[_0x9945('0x6')](),controller[_0x9945('0xc')]);router[_0x9945('0x8')](_0x9945('0xd'),auth[_0x9945('0x6')](),controller[_0x9945('0xe')]);router[_0x9945('0x8')](_0x9945('0xf'),auth[_0x9945('0x6')](),controller[_0x9945('0x10')]);router[_0x9945('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9945('0x11')](_0x9945('0x12'),auth[_0x9945('0x6')](),controller[_0x9945('0x13')]);router[_0x9945('0x11')](_0x9945('0x14'),auth[_0x9945('0x6')](),controller[_0x9945('0x15')]);router['put'](_0x9945('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9945('0x16')](_0x9945('0xd'),auth[_0x9945('0x6')](),controller[_0x9945('0x17')]);module[_0x9945('0x18')]=router;
\ No newline at end of file
index 1350629..27b63ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6933=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER','STRING','format'];(function(_0x590627,_0x349dbc){var _0x274941=function(_0x2f1189){while(--_0x2f1189){_0x590627['push'](_0x590627['shift']());}};_0x274941(++_0x349dbc);}(_0x6933,0xc7));var _0x3693=function(_0x56eaa4,_0xe8ca71){_0x56eaa4=_0x56eaa4-0x0;var _0xa7e4a3=_0x6933[_0x56eaa4];return _0xa7e4a3;};'use strict';var moment=require(_0x3693('0x0'));var Sequelize=require('sequelize');module[_0x3693('0x1')]={'CmHopperId':{'type':Sequelize[_0x3693('0x2')]},'phone':{'type':Sequelize[_0x3693('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x3693('0x4')](_0x3693('0x5'))},'countbusyretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3693('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6f29=['exports','INTEGER','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x27f1c4,_0x2cdaa1){var _0x242ec1=function(_0x533eb2){while(--_0x533eb2){_0x27f1c4['push'](_0x27f1c4['shift']());}};_0x242ec1(++_0x2cdaa1);}(_0x6f29,0x1c1));var _0x96f2=function(_0x5eb294,_0x5b52ba){_0x5eb294=_0x5eb294-0x0;var _0xd139fd=_0x6f29[_0x5eb294];return _0xd139fd;};'use strict';var moment=require('moment');var Sequelize=require(_0x96f2('0x0'));module[_0x96f2('0x1')]={'CmHopperId':{'type':Sequelize[_0x96f2('0x2')]},'phone':{'type':Sequelize[_0x96f2('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x96f2('0x4')],'defaultValue':moment()['format'](_0x96f2('0x5'))},'countbusyretry':{'type':Sequelize[_0x96f2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x96f2('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x96f2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x96f2('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x96f2('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 9ac83ed..60d5e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6c=['CmHopperAdditionalPhones','UserProfileResource','stack','name','send','index','map','CmHopperAdditionalPhone','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get'];(function(_0x139ff6,_0xddca5){var _0x71b083=function(_0x4cf27a){while(--_0x4cf27a){_0x139ff6['push'](_0x139ff6['shift']());}};_0x71b083(++_0xddca5);}(_0x2d6c,0x172));var _0xc2d6=function(_0x5bed21,_0x384e13){_0x5bed21=_0x5bed21-0x0;var _0x7b4c33=_0x2d6c[_0x5bed21];return _0x7b4c33;};'use strict';var emlformat=require(_0xc2d6('0x0'));var rimraf=require(_0xc2d6('0x1'));var zipdir=require(_0xc2d6('0x2'));var jsonpatch=require(_0xc2d6('0x3'));var rp=require(_0xc2d6('0x4'));var moment=require(_0xc2d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc2d6('0x6'));var util=require(_0xc2d6('0x7'));var path=require(_0xc2d6('0x8'));var sox=require(_0xc2d6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc2d6('0xa'));var _=require(_0xc2d6('0xb'));var squel=require(_0xc2d6('0xc'));var crypto=require(_0xc2d6('0xd'));var jsforce=require(_0xc2d6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc2d6('0xf'));var Papa=require(_0xc2d6('0x10'));var Redis=require(_0xc2d6('0x11'));var authService=require(_0xc2d6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc2d6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2d6('0x14'))(_0xc2d6('0x15'));var utils=require('../../config/utils');var config=require(_0xc2d6('0x16'));var licenseUtil=require(_0xc2d6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc366f,_0x5ed04c){_0x5ed04c=_0x5ed04c||0xcc;return function(_0x1323e6){if(_0x1323e6){return _0xc366f[_0xc2d6('0x18')](_0x5ed04c);}return _0xc366f[_0xc2d6('0x19')](_0x5ed04c)[_0xc2d6('0x1a')]();};}function respondWithResult(_0x4c42c7,_0x8652a6){_0x8652a6=_0x8652a6||0xc8;return function(_0x361157){if(_0x361157){return _0x4c42c7[_0xc2d6('0x19')](_0x8652a6)[_0xc2d6('0x1b')](_0x361157);}};}function respondWithFilteredResult(_0x21b9b5,_0x3fb2b7){return function(_0x581981){if(_0x581981){var _0x2c82f5=typeof _0x3fb2b7[_0xc2d6('0x1c')]===_0xc2d6('0x1d')&&typeof _0x3fb2b7[_0xc2d6('0x1e')]==='undefined';var _0x96c0c1=_0x581981['count'];var _0x12f0f1=_0x2c82f5?0x0:_0x3fb2b7[_0xc2d6('0x1c')];var _0x237d54=_0x2c82f5?_0x581981[_0xc2d6('0x1f')]:_0x3fb2b7['offset']+_0x3fb2b7[_0xc2d6('0x1e')];var _0x1ee152;if(_0x237d54>=_0x96c0c1){_0x237d54=_0x96c0c1;_0x1ee152=0xc8;}else{_0x1ee152=0xce;}_0x21b9b5[_0xc2d6('0x19')](_0x1ee152);return _0x21b9b5[_0xc2d6('0x20')]('Content-Range',_0x12f0f1+'-'+_0x237d54+'/'+_0x96c0c1)[_0xc2d6('0x1b')](_0x581981);}return null;};}function patchUpdates(_0x153f05){return function(_0x366187){try{jsonpatch[_0xc2d6('0x21')](_0x366187,_0x153f05,!![]);}catch(_0x413b01){return BPromise[_0xc2d6('0x22')](_0x413b01);}return _0x366187[_0xc2d6('0x23')]();};}function saveUpdates(_0x22c32b,_0x50e984){return function(_0x53d4cf){if(_0x53d4cf){return _0x53d4cf[_0xc2d6('0x24')](_0x22c32b)[_0xc2d6('0x25')](function(_0x253c01){return _0x253c01;});}return null;};}function removeEntity(_0x29682d,_0xa10974){return function(_0x28eeb3){if(_0x28eeb3){return _0x28eeb3[_0xc2d6('0x26')]()[_0xc2d6('0x25')](function(){var _0x1cf29a=_0x28eeb3[_0xc2d6('0x27')]({'plain':!![]});var _0x2dc254=_0xc2d6('0x28');return db[_0xc2d6('0x29')]['destroy']({'where':{'type':_0x2dc254,'resourceId':_0x1cf29a['id']}})['then'](function(){return _0x28eeb3;});})[_0xc2d6('0x25')](function(){_0x29682d[_0xc2d6('0x19')](0xcc)[_0xc2d6('0x1a')]();});}};}function handleEntityNotFound(_0x171100,_0x19b3b9){return function(_0x235b5b){if(!_0x235b5b){_0x171100['sendStatus'](0x194);}return _0x235b5b;};}function handleError(_0x160392,_0x126505){_0x126505=_0x126505||0x1f4;return function(_0x59534b){logger['error'](_0x59534b[_0xc2d6('0x2a')]);if(_0x59534b['name']){delete _0x59534b[_0xc2d6('0x2b')];}_0x160392[_0xc2d6('0x19')](_0x126505)[_0xc2d6('0x2c')](_0x59534b);};}exports[_0xc2d6('0x2d')]=function(_0x1d005e,_0x3bcb01){var _0x452162={},_0x581ef1={},_0x13902a={'count':0x0,'rows':[]};var _0x3aaa48=_[_0xc2d6('0x2e')](db[_0xc2d6('0x2f')]['rawAttributes'],function(_0x1b2c2e){return{'name':_0x1b2c2e['fieldName'],'type':_0x1b2c2e[_0xc2d6('0x30')][_0xc2d6('0x31')]};});_0x581ef1[_0xc2d6('0x32')]=_[_0xc2d6('0x2e')](_0x3aaa48,_0xc2d6('0x2b'));_0x581ef1[_0xc2d6('0x33')]=_[_0xc2d6('0x34')](_0x1d005e[_0xc2d6('0x33')]);_0x581ef1[_0xc2d6('0x35')]=_[_0xc2d6('0x36')](_0x581ef1[_0xc2d6('0x32')],_0x581ef1['query']);_0x452162['attributes']=_[_0xc2d6('0x36')](_0x581ef1[_0xc2d6('0x32')],qs['fields'](_0x1d005e[_0xc2d6('0x33')][_0xc2d6('0x37')]));_0x452162[_0xc2d6('0x38')]=_0x452162[_0xc2d6('0x38')][_0xc2d6('0x39')]?_0x452162['attributes']:_0x581ef1[_0xc2d6('0x32')];if(!_0x1d005e['query'][_0xc2d6('0x3a')](_0xc2d6('0x3b'))){_0x452162[_0xc2d6('0x1e')]=qs[_0xc2d6('0x1e')](_0x1d005e[_0xc2d6('0x33')][_0xc2d6('0x1e')]);_0x452162[_0xc2d6('0x1c')]=qs[_0xc2d6('0x1c')](_0x1d005e[_0xc2d6('0x33')][_0xc2d6('0x1c')]);}_0x452162['order']=qs[_0xc2d6('0x3c')](_0x1d005e[_0xc2d6('0x33')]['sort']);_0x452162[_0xc2d6('0x3d')]=qs['filters'](_[_0xc2d6('0x3e')](_0x1d005e['query'],_0x581ef1[_0xc2d6('0x35')]),_0x3aaa48);if(_0x1d005e[_0xc2d6('0x33')][_0xc2d6('0x3f')]){_0x452162[_0xc2d6('0x3d')]=_[_0xc2d6('0x40')](_0x452162[_0xc2d6('0x3d')],{'$or':_[_0xc2d6('0x2e')](_0x3aaa48,function(_0x5beb98){if(_0x5beb98[_0xc2d6('0x30')]!==_0xc2d6('0x41')){var _0x29d227={};_0x29d227[_0x5beb98[_0xc2d6('0x2b')]]={'$like':'%'+_0x1d005e[_0xc2d6('0x33')][_0xc2d6('0x3f')]+'%'};return _0x29d227;}})});}_0x452162=_[_0xc2d6('0x40')]({},_0x452162,_0x1d005e['options']);var _0x1b18a0={'where':_0x452162[_0xc2d6('0x3d')]};return db[_0xc2d6('0x2f')][_0xc2d6('0x1f')](_0x1b18a0)[_0xc2d6('0x25')](function(_0xb678ab){_0x13902a['count']=_0xb678ab;if(_0x1d005e[_0xc2d6('0x33')][_0xc2d6('0x42')]){_0x452162[_0xc2d6('0x43')]=[{'all':!![]}];}return db[_0xc2d6('0x2f')][_0xc2d6('0x44')](_0x452162);})[_0xc2d6('0x25')](function(_0x5bcb80){_0x13902a['rows']=_0x5bcb80;return _0x13902a;})['then'](respondWithFilteredResult(_0x3bcb01,_0x452162))[_0xc2d6('0x45')](handleError(_0x3bcb01,null));};exports[_0xc2d6('0x46')]=function(_0x32c2a8,_0x148320){var _0x5829f0={'raw':!![],'where':{'id':_0x32c2a8[_0xc2d6('0x47')]['id']}},_0x385987={};_0x385987[_0xc2d6('0x32')]=_[_0xc2d6('0x34')](db[_0xc2d6('0x2f')][_0xc2d6('0x48')]);_0x385987[_0xc2d6('0x33')]=_[_0xc2d6('0x34')](_0x32c2a8[_0xc2d6('0x33')]);_0x385987[_0xc2d6('0x35')]=_[_0xc2d6('0x36')](_0x385987[_0xc2d6('0x32')],_0x385987['query']);_0x5829f0[_0xc2d6('0x38')]=_[_0xc2d6('0x36')](_0x385987[_0xc2d6('0x32')],qs[_0xc2d6('0x37')](_0x32c2a8[_0xc2d6('0x33')][_0xc2d6('0x37')]));_0x5829f0['attributes']=_0x5829f0[_0xc2d6('0x38')][_0xc2d6('0x39')]?_0x5829f0[_0xc2d6('0x38')]:_0x385987['model'];if(_0x32c2a8['query'][_0xc2d6('0x42')]){_0x5829f0[_0xc2d6('0x43')]=[{'all':!![]}];}_0x5829f0=_['merge']({},_0x5829f0,_0x32c2a8[_0xc2d6('0x49')]);return db[_0xc2d6('0x2f')][_0xc2d6('0x4a')](_0x5829f0)['then'](handleEntityNotFound(_0x148320,null))[_0xc2d6('0x25')](respondWithResult(_0x148320,null))[_0xc2d6('0x45')](handleError(_0x148320,null));};exports[_0xc2d6('0x4b')]=function(_0x300e45,_0x4840bb){return db[_0xc2d6('0x2f')]['create'](_0x300e45[_0xc2d6('0x4c')],{})[_0xc2d6('0x25')](function(_0x1b0123){var _0x1a06e5=_0x300e45['user'][_0xc2d6('0x27')]({'plain':!![]});if(!_0x1a06e5)throw new Error(_0xc2d6('0x4d'));if(_0x1a06e5[_0xc2d6('0x4e')]===_0xc2d6('0x4f')){var _0x4706a7=_0x1b0123[_0xc2d6('0x27')]({'plain':!![]});var _0x2310a1=_0xc2d6('0x28');return db[_0xc2d6('0x50')][_0xc2d6('0x4a')]({'where':{'name':_0x2310a1,'userProfileId':_0x1a06e5['userProfileId']},'raw':!![]})[_0xc2d6('0x25')](function(_0x26a1e1){if(_0x26a1e1&&_0x26a1e1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4706a7[_0xc2d6('0x2b')],'resourceId':_0x4706a7['id'],'type':_0x26a1e1['name'],'sectionId':_0x26a1e1['id']},{})['then'](function(){return _0x1b0123;});}else{return _0x1b0123;}})['catch'](function(_0x5cbc67){logger[_0xc2d6('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cbc67);throw _0x5cbc67;});}return _0x1b0123;})[_0xc2d6('0x25')](respondWithResult(_0x4840bb,0xc9))[_0xc2d6('0x45')](handleError(_0x4840bb,null));};exports[_0xc2d6('0x24')]=function(_0x454444,_0x3952d4){if(_0x454444[_0xc2d6('0x4c')]['id']){delete _0x454444[_0xc2d6('0x4c')]['id'];}return db[_0xc2d6('0x2f')][_0xc2d6('0x4a')]({'where':{'id':_0x454444[_0xc2d6('0x47')]['id']}})[_0xc2d6('0x25')](handleEntityNotFound(_0x3952d4,null))[_0xc2d6('0x25')](saveUpdates(_0x454444[_0xc2d6('0x4c')],null))[_0xc2d6('0x25')](respondWithResult(_0x3952d4,null))[_0xc2d6('0x45')](handleError(_0x3952d4,null));};exports[_0xc2d6('0x26')]=function(_0x61f677,_0x4e4bcb){return db[_0xc2d6('0x2f')][_0xc2d6('0x4a')]({'where':{'id':_0x61f677[_0xc2d6('0x47')]['id']}})[_0xc2d6('0x25')](handleEntityNotFound(_0x4e4bcb,null))[_0xc2d6('0x25')](removeEntity(_0x4e4bcb,null))[_0xc2d6('0x45')](handleError(_0x4e4bcb,null));};
\ No newline at end of file
+var _0x8601=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x14055e,_0x4b2b9a){var _0x433a26=function(_0x3f04c4){while(--_0x3f04c4){_0x14055e['push'](_0x14055e['shift']());}};_0x433a26(++_0x4b2b9a);}(_0x8601,0x161));var _0x1860=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8601[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1860('0x0'));var zipdir=require(_0x1860('0x1'));var jsonpatch=require(_0x1860('0x2'));var rp=require(_0x1860('0x3'));var moment=require(_0x1860('0x4'));var BPromise=require(_0x1860('0x5'));var Mustache=require(_0x1860('0x6'));var util=require('util');var path=require(_0x1860('0x7'));var sox=require(_0x1860('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1860('0x9'));var _=require(_0x1860('0xa'));var squel=require(_0x1860('0xb'));var crypto=require('crypto');var jsforce=require(_0x1860('0xc'));var deskjs=require(_0x1860('0xd'));var toCsv=require(_0x1860('0xe'));var querystring=require(_0x1860('0xf'));var Papa=require(_0x1860('0x10'));var Redis=require(_0x1860('0x11'));var authService=require(_0x1860('0x12'));var qs=require(_0x1860('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1860('0x14'));var logger=require(_0x1860('0x15'))(_0x1860('0x16'));var utils=require(_0x1860('0x17'));var config=require(_0x1860('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1860('0x19'))['db'];function respondWithStatusCode(_0x472ffa,_0x2146f5){_0x2146f5=_0x2146f5||0xcc;return function(_0x148f19){if(_0x148f19){return _0x472ffa['sendStatus'](_0x2146f5);}return _0x472ffa[_0x1860('0x1a')](_0x2146f5)[_0x1860('0x1b')]();};}function respondWithResult(_0x24ef71,_0x3595e3){_0x3595e3=_0x3595e3||0xc8;return function(_0x1b2c0f){if(_0x1b2c0f){return _0x24ef71[_0x1860('0x1a')](_0x3595e3)[_0x1860('0x1c')](_0x1b2c0f);}};}function respondWithFilteredResult(_0x4dd9f7,_0x1f6415){return function(_0x3c887e){if(_0x3c887e){var _0x570ee8=typeof _0x1f6415[_0x1860('0x1d')]==='undefined'&&typeof _0x1f6415[_0x1860('0x1e')]===_0x1860('0x1f');var _0x4bad1d=_0x3c887e[_0x1860('0x20')];var _0x562f53=_0x570ee8?0x0:_0x1f6415[_0x1860('0x1d')];var _0xcb3034=_0x570ee8?_0x3c887e[_0x1860('0x20')]:_0x1f6415['offset']+_0x1f6415[_0x1860('0x1e')];var _0x2de28b;if(_0xcb3034>=_0x4bad1d){_0xcb3034=_0x4bad1d;_0x2de28b=0xc8;}else{_0x2de28b=0xce;}_0x4dd9f7[_0x1860('0x1a')](_0x2de28b);return _0x4dd9f7[_0x1860('0x21')](_0x1860('0x22'),_0x562f53+'-'+_0xcb3034+'/'+_0x4bad1d)['json'](_0x3c887e);}return null;};}function patchUpdates(_0x7f47ef){return function(_0x23bf12){try{jsonpatch['apply'](_0x23bf12,_0x7f47ef,!![]);}catch(_0x711a97){return BPromise[_0x1860('0x23')](_0x711a97);}return _0x23bf12[_0x1860('0x24')]();};}function saveUpdates(_0x5a71a4,_0x4a57e7){return function(_0x4a0e03){if(_0x4a0e03){return _0x4a0e03['update'](_0x5a71a4)[_0x1860('0x25')](function(_0x34cabf){return _0x34cabf;});}return null;};}function removeEntity(_0x42e6ef,_0x421269){return function(_0x506d95){if(_0x506d95){return _0x506d95['destroy']()[_0x1860('0x25')](function(){var _0x19a562=_0x506d95[_0x1860('0x26')]({'plain':!![]});var _0x98765a=_0x1860('0x27');return db[_0x1860('0x28')][_0x1860('0x29')]({'where':{'type':_0x98765a,'resourceId':_0x19a562['id']}})['then'](function(){return _0x506d95;});})[_0x1860('0x25')](function(){_0x42e6ef[_0x1860('0x1a')](0xcc)[_0x1860('0x1b')]();});}};}function handleEntityNotFound(_0x2d1ae1,_0x5c43ff){return function(_0x1d44a4){if(!_0x1d44a4){_0x2d1ae1['sendStatus'](0x194);}return _0x1d44a4;};}function handleError(_0x525ffb,_0x29ec12){_0x29ec12=_0x29ec12||0x1f4;return function(_0x342ec4){logger[_0x1860('0x2a')](_0x342ec4[_0x1860('0x2b')]);if(_0x342ec4['name']){delete _0x342ec4[_0x1860('0x2c')];}_0x525ffb[_0x1860('0x1a')](_0x29ec12)[_0x1860('0x2d')](_0x342ec4);};}exports[_0x1860('0x2e')]=function(_0x2023d2,_0x4a1311){var _0x5441e1={},_0x1a86d8={},_0x7c95e0={'count':0x0,'rows':[]};var _0x13b58f=_[_0x1860('0x2f')](db[_0x1860('0x30')][_0x1860('0x31')],function(_0x31e92c){return{'name':_0x31e92c[_0x1860('0x32')],'type':_0x31e92c[_0x1860('0x33')]['key']};});_0x1a86d8[_0x1860('0x34')]=_['map'](_0x13b58f,'name');_0x1a86d8[_0x1860('0x35')]=_[_0x1860('0x36')](_0x2023d2['query']);_0x1a86d8[_0x1860('0x37')]=_[_0x1860('0x38')](_0x1a86d8[_0x1860('0x34')],_0x1a86d8[_0x1860('0x35')]);_0x5441e1[_0x1860('0x39')]=_[_0x1860('0x38')](_0x1a86d8[_0x1860('0x34')],qs[_0x1860('0x3a')](_0x2023d2[_0x1860('0x35')][_0x1860('0x3a')]));_0x5441e1['attributes']=_0x5441e1[_0x1860('0x39')]['length']?_0x5441e1[_0x1860('0x39')]:_0x1a86d8[_0x1860('0x34')];if(!_0x2023d2[_0x1860('0x35')][_0x1860('0x3b')](_0x1860('0x3c'))){_0x5441e1[_0x1860('0x1e')]=qs[_0x1860('0x1e')](_0x2023d2['query'][_0x1860('0x1e')]);_0x5441e1['offset']=qs[_0x1860('0x1d')](_0x2023d2[_0x1860('0x35')][_0x1860('0x1d')]);}_0x5441e1[_0x1860('0x3d')]=qs['sort'](_0x2023d2[_0x1860('0x35')][_0x1860('0x3e')]);_0x5441e1[_0x1860('0x3f')]=qs[_0x1860('0x37')](_['pick'](_0x2023d2[_0x1860('0x35')],_0x1a86d8[_0x1860('0x37')]),_0x13b58f);if(_0x2023d2[_0x1860('0x35')][_0x1860('0x40')]){_0x5441e1[_0x1860('0x3f')]=_['merge'](_0x5441e1[_0x1860('0x3f')],{'$or':_['map'](_0x13b58f,function(_0x276d1f){if(_0x276d1f[_0x1860('0x33')]!=='VIRTUAL'){var _0x33def5={};_0x33def5[_0x276d1f[_0x1860('0x2c')]]={'$like':'%'+_0x2023d2[_0x1860('0x35')]['filter']+'%'};return _0x33def5;}})});}_0x5441e1=_['merge']({},_0x5441e1,_0x2023d2[_0x1860('0x41')]);var _0x59e04a={'where':_0x5441e1['where']};return db[_0x1860('0x30')][_0x1860('0x20')](_0x59e04a)[_0x1860('0x25')](function(_0x3a2445){_0x7c95e0[_0x1860('0x20')]=_0x3a2445;if(_0x2023d2['query'][_0x1860('0x42')]){_0x5441e1[_0x1860('0x43')]=[{'all':!![]}];}return db[_0x1860('0x30')][_0x1860('0x44')](_0x5441e1);})[_0x1860('0x25')](function(_0x16c934){_0x7c95e0['rows']=_0x16c934;return _0x7c95e0;})['then'](respondWithFilteredResult(_0x4a1311,_0x5441e1))[_0x1860('0x45')](handleError(_0x4a1311,null));};exports['show']=function(_0x5bf679,_0x20e508){var _0x5c20a2={'raw':!![],'where':{'id':_0x5bf679[_0x1860('0x46')]['id']}},_0xb848d1={};_0xb848d1['model']=_[_0x1860('0x36')](db[_0x1860('0x30')]['rawAttributes']);_0xb848d1['query']=_[_0x1860('0x36')](_0x5bf679[_0x1860('0x35')]);_0xb848d1['filters']=_[_0x1860('0x38')](_0xb848d1[_0x1860('0x34')],_0xb848d1[_0x1860('0x35')]);_0x5c20a2[_0x1860('0x39')]=_[_0x1860('0x38')](_0xb848d1[_0x1860('0x34')],qs[_0x1860('0x3a')](_0x5bf679[_0x1860('0x35')]['fields']));_0x5c20a2[_0x1860('0x39')]=_0x5c20a2[_0x1860('0x39')][_0x1860('0x47')]?_0x5c20a2[_0x1860('0x39')]:_0xb848d1[_0x1860('0x34')];if(_0x5bf679[_0x1860('0x35')][_0x1860('0x42')]){_0x5c20a2[_0x1860('0x43')]=[{'all':!![]}];}_0x5c20a2=_['merge']({},_0x5c20a2,_0x5bf679['options']);return db['CmHopperAdditionalPhone'][_0x1860('0x48')](_0x5c20a2)[_0x1860('0x25')](handleEntityNotFound(_0x20e508,null))['then'](respondWithResult(_0x20e508,null))[_0x1860('0x45')](handleError(_0x20e508,null));};exports[_0x1860('0x49')]=function(_0x2fe205,_0x31396d){return db[_0x1860('0x30')][_0x1860('0x49')](_0x2fe205[_0x1860('0x4a')],{})[_0x1860('0x25')](function(_0x5e79c9){var _0x2db488=_0x2fe205[_0x1860('0x4b')][_0x1860('0x26')]({'plain':!![]});if(!_0x2db488)throw new Error(_0x1860('0x4c'));if(_0x2db488['role']===_0x1860('0x4b')){var _0x537a3f=_0x5e79c9[_0x1860('0x26')]({'plain':!![]});var _0x36781d=_0x1860('0x27');return db[_0x1860('0x4d')][_0x1860('0x48')]({'where':{'name':_0x36781d,'userProfileId':_0x2db488[_0x1860('0x4e')]},'raw':!![]})[_0x1860('0x25')](function(_0x4afb95){if(_0x4afb95&&_0x4afb95[_0x1860('0x4f')]===0x0){return db[_0x1860('0x28')][_0x1860('0x49')]({'name':_0x537a3f['name'],'resourceId':_0x537a3f['id'],'type':_0x4afb95[_0x1860('0x2c')],'sectionId':_0x4afb95['id']},{})['then'](function(){return _0x5e79c9;});}else{return _0x5e79c9;}})[_0x1860('0x45')](function(_0x2e2794){logger[_0x1860('0x2a')](_0x1860('0x50'),_0x2e2794);throw _0x2e2794;});}return _0x5e79c9;})[_0x1860('0x25')](respondWithResult(_0x31396d,0xc9))[_0x1860('0x45')](handleError(_0x31396d,null));};exports[_0x1860('0x51')]=function(_0x5865fc,_0x2b6402){if(_0x5865fc[_0x1860('0x4a')]['id']){delete _0x5865fc[_0x1860('0x4a')]['id'];}return db[_0x1860('0x30')][_0x1860('0x48')]({'where':{'id':_0x5865fc[_0x1860('0x46')]['id']}})[_0x1860('0x25')](handleEntityNotFound(_0x2b6402,null))[_0x1860('0x25')](saveUpdates(_0x5865fc[_0x1860('0x4a')],null))[_0x1860('0x25')](respondWithResult(_0x2b6402,null))['catch'](handleError(_0x2b6402,null));};exports['destroy']=function(_0xb9b516,_0x50f091){return db[_0x1860('0x30')][_0x1860('0x48')]({'where':{'id':_0xb9b516[_0x1860('0x46')]['id']}})[_0x1860('0x25')](handleEntityNotFound(_0x50f091,null))[_0x1860('0x25')](removeEntity(_0x50f091,null))[_0x1860('0x45')](handleError(_0x50f091,null));};
\ No newline at end of file
index 22aa95c..caaf86e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a1f=['define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0xad001c,_0x2473f9){var _0x1e97f5=function(_0x32da4a){while(--_0x32da4a){_0xad001c['push'](_0xad001c['shift']());}};_0x1e97f5(++_0x2473f9);}(_0x2a1f,0x14b));var _0xf2a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a1f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf2a1('0x0'));var util=require(_0xf2a1('0x1'));var logger=require(_0xf2a1('0x2'))(_0xf2a1('0x3'));var moment=require(_0xf2a1('0x4'));var BPromise=require(_0xf2a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2a1('0x6'));var rimraf=require(_0xf2a1('0x7'));var config=require(_0xf2a1('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xf2a1('0x9')]=function(_0x490b1b,_0x45c3a0){return _0x490b1b[_0xf2a1('0xa')]('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1bba=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x33c228,_0x5dd746){var _0x4cc4b8=function(_0x6e7f0f){while(--_0x6e7f0f){_0x33c228['push'](_0x33c228['shift']());}};_0x4cc4b8(++_0x5dd746);}(_0x1bba,0xe4));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa1bb('0x0'));var logger=require(_0xa1bb('0x1'))('api');var moment=require(_0xa1bb('0x2'));var BPromise=require(_0xa1bb('0x3'));var rp=require(_0xa1bb('0x4'));var fs=require('fs');var path=require(_0xa1bb('0x5'));var rimraf=require('rimraf');var config=require(_0xa1bb('0x6'));var attributes=require(_0xa1bb('0x7'));module[_0xa1bb('0x8')]=function(_0x27c2b3,_0xe2f624){return _0x27c2b3[_0xa1bb('0x9')](_0xa1bb('0xa'),attributes,{'tableName':_0xa1bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index afed5f7..e107fb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8028=['request\x20sent','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','findOne','ContactId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','phone','isNil','countbusyretry','countcongestionretry','countagentrejectretry','countdropretry','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','CmHopper','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s'];(function(_0x104d15,_0x52e03b){var _0x56ebd9=function(_0x122c32){while(--_0x122c32){_0x104d15['push'](_0x104d15['shift']());}};_0x56ebd9(++_0x52e03b);}(_0x8028,0x68));var _0x8802=function(_0x176caa,_0x21992c){_0x176caa=_0x176caa-0x0;var _0x2d104a=_0x8028[_0x176caa];return _0x2d104a;};'use strict';var _=require(_0x8802('0x0'));var util=require(_0x8802('0x1'));var moment=require('moment');var BPromise=require(_0x8802('0x2'));var rs=require(_0x8802('0x3'));var fs=require('fs');var Redis=require(_0x8802('0x4'));var db=require(_0x8802('0x5'))['db'];var utils=require(_0x8802('0x6'));var logger=require(_0x8802('0x7'))(_0x8802('0x8'));var config=require(_0x8802('0x9'));var jayson=require(_0x8802('0xa'));var client=jayson[_0x8802('0xb')][_0x8802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x245ac7,_0x1c2deb,_0xacdca6){return new BPromise(function(_0x2a1fec,_0x31421d){return client[_0x8802('0xd')](_0x245ac7,_0xacdca6)[_0x8802('0xe')](function(_0x4f7aac){logger['info'](_0x8802('0xf'),_0x1c2deb,'request\x20sent');logger[_0x8802('0x10')](_0x8802('0x11'),_0x1c2deb,_0x8802('0x12'),JSON[_0x8802('0x13')](_0x4f7aac));if(_0x4f7aac['error']){if(_0x4f7aac[_0x8802('0x14')][_0x8802('0x15')]===0x1f4){logger[_0x8802('0x14')](_0x8802('0xf'),_0x1c2deb,_0x4f7aac[_0x8802('0x14')][_0x8802('0x16')]);return _0x31421d(_0x4f7aac[_0x8802('0x14')]['message']);}logger[_0x8802('0x14')](_0x8802('0xf'),_0x1c2deb,_0x4f7aac[_0x8802('0x14')][_0x8802('0x16')]);return _0x2a1fec(_0x4f7aac[_0x8802('0x14')][_0x8802('0x16')]);}else{logger[_0x8802('0x17')](_0x8802('0xf'),_0x1c2deb,_0x8802('0x12'));_0x2a1fec(_0x4f7aac[_0x8802('0x18')][_0x8802('0x16')]);}})[_0x8802('0x19')](function(_0x5419e2){logger[_0x8802('0x14')](_0x8802('0xf'),_0x1c2deb,_0x5419e2);_0x31421d(_0x5419e2);});});}exports[_0x8802('0x1a')]=function(_0x363b89){var _0x33214f=this;return new Promise(function(_0x50eb81,_0x3c264c){return db['CmHopper'][_0x8802('0x1b')]({'raw':!![],'where':{'ContactId':_0x363b89['body'][_0x8802('0x1c')],'ListId':_0x363b89[_0x8802('0x1d')]['ListId'],'VoiceQueueId':_0x363b89[_0x8802('0x1d')][_0x8802('0x1e')]===undefined?null:_0x363b89[_0x8802('0x1d')][_0x8802('0x1e')],'CampaignId':_0x363b89[_0x8802('0x1d')][_0x8802('0x1f')]===undefined?null:_0x363b89['body'][_0x8802('0x1f')]}})[_0x8802('0xe')](function(_0xedec1b){if(_0xedec1b!=null){return db[_0x8802('0x20')][_0x8802('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xedec1b['id'],'OrderBy':{'$gt':_0xedec1b[_0x8802('0x21')]}},'order':[['OrderBy',_0x8802('0x22')]]})[_0x8802('0xe')](function(_0x4ba1b6){var _0x2a2f8f=0x0;if(_0x4ba1b6){if(_0x4ba1b6['countbusyretry']+_0x4ba1b6['countcongestionretry']+_0x4ba1b6[_0x8802('0x23')]+_0x4ba1b6[_0x8802('0x24')]+_0x4ba1b6['countdropretry']+_0x4ba1b6[_0x8802('0x25')]+_0x4ba1b6[_0x8802('0x26')]+_0x4ba1b6['countagentrejectretry']<_0x363b89[_0x8802('0x27')]['dialGlobalMaxRetry'])_0x2a2f8f=0x1;_0x50eb81({'additional':_0x2a2f8f});}else{return db[_0x8802('0x20')][_0x8802('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xedec1b['id']},'order':[[_0x8802('0x21'),_0x8802('0x22')]]})[_0x8802('0xe')](function(_0x4f3407){var _0x2b4fb9=0x0;if(_0x4f3407){if(_0x4f3407['countbusyretry']+_0x4f3407['countcongestionretry']+_0x4f3407[_0x8802('0x23')]+_0x4f3407[_0x8802('0x24')]+_0x4f3407['countdropretry']+_0x4f3407[_0x8802('0x25')]+_0x4f3407['countmachineretry']+_0x4f3407['countagentrejectretry']<_0x363b89[_0x8802('0x27')][_0x8802('0x28')])_0x2b4fb9=0x1;_0x50eb81({'additional':_0x2b4fb9});}else{_0x50eb81({'additional':0x0});}})[_0x8802('0x19')](function(_0x3a9c67){logger[_0x8802('0x14')]('VerifyAdditionalPhones',_0x3a9c67[_0x8802('0x16')]);_0x3c264c(_0x33214f[_0x8802('0x14')](0x1f4,_0x3a9c67[_0x8802('0x16')]));});}})['catch'](function(_0x362a2a){logger[_0x8802('0x14')]('VerifyAdditionalPhones',_0x362a2a['message']);_0x3c264c(_0x33214f[_0x8802('0x14')](0x1f4,_0x362a2a[_0x8802('0x16')]));});}else _0x50eb81({'additional':0x0});});});};exports[_0x8802('0x29')]=function(_0x4328ef){var _0x4efc76=this;return new Promise(function(_0x12d87b,_0x4b4d42){return db['CmHopper'][_0x8802('0x1b')]({'raw':!![],'where':{'ContactId':_0x4328ef[_0x8802('0x1d')][_0x8802('0x1c')],'ListId':_0x4328ef[_0x8802('0x1d')]['ListId'],'VoiceQueueId':_0x4328ef['body'][_0x8802('0x1e')]===undefined?null:_0x4328ef[_0x8802('0x1d')][_0x8802('0x1e')],'CampaignId':_0x4328ef[_0x8802('0x1d')]['CampaignId']===undefined?null:_0x4328ef[_0x8802('0x1d')][_0x8802('0x1f')]}})[_0x8802('0xe')](function(_0x1ad3dc){if(_0x1ad3dc!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x1ad3dc['id'],'OrderBy':{'$gte':_0x1ad3dc[_0x8802('0x21')]}},'order':[[_0x8802('0x21'),_0x8802('0x22')]]})[_0x8802('0xe')](function(_0x55cf81){if(_0x55cf81)return activateAdditionalPhone(_0x1ad3dc,_0x4328ef[_0x8802('0x1d')],_0x55cf81,_0x4328ef[_0x8802('0x2a')],_0x4328ef[_0x8802('0x2b')])['then'](function(_0x2f3266){_0x12d87b(_0x2f3266);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x1ad3dc['id']},'order':[[_0x8802('0x21'),_0x8802('0x22')]]})[_0x8802('0xe')](function(_0x5385cb){if(_0x5385cb)return activateAdditionalPhone(_0x1ad3dc,_0x4328ef[_0x8802('0x1d')],_0x5385cb,_0x4328ef['duration'],_0x4328ef['waitTime'])[_0x8802('0xe')](function(_0x5784a4){_0x12d87b(_0x5784a4);});else{_0x12d87b({'id':_0x1ad3dc['id'],'phone':''});}})['catch'](function(_0x2f49e0){logger[_0x8802('0x14')](_0x8802('0x1a'),_0x2f49e0[_0x8802('0x16')]);_0x4b4d42(_0x4efc76[_0x8802('0x14')](0x1f4,_0x2f49e0[_0x8802('0x16')]));});}})[_0x8802('0x19')](function(_0x251d52){logger[_0x8802('0x14')](_0x8802('0x1a'),_0x251d52[_0x8802('0x16')]);_0x4b4d42(_0x4efc76[_0x8802('0x14')](0x1f4,_0x251d52['message']));});}else _0x12d87b(0x1);});});};function activateAdditionalPhone(_0x2c19b9,_0x48db99,_0x328c5b,_0x427a96,_0x3ca8db){return new Promise(function(_0x42c18d,_0x425039){var _0x2259b5;if(_['isNil'](_0x328c5b['scheduledat'])){_0x328c5b[_0x8802('0x2c')]=moment();}if(moment()>moment(_0x328c5b[_0x8802('0x2c')])){_0x2259b5=moment()[_0x8802('0x2d')](_0x3ca8db||0x3,'minutes');}else{if(_0x328c5b[_0x8802('0x21')]==0x0){_0x2259b5=moment(_0x328c5b[_0x8802('0x2c')]);}else{_0x2259b5=moment()[_0x8802('0x2d')](_0x3ca8db||0x3,_0x8802('0x2e'));}}if(_['isNil'](_0x2259b5)){_0x2259b5=moment()[_0x8802('0x2d')](_0x3ca8db||0x3,'minutes');}var _0x335c10={'phone':_0x2c19b9[_0x8802('0x2f')],'active':0x0,'OrderBy':_[_0x8802('0x30')](_0x2c19b9[_0x8802('0x21')])?0x0:_0x2c19b9[_0x8802('0x21')],'scheduledat':moment()['add'](_0x427a96||0x1,_0x8802('0x2e')),'countbusyretry':_0x48db99[_0x8802('0x31')],'countcongestionretry':_0x48db99[_0x8802('0x32')],'countnoanswerretry':_0x48db99[_0x8802('0x23')],'countnosuchnumberretry':_0x48db99['countnosuchnumberretry'],'countdropretry':_0x48db99['countdropretry'],'countabandonedretry':_0x48db99['countabandonedretry'],'countmachineretry':_0x48db99[_0x8802('0x26')],'countagentrejectretry':_0x48db99[_0x8802('0x33')],'createdAt':_0x48db99['createdAt'],'updatedAt':_0x48db99['updatedAt']};var _0x560002={'CmHopperId':_0x2c19b9['id'],'phone':_0x328c5b['phone'],'active':0x0,'OrderBy':_[_0x8802('0x30')](_0x328c5b[_0x8802('0x21')])?0x0:_0x328c5b[_0x8802('0x21')],'scheduledat':_0x2259b5,'countbusyretry':_0x328c5b[_0x8802('0x31')],'countcongestionretry':_0x328c5b['countcongestionretry'],'countnoanswerretry':_0x328c5b[_0x8802('0x23')],'countnosuchnumberretry':_0x328c5b[_0x8802('0x24')],'countdropretry':_0x328c5b[_0x8802('0x34')],'countabandonedretry':_0x328c5b[_0x8802('0x25')],'countmachineretry':_0x328c5b[_0x8802('0x26')],'countagentrejectretry':_0x328c5b[_0x8802('0x33')],'createdAt':_0x328c5b[_0x8802('0x35')],'updatedAt':_0x328c5b['updatedAt']};return db[_0x8802('0x36')][_0x8802('0x37')](function(_0x195cd1){return db[_0x8802('0x20')][_0x8802('0x38')](_0x335c10,{'where':{'id':_0x328c5b['id']}},{'transaction':_0x195cd1})[_0x8802('0xe')](function(){return db['CmHopper'][_0x8802('0x38')](_0x560002,{'where':{'id':_0x2c19b9['id']}},{'transaction':_0x195cd1});});})['then'](function(_0x22c187){_0x42c18d({'id':_0x2c19b9['id'],'phone':_0x328c5b['phone']});})[_0x8802('0x19')](function(_0x14d82a){logger[_0x8802('0x14')](_0x8802('0x39'),_0x14d82a['message']);_0x425039({'error':_0x14d82a[_0x8802('0x16')]});});});}exports[_0x8802('0x3a')]=function(_0x1c8ae3){var _0x24b48e=this;return new Promise(function(_0x4492df,_0x85dad6){return db[_0x8802('0x3b')][_0x8802('0x38')](_0x1c8ae3[_0x8802('0x1d')][_0x8802('0x3c')],{'where':{'id':_0x1c8ae3[_0x8802('0x1d')]['id']}})[_0x8802('0xe')](function(_0xee7632){_0x4492df(_0xee7632);})['catch'](function(_0x56a410){logger[_0x8802('0x14')](_0x8802('0x3a'),_0x56a410[_0x8802('0x16')]);_0x85dad6(_0x24b48e[_0x8802('0x14')](0x1f4,_0x56a410[_0x8802('0x16')]));});});};
\ No newline at end of file
+var _0xc622=['scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','CmHopper','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','VerifyAdditionalPhones','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','countnoanswerretry','countmachineretry','countagentrejectretry','catch','duration','waitTime','isNil'];(function(_0x1bc989,_0x4130ce){var _0x488ead=function(_0xf5c90c){while(--_0xf5c90c){_0x1bc989['push'](_0x1bc989['shift']());}};_0x488ead(++_0x4130ce);}(_0xc622,0xb5));var _0x2c62=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0xc622[_0x105045];return _0x2487d0;};'use strict';var _=require('lodash');var util=require(_0x2c62('0x0'));var moment=require(_0x2c62('0x1'));var BPromise=require(_0x2c62('0x2'));var rs=require(_0x2c62('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c62('0x4'));var logger=require('../../config/logger')(_0x2c62('0x5'));var config=require('../../config/environment');var jayson=require(_0x2c62('0x6'));var client=jayson[_0x2c62('0x7')][_0x2c62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59874c,_0x42c274,_0x34dbca){return new BPromise(function(_0x34adf7,_0x53ae87){return client[_0x2c62('0x9')](_0x59874c,_0x34dbca)[_0x2c62('0xa')](function(_0xffa6de){logger['info'](_0x2c62('0xb'),_0x42c274,'request\x20sent');logger[_0x2c62('0xc')](_0x2c62('0xd'),_0x42c274,_0x2c62('0xe'),JSON['stringify'](_0xffa6de));if(_0xffa6de['error']){if(_0xffa6de[_0x2c62('0xf')]['code']===0x1f4){logger[_0x2c62('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x42c274,_0xffa6de[_0x2c62('0xf')][_0x2c62('0x10')]);return _0x53ae87(_0xffa6de['error'][_0x2c62('0x10')]);}logger[_0x2c62('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x42c274,_0xffa6de['error']['message']);return _0x34adf7(_0xffa6de[_0x2c62('0xf')][_0x2c62('0x10')]);}else{logger[_0x2c62('0x11')](_0x2c62('0xb'),_0x42c274,_0x2c62('0xe'));_0x34adf7(_0xffa6de[_0x2c62('0x12')]['message']);}})['catch'](function(_0x6bcf49){logger[_0x2c62('0xf')](_0x2c62('0xb'),_0x42c274,_0x6bcf49);_0x53ae87(_0x6bcf49);});});}exports[_0x2c62('0x13')]=function(_0xbe82d){var _0xef5bd=this;return new Promise(function(_0x1753b3,_0x30ee37){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0xbe82d[_0x2c62('0x14')][_0x2c62('0x15')],'ListId':_0xbe82d[_0x2c62('0x14')][_0x2c62('0x16')],'VoiceQueueId':_0xbe82d[_0x2c62('0x14')][_0x2c62('0x17')]===undefined?null:_0xbe82d[_0x2c62('0x14')]['VoiceQueueId'],'CampaignId':_0xbe82d[_0x2c62('0x14')][_0x2c62('0x18')]===undefined?null:_0xbe82d['body'][_0x2c62('0x18')]}})['then'](function(_0x11af2b){if(_0x11af2b!=null){return db[_0x2c62('0x19')][_0x2c62('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x11af2b['id'],'OrderBy':{'$gt':_0x11af2b['OrderBy']}},'order':[[_0x2c62('0x1b'),_0x2c62('0x1c')]]})[_0x2c62('0xa')](function(_0x50d914){var _0x4df2ab=0x0;if(_0x50d914){if(_0x50d914[_0x2c62('0x1d')]+_0x50d914[_0x2c62('0x1e')]+_0x50d914['countnoanswerretry']+_0x50d914[_0x2c62('0x1f')]+_0x50d914[_0x2c62('0x20')]+_0x50d914[_0x2c62('0x21')]+_0x50d914['countmachineretry']+_0x50d914['countagentrejectretry']<_0xbe82d[_0x2c62('0x22')][_0x2c62('0x23')])_0x4df2ab=0x1;_0x1753b3({'additional':_0x4df2ab});}else{return db[_0x2c62('0x19')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x11af2b['id']},'order':[[_0x2c62('0x1b'),'ASC']]})[_0x2c62('0xa')](function(_0x7f0d5d){var _0x5431af=0x0;if(_0x7f0d5d){if(_0x7f0d5d[_0x2c62('0x1d')]+_0x7f0d5d[_0x2c62('0x1e')]+_0x7f0d5d[_0x2c62('0x24')]+_0x7f0d5d['countnosuchnumberretry']+_0x7f0d5d[_0x2c62('0x20')]+_0x7f0d5d[_0x2c62('0x21')]+_0x7f0d5d[_0x2c62('0x25')]+_0x7f0d5d[_0x2c62('0x26')]<_0xbe82d[_0x2c62('0x22')][_0x2c62('0x23')])_0x5431af=0x1;_0x1753b3({'additional':_0x5431af});}else{_0x1753b3({'additional':0x0});}})[_0x2c62('0x27')](function(_0x2e0621){logger[_0x2c62('0xf')](_0x2c62('0x13'),_0x2e0621[_0x2c62('0x10')]);_0x30ee37(_0xef5bd[_0x2c62('0xf')](0x1f4,_0x2e0621['message']));});}})[_0x2c62('0x27')](function(_0x27ced3){logger['error'](_0x2c62('0x13'),_0x27ced3[_0x2c62('0x10')]);_0x30ee37(_0xef5bd['error'](0x1f4,_0x27ced3[_0x2c62('0x10')]));});}else _0x1753b3({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x434d43){var _0x49b2c7=this;return new Promise(function(_0x51f836,_0x2d1ec8){return db['CmHopper'][_0x2c62('0x1a')]({'raw':!![],'where':{'ContactId':_0x434d43[_0x2c62('0x14')][_0x2c62('0x15')],'ListId':_0x434d43[_0x2c62('0x14')][_0x2c62('0x16')],'VoiceQueueId':_0x434d43['body']['VoiceQueueId']===undefined?null:_0x434d43[_0x2c62('0x14')][_0x2c62('0x17')],'CampaignId':_0x434d43[_0x2c62('0x14')]['CampaignId']===undefined?null:_0x434d43['body'][_0x2c62('0x18')]}})[_0x2c62('0xa')](function(_0x1f1bcc){if(_0x1f1bcc!=null){return db['CmHopperAdditionalPhone'][_0x2c62('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x1f1bcc['id'],'OrderBy':{'$gte':_0x1f1bcc[_0x2c62('0x1b')]}},'order':[[_0x2c62('0x1b'),_0x2c62('0x1c')]]})[_0x2c62('0xa')](function(_0x151c55){if(_0x151c55)return activateAdditionalPhone(_0x1f1bcc,_0x434d43['body'],_0x151c55,_0x434d43[_0x2c62('0x28')],_0x434d43['waitTime'])[_0x2c62('0xa')](function(_0x4f8653){_0x51f836(_0x4f8653);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x1f1bcc['id']},'order':[[_0x2c62('0x1b'),_0x2c62('0x1c')]]})['then'](function(_0x2ec9af){if(_0x2ec9af)return activateAdditionalPhone(_0x1f1bcc,_0x434d43[_0x2c62('0x14')],_0x2ec9af,_0x434d43[_0x2c62('0x28')],_0x434d43[_0x2c62('0x29')])['then'](function(_0x5355ca){_0x51f836(_0x5355ca);});else{_0x51f836({'id':_0x1f1bcc['id'],'phone':''});}})[_0x2c62('0x27')](function(_0x9f3cc2){logger['error']('VerifyAdditionalPhones',_0x9f3cc2[_0x2c62('0x10')]);_0x2d1ec8(_0x49b2c7['error'](0x1f4,_0x9f3cc2[_0x2c62('0x10')]));});}})[_0x2c62('0x27')](function(_0x444fb7){logger['error']('VerifyAdditionalPhones',_0x444fb7[_0x2c62('0x10')]);_0x2d1ec8(_0x49b2c7['error'](0x1f4,_0x444fb7[_0x2c62('0x10')]));});}else _0x51f836(0x1);});});};function activateAdditionalPhone(_0x313364,_0x27bc0a,_0x7aedf5,_0x3d29c1,_0x56ed82){return new Promise(function(_0x4b47c2,_0xf6b6a1){var _0x358ce0;if(_[_0x2c62('0x2a')](_0x7aedf5['scheduledat'])){_0x7aedf5[_0x2c62('0x2b')]=moment();}if(moment()>moment(_0x7aedf5[_0x2c62('0x2b')])){_0x358ce0=moment()[_0x2c62('0x2c')](_0x56ed82||0x3,_0x2c62('0x2d'));}else{if(_0x7aedf5[_0x2c62('0x1b')]==0x0){_0x358ce0=moment(_0x7aedf5['scheduledat']);}else{_0x358ce0=moment()[_0x2c62('0x2c')](_0x56ed82||0x3,'minutes');}}if(_['isNil'](_0x358ce0)){_0x358ce0=moment()[_0x2c62('0x2c')](_0x56ed82||0x3,'minutes');}var _0x1fe667={'phone':_0x313364[_0x2c62('0x2e')],'active':0x0,'OrderBy':_[_0x2c62('0x2a')](_0x313364[_0x2c62('0x1b')])?0x0:_0x313364[_0x2c62('0x1b')],'scheduledat':moment()[_0x2c62('0x2c')](_0x3d29c1||0x1,_0x2c62('0x2d')),'countbusyretry':_0x27bc0a[_0x2c62('0x1d')],'countcongestionretry':_0x27bc0a[_0x2c62('0x1e')],'countnoanswerretry':_0x27bc0a[_0x2c62('0x24')],'countnosuchnumberretry':_0x27bc0a[_0x2c62('0x1f')],'countdropretry':_0x27bc0a[_0x2c62('0x20')],'countabandonedretry':_0x27bc0a[_0x2c62('0x21')],'countmachineretry':_0x27bc0a[_0x2c62('0x25')],'countagentrejectretry':_0x27bc0a[_0x2c62('0x26')],'createdAt':_0x27bc0a[_0x2c62('0x2f')],'updatedAt':_0x27bc0a[_0x2c62('0x30')]};var _0x4f5e53={'CmHopperId':_0x313364['id'],'phone':_0x7aedf5[_0x2c62('0x2e')],'active':0x0,'OrderBy':_[_0x2c62('0x2a')](_0x7aedf5[_0x2c62('0x1b')])?0x0:_0x7aedf5[_0x2c62('0x1b')],'scheduledat':_0x358ce0,'countbusyretry':_0x7aedf5[_0x2c62('0x1d')],'countcongestionretry':_0x7aedf5['countcongestionretry'],'countnoanswerretry':_0x7aedf5[_0x2c62('0x24')],'countnosuchnumberretry':_0x7aedf5[_0x2c62('0x1f')],'countdropretry':_0x7aedf5[_0x2c62('0x20')],'countabandonedretry':_0x7aedf5[_0x2c62('0x21')],'countmachineretry':_0x7aedf5[_0x2c62('0x25')],'countagentrejectretry':_0x7aedf5[_0x2c62('0x26')],'createdAt':_0x7aedf5['createdAt'],'updatedAt':_0x7aedf5[_0x2c62('0x30')]};return db[_0x2c62('0x31')][_0x2c62('0x32')](function(_0x7ee1dd){return db[_0x2c62('0x19')][_0x2c62('0x33')](_0x1fe667,{'where':{'id':_0x7aedf5['id']}},{'transaction':_0x7ee1dd})[_0x2c62('0xa')](function(){return db[_0x2c62('0x34')][_0x2c62('0x33')](_0x4f5e53,{'where':{'id':_0x313364['id']}},{'transaction':_0x7ee1dd});});})['then'](function(_0x468a5f){_0x4b47c2({'id':_0x313364['id'],'phone':_0x7aedf5['phone']});})[_0x2c62('0x27')](function(_0x79d803){logger[_0x2c62('0xf')](_0x2c62('0x35'),_0x79d803['message']);_0xf6b6a1({'error':_0x79d803['message']});});});}exports[_0x2c62('0x36')]=function(_0x2040e5){var _0x2c7cd4=this;return new Promise(function(_0x383bb6,_0x570a47){return db['CmHopper'][_0x2c62('0x33')](_0x2040e5['body'][_0x2c62('0x37')],{'where':{'id':_0x2040e5['body']['id']}})['then'](function(_0x2b039f){_0x383bb6(_0x2b039f);})[_0x2c62('0x27')](function(_0x3aaaa0){logger[_0x2c62('0xf')](_0x2c62('0x36'),_0x3aaaa0[_0x2c62('0x10')]);_0x570a47(_0x2c7cd4[_0x2c62('0xf')](0x1f4,_0x3aaaa0[_0x2c62('0x10')]));});});};
\ No newline at end of file
index 5e7ef36..1427608 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c2=['index','/:id','show','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x2911f7,_0x41bbee){var _0x28207d=function(_0x1976a3){while(--_0x1976a3){_0x2911f7['push'](_0x2911f7['shift']());}};_0x28207d(++_0x41bbee);}(_0xa2c2,0xa0));var _0x2a2c=function(_0x5999c2,_0x35f914){_0x5999c2=_0x5999c2-0x0;var _0x52edca=_0xa2c2[_0x5999c2];return _0x52edca;};'use strict';var multer=require(_0x2a2c('0x0'));var util=require(_0x2a2c('0x1'));var path=require(_0x2a2c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2a2c('0x3')]();var fs_extra=require(_0x2a2c('0x4'));var auth=require(_0x2a2c('0x5'));var interaction=require(_0x2a2c('0x6'));var config=require(_0x2a2c('0x7'));var controller=require(_0x2a2c('0x8'));router[_0x2a2c('0x9')]('/',auth[_0x2a2c('0xa')](),controller[_0x2a2c('0xb')]);router[_0x2a2c('0x9')](_0x2a2c('0xc'),auth[_0x2a2c('0xa')](),controller[_0x2a2c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a2c('0xe')]);router[_0x2a2c('0xf')](_0x2a2c('0xc'),auth[_0x2a2c('0xa')](),controller['update']);router[_0x2a2c('0x10')]('/:id',auth[_0x2a2c('0xa')](),controller[_0x2a2c('0x11')]);module[_0x2a2c('0x12')]=router;
\ No newline at end of file
+var _0xf215=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','index','get','/:id','isAuthenticated','post','create','put','destroy','multer','util'];(function(_0x26fd90,_0x137a12){var _0xc40000=function(_0x5d51f2){while(--_0x5d51f2){_0x26fd90['push'](_0x26fd90['shift']());}};_0xc40000(++_0x137a12);}(_0xf215,0xec));var _0x5f21=function(_0x435801,_0x2b1487){_0x435801=_0x435801-0x0;var _0x126695=_0xf215[_0x435801];return _0x126695;};'use strict';var multer=require(_0x5f21('0x0'));var util=require(_0x5f21('0x1'));var path=require('path');var timeout=require(_0x5f21('0x2'));var express=require(_0x5f21('0x3'));var router=express[_0x5f21('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5f21('0x5'));var interaction=require(_0x5f21('0x6'));var config=require(_0x5f21('0x7'));var controller=require(_0x5f21('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5f21('0x9')]);router[_0x5f21('0xa')](_0x5f21('0xb'),auth[_0x5f21('0xc')](),controller['show']);router[_0x5f21('0xd')]('/',auth[_0x5f21('0xc')](),controller[_0x5f21('0xe')]);router[_0x5f21('0xf')](_0x5f21('0xb'),auth[_0x5f21('0xc')](),controller['update']);router['delete'](_0x5f21('0xb'),auth['isAuthenticated'](),controller[_0x5f21('0x10')]);module['exports']=router;
\ No newline at end of file
index 5075ac8..25941d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5379=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x5379,0x1a2));var _0x9537=function(_0x5b2a38,_0x4d1f2b){_0x5b2a38=_0x5b2a38-0x0;var _0x3a1670=_0x5379[_0x5b2a38];return _0x3a1670;};'use strict';var moment=require(_0x9537('0x0'));var Sequelize=require(_0x9537('0x1'));module[_0x9537('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9537('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9537('0x3')],'unique':_0x9537('0x4')},'VoiceQueueId':{'type':Sequelize[_0x9537('0x3')],'unique':_0x9537('0x4')}};
\ No newline at end of file
+var _0x1b20=['contactListQueue','INTEGER','sequelize','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var moment=require('moment');var Sequelize=require(_0x01b2('0x0'));module[_0x01b2('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x01b2('0x2')},'ListId':{'type':Sequelize[_0x01b2('0x3')],'unique':_0x01b2('0x2')},'VoiceQueueId':{'type':Sequelize[_0x01b2('0x3')],'unique':_0x01b2('0x2')}};
\ No newline at end of file
index eb58264..19322a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41e0=['body','params','find','describe','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','include'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x41e0,0x18f));var _0x041e=function(_0x30a02e,_0x1338e8){_0x30a02e=_0x30a02e-0x0;var _0x36102a=_0x41e0[_0x30a02e];return _0x36102a;};'use strict';var emlformat=require(_0x041e('0x0'));var rimraf=require(_0x041e('0x1'));var zipdir=require(_0x041e('0x2'));var jsonpatch=require(_0x041e('0x3'));var rp=require(_0x041e('0x4'));var moment=require(_0x041e('0x5'));var BPromise=require(_0x041e('0x6'));var Mustache=require(_0x041e('0x7'));var util=require(_0x041e('0x8'));var path=require(_0x041e('0x9'));var sox=require(_0x041e('0xa'));var csv=require(_0x041e('0xb'));var ejs=require(_0x041e('0xc'));var fs=require('fs');var fs_extra=require(_0x041e('0xd'));var _=require(_0x041e('0xe'));var squel=require(_0x041e('0xf'));var crypto=require(_0x041e('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x041e('0x11'));var toCsv=require(_0x041e('0xb'));var querystring=require(_0x041e('0x12'));var Papa=require(_0x041e('0x13'));var Redis=require('ioredis');var authService=require(_0x041e('0x14'));var qs=require(_0x041e('0x15'));var as=require(_0x041e('0x16'));var hardwareService=require(_0x041e('0x17'));var logger=require('../../config/logger')(_0x041e('0x18'));var utils=require('../../config/utils');var config=require(_0x041e('0x19'));var licenseUtil=require(_0x041e('0x1a'));var db=require(_0x041e('0x1b'))['db'];function respondWithStatusCode(_0x5b6381,_0x177fde){_0x177fde=_0x177fde||0xcc;return function(_0x41ba2c){if(_0x41ba2c){return _0x5b6381[_0x041e('0x1c')](_0x177fde);}return _0x5b6381['status'](_0x177fde)[_0x041e('0x1d')]();};}function respondWithResult(_0x1c56ce,_0x1fdf2c){_0x1fdf2c=_0x1fdf2c||0xc8;return function(_0xc68f88){if(_0xc68f88){return _0x1c56ce['status'](_0x1fdf2c)[_0x041e('0x1e')](_0xc68f88);}};}function respondWithFilteredResult(_0x4762e1,_0x16d79b){return function(_0x5379da){if(_0x5379da){var _0x53c2b9=typeof _0x16d79b['offset']===_0x041e('0x1f')&&typeof _0x16d79b[_0x041e('0x20')]==='undefined';var _0x38af76=_0x5379da['count'];var _0x9f4956=_0x53c2b9?0x0:_0x16d79b[_0x041e('0x21')];var _0xef5d0b=_0x53c2b9?_0x5379da[_0x041e('0x22')]:_0x16d79b[_0x041e('0x21')]+_0x16d79b[_0x041e('0x20')];var _0x2114b1;if(_0xef5d0b>=_0x38af76){_0xef5d0b=_0x38af76;_0x2114b1=0xc8;}else{_0x2114b1=0xce;}_0x4762e1[_0x041e('0x23')](_0x2114b1);return _0x4762e1['set'](_0x041e('0x24'),_0x9f4956+'-'+_0xef5d0b+'/'+_0x38af76)[_0x041e('0x1e')](_0x5379da);}return null;};}function patchUpdates(_0x1b99ac){return function(_0x34a36d){try{jsonpatch[_0x041e('0x25')](_0x34a36d,_0x1b99ac,!![]);}catch(_0x3080d3){return BPromise[_0x041e('0x26')](_0x3080d3);}return _0x34a36d[_0x041e('0x27')]();};}function saveUpdates(_0x5a22c5,_0x3c21cf){return function(_0x56be2b){if(_0x56be2b){return _0x56be2b[_0x041e('0x28')](_0x5a22c5)['then'](function(_0x43f07d){return _0x43f07d;});}return null;};}function removeEntity(_0x53840f,_0x375d04){return function(_0xd0b6d){if(_0xd0b6d){return _0xd0b6d[_0x041e('0x29')]()[_0x041e('0x2a')](function(){_0x53840f['status'](0xcc)[_0x041e('0x1d')]();});}};}function handleEntityNotFound(_0x655600,_0x169858){return function(_0x200ea7){if(!_0x200ea7){_0x655600[_0x041e('0x1c')](0x194);}return _0x200ea7;};}function handleError(_0x4120a7,_0x3fcc0d){_0x3fcc0d=_0x3fcc0d||0x1f4;return function(_0x4d766e){logger['error'](_0x4d766e[_0x041e('0x2b')]);if(_0x4d766e[_0x041e('0x2c')]){delete _0x4d766e[_0x041e('0x2c')];}_0x4120a7[_0x041e('0x23')](_0x3fcc0d)[_0x041e('0x2d')](_0x4d766e);};}exports[_0x041e('0x2e')]=function(_0x47020d,_0x5f3ce9){var _0x20236f={},_0x8f7e93={},_0x200045={'count':0x0,'rows':[]};var _0x58ddef=_['map'](db[_0x041e('0x2f')][_0x041e('0x30')],function(_0x360819){return{'name':_0x360819[_0x041e('0x31')],'type':_0x360819[_0x041e('0x32')][_0x041e('0x33')]};});_0x8f7e93['model']=_[_0x041e('0x34')](_0x58ddef,_0x041e('0x2c'));_0x8f7e93[_0x041e('0x35')]=_[_0x041e('0x36')](_0x47020d[_0x041e('0x35')]);_0x8f7e93['filters']=_[_0x041e('0x37')](_0x8f7e93[_0x041e('0x38')],_0x8f7e93[_0x041e('0x35')]);_0x20236f[_0x041e('0x39')]=_[_0x041e('0x37')](_0x8f7e93[_0x041e('0x38')],qs[_0x041e('0x3a')](_0x47020d[_0x041e('0x35')][_0x041e('0x3a')]));_0x20236f['attributes']=_0x20236f['attributes'][_0x041e('0x3b')]?_0x20236f[_0x041e('0x39')]:_0x8f7e93[_0x041e('0x38')];if(!_0x47020d[_0x041e('0x35')][_0x041e('0x3c')](_0x041e('0x3d'))){_0x20236f[_0x041e('0x20')]=qs[_0x041e('0x20')](_0x47020d[_0x041e('0x35')][_0x041e('0x20')]);_0x20236f['offset']=qs[_0x041e('0x21')](_0x47020d[_0x041e('0x35')][_0x041e('0x21')]);}_0x20236f[_0x041e('0x3e')]=qs[_0x041e('0x3f')](_0x47020d['query']['sort']);_0x20236f[_0x041e('0x40')]=qs[_0x041e('0x41')](_[_0x041e('0x42')](_0x47020d[_0x041e('0x35')],_0x8f7e93[_0x041e('0x41')]),_0x58ddef);if(_0x47020d['query'][_0x041e('0x43')]){_0x20236f[_0x041e('0x40')]=_[_0x041e('0x44')](_0x20236f[_0x041e('0x40')],{'$or':_[_0x041e('0x34')](_0x58ddef,function(_0x2b814f){if(_0x2b814f['type']!=='VIRTUAL'){var _0xa4361b={};_0xa4361b[_0x2b814f[_0x041e('0x2c')]]={'$like':'%'+_0x47020d[_0x041e('0x35')][_0x041e('0x43')]+'%'};return _0xa4361b;}})});}_0x20236f=_['merge']({},_0x20236f,_0x47020d[_0x041e('0x45')]);var _0x2d9db3={'where':_0x20236f[_0x041e('0x40')]};return db[_0x041e('0x2f')]['count'](_0x2d9db3)[_0x041e('0x2a')](function(_0x4db6d6){_0x200045[_0x041e('0x22')]=_0x4db6d6;if(_0x47020d[_0x041e('0x35')][_0x041e('0x46')]){_0x20236f['include']=[{'all':!![]}];}return db[_0x041e('0x2f')][_0x041e('0x47')](_0x20236f);})['then'](function(_0x4e1762){_0x200045[_0x041e('0x48')]=_0x4e1762;return _0x200045;})['then'](respondWithFilteredResult(_0x5f3ce9,_0x20236f))[_0x041e('0x49')](handleError(_0x5f3ce9,null));};exports['show']=function(_0x1fcf81,_0x4f5ab0){var _0x7d10a={'raw':!![],'where':{'id':_0x1fcf81['params']['id']}},_0x2f9fd3={};_0x2f9fd3[_0x041e('0x38')]=_[_0x041e('0x36')](db[_0x041e('0x2f')][_0x041e('0x30')]);_0x2f9fd3[_0x041e('0x35')]=_[_0x041e('0x36')](_0x1fcf81['query']);_0x2f9fd3[_0x041e('0x41')]=_[_0x041e('0x37')](_0x2f9fd3['model'],_0x2f9fd3[_0x041e('0x35')]);_0x7d10a[_0x041e('0x39')]=_[_0x041e('0x37')](_0x2f9fd3[_0x041e('0x38')],qs[_0x041e('0x3a')](_0x1fcf81[_0x041e('0x35')]['fields']));_0x7d10a[_0x041e('0x39')]=_0x7d10a['attributes']['length']?_0x7d10a[_0x041e('0x39')]:_0x2f9fd3['model'];if(_0x1fcf81[_0x041e('0x35')][_0x041e('0x46')]){_0x7d10a[_0x041e('0x4a')]=[{'all':!![]}];}_0x7d10a=_[_0x041e('0x44')]({},_0x7d10a,_0x1fcf81[_0x041e('0x45')]);return db['CmHopperBlack']['find'](_0x7d10a)[_0x041e('0x2a')](handleEntityNotFound(_0x4f5ab0,null))['then'](respondWithResult(_0x4f5ab0,null))[_0x041e('0x49')](handleError(_0x4f5ab0,null));};exports['update']=function(_0x18b4a8,_0x22504e){if(_0x18b4a8['body']['id']){delete _0x18b4a8[_0x041e('0x4b')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x18b4a8[_0x041e('0x4c')]['id']}})[_0x041e('0x2a')](handleEntityNotFound(_0x22504e,null))[_0x041e('0x2a')](saveUpdates(_0x18b4a8[_0x041e('0x4b')],null))[_0x041e('0x2a')](respondWithResult(_0x22504e,null))[_0x041e('0x49')](handleError(_0x22504e,null));};exports[_0x041e('0x29')]=function(_0x2a0665,_0x1e37df){return db['CmHopperBlack'][_0x041e('0x4d')]({'where':{'id':_0x2a0665[_0x041e('0x4c')]['id']}})[_0x041e('0x2a')](handleEntityNotFound(_0x1e37df,null))[_0x041e('0x2a')](removeEntity(_0x1e37df,null))[_0x041e('0x49')](handleError(_0x1e37df,null));};exports[_0x041e('0x4e')]=function(_0x344bcb,_0x415cae){return db[_0x041e('0x2f')][_0x041e('0x4e')]()['then'](respondWithResult(_0x415cae,null))[_0x041e('0x49')](handleError(_0x415cae,null));};
\ No newline at end of file
+var _0x1396=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','apply','reject','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','options','CmHopperBlack','include','findAll','rows','catch','show','params','length','includeAll','find','body','describe','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x3d575f,_0x2e8e6e){var _0x3ee0c7=function(_0x20fe3c){while(--_0x20fe3c){_0x3d575f['push'](_0x3d575f['shift']());}};_0x3ee0c7(++_0x2e8e6e);}(_0x1396,0x1ea));var _0x6139=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x1396[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0x6139('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6139('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6139('0x2'));var BPromise=require(_0x6139('0x3'));var Mustache=require('mustache');var util=require(_0x6139('0x4'));var path=require('path');var sox=require(_0x6139('0x5'));var csv=require(_0x6139('0x6'));var ejs=require(_0x6139('0x7'));var fs=require('fs');var fs_extra=require(_0x6139('0x8'));var _=require(_0x6139('0x9'));var squel=require(_0x6139('0xa'));var crypto=require(_0x6139('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6139('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6139('0xd'));var Papa=require(_0x6139('0xe'));var Redis=require(_0x6139('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6139('0x10'));var as=require(_0x6139('0x11'));var hardwareService=require(_0x6139('0x12'));var logger=require(_0x6139('0x13'))(_0x6139('0x14'));var utils=require(_0x6139('0x15'));var config=require(_0x6139('0x16'));var licenseUtil=require(_0x6139('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a84a0,_0x37d778){_0x37d778=_0x37d778||0xcc;return function(_0x37920e){if(_0x37920e){return _0x5a84a0[_0x6139('0x18')](_0x37d778);}return _0x5a84a0[_0x6139('0x19')](_0x37d778)['end']();};}function respondWithResult(_0x164d2d,_0x1776c9){_0x1776c9=_0x1776c9||0xc8;return function(_0xa1ad8e){if(_0xa1ad8e){return _0x164d2d[_0x6139('0x19')](_0x1776c9)[_0x6139('0x1a')](_0xa1ad8e);}};}function respondWithFilteredResult(_0x42c418,_0x35329b){return function(_0x2fc85e){if(_0x2fc85e){var _0x2cdb64=typeof _0x35329b[_0x6139('0x1b')]==='undefined'&&typeof _0x35329b[_0x6139('0x1c')]===_0x6139('0x1d');var _0x2896e1=_0x2fc85e['count'];var _0x33405c=_0x2cdb64?0x0:_0x35329b['offset'];var _0x1f7b5b=_0x2cdb64?_0x2fc85e[_0x6139('0x1e')]:_0x35329b[_0x6139('0x1b')]+_0x35329b[_0x6139('0x1c')];var _0x128219;if(_0x1f7b5b>=_0x2896e1){_0x1f7b5b=_0x2896e1;_0x128219=0xc8;}else{_0x128219=0xce;}_0x42c418[_0x6139('0x19')](_0x128219);return _0x42c418['set']('Content-Range',_0x33405c+'-'+_0x1f7b5b+'/'+_0x2896e1)[_0x6139('0x1a')](_0x2fc85e);}return null;};}function patchUpdates(_0x59f23d){return function(_0x41d6b8){try{jsonpatch[_0x6139('0x1f')](_0x41d6b8,_0x59f23d,!![]);}catch(_0x3a374f){return BPromise[_0x6139('0x20')](_0x3a374f);}return _0x41d6b8['save']();};}function saveUpdates(_0x31c1f8,_0x41a703){return function(_0x52fea0){if(_0x52fea0){return _0x52fea0[_0x6139('0x21')](_0x31c1f8)[_0x6139('0x22')](function(_0x28badc){return _0x28badc;});}return null;};}function removeEntity(_0x1ed2d5,_0x531926){return function(_0xfe244c){if(_0xfe244c){return _0xfe244c[_0x6139('0x23')]()[_0x6139('0x22')](function(){_0x1ed2d5[_0x6139('0x19')](0xcc)[_0x6139('0x24')]();});}};}function handleEntityNotFound(_0x40b3e4,_0x146109){return function(_0x4a0a1e){if(!_0x4a0a1e){_0x40b3e4['sendStatus'](0x194);}return _0x4a0a1e;};}function handleError(_0xb5bc7b,_0x5a3242){_0x5a3242=_0x5a3242||0x1f4;return function(_0x33de29){logger['error'](_0x33de29[_0x6139('0x25')]);if(_0x33de29[_0x6139('0x26')]){delete _0x33de29[_0x6139('0x26')];}_0xb5bc7b[_0x6139('0x19')](_0x5a3242)[_0x6139('0x27')](_0x33de29);};}exports[_0x6139('0x28')]=function(_0x1d3af6,_0x4d19ca){var _0x4bc5eb={},_0x233191={},_0x521818={'count':0x0,'rows':[]};var _0x19dd77=_[_0x6139('0x29')](db['CmHopperBlack'][_0x6139('0x2a')],function(_0x4725f3){return{'name':_0x4725f3[_0x6139('0x2b')],'type':_0x4725f3['type'][_0x6139('0x2c')]};});_0x233191[_0x6139('0x2d')]=_[_0x6139('0x29')](_0x19dd77,_0x6139('0x26'));_0x233191[_0x6139('0x2e')]=_[_0x6139('0x2f')](_0x1d3af6[_0x6139('0x2e')]);_0x233191['filters']=_[_0x6139('0x30')](_0x233191[_0x6139('0x2d')],_0x233191[_0x6139('0x2e')]);_0x4bc5eb['attributes']=_[_0x6139('0x30')](_0x233191['model'],qs[_0x6139('0x31')](_0x1d3af6[_0x6139('0x2e')][_0x6139('0x31')]));_0x4bc5eb[_0x6139('0x32')]=_0x4bc5eb[_0x6139('0x32')]['length']?_0x4bc5eb[_0x6139('0x32')]:_0x233191['model'];if(!_0x1d3af6['query'][_0x6139('0x33')](_0x6139('0x34'))){_0x4bc5eb[_0x6139('0x1c')]=qs[_0x6139('0x1c')](_0x1d3af6[_0x6139('0x2e')][_0x6139('0x1c')]);_0x4bc5eb[_0x6139('0x1b')]=qs[_0x6139('0x1b')](_0x1d3af6[_0x6139('0x2e')][_0x6139('0x1b')]);}_0x4bc5eb[_0x6139('0x35')]=qs['sort'](_0x1d3af6[_0x6139('0x2e')]['sort']);_0x4bc5eb[_0x6139('0x36')]=qs['filters'](_['pick'](_0x1d3af6[_0x6139('0x2e')],_0x233191[_0x6139('0x37')]),_0x19dd77);if(_0x1d3af6[_0x6139('0x2e')][_0x6139('0x38')]){_0x4bc5eb[_0x6139('0x36')]=_[_0x6139('0x39')](_0x4bc5eb[_0x6139('0x36')],{'$or':_[_0x6139('0x29')](_0x19dd77,function(_0x38efb9){if(_0x38efb9[_0x6139('0x3a')]!=='VIRTUAL'){var _0x269235={};_0x269235[_0x38efb9[_0x6139('0x26')]]={'$like':'%'+_0x1d3af6[_0x6139('0x2e')]['filter']+'%'};return _0x269235;}})});}_0x4bc5eb=_['merge']({},_0x4bc5eb,_0x1d3af6[_0x6139('0x3b')]);var _0x33ba2a={'where':_0x4bc5eb[_0x6139('0x36')]};return db[_0x6139('0x3c')]['count'](_0x33ba2a)['then'](function(_0x4087d8){_0x521818['count']=_0x4087d8;if(_0x1d3af6[_0x6139('0x2e')]['includeAll']){_0x4bc5eb[_0x6139('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x6139('0x3e')](_0x4bc5eb);})[_0x6139('0x22')](function(_0x30e249){_0x521818[_0x6139('0x3f')]=_0x30e249;return _0x521818;})[_0x6139('0x22')](respondWithFilteredResult(_0x4d19ca,_0x4bc5eb))[_0x6139('0x40')](handleError(_0x4d19ca,null));};exports[_0x6139('0x41')]=function(_0x5e775f,_0x51c5ad){var _0x338968={'raw':!![],'where':{'id':_0x5e775f[_0x6139('0x42')]['id']}},_0x4fe658={};_0x4fe658[_0x6139('0x2d')]=_[_0x6139('0x2f')](db[_0x6139('0x3c')]['rawAttributes']);_0x4fe658['query']=_[_0x6139('0x2f')](_0x5e775f[_0x6139('0x2e')]);_0x4fe658[_0x6139('0x37')]=_[_0x6139('0x30')](_0x4fe658[_0x6139('0x2d')],_0x4fe658[_0x6139('0x2e')]);_0x338968[_0x6139('0x32')]=_[_0x6139('0x30')](_0x4fe658[_0x6139('0x2d')],qs['fields'](_0x5e775f[_0x6139('0x2e')][_0x6139('0x31')]));_0x338968['attributes']=_0x338968[_0x6139('0x32')][_0x6139('0x43')]?_0x338968[_0x6139('0x32')]:_0x4fe658[_0x6139('0x2d')];if(_0x5e775f['query'][_0x6139('0x44')]){_0x338968[_0x6139('0x3d')]=[{'all':!![]}];}_0x338968=_[_0x6139('0x39')]({},_0x338968,_0x5e775f[_0x6139('0x3b')]);return db[_0x6139('0x3c')][_0x6139('0x45')](_0x338968)[_0x6139('0x22')](handleEntityNotFound(_0x51c5ad,null))[_0x6139('0x22')](respondWithResult(_0x51c5ad,null))['catch'](handleError(_0x51c5ad,null));};exports[_0x6139('0x21')]=function(_0x6ed596,_0x10f9a4){if(_0x6ed596[_0x6139('0x46')]['id']){delete _0x6ed596[_0x6139('0x46')]['id'];}return db[_0x6139('0x3c')]['find']({'where':{'id':_0x6ed596['params']['id']}})[_0x6139('0x22')](handleEntityNotFound(_0x10f9a4,null))[_0x6139('0x22')](saveUpdates(_0x6ed596[_0x6139('0x46')],null))[_0x6139('0x22')](respondWithResult(_0x10f9a4,null))[_0x6139('0x40')](handleError(_0x10f9a4,null));};exports[_0x6139('0x23')]=function(_0x375969,_0x176fea){return db[_0x6139('0x3c')][_0x6139('0x45')]({'where':{'id':_0x375969['params']['id']}})['then'](handleEntityNotFound(_0x176fea,null))['then'](removeEntity(_0x176fea,null))[_0x6139('0x40')](handleError(_0x176fea,null));};exports[_0x6139('0x47')]=function(_0x28fba3,_0x4b68ad){return db[_0x6139('0x3c')]['describe']()[_0x6139('0x22')](respondWithResult(_0x4b68ad,null))[_0x6139('0x40')](handleError(_0x4b68ad,null));};
\ No newline at end of file
index 7baf58f..3879c14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c37=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4f3081,_0x642cd){var _0x430b5c=function(_0x31361f){while(--_0x31361f){_0x4f3081['push'](_0x4f3081['shift']());}};_0x430b5c(++_0x642cd);}(_0x5c37,0x1d3));var _0x75c3=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0x5c37[_0x19efbc];return _0x205c5e;};'use strict';var _=require(_0x75c3('0x0'));var util=require('util');var logger=require(_0x75c3('0x1'))('api');var moment=require(_0x75c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x75c3('0x3'));var fs=require('fs');var path=require(_0x75c3('0x4'));var rimraf=require(_0x75c3('0x5'));var config=require(_0x75c3('0x6'));var attributes=require(_0x75c3('0x7'));module[_0x75c3('0x8')]=function(_0xdc5c85,_0x570666){return _0xdc5c85[_0x75c3('0x9')](_0x75c3('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43ef=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','util','../../config/logger'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x43ef,0x15a));var _0xf43e=function(_0x1237b6,_0x2f1e85){_0x1237b6=_0x1237b6-0x0;var _0x22add9=_0x43ef[_0x1237b6];return _0x22add9;};'use strict';var _=require('lodash');var util=require(_0xf43e('0x0'));var logger=require(_0xf43e('0x1'))(_0xf43e('0x2'));var moment=require(_0xf43e('0x3'));var BPromise=require(_0xf43e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf43e('0x5'));var rimraf=require(_0xf43e('0x6'));var config=require(_0xf43e('0x7'));var attributes=require(_0xf43e('0x8'));module[_0xf43e('0x9')]=function(_0x4cac56,_0x48c1b3){return _0x4cac56[_0xf43e('0xa')]('CmHopperBlack',attributes,{'tableName':_0xf43e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2c597e9..04c594f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf329=['body','raw','UpdateCmHopperBlack','catch','DestroyCmHopperBlack','destroy','where','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CmHopperBlack','findAll','options','attributes','limit','include','map','model','then','GetCmHopperBlack','update'];(function(_0x2b0275,_0x3fe1fe){var _0x43708e=function(_0x4f410c){while(--_0x4f410c){_0x2b0275['push'](_0x2b0275['shift']());}};_0x43708e(++_0x3fe1fe);}(_0xf329,0x76));var _0x9f32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf329[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9f32('0x0'));var moment=require('moment');var BPromise=require(_0x9f32('0x1'));var rs=require(_0x9f32('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9f32('0x3'));var logger=require(_0x9f32('0x4'))(_0x9f32('0x5'));var config=require(_0x9f32('0x6'));var jayson=require(_0x9f32('0x7'));var client=jayson[_0x9f32('0x8')][_0x9f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x588bf0,_0x5e2017,_0x527c83){return new BPromise(function(_0x2004a1,_0x21ab15){return client['request'](_0x588bf0,_0x527c83)['then'](function(_0x246624){logger[_0x9f32('0xa')](_0x9f32('0xb'),_0x5e2017,_0x9f32('0xc'));logger[_0x9f32('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x5e2017,_0x9f32('0xc'),JSON[_0x9f32('0xe')](_0x246624));if(_0x246624[_0x9f32('0xf')]){if(_0x246624[_0x9f32('0xf')][_0x9f32('0x10')]===0x1f4){logger[_0x9f32('0xf')](_0x9f32('0xb'),_0x5e2017,_0x246624[_0x9f32('0xf')]['message']);return _0x21ab15(_0x246624['error'][_0x9f32('0x11')]);}logger[_0x9f32('0xf')](_0x9f32('0xb'),_0x5e2017,_0x246624[_0x9f32('0xf')][_0x9f32('0x11')]);return _0x2004a1(_0x246624[_0x9f32('0xf')][_0x9f32('0x11')]);}else{logger['info'](_0x9f32('0xb'),_0x5e2017,'request\x20sent');_0x2004a1(_0x246624[_0x9f32('0x12')][_0x9f32('0x11')]);}})['catch'](function(_0x229714){logger[_0x9f32('0xf')](_0x9f32('0xb'),_0x5e2017,_0x229714);_0x21ab15(_0x229714);});});}exports['GetCmHopperBlack']=function(_0x29fd4e){var _0x26ee54=this;return new Promise(function(_0x38736b,_0xd9c3ef){return db[_0x9f32('0x13')][_0x9f32('0x14')]({'raw':_0x29fd4e[_0x9f32('0x15')]?_0x29fd4e[_0x9f32('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x29fd4e[_0x9f32('0x15')]?_0x29fd4e[_0x9f32('0x15')]['where']||null:null,'attributes':_0x29fd4e[_0x9f32('0x15')]?_0x29fd4e[_0x9f32('0x15')][_0x9f32('0x16')]||null:null,'limit':_0x29fd4e[_0x9f32('0x15')]?_0x29fd4e[_0x9f32('0x15')][_0x9f32('0x17')]||null:null,'include':_0x29fd4e[_0x9f32('0x15')]?_0x29fd4e[_0x9f32('0x15')][_0x9f32('0x18')]?_[_0x9f32('0x19')](_0x29fd4e[_0x9f32('0x15')]['include'],function(_0xfdbe7f){return{'model':db[_0xfdbe7f[_0x9f32('0x1a')]],'as':_0xfdbe7f['as'],'attributes':_0xfdbe7f[_0x9f32('0x16')],'include':_0xfdbe7f[_0x9f32('0x18')]?_[_0x9f32('0x19')](_0xfdbe7f[_0x9f32('0x18')],function(_0x21bf58){return{'model':db[_0x21bf58[_0x9f32('0x1a')]],'as':_0x21bf58['as'],'attributes':_0x21bf58[_0x9f32('0x16')],'include':_0x21bf58['include']?_[_0x9f32('0x19')](_0x21bf58['include'],function(_0x1411ff){return{'model':db[_0x1411ff[_0x9f32('0x1a')]],'as':_0x1411ff['as'],'attributes':_0x1411ff[_0x9f32('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9f32('0x1b')](function(_0x18cb56){logger[_0x9f32('0xa')](_0x9f32('0x1c'),_0x29fd4e);logger[_0x9f32('0xd')](_0x9f32('0x1c'),_0x29fd4e,JSON['stringify'](_0x18cb56));_0x38736b(_0x18cb56);})['catch'](function(_0x5d4118){logger[_0x9f32('0xf')](_0x9f32('0x1c'),_0x5d4118[_0x9f32('0x11')],_0x29fd4e);_0xd9c3ef(_0x26ee54[_0x9f32('0xf')](0x1f4,_0x5d4118[_0x9f32('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x44ecbe){var _0xc84441=this;return new Promise(function(_0xfae331,_0x4eaddd){return db['CmHopperBlack'][_0x9f32('0x1d')](_0x44ecbe[_0x9f32('0x1e')],{'raw':_0x44ecbe[_0x9f32('0x15')]?_0x44ecbe[_0x9f32('0x15')][_0x9f32('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44ecbe[_0x9f32('0x15')]?_0x44ecbe[_0x9f32('0x15')]['where']||null:null,'attributes':_0x44ecbe[_0x9f32('0x15')]?_0x44ecbe[_0x9f32('0x15')][_0x9f32('0x16')]||null:null,'limit':_0x44ecbe[_0x9f32('0x15')]?_0x44ecbe[_0x9f32('0x15')][_0x9f32('0x17')]||null:null})[_0x9f32('0x1b')](function(_0x59eb49){logger['info'](_0x9f32('0x20'),_0x44ecbe);logger[_0x9f32('0xd')]('UpdateCmHopperBlack',_0x44ecbe,JSON[_0x9f32('0xe')](_0x59eb49));_0xfae331(_0x59eb49);})[_0x9f32('0x21')](function(_0x44ca41){logger[_0x9f32('0xf')](_0x9f32('0x20'),_0x44ca41['message'],_0x44ecbe);_0x4eaddd(_0xc84441[_0x9f32('0xf')](0x1f4,_0x44ca41[_0x9f32('0x11')]));});});};exports[_0x9f32('0x22')]=function(_0x22fdfc){var _0x36647c=this;return new Promise(function(_0x14496f,_0x3e0333){return db[_0x9f32('0x13')][_0x9f32('0x23')]({'where':_0x22fdfc[_0x9f32('0x15')]?_0x22fdfc[_0x9f32('0x15')][_0x9f32('0x24')]||null:null})[_0x9f32('0x1b')](function(_0x3b3bbc){logger[_0x9f32('0xa')](_0x9f32('0x22'),_0x22fdfc);logger[_0x9f32('0xd')]('DestroyCmHopperBlack',_0x22fdfc,JSON[_0x9f32('0xe')](_0x3b3bbc));_0x14496f(_0x3b3bbc);})[_0x9f32('0x21')](function(_0x44acc3){logger[_0x9f32('0xf')](_0x9f32('0x22'),_0x44acc3[_0x9f32('0x11')],_0x22fdfc);_0x3e0333(_0x36647c[_0x9f32('0xf')](0x1f4,_0x44acc3[_0x9f32('0x11')]));});});};
\ No newline at end of file
+var _0x5e61=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','then','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1ae987,_0x58c825){var _0x3cbceb=function(_0x5a041b){while(--_0x5a041b){_0x1ae987['push'](_0x1ae987['shift']());}};_0x3cbceb(++_0x58c825);}(_0x5e61,0xc9));var _0x15e6=function(_0x2d3f34,_0x1aec14){_0x2d3f34=_0x2d3f34-0x0;var _0x49ca6d=_0x5e61[_0x2d3f34];return _0x49ca6d;};'use strict';var _=require(_0x15e6('0x0'));var util=require(_0x15e6('0x1'));var moment=require(_0x15e6('0x2'));var BPromise=require(_0x15e6('0x3'));var rs=require(_0x15e6('0x4'));var fs=require('fs');var Redis=require(_0x15e6('0x5'));var db=require(_0x15e6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x15e6('0x7'))(_0x15e6('0x8'));var config=require(_0x15e6('0x9'));var jayson=require(_0x15e6('0xa'));var client=jayson[_0x15e6('0xb')][_0x15e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c1999,_0xf8efc3,_0x156134){return new BPromise(function(_0x42029a,_0x3502d3){return client[_0x15e6('0xd')](_0x3c1999,_0x156134)['then'](function(_0x5d3693){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0xf8efc3,_0x15e6('0xe'));logger[_0x15e6('0xf')](_0x15e6('0x10'),_0xf8efc3,_0x15e6('0xe'),JSON[_0x15e6('0x11')](_0x5d3693));if(_0x5d3693[_0x15e6('0x12')]){if(_0x5d3693[_0x15e6('0x12')][_0x15e6('0x13')]===0x1f4){logger[_0x15e6('0x12')](_0x15e6('0x14'),_0xf8efc3,_0x5d3693['error'][_0x15e6('0x15')]);return _0x3502d3(_0x5d3693[_0x15e6('0x12')][_0x15e6('0x15')]);}logger[_0x15e6('0x12')](_0x15e6('0x14'),_0xf8efc3,_0x5d3693['error'][_0x15e6('0x15')]);return _0x42029a(_0x5d3693[_0x15e6('0x12')][_0x15e6('0x15')]);}else{logger[_0x15e6('0x16')](_0x15e6('0x14'),_0xf8efc3,_0x15e6('0xe'));_0x42029a(_0x5d3693[_0x15e6('0x17')][_0x15e6('0x15')]);}})[_0x15e6('0x18')](function(_0x374beb){logger['error'](_0x15e6('0x14'),_0xf8efc3,_0x374beb);_0x3502d3(_0x374beb);});});}exports[_0x15e6('0x19')]=function(_0x268ac1){var _0x3afb89=this;return new Promise(function(_0x4b65dc,_0x437fbe){return db[_0x15e6('0x1a')][_0x15e6('0x1b')]({'raw':_0x268ac1['options']?_0x268ac1[_0x15e6('0x1c')][_0x15e6('0x1d')]===undefined?!![]:![]:!![],'where':_0x268ac1['options']?_0x268ac1[_0x15e6('0x1c')][_0x15e6('0x1e')]||null:null,'attributes':_0x268ac1[_0x15e6('0x1c')]?_0x268ac1[_0x15e6('0x1c')][_0x15e6('0x1f')]||null:null,'limit':_0x268ac1[_0x15e6('0x1c')]?_0x268ac1[_0x15e6('0x1c')][_0x15e6('0x20')]||null:null,'include':_0x268ac1[_0x15e6('0x1c')]?_0x268ac1[_0x15e6('0x1c')]['include']?_['map'](_0x268ac1[_0x15e6('0x1c')][_0x15e6('0x21')],function(_0x457433){return{'model':db[_0x457433[_0x15e6('0x22')]],'as':_0x457433['as'],'attributes':_0x457433[_0x15e6('0x1f')],'include':_0x457433[_0x15e6('0x21')]?_[_0x15e6('0x23')](_0x457433[_0x15e6('0x21')],function(_0x31c9c7){return{'model':db[_0x31c9c7[_0x15e6('0x22')]],'as':_0x31c9c7['as'],'attributes':_0x31c9c7[_0x15e6('0x1f')],'include':_0x31c9c7[_0x15e6('0x21')]?_[_0x15e6('0x23')](_0x31c9c7[_0x15e6('0x21')],function(_0x485b0f){return{'model':db[_0x485b0f[_0x15e6('0x22')]],'as':_0x485b0f['as'],'attributes':_0x485b0f[_0x15e6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x15e6('0x24')](function(_0x10cd60){logger[_0x15e6('0x16')](_0x15e6('0x19'),_0x268ac1);logger['debug'](_0x15e6('0x19'),_0x268ac1,JSON[_0x15e6('0x11')](_0x10cd60));_0x4b65dc(_0x10cd60);})[_0x15e6('0x18')](function(_0x19ed25){logger[_0x15e6('0x12')](_0x15e6('0x19'),_0x19ed25['message'],_0x268ac1);_0x437fbe(_0x3afb89[_0x15e6('0x12')](0x1f4,_0x19ed25['message']));});});};exports[_0x15e6('0x25')]=function(_0x290b70){var _0x32e1e3=this;return new Promise(function(_0x3c0ac4,_0x4f5bf0){return db[_0x15e6('0x1a')][_0x15e6('0x26')](_0x290b70[_0x15e6('0x27')],{'raw':_0x290b70[_0x15e6('0x1c')]?_0x290b70[_0x15e6('0x1c')][_0x15e6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x290b70[_0x15e6('0x1c')]?_0x290b70[_0x15e6('0x1c')][_0x15e6('0x1e')]||null:null,'attributes':_0x290b70[_0x15e6('0x1c')]?_0x290b70['options'][_0x15e6('0x1f')]||null:null,'limit':_0x290b70['options']?_0x290b70[_0x15e6('0x1c')][_0x15e6('0x20')]||null:null})[_0x15e6('0x24')](function(_0x51b5de){logger[_0x15e6('0x16')](_0x15e6('0x25'),_0x290b70);logger['debug']('UpdateCmHopperBlack',_0x290b70,JSON['stringify'](_0x51b5de));_0x3c0ac4(_0x51b5de);})['catch'](function(_0x4c8c40){logger['error'](_0x15e6('0x25'),_0x4c8c40['message'],_0x290b70);_0x4f5bf0(_0x32e1e3[_0x15e6('0x12')](0x1f4,_0x4c8c40['message']));});});};exports[_0x15e6('0x28')]=function(_0x815cdb){var _0x123fd1=this;return new Promise(function(_0xe1a02c,_0xde3680){return db[_0x15e6('0x1a')][_0x15e6('0x29')]({'where':_0x815cdb[_0x15e6('0x1c')]?_0x815cdb[_0x15e6('0x1c')][_0x15e6('0x1e')]||null:null})[_0x15e6('0x24')](function(_0x1a8811){logger['info'](_0x15e6('0x28'),_0x815cdb);logger[_0x15e6('0xf')]('DestroyCmHopperBlack',_0x815cdb,JSON['stringify'](_0x1a8811));_0xe1a02c(_0x1a8811);})[_0x15e6('0x18')](function(_0x23e208){logger[_0x15e6('0x12')](_0x15e6('0x28'),_0x23e208[_0x15e6('0x15')],_0x815cdb);_0xde3680(_0x123fd1['error'](0x1f4,_0x23e208[_0x15e6('0x15')]));});});};
\ No newline at end of file
index e254c7f..39aadad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['describe','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0xd5d5f4,_0x310a9e){var _0x5a7089=function(_0x4de7f4){while(--_0x4de7f4){_0xd5d5f4['push'](_0xd5d5f4['shift']());}};_0x5a7089(++_0x310a9e);}(_0x7c09,0x102));var _0x97c0=function(_0x39dd7a,_0x1b5e18){_0x39dd7a=_0x39dd7a-0x0;var _0x11a7b7=_0x7c09[_0x39dd7a];return _0x11a7b7;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0x9')]('/:id',auth[_0x97c0('0xb')](),controller['show']);router[_0x97c0('0xd')](_0x97c0('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x97c0('0xf')](_0x97c0('0xe'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x10')]);module[_0x97c0('0x11')]=router;
\ No newline at end of file
+var _0x187d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x559833,_0x403f8d){var _0x328bb5=function(_0x34dd3e){while(--_0x34dd3e){_0x559833['push'](_0x559833['shift']());}};_0x328bb5(++_0x403f8d);}(_0x187d,0x93));var _0xd187=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x187d[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')]('/:id',auth[_0xd187('0x9')](),controller[_0xd187('0x13')]);module[_0xd187('0x14')]=router;
\ No newline at end of file
index c49fcf8..cd963e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2632=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x2632,0x1d5));var _0x2263=function(_0x1f4142,_0x24eff0){_0x1f4142=_0x1f4142-0x0;var _0x1b8ae2=_0x2632[_0x1f4142];return _0x1b8ae2;};'use strict';var Sequelize=require(_0x2263('0x0'));var moment=require('moment');module[_0x2263('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2263('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2263('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2263('0x2')]},'calleridname':{'type':Sequelize[_0x2263('0x2')]},'starttime':{'type':Sequelize[_0x2263('0x4')]},'responsetime':{'type':Sequelize[_0x2263('0x4')]},'answertime':{'type':Sequelize[_0x2263('0x4')]},'droptime':{'type':Sequelize[_0x2263('0x4')]},'endtime':{'type':Sequelize[_0x2263('0x4')]},'ringtime':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x2263('0x2')]},'campaigntype':{'type':Sequelize[_0x2263('0x2')]},'membername':{'type':Sequelize[_0x2263('0x2')]},'reason':{'type':Sequelize[_0x2263('0x2')]},'disposition':{'type':Sequelize[_0x2263('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2263('0x2')]},'dispositionat':{'type':Sequelize[_0x2263('0x4')],'set':function(_0x7887e0){var _0x1bb557=this[_0x2263('0x5')](_0x2263('0x6'));if(_0x1bb557&&_0x7887e0){this[_0x2263('0x7')](_0x2263('0x8'),moment(_0x7887e0)[_0x2263('0x9')](moment(_0x1bb557),_0x2263('0xa')));}}},'amd':{'type':Sequelize[_0x2263('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2263('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2263('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2263('0x4')]},'callback':{'type':Sequelize[_0x2263('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x2263('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2263('0x4')]},'recallme':{'type':Sequelize[_0x2263('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2263('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0cda=['endtime','setDataValue','diff','seconds','BOOLEAN','moment','exports','DATE','INTEGER','STRING'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x0cda,0xff));var _0xa0cd=function(_0x12c26c,_0x128dc6){_0x12c26c=_0x12c26c-0x0;var _0x452ff7=_0x0cda[_0x12c26c];return _0x452ff7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa0cd('0x0'));module[_0xa0cd('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa0cd('0x2')]},'countbusyretry':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa0cd('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa0cd('0x4')]},'starttime':{'type':Sequelize[_0xa0cd('0x2')]},'responsetime':{'type':Sequelize[_0xa0cd('0x2')]},'answertime':{'type':Sequelize[_0xa0cd('0x2')]},'droptime':{'type':Sequelize[_0xa0cd('0x2')]},'endtime':{'type':Sequelize[_0xa0cd('0x2')]},'ringtime':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa0cd('0x4')]},'campaign':{'type':Sequelize[_0xa0cd('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa0cd('0x4')]},'reason':{'type':Sequelize[_0xa0cd('0x4')]},'disposition':{'type':Sequelize[_0xa0cd('0x4')]},'secondDisposition':{'type':Sequelize[_0xa0cd('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa0cd('0x4')]},'dispositionat':{'type':Sequelize[_0xa0cd('0x2')],'set':function(_0x3df6f0){var _0x146a82=this['getDataValue'](_0xa0cd('0x5'));if(_0x146a82&&_0x3df6f0){this[_0xa0cd('0x6')]('followuptime',moment(_0x3df6f0)[_0xa0cd('0x7')](moment(_0x146a82),_0xa0cd('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa0cd('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa0cd('0x2')]},'callback':{'type':Sequelize[_0xa0cd('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa0cd('0x2')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa0cd('0x2')]},'recallme':{'type':Sequelize[_0xa0cd('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa0cd('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa0cd('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 455f9ff..a8b1077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x40c7fb,_0x4f525a){var _0x182c04=function(_0x481f08){while(--_0x481f08){_0x40c7fb['push'](_0x40c7fb['shift']());}};_0x182c04(++_0x4f525a);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));};
\ No newline at end of file
+var _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x14835a,_0x326676){var _0x5897a8=function(_0x589b08){while(--_0x589b08){_0x14835a['push'](_0x14835a['shift']());}};_0x5897a8(++_0x326676);}(_0x0295,0x1f0));var _0x5029=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x0295[_0x2136d5];return _0x3bee2e;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));};
\ No newline at end of file
index a0a3485..908cc06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc700=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','calleridnum','uniqueid','lodash','../../config/logger'];(function(_0x385b71,_0x2ae587){var _0x72ac1d=function(_0x5308f0){while(--_0x5308f0){_0x385b71['push'](_0x385b71['shift']());}};_0x72ac1d(++_0x2ae587);}(_0xc700,0xd6));var _0x0c70=function(_0x287706,_0x48d00d){_0x287706=_0x287706-0x0;var _0x51f51a=_0xc700[_0x287706];return _0x51f51a;};'use strict';var _=require(_0x0c70('0x0'));var util=require('util');var logger=require(_0x0c70('0x1'))(_0x0c70('0x2'));var moment=require(_0x0c70('0x3'));var BPromise=require(_0x0c70('0x4'));var rp=require(_0x0c70('0x5'));var fs=require('fs');var path=require(_0x0c70('0x6'));var rimraf=require('rimraf');var config=require(_0x0c70('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x0c70('0x8')]=function(_0x34a11c,_0x24c335){return _0x34a11c[_0x0c70('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x0c70('0xa'),'fields':[_0x0c70('0xa')]},{'name':_0x0c70('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb800=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0xd33fc6,_0x33e629){var _0x2699c8=function(_0x1ba13c){while(--_0x1ba13c){_0xd33fc6['push'](_0xd33fc6['shift']());}};_0x2699c8(++_0x33e629);}(_0xb800,0x17e));var _0x0b80=function(_0x1eb2f2,_0x1857ed){_0x1eb2f2=_0x1eb2f2-0x0;var _0x5b522d=_0xb800[_0x1eb2f2];return _0x5b522d;};'use strict';var _=require(_0x0b80('0x0'));var util=require(_0x0b80('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0b80('0x2'));var BPromise=require(_0x0b80('0x3'));var rp=require(_0x0b80('0x4'));var fs=require('fs');var path=require(_0x0b80('0x5'));var rimraf=require(_0x0b80('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x0b80('0x7')]=function(_0x11441e,_0x106a48){return _0x11441e[_0x0b80('0x8')](_0x0b80('0x9'),attributes,{'tableName':_0x0b80('0xa'),'paranoid':![],'indexes':[{'name':_0x0b80('0xb'),'fields':[_0x0b80('0xb')]},{'name':_0x0b80('0xc'),'fields':[_0x0b80('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 2a84143..0a83cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3931c1,_0x25f110){var _0x454f91=function(_0x12fc92){while(--_0x12fc92){_0x3931c1['push'](_0x3931c1['shift']());}};_0x454f91(++_0x25f110);}(_0xb10b,0x12a));var _0xbb10=function(_0x484e74,_0x4e62bd){_0x484e74=_0x484e74-0x0;var _0x2874fa=_0xb10b[_0x484e74];return _0x2874fa;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x164547,_0xae0eae){var _0x124b18=function(_0x544b94){while(--_0x544b94){_0x164547['push'](_0x164547['shift']());}};_0x124b18(++_0xae0eae);}(_0x7a54,0x106));var _0x47a5=function(_0x11d7e3,_0x4d94d3){_0x11d7e3=_0x11d7e3-0x0;var _0x1d4555=_0x7a54[_0x11d7e3];return _0x1d4555;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 4bafd94..481f9df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c27=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe'];(function(_0x212348,_0x55415c){var _0x1696e9=function(_0x2b87cb){while(--_0x2b87cb){_0x212348['push'](_0x212348['shift']());}};_0x1696e9(++_0x55415c);}(_0x4c27,0x11b));var _0x74c2=function(_0x78ac8e,_0x34f635){_0x78ac8e=_0x78ac8e-0x0;var _0x242d93=_0x4c27[_0x78ac8e];return _0x242d93;};'use strict';var multer=require(_0x74c2('0x0'));var util=require(_0x74c2('0x1'));var path=require(_0x74c2('0x2'));var timeout=require(_0x74c2('0x3'));var express=require(_0x74c2('0x4'));var router=express[_0x74c2('0x5')]();var fs_extra=require(_0x74c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x74c2('0x7'));var config=require(_0x74c2('0x8'));var controller=require(_0x74c2('0x9'));router['get']('/',auth[_0x74c2('0xa')](),controller[_0x74c2('0xb')]);router[_0x74c2('0xc')](_0x74c2('0xd'),auth[_0x74c2('0xa')](),controller['describe']);router[_0x74c2('0xc')](_0x74c2('0xe'),auth[_0x74c2('0xa')](),controller[_0x74c2('0xf')]);router[_0x74c2('0xc')](_0x74c2('0x10'),auth[_0x74c2('0xa')](),controller[_0x74c2('0x11')]);router[_0x74c2('0xc')](_0x74c2('0x12'),auth[_0x74c2('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x74c2('0x13')](_0x74c2('0x14'),auth[_0x74c2('0xa')](),controller[_0x74c2('0x15')]);router[_0x74c2('0x13')](_0x74c2('0x16'),auth[_0x74c2('0xa')](),controller[_0x74c2('0x17')]);router[_0x74c2('0x13')](_0x74c2('0x18'),auth[_0x74c2('0xa')](),controller[_0x74c2('0x19')]);router[_0x74c2('0x1a')](_0x74c2('0xe'),auth[_0x74c2('0xa')](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0x065f=['checkContactHopper','put','update','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','get','/campaign/countAttributes/:id','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper'];(function(_0x49dca3,_0x373137){var _0x160894=function(_0x331821){while(--_0x331821){_0x49dca3['push'](_0x49dca3['shift']());}};_0x160894(++_0x373137);}(_0x065f,0xac));var _0xf065=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x065f[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xf065('0x0'));var util=require('util');var path=require(_0xf065('0x1'));var timeout=require('connect-timeout');var express=require(_0xf065('0x2'));var router=express['Router']();var fs_extra=require(_0xf065('0x3'));var auth=require(_0xf065('0x4'));var interaction=require(_0xf065('0x5'));var config=require(_0xf065('0x6'));var controller=require(_0xf065('0x7'));router['get']('/',auth[_0xf065('0x8')](),controller['index']);router['get'](_0xf065('0x9'),auth[_0xf065('0x8')](),controller[_0xf065('0xa')]);router['get'](_0xf065('0xb'),auth[_0xf065('0x8')](),controller[_0xf065('0xc')]);router['get']('/voice/queue/countAttributes/:id',auth[_0xf065('0x8')](),controller[_0xf065('0xd')]);router[_0xf065('0xe')](_0xf065('0xf'),auth[_0xf065('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xf065('0x10')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xf065('0x11')]);router[_0xf065('0x10')](_0xf065('0x12'),auth[_0xf065('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xf065('0x10')](_0xf065('0x13'),auth[_0xf065('0x8')](),controller[_0xf065('0x14')]);router[_0xf065('0x15')](_0xf065('0xb'),auth[_0xf065('0x8')](),controller[_0xf065('0x16')]);module[_0xf065('0x17')]=router;
\ No newline at end of file
index bff959e..e218876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f96=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7f96,0xa0));var _0x67f9=function(_0x520fee,_0x5a313d){_0x520fee=_0x520fee-0x0;var _0x257173=_0x7f96[_0x520fee];return _0x257173;};'use strict';var Sequelize=require(_0x67f9('0x0'));module['exports']={'state':{'type':Sequelize[_0x67f9('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x67f9('0x2')]},'scheduledat':{'type':Sequelize[_0x67f9('0x3')]},'countbusyretry':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x67f9('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x67f9('0x2')]},'calleridname':{'type':Sequelize[_0x67f9('0x2')]},'starttime':{'type':Sequelize[_0x67f9('0x3')]},'responsetime':{'type':Sequelize[_0x67f9('0x3')]},'answertime':{'type':Sequelize[_0x67f9('0x3')]},'droptime':{'type':Sequelize[_0x67f9('0x3')]},'endtime':{'type':Sequelize[_0x67f9('0x3')]},'ringtime':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x67f9('0x2')]},'campaign':{'type':Sequelize[_0x67f9('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x67f9('0x2')]},'reason':{'type':Sequelize[_0x67f9('0x2')]},'amd':{'type':Sequelize[_0x67f9('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x67f9('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x67f9('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x67f9('0x3')]},'edited':{'type':Sequelize[_0x67f9('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x67f9('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x67f9('0x2')]}};
\ No newline at end of file
+var _0x4085=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x3d54e3,_0x44ffe7){var _0x5e97c3=function(_0x26dfc4){while(--_0x26dfc4){_0x3d54e3['push'](_0x3d54e3['shift']());}};_0x5e97c3(++_0x44ffe7);}(_0x4085,0x1b5));var _0x5408=function(_0x193440,_0x4ca023){_0x193440=_0x193440-0x0;var _0x4c80d1=_0x4085[_0x193440];return _0x4c80d1;};'use strict';var Sequelize=require(_0x5408('0x0'));module[_0x5408('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5408('0x2')]},'scheduledat':{'type':Sequelize[_0x5408('0x3')]},'countbusyretry':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5408('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5408('0x2')]},'calleridnum':{'type':Sequelize[_0x5408('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5408('0x3')]},'responsetime':{'type':Sequelize[_0x5408('0x3')]},'answertime':{'type':Sequelize[_0x5408('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5408('0x3')]},'ringtime':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5408('0x2')]},'campaign':{'type':Sequelize[_0x5408('0x2')]},'campaigntype':{'type':Sequelize[_0x5408('0x2')]},'membername':{'type':Sequelize[_0x5408('0x2')]},'reason':{'type':Sequelize[_0x5408('0x2')]},'amd':{'type':Sequelize[_0x5408('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5408('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5408('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5408('0x3')]},'recallme':{'type':Sequelize[_0x5408('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5408('0x3')]},'edited':{'type':Sequelize[_0x5408('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5408('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
index da567e7..aa93d0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf995=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','describe','catch','uniqueid','rimraf','fast-json-patch','bluebird'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xf995,0x1bf));var _0x5f99=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf995[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f99('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f99('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f99('0x2'));var Mustache=require(_0x5f99('0x3'));var util=require(_0x5f99('0x4'));var path=require(_0x5f99('0x5'));var sox=require('sox');var csv=require(_0x5f99('0x6'));var ejs=require(_0x5f99('0x7'));var fs=require('fs');var fs_extra=require(_0x5f99('0x8'));var _=require(_0x5f99('0x9'));var squel=require(_0x5f99('0xa'));var crypto=require(_0x5f99('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5f99('0xc'));var toCsv=require(_0x5f99('0x6'));var querystring=require(_0x5f99('0xd'));var Papa=require(_0x5f99('0xe'));var Redis=require(_0x5f99('0xf'));var authService=require(_0x5f99('0x10'));var qs=require(_0x5f99('0x11'));var as=require(_0x5f99('0x12'));var hardwareService=require(_0x5f99('0x13'));var logger=require(_0x5f99('0x14'))(_0x5f99('0x15'));var utils=require(_0x5f99('0x16'));var config=require(_0x5f99('0x17'));var licenseUtil=require(_0x5f99('0x18'));var db=require(_0x5f99('0x19'))['db'];function respondWithStatusCode(_0x3f7861,_0x31662c){_0x31662c=_0x31662c||0xcc;return function(_0x5baeb1){if(_0x5baeb1){return _0x3f7861['sendStatus'](_0x31662c);}return _0x3f7861['status'](_0x31662c)[_0x5f99('0x1a')]();};}function respondWithResult(_0x3e8314,_0x46df6d){_0x46df6d=_0x46df6d||0xc8;return function(_0x5a608b){if(_0x5a608b){return _0x3e8314[_0x5f99('0x1b')](_0x46df6d)[_0x5f99('0x1c')](_0x5a608b);}};}function respondWithFilteredResult(_0x5eb4df,_0x5c519d){return function(_0x40a456){if(_0x40a456){var _0x3577e3=typeof _0x5c519d[_0x5f99('0x1d')]===_0x5f99('0x1e')&&typeof _0x5c519d[_0x5f99('0x1f')]===_0x5f99('0x1e');var _0x13dd45=_0x40a456[_0x5f99('0x20')];var _0x53a30d=_0x3577e3?0x0:_0x5c519d[_0x5f99('0x1d')];var _0x453186=_0x3577e3?_0x40a456[_0x5f99('0x20')]:_0x5c519d[_0x5f99('0x1d')]+_0x5c519d[_0x5f99('0x1f')];var _0x2a5156;if(_0x453186>=_0x13dd45){_0x453186=_0x13dd45;_0x2a5156=0xc8;}else{_0x2a5156=0xce;}_0x5eb4df['status'](_0x2a5156);return _0x5eb4df[_0x5f99('0x21')]('Content-Range',_0x53a30d+'-'+_0x453186+'/'+_0x13dd45)['json'](_0x40a456);}return null;};}function patchUpdates(_0x4b78fa){return function(_0x4f80a8){try{jsonpatch['apply'](_0x4f80a8,_0x4b78fa,!![]);}catch(_0x58179a){return BPromise[_0x5f99('0x22')](_0x58179a);}return _0x4f80a8[_0x5f99('0x23')]();};}function saveUpdates(_0xb6a4b3,_0x406c09){return function(_0x2f3b05){if(_0x2f3b05){return _0x2f3b05[_0x5f99('0x24')](_0xb6a4b3)[_0x5f99('0x25')](function(_0x20d309){return _0x20d309;});}return null;};}function removeEntity(_0x9ea990,_0x850cb6){return function(_0x212b70){if(_0x212b70){return _0x212b70[_0x5f99('0x26')]()['then'](function(){_0x9ea990[_0x5f99('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x571f59,_0xd1482b){return function(_0x14b61f){if(!_0x14b61f){_0x571f59['sendStatus'](0x194);}return _0x14b61f;};}function handleError(_0x50bc60,_0x5cacaf){_0x5cacaf=_0x5cacaf||0x1f4;return function(_0x3b2456){logger[_0x5f99('0x27')](_0x3b2456['stack']);if(_0x3b2456['name']){delete _0x3b2456[_0x5f99('0x28')];}_0x50bc60[_0x5f99('0x1b')](_0x5cacaf)['send'](_0x3b2456);};}exports['index']=function(_0x4ab4ff,_0x70fb92){var _0x53fd4a={},_0x264ddc={},_0x2a7a4d={'count':0x0,'rows':[]};var _0x403042=_[_0x5f99('0x29')](db[_0x5f99('0x2a')][_0x5f99('0x2b')],function(_0x5f187b){return{'name':_0x5f187b[_0x5f99('0x2c')],'type':_0x5f187b[_0x5f99('0x2d')][_0x5f99('0x2e')]};});_0x264ddc[_0x5f99('0x2f')]=_[_0x5f99('0x29')](_0x403042,_0x5f99('0x28'));_0x264ddc[_0x5f99('0x30')]=_[_0x5f99('0x31')](_0x4ab4ff[_0x5f99('0x30')]);_0x264ddc[_0x5f99('0x32')]=_[_0x5f99('0x33')](_0x264ddc['model'],_0x264ddc[_0x5f99('0x30')]);_0x53fd4a['attributes']=_[_0x5f99('0x33')](_0x264ddc[_0x5f99('0x2f')],qs[_0x5f99('0x34')](_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x34')]));_0x53fd4a[_0x5f99('0x35')]=_0x53fd4a[_0x5f99('0x35')]['length']?_0x53fd4a['attributes']:_0x264ddc[_0x5f99('0x2f')];if(!_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x36')](_0x5f99('0x37'))){_0x53fd4a[_0x5f99('0x1f')]=qs[_0x5f99('0x1f')](_0x4ab4ff['query']['limit']);_0x53fd4a[_0x5f99('0x1d')]=qs[_0x5f99('0x1d')](_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x1d')]);}_0x53fd4a[_0x5f99('0x38')]=qs[_0x5f99('0x39')](_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x39')]);_0x53fd4a[_0x5f99('0x3a')]=qs[_0x5f99('0x32')](_[_0x5f99('0x3b')](_0x4ab4ff['query'],_0x264ddc[_0x5f99('0x32')]),_0x403042);if(_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x3c')]){_0x53fd4a['where']=_[_0x5f99('0x3d')](_0x53fd4a[_0x5f99('0x3a')],{'$or':_[_0x5f99('0x29')](_0x403042,function(_0x5b6c31){if(_0x5b6c31[_0x5f99('0x2d')]!==_0x5f99('0x3e')){var _0x326e5b={};_0x326e5b[_0x5b6c31[_0x5f99('0x28')]]={'$like':'%'+_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x3c')]+'%'};return _0x326e5b;}})});}_0x53fd4a=_[_0x5f99('0x3d')]({},_0x53fd4a,_0x4ab4ff[_0x5f99('0x3f')]);var _0x40d7e2={'where':_0x53fd4a[_0x5f99('0x3a')]};return db['CmHopperHistory'][_0x5f99('0x20')](_0x40d7e2)[_0x5f99('0x25')](function(_0xa2d48){_0x2a7a4d[_0x5f99('0x20')]=_0xa2d48;if(_0x4ab4ff[_0x5f99('0x30')][_0x5f99('0x40')]){_0x53fd4a[_0x5f99('0x41')]=[{'all':!![]}];}return db[_0x5f99('0x2a')][_0x5f99('0x42')](_0x53fd4a);})[_0x5f99('0x25')](function(_0x207dcc){_0x2a7a4d['rows']=_0x207dcc;return _0x2a7a4d;})[_0x5f99('0x25')](respondWithFilteredResult(_0x70fb92,_0x53fd4a))['catch'](handleError(_0x70fb92,null));};exports[_0x5f99('0x43')]=function(_0x18e170,_0x35fa27){var _0x2f7dcb={'raw':!![],'where':{'id':_0x18e170[_0x5f99('0x44')]['id']}},_0x5b8dd0={};_0x5b8dd0['model']=_[_0x5f99('0x31')](db[_0x5f99('0x2a')][_0x5f99('0x2b')]);_0x5b8dd0['query']=_[_0x5f99('0x31')](_0x18e170[_0x5f99('0x30')]);_0x5b8dd0[_0x5f99('0x32')]=_[_0x5f99('0x33')](_0x5b8dd0[_0x5f99('0x2f')],_0x5b8dd0['query']);_0x2f7dcb[_0x5f99('0x35')]=_[_0x5f99('0x33')](_0x5b8dd0[_0x5f99('0x2f')],qs[_0x5f99('0x34')](_0x18e170['query']['fields']));_0x2f7dcb[_0x5f99('0x35')]=_0x2f7dcb[_0x5f99('0x35')]['length']?_0x2f7dcb[_0x5f99('0x35')]:_0x5b8dd0[_0x5f99('0x2f')];if(_0x18e170[_0x5f99('0x30')]['includeAll']){_0x2f7dcb[_0x5f99('0x41')]=[{'all':!![]}];}_0x2f7dcb=_['merge']({},_0x2f7dcb,_0x18e170['options']);return db[_0x5f99('0x2a')][_0x5f99('0x45')](_0x2f7dcb)[_0x5f99('0x25')](handleEntityNotFound(_0x35fa27,null))[_0x5f99('0x25')](respondWithResult(_0x35fa27,null))['catch'](handleError(_0x35fa27,null));};exports[_0x5f99('0x46')]=function(_0xcc4749,_0x4f3cd1){return db[_0x5f99('0x2a')]['create'](_0xcc4749[_0x5f99('0x47')],{})[_0x5f99('0x25')](respondWithResult(_0x4f3cd1,0xc9))['catch'](handleError(_0x4f3cd1,null));};exports[_0x5f99('0x48')]=function(_0x484423,_0x2d7f11){return db[_0x5f99('0x2a')][_0x5f99('0x48')]()[_0x5f99('0x25')](respondWithResult(_0x2d7f11,null))[_0x5f99('0x49')](handleError(_0x2d7f11,null));};exports[_0x5f99('0x24')]=function(_0x127a5f,_0x4ac9dd){if(_0x127a5f[_0x5f99('0x47')][_0x5f99('0x4a')]){delete _0x127a5f['body'][_0x5f99('0x4a')];}return db[_0x5f99('0x2a')][_0x5f99('0x45')]({'where':{'uniqueid':_0x127a5f['params']['id']}})[_0x5f99('0x25')](handleEntityNotFound(_0x4ac9dd,null))[_0x5f99('0x25')](saveUpdates(_0x127a5f[_0x5f99('0x47')],null))['then'](respondWithResult(_0x4ac9dd,null))[_0x5f99('0x49')](handleError(_0x4ac9dd,null));};
\ No newline at end of file
+var _0xbbbe=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','length','find','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','name','send','map','CmHopperHistory','rawAttributes','type','key','keys','filters','intersection','query','attributes','model','fields'];(function(_0x447631,_0x5c4ef2){var _0x43d68e=function(_0xaa53a3){while(--_0xaa53a3){_0x447631['push'](_0x447631['shift']());}};_0x43d68e(++_0x5c4ef2);}(_0xbbbe,0x138));var _0xebbb=function(_0x4af9ff,_0x1da8d3){_0x4af9ff=_0x4af9ff-0x0;var _0x509d5d=_0xbbbe[_0x4af9ff];return _0x509d5d;};'use strict';var emlformat=require(_0xebbb('0x0'));var rimraf=require(_0xebbb('0x1'));var zipdir=require(_0xebbb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebbb('0x3'));var moment=require('moment');var BPromise=require(_0xebbb('0x4'));var Mustache=require(_0xebbb('0x5'));var util=require(_0xebbb('0x6'));var path=require(_0xebbb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xebbb('0x8'));var fs=require('fs');var fs_extra=require(_0xebbb('0x9'));var _=require(_0xebbb('0xa'));var squel=require(_0xebbb('0xb'));var crypto=require(_0xebbb('0xc'));var jsforce=require(_0xebbb('0xd'));var deskjs=require(_0xebbb('0xe'));var toCsv=require(_0xebbb('0xf'));var querystring=require(_0xebbb('0x10'));var Papa=require(_0xebbb('0x11'));var Redis=require('ioredis');var authService=require(_0xebbb('0x12'));var qs=require(_0xebbb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebbb('0x14'));var logger=require('../../config/logger')(_0xebbb('0x15'));var utils=require(_0xebbb('0x16'));var config=require(_0xebbb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebbb('0x18'))['db'];function respondWithStatusCode(_0x4bed16,_0x199d0a){_0x199d0a=_0x199d0a||0xcc;return function(_0x1d9fb0){if(_0x1d9fb0){return _0x4bed16[_0xebbb('0x19')](_0x199d0a);}return _0x4bed16[_0xebbb('0x1a')](_0x199d0a)[_0xebbb('0x1b')]();};}function respondWithResult(_0x12bee4,_0x3128d7){_0x3128d7=_0x3128d7||0xc8;return function(_0x402c58){if(_0x402c58){return _0x12bee4[_0xebbb('0x1a')](_0x3128d7)[_0xebbb('0x1c')](_0x402c58);}};}function respondWithFilteredResult(_0x19477f,_0x5187ce){return function(_0x55eb36){if(_0x55eb36){var _0xc64b04=typeof _0x5187ce[_0xebbb('0x1d')]===_0xebbb('0x1e')&&typeof _0x5187ce[_0xebbb('0x1f')]===_0xebbb('0x1e');var _0xc2bd3f=_0x55eb36[_0xebbb('0x20')];var _0x10c29e=_0xc64b04?0x0:_0x5187ce[_0xebbb('0x1d')];var _0x20f8f8=_0xc64b04?_0x55eb36['count']:_0x5187ce['offset']+_0x5187ce[_0xebbb('0x1f')];var _0x3442ac;if(_0x20f8f8>=_0xc2bd3f){_0x20f8f8=_0xc2bd3f;_0x3442ac=0xc8;}else{_0x3442ac=0xce;}_0x19477f['status'](_0x3442ac);return _0x19477f[_0xebbb('0x21')]('Content-Range',_0x10c29e+'-'+_0x20f8f8+'/'+_0xc2bd3f)[_0xebbb('0x1c')](_0x55eb36);}return null;};}function patchUpdates(_0x7e08c4){return function(_0x449c7f){try{jsonpatch[_0xebbb('0x22')](_0x449c7f,_0x7e08c4,!![]);}catch(_0x20213d){return BPromise['reject'](_0x20213d);}return _0x449c7f['save']();};}function saveUpdates(_0x18ef80,_0x520dd3){return function(_0x459d38){if(_0x459d38){return _0x459d38[_0xebbb('0x23')](_0x18ef80)[_0xebbb('0x24')](function(_0x317ddd){return _0x317ddd;});}return null;};}function removeEntity(_0x19ad0c,_0x2a24b2){return function(_0x3a14f8){if(_0x3a14f8){return _0x3a14f8[_0xebbb('0x25')]()[_0xebbb('0x24')](function(){_0x19ad0c[_0xebbb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x562124,_0x3cde2c){return function(_0x20d57e){if(!_0x20d57e){_0x562124['sendStatus'](0x194);}return _0x20d57e;};}function handleError(_0x4a2d14,_0x2edeff){_0x2edeff=_0x2edeff||0x1f4;return function(_0x4fa864){logger[_0xebbb('0x26')](_0x4fa864['stack']);if(_0x4fa864['name']){delete _0x4fa864[_0xebbb('0x27')];}_0x4a2d14[_0xebbb('0x1a')](_0x2edeff)[_0xebbb('0x28')](_0x4fa864);};}exports['index']=function(_0x1ac655,_0xb0aa6){var _0x1ae8a4={},_0x351888={},_0x1c817c={'count':0x0,'rows':[]};var _0x3336a9=_[_0xebbb('0x29')](db[_0xebbb('0x2a')][_0xebbb('0x2b')],function(_0x572b72){return{'name':_0x572b72['fieldName'],'type':_0x572b72[_0xebbb('0x2c')][_0xebbb('0x2d')]};});_0x351888['model']=_[_0xebbb('0x29')](_0x3336a9,'name');_0x351888['query']=_[_0xebbb('0x2e')](_0x1ac655['query']);_0x351888[_0xebbb('0x2f')]=_[_0xebbb('0x30')](_0x351888['model'],_0x351888[_0xebbb('0x31')]);_0x1ae8a4[_0xebbb('0x32')]=_[_0xebbb('0x30')](_0x351888[_0xebbb('0x33')],qs[_0xebbb('0x34')](_0x1ac655[_0xebbb('0x31')][_0xebbb('0x34')]));_0x1ae8a4[_0xebbb('0x32')]=_0x1ae8a4[_0xebbb('0x32')]['length']?_0x1ae8a4['attributes']:_0x351888[_0xebbb('0x33')];if(!_0x1ac655[_0xebbb('0x31')][_0xebbb('0x35')](_0xebbb('0x36'))){_0x1ae8a4[_0xebbb('0x1f')]=qs[_0xebbb('0x1f')](_0x1ac655['query'][_0xebbb('0x1f')]);_0x1ae8a4[_0xebbb('0x1d')]=qs[_0xebbb('0x1d')](_0x1ac655['query']['offset']);}_0x1ae8a4[_0xebbb('0x37')]=qs[_0xebbb('0x38')](_0x1ac655['query'][_0xebbb('0x38')]);_0x1ae8a4[_0xebbb('0x39')]=qs[_0xebbb('0x2f')](_[_0xebbb('0x3a')](_0x1ac655[_0xebbb('0x31')],_0x351888[_0xebbb('0x2f')]),_0x3336a9);if(_0x1ac655[_0xebbb('0x31')][_0xebbb('0x3b')]){_0x1ae8a4['where']=_[_0xebbb('0x3c')](_0x1ae8a4[_0xebbb('0x39')],{'$or':_['map'](_0x3336a9,function(_0x155d7d){if(_0x155d7d['type']!=='VIRTUAL'){var _0x1945f8={};_0x1945f8[_0x155d7d['name']]={'$like':'%'+_0x1ac655[_0xebbb('0x31')][_0xebbb('0x3b')]+'%'};return _0x1945f8;}})});}_0x1ae8a4=_['merge']({},_0x1ae8a4,_0x1ac655[_0xebbb('0x3d')]);var _0x1edc2e={'where':_0x1ae8a4['where']};return db[_0xebbb('0x2a')][_0xebbb('0x20')](_0x1edc2e)['then'](function(_0x15899a){_0x1c817c[_0xebbb('0x20')]=_0x15899a;if(_0x1ac655[_0xebbb('0x31')]['includeAll']){_0x1ae8a4[_0xebbb('0x3e')]=[{'all':!![]}];}return db[_0xebbb('0x2a')]['findAll'](_0x1ae8a4);})['then'](function(_0x566c71){_0x1c817c[_0xebbb('0x3f')]=_0x566c71;return _0x1c817c;})[_0xebbb('0x24')](respondWithFilteredResult(_0xb0aa6,_0x1ae8a4))[_0xebbb('0x40')](handleError(_0xb0aa6,null));};exports[_0xebbb('0x41')]=function(_0x183487,_0xd4366c){var _0x9fcc11={'raw':!![],'where':{'id':_0x183487['params']['id']}},_0x5c82b5={};_0x5c82b5[_0xebbb('0x33')]=_['keys'](db['CmHopperHistory'][_0xebbb('0x2b')]);_0x5c82b5[_0xebbb('0x31')]=_[_0xebbb('0x2e')](_0x183487[_0xebbb('0x31')]);_0x5c82b5['filters']=_[_0xebbb('0x30')](_0x5c82b5['model'],_0x5c82b5[_0xebbb('0x31')]);_0x9fcc11['attributes']=_[_0xebbb('0x30')](_0x5c82b5[_0xebbb('0x33')],qs[_0xebbb('0x34')](_0x183487[_0xebbb('0x31')][_0xebbb('0x34')]));_0x9fcc11[_0xebbb('0x32')]=_0x9fcc11['attributes'][_0xebbb('0x42')]?_0x9fcc11[_0xebbb('0x32')]:_0x5c82b5[_0xebbb('0x33')];if(_0x183487[_0xebbb('0x31')]['includeAll']){_0x9fcc11[_0xebbb('0x3e')]=[{'all':!![]}];}_0x9fcc11=_[_0xebbb('0x3c')]({},_0x9fcc11,_0x183487['options']);return db['CmHopperHistory'][_0xebbb('0x43')](_0x9fcc11)[_0xebbb('0x24')](handleEntityNotFound(_0xd4366c,null))[_0xebbb('0x24')](respondWithResult(_0xd4366c,null))[_0xebbb('0x40')](handleError(_0xd4366c,null));};exports[_0xebbb('0x44')]=function(_0x417151,_0x4c0918){return db[_0xebbb('0x2a')]['create'](_0x417151[_0xebbb('0x45')],{})['then'](respondWithResult(_0x4c0918,0xc9))[_0xebbb('0x40')](handleError(_0x4c0918,null));};exports[_0xebbb('0x46')]=function(_0x2c087f,_0x5c3f6b){return db[_0xebbb('0x2a')][_0xebbb('0x46')]()[_0xebbb('0x24')](respondWithResult(_0x5c3f6b,null))[_0xebbb('0x40')](handleError(_0x5c3f6b,null));};exports[_0xebbb('0x23')]=function(_0x18923b,_0x2df1ac){if(_0x18923b[_0xebbb('0x45')][_0xebbb('0x47')]){delete _0x18923b[_0xebbb('0x45')][_0xebbb('0x47')];}return db['CmHopperHistory'][_0xebbb('0x43')]({'where':{'uniqueid':_0x18923b[_0xebbb('0x48')]['id']}})[_0xebbb('0x24')](handleEntityNotFound(_0x2df1ac,null))[_0xebbb('0x24')](saveUpdates(_0x18923b[_0xebbb('0x45')],null))[_0xebbb('0x24')](respondWithResult(_0x2df1ac,null))['catch'](handleError(_0x2df1ac,null));};
\ No newline at end of file
index 12bc05c..434e2ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x806d=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise','path','../../config/environment','exports'];(function(_0x31b425,_0x35bda9){var _0xa8588e=function(_0x5c17bc){while(--_0x5c17bc){_0x31b425['push'](_0x31b425['shift']());}};_0xa8588e(++_0x35bda9);}(_0x806d,0x131));var _0xd806=function(_0x5ced19,_0x5a8b36){_0x5ced19=_0x5ced19-0x0;var _0xd0a1cf=_0x806d[_0x5ced19];return _0xd0a1cf;};'use strict';var _=require(_0xd806('0x0'));var util=require(_0xd806('0x1'));var logger=require(_0xd806('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd806('0x3'));var fs=require('fs');var path=require(_0xd806('0x4'));var rimraf=require('rimraf');var config=require(_0xd806('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0xd806('0x6')]=function(_0x70dd3,_0x3d21d4){return _0x70dd3[_0xd806('0x7')](_0xd806('0x8'),attributes,{'tableName':_0xd806('0x9'),'paranoid':![],'indexes':[{'name':_0xd806('0xa'),'fields':['endtime']},{'name':_0xd806('0xb'),'fields':[_0xd806('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4c9=['moment','request-promise','path','rimraf','./cmHopperHistory.attributes','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xf4c9[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var logger=require(_0x9f4c('0x2'))('api');var moment=require(_0x9f4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f4c('0x4'));var fs=require('fs');var path=require(_0x9f4c('0x5'));var rimraf=require(_0x9f4c('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f4c('0x7'));module['exports']=function(_0x42cd40,_0x48dc53){return _0x42cd40['define']('CmHopperHistory',attributes,{'tableName':_0x9f4c('0x8'),'paranoid':![],'indexes':[{'name':_0x9f4c('0x9'),'fields':[_0x9f4c('0x9')]},{'name':_0x9f4c('0xa'),'fields':[_0x9f4c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 4019142..b54940a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e47=['AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','raw','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','CmHopperHistory','create','options','catch','AvgHandleTime','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x0e47,0x65));var _0x70e4=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x0e47[_0x20a590];return _0x2e1b41;};'use strict';var _=require(_0x70e4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x70e4('0x1'));var rs=require(_0x70e4('0x2'));var fs=require('fs');var Redis=require(_0x70e4('0x3'));var db=require(_0x70e4('0x4'))['db'];var utils=require(_0x70e4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x70e4('0x6'));var jayson=require(_0x70e4('0x7'));var client=jayson['client'][_0x70e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4503c4,_0x34b0c6,_0x1b4ee4){return new BPromise(function(_0x2ac9d3,_0x5eb8c5){return client[_0x70e4('0x9')](_0x4503c4,_0x1b4ee4)[_0x70e4('0xa')](function(_0x3e1b7f){logger[_0x70e4('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x34b0c6,_0x70e4('0xc'));logger[_0x70e4('0xd')](_0x70e4('0xe'),_0x34b0c6,'request\x20sent',JSON[_0x70e4('0xf')](_0x3e1b7f));if(_0x3e1b7f[_0x70e4('0x10')]){if(_0x3e1b7f[_0x70e4('0x10')]['code']===0x1f4){logger[_0x70e4('0x10')](_0x70e4('0x11'),_0x34b0c6,_0x3e1b7f[_0x70e4('0x10')][_0x70e4('0x12')]);return _0x5eb8c5(_0x3e1b7f[_0x70e4('0x10')]['message']);}logger[_0x70e4('0x10')](_0x70e4('0x11'),_0x34b0c6,_0x3e1b7f['error'][_0x70e4('0x12')]);return _0x2ac9d3(_0x3e1b7f['error'][_0x70e4('0x12')]);}else{logger[_0x70e4('0xb')](_0x70e4('0x11'),_0x34b0c6,_0x70e4('0xc'));_0x2ac9d3(_0x3e1b7f[_0x70e4('0x13')][_0x70e4('0x12')]);}})['catch'](function(_0x4d2e94){logger[_0x70e4('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x34b0c6,_0x4d2e94);_0x5eb8c5(_0x4d2e94);});});}exports[_0x70e4('0x14')]=function(_0x1d0650){var _0x4224e4=this;return new Promise(function(_0x41bd22,_0x5cd0a2){return db[_0x70e4('0x15')][_0x70e4('0x16')](_0x1d0650['body'],{'raw':_0x1d0650[_0x70e4('0x17')]?_0x1d0650[_0x70e4('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x70e4('0xa')](function(_0x5f2c85){logger[_0x70e4('0xb')](_0x70e4('0x14'),_0x1d0650);logger[_0x70e4('0xd')](_0x70e4('0x14'),_0x1d0650,JSON['stringify'](_0x5f2c85));_0x41bd22(_0x5f2c85);})[_0x70e4('0x18')](function(_0x264748){logger['error']('CreateCmHopperHistory',_0x264748['message'],_0x1d0650);_0x5cd0a2(_0x4224e4[_0x70e4('0x10')](0x1f4,_0x264748[_0x70e4('0x12')]));});});};exports[_0x70e4('0x19')]=function(_0x1680f0){var _0xdad28b=this;return new Promise(function(_0x1390c8,_0x3e7742){return db[_0x70e4('0x15')]['findAll']({'raw':_0x1680f0[_0x70e4('0x17')]?_0x1680f0[_0x70e4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1680f0['options']?_0x1680f0[_0x70e4('0x17')]['where']||null:null,'attributes':[[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['col']('id')),_0x70e4('0x1c')],[db[_0x70e4('0x1a')]['fn']('COUNT',db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x1e')))),_0x70e4('0x1f')],[db[_0x70e4('0x1a')]['fn']('COUNT',db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x20')))),_0x70e4('0x21')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')]('`state`\x20=\x2011,\x201,\x20null'))),_0x70e4('0x22')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x23'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x70e4('0x24')],[db[_0x70e4('0x1a')]['fn']('AVG',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x70e4('0x25')]]})[_0x70e4('0xa')](function(_0x37d748){logger['info'](_0x70e4('0x19'),_0x1680f0);logger[_0x70e4('0xd')](_0x70e4('0x19'),_0x1680f0,JSON[_0x70e4('0xf')](_0x37d748));_0x1390c8(_0x37d748);})[_0x70e4('0x18')](function(_0x23d0fd){logger['error'](_0x70e4('0x19'),_0x23d0fd[_0x70e4('0x12')],_0x1680f0);_0x3e7742(_0xdad28b[_0x70e4('0x10')](0x1f4,_0x23d0fd[_0x70e4('0x12')]));});});};exports[_0x70e4('0x26')]=function(_0x22a06b){var _0x16f4bd=this;return new Promise(function(_0x483eb5,_0x7b3089){return db[_0x70e4('0x15')][_0x70e4('0x27')]({'raw':_0x22a06b[_0x70e4('0x17')]?_0x22a06b[_0x70e4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22a06b[_0x70e4('0x17')]?_0x22a06b[_0x70e4('0x17')]['where']||null:null,'attributes':[[_0x70e4('0x28'),_0x70e4('0x29')],[db['sequelize']['fn'](_0x70e4('0x1b'),db['sequelize']['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x2a')))),_0x70e4('0x2b')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')]('`state`\x20=\x203,\x201,\x20null'))),_0x70e4('0x2c')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db['sequelize'][_0x70e4('0x1d')]('`state`\x20=\x204,\x201,\x20null'))),_0x70e4('0x2d')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x70e4('0x1d')](_0x70e4('0x2e')))),_0x70e4('0x2f')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x70e4('0x30')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x31')))),_0x70e4('0x32')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x33')))),_0x70e4('0x34')],[db['sequelize']['fn']('COUNT',db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')]('`state`\x20=\x2012,\x201,\x20null'))),_0x70e4('0x35')],[db['sequelize']['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db['sequelize'][_0x70e4('0x1d')](_0x70e4('0x36')))),'outboundBlacklistCallsDay'],[db[_0x70e4('0x1a')]['fn']('COUNT',db[_0x70e4('0x1a')]['fn']('IF',db['sequelize'][_0x70e4('0x1d')](_0x70e4('0x37')))),_0x70e4('0x38')],[db['sequelize']['fn']('COUNT',db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x39')))),_0x70e4('0x3a')],[db['sequelize']['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x3b')))),_0x70e4('0x3c')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')]['fn']('IF',db['sequelize'][_0x70e4('0x1d')](_0x70e4('0x3d')))),_0x70e4('0x3e')]],'group':[_0x70e4('0x28')]})[_0x70e4('0xa')](function(_0x544d8a){logger[_0x70e4('0xb')](_0x70e4('0x26'),_0x22a06b);logger['debug']('GetVoiceQueueHopperHistory',_0x22a06b,JSON['stringify'](_0x544d8a));_0x483eb5(_0x544d8a);})[_0x70e4('0x18')](function(_0xf3c348){logger[_0x70e4('0x10')](_0x70e4('0x26'),_0xf3c348[_0x70e4('0x12')],_0x22a06b);_0x7b3089(_0x16f4bd[_0x70e4('0x10')](0x1f4,_0xf3c348[_0x70e4('0x12')]));});});};exports[_0x70e4('0x3f')]=function(_0x27d5fa){var _0x502a1a=this;return new Promise(function(_0x1468d8,_0x41b4be){return db[_0x70e4('0x15')][_0x70e4('0x27')]({'raw':_0x27d5fa[_0x70e4('0x17')]?_0x27d5fa[_0x70e4('0x17')][_0x70e4('0x40')]===undefined?!![]:![]:!![],'where':_0x27d5fa[_0x70e4('0x17')]?_0x27d5fa['options']['where']||null:null,'attributes':[[_0x70e4('0x28'),_0x70e4('0x29')],[db[_0x70e4('0x1a')]['fn'](_0x70e4('0x1b'),db[_0x70e4('0x1a')][_0x70e4('0x41')]('id')),_0x70e4('0x42')],[db[_0x70e4('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x70e4('0x1a')][_0x70e4('0x1d')](_0x70e4('0x1e')))),_0x70e4('0x43')]],'group':[_0x70e4('0x28')]})[_0x70e4('0xa')](function(_0x3bc965){logger['info'](_0x70e4('0x3f'),_0x27d5fa);logger[_0x70e4('0xd')](_0x70e4('0x3f'),_0x27d5fa,JSON[_0x70e4('0xf')](_0x3bc965));_0x1468d8(_0x3bc965);})[_0x70e4('0x18')](function(_0x33204e){logger[_0x70e4('0x10')]('GetCampaignHopperHistory',_0x33204e['message'],_0x27d5fa);_0x41b4be(_0x502a1a[_0x70e4('0x10')](0x1f4,_0x33204e['message']));});});};
\ No newline at end of file
+var _0xcf2d=['sequelize','col','literal','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','then','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','where'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xcf2d,0x1ea));var _0xdcf2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdcf2('0x0'));var util=require(_0xdcf2('0x1'));var moment=require(_0xdcf2('0x2'));var BPromise=require(_0xdcf2('0x3'));var rs=require(_0xdcf2('0x4'));var fs=require('fs');var Redis=require(_0xdcf2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcf2('0x6'));var config=require(_0xdcf2('0x7'));var jayson=require(_0xdcf2('0x8'));var client=jayson[_0xdcf2('0x9')][_0xdcf2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x298837,_0x435edf,_0x34d448){return new BPromise(function(_0x4a1c7f,_0x5cf8d0){return client[_0xdcf2('0xb')](_0x298837,_0x34d448)['then'](function(_0x399984){logger[_0xdcf2('0xc')](_0xdcf2('0xd'),_0x435edf,'request\x20sent');logger[_0xdcf2('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x435edf,_0xdcf2('0xf'),JSON[_0xdcf2('0x10')](_0x399984));if(_0x399984[_0xdcf2('0x11')]){if(_0x399984['error'][_0xdcf2('0x12')]===0x1f4){logger[_0xdcf2('0x11')](_0xdcf2('0xd'),_0x435edf,_0x399984[_0xdcf2('0x11')]['message']);return _0x5cf8d0(_0x399984[_0xdcf2('0x11')][_0xdcf2('0x13')]);}logger[_0xdcf2('0x11')](_0xdcf2('0xd'),_0x435edf,_0x399984[_0xdcf2('0x11')][_0xdcf2('0x13')]);return _0x4a1c7f(_0x399984[_0xdcf2('0x11')][_0xdcf2('0x13')]);}else{logger[_0xdcf2('0xc')](_0xdcf2('0xd'),_0x435edf,_0xdcf2('0xf'));_0x4a1c7f(_0x399984['result'][_0xdcf2('0x13')]);}})[_0xdcf2('0x14')](function(_0xc7869c){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x435edf,_0xc7869c);_0x5cf8d0(_0xc7869c);});});}exports['CreateCmHopperHistory']=function(_0x3f0d7a){var _0x4b372d=this;return new Promise(function(_0x2f3264,_0x58c032){return db['CmHopperHistory'][_0xdcf2('0x15')](_0x3f0d7a[_0xdcf2('0x16')],{'raw':_0x3f0d7a[_0xdcf2('0x17')]?_0x3f0d7a[_0xdcf2('0x17')][_0xdcf2('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x932588){logger[_0xdcf2('0xc')]('CreateCmHopperHistory',_0x3f0d7a);logger[_0xdcf2('0xe')](_0xdcf2('0x19'),_0x3f0d7a,JSON['stringify'](_0x932588));_0x2f3264(_0x932588);})[_0xdcf2('0x14')](function(_0x3cf9b7){logger[_0xdcf2('0x11')]('CreateCmHopperHistory',_0x3cf9b7[_0xdcf2('0x13')],_0x3f0d7a);_0x58c032(_0x4b372d[_0xdcf2('0x11')](0x1f4,_0x3cf9b7['message']));});});};exports[_0xdcf2('0x1a')]=function(_0x14d9c3){var _0x18961c=this;return new Promise(function(_0x348f66,_0x8e6cd7){return db[_0xdcf2('0x1b')][_0xdcf2('0x1c')]({'raw':_0x14d9c3[_0xdcf2('0x17')]?_0x14d9c3[_0xdcf2('0x17')][_0xdcf2('0x18')]===undefined?!![]:![]:!![],'where':_0x14d9c3[_0xdcf2('0x17')]?_0x14d9c3[_0xdcf2('0x17')][_0xdcf2('0x1d')]||null:null,'attributes':[[db[_0xdcf2('0x1e')]['fn']('COUNT',db[_0xdcf2('0x1e')][_0xdcf2('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xdcf2('0x21')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db['sequelize']['fn']('IF',db[_0xdcf2('0x1e')]['literal'](_0xdcf2('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn']('COUNT',db[_0xdcf2('0x1e')]['fn']('IF',db['sequelize'][_0xdcf2('0x20')](_0xdcf2('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xdcf2('0x25'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xdcf2('0x26')))),'predictiveIntervalAvgHoldtime'],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x25'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')]['literal'](_0xdcf2('0x27')))),_0xdcf2('0x28')]]})['then'](function(_0x239370){logger[_0xdcf2('0xc')]('AvgHandleTime',_0x14d9c3);logger[_0xdcf2('0xe')](_0xdcf2('0x1a'),_0x14d9c3,JSON['stringify'](_0x239370));_0x348f66(_0x239370);})[_0xdcf2('0x14')](function(_0xbde0e2){logger[_0xdcf2('0x11')](_0xdcf2('0x1a'),_0xbde0e2['message'],_0x14d9c3);_0x8e6cd7(_0x18961c[_0xdcf2('0x11')](0x1f4,_0xbde0e2[_0xdcf2('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x358013){var _0x883637=this;return new Promise(function(_0x2327f2,_0x5a0f37){return db[_0xdcf2('0x1b')][_0xdcf2('0x1c')]({'raw':_0x358013[_0xdcf2('0x17')]?_0x358013['options']['raw']===undefined?!![]:![]:!![],'where':_0x358013[_0xdcf2('0x17')]?_0x358013[_0xdcf2('0x17')][_0xdcf2('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0xdcf2('0x29')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0xdcf2('0x2a')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')]['literal'](_0xdcf2('0x2b')))),_0xdcf2('0x2c')],[db['sequelize']['fn']('COUNT',db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')]('`state`\x20=\x205,\x201,\x20null'))),_0xdcf2('0x2d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xdcf2('0x20')](_0xdcf2('0x2e')))),_0xdcf2('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xdcf2('0x1e')]['fn']('IF',db['sequelize'][_0xdcf2('0x20')](_0xdcf2('0x30')))),_0xdcf2('0x31')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db['sequelize']['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xdcf2('0x22'),db['sequelize']['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')](_0xdcf2('0x32')))),_0xdcf2('0x33')],[db['sequelize']['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')](_0xdcf2('0x34')))),_0xdcf2('0x35')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db['sequelize'][_0xdcf2('0x20')]('`state`\x20=\x2014,\x201,\x20null'))),_0xdcf2('0x36')],[db['sequelize']['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0xdcf2('0x37')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db['sequelize']['fn']('IF',db[_0xdcf2('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xdcf2('0x38')],[db['sequelize']['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),_0xdcf2('0x37')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db['sequelize']['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')](_0xdcf2('0x39')))),_0xdcf2('0x3a')]],'group':[_0xdcf2('0x3b')]})[_0xdcf2('0x3c')](function(_0x2e77cc){logger[_0xdcf2('0xc')](_0xdcf2('0x3d'),_0x358013);logger[_0xdcf2('0xe')](_0xdcf2('0x3d'),_0x358013,JSON[_0xdcf2('0x10')](_0x2e77cc));_0x2327f2(_0x2e77cc);})[_0xdcf2('0x14')](function(_0x4ce4b8){logger['error'](_0xdcf2('0x3d'),_0x4ce4b8[_0xdcf2('0x13')],_0x358013);_0x5a0f37(_0x883637['error'](0x1f4,_0x4ce4b8[_0xdcf2('0x13')]));});});};exports[_0xdcf2('0x3e')]=function(_0x4b29e4){var _0x383115=this;return new Promise(function(_0x47bf65,_0x51784b){return db[_0xdcf2('0x1b')][_0xdcf2('0x1c')]({'raw':_0x4b29e4[_0xdcf2('0x17')]?_0x4b29e4[_0xdcf2('0x17')][_0xdcf2('0x18')]===undefined?!![]:![]:!![],'where':_0x4b29e4[_0xdcf2('0x17')]?_0x4b29e4[_0xdcf2('0x17')][_0xdcf2('0x1d')]||null:null,'attributes':[[_0xdcf2('0x3b'),'name'],[db['sequelize']['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['col']('id')),_0xdcf2('0x3f')],[db[_0xdcf2('0x1e')]['fn'](_0xdcf2('0x22'),db[_0xdcf2('0x1e')]['fn']('IF',db[_0xdcf2('0x1e')][_0xdcf2('0x20')](_0xdcf2('0x2b')))),_0xdcf2('0x40')]],'group':['campaign']})['then'](function(_0x2c58be){logger['info'](_0xdcf2('0x3e'),_0x4b29e4);logger[_0xdcf2('0xe')](_0xdcf2('0x3e'),_0x4b29e4,JSON['stringify'](_0x2c58be));_0x47bf65(_0x2c58be);})[_0xdcf2('0x14')](function(_0x3fcc8a){logger[_0xdcf2('0x11')](_0xdcf2('0x3e'),_0x3fcc8a[_0xdcf2('0x13')],_0x4b29e4);_0x51784b(_0x383115[_0xdcf2('0x11')](0x1f4,_0x3fcc8a[_0xdcf2('0x13')]));});});};
\ No newline at end of file
index 4bda370..8d8aeb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1120=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','put','update','path','connect-timeout'];(function(_0x5b0800,_0x353f87){var _0x3e6064=function(_0x224648){while(--_0x224648){_0x5b0800['push'](_0x5b0800['shift']());}};_0x3e6064(++_0x353f87);}(_0x1120,0x1da));var _0x0112=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x1120[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0112('0x0'));var timeout=require(_0x0112('0x1'));var express=require(_0x0112('0x2'));var router=express[_0x0112('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0112('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0112('0x5'));var controller=require('./cmHopperHistory.controller');router[_0x0112('0x6')]('/',auth[_0x0112('0x7')](),controller['index']);router[_0x0112('0x6')](_0x0112('0x8'),auth[_0x0112('0x7')](),controller[_0x0112('0x9')]);router[_0x0112('0x6')](_0x0112('0xa'),auth[_0x0112('0x7')](),controller['show']);router[_0x0112('0xb')]('/',auth[_0x0112('0x7')](),controller['create']);router[_0x0112('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x0112('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x0593=['describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe'];(function(_0x29f574,_0x4e27dd){var _0xbc2316=function(_0x5309f4){while(--_0x5309f4){_0x29f574['push'](_0x29f574['shift']());}};_0xbc2316(++_0x4e27dd);}(_0x0593,0xa8));var _0x3059=function(_0x196dd3,_0x2a6ad0){_0x196dd3=_0x196dd3-0x0;var _0xee0ccb=_0x0593[_0x196dd3];return _0xee0ccb;};'use strict';var multer=require(_0x3059('0x0'));var util=require(_0x3059('0x1'));var path=require(_0x3059('0x2'));var timeout=require(_0x3059('0x3'));var express=require(_0x3059('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3059('0x5'));var interaction=require(_0x3059('0x6'));var config=require('../../config/environment');var controller=require(_0x3059('0x7'));router[_0x3059('0x8')]('/',auth[_0x3059('0x9')](),controller[_0x3059('0xa')]);router[_0x3059('0x8')](_0x3059('0xb'),auth[_0x3059('0x9')](),controller[_0x3059('0xc')]);router[_0x3059('0x8')](_0x3059('0xd'),auth[_0x3059('0x9')](),controller[_0x3059('0xe')]);router[_0x3059('0xf')]('/',auth[_0x3059('0x9')](),controller[_0x3059('0x10')]);router[_0x3059('0x11')](_0x3059('0xd'),auth[_0x3059('0x9')](),controller[_0x3059('0x12')]);module[_0x3059('0x13')]=router;
\ No newline at end of file
index ddb0181..0f66efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25fa=['name','sequelize','STRING'];(function(_0x353098,_0x2f5168){var _0x47fd55=function(_0x5b831c){while(--_0x5b831c){_0x353098['push'](_0x353098['shift']());}};_0x47fd55(++_0x2f5168);}(_0x25fa,0x109));var _0xa25f=function(_0x409645,_0x3a4cbe){_0x409645=_0x409645-0x0;var _0x5d7ab5=_0x25fa[_0x409645];return _0x5d7ab5;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'unique':_0xa25f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xa25f('0x1')]}};
\ No newline at end of file
+var _0x2cc1=['name','sequelize','exports','STRING'];(function(_0x1b43c5,_0x4c5869){var _0x3d06bd=function(_0x5185b8){while(--_0x5185b8){_0x1b43c5['push'](_0x1b43c5['shift']());}};_0x3d06bd(++_0x4c5869);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x28836b,_0x389433){_0x28836b=_0x28836b-0x0;var _0x51f3f8=_0x2cc1[_0x28836b];return _0x51f3f8;};'use strict';var Sequelize=require(_0x12cc('0x0'));module[_0x12cc('0x1')]={'name':{'type':Sequelize[_0x12cc('0x2')],'unique':_0x12cc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x12cc('0x2')]},'dialPrefix':{'type':Sequelize[_0x12cc('0x2')]}};
\ No newline at end of file
index 8f87168..8b03995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x391c=['include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','filter','options','findAll','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','success','errors','push','message','Malformed\x20request\x20syntax','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','CmCustomField','select','from','cm_contacts','distinct','field','c.cf_','customField_','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Lists','UserProfileResource','destroy','stack','name','CmList','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','includeAll'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x391c,0x109));var _0xc391=function(_0x3c328e,_0x133167){_0x3c328e=_0x3c328e-0x0;var _0x46b037=_0x391c[_0x3c328e];return _0x46b037;};'use strict';var emlformat=require(_0xc391('0x0'));var rimraf=require(_0xc391('0x1'));var zipdir=require(_0xc391('0x2'));var jsonpatch=require(_0xc391('0x3'));var rp=require(_0xc391('0x4'));var moment=require('moment');var BPromise=require(_0xc391('0x5'));var Mustache=require(_0xc391('0x6'));var util=require(_0xc391('0x7'));var path=require(_0xc391('0x8'));var sox=require('sox');var csv=require(_0xc391('0x9'));var ejs=require(_0xc391('0xa'));var fs=require('fs');var fs_extra=require(_0xc391('0xb'));var _=require(_0xc391('0xc'));var squel=require(_0xc391('0xd'));var crypto=require('crypto');var jsforce=require(_0xc391('0xe'));var deskjs=require(_0xc391('0xf'));var toCsv=require(_0xc391('0x9'));var querystring=require(_0xc391('0x10'));var Papa=require('papaparse');var Redis=require(_0xc391('0x11'));var authService=require(_0xc391('0x12'));var qs=require(_0xc391('0x13'));var as=require(_0xc391('0x14'));var hardwareService=require(_0xc391('0x15'));var logger=require(_0xc391('0x16'))(_0xc391('0x17'));var utils=require('../../config/utils');var config=require(_0xc391('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc391('0x19'))['db'];var csv_results;config[_0xc391('0x1a')]=_[_0xc391('0x1b')](config[_0xc391('0x1a')],{'host':_0xc391('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc391('0x1a')]));require('./cmList.socket')[_0xc391('0x1d')](socket);function respondWithStatusCode(_0x1e680e,_0xa10824){_0xa10824=_0xa10824||0xcc;return function(_0x5ea6a0){if(_0x5ea6a0){return _0x1e680e[_0xc391('0x1e')](_0xa10824);}return _0x1e680e['status'](_0xa10824)['end']();};}function respondWithResult(_0x305844,_0x47f596){_0x47f596=_0x47f596||0xc8;return function(_0x4300c5){if(_0x4300c5){return _0x305844[_0xc391('0x1f')](_0x47f596)[_0xc391('0x20')](_0x4300c5);}};}function respondWithFilteredResult(_0x28ae9a,_0x2bfbc0){return function(_0xeda612){if(_0xeda612){var _0x19b66d=typeof _0x2bfbc0['offset']===_0xc391('0x21')&&typeof _0x2bfbc0[_0xc391('0x22')]===_0xc391('0x21');var _0x2eb4db=_0xeda612[_0xc391('0x23')];var _0x4277ce=_0x19b66d?0x0:_0x2bfbc0[_0xc391('0x24')];var _0x45e6b2=_0x19b66d?_0xeda612[_0xc391('0x23')]:_0x2bfbc0[_0xc391('0x24')]+_0x2bfbc0['limit'];var _0x30d096;if(_0x45e6b2>=_0x2eb4db){_0x45e6b2=_0x2eb4db;_0x30d096=0xc8;}else{_0x30d096=0xce;}_0x28ae9a[_0xc391('0x1f')](_0x30d096);return _0x28ae9a[_0xc391('0x25')](_0xc391('0x26'),_0x4277ce+'-'+_0x45e6b2+'/'+_0x2eb4db)['json'](_0xeda612);}return null;};}function patchUpdates(_0x13ab98){return function(_0x5bb19f){try{jsonpatch[_0xc391('0x27')](_0x5bb19f,_0x13ab98,!![]);}catch(_0x33a698){return BPromise[_0xc391('0x28')](_0x33a698);}return _0x5bb19f[_0xc391('0x29')]();};}function saveUpdates(_0x1e7293,_0x3c3fe2){return function(_0x5865d3){if(_0x5865d3){return _0x5865d3[_0xc391('0x2a')](_0x1e7293)['then'](function(_0x593ea9){return _0x593ea9;});}return null;};}function removeEntity(_0x465210,_0x1392ce){return function(_0x5b8c9b){if(_0x5b8c9b){return _0x5b8c9b['destroy']()[_0xc391('0x2b')](function(){var _0x1822da=_0x5b8c9b['get']({'plain':!![]});var _0x447321=_0xc391('0x2c');return db[_0xc391('0x2d')][_0xc391('0x2e')]({'where':{'type':_0x447321,'resourceId':_0x1822da['id']}})[_0xc391('0x2b')](function(){return _0x5b8c9b;});})['then'](function(){_0x465210['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9372c2,_0x20cb24){return function(_0x509844){if(!_0x509844){_0x9372c2['sendStatus'](0x194);}return _0x509844;};}function handleError(_0x1d667a,_0x142950){_0x142950=_0x142950||0x1f4;return function(_0x99d5be){logger['error'](_0x99d5be[_0xc391('0x2f')]);if(_0x99d5be[_0xc391('0x30')]){delete _0x99d5be['name'];}_0x1d667a['status'](_0x142950)['send'](_0x99d5be);};}exports['index']=function(_0x36b38b,_0x16ef6a){var _0xb6321e={},_0x497e6d={},_0x4dd014={'count':0x0,'rows':[]};var _0x9bf25=_['map'](db[_0xc391('0x31')][_0xc391('0x32')],function(_0x4e5d2c){return{'name':_0x4e5d2c[_0xc391('0x33')],'type':_0x4e5d2c[_0xc391('0x34')]['key']};});_0x497e6d[_0xc391('0x35')]=_[_0xc391('0x36')](_0x9bf25,_0xc391('0x30'));_0x497e6d['query']=_[_0xc391('0x37')](_0x36b38b[_0xc391('0x38')]);_0x497e6d[_0xc391('0x39')]=_[_0xc391('0x3a')](_0x497e6d[_0xc391('0x35')],_0x497e6d[_0xc391('0x38')]);_0xb6321e['attributes']=_[_0xc391('0x3a')](_0x497e6d[_0xc391('0x35')],qs[_0xc391('0x3b')](_0x36b38b[_0xc391('0x38')][_0xc391('0x3b')]));_0xb6321e[_0xc391('0x3c')]=_0xb6321e[_0xc391('0x3c')][_0xc391('0x3d')]?_0xb6321e[_0xc391('0x3c')]:_0x497e6d['model'];if(!_0x36b38b[_0xc391('0x38')][_0xc391('0x3e')]('nolimit')){_0xb6321e['limit']=qs[_0xc391('0x22')](_0x36b38b[_0xc391('0x38')][_0xc391('0x22')]);_0xb6321e[_0xc391('0x24')]=qs['offset'](_0x36b38b[_0xc391('0x38')][_0xc391('0x24')]);}_0xb6321e[_0xc391('0x3f')]=qs[_0xc391('0x40')](_0x36b38b['query'][_0xc391('0x40')]);_0xb6321e[_0xc391('0x41')]=qs['filters'](_[_0xc391('0x42')](_0x36b38b[_0xc391('0x38')],_0x497e6d['filters']),_0x9bf25);if(_0x36b38b[_0xc391('0x38')]['filter']){_0xb6321e['where']=_[_0xc391('0x43')](_0xb6321e[_0xc391('0x41')],{'$or':_[_0xc391('0x36')](_0x9bf25,function(_0x3c871a){if(_0x3c871a[_0xc391('0x34')]!=='VIRTUAL'){var _0xf241a8={};_0xf241a8[_0x3c871a[_0xc391('0x30')]]={'$like':'%'+_0x36b38b[_0xc391('0x38')]['filter']+'%'};return _0xf241a8;}})});}_0xb6321e=_[_0xc391('0x43')]({},_0xb6321e,_0x36b38b['options']);var _0x40b365={'where':_0xb6321e[_0xc391('0x41')]};return db[_0xc391('0x31')][_0xc391('0x23')](_0x40b365)['then'](function(_0x51ece0){_0x4dd014[_0xc391('0x23')]=_0x51ece0;if(_0x36b38b[_0xc391('0x38')][_0xc391('0x44')]){_0xb6321e[_0xc391('0x45')]=[{'all':!![]}];}return db[_0xc391('0x31')]['findAll'](_0xb6321e);})[_0xc391('0x2b')](function(_0x5d21a2){_0x4dd014[_0xc391('0x46')]=_0x5d21a2;return _0x4dd014;})[_0xc391('0x2b')](respondWithFilteredResult(_0x16ef6a,_0xb6321e))[_0xc391('0x47')](handleError(_0x16ef6a,null));};exports[_0xc391('0x48')]=function(_0x322697,_0x2be504){var _0x25ba10={'raw':![],'where':{'id':_0x322697[_0xc391('0x49')]['id']}},_0x2c1ec3={};_0x2c1ec3[_0xc391('0x35')]=_[_0xc391('0x37')](db[_0xc391('0x31')][_0xc391('0x32')]);_0x2c1ec3[_0xc391('0x38')]=_[_0xc391('0x37')](_0x322697[_0xc391('0x38')]);_0x2c1ec3['filters']=_[_0xc391('0x3a')](_0x2c1ec3[_0xc391('0x35')],_0x2c1ec3['query']);_0x25ba10['attributes']=_[_0xc391('0x3a')](_0x2c1ec3[_0xc391('0x35')],qs[_0xc391('0x3b')](_0x322697['query'][_0xc391('0x3b')]));_0x25ba10[_0xc391('0x3c')]=_0x25ba10[_0xc391('0x3c')][_0xc391('0x3d')]?_0x25ba10[_0xc391('0x3c')]:_0x2c1ec3['model'];if(_0x322697[_0xc391('0x38')]['includeAll']){_0x25ba10[_0xc391('0x45')]=[{'all':!![]}];}_0x25ba10=_['merge']({},_0x25ba10,_0x322697['options']);return db['CmList'][_0xc391('0x4a')](_0x25ba10)['then'](handleEntityNotFound(_0x2be504,null))['then'](respondWithResult(_0x2be504,null))['catch'](handleError(_0x2be504,null));};exports[_0xc391('0x4b')]=function(_0x4dd743,_0x45faeb){return db[_0xc391('0x31')][_0xc391('0x4b')](_0x4dd743['body'],{})[_0xc391('0x2b')](function(_0x2003c1){var _0x5e83b8=_0x4dd743[_0xc391('0x4c')]['get']({'plain':!![]});if(!_0x5e83b8)throw new Error(_0xc391('0x4d'));if(_0x5e83b8[_0xc391('0x4e')]===_0xc391('0x4c')){var _0x9a73d0=_0x2003c1[_0xc391('0x4f')]({'plain':!![]});var _0x4bab30='Lists';return db[_0xc391('0x50')][_0xc391('0x4a')]({'where':{'name':_0x4bab30,'userProfileId':_0x5e83b8[_0xc391('0x51')]},'raw':!![]})[_0xc391('0x2b')](function(_0x4179a8){if(_0x4179a8&&_0x4179a8[_0xc391('0x52')]===0x0){return db['UserProfileResource'][_0xc391('0x4b')]({'name':_0x9a73d0[_0xc391('0x30')],'resourceId':_0x9a73d0['id'],'type':_0x4179a8[_0xc391('0x30')],'sectionId':_0x4179a8['id']},{})[_0xc391('0x2b')](function(){return _0x2003c1;});}else{return _0x2003c1;}})[_0xc391('0x47')](function(_0x419b88){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x419b88);throw _0x419b88;});}return _0x2003c1;})[_0xc391('0x2b')](respondWithResult(_0x45faeb,0xc9))[_0xc391('0x47')](handleError(_0x45faeb,null));};exports[_0xc391('0x2a')]=function(_0x2e231e,_0x27e1cf){if(_0x2e231e[_0xc391('0x53')]['id']){delete _0x2e231e[_0xc391('0x53')]['id'];}return db[_0xc391('0x31')][_0xc391('0x4a')]({'where':{'id':_0x2e231e[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x27e1cf,null))['then'](saveUpdates(_0x2e231e['body'],null))['then'](respondWithResult(_0x27e1cf,null))[_0xc391('0x47')](handleError(_0x27e1cf,null));};exports[_0xc391('0x2e')]=function(_0xd002c3,_0x306dc2){return db[_0xc391('0x31')][_0xc391('0x4a')]({'where':{'id':_0xd002c3[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x306dc2,null))[_0xc391('0x2b')](removeEntity(_0x306dc2,null))[_0xc391('0x47')](handleError(_0x306dc2,null));};exports['describe']=function(_0x1245f0,_0x4ea213){return db[_0xc391('0x31')][_0xc391('0x54')]()[_0xc391('0x2b')](respondWithResult(_0x4ea213,null))[_0xc391('0x47')](handleError(_0x4ea213,null));};exports[_0xc391('0x55')]=function(_0x2fca91,_0x46a87e,_0x6036b6){if(_0x2fca91[_0xc391('0x53')]['id']){delete _0x2fca91['body']['id'];}return db['CmList'][_0xc391('0x4a')]({'where':{'id':_0x2fca91[_0xc391('0x49')]['id']}})['then'](handleEntityNotFound(_0x46a87e,null))[_0xc391('0x2b')](function(_0x5e2ab9){if(_0x5e2ab9){_0x2fca91[_0xc391('0x53')][_0xc391('0x56')]=_0x5e2ab9['id'];return db[_0xc391('0x57')]['create'](_0x2fca91['body']);}})[_0xc391('0x2b')](respondWithResult(_0x46a87e,null))[_0xc391('0x47')](handleError(_0x46a87e,null));};exports[_0xc391('0x58')]=function(_0x4e4218,_0x5e0aaf,_0x15ab35){var _0x16ffff={'raw':![],'where':{}};var _0x306c73={};var _0x4752ff={'count':0x0,'rows':[]};return db[_0xc391('0x31')][_0xc391('0x59')]({'where':{'id':_0x4e4218[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x5e0aaf,null))[_0xc391('0x2b')](function(_0x55fe65){if(_0x55fe65){_0x306c73['model']=_[_0xc391('0x37')](db[_0xc391('0x57')][_0xc391('0x32')]);_0x306c73[_0xc391('0x38')]=_[_0xc391('0x37')](_0x4e4218['query']);_0x306c73[_0xc391('0x39')]=_[_0xc391('0x3a')](_0x306c73['model'],_0x306c73[_0xc391('0x38')]);_0x16ffff[_0xc391('0x3c')]=_['intersection'](_0x306c73[_0xc391('0x35')],qs[_0xc391('0x3b')](_0x4e4218['query']['fields']));_0x16ffff[_0xc391('0x3c')]=_0x16ffff[_0xc391('0x3c')]['length']?_0x16ffff[_0xc391('0x3c')]:_0x306c73['model'];if(!_0x4e4218['query']['hasOwnProperty'](_0xc391('0x5a'))){_0x16ffff[_0xc391('0x22')]=qs['limit'](_0x4e4218[_0xc391('0x38')][_0xc391('0x22')]);_0x16ffff[_0xc391('0x24')]=qs[_0xc391('0x24')](_0x4e4218['query'][_0xc391('0x24')]);}_0x16ffff[_0xc391('0x3f')]=qs[_0xc391('0x40')](_0x4e4218[_0xc391('0x38')][_0xc391('0x40')]);_0x16ffff[_0xc391('0x41')]=qs['filters'](_[_0xc391('0x42')](_0x4e4218['query'],_0x306c73['filters']));_0x16ffff[_0xc391('0x41')]['ListId']=_0x55fe65['id'];if(_0x4e4218[_0xc391('0x38')][_0xc391('0x5b')]){_0x16ffff['where']=_['merge'](_0x16ffff[_0xc391('0x41')],{'$or':_[_0xc391('0x36')](_0x16ffff[_0xc391('0x3c')],function(_0x16b37b){var _0x49c3ca={};_0x49c3ca[_0x16b37b]={'$like':'%'+_0x4e4218[_0xc391('0x38')][_0xc391('0x5b')]+'%'};return _0x49c3ca;})});}_0x16ffff=_[_0xc391('0x43')]({},_0x16ffff,_0x4e4218[_0xc391('0x5c')]);return db[_0xc391('0x57')][_0xc391('0x23')]({'where':_0x16ffff['where']})['then'](function(_0x5dab06){_0x4752ff[_0xc391('0x23')]=_0x5dab06;if(_0x4e4218[_0xc391('0x38')][_0xc391('0x44')]){_0x16ffff[_0xc391('0x45')]=[{'all':!![]}];}return db[_0xc391('0x57')][_0xc391('0x5d')](_0x16ffff);})[_0xc391('0x2b')](function(_0x3cec83){_0x4752ff[_0xc391('0x46')]=_0x3cec83;return _0x4752ff;});}})[_0xc391('0x2b')](respondWithFilteredResult(_0x5e0aaf,_0x16ffff))['catch'](handleError(_0x5e0aaf,null));};exports['removeDispositions']=function(_0x31c433,_0x36eb42,_0x1072b6){return db['CmList'][_0xc391('0x4a')]({'where':{'id':_0x31c433['params']['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x36eb42,null))[_0xc391('0x2b')](function(_0x41c566){if(_0x41c566){return _0x41c566[_0xc391('0x5e')](_0x31c433['query'][_0xc391('0x5f')]);}})[_0xc391('0x2b')](respondWithStatusCode(_0x36eb42,null))[_0xc391('0x47')](handleError(_0x36eb42,null));};exports[_0xc391('0x60')]=function(_0x18b5ec,_0x4fbdc0,_0x21af5c){return db[_0xc391('0x31')][_0xc391('0x4a')]({'where':{'id':_0x18b5ec[_0xc391('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fbdc0,null))[_0xc391('0x2b')](function(_0x4c2a9c){if(_0x4c2a9c){var _0x4119f8=[];var _0x93db2={'success':[],'errors':[]};return db[_0xc391('0x61')][_0xc391('0x54')]()['then'](function(_0x5877ad){if(_0x18b5ec['body']['tags']&&_['isArray'](_0x18b5ec['body'][_0xc391('0x62')])){if(_0x18b5ec[_0xc391('0x53')][_0xc391('0x62')][_0xc391('0x3d')]){_0x18b5ec['body'][_0xc391('0x62')]=_0x18b5ec['body'][_0xc391('0x62')][_0xc391('0x63')](';')+';';}else{_0x18b5ec[_0xc391('0x53')][_0xc391('0x62')]=null;}}else{_0x18b5ec[_0xc391('0x53')][_0xc391('0x62')]=null;}if(_0x18b5ec['body']&&_[_0xc391('0x64')](_0x18b5ec['body'])){for(var _0x3247f6=0x0;_0x3247f6<_0x18b5ec[_0xc391('0x53')][_0xc391('0x3d')];_0x3247f6+=0x1){_0x18b5ec['body'][_0x3247f6]['ListId']=_0x18b5ec['params']['id'];_0x4119f8['push'](_0x18b5ec['body'][_0x3247f6]);}return BPromise['each'](_0x4119f8,function(_0x188e77){return db[_0xc391('0x61')][_0xc391('0x4b')](_['omit'](_0x188e77,[_0xc391('0x5f'),'id'])||{},{'fields':_[_0xc391('0x37')](_0x5877ad),'raw':!![]})[_0xc391('0x2b')](function(_0x25ca11){_0x93db2[_0xc391('0x65')]['push'](_0x25ca11['dataValues']);})[_0xc391('0x47')](function(_0xda8aff){_0x93db2[_0xc391('0x66')][_0xc391('0x67')]({'data':_0x188e77,'error':_0xda8aff[_0xc391('0x68')]});});})['then'](function(_0x526406){return _0x93db2;})[_0xc391('0x47')](function(_0xd87682){return _0xd87682;});}else{_0x4fbdc0['status'](0x190)[_0xc391('0x20')]({'message':_0xc391('0x69')});}});}})[_0xc391('0x2b')](respondWithResult(_0x4fbdc0,null))[_0xc391('0x47')](handleError(_0x4fbdc0,null));};exports['getContacts']=function(_0xa0257d,_0x503b19,_0x4f0995){var _0x8726e1;return db['CmList'][_0xc391('0x4a')]({'where':{'id':_0xa0257d[_0xc391('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xc391('0x6a')}]})[_0xc391('0x2b')](handleEntityNotFound(_0x503b19,null))[_0xc391('0x2b')](function(_0x2403b2){if(_0x2403b2){_0x8726e1=_0x2403b2;return db['CmContact']['rawAttributes'];}})[_0xc391('0x2b')](function(_0x2aea73){if(_0x2aea73){var _0x3e5ae3={};var _0x259e54={};_0x259e54[_0xc391('0x35')]=_[_0xc391('0x6b')](_[_0xc391('0x37')](_0x2aea73),_[_0xc391('0x36')](_0x8726e1[_0xc391('0x6a')],function(_0x5cbdc0){return util[_0xc391('0x6c')](_0xc391('0x6d'),_0x5cbdc0['id']);}));_0x259e54['query']=_[_0xc391('0x37')](_0xa0257d['query']);_0x259e54['filters']=_[_0xc391('0x3a')](_0x259e54[_0xc391('0x35')],_0x259e54[_0xc391('0x38')]);_0x3e5ae3['attributes']=_[_0xc391('0x3a')](_0x259e54[_0xc391('0x35')],qs['fields'](_0xa0257d[_0xc391('0x38')][_0xc391('0x3b')]));_0x3e5ae3['attributes']=_0x3e5ae3[_0xc391('0x3c')]['length']?_0x3e5ae3[_0xc391('0x3c')]:_0x259e54[_0xc391('0x35')];if(!_0xa0257d['query'][_0xc391('0x3e')](_0xc391('0x5a'))){_0x3e5ae3[_0xc391('0x22')]=qs['limit'](_0xa0257d[_0xc391('0x38')]['limit']);_0x3e5ae3['offset']=qs[_0xc391('0x24')](_0xa0257d[_0xc391('0x38')][_0xc391('0x24')]);}_0x3e5ae3[_0xc391('0x3f')]=qs[_0xc391('0x40')](_0xa0257d[_0xc391('0x38')]['sort']);_0x3e5ae3[_0xc391('0x41')]=qs[_0xc391('0x39')](_[_0xc391('0x42')](_0xa0257d['query'],_0x259e54['filters']));_0x3e5ae3[_0xc391('0x6e')]=!![];if(_0xa0257d[_0xc391('0x38')][_0xc391('0x5b')]){_0x3e5ae3['where']=_[_0xc391('0x43')](_0x3e5ae3['where'],{'$or':_[_0xc391('0x36')](_0x3e5ae3['attributes'],function(_0x416030){var _0x7b7f4c={};_0x7b7f4c[_0x416030]={'$like':'%'+_0xa0257d[_0xc391('0x38')][_0xc391('0x5b')]+'%'};return _0x7b7f4c;})});}_0x3e5ae3=_[_0xc391('0x43')]({},_0x3e5ae3,_0xa0257d['options']);return _0x8726e1[_0xc391('0x6f')](_0x3e5ae3);}})[_0xc391('0x2b')](respondWithResult(_0x503b19,null))[_0xc391('0x47')](handleError(_0x503b19,null));};exports[_0xc391('0x70')]=function(_0x5a2eaf,_0x7adfc3,_0x4b142e){var _0x50de1e;var _0x365234;var _0xd79e6f;var _0x9463f8=_0x5a2eaf['params']['id'];csv_results=[];return db[_0xc391('0x71')][_0xc391('0x5d')]({'attributes':['id','name'],'raw':!![],'order':[_0xc391('0x72')]})[_0xc391('0x2b')](function(_0x2518a0){_0x50de1e=_0x2518a0;var _0x4c5288=_[_0xc391('0x37')](db[_0xc391('0x61')][_0xc391('0x32')]);return db[_0xc391('0x73')][_0xc391('0x5d')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x3e22ac){_0x365234=_0x3e22ac;var _0x567fbc=squel[_0xc391('0x74')]()['fields'](_0x4c5288)[_0xc391('0x75')](_0xc391('0x76'),'c')[_0xc391('0x41')]('c.ListId\x20=\x20?',_0x9463f8)[_0xc391('0x41')]('c.deletedAt\x20is\x20null')[_0xc391('0x77')]();for(var _0x1e1095=0x0;_0x1e1095<_0x365234[_0xc391('0x3d')];_0x1e1095++){_0x567fbc[_0xc391('0x78')](_0xc391('0x79')+_0x365234[_0x1e1095]['id'],_0xc391('0x7a')+_0x365234[_0x1e1095]['alias']);}for(var _0x1e1095=0x0;_0x1e1095<_0x50de1e[_0xc391('0x3d')];_0x1e1095++){_0x567fbc[_0xc391('0x78')](squel['select']()[_0xc391('0x78')](_0xc391('0x7b'))['from']('cm_contact_has_items')['where'](_0xc391('0x7c'),_0x50de1e[_0x1e1095]['id'])['where'](_0xc391('0x7d')),_0xc391('0x7e')+_0x50de1e[_0x1e1095][_0xc391('0x30')]);_0x567fbc[_0xc391('0x78')](squel[_0xc391('0x74')]()[_0xc391('0x78')](_0xc391('0x7f'))['from'](_0xc391('0x80'))[_0xc391('0x41')](_0xc391('0x7c'),_0x50de1e[_0x1e1095]['id'])[_0xc391('0x41')](_0xc391('0x7d')),_0xc391('0x81')+_0x50de1e[_0x1e1095][_0xc391('0x30')]);}var _0x4d5c93=[];_0x4d5c93[_0xc391('0x67')](_0x567fbc[_0xc391('0x82')]());BPromise['each'](_0x4d5c93,handleQuery)[_0xc391('0x2b')](function(_0x3da4eb){handleQuery(_0x567fbc['toString']());var _0x508778=csv_results[0x0];if(!_['isEmpty'](_0x508778)){var _0x4345f1=toCsv(_0x508778);var _0x218096=Date[_0xc391('0x83')]();fs[_0xc391('0x84')](util[_0xc391('0x6c')](_0xc391('0x85'),_0x9463f8,_0x218096),_0x4345f1);_0x7adfc3[_0xc391('0x86')](_0xc391('0x87'),_0xc391('0x88')+util[_0xc391('0x6c')](_0xc391('0x89'),_0x9463f8,_0x218096));_0x7adfc3[_0xc391('0x86')](_0xc391('0x8a'),_0xc391('0x8b'));return _0x7adfc3[_0xc391('0x8c')](util[_0xc391('0x6c')](_0xc391('0x85'),_0x9463f8,_0x218096));}else{return _0x7adfc3[_0xc391('0x1e')](0xcc);}});});});};exports[_0xc391('0x8d')]=function(_0x1a9b1f,_0x416ab9,_0x76ad3f){var _0x46fbbd;delete _0x1a9b1f[_0xc391('0x53')]['id'];return db['CmList'][_0xc391('0x59')]({'where':{'id':_0x1a9b1f[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x416ab9,null))['then'](function(_0xd57f0e){if(_0xd57f0e){return db[_0xc391('0x8e')][_0xc391('0x8f')](function(_0x409a3d){return db[_0xc391('0x73')]['create'](_0x1a9b1f[_0xc391('0x53')],{'transaction':_0x409a3d})[_0xc391('0x2b')](function(_0x27e716){_0x46fbbd=_0x27e716;return _0xd57f0e[_0xc391('0x90')](_0x27e716,{'transaction':_0x409a3d});})[_0xc391('0x2b')](function(){var _0xdb74b={'type':db[_0xc391('0x91')][_0xc391('0x92')],'transaction':_0x409a3d};switch(_0x1a9b1f[_0xc391('0x53')]['type']){case'text':_0xdb74b[_0xc391('0x34')]=db[_0xc391('0x91')][_0xc391('0x92')];break;case _0xc391('0x93'):_0xdb74b[_0xc391('0x34')]=db['Sequelize'][_0xc391('0x94')];break;case _0xc391('0x95'):_0xdb74b['type']=db['Sequelize'][_0xc391('0x96')];_0xdb74b[_0xc391('0x97')]=![];break;default:}return db[_0xc391('0x8e')][_0xc391('0x98')][_0xc391('0x99')](_0xc391('0x76'),util['format'](_0xc391('0x9a'),_0x46fbbd['id']),_0xdb74b);})['then'](function(){return _0x46fbbd;});});}})[_0xc391('0x2b')](respondWithResult(_0x416ab9,null))[_0xc391('0x47')](handleError(_0x416ab9,null));};exports['getCustomFields']=function(_0x4dfff5,_0x91e92d,_0x946c61){var _0x581860={};var _0x588502={};var _0x4ea315;var _0x37d521;return db[_0xc391('0x31')][_0xc391('0x59')]({'where':{'id':_0x4dfff5[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x91e92d,null))[_0xc391('0x2b')](function(_0x2eb385){if(_0x2eb385){_0x4ea315=_0x2eb385;_0x588502['model']=_[_0xc391('0x37')](db[_0xc391('0x73')][_0xc391('0x32')]);_0x588502[_0xc391('0x38')]=_['keys'](_0x4dfff5[_0xc391('0x38')]);_0x588502[_0xc391('0x39')]=_[_0xc391('0x3a')](_0x588502[_0xc391('0x35')],_0x588502[_0xc391('0x38')]);_0x581860['attributes']=_['intersection'](_0x588502['model'],qs[_0xc391('0x3b')](_0x4dfff5['query'][_0xc391('0x3b')]));_0x581860['attributes']=_0x581860[_0xc391('0x3c')][_0xc391('0x3d')]?_0x581860[_0xc391('0x3c')]:_0x588502[_0xc391('0x35')];_0x581860['order']=qs[_0xc391('0x40')](_0x4dfff5[_0xc391('0x38')][_0xc391('0x40')]);_0x581860[_0xc391('0x41')]=qs[_0xc391('0x39')](_[_0xc391('0x42')](_0x4dfff5['query'],_0x588502[_0xc391('0x39')]));_0x581860[_0xc391('0x41')]=_[_0xc391('0x43')](_0x581860[_0xc391('0x41')],{'$or':[{'ListId':_0x2eb385['id']},{'ListId':null}]});if(_0x4dfff5['query'][_0xc391('0x5b')]){_0x581860['where']=_[_0xc391('0x43')](_0x581860[_0xc391('0x41')],{'$or':_[_0xc391('0x36')](_0x581860[_0xc391('0x3c')],function(_0x378b7e){var _0x157234={};_0x157234[_0x378b7e]={'$like':'%'+_0x4dfff5[_0xc391('0x38')]['filter']+'%'};return _0x157234;})});}_0x581860=_[_0xc391('0x43')]({},_0x581860,_0x4dfff5[_0xc391('0x5c')]);return db[_0xc391('0x73')][_0xc391('0x9b')](_0x581860);}})['then'](respondWithResult(_0x91e92d,null))[_0xc391('0x47')](handleError(_0x91e92d,null));};exports[_0xc391('0x9c')]=function(_0x1bb75b,_0x5669bd){return db[_0xc391('0x73')][_0xc391('0x9b')]({'where':{'ListId':null}})[_0xc391('0x2b')](handleEntityNotFound(_0x5669bd,null))[_0xc391('0x2b')](function(_0x454bdb){return _0x454bdb;})[_0xc391('0x2b')](respondWithResult(_0x5669bd,null))[_0xc391('0x47')](handleError(_0x5669bd,null));};exports[_0xc391('0x9d')]=function(_0xef8782,_0xa0c40,_0x572e64){return db[_0xc391('0x31')][_0xc391('0x4a')]({'where':{'id':_0xef8782[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0xa0c40,null))[_0xc391('0x2b')](function(_0x3c25b9){if(_0x3c25b9){return _0x3c25b9['addAgents'](_0xef8782['body'][_0xc391('0x5f')],_[_0xc391('0x9e')](_0xef8782[_0xc391('0x53')],[_0xc391('0x5f'),'id'])||{})[_0xc391('0x9f')](function(_0x4b90e1){for(var _0x535c85=0x0;_0x535c85<_0xef8782[_0xc391('0x53')]['ids'][_0xc391('0x3d')];_0x535c85+=0x1){socket[_0xc391('0xa0')]('userCmList:save',{'UserId':Number(_0xef8782[_0xc391('0x53')][_0xc391('0x5f')][_0x535c85]),'CmListId':Number(_0xef8782[_0xc391('0x49')]['id'])});}return _0x4b90e1;});}})[_0xc391('0x2b')](respondWithResult(_0xa0c40,null))[_0xc391('0x47')](handleError(_0xa0c40,null));};exports[_0xc391('0xa1')]=function(_0x397233,_0x338b97,_0xd41cd7){return db['CmList'][_0xc391('0x4a')]({'where':{'id':_0x397233['params']['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x338b97,null))['then'](function(_0x2cd87b){if(_0x2cd87b){return _0x2cd87b['removeAgents'](_0x397233[_0xc391('0x38')][_0xc391('0x5f')])[_0xc391('0x2b')](function(){if(_[_0xc391('0x64')](_0x397233[_0xc391('0x38')][_0xc391('0x5f')])){for(var _0x5367da=0x0;_0x5367da<_0x397233[_0xc391('0x38')][_0xc391('0x5f')][_0xc391('0x3d')];_0x5367da+=0x1){socket[_0xc391('0xa0')](_0xc391('0xa2'),{'UserId':Number(_0x397233[_0xc391('0x38')][_0xc391('0x5f')][_0x5367da]),'CmListId':Number(_0x397233[_0xc391('0x49')]['id'])});}}else{socket[_0xc391('0xa0')](_0xc391('0xa2'),{'UserId':Number(_0x397233[_0xc391('0x38')]['ids']),'CmListId':Number(_0x397233[_0xc391('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x338b97,null))[_0xc391('0x47')](handleError(_0x338b97,null));};exports[_0xc391('0xa3')]=function(_0x643277,_0x167f45,_0x1639e5){var _0x26ce19={};var _0x4380c6={};var _0xddd2b8;var _0x27b5f5;return db['CmList'][_0xc391('0x59')]({'where':{'id':_0x643277[_0xc391('0x49')]['id']}})[_0xc391('0x2b')](handleEntityNotFound(_0x167f45,null))[_0xc391('0x2b')](function(_0x5a7f61){if(_0x5a7f61){_0xddd2b8=_0x5a7f61;_0x4380c6[_0xc391('0x35')]=_['keys'](db[_0xc391('0xa4')][_0xc391('0x32')]);_0x4380c6[_0xc391('0x38')]=_[_0xc391('0x37')](_0x643277[_0xc391('0x38')]);_0x4380c6[_0xc391('0x39')]=_[_0xc391('0x3a')](_0x4380c6[_0xc391('0x35')],_0x4380c6[_0xc391('0x38')]);_0x26ce19[_0xc391('0x3c')]=_[_0xc391('0x3a')](_0x4380c6['model'],qs[_0xc391('0x3b')](_0x643277[_0xc391('0x38')][_0xc391('0x3b')]));_0x26ce19[_0xc391('0x3c')]=_0x26ce19['attributes']['length']?_0x26ce19[_0xc391('0x3c')]:_0x4380c6[_0xc391('0x35')];_0x26ce19[_0xc391('0x3f')]=qs[_0xc391('0x40')](_0x643277[_0xc391('0x38')][_0xc391('0x40')]);_0x26ce19[_0xc391('0x41')]=qs[_0xc391('0x39')](_['pick'](_0x643277[_0xc391('0x38')],_0x4380c6[_0xc391('0x39')]));if(_0x643277[_0xc391('0x38')][_0xc391('0x5b')]){_0x26ce19[_0xc391('0x41')]=_[_0xc391('0x43')](_0x26ce19[_0xc391('0x41')],{'$or':_[_0xc391('0x36')](_0x26ce19[_0xc391('0x3c')],function(_0xfa1148){var _0x9cd408={};_0x9cd408[_0xfa1148]={'$like':'%'+_0x643277[_0xc391('0x38')][_0xc391('0x5b')]+'%'};return _0x9cd408;})});}_0x26ce19=_[_0xc391('0x43')]({},_0x26ce19,_0x643277[_0xc391('0x5c')]);return _0xddd2b8[_0xc391('0xa3')](_0x26ce19);}})['then'](function(_0x4ea923){if(_0x4ea923){_0x27b5f5=_0x4ea923['length'];if(!_0x643277[_0xc391('0x38')][_0xc391('0x3e')]('nolimit')){_0x26ce19[_0xc391('0x22')]=qs[_0xc391('0x22')](_0x643277[_0xc391('0x38')]['limit']);_0x26ce19['offset']=qs['offset'](_0x643277['query'][_0xc391('0x24')]);}return _0xddd2b8[_0xc391('0xa3')](_0x26ce19);}})[_0xc391('0x2b')](function(_0x44ee28){if(_0x44ee28){return _0x44ee28?{'count':_0x27b5f5,'rows':_0x44ee28}:null;}})[_0xc391('0x2b')](respondWithResult(_0x167f45,null))['catch'](handleError(_0x167f45,null));};function handleQuery(_0x3eb803){logger[_0xc391('0xa5')](_0x3eb803);return db['sequelize'][_0xc391('0x38')](_0x3eb803)[_0xc391('0x9f')](function(_0x2206c6){csv_results[_0xc391('0x67')](_0x2206c6);})[_0xc391('0x47')](function(_0xa502df){logger[_0xc391('0xa6')](_0xa502df[_0xc391('0x68')]);});}
\ No newline at end of file
+var _0xc215=['tags','isArray','join','each','ids','success','dataValues','errors','push','message','CmCustomField','CustomFields','CmContact','format','cf_%d','order','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','c.cf_','customField_','alias','field','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','emit','userCmList:save','User','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','get','Lists','destroy','error','stack','name','send','index','CmList','rawAttributes','type','key','query','keys','model','attributes','intersection','length','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','findAll','catch','show','fields','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','getDispositions','findOne','Disposition','hasOwnProperty','include','rows','removeDispositions','addContacts'];(function(_0x67143c,_0x433024){var _0x1dbbc3=function(_0x35a77f){while(--_0x35a77f){_0x67143c['push'](_0x67143c['shift']());}};_0x1dbbc3(++_0x433024);}(_0xc215,0x188));var _0x5c21=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc215[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x5c21('0x0'));var rimraf=require(_0x5c21('0x1'));var zipdir=require(_0x5c21('0x2'));var jsonpatch=require(_0x5c21('0x3'));var rp=require(_0x5c21('0x4'));var moment=require('moment');var BPromise=require(_0x5c21('0x5'));var Mustache=require(_0x5c21('0x6'));var util=require('util');var path=require(_0x5c21('0x7'));var sox=require(_0x5c21('0x8'));var csv=require(_0x5c21('0x9'));var ejs=require(_0x5c21('0xa'));var fs=require('fs');var fs_extra=require(_0x5c21('0xb'));var _=require('lodash');var squel=require(_0x5c21('0xc'));var crypto=require(_0x5c21('0xd'));var jsforce=require(_0x5c21('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c21('0x9'));var querystring=require(_0x5c21('0xf'));var Papa=require(_0x5c21('0x10'));var Redis=require(_0x5c21('0x11'));var authService=require(_0x5c21('0x12'));var qs=require(_0x5c21('0x13'));var as=require(_0x5c21('0x14'));var hardwareService=require(_0x5c21('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5c21('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5c21('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config['redis']=_[_0x5c21('0x18')](config['redis'],{'host':_0x5c21('0x19'),'port':0x18eb});var socket=require(_0x5c21('0x1a'))(new Redis(config['redis']));require(_0x5c21('0x1b'))[_0x5c21('0x1c')](socket);function respondWithStatusCode(_0x3eefe7,_0x5735a5){_0x5735a5=_0x5735a5||0xcc;return function(_0x20cd26){if(_0x20cd26){return _0x3eefe7[_0x5c21('0x1d')](_0x5735a5);}return _0x3eefe7[_0x5c21('0x1e')](_0x5735a5)[_0x5c21('0x1f')]();};}function respondWithResult(_0x1e8c3c,_0x3ec52b){_0x3ec52b=_0x3ec52b||0xc8;return function(_0x498b3d){if(_0x498b3d){return _0x1e8c3c['status'](_0x3ec52b)[_0x5c21('0x20')](_0x498b3d);}};}function respondWithFilteredResult(_0xac8716,_0x1e1820){return function(_0x26c021){if(_0x26c021){var _0x16f58a=typeof _0x1e1820[_0x5c21('0x21')]==='undefined'&&typeof _0x1e1820[_0x5c21('0x22')]==='undefined';var _0x39a448=_0x26c021[_0x5c21('0x23')];var _0x538899=_0x16f58a?0x0:_0x1e1820[_0x5c21('0x21')];var _0x257c2f=_0x16f58a?_0x26c021[_0x5c21('0x23')]:_0x1e1820[_0x5c21('0x21')]+_0x1e1820['limit'];var _0x30b91e;if(_0x257c2f>=_0x39a448){_0x257c2f=_0x39a448;_0x30b91e=0xc8;}else{_0x30b91e=0xce;}_0xac8716['status'](_0x30b91e);return _0xac8716[_0x5c21('0x24')]('Content-Range',_0x538899+'-'+_0x257c2f+'/'+_0x39a448)[_0x5c21('0x20')](_0x26c021);}return null;};}function patchUpdates(_0x40cc6e){return function(_0x5143c2){try{jsonpatch[_0x5c21('0x25')](_0x5143c2,_0x40cc6e,!![]);}catch(_0x37ac08){return BPromise[_0x5c21('0x26')](_0x37ac08);}return _0x5143c2[_0x5c21('0x27')]();};}function saveUpdates(_0x1a1352,_0xd4c28b){return function(_0x5d0d0b){if(_0x5d0d0b){return _0x5d0d0b[_0x5c21('0x28')](_0x1a1352)[_0x5c21('0x29')](function(_0x5b5c33){return _0x5b5c33;});}return null;};}function removeEntity(_0x5e37cd,_0xe9efe8){return function(_0x54e4ca){if(_0x54e4ca){return _0x54e4ca['destroy']()['then'](function(){var _0x1c6409=_0x54e4ca[_0x5c21('0x2a')]({'plain':!![]});var _0x4f7056=_0x5c21('0x2b');return db['UserProfileResource'][_0x5c21('0x2c')]({'where':{'type':_0x4f7056,'resourceId':_0x1c6409['id']}})[_0x5c21('0x29')](function(){return _0x54e4ca;});})[_0x5c21('0x29')](function(){_0x5e37cd[_0x5c21('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46bb65,_0x4cd6d7){return function(_0x5ca56a){if(!_0x5ca56a){_0x46bb65[_0x5c21('0x1d')](0x194);}return _0x5ca56a;};}function handleError(_0x16830c,_0x11bfed){_0x11bfed=_0x11bfed||0x1f4;return function(_0x3e180c){logger[_0x5c21('0x2d')](_0x3e180c[_0x5c21('0x2e')]);if(_0x3e180c[_0x5c21('0x2f')]){delete _0x3e180c[_0x5c21('0x2f')];}_0x16830c['status'](_0x11bfed)[_0x5c21('0x30')](_0x3e180c);};}exports[_0x5c21('0x31')]=function(_0x829547,_0x4e0d35){var _0xb7f155={},_0x3ba4cb={},_0x227525={'count':0x0,'rows':[]};var _0xb0eed6=_['map'](db[_0x5c21('0x32')][_0x5c21('0x33')],function(_0x579f92){return{'name':_0x579f92['fieldName'],'type':_0x579f92[_0x5c21('0x34')][_0x5c21('0x35')]};});_0x3ba4cb['model']=_['map'](_0xb0eed6,'name');_0x3ba4cb[_0x5c21('0x36')]=_[_0x5c21('0x37')](_0x829547[_0x5c21('0x36')]);_0x3ba4cb['filters']=_['intersection'](_0x3ba4cb[_0x5c21('0x38')],_0x3ba4cb[_0x5c21('0x36')]);_0xb7f155[_0x5c21('0x39')]=_[_0x5c21('0x3a')](_0x3ba4cb[_0x5c21('0x38')],qs['fields'](_0x829547[_0x5c21('0x36')]['fields']));_0xb7f155[_0x5c21('0x39')]=_0xb7f155['attributes'][_0x5c21('0x3b')]?_0xb7f155['attributes']:_0x3ba4cb[_0x5c21('0x38')];if(!_0x829547[_0x5c21('0x36')]['hasOwnProperty'](_0x5c21('0x3c'))){_0xb7f155[_0x5c21('0x22')]=qs[_0x5c21('0x22')](_0x829547['query'][_0x5c21('0x22')]);_0xb7f155[_0x5c21('0x21')]=qs[_0x5c21('0x21')](_0x829547[_0x5c21('0x36')][_0x5c21('0x21')]);}_0xb7f155['order']=qs[_0x5c21('0x3d')](_0x829547[_0x5c21('0x36')]['sort']);_0xb7f155['where']=qs[_0x5c21('0x3e')](_[_0x5c21('0x3f')](_0x829547[_0x5c21('0x36')],_0x3ba4cb[_0x5c21('0x3e')]),_0xb0eed6);if(_0x829547['query'][_0x5c21('0x40')]){_0xb7f155[_0x5c21('0x41')]=_[_0x5c21('0x42')](_0xb7f155[_0x5c21('0x41')],{'$or':_[_0x5c21('0x43')](_0xb0eed6,function(_0x370c84){if(_0x370c84[_0x5c21('0x34')]!==_0x5c21('0x44')){var _0x35696d={};_0x35696d[_0x370c84[_0x5c21('0x2f')]]={'$like':'%'+_0x829547['query'][_0x5c21('0x40')]+'%'};return _0x35696d;}})});}_0xb7f155=_[_0x5c21('0x42')]({},_0xb7f155,_0x829547['options']);var _0x238576={'where':_0xb7f155[_0x5c21('0x41')]};return db[_0x5c21('0x32')][_0x5c21('0x23')](_0x238576)[_0x5c21('0x29')](function(_0x578658){_0x227525[_0x5c21('0x23')]=_0x578658;if(_0x829547[_0x5c21('0x36')]['includeAll']){_0xb7f155['include']=[{'all':!![]}];}return db[_0x5c21('0x32')][_0x5c21('0x45')](_0xb7f155);})[_0x5c21('0x29')](function(_0x544dd7){_0x227525['rows']=_0x544dd7;return _0x227525;})[_0x5c21('0x29')](respondWithFilteredResult(_0x4e0d35,_0xb7f155))[_0x5c21('0x46')](handleError(_0x4e0d35,null));};exports[_0x5c21('0x47')]=function(_0x453815,_0x23164c){var _0x5e97e8={'raw':![],'where':{'id':_0x453815['params']['id']}},_0x497388={};_0x497388[_0x5c21('0x38')]=_[_0x5c21('0x37')](db[_0x5c21('0x32')][_0x5c21('0x33')]);_0x497388['query']=_[_0x5c21('0x37')](_0x453815[_0x5c21('0x36')]);_0x497388[_0x5c21('0x3e')]=_['intersection'](_0x497388[_0x5c21('0x38')],_0x497388[_0x5c21('0x36')]);_0x5e97e8[_0x5c21('0x39')]=_[_0x5c21('0x3a')](_0x497388[_0x5c21('0x38')],qs[_0x5c21('0x48')](_0x453815['query'][_0x5c21('0x48')]));_0x5e97e8[_0x5c21('0x39')]=_0x5e97e8['attributes']['length']?_0x5e97e8[_0x5c21('0x39')]:_0x497388['model'];if(_0x453815[_0x5c21('0x36')][_0x5c21('0x49')]){_0x5e97e8['include']=[{'all':!![]}];}_0x5e97e8=_[_0x5c21('0x42')]({},_0x5e97e8,_0x453815[_0x5c21('0x4a')]);return db[_0x5c21('0x32')][_0x5c21('0x4b')](_0x5e97e8)[_0x5c21('0x29')](handleEntityNotFound(_0x23164c,null))[_0x5c21('0x29')](respondWithResult(_0x23164c,null))[_0x5c21('0x46')](handleError(_0x23164c,null));};exports['create']=function(_0x154eaf,_0x2858df){return db[_0x5c21('0x32')][_0x5c21('0x4c')](_0x154eaf[_0x5c21('0x4d')],{})[_0x5c21('0x29')](function(_0x55d94f){var _0x3359ed=_0x154eaf[_0x5c21('0x4e')][_0x5c21('0x2a')]({'plain':!![]});if(!_0x3359ed)throw new Error(_0x5c21('0x4f'));if(_0x3359ed[_0x5c21('0x50')]===_0x5c21('0x4e')){var _0x56bdc9=_0x55d94f[_0x5c21('0x2a')]({'plain':!![]});var _0x5f1254=_0x5c21('0x2b');return db[_0x5c21('0x51')][_0x5c21('0x4b')]({'where':{'name':_0x5f1254,'userProfileId':_0x3359ed[_0x5c21('0x52')]},'raw':!![]})['then'](function(_0xe4d63d){if(_0xe4d63d&&_0xe4d63d[_0x5c21('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x56bdc9[_0x5c21('0x2f')],'resourceId':_0x56bdc9['id'],'type':_0xe4d63d[_0x5c21('0x2f')],'sectionId':_0xe4d63d['id']},{})[_0x5c21('0x29')](function(){return _0x55d94f;});}else{return _0x55d94f;}})[_0x5c21('0x46')](function(_0x447e47){logger['error'](_0x5c21('0x54'),_0x447e47);throw _0x447e47;});}return _0x55d94f;})['then'](respondWithResult(_0x2858df,0xc9))[_0x5c21('0x46')](handleError(_0x2858df,null));};exports[_0x5c21('0x28')]=function(_0x5701ec,_0x2dd3a6){if(_0x5701ec['body']['id']){delete _0x5701ec['body']['id'];}return db[_0x5c21('0x32')][_0x5c21('0x4b')]({'where':{'id':_0x5701ec['params']['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x2dd3a6,null))['then'](saveUpdates(_0x5701ec['body'],null))[_0x5c21('0x29')](respondWithResult(_0x2dd3a6,null))[_0x5c21('0x46')](handleError(_0x2dd3a6,null));};exports[_0x5c21('0x2c')]=function(_0x156f18,_0x305cc9){return db[_0x5c21('0x32')][_0x5c21('0x4b')]({'where':{'id':_0x156f18[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x305cc9,null))[_0x5c21('0x29')](removeEntity(_0x305cc9,null))[_0x5c21('0x46')](handleError(_0x305cc9,null));};exports[_0x5c21('0x56')]=function(_0x27c035,_0x1fae3b){return db[_0x5c21('0x32')][_0x5c21('0x56')]()[_0x5c21('0x29')](respondWithResult(_0x1fae3b,null))[_0x5c21('0x46')](handleError(_0x1fae3b,null));};exports[_0x5c21('0x57')]=function(_0x198ba9,_0x257e4f,_0x435458){if(_0x198ba9[_0x5c21('0x4d')]['id']){delete _0x198ba9[_0x5c21('0x4d')]['id'];}return db[_0x5c21('0x32')]['find']({'where':{'id':_0x198ba9[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x257e4f,null))[_0x5c21('0x29')](function(_0x76d5f1){if(_0x76d5f1){_0x198ba9['body'][_0x5c21('0x58')]=_0x76d5f1['id'];return db['Disposition'][_0x5c21('0x4c')](_0x198ba9[_0x5c21('0x4d')]);}})[_0x5c21('0x29')](respondWithResult(_0x257e4f,null))[_0x5c21('0x46')](handleError(_0x257e4f,null));};exports[_0x5c21('0x59')]=function(_0x4285bf,_0x425aff,_0xecfce5){var _0x1ca9f4={'raw':![],'where':{}};var _0x494517={};var _0x549a0c={'count':0x0,'rows':[]};return db['CmList'][_0x5c21('0x5a')]({'where':{'id':_0x4285bf[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x425aff,null))[_0x5c21('0x29')](function(_0xad1851){if(_0xad1851){_0x494517[_0x5c21('0x38')]=_[_0x5c21('0x37')](db[_0x5c21('0x5b')][_0x5c21('0x33')]);_0x494517[_0x5c21('0x36')]=_[_0x5c21('0x37')](_0x4285bf[_0x5c21('0x36')]);_0x494517[_0x5c21('0x3e')]=_[_0x5c21('0x3a')](_0x494517[_0x5c21('0x38')],_0x494517['query']);_0x1ca9f4[_0x5c21('0x39')]=_['intersection'](_0x494517[_0x5c21('0x38')],qs[_0x5c21('0x48')](_0x4285bf[_0x5c21('0x36')][_0x5c21('0x48')]));_0x1ca9f4[_0x5c21('0x39')]=_0x1ca9f4['attributes'][_0x5c21('0x3b')]?_0x1ca9f4['attributes']:_0x494517[_0x5c21('0x38')];if(!_0x4285bf[_0x5c21('0x36')][_0x5c21('0x5c')]('nolimit')){_0x1ca9f4['limit']=qs['limit'](_0x4285bf[_0x5c21('0x36')][_0x5c21('0x22')]);_0x1ca9f4[_0x5c21('0x21')]=qs[_0x5c21('0x21')](_0x4285bf[_0x5c21('0x36')][_0x5c21('0x21')]);}_0x1ca9f4['order']=qs[_0x5c21('0x3d')](_0x4285bf[_0x5c21('0x36')][_0x5c21('0x3d')]);_0x1ca9f4['where']=qs[_0x5c21('0x3e')](_[_0x5c21('0x3f')](_0x4285bf[_0x5c21('0x36')],_0x494517[_0x5c21('0x3e')]));_0x1ca9f4[_0x5c21('0x41')]['ListId']=_0xad1851['id'];if(_0x4285bf[_0x5c21('0x36')][_0x5c21('0x40')]){_0x1ca9f4[_0x5c21('0x41')]=_[_0x5c21('0x42')](_0x1ca9f4['where'],{'$or':_[_0x5c21('0x43')](_0x1ca9f4[_0x5c21('0x39')],function(_0x18646d){var _0x4741af={};_0x4741af[_0x18646d]={'$like':'%'+_0x4285bf[_0x5c21('0x36')][_0x5c21('0x40')]+'%'};return _0x4741af;})});}_0x1ca9f4=_[_0x5c21('0x42')]({},_0x1ca9f4,_0x4285bf[_0x5c21('0x4a')]);return db[_0x5c21('0x5b')]['count']({'where':_0x1ca9f4[_0x5c21('0x41')]})[_0x5c21('0x29')](function(_0x32dd19){_0x549a0c[_0x5c21('0x23')]=_0x32dd19;if(_0x4285bf['query'][_0x5c21('0x49')]){_0x1ca9f4[_0x5c21('0x5d')]=[{'all':!![]}];}return db[_0x5c21('0x5b')][_0x5c21('0x45')](_0x1ca9f4);})[_0x5c21('0x29')](function(_0x45f97b){_0x549a0c[_0x5c21('0x5e')]=_0x45f97b;return _0x549a0c;});}})[_0x5c21('0x29')](respondWithFilteredResult(_0x425aff,_0x1ca9f4))[_0x5c21('0x46')](handleError(_0x425aff,null));};exports[_0x5c21('0x5f')]=function(_0x1b1d76,_0x4927df,_0x55e1fc){return db[_0x5c21('0x32')][_0x5c21('0x4b')]({'where':{'id':_0x1b1d76[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x4927df,null))[_0x5c21('0x29')](function(_0x4e8628){if(_0x4e8628){return _0x4e8628[_0x5c21('0x5f')](_0x1b1d76[_0x5c21('0x36')]['ids']);}})[_0x5c21('0x29')](respondWithStatusCode(_0x4927df,null))['catch'](handleError(_0x4927df,null));};exports[_0x5c21('0x60')]=function(_0x4a3d68,_0xebb046,_0x1a10cc){return db[_0x5c21('0x32')]['find']({'where':{'id':_0x4a3d68[_0x5c21('0x55')]['id']}})['then'](handleEntityNotFound(_0xebb046,null))['then'](function(_0x5e682f){if(_0x5e682f){var _0x5f21a5=[];var _0xfebbb7={'success':[],'errors':[]};return db['CmContact'][_0x5c21('0x56')]()[_0x5c21('0x29')](function(_0x3cb1a5){if(_0x4a3d68[_0x5c21('0x4d')][_0x5c21('0x61')]&&_[_0x5c21('0x62')](_0x4a3d68[_0x5c21('0x4d')]['tags'])){if(_0x4a3d68[_0x5c21('0x4d')][_0x5c21('0x61')]['length']){_0x4a3d68[_0x5c21('0x4d')][_0x5c21('0x61')]=_0x4a3d68[_0x5c21('0x4d')][_0x5c21('0x61')][_0x5c21('0x63')](';')+';';}else{_0x4a3d68['body'][_0x5c21('0x61')]=null;}}else{_0x4a3d68[_0x5c21('0x4d')][_0x5c21('0x61')]=null;}if(_0x4a3d68[_0x5c21('0x4d')]&&_[_0x5c21('0x62')](_0x4a3d68[_0x5c21('0x4d')])){for(var _0x805f73=0x0;_0x805f73<_0x4a3d68[_0x5c21('0x4d')][_0x5c21('0x3b')];_0x805f73+=0x1){_0x4a3d68[_0x5c21('0x4d')][_0x805f73][_0x5c21('0x58')]=_0x4a3d68[_0x5c21('0x55')]['id'];_0x5f21a5['push'](_0x4a3d68[_0x5c21('0x4d')][_0x805f73]);}return BPromise[_0x5c21('0x64')](_0x5f21a5,function(_0x4483e9){return db['CmContact'][_0x5c21('0x4c')](_['omit'](_0x4483e9,[_0x5c21('0x65'),'id'])||{},{'fields':_[_0x5c21('0x37')](_0x3cb1a5),'raw':!![]})[_0x5c21('0x29')](function(_0xfb25b0){_0xfebbb7[_0x5c21('0x66')]['push'](_0xfb25b0[_0x5c21('0x67')]);})[_0x5c21('0x46')](function(_0x3860d9){_0xfebbb7[_0x5c21('0x68')][_0x5c21('0x69')]({'data':_0x4483e9,'error':_0x3860d9[_0x5c21('0x6a')]});});})[_0x5c21('0x29')](function(_0x1d8691){return _0xfebbb7;})[_0x5c21('0x46')](function(_0x52a01a){return _0x52a01a;});}else{_0xebb046[_0x5c21('0x1e')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x5c21('0x29')](respondWithResult(_0xebb046,null))['catch'](handleError(_0xebb046,null));};exports['getContacts']=function(_0xe5a4d3,_0x584486,_0x17843e){var _0x3d9869;return db['CmList'][_0x5c21('0x4b')]({'where':{'id':_0xe5a4d3['params']['id']},'include':[{'model':db[_0x5c21('0x6b')],'as':_0x5c21('0x6c')}]})[_0x5c21('0x29')](handleEntityNotFound(_0x584486,null))[_0x5c21('0x29')](function(_0x5a429a){if(_0x5a429a){_0x3d9869=_0x5a429a;return db[_0x5c21('0x6d')][_0x5c21('0x33')];}})[_0x5c21('0x29')](function(_0x4ce25d){if(_0x4ce25d){var _0x38a4b9={};var _0x51893a={};_0x51893a[_0x5c21('0x38')]=_['concat'](_[_0x5c21('0x37')](_0x4ce25d),_['map'](_0x3d9869[_0x5c21('0x6c')],function(_0x4ec9a6){return util[_0x5c21('0x6e')](_0x5c21('0x6f'),_0x4ec9a6['id']);}));_0x51893a[_0x5c21('0x36')]=_[_0x5c21('0x37')](_0xe5a4d3[_0x5c21('0x36')]);_0x51893a[_0x5c21('0x3e')]=_[_0x5c21('0x3a')](_0x51893a[_0x5c21('0x38')],_0x51893a[_0x5c21('0x36')]);_0x38a4b9[_0x5c21('0x39')]=_[_0x5c21('0x3a')](_0x51893a[_0x5c21('0x38')],qs[_0x5c21('0x48')](_0xe5a4d3[_0x5c21('0x36')]['fields']));_0x38a4b9[_0x5c21('0x39')]=_0x38a4b9['attributes']['length']?_0x38a4b9[_0x5c21('0x39')]:_0x51893a[_0x5c21('0x38')];if(!_0xe5a4d3[_0x5c21('0x36')][_0x5c21('0x5c')]('nolimit')){_0x38a4b9['limit']=qs['limit'](_0xe5a4d3['query'][_0x5c21('0x22')]);_0x38a4b9[_0x5c21('0x21')]=qs[_0x5c21('0x21')](_0xe5a4d3[_0x5c21('0x36')][_0x5c21('0x21')]);}_0x38a4b9[_0x5c21('0x70')]=qs[_0x5c21('0x3d')](_0xe5a4d3[_0x5c21('0x36')][_0x5c21('0x3d')]);_0x38a4b9[_0x5c21('0x41')]=qs[_0x5c21('0x3e')](_[_0x5c21('0x3f')](_0xe5a4d3['query'],_0x51893a[_0x5c21('0x3e')]));_0x38a4b9[_0x5c21('0x71')]=!![];if(_0xe5a4d3[_0x5c21('0x36')]['filter']){_0x38a4b9[_0x5c21('0x41')]=_[_0x5c21('0x42')](_0x38a4b9[_0x5c21('0x41')],{'$or':_[_0x5c21('0x43')](_0x38a4b9[_0x5c21('0x39')],function(_0x537d71){var _0x34458f={};_0x34458f[_0x537d71]={'$like':'%'+_0xe5a4d3[_0x5c21('0x36')][_0x5c21('0x40')]+'%'};return _0x34458f;})});}_0x38a4b9=_['merge']({},_0x38a4b9,_0xe5a4d3[_0x5c21('0x4a')]);return _0x3d9869[_0x5c21('0x72')](_0x38a4b9);}})[_0x5c21('0x29')](respondWithResult(_0x584486,null))['catch'](handleError(_0x584486,null));};exports[_0x5c21('0x73')]=function(_0x240af6,_0x4c4cda,_0xbc795e){var _0x39d54f;var _0x2ce51b;var _0x2b7adc;var _0x17facd=_0x240af6[_0x5c21('0x55')]['id'];csv_results=[];return db[_0x5c21('0x74')][_0x5c21('0x45')]({'attributes':['id','name'],'raw':!![],'order':[_0x5c21('0x75')]})['then'](function(_0x49c4c3){_0x39d54f=_0x49c4c3;var _0x9d60cf=_[_0x5c21('0x37')](db[_0x5c21('0x6d')][_0x5c21('0x33')]);return db[_0x5c21('0x6b')][_0x5c21('0x45')]({'raw':!![],'attributes':['id','alias']})[_0x5c21('0x29')](function(_0x3b0150){_0x2ce51b=_0x3b0150;var _0x5661bf=squel[_0x5c21('0x76')]()['fields'](_0x9d60cf)[_0x5c21('0x77')](_0x5c21('0x78'),'c')[_0x5c21('0x41')](_0x5c21('0x79'),_0x17facd)[_0x5c21('0x41')](_0x5c21('0x7a'))['distinct']();for(var _0x40cf76=0x0;_0x40cf76<_0x2ce51b[_0x5c21('0x3b')];_0x40cf76++){_0x5661bf['field'](_0x5c21('0x7b')+_0x2ce51b[_0x40cf76]['id'],_0x5c21('0x7c')+_0x2ce51b[_0x40cf76][_0x5c21('0x7d')]);}for(var _0x40cf76=0x0;_0x40cf76<_0x39d54f['length'];_0x40cf76++){_0x5661bf[_0x5c21('0x7e')](squel[_0x5c21('0x76')]()[_0x5c21('0x7e')]('item')[_0x5c21('0x77')](_0x5c21('0x7f'))[_0x5c21('0x41')](_0x5c21('0x80'),_0x39d54f[_0x40cf76]['id'])[_0x5c21('0x41')](_0x5c21('0x81')),_0x5c21('0x82')+_0x39d54f[_0x40cf76]['name']);_0x5661bf[_0x5c21('0x7e')](squel[_0x5c21('0x76')]()[_0x5c21('0x7e')](_0x5c21('0x83'))[_0x5c21('0x77')]('cm_contact_has_items')['where'](_0x5c21('0x80'),_0x39d54f[_0x40cf76]['id'])[_0x5c21('0x41')](_0x5c21('0x81')),_0x5c21('0x84')+_0x39d54f[_0x40cf76][_0x5c21('0x2f')]);}var _0x2c6dfc=[];_0x2c6dfc[_0x5c21('0x69')](_0x5661bf[_0x5c21('0x85')]());BPromise[_0x5c21('0x64')](_0x2c6dfc,handleQuery)[_0x5c21('0x29')](function(_0xf0388f){handleQuery(_0x5661bf[_0x5c21('0x85')]());var _0x46e912=csv_results[0x0];if(!_[_0x5c21('0x86')](_0x46e912)){var _0x1d42b8=toCsv(_0x46e912);var _0x44737c=Date[_0x5c21('0x87')]();fs[_0x5c21('0x88')](util[_0x5c21('0x6e')]('/tmp/list_%d_%s.csv',_0x17facd,_0x44737c),_0x1d42b8);_0x4c4cda[_0x5c21('0x89')]('Content-disposition',_0x5c21('0x8a')+util[_0x5c21('0x6e')](_0x5c21('0x8b'),_0x17facd,_0x44737c));_0x4c4cda[_0x5c21('0x89')](_0x5c21('0x8c'),_0x5c21('0x8d'));return _0x4c4cda['download'](util[_0x5c21('0x6e')]('/tmp/list_%d_%s.csv',_0x17facd,_0x44737c));}else{return _0x4c4cda[_0x5c21('0x1d')](0xcc);}});});});};exports[_0x5c21('0x8e')]=function(_0x32b930,_0x39f276,_0x496a06){var _0x5b6e76;delete _0x32b930[_0x5c21('0x4d')]['id'];return db[_0x5c21('0x32')][_0x5c21('0x5a')]({'where':{'id':_0x32b930[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x39f276,null))[_0x5c21('0x29')](function(_0x4e120a){if(_0x4e120a){return db[_0x5c21('0x8f')]['transaction'](function(_0x5ad985){return db[_0x5c21('0x6b')]['create'](_0x32b930[_0x5c21('0x4d')],{'transaction':_0x5ad985})[_0x5c21('0x29')](function(_0x6b9605){_0x5b6e76=_0x6b9605;return _0x4e120a[_0x5c21('0x90')](_0x6b9605,{'transaction':_0x5ad985});})[_0x5c21('0x29')](function(){var _0x7071ce={'type':db[_0x5c21('0x91')]['TEXT'],'transaction':_0x5ad985};switch(_0x32b930[_0x5c21('0x4d')]['type']){case _0x5c21('0x92'):_0x7071ce[_0x5c21('0x34')]=db[_0x5c21('0x91')][_0x5c21('0x93')];break;case _0x5c21('0x94'):_0x7071ce[_0x5c21('0x34')]=db[_0x5c21('0x91')][_0x5c21('0x95')];break;case'switch':_0x7071ce[_0x5c21('0x34')]=db['Sequelize'][_0x5c21('0x96')];_0x7071ce[_0x5c21('0x97')]=![];break;default:}return db[_0x5c21('0x8f')]['queryInterface'][_0x5c21('0x98')](_0x5c21('0x78'),util[_0x5c21('0x6e')](_0x5c21('0x99'),_0x5b6e76['id']),_0x7071ce);})[_0x5c21('0x29')](function(){return _0x5b6e76;});});}})[_0x5c21('0x29')](respondWithResult(_0x39f276,null))[_0x5c21('0x46')](handleError(_0x39f276,null));};exports[_0x5c21('0x9a')]=function(_0x5f7867,_0x5e6e34,_0x1b8bcd){var _0x3228b4={};var _0x335ddd={};var _0xe537ca;var _0x2a2dc5;return db['CmList']['findOne']({'where':{'id':_0x5f7867[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x5e6e34,null))[_0x5c21('0x29')](function(_0x3ad8cb){if(_0x3ad8cb){_0xe537ca=_0x3ad8cb;_0x335ddd['model']=_[_0x5c21('0x37')](db[_0x5c21('0x6b')][_0x5c21('0x33')]);_0x335ddd['query']=_[_0x5c21('0x37')](_0x5f7867[_0x5c21('0x36')]);_0x335ddd[_0x5c21('0x3e')]=_[_0x5c21('0x3a')](_0x335ddd[_0x5c21('0x38')],_0x335ddd[_0x5c21('0x36')]);_0x3228b4[_0x5c21('0x39')]=_['intersection'](_0x335ddd[_0x5c21('0x38')],qs[_0x5c21('0x48')](_0x5f7867[_0x5c21('0x36')][_0x5c21('0x48')]));_0x3228b4[_0x5c21('0x39')]=_0x3228b4[_0x5c21('0x39')]['length']?_0x3228b4[_0x5c21('0x39')]:_0x335ddd[_0x5c21('0x38')];_0x3228b4[_0x5c21('0x70')]=qs[_0x5c21('0x3d')](_0x5f7867[_0x5c21('0x36')][_0x5c21('0x3d')]);_0x3228b4[_0x5c21('0x41')]=qs['filters'](_[_0x5c21('0x3f')](_0x5f7867[_0x5c21('0x36')],_0x335ddd[_0x5c21('0x3e')]));_0x3228b4['where']=_[_0x5c21('0x42')](_0x3228b4[_0x5c21('0x41')],{'$or':[{'ListId':_0x3ad8cb['id']},{'ListId':null}]});if(_0x5f7867[_0x5c21('0x36')][_0x5c21('0x40')]){_0x3228b4[_0x5c21('0x41')]=_['merge'](_0x3228b4[_0x5c21('0x41')],{'$or':_[_0x5c21('0x43')](_0x3228b4[_0x5c21('0x39')],function(_0x2dee4b){var _0x1e9dc1={};_0x1e9dc1[_0x2dee4b]={'$like':'%'+_0x5f7867[_0x5c21('0x36')][_0x5c21('0x40')]+'%'};return _0x1e9dc1;})});}_0x3228b4=_[_0x5c21('0x42')]({},_0x3228b4,_0x5f7867[_0x5c21('0x4a')]);return db['CmCustomField'][_0x5c21('0x9b')](_0x3228b4);}})[_0x5c21('0x29')](respondWithResult(_0x5e6e34,null))[_0x5c21('0x46')](handleError(_0x5e6e34,null));};exports['getGlobalCustomFields']=function(_0x3c0c81,_0x1fa0e8){return db[_0x5c21('0x6b')]['findAndCountAll']({'where':{'ListId':null}})[_0x5c21('0x29')](handleEntityNotFound(_0x1fa0e8,null))[_0x5c21('0x29')](function(_0x33432a){return _0x33432a;})['then'](respondWithResult(_0x1fa0e8,null))[_0x5c21('0x46')](handleError(_0x1fa0e8,null));};exports[_0x5c21('0x9c')]=function(_0x56d2fd,_0x101312,_0x11a385){return db[_0x5c21('0x32')]['find']({'where':{'id':_0x56d2fd[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x101312,null))[_0x5c21('0x29')](function(_0x47fc7f){if(_0x47fc7f){return _0x47fc7f['addAgents'](_0x56d2fd['body'][_0x5c21('0x65')],_[_0x5c21('0x9d')](_0x56d2fd[_0x5c21('0x4d')],['ids','id'])||{})['spread'](function(_0x3d40f2){for(var _0x1cea14=0x0;_0x1cea14<_0x56d2fd[_0x5c21('0x4d')][_0x5c21('0x65')][_0x5c21('0x3b')];_0x1cea14+=0x1){socket[_0x5c21('0x9e')](_0x5c21('0x9f'),{'UserId':Number(_0x56d2fd[_0x5c21('0x4d')][_0x5c21('0x65')][_0x1cea14]),'CmListId':Number(_0x56d2fd[_0x5c21('0x55')]['id'])});}return _0x3d40f2;});}})['then'](respondWithResult(_0x101312,null))['catch'](handleError(_0x101312,null));};exports['removeAgents']=function(_0xe55621,_0x3a1a8b,_0x7e8da4){return db['CmList'][_0x5c21('0x4b')]({'where':{'id':_0xe55621[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x3a1a8b,null))[_0x5c21('0x29')](function(_0x3c047b){if(_0x3c047b){return _0x3c047b['removeAgents'](_0xe55621[_0x5c21('0x36')][_0x5c21('0x65')])[_0x5c21('0x29')](function(){if(_['isArray'](_0xe55621[_0x5c21('0x36')]['ids'])){for(var _0x4437a0=0x0;_0x4437a0<_0xe55621[_0x5c21('0x36')][_0x5c21('0x65')][_0x5c21('0x3b')];_0x4437a0+=0x1){socket[_0x5c21('0x9e')]('userCmList:remove',{'UserId':Number(_0xe55621['query'][_0x5c21('0x65')][_0x4437a0]),'CmListId':Number(_0xe55621[_0x5c21('0x55')]['id'])});}}else{socket[_0x5c21('0x9e')]('userCmList:remove',{'UserId':Number(_0xe55621[_0x5c21('0x36')]['ids']),'CmListId':Number(_0xe55621[_0x5c21('0x55')]['id'])});}});}})[_0x5c21('0x29')](respondWithStatusCode(_0x3a1a8b,null))['catch'](handleError(_0x3a1a8b,null));};exports['getAgents']=function(_0x40b98b,_0x387e48,_0x18fbe6){var _0x2991d3={};var _0x47fc29={};var _0x4260e2;var _0x53f4fd;return db[_0x5c21('0x32')][_0x5c21('0x5a')]({'where':{'id':_0x40b98b[_0x5c21('0x55')]['id']}})[_0x5c21('0x29')](handleEntityNotFound(_0x387e48,null))[_0x5c21('0x29')](function(_0x10794e){if(_0x10794e){_0x4260e2=_0x10794e;_0x47fc29[_0x5c21('0x38')]=_['keys'](db[_0x5c21('0xa0')]['rawAttributes']);_0x47fc29[_0x5c21('0x36')]=_['keys'](_0x40b98b[_0x5c21('0x36')]);_0x47fc29[_0x5c21('0x3e')]=_[_0x5c21('0x3a')](_0x47fc29[_0x5c21('0x38')],_0x47fc29['query']);_0x2991d3[_0x5c21('0x39')]=_[_0x5c21('0x3a')](_0x47fc29[_0x5c21('0x38')],qs[_0x5c21('0x48')](_0x40b98b[_0x5c21('0x36')][_0x5c21('0x48')]));_0x2991d3[_0x5c21('0x39')]=_0x2991d3[_0x5c21('0x39')][_0x5c21('0x3b')]?_0x2991d3['attributes']:_0x47fc29['model'];_0x2991d3['order']=qs[_0x5c21('0x3d')](_0x40b98b['query']['sort']);_0x2991d3[_0x5c21('0x41')]=qs[_0x5c21('0x3e')](_[_0x5c21('0x3f')](_0x40b98b[_0x5c21('0x36')],_0x47fc29[_0x5c21('0x3e')]));if(_0x40b98b[_0x5c21('0x36')][_0x5c21('0x40')]){_0x2991d3[_0x5c21('0x41')]=_['merge'](_0x2991d3['where'],{'$or':_[_0x5c21('0x43')](_0x2991d3[_0x5c21('0x39')],function(_0x5e0192){var _0x516119={};_0x516119[_0x5e0192]={'$like':'%'+_0x40b98b[_0x5c21('0x36')]['filter']+'%'};return _0x516119;})});}_0x2991d3=_[_0x5c21('0x42')]({},_0x2991d3,_0x40b98b[_0x5c21('0x4a')]);return _0x4260e2[_0x5c21('0xa1')](_0x2991d3);}})[_0x5c21('0x29')](function(_0x1e0a95){if(_0x1e0a95){_0x53f4fd=_0x1e0a95[_0x5c21('0x3b')];if(!_0x40b98b[_0x5c21('0x36')][_0x5c21('0x5c')]('nolimit')){_0x2991d3[_0x5c21('0x22')]=qs['limit'](_0x40b98b[_0x5c21('0x36')][_0x5c21('0x22')]);_0x2991d3[_0x5c21('0x21')]=qs['offset'](_0x40b98b['query']['offset']);}return _0x4260e2[_0x5c21('0xa1')](_0x2991d3);}})[_0x5c21('0x29')](function(_0x18553e){if(_0x18553e){return _0x18553e?{'count':_0x53f4fd,'rows':_0x18553e}:null;}})[_0x5c21('0x29')](respondWithResult(_0x387e48,null))[_0x5c21('0x46')](handleError(_0x387e48,null));};function handleQuery(_0x85334a){logger[_0x5c21('0xa2')](_0x85334a);return db[_0x5c21('0x8f')][_0x5c21('0x36')](_0x85334a)['spread'](function(_0x373200){csv_results[_0x5c21('0x69')](_0x373200);})[_0x5c21('0x46')](function(_0x42677e){logger['error'](_0x42677e[_0x5c21('0x6a')]);});}
\ No newline at end of file
index 696f68b..8ed7d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x55ca,0x126));var _0xa55c=function(_0x108d68,_0x9b39de){_0x108d68=_0x108d68-0x0;var _0x11476a=_0x55ca[_0x108d68];return _0x11476a;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0x599e1e,_0x434df0){_0x599e1e=_0x599e1e-0x0;var _0x152c87=_0xe14b[_0x599e1e];return _0x152c87;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents;
\ No newline at end of file
index 47a4df2..c531005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['path','rimraf','../../config/environment','exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x276750,_0x375a2a){var _0x4a859b=function(_0x5e4bd1){while(--_0x5e4bd1){_0x276750['push'](_0x276750['shift']());}};_0x4a859b(++_0x375a2a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0xf3cd[_0x650e11];return _0x1a9b47;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./cmList.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55e0=['./cmList.attributes','exports','define','cm_lists','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x55e0,0xdc));var _0x055e=function(_0x2bac51,_0x33e3a9){_0x2bac51=_0x2bac51-0x0;var _0x5d88b9=_0x55e0[_0x2bac51];return _0x5d88b9;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('CmList',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 61e26d8..050ea80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb873=['register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./cmList.socket'];(function(_0xdb4759,_0x318491){var _0x11a738=function(_0x411e2d){while(--_0x411e2d){_0xdb4759['push'](_0xdb4759['shift']());}};_0x11a738(++_0x318491);}(_0xb873,0x185));var _0x3b87=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xb873[_0x2555d0];return _0x3bb486;};'use strict';var _=require('lodash');var util=require(_0x3b87('0x0'));var moment=require(_0x3b87('0x1'));var BPromise=require(_0x3b87('0x2'));var rs=require(_0x3b87('0x3'));var fs=require('fs');var Redis=require(_0x3b87('0x4'));var db=require(_0x3b87('0x5'))['db'];var utils=require(_0x3b87('0x6'));var logger=require(_0x3b87('0x7'))(_0x3b87('0x8'));var config=require(_0x3b87('0x9'));var jayson=require(_0x3b87('0xa'));var client=jayson[_0x3b87('0xb')][_0x3b87('0xc')]({'port':0x232a});config['redis']=_[_0x3b87('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3b87('0xe'))(new Redis(config[_0x3b87('0xf')]));require(_0x3b87('0x10'))[_0x3b87('0x11')](socket);function respondWithRpcPromise(_0x2a7378,_0x5ef804,_0x586e02){return new BPromise(function(_0x465ce6,_0x235d04){return client[_0x3b87('0x12')](_0x2a7378,_0x586e02)[_0x3b87('0x13')](function(_0x238844){logger['info'](_0x3b87('0x14'),_0x5ef804,_0x3b87('0x15'));logger[_0x3b87('0x16')](_0x3b87('0x17'),_0x5ef804,_0x3b87('0x15'),JSON[_0x3b87('0x18')](_0x238844));if(_0x238844[_0x3b87('0x19')]){if(_0x238844[_0x3b87('0x19')][_0x3b87('0x1a')]===0x1f4){logger[_0x3b87('0x19')](_0x3b87('0x14'),_0x5ef804,_0x238844[_0x3b87('0x19')][_0x3b87('0x1b')]);return _0x235d04(_0x238844['error'][_0x3b87('0x1b')]);}logger[_0x3b87('0x19')](_0x3b87('0x14'),_0x5ef804,_0x238844[_0x3b87('0x19')][_0x3b87('0x1b')]);return _0x465ce6(_0x238844['error']['message']);}else{logger[_0x3b87('0x1c')](_0x3b87('0x14'),_0x5ef804,'request\x20sent');_0x465ce6(_0x238844['result']['message']);}})['catch'](function(_0x12f3d5){logger[_0x3b87('0x19')](_0x3b87('0x14'),_0x5ef804,_0x12f3d5);_0x235d04(_0x12f3d5);});});}
\ No newline at end of file
+var _0x8825=['../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','randomstring','ioredis','../../mysqldb'];(function(_0x543367,_0x3a34eb){var _0x1ea2b4=function(_0xe7b689){while(--_0xe7b689){_0x543367['push'](_0x543367['shift']());}};_0x1ea2b4(++_0x3a34eb);}(_0x8825,0x111));var _0x5882=function(_0x24cfa9,_0x459f8e){_0x24cfa9=_0x24cfa9-0x0;var _0x29a315=_0x8825[_0x24cfa9];return _0x29a315;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5882('0x0'));var fs=require('fs');var Redis=require(_0x5882('0x1'));var db=require(_0x5882('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5882('0x3'))(_0x5882('0x4'));var config=require(_0x5882('0x5'));var jayson=require(_0x5882('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x5882('0x7')]=_[_0x5882('0x8')](config[_0x5882('0x7')],{'host':_0x5882('0x9'),'port':0x18eb});var socket=require(_0x5882('0xa'))(new Redis(config['redis']));require(_0x5882('0xb'))[_0x5882('0xc')](socket);function respondWithRpcPromise(_0x5eb143,_0x22245d,_0x35f971){return new BPromise(function(_0x4fab3f,_0x2f671c){return client['request'](_0x5eb143,_0x35f971)['then'](function(_0x12930f){logger[_0x5882('0xd')](_0x5882('0xe'),_0x22245d,'request\x20sent');logger['debug'](_0x5882('0xf'),_0x22245d,_0x5882('0x10'),JSON[_0x5882('0x11')](_0x12930f));if(_0x12930f['error']){if(_0x12930f[_0x5882('0x12')][_0x5882('0x13')]===0x1f4){logger[_0x5882('0x12')](_0x5882('0xe'),_0x22245d,_0x12930f['error'][_0x5882('0x14')]);return _0x2f671c(_0x12930f['error'][_0x5882('0x14')]);}logger['error'](_0x5882('0xe'),_0x22245d,_0x12930f[_0x5882('0x12')][_0x5882('0x14')]);return _0x4fab3f(_0x12930f[_0x5882('0x12')]['message']);}else{logger[_0x5882('0xd')]('CmList,\x20%s,\x20%s',_0x22245d,_0x5882('0x10'));_0x4fab3f(_0x12930f[_0x5882('0x15')][_0x5882('0x14')]);}})[_0x5882('0x16')](function(_0x1fe6af){logger[_0x5882('0x12')]('CmList,\x20%s,\x20%s',_0x22245d,_0x1fe6af);_0x2f671c(_0x1fe6af);});});}
\ No newline at end of file
index 604cefb..496ec71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4575=['save','remove','register','length','cmList:','./cmList.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4575,0x1c1));var _0x5457=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x4575[_0x282ccc];return _0x27c2dd;};'use strict';var CmListEvents=require(_0x5457('0x0'));var events=[_0x5457('0x1'),_0x5457('0x2'),'update'];function createListener(_0x2e0f64,_0x36c01d){return function(_0x5bb1e4){_0x36c01d['emit'](_0x2e0f64,_0x5bb1e4);};}function removeListener(_0x5f5c26,_0x26dead){return function(){CmListEvents['removeListener'](_0x5f5c26,_0x26dead);};}exports[_0x5457('0x3')]=function(_0x382fa5){for(var _0x4f7c0d=0x0,_0x204b36=events[_0x5457('0x4')];_0x4f7c0d<_0x204b36;_0x4f7c0d++){var _0x404c14=events[_0x4f7c0d];var _0x3c349b=createListener(_0x5457('0x5')+_0x404c14,_0x382fa5);CmListEvents['on'](_0x404c14,_0x3c349b);}};
\ No newline at end of file
+var _0x898a=['length','cmList:','save','remove','update','emit'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x898a,0x134));var _0xa898=function(_0x394dde,_0x187d3e){_0x394dde=_0x394dde-0x0;var _0x391f0b=_0x898a[_0x394dde];return _0x391f0b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xa898('0x0'),_0xa898('0x1'),_0xa898('0x2')];function createListener(_0x31020d,_0x200f39){return function(_0x21c1fa){_0x200f39[_0xa898('0x3')](_0x31020d,_0x21c1fa);};}function removeListener(_0x517961,_0x3d16fb){return function(){CmListEvents['removeListener'](_0x517961,_0x3d16fb);};}exports['register']=function(_0xa8df76){for(var _0x2f6081=0x0,_0x307be8=events[_0xa898('0x4')];_0x2f6081<_0x307be8;_0x2f6081++){var _0x47bbb6=events[_0x2f6081];var _0x1d4679=createListener(_0xa898('0x5')+_0x47bbb6,_0xa8df76);CmListEvents['on'](_0x47bbb6,_0x1d4679);}};
\ No newline at end of file
index 1289453..a24f4d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec56=['index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated'];(function(_0x520d6d,_0x20ed47){var _0x17bd7b=function(_0x304c1a){while(--_0x304c1a){_0x520d6d['push'](_0x520d6d['shift']());}};_0x17bd7b(++_0x20ed47);}(_0xec56,0x1bd));var _0x6ec5=function(_0x46518b,_0x183caf){_0x46518b=_0x46518b-0x0;var _0x208645=_0xec56[_0x46518b];return _0x208645;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x9')](_0x6ec5('0x12'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x13')]);router['get'](_0x6ec5('0x14'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x9')](_0x6ec5('0x16'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x9')]('/:id/fields',auth[_0x6ec5('0xa')](),controller['getCustomFields']);router[_0x6ec5('0x9')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')]('/',auth['isAuthenticated'](),controller[_0x6ec5('0x1b')]);router[_0x6ec5('0x1a')](_0x6ec5('0x12'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x1c')]);router[_0x6ec5('0x1a')](_0x6ec5('0x14'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x1d')]);router[_0x6ec5('0x1a')](_0x6ec5('0x1e'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x1f')]);router[_0x6ec5('0x1a')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x20')]);router['put'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x21')]);router[_0x6ec5('0x22')](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x23')]);router['delete'](_0x6ec5('0x12'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x24')]);router[_0x6ec5('0x22')]('/:id/users',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0xa9dc=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','create','post','addDisposition','addCustomField','addAgents','put','delete','destroy','removeDispositions','multer','util','path','connect-timeout'];(function(_0x435f71,_0x121b10){var _0x5dc7b1=function(_0xbbeb3a){while(--_0xbbeb3a){_0x435f71['push'](_0x435f71['shift']());}};_0x5dc7b1(++_0x121b10);}(_0xa9dc,0xb0));var _0xca9d=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0xa9dc[_0x390a19];return _0x5d8230;};'use strict';var multer=require(_0xca9d('0x0'));var util=require(_0xca9d('0x1'));var path=require(_0xca9d('0x2'));var timeout=require(_0xca9d('0x3'));var express=require(_0xca9d('0x4'));var router=express['Router']();var fs_extra=require(_0xca9d('0x5'));var auth=require(_0xca9d('0x6'));var interaction=require(_0xca9d('0x7'));var config=require(_0xca9d('0x8'));var controller=require(_0xca9d('0x9'));router[_0xca9d('0xa')]('/',auth['isAuthenticated'](),controller[_0xca9d('0xb')]);router['get'](_0xca9d('0xc'),auth[_0xca9d('0xd')](),controller[_0xca9d('0xe')]);router[_0xca9d('0xa')](_0xca9d('0xf'),auth['isAuthenticated'](),controller[_0xca9d('0x10')]);router[_0xca9d('0xa')](_0xca9d('0x11'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x12')]);router[_0xca9d('0xa')](_0xca9d('0x13'),auth[_0xca9d('0xd')](),controller['getDispositions']);router[_0xca9d('0xa')](_0xca9d('0x14'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x15')]);router[_0xca9d('0xa')](_0xca9d('0x16'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x17')]);router[_0xca9d('0xa')](_0xca9d('0x18'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0xca9d('0xa')](_0xca9d('0x19'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x1a')]);router['post']('/',auth[_0xca9d('0xd')](),controller[_0xca9d('0x1b')]);router[_0xca9d('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xca9d('0x1d')]);router['post'](_0xca9d('0x14'),auth[_0xca9d('0xd')](),controller['addContacts']);router['post'](_0xca9d('0x18'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x1e')]);router['post'](_0xca9d('0x19'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x1f')]);router[_0xca9d('0x20')]('/:id',auth[_0xca9d('0xd')](),controller['update']);router[_0xca9d('0x21')](_0xca9d('0x11'),auth[_0xca9d('0xd')](),controller[_0xca9d('0x22')]);router[_0xca9d('0x21')]('/:id/dispositions',auth[_0xca9d('0xd')](),controller[_0xca9d('0x23')]);router[_0xca9d('0x21')](_0xca9d('0x19'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 0cda962..23a4597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e0d=['exports','VIRTUAL','STRING','sequelize'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x4e0d,0x1a3));var _0xd4e0=function(_0x367a7d,_0xd696cd){_0x367a7d=_0x367a7d-0x0;var _0x4e2f40=_0x4e0d[_0x367a7d];return _0x4e2f40;};'use strict';var Sequelize=require(_0xd4e0('0x0'));module[_0xd4e0('0x1')]={'name':{'type':Sequelize[_0xd4e0('0x2')],'get':function(_0x38908d){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0xd4e0('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xd4e0('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xd4e0('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0xa7aa=['STRING'];(function(_0x3c2a1a,_0x49008a){var _0x279dfa=function(_0x4e16f6){while(--_0x4e16f6){_0x3c2a1a['push'](_0x3c2a1a['shift']());}};_0x279dfa(++_0x49008a);}(_0xa7aa,0xdb));var _0xaa7a=function(_0xb5abcf,_0x49f65f){_0xb5abcf=_0xb5abcf-0x0;var _0xdf12ca=_0xa7aa[_0xb5abcf];return _0xdf12ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3a6397){return this['getDataValue']('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xaa7a('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xaa7a('0x0')],'allowNull':![]}};
\ No newline at end of file
index ded5db0..5384125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1b0f9c,_0xe8fcd3){var _0x11bb30=function(_0x227a9c){while(--_0x227a9c){_0x1b0f9c['push'](_0x1b0f9c['shift']());}};_0x11bb30(++_0xe8fcd3);}(_0x7a54,0x106));var _0x47a5=function(_0x58affe,_0x2793b3){_0x58affe=_0x58affe-0x0;var _0x55ab61=_0x7a54[_0x58affe];return _0x55ab61;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _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(_0x2ff38f,_0xefceba){var _0x19a75f=function(_0x22c3b1){while(--_0x22c3b1){_0x2ff38f['push'](_0x2ff38f['shift']());}};_0x19a75f(++_0xefceba);}(_0x7a54,0x106));var _0x47a5=function(_0x40a19d,_0x244699){_0x40a19d=_0x40a19d-0x0;var _0x382f89=_0x7a54[_0x40a19d];return _0x382f89;};'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 ddbac0a..5800e3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa3b=['rimraf','./condition.attributes','define','Condition','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2f653f,_0x1cef4e){var _0x479836=function(_0x4182c2){while(--_0x4182c2){_0x2f653f['push'](_0x2f653f['shift']());}};_0x479836(++_0x1cef4e);}(_0xfa3b,0x14e));var _0xbfa3=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xfa3b[_0x166d93];return _0xba708;};'use strict';var _=require(_0xbfa3('0x0'));var util=require(_0xbfa3('0x1'));var logger=require(_0xbfa3('0x2'))('api');var moment=require(_0xbfa3('0x3'));var BPromise=require(_0xbfa3('0x4'));var rp=require(_0xbfa3('0x5'));var fs=require('fs');var path=require(_0xbfa3('0x6'));var rimraf=require(_0xbfa3('0x7'));var config=require('../../config/environment');var attributes=require(_0xbfa3('0x8'));module['exports']=function(_0x31e97f,_0x2591b2){return _0x31e97f[_0xbfa3('0x9')](_0xbfa3('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16a2=['request-promise','rimraf','./condition.attributes','exports','Condition','tools_conditions','lodash','api','moment'];(function(_0x138906,_0x393a07){var _0x102a2d=function(_0x44e68a){while(--_0x44e68a){_0x138906['push'](_0x138906['shift']());}};_0x102a2d(++_0x393a07);}(_0x16a2,0x96));var _0x216a=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x16a2[_0x290fa6];return _0x47f1f3;};'use strict';var _=require(_0x216a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x216a('0x1'));var moment=require(_0x216a('0x2'));var BPromise=require('bluebird');var rp=require(_0x216a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x216a('0x4'));var config=require('../../config/environment');var attributes=require(_0x216a('0x5'));module[_0x216a('0x6')]=function(_0x4c84e0,_0x2041cd){return _0x4c84e0['define'](_0x216a('0x7'),attributes,{'tableName':_0x216a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5333922..32857e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77e2=['Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x180fda,_0x1af14f){var _0x3bddc9=function(_0x516a35){while(--_0x516a35){_0x180fda['push'](_0x180fda['shift']());}};_0x3bddc9(++_0x1af14f);}(_0x77e2,0x189));var _0x277e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x277e('0x0'));var util=require(_0x277e('0x1'));var moment=require(_0x277e('0x2'));var BPromise=require(_0x277e('0x3'));var rs=require(_0x277e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x277e('0x5'))['db'];var utils=require(_0x277e('0x6'));var logger=require('../../config/logger')(_0x277e('0x7'));var config=require(_0x277e('0x8'));var jayson=require(_0x277e('0x9'));var client=jayson[_0x277e('0xa')][_0x277e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a5da6,_0x31579c,_0x46c8c0){return new BPromise(function(_0x189a3e,_0xb3153b){return client[_0x277e('0xc')](_0x4a5da6,_0x46c8c0)[_0x277e('0xd')](function(_0x2ec1df){logger[_0x277e('0xe')](_0x277e('0xf'),_0x31579c,_0x277e('0x10'));logger[_0x277e('0x11')](_0x277e('0x12'),_0x31579c,_0x277e('0x10'),JSON[_0x277e('0x13')](_0x2ec1df));if(_0x2ec1df[_0x277e('0x14')]){if(_0x2ec1df[_0x277e('0x14')]['code']===0x1f4){logger[_0x277e('0x14')](_0x277e('0xf'),_0x31579c,_0x2ec1df[_0x277e('0x14')][_0x277e('0x15')]);return _0xb3153b(_0x2ec1df['error']['message']);}logger[_0x277e('0x14')](_0x277e('0xf'),_0x31579c,_0x2ec1df[_0x277e('0x14')][_0x277e('0x15')]);return _0x189a3e(_0x2ec1df['error'][_0x277e('0x15')]);}else{logger[_0x277e('0xe')](_0x277e('0xf'),_0x31579c,_0x277e('0x10'));_0x189a3e(_0x2ec1df[_0x277e('0x16')][_0x277e('0x15')]);}})[_0x277e('0x17')](function(_0x19a0bd){logger[_0x277e('0x14')](_0x277e('0xf'),_0x31579c,_0x19a0bd);_0xb3153b(_0x19a0bd);});});}
\ No newline at end of file
+var _0x77a3=['Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x409c9c,_0x2052d4){var _0x4a0edb=function(_0x150178){while(--_0x150178){_0x409c9c['push'](_0x409c9c['shift']());}};_0x4a0edb(++_0x2052d4);}(_0x77a3,0x1b7));var _0x377a=function(_0x4a7712,_0x31f417){_0x4a7712=_0x4a7712-0x0;var _0xb2d8e2=_0x77a3[_0x4a7712];return _0xb2d8e2;};'use strict';var _=require(_0x377a('0x0'));var util=require(_0x377a('0x1'));var moment=require(_0x377a('0x2'));var BPromise=require(_0x377a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x377a('0x4'))['db'];var utils=require(_0x377a('0x5'));var logger=require(_0x377a('0x6'))('rpc');var config=require(_0x377a('0x7'));var jayson=require(_0x377a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1150a4,_0x56eea3,_0x2e0a49){return new BPromise(function(_0xcce76,_0x1fa3ce){return client[_0x377a('0x9')](_0x1150a4,_0x2e0a49)[_0x377a('0xa')](function(_0xbc5637){logger['info'](_0x377a('0xb'),_0x56eea3,_0x377a('0xc'));logger['debug'](_0x377a('0xd'),_0x56eea3,'request\x20sent',JSON['stringify'](_0xbc5637));if(_0xbc5637[_0x377a('0xe')]){if(_0xbc5637[_0x377a('0xe')]['code']===0x1f4){logger[_0x377a('0xe')]('Condition,\x20%s,\x20%s',_0x56eea3,_0xbc5637['error']['message']);return _0x1fa3ce(_0xbc5637[_0x377a('0xe')][_0x377a('0xf')]);}logger[_0x377a('0xe')]('Condition,\x20%s,\x20%s',_0x56eea3,_0xbc5637[_0x377a('0xe')][_0x377a('0xf')]);return _0xcce76(_0xbc5637[_0x377a('0xe')][_0x377a('0xf')]);}else{logger['info'](_0x377a('0xb'),_0x56eea3,'request\x20sent');_0xcce76(_0xbc5637[_0x377a('0x10')][_0x377a('0xf')]);}})[_0x377a('0x11')](function(_0xfe26c){logger['error'](_0x377a('0xb'),_0x56eea3,_0xfe26c);_0x1fa3ce(_0xfe26c);});});}
\ No newline at end of file
index ed4b240..9aa8eb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35e5=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated'];(function(_0x1cf39f,_0x6d9c74){var _0x32b551=function(_0x5b6288){while(--_0x5b6288){_0x1cf39f['push'](_0x1cf39f['shift']());}};_0x32b551(++_0x6d9c74);}(_0x35e5,0xb7));var _0x535e=function(_0x28d4cc,_0x17ac80){_0x28d4cc=_0x28d4cc-0x0;var _0x1fa5e2=_0x35e5[_0x28d4cc];return _0x1fa5e2;};'use strict';var multer=require(_0x535e('0x0'));var util=require(_0x535e('0x1'));var path=require('path');var timeout=require(_0x535e('0x2'));var express=require(_0x535e('0x3'));var router=express[_0x535e('0x4')]();var fs_extra=require(_0x535e('0x5'));var auth=require(_0x535e('0x6'));var interaction=require(_0x535e('0x7'));var config=require('../../config/environment');var controller=require(_0x535e('0x8'));router[_0x535e('0x9')](_0x535e('0xa'),auth[_0x535e('0xb')](),controller['update']);router['delete'](_0x535e('0xa'),auth[_0x535e('0xb')](),controller['destroy']);module[_0x535e('0xc')]=router;
\ No newline at end of file
+var _0x1680=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1680,0x84));var _0x0168=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x1680[_0x46f1a6];return _0x38429a;};'use strict';var multer=require(_0x0168('0x0'));var util=require(_0x0168('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0168('0x2'));var auth=require(_0x0168('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0168('0x4'));var controller=require(_0x0168('0x5'));router[_0x0168('0x6')](_0x0168('0x7'),auth[_0x0168('0x8')](),controller[_0x0168('0x9')]);router[_0x0168('0xa')]('/:id',auth[_0x0168('0x8')](),controller[_0x0168('0xb')]);module[_0x0168('0xc')]=router;
\ No newline at end of file
index 2f6827e..3fe2275 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dbc=['exports','STRING','name','INTEGER','sequelize'];(function(_0x4bd19e,_0x24d503){var _0x53ec12=function(_0x3485f1){while(--_0x3485f1){_0x4bd19e['push'](_0x4bd19e['shift']());}};_0x53ec12(++_0x24d503);}(_0x5dbc,0x162));var _0xc5db=function(_0xa6bab,_0x5bd7ee){_0xa6bab=_0xa6bab-0x0;var _0x5f3bbd=_0x5dbc[_0xa6bab];return _0x5f3bbd;};'use strict';var Sequelize=require(_0xc5db('0x0'));module[_0xc5db('0x1')]={'name':{'type':Sequelize[_0xc5db('0x2')],'allowNull':![],'unique':_0xc5db('0x3')},'OrderBy':{'type':Sequelize[_0xc5db('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xc5db('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xf1ae=['INTEGER','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1ae,0x67));var _0xef1a=function(_0x54135c,_0x2158be){_0x54135c=_0x54135c-0x0;var _0x108875=_0xf1ae[_0x54135c];return _0x108875;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xef1a('0x0')],'allowNull':![],'unique':_0xef1a('0x1')},'OrderBy':{'type':Sequelize[_0xef1a('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xef1a('0x0')],'allowNull':!![]}};
\ No newline at end of file
index e832ef4..5684851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['limit','count','offset','set','reject','save','update','destroy','get','ContactItemTypes','then','stack','name','send','index','ContactItemType','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','findAll','rows','catch','params','rawAttributes','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x9f2af9,_0x55141a){var _0x24aa62=function(_0x534fca){while(--_0x534fca){_0x9f2af9['push'](_0x9f2af9['shift']());}};_0x24aa62(++_0x55141a);}(_0x5204,0xdf));var _0x4520=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5204[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4520('0x2'));var rp=require(_0x4520('0x3'));var moment=require(_0x4520('0x4'));var BPromise=require(_0x4520('0x5'));var Mustache=require(_0x4520('0x6'));var util=require('util');var path=require(_0x4520('0x7'));var sox=require('sox');var csv=require(_0x4520('0x8'));var ejs=require(_0x4520('0x9'));var fs=require('fs');var fs_extra=require(_0x4520('0xa'));var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x8'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var licenseUtil=require(_0x4520('0x19'));var db=require(_0x4520('0x1a'))['db'];function respondWithStatusCode(_0x3c7a5d,_0x508ea6){_0x508ea6=_0x508ea6||0xcc;return function(_0x2e3c64){if(_0x2e3c64){return _0x3c7a5d[_0x4520('0x1b')](_0x508ea6);}return _0x3c7a5d[_0x4520('0x1c')](_0x508ea6)[_0x4520('0x1d')]();};}function respondWithResult(_0x426836,_0x34d383){_0x34d383=_0x34d383||0xc8;return function(_0x32950a){if(_0x32950a){return _0x426836['status'](_0x34d383)[_0x4520('0x1e')](_0x32950a);}};}function respondWithFilteredResult(_0x20de6b,_0x1ab841){return function(_0x15a31f){if(_0x15a31f){var _0x32d8aa=typeof _0x1ab841['offset']===_0x4520('0x1f')&&typeof _0x1ab841[_0x4520('0x20')]===_0x4520('0x1f');var _0x283ad4=_0x15a31f[_0x4520('0x21')];var _0x2e00f4=_0x32d8aa?0x0:_0x1ab841[_0x4520('0x22')];var _0x4ba69f=_0x32d8aa?_0x15a31f[_0x4520('0x21')]:_0x1ab841[_0x4520('0x22')]+_0x1ab841[_0x4520('0x20')];var _0x460521;if(_0x4ba69f>=_0x283ad4){_0x4ba69f=_0x283ad4;_0x460521=0xc8;}else{_0x460521=0xce;}_0x20de6b['status'](_0x460521);return _0x20de6b[_0x4520('0x23')]('Content-Range',_0x2e00f4+'-'+_0x4ba69f+'/'+_0x283ad4)['json'](_0x15a31f);}return null;};}function patchUpdates(_0x4c46c5){return function(_0x2b9456){try{jsonpatch['apply'](_0x2b9456,_0x4c46c5,!![]);}catch(_0x39e196){return BPromise[_0x4520('0x24')](_0x39e196);}return _0x2b9456[_0x4520('0x25')]();};}function saveUpdates(_0x534b15,_0x3199a9){return function(_0x4000d4){if(_0x4000d4){return _0x4000d4[_0x4520('0x26')](_0x534b15)['then'](function(_0x198c34){return _0x198c34;});}return null;};}function removeEntity(_0x847d15,_0x24eacd){return function(_0x3a4680){if(_0x3a4680){return _0x3a4680[_0x4520('0x27')]()['then'](function(){var _0x3774bd=_0x3a4680[_0x4520('0x28')]({'plain':!![]});var _0x3532aa=_0x4520('0x29');return db['UserProfileResource'][_0x4520('0x27')]({'where':{'type':_0x3532aa,'resourceId':_0x3774bd['id']}})[_0x4520('0x2a')](function(){return _0x3a4680;});})[_0x4520('0x2a')](function(){_0x847d15[_0x4520('0x1c')](0xcc)[_0x4520('0x1d')]();});}};}function handleEntityNotFound(_0x2c95ea,_0x2d6902){return function(_0x195c58){if(!_0x195c58){_0x2c95ea[_0x4520('0x1b')](0x194);}return _0x195c58;};}function handleError(_0x926ca0,_0x58836d){_0x58836d=_0x58836d||0x1f4;return function(_0x222dbd){logger['error'](_0x222dbd[_0x4520('0x2b')]);if(_0x222dbd[_0x4520('0x2c')]){delete _0x222dbd[_0x4520('0x2c')];}_0x926ca0[_0x4520('0x1c')](_0x58836d)[_0x4520('0x2d')](_0x222dbd);};}exports[_0x4520('0x2e')]=function(_0x5bb163,_0x2c32ce){var _0x508c05={},_0x2585eb={},_0x4a6755={'count':0x0,'rows':[]};var _0xf6caff=_['map'](db[_0x4520('0x2f')]['rawAttributes'],function(_0x5087dc){return{'name':_0x5087dc[_0x4520('0x30')],'type':_0x5087dc[_0x4520('0x31')][_0x4520('0x32')]};});_0x2585eb['model']=_[_0x4520('0x33')](_0xf6caff,_0x4520('0x2c'));_0x2585eb[_0x4520('0x34')]=_[_0x4520('0x35')](_0x5bb163['query']);_0x2585eb['filters']=_[_0x4520('0x36')](_0x2585eb[_0x4520('0x37')],_0x2585eb['query']);_0x508c05[_0x4520('0x38')]=_[_0x4520('0x36')](_0x2585eb[_0x4520('0x37')],qs[_0x4520('0x39')](_0x5bb163[_0x4520('0x34')][_0x4520('0x39')]));_0x508c05['attributes']=_0x508c05[_0x4520('0x38')][_0x4520('0x3a')]?_0x508c05['attributes']:_0x2585eb[_0x4520('0x37')];if(!_0x5bb163['query'][_0x4520('0x3b')](_0x4520('0x3c'))){_0x508c05['limit']=qs['limit'](_0x5bb163['query'][_0x4520('0x20')]);_0x508c05[_0x4520('0x22')]=qs[_0x4520('0x22')](_0x5bb163[_0x4520('0x34')][_0x4520('0x22')]);}_0x508c05[_0x4520('0x3d')]=qs[_0x4520('0x3e')](_0x5bb163['query'][_0x4520('0x3e')]);_0x508c05[_0x4520('0x3f')]=qs[_0x4520('0x40')](_['pick'](_0x5bb163[_0x4520('0x34')],_0x2585eb[_0x4520('0x40')]),_0xf6caff);if(_0x5bb163['query']['filter']){_0x508c05[_0x4520('0x3f')]=_[_0x4520('0x41')](_0x508c05[_0x4520('0x3f')],{'$or':_[_0x4520('0x33')](_0xf6caff,function(_0x538843){if(_0x538843['type']!=='VIRTUAL'){var _0x4f5aa1={};_0x4f5aa1[_0x538843[_0x4520('0x2c')]]={'$like':'%'+_0x5bb163['query'][_0x4520('0x42')]+'%'};return _0x4f5aa1;}})});}_0x508c05=_['merge']({},_0x508c05,_0x5bb163['options']);var _0x2ff616={'where':_0x508c05[_0x4520('0x3f')]};return db[_0x4520('0x2f')][_0x4520('0x21')](_0x2ff616)[_0x4520('0x2a')](function(_0x59d646){_0x4a6755[_0x4520('0x21')]=_0x59d646;if(_0x5bb163[_0x4520('0x34')]['includeAll']){_0x508c05['include']=[{'all':!![]}];}return db[_0x4520('0x2f')][_0x4520('0x43')](_0x508c05);})['then'](function(_0x2978d5){_0x4a6755[_0x4520('0x44')]=_0x2978d5;return _0x4a6755;})[_0x4520('0x2a')](respondWithFilteredResult(_0x2c32ce,_0x508c05))[_0x4520('0x45')](handleError(_0x2c32ce,null));};exports['show']=function(_0xabacde,_0x27649a){var _0x361fb0={'raw':!![],'where':{'id':_0xabacde[_0x4520('0x46')]['id']}},_0xb92e25={};_0xb92e25[_0x4520('0x37')]=_[_0x4520('0x35')](db[_0x4520('0x2f')][_0x4520('0x47')]);_0xb92e25[_0x4520('0x34')]=_[_0x4520('0x35')](_0xabacde[_0x4520('0x34')]);_0xb92e25[_0x4520('0x40')]=_[_0x4520('0x36')](_0xb92e25[_0x4520('0x37')],_0xb92e25[_0x4520('0x34')]);_0x361fb0[_0x4520('0x38')]=_['intersection'](_0xb92e25[_0x4520('0x37')],qs[_0x4520('0x39')](_0xabacde['query']['fields']));_0x361fb0['attributes']=_0x361fb0['attributes'][_0x4520('0x3a')]?_0x361fb0['attributes']:_0xb92e25[_0x4520('0x37')];if(_0xabacde[_0x4520('0x34')][_0x4520('0x48')]){_0x361fb0[_0x4520('0x49')]=[{'all':!![]}];}_0x361fb0=_[_0x4520('0x41')]({},_0x361fb0,_0xabacde[_0x4520('0x4a')]);return db[_0x4520('0x2f')][_0x4520('0x4b')](_0x361fb0)[_0x4520('0x2a')](handleEntityNotFound(_0x27649a,null))[_0x4520('0x2a')](respondWithResult(_0x27649a,null))[_0x4520('0x45')](handleError(_0x27649a,null));};exports[_0x4520('0x4c')]=function(_0x737ba4,_0x1e4821){return db[_0x4520('0x2f')][_0x4520('0x4c')](_0x737ba4[_0x4520('0x4d')],{})[_0x4520('0x2a')](function(_0x4cf80e){var _0x53987b=_0x737ba4[_0x4520('0x4e')][_0x4520('0x28')]({'plain':!![]});if(!_0x53987b)throw new Error(_0x4520('0x4f'));if(_0x53987b['role']===_0x4520('0x4e')){var _0x2288a7=_0x4cf80e[_0x4520('0x28')]({'plain':!![]});var _0x5398c2=_0x4520('0x29');return db[_0x4520('0x50')][_0x4520('0x4b')]({'where':{'name':_0x5398c2,'userProfileId':_0x53987b['userProfileId']},'raw':!![]})['then'](function(_0x38b467){if(_0x38b467&&_0x38b467[_0x4520('0x51')]===0x0){return db[_0x4520('0x52')][_0x4520('0x4c')]({'name':_0x2288a7[_0x4520('0x2c')],'resourceId':_0x2288a7['id'],'type':_0x38b467[_0x4520('0x2c')],'sectionId':_0x38b467['id']},{})[_0x4520('0x2a')](function(){return _0x4cf80e;});}else{return _0x4cf80e;}})[_0x4520('0x45')](function(_0x4d30d3){logger[_0x4520('0x53')](_0x4520('0x54'),_0x4d30d3);throw _0x4d30d3;});}return _0x4cf80e;})[_0x4520('0x2a')](respondWithResult(_0x1e4821,0xc9))[_0x4520('0x45')](handleError(_0x1e4821,null));};exports[_0x4520('0x26')]=function(_0x253011,_0x2b09a1){if(_0x253011[_0x4520('0x4d')]['id']){delete _0x253011[_0x4520('0x4d')]['id'];}return db[_0x4520('0x2f')][_0x4520('0x4b')]({'where':{'id':_0x253011[_0x4520('0x46')]['id']}})[_0x4520('0x2a')](handleEntityNotFound(_0x2b09a1,null))[_0x4520('0x2a')](saveUpdates(_0x253011[_0x4520('0x4d')],null))[_0x4520('0x2a')](respondWithResult(_0x2b09a1,null))[_0x4520('0x45')](handleError(_0x2b09a1,null));};exports['destroy']=function(_0x52bb6c,_0x200a96){return db[_0x4520('0x2f')][_0x4520('0x4b')]({'where':{'id':_0x52bb6c[_0x4520('0x46')]['id']}})[_0x4520('0x2a')](handleEntityNotFound(_0x200a96,null))[_0x4520('0x2a')](db['CmContactHasItem'][_0x4520('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x52bb6c[_0x4520('0x46')]['id']}}))['then'](removeEntity(_0x200a96,null))[_0x4520('0x45')](handleError(_0x200a96,null));};
\ No newline at end of file
+var _0x160f=['UserProfileSection','userProfileId','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','ContactItemType','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes'];(function(_0x4bd1ed,_0x2b6949){var _0x2f59b3=function(_0x4dd7b1){while(--_0x4dd7b1){_0x4bd1ed['push'](_0x4bd1ed['shift']());}};_0x2f59b3(++_0x2b6949);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];function respondWithStatusCode(_0x3b09ea,_0x2d8854){_0x2d8854=_0x2d8854||0xcc;return function(_0x523af5){if(_0x523af5){return _0x3b09ea[_0xf160('0x17')](_0x2d8854);}return _0x3b09ea['status'](_0x2d8854)[_0xf160('0x18')]();};}function respondWithResult(_0x26951a,_0x12549a){_0x12549a=_0x12549a||0xc8;return function(_0x2bb6c7){if(_0x2bb6c7){return _0x26951a[_0xf160('0x19')](_0x12549a)[_0xf160('0x1a')](_0x2bb6c7);}};}function respondWithFilteredResult(_0x2643ba,_0x172337){return function(_0x1396ba){if(_0x1396ba){var _0x59ac02=typeof _0x172337[_0xf160('0x1b')]===_0xf160('0x1c')&&typeof _0x172337[_0xf160('0x1d')]===_0xf160('0x1c');var _0x51824b=_0x1396ba[_0xf160('0x1e')];var _0x4b8185=_0x59ac02?0x0:_0x172337[_0xf160('0x1b')];var _0x1cf6ba=_0x59ac02?_0x1396ba[_0xf160('0x1e')]:_0x172337[_0xf160('0x1b')]+_0x172337[_0xf160('0x1d')];var _0x205afa;if(_0x1cf6ba>=_0x51824b){_0x1cf6ba=_0x51824b;_0x205afa=0xc8;}else{_0x205afa=0xce;}_0x2643ba[_0xf160('0x19')](_0x205afa);return _0x2643ba[_0xf160('0x1f')](_0xf160('0x20'),_0x4b8185+'-'+_0x1cf6ba+'/'+_0x51824b)['json'](_0x1396ba);}return null;};}function patchUpdates(_0x40ccf0){return function(_0xa20d5a){try{jsonpatch[_0xf160('0x21')](_0xa20d5a,_0x40ccf0,!![]);}catch(_0x5ad173){return BPromise[_0xf160('0x22')](_0x5ad173);}return _0xa20d5a[_0xf160('0x23')]();};}function saveUpdates(_0x454e63,_0x36d0cb){return function(_0x2e03c8){if(_0x2e03c8){return _0x2e03c8[_0xf160('0x24')](_0x454e63)[_0xf160('0x25')](function(_0x5a72d1){return _0x5a72d1;});}return null;};}function removeEntity(_0x3d1f6c,_0x28bf27){return function(_0x305f6a){if(_0x305f6a){return _0x305f6a[_0xf160('0x26')]()['then'](function(){var _0x42458c=_0x305f6a[_0xf160('0x27')]({'plain':!![]});var _0x4a8003='ContactItemTypes';return db[_0xf160('0x28')][_0xf160('0x26')]({'where':{'type':_0x4a8003,'resourceId':_0x42458c['id']}})[_0xf160('0x25')](function(){return _0x305f6a;});})['then'](function(){_0x3d1f6c[_0xf160('0x19')](0xcc)[_0xf160('0x18')]();});}};}function handleEntityNotFound(_0x2851e8,_0x2e2b00){return function(_0x135e0f){if(!_0x135e0f){_0x2851e8[_0xf160('0x17')](0x194);}return _0x135e0f;};}function handleError(_0x5d0cc8,_0x4d7165){_0x4d7165=_0x4d7165||0x1f4;return function(_0x48145e){logger[_0xf160('0x29')](_0x48145e[_0xf160('0x2a')]);if(_0x48145e[_0xf160('0x2b')]){delete _0x48145e[_0xf160('0x2b')];}_0x5d0cc8[_0xf160('0x19')](_0x4d7165)['send'](_0x48145e);};}exports['index']=function(_0x329d6b,_0x558596){var _0x4ce478={},_0x22c2e3={},_0x3a35b3={'count':0x0,'rows':[]};var _0x5497f6=_[_0xf160('0x2c')](db[_0xf160('0x2d')]['rawAttributes'],function(_0x528dff){return{'name':_0x528dff['fieldName'],'type':_0x528dff['type'][_0xf160('0x2e')]};});_0x22c2e3[_0xf160('0x2f')]=_[_0xf160('0x2c')](_0x5497f6,_0xf160('0x2b'));_0x22c2e3[_0xf160('0x30')]=_[_0xf160('0x31')](_0x329d6b['query']);_0x22c2e3['filters']=_['intersection'](_0x22c2e3[_0xf160('0x2f')],_0x22c2e3['query']);_0x4ce478['attributes']=_[_0xf160('0x32')](_0x22c2e3[_0xf160('0x2f')],qs['fields'](_0x329d6b[_0xf160('0x30')][_0xf160('0x33')]));_0x4ce478[_0xf160('0x34')]=_0x4ce478[_0xf160('0x34')][_0xf160('0x35')]?_0x4ce478['attributes']:_0x22c2e3[_0xf160('0x2f')];if(!_0x329d6b[_0xf160('0x30')][_0xf160('0x36')]('nolimit')){_0x4ce478[_0xf160('0x1d')]=qs[_0xf160('0x1d')](_0x329d6b[_0xf160('0x30')][_0xf160('0x1d')]);_0x4ce478[_0xf160('0x1b')]=qs[_0xf160('0x1b')](_0x329d6b['query']['offset']);}_0x4ce478[_0xf160('0x37')]=qs[_0xf160('0x38')](_0x329d6b[_0xf160('0x30')][_0xf160('0x38')]);_0x4ce478[_0xf160('0x39')]=qs[_0xf160('0x3a')](_[_0xf160('0x3b')](_0x329d6b[_0xf160('0x30')],_0x22c2e3[_0xf160('0x3a')]),_0x5497f6);if(_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]){_0x4ce478[_0xf160('0x39')]=_[_0xf160('0x3d')](_0x4ce478[_0xf160('0x39')],{'$or':_[_0xf160('0x2c')](_0x5497f6,function(_0x256ce7){if(_0x256ce7[_0xf160('0x3e')]!==_0xf160('0x3f')){var _0x43f07f={};_0x43f07f[_0x256ce7[_0xf160('0x2b')]]={'$like':'%'+_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]+'%'};return _0x43f07f;}})});}_0x4ce478=_[_0xf160('0x3d')]({},_0x4ce478,_0x329d6b[_0xf160('0x40')]);var _0x494d76={'where':_0x4ce478[_0xf160('0x39')]};return db[_0xf160('0x2d')][_0xf160('0x1e')](_0x494d76)[_0xf160('0x25')](function(_0x3d273d){_0x3a35b3[_0xf160('0x1e')]=_0x3d273d;if(_0x329d6b[_0xf160('0x30')]['includeAll']){_0x4ce478[_0xf160('0x41')]=[{'all':!![]}];}return db['ContactItemType'][_0xf160('0x42')](_0x4ce478);})[_0xf160('0x25')](function(_0x530fc5){_0x3a35b3[_0xf160('0x43')]=_0x530fc5;return _0x3a35b3;})[_0xf160('0x25')](respondWithFilteredResult(_0x558596,_0x4ce478))[_0xf160('0x44')](handleError(_0x558596,null));};exports[_0xf160('0x45')]=function(_0x468600,_0x43d243){var _0x1154ed={'raw':!![],'where':{'id':_0x468600[_0xf160('0x46')]['id']}},_0x4f5eba={};_0x4f5eba[_0xf160('0x2f')]=_[_0xf160('0x31')](db[_0xf160('0x2d')][_0xf160('0x47')]);_0x4f5eba[_0xf160('0x30')]=_[_0xf160('0x31')](_0x468600[_0xf160('0x30')]);_0x4f5eba[_0xf160('0x3a')]=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],_0x4f5eba['query']);_0x1154ed['attributes']=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],qs[_0xf160('0x33')](_0x468600[_0xf160('0x30')][_0xf160('0x33')]));_0x1154ed[_0xf160('0x34')]=_0x1154ed['attributes'][_0xf160('0x35')]?_0x1154ed['attributes']:_0x4f5eba['model'];if(_0x468600[_0xf160('0x30')][_0xf160('0x48')]){_0x1154ed['include']=[{'all':!![]}];}_0x1154ed=_['merge']({},_0x1154ed,_0x468600[_0xf160('0x40')]);return db[_0xf160('0x2d')][_0xf160('0x49')](_0x1154ed)[_0xf160('0x25')](handleEntityNotFound(_0x43d243,null))['then'](respondWithResult(_0x43d243,null))['catch'](handleError(_0x43d243,null));};exports['create']=function(_0x50a97d,_0x406494){return db['ContactItemType'][_0xf160('0x4a')](_0x50a97d[_0xf160('0x4b')],{})[_0xf160('0x25')](function(_0x3bdfdb){var _0x4f2e23=_0x50a97d[_0xf160('0x4c')][_0xf160('0x27')]({'plain':!![]});if(!_0x4f2e23)throw new Error(_0xf160('0x4d'));if(_0x4f2e23['role']===_0xf160('0x4c')){var _0x40f855=_0x3bdfdb[_0xf160('0x27')]({'plain':!![]});var _0x5c3cee=_0xf160('0x4e');return db[_0xf160('0x4f')][_0xf160('0x49')]({'where':{'name':_0x5c3cee,'userProfileId':_0x4f2e23[_0xf160('0x50')]},'raw':!![]})[_0xf160('0x25')](function(_0x5d0fbb){if(_0x5d0fbb&&_0x5d0fbb['autoAssociation']===0x0){return db[_0xf160('0x28')]['create']({'name':_0x40f855[_0xf160('0x2b')],'resourceId':_0x40f855['id'],'type':_0x5d0fbb[_0xf160('0x2b')],'sectionId':_0x5d0fbb['id']},{})['then'](function(){return _0x3bdfdb;});}else{return _0x3bdfdb;}})['catch'](function(_0x321309){logger[_0xf160('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x321309);throw _0x321309;});}return _0x3bdfdb;})[_0xf160('0x25')](respondWithResult(_0x406494,0xc9))[_0xf160('0x44')](handleError(_0x406494,null));};exports[_0xf160('0x24')]=function(_0x405d7e,_0x5f3ded){if(_0x405d7e[_0xf160('0x4b')]['id']){delete _0x405d7e['body']['id'];}return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x405d7e[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x5f3ded,null))[_0xf160('0x25')](saveUpdates(_0x405d7e['body'],null))[_0xf160('0x25')](respondWithResult(_0x5f3ded,null))['catch'](handleError(_0x5f3ded,null));};exports[_0xf160('0x26')]=function(_0x1229cd,_0x39628d){return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x1229cd[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x39628d,null))[_0xf160('0x25')](db[_0xf160('0x51')][_0xf160('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1229cd['params']['id']}}))['then'](removeEntity(_0x39628d,null))[_0xf160('0x44')](handleError(_0x39628d,null));};
\ No newline at end of file
index 3a54763..7818044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x445b=['rimraf','../../config/environment','./contactItemType.attributes','exports','tools_contact_item_types','util','../../config/logger','api','moment','request-promise'];(function(_0x5e130a,_0x17640c){var _0x56326c=function(_0x1456b0){while(--_0x1456b0){_0x5e130a['push'](_0x5e130a['shift']());}};_0x56326c(++_0x17640c);}(_0x445b,0x1db));var _0xb445=function(_0x3a3e29,_0x7b7582){_0x3a3e29=_0x3a3e29-0x0;var _0x38038b=_0x445b[_0x3a3e29];return _0x38038b;};'use strict';var _=require('lodash');var util=require(_0xb445('0x0'));var logger=require(_0xb445('0x1'))(_0xb445('0x2'));var moment=require(_0xb445('0x3'));var BPromise=require('bluebird');var rp=require(_0xb445('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb445('0x5'));var config=require(_0xb445('0x6'));var attributes=require(_0xb445('0x7'));module[_0xb445('0x8')]=function(_0x51a45b,_0x27a7e5){return _0x51a45b['define']('ContactItemType',attributes,{'tableName':_0xb445('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6a5=['ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','request-promise','path','rimraf','./contactItemType.attributes','exports','define'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa6a5,0xb6));var _0x5a6a=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa6a5[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x5a6a('0x0'));var util=require(_0x5a6a('0x1'));var logger=require(_0x5a6a('0x2'))(_0x5a6a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5a6a('0x4'));var fs=require('fs');var path=require(_0x5a6a('0x5'));var rimraf=require(_0x5a6a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5a6a('0x7'));module[_0x5a6a('0x8')]=function(_0x181982,_0x431ba1){return _0x181982[_0x5a6a('0x9')](_0x5a6a('0xa'),attributes,{'tableName':_0x5a6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3f715c..f1a2f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8cd=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x484398,_0x9fab7f){var _0x11bd7b=function(_0x56ff35){while(--_0x56ff35){_0x484398['push'](_0x484398['shift']());}};_0x11bd7b(++_0x9fab7f);}(_0xe8cd,0x90));var _0xde8c=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0xe8cd[_0x29ce14];return _0x48f289;};'use strict';var _=require('lodash');var util=require(_0xde8c('0x0'));var moment=require(_0xde8c('0x1'));var BPromise=require(_0xde8c('0x2'));var rs=require(_0xde8c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde8c('0x4'))['db'];var utils=require(_0xde8c('0x5'));var logger=require(_0xde8c('0x6'))('rpc');var config=require(_0xde8c('0x7'));var jayson=require(_0xde8c('0x8'));var client=jayson['client'][_0xde8c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11f2d,_0x4c4fcb,_0x2996ca){return new BPromise(function(_0x1d3c3a,_0x4f8517){return client[_0xde8c('0xa')](_0x11f2d,_0x2996ca)[_0xde8c('0xb')](function(_0x71275f){logger[_0xde8c('0xc')](_0xde8c('0xd'),_0x4c4fcb,_0xde8c('0xe'));logger[_0xde8c('0xf')](_0xde8c('0x10'),_0x4c4fcb,'request\x20sent',JSON[_0xde8c('0x11')](_0x71275f));if(_0x71275f['error']){if(_0x71275f[_0xde8c('0x12')][_0xde8c('0x13')]===0x1f4){logger[_0xde8c('0x12')](_0xde8c('0xd'),_0x4c4fcb,_0x71275f[_0xde8c('0x12')][_0xde8c('0x14')]);return _0x4f8517(_0x71275f[_0xde8c('0x12')]['message']);}logger[_0xde8c('0x12')](_0xde8c('0xd'),_0x4c4fcb,_0x71275f[_0xde8c('0x12')][_0xde8c('0x14')]);return _0x1d3c3a(_0x71275f[_0xde8c('0x12')][_0xde8c('0x14')]);}else{logger[_0xde8c('0xc')](_0xde8c('0xd'),_0x4c4fcb,_0xde8c('0xe'));_0x1d3c3a(_0x71275f[_0xde8c('0x15')]['message']);}})[_0xde8c('0x16')](function(_0xc9339d){logger[_0xde8c('0x12')](_0xde8c('0xd'),_0x4c4fcb,_0xc9339d);_0x4f8517(_0xc9339d);});});}
\ No newline at end of file
+var _0xfb00=['request\x20sent','stringify','error','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','debug','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x4b5a7d,_0x392706){var _0x111405=function(_0x42cd7d){while(--_0x42cd7d){_0x4b5a7d['push'](_0x4b5a7d['shift']());}};_0x111405(++_0x392706);}(_0xfb00,0x167));var _0x0fb0=function(_0x3e82f9,_0x5548d9){_0x3e82f9=_0x3e82f9-0x0;var _0x53585c=_0xfb00[_0x3e82f9];return _0x53585c;};'use strict';var _=require(_0x0fb0('0x0'));var util=require('util');var moment=require(_0x0fb0('0x1'));var BPromise=require(_0x0fb0('0x2'));var rs=require(_0x0fb0('0x3'));var fs=require('fs');var Redis=require(_0x0fb0('0x4'));var db=require(_0x0fb0('0x5'))['db'];var utils=require(_0x0fb0('0x6'));var logger=require('../../config/logger')(_0x0fb0('0x7'));var config=require(_0x0fb0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0fb0('0x9')][_0x0fb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e20ce,_0x482061,_0x593507){return new BPromise(function(_0x4ebadb,_0x124b7b){return client[_0x0fb0('0xb')](_0x5e20ce,_0x593507)['then'](function(_0x1b7ba2){logger[_0x0fb0('0xc')]('ContactItemType,\x20%s,\x20%s',_0x482061,'request\x20sent');logger[_0x0fb0('0xd')](_0x0fb0('0xe'),_0x482061,_0x0fb0('0xf'),JSON[_0x0fb0('0x10')](_0x1b7ba2));if(_0x1b7ba2['error']){if(_0x1b7ba2['error']['code']===0x1f4){logger[_0x0fb0('0x11')](_0x0fb0('0x12'),_0x482061,_0x1b7ba2[_0x0fb0('0x11')][_0x0fb0('0x13')]);return _0x124b7b(_0x1b7ba2[_0x0fb0('0x11')][_0x0fb0('0x13')]);}logger['error'](_0x0fb0('0x12'),_0x482061,_0x1b7ba2[_0x0fb0('0x11')][_0x0fb0('0x13')]);return _0x4ebadb(_0x1b7ba2[_0x0fb0('0x11')][_0x0fb0('0x13')]);}else{logger[_0x0fb0('0xc')](_0x0fb0('0x12'),_0x482061,_0x0fb0('0xf'));_0x4ebadb(_0x1b7ba2[_0x0fb0('0x14')][_0x0fb0('0x13')]);}})[_0x0fb0('0x15')](function(_0x5121bb){logger[_0x0fb0('0x11')](_0x0fb0('0x12'),_0x482061,_0x5121bb);_0x124b7b(_0x5121bb);});});}
\ No newline at end of file
index 5bccde8..8bc6ffd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd661=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2377e3,_0x2c0352){var _0x2a6d1b=function(_0x536523){while(--_0x536523){_0x2377e3['push'](_0x2377e3['shift']());}};_0x2a6d1b(++_0x2c0352);}(_0xd661,0x172));var _0x1d66=function(_0x231372,_0x1b07fd){_0x231372=_0x231372-0x0;var _0x807eea=_0xd661[_0x231372];return _0x807eea;};'use strict';var multer=require(_0x1d66('0x0'));var util=require(_0x1d66('0x1'));var path=require(_0x1d66('0x2'));var timeout=require(_0x1d66('0x3'));var express=require(_0x1d66('0x4'));var router=express[_0x1d66('0x5')]();var fs_extra=require(_0x1d66('0x6'));var auth=require(_0x1d66('0x7'));var interaction=require(_0x1d66('0x8'));var config=require(_0x1d66('0x9'));var controller=require('./contactItemType.controller');router[_0x1d66('0xa')]('/',auth[_0x1d66('0xb')](),controller[_0x1d66('0xc')]);router['get'](_0x1d66('0xd'),auth[_0x1d66('0xb')](),controller[_0x1d66('0xe')]);router[_0x1d66('0xf')]('/',auth[_0x1d66('0xb')](),controller[_0x1d66('0x10')]);router[_0x1d66('0x11')](_0x1d66('0xd'),auth[_0x1d66('0xb')](),controller[_0x1d66('0x12')]);router['delete'](_0x1d66('0xd'),auth[_0x1d66('0xb')](),controller[_0x1d66('0x13')]);module[_0x1d66('0x14')]=router;
\ No newline at end of file
+var _0x3f87=['post','create','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x206b49,_0x531be2){var _0x12275c=function(_0x447bbc){while(--_0x447bbc){_0x206b49['push'](_0x206b49['shift']());}};_0x12275c(++_0x531be2);}(_0x3f87,0x76));var _0x73f8=function(_0x3da11e,_0x1f3fd4){_0x3da11e=_0x3da11e-0x0;var _0x4e37c3=_0x3f87[_0x3da11e];return _0x4e37c3;};'use strict';var multer=require(_0x73f8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x73f8('0x1'));var express=require(_0x73f8('0x2'));var router=express['Router']();var fs_extra=require(_0x73f8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x73f8('0x4'));var config=require(_0x73f8('0x5'));var controller=require('./contactItemType.controller');router[_0x73f8('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x73f8('0x7'),auth[_0x73f8('0x8')](),controller[_0x73f8('0x9')]);router[_0x73f8('0xa')]('/',auth[_0x73f8('0x8')](),controller[_0x73f8('0xb')]);router[_0x73f8('0xc')](_0x73f8('0x7'),auth['isAuthenticated'](),controller[_0x73f8('0xd')]);router[_0x73f8('0xe')](_0x73f8('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x73f8('0xf')]=router;
\ No newline at end of file
index 8f5b517..6537272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['name','exports','STRING'];(function(_0x3f6ef2,_0x464b71){var _0x540544=function(_0x187f0f){while(--_0x187f0f){_0x3f6ef2['push'](_0x3f6ef2['shift']());}};_0x540544(++_0x464b71);}(_0x2032,0xd9));var _0x2203=function(_0x1aba11,_0x14accb){_0x1aba11=_0x1aba11-0x0;var _0x20201b=_0x2032[_0x1aba11];return _0x20201b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2032=['name','exports','STRING'];(function(_0x58ab18,_0x392d07){var _0x2cc712=function(_0x45682d){while(--_0x45682d){_0x58ab18['push'](_0x58ab18['shift']());}};_0x2cc712(++_0x392d07);}(_0x2032,0xd9));var _0x2203=function(_0xcd9b37,_0x1b4654){_0xcd9b37=_0xcd9b37-0x0;var _0x3e0989=_0x2032[_0xcd9b37];return _0x3e0989;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 65b7702..c0967a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23ce=['findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrReport','attrRefresh','addItem','DashboardId','DashboardItem','getItems','pick','eml-format','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./dashboard.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','Dashboard'];(function(_0x1362c9,_0x1fc9c4){var _0x147264=function(_0x19d7f8){while(--_0x19d7f8){_0x1362c9['push'](_0x1362c9['shift']());}};_0x147264(++_0x1fc9c4);}(_0x23ce,0x13a));var _0xe23c=function(_0x3530b0,_0x47de47){_0x3530b0=_0x3530b0-0x0;var _0x3e7429=_0x23ce[_0x3530b0];return _0x3e7429;};'use strict';var emlformat=require(_0xe23c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe23c('0x1'));var jsonpatch=require(_0xe23c('0x2'));var rp=require(_0xe23c('0x3'));var moment=require(_0xe23c('0x4'));var BPromise=require(_0xe23c('0x5'));var Mustache=require(_0xe23c('0x6'));var util=require(_0xe23c('0x7'));var path=require(_0xe23c('0x8'));var sox=require(_0xe23c('0x9'));var csv=require(_0xe23c('0xa'));var ejs=require(_0xe23c('0xb'));var fs=require('fs');var fs_extra=require(_0xe23c('0xc'));var _=require(_0xe23c('0xd'));var squel=require(_0xe23c('0xe'));var crypto=require(_0xe23c('0xf'));var jsforce=require(_0xe23c('0x10'));var deskjs=require(_0xe23c('0x11'));var toCsv=require(_0xe23c('0xa'));var querystring=require(_0xe23c('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe23c('0x13'));var qs=require(_0xe23c('0x14'));var as=require(_0xe23c('0x15'));var hardwareService=require(_0xe23c('0x16'));var logger=require('../../config/logger')(_0xe23c('0x17'));var utils=require('../../config/utils');var config=require(_0xe23c('0x18'));var licenseUtil=require(_0xe23c('0x19'));var db=require(_0xe23c('0x1a'))['db'];config['redis']=_[_0xe23c('0x1b')](config['redis'],{'host':_0xe23c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe23c('0x1d')]));require(_0xe23c('0x1e'))[_0xe23c('0x1f')](socket);function respondWithStatusCode(_0xdd8166,_0x3f963b){_0x3f963b=_0x3f963b||0xcc;return function(_0x56270){if(_0x56270){return _0xdd8166['sendStatus'](_0x3f963b);}return _0xdd8166[_0xe23c('0x20')](_0x3f963b)[_0xe23c('0x21')]();};}function respondWithResult(_0x21e170,_0x2270c4){_0x2270c4=_0x2270c4||0xc8;return function(_0x26c17d){if(_0x26c17d){return _0x21e170['status'](_0x2270c4)[_0xe23c('0x22')](_0x26c17d);}};}function respondWithFilteredResult(_0x341dec,_0x323bbd){return function(_0x1a0c3b){if(_0x1a0c3b){var _0x2046e3=typeof _0x323bbd[_0xe23c('0x23')]==='undefined'&&typeof _0x323bbd[_0xe23c('0x24')]===_0xe23c('0x25');var _0x64f248=_0x1a0c3b[_0xe23c('0x26')];var _0xc650d5=_0x2046e3?0x0:_0x323bbd[_0xe23c('0x23')];var _0x44195a=_0x2046e3?_0x1a0c3b['count']:_0x323bbd[_0xe23c('0x23')]+_0x323bbd[_0xe23c('0x24')];var _0x275e47;if(_0x44195a>=_0x64f248){_0x44195a=_0x64f248;_0x275e47=0xc8;}else{_0x275e47=0xce;}_0x341dec[_0xe23c('0x20')](_0x275e47);return _0x341dec[_0xe23c('0x27')](_0xe23c('0x28'),_0xc650d5+'-'+_0x44195a+'/'+_0x64f248)['json'](_0x1a0c3b);}return null;};}function patchUpdates(_0x4aab73){return function(_0x91c113){try{jsonpatch[_0xe23c('0x29')](_0x91c113,_0x4aab73,!![]);}catch(_0x2121fe){return BPromise[_0xe23c('0x2a')](_0x2121fe);}return _0x91c113['save']();};}function saveUpdates(_0x137991,_0x5d5dff){return function(_0x1e8aad){if(_0x1e8aad){return _0x1e8aad[_0xe23c('0x2b')](_0x137991)[_0xe23c('0x2c')](function(_0x22147c){return _0x22147c;});}return null;};}function removeEntity(_0x403fc9,_0x1fb8c5){return function(_0x343889){if(_0x343889){return _0x343889[_0xe23c('0x2d')]()['then'](function(){var _0x43d4cb=_0x343889[_0xe23c('0x2e')]({'plain':!![]});var _0x21b38c=_0xe23c('0x2f');return db[_0xe23c('0x30')][_0xe23c('0x2d')]({'where':{'type':_0x21b38c,'resourceId':_0x43d4cb['id']}})[_0xe23c('0x2c')](function(){return _0x343889;});})[_0xe23c('0x2c')](function(){_0x403fc9[_0xe23c('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x500dc1,_0x511b1b){return function(_0x15f810){if(!_0x15f810){_0x500dc1['sendStatus'](0x194);}return _0x15f810;};}function handleError(_0x2752d4,_0x3b5ef7){_0x3b5ef7=_0x3b5ef7||0x1f4;return function(_0x731245){logger[_0xe23c('0x31')](_0x731245[_0xe23c('0x32')]);if(_0x731245[_0xe23c('0x33')]){delete _0x731245[_0xe23c('0x33')];}_0x2752d4[_0xe23c('0x20')](_0x3b5ef7)['send'](_0x731245);};}exports[_0xe23c('0x34')]=function(_0x27bdf4,_0xa60761){var _0x472ad0={},_0x16bbf0={},_0x4122a3={'count':0x0,'rows':[]};var _0x17a27c=_['map'](db['Dashboard'][_0xe23c('0x35')],function(_0x5024a1){return{'name':_0x5024a1['fieldName'],'type':_0x5024a1[_0xe23c('0x36')][_0xe23c('0x37')]};});_0x16bbf0[_0xe23c('0x38')]=_[_0xe23c('0x39')](_0x17a27c,_0xe23c('0x33'));_0x16bbf0[_0xe23c('0x3a')]=_[_0xe23c('0x3b')](_0x27bdf4[_0xe23c('0x3a')]);_0x16bbf0[_0xe23c('0x3c')]=_[_0xe23c('0x3d')](_0x16bbf0['model'],_0x16bbf0[_0xe23c('0x3a')]);_0x472ad0[_0xe23c('0x3e')]=_[_0xe23c('0x3d')](_0x16bbf0[_0xe23c('0x38')],qs[_0xe23c('0x3f')](_0x27bdf4['query'][_0xe23c('0x3f')]));_0x472ad0[_0xe23c('0x3e')]=_0x472ad0[_0xe23c('0x3e')][_0xe23c('0x40')]?_0x472ad0['attributes']:_0x16bbf0[_0xe23c('0x38')];if(!_0x27bdf4['query'][_0xe23c('0x41')](_0xe23c('0x42'))){_0x472ad0[_0xe23c('0x24')]=qs[_0xe23c('0x24')](_0x27bdf4[_0xe23c('0x3a')]['limit']);_0x472ad0['offset']=qs[_0xe23c('0x23')](_0x27bdf4[_0xe23c('0x3a')]['offset']);}_0x472ad0[_0xe23c('0x43')]=qs[_0xe23c('0x44')](_0x27bdf4[_0xe23c('0x3a')][_0xe23c('0x44')]);_0x472ad0[_0xe23c('0x45')]=qs['filters'](_['pick'](_0x27bdf4[_0xe23c('0x3a')],_0x16bbf0['filters']),_0x17a27c);if(_0x27bdf4[_0xe23c('0x3a')][_0xe23c('0x46')]){_0x472ad0['where']=_[_0xe23c('0x47')](_0x472ad0[_0xe23c('0x45')],{'$or':_[_0xe23c('0x39')](_0x17a27c,function(_0x5e1491){if(_0x5e1491[_0xe23c('0x36')]!=='VIRTUAL'){var _0x36ab14={};_0x36ab14[_0x5e1491['name']]={'$like':'%'+_0x27bdf4[_0xe23c('0x3a')][_0xe23c('0x46')]+'%'};return _0x36ab14;}})});}_0x472ad0=_[_0xe23c('0x47')]({},_0x472ad0,_0x27bdf4[_0xe23c('0x48')]);var _0x2af746={'where':_0x472ad0[_0xe23c('0x45')]};return db['Dashboard'][_0xe23c('0x26')](_0x2af746)['then'](function(_0xc6b454){_0x4122a3['count']=_0xc6b454;if(_0x27bdf4[_0xe23c('0x3a')][_0xe23c('0x49')]){_0x472ad0[_0xe23c('0x4a')]=[{'all':!![]}];}return db[_0xe23c('0x4b')][_0xe23c('0x4c')](_0x472ad0);})[_0xe23c('0x2c')](function(_0x4bbf4e){_0x4122a3[_0xe23c('0x4d')]=_0x4bbf4e;return _0x4122a3;})[_0xe23c('0x2c')](respondWithFilteredResult(_0xa60761,_0x472ad0))[_0xe23c('0x4e')](handleError(_0xa60761,null));};exports[_0xe23c('0x4f')]=function(_0x2dd198,_0x2f7192){var _0x5d576a={'raw':![],'where':{'id':_0x2dd198[_0xe23c('0x50')]['id']}},_0x532c2a={};_0x532c2a[_0xe23c('0x38')]=_[_0xe23c('0x3b')](db[_0xe23c('0x4b')][_0xe23c('0x35')]);_0x532c2a[_0xe23c('0x3a')]=_[_0xe23c('0x3b')](_0x2dd198[_0xe23c('0x3a')]);_0x532c2a['filters']=_[_0xe23c('0x3d')](_0x532c2a[_0xe23c('0x38')],_0x532c2a[_0xe23c('0x3a')]);_0x5d576a[_0xe23c('0x3e')]=_['intersection'](_0x532c2a['model'],qs[_0xe23c('0x3f')](_0x2dd198[_0xe23c('0x3a')][_0xe23c('0x3f')]));_0x5d576a['attributes']=_0x5d576a['attributes'][_0xe23c('0x40')]?_0x5d576a['attributes']:_0x532c2a[_0xe23c('0x38')];if(_0x2dd198[_0xe23c('0x3a')][_0xe23c('0x49')]){_0x5d576a[_0xe23c('0x4a')]=[{'all':!![]}];}_0x5d576a=_[_0xe23c('0x47')]({},_0x5d576a,_0x2dd198[_0xe23c('0x48')]);return db[_0xe23c('0x4b')][_0xe23c('0x51')](_0x5d576a)[_0xe23c('0x2c')](handleEntityNotFound(_0x2f7192,null))['then'](respondWithResult(_0x2f7192,null))[_0xe23c('0x4e')](handleError(_0x2f7192,null));};exports[_0xe23c('0x52')]=function(_0x53036f,_0x2de0a0){return db['Dashboard'][_0xe23c('0x52')](_0x53036f[_0xe23c('0x53')],{})['then'](function(_0x27e69e){var _0x41841b=_0x53036f[_0xe23c('0x54')]['get']({'plain':!![]});if(!_0x41841b)throw new Error(_0xe23c('0x55'));if(_0x41841b[_0xe23c('0x56')]==='user'){var _0x7a9b25=_0x27e69e[_0xe23c('0x2e')]({'plain':!![]});var _0x5bd3bf='CustomDashboards';return db[_0xe23c('0x57')][_0xe23c('0x51')]({'where':{'name':_0x5bd3bf,'userProfileId':_0x41841b['userProfileId']},'raw':!![]})['then'](function(_0x3294d2){if(_0x3294d2&&_0x3294d2[_0xe23c('0x58')]===0x0){return db['UserProfileResource'][_0xe23c('0x52')]({'name':_0x7a9b25[_0xe23c('0x33')],'resourceId':_0x7a9b25['id'],'type':_0x3294d2['name'],'sectionId':_0x3294d2['id']},{})[_0xe23c('0x2c')](function(){return _0x27e69e;});}else{return _0x27e69e;}})[_0xe23c('0x4e')](function(_0x2a893b){logger[_0xe23c('0x31')](_0xe23c('0x59'),_0x2a893b);throw _0x2a893b;});}return _0x27e69e;})[_0xe23c('0x2c')](respondWithResult(_0x2de0a0,0xc9))[_0xe23c('0x4e')](handleError(_0x2de0a0,null));};exports[_0xe23c('0x5a')]=function(_0x52c012,_0x3f4ce0){var _0x2340cc={'where':{'id':_0x52c012[_0xe23c('0x50')]['id']}},_0x42846c={};_0x42846c[_0xe23c('0x38')]=_[_0xe23c('0x3b')](db['Dashboard'][_0xe23c('0x35')]);_0x2340cc[_0xe23c('0x3e')]=_[_0xe23c('0x3d')](_0x42846c[_0xe23c('0x38')],qs[_0xe23c('0x3f')](_0x52c012[_0xe23c('0x3a')]['fields']));_0x2340cc[_0xe23c('0x3e')]=_0x2340cc[_0xe23c('0x3e')][_0xe23c('0x40')]?_0x2340cc[_0xe23c('0x3e')]:_0x42846c['model'];if(_0x52c012[_0xe23c('0x3a')]['includeAll']){_0x2340cc[_0xe23c('0x4a')]=[{'all':!![]}];}_0x2340cc=_[_0xe23c('0x47')]({},_0x2340cc,_0x52c012['options']);return db[_0xe23c('0x4b')][_0xe23c('0x51')](_0x2340cc)[_0xe23c('0x2c')](handleEntityNotFound(_0x3f4ce0,null))['then'](function(_0x32abed){if(_0x32abed){var _0x3329c3=_0x32abed[_0xe23c('0x2e')]({'plain':!![]});_0x3329c3=qs[_0xe23c('0x5b')](_0x3329c3,['id',_0xe23c('0x5c'),_0xe23c('0x5d')]);_0x52c012[_0xe23c('0x53')]=_[_0xe23c('0x5b')](_0x52c012[_0xe23c('0x53')],['id',_0xe23c('0x5c'),'updatedAt']);return db[_0xe23c('0x4b')][_0xe23c('0x52')](_[_0xe23c('0x47')](_0x3329c3,_0x52c012[_0xe23c('0x53')]),{'include':_0x52c012['query'][_0xe23c('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x380603){var _0x21ef92=_0x52c012[_0xe23c('0x54')]['get']({'plain':!![]});if(!_0x21ef92)throw new Error(_0xe23c('0x55'));if(_0x21ef92[_0xe23c('0x56')]==='user'){var _0x2282d3=_0x380603['get']({'plain':!![]});var _0x179069=_0xe23c('0x2f');return db['UserProfileSection'][_0xe23c('0x51')]({'where':{'name':_0x179069,'userProfileId':_0x21ef92[_0xe23c('0x5e')]},'raw':!![]})[_0xe23c('0x2c')](function(_0x456447){if(_0x456447&&_0x456447[_0xe23c('0x58')]===0x0){return db['UserProfileResource'][_0xe23c('0x52')]({'name':_0x2282d3[_0xe23c('0x33')],'resourceId':_0x2282d3['id'],'type':_0x456447[_0xe23c('0x33')],'sectionId':_0x456447['id']},{})['then'](function(){return _0x380603;});}else{return _0x380603;}})[_0xe23c('0x4e')](function(_0x86ae33){logger[_0xe23c('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x86ae33);throw _0x86ae33;});}return _0x380603;});}})['then'](respondWithResult(_0x3f4ce0,0xc9))['catch'](handleError(_0x3f4ce0,null));};exports[_0xe23c('0x2b')]=function(_0x21bd36,_0x154532){if(_0x21bd36['body']['id']){delete _0x21bd36[_0xe23c('0x53')]['id'];}return db[_0xe23c('0x4b')][_0xe23c('0x51')]({'where':{'id':_0x21bd36['params']['id']}})[_0xe23c('0x2c')](handleEntityNotFound(_0x154532,null))[_0xe23c('0x2c')](saveUpdates(_0x21bd36[_0xe23c('0x53')],null))[_0xe23c('0x2c')](respondWithResult(_0x154532,null))[_0xe23c('0x4e')](handleError(_0x154532,null));};exports[_0xe23c('0x2d')]=function(_0x292e66,_0x403755){return db[_0xe23c('0x4b')][_0xe23c('0x51')]({'where':{'id':_0x292e66[_0xe23c('0x50')]['id']}})[_0xe23c('0x2c')](handleEntityNotFound(_0x403755,null))[_0xe23c('0x2c')](removeEntity(_0x403755,null))['catch'](handleError(_0x403755,null));};function widgetAttributes(_0x5d521a){try{switch(_0x5d521a[_0xe23c('0x36')]){case _0xe23c('0x5f'):return[{'name':_0xe23c('0x60'),'value':_0x5d521a[_0xe23c('0x60')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a['attrs'][0x0]?_0x5d521a[_0xe23c('0x61')][0x0][_0xe23c('0x62')]:undefined)||_0xe23c('0x63')}];case _0xe23c('0x64'):return[{'name':_0xe23c('0x65'),'value':_0x5d521a['attrPath']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x0]?_0x5d521a['attrs'][0x0][_0xe23c('0x62')]:undefined)||''}];case'clock':return[{'name':_0xe23c('0x66'),'value':_0x5d521a[_0xe23c('0x66')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x0]?_0x5d521a['attrs'][0x0][_0xe23c('0x62')]:undefined)||_0xe23c('0x67')},{'name':'attrTimezone','value':_0x5d521a[_0xe23c('0x68')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x1]?_0x5d521a[_0xe23c('0x61')][0x1]['value']:undefined)||_0xe23c('0x69')},{'name':_0xe23c('0x6a'),'value':_0x5d521a[_0xe23c('0x6a')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x2]?_0x5d521a['attrs'][0x2][_0xe23c('0x62')]:undefined)||0xc}];case _0xe23c('0x6b'):return[{'name':_0xe23c('0x6c'),'value':_0x5d521a['attrMetric']||(_0x5d521a['attrs']&&_0x5d521a[_0xe23c('0x61')][0x0]?_0x5d521a[_0xe23c('0x61')][0x0]['value']:undefined)||_0xe23c('0x6d')},{'name':_0xe23c('0x6e'),'value':_0x5d521a[_0xe23c('0x6e')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x1]?_0x5d521a[_0xe23c('0x61')][0x1]['value']:undefined)||[]},{'name':_0xe23c('0x6a'),'value':_0x5d521a['attrFontSize']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x2]?_0x5d521a['attrs'][0x2][_0xe23c('0x62')]:undefined)||0x14},{'name':_0xe23c('0x6f'),'value':_0x5d521a[_0xe23c('0x6f')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x3]?_0x5d521a['attrs'][0x3]['value']:undefined)||_0xe23c('0x70')},{'name':_0xe23c('0x71'),'value':_0x5d521a[_0xe23c('0x71')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x4]?_0x5d521a[_0xe23c('0x61')][0x4]['value']:undefined)||''},{'name':_0xe23c('0x72'),'value':_0x5d521a[_0xe23c('0x72')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x5]?_0x5d521a['attrs'][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x5d521a[_0xe23c('0x73')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x6]?_0x5d521a[_0xe23c('0x61')][0x6][_0xe23c('0x62')]:undefined)||''},{'name':_0xe23c('0x74'),'value':_0x5d521a[_0xe23c('0x74')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x7]?_0x5d521a['attrs'][0x7]['value']:undefined)||''},{'name':_0xe23c('0x75'),'value':_0x5d521a['attrWhatsappAccounts']||(_0x5d521a['attrs']&&_0x5d521a[_0xe23c('0x61')][0x8]?_0x5d521a[_0xe23c('0x61')][0x8][_0xe23c('0x62')]:undefined)||''},{'name':_0xe23c('0x76'),'value':_0x5d521a[_0xe23c('0x76')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x9]?_0x5d521a[_0xe23c('0x61')][0x9]['value']:undefined)||''}];case _0xe23c('0x77'):case _0xe23c('0x78'):return[{'name':_0xe23c('0x79'),'value':_0x5d521a[_0xe23c('0x79')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a['attrs'][0x0]?_0x5d521a[_0xe23c('0x61')][0x0][_0xe23c('0x62')]:undefined)||'total'},{'name':_0xe23c('0x7a'),'value':_0x5d521a[_0xe23c('0x7a')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a['attrs'][0x1]?_0x5d521a[_0xe23c('0x61')][0x1][_0xe23c('0x62')]:undefined)||null},{'name':'attrSerie3','value':_0x5d521a['attrSerie3']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x2]?_0x5d521a[_0xe23c('0x61')][0x2][_0xe23c('0x62')]:undefined)||null},{'name':_0xe23c('0x6e'),'value':_0x5d521a['attrVoiceQueues']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x3]?_0x5d521a[_0xe23c('0x61')][0x3][_0xe23c('0x62')]:undefined)||[]},{'name':_0xe23c('0x6f'),'value':_0x5d521a[_0xe23c('0x6f')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x4]?_0x5d521a['attrs'][0x4][_0xe23c('0x62')]:undefined)||_0xe23c('0x70')},{'name':_0xe23c('0x71'),'value':_0x5d521a[_0xe23c('0x71')]||(_0x5d521a['attrs']&&_0x5d521a['attrs'][0x5]?_0x5d521a[_0xe23c('0x61')][0x5][_0xe23c('0x62')]:undefined)||''},{'name':_0xe23c('0x72'),'value':_0x5d521a[_0xe23c('0x72')]||(_0x5d521a['attrs']&&_0x5d521a['attrs'][0x6]?_0x5d521a['attrs'][0x6][_0xe23c('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x5d521a['attrSmsAccounts']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x7]?_0x5d521a[_0xe23c('0x61')][0x7][_0xe23c('0x62')]:undefined)||''},{'name':_0xe23c('0x74'),'value':_0x5d521a[_0xe23c('0x74')]||(_0x5d521a['attrs']&&_0x5d521a[_0xe23c('0x61')][0x8]?_0x5d521a[_0xe23c('0x61')][0x8][_0xe23c('0x62')]:undefined)||''},{'name':_0xe23c('0x75'),'value':_0x5d521a[_0xe23c('0x75')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x9]?_0x5d521a['attrs'][0x9][_0xe23c('0x62')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5d521a['attrChatWebsites']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0xa]?_0x5d521a[_0xe23c('0x61')][0xa][_0xe23c('0x62')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x5d521a['reportType']||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x0]?_0x5d521a[_0xe23c('0x61')][0x0]['type']:undefined)||null,'value':_0x5d521a[_0xe23c('0x7b')]||(_0x5d521a['attrs']&&_0x5d521a[_0xe23c('0x61')][0x0]?_0x5d521a['attrs'][0x0]['value']:undefined)||null},{'name':_0xe23c('0x7c'),'value':_0x5d521a[_0xe23c('0x7c')]||(_0x5d521a[_0xe23c('0x61')]&&_0x5d521a[_0xe23c('0x61')][0x1]?_0x5d521a[_0xe23c('0x61')][0x1][_0xe23c('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x2552e1){logger[_0xe23c('0x31')]('widgetAttributes:\x20%s',JSON['stringify'](_0x2552e1));return[];}}exports[_0xe23c('0x7d')]=function(_0x1d23ce,_0x540a0d,_0x5d239b){if(_0x1d23ce[_0xe23c('0x53')]['id']){delete _0x1d23ce[_0xe23c('0x53')]['id'];}return db[_0xe23c('0x4b')]['find']({'where':{'id':_0x1d23ce[_0xe23c('0x50')]['id']}})[_0xe23c('0x2c')](handleEntityNotFound(_0x540a0d,null))['then'](function(_0x32a3e9){if(_0x32a3e9){_0x1d23ce[_0xe23c('0x53')][_0xe23c('0x7e')]=_0x32a3e9['id'];_0x1d23ce[_0xe23c('0x53')][_0xe23c('0x61')]=widgetAttributes(_0x1d23ce['body']);return db[_0xe23c('0x7f')][_0xe23c('0x52')](_0x1d23ce['body']);}})['then'](respondWithResult(_0x540a0d,null))[_0xe23c('0x4e')](handleError(_0x540a0d,null));};exports[_0xe23c('0x80')]=function(_0x4b6583,_0x5b10ea,_0x1b8ffb){var _0x2d383b={};var _0x814be0={};var _0x28984e;var _0x19bd43;return db[_0xe23c('0x4b')]['findOne']({'where':{'id':_0x4b6583[_0xe23c('0x50')]['id']}})[_0xe23c('0x2c')](handleEntityNotFound(_0x5b10ea,null))[_0xe23c('0x2c')](function(_0x121142){if(_0x121142){_0x28984e=_0x121142;_0x814be0[_0xe23c('0x38')]=_[_0xe23c('0x3b')](db['DashboardItem'][_0xe23c('0x35')]);_0x814be0[_0xe23c('0x3a')]=_[_0xe23c('0x3b')](_0x4b6583[_0xe23c('0x3a')]);_0x814be0[_0xe23c('0x3c')]=_[_0xe23c('0x3d')](_0x814be0[_0xe23c('0x38')],_0x814be0['query']);_0x2d383b[_0xe23c('0x3e')]=_[_0xe23c('0x3d')](_0x814be0['model'],qs['fields'](_0x4b6583[_0xe23c('0x3a')][_0xe23c('0x3f')]));_0x2d383b[_0xe23c('0x3e')]=_0x2d383b[_0xe23c('0x3e')][_0xe23c('0x40')]?_0x2d383b['attributes']:_0x814be0[_0xe23c('0x38')];_0x2d383b[_0xe23c('0x43')]=qs['sort'](_0x4b6583[_0xe23c('0x3a')][_0xe23c('0x44')]);_0x2d383b[_0xe23c('0x45')]=qs[_0xe23c('0x3c')](_[_0xe23c('0x81')](_0x4b6583[_0xe23c('0x3a')],_0x814be0[_0xe23c('0x3c')]));if(_0x4b6583['query']['filter']){_0x2d383b['where']=_[_0xe23c('0x47')](_0x2d383b[_0xe23c('0x45')],{'$or':_[_0xe23c('0x39')](_0x2d383b[_0xe23c('0x3e')],function(_0x16c8e8){var _0x3c012e={};_0x3c012e[_0x16c8e8]={'$like':'%'+_0x4b6583[_0xe23c('0x3a')][_0xe23c('0x46')]+'%'};return _0x3c012e;})});}_0x2d383b=_[_0xe23c('0x47')]({},_0x2d383b,_0x4b6583[_0xe23c('0x48')]);return _0x28984e[_0xe23c('0x80')](_0x2d383b);}})[_0xe23c('0x2c')](function(_0xffcb5c){if(_0xffcb5c){_0x19bd43=_0xffcb5c[_0xe23c('0x40')];if(!_0x4b6583[_0xe23c('0x3a')][_0xe23c('0x41')]('nolimit')){_0x2d383b['limit']=qs[_0xe23c('0x24')](_0x4b6583[_0xe23c('0x3a')][_0xe23c('0x24')]);_0x2d383b[_0xe23c('0x23')]=qs[_0xe23c('0x23')](_0x4b6583[_0xe23c('0x3a')][_0xe23c('0x23')]);}return _0x28984e[_0xe23c('0x80')](_0x2d383b);}})[_0xe23c('0x2c')](function(_0x308d2b){if(_0x308d2b){return _0x308d2b?{'count':_0x19bd43,'rows':_0x308d2b}:null;}})[_0xe23c('0x2c')](respondWithResult(_0x5b10ea,null))[_0xe23c('0x4e')](handleError(_0x5b10ea,null));};
\ No newline at end of file
+var _0xd587=['includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','role','UserProfileSection','update','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','status','json','limit','undefined','count','offset','set','apply','reject','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','Dashboard','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','VIRTUAL','options'];(function(_0xaaf1dd,_0x131aa5){var _0x1546b7=function(_0x516543){while(--_0x516543){_0xaaf1dd['push'](_0xaaf1dd['shift']());}};_0x1546b7(++_0x131aa5);}(_0xd587,0x1be));var _0x7d58=function(_0x1a26f1,_0x2014d8){_0x1a26f1=_0x1a26f1-0x0;var _0x52687d=_0xd587[_0x1a26f1];return _0x52687d;};'use strict';var emlformat=require(_0x7d58('0x0'));var rimraf=require(_0x7d58('0x1'));var zipdir=require(_0x7d58('0x2'));var jsonpatch=require(_0x7d58('0x3'));var rp=require(_0x7d58('0x4'));var moment=require(_0x7d58('0x5'));var BPromise=require(_0x7d58('0x6'));var Mustache=require(_0x7d58('0x7'));var util=require(_0x7d58('0x8'));var path=require(_0x7d58('0x9'));var sox=require(_0x7d58('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d58('0xb'));var _=require(_0x7d58('0xc'));var squel=require(_0x7d58('0xd'));var crypto=require(_0x7d58('0xe'));var jsforce=require(_0x7d58('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d58('0x10'));var Papa=require(_0x7d58('0x11'));var Redis=require(_0x7d58('0x12'));var authService=require(_0x7d58('0x13'));var qs=require(_0x7d58('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d58('0x15'));var logger=require(_0x7d58('0x16'))(_0x7d58('0x17'));var utils=require(_0x7d58('0x18'));var config=require(_0x7d58('0x19'));var licenseUtil=require(_0x7d58('0x1a'));var db=require('../../mysqldb')['db'];config[_0x7d58('0x1b')]=_[_0x7d58('0x1c')](config[_0x7d58('0x1b')],{'host':_0x7d58('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x7d58('0x1e')](socket);function respondWithStatusCode(_0x120c7e,_0x1b1745){_0x1b1745=_0x1b1745||0xcc;return function(_0x530779){if(_0x530779){return _0x120c7e['sendStatus'](_0x1b1745);}return _0x120c7e[_0x7d58('0x1f')](_0x1b1745)['end']();};}function respondWithResult(_0xac5471,_0x1c39ef){_0x1c39ef=_0x1c39ef||0xc8;return function(_0x3a9558){if(_0x3a9558){return _0xac5471['status'](_0x1c39ef)[_0x7d58('0x20')](_0x3a9558);}};}function respondWithFilteredResult(_0x45ebcf,_0x5587ed){return function(_0x14b131){if(_0x14b131){var _0x55d479=typeof _0x5587ed['offset']==='undefined'&&typeof _0x5587ed[_0x7d58('0x21')]===_0x7d58('0x22');var _0x1449f0=_0x14b131[_0x7d58('0x23')];var _0x2beb29=_0x55d479?0x0:_0x5587ed[_0x7d58('0x24')];var _0x27ecee=_0x55d479?_0x14b131[_0x7d58('0x23')]:_0x5587ed['offset']+_0x5587ed['limit'];var _0x202e62;if(_0x27ecee>=_0x1449f0){_0x27ecee=_0x1449f0;_0x202e62=0xc8;}else{_0x202e62=0xce;}_0x45ebcf[_0x7d58('0x1f')](_0x202e62);return _0x45ebcf[_0x7d58('0x25')]('Content-Range',_0x2beb29+'-'+_0x27ecee+'/'+_0x1449f0)['json'](_0x14b131);}return null;};}function patchUpdates(_0x33aa4c){return function(_0x226224){try{jsonpatch[_0x7d58('0x26')](_0x226224,_0x33aa4c,!![]);}catch(_0x4cddc3){return BPromise[_0x7d58('0x27')](_0x4cddc3);}return _0x226224['save']();};}function saveUpdates(_0x431af7,_0x467c9d){return function(_0x4aac0f){if(_0x4aac0f){return _0x4aac0f['update'](_0x431af7)[_0x7d58('0x28')](function(_0x59ec31){return _0x59ec31;});}return null;};}function removeEntity(_0x4acb43,_0x55d23f){return function(_0x5ceef2){if(_0x5ceef2){return _0x5ceef2[_0x7d58('0x29')]()['then'](function(){var _0xc2e83=_0x5ceef2[_0x7d58('0x2a')]({'plain':!![]});var _0x1cecc3=_0x7d58('0x2b');return db[_0x7d58('0x2c')][_0x7d58('0x29')]({'where':{'type':_0x1cecc3,'resourceId':_0xc2e83['id']}})[_0x7d58('0x28')](function(){return _0x5ceef2;});})[_0x7d58('0x28')](function(){_0x4acb43[_0x7d58('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x170a21,_0x92d2fe){return function(_0x53e8c1){if(!_0x53e8c1){_0x170a21['sendStatus'](0x194);}return _0x53e8c1;};}function handleError(_0xd70ee3,_0x21a77d){_0x21a77d=_0x21a77d||0x1f4;return function(_0x4221df){logger[_0x7d58('0x2d')](_0x4221df[_0x7d58('0x2e')]);if(_0x4221df['name']){delete _0x4221df[_0x7d58('0x2f')];}_0xd70ee3[_0x7d58('0x1f')](_0x21a77d)[_0x7d58('0x30')](_0x4221df);};}exports['index']=function(_0x44521c,_0x579a24){var _0x400e84={},_0x2eccbb={},_0x3ea7b8={'count':0x0,'rows':[]};var _0x31d8d3=_['map'](db[_0x7d58('0x31')][_0x7d58('0x32')],function(_0x58ad14){return{'name':_0x58ad14['fieldName'],'type':_0x58ad14['type'][_0x7d58('0x33')]};});_0x2eccbb[_0x7d58('0x34')]=_['map'](_0x31d8d3,_0x7d58('0x2f'));_0x2eccbb[_0x7d58('0x35')]=_[_0x7d58('0x36')](_0x44521c[_0x7d58('0x35')]);_0x2eccbb[_0x7d58('0x37')]=_[_0x7d58('0x38')](_0x2eccbb['model'],_0x2eccbb['query']);_0x400e84[_0x7d58('0x39')]=_['intersection'](_0x2eccbb['model'],qs['fields'](_0x44521c[_0x7d58('0x35')][_0x7d58('0x3a')]));_0x400e84[_0x7d58('0x39')]=_0x400e84[_0x7d58('0x39')][_0x7d58('0x3b')]?_0x400e84[_0x7d58('0x39')]:_0x2eccbb[_0x7d58('0x34')];if(!_0x44521c[_0x7d58('0x35')][_0x7d58('0x3c')]('nolimit')){_0x400e84[_0x7d58('0x21')]=qs[_0x7d58('0x21')](_0x44521c[_0x7d58('0x35')]['limit']);_0x400e84['offset']=qs[_0x7d58('0x24')](_0x44521c[_0x7d58('0x35')][_0x7d58('0x24')]);}_0x400e84[_0x7d58('0x3d')]=qs['sort'](_0x44521c['query'][_0x7d58('0x3e')]);_0x400e84[_0x7d58('0x3f')]=qs['filters'](_['pick'](_0x44521c[_0x7d58('0x35')],_0x2eccbb[_0x7d58('0x37')]),_0x31d8d3);if(_0x44521c[_0x7d58('0x35')][_0x7d58('0x40')]){_0x400e84[_0x7d58('0x3f')]=_[_0x7d58('0x41')](_0x400e84[_0x7d58('0x3f')],{'$or':_[_0x7d58('0x42')](_0x31d8d3,function(_0x529ab8){if(_0x529ab8[_0x7d58('0x43')]!==_0x7d58('0x44')){var _0x34e86a={};_0x34e86a[_0x529ab8[_0x7d58('0x2f')]]={'$like':'%'+_0x44521c[_0x7d58('0x35')][_0x7d58('0x40')]+'%'};return _0x34e86a;}})});}_0x400e84=_[_0x7d58('0x41')]({},_0x400e84,_0x44521c[_0x7d58('0x45')]);var _0x28343e={'where':_0x400e84[_0x7d58('0x3f')]};return db[_0x7d58('0x31')][_0x7d58('0x23')](_0x28343e)[_0x7d58('0x28')](function(_0x35316d){_0x3ea7b8[_0x7d58('0x23')]=_0x35316d;if(_0x44521c[_0x7d58('0x35')][_0x7d58('0x46')]){_0x400e84[_0x7d58('0x47')]=[{'all':!![]}];}return db[_0x7d58('0x31')][_0x7d58('0x48')](_0x400e84);})[_0x7d58('0x28')](function(_0x2cc72d){_0x3ea7b8[_0x7d58('0x49')]=_0x2cc72d;return _0x3ea7b8;})[_0x7d58('0x28')](respondWithFilteredResult(_0x579a24,_0x400e84))[_0x7d58('0x4a')](handleError(_0x579a24,null));};exports[_0x7d58('0x4b')]=function(_0x4132e1,_0x4dbd77){var _0x2bf8e6={'raw':![],'where':{'id':_0x4132e1[_0x7d58('0x4c')]['id']}},_0x1405e7={};_0x1405e7[_0x7d58('0x34')]=_[_0x7d58('0x36')](db[_0x7d58('0x31')][_0x7d58('0x32')]);_0x1405e7[_0x7d58('0x35')]=_[_0x7d58('0x36')](_0x4132e1[_0x7d58('0x35')]);_0x1405e7[_0x7d58('0x37')]=_[_0x7d58('0x38')](_0x1405e7[_0x7d58('0x34')],_0x1405e7[_0x7d58('0x35')]);_0x2bf8e6[_0x7d58('0x39')]=_[_0x7d58('0x38')](_0x1405e7['model'],qs['fields'](_0x4132e1[_0x7d58('0x35')][_0x7d58('0x3a')]));_0x2bf8e6[_0x7d58('0x39')]=_0x2bf8e6[_0x7d58('0x39')][_0x7d58('0x3b')]?_0x2bf8e6[_0x7d58('0x39')]:_0x1405e7[_0x7d58('0x34')];if(_0x4132e1[_0x7d58('0x35')]['includeAll']){_0x2bf8e6[_0x7d58('0x47')]=[{'all':!![]}];}_0x2bf8e6=_[_0x7d58('0x41')]({},_0x2bf8e6,_0x4132e1[_0x7d58('0x45')]);return db[_0x7d58('0x31')][_0x7d58('0x4d')](_0x2bf8e6)[_0x7d58('0x28')](handleEntityNotFound(_0x4dbd77,null))['then'](respondWithResult(_0x4dbd77,null))['catch'](handleError(_0x4dbd77,null));};exports['create']=function(_0x555d80,_0x148de4){return db[_0x7d58('0x31')][_0x7d58('0x4e')](_0x555d80['body'],{})['then'](function(_0x315f04){var _0x2c2d06=_0x555d80['user'][_0x7d58('0x2a')]({'plain':!![]});if(!_0x2c2d06)throw new Error(_0x7d58('0x4f'));if(_0x2c2d06['role']===_0x7d58('0x50')){var _0x205f4e=_0x315f04[_0x7d58('0x2a')]({'plain':!![]});var _0x37b66e=_0x7d58('0x2b');return db['UserProfileSection'][_0x7d58('0x4d')]({'where':{'name':_0x37b66e,'userProfileId':_0x2c2d06[_0x7d58('0x51')]},'raw':!![]})[_0x7d58('0x28')](function(_0xedde4){if(_0xedde4&&_0xedde4[_0x7d58('0x52')]===0x0){return db[_0x7d58('0x2c')][_0x7d58('0x4e')]({'name':_0x205f4e[_0x7d58('0x2f')],'resourceId':_0x205f4e['id'],'type':_0xedde4['name'],'sectionId':_0xedde4['id']},{})[_0x7d58('0x28')](function(){return _0x315f04;});}else{return _0x315f04;}})[_0x7d58('0x4a')](function(_0x4d6456){logger[_0x7d58('0x2d')](_0x7d58('0x53'),_0x4d6456);throw _0x4d6456;});}return _0x315f04;})[_0x7d58('0x28')](respondWithResult(_0x148de4,0xc9))[_0x7d58('0x4a')](handleError(_0x148de4,null));};exports[_0x7d58('0x54')]=function(_0x49bccd,_0x364048){var _0x380cd9={'where':{'id':_0x49bccd[_0x7d58('0x4c')]['id']}},_0x35f621={};_0x35f621[_0x7d58('0x34')]=_[_0x7d58('0x36')](db[_0x7d58('0x31')]['rawAttributes']);_0x380cd9['attributes']=_['intersection'](_0x35f621['model'],qs[_0x7d58('0x3a')](_0x49bccd[_0x7d58('0x35')][_0x7d58('0x3a')]));_0x380cd9[_0x7d58('0x39')]=_0x380cd9[_0x7d58('0x39')]['length']?_0x380cd9[_0x7d58('0x39')]:_0x35f621[_0x7d58('0x34')];if(_0x49bccd[_0x7d58('0x35')]['includeAll']){_0x380cd9[_0x7d58('0x47')]=[{'all':!![]}];}_0x380cd9=_['merge']({},_0x380cd9,_0x49bccd[_0x7d58('0x45')]);return db[_0x7d58('0x31')]['find'](_0x380cd9)[_0x7d58('0x28')](handleEntityNotFound(_0x364048,null))[_0x7d58('0x28')](function(_0x277fa9){if(_0x277fa9){var _0x27572d=_0x277fa9[_0x7d58('0x2a')]({'plain':!![]});_0x27572d=qs[_0x7d58('0x55')](_0x27572d,['id','createdAt',_0x7d58('0x56')]);_0x49bccd[_0x7d58('0x57')]=_[_0x7d58('0x55')](_0x49bccd['body'],['id',_0x7d58('0x58'),'updatedAt']);return db[_0x7d58('0x31')][_0x7d58('0x4e')](_[_0x7d58('0x41')](_0x27572d,_0x49bccd[_0x7d58('0x57')]),{'include':_0x49bccd[_0x7d58('0x35')][_0x7d58('0x46')]?[{'all':!![]}]:undefined})[_0x7d58('0x28')](function(_0x28d01e){var _0x4cb1fe=_0x49bccd[_0x7d58('0x50')]['get']({'plain':!![]});if(!_0x4cb1fe)throw new Error(_0x7d58('0x4f'));if(_0x4cb1fe[_0x7d58('0x59')]===_0x7d58('0x50')){var _0x4f262c=_0x28d01e[_0x7d58('0x2a')]({'plain':!![]});var _0x222662=_0x7d58('0x2b');return db[_0x7d58('0x5a')]['find']({'where':{'name':_0x222662,'userProfileId':_0x4cb1fe['userProfileId']},'raw':!![]})[_0x7d58('0x28')](function(_0x5e8339){if(_0x5e8339&&_0x5e8339['autoAssociation']===0x0){return db[_0x7d58('0x2c')]['create']({'name':_0x4f262c[_0x7d58('0x2f')],'resourceId':_0x4f262c['id'],'type':_0x5e8339[_0x7d58('0x2f')],'sectionId':_0x5e8339['id']},{})['then'](function(){return _0x28d01e;});}else{return _0x28d01e;}})[_0x7d58('0x4a')](function(_0x4d893f){logger['error'](_0x7d58('0x53'),_0x4d893f);throw _0x4d893f;});}return _0x28d01e;});}})[_0x7d58('0x28')](respondWithResult(_0x364048,0xc9))['catch'](handleError(_0x364048,null));};exports[_0x7d58('0x5b')]=function(_0x37c105,_0x53f28a){if(_0x37c105[_0x7d58('0x57')]['id']){delete _0x37c105[_0x7d58('0x57')]['id'];}return db[_0x7d58('0x31')][_0x7d58('0x4d')]({'where':{'id':_0x37c105[_0x7d58('0x4c')]['id']}})['then'](handleEntityNotFound(_0x53f28a,null))['then'](saveUpdates(_0x37c105[_0x7d58('0x57')],null))[_0x7d58('0x28')](respondWithResult(_0x53f28a,null))['catch'](handleError(_0x53f28a,null));};exports[_0x7d58('0x29')]=function(_0x19a39f,_0x457ff5){return db['Dashboard'][_0x7d58('0x4d')]({'where':{'id':_0x19a39f['params']['id']}})['then'](handleEntityNotFound(_0x457ff5,null))['then'](removeEntity(_0x457ff5,null))['catch'](handleError(_0x457ff5,null));};function widgetAttributes(_0x5340a6){try{switch(_0x5340a6[_0x7d58('0x43')]){case _0x7d58('0x5c'):return[{'name':_0x7d58('0x5d'),'value':_0x5340a6[_0x7d58('0x5d')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x0]?_0x5340a6[_0x7d58('0x5e')][0x0][_0x7d58('0x5f')]:undefined)||'https://'}];case _0x7d58('0x60'):return[{'name':'attrPath','value':_0x5340a6[_0x7d58('0x61')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x0]?_0x5340a6[_0x7d58('0x5e')][0x0][_0x7d58('0x5f')]:undefined)||''}];case _0x7d58('0x62'):return[{'name':_0x7d58('0x63'),'value':_0x5340a6[_0x7d58('0x63')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x0]?_0x5340a6[_0x7d58('0x5e')][0x0][_0x7d58('0x5f')]:undefined)||_0x7d58('0x64')},{'name':'attrTimezone','value':_0x5340a6['attrTimezone']||(_0x5340a6['attrs']&&_0x5340a6[_0x7d58('0x5e')][0x1]?_0x5340a6[_0x7d58('0x5e')][0x1][_0x7d58('0x5f')]:undefined)||_0x7d58('0x65')},{'name':_0x7d58('0x66'),'value':_0x5340a6['attrFontSize']||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x2]?_0x5340a6[_0x7d58('0x5e')][0x2][_0x7d58('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0x7d58('0x67'),'value':_0x5340a6[_0x7d58('0x67')]||(_0x5340a6['attrs']&&_0x5340a6[_0x7d58('0x5e')][0x0]?_0x5340a6['attrs'][0x0][_0x7d58('0x5f')]:undefined)||_0x7d58('0x68')},{'name':'attrVoiceQueues','value':_0x5340a6[_0x7d58('0x69')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x1]?_0x5340a6[_0x7d58('0x5e')][0x1][_0x7d58('0x5f')]:undefined)||[]},{'name':_0x7d58('0x66'),'value':_0x5340a6[_0x7d58('0x66')]||(_0x5340a6['attrs']&&_0x5340a6[_0x7d58('0x5e')][0x2]?_0x5340a6['attrs'][0x2][_0x7d58('0x5f')]:undefined)||0x14},{'name':_0x7d58('0x6a'),'value':_0x5340a6[_0x7d58('0x6a')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x3]?_0x5340a6[_0x7d58('0x5e')][0x3]['value']:undefined)||_0x7d58('0x6b')},{'name':'attrEmailAccounts','value':_0x5340a6[_0x7d58('0x6c')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x4]?_0x5340a6['attrs'][0x4][_0x7d58('0x5f')]:undefined)||''},{'name':_0x7d58('0x6d'),'value':_0x5340a6['attrFaxAccounts']||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x5]?_0x5340a6[_0x7d58('0x5e')][0x5]['value']:undefined)||''},{'name':_0x7d58('0x6e'),'value':_0x5340a6[_0x7d58('0x6e')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x6]?_0x5340a6[_0x7d58('0x5e')][0x6][_0x7d58('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5340a6[_0x7d58('0x6f')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x7]?_0x5340a6[_0x7d58('0x5e')][0x7][_0x7d58('0x5f')]:undefined)||''},{'name':_0x7d58('0x70'),'value':_0x5340a6[_0x7d58('0x70')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x8]?_0x5340a6[_0x7d58('0x5e')][0x8][_0x7d58('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5340a6['attrChatWebsites']||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x9]?_0x5340a6[_0x7d58('0x5e')][0x9][_0x7d58('0x5f')]:undefined)||''}];case _0x7d58('0x71'):case _0x7d58('0x72'):return[{'name':_0x7d58('0x73'),'value':_0x5340a6[_0x7d58('0x73')]||(_0x5340a6['attrs']&&_0x5340a6[_0x7d58('0x5e')][0x0]?_0x5340a6[_0x7d58('0x5e')][0x0][_0x7d58('0x5f')]:undefined)||_0x7d58('0x68')},{'name':'attrSerie2','value':_0x5340a6[_0x7d58('0x74')]||(_0x5340a6['attrs']&&_0x5340a6['attrs'][0x1]?_0x5340a6['attrs'][0x1][_0x7d58('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x5340a6[_0x7d58('0x75')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x2]?_0x5340a6[_0x7d58('0x5e')][0x2][_0x7d58('0x5f')]:undefined)||null},{'name':_0x7d58('0x69'),'value':_0x5340a6[_0x7d58('0x69')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x3]?_0x5340a6['attrs'][0x3][_0x7d58('0x5f')]:undefined)||[]},{'name':_0x7d58('0x6a'),'value':_0x5340a6['attrChannel']||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x4]?_0x5340a6[_0x7d58('0x5e')][0x4][_0x7d58('0x5f')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x5340a6[_0x7d58('0x6c')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x5]?_0x5340a6[_0x7d58('0x5e')][0x5][_0x7d58('0x5f')]:undefined)||''},{'name':_0x7d58('0x6d'),'value':_0x5340a6[_0x7d58('0x6d')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x6]?_0x5340a6[_0x7d58('0x5e')][0x6][_0x7d58('0x5f')]:undefined)||''},{'name':_0x7d58('0x6e'),'value':_0x5340a6['attrSmsAccounts']||(_0x5340a6['attrs']&&_0x5340a6[_0x7d58('0x5e')][0x7]?_0x5340a6['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5340a6[_0x7d58('0x6f')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x8]?_0x5340a6['attrs'][0x8][_0x7d58('0x5f')]:undefined)||''},{'name':_0x7d58('0x70'),'value':_0x5340a6['attrWhatsappAccounts']||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x9]?_0x5340a6[_0x7d58('0x5e')][0x9][_0x7d58('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5340a6['attrChatWebsites']||(_0x5340a6['attrs']&&_0x5340a6[_0x7d58('0x5e')][0xa]?_0x5340a6[_0x7d58('0x5e')][0xa]['value']:undefined)||''}];case _0x7d58('0x76'):return[{'name':'attrReport','type':_0x5340a6[_0x7d58('0x77')]||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6[_0x7d58('0x5e')][0x0]?_0x5340a6[_0x7d58('0x5e')][0x0][_0x7d58('0x43')]:undefined)||null,'value':_0x5340a6['attrReport']||(_0x5340a6[_0x7d58('0x5e')]&&_0x5340a6['attrs'][0x0]?_0x5340a6[_0x7d58('0x5e')][0x0][_0x7d58('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x5340a6[_0x7d58('0x78')]||(_0x5340a6['attrs']&&_0x5340a6['attrs'][0x1]?_0x5340a6[_0x7d58('0x5e')][0x1][_0x7d58('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x5b71cf){logger[_0x7d58('0x2d')](_0x7d58('0x79'),JSON[_0x7d58('0x7a')](_0x5b71cf));return[];}}exports[_0x7d58('0x7b')]=function(_0x177248,_0x363996,_0x2ec5d0){if(_0x177248[_0x7d58('0x57')]['id']){delete _0x177248[_0x7d58('0x57')]['id'];}return db['Dashboard'][_0x7d58('0x4d')]({'where':{'id':_0x177248[_0x7d58('0x4c')]['id']}})['then'](handleEntityNotFound(_0x363996,null))['then'](function(_0x18e77e){if(_0x18e77e){_0x177248[_0x7d58('0x57')][_0x7d58('0x7c')]=_0x18e77e['id'];_0x177248[_0x7d58('0x57')][_0x7d58('0x5e')]=widgetAttributes(_0x177248[_0x7d58('0x57')]);return db[_0x7d58('0x7d')]['create'](_0x177248['body']);}})[_0x7d58('0x28')](respondWithResult(_0x363996,null))['catch'](handleError(_0x363996,null));};exports['getItems']=function(_0x1e3b3b,_0x19e3c1,_0x1a5a73){var _0x247dec={};var _0x2d9bf9={};var _0x23c4ac;var _0x5a3a2c;return db[_0x7d58('0x31')][_0x7d58('0x7e')]({'where':{'id':_0x1e3b3b['params']['id']}})[_0x7d58('0x28')](handleEntityNotFound(_0x19e3c1,null))['then'](function(_0x13f86b){if(_0x13f86b){_0x23c4ac=_0x13f86b;_0x2d9bf9['model']=_[_0x7d58('0x36')](db[_0x7d58('0x7d')][_0x7d58('0x32')]);_0x2d9bf9[_0x7d58('0x35')]=_['keys'](_0x1e3b3b[_0x7d58('0x35')]);_0x2d9bf9[_0x7d58('0x37')]=_[_0x7d58('0x38')](_0x2d9bf9[_0x7d58('0x34')],_0x2d9bf9[_0x7d58('0x35')]);_0x247dec[_0x7d58('0x39')]=_[_0x7d58('0x38')](_0x2d9bf9[_0x7d58('0x34')],qs[_0x7d58('0x3a')](_0x1e3b3b[_0x7d58('0x35')][_0x7d58('0x3a')]));_0x247dec['attributes']=_0x247dec[_0x7d58('0x39')][_0x7d58('0x3b')]?_0x247dec[_0x7d58('0x39')]:_0x2d9bf9[_0x7d58('0x34')];_0x247dec[_0x7d58('0x3d')]=qs[_0x7d58('0x3e')](_0x1e3b3b[_0x7d58('0x35')]['sort']);_0x247dec[_0x7d58('0x3f')]=qs[_0x7d58('0x37')](_[_0x7d58('0x7f')](_0x1e3b3b[_0x7d58('0x35')],_0x2d9bf9[_0x7d58('0x37')]));if(_0x1e3b3b['query'][_0x7d58('0x40')]){_0x247dec['where']=_[_0x7d58('0x41')](_0x247dec[_0x7d58('0x3f')],{'$or':_[_0x7d58('0x42')](_0x247dec[_0x7d58('0x39')],function(_0x1b6f5c){var _0x11ecd3={};_0x11ecd3[_0x1b6f5c]={'$like':'%'+_0x1e3b3b['query'][_0x7d58('0x40')]+'%'};return _0x11ecd3;})});}_0x247dec=_[_0x7d58('0x41')]({},_0x247dec,_0x1e3b3b['options']);return _0x23c4ac[_0x7d58('0x80')](_0x247dec);}})[_0x7d58('0x28')](function(_0x4bfdf3){if(_0x4bfdf3){_0x5a3a2c=_0x4bfdf3[_0x7d58('0x3b')];if(!_0x1e3b3b[_0x7d58('0x35')]['hasOwnProperty']('nolimit')){_0x247dec['limit']=qs[_0x7d58('0x21')](_0x1e3b3b[_0x7d58('0x35')][_0x7d58('0x21')]);_0x247dec[_0x7d58('0x24')]=qs['offset'](_0x1e3b3b['query'][_0x7d58('0x24')]);}return _0x23c4ac[_0x7d58('0x80')](_0x247dec);}})[_0x7d58('0x28')](function(_0x4f7796){if(_0x4f7796){return _0x4f7796?{'count':_0x5a3a2c,'rows':_0x4f7796}:null;}})[_0x7d58('0x28')](respondWithResult(_0x19e3c1,null))[_0x7d58('0x4a')](handleError(_0x19e3c1,null));};
\ No newline at end of file
index f60fa23..4e8331b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb7=['save','update','remove','emit','hasOwnProperty','hook','exports','Dashboard'];(function(_0x4fd979,_0x2124e0){var _0x4f48bf=function(_0x3a31f9){while(--_0x3a31f9){_0x4fd979['push'](_0x4fd979['shift']());}};_0x4f48bf(++_0x2124e0);}(_0x3cb7,0xcf));var _0x73cb=function(_0x148316,_0x6c9dc){_0x148316=_0x148316-0x0;var _0xdbe95d=_0x3cb7[_0x148316];return _0xdbe95d;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x73cb('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x73cb('0x1'),'afterUpdate':_0x73cb('0x2'),'afterDestroy':_0x73cb('0x3')};function emitEvent(_0x161127){return function(_0x1374a7,_0x3e3503,_0x14b044){DashboardEvents[_0x73cb('0x4')](_0x161127+':'+_0x1374a7['id'],_0x1374a7);DashboardEvents['emit'](_0x161127,_0x1374a7);_0x14b044(null);};}for(var e in events){if(events[_0x73cb('0x5')](e)){var event=events[e];Dashboard[_0x73cb('0x6')](e,emitEvent(event));}}module[_0x73cb('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0x16a7=['../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1fedc9,_0x29ff69){var _0xa72c64=function(_0x20f8fc){while(--_0x20f8fc){_0x1fedc9['push'](_0x1fedc9['shift']());}};_0xa72c64(++_0x29ff69);}(_0x16a7,0x182));var _0x716a=function(_0x34b029,_0x2856aa){_0x34b029=_0x34b029-0x0;var _0x2d17d1=_0x16a7[_0x34b029];return _0x2d17d1;};'use strict';var EventEmitter=require(_0x716a('0x0'));var Dashboard=require(_0x716a('0x1'))['db'][_0x716a('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x716a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x716a('0x4'),'afterDestroy':_0x716a('0x5')};function emitEvent(_0x1896c6){return function(_0xeae67c,_0x35a11b,_0x595577){DashboardEvents[_0x716a('0x6')](_0x1896c6+':'+_0xeae67c['id'],_0xeae67c);DashboardEvents[_0x716a('0x6')](_0x1896c6,_0xeae67c);_0x595577(null);};}for(var e in events){if(events[_0x716a('0x7')](e)){var event=events[e];Dashboard[_0x716a('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index 948ab1a..e92172b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc40=['api','moment','request-promise','rimraf','../../config/environment','exports','dashboards','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcc40,0x97));var _0x0cc4=function(_0x264659,_0x197677){_0x264659=_0x264659-0x0;var _0x1ac1a9=_0xcc40[_0x264659];return _0x1ac1a9;};'use strict';var _=require(_0x0cc4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0cc4('0x1'));var moment=require(_0x0cc4('0x2'));var BPromise=require('bluebird');var rp=require(_0x0cc4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cc4('0x4'));var config=require(_0x0cc4('0x5'));var attributes=require('./dashboard.attributes');module[_0x0cc4('0x6')]=function(_0x5bbfa7,_0xbe15f4){return _0x5bbfa7['define']('Dashboard',attributes,{'tableName':_0x0cc4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc32c=['rimraf','../../config/environment','./dashboard.attributes','exports','dashboards','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44252b,_0x53fcc4){var _0x3ddd52=function(_0x346011){while(--_0x346011){_0x44252b['push'](_0x44252b['shift']());}};_0x3ddd52(++_0x53fcc4);}(_0xc32c,0xec));var _0xcc32=function(_0x526caa,_0x1924ab){_0x526caa=_0x526caa-0x0;var _0x260d50=_0xc32c[_0x526caa];return _0x260d50;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc32('0x0'))(_0xcc32('0x1'));var moment=require(_0xcc32('0x2'));var BPromise=require(_0xcc32('0x3'));var rp=require(_0xcc32('0x4'));var fs=require('fs');var path=require(_0xcc32('0x5'));var rimraf=require(_0xcc32('0x6'));var config=require(_0xcc32('0x7'));var attributes=require(_0xcc32('0x8'));module[_0xcc32('0x9')]=function(_0x402a1e,_0x5e1b23){return _0x402a1e['define']('Dashboard',attributes,{'tableName':_0xcc32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9e00ca9..0c8913d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24d3=['code','message','Dashboard,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./dashboard.socket','register','request','info','request\x20sent','debug','stringify','error'];(function(_0x59e532,_0x4a4866){var _0x41033c=function(_0x58d08f){while(--_0x58d08f){_0x59e532['push'](_0x59e532['shift']());}};_0x41033c(++_0x4a4866);}(_0x24d3,0x1b5));var _0x324d=function(_0x459820,_0x1b8e1d){_0x459820=_0x459820-0x0;var _0xafadeb=_0x24d3[_0x459820];return _0xafadeb;};'use strict';var _=require(_0x324d('0x0'));var util=require(_0x324d('0x1'));var moment=require(_0x324d('0x2'));var BPromise=require(_0x324d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x324d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x324d('0x5'))(_0x324d('0x6'));var config=require('../../config/environment');var jayson=require(_0x324d('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x324d('0x8')]=_[_0x324d('0x9')](config[_0x324d('0x8')],{'host':_0x324d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x324d('0x8')]));require(_0x324d('0xb'))[_0x324d('0xc')](socket);function respondWithRpcPromise(_0x577fda,_0x2d139a,_0x51c4e5){return new BPromise(function(_0x4f0186,_0x56c7b8){return client[_0x324d('0xd')](_0x577fda,_0x51c4e5)['then'](function(_0x5f0178){logger[_0x324d('0xe')]('Dashboard,\x20%s,\x20%s',_0x2d139a,_0x324d('0xf'));logger[_0x324d('0x10')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2d139a,'request\x20sent',JSON[_0x324d('0x11')](_0x5f0178));if(_0x5f0178['error']){if(_0x5f0178[_0x324d('0x12')][_0x324d('0x13')]===0x1f4){logger[_0x324d('0x12')]('Dashboard,\x20%s,\x20%s',_0x2d139a,_0x5f0178[_0x324d('0x12')][_0x324d('0x14')]);return _0x56c7b8(_0x5f0178['error'][_0x324d('0x14')]);}logger[_0x324d('0x12')](_0x324d('0x15'),_0x2d139a,_0x5f0178['error']['message']);return _0x4f0186(_0x5f0178[_0x324d('0x12')][_0x324d('0x14')]);}else{logger[_0x324d('0xe')](_0x324d('0x15'),_0x2d139a,_0x324d('0xf'));_0x4f0186(_0x5f0178[_0x324d('0x16')][_0x324d('0x14')]);}})[_0x324d('0x17')](function(_0x493b52){logger['error']('Dashboard,\x20%s,\x20%s',_0x2d139a,_0x493b52);_0x56c7b8(_0x493b52);});});}
\ No newline at end of file
+var _0xece4=['request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket'];(function(_0x14fed7,_0x40e63a){var _0x1fedd3=function(_0x312fc1){while(--_0x312fc1){_0x14fed7['push'](_0x14fed7['shift']());}};_0x1fedd3(++_0x40e63a);}(_0xece4,0x14e));var _0x4ece=function(_0x2bb134,_0x53f433){_0x2bb134=_0x2bb134-0x0;var _0x427750=_0xece4[_0x2bb134];return _0x427750;};'use strict';var _=require(_0x4ece('0x0'));var util=require('util');var moment=require(_0x4ece('0x1'));var BPromise=require(_0x4ece('0x2'));var rs=require(_0x4ece('0x3'));var fs=require('fs');var Redis=require(_0x4ece('0x4'));var db=require(_0x4ece('0x5'))['db'];var utils=require(_0x4ece('0x6'));var logger=require(_0x4ece('0x7'))('rpc');var config=require(_0x4ece('0x8'));var jayson=require(_0x4ece('0x9'));var client=jayson[_0x4ece('0xa')][_0x4ece('0xb')]({'port':0x232a});config[_0x4ece('0xc')]=_[_0x4ece('0xd')](config[_0x4ece('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ece('0xe'))(new Redis(config['redis']));require(_0x4ece('0xf'))['register'](socket);function respondWithRpcPromise(_0x56e93c,_0x4c6749,_0x5a8f0e){return new BPromise(function(_0x59eb2b,_0x5c4926){return client[_0x4ece('0x10')](_0x56e93c,_0x5a8f0e)[_0x4ece('0x11')](function(_0x3b15c3){logger[_0x4ece('0x12')](_0x4ece('0x13'),_0x4c6749,_0x4ece('0x14'));logger['debug'](_0x4ece('0x15'),_0x4c6749,'request\x20sent',JSON['stringify'](_0x3b15c3));if(_0x3b15c3['error']){if(_0x3b15c3[_0x4ece('0x16')]['code']===0x1f4){logger[_0x4ece('0x16')]('Dashboard,\x20%s,\x20%s',_0x4c6749,_0x3b15c3[_0x4ece('0x16')]['message']);return _0x5c4926(_0x3b15c3[_0x4ece('0x16')][_0x4ece('0x17')]);}logger[_0x4ece('0x16')](_0x4ece('0x13'),_0x4c6749,_0x3b15c3[_0x4ece('0x16')]['message']);return _0x59eb2b(_0x3b15c3[_0x4ece('0x16')][_0x4ece('0x17')]);}else{logger['info'](_0x4ece('0x13'),_0x4c6749,_0x4ece('0x14'));_0x59eb2b(_0x3b15c3[_0x4ece('0x18')][_0x4ece('0x17')]);}})['catch'](function(_0xd54fc7){logger[_0x4ece('0x16')](_0x4ece('0x13'),_0x4c6749,_0xd54fc7);_0x5c4926(_0xd54fc7);});});}
\ No newline at end of file
index 4825d77..898fc63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88a2=['emit','register','save','remove','update'];(function(_0x10d575,_0x6edf30){var _0x21ce4a=function(_0x320e92){while(--_0x320e92){_0x10d575['push'](_0x10d575['shift']());}};_0x21ce4a(++_0x6edf30);}(_0x88a2,0x1b0));var _0x288a=function(_0x35ecc9,_0x22d5b4){_0x35ecc9=_0x35ecc9-0x0;var _0x53d5fc=_0x88a2[_0x35ecc9];return _0x53d5fc;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x288a('0x0'),_0x288a('0x1'),_0x288a('0x2')];function createListener(_0x548d0b,_0x29c818){return function(_0x1303db){_0x29c818[_0x288a('0x3')](_0x548d0b,_0x1303db);};}function removeListener(_0x1cd7bf,_0xd148ba){return function(){DashboardEvents['removeListener'](_0x1cd7bf,_0xd148ba);};}exports[_0x288a('0x4')]=function(_0x3d6a76){for(var _0x36a3d2=0x0,_0x275e78=events['length'];_0x36a3d2<_0x275e78;_0x36a3d2++){var _0x4c2fde=events[_0x36a3d2];var _0x5c8c08=createListener('dashboard:'+_0x4c2fde,_0x3d6a76);DashboardEvents['on'](_0x4c2fde,_0x5c8c08);}};
\ No newline at end of file
+var _0xfc58=['length','dashboard:','./dashboard.events','save','remove','emit','register'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xfc58,0xdb));var _0x8fc5=function(_0x5b1394,_0x17f08d){_0x5b1394=_0x5b1394-0x0;var _0x483150=_0xfc58[_0x5b1394];return _0x483150;};'use strict';var DashboardEvents=require(_0x8fc5('0x0'));var events=[_0x8fc5('0x1'),_0x8fc5('0x2'),'update'];function createListener(_0x41e969,_0x4c1a4a){return function(_0x43393){_0x4c1a4a[_0x8fc5('0x3')](_0x41e969,_0x43393);};}function removeListener(_0x38ca9b,_0x5751f2){return function(){DashboardEvents['removeListener'](_0x38ca9b,_0x5751f2);};}exports[_0x8fc5('0x4')]=function(_0x41908d){for(var _0x3cbba8=0x0,_0x37c37a=events[_0x8fc5('0x5')];_0x3cbba8<_0x37c37a;_0x3cbba8++){var _0x5e0bf7=events[_0x3cbba8];var _0x28ba7d=createListener(_0x8fc5('0x6')+_0x5e0bf7,_0x41908d);DashboardEvents['on'](_0x5e0bf7,_0x28ba7d);}};
\ No newline at end of file
index 8b7132c..7e60068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f1e=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/items','post','/:id/clone','clone','addItem','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f1e,0x96));var _0xe6f1=function(_0x9f9e55,_0x27b2ef){_0x9f9e55=_0x9f9e55-0x0;var _0x171dbe=_0x6f1e[_0x9f9e55];return _0x171dbe;};'use strict';var multer=require(_0xe6f1('0x0'));var util=require(_0xe6f1('0x1'));var path=require(_0xe6f1('0x2'));var timeout=require(_0xe6f1('0x3'));var express=require(_0xe6f1('0x4'));var router=express[_0xe6f1('0x5')]();var fs_extra=require(_0xe6f1('0x6'));var auth=require(_0xe6f1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0xe6f1('0x8')]('/',auth[_0xe6f1('0x9')](),controller[_0xe6f1('0xa')]);router[_0xe6f1('0x8')](_0xe6f1('0xb'),auth['isAuthenticated'](),controller[_0xe6f1('0xc')]);router[_0xe6f1('0x8')](_0xe6f1('0xd'),auth[_0xe6f1('0x9')](),controller['getItems']);router[_0xe6f1('0xe')]('/',auth[_0xe6f1('0x9')](),controller['create']);router['post'](_0xe6f1('0xf'),auth[_0xe6f1('0x9')](),controller[_0xe6f1('0x10')]);router[_0xe6f1('0xe')](_0xe6f1('0xd'),auth['isAuthenticated'](),controller[_0xe6f1('0x11')]);router[_0xe6f1('0x12')](_0xe6f1('0xb'),auth['isAuthenticated'](),controller[_0xe6f1('0x13')]);router[_0xe6f1('0x14')](_0xe6f1('0xb'),auth[_0xe6f1('0x9')](),controller[_0xe6f1('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xf416=['post','create','/:id/clone','clone','addItem','put','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/items'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf416,0x196));var _0x6f41=function(_0x289518,_0x1804ac){_0x289518=_0x289518-0x0;var _0x4dbf97=_0xf416[_0x289518];return _0x4dbf97;};'use strict';var multer=require('multer');var util=require(_0x6f41('0x0'));var path=require(_0x6f41('0x1'));var timeout=require(_0x6f41('0x2'));var express=require(_0x6f41('0x3'));var router=express[_0x6f41('0x4')]();var fs_extra=require(_0x6f41('0x5'));var auth=require(_0x6f41('0x6'));var interaction=require(_0x6f41('0x7'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x6f41('0x8')]('/',auth[_0x6f41('0x9')](),controller[_0x6f41('0xa')]);router[_0x6f41('0x8')](_0x6f41('0xb'),auth['isAuthenticated'](),controller[_0x6f41('0xc')]);router[_0x6f41('0x8')](_0x6f41('0xd'),auth[_0x6f41('0x9')](),controller['getItems']);router[_0x6f41('0xe')]('/',auth[_0x6f41('0x9')](),controller[_0x6f41('0xf')]);router[_0x6f41('0xe')](_0x6f41('0x10'),auth['isAuthenticated'](),controller[_0x6f41('0x11')]);router[_0x6f41('0xe')](_0x6f41('0xd'),auth[_0x6f41('0x9')](),controller[_0x6f41('0x12')]);router[_0x6f41('0x13')](_0x6f41('0xb'),auth[_0x6f41('0x9')](),controller['update']);router[_0x6f41('0x14')](_0x6f41('0xb'),auth[_0x6f41('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 501350a..ab3e6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x563796,_0x3a9b29){var _0x43428c=function(_0x29e0e1){while(--_0x29e0e1){_0x563796['push'](_0x563796['shift']());}};_0x43428c(++_0x3a9b29);}(_0x4975,0x86));var _0x5497=function(_0x953d76,_0x592c68){_0x953d76=_0x953d76-0x0;var _0x2b599e=_0x4975[_0x953d76];return _0x2b599e;};'use strict';var Sequelize=require(_0x5497('0x0'));var squel=require('squel');var _=require(_0x5497('0x1'));module[_0x5497('0x2')]={'title':{'type':Sequelize[_0x5497('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5497('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5497('0x4')](_0x5497('0x5')),'get':function(){try{return JSON[_0x5497('0x6')](this[_0x5497('0x7')](_0x5497('0x8')));}catch(_0x5d5272){return[];}},'set':function(_0x539a27){try{this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')](_0x539a27));}catch(_0x674a2a){this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5497('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5497('0xb')]},'col':{'type':Sequelize[_0x5497('0xb')]},'background':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5497('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xfdbd[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index 8fe6d21..b521213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd87=['attrs','https://','custom','attrPath','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','error','stack','show','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','merge','options','find','then','catch','params','type','attrUrl'];(function(_0x3b84d5,_0xd86e10){var _0x50a084=function(_0x4b7704){while(--_0x4b7704){_0x3b84d5['push'](_0x3b84d5['shift']());}};_0x50a084(++_0xd86e10);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7fd8('0x0'));var rimraf=require(_0x7fd8('0x1'));var zipdir=require(_0x7fd8('0x2'));var jsonpatch=require(_0x7fd8('0x3'));var rp=require(_0x7fd8('0x4'));var moment=require(_0x7fd8('0x5'));var BPromise=require(_0x7fd8('0x6'));var Mustache=require(_0x7fd8('0x7'));var util=require(_0x7fd8('0x8'));var path=require(_0x7fd8('0x9'));var sox=require(_0x7fd8('0xa'));var csv=require('to-csv');var ejs=require(_0x7fd8('0xb'));var fs=require('fs');var fs_extra=require(_0x7fd8('0xc'));var _=require('lodash');var squel=require(_0x7fd8('0xd'));var crypto=require(_0x7fd8('0xe'));var jsforce=require(_0x7fd8('0xf'));var deskjs=require(_0x7fd8('0x10'));var toCsv=require(_0x7fd8('0x11'));var querystring=require('querystring');var Papa=require(_0x7fd8('0x12'));var Redis=require(_0x7fd8('0x13'));var authService=require(_0x7fd8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fd8('0x15'))('api');var utils=require(_0x7fd8('0x16'));var config=require(_0x7fd8('0x17'));var licenseUtil=require(_0x7fd8('0x18'));var db=require('../../mysqldb')['db'];config[_0x7fd8('0x19')]=_[_0x7fd8('0x1a')](config[_0x7fd8('0x19')],{'host':_0x7fd8('0x1b'),'port':0x18eb});var socket=require(_0x7fd8('0x1c'))(new Redis(config['redis']));require(_0x7fd8('0x1d'))[_0x7fd8('0x1e')](socket);function respondWithStatusCode(_0x1d481a,_0x1131ef){_0x1131ef=_0x1131ef||0xcc;return function(_0x250a02){if(_0x250a02){return _0x1d481a[_0x7fd8('0x1f')](_0x1131ef);}return _0x1d481a[_0x7fd8('0x20')](_0x1131ef)[_0x7fd8('0x21')]();};}function respondWithResult(_0x2a8818,_0x1461ed){_0x1461ed=_0x1461ed||0xc8;return function(_0x416158){if(_0x416158){return _0x2a8818['status'](_0x1461ed)['json'](_0x416158);}};}function respondWithFilteredResult(_0x5ca7f6,_0xab57f7){return function(_0xce23dc){if(_0xce23dc){var _0x48734c=typeof _0xab57f7[_0x7fd8('0x22')]===_0x7fd8('0x23')&&typeof _0xab57f7[_0x7fd8('0x24')]===_0x7fd8('0x23');var _0x3ab724=_0xce23dc[_0x7fd8('0x25')];var _0x2edf31=_0x48734c?0x0:_0xab57f7[_0x7fd8('0x22')];var _0x4b5d0a=_0x48734c?_0xce23dc[_0x7fd8('0x25')]:_0xab57f7[_0x7fd8('0x22')]+_0xab57f7[_0x7fd8('0x24')];var _0x13417d;if(_0x4b5d0a>=_0x3ab724){_0x4b5d0a=_0x3ab724;_0x13417d=0xc8;}else{_0x13417d=0xce;}_0x5ca7f6[_0x7fd8('0x20')](_0x13417d);return _0x5ca7f6[_0x7fd8('0x26')]('Content-Range',_0x2edf31+'-'+_0x4b5d0a+'/'+_0x3ab724)[_0x7fd8('0x27')](_0xce23dc);}return null;};}function patchUpdates(_0x1d26d4){return function(_0x34dadf){try{jsonpatch[_0x7fd8('0x28')](_0x34dadf,_0x1d26d4,!![]);}catch(_0x52b71a){return BPromise[_0x7fd8('0x29')](_0x52b71a);}return _0x34dadf[_0x7fd8('0x2a')]();};}function saveUpdates(_0x2e7520,_0x33ab3d){return function(_0x561dd1){if(_0x561dd1){return _0x561dd1['update'](_0x2e7520)['then'](function(_0x3650cb){return _0x3650cb;});}return null;};}function removeEntity(_0x6cccad,_0xa273a7){return function(_0xd8168f){if(_0xd8168f){return _0xd8168f[_0x7fd8('0x2b')]()['then'](function(){_0x6cccad[_0x7fd8('0x20')](0xcc)[_0x7fd8('0x21')]();});}};}function handleEntityNotFound(_0xda5f2a,_0x40b79b){return function(_0xa7da6b){if(!_0xa7da6b){_0xda5f2a['sendStatus'](0x194);}return _0xa7da6b;};}function handleError(_0x544179,_0x22a845){_0x22a845=_0x22a845||0x1f4;return function(_0x2bd721){logger[_0x7fd8('0x2c')](_0x2bd721[_0x7fd8('0x2d')]);if(_0x2bd721['name']){delete _0x2bd721['name'];}_0x544179[_0x7fd8('0x20')](_0x22a845)['send'](_0x2bd721);};}exports[_0x7fd8('0x2e')]=function(_0x235394,_0x3df0a2){var _0x57c434={'raw':![],'where':{'id':_0x235394['params']['id']}},_0x28e28e={};_0x28e28e[_0x7fd8('0x2f')]=_[_0x7fd8('0x30')](db[_0x7fd8('0x31')][_0x7fd8('0x32')]);_0x28e28e[_0x7fd8('0x33')]=_[_0x7fd8('0x30')](_0x235394[_0x7fd8('0x33')]);_0x28e28e['filters']=_[_0x7fd8('0x34')](_0x28e28e[_0x7fd8('0x2f')],_0x28e28e[_0x7fd8('0x33')]);_0x57c434[_0x7fd8('0x35')]=_[_0x7fd8('0x34')](_0x28e28e[_0x7fd8('0x2f')],qs[_0x7fd8('0x36')](_0x235394[_0x7fd8('0x33')]['fields']));_0x57c434['attributes']=_0x57c434[_0x7fd8('0x35')][_0x7fd8('0x37')]?_0x57c434[_0x7fd8('0x35')]:_0x28e28e['model'];if(_0x235394[_0x7fd8('0x33')]['includeAll']){_0x57c434['include']=[{'all':!![]}];}_0x57c434=_[_0x7fd8('0x38')]({},_0x57c434,_0x235394[_0x7fd8('0x39')]);return db[_0x7fd8('0x31')][_0x7fd8('0x3a')](_0x57c434)[_0x7fd8('0x3b')](handleEntityNotFound(_0x3df0a2,null))[_0x7fd8('0x3b')](respondWithResult(_0x3df0a2,null))[_0x7fd8('0x3c')](handleError(_0x3df0a2,null));};exports[_0x7fd8('0x2b')]=function(_0x514dff,_0x3766a0){return db['DashboardItem']['find']({'where':{'id':_0x514dff[_0x7fd8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3766a0,null))['then'](removeEntity(_0x3766a0,null))['catch'](handleError(_0x3766a0,null));};function widgetAttributes(_0x6c5e52){try{switch(_0x6c5e52[_0x7fd8('0x3e')]){case'iframe':return[{'name':_0x7fd8('0x3f'),'value':_0x6c5e52[_0x7fd8('0x3f')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52['attrs'][0x0]?_0x6c5e52['attrs'][0x0]['value']:undefined)||_0x7fd8('0x41')}];case _0x7fd8('0x42'):return[{'name':_0x7fd8('0x43'),'value':_0x6c5e52[_0x7fd8('0x43')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x0]?_0x6c5e52[_0x7fd8('0x40')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x6c5e52[_0x7fd8('0x44')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x0]?_0x6c5e52['attrs'][0x0][_0x7fd8('0x45')]:undefined)||_0x7fd8('0x46')},{'name':_0x7fd8('0x47'),'value':_0x6c5e52[_0x7fd8('0x47')]||(_0x6c5e52['attrs']&&_0x6c5e52[_0x7fd8('0x40')][0x1]?_0x6c5e52[_0x7fd8('0x40')][0x1]['value']:undefined)||_0x7fd8('0x48')},{'name':'attrFontSize','value':_0x6c5e52[_0x7fd8('0x49')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x2]?_0x6c5e52[_0x7fd8('0x40')][0x2]['value']:undefined)||0xc}];case _0x7fd8('0x4a'):return[{'name':_0x7fd8('0x4b'),'value':_0x6c5e52[_0x7fd8('0x4b')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x0]?_0x6c5e52[_0x7fd8('0x40')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x6c5e52[_0x7fd8('0x4c')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52['attrs'][0x1]?_0x6c5e52['attrs'][0x1][_0x7fd8('0x45')]:undefined)||[]},{'name':_0x7fd8('0x49'),'value':_0x6c5e52['attrFontSize']||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x2]?_0x6c5e52[_0x7fd8('0x40')][0x2]['value']:undefined)||0x14},{'name':_0x7fd8('0x4d'),'value':_0x6c5e52[_0x7fd8('0x4d')]||(_0x6c5e52['attrs']&&_0x6c5e52[_0x7fd8('0x40')][0x3]?_0x6c5e52['attrs'][0x3][_0x7fd8('0x45')]:undefined)||_0x7fd8('0x4e')},{'name':_0x7fd8('0x4f'),'value':_0x6c5e52[_0x7fd8('0x4f')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x4]?_0x6c5e52[_0x7fd8('0x40')][0x4][_0x7fd8('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x6c5e52[_0x7fd8('0x50')]||(_0x6c5e52['attrs']&&_0x6c5e52[_0x7fd8('0x40')][0x5]?_0x6c5e52[_0x7fd8('0x40')][0x5]['value']:undefined)||''},{'name':_0x7fd8('0x51'),'value':_0x6c5e52[_0x7fd8('0x51')]||(_0x6c5e52['attrs']&&_0x6c5e52['attrs'][0x6]?_0x6c5e52['attrs'][0x6][_0x7fd8('0x45')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x6c5e52[_0x7fd8('0x52')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x7]?_0x6c5e52[_0x7fd8('0x40')][0x7][_0x7fd8('0x45')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x6c5e52['attrWhatsappAccounts']||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x8]?_0x6c5e52[_0x7fd8('0x40')][0x8][_0x7fd8('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x6c5e52[_0x7fd8('0x53')]||(_0x6c5e52['attrs']&&_0x6c5e52[_0x7fd8('0x40')][0x9]?_0x6c5e52[_0x7fd8('0x40')][0x9][_0x7fd8('0x45')]:undefined)||''}];case _0x7fd8('0x54'):case _0x7fd8('0x55'):return[{'name':_0x7fd8('0x56'),'value':_0x6c5e52[_0x7fd8('0x56')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x0]?_0x6c5e52[_0x7fd8('0x40')][0x0][_0x7fd8('0x45')]:undefined)||'total'},{'name':_0x7fd8('0x57'),'value':_0x6c5e52[_0x7fd8('0x57')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x1]?_0x6c5e52[_0x7fd8('0x40')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x6c5e52['attrSerie3']||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x2]?_0x6c5e52[_0x7fd8('0x40')][0x2][_0x7fd8('0x45')]:undefined)||null},{'name':_0x7fd8('0x4c'),'value':_0x6c5e52[_0x7fd8('0x4c')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52['attrs'][0x3]?_0x6c5e52['attrs'][0x3][_0x7fd8('0x45')]:undefined)||[]},{'name':'attrChannel','value':_0x6c5e52[_0x7fd8('0x4d')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52['attrs'][0x4]?_0x6c5e52[_0x7fd8('0x40')][0x4][_0x7fd8('0x45')]:undefined)||'voice'},{'name':_0x7fd8('0x4f'),'value':_0x6c5e52[_0x7fd8('0x4f')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x5]?_0x6c5e52[_0x7fd8('0x40')][0x5][_0x7fd8('0x45')]:undefined)||''},{'name':_0x7fd8('0x50'),'value':_0x6c5e52['attrFaxAccounts']||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x6]?_0x6c5e52[_0x7fd8('0x40')][0x6][_0x7fd8('0x45')]:undefined)||''},{'name':_0x7fd8('0x51'),'value':_0x6c5e52['attrSmsAccounts']||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x7]?_0x6c5e52[_0x7fd8('0x40')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x6c5e52[_0x7fd8('0x52')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x8]?_0x6c5e52[_0x7fd8('0x40')][0x8][_0x7fd8('0x45')]:undefined)||''},{'name':_0x7fd8('0x58'),'value':_0x6c5e52['attrWhatsappAccounts']||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x9]?_0x6c5e52[_0x7fd8('0x40')][0x9][_0x7fd8('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x6c5e52[_0x7fd8('0x53')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0xa]?_0x6c5e52[_0x7fd8('0x40')][0xa][_0x7fd8('0x45')]:undefined)||''}];case _0x7fd8('0x59'):return[{'name':_0x7fd8('0x5a'),'type':_0x6c5e52[_0x7fd8('0x5b')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x0]?_0x6c5e52[_0x7fd8('0x40')][0x0][_0x7fd8('0x3e')]:undefined)||null,'value':_0x6c5e52[_0x7fd8('0x5a')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52['attrs'][0x0]?_0x6c5e52['attrs'][0x0][_0x7fd8('0x45')]:undefined)||null},{'name':_0x7fd8('0x5c'),'value':_0x6c5e52[_0x7fd8('0x5c')]||(_0x6c5e52[_0x7fd8('0x40')]&&_0x6c5e52[_0x7fd8('0x40')][0x1]?_0x6c5e52['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x16614a){logger[_0x7fd8('0x2c')]('widgetAttributes:\x20%s',JSON['stringify'](_0x16614a));return[];}}exports[_0x7fd8('0x5d')]=function(_0x124b53,_0xbabad2){if(_0x124b53[_0x7fd8('0x5e')]){_0x124b53[_0x7fd8('0x5e')][_0x7fd8('0x40')]=widgetAttributes(_0x124b53['body']);}return db['DashboardItem'][_0x7fd8('0x5d')](_0x124b53[_0x7fd8('0x5e')],{})['then'](respondWithResult(_0xbabad2,0xc9))[_0x7fd8('0x3c')](handleError(_0xbabad2,null));};exports[_0x7fd8('0x5f')]=function(_0x49d283,_0x163038){if(_0x49d283['body']['id']){delete _0x49d283[_0x7fd8('0x5e')]['id'];}_0x49d283['body'][_0x7fd8('0x40')]=widgetAttributes(_0x49d283['body']);return db['DashboardItem'][_0x7fd8('0x3a')]({'where':{'id':_0x49d283[_0x7fd8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x163038,null))[_0x7fd8('0x3b')](saveUpdates(_0x49d283['body'],null))[_0x7fd8('0x3b')](respondWithResult(_0x163038,null))[_0x7fd8('0x3c')](handleError(_0x163038,null));};
\ No newline at end of file
+var _0xf722=['stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','params','model','keys','DashboardItem','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','destroy','catch','type','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrVoiceQueues','web-report','attrReport','attrRefresh'];(function(_0x49ff0b,_0x3e9fd8){var _0x5a688e=function(_0x31de21){while(--_0x31de21){_0x49ff0b['push'](_0x49ff0b['shift']());}};_0x5a688e(++_0x3e9fd8);}(_0xf722,0x18f));var _0x2f72=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf722[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x2f72('0x0'));var rimraf=require(_0x2f72('0x1'));var zipdir=require(_0x2f72('0x2'));var jsonpatch=require(_0x2f72('0x3'));var rp=require('request-promise');var moment=require(_0x2f72('0x4'));var BPromise=require(_0x2f72('0x5'));var Mustache=require(_0x2f72('0x6'));var util=require(_0x2f72('0x7'));var path=require('path');var sox=require(_0x2f72('0x8'));var csv=require(_0x2f72('0x9'));var ejs=require(_0x2f72('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2f72('0xb'));var crypto=require(_0x2f72('0xc'));var jsforce=require(_0x2f72('0xd'));var deskjs=require(_0x2f72('0xe'));var toCsv=require(_0x2f72('0x9'));var querystring=require(_0x2f72('0xf'));var Papa=require(_0x2f72('0x10'));var Redis=require(_0x2f72('0x11'));var authService=require(_0x2f72('0x12'));var qs=require(_0x2f72('0x13'));var as=require(_0x2f72('0x14'));var hardwareService=require(_0x2f72('0x15'));var logger=require(_0x2f72('0x16'))(_0x2f72('0x17'));var utils=require('../../config/utils');var config=require(_0x2f72('0x18'));var licenseUtil=require(_0x2f72('0x19'));var db=require(_0x2f72('0x1a'))['db'];config[_0x2f72('0x1b')]=_[_0x2f72('0x1c')](config[_0x2f72('0x1b')],{'host':_0x2f72('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2f72('0x1e'))[_0x2f72('0x1f')](socket);function respondWithStatusCode(_0x47bee7,_0x25c780){_0x25c780=_0x25c780||0xcc;return function(_0x25b44b){if(_0x25b44b){return _0x47bee7[_0x2f72('0x20')](_0x25c780);}return _0x47bee7['status'](_0x25c780)[_0x2f72('0x21')]();};}function respondWithResult(_0x24412d,_0x2f408f){_0x2f408f=_0x2f408f||0xc8;return function(_0x418b0b){if(_0x418b0b){return _0x24412d[_0x2f72('0x22')](_0x2f408f)[_0x2f72('0x23')](_0x418b0b);}};}function respondWithFilteredResult(_0x2e9ea0,_0x106716){return function(_0x5ab0d2){if(_0x5ab0d2){var _0x5b3b8d=typeof _0x106716[_0x2f72('0x24')]===_0x2f72('0x25')&&typeof _0x106716[_0x2f72('0x26')]===_0x2f72('0x25');var _0x496edb=_0x5ab0d2['count'];var _0x2ec849=_0x5b3b8d?0x0:_0x106716[_0x2f72('0x24')];var _0x5ea7f9=_0x5b3b8d?_0x5ab0d2[_0x2f72('0x27')]:_0x106716[_0x2f72('0x24')]+_0x106716['limit'];var _0x35edd2;if(_0x5ea7f9>=_0x496edb){_0x5ea7f9=_0x496edb;_0x35edd2=0xc8;}else{_0x35edd2=0xce;}_0x2e9ea0[_0x2f72('0x22')](_0x35edd2);return _0x2e9ea0[_0x2f72('0x28')](_0x2f72('0x29'),_0x2ec849+'-'+_0x5ea7f9+'/'+_0x496edb)[_0x2f72('0x23')](_0x5ab0d2);}return null;};}function patchUpdates(_0x2f0ad8){return function(_0x3b3d33){try{jsonpatch['apply'](_0x3b3d33,_0x2f0ad8,!![]);}catch(_0x3b2924){return BPromise[_0x2f72('0x2a')](_0x3b2924);}return _0x3b3d33[_0x2f72('0x2b')]();};}function saveUpdates(_0x866be6,_0x2444e6){return function(_0x4e6f39){if(_0x4e6f39){return _0x4e6f39[_0x2f72('0x2c')](_0x866be6)[_0x2f72('0x2d')](function(_0x46cee2){return _0x46cee2;});}return null;};}function removeEntity(_0x16cbab,_0x5670c2){return function(_0x2e542a){if(_0x2e542a){return _0x2e542a['destroy']()[_0x2f72('0x2d')](function(){_0x16cbab['status'](0xcc)[_0x2f72('0x21')]();});}};}function handleEntityNotFound(_0x2fc5d6,_0x4a9880){return function(_0x215c6e){if(!_0x215c6e){_0x2fc5d6[_0x2f72('0x20')](0x194);}return _0x215c6e;};}function handleError(_0x2df18b,_0xd033df){_0xd033df=_0xd033df||0x1f4;return function(_0x5b8f6b){logger[_0x2f72('0x2e')](_0x5b8f6b['stack']);if(_0x5b8f6b[_0x2f72('0x2f')]){delete _0x5b8f6b['name'];}_0x2df18b[_0x2f72('0x22')](_0xd033df)[_0x2f72('0x30')](_0x5b8f6b);};}exports['show']=function(_0x454333,_0x2b2158){var _0xb3d318={'raw':![],'where':{'id':_0x454333[_0x2f72('0x31')]['id']}},_0x148294={};_0x148294[_0x2f72('0x32')]=_[_0x2f72('0x33')](db[_0x2f72('0x34')]['rawAttributes']);_0x148294[_0x2f72('0x35')]=_[_0x2f72('0x33')](_0x454333[_0x2f72('0x35')]);_0x148294[_0x2f72('0x36')]=_[_0x2f72('0x37')](_0x148294[_0x2f72('0x32')],_0x148294[_0x2f72('0x35')]);_0xb3d318[_0x2f72('0x38')]=_[_0x2f72('0x37')](_0x148294[_0x2f72('0x32')],qs[_0x2f72('0x39')](_0x454333[_0x2f72('0x35')][_0x2f72('0x39')]));_0xb3d318[_0x2f72('0x38')]=_0xb3d318[_0x2f72('0x38')][_0x2f72('0x3a')]?_0xb3d318[_0x2f72('0x38')]:_0x148294[_0x2f72('0x32')];if(_0x454333['query'][_0x2f72('0x3b')]){_0xb3d318['include']=[{'all':!![]}];}_0xb3d318=_[_0x2f72('0x3c')]({},_0xb3d318,_0x454333[_0x2f72('0x3d')]);return db[_0x2f72('0x34')][_0x2f72('0x3e')](_0xb3d318)[_0x2f72('0x2d')](handleEntityNotFound(_0x2b2158,null))[_0x2f72('0x2d')](respondWithResult(_0x2b2158,null))['catch'](handleError(_0x2b2158,null));};exports[_0x2f72('0x3f')]=function(_0x43a7b5,_0xe2b486){return db['DashboardItem'][_0x2f72('0x3e')]({'where':{'id':_0x43a7b5[_0x2f72('0x31')]['id']}})[_0x2f72('0x2d')](handleEntityNotFound(_0xe2b486,null))[_0x2f72('0x2d')](removeEntity(_0xe2b486,null))[_0x2f72('0x40')](handleError(_0xe2b486,null));};function widgetAttributes(_0x1acbcd){try{switch(_0x1acbcd[_0x2f72('0x41')]){case'iframe':return[{'name':_0x2f72('0x42'),'value':_0x1acbcd[_0x2f72('0x42')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x0]?_0x1acbcd['attrs'][0x0]['value']:undefined)||'https://'}];case _0x2f72('0x44'):return[{'name':'attrPath','value':_0x1acbcd[_0x2f72('0x45')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x0]?_0x1acbcd[_0x2f72('0x43')][0x0][_0x2f72('0x46')]:undefined)||''}];case _0x2f72('0x47'):return[{'name':'attrHourFormat','value':_0x1acbcd[_0x2f72('0x48')]||(_0x1acbcd['attrs']&&_0x1acbcd[_0x2f72('0x43')][0x0]?_0x1acbcd['attrs'][0x0][_0x2f72('0x46')]:undefined)||_0x2f72('0x49')},{'name':_0x2f72('0x4a'),'value':_0x1acbcd[_0x2f72('0x4a')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x1]?_0x1acbcd['attrs'][0x1][_0x2f72('0x46')]:undefined)||_0x2f72('0x4b')},{'name':_0x2f72('0x4c'),'value':_0x1acbcd[_0x2f72('0x4c')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x2]?_0x1acbcd['attrs'][0x2][_0x2f72('0x46')]:undefined)||0xc}];case _0x2f72('0x4d'):return[{'name':_0x2f72('0x4e'),'value':_0x1acbcd['attrMetric']||(_0x1acbcd['attrs']&&_0x1acbcd[_0x2f72('0x43')][0x0]?_0x1acbcd[_0x2f72('0x43')][0x0][_0x2f72('0x46')]:undefined)||_0x2f72('0x4f')},{'name':'attrVoiceQueues','value':_0x1acbcd['attrVoiceQueues']||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x1]?_0x1acbcd[_0x2f72('0x43')][0x1]['value']:undefined)||[]},{'name':_0x2f72('0x4c'),'value':_0x1acbcd['attrFontSize']||(_0x1acbcd['attrs']&&_0x1acbcd['attrs'][0x2]?_0x1acbcd[_0x2f72('0x43')][0x2][_0x2f72('0x46')]:undefined)||0x14},{'name':'attrChannel','value':_0x1acbcd[_0x2f72('0x50')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd['attrs'][0x3]?_0x1acbcd['attrs'][0x3][_0x2f72('0x46')]:undefined)||_0x2f72('0x51')},{'name':_0x2f72('0x52'),'value':_0x1acbcd['attrEmailAccounts']||(_0x1acbcd['attrs']&&_0x1acbcd[_0x2f72('0x43')][0x4]?_0x1acbcd[_0x2f72('0x43')][0x4][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x53'),'value':_0x1acbcd[_0x2f72('0x53')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd['attrs'][0x5]?_0x1acbcd[_0x2f72('0x43')][0x5][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x54'),'value':_0x1acbcd[_0x2f72('0x54')]||(_0x1acbcd['attrs']&&_0x1acbcd[_0x2f72('0x43')][0x6]?_0x1acbcd['attrs'][0x6]['value']:undefined)||''},{'name':_0x2f72('0x55'),'value':_0x1acbcd[_0x2f72('0x55')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x7]?_0x1acbcd[_0x2f72('0x43')][0x7][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x56'),'value':_0x1acbcd[_0x2f72('0x56')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x8]?_0x1acbcd['attrs'][0x8][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x57'),'value':_0x1acbcd[_0x2f72('0x57')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x9]?_0x1acbcd[_0x2f72('0x43')][0x9][_0x2f72('0x46')]:undefined)||''}];case _0x2f72('0x58'):case _0x2f72('0x59'):return[{'name':_0x2f72('0x5a'),'value':_0x1acbcd[_0x2f72('0x5a')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd['attrs'][0x0]?_0x1acbcd['attrs'][0x0][_0x2f72('0x46')]:undefined)||_0x2f72('0x4f')},{'name':_0x2f72('0x5b'),'value':_0x1acbcd[_0x2f72('0x5b')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x1]?_0x1acbcd[_0x2f72('0x43')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1acbcd['attrSerie3']||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x2]?_0x1acbcd[_0x2f72('0x43')][0x2][_0x2f72('0x46')]:undefined)||null},{'name':_0x2f72('0x5c'),'value':_0x1acbcd[_0x2f72('0x5c')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x3]?_0x1acbcd[_0x2f72('0x43')][0x3][_0x2f72('0x46')]:undefined)||[]},{'name':_0x2f72('0x50'),'value':_0x1acbcd[_0x2f72('0x50')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x4]?_0x1acbcd[_0x2f72('0x43')][0x4]['value']:undefined)||_0x2f72('0x51')},{'name':_0x2f72('0x52'),'value':_0x1acbcd['attrEmailAccounts']||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x5]?_0x1acbcd['attrs'][0x5][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x53'),'value':_0x1acbcd['attrFaxAccounts']||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x6]?_0x1acbcd[_0x2f72('0x43')][0x6]['value']:undefined)||''},{'name':_0x2f72('0x54'),'value':_0x1acbcd[_0x2f72('0x54')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x7]?_0x1acbcd['attrs'][0x7][_0x2f72('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1acbcd[_0x2f72('0x55')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x8]?_0x1acbcd[_0x2f72('0x43')][0x8][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x56'),'value':_0x1acbcd[_0x2f72('0x56')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x9]?_0x1acbcd[_0x2f72('0x43')][0x9][_0x2f72('0x46')]:undefined)||''},{'name':_0x2f72('0x57'),'value':_0x1acbcd['attrChatWebsites']||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd['attrs'][0xa]?_0x1acbcd[_0x2f72('0x43')][0xa][_0x2f72('0x46')]:undefined)||''}];case _0x2f72('0x5d'):return[{'name':_0x2f72('0x5e'),'type':_0x1acbcd['reportType']||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd['attrs'][0x0]?_0x1acbcd[_0x2f72('0x43')][0x0][_0x2f72('0x41')]:undefined)||null,'value':_0x1acbcd['attrReport']||(_0x1acbcd['attrs']&&_0x1acbcd[_0x2f72('0x43')][0x0]?_0x1acbcd['attrs'][0x0][_0x2f72('0x46')]:undefined)||null},{'name':_0x2f72('0x5f'),'value':_0x1acbcd[_0x2f72('0x5f')]||(_0x1acbcd[_0x2f72('0x43')]&&_0x1acbcd[_0x2f72('0x43')][0x1]?_0x1acbcd['attrs'][0x1][_0x2f72('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x191f44){logger[_0x2f72('0x2e')]('widgetAttributes:\x20%s',JSON[_0x2f72('0x60')](_0x191f44));return[];}}exports[_0x2f72('0x61')]=function(_0x134782,_0x40b918){if(_0x134782[_0x2f72('0x62')]){_0x134782[_0x2f72('0x62')]['attrs']=widgetAttributes(_0x134782[_0x2f72('0x62')]);}return db['DashboardItem'][_0x2f72('0x61')](_0x134782[_0x2f72('0x62')],{})[_0x2f72('0x2d')](respondWithResult(_0x40b918,0xc9))[_0x2f72('0x40')](handleError(_0x40b918,null));};exports['update']=function(_0x3da587,_0x48973d){if(_0x3da587[_0x2f72('0x62')]['id']){delete _0x3da587[_0x2f72('0x62')]['id'];}_0x3da587[_0x2f72('0x62')]['attrs']=widgetAttributes(_0x3da587['body']);return db[_0x2f72('0x34')][_0x2f72('0x3e')]({'where':{'id':_0x3da587[_0x2f72('0x31')]['id']}})[_0x2f72('0x2d')](handleEntityNotFound(_0x48973d,null))[_0x2f72('0x2d')](saveUpdates(_0x3da587[_0x2f72('0x62')],null))[_0x2f72('0x2d')](respondWithResult(_0x48973d,null))[_0x2f72('0x40')](handleError(_0x48973d,null));};
\ No newline at end of file
index 53f9023..1f3d93a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a9f=['emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6a9f,0x1e0));var _0xf6a9=function(_0x11dd3f,_0x1bed35){_0x11dd3f=_0x11dd3f-0x0;var _0x3af580=_0x6a9f[_0x11dd3f];return _0x3af580;};'use strict';var EventEmitter=require(_0xf6a9('0x0'));var DashboardItem=require(_0xf6a9('0x1'))['db'][_0xf6a9('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf6a9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6a9('0x4'),'afterDestroy':_0xf6a9('0x5')};function emitEvent(_0x4c96fc){return function(_0x1aa1e9,_0x56a8ea,_0x3ca34f){DashboardItemEvents[_0xf6a9('0x6')](_0x4c96fc+':'+_0x1aa1e9['id'],_0x1aa1e9);DashboardItemEvents[_0xf6a9('0x6')](_0x4c96fc,_0x1aa1e9);_0x3ca34f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf6a9('0x7')](e,emitEvent(event));}}module[_0xf6a9('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0x4912=['../../mysqldb','DashboardItem','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x31da8c,_0x24b9a7){var _0x54b23a=function(_0x4e395e){while(--_0x4e395e){_0x31da8c['push'](_0x31da8c['shift']());}};_0x54b23a(++_0x24b9a7);}(_0x4912,0x1c0));var _0x2491=function(_0x63cc0a,_0x484b83){_0x63cc0a=_0x63cc0a-0x0;var _0x248476=_0x4912[_0x63cc0a];return _0x248476;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x2491('0x0'))['db'][_0x2491('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2491('0x2')](0x0);var events={'afterCreate':_0x2491('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x379866){return function(_0x30258c,_0x36f0f7,_0x1f66f6){DashboardItemEvents[_0x2491('0x4')](_0x379866+':'+_0x30258c['id'],_0x30258c);DashboardItemEvents[_0x2491('0x4')](_0x379866,_0x30258c);_0x1f66f6(null);};}for(var e in events){if(events[_0x2491('0x5')](e)){var event=events[e];DashboardItem[_0x2491('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 4ea0e0c..46aeb54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd696=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','dashboard_items','lodash','util','../../config/logger'];(function(_0x3d5d27,_0x5477ac){var _0x4dcacc=function(_0x49884b){while(--_0x49884b){_0x3d5d27['push'](_0x3d5d27['shift']());}};_0x4dcacc(++_0x5477ac);}(_0xd696,0xe1));var _0x6d69=function(_0x425ea3,_0x26b830){_0x425ea3=_0x425ea3-0x0;var _0x54f159=_0xd696[_0x425ea3];return _0x54f159;};'use strict';var _=require(_0x6d69('0x0'));var util=require(_0x6d69('0x1'));var logger=require(_0x6d69('0x2'))(_0x6d69('0x3'));var moment=require(_0x6d69('0x4'));var BPromise=require(_0x6d69('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d69('0x6'));var rimraf=require(_0x6d69('0x7'));var config=require(_0x6d69('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x6d69('0x9')]=function(_0x5afe26,_0x21a1ee){return _0x5afe26[_0x6d69('0xa')]('DashboardItem',attributes,{'tableName':_0x6d69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b71=['../../config/environment','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b71,0x119));var _0x10b7=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0x0b71[_0x2b6600];return _0x912ee2;};'use strict';var _=require(_0x10b7('0x0'));var util=require(_0x10b7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x10b7('0x2'));var BPromise=require(_0x10b7('0x3'));var rp=require(_0x10b7('0x4'));var fs=require('fs');var path=require(_0x10b7('0x5'));var rimraf=require(_0x10b7('0x6'));var config=require(_0x10b7('0x7'));var attributes=require(_0x10b7('0x8'));module['exports']=function(_0xde0bed,_0x30f052){return _0xde0bed[_0x10b7('0x9')](_0x10b7('0xa'),attributes,{'tableName':_0x10b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eea4c05..8aaf5ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9397=['error','code','DashboardItem,\x20%s,\x20%s','message','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x45d9d7,_0x231127){var _0x394d24=function(_0x11ea47){while(--_0x11ea47){_0x45d9d7['push'](_0x45d9d7['shift']());}};_0x394d24(++_0x231127);}(_0x9397,0x125));var _0x7939=function(_0x25e214,_0x42a13e){_0x25e214=_0x25e214-0x0;var _0x48ca06=_0x9397[_0x25e214];return _0x48ca06;};'use strict';var _=require(_0x7939('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7939('0x1'));var fs=require('fs');var Redis=require(_0x7939('0x2'));var db=require(_0x7939('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7939('0x4'));var config=require(_0x7939('0x5'));var jayson=require(_0x7939('0x6'));var client=jayson[_0x7939('0x7')]['http']({'port':0x232a});config[_0x7939('0x8')]=_[_0x7939('0x9')](config['redis'],{'host':_0x7939('0xa'),'port':0x18eb});var socket=require(_0x7939('0xb'))(new Redis(config[_0x7939('0x8')]));require('./dashboardItem.socket')[_0x7939('0xc')](socket);function respondWithRpcPromise(_0x1c1fd2,_0x5739b5,_0x15ec65){return new BPromise(function(_0x18cd69,_0xf02921){return client[_0x7939('0xd')](_0x1c1fd2,_0x15ec65)[_0x7939('0xe')](function(_0xafead8){logger[_0x7939('0xf')]('DashboardItem,\x20%s,\x20%s',_0x5739b5,_0x7939('0x10'));logger[_0x7939('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5739b5,_0x7939('0x10'),JSON[_0x7939('0x12')](_0xafead8));if(_0xafead8['error']){if(_0xafead8[_0x7939('0x13')][_0x7939('0x14')]===0x1f4){logger[_0x7939('0x13')](_0x7939('0x15'),_0x5739b5,_0xafead8[_0x7939('0x13')][_0x7939('0x16')]);return _0xf02921(_0xafead8[_0x7939('0x13')][_0x7939('0x16')]);}logger[_0x7939('0x13')](_0x7939('0x15'),_0x5739b5,_0xafead8['error'][_0x7939('0x16')]);return _0x18cd69(_0xafead8['error']['message']);}else{logger['info'](_0x7939('0x15'),_0x5739b5,_0x7939('0x10'));_0x18cd69(_0xafead8['result'][_0x7939('0x16')]);}})[_0x7939('0x17')](function(_0x2b71d6){logger[_0x7939('0x13')](_0x7939('0x15'),_0x5739b5,_0x2b71d6);_0xf02921(_0x2b71d6);});});}
\ No newline at end of file
+var _0xfd69=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4aa2c9,_0x3c74e5){var _0x212e33=function(_0x20f06a){while(--_0x20f06a){_0x4aa2c9['push'](_0x4aa2c9['shift']());}};_0x212e33(++_0x3c74e5);}(_0xfd69,0xe6));var _0x9fd6=function(_0x31b360,_0x3cf39c){_0x31b360=_0x31b360-0x0;var _0x2ce851=_0xfd69[_0x31b360];return _0x2ce851;};'use strict';var _=require(_0x9fd6('0x0'));var util=require('util');var moment=require(_0x9fd6('0x1'));var BPromise=require(_0x9fd6('0x2'));var rs=require(_0x9fd6('0x3'));var fs=require('fs');var Redis=require(_0x9fd6('0x4'));var db=require(_0x9fd6('0x5'))['db'];var utils=require(_0x9fd6('0x6'));var logger=require(_0x9fd6('0x7'))('rpc');var config=require(_0x9fd6('0x8'));var jayson=require(_0x9fd6('0x9'));var client=jayson[_0x9fd6('0xa')][_0x9fd6('0xb')]({'port':0x232a});config[_0x9fd6('0xc')]=_['defaults'](config[_0x9fd6('0xc')],{'host':_0x9fd6('0xd'),'port':0x18eb});var socket=require(_0x9fd6('0xe'))(new Redis(config[_0x9fd6('0xc')]));require(_0x9fd6('0xf'))[_0x9fd6('0x10')](socket);function respondWithRpcPromise(_0x1247b5,_0x326f52,_0x4a97c0){return new BPromise(function(_0x1cb0e2,_0x8ce149){return client[_0x9fd6('0x11')](_0x1247b5,_0x4a97c0)['then'](function(_0x153b8a){logger[_0x9fd6('0x12')](_0x9fd6('0x13'),_0x326f52,_0x9fd6('0x14'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x326f52,_0x9fd6('0x14'),JSON['stringify'](_0x153b8a));if(_0x153b8a[_0x9fd6('0x15')]){if(_0x153b8a[_0x9fd6('0x15')][_0x9fd6('0x16')]===0x1f4){logger['error'](_0x9fd6('0x13'),_0x326f52,_0x153b8a[_0x9fd6('0x15')]['message']);return _0x8ce149(_0x153b8a[_0x9fd6('0x15')][_0x9fd6('0x17')]);}logger[_0x9fd6('0x15')](_0x9fd6('0x13'),_0x326f52,_0x153b8a['error'][_0x9fd6('0x17')]);return _0x1cb0e2(_0x153b8a[_0x9fd6('0x15')][_0x9fd6('0x17')]);}else{logger['info'](_0x9fd6('0x13'),_0x326f52,_0x9fd6('0x14'));_0x1cb0e2(_0x153b8a[_0x9fd6('0x18')]['message']);}})[_0x9fd6('0x19')](function(_0x3144e4){logger[_0x9fd6('0x15')]('DashboardItem,\x20%s,\x20%s',_0x326f52,_0x3144e4);_0x8ce149(_0x3144e4);});});}
\ No newline at end of file
index b23f5c2..0a87991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad88=['dashboardItem:','./dashboardItem.events','save','update','emit','removeListener'];(function(_0x4c5f7a,_0x28b890){var _0x17099e=function(_0x4e81e0){while(--_0x4e81e0){_0x4c5f7a['push'](_0x4c5f7a['shift']());}};_0x17099e(++_0x28b890);}(_0xad88,0xaf));var _0x8ad8=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xad88[_0xac151d];return _0x111dba;};'use strict';var DashboardItemEvents=require(_0x8ad8('0x0'));var events=[_0x8ad8('0x1'),'remove',_0x8ad8('0x2')];function createListener(_0x512243,_0x5230cb){return function(_0x56010c){_0x5230cb[_0x8ad8('0x3')](_0x512243,_0x56010c);};}function removeListener(_0x40675a,_0x240fc1){return function(){DashboardItemEvents[_0x8ad8('0x4')](_0x40675a,_0x240fc1);};}exports['register']=function(_0x2ece2c){for(var _0x3b5285=0x0,_0x33f054=events['length'];_0x3b5285<_0x33f054;_0x3b5285++){var _0x3b3857=events[_0x3b5285];var _0x5e7c8d=createListener(_0x8ad8('0x5')+_0x3b3857,_0x2ece2c);DashboardItemEvents['on'](_0x3b3857,_0x5e7c8d);}};
\ No newline at end of file
+var _0x4775=['emit','removeListener','register','./dashboardItem.events','update'];(function(_0x39f047,_0x3a8229){var _0x51a7f0=function(_0x43ce3e){while(--_0x43ce3e){_0x39f047['push'](_0x39f047['shift']());}};_0x51a7f0(++_0x3a8229);}(_0x4775,0x9e));var _0x5477=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x4775[_0x2a0350];return _0x425220;};'use strict';var DashboardItemEvents=require(_0x5477('0x0'));var events=['save','remove',_0x5477('0x1')];function createListener(_0x576b93,_0x28f1bc){return function(_0xeca7e2){_0x28f1bc[_0x5477('0x2')](_0x576b93,_0xeca7e2);};}function removeListener(_0xa04d10,_0x2ec9ec){return function(){DashboardItemEvents[_0x5477('0x3')](_0xa04d10,_0x2ec9ec);};}exports[_0x5477('0x4')]=function(_0x46bd8c){for(var _0x36896b=0x0,_0x3f87f5=events['length'];_0x36896b<_0x3f87f5;_0x36896b++){var _0x865a50=events[_0x36896b];var _0x543ff9=createListener('dashboardItem:'+_0x865a50,_0x46bd8c);DashboardItemEvents['on'](_0x865a50,_0x543ff9);}};
\ No newline at end of file
index d860160..f847fe1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc26c=['put','/:id','update','delete','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','post','create'];(function(_0x2c3441,_0x40e583){var _0x5ac916=function(_0x4b02e8){while(--_0x4b02e8){_0x2c3441['push'](_0x2c3441['shift']());}};_0x5ac916(++_0x40e583);}(_0xc26c,0x105));var _0xcc26=function(_0x233ce7,_0x2b9417){_0x233ce7=_0x233ce7-0x0;var _0x108fc2=_0xc26c[_0x233ce7];return _0x108fc2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcc26('0x0'));var express=require('express');var router=express[_0xcc26('0x1')]();var fs_extra=require(_0xcc26('0x2'));var auth=require(_0xcc26('0x3'));var interaction=require(_0xcc26('0x4'));var config=require(_0xcc26('0x5'));var controller=require(_0xcc26('0x6'));router[_0xcc26('0x7')]('/:id',auth[_0xcc26('0x8')](),controller['show']);router[_0xcc26('0x9')]('/',auth[_0xcc26('0x8')](),controller[_0xcc26('0xa')]);router[_0xcc26('0xb')](_0xcc26('0xc'),auth[_0xcc26('0x8')](),controller[_0xcc26('0xd')]);router[_0xcc26('0xe')](_0xcc26('0xc'),auth[_0xcc26('0x8')](),controller['destroy']);module[_0xcc26('0xf')]=router;
\ No newline at end of file
+var _0xc99a=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x494f4d,_0x2807fa){var _0x3e7dfc=function(_0x14f2d2){while(--_0x14f2d2){_0x494f4d['push'](_0x494f4d['shift']());}};_0x3e7dfc(++_0x2807fa);}(_0xc99a,0x6e));var _0xac99=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc99a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xac99('0x0'));var util=require(_0xac99('0x1'));var path=require(_0xac99('0x2'));var timeout=require(_0xac99('0x3'));var express=require(_0xac99('0x4'));var router=express['Router']();var fs_extra=require(_0xac99('0x5'));var auth=require(_0xac99('0x6'));var interaction=require(_0xac99('0x7'));var config=require(_0xac99('0x8'));var controller=require(_0xac99('0x9'));router[_0xac99('0xa')](_0xac99('0xb'),auth[_0xac99('0xc')](),controller[_0xac99('0xd')]);router[_0xac99('0xe')]('/',auth[_0xac99('0xc')](),controller[_0xac99('0xf')]);router[_0xac99('0x10')](_0xac99('0xb'),auth[_0xac99('0xc')](),controller[_0xac99('0x11')]);router[_0xac99('0x12')](_0xac99('0xb'),auth[_0xac99('0xc')](),controller[_0xac99('0x13')]);module[_0xac99('0x14')]=router;
\ No newline at end of file
index 2af5272..75845de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa6a=['exports','ENUM','first','third','STRING','sequelize'];(function(_0x4f478f,_0x5829c7){var _0x57598b=function(_0x189812){while(--_0x189812){_0x4f478f['push'](_0x4f478f['shift']());}};_0x57598b(++_0x5829c7);}(_0xfa6a,0xe9));var _0xafa6=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xfa6a[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xafa6('0x0'));module[_0xafa6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xafa6('0x2')](_0xafa6('0x3'),'second',_0xafa6('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xafa6('0x5')]}};
\ No newline at end of file
+var _0x84ef=['STRING','exports','first','second','third'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x84ef,0x97));var _0xf84e=function(_0x32c810,_0x153481){_0x32c810=_0x32c810-0x0;var _0x24adbf=_0x84ef[_0x32c810];return _0x24adbf;};'use strict';var Sequelize=require('sequelize');module[_0xf84e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xf84e('0x1'),_0xf84e('0x2'),_0xf84e('0x3')),'allowNull':![],'defaultValue':_0xf84e('0x1')},'description':{'type':Sequelize[_0xf84e('0x4')]}};
\ No newline at end of file
index ba3baff..4495db6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8173=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','status','error','stack','index','map','rawAttributes','fieldName','type','key','name','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','Disposition','includeAll','findAll','rows','catch','show','params'];(function(_0x308b11,_0x27a881){var _0x5441b4=function(_0x4b287a){while(--_0x4b287a){_0x308b11['push'](_0x308b11['shift']());}};_0x5441b4(++_0x27a881);}(_0x8173,0x1db));var _0x3817=function(_0x17496c,_0xaaf7d){_0x17496c=_0x17496c-0x0;var _0x29989f=_0x8173[_0x17496c];return _0x29989f;};'use strict';var emlformat=require(_0x3817('0x0'));var rimraf=require(_0x3817('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3817('0x2'));var rp=require(_0x3817('0x3'));var moment=require(_0x3817('0x4'));var BPromise=require(_0x3817('0x5'));var Mustache=require('mustache');var util=require(_0x3817('0x6'));var path=require('path');var sox=require(_0x3817('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3817('0x8'));var _=require(_0x3817('0x9'));var squel=require(_0x3817('0xa'));var crypto=require('crypto');var jsforce=require(_0x3817('0xb'));var deskjs=require(_0x3817('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3817('0xd'));var Redis=require(_0x3817('0xe'));var authService=require(_0x3817('0xf'));var qs=require(_0x3817('0x10'));var as=require(_0x3817('0x11'));var hardwareService=require(_0x3817('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3817('0x13'));var config=require(_0x3817('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bd0a9,_0x1a29b8){_0x1a29b8=_0x1a29b8||0xcc;return function(_0x151c56){if(_0x151c56){return _0x4bd0a9[_0x3817('0x15')](_0x1a29b8);}return _0x4bd0a9['status'](_0x1a29b8)[_0x3817('0x16')]();};}function respondWithResult(_0x4b151e,_0x300b8e){_0x300b8e=_0x300b8e||0xc8;return function(_0x2c92ed){if(_0x2c92ed){return _0x4b151e['status'](_0x300b8e)['json'](_0x2c92ed);}};}function respondWithFilteredResult(_0x1411c9,_0x11d892){return function(_0x4d9509){if(_0x4d9509){var _0x155075=typeof _0x11d892[_0x3817('0x17')]===_0x3817('0x18')&&typeof _0x11d892[_0x3817('0x19')]===_0x3817('0x18');var _0x347771=_0x4d9509['count'];var _0x215d15=_0x155075?0x0:_0x11d892['offset'];var _0x4de43b=_0x155075?_0x4d9509[_0x3817('0x1a')]:_0x11d892[_0x3817('0x17')]+_0x11d892[_0x3817('0x19')];var _0x5bcb09;if(_0x4de43b>=_0x347771){_0x4de43b=_0x347771;_0x5bcb09=0xc8;}else{_0x5bcb09=0xce;}_0x1411c9['status'](_0x5bcb09);return _0x1411c9[_0x3817('0x1b')](_0x3817('0x1c'),_0x215d15+'-'+_0x4de43b+'/'+_0x347771)['json'](_0x4d9509);}return null;};}function patchUpdates(_0x28f192){return function(_0x16b93c){try{jsonpatch[_0x3817('0x1d')](_0x16b93c,_0x28f192,!![]);}catch(_0x33b216){return BPromise[_0x3817('0x1e')](_0x33b216);}return _0x16b93c[_0x3817('0x1f')]();};}function saveUpdates(_0xef8880,_0x3c16b5){return function(_0x21fa53){if(_0x21fa53){return _0x21fa53[_0x3817('0x20')](_0xef8880)[_0x3817('0x21')](function(_0x259b36){return _0x259b36;});}return null;};}function removeEntity(_0x569686,_0x4e141e){return function(_0x43716d){if(_0x43716d){return _0x43716d[_0x3817('0x22')]()[_0x3817('0x21')](function(){var _0x89ccc1=_0x43716d[_0x3817('0x23')]({'plain':!![]});var _0x251cd7=_0x3817('0x24');return db[_0x3817('0x25')][_0x3817('0x22')]({'where':{'type':_0x251cd7,'resourceId':_0x89ccc1['id']}})['then'](function(){return _0x43716d;});})[_0x3817('0x21')](function(){_0x569686[_0x3817('0x26')](0xcc)[_0x3817('0x16')]();});}};}function handleEntityNotFound(_0x30bc7d,_0x2c6a1f){return function(_0x54ccb6){if(!_0x54ccb6){_0x30bc7d[_0x3817('0x15')](0x194);}return _0x54ccb6;};}function handleError(_0x504679,_0x17f92f){_0x17f92f=_0x17f92f||0x1f4;return function(_0x3d0cc9){logger[_0x3817('0x27')](_0x3d0cc9[_0x3817('0x28')]);if(_0x3d0cc9['name']){delete _0x3d0cc9['name'];}_0x504679[_0x3817('0x26')](_0x17f92f)['send'](_0x3d0cc9);};}exports[_0x3817('0x29')]=function(_0x237220,_0x267f7c){var _0x41d19d={},_0x207492={},_0x2bf98b={'count':0x0,'rows':[]};var _0x135ac0=_[_0x3817('0x2a')](db['Disposition'][_0x3817('0x2b')],function(_0x4ee0d1){return{'name':_0x4ee0d1[_0x3817('0x2c')],'type':_0x4ee0d1[_0x3817('0x2d')][_0x3817('0x2e')]};});_0x207492['model']=_[_0x3817('0x2a')](_0x135ac0,_0x3817('0x2f'));_0x207492[_0x3817('0x30')]=_[_0x3817('0x31')](_0x237220[_0x3817('0x30')]);_0x207492['filters']=_['intersection'](_0x207492[_0x3817('0x32')],_0x207492[_0x3817('0x30')]);_0x41d19d[_0x3817('0x33')]=_[_0x3817('0x34')](_0x207492[_0x3817('0x32')],qs['fields'](_0x237220[_0x3817('0x30')][_0x3817('0x35')]));_0x41d19d[_0x3817('0x33')]=_0x41d19d['attributes'][_0x3817('0x36')]?_0x41d19d[_0x3817('0x33')]:_0x207492[_0x3817('0x32')];if(!_0x237220[_0x3817('0x30')]['hasOwnProperty'](_0x3817('0x37'))){_0x41d19d[_0x3817('0x19')]=qs[_0x3817('0x19')](_0x237220[_0x3817('0x30')][_0x3817('0x19')]);_0x41d19d[_0x3817('0x17')]=qs[_0x3817('0x17')](_0x237220[_0x3817('0x30')][_0x3817('0x17')]);}_0x41d19d[_0x3817('0x38')]=qs[_0x3817('0x39')](_0x237220[_0x3817('0x30')][_0x3817('0x39')]);_0x41d19d[_0x3817('0x3a')]=qs[_0x3817('0x3b')](_[_0x3817('0x3c')](_0x237220[_0x3817('0x30')],_0x207492[_0x3817('0x3b')]),_0x135ac0);if(_0x237220['query'][_0x3817('0x3d')]){_0x41d19d['where']=_[_0x3817('0x3e')](_0x41d19d[_0x3817('0x3a')],{'$or':_[_0x3817('0x2a')](_0x135ac0,function(_0x56050f){if(_0x56050f[_0x3817('0x2d')]!=='VIRTUAL'){var _0x358900={};_0x358900[_0x56050f[_0x3817('0x2f')]]={'$like':'%'+_0x237220[_0x3817('0x30')][_0x3817('0x3d')]+'%'};return _0x358900;}})});}_0x41d19d=_[_0x3817('0x3e')]({},_0x41d19d,_0x237220[_0x3817('0x3f')]);var _0x3daedf={'where':_0x41d19d[_0x3817('0x3a')]};return db[_0x3817('0x40')][_0x3817('0x1a')](_0x3daedf)['then'](function(_0x16d9d0){_0x2bf98b[_0x3817('0x1a')]=_0x16d9d0;if(_0x237220[_0x3817('0x30')][_0x3817('0x41')]){_0x41d19d['include']=[{'all':!![]}];}return db[_0x3817('0x40')][_0x3817('0x42')](_0x41d19d);})[_0x3817('0x21')](function(_0x1a4580){_0x2bf98b[_0x3817('0x43')]=_0x1a4580;return _0x2bf98b;})[_0x3817('0x21')](respondWithFilteredResult(_0x267f7c,_0x41d19d))[_0x3817('0x44')](handleError(_0x267f7c,null));};exports[_0x3817('0x45')]=function(_0x1940fa,_0x15ecc0){var _0xb63a73={'raw':!![],'where':{'id':_0x1940fa[_0x3817('0x46')]['id']}},_0x5b9e73={};_0x5b9e73[_0x3817('0x32')]=_['keys'](db[_0x3817('0x40')][_0x3817('0x2b')]);_0x5b9e73[_0x3817('0x30')]=_['keys'](_0x1940fa['query']);_0x5b9e73[_0x3817('0x3b')]=_[_0x3817('0x34')](_0x5b9e73[_0x3817('0x32')],_0x5b9e73[_0x3817('0x30')]);_0xb63a73['attributes']=_['intersection'](_0x5b9e73[_0x3817('0x32')],qs[_0x3817('0x35')](_0x1940fa['query'][_0x3817('0x35')]));_0xb63a73[_0x3817('0x33')]=_0xb63a73['attributes'][_0x3817('0x36')]?_0xb63a73[_0x3817('0x33')]:_0x5b9e73[_0x3817('0x32')];if(_0x1940fa[_0x3817('0x30')]['includeAll']){_0xb63a73['include']=[{'all':!![]}];}_0xb63a73=_[_0x3817('0x3e')]({},_0xb63a73,_0x1940fa['options']);return db[_0x3817('0x40')][_0x3817('0x47')](_0xb63a73)[_0x3817('0x21')](handleEntityNotFound(_0x15ecc0,null))[_0x3817('0x21')](respondWithResult(_0x15ecc0,null))[_0x3817('0x44')](handleError(_0x15ecc0,null));};exports[_0x3817('0x48')]=function(_0x3680d2,_0x879eae){return db[_0x3817('0x40')][_0x3817('0x48')](_0x3680d2[_0x3817('0x49')],{})[_0x3817('0x21')](function(_0x1995a3){var _0x5946f4=_0x3680d2[_0x3817('0x4a')]['get']({'plain':!![]});if(!_0x5946f4)throw new Error(_0x3817('0x4b'));if(_0x5946f4[_0x3817('0x4c')]===_0x3817('0x4a')){var _0x47871e=_0x1995a3[_0x3817('0x23')]({'plain':!![]});var _0x3ef384=_0x3817('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x3ef384,'userProfileId':_0x5946f4[_0x3817('0x4d')]},'raw':!![]})[_0x3817('0x21')](function(_0x426482){if(_0x426482&&_0x426482['autoAssociation']===0x0){return db[_0x3817('0x25')][_0x3817('0x48')]({'name':_0x47871e[_0x3817('0x2f')],'resourceId':_0x47871e['id'],'type':_0x426482[_0x3817('0x2f')],'sectionId':_0x426482['id']},{})['then'](function(){return _0x1995a3;});}else{return _0x1995a3;}})['catch'](function(_0x22f651){logger[_0x3817('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22f651);throw _0x22f651;});}return _0x1995a3;})[_0x3817('0x21')](respondWithResult(_0x879eae,0xc9))['catch'](handleError(_0x879eae,null));};exports[_0x3817('0x20')]=function(_0x428349,_0x52fabc){if(_0x428349[_0x3817('0x49')]['id']){delete _0x428349[_0x3817('0x49')]['id'];}return db['Disposition'][_0x3817('0x47')]({'where':{'id':_0x428349['params']['id']}})[_0x3817('0x21')](handleEntityNotFound(_0x52fabc,null))[_0x3817('0x21')](saveUpdates(_0x428349['body'],null))[_0x3817('0x21')](respondWithResult(_0x52fabc,null))[_0x3817('0x44')](handleError(_0x52fabc,null));};exports[_0x3817('0x22')]=function(_0x13d2f2,_0x25b8ea){return db['Disposition'][_0x3817('0x47')]({'where':{'id':_0x13d2f2[_0x3817('0x46')]['id']}})[_0x3817('0x21')](handleEntityNotFound(_0x25b8ea,null))[_0x3817('0x21')](removeEntity(_0x25b8ea,null))[_0x3817('0x44')](handleError(_0x25b8ea,null));};
\ No newline at end of file
+var _0xe2af=['pick','filter','merge','VIRTUAL','Disposition','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Dispositions','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where'];(function(_0x3e3c2e,_0x3353a3){var _0x3f5b24=function(_0x4c7529){while(--_0x4c7529){_0x3e3c2e['push'](_0x3e3c2e['shift']());}};_0x3f5b24(++_0x3353a3);}(_0xe2af,0x6a));var _0xfe2a=function(_0x4e8367,_0x17f37d){_0x4e8367=_0x4e8367-0x0;var _0x5b1e6e=_0xe2af[_0x4e8367];return _0x5b1e6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2a('0x0'));var zipdir=require(_0xfe2a('0x1'));var jsonpatch=require(_0xfe2a('0x2'));var rp=require(_0xfe2a('0x3'));var moment=require(_0xfe2a('0x4'));var BPromise=require(_0xfe2a('0x5'));var Mustache=require(_0xfe2a('0x6'));var util=require('util');var path=require(_0xfe2a('0x7'));var sox=require(_0xfe2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2a('0x9'));var squel=require(_0xfe2a('0xa'));var crypto=require('crypto');var jsforce=require(_0xfe2a('0xb'));var deskjs=require(_0xfe2a('0xc'));var toCsv=require(_0xfe2a('0xd'));var querystring=require('querystring');var Papa=require(_0xfe2a('0xe'));var Redis=require(_0xfe2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfe2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2a('0x11'));var logger=require(_0xfe2a('0x12'))(_0xfe2a('0x13'));var utils=require(_0xfe2a('0x14'));var config=require(_0xfe2a('0x15'));var licenseUtil=require(_0xfe2a('0x16'));var db=require(_0xfe2a('0x17'))['db'];function respondWithStatusCode(_0x5da98e,_0x1f2ed2){_0x1f2ed2=_0x1f2ed2||0xcc;return function(_0x1ac883){if(_0x1ac883){return _0x5da98e[_0xfe2a('0x18')](_0x1f2ed2);}return _0x5da98e[_0xfe2a('0x19')](_0x1f2ed2)[_0xfe2a('0x1a')]();};}function respondWithResult(_0x18a30b,_0x27a740){_0x27a740=_0x27a740||0xc8;return function(_0x4bb463){if(_0x4bb463){return _0x18a30b['status'](_0x27a740)[_0xfe2a('0x1b')](_0x4bb463);}};}function respondWithFilteredResult(_0xc24caa,_0x213a13){return function(_0x428f02){if(_0x428f02){var _0x3026dc=typeof _0x213a13[_0xfe2a('0x1c')]===_0xfe2a('0x1d')&&typeof _0x213a13[_0xfe2a('0x1e')]===_0xfe2a('0x1d');var _0x499452=_0x428f02[_0xfe2a('0x1f')];var _0x4969a9=_0x3026dc?0x0:_0x213a13['offset'];var _0x4f2b86=_0x3026dc?_0x428f02[_0xfe2a('0x1f')]:_0x213a13[_0xfe2a('0x1c')]+_0x213a13[_0xfe2a('0x1e')];var _0x430a5f;if(_0x4f2b86>=_0x499452){_0x4f2b86=_0x499452;_0x430a5f=0xc8;}else{_0x430a5f=0xce;}_0xc24caa[_0xfe2a('0x19')](_0x430a5f);return _0xc24caa[_0xfe2a('0x20')]('Content-Range',_0x4969a9+'-'+_0x4f2b86+'/'+_0x499452)[_0xfe2a('0x1b')](_0x428f02);}return null;};}function patchUpdates(_0x36bbd1){return function(_0x304920){try{jsonpatch[_0xfe2a('0x21')](_0x304920,_0x36bbd1,!![]);}catch(_0x18ccef){return BPromise['reject'](_0x18ccef);}return _0x304920[_0xfe2a('0x22')]();};}function saveUpdates(_0x36274c,_0x4e51c6){return function(_0x20afcd){if(_0x20afcd){return _0x20afcd[_0xfe2a('0x23')](_0x36274c)[_0xfe2a('0x24')](function(_0x5d1829){return _0x5d1829;});}return null;};}function removeEntity(_0x2cb58c,_0xbf719f){return function(_0x1a31f1){if(_0x1a31f1){return _0x1a31f1[_0xfe2a('0x25')]()[_0xfe2a('0x24')](function(){var _0x41a072=_0x1a31f1[_0xfe2a('0x26')]({'plain':!![]});var _0x59e1fd=_0xfe2a('0x27');return db['UserProfileResource'][_0xfe2a('0x25')]({'where':{'type':_0x59e1fd,'resourceId':_0x41a072['id']}})[_0xfe2a('0x24')](function(){return _0x1a31f1;});})[_0xfe2a('0x24')](function(){_0x2cb58c['status'](0xcc)[_0xfe2a('0x1a')]();});}};}function handleEntityNotFound(_0x3bf4a0,_0x4a980b){return function(_0x4d8d5e){if(!_0x4d8d5e){_0x3bf4a0['sendStatus'](0x194);}return _0x4d8d5e;};}function handleError(_0x24ff7b,_0x3209fa){_0x3209fa=_0x3209fa||0x1f4;return function(_0x5a715c){logger[_0xfe2a('0x28')](_0x5a715c['stack']);if(_0x5a715c[_0xfe2a('0x29')]){delete _0x5a715c['name'];}_0x24ff7b['status'](_0x3209fa)[_0xfe2a('0x2a')](_0x5a715c);};}exports['index']=function(_0x17541d,_0x518365){var _0xb9a17f={},_0x2387d1={},_0x1d8146={'count':0x0,'rows':[]};var _0x415d4d=_[_0xfe2a('0x2b')](db['Disposition'][_0xfe2a('0x2c')],function(_0x3efbb6){return{'name':_0x3efbb6[_0xfe2a('0x2d')],'type':_0x3efbb6[_0xfe2a('0x2e')][_0xfe2a('0x2f')]};});_0x2387d1[_0xfe2a('0x30')]=_[_0xfe2a('0x2b')](_0x415d4d,_0xfe2a('0x29'));_0x2387d1[_0xfe2a('0x31')]=_['keys'](_0x17541d[_0xfe2a('0x31')]);_0x2387d1[_0xfe2a('0x32')]=_[_0xfe2a('0x33')](_0x2387d1[_0xfe2a('0x30')],_0x2387d1['query']);_0xb9a17f[_0xfe2a('0x34')]=_['intersection'](_0x2387d1[_0xfe2a('0x30')],qs[_0xfe2a('0x35')](_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x35')]));_0xb9a17f[_0xfe2a('0x34')]=_0xb9a17f[_0xfe2a('0x34')][_0xfe2a('0x36')]?_0xb9a17f['attributes']:_0x2387d1[_0xfe2a('0x30')];if(!_0x17541d[_0xfe2a('0x31')]['hasOwnProperty'](_0xfe2a('0x37'))){_0xb9a17f[_0xfe2a('0x1e')]=qs[_0xfe2a('0x1e')](_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x1e')]);_0xb9a17f[_0xfe2a('0x1c')]=qs[_0xfe2a('0x1c')](_0x17541d['query'][_0xfe2a('0x1c')]);}_0xb9a17f['order']=qs[_0xfe2a('0x38')](_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x38')]);_0xb9a17f[_0xfe2a('0x39')]=qs[_0xfe2a('0x32')](_[_0xfe2a('0x3a')](_0x17541d[_0xfe2a('0x31')],_0x2387d1[_0xfe2a('0x32')]),_0x415d4d);if(_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x3b')]){_0xb9a17f[_0xfe2a('0x39')]=_[_0xfe2a('0x3c')](_0xb9a17f[_0xfe2a('0x39')],{'$or':_[_0xfe2a('0x2b')](_0x415d4d,function(_0x178b10){if(_0x178b10[_0xfe2a('0x2e')]!==_0xfe2a('0x3d')){var _0x11f16d={};_0x11f16d[_0x178b10[_0xfe2a('0x29')]]={'$like':'%'+_0x17541d['query']['filter']+'%'};return _0x11f16d;}})});}_0xb9a17f=_['merge']({},_0xb9a17f,_0x17541d['options']);var _0x2026c7={'where':_0xb9a17f['where']};return db[_0xfe2a('0x3e')][_0xfe2a('0x1f')](_0x2026c7)[_0xfe2a('0x24')](function(_0x42b659){_0x1d8146[_0xfe2a('0x1f')]=_0x42b659;if(_0x17541d[_0xfe2a('0x31')][_0xfe2a('0x3f')]){_0xb9a17f[_0xfe2a('0x40')]=[{'all':!![]}];}return db[_0xfe2a('0x3e')][_0xfe2a('0x41')](_0xb9a17f);})['then'](function(_0x1d1de1){_0x1d8146[_0xfe2a('0x42')]=_0x1d1de1;return _0x1d8146;})[_0xfe2a('0x24')](respondWithFilteredResult(_0x518365,_0xb9a17f))[_0xfe2a('0x43')](handleError(_0x518365,null));};exports[_0xfe2a('0x44')]=function(_0x7ed669,_0xa32d4d){var _0x2d7462={'raw':!![],'where':{'id':_0x7ed669[_0xfe2a('0x45')]['id']}},_0x3287af={};_0x3287af[_0xfe2a('0x30')]=_[_0xfe2a('0x46')](db['Disposition'][_0xfe2a('0x2c')]);_0x3287af[_0xfe2a('0x31')]=_['keys'](_0x7ed669[_0xfe2a('0x31')]);_0x3287af[_0xfe2a('0x32')]=_[_0xfe2a('0x33')](_0x3287af[_0xfe2a('0x30')],_0x3287af['query']);_0x2d7462[_0xfe2a('0x34')]=_['intersection'](_0x3287af[_0xfe2a('0x30')],qs[_0xfe2a('0x35')](_0x7ed669[_0xfe2a('0x31')]['fields']));_0x2d7462[_0xfe2a('0x34')]=_0x2d7462[_0xfe2a('0x34')][_0xfe2a('0x36')]?_0x2d7462['attributes']:_0x3287af[_0xfe2a('0x30')];if(_0x7ed669['query'][_0xfe2a('0x3f')]){_0x2d7462[_0xfe2a('0x40')]=[{'all':!![]}];}_0x2d7462=_[_0xfe2a('0x3c')]({},_0x2d7462,_0x7ed669[_0xfe2a('0x47')]);return db['Disposition'][_0xfe2a('0x48')](_0x2d7462)[_0xfe2a('0x24')](handleEntityNotFound(_0xa32d4d,null))[_0xfe2a('0x24')](respondWithResult(_0xa32d4d,null))[_0xfe2a('0x43')](handleError(_0xa32d4d,null));};exports[_0xfe2a('0x49')]=function(_0x1c8693,_0x2ef065){return db[_0xfe2a('0x3e')][_0xfe2a('0x49')](_0x1c8693[_0xfe2a('0x4a')],{})[_0xfe2a('0x24')](function(_0x5b0d9f){var _0x5da79f=_0x1c8693[_0xfe2a('0x4b')][_0xfe2a('0x26')]({'plain':!![]});if(!_0x5da79f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5da79f[_0xfe2a('0x4c')]===_0xfe2a('0x4b')){var _0x51b796=_0x5b0d9f['get']({'plain':!![]});var _0x20a274='Dispositions';return db[_0xfe2a('0x4d')][_0xfe2a('0x48')]({'where':{'name':_0x20a274,'userProfileId':_0x5da79f[_0xfe2a('0x4e')]},'raw':!![]})[_0xfe2a('0x24')](function(_0x2370ba){if(_0x2370ba&&_0x2370ba[_0xfe2a('0x4f')]===0x0){return db[_0xfe2a('0x50')][_0xfe2a('0x49')]({'name':_0x51b796[_0xfe2a('0x29')],'resourceId':_0x51b796['id'],'type':_0x2370ba[_0xfe2a('0x29')],'sectionId':_0x2370ba['id']},{})[_0xfe2a('0x24')](function(){return _0x5b0d9f;});}else{return _0x5b0d9f;}})[_0xfe2a('0x43')](function(_0x30b2bc){logger[_0xfe2a('0x28')](_0xfe2a('0x51'),_0x30b2bc);throw _0x30b2bc;});}return _0x5b0d9f;})[_0xfe2a('0x24')](respondWithResult(_0x2ef065,0xc9))[_0xfe2a('0x43')](handleError(_0x2ef065,null));};exports[_0xfe2a('0x23')]=function(_0x2d4728,_0x3dbb48){if(_0x2d4728[_0xfe2a('0x4a')]['id']){delete _0x2d4728[_0xfe2a('0x4a')]['id'];}return db[_0xfe2a('0x3e')]['find']({'where':{'id':_0x2d4728[_0xfe2a('0x45')]['id']}})[_0xfe2a('0x24')](handleEntityNotFound(_0x3dbb48,null))['then'](saveUpdates(_0x2d4728[_0xfe2a('0x4a')],null))[_0xfe2a('0x24')](respondWithResult(_0x3dbb48,null))[_0xfe2a('0x43')](handleError(_0x3dbb48,null));};exports[_0xfe2a('0x25')]=function(_0x4fc5a5,_0x3d87a1){return db['Disposition'][_0xfe2a('0x48')]({'where':{'id':_0x4fc5a5[_0xfe2a('0x45')]['id']}})[_0xfe2a('0x24')](handleEntityNotFound(_0x3d87a1,null))[_0xfe2a('0x24')](removeEntity(_0x3d87a1,null))[_0xfe2a('0x43')](handleError(_0x3d87a1,null));};
\ No newline at end of file
index b0ec3fc..56312ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0369=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x0369,0x113));var _0x9036=function(_0x12019c,_0x4c1f1a){_0x12019c=_0x12019c-0x0;var _0x1a3004=_0x0369[_0x12019c];return _0x1a3004;};'use strict';var _=require(_0x9036('0x0'));var util=require(_0x9036('0x1'));var logger=require(_0x9036('0x2'))(_0x9036('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9036('0x4'));var fs=require('fs');var path=require(_0x9036('0x5'));var rimraf=require(_0x9036('0x6'));var config=require(_0x9036('0x7'));var attributes=require(_0x9036('0x8'));module[_0x9036('0x9')]=function(_0x41210a,_0x3372f7){return _0x41210a[_0x9036('0xa')](_0x9036('0xb'),attributes,{'tableName':_0x9036('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9036('0xd'),'fields':[_0x9036('0xe'),_0x9036('0xf')]},{'unique':!![],'name':_0x9036('0x10'),'fields':[_0x9036('0xe'),_0x9036('0x11')]},{'unique':!![],'name':_0x9036('0x12'),'fields':[_0x9036('0xe'),_0x9036('0x13')]},{'unique':!![],'name':_0x9036('0x14'),'fields':[_0x9036('0xe'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x9036('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x9036('0x15'),'fields':[_0x9036('0xe'),_0x9036('0x16')]},{'unique':!![],'name':_0x9036('0x17'),'fields':['name',_0x9036('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe98=['../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_sms','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','bluebird','path','rimraf'];(function(_0x365628,_0x1728f6){var _0x3f221f=function(_0x286d4f){while(--_0x286d4f){_0x365628['push'](_0x365628['shift']());}};_0x3f221f(++_0x1728f6);}(_0xbe98,0x174));var _0x8be9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe98[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8be9('0x0'));var util=require(_0x8be9('0x1'));var logger=require('../../config/logger')(_0x8be9('0x2'));var moment=require('moment');var BPromise=require(_0x8be9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8be9('0x4'));var rimraf=require(_0x8be9('0x5'));var config=require(_0x8be9('0x6'));var attributes=require(_0x8be9('0x7'));module[_0x8be9('0x8')]=function(_0x5a4148,_0x4636bf){return _0x5a4148[_0x8be9('0x9')](_0x8be9('0xa'),attributes,{'tableName':_0x8be9('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8be9('0xc'),'fields':[_0x8be9('0xd'),_0x8be9('0xe')]},{'unique':!![],'name':_0x8be9('0xf'),'fields':[_0x8be9('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x8be9('0x10'),'fields':[_0x8be9('0xd'),'SmsAccountId']},{'unique':!![],'name':_0x8be9('0x11'),'fields':[_0x8be9('0xd'),_0x8be9('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x8be9('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x8be9('0x13'),'fields':[_0x8be9('0xd'),_0x8be9('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
index e2f359b..01146bc 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(_0x13dcce,_0x5dfdc3){var _0x2c0acb=function(_0x10ca41){while(--_0x10ca41){_0x13dcce['push'](_0x13dcce['shift']());}};_0x2c0acb(++_0x5dfdc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1c10d3,_0x436647){var _0x7573e5=function(_0x522394){while(--_0x522394){_0x1c10d3['push'](_0x1c10d3['shift']());}};_0x7573e5(++_0x436647);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 d61874c..9abe995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6639=['delete','isAuthenticated','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6639,0x1e3));var _0x9663=function(_0x445cbd,_0x12e747){_0x445cbd=_0x445cbd-0x0;var _0x2ed3ff=_0x6639[_0x445cbd];return _0x2ed3ff;};'use strict';var multer=require('multer');var util=require(_0x9663('0x0'));var path=require('path');var timeout=require(_0x9663('0x1'));var express=require('express');var router=express[_0x9663('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9663('0x3'));var interaction=require(_0x9663('0x4'));var config=require(_0x9663('0x5'));var controller=require(_0x9663('0x6'));router[_0x9663('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9663('0x8'),auth['isAuthenticated'](),controller[_0x9663('0x9')]);router[_0x9663('0xa')]('/',auth['isAuthenticated'](),controller[_0x9663('0xb')]);router['put'](_0x9663('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x9663('0xc')](_0x9663('0x8'),auth[_0x9663('0xd')](),controller[_0x9663('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x5f83=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put','/:id','update','destroy','exports','multer'];(function(_0x18f3c5,_0x58852e){var _0x1e7acb=function(_0x39b8d8){while(--_0x39b8d8){_0x18f3c5['push'](_0x18f3c5['shift']());}};_0x1e7acb(++_0x58852e);}(_0x5f83,0x8f));var _0x35f8=function(_0x2745a1,_0x103b45){_0x2745a1=_0x2745a1-0x0;var _0x511815=_0x5f83[_0x2745a1];return _0x511815;};'use strict';var multer=require(_0x35f8('0x0'));var util=require(_0x35f8('0x1'));var path=require('path');var timeout=require(_0x35f8('0x2'));var express=require(_0x35f8('0x3'));var router=express[_0x35f8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x35f8('0x5'));var interaction=require(_0x35f8('0x6'));var config=require(_0x35f8('0x7'));var controller=require('./disposition.controller');router[_0x35f8('0x8')]('/',auth['isAuthenticated'](),controller[_0x35f8('0x9')]);router[_0x35f8('0x8')]('/:id',auth[_0x35f8('0xa')](),controller[_0x35f8('0xb')]);router[_0x35f8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x35f8('0xd')](_0x35f8('0xe'),auth[_0x35f8('0xa')](),controller[_0x35f8('0xf')]);router['delete'](_0x35f8('0xe'),auth[_0x35f8('0xa')](),controller[_0x35f8('0x10')]);module[_0x35f8('0x11')]=router;
\ No newline at end of file
index 1b31eeb..a75c9d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c0=['yes','localstationid','2400','7200','4800','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','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','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3c0,0xb4));var _0x0a3c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa3c0[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x0a3c('0x0'));module[_0x0a3c('0x1')]={'name':{'type':Sequelize[_0x0a3c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0a3c('0x2')]},'ecm':{'type':Sequelize[_0x0a3c('0x3')]('yes','no'),'defaultValue':_0x0a3c('0x4')},'headerinfo':{'type':Sequelize[_0x0a3c('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x0a3c('0x2')],'unique':_0x0a3c('0x5')},'minrate':{'type':Sequelize[_0x0a3c('0x3')](_0x0a3c('0x6'),'4800',_0x0a3c('0x7'),'9600','12000','14400'),'defaultValue':_0x0a3c('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x0a3c('0x6'),_0x0a3c('0x8'),_0x0a3c('0x7'),_0x0a3c('0x9'),_0x0a3c('0xa'),'14400'),'defaultValue':_0x0a3c('0xb')},'modem':{'type':Sequelize[_0x0a3c('0x2')],'defaultValue':_0x0a3c('0xc')},'gateway':{'type':Sequelize[_0x0a3c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0a3c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0a3c('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0a3c('0x3')](_0x0a3c('0xe'),_0x0a3c('0xf'),_0x0a3c('0x10'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x0a3c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0a3c('0x11')],'defaultValue':function(){return _0x0a3c('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a3c('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a3c('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0a3c('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a3c('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a3c('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a3c('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x0a3c('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x0a3c('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d4b8f){if(!_0x3d4b8f)this[_0x0a3c('0x15')](_0x0a3c('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x3d4b8f);}}};
\ No newline at end of file
+var _0xd4d4=['xCALLY\x20Motion\x20Fax','2400','4800','9600','12000','14400','7200','INTEGER','KHOMP','SIP','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','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes'];(function(_0x15e14e,_0x48012d){var _0x331403=function(_0x3f40d6){while(--_0x3f40d6){_0x15e14e['push'](_0x15e14e['shift']());}};_0x331403(++_0x48012d);}(_0xd4d4,0xcd));var _0x4d4d=function(_0x3e5a64,_0x484d5c){_0x3e5a64=_0x3e5a64-0x0;var _0x54c670=_0xd4d4[_0x3e5a64];return _0x54c670;};'use strict';var Sequelize=require(_0x4d4d('0x0'));module[_0x4d4d('0x1')]={'name':{'type':Sequelize[_0x4d4d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4d4d('0x2')]},'ecm':{'type':Sequelize[_0x4d4d('0x3')](_0x4d4d('0x4'),'no'),'defaultValue':_0x4d4d('0x4')},'headerinfo':{'type':Sequelize[_0x4d4d('0x2')],'defaultValue':_0x4d4d('0x5')},'localstationid':{'type':Sequelize[_0x4d4d('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x4d4d('0x3')](_0x4d4d('0x6'),_0x4d4d('0x7'),'7200',_0x4d4d('0x8'),_0x4d4d('0x9'),_0x4d4d('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x4d4d('0x3')](_0x4d4d('0x6'),'4800',_0x4d4d('0xb'),_0x4d4d('0x8'),'12000','14400'),'defaultValue':_0x4d4d('0xa')},'modem':{'type':Sequelize[_0x4d4d('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4d4d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4d4d('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4d4d('0x3')]('SIP','IAX','DADHI',_0x4d4d('0xd')),'defaultValue':_0x4d4d('0xe')},'key':{'type':Sequelize[_0x4d4d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4d4d('0xf')],'defaultValue':function(){return _0x4d4d('0x10');}},'notificationSound':{'type':Sequelize[_0x4d4d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4d4d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4d4d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4d4d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4d4d('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x4d4d('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x57c601){if(!_0x57c601)this[_0x4d4d('0x13')]('mandatoryDispositionPauseId',null);this[_0x4d4d('0x13')](_0x4d4d('0x14'),_0x57c601);}}};
\ No newline at end of file
index e21e35f..ed1923a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d77=['length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','describe','addDisposition','getDispositions','Disposition','sort','FaxAccountId','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','context','from-voip-provider','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','TrunkId','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','FaxAccount','includeAll','include','rows','show','params','rawAttributes'];(function(_0x237dc7,_0x116df9){var _0x12235e=function(_0x204f94){while(--_0x204f94){_0x237dc7['push'](_0x237dc7['shift']());}};_0x12235e(++_0x116df9);}(_0x4d77,0x1f0));var _0x74d7=function(_0x17d40b,_0x443f25){_0x17d40b=_0x17d40b-0x0;var _0x15726e=_0x4d77[_0x17d40b];return _0x15726e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74d7('0x0'));var zipdir=require(_0x74d7('0x1'));var jsonpatch=require(_0x74d7('0x2'));var rp=require(_0x74d7('0x3'));var moment=require(_0x74d7('0x4'));var BPromise=require(_0x74d7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x74d7('0x6'));var sox=require(_0x74d7('0x7'));var csv=require(_0x74d7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74d7('0x9'));var squel=require(_0x74d7('0xa'));var crypto=require(_0x74d7('0xb'));var jsforce=require(_0x74d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x74d7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74d7('0xd'));var authService=require(_0x74d7('0xe'));var qs=require(_0x74d7('0xf'));var as=require(_0x74d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74d7('0x11'))('api');var utils=require(_0x74d7('0x12'));var config=require(_0x74d7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x74d7('0x14')]=_[_0x74d7('0x15')](config[_0x74d7('0x14')],{'host':_0x74d7('0x16'),'port':0x18eb});var socket=require(_0x74d7('0x17'))(new Redis(config[_0x74d7('0x14')]));require(_0x74d7('0x18'))[_0x74d7('0x19')](socket);var jayson=require(_0x74d7('0x1a'));var client=jayson[_0x74d7('0x1b')][_0x74d7('0x1c')]({'port':0x232c});var client9002=jayson[_0x74d7('0x1b')][_0x74d7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x529511,_0x1d616b,_0x33857a,_0x3f8646){return new BPromise(function(_0x2dccf1,_0x26117d){var _0x4df9dc=_0x3f8646||client;return _0x4df9dc[_0x74d7('0x1d')](_0x529511,_0x33857a)[_0x74d7('0x1e')](function(_0x505211){logger[_0x74d7('0x1f')](_0x74d7('0x20'),_0x1d616b,_0x74d7('0x21'));logger[_0x74d7('0x22')](_0x74d7('0x23'),_0x1d616b,_0x74d7('0x21'),JSON[_0x74d7('0x24')](_0x505211));if(_0x505211[_0x74d7('0x25')]){if(_0x505211[_0x74d7('0x25')][_0x74d7('0x26')]===0x1f4){logger['error'](_0x74d7('0x20'),_0x1d616b,_0x505211[_0x74d7('0x25')][_0x74d7('0x27')]);return _0x26117d(_0x505211[_0x74d7('0x25')][_0x74d7('0x27')]);}logger[_0x74d7('0x25')](_0x74d7('0x20'),_0x1d616b,_0x505211[_0x74d7('0x25')][_0x74d7('0x27')]);return _0x2dccf1(_0x505211['error'][_0x74d7('0x27')]);}else{logger[_0x74d7('0x1f')](_0x74d7('0x20'),_0x1d616b,_0x74d7('0x21'));_0x2dccf1(_0x505211['result'][_0x74d7('0x27')]);}})[_0x74d7('0x28')](function(_0x59e717){logger[_0x74d7('0x25')](_0x74d7('0x20'),_0x1d616b,_0x59e717);_0x26117d(_0x59e717);});});}function respondWithStatusCode(_0x298fbb,_0x59efab){_0x59efab=_0x59efab||0xcc;return function(_0x3620df){if(_0x3620df){return _0x298fbb['sendStatus'](_0x59efab);}return _0x298fbb[_0x74d7('0x29')](_0x59efab)[_0x74d7('0x2a')]();};}function respondWithResult(_0x4a9126,_0x4d5329){_0x4d5329=_0x4d5329||0xc8;return function(_0x17d8d6){if(_0x17d8d6){return _0x4a9126[_0x74d7('0x29')](_0x4d5329)[_0x74d7('0x2b')](_0x17d8d6);}};}function respondWithFilteredResult(_0x169b7b,_0x59f094){return function(_0x116c53){if(_0x116c53){var _0x5452ad=typeof _0x59f094[_0x74d7('0x2c')]===_0x74d7('0x2d')&&typeof _0x59f094[_0x74d7('0x2e')]===_0x74d7('0x2d');var _0x25dc1e=_0x116c53[_0x74d7('0x2f')];var _0x166b40=_0x5452ad?0x0:_0x59f094[_0x74d7('0x2c')];var _0x30b211=_0x5452ad?_0x116c53[_0x74d7('0x2f')]:_0x59f094[_0x74d7('0x2c')]+_0x59f094[_0x74d7('0x2e')];var _0x172d50;if(_0x30b211>=_0x25dc1e){_0x30b211=_0x25dc1e;_0x172d50=0xc8;}else{_0x172d50=0xce;}_0x169b7b['status'](_0x172d50);return _0x169b7b[_0x74d7('0x30')](_0x74d7('0x31'),_0x166b40+'-'+_0x30b211+'/'+_0x25dc1e)[_0x74d7('0x2b')](_0x116c53);}return null;};}function patchUpdates(_0x22f87d){return function(_0x351438){try{jsonpatch[_0x74d7('0x32')](_0x351438,_0x22f87d,!![]);}catch(_0x5a427f){return BPromise[_0x74d7('0x33')](_0x5a427f);}return _0x351438[_0x74d7('0x34')]();};}function saveUpdates(_0x4a3e76,_0x1434a3){return function(_0x5ecf09){if(_0x5ecf09){return _0x5ecf09[_0x74d7('0x35')](_0x4a3e76)[_0x74d7('0x1e')](function(_0x180dae){return _0x180dae;});}return null;};}function removeEntity(_0x361320,_0x174963){return function(_0x1245ce){if(_0x1245ce){return _0x1245ce[_0x74d7('0x36')]()[_0x74d7('0x1e')](function(){var _0x3d8bcf=_0x1245ce['get']({'plain':!![]});var _0x40bded=_0x74d7('0x37');return db[_0x74d7('0x38')][_0x74d7('0x36')]({'where':{'type':_0x40bded,'resourceId':_0x3d8bcf['id']}})[_0x74d7('0x1e')](function(){return _0x1245ce;});})[_0x74d7('0x1e')](function(){_0x361320[_0x74d7('0x29')](0xcc)[_0x74d7('0x2a')]();});}};}function handleEntityNotFound(_0xd0b5d8,_0x2e2aaf){return function(_0x421b6a){if(!_0x421b6a){_0xd0b5d8['sendStatus'](0x194);}return _0x421b6a;};}function handleError(_0x26a9c1,_0x6613cc){_0x6613cc=_0x6613cc||0x1f4;return function(_0x5bbaeb){logger[_0x74d7('0x25')](_0x5bbaeb[_0x74d7('0x39')]);if(_0x5bbaeb[_0x74d7('0x3a')]){delete _0x5bbaeb['name'];}_0x26a9c1[_0x74d7('0x29')](_0x6613cc)['send'](_0x5bbaeb);};}exports[_0x74d7('0x3b')]=function(_0x548588,_0x3d83cb){var _0xf2c85b={'include':[{'model':db[_0x74d7('0x3c')],'as':_0x74d7('0x3d')}]},_0x426b7d={},_0x12ca1={'count':0x0,'rows':[]};var _0x349958=_['map'](db['FaxAccount']['rawAttributes'],function(_0x788007){return{'name':_0x788007[_0x74d7('0x3e')],'type':_0x788007[_0x74d7('0x3f')][_0x74d7('0x40')]};});_0x426b7d['model']=_[_0x74d7('0x41')](_0x349958,_0x74d7('0x3a'));_0x426b7d[_0x74d7('0x42')]=_[_0x74d7('0x43')](_0x548588[_0x74d7('0x42')]);_0x426b7d[_0x74d7('0x44')]=_['intersection'](_0x426b7d[_0x74d7('0x45')],_0x426b7d['query']);_0xf2c85b['attributes']=_[_0x74d7('0x46')](_0x426b7d[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x548588['query'][_0x74d7('0x47')]));_0xf2c85b[_0x74d7('0x48')]=_0xf2c85b['attributes']['length']?_0xf2c85b['attributes']:_0x426b7d[_0x74d7('0x45')];if(!_0x548588[_0x74d7('0x42')][_0x74d7('0x49')](_0x74d7('0x4a'))){_0xf2c85b[_0x74d7('0x2e')]=qs[_0x74d7('0x2e')](_0x548588['query'][_0x74d7('0x2e')]);_0xf2c85b[_0x74d7('0x2c')]=qs['offset'](_0x548588[_0x74d7('0x42')][_0x74d7('0x2c')]);}_0xf2c85b[_0x74d7('0x4b')]=qs['sort'](_0x548588['query']['sort']);_0xf2c85b[_0x74d7('0x4c')]=qs[_0x74d7('0x44')](_[_0x74d7('0x4d')](_0x548588[_0x74d7('0x42')],_0x426b7d[_0x74d7('0x44')]),_0x349958);if(_0x548588[_0x74d7('0x42')]['filter']){_0xf2c85b[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0xf2c85b['where'],{'$or':_['map'](_0x349958,function(_0x46faba){if(_0x46faba[_0x74d7('0x3f')]!==_0x74d7('0x4f')){var _0x23f877={};_0x23f877[_0x46faba['name']]={'$like':'%'+_0x548588[_0x74d7('0x42')][_0x74d7('0x50')]+'%'};return _0x23f877;}})});}_0xf2c85b=_[_0x74d7('0x4e')]({},_0xf2c85b,_0x548588[_0x74d7('0x51')]);var _0x375e2c={'where':_0xf2c85b[_0x74d7('0x4c')]};return db[_0x74d7('0x52')][_0x74d7('0x2f')](_0x375e2c)[_0x74d7('0x1e')](function(_0x59bc5e){_0x12ca1[_0x74d7('0x2f')]=_0x59bc5e;if(_0x548588['query'][_0x74d7('0x53')]){_0xf2c85b[_0x74d7('0x54')]=[{'all':!![]}];}return db[_0x74d7('0x52')]['findAll'](_0xf2c85b);})[_0x74d7('0x1e')](function(_0x4eaed4){_0x12ca1[_0x74d7('0x55')]=_0x4eaed4;return _0x12ca1;})[_0x74d7('0x1e')](respondWithFilteredResult(_0x3d83cb,_0xf2c85b))[_0x74d7('0x28')](handleError(_0x3d83cb,null));};exports[_0x74d7('0x56')]=function(_0x5f3969,_0x4d0b8c){var _0x702c72={'raw':![],'where':{'id':_0x5f3969[_0x74d7('0x57')]['id']},'include':[{'model':db[_0x74d7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1ffe5e={};_0x1ffe5e[_0x74d7('0x45')]=_[_0x74d7('0x43')](db['FaxAccount'][_0x74d7('0x58')]);_0x1ffe5e['query']=_[_0x74d7('0x43')](_0x5f3969[_0x74d7('0x42')]);_0x1ffe5e[_0x74d7('0x44')]=_[_0x74d7('0x46')](_0x1ffe5e[_0x74d7('0x45')],_0x1ffe5e[_0x74d7('0x42')]);_0x702c72[_0x74d7('0x48')]=_[_0x74d7('0x46')](_0x1ffe5e[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x5f3969[_0x74d7('0x42')][_0x74d7('0x47')]));_0x702c72['attributes']=_0x702c72[_0x74d7('0x48')][_0x74d7('0x59')]?_0x702c72['attributes']:_0x1ffe5e[_0x74d7('0x45')];if(_0x5f3969['query'][_0x74d7('0x53')]){_0x702c72[_0x74d7('0x54')]=[{'all':!![]}];}_0x702c72=_[_0x74d7('0x4e')]({},_0x702c72,_0x5f3969[_0x74d7('0x51')]);return db['FaxAccount']['find'](_0x702c72)[_0x74d7('0x1e')](handleEntityNotFound(_0x4d0b8c,null))['then'](respondWithResult(_0x4d0b8c,null))[_0x74d7('0x28')](handleError(_0x4d0b8c,null));};exports[_0x74d7('0x5a')]=function(_0x408534,_0x1eec1d){return db[_0x74d7('0x52')][_0x74d7('0x5a')](_0x408534[_0x74d7('0x5b')],{})[_0x74d7('0x1e')](function(_0x524c21){var _0x35a001=_0x408534[_0x74d7('0x5c')][_0x74d7('0x5d')]({'plain':!![]});if(!_0x35a001)throw new Error(_0x74d7('0x5e'));if(_0x35a001[_0x74d7('0x5f')]===_0x74d7('0x5c')){var _0x3f0e92=_0x524c21[_0x74d7('0x5d')]({'plain':!![]});var _0x35e460=_0x74d7('0x37');return db[_0x74d7('0x60')][_0x74d7('0x61')]({'where':{'name':_0x35e460,'userProfileId':_0x35a001[_0x74d7('0x62')]},'raw':!![]})['then'](function(_0x5e2d62){if(_0x5e2d62&&_0x5e2d62['autoAssociation']===0x0){return db[_0x74d7('0x38')][_0x74d7('0x5a')]({'name':_0x3f0e92[_0x74d7('0x3a')],'resourceId':_0x3f0e92['id'],'type':_0x5e2d62[_0x74d7('0x3a')],'sectionId':_0x5e2d62['id']},{})['then'](function(){return _0x524c21;});}else{return _0x524c21;}})[_0x74d7('0x28')](function(_0x3ab4ca){logger[_0x74d7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab4ca);throw _0x3ab4ca;});}return _0x524c21;})['then'](respondWithResult(_0x1eec1d,0xc9))[_0x74d7('0x28')](handleError(_0x1eec1d,null));};exports[_0x74d7('0x35')]=function(_0x43e25e,_0x53f51f){if(_0x43e25e[_0x74d7('0x5b')]['id']){delete _0x43e25e[_0x74d7('0x5b')]['id'];}return db[_0x74d7('0x52')][_0x74d7('0x61')]({'where':{'id':_0x43e25e[_0x74d7('0x57')]['id']},'include':[{'model':db[_0x74d7('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x74d7('0x1e')](handleEntityNotFound(_0x53f51f,null))['then'](saveUpdates(_0x43e25e[_0x74d7('0x5b')],null))[_0x74d7('0x1e')](respondWithResult(_0x53f51f,null))[_0x74d7('0x28')](handleError(_0x53f51f,null));};exports[_0x74d7('0x36')]=function(_0x42580a,_0x27549d){return db[_0x74d7('0x52')][_0x74d7('0x61')]({'where':{'id':_0x42580a[_0x74d7('0x57')]['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x27549d,null))[_0x74d7('0x1e')](removeEntity(_0x27549d,null))[_0x74d7('0x28')](handleError(_0x27549d,null));};exports['describe']=function(_0x2b9f02,_0x40d9d7){return db[_0x74d7('0x52')][_0x74d7('0x63')]()[_0x74d7('0x1e')](respondWithResult(_0x40d9d7,null))['catch'](handleError(_0x40d9d7,null));};exports[_0x74d7('0x64')]=function(_0x382d1f,_0x21b561,_0x586007){if(_0x382d1f['body']['id']){delete _0x382d1f[_0x74d7('0x5b')]['id'];}return db[_0x74d7('0x52')]['find']({'where':{'id':_0x382d1f['params']['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x21b561,null))['then'](function(_0x56655a){if(_0x56655a){_0x382d1f[_0x74d7('0x5b')]['FaxAccountId']=_0x56655a['id'];return db['Disposition']['create'](_0x382d1f[_0x74d7('0x5b')]);}})[_0x74d7('0x1e')](respondWithResult(_0x21b561,null))[_0x74d7('0x28')](handleError(_0x21b561,null));};exports[_0x74d7('0x65')]=function(_0x3d6429,_0x4eda4d,_0x1bc1b2){var _0x1f39c8={'raw':![],'where':{}};var _0x48f312={};var _0x1ffdf0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3d6429[_0x74d7('0x57')]['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x4eda4d,null))[_0x74d7('0x1e')](function(_0x7f1676){if(_0x7f1676){_0x48f312[_0x74d7('0x45')]=_['keys'](db[_0x74d7('0x66')][_0x74d7('0x58')]);_0x48f312[_0x74d7('0x42')]=_['keys'](_0x3d6429[_0x74d7('0x42')]);_0x48f312[_0x74d7('0x44')]=_['intersection'](_0x48f312[_0x74d7('0x45')],_0x48f312['query']);_0x1f39c8[_0x74d7('0x48')]=_['intersection'](_0x48f312[_0x74d7('0x45')],qs['fields'](_0x3d6429[_0x74d7('0x42')][_0x74d7('0x47')]));_0x1f39c8[_0x74d7('0x48')]=_0x1f39c8['attributes'][_0x74d7('0x59')]?_0x1f39c8[_0x74d7('0x48')]:_0x48f312[_0x74d7('0x45')];if(!_0x3d6429[_0x74d7('0x42')][_0x74d7('0x49')](_0x74d7('0x4a'))){_0x1f39c8['limit']=qs['limit'](_0x3d6429[_0x74d7('0x42')][_0x74d7('0x2e')]);_0x1f39c8['offset']=qs[_0x74d7('0x2c')](_0x3d6429[_0x74d7('0x42')]['offset']);}_0x1f39c8['order']=qs[_0x74d7('0x67')](_0x3d6429[_0x74d7('0x42')][_0x74d7('0x67')]);_0x1f39c8[_0x74d7('0x4c')]=qs[_0x74d7('0x44')](_[_0x74d7('0x4d')](_0x3d6429[_0x74d7('0x42')],_0x48f312['filters']));_0x1f39c8[_0x74d7('0x4c')][_0x74d7('0x68')]=_0x7f1676['id'];if(_0x3d6429[_0x74d7('0x42')][_0x74d7('0x50')]){_0x1f39c8[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0x1f39c8['where'],{'$or':_[_0x74d7('0x41')](_0x1f39c8[_0x74d7('0x48')],function(_0x34d469){var _0x4ed5b5={};_0x4ed5b5[_0x34d469]={'$like':'%'+_0x3d6429[_0x74d7('0x42')][_0x74d7('0x50')]+'%'};return _0x4ed5b5;})});}_0x1f39c8=_[_0x74d7('0x4e')]({},_0x1f39c8,_0x3d6429['options']);return db[_0x74d7('0x66')][_0x74d7('0x2f')]({'where':_0x1f39c8[_0x74d7('0x4c')]})['then'](function(_0x354c9a){_0x1ffdf0[_0x74d7('0x2f')]=_0x354c9a;if(_0x3d6429['query']['includeAll']){_0x1f39c8[_0x74d7('0x54')]=[{'all':!![]}];}return db[_0x74d7('0x66')][_0x74d7('0x69')](_0x1f39c8);})[_0x74d7('0x1e')](function(_0x9eb706){_0x1ffdf0[_0x74d7('0x55')]=_0x9eb706;return _0x1ffdf0;});}})['then'](respondWithFilteredResult(_0x4eda4d,_0x1f39c8))['catch'](handleError(_0x4eda4d,null));};exports[_0x74d7('0x6a')]=function(_0x33357a,_0x17a1d7,_0x27dfc5){return db[_0x74d7('0x52')]['find']({'where':{'id':_0x33357a[_0x74d7('0x57')]['id']}})['then'](handleEntityNotFound(_0x17a1d7,null))[_0x74d7('0x1e')](function(_0x55c1a0){if(_0x55c1a0){return _0x55c1a0['removeDispositions'](_0x33357a[_0x74d7('0x42')][_0x74d7('0x6b')]);}})[_0x74d7('0x1e')](respondWithStatusCode(_0x17a1d7,null))['catch'](handleError(_0x17a1d7,null));};exports[_0x74d7('0x6c')]=function(_0x19871a,_0x3abaa7,_0x4e9854){if(_0x19871a[_0x74d7('0x5b')]['id']){delete _0x19871a[_0x74d7('0x5b')]['id'];}return db['FaxAccount'][_0x74d7('0x61')]({'where':{'id':_0x19871a[_0x74d7('0x57')]['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x3abaa7,null))['then'](function(_0x30f869){if(_0x30f869){_0x19871a[_0x74d7('0x5b')][_0x74d7('0x68')]=_0x30f869['id'];return db['CannedAnswer'][_0x74d7('0x5a')](_0x19871a[_0x74d7('0x5b')]);}})[_0x74d7('0x1e')](respondWithResult(_0x3abaa7,null))['catch'](handleError(_0x3abaa7,null));};exports[_0x74d7('0x6d')]=function(_0x2a8ca6,_0x5427aa,_0xb29c4d){var _0x190183={'raw':![],'where':{}};var _0x39b12b={};var _0x35ee7c={'count':0x0,'rows':[]};return db[_0x74d7('0x52')][_0x74d7('0x6e')]({'where':{'id':_0x2a8ca6['params']['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x5427aa,null))['then'](function(_0x1885da){if(_0x1885da){_0x39b12b[_0x74d7('0x45')]=_[_0x74d7('0x43')](db[_0x74d7('0x6f')]['rawAttributes']);_0x39b12b[_0x74d7('0x42')]=_[_0x74d7('0x43')](_0x2a8ca6[_0x74d7('0x42')]);_0x39b12b[_0x74d7('0x44')]=_[_0x74d7('0x46')](_0x39b12b['model'],_0x39b12b[_0x74d7('0x42')]);_0x190183[_0x74d7('0x48')]=_[_0x74d7('0x46')](_0x39b12b[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x2a8ca6[_0x74d7('0x42')][_0x74d7('0x47')]));_0x190183['attributes']=_0x190183[_0x74d7('0x48')][_0x74d7('0x59')]?_0x190183[_0x74d7('0x48')]:_0x39b12b['model'];if(!_0x2a8ca6[_0x74d7('0x42')][_0x74d7('0x49')](_0x74d7('0x4a'))){_0x190183[_0x74d7('0x2e')]=qs[_0x74d7('0x2e')](_0x2a8ca6[_0x74d7('0x42')][_0x74d7('0x2e')]);_0x190183[_0x74d7('0x2c')]=qs['offset'](_0x2a8ca6[_0x74d7('0x42')][_0x74d7('0x2c')]);}_0x190183[_0x74d7('0x4b')]=qs[_0x74d7('0x67')](_0x2a8ca6[_0x74d7('0x42')][_0x74d7('0x67')]);_0x190183[_0x74d7('0x4c')]=qs[_0x74d7('0x44')](_[_0x74d7('0x4d')](_0x2a8ca6[_0x74d7('0x42')],_0x39b12b[_0x74d7('0x44')]));_0x190183[_0x74d7('0x4c')][_0x74d7('0x68')]=_0x1885da['id'];if(_0x2a8ca6['query'][_0x74d7('0x50')]){_0x190183[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0x190183[_0x74d7('0x4c')],{'$or':_[_0x74d7('0x41')](_0x190183[_0x74d7('0x48')],function(_0x11aa52){var _0x20453b={};_0x20453b[_0x11aa52]={'$like':'%'+_0x2a8ca6['query']['filter']+'%'};return _0x20453b;})});}_0x190183=_[_0x74d7('0x4e')]({},_0x190183,_0x2a8ca6[_0x74d7('0x51')]);return db[_0x74d7('0x6f')]['count']({'where':_0x190183[_0x74d7('0x4c')]})[_0x74d7('0x1e')](function(_0x5165cb){_0x35ee7c[_0x74d7('0x2f')]=_0x5165cb;if(_0x2a8ca6['query'][_0x74d7('0x53')]){_0x190183[_0x74d7('0x54')]=[{'all':!![]}];}return db[_0x74d7('0x6f')][_0x74d7('0x69')](_0x190183);})[_0x74d7('0x1e')](function(_0x38665f){_0x35ee7c[_0x74d7('0x55')]=_0x38665f;return _0x35ee7c;});}})[_0x74d7('0x1e')](respondWithFilteredResult(_0x5427aa,_0x190183))[_0x74d7('0x28')](handleError(_0x5427aa,null));};exports[_0x74d7('0x70')]=function(_0x4a8929,_0x1b3d2e,_0x3f4b1d){return db[_0x74d7('0x52')][_0x74d7('0x61')]({'where':{'id':_0x4a8929['params']['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x1b3d2e,null))[_0x74d7('0x1e')](function(_0x122b15){if(_0x122b15){return _0x122b15[_0x74d7('0x70')](_0x4a8929[_0x74d7('0x42')][_0x74d7('0x6b')]);}})[_0x74d7('0x1e')](respondWithStatusCode(_0x1b3d2e,null))[_0x74d7('0x28')](handleError(_0x1b3d2e,null));};exports['addInteraction']=function(_0x378149,_0x49ae20,_0x28339e){return db[_0x74d7('0x71')][_0x74d7('0x61')]({'where':{'id':_0x378149[_0x74d7('0x57')]['id']}})['then'](handleEntityNotFound(_0x49ae20,null))[_0x74d7('0x1e')](function(_0xc30770){if(_0xc30770){return _0xc30770['addInteraction'](_0x378149[_0x74d7('0x5b')][_0x74d7('0x6b')],_[_0x74d7('0x72')](_0x378149[_0x74d7('0x5b')],[_0x74d7('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x49ae20,null))['catch'](handleError(_0x49ae20,null));};exports[_0x74d7('0x73')]=function(_0x519089,_0x33ba17,_0x4c71fe){var _0x599372={'raw':![],'where':{}};var _0xd49f22={};var _0x5a786f={'count':0x0,'rows':[]};return db[_0x74d7('0x52')][_0x74d7('0x6e')]({'where':{'id':_0x519089['params']['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x33ba17,null))[_0x74d7('0x1e')](function(_0xcd6c3a){if(_0xcd6c3a){_0xd49f22['model']=_[_0x74d7('0x43')](db[_0x74d7('0x71')][_0x74d7('0x58')]);_0xd49f22['query']=_['keys'](_0x519089['query']);_0xd49f22[_0x74d7('0x44')]=_['intersection'](_0xd49f22[_0x74d7('0x45')],_0xd49f22['query']);_0x599372[_0x74d7('0x48')]=_[_0x74d7('0x46')](_0xd49f22[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x519089[_0x74d7('0x42')][_0x74d7('0x47')]));_0x599372[_0x74d7('0x48')]=_0x599372['attributes'][_0x74d7('0x59')]?_0x599372[_0x74d7('0x48')]:_0xd49f22['model'];if(!_0x519089[_0x74d7('0x42')][_0x74d7('0x49')](_0x74d7('0x4a'))){_0x599372[_0x74d7('0x2e')]=qs[_0x74d7('0x2e')](_0x519089[_0x74d7('0x42')][_0x74d7('0x2e')]);_0x599372[_0x74d7('0x2c')]=qs[_0x74d7('0x2c')](_0x519089[_0x74d7('0x42')]['offset']);}_0x599372[_0x74d7('0x4b')]=qs[_0x74d7('0x67')](_0x519089['query'][_0x74d7('0x67')]);_0x599372[_0x74d7('0x4c')]=qs['filters'](_[_0x74d7('0x4d')](_0x519089[_0x74d7('0x42')],_0xd49f22[_0x74d7('0x44')]));_0x599372['where']['FaxAccountId']=_0xcd6c3a['id'];if(_0x519089[_0x74d7('0x42')][_0x74d7('0x50')]){_0x599372[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0x599372[_0x74d7('0x4c')],{'$or':_[_0x74d7('0x41')](_0x599372[_0x74d7('0x48')],function(_0x5882c5){var _0x523b86={};_0x523b86[_0x5882c5]={'$like':'%'+_0x519089[_0x74d7('0x42')][_0x74d7('0x50')]+'%'};return _0x523b86;})});}_0x599372=_[_0x74d7('0x4e')]({},_0x599372,_0x519089[_0x74d7('0x51')]);return db[_0x74d7('0x71')][_0x74d7('0x2f')]({'where':_0x599372[_0x74d7('0x4c')]})[_0x74d7('0x1e')](function(_0x309415){_0x5a786f['count']=_0x309415;if(_0x519089[_0x74d7('0x42')]['includeAll']){_0x599372[_0x74d7('0x54')]=[{'model':db[_0x74d7('0x74')],'as':_0x74d7('0x75'),'required':![]},{'model':db[_0x74d7('0x76')],'as':'Owner','attributes':[_0x74d7('0x3a'),_0x74d7('0x77'),_0x74d7('0x78')],'required':![]},{'model':db['Tag'],'as':_0x74d7('0x79'),'attributes':['id','name',_0x74d7('0x7a')],'where':_0x519089[_0x74d7('0x42')][_0x74d7('0x7b')]?{'id':_0x519089[_0x74d7('0x42')]['tag']}:undefined,'required':_0x519089['query']['tag']?!![]:![]}];}return db[_0x74d7('0x71')][_0x74d7('0x69')](_0x599372);})[_0x74d7('0x1e')](function(_0x12f78b){_0x5a786f['rows']=_0x12f78b;return _0x5a786f;});}})[_0x74d7('0x1e')](respondWithFilteredResult(_0x33ba17,_0x599372))[_0x74d7('0x28')](handleError(_0x33ba17,null));};exports[_0x74d7('0x7c')]=function(_0x1cd8e3,_0x592618){var _0x5305ea=_0x1cd8e3['params']['id'];var _0x6820a=_0x1cd8e3[_0x74d7('0x5b')];var _0x4b380c=0xc8;var _0x4a8770=null;return db['sequelize'][_0x74d7('0x7d')]({'isolationLevel':db[_0x74d7('0x7e')]['Transaction'][_0x74d7('0x7f')][_0x74d7('0x80')]},function(_0x25e589){return db[_0x74d7('0x52')][_0x74d7('0x6e')]({'where':{'id':_0x5305ea},'transaction':_0x25e589})[_0x74d7('0x1e')](function(_0x1e052b){if(_0x1e052b){return db[_0x74d7('0x81')][_0x74d7('0x36')]({'where':{'FaxAccountId':_0x5305ea},'transaction':_0x25e589})[_0x74d7('0x1e')](function(){var _0x54e80f=_[_0x74d7('0x41')](_0x6820a,function(_0x2f20ea){_0x2f20ea[_0x74d7('0x68')]=_0x5305ea;return _0x2f20ea;});return db[_0x74d7('0x81')][_0x74d7('0x82')](_0x54e80f,{'transaction':_0x25e589});});}else{_0x4b380c=0x194;_0x4a8770=[];}});})[_0x74d7('0x1e')](function(){if(_0x4b380c!==0x194){return db[_0x74d7('0x81')][_0x74d7('0x83')]({'where':{'FaxAccountId':_0x5305ea},'order':_0x74d7('0x84')})['then'](function(_0x197332){_0x4a8770=_0x197332;});}})[_0x74d7('0x28')](function(_0x4704b6){_0x4b380c=0x1f4;logger['error'](_0x4704b6[_0x74d7('0x39')]);if(_0x4704b6[_0x74d7('0x3a')]){delete _0x4704b6[_0x74d7('0x3a')];}_0x4a8770=_0x4704b6;})[_0x74d7('0x85')](function(){if(_0x4a8770===null){_0x592618[_0x74d7('0x86')](_0x4b380c);}else{if(_0x4b380c===0x1f4){_0x592618[_0x74d7('0x29')](_0x4b380c)['send'](_0x4a8770);}else{_0x592618['status'](_0x4b380c)[_0x74d7('0x2b')](_0x4a8770);}}});};exports[_0x74d7('0x87')]=function(_0x1845ee,_0x9fb661,_0x5de01b){var _0x21b356={};var _0x2ed345={};var _0x335123;var _0x543295;return db[_0x74d7('0x52')]['findOne']({'where':{'id':_0x1845ee[_0x74d7('0x57')]['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x9fb661,null))[_0x74d7('0x1e')](function(_0xb89d9e){if(_0xb89d9e){_0x335123=_0xb89d9e;_0x2ed345['model']=_[_0x74d7('0x43')](db['FaxApplication'][_0x74d7('0x58')]);_0x2ed345[_0x74d7('0x42')]=_[_0x74d7('0x43')](_0x1845ee['query']);_0x2ed345[_0x74d7('0x44')]=_['intersection'](_0x2ed345[_0x74d7('0x45')],_0x2ed345[_0x74d7('0x42')]);_0x21b356[_0x74d7('0x48')]=_[_0x74d7('0x46')](_0x2ed345[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x1845ee[_0x74d7('0x42')][_0x74d7('0x47')]));_0x21b356[_0x74d7('0x48')]=_0x21b356[_0x74d7('0x48')][_0x74d7('0x59')]?_0x21b356[_0x74d7('0x48')]:_0x2ed345['model'];_0x21b356[_0x74d7('0x4b')]=qs[_0x74d7('0x67')](_0x1845ee[_0x74d7('0x42')]['sort']);_0x21b356[_0x74d7('0x4c')]=qs[_0x74d7('0x44')](_[_0x74d7('0x4d')](_0x1845ee[_0x74d7('0x42')],_0x2ed345[_0x74d7('0x44')]));if(_0x1845ee[_0x74d7('0x42')]['filter']){_0x21b356[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0x21b356[_0x74d7('0x4c')],{'$or':_['map'](_0x21b356[_0x74d7('0x48')],function(_0x30c905){var _0x3d7f67={};_0x3d7f67[_0x30c905]={'$like':'%'+_0x1845ee[_0x74d7('0x42')][_0x74d7('0x50')]+'%'};return _0x3d7f67;})});}_0x21b356=_[_0x74d7('0x4e')]({},_0x21b356,_0x1845ee[_0x74d7('0x51')]);return _0x335123[_0x74d7('0x87')](_0x21b356);}})[_0x74d7('0x1e')](function(_0x480031){if(_0x480031){_0x543295=_0x480031['length'];if(!_0x1845ee[_0x74d7('0x42')][_0x74d7('0x49')](_0x74d7('0x4a'))){_0x21b356[_0x74d7('0x2e')]=qs['limit'](_0x1845ee[_0x74d7('0x42')][_0x74d7('0x2e')]);_0x21b356[_0x74d7('0x2c')]=qs[_0x74d7('0x2c')](_0x1845ee['query'][_0x74d7('0x2c')]);}return _0x335123[_0x74d7('0x87')](_0x21b356);}})['then'](function(_0x5acf20){if(_0x5acf20){return _0x5acf20?{'count':_0x543295,'rows':_0x5acf20}:null;}})['then'](respondWithResult(_0x9fb661,null))[_0x74d7('0x28')](handleError(_0x9fb661,null));};function Extension(_0xf51159,_0x3b86bc,_0x656e70,_0x292050){this[_0x74d7('0x88')]=_0x74d7('0x89');this['exten']=_0xf51159[_0x74d7('0x8a')];this[_0x74d7('0x8b')]=_0x292050;this[_0x74d7('0x3f')]='system';this[_0x74d7('0x8c')]=_0x74d7('0x8d');this['FaxAccountId']=_0xf51159['id'];this[_0x74d7('0x84')]=_0x3b86bc;this[_0x74d7('0x8e')]=_0x656e70;}function createExtensionsReciveFax(_0x1ae03f){var _0x4339be=0x1;var _0x26f315=[];_0x26f315[_0x74d7('0x8f')](new Extension(_0x1ae03f,_0x4339be,'',_0x74d7('0x90')));_0x4339be+=0x1;_0x26f315[_0x74d7('0x8f')](new Extension(_0x1ae03f,_0x4339be,_0x74d7('0x91'),_0x74d7('0x92')));_0x4339be+=0x1;for(var _0x18b946 in _0x1ae03f){if(_0x1ae03f[_0x74d7('0x49')](_0x18b946)&&(_0x18b946===_0x74d7('0x93')||_0x18b946==='localstationid'||_0x18b946===_0x74d7('0x94')||_0x18b946==='faxdetect'||_0x18b946===_0x74d7('0x95')||_0x18b946===_0x74d7('0x96')||_0x18b946==='minrate'||_0x18b946===_0x74d7('0x97')||_0x18b946===_0x74d7('0x98'))){_0x26f315[_0x74d7('0x8f')](new Extension(_0x1ae03f,_0x4339be,_0x74d7('0x99')+_0x18b946+')='+_0x1ae03f[_0x18b946],_0x74d7('0x92')));_0x4339be+=0x1;}}_0x26f315[_0x74d7('0x8f')](new Extension(_0x1ae03f,_0x4339be,'6',_0x74d7('0x9a')));_0x4339be+=0x1;_0x26f315[_0x74d7('0x8f')](new Extension(_0x1ae03f,_0x4339be,_0x74d7('0x9b'),_0x74d7('0x9c')));_0x4339be=0x0;return _0x26f315;}exports[_0x74d7('0x9d')]=function(_0xe7c715,_0x53692a,_0x18d25e){var _0x71cdaa;return db['sequelize'][_0x74d7('0x7d')](function(_0x5c74ae){return db['FaxAccount'][_0x74d7('0x5a')](_0xe7c715[_0x74d7('0x5b')],{'transaction':_0x5c74ae})[_0x74d7('0x1e')](function(_0xd2780d){_0x71cdaa=_0xd2780d[_0x74d7('0x5d')]({'plain':!![]});return db[_0x74d7('0x9e')][_0x74d7('0x82')](createExtensionsReciveFax(_0x71cdaa),{'transaction':_0x5c74ae});});})[_0x74d7('0x1e')](function(){return _0x71cdaa;})[_0x74d7('0x1e')](respondWithResult(_0x53692a,null))[_0x74d7('0x28')](handleError(_0x53692a,null));};exports['updateAccountApplications']=function(_0x11c4d2,_0x4ad5b8,_0x14e953){var _0x1c95a0;return db[_0x74d7('0x7e')][_0x74d7('0x7d')](function(_0x522615){return db[_0x74d7('0x52')]['update'](_0x11c4d2['body'],{'where':{'id':_0x11c4d2['body']['id']},'transaction':_0x522615})[_0x74d7('0x1e')](function(_0x273bcc){return db[_0x74d7('0x9e')][_0x74d7('0x36')]({'where':{'FaxAccountId':_0x11c4d2['body']['id']},'transaction':_0x522615})[_0x74d7('0x1e')](function(_0x3b863a){return db[_0x74d7('0x9e')][_0x74d7('0x82')](createExtensionsReciveFax(_[_0x74d7('0x72')](_0x11c4d2[_0x74d7('0x5b')],[_0x74d7('0x9f'),_0x74d7('0x40'),_0x74d7('0xa0'),'updatedAt',_0x74d7('0xa1'),_0x74d7('0xa2')])),{'transaction':_0x522615});});});})[_0x74d7('0x1e')](function(){return db['FaxAccount'][_0x74d7('0xa3')](_0x11c4d2[_0x74d7('0x5b')]['id']);})[_0x74d7('0x1e')](respondWithResult(_0x4ad5b8,null))['catch'](handleError(_0x4ad5b8,null));};exports['getMessages']=function(_0x4b19ca,_0x15a0eb,_0x517472){var _0x40dfdb={'raw':!![],'where':{}};var _0x469fc6={};var _0x550aff={'count':0x0,'rows':[]};return db['FaxAccount'][_0x74d7('0x6e')]({'where':{'id':_0x4b19ca[_0x74d7('0x57')]['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x15a0eb,null))[_0x74d7('0x1e')](function(_0x10808d){if(_0x10808d){_0x469fc6[_0x74d7('0x45')]=_[_0x74d7('0x43')](db[_0x74d7('0xa4')][_0x74d7('0x58')]);_0x469fc6['query']=_['keys'](_0x4b19ca[_0x74d7('0x42')]);_0x469fc6['filters']=_[_0x74d7('0x46')](_0x469fc6[_0x74d7('0x45')],_0x469fc6[_0x74d7('0x42')]);_0x40dfdb[_0x74d7('0x48')]=_[_0x74d7('0x46')](_0x469fc6[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x4b19ca[_0x74d7('0x42')][_0x74d7('0x47')]));_0x40dfdb[_0x74d7('0x48')]=_0x40dfdb['attributes'][_0x74d7('0x59')]?_0x40dfdb[_0x74d7('0x48')]:_0x469fc6['model'];if(!_0x4b19ca[_0x74d7('0x42')][_0x74d7('0x49')](_0x74d7('0x4a'))){_0x40dfdb[_0x74d7('0x2e')]=qs[_0x74d7('0x2e')](_0x4b19ca[_0x74d7('0x42')][_0x74d7('0x2e')]);_0x40dfdb['offset']=qs[_0x74d7('0x2c')](_0x4b19ca['query'][_0x74d7('0x2c')]);}_0x40dfdb[_0x74d7('0x4b')]=qs[_0x74d7('0x67')](_0x4b19ca[_0x74d7('0x42')][_0x74d7('0x67')]);_0x40dfdb[_0x74d7('0x4c')]=qs['filters'](_[_0x74d7('0x4d')](_0x4b19ca['query'],_0x469fc6[_0x74d7('0x44')]));_0x40dfdb['where']['FaxAccountId']=_0x10808d['id'];if(_0x4b19ca[_0x74d7('0x42')]['filter']){_0x40dfdb[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0x40dfdb[_0x74d7('0x4c')],{'$or':_[_0x74d7('0x41')](_0x40dfdb[_0x74d7('0x48')],function(_0x4d97d5){var _0x5d7a7a={};_0x5d7a7a[_0x4d97d5]={'$like':'%'+_0x4b19ca[_0x74d7('0x42')][_0x74d7('0x50')]+'%'};return _0x5d7a7a;})});}if(_0x4b19ca[_0x74d7('0x42')][_0x74d7('0xa5')]){var _0x3bb4e4=_0x4b19ca['query']['$gte']['split'](',');var _0x101dc0={};_0x101dc0[_0x3bb4e4[0x0]]={'$gte':moment(_0x3bb4e4[0x1])[_0x74d7('0xa6')](_0x74d7('0xa7'))};_0x40dfdb[_0x74d7('0x4c')]=_[_0x74d7('0x4e')](_0x40dfdb[_0x74d7('0x4c')],_0x101dc0);}_0x40dfdb=_[_0x74d7('0x4e')]({},_0x40dfdb,_0x4b19ca['options']);return db['FaxMessage'][_0x74d7('0x2f')]({'where':_0x40dfdb[_0x74d7('0x4c')]})['then'](function(_0x298580){_0x550aff[_0x74d7('0x2f')]=_0x298580;if(_0x4b19ca[_0x74d7('0x42')][_0x74d7('0x53')]){_0x40dfdb[_0x74d7('0x54')]=[{'all':!![]}];}return db[_0x74d7('0xa4')]['findAll'](_0x40dfdb);})[_0x74d7('0x1e')](function(_0x461f1e){_0x550aff[_0x74d7('0x55')]=_0x461f1e;return _0x550aff;});}})[_0x74d7('0x1e')](respondWithFilteredResult(_0x15a0eb,_0x40dfdb))['catch'](handleError(_0x15a0eb,null));};exports[_0x74d7('0xa8')]=function(_0x24c3eb,_0x2350a5,_0x4bbeda){var _0x5e8f89,_0x4da222={},_0x1592e9;if(_0x24c3eb[_0x74d7('0x5b')]['to']){_0x1592e9=_0x24c3eb[_0x74d7('0x5b')]['to'][0x0];}return db['FaxAccount'][_0x74d7('0x61')]({'where':{'id':_0x24c3eb[_0x74d7('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x74d7('0xa9'),'include':[{'model':db[_0x74d7('0x74')],'as':_0x74d7('0xaa'),'where':{'fax':_0x1592e9},'limit':0x1,'order':[['updatedAt',_0x74d7('0xab')]]}]}]})['then'](handleEntityNotFound(_0x2350a5,null))[_0x74d7('0x1e')](function(_0x1fec5d){_0x5e8f89=_0x1fec5d;if(_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')]&&_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][_0x74d7('0x59')]){for(var _0x8a8257=0x0;_0x8a8257<_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')]['length'];_0x8a8257+=0x1){_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][_0x8a8257]={'filename':_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][_0x8a8257][_0x74d7('0x3a')],'id':_0x24c3eb[_0x74d7('0x5b')]['attachments'][_0x8a8257]['id'],'path':path[_0x74d7('0xad')](config[_0x74d7('0xae')],_0x74d7('0xaf'),_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][_0x8a8257]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x74d7('0xb0'),{'FaxAccountId':_[_0x74d7('0xb1')](_0x24c3eb[_0x74d7('0x57')]['id'])?undefined:_0x24c3eb[_0x74d7('0x57')]['id'],'path':_['isNil'](_0x24c3eb[_0x74d7('0x5b')]['attachments'][0x0]['path'])?undefined:_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][0x0]['path'],'fax':_['isNil'](_0x24c3eb[_0x74d7('0x5b')]['to'][0x0])?undefined:_0x24c3eb[_0x74d7('0x5b')]['to'][0x0]},client9002);})['then'](function(){if(_0x5e8f89){if(_[_0x74d7('0xb1')](_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xb2')])){_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xb2')]=util[_0x74d7('0xa6')]('\x22%s\x22\x20<%s>',_0x5e8f89[_0x74d7('0x3a')],_0x5e8f89[_0x74d7('0xb3')]);}if(_0x5e8f89['List']){if(_0x5e8f89['List'][_0x74d7('0xaa')][_0x74d7('0x59')]){return _0x5e8f89['List'][_0x74d7('0xaa')][0x0];}else{return db[_0x74d7('0x74')][_0x74d7('0x5a')](_[_0x74d7('0x15')](_0x24c3eb['body'],{'firstName':_0x24c3eb[_0x74d7('0x5b')]['to'][0x0],'phone':_0x24c3eb[_0x74d7('0x5b')]['to'][0x0],'fax':_0x24c3eb[_0x74d7('0x5b')]['to'][0x0],'ListId':_0x5e8f89[_0x74d7('0xa2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x74d7('0x1e')](function(_0x5306c4){if(_0x5306c4){return db[_0x74d7('0x71')][_0x74d7('0x61')]({'where':{'ContactId':_0x5306c4['id'],'closed':![],'FaxAccountId':_0x5e8f89['id']}})[_0x74d7('0x1e')](function(_0x1a2e7c){if(_0x1a2e7c){return[_0x1a2e7c,![]];}return db[_0x74d7('0x71')][_0x74d7('0x5a')]({'UserId':_0x24c3eb[_0x74d7('0x5c')]['id'],'ContactId':_0x5306c4['id'],'FaxAccountId':_0x5e8f89['id'],'fax':_0x24c3eb[_0x74d7('0x5b')]['to'][0x0],'firstMsgDirection':_0x74d7('0xb4'),'Messages':[_['merge'](_0x24c3eb['body'],{'read':![],'body':_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][0x0][_0x74d7('0xb5')],'FaxAccountId':_0x5e8f89['id'],'UserId':_0x24c3eb[_0x74d7('0x5c')]['id'],'ContactId':_0x5306c4['id'],'AttachmentId':_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x74d7('0x1e')](function(_0x398227){return[_0x398227,!![]];});});}else{throw new Error(_0x74d7('0xb6'));}})[_0x74d7('0xb7')](function(_0x4dcdd0,_0x2301cb){if(_0x2301cb){return _0x4dcdd0;}return db[_0x74d7('0xa4')][_0x74d7('0x5a')]({'direction':_0x74d7('0xb4'),'read':![],'body':_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][0x0]['filename'],'FaxAccountId':_0x5e8f89['id'],'FaxInteractionId':_0x4dcdd0['id'],'UserId':_0x24c3eb[_0x74d7('0x5c')]['id'],'ContactId':_0x4dcdd0[_0x74d7('0xb8')],'AttachmentId':_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][0x0]['id']})[_0x74d7('0x1e')](function(_0x225948){_0x4dcdd0[_0x74d7('0xb9')][_0x74d7('0xba')]=[];_0x4dcdd0['dataValues'][_0x74d7('0xba')][_0x74d7('0x8f')](_0x225948[_0x74d7('0xb9')]);return _0x4dcdd0;});})['then'](function(_0x3ac2c6){respondWithRpcPromise(_0x74d7('0xbb'),_0x74d7('0xbb'),{'FaxAccountId':_[_0x74d7('0xb1')](_0x24c3eb['params']['id'])?undefined:_0x24c3eb['params']['id'],'path':_['isNil'](_0x24c3eb[_0x74d7('0x5b')][_0x74d7('0xac')][0x0][_0x74d7('0x6')])?undefined:_0x24c3eb[_0x74d7('0x5b')]['attachments'][0x0][_0x74d7('0x6')],'fax':_[_0x74d7('0xb1')](_0x24c3eb[_0x74d7('0x5b')]['to'][0x0])?undefined:_0x24c3eb[_0x74d7('0x5b')]['to'][0x0],'AttachmentId':_0x24c3eb['body'][_0x74d7('0xac')][0x0]['id']},client9002)[_0x74d7('0x1e')](function(_0x302d32){logger[_0x74d7('0x1f')](_0x74d7('0xbc'),_0x302d32);})[_0x74d7('0x28')](function(_0x125120){logger[_0x74d7('0x1f')](_0x74d7('0xbc'),_0x125120);});return _0x3ac2c6;})[_0x74d7('0x1e')](respondWithResult(_0x2350a5,null))[_0x74d7('0x28')](handleError(_0x2350a5,null));};exports[_0x74d7('0xbd')]=function(_0xc8c1a9,_0x44cb58,_0x12ebb7){return db['FaxAccount']['find']({'where':{'id':_0xc8c1a9['params']['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x44cb58,null))['then'](function(_0x91280e){if(_0x91280e){return _0x91280e[_0x74d7('0xbd')](_0xc8c1a9['body'][_0x74d7('0x6b')],_[_0x74d7('0x72')](_0xc8c1a9[_0x74d7('0x5b')],[_0x74d7('0x6b'),'id'])||{})[_0x74d7('0xb7')](function(_0x2237af){for(var _0x50e315=0x0;_0x50e315<_0xc8c1a9[_0x74d7('0x5b')][_0x74d7('0x6b')]['length'];_0x50e315+=0x1){socket[_0x74d7('0xbe')](_0x74d7('0xbf'),{'UserId':Number(_0xc8c1a9[_0x74d7('0x5b')][_0x74d7('0x6b')][_0x50e315]),'FaxAccountId':Number(_0xc8c1a9['params']['id'])});}return _0x2237af;});}})[_0x74d7('0x1e')](respondWithResult(_0x44cb58,null))['catch'](handleError(_0x44cb58,null));};exports[_0x74d7('0xc0')]=function(_0x119e18,_0x4aa207,_0x23e8ab){return db[_0x74d7('0x52')][_0x74d7('0x61')]({'where':{'id':_0x119e18[_0x74d7('0x57')]['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x4aa207,null))[_0x74d7('0x1e')](function(_0x56847f){if(_0x56847f){return _0x56847f[_0x74d7('0xc0')](_0x119e18['query'][_0x74d7('0x6b')])['then'](function(){if(_[_0x74d7('0xc1')](_0x119e18[_0x74d7('0x42')][_0x74d7('0x6b')])){for(var _0x4126b6=0x0;_0x4126b6<_0x119e18[_0x74d7('0x42')][_0x74d7('0x6b')][_0x74d7('0x59')];_0x4126b6+=0x1){socket[_0x74d7('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x119e18[_0x74d7('0x42')][_0x74d7('0x6b')][_0x4126b6]),'FaxAccountId':Number(_0x119e18[_0x74d7('0x57')]['id'])});}}else{socket[_0x74d7('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x119e18['query'][_0x74d7('0x6b')]),'FaxAccountId':Number(_0x119e18[_0x74d7('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x4aa207,null))['catch'](handleError(_0x4aa207,null));};exports[_0x74d7('0xc2')]=function(_0x23accd,_0x157f07,_0x360f7f){var _0x366285={};var _0xd488c2={};var _0x275b3b;var _0x44ac6c;return db[_0x74d7('0x52')][_0x74d7('0x6e')]({'where':{'id':_0x23accd['params']['id']}})[_0x74d7('0x1e')](handleEntityNotFound(_0x157f07,null))[_0x74d7('0x1e')](function(_0x476787){if(_0x476787){_0x275b3b=_0x476787;_0xd488c2[_0x74d7('0x45')]=_[_0x74d7('0x43')](db[_0x74d7('0x76')][_0x74d7('0x58')]);_0xd488c2[_0x74d7('0x42')]=_[_0x74d7('0x43')](_0x23accd[_0x74d7('0x42')]);_0xd488c2[_0x74d7('0x44')]=_[_0x74d7('0x46')](_0xd488c2[_0x74d7('0x45')],_0xd488c2[_0x74d7('0x42')]);_0x366285[_0x74d7('0x48')]=_[_0x74d7('0x46')](_0xd488c2[_0x74d7('0x45')],qs[_0x74d7('0x47')](_0x23accd[_0x74d7('0x42')][_0x74d7('0x47')]));_0x366285[_0x74d7('0x48')]=_0x366285[_0x74d7('0x48')][_0x74d7('0x59')]?_0x366285[_0x74d7('0x48')]:_0xd488c2['model'];_0x366285[_0x74d7('0x4b')]=qs[_0x74d7('0x67')](_0x23accd[_0x74d7('0x42')][_0x74d7('0x67')]);_0x366285['where']=qs[_0x74d7('0x44')](_[_0x74d7('0x4d')](_0x23accd[_0x74d7('0x42')],_0xd488c2[_0x74d7('0x44')]));if(_0x23accd['query'][_0x74d7('0x50')]){_0x366285[_0x74d7('0x4c')]=_['merge'](_0x366285['where'],{'$or':_[_0x74d7('0x41')](_0x366285['attributes'],function(_0x302b79){var _0x234cd0={};_0x234cd0[_0x302b79]={'$like':'%'+_0x23accd['query'][_0x74d7('0x50')]+'%'};return _0x234cd0;})});}_0x366285=_[_0x74d7('0x4e')]({},_0x366285,_0x23accd[_0x74d7('0x51')]);return _0x275b3b[_0x74d7('0xc2')](_0x366285);}})[_0x74d7('0x1e')](function(_0x2fd919){if(_0x2fd919){_0x44ac6c=_0x2fd919['length'];if(!_0x23accd[_0x74d7('0x42')]['hasOwnProperty'](_0x74d7('0x4a'))){_0x366285[_0x74d7('0x2e')]=qs[_0x74d7('0x2e')](_0x23accd[_0x74d7('0x42')]['limit']);_0x366285[_0x74d7('0x2c')]=qs[_0x74d7('0x2c')](_0x23accd[_0x74d7('0x42')]['offset']);}return _0x275b3b[_0x74d7('0xc2')](_0x366285);}})[_0x74d7('0x1e')](function(_0x37a984){if(_0x37a984){return _0x37a984?{'count':_0x44ac6c,'rows':_0x37a984}:null;}})[_0x74d7('0x1e')](respondWithResult(_0x157f07,null))[_0x74d7('0x28')](handleError(_0x157f07,null));};
\ No newline at end of file
+var _0x3b19=['findAll','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addInteraction','getInteractions','FaxAccountId','FaxInteraction','User','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','exten','localstationid','app','system','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','faxdetect','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','VoiceExtension','updateAccountApplications','sequelize','omit','tech','key','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','ListId','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','limit','undefined','offset','set','reject','save','update','destroy','FaxAccounts','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','Pause','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','findOne','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b19,0x120));var _0x93b1=function(_0x402e3d,_0x85e542){_0x402e3d=_0x402e3d-0x0;var _0x5aad44=_0x3b19[_0x402e3d];return _0x5aad44;};'use strict';var emlformat=require(_0x93b1('0x0'));var rimraf=require(_0x93b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93b1('0x2'));var rp=require(_0x93b1('0x3'));var moment=require('moment');var BPromise=require(_0x93b1('0x4'));var Mustache=require(_0x93b1('0x5'));var util=require(_0x93b1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93b1('0x7'));var ejs=require(_0x93b1('0x8'));var fs=require('fs');var fs_extra=require(_0x93b1('0x9'));var _=require(_0x93b1('0xa'));var squel=require(_0x93b1('0xb'));var crypto=require(_0x93b1('0xc'));var jsforce=require(_0x93b1('0xd'));var deskjs=require(_0x93b1('0xe'));var toCsv=require(_0x93b1('0x7'));var querystring=require(_0x93b1('0xf'));var Papa=require(_0x93b1('0x10'));var Redis=require('ioredis');var authService=require(_0x93b1('0x11'));var qs=require(_0x93b1('0x12'));var as=require(_0x93b1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x93b1('0x14'));var utils=require(_0x93b1('0x15'));var config=require(_0x93b1('0x16'));var licenseUtil=require(_0x93b1('0x17'));var db=require(_0x93b1('0x18'))['db'];config[_0x93b1('0x19')]=_['defaults'](config[_0x93b1('0x19')],{'host':_0x93b1('0x1a'),'port':0x18eb});var socket=require(_0x93b1('0x1b'))(new Redis(config[_0x93b1('0x19')]));require(_0x93b1('0x1c'))[_0x93b1('0x1d')](socket);var jayson=require(_0x93b1('0x1e'));var client=jayson['client'][_0x93b1('0x1f')]({'port':0x232c});var client9002=jayson[_0x93b1('0x20')][_0x93b1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x45285d,_0x5da94,_0x42d60a,_0x290fe5){return new BPromise(function(_0x138b57,_0x1b925e){var _0x323312=_0x290fe5||client;return _0x323312[_0x93b1('0x21')](_0x45285d,_0x42d60a)[_0x93b1('0x22')](function(_0x33c04c){logger[_0x93b1('0x23')](_0x93b1('0x24'),_0x5da94,_0x93b1('0x25'));logger[_0x93b1('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5da94,_0x93b1('0x25'),JSON[_0x93b1('0x27')](_0x33c04c));if(_0x33c04c[_0x93b1('0x28')]){if(_0x33c04c[_0x93b1('0x28')]['code']===0x1f4){logger[_0x93b1('0x28')](_0x93b1('0x24'),_0x5da94,_0x33c04c['error'][_0x93b1('0x29')]);return _0x1b925e(_0x33c04c['error'][_0x93b1('0x29')]);}logger[_0x93b1('0x28')]('FaxAccount,\x20%s,\x20%s',_0x5da94,_0x33c04c['error'][_0x93b1('0x29')]);return _0x138b57(_0x33c04c[_0x93b1('0x28')][_0x93b1('0x29')]);}else{logger[_0x93b1('0x23')](_0x93b1('0x24'),_0x5da94,'request\x20sent');_0x138b57(_0x33c04c[_0x93b1('0x2a')][_0x93b1('0x29')]);}})['catch'](function(_0x1f95e8){logger['error'](_0x93b1('0x24'),_0x5da94,_0x1f95e8);_0x1b925e(_0x1f95e8);});});}function respondWithStatusCode(_0x2283fe,_0x3da5c6){_0x3da5c6=_0x3da5c6||0xcc;return function(_0x22b5bc){if(_0x22b5bc){return _0x2283fe[_0x93b1('0x2b')](_0x3da5c6);}return _0x2283fe[_0x93b1('0x2c')](_0x3da5c6)[_0x93b1('0x2d')]();};}function respondWithResult(_0x566cbc,_0x344ee8){_0x344ee8=_0x344ee8||0xc8;return function(_0x42259c){if(_0x42259c){return _0x566cbc['status'](_0x344ee8)[_0x93b1('0x2e')](_0x42259c);}};}function respondWithFilteredResult(_0x333605,_0x89f2bb){return function(_0x26214d){if(_0x26214d){var _0x47bc22=typeof _0x89f2bb['offset']==='undefined'&&typeof _0x89f2bb[_0x93b1('0x2f')]===_0x93b1('0x30');var _0x3f7a4d=_0x26214d['count'];var _0x367dab=_0x47bc22?0x0:_0x89f2bb[_0x93b1('0x31')];var _0x25d2b4=_0x47bc22?_0x26214d['count']:_0x89f2bb[_0x93b1('0x31')]+_0x89f2bb[_0x93b1('0x2f')];var _0x118490;if(_0x25d2b4>=_0x3f7a4d){_0x25d2b4=_0x3f7a4d;_0x118490=0xc8;}else{_0x118490=0xce;}_0x333605['status'](_0x118490);return _0x333605[_0x93b1('0x32')]('Content-Range',_0x367dab+'-'+_0x25d2b4+'/'+_0x3f7a4d)[_0x93b1('0x2e')](_0x26214d);}return null;};}function patchUpdates(_0x3522dc){return function(_0x3e7249){try{jsonpatch['apply'](_0x3e7249,_0x3522dc,!![]);}catch(_0x128202){return BPromise[_0x93b1('0x33')](_0x128202);}return _0x3e7249[_0x93b1('0x34')]();};}function saveUpdates(_0x39f66e,_0xc189ee){return function(_0xa35a19){if(_0xa35a19){return _0xa35a19[_0x93b1('0x35')](_0x39f66e)['then'](function(_0x24ff34){return _0x24ff34;});}return null;};}function removeEntity(_0xd9934d,_0x4cc813){return function(_0x9f9a67){if(_0x9f9a67){return _0x9f9a67[_0x93b1('0x36')]()[_0x93b1('0x22')](function(){var _0x38ec34=_0x9f9a67['get']({'plain':!![]});var _0x3cd4c7=_0x93b1('0x37');return db['UserProfileResource'][_0x93b1('0x36')]({'where':{'type':_0x3cd4c7,'resourceId':_0x38ec34['id']}})['then'](function(){return _0x9f9a67;});})[_0x93b1('0x22')](function(){_0xd9934d['status'](0xcc)[_0x93b1('0x2d')]();});}};}function handleEntityNotFound(_0xb8b288,_0x20397f){return function(_0xff5d5){if(!_0xff5d5){_0xb8b288[_0x93b1('0x2b')](0x194);}return _0xff5d5;};}function handleError(_0x43d858,_0x4b4ca1){_0x4b4ca1=_0x4b4ca1||0x1f4;return function(_0x126065){logger[_0x93b1('0x28')](_0x126065[_0x93b1('0x38')]);if(_0x126065[_0x93b1('0x39')]){delete _0x126065['name'];}_0x43d858[_0x93b1('0x2c')](_0x4b4ca1)[_0x93b1('0x3a')](_0x126065);};}exports[_0x93b1('0x3b')]=function(_0x5d6eb3,_0x5c5aa6){var _0x47f96b={'include':[{'model':db['Pause'],'as':_0x93b1('0x3c')}]},_0xaa4577={},_0x5504b2={'count':0x0,'rows':[]};var _0x4fa89d=_[_0x93b1('0x3d')](db[_0x93b1('0x3e')][_0x93b1('0x3f')],function(_0x233b79){return{'name':_0x233b79[_0x93b1('0x40')],'type':_0x233b79[_0x93b1('0x41')]['key']};});_0xaa4577[_0x93b1('0x42')]=_[_0x93b1('0x3d')](_0x4fa89d,'name');_0xaa4577['query']=_[_0x93b1('0x43')](_0x5d6eb3[_0x93b1('0x44')]);_0xaa4577[_0x93b1('0x45')]=_['intersection'](_0xaa4577[_0x93b1('0x42')],_0xaa4577['query']);_0x47f96b[_0x93b1('0x46')]=_[_0x93b1('0x47')](_0xaa4577[_0x93b1('0x42')],qs[_0x93b1('0x48')](_0x5d6eb3[_0x93b1('0x44')][_0x93b1('0x48')]));_0x47f96b[_0x93b1('0x46')]=_0x47f96b[_0x93b1('0x46')][_0x93b1('0x49')]?_0x47f96b[_0x93b1('0x46')]:_0xaa4577['model'];if(!_0x5d6eb3[_0x93b1('0x44')]['hasOwnProperty'](_0x93b1('0x4a'))){_0x47f96b[_0x93b1('0x2f')]=qs[_0x93b1('0x2f')](_0x5d6eb3[_0x93b1('0x44')][_0x93b1('0x2f')]);_0x47f96b[_0x93b1('0x31')]=qs['offset'](_0x5d6eb3[_0x93b1('0x44')][_0x93b1('0x31')]);}_0x47f96b[_0x93b1('0x4b')]=qs[_0x93b1('0x4c')](_0x5d6eb3['query'][_0x93b1('0x4c')]);_0x47f96b[_0x93b1('0x4d')]=qs['filters'](_[_0x93b1('0x4e')](_0x5d6eb3['query'],_0xaa4577[_0x93b1('0x45')]),_0x4fa89d);if(_0x5d6eb3[_0x93b1('0x44')][_0x93b1('0x4f')]){_0x47f96b[_0x93b1('0x4d')]=_[_0x93b1('0x50')](_0x47f96b['where'],{'$or':_['map'](_0x4fa89d,function(_0x4f28c8){if(_0x4f28c8[_0x93b1('0x41')]!==_0x93b1('0x51')){var _0x1e098b={};_0x1e098b[_0x4f28c8[_0x93b1('0x39')]]={'$like':'%'+_0x5d6eb3['query']['filter']+'%'};return _0x1e098b;}})});}_0x47f96b=_['merge']({},_0x47f96b,_0x5d6eb3[_0x93b1('0x52')]);var _0x5d537c={'where':_0x47f96b['where']};return db[_0x93b1('0x3e')]['count'](_0x5d537c)[_0x93b1('0x22')](function(_0x14fe69){_0x5504b2[_0x93b1('0x53')]=_0x14fe69;if(_0x5d6eb3['query'][_0x93b1('0x54')]){_0x47f96b['include']=[{'all':!![]}];}return db[_0x93b1('0x3e')]['findAll'](_0x47f96b);})[_0x93b1('0x22')](function(_0x2ab05e){_0x5504b2[_0x93b1('0x55')]=_0x2ab05e;return _0x5504b2;})['then'](respondWithFilteredResult(_0x5c5aa6,_0x47f96b))['catch'](handleError(_0x5c5aa6,null));};exports[_0x93b1('0x56')]=function(_0x21ce28,_0x16d0ce){var _0x4bda2a={'raw':![],'where':{'id':_0x21ce28[_0x93b1('0x57')]['id']},'include':[{'model':db[_0x93b1('0x58')],'as':_0x93b1('0x3c')}]},_0x49f145={};_0x49f145['model']=_[_0x93b1('0x43')](db[_0x93b1('0x3e')][_0x93b1('0x3f')]);_0x49f145['query']=_['keys'](_0x21ce28[_0x93b1('0x44')]);_0x49f145['filters']=_[_0x93b1('0x47')](_0x49f145[_0x93b1('0x42')],_0x49f145[_0x93b1('0x44')]);_0x4bda2a[_0x93b1('0x46')]=_[_0x93b1('0x47')](_0x49f145[_0x93b1('0x42')],qs[_0x93b1('0x48')](_0x21ce28[_0x93b1('0x44')]['fields']));_0x4bda2a['attributes']=_0x4bda2a['attributes'][_0x93b1('0x49')]?_0x4bda2a[_0x93b1('0x46')]:_0x49f145['model'];if(_0x21ce28['query']['includeAll']){_0x4bda2a['include']=[{'all':!![]}];}_0x4bda2a=_[_0x93b1('0x50')]({},_0x4bda2a,_0x21ce28[_0x93b1('0x52')]);return db[_0x93b1('0x3e')]['find'](_0x4bda2a)[_0x93b1('0x22')](handleEntityNotFound(_0x16d0ce,null))[_0x93b1('0x22')](respondWithResult(_0x16d0ce,null))[_0x93b1('0x59')](handleError(_0x16d0ce,null));};exports[_0x93b1('0x5a')]=function(_0x91f7b3,_0x436d4c){return db[_0x93b1('0x3e')][_0x93b1('0x5a')](_0x91f7b3['body'],{})['then'](function(_0xa675e9){var _0x24de9d=_0x91f7b3[_0x93b1('0x5b')][_0x93b1('0x5c')]({'plain':!![]});if(!_0x24de9d)throw new Error(_0x93b1('0x5d'));if(_0x24de9d[_0x93b1('0x5e')]===_0x93b1('0x5b')){var _0x22e0c6=_0xa675e9['get']({'plain':!![]});var _0x200575=_0x93b1('0x37');return db[_0x93b1('0x5f')][_0x93b1('0x60')]({'where':{'name':_0x200575,'userProfileId':_0x24de9d[_0x93b1('0x61')]},'raw':!![]})[_0x93b1('0x22')](function(_0x4d0c8d){if(_0x4d0c8d&&_0x4d0c8d[_0x93b1('0x62')]===0x0){return db['UserProfileResource'][_0x93b1('0x5a')]({'name':_0x22e0c6[_0x93b1('0x39')],'resourceId':_0x22e0c6['id'],'type':_0x4d0c8d[_0x93b1('0x39')],'sectionId':_0x4d0c8d['id']},{})['then'](function(){return _0xa675e9;});}else{return _0xa675e9;}})[_0x93b1('0x59')](function(_0x51b53b){logger[_0x93b1('0x28')](_0x93b1('0x63'),_0x51b53b);throw _0x51b53b;});}return _0xa675e9;})[_0x93b1('0x22')](respondWithResult(_0x436d4c,0xc9))['catch'](handleError(_0x436d4c,null));};exports[_0x93b1('0x35')]=function(_0x4c2dd0,_0x2a4dba){if(_0x4c2dd0[_0x93b1('0x64')]['id']){delete _0x4c2dd0[_0x93b1('0x64')]['id'];}return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0x4c2dd0['params']['id']},'include':[{'model':db[_0x93b1('0x58')],'as':_0x93b1('0x3c')}]})[_0x93b1('0x22')](handleEntityNotFound(_0x2a4dba,null))['then'](saveUpdates(_0x4c2dd0[_0x93b1('0x64')],null))[_0x93b1('0x22')](respondWithResult(_0x2a4dba,null))['catch'](handleError(_0x2a4dba,null));};exports[_0x93b1('0x36')]=function(_0x3045af,_0x3380ca){return db['FaxAccount'][_0x93b1('0x60')]({'where':{'id':_0x3045af[_0x93b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x3380ca,null))[_0x93b1('0x22')](removeEntity(_0x3380ca,null))[_0x93b1('0x59')](handleError(_0x3380ca,null));};exports[_0x93b1('0x65')]=function(_0x1ed658,_0x290290){return db[_0x93b1('0x3e')][_0x93b1('0x65')]()[_0x93b1('0x22')](respondWithResult(_0x290290,null))[_0x93b1('0x59')](handleError(_0x290290,null));};exports[_0x93b1('0x66')]=function(_0x47beff,_0x43c2ee,_0x20dee7){if(_0x47beff[_0x93b1('0x64')]['id']){delete _0x47beff[_0x93b1('0x64')]['id'];}return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0x47beff['params']['id']}})[_0x93b1('0x22')](handleEntityNotFound(_0x43c2ee,null))[_0x93b1('0x22')](function(_0x22d51c){if(_0x22d51c){_0x47beff[_0x93b1('0x64')]['FaxAccountId']=_0x22d51c['id'];return db[_0x93b1('0x67')][_0x93b1('0x5a')](_0x47beff[_0x93b1('0x64')]);}})[_0x93b1('0x22')](respondWithResult(_0x43c2ee,null))[_0x93b1('0x59')](handleError(_0x43c2ee,null));};exports['getDispositions']=function(_0x1fe63c,_0x31841e,_0x2a037f){var _0x3f7d82={'raw':![],'where':{}};var _0x5dbbf7={};var _0x30e5f4={'count':0x0,'rows':[]};return db[_0x93b1('0x3e')][_0x93b1('0x68')]({'where':{'id':_0x1fe63c['params']['id']}})['then'](handleEntityNotFound(_0x31841e,null))[_0x93b1('0x22')](function(_0x2acf17){if(_0x2acf17){_0x5dbbf7[_0x93b1('0x42')]=_[_0x93b1('0x43')](db['Disposition'][_0x93b1('0x3f')]);_0x5dbbf7[_0x93b1('0x44')]=_['keys'](_0x1fe63c[_0x93b1('0x44')]);_0x5dbbf7['filters']=_[_0x93b1('0x47')](_0x5dbbf7[_0x93b1('0x42')],_0x5dbbf7['query']);_0x3f7d82[_0x93b1('0x46')]=_[_0x93b1('0x47')](_0x5dbbf7['model'],qs[_0x93b1('0x48')](_0x1fe63c[_0x93b1('0x44')][_0x93b1('0x48')]));_0x3f7d82[_0x93b1('0x46')]=_0x3f7d82[_0x93b1('0x46')]['length']?_0x3f7d82[_0x93b1('0x46')]:_0x5dbbf7['model'];if(!_0x1fe63c['query']['hasOwnProperty'](_0x93b1('0x4a'))){_0x3f7d82[_0x93b1('0x2f')]=qs[_0x93b1('0x2f')](_0x1fe63c['query'][_0x93b1('0x2f')]);_0x3f7d82['offset']=qs[_0x93b1('0x31')](_0x1fe63c[_0x93b1('0x44')]['offset']);}_0x3f7d82[_0x93b1('0x4b')]=qs[_0x93b1('0x4c')](_0x1fe63c[_0x93b1('0x44')]['sort']);_0x3f7d82[_0x93b1('0x4d')]=qs[_0x93b1('0x45')](_['pick'](_0x1fe63c[_0x93b1('0x44')],_0x5dbbf7['filters']));_0x3f7d82['where']['FaxAccountId']=_0x2acf17['id'];if(_0x1fe63c[_0x93b1('0x44')]['filter']){_0x3f7d82[_0x93b1('0x4d')]=_[_0x93b1('0x50')](_0x3f7d82['where'],{'$or':_['map'](_0x3f7d82['attributes'],function(_0x3895db){var _0x4ff0cc={};_0x4ff0cc[_0x3895db]={'$like':'%'+_0x1fe63c['query'][_0x93b1('0x4f')]+'%'};return _0x4ff0cc;})});}_0x3f7d82=_[_0x93b1('0x50')]({},_0x3f7d82,_0x1fe63c[_0x93b1('0x52')]);return db[_0x93b1('0x67')][_0x93b1('0x53')]({'where':_0x3f7d82[_0x93b1('0x4d')]})['then'](function(_0x4084af){_0x30e5f4[_0x93b1('0x53')]=_0x4084af;if(_0x1fe63c[_0x93b1('0x44')]['includeAll']){_0x3f7d82[_0x93b1('0x69')]=[{'all':!![]}];}return db[_0x93b1('0x67')][_0x93b1('0x6a')](_0x3f7d82);})[_0x93b1('0x22')](function(_0x95652e){_0x30e5f4[_0x93b1('0x55')]=_0x95652e;return _0x30e5f4;});}})[_0x93b1('0x22')](respondWithFilteredResult(_0x31841e,_0x3f7d82))[_0x93b1('0x59')](handleError(_0x31841e,null));};exports[_0x93b1('0x6b')]=function(_0x115322,_0x86302a,_0x57c730){return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0x115322[_0x93b1('0x57')]['id']}})[_0x93b1('0x22')](handleEntityNotFound(_0x86302a,null))['then'](function(_0x4f84df){if(_0x4f84df){return _0x4f84df['removeDispositions'](_0x115322[_0x93b1('0x44')][_0x93b1('0x6c')]);}})[_0x93b1('0x22')](respondWithStatusCode(_0x86302a,null))['catch'](handleError(_0x86302a,null));};exports['addAnswer']=function(_0x3a03c1,_0x21e018,_0x2d623c){if(_0x3a03c1[_0x93b1('0x64')]['id']){delete _0x3a03c1['body']['id'];}return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0x3a03c1[_0x93b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x21e018,null))['then'](function(_0x4350f3){if(_0x4350f3){_0x3a03c1[_0x93b1('0x64')]['FaxAccountId']=_0x4350f3['id'];return db[_0x93b1('0x6d')][_0x93b1('0x5a')](_0x3a03c1[_0x93b1('0x64')]);}})['then'](respondWithResult(_0x21e018,null))[_0x93b1('0x59')](handleError(_0x21e018,null));};exports[_0x93b1('0x6e')]=function(_0x167877,_0x1c05cc,_0x1af094){var _0x4d9e0f={'raw':![],'where':{}};var _0x2a0709={};var _0x4d219a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x93b1('0x68')]({'where':{'id':_0x167877[_0x93b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c05cc,null))[_0x93b1('0x22')](function(_0x94858b){if(_0x94858b){_0x2a0709['model']=_[_0x93b1('0x43')](db[_0x93b1('0x6d')]['rawAttributes']);_0x2a0709[_0x93b1('0x44')]=_[_0x93b1('0x43')](_0x167877['query']);_0x2a0709[_0x93b1('0x45')]=_['intersection'](_0x2a0709[_0x93b1('0x42')],_0x2a0709[_0x93b1('0x44')]);_0x4d9e0f[_0x93b1('0x46')]=_[_0x93b1('0x47')](_0x2a0709[_0x93b1('0x42')],qs[_0x93b1('0x48')](_0x167877[_0x93b1('0x44')][_0x93b1('0x48')]));_0x4d9e0f[_0x93b1('0x46')]=_0x4d9e0f[_0x93b1('0x46')][_0x93b1('0x49')]?_0x4d9e0f[_0x93b1('0x46')]:_0x2a0709[_0x93b1('0x42')];if(!_0x167877[_0x93b1('0x44')][_0x93b1('0x6f')](_0x93b1('0x4a'))){_0x4d9e0f[_0x93b1('0x2f')]=qs[_0x93b1('0x2f')](_0x167877[_0x93b1('0x44')][_0x93b1('0x2f')]);_0x4d9e0f[_0x93b1('0x31')]=qs[_0x93b1('0x31')](_0x167877[_0x93b1('0x44')][_0x93b1('0x31')]);}_0x4d9e0f[_0x93b1('0x4b')]=qs[_0x93b1('0x4c')](_0x167877[_0x93b1('0x44')][_0x93b1('0x4c')]);_0x4d9e0f[_0x93b1('0x4d')]=qs[_0x93b1('0x45')](_['pick'](_0x167877[_0x93b1('0x44')],_0x2a0709[_0x93b1('0x45')]));_0x4d9e0f[_0x93b1('0x4d')]['FaxAccountId']=_0x94858b['id'];if(_0x167877[_0x93b1('0x44')][_0x93b1('0x4f')]){_0x4d9e0f[_0x93b1('0x4d')]=_[_0x93b1('0x50')](_0x4d9e0f['where'],{'$or':_[_0x93b1('0x3d')](_0x4d9e0f[_0x93b1('0x46')],function(_0x334c2e){var _0x2d688a={};_0x2d688a[_0x334c2e]={'$like':'%'+_0x167877[_0x93b1('0x44')][_0x93b1('0x4f')]+'%'};return _0x2d688a;})});}_0x4d9e0f=_[_0x93b1('0x50')]({},_0x4d9e0f,_0x167877[_0x93b1('0x52')]);return db[_0x93b1('0x6d')][_0x93b1('0x53')]({'where':_0x4d9e0f[_0x93b1('0x4d')]})['then'](function(_0x1aec78){_0x4d219a['count']=_0x1aec78;if(_0x167877['query'][_0x93b1('0x54')]){_0x4d9e0f[_0x93b1('0x69')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4d9e0f);})[_0x93b1('0x22')](function(_0xd5dc65){_0x4d219a[_0x93b1('0x55')]=_0xd5dc65;return _0x4d219a;});}})[_0x93b1('0x22')](respondWithFilteredResult(_0x1c05cc,_0x4d9e0f))[_0x93b1('0x59')](handleError(_0x1c05cc,null));};exports['removeAnswers']=function(_0x44a235,_0x53c2de,_0x23d510){return db['FaxAccount']['find']({'where':{'id':_0x44a235[_0x93b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x53c2de,null))['then'](function(_0x4cb2f2){if(_0x4cb2f2){return _0x4cb2f2[_0x93b1('0x70')](_0x44a235['query'][_0x93b1('0x6c')]);}})[_0x93b1('0x22')](respondWithStatusCode(_0x53c2de,null))[_0x93b1('0x59')](handleError(_0x53c2de,null));};exports[_0x93b1('0x71')]=function(_0x550a42,_0x7d0609,_0x329bd4){return db['FaxInteraction'][_0x93b1('0x60')]({'where':{'id':_0x550a42[_0x93b1('0x57')]['id']}})[_0x93b1('0x22')](handleEntityNotFound(_0x7d0609,null))[_0x93b1('0x22')](function(_0x3b666e){if(_0x3b666e){return _0x3b666e[_0x93b1('0x71')](_0x550a42[_0x93b1('0x64')][_0x93b1('0x6c')],_['omit'](_0x550a42[_0x93b1('0x64')],['ids','id'])||{});}})[_0x93b1('0x22')](respondWithResult(_0x7d0609,null))[_0x93b1('0x59')](handleError(_0x7d0609,null));};exports[_0x93b1('0x72')]=function(_0xd0acfc,_0x2970a1,_0x206da6){var _0x38ba29={'raw':![],'where':{}};var _0x2005f2={};var _0x6a3a8f={'count':0x0,'rows':[]};return db[_0x93b1('0x3e')][_0x93b1('0x68')]({'where':{'id':_0xd0acfc[_0x93b1('0x57')]['id']}})[_0x93b1('0x22')](handleEntityNotFound(_0x2970a1,null))[_0x93b1('0x22')](function(_0x40d4ab){if(_0x40d4ab){_0x2005f2[_0x93b1('0x42')]=_[_0x93b1('0x43')](db['FaxInteraction'][_0x93b1('0x3f')]);_0x2005f2[_0x93b1('0x44')]=_[_0x93b1('0x43')](_0xd0acfc['query']);_0x2005f2[_0x93b1('0x45')]=_[_0x93b1('0x47')](_0x2005f2[_0x93b1('0x42')],_0x2005f2[_0x93b1('0x44')]);_0x38ba29['attributes']=_['intersection'](_0x2005f2[_0x93b1('0x42')],qs['fields'](_0xd0acfc['query'][_0x93b1('0x48')]));_0x38ba29[_0x93b1('0x46')]=_0x38ba29[_0x93b1('0x46')][_0x93b1('0x49')]?_0x38ba29[_0x93b1('0x46')]:_0x2005f2['model'];if(!_0xd0acfc['query'][_0x93b1('0x6f')]('nolimit')){_0x38ba29[_0x93b1('0x2f')]=qs['limit'](_0xd0acfc['query']['limit']);_0x38ba29[_0x93b1('0x31')]=qs[_0x93b1('0x31')](_0xd0acfc[_0x93b1('0x44')][_0x93b1('0x31')]);}_0x38ba29[_0x93b1('0x4b')]=qs[_0x93b1('0x4c')](_0xd0acfc['query'][_0x93b1('0x4c')]);_0x38ba29[_0x93b1('0x4d')]=qs[_0x93b1('0x45')](_[_0x93b1('0x4e')](_0xd0acfc[_0x93b1('0x44')],_0x2005f2[_0x93b1('0x45')]));_0x38ba29[_0x93b1('0x4d')][_0x93b1('0x73')]=_0x40d4ab['id'];if(_0xd0acfc['query']['filter']){_0x38ba29[_0x93b1('0x4d')]=_['merge'](_0x38ba29[_0x93b1('0x4d')],{'$or':_[_0x93b1('0x3d')](_0x38ba29[_0x93b1('0x46')],function(_0x39cdc9){var _0x3c460e={};_0x3c460e[_0x39cdc9]={'$like':'%'+_0xd0acfc[_0x93b1('0x44')][_0x93b1('0x4f')]+'%'};return _0x3c460e;})});}_0x38ba29=_[_0x93b1('0x50')]({},_0x38ba29,_0xd0acfc[_0x93b1('0x52')]);return db[_0x93b1('0x74')][_0x93b1('0x53')]({'where':_0x38ba29[_0x93b1('0x4d')]})[_0x93b1('0x22')](function(_0x4cded2){_0x6a3a8f['count']=_0x4cded2;if(_0xd0acfc[_0x93b1('0x44')]['includeAll']){_0x38ba29['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x93b1('0x75')],'as':'Owner','attributes':[_0x93b1('0x39'),_0x93b1('0x76'),_0x93b1('0x77')],'required':![]},{'model':db[_0x93b1('0x78')],'as':_0x93b1('0x79'),'attributes':['id',_0x93b1('0x39'),_0x93b1('0x7a')],'where':_0xd0acfc[_0x93b1('0x44')]['tag']?{'id':_0xd0acfc[_0x93b1('0x44')][_0x93b1('0x7b')]}:undefined,'required':_0xd0acfc[_0x93b1('0x44')][_0x93b1('0x7b')]?!![]:![]}];}return db[_0x93b1('0x74')][_0x93b1('0x6a')](_0x38ba29);})[_0x93b1('0x22')](function(_0xdffd87){_0x6a3a8f[_0x93b1('0x55')]=_0xdffd87;return _0x6a3a8f;});}})['then'](respondWithFilteredResult(_0x2970a1,_0x38ba29))[_0x93b1('0x59')](handleError(_0x2970a1,null));};exports[_0x93b1('0x7c')]=function(_0x3d1fe9,_0x4c4c4c){var _0x30d774=_0x3d1fe9[_0x93b1('0x57')]['id'];var _0x27dc2c=_0x3d1fe9[_0x93b1('0x64')];var _0x60010c=0xc8;var _0x1d513b=null;return db['sequelize'][_0x93b1('0x7d')]({'isolationLevel':db['sequelize'][_0x93b1('0x7e')][_0x93b1('0x7f')][_0x93b1('0x80')]},function(_0x3ae1a0){return db[_0x93b1('0x3e')][_0x93b1('0x68')]({'where':{'id':_0x30d774},'transaction':_0x3ae1a0})[_0x93b1('0x22')](function(_0x1a03f3){if(_0x1a03f3){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x30d774},'transaction':_0x3ae1a0})[_0x93b1('0x22')](function(){var _0x54dcf0=_[_0x93b1('0x3d')](_0x27dc2c,function(_0x562aad){_0x562aad[_0x93b1('0x73')]=_0x30d774;return _0x562aad;});return db[_0x93b1('0x81')][_0x93b1('0x82')](_0x54dcf0,{'transaction':_0x3ae1a0});});}else{_0x60010c=0x194;_0x1d513b=[];}});})[_0x93b1('0x22')](function(){if(_0x60010c!==0x194){return db[_0x93b1('0x81')][_0x93b1('0x83')]({'where':{'FaxAccountId':_0x30d774},'order':_0x93b1('0x84')})[_0x93b1('0x22')](function(_0x3767f7){_0x1d513b=_0x3767f7;});}})[_0x93b1('0x59')](function(_0x17cff4){_0x60010c=0x1f4;logger[_0x93b1('0x28')](_0x17cff4[_0x93b1('0x38')]);if(_0x17cff4['name']){delete _0x17cff4[_0x93b1('0x39')];}_0x1d513b=_0x17cff4;})[_0x93b1('0x85')](function(){if(_0x1d513b===null){_0x4c4c4c[_0x93b1('0x2b')](_0x60010c);}else{if(_0x60010c===0x1f4){_0x4c4c4c[_0x93b1('0x2c')](_0x60010c)[_0x93b1('0x3a')](_0x1d513b);}else{_0x4c4c4c[_0x93b1('0x2c')](_0x60010c)[_0x93b1('0x2e')](_0x1d513b);}}});};exports[_0x93b1('0x86')]=function(_0x4b61c0,_0x4a5b31,_0x5d5362){var _0x1daf19={};var _0x46ad54={};var _0x21a93e;var _0x1c8e6f;return db[_0x93b1('0x3e')][_0x93b1('0x68')]({'where':{'id':_0x4b61c0[_0x93b1('0x57')]['id']}})[_0x93b1('0x22')](handleEntityNotFound(_0x4a5b31,null))[_0x93b1('0x22')](function(_0x23c532){if(_0x23c532){_0x21a93e=_0x23c532;_0x46ad54[_0x93b1('0x42')]=_[_0x93b1('0x43')](db[_0x93b1('0x81')][_0x93b1('0x3f')]);_0x46ad54[_0x93b1('0x44')]=_[_0x93b1('0x43')](_0x4b61c0[_0x93b1('0x44')]);_0x46ad54['filters']=_[_0x93b1('0x47')](_0x46ad54[_0x93b1('0x42')],_0x46ad54[_0x93b1('0x44')]);_0x1daf19['attributes']=_['intersection'](_0x46ad54[_0x93b1('0x42')],qs[_0x93b1('0x48')](_0x4b61c0['query'][_0x93b1('0x48')]));_0x1daf19[_0x93b1('0x46')]=_0x1daf19[_0x93b1('0x46')][_0x93b1('0x49')]?_0x1daf19[_0x93b1('0x46')]:_0x46ad54[_0x93b1('0x42')];_0x1daf19[_0x93b1('0x4b')]=qs[_0x93b1('0x4c')](_0x4b61c0['query'][_0x93b1('0x4c')]);_0x1daf19[_0x93b1('0x4d')]=qs[_0x93b1('0x45')](_[_0x93b1('0x4e')](_0x4b61c0['query'],_0x46ad54[_0x93b1('0x45')]));if(_0x4b61c0[_0x93b1('0x44')]['filter']){_0x1daf19[_0x93b1('0x4d')]=_[_0x93b1('0x50')](_0x1daf19[_0x93b1('0x4d')],{'$or':_[_0x93b1('0x3d')](_0x1daf19[_0x93b1('0x46')],function(_0x4a0447){var _0x39ed8e={};_0x39ed8e[_0x4a0447]={'$like':'%'+_0x4b61c0['query']['filter']+'%'};return _0x39ed8e;})});}_0x1daf19=_[_0x93b1('0x50')]({},_0x1daf19,_0x4b61c0[_0x93b1('0x52')]);return _0x21a93e[_0x93b1('0x86')](_0x1daf19);}})[_0x93b1('0x22')](function(_0xbd1863){if(_0xbd1863){_0x1c8e6f=_0xbd1863[_0x93b1('0x49')];if(!_0x4b61c0[_0x93b1('0x44')][_0x93b1('0x6f')]('nolimit')){_0x1daf19[_0x93b1('0x2f')]=qs[_0x93b1('0x2f')](_0x4b61c0[_0x93b1('0x44')][_0x93b1('0x2f')]);_0x1daf19[_0x93b1('0x31')]=qs[_0x93b1('0x31')](_0x4b61c0['query'][_0x93b1('0x31')]);}return _0x21a93e['getApplications'](_0x1daf19);}})[_0x93b1('0x22')](function(_0x54a547){if(_0x54a547){return _0x54a547?{'count':_0x1c8e6f,'rows':_0x54a547}:null;}})['then'](respondWithResult(_0x4a5b31,null))[_0x93b1('0x59')](handleError(_0x4a5b31,null));};function Extension(_0x301b12,_0x598f69,_0x3919be,_0xc63d21){this[_0x93b1('0x87')]='from-voip-provider';this[_0x93b1('0x88')]=_0x301b12[_0x93b1('0x89')];this[_0x93b1('0x8a')]=_0xc63d21;this['type']=_0x93b1('0x8b');this['description']='Fax\x20Extension';this[_0x93b1('0x73')]=_0x301b12['id'];this[_0x93b1('0x84')]=_0x598f69;this[_0x93b1('0x8c')]=_0x3919be;}function createExtensionsReciveFax(_0x301042){var _0x406796=0x1;var _0x4f2600=[];_0x4f2600['push'](new Extension(_0x301042,_0x406796,'',_0x93b1('0x8d')));_0x406796+=0x1;_0x4f2600[_0x93b1('0x8e')](new Extension(_0x301042,_0x406796,_0x93b1('0x8f'),_0x93b1('0x90')));_0x406796+=0x1;for(var _0xfb0a1 in _0x301042){if(_0x301042[_0x93b1('0x6f')](_0xfb0a1)&&(_0xfb0a1===_0x93b1('0x91')||_0xfb0a1===_0x93b1('0x89')||_0xfb0a1==='gateway'||_0xfb0a1===_0x93b1('0x92')||_0xfb0a1==='headerinfo'||_0xfb0a1==='maxrate'||_0xfb0a1===_0x93b1('0x93')||_0xfb0a1==='modem'||_0xfb0a1===_0x93b1('0x94'))){_0x4f2600['push'](new Extension(_0x301042,_0x406796,_0x93b1('0x95')+_0xfb0a1+')='+_0x301042[_0xfb0a1],'Set'));_0x406796+=0x1;}}_0x4f2600['push'](new Extension(_0x301042,_0x406796,'6',_0x93b1('0x96')));_0x406796+=0x1;_0x4f2600[_0x93b1('0x8e')](new Extension(_0x301042,_0x406796,'/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',_0x93b1('0x97')));_0x406796=0x0;return _0x4f2600;}exports['addAccountApplications']=function(_0x4febdf,_0x1f3d98,_0x5959ba){var _0x587dd7;return db['sequelize'][_0x93b1('0x7d')](function(_0xab6577){return db[_0x93b1('0x3e')]['create'](_0x4febdf[_0x93b1('0x64')],{'transaction':_0xab6577})[_0x93b1('0x22')](function(_0x820cd5){_0x587dd7=_0x820cd5[_0x93b1('0x5c')]({'plain':!![]});return db[_0x93b1('0x98')]['bulkCreate'](createExtensionsReciveFax(_0x587dd7),{'transaction':_0xab6577});});})[_0x93b1('0x22')](function(){return _0x587dd7;})[_0x93b1('0x22')](respondWithResult(_0x1f3d98,null))['catch'](handleError(_0x1f3d98,null));};exports[_0x93b1('0x99')]=function(_0x332a23,_0x342319,_0x1df4ab){var _0x27b4ad;return db[_0x93b1('0x9a')][_0x93b1('0x7d')](function(_0x5a7368){return db[_0x93b1('0x3e')][_0x93b1('0x35')](_0x332a23[_0x93b1('0x64')],{'where':{'id':_0x332a23[_0x93b1('0x64')]['id']},'transaction':_0x5a7368})[_0x93b1('0x22')](function(_0x4dad4f){return db[_0x93b1('0x98')]['destroy']({'where':{'FaxAccountId':_0x332a23[_0x93b1('0x64')]['id']},'transaction':_0x5a7368})[_0x93b1('0x22')](function(_0x376daf){return db[_0x93b1('0x98')][_0x93b1('0x82')](createExtensionsReciveFax(_[_0x93b1('0x9b')](_0x332a23['body'],[_0x93b1('0x9c'),_0x93b1('0x9d'),_0x93b1('0x9e'),_0x93b1('0x9f'),'TrunkId','ListId'])),{'transaction':_0x5a7368});});});})[_0x93b1('0x22')](function(){return db[_0x93b1('0x3e')][_0x93b1('0xa0')](_0x332a23['body']['id']);})[_0x93b1('0x22')](respondWithResult(_0x342319,null))[_0x93b1('0x59')](handleError(_0x342319,null));};exports[_0x93b1('0xa1')]=function(_0x1622a7,_0x57629f,_0x5b0f55){var _0x130313={'raw':!![],'where':{}};var _0x544311={};var _0x1f37b2={'count':0x0,'rows':[]};return db[_0x93b1('0x3e')][_0x93b1('0x68')]({'where':{'id':_0x1622a7[_0x93b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x57629f,null))['then'](function(_0x338703){if(_0x338703){_0x544311[_0x93b1('0x42')]=_[_0x93b1('0x43')](db[_0x93b1('0xa2')][_0x93b1('0x3f')]);_0x544311[_0x93b1('0x44')]=_['keys'](_0x1622a7[_0x93b1('0x44')]);_0x544311['filters']=_[_0x93b1('0x47')](_0x544311[_0x93b1('0x42')],_0x544311[_0x93b1('0x44')]);_0x130313[_0x93b1('0x46')]=_[_0x93b1('0x47')](_0x544311[_0x93b1('0x42')],qs[_0x93b1('0x48')](_0x1622a7[_0x93b1('0x44')][_0x93b1('0x48')]));_0x130313[_0x93b1('0x46')]=_0x130313[_0x93b1('0x46')][_0x93b1('0x49')]?_0x130313[_0x93b1('0x46')]:_0x544311[_0x93b1('0x42')];if(!_0x1622a7[_0x93b1('0x44')][_0x93b1('0x6f')](_0x93b1('0x4a'))){_0x130313[_0x93b1('0x2f')]=qs[_0x93b1('0x2f')](_0x1622a7['query'][_0x93b1('0x2f')]);_0x130313[_0x93b1('0x31')]=qs['offset'](_0x1622a7[_0x93b1('0x44')][_0x93b1('0x31')]);}_0x130313[_0x93b1('0x4b')]=qs['sort'](_0x1622a7['query'][_0x93b1('0x4c')]);_0x130313['where']=qs[_0x93b1('0x45')](_[_0x93b1('0x4e')](_0x1622a7[_0x93b1('0x44')],_0x544311[_0x93b1('0x45')]));_0x130313[_0x93b1('0x4d')][_0x93b1('0x73')]=_0x338703['id'];if(_0x1622a7[_0x93b1('0x44')][_0x93b1('0x4f')]){_0x130313['where']=_[_0x93b1('0x50')](_0x130313[_0x93b1('0x4d')],{'$or':_['map'](_0x130313['attributes'],function(_0x2d3ffc){var _0x2554b1={};_0x2554b1[_0x2d3ffc]={'$like':'%'+_0x1622a7['query'][_0x93b1('0x4f')]+'%'};return _0x2554b1;})});}if(_0x1622a7['query'][_0x93b1('0xa3')]){var _0x2e2d78=_0x1622a7[_0x93b1('0x44')][_0x93b1('0xa3')][_0x93b1('0xa4')](',');var _0x183602={};_0x183602[_0x2e2d78[0x0]]={'$gte':moment(_0x2e2d78[0x1])[_0x93b1('0xa5')](_0x93b1('0xa6'))};_0x130313[_0x93b1('0x4d')]=_[_0x93b1('0x50')](_0x130313['where'],_0x183602);}_0x130313=_[_0x93b1('0x50')]({},_0x130313,_0x1622a7[_0x93b1('0x52')]);return db['FaxMessage'][_0x93b1('0x53')]({'where':_0x130313[_0x93b1('0x4d')]})[_0x93b1('0x22')](function(_0x2fb945){_0x1f37b2[_0x93b1('0x53')]=_0x2fb945;if(_0x1622a7['query'][_0x93b1('0x54')]){_0x130313[_0x93b1('0x69')]=[{'all':!![]}];}return db[_0x93b1('0xa2')][_0x93b1('0x6a')](_0x130313);})[_0x93b1('0x22')](function(_0xf52eea){_0x1f37b2[_0x93b1('0x55')]=_0xf52eea;return _0x1f37b2;});}})[_0x93b1('0x22')](respondWithFilteredResult(_0x57629f,_0x130313))[_0x93b1('0x59')](handleError(_0x57629f,null));};exports[_0x93b1('0x3a')]=function(_0x1f9b56,_0x2eed66,_0x207316){var _0x41ce50,_0x5c71cd={},_0x5c22c1;if(_0x1f9b56['body']['to']){_0x5c22c1=_0x1f9b56[_0x93b1('0x64')]['to'][0x0];}return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0x1f9b56['params']['id']},'include':[{'model':db[_0x93b1('0xa7')],'as':_0x93b1('0xa8'),'include':[{'model':db[_0x93b1('0xa9')],'as':_0x93b1('0xaa'),'where':{'fax':_0x5c22c1},'limit':0x1,'order':[[_0x93b1('0x9f'),_0x93b1('0xab')]]}]}]})[_0x93b1('0x22')](handleEntityNotFound(_0x2eed66,null))[_0x93b1('0x22')](function(_0xdfbb50){_0x41ce50=_0xdfbb50;if(_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')]&&_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')]['length']){for(var _0x44b4c1=0x0;_0x44b4c1<_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][_0x93b1('0x49')];_0x44b4c1+=0x1){_0x1f9b56[_0x93b1('0x64')]['attachments'][_0x44b4c1]={'filename':_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][_0x44b4c1]['name'],'id':_0x1f9b56[_0x93b1('0x64')]['attachments'][_0x44b4c1]['id'],'path':path[_0x93b1('0xad')](config[_0x93b1('0xae')],_0x93b1('0xaf'),_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][_0x44b4c1][_0x93b1('0xb0')])};}}return respondWithRpcPromise(_0x93b1('0xb1'),_0x93b1('0xb1'),{'FaxAccountId':_['isNil'](_0x1f9b56[_0x93b1('0x57')]['id'])?undefined:_0x1f9b56[_0x93b1('0x57')]['id'],'path':_[_0x93b1('0xb2')](_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0][_0x93b1('0xb3')])?undefined:_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0][_0x93b1('0xb3')],'fax':_[_0x93b1('0xb2')](_0x1f9b56[_0x93b1('0x64')]['to'][0x0])?undefined:_0x1f9b56[_0x93b1('0x64')]['to'][0x0]},client9002);})[_0x93b1('0x22')](function(){if(_0x41ce50){if(_[_0x93b1('0xb2')](_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xb4')])){_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xb4')]=util[_0x93b1('0xa5')]('\x22%s\x22\x20<%s>',_0x41ce50['name'],_0x41ce50[_0x93b1('0xb5')]);}if(_0x41ce50['List']){if(_0x41ce50[_0x93b1('0xa8')][_0x93b1('0xaa')][_0x93b1('0x49')]){return _0x41ce50['List']['Contacts'][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x1f9b56[_0x93b1('0x64')],{'firstName':_0x1f9b56[_0x93b1('0x64')]['to'][0x0],'phone':_0x1f9b56[_0x93b1('0x64')]['to'][0x0],'fax':_0x1f9b56[_0x93b1('0x64')]['to'][0x0],'ListId':_0x41ce50[_0x93b1('0xb6')]}));}}else{throw new Error(_0x93b1('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x93b1('0x22')](function(_0x36f621){if(_0x36f621){return db[_0x93b1('0x74')][_0x93b1('0x60')]({'where':{'ContactId':_0x36f621['id'],'closed':![],'FaxAccountId':_0x41ce50['id']}})[_0x93b1('0x22')](function(_0x140142){if(_0x140142){return[_0x140142,![]];}return db[_0x93b1('0x74')][_0x93b1('0x5a')]({'UserId':_0x1f9b56['user']['id'],'ContactId':_0x36f621['id'],'FaxAccountId':_0x41ce50['id'],'fax':_0x1f9b56['body']['to'][0x0],'firstMsgDirection':_0x93b1('0xb8'),'Messages':[_['merge'](_0x1f9b56[_0x93b1('0x64')],{'read':![],'body':_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0][_0x93b1('0xb9')],'FaxAccountId':_0x41ce50['id'],'UserId':_0x1f9b56[_0x93b1('0x5b')]['id'],'ContactId':_0x36f621['id'],'AttachmentId':_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x93b1('0xa2')],'as':'Messages'}]})[_0x93b1('0x22')](function(_0x48062f){return[_0x48062f,!![]];});});}else{throw new Error(_0x93b1('0xba'));}})[_0x93b1('0xbb')](function(_0x25727a,_0x205437){if(_0x205437){return _0x25727a;}return db[_0x93b1('0xa2')][_0x93b1('0x5a')]({'direction':'out','read':![],'body':_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0]['filename'],'FaxAccountId':_0x41ce50['id'],'FaxInteractionId':_0x25727a['id'],'UserId':_0x1f9b56[_0x93b1('0x5b')]['id'],'ContactId':_0x25727a[_0x93b1('0xbc')],'AttachmentId':_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0]['id']})[_0x93b1('0x22')](function(_0x1cb6fb){_0x25727a[_0x93b1('0xbd')]['Messages']=[];_0x25727a[_0x93b1('0xbd')]['Messages'][_0x93b1('0x8e')](_0x1cb6fb['dataValues']);return _0x25727a;});})[_0x93b1('0x22')](function(_0x4321a2){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x93b1('0xb2')](_0x1f9b56[_0x93b1('0x57')]['id'])?undefined:_0x1f9b56[_0x93b1('0x57')]['id'],'path':_['isNil'](_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0][_0x93b1('0xb3')])?undefined:_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0]['path'],'fax':_[_0x93b1('0xb2')](_0x1f9b56[_0x93b1('0x64')]['to'][0x0])?undefined:_0x1f9b56['body']['to'][0x0],'AttachmentId':_0x1f9b56[_0x93b1('0x64')][_0x93b1('0xac')][0x0]['id']},client9002)[_0x93b1('0x22')](function(_0x56ad21){logger[_0x93b1('0x23')](_0x93b1('0xbe'),_0x56ad21);})['catch'](function(_0x2f6456){logger[_0x93b1('0x23')](_0x93b1('0xbe'),_0x2f6456);});return _0x4321a2;})[_0x93b1('0x22')](respondWithResult(_0x2eed66,null))['catch'](handleError(_0x2eed66,null));};exports['addAgents']=function(_0x3e3517,_0x45bfc1,_0x1e1cf6){return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0x3e3517[_0x93b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x45bfc1,null))[_0x93b1('0x22')](function(_0x31c8bb){if(_0x31c8bb){return _0x31c8bb['addAgents'](_0x3e3517[_0x93b1('0x64')]['ids'],_['omit'](_0x3e3517[_0x93b1('0x64')],['ids','id'])||{})[_0x93b1('0xbb')](function(_0x2f8bac){for(var _0x535dc3=0x0;_0x535dc3<_0x3e3517[_0x93b1('0x64')][_0x93b1('0x6c')][_0x93b1('0x49')];_0x535dc3+=0x1){socket['emit'](_0x93b1('0xbf'),{'UserId':Number(_0x3e3517[_0x93b1('0x64')][_0x93b1('0x6c')][_0x535dc3]),'FaxAccountId':Number(_0x3e3517[_0x93b1('0x57')]['id'])});}return _0x2f8bac;});}})['then'](respondWithResult(_0x45bfc1,null))[_0x93b1('0x59')](handleError(_0x45bfc1,null));};exports[_0x93b1('0xc0')]=function(_0xcf0455,_0x48f734,_0x3acdf9){return db[_0x93b1('0x3e')][_0x93b1('0x60')]({'where':{'id':_0xcf0455['params']['id']}})['then'](handleEntityNotFound(_0x48f734,null))[_0x93b1('0x22')](function(_0x1325cf){if(_0x1325cf){return _0x1325cf[_0x93b1('0xc0')](_0xcf0455[_0x93b1('0x44')][_0x93b1('0x6c')])[_0x93b1('0x22')](function(){if(_[_0x93b1('0xc1')](_0xcf0455[_0x93b1('0x44')][_0x93b1('0x6c')])){for(var _0x96c04b=0x0;_0x96c04b<_0xcf0455['query'][_0x93b1('0x6c')][_0x93b1('0x49')];_0x96c04b+=0x1){socket[_0x93b1('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0xcf0455[_0x93b1('0x44')][_0x93b1('0x6c')][_0x96c04b]),'FaxAccountId':Number(_0xcf0455[_0x93b1('0x57')]['id'])});}}else{socket[_0x93b1('0xc2')](_0x93b1('0xc3'),{'UserId':Number(_0xcf0455[_0x93b1('0x44')]['ids']),'FaxAccountId':Number(_0xcf0455['params']['id'])});}});}})[_0x93b1('0x22')](respondWithStatusCode(_0x48f734,null))[_0x93b1('0x59')](handleError(_0x48f734,null));};exports[_0x93b1('0xc4')]=function(_0x1b8c5a,_0x3d6217,_0x8ca435){var _0x21f769={};var _0x6ad4b0={};var _0xc3e89b;var _0x32577d;return db[_0x93b1('0x3e')]['findOne']({'where':{'id':_0x1b8c5a[_0x93b1('0x57')]['id']}})[_0x93b1('0x22')](handleEntityNotFound(_0x3d6217,null))['then'](function(_0x2b59a7){if(_0x2b59a7){_0xc3e89b=_0x2b59a7;_0x6ad4b0[_0x93b1('0x42')]=_['keys'](db[_0x93b1('0x75')][_0x93b1('0x3f')]);_0x6ad4b0['query']=_[_0x93b1('0x43')](_0x1b8c5a[_0x93b1('0x44')]);_0x6ad4b0['filters']=_['intersection'](_0x6ad4b0[_0x93b1('0x42')],_0x6ad4b0['query']);_0x21f769['attributes']=_[_0x93b1('0x47')](_0x6ad4b0[_0x93b1('0x42')],qs[_0x93b1('0x48')](_0x1b8c5a[_0x93b1('0x44')][_0x93b1('0x48')]));_0x21f769[_0x93b1('0x46')]=_0x21f769[_0x93b1('0x46')][_0x93b1('0x49')]?_0x21f769[_0x93b1('0x46')]:_0x6ad4b0[_0x93b1('0x42')];_0x21f769[_0x93b1('0x4b')]=qs[_0x93b1('0x4c')](_0x1b8c5a[_0x93b1('0x44')][_0x93b1('0x4c')]);_0x21f769[_0x93b1('0x4d')]=qs[_0x93b1('0x45')](_[_0x93b1('0x4e')](_0x1b8c5a[_0x93b1('0x44')],_0x6ad4b0[_0x93b1('0x45')]));if(_0x1b8c5a[_0x93b1('0x44')][_0x93b1('0x4f')]){_0x21f769[_0x93b1('0x4d')]=_[_0x93b1('0x50')](_0x21f769['where'],{'$or':_['map'](_0x21f769['attributes'],function(_0x400dec){var _0x5f1150={};_0x5f1150[_0x400dec]={'$like':'%'+_0x1b8c5a[_0x93b1('0x44')][_0x93b1('0x4f')]+'%'};return _0x5f1150;})});}_0x21f769=_[_0x93b1('0x50')]({},_0x21f769,_0x1b8c5a['options']);return _0xc3e89b[_0x93b1('0xc4')](_0x21f769);}})['then'](function(_0x2e2ee4){if(_0x2e2ee4){_0x32577d=_0x2e2ee4[_0x93b1('0x49')];if(!_0x1b8c5a[_0x93b1('0x44')]['hasOwnProperty']('nolimit')){_0x21f769[_0x93b1('0x2f')]=qs[_0x93b1('0x2f')](_0x1b8c5a[_0x93b1('0x44')][_0x93b1('0x2f')]);_0x21f769[_0x93b1('0x31')]=qs[_0x93b1('0x31')](_0x1b8c5a[_0x93b1('0x44')][_0x93b1('0x31')]);}return _0xc3e89b[_0x93b1('0xc4')](_0x21f769);}})[_0x93b1('0x22')](function(_0x580a0e){if(_0x580a0e){return _0x580a0e?{'count':_0x32577d,'rows':_0x580a0e}:null;}})[_0x93b1('0x22')](respondWithResult(_0x3d6217,null))['catch'](handleError(_0x3d6217,null));};
\ No newline at end of file
index 26e877b..117f2c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef50=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x46cf94,_0x3b45c7){var _0x36554d=function(_0x4aacaa){while(--_0x4aacaa){_0x46cf94['push'](_0x46cf94['shift']());}};_0x36554d(++_0x3b45c7);}(_0xef50,0x1e1));var _0x0ef5=function(_0x472ae8,_0x12cff1){_0x472ae8=_0x472ae8-0x0;var _0x54b143=_0xef50[_0x472ae8];return _0x54b143;};'use strict';var EventEmitter=require(_0x0ef5('0x0'));var FaxAccount=require(_0x0ef5('0x1'))['db'][_0x0ef5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ef5('0x3'),'afterUpdate':_0x0ef5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x424d4e){return function(_0x42da80,_0x30e2ca,_0x138b84){FaxAccountEvents['emit'](_0x424d4e+':'+_0x42da80['id'],_0x42da80);FaxAccountEvents[_0x0ef5('0x5')](_0x424d4e,_0x42da80);_0x138b84(null);};}for(var e in events){if(events[_0x0ef5('0x6')](e)){var event=events[e];FaxAccount[_0x0ef5('0x7')](e,emitEvent(event));}}module[_0x0ef5('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0xeeaf=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update'];(function(_0x241786,_0x10336f){var _0x1fc73d=function(_0x4b4b85){while(--_0x4b4b85){_0x241786['push'](_0x241786['shift']());}};_0x1fc73d(++_0x10336f);}(_0xeeaf,0x159));var _0xfeea=function(_0x33a813,_0x12a55e){_0x33a813=_0x33a813-0x0;var _0x42aaa5=_0xeeaf[_0x33a813];return _0x42aaa5;};'use strict';var EventEmitter=require(_0xfeea('0x0'));var FaxAccount=require(_0xfeea('0x1'))['db'][_0xfeea('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xfeea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfeea('0x4'),'afterDestroy':_0xfeea('0x5')};function emitEvent(_0x84cb4a){return function(_0x52506f,_0x1bbaf8,_0x222234){FaxAccountEvents['emit'](_0x84cb4a+':'+_0x52506f['id'],_0x52506f);FaxAccountEvents[_0xfeea('0x6')](_0x84cb4a,_0x52506f);_0x222234(null);};}for(var e in events){if(events[_0xfeea('0x7')](e)){var event=events[e];FaxAccount[_0xfeea('0x8')](e,emitEvent(event));}}module[_0xfeea('0x9')]=FaxAccountEvents;
\ No newline at end of file
index 3fce7eb..789b55c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc6d=['define','FaxAccount','fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xcc6d,0xe3));var _0xdcc6=function(_0x5612eb,_0x1e311e){_0x5612eb=_0x5612eb-0x0;var _0x2ff828=_0xcc6d[_0x5612eb];return _0x2ff828;};'use strict';var _=require('lodash');var util=require(_0xdcc6('0x0'));var logger=require(_0xdcc6('0x1'))(_0xdcc6('0x2'));var moment=require(_0xdcc6('0x3'));var BPromise=require(_0xdcc6('0x4'));var rp=require(_0xdcc6('0x5'));var fs=require('fs');var path=require(_0xdcc6('0x6'));var rimraf=require(_0xdcc6('0x7'));var config=require(_0xdcc6('0x8'));var attributes=require(_0xdcc6('0x9'));module[_0xdcc6('0xa')]=function(_0x25267a,_0x24a88f){return _0x25267a[_0xdcc6('0xb')](_0xdcc6('0xc'),attributes,{'tableName':_0xdcc6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3375=['define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x3375,0xf5));var _0x5337=function(_0x426558,_0x53c50d){_0x426558=_0x426558-0x0;var _0x81b48=_0x3375[_0x426558];return _0x81b48;};'use strict';var _=require(_0x5337('0x0'));var util=require(_0x5337('0x1'));var logger=require(_0x5337('0x2'))(_0x5337('0x3'));var moment=require('moment');var BPromise=require(_0x5337('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5337('0x5'));var rimraf=require(_0x5337('0x6'));var config=require(_0x5337('0x7'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x51b991,_0x2f16d2){return _0x51b991[_0x5337('0x8')](_0x5337('0x9'),attributes,{'tableName':_0x5337('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b73bad..e31b569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a7=['priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','AttachmentId','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','keys','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','get','applications','Applications','list','orderBy'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x27a7,0x17a));var _0x727a=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x27a7[_0x2e0443];return _0x52d450;};'use strict';var _=require(_0x727a('0x0'));var util=require(_0x727a('0x1'));var moment=require(_0x727a('0x2'));var BPromise=require(_0x727a('0x3'));var rs=require(_0x727a('0x4'));var fs=require('fs');var Redis=require(_0x727a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x727a('0x6'));var logger=require(_0x727a('0x7'))('rpc');var config=require(_0x727a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x727a('0x9')][_0x727a('0xa')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0x727a('0xb'),'port':0x18eb});var socket=require(_0x727a('0xc'))(new Redis(config['redis']));require(_0x727a('0xd'))[_0x727a('0xe')](socket);function respondWithRpcPromise(_0x1459e3,_0x3fd5a4,_0x5ce963){return new BPromise(function(_0x364132,_0xf28ac4){return client[_0x727a('0xf')](_0x1459e3,_0x5ce963)[_0x727a('0x10')](function(_0xe60e6f){logger[_0x727a('0x11')](_0x727a('0x12'),_0x3fd5a4,_0x727a('0x13'));logger[_0x727a('0x14')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3fd5a4,'request\x20sent',JSON[_0x727a('0x15')](_0xe60e6f));if(_0xe60e6f[_0x727a('0x16')]){if(_0xe60e6f['error'][_0x727a('0x17')]===0x1f4){logger[_0x727a('0x16')](_0x727a('0x12'),_0x3fd5a4,_0xe60e6f[_0x727a('0x16')]['message']);return _0xf28ac4(_0xe60e6f[_0x727a('0x16')][_0x727a('0x18')]);}logger[_0x727a('0x16')](_0x727a('0x12'),_0x3fd5a4,_0xe60e6f[_0x727a('0x16')][_0x727a('0x18')]);return _0x364132(_0xe60e6f[_0x727a('0x16')][_0x727a('0x18')]);}else{logger[_0x727a('0x11')]('FaxAccount,\x20%s,\x20%s',_0x3fd5a4,_0x727a('0x13'));_0x364132(_0xe60e6f[_0x727a('0x19')][_0x727a('0x18')]);}})[_0x727a('0x1a')](function(_0x105fb6){logger[_0x727a('0x16')](_0x727a('0x12'),_0x3fd5a4,_0x105fb6);_0xf28ac4(_0x105fb6);});});}exports[_0x727a('0x1b')]=function(_0x4e86a5){var _0x33236b=this;return new Promise(function(_0x3040e7,_0x3c971e){return db[_0x727a('0x1c')]['findAll']({'raw':_0x4e86a5[_0x727a('0x1d')]?_0x4e86a5[_0x727a('0x1d')][_0x727a('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e86a5[_0x727a('0x1d')]?_0x4e86a5[_0x727a('0x1d')]['where']||null:null,'attributes':_0x4e86a5[_0x727a('0x1d')]?_0x4e86a5['options'][_0x727a('0x1f')]||null:null,'limit':_0x4e86a5['options']?_0x4e86a5['options'][_0x727a('0x20')]||null:null,'include':_0x4e86a5[_0x727a('0x1d')]?_0x4e86a5[_0x727a('0x1d')][_0x727a('0x21')]?_[_0x727a('0x22')](_0x4e86a5[_0x727a('0x1d')][_0x727a('0x21')],function(_0x3bf6e0){return{'model':db[_0x3bf6e0[_0x727a('0x23')]],'as':_0x3bf6e0['as'],'attributes':_0x3bf6e0[_0x727a('0x1f')],'include':_0x3bf6e0[_0x727a('0x21')]?_[_0x727a('0x22')](_0x3bf6e0[_0x727a('0x21')],function(_0x44944a){return{'model':db[_0x44944a[_0x727a('0x23')]],'as':_0x44944a['as'],'attributes':_0x44944a[_0x727a('0x1f')],'include':_0x44944a['include']?_[_0x727a('0x22')](_0x44944a[_0x727a('0x21')],function(_0x350e79){return{'model':db[_0x350e79[_0x727a('0x23')]],'as':_0x350e79['as'],'attributes':_0x350e79[_0x727a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x727a('0x10')](function(_0x137e56){logger[_0x727a('0x11')]('GetFaxAccount',_0x4e86a5);logger['debug'](_0x727a('0x1b'),_0x4e86a5,JSON[_0x727a('0x15')](_0x137e56));_0x3040e7(_0x137e56);})[_0x727a('0x1a')](function(_0x480a0c){logger[_0x727a('0x16')](_0x727a('0x1b'),_0x480a0c[_0x727a('0x18')],_0x4e86a5);_0x3c971e(_0x33236b[_0x727a('0x16')](0x1f4,_0x480a0c[_0x727a('0x18')]));});});};exports[_0x727a('0x24')]=function(_0x405041,_0x5362bb,_0x2b45b5){var _0x325796=this;return new Promise(function(_0x75ff32,_0x5d0883){var _0x414fbe={'body':_0x405041[_0x727a('0x25')],'channel':_0x727a('0x26')};var _0x5b4aed=[];var _0x49bed2=[];var _0x21ede0={};return db[_0x727a('0x27')][_0x727a('0x28')]()['then'](function(_0x276bf6){if(!_0x276bf6){throw new db[(_0x727a('0x29'))][(_0x727a('0x2a'))](_0x727a('0x2b'));}_0x5b4aed=_[_0x727a('0x2c')](_['keys'](_0x276bf6),[_0x727a('0x2d'),'updatedAt']);_0x49bed2=_['difference'](_[_0x727a('0x2e')](_0x276bf6),[_0x727a('0x2d'),'updatedAt',_0x727a('0x2f'),_0x727a('0x30')]);if(_0x405041[_0x727a('0x25')]['id']){delete _0x405041[_0x727a('0x25')]['id'];}if(_[_0x727a('0x31')](_0x405041[_0x727a('0x25')][_0x727a('0x32')])){throw new db[(_0x727a('0x29'))][(_0x727a('0x2a'))](_0x727a('0x33'));}if(_['isNil'](_0x405041[_0x727a('0x25')][_0x727a('0x25')])||_0x405041[_0x727a('0x25')][_0x727a('0x25')]===''){throw new db[(_0x727a('0x29'))]['ValidationError'](_0x727a('0x34'));}if(_[_0x727a('0x31')](_0x405041['body']['mapKey'])){throw new db[(_0x727a('0x29'))]['ValidationError'](_0x727a('0x35')+_0x49bed2);}if(!_['includes'](_0x49bed2,_0x405041[_0x727a('0x25')][_0x727a('0x36')])){throw new db[(_0x727a('0x29'))][(_0x727a('0x2a'))](_0x727a('0x37')+_0x49bed2);}_0x21ede0[_0x405041[_0x727a('0x25')][_0x727a('0x36')]]=_0x405041[_0x727a('0x25')][_0x727a('0x32')];})[_0x727a('0x10')](function(){return db[_0x727a('0x1c')][_0x727a('0x38')]({'where':{'id':_0x405041[_0x727a('0x39')]['id']},'include':[{'model':db[_0x727a('0x3a')],'as':_0x727a('0x3b'),'include':[{'model':db[_0x727a('0x27')],'as':_0x727a('0x3c'),'where':_0x21ede0,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x727a('0x3d')],'as':'Applications'}]});})['then'](function(_0x310d7f){if(_0x310d7f&&_0x310d7f[_0x727a('0x3b')]){var _0x3dc27b=_0x310d7f[_0x727a('0x3e')]({'plain':!![]});_0x414fbe[_0x727a('0x39')]=_0x3dc27b;_0x414fbe[_0x727a('0x3f')]=_0x3dc27b[_0x727a('0x40')];_0x414fbe[_0x727a('0x41')]=_0x3dc27b['List'];_0x414fbe[_0x727a('0x3f')]=_[_0x727a('0x42')](_0x414fbe[_0x727a('0x3f')],[_0x727a('0x43')],[_0x727a('0x44')]);if(_0x414fbe[_0x727a('0x39')][_0x727a('0x40')]){delete _0x414fbe['account']['Applications'];}if(_0x414fbe[_0x727a('0x39')]['List']&&_0x414fbe[_0x727a('0x39')]['List'][_0x727a('0x3c')][_0x727a('0x45')]){return _0x414fbe[_0x727a('0x39')][_0x727a('0x3b')][_0x727a('0x3c')][0x0];}var _0x2bc01f=_['defaults'](_0x405041['body'],{'firstName':_0x405041[_0x727a('0x25')][_0x727a('0x32')],'ListId':_0x3dc27b[_0x727a('0x30')]});_0x2bc01f[_0x405041['body'][_0x727a('0x36')]]=_0x405041[_0x727a('0x25')]['from'];return db['CmContact'][_0x727a('0x46')](_0x2bc01f,{'fields':_0x5b4aed,'raw':!![]});}})[_0x727a('0x10')](function(_0x2e4e69){_0x414fbe[_0x727a('0x47')]=_0x2e4e69;if(_0x2e4e69){var _0x45f55f={'ContactId':_0x2e4e69['id'],'FaxAccountId':_0x405041['account']['id'],'fax':_0x2e4e69[_0x727a('0x26')]};return db[_0x727a('0x48')][_0x727a('0x38')]({'where':{'ContactId':_0x2e4e69['id'],'closed':![],'FaxAccountId':_0x405041['account']['id']}})[_0x727a('0x10')](function(_0x425b2e){if(_0x425b2e){return[_0x425b2e,![]];}return db['FaxInteraction'][_0x727a('0x46')](_0x45f55f)['then'](function(_0x68a35d){return[_0x68a35d,!![]];});});}else{throw new Error(_0x727a('0x49'));}})[_0x727a('0x4a')](function(_0x19b340,_0x2bf86e){var _0xac62ad=_0x19b340[_0x727a('0x3e')]({'plain':!![]});if(_0x2bf86e){if(_0x414fbe[_0x727a('0x39')][_0x727a('0x4b')]){_0x414fbe[_0x727a('0x3f')][_0x727a('0x4c')]({'id':0x0,'priority':_0x414fbe[_0x727a('0x3f')][_0x727a('0x45')]+0x1,'app':_0x727a('0x4d'),'appdata':'unmanaged','interval':_0x727a('0x4e')});}_0xac62ad['created']=!![];}else{_0xac62ad[_0x727a('0x4f')]=![];}_0x414fbe[_0x727a('0x50')]=_0xac62ad;return db['FaxMessage'][_0x727a('0x46')]({'body':_0x405041[_0x727a('0x25')]['body'],'FaxAccountId':_0x405041[_0x727a('0x39')]['id'],'FaxInteractionId':_0x19b340['id'],'direction':'in','ContactId':_0x19b340['ContactId'],'AttachmentId':_0x405041[_0x727a('0x25')][_0x727a('0x51')]});})[_0x727a('0x10')](function(_0x6d303b){_0x414fbe['message']=_0x6d303b;if(_0x414fbe[_0x727a('0x50')][_0x727a('0x52')]){return db[_0x727a('0x53')][_0x727a('0x38')]({'attributes':['id',_0x727a('0x54')],'where':{'id':_0x414fbe[_0x727a('0x50')][_0x727a('0x52')]}})['then'](function(_0x3e88dd){if(_0x3e88dd){_0x414fbe[_0x727a('0x3f')][_0x727a('0x55')]({'id':0x0,'priority':0x0,'app':_0x727a('0x56'),'appdata':_0x3e88dd[_0x727a('0x54')]+','+(_0x414fbe[_0x727a('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x727a('0x4e')});}return respondWithRpcPromise(_0x727a('0x57'),'startRouting',_0x414fbe);});}return respondWithRpcPromise(_0x727a('0x57'),_0x727a('0x58'),_0x414fbe);})[_0x727a('0x10')](function(_0x583772){_0x75ff32(_0x583772);})[_0x727a('0x1a')](function(_0x491ac2){_0x5d0883(_0x325796[_0x727a('0x16')](0x1f4,_0x491ac2[_0x727a('0x18')]));});});};
\ No newline at end of file
+var _0xec31=['code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','attributes','map','model','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','orderBy','asc','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','unshift','agent','name','Start','startRouting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x2fd970,_0x30c7f0){var _0x50515f=function(_0x1c44dc){while(--_0x1c44dc){_0x2fd970['push'](_0x2fd970['shift']());}};_0x50515f(++_0x30c7f0);}(_0xec31,0x15f));var _0x1ec3=function(_0x3b392e,_0x1d3988){_0x3b392e=_0x3b392e-0x0;var _0x1c9d18=_0xec31[_0x3b392e];return _0x1c9d18;};'use strict';var _=require('lodash');var util=require(_0x1ec3('0x0'));var moment=require(_0x1ec3('0x1'));var BPromise=require(_0x1ec3('0x2'));var rs=require(_0x1ec3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ec3('0x4'))['db'];var utils=require(_0x1ec3('0x5'));var logger=require(_0x1ec3('0x6'))(_0x1ec3('0x7'));var config=require(_0x1ec3('0x8'));var jayson=require(_0x1ec3('0x9'));var client=jayson['client'][_0x1ec3('0xa')]({'port':0x232c});config[_0x1ec3('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1ec3('0xc'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x1ec3('0xd')](socket);function respondWithRpcPromise(_0x190821,_0x275ce1,_0x554118){return new BPromise(function(_0x4b29ba,_0x1c7d7d){return client[_0x1ec3('0xe')](_0x190821,_0x554118)[_0x1ec3('0xf')](function(_0x490531){logger[_0x1ec3('0x10')](_0x1ec3('0x11'),_0x275ce1,_0x1ec3('0x12'));logger[_0x1ec3('0x13')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x275ce1,'request\x20sent',JSON['stringify'](_0x490531));if(_0x490531[_0x1ec3('0x14')]){if(_0x490531[_0x1ec3('0x14')][_0x1ec3('0x15')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x275ce1,_0x490531[_0x1ec3('0x14')]['message']);return _0x1c7d7d(_0x490531['error'][_0x1ec3('0x16')]);}logger[_0x1ec3('0x14')](_0x1ec3('0x11'),_0x275ce1,_0x490531['error'][_0x1ec3('0x16')]);return _0x4b29ba(_0x490531[_0x1ec3('0x14')]['message']);}else{logger[_0x1ec3('0x10')](_0x1ec3('0x11'),_0x275ce1,'request\x20sent');_0x4b29ba(_0x490531[_0x1ec3('0x17')]['message']);}})[_0x1ec3('0x18')](function(_0x302085){logger['error'](_0x1ec3('0x11'),_0x275ce1,_0x302085);_0x1c7d7d(_0x302085);});});}exports[_0x1ec3('0x19')]=function(_0x57ec06){var _0x11df27=this;return new Promise(function(_0x329619,_0x2359a4){return db[_0x1ec3('0x1a')][_0x1ec3('0x1b')]({'raw':_0x57ec06['options']?_0x57ec06[_0x1ec3('0x1c')][_0x1ec3('0x1d')]===undefined?!![]:![]:!![],'where':_0x57ec06[_0x1ec3('0x1c')]?_0x57ec06[_0x1ec3('0x1c')][_0x1ec3('0x1e')]||null:null,'attributes':_0x57ec06[_0x1ec3('0x1c')]?_0x57ec06['options']['attributes']||null:null,'limit':_0x57ec06[_0x1ec3('0x1c')]?_0x57ec06[_0x1ec3('0x1c')][_0x1ec3('0x1f')]||null:null,'include':_0x57ec06[_0x1ec3('0x1c')]?_0x57ec06[_0x1ec3('0x1c')]['include']?_['map'](_0x57ec06[_0x1ec3('0x1c')][_0x1ec3('0x20')],function(_0x30ff1f){return{'model':db[_0x30ff1f['model']],'as':_0x30ff1f['as'],'attributes':_0x30ff1f[_0x1ec3('0x21')],'include':_0x30ff1f['include']?_[_0x1ec3('0x22')](_0x30ff1f['include'],function(_0x3ac5dc){return{'model':db[_0x3ac5dc['model']],'as':_0x3ac5dc['as'],'attributes':_0x3ac5dc['attributes'],'include':_0x3ac5dc['include']?_['map'](_0x3ac5dc[_0x1ec3('0x20')],function(_0x40b19a){return{'model':db[_0x40b19a[_0x1ec3('0x23')]],'as':_0x40b19a['as'],'attributes':_0x40b19a[_0x1ec3('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x466102){logger['info'](_0x1ec3('0x19'),_0x57ec06);logger['debug'](_0x1ec3('0x19'),_0x57ec06,JSON[_0x1ec3('0x24')](_0x466102));_0x329619(_0x466102);})[_0x1ec3('0x18')](function(_0x3c862d){logger[_0x1ec3('0x14')]('GetFaxAccount',_0x3c862d[_0x1ec3('0x16')],_0x57ec06);_0x2359a4(_0x11df27[_0x1ec3('0x14')](0x1f4,_0x3c862d['message']));});});};exports[_0x1ec3('0x25')]=function(_0x4a68a8,_0x406eb8,_0x25d57d){var _0x1f9d87=this;return new Promise(function(_0x3ba6b3,_0x4e83d1){var _0xbab0a1={'body':_0x4a68a8[_0x1ec3('0x26')],'channel':_0x1ec3('0x27')};var _0x4a2dff=[];var _0x7baddc=[];var _0x3c3ede={};return db[_0x1ec3('0x28')][_0x1ec3('0x29')]()['then'](function(_0x1270e2){if(!_0x1270e2){throw new db[(_0x1ec3('0x2a'))][(_0x1ec3('0x2b'))](_0x1ec3('0x2c'));}_0x4a2dff=_[_0x1ec3('0x2d')](_[_0x1ec3('0x2e')](_0x1270e2),['createdAt',_0x1ec3('0x2f')]);_0x7baddc=_[_0x1ec3('0x2d')](_['keys'](_0x1270e2),[_0x1ec3('0x30'),_0x1ec3('0x2f'),_0x1ec3('0x31'),_0x1ec3('0x32')]);if(_0x4a68a8[_0x1ec3('0x26')]['id']){delete _0x4a68a8[_0x1ec3('0x26')]['id'];}if(_[_0x1ec3('0x33')](_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x34')])){throw new db['Sequelize'][(_0x1ec3('0x2b'))](_0x1ec3('0x35'));}if(_[_0x1ec3('0x33')](_0x4a68a8[_0x1ec3('0x26')]['body'])||_0x4a68a8['body']['body']===''){throw new db[(_0x1ec3('0x2a'))][(_0x1ec3('0x2b'))](_0x1ec3('0x36'));}if(_[_0x1ec3('0x33')](_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x37')])){throw new db[(_0x1ec3('0x2a'))][(_0x1ec3('0x2b'))](_0x1ec3('0x38')+_0x7baddc);}if(!_[_0x1ec3('0x39')](_0x7baddc,_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x37')])){throw new db[(_0x1ec3('0x2a'))][(_0x1ec3('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7baddc);}_0x3c3ede[_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x37')]]=_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x34')];})['then'](function(){return db[_0x1ec3('0x1a')][_0x1ec3('0x3a')]({'where':{'id':_0x4a68a8['account']['id']},'include':[{'model':db[_0x1ec3('0x3b')],'as':_0x1ec3('0x3c'),'include':[{'model':db[_0x1ec3('0x28')],'as':_0x1ec3('0x3d'),'where':_0x3c3ede,'limit':0x1,'order':[[_0x1ec3('0x2f'),_0x1ec3('0x3e')]]}]},{'model':db[_0x1ec3('0x3f')],'as':_0x1ec3('0x40')}]});})[_0x1ec3('0xf')](function(_0x202196){if(_0x202196&&_0x202196['List']){var _0x1fecc5=_0x202196[_0x1ec3('0x41')]({'plain':!![]});_0xbab0a1[_0x1ec3('0x42')]=_0x1fecc5;_0xbab0a1[_0x1ec3('0x43')]=_0x1fecc5[_0x1ec3('0x40')];_0xbab0a1[_0x1ec3('0x44')]=_0x1fecc5['List'];_0xbab0a1[_0x1ec3('0x43')]=_[_0x1ec3('0x45')](_0xbab0a1[_0x1ec3('0x43')],['priority'],[_0x1ec3('0x46')]);if(_0xbab0a1['account'][_0x1ec3('0x40')]){delete _0xbab0a1[_0x1ec3('0x42')][_0x1ec3('0x40')];}if(_0xbab0a1[_0x1ec3('0x42')]['List']&&_0xbab0a1[_0x1ec3('0x42')][_0x1ec3('0x3c')][_0x1ec3('0x3d')][_0x1ec3('0x47')]){return _0xbab0a1[_0x1ec3('0x42')]['List'][_0x1ec3('0x3d')][0x0];}var _0x1284a9=_[_0x1ec3('0x48')](_0x4a68a8['body'],{'firstName':_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x34')],'ListId':_0x1fecc5[_0x1ec3('0x32')]});_0x1284a9[_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x37')]]=_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x34')];return db[_0x1ec3('0x28')][_0x1ec3('0x49')](_0x1284a9,{'fields':_0x4a2dff,'raw':!![]});}})[_0x1ec3('0xf')](function(_0x180467){_0xbab0a1[_0x1ec3('0x4a')]=_0x180467;if(_0x180467){var _0x27057c={'ContactId':_0x180467['id'],'FaxAccountId':_0x4a68a8[_0x1ec3('0x42')]['id'],'fax':_0x180467[_0x1ec3('0x27')]};return db['FaxInteraction'][_0x1ec3('0x3a')]({'where':{'ContactId':_0x180467['id'],'closed':![],'FaxAccountId':_0x4a68a8[_0x1ec3('0x42')]['id']}})[_0x1ec3('0xf')](function(_0x4cacc6){if(_0x4cacc6){return[_0x4cacc6,![]];}return db[_0x1ec3('0x4b')][_0x1ec3('0x49')](_0x27057c)[_0x1ec3('0xf')](function(_0x31df4b){return[_0x31df4b,!![]];});});}else{throw new Error(_0x1ec3('0x4c'));}})['spread'](function(_0xa06987,_0x403457){var _0x341225=_0xa06987[_0x1ec3('0x41')]({'plain':!![]});if(_0x403457){if(_0xbab0a1[_0x1ec3('0x42')]['autoclose']){_0xbab0a1[_0x1ec3('0x43')][_0x1ec3('0x4d')]({'id':0x0,'priority':_0xbab0a1[_0x1ec3('0x43')][_0x1ec3('0x47')]+0x1,'app':_0x1ec3('0x4e'),'appdata':_0x1ec3('0x4f'),'interval':_0x1ec3('0x50')});}_0x341225[_0x1ec3('0x51')]=!![];}else{_0x341225[_0x1ec3('0x51')]=![];}_0xbab0a1['interaction']=_0x341225;return db[_0x1ec3('0x52')][_0x1ec3('0x49')]({'body':_0x4a68a8['body'][_0x1ec3('0x26')],'FaxAccountId':_0x4a68a8['account']['id'],'FaxInteractionId':_0xa06987['id'],'direction':'in','ContactId':_0xa06987[_0x1ec3('0x53')],'AttachmentId':_0x4a68a8[_0x1ec3('0x26')][_0x1ec3('0x54')]});})[_0x1ec3('0xf')](function(_0xbcfac5){_0xbab0a1[_0x1ec3('0x16')]=_0xbcfac5;if(_0xbab0a1[_0x1ec3('0x55')][_0x1ec3('0x56')]){return db[_0x1ec3('0x57')][_0x1ec3('0x3a')]({'attributes':['id','name'],'where':{'id':_0xbab0a1['interaction']['UserId']}})[_0x1ec3('0xf')](function(_0x468abb){if(_0x468abb){_0xbab0a1['applications'][_0x1ec3('0x58')]({'id':0x0,'priority':0x0,'app':_0x1ec3('0x59'),'appdata':_0x468abb[_0x1ec3('0x5a')]+','+(_0xbab0a1[_0x1ec3('0x42')]['waitForTheAssignedAgent']||0xa),'interval':_0x1ec3('0x50')});}return respondWithRpcPromise(_0x1ec3('0x5b'),_0x1ec3('0x5c'),_0xbab0a1);});}return respondWithRpcPromise(_0x1ec3('0x5b'),'startRouting',_0xbab0a1);})['then'](function(_0x342f62){_0x3ba6b3(_0x342f62);})[_0x1ec3('0x18')](function(_0x385a40){_0x4e83d1(_0x1f9d87[_0x1ec3('0x14')](0x1f4,_0x385a40['message']));});});};
\ No newline at end of file
index 21f1183..328fa2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb59f=['remove','update','removeListener','register','length','./faxAccount.events','save'];(function(_0x540fd6,_0x3ce8dc){var _0x47754b=function(_0x426c70){while(--_0x426c70){_0x540fd6['push'](_0x540fd6['shift']());}};_0x47754b(++_0x3ce8dc);}(_0xb59f,0x1be));var _0xfb59=function(_0x1977c2,_0x24a968){_0x1977c2=_0x1977c2-0x0;var _0x35ef0f=_0xb59f[_0x1977c2];return _0x35ef0f;};'use strict';var FaxAccountEvents=require(_0xfb59('0x0'));var events=[_0xfb59('0x1'),_0xfb59('0x2'),_0xfb59('0x3')];function createListener(_0x2af01a,_0x572919){return function(_0x2ac822){_0x572919['emit'](_0x2af01a,_0x2ac822);};}function removeListener(_0x43d956,_0x2adc58){return function(){FaxAccountEvents[_0xfb59('0x4')](_0x43d956,_0x2adc58);};}exports[_0xfb59('0x5')]=function(_0x2a1cd0){for(var _0x134fe3=0x0,_0x2009c5=events[_0xfb59('0x6')];_0x134fe3<_0x2009c5;_0x134fe3++){var _0x483738=events[_0x134fe3];var _0x506e99=createListener('faxAccount:'+_0x483738,_0x2a1cd0);FaxAccountEvents['on'](_0x483738,_0x506e99);}};
\ No newline at end of file
+var _0x9853=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x3d9c35,_0x37a37f){var _0x5e0d82=function(_0x328812){while(--_0x328812){_0x3d9c35['push'](_0x3d9c35['shift']());}};_0x5e0d82(++_0x37a37f);}(_0x9853,0x1c1));var _0x3985=function(_0x3055ab,_0x4d1f74){_0x3055ab=_0x3055ab-0x0;var _0x31d336=_0x9853[_0x3055ab];return _0x31d336;};'use strict';var FaxAccountEvents=require(_0x3985('0x0'));var events=[_0x3985('0x1'),_0x3985('0x2'),_0x3985('0x3')];function createListener(_0x2886bf,_0x13723b){return function(_0x23f893){_0x13723b[_0x3985('0x4')](_0x2886bf,_0x23f893);};}function removeListener(_0x327b4f,_0x215894){return function(){FaxAccountEvents[_0x3985('0x5')](_0x327b4f,_0x215894);};}exports[_0x3985('0x6')]=function(_0x4dc119){for(var _0x42f95b=0x0,_0x28087f=events[_0x3985('0x7')];_0x42f95b<_0x28087f;_0x42f95b++){var _0x2ccb84=events[_0x42f95b];var _0x38f43d=createListener(_0x3985('0x8')+_0x2ccb84,_0x4dc119);FaxAccountEvents['on'](_0x2ccb84,_0x38f43d);}};
\ No newline at end of file
index 487adcc..855008b 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(_0x3c0ccd,_0x1e1335){var _0x23231c=function(_0x38d8e6){while(--_0x38d8e6){_0x3c0ccd['push'](_0x3c0ccd['shift']());}};_0x23231c(++_0x1e1335);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0xecb44f,_0x28a46b){var _0x3c4894=function(_0x413446){while(--_0x413446){_0xecb44f['push'](_0xecb44f['shift']());}};_0x3c4894(++_0x28a46b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 80fc6f6..6983a48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c1=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x19c1,0x6d));var _0x119c=function(_0x73ad24,_0x5b14b1){_0x73ad24=_0x73ad24-0x0;var _0x4cd51f=_0x19c1[_0x73ad24];return _0x4cd51f;};'use strict';var Sequelize=require(_0x119c('0x0'));module[_0x119c('0x1')]={'priority':{'type':Sequelize[_0x119c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x119c('0x3')],'allowNull':![],'defaultValue':_0x119c('0x4')},'appdata':{'type':Sequelize[_0x119c('0x5')]()},'description':{'type':Sequelize[_0x119c('0x3')]},'interval':{'type':Sequelize[_0x119c('0x3')],'defaultValue':_0x119c('0x6')}};
\ No newline at end of file
+var _0x1d4d=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x54c6fe,_0x2577ce){var _0x305c86=function(_0x34893f){while(--_0x34893f){_0x54c6fe['push'](_0x54c6fe['shift']());}};_0x305c86(++_0x2577ce);}(_0x1d4d,0xf1));var _0xd1d4=function(_0x1b20b2,_0x5fe1b8){_0x1b20b2=_0x1b20b2-0x0;var _0xa5c233=_0x1d4d[_0x1b20b2];return _0xa5c233;};'use strict';var Sequelize=require(_0xd1d4('0x0'));module[_0xd1d4('0x1')]={'priority':{'type':Sequelize[_0xd1d4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd1d4('0x3')],'allowNull':![],'defaultValue':_0xd1d4('0x4')},'appdata':{'type':Sequelize[_0xd1d4('0x5')]()},'description':{'type':Sequelize[_0xd1d4('0x3')]},'interval':{'type':Sequelize[_0xd1d4('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 47e811a..7c0231a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeef9=['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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0xeef9,0x123));var _0x9eef=function(_0x470711,_0x415ae0){_0x470711=_0x470711-0x0;var _0x33b3aa=_0xeef9[_0x470711];return _0x33b3aa;};'use strict';var emlformat=require(_0x9eef('0x0'));var rimraf=require(_0x9eef('0x1'));var zipdir=require(_0x9eef('0x2'));var jsonpatch=require(_0x9eef('0x3'));var rp=require(_0x9eef('0x4'));var moment=require('moment');var BPromise=require(_0x9eef('0x5'));var Mustache=require(_0x9eef('0x6'));var util=require(_0x9eef('0x7'));var path=require(_0x9eef('0x8'));var sox=require(_0x9eef('0x9'));var csv=require(_0x9eef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9eef('0xb'));var crypto=require(_0x9eef('0xc'));var jsforce=require(_0x9eef('0xd'));var deskjs=require(_0x9eef('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9eef('0xf'));var Papa=require(_0x9eef('0x10'));var Redis=require('ioredis');var authService=require(_0x9eef('0x11'));var qs=require(_0x9eef('0x12'));var as=require(_0x9eef('0x13'));var hardwareService=require(_0x9eef('0x14'));var logger=require('../../config/logger')(_0x9eef('0x15'));var utils=require(_0x9eef('0x16'));var config=require(_0x9eef('0x17'));var licenseUtil=require(_0x9eef('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35f72f,_0x44e53b){_0x44e53b=_0x44e53b||0xcc;return function(_0x427071){if(_0x427071){return _0x35f72f['sendStatus'](_0x44e53b);}return _0x35f72f['status'](_0x44e53b)[_0x9eef('0x19')]();};}function respondWithResult(_0x4f0163,_0x3c68ed){_0x3c68ed=_0x3c68ed||0xc8;return function(_0x1bfcc9){if(_0x1bfcc9){return _0x4f0163[_0x9eef('0x1a')](_0x3c68ed)[_0x9eef('0x1b')](_0x1bfcc9);}};}function respondWithFilteredResult(_0x5ae7cc,_0x1ba937){return function(_0x3e2999){if(_0x3e2999){var _0x41b7bb=typeof _0x1ba937[_0x9eef('0x1c')]===_0x9eef('0x1d')&&typeof _0x1ba937[_0x9eef('0x1e')]===_0x9eef('0x1d');var _0x27b2d4=_0x3e2999[_0x9eef('0x1f')];var _0x2ca8d3=_0x41b7bb?0x0:_0x1ba937[_0x9eef('0x1c')];var _0x4f7d9b=_0x41b7bb?_0x3e2999[_0x9eef('0x1f')]:_0x1ba937[_0x9eef('0x1c')]+_0x1ba937['limit'];var _0x39fdcb;if(_0x4f7d9b>=_0x27b2d4){_0x4f7d9b=_0x27b2d4;_0x39fdcb=0xc8;}else{_0x39fdcb=0xce;}_0x5ae7cc[_0x9eef('0x1a')](_0x39fdcb);return _0x5ae7cc[_0x9eef('0x20')](_0x9eef('0x21'),_0x2ca8d3+'-'+_0x4f7d9b+'/'+_0x27b2d4)[_0x9eef('0x1b')](_0x3e2999);}return null;};}function patchUpdates(_0x142fcc){return function(_0x1f4096){try{jsonpatch[_0x9eef('0x22')](_0x1f4096,_0x142fcc,!![]);}catch(_0x34752c){return BPromise[_0x9eef('0x23')](_0x34752c);}return _0x1f4096[_0x9eef('0x24')]();};}function saveUpdates(_0xddcbe,_0x4a1ea6){return function(_0x10cc1e){if(_0x10cc1e){return _0x10cc1e[_0x9eef('0x25')](_0xddcbe)['then'](function(_0x3059a3){return _0x3059a3;});}return null;};}function removeEntity(_0x5521b0,_0x58bb15){return function(_0xc511ba){if(_0xc511ba){return _0xc511ba['destroy']()[_0x9eef('0x26')](function(){_0x5521b0['status'](0xcc)[_0x9eef('0x19')]();});}};}function handleEntityNotFound(_0x419bdf,_0x404e8a){return function(_0x1ab704){if(!_0x1ab704){_0x419bdf['sendStatus'](0x194);}return _0x1ab704;};}function handleError(_0x276903,_0x422fb7){_0x422fb7=_0x422fb7||0x1f4;return function(_0x46b591){logger[_0x9eef('0x27')](_0x46b591[_0x9eef('0x28')]);if(_0x46b591[_0x9eef('0x29')]){delete _0x46b591[_0x9eef('0x29')];}_0x276903[_0x9eef('0x1a')](_0x422fb7)[_0x9eef('0x2a')](_0x46b591);};}exports['index']=function(_0x266ce3,_0x374962){var _0x5df6bb={},_0x34fa58={},_0x5ba94f={'count':0x0,'rows':[]};var _0x3b1451=_[_0x9eef('0x2b')](db[_0x9eef('0x2c')][_0x9eef('0x2d')],function(_0x21705e){return{'name':_0x21705e[_0x9eef('0x2e')],'type':_0x21705e[_0x9eef('0x2f')][_0x9eef('0x30')]};});_0x34fa58[_0x9eef('0x31')]=_[_0x9eef('0x2b')](_0x3b1451,_0x9eef('0x29'));_0x34fa58[_0x9eef('0x32')]=_['keys'](_0x266ce3['query']);_0x34fa58['filters']=_[_0x9eef('0x33')](_0x34fa58['model'],_0x34fa58['query']);_0x5df6bb[_0x9eef('0x34')]=_[_0x9eef('0x33')](_0x34fa58[_0x9eef('0x31')],qs[_0x9eef('0x35')](_0x266ce3['query'][_0x9eef('0x35')]));_0x5df6bb[_0x9eef('0x34')]=_0x5df6bb['attributes']['length']?_0x5df6bb['attributes']:_0x34fa58[_0x9eef('0x31')];if(!_0x266ce3[_0x9eef('0x32')][_0x9eef('0x36')](_0x9eef('0x37'))){_0x5df6bb[_0x9eef('0x1e')]=qs[_0x9eef('0x1e')](_0x266ce3['query']['limit']);_0x5df6bb[_0x9eef('0x1c')]=qs[_0x9eef('0x1c')](_0x266ce3[_0x9eef('0x32')][_0x9eef('0x1c')]);}_0x5df6bb[_0x9eef('0x38')]=qs[_0x9eef('0x39')](_0x266ce3['query'][_0x9eef('0x39')]);_0x5df6bb[_0x9eef('0x3a')]=qs[_0x9eef('0x3b')](_[_0x9eef('0x3c')](_0x266ce3[_0x9eef('0x32')],_0x34fa58[_0x9eef('0x3b')]),_0x3b1451);if(_0x266ce3[_0x9eef('0x32')][_0x9eef('0x3d')]){_0x5df6bb[_0x9eef('0x3a')]=_['merge'](_0x5df6bb[_0x9eef('0x3a')],{'$or':_[_0x9eef('0x2b')](_0x3b1451,function(_0x422782){if(_0x422782[_0x9eef('0x2f')]!==_0x9eef('0x3e')){var _0x15a1c9={};_0x15a1c9[_0x422782[_0x9eef('0x29')]]={'$like':'%'+_0x266ce3[_0x9eef('0x32')][_0x9eef('0x3d')]+'%'};return _0x15a1c9;}})});}_0x5df6bb=_[_0x9eef('0x3f')]({},_0x5df6bb,_0x266ce3[_0x9eef('0x40')]);var _0x304388={'where':_0x5df6bb['where']};return db['FaxApplication'][_0x9eef('0x1f')](_0x304388)[_0x9eef('0x26')](function(_0x4e72eb){_0x5ba94f[_0x9eef('0x1f')]=_0x4e72eb;if(_0x266ce3[_0x9eef('0x32')][_0x9eef('0x41')]){_0x5df6bb[_0x9eef('0x42')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x5df6bb);})[_0x9eef('0x26')](function(_0x3cf0e5){_0x5ba94f['rows']=_0x3cf0e5;return _0x5ba94f;})['then'](respondWithFilteredResult(_0x374962,_0x5df6bb))[_0x9eef('0x43')](handleError(_0x374962,null));};exports[_0x9eef('0x44')]=function(_0x3ddbf3,_0x1ee98e){var _0x5a5f08={'raw':!![],'where':{'id':_0x3ddbf3[_0x9eef('0x45')]['id']}},_0x28a7d3={};_0x28a7d3[_0x9eef('0x31')]=_['keys'](db[_0x9eef('0x2c')][_0x9eef('0x2d')]);_0x28a7d3[_0x9eef('0x32')]=_[_0x9eef('0x46')](_0x3ddbf3[_0x9eef('0x32')]);_0x28a7d3[_0x9eef('0x3b')]=_[_0x9eef('0x33')](_0x28a7d3[_0x9eef('0x31')],_0x28a7d3['query']);_0x5a5f08['attributes']=_[_0x9eef('0x33')](_0x28a7d3[_0x9eef('0x31')],qs[_0x9eef('0x35')](_0x3ddbf3[_0x9eef('0x32')]['fields']));_0x5a5f08['attributes']=_0x5a5f08[_0x9eef('0x34')][_0x9eef('0x47')]?_0x5a5f08[_0x9eef('0x34')]:_0x28a7d3[_0x9eef('0x31')];if(_0x3ddbf3[_0x9eef('0x32')]['includeAll']){_0x5a5f08['include']=[{'all':!![]}];}_0x5a5f08=_[_0x9eef('0x3f')]({},_0x5a5f08,_0x3ddbf3['options']);return db[_0x9eef('0x2c')][_0x9eef('0x48')](_0x5a5f08)[_0x9eef('0x26')](handleEntityNotFound(_0x1ee98e,null))['then'](respondWithResult(_0x1ee98e,null))[_0x9eef('0x43')](handleError(_0x1ee98e,null));};exports[_0x9eef('0x49')]=function(_0x5465d3,_0x44923c){return db[_0x9eef('0x2c')][_0x9eef('0x49')](_0x5465d3[_0x9eef('0x4a')],{})[_0x9eef('0x26')](respondWithResult(_0x44923c,0xc9))[_0x9eef('0x43')](handleError(_0x44923c,null));};exports['update']=function(_0x89412f,_0x3eac6d){if(_0x89412f['body']['id']){delete _0x89412f['body']['id'];}return db[_0x9eef('0x2c')][_0x9eef('0x48')]({'where':{'id':_0x89412f[_0x9eef('0x45')]['id']}})[_0x9eef('0x26')](handleEntityNotFound(_0x3eac6d,null))[_0x9eef('0x26')](saveUpdates(_0x89412f[_0x9eef('0x4a')],null))[_0x9eef('0x26')](respondWithResult(_0x3eac6d,null))['catch'](handleError(_0x3eac6d,null));};exports[_0x9eef('0x4b')]=function(_0x42dedf,_0x253c1d){return db[_0x9eef('0x2c')]['find']({'where':{'id':_0x42dedf[_0x9eef('0x45')]['id']}})['then'](handleEntityNotFound(_0x253c1d,null))[_0x9eef('0x26')](removeEntity(_0x253c1d,null))[_0x9eef('0x43')](handleError(_0x253c1d,null));};
\ No newline at end of file
+var _0x78dd=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','stack','send','map','FaxApplication','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x78dd,0xc9));var _0xd78d=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x78dd[_0x119cd8];return _0x7072a3;};'use strict';var emlformat=require(_0xd78d('0x0'));var rimraf=require(_0xd78d('0x1'));var zipdir=require(_0xd78d('0x2'));var jsonpatch=require(_0xd78d('0x3'));var rp=require(_0xd78d('0x4'));var moment=require('moment');var BPromise=require(_0xd78d('0x5'));var Mustache=require('mustache');var util=require(_0xd78d('0x6'));var path=require(_0xd78d('0x7'));var sox=require(_0xd78d('0x8'));var csv=require(_0xd78d('0x9'));var ejs=require(_0xd78d('0xa'));var fs=require('fs');var fs_extra=require(_0xd78d('0xb'));var _=require(_0xd78d('0xc'));var squel=require(_0xd78d('0xd'));var crypto=require(_0xd78d('0xe'));var jsforce=require(_0xd78d('0xf'));var deskjs=require(_0xd78d('0x10'));var toCsv=require(_0xd78d('0x9'));var querystring=require(_0xd78d('0x11'));var Papa=require(_0xd78d('0x12'));var Redis=require(_0xd78d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd78d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd78d('0x15'));var logger=require('../../config/logger')(_0xd78d('0x16'));var utils=require(_0xd78d('0x17'));var config=require(_0xd78d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd78d('0x19'))['db'];function respondWithStatusCode(_0xff2ca3,_0x532a43){_0x532a43=_0x532a43||0xcc;return function(_0x194618){if(_0x194618){return _0xff2ca3[_0xd78d('0x1a')](_0x532a43);}return _0xff2ca3[_0xd78d('0x1b')](_0x532a43)[_0xd78d('0x1c')]();};}function respondWithResult(_0x4e5592,_0x125ec6){_0x125ec6=_0x125ec6||0xc8;return function(_0x313214){if(_0x313214){return _0x4e5592[_0xd78d('0x1b')](_0x125ec6)[_0xd78d('0x1d')](_0x313214);}};}function respondWithFilteredResult(_0x4c3cbe,_0x7735e1){return function(_0x462aee){if(_0x462aee){var _0x1f02a4=typeof _0x7735e1[_0xd78d('0x1e')]==='undefined'&&typeof _0x7735e1[_0xd78d('0x1f')]===_0xd78d('0x20');var _0x576e3a=_0x462aee['count'];var _0x3c6ac8=_0x1f02a4?0x0:_0x7735e1[_0xd78d('0x1e')];var _0x2b5af0=_0x1f02a4?_0x462aee[_0xd78d('0x21')]:_0x7735e1[_0xd78d('0x1e')]+_0x7735e1[_0xd78d('0x1f')];var _0x1bab26;if(_0x2b5af0>=_0x576e3a){_0x2b5af0=_0x576e3a;_0x1bab26=0xc8;}else{_0x1bab26=0xce;}_0x4c3cbe[_0xd78d('0x1b')](_0x1bab26);return _0x4c3cbe['set']('Content-Range',_0x3c6ac8+'-'+_0x2b5af0+'/'+_0x576e3a)[_0xd78d('0x1d')](_0x462aee);}return null;};}function patchUpdates(_0xf9bd96){return function(_0x53590c){try{jsonpatch[_0xd78d('0x22')](_0x53590c,_0xf9bd96,!![]);}catch(_0x333e85){return BPromise[_0xd78d('0x23')](_0x333e85);}return _0x53590c[_0xd78d('0x24')]();};}function saveUpdates(_0x38e0eb,_0x4c6164){return function(_0x82f7d){if(_0x82f7d){return _0x82f7d[_0xd78d('0x25')](_0x38e0eb)[_0xd78d('0x26')](function(_0x4e70d2){return _0x4e70d2;});}return null;};}function removeEntity(_0x3840cd,_0x2ce50c){return function(_0x28c844){if(_0x28c844){return _0x28c844[_0xd78d('0x27')]()[_0xd78d('0x26')](function(){_0x3840cd[_0xd78d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x572097,_0x3d52af){return function(_0x4e3a6e){if(!_0x4e3a6e){_0x572097[_0xd78d('0x1a')](0x194);}return _0x4e3a6e;};}function handleError(_0x8f1443,_0xd61c8b){_0xd61c8b=_0xd61c8b||0x1f4;return function(_0x319f51){logger[_0xd78d('0x28')](_0x319f51[_0xd78d('0x29')]);if(_0x319f51['name']){delete _0x319f51['name'];}_0x8f1443['status'](_0xd61c8b)[_0xd78d('0x2a')](_0x319f51);};}exports['index']=function(_0xf17aa0,_0x2b2b18){var _0x17c6b1={},_0x4da07e={},_0x194766={'count':0x0,'rows':[]};var _0x1f0745=_[_0xd78d('0x2b')](db[_0xd78d('0x2c')][_0xd78d('0x2d')],function(_0x1fbe31){return{'name':_0x1fbe31['fieldName'],'type':_0x1fbe31[_0xd78d('0x2e')][_0xd78d('0x2f')]};});_0x4da07e[_0xd78d('0x30')]=_[_0xd78d('0x2b')](_0x1f0745,_0xd78d('0x31'));_0x4da07e[_0xd78d('0x32')]=_[_0xd78d('0x33')](_0xf17aa0[_0xd78d('0x32')]);_0x4da07e[_0xd78d('0x34')]=_[_0xd78d('0x35')](_0x4da07e[_0xd78d('0x30')],_0x4da07e[_0xd78d('0x32')]);_0x17c6b1[_0xd78d('0x36')]=_[_0xd78d('0x35')](_0x4da07e[_0xd78d('0x30')],qs[_0xd78d('0x37')](_0xf17aa0[_0xd78d('0x32')][_0xd78d('0x37')]));_0x17c6b1[_0xd78d('0x36')]=_0x17c6b1['attributes'][_0xd78d('0x38')]?_0x17c6b1['attributes']:_0x4da07e['model'];if(!_0xf17aa0[_0xd78d('0x32')][_0xd78d('0x39')](_0xd78d('0x3a'))){_0x17c6b1[_0xd78d('0x1f')]=qs['limit'](_0xf17aa0[_0xd78d('0x32')][_0xd78d('0x1f')]);_0x17c6b1['offset']=qs[_0xd78d('0x1e')](_0xf17aa0[_0xd78d('0x32')][_0xd78d('0x1e')]);}_0x17c6b1[_0xd78d('0x3b')]=qs[_0xd78d('0x3c')](_0xf17aa0['query']['sort']);_0x17c6b1[_0xd78d('0x3d')]=qs[_0xd78d('0x34')](_[_0xd78d('0x3e')](_0xf17aa0['query'],_0x4da07e[_0xd78d('0x34')]),_0x1f0745);if(_0xf17aa0[_0xd78d('0x32')]['filter']){_0x17c6b1[_0xd78d('0x3d')]=_[_0xd78d('0x3f')](_0x17c6b1[_0xd78d('0x3d')],{'$or':_[_0xd78d('0x2b')](_0x1f0745,function(_0x496188){if(_0x496188['type']!==_0xd78d('0x40')){var _0x3adedf={};_0x3adedf[_0x496188[_0xd78d('0x31')]]={'$like':'%'+_0xf17aa0['query'][_0xd78d('0x41')]+'%'};return _0x3adedf;}})});}_0x17c6b1=_['merge']({},_0x17c6b1,_0xf17aa0['options']);var _0x34ee00={'where':_0x17c6b1[_0xd78d('0x3d')]};return db[_0xd78d('0x2c')][_0xd78d('0x21')](_0x34ee00)['then'](function(_0x1db9c3){_0x194766[_0xd78d('0x21')]=_0x1db9c3;if(_0xf17aa0[_0xd78d('0x32')][_0xd78d('0x42')]){_0x17c6b1[_0xd78d('0x43')]=[{'all':!![]}];}return db[_0xd78d('0x2c')]['findAll'](_0x17c6b1);})[_0xd78d('0x26')](function(_0x46e3fd){_0x194766[_0xd78d('0x44')]=_0x46e3fd;return _0x194766;})[_0xd78d('0x26')](respondWithFilteredResult(_0x2b2b18,_0x17c6b1))['catch'](handleError(_0x2b2b18,null));};exports[_0xd78d('0x45')]=function(_0x574e31,_0x4d38e0){var _0xb2c031={'raw':!![],'where':{'id':_0x574e31[_0xd78d('0x46')]['id']}},_0x30b7c2={};_0x30b7c2[_0xd78d('0x30')]=_['keys'](db[_0xd78d('0x2c')][_0xd78d('0x2d')]);_0x30b7c2[_0xd78d('0x32')]=_[_0xd78d('0x33')](_0x574e31[_0xd78d('0x32')]);_0x30b7c2[_0xd78d('0x34')]=_[_0xd78d('0x35')](_0x30b7c2[_0xd78d('0x30')],_0x30b7c2[_0xd78d('0x32')]);_0xb2c031[_0xd78d('0x36')]=_['intersection'](_0x30b7c2['model'],qs[_0xd78d('0x37')](_0x574e31['query'][_0xd78d('0x37')]));_0xb2c031[_0xd78d('0x36')]=_0xb2c031['attributes'][_0xd78d('0x38')]?_0xb2c031['attributes']:_0x30b7c2[_0xd78d('0x30')];if(_0x574e31[_0xd78d('0x32')][_0xd78d('0x42')]){_0xb2c031[_0xd78d('0x43')]=[{'all':!![]}];}_0xb2c031=_['merge']({},_0xb2c031,_0x574e31['options']);return db['FaxApplication'][_0xd78d('0x47')](_0xb2c031)[_0xd78d('0x26')](handleEntityNotFound(_0x4d38e0,null))[_0xd78d('0x26')](respondWithResult(_0x4d38e0,null))[_0xd78d('0x48')](handleError(_0x4d38e0,null));};exports[_0xd78d('0x49')]=function(_0x23823e,_0x2fa78d){return db[_0xd78d('0x2c')][_0xd78d('0x49')](_0x23823e[_0xd78d('0x4a')],{})[_0xd78d('0x26')](respondWithResult(_0x2fa78d,0xc9))[_0xd78d('0x48')](handleError(_0x2fa78d,null));};exports[_0xd78d('0x25')]=function(_0x538263,_0x3fe780){if(_0x538263[_0xd78d('0x4a')]['id']){delete _0x538263['body']['id'];}return db['FaxApplication']['find']({'where':{'id':_0x538263[_0xd78d('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fe780,null))[_0xd78d('0x26')](saveUpdates(_0x538263[_0xd78d('0x4a')],null))[_0xd78d('0x26')](respondWithResult(_0x3fe780,null))['catch'](handleError(_0x3fe780,null));};exports[_0xd78d('0x27')]=function(_0x46afc3,_0x59f730){return db[_0xd78d('0x2c')][_0xd78d('0x47')]({'where':{'id':_0x46afc3[_0xd78d('0x46')]['id']}})['then'](handleEntityNotFound(_0x59f730,null))[_0xd78d('0x26')](removeEntity(_0x59f730,null))[_0xd78d('0x48')](handleError(_0x59f730,null));};
\ No newline at end of file
index aef972b..9d19d9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd951=['define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0xa4bab0,_0x3c896e){var _0x288012=function(_0xc22fcb){while(--_0xc22fcb){_0xa4bab0['push'](_0xa4bab0['shift']());}};_0x288012(++_0x3c896e);}(_0xd951,0x190));var _0x1d95=function(_0x231796,_0x370568){_0x231796=_0x231796-0x0;var _0x19c74f=_0xd951[_0x231796];return _0x19c74f;};'use strict';var _=require(_0x1d95('0x0'));var util=require(_0x1d95('0x1'));var logger=require('../../config/logger')(_0x1d95('0x2'));var moment=require(_0x1d95('0x3'));var BPromise=require('bluebird');var rp=require(_0x1d95('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d95('0x5'));var config=require(_0x1d95('0x6'));var attributes=require(_0x1d95('0x7'));module['exports']=function(_0x3bbbe7,_0x549158){return _0x3bbbe7[_0x1d95('0x8')](_0x1d95('0x9'),attributes,{'tableName':_0x1d95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1d95('0xb')});};
\ No newline at end of file
+var _0x6356=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0x2a9e15,_0xfe65b1){var _0x528516=function(_0xfaa4b4){while(--_0xfaa4b4){_0x2a9e15['push'](_0x2a9e15['shift']());}};_0x528516(++_0xfe65b1);}(_0x6356,0xd7));var _0x6635=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x6356[_0x2389bc];return _0x170548;};'use strict';var _=require(_0x6635('0x0'));var util=require(_0x6635('0x1'));var logger=require(_0x6635('0x2'))(_0x6635('0x3'));var moment=require(_0x6635('0x4'));var BPromise=require('bluebird');var rp=require(_0x6635('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6635('0x6'));var config=require(_0x6635('0x7'));var attributes=require(_0x6635('0x8'));module['exports']=function(_0x556d54,_0x33d8c1){return _0x556d54[_0x6635('0x9')](_0x6635('0xa'),attributes,{'tableName':_0x6635('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6635('0xc'),'collate':_0x6635('0xd')});};
\ No newline at end of file
index 46d5970..12734c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0706=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','limit','util','moment','bluebird','ioredis'];(function(_0x5994c3,_0x475671){var _0x170776=function(_0x168f69){while(--_0x168f69){_0x5994c3['push'](_0x5994c3['shift']());}};_0x170776(++_0x475671);}(_0x0706,0x1dc));var _0x6070=function(_0x405e76,_0x3d1fae){_0x405e76=_0x405e76-0x0;var _0x29490e=_0x0706[_0x405e76];return _0x29490e;};'use strict';var _=require('lodash');var util=require(_0x6070('0x0'));var moment=require(_0x6070('0x1'));var BPromise=require(_0x6070('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6070('0x3'));var db=require(_0x6070('0x4'))['db'];var utils=require(_0x6070('0x5'));var logger=require(_0x6070('0x6'))(_0x6070('0x7'));var config=require(_0x6070('0x8'));var jayson=require(_0x6070('0x9'));var client=jayson[_0x6070('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5abd06,_0x86ec15,_0x59d5da){return new BPromise(function(_0x53fcd9,_0x2134f5){return client['request'](_0x5abd06,_0x59d5da)[_0x6070('0xb')](function(_0x274731){logger[_0x6070('0xc')](_0x6070('0xd'),_0x86ec15,_0x6070('0xe'));logger[_0x6070('0xf')](_0x6070('0x10'),_0x86ec15,_0x6070('0xe'),JSON[_0x6070('0x11')](_0x274731));if(_0x274731[_0x6070('0x12')]){if(_0x274731[_0x6070('0x12')][_0x6070('0x13')]===0x1f4){logger['error'](_0x6070('0xd'),_0x86ec15,_0x274731[_0x6070('0x12')]['message']);return _0x2134f5(_0x274731[_0x6070('0x12')][_0x6070('0x14')]);}logger[_0x6070('0x12')](_0x6070('0xd'),_0x86ec15,_0x274731[_0x6070('0x12')][_0x6070('0x14')]);return _0x53fcd9(_0x274731[_0x6070('0x12')][_0x6070('0x14')]);}else{logger[_0x6070('0xc')](_0x6070('0xd'),_0x86ec15,'request\x20sent');_0x53fcd9(_0x274731[_0x6070('0x15')][_0x6070('0x14')]);}})[_0x6070('0x16')](function(_0x4e5c28){logger[_0x6070('0x12')]('FaxApplication,\x20%s,\x20%s',_0x86ec15,_0x4e5c28);_0x2134f5(_0x4e5c28);});});}exports[_0x6070('0x17')]=function(_0xad8159){var _0x596545=this;return new Promise(function(_0xdeb3c7,_0x340458){return db['FaxApplication'][_0x6070('0x18')](_0xad8159[_0x6070('0x19')],{'raw':_0xad8159[_0x6070('0x1a')]?_0xad8159[_0x6070('0x1a')][_0x6070('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xad8159['options']?_0xad8159[_0x6070('0x1a')][_0x6070('0x1c')]||null:null,'attributes':_0xad8159[_0x6070('0x1a')]?_0xad8159[_0x6070('0x1a')]['attributes']||null:null,'limit':_0xad8159[_0x6070('0x1a')]?_0xad8159[_0x6070('0x1a')][_0x6070('0x1d')]||null:null})['then'](function(_0xb630d){logger[_0x6070('0xc')](_0x6070('0x17'),_0xad8159);logger[_0x6070('0xf')](_0x6070('0x17'),_0xad8159,JSON['stringify'](_0xb630d));_0xdeb3c7(_0xb630d);})[_0x6070('0x16')](function(_0x200bac){logger['error'](_0x6070('0x17'),_0x200bac[_0x6070('0x14')],_0xad8159);_0x340458(_0x596545['error'](0x1f4,_0x200bac[_0x6070('0x14')]));});});};
\ No newline at end of file
+var _0x04e9=['update','body','options','raw','where','attributes','debug','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication'];(function(_0xeeaa97,_0x3430bc){var _0x3090f5=function(_0x344047){while(--_0x344047){_0xeeaa97['push'](_0xeeaa97['shift']());}};_0x3090f5(++_0x3430bc);}(_0x04e9,0x7b));var _0x904e=function(_0x5ec576,_0x26ff14){_0x5ec576=_0x5ec576-0x0;var _0x32648a=_0x04e9[_0x5ec576];return _0x32648a;};'use strict';var _=require('lodash');var util=require(_0x904e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x904e('0x1'));var fs=require('fs');var Redis=require(_0x904e('0x2'));var db=require(_0x904e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x904e('0x4'))(_0x904e('0x5'));var config=require(_0x904e('0x6'));var jayson=require(_0x904e('0x7'));var client=jayson['client'][_0x904e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a08d8,_0x28e159,_0xfb02ff){return new BPromise(function(_0x1977dd,_0x429570){return client[_0x904e('0x9')](_0x1a08d8,_0xfb02ff)[_0x904e('0xa')](function(_0x524643){logger[_0x904e('0xb')](_0x904e('0xc'),_0x28e159,_0x904e('0xd'));logger['debug'](_0x904e('0xe'),_0x28e159,_0x904e('0xd'),JSON[_0x904e('0xf')](_0x524643));if(_0x524643[_0x904e('0x10')]){if(_0x524643[_0x904e('0x10')][_0x904e('0x11')]===0x1f4){logger[_0x904e('0x10')](_0x904e('0xc'),_0x28e159,_0x524643['error'][_0x904e('0x12')]);return _0x429570(_0x524643['error'][_0x904e('0x12')]);}logger[_0x904e('0x10')](_0x904e('0xc'),_0x28e159,_0x524643[_0x904e('0x10')]['message']);return _0x1977dd(_0x524643[_0x904e('0x10')][_0x904e('0x12')]);}else{logger['info'](_0x904e('0xc'),_0x28e159,_0x904e('0xd'));_0x1977dd(_0x524643[_0x904e('0x13')][_0x904e('0x12')]);}})[_0x904e('0x14')](function(_0x12d7b5){logger[_0x904e('0x10')](_0x904e('0xc'),_0x28e159,_0x12d7b5);_0x429570(_0x12d7b5);});});}exports[_0x904e('0x15')]=function(_0x49ec70){var _0x3ee07d=this;return new Promise(function(_0x18b8bf,_0xe99734){return db['FaxApplication'][_0x904e('0x16')](_0x49ec70[_0x904e('0x17')],{'raw':_0x49ec70[_0x904e('0x18')]?_0x49ec70[_0x904e('0x18')][_0x904e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49ec70[_0x904e('0x18')]?_0x49ec70[_0x904e('0x18')][_0x904e('0x1a')]||null:null,'attributes':_0x49ec70[_0x904e('0x18')]?_0x49ec70[_0x904e('0x18')][_0x904e('0x1b')]||null:null,'limit':_0x49ec70[_0x904e('0x18')]?_0x49ec70[_0x904e('0x18')]['limit']||null:null})['then'](function(_0x190b0e){logger[_0x904e('0xb')](_0x904e('0x15'),_0x49ec70);logger[_0x904e('0x1c')](_0x904e('0x15'),_0x49ec70,JSON[_0x904e('0xf')](_0x190b0e));_0x18b8bf(_0x190b0e);})[_0x904e('0x14')](function(_0x261e12){logger[_0x904e('0x10')](_0x904e('0x15'),_0x261e12[_0x904e('0x12')],_0x49ec70);_0xe99734(_0x3ee07d[_0x904e('0x10')](0x1f4,_0x261e12['message']));});});};
\ No newline at end of file
index 971fd52..2fa92ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x3297ae,_0x3f4784){var _0x5c86a3=function(_0x1851e5){while(--_0x1851e5){_0x3297ae['push'](_0x3297ae['shift']());}};_0x5c86a3(++_0x3f4784);}(_0x757a,0xde));var _0xa757=function(_0x51c6dc,_0x5adf3a){_0x51c6dc=_0x51c6dc-0x0;var _0x484d3a=_0x757a[_0x51c6dc];return _0x484d3a;};'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('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xed3c=['index','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./faxApplication.controller','get','isAuthenticated'];(function(_0x43227c,_0x248f92){var _0x3b7a1c=function(_0x355cae){while(--_0x355cae){_0x43227c['push'](_0x43227c['shift']());}};_0x3b7a1c(++_0x248f92);}(_0xed3c,0x1a6));var _0xced3=function(_0x4e33c0,_0x555fda){_0x4e33c0=_0x4e33c0-0x0;var _0x1f7aa3=_0xed3c[_0x4e33c0];return _0x1f7aa3;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xced3('0xc')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router[_0xced3('0xf')]('/:id',auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);module[_0xced3('0x11')]=router;
\ No newline at end of file
index 8682bed..afc940b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68ff=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x4193c8,_0x30e914){var _0x4f0b5d=function(_0x26f087){while(--_0x26f087){_0x4193c8['push'](_0x4193c8['shift']());}};_0x4f0b5d(++_0x30e914);}(_0x68ff,0x1e5));var _0xf68f=function(_0x467fc7,_0x30674a){_0x467fc7=_0x467fc7-0x0;var _0x15bcd3=_0x68ff[_0x467fc7];return _0x15bcd3;};'use strict';var Sequelize=require(_0xf68f('0x0'));module[_0xf68f('0x1')]={'closed':{'type':Sequelize[_0xf68f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf68f('0x3')]},'secondDisposition':{'type':Sequelize[_0xf68f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf68f('0x3')]},'note':{'type':Sequelize[_0xf68f('0x3')]},'read1stAt':{'type':Sequelize[_0xf68f('0x4')]},'fax':{'type':Sequelize[_0xf68f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf68f('0x5')]('in',_0xf68f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf68f('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xaa94=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x2a8364,_0x1a950d){var _0x56aebd=function(_0x3fdd0c){while(--_0x3fdd0c){_0x2a8364['push'](_0x2a8364['shift']());}};_0x56aebd(++_0x1a950d);}(_0xaa94,0xc9));var _0x4aa9=function(_0x122b8a,_0x222c02){_0x122b8a=_0x122b8a-0x0;var _0x17222a=_0xaa94[_0x122b8a];return _0x17222a;};'use strict';var Sequelize=require(_0x4aa9('0x0'));module[_0x4aa9('0x1')]={'closed':{'type':Sequelize[_0x4aa9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4aa9('0x3')]},'secondDisposition':{'type':Sequelize[_0x4aa9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4aa9('0x3')]},'note':{'type':Sequelize[_0x4aa9('0x3')]},'read1stAt':{'type':Sequelize[_0x4aa9('0x4')]},'fax':{'type':Sequelize[_0x4aa9('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4aa9('0x5')]('in',_0x4aa9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4aa9('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4aa9('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index a3ace10..39fd288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e4d=['log','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./faxInteraction.socket','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','end','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','fax','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','include','find','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','hasOwnProperty','nolimit','sort','where','pick','FaxInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','spread','Tag','color','emit','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0x4e4d,0x1a2));var _0xd4e4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4e4d[_0x1035c1];return _0x308d67;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd4e4('0x0'));var moment=require(_0xd4e4('0x1'));var BPromise=require(_0xd4e4('0x2'));var util=require(_0xd4e4('0x3'));var path=require(_0xd4e4('0x4'));var fs=require('fs');var _=require(_0xd4e4('0x5'));var Redis=require(_0xd4e4('0x6'));var interaction=require(_0xd4e4('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xd4e4('0x8'))('api');var config=require(_0xd4e4('0x9'));var db=require('../../mysqldb')['db'];config[_0xd4e4('0xa')]=_[_0xd4e4('0xb')](config[_0xd4e4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd4e4('0xc'))(new Redis(config[_0xd4e4('0xa')]));require(_0xd4e4('0xd'))['register'](socket);function respondWithStatusCode(_0x38cf39,_0x523d69){_0x523d69=_0x523d69||0xcc;return function(_0x37dfd4){if(_0x37dfd4){return _0x38cf39[_0xd4e4('0xe')](_0x523d69);}return _0x38cf39[_0xd4e4('0xf')](_0x523d69)['end']();};}function respondWithResult(_0x21c07a,_0x6531d4){_0x6531d4=_0x6531d4||0xc8;return function(_0x2c97bd){if(_0x2c97bd){return _0x21c07a['status'](_0x6531d4)['json'](_0x2c97bd);}};}function respondWithFilteredResult(_0xf821f2,_0x1a2774){return function(_0x444fc9){if(_0x444fc9){var _0x567725=typeof _0x1a2774[_0xd4e4('0x10')]==='undefined'&&typeof _0x1a2774[_0xd4e4('0x11')]===_0xd4e4('0x12');var _0x5a939d=_0x444fc9['count'];var _0x207196=_0x567725?0x0:_0x1a2774[_0xd4e4('0x10')];var _0x254c77=_0x567725?_0x444fc9[_0xd4e4('0x13')]:_0x1a2774[_0xd4e4('0x10')]+_0x1a2774[_0xd4e4('0x11')];var _0x126f28;if(_0x254c77>=_0x5a939d){_0x254c77=_0x5a939d;_0x126f28=0xc8;}else{_0x126f28=0xce;}_0xf821f2['status'](_0x126f28);return _0xf821f2[_0xd4e4('0x14')](_0xd4e4('0x15'),_0x207196+'-'+_0x254c77+'/'+_0x5a939d)[_0xd4e4('0x16')](_0x444fc9);}return null;};}function saveUpdates(_0x371329){return function(_0x376c14){if(_0x376c14){return _0x376c14[_0xd4e4('0x17')](_0x371329)[_0xd4e4('0x18')](function(_0x46e02f){return _0x46e02f;});}return null;};}function removeEntity(_0x192274){return function(_0x2dc6df){if(_0x2dc6df){return _0x2dc6df[_0xd4e4('0x19')]()[_0xd4e4('0x18')](function(){_0x192274[_0xd4e4('0xf')](0xcc)[_0xd4e4('0x1a')]();});}};}function handleEntityNotFound(_0x518b43){return function(_0x115132){if(!_0x115132){_0x518b43[_0xd4e4('0xe')](0x194);}return _0x115132;};}function handleError(_0x5355f6,_0x377639){_0x377639=_0x377639||0x1f4;return function(_0x559efd){logger[_0xd4e4('0x1b')](_0x559efd[_0xd4e4('0x1c')]);if(_0x559efd[_0xd4e4('0x1d')]){delete _0x559efd[_0xd4e4('0x1d')];}_0x5355f6[_0xd4e4('0xf')](_0x377639)[_0xd4e4('0x1e')](_0x559efd);};}exports[_0xd4e4('0x1f')]=function(_0x4397c6,_0x193fe5){var _0x2d5617={};var _0x509554=_[_0xd4e4('0x20')](db[_0xd4e4('0x21')][_0xd4e4('0x22')],function(_0xa81922){return{'name':_0xa81922[_0xd4e4('0x23')],'type':_0xa81922[_0xd4e4('0x24')][_0xd4e4('0x25')]};});_0x2d5617=qs['getOptions'](_0x509554,_0x4397c6);return interaction['findAll'](_0xd4e4('0x26'),_0x4397c6[_0xd4e4('0x27')],_0x4397c6[_0xd4e4('0x28')],_0x2d5617,_0x509554)[_0xd4e4('0x18')](respondWithFilteredResult(_0x193fe5,_0x2d5617))[_0xd4e4('0x29')](handleError(_0x193fe5,null));};exports[_0xd4e4('0x2a')]=function(_0x17db79,_0x1c1c89){var _0x29f3c5={'raw':![],'where':{'id':_0x17db79['params']['id']}},_0x192d7b={};_0x192d7b[_0xd4e4('0x2b')]=_[_0xd4e4('0x2c')](db[_0xd4e4('0x21')]['rawAttributes']);_0x192d7b['query']=_[_0xd4e4('0x2c')](_0x17db79[_0xd4e4('0x27')]);_0x192d7b[_0xd4e4('0x2d')]=_[_0xd4e4('0x2e')](_0x192d7b[_0xd4e4('0x2b')],_0x192d7b['query']);_0x29f3c5[_0xd4e4('0x2f')]=_[_0xd4e4('0x2e')](_0x192d7b['model'],qs['fields'](_0x17db79['query'][_0xd4e4('0x30')]));_0x29f3c5['attributes']=_0x29f3c5[_0xd4e4('0x2f')][_0xd4e4('0x31')]?_0x29f3c5[_0xd4e4('0x2f')]:_0x192d7b[_0xd4e4('0x2b')];if(_0x17db79[_0xd4e4('0x27')]['includeAll']){_0x29f3c5[_0xd4e4('0x32')]=[{'all':!![]}];}_0x29f3c5=_['merge']({},_0x29f3c5,_0x17db79['options']);return db[_0xd4e4('0x21')][_0xd4e4('0x33')](_0x29f3c5)[_0xd4e4('0x18')](handleEntityNotFound(_0x1c1c89,null))['then'](respondWithResult(_0x1c1c89,null))['catch'](handleError(_0x1c1c89,null));};exports['create']=function(_0x451d92,_0x3dd713){return db[_0xd4e4('0x21')][_0xd4e4('0x34')](_0x451d92[_0xd4e4('0x35')],{})[_0xd4e4('0x18')](respondWithResult(_0x3dd713,0xc9))['catch'](handleError(_0x3dd713,null));};exports[_0xd4e4('0x17')]=function(_0x2eb97b,_0xaf5f1){if(_0x2eb97b[_0xd4e4('0x35')]['id']){delete _0x2eb97b[_0xd4e4('0x35')]['id'];}return db[_0xd4e4('0x21')]['find']({'where':{'id':_0x2eb97b[_0xd4e4('0x36')]['id']}})[_0xd4e4('0x18')](handleEntityNotFound(_0xaf5f1,null))['then'](saveUpdates(_0x2eb97b[_0xd4e4('0x35')],null))[_0xd4e4('0x18')](respondWithResult(_0xaf5f1,null))[_0xd4e4('0x29')](handleError(_0xaf5f1,null));};exports[_0xd4e4('0x19')]=function(_0x30a39d,_0x3a2ce2){return db[_0xd4e4('0x21')][_0xd4e4('0x33')]({'where':{'id':_0x30a39d[_0xd4e4('0x36')]['id']}})['then'](handleEntityNotFound(_0x3a2ce2,null))[_0xd4e4('0x18')](removeEntity(_0x3a2ce2,null))[_0xd4e4('0x29')](handleError(_0x3a2ce2,null));};exports[_0xd4e4('0x37')]=function(_0x4b2b50,_0x535ee8){return db[_0xd4e4('0x21')][_0xd4e4('0x37')]()[_0xd4e4('0x18')](respondWithResult(_0x535ee8,null))[_0xd4e4('0x29')](handleError(_0x535ee8,null));};exports[_0xd4e4('0x38')]=function(_0x39b49e,_0x38148d){return db['FaxMessage']['find']({'where':{'id':_0x39b49e[_0xd4e4('0x36')]['id']}})[_0xd4e4('0x18')](handleEntityNotFound(_0x38148d,null))['then'](function(_0x1668ad){if(_0x1668ad){return _0x1668ad[_0xd4e4('0x38')](_0x39b49e[_0xd4e4('0x35')][_0xd4e4('0x39')],_[_0xd4e4('0x3a')](_0x39b49e[_0xd4e4('0x35')],[_0xd4e4('0x39'),'id'])||{});}})['then'](respondWithResult(_0x38148d,null))['catch'](handleError(_0x38148d,null));};exports[_0xd4e4('0x3b')]=function(_0x2b19c2,_0xd7a0f7){var _0x48d7af={'raw':![],'where':{}};var _0x3fd584={};var _0x2f8d7c={'count':0x0,'rows':[]};return db[_0xd4e4('0x21')][_0xd4e4('0x3c')]({'where':{'id':_0x2b19c2['params']['id']}})[_0xd4e4('0x18')](handleEntityNotFound(_0xd7a0f7,null))[_0xd4e4('0x18')](function(_0x5322be){if(_0x5322be){_0x3fd584[_0xd4e4('0x2b')]=_[_0xd4e4('0x2c')](db[_0xd4e4('0x3d')][_0xd4e4('0x22')]);_0x3fd584[_0xd4e4('0x27')]=_[_0xd4e4('0x2c')](_0x2b19c2['query']);_0x3fd584[_0xd4e4('0x2d')]=_[_0xd4e4('0x2e')](_0x3fd584[_0xd4e4('0x2b')],_0x3fd584['query']);_0x48d7af[_0xd4e4('0x2f')]=_[_0xd4e4('0x2e')](_0x3fd584['model'],qs[_0xd4e4('0x30')](_0x2b19c2['query']['fields']));_0x48d7af['attributes']=_0x48d7af[_0xd4e4('0x2f')]['length']?_0x48d7af['attributes']:_0x3fd584[_0xd4e4('0x2b')];if(!_0x2b19c2[_0xd4e4('0x27')][_0xd4e4('0x3e')](_0xd4e4('0x3f'))){_0x48d7af[_0xd4e4('0x11')]=qs['limit'](_0x2b19c2[_0xd4e4('0x27')][_0xd4e4('0x11')]);_0x48d7af[_0xd4e4('0x10')]=qs[_0xd4e4('0x10')](_0x2b19c2['query'][_0xd4e4('0x10')]);}_0x48d7af['order']=qs['sort'](_0x2b19c2[_0xd4e4('0x27')][_0xd4e4('0x40')]);_0x48d7af[_0xd4e4('0x41')]=qs['filters'](_[_0xd4e4('0x42')](_0x2b19c2[_0xd4e4('0x27')],_0x3fd584[_0xd4e4('0x2d')]));_0x48d7af['where'][_0xd4e4('0x43')]=_0x5322be['id'];if(_0x2b19c2[_0xd4e4('0x27')][_0xd4e4('0x44')]){_0x48d7af['where']=_[_0xd4e4('0x45')](_0x48d7af[_0xd4e4('0x41')],{'$or':_['map'](_0x48d7af[_0xd4e4('0x2f')],function(_0x542360){var _0x5605f1={};_0x5605f1[_0x542360]={'$like':'%'+_0x2b19c2[_0xd4e4('0x27')]['filter']+'%'};return _0x5605f1;})});}if(_0x2b19c2[_0xd4e4('0x27')][_0xd4e4('0x46')]){var _0xc7a386=_0x2b19c2[_0xd4e4('0x27')][_0xd4e4('0x46')][_0xd4e4('0x47')](',');var _0xdad558={};_0xdad558[_0xc7a386[0x0]]={'$gte':moment(_0xc7a386[0x1])[_0xd4e4('0x48')](_0xd4e4('0x49'))};_0x48d7af[_0xd4e4('0x41')]=_[_0xd4e4('0x45')](_0x48d7af['where'],_0xdad558);}_0x48d7af=_[_0xd4e4('0x45')]({},_0x48d7af,_0x2b19c2[_0xd4e4('0x4a')]);return db['FaxMessage'][_0xd4e4('0x13')]({'where':_0x48d7af['where']})[_0xd4e4('0x18')](function(_0xe8bb3b){_0x2f8d7c['count']=_0xe8bb3b;if(_0x2b19c2['query'][_0xd4e4('0x4b')]){_0x48d7af[_0xd4e4('0x32')]=[{'all':!![]}];}return db[_0xd4e4('0x3d')][_0xd4e4('0x4c')](_0x48d7af);})[_0xd4e4('0x18')](function(_0x392188){_0x2f8d7c[_0xd4e4('0x4d')]=_0x392188;return _0x2f8d7c;});}})[_0xd4e4('0x18')](respondWithFilteredResult(_0xd7a0f7,_0x48d7af))[_0xd4e4('0x29')](handleError(_0xd7a0f7,null));};exports[_0xd4e4('0x4e')]=function(_0x80be3f,_0x4afadd){return db[_0xd4e4('0x21')]['find']({'where':{'id':_0x80be3f[_0xd4e4('0x36')]['id']}})['then'](handleEntityNotFound(_0x4afadd,null))[_0xd4e4('0x18')](function(_0x432877){if(_0x432877){return _0x432877['setTags'](_0x80be3f['body'][_0xd4e4('0x39')],_[_0xd4e4('0x3a')](_0x80be3f[_0xd4e4('0x35')],['ids','id'])||{})[_0xd4e4('0x4f')](function(){return db[_0xd4e4('0x50')][_0xd4e4('0x4c')]({'attributes':['id','name',_0xd4e4('0x51')],'where':{'id':_0x80be3f[_0xd4e4('0x35')]['ids']}});})[_0xd4e4('0x18')](function(_0x535cf5){socket[_0xd4e4('0x52')]('faxInteractionTags:save',{'id':Number(_0x80be3f[_0xd4e4('0x36')]['id']),'tags':_0x535cf5||[]});return{'id':Number(_0x80be3f[_0xd4e4('0x36')]['id']),'tags':_0x535cf5||[]};});}})[_0xd4e4('0x18')](respondWithResult(_0x4afadd,null))[_0xd4e4('0x29')](handleError(_0x4afadd,null));};exports[_0xd4e4('0x53')]=function(_0x57705f,_0x22ca1d){return db[_0xd4e4('0x21')][_0xd4e4('0x33')]({'where':{'id':_0x57705f[_0xd4e4('0x36')]['id']}})['then'](handleEntityNotFound(_0x22ca1d,null))[_0xd4e4('0x18')](function(_0x345b14){if(_0x345b14){return _0x345b14['removeTags'](_0x57705f['query']['ids']);}})[_0xd4e4('0x18')](respondWithStatusCode(_0x22ca1d,null))[_0xd4e4('0x29')](handleError(_0x22ca1d,null));};exports[_0xd4e4('0x54')]=function(_0x46f445,_0x347c46){var _0x406d1d=moment()[_0xd4e4('0x55')]()['toString']();var _0x252394=path[_0xd4e4('0x56')](config['root'],_0xd4e4('0x57'),_0xd4e4('0x58'),_0xd4e4('0x59'));var _0xa43972=path[_0xd4e4('0x56')](config[_0xd4e4('0x5a')],_0xd4e4('0x57'),_0xd4e4('0x58'),'attachments');var _0x3239f8=path['join'](_0x252394,_0x406d1d);var _0x45e683=util['format'](_0xd4e4('0x5b'),_0x46f445[_0xd4e4('0x36')]['id'],_0x406d1d);var _0x23979b=path[_0xd4e4('0x56')](_0x252394,_0x45e683);var _0x2da6c3=[];_0x2da6c3['push']({'model':db[_0xd4e4('0x5c')],'as':'Attachment','raw':!![]});var _0xa9dfcf=[{'model':db[_0xd4e4('0x3d')],'as':_0xd4e4('0x5d'),'attributes':['id','body',_0xd4e4('0x5e')],'include':_0x2da6c3}];return db[_0xd4e4('0x21')]['find']({'where':{'id':_0x46f445[_0xd4e4('0x36')]['id']},'include':_0xa9dfcf})['then'](handleEntityNotFound(_0x347c46,null))[_0xd4e4('0x18')](function(_0x351bbc){if(_0x351bbc&&_0x351bbc[_0xd4e4('0x5d')]){var _0x89ae27=_0x351bbc[_0xd4e4('0x5f')]({'plain':!![]});fs[_0xd4e4('0x60')](_0x3239f8);for(var _0x47592e=0x0;_0x47592e<_0x89ae27[_0xd4e4('0x5d')]['length'];_0x47592e++){var _0xd4bdff=_0x89ae27[_0xd4e4('0x5d')][_0x47592e][_0xd4e4('0x5c')];if(_0xd4bdff){var _0x271df7=path[_0xd4e4('0x56')](_0xa43972,_0xd4bdff[_0xd4e4('0x61')]);if(fs[_0xd4e4('0x62')](_0x271df7)){fs[_0xd4e4('0x63')](_0x271df7)['pipe'](fs[_0xd4e4('0x64')](path[_0xd4e4('0x56')](_0x3239f8,_0xd4bdff[_0xd4e4('0x61')])));}}}return BPromise[_0xd4e4('0x65')]()['then'](function(){return new BPromise(function(_0x5bde82,_0x1bfad8){zipdir(_0x3239f8,{'saveTo':_0x23979b},function(_0x48b962,_0x45b9cf){if(_0x48b962)return _0x1bfad8(_0x48b962);return _0x5bde82(_0x45b9cf);});})[_0xd4e4('0x18')](function(){return new BPromise(function(_0x5462e0,_0x53c597){rimraf(_0x3239f8,function(_0x5526eb){if(_0x5526eb)_0x53c597(_0x5526eb);return _0x5462e0();});});})[_0xd4e4('0x18')](function(){return _0x347c46[_0xd4e4('0x54')](_0x23979b,_0x45e683,function(_0x5d79a7){if(_0x5d79a7){console[_0xd4e4('0x66')]('err',_0x5d79a7);}else{fs[_0xd4e4('0x67')](_0x23979b);}});});});}else{return _0x347c46[_0xd4e4('0xe')](0xc8);}})['catch'](handleError(_0x347c46,null));};
\ No newline at end of file
+var _0xbc9c=['query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','FaxMessage','omit','findOne','hasOwnProperty','nolimit','sort','where','pick','FaxInteractionId','filter','$gte','split','ids','spread','Tag','color','removeTags','download','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','unlinkSync','sendStatus','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','end','error','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','user','params','model','keys'];(function(_0x26fdab,_0x4b36ad){var _0x16c603=function(_0xb6c497){while(--_0xb6c497){_0x26fdab['push'](_0x26fdab['shift']());}};_0x16c603(++_0x4b36ad);}(_0xbc9c,0x99));var _0xcbc9=function(_0x15ab24,_0x3ef448){_0x15ab24=_0x15ab24-0x0;var _0x249b46=_0xbc9c[_0x15ab24];return _0x249b46;};'use strict';var rimraf=require(_0xcbc9('0x0'));var zipdir=require('zip-dir');var moment=require(_0xcbc9('0x1'));var BPromise=require(_0xcbc9('0x2'));var util=require(_0xcbc9('0x3'));var path=require(_0xcbc9('0x4'));var fs=require('fs');var _=require(_0xcbc9('0x5'));var Redis=require(_0xcbc9('0x6'));var interaction=require(_0xcbc9('0x7'));var qs=require(_0xcbc9('0x8'));var logger=require(_0xcbc9('0x9'))(_0xcbc9('0xa'));var config=require('../../config/environment');var db=require(_0xcbc9('0xb'))['db'];config[_0xcbc9('0xc')]=_[_0xcbc9('0xd')](config[_0xcbc9('0xc')],{'host':_0xcbc9('0xe'),'port':0x18eb});var socket=require(_0xcbc9('0xf'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xcbc9('0x10')](socket);function respondWithStatusCode(_0x3048bb,_0x21fb7f){_0x21fb7f=_0x21fb7f||0xcc;return function(_0x5eb785){if(_0x5eb785){return _0x3048bb['sendStatus'](_0x21fb7f);}return _0x3048bb[_0xcbc9('0x11')](_0x21fb7f)['end']();};}function respondWithResult(_0x57d341,_0xb213a7){_0xb213a7=_0xb213a7||0xc8;return function(_0x1fb3e3){if(_0x1fb3e3){return _0x57d341[_0xcbc9('0x11')](_0xb213a7)['json'](_0x1fb3e3);}};}function respondWithFilteredResult(_0x229b43,_0x53cf64){return function(_0x2a7f56){if(_0x2a7f56){var _0x25d73d=typeof _0x53cf64[_0xcbc9('0x12')]===_0xcbc9('0x13')&&typeof _0x53cf64['limit']==='undefined';var _0x1bc53f=_0x2a7f56['count'];var _0x2986d0=_0x25d73d?0x0:_0x53cf64['offset'];var _0x3a8e14=_0x25d73d?_0x2a7f56[_0xcbc9('0x14')]:_0x53cf64[_0xcbc9('0x12')]+_0x53cf64[_0xcbc9('0x15')];var _0x333d94;if(_0x3a8e14>=_0x1bc53f){_0x3a8e14=_0x1bc53f;_0x333d94=0xc8;}else{_0x333d94=0xce;}_0x229b43[_0xcbc9('0x11')](_0x333d94);return _0x229b43[_0xcbc9('0x16')](_0xcbc9('0x17'),_0x2986d0+'-'+_0x3a8e14+'/'+_0x1bc53f)[_0xcbc9('0x18')](_0x2a7f56);}return null;};}function saveUpdates(_0x3e5f7b){return function(_0x3fb1b4){if(_0x3fb1b4){return _0x3fb1b4[_0xcbc9('0x19')](_0x3e5f7b)[_0xcbc9('0x1a')](function(_0x17eee4){return _0x17eee4;});}return null;};}function removeEntity(_0x20a8af){return function(_0x1acde1){if(_0x1acde1){return _0x1acde1[_0xcbc9('0x1b')]()['then'](function(){_0x20a8af[_0xcbc9('0x11')](0xcc)[_0xcbc9('0x1c')]();});}};}function handleEntityNotFound(_0x47b23e){return function(_0x3faf4b){if(!_0x3faf4b){_0x47b23e['sendStatus'](0x194);}return _0x3faf4b;};}function handleError(_0x355224,_0xe776bb){_0xe776bb=_0xe776bb||0x1f4;return function(_0x4bc812){logger[_0xcbc9('0x1d')](_0x4bc812['stack']);if(_0x4bc812[_0xcbc9('0x1e')]){delete _0x4bc812[_0xcbc9('0x1e')];}_0x355224['status'](_0xe776bb)[_0xcbc9('0x1f')](_0x4bc812);};}exports[_0xcbc9('0x20')]=function(_0x4dab61,_0x32ae50){var _0x377ed4={};var _0x514d04=_[_0xcbc9('0x21')](db[_0xcbc9('0x22')][_0xcbc9('0x23')],function(_0x4b5fd8){return{'name':_0x4b5fd8['fieldName'],'type':_0x4b5fd8[_0xcbc9('0x24')][_0xcbc9('0x25')]};});_0x377ed4=qs[_0xcbc9('0x26')](_0x514d04,_0x4dab61);return interaction[_0xcbc9('0x27')](_0xcbc9('0x28'),_0x4dab61['query'],_0x4dab61[_0xcbc9('0x29')],_0x377ed4,_0x514d04)[_0xcbc9('0x1a')](respondWithFilteredResult(_0x32ae50,_0x377ed4))['catch'](handleError(_0x32ae50,null));};exports['show']=function(_0x2a469f,_0x3d1135){var _0x27a658={'raw':![],'where':{'id':_0x2a469f[_0xcbc9('0x2a')]['id']}},_0x12fca7={};_0x12fca7[_0xcbc9('0x2b')]=_[_0xcbc9('0x2c')](db['FaxInteraction'][_0xcbc9('0x23')]);_0x12fca7['query']=_['keys'](_0x2a469f[_0xcbc9('0x2d')]);_0x12fca7[_0xcbc9('0x2e')]=_[_0xcbc9('0x2f')](_0x12fca7[_0xcbc9('0x2b')],_0x12fca7[_0xcbc9('0x2d')]);_0x27a658[_0xcbc9('0x30')]=_[_0xcbc9('0x2f')](_0x12fca7[_0xcbc9('0x2b')],qs[_0xcbc9('0x31')](_0x2a469f['query']['fields']));_0x27a658['attributes']=_0x27a658[_0xcbc9('0x30')][_0xcbc9('0x32')]?_0x27a658['attributes']:_0x12fca7[_0xcbc9('0x2b')];if(_0x2a469f[_0xcbc9('0x2d')][_0xcbc9('0x33')]){_0x27a658[_0xcbc9('0x34')]=[{'all':!![]}];}_0x27a658=_[_0xcbc9('0x35')]({},_0x27a658,_0x2a469f[_0xcbc9('0x36')]);return db[_0xcbc9('0x22')][_0xcbc9('0x37')](_0x27a658)[_0xcbc9('0x1a')](handleEntityNotFound(_0x3d1135,null))['then'](respondWithResult(_0x3d1135,null))[_0xcbc9('0x38')](handleError(_0x3d1135,null));};exports[_0xcbc9('0x39')]=function(_0x36f659,_0x4899e0){return db[_0xcbc9('0x22')][_0xcbc9('0x39')](_0x36f659['body'],{})['then'](respondWithResult(_0x4899e0,0xc9))[_0xcbc9('0x38')](handleError(_0x4899e0,null));};exports[_0xcbc9('0x19')]=function(_0x1917ac,_0x31996){if(_0x1917ac[_0xcbc9('0x3a')]['id']){delete _0x1917ac[_0xcbc9('0x3a')]['id'];}return db['FaxInteraction'][_0xcbc9('0x37')]({'where':{'id':_0x1917ac[_0xcbc9('0x2a')]['id']}})[_0xcbc9('0x1a')](handleEntityNotFound(_0x31996,null))[_0xcbc9('0x1a')](saveUpdates(_0x1917ac['body'],null))[_0xcbc9('0x1a')](respondWithResult(_0x31996,null))[_0xcbc9('0x38')](handleError(_0x31996,null));};exports[_0xcbc9('0x1b')]=function(_0x30adb7,_0x43cfb3){return db[_0xcbc9('0x22')][_0xcbc9('0x37')]({'where':{'id':_0x30adb7[_0xcbc9('0x2a')]['id']}})[_0xcbc9('0x1a')](handleEntityNotFound(_0x43cfb3,null))[_0xcbc9('0x1a')](removeEntity(_0x43cfb3,null))[_0xcbc9('0x38')](handleError(_0x43cfb3,null));};exports['describe']=function(_0x190c32,_0x3533eb){return db[_0xcbc9('0x22')][_0xcbc9('0x3b')]()[_0xcbc9('0x1a')](respondWithResult(_0x3533eb,null))['catch'](handleError(_0x3533eb,null));};exports[_0xcbc9('0x3c')]=function(_0x2d0287,_0x1da717){return db[_0xcbc9('0x3d')][_0xcbc9('0x37')]({'where':{'id':_0x2d0287[_0xcbc9('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1da717,null))[_0xcbc9('0x1a')](function(_0x18478a){if(_0x18478a){return _0x18478a[_0xcbc9('0x3c')](_0x2d0287[_0xcbc9('0x3a')]['ids'],_[_0xcbc9('0x3e')](_0x2d0287[_0xcbc9('0x3a')],['ids','id'])||{});}})['then'](respondWithResult(_0x1da717,null))['catch'](handleError(_0x1da717,null));};exports['getMessages']=function(_0x3e063a,_0x514fe1){var _0x54c948={'raw':![],'where':{}};var _0xd2751d={};var _0x20bb5f={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xcbc9('0x3f')]({'where':{'id':_0x3e063a[_0xcbc9('0x2a')]['id']}})[_0xcbc9('0x1a')](handleEntityNotFound(_0x514fe1,null))[_0xcbc9('0x1a')](function(_0x58ac71){if(_0x58ac71){_0xd2751d[_0xcbc9('0x2b')]=_['keys'](db[_0xcbc9('0x3d')][_0xcbc9('0x23')]);_0xd2751d[_0xcbc9('0x2d')]=_[_0xcbc9('0x2c')](_0x3e063a[_0xcbc9('0x2d')]);_0xd2751d['filters']=_[_0xcbc9('0x2f')](_0xd2751d[_0xcbc9('0x2b')],_0xd2751d[_0xcbc9('0x2d')]);_0x54c948[_0xcbc9('0x30')]=_[_0xcbc9('0x2f')](_0xd2751d[_0xcbc9('0x2b')],qs[_0xcbc9('0x31')](_0x3e063a[_0xcbc9('0x2d')][_0xcbc9('0x31')]));_0x54c948['attributes']=_0x54c948[_0xcbc9('0x30')][_0xcbc9('0x32')]?_0x54c948[_0xcbc9('0x30')]:_0xd2751d['model'];if(!_0x3e063a[_0xcbc9('0x2d')][_0xcbc9('0x40')](_0xcbc9('0x41'))){_0x54c948[_0xcbc9('0x15')]=qs[_0xcbc9('0x15')](_0x3e063a['query'][_0xcbc9('0x15')]);_0x54c948[_0xcbc9('0x12')]=qs[_0xcbc9('0x12')](_0x3e063a[_0xcbc9('0x2d')][_0xcbc9('0x12')]);}_0x54c948['order']=qs[_0xcbc9('0x42')](_0x3e063a['query'][_0xcbc9('0x42')]);_0x54c948[_0xcbc9('0x43')]=qs[_0xcbc9('0x2e')](_[_0xcbc9('0x44')](_0x3e063a['query'],_0xd2751d[_0xcbc9('0x2e')]));_0x54c948['where'][_0xcbc9('0x45')]=_0x58ac71['id'];if(_0x3e063a[_0xcbc9('0x2d')][_0xcbc9('0x46')]){_0x54c948[_0xcbc9('0x43')]=_[_0xcbc9('0x35')](_0x54c948[_0xcbc9('0x43')],{'$or':_[_0xcbc9('0x21')](_0x54c948['attributes'],function(_0x5df0c3){var _0x404cdc={};_0x404cdc[_0x5df0c3]={'$like':'%'+_0x3e063a[_0xcbc9('0x2d')][_0xcbc9('0x46')]+'%'};return _0x404cdc;})});}if(_0x3e063a['query'][_0xcbc9('0x47')]){var _0x132719=_0x3e063a[_0xcbc9('0x2d')][_0xcbc9('0x47')][_0xcbc9('0x48')](',');var _0x4ae3ce={};_0x4ae3ce[_0x132719[0x0]]={'$gte':moment(_0x132719[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x54c948[_0xcbc9('0x43')]=_[_0xcbc9('0x35')](_0x54c948['where'],_0x4ae3ce);}_0x54c948=_[_0xcbc9('0x35')]({},_0x54c948,_0x3e063a[_0xcbc9('0x36')]);return db[_0xcbc9('0x3d')][_0xcbc9('0x14')]({'where':_0x54c948[_0xcbc9('0x43')]})['then'](function(_0x2b484e){_0x20bb5f[_0xcbc9('0x14')]=_0x2b484e;if(_0x3e063a['query'][_0xcbc9('0x33')]){_0x54c948[_0xcbc9('0x34')]=[{'all':!![]}];}return db[_0xcbc9('0x3d')]['findAll'](_0x54c948);})['then'](function(_0x3503f8){_0x20bb5f['rows']=_0x3503f8;return _0x20bb5f;});}})[_0xcbc9('0x1a')](respondWithFilteredResult(_0x514fe1,_0x54c948))[_0xcbc9('0x38')](handleError(_0x514fe1,null));};exports['addTags']=function(_0x2cd201,_0x5d45af){return db[_0xcbc9('0x22')][_0xcbc9('0x37')]({'where':{'id':_0x2cd201[_0xcbc9('0x2a')]['id']}})[_0xcbc9('0x1a')](handleEntityNotFound(_0x5d45af,null))[_0xcbc9('0x1a')](function(_0x4c62af){if(_0x4c62af){return _0x4c62af['setTags'](_0x2cd201[_0xcbc9('0x3a')][_0xcbc9('0x49')],_[_0xcbc9('0x3e')](_0x2cd201[_0xcbc9('0x3a')],[_0xcbc9('0x49'),'id'])||{})[_0xcbc9('0x4a')](function(){return db[_0xcbc9('0x4b')][_0xcbc9('0x27')]({'attributes':['id',_0xcbc9('0x1e'),_0xcbc9('0x4c')],'where':{'id':_0x2cd201[_0xcbc9('0x3a')][_0xcbc9('0x49')]}});})[_0xcbc9('0x1a')](function(_0x368d57){socket['emit']('faxInteractionTags:save',{'id':Number(_0x2cd201[_0xcbc9('0x2a')]['id']),'tags':_0x368d57||[]});return{'id':Number(_0x2cd201['params']['id']),'tags':_0x368d57||[]};});}})[_0xcbc9('0x1a')](respondWithResult(_0x5d45af,null))[_0xcbc9('0x38')](handleError(_0x5d45af,null));};exports[_0xcbc9('0x4d')]=function(_0x4b6b1b,_0x5cc28a){return db['FaxInteraction'][_0xcbc9('0x37')]({'where':{'id':_0x4b6b1b[_0xcbc9('0x2a')]['id']}})[_0xcbc9('0x1a')](handleEntityNotFound(_0x5cc28a,null))[_0xcbc9('0x1a')](function(_0x3dcc57){if(_0x3dcc57){return _0x3dcc57['removeTags'](_0x4b6b1b['query'][_0xcbc9('0x49')]);}})[_0xcbc9('0x1a')](respondWithStatusCode(_0x5cc28a,null))['catch'](handleError(_0x5cc28a,null));};exports[_0xcbc9('0x4e')]=function(_0x82e637,_0x4fa68c){var _0x28334a=moment()['unix']()[_0xcbc9('0x4f')]();var _0x2a4195=path[_0xcbc9('0x50')](config[_0xcbc9('0x51')],_0xcbc9('0x52'),_0xcbc9('0x53'),_0xcbc9('0x54'));var _0xdc673a=path[_0xcbc9('0x50')](config['root'],_0xcbc9('0x52'),'files',_0xcbc9('0x55'));var _0x2376ca=path[_0xcbc9('0x50')](_0x2a4195,_0x28334a);var _0xd5451c=util[_0xcbc9('0x56')](_0xcbc9('0x57'),_0x82e637[_0xcbc9('0x2a')]['id'],_0x28334a);var _0x810223=path[_0xcbc9('0x50')](_0x2a4195,_0xd5451c);var _0x40670c=[];_0x40670c[_0xcbc9('0x58')]({'model':db[_0xcbc9('0x59')],'as':_0xcbc9('0x59'),'raw':!![]});var _0x838f30=[{'model':db['FaxMessage'],'as':_0xcbc9('0x5a'),'attributes':['id',_0xcbc9('0x3a'),'createdAt'],'include':_0x40670c}];return db[_0xcbc9('0x22')]['find']({'where':{'id':_0x82e637[_0xcbc9('0x2a')]['id']},'include':_0x838f30})[_0xcbc9('0x1a')](handleEntityNotFound(_0x4fa68c,null))[_0xcbc9('0x1a')](function(_0x55e671){if(_0x55e671&&_0x55e671['Messages']){var _0x219ab1=_0x55e671['get']({'plain':!![]});fs[_0xcbc9('0x5b')](_0x2376ca);for(var _0x111fd0=0x0;_0x111fd0<_0x219ab1['Messages'][_0xcbc9('0x32')];_0x111fd0++){var _0x55653d=_0x219ab1[_0xcbc9('0x5a')][_0x111fd0][_0xcbc9('0x59')];if(_0x55653d){var _0xb53892=path[_0xcbc9('0x50')](_0xdc673a,_0x55653d['basename']);if(fs[_0xcbc9('0x5c')](_0xb53892)){fs[_0xcbc9('0x5d')](_0xb53892)[_0xcbc9('0x5e')](fs[_0xcbc9('0x5f')](path['join'](_0x2376ca,_0x55653d[_0xcbc9('0x60')])));}}}return BPromise['resolve']()[_0xcbc9('0x1a')](function(){return new BPromise(function(_0x14ab1d,_0x596332){zipdir(_0x2376ca,{'saveTo':_0x810223},function(_0x2a9259,_0x37571e){if(_0x2a9259)return _0x596332(_0x2a9259);return _0x14ab1d(_0x37571e);});})[_0xcbc9('0x1a')](function(){return new BPromise(function(_0x58b193,_0x569f68){rimraf(_0x2376ca,function(_0x493b41){if(_0x493b41)_0x569f68(_0x493b41);return _0x58b193();});});})['then'](function(){return _0x4fa68c[_0xcbc9('0x4e')](_0x810223,_0xd5451c,function(_0x3b92df){if(_0x3b92df){console['log']('err',_0x3b92df);}else{fs[_0xcbc9('0x61')](_0x810223);}});});});}else{return _0x4fa68c[_0xcbc9('0x62')](0xc8);}})['catch'](handleError(_0x4fa68c,null));};
\ No newline at end of file
index 5f7f53a..491e13b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5573=['emit','catch','hook','exports','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x4a6102,_0xedf422){var _0x416650=function(_0x4be9ec){while(--_0x4be9ec){_0x4a6102['push'](_0x4a6102['shift']());}};_0x416650(++_0xedf422);}(_0x5573,0x18b));var _0x3557=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x5573[_0x291d3f];return _0x242080;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x3557('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0x3557('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3557('0x2')](0x0);var events={'afterCreate':_0x3557('0x3'),'afterUpdate':_0x3557('0x4'),'afterDestroy':_0x3557('0x5')};function emitEvent(_0xc77de9){return function(_0x32375a,_0xfd69f4,_0x4de78e){_0x32375a['getUsers']({'attributes':['id'],'raw':!![]})[_0x3557('0x6')](function(_0x3ad0f6){_0x32375a[_0x3557('0x7')](_0x3557('0x8'),_0x3ad0f6[_0x3557('0x9')](function(_0x3d6156){return{'id':_0x3d6156['id']};}));return FaxMessage[_0x3557('0xa')]({'where':{'FaxInteractionId':_0x32375a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3557('0x6')](function(_0x2ab4a3){_0x32375a[_0x3557('0x7')](_0x3557('0xb'),_0x2ab4a3[_0x3557('0xc')]);FaxInteractionEvents[_0x3557('0xd')](_0xc77de9+':'+_0x32375a['id'],_0x32375a);FaxInteractionEvents['emit'](_0xc77de9,_0x32375a);_0x4de78e(null);})[_0x3557('0xe')](_0x4de78e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x3557('0xf')](e,emitEvent(event));}}module[_0x3557('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xa197=['getUsers','setDataValue','Users','findAll','then','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x30f0aa,_0x5e5063){var _0x489a8d=function(_0x42b1c2){while(--_0x42b1c2){_0x30f0aa['push'](_0x30f0aa['shift']());}};_0x489a8d(++_0x5e5063);}(_0xa197,0x160));var _0x7a19=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xa197[_0x455c6c];return _0x488242;};'use strict';var EventEmitter=require(_0x7a19('0x0'));var FaxInteraction=require(_0x7a19('0x1'))['db'][_0x7a19('0x2')];var FaxMessage=require(_0x7a19('0x1'))['db'][_0x7a19('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7a19('0x4')](0x0);var events={'afterCreate':_0x7a19('0x5'),'afterUpdate':_0x7a19('0x6'),'afterDestroy':_0x7a19('0x7')};function emitEvent(_0x41fb2d){return function(_0x5c0f7e,_0x2089f4,_0x5b0726){_0x5c0f7e[_0x7a19('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x33f013){_0x5c0f7e[_0x7a19('0x9')](_0x7a19('0xa'),_0x33f013['map'](function(_0x56661a){return{'id':_0x56661a['id']};}));return FaxMessage[_0x7a19('0xb')]({'where':{'FaxInteractionId':_0x5c0f7e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7a19('0xc')](function(_0x4708ee){_0x5c0f7e[_0x7a19('0x9')](_0x7a19('0xd'),_0x4708ee['length']);FaxInteractionEvents[_0x7a19('0xe')](_0x41fb2d+':'+_0x5c0f7e['id'],_0x5c0f7e);FaxInteractionEvents[_0x7a19('0xe')](_0x41fb2d,_0x5c0f7e);_0x5b0726(null);})[_0x7a19('0xf')](_0x5b0726(null));};}for(var e in events){if(events[_0x7a19('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x7a19('0x11')]=FaxInteractionEvents;
\ No newline at end of file
index fa782a4..7822cc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45c8=['fax_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxInteraction.attributes','define','FaxInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45c8,0x8b));var _0x845c=function(_0x504381,_0x3bc661){_0x504381=_0x504381-0x0;var _0xbf2843=_0x45c8[_0x504381];return _0xbf2843;};'use strict';var _=require(_0x845c('0x0'));var util=require(_0x845c('0x1'));var logger=require(_0x845c('0x2'))(_0x845c('0x3'));var moment=require(_0x845c('0x4'));var BPromise=require(_0x845c('0x5'));var rp=require(_0x845c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x845c('0x7'));var config=require('../../config/environment');var attributes=require(_0x845c('0x8'));module['exports']=function(_0x546795,_0x4211ae){return _0x546795[_0x845c('0x9')](_0x845c('0xa'),attributes,{'tableName':_0x845c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5723f1,_0x299d37,_0x50e944){if(_0x5723f1['changed']('closed')){_0x5723f1[_0x845c('0xc')]=moment()[_0x845c('0xd')](_0x845c('0xe'));}_0x50e944(null,_0x5723f1);}}});};
\ No newline at end of file
+var _0x2689=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','changed','closed','closedAt'];(function(_0x94317c,_0x5688bf){var _0x2234cb=function(_0x437313){while(--_0x437313){_0x94317c['push'](_0x94317c['shift']());}};_0x2234cb(++_0x5688bf);}(_0x2689,0x6a));var _0x9268=function(_0x4f2a67,_0x5def7a){_0x4f2a67=_0x4f2a67-0x0;var _0x333700=_0x2689[_0x4f2a67];return _0x333700;};'use strict';var _=require(_0x9268('0x0'));var util=require(_0x9268('0x1'));var logger=require(_0x9268('0x2'))('api');var moment=require(_0x9268('0x3'));var BPromise=require('bluebird');var rp=require(_0x9268('0x4'));var fs=require('fs');var path=require(_0x9268('0x5'));var rimraf=require(_0x9268('0x6'));var config=require(_0x9268('0x7'));var attributes=require(_0x9268('0x8'));module[_0x9268('0x9')]=function(_0x185681,_0x45490a){return _0x185681['define']('FaxInteraction',attributes,{'tableName':_0x9268('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39d127,_0xd57f65,_0x26bb34){if(_0x39d127[_0x9268('0xb')](_0x9268('0xc'))){_0x39d127[_0x9268('0xd')]=moment()['format'](_0x9268('0xe'));}_0x26bb34(null,_0x39d127);}}});};
\ No newline at end of file
index 282f6fe..dbd975b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd2f=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','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','message','result','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xbd2f,0x166));var _0xfbd2=function(_0x1d9d37,_0x5f0a87){_0x1d9d37=_0x1d9d37-0x0;var _0xdee737=_0xbd2f[_0x1d9d37];return _0xdee737;};'use strict';var _=require(_0xfbd2('0x0'));var util=require(_0xfbd2('0x1'));var moment=require(_0xfbd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbd2('0x3'));var fs=require('fs');var Redis=require(_0xfbd2('0x4'));var db=require(_0xfbd2('0x5'))['db'];var utils=require(_0xfbd2('0x6'));var logger=require('../../config/logger')(_0xfbd2('0x7'));var config=require('../../config/environment');var jayson=require(_0xfbd2('0x8'));var client=jayson[_0xfbd2('0x9')][_0xfbd2('0xa')]({'port':0x232a});config['redis']=_[_0xfbd2('0xb')](config[_0xfbd2('0xc')],{'host':_0xfbd2('0xd'),'port':0x18eb});var socket=require(_0xfbd2('0xe'))(new Redis(config[_0xfbd2('0xc')]));require(_0xfbd2('0xf'))['register'](socket);function respondWithRpcPromise(_0x9d7e6b,_0x1449a9,_0x37f86d){return new BPromise(function(_0x45440a,_0x551b56){return client[_0xfbd2('0x10')](_0x9d7e6b,_0x37f86d)[_0xfbd2('0x11')](function(_0x1e1fda){logger[_0xfbd2('0x12')](_0xfbd2('0x13'),_0x1449a9,'request\x20sent');logger[_0xfbd2('0x14')](_0xfbd2('0x15'),_0x1449a9,_0xfbd2('0x16'),JSON[_0xfbd2('0x17')](_0x1e1fda));if(_0x1e1fda[_0xfbd2('0x18')]){if(_0x1e1fda[_0xfbd2('0x18')][_0xfbd2('0x19')]===0x1f4){logger[_0xfbd2('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x1449a9,_0x1e1fda[_0xfbd2('0x18')][_0xfbd2('0x1a')]);return _0x551b56(_0x1e1fda[_0xfbd2('0x18')]['message']);}logger[_0xfbd2('0x18')](_0xfbd2('0x13'),_0x1449a9,_0x1e1fda[_0xfbd2('0x18')][_0xfbd2('0x1a')]);return _0x45440a(_0x1e1fda['error'][_0xfbd2('0x1a')]);}else{logger[_0xfbd2('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x1449a9,_0xfbd2('0x16'));_0x45440a(_0x1e1fda[_0xfbd2('0x1b')][_0xfbd2('0x1a')]);}})[_0xfbd2('0x1c')](function(_0x28331f){logger[_0xfbd2('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x1449a9,_0x28331f);_0x551b56(_0x28331f);});});}exports[_0xfbd2('0x1d')]=function(_0x2a9ca6){var _0x4c3b57=this;return new Promise(function(_0x574c7d,_0x63319c){return db[_0xfbd2('0x1e')][_0xfbd2('0x1f')](_0x2a9ca6[_0xfbd2('0x20')],{'raw':_0x2a9ca6['options']?_0x2a9ca6[_0xfbd2('0x21')][_0xfbd2('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a9ca6[_0xfbd2('0x21')]?_0x2a9ca6[_0xfbd2('0x21')][_0xfbd2('0x23')]||null:null,'attributes':_0x2a9ca6['options']?_0x2a9ca6[_0xfbd2('0x21')]['attributes']||null:null,'limit':_0x2a9ca6[_0xfbd2('0x21')]?_0x2a9ca6['options']['limit']||null:null})[_0xfbd2('0x11')](function(_0x5af430){logger[_0xfbd2('0x12')]('UpdateFaxInteraction',_0x2a9ca6);logger[_0xfbd2('0x14')](_0xfbd2('0x1d'),_0x2a9ca6,JSON[_0xfbd2('0x17')](_0x5af430));_0x574c7d(_0x5af430);})[_0xfbd2('0x1c')](function(_0x332bb9){logger[_0xfbd2('0x18')]('UpdateFaxInteraction',_0x332bb9[_0xfbd2('0x1a')],_0x2a9ca6);_0x63319c(_0x4c3b57[_0xfbd2('0x18')](0x1f4,_0x332bb9[_0xfbd2('0x1a')]));});});};exports[_0xfbd2('0x24')]=function(_0x5caf22){return new Promise(function(_0x3fc0f3,_0x1245be){return db[_0xfbd2('0x1e')][_0xfbd2('0x25')]({'where':_0x5caf22['options']?_0x5caf22['options'][_0xfbd2('0x23')]||null:null})[_0xfbd2('0x11')](function(_0x2ee195){if(_0x2ee195){return _0x2ee195[_0xfbd2('0x26')](_0x5caf22[_0xfbd2('0x20')][_0xfbd2('0x27')],_[_0xfbd2('0x28')](_0x5caf22[_0xfbd2('0x20')],[_0xfbd2('0x27'),'id'])||{});}})[_0xfbd2('0x29')](function(_0xdc0e9a){logger['info']('AddTags',_0x5caf22);logger[_0xfbd2('0x14')](_0xfbd2('0x2a'),_0x5caf22,JSON[_0xfbd2('0x17')](_0xdc0e9a));_0x3fc0f3(_0xdc0e9a);})[_0xfbd2('0x1c')](function(_0x33c679){logger[_0xfbd2('0x18')]('AddTags',_0x33c679[_0xfbd2('0x1a')],_0x5caf22);_0x1245be(_this[_0xfbd2('0x18')](0x1f4,_0x33c679['message']));});});};
\ No newline at end of file
+var _0xcc7c=['attributes','debug','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xcc7c,0x81));var _0xccc7=function(_0x3f3272,_0x4f7010){_0x3f3272=_0x3f3272-0x0;var _0x3343b7=_0xcc7c[_0x3f3272];return _0x3343b7;};'use strict';var _=require(_0xccc7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xccc7('0x1'));var rs=require(_0xccc7('0x2'));var fs=require('fs');var Redis=require(_0xccc7('0x3'));var db=require(_0xccc7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xccc7('0x5'))(_0xccc7('0x6'));var config=require(_0xccc7('0x7'));var jayson=require(_0xccc7('0x8'));var client=jayson[_0xccc7('0x9')]['http']({'port':0x232a});config['redis']=_[_0xccc7('0xa')](config[_0xccc7('0xb')],{'host':_0xccc7('0xc'),'port':0x18eb});var socket=require(_0xccc7('0xd'))(new Redis(config[_0xccc7('0xb')]));require('./faxInteraction.socket')[_0xccc7('0xe')](socket);function respondWithRpcPromise(_0x51c5c6,_0x3769c5,_0x2e0ea3){return new BPromise(function(_0x2b7ea0,_0x268eb5){return client['request'](_0x51c5c6,_0x2e0ea3)[_0xccc7('0xf')](function(_0x5e6443){logger[_0xccc7('0x10')](_0xccc7('0x11'),_0x3769c5,_0xccc7('0x12'));logger['debug'](_0xccc7('0x13'),_0x3769c5,_0xccc7('0x12'),JSON[_0xccc7('0x14')](_0x5e6443));if(_0x5e6443[_0xccc7('0x15')]){if(_0x5e6443['error']['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3769c5,_0x5e6443[_0xccc7('0x15')][_0xccc7('0x16')]);return _0x268eb5(_0x5e6443['error'][_0xccc7('0x16')]);}logger[_0xccc7('0x15')](_0xccc7('0x11'),_0x3769c5,_0x5e6443[_0xccc7('0x15')][_0xccc7('0x16')]);return _0x2b7ea0(_0x5e6443[_0xccc7('0x15')][_0xccc7('0x16')]);}else{logger[_0xccc7('0x10')](_0xccc7('0x11'),_0x3769c5,'request\x20sent');_0x2b7ea0(_0x5e6443[_0xccc7('0x17')][_0xccc7('0x16')]);}})['catch'](function(_0x1a2348){logger[_0xccc7('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x3769c5,_0x1a2348);_0x268eb5(_0x1a2348);});});}exports[_0xccc7('0x18')]=function(_0x19ce2e){var _0x30632c=this;return new Promise(function(_0x3c1e79,_0xa376e){return db[_0xccc7('0x19')][_0xccc7('0x1a')](_0x19ce2e[_0xccc7('0x1b')],{'raw':_0x19ce2e[_0xccc7('0x1c')]?_0x19ce2e[_0xccc7('0x1c')][_0xccc7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19ce2e[_0xccc7('0x1c')]?_0x19ce2e['options'][_0xccc7('0x1e')]||null:null,'attributes':_0x19ce2e['options']?_0x19ce2e[_0xccc7('0x1c')][_0xccc7('0x1f')]||null:null,'limit':_0x19ce2e['options']?_0x19ce2e[_0xccc7('0x1c')]['limit']||null:null})[_0xccc7('0xf')](function(_0x28a093){logger[_0xccc7('0x10')]('UpdateFaxInteraction',_0x19ce2e);logger[_0xccc7('0x20')](_0xccc7('0x18'),_0x19ce2e,JSON['stringify'](_0x28a093));_0x3c1e79(_0x28a093);})['catch'](function(_0x220a87){logger[_0xccc7('0x15')](_0xccc7('0x18'),_0x220a87[_0xccc7('0x16')],_0x19ce2e);_0xa376e(_0x30632c[_0xccc7('0x15')](0x1f4,_0x220a87[_0xccc7('0x16')]));});});};exports[_0xccc7('0x21')]=function(_0x10a06c){return new Promise(function(_0x2d7c44,_0xc2d012){return db['FaxInteraction'][_0xccc7('0x22')]({'where':_0x10a06c[_0xccc7('0x1c')]?_0x10a06c[_0xccc7('0x1c')][_0xccc7('0x1e')]||null:null})[_0xccc7('0xf')](function(_0x2e17bc){if(_0x2e17bc){return _0x2e17bc[_0xccc7('0x23')](_0x10a06c[_0xccc7('0x1b')][_0xccc7('0x24')],_['omit'](_0x10a06c['body'],[_0xccc7('0x24'),'id'])||{});}})[_0xccc7('0x25')](function(_0x53cdd0){logger[_0xccc7('0x10')](_0xccc7('0x26'),_0x10a06c);logger[_0xccc7('0x20')](_0xccc7('0x26'),_0x10a06c,JSON['stringify'](_0x53cdd0));_0x2d7c44(_0x53cdd0);})[_0xccc7('0x27')](function(_0x404bca){logger[_0xccc7('0x15')](_0xccc7('0x26'),_0x404bca[_0xccc7('0x16')],_0x10a06c);_0xc2d012(_this[_0xccc7('0x15')](0x1f4,_0x404bca['message']));});});};
\ No newline at end of file
index a505500..3515d3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12af=['remove','update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x21bad5,_0x23a39d){var _0x235106=function(_0x281b1f){while(--_0x281b1f){_0x21bad5['push'](_0x21bad5['shift']());}};_0x235106(++_0x23a39d);}(_0x12af,0x1d6));var _0xf12a=function(_0x1e79f4,_0x2e4769){_0x1e79f4=_0x1e79f4-0x0;var _0x279302=_0x12af[_0x1e79f4];return _0x279302;};'use strict';var FaxInteractionEvents=require(_0xf12a('0x0'));var events=[_0xf12a('0x1'),_0xf12a('0x2'),_0xf12a('0x3')];function createListener(_0x20115d,_0x3ad1f5){return function(_0x3de423){_0x3ad1f5[_0xf12a('0x4')](_0x20115d,_0x3de423);};}function removeListener(_0x20a975,_0xbfd3d6){return function(){FaxInteractionEvents[_0xf12a('0x5')](_0x20a975,_0xbfd3d6);};}exports['register']=function(_0x449174){for(var _0x816e25=0x0,_0x59749f=events[_0xf12a('0x6')];_0x816e25<_0x59749f;_0x816e25++){var _0x4b3aa5=events[_0x816e25];var _0x5532e1=createListener(_0xf12a('0x7')+_0x4b3aa5,_0x449174);FaxInteractionEvents['on'](_0x4b3aa5,_0x5532e1);}};
\ No newline at end of file
+var _0xb896=['length','faxInteraction:','remove','update','emit','removeListener'];(function(_0x155bc9,_0x32772a){var _0x10361e=function(_0xc7a009){while(--_0xc7a009){_0x155bc9['push'](_0x155bc9['shift']());}};_0x10361e(++_0x32772a);}(_0xb896,0x6e));var _0x6b89=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0xb896[_0x2ca616];return _0x53155f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x6b89('0x0'),_0x6b89('0x1')];function createListener(_0x62b1f2,_0x3108b0){return function(_0xbd07d8){_0x3108b0[_0x6b89('0x2')](_0x62b1f2,_0xbd07d8);};}function removeListener(_0x339ddd,_0xf425a6){return function(){FaxInteractionEvents[_0x6b89('0x3')](_0x339ddd,_0xf425a6);};}exports['register']=function(_0x2ea60d){for(var _0x25ee83=0x0,_0x58d743=events[_0x6b89('0x4')];_0x25ee83<_0x58d743;_0x25ee83++){var _0x268fc8=events[_0x25ee83];var _0x5e6fb0=createListener(_0x6b89('0x5')+_0x268fc8,_0x2ea60d);FaxInteractionEvents['on'](_0x268fc8,_0x5e6fb0);}};
\ No newline at end of file
index 83edf43..797c008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1539=['faxinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','update','delete'];(function(_0x164c4c,_0x42d613){var _0x2ee33d=function(_0x5d2f65){while(--_0x5d2f65){_0x164c4c['push'](_0x164c4c['shift']());}};_0x2ee33d(++_0x42d613);}(_0x1539,0x139));var _0x9153=function(_0x2f6739,_0x3d9f2f){_0x2f6739=_0x2f6739-0x0;var _0x41662c=_0x1539[_0x2f6739];return _0x41662c;};'use strict';var multer=require('multer');var util=require(_0x9153('0x0'));var path=require(_0x9153('0x1'));var timeout=require(_0x9153('0x2'));var express=require('express');var router=express[_0x9153('0x3')]();var fs_extra=require(_0x9153('0x4'));var auth=require(_0x9153('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9153('0x6'));var controller=require(_0x9153('0x7'));router['get']('/',auth[_0x9153('0x8')](),controller['index']);router[_0x9153('0x9')]('/describe',auth[_0x9153('0x8')](),controller[_0x9153('0xa')]);router[_0x9153('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9153('0xb')]);router['get'](_0x9153('0xc'),auth[_0x9153('0x8')](),controller[_0x9153('0xd')]);router['get'](_0x9153('0xe'),auth[_0x9153('0x8')](),controller[_0x9153('0xf')]);router[_0x9153('0x10')]('/',auth[_0x9153('0x8')](),controller[_0x9153('0x11')]);router[_0x9153('0x10')](_0x9153('0xc'),auth[_0x9153('0x8')](),controller[_0x9153('0x12')]);router[_0x9153('0x10')](_0x9153('0x13'),auth[_0x9153('0x8')](),interaction[_0x9153('0x14')](_0x9153('0x15'),_0x9153('0x16')),controller[_0x9153('0x17')]);router[_0x9153('0x18')](_0x9153('0x19'),auth[_0x9153('0x8')](),interaction[_0x9153('0x14')]('fax','faxinteraction:update'),controller[_0x9153('0x1a')]);router[_0x9153('0x1b')](_0x9153('0x19'),auth[_0x9153('0x8')](),interaction[_0x9153('0x14')](_0x9153('0x15'),_0x9153('0x1c')),controller[_0x9153('0x1d')]);router[_0x9153('0x1b')](_0x9153('0x13'),auth['isAuthenticated'](),controller[_0x9153('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x1a1c=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','get','/describe','describe','/:id','show','isAuthenticated','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete'];(function(_0x1223ad,_0x11f7ac){var _0xdb2cec=function(_0x5e9489){while(--_0x5e9489){_0x1223ad['push'](_0x1223ad['shift']());}};_0xdb2cec(++_0x11f7ac);}(_0x1a1c,0xfe));var _0xc1a1=function(_0x189b89,_0x8b26a){_0x189b89=_0x189b89-0x0;var _0x44e166=_0x1a1c[_0x189b89];return _0x44e166;};'use strict';var multer=require(_0xc1a1('0x0'));var util=require(_0xc1a1('0x1'));var path=require(_0xc1a1('0x2'));var timeout=require(_0xc1a1('0x3'));var express=require('express');var router=express[_0xc1a1('0x4')]();var fs_extra=require(_0xc1a1('0x5'));var auth=require(_0xc1a1('0x6'));var interaction=require(_0xc1a1('0x7'));var config=require(_0xc1a1('0x8'));var controller=require(_0xc1a1('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc1a1('0xa')]);router[_0xc1a1('0xb')](_0xc1a1('0xc'),auth['isAuthenticated'](),controller[_0xc1a1('0xd')]);router[_0xc1a1('0xb')](_0xc1a1('0xe'),auth['isAuthenticated'](),controller[_0xc1a1('0xf')]);router[_0xc1a1('0xb')]('/:id/messages',auth[_0xc1a1('0x10')](),controller[_0xc1a1('0x11')]);router['get']('/:id/download',auth[_0xc1a1('0x10')](),controller[_0xc1a1('0x12')]);router[_0xc1a1('0x13')]('/',auth[_0xc1a1('0x10')](),controller[_0xc1a1('0x14')]);router[_0xc1a1('0x13')](_0xc1a1('0x15'),auth[_0xc1a1('0x10')](),controller[_0xc1a1('0x16')]);router[_0xc1a1('0x13')](_0xc1a1('0x17'),auth[_0xc1a1('0x10')](),interaction[_0xc1a1('0x18')](_0xc1a1('0x19'),_0xc1a1('0x1a')),controller[_0xc1a1('0x1b')]);router[_0xc1a1('0x1c')](_0xc1a1('0xe'),auth[_0xc1a1('0x10')](),interaction[_0xc1a1('0x18')](_0xc1a1('0x19'),_0xc1a1('0x1d')),controller[_0xc1a1('0x1e')]);router['delete'](_0xc1a1('0xe'),auth[_0xc1a1('0x10')](),interaction[_0xc1a1('0x18')](_0xc1a1('0x19'),_0xc1a1('0x1f')),controller[_0xc1a1('0x20')]);router[_0xc1a1('0x21')](_0xc1a1('0x17'),auth[_0xc1a1('0x10')](),controller[_0xc1a1('0x22')]);module[_0xc1a1('0x23')]=router;
\ No newline at end of file
index b4a5e13..78ce48c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bca=['out','TEXT','exports','BOOLEAN'];(function(_0x36068f,_0x5d0f76){var _0x3a0e46=function(_0x5ed993){while(--_0x5ed993){_0x36068f['push'](_0x36068f['shift']());}};_0x3a0e46(++_0x5d0f76);}(_0x1bca,0xb6));var _0xa1bc=function(_0x246a9e,_0xdeb42d){_0x246a9e=_0x246a9e-0x0;var _0x395583=_0x1bca[_0x246a9e];return _0x395583;};'use strict';var Sequelize=require('sequelize');module[_0xa1bc('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa1bc('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa1bc('0x2')),'defaultValue':_0xa1bc('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa1bc('0x3')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xacfe=['DATE','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xacfe,0xfd));var _0xeacf=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xacfe[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xeacf('0x0')](_0xeacf('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xeacf('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeacf('0x3')]('in',_0xeacf('0x4')),'defaultValue':_0xeacf('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xeacf('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xeacf('0x5')]}};
\ No newline at end of file
index 709033d..a33c416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f7e=['error','code','message','info','result','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','body','find','describe','fax-interactions','accept','fax','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','event','acceptmessage','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','motionChannel','EventManager','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','Attachment','basename','zip-dir','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','client','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x7f7e,0x178));var _0xe7f7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7f7e[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7f7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7f7('0x1'));var moment=require('moment');var BPromise=require(_0xe7f7('0x2'));var Mustache=require(_0xe7f7('0x3'));var util=require('util');var path=require('path');var sox=require(_0xe7f7('0x4'));var csv=require(_0xe7f7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe7f7('0x6'));var _=require(_0xe7f7('0x7'));var squel=require(_0xe7f7('0x8'));var crypto=require(_0xe7f7('0x9'));var jsforce=require(_0xe7f7('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe7f7('0xb'));var Papa=require(_0xe7f7('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe7f7('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7f7('0xe'));var logger=require(_0xe7f7('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xe7f7('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7f7('0x11'))['db'];config['redis']=_[_0xe7f7('0x12')](config[_0xe7f7('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xe7f7('0x14'))(new Redis(config[_0xe7f7('0x13')]));require('./faxMessage.socket')[_0xe7f7('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe7f7('0x16')][_0xe7f7('0x17')]({'port':0x232c});var client9002=jayson['client'][_0xe7f7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5d0679,_0x4015ce,_0x75a926,_0x5c8836){return new BPromise(function(_0xeb8136,_0x3ab833){var _0x261e82=_0x5c8836||client;return _0x261e82['request'](_0x5d0679,_0x75a926)[_0xe7f7('0x18')](function(_0x395250){logger['info'](_0xe7f7('0x19'),_0x4015ce,_0xe7f7('0x1a'));logger['debug'](_0xe7f7('0x1b'),_0x4015ce,_0xe7f7('0x1a'),JSON[_0xe7f7('0x1c')](_0x395250));if(_0x395250[_0xe7f7('0x1d')]){if(_0x395250[_0xe7f7('0x1d')][_0xe7f7('0x1e')]===0x1f4){logger[_0xe7f7('0x1d')](_0xe7f7('0x19'),_0x4015ce,_0x395250[_0xe7f7('0x1d')][_0xe7f7('0x1f')]);return _0x3ab833(_0x395250['error']['message']);}logger[_0xe7f7('0x1d')](_0xe7f7('0x19'),_0x4015ce,_0x395250[_0xe7f7('0x1d')][_0xe7f7('0x1f')]);return _0xeb8136(_0x395250[_0xe7f7('0x1d')][_0xe7f7('0x1f')]);}else{logger[_0xe7f7('0x20')](_0xe7f7('0x19'),_0x4015ce,'request\x20sent');_0xeb8136(_0x395250[_0xe7f7('0x21')][_0xe7f7('0x1f')]);}})['catch'](function(_0x2eec0c){logger[_0xe7f7('0x1d')]('FaxMessage,\x20%s,\x20%s',_0x4015ce,_0x2eec0c);_0x3ab833(_0x2eec0c);});});}function respondWithStatusCode(_0x3d18a2,_0x2d2769){_0x2d2769=_0x2d2769||0xcc;return function(_0x3037e8){if(_0x3037e8){return _0x3d18a2['sendStatus'](_0x2d2769);}return _0x3d18a2[_0xe7f7('0x22')](_0x2d2769)[_0xe7f7('0x23')]();};}function respondWithResult(_0x7d3311,_0x2fa41f){_0x2fa41f=_0x2fa41f||0xc8;return function(_0x19437e){if(_0x19437e){return _0x7d3311[_0xe7f7('0x22')](_0x2fa41f)[_0xe7f7('0x24')](_0x19437e);}};}function respondWithFilteredResult(_0x5c7d3b,_0x4dd8de){return function(_0x13fe39){if(_0x13fe39){var _0x31b4af=typeof _0x4dd8de[_0xe7f7('0x25')]===_0xe7f7('0x26')&&typeof _0x4dd8de['limit']===_0xe7f7('0x26');var _0x4775c4=_0x13fe39[_0xe7f7('0x27')];var _0x330022=_0x31b4af?0x0:_0x4dd8de[_0xe7f7('0x25')];var _0x50813f=_0x31b4af?_0x13fe39[_0xe7f7('0x27')]:_0x4dd8de[_0xe7f7('0x25')]+_0x4dd8de[_0xe7f7('0x28')];var _0x337ea0;if(_0x50813f>=_0x4775c4){_0x50813f=_0x4775c4;_0x337ea0=0xc8;}else{_0x337ea0=0xce;}_0x5c7d3b[_0xe7f7('0x22')](_0x337ea0);return _0x5c7d3b['set']('Content-Range',_0x330022+'-'+_0x50813f+'/'+_0x4775c4)[_0xe7f7('0x24')](_0x13fe39);}return null;};}function patchUpdates(_0x52a3ac){return function(_0x1bfe0b){try{jsonpatch[_0xe7f7('0x29')](_0x1bfe0b,_0x52a3ac,!![]);}catch(_0xba7971){return BPromise[_0xe7f7('0x2a')](_0xba7971);}return _0x1bfe0b[_0xe7f7('0x2b')]();};}function saveUpdates(_0x280584,_0x39230c){return function(_0x2be622){if(_0x2be622){return _0x2be622[_0xe7f7('0x2c')](_0x280584)[_0xe7f7('0x18')](function(_0x52f117){return _0x52f117;});}return null;};}function removeEntity(_0x357dec,_0xb43aaf){return function(_0x176779){if(_0x176779){return _0x176779[_0xe7f7('0x2d')]()[_0xe7f7('0x18')](function(){_0x357dec[_0xe7f7('0x22')](0xcc)[_0xe7f7('0x23')]();});}};}function handleEntityNotFound(_0x15e55b,_0x4b0910){return function(_0xa7c35c){if(!_0xa7c35c){_0x15e55b[_0xe7f7('0x2e')](0x194);}return _0xa7c35c;};}function handleError(_0x4bd546,_0x28bb56){_0x28bb56=_0x28bb56||0x1f4;return function(_0x4acc36){logger[_0xe7f7('0x1d')](_0x4acc36[_0xe7f7('0x2f')]);if(_0x4acc36[_0xe7f7('0x30')]){delete _0x4acc36['name'];}_0x4bd546[_0xe7f7('0x22')](_0x28bb56)['send'](_0x4acc36);};}exports[_0xe7f7('0x31')]=function(_0xfd2a17,_0x36be53){var _0x14bb3c={},_0x5e390b={},_0x420798={'count':0x0,'rows':[]};var _0x5d5515=_[_0xe7f7('0x32')](db[_0xe7f7('0x33')][_0xe7f7('0x34')],function(_0x231d6f){return{'name':_0x231d6f[_0xe7f7('0x35')],'type':_0x231d6f[_0xe7f7('0x36')][_0xe7f7('0x37')]};});_0x5e390b['model']=_['map'](_0x5d5515,_0xe7f7('0x30'));_0x5e390b['query']=_[_0xe7f7('0x38')](_0xfd2a17['query']);_0x5e390b[_0xe7f7('0x39')]=_[_0xe7f7('0x3a')](_0x5e390b[_0xe7f7('0x3b')],_0x5e390b['query']);_0x14bb3c[_0xe7f7('0x3c')]=_[_0xe7f7('0x3a')](_0x5e390b['model'],qs[_0xe7f7('0x3d')](_0xfd2a17['query'][_0xe7f7('0x3d')]));_0x14bb3c[_0xe7f7('0x3c')]=_0x14bb3c[_0xe7f7('0x3c')][_0xe7f7('0x3e')]?_0x14bb3c[_0xe7f7('0x3c')]:_0x5e390b[_0xe7f7('0x3b')];if(!_0xfd2a17[_0xe7f7('0x3f')][_0xe7f7('0x40')](_0xe7f7('0x41'))){_0x14bb3c[_0xe7f7('0x28')]=qs[_0xe7f7('0x28')](_0xfd2a17[_0xe7f7('0x3f')][_0xe7f7('0x28')]);_0x14bb3c['offset']=qs[_0xe7f7('0x25')](_0xfd2a17[_0xe7f7('0x3f')][_0xe7f7('0x25')]);}_0x14bb3c[_0xe7f7('0x42')]=qs[_0xe7f7('0x43')](_0xfd2a17[_0xe7f7('0x3f')][_0xe7f7('0x43')]);_0x14bb3c[_0xe7f7('0x44')]=qs[_0xe7f7('0x39')](_[_0xe7f7('0x45')](_0xfd2a17['query'],_0x5e390b[_0xe7f7('0x39')]),_0x5d5515);if(_0xfd2a17['query']['filter']){_0x14bb3c[_0xe7f7('0x44')]=_[_0xe7f7('0x46')](_0x14bb3c[_0xe7f7('0x44')],{'$or':_[_0xe7f7('0x32')](_0x5d5515,function(_0xe517b3){if(_0xe517b3['type']!==_0xe7f7('0x47')){var _0x16c311={};_0x16c311[_0xe517b3[_0xe7f7('0x30')]]={'$like':'%'+_0xfd2a17[_0xe7f7('0x3f')]['filter']+'%'};return _0x16c311;}})});}_0x14bb3c=_[_0xe7f7('0x46')]({},_0x14bb3c,_0xfd2a17[_0xe7f7('0x48')]);var _0x9ee0f3={'where':_0x14bb3c[_0xe7f7('0x44')]};return db['FaxMessage']['count'](_0x9ee0f3)[_0xe7f7('0x18')](function(_0x57472e){_0x420798[_0xe7f7('0x27')]=_0x57472e;if(_0xfd2a17[_0xe7f7('0x3f')][_0xe7f7('0x49')]){_0x14bb3c[_0xe7f7('0x4a')]=[{'all':!![]}];}return db[_0xe7f7('0x33')]['findAll'](_0x14bb3c);})[_0xe7f7('0x18')](function(_0x553b20){_0x420798[_0xe7f7('0x4b')]=_0x553b20;return _0x420798;})[_0xe7f7('0x18')](respondWithFilteredResult(_0x36be53,_0x14bb3c))[_0xe7f7('0x4c')](handleError(_0x36be53,null));};exports[_0xe7f7('0x4d')]=function(_0x150cd3,_0x4709ef){var _0x4d7279={'raw':!![],'where':{'id':_0x150cd3[_0xe7f7('0x4e')]['id']}},_0x321be8={};_0x321be8['model']=_['keys'](db[_0xe7f7('0x33')]['rawAttributes']);_0x321be8['query']=_[_0xe7f7('0x38')](_0x150cd3[_0xe7f7('0x3f')]);_0x321be8[_0xe7f7('0x39')]=_[_0xe7f7('0x3a')](_0x321be8['model'],_0x321be8[_0xe7f7('0x3f')]);_0x4d7279['attributes']=_[_0xe7f7('0x3a')](_0x321be8[_0xe7f7('0x3b')],qs[_0xe7f7('0x3d')](_0x150cd3['query'][_0xe7f7('0x3d')]));_0x4d7279[_0xe7f7('0x3c')]=_0x4d7279[_0xe7f7('0x3c')]['length']?_0x4d7279[_0xe7f7('0x3c')]:_0x321be8[_0xe7f7('0x3b')];if(_0x150cd3['query'][_0xe7f7('0x49')]){_0x4d7279[_0xe7f7('0x4a')]=[{'all':!![]}];}_0x4d7279=_[_0xe7f7('0x46')]({},_0x4d7279,_0x150cd3['options']);return db[_0xe7f7('0x33')]['find'](_0x4d7279)['then'](handleEntityNotFound(_0x4709ef,null))[_0xe7f7('0x18')](respondWithResult(_0x4709ef,null))['catch'](handleError(_0x4709ef,null));};exports['update']=function(_0x2b778e,_0x2bb2b9){if(_0x2b778e[_0xe7f7('0x4f')]['id']){delete _0x2b778e[_0xe7f7('0x4f')]['id'];}return db[_0xe7f7('0x33')][_0xe7f7('0x50')]({'where':{'id':_0x2b778e[_0xe7f7('0x4e')]['id']}})[_0xe7f7('0x18')](handleEntityNotFound(_0x2bb2b9,null))[_0xe7f7('0x18')](saveUpdates(_0x2b778e['body'],null))[_0xe7f7('0x18')](respondWithResult(_0x2bb2b9,null))[_0xe7f7('0x4c')](handleError(_0x2bb2b9,null));};exports[_0xe7f7('0x2d')]=function(_0x19c72f,_0x2166c5){return db['FaxMessage'][_0xe7f7('0x50')]({'where':{'id':_0x19c72f[_0xe7f7('0x4e')]['id']}})[_0xe7f7('0x18')](handleEntityNotFound(_0x2166c5,null))['then'](removeEntity(_0x2166c5,null))[_0xe7f7('0x4c')](handleError(_0x2166c5,null));};exports['describe']=function(_0x23168e,_0x2c580f){return db[_0xe7f7('0x33')][_0xe7f7('0x51')]()['then'](respondWithResult(_0x2c580f,null))['catch'](handleError(_0x2c580f,null));};var interaction_log=require('../../config/logger')(_0xe7f7('0x52'));exports[_0xe7f7('0x53')]=function(_0x253982,_0x5ccfed,_0x19e30b){var _0x4412cf={'agent':{},'channel':_0xe7f7('0x54')};if(_0x253982[_0xe7f7('0x4f')]['id']){delete _0x253982[_0xe7f7('0x4f')]['id'];}_0x253982[_0xe7f7('0x4f')]['read']=!![];_0x253982[_0xe7f7('0x4f')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x253982[_0xe7f7('0x4f')][_0xe7f7('0x55')]=_0x253982['body'][_0xe7f7('0x55')]||_0x253982[_0xe7f7('0x56')]['id'];_0x4412cf[_0xe7f7('0x57')]['id']=_0x253982[_0xe7f7('0x4f')][_0xe7f7('0x55')];return db[_0xe7f7('0x33')]['find']({'where':{'id':_0x253982[_0xe7f7('0x4e')]['id'],'UserId':null}})[_0xe7f7('0x18')](handleEntityNotFound(_0x5ccfed,null))[_0xe7f7('0x18')](saveUpdates(_0x253982[_0xe7f7('0x4f')],null))['then'](function(_0x3a1cb2){if(_0x3a1cb2){_0x4412cf['message']=_0x3a1cb2['get']({'plain':!![]});return db[_0xe7f7('0x58')][_0xe7f7('0x50')]({'where':{'id':_0x3a1cb2[_0xe7f7('0x59')]}});}return null;})[_0xe7f7('0x18')](handleEntityNotFound(_0x5ccfed,null))[_0xe7f7('0x18')](function(_0xc871c3){if(_0xc871c3){return _0xc871c3[_0xe7f7('0x2c')]({'UserId':_0x253982['body'][_0xe7f7('0x55')],'read1stAt':_[_0xe7f7('0x5a')](_0xc871c3[_0xe7f7('0x5b')])?moment()[_0xe7f7('0x5c')](_0xe7f7('0x5d')):undefined});}return null;})['then'](function(_0x5227bc){if(_0x5227bc){_0x4412cf[_0xe7f7('0x5e')]=_0x5227bc['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x253982[_0xe7f7('0x56')]['id'],_0x253982[_0xe7f7('0x56')]['name'],_0x253982['user']['role'],_0x4412cf[_0xe7f7('0x5e')]['id'],_0x253982[_0xe7f7('0x4f')]?JSON[_0xe7f7('0x1c')](_0x253982[_0xe7f7('0x4f')]):_0xe7f7('0x5f'));return respondWithRpcPromise(_0xe7f7('0x60'),_0xe7f7('0x61'),_0x4412cf);}return null;})[_0xe7f7('0x18')](function(_0x42d4cb){var _0x31c5e0=_0xe7f7('0x62')+_0x42d4cb['message'][_0xe7f7('0x63')];return db[_0xe7f7('0x64')]['query'](_0x31c5e0,{'type':db[_0xe7f7('0x65')][_0xe7f7('0x66')][_0xe7f7('0x67')],'raw':!![]})['then'](function(_0x440bf6){return _0x440bf6;});})[_0xe7f7('0x18')](function(_0x477323){if(_0x477323){_0x4412cf['message'][_0xe7f7('0x68')]=_0x477323[0x0];if(!_0x253982['body'][_0xe7f7('0x55')])return;return db[_0xe7f7('0x69')][_0xe7f7('0x50')]({'where':{'id':_0x253982[_0xe7f7('0x4f')]['UserId'],'role':_0xe7f7('0x57')},'attributes':['id','name','fullname',_0xe7f7('0x6a'),_0xe7f7('0x6b')],'raw':!![]});}return null;})['then'](function(_0x5692ab){if(!_0x5692ab)return null;_0x4412cf[_0xe7f7('0x1f')][_0xe7f7('0x57')]=_0x5692ab;return _0x4412cf;})['then'](function(_0x28424f){if(_0x28424f){if(_0x253982[_0xe7f7('0x4f')][_0xe7f7('0x6c')]){_0x4412cf[_0xe7f7('0x1f')]['interface']=util[_0xe7f7('0x5c')](_0xe7f7('0x6d'),_0x253982[_0xe7f7('0x56')]['name']);_0x4412cf[_0xe7f7('0x1f')][_0xe7f7('0x6e')]=_0x4412cf[_0xe7f7('0x6e')];_0x4412cf[_0xe7f7('0x1f')]['motionChannel']=_0x4412cf[_0xe7f7('0x6e')];_0x4412cf['message'][_0xe7f7('0x6f')]=_0xe7f7('0x53');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xe7f7('0x70'),'message':_0x4412cf['message']},client9002)['then'](function(){return _0x4412cf;});}return _0x4412cf;}return null;})[_0xe7f7('0x18')](respondWithResult(_0x5ccfed,null))['catch'](handleError(_0x5ccfed,null));};var interaction_log=require(_0xe7f7('0xf'))(_0xe7f7('0x52'));exports['reject']=function(_0x65efca,_0x1b3e12,_0x304330){var _0x26967d={'agent':{},'channel':'fax'};if(_0x65efca[_0xe7f7('0x4f')]['id']){delete _0x65efca[_0xe7f7('0x4f')]['id'];}_0x65efca[_0xe7f7('0x4f')][_0xe7f7('0x55')]=_0x65efca[_0xe7f7('0x4f')]['UserId']||_0x65efca[_0xe7f7('0x56')]['id'];_0x26967d[_0xe7f7('0x57')]['id']=_0x65efca[_0xe7f7('0x4f')]['UserId'];return db[_0xe7f7('0x33')]['find']({'where':{'id':_0x65efca[_0xe7f7('0x4e')]['id'],'UserId':null}})[_0xe7f7('0x18')](handleEntityNotFound(_0x1b3e12,null))[_0xe7f7('0x18')](function(_0x4e1c50){if(_0x4e1c50){_0x26967d['message']=_0x4e1c50['get']({'plain':!![]});return db[_0xe7f7('0x58')]['find']({'where':{'id':_0x4e1c50[_0xe7f7('0x59')]}});}return null;})[_0xe7f7('0x18')](handleEntityNotFound(_0x1b3e12,null))[_0xe7f7('0x18')](function(_0x3f0def){if(_0x3f0def){_0x26967d[_0xe7f7('0x5e')]=_0x3f0def[_0xe7f7('0x71')]({'plain':!![]});interaction_log[_0xe7f7('0x20')](_0xe7f7('0x72'),_0x65efca[_0xe7f7('0x56')]['id'],_0x65efca[_0xe7f7('0x56')][_0xe7f7('0x30')],_0x65efca[_0xe7f7('0x56')][_0xe7f7('0x73')],_0x26967d[_0xe7f7('0x5e')]['id'],_0x65efca[_0xe7f7('0x4f')]?JSON[_0xe7f7('0x1c')](_0x65efca[_0xe7f7('0x4f')]):_0xe7f7('0x5f'));return respondWithRpcPromise(_0xe7f7('0x74'),_0xe7f7('0x75'),_0x26967d);}return null;})[_0xe7f7('0x18')](function(_0x114541){var _0x1ca8d3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x114541[_0xe7f7('0x1f')]['ContactId'];return db[_0xe7f7('0x64')][_0xe7f7('0x3f')](_0x1ca8d3,{'type':db[_0xe7f7('0x65')][_0xe7f7('0x66')][_0xe7f7('0x67')],'raw':!![]})[_0xe7f7('0x18')](function(_0x3df4b6){return _0x3df4b6;});})[_0xe7f7('0x18')](function(_0x20b199){if(_0x20b199){_0x26967d[_0xe7f7('0x1f')][_0xe7f7('0x68')]=_0x20b199[0x0];if(!_0x65efca['body'][_0xe7f7('0x55')])return;return db['User'][_0xe7f7('0x50')]({'where':{'id':_0x65efca[_0xe7f7('0x4f')][_0xe7f7('0x55')],'role':_0xe7f7('0x57')},'attributes':['id',_0xe7f7('0x30'),'fullname',_0xe7f7('0x6a'),_0xe7f7('0x6b')],'raw':!![]});}return null;})[_0xe7f7('0x18')](function(_0x49cd91){if(!_0x49cd91)return null;_0x26967d[_0xe7f7('0x1f')][_0xe7f7('0x57')]=_0x49cd91;return _0x26967d;})[_0xe7f7('0x18')](function(_0xa6d841){if(_0xa6d841){_0xa6d841[_0xe7f7('0x1f')]['interface']=util['format'](_0xe7f7('0x6d'),_0x65efca['user'][_0xe7f7('0x30')]);_0xa6d841[_0xe7f7('0x1f')]['channel']=_0x26967d[_0xe7f7('0x6e')];_0xa6d841[_0xe7f7('0x1f')][_0xe7f7('0x76')]=_0x26967d[_0xe7f7('0x6e')];_0xa6d841['message'][_0xe7f7('0x6f')]=_0xe7f7('0x2a');respondWithRpcPromise(_0xe7f7('0x77'),_0xe7f7('0x77'),{'event':_0xe7f7('0x78'),'message':_0xa6d841[_0xe7f7('0x1f')]},client9002);return _0x26967d;}return null;})[_0xe7f7('0x18')](respondWithResult(_0x1b3e12,null))[_0xe7f7('0x4c')](handleError(_0x1b3e12,null));};exports[_0xe7f7('0x79')]=function(_0x4a840f,_0x13892a){var _0x324f2c;return db[_0xe7f7('0x33')][_0xe7f7('0x79')](_0x4a840f[_0xe7f7('0x4f')],{})['then'](function(_0x20e4a0){_0x324f2c=_0x20e4a0;return db[_0xe7f7('0x7a')]['findOne']({'where':{'id':_0x324f2c[_0xe7f7('0x63')]}});})['then'](function(_0x57dc5d){if(_['isNil'](_0x57dc5d)){return;}else{_0x324f2c[_0xe7f7('0x54')]=_0x57dc5d[_0xe7f7('0x54')];return db['Attachment'][_0xe7f7('0x7b')]({'where':{'id':_0x324f2c[_0xe7f7('0x7c')]}});}})[_0xe7f7('0x18')](function(_0x30c3cb){return respondWithRpcPromise('SendFax',_0xe7f7('0x7d'),{'FaxAccountId':_[_0xe7f7('0x5a')](_0x4a840f[_0xe7f7('0x4f')])?undefined:_0x4a840f[_0xe7f7('0x4f')]['FaxAccountId'],'path':_['isNil'](_0x30c3cb)?undefined:util[_0xe7f7('0x5c')](_0xe7f7('0x7e'),_0x30c3cb['basename']),'fax':_['isNil'](_0x324f2c[_0xe7f7('0x54')])?undefined:_0x324f2c[_0xe7f7('0x54')],'AttachmentId':_0x324f2c[_0xe7f7('0x7c')]},client9002);})[_0xe7f7('0x18')](respondWithResult(_0x13892a,0xc9))[_0xe7f7('0x4c')](handleError(_0x13892a,null));};exports[_0xe7f7('0x7f')]=function(_0xb1b13b,_0x430b0d){var _0x2227ae=path[_0xe7f7('0x80')](config[_0xe7f7('0x81')],_0xe7f7('0x82'),_0xe7f7('0x83'),_0xe7f7('0x84'));return db[_0xe7f7('0x33')][_0xe7f7('0x50')]({'where':{'id':_0xb1b13b['params']['id']},'include':[{'model':db[_0xe7f7('0x85')],'as':'Attachment'}]})[_0xe7f7('0x18')](handleEntityNotFound(_0x430b0d,null))[_0xe7f7('0x18')](function(_0x5aabb9){if(_0x5aabb9){return _0x430b0d[_0xe7f7('0x7f')](path['join'](_0x2227ae,_0x5aabb9[_0xe7f7('0x85')][_0xe7f7('0x86')]));}})[_0xe7f7('0x4c')](handleError(_0x430b0d,null));};
\ No newline at end of file
+var _0x8d43=['FaxMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','params','find','update','body','describe','fax','read','readAt','format','UserId','user','agent','get','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','../../config/logger','fax-interactions','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','reject','create','CmContact','findOne','Attachment','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','server','files','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','count','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','send','index','map'];(function(_0x45fdf8,_0x2cbc51){var _0x1eefaa=function(_0x4bf4e3){while(--_0x4bf4e3){_0x45fdf8['push'](_0x45fdf8['shift']());}};_0x1eefaa(++_0x2cbc51);}(_0x8d43,0xdf));var _0x38d4=function(_0x3056bf,_0x10dbef){_0x3056bf=_0x3056bf-0x0;var _0x2adc05=_0x8d43[_0x3056bf];return _0x2adc05;};'use strict';var emlformat=require(_0x38d4('0x0'));var rimraf=require(_0x38d4('0x1'));var zipdir=require(_0x38d4('0x2'));var jsonpatch=require(_0x38d4('0x3'));var rp=require(_0x38d4('0x4'));var moment=require('moment');var BPromise=require(_0x38d4('0x5'));var Mustache=require(_0x38d4('0x6'));var util=require(_0x38d4('0x7'));var path=require(_0x38d4('0x8'));var sox=require(_0x38d4('0x9'));var csv=require(_0x38d4('0xa'));var ejs=require(_0x38d4('0xb'));var fs=require('fs');var fs_extra=require(_0x38d4('0xc'));var _=require('lodash');var squel=require(_0x38d4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x38d4('0xe'));var toCsv=require(_0x38d4('0xa'));var querystring=require('querystring');var Papa=require(_0x38d4('0xf'));var Redis=require(_0x38d4('0x10'));var authService=require(_0x38d4('0x11'));var qs=require(_0x38d4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x38d4('0x13'));var utils=require(_0x38d4('0x14'));var config=require(_0x38d4('0x15'));var licenseUtil=require(_0x38d4('0x16'));var db=require(_0x38d4('0x17'))['db'];config[_0x38d4('0x18')]=_[_0x38d4('0x19')](config[_0x38d4('0x18')],{'host':_0x38d4('0x1a'),'port':0x18eb});var socket=require(_0x38d4('0x1b'))(new Redis(config[_0x38d4('0x18')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x38d4('0x1c'));var client=jayson[_0x38d4('0x1d')][_0x38d4('0x1e')]({'port':0x232c});var client9002=jayson[_0x38d4('0x1d')][_0x38d4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xafde49,_0x173262,_0xccf141,_0x2560e9){return new BPromise(function(_0x353b48,_0x3d4513){var _0x100e15=_0x2560e9||client;return _0x100e15[_0x38d4('0x1f')](_0xafde49,_0xccf141)[_0x38d4('0x20')](function(_0x478a3f){logger[_0x38d4('0x21')](_0x38d4('0x22'),_0x173262,_0x38d4('0x23'));logger[_0x38d4('0x24')](_0x38d4('0x25'),_0x173262,_0x38d4('0x23'),JSON['stringify'](_0x478a3f));if(_0x478a3f[_0x38d4('0x26')]){if(_0x478a3f['error'][_0x38d4('0x27')]===0x1f4){logger[_0x38d4('0x26')](_0x38d4('0x22'),_0x173262,_0x478a3f['error'][_0x38d4('0x28')]);return _0x3d4513(_0x478a3f['error'][_0x38d4('0x28')]);}logger[_0x38d4('0x26')](_0x38d4('0x22'),_0x173262,_0x478a3f['error'][_0x38d4('0x28')]);return _0x353b48(_0x478a3f[_0x38d4('0x26')]['message']);}else{logger[_0x38d4('0x21')](_0x38d4('0x22'),_0x173262,_0x38d4('0x23'));_0x353b48(_0x478a3f['result'][_0x38d4('0x28')]);}})[_0x38d4('0x29')](function(_0x1e64e1){logger[_0x38d4('0x26')](_0x38d4('0x22'),_0x173262,_0x1e64e1);_0x3d4513(_0x1e64e1);});});}function respondWithStatusCode(_0x4b84e,_0x21f4ab){_0x21f4ab=_0x21f4ab||0xcc;return function(_0x3a3f3f){if(_0x3a3f3f){return _0x4b84e['sendStatus'](_0x21f4ab);}return _0x4b84e[_0x38d4('0x2a')](_0x21f4ab)[_0x38d4('0x2b')]();};}function respondWithResult(_0x4eb32a,_0x2ccb31){_0x2ccb31=_0x2ccb31||0xc8;return function(_0x496a8e){if(_0x496a8e){return _0x4eb32a[_0x38d4('0x2a')](_0x2ccb31)[_0x38d4('0x2c')](_0x496a8e);}};}function respondWithFilteredResult(_0x3907c0,_0x4b1d3a){return function(_0x725600){if(_0x725600){var _0x5983d3=typeof _0x4b1d3a[_0x38d4('0x2d')]==='undefined'&&typeof _0x4b1d3a['limit']==='undefined';var _0x5a4b98=_0x725600[_0x38d4('0x2e')];var _0x576677=_0x5983d3?0x0:_0x4b1d3a[_0x38d4('0x2d')];var _0x587e65=_0x5983d3?_0x725600['count']:_0x4b1d3a[_0x38d4('0x2d')]+_0x4b1d3a[_0x38d4('0x2f')];var _0xc32c99;if(_0x587e65>=_0x5a4b98){_0x587e65=_0x5a4b98;_0xc32c99=0xc8;}else{_0xc32c99=0xce;}_0x3907c0[_0x38d4('0x2a')](_0xc32c99);return _0x3907c0[_0x38d4('0x30')](_0x38d4('0x31'),_0x576677+'-'+_0x587e65+'/'+_0x5a4b98)['json'](_0x725600);}return null;};}function patchUpdates(_0xa33369){return function(_0x579671){try{jsonpatch[_0x38d4('0x32')](_0x579671,_0xa33369,!![]);}catch(_0x299661){return BPromise['reject'](_0x299661);}return _0x579671[_0x38d4('0x33')]();};}function saveUpdates(_0x3846ff,_0x51fc23){return function(_0x26c757){if(_0x26c757){return _0x26c757['update'](_0x3846ff)[_0x38d4('0x20')](function(_0x53fd58){return _0x53fd58;});}return null;};}function removeEntity(_0x4021af,_0x1319ca){return function(_0x512592){if(_0x512592){return _0x512592[_0x38d4('0x34')]()[_0x38d4('0x20')](function(){_0x4021af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1867fc,_0x3f49dc){return function(_0x4529b4){if(!_0x4529b4){_0x1867fc[_0x38d4('0x35')](0x194);}return _0x4529b4;};}function handleError(_0x1f0062,_0x18d7c5){_0x18d7c5=_0x18d7c5||0x1f4;return function(_0x34aec2){logger[_0x38d4('0x26')](_0x34aec2[_0x38d4('0x36')]);if(_0x34aec2[_0x38d4('0x37')]){delete _0x34aec2['name'];}_0x1f0062[_0x38d4('0x2a')](_0x18d7c5)[_0x38d4('0x38')](_0x34aec2);};}exports[_0x38d4('0x39')]=function(_0xd21dc3,_0xe0edac){var _0x4c6106={},_0x32273e={},_0x5041bb={'count':0x0,'rows':[]};var _0x1ac8e6=_[_0x38d4('0x3a')](db[_0x38d4('0x3b')][_0x38d4('0x3c')],function(_0x6c49e0){return{'name':_0x6c49e0[_0x38d4('0x3d')],'type':_0x6c49e0[_0x38d4('0x3e')]['key']};});_0x32273e['model']=_[_0x38d4('0x3a')](_0x1ac8e6,_0x38d4('0x37'));_0x32273e[_0x38d4('0x3f')]=_[_0x38d4('0x40')](_0xd21dc3[_0x38d4('0x3f')]);_0x32273e[_0x38d4('0x41')]=_[_0x38d4('0x42')](_0x32273e[_0x38d4('0x43')],_0x32273e['query']);_0x4c6106[_0x38d4('0x44')]=_[_0x38d4('0x42')](_0x32273e[_0x38d4('0x43')],qs['fields'](_0xd21dc3[_0x38d4('0x3f')][_0x38d4('0x45')]));_0x4c6106[_0x38d4('0x44')]=_0x4c6106[_0x38d4('0x44')][_0x38d4('0x46')]?_0x4c6106[_0x38d4('0x44')]:_0x32273e[_0x38d4('0x43')];if(!_0xd21dc3[_0x38d4('0x3f')]['hasOwnProperty'](_0x38d4('0x47'))){_0x4c6106[_0x38d4('0x2f')]=qs[_0x38d4('0x2f')](_0xd21dc3['query']['limit']);_0x4c6106[_0x38d4('0x2d')]=qs[_0x38d4('0x2d')](_0xd21dc3['query'][_0x38d4('0x2d')]);}_0x4c6106['order']=qs[_0x38d4('0x48')](_0xd21dc3['query'][_0x38d4('0x48')]);_0x4c6106[_0x38d4('0x49')]=qs['filters'](_['pick'](_0xd21dc3[_0x38d4('0x3f')],_0x32273e[_0x38d4('0x41')]),_0x1ac8e6);if(_0xd21dc3['query']['filter']){_0x4c6106[_0x38d4('0x49')]=_[_0x38d4('0x4a')](_0x4c6106[_0x38d4('0x49')],{'$or':_[_0x38d4('0x3a')](_0x1ac8e6,function(_0x56cba7){if(_0x56cba7[_0x38d4('0x3e')]!==_0x38d4('0x4b')){var _0x3b6338={};_0x3b6338[_0x56cba7['name']]={'$like':'%'+_0xd21dc3['query'][_0x38d4('0x4c')]+'%'};return _0x3b6338;}})});}_0x4c6106=_[_0x38d4('0x4a')]({},_0x4c6106,_0xd21dc3[_0x38d4('0x4d')]);var _0xe8cb0b={'where':_0x4c6106['where']};return db['FaxMessage'][_0x38d4('0x2e')](_0xe8cb0b)[_0x38d4('0x20')](function(_0xc069dd){_0x5041bb[_0x38d4('0x2e')]=_0xc069dd;if(_0xd21dc3['query']['includeAll']){_0x4c6106[_0x38d4('0x4e')]=[{'all':!![]}];}return db[_0x38d4('0x3b')][_0x38d4('0x4f')](_0x4c6106);})[_0x38d4('0x20')](function(_0x248d0d){_0x5041bb[_0x38d4('0x50')]=_0x248d0d;return _0x5041bb;})[_0x38d4('0x20')](respondWithFilteredResult(_0xe0edac,_0x4c6106))[_0x38d4('0x29')](handleError(_0xe0edac,null));};exports['show']=function(_0x477591,_0x349064){var _0x2ce4a7={'raw':!![],'where':{'id':_0x477591[_0x38d4('0x51')]['id']}},_0x43dd3e={};_0x43dd3e['model']=_[_0x38d4('0x40')](db[_0x38d4('0x3b')][_0x38d4('0x3c')]);_0x43dd3e[_0x38d4('0x3f')]=_[_0x38d4('0x40')](_0x477591[_0x38d4('0x3f')]);_0x43dd3e[_0x38d4('0x41')]=_['intersection'](_0x43dd3e[_0x38d4('0x43')],_0x43dd3e['query']);_0x2ce4a7[_0x38d4('0x44')]=_[_0x38d4('0x42')](_0x43dd3e[_0x38d4('0x43')],qs['fields'](_0x477591[_0x38d4('0x3f')][_0x38d4('0x45')]));_0x2ce4a7['attributes']=_0x2ce4a7[_0x38d4('0x44')][_0x38d4('0x46')]?_0x2ce4a7['attributes']:_0x43dd3e[_0x38d4('0x43')];if(_0x477591[_0x38d4('0x3f')]['includeAll']){_0x2ce4a7[_0x38d4('0x4e')]=[{'all':!![]}];}_0x2ce4a7=_['merge']({},_0x2ce4a7,_0x477591[_0x38d4('0x4d')]);return db[_0x38d4('0x3b')][_0x38d4('0x52')](_0x2ce4a7)[_0x38d4('0x20')](handleEntityNotFound(_0x349064,null))[_0x38d4('0x20')](respondWithResult(_0x349064,null))['catch'](handleError(_0x349064,null));};exports[_0x38d4('0x53')]=function(_0x270b5d,_0x5d444c){if(_0x270b5d[_0x38d4('0x54')]['id']){delete _0x270b5d[_0x38d4('0x54')]['id'];}return db[_0x38d4('0x3b')][_0x38d4('0x52')]({'where':{'id':_0x270b5d['params']['id']}})['then'](handleEntityNotFound(_0x5d444c,null))[_0x38d4('0x20')](saveUpdates(_0x270b5d[_0x38d4('0x54')],null))['then'](respondWithResult(_0x5d444c,null))[_0x38d4('0x29')](handleError(_0x5d444c,null));};exports['destroy']=function(_0x237300,_0x406b06){return db[_0x38d4('0x3b')][_0x38d4('0x52')]({'where':{'id':_0x237300['params']['id']}})['then'](handleEntityNotFound(_0x406b06,null))['then'](removeEntity(_0x406b06,null))['catch'](handleError(_0x406b06,null));};exports['describe']=function(_0x3d0018,_0x18c737){return db[_0x38d4('0x3b')][_0x38d4('0x55')]()[_0x38d4('0x20')](respondWithResult(_0x18c737,null))[_0x38d4('0x29')](handleError(_0x18c737,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x1c7d63,_0x3b60dd,_0x5ef7c4){var _0x2c32e1={'agent':{},'channel':_0x38d4('0x56')};if(_0x1c7d63[_0x38d4('0x54')]['id']){delete _0x1c7d63['body']['id'];}_0x1c7d63[_0x38d4('0x54')][_0x38d4('0x57')]=!![];_0x1c7d63[_0x38d4('0x54')][_0x38d4('0x58')]=moment()[_0x38d4('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c7d63[_0x38d4('0x54')]['UserId']=_0x1c7d63['body'][_0x38d4('0x5a')]||_0x1c7d63[_0x38d4('0x5b')]['id'];_0x2c32e1[_0x38d4('0x5c')]['id']=_0x1c7d63[_0x38d4('0x54')][_0x38d4('0x5a')];return db[_0x38d4('0x3b')]['find']({'where':{'id':_0x1c7d63[_0x38d4('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b60dd,null))[_0x38d4('0x20')](saveUpdates(_0x1c7d63[_0x38d4('0x54')],null))[_0x38d4('0x20')](function(_0x26a75a){if(_0x26a75a){_0x2c32e1[_0x38d4('0x28')]=_0x26a75a[_0x38d4('0x5d')]({'plain':!![]});return db['FaxInteraction'][_0x38d4('0x52')]({'where':{'id':_0x26a75a[_0x38d4('0x5e')]}});}return null;})[_0x38d4('0x20')](handleEntityNotFound(_0x3b60dd,null))[_0x38d4('0x20')](function(_0x8c3657){if(_0x8c3657){return _0x8c3657[_0x38d4('0x53')]({'UserId':_0x1c7d63['body']['UserId'],'read1stAt':_[_0x38d4('0x5f')](_0x8c3657['read1stAt'])?moment()[_0x38d4('0x59')](_0x38d4('0x60')):undefined});}return null;})[_0x38d4('0x20')](function(_0x31fae2){if(_0x31fae2){_0x2c32e1[_0x38d4('0x61')]=_0x31fae2[_0x38d4('0x5d')]({'plain':!![]});interaction_log[_0x38d4('0x21')](_0x38d4('0x62'),_0x1c7d63['user']['id'],_0x1c7d63['user'][_0x38d4('0x37')],_0x1c7d63['user'][_0x38d4('0x63')],_0x2c32e1[_0x38d4('0x61')]['id'],_0x1c7d63[_0x38d4('0x54')]?JSON['stringify'](_0x1c7d63[_0x38d4('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0x38d4('0x64'),_0x2c32e1);}return null;})[_0x38d4('0x20')](function(_0xa8764e){var _0x2a9ad4=_0x38d4('0x65')+_0xa8764e[_0x38d4('0x28')][_0x38d4('0x66')];return db[_0x38d4('0x67')]['query'](_0x2a9ad4,{'type':db[_0x38d4('0x68')]['QueryTypes'][_0x38d4('0x69')],'raw':!![]})[_0x38d4('0x20')](function(_0x2db4c8){return _0x2db4c8;});})[_0x38d4('0x20')](function(_0x4fef06){if(_0x4fef06){_0x2c32e1[_0x38d4('0x28')][_0x38d4('0x6a')]=_0x4fef06[0x0];if(!_0x1c7d63[_0x38d4('0x54')][_0x38d4('0x5a')])return;return db[_0x38d4('0x6b')][_0x38d4('0x52')]({'where':{'id':_0x1c7d63['body']['UserId'],'role':_0x38d4('0x5c')},'attributes':['id','name',_0x38d4('0x6c'),_0x38d4('0x6d'),_0x38d4('0x6e')],'raw':!![]});}return null;})[_0x38d4('0x20')](function(_0x4480e5){if(!_0x4480e5)return null;_0x2c32e1[_0x38d4('0x28')][_0x38d4('0x5c')]=_0x4480e5;return _0x2c32e1;})[_0x38d4('0x20')](function(_0x462fdf){if(_0x462fdf){if(_0x1c7d63['body'][_0x38d4('0x6f')]){_0x2c32e1[_0x38d4('0x28')][_0x38d4('0x70')]=util[_0x38d4('0x59')](_0x38d4('0x71'),_0x1c7d63[_0x38d4('0x5b')][_0x38d4('0x37')]);_0x2c32e1[_0x38d4('0x28')][_0x38d4('0x72')]=_0x2c32e1[_0x38d4('0x72')];_0x2c32e1[_0x38d4('0x28')][_0x38d4('0x73')]=_0x2c32e1[_0x38d4('0x72')];_0x2c32e1['message'][_0x38d4('0x74')]=_0x38d4('0x75');return respondWithRpcPromise(_0x38d4('0x76'),_0x38d4('0x76'),{'event':_0x38d4('0x77'),'message':_0x2c32e1[_0x38d4('0x28')]},client9002)[_0x38d4('0x20')](function(){return _0x2c32e1;});}return _0x2c32e1;}return null;})['then'](respondWithResult(_0x3b60dd,null))['catch'](handleError(_0x3b60dd,null));};var interaction_log=require(_0x38d4('0x78'))(_0x38d4('0x79'));exports['reject']=function(_0x5e06cd,_0x49edcf,_0x5252ae){var _0x241ef0={'agent':{},'channel':_0x38d4('0x56')};if(_0x5e06cd['body']['id']){delete _0x5e06cd[_0x38d4('0x54')]['id'];}_0x5e06cd[_0x38d4('0x54')]['UserId']=_0x5e06cd['body'][_0x38d4('0x5a')]||_0x5e06cd[_0x38d4('0x5b')]['id'];_0x241ef0[_0x38d4('0x5c')]['id']=_0x5e06cd[_0x38d4('0x54')][_0x38d4('0x5a')];return db[_0x38d4('0x3b')]['find']({'where':{'id':_0x5e06cd[_0x38d4('0x51')]['id'],'UserId':null}})[_0x38d4('0x20')](handleEntityNotFound(_0x49edcf,null))['then'](function(_0x190278){if(_0x190278){_0x241ef0[_0x38d4('0x28')]=_0x190278[_0x38d4('0x5d')]({'plain':!![]});return db[_0x38d4('0x7a')]['find']({'where':{'id':_0x190278['FaxInteractionId']}});}return null;})[_0x38d4('0x20')](handleEntityNotFound(_0x49edcf,null))['then'](function(_0x5ebb2f){if(_0x5ebb2f){_0x241ef0[_0x38d4('0x61')]=_0x5ebb2f[_0x38d4('0x5d')]({'plain':!![]});interaction_log[_0x38d4('0x21')](_0x38d4('0x7b'),_0x5e06cd[_0x38d4('0x5b')]['id'],_0x5e06cd[_0x38d4('0x5b')][_0x38d4('0x37')],_0x5e06cd['user'][_0x38d4('0x63')],_0x241ef0[_0x38d4('0x61')]['id'],_0x5e06cd[_0x38d4('0x54')]?JSON['stringify'](_0x5e06cd[_0x38d4('0x54')]):_0x38d4('0x7c'));return respondWithRpcPromise(_0x38d4('0x7d'),_0x38d4('0x7e'),_0x241ef0);}return null;})['then'](function(_0x274993){var _0x28174f=_0x38d4('0x65')+_0x274993[_0x38d4('0x28')][_0x38d4('0x66')];return db[_0x38d4('0x67')][_0x38d4('0x3f')](_0x28174f,{'type':db[_0x38d4('0x68')][_0x38d4('0x7f')][_0x38d4('0x69')],'raw':!![]})['then'](function(_0x49d739){return _0x49d739;});})[_0x38d4('0x20')](function(_0x1242a2){if(_0x1242a2){_0x241ef0['message'][_0x38d4('0x6a')]=_0x1242a2[0x0];if(!_0x5e06cd[_0x38d4('0x54')][_0x38d4('0x5a')])return;return db[_0x38d4('0x6b')][_0x38d4('0x52')]({'where':{'id':_0x5e06cd[_0x38d4('0x54')][_0x38d4('0x5a')],'role':'agent'},'attributes':['id',_0x38d4('0x37'),_0x38d4('0x6c'),_0x38d4('0x6d'),_0x38d4('0x6e')],'raw':!![]});}return null;})['then'](function(_0x597a71){if(!_0x597a71)return null;_0x241ef0[_0x38d4('0x28')][_0x38d4('0x5c')]=_0x597a71;return _0x241ef0;})[_0x38d4('0x20')](function(_0x414e33){if(_0x414e33){_0x414e33['message'][_0x38d4('0x70')]=util[_0x38d4('0x59')](_0x38d4('0x71'),_0x5e06cd['user'][_0x38d4('0x37')]);_0x414e33[_0x38d4('0x28')][_0x38d4('0x72')]=_0x241ef0[_0x38d4('0x72')];_0x414e33[_0x38d4('0x28')][_0x38d4('0x73')]=_0x241ef0[_0x38d4('0x72')];_0x414e33[_0x38d4('0x28')][_0x38d4('0x74')]=_0x38d4('0x80');respondWithRpcPromise(_0x38d4('0x76'),_0x38d4('0x76'),{'event':'rejectmessage','message':_0x414e33[_0x38d4('0x28')]},client9002);return _0x241ef0;}return null;})[_0x38d4('0x20')](respondWithResult(_0x49edcf,null))[_0x38d4('0x29')](handleError(_0x49edcf,null));};exports[_0x38d4('0x81')]=function(_0x200fdf,_0x257b67){var _0x5e9453;return db[_0x38d4('0x3b')][_0x38d4('0x81')](_0x200fdf[_0x38d4('0x54')],{})[_0x38d4('0x20')](function(_0x20485e){_0x5e9453=_0x20485e;return db[_0x38d4('0x82')][_0x38d4('0x83')]({'where':{'id':_0x5e9453[_0x38d4('0x66')]}});})['then'](function(_0x5968fa){if(_['isNil'](_0x5968fa)){return;}else{_0x5e9453[_0x38d4('0x56')]=_0x5968fa[_0x38d4('0x56')];return db[_0x38d4('0x84')][_0x38d4('0x83')]({'where':{'id':_0x5e9453['AttachmentId']}});}})[_0x38d4('0x20')](function(_0xecbdfc){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x38d4('0x5f')](_0x200fdf[_0x38d4('0x54')])?undefined:_0x200fdf[_0x38d4('0x54')][_0x38d4('0x85')],'path':_[_0x38d4('0x5f')](_0xecbdfc)?undefined:util[_0x38d4('0x59')](_0x38d4('0x86'),_0xecbdfc['basename']),'fax':_[_0x38d4('0x5f')](_0x5e9453[_0x38d4('0x56')])?undefined:_0x5e9453[_0x38d4('0x56')],'AttachmentId':_0x5e9453[_0x38d4('0x87')]},client9002);})[_0x38d4('0x20')](respondWithResult(_0x257b67,0xc9))[_0x38d4('0x29')](handleError(_0x257b67,null));};exports[_0x38d4('0x88')]=function(_0x2af419,_0x858456){var _0x1a35ff=path[_0x38d4('0x89')](config['root'],_0x38d4('0x8a'),_0x38d4('0x8b'),'attachments');return db[_0x38d4('0x3b')][_0x38d4('0x52')]({'where':{'id':_0x2af419[_0x38d4('0x51')]['id']},'include':[{'model':db[_0x38d4('0x84')],'as':_0x38d4('0x84')}]})['then'](handleEntityNotFound(_0x858456,null))[_0x38d4('0x20')](function(_0x3e9b44){if(_0x3e9b44){return _0x858456[_0x38d4('0x88')](path[_0x38d4('0x89')](_0x1a35ff,_0x3e9b44['Attachment'][_0x38d4('0x8c')]));}})['catch'](handleError(_0x858456,null));};
\ No newline at end of file
index 7a858d3..c1d953e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5fdc,0x127));var _0xc5fd=function(_0x30ebe5,_0x4cb463){_0x30ebe5=_0x30ebe5-0x0;var _0x344f0f=_0x5fdc[_0x30ebe5];return _0x344f0f;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var FaxMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc5fd('0x3')](0x0);var events={'afterCreate':_0xc5fd('0x4'),'afterUpdate':_0xc5fd('0x5'),'afterDestroy':_0xc5fd('0x6')};function emitEvent(_0x4d015c){return function(_0xfdf928,_0x1b6205,_0xca27a0){FaxMessageEvents[_0xc5fd('0x7')](_0x4d015c+':'+_0xfdf928['id'],_0xfdf928);FaxMessageEvents[_0xc5fd('0x7')](_0x4d015c,_0xfdf928);_0xca27a0(null);};}for(var e in events){if(events[_0xc5fd('0x8')](e)){var event=events[e];FaxMessage[_0xc5fd('0x9')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0x6c14=['../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x13ecbe,_0x414779){var _0x614373=function(_0x4270ae){while(--_0x4270ae){_0x13ecbe['push'](_0x13ecbe['shift']());}};_0x614373(++_0x414779);}(_0x6c14,0xd1));var _0x46c1=function(_0x1d6818,_0x287c8e){_0x1d6818=_0x1d6818-0x0;var _0x1f3a0c=_0x6c14[_0x1d6818];return _0x1f3a0c;};'use strict';var EventEmitter=require(_0x46c1('0x0'));var FaxMessage=require(_0x46c1('0x1'))['db'][_0x46c1('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x46c1('0x3')](0x0);var events={'afterCreate':_0x46c1('0x4'),'afterUpdate':'update','afterDestroy':_0x46c1('0x5')};function emitEvent(_0x1aa112){return function(_0x311234,_0x5b4a69,_0x2a884e){FaxMessageEvents[_0x46c1('0x6')](_0x1aa112+':'+_0x311234['id'],_0x311234);FaxMessageEvents[_0x46c1('0x6')](_0x1aa112,_0x311234);_0x2a884e(null);};}for(var e in events){if(events[_0x46c1('0x7')](e)){var event=events[e];FaxMessage[_0x46c1('0x8')](e,emitEvent(event));}}module[_0x46c1('0x9')]=FaxMessageEvents;
\ No newline at end of file
index 4f02d21..c6f9341 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3657=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3bb45b,_0x2dcc0b){var _0x513162=function(_0x46f44b){while(--_0x46f44b){_0x3bb45b['push'](_0x3bb45b['shift']());}};_0x513162(++_0x2dcc0b);}(_0x3657,0x1ca));var _0x7365=function(_0x3bbd21,_0x23f22d){_0x3bbd21=_0x3bbd21-0x0;var _0x11908b=_0x3657[_0x3bbd21];return _0x11908b;};'use strict';var _=require(_0x7365('0x0'));var util=require('util');var logger=require(_0x7365('0x1'))(_0x7365('0x2'));var moment=require(_0x7365('0x3'));var BPromise=require(_0x7365('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7365('0x5'));var config=require(_0x7365('0x6'));var attributes=require(_0x7365('0x7'));module[_0x7365('0x8')]=function(_0x4d1cd4,_0x2e3b84){return _0x4d1cd4['define'](_0x7365('0x9'),attributes,{'tableName':_0x7365('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x7365('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fae51,_0xf5d4fe,_0x5cb80e){var _0x452509=_0x4d1cd4[_0x7365('0xc')];var _0x538a5d=_0x1fae51[_0x7365('0xd')]({'plain':!![]});if(_0x538a5d['direction'][_0x7365('0xe')]()==='in'||_0x538a5d[_0x7365('0xf')]['toLowerCase']()===_0x7365('0x10')&&!_0x538a5d[_0x7365('0x11')]&&!_[_0x7365('0x12')](_0x538a5d['UserId'])){_0x452509[_0x7365('0x13')][_0x7365('0x14')]({'where':{'id':_0x538a5d[_0x7365('0x15')]}})[_0x7365('0x16')](function(_0x6939a1){if(_0x6939a1){_0x6939a1['update']({'lastMsgAt':_0x538a5d[_0x7365('0x17')],'lastMsgDirection':_0x538a5d[_0x7365('0xf')][_0x7365('0xe')]()});}})['catch'](function(_0x4d66ad){console[_0x7365('0x18')](_0x4d66ad);});}_0x5cb80e();}},'charset':_0x7365('0x19'),'collate':_0x7365('0x1a')});};
\ No newline at end of file
+var _0xe26c=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','body','FULLTEXT','get','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x24e056,_0x257d1a){var _0x57b6ea=function(_0x2c9843){while(--_0x2c9843){_0x24e056['push'](_0x24e056['shift']());}};_0x57b6ea(++_0x257d1a);}(_0xe26c,0x10c));var _0xce26=function(_0x2a2853,_0x4ec997){_0x2a2853=_0x2a2853-0x0;var _0x164241=_0xe26c[_0x2a2853];return _0x164241;};'use strict';var _=require(_0xce26('0x0'));var util=require(_0xce26('0x1'));var logger=require(_0xce26('0x2'))('api');var moment=require('moment');var BPromise=require(_0xce26('0x3'));var rp=require(_0xce26('0x4'));var fs=require('fs');var path=require(_0xce26('0x5'));var rimraf=require(_0xce26('0x6'));var config=require(_0xce26('0x7'));var attributes=require(_0xce26('0x8'));module[_0xce26('0x9')]=function(_0xb2832c,_0x24eec0){return _0xb2832c[_0xce26('0xa')]('FaxMessage',attributes,{'tableName':_0xce26('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xce26('0xc')],'type':_0xce26('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ab6da,_0x13b339,_0x1ad9bc){var _0xa9a8b0=_0xb2832c['models'];var _0x4f55b1=_0x3ab6da[_0xce26('0xe')]({'plain':!![]});if(_0x4f55b1[_0xce26('0xf')][_0xce26('0x10')]()==='in'||_0x4f55b1['direction'][_0xce26('0x10')]()==='out'&&!_0x4f55b1['secret']&&!_[_0xce26('0x11')](_0x4f55b1[_0xce26('0x12')])){_0xa9a8b0[_0xce26('0x13')][_0xce26('0x14')]({'where':{'id':_0x4f55b1[_0xce26('0x15')]}})[_0xce26('0x16')](function(_0x240d62){if(_0x240d62){_0x240d62[_0xce26('0x17')]({'lastMsgAt':_0x4f55b1[_0xce26('0x18')],'lastMsgDirection':_0x4f55b1[_0xce26('0xf')][_0xce26('0x10')]()});}})[_0xce26('0x19')](function(_0x2c114a){console[_0xce26('0x1a')](_0x2c114a);});}_0x1ad9bc();}},'charset':_0xce26('0x1b'),'collate':_0xce26('0x1c')});};
\ No newline at end of file
index edb038e..42ce5ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x558fad,_0x153dba){var _0x1a4017=function(_0x11fce0){while(--_0x11fce0){_0x558fad['push'](_0x558fad['shift']());}};_0x1a4017(++_0x153dba);}(_0xbec5,0xe5));var _0x5bec=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0xbec5[_0x455150];return _0x12ca9c;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('FaxMessage,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});}exports[_0x5bec('0x1a')]=function(_0x593786){var _0x554f9f=this;return new Promise(function(_0xab397b,_0x5be91c){return db[_0x5bec('0x1b')][_0x5bec('0x1c')](_0x593786[_0x5bec('0x1d')],{'raw':_0x593786[_0x5bec('0x1e')]?_0x593786[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x5bec('0x10')](function(_0x4cfcb8){logger[_0x5bec('0x11')](_0x5bec('0x1a'),_0x593786);logger['debug'](_0x5bec('0x1a'),_0x593786,JSON[_0x5bec('0x14')](_0x4cfcb8));_0xab397b(_0x4cfcb8);})['catch'](function(_0x45afb7){logger[_0x5bec('0x15')](_0x5bec('0x1a'),_0x45afb7[_0x5bec('0x18')],_0x593786);_0x5be91c(_0x554f9f[_0x5bec('0x15')](0x1f4,_0x45afb7[_0x5bec('0x18')]));});});};exports[_0x5bec('0x1f')]=function(_0x4de66a){var _0x5b63ab=this;return new Promise(function(_0x5e44b3,_0x2961bd){return db[_0x5bec('0x1b')][_0x5bec('0x20')](_0x4de66a['body'],{'raw':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['where']||null:null,'attributes':_0x4de66a['options']?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x21')]||null:null,'limit':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x22')]||null:null})[_0x5bec('0x10')](function(_0x5d6621){logger[_0x5bec('0x11')]('UpdateFaxMessage',_0x4de66a);logger[_0x5bec('0x13')](_0x5bec('0x1f'),_0x4de66a,JSON[_0x5bec('0x14')](_0x5d6621));_0x5e44b3(_0x5d6621);})[_0x5bec('0x19')](function(_0x5128c0){logger[_0x5bec('0x15')](_0x5bec('0x1f'),_0x5128c0[_0x5bec('0x18')],_0x4de66a);_0x2961bd(_0x5b63ab['error'](0x1f4,_0x5128c0[_0x5bec('0x18')]));});});};
\ No newline at end of file
+var _0x54ef=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','request','then','info','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2e48ae,_0xc9e6b1){var _0x1d9918=function(_0x4b7b7e){while(--_0x4b7b7e){_0x2e48ae['push'](_0x2e48ae['shift']());}};_0x1d9918(++_0xc9e6b1);}(_0x54ef,0x112));var _0xf54e=function(_0x1946d8,_0x158c24){_0x1946d8=_0x1946d8-0x0;var _0x28d226=_0x54ef[_0x1946d8];return _0x28d226;};'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});config[_0xf54e('0xb')]=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));require(_0xf54e('0xe'))['register'](socket);function respondWithRpcPromise(_0x26fc3e,_0xefa1c0,_0x6b9e61){return new BPromise(function(_0x3ecfb3,_0x5f232a){return client[_0xf54e('0xf')](_0x26fc3e,_0x6b9e61)[_0xf54e('0x10')](function(_0x143d66){logger[_0xf54e('0x11')]('FaxMessage,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'),JSON[_0xf54e('0x13')](_0x143d66));if(_0x143d66[_0xf54e('0x14')]){if(_0x143d66[_0xf54e('0x14')]['code']===0x1f4){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);return _0x5f232a(_0x143d66['error'][_0xf54e('0x16')]);}logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66['error']['message']);return _0x3ecfb3(_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);}else{logger[_0xf54e('0x11')](_0xf54e('0x15'),_0xefa1c0,_0xf54e('0x12'));_0x3ecfb3(_0x143d66[_0xf54e('0x17')][_0xf54e('0x16')]);}})[_0xf54e('0x18')](function(_0x1dcc04){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x1dcc04);_0x5f232a(_0x1dcc04);});});}exports['CreateFaxMessage']=function(_0x48a7e1){var _0x23e14=this;return new Promise(function(_0x59f338,_0x3e1556){return db[_0xf54e('0x19')][_0xf54e('0x1a')](_0x48a7e1[_0xf54e('0x1b')],{'raw':_0x48a7e1[_0xf54e('0x1c')]?_0x48a7e1[_0xf54e('0x1c')][_0xf54e('0x1d')]===undefined?!![]:![]:!![]})[_0xf54e('0x10')](function(_0x3c0169){logger[_0xf54e('0x11')](_0xf54e('0x1e'),_0x48a7e1);logger['debug'](_0xf54e('0x1e'),_0x48a7e1,JSON['stringify'](_0x3c0169));_0x59f338(_0x3c0169);})[_0xf54e('0x18')](function(_0x272df6){logger[_0xf54e('0x14')](_0xf54e('0x1e'),_0x272df6[_0xf54e('0x16')],_0x48a7e1);_0x3e1556(_0x23e14[_0xf54e('0x14')](0x1f4,_0x272df6[_0xf54e('0x16')]));});});};exports[_0xf54e('0x1f')]=function(_0x2342a9){var _0x33457f=this;return new Promise(function(_0xf6cdd7,_0x39c0ae){return db[_0xf54e('0x19')]['update'](_0x2342a9[_0xf54e('0x1b')],{'raw':_0x2342a9['options']?_0x2342a9[_0xf54e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x20')]||null:null,'attributes':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x21')]||null:null,'limit':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9['options']['limit']||null:null})[_0xf54e('0x10')](function(_0x258d29){logger[_0xf54e('0x11')](_0xf54e('0x1f'),_0x2342a9);logger[_0xf54e('0x22')](_0xf54e('0x1f'),_0x2342a9,JSON[_0xf54e('0x13')](_0x258d29));_0xf6cdd7(_0x258d29);})[_0xf54e('0x18')](function(_0x3ae704){logger[_0xf54e('0x14')]('UpdateFaxMessage',_0x3ae704['message'],_0x2342a9);_0x39c0ae(_0x33457f[_0xf54e('0x14')](0x1f4,_0x3ae704[_0xf54e('0x16')]));});});};
\ No newline at end of file
index 269d3c8..e595e72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc21e=['register','faxMessage:','./faxMessage.events','update','emit','removeListener'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0xc21e,0x170));var _0xec21=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc21e[_0x2c91e9];return _0x13f0ff;};'use strict';var FaxMessageEvents=require(_0xec21('0x0'));var events=['save','remove',_0xec21('0x1')];function createListener(_0x287034,_0x2e8e60){return function(_0x48ad24){_0x2e8e60[_0xec21('0x2')](_0x287034,_0x48ad24);};}function removeListener(_0x5b3283,_0x4c6fcd){return function(){FaxMessageEvents[_0xec21('0x3')](_0x5b3283,_0x4c6fcd);};}exports[_0xec21('0x4')]=function(_0xdc4064){for(var _0x5b404e=0x0,_0x34edc7=events['length'];_0x5b404e<_0x34edc7;_0x5b404e++){var _0x50a8cb=events[_0x5b404e];var _0x38c047=createListener(_0xec21('0x5')+_0x50a8cb,_0xdc4064);FaxMessageEvents['on'](_0x50a8cb,_0x38c047);}};
\ No newline at end of file
+var _0x3c59=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x3c59,0x106));var _0x93c5=function(_0x2b5318,_0x1dcff0){_0x2b5318=_0x2b5318-0x0;var _0x16e75b=_0x3c59[_0x2b5318];return _0x16e75b;};'use strict';var FaxMessageEvents=require(_0x93c5('0x0'));var events=[_0x93c5('0x1'),'remove',_0x93c5('0x2')];function createListener(_0x5dcdb0,_0x4b6e09){return function(_0x1d24e8){_0x4b6e09[_0x93c5('0x3')](_0x5dcdb0,_0x1d24e8);};}function removeListener(_0x2f6437,_0x3049da){return function(){FaxMessageEvents[_0x93c5('0x4')](_0x2f6437,_0x3049da);};}exports[_0x93c5('0x5')]=function(_0x3161a8){for(var _0x591879=0x0,_0x554043=events[_0x93c5('0x6')];_0x591879<_0x554043;_0x591879++){var _0x100117=events[_0x591879];var _0x40946d=createListener(_0x93c5('0x7')+_0x100117,_0x3161a8);FaxMessageEvents['on'](_0x100117,_0x40946d);}};
\ No newline at end of file
index 2e38b4f..f793607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','describe','download','post','tracked','fax','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xac4a,0x13f));var _0xaac4=function(_0x2286d7,_0x56bc07){_0x2286d7=_0x2286d7-0x0;var _0x87d354=_0xac4a[_0x2286d7];return _0x87d354;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/describe',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xd')]('/',auth[_0xaac4('0x9')](),interaction[_0xaac4('0xe')](_0xaac4('0xf'),'faxmessage:create'),controller['create']);router[_0xaac4('0x10')](_0xaac4('0x11'),auth[_0xaac4('0x9')](),controller['update']);router[_0xaac4('0x10')](_0xaac4('0x12'),auth['isAuthenticated'](),controller[_0xaac4('0x13')]);router[_0xaac4('0x10')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x11'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router;
\ No newline at end of file
+var _0x6f0d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','show','/:id/download','post','tracked','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x598152,_0x4230ac){var _0x71af95=function(_0x59f1da){while(--_0x59f1da){_0x598152['push'](_0x598152['shift']());}};_0x71af95(++_0x4230ac);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x192227,_0x50aa12){_0x192227=_0x192227-0x0;var _0x2fdacf=_0x6f0d[_0x192227];return _0x2fdacf;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xa')](_0xd6f0('0xe'),auth[_0xd6f0('0x9')](),controller['download']);router[_0xd6f0('0xf')]('/',auth[_0xd6f0('0x9')](),interaction[_0xd6f0('0x10')](_0xd6f0('0x11'),'faxmessage:create'),controller[_0xd6f0('0x12')]);router[_0xd6f0('0x13')](_0xd6f0('0x14'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x15')]);router[_0xd6f0('0x13')](_0xd6f0('0x16'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x17')]);router['put'](_0xd6f0('0x18'),auth[_0xd6f0('0x9')](),controller['reject']);router[_0xd6f0('0x19')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x1a')]);module[_0xd6f0('0x1b')]=router;
\ No newline at end of file
index 323d0c1..2dc9632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7faf=['INTEGER','rrmemory','beepall','roundrobin','sequelize','name'];(function(_0x5b0c41,_0x55f81a){var _0x14897f=function(_0x4dab48){while(--_0x4dab48){_0x5b0c41['push'](_0x5b0c41['shift']());}};_0x14897f(++_0x55f81a);}(_0x7faf,0x112));var _0xf7fa=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7faf[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xf7fa('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf7fa('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf7fa('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf7fa('0x3'),_0xf7fa('0x4'),_0xf7fa('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf7fa('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x04d9=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','name','STRING'];(function(_0x2c5568,_0xb12f15){var _0x698d67=function(_0x482ec0){while(--_0x482ec0){_0x2c5568['push'](_0x2c5568['shift']());}};_0x698d67(++_0xb12f15);}(_0x04d9,0x105));var _0x904d=function(_0x37d359,_0xe8fe83){_0x37d359=_0x37d359-0x0;var _0x482d4c=_0x04d9[_0x37d359];return _0x482d4c;};'use strict';var Sequelize=require(_0x904d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x904d('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x904d('0x2')]},'timeout':{'type':Sequelize[_0x904d('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x904d('0x4')](_0x904d('0x5'),_0x904d('0x6'),_0x904d('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x904d('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 8cb548c..1ef0634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x922c=['rawAttributes','hasOwnProperty','nolimit','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','userFaxQueue:save','removeTeams','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','forEach','emit','userFaxQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxQueue.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','FaxQueues','UserProfileResource','then','sendStatus','error','name','send','index','map','FaxQueue','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','getMembers','findOne','get','order','pick','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team'];(function(_0xe5ab97,_0x2c5b24){var _0x37b629=function(_0x3c473e){while(--_0x3c473e){_0xe5ab97['push'](_0xe5ab97['shift']());}};_0x37b629(++_0x2c5b24);}(_0x922c,0xaf));var _0xc922=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x922c[_0xc7348b];return _0x307cec;};'use strict';var emlformat=require(_0xc922('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc922('0x1'));var jsonpatch=require(_0xc922('0x2'));var rp=require(_0xc922('0x3'));var moment=require('moment');var BPromise=require(_0xc922('0x4'));var Mustache=require('mustache');var util=require(_0xc922('0x5'));var path=require(_0xc922('0x6'));var sox=require(_0xc922('0x7'));var csv=require(_0xc922('0x8'));var ejs=require(_0xc922('0x9'));var fs=require('fs');var fs_extra=require(_0xc922('0xa'));var _=require('lodash');var squel=require(_0xc922('0xb'));var crypto=require(_0xc922('0xc'));var jsforce=require(_0xc922('0xd'));var deskjs=require(_0xc922('0xe'));var toCsv=require(_0xc922('0x8'));var querystring=require(_0xc922('0xf'));var Papa=require(_0xc922('0x10'));var Redis=require(_0xc922('0x11'));var authService=require(_0xc922('0x12'));var qs=require(_0xc922('0x13'));var as=require(_0xc922('0x14'));var hardwareService=require(_0xc922('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc922('0x16'));var config=require(_0xc922('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc922('0x18')]=_['defaults'](config[_0xc922('0x18')],{'host':_0xc922('0x19'),'port':0x18eb});var socket=require(_0xc922('0x1a'))(new Redis(config['redis']));require(_0xc922('0x1b'))['register'](socket);function respondWithStatusCode(_0x3f5c6d,_0x21f411){_0x21f411=_0x21f411||0xcc;return function(_0x5c75e3){if(_0x5c75e3){return _0x3f5c6d['sendStatus'](_0x21f411);}return _0x3f5c6d[_0xc922('0x1c')](_0x21f411)[_0xc922('0x1d')]();};}function respondWithResult(_0x1c4b53,_0x53f7a6){_0x53f7a6=_0x53f7a6||0xc8;return function(_0x409eaa){if(_0x409eaa){return _0x1c4b53[_0xc922('0x1c')](_0x53f7a6)['json'](_0x409eaa);}};}function respondWithFilteredResult(_0x505109,_0x443e02){return function(_0x4c974c){if(_0x4c974c){var _0x410736=typeof _0x443e02[_0xc922('0x1e')]===_0xc922('0x1f')&&typeof _0x443e02[_0xc922('0x20')]===_0xc922('0x1f');var _0x15fb77=_0x4c974c[_0xc922('0x21')];var _0x19eec0=_0x410736?0x0:_0x443e02[_0xc922('0x1e')];var _0x54e5ef=_0x410736?_0x4c974c[_0xc922('0x21')]:_0x443e02[_0xc922('0x1e')]+_0x443e02['limit'];var _0x300ca;if(_0x54e5ef>=_0x15fb77){_0x54e5ef=_0x15fb77;_0x300ca=0xc8;}else{_0x300ca=0xce;}_0x505109[_0xc922('0x1c')](_0x300ca);return _0x505109[_0xc922('0x22')](_0xc922('0x23'),_0x19eec0+'-'+_0x54e5ef+'/'+_0x15fb77)[_0xc922('0x24')](_0x4c974c);}return null;};}function patchUpdates(_0x1176ff){return function(_0x5b1a90){try{jsonpatch['apply'](_0x5b1a90,_0x1176ff,!![]);}catch(_0x5e778e){return BPromise[_0xc922('0x25')](_0x5e778e);}return _0x5b1a90[_0xc922('0x26')]();};}function saveUpdates(_0xe4e133,_0x2ce288){return function(_0x5bedbe){if(_0x5bedbe){return _0x5bedbe['update'](_0xe4e133)['then'](function(_0x1be410){return _0x1be410;});}return null;};}function removeEntity(_0x466ee4,_0x247bd3){return function(_0x5e5f9f){if(_0x5e5f9f){return _0x5e5f9f['destroy']()['then'](function(){var _0x17a0a5=_0x5e5f9f['get']({'plain':!![]});var _0xb8c481=_0xc922('0x27');return db[_0xc922('0x28')]['destroy']({'where':{'type':_0xb8c481,'resourceId':_0x17a0a5['id']}})[_0xc922('0x29')](function(){return _0x5e5f9f;});})[_0xc922('0x29')](function(){_0x466ee4[_0xc922('0x1c')](0xcc)[_0xc922('0x1d')]();});}};}function handleEntityNotFound(_0x491440,_0x53aa7a){return function(_0x2e3535){if(!_0x2e3535){_0x491440[_0xc922('0x2a')](0x194);}return _0x2e3535;};}function handleError(_0x19f8c3,_0x31e8de){_0x31e8de=_0x31e8de||0x1f4;return function(_0x22305b){logger[_0xc922('0x2b')](_0x22305b['stack']);if(_0x22305b['name']){delete _0x22305b[_0xc922('0x2c')];}_0x19f8c3[_0xc922('0x1c')](_0x31e8de)[_0xc922('0x2d')](_0x22305b);};}exports[_0xc922('0x2e')]=function(_0x1653bc,_0x180603){var _0x5a67fa={},_0x36b401={},_0x104f3c={'count':0x0,'rows':[]};var _0x10e406=_[_0xc922('0x2f')](db[_0xc922('0x30')]['rawAttributes'],function(_0x31ec7d){return{'name':_0x31ec7d[_0xc922('0x31')],'type':_0x31ec7d[_0xc922('0x32')][_0xc922('0x33')]};});_0x36b401[_0xc922('0x34')]=_[_0xc922('0x2f')](_0x10e406,_0xc922('0x2c'));_0x36b401['query']=_[_0xc922('0x35')](_0x1653bc[_0xc922('0x36')]);_0x36b401['filters']=_[_0xc922('0x37')](_0x36b401['model'],_0x36b401[_0xc922('0x36')]);_0x5a67fa[_0xc922('0x38')]=_[_0xc922('0x37')](_0x36b401['model'],qs['fields'](_0x1653bc['query'][_0xc922('0x39')]));_0x5a67fa[_0xc922('0x38')]=_0x5a67fa[_0xc922('0x38')][_0xc922('0x3a')]?_0x5a67fa[_0xc922('0x38')]:_0x36b401['model'];if(!_0x1653bc['query']['hasOwnProperty']('nolimit')){_0x5a67fa['limit']=qs[_0xc922('0x20')](_0x1653bc[_0xc922('0x36')][_0xc922('0x20')]);_0x5a67fa[_0xc922('0x1e')]=qs[_0xc922('0x1e')](_0x1653bc['query'][_0xc922('0x1e')]);}_0x5a67fa['order']=qs[_0xc922('0x3b')](_0x1653bc[_0xc922('0x36')][_0xc922('0x3b')]);_0x5a67fa[_0xc922('0x3c')]=qs[_0xc922('0x3d')](_['pick'](_0x1653bc[_0xc922('0x36')],_0x36b401['filters']),_0x10e406);if(_0x1653bc['query'][_0xc922('0x3e')]){_0x5a67fa[_0xc922('0x3c')]=_[_0xc922('0x3f')](_0x5a67fa['where'],{'$or':_[_0xc922('0x2f')](_0x10e406,function(_0x375711){if(_0x375711[_0xc922('0x32')]!=='VIRTUAL'){var _0x317fe2={};_0x317fe2[_0x375711[_0xc922('0x2c')]]={'$like':'%'+_0x1653bc[_0xc922('0x36')][_0xc922('0x3e')]+'%'};return _0x317fe2;}})});}_0x5a67fa=_[_0xc922('0x3f')]({},_0x5a67fa,_0x1653bc[_0xc922('0x40')]);var _0x5ef91b={'where':_0x5a67fa[_0xc922('0x3c')]};return db[_0xc922('0x30')][_0xc922('0x21')](_0x5ef91b)[_0xc922('0x29')](function(_0x1ddf2d){_0x104f3c[_0xc922('0x21')]=_0x1ddf2d;if(_0x1653bc[_0xc922('0x36')][_0xc922('0x41')]){_0x5a67fa[_0xc922('0x42')]=[{'all':!![]}];}return db['FaxQueue'][_0xc922('0x43')](_0x5a67fa);})[_0xc922('0x29')](function(_0x380872){_0x104f3c[_0xc922('0x44')]=_0x380872;return _0x104f3c;})['then'](respondWithFilteredResult(_0x180603,_0x5a67fa))[_0xc922('0x45')](handleError(_0x180603,null));};exports[_0xc922('0x46')]=function(_0x3ae6c6,_0x1db82c){var _0x3101c9={'raw':!![],'where':{'id':_0x3ae6c6[_0xc922('0x47')]['id']}},_0xd5ceea={};_0xd5ceea['model']=_[_0xc922('0x35')](db[_0xc922('0x30')]['rawAttributes']);_0xd5ceea['query']=_['keys'](_0x3ae6c6['query']);_0xd5ceea[_0xc922('0x3d')]=_[_0xc922('0x37')](_0xd5ceea['model'],_0xd5ceea[_0xc922('0x36')]);_0x3101c9[_0xc922('0x38')]=_[_0xc922('0x37')](_0xd5ceea[_0xc922('0x34')],qs['fields'](_0x3ae6c6[_0xc922('0x36')][_0xc922('0x39')]));_0x3101c9['attributes']=_0x3101c9[_0xc922('0x38')][_0xc922('0x3a')]?_0x3101c9[_0xc922('0x38')]:_0xd5ceea['model'];if(_0x3ae6c6[_0xc922('0x36')][_0xc922('0x41')]){_0x3101c9[_0xc922('0x42')]=[{'all':!![]}];}_0x3101c9=_[_0xc922('0x3f')]({},_0x3101c9,_0x3ae6c6[_0xc922('0x40')]);return db[_0xc922('0x30')][_0xc922('0x48')](_0x3101c9)[_0xc922('0x29')](handleEntityNotFound(_0x1db82c,null))[_0xc922('0x29')](respondWithResult(_0x1db82c,null))[_0xc922('0x45')](handleError(_0x1db82c,null));};exports['create']=function(_0x40a94a,_0x1c2606){return db[_0xc922('0x30')][_0xc922('0x49')](_0x40a94a['body'],{})[_0xc922('0x29')](function(_0x1857ea){var _0x56f338=_0x40a94a['user']['get']({'plain':!![]});if(!_0x56f338)throw new Error(_0xc922('0x4a'));if(_0x56f338[_0xc922('0x4b')]===_0xc922('0x4c')){var _0x1db9f3=_0x1857ea['get']({'plain':!![]});var _0x3fa894=_0xc922('0x27');return db[_0xc922('0x4d')][_0xc922('0x48')]({'where':{'name':_0x3fa894,'userProfileId':_0x56f338[_0xc922('0x4e')]},'raw':!![]})['then'](function(_0x39afeb){if(_0x39afeb&&_0x39afeb[_0xc922('0x4f')]===0x0){return db[_0xc922('0x28')][_0xc922('0x49')]({'name':_0x1db9f3['name'],'resourceId':_0x1db9f3['id'],'type':_0x39afeb['name'],'sectionId':_0x39afeb['id']},{})[_0xc922('0x29')](function(){return _0x1857ea;});}else{return _0x1857ea;}})[_0xc922('0x45')](function(_0x801b48){logger[_0xc922('0x2b')](_0xc922('0x50'),_0x801b48);throw _0x801b48;});}return _0x1857ea;})['then'](respondWithResult(_0x1c2606,0xc9))[_0xc922('0x45')](handleError(_0x1c2606,null));};exports[_0xc922('0x51')]=function(_0x555ed8,_0x22f564){if(_0x555ed8[_0xc922('0x52')]['id']){delete _0x555ed8[_0xc922('0x52')]['id'];}return db['FaxQueue'][_0xc922('0x48')]({'where':{'id':_0x555ed8[_0xc922('0x47')]['id']}})['then'](handleEntityNotFound(_0x22f564,null))[_0xc922('0x29')](saveUpdates(_0x555ed8[_0xc922('0x52')],null))['then'](respondWithResult(_0x22f564,null))[_0xc922('0x45')](handleError(_0x22f564,null));};exports[_0xc922('0x53')]=function(_0x566e5e,_0x141dab){return db[_0xc922('0x30')][_0xc922('0x48')]({'where':{'id':_0x566e5e['params']['id']}})[_0xc922('0x29')](handleEntityNotFound(_0x141dab,null))['then'](removeEntity(_0x141dab,null))[_0xc922('0x45')](handleError(_0x141dab,null));};exports[_0xc922('0x54')]=function(_0x3654eb,_0x6494a7){return db['FaxQueue'][_0xc922('0x54')]()[_0xc922('0x29')](respondWithResult(_0x6494a7,null))['catch'](handleError(_0x6494a7,null));};exports[_0xc922('0x55')]=function(_0x5067f9,_0x5034d6,_0x195041){var _0x57627a={'raw':!![],'where':{}},_0x230516={},_0x44786c;return db[_0xc922('0x30')][_0xc922('0x56')]({'where':{'id':_0x5067f9[_0xc922('0x47')]['id']}})[_0xc922('0x29')](handleEntityNotFound(_0x5034d6,null))[_0xc922('0x29')](function(_0x41eb7d){if(_0x41eb7d){_0x44786c=_0x41eb7d[_0xc922('0x57')]({'plain':!![]});_0x230516['model']=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x230516[_0xc922('0x36')]=_[_0xc922('0x35')](_0x5067f9[_0xc922('0x36')]);_0x230516[_0xc922('0x3d')]=_[_0xc922('0x37')](_0x230516[_0xc922('0x34')],_0x230516[_0xc922('0x36')]);_0x57627a[_0xc922('0x38')]=_[_0xc922('0x37')](_0x230516[_0xc922('0x34')],qs[_0xc922('0x39')](_0x5067f9[_0xc922('0x36')]['fields']));_0x57627a[_0xc922('0x38')]=_0x57627a[_0xc922('0x38')][_0xc922('0x3a')]?_0x57627a[_0xc922('0x38')]:_0x230516[_0xc922('0x34')];if(!_0x5067f9[_0xc922('0x36')]['hasOwnProperty']('nolimit')){_0x57627a['limit']=qs['limit'](_0x5067f9[_0xc922('0x36')]['limit']);_0x57627a[_0xc922('0x1e')]=qs[_0xc922('0x1e')](_0x5067f9[_0xc922('0x36')][_0xc922('0x1e')]);}_0x57627a[_0xc922('0x58')]=qs[_0xc922('0x3b')](_0x5067f9[_0xc922('0x36')][_0xc922('0x3b')]);_0x57627a[_0xc922('0x3c')]=qs[_0xc922('0x3d')](_[_0xc922('0x59')](_0x5067f9[_0xc922('0x36')],_0x230516['filters']));_0x57627a[_0xc922('0x3c')][_0xc922('0x5a')]=_0x41eb7d['id'];if(_0x5067f9[_0xc922('0x36')][_0xc922('0x3e')]){_0x57627a[_0xc922('0x3c')]=_[_0xc922('0x3f')](_0x57627a[_0xc922('0x3c')],{'$or':_['map'](_0x57627a['attributes'],function(_0x258a63){var _0x114a94={};_0x114a94[_0x258a63]={'$like':'%'+_0x5067f9[_0xc922('0x36')][_0xc922('0x3e')]+'%'};return _0x114a94;})});}_0x57627a=_[_0xc922('0x3f')]({},_0x57627a,_0x5067f9[_0xc922('0x40')]);return db[_0xc922('0x5b')]['findAll'](_0x57627a);}})[_0xc922('0x29')](function(_0x756414){if(_0x756414){return db[_0xc922('0x5c')][_0xc922('0x5d')]({'where':{'id':_[_0xc922('0x2f')](_0x756414,_0xc922('0x5e')),'role':'agent'},'attributes':['id',_0xc922('0x2c'),_0xc922('0x5f'),_0xc922('0x60'),_0xc922('0x61')]});}})[_0xc922('0x29')](function(_0x574fdf){if(_0x574fdf){return{'count':_0x574fdf['count'],'rows':_['map'](_0x574fdf[_0xc922('0x44')],function(_0x212124){return{'membername':_0x212124[_0xc922('0x2c')],'UserId':_0x212124['id'],'queue_name':_0x44786c[_0xc922('0x2c')],'FaxQueueId':_0x44786c['id'],'interface':util[_0xc922('0x62')](_0xc922('0x63'),_0xc922('0x64'),_0x212124['name']),'penalty':0x0,'paused':_0x212124['faxPause'],'createdAt':_0x212124['createdAt'],'updatedAt':_0x212124[_0xc922('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc922('0x29')](respondWithFilteredResult(_0x5034d6,_0x57627a))[_0xc922('0x45')](handleError(_0x5034d6,null));};exports[_0xc922('0x65')]=function(_0x389364,_0x336734,_0x24bab9){var _0xf3b31={};var _0x4dfdcc={};var _0x9e7818;var _0x4d6100;return db['FaxQueue']['findOne']({'where':{'id':_0x389364[_0xc922('0x47')]['id']}})['then'](handleEntityNotFound(_0x336734,null))['then'](function(_0x4cdf71){if(_0x4cdf71){_0x9e7818=_0x4cdf71;_0x4dfdcc[_0xc922('0x34')]=_['keys'](db[_0xc922('0x66')][_0xc922('0x67')]);_0x4dfdcc['query']=_[_0xc922('0x35')](_0x389364['query']);_0x4dfdcc[_0xc922('0x3d')]=_[_0xc922('0x37')](_0x4dfdcc['model'],_0x4dfdcc[_0xc922('0x36')]);_0xf3b31[_0xc922('0x38')]=_[_0xc922('0x37')](_0x4dfdcc[_0xc922('0x34')],qs[_0xc922('0x39')](_0x389364[_0xc922('0x36')][_0xc922('0x39')]));_0xf3b31['attributes']=_0xf3b31[_0xc922('0x38')]['length']?_0xf3b31['attributes']:_0x4dfdcc[_0xc922('0x34')];_0xf3b31[_0xc922('0x58')]=qs[_0xc922('0x3b')](_0x389364['query'][_0xc922('0x3b')]);_0xf3b31['where']=qs[_0xc922('0x3d')](_[_0xc922('0x59')](_0x389364[_0xc922('0x36')],_0x4dfdcc[_0xc922('0x3d')]));if(_0x389364[_0xc922('0x36')][_0xc922('0x3e')]){_0xf3b31[_0xc922('0x3c')]=_['merge'](_0xf3b31[_0xc922('0x3c')],{'$or':_[_0xc922('0x2f')](_0xf3b31['attributes'],function(_0x2a4df2){var _0x24bc2e={};_0x24bc2e[_0x2a4df2]={'$like':'%'+_0x389364[_0xc922('0x36')][_0xc922('0x3e')]+'%'};return _0x24bc2e;})});}_0xf3b31=_[_0xc922('0x3f')]({},_0xf3b31,_0x389364[_0xc922('0x40')]);return _0x9e7818[_0xc922('0x65')](_0xf3b31);}})[_0xc922('0x29')](function(_0x252cd7){if(_0x252cd7){_0x4d6100=_0x252cd7[_0xc922('0x3a')];if(!_0x389364[_0xc922('0x36')][_0xc922('0x68')](_0xc922('0x69'))){_0xf3b31[_0xc922('0x20')]=qs[_0xc922('0x20')](_0x389364[_0xc922('0x36')][_0xc922('0x20')]);_0xf3b31[_0xc922('0x1e')]=qs['offset'](_0x389364['query'][_0xc922('0x1e')]);}return _0x9e7818[_0xc922('0x65')](_0xf3b31);}})[_0xc922('0x29')](function(_0x1d0b7d){if(_0x1d0b7d){return _0x1d0b7d?{'count':_0x4d6100,'rows':_0x1d0b7d}:null;}})[_0xc922('0x29')](respondWithResult(_0x336734,null))[_0xc922('0x45')](handleError(_0x336734,null));};exports[_0xc922('0x6a')]=function(_0x5eabbb,_0x24d7c6,_0x4bf6c4){var _0x1454e2=_0x5eabbb[_0xc922('0x52')][_0xc922('0x6b')];return db[_0xc922('0x66')]['findAll']({'where':{'id':_0x1454e2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc922('0x6c'),'attributes':['id',_0xc922('0x2c'),_0xc922('0x6d'),_0xc922('0x6e'),'interface'],'raw':!![]}]})[_0xc922('0x29')](function(_0x21c688){if(_0x21c688){var _0x50a333=_[_0xc922('0x6f')](_0x21c688,function(_0x3fd63c){var _0x5f420b=_0x3fd63c[_0xc922('0x57')]({'plain':!![]});return _0x5f420b[_0xc922('0x6c')];});return db[_0xc922('0x30')]['find']({'where':{'id':_0x5eabbb[_0xc922('0x47')]['id']}})['then'](function(_0x78672b){return db[_0xc922('0x70')][_0xc922('0x71')](function(_0x300e31){return _0x78672b[_0xc922('0x6a')](_0x1454e2,{'transaction':_0x300e31})[_0xc922('0x29')](function(){return BPromise[_0xc922('0x72')](_0x50a333,function(_0x1375fd){return db[_0xc922('0x5b')]['findOrCreate']({'where':{'UserId':_0x1375fd['id'],'FaxQueueId':_0x5eabbb[_0xc922('0x47')]['id']},'transaction':_0x300e31});});})['then'](function(){_0x50a333['forEach'](function(_0x41ebe9){socket['emit'](_0xc922('0x73'),{'UserId':_0x41ebe9['id'],'FaxQueueId':_0x78672b['id']});});});});});}})['then'](respondWithStatusCode(_0x24d7c6,null))['catch'](handleError(_0x24d7c6,null));};exports[_0xc922('0x74')]=function(_0x1d1e99,_0x3dc11e,_0x1534b4){return db[_0xc922('0x66')]['findAll']({'where':{'id':_0x1d1e99[_0xc922('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc922('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3dc11e,null))[_0xc922('0x29')](function(_0x1ceb1c){var _0x1799d3=_[_0xc922('0x2f')](_0x1ceb1c,'id');var _0x2b03e9=[];var _0xd9abdc=[];var _0x2440f5=squel['select']();_0x2440f5['field'](_0xc922('0x75'))[_0xc922('0x76')](_0xc922('0x77'),'tq')[_0xc922('0x78')](_0xc922('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xc922('0x7a'),_0x1d1e99[_0xc922('0x47')]['id']);for(var _0x3ed189=0x0;_0x3ed189<_0x1ceb1c[_0xc922('0x3a')];_0x3ed189+=0x1){let _0x4b31ac=_0x1ceb1c[_0x3ed189];for(var _0x13b086=0x0;_0x13b086<_0x4b31ac[_0xc922('0x6c')][_0xc922('0x3a')];_0x13b086+=0x1){let _0x59513b=_0x4b31ac[_0xc922('0x6c')][_0x13b086];var _0x36709f=_0x2440f5['clone']();_0x36709f['where'](_0xc922('0x7b'),_0x59513b['id']);_0xd9abdc[_0xc922('0x7c')](db[_0xc922('0x70')][_0xc922('0x36')](_0x36709f[_0xc922('0x7d')](),{'type':db[_0xc922('0x70')]['QueryTypes'][_0xc922('0x7e')]})['then'](function(_0x47aea7){if(_0x47aea7[_0xc922('0x3a')]===0x1){return _0x59513b['id'];}else{var _0x11ee74=_['every'](_[_0xc922('0x2f')](_0x47aea7,_0xc922('0x7f')),function(_0x22dab5){return _['includes'](_0x1799d3,_0x22dab5);});if(_0x11ee74){return _0x59513b['id'];}}}));}}return BPromise[_0xc922('0x80')](_0xd9abdc)[_0xc922('0x29')](function(_0x159b57){_0x2b03e9=_(_0x2b03e9)[_0xc922('0x81')](_0x159b57)[_0xc922('0x82')]()['value']();return db[_0xc922('0x30')]['find']({'where':{'id':_0x1d1e99[_0xc922('0x47')]['id']}})[_0xc922('0x29')](function(_0x509916){return db[_0xc922('0x70')][_0xc922('0x71')](function(_0x520389){return _0x509916[_0xc922('0x74')](_0x1d1e99['query'][_0xc922('0x6b')],{'transaction':_0x520389})[_0xc922('0x29')](function(){if(!_['isEmpty'](_0x2b03e9)){return _0x509916['removeAgents'](_0x2b03e9,{'transaction':_0x520389});}})['then'](function(){_0x2b03e9[_0xc922('0x83')](function(_0x28029d){socket[_0xc922('0x84')](_0xc922('0x85'),{'UserId':_0x28029d,'FaxQueueId':_0x509916['id']});});});});});});})[_0xc922('0x29')](respondWithStatusCode(_0x3dc11e,null))[_0xc922('0x45')](handleError(_0x3dc11e,null));};exports['addAgents']=function(_0x2321ac,_0x294037,_0x2e7dd5){return db['FaxQueue'][_0xc922('0x48')]({'where':{'id':_0x2321ac['params']['id']}})[_0xc922('0x29')](handleEntityNotFound(_0x294037,null))[_0xc922('0x29')](function(_0x6bedb8){if(_0x6bedb8){return _0x6bedb8[_0xc922('0x86')](_0x2321ac[_0xc922('0x52')]['ids'],_['omit'](_0x2321ac[_0xc922('0x52')],[_0xc922('0x6b'),'id'])||{})[_0xc922('0x87')](function(_0x6e5015){for(var _0x9a22db=0x0;_0x9a22db<_0x2321ac['body']['ids'][_0xc922('0x3a')];_0x9a22db+=0x1){socket[_0xc922('0x84')](_0xc922('0x73'),{'UserId':Number(_0x2321ac[_0xc922('0x52')][_0xc922('0x6b')][_0x9a22db]),'FaxQueueId':Number(_0x2321ac[_0xc922('0x47')]['id'])});}return _0x6e5015;});}})['then'](respondWithResult(_0x294037,null))[_0xc922('0x45')](handleError(_0x294037,null));};exports[_0xc922('0x88')]=function(_0x13430f,_0x3f7632,_0x174aa6){return db[_0xc922('0x30')][_0xc922('0x48')]({'where':{'id':_0x13430f[_0xc922('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f7632,null))['then'](function(_0x2a2ec7){if(_0x2a2ec7){return _0x2a2ec7[_0xc922('0x88')](_0x13430f[_0xc922('0x36')][_0xc922('0x6b')])[_0xc922('0x29')](function(){if(_[_0xc922('0x89')](_0x13430f[_0xc922('0x36')][_0xc922('0x6b')])){for(var _0x415443=0x0;_0x415443<_0x13430f[_0xc922('0x36')][_0xc922('0x6b')][_0xc922('0x3a')];_0x415443+=0x1){socket[_0xc922('0x84')](_0xc922('0x85'),{'UserId':Number(_0x13430f[_0xc922('0x36')]['ids'][_0x415443]),'FaxQueueId':Number(_0x13430f[_0xc922('0x47')]['id'])});}}else{socket[_0xc922('0x84')](_0xc922('0x85'),{'UserId':Number(_0x13430f[_0xc922('0x36')]['ids']),'FaxQueueId':Number(_0x13430f[_0xc922('0x47')]['id'])});}});}})[_0xc922('0x29')](respondWithStatusCode(_0x3f7632,null))['catch'](handleError(_0x3f7632,null));};exports['getAgents']=function(_0x4c9b32,_0x2312e4,_0x4c607f){var _0x2a39ce={};var _0x4a9f85={};var _0x455e4c;var _0x21cd6c;return db[_0xc922('0x30')][_0xc922('0x56')]({'where':{'id':_0x4c9b32[_0xc922('0x47')]['id']}})[_0xc922('0x29')](handleEntityNotFound(_0x2312e4,null))[_0xc922('0x29')](function(_0x22c91f){if(_0x22c91f){_0x455e4c=_0x22c91f;_0x4a9f85[_0xc922('0x34')]=_['keys'](db[_0xc922('0x5c')][_0xc922('0x67')]);_0x4a9f85['query']=_[_0xc922('0x35')](_0x4c9b32[_0xc922('0x36')]);_0x4a9f85[_0xc922('0x3d')]=_['intersection'](_0x4a9f85[_0xc922('0x34')],_0x4a9f85[_0xc922('0x36')]);_0x2a39ce[_0xc922('0x38')]=_[_0xc922('0x37')](_0x4a9f85[_0xc922('0x34')],qs[_0xc922('0x39')](_0x4c9b32[_0xc922('0x36')]['fields']));_0x2a39ce[_0xc922('0x38')]=_0x2a39ce[_0xc922('0x38')]['length']?_0x2a39ce[_0xc922('0x38')]:_0x4a9f85[_0xc922('0x34')];_0x2a39ce['order']=qs[_0xc922('0x3b')](_0x4c9b32[_0xc922('0x36')][_0xc922('0x3b')]);_0x2a39ce[_0xc922('0x3c')]=qs[_0xc922('0x3d')](_[_0xc922('0x59')](_0x4c9b32['query'],_0x4a9f85[_0xc922('0x3d')]));if(_0x4c9b32[_0xc922('0x36')]['filter']){_0x2a39ce[_0xc922('0x3c')]=_[_0xc922('0x3f')](_0x2a39ce[_0xc922('0x3c')],{'$or':_[_0xc922('0x2f')](_0x2a39ce[_0xc922('0x38')],function(_0x1143fd){var _0x3495d6={};_0x3495d6[_0x1143fd]={'$like':'%'+_0x4c9b32[_0xc922('0x36')]['filter']+'%'};return _0x3495d6;})});}_0x2a39ce=_['merge']({},_0x2a39ce,_0x4c9b32[_0xc922('0x40')]);return _0x455e4c[_0xc922('0x8a')](_0x2a39ce);}})[_0xc922('0x29')](function(_0x442397){if(_0x442397){_0x21cd6c=_0x442397['length'];if(!_0x4c9b32[_0xc922('0x36')]['hasOwnProperty'](_0xc922('0x69'))){_0x2a39ce[_0xc922('0x20')]=qs[_0xc922('0x20')](_0x4c9b32['query'][_0xc922('0x20')]);_0x2a39ce[_0xc922('0x1e')]=qs[_0xc922('0x1e')](_0x4c9b32[_0xc922('0x36')][_0xc922('0x1e')]);}return _0x455e4c[_0xc922('0x8a')](_0x2a39ce);}})[_0xc922('0x29')](function(_0x92c27e){if(_0x92c27e){return _0x92c27e?{'count':_0x21cd6c,'rows':_0x92c27e}:null;}})[_0xc922('0x29')](respondWithResult(_0x2312e4,null))[_0xc922('0x45')](handleError(_0x2312e4,null));};
\ No newline at end of file
+var _0x7b73=['findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','value','isEmpty','addAgents','omit','spread','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','where','merge','filter','includeAll','findAll','rows','catch','show','params','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction'];(function(_0x2d1894,_0x161978){var _0x9e888d=function(_0x46ee43){while(--_0x46ee43){_0x2d1894['push'](_0x2d1894['shift']());}};_0x9e888d(++_0x161978);}(_0x7b73,0x139));var _0x37b7=function(_0x10a08d,_0x1bab5d){_0x10a08d=_0x10a08d-0x0;var _0x27abcc=_0x7b73[_0x10a08d];return _0x27abcc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x37b7('0x0'));var jsonpatch=require(_0x37b7('0x1'));var rp=require(_0x37b7('0x2'));var moment=require(_0x37b7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x37b7('0x4'));var util=require(_0x37b7('0x5'));var path=require(_0x37b7('0x6'));var sox=require(_0x37b7('0x7'));var csv=require(_0x37b7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37b7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x37b7('0xa'));var jsforce=require(_0x37b7('0xb'));var deskjs=require(_0x37b7('0xc'));var toCsv=require(_0x37b7('0x8'));var querystring=require(_0x37b7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37b7('0xe'));var qs=require(_0x37b7('0xf'));var as=require(_0x37b7('0x10'));var hardwareService=require(_0x37b7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x37b7('0x12'));var config=require(_0x37b7('0x13'));var licenseUtil=require(_0x37b7('0x14'));var db=require('../../mysqldb')['db'];config[_0x37b7('0x15')]=_[_0x37b7('0x16')](config['redis'],{'host':_0x37b7('0x17'),'port':0x18eb});var socket=require(_0x37b7('0x18'))(new Redis(config['redis']));require(_0x37b7('0x19'))['register'](socket);function respondWithStatusCode(_0x4918c3,_0x5ca21d){_0x5ca21d=_0x5ca21d||0xcc;return function(_0x1dc9fb){if(_0x1dc9fb){return _0x4918c3[_0x37b7('0x1a')](_0x5ca21d);}return _0x4918c3['status'](_0x5ca21d)['end']();};}function respondWithResult(_0x45c887,_0x64bf28){_0x64bf28=_0x64bf28||0xc8;return function(_0x30b495){if(_0x30b495){return _0x45c887[_0x37b7('0x1b')](_0x64bf28)[_0x37b7('0x1c')](_0x30b495);}};}function respondWithFilteredResult(_0x16da32,_0x505b9a){return function(_0x3f3245){if(_0x3f3245){var _0x523f9b=typeof _0x505b9a[_0x37b7('0x1d')]===_0x37b7('0x1e')&&typeof _0x505b9a['limit']===_0x37b7('0x1e');var _0x17c329=_0x3f3245[_0x37b7('0x1f')];var _0x3b522a=_0x523f9b?0x0:_0x505b9a[_0x37b7('0x1d')];var _0x1c22e4=_0x523f9b?_0x3f3245[_0x37b7('0x1f')]:_0x505b9a[_0x37b7('0x1d')]+_0x505b9a['limit'];var _0x2d19c2;if(_0x1c22e4>=_0x17c329){_0x1c22e4=_0x17c329;_0x2d19c2=0xc8;}else{_0x2d19c2=0xce;}_0x16da32['status'](_0x2d19c2);return _0x16da32['set'](_0x37b7('0x20'),_0x3b522a+'-'+_0x1c22e4+'/'+_0x17c329)[_0x37b7('0x1c')](_0x3f3245);}return null;};}function patchUpdates(_0x45808e){return function(_0x4e44ed){try{jsonpatch[_0x37b7('0x21')](_0x4e44ed,_0x45808e,!![]);}catch(_0x3d9c33){return BPromise[_0x37b7('0x22')](_0x3d9c33);}return _0x4e44ed[_0x37b7('0x23')]();};}function saveUpdates(_0x4e4229,_0x20f8e1){return function(_0x4264af){if(_0x4264af){return _0x4264af[_0x37b7('0x24')](_0x4e4229)[_0x37b7('0x25')](function(_0x236c34){return _0x236c34;});}return null;};}function removeEntity(_0x3e6ecb,_0xc33058){return function(_0x56c5ef){if(_0x56c5ef){return _0x56c5ef[_0x37b7('0x26')]()[_0x37b7('0x25')](function(){var _0x3bbecb=_0x56c5ef[_0x37b7('0x27')]({'plain':!![]});var _0x143569=_0x37b7('0x28');return db[_0x37b7('0x29')]['destroy']({'where':{'type':_0x143569,'resourceId':_0x3bbecb['id']}})[_0x37b7('0x25')](function(){return _0x56c5ef;});})[_0x37b7('0x25')](function(){_0x3e6ecb[_0x37b7('0x1b')](0xcc)[_0x37b7('0x2a')]();});}};}function handleEntityNotFound(_0x3e1adc,_0x4c2832){return function(_0x4d4e9e){if(!_0x4d4e9e){_0x3e1adc[_0x37b7('0x1a')](0x194);}return _0x4d4e9e;};}function handleError(_0x5cd5d5,_0x53b6fe){_0x53b6fe=_0x53b6fe||0x1f4;return function(_0x249f1c){logger[_0x37b7('0x2b')](_0x249f1c[_0x37b7('0x2c')]);if(_0x249f1c[_0x37b7('0x2d')]){delete _0x249f1c[_0x37b7('0x2d')];}_0x5cd5d5[_0x37b7('0x1b')](_0x53b6fe)[_0x37b7('0x2e')](_0x249f1c);};}exports['index']=function(_0x526499,_0x5b08a7){var _0x10b214={},_0x35b612={},_0x5a3390={'count':0x0,'rows':[]};var _0x42213f=_[_0x37b7('0x2f')](db[_0x37b7('0x30')][_0x37b7('0x31')],function(_0x3f1fa2){return{'name':_0x3f1fa2[_0x37b7('0x32')],'type':_0x3f1fa2[_0x37b7('0x33')][_0x37b7('0x34')]};});_0x35b612[_0x37b7('0x35')]=_['map'](_0x42213f,_0x37b7('0x2d'));_0x35b612[_0x37b7('0x36')]=_[_0x37b7('0x37')](_0x526499[_0x37b7('0x36')]);_0x35b612[_0x37b7('0x38')]=_['intersection'](_0x35b612[_0x37b7('0x35')],_0x35b612['query']);_0x10b214[_0x37b7('0x39')]=_[_0x37b7('0x3a')](_0x35b612['model'],qs[_0x37b7('0x3b')](_0x526499['query'][_0x37b7('0x3b')]));_0x10b214[_0x37b7('0x39')]=_0x10b214[_0x37b7('0x39')][_0x37b7('0x3c')]?_0x10b214[_0x37b7('0x39')]:_0x35b612[_0x37b7('0x35')];if(!_0x526499[_0x37b7('0x36')]['hasOwnProperty'](_0x37b7('0x3d'))){_0x10b214[_0x37b7('0x3e')]=qs[_0x37b7('0x3e')](_0x526499[_0x37b7('0x36')][_0x37b7('0x3e')]);_0x10b214[_0x37b7('0x1d')]=qs[_0x37b7('0x1d')](_0x526499['query'][_0x37b7('0x1d')]);}_0x10b214[_0x37b7('0x3f')]=qs[_0x37b7('0x40')](_0x526499['query'][_0x37b7('0x40')]);_0x10b214['where']=qs[_0x37b7('0x38')](_[_0x37b7('0x41')](_0x526499[_0x37b7('0x36')],_0x35b612[_0x37b7('0x38')]),_0x42213f);if(_0x526499[_0x37b7('0x36')]['filter']){_0x10b214[_0x37b7('0x42')]=_[_0x37b7('0x43')](_0x10b214[_0x37b7('0x42')],{'$or':_['map'](_0x42213f,function(_0x2c4d18){if(_0x2c4d18[_0x37b7('0x33')]!=='VIRTUAL'){var _0x1589e5={};_0x1589e5[_0x2c4d18[_0x37b7('0x2d')]]={'$like':'%'+_0x526499[_0x37b7('0x36')][_0x37b7('0x44')]+'%'};return _0x1589e5;}})});}_0x10b214=_[_0x37b7('0x43')]({},_0x10b214,_0x526499['options']);var _0x956e7a={'where':_0x10b214[_0x37b7('0x42')]};return db[_0x37b7('0x30')]['count'](_0x956e7a)[_0x37b7('0x25')](function(_0x2efb85){_0x5a3390[_0x37b7('0x1f')]=_0x2efb85;if(_0x526499[_0x37b7('0x36')][_0x37b7('0x45')]){_0x10b214['include']=[{'all':!![]}];}return db[_0x37b7('0x30')][_0x37b7('0x46')](_0x10b214);})[_0x37b7('0x25')](function(_0x1be5e1){_0x5a3390[_0x37b7('0x47')]=_0x1be5e1;return _0x5a3390;})[_0x37b7('0x25')](respondWithFilteredResult(_0x5b08a7,_0x10b214))[_0x37b7('0x48')](handleError(_0x5b08a7,null));};exports[_0x37b7('0x49')]=function(_0xbf1390,_0x22bae3){var _0x2420f8={'raw':!![],'where':{'id':_0xbf1390[_0x37b7('0x4a')]['id']}},_0x46923c={};_0x46923c['model']=_[_0x37b7('0x37')](db[_0x37b7('0x30')]['rawAttributes']);_0x46923c['query']=_['keys'](_0xbf1390[_0x37b7('0x36')]);_0x46923c[_0x37b7('0x38')]=_[_0x37b7('0x3a')](_0x46923c[_0x37b7('0x35')],_0x46923c[_0x37b7('0x36')]);_0x2420f8['attributes']=_[_0x37b7('0x3a')](_0x46923c[_0x37b7('0x35')],qs[_0x37b7('0x3b')](_0xbf1390[_0x37b7('0x36')]['fields']));_0x2420f8[_0x37b7('0x39')]=_0x2420f8[_0x37b7('0x39')]['length']?_0x2420f8['attributes']:_0x46923c[_0x37b7('0x35')];if(_0xbf1390[_0x37b7('0x36')][_0x37b7('0x45')]){_0x2420f8['include']=[{'all':!![]}];}_0x2420f8=_[_0x37b7('0x43')]({},_0x2420f8,_0xbf1390[_0x37b7('0x4b')]);return db[_0x37b7('0x30')]['find'](_0x2420f8)[_0x37b7('0x25')](handleEntityNotFound(_0x22bae3,null))[_0x37b7('0x25')](respondWithResult(_0x22bae3,null))[_0x37b7('0x48')](handleError(_0x22bae3,null));};exports['create']=function(_0x2bafb1,_0x5e6df2){return db['FaxQueue'][_0x37b7('0x4c')](_0x2bafb1['body'],{})[_0x37b7('0x25')](function(_0x2e0643){var _0x3356b1=_0x2bafb1['user'][_0x37b7('0x27')]({'plain':!![]});if(!_0x3356b1)throw new Error(_0x37b7('0x4d'));if(_0x3356b1[_0x37b7('0x4e')]===_0x37b7('0x4f')){var _0x472c48=_0x2e0643[_0x37b7('0x27')]({'plain':!![]});var _0x495b28=_0x37b7('0x28');return db[_0x37b7('0x50')][_0x37b7('0x51')]({'where':{'name':_0x495b28,'userProfileId':_0x3356b1[_0x37b7('0x52')]},'raw':!![]})['then'](function(_0xcfad80){if(_0xcfad80&&_0xcfad80[_0x37b7('0x53')]===0x0){return db[_0x37b7('0x29')]['create']({'name':_0x472c48[_0x37b7('0x2d')],'resourceId':_0x472c48['id'],'type':_0xcfad80[_0x37b7('0x2d')],'sectionId':_0xcfad80['id']},{})[_0x37b7('0x25')](function(){return _0x2e0643;});}else{return _0x2e0643;}})[_0x37b7('0x48')](function(_0x49f4d5){logger[_0x37b7('0x2b')](_0x37b7('0x54'),_0x49f4d5);throw _0x49f4d5;});}return _0x2e0643;})[_0x37b7('0x25')](respondWithResult(_0x5e6df2,0xc9))[_0x37b7('0x48')](handleError(_0x5e6df2,null));};exports[_0x37b7('0x24')]=function(_0x4df0dc,_0x26bdde){if(_0x4df0dc[_0x37b7('0x55')]['id']){delete _0x4df0dc[_0x37b7('0x55')]['id'];}return db[_0x37b7('0x30')][_0x37b7('0x51')]({'where':{'id':_0x4df0dc['params']['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x26bdde,null))[_0x37b7('0x25')](saveUpdates(_0x4df0dc[_0x37b7('0x55')],null))['then'](respondWithResult(_0x26bdde,null))[_0x37b7('0x48')](handleError(_0x26bdde,null));};exports[_0x37b7('0x26')]=function(_0x2fbca7,_0x2662fb){return db[_0x37b7('0x30')][_0x37b7('0x51')]({'where':{'id':_0x2fbca7[_0x37b7('0x4a')]['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x2662fb,null))[_0x37b7('0x25')](removeEntity(_0x2662fb,null))[_0x37b7('0x48')](handleError(_0x2662fb,null));};exports[_0x37b7('0x56')]=function(_0x11a4b7,_0x4db51c){return db[_0x37b7('0x30')]['describe']()[_0x37b7('0x25')](respondWithResult(_0x4db51c,null))[_0x37b7('0x48')](handleError(_0x4db51c,null));};exports[_0x37b7('0x57')]=function(_0x5a19da,_0x4b736c,_0x13a449){var _0x4f8bba={'raw':!![],'where':{}},_0x151b13={},_0x5b4640;return db[_0x37b7('0x30')][_0x37b7('0x58')]({'where':{'id':_0x5a19da[_0x37b7('0x4a')]['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x4b736c,null))['then'](function(_0x1f6eba){if(_0x1f6eba){_0x5b4640=_0x1f6eba[_0x37b7('0x27')]({'plain':!![]});_0x151b13[_0x37b7('0x35')]=_[_0x37b7('0x37')](db[_0x37b7('0x59')][_0x37b7('0x31')]);_0x151b13[_0x37b7('0x36')]=_[_0x37b7('0x37')](_0x5a19da[_0x37b7('0x36')]);_0x151b13['filters']=_[_0x37b7('0x3a')](_0x151b13['model'],_0x151b13['query']);_0x4f8bba[_0x37b7('0x39')]=_[_0x37b7('0x3a')](_0x151b13[_0x37b7('0x35')],qs[_0x37b7('0x3b')](_0x5a19da['query'][_0x37b7('0x3b')]));_0x4f8bba[_0x37b7('0x39')]=_0x4f8bba['attributes'][_0x37b7('0x3c')]?_0x4f8bba[_0x37b7('0x39')]:_0x151b13['model'];if(!_0x5a19da[_0x37b7('0x36')][_0x37b7('0x5a')](_0x37b7('0x3d'))){_0x4f8bba[_0x37b7('0x3e')]=qs['limit'](_0x5a19da[_0x37b7('0x36')]['limit']);_0x4f8bba[_0x37b7('0x1d')]=qs[_0x37b7('0x1d')](_0x5a19da[_0x37b7('0x36')][_0x37b7('0x1d')]);}_0x4f8bba['order']=qs[_0x37b7('0x40')](_0x5a19da[_0x37b7('0x36')][_0x37b7('0x40')]);_0x4f8bba[_0x37b7('0x42')]=qs[_0x37b7('0x38')](_[_0x37b7('0x41')](_0x5a19da[_0x37b7('0x36')],_0x151b13[_0x37b7('0x38')]));_0x4f8bba['where']['FaxQueueId']=_0x1f6eba['id'];if(_0x5a19da['query']['filter']){_0x4f8bba[_0x37b7('0x42')]=_['merge'](_0x4f8bba[_0x37b7('0x42')],{'$or':_[_0x37b7('0x2f')](_0x4f8bba[_0x37b7('0x39')],function(_0x16c86d){var _0x4c8f97={};_0x4c8f97[_0x16c86d]={'$like':'%'+_0x5a19da[_0x37b7('0x36')][_0x37b7('0x44')]+'%'};return _0x4c8f97;})});}_0x4f8bba=_['merge']({},_0x4f8bba,_0x5a19da[_0x37b7('0x4b')]);return db[_0x37b7('0x59')][_0x37b7('0x46')](_0x4f8bba);}})[_0x37b7('0x25')](function(_0x4ad8b5){if(_0x4ad8b5){return db['User']['findAndCountAll']({'where':{'id':_[_0x37b7('0x2f')](_0x4ad8b5,_0x37b7('0x5b')),'role':_0x37b7('0x5c')},'attributes':['id',_0x37b7('0x2d'),_0x37b7('0x5d'),'updatedAt',_0x37b7('0x5e')]});}})[_0x37b7('0x25')](function(_0x4d92e4){if(_0x4d92e4){return{'count':_0x4d92e4['count'],'rows':_['map'](_0x4d92e4[_0x37b7('0x47')],function(_0x31bb33){return{'membername':_0x31bb33[_0x37b7('0x2d')],'UserId':_0x31bb33['id'],'queue_name':_0x5b4640[_0x37b7('0x2d')],'FaxQueueId':_0x5b4640['id'],'interface':util[_0x37b7('0x5f')](_0x37b7('0x60'),_0x37b7('0x61'),_0x31bb33[_0x37b7('0x2d')]),'penalty':0x0,'paused':_0x31bb33[_0x37b7('0x5d')],'createdAt':_0x31bb33[_0x37b7('0x5e')],'updatedAt':_0x31bb33[_0x37b7('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4b736c,_0x4f8bba))['catch'](handleError(_0x4b736c,null));};exports[_0x37b7('0x63')]=function(_0x7f97ee,_0x87378c,_0x1d7bc8){var _0x1f6bca={};var _0x543728={};var _0x2e909b;var _0x45bbb6;return db[_0x37b7('0x30')]['findOne']({'where':{'id':_0x7f97ee['params']['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x87378c,null))[_0x37b7('0x25')](function(_0x79884c){if(_0x79884c){_0x2e909b=_0x79884c;_0x543728[_0x37b7('0x35')]=_[_0x37b7('0x37')](db[_0x37b7('0x64')]['rawAttributes']);_0x543728[_0x37b7('0x36')]=_['keys'](_0x7f97ee[_0x37b7('0x36')]);_0x543728[_0x37b7('0x38')]=_[_0x37b7('0x3a')](_0x543728[_0x37b7('0x35')],_0x543728[_0x37b7('0x36')]);_0x1f6bca[_0x37b7('0x39')]=_[_0x37b7('0x3a')](_0x543728[_0x37b7('0x35')],qs[_0x37b7('0x3b')](_0x7f97ee[_0x37b7('0x36')][_0x37b7('0x3b')]));_0x1f6bca[_0x37b7('0x39')]=_0x1f6bca[_0x37b7('0x39')][_0x37b7('0x3c')]?_0x1f6bca[_0x37b7('0x39')]:_0x543728[_0x37b7('0x35')];_0x1f6bca['order']=qs[_0x37b7('0x40')](_0x7f97ee['query'][_0x37b7('0x40')]);_0x1f6bca[_0x37b7('0x42')]=qs[_0x37b7('0x38')](_[_0x37b7('0x41')](_0x7f97ee[_0x37b7('0x36')],_0x543728['filters']));if(_0x7f97ee[_0x37b7('0x36')][_0x37b7('0x44')]){_0x1f6bca['where']=_['merge'](_0x1f6bca[_0x37b7('0x42')],{'$or':_['map'](_0x1f6bca[_0x37b7('0x39')],function(_0x1dd929){var _0xab8fc={};_0xab8fc[_0x1dd929]={'$like':'%'+_0x7f97ee[_0x37b7('0x36')][_0x37b7('0x44')]+'%'};return _0xab8fc;})});}_0x1f6bca=_[_0x37b7('0x43')]({},_0x1f6bca,_0x7f97ee[_0x37b7('0x4b')]);return _0x2e909b[_0x37b7('0x63')](_0x1f6bca);}})[_0x37b7('0x25')](function(_0x763ae9){if(_0x763ae9){_0x45bbb6=_0x763ae9[_0x37b7('0x3c')];if(!_0x7f97ee['query'][_0x37b7('0x5a')]('nolimit')){_0x1f6bca[_0x37b7('0x3e')]=qs[_0x37b7('0x3e')](_0x7f97ee['query'][_0x37b7('0x3e')]);_0x1f6bca[_0x37b7('0x1d')]=qs[_0x37b7('0x1d')](_0x7f97ee['query'][_0x37b7('0x1d')]);}return _0x2e909b[_0x37b7('0x63')](_0x1f6bca);}})[_0x37b7('0x25')](function(_0x34e271){if(_0x34e271){return _0x34e271?{'count':_0x45bbb6,'rows':_0x34e271}:null;}})[_0x37b7('0x25')](respondWithResult(_0x87378c,null))['catch'](handleError(_0x87378c,null));};exports['addTeams']=function(_0x515c15,_0x392f91,_0x149283){var _0x42fd2d=_0x515c15[_0x37b7('0x55')][_0x37b7('0x65')];return db['Team']['findAll']({'where':{'id':_0x42fd2d},'attributes':['id'],'include':[{'model':db[_0x37b7('0x66')],'as':_0x37b7('0x67'),'attributes':['id',_0x37b7('0x2d'),_0x37b7('0x68'),_0x37b7('0x69'),_0x37b7('0x6a')],'raw':!![]}]})[_0x37b7('0x25')](function(_0x2591c3){if(_0x2591c3){var _0x3ac456=_[_0x37b7('0x6b')](_0x2591c3,function(_0x282637){var _0x5c4caf=_0x282637[_0x37b7('0x27')]({'plain':!![]});return _0x5c4caf['Agents'];});return db[_0x37b7('0x30')]['find']({'where':{'id':_0x515c15[_0x37b7('0x4a')]['id']}})['then'](function(_0x126f45){return db[_0x37b7('0x6c')][_0x37b7('0x6d')](function(_0x1056cc){return _0x126f45['addTeams'](_0x42fd2d,{'transaction':_0x1056cc})['then'](function(){return BPromise['each'](_0x3ac456,function(_0xd2a721){return db['UserFaxQueue'][_0x37b7('0x6e')]({'where':{'UserId':_0xd2a721['id'],'FaxQueueId':_0x515c15[_0x37b7('0x4a')]['id']},'transaction':_0x1056cc});});})[_0x37b7('0x25')](function(){_0x3ac456[_0x37b7('0x6f')](function(_0x2fcb3d){socket[_0x37b7('0x70')]('userFaxQueue:save',{'UserId':_0x2fcb3d['id'],'FaxQueueId':_0x126f45['id']});});});});});}})[_0x37b7('0x25')](respondWithStatusCode(_0x392f91,null))[_0x37b7('0x48')](handleError(_0x392f91,null));};exports[_0x37b7('0x71')]=function(_0x57c002,_0x3fd19f,_0xfbec8){return db[_0x37b7('0x64')][_0x37b7('0x46')]({'where':{'id':_0x57c002['query'][_0x37b7('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x37b7('0x25')](handleEntityNotFound(_0x3fd19f,null))[_0x37b7('0x25')](function(_0x1d3591){var _0x208e7b=_[_0x37b7('0x2f')](_0x1d3591,'id');var _0x35ff4b=[];var _0x5251f3=[];var _0x1a572f=squel[_0x37b7('0x72')]();_0x1a572f[_0x37b7('0x73')](_0x37b7('0x74'))[_0x37b7('0x75')](_0x37b7('0x76'),'tq')[_0x37b7('0x77')](_0x37b7('0x78'),'ut',_0x37b7('0x79'))[_0x37b7('0x42')](_0x37b7('0x7a'),_0x57c002[_0x37b7('0x4a')]['id']);for(var _0x3eaef5=0x0;_0x3eaef5<_0x1d3591[_0x37b7('0x3c')];_0x3eaef5+=0x1){let _0x480dd6=_0x1d3591[_0x3eaef5];for(var _0x5c8542=0x0;_0x5c8542<_0x480dd6[_0x37b7('0x67')]['length'];_0x5c8542+=0x1){let _0x1fc6b1=_0x480dd6[_0x37b7('0x67')][_0x5c8542];var _0x234a76=_0x1a572f[_0x37b7('0x7b')]();_0x234a76['where'](_0x37b7('0x7c'),_0x1fc6b1['id']);_0x5251f3[_0x37b7('0x7d')](db[_0x37b7('0x6c')][_0x37b7('0x36')](_0x234a76[_0x37b7('0x7e')](),{'type':db['sequelize']['QueryTypes'][_0x37b7('0x7f')]})[_0x37b7('0x25')](function(_0x147163){if(_0x147163[_0x37b7('0x3c')]===0x1){return _0x1fc6b1['id'];}else{var _0x40e8b5=_[_0x37b7('0x80')](_[_0x37b7('0x2f')](_0x147163,_0x37b7('0x81')),function(_0xc80df){return _['includes'](_0x208e7b,_0xc80df);});if(_0x40e8b5){return _0x1fc6b1['id'];}}}));}}return BPromise[_0x37b7('0x82')](_0x5251f3)[_0x37b7('0x25')](function(_0x3282cf){_0x35ff4b=_(_0x35ff4b)[_0x37b7('0x83')](_0x3282cf)['compact']()[_0x37b7('0x84')]();return db[_0x37b7('0x30')][_0x37b7('0x51')]({'where':{'id':_0x57c002[_0x37b7('0x4a')]['id']}})[_0x37b7('0x25')](function(_0x36c7cd){return db[_0x37b7('0x6c')][_0x37b7('0x6d')](function(_0x2e1351){return _0x36c7cd[_0x37b7('0x71')](_0x57c002['query']['ids'],{'transaction':_0x2e1351})[_0x37b7('0x25')](function(){if(!_[_0x37b7('0x85')](_0x35ff4b)){return _0x36c7cd['removeAgents'](_0x35ff4b,{'transaction':_0x2e1351});}})['then'](function(){_0x35ff4b['forEach'](function(_0x59b7ff){socket[_0x37b7('0x70')]('userFaxQueue:remove',{'UserId':_0x59b7ff,'FaxQueueId':_0x36c7cd['id']});});});});});});})[_0x37b7('0x25')](respondWithStatusCode(_0x3fd19f,null))['catch'](handleError(_0x3fd19f,null));};exports[_0x37b7('0x86')]=function(_0x2ebe2b,_0x2d4e96,_0x32aa03){return db['FaxQueue'][_0x37b7('0x51')]({'where':{'id':_0x2ebe2b[_0x37b7('0x4a')]['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x2d4e96,null))[_0x37b7('0x25')](function(_0x132c21){if(_0x132c21){return _0x132c21[_0x37b7('0x86')](_0x2ebe2b[_0x37b7('0x55')][_0x37b7('0x65')],_[_0x37b7('0x87')](_0x2ebe2b[_0x37b7('0x55')],[_0x37b7('0x65'),'id'])||{})[_0x37b7('0x88')](function(_0x16de2c){for(var _0x37e275=0x0;_0x37e275<_0x2ebe2b[_0x37b7('0x55')][_0x37b7('0x65')][_0x37b7('0x3c')];_0x37e275+=0x1){socket[_0x37b7('0x70')](_0x37b7('0x89'),{'UserId':Number(_0x2ebe2b[_0x37b7('0x55')][_0x37b7('0x65')][_0x37e275]),'FaxQueueId':Number(_0x2ebe2b[_0x37b7('0x4a')]['id'])});}return _0x16de2c;});}})[_0x37b7('0x25')](respondWithResult(_0x2d4e96,null))['catch'](handleError(_0x2d4e96,null));};exports['removeAgents']=function(_0x250e61,_0x553f46,_0x478ca1){return db['FaxQueue'][_0x37b7('0x51')]({'where':{'id':_0x250e61[_0x37b7('0x4a')]['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x553f46,null))[_0x37b7('0x25')](function(_0x398d7f){if(_0x398d7f){return _0x398d7f['removeAgents'](_0x250e61['query'][_0x37b7('0x65')])[_0x37b7('0x25')](function(){if(_[_0x37b7('0x8a')](_0x250e61[_0x37b7('0x36')][_0x37b7('0x65')])){for(var _0x3f77e2=0x0;_0x3f77e2<_0x250e61[_0x37b7('0x36')][_0x37b7('0x65')][_0x37b7('0x3c')];_0x3f77e2+=0x1){socket[_0x37b7('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x250e61['query']['ids'][_0x3f77e2]),'FaxQueueId':Number(_0x250e61[_0x37b7('0x4a')]['id'])});}}else{socket[_0x37b7('0x70')](_0x37b7('0x8b'),{'UserId':Number(_0x250e61[_0x37b7('0x36')]['ids']),'FaxQueueId':Number(_0x250e61[_0x37b7('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x553f46,null))[_0x37b7('0x48')](handleError(_0x553f46,null));};exports['getAgents']=function(_0x57fc57,_0x1af27c,_0x45d982){var _0x41d46f={};var _0x1f152e={};var _0x7164ef;var _0x3b3a86;return db[_0x37b7('0x30')][_0x37b7('0x58')]({'where':{'id':_0x57fc57['params']['id']}})[_0x37b7('0x25')](handleEntityNotFound(_0x1af27c,null))['then'](function(_0x4c502f){if(_0x4c502f){_0x7164ef=_0x4c502f;_0x1f152e[_0x37b7('0x35')]=_['keys'](db[_0x37b7('0x66')][_0x37b7('0x31')]);_0x1f152e[_0x37b7('0x36')]=_['keys'](_0x57fc57[_0x37b7('0x36')]);_0x1f152e['filters']=_[_0x37b7('0x3a')](_0x1f152e[_0x37b7('0x35')],_0x1f152e[_0x37b7('0x36')]);_0x41d46f[_0x37b7('0x39')]=_['intersection'](_0x1f152e['model'],qs[_0x37b7('0x3b')](_0x57fc57[_0x37b7('0x36')][_0x37b7('0x3b')]));_0x41d46f[_0x37b7('0x39')]=_0x41d46f[_0x37b7('0x39')][_0x37b7('0x3c')]?_0x41d46f['attributes']:_0x1f152e[_0x37b7('0x35')];_0x41d46f[_0x37b7('0x3f')]=qs[_0x37b7('0x40')](_0x57fc57[_0x37b7('0x36')][_0x37b7('0x40')]);_0x41d46f['where']=qs[_0x37b7('0x38')](_[_0x37b7('0x41')](_0x57fc57[_0x37b7('0x36')],_0x1f152e['filters']));if(_0x57fc57['query']['filter']){_0x41d46f['where']=_[_0x37b7('0x43')](_0x41d46f['where'],{'$or':_[_0x37b7('0x2f')](_0x41d46f[_0x37b7('0x39')],function(_0x1d74d4){var _0x10b4e0={};_0x10b4e0[_0x1d74d4]={'$like':'%'+_0x57fc57[_0x37b7('0x36')][_0x37b7('0x44')]+'%'};return _0x10b4e0;})});}_0x41d46f=_['merge']({},_0x41d46f,_0x57fc57[_0x37b7('0x4b')]);return _0x7164ef[_0x37b7('0x8c')](_0x41d46f);}})[_0x37b7('0x25')](function(_0x18489e){if(_0x18489e){_0x3b3a86=_0x18489e['length'];if(!_0x57fc57[_0x37b7('0x36')][_0x37b7('0x5a')](_0x37b7('0x3d'))){_0x41d46f[_0x37b7('0x3e')]=qs[_0x37b7('0x3e')](_0x57fc57[_0x37b7('0x36')][_0x37b7('0x3e')]);_0x41d46f[_0x37b7('0x1d')]=qs[_0x37b7('0x1d')](_0x57fc57['query'][_0x37b7('0x1d')]);}return _0x7164ef[_0x37b7('0x8c')](_0x41d46f);}})[_0x37b7('0x25')](function(_0x14fd87){if(_0x14fd87){return _0x14fd87?{'count':_0x3b3a86,'rows':_0x14fd87}:null;}})[_0x37b7('0x25')](respondWithResult(_0x1af27c,null))[_0x37b7('0x48')](handleError(_0x1af27c,null));};
\ No newline at end of file
index de7974f..558d493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43e=['remove','emit','exports','events','save','update'];(function(_0x42808e,_0x3efea1){var _0x1b75d5=function(_0x2c9770){while(--_0x2c9770){_0x42808e['push'](_0x42808e['shift']());}};_0x1b75d5(++_0x3efea1);}(_0xb43e,0x141));var _0xeb43=function(_0x1a4724,_0xc07835){_0x1a4724=_0x1a4724-0x0;var _0x3b7d88=_0xb43e[_0x1a4724];return _0x3b7d88;};'use strict';var EventEmitter=require(_0xeb43('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb43('0x1'),'afterUpdate':_0xeb43('0x2'),'afterDestroy':_0xeb43('0x3')};function emitEvent(_0x3fa3b3){return function(_0x50bca8,_0x54d294,_0x56f781){FaxQueueEvents['emit'](_0x3fa3b3+':'+_0x50bca8['id'],_0x50bca8);FaxQueueEvents[_0xeb43('0x4')](_0x3fa3b3,_0x50bca8);_0x56f781(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xeb43('0x5')]=FaxQueueEvents;
\ No newline at end of file
+var _0xaaff=['save','update','remove','emit','hook','exports','events','FaxQueue'];(function(_0x11002f,_0x581ba1){var _0x5223d0=function(_0x116965){while(--_0x116965){_0x11002f['push'](_0x11002f['shift']());}};_0x5223d0(++_0x581ba1);}(_0xaaff,0x15e));var _0xfaaf=function(_0x5d5ab2,_0x1d3681){_0x5d5ab2=_0x5d5ab2-0x0;var _0xb8fe37=_0xaaff[_0x5d5ab2];return _0xb8fe37;};'use strict';var EventEmitter=require(_0xfaaf('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xfaaf('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfaaf('0x2'),'afterUpdate':_0xfaaf('0x3'),'afterDestroy':_0xfaaf('0x4')};function emitEvent(_0x1e90d8){return function(_0x80fc72,_0x5f5a91,_0x42914e){FaxQueueEvents[_0xfaaf('0x5')](_0x1e90d8+':'+_0x80fc72['id'],_0x80fc72);FaxQueueEvents[_0xfaaf('0x5')](_0x1e90d8,_0x80fc72);_0x42914e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xfaaf('0x6')](e,emitEvent(event));}}module[_0xfaaf('0x7')]=FaxQueueEvents;
\ No newline at end of file
index ada4709..387dd0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25d8=['FaxQueue','fax_queues','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define'];(function(_0x1d028e,_0x4c8786){var _0x534c96=function(_0x1b630a){while(--_0x1b630a){_0x1d028e['push'](_0x1d028e['shift']());}};_0x534c96(++_0x4c8786);}(_0x25d8,0xe6));var _0x825d=function(_0x4c17f6,_0x263025){_0x4c17f6=_0x4c17f6-0x0;var _0x2d016d=_0x25d8[_0x4c17f6];return _0x2d016d;};'use strict';var _=require(_0x825d('0x0'));var util=require(_0x825d('0x1'));var logger=require('../../config/logger')(_0x825d('0x2'));var moment=require(_0x825d('0x3'));var BPromise=require('bluebird');var rp=require(_0x825d('0x4'));var fs=require('fs');var path=require(_0x825d('0x5'));var rimraf=require(_0x825d('0x6'));var config=require(_0x825d('0x7'));var attributes=require(_0x825d('0x8'));module['exports']=function(_0x48381d,_0x4dea2d){return _0x48381d[_0x825d('0x9')](_0x825d('0xa'),attributes,{'tableName':_0x825d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b9f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x43a799,_0x1cf743){var _0x219ffe=function(_0x4a67c5){while(--_0x4a67c5){_0x43a799['push'](_0x43a799['shift']());}};_0x219ffe(++_0x1cf743);}(_0x0b9f,0x145));var _0xf0b9=function(_0x1bb558,_0x43d6e2){_0x1bb558=_0x1bb558-0x0;var _0x35ceac=_0x0b9f[_0x1bb558];return _0x35ceac;};'use strict';var _=require(_0xf0b9('0x0'));var util=require(_0xf0b9('0x1'));var logger=require(_0xf0b9('0x2'))(_0xf0b9('0x3'));var moment=require(_0xf0b9('0x4'));var BPromise=require(_0xf0b9('0x5'));var rp=require(_0xf0b9('0x6'));var fs=require('fs');var path=require(_0xf0b9('0x7'));var rimraf=require(_0xf0b9('0x8'));var config=require(_0xf0b9('0x9'));var attributes=require(_0xf0b9('0xa'));module[_0xf0b9('0xb')]=function(_0x152c8f,_0x3082df){return _0x152c8f[_0xf0b9('0xc')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fd9e3b1..255af77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec7=['request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','include','map','model','attributes','find','ShowFaxQueue','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register'];(function(_0xbfa006,_0x1118d1){var _0x396001=function(_0x5173ff){while(--_0x5173ff){_0xbfa006['push'](_0xbfa006['shift']());}};_0x396001(++_0x1118d1);}(_0x0ec7,0x1e0));var _0x70ec=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x0ec7[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require(_0x70ec('0x0'));var moment=require('moment');var BPromise=require(_0x70ec('0x1'));var rs=require(_0x70ec('0x2'));var fs=require('fs');var Redis=require(_0x70ec('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x70ec('0x4'))(_0x70ec('0x5'));var config=require('../../config/environment');var jayson=require(_0x70ec('0x6'));var client=jayson[_0x70ec('0x7')][_0x70ec('0x8')]({'port':0x232a});config[_0x70ec('0x9')]=_[_0x70ec('0xa')](config['redis'],{'host':_0x70ec('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x70ec('0xc'))[_0x70ec('0xd')](socket);function respondWithRpcPromise(_0x4dd14e,_0x174914,_0x37a1d5){return new BPromise(function(_0x220d8a,_0x351ccf){return client[_0x70ec('0xe')](_0x4dd14e,_0x37a1d5)[_0x70ec('0xf')](function(_0x131d21){logger[_0x70ec('0x10')](_0x70ec('0x11'),_0x174914,_0x70ec('0x12'));logger[_0x70ec('0x13')](_0x70ec('0x14'),_0x174914,'request\x20sent',JSON[_0x70ec('0x15')](_0x131d21));if(_0x131d21[_0x70ec('0x16')]){if(_0x131d21[_0x70ec('0x16')][_0x70ec('0x17')]===0x1f4){logger[_0x70ec('0x16')](_0x70ec('0x11'),_0x174914,_0x131d21[_0x70ec('0x16')][_0x70ec('0x18')]);return _0x351ccf(_0x131d21[_0x70ec('0x16')][_0x70ec('0x18')]);}logger[_0x70ec('0x16')](_0x70ec('0x11'),_0x174914,_0x131d21[_0x70ec('0x16')]['message']);return _0x220d8a(_0x131d21[_0x70ec('0x16')]['message']);}else{logger[_0x70ec('0x10')](_0x70ec('0x11'),_0x174914,'request\x20sent');_0x220d8a(_0x131d21[_0x70ec('0x19')]['message']);}})[_0x70ec('0x1a')](function(_0x150b3e){logger[_0x70ec('0x16')](_0x70ec('0x11'),_0x174914,_0x150b3e);_0x351ccf(_0x150b3e);});});}exports[_0x70ec('0x1b')]=function(_0xea5c2e){var _0x372eb5=this;return new Promise(function(_0x3349f7,_0x2d299a){return db[_0x70ec('0x1c')]['findAll']({'raw':_0xea5c2e[_0x70ec('0x1d')]?_0xea5c2e[_0x70ec('0x1d')][_0x70ec('0x1e')]===undefined?!![]:![]:!![],'where':_0xea5c2e[_0x70ec('0x1d')]?_0xea5c2e['options'][_0x70ec('0x1f')]||null:null,'attributes':_0xea5c2e[_0x70ec('0x1d')]?_0xea5c2e['options']['attributes']||null:null,'limit':_0xea5c2e[_0x70ec('0x1d')]?_0xea5c2e[_0x70ec('0x1d')]['limit']||null:null,'include':_0xea5c2e['options']?_0xea5c2e[_0x70ec('0x1d')][_0x70ec('0x20')]?_['map'](_0xea5c2e[_0x70ec('0x1d')]['include'],function(_0x28c8bb){return{'model':db[_0x28c8bb['model']],'as':_0x28c8bb['as'],'attributes':_0x28c8bb['attributes'],'include':_0x28c8bb[_0x70ec('0x20')]?_[_0x70ec('0x21')](_0x28c8bb[_0x70ec('0x20')],function(_0x3321ed){return{'model':db[_0x3321ed[_0x70ec('0x22')]],'as':_0x3321ed['as'],'attributes':_0x3321ed['attributes'],'include':_0x3321ed['include']?_[_0x70ec('0x21')](_0x3321ed[_0x70ec('0x20')],function(_0x159b60){return{'model':db[_0x159b60['model']],'as':_0x159b60['as'],'attributes':_0x159b60[_0x70ec('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70ec('0xf')](function(_0x765c77){logger['info'](_0x70ec('0x1b'),_0xea5c2e);logger[_0x70ec('0x13')](_0x70ec('0x1b'),_0xea5c2e,JSON[_0x70ec('0x15')](_0x765c77));_0x3349f7(_0x765c77);})[_0x70ec('0x1a')](function(_0x45cbb6){logger[_0x70ec('0x16')]('GetFaxQueue',_0x45cbb6[_0x70ec('0x18')],_0xea5c2e);_0x2d299a(_0x372eb5[_0x70ec('0x16')](0x1f4,_0x45cbb6[_0x70ec('0x18')]));});});};exports['ShowFaxQueue']=function(_0x30be88){var _0x68d1e2=this;return new Promise(function(_0x307081,_0x225829){return db[_0x70ec('0x1c')][_0x70ec('0x24')]({'raw':_0x30be88[_0x70ec('0x1d')]?_0x30be88[_0x70ec('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x30be88[_0x70ec('0x1d')]?_0x30be88[_0x70ec('0x1d')]['where']||null:null,'attributes':_0x30be88[_0x70ec('0x1d')]?_0x30be88[_0x70ec('0x1d')][_0x70ec('0x23')]||null:null,'include':_0x30be88[_0x70ec('0x1d')]?_0x30be88[_0x70ec('0x1d')]['include']?_[_0x70ec('0x21')](_0x30be88[_0x70ec('0x1d')][_0x70ec('0x20')],function(_0x33da6c){return{'model':db[_0x33da6c[_0x70ec('0x22')]],'as':_0x33da6c['as'],'attributes':_0x33da6c[_0x70ec('0x23')],'include':_0x33da6c[_0x70ec('0x20')]?_['map'](_0x33da6c[_0x70ec('0x20')],function(_0x438855){return{'model':db[_0x438855[_0x70ec('0x22')]],'as':_0x438855['as'],'attributes':_0x438855['attributes'],'include':_0x438855[_0x70ec('0x20')]?_['map'](_0x438855['include'],function(_0x2b897e){return{'model':db[_0x2b897e[_0x70ec('0x22')]],'as':_0x2b897e['as'],'attributes':_0x2b897e[_0x70ec('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70ec('0xf')](function(_0x4e6955){logger[_0x70ec('0x10')]('ShowFaxQueue',_0x30be88);logger[_0x70ec('0x13')](_0x70ec('0x25'),_0x30be88,JSON[_0x70ec('0x15')](_0x4e6955));_0x307081(_0x4e6955);})[_0x70ec('0x1a')](function(_0x319cb2){logger[_0x70ec('0x16')](_0x70ec('0x25'),_0x319cb2[_0x70ec('0x18')],_0x30be88);_0x225829(_0x68d1e2[_0x70ec('0x16')](0x1f4,_0x319cb2['message']));});});};
\ No newline at end of file
+var _0x0ed1=['localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','map','include','model','where','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults'];(function(_0x4383fc,_0x33472b){var _0x3d620f=function(_0x57099a){while(--_0x57099a){_0x4383fc['push'](_0x4383fc['shift']());}};_0x3d620f(++_0x33472b);}(_0x0ed1,0xbb));var _0x10ed=function(_0x5521a3,_0x4d02d5){_0x5521a3=_0x5521a3-0x0;var _0x491a66=_0x0ed1[_0x5521a3];return _0x491a66;};'use strict';var _=require(_0x10ed('0x0'));var util=require('util');var moment=require(_0x10ed('0x1'));var BPromise=require(_0x10ed('0x2'));var rs=require(_0x10ed('0x3'));var fs=require('fs');var Redis=require(_0x10ed('0x4'));var db=require(_0x10ed('0x5'))['db'];var utils=require(_0x10ed('0x6'));var logger=require(_0x10ed('0x7'))(_0x10ed('0x8'));var config=require('../../config/environment');var jayson=require(_0x10ed('0x9'));var client=jayson['client'][_0x10ed('0xa')]({'port':0x232a});config[_0x10ed('0xb')]=_[_0x10ed('0xc')](config[_0x10ed('0xb')],{'host':_0x10ed('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10ed('0xb')]));require(_0x10ed('0xe'))[_0x10ed('0xf')](socket);function respondWithRpcPromise(_0x5c8b82,_0x15f75e,_0x400807){return new BPromise(function(_0x1b37df,_0x296c7e){return client[_0x10ed('0x10')](_0x5c8b82,_0x400807)[_0x10ed('0x11')](function(_0x3a0dba){logger[_0x10ed('0x12')](_0x10ed('0x13'),_0x15f75e,'request\x20sent');logger[_0x10ed('0x14')](_0x10ed('0x15'),_0x15f75e,'request\x20sent',JSON[_0x10ed('0x16')](_0x3a0dba));if(_0x3a0dba[_0x10ed('0x17')]){if(_0x3a0dba[_0x10ed('0x17')][_0x10ed('0x18')]===0x1f4){logger[_0x10ed('0x17')](_0x10ed('0x13'),_0x15f75e,_0x3a0dba[_0x10ed('0x17')]['message']);return _0x296c7e(_0x3a0dba['error'][_0x10ed('0x19')]);}logger[_0x10ed('0x17')]('FaxQueue,\x20%s,\x20%s',_0x15f75e,_0x3a0dba[_0x10ed('0x17')][_0x10ed('0x19')]);return _0x1b37df(_0x3a0dba[_0x10ed('0x17')][_0x10ed('0x19')]);}else{logger['info'](_0x10ed('0x13'),_0x15f75e,'request\x20sent');_0x1b37df(_0x3a0dba[_0x10ed('0x1a')]['message']);}})[_0x10ed('0x1b')](function(_0x366222){logger[_0x10ed('0x17')](_0x10ed('0x13'),_0x15f75e,_0x366222);_0x296c7e(_0x366222);});});}exports[_0x10ed('0x1c')]=function(_0x516c86){var _0x44b4a0=this;return new Promise(function(_0xf72f7c,_0x21db13){return db[_0x10ed('0x1d')][_0x10ed('0x1e')]({'raw':_0x516c86[_0x10ed('0x1f')]?_0x516c86['options'][_0x10ed('0x20')]===undefined?!![]:![]:!![],'where':_0x516c86[_0x10ed('0x1f')]?_0x516c86[_0x10ed('0x1f')]['where']||null:null,'attributes':_0x516c86[_0x10ed('0x1f')]?_0x516c86[_0x10ed('0x1f')][_0x10ed('0x21')]||null:null,'limit':_0x516c86[_0x10ed('0x1f')]?_0x516c86[_0x10ed('0x1f')][_0x10ed('0x22')]||null:null,'include':_0x516c86[_0x10ed('0x1f')]?_0x516c86[_0x10ed('0x1f')]['include']?_[_0x10ed('0x23')](_0x516c86[_0x10ed('0x1f')][_0x10ed('0x24')],function(_0x1c9e72){return{'model':db[_0x1c9e72[_0x10ed('0x25')]],'as':_0x1c9e72['as'],'attributes':_0x1c9e72[_0x10ed('0x21')],'include':_0x1c9e72[_0x10ed('0x24')]?_[_0x10ed('0x23')](_0x1c9e72[_0x10ed('0x24')],function(_0x5d34f5){return{'model':db[_0x5d34f5[_0x10ed('0x25')]],'as':_0x5d34f5['as'],'attributes':_0x5d34f5[_0x10ed('0x21')],'include':_0x5d34f5[_0x10ed('0x24')]?_[_0x10ed('0x23')](_0x5d34f5[_0x10ed('0x24')],function(_0x28d1e9){return{'model':db[_0x28d1e9['model']],'as':_0x28d1e9['as'],'attributes':_0x28d1e9[_0x10ed('0x21')]};}):[]};}):[]};}):[]:[]})[_0x10ed('0x11')](function(_0xd83862){logger[_0x10ed('0x12')](_0x10ed('0x1c'),_0x516c86);logger[_0x10ed('0x14')](_0x10ed('0x1c'),_0x516c86,JSON['stringify'](_0xd83862));_0xf72f7c(_0xd83862);})['catch'](function(_0x49894a){logger[_0x10ed('0x17')](_0x10ed('0x1c'),_0x49894a[_0x10ed('0x19')],_0x516c86);_0x21db13(_0x44b4a0['error'](0x1f4,_0x49894a[_0x10ed('0x19')]));});});};exports['ShowFaxQueue']=function(_0x1581b7){var _0x5e2f02=this;return new Promise(function(_0x24a185,_0x4e0c63){return db[_0x10ed('0x1d')]['find']({'raw':_0x1581b7[_0x10ed('0x1f')]?_0x1581b7[_0x10ed('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1581b7[_0x10ed('0x1f')]?_0x1581b7[_0x10ed('0x1f')][_0x10ed('0x26')]||null:null,'attributes':_0x1581b7[_0x10ed('0x1f')]?_0x1581b7[_0x10ed('0x1f')]['attributes']||null:null,'include':_0x1581b7[_0x10ed('0x1f')]?_0x1581b7['options']['include']?_[_0x10ed('0x23')](_0x1581b7[_0x10ed('0x1f')][_0x10ed('0x24')],function(_0x53dbb8){return{'model':db[_0x53dbb8[_0x10ed('0x25')]],'as':_0x53dbb8['as'],'attributes':_0x53dbb8[_0x10ed('0x21')],'include':_0x53dbb8[_0x10ed('0x24')]?_['map'](_0x53dbb8['include'],function(_0x3033bf){return{'model':db[_0x3033bf[_0x10ed('0x25')]],'as':_0x3033bf['as'],'attributes':_0x3033bf[_0x10ed('0x21')],'include':_0x3033bf[_0x10ed('0x24')]?_[_0x10ed('0x23')](_0x3033bf[_0x10ed('0x24')],function(_0x2afbff){return{'model':db[_0x2afbff['model']],'as':_0x2afbff['as'],'attributes':_0x2afbff[_0x10ed('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d2932){logger['info'](_0x10ed('0x27'),_0x1581b7);logger[_0x10ed('0x14')](_0x10ed('0x27'),_0x1581b7,JSON[_0x10ed('0x16')](_0x4d2932));_0x24a185(_0x4d2932);})['catch'](function(_0x510567){logger['error'](_0x10ed('0x27'),_0x510567[_0x10ed('0x19')],_0x1581b7);_0x4e0c63(_0x5e2f02['error'](0x1f4,_0x510567['message']));});});};
\ No newline at end of file
index 5b95f31..8fd14e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74c3=['./faxQueue.events','save','update','emit','removeListener','register','faxQueue:'];(function(_0xd81093,_0x216e64){var _0x22f43e=function(_0x124e53){while(--_0x124e53){_0xd81093['push'](_0xd81093['shift']());}};_0x22f43e(++_0x216e64);}(_0x74c3,0x16c));var _0x374c=function(_0x247178,_0x3787e1){_0x247178=_0x247178-0x0;var _0x390615=_0x74c3[_0x247178];return _0x390615;};'use strict';var FaxQueueEvents=require(_0x374c('0x0'));var events=[_0x374c('0x1'),'remove',_0x374c('0x2')];function createListener(_0x4d7e4f,_0x4850ac){return function(_0x4fbfe8){_0x4850ac[_0x374c('0x3')](_0x4d7e4f,_0x4fbfe8);};}function removeListener(_0x441443,_0x17ae05){return function(){FaxQueueEvents[_0x374c('0x4')](_0x441443,_0x17ae05);};}exports[_0x374c('0x5')]=function(_0x421bed){for(var _0x1c3dec=0x0,_0x1e4b35=events['length'];_0x1c3dec<_0x1e4b35;_0x1c3dec++){var _0x2370be=events[_0x1c3dec];var _0xa9bfcf=createListener(_0x374c('0x6')+_0x2370be,_0x421bed);FaxQueueEvents['on'](_0x2370be,_0xa9bfcf);}};
\ No newline at end of file
+var _0xa8db=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x282174,_0x5c07d8){var _0xcc954a=function(_0x1342df){while(--_0x1342df){_0x282174['push'](_0x282174['shift']());}};_0xcc954a(++_0x5c07d8);}(_0xa8db,0x12a));var _0xba8d=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xa8db[_0x1602ef];return _0x5870ee;};'use strict';var FaxQueueEvents=require(_0xba8d('0x0'));var events=[_0xba8d('0x1'),_0xba8d('0x2'),_0xba8d('0x3')];function createListener(_0x1a4f28,_0x53c0d6){return function(_0x8ec78b){_0x53c0d6[_0xba8d('0x4')](_0x1a4f28,_0x8ec78b);};}function removeListener(_0x16a09b,_0x146158){return function(){FaxQueueEvents[_0xba8d('0x5')](_0x16a09b,_0x146158);};}exports['register']=function(_0x5dd30){for(var _0x51f070=0x0,_0x5cb143=events[_0xba8d('0x6')];_0x51f070<_0x5cb143;_0x51f070++){var _0x40a00e=events[_0x51f070];var _0x5cdddd=createListener(_0xba8d('0x7')+_0x40a00e,_0x5dd30);FaxQueueEvents['on'](_0x40a00e,_0x5cdddd);}};
\ No newline at end of file
index 7532a5f..3071490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x5d17,0x114));var _0x75d1=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x5d17[_0x13843f];return _0x1063ae;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x75d1('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x75d1('0xe')]);router[_0x75d1('0x8')]('/:id/teams',auth[_0x75d1('0xb')](),controller[_0x75d1('0xf')]);router[_0x75d1('0x8')](_0x75d1('0x10'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);router['post']('/',auth[_0x75d1('0xb')](),controller[_0x75d1('0x12')]);router[_0x75d1('0x13')](_0x75d1('0x14'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x75d1('0x10'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x15')]);router['put'](_0x75d1('0xd'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x16')]);router[_0x75d1('0x17')](_0x75d1('0xd'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x18')]);router[_0x75d1('0x17')](_0x75d1('0x14'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x19')]);router['delete']('/:id/users',auth[_0x75d1('0xb')](),controller[_0x75d1('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0xcde7=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','path','connect-timeout','express'];(function(_0x38a979,_0x592a49){var _0x184a37=function(_0x7bbcba){while(--_0x7bbcba){_0x38a979['push'](_0x38a979['shift']());}};_0x184a37(++_0x592a49);}(_0xcde7,0x65));var _0x7cde=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcde7[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cde('0x0'));var timeout=require(_0x7cde('0x1'));var express=require(_0x7cde('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7cde('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7cde('0x4'));var controller=require(_0x7cde('0x5'));router[_0x7cde('0x6')]('/',auth[_0x7cde('0x7')](),controller[_0x7cde('0x8')]);router[_0x7cde('0x6')]('/describe',auth[_0x7cde('0x7')](),controller['describe']);router[_0x7cde('0x6')](_0x7cde('0x9'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xa')]);router['get'](_0x7cde('0xb'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xc')]);router[_0x7cde('0x6')](_0x7cde('0xd'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xe')]);router[_0x7cde('0x6')](_0x7cde('0xf'),auth[_0x7cde('0x7')](),controller['getAgents']);router[_0x7cde('0x10')]('/',auth[_0x7cde('0x7')](),controller[_0x7cde('0x11')]);router[_0x7cde('0x10')](_0x7cde('0xd'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x12')]);router[_0x7cde('0x10')](_0x7cde('0xf'),auth['isAuthenticated'](),controller[_0x7cde('0x13')]);router[_0x7cde('0x14')](_0x7cde('0x9'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x15')]);router[_0x7cde('0x16')](_0x7cde('0x9'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x17')]);router[_0x7cde('0x16')](_0x7cde('0xd'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x18')]);router['delete'](_0x7cde('0xf'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x19')]);module['exports']=router;
\ No newline at end of file
index c8aef24..296fe7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa86f=['exports','STRING','DATE','moment'];(function(_0xd035f4,_0x209574){var _0x3d2317=function(_0x3ad930){while(--_0x3ad930){_0xd035f4['push'](_0xd035f4['shift']());}};_0x3d2317(++_0x209574);}(_0xa86f,0x1b7));var _0xfa86=function(_0x40c6c9,_0x2977e9){_0x40c6c9=_0x40c6c9-0x0;var _0x12a577=_0xa86f[_0x40c6c9];return _0x12a577;};'use strict';var moment=require(_0xfa86('0x0'));var Sequelize=require('sequelize');module[_0xfa86('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfa86('0x2')]},'joinAt':{'type':Sequelize[_0xfa86('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfa86('0x3')]},'exitAt':{'type':Sequelize[_0xfa86('0x3')]},'reason':{'type':Sequelize[_0xfa86('0x2')]}};
\ No newline at end of file
+var _0xaef2=['sequelize','STRING','DATE','moment'];(function(_0x233a6f,_0x4d8ca8){var _0x579588=function(_0x4855dd){while(--_0x4855dd){_0x233a6f['push'](_0x233a6f['shift']());}};_0x579588(++_0x4d8ca8);}(_0xaef2,0x1af));var _0x2aef=function(_0x2a32e3,_0x2610a1){_0x2a32e3=_0x2a32e3-0x0;var _0x22f01b=_0xaef2[_0x2a32e3];return _0x22f01b;};'use strict';var moment=require(_0x2aef('0x0'));var Sequelize=require(_0x2aef('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2aef('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2aef('0x2')]},'joinAt':{'type':Sequelize[_0x2aef('0x3')]},'leaveAt':{'type':Sequelize[_0x2aef('0x3')]},'acceptAt':{'type':Sequelize[_0x2aef('0x3')]},'exitAt':{'type':Sequelize[_0x2aef('0x3')]},'reason':{'type':Sequelize[_0x2aef('0x2')]}};
\ No newline at end of file
index 0dfad53..808cb04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9a=['length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields'];(function(_0x28aeb2,_0x319b38){var _0x1d33e1=function(_0x651b59){while(--_0x651b59){_0x28aeb2['push'](_0x28aeb2['shift']());}};_0x1d33e1(++_0x319b38);}(_0x0a9a,0x183));var _0xa0a9=function(_0x421d30,_0x53e75c){_0x421d30=_0x421d30-0x0;var _0x5f1b03=_0x0a9a[_0x421d30];return _0x5f1b03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0a9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0a9('0x1'));var rp=require(_0xa0a9('0x2'));var moment=require(_0xa0a9('0x3'));var BPromise=require(_0xa0a9('0x4'));var Mustache=require('mustache');var util=require(_0xa0a9('0x5'));var path=require(_0xa0a9('0x6'));var sox=require('sox');var csv=require(_0xa0a9('0x7'));var ejs=require(_0xa0a9('0x8'));var fs=require('fs');var fs_extra=require(_0xa0a9('0x9'));var _=require(_0xa0a9('0xa'));var squel=require('squel');var crypto=require(_0xa0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa0a9('0xc'));var toCsv=require(_0xa0a9('0x7'));var querystring=require(_0xa0a9('0xd'));var Papa=require(_0xa0a9('0xe'));var Redis=require('ioredis');var authService=require(_0xa0a9('0xf'));var qs=require(_0xa0a9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0a9('0x11'))(_0xa0a9('0x12'));var utils=require('../../config/utils');var config=require(_0xa0a9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0a9('0x14'))['db'];function respondWithStatusCode(_0x4b7913,_0xb87a94){_0xb87a94=_0xb87a94||0xcc;return function(_0x1ae2a7){if(_0x1ae2a7){return _0x4b7913[_0xa0a9('0x15')](_0xb87a94);}return _0x4b7913[_0xa0a9('0x16')](_0xb87a94)[_0xa0a9('0x17')]();};}function respondWithResult(_0x4fac40,_0x1f3f23){_0x1f3f23=_0x1f3f23||0xc8;return function(_0x9ef979){if(_0x9ef979){return _0x4fac40[_0xa0a9('0x16')](_0x1f3f23)[_0xa0a9('0x18')](_0x9ef979);}};}function respondWithFilteredResult(_0x2f8b3c,_0x1a7b8a){return function(_0x5a6693){if(_0x5a6693){var _0x176faa=typeof _0x1a7b8a['offset']==='undefined'&&typeof _0x1a7b8a[_0xa0a9('0x19')]===_0xa0a9('0x1a');var _0x476762=_0x5a6693[_0xa0a9('0x1b')];var _0x568409=_0x176faa?0x0:_0x1a7b8a[_0xa0a9('0x1c')];var _0x126401=_0x176faa?_0x5a6693[_0xa0a9('0x1b')]:_0x1a7b8a[_0xa0a9('0x1c')]+_0x1a7b8a[_0xa0a9('0x19')];var _0x3c1b3a;if(_0x126401>=_0x476762){_0x126401=_0x476762;_0x3c1b3a=0xc8;}else{_0x3c1b3a=0xce;}_0x2f8b3c['status'](_0x3c1b3a);return _0x2f8b3c[_0xa0a9('0x1d')](_0xa0a9('0x1e'),_0x568409+'-'+_0x126401+'/'+_0x476762)['json'](_0x5a6693);}return null;};}function patchUpdates(_0x53b99d){return function(_0x465d60){try{jsonpatch[_0xa0a9('0x1f')](_0x465d60,_0x53b99d,!![]);}catch(_0x3d9905){return BPromise['reject'](_0x3d9905);}return _0x465d60[_0xa0a9('0x20')]();};}function saveUpdates(_0x4e6f4c,_0x1fb36b){return function(_0x5e6148){if(_0x5e6148){return _0x5e6148[_0xa0a9('0x21')](_0x4e6f4c)[_0xa0a9('0x22')](function(_0x2f0b14){return _0x2f0b14;});}return null;};}function removeEntity(_0x305747,_0x4938da){return function(_0x423d3a){if(_0x423d3a){return _0x423d3a['destroy']()[_0xa0a9('0x22')](function(){_0x305747[_0xa0a9('0x16')](0xcc)[_0xa0a9('0x17')]();});}};}function handleEntityNotFound(_0x252a14,_0x503ef2){return function(_0x7c1502){if(!_0x7c1502){_0x252a14[_0xa0a9('0x15')](0x194);}return _0x7c1502;};}function handleError(_0x384cd5,_0x3f4bea){_0x3f4bea=_0x3f4bea||0x1f4;return function(_0x526dd1){logger[_0xa0a9('0x23')](_0x526dd1[_0xa0a9('0x24')]);if(_0x526dd1[_0xa0a9('0x25')]){delete _0x526dd1['name'];}_0x384cd5['status'](_0x3f4bea)[_0xa0a9('0x26')](_0x526dd1);};}exports[_0xa0a9('0x27')]=function(_0x10bbfd,_0x38e342){var _0x4685c5={},_0xe218ff={},_0x2386c9={'count':0x0,'rows':[]};var _0x24e744=_[_0xa0a9('0x28')](db[_0xa0a9('0x29')][_0xa0a9('0x2a')],function(_0x554191){return{'name':_0x554191[_0xa0a9('0x2b')],'type':_0x554191[_0xa0a9('0x2c')]['key']};});_0xe218ff[_0xa0a9('0x2d')]=_[_0xa0a9('0x28')](_0x24e744,'name');_0xe218ff['query']=_[_0xa0a9('0x2e')](_0x10bbfd['query']);_0xe218ff['filters']=_[_0xa0a9('0x2f')](_0xe218ff[_0xa0a9('0x2d')],_0xe218ff[_0xa0a9('0x30')]);_0x4685c5[_0xa0a9('0x31')]=_[_0xa0a9('0x2f')](_0xe218ff[_0xa0a9('0x2d')],qs[_0xa0a9('0x32')](_0x10bbfd['query'][_0xa0a9('0x32')]));_0x4685c5[_0xa0a9('0x31')]=_0x4685c5['attributes'][_0xa0a9('0x33')]?_0x4685c5[_0xa0a9('0x31')]:_0xe218ff[_0xa0a9('0x2d')];if(!_0x10bbfd['query']['hasOwnProperty'](_0xa0a9('0x34'))){_0x4685c5[_0xa0a9('0x19')]=qs[_0xa0a9('0x19')](_0x10bbfd[_0xa0a9('0x30')]['limit']);_0x4685c5[_0xa0a9('0x1c')]=qs[_0xa0a9('0x1c')](_0x10bbfd[_0xa0a9('0x30')]['offset']);}_0x4685c5[_0xa0a9('0x35')]=qs[_0xa0a9('0x36')](_0x10bbfd[_0xa0a9('0x30')]['sort']);_0x4685c5[_0xa0a9('0x37')]=qs[_0xa0a9('0x38')](_[_0xa0a9('0x39')](_0x10bbfd[_0xa0a9('0x30')],_0xe218ff[_0xa0a9('0x38')]),_0x24e744);if(_0x10bbfd[_0xa0a9('0x30')][_0xa0a9('0x3a')]){_0x4685c5[_0xa0a9('0x37')]=_[_0xa0a9('0x3b')](_0x4685c5[_0xa0a9('0x37')],{'$or':_[_0xa0a9('0x28')](_0x24e744,function(_0x2fdc10){if(_0x2fdc10[_0xa0a9('0x2c')]!==_0xa0a9('0x3c')){var _0xaa6ef9={};_0xaa6ef9[_0x2fdc10[_0xa0a9('0x25')]]={'$like':'%'+_0x10bbfd[_0xa0a9('0x30')]['filter']+'%'};return _0xaa6ef9;}})});}_0x4685c5=_[_0xa0a9('0x3b')]({},_0x4685c5,_0x10bbfd[_0xa0a9('0x3d')]);var _0x3d3769={'where':_0x4685c5['where']};return db[_0xa0a9('0x29')][_0xa0a9('0x1b')](_0x3d3769)[_0xa0a9('0x22')](function(_0xbbd377){_0x2386c9['count']=_0xbbd377;if(_0x10bbfd[_0xa0a9('0x30')][_0xa0a9('0x3e')]){_0x4685c5[_0xa0a9('0x3f')]=[{'all':!![]}];}return db[_0xa0a9('0x29')][_0xa0a9('0x40')](_0x4685c5);})['then'](function(_0x373b95){_0x2386c9[_0xa0a9('0x41')]=_0x373b95;return _0x2386c9;})[_0xa0a9('0x22')](respondWithFilteredResult(_0x38e342,_0x4685c5))[_0xa0a9('0x42')](handleError(_0x38e342,null));};exports[_0xa0a9('0x43')]=function(_0x5d4406,_0x2c2754){var _0x11c130={'raw':!![],'where':{'id':_0x5d4406[_0xa0a9('0x44')]['id']}},_0x27358c={};_0x27358c[_0xa0a9('0x2d')]=_['keys'](db[_0xa0a9('0x29')][_0xa0a9('0x2a')]);_0x27358c['query']=_['keys'](_0x5d4406[_0xa0a9('0x30')]);_0x27358c[_0xa0a9('0x38')]=_[_0xa0a9('0x2f')](_0x27358c[_0xa0a9('0x2d')],_0x27358c['query']);_0x11c130[_0xa0a9('0x31')]=_[_0xa0a9('0x2f')](_0x27358c[_0xa0a9('0x2d')],qs[_0xa0a9('0x32')](_0x5d4406[_0xa0a9('0x30')][_0xa0a9('0x32')]));_0x11c130[_0xa0a9('0x31')]=_0x11c130[_0xa0a9('0x31')][_0xa0a9('0x33')]?_0x11c130[_0xa0a9('0x31')]:_0x27358c[_0xa0a9('0x2d')];if(_0x5d4406[_0xa0a9('0x30')][_0xa0a9('0x3e')]){_0x11c130[_0xa0a9('0x3f')]=[{'all':!![]}];}_0x11c130=_[_0xa0a9('0x3b')]({},_0x11c130,_0x5d4406[_0xa0a9('0x3d')]);return db[_0xa0a9('0x29')]['find'](_0x11c130)[_0xa0a9('0x22')](handleEntityNotFound(_0x2c2754,null))['then'](respondWithResult(_0x2c2754,null))[_0xa0a9('0x42')](handleError(_0x2c2754,null));};exports[_0xa0a9('0x45')]=function(_0x15002c,_0x132eca){return db[_0xa0a9('0x29')][_0xa0a9('0x45')](_0x15002c[_0xa0a9('0x46')],{})[_0xa0a9('0x22')](respondWithResult(_0x132eca,0xc9))[_0xa0a9('0x42')](handleError(_0x132eca,null));};exports['update']=function(_0x5d4162,_0x46a9ca){if(_0x5d4162[_0xa0a9('0x46')]['id']){delete _0x5d4162['body']['id'];}return db[_0xa0a9('0x29')][_0xa0a9('0x47')]({'where':{'id':_0x5d4162[_0xa0a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x46a9ca,null))[_0xa0a9('0x22')](saveUpdates(_0x5d4162[_0xa0a9('0x46')],null))[_0xa0a9('0x22')](respondWithResult(_0x46a9ca,null))[_0xa0a9('0x42')](handleError(_0x46a9ca,null));};exports['destroy']=function(_0x398501,_0x45db88){return db[_0xa0a9('0x29')][_0xa0a9('0x47')]({'where':{'id':_0x398501[_0xa0a9('0x44')]['id']}})[_0xa0a9('0x22')](handleEntityNotFound(_0x45db88,null))[_0xa0a9('0x22')](removeEntity(_0x45db88,null))['catch'](handleError(_0x45db88,null));};exports[_0xa0a9('0x48')]=function(_0x429c65,_0x56a61d){return db[_0xa0a9('0x29')][_0xa0a9('0x48')]()[_0xa0a9('0x22')](respondWithResult(_0x56a61d,null))['catch'](handleError(_0x56a61d,null));};
\ No newline at end of file
+var _0x3cd1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','stack','name','index','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','options','include','findAll','show','params','length','includeAll','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x350539,_0x12db43){var _0xabd4ad=function(_0x33436f){while(--_0x33436f){_0x350539['push'](_0x350539['shift']());}};_0xabd4ad(++_0x12db43);}(_0x3cd1,0x112));var _0x13cd=function(_0x326722,_0x299750){_0x326722=_0x326722-0x0;var _0x3327a9=_0x3cd1[_0x326722];return _0x3327a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13cd('0x0'));var zipdir=require(_0x13cd('0x1'));var jsonpatch=require(_0x13cd('0x2'));var rp=require(_0x13cd('0x3'));var moment=require(_0x13cd('0x4'));var BPromise=require(_0x13cd('0x5'));var Mustache=require(_0x13cd('0x6'));var util=require(_0x13cd('0x7'));var path=require('path');var sox=require(_0x13cd('0x8'));var csv=require(_0x13cd('0x9'));var ejs=require(_0x13cd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x13cd('0xb'));var crypto=require(_0x13cd('0xc'));var jsforce=require(_0x13cd('0xd'));var deskjs=require(_0x13cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x13cd('0xf'));var Papa=require(_0x13cd('0x10'));var Redis=require(_0x13cd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x13cd('0x12'));var hardwareService=require(_0x13cd('0x13'));var logger=require(_0x13cd('0x14'))(_0x13cd('0x15'));var utils=require(_0x13cd('0x16'));var config=require(_0x13cd('0x17'));var licenseUtil=require(_0x13cd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da3a7,_0x2fe1a0){_0x2fe1a0=_0x2fe1a0||0xcc;return function(_0x4bab73){if(_0x4bab73){return _0x1da3a7[_0x13cd('0x19')](_0x2fe1a0);}return _0x1da3a7[_0x13cd('0x1a')](_0x2fe1a0)[_0x13cd('0x1b')]();};}function respondWithResult(_0xfff1f2,_0x29e672){_0x29e672=_0x29e672||0xc8;return function(_0x473e50){if(_0x473e50){return _0xfff1f2[_0x13cd('0x1a')](_0x29e672)[_0x13cd('0x1c')](_0x473e50);}};}function respondWithFilteredResult(_0x5cf7a4,_0x24b647){return function(_0x4afa7a){if(_0x4afa7a){var _0x3d790d=typeof _0x24b647[_0x13cd('0x1d')]==='undefined'&&typeof _0x24b647[_0x13cd('0x1e')]===_0x13cd('0x1f');var _0x1af3e3=_0x4afa7a[_0x13cd('0x20')];var _0x1442eb=_0x3d790d?0x0:_0x24b647[_0x13cd('0x1d')];var _0x45b9de=_0x3d790d?_0x4afa7a[_0x13cd('0x20')]:_0x24b647['offset']+_0x24b647[_0x13cd('0x1e')];var _0x4dc631;if(_0x45b9de>=_0x1af3e3){_0x45b9de=_0x1af3e3;_0x4dc631=0xc8;}else{_0x4dc631=0xce;}_0x5cf7a4[_0x13cd('0x1a')](_0x4dc631);return _0x5cf7a4[_0x13cd('0x21')](_0x13cd('0x22'),_0x1442eb+'-'+_0x45b9de+'/'+_0x1af3e3)[_0x13cd('0x1c')](_0x4afa7a);}return null;};}function patchUpdates(_0x5d12b8){return function(_0x2f4368){try{jsonpatch['apply'](_0x2f4368,_0x5d12b8,!![]);}catch(_0x3d4eca){return BPromise[_0x13cd('0x23')](_0x3d4eca);}return _0x2f4368[_0x13cd('0x24')]();};}function saveUpdates(_0x10f682,_0x439ba1){return function(_0x17cfb3){if(_0x17cfb3){return _0x17cfb3['update'](_0x10f682)['then'](function(_0x2c3925){return _0x2c3925;});}return null;};}function removeEntity(_0x4fc1c2,_0x5144cc){return function(_0xc0503f){if(_0xc0503f){return _0xc0503f[_0x13cd('0x25')]()[_0x13cd('0x26')](function(){_0x4fc1c2['status'](0xcc)[_0x13cd('0x1b')]();});}};}function handleEntityNotFound(_0x11124f,_0x20f110){return function(_0x167fa1){if(!_0x167fa1){_0x11124f[_0x13cd('0x19')](0x194);}return _0x167fa1;};}function handleError(_0x1701a3,_0x190876){_0x190876=_0x190876||0x1f4;return function(_0x23019d){logger['error'](_0x23019d[_0x13cd('0x27')]);if(_0x23019d['name']){delete _0x23019d[_0x13cd('0x28')];}_0x1701a3[_0x13cd('0x1a')](_0x190876)['send'](_0x23019d);};}exports[_0x13cd('0x29')]=function(_0x136825,_0x256628){var _0x1f726b={},_0x3fd1f6={},_0x2079d1={'count':0x0,'rows':[]};var _0x115cfc=_['map'](db[_0x13cd('0x2a')]['rawAttributes'],function(_0x5ace47){return{'name':_0x5ace47[_0x13cd('0x2b')],'type':_0x5ace47['type']['key']};});_0x3fd1f6[_0x13cd('0x2c')]=_['map'](_0x115cfc,_0x13cd('0x28'));_0x3fd1f6[_0x13cd('0x2d')]=_[_0x13cd('0x2e')](_0x136825[_0x13cd('0x2d')]);_0x3fd1f6[_0x13cd('0x2f')]=_[_0x13cd('0x30')](_0x3fd1f6[_0x13cd('0x2c')],_0x3fd1f6[_0x13cd('0x2d')]);_0x1f726b[_0x13cd('0x31')]=_[_0x13cd('0x30')](_0x3fd1f6['model'],qs['fields'](_0x136825['query'][_0x13cd('0x32')]));_0x1f726b[_0x13cd('0x31')]=_0x1f726b[_0x13cd('0x31')]['length']?_0x1f726b[_0x13cd('0x31')]:_0x3fd1f6[_0x13cd('0x2c')];if(!_0x136825[_0x13cd('0x2d')][_0x13cd('0x33')](_0x13cd('0x34'))){_0x1f726b['limit']=qs[_0x13cd('0x1e')](_0x136825[_0x13cd('0x2d')][_0x13cd('0x1e')]);_0x1f726b[_0x13cd('0x1d')]=qs[_0x13cd('0x1d')](_0x136825[_0x13cd('0x2d')][_0x13cd('0x1d')]);}_0x1f726b[_0x13cd('0x35')]=qs[_0x13cd('0x36')](_0x136825['query']['sort']);_0x1f726b['where']=qs[_0x13cd('0x2f')](_['pick'](_0x136825[_0x13cd('0x2d')],_0x3fd1f6[_0x13cd('0x2f')]),_0x115cfc);if(_0x136825[_0x13cd('0x2d')][_0x13cd('0x37')]){_0x1f726b[_0x13cd('0x38')]=_[_0x13cd('0x39')](_0x1f726b[_0x13cd('0x38')],{'$or':_[_0x13cd('0x3a')](_0x115cfc,function(_0x1950a4){if(_0x1950a4[_0x13cd('0x3b')]!=='VIRTUAL'){var _0x5eb9ed={};_0x5eb9ed[_0x1950a4[_0x13cd('0x28')]]={'$like':'%'+_0x136825[_0x13cd('0x2d')][_0x13cd('0x37')]+'%'};return _0x5eb9ed;}})});}_0x1f726b=_[_0x13cd('0x39')]({},_0x1f726b,_0x136825[_0x13cd('0x3c')]);var _0x4ea248={'where':_0x1f726b[_0x13cd('0x38')]};return db[_0x13cd('0x2a')][_0x13cd('0x20')](_0x4ea248)[_0x13cd('0x26')](function(_0x1bec66){_0x2079d1[_0x13cd('0x20')]=_0x1bec66;if(_0x136825[_0x13cd('0x2d')]['includeAll']){_0x1f726b[_0x13cd('0x3d')]=[{'all':!![]}];}return db[_0x13cd('0x2a')][_0x13cd('0x3e')](_0x1f726b);})[_0x13cd('0x26')](function(_0x4ba5f6){_0x2079d1['rows']=_0x4ba5f6;return _0x2079d1;})[_0x13cd('0x26')](respondWithFilteredResult(_0x256628,_0x1f726b))['catch'](handleError(_0x256628,null));};exports[_0x13cd('0x3f')]=function(_0x48d843,_0x4ab83c){var _0x200367={'raw':!![],'where':{'id':_0x48d843[_0x13cd('0x40')]['id']}},_0x10bd80={};_0x10bd80[_0x13cd('0x2c')]=_[_0x13cd('0x2e')](db[_0x13cd('0x2a')]['rawAttributes']);_0x10bd80[_0x13cd('0x2d')]=_[_0x13cd('0x2e')](_0x48d843['query']);_0x10bd80[_0x13cd('0x2f')]=_[_0x13cd('0x30')](_0x10bd80[_0x13cd('0x2c')],_0x10bd80['query']);_0x200367[_0x13cd('0x31')]=_[_0x13cd('0x30')](_0x10bd80['model'],qs['fields'](_0x48d843[_0x13cd('0x2d')][_0x13cd('0x32')]));_0x200367[_0x13cd('0x31')]=_0x200367[_0x13cd('0x31')][_0x13cd('0x41')]?_0x200367[_0x13cd('0x31')]:_0x10bd80[_0x13cd('0x2c')];if(_0x48d843[_0x13cd('0x2d')][_0x13cd('0x42')]){_0x200367['include']=[{'all':!![]}];}_0x200367=_['merge']({},_0x200367,_0x48d843[_0x13cd('0x3c')]);return db[_0x13cd('0x2a')][_0x13cd('0x43')](_0x200367)[_0x13cd('0x26')](handleEntityNotFound(_0x4ab83c,null))['then'](respondWithResult(_0x4ab83c,null))[_0x13cd('0x44')](handleError(_0x4ab83c,null));};exports[_0x13cd('0x45')]=function(_0x45c0f6,_0x478538){return db['FaxQueueReport']['create'](_0x45c0f6[_0x13cd('0x46')],{})['then'](respondWithResult(_0x478538,0xc9))[_0x13cd('0x44')](handleError(_0x478538,null));};exports[_0x13cd('0x47')]=function(_0x10f94a,_0x5810ad){if(_0x10f94a[_0x13cd('0x46')]['id']){delete _0x10f94a['body']['id'];}return db[_0x13cd('0x2a')]['find']({'where':{'id':_0x10f94a[_0x13cd('0x40')]['id']}})['then'](handleEntityNotFound(_0x5810ad,null))[_0x13cd('0x26')](saveUpdates(_0x10f94a[_0x13cd('0x46')],null))[_0x13cd('0x26')](respondWithResult(_0x5810ad,null))['catch'](handleError(_0x5810ad,null));};exports[_0x13cd('0x25')]=function(_0x12af6d,_0x37287e){return db['FaxQueueReport']['find']({'where':{'id':_0x12af6d[_0x13cd('0x40')]['id']}})[_0x13cd('0x26')](handleEntityNotFound(_0x37287e,null))['then'](removeEntity(_0x37287e,null))[_0x13cd('0x44')](handleError(_0x37287e,null));};exports[_0x13cd('0x48')]=function(_0x14310e,_0x451746){return db['FaxQueueReport'][_0x13cd('0x48')]()[_0x13cd('0x26')](respondWithResult(_0x451746,null))['catch'](handleError(_0x451746,null));};
\ No newline at end of file
index 6c39d4f..9f2db4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x528260,_0x230cb4){var _0x3cf294=function(_0x20bbe1){while(--_0x20bbe1){_0x528260['push'](_0x528260['shift']());}};_0x3cf294(++_0x230cb4);}(_0x1261,0x144));var _0x1126=function(_0x1466ba,_0x4cd93e){_0x1466ba=_0x1466ba-0x0;var _0x56a71b=_0x1261[_0x1466ba];return _0x56a71b;};'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')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x586f45,_0x4b258f){var _0x9bead6=function(_0x183c3a){while(--_0x183c3a){_0x586f45['push'](_0x586f45['shift']());}};_0x9bead6(++_0x4b258f);}(_0xabce,0x103));var _0xeabc=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xabce[_0x4bfac3];return _0x15f0f2;};'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
index 19b7556..a4f8632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dec=['UpdateFaxQueueReport','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','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','debug','update','limit'];(function(_0x1e7670,_0x437534){var _0x1c21ce=function(_0x37ce66){while(--_0x37ce66){_0x1e7670['push'](_0x1e7670['shift']());}};_0x1c21ce(++_0x437534);}(_0x5dec,0x1d1));var _0xc5de=function(_0x1cbecb,_0x505e33){_0x1cbecb=_0x1cbecb-0x0;var _0x4112c4=_0x5dec[_0x1cbecb];return _0x4112c4;};'use strict';var _=require(_0xc5de('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5de('0x1'));var fs=require('fs');var Redis=require(_0xc5de('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5de('0x3'));var logger=require('../../config/logger')(_0xc5de('0x4'));var config=require(_0xc5de('0x5'));var jayson=require(_0xc5de('0x6'));var client=jayson[_0xc5de('0x7')][_0xc5de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38c8e9,_0x49ac73,_0x5d6fb2){return new BPromise(function(_0x3d51c7,_0x5f2b60){return client['request'](_0x38c8e9,_0x5d6fb2)[_0xc5de('0x9')](function(_0x41c03a){logger[_0xc5de('0xa')](_0xc5de('0xb'),_0x49ac73,_0xc5de('0xc'));logger['debug'](_0xc5de('0xd'),_0x49ac73,_0xc5de('0xc'),JSON[_0xc5de('0xe')](_0x41c03a));if(_0x41c03a[_0xc5de('0xf')]){if(_0x41c03a[_0xc5de('0xf')][_0xc5de('0x10')]===0x1f4){logger[_0xc5de('0xf')](_0xc5de('0xb'),_0x49ac73,_0x41c03a[_0xc5de('0xf')]['message']);return _0x5f2b60(_0x41c03a[_0xc5de('0xf')][_0xc5de('0x11')]);}logger[_0xc5de('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x49ac73,_0x41c03a['error'][_0xc5de('0x11')]);return _0x3d51c7(_0x41c03a['error'][_0xc5de('0x11')]);}else{logger[_0xc5de('0xa')](_0xc5de('0xb'),_0x49ac73,'request\x20sent');_0x3d51c7(_0x41c03a[_0xc5de('0x12')][_0xc5de('0x11')]);}})[_0xc5de('0x13')](function(_0x5c5e71){logger['error'](_0xc5de('0xb'),_0x49ac73,_0x5c5e71);_0x5f2b60(_0x5c5e71);});});}exports[_0xc5de('0x14')]=function(_0x25a167){var _0x50779a=this;return new Promise(function(_0x3769e4,_0x4c5606){return db['FaxQueueReport'][_0xc5de('0x15')](_0x25a167[_0xc5de('0x16')],{'raw':_0x25a167[_0xc5de('0x17')]?_0x25a167[_0xc5de('0x17')][_0xc5de('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x28bd9e){logger['info']('CreateFaxQueueReport',_0x25a167);logger[_0xc5de('0x19')](_0xc5de('0x14'),_0x25a167,JSON['stringify'](_0x28bd9e));_0x3769e4(_0x28bd9e);})['catch'](function(_0xc6fbe){logger['error']('CreateFaxQueueReport',_0xc6fbe[_0xc5de('0x11')],_0x25a167);_0x4c5606(_0x50779a[_0xc5de('0xf')](0x1f4,_0xc6fbe[_0xc5de('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x5b70f7){var _0x3af6f5=this;return new Promise(function(_0xb82988,_0x249d5a){return db['FaxQueueReport'][_0xc5de('0x1a')](_0x5b70f7['body'],{'raw':_0x5b70f7['options']?_0x5b70f7[_0xc5de('0x17')][_0xc5de('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b70f7[_0xc5de('0x17')]?_0x5b70f7[_0xc5de('0x17')]['where']||null:null,'attributes':_0x5b70f7[_0xc5de('0x17')]?_0x5b70f7[_0xc5de('0x17')]['attributes']||null:null,'limit':_0x5b70f7['options']?_0x5b70f7[_0xc5de('0x17')][_0xc5de('0x1b')]||null:null})[_0xc5de('0x9')](function(_0x5894b0){logger[_0xc5de('0xa')]('UpdateFaxQueueReport',_0x5b70f7);logger['debug']('UpdateFaxQueueReport',_0x5b70f7,JSON[_0xc5de('0xe')](_0x5894b0));_0xb82988(_0x5894b0);})[_0xc5de('0x13')](function(_0x3ff700){logger['error'](_0xc5de('0x1c'),_0x3ff700[_0xc5de('0x11')],_0x5b70f7);_0x249d5a(_0x3af6f5[_0xc5de('0xf')](0x1f4,_0x3ff700[_0xc5de('0x11')]));});});};
\ No newline at end of file
+var _0x67c1=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','create','options','UpdateFaxQueueReport','update','body','raw','where'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x67c1,0xf8));var _0x167c=function(_0x2bec2b,_0x15354b){_0x2bec2b=_0x2bec2b-0x0;var _0x5ad5ae=_0x67c1[_0x2bec2b];return _0x5ad5ae;};'use strict';var _=require('lodash');var util=require(_0x167c('0x0'));var moment=require(_0x167c('0x1'));var BPromise=require(_0x167c('0x2'));var rs=require(_0x167c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x167c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x167c('0x5'))(_0x167c('0x6'));var config=require(_0x167c('0x7'));var jayson=require(_0x167c('0x8'));var client=jayson[_0x167c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243af0,_0x20fa89,_0x4c9df){return new BPromise(function(_0x1a13f7,_0x4138c0){return client[_0x167c('0xa')](_0x243af0,_0x4c9df)[_0x167c('0xb')](function(_0x2d1ae1){logger['info'](_0x167c('0xc'),_0x20fa89,'request\x20sent');logger[_0x167c('0xd')](_0x167c('0xe'),_0x20fa89,_0x167c('0xf'),JSON[_0x167c('0x10')](_0x2d1ae1));if(_0x2d1ae1[_0x167c('0x11')]){if(_0x2d1ae1[_0x167c('0x11')][_0x167c('0x12')]===0x1f4){logger[_0x167c('0x11')](_0x167c('0xc'),_0x20fa89,_0x2d1ae1[_0x167c('0x11')][_0x167c('0x13')]);return _0x4138c0(_0x2d1ae1[_0x167c('0x11')][_0x167c('0x13')]);}logger[_0x167c('0x11')](_0x167c('0xc'),_0x20fa89,_0x2d1ae1[_0x167c('0x11')][_0x167c('0x13')]);return _0x1a13f7(_0x2d1ae1['error']['message']);}else{logger[_0x167c('0x14')](_0x167c('0xc'),_0x20fa89,'request\x20sent');_0x1a13f7(_0x2d1ae1[_0x167c('0x15')][_0x167c('0x13')]);}})[_0x167c('0x16')](function(_0x318926){logger['error'](_0x167c('0xc'),_0x20fa89,_0x318926);_0x4138c0(_0x318926);});});}exports[_0x167c('0x17')]=function(_0x21b4f8){var _0x4d7248=this;return new Promise(function(_0x3858f6,_0x534a90){return db['FaxQueueReport'][_0x167c('0x18')](_0x21b4f8['body'],{'raw':_0x21b4f8[_0x167c('0x19')]?_0x21b4f8[_0x167c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x167c('0xb')](function(_0x289456){logger[_0x167c('0x14')]('CreateFaxQueueReport',_0x21b4f8);logger[_0x167c('0xd')](_0x167c('0x17'),_0x21b4f8,JSON[_0x167c('0x10')](_0x289456));_0x3858f6(_0x289456);})['catch'](function(_0x5e679b){logger[_0x167c('0x11')](_0x167c('0x17'),_0x5e679b[_0x167c('0x13')],_0x21b4f8);_0x534a90(_0x4d7248[_0x167c('0x11')](0x1f4,_0x5e679b[_0x167c('0x13')]));});});};exports[_0x167c('0x1a')]=function(_0x34dfce){var _0x544150=this;return new Promise(function(_0x7dcecb,_0x4efa0e){return db['FaxQueueReport'][_0x167c('0x1b')](_0x34dfce[_0x167c('0x1c')],{'raw':_0x34dfce[_0x167c('0x19')]?_0x34dfce[_0x167c('0x19')][_0x167c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34dfce['options']?_0x34dfce[_0x167c('0x19')][_0x167c('0x1e')]||null:null,'attributes':_0x34dfce[_0x167c('0x19')]?_0x34dfce['options']['attributes']||null:null,'limit':_0x34dfce[_0x167c('0x19')]?_0x34dfce[_0x167c('0x19')]['limit']||null:null})[_0x167c('0xb')](function(_0xaf8ccc){logger['info'](_0x167c('0x1a'),_0x34dfce);logger[_0x167c('0xd')](_0x167c('0x1a'),_0x34dfce,JSON[_0x167c('0x10')](_0xaf8ccc));_0x7dcecb(_0xaf8ccc);})[_0x167c('0x16')](function(_0x691c87){logger[_0x167c('0x11')]('UpdateFaxQueueReport',_0x691c87[_0x167c('0x13')],_0x34dfce);_0x4efa0e(_0x544150[_0x167c('0x11')](0x1f4,_0x691c87[_0x167c('0x13')]));});});};
\ No newline at end of file
index 068898e..2c0488f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b6c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','path','connect-timeout'];(function(_0x297ea8,_0x515202){var _0x1188bd=function(_0x29fba7){while(--_0x29fba7){_0x297ea8['push'](_0x297ea8['shift']());}};_0x1188bd(++_0x515202);}(_0x4b6c,0x1e2));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc4b6('0x0'));var timeout=require(_0xc4b6('0x1'));var express=require(_0xc4b6('0x2'));var router=express[_0xc4b6('0x3')]();var fs_extra=require(_0xc4b6('0x4'));var auth=require(_0xc4b6('0x5'));var interaction=require(_0xc4b6('0x6'));var config=require(_0xc4b6('0x7'));var controller=require(_0xc4b6('0x8'));router[_0xc4b6('0x9')]('/',auth[_0xc4b6('0xa')](),controller[_0xc4b6('0xb')]);router[_0xc4b6('0x9')](_0xc4b6('0xc'),auth[_0xc4b6('0xa')](),controller[_0xc4b6('0xd')]);router[_0xc4b6('0x9')]('/:id',auth[_0xc4b6('0xa')](),controller[_0xc4b6('0xe')]);router[_0xc4b6('0xf')]('/',auth[_0xc4b6('0xa')](),controller['create']);router[_0xc4b6('0x10')](_0xc4b6('0x11'),auth[_0xc4b6('0xa')](),controller[_0xc4b6('0x12')]);router[_0xc4b6('0x13')](_0xc4b6('0x11'),auth[_0xc4b6('0xa')](),controller[_0xc4b6('0x14')]);module[_0xc4b6('0x15')]=router;
\ No newline at end of file
+var _0x38ee=['Router','fs-extra','../../components/auth/service','./faxQueueReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x38ee,0xeb));var _0xe38e=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0x38ee[_0x5de1bc];return _0x19f4b8;};'use strict';var multer=require(_0xe38e('0x0'));var util=require(_0xe38e('0x1'));var path=require(_0xe38e('0x2'));var timeout=require(_0xe38e('0x3'));var express=require(_0xe38e('0x4'));var router=express[_0xe38e('0x5')]();var fs_extra=require(_0xe38e('0x6'));var auth=require(_0xe38e('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe38e('0x8'));router[_0xe38e('0x9')]('/',auth['isAuthenticated'](),controller[_0xe38e('0xa')]);router[_0xe38e('0x9')]('/describe',auth[_0xe38e('0xb')](),controller[_0xe38e('0xc')]);router[_0xe38e('0x9')](_0xe38e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe38e('0xe')]('/',auth[_0xe38e('0xb')](),controller[_0xe38e('0xf')]);router[_0xe38e('0x10')]('/:id',auth[_0xe38e('0xb')](),controller[_0xe38e('0x11')]);router[_0xe38e('0x12')]('/:id',auth[_0xe38e('0xb')](),controller[_0xe38e('0x13')]);module['exports']=router;
\ No newline at end of file
index f217153..e51f0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2ceba7,_0x451ce4){var _0x5348eb=function(_0x3596fc){while(--_0x3596fc){_0x2ceba7['push'](_0x2ceba7['shift']());}};_0x5348eb(++_0x451ce4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0xb43b,0x1b2));var _0xbb43=function(_0xb81d40,_0x47e1ba){_0xb81d40=_0xb81d40-0x0;var _0x31ea0c=_0xb43b[_0xb81d40];return _0x31ea0c;};'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
index b350012..8bd76b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7cd=['include','findAll','rows','catch','show','params','rawAttributes','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','FaxTransferReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0xe7cd,0x17e));var _0xde7c=function(_0x1eae89,_0x511b25){_0x1eae89=_0x1eae89-0x0;var _0x29cf59=_0xe7cd[_0x1eae89];return _0x29cf59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde7c('0x0'));var zipdir=require(_0xde7c('0x1'));var jsonpatch=require(_0xde7c('0x2'));var rp=require(_0xde7c('0x3'));var moment=require(_0xde7c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xde7c('0x5'));var csv=require(_0xde7c('0x6'));var ejs=require(_0xde7c('0x7'));var fs=require('fs');var fs_extra=require(_0xde7c('0x8'));var _=require(_0xde7c('0x9'));var squel=require(_0xde7c('0xa'));var crypto=require(_0xde7c('0xb'));var jsforce=require(_0xde7c('0xc'));var deskjs=require(_0xde7c('0xd'));var toCsv=require(_0xde7c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xde7c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xde7c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde7c('0x10'));var logger=require(_0xde7c('0x11'))(_0xde7c('0x12'));var utils=require(_0xde7c('0x13'));var config=require(_0xde7c('0x14'));var licenseUtil=require(_0xde7c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419ece,_0x40f40f){_0x40f40f=_0x40f40f||0xcc;return function(_0x101f01){if(_0x101f01){return _0x419ece[_0xde7c('0x16')](_0x40f40f);}return _0x419ece[_0xde7c('0x17')](_0x40f40f)[_0xde7c('0x18')]();};}function respondWithResult(_0x4d7510,_0x253761){_0x253761=_0x253761||0xc8;return function(_0x396575){if(_0x396575){return _0x4d7510[_0xde7c('0x17')](_0x253761)[_0xde7c('0x19')](_0x396575);}};}function respondWithFilteredResult(_0x5a1fa9,_0x2433d9){return function(_0x270d9b){if(_0x270d9b){var _0x525609=typeof _0x2433d9[_0xde7c('0x1a')]===_0xde7c('0x1b')&&typeof _0x2433d9[_0xde7c('0x1c')]===_0xde7c('0x1b');var _0x5b60e7=_0x270d9b[_0xde7c('0x1d')];var _0x456d95=_0x525609?0x0:_0x2433d9[_0xde7c('0x1a')];var _0x4a79d3=_0x525609?_0x270d9b[_0xde7c('0x1d')]:_0x2433d9[_0xde7c('0x1a')]+_0x2433d9[_0xde7c('0x1c')];var _0x479a23;if(_0x4a79d3>=_0x5b60e7){_0x4a79d3=_0x5b60e7;_0x479a23=0xc8;}else{_0x479a23=0xce;}_0x5a1fa9['status'](_0x479a23);return _0x5a1fa9[_0xde7c('0x1e')](_0xde7c('0x1f'),_0x456d95+'-'+_0x4a79d3+'/'+_0x5b60e7)[_0xde7c('0x19')](_0x270d9b);}return null;};}function patchUpdates(_0x1c1d75){return function(_0x7ac292){try{jsonpatch[_0xde7c('0x20')](_0x7ac292,_0x1c1d75,!![]);}catch(_0x4c0c94){return BPromise[_0xde7c('0x21')](_0x4c0c94);}return _0x7ac292[_0xde7c('0x22')]();};}function saveUpdates(_0x1762f5,_0x4d3ee9){return function(_0x47c326){if(_0x47c326){return _0x47c326[_0xde7c('0x23')](_0x1762f5)[_0xde7c('0x24')](function(_0x13fc7d){return _0x13fc7d;});}return null;};}function removeEntity(_0x1f03c4,_0x35895b){return function(_0x4790eb){if(_0x4790eb){return _0x4790eb['destroy']()[_0xde7c('0x24')](function(){_0x1f03c4[_0xde7c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30a19c,_0x242634){return function(_0x59a01a){if(!_0x59a01a){_0x30a19c[_0xde7c('0x16')](0x194);}return _0x59a01a;};}function handleError(_0x51e2d4,_0x1cf208){_0x1cf208=_0x1cf208||0x1f4;return function(_0x52da8c){logger[_0xde7c('0x25')](_0x52da8c['stack']);if(_0x52da8c[_0xde7c('0x26')]){delete _0x52da8c[_0xde7c('0x26')];}_0x51e2d4['status'](_0x1cf208)[_0xde7c('0x27')](_0x52da8c);};}exports['index']=function(_0x1c369f,_0x217863){var _0x4a4c1c={},_0x438175={},_0x3fea60={'count':0x0,'rows':[]};var _0x30b32b=_[_0xde7c('0x28')](db[_0xde7c('0x29')]['rawAttributes'],function(_0x5bc469){return{'name':_0x5bc469[_0xde7c('0x2a')],'type':_0x5bc469[_0xde7c('0x2b')][_0xde7c('0x2c')]};});_0x438175[_0xde7c('0x2d')]=_[_0xde7c('0x28')](_0x30b32b,_0xde7c('0x26'));_0x438175[_0xde7c('0x2e')]=_[_0xde7c('0x2f')](_0x1c369f['query']);_0x438175['filters']=_['intersection'](_0x438175[_0xde7c('0x2d')],_0x438175['query']);_0x4a4c1c['attributes']=_[_0xde7c('0x30')](_0x438175[_0xde7c('0x2d')],qs[_0xde7c('0x31')](_0x1c369f[_0xde7c('0x2e')][_0xde7c('0x31')]));_0x4a4c1c[_0xde7c('0x32')]=_0x4a4c1c[_0xde7c('0x32')][_0xde7c('0x33')]?_0x4a4c1c[_0xde7c('0x32')]:_0x438175[_0xde7c('0x2d')];if(!_0x1c369f['query'][_0xde7c('0x34')](_0xde7c('0x35'))){_0x4a4c1c[_0xde7c('0x1c')]=qs[_0xde7c('0x1c')](_0x1c369f[_0xde7c('0x2e')][_0xde7c('0x1c')]);_0x4a4c1c['offset']=qs['offset'](_0x1c369f[_0xde7c('0x2e')][_0xde7c('0x1a')]);}_0x4a4c1c['order']=qs['sort'](_0x1c369f['query'][_0xde7c('0x36')]);_0x4a4c1c[_0xde7c('0x37')]=qs[_0xde7c('0x38')](_[_0xde7c('0x39')](_0x1c369f[_0xde7c('0x2e')],_0x438175['filters']),_0x30b32b);if(_0x1c369f[_0xde7c('0x2e')][_0xde7c('0x3a')]){_0x4a4c1c[_0xde7c('0x37')]=_[_0xde7c('0x3b')](_0x4a4c1c['where'],{'$or':_[_0xde7c('0x28')](_0x30b32b,function(_0x19313f){if(_0x19313f[_0xde7c('0x2b')]!=='VIRTUAL'){var _0x4f2fe9={};_0x4f2fe9[_0x19313f[_0xde7c('0x26')]]={'$like':'%'+_0x1c369f[_0xde7c('0x2e')]['filter']+'%'};return _0x4f2fe9;}})});}_0x4a4c1c=_['merge']({},_0x4a4c1c,_0x1c369f[_0xde7c('0x3c')]);var _0x3975fe={'where':_0x4a4c1c[_0xde7c('0x37')]};return db[_0xde7c('0x29')][_0xde7c('0x1d')](_0x3975fe)[_0xde7c('0x24')](function(_0x4ac420){_0x3fea60[_0xde7c('0x1d')]=_0x4ac420;if(_0x1c369f['query'][_0xde7c('0x3d')]){_0x4a4c1c[_0xde7c('0x3e')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xde7c('0x3f')](_0x4a4c1c);})[_0xde7c('0x24')](function(_0x3a89b9){_0x3fea60[_0xde7c('0x40')]=_0x3a89b9;return _0x3fea60;})['then'](respondWithFilteredResult(_0x217863,_0x4a4c1c))[_0xde7c('0x41')](handleError(_0x217863,null));};exports[_0xde7c('0x42')]=function(_0x27709f,_0x1c309c){var _0x52b45a={'raw':!![],'where':{'id':_0x27709f[_0xde7c('0x43')]['id']}},_0x9ad721={};_0x9ad721[_0xde7c('0x2d')]=_['keys'](db[_0xde7c('0x29')][_0xde7c('0x44')]);_0x9ad721[_0xde7c('0x2e')]=_[_0xde7c('0x2f')](_0x27709f[_0xde7c('0x2e')]);_0x9ad721[_0xde7c('0x38')]=_[_0xde7c('0x30')](_0x9ad721[_0xde7c('0x2d')],_0x9ad721[_0xde7c('0x2e')]);_0x52b45a['attributes']=_[_0xde7c('0x30')](_0x9ad721[_0xde7c('0x2d')],qs[_0xde7c('0x31')](_0x27709f['query'][_0xde7c('0x31')]));_0x52b45a[_0xde7c('0x32')]=_0x52b45a['attributes'][_0xde7c('0x33')]?_0x52b45a[_0xde7c('0x32')]:_0x9ad721['model'];if(_0x27709f[_0xde7c('0x2e')][_0xde7c('0x3d')]){_0x52b45a[_0xde7c('0x3e')]=[{'all':!![]}];}_0x52b45a=_[_0xde7c('0x3b')]({},_0x52b45a,_0x27709f['options']);return db[_0xde7c('0x29')]['find'](_0x52b45a)[_0xde7c('0x24')](handleEntityNotFound(_0x1c309c,null))[_0xde7c('0x24')](respondWithResult(_0x1c309c,null))[_0xde7c('0x41')](handleError(_0x1c309c,null));};exports[_0xde7c('0x45')]=function(_0xe032d,_0x442e0d){return db[_0xde7c('0x29')][_0xde7c('0x45')](_0xe032d[_0xde7c('0x46')],{})[_0xde7c('0x24')](respondWithResult(_0x442e0d,0xc9))[_0xde7c('0x41')](handleError(_0x442e0d,null));};exports[_0xde7c('0x23')]=function(_0x4f8e52,_0x30ad5d){if(_0x4f8e52['body']['id']){delete _0x4f8e52['body']['id'];}return db[_0xde7c('0x29')][_0xde7c('0x47')]({'where':{'id':_0x4f8e52['params']['id']}})[_0xde7c('0x24')](handleEntityNotFound(_0x30ad5d,null))[_0xde7c('0x24')](saveUpdates(_0x4f8e52['body'],null))[_0xde7c('0x24')](respondWithResult(_0x30ad5d,null))[_0xde7c('0x41')](handleError(_0x30ad5d,null));};exports[_0xde7c('0x48')]=function(_0x140917,_0x20abd3){return db['FaxTransferReport']['find']({'where':{'id':_0x140917[_0xde7c('0x43')]['id']}})[_0xde7c('0x24')](handleEntityNotFound(_0x20abd3,null))[_0xde7c('0x24')](removeEntity(_0x20abd3,null))['catch'](handleError(_0x20abd3,null));};exports[_0xde7c('0x49')]=function(_0x12e12e,_0x2ac4f2){return db['FaxTransferReport'][_0xde7c('0x49')]()[_0xde7c('0x24')](respondWithResult(_0x2ac4f2,null))[_0xde7c('0x41')](handleError(_0x2ac4f2,null));};
\ No newline at end of file
+var _0x0881=['body','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','fields','length','find','catch','create'];(function(_0x4c589b,_0x38732d){var _0x4fa065=function(_0x2876fb){while(--_0x2876fb){_0x4c589b['push'](_0x4c589b['shift']());}};_0x4fa065(++_0x38732d);}(_0x0881,0x1e6));var _0x1088=function(_0x5545f7,_0x570414){_0x5545f7=_0x5545f7-0x0;var _0x52a979=_0x0881[_0x5545f7];return _0x52a979;};'use strict';var emlformat=require(_0x1088('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1088('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1088('0x2'));var moment=require(_0x1088('0x3'));var BPromise=require(_0x1088('0x4'));var Mustache=require(_0x1088('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1088('0x6'));var ejs=require(_0x1088('0x7'));var fs=require('fs');var fs_extra=require(_0x1088('0x8'));var _=require(_0x1088('0x9'));var squel=require('squel');var crypto=require(_0x1088('0xa'));var jsforce=require(_0x1088('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1088('0x6'));var querystring=require('querystring');var Papa=require(_0x1088('0xc'));var Redis=require(_0x1088('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1088('0xe'));var as=require(_0x1088('0xf'));var hardwareService=require(_0x1088('0x10'));var logger=require(_0x1088('0x11'))('api');var utils=require(_0x1088('0x12'));var config=require(_0x1088('0x13'));var licenseUtil=require(_0x1088('0x14'));var db=require(_0x1088('0x15'))['db'];function respondWithStatusCode(_0x5c5ee2,_0x2f20a1){_0x2f20a1=_0x2f20a1||0xcc;return function(_0x1e9961){if(_0x1e9961){return _0x5c5ee2[_0x1088('0x16')](_0x2f20a1);}return _0x5c5ee2[_0x1088('0x17')](_0x2f20a1)[_0x1088('0x18')]();};}function respondWithResult(_0x228f1e,_0x131a28){_0x131a28=_0x131a28||0xc8;return function(_0x240a1e){if(_0x240a1e){return _0x228f1e[_0x1088('0x17')](_0x131a28)[_0x1088('0x19')](_0x240a1e);}};}function respondWithFilteredResult(_0x4c0ee7,_0x56d419){return function(_0xa5c26){if(_0xa5c26){var _0x432865=typeof _0x56d419['offset']==='undefined'&&typeof _0x56d419[_0x1088('0x1a')]==='undefined';var _0x1242f8=_0xa5c26[_0x1088('0x1b')];var _0xe49b77=_0x432865?0x0:_0x56d419[_0x1088('0x1c')];var _0x1de074=_0x432865?_0xa5c26[_0x1088('0x1b')]:_0x56d419[_0x1088('0x1c')]+_0x56d419[_0x1088('0x1a')];var _0x119cd5;if(_0x1de074>=_0x1242f8){_0x1de074=_0x1242f8;_0x119cd5=0xc8;}else{_0x119cd5=0xce;}_0x4c0ee7[_0x1088('0x17')](_0x119cd5);return _0x4c0ee7[_0x1088('0x1d')](_0x1088('0x1e'),_0xe49b77+'-'+_0x1de074+'/'+_0x1242f8)[_0x1088('0x19')](_0xa5c26);}return null;};}function patchUpdates(_0x3e5e01){return function(_0x7514f){try{jsonpatch[_0x1088('0x1f')](_0x7514f,_0x3e5e01,!![]);}catch(_0x48834e){return BPromise[_0x1088('0x20')](_0x48834e);}return _0x7514f[_0x1088('0x21')]();};}function saveUpdates(_0x13ce2c,_0x2ec3b8){return function(_0x2da4c6){if(_0x2da4c6){return _0x2da4c6[_0x1088('0x22')](_0x13ce2c)['then'](function(_0x5e3543){return _0x5e3543;});}return null;};}function removeEntity(_0x3d033e,_0x15266b){return function(_0x28ee73){if(_0x28ee73){return _0x28ee73['destroy']()[_0x1088('0x23')](function(){_0x3d033e['status'](0xcc)[_0x1088('0x18')]();});}};}function handleEntityNotFound(_0x2d24cf,_0x398749){return function(_0x58e466){if(!_0x58e466){_0x2d24cf[_0x1088('0x16')](0x194);}return _0x58e466;};}function handleError(_0x48f342,_0x2ae7c0){_0x2ae7c0=_0x2ae7c0||0x1f4;return function(_0x13f3ed){logger[_0x1088('0x24')](_0x13f3ed['stack']);if(_0x13f3ed['name']){delete _0x13f3ed[_0x1088('0x25')];}_0x48f342['status'](_0x2ae7c0)[_0x1088('0x26')](_0x13f3ed);};}exports['index']=function(_0x16799f,_0x1bdfdf){var _0x46307f={},_0x58aa5f={},_0x119f07={'count':0x0,'rows':[]};var _0x31acc9=_[_0x1088('0x27')](db[_0x1088('0x28')][_0x1088('0x29')],function(_0x13e6e5){return{'name':_0x13e6e5[_0x1088('0x2a')],'type':_0x13e6e5[_0x1088('0x2b')][_0x1088('0x2c')]};});_0x58aa5f[_0x1088('0x2d')]=_[_0x1088('0x27')](_0x31acc9,_0x1088('0x25'));_0x58aa5f[_0x1088('0x2e')]=_['keys'](_0x16799f['query']);_0x58aa5f[_0x1088('0x2f')]=_[_0x1088('0x30')](_0x58aa5f['model'],_0x58aa5f[_0x1088('0x2e')]);_0x46307f[_0x1088('0x31')]=_[_0x1088('0x30')](_0x58aa5f['model'],qs['fields'](_0x16799f['query']['fields']));_0x46307f[_0x1088('0x31')]=_0x46307f[_0x1088('0x31')]['length']?_0x46307f[_0x1088('0x31')]:_0x58aa5f[_0x1088('0x2d')];if(!_0x16799f[_0x1088('0x2e')]['hasOwnProperty']('nolimit')){_0x46307f[_0x1088('0x1a')]=qs[_0x1088('0x1a')](_0x16799f[_0x1088('0x2e')]['limit']);_0x46307f[_0x1088('0x1c')]=qs[_0x1088('0x1c')](_0x16799f['query']['offset']);}_0x46307f['order']=qs[_0x1088('0x32')](_0x16799f[_0x1088('0x2e')][_0x1088('0x32')]);_0x46307f[_0x1088('0x33')]=qs[_0x1088('0x2f')](_['pick'](_0x16799f[_0x1088('0x2e')],_0x58aa5f[_0x1088('0x2f')]),_0x31acc9);if(_0x16799f[_0x1088('0x2e')][_0x1088('0x34')]){_0x46307f[_0x1088('0x33')]=_[_0x1088('0x35')](_0x46307f['where'],{'$or':_[_0x1088('0x27')](_0x31acc9,function(_0x4f57f9){if(_0x4f57f9[_0x1088('0x2b')]!==_0x1088('0x36')){var _0xe049c6={};_0xe049c6[_0x4f57f9[_0x1088('0x25')]]={'$like':'%'+_0x16799f[_0x1088('0x2e')][_0x1088('0x34')]+'%'};return _0xe049c6;}})});}_0x46307f=_[_0x1088('0x35')]({},_0x46307f,_0x16799f[_0x1088('0x37')]);var _0x42abb8={'where':_0x46307f[_0x1088('0x33')]};return db[_0x1088('0x28')][_0x1088('0x1b')](_0x42abb8)[_0x1088('0x23')](function(_0x398d4d){_0x119f07[_0x1088('0x1b')]=_0x398d4d;if(_0x16799f[_0x1088('0x2e')][_0x1088('0x38')]){_0x46307f[_0x1088('0x39')]=[{'all':!![]}];}return db[_0x1088('0x28')][_0x1088('0x3a')](_0x46307f);})[_0x1088('0x23')](function(_0x3255a1){_0x119f07['rows']=_0x3255a1;return _0x119f07;})[_0x1088('0x23')](respondWithFilteredResult(_0x1bdfdf,_0x46307f))['catch'](handleError(_0x1bdfdf,null));};exports['show']=function(_0x51aa7a,_0x4bf188){var _0x610aef={'raw':!![],'where':{'id':_0x51aa7a[_0x1088('0x3b')]['id']}},_0x53f62d={};_0x53f62d['model']=_[_0x1088('0x3c')](db[_0x1088('0x28')]['rawAttributes']);_0x53f62d[_0x1088('0x2e')]=_[_0x1088('0x3c')](_0x51aa7a[_0x1088('0x2e')]);_0x53f62d[_0x1088('0x2f')]=_[_0x1088('0x30')](_0x53f62d[_0x1088('0x2d')],_0x53f62d[_0x1088('0x2e')]);_0x610aef['attributes']=_[_0x1088('0x30')](_0x53f62d[_0x1088('0x2d')],qs[_0x1088('0x3d')](_0x51aa7a['query'][_0x1088('0x3d')]));_0x610aef[_0x1088('0x31')]=_0x610aef['attributes'][_0x1088('0x3e')]?_0x610aef[_0x1088('0x31')]:_0x53f62d[_0x1088('0x2d')];if(_0x51aa7a['query'][_0x1088('0x38')]){_0x610aef[_0x1088('0x39')]=[{'all':!![]}];}_0x610aef=_[_0x1088('0x35')]({},_0x610aef,_0x51aa7a[_0x1088('0x37')]);return db[_0x1088('0x28')][_0x1088('0x3f')](_0x610aef)['then'](handleEntityNotFound(_0x4bf188,null))['then'](respondWithResult(_0x4bf188,null))[_0x1088('0x40')](handleError(_0x4bf188,null));};exports[_0x1088('0x41')]=function(_0x1e1eda,_0x496b38){return db[_0x1088('0x28')][_0x1088('0x41')](_0x1e1eda['body'],{})[_0x1088('0x23')](respondWithResult(_0x496b38,0xc9))[_0x1088('0x40')](handleError(_0x496b38,null));};exports[_0x1088('0x22')]=function(_0x26de98,_0x1c7a40){if(_0x26de98[_0x1088('0x42')]['id']){delete _0x26de98['body']['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x26de98[_0x1088('0x3b')]['id']}})[_0x1088('0x23')](handleEntityNotFound(_0x1c7a40,null))[_0x1088('0x23')](saveUpdates(_0x26de98[_0x1088('0x42')],null))[_0x1088('0x23')](respondWithResult(_0x1c7a40,null))[_0x1088('0x40')](handleError(_0x1c7a40,null));};exports[_0x1088('0x43')]=function(_0x3de6ae,_0x451bdd){return db['FaxTransferReport'][_0x1088('0x3f')]({'where':{'id':_0x3de6ae[_0x1088('0x3b')]['id']}})[_0x1088('0x23')](handleEntityNotFound(_0x451bdd,null))['then'](removeEntity(_0x451bdd,null))[_0x1088('0x40')](handleError(_0x451bdd,null));};exports[_0x1088('0x44')]=function(_0x15589d,_0x41f893){return db[_0x1088('0x28')]['describe']()['then'](respondWithResult(_0x41f893,null))[_0x1088('0x40')](handleError(_0x41f893,null));};
\ No newline at end of file
index 69726e6..030d94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7e1=['../../config/environment','./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x2b83c8,_0x576876){var _0x300e85=function(_0x46da70){while(--_0x46da70){_0x2b83c8['push'](_0x2b83c8['shift']());}};_0x300e85(++_0x576876);}(_0xf7e1,0x170));var _0x1f7e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xf7e1[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x1f7e('0x0'));var util=require(_0x1f7e('0x1'));var logger=require(_0x1f7e('0x2'))(_0x1f7e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f7e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f7e('0x5'));var config=require(_0x1f7e('0x6'));var attributes=require(_0x1f7e('0x7'));module['exports']=function(_0x36892f,_0x542097){return _0x36892f['define'](_0x1f7e('0x8'),attributes,{'tableName':_0x1f7e('0x9'),'paranoid':![],'indexes':[{'name':_0x1f7e('0xa'),'fields':[_0x1f7e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b87=['util','moment','bluebird','../../config/environment','exports','define','report_fax_transfer','lodash'];(function(_0xdaadb0,_0x57c953){var _0x3ef04f=function(_0x27f09b){while(--_0x27f09b){_0xdaadb0['push'](_0xdaadb0['shift']());}};_0x3ef04f(++_0x57c953);}(_0x9b87,0x7f));var _0x79b8=function(_0x92e1f2,_0x2946f7){_0x92e1f2=_0x92e1f2-0x0;var _0x303264=_0x9b87[_0x92e1f2];return _0x303264;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x79b8('0x2'));var BPromise=require(_0x79b8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x79b8('0x4'));var attributes=require('./faxTransferReport.attributes');module[_0x79b8('0x5')]=function(_0x3e100d,_0x4f2771){return _0x3e100d[_0x79b8('0x6')]('FaxTransferReport',attributes,{'tableName':_0x79b8('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 5e11653..54ca0a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf17a=['randomstring','ioredis','../../config/utils','../../config/logger','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x5a6e32,_0x573b46){var _0x168e07=function(_0x427e62){while(--_0x427e62){_0x5a6e32['push'](_0x5a6e32['shift']());}};_0x168e07(++_0x573b46);}(_0xf17a,0xc5));var _0xaf17=function(_0x277b85,_0x2f9686){_0x277b85=_0x277b85-0x0;var _0x56853f=_0xf17a[_0x277b85];return _0x56853f;};'use strict';var _=require(_0xaf17('0x0'));var util=require(_0xaf17('0x1'));var moment=require('moment');var BPromise=require(_0xaf17('0x2'));var rs=require(_0xaf17('0x3'));var fs=require('fs');var Redis=require(_0xaf17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf17('0x5'));var logger=require(_0xaf17('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaf17('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x26d1bd,_0x3307e2,_0x13726a){return new BPromise(function(_0x48117d,_0x33b3d2){return client[_0xaf17('0x8')](_0x26d1bd,_0x13726a)[_0xaf17('0x9')](function(_0x2e25cf){logger[_0xaf17('0xa')](_0xaf17('0xb'),_0x3307e2,_0xaf17('0xc'));logger[_0xaf17('0xd')](_0xaf17('0xe'),_0x3307e2,_0xaf17('0xc'),JSON[_0xaf17('0xf')](_0x2e25cf));if(_0x2e25cf[_0xaf17('0x10')]){if(_0x2e25cf[_0xaf17('0x10')][_0xaf17('0x11')]===0x1f4){logger['error'](_0xaf17('0xb'),_0x3307e2,_0x2e25cf['error']['message']);return _0x33b3d2(_0x2e25cf['error'][_0xaf17('0x12')]);}logger[_0xaf17('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x3307e2,_0x2e25cf['error'][_0xaf17('0x12')]);return _0x48117d(_0x2e25cf[_0xaf17('0x10')]['message']);}else{logger[_0xaf17('0xa')](_0xaf17('0xb'),_0x3307e2,_0xaf17('0xc'));_0x48117d(_0x2e25cf['result']['message']);}})[_0xaf17('0x13')](function(_0x281650){logger[_0xaf17('0x10')](_0xaf17('0xb'),_0x3307e2,_0x281650);_0x33b3d2(_0x281650);});});}
\ No newline at end of file
+var _0xf753=['request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xb5b581,_0xa70a1b){var _0x8293cd=function(_0x1a3242){while(--_0x1a3242){_0xb5b581['push'](_0xb5b581['shift']());}};_0x8293cd(++_0xa70a1b);}(_0xf753,0x1ac));var _0x3f75=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0xf753[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0x3f75('0x0'));var util=require('util');var moment=require(_0x3f75('0x1'));var BPromise=require(_0x3f75('0x2'));var rs=require(_0x3f75('0x3'));var fs=require('fs');var Redis=require(_0x3f75('0x4'));var db=require(_0x3f75('0x5'))['db'];var utils=require(_0x3f75('0x6'));var logger=require(_0x3f75('0x7'))(_0x3f75('0x8'));var config=require(_0x3f75('0x9'));var jayson=require(_0x3f75('0xa'));var client=jayson['client'][_0x3f75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a9f2a,_0x2ad777,_0x239ab0){return new BPromise(function(_0x445448,_0x20d1bd){return client[_0x3f75('0xc')](_0x4a9f2a,_0x239ab0)[_0x3f75('0xd')](function(_0x1fa527){logger['info'](_0x3f75('0xe'),_0x2ad777,_0x3f75('0xf'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2ad777,_0x3f75('0xf'),JSON[_0x3f75('0x10')](_0x1fa527));if(_0x1fa527[_0x3f75('0x11')]){if(_0x1fa527['error']['code']===0x1f4){logger['error'](_0x3f75('0xe'),_0x2ad777,_0x1fa527[_0x3f75('0x11')][_0x3f75('0x12')]);return _0x20d1bd(_0x1fa527['error']['message']);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2ad777,_0x1fa527[_0x3f75('0x11')][_0x3f75('0x12')]);return _0x445448(_0x1fa527['error'][_0x3f75('0x12')]);}else{logger[_0x3f75('0x13')](_0x3f75('0xe'),_0x2ad777,_0x3f75('0xf'));_0x445448(_0x1fa527[_0x3f75('0x14')][_0x3f75('0x12')]);}})[_0x3f75('0x15')](function(_0x55a7ab){logger[_0x3f75('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x2ad777,_0x55a7ab);_0x20d1bd(_0x55a7ab);});});}
\ No newline at end of file
index 72f229e..7e0ce2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c7=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x28dd58,_0x4336e9){var _0x2b0f07=function(_0x422434){while(--_0x422434){_0x28dd58['push'](_0x28dd58['shift']());}};_0x2b0f07(++_0x4336e9);}(_0x73c7,0x1a7));var _0x773c=function(_0x9a3e0b,_0x19b953){_0x9a3e0b=_0x9a3e0b-0x0;var _0x36cbbe=_0x73c7[_0x9a3e0b];return _0x36cbbe;};'use strict';var multer=require(_0x773c('0x0'));var util=require(_0x773c('0x1'));var path=require(_0x773c('0x2'));var timeout=require(_0x773c('0x3'));var express=require(_0x773c('0x4'));var router=express[_0x773c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x773c('0x6'));var interaction=require(_0x773c('0x7'));var config=require(_0x773c('0x8'));var controller=require(_0x773c('0x9'));router[_0x773c('0xa')]('/',auth[_0x773c('0xb')](),controller[_0x773c('0xc')]);router['get'](_0x773c('0xd'),auth['isAuthenticated'](),controller[_0x773c('0xe')]);router[_0x773c('0xa')](_0x773c('0xf'),auth[_0x773c('0xb')](),controller[_0x773c('0x10')]);router[_0x773c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x773c('0x12')]('/:id',auth[_0x773c('0xb')](),controller[_0x773c('0x13')]);router['delete'](_0x773c('0xf'),auth[_0x773c('0xb')](),controller[_0x773c('0x14')]);module[_0x773c('0x15')]=router;
\ No newline at end of file
+var _0x868e=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x5565b7,_0x2677f7){var _0x5321fc=function(_0x45d69d){while(--_0x45d69d){_0x5565b7['push'](_0x5565b7['shift']());}};_0x5321fc(++_0x2677f7);}(_0x868e,0xd1));var _0xe868=function(_0x316297,_0x35b8e4){_0x316297=_0x316297-0x0;var _0x126eb1=_0x868e[_0x316297];return _0x126eb1;};'use strict';var multer=require(_0xe868('0x0'));var util=require('util');var path=require(_0xe868('0x1'));var timeout=require(_0xe868('0x2'));var express=require(_0xe868('0x3'));var router=express[_0xe868('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe868('0x5'));var interaction=require(_0xe868('0x6'));var config=require(_0xe868('0x7'));var controller=require('./faxTransferReport.controller');router[_0xe868('0x8')]('/',auth['isAuthenticated'](),controller[_0xe868('0x9')]);router[_0xe868('0x8')]('/describe',auth[_0xe868('0xa')](),controller['describe']);router['get'](_0xe868('0xb'),auth[_0xe868('0xa')](),controller[_0xe868('0xc')]);router[_0xe868('0xd')]('/',auth[_0xe868('0xa')](),controller[_0xe868('0xe')]);router[_0xe868('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe868('0x10')]);router[_0xe868('0x11')](_0xe868('0xb'),auth[_0xe868('0xa')](),controller[_0xe868('0x12')]);module[_0xe868('0x13')]=router;
\ No newline at end of file
index 359606b..a7f4ad9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38e9=['../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dc3ee,_0x2c2716){var _0x550676=function(_0x15bb11){while(--_0x15bb11){_0x3dc3ee['push'](_0x3dc3ee['shift']());}};_0x550676(++_0x2c2716);}(_0x38e9,0xa8));var _0x938e=function(_0x3f4d55,_0x21aca6){_0x3f4d55=_0x3f4d55-0x0;var _0x3e9d17=_0x38e9[_0x3f4d55];return _0x3e9d17;};'use strict';var multer=require('multer');var util=require(_0x938e('0x0'));var path=require(_0x938e('0x1'));var timeout=require(_0x938e('0x2'));var express=require(_0x938e('0x3'));var router=express[_0x938e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x938e('0x5'));var interaction=require(_0x938e('0x6'));var config=require(_0x938e('0x7'));var controller=require(_0x938e('0x8'));router['get']('/',auth[_0x938e('0x9')](),controller[_0x938e('0xa')]);router['get']('/:id',auth[_0x938e('0x9')](),controller['show']);router[_0x938e('0xb')]('/:id/configurations',auth[_0x938e('0x9')](),controller[_0x938e('0xc')]);router['get'](_0x938e('0xd'),auth['isAuthenticated'](),controller[_0x938e('0xe')]);router['post']('/',auth[_0x938e('0x9')](),controller[_0x938e('0xf')]);router[_0x938e('0x10')](_0x938e('0x11'),auth['isAuthenticated'](),controller[_0x938e('0x12')]);router[_0x938e('0x13')](_0x938e('0x14'),auth[_0x938e('0x9')](),controller[_0x938e('0x15')]);router[_0x938e('0x16')](_0x938e('0x14'),auth[_0x938e('0x9')](),controller[_0x938e('0x17')]);module[_0x938e('0x18')]=router;
\ No newline at end of file
+var _0x52b4=['../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x52b4,0x8f));var _0x452b=function(_0x4e7f39,_0x16e7b3){_0x4e7f39=_0x4e7f39-0x0;var _0x815784=_0x52b4[_0x4e7f39];return _0x815784;};'use strict';var multer=require(_0x452b('0x0'));var util=require(_0x452b('0x1'));var path=require(_0x452b('0x2'));var timeout=require(_0x452b('0x3'));var express=require('express');var router=express[_0x452b('0x4')]();var fs_extra=require(_0x452b('0x5'));var auth=require(_0x452b('0x6'));var interaction=require(_0x452b('0x7'));var config=require(_0x452b('0x8'));var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x452b('0x9')]);router['get'](_0x452b('0xa'),auth[_0x452b('0xb')](),controller[_0x452b('0xc')]);router[_0x452b('0xd')](_0x452b('0xe'),auth['isAuthenticated'](),controller[_0x452b('0xf')]);router[_0x452b('0xd')](_0x452b('0x10'),auth['isAuthenticated'](),controller[_0x452b('0x11')]);router[_0x452b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x452b('0x12')](_0x452b('0xe'),auth[_0x452b('0xb')](),controller[_0x452b('0x13')]);router[_0x452b('0x14')](_0x452b('0xa'),auth[_0x452b('0xb')](),controller[_0x452b('0x15')]);router[_0x452b('0x16')](_0x452b('0xa'),auth['isAuthenticated'](),controller[_0x452b('0x17')]);module[_0x452b('0x18')]=router;
\ No newline at end of file
index d9aff4b..d7aa831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62d5=['ENUM','basic','integrationTab','newTab','exports','STRING'];(function(_0x7d9fa7,_0x1582d2){var _0x4012d3=function(_0x3f44c6){while(--_0x3f44c6){_0x7d9fa7['push'](_0x7d9fa7['shift']());}};_0x4012d3(++_0x1582d2);}(_0x62d5,0x94));var _0x562d=function(_0x552097,_0x225983){_0x552097=_0x552097-0x0;var _0x2a98a0=_0x62d5[_0x552097];return _0x2a98a0;};'use strict';var Sequelize=require('sequelize');module[_0x562d('0x0')]={'name':{'type':Sequelize[_0x562d('0x1')]},'description':{'type':Sequelize[_0x562d('0x1')]},'username':{'type':Sequelize[_0x562d('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x562d('0x2')](_0x562d('0x3')),'defaultValue':_0x562d('0x3')},'password':{'type':Sequelize[_0x562d('0x1')]},'consumerKey':{'type':Sequelize[_0x562d('0x1')]},'consumerSecret':{'type':Sequelize[_0x562d('0x1')]},'token':{'type':Sequelize[_0x562d('0x1')]},'tokenSecret':{'type':Sequelize[_0x562d('0x1')]},'serverUrl':{'type':Sequelize[_0x562d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x562d('0x2')](_0x562d('0x4'),_0x562d('0x5')),'defaultValue':_0x562d('0x4')}};
\ No newline at end of file
+var _0x1ccc=['exports','STRING','ENUM','basic','newTab','integrationTab','sequelize'];(function(_0x173c03,_0x4da67d){var _0x3bce03=function(_0x18eaef){while(--_0x18eaef){_0x173c03['push'](_0x173c03['shift']());}};_0x3bce03(++_0x4da67d);}(_0x1ccc,0x1b1));var _0xc1cc=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x1ccc[_0x40b3f2];return _0x4ce90c;};'use strict';var Sequelize=require(_0xc1cc('0x0'));module[_0xc1cc('0x1')]={'name':{'type':Sequelize[_0xc1cc('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc1cc('0x2')]},'remoteUri':{'type':Sequelize[_0xc1cc('0x2')]},'authType':{'type':Sequelize[_0xc1cc('0x3')](_0xc1cc('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xc1cc('0x2')]},'consumerKey':{'type':Sequelize[_0xc1cc('0x2')]},'consumerSecret':{'type':Sequelize[_0xc1cc('0x2')]},'token':{'type':Sequelize[_0xc1cc('0x2')]},'tokenSecret':{'type':Sequelize[_0xc1cc('0x2')]},'serverUrl':{'type':Sequelize[_0xc1cc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc1cc('0x3')]('integrationTab',_0xc1cc('0x5')),'defaultValue':_0xc1cc('0x6')}};
\ No newline at end of file
index 432621b..47ead43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b05=['DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','Authorization','format','Basic\x20%s','%s:%s','toString','base64','active','error','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','end','stack','name','send','DeskAccount','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','intersection','find','create','body','params','destroy','getConfigurations','findOne','DeskConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x4a1802,_0x1e9208){var _0x376145=function(_0x1b0673){while(--_0x1b0673){_0x4a1802['push'](_0x4a1802['shift']());}};_0x376145(++_0x1e9208);}(_0x6b05,0x178));var _0x56b0=function(_0x4f7c09,_0x5a42da){_0x4f7c09=_0x4f7c09-0x0;var _0x5572c4=_0x6b05[_0x4f7c09];return _0x5572c4;};'use strict';var emlformat=require(_0x56b0('0x0'));var rimraf=require(_0x56b0('0x1'));var zipdir=require(_0x56b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56b0('0x3'));var moment=require(_0x56b0('0x4'));var BPromise=require(_0x56b0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56b0('0x6'));var sox=require(_0x56b0('0x7'));var csv=require(_0x56b0('0x8'));var ejs=require(_0x56b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56b0('0xa'));var squel=require(_0x56b0('0xb'));var crypto=require(_0x56b0('0xc'));var jsforce=require(_0x56b0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x56b0('0x8'));var querystring=require(_0x56b0('0xe'));var Papa=require(_0x56b0('0xf'));var Redis=require(_0x56b0('0x10'));var authService=require(_0x56b0('0x11'));var qs=require(_0x56b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56b0('0x13'));var logger=require(_0x56b0('0x14'))(_0x56b0('0x15'));var utils=require(_0x56b0('0x16'));var config=require(_0x56b0('0x17'));var licenseUtil=require(_0x56b0('0x18'));var db=require(_0x56b0('0x19'))['db'];var integrations=require(_0x56b0('0x1a'));function respondWithStatusCode(_0x59d3da,_0x259da5){_0x259da5=_0x259da5||0xcc;return function(_0x226008){if(_0x226008){return _0x59d3da[_0x56b0('0x1b')](_0x259da5);}return _0x59d3da[_0x56b0('0x1c')](_0x259da5)['end']();};}function respondWithResult(_0x4aeeb9,_0x4ebc86){_0x4ebc86=_0x4ebc86||0xc8;return function(_0xa26905){if(_0xa26905){return _0x4aeeb9['status'](_0x4ebc86)['json'](_0xa26905);}};}function respondWithFilteredResult(_0x12830e,_0x368b10){return function(_0x3613de){if(_0x3613de){var _0x26cc5a=typeof _0x368b10['offset']==='undefined'&&typeof _0x368b10['limit']===_0x56b0('0x1d');var _0x1d99f5=_0x3613de[_0x56b0('0x1e')];var _0x1d569d=_0x26cc5a?0x0:_0x368b10[_0x56b0('0x1f')];var _0x4dfc6f=_0x26cc5a?_0x3613de[_0x56b0('0x1e')]:_0x368b10[_0x56b0('0x1f')]+_0x368b10[_0x56b0('0x20')];var _0x5cf17f;if(_0x4dfc6f>=_0x1d99f5){_0x4dfc6f=_0x1d99f5;_0x5cf17f=0xc8;}else{_0x5cf17f=0xce;}_0x12830e['status'](_0x5cf17f);return _0x12830e[_0x56b0('0x21')](_0x56b0('0x22'),_0x1d569d+'-'+_0x4dfc6f+'/'+_0x1d99f5)[_0x56b0('0x23')](_0x3613de);}return null;};}function patchUpdates(_0x57fdfb){return function(_0x4c1410){try{jsonpatch['apply'](_0x4c1410,_0x57fdfb,!![]);}catch(_0x4fcb14){return BPromise[_0x56b0('0x24')](_0x4fcb14);}return _0x4c1410[_0x56b0('0x25')]();};}function saveUpdates(_0x1480df,_0x586b5b){return function(_0x983503){if(_0x983503){return _0x983503[_0x56b0('0x26')](_0x1480df)[_0x56b0('0x27')](function(_0x45d556){return _0x45d556;});}return null;};}function removeEntity(_0x50c770,_0x83cb45){return function(_0x3f8d62){if(_0x3f8d62){return _0x3f8d62['destroy']()[_0x56b0('0x27')](function(){_0x50c770[_0x56b0('0x1c')](0xcc)[_0x56b0('0x28')]();});}};}function handleEntityNotFound(_0x5ad137,_0x52fcb9){return function(_0x49325a){if(!_0x49325a){_0x5ad137[_0x56b0('0x1b')](0x194);}return _0x49325a;};}function handleError(_0x34dd4d,_0x2b6e02){_0x2b6e02=_0x2b6e02||0x1f4;return function(_0x4d86b4){logger['error'](_0x4d86b4[_0x56b0('0x29')]);if(_0x4d86b4[_0x56b0('0x2a')]){delete _0x4d86b4[_0x56b0('0x2a')];}_0x34dd4d[_0x56b0('0x1c')](_0x2b6e02)[_0x56b0('0x2b')](_0x4d86b4);};}exports['index']=function(_0x57ce57,_0x2a2213){var _0x153053={},_0xbf84b6={},_0x1ec2bd={'count':0x0,'rows':[]};var _0xdce6e7=_['map'](db[_0x56b0('0x2c')][_0x56b0('0x2d')],function(_0x458169){return{'name':_0x458169[_0x56b0('0x2e')],'type':_0x458169[_0x56b0('0x2f')][_0x56b0('0x30')]};});_0xbf84b6['model']=_[_0x56b0('0x31')](_0xdce6e7,'name');_0xbf84b6[_0x56b0('0x32')]=_['keys'](_0x57ce57[_0x56b0('0x32')]);_0xbf84b6[_0x56b0('0x33')]=_['intersection'](_0xbf84b6[_0x56b0('0x34')],_0xbf84b6[_0x56b0('0x32')]);_0x153053[_0x56b0('0x35')]=_['intersection'](_0xbf84b6[_0x56b0('0x34')],qs[_0x56b0('0x36')](_0x57ce57['query'][_0x56b0('0x36')]));_0x153053['attributes']=_0x153053[_0x56b0('0x35')]['length']?_0x153053[_0x56b0('0x35')]:_0xbf84b6['model'];if(!_0x57ce57[_0x56b0('0x32')][_0x56b0('0x37')](_0x56b0('0x38'))){_0x153053['limit']=qs['limit'](_0x57ce57[_0x56b0('0x32')][_0x56b0('0x20')]);_0x153053[_0x56b0('0x1f')]=qs[_0x56b0('0x1f')](_0x57ce57[_0x56b0('0x32')]['offset']);}_0x153053[_0x56b0('0x39')]=qs['sort'](_0x57ce57[_0x56b0('0x32')][_0x56b0('0x3a')]);_0x153053[_0x56b0('0x3b')]=qs[_0x56b0('0x33')](_[_0x56b0('0x3c')](_0x57ce57[_0x56b0('0x32')],_0xbf84b6['filters']),_0xdce6e7);if(_0x57ce57[_0x56b0('0x32')][_0x56b0('0x3d')]){_0x153053[_0x56b0('0x3b')]=_[_0x56b0('0x3e')](_0x153053[_0x56b0('0x3b')],{'$or':_['map'](_0xdce6e7,function(_0x26fa38){if(_0x26fa38[_0x56b0('0x2f')]!==_0x56b0('0x3f')){var _0x41be95={};_0x41be95[_0x26fa38['name']]={'$like':'%'+_0x57ce57[_0x56b0('0x32')][_0x56b0('0x3d')]+'%'};return _0x41be95;}})});}_0x153053=_['merge']({},_0x153053,_0x57ce57[_0x56b0('0x40')]);var _0x22610e={'where':_0x153053[_0x56b0('0x3b')]};return db['DeskAccount'][_0x56b0('0x1e')](_0x22610e)[_0x56b0('0x27')](function(_0x33e69e){_0x1ec2bd['count']=_0x33e69e;if(_0x57ce57[_0x56b0('0x32')][_0x56b0('0x41')]){_0x153053[_0x56b0('0x42')]=[{'all':!![]}];}return db['DeskAccount'][_0x56b0('0x43')](_0x153053);})[_0x56b0('0x27')](function(_0x45c299){_0x1ec2bd[_0x56b0('0x44')]=_0x45c299;return _0x1ec2bd;})[_0x56b0('0x27')](respondWithFilteredResult(_0x2a2213,_0x153053))[_0x56b0('0x45')](handleError(_0x2a2213,null));};exports['show']=function(_0x37c6dd,_0x3bf538){var _0x18ade2={'raw':![],'where':{'id':_0x37c6dd['params']['id']}},_0x319c55={};_0x319c55['model']=_[_0x56b0('0x46')](db[_0x56b0('0x2c')]['rawAttributes']);_0x319c55[_0x56b0('0x32')]=_[_0x56b0('0x46')](_0x37c6dd[_0x56b0('0x32')]);_0x319c55[_0x56b0('0x33')]=_[_0x56b0('0x47')](_0x319c55[_0x56b0('0x34')],_0x319c55[_0x56b0('0x32')]);_0x18ade2[_0x56b0('0x35')]=_[_0x56b0('0x47')](_0x319c55['model'],qs[_0x56b0('0x36')](_0x37c6dd[_0x56b0('0x32')][_0x56b0('0x36')]));_0x18ade2[_0x56b0('0x35')]=_0x18ade2['attributes']['length']?_0x18ade2['attributes']:_0x319c55[_0x56b0('0x34')];if(_0x37c6dd['query']['includeAll']){_0x18ade2['include']=[{'all':!![]}];}_0x18ade2=_['merge']({},_0x18ade2,_0x37c6dd[_0x56b0('0x40')]);return db[_0x56b0('0x2c')][_0x56b0('0x48')](_0x18ade2)[_0x56b0('0x27')](handleEntityNotFound(_0x3bf538,null))[_0x56b0('0x27')](respondWithResult(_0x3bf538,null))[_0x56b0('0x45')](handleError(_0x3bf538,null));};exports[_0x56b0('0x49')]=function(_0x33f962,_0x1a7594){return db[_0x56b0('0x2c')]['create'](_0x33f962['body'],{})['then'](respondWithResult(_0x1a7594,0xc9))['catch'](handleError(_0x1a7594,null));};exports[_0x56b0('0x26')]=function(_0x515f78,_0x3843b){if(_0x515f78[_0x56b0('0x4a')]['id']){delete _0x515f78[_0x56b0('0x4a')]['id'];}return db[_0x56b0('0x2c')]['find']({'where':{'id':_0x515f78[_0x56b0('0x4b')]['id']}})[_0x56b0('0x27')](handleEntityNotFound(_0x3843b,null))[_0x56b0('0x27')](saveUpdates(_0x515f78[_0x56b0('0x4a')],null))['then'](respondWithResult(_0x3843b,null))[_0x56b0('0x45')](handleError(_0x3843b,null));};exports[_0x56b0('0x4c')]=function(_0x3cfc1d,_0x34d5a9){return db[_0x56b0('0x2c')][_0x56b0('0x48')]({'where':{'id':_0x3cfc1d['params']['id']}})[_0x56b0('0x27')](handleEntityNotFound(_0x34d5a9,null))[_0x56b0('0x27')](removeEntity(_0x34d5a9,null))[_0x56b0('0x45')](handleError(_0x34d5a9,null));};exports[_0x56b0('0x4d')]=function(_0x510a23,_0x160d8c,_0x1f09e8){var _0x53b50d={};var _0x542d99={};var _0x3a6146;var _0x9210f8;return db[_0x56b0('0x2c')][_0x56b0('0x4e')]({'where':{'id':_0x510a23[_0x56b0('0x4b')]['id']}})[_0x56b0('0x27')](handleEntityNotFound(_0x160d8c,null))[_0x56b0('0x27')](function(_0x4af5d3){if(_0x4af5d3){_0x3a6146=_0x4af5d3;_0x542d99['model']=_['keys'](db[_0x56b0('0x4f')]['rawAttributes']);_0x542d99['query']=_[_0x56b0('0x46')](_0x510a23['query']);_0x542d99[_0x56b0('0x33')]=_[_0x56b0('0x47')](_0x542d99['model'],_0x542d99[_0x56b0('0x32')]);_0x53b50d['attributes']=_['intersection'](_0x542d99['model'],qs[_0x56b0('0x36')](_0x510a23[_0x56b0('0x32')][_0x56b0('0x36')]));_0x53b50d[_0x56b0('0x35')]=_0x53b50d['attributes'][_0x56b0('0x50')]?_0x53b50d[_0x56b0('0x35')]:_0x542d99[_0x56b0('0x34')];_0x53b50d[_0x56b0('0x39')]=qs['sort'](_0x510a23['query'][_0x56b0('0x3a')]);_0x53b50d['where']=qs['filters'](_['pick'](_0x510a23[_0x56b0('0x32')],_0x542d99[_0x56b0('0x33')]));if(_0x510a23['query'][_0x56b0('0x3d')]){_0x53b50d[_0x56b0('0x3b')]=_[_0x56b0('0x3e')](_0x53b50d['where'],{'$or':_[_0x56b0('0x31')](_0x53b50d['attributes'],function(_0x54144d){var _0x284496={};_0x284496[_0x54144d]={'$like':'%'+_0x510a23['query'][_0x56b0('0x3d')]+'%'};return _0x284496;})});}_0x53b50d=_[_0x56b0('0x3e')]({},_0x53b50d,_0x510a23[_0x56b0('0x40')]);return _0x3a6146[_0x56b0('0x4d')](_0x53b50d);}})[_0x56b0('0x27')](function(_0x5ed821){if(_0x5ed821){_0x9210f8=_0x5ed821[_0x56b0('0x50')];if(!_0x510a23[_0x56b0('0x32')][_0x56b0('0x37')](_0x56b0('0x38'))){_0x53b50d[_0x56b0('0x20')]=qs[_0x56b0('0x20')](_0x510a23[_0x56b0('0x32')]['limit']);_0x53b50d[_0x56b0('0x1f')]=qs[_0x56b0('0x1f')](_0x510a23[_0x56b0('0x32')][_0x56b0('0x1f')]);}return _0x3a6146[_0x56b0('0x4d')](_0x53b50d);}})[_0x56b0('0x27')](function(_0x148b02){if(_0x148b02){return _0x148b02?{'count':_0x9210f8,'rows':_0x148b02}:null;}})[_0x56b0('0x27')](respondWithResult(_0x160d8c,null))[_0x56b0('0x45')](handleError(_0x160d8c,null));};exports[_0x56b0('0x51')]=function(_0x534af9,_0x49216c,_0x2176de){if(_0x534af9[_0x56b0('0x4a')]['id']){delete _0x534af9['body']['id'];}return db[_0x56b0('0x2c')][_0x56b0('0x4e')]({'where':{'id':_0x534af9[_0x56b0('0x4b')]['id']}})[_0x56b0('0x27')](handleEntityNotFound(_0x49216c,null))[_0x56b0('0x27')](function(_0x1b83ce){if(_0x1b83ce){_0x534af9[_0x56b0('0x4a')][_0x56b0('0x52')]=_0x1b83ce['id'];_0x534af9[_0x56b0('0x4a')][_0x56b0('0x53')]=integrations[_0x56b0('0x54')](_0x534af9['body'][_0x56b0('0x55')],_0x534af9[_0x56b0('0x4a')][_0x56b0('0x2f')]);_0x534af9['body'][_0x56b0('0x56')]=integrations[_0x56b0('0x57')](_0x534af9['body']['channel'],_0x534af9[_0x56b0('0x4a')][_0x56b0('0x2f')]);return db['DeskConfiguration'][_0x56b0('0x49')](_0x534af9[_0x56b0('0x4a')],{'include':[{'model':db[_0x56b0('0x58')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x56b0('0x56')}]});}return null;})[_0x56b0('0x27')](respondWithResult(_0x49216c,null))[_0x56b0('0x45')](handleError(_0x49216c,null));};exports[_0x56b0('0x59')]=function(_0xd3e8ff,_0x214c5d,_0x25d99c){var _0x4915c3=[{'name':_0x56b0('0x5a'),'label':_0x56b0('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 _0x3e5f77='';return db[_0x56b0('0x2c')]['findOne']({'where':{'id':_0xd3e8ff[_0x56b0('0x4b')]['id']},'attributes':['id',_0x56b0('0x5b'),_0x56b0('0x5c'),_0x56b0('0x5d'),_0x56b0('0x5e'),_0x56b0('0x5f'),_0x56b0('0x60'),_0x56b0('0x61'),_0x56b0('0x62')]})[_0x56b0('0x27')](handleEntityNotFound(_0x214c5d,null))['then'](function(_0x2ddaca){if(_0x2ddaca){_0x3e5f77=_0x2ddaca[_0x56b0('0x5b')];var _0x20a596=_0x3e5f77[_0x56b0('0x63')](-0x1);if(_0x20a596==='/'){_0x3e5f77=_0x3e5f77[_0x56b0('0x64')](0x0,_0x3e5f77[_0x56b0('0x65')](_0x20a596));}var _0xb055e7={'method':'GET','uri':util['format'](_0x56b0('0x66'),_0x3e5f77),'headers':{'Content-Type':'application/json','Accept':_0x56b0('0x67')},'json':!![]};if(_0x2ddaca[_0x56b0('0x5c')]===_0x56b0('0x68')){_0xb055e7['headers'][_0x56b0('0x69')]=util[_0x56b0('0x6a')](_0x56b0('0x6b'),new Buffer(util[_0x56b0('0x6a')](_0x56b0('0x6c'),_0x2ddaca[_0x56b0('0x5d')],_0x2ddaca[_0x56b0('0x5e')]))[_0x56b0('0x6d')](_0x56b0('0x6e')));}return rp(_0xb055e7)[_0x56b0('0x27')](function(_0x29eb6b){return _0x4915c3['concat'](_[_0x56b0('0x31')](_0x29eb6b['_embedded']['entries'],function(_0x3130b3){return{'id':_0x3130b3['name'],'name':_0x3130b3['name'],'type':_0x3130b3['type'],'active':_0x3130b3[_0x56b0('0x6f')],'label':_0x3130b3['label'],'custom':!![]};}));});}})[_0x56b0('0x27')](function(_0x2e1a72){return{'count':_0x2e1a72['length'],'rows':_0x2e1a72};})[_0x56b0('0x27')](respondWithResult(_0x214c5d,null))[_0x56b0('0x45')](function(_0x137bf5){var _0x5888fe=_0xd3e8ff['query']['test']?0x1f4:_0x137bf5['statusCode']||0x1f4;logger[_0x56b0('0x70')](_0x56b0('0x71'),_0x56b0('0x59'),_0x5888fe,JSON[_0x56b0('0x72')](_0x137bf5));delete _0x137bf5[_0x56b0('0x2a')];if(_0x5888fe===0x191){_0x5888fe=0x190;}_0x214c5d['status'](_0x5888fe)['send'](_0xd3e8ff[_0x56b0('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x137bf5[_0x56b0('0x73')]}:_0x137bf5);});};
\ No newline at end of file
+var _0xadb0=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','length','find','create','body','destroy','getConfigurations','DeskConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','consumerKey','consumerSecret','tokenSecret','slice','substring','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','entries','active','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x48d233,_0x156716){var _0x2984ae=function(_0x5adc23){while(--_0x5adc23){_0x48d233['push'](_0x48d233['shift']());}};_0x2984ae(++_0x156716);}(_0xadb0,0xcf));var _0x0adb=function(_0x496e9d,_0x12567a){_0x496e9d=_0x496e9d-0x0;var _0x5c5a13=_0xadb0[_0x496e9d];return _0x5c5a13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0adb('0x0'));var zipdir=require(_0x0adb('0x1'));var jsonpatch=require(_0x0adb('0x2'));var rp=require(_0x0adb('0x3'));var moment=require('moment');var BPromise=require(_0x0adb('0x4'));var Mustache=require(_0x0adb('0x5'));var util=require('util');var path=require(_0x0adb('0x6'));var sox=require(_0x0adb('0x7'));var csv=require(_0x0adb('0x8'));var ejs=require(_0x0adb('0x9'));var fs=require('fs');var fs_extra=require(_0x0adb('0xa'));var _=require(_0x0adb('0xb'));var squel=require(_0x0adb('0xc'));var crypto=require(_0x0adb('0xd'));var jsforce=require(_0x0adb('0xe'));var deskjs=require(_0x0adb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0adb('0x10'));var Papa=require(_0x0adb('0x11'));var Redis=require(_0x0adb('0x12'));var authService=require(_0x0adb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0adb('0x14'));var hardwareService=require(_0x0adb('0x15'));var logger=require('../../config/logger')(_0x0adb('0x16'));var utils=require(_0x0adb('0x17'));var config=require(_0x0adb('0x18'));var licenseUtil=require(_0x0adb('0x19'));var db=require(_0x0adb('0x1a'))['db'];var integrations=require(_0x0adb('0x1b'));function respondWithStatusCode(_0x151018,_0x4ce8cf){_0x4ce8cf=_0x4ce8cf||0xcc;return function(_0x285488){if(_0x285488){return _0x151018[_0x0adb('0x1c')](_0x4ce8cf);}return _0x151018[_0x0adb('0x1d')](_0x4ce8cf)['end']();};}function respondWithResult(_0x5d75b3,_0x215a32){_0x215a32=_0x215a32||0xc8;return function(_0x51b9d5){if(_0x51b9d5){return _0x5d75b3[_0x0adb('0x1d')](_0x215a32)['json'](_0x51b9d5);}};}function respondWithFilteredResult(_0x431726,_0x40a8b9){return function(_0x209ad1){if(_0x209ad1){var _0x5ac60f=typeof _0x40a8b9[_0x0adb('0x1e')]===_0x0adb('0x1f')&&typeof _0x40a8b9[_0x0adb('0x20')]===_0x0adb('0x1f');var _0x33876d=_0x209ad1[_0x0adb('0x21')];var _0x2cee9a=_0x5ac60f?0x0:_0x40a8b9[_0x0adb('0x1e')];var _0x5505cd=_0x5ac60f?_0x209ad1['count']:_0x40a8b9[_0x0adb('0x1e')]+_0x40a8b9['limit'];var _0x5a9eb5;if(_0x5505cd>=_0x33876d){_0x5505cd=_0x33876d;_0x5a9eb5=0xc8;}else{_0x5a9eb5=0xce;}_0x431726['status'](_0x5a9eb5);return _0x431726['set'](_0x0adb('0x22'),_0x2cee9a+'-'+_0x5505cd+'/'+_0x33876d)['json'](_0x209ad1);}return null;};}function patchUpdates(_0xa05956){return function(_0x3f7aba){try{jsonpatch[_0x0adb('0x23')](_0x3f7aba,_0xa05956,!![]);}catch(_0x5e0d44){return BPromise[_0x0adb('0x24')](_0x5e0d44);}return _0x3f7aba['save']();};}function saveUpdates(_0x15be10,_0x2f57f0){return function(_0x2689ac){if(_0x2689ac){return _0x2689ac[_0x0adb('0x25')](_0x15be10)['then'](function(_0x1be11c){return _0x1be11c;});}return null;};}function removeEntity(_0x74fbd4,_0xa81c72){return function(_0x57604e){if(_0x57604e){return _0x57604e['destroy']()[_0x0adb('0x26')](function(){_0x74fbd4[_0x0adb('0x1d')](0xcc)[_0x0adb('0x27')]();});}};}function handleEntityNotFound(_0xda79fd,_0x1b230d){return function(_0x394ded){if(!_0x394ded){_0xda79fd['sendStatus'](0x194);}return _0x394ded;};}function handleError(_0x3cf06d,_0xb99939){_0xb99939=_0xb99939||0x1f4;return function(_0x493134){logger[_0x0adb('0x28')](_0x493134[_0x0adb('0x29')]);if(_0x493134[_0x0adb('0x2a')]){delete _0x493134['name'];}_0x3cf06d['status'](_0xb99939)[_0x0adb('0x2b')](_0x493134);};}exports[_0x0adb('0x2c')]=function(_0x2dfeb2,_0x4eb22e){var _0x235c3d={},_0x57139c={},_0x4cc3ff={'count':0x0,'rows':[]};var _0x31c00b=_['map'](db[_0x0adb('0x2d')][_0x0adb('0x2e')],function(_0x2e9cfa){return{'name':_0x2e9cfa[_0x0adb('0x2f')],'type':_0x2e9cfa[_0x0adb('0x30')]['key']};});_0x57139c['model']=_['map'](_0x31c00b,_0x0adb('0x2a'));_0x57139c[_0x0adb('0x31')]=_['keys'](_0x2dfeb2[_0x0adb('0x31')]);_0x57139c[_0x0adb('0x32')]=_[_0x0adb('0x33')](_0x57139c[_0x0adb('0x34')],_0x57139c['query']);_0x235c3d['attributes']=_[_0x0adb('0x33')](_0x57139c[_0x0adb('0x34')],qs[_0x0adb('0x35')](_0x2dfeb2[_0x0adb('0x31')][_0x0adb('0x35')]));_0x235c3d['attributes']=_0x235c3d['attributes']['length']?_0x235c3d[_0x0adb('0x36')]:_0x57139c[_0x0adb('0x34')];if(!_0x2dfeb2[_0x0adb('0x31')][_0x0adb('0x37')](_0x0adb('0x38'))){_0x235c3d['limit']=qs['limit'](_0x2dfeb2['query'][_0x0adb('0x20')]);_0x235c3d[_0x0adb('0x1e')]=qs['offset'](_0x2dfeb2['query'][_0x0adb('0x1e')]);}_0x235c3d[_0x0adb('0x39')]=qs[_0x0adb('0x3a')](_0x2dfeb2[_0x0adb('0x31')][_0x0adb('0x3a')]);_0x235c3d[_0x0adb('0x3b')]=qs['filters'](_['pick'](_0x2dfeb2['query'],_0x57139c['filters']),_0x31c00b);if(_0x2dfeb2[_0x0adb('0x31')][_0x0adb('0x3c')]){_0x235c3d['where']=_['merge'](_0x235c3d['where'],{'$or':_[_0x0adb('0x3d')](_0x31c00b,function(_0x5d38ed){if(_0x5d38ed[_0x0adb('0x30')]!==_0x0adb('0x3e')){var _0x4ebedd={};_0x4ebedd[_0x5d38ed['name']]={'$like':'%'+_0x2dfeb2[_0x0adb('0x31')]['filter']+'%'};return _0x4ebedd;}})});}_0x235c3d=_[_0x0adb('0x3f')]({},_0x235c3d,_0x2dfeb2[_0x0adb('0x40')]);var _0x14519a={'where':_0x235c3d[_0x0adb('0x3b')]};return db['DeskAccount'][_0x0adb('0x21')](_0x14519a)[_0x0adb('0x26')](function(_0x17362f){_0x4cc3ff['count']=_0x17362f;if(_0x2dfeb2['query'][_0x0adb('0x41')]){_0x235c3d[_0x0adb('0x42')]=[{'all':!![]}];}return db[_0x0adb('0x2d')]['findAll'](_0x235c3d);})[_0x0adb('0x26')](function(_0x5c0414){_0x4cc3ff['rows']=_0x5c0414;return _0x4cc3ff;})[_0x0adb('0x26')](respondWithFilteredResult(_0x4eb22e,_0x235c3d))[_0x0adb('0x43')](handleError(_0x4eb22e,null));};exports[_0x0adb('0x44')]=function(_0x58b526,_0x554c1c){var _0x356b15={'raw':![],'where':{'id':_0x58b526[_0x0adb('0x45')]['id']}},_0x2a3b86={};_0x2a3b86[_0x0adb('0x34')]=_['keys'](db[_0x0adb('0x2d')]['rawAttributes']);_0x2a3b86[_0x0adb('0x31')]=_[_0x0adb('0x46')](_0x58b526[_0x0adb('0x31')]);_0x2a3b86[_0x0adb('0x32')]=_[_0x0adb('0x33')](_0x2a3b86[_0x0adb('0x34')],_0x2a3b86[_0x0adb('0x31')]);_0x356b15[_0x0adb('0x36')]=_[_0x0adb('0x33')](_0x2a3b86[_0x0adb('0x34')],qs['fields'](_0x58b526[_0x0adb('0x31')][_0x0adb('0x35')]));_0x356b15[_0x0adb('0x36')]=_0x356b15[_0x0adb('0x36')][_0x0adb('0x47')]?_0x356b15[_0x0adb('0x36')]:_0x2a3b86[_0x0adb('0x34')];if(_0x58b526[_0x0adb('0x31')]['includeAll']){_0x356b15['include']=[{'all':!![]}];}_0x356b15=_[_0x0adb('0x3f')]({},_0x356b15,_0x58b526[_0x0adb('0x40')]);return db[_0x0adb('0x2d')][_0x0adb('0x48')](_0x356b15)[_0x0adb('0x26')](handleEntityNotFound(_0x554c1c,null))[_0x0adb('0x26')](respondWithResult(_0x554c1c,null))['catch'](handleError(_0x554c1c,null));};exports[_0x0adb('0x49')]=function(_0xcc2ee3,_0x2387d4){return db[_0x0adb('0x2d')][_0x0adb('0x49')](_0xcc2ee3[_0x0adb('0x4a')],{})[_0x0adb('0x26')](respondWithResult(_0x2387d4,0xc9))[_0x0adb('0x43')](handleError(_0x2387d4,null));};exports['update']=function(_0x3fd586,_0x54ce6c){if(_0x3fd586[_0x0adb('0x4a')]['id']){delete _0x3fd586[_0x0adb('0x4a')]['id'];}return db[_0x0adb('0x2d')]['find']({'where':{'id':_0x3fd586['params']['id']}})['then'](handleEntityNotFound(_0x54ce6c,null))['then'](saveUpdates(_0x3fd586[_0x0adb('0x4a')],null))[_0x0adb('0x26')](respondWithResult(_0x54ce6c,null))['catch'](handleError(_0x54ce6c,null));};exports[_0x0adb('0x4b')]=function(_0x3f646b,_0xb801c8){return db['DeskAccount'][_0x0adb('0x48')]({'where':{'id':_0x3f646b['params']['id']}})[_0x0adb('0x26')](handleEntityNotFound(_0xb801c8,null))[_0x0adb('0x26')](removeEntity(_0xb801c8,null))[_0x0adb('0x43')](handleError(_0xb801c8,null));};exports[_0x0adb('0x4c')]=function(_0x12828b,_0x5f3683,_0x39318c){var _0x129cf6={};var _0x1a62d8={};var _0x4adcfb;var _0x16e16b;return db['DeskAccount']['findOne']({'where':{'id':_0x12828b[_0x0adb('0x45')]['id']}})[_0x0adb('0x26')](handleEntityNotFound(_0x5f3683,null))[_0x0adb('0x26')](function(_0x2860a1){if(_0x2860a1){_0x4adcfb=_0x2860a1;_0x1a62d8[_0x0adb('0x34')]=_['keys'](db[_0x0adb('0x4d')][_0x0adb('0x2e')]);_0x1a62d8[_0x0adb('0x31')]=_['keys'](_0x12828b[_0x0adb('0x31')]);_0x1a62d8[_0x0adb('0x32')]=_[_0x0adb('0x33')](_0x1a62d8[_0x0adb('0x34')],_0x1a62d8[_0x0adb('0x31')]);_0x129cf6[_0x0adb('0x36')]=_[_0x0adb('0x33')](_0x1a62d8[_0x0adb('0x34')],qs[_0x0adb('0x35')](_0x12828b['query']['fields']));_0x129cf6['attributes']=_0x129cf6[_0x0adb('0x36')]['length']?_0x129cf6[_0x0adb('0x36')]:_0x1a62d8[_0x0adb('0x34')];_0x129cf6[_0x0adb('0x39')]=qs[_0x0adb('0x3a')](_0x12828b['query'][_0x0adb('0x3a')]);_0x129cf6[_0x0adb('0x3b')]=qs['filters'](_[_0x0adb('0x4e')](_0x12828b[_0x0adb('0x31')],_0x1a62d8[_0x0adb('0x32')]));if(_0x12828b['query'][_0x0adb('0x3c')]){_0x129cf6[_0x0adb('0x3b')]=_[_0x0adb('0x3f')](_0x129cf6[_0x0adb('0x3b')],{'$or':_['map'](_0x129cf6[_0x0adb('0x36')],function(_0x5c031f){var _0x52c656={};_0x52c656[_0x5c031f]={'$like':'%'+_0x12828b[_0x0adb('0x31')][_0x0adb('0x3c')]+'%'};return _0x52c656;})});}_0x129cf6=_[_0x0adb('0x3f')]({},_0x129cf6,_0x12828b[_0x0adb('0x40')]);return _0x4adcfb['getConfigurations'](_0x129cf6);}})[_0x0adb('0x26')](function(_0x91814d){if(_0x91814d){_0x16e16b=_0x91814d[_0x0adb('0x47')];if(!_0x12828b[_0x0adb('0x31')][_0x0adb('0x37')](_0x0adb('0x38'))){_0x129cf6[_0x0adb('0x20')]=qs[_0x0adb('0x20')](_0x12828b['query'][_0x0adb('0x20')]);_0x129cf6[_0x0adb('0x1e')]=qs[_0x0adb('0x1e')](_0x12828b[_0x0adb('0x31')][_0x0adb('0x1e')]);}return _0x4adcfb['getConfigurations'](_0x129cf6);}})[_0x0adb('0x26')](function(_0x20c5bb){if(_0x20c5bb){return _0x20c5bb?{'count':_0x16e16b,'rows':_0x20c5bb}:null;}})['then'](respondWithResult(_0x5f3683,null))['catch'](handleError(_0x5f3683,null));};exports[_0x0adb('0x4f')]=function(_0x281760,_0x2503af,_0x25d5a3){if(_0x281760[_0x0adb('0x4a')]['id']){delete _0x281760[_0x0adb('0x4a')]['id'];}return db[_0x0adb('0x2d')][_0x0adb('0x50')]({'where':{'id':_0x281760[_0x0adb('0x45')]['id']}})['then'](handleEntityNotFound(_0x2503af,null))[_0x0adb('0x26')](function(_0x48bdb4){if(_0x48bdb4){_0x281760[_0x0adb('0x4a')][_0x0adb('0x51')]=_0x48bdb4['id'];_0x281760[_0x0adb('0x4a')][_0x0adb('0x52')]=integrations[_0x0adb('0x53')](_0x281760[_0x0adb('0x4a')][_0x0adb('0x54')],_0x281760[_0x0adb('0x4a')][_0x0adb('0x30')]);_0x281760[_0x0adb('0x4a')][_0x0adb('0x55')]=integrations[_0x0adb('0x56')](_0x281760['body'][_0x0adb('0x54')],_0x281760[_0x0adb('0x4a')][_0x0adb('0x30')]);return db[_0x0adb('0x4d')][_0x0adb('0x49')](_0x281760[_0x0adb('0x4a')],{'include':[{'model':db[_0x0adb('0x57')],'as':_0x0adb('0x52')},{'model':db[_0x0adb('0x57')],'as':_0x0adb('0x55')}]});}return null;})[_0x0adb('0x26')](respondWithResult(_0x2503af,null))[_0x0adb('0x43')](handleError(_0x2503af,null));};exports[_0x0adb('0x58')]=function(_0x546d28,_0x218727,_0x3677f2){var _0x1d174e=[{'name':'priority','label':_0x0adb('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x530e28='';return db['DeskAccount'][_0x0adb('0x50')]({'where':{'id':_0x546d28[_0x0adb('0x45')]['id']},'attributes':['id',_0x0adb('0x5a'),'authType','username','password',_0x0adb('0x5b'),_0x0adb('0x5c'),'token',_0x0adb('0x5d')]})[_0x0adb('0x26')](handleEntityNotFound(_0x218727,null))['then'](function(_0x30e0f9){if(_0x30e0f9){_0x530e28=_0x30e0f9[_0x0adb('0x5a')];var _0x17c997=_0x530e28[_0x0adb('0x5e')](-0x1);if(_0x17c997==='/'){_0x530e28=_0x530e28[_0x0adb('0x5f')](0x0,_0x530e28['lastIndexOf'](_0x17c997));}var _0x3d91ae={'method':_0x0adb('0x60'),'uri':util[_0x0adb('0x61')](_0x0adb('0x62'),_0x530e28),'headers':{'Content-Type':_0x0adb('0x63'),'Accept':'application/json'},'json':!![]};if(_0x30e0f9[_0x0adb('0x64')]===_0x0adb('0x65')){_0x3d91ae[_0x0adb('0x66')][_0x0adb('0x67')]=util[_0x0adb('0x61')](_0x0adb('0x68'),new Buffer(util[_0x0adb('0x61')](_0x0adb('0x69'),_0x30e0f9[_0x0adb('0x6a')],_0x30e0f9['password']))[_0x0adb('0x6b')](_0x0adb('0x6c')));}return rp(_0x3d91ae)[_0x0adb('0x26')](function(_0x245314){return _0x1d174e[_0x0adb('0x6d')](_[_0x0adb('0x3d')](_0x245314[_0x0adb('0x6e')][_0x0adb('0x6f')],function(_0x38c064){return{'id':_0x38c064['name'],'name':_0x38c064[_0x0adb('0x2a')],'type':_0x38c064[_0x0adb('0x30')],'active':_0x38c064[_0x0adb('0x70')],'label':_0x38c064['label'],'custom':!![]};}));});}})[_0x0adb('0x26')](function(_0x15abe5){return{'count':_0x15abe5['length'],'rows':_0x15abe5};})['then'](respondWithResult(_0x218727,null))[_0x0adb('0x43')](function(_0x3daec0){var _0x1eb8f6=_0x546d28[_0x0adb('0x31')]['test']?0x1f4:_0x3daec0['statusCode']||0x1f4;logger[_0x0adb('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x0adb('0x58'),_0x1eb8f6,JSON[_0x0adb('0x71')](_0x3daec0));delete _0x3daec0[_0x0adb('0x2a')];if(_0x1eb8f6===0x191){_0x1eb8f6=0x190;}_0x218727[_0x0adb('0x1d')](_0x1eb8f6)[_0x0adb('0x2b')](_0x546d28[_0x0adb('0x31')][_0x0adb('0x72')]?{'message':_0x0adb('0x73'),'statusCode':_0x3daec0['statusCode']}:_0x3daec0);});};
\ No newline at end of file
index ccd6368..931f9e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d31=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x1d31,0x15b));var _0x11d3=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x1d31[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x11d3('0x0'));var util=require('util');var logger=require(_0x11d3('0x1'))(_0x11d3('0x2'));var moment=require(_0x11d3('0x3'));var BPromise=require(_0x11d3('0x4'));var rp=require(_0x11d3('0x5'));var fs=require('fs');var path=require(_0x11d3('0x6'));var rimraf=require(_0x11d3('0x7'));var config=require(_0x11d3('0x8'));var attributes=require(_0x11d3('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x11d3('0xa')]=function(_0x553438,_0x4b2cb2){return _0x553438[_0x11d3('0xb')](_0x11d3('0xc'),attributes,{'tableName':_0x11d3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56d0=['util','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x53a054,_0x4fe6c7){var _0x23d548=function(_0x4393a8){while(--_0x4393a8){_0x53a054['push'](_0x53a054['shift']());}};_0x23d548(++_0x4fe6c7);}(_0x56d0,0x1d3));var _0x056d=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x56d0[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0x056d('0x0'));var util=require(_0x056d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x056d('0x2'));var rp=require(_0x056d('0x3'));var fs=require('fs');var path=require(_0x056d('0x4'));var rimraf=require('rimraf');var config=require(_0x056d('0x5'));var attributes=require(_0x056d('0x6'));var integrations=require(_0x056d('0x7'));module[_0x056d('0x8')]=function(_0x3b4114,_0x56a836){return _0x3b4114[_0x056d('0x9')](_0x056d('0xa'),attributes,{'tableName':_0x056d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e9790f..dc5246a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x419d=['catch','ShowDeskAccount','DeskAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0xa1ed17,_0xcf8da6){var _0x4674ab=function(_0x48bb96){while(--_0x48bb96){_0xa1ed17['push'](_0xa1ed17['shift']());}};_0x4674ab(++_0xcf8da6);}(_0x419d,0x148));var _0xd419=function(_0x3eda3d,_0x232089){_0x3eda3d=_0x3eda3d-0x0;var _0x2efe88=_0x419d[_0x3eda3d];return _0x2efe88;};'use strict';var _=require('lodash');var util=require(_0xd419('0x0'));var moment=require(_0xd419('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd419('0x2'));var db=require(_0xd419('0x3'))['db'];var utils=require(_0xd419('0x4'));var logger=require(_0xd419('0x5'))(_0xd419('0x6'));var config=require(_0xd419('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd419('0x8')][_0xd419('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15da4e,_0x37798b,_0x56132a){return new BPromise(function(_0x86d0a2,_0x4dbbb1){return client[_0xd419('0xa')](_0x15da4e,_0x56132a)[_0xd419('0xb')](function(_0x27f856){logger[_0xd419('0xc')](_0xd419('0xd'),_0x37798b,_0xd419('0xe'));logger[_0xd419('0xf')](_0xd419('0x10'),_0x37798b,_0xd419('0xe'),JSON[_0xd419('0x11')](_0x27f856));if(_0x27f856[_0xd419('0x12')]){if(_0x27f856[_0xd419('0x12')][_0xd419('0x13')]===0x1f4){logger['error'](_0xd419('0xd'),_0x37798b,_0x27f856[_0xd419('0x12')][_0xd419('0x14')]);return _0x4dbbb1(_0x27f856[_0xd419('0x12')][_0xd419('0x14')]);}logger[_0xd419('0x12')](_0xd419('0xd'),_0x37798b,_0x27f856['error'][_0xd419('0x14')]);return _0x86d0a2(_0x27f856[_0xd419('0x12')][_0xd419('0x14')]);}else{logger[_0xd419('0xc')]('DeskAccount,\x20%s,\x20%s',_0x37798b,_0xd419('0xe'));_0x86d0a2(_0x27f856[_0xd419('0x15')]['message']);}})['catch'](function(_0x5e1d98){logger[_0xd419('0x12')](_0xd419('0xd'),_0x37798b,_0x5e1d98);_0x4dbbb1(_0x5e1d98);});});}exports[_0xd419('0x16')]=function(_0x5e0751){var _0x1fff43=this;return new Promise(function(_0x47a2ac,_0x2dc5d5){return db['DeskAccount'][_0xd419('0x17')]({'raw':_0x5e0751[_0xd419('0x18')]?_0x5e0751[_0xd419('0x18')][_0xd419('0x19')]===undefined?!![]:![]:!![],'where':_0x5e0751['options']?_0x5e0751[_0xd419('0x18')][_0xd419('0x1a')]||null:null,'attributes':_0x5e0751['options']?_0x5e0751['options'][_0xd419('0x1b')]||null:null,'limit':_0x5e0751[_0xd419('0x18')]?_0x5e0751['options'][_0xd419('0x1c')]||null:null,'include':_0x5e0751[_0xd419('0x18')]?_0x5e0751[_0xd419('0x18')]['include']?_[_0xd419('0x1d')](_0x5e0751[_0xd419('0x18')][_0xd419('0x1e')],function(_0x5e0085){return{'model':db[_0x5e0085['model']],'as':_0x5e0085['as'],'attributes':_0x5e0085[_0xd419('0x1b')],'include':_0x5e0085[_0xd419('0x1e')]?_[_0xd419('0x1d')](_0x5e0085[_0xd419('0x1e')],function(_0x5b5327){return{'model':db[_0x5b5327[_0xd419('0x1f')]],'as':_0x5b5327['as'],'attributes':_0x5b5327['attributes'],'include':_0x5b5327['include']?_[_0xd419('0x1d')](_0x5b5327[_0xd419('0x1e')],function(_0x2d5c01){return{'model':db[_0x2d5c01[_0xd419('0x1f')]],'as':_0x2d5c01['as'],'attributes':_0x2d5c01[_0xd419('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd419('0xb')](function(_0x2bde53){logger[_0xd419('0xc')]('GetDeskAccount',_0x5e0751);logger[_0xd419('0xf')](_0xd419('0x16'),_0x5e0751,JSON[_0xd419('0x11')](_0x2bde53));_0x47a2ac(_0x2bde53);})[_0xd419('0x20')](function(_0x4d72b9){logger['error'](_0xd419('0x16'),_0x4d72b9[_0xd419('0x14')],_0x5e0751);_0x2dc5d5(_0x1fff43['error'](0x1f4,_0x4d72b9[_0xd419('0x14')]));});});};exports[_0xd419('0x21')]=function(_0x20dd4f){var _0xc3c7ad=this;return new Promise(function(_0x5a9d73,_0x37803f){return db[_0xd419('0x22')][_0xd419('0x23')]({'raw':_0x20dd4f[_0xd419('0x18')]?_0x20dd4f[_0xd419('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x20dd4f[_0xd419('0x18')]?_0x20dd4f['options'][_0xd419('0x1a')]||null:null,'attributes':_0x20dd4f[_0xd419('0x18')]?_0x20dd4f['options']['attributes']||null:null,'include':_0x20dd4f[_0xd419('0x18')]?_0x20dd4f[_0xd419('0x18')][_0xd419('0x1e')]?_['map'](_0x20dd4f[_0xd419('0x18')][_0xd419('0x1e')],function(_0x343fe0){return{'model':db[_0x343fe0['model']],'as':_0x343fe0['as'],'attributes':_0x343fe0['attributes'],'include':_0x343fe0['include']?_[_0xd419('0x1d')](_0x343fe0[_0xd419('0x1e')],function(_0x54b35d){return{'model':db[_0x54b35d['model']],'as':_0x54b35d['as'],'attributes':_0x54b35d[_0xd419('0x1b')],'include':_0x54b35d['include']?_[_0xd419('0x1d')](_0x54b35d[_0xd419('0x1e')],function(_0xe7b0f0){return{'model':db[_0xe7b0f0[_0xd419('0x1f')]],'as':_0xe7b0f0['as'],'attributes':_0xe7b0f0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14274d){logger[_0xd419('0xc')](_0xd419('0x21'),_0x20dd4f);logger[_0xd419('0xf')](_0xd419('0x21'),_0x20dd4f,JSON[_0xd419('0x11')](_0x14274d));_0x5a9d73(_0x14274d);})[_0xd419('0x20')](function(_0x253ff1){logger[_0xd419('0x12')](_0xd419('0x21'),_0x253ff1[_0xd419('0x14')],_0x20dd4f);_0x37803f(_0xc3c7ad[_0xd419('0x12')](0x1f4,_0x253ff1['message']));});});};
\ No newline at end of file
+var _0x69e2=['GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x42a022,_0x1ea137){var _0x2d4201=function(_0x249d1b){while(--_0x249d1b){_0x42a022['push'](_0x42a022['shift']());}};_0x2d4201(++_0x1ea137);}(_0x69e2,0x11d));var _0x269e=function(_0x395334,_0x41f6a1){_0x395334=_0x395334-0x0;var _0xe3f9a6=_0x69e2[_0x395334];return _0xe3f9a6;};'use strict';var _=require(_0x269e('0x0'));var util=require(_0x269e('0x1'));var moment=require(_0x269e('0x2'));var BPromise=require(_0x269e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x269e('0x4'));var db=require(_0x269e('0x5'))['db'];var utils=require(_0x269e('0x6'));var logger=require('../../config/logger')(_0x269e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x269e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5273fe,_0x4625f1,_0x21045f){return new BPromise(function(_0x5c292b,_0xcc3e2b){return client['request'](_0x5273fe,_0x21045f)[_0x269e('0x9')](function(_0x56e6ee){logger[_0x269e('0xa')](_0x269e('0xb'),_0x4625f1,'request\x20sent');logger[_0x269e('0xc')](_0x269e('0xd'),_0x4625f1,_0x269e('0xe'),JSON[_0x269e('0xf')](_0x56e6ee));if(_0x56e6ee[_0x269e('0x10')]){if(_0x56e6ee['error'][_0x269e('0x11')]===0x1f4){logger[_0x269e('0x10')]('DeskAccount,\x20%s,\x20%s',_0x4625f1,_0x56e6ee[_0x269e('0x10')][_0x269e('0x12')]);return _0xcc3e2b(_0x56e6ee['error'][_0x269e('0x12')]);}logger[_0x269e('0x10')]('DeskAccount,\x20%s,\x20%s',_0x4625f1,_0x56e6ee['error'][_0x269e('0x12')]);return _0x5c292b(_0x56e6ee[_0x269e('0x10')]['message']);}else{logger[_0x269e('0xa')]('DeskAccount,\x20%s,\x20%s',_0x4625f1,_0x269e('0xe'));_0x5c292b(_0x56e6ee[_0x269e('0x13')][_0x269e('0x12')]);}})[_0x269e('0x14')](function(_0x1197a6){logger[_0x269e('0x10')]('DeskAccount,\x20%s,\x20%s',_0x4625f1,_0x1197a6);_0xcc3e2b(_0x1197a6);});});}exports[_0x269e('0x15')]=function(_0x39be66){var _0x258a3e=this;return new Promise(function(_0x4ff7a,_0x4895ce){return db[_0x269e('0x16')][_0x269e('0x17')]({'raw':_0x39be66[_0x269e('0x18')]?_0x39be66[_0x269e('0x18')][_0x269e('0x19')]===undefined?!![]:![]:!![],'where':_0x39be66['options']?_0x39be66[_0x269e('0x18')][_0x269e('0x1a')]||null:null,'attributes':_0x39be66[_0x269e('0x18')]?_0x39be66['options']['attributes']||null:null,'limit':_0x39be66[_0x269e('0x18')]?_0x39be66[_0x269e('0x18')][_0x269e('0x1b')]||null:null,'include':_0x39be66[_0x269e('0x18')]?_0x39be66[_0x269e('0x18')][_0x269e('0x1c')]?_[_0x269e('0x1d')](_0x39be66['options'][_0x269e('0x1c')],function(_0x50ec53){return{'model':db[_0x50ec53[_0x269e('0x1e')]],'as':_0x50ec53['as'],'attributes':_0x50ec53[_0x269e('0x1f')],'include':_0x50ec53['include']?_[_0x269e('0x1d')](_0x50ec53[_0x269e('0x1c')],function(_0x10af82){return{'model':db[_0x10af82[_0x269e('0x1e')]],'as':_0x10af82['as'],'attributes':_0x10af82[_0x269e('0x1f')],'include':_0x10af82[_0x269e('0x1c')]?_['map'](_0x10af82[_0x269e('0x1c')],function(_0x5f32b1){return{'model':db[_0x5f32b1['model']],'as':_0x5f32b1['as'],'attributes':_0x5f32b1[_0x269e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x269e('0x9')](function(_0xdf869){logger[_0x269e('0xa')](_0x269e('0x15'),_0x39be66);logger['debug'](_0x269e('0x15'),_0x39be66,JSON['stringify'](_0xdf869));_0x4ff7a(_0xdf869);})[_0x269e('0x14')](function(_0x582aa5){logger['error']('GetDeskAccount',_0x582aa5[_0x269e('0x12')],_0x39be66);_0x4895ce(_0x258a3e[_0x269e('0x10')](0x1f4,_0x582aa5[_0x269e('0x12')]));});});};exports[_0x269e('0x20')]=function(_0x2e881b){var _0x4b5147=this;return new Promise(function(_0x2eda5e,_0xd1feb4){return db[_0x269e('0x16')][_0x269e('0x21')]({'raw':_0x2e881b['options']?_0x2e881b[_0x269e('0x18')][_0x269e('0x19')]===undefined?!![]:![]:!![],'where':_0x2e881b[_0x269e('0x18')]?_0x2e881b['options'][_0x269e('0x1a')]||null:null,'attributes':_0x2e881b[_0x269e('0x18')]?_0x2e881b['options']['attributes']||null:null,'include':_0x2e881b[_0x269e('0x18')]?_0x2e881b[_0x269e('0x18')][_0x269e('0x1c')]?_['map'](_0x2e881b[_0x269e('0x18')][_0x269e('0x1c')],function(_0x3c2c03){return{'model':db[_0x3c2c03[_0x269e('0x1e')]],'as':_0x3c2c03['as'],'attributes':_0x3c2c03[_0x269e('0x1f')],'include':_0x3c2c03[_0x269e('0x1c')]?_['map'](_0x3c2c03[_0x269e('0x1c')],function(_0x1fb76b){return{'model':db[_0x1fb76b[_0x269e('0x1e')]],'as':_0x1fb76b['as'],'attributes':_0x1fb76b[_0x269e('0x1f')],'include':_0x1fb76b[_0x269e('0x1c')]?_[_0x269e('0x1d')](_0x1fb76b[_0x269e('0x1c')],function(_0x396abf){return{'model':db[_0x396abf[_0x269e('0x1e')]],'as':_0x396abf['as'],'attributes':_0x396abf[_0x269e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x269e('0x9')](function(_0x264934){logger[_0x269e('0xa')](_0x269e('0x20'),_0x2e881b);logger[_0x269e('0xc')](_0x269e('0x20'),_0x2e881b,JSON[_0x269e('0xf')](_0x264934));_0x2eda5e(_0x264934);})[_0x269e('0x14')](function(_0x5ae4f2){logger[_0x269e('0x10')](_0x269e('0x20'),_0x5ae4f2[_0x269e('0x12')],_0x2e881b);_0xd1feb4(_0x4b5147[_0x269e('0x10')](0x1f4,_0x5ae4f2[_0x269e('0x12')]));});});};
\ No newline at end of file
index 19153e2..550a19c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x30f91a,_0x130206){var _0xb54ec8=function(_0x23367a){while(--_0x23367a){_0x30f91a['push'](_0x30f91a['shift']());}};_0xb54ec8(++_0x130206);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
+var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3fec33,_0x3ab7f1){var _0x576dac=function(_0x5a12d3){while(--_0x5a12d3){_0x3fec33['push'](_0x3fec33['shift']());}};_0x576dac(++_0x3ab7f1);}(_0x34e8,0x12c));var _0x834e=function(_0x72653f,_0x53195c){_0x72653f=_0x72653f-0x0;var _0x20563=_0x34e8[_0x72653f];return _0x20563;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router;
\ No newline at end of file
index ef1be14..3c70108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eb0=['STRING','sequelize','exports'];(function(_0x122618,_0x576472){var _0x13f625=function(_0x17be25){while(--_0x17be25){_0x122618['push'](_0x122618['shift']());}};_0x13f625(++_0x576472);}(_0x7eb0,0x1d2));var _0x07eb=function(_0x400605,_0x245308){_0x400605=_0x400605-0x0;var _0x18aac1=_0x7eb0[_0x400605];return _0x18aac1;};'use strict';var Sequelize=require(_0x07eb('0x0'));module[_0x07eb('0x1')]={'name':{'type':Sequelize[_0x07eb('0x2')]},'description':{'type':Sequelize[_0x07eb('0x2')]}};
\ No newline at end of file
+var _0xc51c=['STRING','sequelize','exports'];(function(_0x1d6bc7,_0x14cb9f){var _0x34bbcf=function(_0xd14c59){while(--_0xd14c59){_0x1d6bc7['push'](_0x1d6bc7['shift']());}};_0x34bbcf(++_0x14cb9f);}(_0xc51c,0x91));var _0xcc51=function(_0x367e65,_0x306ad2){_0x367e65=_0x367e65-0x0;var _0x2a32ec=_0xc51c[_0x367e65];return _0x2a32ec;};'use strict';var Sequelize=require(_0xcc51('0x0'));module[_0xcc51('0x1')]={'name':{'type':Sequelize[_0xcc51('0x2')]},'description':{'type':Sequelize[_0xcc51('0x2')]}};
\ No newline at end of file
index 9e37a19..a54ce10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af1=['findAll','catch','show','params','rawAttributes','merge','create','body','update','find','getFields','findOne','pick','where','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','sendStatus','end','status','offset','undefined','limit','count','json','apply','save','then','destroy','error','stack','name','index','map','DeskConfiguration','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','type','VIRTUAL','options','includeAll','include'];(function(_0x34df56,_0x52a58f){var _0x520f88=function(_0x2f0a82){while(--_0x2f0a82){_0x34df56['push'](_0x34df56['shift']());}};_0x520f88(++_0x52a58f);}(_0x9af1,0x1f4));var _0x19af=function(_0x281dbb,_0x147d85){_0x281dbb=_0x281dbb-0x0;var _0x3c3690=_0x9af1[_0x281dbb];return _0x3c3690;};'use strict';var emlformat=require(_0x19af('0x0'));var rimraf=require(_0x19af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x19af('0x2'));var rp=require(_0x19af('0x3'));var moment=require('moment');var BPromise=require(_0x19af('0x4'));var Mustache=require(_0x19af('0x5'));var util=require(_0x19af('0x6'));var path=require(_0x19af('0x7'));var sox=require(_0x19af('0x8'));var csv=require(_0x19af('0x9'));var ejs=require(_0x19af('0xa'));var fs=require('fs');var fs_extra=require(_0x19af('0xb'));var _=require(_0x19af('0xc'));var squel=require(_0x19af('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x19af('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x19af('0xf'));var Redis=require('ioredis');var authService=require(_0x19af('0x10'));var qs=require(_0x19af('0x11'));var as=require(_0x19af('0x12'));var hardwareService=require(_0x19af('0x13'));var logger=require(_0x19af('0x14'))(_0x19af('0x15'));var utils=require(_0x19af('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71139d,_0x3a1008){_0x3a1008=_0x3a1008||0xcc;return function(_0x99c67){if(_0x99c67){return _0x71139d[_0x19af('0x17')](_0x3a1008);}return _0x71139d['status'](_0x3a1008)[_0x19af('0x18')]();};}function respondWithResult(_0x365269,_0x591e9a){_0x591e9a=_0x591e9a||0xc8;return function(_0x54090a){if(_0x54090a){return _0x365269[_0x19af('0x19')](_0x591e9a)['json'](_0x54090a);}};}function respondWithFilteredResult(_0x1a6571,_0x47fa1c){return function(_0x5a6f0e){if(_0x5a6f0e){var _0xef6c9b=typeof _0x47fa1c[_0x19af('0x1a')]===_0x19af('0x1b')&&typeof _0x47fa1c[_0x19af('0x1c')]===_0x19af('0x1b');var _0x5b1a44=_0x5a6f0e[_0x19af('0x1d')];var _0x4ae049=_0xef6c9b?0x0:_0x47fa1c[_0x19af('0x1a')];var _0x3e158c=_0xef6c9b?_0x5a6f0e[_0x19af('0x1d')]:_0x47fa1c[_0x19af('0x1a')]+_0x47fa1c['limit'];var _0x3efd72;if(_0x3e158c>=_0x5b1a44){_0x3e158c=_0x5b1a44;_0x3efd72=0xc8;}else{_0x3efd72=0xce;}_0x1a6571['status'](_0x3efd72);return _0x1a6571['set']('Content-Range',_0x4ae049+'-'+_0x3e158c+'/'+_0x5b1a44)[_0x19af('0x1e')](_0x5a6f0e);}return null;};}function patchUpdates(_0x520bf5){return function(_0x2cec05){try{jsonpatch[_0x19af('0x1f')](_0x2cec05,_0x520bf5,!![]);}catch(_0x135f39){return BPromise['reject'](_0x135f39);}return _0x2cec05[_0x19af('0x20')]();};}function saveUpdates(_0x429be9,_0x480c7a){return function(_0x3147d3){if(_0x3147d3){return _0x3147d3['update'](_0x429be9)[_0x19af('0x21')](function(_0x3bfab6){return _0x3bfab6;});}return null;};}function removeEntity(_0x4cb0fa,_0xaec293){return function(_0x166dde){if(_0x166dde){return _0x166dde[_0x19af('0x22')]()[_0x19af('0x21')](function(){_0x4cb0fa[_0x19af('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefab4d,_0x42bbb0){return function(_0x4f5e95){if(!_0x4f5e95){_0xefab4d[_0x19af('0x17')](0x194);}return _0x4f5e95;};}function handleError(_0x44c3c5,_0x56728f){_0x56728f=_0x56728f||0x1f4;return function(_0x2905b2){logger[_0x19af('0x23')](_0x2905b2[_0x19af('0x24')]);if(_0x2905b2['name']){delete _0x2905b2[_0x19af('0x25')];}_0x44c3c5[_0x19af('0x19')](_0x56728f)['send'](_0x2905b2);};}exports[_0x19af('0x26')]=function(_0x13b841,_0x1d4401){var _0x28f55b={},_0x2ccdcc={},_0xff4897={'count':0x0,'rows':[]};var _0x57f9de=_[_0x19af('0x27')](db[_0x19af('0x28')]['rawAttributes'],function(_0x3e3e33){return{'name':_0x3e3e33[_0x19af('0x29')],'type':_0x3e3e33['type'][_0x19af('0x2a')]};});_0x2ccdcc[_0x19af('0x2b')]=_['map'](_0x57f9de,_0x19af('0x25'));_0x2ccdcc[_0x19af('0x2c')]=_[_0x19af('0x2d')](_0x13b841[_0x19af('0x2c')]);_0x2ccdcc[_0x19af('0x2e')]=_[_0x19af('0x2f')](_0x2ccdcc['model'],_0x2ccdcc['query']);_0x28f55b['attributes']=_['intersection'](_0x2ccdcc[_0x19af('0x2b')],qs[_0x19af('0x30')](_0x13b841['query'][_0x19af('0x30')]));_0x28f55b['attributes']=_0x28f55b[_0x19af('0x31')][_0x19af('0x32')]?_0x28f55b[_0x19af('0x31')]:_0x2ccdcc[_0x19af('0x2b')];if(!_0x13b841[_0x19af('0x2c')]['hasOwnProperty'](_0x19af('0x33'))){_0x28f55b['limit']=qs[_0x19af('0x1c')](_0x13b841[_0x19af('0x2c')][_0x19af('0x1c')]);_0x28f55b[_0x19af('0x1a')]=qs[_0x19af('0x1a')](_0x13b841[_0x19af('0x2c')]['offset']);}_0x28f55b[_0x19af('0x34')]=qs[_0x19af('0x35')](_0x13b841[_0x19af('0x2c')][_0x19af('0x35')]);_0x28f55b['where']=qs['filters'](_['pick'](_0x13b841[_0x19af('0x2c')],_0x2ccdcc[_0x19af('0x2e')]),_0x57f9de);if(_0x13b841[_0x19af('0x2c')][_0x19af('0x36')]){_0x28f55b['where']=_['merge'](_0x28f55b['where'],{'$or':_[_0x19af('0x27')](_0x57f9de,function(_0x591cfe){if(_0x591cfe[_0x19af('0x37')]!==_0x19af('0x38')){var _0x233688={};_0x233688[_0x591cfe['name']]={'$like':'%'+_0x13b841[_0x19af('0x2c')]['filter']+'%'};return _0x233688;}})});}_0x28f55b=_['merge']({},_0x28f55b,_0x13b841[_0x19af('0x39')]);var _0x223dc8={'where':_0x28f55b['where']};return db[_0x19af('0x28')][_0x19af('0x1d')](_0x223dc8)['then'](function(_0x49ada3){_0xff4897[_0x19af('0x1d')]=_0x49ada3;if(_0x13b841[_0x19af('0x2c')][_0x19af('0x3a')]){_0x28f55b[_0x19af('0x3b')]=[{'all':!![]}];}return db[_0x19af('0x28')][_0x19af('0x3c')](_0x28f55b);})[_0x19af('0x21')](function(_0x4afe04){_0xff4897['rows']=_0x4afe04;return _0xff4897;})[_0x19af('0x21')](respondWithFilteredResult(_0x1d4401,_0x28f55b))[_0x19af('0x3d')](handleError(_0x1d4401,null));};exports[_0x19af('0x3e')]=function(_0x476169,_0x24963d){var _0x44c414={'raw':![],'where':{'id':_0x476169[_0x19af('0x3f')]['id']}},_0x48d619={};_0x48d619['model']=_[_0x19af('0x2d')](db[_0x19af('0x28')][_0x19af('0x40')]);_0x48d619[_0x19af('0x2c')]=_[_0x19af('0x2d')](_0x476169[_0x19af('0x2c')]);_0x48d619['filters']=_[_0x19af('0x2f')](_0x48d619[_0x19af('0x2b')],_0x48d619['query']);_0x44c414[_0x19af('0x31')]=_[_0x19af('0x2f')](_0x48d619[_0x19af('0x2b')],qs[_0x19af('0x30')](_0x476169[_0x19af('0x2c')]['fields']));_0x44c414[_0x19af('0x31')]=_0x44c414[_0x19af('0x31')][_0x19af('0x32')]?_0x44c414[_0x19af('0x31')]:_0x48d619[_0x19af('0x2b')];if(_0x476169[_0x19af('0x2c')]['includeAll']){_0x44c414[_0x19af('0x3b')]=[{'all':!![]}];}_0x44c414=_[_0x19af('0x41')]({},_0x44c414,_0x476169[_0x19af('0x39')]);return db[_0x19af('0x28')]['find'](_0x44c414)[_0x19af('0x21')](handleEntityNotFound(_0x24963d,null))[_0x19af('0x21')](respondWithResult(_0x24963d,null))[_0x19af('0x3d')](handleError(_0x24963d,null));};exports[_0x19af('0x42')]=function(_0x5d2c5b,_0x9db37f){return db[_0x19af('0x28')][_0x19af('0x42')](_0x5d2c5b[_0x19af('0x43')],{})[_0x19af('0x21')](respondWithResult(_0x9db37f,0xc9))[_0x19af('0x3d')](handleError(_0x9db37f,null));};exports[_0x19af('0x44')]=function(_0x2556ff,_0x307352){if(_0x2556ff[_0x19af('0x43')]['id']){delete _0x2556ff[_0x19af('0x43')]['id'];}return db['DeskConfiguration'][_0x19af('0x45')]({'where':{'id':_0x2556ff[_0x19af('0x3f')]['id']}})['then'](handleEntityNotFound(_0x307352,null))['then'](saveUpdates(_0x2556ff[_0x19af('0x43')],null))[_0x19af('0x21')](respondWithResult(_0x307352,null))['catch'](handleError(_0x307352,null));};exports[_0x19af('0x22')]=function(_0x1c59e6,_0x1db834){return db['DeskConfiguration'][_0x19af('0x45')]({'where':{'id':_0x1c59e6[_0x19af('0x3f')]['id']}})[_0x19af('0x21')](handleEntityNotFound(_0x1db834,null))[_0x19af('0x21')](removeEntity(_0x1db834,null))[_0x19af('0x3d')](handleError(_0x1db834,null));};exports[_0x19af('0x46')]=function(_0x5a19e4,_0x3f388c,_0x200b9a){var _0x3fa382={};var _0x15d33d={};var _0x5c1a6b;var _0x430feb;return db['DeskConfiguration'][_0x19af('0x47')]({'where':{'id':_0x5a19e4[_0x19af('0x3f')]['id']}})[_0x19af('0x21')](handleEntityNotFound(_0x3f388c,null))[_0x19af('0x21')](function(_0x4f261d){if(_0x4f261d){_0x5c1a6b=_0x4f261d;_0x15d33d[_0x19af('0x2b')]=_[_0x19af('0x2d')](db['DeskField'][_0x19af('0x40')]);_0x15d33d[_0x19af('0x2c')]=_[_0x19af('0x2d')](_0x5a19e4[_0x19af('0x2c')]);_0x15d33d[_0x19af('0x2e')]=_['intersection'](_0x15d33d['model'],_0x15d33d[_0x19af('0x2c')]);_0x3fa382[_0x19af('0x31')]=_['intersection'](_0x15d33d[_0x19af('0x2b')],qs[_0x19af('0x30')](_0x5a19e4[_0x19af('0x2c')][_0x19af('0x30')]));_0x3fa382[_0x19af('0x31')]=_0x3fa382['attributes']['length']?_0x3fa382[_0x19af('0x31')]:_0x15d33d[_0x19af('0x2b')];_0x3fa382[_0x19af('0x34')]=qs[_0x19af('0x35')](_0x5a19e4[_0x19af('0x2c')][_0x19af('0x35')]);_0x3fa382['where']=qs['filters'](_[_0x19af('0x48')](_0x5a19e4[_0x19af('0x2c')],_0x15d33d[_0x19af('0x2e')]));if(_0x5a19e4[_0x19af('0x2c')][_0x19af('0x36')]){_0x3fa382[_0x19af('0x49')]=_['merge'](_0x3fa382[_0x19af('0x49')],{'$or':_[_0x19af('0x27')](_0x3fa382['attributes'],function(_0x5c2048){var _0xc08a1b={};_0xc08a1b[_0x5c2048]={'$like':'%'+_0x5a19e4[_0x19af('0x2c')][_0x19af('0x36')]+'%'};return _0xc08a1b;})});}_0x3fa382=_[_0x19af('0x41')]({},_0x3fa382,_0x5a19e4[_0x19af('0x39')]);return _0x5c1a6b[_0x19af('0x46')](_0x3fa382);}})['then'](function(_0x10e957){if(_0x10e957){_0x430feb=_0x10e957['length'];if(!_0x5a19e4[_0x19af('0x2c')][_0x19af('0x4a')]('nolimit')){_0x3fa382[_0x19af('0x1c')]=qs['limit'](_0x5a19e4[_0x19af('0x2c')][_0x19af('0x1c')]);_0x3fa382[_0x19af('0x1a')]=qs[_0x19af('0x1a')](_0x5a19e4[_0x19af('0x2c')][_0x19af('0x1a')]);}return _0x5c1a6b[_0x19af('0x46')](_0x3fa382);}})[_0x19af('0x21')](function(_0x2361b8){if(_0x2361b8){return _0x2361b8?{'count':_0x430feb,'rows':_0x2361b8}:null;}})[_0x19af('0x21')](respondWithResult(_0x3f388c,null))[_0x19af('0x3d')](handleError(_0x3f388c,null));};exports[_0x19af('0x4b')]=function(_0x36d157,_0x2ca4ff,_0x2fecc2){var _0x4b4625={};var _0x534a37={};var _0x15d8b1;var _0x4ac9db;return db[_0x19af('0x28')]['findOne']({'where':{'id':_0x36d157[_0x19af('0x3f')]['id']}})[_0x19af('0x21')](handleEntityNotFound(_0x2ca4ff,null))[_0x19af('0x21')](function(_0x2a4341){if(_0x2a4341){_0x15d8b1=_0x2a4341;_0x534a37[_0x19af('0x2b')]=_[_0x19af('0x2d')](db[_0x19af('0x4c')][_0x19af('0x40')]);_0x534a37['query']=_[_0x19af('0x2d')](_0x36d157['query']);_0x534a37[_0x19af('0x2e')]=_[_0x19af('0x2f')](_0x534a37[_0x19af('0x2b')],_0x534a37[_0x19af('0x2c')]);_0x4b4625['attributes']=_['intersection'](_0x534a37['model'],qs[_0x19af('0x30')](_0x36d157[_0x19af('0x2c')][_0x19af('0x30')]));_0x4b4625['attributes']=_0x4b4625[_0x19af('0x31')]['length']?_0x4b4625[_0x19af('0x31')]:_0x534a37[_0x19af('0x2b')];_0x4b4625['order']=qs[_0x19af('0x35')](_0x36d157['query'][_0x19af('0x35')]);_0x4b4625[_0x19af('0x49')]=qs[_0x19af('0x2e')](_[_0x19af('0x48')](_0x36d157[_0x19af('0x2c')],_0x534a37[_0x19af('0x2e')]));if(_0x36d157[_0x19af('0x2c')][_0x19af('0x36')]){_0x4b4625['where']=_[_0x19af('0x41')](_0x4b4625[_0x19af('0x49')],{'$or':_['map'](_0x4b4625[_0x19af('0x31')],function(_0x5b208e){var _0x5da4f6={};_0x5da4f6[_0x5b208e]={'$like':'%'+_0x36d157[_0x19af('0x2c')][_0x19af('0x36')]+'%'};return _0x5da4f6;})});}_0x4b4625=_[_0x19af('0x41')]({},_0x4b4625,_0x36d157[_0x19af('0x39')]);return _0x15d8b1['getSubjects'](_0x4b4625);}})['then'](function(_0x1f755f){if(_0x1f755f){_0x4ac9db=_0x1f755f[_0x19af('0x32')];if(!_0x36d157[_0x19af('0x2c')][_0x19af('0x4a')](_0x19af('0x33'))){_0x4b4625['limit']=qs[_0x19af('0x1c')](_0x36d157[_0x19af('0x2c')][_0x19af('0x1c')]);_0x4b4625['offset']=qs[_0x19af('0x1a')](_0x36d157['query']['offset']);}return _0x15d8b1[_0x19af('0x4b')](_0x4b4625);}})['then'](function(_0x25698d){if(_0x25698d){return _0x25698d?{'count':_0x4ac9db,'rows':_0x25698d}:null;}})[_0x19af('0x21')](respondWithResult(_0x2ca4ff,null))[_0x19af('0x3d')](handleError(_0x2ca4ff,null));};exports[_0x19af('0x4d')]=function(_0x236774,_0x22d465,_0x22e1cf){var _0x250667={};var _0x9fd45e={};var _0x4c79ee;var _0x68423b;return db[_0x19af('0x28')][_0x19af('0x47')]({'where':{'id':_0x236774[_0x19af('0x3f')]['id']}})[_0x19af('0x21')](handleEntityNotFound(_0x22d465,null))[_0x19af('0x21')](function(_0x5e7ba2){if(_0x5e7ba2){_0x4c79ee=_0x5e7ba2;_0x9fd45e['model']=_['keys'](db['DeskField'][_0x19af('0x40')]);_0x9fd45e[_0x19af('0x2c')]=_[_0x19af('0x2d')](_0x236774['query']);_0x9fd45e[_0x19af('0x2e')]=_[_0x19af('0x2f')](_0x9fd45e['model'],_0x9fd45e[_0x19af('0x2c')]);_0x250667[_0x19af('0x31')]=_[_0x19af('0x2f')](_0x9fd45e[_0x19af('0x2b')],qs['fields'](_0x236774['query'][_0x19af('0x30')]));_0x250667['attributes']=_0x250667['attributes'][_0x19af('0x32')]?_0x250667[_0x19af('0x31')]:_0x9fd45e['model'];_0x250667[_0x19af('0x34')]=qs[_0x19af('0x35')](_0x236774[_0x19af('0x2c')][_0x19af('0x35')]);_0x250667[_0x19af('0x49')]=qs[_0x19af('0x2e')](_[_0x19af('0x48')](_0x236774['query'],_0x9fd45e[_0x19af('0x2e')]));if(_0x236774[_0x19af('0x2c')][_0x19af('0x36')]){_0x250667[_0x19af('0x49')]=_['merge'](_0x250667[_0x19af('0x49')],{'$or':_['map'](_0x250667['attributes'],function(_0x53a8f2){var _0x688e8a={};_0x688e8a[_0x53a8f2]={'$like':'%'+_0x236774['query']['filter']+'%'};return _0x688e8a;})});}_0x250667=_[_0x19af('0x41')]({},_0x250667,_0x236774[_0x19af('0x39')]);return _0x4c79ee['getDescriptions'](_0x250667);}})[_0x19af('0x21')](function(_0x4edc7a){if(_0x4edc7a){_0x68423b=_0x4edc7a[_0x19af('0x32')];if(!_0x236774[_0x19af('0x2c')][_0x19af('0x4a')]('nolimit')){_0x250667[_0x19af('0x1c')]=qs[_0x19af('0x1c')](_0x236774[_0x19af('0x2c')][_0x19af('0x1c')]);_0x250667[_0x19af('0x1a')]=qs[_0x19af('0x1a')](_0x236774[_0x19af('0x2c')][_0x19af('0x1a')]);}return _0x4c79ee['getDescriptions'](_0x250667);}})[_0x19af('0x21')](function(_0x305547){if(_0x305547){return _0x305547?{'count':_0x68423b,'rows':_0x305547}:null;}})[_0x19af('0x21')](respondWithResult(_0x22d465,null))[_0x19af('0x3d')](handleError(_0x22d465,null));};exports['getTags']=function(_0x164f60,_0xf931f5,_0x4b66cd){var _0x540ba4={};var _0x85a830={};var _0x4de516;var _0x3785ba;return db[_0x19af('0x28')][_0x19af('0x47')]({'where':{'id':_0x164f60['params']['id']}})['then'](handleEntityNotFound(_0xf931f5,null))[_0x19af('0x21')](function(_0x5d0a90){if(_0x5d0a90){_0x4de516=_0x5d0a90;_0x85a830[_0x19af('0x2b')]=_[_0x19af('0x2d')](db['Tag'][_0x19af('0x40')]);_0x85a830['query']=_['keys'](_0x164f60[_0x19af('0x2c')]);_0x85a830[_0x19af('0x2e')]=_['intersection'](_0x85a830[_0x19af('0x2b')],_0x85a830['query']);_0x540ba4['attributes']=_[_0x19af('0x2f')](_0x85a830['model'],qs[_0x19af('0x30')](_0x164f60[_0x19af('0x2c')][_0x19af('0x30')]));_0x540ba4[_0x19af('0x31')]=_0x540ba4[_0x19af('0x31')]['length']?_0x540ba4[_0x19af('0x31')]:_0x85a830['model'];_0x540ba4[_0x19af('0x34')]=qs[_0x19af('0x35')](_0x164f60['query'][_0x19af('0x35')]);_0x540ba4[_0x19af('0x49')]=qs['filters'](_[_0x19af('0x48')](_0x164f60['query'],_0x85a830[_0x19af('0x2e')]));if(_0x164f60[_0x19af('0x2c')][_0x19af('0x36')]){_0x540ba4[_0x19af('0x49')]=_[_0x19af('0x41')](_0x540ba4[_0x19af('0x49')],{'$or':_[_0x19af('0x27')](_0x540ba4[_0x19af('0x31')],function(_0x256525){var _0x1bad9b={};_0x1bad9b[_0x256525]={'$like':'%'+_0x164f60[_0x19af('0x2c')][_0x19af('0x36')]+'%'};return _0x1bad9b;})});}_0x540ba4=_[_0x19af('0x41')]({},_0x540ba4,_0x164f60['options']);return _0x4de516[_0x19af('0x4e')](_0x540ba4);}})[_0x19af('0x21')](function(_0xf06d9){if(_0xf06d9){_0x3785ba=_0xf06d9[_0x19af('0x32')];if(!_0x164f60[_0x19af('0x2c')][_0x19af('0x4a')](_0x19af('0x33'))){_0x540ba4[_0x19af('0x1c')]=qs['limit'](_0x164f60['query'][_0x19af('0x1c')]);_0x540ba4['offset']=qs[_0x19af('0x1a')](_0x164f60[_0x19af('0x2c')][_0x19af('0x1a')]);}return _0x4de516['getTags'](_0x540ba4);}})[_0x19af('0x21')](function(_0x33fefc){if(_0x33fefc){return _0x33fefc?{'count':_0x3785ba,'rows':_0x33fefc}:null;}})[_0x19af('0x21')](respondWithResult(_0xf931f5,null))[_0x19af('0x3d')](handleError(_0xf931f5,null));};exports['setTags']=function(_0x1e0019,_0x4f9021,_0x5bab31){if(_0x1e0019[_0x19af('0x43')]['id']){delete _0x1e0019['body']['id'];}return db[_0x19af('0x28')]['findOne']({'where':{'id':_0x1e0019['params']['id']}})[_0x19af('0x21')](handleEntityNotFound(_0x4f9021,null))[_0x19af('0x21')](function(_0x30501e){if(_0x30501e){return _0x30501e['setTags'](_0x1e0019[_0x19af('0x43')][_0x19af('0x4f')]||[]);}return null;})[_0x19af('0x21')](respondWithResult(_0x4f9021,null))[_0x19af('0x3d')](handleError(_0x4f9021,null));};
\ No newline at end of file
+var _0xb514=['VIRTUAL','options','includeAll','include','rows','params','keys','length','find','catch','create','body','getFields','findOne','DeskField','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xb514,0x106));var _0x4b51=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0xb514[_0x77d310];return _0x2cdce4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b51('0x0'));var zipdir=require(_0x4b51('0x1'));var jsonpatch=require(_0x4b51('0x2'));var rp=require(_0x4b51('0x3'));var moment=require(_0x4b51('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b51('0x5'));var path=require(_0x4b51('0x6'));var sox=require(_0x4b51('0x7'));var csv=require(_0x4b51('0x8'));var ejs=require(_0x4b51('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b51('0xb'));var toCsv=require(_0x4b51('0x8'));var querystring=require(_0x4b51('0xc'));var Papa=require(_0x4b51('0xd'));var Redis=require(_0x4b51('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4b51('0xf'));var as=require(_0x4b51('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b51('0x11'))(_0x4b51('0x12'));var utils=require(_0x4b51('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4b51('0x14'));var db=require(_0x4b51('0x15'))['db'];function respondWithStatusCode(_0x11b494,_0x3456aa){_0x3456aa=_0x3456aa||0xcc;return function(_0x3568b8){if(_0x3568b8){return _0x11b494[_0x4b51('0x16')](_0x3456aa);}return _0x11b494['status'](_0x3456aa)['end']();};}function respondWithResult(_0x6abd96,_0x4fd471){_0x4fd471=_0x4fd471||0xc8;return function(_0xa9e1e4){if(_0xa9e1e4){return _0x6abd96[_0x4b51('0x17')](_0x4fd471)['json'](_0xa9e1e4);}};}function respondWithFilteredResult(_0x3dfdd9,_0x76fa16){return function(_0x3dd6ef){if(_0x3dd6ef){var _0x11b8e9=typeof _0x76fa16[_0x4b51('0x18')]===_0x4b51('0x19')&&typeof _0x76fa16[_0x4b51('0x1a')]===_0x4b51('0x19');var _0x275553=_0x3dd6ef[_0x4b51('0x1b')];var _0x426927=_0x11b8e9?0x0:_0x76fa16[_0x4b51('0x18')];var _0xd58d2a=_0x11b8e9?_0x3dd6ef[_0x4b51('0x1b')]:_0x76fa16[_0x4b51('0x18')]+_0x76fa16[_0x4b51('0x1a')];var _0x3bd311;if(_0xd58d2a>=_0x275553){_0xd58d2a=_0x275553;_0x3bd311=0xc8;}else{_0x3bd311=0xce;}_0x3dfdd9['status'](_0x3bd311);return _0x3dfdd9['set'](_0x4b51('0x1c'),_0x426927+'-'+_0xd58d2a+'/'+_0x275553)['json'](_0x3dd6ef);}return null;};}function patchUpdates(_0x38791a){return function(_0x3cae98){try{jsonpatch[_0x4b51('0x1d')](_0x3cae98,_0x38791a,!![]);}catch(_0x345ad7){return BPromise[_0x4b51('0x1e')](_0x345ad7);}return _0x3cae98[_0x4b51('0x1f')]();};}function saveUpdates(_0x537d0e,_0xe00c23){return function(_0x24903f){if(_0x24903f){return _0x24903f[_0x4b51('0x20')](_0x537d0e)[_0x4b51('0x21')](function(_0x49f092){return _0x49f092;});}return null;};}function removeEntity(_0x27e86a,_0x330134){return function(_0x3ad495){if(_0x3ad495){return _0x3ad495[_0x4b51('0x22')]()[_0x4b51('0x21')](function(){_0x27e86a[_0x4b51('0x17')](0xcc)[_0x4b51('0x23')]();});}};}function handleEntityNotFound(_0x385422,_0x524c4a){return function(_0x360c4d){if(!_0x360c4d){_0x385422[_0x4b51('0x16')](0x194);}return _0x360c4d;};}function handleError(_0x585cd2,_0x24f2fe){_0x24f2fe=_0x24f2fe||0x1f4;return function(_0x42261c){logger[_0x4b51('0x24')](_0x42261c[_0x4b51('0x25')]);if(_0x42261c[_0x4b51('0x26')]){delete _0x42261c[_0x4b51('0x26')];}_0x585cd2[_0x4b51('0x17')](_0x24f2fe)[_0x4b51('0x27')](_0x42261c);};}exports['index']=function(_0xd1e28,_0x550516){var _0x539741={},_0x1fa2fc={},_0x212a55={'count':0x0,'rows':[]};var _0x351798=_[_0x4b51('0x28')](db[_0x4b51('0x29')][_0x4b51('0x2a')],function(_0x9b709a){return{'name':_0x9b709a[_0x4b51('0x2b')],'type':_0x9b709a['type'][_0x4b51('0x2c')]};});_0x1fa2fc[_0x4b51('0x2d')]=_['map'](_0x351798,'name');_0x1fa2fc[_0x4b51('0x2e')]=_['keys'](_0xd1e28[_0x4b51('0x2e')]);_0x1fa2fc['filters']=_[_0x4b51('0x2f')](_0x1fa2fc[_0x4b51('0x2d')],_0x1fa2fc['query']);_0x539741[_0x4b51('0x30')]=_['intersection'](_0x1fa2fc[_0x4b51('0x2d')],qs[_0x4b51('0x31')](_0xd1e28[_0x4b51('0x2e')][_0x4b51('0x31')]));_0x539741[_0x4b51('0x30')]=_0x539741['attributes']['length']?_0x539741[_0x4b51('0x30')]:_0x1fa2fc[_0x4b51('0x2d')];if(!_0xd1e28[_0x4b51('0x2e')][_0x4b51('0x32')]('nolimit')){_0x539741[_0x4b51('0x1a')]=qs[_0x4b51('0x1a')](_0xd1e28[_0x4b51('0x2e')][_0x4b51('0x1a')]);_0x539741['offset']=qs[_0x4b51('0x18')](_0xd1e28['query'][_0x4b51('0x18')]);}_0x539741[_0x4b51('0x33')]=qs['sort'](_0xd1e28[_0x4b51('0x2e')][_0x4b51('0x34')]);_0x539741['where']=qs[_0x4b51('0x35')](_[_0x4b51('0x36')](_0xd1e28[_0x4b51('0x2e')],_0x1fa2fc[_0x4b51('0x35')]),_0x351798);if(_0xd1e28[_0x4b51('0x2e')][_0x4b51('0x37')]){_0x539741['where']=_[_0x4b51('0x38')](_0x539741[_0x4b51('0x39')],{'$or':_['map'](_0x351798,function(_0x5d2263){if(_0x5d2263['type']!==_0x4b51('0x3a')){var _0x304110={};_0x304110[_0x5d2263[_0x4b51('0x26')]]={'$like':'%'+_0xd1e28[_0x4b51('0x2e')][_0x4b51('0x37')]+'%'};return _0x304110;}})});}_0x539741=_[_0x4b51('0x38')]({},_0x539741,_0xd1e28[_0x4b51('0x3b')]);var _0x3d7c2b={'where':_0x539741[_0x4b51('0x39')]};return db[_0x4b51('0x29')][_0x4b51('0x1b')](_0x3d7c2b)[_0x4b51('0x21')](function(_0x355aea){_0x212a55['count']=_0x355aea;if(_0xd1e28['query'][_0x4b51('0x3c')]){_0x539741[_0x4b51('0x3d')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x539741);})[_0x4b51('0x21')](function(_0x22a34a){_0x212a55[_0x4b51('0x3e')]=_0x22a34a;return _0x212a55;})['then'](respondWithFilteredResult(_0x550516,_0x539741))['catch'](handleError(_0x550516,null));};exports['show']=function(_0xee3615,_0x312106){var _0x244635={'raw':![],'where':{'id':_0xee3615[_0x4b51('0x3f')]['id']}},_0x5edd7a={};_0x5edd7a[_0x4b51('0x2d')]=_[_0x4b51('0x40')](db['DeskConfiguration']['rawAttributes']);_0x5edd7a[_0x4b51('0x2e')]=_[_0x4b51('0x40')](_0xee3615[_0x4b51('0x2e')]);_0x5edd7a[_0x4b51('0x35')]=_[_0x4b51('0x2f')](_0x5edd7a['model'],_0x5edd7a[_0x4b51('0x2e')]);_0x244635[_0x4b51('0x30')]=_[_0x4b51('0x2f')](_0x5edd7a[_0x4b51('0x2d')],qs['fields'](_0xee3615[_0x4b51('0x2e')][_0x4b51('0x31')]));_0x244635[_0x4b51('0x30')]=_0x244635[_0x4b51('0x30')][_0x4b51('0x41')]?_0x244635[_0x4b51('0x30')]:_0x5edd7a[_0x4b51('0x2d')];if(_0xee3615[_0x4b51('0x2e')][_0x4b51('0x3c')]){_0x244635[_0x4b51('0x3d')]=[{'all':!![]}];}_0x244635=_[_0x4b51('0x38')]({},_0x244635,_0xee3615['options']);return db['DeskConfiguration'][_0x4b51('0x42')](_0x244635)[_0x4b51('0x21')](handleEntityNotFound(_0x312106,null))[_0x4b51('0x21')](respondWithResult(_0x312106,null))[_0x4b51('0x43')](handleError(_0x312106,null));};exports[_0x4b51('0x44')]=function(_0x33212e,_0x31294e){return db['DeskConfiguration']['create'](_0x33212e[_0x4b51('0x45')],{})[_0x4b51('0x21')](respondWithResult(_0x31294e,0xc9))[_0x4b51('0x43')](handleError(_0x31294e,null));};exports['update']=function(_0x4b03dc,_0x32b66b){if(_0x4b03dc['body']['id']){delete _0x4b03dc[_0x4b51('0x45')]['id'];}return db[_0x4b51('0x29')][_0x4b51('0x42')]({'where':{'id':_0x4b03dc[_0x4b51('0x3f')]['id']}})['then'](handleEntityNotFound(_0x32b66b,null))['then'](saveUpdates(_0x4b03dc[_0x4b51('0x45')],null))[_0x4b51('0x21')](respondWithResult(_0x32b66b,null))[_0x4b51('0x43')](handleError(_0x32b66b,null));};exports[_0x4b51('0x22')]=function(_0x35ab02,_0x17f2e5){return db[_0x4b51('0x29')][_0x4b51('0x42')]({'where':{'id':_0x35ab02[_0x4b51('0x3f')]['id']}})[_0x4b51('0x21')](handleEntityNotFound(_0x17f2e5,null))[_0x4b51('0x21')](removeEntity(_0x17f2e5,null))['catch'](handleError(_0x17f2e5,null));};exports[_0x4b51('0x46')]=function(_0x156719,_0x441e8d,_0x4cde4b){var _0x3abfee={};var _0x198a15={};var _0x13cb27;var _0x319801;return db[_0x4b51('0x29')][_0x4b51('0x47')]({'where':{'id':_0x156719[_0x4b51('0x3f')]['id']}})[_0x4b51('0x21')](handleEntityNotFound(_0x441e8d,null))[_0x4b51('0x21')](function(_0x12358a){if(_0x12358a){_0x13cb27=_0x12358a;_0x198a15[_0x4b51('0x2d')]=_['keys'](db[_0x4b51('0x48')][_0x4b51('0x2a')]);_0x198a15[_0x4b51('0x2e')]=_[_0x4b51('0x40')](_0x156719[_0x4b51('0x2e')]);_0x198a15[_0x4b51('0x35')]=_[_0x4b51('0x2f')](_0x198a15[_0x4b51('0x2d')],_0x198a15[_0x4b51('0x2e')]);_0x3abfee[_0x4b51('0x30')]=_['intersection'](_0x198a15['model'],qs[_0x4b51('0x31')](_0x156719[_0x4b51('0x2e')][_0x4b51('0x31')]));_0x3abfee['attributes']=_0x3abfee[_0x4b51('0x30')][_0x4b51('0x41')]?_0x3abfee[_0x4b51('0x30')]:_0x198a15[_0x4b51('0x2d')];_0x3abfee[_0x4b51('0x33')]=qs[_0x4b51('0x34')](_0x156719[_0x4b51('0x2e')][_0x4b51('0x34')]);_0x3abfee['where']=qs['filters'](_[_0x4b51('0x36')](_0x156719[_0x4b51('0x2e')],_0x198a15[_0x4b51('0x35')]));if(_0x156719['query'][_0x4b51('0x37')]){_0x3abfee['where']=_[_0x4b51('0x38')](_0x3abfee[_0x4b51('0x39')],{'$or':_['map'](_0x3abfee['attributes'],function(_0x42fccd){var _0x17dd68={};_0x17dd68[_0x42fccd]={'$like':'%'+_0x156719[_0x4b51('0x2e')][_0x4b51('0x37')]+'%'};return _0x17dd68;})});}_0x3abfee=_['merge']({},_0x3abfee,_0x156719[_0x4b51('0x3b')]);return _0x13cb27['getFields'](_0x3abfee);}})[_0x4b51('0x21')](function(_0x3ea922){if(_0x3ea922){_0x319801=_0x3ea922['length'];if(!_0x156719['query'][_0x4b51('0x32')]('nolimit')){_0x3abfee[_0x4b51('0x1a')]=qs['limit'](_0x156719[_0x4b51('0x2e')][_0x4b51('0x1a')]);_0x3abfee[_0x4b51('0x18')]=qs['offset'](_0x156719[_0x4b51('0x2e')][_0x4b51('0x18')]);}return _0x13cb27[_0x4b51('0x46')](_0x3abfee);}})[_0x4b51('0x21')](function(_0x3bfb17){if(_0x3bfb17){return _0x3bfb17?{'count':_0x319801,'rows':_0x3bfb17}:null;}})['then'](respondWithResult(_0x441e8d,null))['catch'](handleError(_0x441e8d,null));};exports[_0x4b51('0x49')]=function(_0x8bcb6e,_0x170c64,_0x5be6c5){var _0x354e53={};var _0x1cf447={};var _0x4dae8a;var _0x18e561;return db[_0x4b51('0x29')][_0x4b51('0x47')]({'where':{'id':_0x8bcb6e[_0x4b51('0x3f')]['id']}})[_0x4b51('0x21')](handleEntityNotFound(_0x170c64,null))[_0x4b51('0x21')](function(_0x364515){if(_0x364515){_0x4dae8a=_0x364515;_0x1cf447[_0x4b51('0x2d')]=_['keys'](db[_0x4b51('0x48')][_0x4b51('0x2a')]);_0x1cf447['query']=_[_0x4b51('0x40')](_0x8bcb6e[_0x4b51('0x2e')]);_0x1cf447[_0x4b51('0x35')]=_[_0x4b51('0x2f')](_0x1cf447[_0x4b51('0x2d')],_0x1cf447['query']);_0x354e53['attributes']=_[_0x4b51('0x2f')](_0x1cf447[_0x4b51('0x2d')],qs[_0x4b51('0x31')](_0x8bcb6e[_0x4b51('0x2e')]['fields']));_0x354e53[_0x4b51('0x30')]=_0x354e53[_0x4b51('0x30')][_0x4b51('0x41')]?_0x354e53[_0x4b51('0x30')]:_0x1cf447[_0x4b51('0x2d')];_0x354e53['order']=qs[_0x4b51('0x34')](_0x8bcb6e[_0x4b51('0x2e')][_0x4b51('0x34')]);_0x354e53[_0x4b51('0x39')]=qs[_0x4b51('0x35')](_['pick'](_0x8bcb6e[_0x4b51('0x2e')],_0x1cf447['filters']));if(_0x8bcb6e[_0x4b51('0x2e')][_0x4b51('0x37')]){_0x354e53[_0x4b51('0x39')]=_['merge'](_0x354e53[_0x4b51('0x39')],{'$or':_[_0x4b51('0x28')](_0x354e53[_0x4b51('0x30')],function(_0x57563f){var _0x1befc6={};_0x1befc6[_0x57563f]={'$like':'%'+_0x8bcb6e['query'][_0x4b51('0x37')]+'%'};return _0x1befc6;})});}_0x354e53=_[_0x4b51('0x38')]({},_0x354e53,_0x8bcb6e[_0x4b51('0x3b')]);return _0x4dae8a[_0x4b51('0x49')](_0x354e53);}})['then'](function(_0x61be77){if(_0x61be77){_0x18e561=_0x61be77['length'];if(!_0x8bcb6e['query'][_0x4b51('0x32')](_0x4b51('0x4a'))){_0x354e53['limit']=qs[_0x4b51('0x1a')](_0x8bcb6e[_0x4b51('0x2e')]['limit']);_0x354e53[_0x4b51('0x18')]=qs[_0x4b51('0x18')](_0x8bcb6e[_0x4b51('0x2e')][_0x4b51('0x18')]);}return _0x4dae8a[_0x4b51('0x49')](_0x354e53);}})[_0x4b51('0x21')](function(_0x26287b){if(_0x26287b){return _0x26287b?{'count':_0x18e561,'rows':_0x26287b}:null;}})[_0x4b51('0x21')](respondWithResult(_0x170c64,null))['catch'](handleError(_0x170c64,null));};exports[_0x4b51('0x4b')]=function(_0x4ce66f,_0x5ca719,_0x22d028){var _0x55dc21={};var _0x2dc26c={};var _0x58e73f;var _0x87c17c;return db[_0x4b51('0x29')]['findOne']({'where':{'id':_0x4ce66f['params']['id']}})['then'](handleEntityNotFound(_0x5ca719,null))['then'](function(_0x515f79){if(_0x515f79){_0x58e73f=_0x515f79;_0x2dc26c['model']=_[_0x4b51('0x40')](db[_0x4b51('0x48')][_0x4b51('0x2a')]);_0x2dc26c[_0x4b51('0x2e')]=_[_0x4b51('0x40')](_0x4ce66f[_0x4b51('0x2e')]);_0x2dc26c[_0x4b51('0x35')]=_[_0x4b51('0x2f')](_0x2dc26c[_0x4b51('0x2d')],_0x2dc26c[_0x4b51('0x2e')]);_0x55dc21[_0x4b51('0x30')]=_['intersection'](_0x2dc26c[_0x4b51('0x2d')],qs[_0x4b51('0x31')](_0x4ce66f[_0x4b51('0x2e')][_0x4b51('0x31')]));_0x55dc21[_0x4b51('0x30')]=_0x55dc21['attributes'][_0x4b51('0x41')]?_0x55dc21[_0x4b51('0x30')]:_0x2dc26c['model'];_0x55dc21[_0x4b51('0x33')]=qs[_0x4b51('0x34')](_0x4ce66f[_0x4b51('0x2e')][_0x4b51('0x34')]);_0x55dc21[_0x4b51('0x39')]=qs[_0x4b51('0x35')](_[_0x4b51('0x36')](_0x4ce66f['query'],_0x2dc26c[_0x4b51('0x35')]));if(_0x4ce66f[_0x4b51('0x2e')][_0x4b51('0x37')]){_0x55dc21[_0x4b51('0x39')]=_[_0x4b51('0x38')](_0x55dc21[_0x4b51('0x39')],{'$or':_[_0x4b51('0x28')](_0x55dc21['attributes'],function(_0x4a1712){var _0x4f6775={};_0x4f6775[_0x4a1712]={'$like':'%'+_0x4ce66f[_0x4b51('0x2e')][_0x4b51('0x37')]+'%'};return _0x4f6775;})});}_0x55dc21=_['merge']({},_0x55dc21,_0x4ce66f[_0x4b51('0x3b')]);return _0x58e73f[_0x4b51('0x4b')](_0x55dc21);}})['then'](function(_0xa8e683){if(_0xa8e683){_0x87c17c=_0xa8e683[_0x4b51('0x41')];if(!_0x4ce66f['query'][_0x4b51('0x32')](_0x4b51('0x4a'))){_0x55dc21['limit']=qs[_0x4b51('0x1a')](_0x4ce66f[_0x4b51('0x2e')][_0x4b51('0x1a')]);_0x55dc21[_0x4b51('0x18')]=qs[_0x4b51('0x18')](_0x4ce66f[_0x4b51('0x2e')][_0x4b51('0x18')]);}return _0x58e73f[_0x4b51('0x4b')](_0x55dc21);}})[_0x4b51('0x21')](function(_0x4872d9){if(_0x4872d9){return _0x4872d9?{'count':_0x87c17c,'rows':_0x4872d9}:null;}})['then'](respondWithResult(_0x5ca719,null))[_0x4b51('0x43')](handleError(_0x5ca719,null));};exports[_0x4b51('0x4c')]=function(_0x48ae73,_0x5e7f23,_0x219e70){var _0x4b90ea={};var _0x32a8ab={};var _0x154575;var _0x11782b;return db[_0x4b51('0x29')][_0x4b51('0x47')]({'where':{'id':_0x48ae73[_0x4b51('0x3f')]['id']}})[_0x4b51('0x21')](handleEntityNotFound(_0x5e7f23,null))[_0x4b51('0x21')](function(_0x830e49){if(_0x830e49){_0x154575=_0x830e49;_0x32a8ab[_0x4b51('0x2d')]=_[_0x4b51('0x40')](db[_0x4b51('0x4d')][_0x4b51('0x2a')]);_0x32a8ab[_0x4b51('0x2e')]=_[_0x4b51('0x40')](_0x48ae73[_0x4b51('0x2e')]);_0x32a8ab[_0x4b51('0x35')]=_[_0x4b51('0x2f')](_0x32a8ab[_0x4b51('0x2d')],_0x32a8ab[_0x4b51('0x2e')]);_0x4b90ea['attributes']=_[_0x4b51('0x2f')](_0x32a8ab[_0x4b51('0x2d')],qs['fields'](_0x48ae73[_0x4b51('0x2e')]['fields']));_0x4b90ea[_0x4b51('0x30')]=_0x4b90ea['attributes'][_0x4b51('0x41')]?_0x4b90ea[_0x4b51('0x30')]:_0x32a8ab['model'];_0x4b90ea[_0x4b51('0x33')]=qs[_0x4b51('0x34')](_0x48ae73['query'][_0x4b51('0x34')]);_0x4b90ea[_0x4b51('0x39')]=qs['filters'](_['pick'](_0x48ae73[_0x4b51('0x2e')],_0x32a8ab[_0x4b51('0x35')]));if(_0x48ae73['query'][_0x4b51('0x37')]){_0x4b90ea['where']=_[_0x4b51('0x38')](_0x4b90ea[_0x4b51('0x39')],{'$or':_['map'](_0x4b90ea[_0x4b51('0x30')],function(_0x3ddab7){var _0x3de0d2={};_0x3de0d2[_0x3ddab7]={'$like':'%'+_0x48ae73['query'][_0x4b51('0x37')]+'%'};return _0x3de0d2;})});}_0x4b90ea=_['merge']({},_0x4b90ea,_0x48ae73['options']);return _0x154575['getTags'](_0x4b90ea);}})['then'](function(_0x492796){if(_0x492796){_0x11782b=_0x492796[_0x4b51('0x41')];if(!_0x48ae73[_0x4b51('0x2e')][_0x4b51('0x32')]('nolimit')){_0x4b90ea[_0x4b51('0x1a')]=qs[_0x4b51('0x1a')](_0x48ae73[_0x4b51('0x2e')][_0x4b51('0x1a')]);_0x4b90ea[_0x4b51('0x18')]=qs[_0x4b51('0x18')](_0x48ae73[_0x4b51('0x2e')]['offset']);}return _0x154575[_0x4b51('0x4c')](_0x4b90ea);}})['then'](function(_0x12a1a0){if(_0x12a1a0){return _0x12a1a0?{'count':_0x11782b,'rows':_0x12a1a0}:null;}})[_0x4b51('0x21')](respondWithResult(_0x5e7f23,null))['catch'](handleError(_0x5e7f23,null));};exports[_0x4b51('0x4e')]=function(_0x4e3a28,_0x4e15dc,_0x2654ec){if(_0x4e3a28[_0x4b51('0x45')]['id']){delete _0x4e3a28[_0x4b51('0x45')]['id'];}return db[_0x4b51('0x29')][_0x4b51('0x47')]({'where':{'id':_0x4e3a28[_0x4b51('0x3f')]['id']}})[_0x4b51('0x21')](handleEntityNotFound(_0x4e15dc,null))[_0x4b51('0x21')](function(_0x3bf318){if(_0x3bf318){return _0x3bf318['setTags'](_0x4e3a28[_0x4b51('0x45')][_0x4b51('0x4f')]||[]);}return null;})[_0x4b51('0x21')](respondWithResult(_0x4e15dc,null))[_0x4b51('0x43')](handleError(_0x4e15dc,null));};
\ No newline at end of file
index 7edcf67..a640702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9a2=['exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x3e422b,_0x5d2e87){var _0x844a96=function(_0x50b6d7){while(--_0x50b6d7){_0x3e422b['push'](_0x3e422b['shift']());}};_0x844a96(++_0x5d2e87);}(_0xd9a2,0x16e));var _0x2d9a=function(_0x386c33,_0x5b4087){_0x386c33=_0x386c33-0x0;var _0x236e00=_0xd9a2[_0x386c33];return _0x236e00;};'use strict';var _=require('lodash');var util=require(_0x2d9a('0x0'));var logger=require(_0x2d9a('0x1'))(_0x2d9a('0x2'));var moment=require(_0x2d9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d9a('0x4'));var fs=require('fs');var path=require(_0x2d9a('0x5'));var rimraf=require('rimraf');var config=require(_0x2d9a('0x6'));var attributes=require(_0x2d9a('0x7'));module[_0x2d9a('0x8')]=function(_0x2bef7d,_0x22cc88){return _0x2bef7d['define'](_0x2d9a('0x9'),attributes,{'tableName':_0x2d9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7985=['DeskConfiguration','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7985,0x1de));var _0x5798=function(_0x24a956,_0x1a7a4f){_0x24a956=_0x24a956-0x0;var _0x38aac9=_0x7985[_0x24a956];return _0x38aac9;};'use strict';var _=require(_0x5798('0x0'));var util=require('util');var logger=require(_0x5798('0x1'))(_0x5798('0x2'));var moment=require(_0x5798('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5798('0x4'));var rimraf=require(_0x5798('0x5'));var config=require(_0x5798('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x5798('0x7')]=function(_0x422990,_0x28cf24){return _0x422990['define'](_0x5798('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c502e2c..3566f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe296=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','DeskConfiguration,\x20%s,\x20%s'];(function(_0x1cfafd,_0x1d3be1){var _0x83094f=function(_0x20f18b){while(--_0x20f18b){_0x1cfafd['push'](_0x1cfafd['shift']());}};_0x83094f(++_0x1d3be1);}(_0xe296,0x1d1));var _0x6e29=function(_0x264a70,_0x57194a){_0x264a70=_0x264a70-0x0;var _0x3c8638=_0xe296[_0x264a70];return _0x3c8638;};'use strict';var _=require(_0x6e29('0x0'));var util=require(_0x6e29('0x1'));var moment=require(_0x6e29('0x2'));var BPromise=require(_0x6e29('0x3'));var rs=require(_0x6e29('0x4'));var fs=require('fs');var Redis=require(_0x6e29('0x5'));var db=require(_0x6e29('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e29('0x7'))('rpc');var config=require(_0x6e29('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfa3bc4,_0x171cbe,_0x2a8642){return new BPromise(function(_0x1e3697,_0x2a355c){return client[_0x6e29('0xa')](_0xfa3bc4,_0x2a8642)['then'](function(_0x5a89b0){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x171cbe,_0x6e29('0xb'));logger[_0x6e29('0xc')](_0x6e29('0xd'),_0x171cbe,_0x6e29('0xb'),JSON[_0x6e29('0xe')](_0x5a89b0));if(_0x5a89b0['error']){if(_0x5a89b0[_0x6e29('0xf')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x171cbe,_0x5a89b0[_0x6e29('0xf')][_0x6e29('0x10')]);return _0x2a355c(_0x5a89b0['error'][_0x6e29('0x10')]);}logger[_0x6e29('0xf')](_0x6e29('0x11'),_0x171cbe,_0x5a89b0[_0x6e29('0xf')][_0x6e29('0x10')]);return _0x1e3697(_0x5a89b0['error']['message']);}else{logger[_0x6e29('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x171cbe,_0x6e29('0xb'));_0x1e3697(_0x5a89b0[_0x6e29('0x13')][_0x6e29('0x10')]);}})[_0x6e29('0x14')](function(_0x575a40){logger[_0x6e29('0xf')](_0x6e29('0x11'),_0x171cbe,_0x575a40);_0x2a355c(_0x575a40);});});}
\ No newline at end of file
+var _0xe1bd=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1bd,0x1a3));var _0xde1b=function(_0x39d906,_0x2b31a4){_0x39d906=_0x39d906-0x0;var _0x9724b1=_0xe1bd[_0x39d906];return _0x9724b1;};'use strict';var _=require(_0xde1b('0x0'));var util=require(_0xde1b('0x1'));var moment=require(_0xde1b('0x2'));var BPromise=require(_0xde1b('0x3'));var rs=require(_0xde1b('0x4'));var fs=require('fs');var Redis=require(_0xde1b('0x5'));var db=require(_0xde1b('0x6'))['db'];var utils=require(_0xde1b('0x7'));var logger=require(_0xde1b('0x8'))(_0xde1b('0x9'));var config=require('../../config/environment');var jayson=require(_0xde1b('0xa'));var client=jayson[_0xde1b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e3b8b,_0x36b491,_0x3b4fc7){return new BPromise(function(_0x1da9f4,_0x403447){return client[_0xde1b('0xc')](_0x8e3b8b,_0x3b4fc7)[_0xde1b('0xd')](function(_0x488aa1){logger[_0xde1b('0xe')](_0xde1b('0xf'),_0x36b491,_0xde1b('0x10'));logger[_0xde1b('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x36b491,'request\x20sent',JSON[_0xde1b('0x12')](_0x488aa1));if(_0x488aa1['error']){if(_0x488aa1[_0xde1b('0x13')][_0xde1b('0x14')]===0x1f4){logger['error'](_0xde1b('0xf'),_0x36b491,_0x488aa1[_0xde1b('0x13')]['message']);return _0x403447(_0x488aa1[_0xde1b('0x13')][_0xde1b('0x15')]);}logger[_0xde1b('0x13')](_0xde1b('0xf'),_0x36b491,_0x488aa1[_0xde1b('0x13')]['message']);return _0x1da9f4(_0x488aa1[_0xde1b('0x13')][_0xde1b('0x15')]);}else{logger['info'](_0xde1b('0xf'),_0x36b491,_0xde1b('0x10'));_0x1da9f4(_0x488aa1[_0xde1b('0x16')]['message']);}})[_0xde1b('0x17')](function(_0x3f6c4d){logger[_0xde1b('0x13')](_0xde1b('0xf'),_0x36b491,_0x3f6c4d);_0x403447(_0x3f6c4d);});});}
\ No newline at end of file
index 725f344..326d447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6bf=['/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put'];(function(_0x37c977,_0xa4a1fb){var _0x4c32e7=function(_0x2dfd79){while(--_0x2dfd79){_0x37c977['push'](_0x37c977['shift']());}};_0x4c32e7(++_0xa4a1fb);}(_0xe6bf,0x8b));var _0xfe6b=function(_0x586457,_0x22bac7){_0x586457=_0x586457-0x0;var _0x3c1d40=_0xe6bf[_0x586457];return _0x3c1d40;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfe6b('0x0'));var timeout=require(_0xfe6b('0x1'));var express=require('express');var router=express[_0xfe6b('0x2')]();var fs_extra=require(_0xfe6b('0x3'));var auth=require(_0xfe6b('0x4'));var interaction=require(_0xfe6b('0x5'));var config=require(_0xfe6b('0x6'));var controller=require('./intDeskField.controller');router[_0xfe6b('0x7')]('/',auth[_0xfe6b('0x8')](),controller['index']);router[_0xfe6b('0x7')]('/:id',auth[_0xfe6b('0x8')](),controller[_0xfe6b('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfe6b('0xa')](_0xfe6b('0xb'),auth[_0xfe6b('0x8')](),controller[_0xfe6b('0xc')]);router['delete']('/:id',auth[_0xfe6b('0x8')](),controller[_0xfe6b('0xd')]);module[_0xfe6b('0xe')]=router;
\ No newline at end of file
+var _0xcf58=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','put','/:id','delete','destroy','exports','multer','util'];(function(_0x321e8a,_0x2f6cda){var _0x4c5901=function(_0x4d8c2f){while(--_0x4d8c2f){_0x321e8a['push'](_0x321e8a['shift']());}};_0x4c5901(++_0x2f6cda);}(_0xcf58,0x86));var _0x8cf5=function(_0x3d5d85,_0x3c8eda){_0x3d5d85=_0x3d5d85-0x0;var _0xd2475a=_0xcf58[_0x3d5d85];return _0xd2475a;};'use strict';var multer=require(_0x8cf5('0x0'));var util=require(_0x8cf5('0x1'));var path=require('path');var timeout=require(_0x8cf5('0x2'));var express=require(_0x8cf5('0x3'));var router=express['Router']();var fs_extra=require(_0x8cf5('0x4'));var auth=require(_0x8cf5('0x5'));var interaction=require(_0x8cf5('0x6'));var config=require(_0x8cf5('0x7'));var controller=require('./intDeskField.controller');router[_0x8cf5('0x8')]('/',auth[_0x8cf5('0x9')](),controller[_0x8cf5('0xa')]);router['get']('/:id',auth[_0x8cf5('0x9')](),controller['show']);router[_0x8cf5('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf5('0xc')](_0x8cf5('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8cf5('0xe')]('/:id',auth[_0x8cf5('0x9')](),controller[_0x8cf5('0xf')]);module[_0x8cf5('0x10')]=router;
\ No newline at end of file
index 85791b5..19cb416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe21=['variable','BOOLEAN','ENUM','string','customVariable','keyValue','STRING'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0xbe21,0x80));var _0x1be2=function(_0xa1da69,_0x34c5da){_0xa1da69=_0xa1da69-0x0;var _0x20ed09=_0xbe21[_0xa1da69];return _0x20ed09;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1be2('0x0')](_0x1be2('0x1'),'variable',_0x1be2('0x2'),_0x1be2('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1be2('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x1be2('0x1'),_0x1be2('0x5'),_0x1be2('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1be2('0x4')]},'nameField':{'type':Sequelize[_0x1be2('0x4')]},'customField':{'type':Sequelize[_0x1be2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1be2('0x4')]}};
\ No newline at end of file
+var _0xcf6c=['BOOLEAN','sequelize','exports','string','keyValue','STRING','ENUM','variable','customVariable'];(function(_0x57a146,_0x18650e){var _0x7c6457=function(_0xea17f6){while(--_0xea17f6){_0x57a146['push'](_0x57a146['shift']());}};_0x7c6457(++_0x18650e);}(_0xcf6c,0x7f));var _0xccf6=function(_0x639430,_0x3c1d15){_0x639430=_0x639430-0x0;var _0x282adb=_0xcf6c[_0x639430];return _0x282adb;};'use strict';var Sequelize=require(_0xccf6('0x0'));module[_0xccf6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xccf6('0x2'),'variable','customVariable',_0xccf6('0x3'),'picklist'),'defaultValue':_0xccf6('0x2')},'content':{'type':Sequelize[_0xccf6('0x4')]},'key':{'type':Sequelize[_0xccf6('0x4')]},'keyType':{'type':Sequelize[_0xccf6('0x5')](_0xccf6('0x2'),_0xccf6('0x6'),_0xccf6('0x7'))},'keyContent':{'type':Sequelize[_0xccf6('0x4')]},'idField':{'type':Sequelize[_0xccf6('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xccf6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xccf6('0x4')]}};
\ No newline at end of file
index f7583aa..30cb542 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb777=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','name','index','map','DeskField','rawAttributes','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','keys','intersection','includeAll','create','catch','find','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3367ab,_0x5b5dac){var _0x516d1a=function(_0x420d66){while(--_0x420d66){_0x3367ab['push'](_0x3367ab['shift']());}};_0x516d1a(++_0x5b5dac);}(_0xb777,0x107));var _0x7b77=function(_0xf3d3d,_0x18c710){_0xf3d3d=_0xf3d3d-0x0;var _0x1e5511=_0xb777[_0xf3d3d];return _0x1e5511;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b77('0x0'));var zipdir=require(_0x7b77('0x1'));var jsonpatch=require(_0x7b77('0x2'));var rp=require(_0x7b77('0x3'));var moment=require('moment');var BPromise=require(_0x7b77('0x4'));var Mustache=require(_0x7b77('0x5'));var util=require(_0x7b77('0x6'));var path=require(_0x7b77('0x7'));var sox=require(_0x7b77('0x8'));var csv=require(_0x7b77('0x9'));var ejs=require(_0x7b77('0xa'));var fs=require('fs');var fs_extra=require(_0x7b77('0xb'));var _=require('lodash');var squel=require(_0x7b77('0xc'));var crypto=require(_0x7b77('0xd'));var jsforce=require(_0x7b77('0xe'));var deskjs=require(_0x7b77('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7b77('0x10'));var Papa=require(_0x7b77('0x11'));var Redis=require(_0x7b77('0x12'));var authService=require(_0x7b77('0x13'));var qs=require(_0x7b77('0x14'));var as=require(_0x7b77('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7b77('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b77('0x17'));var db=require(_0x7b77('0x18'))['db'];function respondWithStatusCode(_0x58acba,_0x248e1b){_0x248e1b=_0x248e1b||0xcc;return function(_0x1e8eae){if(_0x1e8eae){return _0x58acba[_0x7b77('0x19')](_0x248e1b);}return _0x58acba[_0x7b77('0x1a')](_0x248e1b)['end']();};}function respondWithResult(_0x462310,_0x46d319){_0x46d319=_0x46d319||0xc8;return function(_0x241dfa){if(_0x241dfa){return _0x462310[_0x7b77('0x1a')](_0x46d319)[_0x7b77('0x1b')](_0x241dfa);}};}function respondWithFilteredResult(_0x4b3128,_0x44a2b7){return function(_0x4953a7){if(_0x4953a7){var _0x4b2075=typeof _0x44a2b7[_0x7b77('0x1c')]===_0x7b77('0x1d')&&typeof _0x44a2b7[_0x7b77('0x1e')]===_0x7b77('0x1d');var _0x4e8e74=_0x4953a7['count'];var _0x2bca29=_0x4b2075?0x0:_0x44a2b7['offset'];var _0x3248fd=_0x4b2075?_0x4953a7[_0x7b77('0x1f')]:_0x44a2b7[_0x7b77('0x1c')]+_0x44a2b7[_0x7b77('0x1e')];var _0x59a367;if(_0x3248fd>=_0x4e8e74){_0x3248fd=_0x4e8e74;_0x59a367=0xc8;}else{_0x59a367=0xce;}_0x4b3128[_0x7b77('0x1a')](_0x59a367);return _0x4b3128[_0x7b77('0x20')](_0x7b77('0x21'),_0x2bca29+'-'+_0x3248fd+'/'+_0x4e8e74)[_0x7b77('0x1b')](_0x4953a7);}return null;};}function patchUpdates(_0x1d3c8a){return function(_0x1a3b73){try{jsonpatch['apply'](_0x1a3b73,_0x1d3c8a,!![]);}catch(_0x37e6e4){return BPromise['reject'](_0x37e6e4);}return _0x1a3b73[_0x7b77('0x22')]();};}function saveUpdates(_0x347c28,_0x4bc569){return function(_0x1a6705){if(_0x1a6705){return _0x1a6705[_0x7b77('0x23')](_0x347c28)[_0x7b77('0x24')](function(_0xe75b16){return _0xe75b16;});}return null;};}function removeEntity(_0x4c09c7,_0x2ad96e){return function(_0x35fa36){if(_0x35fa36){return _0x35fa36[_0x7b77('0x25')]()[_0x7b77('0x24')](function(){_0x4c09c7[_0x7b77('0x1a')](0xcc)[_0x7b77('0x26')]();});}};}function handleEntityNotFound(_0x3aaaf1,_0x77d1a){return function(_0x58198b){if(!_0x58198b){_0x3aaaf1[_0x7b77('0x19')](0x194);}return _0x58198b;};}function handleError(_0x1e9ffb,_0x26d41a){_0x26d41a=_0x26d41a||0x1f4;return function(_0x1ee099){logger[_0x7b77('0x27')](_0x1ee099['stack']);if(_0x1ee099['name']){delete _0x1ee099[_0x7b77('0x28')];}_0x1e9ffb[_0x7b77('0x1a')](_0x26d41a)['send'](_0x1ee099);};}exports[_0x7b77('0x29')]=function(_0x4ac55b,_0x329596){var _0x551b3f={},_0x22ec8d={},_0x5418c2={'count':0x0,'rows':[]};var _0x171140=_[_0x7b77('0x2a')](db[_0x7b77('0x2b')][_0x7b77('0x2c')],function(_0xb365fb){return{'name':_0xb365fb['fieldName'],'type':_0xb365fb[_0x7b77('0x2d')][_0x7b77('0x2e')]};});_0x22ec8d[_0x7b77('0x2f')]=_['map'](_0x171140,_0x7b77('0x28'));_0x22ec8d[_0x7b77('0x30')]=_['keys'](_0x4ac55b[_0x7b77('0x30')]);_0x22ec8d[_0x7b77('0x31')]=_['intersection'](_0x22ec8d[_0x7b77('0x2f')],_0x22ec8d[_0x7b77('0x30')]);_0x551b3f['attributes']=_['intersection'](_0x22ec8d[_0x7b77('0x2f')],qs[_0x7b77('0x32')](_0x4ac55b[_0x7b77('0x30')]['fields']));_0x551b3f['attributes']=_0x551b3f[_0x7b77('0x33')][_0x7b77('0x34')]?_0x551b3f[_0x7b77('0x33')]:_0x22ec8d[_0x7b77('0x2f')];if(!_0x4ac55b[_0x7b77('0x30')][_0x7b77('0x35')](_0x7b77('0x36'))){_0x551b3f[_0x7b77('0x1e')]=qs[_0x7b77('0x1e')](_0x4ac55b[_0x7b77('0x30')]['limit']);_0x551b3f[_0x7b77('0x1c')]=qs[_0x7b77('0x1c')](_0x4ac55b[_0x7b77('0x30')][_0x7b77('0x1c')]);}_0x551b3f['order']=qs[_0x7b77('0x37')](_0x4ac55b[_0x7b77('0x30')][_0x7b77('0x37')]);_0x551b3f[_0x7b77('0x38')]=qs['filters'](_[_0x7b77('0x39')](_0x4ac55b[_0x7b77('0x30')],_0x22ec8d[_0x7b77('0x31')]),_0x171140);if(_0x4ac55b[_0x7b77('0x30')]['filter']){_0x551b3f['where']=_[_0x7b77('0x3a')](_0x551b3f[_0x7b77('0x38')],{'$or':_[_0x7b77('0x2a')](_0x171140,function(_0x555c8f){if(_0x555c8f[_0x7b77('0x2d')]!==_0x7b77('0x3b')){var _0x528fab={};_0x528fab[_0x555c8f[_0x7b77('0x28')]]={'$like':'%'+_0x4ac55b[_0x7b77('0x30')][_0x7b77('0x3c')]+'%'};return _0x528fab;}})});}_0x551b3f=_[_0x7b77('0x3a')]({},_0x551b3f,_0x4ac55b[_0x7b77('0x3d')]);var _0x47d1db={'where':_0x551b3f[_0x7b77('0x38')]};return db['DeskField'][_0x7b77('0x1f')](_0x47d1db)[_0x7b77('0x24')](function(_0xa51125){_0x5418c2[_0x7b77('0x1f')]=_0xa51125;if(_0x4ac55b[_0x7b77('0x30')]['includeAll']){_0x551b3f[_0x7b77('0x3e')]=[{'all':!![]}];}return db[_0x7b77('0x2b')]['findAll'](_0x551b3f);})['then'](function(_0x527648){_0x5418c2['rows']=_0x527648;return _0x5418c2;})[_0x7b77('0x24')](respondWithFilteredResult(_0x329596,_0x551b3f))['catch'](handleError(_0x329596,null));};exports[_0x7b77('0x3f')]=function(_0x30353d,_0xc4cbe4){var _0x190ee4={'raw':!![],'where':{'id':_0x30353d[_0x7b77('0x40')]['id']}},_0x4a564c={};_0x4a564c['model']=_[_0x7b77('0x41')](db[_0x7b77('0x2b')]['rawAttributes']);_0x4a564c[_0x7b77('0x30')]=_[_0x7b77('0x41')](_0x30353d[_0x7b77('0x30')]);_0x4a564c[_0x7b77('0x31')]=_[_0x7b77('0x42')](_0x4a564c[_0x7b77('0x2f')],_0x4a564c[_0x7b77('0x30')]);_0x190ee4[_0x7b77('0x33')]=_[_0x7b77('0x42')](_0x4a564c[_0x7b77('0x2f')],qs[_0x7b77('0x32')](_0x30353d['query'][_0x7b77('0x32')]));_0x190ee4[_0x7b77('0x33')]=_0x190ee4[_0x7b77('0x33')][_0x7b77('0x34')]?_0x190ee4[_0x7b77('0x33')]:_0x4a564c[_0x7b77('0x2f')];if(_0x30353d['query'][_0x7b77('0x43')]){_0x190ee4[_0x7b77('0x3e')]=[{'all':!![]}];}_0x190ee4=_[_0x7b77('0x3a')]({},_0x190ee4,_0x30353d['options']);return db[_0x7b77('0x2b')]['find'](_0x190ee4)[_0x7b77('0x24')](handleEntityNotFound(_0xc4cbe4,null))[_0x7b77('0x24')](respondWithResult(_0xc4cbe4,null))['catch'](handleError(_0xc4cbe4,null));};exports[_0x7b77('0x44')]=function(_0x5a4767,_0x5659bd){return db[_0x7b77('0x2b')][_0x7b77('0x44')](_0x5a4767['body'],{})[_0x7b77('0x24')](respondWithResult(_0x5659bd,0xc9))[_0x7b77('0x45')](handleError(_0x5659bd,null));};exports[_0x7b77('0x23')]=function(_0x441125,_0x538e13){if(_0x441125['body']['id']){delete _0x441125['body']['id'];}return db['DeskField'][_0x7b77('0x46')]({'where':{'id':_0x441125[_0x7b77('0x40')]['id']}})[_0x7b77('0x24')](handleEntityNotFound(_0x538e13,null))[_0x7b77('0x24')](saveUpdates(_0x441125[_0x7b77('0x47')],null))[_0x7b77('0x24')](respondWithResult(_0x538e13,null))[_0x7b77('0x45')](handleError(_0x538e13,null));};exports[_0x7b77('0x25')]=function(_0xf90128,_0x375456){return db[_0x7b77('0x2b')][_0x7b77('0x46')]({'where':{'id':_0xf90128[_0x7b77('0x40')]['id']}})['then'](handleEntityNotFound(_0x375456,null))[_0x7b77('0x24')](removeEntity(_0x375456,null))[_0x7b77('0x45')](handleError(_0x375456,null));};
\ No newline at end of file
+var _0x18b2=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','key','map','query','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','DeskField','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5e6a99,_0x21b6a8){var _0x342d94=function(_0x4d7efb){while(--_0x4d7efb){_0x5e6a99['push'](_0x5e6a99['shift']());}};_0x342d94(++_0x21b6a8);}(_0x18b2,0x85));var _0x218b=function(_0x2e2bd1,_0x234ebc){_0x2e2bd1=_0x2e2bd1-0x0;var _0x417037=_0x18b2[_0x2e2bd1];return _0x417037;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x218b('0x0'));var zipdir=require(_0x218b('0x1'));var jsonpatch=require(_0x218b('0x2'));var rp=require('request-promise');var moment=require(_0x218b('0x3'));var BPromise=require(_0x218b('0x4'));var Mustache=require(_0x218b('0x5'));var util=require(_0x218b('0x6'));var path=require(_0x218b('0x7'));var sox=require(_0x218b('0x8'));var csv=require(_0x218b('0x9'));var ejs=require(_0x218b('0xa'));var fs=require('fs');var fs_extra=require(_0x218b('0xb'));var _=require(_0x218b('0xc'));var squel=require(_0x218b('0xd'));var crypto=require(_0x218b('0xe'));var jsforce=require(_0x218b('0xf'));var deskjs=require(_0x218b('0x10'));var toCsv=require(_0x218b('0x9'));var querystring=require('querystring');var Papa=require(_0x218b('0x11'));var Redis=require(_0x218b('0x12'));var authService=require(_0x218b('0x13'));var qs=require(_0x218b('0x14'));var as=require(_0x218b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x218b('0x16'))('api');var utils=require(_0x218b('0x17'));var config=require(_0x218b('0x18'));var licenseUtil=require(_0x218b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26d573,_0x1a8456){_0x1a8456=_0x1a8456||0xcc;return function(_0x57ea4e){if(_0x57ea4e){return _0x26d573[_0x218b('0x1a')](_0x1a8456);}return _0x26d573[_0x218b('0x1b')](_0x1a8456)['end']();};}function respondWithResult(_0x3475c7,_0xa45378){_0xa45378=_0xa45378||0xc8;return function(_0x467aa0){if(_0x467aa0){return _0x3475c7[_0x218b('0x1b')](_0xa45378)[_0x218b('0x1c')](_0x467aa0);}};}function respondWithFilteredResult(_0x27b5b8,_0x384852){return function(_0x2487d3){if(_0x2487d3){var _0x461808=typeof _0x384852[_0x218b('0x1d')]===_0x218b('0x1e')&&typeof _0x384852[_0x218b('0x1f')]===_0x218b('0x1e');var _0x13ecbd=_0x2487d3[_0x218b('0x20')];var _0x477f32=_0x461808?0x0:_0x384852['offset'];var _0x2a1c5c=_0x461808?_0x2487d3[_0x218b('0x20')]:_0x384852[_0x218b('0x1d')]+_0x384852['limit'];var _0x5f249c;if(_0x2a1c5c>=_0x13ecbd){_0x2a1c5c=_0x13ecbd;_0x5f249c=0xc8;}else{_0x5f249c=0xce;}_0x27b5b8['status'](_0x5f249c);return _0x27b5b8[_0x218b('0x21')](_0x218b('0x22'),_0x477f32+'-'+_0x2a1c5c+'/'+_0x13ecbd)[_0x218b('0x1c')](_0x2487d3);}return null;};}function patchUpdates(_0x157a8e){return function(_0x449851){try{jsonpatch[_0x218b('0x23')](_0x449851,_0x157a8e,!![]);}catch(_0xeaa78b){return BPromise[_0x218b('0x24')](_0xeaa78b);}return _0x449851['save']();};}function saveUpdates(_0x50e657,_0x387c21){return function(_0x35716b){if(_0x35716b){return _0x35716b['update'](_0x50e657)[_0x218b('0x25')](function(_0x280f32){return _0x280f32;});}return null;};}function removeEntity(_0x40895a,_0x571909){return function(_0x52b3a9){if(_0x52b3a9){return _0x52b3a9[_0x218b('0x26')]()[_0x218b('0x25')](function(){_0x40895a['status'](0xcc)[_0x218b('0x27')]();});}};}function handleEntityNotFound(_0x1d70a8,_0x3a6868){return function(_0x3135d8){if(!_0x3135d8){_0x1d70a8[_0x218b('0x1a')](0x194);}return _0x3135d8;};}function handleError(_0x5120d7,_0x178214){_0x178214=_0x178214||0x1f4;return function(_0x239f75){logger[_0x218b('0x28')](_0x239f75['stack']);if(_0x239f75[_0x218b('0x29')]){delete _0x239f75['name'];}_0x5120d7['status'](_0x178214)[_0x218b('0x2a')](_0x239f75);};}exports[_0x218b('0x2b')]=function(_0x50b0f5,_0x4f2af0){var _0x539bb5={},_0x4aca90={},_0x5cc7dc={'count':0x0,'rows':[]};var _0x48b42e=_['map'](db['DeskField'][_0x218b('0x2c')],function(_0x2351d0){return{'name':_0x2351d0[_0x218b('0x2d')],'type':_0x2351d0[_0x218b('0x2e')][_0x218b('0x2f')]};});_0x4aca90['model']=_[_0x218b('0x30')](_0x48b42e,'name');_0x4aca90[_0x218b('0x31')]=_['keys'](_0x50b0f5[_0x218b('0x31')]);_0x4aca90['filters']=_['intersection'](_0x4aca90['model'],_0x4aca90['query']);_0x539bb5[_0x218b('0x32')]=_[_0x218b('0x33')](_0x4aca90['model'],qs[_0x218b('0x34')](_0x50b0f5[_0x218b('0x31')][_0x218b('0x34')]));_0x539bb5[_0x218b('0x32')]=_0x539bb5['attributes'][_0x218b('0x35')]?_0x539bb5[_0x218b('0x32')]:_0x4aca90[_0x218b('0x36')];if(!_0x50b0f5[_0x218b('0x31')][_0x218b('0x37')](_0x218b('0x38'))){_0x539bb5[_0x218b('0x1f')]=qs[_0x218b('0x1f')](_0x50b0f5['query']['limit']);_0x539bb5[_0x218b('0x1d')]=qs[_0x218b('0x1d')](_0x50b0f5[_0x218b('0x31')][_0x218b('0x1d')]);}_0x539bb5[_0x218b('0x39')]=qs[_0x218b('0x3a')](_0x50b0f5['query'][_0x218b('0x3a')]);_0x539bb5['where']=qs['filters'](_[_0x218b('0x3b')](_0x50b0f5[_0x218b('0x31')],_0x4aca90['filters']),_0x48b42e);if(_0x50b0f5[_0x218b('0x31')][_0x218b('0x3c')]){_0x539bb5['where']=_['merge'](_0x539bb5[_0x218b('0x3d')],{'$or':_[_0x218b('0x30')](_0x48b42e,function(_0x4735d2){if(_0x4735d2['type']!==_0x218b('0x3e')){var _0x220fb5={};_0x220fb5[_0x4735d2['name']]={'$like':'%'+_0x50b0f5[_0x218b('0x31')][_0x218b('0x3c')]+'%'};return _0x220fb5;}})});}_0x539bb5=_[_0x218b('0x3f')]({},_0x539bb5,_0x50b0f5[_0x218b('0x40')]);var _0x21b296={'where':_0x539bb5[_0x218b('0x3d')]};return db[_0x218b('0x41')][_0x218b('0x20')](_0x21b296)[_0x218b('0x25')](function(_0x3ef2d3){_0x5cc7dc[_0x218b('0x20')]=_0x3ef2d3;if(_0x50b0f5['query'][_0x218b('0x42')]){_0x539bb5[_0x218b('0x43')]=[{'all':!![]}];}return db['DeskField'][_0x218b('0x44')](_0x539bb5);})[_0x218b('0x25')](function(_0x5807ef){_0x5cc7dc['rows']=_0x5807ef;return _0x5cc7dc;})[_0x218b('0x25')](respondWithFilteredResult(_0x4f2af0,_0x539bb5))[_0x218b('0x45')](handleError(_0x4f2af0,null));};exports[_0x218b('0x46')]=function(_0x3f3e92,_0x35ef57){var _0x4a9076={'raw':!![],'where':{'id':_0x3f3e92[_0x218b('0x47')]['id']}},_0x13360e={};_0x13360e['model']=_['keys'](db['DeskField']['rawAttributes']);_0x13360e[_0x218b('0x31')]=_[_0x218b('0x48')](_0x3f3e92[_0x218b('0x31')]);_0x13360e['filters']=_[_0x218b('0x33')](_0x13360e[_0x218b('0x36')],_0x13360e[_0x218b('0x31')]);_0x4a9076[_0x218b('0x32')]=_[_0x218b('0x33')](_0x13360e['model'],qs[_0x218b('0x34')](_0x3f3e92[_0x218b('0x31')][_0x218b('0x34')]));_0x4a9076[_0x218b('0x32')]=_0x4a9076[_0x218b('0x32')][_0x218b('0x35')]?_0x4a9076[_0x218b('0x32')]:_0x13360e[_0x218b('0x36')];if(_0x3f3e92[_0x218b('0x31')]['includeAll']){_0x4a9076[_0x218b('0x43')]=[{'all':!![]}];}_0x4a9076=_[_0x218b('0x3f')]({},_0x4a9076,_0x3f3e92['options']);return db[_0x218b('0x41')][_0x218b('0x49')](_0x4a9076)[_0x218b('0x25')](handleEntityNotFound(_0x35ef57,null))[_0x218b('0x25')](respondWithResult(_0x35ef57,null))['catch'](handleError(_0x35ef57,null));};exports[_0x218b('0x4a')]=function(_0x5b5f4a,_0x2c8cae){return db[_0x218b('0x41')][_0x218b('0x4a')](_0x5b5f4a[_0x218b('0x4b')],{})[_0x218b('0x25')](respondWithResult(_0x2c8cae,0xc9))[_0x218b('0x45')](handleError(_0x2c8cae,null));};exports[_0x218b('0x4c')]=function(_0x2ce155,_0x30c63c){if(_0x2ce155[_0x218b('0x4b')]['id']){delete _0x2ce155['body']['id'];}return db[_0x218b('0x41')][_0x218b('0x49')]({'where':{'id':_0x2ce155[_0x218b('0x47')]['id']}})[_0x218b('0x25')](handleEntityNotFound(_0x30c63c,null))[_0x218b('0x25')](saveUpdates(_0x2ce155[_0x218b('0x4b')],null))[_0x218b('0x25')](respondWithResult(_0x30c63c,null))[_0x218b('0x45')](handleError(_0x30c63c,null));};exports[_0x218b('0x26')]=function(_0x392866,_0xf3dfe9){return db[_0x218b('0x41')][_0x218b('0x49')]({'where':{'id':_0x392866[_0x218b('0x47')]['id']}})[_0x218b('0x25')](handleEntityNotFound(_0xf3dfe9,null))[_0x218b('0x25')](removeEntity(_0xf3dfe9,null))[_0x218b('0x45')](handleError(_0xf3dfe9,null));};
\ No newline at end of file
index 78df87d..7f3f26a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa0=['define','DeskField','int_desk_fields','desk_unique_index','idField','../../config/logger','moment','bluebird','request-promise','rimraf','./intDeskField.attributes'];(function(_0x157229,_0x200271){var _0xfb7e8e=function(_0x4671d1){while(--_0x4671d1){_0x157229['push'](_0x157229['shift']());}};_0xfb7e8e(++_0x200271);}(_0x6aa0,0x68));var _0x06aa=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x6aa0[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x06aa('0x0'))('api');var moment=require(_0x06aa('0x1'));var BPromise=require(_0x06aa('0x2'));var rp=require(_0x06aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06aa('0x4'));var config=require('../../config/environment');var attributes=require(_0x06aa('0x5'));module['exports']=function(_0x2f1752,_0x2265f5){return _0x2f1752[_0x06aa('0x6')](_0x06aa('0x7'),attributes,{'tableName':_0x06aa('0x8'),'paranoid':![],'indexes':[{'name':_0x06aa('0x9'),'fields':[_0x06aa('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf418=['DeskField','int_desk_fields','desk_unique_index','FieldId','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define'];(function(_0x1a2eac,_0x169590){var _0x23b62a=function(_0x507287){while(--_0x507287){_0x1a2eac['push'](_0x1a2eac['shift']());}};_0x23b62a(++_0x169590);}(_0xf418,0x18a));var _0x8f41=function(_0x5aa52f,_0x56e6f0){_0x5aa52f=_0x5aa52f-0x0;var _0x34027d=_0xf418[_0x5aa52f];return _0x34027d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f41('0x0'))(_0x8f41('0x1'));var moment=require('moment');var BPromise=require(_0x8f41('0x2'));var rp=require(_0x8f41('0x3'));var fs=require('fs');var path=require(_0x8f41('0x4'));var rimraf=require(_0x8f41('0x5'));var config=require(_0x8f41('0x6'));var attributes=require(_0x8f41('0x7'));module['exports']=function(_0x3f6318,_0x5f0130){return _0x3f6318[_0x8f41('0x8')](_0x8f41('0x9'),attributes,{'tableName':_0x8f41('0xa'),'paranoid':![],'indexes':[{'name':_0x8f41('0xb'),'fields':['idField',_0x8f41('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3ad9840..b9a5095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfcd=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfcd,0x11d));var _0xddfc=function(_0x1ff675,_0x567bba){_0x1ff675=_0x1ff675-0x0;var _0x240596=_0xdfcd[_0x1ff675];return _0x240596;};'use strict';var _=require('lodash');var util=require(_0xddfc('0x0'));var moment=require('moment');var BPromise=require(_0xddfc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfc('0x2'));var db=require(_0xddfc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xddfc('0x4'))('rpc');var config=require(_0xddfc('0x5'));var jayson=require(_0xddfc('0x6'));var client=jayson['client'][_0xddfc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28be07,_0x310985,_0x282b04){return new BPromise(function(_0x26af9b,_0x3b0446){return client[_0xddfc('0x8')](_0x28be07,_0x282b04)[_0xddfc('0x9')](function(_0x3fa874){logger[_0xddfc('0xa')](_0xddfc('0xb'),_0x310985,_0xddfc('0xc'));logger[_0xddfc('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x310985,_0xddfc('0xc'),JSON[_0xddfc('0xe')](_0x3fa874));if(_0x3fa874[_0xddfc('0xf')]){if(_0x3fa874['error']['code']===0x1f4){logger[_0xddfc('0xf')]('DeskField,\x20%s,\x20%s',_0x310985,_0x3fa874[_0xddfc('0xf')][_0xddfc('0x10')]);return _0x3b0446(_0x3fa874[_0xddfc('0xf')][_0xddfc('0x10')]);}logger['error'](_0xddfc('0xb'),_0x310985,_0x3fa874[_0xddfc('0xf')][_0xddfc('0x10')]);return _0x26af9b(_0x3fa874[_0xddfc('0xf')][_0xddfc('0x10')]);}else{logger['info'](_0xddfc('0xb'),_0x310985,'request\x20sent');_0x26af9b(_0x3fa874['result'][_0xddfc('0x10')]);}})[_0xddfc('0x11')](function(_0x5f231f){logger['error']('DeskField,\x20%s,\x20%s',_0x310985,_0x5f231f);_0x3b0446(_0x5f231f);});});}
\ No newline at end of file
+var _0x845a=['then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x845a,0x72));var _0xa845=function(_0x439a16,_0x377a7f){_0x439a16=_0x439a16-0x0;var _0x57d671=_0x845a[_0x439a16];return _0x57d671;};'use strict';var _=require(_0xa845('0x0'));var util=require('util');var moment=require(_0xa845('0x1'));var BPromise=require(_0xa845('0x2'));var rs=require(_0xa845('0x3'));var fs=require('fs');var Redis=require(_0xa845('0x4'));var db=require(_0xa845('0x5'))['db'];var utils=require(_0xa845('0x6'));var logger=require('../../config/logger')(_0xa845('0x7'));var config=require(_0xa845('0x8'));var jayson=require(_0xa845('0x9'));var client=jayson[_0xa845('0xa')][_0xa845('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346e72,_0x5da1ce,_0x3a0356){return new BPromise(function(_0xf84127,_0x27aabf){return client['request'](_0x346e72,_0x3a0356)[_0xa845('0xc')](function(_0xbc8de6){logger[_0xa845('0xd')](_0xa845('0xe'),_0x5da1ce,_0xa845('0xf'));logger[_0xa845('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x5da1ce,_0xa845('0xf'),JSON['stringify'](_0xbc8de6));if(_0xbc8de6[_0xa845('0x11')]){if(_0xbc8de6[_0xa845('0x11')]['code']===0x1f4){logger[_0xa845('0x11')]('DeskField,\x20%s,\x20%s',_0x5da1ce,_0xbc8de6[_0xa845('0x11')][_0xa845('0x12')]);return _0x27aabf(_0xbc8de6[_0xa845('0x11')][_0xa845('0x12')]);}logger[_0xa845('0x11')]('DeskField,\x20%s,\x20%s',_0x5da1ce,_0xbc8de6[_0xa845('0x11')]['message']);return _0xf84127(_0xbc8de6[_0xa845('0x11')][_0xa845('0x12')]);}else{logger[_0xa845('0xd')](_0xa845('0xe'),_0x5da1ce,_0xa845('0xf'));_0xf84127(_0xbc8de6[_0xa845('0x13')][_0xa845('0x12')]);}})[_0xa845('0x14')](function(_0x195769){logger[_0xa845('0x11')](_0xa845('0xe'),_0x5da1ce,_0x195769);_0x27aabf(_0x195769);});});}
\ No newline at end of file
index fd46536..c87b0c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ac=['./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e5bd3,_0x410f97){var _0x2cac65=function(_0x310add){while(--_0x310add){_0x3e5bd3['push'](_0x3e5bd3['shift']());}};_0x2cac65(++_0x410f97);}(_0x60ac,0x148));var _0xc60a=function(_0x175878,_0x4f4b01){_0x175878=_0x175878-0x0;var _0x3181a7=_0x60ac[_0x175878];return _0x3181a7;};'use strict';var multer=require(_0xc60a('0x0'));var util=require(_0xc60a('0x1'));var path=require(_0xc60a('0x2'));var timeout=require(_0xc60a('0x3'));var express=require(_0xc60a('0x4'));var router=express['Router']();var fs_extra=require(_0xc60a('0x5'));var auth=require(_0xc60a('0x6'));var interaction=require(_0xc60a('0x7'));var config=require('../../config/environment');var controller=require(_0xc60a('0x8'));router[_0xc60a('0x9')]('/',auth[_0xc60a('0xa')](),controller['index']);router[_0xc60a('0x9')](_0xc60a('0xb'),auth[_0xc60a('0xa')](),controller[_0xc60a('0xc')]);router[_0xc60a('0x9')](_0xc60a('0xd'),auth[_0xc60a('0xa')](),controller[_0xc60a('0xe')]);router['get'](_0xc60a('0xf'),auth['isAuthenticated'](),controller[_0xc60a('0x10')]);router[_0xc60a('0x11')]('/',auth[_0xc60a('0xa')](),controller[_0xc60a('0x12')]);router['post'](_0xc60a('0xd'),auth['isAuthenticated'](),controller[_0xc60a('0x13')]);router[_0xc60a('0x14')](_0xc60a('0xb'),auth[_0xc60a('0xa')](),controller[_0xc60a('0x15')]);router['delete']('/:id',auth[_0xc60a('0xa')](),controller[_0xc60a('0x16')]);module[_0xc60a('0x17')]=router;
\ No newline at end of file
+var _0x79e6=['Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express'];(function(_0x11ac91,_0x20c725){var _0x5a63dc=function(_0x157380){while(--_0x157380){_0x11ac91['push'](_0x11ac91['shift']());}};_0x5a63dc(++_0x20c725);}(_0x79e6,0x85));var _0x679e=function(_0x122527,_0x46ed6b){_0x122527=_0x122527-0x0;var _0x5d82f9=_0x79e6[_0x122527];return _0x5d82f9;};'use strict';var multer=require(_0x679e('0x0'));var util=require(_0x679e('0x1'));var path=require(_0x679e('0x2'));var timeout=require(_0x679e('0x3'));var express=require(_0x679e('0x4'));var router=express[_0x679e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x679e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x679e('0x7'));var controller=require(_0x679e('0x8'));router['get']('/',auth[_0x679e('0x9')](),controller[_0x679e('0xa')]);router[_0x679e('0xb')]('/:id',auth[_0x679e('0x9')](),controller[_0x679e('0xc')]);router[_0x679e('0xb')](_0x679e('0xd'),auth[_0x679e('0x9')](),controller[_0x679e('0xe')]);router['get'](_0x679e('0xf'),auth['isAuthenticated'](),controller[_0x679e('0x10')]);router[_0x679e('0x11')]('/',auth['isAuthenticated'](),controller[_0x679e('0x12')]);router[_0x679e('0x11')](_0x679e('0xd'),auth[_0x679e('0x9')](),controller['addConfiguration']);router[_0x679e('0x13')](_0x679e('0x14'),auth[_0x679e('0x9')](),controller[_0x679e('0x15')]);router[_0x679e('0x16')](_0x679e('0x14'),auth[_0x679e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f5c8505..cffbf19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5e3=['exports','STRING','BOOLEAN'];(function(_0x24c8eb,_0x29e781){var _0x5c4625=function(_0x153986){while(--_0x153986){_0x24c8eb['push'](_0x24c8eb['shift']());}};_0x5c4625(++_0x29e781);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x200f94,_0x161dd0){_0x200f94=_0x200f94-0x0;var _0x4fd56a=_0xe5e3[_0x200f94];return _0x4fd56a;};'use strict';var Sequelize=require('sequelize');module[_0x3e5e('0x0')]={'name':{'type':Sequelize[_0x3e5e('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3e5e('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3e5e('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5e('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3e5e('0x1')]},'modernAuthentication':{'type':Sequelize[_0x3e5e('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x624c=['STRING','BOOLEAN','exports'];(function(_0x1d90f0,_0x3c2ff0){var _0x4e59c0=function(_0x13f859){while(--_0x13f859){_0x1d90f0['push'](_0x1d90f0['shift']());}};_0x4e59c0(++_0x3c2ff0);}(_0x624c,0x1ee));var _0xc624=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0x624c[_0xd98def];return _0x55b182;};'use strict';var Sequelize=require('sequelize');module[_0xc624('0x0')]={'name':{'type':Sequelize[_0xc624('0x1')]},'username':{'type':Sequelize[_0xc624('0x1')]},'password':{'type':Sequelize[_0xc624('0x1')]},'remoteUri':{'type':Sequelize[_0xc624('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc624('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc624('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xc624('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 3c8bf7b..857237a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6707=['offset','undefined','limit','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll','include','catch','show','params','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','password','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','remove','includes','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','forEach','isNil','BooleanAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','UserLocalizedLabel','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json'];(function(_0x4505b8,_0x4ac0d7){var _0x4b3368=function(_0x2fd5cf){while(--_0x2fd5cf){_0x4505b8['push'](_0x4505b8['shift']());}};_0x4b3368(++_0x4ac0d7);}(_0x6707,0x165));var _0x7670=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x6707[_0x45f951];return _0x24756c;};'use strict';var rp=require(_0x7670('0x0'));var util=require('util');var _=require(_0x7670('0x1'));var qs=require(_0x7670('0x2'));var logger=require(_0x7670('0x3'))(_0x7670('0x4'));var db=require(_0x7670('0x5'))['db'];var integrations=require(_0x7670('0x6'));function respondWithResult(_0x3336a1,_0x141559){_0x141559=_0x141559||0xc8;return function(_0x17fc94){if(_0x17fc94){return _0x3336a1[_0x7670('0x7')](_0x141559)[_0x7670('0x8')](_0x17fc94);}};}function respondWithFilteredResult(_0x90adf8,_0x580650){return function(_0x417ff5){if(_0x417ff5){var _0x13f0c2=typeof _0x580650[_0x7670('0x9')]===_0x7670('0xa')&&typeof _0x580650[_0x7670('0xb')]==='undefined';var _0x313680=_0x417ff5[_0x7670('0xc')];var _0x491d0d=_0x13f0c2?0x0:_0x580650[_0x7670('0x9')];var _0x3b3548=_0x13f0c2?_0x417ff5[_0x7670('0xc')]:_0x580650[_0x7670('0x9')]+_0x580650['limit'];var _0xd6515a;if(_0x3b3548>=_0x313680){_0x3b3548=_0x313680;_0xd6515a=0xc8;}else{_0xd6515a=0xce;}_0x90adf8[_0x7670('0x7')](_0xd6515a);return _0x90adf8[_0x7670('0xd')](_0x7670('0xe'),_0x491d0d+'-'+_0x3b3548+'/'+_0x313680)[_0x7670('0x8')](_0x417ff5);}return null;};}function saveUpdates(_0xc44cd2){return function(_0x411b9f){if(_0x411b9f){return _0x411b9f['update'](_0xc44cd2)[_0x7670('0xf')](function(_0x169014){return _0x169014;});}return null;};}function removeEntity(_0x1a6e5e){return function(_0x50450b){if(_0x50450b){return _0x50450b[_0x7670('0x10')]()[_0x7670('0xf')](function(){_0x1a6e5e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x578b31){return function(_0x1438ab){if(!_0x1438ab){_0x578b31[_0x7670('0x11')](0x194);}return _0x1438ab;};}function handleError(_0x4b6a60,_0x1650ef){_0x1650ef=_0x1650ef||0x1f4;return function(_0x3bd125){logger[_0x7670('0x12')](_0x3bd125[_0x7670('0x13')]);if(_0x3bd125[_0x7670('0x14')]){delete _0x3bd125[_0x7670('0x14')];}_0x4b6a60[_0x7670('0x7')](_0x1650ef)[_0x7670('0x15')](_0x3bd125);};}exports[_0x7670('0x16')]=function(_0x11fafe,_0x13c008){var _0x5c8b92={},_0x404588={},_0x3ba671={'count':0x0,'rows':[]};var _0x2ce478=_['map'](db[_0x7670('0x17')][_0x7670('0x18')],function(_0x12fddb){return{'name':_0x12fddb['fieldName'],'type':_0x12fddb['type'][_0x7670('0x19')]};});_0x404588[_0x7670('0x1a')]=_[_0x7670('0x1b')](_0x2ce478,_0x7670('0x14'));_0x404588[_0x7670('0x1c')]=_[_0x7670('0x1d')](_0x11fafe[_0x7670('0x1c')]);_0x404588[_0x7670('0x1e')]=_['intersection'](_0x404588[_0x7670('0x1a')],_0x404588[_0x7670('0x1c')]);_0x5c8b92[_0x7670('0x1f')]=_[_0x7670('0x20')](_0x404588[_0x7670('0x1a')],qs[_0x7670('0x21')](_0x11fafe[_0x7670('0x1c')]['fields']));_0x5c8b92[_0x7670('0x1f')]=_0x5c8b92[_0x7670('0x1f')][_0x7670('0x22')]?_0x5c8b92[_0x7670('0x1f')]:_0x404588['model'];if(!_0x11fafe[_0x7670('0x1c')][_0x7670('0x23')](_0x7670('0x24'))){_0x5c8b92['limit']=qs['limit'](_0x11fafe[_0x7670('0x1c')]['limit']);_0x5c8b92[_0x7670('0x9')]=qs[_0x7670('0x9')](_0x11fafe[_0x7670('0x1c')][_0x7670('0x9')]);}_0x5c8b92['order']=qs[_0x7670('0x25')](_0x11fafe['query'][_0x7670('0x25')]);_0x5c8b92['where']=qs[_0x7670('0x1e')](_[_0x7670('0x26')](_0x11fafe[_0x7670('0x1c')],_0x404588['filters']),_0x2ce478);if(_0x11fafe['query'][_0x7670('0x27')]){_0x5c8b92[_0x7670('0x28')]=_[_0x7670('0x29')](_0x5c8b92[_0x7670('0x28')],{'$or':_[_0x7670('0x1b')](_0x2ce478,function(_0x57f9e5){if(_0x57f9e5[_0x7670('0x2a')]!=='VIRTUAL'){var _0x432f3a={};_0x432f3a[_0x57f9e5[_0x7670('0x14')]]={'$like':'%'+_0x11fafe[_0x7670('0x1c')]['filter']+'%'};return _0x432f3a;}})});}_0x5c8b92=_[_0x7670('0x29')]({},_0x5c8b92,_0x11fafe[_0x7670('0x2b')]);var _0xaa022b={'where':_0x5c8b92[_0x7670('0x28')]};return db[_0x7670('0x17')][_0x7670('0xc')](_0xaa022b)[_0x7670('0xf')](function(_0x186f4a){_0x3ba671[_0x7670('0xc')]=_0x186f4a;if(_0x11fafe['query'][_0x7670('0x2c')]){_0x5c8b92[_0x7670('0x2d')]=[{'all':!![]}];}return db[_0x7670('0x17')]['findAll'](_0x5c8b92);})[_0x7670('0xf')](function(_0x136488){_0x3ba671['rows']=_0x136488;return _0x3ba671;})['then'](respondWithFilteredResult(_0x13c008,_0x5c8b92))[_0x7670('0x2e')](handleError(_0x13c008,null));};exports[_0x7670('0x2f')]=function(_0x5650df,_0x3cdadd){var _0x1caf5a={'raw':![],'where':{'id':_0x5650df[_0x7670('0x30')]['id']}},_0x3bd017={};_0x3bd017[_0x7670('0x1a')]=_[_0x7670('0x1d')](db['Dynamics365Account'][_0x7670('0x18')]);_0x3bd017[_0x7670('0x1c')]=_[_0x7670('0x1d')](_0x5650df[_0x7670('0x1c')]);_0x3bd017[_0x7670('0x1e')]=_[_0x7670('0x20')](_0x3bd017[_0x7670('0x1a')],_0x3bd017['query']);_0x1caf5a['attributes']=_[_0x7670('0x20')](_0x3bd017[_0x7670('0x1a')],qs['fields'](_0x5650df[_0x7670('0x1c')][_0x7670('0x21')]));_0x1caf5a[_0x7670('0x1f')]=_0x1caf5a['attributes'][_0x7670('0x22')]?_0x1caf5a[_0x7670('0x1f')]:_0x3bd017[_0x7670('0x1a')];if(_0x5650df[_0x7670('0x1c')][_0x7670('0x2c')]){_0x1caf5a['include']=[{'all':!![]}];}_0x1caf5a=_[_0x7670('0x29')]({},_0x1caf5a,_0x5650df[_0x7670('0x2b')]);return db[_0x7670('0x17')][_0x7670('0x31')](_0x1caf5a)[_0x7670('0xf')](handleEntityNotFound(_0x3cdadd,null))[_0x7670('0xf')](respondWithResult(_0x3cdadd,null))[_0x7670('0x2e')](handleError(_0x3cdadd,null));};exports[_0x7670('0x32')]=function(_0x56eac2,_0x2b86c3){return db[_0x7670('0x17')][_0x7670('0x32')](_0x56eac2[_0x7670('0x33')],{})[_0x7670('0xf')](respondWithResult(_0x2b86c3,0xc9))[_0x7670('0x2e')](handleError(_0x2b86c3,null));};exports[_0x7670('0x34')]=function(_0x541b83,_0x52079f){if(_0x541b83[_0x7670('0x33')]['id']){delete _0x541b83[_0x7670('0x33')]['id'];}return db[_0x7670('0x17')][_0x7670('0x31')]({'where':{'id':_0x541b83['params']['id']}})[_0x7670('0xf')](handleEntityNotFound(_0x52079f,null))[_0x7670('0xf')](saveUpdates(_0x541b83[_0x7670('0x33')],null))[_0x7670('0xf')](respondWithResult(_0x52079f,null))[_0x7670('0x2e')](handleError(_0x52079f,null));};exports[_0x7670('0x10')]=function(_0x2cae24,_0x4a51c6){return db[_0x7670('0x17')][_0x7670('0x31')]({'where':{'id':_0x2cae24[_0x7670('0x30')]['id']}})[_0x7670('0xf')](handleEntityNotFound(_0x4a51c6,null))['then'](removeEntity(_0x4a51c6,null))['catch'](handleError(_0x4a51c6,null));};exports[_0x7670('0x35')]=function(_0x262301,_0x2029a0){var _0x5461a7={};var _0x3c9686={};var _0x11701a;var _0x5c2c66;return db[_0x7670('0x17')][_0x7670('0x36')]({'where':{'id':_0x262301[_0x7670('0x30')]['id']}})['then'](handleEntityNotFound(_0x2029a0,null))[_0x7670('0xf')](function(_0x36a0a0){if(_0x36a0a0){_0x11701a=_0x36a0a0;_0x3c9686[_0x7670('0x1a')]=_[_0x7670('0x1d')](db[_0x7670('0x37')][_0x7670('0x18')]);_0x3c9686[_0x7670('0x1c')]=_[_0x7670('0x1d')](_0x262301[_0x7670('0x1c')]);_0x3c9686[_0x7670('0x1e')]=_[_0x7670('0x20')](_0x3c9686['model'],_0x3c9686[_0x7670('0x1c')]);_0x5461a7[_0x7670('0x1f')]=_['intersection'](_0x3c9686['model'],qs[_0x7670('0x21')](_0x262301[_0x7670('0x1c')][_0x7670('0x21')]));_0x5461a7[_0x7670('0x1f')]=_0x5461a7[_0x7670('0x1f')][_0x7670('0x22')]?_0x5461a7[_0x7670('0x1f')]:_0x3c9686[_0x7670('0x1a')];_0x5461a7['order']=qs[_0x7670('0x25')](_0x262301[_0x7670('0x1c')][_0x7670('0x25')]);_0x5461a7['where']=qs[_0x7670('0x1e')](_['pick'](_0x262301[_0x7670('0x1c')],_0x3c9686['filters']));if(_0x262301[_0x7670('0x1c')][_0x7670('0x27')]){_0x5461a7[_0x7670('0x28')]=_['merge'](_0x5461a7['where'],{'$or':_['map'](_0x5461a7[_0x7670('0x1f')],function(_0x47eae4){var _0x9283e={};_0x9283e[_0x47eae4]={'$like':'%'+_0x262301[_0x7670('0x1c')][_0x7670('0x27')]+'%'};return _0x9283e;})});}_0x5461a7=_[_0x7670('0x29')]({},_0x5461a7,_0x262301[_0x7670('0x2b')]);return _0x11701a['getConfigurations'](_0x5461a7);}})[_0x7670('0xf')](function(_0x49dd70){if(_0x49dd70){_0x5c2c66=_0x49dd70[_0x7670('0x22')];if(!_0x262301[_0x7670('0x1c')]['hasOwnProperty'](_0x7670('0x24'))){_0x5461a7[_0x7670('0xb')]=qs[_0x7670('0xb')](_0x262301[_0x7670('0x1c')][_0x7670('0xb')]);_0x5461a7[_0x7670('0x9')]=qs[_0x7670('0x9')](_0x262301[_0x7670('0x1c')]['offset']);}return _0x11701a['getConfigurations'](_0x5461a7);}})[_0x7670('0xf')](function(_0x2328fe){if(_0x2328fe){return _0x2328fe?{'count':_0x5c2c66,'rows':_0x2328fe}:null;}})[_0x7670('0xf')](respondWithResult(_0x2029a0,null))[_0x7670('0x2e')](handleError(_0x2029a0,null));};exports[_0x7670('0x38')]=function(_0x4b1cb0,_0x2b86fc){if(_0x4b1cb0[_0x7670('0x33')]['id']){delete _0x4b1cb0[_0x7670('0x33')]['id'];}return db[_0x7670('0x17')][_0x7670('0x36')]({'where':{'id':_0x4b1cb0[_0x7670('0x30')]['id']}})['then'](handleEntityNotFound(_0x2b86fc,null))[_0x7670('0xf')](function(_0x4f2584){if(_0x4f2584){_0x4b1cb0[_0x7670('0x33')][_0x7670('0x39')]=_0x4f2584['id'];_0x4b1cb0[_0x7670('0x33')][_0x7670('0x3a')]=integrations[_0x7670('0x3b')](_0x4b1cb0[_0x7670('0x33')][_0x7670('0x3c')],_0x4b1cb0[_0x7670('0x33')]['type']);_0x4b1cb0[_0x7670('0x33')][_0x7670('0x3d')]=integrations[_0x7670('0x3e')](_0x4b1cb0[_0x7670('0x33')][_0x7670('0x3c')],_0x4b1cb0[_0x7670('0x33')]['type']);return db[_0x7670('0x37')][_0x7670('0x32')](_0x4b1cb0['body'],{'include':[{'model':db[_0x7670('0x3f')],'as':_0x7670('0x3a')},{'model':db[_0x7670('0x3f')],'as':_0x7670('0x3d')}]});}return null;})[_0x7670('0xf')](respondWithResult(_0x2b86fc,null))[_0x7670('0x2e')](handleError(_0x2b86fc,null));};function sanitizeRemoteUri(_0x56c2a5){var _0x218526=_0x56c2a5['slice'](-0x1);if(_0x218526==='/')return _0x56c2a5[_0x7670('0x40')](0x0,_0x56c2a5[_0x7670('0x41')](_0x218526));return _0x56c2a5;}function getWebApiUrl(_0x2e6f08){return util['format'](_0x7670('0x42'),_0x2e6f08);}exports['getFields']=function(_0x2a08a4,_0x4181b5){var _0x143f62=_0x2a08a4['query'][_0x7670('0x43')];var _0xe6ef5b=_0x143f62===_0x7670('0x44')?_0x7670('0x45'):_0x7670('0x46');var _0x16b837='';var _0x7712d9='';var _0x29f903='';var _0xb5635a='';var _0x15106c='';var _0x36b739='';var _0x1d11da='';var _0x1986f1='';var _0x2eeb16=[_0x7670('0x47'),'description',_0x7670('0x48'),_0x7670('0x49'),'caseorigincode',_0x7670('0x4a'),_0x7670('0x4b'),_0x7670('0x4c'),_0x7670('0x4d'),_0x7670('0x4e')];var _0x567e08=['accountidname','accountidyominame','actualserviceunits',_0x7670('0x4f'),_0x7670('0x50'),'contactidyominame',_0x7670('0x51'),_0x7670('0x52'),_0x7670('0x53'),_0x7670('0x54'),'createdbyname',_0x7670('0x55'),_0x7670('0x56'),'createdonbehalfbyname',_0x7670('0x57'),_0x7670('0x58'),_0x7670('0x59'),_0x7670('0x5a'),_0x7670('0x5b'),_0x7670('0x5c'),_0x7670('0x5d'),_0x7670('0x5e'),'escalatedon',_0x7670('0x5f'),_0x7670('0x60'),_0x7670('0x61'),_0x7670('0x62'),'influencescore','kbarticleidname',_0x7670('0x63'),_0x7670('0x64'),_0x7670('0x65'),_0x7670('0x66'),'modifiedbyname',_0x7670('0x67'),_0x7670('0x68'),'modifiedonbehalfbyname',_0x7670('0x69'),_0x7670('0x6a'),_0x7670('0x6b'),_0x7670('0x6c'),'onholdtime',_0x7670('0x6d'),'owneridname',_0x7670('0x6e'),_0x7670('0x6f'),_0x7670('0x70'),_0x7670('0x71'),_0x7670('0x72'),_0x7670('0x73'),_0x7670('0x74'),_0x7670('0x75'),_0x7670('0x76'),'resolvebykpiidname','responseby',_0x7670('0x77'),_0x7670('0x78'),_0x7670('0x79'),'slainvokedidname',_0x7670('0x7a'),'socialprofileidname',_0x7670('0x7b'),_0x7670('0x7c'),_0x7670('0x7d'),_0x7670('0x7e'),_0x7670('0x7f'),'transactioncurrencyidname','traversedpath',_0x7670('0x80'),_0x7670('0x81')];var _0x317de7=_0x2eeb16[_0x7670('0x82')](_0x567e08);return db['Dynamics365Account']['findOne']({'where':{'id':_0x2a08a4[_0x7670('0x30')]['id']},'attributes':['id',_0x7670('0x83'),'password',_0x7670('0x84'),_0x7670('0x85'),_0x7670('0x86'),_0x7670('0x87'),_0x7670('0x88')],'include':[{'model':db[_0x7670('0x89')],'as':_0x7670('0x89'),'attributes':['id',_0x7670('0x8a'),_0x7670('0x8b')]}]})['then'](handleEntityNotFound(_0x4181b5,null))['then'](function(_0x5386b8){if(_0x5386b8){if(_0x5386b8['modernAuthentication']){_0x5386b8['access_token']=_0x5386b8[_0x7670('0x89')][_0x7670('0x8a')];_0x1986f1=sanitizeRemoteUri(_0x5386b8[_0x7670('0x89')][_0x7670('0x8b')]);_0x1d11da=getWebApiUrl(_0x1986f1);return _0x5386b8;}_0x1986f1=sanitizeRemoteUri(_0x5386b8[_0x7670('0x84')]);_0x1d11da=getWebApiUrl(_0x1986f1);var _0x1cb23d={'method':_0x7670('0x8c'),'uri':'https://login.microsoftonline.com/'+_0x5386b8[_0x7670('0x85')]+_0x7670('0x8d'),'form':{'client_id':_0x5386b8[_0x7670('0x86')],'resource':_0x1986f1,'username':_0x5386b8['username'],'password':_0x5386b8[_0x7670('0x8e')],'grant_type':_0x7670('0x8e'),'client_secret':_0x5386b8[_0x7670('0x87')]},'json':!![]};return rp(_0x1cb23d);}})[_0x7670('0xf')](function(_0x5128dc){_0x36b739=_0x5128dc['access_token'];var _0x56f75a={'method':'GET','uri':encodeURI(_0x1d11da+_0x7670('0x8f')+_0xe6ef5b+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x36b739,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x56f75a);})[_0x7670('0xf')](function(_0x4d285f){var _0x477328=_0x4d285f[_0x7670('0x90')][0x0];var _0x527775=_0x477328['MetadataId'];var _0x1e9bd6={'method':_0x7670('0x91'),'uri':_0x1d11da+'EntityDefinitions('+_0x527775+_0x7670('0x92'),'headers':{'Authorization':_0x7670('0x93')+_0x36b739,'If-None-Match':null,'OData-Version':_0x7670('0x94')},'json':!![]};return rp(_0x1e9bd6);})[_0x7670('0xf')](function(_0x3cd0cb){_0x16b837=_0x3cd0cb;_0x7712d9=_0x16b837['Attributes'];_0x7712d9=_[_0x7670('0x95')](_0x7712d9,function(_0xf28264){return!_0x317de7[_0x7670('0x96')](_0xf28264['LogicalName']);});var _0x264504=[];var _0x4ca082=[];_0x7712d9['forEach'](function(_0x145d90){if(_0x145d90[_0x7670('0x97')]){var _0x569be2=_0x145d90['@odata.type'][_0x7670('0x40')](_0x145d90['@odata.type']['lastIndexOf']('.')+0x1);if(_0x569be2===_0x7670('0x98')){_0x264504[_0x7670('0x99')](getSelectList(_0x1d11da,_0x143f62,_0x4ca082,_0x16b837[_0x7670('0x9a')],_0x145d90[_0x7670('0x9a')],_0x36b739));}}});return Promise[_0x7670('0x9b')](_0x264504);})[_0x7670('0xf')](function(_0x17c529){_0x29f903=_0x17c529[0x0];var _0xb3ea0=[];var _0x3e8d54=[];_0x7712d9[_0x7670('0x9c')](function(_0x1f36c9){if(!_[_0x7670('0x9d')](_0x1f36c9[_0x7670('0x97')])){var _0x457024=_0x1f36c9[_0x7670('0x97')][_0x7670('0x40')](_0x1f36c9[_0x7670('0x97')][_0x7670('0x41')]('.')+0x1);if(_0x457024===_0x7670('0x9e')){_0xb3ea0[_0x7670('0x99')](getBooleanList(_0x1d11da,_0x143f62,_0x3e8d54,_0x16b837['MetadataId'],_0x1f36c9['MetadataId'],_0x36b739));}}});return Promise[_0x7670('0x9b')](_0xb3ea0);})[_0x7670('0xf')](function(_0x11cc49){_0xb5635a=_0x11cc49[0x0];var _0x4b63a7=[];var _0x72665c=[];_0x7712d9['forEach'](function(_0x1b05e9){if(_0x1b05e9[_0x7670('0x97')]){var _0x36d379=_0x1b05e9['@odata.type']['substring'](_0x1b05e9[_0x7670('0x97')]['lastIndexOf']('.')+0x1);if(_0x36d379==='StringAttributeMetadata'||_0x36d379==='DoubleAttributeMetadata'||_0x36d379===_0x7670('0x9f')||_0x36d379===_0x7670('0xa0')||_0x36d379===_0x7670('0xa1')||_0x36d379===_0x7670('0xa2')||_0x36d379===_0x7670('0xa3')||_0x36d379==='EntityNameAttributeMetadata'||_0x36d379===_0x7670('0xa4')||_0x36d379===_0x7670('0xa5')){_0x4b63a7[_0x7670('0x99')](getInputList(_0x1d11da,_0x143f62,_0x36d379,_0x72665c,_0x16b837['MetadataId'],_0x1b05e9[_0x7670('0x9a')],_0x36b739));}}});return Promise['all'](_0x4b63a7);})[_0x7670('0xf')](function(_0x8f6a86){_0x15106c=_0x8f6a86[0x0];var _0xef1fad=_0x29f903[_0x7670('0x82')](_0xb5635a)[_0x7670('0x82')](_0x15106c);var _0x105687={'count':_0xef1fad['length'],'rows':_0xef1fad};return _0x105687;})[_0x7670('0xf')](respondWithResult(_0x4181b5,null))[_0x7670('0x2e')](function(_0x37fa38){var _0x3cd680=_0x2a08a4[_0x7670('0x1c')]['test']?0x1f4:_0x37fa38[_0x7670('0xa6')]||0x1f4;logger[_0x7670('0x12')](_0x37fa38[_0x7670('0x13')]);delete _0x37fa38['name'];if(_0x3cd680===0x191){_0x3cd680=0x190;}_0x4181b5['status'](_0x3cd680)[_0x7670('0x15')](_0x2a08a4[_0x7670('0x1c')]['test']?{'message':_0x7670('0xa7'),'statusCode':_0x37fa38[_0x7670('0xa6')]}:_0x37fa38);});};function getSelectList(_0x408603,_0x33e3b9,_0x49baa8,_0x24ba90,_0x47fed6,_0x39014c){var _0x1a0991={'method':'GET','uri':_0x408603+_0x7670('0xa8')+_0x24ba90+')/Attributes('+_0x47fed6+_0x7670('0xa9')+_0x7670('0xaa'),'headers':{'Authorization':_0x7670('0x93')+_0x39014c,'If-None-Match':null,'OData-Version':_0x7670('0x94')},'json':!![]};return rp(_0x1a0991)['then'](function(_0x1cb681){var _0x5ebe34=[];var _0xd2fa44=_0x1cb681['OptionSet'][_0x7670('0xab')];_0xd2fa44[_0x7670('0x9c')](function(_0x4c128c){_0x5ebe34[_0x7670('0x99')]({'name':_0x4c128c['Label']['UserLocalizedLabel'][_0x7670('0xac')],'value':String(_0x4c128c[_0x7670('0xad')])});});var _0x2b7227={'id':_0x33e3b9+'_'+_0x1cb681['LogicalName'],'name':_0x1cb681['DisplayName']['UserLocalizedLabel'][_0x7670('0xac')],'custom':![],'options':_0x5ebe34};_0x49baa8[_0x7670('0x99')](_0x2b7227);return _0x49baa8;});}function getBooleanList(_0x147515,_0x20ff14,_0xcc73ea,_0x1f3354,_0x1123ab,_0x30ae09){var _0x1ae33a={'method':_0x7670('0x91'),'uri':_0x147515+_0x7670('0xa8')+_0x1f3354+_0x7670('0xae')+_0x1123ab+_0x7670('0xaf'),'headers':{'Authorization':'Bearer\x20'+_0x30ae09,'If-None-Match':null,'OData-Version':_0x7670('0x94')},'json':!![]};return rp(_0x1ae33a)[_0x7670('0xf')](function(_0xce3480){var _0x184c32=[];_0x184c32[_0x7670('0x99')]({'name':_0xce3480[_0x7670('0xb0')][_0x7670('0xb1')]['Label']['UserLocalizedLabel'][_0x7670('0xac')],'value':_0x7670('0xb2')},{'name':_0xce3480['OptionSet']['FalseOption'][_0x7670('0xac')][_0x7670('0xb3')][_0x7670('0xac')],'value':'false'});var _0x42dca4={'id':_0x20ff14+'_'+_0xce3480[_0x7670('0xb4')],'name':_0xce3480[_0x7670('0xb5')][_0x7670('0xb3')][_0x7670('0xac')],'custom':![],'options':_0x184c32};_0xcc73ea[_0x7670('0x99')](_0x42dca4);return _0xcc73ea;});}function getInputList(_0x2e1116,_0x94dce2,_0xd14ef2,_0x4945b1,_0x4f2134,_0x14c592,_0x268f15){var _0x4db8d7={'method':_0x7670('0x91'),'uri':_0x2e1116+_0x7670('0xa8')+_0x4f2134+_0x7670('0xae')+_0x14c592+_0x7670('0xb6')+_0xd14ef2+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x268f15,'If-None-Match':null,'OData-Version':_0x7670('0x94')},'json':!![]};return rp(_0x4db8d7)['then'](function(_0x48fa1e){var _0x28af0f={'id':_0x94dce2+'_'+_0x48fa1e[_0x7670('0xb4')],'name':_0x48fa1e[_0x7670('0xb5')]['UserLocalizedLabel']?_0x48fa1e[_0x7670('0xb5')]['UserLocalizedLabel']['Label']:_0x48fa1e[_0x7670('0xb4')],'custom':![],'options':[]};_0x4945b1[_0x7670('0x99')](_0x28af0f);return _0x4945b1;});}
\ No newline at end of file
+var _0x253c=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','sort','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','ownerid','subject','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productserialnumber','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','concat','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','https://login.microsoftonline.com/','/oauth2/token','username','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status'];(function(_0x4a6339,_0x30cd3a){var _0x5e9a19=function(_0x4ac2b4){while(--_0x4ac2b4){_0x4a6339['push'](_0x4a6339['shift']());}};_0x5e9a19(++_0x30cd3a);}(_0x253c,0xb0));var _0xc253=function(_0x3767ef,_0x29c168){_0x3767ef=_0x3767ef-0x0;var _0x14c673=_0x253c[_0x3767ef];return _0x14c673;};'use strict';var rp=require(_0xc253('0x0'));var util=require(_0xc253('0x1'));var _=require('lodash');var qs=require(_0xc253('0x2'));var logger=require(_0xc253('0x3'))(_0xc253('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc253('0x5'));function respondWithResult(_0x27671f,_0x41eaac){_0x41eaac=_0x41eaac||0xc8;return function(_0x45586a){if(_0x45586a){return _0x27671f[_0xc253('0x6')](_0x41eaac)[_0xc253('0x7')](_0x45586a);}};}function respondWithFilteredResult(_0x40c398,_0x5610dd){return function(_0x549326){if(_0x549326){var _0xc76718=typeof _0x5610dd[_0xc253('0x8')]===_0xc253('0x9')&&typeof _0x5610dd[_0xc253('0xa')]===_0xc253('0x9');var _0x3e5b64=_0x549326[_0xc253('0xb')];var _0x309e6d=_0xc76718?0x0:_0x5610dd[_0xc253('0x8')];var _0x3596ea=_0xc76718?_0x549326['count']:_0x5610dd['offset']+_0x5610dd[_0xc253('0xa')];var _0x176567;if(_0x3596ea>=_0x3e5b64){_0x3596ea=_0x3e5b64;_0x176567=0xc8;}else{_0x176567=0xce;}_0x40c398[_0xc253('0x6')](_0x176567);return _0x40c398[_0xc253('0xc')](_0xc253('0xd'),_0x309e6d+'-'+_0x3596ea+'/'+_0x3e5b64)[_0xc253('0x7')](_0x549326);}return null;};}function saveUpdates(_0x367347){return function(_0x32927b){if(_0x32927b){return _0x32927b[_0xc253('0xe')](_0x367347)[_0xc253('0xf')](function(_0x416f61){return _0x416f61;});}return null;};}function removeEntity(_0x542714){return function(_0x562ea6){if(_0x562ea6){return _0x562ea6[_0xc253('0x10')]()[_0xc253('0xf')](function(){_0x542714[_0xc253('0x6')](0xcc)[_0xc253('0x11')]();});}};}function handleEntityNotFound(_0xc9705){return function(_0x3f17ad){if(!_0x3f17ad){_0xc9705['sendStatus'](0x194);}return _0x3f17ad;};}function handleError(_0x4779e7,_0x1625db){_0x1625db=_0x1625db||0x1f4;return function(_0x563bb7){logger[_0xc253('0x12')](_0x563bb7[_0xc253('0x13')]);if(_0x563bb7[_0xc253('0x14')]){delete _0x563bb7['name'];}_0x4779e7[_0xc253('0x6')](_0x1625db)[_0xc253('0x15')](_0x563bb7);};}exports[_0xc253('0x16')]=function(_0x404937,_0x142b2c){var _0x58ea0e={},_0x2d3392={},_0x3596ac={'count':0x0,'rows':[]};var _0x41dece=_[_0xc253('0x17')](db[_0xc253('0x18')][_0xc253('0x19')],function(_0x5baf38){return{'name':_0x5baf38['fieldName'],'type':_0x5baf38['type']['key']};});_0x2d3392[_0xc253('0x1a')]=_[_0xc253('0x17')](_0x41dece,_0xc253('0x14'));_0x2d3392[_0xc253('0x1b')]=_[_0xc253('0x1c')](_0x404937[_0xc253('0x1b')]);_0x2d3392[_0xc253('0x1d')]=_[_0xc253('0x1e')](_0x2d3392[_0xc253('0x1a')],_0x2d3392[_0xc253('0x1b')]);_0x58ea0e['attributes']=_['intersection'](_0x2d3392[_0xc253('0x1a')],qs[_0xc253('0x1f')](_0x404937[_0xc253('0x1b')][_0xc253('0x1f')]));_0x58ea0e['attributes']=_0x58ea0e[_0xc253('0x20')][_0xc253('0x21')]?_0x58ea0e[_0xc253('0x20')]:_0x2d3392[_0xc253('0x1a')];if(!_0x404937[_0xc253('0x1b')][_0xc253('0x22')](_0xc253('0x23'))){_0x58ea0e[_0xc253('0xa')]=qs[_0xc253('0xa')](_0x404937[_0xc253('0x1b')][_0xc253('0xa')]);_0x58ea0e[_0xc253('0x8')]=qs[_0xc253('0x8')](_0x404937[_0xc253('0x1b')]['offset']);}_0x58ea0e[_0xc253('0x24')]=qs['sort'](_0x404937[_0xc253('0x1b')]['sort']);_0x58ea0e[_0xc253('0x25')]=qs[_0xc253('0x1d')](_['pick'](_0x404937[_0xc253('0x1b')],_0x2d3392[_0xc253('0x1d')]),_0x41dece);if(_0x404937[_0xc253('0x1b')][_0xc253('0x26')]){_0x58ea0e['where']=_[_0xc253('0x27')](_0x58ea0e['where'],{'$or':_[_0xc253('0x17')](_0x41dece,function(_0x46611a){if(_0x46611a[_0xc253('0x28')]!==_0xc253('0x29')){var _0x425ae0={};_0x425ae0[_0x46611a['name']]={'$like':'%'+_0x404937[_0xc253('0x1b')][_0xc253('0x26')]+'%'};return _0x425ae0;}})});}_0x58ea0e=_['merge']({},_0x58ea0e,_0x404937[_0xc253('0x2a')]);var _0x4c088c={'where':_0x58ea0e[_0xc253('0x25')]};return db[_0xc253('0x18')]['count'](_0x4c088c)[_0xc253('0xf')](function(_0x3cfb6b){_0x3596ac['count']=_0x3cfb6b;if(_0x404937[_0xc253('0x1b')][_0xc253('0x2b')]){_0x58ea0e['include']=[{'all':!![]}];}return db[_0xc253('0x18')][_0xc253('0x2c')](_0x58ea0e);})[_0xc253('0xf')](function(_0x2b4944){_0x3596ac[_0xc253('0x2d')]=_0x2b4944;return _0x3596ac;})[_0xc253('0xf')](respondWithFilteredResult(_0x142b2c,_0x58ea0e))[_0xc253('0x2e')](handleError(_0x142b2c,null));};exports[_0xc253('0x2f')]=function(_0x21123f,_0x3e494f){var _0x118f6a={'raw':![],'where':{'id':_0x21123f[_0xc253('0x30')]['id']}},_0x4ba53b={};_0x4ba53b[_0xc253('0x1a')]=_['keys'](db[_0xc253('0x18')][_0xc253('0x19')]);_0x4ba53b[_0xc253('0x1b')]=_[_0xc253('0x1c')](_0x21123f[_0xc253('0x1b')]);_0x4ba53b[_0xc253('0x1d')]=_[_0xc253('0x1e')](_0x4ba53b[_0xc253('0x1a')],_0x4ba53b['query']);_0x118f6a[_0xc253('0x20')]=_['intersection'](_0x4ba53b[_0xc253('0x1a')],qs[_0xc253('0x1f')](_0x21123f[_0xc253('0x1b')]['fields']));_0x118f6a['attributes']=_0x118f6a[_0xc253('0x20')]['length']?_0x118f6a['attributes']:_0x4ba53b[_0xc253('0x1a')];if(_0x21123f[_0xc253('0x1b')][_0xc253('0x2b')]){_0x118f6a['include']=[{'all':!![]}];}_0x118f6a=_[_0xc253('0x27')]({},_0x118f6a,_0x21123f[_0xc253('0x2a')]);return db[_0xc253('0x18')]['find'](_0x118f6a)[_0xc253('0xf')](handleEntityNotFound(_0x3e494f,null))[_0xc253('0xf')](respondWithResult(_0x3e494f,null))[_0xc253('0x2e')](handleError(_0x3e494f,null));};exports[_0xc253('0x31')]=function(_0x33d4ae,_0x3cfd7d){return db['Dynamics365Account'][_0xc253('0x31')](_0x33d4ae[_0xc253('0x32')],{})['then'](respondWithResult(_0x3cfd7d,0xc9))['catch'](handleError(_0x3cfd7d,null));};exports[_0xc253('0xe')]=function(_0x54a2a,_0x510278){if(_0x54a2a[_0xc253('0x32')]['id']){delete _0x54a2a[_0xc253('0x32')]['id'];}return db[_0xc253('0x18')]['find']({'where':{'id':_0x54a2a[_0xc253('0x30')]['id']}})[_0xc253('0xf')](handleEntityNotFound(_0x510278,null))[_0xc253('0xf')](saveUpdates(_0x54a2a[_0xc253('0x32')],null))[_0xc253('0xf')](respondWithResult(_0x510278,null))[_0xc253('0x2e')](handleError(_0x510278,null));};exports['destroy']=function(_0x245e82,_0x2f0b4e){return db['Dynamics365Account'][_0xc253('0x33')]({'where':{'id':_0x245e82[_0xc253('0x30')]['id']}})['then'](handleEntityNotFound(_0x2f0b4e,null))[_0xc253('0xf')](removeEntity(_0x2f0b4e,null))[_0xc253('0x2e')](handleError(_0x2f0b4e,null));};exports[_0xc253('0x34')]=function(_0x4b301c,_0x4bca9c){var _0x2f504f={};var _0x39e8b3={};var _0x28f2e3;var _0x5444f1;return db[_0xc253('0x18')][_0xc253('0x35')]({'where':{'id':_0x4b301c[_0xc253('0x30')]['id']}})[_0xc253('0xf')](handleEntityNotFound(_0x4bca9c,null))[_0xc253('0xf')](function(_0x1f554a){if(_0x1f554a){_0x28f2e3=_0x1f554a;_0x39e8b3[_0xc253('0x1a')]=_[_0xc253('0x1c')](db['Dynamics365Configuration'][_0xc253('0x19')]);_0x39e8b3[_0xc253('0x1b')]=_[_0xc253('0x1c')](_0x4b301c[_0xc253('0x1b')]);_0x39e8b3['filters']=_[_0xc253('0x1e')](_0x39e8b3[_0xc253('0x1a')],_0x39e8b3[_0xc253('0x1b')]);_0x2f504f[_0xc253('0x20')]=_[_0xc253('0x1e')](_0x39e8b3[_0xc253('0x1a')],qs[_0xc253('0x1f')](_0x4b301c[_0xc253('0x1b')]['fields']));_0x2f504f[_0xc253('0x20')]=_0x2f504f[_0xc253('0x20')][_0xc253('0x21')]?_0x2f504f[_0xc253('0x20')]:_0x39e8b3[_0xc253('0x1a')];_0x2f504f[_0xc253('0x24')]=qs['sort'](_0x4b301c[_0xc253('0x1b')][_0xc253('0x36')]);_0x2f504f[_0xc253('0x25')]=qs[_0xc253('0x1d')](_[_0xc253('0x37')](_0x4b301c[_0xc253('0x1b')],_0x39e8b3[_0xc253('0x1d')]));if(_0x4b301c[_0xc253('0x1b')][_0xc253('0x26')]){_0x2f504f[_0xc253('0x25')]=_['merge'](_0x2f504f[_0xc253('0x25')],{'$or':_[_0xc253('0x17')](_0x2f504f[_0xc253('0x20')],function(_0x172a7e){var _0x4746db={};_0x4746db[_0x172a7e]={'$like':'%'+_0x4b301c['query']['filter']+'%'};return _0x4746db;})});}_0x2f504f=_[_0xc253('0x27')]({},_0x2f504f,_0x4b301c['options']);return _0x28f2e3[_0xc253('0x34')](_0x2f504f);}})[_0xc253('0xf')](function(_0x3037d4){if(_0x3037d4){_0x5444f1=_0x3037d4[_0xc253('0x21')];if(!_0x4b301c[_0xc253('0x1b')]['hasOwnProperty'](_0xc253('0x23'))){_0x2f504f[_0xc253('0xa')]=qs[_0xc253('0xa')](_0x4b301c[_0xc253('0x1b')][_0xc253('0xa')]);_0x2f504f[_0xc253('0x8')]=qs[_0xc253('0x8')](_0x4b301c['query']['offset']);}return _0x28f2e3[_0xc253('0x34')](_0x2f504f);}})[_0xc253('0xf')](function(_0x443985){if(_0x443985){return _0x443985?{'count':_0x5444f1,'rows':_0x443985}:null;}})[_0xc253('0xf')](respondWithResult(_0x4bca9c,null))['catch'](handleError(_0x4bca9c,null));};exports[_0xc253('0x38')]=function(_0x5507a6,_0x40e2b8){if(_0x5507a6[_0xc253('0x32')]['id']){delete _0x5507a6[_0xc253('0x32')]['id'];}return db[_0xc253('0x18')][_0xc253('0x35')]({'where':{'id':_0x5507a6[_0xc253('0x30')]['id']}})[_0xc253('0xf')](handleEntityNotFound(_0x40e2b8,null))[_0xc253('0xf')](function(_0xba555c){if(_0xba555c){_0x5507a6[_0xc253('0x32')][_0xc253('0x39')]=_0xba555c['id'];_0x5507a6[_0xc253('0x32')][_0xc253('0x3a')]=integrations[_0xc253('0x3b')](_0x5507a6[_0xc253('0x32')][_0xc253('0x3c')],_0x5507a6['body'][_0xc253('0x28')]);_0x5507a6[_0xc253('0x32')]['Descriptions']=integrations['getDescriptions'](_0x5507a6[_0xc253('0x32')][_0xc253('0x3c')],_0x5507a6['body']['type']);return db[_0xc253('0x3d')][_0xc253('0x31')](_0x5507a6[_0xc253('0x32')],{'include':[{'model':db[_0xc253('0x3e')],'as':_0xc253('0x3a')},{'model':db[_0xc253('0x3e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x40e2b8,null))['catch'](handleError(_0x40e2b8,null));};function sanitizeRemoteUri(_0x56b1fe){var _0x59d80d=_0x56b1fe[_0xc253('0x3f')](-0x1);if(_0x59d80d==='/')return _0x56b1fe[_0xc253('0x40')](0x0,_0x56b1fe[_0xc253('0x41')](_0x59d80d));return _0x56b1fe;}function getWebApiUrl(_0x3c8d21){return util[_0xc253('0x42')](_0xc253('0x43'),_0x3c8d21);}exports[_0xc253('0x44')]=function(_0x546068,_0xd5250){var _0x4ed2cb=_0x546068[_0xc253('0x1b')][_0xc253('0x45')];var _0x117546=_0x4ed2cb===_0xc253('0x46')?_0xc253('0x47'):_0xc253('0x48');var _0xa03c2d='';var _0x3b6b50='';var _0xc5d8f2='';var _0x5ce8e8='';var _0x58cacc='';var _0x5260dc='';var _0x24bedc='';var _0x298f1d='';var _0x1fdb35=[_0xc253('0x49'),_0xc253('0x4a'),'customerid',_0xc253('0x4b'),'caseorigincode',_0xc253('0x4c'),'phonenumber','regardingobjectid',_0xc253('0x4d'),'phonecall_activity_parties'];var _0x541d81=[_0xc253('0x4e'),_0xc253('0x4f'),_0xc253('0x50'),_0xc253('0x51'),'contactidname','contactidyominame','contractdetailidname',_0xc253('0x52'),_0xc253('0x53'),'createdbyexternalpartyyominame',_0xc253('0x54'),_0xc253('0x55'),_0xc253('0x56'),_0xc253('0x57'),_0xc253('0x58'),'customeridname',_0xc253('0x59'),_0xc253('0x5a'),'emailaddress','entitlementidname',_0xc253('0x5b'),_0xc253('0x5c'),_0xc253('0x5d'),_0xc253('0x5e'),'firstresponsebykpiidname',_0xc253('0x5f'),_0xc253('0x60'),_0xc253('0x61'),'kbarticleidname',_0xc253('0x62'),_0xc253('0x63'),_0xc253('0x64'),'modifiedbyexternalpartyyominame',_0xc253('0x65'),_0xc253('0x66'),'modifiedon',_0xc253('0x67'),_0xc253('0x68'),_0xc253('0x69'),_0xc253('0x6a'),_0xc253('0x6b'),_0xc253('0x6c'),_0xc253('0x6d'),'owneridname',_0xc253('0x6e'),_0xc253('0x6f'),_0xc253('0x70'),_0xc253('0x71'),_0xc253('0x72'),'prioritycodename','productidname',_0xc253('0x73'),'resolveby',_0xc253('0x74'),'responseby',_0xc253('0x75'),'responsiblecontactidyominame',_0xc253('0x76'),_0xc253('0x77'),_0xc253('0x78'),_0xc253('0x79'),'statecode','statuscode',_0xc253('0x7a'),_0xc253('0x7b'),_0xc253('0x7c'),'transactioncurrencyidname',_0xc253('0x7d'),_0xc253('0x7e'),'versionnumber'];var _0x45029f=_0x1fdb35[_0xc253('0x7f')](_0x541d81);return db[_0xc253('0x18')][_0xc253('0x35')]({'where':{'id':_0x546068[_0xc253('0x30')]['id']},'attributes':['id','username','password','remoteUri','tenantId',_0xc253('0x80'),_0xc253('0x81'),_0xc253('0x82')],'include':[{'model':db[_0xc253('0x83')],'as':_0xc253('0x83'),'attributes':['id',_0xc253('0x84'),_0xc253('0x85')]}]})[_0xc253('0xf')](handleEntityNotFound(_0xd5250,null))[_0xc253('0xf')](function(_0x516a26){if(_0x516a26){if(_0x516a26[_0xc253('0x82')]){_0x516a26[_0xc253('0x86')]=_0x516a26[_0xc253('0x83')]['data5'];_0x298f1d=sanitizeRemoteUri(_0x516a26['CloudProvider']['data7']);_0x24bedc=getWebApiUrl(_0x298f1d);return _0x516a26;}_0x298f1d=sanitizeRemoteUri(_0x516a26[_0xc253('0x87')]);_0x24bedc=getWebApiUrl(_0x298f1d);var _0x1380a1={'method':'POST','uri':_0xc253('0x88')+_0x516a26['tenantId']+_0xc253('0x89'),'form':{'client_id':_0x516a26[_0xc253('0x80')],'resource':_0x298f1d,'username':_0x516a26[_0xc253('0x8a')],'password':_0x516a26[_0xc253('0x8b')],'grant_type':_0xc253('0x8b'),'client_secret':_0x516a26[_0xc253('0x81')]},'json':!![]};return rp(_0x1380a1);}})[_0xc253('0xf')](function(_0x3acaad){_0x5260dc=_0x3acaad['access_token'];var _0x3fa461={'method':_0xc253('0x8c'),'uri':encodeURI(_0x24bedc+_0xc253('0x8d')+_0x117546+'\x27'),'headers':{'Authorization':_0xc253('0x8e')+_0x5260dc,'If-None-Match':null,'OData-Version':_0xc253('0x8f')},'json':!![]};return rp(_0x3fa461);})[_0xc253('0xf')](function(_0x31c706){var _0x8953bb=_0x31c706[_0xc253('0x90')][0x0];var _0x2bd323=_0x8953bb['MetadataId'];var _0x2f45e8={'method':'GET','uri':_0x24bedc+_0xc253('0x91')+_0x2bd323+_0xc253('0x92'),'headers':{'Authorization':_0xc253('0x8e')+_0x5260dc,'If-None-Match':null,'OData-Version':_0xc253('0x8f')},'json':!![]};return rp(_0x2f45e8);})[_0xc253('0xf')](function(_0x153946){_0xa03c2d=_0x153946;_0x3b6b50=_0xa03c2d[_0xc253('0x93')];_0x3b6b50=_['remove'](_0x3b6b50,function(_0x5c777e){return!_0x45029f[_0xc253('0x94')](_0x5c777e[_0xc253('0x95')]);});var _0x176a12=[];var _0x3c161b=[];_0x3b6b50[_0xc253('0x96')](function(_0x4a54da){if(_0x4a54da[_0xc253('0x97')]){var _0x2e5a08=_0x4a54da[_0xc253('0x97')][_0xc253('0x40')](_0x4a54da[_0xc253('0x97')]['lastIndexOf']('.')+0x1);if(_0x2e5a08==='PicklistAttributeMetadata'){_0x176a12[_0xc253('0x98')](getSelectList(_0x24bedc,_0x4ed2cb,_0x3c161b,_0xa03c2d[_0xc253('0x99')],_0x4a54da[_0xc253('0x99')],_0x5260dc));}}});return Promise[_0xc253('0x9a')](_0x176a12);})[_0xc253('0xf')](function(_0x218ae2){_0xc5d8f2=_0x218ae2[0x0];var _0x196c2a=[];var _0xe82c1c=[];_0x3b6b50[_0xc253('0x96')](function(_0xea959d){if(!_[_0xc253('0x9b')](_0xea959d[_0xc253('0x97')])){var _0x181dc0=_0xea959d[_0xc253('0x97')]['substring'](_0xea959d[_0xc253('0x97')][_0xc253('0x41')]('.')+0x1);if(_0x181dc0===_0xc253('0x9c')){_0x196c2a[_0xc253('0x98')](getBooleanList(_0x24bedc,_0x4ed2cb,_0xe82c1c,_0xa03c2d[_0xc253('0x99')],_0xea959d[_0xc253('0x99')],_0x5260dc));}}});return Promise['all'](_0x196c2a);})[_0xc253('0xf')](function(_0x5dc77b){_0x5ce8e8=_0x5dc77b[0x0];var _0x2e6ba8=[];var _0x5e4d6d=[];_0x3b6b50[_0xc253('0x96')](function(_0x2794f0){if(_0x2794f0[_0xc253('0x97')]){var _0x3beee9=_0x2794f0['@odata.type'][_0xc253('0x40')](_0x2794f0[_0xc253('0x97')][_0xc253('0x41')]('.')+0x1);if(_0x3beee9===_0xc253('0x9d')||_0x3beee9===_0xc253('0x9e')||_0x3beee9===_0xc253('0x9f')||_0x3beee9===_0xc253('0xa0')||_0x3beee9===_0xc253('0xa1')||_0x3beee9===_0xc253('0xa2')||_0x3beee9==='StatusAttributeMetadata'||_0x3beee9===_0xc253('0xa3')||_0x3beee9===_0xc253('0xa4')||_0x3beee9===_0xc253('0xa5')){_0x2e6ba8[_0xc253('0x98')](getInputList(_0x24bedc,_0x4ed2cb,_0x3beee9,_0x5e4d6d,_0xa03c2d[_0xc253('0x99')],_0x2794f0['MetadataId'],_0x5260dc));}}});return Promise[_0xc253('0x9a')](_0x2e6ba8);})[_0xc253('0xf')](function(_0x406e0a){_0x58cacc=_0x406e0a[0x0];var _0x583db2=_0xc5d8f2[_0xc253('0x7f')](_0x5ce8e8)['concat'](_0x58cacc);var _0x55bcca={'count':_0x583db2['length'],'rows':_0x583db2};return _0x55bcca;})['then'](respondWithResult(_0xd5250,null))[_0xc253('0x2e')](function(_0x11b585){var _0x3a0aac=_0x546068['query'][_0xc253('0xa6')]?0x1f4:_0x11b585[_0xc253('0xa7')]||0x1f4;logger[_0xc253('0x12')](_0x11b585[_0xc253('0x13')]);delete _0x11b585[_0xc253('0x14')];if(_0x3a0aac===0x191){_0x3a0aac=0x190;}_0xd5250['status'](_0x3a0aac)[_0xc253('0x15')](_0x546068['query'][_0xc253('0xa6')]?{'message':_0xc253('0xa8'),'statusCode':_0x11b585[_0xc253('0xa7')]}:_0x11b585);});};function getSelectList(_0x305e8b,_0x1117a6,_0x886ce0,_0x4008f2,_0x416b5c,_0x119bdc){var _0x5401d0={'method':_0xc253('0x8c'),'uri':_0x305e8b+_0xc253('0x91')+_0x4008f2+_0xc253('0xa9')+_0x416b5c+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xc253('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x119bdc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5401d0)['then'](function(_0x2c615b){var _0x41cdf8=[];var _0x556e5b=_0x2c615b['OptionSet'][_0xc253('0xab')];_0x556e5b['forEach'](function(_0x100b14){_0x41cdf8[_0xc253('0x98')]({'name':_0x100b14[_0xc253('0xac')]['UserLocalizedLabel'][_0xc253('0xac')],'value':String(_0x100b14[_0xc253('0xad')])});});var _0x110835={'id':_0x1117a6+'_'+_0x2c615b[_0xc253('0x95')],'name':_0x2c615b[_0xc253('0xae')][_0xc253('0xaf')]['Label'],'custom':![],'options':_0x41cdf8};_0x886ce0[_0xc253('0x98')](_0x110835);return _0x886ce0;});}function getBooleanList(_0x2ca253,_0x1e021a,_0x20aff8,_0x28be04,_0x25acb3,_0x3140fe){var _0x40fbb3={'method':_0xc253('0x8c'),'uri':_0x2ca253+_0xc253('0x91')+_0x28be04+')/Attributes('+_0x25acb3+_0xc253('0xb0'),'headers':{'Authorization':'Bearer\x20'+_0x3140fe,'If-None-Match':null,'OData-Version':_0xc253('0x8f')},'json':!![]};return rp(_0x40fbb3)[_0xc253('0xf')](function(_0x5aa998){var _0x4fe162=[];_0x4fe162[_0xc253('0x98')]({'name':_0x5aa998[_0xc253('0xb1')]['TrueOption'][_0xc253('0xac')][_0xc253('0xaf')][_0xc253('0xac')],'value':_0xc253('0xb2')},{'name':_0x5aa998[_0xc253('0xb1')][_0xc253('0xb3')][_0xc253('0xac')][_0xc253('0xaf')][_0xc253('0xac')],'value':_0xc253('0xb4')});var _0x5ac93b={'id':_0x1e021a+'_'+_0x5aa998[_0xc253('0x95')],'name':_0x5aa998['DisplayName'][_0xc253('0xaf')][_0xc253('0xac')],'custom':![],'options':_0x4fe162};_0x20aff8[_0xc253('0x98')](_0x5ac93b);return _0x20aff8;});}function getInputList(_0x84ba8e,_0x61b5c1,_0x3664eb,_0x23cac1,_0xfcf9dc,_0x262444,_0x2a0998){var _0x377cda={'method':_0xc253('0x8c'),'uri':_0x84ba8e+_0xc253('0x91')+_0xfcf9dc+_0xc253('0xa9')+_0x262444+_0xc253('0xb5')+_0x3664eb+_0xc253('0xb6'),'headers':{'Authorization':_0xc253('0x8e')+_0x2a0998,'If-None-Match':null,'OData-Version':_0xc253('0x8f')},'json':!![]};return rp(_0x377cda)[_0xc253('0xf')](function(_0x5d6a1f){var _0x41ffd5={'id':_0x61b5c1+'_'+_0x5d6a1f['LogicalName'],'name':_0x5d6a1f[_0xc253('0xae')][_0xc253('0xaf')]?_0x5d6a1f['DisplayName']['UserLocalizedLabel'][_0xc253('0xac')]:_0x5d6a1f[_0xc253('0x95')],'custom':![],'options':[]};_0x23cac1[_0xc253('0x98')](_0x41ffd5);return _0x23cac1;});}
\ No newline at end of file
index 4846f14..fb83bbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xc83e7f,_0x3c8397){var _0x1ff519=function(_0x352d78){while(--_0x352d78){_0xc83e7f['push'](_0xc83e7f['shift']());}};_0x1ff519(++_0x3c8397);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x25614e,_0x1c37af){var _0x353468=function(_0x348aa9){while(--_0x348aa9){_0x25614e['push'](_0x25614e['shift']());}};_0x353468(++_0x1c37af);}(_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('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 10104ef..2234364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481f=['attributes','include','model','map','catch','Dynamics365Account','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','GetDynamics365Account','findAll','options','raw','where'];(function(_0x4337fb,_0x5c7569){var _0x570aab=function(_0x12fcb8){while(--_0x12fcb8){_0x4337fb['push'](_0x4337fb['shift']());}};_0x570aab(++_0x5c7569);}(_0x481f,0x142));var _0xf481=function(_0x1b935a,_0x876060){_0x1b935a=_0x1b935a-0x0;var _0x4dd134=_0x481f[_0x1b935a];return _0x4dd134;};'use strict';var _=require(_0xf481('0x0'));var util=require(_0xf481('0x1'));var moment=require(_0xf481('0x2'));var BPromise=require(_0xf481('0x3'));var rs=require(_0xf481('0x4'));var fs=require('fs');var Redis=require(_0xf481('0x5'));var db=require(_0xf481('0x6'))['db'];var utils=require(_0xf481('0x7'));var logger=require(_0xf481('0x8'))(_0xf481('0x9'));var config=require(_0xf481('0xa'));var jayson=require(_0xf481('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51207e,_0x27dd92,_0x340304){return new BPromise(function(_0x2d3915,_0xbcbb4b){return client[_0xf481('0xc')](_0x51207e,_0x340304)[_0xf481('0xd')](function(_0x4fc412){logger[_0xf481('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x27dd92,'request\x20sent');logger['debug'](_0xf481('0xf'),_0x27dd92,_0xf481('0x10'),JSON[_0xf481('0x11')](_0x4fc412));if(_0x4fc412['error']){if(_0x4fc412[_0xf481('0x12')][_0xf481('0x13')]===0x1f4){logger[_0xf481('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x27dd92,_0x4fc412['error'][_0xf481('0x14')]);return _0xbcbb4b(_0x4fc412[_0xf481('0x12')]['message']);}logger[_0xf481('0x12')](_0xf481('0x15'),_0x27dd92,_0x4fc412[_0xf481('0x12')][_0xf481('0x14')]);return _0x2d3915(_0x4fc412[_0xf481('0x12')]['message']);}else{logger['info'](_0xf481('0x15'),_0x27dd92,_0xf481('0x10'));_0x2d3915(_0x4fc412[_0xf481('0x16')][_0xf481('0x14')]);}})['catch'](function(_0x274db6){logger[_0xf481('0x12')](_0xf481('0x15'),_0x27dd92,_0x274db6);_0xbcbb4b(_0x274db6);});});}exports[_0xf481('0x17')]=function(_0x53e116){var _0x314448=this;return new Promise(function(_0x127dcf,_0x53cc69){return db['Dynamics365Account'][_0xf481('0x18')]({'raw':_0x53e116[_0xf481('0x19')]?_0x53e116[_0xf481('0x19')][_0xf481('0x1a')]===undefined?!![]:![]:!![],'where':_0x53e116[_0xf481('0x19')]?_0x53e116[_0xf481('0x19')][_0xf481('0x1b')]||null:null,'attributes':_0x53e116[_0xf481('0x19')]?_0x53e116[_0xf481('0x19')][_0xf481('0x1c')]||null:null,'limit':_0x53e116['options']?_0x53e116[_0xf481('0x19')]['limit']||null:null,'include':_0x53e116[_0xf481('0x19')]?_0x53e116[_0xf481('0x19')]['include']?_['map'](_0x53e116[_0xf481('0x19')][_0xf481('0x1d')],function(_0x48d460){return{'model':db[_0x48d460[_0xf481('0x1e')]],'as':_0x48d460['as'],'attributes':_0x48d460[_0xf481('0x1c')],'include':_0x48d460[_0xf481('0x1d')]?_['map'](_0x48d460[_0xf481('0x1d')],function(_0x4df994){return{'model':db[_0x4df994[_0xf481('0x1e')]],'as':_0x4df994['as'],'attributes':_0x4df994[_0xf481('0x1c')],'include':_0x4df994[_0xf481('0x1d')]?_[_0xf481('0x1f')](_0x4df994[_0xf481('0x1d')],function(_0x19a3d0){return{'model':db[_0x19a3d0[_0xf481('0x1e')]],'as':_0x19a3d0['as'],'attributes':_0x19a3d0[_0xf481('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf481('0xd')](function(_0x47f2a0){logger[_0xf481('0xe')](_0xf481('0x17'),_0x53e116);logger['debug'](_0xf481('0x17'),_0x53e116,JSON[_0xf481('0x11')](_0x47f2a0));_0x127dcf(_0x47f2a0);})[_0xf481('0x20')](function(_0x693afb){logger[_0xf481('0x12')](_0xf481('0x17'),_0x693afb[_0xf481('0x14')],_0x53e116);_0x53cc69(_0x314448[_0xf481('0x12')](0x1f4,_0x693afb[_0xf481('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x5e0773){var _0x159532=this;return new Promise(function(_0x57d495,_0x575284){return db[_0xf481('0x21')]['find']({'raw':_0x5e0773[_0xf481('0x19')]?_0x5e0773[_0xf481('0x19')][_0xf481('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e0773[_0xf481('0x19')]?_0x5e0773[_0xf481('0x19')][_0xf481('0x1b')]||null:null,'attributes':_0x5e0773[_0xf481('0x19')]?_0x5e0773[_0xf481('0x19')]['attributes']||null:null,'include':_0x5e0773[_0xf481('0x19')]?_0x5e0773[_0xf481('0x19')][_0xf481('0x1d')]?_[_0xf481('0x1f')](_0x5e0773['options'][_0xf481('0x1d')],function(_0x33335c){return{'model':db[_0x33335c[_0xf481('0x1e')]],'as':_0x33335c['as'],'attributes':_0x33335c[_0xf481('0x1c')],'include':_0x33335c[_0xf481('0x1d')]?_[_0xf481('0x1f')](_0x33335c[_0xf481('0x1d')],function(_0xcb8806){return{'model':db[_0xcb8806['model']],'as':_0xcb8806['as'],'attributes':_0xcb8806['attributes'],'include':_0xcb8806[_0xf481('0x1d')]?_['map'](_0xcb8806[_0xf481('0x1d')],function(_0xb0a4cf){return{'model':db[_0xb0a4cf[_0xf481('0x1e')]],'as':_0xb0a4cf['as'],'attributes':_0xb0a4cf[_0xf481('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf481('0xd')](function(_0x46648e){logger[_0xf481('0xe')](_0xf481('0x22'),_0x5e0773);logger['debug']('ShowDynamics365Account',_0x5e0773,JSON[_0xf481('0x11')](_0x46648e));_0x57d495(_0x46648e);})[_0xf481('0x20')](function(_0x1ac1e8){logger[_0xf481('0x12')](_0xf481('0x22'),_0x1ac1e8[_0xf481('0x14')],_0x5e0773);_0x575284(_0x159532['error'](0x1f4,_0x1ac1e8[_0xf481('0x14')]));});});};
\ No newline at end of file
+var _0x8ace=['../../mysqldb','../../config/utils','../../config/logger','http','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account','find','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x8ace,0xc7));var _0xe8ac=function(_0x415264,_0x4e71cc){_0x415264=_0x415264-0x0;var _0x305b9e=_0x8ace[_0x415264];return _0x305b9e;};'use strict';var _=require(_0xe8ac('0x0'));var util=require('util');var moment=require(_0xe8ac('0x1'));var BPromise=require(_0xe8ac('0x2'));var rs=require(_0xe8ac('0x3'));var fs=require('fs');var Redis=require(_0xe8ac('0x4'));var db=require(_0xe8ac('0x5'))['db'];var utils=require(_0xe8ac('0x6'));var logger=require(_0xe8ac('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe8ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eefd1,_0x4f3ef9,_0x35cd8c){return new BPromise(function(_0x3b7036,_0x2ff476){return client['request'](_0x4eefd1,_0x35cd8c)[_0xe8ac('0x9')](function(_0x3605d4){logger[_0xe8ac('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x4f3ef9,'request\x20sent');logger[_0xe8ac('0xb')](_0xe8ac('0xc'),_0x4f3ef9,'request\x20sent',JSON[_0xe8ac('0xd')](_0x3605d4));if(_0x3605d4[_0xe8ac('0xe')]){if(_0x3605d4[_0xe8ac('0xe')][_0xe8ac('0xf')]===0x1f4){logger[_0xe8ac('0xe')](_0xe8ac('0x10'),_0x4f3ef9,_0x3605d4['error'][_0xe8ac('0x11')]);return _0x2ff476(_0x3605d4[_0xe8ac('0xe')]['message']);}logger[_0xe8ac('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x4f3ef9,_0x3605d4[_0xe8ac('0xe')][_0xe8ac('0x11')]);return _0x3b7036(_0x3605d4[_0xe8ac('0xe')][_0xe8ac('0x11')]);}else{logger['info'](_0xe8ac('0x10'),_0x4f3ef9,_0xe8ac('0x12'));_0x3b7036(_0x3605d4[_0xe8ac('0x13')][_0xe8ac('0x11')]);}})[_0xe8ac('0x14')](function(_0x5ce770){logger[_0xe8ac('0xe')](_0xe8ac('0x10'),_0x4f3ef9,_0x5ce770);_0x2ff476(_0x5ce770);});});}exports[_0xe8ac('0x15')]=function(_0x1d1c58){var _0x54f194=this;return new Promise(function(_0x4656fe,_0x25314f){return db[_0xe8ac('0x16')][_0xe8ac('0x17')]({'raw':_0x1d1c58[_0xe8ac('0x18')]?_0x1d1c58[_0xe8ac('0x18')][_0xe8ac('0x19')]===undefined?!![]:![]:!![],'where':_0x1d1c58['options']?_0x1d1c58[_0xe8ac('0x18')][_0xe8ac('0x1a')]||null:null,'attributes':_0x1d1c58[_0xe8ac('0x18')]?_0x1d1c58[_0xe8ac('0x18')]['attributes']||null:null,'limit':_0x1d1c58[_0xe8ac('0x18')]?_0x1d1c58[_0xe8ac('0x18')][_0xe8ac('0x1b')]||null:null,'include':_0x1d1c58['options']?_0x1d1c58[_0xe8ac('0x18')][_0xe8ac('0x1c')]?_[_0xe8ac('0x1d')](_0x1d1c58[_0xe8ac('0x18')]['include'],function(_0x420e15){return{'model':db[_0x420e15[_0xe8ac('0x1e')]],'as':_0x420e15['as'],'attributes':_0x420e15['attributes'],'include':_0x420e15[_0xe8ac('0x1c')]?_[_0xe8ac('0x1d')](_0x420e15['include'],function(_0x220548){return{'model':db[_0x220548[_0xe8ac('0x1e')]],'as':_0x220548['as'],'attributes':_0x220548[_0xe8ac('0x1f')],'include':_0x220548[_0xe8ac('0x1c')]?_['map'](_0x220548[_0xe8ac('0x1c')],function(_0x3f8a9e){return{'model':db[_0x3f8a9e[_0xe8ac('0x1e')]],'as':_0x3f8a9e['as'],'attributes':_0x3f8a9e[_0xe8ac('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x77ca60){logger['info'](_0xe8ac('0x15'),_0x1d1c58);logger['debug'](_0xe8ac('0x15'),_0x1d1c58,JSON['stringify'](_0x77ca60));_0x4656fe(_0x77ca60);})[_0xe8ac('0x14')](function(_0x2a8ac3){logger[_0xe8ac('0xe')](_0xe8ac('0x15'),_0x2a8ac3[_0xe8ac('0x11')],_0x1d1c58);_0x25314f(_0x54f194[_0xe8ac('0xe')](0x1f4,_0x2a8ac3[_0xe8ac('0x11')]));});});};exports[_0xe8ac('0x20')]=function(_0x36137a){var _0x13c059=this;return new Promise(function(_0x3ed4c2,_0x529b83){return db[_0xe8ac('0x16')][_0xe8ac('0x21')]({'raw':_0x36137a[_0xe8ac('0x18')]?_0x36137a['options'][_0xe8ac('0x19')]===undefined?!![]:![]:!![],'where':_0x36137a[_0xe8ac('0x18')]?_0x36137a[_0xe8ac('0x18')][_0xe8ac('0x1a')]||null:null,'attributes':_0x36137a['options']?_0x36137a[_0xe8ac('0x18')][_0xe8ac('0x1f')]||null:null,'include':_0x36137a[_0xe8ac('0x18')]?_0x36137a[_0xe8ac('0x18')][_0xe8ac('0x1c')]?_['map'](_0x36137a['options']['include'],function(_0x4a2b99){return{'model':db[_0x4a2b99[_0xe8ac('0x1e')]],'as':_0x4a2b99['as'],'attributes':_0x4a2b99[_0xe8ac('0x1f')],'include':_0x4a2b99[_0xe8ac('0x1c')]?_[_0xe8ac('0x1d')](_0x4a2b99[_0xe8ac('0x1c')],function(_0xbca4aa){return{'model':db[_0xbca4aa[_0xe8ac('0x1e')]],'as':_0xbca4aa['as'],'attributes':_0xbca4aa[_0xe8ac('0x1f')],'include':_0xbca4aa[_0xe8ac('0x1c')]?_[_0xe8ac('0x1d')](_0xbca4aa[_0xe8ac('0x1c')],function(_0x4d540b){return{'model':db[_0x4d540b[_0xe8ac('0x1e')]],'as':_0x4d540b['as'],'attributes':_0x4d540b[_0xe8ac('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe8ac('0x9')](function(_0x55c2ae){logger[_0xe8ac('0xa')]('ShowDynamics365Account',_0x36137a);logger[_0xe8ac('0xb')](_0xe8ac('0x20'),_0x36137a,JSON[_0xe8ac('0xd')](_0x55c2ae));_0x3ed4c2(_0x55c2ae);})['catch'](function(_0x1f5141){logger[_0xe8ac('0xe')](_0xe8ac('0x20'),_0x1f5141['message'],_0x36137a);_0x529b83(_0x13c059[_0xe8ac('0xe')](0x1f4,_0x1f5141[_0xe8ac('0x11')]));});});};
\ No newline at end of file
index fb0919e..2b626af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcef=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','post','create','/:id','destroy','multer','util','path','express'];(function(_0x1ca54c,_0x1a7461){var _0x3043ee=function(_0x357b1b){while(--_0x357b1b){_0x1ca54c['push'](_0x1ca54c['shift']());}};_0x3043ee(++_0x1a7461);}(_0xfcef,0x74));var _0xffce=function(_0x20cdf0,_0x519950){_0x20cdf0=_0x20cdf0-0x0;var _0x3cf8bb=_0xfcef[_0x20cdf0];return _0x3cf8bb;};'use strict';var multer=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var path=require(_0xffce('0x2'));var timeout=require('connect-timeout');var express=require(_0xffce('0x3'));var router=express[_0xffce('0x4')]();var fs_extra=require(_0xffce('0x5'));var auth=require(_0xffce('0x6'));var interaction=require(_0xffce('0x7'));var config=require(_0xffce('0x8'));var controller=require(_0xffce('0x9'));router['get']('/',auth[_0xffce('0xa')](),controller[_0xffce('0xb')]);router[_0xffce('0xc')]('/:id',auth[_0xffce('0xa')](),controller[_0xffce('0xd')]);router[_0xffce('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0xffce('0xe')]);router[_0xffce('0xc')](_0xffce('0xf'),auth[_0xffce('0xa')](),controller['getSubjects']);router[_0xffce('0xc')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xffce('0x10')]('/',auth[_0xffce('0xa')](),controller[_0xffce('0x11')]);router['put'](_0xffce('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xffce('0x12'),auth[_0xffce('0xa')](),controller[_0xffce('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2ace=['isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ace,0x17e));var _0xe2ac=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x2ace[_0x1344d6];return _0xf45b24;};'use strict';var multer=require('multer');var util=require(_0xe2ac('0x0'));var path=require(_0xe2ac('0x1'));var timeout=require(_0xe2ac('0x2'));var express=require('express');var router=express[_0xe2ac('0x3')]();var fs_extra=require(_0xe2ac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe2ac('0x5'));var config=require(_0xe2ac('0x6'));var controller=require(_0xe2ac('0x7'));router[_0xe2ac('0x8')]('/',auth[_0xe2ac('0x9')](),controller[_0xe2ac('0xa')]);router[_0xe2ac('0x8')](_0xe2ac('0xb'),auth[_0xe2ac('0x9')](),controller[_0xe2ac('0xc')]);router[_0xe2ac('0x8')](_0xe2ac('0xd'),auth[_0xe2ac('0x9')](),controller['getFields']);router['get'](_0xe2ac('0xe'),auth['isAuthenticated'](),controller[_0xe2ac('0xf')]);router[_0xe2ac('0x8')]('/:id/descriptions',auth[_0xe2ac('0x9')](),controller[_0xe2ac('0x10')]);router[_0xe2ac('0x11')]('/',auth['isAuthenticated'](),controller[_0xe2ac('0x12')]);router[_0xe2ac('0x13')](_0xe2ac('0xb'),auth[_0xe2ac('0x9')](),controller[_0xe2ac('0x14')]);router['delete'](_0xe2ac('0xb'),auth['isAuthenticated'](),controller[_0xe2ac('0x15')]);module[_0xe2ac('0x16')]=router;
\ No newline at end of file
index c7131b4..b81334f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabe6=['BOOLEAN','STRING','phonecall','incident','ENUM','contact','nothing'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0xabe6,0x143));var _0x6abe=function(_0x2f91dc,_0x2089ee){_0x2f91dc=_0x2f91dc-0x0;var _0x30db4a=_0xabe6[_0x2f91dc];return _0x30db4a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6abe('0x0')]},'description':{'type':Sequelize[_0x6abe('0x0')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x6abe('0x1')),'defaultValue':_0x6abe('0x2')},'moduleCreate':{'type':Sequelize[_0x6abe('0x3')](_0x6abe('0x4'),_0x6abe('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x6abe('0x6')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x216a=['nothing','exports','STRING','ENUM','incident','contact'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x216a,0x10f));var _0xa216=function(_0x18be1b,_0xc59732){_0x18be1b=_0x18be1b-0x0;var _0x172bc1=_0x216a[_0x18be1b];return _0x172bc1;};'use strict';var Sequelize=require('sequelize');module[_0xa216('0x0')]={'name':{'type':Sequelize[_0xa216('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa216('0x2')]('incident','phonecall'),'defaultValue':_0xa216('0x3')},'moduleCreate':{'type':Sequelize[_0xa216('0x2')](_0xa216('0x4'),_0xa216('0x5')),'defaultValue':_0xa216('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xa216('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index ecd3c99..5480651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0903=['json','offset','undefined','limit','count','apply','reject','save','then','error','stack','name','Dynamics365Configuration','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','catch','create','body','update','destroy','findOne','Dynamics365Field','pick','getFields','hasOwnProperty','getSubjects','nolimit','getDescriptions','eml-format','zip-dir','request-promise','moment','util','path','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x0903,0x1af));var _0x3090=function(_0xff659d,_0x2283a1){_0xff659d=_0xff659d-0x0;var _0x19c170=_0x0903[_0xff659d];return _0x19c170;};'use strict';var emlformat=require(_0x3090('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3090('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3090('0x2'));var moment=require(_0x3090('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3090('0x4'));var path=require(_0x3090('0x5'));var sox=require('sox');var csv=require(_0x3090('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3090('0x7'));var _=require('lodash');var squel=require(_0x3090('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3090('0x9'));var toCsv=require('to-csv');var querystring=require(_0x3090('0xa'));var Papa=require('papaparse');var Redis=require(_0x3090('0xb'));var authService=require(_0x3090('0xc'));var qs=require(_0x3090('0xd'));var as=require(_0x3090('0xe'));var hardwareService=require(_0x3090('0xf'));var logger=require(_0x3090('0x10'))(_0x3090('0x11'));var utils=require(_0x3090('0x12'));var config=require(_0x3090('0x13'));var licenseUtil=require(_0x3090('0x14'));var db=require(_0x3090('0x15'))['db'];function respondWithStatusCode(_0x118ac1,_0x8f69e8){_0x8f69e8=_0x8f69e8||0xcc;return function(_0x298338){if(_0x298338){return _0x118ac1[_0x3090('0x16')](_0x8f69e8);}return _0x118ac1[_0x3090('0x17')](_0x8f69e8)[_0x3090('0x18')]();};}function respondWithResult(_0x39aa92,_0x412e4a){_0x412e4a=_0x412e4a||0xc8;return function(_0x1173bf){if(_0x1173bf){return _0x39aa92['status'](_0x412e4a)[_0x3090('0x19')](_0x1173bf);}};}function respondWithFilteredResult(_0x40002c,_0x5f01af){return function(_0xec11d5){if(_0xec11d5){var _0x574235=typeof _0x5f01af[_0x3090('0x1a')]===_0x3090('0x1b')&&typeof _0x5f01af[_0x3090('0x1c')]===_0x3090('0x1b');var _0xeeb5f=_0xec11d5[_0x3090('0x1d')];var _0x11492f=_0x574235?0x0:_0x5f01af[_0x3090('0x1a')];var _0x1dd8db=_0x574235?_0xec11d5[_0x3090('0x1d')]:_0x5f01af[_0x3090('0x1a')]+_0x5f01af['limit'];var _0xea6934;if(_0x1dd8db>=_0xeeb5f){_0x1dd8db=_0xeeb5f;_0xea6934=0xc8;}else{_0xea6934=0xce;}_0x40002c['status'](_0xea6934);return _0x40002c['set']('Content-Range',_0x11492f+'-'+_0x1dd8db+'/'+_0xeeb5f)[_0x3090('0x19')](_0xec11d5);}return null;};}function patchUpdates(_0xb4ce37){return function(_0x33bf4a){try{jsonpatch[_0x3090('0x1e')](_0x33bf4a,_0xb4ce37,!![]);}catch(_0x17eeba){return BPromise[_0x3090('0x1f')](_0x17eeba);}return _0x33bf4a[_0x3090('0x20')]();};}function saveUpdates(_0x2a3edd,_0x2c563c){return function(_0x3ff233){if(_0x3ff233){return _0x3ff233['update'](_0x2a3edd)[_0x3090('0x21')](function(_0x2bef6b){return _0x2bef6b;});}return null;};}function removeEntity(_0x3f547d,_0x144171){return function(_0x15e18a){if(_0x15e18a){return _0x15e18a['destroy']()[_0x3090('0x21')](function(){_0x3f547d[_0x3090('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b80da,_0x3fee90){return function(_0x29fab8){if(!_0x29fab8){_0x3b80da['sendStatus'](0x194);}return _0x29fab8;};}function handleError(_0x5c8306,_0x4cd089){_0x4cd089=_0x4cd089||0x1f4;return function(_0x35f4c8){logger[_0x3090('0x22')](_0x35f4c8[_0x3090('0x23')]);if(_0x35f4c8[_0x3090('0x24')]){delete _0x35f4c8[_0x3090('0x24')];}_0x5c8306[_0x3090('0x17')](_0x4cd089)['send'](_0x35f4c8);};}exports['index']=function(_0x2f80f9,_0x24e047){var _0x1315aa={},_0x307f8e={},_0x2b4ac6={'count':0x0,'rows':[]};var _0x5c0cee=_['map'](db[_0x3090('0x25')][_0x3090('0x26')],function(_0x24be27){return{'name':_0x24be27['fieldName'],'type':_0x24be27[_0x3090('0x27')][_0x3090('0x28')]};});_0x307f8e[_0x3090('0x29')]=_[_0x3090('0x2a')](_0x5c0cee,_0x3090('0x24'));_0x307f8e[_0x3090('0x2b')]=_[_0x3090('0x2c')](_0x2f80f9['query']);_0x307f8e['filters']=_[_0x3090('0x2d')](_0x307f8e['model'],_0x307f8e['query']);_0x1315aa[_0x3090('0x2e')]=_[_0x3090('0x2d')](_0x307f8e[_0x3090('0x29')],qs[_0x3090('0x2f')](_0x2f80f9[_0x3090('0x2b')][_0x3090('0x2f')]));_0x1315aa['attributes']=_0x1315aa[_0x3090('0x2e')]['length']?_0x1315aa[_0x3090('0x2e')]:_0x307f8e['model'];if(!_0x2f80f9['query']['hasOwnProperty']('nolimit')){_0x1315aa[_0x3090('0x1c')]=qs[_0x3090('0x1c')](_0x2f80f9[_0x3090('0x2b')][_0x3090('0x1c')]);_0x1315aa[_0x3090('0x1a')]=qs[_0x3090('0x1a')](_0x2f80f9[_0x3090('0x2b')][_0x3090('0x1a')]);}_0x1315aa[_0x3090('0x30')]=qs['sort'](_0x2f80f9[_0x3090('0x2b')][_0x3090('0x31')]);_0x1315aa[_0x3090('0x32')]=qs[_0x3090('0x33')](_['pick'](_0x2f80f9[_0x3090('0x2b')],_0x307f8e['filters']),_0x5c0cee);if(_0x2f80f9[_0x3090('0x2b')][_0x3090('0x34')]){_0x1315aa[_0x3090('0x32')]=_[_0x3090('0x35')](_0x1315aa[_0x3090('0x32')],{'$or':_[_0x3090('0x2a')](_0x5c0cee,function(_0x296add){if(_0x296add[_0x3090('0x27')]!==_0x3090('0x36')){var _0x17f747={};_0x17f747[_0x296add['name']]={'$like':'%'+_0x2f80f9[_0x3090('0x2b')]['filter']+'%'};return _0x17f747;}})});}_0x1315aa=_['merge']({},_0x1315aa,_0x2f80f9[_0x3090('0x37')]);var _0x575dc0={'where':_0x1315aa['where']};return db['Dynamics365Configuration'][_0x3090('0x1d')](_0x575dc0)[_0x3090('0x21')](function(_0x328d0f){_0x2b4ac6['count']=_0x328d0f;if(_0x2f80f9[_0x3090('0x2b')][_0x3090('0x38')]){_0x1315aa[_0x3090('0x39')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3090('0x3a')](_0x1315aa);})['then'](function(_0x3f5ff6){_0x2b4ac6['rows']=_0x3f5ff6;return _0x2b4ac6;})[_0x3090('0x21')](respondWithFilteredResult(_0x24e047,_0x1315aa))['catch'](handleError(_0x24e047,null));};exports[_0x3090('0x3b')]=function(_0x72b62d,_0x2ca665){var _0x4e3ca6={'raw':![],'where':{'id':_0x72b62d[_0x3090('0x3c')]['id']}},_0x4b4cf0={};_0x4b4cf0[_0x3090('0x29')]=_[_0x3090('0x2c')](db[_0x3090('0x25')][_0x3090('0x26')]);_0x4b4cf0['query']=_[_0x3090('0x2c')](_0x72b62d[_0x3090('0x2b')]);_0x4b4cf0[_0x3090('0x33')]=_[_0x3090('0x2d')](_0x4b4cf0['model'],_0x4b4cf0[_0x3090('0x2b')]);_0x4e3ca6[_0x3090('0x2e')]=_[_0x3090('0x2d')](_0x4b4cf0[_0x3090('0x29')],qs[_0x3090('0x2f')](_0x72b62d[_0x3090('0x2b')][_0x3090('0x2f')]));_0x4e3ca6[_0x3090('0x2e')]=_0x4e3ca6['attributes'][_0x3090('0x3d')]?_0x4e3ca6['attributes']:_0x4b4cf0[_0x3090('0x29')];if(_0x72b62d['query'][_0x3090('0x38')]){_0x4e3ca6[_0x3090('0x39')]=[{'all':!![]}];}_0x4e3ca6=_['merge']({},_0x4e3ca6,_0x72b62d[_0x3090('0x37')]);return db['Dynamics365Configuration'][_0x3090('0x3e')](_0x4e3ca6)[_0x3090('0x21')](handleEntityNotFound(_0x2ca665,null))[_0x3090('0x21')](respondWithResult(_0x2ca665,null))[_0x3090('0x3f')](handleError(_0x2ca665,null));};exports[_0x3090('0x40')]=function(_0x1fc7b7,_0x5b1c0b){return db['Dynamics365Configuration'][_0x3090('0x40')](_0x1fc7b7[_0x3090('0x41')],{})['then'](respondWithResult(_0x5b1c0b,0xc9))[_0x3090('0x3f')](handleError(_0x5b1c0b,null));};exports[_0x3090('0x42')]=function(_0x297cf3,_0x34ae1a){if(_0x297cf3[_0x3090('0x41')]['id']){delete _0x297cf3[_0x3090('0x41')]['id'];}return db[_0x3090('0x25')][_0x3090('0x3e')]({'where':{'id':_0x297cf3[_0x3090('0x3c')]['id']}})[_0x3090('0x21')](handleEntityNotFound(_0x34ae1a,null))[_0x3090('0x21')](saveUpdates(_0x297cf3[_0x3090('0x41')],null))[_0x3090('0x21')](respondWithResult(_0x34ae1a,null))[_0x3090('0x3f')](handleError(_0x34ae1a,null));};exports[_0x3090('0x43')]=function(_0x211699,_0x4a5926){return db[_0x3090('0x25')]['find']({'where':{'id':_0x211699[_0x3090('0x3c')]['id']}})[_0x3090('0x21')](handleEntityNotFound(_0x4a5926,null))[_0x3090('0x21')](removeEntity(_0x4a5926,null))[_0x3090('0x3f')](handleError(_0x4a5926,null));};exports['getFields']=function(_0x378e36,_0x36f0f4,_0x41c0d8){var _0x3c9f18={};var _0x396f46={};var _0xe0fc82;var _0x40749f;return db[_0x3090('0x25')][_0x3090('0x44')]({'where':{'id':_0x378e36[_0x3090('0x3c')]['id']}})[_0x3090('0x21')](handleEntityNotFound(_0x36f0f4,null))[_0x3090('0x21')](function(_0xffe802){if(_0xffe802){_0xe0fc82=_0xffe802;_0x396f46[_0x3090('0x29')]=_[_0x3090('0x2c')](db[_0x3090('0x45')][_0x3090('0x26')]);_0x396f46[_0x3090('0x2b')]=_[_0x3090('0x2c')](_0x378e36[_0x3090('0x2b')]);_0x396f46[_0x3090('0x33')]=_['intersection'](_0x396f46[_0x3090('0x29')],_0x396f46[_0x3090('0x2b')]);_0x3c9f18[_0x3090('0x2e')]=_[_0x3090('0x2d')](_0x396f46[_0x3090('0x29')],qs[_0x3090('0x2f')](_0x378e36['query'][_0x3090('0x2f')]));_0x3c9f18[_0x3090('0x2e')]=_0x3c9f18['attributes']['length']?_0x3c9f18[_0x3090('0x2e')]:_0x396f46['model'];_0x3c9f18['order']=qs['sort'](_0x378e36[_0x3090('0x2b')]['sort']);_0x3c9f18[_0x3090('0x32')]=qs[_0x3090('0x33')](_[_0x3090('0x46')](_0x378e36[_0x3090('0x2b')],_0x396f46['filters']));if(_0x378e36[_0x3090('0x2b')][_0x3090('0x34')]){_0x3c9f18[_0x3090('0x32')]=_['merge'](_0x3c9f18[_0x3090('0x32')],{'$or':_['map'](_0x3c9f18[_0x3090('0x2e')],function(_0x539d20){var _0x1eafe7={};_0x1eafe7[_0x539d20]={'$like':'%'+_0x378e36[_0x3090('0x2b')][_0x3090('0x34')]+'%'};return _0x1eafe7;})});}_0x3c9f18=_[_0x3090('0x35')]({},_0x3c9f18,_0x378e36[_0x3090('0x37')]);return _0xe0fc82[_0x3090('0x47')](_0x3c9f18);}})[_0x3090('0x21')](function(_0x2bcd91){if(_0x2bcd91){_0x40749f=_0x2bcd91[_0x3090('0x3d')];if(!_0x378e36['query'][_0x3090('0x48')]('nolimit')){_0x3c9f18[_0x3090('0x1c')]=qs['limit'](_0x378e36[_0x3090('0x2b')]['limit']);_0x3c9f18[_0x3090('0x1a')]=qs[_0x3090('0x1a')](_0x378e36[_0x3090('0x2b')][_0x3090('0x1a')]);}return _0xe0fc82[_0x3090('0x47')](_0x3c9f18);}})[_0x3090('0x21')](function(_0x34d2de){if(_0x34d2de){return _0x34d2de?{'count':_0x40749f,'rows':_0x34d2de}:null;}})[_0x3090('0x21')](respondWithResult(_0x36f0f4,null))[_0x3090('0x3f')](handleError(_0x36f0f4,null));};exports[_0x3090('0x49')]=function(_0x153dd3,_0x2465e2,_0x2b636e){var _0x54b2c9={};var _0x3edf3a={};var _0x5f351c;var _0x57996d;return db[_0x3090('0x25')][_0x3090('0x44')]({'where':{'id':_0x153dd3[_0x3090('0x3c')]['id']}})[_0x3090('0x21')](handleEntityNotFound(_0x2465e2,null))[_0x3090('0x21')](function(_0x4d4e7e){if(_0x4d4e7e){_0x5f351c=_0x4d4e7e;_0x3edf3a[_0x3090('0x29')]=_[_0x3090('0x2c')](db[_0x3090('0x45')][_0x3090('0x26')]);_0x3edf3a['query']=_['keys'](_0x153dd3['query']);_0x3edf3a['filters']=_[_0x3090('0x2d')](_0x3edf3a[_0x3090('0x29')],_0x3edf3a[_0x3090('0x2b')]);_0x54b2c9[_0x3090('0x2e')]=_[_0x3090('0x2d')](_0x3edf3a[_0x3090('0x29')],qs['fields'](_0x153dd3['query'][_0x3090('0x2f')]));_0x54b2c9[_0x3090('0x2e')]=_0x54b2c9[_0x3090('0x2e')][_0x3090('0x3d')]?_0x54b2c9[_0x3090('0x2e')]:_0x3edf3a['model'];_0x54b2c9[_0x3090('0x30')]=qs[_0x3090('0x31')](_0x153dd3[_0x3090('0x2b')][_0x3090('0x31')]);_0x54b2c9[_0x3090('0x32')]=qs[_0x3090('0x33')](_[_0x3090('0x46')](_0x153dd3['query'],_0x3edf3a[_0x3090('0x33')]));if(_0x153dd3[_0x3090('0x2b')]['filter']){_0x54b2c9[_0x3090('0x32')]=_[_0x3090('0x35')](_0x54b2c9[_0x3090('0x32')],{'$or':_[_0x3090('0x2a')](_0x54b2c9[_0x3090('0x2e')],function(_0x3f296a){var _0x5c5677={};_0x5c5677[_0x3f296a]={'$like':'%'+_0x153dd3[_0x3090('0x2b')]['filter']+'%'};return _0x5c5677;})});}_0x54b2c9=_[_0x3090('0x35')]({},_0x54b2c9,_0x153dd3[_0x3090('0x37')]);return _0x5f351c[_0x3090('0x49')](_0x54b2c9);}})[_0x3090('0x21')](function(_0x44f355){if(_0x44f355){_0x57996d=_0x44f355['length'];if(!_0x153dd3[_0x3090('0x2b')]['hasOwnProperty'](_0x3090('0x4a'))){_0x54b2c9['limit']=qs[_0x3090('0x1c')](_0x153dd3[_0x3090('0x2b')][_0x3090('0x1c')]);_0x54b2c9[_0x3090('0x1a')]=qs['offset'](_0x153dd3[_0x3090('0x2b')][_0x3090('0x1a')]);}return _0x5f351c[_0x3090('0x49')](_0x54b2c9);}})[_0x3090('0x21')](function(_0x59675c){if(_0x59675c){return _0x59675c?{'count':_0x57996d,'rows':_0x59675c}:null;}})['then'](respondWithResult(_0x2465e2,null))['catch'](handleError(_0x2465e2,null));};exports[_0x3090('0x4b')]=function(_0x1cce63,_0x15e0aa,_0x577001){var _0xf177b2={};var _0x1a18e1={};var _0x46d976;var _0x4f44b3;return db[_0x3090('0x25')][_0x3090('0x44')]({'where':{'id':_0x1cce63[_0x3090('0x3c')]['id']}})['then'](handleEntityNotFound(_0x15e0aa,null))[_0x3090('0x21')](function(_0x24bd31){if(_0x24bd31){_0x46d976=_0x24bd31;_0x1a18e1[_0x3090('0x29')]=_[_0x3090('0x2c')](db[_0x3090('0x45')]['rawAttributes']);_0x1a18e1[_0x3090('0x2b')]=_[_0x3090('0x2c')](_0x1cce63[_0x3090('0x2b')]);_0x1a18e1[_0x3090('0x33')]=_[_0x3090('0x2d')](_0x1a18e1['model'],_0x1a18e1[_0x3090('0x2b')]);_0xf177b2[_0x3090('0x2e')]=_['intersection'](_0x1a18e1['model'],qs[_0x3090('0x2f')](_0x1cce63[_0x3090('0x2b')][_0x3090('0x2f')]));_0xf177b2[_0x3090('0x2e')]=_0xf177b2[_0x3090('0x2e')]['length']?_0xf177b2[_0x3090('0x2e')]:_0x1a18e1[_0x3090('0x29')];_0xf177b2[_0x3090('0x30')]=qs['sort'](_0x1cce63[_0x3090('0x2b')][_0x3090('0x31')]);_0xf177b2[_0x3090('0x32')]=qs[_0x3090('0x33')](_[_0x3090('0x46')](_0x1cce63[_0x3090('0x2b')],_0x1a18e1[_0x3090('0x33')]));if(_0x1cce63[_0x3090('0x2b')][_0x3090('0x34')]){_0xf177b2[_0x3090('0x32')]=_[_0x3090('0x35')](_0xf177b2[_0x3090('0x32')],{'$or':_[_0x3090('0x2a')](_0xf177b2[_0x3090('0x2e')],function(_0x5d1272){var _0x5b8603={};_0x5b8603[_0x5d1272]={'$like':'%'+_0x1cce63[_0x3090('0x2b')]['filter']+'%'};return _0x5b8603;})});}_0xf177b2=_[_0x3090('0x35')]({},_0xf177b2,_0x1cce63['options']);return _0x46d976[_0x3090('0x4b')](_0xf177b2);}})['then'](function(_0x1fe3d0){if(_0x1fe3d0){_0x4f44b3=_0x1fe3d0[_0x3090('0x3d')];if(!_0x1cce63[_0x3090('0x2b')]['hasOwnProperty'](_0x3090('0x4a'))){_0xf177b2['limit']=qs[_0x3090('0x1c')](_0x1cce63[_0x3090('0x2b')][_0x3090('0x1c')]);_0xf177b2[_0x3090('0x1a')]=qs['offset'](_0x1cce63[_0x3090('0x2b')][_0x3090('0x1a')]);}return _0x46d976[_0x3090('0x4b')](_0xf177b2);}})['then'](function(_0xfdab20){if(_0xfdab20){return _0xfdab20?{'count':_0x4f44b3,'rows':_0xfdab20}:null;}})[_0x3090('0x21')](respondWithResult(_0x15e0aa,null))[_0x3090('0x3f')](handleError(_0x15e0aa,null));};
\ No newline at end of file
+var _0x154d=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','intersection','merge','create','body','find','getFields','hasOwnProperty','getSubjects','findOne','Dynamics365Field','pick','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x154d,0xe4));var _0xd154=function(_0x408f75,_0x427ddf){_0x408f75=_0x408f75-0x0;var _0x1192de=_0x154d[_0x408f75];return _0x1192de;};'use strict';var emlformat=require(_0xd154('0x0'));var rimraf=require(_0xd154('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd154('0x2'));var rp=require(_0xd154('0x3'));var moment=require(_0xd154('0x4'));var BPromise=require(_0xd154('0x5'));var Mustache=require(_0xd154('0x6'));var util=require(_0xd154('0x7'));var path=require(_0xd154('0x8'));var sox=require(_0xd154('0x9'));var csv=require(_0xd154('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd154('0xb'));var _=require('lodash');var squel=require(_0xd154('0xc'));var crypto=require(_0xd154('0xd'));var jsforce=require(_0xd154('0xe'));var deskjs=require(_0xd154('0xf'));var toCsv=require(_0xd154('0xa'));var querystring=require(_0xd154('0x10'));var Papa=require(_0xd154('0x11'));var Redis=require(_0xd154('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd154('0x13'));var as=require(_0xd154('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd154('0x15'))(_0xd154('0x16'));var utils=require(_0xd154('0x17'));var config=require(_0xd154('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd154('0x19'))['db'];function respondWithStatusCode(_0x54812d,_0x3fed9e){_0x3fed9e=_0x3fed9e||0xcc;return function(_0x1dd23c){if(_0x1dd23c){return _0x54812d['sendStatus'](_0x3fed9e);}return _0x54812d[_0xd154('0x1a')](_0x3fed9e)[_0xd154('0x1b')]();};}function respondWithResult(_0x1b91c0,_0x2af0dc){_0x2af0dc=_0x2af0dc||0xc8;return function(_0x1a67be){if(_0x1a67be){return _0x1b91c0['status'](_0x2af0dc)[_0xd154('0x1c')](_0x1a67be);}};}function respondWithFilteredResult(_0x49f03e,_0xcd3791){return function(_0x36a28d){if(_0x36a28d){var _0xe7e4ab=typeof _0xcd3791['offset']===_0xd154('0x1d')&&typeof _0xcd3791[_0xd154('0x1e')]===_0xd154('0x1d');var _0x295c85=_0x36a28d[_0xd154('0x1f')];var _0x42a275=_0xe7e4ab?0x0:_0xcd3791[_0xd154('0x20')];var _0x440fe8=_0xe7e4ab?_0x36a28d['count']:_0xcd3791[_0xd154('0x20')]+_0xcd3791[_0xd154('0x1e')];var _0x198e95;if(_0x440fe8>=_0x295c85){_0x440fe8=_0x295c85;_0x198e95=0xc8;}else{_0x198e95=0xce;}_0x49f03e[_0xd154('0x1a')](_0x198e95);return _0x49f03e['set']('Content-Range',_0x42a275+'-'+_0x440fe8+'/'+_0x295c85)[_0xd154('0x1c')](_0x36a28d);}return null;};}function patchUpdates(_0x4c9247){return function(_0x250422){try{jsonpatch[_0xd154('0x21')](_0x250422,_0x4c9247,!![]);}catch(_0xab7eda){return BPromise[_0xd154('0x22')](_0xab7eda);}return _0x250422[_0xd154('0x23')]();};}function saveUpdates(_0x3f9bb1,_0x46ff93){return function(_0x4b74b9){if(_0x4b74b9){return _0x4b74b9[_0xd154('0x24')](_0x3f9bb1)[_0xd154('0x25')](function(_0x42f5f4){return _0x42f5f4;});}return null;};}function removeEntity(_0x34e664,_0x28891b){return function(_0x1f7673){if(_0x1f7673){return _0x1f7673[_0xd154('0x26')]()[_0xd154('0x25')](function(){_0x34e664[_0xd154('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a599,_0x492f90){return function(_0x4a824b){if(!_0x4a824b){_0x53a599[_0xd154('0x27')](0x194);}return _0x4a824b;};}function handleError(_0x2f997e,_0x146e86){_0x146e86=_0x146e86||0x1f4;return function(_0xcbd5b6){logger[_0xd154('0x28')](_0xcbd5b6['stack']);if(_0xcbd5b6[_0xd154('0x29')]){delete _0xcbd5b6[_0xd154('0x29')];}_0x2f997e[_0xd154('0x1a')](_0x146e86)[_0xd154('0x2a')](_0xcbd5b6);};}exports[_0xd154('0x2b')]=function(_0x4648d0,_0x36aa35){var _0x252277={},_0x1ddcf5={},_0xe071bb={'count':0x0,'rows':[]};var _0x3fae8a=_[_0xd154('0x2c')](db[_0xd154('0x2d')][_0xd154('0x2e')],function(_0x1ebb0f){return{'name':_0x1ebb0f['fieldName'],'type':_0x1ebb0f[_0xd154('0x2f')][_0xd154('0x30')]};});_0x1ddcf5[_0xd154('0x31')]=_[_0xd154('0x2c')](_0x3fae8a,_0xd154('0x29'));_0x1ddcf5[_0xd154('0x32')]=_[_0xd154('0x33')](_0x4648d0[_0xd154('0x32')]);_0x1ddcf5[_0xd154('0x34')]=_['intersection'](_0x1ddcf5[_0xd154('0x31')],_0x1ddcf5[_0xd154('0x32')]);_0x252277[_0xd154('0x35')]=_['intersection'](_0x1ddcf5['model'],qs[_0xd154('0x36')](_0x4648d0['query'][_0xd154('0x36')]));_0x252277[_0xd154('0x35')]=_0x252277['attributes'][_0xd154('0x37')]?_0x252277[_0xd154('0x35')]:_0x1ddcf5[_0xd154('0x31')];if(!_0x4648d0[_0xd154('0x32')]['hasOwnProperty'](_0xd154('0x38'))){_0x252277[_0xd154('0x1e')]=qs['limit'](_0x4648d0[_0xd154('0x32')]['limit']);_0x252277[_0xd154('0x20')]=qs[_0xd154('0x20')](_0x4648d0[_0xd154('0x32')][_0xd154('0x20')]);}_0x252277[_0xd154('0x39')]=qs['sort'](_0x4648d0[_0xd154('0x32')][_0xd154('0x3a')]);_0x252277[_0xd154('0x3b')]=qs[_0xd154('0x34')](_['pick'](_0x4648d0[_0xd154('0x32')],_0x1ddcf5[_0xd154('0x34')]),_0x3fae8a);if(_0x4648d0[_0xd154('0x32')][_0xd154('0x3c')]){_0x252277[_0xd154('0x3b')]=_['merge'](_0x252277[_0xd154('0x3b')],{'$or':_[_0xd154('0x2c')](_0x3fae8a,function(_0x17eb1d){if(_0x17eb1d[_0xd154('0x2f')]!==_0xd154('0x3d')){var _0xe7b98a={};_0xe7b98a[_0x17eb1d[_0xd154('0x29')]]={'$like':'%'+_0x4648d0[_0xd154('0x32')][_0xd154('0x3c')]+'%'};return _0xe7b98a;}})});}_0x252277=_['merge']({},_0x252277,_0x4648d0[_0xd154('0x3e')]);var _0x473516={'where':_0x252277[_0xd154('0x3b')]};return db['Dynamics365Configuration'][_0xd154('0x1f')](_0x473516)['then'](function(_0x2b74e4){_0xe071bb[_0xd154('0x1f')]=_0x2b74e4;if(_0x4648d0[_0xd154('0x32')][_0xd154('0x3f')]){_0x252277[_0xd154('0x40')]=[{'all':!![]}];}return db[_0xd154('0x2d')][_0xd154('0x41')](_0x252277);})['then'](function(_0x5d1947){_0xe071bb['rows']=_0x5d1947;return _0xe071bb;})[_0xd154('0x25')](respondWithFilteredResult(_0x36aa35,_0x252277))[_0xd154('0x42')](handleError(_0x36aa35,null));};exports['show']=function(_0x39a388,_0x58bb90){var _0x124a56={'raw':![],'where':{'id':_0x39a388[_0xd154('0x43')]['id']}},_0x32fe43={};_0x32fe43['model']=_[_0xd154('0x33')](db[_0xd154('0x2d')]['rawAttributes']);_0x32fe43[_0xd154('0x32')]=_[_0xd154('0x33')](_0x39a388[_0xd154('0x32')]);_0x32fe43[_0xd154('0x34')]=_['intersection'](_0x32fe43[_0xd154('0x31')],_0x32fe43[_0xd154('0x32')]);_0x124a56['attributes']=_[_0xd154('0x44')](_0x32fe43[_0xd154('0x31')],qs[_0xd154('0x36')](_0x39a388['query'][_0xd154('0x36')]));_0x124a56[_0xd154('0x35')]=_0x124a56['attributes'][_0xd154('0x37')]?_0x124a56[_0xd154('0x35')]:_0x32fe43[_0xd154('0x31')];if(_0x39a388['query'][_0xd154('0x3f')]){_0x124a56[_0xd154('0x40')]=[{'all':!![]}];}_0x124a56=_[_0xd154('0x45')]({},_0x124a56,_0x39a388[_0xd154('0x3e')]);return db[_0xd154('0x2d')]['find'](_0x124a56)['then'](handleEntityNotFound(_0x58bb90,null))[_0xd154('0x25')](respondWithResult(_0x58bb90,null))[_0xd154('0x42')](handleError(_0x58bb90,null));};exports[_0xd154('0x46')]=function(_0x156619,_0x17293b){return db[_0xd154('0x2d')][_0xd154('0x46')](_0x156619['body'],{})['then'](respondWithResult(_0x17293b,0xc9))[_0xd154('0x42')](handleError(_0x17293b,null));};exports[_0xd154('0x24')]=function(_0x2979b3,_0x41354d){if(_0x2979b3[_0xd154('0x47')]['id']){delete _0x2979b3[_0xd154('0x47')]['id'];}return db[_0xd154('0x2d')][_0xd154('0x48')]({'where':{'id':_0x2979b3[_0xd154('0x43')]['id']}})[_0xd154('0x25')](handleEntityNotFound(_0x41354d,null))[_0xd154('0x25')](saveUpdates(_0x2979b3[_0xd154('0x47')],null))[_0xd154('0x25')](respondWithResult(_0x41354d,null))[_0xd154('0x42')](handleError(_0x41354d,null));};exports[_0xd154('0x26')]=function(_0x1bfe30,_0x5c523d){return db[_0xd154('0x2d')][_0xd154('0x48')]({'where':{'id':_0x1bfe30['params']['id']}})[_0xd154('0x25')](handleEntityNotFound(_0x5c523d,null))[_0xd154('0x25')](removeEntity(_0x5c523d,null))['catch'](handleError(_0x5c523d,null));};exports['getFields']=function(_0x5c642e,_0x264ad0,_0xf6dec7){var _0x1ea32e={};var _0x29cc39={};var _0x44eb89;var _0x58f837;return db[_0xd154('0x2d')]['findOne']({'where':{'id':_0x5c642e['params']['id']}})[_0xd154('0x25')](handleEntityNotFound(_0x264ad0,null))[_0xd154('0x25')](function(_0x4d52b7){if(_0x4d52b7){_0x44eb89=_0x4d52b7;_0x29cc39[_0xd154('0x31')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x29cc39[_0xd154('0x32')]=_[_0xd154('0x33')](_0x5c642e['query']);_0x29cc39[_0xd154('0x34')]=_[_0xd154('0x44')](_0x29cc39[_0xd154('0x31')],_0x29cc39[_0xd154('0x32')]);_0x1ea32e['attributes']=_[_0xd154('0x44')](_0x29cc39['model'],qs['fields'](_0x5c642e['query'][_0xd154('0x36')]));_0x1ea32e[_0xd154('0x35')]=_0x1ea32e['attributes'][_0xd154('0x37')]?_0x1ea32e[_0xd154('0x35')]:_0x29cc39[_0xd154('0x31')];_0x1ea32e[_0xd154('0x39')]=qs[_0xd154('0x3a')](_0x5c642e[_0xd154('0x32')][_0xd154('0x3a')]);_0x1ea32e[_0xd154('0x3b')]=qs['filters'](_['pick'](_0x5c642e['query'],_0x29cc39[_0xd154('0x34')]));if(_0x5c642e[_0xd154('0x32')]['filter']){_0x1ea32e[_0xd154('0x3b')]=_[_0xd154('0x45')](_0x1ea32e['where'],{'$or':_['map'](_0x1ea32e[_0xd154('0x35')],function(_0x1b42ca){var _0x4ab916={};_0x4ab916[_0x1b42ca]={'$like':'%'+_0x5c642e[_0xd154('0x32')][_0xd154('0x3c')]+'%'};return _0x4ab916;})});}_0x1ea32e=_[_0xd154('0x45')]({},_0x1ea32e,_0x5c642e[_0xd154('0x3e')]);return _0x44eb89[_0xd154('0x49')](_0x1ea32e);}})[_0xd154('0x25')](function(_0x19cc5f){if(_0x19cc5f){_0x58f837=_0x19cc5f[_0xd154('0x37')];if(!_0x5c642e[_0xd154('0x32')][_0xd154('0x4a')](_0xd154('0x38'))){_0x1ea32e[_0xd154('0x1e')]=qs[_0xd154('0x1e')](_0x5c642e[_0xd154('0x32')][_0xd154('0x1e')]);_0x1ea32e['offset']=qs['offset'](_0x5c642e['query'][_0xd154('0x20')]);}return _0x44eb89['getFields'](_0x1ea32e);}})[_0xd154('0x25')](function(_0x546fe1){if(_0x546fe1){return _0x546fe1?{'count':_0x58f837,'rows':_0x546fe1}:null;}})[_0xd154('0x25')](respondWithResult(_0x264ad0,null))['catch'](handleError(_0x264ad0,null));};exports[_0xd154('0x4b')]=function(_0x45272e,_0x4e0629,_0x3c2618){var _0x581e41={};var _0x4c6c74={};var _0xaf4149;var _0x890950;return db[_0xd154('0x2d')][_0xd154('0x4c')]({'where':{'id':_0x45272e[_0xd154('0x43')]['id']}})[_0xd154('0x25')](handleEntityNotFound(_0x4e0629,null))['then'](function(_0x54f7ef){if(_0x54f7ef){_0xaf4149=_0x54f7ef;_0x4c6c74['model']=_[_0xd154('0x33')](db[_0xd154('0x4d')][_0xd154('0x2e')]);_0x4c6c74[_0xd154('0x32')]=_['keys'](_0x45272e[_0xd154('0x32')]);_0x4c6c74['filters']=_['intersection'](_0x4c6c74[_0xd154('0x31')],_0x4c6c74[_0xd154('0x32')]);_0x581e41['attributes']=_[_0xd154('0x44')](_0x4c6c74[_0xd154('0x31')],qs[_0xd154('0x36')](_0x45272e[_0xd154('0x32')][_0xd154('0x36')]));_0x581e41[_0xd154('0x35')]=_0x581e41['attributes']['length']?_0x581e41[_0xd154('0x35')]:_0x4c6c74[_0xd154('0x31')];_0x581e41[_0xd154('0x39')]=qs[_0xd154('0x3a')](_0x45272e[_0xd154('0x32')][_0xd154('0x3a')]);_0x581e41[_0xd154('0x3b')]=qs[_0xd154('0x34')](_[_0xd154('0x4e')](_0x45272e['query'],_0x4c6c74[_0xd154('0x34')]));if(_0x45272e[_0xd154('0x32')][_0xd154('0x3c')]){_0x581e41[_0xd154('0x3b')]=_[_0xd154('0x45')](_0x581e41[_0xd154('0x3b')],{'$or':_[_0xd154('0x2c')](_0x581e41['attributes'],function(_0x529805){var _0x4d8fe7={};_0x4d8fe7[_0x529805]={'$like':'%'+_0x45272e[_0xd154('0x32')][_0xd154('0x3c')]+'%'};return _0x4d8fe7;})});}_0x581e41=_[_0xd154('0x45')]({},_0x581e41,_0x45272e[_0xd154('0x3e')]);return _0xaf4149['getSubjects'](_0x581e41);}})[_0xd154('0x25')](function(_0x4933a1){if(_0x4933a1){_0x890950=_0x4933a1[_0xd154('0x37')];if(!_0x45272e[_0xd154('0x32')][_0xd154('0x4a')](_0xd154('0x38'))){_0x581e41[_0xd154('0x1e')]=qs[_0xd154('0x1e')](_0x45272e[_0xd154('0x32')][_0xd154('0x1e')]);_0x581e41[_0xd154('0x20')]=qs[_0xd154('0x20')](_0x45272e['query'][_0xd154('0x20')]);}return _0xaf4149[_0xd154('0x4b')](_0x581e41);}})[_0xd154('0x25')](function(_0x2bf272){if(_0x2bf272){return _0x2bf272?{'count':_0x890950,'rows':_0x2bf272}:null;}})[_0xd154('0x25')](respondWithResult(_0x4e0629,null))[_0xd154('0x42')](handleError(_0x4e0629,null));};exports[_0xd154('0x4f')]=function(_0x275d19,_0x293a64,_0x25a2f6){var _0x16ce85={};var _0x2696a8={};var _0x45efb6;var _0x880c70;return db[_0xd154('0x2d')][_0xd154('0x4c')]({'where':{'id':_0x275d19['params']['id']}})[_0xd154('0x25')](handleEntityNotFound(_0x293a64,null))[_0xd154('0x25')](function(_0x163fda){if(_0x163fda){_0x45efb6=_0x163fda;_0x2696a8['model']=_[_0xd154('0x33')](db[_0xd154('0x4d')]['rawAttributes']);_0x2696a8[_0xd154('0x32')]=_['keys'](_0x275d19['query']);_0x2696a8[_0xd154('0x34')]=_[_0xd154('0x44')](_0x2696a8['model'],_0x2696a8['query']);_0x16ce85[_0xd154('0x35')]=_[_0xd154('0x44')](_0x2696a8[_0xd154('0x31')],qs[_0xd154('0x36')](_0x275d19[_0xd154('0x32')][_0xd154('0x36')]));_0x16ce85[_0xd154('0x35')]=_0x16ce85[_0xd154('0x35')][_0xd154('0x37')]?_0x16ce85[_0xd154('0x35')]:_0x2696a8[_0xd154('0x31')];_0x16ce85[_0xd154('0x39')]=qs[_0xd154('0x3a')](_0x275d19['query'][_0xd154('0x3a')]);_0x16ce85[_0xd154('0x3b')]=qs[_0xd154('0x34')](_['pick'](_0x275d19[_0xd154('0x32')],_0x2696a8[_0xd154('0x34')]));if(_0x275d19[_0xd154('0x32')][_0xd154('0x3c')]){_0x16ce85['where']=_[_0xd154('0x45')](_0x16ce85['where'],{'$or':_[_0xd154('0x2c')](_0x16ce85[_0xd154('0x35')],function(_0x4959bb){var _0x2d246b={};_0x2d246b[_0x4959bb]={'$like':'%'+_0x275d19[_0xd154('0x32')][_0xd154('0x3c')]+'%'};return _0x2d246b;})});}_0x16ce85=_[_0xd154('0x45')]({},_0x16ce85,_0x275d19[_0xd154('0x3e')]);return _0x45efb6['getDescriptions'](_0x16ce85);}})[_0xd154('0x25')](function(_0x2d9851){if(_0x2d9851){_0x880c70=_0x2d9851[_0xd154('0x37')];if(!_0x275d19[_0xd154('0x32')][_0xd154('0x4a')]('nolimit')){_0x16ce85[_0xd154('0x1e')]=qs['limit'](_0x275d19[_0xd154('0x32')][_0xd154('0x1e')]);_0x16ce85[_0xd154('0x20')]=qs[_0xd154('0x20')](_0x275d19[_0xd154('0x32')][_0xd154('0x20')]);}return _0x45efb6[_0xd154('0x4f')](_0x16ce85);}})[_0xd154('0x25')](function(_0xbfa64a){if(_0xbfa64a){return _0xbfa64a?{'count':_0x880c70,'rows':_0xbfa64a}:null;}})[_0xd154('0x25')](respondWithResult(_0x293a64,null))[_0xd154('0x42')](handleError(_0x293a64,null));};
\ No newline at end of file
index a5387a6..da3facc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0xe525cf,_0x26d5b2){var _0x49f5a7=function(_0x288238){while(--_0x288238){_0xe525cf['push'](_0xe525cf['shift']());}};_0x49f5a7(++_0x26d5b2);}(_0x9f62,0x154));var _0x29f6=function(_0x3b0b3a,_0x2469fb){_0x3b0b3a=_0x3b0b3a-0x0;var _0x5b6c77=_0x9f62[_0x3b0b3a];return _0x5b6c77;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x3adde2,_0x3062c3){var _0xd3726d=function(_0x42bbe6){while(--_0x42bbe6){_0x3adde2['push'](_0x3adde2['shift']());}};_0xd3726d(++_0x3062c3);}(_0x5b02,0xe9));var _0x25b0=function(_0x4149a0,_0x2bc959){_0x4149a0=_0x4149a0-0x0;var _0x1e32bb=_0x5b02[_0x4149a0];return _0x1e32bb;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d594baf..6680cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a79=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x6a79,0x144));var _0x96a7=function(_0x156e60,_0x18ef4b){_0x156e60=_0x156e60-0x0;var _0xe8a8e3=_0x6a79[_0x156e60];return _0xe8a8e3;};'use strict';var _=require(_0x96a7('0x0'));var util=require(_0x96a7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x96a7('0x2'));var fs=require('fs');var Redis=require(_0x96a7('0x3'));var db=require(_0x96a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96a7('0x5'))(_0x96a7('0x6'));var config=require(_0x96a7('0x7'));var jayson=require(_0x96a7('0x8'));var client=jayson[_0x96a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x581c21,_0x1f2d1c,_0x4ce149){return new BPromise(function(_0x4cdb58,_0x58167c){return client[_0x96a7('0xa')](_0x581c21,_0x4ce149)[_0x96a7('0xb')](function(_0x53b14e){logger[_0x96a7('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f2d1c,_0x96a7('0xd'));logger[_0x96a7('0xe')](_0x96a7('0xf'),_0x1f2d1c,_0x96a7('0xd'),JSON[_0x96a7('0x10')](_0x53b14e));if(_0x53b14e[_0x96a7('0x11')]){if(_0x53b14e[_0x96a7('0x11')][_0x96a7('0x12')]===0x1f4){logger['error'](_0x96a7('0x13'),_0x1f2d1c,_0x53b14e[_0x96a7('0x11')][_0x96a7('0x14')]);return _0x58167c(_0x53b14e[_0x96a7('0x11')]['message']);}logger[_0x96a7('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f2d1c,_0x53b14e[_0x96a7('0x11')]['message']);return _0x4cdb58(_0x53b14e[_0x96a7('0x11')][_0x96a7('0x14')]);}else{logger[_0x96a7('0xc')](_0x96a7('0x13'),_0x1f2d1c,_0x96a7('0xd'));_0x4cdb58(_0x53b14e[_0x96a7('0x15')]['message']);}})[_0x96a7('0x16')](function(_0x547b04){logger['error'](_0x96a7('0x13'),_0x1f2d1c,_0x547b04);_0x58167c(_0x547b04);});});}
\ No newline at end of file
+var _0x1011=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1011,0xe1));var _0x1101=function(_0x1eb252,_0x1b9c4f){_0x1eb252=_0x1eb252-0x0;var _0x7d46a=_0x1011[_0x1eb252];return _0x7d46a;};'use strict';var _=require(_0x1101('0x0'));var util=require(_0x1101('0x1'));var moment=require(_0x1101('0x2'));var BPromise=require(_0x1101('0x3'));var rs=require(_0x1101('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1101('0x5'))['db'];var utils=require(_0x1101('0x6'));var logger=require(_0x1101('0x7'))('rpc');var config=require(_0x1101('0x8'));var jayson=require(_0x1101('0x9'));var client=jayson['client'][_0x1101('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x315b24,_0x44d1bf,_0x1bcf73){return new BPromise(function(_0x39da79,_0x3088b7){return client[_0x1101('0xb')](_0x315b24,_0x1bcf73)['then'](function(_0x1cbef7){logger[_0x1101('0xc')](_0x1101('0xd'),_0x44d1bf,_0x1101('0xe'));logger[_0x1101('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x44d1bf,'request\x20sent',JSON[_0x1101('0x10')](_0x1cbef7));if(_0x1cbef7[_0x1101('0x11')]){if(_0x1cbef7[_0x1101('0x11')][_0x1101('0x12')]===0x1f4){logger[_0x1101('0x11')](_0x1101('0xd'),_0x44d1bf,_0x1cbef7[_0x1101('0x11')][_0x1101('0x13')]);return _0x3088b7(_0x1cbef7[_0x1101('0x11')][_0x1101('0x13')]);}logger[_0x1101('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x44d1bf,_0x1cbef7[_0x1101('0x11')][_0x1101('0x13')]);return _0x39da79(_0x1cbef7['error'][_0x1101('0x13')]);}else{logger[_0x1101('0xc')](_0x1101('0xd'),_0x44d1bf,_0x1101('0xe'));_0x39da79(_0x1cbef7['result'][_0x1101('0x13')]);}})[_0x1101('0x14')](function(_0x46c1dc){logger[_0x1101('0x11')](_0x1101('0xd'),_0x44d1bf,_0x46c1dc);_0x3088b7(_0x46c1dc);});});}
\ No newline at end of file
index 562e77d..c9e1cb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0b5=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x3acd48,_0x216d4f){var _0x2e4bbf=function(_0x150192){while(--_0x150192){_0x3acd48['push'](_0x3acd48['shift']());}};_0x2e4bbf(++_0x216d4f);}(_0xa0b5,0x17c));var _0x5a0b=function(_0x15ec79,_0x5cae50){_0x15ec79=_0x15ec79-0x0;var _0x1c13cc=_0xa0b5[_0x15ec79];return _0x1c13cc;};'use strict';var multer=require(_0x5a0b('0x0'));var util=require(_0x5a0b('0x1'));var path=require(_0x5a0b('0x2'));var timeout=require(_0x5a0b('0x3'));var express=require(_0x5a0b('0x4'));var router=express[_0x5a0b('0x5')]();var fs_extra=require(_0x5a0b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5a0b('0x7'));var controller=require(_0x5a0b('0x8'));router[_0x5a0b('0x9')]('/',auth[_0x5a0b('0xa')](),controller[_0x5a0b('0xb')]);router['get']('/:id',auth[_0x5a0b('0xa')](),controller[_0x5a0b('0xc')]);router[_0x5a0b('0xd')]('/',auth[_0x5a0b('0xa')](),controller[_0x5a0b('0xe')]);router[_0x5a0b('0xf')](_0x5a0b('0x10'),auth[_0x5a0b('0xa')](),controller[_0x5a0b('0x11')]);router[_0x5a0b('0x12')](_0x5a0b('0x10'),auth[_0x5a0b('0xa')](),controller[_0x5a0b('0x13')]);module[_0x5a0b('0x14')]=router;
\ No newline at end of file
+var _0x5c22=['create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post'];(function(_0x48ccc4,_0x4045e4){var _0x49d8bd=function(_0x25fc2b){while(--_0x25fc2b){_0x48ccc4['push'](_0x48ccc4['shift']());}};_0x49d8bd(++_0x4045e4);}(_0x5c22,0x8a));var _0x25c2=function(_0x335e4e,_0x3f86b3){_0x335e4e=_0x335e4e-0x0;var _0x13cb7f=_0x5c22[_0x335e4e];return _0x13cb7f;};'use strict';var multer=require('multer');var util=require(_0x25c2('0x0'));var path=require(_0x25c2('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c2('0x2'));var router=express[_0x25c2('0x3')]();var fs_extra=require(_0x25c2('0x4'));var auth=require(_0x25c2('0x5'));var interaction=require(_0x25c2('0x6'));var config=require(_0x25c2('0x7'));var controller=require(_0x25c2('0x8'));router[_0x25c2('0x9')]('/',auth[_0x25c2('0xa')](),controller['index']);router[_0x25c2('0x9')](_0x25c2('0xb'),auth[_0x25c2('0xa')](),controller[_0x25c2('0xc')]);router[_0x25c2('0xd')]('/',auth[_0x25c2('0xa')](),controller[_0x25c2('0xe')]);router['put'](_0x25c2('0xb'),auth['isAuthenticated'](),controller[_0x25c2('0xf')]);router[_0x25c2('0x10')](_0x25c2('0xb'),auth[_0x25c2('0xa')](),controller[_0x25c2('0x11')]);module[_0x25c2('0x12')]=router;
\ No newline at end of file
index 287448b..93e682e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee74=['exports','string','variable','keyValue','picklist','ENUM','STRING','BOOLEAN','sequelize'];(function(_0x227215,_0x7caa6c){var _0x174cf6=function(_0x3d58a5){while(--_0x3d58a5){_0x227215['push'](_0x227215['shift']());}};_0x174cf6(++_0x7caa6c);}(_0xee74,0x6b));var _0x4ee7=function(_0x2b2bb0,_0x2071d4){_0x2b2bb0=_0x2b2bb0-0x0;var _0x993c5c=_0xee74[_0x2b2bb0];return _0x993c5c;};'use strict';var Sequelize=require(_0x4ee7('0x0'));module[_0x4ee7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4ee7('0x2'),_0x4ee7('0x3'),'customVariable',_0x4ee7('0x4'),_0x4ee7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4ee7('0x6')](_0x4ee7('0x2'),_0x4ee7('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4ee7('0x7')]},'nameField':{'type':Sequelize[_0x4ee7('0x7')]},'customField':{'type':Sequelize[_0x4ee7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ee7('0x7')]}};
\ No newline at end of file
+var _0x7d45=['keyValue','picklist','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x2dde1c,_0x2a6205){var _0x4d4cae=function(_0xb41244){while(--_0xb41244){_0x2dde1c['push'](_0x2dde1c['shift']());}};_0x4d4cae(++_0x2a6205);}(_0x7d45,0x83));var _0x57d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d45[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x57d4('0x0'));module['exports']={'type':{'type':Sequelize[_0x57d4('0x1')](_0x57d4('0x2'),_0x57d4('0x3'),_0x57d4('0x4'),_0x57d4('0x5'),_0x57d4('0x6')),'defaultValue':_0x57d4('0x2')},'content':{'type':Sequelize[_0x57d4('0x7')]},'key':{'type':Sequelize[_0x57d4('0x7')]},'keyType':{'type':Sequelize[_0x57d4('0x1')](_0x57d4('0x2'),_0x57d4('0x3'),_0x57d4('0x4'))},'keyContent':{'type':Sequelize[_0x57d4('0x7')]},'idField':{'type':Sequelize[_0x57d4('0x7')]},'nameField':{'type':Sequelize[_0x57d4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57d4('0x7')]}};
\ No newline at end of file
index cece3f2..60317d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e28=['query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key'];(function(_0x56a6d7,_0x4b703e){var _0x25157b=function(_0x120f3b){while(--_0x120f3b){_0x56a6d7['push'](_0x56a6d7['shift']());}};_0x25157b(++_0x4b703e);}(_0x4e28,0xfd));var _0x84e2=function(_0x59db5f,_0x3719ab){_0x59db5f=_0x59db5f-0x0;var _0x4ae0e4=_0x4e28[_0x59db5f];return _0x4ae0e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x84e2('0x0'));var zipdir=require(_0x84e2('0x1'));var jsonpatch=require(_0x84e2('0x2'));var rp=require(_0x84e2('0x3'));var moment=require(_0x84e2('0x4'));var BPromise=require(_0x84e2('0x5'));var Mustache=require(_0x84e2('0x6'));var util=require(_0x84e2('0x7'));var path=require(_0x84e2('0x8'));var sox=require(_0x84e2('0x9'));var csv=require(_0x84e2('0xa'));var ejs=require(_0x84e2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84e2('0xc'));var squel=require(_0x84e2('0xd'));var crypto=require(_0x84e2('0xe'));var jsforce=require(_0x84e2('0xf'));var deskjs=require(_0x84e2('0x10'));var toCsv=require(_0x84e2('0xa'));var querystring=require(_0x84e2('0x11'));var Papa=require('papaparse');var Redis=require(_0x84e2('0x12'));var authService=require(_0x84e2('0x13'));var qs=require(_0x84e2('0x14'));var as=require(_0x84e2('0x15'));var hardwareService=require(_0x84e2('0x16'));var logger=require(_0x84e2('0x17'))(_0x84e2('0x18'));var utils=require(_0x84e2('0x19'));var config=require(_0x84e2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4243b0,_0x1a819f){_0x1a819f=_0x1a819f||0xcc;return function(_0x2ac4c1){if(_0x2ac4c1){return _0x4243b0[_0x84e2('0x1b')](_0x1a819f);}return _0x4243b0['status'](_0x1a819f)[_0x84e2('0x1c')]();};}function respondWithResult(_0x1e90a8,_0x26c18c){_0x26c18c=_0x26c18c||0xc8;return function(_0x2233c4){if(_0x2233c4){return _0x1e90a8[_0x84e2('0x1d')](_0x26c18c)['json'](_0x2233c4);}};}function respondWithFilteredResult(_0x562a29,_0x694af6){return function(_0x2914bc){if(_0x2914bc){var _0x46082f=typeof _0x694af6[_0x84e2('0x1e')]==='undefined'&&typeof _0x694af6[_0x84e2('0x1f')]==='undefined';var _0x4729fa=_0x2914bc['count'];var _0x57949c=_0x46082f?0x0:_0x694af6['offset'];var _0xd9c36b=_0x46082f?_0x2914bc[_0x84e2('0x20')]:_0x694af6['offset']+_0x694af6[_0x84e2('0x1f')];var _0x58269b;if(_0xd9c36b>=_0x4729fa){_0xd9c36b=_0x4729fa;_0x58269b=0xc8;}else{_0x58269b=0xce;}_0x562a29[_0x84e2('0x1d')](_0x58269b);return _0x562a29[_0x84e2('0x21')](_0x84e2('0x22'),_0x57949c+'-'+_0xd9c36b+'/'+_0x4729fa)['json'](_0x2914bc);}return null;};}function patchUpdates(_0x17db19){return function(_0x4c604e){try{jsonpatch[_0x84e2('0x23')](_0x4c604e,_0x17db19,!![]);}catch(_0x6682cd){return BPromise[_0x84e2('0x24')](_0x6682cd);}return _0x4c604e[_0x84e2('0x25')]();};}function saveUpdates(_0x12de1d,_0x5cf870){return function(_0x4bd407){if(_0x4bd407){return _0x4bd407[_0x84e2('0x26')](_0x12de1d)[_0x84e2('0x27')](function(_0x4241cb){return _0x4241cb;});}return null;};}function removeEntity(_0x3309cf,_0x15cbe6){return function(_0x1b8705){if(_0x1b8705){return _0x1b8705[_0x84e2('0x28')]()[_0x84e2('0x27')](function(){_0x3309cf[_0x84e2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1969f3,_0x2f0e77){return function(_0x2ce900){if(!_0x2ce900){_0x1969f3['sendStatus'](0x194);}return _0x2ce900;};}function handleError(_0x492e17,_0xa9c7b6){_0xa9c7b6=_0xa9c7b6||0x1f4;return function(_0x4dcf9a){logger[_0x84e2('0x29')](_0x4dcf9a[_0x84e2('0x2a')]);if(_0x4dcf9a[_0x84e2('0x2b')]){delete _0x4dcf9a['name'];}_0x492e17[_0x84e2('0x1d')](_0xa9c7b6)[_0x84e2('0x2c')](_0x4dcf9a);};}exports[_0x84e2('0x2d')]=function(_0x4bbc3c,_0x284392){var _0x1e55d6={},_0xe9fc03={},_0x3ff050={'count':0x0,'rows':[]};var _0x4f4155=_[_0x84e2('0x2e')](db[_0x84e2('0x2f')][_0x84e2('0x30')],function(_0xdd8036){return{'name':_0xdd8036[_0x84e2('0x31')],'type':_0xdd8036['type'][_0x84e2('0x32')]};});_0xe9fc03['model']=_['map'](_0x4f4155,_0x84e2('0x2b'));_0xe9fc03[_0x84e2('0x33')]=_['keys'](_0x4bbc3c['query']);_0xe9fc03[_0x84e2('0x34')]=_[_0x84e2('0x35')](_0xe9fc03[_0x84e2('0x36')],_0xe9fc03[_0x84e2('0x33')]);_0x1e55d6['attributes']=_['intersection'](_0xe9fc03[_0x84e2('0x36')],qs[_0x84e2('0x37')](_0x4bbc3c[_0x84e2('0x33')][_0x84e2('0x37')]));_0x1e55d6[_0x84e2('0x38')]=_0x1e55d6[_0x84e2('0x38')][_0x84e2('0x39')]?_0x1e55d6[_0x84e2('0x38')]:_0xe9fc03[_0x84e2('0x36')];if(!_0x4bbc3c[_0x84e2('0x33')]['hasOwnProperty'](_0x84e2('0x3a'))){_0x1e55d6[_0x84e2('0x1f')]=qs[_0x84e2('0x1f')](_0x4bbc3c[_0x84e2('0x33')][_0x84e2('0x1f')]);_0x1e55d6[_0x84e2('0x1e')]=qs[_0x84e2('0x1e')](_0x4bbc3c[_0x84e2('0x33')][_0x84e2('0x1e')]);}_0x1e55d6['order']=qs[_0x84e2('0x3b')](_0x4bbc3c[_0x84e2('0x33')][_0x84e2('0x3b')]);_0x1e55d6[_0x84e2('0x3c')]=qs[_0x84e2('0x34')](_[_0x84e2('0x3d')](_0x4bbc3c[_0x84e2('0x33')],_0xe9fc03['filters']),_0x4f4155);if(_0x4bbc3c['query'][_0x84e2('0x3e')]){_0x1e55d6[_0x84e2('0x3c')]=_[_0x84e2('0x3f')](_0x1e55d6[_0x84e2('0x3c')],{'$or':_[_0x84e2('0x2e')](_0x4f4155,function(_0x313642){if(_0x313642[_0x84e2('0x40')]!==_0x84e2('0x41')){var _0x13ecec={};_0x13ecec[_0x313642[_0x84e2('0x2b')]]={'$like':'%'+_0x4bbc3c['query']['filter']+'%'};return _0x13ecec;}})});}_0x1e55d6=_['merge']({},_0x1e55d6,_0x4bbc3c[_0x84e2('0x42')]);var _0x4a4162={'where':_0x1e55d6[_0x84e2('0x3c')]};return db['Dynamics365Field']['count'](_0x4a4162)['then'](function(_0x2cf45f){_0x3ff050[_0x84e2('0x20')]=_0x2cf45f;if(_0x4bbc3c['query'][_0x84e2('0x43')]){_0x1e55d6['include']=[{'all':!![]}];}return db[_0x84e2('0x2f')]['findAll'](_0x1e55d6);})[_0x84e2('0x27')](function(_0x3bfa4a){_0x3ff050[_0x84e2('0x44')]=_0x3bfa4a;return _0x3ff050;})[_0x84e2('0x27')](respondWithFilteredResult(_0x284392,_0x1e55d6))[_0x84e2('0x45')](handleError(_0x284392,null));};exports['show']=function(_0x5eec2b,_0x43a82c){var _0x19541b={'raw':!![],'where':{'id':_0x5eec2b[_0x84e2('0x46')]['id']}},_0x4ca079={};_0x4ca079[_0x84e2('0x36')]=_[_0x84e2('0x47')](db[_0x84e2('0x2f')]['rawAttributes']);_0x4ca079['query']=_[_0x84e2('0x47')](_0x5eec2b['query']);_0x4ca079[_0x84e2('0x34')]=_[_0x84e2('0x35')](_0x4ca079[_0x84e2('0x36')],_0x4ca079[_0x84e2('0x33')]);_0x19541b[_0x84e2('0x38')]=_[_0x84e2('0x35')](_0x4ca079[_0x84e2('0x36')],qs[_0x84e2('0x37')](_0x5eec2b[_0x84e2('0x33')][_0x84e2('0x37')]));_0x19541b[_0x84e2('0x38')]=_0x19541b['attributes'][_0x84e2('0x39')]?_0x19541b['attributes']:_0x4ca079[_0x84e2('0x36')];if(_0x5eec2b['query'][_0x84e2('0x43')]){_0x19541b[_0x84e2('0x48')]=[{'all':!![]}];}_0x19541b=_['merge']({},_0x19541b,_0x5eec2b[_0x84e2('0x42')]);return db[_0x84e2('0x2f')][_0x84e2('0x49')](_0x19541b)[_0x84e2('0x27')](handleEntityNotFound(_0x43a82c,null))[_0x84e2('0x27')](respondWithResult(_0x43a82c,null))['catch'](handleError(_0x43a82c,null));};exports[_0x84e2('0x4a')]=function(_0x359851,_0x474527){return db[_0x84e2('0x2f')][_0x84e2('0x4a')](_0x359851['body'],{})['then'](respondWithResult(_0x474527,0xc9))[_0x84e2('0x45')](handleError(_0x474527,null));};exports[_0x84e2('0x26')]=function(_0x3dd910,_0x17bea1){if(_0x3dd910[_0x84e2('0x4b')]['id']){delete _0x3dd910['body']['id'];}return db[_0x84e2('0x2f')][_0x84e2('0x49')]({'where':{'id':_0x3dd910['params']['id']}})[_0x84e2('0x27')](handleEntityNotFound(_0x17bea1,null))[_0x84e2('0x27')](saveUpdates(_0x3dd910[_0x84e2('0x4b')],null))[_0x84e2('0x27')](respondWithResult(_0x17bea1,null))[_0x84e2('0x45')](handleError(_0x17bea1,null));};exports[_0x84e2('0x28')]=function(_0x4eb889,_0x4c5e47){return db[_0x84e2('0x2f')]['find']({'where':{'id':_0x4eb889[_0x84e2('0x46')]['id']}})[_0x84e2('0x27')](handleEntityNotFound(_0x4c5e47,null))[_0x84e2('0x27')](removeEntity(_0x4c5e47,null))[_0x84e2('0x45')](handleError(_0x4c5e47,null));};
\ No newline at end of file
+var _0x1433=['find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','update','destroy','then','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','Dynamics365Field','includeAll','include','findAll','catch','show','params','options'];(function(_0x44af6d,_0x1ed752){var _0x171af4=function(_0x4da0a2){while(--_0x4da0a2){_0x44af6d['push'](_0x44af6d['shift']());}};_0x171af4(++_0x1ed752);}(_0x1433,0x8d));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('fast-json-patch');var rp=require(_0x3143('0x2'));var moment=require(_0x3143('0x3'));var BPromise=require(_0x3143('0x4'));var Mustache=require(_0x3143('0x5'));var util=require('util');var path=require(_0x3143('0x6'));var sox=require(_0x3143('0x7'));var csv=require(_0x3143('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3143('0x9'));var _=require(_0x3143('0xa'));var squel=require(_0x3143('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3143('0xc'));var toCsv=require(_0x3143('0x8'));var querystring=require('querystring');var Papa=require(_0x3143('0xd'));var Redis=require(_0x3143('0xe'));var authService=require(_0x3143('0xf'));var qs=require(_0x3143('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3143('0x11'));var logger=require(_0x3143('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3143('0x13'));var licenseUtil=require(_0x3143('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4167ee,_0x45890f){_0x45890f=_0x45890f||0xcc;return function(_0x310c06){if(_0x310c06){return _0x4167ee[_0x3143('0x15')](_0x45890f);}return _0x4167ee[_0x3143('0x16')](_0x45890f)[_0x3143('0x17')]();};}function respondWithResult(_0x42ca0f,_0x147f13){_0x147f13=_0x147f13||0xc8;return function(_0x3256a9){if(_0x3256a9){return _0x42ca0f[_0x3143('0x16')](_0x147f13)[_0x3143('0x18')](_0x3256a9);}};}function respondWithFilteredResult(_0x49c242,_0x4bcc14){return function(_0x5dbebd){if(_0x5dbebd){var _0xa16592=typeof _0x4bcc14['offset']===_0x3143('0x19')&&typeof _0x4bcc14['limit']===_0x3143('0x19');var _0x541812=_0x5dbebd['count'];var _0x207de8=_0xa16592?0x0:_0x4bcc14['offset'];var _0x4b8e48=_0xa16592?_0x5dbebd[_0x3143('0x1a')]:_0x4bcc14[_0x3143('0x1b')]+_0x4bcc14[_0x3143('0x1c')];var _0x583f9d;if(_0x4b8e48>=_0x541812){_0x4b8e48=_0x541812;_0x583f9d=0xc8;}else{_0x583f9d=0xce;}_0x49c242[_0x3143('0x16')](_0x583f9d);return _0x49c242[_0x3143('0x1d')]('Content-Range',_0x207de8+'-'+_0x4b8e48+'/'+_0x541812)['json'](_0x5dbebd);}return null;};}function patchUpdates(_0x528b6c){return function(_0x2f5759){try{jsonpatch[_0x3143('0x1e')](_0x2f5759,_0x528b6c,!![]);}catch(_0x2daa43){return BPromise['reject'](_0x2daa43);}return _0x2f5759[_0x3143('0x1f')]();};}function saveUpdates(_0x5cc831,_0x5319cf){return function(_0x1ddd7b){if(_0x1ddd7b){return _0x1ddd7b[_0x3143('0x20')](_0x5cc831)['then'](function(_0x53d833){return _0x53d833;});}return null;};}function removeEntity(_0x1bb9fb,_0x2567af){return function(_0x1e754a){if(_0x1e754a){return _0x1e754a[_0x3143('0x21')]()[_0x3143('0x22')](function(){_0x1bb9fb[_0x3143('0x16')](0xcc)[_0x3143('0x17')]();});}};}function handleEntityNotFound(_0x10e2ea,_0x19a8ca){return function(_0x865fe8){if(!_0x865fe8){_0x10e2ea[_0x3143('0x15')](0x194);}return _0x865fe8;};}function handleError(_0x162453,_0x37d40a){_0x37d40a=_0x37d40a||0x1f4;return function(_0x5ab767){logger['error'](_0x5ab767['stack']);if(_0x5ab767['name']){delete _0x5ab767[_0x3143('0x23')];}_0x162453[_0x3143('0x16')](_0x37d40a)[_0x3143('0x24')](_0x5ab767);};}exports[_0x3143('0x25')]=function(_0x3e0516,_0x72913a){var _0x2adc5d={},_0x1248bd={},_0x51a107={'count':0x0,'rows':[]};var _0x57e1c7=_['map'](db['Dynamics365Field'][_0x3143('0x26')],function(_0x3680ee){return{'name':_0x3680ee['fieldName'],'type':_0x3680ee[_0x3143('0x27')][_0x3143('0x28')]};});_0x1248bd[_0x3143('0x29')]=_[_0x3143('0x2a')](_0x57e1c7,_0x3143('0x23'));_0x1248bd[_0x3143('0x2b')]=_[_0x3143('0x2c')](_0x3e0516[_0x3143('0x2b')]);_0x1248bd[_0x3143('0x2d')]=_[_0x3143('0x2e')](_0x1248bd[_0x3143('0x29')],_0x1248bd[_0x3143('0x2b')]);_0x2adc5d['attributes']=_[_0x3143('0x2e')](_0x1248bd[_0x3143('0x29')],qs[_0x3143('0x2f')](_0x3e0516[_0x3143('0x2b')]['fields']));_0x2adc5d[_0x3143('0x30')]=_0x2adc5d[_0x3143('0x30')][_0x3143('0x31')]?_0x2adc5d[_0x3143('0x30')]:_0x1248bd[_0x3143('0x29')];if(!_0x3e0516[_0x3143('0x2b')][_0x3143('0x32')](_0x3143('0x33'))){_0x2adc5d['limit']=qs[_0x3143('0x1c')](_0x3e0516['query']['limit']);_0x2adc5d['offset']=qs[_0x3143('0x1b')](_0x3e0516[_0x3143('0x2b')][_0x3143('0x1b')]);}_0x2adc5d['order']=qs['sort'](_0x3e0516[_0x3143('0x2b')][_0x3143('0x34')]);_0x2adc5d['where']=qs[_0x3143('0x2d')](_[_0x3143('0x35')](_0x3e0516[_0x3143('0x2b')],_0x1248bd[_0x3143('0x2d')]),_0x57e1c7);if(_0x3e0516[_0x3143('0x2b')][_0x3143('0x36')]){_0x2adc5d[_0x3143('0x37')]=_[_0x3143('0x38')](_0x2adc5d[_0x3143('0x37')],{'$or':_[_0x3143('0x2a')](_0x57e1c7,function(_0x38be59){if(_0x38be59[_0x3143('0x27')]!==_0x3143('0x39')){var _0x502720={};_0x502720[_0x38be59[_0x3143('0x23')]]={'$like':'%'+_0x3e0516[_0x3143('0x2b')][_0x3143('0x36')]+'%'};return _0x502720;}})});}_0x2adc5d=_[_0x3143('0x38')]({},_0x2adc5d,_0x3e0516['options']);var _0x23e141={'where':_0x2adc5d[_0x3143('0x37')]};return db[_0x3143('0x3a')]['count'](_0x23e141)[_0x3143('0x22')](function(_0x1d3f31){_0x51a107[_0x3143('0x1a')]=_0x1d3f31;if(_0x3e0516['query'][_0x3143('0x3b')]){_0x2adc5d[_0x3143('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x3143('0x3d')](_0x2adc5d);})['then'](function(_0x3d3933){_0x51a107['rows']=_0x3d3933;return _0x51a107;})[_0x3143('0x22')](respondWithFilteredResult(_0x72913a,_0x2adc5d))[_0x3143('0x3e')](handleError(_0x72913a,null));};exports[_0x3143('0x3f')]=function(_0x3b8ac2,_0x3bb4a5){var _0x1392ba={'raw':!![],'where':{'id':_0x3b8ac2[_0x3143('0x40')]['id']}},_0x47aee8={};_0x47aee8[_0x3143('0x29')]=_['keys'](db[_0x3143('0x3a')]['rawAttributes']);_0x47aee8[_0x3143('0x2b')]=_[_0x3143('0x2c')](_0x3b8ac2[_0x3143('0x2b')]);_0x47aee8[_0x3143('0x2d')]=_[_0x3143('0x2e')](_0x47aee8[_0x3143('0x29')],_0x47aee8['query']);_0x1392ba['attributes']=_[_0x3143('0x2e')](_0x47aee8[_0x3143('0x29')],qs[_0x3143('0x2f')](_0x3b8ac2[_0x3143('0x2b')]['fields']));_0x1392ba[_0x3143('0x30')]=_0x1392ba[_0x3143('0x30')][_0x3143('0x31')]?_0x1392ba[_0x3143('0x30')]:_0x47aee8['model'];if(_0x3b8ac2[_0x3143('0x2b')][_0x3143('0x3b')]){_0x1392ba[_0x3143('0x3c')]=[{'all':!![]}];}_0x1392ba=_[_0x3143('0x38')]({},_0x1392ba,_0x3b8ac2[_0x3143('0x41')]);return db[_0x3143('0x3a')][_0x3143('0x42')](_0x1392ba)[_0x3143('0x22')](handleEntityNotFound(_0x3bb4a5,null))[_0x3143('0x22')](respondWithResult(_0x3bb4a5,null))[_0x3143('0x3e')](handleError(_0x3bb4a5,null));};exports[_0x3143('0x43')]=function(_0x55b3d7,_0x2d807a){return db['Dynamics365Field'][_0x3143('0x43')](_0x55b3d7[_0x3143('0x44')],{})[_0x3143('0x22')](respondWithResult(_0x2d807a,0xc9))['catch'](handleError(_0x2d807a,null));};exports['update']=function(_0x3c8ef7,_0x5b26b7){if(_0x3c8ef7[_0x3143('0x44')]['id']){delete _0x3c8ef7[_0x3143('0x44')]['id'];}return db['Dynamics365Field'][_0x3143('0x42')]({'where':{'id':_0x3c8ef7[_0x3143('0x40')]['id']}})['then'](handleEntityNotFound(_0x5b26b7,null))[_0x3143('0x22')](saveUpdates(_0x3c8ef7[_0x3143('0x44')],null))[_0x3143('0x22')](respondWithResult(_0x5b26b7,null))['catch'](handleError(_0x5b26b7,null));};exports[_0x3143('0x21')]=function(_0x9b0d98,_0x89d02d){return db[_0x3143('0x3a')]['find']({'where':{'id':_0x9b0d98[_0x3143('0x40')]['id']}})['then'](handleEntityNotFound(_0x89d02d,null))[_0x3143('0x22')](removeEntity(_0x89d02d,null))[_0x3143('0x3e')](handleError(_0x89d02d,null));};
\ No newline at end of file
index 17de703..628c245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06e8=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','util','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports'];(function(_0x36a57d,_0x18238a){var _0x44a822=function(_0x311afe){while(--_0x311afe){_0x36a57d['push'](_0x36a57d['shift']());}};_0x44a822(++_0x18238a);}(_0x06e8,0x1e5));var _0x806e=function(_0x18b17b,_0x3a2a85){_0x18b17b=_0x18b17b-0x0;var _0x316060=_0x06e8[_0x18b17b];return _0x316060;};'use strict';var _=require('lodash');var util=require(_0x806e('0x0'));var logger=require('../../config/logger')(_0x806e('0x1'));var moment=require(_0x806e('0x2'));var BPromise=require(_0x806e('0x3'));var rp=require(_0x806e('0x4'));var fs=require('fs');var path=require(_0x806e('0x5'));var rimraf=require(_0x806e('0x6'));var config=require('../../config/environment');var attributes=require(_0x806e('0x7'));module[_0x806e('0x8')]=function(_0x2ed3a7,_0x4c5f98){return _0x2ed3a7['define'](_0x806e('0x9'),attributes,{'tableName':_0x806e('0xa'),'paranoid':![],'indexes':[{'name':_0x806e('0xb'),'fields':[_0x806e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e2b=['bluebird','path','rimraf','../../config/environment','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3e2b,0x183));var _0xb3e2=function(_0x507ff2,_0x42e446){_0x507ff2=_0x507ff2-0x0;var _0x4910cf=_0x3e2b[_0x507ff2];return _0x4910cf;};'use strict';var _=require(_0xb3e2('0x0'));var util=require(_0xb3e2('0x1'));var logger=require(_0xb3e2('0x2'))(_0xb3e2('0x3'));var moment=require(_0xb3e2('0x4'));var BPromise=require(_0xb3e2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3e2('0x6'));var rimraf=require(_0xb3e2('0x7'));var config=require(_0xb3e2('0x8'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x56d975,_0x1beaf3){return _0x56d975[_0xb3e2('0x9')](_0xb3e2('0xa'),attributes,{'tableName':_0xb3e2('0xb'),'paranoid':![],'indexes':[{'name':_0xb3e2('0xc'),'fields':[_0xb3e2('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 633aa4d..56d3cd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x238d=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4dadd0,_0xd02549){var _0x3daaac=function(_0x58347d){while(--_0x58347d){_0x4dadd0['push'](_0x4dadd0['shift']());}};_0x3daaac(++_0xd02549);}(_0x238d,0x6d));var _0xd238=function(_0x4ec80f,_0x1f476c){_0x4ec80f=_0x4ec80f-0x0;var _0xeda773=_0x238d[_0x4ec80f];return _0xeda773;};'use strict';var _=require(_0xd238('0x0'));var util=require(_0xd238('0x1'));var moment=require(_0xd238('0x2'));var BPromise=require(_0xd238('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd238('0x4'));var db=require(_0xd238('0x5'))['db'];var utils=require(_0xd238('0x6'));var logger=require('../../config/logger')(_0xd238('0x7'));var config=require(_0xd238('0x8'));var jayson=require(_0xd238('0x9'));var client=jayson[_0xd238('0xa')][_0xd238('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33960b,_0x52ba75,_0x5adfe3){return new BPromise(function(_0x2cc486,_0x55d9cd){return client[_0xd238('0xc')](_0x33960b,_0x5adfe3)['then'](function(_0x5ee954){logger[_0xd238('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x52ba75,'request\x20sent');logger['debug'](_0xd238('0xe'),_0x52ba75,_0xd238('0xf'),JSON['stringify'](_0x5ee954));if(_0x5ee954[_0xd238('0x10')]){if(_0x5ee954[_0xd238('0x10')][_0xd238('0x11')]===0x1f4){logger[_0xd238('0x10')](_0xd238('0x12'),_0x52ba75,_0x5ee954[_0xd238('0x10')][_0xd238('0x13')]);return _0x55d9cd(_0x5ee954[_0xd238('0x10')][_0xd238('0x13')]);}logger[_0xd238('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x52ba75,_0x5ee954[_0xd238('0x10')]['message']);return _0x2cc486(_0x5ee954[_0xd238('0x10')][_0xd238('0x13')]);}else{logger['info'](_0xd238('0x12'),_0x52ba75,_0xd238('0xf'));_0x2cc486(_0x5ee954[_0xd238('0x14')][_0xd238('0x13')]);}})[_0xd238('0x15')](function(_0xa527e4){logger[_0xd238('0x10')](_0xd238('0x12'),_0x52ba75,_0xa527e4);_0x55d9cd(_0xa527e4);});});}
\ No newline at end of file
+var _0x74ef=['info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x1db94d,_0x378373){var _0x311b52=function(_0x1a1fae){while(--_0x1a1fae){_0x1db94d['push'](_0x1db94d['shift']());}};_0x311b52(++_0x378373);}(_0x74ef,0x11b));var _0xf74e=function(_0x56442c,_0x46f7cd){_0x56442c=_0x56442c-0x0;var _0x5ed5dc=_0x74ef[_0x56442c];return _0x5ed5dc;};'use strict';var _=require('lodash');var util=require(_0xf74e('0x0'));var moment=require(_0xf74e('0x1'));var BPromise=require(_0xf74e('0x2'));var rs=require(_0xf74e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf74e('0x4'))['db'];var utils=require(_0xf74e('0x5'));var logger=require('../../config/logger')(_0xf74e('0x6'));var config=require('../../config/environment');var jayson=require(_0xf74e('0x7'));var client=jayson['client'][_0xf74e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c7232,_0x39d65f,_0x28ad22){return new BPromise(function(_0x282d42,_0x4cc9a9){return client[_0xf74e('0x9')](_0x3c7232,_0x28ad22)[_0xf74e('0xa')](function(_0xb081ef){logger[_0xf74e('0xb')](_0xf74e('0xc'),_0x39d65f,_0xf74e('0xd'));logger[_0xf74e('0xe')](_0xf74e('0xf'),_0x39d65f,'request\x20sent',JSON['stringify'](_0xb081ef));if(_0xb081ef[_0xf74e('0x10')]){if(_0xb081ef['error'][_0xf74e('0x11')]===0x1f4){logger['error'](_0xf74e('0xc'),_0x39d65f,_0xb081ef[_0xf74e('0x10')][_0xf74e('0x12')]);return _0x4cc9a9(_0xb081ef[_0xf74e('0x10')][_0xf74e('0x12')]);}logger[_0xf74e('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x39d65f,_0xb081ef[_0xf74e('0x10')][_0xf74e('0x12')]);return _0x282d42(_0xb081ef[_0xf74e('0x10')]['message']);}else{logger[_0xf74e('0xb')](_0xf74e('0xc'),_0x39d65f,'request\x20sent');_0x282d42(_0xb081ef[_0xf74e('0x13')][_0xf74e('0x12')]);}})[_0xf74e('0x14')](function(_0x9e4b37){logger['error'](_0xf74e('0xc'),_0x39d65f,_0x9e4b37);_0x4cc9a9(_0x9e4b37);});});}
\ No newline at end of file
index 3e2dcf4..b84b347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96a5=['create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x96a5,0xec));var _0x596a=function(_0x25810f,_0x3fdabe){_0x25810f=_0x25810f-0x0;var _0x333cba=_0x96a5[_0x25810f];return _0x333cba;};'use strict';var multer=require('multer');var util=require(_0x596a('0x0'));var path=require(_0x596a('0x1'));var timeout=require(_0x596a('0x2'));var express=require(_0x596a('0x3'));var router=express[_0x596a('0x4')]();var fs_extra=require(_0x596a('0x5'));var auth=require(_0x596a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x596a('0x7'));var controller=require(_0x596a('0x8'));router[_0x596a('0x9')]('/',auth[_0x596a('0xa')](),controller[_0x596a('0xb')]);router['get'](_0x596a('0xc'),auth[_0x596a('0xa')](),controller[_0x596a('0xd')]);router[_0x596a('0x9')](_0x596a('0xe'),auth['isAuthenticated'](),controller[_0x596a('0xf')]);router[_0x596a('0x9')](_0x596a('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x596a('0xa')](),controller[_0x596a('0x11')]);router['post'](_0x596a('0xe'),auth[_0x596a('0xa')](),controller[_0x596a('0x12')]);router[_0x596a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x596a('0x14')]);router['delete'](_0x596a('0xc'),auth[_0x596a('0xa')](),controller[_0x596a('0x15')]);module[_0x596a('0x16')]=router;
\ No newline at end of file
+var _0x96b1=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','getConfigurations','post','/:id/configurations','addConfiguration','put','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x96b1,0x153));var _0x196b=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x96b1[_0x2b49bc];return _0x43cc65;};'use strict';var multer=require(_0x196b('0x0'));var util=require('util');var path=require(_0x196b('0x1'));var timeout=require(_0x196b('0x2'));var express=require(_0x196b('0x3'));var router=express[_0x196b('0x4')]();var fs_extra=require(_0x196b('0x5'));var auth=require(_0x196b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x196b('0x7')]('/',auth[_0x196b('0x8')](),controller[_0x196b('0x9')]);router[_0x196b('0x7')](_0x196b('0xa'),auth[_0x196b('0x8')](),controller[_0x196b('0xb')]);router[_0x196b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x196b('0xc')]);router[_0x196b('0x7')]('/:id/fields',auth[_0x196b('0x8')](),controller['getFields']);router[_0x196b('0xd')]('/',auth[_0x196b('0x8')](),controller['create']);router[_0x196b('0xd')](_0x196b('0xe'),auth['isAuthenticated'](),controller[_0x196b('0xf')]);router[_0x196b('0x10')](_0x196b('0xa'),auth['isAuthenticated'](),controller[_0x196b('0x11')]);router[_0x196b('0x12')](_0x196b('0xa'),auth[_0x196b('0x8')](),controller[_0x196b('0x13')]);module[_0x196b('0x14')]=router;
\ No newline at end of file
index 4c6d5f2..36611de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['sequelize','STRING','remoteUri'];(function(_0x234a75,_0x1e2cc8){var _0x50031d=function(_0x3b878f){while(--_0x3b878f){_0x234a75['push'](_0x234a75['shift']());}};_0x50031d(++_0x1e2cc8);}(_0x4bd3,0x174));var _0x34bd=function(_0x25525a,_0x54b483){_0x25525a=_0x25525a-0x0;var _0x3f4a86=_0x4bd3[_0x25525a];return _0x3f4a86;};'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
+var _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x539357,_0x5eb77e){var _0x1d3f07=function(_0x53fb74){while(--_0x53fb74){_0x539357['push'](_0x539357['shift']());}};_0x1d3f07(++_0x5eb77e);}(_0xef0f,0x168));var _0xfef0=function(_0xb85f39,_0x58d5d8){_0xb85f39=_0xb85f39-0x0;var _0x67805e=_0xef0f[_0xb85f39];return _0x67805e;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index f7cd26f..ca49fcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7948=['group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','FreshdeskAccount','findAll','rows','catch','include','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x7948,0x185));var _0x8794=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x7948[_0xab9f3d];return _0x5283bf;};'use strict';var emlformat=require(_0x8794('0x0'));var rimraf=require(_0x8794('0x1'));var zipdir=require(_0x8794('0x2'));var jsonpatch=require(_0x8794('0x3'));var rp=require(_0x8794('0x4'));var moment=require(_0x8794('0x5'));var BPromise=require(_0x8794('0x6'));var Mustache=require(_0x8794('0x7'));var util=require(_0x8794('0x8'));var path=require(_0x8794('0x9'));var sox=require(_0x8794('0xa'));var csv=require(_0x8794('0xb'));var ejs=require(_0x8794('0xc'));var fs=require('fs');var fs_extra=require(_0x8794('0xd'));var _=require(_0x8794('0xe'));var squel=require(_0x8794('0xf'));var crypto=require(_0x8794('0x10'));var jsforce=require(_0x8794('0x11'));var deskjs=require(_0x8794('0x12'));var toCsv=require(_0x8794('0xb'));var querystring=require(_0x8794('0x13'));var Papa=require(_0x8794('0x14'));var Redis=require(_0x8794('0x15'));var authService=require(_0x8794('0x16'));var qs=require(_0x8794('0x17'));var as=require(_0x8794('0x18'));var hardwareService=require(_0x8794('0x19'));var logger=require(_0x8794('0x1a'))(_0x8794('0x1b'));var utils=require(_0x8794('0x1c'));var config=require(_0x8794('0x1d'));var licenseUtil=require('../../config/license/util');var db=require(_0x8794('0x1e'))['db'];var integrations=require(_0x8794('0x1f'));function respondWithStatusCode(_0x1e9dac,_0x10a723){_0x10a723=_0x10a723||0xcc;return function(_0x1ce53e){if(_0x1ce53e){return _0x1e9dac[_0x8794('0x20')](_0x10a723);}return _0x1e9dac[_0x8794('0x21')](_0x10a723)[_0x8794('0x22')]();};}function respondWithResult(_0xb22e03,_0x2967e3){_0x2967e3=_0x2967e3||0xc8;return function(_0x2aea71){if(_0x2aea71){return _0xb22e03[_0x8794('0x21')](_0x2967e3)[_0x8794('0x23')](_0x2aea71);}};}function respondWithFilteredResult(_0x537e3d,_0x7500eb){return function(_0x4f8b21){if(_0x4f8b21){var _0x5623d7=typeof _0x7500eb[_0x8794('0x24')]===_0x8794('0x25')&&typeof _0x7500eb[_0x8794('0x26')]==='undefined';var _0x24ae6a=_0x4f8b21[_0x8794('0x27')];var _0x46be4d=_0x5623d7?0x0:_0x7500eb['offset'];var _0x23a396=_0x5623d7?_0x4f8b21[_0x8794('0x27')]:_0x7500eb[_0x8794('0x24')]+_0x7500eb['limit'];var _0x186ed4;if(_0x23a396>=_0x24ae6a){_0x23a396=_0x24ae6a;_0x186ed4=0xc8;}else{_0x186ed4=0xce;}_0x537e3d[_0x8794('0x21')](_0x186ed4);return _0x537e3d[_0x8794('0x28')]('Content-Range',_0x46be4d+'-'+_0x23a396+'/'+_0x24ae6a)[_0x8794('0x23')](_0x4f8b21);}return null;};}function patchUpdates(_0x4bd1ef){return function(_0x10829a){try{jsonpatch[_0x8794('0x29')](_0x10829a,_0x4bd1ef,!![]);}catch(_0x2b8cae){return BPromise[_0x8794('0x2a')](_0x2b8cae);}return _0x10829a[_0x8794('0x2b')]();};}function saveUpdates(_0xa180ac,_0x1b8c19){return function(_0xd6651c){if(_0xd6651c){return _0xd6651c[_0x8794('0x2c')](_0xa180ac)[_0x8794('0x2d')](function(_0x518eb6){return _0x518eb6;});}return null;};}function removeEntity(_0x3e3db9,_0x4de3af){return function(_0x16f7a0){if(_0x16f7a0){return _0x16f7a0[_0x8794('0x2e')]()['then'](function(){_0x3e3db9[_0x8794('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c30c,_0x5e3094){return function(_0x1f56f6){if(!_0x1f56f6){_0x38c30c['sendStatus'](0x194);}return _0x1f56f6;};}function handleError(_0x17cbd2,_0x165698){_0x165698=_0x165698||0x1f4;return function(_0xc1a17c){logger['error'](_0xc1a17c['stack']);if(_0xc1a17c[_0x8794('0x2f')]){delete _0xc1a17c[_0x8794('0x2f')];}_0x17cbd2[_0x8794('0x21')](_0x165698)['send'](_0xc1a17c);};}exports[_0x8794('0x30')]=function(_0x536fed,_0x4cb01c){var _0x2c357b={},_0x25f9f6={},_0x7ca073={'count':0x0,'rows':[]};var _0x45bbde=_[_0x8794('0x31')](db['FreshdeskAccount'][_0x8794('0x32')],function(_0x375ac1){return{'name':_0x375ac1[_0x8794('0x33')],'type':_0x375ac1[_0x8794('0x34')]['key']};});_0x25f9f6[_0x8794('0x35')]=_[_0x8794('0x31')](_0x45bbde,'name');_0x25f9f6['query']=_[_0x8794('0x36')](_0x536fed[_0x8794('0x37')]);_0x25f9f6[_0x8794('0x38')]=_[_0x8794('0x39')](_0x25f9f6['model'],_0x25f9f6['query']);_0x2c357b[_0x8794('0x3a')]=_[_0x8794('0x39')](_0x25f9f6[_0x8794('0x35')],qs[_0x8794('0x3b')](_0x536fed[_0x8794('0x37')][_0x8794('0x3b')]));_0x2c357b[_0x8794('0x3a')]=_0x2c357b[_0x8794('0x3a')][_0x8794('0x3c')]?_0x2c357b[_0x8794('0x3a')]:_0x25f9f6[_0x8794('0x35')];if(!_0x536fed['query'][_0x8794('0x3d')](_0x8794('0x3e'))){_0x2c357b[_0x8794('0x26')]=qs[_0x8794('0x26')](_0x536fed['query']['limit']);_0x2c357b[_0x8794('0x24')]=qs[_0x8794('0x24')](_0x536fed[_0x8794('0x37')][_0x8794('0x24')]);}_0x2c357b[_0x8794('0x3f')]=qs[_0x8794('0x40')](_0x536fed[_0x8794('0x37')][_0x8794('0x40')]);_0x2c357b['where']=qs[_0x8794('0x38')](_[_0x8794('0x41')](_0x536fed[_0x8794('0x37')],_0x25f9f6['filters']),_0x45bbde);if(_0x536fed[_0x8794('0x37')][_0x8794('0x42')]){_0x2c357b[_0x8794('0x43')]=_[_0x8794('0x44')](_0x2c357b['where'],{'$or':_[_0x8794('0x31')](_0x45bbde,function(_0x1121ca){if(_0x1121ca[_0x8794('0x34')]!==_0x8794('0x45')){var _0x20cfb9={};_0x20cfb9[_0x1121ca['name']]={'$like':'%'+_0x536fed[_0x8794('0x37')]['filter']+'%'};return _0x20cfb9;}})});}_0x2c357b=_['merge']({},_0x2c357b,_0x536fed[_0x8794('0x46')]);var _0x240bc6={'where':_0x2c357b[_0x8794('0x43')]};return db['FreshdeskAccount'][_0x8794('0x27')](_0x240bc6)[_0x8794('0x2d')](function(_0x3a3d63){_0x7ca073[_0x8794('0x27')]=_0x3a3d63;if(_0x536fed['query'][_0x8794('0x47')]){_0x2c357b['include']=[{'all':!![]}];}return db[_0x8794('0x48')][_0x8794('0x49')](_0x2c357b);})[_0x8794('0x2d')](function(_0x1f5c78){_0x7ca073[_0x8794('0x4a')]=_0x1f5c78;return _0x7ca073;})['then'](respondWithFilteredResult(_0x4cb01c,_0x2c357b))[_0x8794('0x4b')](handleError(_0x4cb01c,null));};exports['show']=function(_0x239bd3,_0x516655){var _0x2ef73d={'raw':![],'where':{'id':_0x239bd3['params']['id']}},_0x36b588={};_0x36b588[_0x8794('0x35')]=_[_0x8794('0x36')](db[_0x8794('0x48')][_0x8794('0x32')]);_0x36b588['query']=_['keys'](_0x239bd3[_0x8794('0x37')]);_0x36b588[_0x8794('0x38')]=_[_0x8794('0x39')](_0x36b588[_0x8794('0x35')],_0x36b588['query']);_0x2ef73d['attributes']=_[_0x8794('0x39')](_0x36b588[_0x8794('0x35')],qs[_0x8794('0x3b')](_0x239bd3[_0x8794('0x37')][_0x8794('0x3b')]));_0x2ef73d['attributes']=_0x2ef73d['attributes'][_0x8794('0x3c')]?_0x2ef73d['attributes']:_0x36b588[_0x8794('0x35')];if(_0x239bd3[_0x8794('0x37')]['includeAll']){_0x2ef73d[_0x8794('0x4c')]=[{'all':!![]}];}_0x2ef73d=_[_0x8794('0x44')]({},_0x2ef73d,_0x239bd3[_0x8794('0x46')]);return db[_0x8794('0x48')][_0x8794('0x4d')](_0x2ef73d)[_0x8794('0x2d')](handleEntityNotFound(_0x516655,null))['then'](respondWithResult(_0x516655,null))[_0x8794('0x4b')](handleError(_0x516655,null));};exports[_0x8794('0x4e')]=function(_0x36645b,_0x40d649){return db[_0x8794('0x48')]['create'](_0x36645b[_0x8794('0x4f')],{})[_0x8794('0x2d')](respondWithResult(_0x40d649,0xc9))[_0x8794('0x4b')](handleError(_0x40d649,null));};exports[_0x8794('0x2c')]=function(_0x14df40,_0x337aa9){if(_0x14df40[_0x8794('0x4f')]['id']){delete _0x14df40[_0x8794('0x4f')]['id'];}return db['FreshdeskAccount'][_0x8794('0x4d')]({'where':{'id':_0x14df40[_0x8794('0x50')]['id']}})[_0x8794('0x2d')](handleEntityNotFound(_0x337aa9,null))[_0x8794('0x2d')](saveUpdates(_0x14df40[_0x8794('0x4f')],null))[_0x8794('0x2d')](respondWithResult(_0x337aa9,null))[_0x8794('0x4b')](handleError(_0x337aa9,null));};exports[_0x8794('0x2e')]=function(_0x1be24d,_0x20db95){return db[_0x8794('0x48')][_0x8794('0x4d')]({'where':{'id':_0x1be24d['params']['id']}})['then'](handleEntityNotFound(_0x20db95,null))['then'](removeEntity(_0x20db95,null))[_0x8794('0x4b')](handleError(_0x20db95,null));};exports[_0x8794('0x51')]=function(_0x3bfb2d,_0x5627d0,_0x1bfb97){var _0x53ca6a={};var _0x342424={};var _0x4dbf82;var _0x449668;return db['FreshdeskAccount'][_0x8794('0x52')]({'where':{'id':_0x3bfb2d['params']['id']}})[_0x8794('0x2d')](handleEntityNotFound(_0x5627d0,null))[_0x8794('0x2d')](function(_0x1fe264){if(_0x1fe264){_0x4dbf82=_0x1fe264;_0x342424['model']=_['keys'](db[_0x8794('0x53')][_0x8794('0x32')]);_0x342424[_0x8794('0x37')]=_[_0x8794('0x36')](_0x3bfb2d[_0x8794('0x37')]);_0x342424[_0x8794('0x38')]=_['intersection'](_0x342424[_0x8794('0x35')],_0x342424[_0x8794('0x37')]);_0x53ca6a[_0x8794('0x3a')]=_[_0x8794('0x39')](_0x342424[_0x8794('0x35')],qs[_0x8794('0x3b')](_0x3bfb2d['query'][_0x8794('0x3b')]));_0x53ca6a[_0x8794('0x3a')]=_0x53ca6a[_0x8794('0x3a')][_0x8794('0x3c')]?_0x53ca6a['attributes']:_0x342424[_0x8794('0x35')];_0x53ca6a['order']=qs[_0x8794('0x40')](_0x3bfb2d[_0x8794('0x37')][_0x8794('0x40')]);_0x53ca6a[_0x8794('0x43')]=qs[_0x8794('0x38')](_[_0x8794('0x41')](_0x3bfb2d['query'],_0x342424[_0x8794('0x38')]));if(_0x3bfb2d[_0x8794('0x37')][_0x8794('0x42')]){_0x53ca6a[_0x8794('0x43')]=_['merge'](_0x53ca6a['where'],{'$or':_['map'](_0x53ca6a[_0x8794('0x3a')],function(_0x5676f0){var _0x2a29aa={};_0x2a29aa[_0x5676f0]={'$like':'%'+_0x3bfb2d[_0x8794('0x37')][_0x8794('0x42')]+'%'};return _0x2a29aa;})});}_0x53ca6a=_[_0x8794('0x44')]({},_0x53ca6a,_0x3bfb2d[_0x8794('0x46')]);return _0x4dbf82[_0x8794('0x51')](_0x53ca6a);}})[_0x8794('0x2d')](function(_0x4c9a59){if(_0x4c9a59){_0x449668=_0x4c9a59[_0x8794('0x3c')];if(!_0x3bfb2d[_0x8794('0x37')]['hasOwnProperty'](_0x8794('0x3e'))){_0x53ca6a[_0x8794('0x26')]=qs[_0x8794('0x26')](_0x3bfb2d[_0x8794('0x37')]['limit']);_0x53ca6a[_0x8794('0x24')]=qs[_0x8794('0x24')](_0x3bfb2d[_0x8794('0x37')][_0x8794('0x24')]);}return _0x4dbf82[_0x8794('0x51')](_0x53ca6a);}})[_0x8794('0x2d')](function(_0x420cf5){if(_0x420cf5){return _0x420cf5?{'count':_0x449668,'rows':_0x420cf5}:null;}})[_0x8794('0x2d')](respondWithResult(_0x5627d0,null))[_0x8794('0x4b')](handleError(_0x5627d0,null));};exports[_0x8794('0x54')]=function(_0x4554f3,_0x48eeff,_0x22f18c){if(_0x4554f3[_0x8794('0x4f')]['id']){delete _0x4554f3[_0x8794('0x4f')]['id'];}return db[_0x8794('0x48')][_0x8794('0x52')]({'where':{'id':_0x4554f3[_0x8794('0x50')]['id']}})['then'](handleEntityNotFound(_0x48eeff,null))['then'](function(_0x180b73){if(_0x180b73){_0x4554f3[_0x8794('0x4f')]['AccountId']=_0x180b73['id'];_0x4554f3[_0x8794('0x4f')][_0x8794('0x55')]=integrations[_0x8794('0x56')](_0x4554f3[_0x8794('0x4f')][_0x8794('0x57')],_0x4554f3['body'][_0x8794('0x34')]);_0x4554f3[_0x8794('0x4f')][_0x8794('0x58')]=integrations['getDescriptions'](_0x4554f3[_0x8794('0x4f')]['channel'],_0x4554f3[_0x8794('0x4f')][_0x8794('0x34')]);return db[_0x8794('0x53')][_0x8794('0x4e')](_0x4554f3[_0x8794('0x4f')],{'include':[{'model':db[_0x8794('0x59')],'as':_0x8794('0x55')},{'model':db[_0x8794('0x59')],'as':'Descriptions'}]});}return null;})[_0x8794('0x2d')](respondWithResult(_0x48eeff,null))['catch'](handleError(_0x48eeff,null));};exports[_0x8794('0x5a')]=function(_0x1ae06e,_0x528ebc,_0x1397f4){var _0x78df3b='';return db[_0x8794('0x48')][_0x8794('0x52')]({'where':{'id':_0x1ae06e[_0x8794('0x50')]['id']},'attributes':['id',_0x8794('0x5b'),_0x8794('0x5c')]})['then'](handleEntityNotFound(_0x528ebc,null))['then'](function(_0x4272d0){if(_0x4272d0){_0x78df3b=_0x4272d0['remoteUri'];var _0x5e640a=_0x78df3b[_0x8794('0x5d')](-0x1);if(_0x5e640a==='/'){_0x78df3b=_0x78df3b[_0x8794('0x5e')](0x0,_0x78df3b['lastIndexOf'](_0x5e640a));}return rp({'method':_0x8794('0x5f'),'uri':util[_0x8794('0x60')](_0x8794('0x61'),_0x78df3b,_0x8794('0x62')),'headers':{'Authorization':util['format'](_0x8794('0x63'),new Buffer(util[_0x8794('0x60')](_0x8794('0x64'),_0x4272d0[_0x8794('0x5c')]))[_0x8794('0x65')]('base64'))},'json':!![]});}})[_0x8794('0x2d')](function(_0x2186ea){if(_0x2186ea){var _0x2dd42e=[_0x8794('0x66'),_0x8794('0x67'),_0x8794('0x68'),_0x8794('0x69'),_0x8794('0x21'),_0x8794('0x6a'),_0x8794('0x6b'),_0x8794('0x6c'),_0x8794('0x6d'),_0x8794('0x6b'),_0x8794('0x6e')];_[_0x8794('0x6f')](_0x2186ea,function(_0x2b0825){return _0x2dd42e[_0x8794('0x70')](_0x2b0825[_0x8794('0x2f')])||!_0x2b0825[_0x8794('0x71')]&&_0x2b0825[_0x8794('0x34')]!==_0x8794('0x72')&&_0x2b0825[_0x8794('0x34')]!==_0x8794('0x73');});return{'count':_0x2186ea[_0x8794('0x3c')],'rows':_['map'](_0x2186ea,function(_0x4a349e){return{'id':_0x4a349e[_0x8794('0x2f')],'name':_0x4a349e[_0x8794('0x74')],'custom':!_0x4a349e[_0x8794('0x71')],'options':_0x4a349e['choices']?_['map'](_0x4a349e[_0x8794('0x75')],function(_0x273061){return{'name':_[_0x8794('0x76')](_0x273061),'value':_0x273061};}):[]};})};}})[_0x8794('0x2d')](respondWithResult(_0x528ebc,null))[_0x8794('0x4b')](function(_0x47b2e8){var _0x4abba7=_0x1ae06e[_0x8794('0x37')][_0x8794('0x77')]?0x1f4:_0x47b2e8[_0x8794('0x78')]||0x1f4;logger['error'](_0x8794('0x79'),_0x8794('0x5a'),_0x4abba7,JSON[_0x8794('0x7a')](_0x47b2e8));delete _0x47b2e8[_0x8794('0x2f')];if(_0x4abba7===0x191){_0x4abba7=0x190;}_0x528ebc[_0x8794('0x21')](_0x4abba7)['send'](_0x1ae06e[_0x8794('0x37')]['test']?{'message':_0x8794('0x7b'),'statusCode':_0x47b2e8[_0x8794('0x78')]}:_0x47b2e8);});};
\ No newline at end of file
+var _0x073e=['params','include','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','requester','subject','priority','group','source','ticket_type','company','remove','default','custom_text','label','choices','capitalize','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','name','send','map','FreshdeskAccount','rawAttributes','fieldName','type','query','keys','model','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch'];(function(_0x3b0aa4,_0x574abc){var _0x34ddb0=function(_0xeb5cfd){while(--_0xeb5cfd){_0x3b0aa4['push'](_0x3b0aa4['shift']());}};_0x34ddb0(++_0x574abc);}(_0x073e,0x181));var _0xe073=function(_0xdc2b18,_0x385615){_0xdc2b18=_0xdc2b18-0x0;var _0x2b5b88=_0x073e[_0xdc2b18];return _0x2b5b88;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3dedf7,_0x5d2f2f){_0x5d2f2f=_0x5d2f2f||0xcc;return function(_0x3549c4){if(_0x3549c4){return _0x3dedf7['sendStatus'](_0x5d2f2f);}return _0x3dedf7[_0xe073('0x18')](_0x5d2f2f)[_0xe073('0x19')]();};}function respondWithResult(_0x47828d,_0x2ce92d){_0x2ce92d=_0x2ce92d||0xc8;return function(_0x3fb05a){if(_0x3fb05a){return _0x47828d[_0xe073('0x18')](_0x2ce92d)[_0xe073('0x1a')](_0x3fb05a);}};}function respondWithFilteredResult(_0xfb28f5,_0x208f2e){return function(_0x26f3d3){if(_0x26f3d3){var _0x38f9e5=typeof _0x208f2e['offset']==='undefined'&&typeof _0x208f2e['limit']===_0xe073('0x1b');var _0x15488e=_0x26f3d3[_0xe073('0x1c')];var _0x16eaa6=_0x38f9e5?0x0:_0x208f2e['offset'];var _0x4fdd2c=_0x38f9e5?_0x26f3d3[_0xe073('0x1c')]:_0x208f2e[_0xe073('0x1d')]+_0x208f2e['limit'];var _0x21c02e;if(_0x4fdd2c>=_0x15488e){_0x4fdd2c=_0x15488e;_0x21c02e=0xc8;}else{_0x21c02e=0xce;}_0xfb28f5[_0xe073('0x18')](_0x21c02e);return _0xfb28f5[_0xe073('0x1e')](_0xe073('0x1f'),_0x16eaa6+'-'+_0x4fdd2c+'/'+_0x15488e)[_0xe073('0x1a')](_0x26f3d3);}return null;};}function patchUpdates(_0x17dd4b){return function(_0x41639a){try{jsonpatch[_0xe073('0x20')](_0x41639a,_0x17dd4b,!![]);}catch(_0xef9bf5){return BPromise[_0xe073('0x21')](_0xef9bf5);}return _0x41639a['save']();};}function saveUpdates(_0x4405fd,_0x21f9c2){return function(_0x419703){if(_0x419703){return _0x419703[_0xe073('0x22')](_0x4405fd)[_0xe073('0x23')](function(_0x275aa8){return _0x275aa8;});}return null;};}function removeEntity(_0x504c26,_0x4c76ef){return function(_0x42d112){if(_0x42d112){return _0x42d112['destroy']()['then'](function(){_0x504c26['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a38b,_0x50795f){return function(_0x23537f){if(!_0x23537f){_0x54a38b[_0xe073('0x24')](0x194);}return _0x23537f;};}function handleError(_0x5bd226,_0x1fca27){_0x1fca27=_0x1fca27||0x1f4;return function(_0x4548d8){logger[_0xe073('0x25')](_0x4548d8['stack']);if(_0x4548d8[_0xe073('0x26')]){delete _0x4548d8['name'];}_0x5bd226[_0xe073('0x18')](_0x1fca27)[_0xe073('0x27')](_0x4548d8);};}exports['index']=function(_0x5dfff9,_0x15adbb){var _0x859ed8={},_0x278fbb={},_0x2f1cd2={'count':0x0,'rows':[]};var _0x20fabe=_[_0xe073('0x28')](db[_0xe073('0x29')][_0xe073('0x2a')],function(_0x5c04fe){return{'name':_0x5c04fe[_0xe073('0x2b')],'type':_0x5c04fe[_0xe073('0x2c')]['key']};});_0x278fbb['model']=_[_0xe073('0x28')](_0x20fabe,'name');_0x278fbb[_0xe073('0x2d')]=_[_0xe073('0x2e')](_0x5dfff9[_0xe073('0x2d')]);_0x278fbb['filters']=_['intersection'](_0x278fbb[_0xe073('0x2f')],_0x278fbb[_0xe073('0x2d')]);_0x859ed8['attributes']=_[_0xe073('0x30')](_0x278fbb[_0xe073('0x2f')],qs[_0xe073('0x31')](_0x5dfff9['query'][_0xe073('0x31')]));_0x859ed8['attributes']=_0x859ed8['attributes'][_0xe073('0x32')]?_0x859ed8[_0xe073('0x33')]:_0x278fbb[_0xe073('0x2f')];if(!_0x5dfff9['query'][_0xe073('0x34')](_0xe073('0x35'))){_0x859ed8[_0xe073('0x36')]=qs['limit'](_0x5dfff9[_0xe073('0x2d')][_0xe073('0x36')]);_0x859ed8[_0xe073('0x1d')]=qs[_0xe073('0x1d')](_0x5dfff9[_0xe073('0x2d')][_0xe073('0x1d')]);}_0x859ed8['order']=qs[_0xe073('0x37')](_0x5dfff9[_0xe073('0x2d')][_0xe073('0x37')]);_0x859ed8['where']=qs[_0xe073('0x38')](_[_0xe073('0x39')](_0x5dfff9[_0xe073('0x2d')],_0x278fbb[_0xe073('0x38')]),_0x20fabe);if(_0x5dfff9[_0xe073('0x2d')]['filter']){_0x859ed8[_0xe073('0x3a')]=_['merge'](_0x859ed8[_0xe073('0x3a')],{'$or':_[_0xe073('0x28')](_0x20fabe,function(_0x469537){if(_0x469537[_0xe073('0x2c')]!==_0xe073('0x3b')){var _0x2e200c={};_0x2e200c[_0x469537[_0xe073('0x26')]]={'$like':'%'+_0x5dfff9[_0xe073('0x2d')][_0xe073('0x3c')]+'%'};return _0x2e200c;}})});}_0x859ed8=_[_0xe073('0x3d')]({},_0x859ed8,_0x5dfff9[_0xe073('0x3e')]);var _0x300ef8={'where':_0x859ed8[_0xe073('0x3a')]};return db['FreshdeskAccount'][_0xe073('0x1c')](_0x300ef8)['then'](function(_0x174207){_0x2f1cd2[_0xe073('0x1c')]=_0x174207;if(_0x5dfff9[_0xe073('0x2d')][_0xe073('0x3f')]){_0x859ed8['include']=[{'all':!![]}];}return db[_0xe073('0x29')][_0xe073('0x40')](_0x859ed8);})[_0xe073('0x23')](function(_0x3c44f1){_0x2f1cd2[_0xe073('0x41')]=_0x3c44f1;return _0x2f1cd2;})['then'](respondWithFilteredResult(_0x15adbb,_0x859ed8))[_0xe073('0x42')](handleError(_0x15adbb,null));};exports['show']=function(_0x764196,_0x2a8c57){var _0x125d1f={'raw':![],'where':{'id':_0x764196[_0xe073('0x43')]['id']}},_0x76ae2e={};_0x76ae2e[_0xe073('0x2f')]=_[_0xe073('0x2e')](db[_0xe073('0x29')][_0xe073('0x2a')]);_0x76ae2e[_0xe073('0x2d')]=_[_0xe073('0x2e')](_0x764196['query']);_0x76ae2e['filters']=_[_0xe073('0x30')](_0x76ae2e[_0xe073('0x2f')],_0x76ae2e[_0xe073('0x2d')]);_0x125d1f[_0xe073('0x33')]=_[_0xe073('0x30')](_0x76ae2e['model'],qs[_0xe073('0x31')](_0x764196[_0xe073('0x2d')][_0xe073('0x31')]));_0x125d1f[_0xe073('0x33')]=_0x125d1f[_0xe073('0x33')]['length']?_0x125d1f[_0xe073('0x33')]:_0x76ae2e['model'];if(_0x764196['query'][_0xe073('0x3f')]){_0x125d1f[_0xe073('0x44')]=[{'all':!![]}];}_0x125d1f=_['merge']({},_0x125d1f,_0x764196['options']);return db[_0xe073('0x29')][_0xe073('0x45')](_0x125d1f)[_0xe073('0x23')](handleEntityNotFound(_0x2a8c57,null))[_0xe073('0x23')](respondWithResult(_0x2a8c57,null))[_0xe073('0x42')](handleError(_0x2a8c57,null));};exports[_0xe073('0x46')]=function(_0x317159,_0x5c7c66){return db[_0xe073('0x29')]['create'](_0x317159[_0xe073('0x47')],{})[_0xe073('0x23')](respondWithResult(_0x5c7c66,0xc9))[_0xe073('0x42')](handleError(_0x5c7c66,null));};exports['update']=function(_0x4d5bcd,_0x20f918){if(_0x4d5bcd[_0xe073('0x47')]['id']){delete _0x4d5bcd[_0xe073('0x47')]['id'];}return db['FreshdeskAccount'][_0xe073('0x45')]({'where':{'id':_0x4d5bcd[_0xe073('0x43')]['id']}})[_0xe073('0x23')](handleEntityNotFound(_0x20f918,null))[_0xe073('0x23')](saveUpdates(_0x4d5bcd[_0xe073('0x47')],null))[_0xe073('0x23')](respondWithResult(_0x20f918,null))[_0xe073('0x42')](handleError(_0x20f918,null));};exports[_0xe073('0x48')]=function(_0x3238eb,_0x5626d4){return db[_0xe073('0x29')]['find']({'where':{'id':_0x3238eb[_0xe073('0x43')]['id']}})['then'](handleEntityNotFound(_0x5626d4,null))[_0xe073('0x23')](removeEntity(_0x5626d4,null))[_0xe073('0x42')](handleError(_0x5626d4,null));};exports[_0xe073('0x49')]=function(_0xc7ff7c,_0x527a35,_0x2a3d65){var _0x1090c4={};var _0x191005={};var _0x48a470;var _0x5503c2;return db[_0xe073('0x29')][_0xe073('0x4a')]({'where':{'id':_0xc7ff7c[_0xe073('0x43')]['id']}})[_0xe073('0x23')](handleEntityNotFound(_0x527a35,null))[_0xe073('0x23')](function(_0x5212d5){if(_0x5212d5){_0x48a470=_0x5212d5;_0x191005[_0xe073('0x2f')]=_[_0xe073('0x2e')](db[_0xe073('0x4b')][_0xe073('0x2a')]);_0x191005[_0xe073('0x2d')]=_[_0xe073('0x2e')](_0xc7ff7c[_0xe073('0x2d')]);_0x191005[_0xe073('0x38')]=_[_0xe073('0x30')](_0x191005[_0xe073('0x2f')],_0x191005['query']);_0x1090c4[_0xe073('0x33')]=_['intersection'](_0x191005['model'],qs[_0xe073('0x31')](_0xc7ff7c[_0xe073('0x2d')][_0xe073('0x31')]));_0x1090c4['attributes']=_0x1090c4[_0xe073('0x33')][_0xe073('0x32')]?_0x1090c4[_0xe073('0x33')]:_0x191005['model'];_0x1090c4[_0xe073('0x4c')]=qs['sort'](_0xc7ff7c[_0xe073('0x2d')][_0xe073('0x37')]);_0x1090c4[_0xe073('0x3a')]=qs[_0xe073('0x38')](_[_0xe073('0x39')](_0xc7ff7c[_0xe073('0x2d')],_0x191005[_0xe073('0x38')]));if(_0xc7ff7c[_0xe073('0x2d')][_0xe073('0x3c')]){_0x1090c4[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x1090c4[_0xe073('0x3a')],{'$or':_[_0xe073('0x28')](_0x1090c4[_0xe073('0x33')],function(_0x9a824b){var _0x1dff1e={};_0x1dff1e[_0x9a824b]={'$like':'%'+_0xc7ff7c[_0xe073('0x2d')][_0xe073('0x3c')]+'%'};return _0x1dff1e;})});}_0x1090c4=_[_0xe073('0x3d')]({},_0x1090c4,_0xc7ff7c[_0xe073('0x3e')]);return _0x48a470[_0xe073('0x49')](_0x1090c4);}})[_0xe073('0x23')](function(_0xce6a6d){if(_0xce6a6d){_0x5503c2=_0xce6a6d[_0xe073('0x32')];if(!_0xc7ff7c[_0xe073('0x2d')][_0xe073('0x34')]('nolimit')){_0x1090c4[_0xe073('0x36')]=qs[_0xe073('0x36')](_0xc7ff7c[_0xe073('0x2d')][_0xe073('0x36')]);_0x1090c4[_0xe073('0x1d')]=qs['offset'](_0xc7ff7c[_0xe073('0x2d')]['offset']);}return _0x48a470[_0xe073('0x49')](_0x1090c4);}})[_0xe073('0x23')](function(_0x1c941f){if(_0x1c941f){return _0x1c941f?{'count':_0x5503c2,'rows':_0x1c941f}:null;}})[_0xe073('0x23')](respondWithResult(_0x527a35,null))[_0xe073('0x42')](handleError(_0x527a35,null));};exports[_0xe073('0x4d')]=function(_0x5ada4e,_0x3ffd06,_0x5d05e1){if(_0x5ada4e[_0xe073('0x47')]['id']){delete _0x5ada4e['body']['id'];}return db[_0xe073('0x29')][_0xe073('0x4a')]({'where':{'id':_0x5ada4e[_0xe073('0x43')]['id']}})[_0xe073('0x23')](handleEntityNotFound(_0x3ffd06,null))[_0xe073('0x23')](function(_0x17db84){if(_0x17db84){_0x5ada4e[_0xe073('0x47')][_0xe073('0x4e')]=_0x17db84['id'];_0x5ada4e[_0xe073('0x47')][_0xe073('0x4f')]=integrations[_0xe073('0x50')](_0x5ada4e['body']['channel'],_0x5ada4e[_0xe073('0x47')][_0xe073('0x2c')]);_0x5ada4e['body']['Descriptions']=integrations[_0xe073('0x51')](_0x5ada4e[_0xe073('0x47')][_0xe073('0x52')],_0x5ada4e[_0xe073('0x47')][_0xe073('0x2c')]);return db['FreshdeskConfiguration'][_0xe073('0x46')](_0x5ada4e[_0xe073('0x47')],{'include':[{'model':db[_0xe073('0x53')],'as':_0xe073('0x4f')},{'model':db[_0xe073('0x53')],'as':_0xe073('0x54')}]});}return null;})[_0xe073('0x23')](respondWithResult(_0x3ffd06,null))[_0xe073('0x42')](handleError(_0x3ffd06,null));};exports[_0xe073('0x55')]=function(_0x35e2ae,_0x512cd5,_0x19a3e7){var _0x509fd5='';return db['FreshdeskAccount'][_0xe073('0x4a')]({'where':{'id':_0x35e2ae[_0xe073('0x43')]['id']},'attributes':['id',_0xe073('0x56'),_0xe073('0x57')]})[_0xe073('0x23')](handleEntityNotFound(_0x512cd5,null))[_0xe073('0x23')](function(_0x31a0e2){if(_0x31a0e2){_0x509fd5=_0x31a0e2[_0xe073('0x56')];var _0x1b4e7a=_0x509fd5[_0xe073('0x58')](-0x1);if(_0x1b4e7a==='/'){_0x509fd5=_0x509fd5['substring'](0x0,_0x509fd5[_0xe073('0x59')](_0x1b4e7a));}return rp({'method':_0xe073('0x5a'),'uri':util[_0xe073('0x5b')](_0xe073('0x5c'),_0x509fd5,_0xe073('0x5d')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xe073('0x5b')](_0xe073('0x5e'),_0x31a0e2[_0xe073('0x57')]))[_0xe073('0x5f')]('base64'))},'json':!![]});}})['then'](function(_0x40a351){if(_0x40a351){var _0x164a8f=[_0xe073('0x60'),_0xe073('0x61'),'agent','description','status',_0xe073('0x62'),_0xe073('0x63'),_0xe073('0x64'),_0xe073('0x65'),_0xe073('0x63'),_0xe073('0x66')];_[_0xe073('0x67')](_0x40a351,function(_0x5bdb91){return _0x164a8f['includes'](_0x5bdb91[_0xe073('0x26')])||!_0x5bdb91[_0xe073('0x68')]&&_0x5bdb91[_0xe073('0x2c')]!==_0xe073('0x69')&&_0x5bdb91[_0xe073('0x2c')]!=='custom_dropdown';});return{'count':_0x40a351[_0xe073('0x32')],'rows':_['map'](_0x40a351,function(_0x5b6b21){return{'id':_0x5b6b21[_0xe073('0x26')],'name':_0x5b6b21[_0xe073('0x6a')],'custom':!_0x5b6b21[_0xe073('0x68')],'options':_0x5b6b21[_0xe073('0x6b')]?_['map'](_0x5b6b21['choices'],function(_0xb8b09f){return{'name':_[_0xe073('0x6c')](_0xb8b09f),'value':_0xb8b09f};}):[]};})};}})['then'](respondWithResult(_0x512cd5,null))[_0xe073('0x42')](function(_0x278717){var _0x624d5f=_0x35e2ae[_0xe073('0x2d')]['test']?0x1f4:_0x278717[_0xe073('0x6d')]||0x1f4;logger[_0xe073('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xe073('0x55'),_0x624d5f,JSON[_0xe073('0x6e')](_0x278717));delete _0x278717['name'];if(_0x624d5f===0x191){_0x624d5f=0x190;}_0x512cd5[_0xe073('0x18')](_0x624d5f)[_0xe073('0x27')](_0x35e2ae[_0xe073('0x2d')][_0xe073('0x6f')]?{'message':_0xe073('0x70'),'statusCode':_0x278717['statusCode']}:_0x278717);});};
\ No newline at end of file
index 8628974..893de31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb47=['../../components/integrations/configuration','define','FreshdeskAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0xdb47,0xbe));var _0x7db4=function(_0x11a871,_0x24b28b){_0x11a871=_0x11a871-0x0;var _0x4d5b5c=_0xdb47[_0x11a871];return _0x4d5b5c;};'use strict';var _=require(_0x7db4('0x0'));var util=require('util');var logger=require(_0x7db4('0x1'))(_0x7db4('0x2'));var moment=require(_0x7db4('0x3'));var BPromise=require(_0x7db4('0x4'));var rp=require(_0x7db4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7db4('0x6'));var attributes=require(_0x7db4('0x7'));var integrations=require(_0x7db4('0x8'));module['exports']=function(_0x4d8afd,_0x35c64f){return _0x4d8afd[_0x7db4('0x9')](_0x7db4('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x71fa=['../../config/logger','api','moment','bluebird','path','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash'];(function(_0x1045ef,_0xfea295){var _0x3e99f2=function(_0x373c6b){while(--_0x373c6b){_0x1045ef['push'](_0x1045ef['shift']());}};_0x3e99f2(++_0xfea295);}(_0x71fa,0xf9));var _0xa71f=function(_0x161a90,_0x1112cc){_0x161a90=_0x161a90-0x0;var _0x1575a0=_0x71fa[_0x161a90];return _0x1575a0;};'use strict';var _=require(_0xa71f('0x0'));var util=require('util');var logger=require(_0xa71f('0x1'))(_0xa71f('0x2'));var moment=require(_0xa71f('0x3'));var BPromise=require(_0xa71f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa71f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xa71f('0x6'));module[_0xa71f('0x7')]=function(_0x5e79ee,_0x5ecb4d){return _0x5e79ee[_0xa71f('0x8')](_0xa71f('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b17e6d2..4d3b470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9959=['raw','where','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount'];(function(_0x23434f,_0x4bb2f4){var _0x2dcb67=function(_0x33d680){while(--_0x33d680){_0x23434f['push'](_0x23434f['shift']());}};_0x2dcb67(++_0x4bb2f4);}(_0x9959,0x1c2));var _0x9995=function(_0x141131,_0x52b412){_0x141131=_0x141131-0x0;var _0x3287e7=_0x9959[_0x141131];return _0x3287e7;};'use strict';var _=require(_0x9995('0x0'));var util=require('util');var moment=require(_0x9995('0x1'));var BPromise=require('bluebird');var rs=require(_0x9995('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9995('0x3'))['db'];var utils=require(_0x9995('0x4'));var logger=require('../../config/logger')(_0x9995('0x5'));var config=require('../../config/environment');var jayson=require(_0x9995('0x6'));var client=jayson[_0x9995('0x7')][_0x9995('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcd5908,_0x59c734,_0x3cc38c){return new BPromise(function(_0x364282,_0x4d0037){return client[_0x9995('0x9')](_0xcd5908,_0x3cc38c)[_0x9995('0xa')](function(_0x50fbc2){logger[_0x9995('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x59c734,'request\x20sent');logger[_0x9995('0xc')](_0x9995('0xd'),_0x59c734,_0x9995('0xe'),JSON['stringify'](_0x50fbc2));if(_0x50fbc2[_0x9995('0xf')]){if(_0x50fbc2[_0x9995('0xf')]['code']===0x1f4){logger['error'](_0x9995('0x10'),_0x59c734,_0x50fbc2['error'][_0x9995('0x11')]);return _0x4d0037(_0x50fbc2['error']['message']);}logger[_0x9995('0xf')](_0x9995('0x10'),_0x59c734,_0x50fbc2[_0x9995('0xf')][_0x9995('0x11')]);return _0x364282(_0x50fbc2[_0x9995('0xf')][_0x9995('0x11')]);}else{logger[_0x9995('0xb')](_0x9995('0x10'),_0x59c734,_0x9995('0xe'));_0x364282(_0x50fbc2[_0x9995('0x12')]['message']);}})['catch'](function(_0x1277d0){logger[_0x9995('0xf')](_0x9995('0x10'),_0x59c734,_0x1277d0);_0x4d0037(_0x1277d0);});});}exports[_0x9995('0x13')]=function(_0xa4465b){var _0x55b997=this;return new Promise(function(_0x254d99,_0x57ac5d){return db[_0x9995('0x14')][_0x9995('0x15')]({'raw':_0xa4465b[_0x9995('0x16')]?_0xa4465b['options']['raw']===undefined?!![]:![]:!![],'where':_0xa4465b[_0x9995('0x16')]?_0xa4465b['options']['where']||null:null,'attributes':_0xa4465b['options']?_0xa4465b[_0x9995('0x16')][_0x9995('0x17')]||null:null,'limit':_0xa4465b[_0x9995('0x16')]?_0xa4465b[_0x9995('0x16')][_0x9995('0x18')]||null:null,'include':_0xa4465b[_0x9995('0x16')]?_0xa4465b['options'][_0x9995('0x19')]?_[_0x9995('0x1a')](_0xa4465b['options'][_0x9995('0x19')],function(_0x3e1660){return{'model':db[_0x3e1660[_0x9995('0x1b')]],'as':_0x3e1660['as'],'attributes':_0x3e1660[_0x9995('0x17')],'include':_0x3e1660['include']?_[_0x9995('0x1a')](_0x3e1660[_0x9995('0x19')],function(_0x11af48){return{'model':db[_0x11af48[_0x9995('0x1b')]],'as':_0x11af48['as'],'attributes':_0x11af48['attributes'],'include':_0x11af48[_0x9995('0x19')]?_[_0x9995('0x1a')](_0x11af48[_0x9995('0x19')],function(_0x4fe292){return{'model':db[_0x4fe292[_0x9995('0x1b')]],'as':_0x4fe292['as'],'attributes':_0x4fe292['attributes']};}):[]};}):[]};}):[]:[]})[_0x9995('0xa')](function(_0x15cad6){logger['info'](_0x9995('0x13'),_0xa4465b);logger[_0x9995('0xc')](_0x9995('0x13'),_0xa4465b,JSON[_0x9995('0x1c')](_0x15cad6));_0x254d99(_0x15cad6);})['catch'](function(_0x5ba64a){logger['error'](_0x9995('0x13'),_0x5ba64a[_0x9995('0x11')],_0xa4465b);_0x57ac5d(_0x55b997[_0x9995('0xf')](0x1f4,_0x5ba64a[_0x9995('0x11')]));});});};exports[_0x9995('0x1d')]=function(_0x522157){var _0x288c37=this;return new Promise(function(_0x205fdc,_0x5f403f){return db[_0x9995('0x14')]['find']({'raw':_0x522157['options']?_0x522157[_0x9995('0x16')][_0x9995('0x1e')]===undefined?!![]:![]:!![],'where':_0x522157[_0x9995('0x16')]?_0x522157['options'][_0x9995('0x1f')]||null:null,'attributes':_0x522157[_0x9995('0x16')]?_0x522157[_0x9995('0x16')][_0x9995('0x17')]||null:null,'include':_0x522157[_0x9995('0x16')]?_0x522157['options'][_0x9995('0x19')]?_['map'](_0x522157[_0x9995('0x16')][_0x9995('0x19')],function(_0xf6d1f0){return{'model':db[_0xf6d1f0[_0x9995('0x1b')]],'as':_0xf6d1f0['as'],'attributes':_0xf6d1f0['attributes'],'include':_0xf6d1f0[_0x9995('0x19')]?_['map'](_0xf6d1f0['include'],function(_0x491086){return{'model':db[_0x491086[_0x9995('0x1b')]],'as':_0x491086['as'],'attributes':_0x491086[_0x9995('0x17')],'include':_0x491086['include']?_['map'](_0x491086[_0x9995('0x19')],function(_0x5cd5c1){return{'model':db[_0x5cd5c1[_0x9995('0x1b')]],'as':_0x5cd5c1['as'],'attributes':_0x5cd5c1[_0x9995('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x587b72){logger['info']('ShowFreshdeskAccount',_0x522157);logger[_0x9995('0xc')](_0x9995('0x1d'),_0x522157,JSON['stringify'](_0x587b72));_0x205fdc(_0x587b72);})['catch'](function(_0x23814b){logger['error'](_0x9995('0x1d'),_0x23814b[_0x9995('0x11')],_0x522157);_0x5f403f(_0x288c37[_0x9995('0xf')](0x1f4,_0x23814b['message']));});});};
\ No newline at end of file
+var _0xec96=['../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','FreshdeskAccount,\x20%s,\x20%s','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xec96,0x119));var _0x6ec9=function(_0x53a01e,_0x51794e){_0x53a01e=_0x53a01e-0x0;var _0x4c8fd8=_0xec96[_0x53a01e];return _0x4c8fd8;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var moment=require(_0x6ec9('0x2'));var BPromise=require(_0x6ec9('0x3'));var rs=require(_0x6ec9('0x4'));var fs=require('fs');var Redis=require(_0x6ec9('0x5'));var db=require(_0x6ec9('0x6'))['db'];var utils=require(_0x6ec9('0x7'));var logger=require('../../config/logger')(_0x6ec9('0x8'));var config=require(_0x6ec9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6ec9('0xa')][_0x6ec9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34e1d0,_0x32dd03,_0x53744b){return new BPromise(function(_0x38869b,_0x404ac0){return client[_0x6ec9('0xc')](_0x34e1d0,_0x53744b)[_0x6ec9('0xd')](function(_0x17e5c8){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x32dd03,_0x6ec9('0xe'));logger['debug'](_0x6ec9('0xf'),_0x32dd03,_0x6ec9('0xe'),JSON['stringify'](_0x17e5c8));if(_0x17e5c8[_0x6ec9('0x10')]){if(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x11')]===0x1f4){logger[_0x6ec9('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x404ac0(_0x17e5c8['error'][_0x6ec9('0x12')]);}logger[_0x6ec9('0x10')](_0x6ec9('0x13'),_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x38869b(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);}else{logger[_0x6ec9('0x14')](_0x6ec9('0x13'),_0x32dd03,_0x6ec9('0xe'));_0x38869b(_0x17e5c8[_0x6ec9('0x15')]['message']);}})[_0x6ec9('0x16')](function(_0x124178){logger['error'](_0x6ec9('0x13'),_0x32dd03,_0x124178);_0x404ac0(_0x124178);});});}exports[_0x6ec9('0x17')]=function(_0x8f5fed){var _0x399167=this;return new Promise(function(_0xc32d28,_0x34a8b2){return db[_0x6ec9('0x18')]['findAll']({'raw':_0x8f5fed['options']?_0x8f5fed[_0x6ec9('0x19')][_0x6ec9('0x1a')]===undefined?!![]:![]:!![],'where':_0x8f5fed['options']?_0x8f5fed[_0x6ec9('0x19')]['where']||null:null,'attributes':_0x8f5fed[_0x6ec9('0x19')]?_0x8f5fed[_0x6ec9('0x19')][_0x6ec9('0x1b')]||null:null,'limit':_0x8f5fed[_0x6ec9('0x19')]?_0x8f5fed[_0x6ec9('0x19')][_0x6ec9('0x1c')]||null:null,'include':_0x8f5fed[_0x6ec9('0x19')]?_0x8f5fed[_0x6ec9('0x19')][_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x8f5fed[_0x6ec9('0x19')]['include'],function(_0x3b005b){return{'model':db[_0x3b005b[_0x6ec9('0x1f')]],'as':_0x3b005b['as'],'attributes':_0x3b005b['attributes'],'include':_0x3b005b['include']?_['map'](_0x3b005b[_0x6ec9('0x1d')],function(_0x3aa140){return{'model':db[_0x3aa140['model']],'as':_0x3aa140['as'],'attributes':_0x3aa140[_0x6ec9('0x1b')],'include':_0x3aa140[_0x6ec9('0x1d')]?_['map'](_0x3aa140['include'],function(_0x47d493){return{'model':db[_0x47d493[_0x6ec9('0x1f')]],'as':_0x47d493['as'],'attributes':_0x47d493[_0x6ec9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6ec9('0xd')](function(_0x21bc66){logger[_0x6ec9('0x14')](_0x6ec9('0x17'),_0x8f5fed);logger[_0x6ec9('0x20')]('GetFreshdeskAccount',_0x8f5fed,JSON['stringify'](_0x21bc66));_0xc32d28(_0x21bc66);})['catch'](function(_0x4c4576){logger[_0x6ec9('0x10')](_0x6ec9('0x17'),_0x4c4576['message'],_0x8f5fed);_0x34a8b2(_0x399167[_0x6ec9('0x10')](0x1f4,_0x4c4576[_0x6ec9('0x12')]));});});};exports[_0x6ec9('0x21')]=function(_0x527a6f){var _0x151d4c=this;return new Promise(function(_0x5687a5,_0x369b40){return db[_0x6ec9('0x18')][_0x6ec9('0x22')]({'raw':_0x527a6f[_0x6ec9('0x19')]?_0x527a6f[_0x6ec9('0x19')][_0x6ec9('0x1a')]===undefined?!![]:![]:!![],'where':_0x527a6f[_0x6ec9('0x19')]?_0x527a6f[_0x6ec9('0x19')]['where']||null:null,'attributes':_0x527a6f[_0x6ec9('0x19')]?_0x527a6f['options'][_0x6ec9('0x1b')]||null:null,'include':_0x527a6f['options']?_0x527a6f[_0x6ec9('0x19')][_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x527a6f[_0x6ec9('0x19')]['include'],function(_0x3ac06d){return{'model':db[_0x3ac06d['model']],'as':_0x3ac06d['as'],'attributes':_0x3ac06d[_0x6ec9('0x1b')],'include':_0x3ac06d[_0x6ec9('0x1d')]?_['map'](_0x3ac06d[_0x6ec9('0x1d')],function(_0x625355){return{'model':db[_0x625355[_0x6ec9('0x1f')]],'as':_0x625355['as'],'attributes':_0x625355[_0x6ec9('0x1b')],'include':_0x625355[_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x625355[_0x6ec9('0x1d')],function(_0xc9ae58){return{'model':db[_0xc9ae58['model']],'as':_0xc9ae58['as'],'attributes':_0xc9ae58[_0x6ec9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6ec9('0xd')](function(_0x22f1ae){logger[_0x6ec9('0x14')]('ShowFreshdeskAccount',_0x527a6f);logger[_0x6ec9('0x20')](_0x6ec9('0x21'),_0x527a6f,JSON[_0x6ec9('0x23')](_0x22f1ae));_0x5687a5(_0x22f1ae);})[_0x6ec9('0x16')](function(_0x417a62){logger[_0x6ec9('0x10')]('ShowFreshdeskAccount',_0x417a62['message'],_0x527a6f);_0x369b40(_0x151d4c[_0x6ec9('0x10')](0x1f4,_0x417a62['message']));});});};
\ No newline at end of file
index 63d7351..5fb8589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0946=['post','setTags','put','delete','multer','util','express','Router','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create'];(function(_0x585e7a,_0x2bb904){var _0x72ffc0=function(_0x3faa47){while(--_0x3faa47){_0x585e7a['push'](_0x585e7a['shift']());}};_0x72ffc0(++_0x2bb904);}(_0x0946,0x169));var _0x6094=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x0946[_0x5224ba];return _0x459bd2;};'use strict';var multer=require(_0x6094('0x0'));var util=require(_0x6094('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6094('0x2'));var router=express[_0x6094('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6094('0x4'));var controller=require(_0x6094('0x5'));router[_0x6094('0x6')]('/',auth[_0x6094('0x7')](),controller['index']);router[_0x6094('0x6')](_0x6094('0x8'),auth['isAuthenticated'](),controller[_0x6094('0x9')]);router['get'](_0x6094('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x6094('0x6')](_0x6094('0xb'),auth[_0x6094('0x7')](),controller[_0x6094('0xc')]);router[_0x6094('0x6')]('/:id/descriptions',auth[_0x6094('0x7')](),controller[_0x6094('0xd')]);router[_0x6094('0x6')](_0x6094('0xe'),auth[_0x6094('0x7')](),controller[_0x6094('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6094('0x10')]);router[_0x6094('0x11')](_0x6094('0xe'),auth['isAuthenticated'](),controller[_0x6094('0x12')]);router[_0x6094('0x13')](_0x6094('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x6094('0x14')](_0x6094('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3613=['/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','setTags','delete','/:id','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3613,0x120));var _0x3361=function(_0x47e02a,_0x44eea5){_0x47e02a=_0x47e02a-0x0;var _0x2605a1=_0x3613[_0x47e02a];return _0x2605a1;};'use strict';var multer=require('multer');var util=require(_0x3361('0x0'));var path=require(_0x3361('0x1'));var timeout=require(_0x3361('0x2'));var express=require('express');var router=express[_0x3361('0x3')]();var fs_extra=require(_0x3361('0x4'));var auth=require(_0x3361('0x5'));var interaction=require(_0x3361('0x6'));var config=require('../../config/environment');var controller=require(_0x3361('0x7'));router[_0x3361('0x8')]('/',auth[_0x3361('0x9')](),controller[_0x3361('0xa')]);router[_0x3361('0x8')]('/:id',auth[_0x3361('0x9')](),controller[_0x3361('0xb')]);router[_0x3361('0x8')](_0x3361('0xc'),auth['isAuthenticated'](),controller[_0x3361('0xd')]);router['get'](_0x3361('0xe'),auth[_0x3361('0x9')](),controller[_0x3361('0xf')]);router[_0x3361('0x8')]('/:id/descriptions',auth[_0x3361('0x9')](),controller[_0x3361('0x10')]);router['get'](_0x3361('0x11'),auth[_0x3361('0x9')](),controller[_0x3361('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3361('0x13')]);router[_0x3361('0x14')](_0x3361('0x11'),auth[_0x3361('0x9')](),controller[_0x3361('0x15')]);router['put']('/:id',auth[_0x3361('0x9')](),controller['update']);router[_0x3361('0x16')](_0x3361('0x17'),auth[_0x3361('0x9')](),controller['destroy']);module[_0x3361('0x18')]=router;
\ No newline at end of file
index d659bc5..df9ea59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ce=['exports'];(function(_0x53aed8,_0x2c8771){var _0x54637d=function(_0x3e06d6){while(--_0x3e06d6){_0x53aed8['push'](_0x53aed8['shift']());}};_0x54637d(++_0x2c8771);}(_0x38ce,0x150));var _0xe38c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x38ce[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module[_0xe38c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x93a8=['STRING'];(function(_0x33ae96,_0x4718e7){var _0x5df3ef=function(_0x4cc962){while(--_0x4cc962){_0x33ae96['push'](_0x33ae96['shift']());}};_0x5df3ef(++_0x4718e7);}(_0x93a8,0xcf));var _0x893a=function(_0x8e561a,_0x327dec){_0x8e561a=_0x8e561a-0x0;var _0x1a79a7=_0x93a8[_0x8e561a];return _0x1a79a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x893a('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 559dec4..b651293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3768=['json','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','type','options','FreshdeskConfiguration','then','includeAll','include','findAll','rows','catch','show','create','body','params','find','findOne','FreshdeskField','order','pick','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3768,0x177));var _0x8376=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x3768[_0x51cc1d];return _0x2eb9f2;};'use strict';var emlformat=require(_0x8376('0x0'));var rimraf=require(_0x8376('0x1'));var zipdir=require(_0x8376('0x2'));var jsonpatch=require(_0x8376('0x3'));var rp=require(_0x8376('0x4'));var moment=require('moment');var BPromise=require(_0x8376('0x5'));var Mustache=require(_0x8376('0x6'));var util=require(_0x8376('0x7'));var path=require('path');var sox=require(_0x8376('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8376('0x9'));var _=require('lodash');var squel=require(_0x8376('0xa'));var crypto=require('crypto');var jsforce=require(_0x8376('0xb'));var deskjs=require(_0x8376('0xc'));var toCsv=require(_0x8376('0xd'));var querystring=require(_0x8376('0xe'));var Papa=require(_0x8376('0xf'));var Redis=require(_0x8376('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8376('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8376('0x12'));var config=require(_0x8376('0x13'));var licenseUtil=require(_0x8376('0x14'));var db=require(_0x8376('0x15'))['db'];function respondWithStatusCode(_0x5cd680,_0x1d78ee){_0x1d78ee=_0x1d78ee||0xcc;return function(_0x51e73f){if(_0x51e73f){return _0x5cd680[_0x8376('0x16')](_0x1d78ee);}return _0x5cd680['status'](_0x1d78ee)['end']();};}function respondWithResult(_0x1a99ea,_0x2216b2){_0x2216b2=_0x2216b2||0xc8;return function(_0x10fa4c){if(_0x10fa4c){return _0x1a99ea[_0x8376('0x17')](_0x2216b2)['json'](_0x10fa4c);}};}function respondWithFilteredResult(_0x36368c,_0x3ce9bd){return function(_0x3bf788){if(_0x3bf788){var _0x1bef83=typeof _0x3ce9bd[_0x8376('0x18')]===_0x8376('0x19')&&typeof _0x3ce9bd['limit']===_0x8376('0x19');var _0x1c8ce9=_0x3bf788[_0x8376('0x1a')];var _0x435ef8=_0x1bef83?0x0:_0x3ce9bd[_0x8376('0x18')];var _0x4e945=_0x1bef83?_0x3bf788[_0x8376('0x1a')]:_0x3ce9bd['offset']+_0x3ce9bd[_0x8376('0x1b')];var _0x5b7df5;if(_0x4e945>=_0x1c8ce9){_0x4e945=_0x1c8ce9;_0x5b7df5=0xc8;}else{_0x5b7df5=0xce;}_0x36368c[_0x8376('0x17')](_0x5b7df5);return _0x36368c[_0x8376('0x1c')](_0x8376('0x1d'),_0x435ef8+'-'+_0x4e945+'/'+_0x1c8ce9)[_0x8376('0x1e')](_0x3bf788);}return null;};}function patchUpdates(_0x200fdf){return function(_0x345674){try{jsonpatch[_0x8376('0x1f')](_0x345674,_0x200fdf,!![]);}catch(_0x464903){return BPromise[_0x8376('0x20')](_0x464903);}return _0x345674[_0x8376('0x21')]();};}function saveUpdates(_0x571116,_0x524145){return function(_0x3c7ce0){if(_0x3c7ce0){return _0x3c7ce0[_0x8376('0x22')](_0x571116)['then'](function(_0x4421b3){return _0x4421b3;});}return null;};}function removeEntity(_0x586700,_0x1a2021){return function(_0x2b2b14){if(_0x2b2b14){return _0x2b2b14[_0x8376('0x23')]()['then'](function(){_0x586700[_0x8376('0x17')](0xcc)[_0x8376('0x24')]();});}};}function handleEntityNotFound(_0x16aa38,_0x4be834){return function(_0x2969c0){if(!_0x2969c0){_0x16aa38[_0x8376('0x16')](0x194);}return _0x2969c0;};}function handleError(_0xbaa5de,_0xb09a3){_0xb09a3=_0xb09a3||0x1f4;return function(_0x16ddb2){logger[_0x8376('0x25')](_0x16ddb2[_0x8376('0x26')]);if(_0x16ddb2[_0x8376('0x27')]){delete _0x16ddb2[_0x8376('0x27')];}_0xbaa5de[_0x8376('0x17')](_0xb09a3)[_0x8376('0x28')](_0x16ddb2);};}exports[_0x8376('0x29')]=function(_0x523a3c,_0x4c1b11){var _0x154dd5={},_0x5495ca={},_0x3c22e1={'count':0x0,'rows':[]};var _0x58813c=_[_0x8376('0x2a')](db['FreshdeskConfiguration'][_0x8376('0x2b')],function(_0xd7e3dd){return{'name':_0xd7e3dd[_0x8376('0x2c')],'type':_0xd7e3dd['type']['key']};});_0x5495ca[_0x8376('0x2d')]=_[_0x8376('0x2a')](_0x58813c,_0x8376('0x27'));_0x5495ca[_0x8376('0x2e')]=_[_0x8376('0x2f')](_0x523a3c['query']);_0x5495ca[_0x8376('0x30')]=_[_0x8376('0x31')](_0x5495ca[_0x8376('0x2d')],_0x5495ca[_0x8376('0x2e')]);_0x154dd5[_0x8376('0x32')]=_[_0x8376('0x31')](_0x5495ca[_0x8376('0x2d')],qs[_0x8376('0x33')](_0x523a3c[_0x8376('0x2e')][_0x8376('0x33')]));_0x154dd5[_0x8376('0x32')]=_0x154dd5['attributes'][_0x8376('0x34')]?_0x154dd5[_0x8376('0x32')]:_0x5495ca['model'];if(!_0x523a3c[_0x8376('0x2e')][_0x8376('0x35')](_0x8376('0x36'))){_0x154dd5[_0x8376('0x1b')]=qs[_0x8376('0x1b')](_0x523a3c['query'][_0x8376('0x1b')]);_0x154dd5[_0x8376('0x18')]=qs[_0x8376('0x18')](_0x523a3c[_0x8376('0x2e')]['offset']);}_0x154dd5['order']=qs[_0x8376('0x37')](_0x523a3c[_0x8376('0x2e')]['sort']);_0x154dd5['where']=qs[_0x8376('0x30')](_['pick'](_0x523a3c['query'],_0x5495ca[_0x8376('0x30')]),_0x58813c);if(_0x523a3c[_0x8376('0x2e')][_0x8376('0x38')]){_0x154dd5['where']=_[_0x8376('0x39')](_0x154dd5[_0x8376('0x3a')],{'$or':_[_0x8376('0x2a')](_0x58813c,function(_0x1e4c2c){if(_0x1e4c2c[_0x8376('0x3b')]!=='VIRTUAL'){var _0xbf1768={};_0xbf1768[_0x1e4c2c[_0x8376('0x27')]]={'$like':'%'+_0x523a3c[_0x8376('0x2e')][_0x8376('0x38')]+'%'};return _0xbf1768;}})});}_0x154dd5=_['merge']({},_0x154dd5,_0x523a3c[_0x8376('0x3c')]);var _0x4892c0={'where':_0x154dd5['where']};return db[_0x8376('0x3d')][_0x8376('0x1a')](_0x4892c0)[_0x8376('0x3e')](function(_0x53c823){_0x3c22e1[_0x8376('0x1a')]=_0x53c823;if(_0x523a3c[_0x8376('0x2e')][_0x8376('0x3f')]){_0x154dd5[_0x8376('0x40')]=[{'all':!![]}];}return db[_0x8376('0x3d')][_0x8376('0x41')](_0x154dd5);})['then'](function(_0x287e27){_0x3c22e1[_0x8376('0x42')]=_0x287e27;return _0x3c22e1;})[_0x8376('0x3e')](respondWithFilteredResult(_0x4c1b11,_0x154dd5))[_0x8376('0x43')](handleError(_0x4c1b11,null));};exports[_0x8376('0x44')]=function(_0x1d6536,_0x174466){var _0x4ebb86={'raw':![],'where':{'id':_0x1d6536['params']['id']}},_0x1cd370={};_0x1cd370[_0x8376('0x2d')]=_[_0x8376('0x2f')](db[_0x8376('0x3d')][_0x8376('0x2b')]);_0x1cd370[_0x8376('0x2e')]=_[_0x8376('0x2f')](_0x1d6536[_0x8376('0x2e')]);_0x1cd370[_0x8376('0x30')]=_[_0x8376('0x31')](_0x1cd370['model'],_0x1cd370['query']);_0x4ebb86[_0x8376('0x32')]=_[_0x8376('0x31')](_0x1cd370['model'],qs[_0x8376('0x33')](_0x1d6536[_0x8376('0x2e')][_0x8376('0x33')]));_0x4ebb86[_0x8376('0x32')]=_0x4ebb86[_0x8376('0x32')]['length']?_0x4ebb86['attributes']:_0x1cd370[_0x8376('0x2d')];if(_0x1d6536['query']['includeAll']){_0x4ebb86[_0x8376('0x40')]=[{'all':!![]}];}_0x4ebb86=_[_0x8376('0x39')]({},_0x4ebb86,_0x1d6536[_0x8376('0x3c')]);return db[_0x8376('0x3d')]['find'](_0x4ebb86)['then'](handleEntityNotFound(_0x174466,null))[_0x8376('0x3e')](respondWithResult(_0x174466,null))[_0x8376('0x43')](handleError(_0x174466,null));};exports[_0x8376('0x45')]=function(_0x1a78a7,_0x502dd7){return db[_0x8376('0x3d')]['create'](_0x1a78a7[_0x8376('0x46')],{})[_0x8376('0x3e')](respondWithResult(_0x502dd7,0xc9))[_0x8376('0x43')](handleError(_0x502dd7,null));};exports[_0x8376('0x22')]=function(_0x4d72c5,_0x4d1fca){if(_0x4d72c5[_0x8376('0x46')]['id']){delete _0x4d72c5['body']['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4d72c5[_0x8376('0x47')]['id']}})['then'](handleEntityNotFound(_0x4d1fca,null))[_0x8376('0x3e')](saveUpdates(_0x4d72c5[_0x8376('0x46')],null))[_0x8376('0x3e')](respondWithResult(_0x4d1fca,null))['catch'](handleError(_0x4d1fca,null));};exports[_0x8376('0x23')]=function(_0x5f50ac,_0x1f01df){return db[_0x8376('0x3d')][_0x8376('0x48')]({'where':{'id':_0x5f50ac['params']['id']}})[_0x8376('0x3e')](handleEntityNotFound(_0x1f01df,null))[_0x8376('0x3e')](removeEntity(_0x1f01df,null))['catch'](handleError(_0x1f01df,null));};exports['getFields']=function(_0x400383,_0x1a2bcc,_0x10df14){var _0x140d3d={};var _0x37462a={};var _0x1baf01;var _0xfe3e5e;return db[_0x8376('0x3d')][_0x8376('0x49')]({'where':{'id':_0x400383[_0x8376('0x47')]['id']}})[_0x8376('0x3e')](handleEntityNotFound(_0x1a2bcc,null))['then'](function(_0x1ae23b){if(_0x1ae23b){_0x1baf01=_0x1ae23b;_0x37462a[_0x8376('0x2d')]=_[_0x8376('0x2f')](db[_0x8376('0x4a')][_0x8376('0x2b')]);_0x37462a[_0x8376('0x2e')]=_[_0x8376('0x2f')](_0x400383[_0x8376('0x2e')]);_0x37462a['filters']=_[_0x8376('0x31')](_0x37462a[_0x8376('0x2d')],_0x37462a['query']);_0x140d3d['attributes']=_['intersection'](_0x37462a[_0x8376('0x2d')],qs[_0x8376('0x33')](_0x400383[_0x8376('0x2e')]['fields']));_0x140d3d[_0x8376('0x32')]=_0x140d3d[_0x8376('0x32')][_0x8376('0x34')]?_0x140d3d['attributes']:_0x37462a['model'];_0x140d3d[_0x8376('0x4b')]=qs[_0x8376('0x37')](_0x400383[_0x8376('0x2e')]['sort']);_0x140d3d[_0x8376('0x3a')]=qs[_0x8376('0x30')](_[_0x8376('0x4c')](_0x400383[_0x8376('0x2e')],_0x37462a[_0x8376('0x30')]));if(_0x400383[_0x8376('0x2e')][_0x8376('0x38')]){_0x140d3d['where']=_[_0x8376('0x39')](_0x140d3d[_0x8376('0x3a')],{'$or':_[_0x8376('0x2a')](_0x140d3d[_0x8376('0x32')],function(_0x4d6437){var _0x4d39c2={};_0x4d39c2[_0x4d6437]={'$like':'%'+_0x400383[_0x8376('0x2e')]['filter']+'%'};return _0x4d39c2;})});}_0x140d3d=_[_0x8376('0x39')]({},_0x140d3d,_0x400383['options']);return _0x1baf01['getFields'](_0x140d3d);}})[_0x8376('0x3e')](function(_0x11fc3f){if(_0x11fc3f){_0xfe3e5e=_0x11fc3f['length'];if(!_0x400383[_0x8376('0x2e')][_0x8376('0x35')](_0x8376('0x36'))){_0x140d3d[_0x8376('0x1b')]=qs[_0x8376('0x1b')](_0x400383[_0x8376('0x2e')][_0x8376('0x1b')]);_0x140d3d[_0x8376('0x18')]=qs[_0x8376('0x18')](_0x400383[_0x8376('0x2e')][_0x8376('0x18')]);}return _0x1baf01['getFields'](_0x140d3d);}})[_0x8376('0x3e')](function(_0x4545e7){if(_0x4545e7){return _0x4545e7?{'count':_0xfe3e5e,'rows':_0x4545e7}:null;}})['then'](respondWithResult(_0x1a2bcc,null))[_0x8376('0x43')](handleError(_0x1a2bcc,null));};exports[_0x8376('0x4d')]=function(_0x39b617,_0x61dc6e,_0xd69b9f){var _0x416249={};var _0x113eec={};var _0x53eac1;var _0x1e5c4d;return db['FreshdeskConfiguration'][_0x8376('0x49')]({'where':{'id':_0x39b617['params']['id']}})[_0x8376('0x3e')](handleEntityNotFound(_0x61dc6e,null))[_0x8376('0x3e')](function(_0xe861c){if(_0xe861c){_0x53eac1=_0xe861c;_0x113eec[_0x8376('0x2d')]=_[_0x8376('0x2f')](db[_0x8376('0x4a')][_0x8376('0x2b')]);_0x113eec[_0x8376('0x2e')]=_[_0x8376('0x2f')](_0x39b617[_0x8376('0x2e')]);_0x113eec['filters']=_[_0x8376('0x31')](_0x113eec[_0x8376('0x2d')],_0x113eec['query']);_0x416249[_0x8376('0x32')]=_[_0x8376('0x31')](_0x113eec[_0x8376('0x2d')],qs['fields'](_0x39b617['query'][_0x8376('0x33')]));_0x416249['attributes']=_0x416249[_0x8376('0x32')][_0x8376('0x34')]?_0x416249[_0x8376('0x32')]:_0x113eec[_0x8376('0x2d')];_0x416249['order']=qs[_0x8376('0x37')](_0x39b617[_0x8376('0x2e')]['sort']);_0x416249['where']=qs[_0x8376('0x30')](_[_0x8376('0x4c')](_0x39b617[_0x8376('0x2e')],_0x113eec[_0x8376('0x30')]));if(_0x39b617[_0x8376('0x2e')]['filter']){_0x416249['where']=_[_0x8376('0x39')](_0x416249[_0x8376('0x3a')],{'$or':_[_0x8376('0x2a')](_0x416249[_0x8376('0x32')],function(_0x189359){var _0x2621c2={};_0x2621c2[_0x189359]={'$like':'%'+_0x39b617[_0x8376('0x2e')][_0x8376('0x38')]+'%'};return _0x2621c2;})});}_0x416249=_[_0x8376('0x39')]({},_0x416249,_0x39b617[_0x8376('0x3c')]);return _0x53eac1[_0x8376('0x4d')](_0x416249);}})[_0x8376('0x3e')](function(_0x4ddc2a){if(_0x4ddc2a){_0x1e5c4d=_0x4ddc2a[_0x8376('0x34')];if(!_0x39b617[_0x8376('0x2e')][_0x8376('0x35')](_0x8376('0x36'))){_0x416249[_0x8376('0x1b')]=qs[_0x8376('0x1b')](_0x39b617[_0x8376('0x2e')][_0x8376('0x1b')]);_0x416249['offset']=qs['offset'](_0x39b617[_0x8376('0x2e')]['offset']);}return _0x53eac1[_0x8376('0x4d')](_0x416249);}})[_0x8376('0x3e')](function(_0x125617){if(_0x125617){return _0x125617?{'count':_0x1e5c4d,'rows':_0x125617}:null;}})[_0x8376('0x3e')](respondWithResult(_0x61dc6e,null))[_0x8376('0x43')](handleError(_0x61dc6e,null));};exports[_0x8376('0x4e')]=function(_0x38d4f4,_0x567a42,_0x11cfe3){var _0x1ae72c={};var _0x503a1b={};var _0x32335a;var _0x5b5b50;return db[_0x8376('0x3d')][_0x8376('0x49')]({'where':{'id':_0x38d4f4[_0x8376('0x47')]['id']}})[_0x8376('0x3e')](handleEntityNotFound(_0x567a42,null))[_0x8376('0x3e')](function(_0x1292be){if(_0x1292be){_0x32335a=_0x1292be;_0x503a1b[_0x8376('0x2d')]=_[_0x8376('0x2f')](db['FreshdeskField'][_0x8376('0x2b')]);_0x503a1b[_0x8376('0x2e')]=_['keys'](_0x38d4f4[_0x8376('0x2e')]);_0x503a1b[_0x8376('0x30')]=_[_0x8376('0x31')](_0x503a1b['model'],_0x503a1b['query']);_0x1ae72c['attributes']=_[_0x8376('0x31')](_0x503a1b[_0x8376('0x2d')],qs['fields'](_0x38d4f4[_0x8376('0x2e')]['fields']));_0x1ae72c[_0x8376('0x32')]=_0x1ae72c[_0x8376('0x32')][_0x8376('0x34')]?_0x1ae72c[_0x8376('0x32')]:_0x503a1b['model'];_0x1ae72c[_0x8376('0x4b')]=qs[_0x8376('0x37')](_0x38d4f4[_0x8376('0x2e')][_0x8376('0x37')]);_0x1ae72c[_0x8376('0x3a')]=qs[_0x8376('0x30')](_[_0x8376('0x4c')](_0x38d4f4['query'],_0x503a1b['filters']));if(_0x38d4f4['query'][_0x8376('0x38')]){_0x1ae72c['where']=_[_0x8376('0x39')](_0x1ae72c[_0x8376('0x3a')],{'$or':_[_0x8376('0x2a')](_0x1ae72c[_0x8376('0x32')],function(_0x36806e){var _0x5ac46d={};_0x5ac46d[_0x36806e]={'$like':'%'+_0x38d4f4[_0x8376('0x2e')][_0x8376('0x38')]+'%'};return _0x5ac46d;})});}_0x1ae72c=_[_0x8376('0x39')]({},_0x1ae72c,_0x38d4f4[_0x8376('0x3c')]);return _0x32335a[_0x8376('0x4e')](_0x1ae72c);}})[_0x8376('0x3e')](function(_0x25595a){if(_0x25595a){_0x5b5b50=_0x25595a['length'];if(!_0x38d4f4['query'][_0x8376('0x35')]('nolimit')){_0x1ae72c[_0x8376('0x1b')]=qs[_0x8376('0x1b')](_0x38d4f4[_0x8376('0x2e')][_0x8376('0x1b')]);_0x1ae72c[_0x8376('0x18')]=qs['offset'](_0x38d4f4['query'][_0x8376('0x18')]);}return _0x32335a[_0x8376('0x4e')](_0x1ae72c);}})[_0x8376('0x3e')](function(_0x56a40d){if(_0x56a40d){return _0x56a40d?{'count':_0x5b5b50,'rows':_0x56a40d}:null;}})[_0x8376('0x3e')](respondWithResult(_0x567a42,null))['catch'](handleError(_0x567a42,null));};exports[_0x8376('0x4f')]=function(_0x39bcd6,_0x5719ea,_0x37aac8){var _0x64b3f5={};var _0x27a459={};var _0xf43b35;var _0x3044e2;return db[_0x8376('0x3d')][_0x8376('0x49')]({'where':{'id':_0x39bcd6[_0x8376('0x47')]['id']}})['then'](handleEntityNotFound(_0x5719ea,null))[_0x8376('0x3e')](function(_0x158a15){if(_0x158a15){_0xf43b35=_0x158a15;_0x27a459[_0x8376('0x2d')]=_[_0x8376('0x2f')](db['Tag'][_0x8376('0x2b')]);_0x27a459[_0x8376('0x2e')]=_['keys'](_0x39bcd6[_0x8376('0x2e')]);_0x27a459['filters']=_[_0x8376('0x31')](_0x27a459[_0x8376('0x2d')],_0x27a459['query']);_0x64b3f5[_0x8376('0x32')]=_[_0x8376('0x31')](_0x27a459[_0x8376('0x2d')],qs['fields'](_0x39bcd6[_0x8376('0x2e')]['fields']));_0x64b3f5['attributes']=_0x64b3f5[_0x8376('0x32')][_0x8376('0x34')]?_0x64b3f5[_0x8376('0x32')]:_0x27a459[_0x8376('0x2d')];_0x64b3f5[_0x8376('0x4b')]=qs[_0x8376('0x37')](_0x39bcd6[_0x8376('0x2e')]['sort']);_0x64b3f5[_0x8376('0x3a')]=qs[_0x8376('0x30')](_['pick'](_0x39bcd6['query'],_0x27a459['filters']));if(_0x39bcd6[_0x8376('0x2e')][_0x8376('0x38')]){_0x64b3f5[_0x8376('0x3a')]=_[_0x8376('0x39')](_0x64b3f5[_0x8376('0x3a')],{'$or':_[_0x8376('0x2a')](_0x64b3f5[_0x8376('0x32')],function(_0x84047a){var _0x595c42={};_0x595c42[_0x84047a]={'$like':'%'+_0x39bcd6[_0x8376('0x2e')]['filter']+'%'};return _0x595c42;})});}_0x64b3f5=_[_0x8376('0x39')]({},_0x64b3f5,_0x39bcd6[_0x8376('0x3c')]);return _0xf43b35['getTags'](_0x64b3f5);}})['then'](function(_0x40c084){if(_0x40c084){_0x3044e2=_0x40c084[_0x8376('0x34')];if(!_0x39bcd6[_0x8376('0x2e')][_0x8376('0x35')]('nolimit')){_0x64b3f5[_0x8376('0x1b')]=qs[_0x8376('0x1b')](_0x39bcd6['query'][_0x8376('0x1b')]);_0x64b3f5['offset']=qs['offset'](_0x39bcd6['query']['offset']);}return _0xf43b35[_0x8376('0x4f')](_0x64b3f5);}})[_0x8376('0x3e')](function(_0x8d5837){if(_0x8d5837){return _0x8d5837?{'count':_0x3044e2,'rows':_0x8d5837}:null;}})[_0x8376('0x3e')](respondWithResult(_0x5719ea,null))[_0x8376('0x43')](handleError(_0x5719ea,null));};exports[_0x8376('0x50')]=function(_0x372de8,_0x1aea77,_0x32a9d5){if(_0x372de8[_0x8376('0x46')]['id']){delete _0x372de8[_0x8376('0x46')]['id'];}return db[_0x8376('0x3d')][_0x8376('0x49')]({'where':{'id':_0x372de8[_0x8376('0x47')]['id']}})['then'](handleEntityNotFound(_0x1aea77,null))[_0x8376('0x3e')](function(_0x3345d2){if(_0x3345d2){return _0x3345d2[_0x8376('0x50')](_0x372de8[_0x8376('0x46')]['ids']||[]);}return null;})[_0x8376('0x3e')](respondWithResult(_0x1aea77,null))[_0x8376('0x43')](handleError(_0x1aea77,null));};
\ No newline at end of file
+var _0xec3c=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','find','create','body','catch','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x2b644d,_0x4a0130){var _0x1fadd2=function(_0x2a2451){while(--_0x2a2451){_0x2b644d['push'](_0x2b644d['shift']());}};_0x1fadd2(++_0x4a0130);}(_0xec3c,0x77));var _0xcec3=function(_0x536256,_0x237fb5){_0x536256=_0x536256-0x0;var _0x1675f7=_0xec3c[_0x536256];return _0x1675f7;};'use strict';var emlformat=require(_0xcec3('0x0'));var rimraf=require(_0xcec3('0x1'));var zipdir=require(_0xcec3('0x2'));var jsonpatch=require(_0xcec3('0x3'));var rp=require('request-promise');var moment=require(_0xcec3('0x4'));var BPromise=require(_0xcec3('0x5'));var Mustache=require('mustache');var util=require(_0xcec3('0x6'));var path=require(_0xcec3('0x7'));var sox=require(_0xcec3('0x8'));var csv=require(_0xcec3('0x9'));var ejs=require(_0xcec3('0xa'));var fs=require('fs');var fs_extra=require(_0xcec3('0xb'));var _=require(_0xcec3('0xc'));var squel=require(_0xcec3('0xd'));var crypto=require('crypto');var jsforce=require(_0xcec3('0xe'));var deskjs=require(_0xcec3('0xf'));var toCsv=require(_0xcec3('0x9'));var querystring=require(_0xcec3('0x10'));var Papa=require(_0xcec3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcec3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcec3('0x13'));var logger=require(_0xcec3('0x14'))('api');var utils=require(_0xcec3('0x15'));var config=require(_0xcec3('0x16'));var licenseUtil=require(_0xcec3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360e90,_0x2f9913){_0x2f9913=_0x2f9913||0xcc;return function(_0x2fb41c){if(_0x2fb41c){return _0x360e90[_0xcec3('0x18')](_0x2f9913);}return _0x360e90[_0xcec3('0x19')](_0x2f9913)[_0xcec3('0x1a')]();};}function respondWithResult(_0x5c9d44,_0x4e0f24){_0x4e0f24=_0x4e0f24||0xc8;return function(_0xce2b11){if(_0xce2b11){return _0x5c9d44[_0xcec3('0x19')](_0x4e0f24)[_0xcec3('0x1b')](_0xce2b11);}};}function respondWithFilteredResult(_0x4c91e3,_0x222db4){return function(_0x54dd46){if(_0x54dd46){var _0x2a241d=typeof _0x222db4[_0xcec3('0x1c')]===_0xcec3('0x1d')&&typeof _0x222db4[_0xcec3('0x1e')]===_0xcec3('0x1d');var _0x162f1b=_0x54dd46['count'];var _0x3d5a22=_0x2a241d?0x0:_0x222db4[_0xcec3('0x1c')];var _0x6a0c5d=_0x2a241d?_0x54dd46[_0xcec3('0x1f')]:_0x222db4[_0xcec3('0x1c')]+_0x222db4[_0xcec3('0x1e')];var _0xc65284;if(_0x6a0c5d>=_0x162f1b){_0x6a0c5d=_0x162f1b;_0xc65284=0xc8;}else{_0xc65284=0xce;}_0x4c91e3['status'](_0xc65284);return _0x4c91e3[_0xcec3('0x20')]('Content-Range',_0x3d5a22+'-'+_0x6a0c5d+'/'+_0x162f1b)[_0xcec3('0x1b')](_0x54dd46);}return null;};}function patchUpdates(_0x4dd114){return function(_0x981fe3){try{jsonpatch[_0xcec3('0x21')](_0x981fe3,_0x4dd114,!![]);}catch(_0xbe8559){return BPromise[_0xcec3('0x22')](_0xbe8559);}return _0x981fe3[_0xcec3('0x23')]();};}function saveUpdates(_0x149ff0,_0x10f038){return function(_0x29834d){if(_0x29834d){return _0x29834d[_0xcec3('0x24')](_0x149ff0)[_0xcec3('0x25')](function(_0x5a8131){return _0x5a8131;});}return null;};}function removeEntity(_0x2cc415,_0x3dfbd3){return function(_0x3f5ed0){if(_0x3f5ed0){return _0x3f5ed0[_0xcec3('0x26')]()[_0xcec3('0x25')](function(){_0x2cc415[_0xcec3('0x19')](0xcc)[_0xcec3('0x1a')]();});}};}function handleEntityNotFound(_0x26f0d1,_0x583608){return function(_0x47b0b6){if(!_0x47b0b6){_0x26f0d1[_0xcec3('0x18')](0x194);}return _0x47b0b6;};}function handleError(_0x526e63,_0x2f4280){_0x2f4280=_0x2f4280||0x1f4;return function(_0x17675c){logger[_0xcec3('0x27')](_0x17675c[_0xcec3('0x28')]);if(_0x17675c[_0xcec3('0x29')]){delete _0x17675c['name'];}_0x526e63[_0xcec3('0x19')](_0x2f4280)[_0xcec3('0x2a')](_0x17675c);};}exports['index']=function(_0x39506d,_0x3ca7c9){var _0x3737ef={},_0x53344f={},_0x2fa4b4={'count':0x0,'rows':[]};var _0x4b6408=_[_0xcec3('0x2b')](db[_0xcec3('0x2c')][_0xcec3('0x2d')],function(_0xa79886){return{'name':_0xa79886[_0xcec3('0x2e')],'type':_0xa79886[_0xcec3('0x2f')][_0xcec3('0x30')]};});_0x53344f[_0xcec3('0x31')]=_['map'](_0x4b6408,_0xcec3('0x29'));_0x53344f[_0xcec3('0x32')]=_[_0xcec3('0x33')](_0x39506d[_0xcec3('0x32')]);_0x53344f[_0xcec3('0x34')]=_['intersection'](_0x53344f[_0xcec3('0x31')],_0x53344f[_0xcec3('0x32')]);_0x3737ef[_0xcec3('0x35')]=_['intersection'](_0x53344f[_0xcec3('0x31')],qs[_0xcec3('0x36')](_0x39506d[_0xcec3('0x32')][_0xcec3('0x36')]));_0x3737ef[_0xcec3('0x35')]=_0x3737ef[_0xcec3('0x35')][_0xcec3('0x37')]?_0x3737ef[_0xcec3('0x35')]:_0x53344f['model'];if(!_0x39506d[_0xcec3('0x32')][_0xcec3('0x38')](_0xcec3('0x39'))){_0x3737ef[_0xcec3('0x1e')]=qs[_0xcec3('0x1e')](_0x39506d['query'][_0xcec3('0x1e')]);_0x3737ef[_0xcec3('0x1c')]=qs['offset'](_0x39506d['query'][_0xcec3('0x1c')]);}_0x3737ef[_0xcec3('0x3a')]=qs[_0xcec3('0x3b')](_0x39506d[_0xcec3('0x32')]['sort']);_0x3737ef[_0xcec3('0x3c')]=qs[_0xcec3('0x34')](_[_0xcec3('0x3d')](_0x39506d[_0xcec3('0x32')],_0x53344f[_0xcec3('0x34')]),_0x4b6408);if(_0x39506d[_0xcec3('0x32')][_0xcec3('0x3e')]){_0x3737ef[_0xcec3('0x3c')]=_[_0xcec3('0x3f')](_0x3737ef[_0xcec3('0x3c')],{'$or':_['map'](_0x4b6408,function(_0x5b44f5){if(_0x5b44f5[_0xcec3('0x2f')]!==_0xcec3('0x40')){var _0x4e8cfe={};_0x4e8cfe[_0x5b44f5[_0xcec3('0x29')]]={'$like':'%'+_0x39506d[_0xcec3('0x32')][_0xcec3('0x3e')]+'%'};return _0x4e8cfe;}})});}_0x3737ef=_['merge']({},_0x3737ef,_0x39506d['options']);var _0x4f1165={'where':_0x3737ef[_0xcec3('0x3c')]};return db[_0xcec3('0x2c')][_0xcec3('0x1f')](_0x4f1165)[_0xcec3('0x25')](function(_0x2beef1){_0x2fa4b4[_0xcec3('0x1f')]=_0x2beef1;if(_0x39506d[_0xcec3('0x32')][_0xcec3('0x41')]){_0x3737ef[_0xcec3('0x42')]=[{'all':!![]}];}return db[_0xcec3('0x2c')][_0xcec3('0x43')](_0x3737ef);})['then'](function(_0x610f32){_0x2fa4b4[_0xcec3('0x44')]=_0x610f32;return _0x2fa4b4;})['then'](respondWithFilteredResult(_0x3ca7c9,_0x3737ef))['catch'](handleError(_0x3ca7c9,null));};exports[_0xcec3('0x45')]=function(_0xfdabb4,_0x257cde){var _0x1618de={'raw':![],'where':{'id':_0xfdabb4[_0xcec3('0x46')]['id']}},_0x1e99e9={};_0x1e99e9[_0xcec3('0x31')]=_[_0xcec3('0x33')](db[_0xcec3('0x2c')][_0xcec3('0x2d')]);_0x1e99e9[_0xcec3('0x32')]=_[_0xcec3('0x33')](_0xfdabb4[_0xcec3('0x32')]);_0x1e99e9[_0xcec3('0x34')]=_[_0xcec3('0x47')](_0x1e99e9['model'],_0x1e99e9[_0xcec3('0x32')]);_0x1618de[_0xcec3('0x35')]=_[_0xcec3('0x47')](_0x1e99e9[_0xcec3('0x31')],qs[_0xcec3('0x36')](_0xfdabb4[_0xcec3('0x32')]['fields']));_0x1618de['attributes']=_0x1618de[_0xcec3('0x35')][_0xcec3('0x37')]?_0x1618de[_0xcec3('0x35')]:_0x1e99e9[_0xcec3('0x31')];if(_0xfdabb4['query'][_0xcec3('0x41')]){_0x1618de[_0xcec3('0x42')]=[{'all':!![]}];}_0x1618de=_[_0xcec3('0x3f')]({},_0x1618de,_0xfdabb4['options']);return db[_0xcec3('0x2c')][_0xcec3('0x48')](_0x1618de)[_0xcec3('0x25')](handleEntityNotFound(_0x257cde,null))[_0xcec3('0x25')](respondWithResult(_0x257cde,null))['catch'](handleError(_0x257cde,null));};exports[_0xcec3('0x49')]=function(_0x1bad94,_0x15ade0){return db[_0xcec3('0x2c')][_0xcec3('0x49')](_0x1bad94[_0xcec3('0x4a')],{})[_0xcec3('0x25')](respondWithResult(_0x15ade0,0xc9))[_0xcec3('0x4b')](handleError(_0x15ade0,null));};exports['update']=function(_0x496d98,_0x4153eb){if(_0x496d98[_0xcec3('0x4a')]['id']){delete _0x496d98[_0xcec3('0x4a')]['id'];}return db[_0xcec3('0x2c')][_0xcec3('0x48')]({'where':{'id':_0x496d98['params']['id']}})[_0xcec3('0x25')](handleEntityNotFound(_0x4153eb,null))[_0xcec3('0x25')](saveUpdates(_0x496d98[_0xcec3('0x4a')],null))['then'](respondWithResult(_0x4153eb,null))[_0xcec3('0x4b')](handleError(_0x4153eb,null));};exports[_0xcec3('0x26')]=function(_0x4ed568,_0x2f4646){return db['FreshdeskConfiguration'][_0xcec3('0x48')]({'where':{'id':_0x4ed568[_0xcec3('0x46')]['id']}})[_0xcec3('0x25')](handleEntityNotFound(_0x2f4646,null))['then'](removeEntity(_0x2f4646,null))['catch'](handleError(_0x2f4646,null));};exports[_0xcec3('0x4c')]=function(_0x4ddda7,_0x217f15,_0x4525d3){var _0x22b719={};var _0x10933a={};var _0x5c3bd2;var _0xe1964f;return db[_0xcec3('0x2c')][_0xcec3('0x4d')]({'where':{'id':_0x4ddda7[_0xcec3('0x46')]['id']}})[_0xcec3('0x25')](handleEntityNotFound(_0x217f15,null))['then'](function(_0x5651a5){if(_0x5651a5){_0x5c3bd2=_0x5651a5;_0x10933a[_0xcec3('0x31')]=_[_0xcec3('0x33')](db[_0xcec3('0x4e')][_0xcec3('0x2d')]);_0x10933a[_0xcec3('0x32')]=_[_0xcec3('0x33')](_0x4ddda7[_0xcec3('0x32')]);_0x10933a[_0xcec3('0x34')]=_[_0xcec3('0x47')](_0x10933a[_0xcec3('0x31')],_0x10933a['query']);_0x22b719[_0xcec3('0x35')]=_[_0xcec3('0x47')](_0x10933a[_0xcec3('0x31')],qs[_0xcec3('0x36')](_0x4ddda7[_0xcec3('0x32')][_0xcec3('0x36')]));_0x22b719['attributes']=_0x22b719[_0xcec3('0x35')]['length']?_0x22b719[_0xcec3('0x35')]:_0x10933a[_0xcec3('0x31')];_0x22b719[_0xcec3('0x3a')]=qs['sort'](_0x4ddda7[_0xcec3('0x32')][_0xcec3('0x3b')]);_0x22b719[_0xcec3('0x3c')]=qs[_0xcec3('0x34')](_[_0xcec3('0x3d')](_0x4ddda7[_0xcec3('0x32')],_0x10933a[_0xcec3('0x34')]));if(_0x4ddda7[_0xcec3('0x32')]['filter']){_0x22b719[_0xcec3('0x3c')]=_[_0xcec3('0x3f')](_0x22b719['where'],{'$or':_['map'](_0x22b719[_0xcec3('0x35')],function(_0x98e1bc){var _0x26c89e={};_0x26c89e[_0x98e1bc]={'$like':'%'+_0x4ddda7[_0xcec3('0x32')][_0xcec3('0x3e')]+'%'};return _0x26c89e;})});}_0x22b719=_[_0xcec3('0x3f')]({},_0x22b719,_0x4ddda7[_0xcec3('0x4f')]);return _0x5c3bd2[_0xcec3('0x4c')](_0x22b719);}})[_0xcec3('0x25')](function(_0x3c8410){if(_0x3c8410){_0xe1964f=_0x3c8410[_0xcec3('0x37')];if(!_0x4ddda7[_0xcec3('0x32')][_0xcec3('0x38')](_0xcec3('0x39'))){_0x22b719[_0xcec3('0x1e')]=qs[_0xcec3('0x1e')](_0x4ddda7[_0xcec3('0x32')][_0xcec3('0x1e')]);_0x22b719[_0xcec3('0x1c')]=qs['offset'](_0x4ddda7[_0xcec3('0x32')]['offset']);}return _0x5c3bd2[_0xcec3('0x4c')](_0x22b719);}})[_0xcec3('0x25')](function(_0x235f66){if(_0x235f66){return _0x235f66?{'count':_0xe1964f,'rows':_0x235f66}:null;}})[_0xcec3('0x25')](respondWithResult(_0x217f15,null))[_0xcec3('0x4b')](handleError(_0x217f15,null));};exports['getSubjects']=function(_0x40fffc,_0x3235ef,_0x375ffc){var _0x1c1013={};var _0x515ced={};var _0x1fcd98;var _0x4cad1d;return db[_0xcec3('0x2c')][_0xcec3('0x4d')]({'where':{'id':_0x40fffc[_0xcec3('0x46')]['id']}})[_0xcec3('0x25')](handleEntityNotFound(_0x3235ef,null))[_0xcec3('0x25')](function(_0x353c45){if(_0x353c45){_0x1fcd98=_0x353c45;_0x515ced[_0xcec3('0x31')]=_['keys'](db[_0xcec3('0x4e')][_0xcec3('0x2d')]);_0x515ced[_0xcec3('0x32')]=_['keys'](_0x40fffc['query']);_0x515ced['filters']=_[_0xcec3('0x47')](_0x515ced[_0xcec3('0x31')],_0x515ced[_0xcec3('0x32')]);_0x1c1013[_0xcec3('0x35')]=_[_0xcec3('0x47')](_0x515ced[_0xcec3('0x31')],qs[_0xcec3('0x36')](_0x40fffc[_0xcec3('0x32')][_0xcec3('0x36')]));_0x1c1013[_0xcec3('0x35')]=_0x1c1013[_0xcec3('0x35')][_0xcec3('0x37')]?_0x1c1013[_0xcec3('0x35')]:_0x515ced[_0xcec3('0x31')];_0x1c1013['order']=qs[_0xcec3('0x3b')](_0x40fffc[_0xcec3('0x32')][_0xcec3('0x3b')]);_0x1c1013[_0xcec3('0x3c')]=qs[_0xcec3('0x34')](_[_0xcec3('0x3d')](_0x40fffc[_0xcec3('0x32')],_0x515ced[_0xcec3('0x34')]));if(_0x40fffc[_0xcec3('0x32')][_0xcec3('0x3e')]){_0x1c1013[_0xcec3('0x3c')]=_[_0xcec3('0x3f')](_0x1c1013[_0xcec3('0x3c')],{'$or':_[_0xcec3('0x2b')](_0x1c1013[_0xcec3('0x35')],function(_0x1687a3){var _0x2ee5e0={};_0x2ee5e0[_0x1687a3]={'$like':'%'+_0x40fffc[_0xcec3('0x32')]['filter']+'%'};return _0x2ee5e0;})});}_0x1c1013=_[_0xcec3('0x3f')]({},_0x1c1013,_0x40fffc[_0xcec3('0x4f')]);return _0x1fcd98['getSubjects'](_0x1c1013);}})['then'](function(_0x16bc78){if(_0x16bc78){_0x4cad1d=_0x16bc78[_0xcec3('0x37')];if(!_0x40fffc['query'][_0xcec3('0x38')](_0xcec3('0x39'))){_0x1c1013['limit']=qs['limit'](_0x40fffc['query'][_0xcec3('0x1e')]);_0x1c1013[_0xcec3('0x1c')]=qs[_0xcec3('0x1c')](_0x40fffc['query'][_0xcec3('0x1c')]);}return _0x1fcd98[_0xcec3('0x50')](_0x1c1013);}})[_0xcec3('0x25')](function(_0x3e1dbb){if(_0x3e1dbb){return _0x3e1dbb?{'count':_0x4cad1d,'rows':_0x3e1dbb}:null;}})[_0xcec3('0x25')](respondWithResult(_0x3235ef,null))[_0xcec3('0x4b')](handleError(_0x3235ef,null));};exports[_0xcec3('0x51')]=function(_0x27b1f3,_0x53fb08,_0x5dd0c6){var _0x527c12={};var _0x213b32={};var _0x542f6e;var _0x113e54;return db[_0xcec3('0x2c')][_0xcec3('0x4d')]({'where':{'id':_0x27b1f3['params']['id']}})['then'](handleEntityNotFound(_0x53fb08,null))[_0xcec3('0x25')](function(_0x399e63){if(_0x399e63){_0x542f6e=_0x399e63;_0x213b32[_0xcec3('0x31')]=_['keys'](db[_0xcec3('0x4e')][_0xcec3('0x2d')]);_0x213b32[_0xcec3('0x32')]=_['keys'](_0x27b1f3[_0xcec3('0x32')]);_0x213b32[_0xcec3('0x34')]=_[_0xcec3('0x47')](_0x213b32['model'],_0x213b32[_0xcec3('0x32')]);_0x527c12[_0xcec3('0x35')]=_[_0xcec3('0x47')](_0x213b32[_0xcec3('0x31')],qs[_0xcec3('0x36')](_0x27b1f3[_0xcec3('0x32')]['fields']));_0x527c12[_0xcec3('0x35')]=_0x527c12[_0xcec3('0x35')]['length']?_0x527c12[_0xcec3('0x35')]:_0x213b32['model'];_0x527c12[_0xcec3('0x3a')]=qs[_0xcec3('0x3b')](_0x27b1f3[_0xcec3('0x32')][_0xcec3('0x3b')]);_0x527c12[_0xcec3('0x3c')]=qs[_0xcec3('0x34')](_[_0xcec3('0x3d')](_0x27b1f3[_0xcec3('0x32')],_0x213b32['filters']));if(_0x27b1f3[_0xcec3('0x32')][_0xcec3('0x3e')]){_0x527c12[_0xcec3('0x3c')]=_[_0xcec3('0x3f')](_0x527c12[_0xcec3('0x3c')],{'$or':_[_0xcec3('0x2b')](_0x527c12[_0xcec3('0x35')],function(_0xf64dd){var _0x2837a9={};_0x2837a9[_0xf64dd]={'$like':'%'+_0x27b1f3[_0xcec3('0x32')][_0xcec3('0x3e')]+'%'};return _0x2837a9;})});}_0x527c12=_[_0xcec3('0x3f')]({},_0x527c12,_0x27b1f3[_0xcec3('0x4f')]);return _0x542f6e[_0xcec3('0x51')](_0x527c12);}})['then'](function(_0x491ac8){if(_0x491ac8){_0x113e54=_0x491ac8[_0xcec3('0x37')];if(!_0x27b1f3[_0xcec3('0x32')]['hasOwnProperty'](_0xcec3('0x39'))){_0x527c12[_0xcec3('0x1e')]=qs[_0xcec3('0x1e')](_0x27b1f3[_0xcec3('0x32')]['limit']);_0x527c12[_0xcec3('0x1c')]=qs[_0xcec3('0x1c')](_0x27b1f3[_0xcec3('0x32')][_0xcec3('0x1c')]);}return _0x542f6e[_0xcec3('0x51')](_0x527c12);}})[_0xcec3('0x25')](function(_0x4a5f37){if(_0x4a5f37){return _0x4a5f37?{'count':_0x113e54,'rows':_0x4a5f37}:null;}})[_0xcec3('0x25')](respondWithResult(_0x53fb08,null))[_0xcec3('0x4b')](handleError(_0x53fb08,null));};exports[_0xcec3('0x52')]=function(_0x945553,_0x1c6145,_0x3542f7){var _0x130e66={};var _0x5ad288={};var _0x476c5e;var _0x464699;return db[_0xcec3('0x2c')][_0xcec3('0x4d')]({'where':{'id':_0x945553[_0xcec3('0x46')]['id']}})[_0xcec3('0x25')](handleEntityNotFound(_0x1c6145,null))['then'](function(_0x37989b){if(_0x37989b){_0x476c5e=_0x37989b;_0x5ad288[_0xcec3('0x31')]=_[_0xcec3('0x33')](db[_0xcec3('0x53')][_0xcec3('0x2d')]);_0x5ad288[_0xcec3('0x32')]=_['keys'](_0x945553[_0xcec3('0x32')]);_0x5ad288['filters']=_[_0xcec3('0x47')](_0x5ad288[_0xcec3('0x31')],_0x5ad288[_0xcec3('0x32')]);_0x130e66[_0xcec3('0x35')]=_[_0xcec3('0x47')](_0x5ad288['model'],qs[_0xcec3('0x36')](_0x945553[_0xcec3('0x32')][_0xcec3('0x36')]));_0x130e66[_0xcec3('0x35')]=_0x130e66[_0xcec3('0x35')][_0xcec3('0x37')]?_0x130e66[_0xcec3('0x35')]:_0x5ad288[_0xcec3('0x31')];_0x130e66[_0xcec3('0x3a')]=qs[_0xcec3('0x3b')](_0x945553[_0xcec3('0x32')]['sort']);_0x130e66[_0xcec3('0x3c')]=qs['filters'](_[_0xcec3('0x3d')](_0x945553[_0xcec3('0x32')],_0x5ad288[_0xcec3('0x34')]));if(_0x945553[_0xcec3('0x32')][_0xcec3('0x3e')]){_0x130e66[_0xcec3('0x3c')]=_[_0xcec3('0x3f')](_0x130e66['where'],{'$or':_[_0xcec3('0x2b')](_0x130e66[_0xcec3('0x35')],function(_0x45e130){var _0x2de57b={};_0x2de57b[_0x45e130]={'$like':'%'+_0x945553['query'][_0xcec3('0x3e')]+'%'};return _0x2de57b;})});}_0x130e66=_[_0xcec3('0x3f')]({},_0x130e66,_0x945553['options']);return _0x476c5e[_0xcec3('0x52')](_0x130e66);}})['then'](function(_0x1da930){if(_0x1da930){_0x464699=_0x1da930[_0xcec3('0x37')];if(!_0x945553[_0xcec3('0x32')]['hasOwnProperty']('nolimit')){_0x130e66[_0xcec3('0x1e')]=qs[_0xcec3('0x1e')](_0x945553[_0xcec3('0x32')]['limit']);_0x130e66[_0xcec3('0x1c')]=qs[_0xcec3('0x1c')](_0x945553['query'][_0xcec3('0x1c')]);}return _0x476c5e['getTags'](_0x130e66);}})[_0xcec3('0x25')](function(_0x3a7aab){if(_0x3a7aab){return _0x3a7aab?{'count':_0x464699,'rows':_0x3a7aab}:null;}})[_0xcec3('0x25')](respondWithResult(_0x1c6145,null))['catch'](handleError(_0x1c6145,null));};exports['setTags']=function(_0x73cf35,_0x72b95e,_0x1a9686){if(_0x73cf35['body']['id']){delete _0x73cf35['body']['id'];}return db[_0xcec3('0x2c')][_0xcec3('0x4d')]({'where':{'id':_0x73cf35[_0xcec3('0x46')]['id']}})[_0xcec3('0x25')](handleEntityNotFound(_0x72b95e,null))[_0xcec3('0x25')](function(_0x21b07d){if(_0x21b07d){return _0x21b07d[_0xcec3('0x54')](_0x73cf35[_0xcec3('0x4a')][_0xcec3('0x55')]||[]);}return null;})['then'](respondWithResult(_0x72b95e,null))[_0xcec3('0x4b')](handleError(_0x72b95e,null));};
\ No newline at end of file
index b8c89d8..ad5cb64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cd9=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x21afde,_0x4454ce){var _0x33cde=function(_0x4020fc){while(--_0x4020fc){_0x21afde['push'](_0x21afde['shift']());}};_0x33cde(++_0x4454ce);}(_0x1cd9,0x133));var _0x91cd=function(_0x42ae19,_0x3f8abc){_0x42ae19=_0x42ae19-0x0;var _0x6115e6=_0x1cd9[_0x42ae19];return _0x6115e6;};'use strict';var _=require('lodash');var util=require(_0x91cd('0x0'));var logger=require(_0x91cd('0x1'))(_0x91cd('0x2'));var moment=require(_0x91cd('0x3'));var BPromise=require(_0x91cd('0x4'));var rp=require(_0x91cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x91cd('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x91cd('0x7')]=function(_0x3d2163,_0x3e7a3b){return _0x3d2163[_0x91cd('0x8')](_0x91cd('0x9'),attributes,{'tableName':_0x91cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe47e=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','request-promise','path','rimraf','exports','define'];(function(_0x5dbf82,_0x3707e2){var _0x4c6007=function(_0x126362){while(--_0x126362){_0x5dbf82['push'](_0x5dbf82['shift']());}};_0x4c6007(++_0x3707e2);}(_0xe47e,0x10a));var _0xee47=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0xe47e[_0x4fe19c];return _0x952ac7;};'use strict';var _=require(_0xee47('0x0'));var util=require(_0xee47('0x1'));var logger=require(_0xee47('0x2'))(_0xee47('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee47('0x4'));var fs=require('fs');var path=require(_0xee47('0x5'));var rimraf=require(_0xee47('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xee47('0x7')]=function(_0x530f1e,_0x23f55e){return _0x530f1e[_0xee47('0x8')](_0xee47('0x9'),attributes,{'tableName':_0xee47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 693f49d..8fee5ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x971a=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0x971a,0x1cb));var _0xa971=function(_0x59474d,_0x13475b){_0x59474d=_0x59474d-0x0;var _0x4e977a=_0x971a[_0x59474d];return _0x4e977a;};'use strict';var _=require(_0xa971('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa971('0x1'));var rs=require(_0xa971('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa971('0x3'));var logger=require(_0xa971('0x4'))(_0xa971('0x5'));var config=require(_0xa971('0x6'));var jayson=require(_0xa971('0x7'));var client=jayson[_0xa971('0x8')][_0xa971('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb13c9e,_0x5e3893,_0x1db298){return new BPromise(function(_0x377352,_0x304ea9){return client['request'](_0xb13c9e,_0x1db298)['then'](function(_0x238278){logger[_0xa971('0xa')](_0xa971('0xb'),_0x5e3893,_0xa971('0xc'));logger[_0xa971('0xd')](_0xa971('0xe'),_0x5e3893,'request\x20sent',JSON[_0xa971('0xf')](_0x238278));if(_0x238278[_0xa971('0x10')]){if(_0x238278[_0xa971('0x10')][_0xa971('0x11')]===0x1f4){logger[_0xa971('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e3893,_0x238278['error'][_0xa971('0x12')]);return _0x304ea9(_0x238278[_0xa971('0x10')][_0xa971('0x12')]);}logger[_0xa971('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e3893,_0x238278[_0xa971('0x10')]['message']);return _0x377352(_0x238278[_0xa971('0x10')][_0xa971('0x12')]);}else{logger['info'](_0xa971('0xb'),_0x5e3893,_0xa971('0xc'));_0x377352(_0x238278[_0xa971('0x13')][_0xa971('0x12')]);}})['catch'](function(_0x5d1a49){logger[_0xa971('0x10')](_0xa971('0xb'),_0x5e3893,_0x5d1a49);_0x304ea9(_0x5d1a49);});});}
\ No newline at end of file
+var _0x09c8=['request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0xd52466,_0x2e7d30){var _0x3993f2=function(_0x5eea21){while(--_0x5eea21){_0xd52466['push'](_0xd52466['shift']());}};_0x3993f2(++_0x2e7d30);}(_0x09c8,0x183));var _0x809c=function(_0x5a5936,_0x1fef78){_0x5a5936=_0x5a5936-0x0;var _0x2d9112=_0x09c8[_0x5a5936];return _0x2d9112;};'use strict';var _=require(_0x809c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x809c('0x1'));var rs=require(_0x809c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x809c('0x3'))['db'];var utils=require(_0x809c('0x4'));var logger=require('../../config/logger')(_0x809c('0x5'));var config=require(_0x809c('0x6'));var jayson=require(_0x809c('0x7'));var client=jayson['client'][_0x809c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1134c0,_0x2b86e6,_0x3d9f1c){return new BPromise(function(_0x2766f7,_0x12e3ff){return client[_0x809c('0x9')](_0x1134c0,_0x3d9f1c)['then'](function(_0x4cb9e4){logger[_0x809c('0xa')](_0x809c('0xb'),_0x2b86e6,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2b86e6,_0x809c('0xc'),JSON[_0x809c('0xd')](_0x4cb9e4));if(_0x4cb9e4['error']){if(_0x4cb9e4[_0x809c('0xe')][_0x809c('0xf')]===0x1f4){logger[_0x809c('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b86e6,_0x4cb9e4[_0x809c('0xe')]['message']);return _0x12e3ff(_0x4cb9e4[_0x809c('0xe')][_0x809c('0x10')]);}logger[_0x809c('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b86e6,_0x4cb9e4[_0x809c('0xe')][_0x809c('0x10')]);return _0x2766f7(_0x4cb9e4[_0x809c('0xe')][_0x809c('0x10')]);}else{logger[_0x809c('0xa')](_0x809c('0xb'),_0x2b86e6,_0x809c('0xc'));_0x2766f7(_0x4cb9e4[_0x809c('0x11')]['message']);}})[_0x809c('0x12')](function(_0x523be6){logger['error'](_0x809c('0xb'),_0x2b86e6,_0x523be6);_0x12e3ff(_0x523be6);});});}
\ No newline at end of file
index e567069..f7dcb17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48cf=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xa7abb9,_0xd574bd){var _0x27bdb0=function(_0x3c8db8){while(--_0x3c8db8){_0xa7abb9['push'](_0xa7abb9['shift']());}};_0x27bdb0(++_0xd574bd);}(_0x48cf,0x1ea));var _0xf48c=function(_0x230e5b,_0x192445){_0x230e5b=_0x230e5b-0x0;var _0x5e50ee=_0x48cf[_0x230e5b];return _0x5e50ee;};'use strict';var multer=require(_0xf48c('0x0'));var util=require(_0xf48c('0x1'));var path=require(_0xf48c('0x2'));var timeout=require(_0xf48c('0x3'));var express=require(_0xf48c('0x4'));var router=express[_0xf48c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf48c('0x6'));var interaction=require(_0xf48c('0x7'));var config=require(_0xf48c('0x8'));var controller=require(_0xf48c('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf48c('0xa')]('/:id',auth[_0xf48c('0xb')](),controller[_0xf48c('0xc')]);router[_0xf48c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf48c('0xe'),auth[_0xf48c('0xb')](),controller[_0xf48c('0xf')]);router[_0xf48c('0x10')]('/:id',auth[_0xf48c('0xb')](),controller[_0xf48c('0x11')]);module[_0xf48c('0x12')]=router;
\ No newline at end of file
+var _0x3abc=['/:id','post','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x33b3e7,_0x3c2592){var _0x49f558=function(_0x3bad6c){while(--_0x3bad6c){_0x33b3e7['push'](_0x33b3e7['shift']());}};_0x49f558(++_0x3c2592);}(_0x3abc,0x86));var _0xc3ab=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x3abc[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xc3ab('0x0'));var util=require(_0xc3ab('0x1'));var path=require(_0xc3ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3ab('0x3'));var router=express['Router']();var fs_extra=require(_0xc3ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc3ab('0x5'));var config=require(_0xc3ab('0x6'));var controller=require('./intFreshdeskField.controller');router[_0xc3ab('0x7')]('/',auth[_0xc3ab('0x8')](),controller[_0xc3ab('0x9')]);router[_0xc3ab('0x7')](_0xc3ab('0xa'),auth[_0xc3ab('0x8')](),controller['show']);router[_0xc3ab('0xb')]('/',auth[_0xc3ab('0x8')](),controller['create']);router['put'](_0xc3ab('0xa'),auth['isAuthenticated'](),controller[_0xc3ab('0xc')]);router[_0xc3ab('0xd')](_0xc3ab('0xa'),auth[_0xc3ab('0x8')](),controller[_0xc3ab('0xe')]);module[_0xc3ab('0xf')]=router;
\ No newline at end of file
index eaeb7f2..22e3a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55a2=['ENUM','string','variable','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x4e38fd,_0x13d776){var _0x2fe8b7=function(_0x22127a){while(--_0x22127a){_0x4e38fd['push'](_0x4e38fd['shift']());}};_0x2fe8b7(++_0x13d776);}(_0x55a2,0x1de));var _0x255a=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x55a2[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0x255a('0x0'));module[_0x255a('0x1')]={'type':{'type':Sequelize[_0x255a('0x2')](_0x255a('0x3'),_0x255a('0x4'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x255a('0x5')]},'key':{'type':Sequelize[_0x255a('0x5')]},'keyType':{'type':Sequelize[_0x255a('0x2')]('string','variable',_0x255a('0x6'))},'keyContent':{'type':Sequelize[_0x255a('0x5')]},'idField':{'type':Sequelize[_0x255a('0x5')]},'nameField':{'type':Sequelize[_0x255a('0x5')]},'customField':{'type':Sequelize[_0x255a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2809=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x277173,_0x1fc5a6){var _0x1e2459=function(_0x20eea7){while(--_0x20eea7){_0x277173['push'](_0x277173['shift']());}};_0x1e2459(++_0x1fc5a6);}(_0x2809,0x106));var _0x9280=function(_0x890db7,_0x4dcf2c){_0x890db7=_0x890db7-0x0;var _0x46412=_0x2809[_0x890db7];return _0x46412;};'use strict';var Sequelize=require(_0x9280('0x0'));module[_0x9280('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9280('0x2'),_0x9280('0x3'),_0x9280('0x4'),_0x9280('0x5'),_0x9280('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9280('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9280('0x8')]('string',_0x9280('0x3'),_0x9280('0x4'))},'keyContent':{'type':Sequelize[_0x9280('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9280('0x7')]},'customField':{'type':Sequelize[_0x9280('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9280('0x7')]}};
\ No newline at end of file
index b8b9d4f..774d0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x780f=['FreshdeskField','rawAttributes','fieldName','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','send','index'];(function(_0x28ad3d,_0x2c494a){var _0x220974=function(_0x53fc66){while(--_0x53fc66){_0x28ad3d['push'](_0x28ad3d['shift']());}};_0x220974(++_0x2c494a);}(_0x780f,0x6c));var _0xf780=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x780f[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0xf780('0x0'));var rimraf=require(_0xf780('0x1'));var zipdir=require(_0xf780('0x2'));var jsonpatch=require(_0xf780('0x3'));var rp=require(_0xf780('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf780('0x5'));var util=require(_0xf780('0x6'));var path=require(_0xf780('0x7'));var sox=require(_0xf780('0x8'));var csv=require('to-csv');var ejs=require(_0xf780('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf780('0xa'));var squel=require(_0xf780('0xb'));var crypto=require(_0xf780('0xc'));var jsforce=require(_0xf780('0xd'));var deskjs=require(_0xf780('0xe'));var toCsv=require(_0xf780('0xf'));var querystring=require('querystring');var Papa=require(_0xf780('0x10'));var Redis=require(_0xf780('0x11'));var authService=require(_0xf780('0x12'));var qs=require(_0xf780('0x13'));var as=require(_0xf780('0x14'));var hardwareService=require(_0xf780('0x15'));var logger=require(_0xf780('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf780('0x17'));var licenseUtil=require(_0xf780('0x18'));var db=require(_0xf780('0x19'))['db'];function respondWithStatusCode(_0x1a8520,_0x5f04e1){_0x5f04e1=_0x5f04e1||0xcc;return function(_0x24aa4f){if(_0x24aa4f){return _0x1a8520[_0xf780('0x1a')](_0x5f04e1);}return _0x1a8520[_0xf780('0x1b')](_0x5f04e1)[_0xf780('0x1c')]();};}function respondWithResult(_0x5c353b,_0x5a64bc){_0x5a64bc=_0x5a64bc||0xc8;return function(_0x4be599){if(_0x4be599){return _0x5c353b[_0xf780('0x1b')](_0x5a64bc)[_0xf780('0x1d')](_0x4be599);}};}function respondWithFilteredResult(_0xc1e872,_0x187b6d){return function(_0x206d34){if(_0x206d34){var _0x335ba6=typeof _0x187b6d[_0xf780('0x1e')]==='undefined'&&typeof _0x187b6d[_0xf780('0x1f')]===_0xf780('0x20');var _0xa78b1b=_0x206d34[_0xf780('0x21')];var _0x5d5a81=_0x335ba6?0x0:_0x187b6d[_0xf780('0x1e')];var _0x53dfee=_0x335ba6?_0x206d34[_0xf780('0x21')]:_0x187b6d[_0xf780('0x1e')]+_0x187b6d['limit'];var _0x29dae1;if(_0x53dfee>=_0xa78b1b){_0x53dfee=_0xa78b1b;_0x29dae1=0xc8;}else{_0x29dae1=0xce;}_0xc1e872[_0xf780('0x1b')](_0x29dae1);return _0xc1e872['set'](_0xf780('0x22'),_0x5d5a81+'-'+_0x53dfee+'/'+_0xa78b1b)[_0xf780('0x1d')](_0x206d34);}return null;};}function patchUpdates(_0x3c7054){return function(_0x4065bb){try{jsonpatch[_0xf780('0x23')](_0x4065bb,_0x3c7054,!![]);}catch(_0x147de9){return BPromise['reject'](_0x147de9);}return _0x4065bb[_0xf780('0x24')]();};}function saveUpdates(_0x4de546,_0x5853ea){return function(_0x45d80e){if(_0x45d80e){return _0x45d80e[_0xf780('0x25')](_0x4de546)[_0xf780('0x26')](function(_0x58bb66){return _0x58bb66;});}return null;};}function removeEntity(_0x2fcb2d,_0x373dce){return function(_0x4f59b1){if(_0x4f59b1){return _0x4f59b1[_0xf780('0x27')]()['then'](function(){_0x2fcb2d[_0xf780('0x1b')](0xcc)[_0xf780('0x1c')]();});}};}function handleEntityNotFound(_0x5d4053,_0x589208){return function(_0x3710bb){if(!_0x3710bb){_0x5d4053[_0xf780('0x1a')](0x194);}return _0x3710bb;};}function handleError(_0x462435,_0x40d9c9){_0x40d9c9=_0x40d9c9||0x1f4;return function(_0x458c76){logger[_0xf780('0x28')](_0x458c76[_0xf780('0x29')]);if(_0x458c76['name']){delete _0x458c76['name'];}_0x462435['status'](_0x40d9c9)[_0xf780('0x2a')](_0x458c76);};}exports[_0xf780('0x2b')]=function(_0x26452f,_0x4ef8c3){var _0x4ed256={},_0x36bc63={},_0x149190={'count':0x0,'rows':[]};var _0x2b832d=_['map'](db[_0xf780('0x2c')][_0xf780('0x2d')],function(_0x2368e3){return{'name':_0x2368e3[_0xf780('0x2e')],'type':_0x2368e3['type'][_0xf780('0x2f')]};});_0x36bc63['model']=_[_0xf780('0x30')](_0x2b832d,_0xf780('0x31'));_0x36bc63[_0xf780('0x32')]=_[_0xf780('0x33')](_0x26452f[_0xf780('0x32')]);_0x36bc63[_0xf780('0x34')]=_[_0xf780('0x35')](_0x36bc63[_0xf780('0x36')],_0x36bc63['query']);_0x4ed256[_0xf780('0x37')]=_[_0xf780('0x35')](_0x36bc63[_0xf780('0x36')],qs[_0xf780('0x38')](_0x26452f[_0xf780('0x32')]['fields']));_0x4ed256[_0xf780('0x37')]=_0x4ed256['attributes'][_0xf780('0x39')]?_0x4ed256[_0xf780('0x37')]:_0x36bc63[_0xf780('0x36')];if(!_0x26452f['query'][_0xf780('0x3a')](_0xf780('0x3b'))){_0x4ed256[_0xf780('0x1f')]=qs[_0xf780('0x1f')](_0x26452f['query'][_0xf780('0x1f')]);_0x4ed256['offset']=qs[_0xf780('0x1e')](_0x26452f['query']['offset']);}_0x4ed256[_0xf780('0x3c')]=qs['sort'](_0x26452f[_0xf780('0x32')][_0xf780('0x3d')]);_0x4ed256[_0xf780('0x3e')]=qs[_0xf780('0x34')](_['pick'](_0x26452f[_0xf780('0x32')],_0x36bc63[_0xf780('0x34')]),_0x2b832d);if(_0x26452f[_0xf780('0x32')][_0xf780('0x3f')]){_0x4ed256['where']=_[_0xf780('0x40')](_0x4ed256[_0xf780('0x3e')],{'$or':_[_0xf780('0x30')](_0x2b832d,function(_0xdac8ab){if(_0xdac8ab[_0xf780('0x41')]!=='VIRTUAL'){var _0x4b8a3c={};_0x4b8a3c[_0xdac8ab[_0xf780('0x31')]]={'$like':'%'+_0x26452f[_0xf780('0x32')][_0xf780('0x3f')]+'%'};return _0x4b8a3c;}})});}_0x4ed256=_[_0xf780('0x40')]({},_0x4ed256,_0x26452f[_0xf780('0x42')]);var _0x4a0efe={'where':_0x4ed256[_0xf780('0x3e')]};return db['FreshdeskField'][_0xf780('0x21')](_0x4a0efe)[_0xf780('0x26')](function(_0x28783f){_0x149190[_0xf780('0x21')]=_0x28783f;if(_0x26452f['query'][_0xf780('0x43')]){_0x4ed256[_0xf780('0x44')]=[{'all':!![]}];}return db[_0xf780('0x2c')][_0xf780('0x45')](_0x4ed256);})[_0xf780('0x26')](function(_0x12ae9a){_0x149190[_0xf780('0x46')]=_0x12ae9a;return _0x149190;})[_0xf780('0x26')](respondWithFilteredResult(_0x4ef8c3,_0x4ed256))[_0xf780('0x47')](handleError(_0x4ef8c3,null));};exports[_0xf780('0x48')]=function(_0x143118,_0x30a036){var _0x406a9e={'raw':!![],'where':{'id':_0x143118['params']['id']}},_0x42a710={};_0x42a710[_0xf780('0x36')]=_['keys'](db[_0xf780('0x2c')][_0xf780('0x2d')]);_0x42a710['query']=_['keys'](_0x143118['query']);_0x42a710['filters']=_[_0xf780('0x35')](_0x42a710['model'],_0x42a710[_0xf780('0x32')]);_0x406a9e[_0xf780('0x37')]=_[_0xf780('0x35')](_0x42a710[_0xf780('0x36')],qs[_0xf780('0x38')](_0x143118['query']['fields']));_0x406a9e['attributes']=_0x406a9e['attributes'][_0xf780('0x39')]?_0x406a9e[_0xf780('0x37')]:_0x42a710[_0xf780('0x36')];if(_0x143118[_0xf780('0x32')][_0xf780('0x43')]){_0x406a9e[_0xf780('0x44')]=[{'all':!![]}];}_0x406a9e=_['merge']({},_0x406a9e,_0x143118[_0xf780('0x42')]);return db[_0xf780('0x2c')][_0xf780('0x49')](_0x406a9e)[_0xf780('0x26')](handleEntityNotFound(_0x30a036,null))[_0xf780('0x26')](respondWithResult(_0x30a036,null))[_0xf780('0x47')](handleError(_0x30a036,null));};exports['create']=function(_0x26fe74,_0x5c4170){return db[_0xf780('0x2c')]['create'](_0x26fe74[_0xf780('0x4a')],{})['then'](respondWithResult(_0x5c4170,0xc9))['catch'](handleError(_0x5c4170,null));};exports[_0xf780('0x25')]=function(_0x72a225,_0x189717){if(_0x72a225[_0xf780('0x4a')]['id']){delete _0x72a225['body']['id'];}return db[_0xf780('0x2c')][_0xf780('0x49')]({'where':{'id':_0x72a225[_0xf780('0x4b')]['id']}})[_0xf780('0x26')](handleEntityNotFound(_0x189717,null))[_0xf780('0x26')](saveUpdates(_0x72a225['body'],null))[_0xf780('0x26')](respondWithResult(_0x189717,null))['catch'](handleError(_0x189717,null));};exports[_0xf780('0x27')]=function(_0x1b492a,_0x22c52d){return db[_0xf780('0x2c')][_0xf780('0x49')]({'where':{'id':_0x1b492a['params']['id']}})['then'](handleEntityNotFound(_0x22c52d,null))[_0xf780('0x26')](removeEntity(_0x22c52d,null))[_0xf780('0x47')](handleError(_0x22c52d,null));};
\ No newline at end of file
+var _0xa571=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','end','error','name','index','map','FreshdeskField','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa571,0x107));var _0x1a57=function(_0x5832b2,_0x3699d7){_0x5832b2=_0x5832b2-0x0;var _0x23a422=_0xa571[_0x5832b2];return _0x23a422;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x23')]();});}};}function handleEntityNotFound(_0x2f9454,_0x182649){return function(_0x25c1e9){if(!_0x25c1e9){_0x2f9454[_0x1a57('0x18')](0x194);}return _0x25c1e9;};}function handleError(_0x27cfe1,_0xf6ffef){_0xf6ffef=_0xf6ffef||0x1f4;return function(_0x26584b){logger[_0x1a57('0x24')](_0x26584b['stack']);if(_0x26584b['name']){delete _0x26584b[_0x1a57('0x25')];}_0x27cfe1[_0x1a57('0x19')](_0xf6ffef)['send'](_0x26584b);};}exports[_0x1a57('0x26')]=function(_0x54f6a5,_0x2d8738){var _0x4a2901={},_0x53bf6e={},_0x8179a4={'count':0x0,'rows':[]};var _0x274fe6=_[_0x1a57('0x27')](db[_0x1a57('0x28')]['rawAttributes'],function(_0x366d5f){return{'name':_0x366d5f[_0x1a57('0x29')],'type':_0x366d5f[_0x1a57('0x2a')][_0x1a57('0x2b')]};});_0x53bf6e['model']=_[_0x1a57('0x27')](_0x274fe6,_0x1a57('0x25'));_0x53bf6e[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x54f6a5[_0x1a57('0x2c')]);_0x53bf6e[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],_0x53bf6e[_0x1a57('0x2c')]);_0x4a2901['attributes']=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],qs['fields'](_0x54f6a5['query'][_0x1a57('0x31')]));_0x4a2901[_0x1a57('0x32')]=_0x4a2901[_0x1a57('0x32')][_0x1a57('0x33')]?_0x4a2901[_0x1a57('0x32')]:_0x53bf6e[_0x1a57('0x30')];if(!_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x34')](_0x1a57('0x35'))){_0x4a2901[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x4a2901[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1e')]);}_0x4a2901[_0x1a57('0x36')]=qs['sort'](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x37')]);_0x4a2901[_0x1a57('0x38')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x39')](_0x54f6a5[_0x1a57('0x2c')],_0x53bf6e[_0x1a57('0x2e')]),_0x274fe6);if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]){_0x4a2901['where']=_['merge'](_0x4a2901['where'],{'$or':_['map'](_0x274fe6,function(_0x333b32){if(_0x333b32[_0x1a57('0x2a')]!==_0x1a57('0x3b')){var _0x4d6e1e={};_0x4d6e1e[_0x333b32[_0x1a57('0x25')]]={'$like':'%'+_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]+'%'};return _0x4d6e1e;}})});}_0x4a2901=_[_0x1a57('0x3c')]({},_0x4a2901,_0x54f6a5['options']);var _0x1be254={'where':_0x4a2901['where']};return db[_0x1a57('0x28')][_0x1a57('0x1d')](_0x1be254)[_0x1a57('0x21')](function(_0x534a9a){_0x8179a4[_0x1a57('0x1d')]=_0x534a9a;if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x4a2901[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x28')]['findAll'](_0x4a2901);})[_0x1a57('0x21')](function(_0x47e998){_0x8179a4['rows']=_0x47e998;return _0x8179a4;})[_0x1a57('0x21')](respondWithFilteredResult(_0x2d8738,_0x4a2901))['catch'](handleError(_0x2d8738,null));};exports[_0x1a57('0x3f')]=function(_0x398c59,_0x3fbae1){var _0x59abb1={'raw':!![],'where':{'id':_0x398c59[_0x1a57('0x40')]['id']}},_0x188a50={};_0x188a50[_0x1a57('0x30')]=_[_0x1a57('0x2d')](db['FreshdeskField'][_0x1a57('0x41')]);_0x188a50[_0x1a57('0x2c')]=_['keys'](_0x398c59[_0x1a57('0x2c')]);_0x188a50['filters']=_['intersection'](_0x188a50[_0x1a57('0x30')],_0x188a50[_0x1a57('0x2c')]);_0x59abb1[_0x1a57('0x32')]=_[_0x1a57('0x2f')](_0x188a50['model'],qs[_0x1a57('0x31')](_0x398c59[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x59abb1[_0x1a57('0x32')]=_0x59abb1[_0x1a57('0x32')]['length']?_0x59abb1[_0x1a57('0x32')]:_0x188a50[_0x1a57('0x30')];if(_0x398c59[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x59abb1['include']=[{'all':!![]}];}_0x59abb1=_[_0x1a57('0x3c')]({},_0x59abb1,_0x398c59['options']);return db[_0x1a57('0x28')][_0x1a57('0x42')](_0x59abb1)[_0x1a57('0x21')](handleEntityNotFound(_0x3fbae1,null))[_0x1a57('0x21')](respondWithResult(_0x3fbae1,null))[_0x1a57('0x43')](handleError(_0x3fbae1,null));};exports[_0x1a57('0x44')]=function(_0x28f629,_0x401285){return db[_0x1a57('0x28')][_0x1a57('0x44')](_0x28f629[_0x1a57('0x45')],{})[_0x1a57('0x21')](respondWithResult(_0x401285,0xc9))[_0x1a57('0x43')](handleError(_0x401285,null));};exports['update']=function(_0xf4d056,_0x480aff){if(_0xf4d056[_0x1a57('0x45')]['id']){delete _0xf4d056[_0x1a57('0x45')]['id'];}return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0xf4d056[_0x1a57('0x40')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x480aff,null))[_0x1a57('0x21')](saveUpdates(_0xf4d056[_0x1a57('0x45')],null))[_0x1a57('0x21')](respondWithResult(_0x480aff,null))['catch'](handleError(_0x480aff,null));};exports[_0x1a57('0x22')]=function(_0x439a42,_0x51651d){return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0x439a42['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x51651d,null))[_0x1a57('0x21')](removeEntity(_0x51651d,null))['catch'](handleError(_0x51651d,null));};
\ No newline at end of file
index 88fb496..9d7834f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12cc=['bluebird','rimraf','../../config/environment','define','FreshdeskField','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x909db9,_0x2a2f44){var _0x58eee2=function(_0x225981){while(--_0x225981){_0x909db9['push'](_0x909db9['shift']());}};_0x58eee2(++_0x2a2f44);}(_0x12cc,0xc2));var _0xc12c=function(_0x336758,_0x199933){_0x336758=_0x336758-0x0;var _0x17b7f2=_0x12cc[_0x336758];return _0x17b7f2;};'use strict';var _=require('lodash');var util=require(_0xc12c('0x0'));var logger=require(_0xc12c('0x1'))(_0xc12c('0x2'));var moment=require(_0xc12c('0x3'));var BPromise=require(_0xc12c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc12c('0x5'));var config=require(_0xc12c('0x6'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x4990f4,_0x152fcd){return _0x4990f4[_0xc12c('0x7')](_0xc12c('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xc12c('0x9'),_0xc12c('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c08=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x29f6f8,_0x3bd3e4){var _0x6c4589=function(_0x4cc8dc){while(--_0x4cc8dc){_0x29f6f8['push'](_0x29f6f8['shift']());}};_0x6c4589(++_0x3bd3e4);}(_0x1c08,0x17b));var _0x81c0=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x1c08[_0x10d670];return _0x20d6f8;};'use strict';var _=require(_0x81c0('0x0'));var util=require(_0x81c0('0x1'));var logger=require(_0x81c0('0x2'))(_0x81c0('0x3'));var moment=require('moment');var BPromise=require(_0x81c0('0x4'));var rp=require(_0x81c0('0x5'));var fs=require('fs');var path=require(_0x81c0('0x6'));var rimraf=require(_0x81c0('0x7'));var config=require(_0x81c0('0x8'));var attributes=require(_0x81c0('0x9'));module[_0x81c0('0xa')]=function(_0x472cde,_0x47c1b9){return _0x472cde[_0x81c0('0xb')](_0x81c0('0xc'),attributes,{'tableName':_0x81c0('0xd'),'paranoid':![],'indexes':[{'name':_0x81c0('0xe'),'fields':['idField',_0x81c0('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 85df74a..8ebe3d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad9=['error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5103e5,_0x15cb66){var _0x488441=function(_0x4c642e){while(--_0x4c642e){_0x5103e5['push'](_0x5103e5['shift']());}};_0x488441(++_0x15cb66);}(_0x3ad9,0x1d4));var _0x93ad=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0x3ad9[_0x212bf5];return _0xfcad21;};'use strict';var _=require(_0x93ad('0x0'));var util=require(_0x93ad('0x1'));var moment=require('moment');var BPromise=require(_0x93ad('0x2'));var rs=require(_0x93ad('0x3'));var fs=require('fs');var Redis=require(_0x93ad('0x4'));var db=require(_0x93ad('0x5'))['db'];var utils=require(_0x93ad('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x93ad('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93ad('0x8')][_0x93ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x128267,_0x552ae9,_0x5f9b90){return new BPromise(function(_0x490185,_0x2e9225){return client[_0x93ad('0xa')](_0x128267,_0x5f9b90)['then'](function(_0x1efe09){logger[_0x93ad('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x552ae9,_0x93ad('0xc'));logger['debug'](_0x93ad('0xd'),_0x552ae9,'request\x20sent',JSON[_0x93ad('0xe')](_0x1efe09));if(_0x1efe09[_0x93ad('0xf')]){if(_0x1efe09[_0x93ad('0xf')][_0x93ad('0x10')]===0x1f4){logger[_0x93ad('0xf')](_0x93ad('0x11'),_0x552ae9,_0x1efe09['error'][_0x93ad('0x12')]);return _0x2e9225(_0x1efe09[_0x93ad('0xf')][_0x93ad('0x12')]);}logger[_0x93ad('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x552ae9,_0x1efe09[_0x93ad('0xf')]['message']);return _0x490185(_0x1efe09[_0x93ad('0xf')][_0x93ad('0x12')]);}else{logger[_0x93ad('0xb')](_0x93ad('0x11'),_0x552ae9,_0x93ad('0xc'));_0x490185(_0x1efe09[_0x93ad('0x13')][_0x93ad('0x12')]);}})[_0x93ad('0x14')](function(_0x58ad53){logger['error'](_0x93ad('0x11'),_0x552ae9,_0x58ad53);_0x2e9225(_0x58ad53);});});}
\ No newline at end of file
+var _0x4eb8=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4eb8,0x1a6));var _0x84eb=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x4eb8[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var moment=require(_0x84eb('0x2'));var BPromise=require(_0x84eb('0x3'));var rs=require(_0x84eb('0x4'));var fs=require('fs');var Redis=require(_0x84eb('0x5'));var db=require(_0x84eb('0x6'))['db'];var utils=require(_0x84eb('0x7'));var logger=require(_0x84eb('0x8'))(_0x84eb('0x9'));var config=require(_0x84eb('0xa'));var jayson=require(_0x84eb('0xb'));var client=jayson[_0x84eb('0xc')][_0x84eb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1c44ab,_0x3771e7,_0x37bc5c){return new BPromise(function(_0x562cb8,_0x4e2c9e){return client[_0x84eb('0xe')](_0x1c44ab,_0x37bc5c)[_0x84eb('0xf')](function(_0x662903){logger[_0x84eb('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x3771e7,_0x84eb('0x11'));logger[_0x84eb('0x12')](_0x84eb('0x13'),_0x3771e7,'request\x20sent',JSON[_0x84eb('0x14')](_0x662903));if(_0x662903[_0x84eb('0x15')]){if(_0x662903['error'][_0x84eb('0x16')]===0x1f4){logger[_0x84eb('0x15')](_0x84eb('0x17'),_0x3771e7,_0x662903[_0x84eb('0x15')][_0x84eb('0x18')]);return _0x4e2c9e(_0x662903[_0x84eb('0x15')][_0x84eb('0x18')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3771e7,_0x662903[_0x84eb('0x15')]['message']);return _0x562cb8(_0x662903[_0x84eb('0x15')][_0x84eb('0x18')]);}else{logger[_0x84eb('0x10')](_0x84eb('0x17'),_0x3771e7,_0x84eb('0x11'));_0x562cb8(_0x662903[_0x84eb('0x19')]['message']);}})[_0x84eb('0x1a')](function(_0xef513c){logger[_0x84eb('0x15')](_0x84eb('0x17'),_0x3771e7,_0xef513c);_0x4e2c9e(_0xef513c);});});}
\ No newline at end of file
index 804017c..cb02b27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f8=['/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x3003fc,_0x5ac5de){var _0x22cb43=function(_0x478661){while(--_0x478661){_0x3003fc['push'](_0x3003fc['shift']());}};_0x22cb43(++_0x5ac5de);}(_0x57f8,0x198));var _0x857f=function(_0x17bfa4,_0x3eb5f7){_0x17bfa4=_0x17bfa4-0x0;var _0x3d9ca8=_0x57f8[_0x17bfa4];return _0x3d9ca8;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['getConfigurations']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['getFields']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),controller[_0x857f('0x10')]);router[_0x857f('0xf')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller[_0x857f('0x11')]);router['put'](_0x857f('0xc'),auth[_0x857f('0xb')](),controller[_0x857f('0x12')]);router[_0x857f('0x13')](_0x857f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x857f('0x14')]=router;
\ No newline at end of file
+var _0x5423=['create','post','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x1d3030,_0x3f9c35){var _0x5b759b=function(_0x4d1161){while(--_0x4d1161){_0x1d3030['push'](_0x1d3030['shift']());}};_0x5b759b(++_0x3f9c35);}(_0x5423,0xe3));var _0x3542=function(_0x239e3d,_0x123151){_0x239e3d=_0x239e3d-0x0;var _0x44d278=_0x5423[_0x239e3d];return _0x44d278;};'use strict';var multer=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var path=require('path');var timeout=require(_0x3542('0x2'));var express=require(_0x3542('0x3'));var router=express['Router']();var fs_extra=require(_0x3542('0x4'));var auth=require(_0x3542('0x5'));var interaction=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x3542('0x8')]('/',auth[_0x3542('0x9')](),controller[_0x3542('0xa')]);router[_0x3542('0x8')](_0x3542('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3542('0x8')](_0x3542('0xc'),auth['isAuthenticated'](),controller[_0x3542('0xd')]);router[_0x3542('0x8')]('/:id/fields',auth[_0x3542('0x9')](),controller[_0x3542('0xe')]);router['post']('/',auth[_0x3542('0x9')](),controller[_0x3542('0xf')]);router[_0x3542('0x10')](_0x3542('0xc'),auth[_0x3542('0x9')](),controller[_0x3542('0x11')]);router[_0x3542('0x12')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller[_0x3542('0x13')]);router[_0x3542('0x14')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller['destroy']);module[_0x3542('0x15')]=router;
\ No newline at end of file
index 93a1cc7..9d67ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['username','exports','STRING'];(function(_0x4601f3,_0x4d2401){var _0x2afb49=function(_0x297f98){while(--_0x297f98){_0x4601f3['push'](_0x4601f3['shift']());}};_0x2afb49(++_0x4d2401);}(_0xfff0,0x139));var _0x0fff=function(_0x2073b4,_0x5a4f6a){_0x2073b4=_0x2073b4-0x0;var _0x4031b8=_0xfff0[_0x2073b4];return _0x4031b8;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')]},'description':{'type':Sequelize[_0x0fff('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0fff('0x2')},'apiKey':{'type':Sequelize[_0x0fff('0x1')]},'remoteUri':{'type':Sequelize[_0x0fff('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x47c5=['username','remoteUri','sequelize','exports','STRING'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x47c5,0x165));var _0x547c=function(_0x3b296d,_0x1c9045){_0x3b296d=_0x3b296d-0x0;var _0x166ef1=_0x47c5[_0x3b296d];return _0x166ef1;};'use strict';var Sequelize=require(_0x547c('0x0'));module[_0x547c('0x1')]={'name':{'type':Sequelize[_0x547c('0x2')]},'description':{'type':Sequelize[_0x547c('0x2')]},'username':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index b305d00..73dec85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8937=['attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','findOne','FreshsalesConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8937,0x95));var _0x7893=function(_0x51ee58,_0x891903){_0x51ee58=_0x51ee58-0x0;var _0x3b4208=_0x8937[_0x51ee58];return _0x3b4208;};'use strict';var emlformat=require(_0x7893('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7893('0x1'));var jsonpatch=require(_0x7893('0x2'));var rp=require(_0x7893('0x3'));var moment=require(_0x7893('0x4'));var BPromise=require(_0x7893('0x5'));var Mustache=require(_0x7893('0x6'));var util=require(_0x7893('0x7'));var path=require(_0x7893('0x8'));var sox=require(_0x7893('0x9'));var csv=require(_0x7893('0xa'));var ejs=require(_0x7893('0xb'));var fs=require('fs');var fs_extra=require(_0x7893('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7893('0xd'));var jsforce=require(_0x7893('0xe'));var deskjs=require(_0x7893('0xf'));var toCsv=require(_0x7893('0xa'));var querystring=require(_0x7893('0x10'));var Papa=require('papaparse');var Redis=require(_0x7893('0x11'));var authService=require(_0x7893('0x12'));var qs=require(_0x7893('0x13'));var as=require(_0x7893('0x14'));var hardwareService=require(_0x7893('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7893('0x16'));var config=require(_0x7893('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7893('0x18'))['db'];var integrations=require(_0x7893('0x19'));function respondWithStatusCode(_0x457375,_0x3fea01){_0x3fea01=_0x3fea01||0xcc;return function(_0x5b91c5){if(_0x5b91c5){return _0x457375['sendStatus'](_0x3fea01);}return _0x457375[_0x7893('0x1a')](_0x3fea01)[_0x7893('0x1b')]();};}function respondWithResult(_0x110dfb,_0x4b1f07){_0x4b1f07=_0x4b1f07||0xc8;return function(_0x18f6f4){if(_0x18f6f4){return _0x110dfb['status'](_0x4b1f07)[_0x7893('0x1c')](_0x18f6f4);}};}function respondWithFilteredResult(_0x177258,_0x54a819){return function(_0x530814){if(_0x530814){var _0x34d6c0=typeof _0x54a819['offset']==='undefined'&&typeof _0x54a819[_0x7893('0x1d')]===_0x7893('0x1e');var _0x237b28=_0x530814[_0x7893('0x1f')];var _0x187fec=_0x34d6c0?0x0:_0x54a819['offset'];var _0x48c1ea=_0x34d6c0?_0x530814[_0x7893('0x1f')]:_0x54a819['offset']+_0x54a819['limit'];var _0x295f9a;if(_0x48c1ea>=_0x237b28){_0x48c1ea=_0x237b28;_0x295f9a=0xc8;}else{_0x295f9a=0xce;}_0x177258[_0x7893('0x1a')](_0x295f9a);return _0x177258[_0x7893('0x20')](_0x7893('0x21'),_0x187fec+'-'+_0x48c1ea+'/'+_0x237b28)['json'](_0x530814);}return null;};}function patchUpdates(_0x596304){return function(_0x205059){try{jsonpatch['apply'](_0x205059,_0x596304,!![]);}catch(_0x23770b){return BPromise[_0x7893('0x22')](_0x23770b);}return _0x205059[_0x7893('0x23')]();};}function saveUpdates(_0x5c702f,_0x1f7a54){return function(_0x501ea9){if(_0x501ea9){return _0x501ea9['update'](_0x5c702f)[_0x7893('0x24')](function(_0x6c1738){return _0x6c1738;});}return null;};}function removeEntity(_0x13f211,_0x56bdd5){return function(_0x49e07b){if(_0x49e07b){return _0x49e07b[_0x7893('0x25')]()[_0x7893('0x24')](function(){_0x13f211['status'](0xcc)[_0x7893('0x1b')]();});}};}function handleEntityNotFound(_0x31b66c,_0x41385e){return function(_0xe6e672){if(!_0xe6e672){_0x31b66c[_0x7893('0x26')](0x194);}return _0xe6e672;};}function handleError(_0x52f40b,_0x5b68e3){_0x5b68e3=_0x5b68e3||0x1f4;return function(_0x360788){logger['error'](_0x360788[_0x7893('0x27')]);if(_0x360788[_0x7893('0x28')]){delete _0x360788[_0x7893('0x28')];}_0x52f40b[_0x7893('0x1a')](_0x5b68e3)[_0x7893('0x29')](_0x360788);};}exports[_0x7893('0x2a')]=function(_0x31029a,_0x1ffe23){var _0x6e1013={},_0x2dad02={},_0x5e6793={'count':0x0,'rows':[]};var _0x4d8f10=_[_0x7893('0x2b')](db[_0x7893('0x2c')][_0x7893('0x2d')],function(_0x5b6589){return{'name':_0x5b6589[_0x7893('0x2e')],'type':_0x5b6589[_0x7893('0x2f')]['key']};});_0x2dad02[_0x7893('0x30')]=_['map'](_0x4d8f10,_0x7893('0x28'));_0x2dad02[_0x7893('0x31')]=_[_0x7893('0x32')](_0x31029a[_0x7893('0x31')]);_0x2dad02[_0x7893('0x33')]=_[_0x7893('0x34')](_0x2dad02[_0x7893('0x30')],_0x2dad02[_0x7893('0x31')]);_0x6e1013[_0x7893('0x35')]=_[_0x7893('0x34')](_0x2dad02[_0x7893('0x30')],qs[_0x7893('0x36')](_0x31029a['query'][_0x7893('0x36')]));_0x6e1013[_0x7893('0x35')]=_0x6e1013[_0x7893('0x35')][_0x7893('0x37')]?_0x6e1013[_0x7893('0x35')]:_0x2dad02['model'];if(!_0x31029a[_0x7893('0x31')]['hasOwnProperty'](_0x7893('0x38'))){_0x6e1013[_0x7893('0x1d')]=qs[_0x7893('0x1d')](_0x31029a['query'][_0x7893('0x1d')]);_0x6e1013[_0x7893('0x39')]=qs[_0x7893('0x39')](_0x31029a[_0x7893('0x31')][_0x7893('0x39')]);}_0x6e1013[_0x7893('0x3a')]=qs[_0x7893('0x3b')](_0x31029a['query'][_0x7893('0x3b')]);_0x6e1013[_0x7893('0x3c')]=qs['filters'](_[_0x7893('0x3d')](_0x31029a[_0x7893('0x31')],_0x2dad02[_0x7893('0x33')]),_0x4d8f10);if(_0x31029a[_0x7893('0x31')]['filter']){_0x6e1013[_0x7893('0x3c')]=_['merge'](_0x6e1013[_0x7893('0x3c')],{'$or':_[_0x7893('0x2b')](_0x4d8f10,function(_0x59a735){if(_0x59a735[_0x7893('0x2f')]!=='VIRTUAL'){var _0x55383e={};_0x55383e[_0x59a735[_0x7893('0x28')]]={'$like':'%'+_0x31029a[_0x7893('0x31')][_0x7893('0x3e')]+'%'};return _0x55383e;}})});}_0x6e1013=_[_0x7893('0x3f')]({},_0x6e1013,_0x31029a['options']);var _0xfc7c1={'where':_0x6e1013[_0x7893('0x3c')]};return db[_0x7893('0x2c')][_0x7893('0x1f')](_0xfc7c1)[_0x7893('0x24')](function(_0x58da57){_0x5e6793[_0x7893('0x1f')]=_0x58da57;if(_0x31029a[_0x7893('0x31')][_0x7893('0x40')]){_0x6e1013[_0x7893('0x41')]=[{'all':!![]}];}return db[_0x7893('0x2c')][_0x7893('0x42')](_0x6e1013);})['then'](function(_0x52aa13){_0x5e6793['rows']=_0x52aa13;return _0x5e6793;})[_0x7893('0x24')](respondWithFilteredResult(_0x1ffe23,_0x6e1013))[_0x7893('0x43')](handleError(_0x1ffe23,null));};exports[_0x7893('0x44')]=function(_0x5a4581,_0x88fa26){var _0x2461fa={'raw':![],'where':{'id':_0x5a4581[_0x7893('0x45')]['id']}},_0x27d838={};_0x27d838['model']=_[_0x7893('0x32')](db[_0x7893('0x2c')]['rawAttributes']);_0x27d838['query']=_['keys'](_0x5a4581['query']);_0x27d838[_0x7893('0x33')]=_[_0x7893('0x34')](_0x27d838[_0x7893('0x30')],_0x27d838['query']);_0x2461fa[_0x7893('0x35')]=_[_0x7893('0x34')](_0x27d838[_0x7893('0x30')],qs[_0x7893('0x36')](_0x5a4581[_0x7893('0x31')][_0x7893('0x36')]));_0x2461fa[_0x7893('0x35')]=_0x2461fa[_0x7893('0x35')][_0x7893('0x37')]?_0x2461fa[_0x7893('0x35')]:_0x27d838[_0x7893('0x30')];if(_0x5a4581[_0x7893('0x31')][_0x7893('0x40')]){_0x2461fa[_0x7893('0x41')]=[{'all':!![]}];}_0x2461fa=_[_0x7893('0x3f')]({},_0x2461fa,_0x5a4581[_0x7893('0x46')]);return db[_0x7893('0x2c')][_0x7893('0x47')](_0x2461fa)['then'](handleEntityNotFound(_0x88fa26,null))[_0x7893('0x24')](respondWithResult(_0x88fa26,null))['catch'](handleError(_0x88fa26,null));};exports['create']=function(_0x5c6d68,_0x4448b5){return db[_0x7893('0x2c')][_0x7893('0x48')](_0x5c6d68['body'],{})['then'](respondWithResult(_0x4448b5,0xc9))['catch'](handleError(_0x4448b5,null));};exports['update']=function(_0x5a5b35,_0x44556f){if(_0x5a5b35[_0x7893('0x49')]['id']){delete _0x5a5b35[_0x7893('0x49')]['id'];}return db['FreshsalesAccount'][_0x7893('0x47')]({'where':{'id':_0x5a5b35[_0x7893('0x45')]['id']}})[_0x7893('0x24')](handleEntityNotFound(_0x44556f,null))['then'](saveUpdates(_0x5a5b35[_0x7893('0x49')],null))['then'](respondWithResult(_0x44556f,null))[_0x7893('0x43')](handleError(_0x44556f,null));};exports[_0x7893('0x25')]=function(_0xa1f139,_0xec5fd8){return db[_0x7893('0x2c')]['find']({'where':{'id':_0xa1f139[_0x7893('0x45')]['id']}})['then'](handleEntityNotFound(_0xec5fd8,null))[_0x7893('0x24')](removeEntity(_0xec5fd8,null))[_0x7893('0x43')](handleError(_0xec5fd8,null));};exports['getConfigurations']=function(_0x3855b3,_0x3418ef,_0x124234){var _0x32a899={};var _0xd3d314={};var _0x142b5e;var _0x3d883e;return db[_0x7893('0x2c')][_0x7893('0x4a')]({'where':{'id':_0x3855b3[_0x7893('0x45')]['id']}})[_0x7893('0x24')](handleEntityNotFound(_0x3418ef,null))[_0x7893('0x24')](function(_0xcdf4d6){if(_0xcdf4d6){_0x142b5e=_0xcdf4d6;_0xd3d314[_0x7893('0x30')]=_[_0x7893('0x32')](db[_0x7893('0x4b')][_0x7893('0x2d')]);_0xd3d314[_0x7893('0x31')]=_[_0x7893('0x32')](_0x3855b3[_0x7893('0x31')]);_0xd3d314[_0x7893('0x33')]=_[_0x7893('0x34')](_0xd3d314[_0x7893('0x30')],_0xd3d314[_0x7893('0x31')]);_0x32a899[_0x7893('0x35')]=_[_0x7893('0x34')](_0xd3d314['model'],qs[_0x7893('0x36')](_0x3855b3['query']['fields']));_0x32a899[_0x7893('0x35')]=_0x32a899['attributes'][_0x7893('0x37')]?_0x32a899['attributes']:_0xd3d314[_0x7893('0x30')];_0x32a899[_0x7893('0x3a')]=qs[_0x7893('0x3b')](_0x3855b3[_0x7893('0x31')]['sort']);_0x32a899[_0x7893('0x3c')]=qs[_0x7893('0x33')](_[_0x7893('0x3d')](_0x3855b3['query'],_0xd3d314[_0x7893('0x33')]));if(_0x3855b3[_0x7893('0x31')][_0x7893('0x3e')]){_0x32a899[_0x7893('0x3c')]=_[_0x7893('0x3f')](_0x32a899['where'],{'$or':_['map'](_0x32a899[_0x7893('0x35')],function(_0x9ada79){var _0x214fbd={};_0x214fbd[_0x9ada79]={'$like':'%'+_0x3855b3['query'][_0x7893('0x3e')]+'%'};return _0x214fbd;})});}_0x32a899=_['merge']({},_0x32a899,_0x3855b3[_0x7893('0x46')]);return _0x142b5e[_0x7893('0x4c')](_0x32a899);}})[_0x7893('0x24')](function(_0x31ce87){if(_0x31ce87){_0x3d883e=_0x31ce87[_0x7893('0x37')];if(!_0x3855b3['query'][_0x7893('0x4d')]('nolimit')){_0x32a899[_0x7893('0x1d')]=qs[_0x7893('0x1d')](_0x3855b3[_0x7893('0x31')][_0x7893('0x1d')]);_0x32a899[_0x7893('0x39')]=qs[_0x7893('0x39')](_0x3855b3[_0x7893('0x31')][_0x7893('0x39')]);}return _0x142b5e[_0x7893('0x4c')](_0x32a899);}})[_0x7893('0x24')](function(_0x2bf74c){if(_0x2bf74c){return _0x2bf74c?{'count':_0x3d883e,'rows':_0x2bf74c}:null;}})['then'](respondWithResult(_0x3418ef,null))['catch'](handleError(_0x3418ef,null));};exports[_0x7893('0x4e')]=function(_0xaf3091,_0x4bf56b,_0x25d664){if(_0xaf3091['body']['id']){delete _0xaf3091[_0x7893('0x49')]['id'];}return db[_0x7893('0x2c')][_0x7893('0x4a')]({'where':{'id':_0xaf3091[_0x7893('0x45')]['id']}})[_0x7893('0x24')](handleEntityNotFound(_0x4bf56b,null))['then'](function(_0x3d9672){if(_0x3d9672){_0xaf3091[_0x7893('0x49')][_0x7893('0x4f')]=_0x3d9672['id'];_0xaf3091[_0x7893('0x49')][_0x7893('0x50')]=integrations[_0x7893('0x51')](_0xaf3091[_0x7893('0x49')][_0x7893('0x52')],_0xaf3091[_0x7893('0x49')][_0x7893('0x2f')]);_0xaf3091['body'][_0x7893('0x53')]=integrations[_0x7893('0x54')](_0xaf3091['body'][_0x7893('0x52')],_0xaf3091[_0x7893('0x49')]['type']);return db[_0x7893('0x4b')][_0x7893('0x48')](_0xaf3091[_0x7893('0x49')],{'include':[{'model':db[_0x7893('0x55')],'as':_0x7893('0x50')},{'model':db[_0x7893('0x55')],'as':'Descriptions'}]});}return null;})[_0x7893('0x24')](respondWithResult(_0x4bf56b,null))[_0x7893('0x43')](handleError(_0x4bf56b,null));};exports['getFields']=function(_0x1fbd1d,_0x5b4aa6,_0x5dfab3){var _0xdfab6='';var _0x42adc1='';return db[_0x7893('0x2c')]['findOne']({'where':{'id':_0x1fbd1d[_0x7893('0x45')]['id']},'attributes':['id',_0x7893('0x56'),_0x7893('0x57'),_0x7893('0x58')]})[_0x7893('0x24')](handleEntityNotFound(_0x5b4aa6,null))[_0x7893('0x24')](function(_0x568f2c){if(_0x568f2c){_0x42adc1=_0x568f2c[_0x7893('0x56')];_0xdfab6=_0x568f2c[_0x7893('0x57')];var _0x526d13=_0x568f2c['remoteUri'][_0x7893('0x59')](-0x1);if(_0x526d13==='/'){_0xdfab6=_0xdfab6[_0x7893('0x5a')](0x0,_0xdfab6[_0x7893('0x5b')](_0x526d13));}return rp({'method':_0x7893('0x5c'),'uri':util[_0x7893('0x5d')](_0x7893('0x5e'),_0xdfab6,_0x7893('0x5f')),'headers':{'Authorization':_0x7893('0x60')+_0x568f2c[_0x7893('0x58')]},'json':!![]});}})['then'](function(_0x2800ab){if(_0x2800ab){var _0xe49ca4=_0x2800ab['users'];var _0x4c910e=![];var _0x119865=null;for(_0x119865=0x0;_0x119865<_0xe49ca4[_0x7893('0x37')];_0x119865++){if(_0xe49ca4[_0x119865][_0x7893('0x61')]===_0x42adc1){_0x4c910e=!![];}}if(_0x4c910e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x7893('0x24')](respondWithResult(_0x5b4aa6,null))[_0x7893('0x43')](function(_0x1c5b8e){var _0x41ddb9=_0x1fbd1d[_0x7893('0x31')][_0x7893('0x62')]?0x1f4:_0x1c5b8e[_0x7893('0x63')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x41ddb9,JSON['stringify'](_0x1c5b8e));delete _0x1c5b8e[_0x7893('0x28')];if(_0x41ddb9===0x191){_0x41ddb9=0x190;}_0x5b4aa6['status'](_0x41ddb9)['send'](_0x1fbd1d[_0x7893('0x31')]['test']?{'message':_0x7893('0x64'),'statusCode':_0x1c5b8e[_0x7893('0x63')]}:_0x1c5b8e);});};
\ No newline at end of file
+var _0x4975=['type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','filters','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','sort','pick','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshsalesField','Descriptions','getFields','username','apiKey','remoteUri','slice','GET','format','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','util','path','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','FreshsalesAccount','fieldName'];(function(_0x34ac63,_0x40f4da){var _0x44aee2=function(_0x5a1140){while(--_0x5a1140){_0x34ac63['push'](_0x34ac63['shift']());}};_0x44aee2(++_0x40f4da);}(_0x4975,0x1d1));var _0x5497=function(_0x106f9f,_0x29c655){_0x106f9f=_0x106f9f-0x0;var _0x4d553b=_0x4975[_0x106f9f];return _0x4d553b;};'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('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5497('0x4'));var path=require(_0x5497('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0x6'));var _=require(_0x5497('0x7'));var squel=require('squel');var crypto=require(_0x5497('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5497('0x9'));var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xb'));var Redis=require(_0x5497('0xc'));var authService=require(_0x5497('0xd'));var qs=require(_0x5497('0xe'));var as=require(_0x5497('0xf'));var hardwareService=require(_0x5497('0x10'));var logger=require(_0x5497('0x11'))(_0x5497('0x12'));var utils=require(_0x5497('0x13'));var config=require(_0x5497('0x14'));var licenseUtil=require(_0x5497('0x15'));var db=require(_0x5497('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x6fbf3b,_0x4adf35){_0x4adf35=_0x4adf35||0xcc;return function(_0x974702){if(_0x974702){return _0x6fbf3b[_0x5497('0x17')](_0x4adf35);}return _0x6fbf3b[_0x5497('0x18')](_0x4adf35)[_0x5497('0x19')]();};}function respondWithResult(_0x462836,_0x47ccc2){_0x47ccc2=_0x47ccc2||0xc8;return function(_0x5ac51d){if(_0x5ac51d){return _0x462836[_0x5497('0x18')](_0x47ccc2)[_0x5497('0x1a')](_0x5ac51d);}};}function respondWithFilteredResult(_0x2443ce,_0x296d4d){return function(_0x454c23){if(_0x454c23){var _0x3bcf95=typeof _0x296d4d['offset']===_0x5497('0x1b')&&typeof _0x296d4d[_0x5497('0x1c')]==='undefined';var _0x702e7c=_0x454c23[_0x5497('0x1d')];var _0x161ff7=_0x3bcf95?0x0:_0x296d4d[_0x5497('0x1e')];var _0x136865=_0x3bcf95?_0x454c23[_0x5497('0x1d')]:_0x296d4d['offset']+_0x296d4d[_0x5497('0x1c')];var _0x1c70bb;if(_0x136865>=_0x702e7c){_0x136865=_0x702e7c;_0x1c70bb=0xc8;}else{_0x1c70bb=0xce;}_0x2443ce[_0x5497('0x18')](_0x1c70bb);return _0x2443ce[_0x5497('0x1f')](_0x5497('0x20'),_0x161ff7+'-'+_0x136865+'/'+_0x702e7c)[_0x5497('0x1a')](_0x454c23);}return null;};}function patchUpdates(_0x1c6cd3){return function(_0x4e78d3){try{jsonpatch[_0x5497('0x21')](_0x4e78d3,_0x1c6cd3,!![]);}catch(_0x4d2259){return BPromise[_0x5497('0x22')](_0x4d2259);}return _0x4e78d3[_0x5497('0x23')]();};}function saveUpdates(_0x2c7c5f,_0x2acd06){return function(_0x205a4b){if(_0x205a4b){return _0x205a4b[_0x5497('0x24')](_0x2c7c5f)[_0x5497('0x25')](function(_0x36683c){return _0x36683c;});}return null;};}function removeEntity(_0x5005b7,_0x3b0edb){return function(_0x2f4881){if(_0x2f4881){return _0x2f4881[_0x5497('0x26')]()[_0x5497('0x25')](function(){_0x5005b7['status'](0xcc)[_0x5497('0x19')]();});}};}function handleEntityNotFound(_0x7bc478,_0x4bba1e){return function(_0x308ccf){if(!_0x308ccf){_0x7bc478[_0x5497('0x17')](0x194);}return _0x308ccf;};}function handleError(_0x14aef5,_0x23d03){_0x23d03=_0x23d03||0x1f4;return function(_0x5ebb24){logger[_0x5497('0x27')](_0x5ebb24['stack']);if(_0x5ebb24[_0x5497('0x28')]){delete _0x5ebb24[_0x5497('0x28')];}_0x14aef5['status'](_0x23d03)['send'](_0x5ebb24);};}exports[_0x5497('0x29')]=function(_0x455a43,_0x58b893){var _0x180815={},_0x4fed6c={},_0x2b4aef={'count':0x0,'rows':[]};var _0x37b43f=_[_0x5497('0x2a')](db[_0x5497('0x2b')]['rawAttributes'],function(_0x1c4a32){return{'name':_0x1c4a32[_0x5497('0x2c')],'type':_0x1c4a32[_0x5497('0x2d')][_0x5497('0x2e')]};});_0x4fed6c['model']=_['map'](_0x37b43f,'name');_0x4fed6c[_0x5497('0x2f')]=_[_0x5497('0x30')](_0x455a43['query']);_0x4fed6c['filters']=_[_0x5497('0x31')](_0x4fed6c[_0x5497('0x32')],_0x4fed6c[_0x5497('0x2f')]);_0x180815[_0x5497('0x33')]=_['intersection'](_0x4fed6c[_0x5497('0x32')],qs[_0x5497('0x34')](_0x455a43[_0x5497('0x2f')][_0x5497('0x34')]));_0x180815['attributes']=_0x180815['attributes'][_0x5497('0x35')]?_0x180815[_0x5497('0x33')]:_0x4fed6c[_0x5497('0x32')];if(!_0x455a43[_0x5497('0x2f')][_0x5497('0x36')](_0x5497('0x37'))){_0x180815['limit']=qs['limit'](_0x455a43['query'][_0x5497('0x1c')]);_0x180815['offset']=qs[_0x5497('0x1e')](_0x455a43['query'][_0x5497('0x1e')]);}_0x180815[_0x5497('0x38')]=qs['sort'](_0x455a43[_0x5497('0x2f')]['sort']);_0x180815['where']=qs[_0x5497('0x39')](_['pick'](_0x455a43['query'],_0x4fed6c[_0x5497('0x39')]),_0x37b43f);if(_0x455a43[_0x5497('0x2f')]['filter']){_0x180815[_0x5497('0x3a')]=_['merge'](_0x180815[_0x5497('0x3a')],{'$or':_['map'](_0x37b43f,function(_0x296e96){if(_0x296e96['type']!==_0x5497('0x3b')){var _0x4832f5={};_0x4832f5[_0x296e96[_0x5497('0x28')]]={'$like':'%'+_0x455a43[_0x5497('0x2f')][_0x5497('0x3c')]+'%'};return _0x4832f5;}})});}_0x180815=_[_0x5497('0x3d')]({},_0x180815,_0x455a43[_0x5497('0x3e')]);var _0x16bc47={'where':_0x180815[_0x5497('0x3a')]};return db[_0x5497('0x2b')][_0x5497('0x1d')](_0x16bc47)['then'](function(_0x195e14){_0x2b4aef[_0x5497('0x1d')]=_0x195e14;if(_0x455a43[_0x5497('0x2f')]['includeAll']){_0x180815[_0x5497('0x3f')]=[{'all':!![]}];}return db[_0x5497('0x2b')][_0x5497('0x40')](_0x180815);})[_0x5497('0x25')](function(_0x48286a){_0x2b4aef[_0x5497('0x41')]=_0x48286a;return _0x2b4aef;})['then'](respondWithFilteredResult(_0x58b893,_0x180815))[_0x5497('0x42')](handleError(_0x58b893,null));};exports[_0x5497('0x43')]=function(_0x30e1a5,_0x10e32a){var _0x308c1a={'raw':![],'where':{'id':_0x30e1a5['params']['id']}},_0x38fbac={};_0x38fbac['model']=_[_0x5497('0x30')](db[_0x5497('0x2b')][_0x5497('0x44')]);_0x38fbac[_0x5497('0x2f')]=_[_0x5497('0x30')](_0x30e1a5[_0x5497('0x2f')]);_0x38fbac[_0x5497('0x39')]=_['intersection'](_0x38fbac[_0x5497('0x32')],_0x38fbac[_0x5497('0x2f')]);_0x308c1a['attributes']=_['intersection'](_0x38fbac['model'],qs['fields'](_0x30e1a5[_0x5497('0x2f')][_0x5497('0x34')]));_0x308c1a[_0x5497('0x33')]=_0x308c1a[_0x5497('0x33')][_0x5497('0x35')]?_0x308c1a[_0x5497('0x33')]:_0x38fbac[_0x5497('0x32')];if(_0x30e1a5[_0x5497('0x2f')][_0x5497('0x45')]){_0x308c1a[_0x5497('0x3f')]=[{'all':!![]}];}_0x308c1a=_['merge']({},_0x308c1a,_0x30e1a5[_0x5497('0x3e')]);return db[_0x5497('0x2b')][_0x5497('0x46')](_0x308c1a)[_0x5497('0x25')](handleEntityNotFound(_0x10e32a,null))[_0x5497('0x25')](respondWithResult(_0x10e32a,null))[_0x5497('0x42')](handleError(_0x10e32a,null));};exports[_0x5497('0x47')]=function(_0x48fe93,_0x53c5e2){return db[_0x5497('0x2b')][_0x5497('0x47')](_0x48fe93[_0x5497('0x48')],{})[_0x5497('0x25')](respondWithResult(_0x53c5e2,0xc9))[_0x5497('0x42')](handleError(_0x53c5e2,null));};exports[_0x5497('0x24')]=function(_0x11b0b9,_0x91b12c){if(_0x11b0b9[_0x5497('0x48')]['id']){delete _0x11b0b9['body']['id'];}return db[_0x5497('0x2b')]['find']({'where':{'id':_0x11b0b9[_0x5497('0x49')]['id']}})['then'](handleEntityNotFound(_0x91b12c,null))['then'](saveUpdates(_0x11b0b9['body'],null))[_0x5497('0x25')](respondWithResult(_0x91b12c,null))[_0x5497('0x42')](handleError(_0x91b12c,null));};exports[_0x5497('0x26')]=function(_0x5240b4,_0x392a04){return db[_0x5497('0x2b')][_0x5497('0x46')]({'where':{'id':_0x5240b4[_0x5497('0x49')]['id']}})[_0x5497('0x25')](handleEntityNotFound(_0x392a04,null))[_0x5497('0x25')](removeEntity(_0x392a04,null))['catch'](handleError(_0x392a04,null));};exports[_0x5497('0x4a')]=function(_0x2e3fed,_0x25a493,_0x1f2a7f){var _0x215b5a={};var _0x222d00={};var _0x5c4dec;var _0x428c3f;return db[_0x5497('0x2b')][_0x5497('0x4b')]({'where':{'id':_0x2e3fed[_0x5497('0x49')]['id']}})[_0x5497('0x25')](handleEntityNotFound(_0x25a493,null))[_0x5497('0x25')](function(_0x48737f){if(_0x48737f){_0x5c4dec=_0x48737f;_0x222d00[_0x5497('0x32')]=_['keys'](db[_0x5497('0x4c')][_0x5497('0x44')]);_0x222d00[_0x5497('0x2f')]=_[_0x5497('0x30')](_0x2e3fed[_0x5497('0x2f')]);_0x222d00['filters']=_[_0x5497('0x31')](_0x222d00['model'],_0x222d00[_0x5497('0x2f')]);_0x215b5a[_0x5497('0x33')]=_['intersection'](_0x222d00['model'],qs[_0x5497('0x34')](_0x2e3fed['query'][_0x5497('0x34')]));_0x215b5a[_0x5497('0x33')]=_0x215b5a[_0x5497('0x33')]['length']?_0x215b5a[_0x5497('0x33')]:_0x222d00[_0x5497('0x32')];_0x215b5a[_0x5497('0x38')]=qs['sort'](_0x2e3fed[_0x5497('0x2f')][_0x5497('0x4d')]);_0x215b5a[_0x5497('0x3a')]=qs[_0x5497('0x39')](_[_0x5497('0x4e')](_0x2e3fed[_0x5497('0x2f')],_0x222d00[_0x5497('0x39')]));if(_0x2e3fed['query'][_0x5497('0x3c')]){_0x215b5a[_0x5497('0x3a')]=_[_0x5497('0x3d')](_0x215b5a['where'],{'$or':_['map'](_0x215b5a[_0x5497('0x33')],function(_0x382332){var _0x2b38ca={};_0x2b38ca[_0x382332]={'$like':'%'+_0x2e3fed[_0x5497('0x2f')]['filter']+'%'};return _0x2b38ca;})});}_0x215b5a=_[_0x5497('0x3d')]({},_0x215b5a,_0x2e3fed['options']);return _0x5c4dec[_0x5497('0x4a')](_0x215b5a);}})['then'](function(_0x276127){if(_0x276127){_0x428c3f=_0x276127[_0x5497('0x35')];if(!_0x2e3fed[_0x5497('0x2f')][_0x5497('0x36')](_0x5497('0x37'))){_0x215b5a['limit']=qs[_0x5497('0x1c')](_0x2e3fed[_0x5497('0x2f')]['limit']);_0x215b5a[_0x5497('0x1e')]=qs['offset'](_0x2e3fed[_0x5497('0x2f')][_0x5497('0x1e')]);}return _0x5c4dec[_0x5497('0x4a')](_0x215b5a);}})[_0x5497('0x25')](function(_0x319dc1){if(_0x319dc1){return _0x319dc1?{'count':_0x428c3f,'rows':_0x319dc1}:null;}})['then'](respondWithResult(_0x25a493,null))['catch'](handleError(_0x25a493,null));};exports[_0x5497('0x4f')]=function(_0x46b9b3,_0x398f87,_0x169f81){if(_0x46b9b3[_0x5497('0x48')]['id']){delete _0x46b9b3[_0x5497('0x48')]['id'];}return db['FreshsalesAccount'][_0x5497('0x4b')]({'where':{'id':_0x46b9b3['params']['id']}})[_0x5497('0x25')](handleEntityNotFound(_0x398f87,null))[_0x5497('0x25')](function(_0x443c5e){if(_0x443c5e){_0x46b9b3[_0x5497('0x48')][_0x5497('0x50')]=_0x443c5e['id'];_0x46b9b3[_0x5497('0x48')][_0x5497('0x51')]=integrations[_0x5497('0x52')](_0x46b9b3['body']['channel'],_0x46b9b3['body'][_0x5497('0x2d')]);_0x46b9b3[_0x5497('0x48')]['Descriptions']=integrations[_0x5497('0x53')](_0x46b9b3[_0x5497('0x48')]['channel'],_0x46b9b3[_0x5497('0x48')][_0x5497('0x2d')]);return db['FreshsalesConfiguration'][_0x5497('0x47')](_0x46b9b3['body'],{'include':[{'model':db[_0x5497('0x54')],'as':_0x5497('0x51')},{'model':db[_0x5497('0x54')],'as':_0x5497('0x55')}]});}return null;})[_0x5497('0x25')](respondWithResult(_0x398f87,null))[_0x5497('0x42')](handleError(_0x398f87,null));};exports[_0x5497('0x56')]=function(_0x122f95,_0x19c400,_0x13f6cd){var _0x24536e='';var _0x146faf='';return db[_0x5497('0x2b')][_0x5497('0x4b')]({'where':{'id':_0x122f95['params']['id']},'attributes':['id',_0x5497('0x57'),'remoteUri',_0x5497('0x58')]})[_0x5497('0x25')](handleEntityNotFound(_0x19c400,null))[_0x5497('0x25')](function(_0x3fe2f2){if(_0x3fe2f2){_0x146faf=_0x3fe2f2[_0x5497('0x57')];_0x24536e=_0x3fe2f2[_0x5497('0x59')];var _0x34b792=_0x3fe2f2['remoteUri'][_0x5497('0x5a')](-0x1);if(_0x34b792==='/'){_0x24536e=_0x24536e['substring'](0x0,_0x24536e['lastIndexOf'](_0x34b792));}return rp({'method':_0x5497('0x5b'),'uri':util[_0x5497('0x5c')]('%s%s',_0x24536e,_0x5497('0x5d')),'headers':{'Authorization':'Token\x20token='+_0x3fe2f2[_0x5497('0x58')]},'json':!![]});}})[_0x5497('0x25')](function(_0x59f8dc){if(_0x59f8dc){var _0x54858b=_0x59f8dc[_0x5497('0x5e')];var _0xfde992=![];var _0x42a4a0=null;for(_0x42a4a0=0x0;_0x42a4a0<_0x54858b[_0x5497('0x35')];_0x42a4a0++){if(_0x54858b[_0x42a4a0][_0x5497('0x5f')]===_0x146faf){_0xfde992=!![];}}if(_0xfde992){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5497('0x60')});}}})[_0x5497('0x25')](respondWithResult(_0x19c400,null))[_0x5497('0x42')](function(_0x58ae80){var _0x22d70b=_0x122f95[_0x5497('0x2f')][_0x5497('0x61')]?0x1f4:_0x58ae80[_0x5497('0x62')]||0x1f4;logger['error'](_0x5497('0x63'),_0x5497('0x56'),_0x22d70b,JSON['stringify'](_0x58ae80));delete _0x58ae80[_0x5497('0x28')];if(_0x22d70b===0x191){_0x22d70b=0x190;}_0x19c400[_0x5497('0x18')](_0x22d70b)[_0x5497('0x64')](_0x122f95[_0x5497('0x2f')][_0x5497('0x61')]?{'message':_0x5497('0x65'),'statusCode':_0x58ae80['statusCode']}:_0x58ae80);});};
\ No newline at end of file
index e7a651a..6548d27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','request-promise'];(function(_0x59cd48,_0x48be43){var _0x55de1d=function(_0x8f3023){while(--_0x8f3023){_0x59cd48['push'](_0x59cd48['shift']());}};_0x55de1d(++_0x48be43);}(_0xed1c,0xe4));var _0xced1=function(_0x352bef,_0x347475){_0x352bef=_0x352bef-0x0;var _0x34e71a=_0xed1c[_0x352bef];return _0x34e71a;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));var integrations=require(_0xced1('0x6'));module[_0xced1('0x7')]=function(_0x37b22b,_0x59399e){return _0x37b22b[_0xced1('0x8')](_0xced1('0x9'),attributes,{'tableName':_0xced1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0120=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x434fe6,_0x4523c6){var _0x4452b4=function(_0xe51044){while(--_0xe51044){_0x434fe6['push'](_0x434fe6['shift']());}};_0x4452b4(++_0x4523c6);}(_0x0120,0x6f));var _0x0012=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0120[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));var integrations=require(_0x0012('0xb'));module['exports']=function(_0x4b396c,_0x59980a){return _0x4b396c[_0x0012('0xc')](_0x0012('0xd'),attributes,{'tableName':_0x0012('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6c49bee..aa260d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowFreshsalesAccount','FreshsalesAccount','find','util','bluebird'];(function(_0x2faa85,_0x92786a){var _0x2ea119=function(_0x5e2ee8){while(--_0x5e2ee8){_0x2faa85['push'](_0x2faa85['shift']());}};_0x2ea119(++_0x92786a);}(_0xadb5,0xad));var _0x5adb=function(_0x591b42,_0x29758d){_0x591b42=_0x591b42-0x0;var _0x50dbb6=_0xadb5[_0x591b42];return _0x50dbb6;};'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']('FreshsalesAccount,\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['FreshsalesAccount'][_0x5adb('0x16')]({'raw':_0x529b65['options']?_0x529b65['options'][_0x5adb('0x17')]===undefined?!![]:![]:!![],'where':_0x529b65[_0x5adb('0x18')]?_0x529b65[_0x5adb('0x18')][_0x5adb('0x19')]||null:null,'attributes':_0x529b65[_0x5adb('0x18')]?_0x529b65['options'][_0x5adb('0x1a')]||null:null,'limit':_0x529b65['options']?_0x529b65['options'][_0x5adb('0x1b')]||null:null,'include':_0x529b65[_0x5adb('0x18')]?_0x529b65[_0x5adb('0x18')][_0x5adb('0x1c')]?_[_0x5adb('0x1d')](_0x529b65[_0x5adb('0x18')][_0x5adb('0x1c')],function(_0x4ca150){return{'model':db[_0x4ca150[_0x5adb('0x1e')]],'as':_0x4ca150['as'],'attributes':_0x4ca150[_0x5adb('0x1a')],'include':_0x4ca150[_0x5adb('0x1c')]?_[_0x5adb('0x1d')](_0x4ca150[_0x5adb('0x1c')],function(_0x49f203){return{'model':db[_0x49f203[_0x5adb('0x1e')]],'as':_0x49f203['as'],'attributes':_0x49f203[_0x5adb('0x1a')],'include':_0x49f203['include']?_[_0x5adb('0x1d')](_0x49f203[_0x5adb('0x1c')],function(_0x1a0acd){return{'model':db[_0x1a0acd['model']],'as':_0x1a0acd['as'],'attributes':_0x1a0acd[_0x5adb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5adb('0xb')](function(_0x3a4fca){logger[_0x5adb('0xc')](_0x5adb('0x15'),_0x529b65);logger[_0x5adb('0x1f')]('GetFreshsalesAccount',_0x529b65,JSON['stringify'](_0x3a4fca));_0x5de028(_0x3a4fca);})['catch'](function(_0x39bddd){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x39bddd[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x39bddd['message']));});});};exports[_0x5adb('0x20')]=function(_0x34b793){var _0x372da1=this;return new Promise(function(_0x3b1fed,_0x450169){return db[_0x5adb('0x21')][_0x5adb('0x22')]({'raw':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')][_0x5adb('0x17')]===undefined?!![]:![]:!![],'where':_0x34b793['options']?_0x34b793[_0x5adb('0x18')]['where']||null:null,'attributes':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')]['attributes']||null:null,'include':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')][_0x5adb('0x1c')]?_['map'](_0x34b793[_0x5adb('0x18')][_0x5adb('0x1c')],function(_0x4b5887){return{'model':db[_0x4b5887['model']],'as':_0x4b5887['as'],'attributes':_0x4b5887[_0x5adb('0x1a')],'include':_0x4b5887['include']?_[_0x5adb('0x1d')](_0x4b5887[_0x5adb('0x1c')],function(_0x3c2b07){return{'model':db[_0x3c2b07[_0x5adb('0x1e')]],'as':_0x3c2b07['as'],'attributes':_0x3c2b07[_0x5adb('0x1a')],'include':_0x3c2b07['include']?_[_0x5adb('0x1d')](_0x3c2b07[_0x5adb('0x1c')],function(_0x1c3a5c){return{'model':db[_0x1c3a5c['model']],'as':_0x1c3a5c['as'],'attributes':_0x1c3a5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5adb('0xb')](function(_0x5d1baa){logger['info'](_0x5adb('0x20'),_0x34b793);logger['debug'](_0x5adb('0x20'),_0x34b793,JSON['stringify'](_0x5d1baa));_0x3b1fed(_0x5d1baa);})[_0x5adb('0x14')](function(_0x4d052f){logger[_0x5adb('0x10')](_0x5adb('0x20'),_0x4d052f['message'],_0x34b793);_0x450169(_0x372da1[_0x5adb('0x10')](0x1f4,_0x4d052f['message']));});});};
\ No newline at end of file
+var _0xb145=['stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetFreshsalesAccount','where','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb145,0xa3));var _0x5b14=function(_0x17f810,_0x5b39b9){_0x17f810=_0x17f810-0x0;var _0x1ffa9=_0xb145[_0x17f810];return _0x1ffa9;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});}exports['GetFreshsalesAccount']=function(_0x48d395){var _0x58bf3c=this;return new Promise(function(_0x3f397d,_0x3035b5){return db[_0x5b14('0x17')][_0x5b14('0x18')]({'raw':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d395['options']?_0x48d395['options']['where']||null:null,'attributes':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'limit':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1c')]||null:null,'include':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x48d395['options'][_0x5b14('0x1d')],function(_0x54073f){return{'model':db[_0x54073f['model']],'as':_0x54073f['as'],'attributes':_0x54073f['attributes'],'include':_0x54073f['include']?_[_0x5b14('0x1e')](_0x54073f[_0x5b14('0x1d')],function(_0x153a25){return{'model':db[_0x153a25['model']],'as':_0x153a25['as'],'attributes':_0x153a25[_0x5b14('0x1b')],'include':_0x153a25[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x153a25[_0x5b14('0x1d')],function(_0xe6851b){return{'model':db[_0xe6851b[_0x5b14('0x1f')]],'as':_0xe6851b['as'],'attributes':_0xe6851b[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b14('0x20')](function(_0x296d65){logger[_0x5b14('0xd')](_0x5b14('0x21'),_0x48d395);logger[_0x5b14('0xf')](_0x5b14('0x21'),_0x48d395,JSON[_0x5b14('0x11')](_0x296d65));_0x3f397d(_0x296d65);})['catch'](function(_0x370fcd){logger[_0x5b14('0x12')]('GetFreshsalesAccount',_0x370fcd['message'],_0x48d395);_0x3035b5(_0x58bf3c[_0x5b14('0x12')](0x1f4,_0x370fcd[_0x5b14('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x4c1f0e){var _0x21b43b=this;return new Promise(function(_0x4d3905,_0x38c665){return db[_0x5b14('0x17')]['find']({'raw':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e['options'][_0x5b14('0x22')]||null:null,'attributes':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'include':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e[_0x5b14('0x19')]['include']?_[_0x5b14('0x1e')](_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1d')],function(_0x37f62c){return{'model':db[_0x37f62c['model']],'as':_0x37f62c['as'],'attributes':_0x37f62c[_0x5b14('0x1b')],'include':_0x37f62c[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x37f62c['include'],function(_0x2fe74d){return{'model':db[_0x2fe74d['model']],'as':_0x2fe74d['as'],'attributes':_0x2fe74d[_0x5b14('0x1b')],'include':_0x2fe74d[_0x5b14('0x1d')]?_['map'](_0x2fe74d[_0x5b14('0x1d')],function(_0x2a83d4){return{'model':db[_0x2a83d4['model']],'as':_0x2a83d4['as'],'attributes':_0x2a83d4[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ce6bb){logger[_0x5b14('0xd')](_0x5b14('0x23'),_0x4c1f0e);logger[_0x5b14('0xf')]('ShowFreshsalesAccount',_0x4c1f0e,JSON[_0x5b14('0x11')](_0x1ce6bb));_0x4d3905(_0x1ce6bb);})[_0x5b14('0x16')](function(_0x15d4c4){logger[_0x5b14('0x12')](_0x5b14('0x23'),_0x15d4c4[_0x5b14('0x14')],_0x4c1f0e);_0x38c665(_0x21b43b[_0x5b14('0x12')](0x1f4,_0x15d4c4[_0x5b14('0x14')]));});});};
\ No newline at end of file
index 0861410..f9a958e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a91=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','/:id/subjects','getSubjects','get','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','multer'];(function(_0x40b48b,_0x5c29e7){var _0x5cbd32=function(_0x5f4e5a){while(--_0x5f4e5a){_0x40b48b['push'](_0x40b48b['shift']());}};_0x5cbd32(++_0x5c29e7);}(_0x1a91,0xfc));var _0x11a9=function(_0x2c5af3,_0x1e2bdf){_0x2c5af3=_0x2c5af3-0x0;var _0x1b5929=_0x1a91[_0x2c5af3];return _0x1b5929;};'use strict';var multer=require(_0x11a9('0x0'));var util=require(_0x11a9('0x1'));var path=require(_0x11a9('0x2'));var timeout=require(_0x11a9('0x3'));var express=require('express');var router=express[_0x11a9('0x4')]();var fs_extra=require(_0x11a9('0x5'));var auth=require(_0x11a9('0x6'));var interaction=require(_0x11a9('0x7'));var config=require(_0x11a9('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x11a9('0x9')](),controller['index']);router['get'](_0x11a9('0xa'),auth[_0x11a9('0x9')](),controller[_0x11a9('0xb')]);router['get'](_0x11a9('0xc'),auth[_0x11a9('0x9')](),controller[_0x11a9('0xd')]);router[_0x11a9('0xe')](_0x11a9('0xf'),auth[_0x11a9('0x9')](),controller[_0x11a9('0x10')]);router[_0x11a9('0xe')](_0x11a9('0x11'),auth[_0x11a9('0x9')](),controller[_0x11a9('0x12')]);router[_0x11a9('0x13')]('/',auth['isAuthenticated'](),controller[_0x11a9('0x14')]);router[_0x11a9('0x15')](_0x11a9('0xa'),auth['isAuthenticated'](),controller[_0x11a9('0x16')]);router['delete'](_0x11a9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4824=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','index','/:id','isAuthenticated','get','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','put','update','delete','exports','util'];(function(_0x1fb406,_0x276605){var _0x5579f6=function(_0x829f8d){while(--_0x829f8d){_0x1fb406['push'](_0x1fb406['shift']());}};_0x5579f6(++_0x276605);}(_0x4824,0x19d));var _0x4482=function(_0x231d1d,_0x5edd5b){_0x231d1d=_0x231d1d-0x0;var _0x491025=_0x4824[_0x231d1d];return _0x491025;};'use strict';var multer=require('multer');var util=require(_0x4482('0x0'));var path=require(_0x4482('0x1'));var timeout=require('connect-timeout');var express=require(_0x4482('0x2'));var router=express[_0x4482('0x3')]();var fs_extra=require(_0x4482('0x4'));var auth=require(_0x4482('0x5'));var interaction=require(_0x4482('0x6'));var config=require(_0x4482('0x7'));var controller=require(_0x4482('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4482('0x9')]);router['get'](_0x4482('0xa'),auth[_0x4482('0xb')](),controller['show']);router[_0x4482('0xc')](_0x4482('0xd'),auth[_0x4482('0xb')](),controller[_0x4482('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x4482('0xf')]);router[_0x4482('0xc')](_0x4482('0x10'),auth[_0x4482('0xb')](),controller[_0x4482('0x11')]);router[_0x4482('0x12')]('/',auth[_0x4482('0xb')](),controller['create']);router[_0x4482('0x13')]('/:id',auth[_0x4482('0xb')](),controller[_0x4482('0x14')]);router[_0x4482('0x15')]('/:id',auth[_0x4482('0xb')](),controller['destroy']);module[_0x4482('0x16')]=router;
\ No newline at end of file
index e120ef7..351b281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaca9=['STRING','sequelize','exports'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xaca9,0x10c));var _0x9aca=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xaca9[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x9aca('0x0'));module[_0x9aca('0x1')]={'name':{'type':Sequelize[_0x9aca('0x2')]},'description':{'type':Sequelize[_0x9aca('0x2')]}};
\ No newline at end of file
+var _0x58a0=['sequelize','STRING'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0x58a0,0x8c));var _0x058a=function(_0x156e60,_0x18ef4b){_0x156e60=_0x156e60-0x0;var _0xe8a8e3=_0x58a0[_0x156e60];return _0xe8a8e3;};'use strict';var Sequelize=require(_0x058a('0x0'));module['exports']={'name':{'type':Sequelize[_0x058a('0x1')]},'description':{'type':Sequelize[_0x058a('0x1')]}};
\ No newline at end of file
index b882287..a73da97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3389=['zip-dir','request-promise','moment','util','path','sox','ejs','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','params','options','find','create','body','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','getFields','eml-format'];(function(_0x5a87fb,_0x2c2d6d){var _0x5c1ac5=function(_0x23183c){while(--_0x23183c){_0x5a87fb['push'](_0x5a87fb['shift']());}};_0x5c1ac5(++_0x2c2d6d);}(_0x3389,0xec));var _0x9338=function(_0x3a6a24,_0x2e6ac6){_0x3a6a24=_0x3a6a24-0x0;var _0x313516=_0x3389[_0x3a6a24];return _0x313516;};'use strict';var emlformat=require(_0x9338('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9338('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9338('0x2'));var moment=require(_0x9338('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9338('0x4'));var path=require(_0x9338('0x5'));var sox=require(_0x9338('0x6'));var csv=require('to-csv');var ejs=require(_0x9338('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9338('0x8'));var squel=require(_0x9338('0x9'));var crypto=require(_0x9338('0xa'));var jsforce=require(_0x9338('0xb'));var deskjs=require(_0x9338('0xc'));var toCsv=require(_0x9338('0xd'));var querystring=require(_0x9338('0xe'));var Papa=require(_0x9338('0xf'));var Redis=require(_0x9338('0x10'));var authService=require(_0x9338('0x11'));var qs=require(_0x9338('0x12'));var as=require(_0x9338('0x13'));var hardwareService=require(_0x9338('0x14'));var logger=require(_0x9338('0x15'))('api');var utils=require(_0x9338('0x16'));var config=require(_0x9338('0x17'));var licenseUtil=require(_0x9338('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dbcf7,_0x5a57d0){_0x5a57d0=_0x5a57d0||0xcc;return function(_0x3593dd){if(_0x3593dd){return _0x2dbcf7[_0x9338('0x19')](_0x5a57d0);}return _0x2dbcf7[_0x9338('0x1a')](_0x5a57d0)[_0x9338('0x1b')]();};}function respondWithResult(_0x281450,_0x19e09){_0x19e09=_0x19e09||0xc8;return function(_0x4d38a8){if(_0x4d38a8){return _0x281450[_0x9338('0x1a')](_0x19e09)[_0x9338('0x1c')](_0x4d38a8);}};}function respondWithFilteredResult(_0x22f61f,_0x25813a){return function(_0x1420c4){if(_0x1420c4){var _0x10e24d=typeof _0x25813a['offset']===_0x9338('0x1d')&&typeof _0x25813a[_0x9338('0x1e')]===_0x9338('0x1d');var _0x4ff90b=_0x1420c4[_0x9338('0x1f')];var _0x27ac92=_0x10e24d?0x0:_0x25813a[_0x9338('0x20')];var _0x4d3e9a=_0x10e24d?_0x1420c4['count']:_0x25813a[_0x9338('0x20')]+_0x25813a[_0x9338('0x1e')];var _0x3c0c8c;if(_0x4d3e9a>=_0x4ff90b){_0x4d3e9a=_0x4ff90b;_0x3c0c8c=0xc8;}else{_0x3c0c8c=0xce;}_0x22f61f['status'](_0x3c0c8c);return _0x22f61f[_0x9338('0x21')](_0x9338('0x22'),_0x27ac92+'-'+_0x4d3e9a+'/'+_0x4ff90b)[_0x9338('0x1c')](_0x1420c4);}return null;};}function patchUpdates(_0x2f59c3){return function(_0x4a939f){try{jsonpatch[_0x9338('0x23')](_0x4a939f,_0x2f59c3,!![]);}catch(_0x4c0a72){return BPromise[_0x9338('0x24')](_0x4c0a72);}return _0x4a939f[_0x9338('0x25')]();};}function saveUpdates(_0x1e43f8,_0x4b58c2){return function(_0x3498c3){if(_0x3498c3){return _0x3498c3[_0x9338('0x26')](_0x1e43f8)[_0x9338('0x27')](function(_0x1b6586){return _0x1b6586;});}return null;};}function removeEntity(_0x4eb37b,_0x42dce4){return function(_0x40aa4f){if(_0x40aa4f){return _0x40aa4f[_0x9338('0x28')]()['then'](function(){_0x4eb37b[_0x9338('0x1a')](0xcc)[_0x9338('0x1b')]();});}};}function handleEntityNotFound(_0x3744ef,_0x1c7f8f){return function(_0xca527){if(!_0xca527){_0x3744ef[_0x9338('0x19')](0x194);}return _0xca527;};}function handleError(_0x3aa7d3,_0x33f300){_0x33f300=_0x33f300||0x1f4;return function(_0x5be3c9){logger['error'](_0x5be3c9[_0x9338('0x29')]);if(_0x5be3c9[_0x9338('0x2a')]){delete _0x5be3c9[_0x9338('0x2a')];}_0x3aa7d3[_0x9338('0x1a')](_0x33f300)[_0x9338('0x2b')](_0x5be3c9);};}exports['index']=function(_0x4eb259,_0x4452bd){var _0x49bd63={},_0x2cde9e={},_0x5ee066={'count':0x0,'rows':[]};var _0x153388=_['map'](db[_0x9338('0x2c')][_0x9338('0x2d')],function(_0x4b666d){return{'name':_0x4b666d['fieldName'],'type':_0x4b666d[_0x9338('0x2e')][_0x9338('0x2f')]};});_0x2cde9e[_0x9338('0x30')]=_[_0x9338('0x31')](_0x153388,_0x9338('0x2a'));_0x2cde9e[_0x9338('0x32')]=_[_0x9338('0x33')](_0x4eb259[_0x9338('0x32')]);_0x2cde9e[_0x9338('0x34')]=_[_0x9338('0x35')](_0x2cde9e[_0x9338('0x30')],_0x2cde9e[_0x9338('0x32')]);_0x49bd63[_0x9338('0x36')]=_[_0x9338('0x35')](_0x2cde9e[_0x9338('0x30')],qs[_0x9338('0x37')](_0x4eb259[_0x9338('0x32')][_0x9338('0x37')]));_0x49bd63['attributes']=_0x49bd63[_0x9338('0x36')][_0x9338('0x38')]?_0x49bd63[_0x9338('0x36')]:_0x2cde9e[_0x9338('0x30')];if(!_0x4eb259[_0x9338('0x32')][_0x9338('0x39')]('nolimit')){_0x49bd63[_0x9338('0x1e')]=qs[_0x9338('0x1e')](_0x4eb259[_0x9338('0x32')]['limit']);_0x49bd63[_0x9338('0x20')]=qs[_0x9338('0x20')](_0x4eb259[_0x9338('0x32')][_0x9338('0x20')]);}_0x49bd63[_0x9338('0x3a')]=qs[_0x9338('0x3b')](_0x4eb259['query'][_0x9338('0x3b')]);_0x49bd63[_0x9338('0x3c')]=qs[_0x9338('0x34')](_[_0x9338('0x3d')](_0x4eb259[_0x9338('0x32')],_0x2cde9e[_0x9338('0x34')]),_0x153388);if(_0x4eb259[_0x9338('0x32')][_0x9338('0x3e')]){_0x49bd63[_0x9338('0x3c')]=_[_0x9338('0x3f')](_0x49bd63[_0x9338('0x3c')],{'$or':_[_0x9338('0x31')](_0x153388,function(_0x52aaad){if(_0x52aaad[_0x9338('0x2e')]!==_0x9338('0x40')){var _0x2854f3={};_0x2854f3[_0x52aaad[_0x9338('0x2a')]]={'$like':'%'+_0x4eb259['query'][_0x9338('0x3e')]+'%'};return _0x2854f3;}})});}_0x49bd63=_[_0x9338('0x3f')]({},_0x49bd63,_0x4eb259['options']);var _0x2fc66a={'where':_0x49bd63[_0x9338('0x3c')]};return db['FreshsalesConfiguration']['count'](_0x2fc66a)['then'](function(_0x303fbf){_0x5ee066[_0x9338('0x1f')]=_0x303fbf;if(_0x4eb259[_0x9338('0x32')]['includeAll']){_0x49bd63[_0x9338('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x9338('0x42')](_0x49bd63);})[_0x9338('0x27')](function(_0x5bc486){_0x5ee066['rows']=_0x5bc486;return _0x5ee066;})['then'](respondWithFilteredResult(_0x4452bd,_0x49bd63))[_0x9338('0x43')](handleError(_0x4452bd,null));};exports['show']=function(_0x1af113,_0xa68a7){var _0x9c83e3={'raw':![],'where':{'id':_0x1af113[_0x9338('0x44')]['id']}},_0x2e458f={};_0x2e458f[_0x9338('0x30')]=_['keys'](db[_0x9338('0x2c')][_0x9338('0x2d')]);_0x2e458f[_0x9338('0x32')]=_[_0x9338('0x33')](_0x1af113[_0x9338('0x32')]);_0x2e458f[_0x9338('0x34')]=_['intersection'](_0x2e458f[_0x9338('0x30')],_0x2e458f[_0x9338('0x32')]);_0x9c83e3['attributes']=_['intersection'](_0x2e458f[_0x9338('0x30')],qs[_0x9338('0x37')](_0x1af113['query']['fields']));_0x9c83e3['attributes']=_0x9c83e3[_0x9338('0x36')]['length']?_0x9c83e3[_0x9338('0x36')]:_0x2e458f['model'];if(_0x1af113[_0x9338('0x32')]['includeAll']){_0x9c83e3[_0x9338('0x41')]=[{'all':!![]}];}_0x9c83e3=_[_0x9338('0x3f')]({},_0x9c83e3,_0x1af113[_0x9338('0x45')]);return db[_0x9338('0x2c')][_0x9338('0x46')](_0x9c83e3)['then'](handleEntityNotFound(_0xa68a7,null))[_0x9338('0x27')](respondWithResult(_0xa68a7,null))['catch'](handleError(_0xa68a7,null));};exports['create']=function(_0x287d4c,_0x1eeb2d){return db['FreshsalesConfiguration'][_0x9338('0x47')](_0x287d4c['body'],{})[_0x9338('0x27')](respondWithResult(_0x1eeb2d,0xc9))[_0x9338('0x43')](handleError(_0x1eeb2d,null));};exports[_0x9338('0x26')]=function(_0x1284a3,_0x3e9840){if(_0x1284a3[_0x9338('0x48')]['id']){delete _0x1284a3['body']['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x1284a3[_0x9338('0x44')]['id']}})[_0x9338('0x27')](handleEntityNotFound(_0x3e9840,null))['then'](saveUpdates(_0x1284a3[_0x9338('0x48')],null))[_0x9338('0x27')](respondWithResult(_0x3e9840,null))['catch'](handleError(_0x3e9840,null));};exports[_0x9338('0x28')]=function(_0x32bdf2,_0x382ec2){return db['FreshsalesConfiguration'][_0x9338('0x46')]({'where':{'id':_0x32bdf2['params']['id']}})[_0x9338('0x27')](handleEntityNotFound(_0x382ec2,null))[_0x9338('0x27')](removeEntity(_0x382ec2,null))[_0x9338('0x43')](handleError(_0x382ec2,null));};exports[_0x9338('0x49')]=function(_0x4a7963,_0x215312,_0x3f655c){var _0x177e8f={};var _0x3e60aa={};var _0x1bea9d;var _0x107de3;return db['FreshsalesConfiguration'][_0x9338('0x4a')]({'where':{'id':_0x4a7963[_0x9338('0x44')]['id']}})[_0x9338('0x27')](handleEntityNotFound(_0x215312,null))['then'](function(_0x32e116){if(_0x32e116){_0x1bea9d=_0x32e116;_0x3e60aa[_0x9338('0x30')]=_[_0x9338('0x33')](db[_0x9338('0x4b')]['rawAttributes']);_0x3e60aa[_0x9338('0x32')]=_['keys'](_0x4a7963[_0x9338('0x32')]);_0x3e60aa[_0x9338('0x34')]=_[_0x9338('0x35')](_0x3e60aa['model'],_0x3e60aa['query']);_0x177e8f['attributes']=_[_0x9338('0x35')](_0x3e60aa['model'],qs[_0x9338('0x37')](_0x4a7963[_0x9338('0x32')]['fields']));_0x177e8f['attributes']=_0x177e8f['attributes']['length']?_0x177e8f[_0x9338('0x36')]:_0x3e60aa[_0x9338('0x30')];_0x177e8f[_0x9338('0x3a')]=qs['sort'](_0x4a7963[_0x9338('0x32')][_0x9338('0x3b')]);_0x177e8f['where']=qs[_0x9338('0x34')](_[_0x9338('0x3d')](_0x4a7963[_0x9338('0x32')],_0x3e60aa[_0x9338('0x34')]));if(_0x4a7963['query'][_0x9338('0x3e')]){_0x177e8f[_0x9338('0x3c')]=_[_0x9338('0x3f')](_0x177e8f['where'],{'$or':_[_0x9338('0x31')](_0x177e8f[_0x9338('0x36')],function(_0x5cdc6d){var _0x2254db={};_0x2254db[_0x5cdc6d]={'$like':'%'+_0x4a7963[_0x9338('0x32')][_0x9338('0x3e')]+'%'};return _0x2254db;})});}_0x177e8f=_[_0x9338('0x3f')]({},_0x177e8f,_0x4a7963[_0x9338('0x45')]);return _0x1bea9d[_0x9338('0x49')](_0x177e8f);}})[_0x9338('0x27')](function(_0x581ac2){if(_0x581ac2){_0x107de3=_0x581ac2[_0x9338('0x38')];if(!_0x4a7963[_0x9338('0x32')][_0x9338('0x39')](_0x9338('0x4c'))){_0x177e8f[_0x9338('0x1e')]=qs[_0x9338('0x1e')](_0x4a7963[_0x9338('0x32')][_0x9338('0x1e')]);_0x177e8f[_0x9338('0x20')]=qs[_0x9338('0x20')](_0x4a7963[_0x9338('0x32')]['offset']);}return _0x1bea9d[_0x9338('0x49')](_0x177e8f);}})['then'](function(_0x5cbe0a){if(_0x5cbe0a){return _0x5cbe0a?{'count':_0x107de3,'rows':_0x5cbe0a}:null;}})[_0x9338('0x27')](respondWithResult(_0x215312,null))[_0x9338('0x43')](handleError(_0x215312,null));};exports[_0x9338('0x4d')]=function(_0x528457,_0x1651d3,_0x398d14){var _0x2ecd77={};var _0x56142a={};var _0x2ed043;var _0x50c0e8;return db['FreshsalesConfiguration'][_0x9338('0x4a')]({'where':{'id':_0x528457['params']['id']}})[_0x9338('0x27')](handleEntityNotFound(_0x1651d3,null))[_0x9338('0x27')](function(_0x2972e4){if(_0x2972e4){_0x2ed043=_0x2972e4;_0x56142a['model']=_[_0x9338('0x33')](db[_0x9338('0x4b')][_0x9338('0x2d')]);_0x56142a[_0x9338('0x32')]=_['keys'](_0x528457[_0x9338('0x32')]);_0x56142a[_0x9338('0x34')]=_[_0x9338('0x35')](_0x56142a[_0x9338('0x30')],_0x56142a[_0x9338('0x32')]);_0x2ecd77[_0x9338('0x36')]=_[_0x9338('0x35')](_0x56142a[_0x9338('0x30')],qs[_0x9338('0x37')](_0x528457[_0x9338('0x32')][_0x9338('0x37')]));_0x2ecd77[_0x9338('0x36')]=_0x2ecd77[_0x9338('0x36')][_0x9338('0x38')]?_0x2ecd77['attributes']:_0x56142a[_0x9338('0x30')];_0x2ecd77[_0x9338('0x3a')]=qs['sort'](_0x528457[_0x9338('0x32')]['sort']);_0x2ecd77[_0x9338('0x3c')]=qs['filters'](_['pick'](_0x528457[_0x9338('0x32')],_0x56142a[_0x9338('0x34')]));if(_0x528457[_0x9338('0x32')][_0x9338('0x3e')]){_0x2ecd77['where']=_['merge'](_0x2ecd77['where'],{'$or':_['map'](_0x2ecd77[_0x9338('0x36')],function(_0x1a3fd6){var _0x5ce989={};_0x5ce989[_0x1a3fd6]={'$like':'%'+_0x528457[_0x9338('0x32')][_0x9338('0x3e')]+'%'};return _0x5ce989;})});}_0x2ecd77=_[_0x9338('0x3f')]({},_0x2ecd77,_0x528457[_0x9338('0x45')]);return _0x2ed043[_0x9338('0x4d')](_0x2ecd77);}})[_0x9338('0x27')](function(_0x4ef442){if(_0x4ef442){_0x50c0e8=_0x4ef442['length'];if(!_0x528457[_0x9338('0x32')][_0x9338('0x39')](_0x9338('0x4c'))){_0x2ecd77[_0x9338('0x1e')]=qs['limit'](_0x528457['query']['limit']);_0x2ecd77['offset']=qs['offset'](_0x528457['query'][_0x9338('0x20')]);}return _0x2ed043['getDescriptions'](_0x2ecd77);}})[_0x9338('0x27')](function(_0x2859d2){if(_0x2859d2){return _0x2859d2?{'count':_0x50c0e8,'rows':_0x2859d2}:null;}})['then'](respondWithResult(_0x1651d3,null))[_0x9338('0x43')](handleError(_0x1651d3,null));};exports['getFields']=function(_0x515363,_0x3a8dc8,_0x19fdc2){var _0x43d770={};var _0x596321={};var _0x395bfb;var _0x3e4721;return db['FreshsalesConfiguration'][_0x9338('0x4a')]({'where':{'id':_0x515363[_0x9338('0x44')]['id']}})[_0x9338('0x27')](handleEntityNotFound(_0x3a8dc8,null))[_0x9338('0x27')](function(_0x5daccd){if(_0x5daccd){_0x395bfb=_0x5daccd;_0x596321['model']=_['keys'](db[_0x9338('0x4b')][_0x9338('0x2d')]);_0x596321[_0x9338('0x32')]=_['keys'](_0x515363[_0x9338('0x32')]);_0x596321['filters']=_[_0x9338('0x35')](_0x596321[_0x9338('0x30')],_0x596321[_0x9338('0x32')]);_0x43d770[_0x9338('0x36')]=_[_0x9338('0x35')](_0x596321['model'],qs[_0x9338('0x37')](_0x515363['query']['fields']));_0x43d770[_0x9338('0x36')]=_0x43d770[_0x9338('0x36')][_0x9338('0x38')]?_0x43d770['attributes']:_0x596321['model'];_0x43d770[_0x9338('0x3a')]=qs[_0x9338('0x3b')](_0x515363[_0x9338('0x32')]['sort']);_0x43d770['where']=qs[_0x9338('0x34')](_[_0x9338('0x3d')](_0x515363[_0x9338('0x32')],_0x596321['filters']));if(_0x515363[_0x9338('0x32')][_0x9338('0x3e')]){_0x43d770[_0x9338('0x3c')]=_[_0x9338('0x3f')](_0x43d770[_0x9338('0x3c')],{'$or':_['map'](_0x43d770[_0x9338('0x36')],function(_0x97679d){var _0x1a9ef7={};_0x1a9ef7[_0x97679d]={'$like':'%'+_0x515363[_0x9338('0x32')][_0x9338('0x3e')]+'%'};return _0x1a9ef7;})});}_0x43d770=_[_0x9338('0x3f')]({},_0x43d770,_0x515363['options']);return _0x395bfb[_0x9338('0x4e')](_0x43d770);}})[_0x9338('0x27')](function(_0xcaac99){if(_0xcaac99){_0x3e4721=_0xcaac99['length'];if(!_0x515363[_0x9338('0x32')]['hasOwnProperty'](_0x9338('0x4c'))){_0x43d770[_0x9338('0x1e')]=qs[_0x9338('0x1e')](_0x515363[_0x9338('0x32')][_0x9338('0x1e')]);_0x43d770[_0x9338('0x20')]=qs['offset'](_0x515363[_0x9338('0x32')]['offset']);}return _0x395bfb[_0x9338('0x4e')](_0x43d770);}})[_0x9338('0x27')](function(_0x1b1d44){if(_0x1b1d44){return _0x1b1d44?{'count':_0x3e4721,'rows':_0x1b1d44}:null;}})[_0x9338('0x27')](respondWithResult(_0x3a8dc8,null))[_0x9338('0x43')](handleError(_0x3a8dc8,null));};
\ No newline at end of file
+var _0x21bd=['merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','FreshsalesField','getSubjects','getDescriptions','findOne','order','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x4bc720,_0x272421){var _0x4e542d=function(_0x2e273a){while(--_0x2e273a){_0x4bc720['push'](_0x4bc720['shift']());}};_0x4e542d(++_0x272421);}(_0x21bd,0xb2));var _0xd21b=function(_0x42d086,_0x31ce10){_0x42d086=_0x42d086-0x0;var _0x4ff883=_0x21bd[_0x42d086];return _0x4ff883;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd21b('0x0'));var zipdir=require(_0xd21b('0x1'));var jsonpatch=require(_0xd21b('0x2'));var rp=require(_0xd21b('0x3'));var moment=require(_0xd21b('0x4'));var BPromise=require(_0xd21b('0x5'));var Mustache=require(_0xd21b('0x6'));var util=require(_0xd21b('0x7'));var path=require('path');var sox=require(_0xd21b('0x8'));var csv=require(_0xd21b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd21b('0xa'));var _=require('lodash');var squel=require(_0xd21b('0xb'));var crypto=require(_0xd21b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd21b('0xd'));var toCsv=require(_0xd21b('0x9'));var querystring=require('querystring');var Papa=require(_0xd21b('0xe'));var Redis=require(_0xd21b('0xf'));var authService=require(_0xd21b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd21b('0x11'));var hardwareService=require(_0xd21b('0x12'));var logger=require(_0xd21b('0x13'))(_0xd21b('0x14'));var utils=require(_0xd21b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd21b('0x16'));var db=require(_0xd21b('0x17'))['db'];function respondWithStatusCode(_0x5648b0,_0x8fc947){_0x8fc947=_0x8fc947||0xcc;return function(_0x22e254){if(_0x22e254){return _0x5648b0[_0xd21b('0x18')](_0x8fc947);}return _0x5648b0['status'](_0x8fc947)[_0xd21b('0x19')]();};}function respondWithResult(_0x54b7ec,_0xff9742){_0xff9742=_0xff9742||0xc8;return function(_0x41bed4){if(_0x41bed4){return _0x54b7ec[_0xd21b('0x1a')](_0xff9742)['json'](_0x41bed4);}};}function respondWithFilteredResult(_0x14450e,_0x41f906){return function(_0x230b7c){if(_0x230b7c){var _0x286b4c=typeof _0x41f906[_0xd21b('0x1b')]==='undefined'&&typeof _0x41f906[_0xd21b('0x1c')]===_0xd21b('0x1d');var _0x155787=_0x230b7c[_0xd21b('0x1e')];var _0x68ef=_0x286b4c?0x0:_0x41f906[_0xd21b('0x1b')];var _0x45a432=_0x286b4c?_0x230b7c[_0xd21b('0x1e')]:_0x41f906[_0xd21b('0x1b')]+_0x41f906[_0xd21b('0x1c')];var _0x508ed8;if(_0x45a432>=_0x155787){_0x45a432=_0x155787;_0x508ed8=0xc8;}else{_0x508ed8=0xce;}_0x14450e['status'](_0x508ed8);return _0x14450e['set'](_0xd21b('0x1f'),_0x68ef+'-'+_0x45a432+'/'+_0x155787)[_0xd21b('0x20')](_0x230b7c);}return null;};}function patchUpdates(_0x40acdc){return function(_0x3aa36c){try{jsonpatch[_0xd21b('0x21')](_0x3aa36c,_0x40acdc,!![]);}catch(_0x14e282){return BPromise[_0xd21b('0x22')](_0x14e282);}return _0x3aa36c[_0xd21b('0x23')]();};}function saveUpdates(_0x24ff8b,_0x4a180f){return function(_0x4d1c31){if(_0x4d1c31){return _0x4d1c31[_0xd21b('0x24')](_0x24ff8b)[_0xd21b('0x25')](function(_0xd77019){return _0xd77019;});}return null;};}function removeEntity(_0x2b7757,_0x1665e1){return function(_0x2a885f){if(_0x2a885f){return _0x2a885f['destroy']()[_0xd21b('0x25')](function(){_0x2b7757[_0xd21b('0x1a')](0xcc)[_0xd21b('0x19')]();});}};}function handleEntityNotFound(_0x260a44,_0x3412c8){return function(_0x2eaa84){if(!_0x2eaa84){_0x260a44[_0xd21b('0x18')](0x194);}return _0x2eaa84;};}function handleError(_0x16e29a,_0x33f590){_0x33f590=_0x33f590||0x1f4;return function(_0x47f4cf){logger[_0xd21b('0x26')](_0x47f4cf[_0xd21b('0x27')]);if(_0x47f4cf[_0xd21b('0x28')]){delete _0x47f4cf[_0xd21b('0x28')];}_0x16e29a[_0xd21b('0x1a')](_0x33f590)[_0xd21b('0x29')](_0x47f4cf);};}exports['index']=function(_0x483db9,_0x4357a1){var _0x4f4610={},_0x23c5ad={},_0x31b9b0={'count':0x0,'rows':[]};var _0x4c96af=_['map'](db[_0xd21b('0x2a')][_0xd21b('0x2b')],function(_0x4863c6){return{'name':_0x4863c6[_0xd21b('0x2c')],'type':_0x4863c6[_0xd21b('0x2d')][_0xd21b('0x2e')]};});_0x23c5ad[_0xd21b('0x2f')]=_[_0xd21b('0x30')](_0x4c96af,'name');_0x23c5ad[_0xd21b('0x31')]=_[_0xd21b('0x32')](_0x483db9['query']);_0x23c5ad[_0xd21b('0x33')]=_[_0xd21b('0x34')](_0x23c5ad[_0xd21b('0x2f')],_0x23c5ad[_0xd21b('0x31')]);_0x4f4610[_0xd21b('0x35')]=_[_0xd21b('0x34')](_0x23c5ad[_0xd21b('0x2f')],qs[_0xd21b('0x36')](_0x483db9[_0xd21b('0x31')][_0xd21b('0x36')]));_0x4f4610[_0xd21b('0x35')]=_0x4f4610['attributes'][_0xd21b('0x37')]?_0x4f4610[_0xd21b('0x35')]:_0x23c5ad[_0xd21b('0x2f')];if(!_0x483db9[_0xd21b('0x31')][_0xd21b('0x38')](_0xd21b('0x39'))){_0x4f4610[_0xd21b('0x1c')]=qs[_0xd21b('0x1c')](_0x483db9['query'][_0xd21b('0x1c')]);_0x4f4610[_0xd21b('0x1b')]=qs[_0xd21b('0x1b')](_0x483db9['query'][_0xd21b('0x1b')]);}_0x4f4610['order']=qs[_0xd21b('0x3a')](_0x483db9['query']['sort']);_0x4f4610[_0xd21b('0x3b')]=qs[_0xd21b('0x33')](_[_0xd21b('0x3c')](_0x483db9[_0xd21b('0x31')],_0x23c5ad[_0xd21b('0x33')]),_0x4c96af);if(_0x483db9['query'][_0xd21b('0x3d')]){_0x4f4610[_0xd21b('0x3b')]=_[_0xd21b('0x3e')](_0x4f4610['where'],{'$or':_[_0xd21b('0x30')](_0x4c96af,function(_0x1e514c){if(_0x1e514c[_0xd21b('0x2d')]!=='VIRTUAL'){var _0x5672c9={};_0x5672c9[_0x1e514c[_0xd21b('0x28')]]={'$like':'%'+_0x483db9[_0xd21b('0x31')]['filter']+'%'};return _0x5672c9;}})});}_0x4f4610=_['merge']({},_0x4f4610,_0x483db9[_0xd21b('0x3f')]);var _0x3307c3={'where':_0x4f4610[_0xd21b('0x3b')]};return db[_0xd21b('0x2a')][_0xd21b('0x1e')](_0x3307c3)[_0xd21b('0x25')](function(_0x278260){_0x31b9b0['count']=_0x278260;if(_0x483db9['query'][_0xd21b('0x40')]){_0x4f4610[_0xd21b('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xd21b('0x42')](_0x4f4610);})[_0xd21b('0x25')](function(_0x437677){_0x31b9b0['rows']=_0x437677;return _0x31b9b0;})['then'](respondWithFilteredResult(_0x4357a1,_0x4f4610))[_0xd21b('0x43')](handleError(_0x4357a1,null));};exports[_0xd21b('0x44')]=function(_0x1d1358,_0x15deb3){var _0x565617={'raw':![],'where':{'id':_0x1d1358[_0xd21b('0x45')]['id']}},_0x54d070={};_0x54d070['model']=_[_0xd21b('0x32')](db['FreshsalesConfiguration'][_0xd21b('0x2b')]);_0x54d070[_0xd21b('0x31')]=_['keys'](_0x1d1358[_0xd21b('0x31')]);_0x54d070['filters']=_[_0xd21b('0x34')](_0x54d070[_0xd21b('0x2f')],_0x54d070[_0xd21b('0x31')]);_0x565617[_0xd21b('0x35')]=_[_0xd21b('0x34')](_0x54d070['model'],qs[_0xd21b('0x36')](_0x1d1358['query']['fields']));_0x565617['attributes']=_0x565617[_0xd21b('0x35')]['length']?_0x565617['attributes']:_0x54d070[_0xd21b('0x2f')];if(_0x1d1358[_0xd21b('0x31')]['includeAll']){_0x565617['include']=[{'all':!![]}];}_0x565617=_[_0xd21b('0x3e')]({},_0x565617,_0x1d1358[_0xd21b('0x3f')]);return db['FreshsalesConfiguration'][_0xd21b('0x46')](_0x565617)[_0xd21b('0x25')](handleEntityNotFound(_0x15deb3,null))['then'](respondWithResult(_0x15deb3,null))[_0xd21b('0x43')](handleError(_0x15deb3,null));};exports[_0xd21b('0x47')]=function(_0x4cd404,_0x299965){return db[_0xd21b('0x2a')][_0xd21b('0x47')](_0x4cd404[_0xd21b('0x48')],{})[_0xd21b('0x25')](respondWithResult(_0x299965,0xc9))['catch'](handleError(_0x299965,null));};exports[_0xd21b('0x24')]=function(_0x4e1eff,_0x3db31a){if(_0x4e1eff[_0xd21b('0x48')]['id']){delete _0x4e1eff['body']['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x4e1eff['params']['id']}})[_0xd21b('0x25')](handleEntityNotFound(_0x3db31a,null))[_0xd21b('0x25')](saveUpdates(_0x4e1eff[_0xd21b('0x48')],null))[_0xd21b('0x25')](respondWithResult(_0x3db31a,null))[_0xd21b('0x43')](handleError(_0x3db31a,null));};exports[_0xd21b('0x49')]=function(_0x3d3fba,_0x1b15ab){return db['FreshsalesConfiguration'][_0xd21b('0x46')]({'where':{'id':_0x3d3fba[_0xd21b('0x45')]['id']}})[_0xd21b('0x25')](handleEntityNotFound(_0x1b15ab,null))[_0xd21b('0x25')](removeEntity(_0x1b15ab,null))[_0xd21b('0x43')](handleError(_0x1b15ab,null));};exports['getSubjects']=function(_0x24d7c9,_0x4aadbc,_0x1f00d0){var _0x4c22fc={};var _0x14e13c={};var _0x49c728;var _0x32af14;return db[_0xd21b('0x2a')]['findOne']({'where':{'id':_0x24d7c9[_0xd21b('0x45')]['id']}})[_0xd21b('0x25')](handleEntityNotFound(_0x4aadbc,null))[_0xd21b('0x25')](function(_0x42e630){if(_0x42e630){_0x49c728=_0x42e630;_0x14e13c[_0xd21b('0x2f')]=_[_0xd21b('0x32')](db[_0xd21b('0x4a')][_0xd21b('0x2b')]);_0x14e13c[_0xd21b('0x31')]=_['keys'](_0x24d7c9['query']);_0x14e13c['filters']=_[_0xd21b('0x34')](_0x14e13c[_0xd21b('0x2f')],_0x14e13c[_0xd21b('0x31')]);_0x4c22fc[_0xd21b('0x35')]=_['intersection'](_0x14e13c[_0xd21b('0x2f')],qs[_0xd21b('0x36')](_0x24d7c9[_0xd21b('0x31')][_0xd21b('0x36')]));_0x4c22fc[_0xd21b('0x35')]=_0x4c22fc[_0xd21b('0x35')][_0xd21b('0x37')]?_0x4c22fc[_0xd21b('0x35')]:_0x14e13c['model'];_0x4c22fc['order']=qs[_0xd21b('0x3a')](_0x24d7c9[_0xd21b('0x31')][_0xd21b('0x3a')]);_0x4c22fc['where']=qs[_0xd21b('0x33')](_['pick'](_0x24d7c9[_0xd21b('0x31')],_0x14e13c[_0xd21b('0x33')]));if(_0x24d7c9[_0xd21b('0x31')][_0xd21b('0x3d')]){_0x4c22fc[_0xd21b('0x3b')]=_['merge'](_0x4c22fc[_0xd21b('0x3b')],{'$or':_[_0xd21b('0x30')](_0x4c22fc['attributes'],function(_0x8a925d){var _0x347347={};_0x347347[_0x8a925d]={'$like':'%'+_0x24d7c9[_0xd21b('0x31')][_0xd21b('0x3d')]+'%'};return _0x347347;})});}_0x4c22fc=_[_0xd21b('0x3e')]({},_0x4c22fc,_0x24d7c9[_0xd21b('0x3f')]);return _0x49c728[_0xd21b('0x4b')](_0x4c22fc);}})[_0xd21b('0x25')](function(_0x19a5f8){if(_0x19a5f8){_0x32af14=_0x19a5f8[_0xd21b('0x37')];if(!_0x24d7c9['query'][_0xd21b('0x38')]('nolimit')){_0x4c22fc['limit']=qs[_0xd21b('0x1c')](_0x24d7c9[_0xd21b('0x31')][_0xd21b('0x1c')]);_0x4c22fc['offset']=qs['offset'](_0x24d7c9['query'][_0xd21b('0x1b')]);}return _0x49c728[_0xd21b('0x4b')](_0x4c22fc);}})[_0xd21b('0x25')](function(_0x5eec1c){if(_0x5eec1c){return _0x5eec1c?{'count':_0x32af14,'rows':_0x5eec1c}:null;}})['then'](respondWithResult(_0x4aadbc,null))['catch'](handleError(_0x4aadbc,null));};exports[_0xd21b('0x4c')]=function(_0x2cc1ca,_0x3c9b08,_0x20169d){var _0x304ff6={};var _0xc87a78={};var _0x33cf22;var _0x8e57ba;return db[_0xd21b('0x2a')][_0xd21b('0x4d')]({'where':{'id':_0x2cc1ca[_0xd21b('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c9b08,null))['then'](function(_0x515431){if(_0x515431){_0x33cf22=_0x515431;_0xc87a78['model']=_[_0xd21b('0x32')](db[_0xd21b('0x4a')][_0xd21b('0x2b')]);_0xc87a78[_0xd21b('0x31')]=_[_0xd21b('0x32')](_0x2cc1ca['query']);_0xc87a78[_0xd21b('0x33')]=_[_0xd21b('0x34')](_0xc87a78['model'],_0xc87a78[_0xd21b('0x31')]);_0x304ff6[_0xd21b('0x35')]=_['intersection'](_0xc87a78[_0xd21b('0x2f')],qs[_0xd21b('0x36')](_0x2cc1ca[_0xd21b('0x31')]['fields']));_0x304ff6[_0xd21b('0x35')]=_0x304ff6['attributes'][_0xd21b('0x37')]?_0x304ff6['attributes']:_0xc87a78[_0xd21b('0x2f')];_0x304ff6[_0xd21b('0x4e')]=qs[_0xd21b('0x3a')](_0x2cc1ca[_0xd21b('0x31')][_0xd21b('0x3a')]);_0x304ff6[_0xd21b('0x3b')]=qs[_0xd21b('0x33')](_[_0xd21b('0x3c')](_0x2cc1ca[_0xd21b('0x31')],_0xc87a78['filters']));if(_0x2cc1ca['query'][_0xd21b('0x3d')]){_0x304ff6['where']=_[_0xd21b('0x3e')](_0x304ff6[_0xd21b('0x3b')],{'$or':_[_0xd21b('0x30')](_0x304ff6[_0xd21b('0x35')],function(_0x12101a){var _0x4d5c19={};_0x4d5c19[_0x12101a]={'$like':'%'+_0x2cc1ca[_0xd21b('0x31')][_0xd21b('0x3d')]+'%'};return _0x4d5c19;})});}_0x304ff6=_[_0xd21b('0x3e')]({},_0x304ff6,_0x2cc1ca['options']);return _0x33cf22[_0xd21b('0x4c')](_0x304ff6);}})[_0xd21b('0x25')](function(_0x47a71f){if(_0x47a71f){_0x8e57ba=_0x47a71f[_0xd21b('0x37')];if(!_0x2cc1ca[_0xd21b('0x31')]['hasOwnProperty'](_0xd21b('0x39'))){_0x304ff6[_0xd21b('0x1c')]=qs[_0xd21b('0x1c')](_0x2cc1ca[_0xd21b('0x31')][_0xd21b('0x1c')]);_0x304ff6[_0xd21b('0x1b')]=qs[_0xd21b('0x1b')](_0x2cc1ca['query'][_0xd21b('0x1b')]);}return _0x33cf22[_0xd21b('0x4c')](_0x304ff6);}})['then'](function(_0x4c7046){if(_0x4c7046){return _0x4c7046?{'count':_0x8e57ba,'rows':_0x4c7046}:null;}})[_0xd21b('0x25')](respondWithResult(_0x3c9b08,null))['catch'](handleError(_0x3c9b08,null));};exports['getFields']=function(_0x1c66a5,_0x2c447a,_0x11093e){var _0x34dac9={};var _0x49dded={};var _0x1f3009;var _0x539839;return db[_0xd21b('0x2a')]['findOne']({'where':{'id':_0x1c66a5['params']['id']}})['then'](handleEntityNotFound(_0x2c447a,null))['then'](function(_0x54b4bf){if(_0x54b4bf){_0x1f3009=_0x54b4bf;_0x49dded[_0xd21b('0x2f')]=_[_0xd21b('0x32')](db[_0xd21b('0x4a')][_0xd21b('0x2b')]);_0x49dded[_0xd21b('0x31')]=_[_0xd21b('0x32')](_0x1c66a5[_0xd21b('0x31')]);_0x49dded[_0xd21b('0x33')]=_['intersection'](_0x49dded[_0xd21b('0x2f')],_0x49dded['query']);_0x34dac9['attributes']=_[_0xd21b('0x34')](_0x49dded[_0xd21b('0x2f')],qs[_0xd21b('0x36')](_0x1c66a5['query'][_0xd21b('0x36')]));_0x34dac9[_0xd21b('0x35')]=_0x34dac9[_0xd21b('0x35')][_0xd21b('0x37')]?_0x34dac9[_0xd21b('0x35')]:_0x49dded['model'];_0x34dac9[_0xd21b('0x4e')]=qs['sort'](_0x1c66a5['query'][_0xd21b('0x3a')]);_0x34dac9[_0xd21b('0x3b')]=qs[_0xd21b('0x33')](_[_0xd21b('0x3c')](_0x1c66a5[_0xd21b('0x31')],_0x49dded[_0xd21b('0x33')]));if(_0x1c66a5[_0xd21b('0x31')]['filter']){_0x34dac9[_0xd21b('0x3b')]=_[_0xd21b('0x3e')](_0x34dac9[_0xd21b('0x3b')],{'$or':_[_0xd21b('0x30')](_0x34dac9[_0xd21b('0x35')],function(_0x38a723){var _0x15a87e={};_0x15a87e[_0x38a723]={'$like':'%'+_0x1c66a5[_0xd21b('0x31')][_0xd21b('0x3d')]+'%'};return _0x15a87e;})});}_0x34dac9=_[_0xd21b('0x3e')]({},_0x34dac9,_0x1c66a5['options']);return _0x1f3009[_0xd21b('0x4f')](_0x34dac9);}})['then'](function(_0x3fe4a9){if(_0x3fe4a9){_0x539839=_0x3fe4a9[_0xd21b('0x37')];if(!_0x1c66a5[_0xd21b('0x31')]['hasOwnProperty'](_0xd21b('0x39'))){_0x34dac9[_0xd21b('0x1c')]=qs[_0xd21b('0x1c')](_0x1c66a5['query']['limit']);_0x34dac9['offset']=qs[_0xd21b('0x1b')](_0x1c66a5[_0xd21b('0x31')][_0xd21b('0x1b')]);}return _0x1f3009[_0xd21b('0x4f')](_0x34dac9);}})['then'](function(_0x954333){if(_0x954333){return _0x954333?{'count':_0x539839,'rows':_0x954333}:null;}})[_0xd21b('0x25')](respondWithResult(_0x2c447a,null))[_0xd21b('0x43')](handleError(_0x2c447a,null));};
\ No newline at end of file
index fcde65a..88a395e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8fe=['int_freshsales_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshsalesConfiguration'];(function(_0x25bf90,_0x365827){var _0x2304f0=function(_0x5864ae){while(--_0x5864ae){_0x25bf90['push'](_0x25bf90['shift']());}};_0x2304f0(++_0x365827);}(_0xb8fe,0x1d5));var _0xeb8f=function(_0x5d7dc9,_0x26cc47){_0x5d7dc9=_0x5d7dc9-0x0;var _0x3eefa1=_0xb8fe[_0x5d7dc9];return _0x3eefa1;};'use strict';var _=require(_0xeb8f('0x0'));var util=require(_0xeb8f('0x1'));var logger=require(_0xeb8f('0x2'))(_0xeb8f('0x3'));var moment=require('moment');var BPromise=require(_0xeb8f('0x4'));var rp=require(_0xeb8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb8f('0x6'));var config=require(_0xeb8f('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xeb8f('0x8')]=function(_0x574053,_0x9f96fc){return _0x574053[_0xeb8f('0x9')](_0xeb8f('0xa'),attributes,{'tableName':_0xeb8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa62d=['define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','bluebird','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0xa62d,0x1d9));var _0xda62=function(_0x2f58b4,_0x2d4dc3){_0x2f58b4=_0x2f58b4-0x0;var _0x354ef0=_0xa62d[_0x2f58b4];return _0x354ef0;};'use strict';var _=require(_0xda62('0x0'));var util=require('util');var logger=require(_0xda62('0x1'))(_0xda62('0x2'));var moment=require('moment');var BPromise=require(_0xda62('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xda62('0x4'));var attributes=require(_0xda62('0x5'));module[_0xda62('0x6')]=function(_0x3341d0,_0x53a91c){return _0x3341d0[_0xda62('0x7')](_0xda62('0x8'),attributes,{'tableName':_0xda62('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e2666cd..ddaaeb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa6d=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x15c201,_0x1ee23d){var _0xe8a5de=function(_0x30e87c){while(--_0x30e87c){_0x15c201['push'](_0x15c201['shift']());}};_0xe8a5de(++_0x1ee23d);}(_0xaa6d,0xf6));var _0xdaa6=function(_0x2f5631,_0x3b8253){_0x2f5631=_0x2f5631-0x0;var _0x1c17d4=_0xaa6d[_0x2f5631];return _0x1c17d4;};'use strict';var _=require('lodash');var util=require(_0xdaa6('0x0'));var moment=require('moment');var BPromise=require(_0xdaa6('0x1'));var rs=require(_0xdaa6('0x2'));var fs=require('fs');var Redis=require(_0xdaa6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdaa6('0x4'))(_0xdaa6('0x5'));var config=require('../../config/environment');var jayson=require(_0xdaa6('0x6'));var client=jayson[_0xdaa6('0x7')][_0xdaa6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5988b6,_0x13d74a,_0x441a9e){return new BPromise(function(_0x1dd76d,_0x3d3afa){return client[_0xdaa6('0x9')](_0x5988b6,_0x441a9e)[_0xdaa6('0xa')](function(_0x5d9742){logger[_0xdaa6('0xb')](_0xdaa6('0xc'),_0x13d74a,_0xdaa6('0xd'));logger[_0xdaa6('0xe')](_0xdaa6('0xf'),_0x13d74a,_0xdaa6('0xd'),JSON['stringify'](_0x5d9742));if(_0x5d9742[_0xdaa6('0x10')]){if(_0x5d9742[_0xdaa6('0x10')]['code']===0x1f4){logger[_0xdaa6('0x10')](_0xdaa6('0xc'),_0x13d74a,_0x5d9742[_0xdaa6('0x10')][_0xdaa6('0x11')]);return _0x3d3afa(_0x5d9742[_0xdaa6('0x10')]['message']);}logger[_0xdaa6('0x10')](_0xdaa6('0xc'),_0x13d74a,_0x5d9742[_0xdaa6('0x10')][_0xdaa6('0x11')]);return _0x1dd76d(_0x5d9742[_0xdaa6('0x10')][_0xdaa6('0x11')]);}else{logger['info'](_0xdaa6('0xc'),_0x13d74a,'request\x20sent');_0x1dd76d(_0x5d9742[_0xdaa6('0x12')]['message']);}})[_0xdaa6('0x13')](function(_0x3eb642){logger[_0xdaa6('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x13d74a,_0x3eb642);_0x3d3afa(_0x3eb642);});});}
\ No newline at end of file
+var _0x6e33=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5815af,_0x361f0b){var _0x3f14cb=function(_0x422c47){while(--_0x422c47){_0x5815af['push'](_0x5815af['shift']());}};_0x3f14cb(++_0x361f0b);}(_0x6e33,0x16a));var _0x36e3=function(_0x25ac95,_0x47e24a){_0x25ac95=_0x25ac95-0x0;var _0x1e762b=_0x6e33[_0x25ac95];return _0x1e762b;};'use strict';var _=require(_0x36e3('0x0'));var util=require(_0x36e3('0x1'));var moment=require(_0x36e3('0x2'));var BPromise=require(_0x36e3('0x3'));var rs=require(_0x36e3('0x4'));var fs=require('fs');var Redis=require(_0x36e3('0x5'));var db=require(_0x36e3('0x6'))['db'];var utils=require(_0x36e3('0x7'));var logger=require('../../config/logger')(_0x36e3('0x8'));var config=require('../../config/environment');var jayson=require(_0x36e3('0x9'));var client=jayson[_0x36e3('0xa')][_0x36e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x329032,_0x23bd2d,_0x173d5d){return new BPromise(function(_0xd51087,_0x391ae1){return client[_0x36e3('0xc')](_0x329032,_0x173d5d)[_0x36e3('0xd')](function(_0x4f05b3){logger['info'](_0x36e3('0xe'),_0x23bd2d,_0x36e3('0xf'));logger[_0x36e3('0x10')](_0x36e3('0x11'),_0x23bd2d,_0x36e3('0xf'),JSON[_0x36e3('0x12')](_0x4f05b3));if(_0x4f05b3[_0x36e3('0x13')]){if(_0x4f05b3[_0x36e3('0x13')][_0x36e3('0x14')]===0x1f4){logger[_0x36e3('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x23bd2d,_0x4f05b3['error']['message']);return _0x391ae1(_0x4f05b3[_0x36e3('0x13')][_0x36e3('0x15')]);}logger['error'](_0x36e3('0xe'),_0x23bd2d,_0x4f05b3[_0x36e3('0x13')][_0x36e3('0x15')]);return _0xd51087(_0x4f05b3[_0x36e3('0x13')][_0x36e3('0x15')]);}else{logger['info'](_0x36e3('0xe'),_0x23bd2d,'request\x20sent');_0xd51087(_0x4f05b3[_0x36e3('0x16')][_0x36e3('0x15')]);}})[_0x36e3('0x17')](function(_0xda30a6){logger['error'](_0x36e3('0xe'),_0x23bd2d,_0xda30a6);_0x391ae1(_0xda30a6);});});}
\ No newline at end of file
index 5bf8f61..018f505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2621=['/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0xee3338,_0x49aa57){var _0x4479ce=function(_0x1adc03){while(--_0x1adc03){_0xee3338['push'](_0xee3338['shift']());}};_0x4479ce(++_0x49aa57);}(_0x2621,0x1d2));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var path=require(_0x1262('0x2'));var timeout=require(_0x1262('0x3'));var express=require(_0x1262('0x4'));var router=express[_0x1262('0x5')]();var fs_extra=require(_0x1262('0x6'));var auth=require(_0x1262('0x7'));var interaction=require(_0x1262('0x8'));var config=require(_0x1262('0x9'));var controller=require(_0x1262('0xa'));router[_0x1262('0xb')]('/',auth[_0x1262('0xc')](),controller[_0x1262('0xd')]);router['get'](_0x1262('0xe'),auth['isAuthenticated'](),controller[_0x1262('0xf')]);router['post']('/',auth[_0x1262('0xc')](),controller[_0x1262('0x10')]);router[_0x1262('0x11')]('/:id',auth[_0x1262('0xc')](),controller['update']);router[_0x1262('0x12')](_0x1262('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1262('0x13')]=router;
\ No newline at end of file
+var _0x0c02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','create','put','/:id','exports','util','path','express','Router'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x20c0('0xc')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0xe')](_0x20c0('0xf'),auth[_0x20c0('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x20c0('0x10')]=router;
\ No newline at end of file
index 104ce15..c816756 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53c5=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x423dd4,_0x287532){var _0xb29406=function(_0x577c6f){while(--_0x577c6f){_0x423dd4['push'](_0x423dd4['shift']());}};_0xb29406(++_0x287532);}(_0x53c5,0x1eb));var _0x553c=function(_0x2c43b0,_0x201325){_0x2c43b0=_0x2c43b0-0x0;var _0x3ed8db=_0x53c5[_0x2c43b0];return _0x3ed8db;};'use strict';var Sequelize=require(_0x553c('0x0'));module[_0x553c('0x1')]={'type':{'type':Sequelize[_0x553c('0x2')](_0x553c('0x3'),_0x553c('0x4'),'customVariable',_0x553c('0x5'),_0x553c('0x6')),'defaultValue':_0x553c('0x3')},'content':{'type':Sequelize[_0x553c('0x7')]},'key':{'type':Sequelize[_0x553c('0x7')]},'keyType':{'type':Sequelize[_0x553c('0x2')]('string',_0x553c('0x4'),_0x553c('0x8'))},'keyContent':{'type':Sequelize[_0x553c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x553c('0x7')]},'customField':{'type':Sequelize[_0x553c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb8ce=['keyValue','picklist','STRING','variable','sequelize','exports','ENUM','string'];(function(_0x9ddad9,_0x4d475c){var _0x363c96=function(_0x5954bb){while(--_0x5954bb){_0x9ddad9['push'](_0x9ddad9['shift']());}};_0x363c96(++_0x4d475c);}(_0xb8ce,0xf4));var _0xeb8c=function(_0x4ed4cc,_0x6ec722){_0x4ed4cc=_0x4ed4cc-0x0;var _0x582e1a=_0xb8ce[_0x4ed4cc];return _0x582e1a;};'use strict';var Sequelize=require(_0xeb8c('0x0'));module[_0xeb8c('0x1')]={'type':{'type':Sequelize[_0xeb8c('0x2')](_0xeb8c('0x3'),'variable','customVariable',_0xeb8c('0x4'),_0xeb8c('0x5')),'defaultValue':_0xeb8c('0x3')},'content':{'type':Sequelize[_0xeb8c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xeb8c('0x2')](_0xeb8c('0x3'),_0xeb8c('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xeb8c('0x6')]},'idField':{'type':Sequelize[_0xeb8c('0x6')]},'nameField':{'type':Sequelize[_0xeb8c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeb8c('0x6')]}};
\ No newline at end of file
index f84e62d..41a760b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45fb=['length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','FreshsalesField','fieldName','model','map','intersection','query','attributes','fields'];(function(_0x11c2e5,_0x480741){var _0x1c35de=function(_0x34132e){while(--_0x34132e){_0x11c2e5['push'](_0x11c2e5['shift']());}};_0x1c35de(++_0x480741);}(_0x45fb,0xaf));var _0xb45f=function(_0x3d023a,_0x132fe9){_0x3d023a=_0x3d023a-0x0;var _0x51f483=_0x45fb[_0x3d023a];return _0x51f483;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb45f('0x0'));var zipdir=require(_0xb45f('0x1'));var jsonpatch=require(_0xb45f('0x2'));var rp=require(_0xb45f('0x3'));var moment=require(_0xb45f('0x4'));var BPromise=require(_0xb45f('0x5'));var Mustache=require(_0xb45f('0x6'));var util=require(_0xb45f('0x7'));var path=require('path');var sox=require(_0xb45f('0x8'));var csv=require(_0xb45f('0x9'));var ejs=require(_0xb45f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb45f('0xb'));var squel=require(_0xb45f('0xc'));var crypto=require(_0xb45f('0xd'));var jsforce=require(_0xb45f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb45f('0x9'));var querystring=require(_0xb45f('0xf'));var Papa=require(_0xb45f('0x10'));var Redis=require(_0xb45f('0x11'));var authService=require(_0xb45f('0x12'));var qs=require(_0xb45f('0x13'));var as=require(_0xb45f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb45f('0x15'))(_0xb45f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x459f7e,_0x7c6400){_0x7c6400=_0x7c6400||0xcc;return function(_0x1f75d7){if(_0x1f75d7){return _0x459f7e[_0xb45f('0x17')](_0x7c6400);}return _0x459f7e[_0xb45f('0x18')](_0x7c6400)['end']();};}function respondWithResult(_0x6782ae,_0x899b17){_0x899b17=_0x899b17||0xc8;return function(_0x4424e2){if(_0x4424e2){return _0x6782ae[_0xb45f('0x18')](_0x899b17)[_0xb45f('0x19')](_0x4424e2);}};}function respondWithFilteredResult(_0x4944e6,_0x3bb941){return function(_0x443662){if(_0x443662){var _0x4e14de=typeof _0x3bb941[_0xb45f('0x1a')]===_0xb45f('0x1b')&&typeof _0x3bb941[_0xb45f('0x1c')]===_0xb45f('0x1b');var _0x49986f=_0x443662[_0xb45f('0x1d')];var _0x4a1351=_0x4e14de?0x0:_0x3bb941['offset'];var _0x16ee71=_0x4e14de?_0x443662[_0xb45f('0x1d')]:_0x3bb941['offset']+_0x3bb941[_0xb45f('0x1c')];var _0x1da394;if(_0x16ee71>=_0x49986f){_0x16ee71=_0x49986f;_0x1da394=0xc8;}else{_0x1da394=0xce;}_0x4944e6[_0xb45f('0x18')](_0x1da394);return _0x4944e6[_0xb45f('0x1e')](_0xb45f('0x1f'),_0x4a1351+'-'+_0x16ee71+'/'+_0x49986f)[_0xb45f('0x19')](_0x443662);}return null;};}function patchUpdates(_0x28c81d){return function(_0x75e212){try{jsonpatch['apply'](_0x75e212,_0x28c81d,!![]);}catch(_0x95c1a0){return BPromise[_0xb45f('0x20')](_0x95c1a0);}return _0x75e212[_0xb45f('0x21')]();};}function saveUpdates(_0x54bcd2,_0x3f1465){return function(_0x2cf361){if(_0x2cf361){return _0x2cf361[_0xb45f('0x22')](_0x54bcd2)['then'](function(_0x4f4c52){return _0x4f4c52;});}return null;};}function removeEntity(_0x23d11f,_0x4dcdf4){return function(_0x2e827b){if(_0x2e827b){return _0x2e827b[_0xb45f('0x23')]()['then'](function(){_0x23d11f[_0xb45f('0x18')](0xcc)[_0xb45f('0x24')]();});}};}function handleEntityNotFound(_0x253632,_0x4ff88f){return function(_0x181093){if(!_0x181093){_0x253632[_0xb45f('0x17')](0x194);}return _0x181093;};}function handleError(_0x334195,_0x49cdd3){_0x49cdd3=_0x49cdd3||0x1f4;return function(_0x334d53){logger[_0xb45f('0x25')](_0x334d53[_0xb45f('0x26')]);if(_0x334d53[_0xb45f('0x27')]){delete _0x334d53[_0xb45f('0x27')];}_0x334195[_0xb45f('0x18')](_0x49cdd3)[_0xb45f('0x28')](_0x334d53);};}exports[_0xb45f('0x29')]=function(_0x1aec03,_0x5f49dc){var _0x50380e={},_0x25f3c5={},_0x4be406={'count':0x0,'rows':[]};var _0x1a8e8b=_['map'](db[_0xb45f('0x2a')]['rawAttributes'],function(_0x124602){return{'name':_0x124602[_0xb45f('0x2b')],'type':_0x124602['type']['key']};});_0x25f3c5[_0xb45f('0x2c')]=_[_0xb45f('0x2d')](_0x1a8e8b,_0xb45f('0x27'));_0x25f3c5['query']=_['keys'](_0x1aec03['query']);_0x25f3c5['filters']=_[_0xb45f('0x2e')](_0x25f3c5[_0xb45f('0x2c')],_0x25f3c5[_0xb45f('0x2f')]);_0x50380e[_0xb45f('0x30')]=_[_0xb45f('0x2e')](_0x25f3c5[_0xb45f('0x2c')],qs[_0xb45f('0x31')](_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x31')]));_0x50380e['attributes']=_0x50380e[_0xb45f('0x30')][_0xb45f('0x32')]?_0x50380e[_0xb45f('0x30')]:_0x25f3c5[_0xb45f('0x2c')];if(!_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x33')](_0xb45f('0x34'))){_0x50380e[_0xb45f('0x1c')]=qs[_0xb45f('0x1c')](_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x1c')]);_0x50380e[_0xb45f('0x1a')]=qs[_0xb45f('0x1a')](_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x1a')]);}_0x50380e[_0xb45f('0x35')]=qs[_0xb45f('0x36')](_0x1aec03['query'][_0xb45f('0x36')]);_0x50380e['where']=qs['filters'](_[_0xb45f('0x37')](_0x1aec03[_0xb45f('0x2f')],_0x25f3c5[_0xb45f('0x38')]),_0x1a8e8b);if(_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x39')]){_0x50380e[_0xb45f('0x3a')]=_[_0xb45f('0x3b')](_0x50380e[_0xb45f('0x3a')],{'$or':_[_0xb45f('0x2d')](_0x1a8e8b,function(_0x17f59e){if(_0x17f59e[_0xb45f('0x3c')]!==_0xb45f('0x3d')){var _0x142b2b={};_0x142b2b[_0x17f59e[_0xb45f('0x27')]]={'$like':'%'+_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x39')]+'%'};return _0x142b2b;}})});}_0x50380e=_[_0xb45f('0x3b')]({},_0x50380e,_0x1aec03[_0xb45f('0x3e')]);var _0x7411ab={'where':_0x50380e[_0xb45f('0x3a')]};return db[_0xb45f('0x2a')][_0xb45f('0x1d')](_0x7411ab)[_0xb45f('0x3f')](function(_0x10a910){_0x4be406[_0xb45f('0x1d')]=_0x10a910;if(_0x1aec03[_0xb45f('0x2f')][_0xb45f('0x40')]){_0x50380e[_0xb45f('0x41')]=[{'all':!![]}];}return db[_0xb45f('0x2a')][_0xb45f('0x42')](_0x50380e);})['then'](function(_0x114883){_0x4be406[_0xb45f('0x43')]=_0x114883;return _0x4be406;})[_0xb45f('0x3f')](respondWithFilteredResult(_0x5f49dc,_0x50380e))[_0xb45f('0x44')](handleError(_0x5f49dc,null));};exports['show']=function(_0x31f37d,_0xba7f9a){var _0x2513dd={'raw':!![],'where':{'id':_0x31f37d[_0xb45f('0x45')]['id']}},_0xe680a8={};_0xe680a8['model']=_[_0xb45f('0x46')](db[_0xb45f('0x2a')][_0xb45f('0x47')]);_0xe680a8['query']=_['keys'](_0x31f37d[_0xb45f('0x2f')]);_0xe680a8[_0xb45f('0x38')]=_[_0xb45f('0x2e')](_0xe680a8[_0xb45f('0x2c')],_0xe680a8[_0xb45f('0x2f')]);_0x2513dd[_0xb45f('0x30')]=_[_0xb45f('0x2e')](_0xe680a8[_0xb45f('0x2c')],qs[_0xb45f('0x31')](_0x31f37d[_0xb45f('0x2f')][_0xb45f('0x31')]));_0x2513dd[_0xb45f('0x30')]=_0x2513dd[_0xb45f('0x30')][_0xb45f('0x32')]?_0x2513dd[_0xb45f('0x30')]:_0xe680a8['model'];if(_0x31f37d['query'][_0xb45f('0x40')]){_0x2513dd[_0xb45f('0x41')]=[{'all':!![]}];}_0x2513dd=_['merge']({},_0x2513dd,_0x31f37d['options']);return db[_0xb45f('0x2a')][_0xb45f('0x48')](_0x2513dd)[_0xb45f('0x3f')](handleEntityNotFound(_0xba7f9a,null))['then'](respondWithResult(_0xba7f9a,null))[_0xb45f('0x44')](handleError(_0xba7f9a,null));};exports['create']=function(_0x20f675,_0x2b5cae){return db[_0xb45f('0x2a')][_0xb45f('0x49')](_0x20f675[_0xb45f('0x4a')],{})[_0xb45f('0x3f')](respondWithResult(_0x2b5cae,0xc9))['catch'](handleError(_0x2b5cae,null));};exports[_0xb45f('0x22')]=function(_0x16429a,_0x1eeb6e){if(_0x16429a['body']['id']){delete _0x16429a[_0xb45f('0x4a')]['id'];}return db['FreshsalesField'][_0xb45f('0x48')]({'where':{'id':_0x16429a[_0xb45f('0x45')]['id']}})['then'](handleEntityNotFound(_0x1eeb6e,null))[_0xb45f('0x3f')](saveUpdates(_0x16429a[_0xb45f('0x4a')],null))[_0xb45f('0x3f')](respondWithResult(_0x1eeb6e,null))[_0xb45f('0x44')](handleError(_0x1eeb6e,null));};exports[_0xb45f('0x23')]=function(_0xe50d2f,_0x356468){return db[_0xb45f('0x2a')][_0xb45f('0x48')]({'where':{'id':_0xe50d2f['params']['id']}})[_0xb45f('0x3f')](handleEntityNotFound(_0x356468,null))[_0xb45f('0x3f')](removeEntity(_0x356468,null))[_0xb45f('0x44')](handleError(_0x356468,null));};
\ No newline at end of file
+var _0xe36b=['error','stack','name','send','index','map','FreshsalesField','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','update','find','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus'];(function(_0x4209e6,_0x266b75){var _0x308f96=function(_0x587a84){while(--_0x587a84){_0x4209e6['push'](_0x4209e6['shift']());}};_0x308f96(++_0x266b75);}(_0xe36b,0x171));var _0xbe36=function(_0x42fe1f,_0x397527){_0x42fe1f=_0x42fe1f-0x0;var _0x227761=_0xe36b[_0x42fe1f];return _0x227761;};'use strict';var emlformat=require(_0xbe36('0x0'));var rimraf=require(_0xbe36('0x1'));var zipdir=require(_0xbe36('0x2'));var jsonpatch=require(_0xbe36('0x3'));var rp=require(_0xbe36('0x4'));var moment=require(_0xbe36('0x5'));var BPromise=require(_0xbe36('0x6'));var Mustache=require(_0xbe36('0x7'));var util=require('util');var path=require(_0xbe36('0x8'));var sox=require(_0xbe36('0x9'));var csv=require(_0xbe36('0xa'));var ejs=require(_0xbe36('0xb'));var fs=require('fs');var fs_extra=require(_0xbe36('0xc'));var _=require(_0xbe36('0xd'));var squel=require(_0xbe36('0xe'));var crypto=require(_0xbe36('0xf'));var jsforce=require(_0xbe36('0x10'));var deskjs=require(_0xbe36('0x11'));var toCsv=require(_0xbe36('0xa'));var querystring=require(_0xbe36('0x12'));var Papa=require('papaparse');var Redis=require(_0xbe36('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbe36('0x14'));var as=require(_0xbe36('0x15'));var hardwareService=require(_0xbe36('0x16'));var logger=require(_0xbe36('0x17'))(_0xbe36('0x18'));var utils=require(_0xbe36('0x19'));var config=require(_0xbe36('0x1a'));var licenseUtil=require(_0xbe36('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e1a9d,_0xb234e){_0xb234e=_0xb234e||0xcc;return function(_0x295832){if(_0x295832){return _0x5e1a9d['sendStatus'](_0xb234e);}return _0x5e1a9d[_0xbe36('0x1c')](_0xb234e)[_0xbe36('0x1d')]();};}function respondWithResult(_0x584f2c,_0x59775b){_0x59775b=_0x59775b||0xc8;return function(_0x52275f){if(_0x52275f){return _0x584f2c[_0xbe36('0x1c')](_0x59775b)[_0xbe36('0x1e')](_0x52275f);}};}function respondWithFilteredResult(_0x3f6ec4,_0x36d0e5){return function(_0x51590c){if(_0x51590c){var _0x5194b4=typeof _0x36d0e5[_0xbe36('0x1f')]===_0xbe36('0x20')&&typeof _0x36d0e5[_0xbe36('0x21')]===_0xbe36('0x20');var _0x5e42ca=_0x51590c[_0xbe36('0x22')];var _0xd30b8f=_0x5194b4?0x0:_0x36d0e5[_0xbe36('0x1f')];var _0x4c13ac=_0x5194b4?_0x51590c[_0xbe36('0x22')]:_0x36d0e5[_0xbe36('0x1f')]+_0x36d0e5[_0xbe36('0x21')];var _0x231efb;if(_0x4c13ac>=_0x5e42ca){_0x4c13ac=_0x5e42ca;_0x231efb=0xc8;}else{_0x231efb=0xce;}_0x3f6ec4[_0xbe36('0x1c')](_0x231efb);return _0x3f6ec4['set'](_0xbe36('0x23'),_0xd30b8f+'-'+_0x4c13ac+'/'+_0x5e42ca)[_0xbe36('0x1e')](_0x51590c);}return null;};}function patchUpdates(_0x4b714f){return function(_0x3894cf){try{jsonpatch[_0xbe36('0x24')](_0x3894cf,_0x4b714f,!![]);}catch(_0x45f7f5){return BPromise[_0xbe36('0x25')](_0x45f7f5);}return _0x3894cf[_0xbe36('0x26')]();};}function saveUpdates(_0x582704,_0x59b524){return function(_0x46b143){if(_0x46b143){return _0x46b143['update'](_0x582704)[_0xbe36('0x27')](function(_0x282c13){return _0x282c13;});}return null;};}function removeEntity(_0x4f4111,_0x491d24){return function(_0x5bf499){if(_0x5bf499){return _0x5bf499['destroy']()['then'](function(){_0x4f4111[_0xbe36('0x1c')](0xcc)[_0xbe36('0x1d')]();});}};}function handleEntityNotFound(_0x2d5975,_0x95eba3){return function(_0x29d533){if(!_0x29d533){_0x2d5975[_0xbe36('0x28')](0x194);}return _0x29d533;};}function handleError(_0x55c502,_0xdbf030){_0xdbf030=_0xdbf030||0x1f4;return function(_0x5099d8){logger[_0xbe36('0x29')](_0x5099d8[_0xbe36('0x2a')]);if(_0x5099d8[_0xbe36('0x2b')]){delete _0x5099d8[_0xbe36('0x2b')];}_0x55c502[_0xbe36('0x1c')](_0xdbf030)[_0xbe36('0x2c')](_0x5099d8);};}exports[_0xbe36('0x2d')]=function(_0x26e309,_0x1453e3){var _0x331ea1={},_0x493819={},_0xf8a9ce={'count':0x0,'rows':[]};var _0x29d3bc=_[_0xbe36('0x2e')](db[_0xbe36('0x2f')]['rawAttributes'],function(_0x146c12){return{'name':_0x146c12[_0xbe36('0x30')],'type':_0x146c12[_0xbe36('0x31')][_0xbe36('0x32')]};});_0x493819['model']=_[_0xbe36('0x2e')](_0x29d3bc,_0xbe36('0x2b'));_0x493819[_0xbe36('0x33')]=_[_0xbe36('0x34')](_0x26e309[_0xbe36('0x33')]);_0x493819[_0xbe36('0x35')]=_['intersection'](_0x493819[_0xbe36('0x36')],_0x493819[_0xbe36('0x33')]);_0x331ea1['attributes']=_[_0xbe36('0x37')](_0x493819[_0xbe36('0x36')],qs[_0xbe36('0x38')](_0x26e309[_0xbe36('0x33')]['fields']));_0x331ea1[_0xbe36('0x39')]=_0x331ea1['attributes'][_0xbe36('0x3a')]?_0x331ea1[_0xbe36('0x39')]:_0x493819[_0xbe36('0x36')];if(!_0x26e309[_0xbe36('0x33')][_0xbe36('0x3b')](_0xbe36('0x3c'))){_0x331ea1[_0xbe36('0x21')]=qs[_0xbe36('0x21')](_0x26e309['query'][_0xbe36('0x21')]);_0x331ea1[_0xbe36('0x1f')]=qs[_0xbe36('0x1f')](_0x26e309[_0xbe36('0x33')][_0xbe36('0x1f')]);}_0x331ea1[_0xbe36('0x3d')]=qs[_0xbe36('0x3e')](_0x26e309['query']['sort']);_0x331ea1[_0xbe36('0x3f')]=qs['filters'](_[_0xbe36('0x40')](_0x26e309[_0xbe36('0x33')],_0x493819[_0xbe36('0x35')]),_0x29d3bc);if(_0x26e309[_0xbe36('0x33')][_0xbe36('0x41')]){_0x331ea1[_0xbe36('0x3f')]=_[_0xbe36('0x42')](_0x331ea1[_0xbe36('0x3f')],{'$or':_[_0xbe36('0x2e')](_0x29d3bc,function(_0x23d22e){if(_0x23d22e[_0xbe36('0x31')]!==_0xbe36('0x43')){var _0x2476a0={};_0x2476a0[_0x23d22e[_0xbe36('0x2b')]]={'$like':'%'+_0x26e309[_0xbe36('0x33')]['filter']+'%'};return _0x2476a0;}})});}_0x331ea1=_[_0xbe36('0x42')]({},_0x331ea1,_0x26e309[_0xbe36('0x44')]);var _0x56aacc={'where':_0x331ea1[_0xbe36('0x3f')]};return db[_0xbe36('0x2f')]['count'](_0x56aacc)[_0xbe36('0x27')](function(_0xf88a95){_0xf8a9ce[_0xbe36('0x22')]=_0xf88a95;if(_0x26e309['query'][_0xbe36('0x45')]){_0x331ea1[_0xbe36('0x46')]=[{'all':!![]}];}return db[_0xbe36('0x2f')][_0xbe36('0x47')](_0x331ea1);})[_0xbe36('0x27')](function(_0x451e56){_0xf8a9ce[_0xbe36('0x48')]=_0x451e56;return _0xf8a9ce;})[_0xbe36('0x27')](respondWithFilteredResult(_0x1453e3,_0x331ea1))['catch'](handleError(_0x1453e3,null));};exports[_0xbe36('0x49')]=function(_0x111a2c,_0x53117f){var _0x42934a={'raw':!![],'where':{'id':_0x111a2c[_0xbe36('0x4a')]['id']}},_0x7138eb={};_0x7138eb[_0xbe36('0x36')]=_[_0xbe36('0x34')](db['FreshsalesField'][_0xbe36('0x4b')]);_0x7138eb[_0xbe36('0x33')]=_[_0xbe36('0x34')](_0x111a2c['query']);_0x7138eb[_0xbe36('0x35')]=_[_0xbe36('0x37')](_0x7138eb[_0xbe36('0x36')],_0x7138eb['query']);_0x42934a[_0xbe36('0x39')]=_['intersection'](_0x7138eb[_0xbe36('0x36')],qs[_0xbe36('0x38')](_0x111a2c[_0xbe36('0x33')][_0xbe36('0x38')]));_0x42934a['attributes']=_0x42934a[_0xbe36('0x39')][_0xbe36('0x3a')]?_0x42934a[_0xbe36('0x39')]:_0x7138eb['model'];if(_0x111a2c['query'][_0xbe36('0x45')]){_0x42934a['include']=[{'all':!![]}];}_0x42934a=_[_0xbe36('0x42')]({},_0x42934a,_0x111a2c[_0xbe36('0x44')]);return db['FreshsalesField']['find'](_0x42934a)['then'](handleEntityNotFound(_0x53117f,null))['then'](respondWithResult(_0x53117f,null))[_0xbe36('0x4c')](handleError(_0x53117f,null));};exports[_0xbe36('0x4d')]=function(_0x429c45,_0x2c6f30){return db[_0xbe36('0x2f')][_0xbe36('0x4d')](_0x429c45[_0xbe36('0x4e')],{})[_0xbe36('0x27')](respondWithResult(_0x2c6f30,0xc9))[_0xbe36('0x4c')](handleError(_0x2c6f30,null));};exports[_0xbe36('0x4f')]=function(_0x22e997,_0x499d58){if(_0x22e997[_0xbe36('0x4e')]['id']){delete _0x22e997[_0xbe36('0x4e')]['id'];}return db['FreshsalesField'][_0xbe36('0x50')]({'where':{'id':_0x22e997[_0xbe36('0x4a')]['id']}})[_0xbe36('0x27')](handleEntityNotFound(_0x499d58,null))[_0xbe36('0x27')](saveUpdates(_0x22e997[_0xbe36('0x4e')],null))[_0xbe36('0x27')](respondWithResult(_0x499d58,null))[_0xbe36('0x4c')](handleError(_0x499d58,null));};exports[_0xbe36('0x51')]=function(_0x50da87,_0x4b05cd){return db['FreshsalesField'][_0xbe36('0x50')]({'where':{'id':_0x50da87[_0xbe36('0x4a')]['id']}})[_0xbe36('0x27')](handleEntityNotFound(_0x4b05cd,null))[_0xbe36('0x27')](removeEntity(_0x4b05cd,null))['catch'](handleError(_0x4b05cd,null));};
\ No newline at end of file
index 674b0b1..59f5612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdc2=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./intFreshsalesField.attributes'];(function(_0x278273,_0xc363bb){var _0x28382a=function(_0x2ed6fd){while(--_0x2ed6fd){_0x278273['push'](_0x278273['shift']());}};_0x28382a(++_0xc363bb);}(_0xbdc2,0x148));var _0x2bdc=function(_0x3bfd9a,_0x5c5a47){_0x3bfd9a=_0x3bfd9a-0x0;var _0x34ae7c=_0xbdc2[_0x3bfd9a];return _0x34ae7c;};'use strict';var _=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var logger=require(_0x2bdc('0x2'))(_0x2bdc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2bdc('0x4'));var fs=require('fs');var path=require(_0x2bdc('0x5'));var rimraf=require('rimraf');var config=require(_0x2bdc('0x6'));var attributes=require(_0x2bdc('0x7'));module['exports']=function(_0x1a4381,_0x4bf5cd){return _0x1a4381[_0x2bdc('0x8')](_0x2bdc('0x9'),attributes,{'tableName':_0x2bdc('0xa'),'paranoid':![],'indexes':[{'name':_0x2bdc('0xb'),'fields':[_0x2bdc('0xc'),_0x2bdc('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb875=['moment','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash'];(function(_0x3a8d2b,_0x489d66){var _0x16105a=function(_0x410e39){while(--_0x410e39){_0x3a8d2b['push'](_0x3a8d2b['shift']());}};_0x16105a(++_0x489d66);}(_0xb875,0x167));var _0x5b87=function(_0x17e172,_0xdd45d5){_0x17e172=_0x17e172-0x0;var _0x2e81c8=_0xb875[_0x17e172];return _0x2e81c8;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b87('0x1'));var BPromise=require('bluebird');var rp=require(_0x5b87('0x2'));var fs=require('fs');var path=require(_0x5b87('0x3'));var rimraf=require('rimraf');var config=require(_0x5b87('0x4'));var attributes=require(_0x5b87('0x5'));module[_0x5b87('0x6')]=function(_0x32ed83,_0x253d91){return _0x32ed83[_0x5b87('0x7')](_0x5b87('0x8'),attributes,{'tableName':_0x5b87('0x9'),'paranoid':![],'indexes':[{'name':_0x5b87('0xa'),'fields':[_0x5b87('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7481636..e48b644 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(_0x4f8c28,_0x4cab61){var _0x1a6806=function(_0x58aca2){while(--_0x58aca2){_0x4f8c28['push'](_0x4f8c28['shift']());}};_0x1a6806(++_0x4cab61);}(_0x33af,0xec));var _0xf33a=function(_0x30b2c6,_0x1eafe8){_0x30b2c6=_0x30b2c6-0x0;var _0x42052d=_0x33af[_0x30b2c6];return _0x42052d;};'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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2a9db9,_0x243844){var _0x443614=function(_0x3071c3){while(--_0x3071c3){_0x2a9db9['push'](_0x2a9db9['shift']());}};_0x443614(++_0x243844);}(_0xabce,0x103));var _0xeabc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xabce[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('FreshsalesField,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
index b1a3ac1..e01dfe9 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(_0x5ce608,_0x1aca8e){var _0x582fdf=function(_0x2b358e){while(--_0x2b358e){_0x5ce608['push'](_0x5ce608['shift']());}};_0x582fdf(++_0x1aca8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x15ef76,_0x569e3c){var _0x2f92a7=function(_0x3b765f){while(--_0x3b765f){_0x15ef76['push'](_0x15ef76['shift']());}};_0x2f92a7(++_0x569e3c);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 56ef2a5..1701c77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5360=['STRING','integrationTab','newTab','sequelize','exports'];(function(_0x58f9ec,_0x3188fa){var _0x28dca5=function(_0x1e1559){while(--_0x1e1559){_0x58f9ec['push'](_0x58f9ec['shift']());}};_0x28dca5(++_0x3188fa);}(_0x5360,0x157));var _0x0536=function(_0x14b2ef,_0x526b8e){_0x14b2ef=_0x14b2ef-0x0;var _0x543361=_0x5360[_0x14b2ef];return _0x543361;};'use strict';var Sequelize=require(_0x0536('0x0'));module[_0x0536('0x1')]={'name':{'type':Sequelize[_0x0536('0x2')]},'description':{'type':Sequelize[_0x0536('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x0536('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x0536('0x2')]},'clientSecret':{'type':Sequelize[_0x0536('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0536('0x3'),_0x0536('0x4')),'defaultValue':_0x0536('0x3')}};
\ No newline at end of file
+var _0x928c=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x41c826,_0x59e68a){var _0x1d5b74=function(_0x4c10d4){while(--_0x4c10d4){_0x41c826['push'](_0x41c826['shift']());}};_0x1d5b74(++_0x59e68a);}(_0x928c,0x157));var _0xc928=function(_0x423e72,_0x3ba880){_0x423e72=_0x423e72-0x0;var _0x34cf3d=_0x928c[_0x423e72];return _0x34cf3d;};'use strict';var Sequelize=require(_0xc928('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc928('0x1')]},'username':{'type':Sequelize[_0xc928('0x1')],'unique':_0xc928('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc928('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc928('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc928('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc928('0x3')](_0xc928('0x4'),_0xc928('0x5')),'defaultValue':_0xc928('0x4')}};
\ No newline at end of file
index 7ea7318..6efb8b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5237=['clientId','login','password','isNil','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','SalesforceAccount','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','Descriptions','getDescriptions','channel','SalesforceField','remoteUri','clientSecret','username','securityToken','slice','lastIndexOf'];(function(_0x4db94b,_0x5c2eb1){var _0x1f4cc8=function(_0x23099){while(--_0x23099){_0x4db94b['push'](_0x4db94b['shift']());}};_0x1f4cc8(++_0x5c2eb1);}(_0x5237,0x17d));var _0x7523=function(_0x2ccbc4,_0x45ebf3){_0x2ccbc4=_0x2ccbc4-0x0;var _0x1c9b2f=_0x5237[_0x2ccbc4];return _0x1c9b2f;};'use strict';var emlformat=require(_0x7523('0x0'));var rimraf=require(_0x7523('0x1'));var zipdir=require(_0x7523('0x2'));var jsonpatch=require(_0x7523('0x3'));var rp=require('request-promise');var moment=require(_0x7523('0x4'));var BPromise=require(_0x7523('0x5'));var Mustache=require(_0x7523('0x6'));var util=require(_0x7523('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7523('0x8'));var ejs=require(_0x7523('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7523('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7523('0xb'));var deskjs=require(_0x7523('0xc'));var toCsv=require(_0x7523('0x8'));var querystring=require(_0x7523('0xd'));var Papa=require(_0x7523('0xe'));var Redis=require(_0x7523('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7523('0x10'));var logger=require('../../config/logger')(_0x7523('0x11'));var utils=require('../../config/utils');var config=require(_0x7523('0x12'));var licenseUtil=require(_0x7523('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7523('0x14'));function respondWithStatusCode(_0x3bed25,_0x1e1918){_0x1e1918=_0x1e1918||0xcc;return function(_0x1fc406){if(_0x1fc406){return _0x3bed25[_0x7523('0x15')](_0x1e1918);}return _0x3bed25[_0x7523('0x16')](_0x1e1918)[_0x7523('0x17')]();};}function respondWithResult(_0x2927c2,_0x4728e4){_0x4728e4=_0x4728e4||0xc8;return function(_0x1291a3){if(_0x1291a3){return _0x2927c2[_0x7523('0x16')](_0x4728e4)[_0x7523('0x18')](_0x1291a3);}};}function respondWithFilteredResult(_0x47f41c,_0x5941db){return function(_0x438390){if(_0x438390){var _0x486e2a=typeof _0x5941db[_0x7523('0x19')]===_0x7523('0x1a')&&typeof _0x5941db['limit']===_0x7523('0x1a');var _0x2f4054=_0x438390[_0x7523('0x1b')];var _0x342534=_0x486e2a?0x0:_0x5941db[_0x7523('0x19')];var _0x39b89b=_0x486e2a?_0x438390[_0x7523('0x1b')]:_0x5941db['offset']+_0x5941db[_0x7523('0x1c')];var _0x994fb6;if(_0x39b89b>=_0x2f4054){_0x39b89b=_0x2f4054;_0x994fb6=0xc8;}else{_0x994fb6=0xce;}_0x47f41c[_0x7523('0x16')](_0x994fb6);return _0x47f41c[_0x7523('0x1d')](_0x7523('0x1e'),_0x342534+'-'+_0x39b89b+'/'+_0x2f4054)[_0x7523('0x18')](_0x438390);}return null;};}function patchUpdates(_0x2064e0){return function(_0x536614){try{jsonpatch[_0x7523('0x1f')](_0x536614,_0x2064e0,!![]);}catch(_0xc1e328){return BPromise['reject'](_0xc1e328);}return _0x536614[_0x7523('0x20')]();};}function saveUpdates(_0x4a9508,_0x5e9ae0){return function(_0x2b7337){if(_0x2b7337){return _0x2b7337[_0x7523('0x21')](_0x4a9508)[_0x7523('0x22')](function(_0x277290){return _0x277290;});}return null;};}function removeEntity(_0x13b04e,_0x22c9f4){return function(_0x2245f3){if(_0x2245f3){return _0x2245f3['destroy']()['then'](function(){_0x13b04e['status'](0xcc)[_0x7523('0x17')]();});}};}function handleEntityNotFound(_0x50b20c,_0x3a2931){return function(_0x18ebda){if(!_0x18ebda){_0x50b20c[_0x7523('0x15')](0x194);}return _0x18ebda;};}function handleError(_0x530de3,_0xdef9de){_0xdef9de=_0xdef9de||0x1f4;return function(_0x4013e0){logger[_0x7523('0x23')](_0x4013e0[_0x7523('0x24')]);if(_0x4013e0[_0x7523('0x25')]){delete _0x4013e0[_0x7523('0x25')];}_0x530de3['status'](_0xdef9de)[_0x7523('0x26')](_0x4013e0);};}exports[_0x7523('0x27')]=function(_0x932e2d,_0x1c1158){var _0x581efd={},_0x58cf2e={},_0x4634a5={'count':0x0,'rows':[]};var _0x4c6696=_[_0x7523('0x28')](db['SalesforceAccount'][_0x7523('0x29')],function(_0x1e0cc8){return{'name':_0x1e0cc8['fieldName'],'type':_0x1e0cc8[_0x7523('0x2a')][_0x7523('0x2b')]};});_0x58cf2e[_0x7523('0x2c')]=_[_0x7523('0x28')](_0x4c6696,'name');_0x58cf2e['query']=_['keys'](_0x932e2d[_0x7523('0x2d')]);_0x58cf2e[_0x7523('0x2e')]=_['intersection'](_0x58cf2e['model'],_0x58cf2e[_0x7523('0x2d')]);_0x581efd[_0x7523('0x2f')]=_[_0x7523('0x30')](_0x58cf2e[_0x7523('0x2c')],qs['fields'](_0x932e2d[_0x7523('0x2d')][_0x7523('0x31')]));_0x581efd['attributes']=_0x581efd[_0x7523('0x2f')][_0x7523('0x32')]?_0x581efd[_0x7523('0x2f')]:_0x58cf2e[_0x7523('0x2c')];if(!_0x932e2d[_0x7523('0x2d')][_0x7523('0x33')](_0x7523('0x34'))){_0x581efd[_0x7523('0x1c')]=qs[_0x7523('0x1c')](_0x932e2d[_0x7523('0x2d')][_0x7523('0x1c')]);_0x581efd['offset']=qs[_0x7523('0x19')](_0x932e2d[_0x7523('0x2d')][_0x7523('0x19')]);}_0x581efd[_0x7523('0x35')]=qs[_0x7523('0x36')](_0x932e2d[_0x7523('0x2d')][_0x7523('0x36')]);_0x581efd[_0x7523('0x37')]=qs[_0x7523('0x2e')](_['pick'](_0x932e2d[_0x7523('0x2d')],_0x58cf2e[_0x7523('0x2e')]),_0x4c6696);if(_0x932e2d[_0x7523('0x2d')]['filter']){_0x581efd[_0x7523('0x37')]=_['merge'](_0x581efd[_0x7523('0x37')],{'$or':_['map'](_0x4c6696,function(_0x271e9d){if(_0x271e9d[_0x7523('0x2a')]!==_0x7523('0x38')){var _0x482674={};_0x482674[_0x271e9d[_0x7523('0x25')]]={'$like':'%'+_0x932e2d[_0x7523('0x2d')][_0x7523('0x39')]+'%'};return _0x482674;}})});}_0x581efd=_[_0x7523('0x3a')]({},_0x581efd,_0x932e2d[_0x7523('0x3b')]);var _0x355cb2={'where':_0x581efd[_0x7523('0x37')]};return db[_0x7523('0x3c')][_0x7523('0x1b')](_0x355cb2)['then'](function(_0x1bbdee){_0x4634a5[_0x7523('0x1b')]=_0x1bbdee;if(_0x932e2d[_0x7523('0x2d')][_0x7523('0x3d')]){_0x581efd[_0x7523('0x3e')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x7523('0x3f')](_0x581efd);})[_0x7523('0x22')](function(_0x44a8c0){_0x4634a5[_0x7523('0x40')]=_0x44a8c0;return _0x4634a5;})[_0x7523('0x22')](respondWithFilteredResult(_0x1c1158,_0x581efd))[_0x7523('0x41')](handleError(_0x1c1158,null));};exports[_0x7523('0x42')]=function(_0x2b09ab,_0x2be7c0){var _0xf61c13={'raw':![],'where':{'id':_0x2b09ab['params']['id']}},_0x2a69d1={};_0x2a69d1['model']=_[_0x7523('0x43')](db[_0x7523('0x3c')]['rawAttributes']);_0x2a69d1['query']=_[_0x7523('0x43')](_0x2b09ab['query']);_0x2a69d1[_0x7523('0x2e')]=_[_0x7523('0x30')](_0x2a69d1[_0x7523('0x2c')],_0x2a69d1['query']);_0xf61c13[_0x7523('0x2f')]=_['intersection'](_0x2a69d1[_0x7523('0x2c')],qs[_0x7523('0x31')](_0x2b09ab[_0x7523('0x2d')][_0x7523('0x31')]));_0xf61c13['attributes']=_0xf61c13[_0x7523('0x2f')]['length']?_0xf61c13[_0x7523('0x2f')]:_0x2a69d1['model'];if(_0x2b09ab[_0x7523('0x2d')][_0x7523('0x3d')]){_0xf61c13[_0x7523('0x3e')]=[{'all':!![]}];}_0xf61c13=_['merge']({},_0xf61c13,_0x2b09ab[_0x7523('0x3b')]);return db[_0x7523('0x3c')][_0x7523('0x44')](_0xf61c13)['then'](handleEntityNotFound(_0x2be7c0,null))[_0x7523('0x22')](respondWithResult(_0x2be7c0,null))['catch'](handleError(_0x2be7c0,null));};exports[_0x7523('0x45')]=function(_0x1eda46,_0x2f82ca){return db[_0x7523('0x3c')]['create'](_0x1eda46[_0x7523('0x46')],{})['then'](respondWithResult(_0x2f82ca,0xc9))[_0x7523('0x41')](handleError(_0x2f82ca,null));};exports[_0x7523('0x21')]=function(_0x5731cb,_0x577b63){if(_0x5731cb['body']['id']){delete _0x5731cb[_0x7523('0x46')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x5731cb[_0x7523('0x47')]['id']}})[_0x7523('0x22')](handleEntityNotFound(_0x577b63,null))[_0x7523('0x22')](saveUpdates(_0x5731cb['body'],null))[_0x7523('0x22')](respondWithResult(_0x577b63,null))[_0x7523('0x41')](handleError(_0x577b63,null));};exports['destroy']=function(_0x459cb2,_0x384d0f){return db['SalesforceAccount']['find']({'where':{'id':_0x459cb2[_0x7523('0x47')]['id']}})[_0x7523('0x22')](handleEntityNotFound(_0x384d0f,null))[_0x7523('0x22')](removeEntity(_0x384d0f,null))['catch'](handleError(_0x384d0f,null));};exports[_0x7523('0x48')]=function(_0x18223d,_0x568e72,_0x2d3388){var _0x8cdafc={};var _0x569ddc={};var _0x334068;var _0x5908af;return db[_0x7523('0x3c')][_0x7523('0x49')]({'where':{'id':_0x18223d[_0x7523('0x47')]['id']}})['then'](handleEntityNotFound(_0x568e72,null))[_0x7523('0x22')](function(_0x21248e){if(_0x21248e){_0x334068=_0x21248e;_0x569ddc[_0x7523('0x2c')]=_[_0x7523('0x43')](db[_0x7523('0x4a')][_0x7523('0x29')]);_0x569ddc[_0x7523('0x2d')]=_[_0x7523('0x43')](_0x18223d[_0x7523('0x2d')]);_0x569ddc['filters']=_[_0x7523('0x30')](_0x569ddc[_0x7523('0x2c')],_0x569ddc[_0x7523('0x2d')]);_0x8cdafc[_0x7523('0x2f')]=_['intersection'](_0x569ddc[_0x7523('0x2c')],qs[_0x7523('0x31')](_0x18223d[_0x7523('0x2d')][_0x7523('0x31')]));_0x8cdafc[_0x7523('0x2f')]=_0x8cdafc[_0x7523('0x2f')][_0x7523('0x32')]?_0x8cdafc[_0x7523('0x2f')]:_0x569ddc[_0x7523('0x2c')];_0x8cdafc[_0x7523('0x35')]=qs['sort'](_0x18223d[_0x7523('0x2d')][_0x7523('0x36')]);_0x8cdafc[_0x7523('0x37')]=qs[_0x7523('0x2e')](_[_0x7523('0x4b')](_0x18223d[_0x7523('0x2d')],_0x569ddc[_0x7523('0x2e')]));if(_0x18223d[_0x7523('0x2d')]['filter']){_0x8cdafc[_0x7523('0x37')]=_[_0x7523('0x3a')](_0x8cdafc[_0x7523('0x37')],{'$or':_[_0x7523('0x28')](_0x8cdafc[_0x7523('0x2f')],function(_0x68ec3f){var _0x43f9ff={};_0x43f9ff[_0x68ec3f]={'$like':'%'+_0x18223d[_0x7523('0x2d')][_0x7523('0x39')]+'%'};return _0x43f9ff;})});}_0x8cdafc=_[_0x7523('0x3a')]({},_0x8cdafc,_0x18223d[_0x7523('0x3b')]);return _0x334068[_0x7523('0x48')](_0x8cdafc);}})[_0x7523('0x22')](function(_0x4eb149){if(_0x4eb149){_0x5908af=_0x4eb149['length'];if(!_0x18223d[_0x7523('0x2d')][_0x7523('0x33')](_0x7523('0x34'))){_0x8cdafc[_0x7523('0x1c')]=qs[_0x7523('0x1c')](_0x18223d[_0x7523('0x2d')][_0x7523('0x1c')]);_0x8cdafc[_0x7523('0x19')]=qs[_0x7523('0x19')](_0x18223d[_0x7523('0x2d')][_0x7523('0x19')]);}return _0x334068[_0x7523('0x48')](_0x8cdafc);}})[_0x7523('0x22')](function(_0x47db41){if(_0x47db41){return _0x47db41?{'count':_0x5908af,'rows':_0x47db41}:null;}})[_0x7523('0x22')](respondWithResult(_0x568e72,null))[_0x7523('0x41')](handleError(_0x568e72,null));};exports[_0x7523('0x4c')]=function(_0x1665aa,_0x2c76f2,_0x3970d7){if(_0x1665aa[_0x7523('0x46')]['id']){delete _0x1665aa[_0x7523('0x46')]['id'];}return db[_0x7523('0x3c')][_0x7523('0x49')]({'where':{'id':_0x1665aa['params']['id']}})['then'](handleEntityNotFound(_0x2c76f2,null))[_0x7523('0x22')](function(_0x4032d9){if(_0x4032d9){_0x1665aa[_0x7523('0x46')]['AccountId']=_0x4032d9['id'];_0x1665aa['body']['Subjects']=integrations['getSubjects'](_0x1665aa[_0x7523('0x46')]['channel'],_0x1665aa[_0x7523('0x46')][_0x7523('0x2a')]);_0x1665aa[_0x7523('0x46')][_0x7523('0x4d')]=integrations[_0x7523('0x4e')](_0x1665aa[_0x7523('0x46')][_0x7523('0x4f')],_0x1665aa[_0x7523('0x46')][_0x7523('0x2a')]);return db['SalesforceConfiguration'][_0x7523('0x45')](_0x1665aa[_0x7523('0x46')],{'include':[{'model':db[_0x7523('0x50')],'as':'Subjects'},{'model':db[_0x7523('0x50')],'as':_0x7523('0x4d')}]});}return null;})[_0x7523('0x22')](respondWithResult(_0x2c76f2,null))[_0x7523('0x41')](handleError(_0x2c76f2,null));};exports['getFields']=function(_0x28e8a2,_0x1847a8,_0x363962){var _0x2e99be;var _0x4f4825='';var _0x4650fc='Task';return db[_0x7523('0x3c')][_0x7523('0x49')]({'where':{'id':_0x28e8a2['params']['id']},'attributes':['id',_0x7523('0x51'),'clientId',_0x7523('0x52'),_0x7523('0x53'),'password',_0x7523('0x54')]})[_0x7523('0x22')](handleEntityNotFound(_0x1847a8,null))[_0x7523('0x22')](function(_0x3c9692){if(_0x3c9692){_0x4f4825=_0x3c9692[_0x7523('0x51')];var _0x4abbe7=_0x4f4825[_0x7523('0x55')](-0x1);if(_0x4abbe7==='/'){_0x4f4825=_0x4f4825['substring'](0x0,_0x4f4825[_0x7523('0x56')](_0x4abbe7));}_0x2e99be=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4f4825,'clientId':_0x3c9692[_0x7523('0x57')],'clientSecret':_0x3c9692[_0x7523('0x52')]}});return _0x2e99be[_0x7523('0x58')](_0x3c9692['username'],_0x3c9692[_0x7523('0x59')]['concat'](_0x3c9692[_0x7523('0x54')]));}})['then'](function(_0x49a2b4){if(_0x49a2b4){if(!_[_0x7523('0x5a')](_0x28e8a2['query']['ticketType'])){_0x4650fc=_0x28e8a2[_0x7523('0x2d')]['ticketType'];}return _0x2e99be['sobject'](_0x4650fc)[_0x7523('0x5b')]();}})[_0x7523('0x22')](function(_0x3b3278){var _0x3a5a69=[_0x7523('0x5c'),_0x7523('0x5d'),_0x7523('0x5e'),_0x7523('0x5f'),'Subject',_0x7523('0x60')];var _0x1e1516=[_0x7523('0x61'),_0x7523('0x62'),'picklist',_0x7523('0x63'),_0x7523('0x64'),_0x7523('0x65'),_0x7523('0x66')];if(_0x3b3278){_[_0x7523('0x67')](_0x3b3278[_0x7523('0x31')],function(_0x39fd05){return _0x3a5a69[_0x7523('0x68')](_0x39fd05[_0x7523('0x25')])||!_0x1e1516[_0x7523('0x68')](_0x39fd05['type']);});return{'count':_0x3b3278[_0x7523('0x31')][_0x7523('0x32')],'rows':_[_0x7523('0x28')](_0x3b3278['fields'],function(_0x25ee6f){return{'id':_0x25ee6f[_0x7523('0x25')],'name':_0x25ee6f[_0x7523('0x69')],'custom':_0x25ee6f[_0x7523('0x6a')],'options':_0x25ee6f[_0x7523('0x6b')][_0x7523('0x32')]>0x0?_['map'](_0x25ee6f[_0x7523('0x6b')],function(_0x22b64f){return{'name':_0x22b64f['label'],'value':_0x22b64f[_0x7523('0x6c')]};}):_0x25ee6f['type']==_0x7523('0x63')?[{'name':_0x7523('0x6d'),'value':_0x7523('0x6e')},{'name':_0x7523('0x6f'),'value':_0x7523('0x70')}]:[]};})};}})[_0x7523('0x22')](respondWithResult(_0x1847a8,null))['catch'](function(_0x3780c7){var _0x1a27e9=_0x28e8a2[_0x7523('0x2d')][_0x7523('0x71')]?0x1f4:_0x3780c7['statusCode']||0x1f4;logger[_0x7523('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1a27e9,JSON[_0x7523('0x72')](_0x3780c7));delete _0x3780c7[_0x7523('0x25')];if(_0x1a27e9===0x191){_0x1a27e9=0x190;}_0x1847a8[_0x7523('0x16')](_0x1a27e9)['send'](_0x28e8a2[_0x7523('0x2d')][_0x7523('0x71')]?{'message':_0x7523('0x73'),'statusCode':_0x3780c7[_0x7523('0x74')]}:_0x3780c7);});};
\ No newline at end of file
+var _0x4e80=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','type','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','getConfigurations','SalesforceConfiguration','sort','addConfiguration','findOne','AccountId','channel','SalesforceField','Subjects','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','slice','substring','lastIndexOf','Connection','clientId','login','concat','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x24ad87,_0x2022a0){var _0x58b137=function(_0x2886d8){while(--_0x2886d8){_0x24ad87['push'](_0x24ad87['shift']());}};_0x58b137(++_0x2022a0);}(_0x4e80,0xe9));var _0x04e8=function(_0x58a22f,_0x22721e){_0x58a22f=_0x58a22f-0x0;var _0x239b0e=_0x4e80[_0x58a22f];return _0x239b0e;};'use strict';var emlformat=require(_0x04e8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x04e8('0x1'));var rp=require(_0x04e8('0x2'));var moment=require('moment');var BPromise=require(_0x04e8('0x3'));var Mustache=require('mustache');var util=require(_0x04e8('0x4'));var path=require('path');var sox=require(_0x04e8('0x5'));var csv=require(_0x04e8('0x6'));var ejs=require(_0x04e8('0x7'));var fs=require('fs');var fs_extra=require(_0x04e8('0x8'));var _=require(_0x04e8('0x9'));var squel=require(_0x04e8('0xa'));var crypto=require(_0x04e8('0xb'));var jsforce=require(_0x04e8('0xc'));var deskjs=require(_0x04e8('0xd'));var toCsv=require(_0x04e8('0x6'));var querystring=require(_0x04e8('0xe'));var Papa=require(_0x04e8('0xf'));var Redis=require(_0x04e8('0x10'));var authService=require(_0x04e8('0x11'));var qs=require(_0x04e8('0x12'));var as=require(_0x04e8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04e8('0x14'))(_0x04e8('0x15'));var utils=require(_0x04e8('0x16'));var config=require(_0x04e8('0x17'));var licenseUtil=require(_0x04e8('0x18'));var db=require(_0x04e8('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x515a29,_0xfdd00a){_0xfdd00a=_0xfdd00a||0xcc;return function(_0x37c671){if(_0x37c671){return _0x515a29[_0x04e8('0x1a')](_0xfdd00a);}return _0x515a29[_0x04e8('0x1b')](_0xfdd00a)['end']();};}function respondWithResult(_0x529e05,_0x243563){_0x243563=_0x243563||0xc8;return function(_0x2a2f39){if(_0x2a2f39){return _0x529e05[_0x04e8('0x1b')](_0x243563)['json'](_0x2a2f39);}};}function respondWithFilteredResult(_0x5b22d3,_0x1c0894){return function(_0x3dbd89){if(_0x3dbd89){var _0xb7d65d=typeof _0x1c0894[_0x04e8('0x1c')]==='undefined'&&typeof _0x1c0894[_0x04e8('0x1d')]===_0x04e8('0x1e');var _0x4e473c=_0x3dbd89['count'];var _0x2250fe=_0xb7d65d?0x0:_0x1c0894[_0x04e8('0x1c')];var _0x1c8645=_0xb7d65d?_0x3dbd89[_0x04e8('0x1f')]:_0x1c0894[_0x04e8('0x1c')]+_0x1c0894[_0x04e8('0x1d')];var _0x57a376;if(_0x1c8645>=_0x4e473c){_0x1c8645=_0x4e473c;_0x57a376=0xc8;}else{_0x57a376=0xce;}_0x5b22d3['status'](_0x57a376);return _0x5b22d3[_0x04e8('0x20')](_0x04e8('0x21'),_0x2250fe+'-'+_0x1c8645+'/'+_0x4e473c)[_0x04e8('0x22')](_0x3dbd89);}return null;};}function patchUpdates(_0x46de9c){return function(_0x146069){try{jsonpatch[_0x04e8('0x23')](_0x146069,_0x46de9c,!![]);}catch(_0x56ffcc){return BPromise[_0x04e8('0x24')](_0x56ffcc);}return _0x146069[_0x04e8('0x25')]();};}function saveUpdates(_0x57820b,_0x339572){return function(_0x2ea025){if(_0x2ea025){return _0x2ea025[_0x04e8('0x26')](_0x57820b)[_0x04e8('0x27')](function(_0x583c17){return _0x583c17;});}return null;};}function removeEntity(_0x34a20e,_0x2328b0){return function(_0x5b76cb){if(_0x5b76cb){return _0x5b76cb[_0x04e8('0x28')]()[_0x04e8('0x27')](function(){_0x34a20e[_0x04e8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b45fb,_0x15a43d){return function(_0xef3feb){if(!_0xef3feb){_0x4b45fb[_0x04e8('0x1a')](0x194);}return _0xef3feb;};}function handleError(_0x414c89,_0x385786){_0x385786=_0x385786||0x1f4;return function(_0x179298){logger[_0x04e8('0x29')](_0x179298[_0x04e8('0x2a')]);if(_0x179298[_0x04e8('0x2b')]){delete _0x179298['name'];}_0x414c89[_0x04e8('0x1b')](_0x385786)[_0x04e8('0x2c')](_0x179298);};}exports['index']=function(_0x2130ac,_0x229744){var _0x4bd04f={},_0x184ed2={},_0x11c832={'count':0x0,'rows':[]};var _0x522cc9=_[_0x04e8('0x2d')](db[_0x04e8('0x2e')][_0x04e8('0x2f')],function(_0x4a48b1){return{'name':_0x4a48b1[_0x04e8('0x30')],'type':_0x4a48b1['type']['key']};});_0x184ed2['model']=_['map'](_0x522cc9,_0x04e8('0x2b'));_0x184ed2[_0x04e8('0x31')]=_[_0x04e8('0x32')](_0x2130ac[_0x04e8('0x31')]);_0x184ed2[_0x04e8('0x33')]=_[_0x04e8('0x34')](_0x184ed2[_0x04e8('0x35')],_0x184ed2[_0x04e8('0x31')]);_0x4bd04f['attributes']=_[_0x04e8('0x34')](_0x184ed2[_0x04e8('0x35')],qs[_0x04e8('0x36')](_0x2130ac[_0x04e8('0x31')][_0x04e8('0x36')]));_0x4bd04f['attributes']=_0x4bd04f[_0x04e8('0x37')][_0x04e8('0x38')]?_0x4bd04f[_0x04e8('0x37')]:_0x184ed2[_0x04e8('0x35')];if(!_0x2130ac[_0x04e8('0x31')][_0x04e8('0x39')](_0x04e8('0x3a'))){_0x4bd04f[_0x04e8('0x1d')]=qs[_0x04e8('0x1d')](_0x2130ac['query']['limit']);_0x4bd04f[_0x04e8('0x1c')]=qs[_0x04e8('0x1c')](_0x2130ac[_0x04e8('0x31')][_0x04e8('0x1c')]);}_0x4bd04f[_0x04e8('0x3b')]=qs['sort'](_0x2130ac[_0x04e8('0x31')]['sort']);_0x4bd04f['where']=qs['filters'](_[_0x04e8('0x3c')](_0x2130ac[_0x04e8('0x31')],_0x184ed2[_0x04e8('0x33')]),_0x522cc9);if(_0x2130ac['query'][_0x04e8('0x3d')]){_0x4bd04f[_0x04e8('0x3e')]=_['merge'](_0x4bd04f[_0x04e8('0x3e')],{'$or':_['map'](_0x522cc9,function(_0x153ec8){if(_0x153ec8[_0x04e8('0x3f')]!=='VIRTUAL'){var _0x58aa37={};_0x58aa37[_0x153ec8[_0x04e8('0x2b')]]={'$like':'%'+_0x2130ac[_0x04e8('0x31')][_0x04e8('0x3d')]+'%'};return _0x58aa37;}})});}_0x4bd04f=_[_0x04e8('0x40')]({},_0x4bd04f,_0x2130ac['options']);var _0x261822={'where':_0x4bd04f[_0x04e8('0x3e')]};return db[_0x04e8('0x2e')]['count'](_0x261822)[_0x04e8('0x27')](function(_0x3b7dd0){_0x11c832[_0x04e8('0x1f')]=_0x3b7dd0;if(_0x2130ac['query']['includeAll']){_0x4bd04f[_0x04e8('0x41')]=[{'all':!![]}];}return db[_0x04e8('0x2e')][_0x04e8('0x42')](_0x4bd04f);})[_0x04e8('0x27')](function(_0x53a9b9){_0x11c832[_0x04e8('0x43')]=_0x53a9b9;return _0x11c832;})[_0x04e8('0x27')](respondWithFilteredResult(_0x229744,_0x4bd04f))[_0x04e8('0x44')](handleError(_0x229744,null));};exports[_0x04e8('0x45')]=function(_0x3db6ca,_0x2568f2){var _0x4cb99f={'raw':![],'where':{'id':_0x3db6ca[_0x04e8('0x46')]['id']}},_0x1a8c66={};_0x1a8c66['model']=_[_0x04e8('0x32')](db['SalesforceAccount'][_0x04e8('0x2f')]);_0x1a8c66['query']=_[_0x04e8('0x32')](_0x3db6ca[_0x04e8('0x31')]);_0x1a8c66[_0x04e8('0x33')]=_['intersection'](_0x1a8c66[_0x04e8('0x35')],_0x1a8c66['query']);_0x4cb99f[_0x04e8('0x37')]=_[_0x04e8('0x34')](_0x1a8c66[_0x04e8('0x35')],qs['fields'](_0x3db6ca[_0x04e8('0x31')][_0x04e8('0x36')]));_0x4cb99f[_0x04e8('0x37')]=_0x4cb99f['attributes'][_0x04e8('0x38')]?_0x4cb99f['attributes']:_0x1a8c66[_0x04e8('0x35')];if(_0x3db6ca[_0x04e8('0x31')][_0x04e8('0x47')]){_0x4cb99f[_0x04e8('0x41')]=[{'all':!![]}];}_0x4cb99f=_[_0x04e8('0x40')]({},_0x4cb99f,_0x3db6ca[_0x04e8('0x48')]);return db[_0x04e8('0x2e')][_0x04e8('0x49')](_0x4cb99f)[_0x04e8('0x27')](handleEntityNotFound(_0x2568f2,null))[_0x04e8('0x27')](respondWithResult(_0x2568f2,null))[_0x04e8('0x44')](handleError(_0x2568f2,null));};exports[_0x04e8('0x4a')]=function(_0x2bcb91,_0x59f89b){return db[_0x04e8('0x2e')][_0x04e8('0x4a')](_0x2bcb91[_0x04e8('0x4b')],{})[_0x04e8('0x27')](respondWithResult(_0x59f89b,0xc9))[_0x04e8('0x44')](handleError(_0x59f89b,null));};exports[_0x04e8('0x26')]=function(_0x378f89,_0x142a2a){if(_0x378f89['body']['id']){delete _0x378f89[_0x04e8('0x4b')]['id'];}return db[_0x04e8('0x2e')]['find']({'where':{'id':_0x378f89[_0x04e8('0x46')]['id']}})['then'](handleEntityNotFound(_0x142a2a,null))[_0x04e8('0x27')](saveUpdates(_0x378f89[_0x04e8('0x4b')],null))['then'](respondWithResult(_0x142a2a,null))['catch'](handleError(_0x142a2a,null));};exports[_0x04e8('0x28')]=function(_0x24a98c,_0x32bb1e){return db[_0x04e8('0x2e')][_0x04e8('0x49')]({'where':{'id':_0x24a98c[_0x04e8('0x46')]['id']}})['then'](handleEntityNotFound(_0x32bb1e,null))[_0x04e8('0x27')](removeEntity(_0x32bb1e,null))[_0x04e8('0x44')](handleError(_0x32bb1e,null));};exports[_0x04e8('0x4c')]=function(_0x1b192b,_0x418e6f,_0x2c6d52){var _0x5fb401={};var _0x4ca612={};var _0x3a5fa0;var _0x22140d;return db[_0x04e8('0x2e')]['findOne']({'where':{'id':_0x1b192b[_0x04e8('0x46')]['id']}})[_0x04e8('0x27')](handleEntityNotFound(_0x418e6f,null))[_0x04e8('0x27')](function(_0x21699f){if(_0x21699f){_0x3a5fa0=_0x21699f;_0x4ca612[_0x04e8('0x35')]=_[_0x04e8('0x32')](db[_0x04e8('0x4d')][_0x04e8('0x2f')]);_0x4ca612[_0x04e8('0x31')]=_[_0x04e8('0x32')](_0x1b192b[_0x04e8('0x31')]);_0x4ca612[_0x04e8('0x33')]=_[_0x04e8('0x34')](_0x4ca612[_0x04e8('0x35')],_0x4ca612[_0x04e8('0x31')]);_0x5fb401[_0x04e8('0x37')]=_[_0x04e8('0x34')](_0x4ca612[_0x04e8('0x35')],qs[_0x04e8('0x36')](_0x1b192b[_0x04e8('0x31')][_0x04e8('0x36')]));_0x5fb401[_0x04e8('0x37')]=_0x5fb401['attributes'][_0x04e8('0x38')]?_0x5fb401[_0x04e8('0x37')]:_0x4ca612[_0x04e8('0x35')];_0x5fb401['order']=qs[_0x04e8('0x4e')](_0x1b192b[_0x04e8('0x31')][_0x04e8('0x4e')]);_0x5fb401['where']=qs[_0x04e8('0x33')](_[_0x04e8('0x3c')](_0x1b192b[_0x04e8('0x31')],_0x4ca612[_0x04e8('0x33')]));if(_0x1b192b['query'][_0x04e8('0x3d')]){_0x5fb401[_0x04e8('0x3e')]=_[_0x04e8('0x40')](_0x5fb401[_0x04e8('0x3e')],{'$or':_['map'](_0x5fb401[_0x04e8('0x37')],function(_0x50e73b){var _0x41d64d={};_0x41d64d[_0x50e73b]={'$like':'%'+_0x1b192b[_0x04e8('0x31')]['filter']+'%'};return _0x41d64d;})});}_0x5fb401=_[_0x04e8('0x40')]({},_0x5fb401,_0x1b192b[_0x04e8('0x48')]);return _0x3a5fa0[_0x04e8('0x4c')](_0x5fb401);}})['then'](function(_0x49b6d4){if(_0x49b6d4){_0x22140d=_0x49b6d4[_0x04e8('0x38')];if(!_0x1b192b[_0x04e8('0x31')][_0x04e8('0x39')]('nolimit')){_0x5fb401['limit']=qs[_0x04e8('0x1d')](_0x1b192b[_0x04e8('0x31')]['limit']);_0x5fb401[_0x04e8('0x1c')]=qs[_0x04e8('0x1c')](_0x1b192b['query']['offset']);}return _0x3a5fa0['getConfigurations'](_0x5fb401);}})[_0x04e8('0x27')](function(_0x3149b1){if(_0x3149b1){return _0x3149b1?{'count':_0x22140d,'rows':_0x3149b1}:null;}})[_0x04e8('0x27')](respondWithResult(_0x418e6f,null))[_0x04e8('0x44')](handleError(_0x418e6f,null));};exports[_0x04e8('0x4f')]=function(_0x58c1b4,_0x4f37d3,_0x20b5e9){if(_0x58c1b4[_0x04e8('0x4b')]['id']){delete _0x58c1b4[_0x04e8('0x4b')]['id'];}return db['SalesforceAccount'][_0x04e8('0x50')]({'where':{'id':_0x58c1b4[_0x04e8('0x46')]['id']}})[_0x04e8('0x27')](handleEntityNotFound(_0x4f37d3,null))['then'](function(_0x2fc20d){if(_0x2fc20d){_0x58c1b4['body'][_0x04e8('0x51')]=_0x2fc20d['id'];_0x58c1b4[_0x04e8('0x4b')]['Subjects']=integrations['getSubjects'](_0x58c1b4[_0x04e8('0x4b')]['channel'],_0x58c1b4[_0x04e8('0x4b')]['type']);_0x58c1b4[_0x04e8('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x58c1b4[_0x04e8('0x4b')][_0x04e8('0x52')],_0x58c1b4[_0x04e8('0x4b')]['type']);return db[_0x04e8('0x4d')][_0x04e8('0x4a')](_0x58c1b4[_0x04e8('0x4b')],{'include':[{'model':db[_0x04e8('0x53')],'as':_0x04e8('0x54')},{'model':db[_0x04e8('0x53')],'as':_0x04e8('0x55')}]});}return null;})[_0x04e8('0x27')](respondWithResult(_0x4f37d3,null))['catch'](handleError(_0x4f37d3,null));};exports[_0x04e8('0x56')]=function(_0x199744,_0xe39f0b,_0x293cf1){var _0x5c2787;var _0x554515='';var _0x3723fa=_0x04e8('0x57');return db[_0x04e8('0x2e')][_0x04e8('0x50')]({'where':{'id':_0x199744[_0x04e8('0x46')]['id']},'attributes':['id',_0x04e8('0x58'),'clientId',_0x04e8('0x59'),_0x04e8('0x5a'),_0x04e8('0x5b'),'securityToken']})['then'](handleEntityNotFound(_0xe39f0b,null))[_0x04e8('0x27')](function(_0x258683){if(_0x258683){_0x554515=_0x258683['remoteUri'];var _0x3cab3f=_0x554515[_0x04e8('0x5c')](-0x1);if(_0x3cab3f==='/'){_0x554515=_0x554515[_0x04e8('0x5d')](0x0,_0x554515[_0x04e8('0x5e')](_0x3cab3f));}_0x5c2787=new jsforce[(_0x04e8('0x5f'))]({'oauth2':{'loginUrl':_0x554515,'clientId':_0x258683[_0x04e8('0x60')],'clientSecret':_0x258683[_0x04e8('0x59')]}});return _0x5c2787[_0x04e8('0x61')](_0x258683['username'],_0x258683['password'][_0x04e8('0x62')](_0x258683[_0x04e8('0x63')]));}})[_0x04e8('0x27')](function(_0x4b8c4b){if(_0x4b8c4b){if(!_[_0x04e8('0x64')](_0x199744['query'][_0x04e8('0x65')])){_0x3723fa=_0x199744[_0x04e8('0x31')][_0x04e8('0x65')];}return _0x5c2787[_0x04e8('0x66')](_0x3723fa)['describe']();}})['then'](function(_0x4ed1be){var _0x3c18e4=[_0x04e8('0x67'),_0x04e8('0x68'),_0x04e8('0x69'),_0x04e8('0x6a'),_0x04e8('0x6b'),_0x04e8('0x6c')];var _0x2f1c5f=['string','int',_0x04e8('0x6d'),_0x04e8('0x6e'),_0x04e8('0x6f'),_0x04e8('0x70'),_0x04e8('0x71')];if(_0x4ed1be){_[_0x04e8('0x72')](_0x4ed1be[_0x04e8('0x36')],function(_0x2afe70){return _0x3c18e4['includes'](_0x2afe70['name'])||!_0x2f1c5f[_0x04e8('0x73')](_0x2afe70[_0x04e8('0x3f')]);});return{'count':_0x4ed1be[_0x04e8('0x36')][_0x04e8('0x38')],'rows':_['map'](_0x4ed1be[_0x04e8('0x36')],function(_0x19c527){return{'id':_0x19c527['name'],'name':_0x19c527['label'],'custom':_0x19c527[_0x04e8('0x74')],'options':_0x19c527[_0x04e8('0x75')]['length']>0x0?_['map'](_0x19c527['picklistValues'],function(_0x42b69e){return{'name':_0x42b69e[_0x04e8('0x76')],'value':_0x42b69e[_0x04e8('0x77')]};}):_0x19c527[_0x04e8('0x3f')]==_0x04e8('0x6e')?[{'name':'True','value':'true'},{'name':'False','value':'false'}]:[]};})};}})['then'](respondWithResult(_0xe39f0b,null))['catch'](function(_0x47fb29){var _0x21a827=_0x199744[_0x04e8('0x31')][_0x04e8('0x78')]?0x1f4:_0x47fb29[_0x04e8('0x79')]||0x1f4;logger[_0x04e8('0x29')](_0x04e8('0x7a'),'getFields',_0x21a827,JSON['stringify'](_0x47fb29));delete _0x47fb29[_0x04e8('0x2b')];if(_0x21a827===0x191){_0x21a827=0x190;}_0xe39f0b[_0x04e8('0x1b')](_0x21a827)['send'](_0x199744[_0x04e8('0x31')][_0x04e8('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x47fb29[_0x04e8('0x79')]}:_0x47fb29);});};
\ No newline at end of file
index 538b533..6212b59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ade=['define','int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x0ade,0xab));var _0xe0ad=function(_0x22c805,_0x440f6c){_0x22c805=_0x22c805-0x0;var _0x52a7df=_0x0ade[_0x22c805];return _0x52a7df;};'use strict';var _=require(_0xe0ad('0x0'));var util=require(_0xe0ad('0x1'));var logger=require('../../config/logger')(_0xe0ad('0x2'));var moment=require(_0xe0ad('0x3'));var BPromise=require(_0xe0ad('0x4'));var rp=require(_0xe0ad('0x5'));var fs=require('fs');var path=require(_0xe0ad('0x6'));var rimraf=require(_0xe0ad('0x7'));var config=require('../../config/environment');var attributes=require(_0xe0ad('0x8'));var integrations=require(_0xe0ad('0x9'));module[_0xe0ad('0xa')]=function(_0x38f67b,_0x4426eb){return _0x38f67b[_0xe0ad('0xb')]('SalesforceAccount',attributes,{'tableName':_0xe0ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd691=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','lodash','util','../../config/logger','moment'];(function(_0x3554f9,_0x2a5f35){var _0x253d8b=function(_0x291aac){while(--_0x291aac){_0x3554f9['push'](_0x3554f9['shift']());}};_0x253d8b(++_0x2a5f35);}(_0xd691,0xe6));var _0x1d69=function(_0x405dc0,_0x5f2898){_0x405dc0=_0x405dc0-0x0;var _0x1ed46d=_0xd691[_0x405dc0];return _0x1ed46d;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var logger=require(_0x1d69('0x2'))('api');var moment=require(_0x1d69('0x3'));var BPromise=require(_0x1d69('0x4'));var rp=require(_0x1d69('0x5'));var fs=require('fs');var path=require(_0x1d69('0x6'));var rimraf=require(_0x1d69('0x7'));var config=require(_0x1d69('0x8'));var attributes=require(_0x1d69('0x9'));var integrations=require(_0x1d69('0xa'));module[_0x1d69('0xb')]=function(_0x3b36f5,_0x5a5b0c){return _0x3b36f5['define'](_0x1d69('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2879dad..d96fa9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x701c=['debug','stringify','error','code','message','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','catch','ShowSalesforceAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4eccd4,_0x33e3f2){var _0xa337db=function(_0x49e564){while(--_0x49e564){_0x4eccd4['push'](_0x4eccd4['shift']());}};_0xa337db(++_0x33e3f2);}(_0x701c,0x167));var _0xc701=function(_0x1691fd,_0x2fab1c){_0x1691fd=_0x1691fd-0x0;var _0x2bf50b=_0x701c[_0x1691fd];return _0x2bf50b;};'use strict';var _=require(_0xc701('0x0'));var util=require('util');var moment=require(_0xc701('0x1'));var BPromise=require(_0xc701('0x2'));var rs=require(_0xc701('0x3'));var fs=require('fs');var Redis=require(_0xc701('0x4'));var db=require(_0xc701('0x5'))['db'];var utils=require(_0xc701('0x6'));var logger=require(_0xc701('0x7'))('rpc');var config=require(_0xc701('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc701('0x9')][_0xc701('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1368dc,_0x2fb53a,_0x5cde33){return new BPromise(function(_0x45dacc,_0x1b9125){return client['request'](_0x1368dc,_0x5cde33)[_0xc701('0xb')](function(_0x37aac0){logger[_0xc701('0xc')](_0xc701('0xd'),_0x2fb53a,_0xc701('0xe'));logger[_0xc701('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2fb53a,'request\x20sent',JSON[_0xc701('0x10')](_0x37aac0));if(_0x37aac0[_0xc701('0x11')]){if(_0x37aac0[_0xc701('0x11')][_0xc701('0x12')]===0x1f4){logger[_0xc701('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2fb53a,_0x37aac0['error'][_0xc701('0x13')]);return _0x1b9125(_0x37aac0[_0xc701('0x11')][_0xc701('0x13')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x2fb53a,_0x37aac0[_0xc701('0x11')][_0xc701('0x13')]);return _0x45dacc(_0x37aac0[_0xc701('0x11')]['message']);}else{logger[_0xc701('0xc')](_0xc701('0xd'),_0x2fb53a,_0xc701('0xe'));_0x45dacc(_0x37aac0['result'][_0xc701('0x13')]);}})['catch'](function(_0x513610){logger['error'](_0xc701('0xd'),_0x2fb53a,_0x513610);_0x1b9125(_0x513610);});});}exports['GetSalesforceAccount']=function(_0x503eb4){var _0x16ac02=this;return new Promise(function(_0x204300,_0x4ce70e){return db[_0xc701('0x14')][_0xc701('0x15')]({'raw':_0x503eb4['options']?_0x503eb4[_0xc701('0x16')][_0xc701('0x17')]===undefined?!![]:![]:!![],'where':_0x503eb4['options']?_0x503eb4[_0xc701('0x16')][_0xc701('0x18')]||null:null,'attributes':_0x503eb4[_0xc701('0x16')]?_0x503eb4[_0xc701('0x16')][_0xc701('0x19')]||null:null,'limit':_0x503eb4['options']?_0x503eb4[_0xc701('0x16')][_0xc701('0x1a')]||null:null,'include':_0x503eb4['options']?_0x503eb4[_0xc701('0x16')][_0xc701('0x1b')]?_[_0xc701('0x1c')](_0x503eb4['options']['include'],function(_0x2b89ff){return{'model':db[_0x2b89ff[_0xc701('0x1d')]],'as':_0x2b89ff['as'],'attributes':_0x2b89ff[_0xc701('0x19')],'include':_0x2b89ff['include']?_[_0xc701('0x1c')](_0x2b89ff[_0xc701('0x1b')],function(_0x393905){return{'model':db[_0x393905[_0xc701('0x1d')]],'as':_0x393905['as'],'attributes':_0x393905[_0xc701('0x19')],'include':_0x393905['include']?_[_0xc701('0x1c')](_0x393905[_0xc701('0x1b')],function(_0x46002e){return{'model':db[_0x46002e[_0xc701('0x1d')]],'as':_0x46002e['as'],'attributes':_0x46002e[_0xc701('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc701('0xb')](function(_0x4138c6){logger[_0xc701('0xc')](_0xc701('0x1e'),_0x503eb4);logger[_0xc701('0xf')](_0xc701('0x1e'),_0x503eb4,JSON[_0xc701('0x10')](_0x4138c6));_0x204300(_0x4138c6);})[_0xc701('0x1f')](function(_0x4386c0){logger[_0xc701('0x11')](_0xc701('0x1e'),_0x4386c0[_0xc701('0x13')],_0x503eb4);_0x4ce70e(_0x16ac02['error'](0x1f4,_0x4386c0[_0xc701('0x13')]));});});};exports[_0xc701('0x20')]=function(_0x2d900e){var _0x38bbde=this;return new Promise(function(_0x4ad387,_0x251e21){return db[_0xc701('0x14')][_0xc701('0x21')]({'raw':_0x2d900e[_0xc701('0x16')]?_0x2d900e[_0xc701('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2d900e[_0xc701('0x16')]?_0x2d900e[_0xc701('0x16')][_0xc701('0x18')]||null:null,'attributes':_0x2d900e[_0xc701('0x16')]?_0x2d900e[_0xc701('0x16')][_0xc701('0x19')]||null:null,'include':_0x2d900e[_0xc701('0x16')]?_0x2d900e['options'][_0xc701('0x1b')]?_[_0xc701('0x1c')](_0x2d900e['options'][_0xc701('0x1b')],function(_0x4bc3b1){return{'model':db[_0x4bc3b1[_0xc701('0x1d')]],'as':_0x4bc3b1['as'],'attributes':_0x4bc3b1[_0xc701('0x19')],'include':_0x4bc3b1[_0xc701('0x1b')]?_[_0xc701('0x1c')](_0x4bc3b1[_0xc701('0x1b')],function(_0x10171d){return{'model':db[_0x10171d['model']],'as':_0x10171d['as'],'attributes':_0x10171d[_0xc701('0x19')],'include':_0x10171d[_0xc701('0x1b')]?_['map'](_0x10171d[_0xc701('0x1b')],function(_0x3f6e39){return{'model':db[_0x3f6e39[_0xc701('0x1d')]],'as':_0x3f6e39['as'],'attributes':_0x3f6e39[_0xc701('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcf8907){logger[_0xc701('0xc')]('ShowSalesforceAccount',_0x2d900e);logger[_0xc701('0xf')](_0xc701('0x20'),_0x2d900e,JSON['stringify'](_0xcf8907));_0x4ad387(_0xcf8907);})['catch'](function(_0x2d4435){logger[_0xc701('0x11')](_0xc701('0x20'),_0x2d4435['message'],_0x2d900e);_0x251e21(_0x38bbde[_0xc701('0x11')](0x1f4,_0x2d4435[_0xc701('0x13')]));});});};
\ No newline at end of file
+var _0x6635=['then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6635,0x10d));var _0x5663=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6635[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5663('0x0'));var BPromise=require(_0x5663('0x1'));var rs=require(_0x5663('0x2'));var fs=require('fs');var Redis=require(_0x5663('0x3'));var db=require(_0x5663('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5663('0x5'))(_0x5663('0x6'));var config=require(_0x5663('0x7'));var jayson=require(_0x5663('0x8'));var client=jayson[_0x5663('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f15fc,_0x5382a2,_0xcaac89){return new BPromise(function(_0x23fce5,_0x4351dd){return client[_0x5663('0xa')](_0x1f15fc,_0xcaac89)[_0x5663('0xb')](function(_0x3962e6){logger[_0x5663('0xc')](_0x5663('0xd'),_0x5382a2,'request\x20sent');logger[_0x5663('0xe')](_0x5663('0xf'),_0x5382a2,_0x5663('0x10'),JSON[_0x5663('0x11')](_0x3962e6));if(_0x3962e6[_0x5663('0x12')]){if(_0x3962e6[_0x5663('0x12')][_0x5663('0x13')]===0x1f4){logger[_0x5663('0x12')](_0x5663('0xd'),_0x5382a2,_0x3962e6[_0x5663('0x12')][_0x5663('0x14')]);return _0x4351dd(_0x3962e6[_0x5663('0x12')][_0x5663('0x14')]);}logger[_0x5663('0x12')](_0x5663('0xd'),_0x5382a2,_0x3962e6[_0x5663('0x12')][_0x5663('0x14')]);return _0x23fce5(_0x3962e6[_0x5663('0x12')]['message']);}else{logger[_0x5663('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x5382a2,_0x5663('0x10'));_0x23fce5(_0x3962e6[_0x5663('0x15')][_0x5663('0x14')]);}})[_0x5663('0x16')](function(_0x11a917){logger['error'](_0x5663('0xd'),_0x5382a2,_0x11a917);_0x4351dd(_0x11a917);});});}exports[_0x5663('0x17')]=function(_0x409bcb){var _0x564f17=this;return new Promise(function(_0xd2677e,_0x138000){return db[_0x5663('0x18')]['findAll']({'raw':_0x409bcb[_0x5663('0x19')]?_0x409bcb[_0x5663('0x19')][_0x5663('0x1a')]===undefined?!![]:![]:!![],'where':_0x409bcb[_0x5663('0x19')]?_0x409bcb[_0x5663('0x19')][_0x5663('0x1b')]||null:null,'attributes':_0x409bcb[_0x5663('0x19')]?_0x409bcb['options'][_0x5663('0x1c')]||null:null,'limit':_0x409bcb[_0x5663('0x19')]?_0x409bcb[_0x5663('0x19')][_0x5663('0x1d')]||null:null,'include':_0x409bcb['options']?_0x409bcb[_0x5663('0x19')][_0x5663('0x1e')]?_[_0x5663('0x1f')](_0x409bcb[_0x5663('0x19')][_0x5663('0x1e')],function(_0xabba00){return{'model':db[_0xabba00[_0x5663('0x20')]],'as':_0xabba00['as'],'attributes':_0xabba00[_0x5663('0x1c')],'include':_0xabba00[_0x5663('0x1e')]?_[_0x5663('0x1f')](_0xabba00[_0x5663('0x1e')],function(_0x19f382){return{'model':db[_0x19f382['model']],'as':_0x19f382['as'],'attributes':_0x19f382[_0x5663('0x1c')],'include':_0x19f382[_0x5663('0x1e')]?_[_0x5663('0x1f')](_0x19f382[_0x5663('0x1e')],function(_0xdbed91){return{'model':db[_0xdbed91[_0x5663('0x20')]],'as':_0xdbed91['as'],'attributes':_0xdbed91['attributes']};}):[]};}):[]};}):[]:[]})[_0x5663('0xb')](function(_0x446b8a){logger[_0x5663('0xc')](_0x5663('0x17'),_0x409bcb);logger[_0x5663('0xe')](_0x5663('0x17'),_0x409bcb,JSON['stringify'](_0x446b8a));_0xd2677e(_0x446b8a);})[_0x5663('0x16')](function(_0x3c427c){logger[_0x5663('0x12')]('GetSalesforceAccount',_0x3c427c[_0x5663('0x14')],_0x409bcb);_0x138000(_0x564f17['error'](0x1f4,_0x3c427c[_0x5663('0x14')]));});});};exports[_0x5663('0x21')]=function(_0x1d0479){var _0x24df41=this;return new Promise(function(_0x4e4081,_0x50986a){return db[_0x5663('0x18')][_0x5663('0x22')]({'raw':_0x1d0479[_0x5663('0x19')]?_0x1d0479[_0x5663('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1d0479[_0x5663('0x19')]?_0x1d0479['options'][_0x5663('0x1b')]||null:null,'attributes':_0x1d0479[_0x5663('0x19')]?_0x1d0479[_0x5663('0x19')][_0x5663('0x1c')]||null:null,'include':_0x1d0479[_0x5663('0x19')]?_0x1d0479[_0x5663('0x19')][_0x5663('0x1e')]?_['map'](_0x1d0479['options'][_0x5663('0x1e')],function(_0x5b560a){return{'model':db[_0x5b560a[_0x5663('0x20')]],'as':_0x5b560a['as'],'attributes':_0x5b560a[_0x5663('0x1c')],'include':_0x5b560a[_0x5663('0x1e')]?_['map'](_0x5b560a[_0x5663('0x1e')],function(_0x2624fa){return{'model':db[_0x2624fa[_0x5663('0x20')]],'as':_0x2624fa['as'],'attributes':_0x2624fa['attributes'],'include':_0x2624fa[_0x5663('0x1e')]?_[_0x5663('0x1f')](_0x2624fa[_0x5663('0x1e')],function(_0x59c7d7){return{'model':db[_0x59c7d7['model']],'as':_0x59c7d7['as'],'attributes':_0x59c7d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5663('0xb')](function(_0x37c686){logger[_0x5663('0xc')]('ShowSalesforceAccount',_0x1d0479);logger[_0x5663('0xe')](_0x5663('0x21'),_0x1d0479,JSON[_0x5663('0x11')](_0x37c686));_0x4e4081(_0x37c686);})[_0x5663('0x16')](function(_0x4943d2){logger[_0x5663('0x12')](_0x5663('0x21'),_0x4943d2[_0x5663('0x14')],_0x1d0479);_0x50986a(_0x24df41[_0x5663('0x12')](0x1f4,_0x4943d2['message']));});});};
\ No newline at end of file
index ecd72a3..5a7f9a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x3168b9,_0xb7822c){var _0x4cc1e3=function(_0x42c64e){while(--_0x42c64e){_0x3168b9['push'](_0x3168b9['shift']());}};_0x4cc1e3(++_0xb7822c);}(_0xadb5,0xad));var _0x5adb=function(_0x130079,_0x58b2d2){_0x130079=_0x130079-0x0;var _0x5c38ef=_0xadb5[_0x130079];return _0x5c38ef;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router;
\ No newline at end of file
+var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11adbd,_0x5055f5){_0x11adbd=_0x11adbd-0x0;var _0x270029=_0x0b0e[_0x11adbd];return _0x270029;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router;
\ No newline at end of file
index cd957bb..aadb333 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe766=['Case','Task','contact_lead','contact','lead','account_contact_lead','account','STRING','sequelize','exports','ENUM'];(function(_0x5e68ca,_0x5f1fe4){var _0xb452a1=function(_0xb692df){while(--_0xb692df){_0x5e68ca['push'](_0x5e68ca['shift']());}};_0xb452a1(++_0x5f1fe4);}(_0xe766,0x17e));var _0x6e76=function(_0x35f9d4,_0x5dea15){_0x35f9d4=_0x35f9d4-0x0;var _0xfbbb29=_0xe766[_0x35f9d4];return _0xfbbb29;};'use strict';var Sequelize=require(_0x6e76('0x0'));module[_0x6e76('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x6e76('0x2')]('Task',_0x6e76('0x3')),'defaultValue':_0x6e76('0x4')},'moduleSearch':{'type':Sequelize[_0x6e76('0x2')](_0x6e76('0x5'),_0x6e76('0x6'),_0x6e76('0x7'),_0x6e76('0x8'),_0x6e76('0x9')),'defaultValue':_0x6e76('0x5')},'moduleCreate':{'type':Sequelize[_0x6e76('0x2')]('nothing',_0x6e76('0x6'),_0x6e76('0x7'),_0x6e76('0x9')),'defaultValue':_0x6e76('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x6e76('0xa')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x6e76('0xa')]}};
\ No newline at end of file
+var _0xc863=['Case','contact_lead','lead','account','nothing','contact','sequelize','exports','STRING','ENUM','Task'];(function(_0x2b7fd8,_0x14677e){var _0x53d1ac=function(_0x43768c){while(--_0x43768c){_0x2b7fd8['push'](_0x2b7fd8['shift']());}};_0x53d1ac(++_0x14677e);}(_0xc863,0x1ea));var _0x3c86=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xc863[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0x3c86('0x0'));module[_0x3c86('0x1')]={'name':{'type':Sequelize[_0x3c86('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3c86('0x3')](_0x3c86('0x4'),_0x3c86('0x5')),'defaultValue':_0x3c86('0x4')},'moduleSearch':{'type':Sequelize[_0x3c86('0x3')](_0x3c86('0x6'),'contact',_0x3c86('0x7'),'account_contact_lead',_0x3c86('0x8')),'defaultValue':_0x3c86('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x3c86('0x9'),_0x3c86('0xa'),_0x3c86('0x7'),_0x3c86('0x8')),'defaultValue':_0x3c86('0x7')},'leadId':{'type':Sequelize[_0x3c86('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x3c86('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x3c86('0x2')]}};
\ No newline at end of file
index 1d14a7e..62f6488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60f3=['filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','getFields','findOne','SalesforceField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','VIRTUAL'];(function(_0x2e6d0e,_0x269605){var _0x1a4b7b=function(_0x2fc032){while(--_0x2fc032){_0x2e6d0e['push'](_0x2e6d0e['shift']());}};_0x1a4b7b(++_0x269605);}(_0x60f3,0xb2));var _0x360f=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0x60f3[_0x8af54b];return _0x27d8f0;};'use strict';var emlformat=require(_0x360f('0x0'));var rimraf=require(_0x360f('0x1'));var zipdir=require(_0x360f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x360f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x360f('0x4'));var util=require(_0x360f('0x5'));var path=require('path');var sox=require(_0x360f('0x6'));var csv=require(_0x360f('0x7'));var ejs=require(_0x360f('0x8'));var fs=require('fs');var fs_extra=require(_0x360f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x360f('0xa'));var jsforce=require(_0x360f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x360f('0x7'));var querystring=require(_0x360f('0xc'));var Papa=require(_0x360f('0xd'));var Redis=require(_0x360f('0xe'));var authService=require(_0x360f('0xf'));var qs=require(_0x360f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x360f('0x11'));var logger=require(_0x360f('0x12'))(_0x360f('0x13'));var utils=require(_0x360f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x360f('0x15'));var db=require(_0x360f('0x16'))['db'];function respondWithStatusCode(_0x3d5b8f,_0x42c5be){_0x42c5be=_0x42c5be||0xcc;return function(_0x404f37){if(_0x404f37){return _0x3d5b8f['sendStatus'](_0x42c5be);}return _0x3d5b8f[_0x360f('0x17')](_0x42c5be)['end']();};}function respondWithResult(_0x5ba3fd,_0x35cfa2){_0x35cfa2=_0x35cfa2||0xc8;return function(_0x5cdd71){if(_0x5cdd71){return _0x5ba3fd['status'](_0x35cfa2)[_0x360f('0x18')](_0x5cdd71);}};}function respondWithFilteredResult(_0x587ae6,_0x371f42){return function(_0x4dd6df){if(_0x4dd6df){var _0x2300ce=typeof _0x371f42[_0x360f('0x19')]==='undefined'&&typeof _0x371f42[_0x360f('0x1a')]===_0x360f('0x1b');var _0x522711=_0x4dd6df['count'];var _0x4b177d=_0x2300ce?0x0:_0x371f42[_0x360f('0x19')];var _0xfe5ab6=_0x2300ce?_0x4dd6df[_0x360f('0x1c')]:_0x371f42[_0x360f('0x19')]+_0x371f42['limit'];var _0x1549a0;if(_0xfe5ab6>=_0x522711){_0xfe5ab6=_0x522711;_0x1549a0=0xc8;}else{_0x1549a0=0xce;}_0x587ae6[_0x360f('0x17')](_0x1549a0);return _0x587ae6[_0x360f('0x1d')](_0x360f('0x1e'),_0x4b177d+'-'+_0xfe5ab6+'/'+_0x522711)['json'](_0x4dd6df);}return null;};}function patchUpdates(_0x3d3067){return function(_0x2a56d0){try{jsonpatch[_0x360f('0x1f')](_0x2a56d0,_0x3d3067,!![]);}catch(_0x2aabf2){return BPromise[_0x360f('0x20')](_0x2aabf2);}return _0x2a56d0['save']();};}function saveUpdates(_0x513cf4,_0x517c7b){return function(_0x3ea0a9){if(_0x3ea0a9){return _0x3ea0a9[_0x360f('0x21')](_0x513cf4)[_0x360f('0x22')](function(_0x5b9203){return _0x5b9203;});}return null;};}function removeEntity(_0x5778db,_0x153cc9){return function(_0x23a680){if(_0x23a680){return _0x23a680[_0x360f('0x23')]()[_0x360f('0x22')](function(){_0x5778db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9126,_0x2db35d){return function(_0x49e80f){if(!_0x49e80f){_0x1f9126[_0x360f('0x24')](0x194);}return _0x49e80f;};}function handleError(_0x379a91,_0x8e92c0){_0x8e92c0=_0x8e92c0||0x1f4;return function(_0x59bbb7){logger[_0x360f('0x25')](_0x59bbb7[_0x360f('0x26')]);if(_0x59bbb7[_0x360f('0x27')]){delete _0x59bbb7['name'];}_0x379a91[_0x360f('0x17')](_0x8e92c0)[_0x360f('0x28')](_0x59bbb7);};}exports[_0x360f('0x29')]=function(_0x3df90a,_0x168981){var _0xd499ff={},_0x3ac80e={},_0x59f062={'count':0x0,'rows':[]};var _0x963931=_[_0x360f('0x2a')](db[_0x360f('0x2b')][_0x360f('0x2c')],function(_0x4a0da2){return{'name':_0x4a0da2['fieldName'],'type':_0x4a0da2[_0x360f('0x2d')][_0x360f('0x2e')]};});_0x3ac80e[_0x360f('0x2f')]=_[_0x360f('0x2a')](_0x963931,_0x360f('0x27'));_0x3ac80e[_0x360f('0x30')]=_[_0x360f('0x31')](_0x3df90a['query']);_0x3ac80e[_0x360f('0x32')]=_[_0x360f('0x33')](_0x3ac80e[_0x360f('0x2f')],_0x3ac80e[_0x360f('0x30')]);_0xd499ff[_0x360f('0x34')]=_['intersection'](_0x3ac80e[_0x360f('0x2f')],qs['fields'](_0x3df90a[_0x360f('0x30')][_0x360f('0x35')]));_0xd499ff[_0x360f('0x34')]=_0xd499ff[_0x360f('0x34')]['length']?_0xd499ff[_0x360f('0x34')]:_0x3ac80e[_0x360f('0x2f')];if(!_0x3df90a[_0x360f('0x30')]['hasOwnProperty'](_0x360f('0x36'))){_0xd499ff[_0x360f('0x1a')]=qs[_0x360f('0x1a')](_0x3df90a['query'][_0x360f('0x1a')]);_0xd499ff[_0x360f('0x19')]=qs[_0x360f('0x19')](_0x3df90a[_0x360f('0x30')][_0x360f('0x19')]);}_0xd499ff['order']=qs[_0x360f('0x37')](_0x3df90a[_0x360f('0x30')][_0x360f('0x37')]);_0xd499ff[_0x360f('0x38')]=qs[_0x360f('0x32')](_[_0x360f('0x39')](_0x3df90a[_0x360f('0x30')],_0x3ac80e[_0x360f('0x32')]),_0x963931);if(_0x3df90a[_0x360f('0x30')]['filter']){_0xd499ff[_0x360f('0x38')]=_['merge'](_0xd499ff[_0x360f('0x38')],{'$or':_[_0x360f('0x2a')](_0x963931,function(_0x31fbc0){if(_0x31fbc0[_0x360f('0x2d')]!==_0x360f('0x3a')){var _0x3b4e23={};_0x3b4e23[_0x31fbc0[_0x360f('0x27')]]={'$like':'%'+_0x3df90a['query'][_0x360f('0x3b')]+'%'};return _0x3b4e23;}})});}_0xd499ff=_[_0x360f('0x3c')]({},_0xd499ff,_0x3df90a[_0x360f('0x3d')]);var _0x3a5f9c={'where':_0xd499ff[_0x360f('0x38')]};return db[_0x360f('0x2b')][_0x360f('0x1c')](_0x3a5f9c)[_0x360f('0x22')](function(_0x5783b4){_0x59f062[_0x360f('0x1c')]=_0x5783b4;if(_0x3df90a[_0x360f('0x30')][_0x360f('0x3e')]){_0xd499ff[_0x360f('0x3f')]=[{'all':!![]}];}return db[_0x360f('0x2b')][_0x360f('0x40')](_0xd499ff);})[_0x360f('0x22')](function(_0x2881a0){_0x59f062['rows']=_0x2881a0;return _0x59f062;})[_0x360f('0x22')](respondWithFilteredResult(_0x168981,_0xd499ff))[_0x360f('0x41')](handleError(_0x168981,null));};exports[_0x360f('0x42')]=function(_0x5e98a5,_0x38ac5c){var _0x59ff3b={'raw':![],'where':{'id':_0x5e98a5[_0x360f('0x43')]['id']}},_0x548ae1={};_0x548ae1['model']=_[_0x360f('0x31')](db[_0x360f('0x2b')]['rawAttributes']);_0x548ae1[_0x360f('0x30')]=_[_0x360f('0x31')](_0x5e98a5[_0x360f('0x30')]);_0x548ae1[_0x360f('0x32')]=_[_0x360f('0x33')](_0x548ae1[_0x360f('0x2f')],_0x548ae1[_0x360f('0x30')]);_0x59ff3b['attributes']=_[_0x360f('0x33')](_0x548ae1[_0x360f('0x2f')],qs[_0x360f('0x35')](_0x5e98a5[_0x360f('0x30')][_0x360f('0x35')]));_0x59ff3b['attributes']=_0x59ff3b[_0x360f('0x34')][_0x360f('0x44')]?_0x59ff3b['attributes']:_0x548ae1[_0x360f('0x2f')];if(_0x5e98a5[_0x360f('0x30')][_0x360f('0x3e')]){_0x59ff3b[_0x360f('0x3f')]=[{'all':!![]}];}_0x59ff3b=_[_0x360f('0x3c')]({},_0x59ff3b,_0x5e98a5[_0x360f('0x3d')]);return db[_0x360f('0x2b')][_0x360f('0x45')](_0x59ff3b)[_0x360f('0x22')](handleEntityNotFound(_0x38ac5c,null))[_0x360f('0x22')](respondWithResult(_0x38ac5c,null))[_0x360f('0x41')](handleError(_0x38ac5c,null));};exports['create']=function(_0x4c161e,_0x11eef1){return db[_0x360f('0x2b')][_0x360f('0x46')](_0x4c161e[_0x360f('0x47')],{})[_0x360f('0x22')](respondWithResult(_0x11eef1,0xc9))[_0x360f('0x41')](handleError(_0x11eef1,null));};exports[_0x360f('0x21')]=function(_0x49957b,_0x3f3d82){if(_0x49957b[_0x360f('0x47')]['id']){delete _0x49957b[_0x360f('0x47')]['id'];}return db[_0x360f('0x2b')]['find']({'where':{'id':_0x49957b[_0x360f('0x43')]['id']}})[_0x360f('0x22')](handleEntityNotFound(_0x3f3d82,null))['then'](saveUpdates(_0x49957b[_0x360f('0x47')],null))[_0x360f('0x22')](respondWithResult(_0x3f3d82,null))['catch'](handleError(_0x3f3d82,null));};exports[_0x360f('0x23')]=function(_0x5a53ec,_0x332276){return db[_0x360f('0x2b')][_0x360f('0x45')]({'where':{'id':_0x5a53ec[_0x360f('0x43')]['id']}})[_0x360f('0x22')](handleEntityNotFound(_0x332276,null))[_0x360f('0x22')](removeEntity(_0x332276,null))[_0x360f('0x41')](handleError(_0x332276,null));};exports[_0x360f('0x48')]=function(_0x37eca3,_0x430f71,_0x8ff473){var _0x571a3f={};var _0x4457d8={};var _0x4785e4;var _0x563e46;return db[_0x360f('0x2b')][_0x360f('0x49')]({'where':{'id':_0x37eca3[_0x360f('0x43')]['id']}})[_0x360f('0x22')](handleEntityNotFound(_0x430f71,null))[_0x360f('0x22')](function(_0x312dd7){if(_0x312dd7){_0x4785e4=_0x312dd7;_0x4457d8[_0x360f('0x2f')]=_[_0x360f('0x31')](db[_0x360f('0x4a')][_0x360f('0x2c')]);_0x4457d8['query']=_['keys'](_0x37eca3['query']);_0x4457d8[_0x360f('0x32')]=_[_0x360f('0x33')](_0x4457d8[_0x360f('0x2f')],_0x4457d8[_0x360f('0x30')]);_0x571a3f[_0x360f('0x34')]=_['intersection'](_0x4457d8[_0x360f('0x2f')],qs['fields'](_0x37eca3['query'][_0x360f('0x35')]));_0x571a3f['attributes']=_0x571a3f[_0x360f('0x34')][_0x360f('0x44')]?_0x571a3f[_0x360f('0x34')]:_0x4457d8['model'];_0x571a3f[_0x360f('0x4b')]=qs[_0x360f('0x37')](_0x37eca3[_0x360f('0x30')][_0x360f('0x37')]);_0x571a3f[_0x360f('0x38')]=qs['filters'](_[_0x360f('0x39')](_0x37eca3['query'],_0x4457d8[_0x360f('0x32')]));if(_0x37eca3[_0x360f('0x30')]['filter']){_0x571a3f[_0x360f('0x38')]=_['merge'](_0x571a3f[_0x360f('0x38')],{'$or':_[_0x360f('0x2a')](_0x571a3f[_0x360f('0x34')],function(_0x484fb3){var _0x199ad8={};_0x199ad8[_0x484fb3]={'$like':'%'+_0x37eca3[_0x360f('0x30')]['filter']+'%'};return _0x199ad8;})});}_0x571a3f=_['merge']({},_0x571a3f,_0x37eca3['options']);return _0x4785e4[_0x360f('0x48')](_0x571a3f);}})[_0x360f('0x22')](function(_0x5e24c2){if(_0x5e24c2){_0x563e46=_0x5e24c2['length'];if(!_0x37eca3[_0x360f('0x30')][_0x360f('0x4c')](_0x360f('0x36'))){_0x571a3f[_0x360f('0x1a')]=qs['limit'](_0x37eca3['query'][_0x360f('0x1a')]);_0x571a3f[_0x360f('0x19')]=qs['offset'](_0x37eca3[_0x360f('0x30')][_0x360f('0x19')]);}return _0x4785e4[_0x360f('0x48')](_0x571a3f);}})[_0x360f('0x22')](function(_0xf34e11){if(_0xf34e11){return _0xf34e11?{'count':_0x563e46,'rows':_0xf34e11}:null;}})['then'](respondWithResult(_0x430f71,null))[_0x360f('0x41')](handleError(_0x430f71,null));};exports['getSubjects']=function(_0xdd81ef,_0x3d88e9,_0x1de040){var _0x1bd30c={};var _0x2b7df0={};var _0x29131e;var _0x14a3fe;return db[_0x360f('0x2b')][_0x360f('0x49')]({'where':{'id':_0xdd81ef['params']['id']}})[_0x360f('0x22')](handleEntityNotFound(_0x3d88e9,null))[_0x360f('0x22')](function(_0x4385ca){if(_0x4385ca){_0x29131e=_0x4385ca;_0x2b7df0['model']=_[_0x360f('0x31')](db[_0x360f('0x4a')][_0x360f('0x2c')]);_0x2b7df0[_0x360f('0x30')]=_['keys'](_0xdd81ef[_0x360f('0x30')]);_0x2b7df0[_0x360f('0x32')]=_['intersection'](_0x2b7df0['model'],_0x2b7df0[_0x360f('0x30')]);_0x1bd30c[_0x360f('0x34')]=_[_0x360f('0x33')](_0x2b7df0[_0x360f('0x2f')],qs[_0x360f('0x35')](_0xdd81ef[_0x360f('0x30')][_0x360f('0x35')]));_0x1bd30c[_0x360f('0x34')]=_0x1bd30c[_0x360f('0x34')][_0x360f('0x44')]?_0x1bd30c['attributes']:_0x2b7df0[_0x360f('0x2f')];_0x1bd30c['order']=qs[_0x360f('0x37')](_0xdd81ef[_0x360f('0x30')][_0x360f('0x37')]);_0x1bd30c['where']=qs[_0x360f('0x32')](_['pick'](_0xdd81ef[_0x360f('0x30')],_0x2b7df0[_0x360f('0x32')]));if(_0xdd81ef['query']['filter']){_0x1bd30c['where']=_[_0x360f('0x3c')](_0x1bd30c[_0x360f('0x38')],{'$or':_[_0x360f('0x2a')](_0x1bd30c[_0x360f('0x34')],function(_0xbcb205){var _0x5ccaa1={};_0x5ccaa1[_0xbcb205]={'$like':'%'+_0xdd81ef['query'][_0x360f('0x3b')]+'%'};return _0x5ccaa1;})});}_0x1bd30c=_[_0x360f('0x3c')]({},_0x1bd30c,_0xdd81ef['options']);return _0x29131e[_0x360f('0x4d')](_0x1bd30c);}})[_0x360f('0x22')](function(_0x23f8d3){if(_0x23f8d3){_0x14a3fe=_0x23f8d3[_0x360f('0x44')];if(!_0xdd81ef[_0x360f('0x30')][_0x360f('0x4c')]('nolimit')){_0x1bd30c[_0x360f('0x1a')]=qs[_0x360f('0x1a')](_0xdd81ef[_0x360f('0x30')][_0x360f('0x1a')]);_0x1bd30c[_0x360f('0x19')]=qs['offset'](_0xdd81ef[_0x360f('0x30')][_0x360f('0x19')]);}return _0x29131e[_0x360f('0x4d')](_0x1bd30c);}})['then'](function(_0x35f1ab){if(_0x35f1ab){return _0x35f1ab?{'count':_0x14a3fe,'rows':_0x35f1ab}:null;}})['then'](respondWithResult(_0x3d88e9,null))['catch'](handleError(_0x3d88e9,null));};exports['getDescriptions']=function(_0x29bc04,_0x203881,_0x3c8a74){var _0x705da1={};var _0x43eba4={};var _0x276cbe;var _0x9a3e3b;return db[_0x360f('0x2b')][_0x360f('0x49')]({'where':{'id':_0x29bc04[_0x360f('0x43')]['id']}})['then'](handleEntityNotFound(_0x203881,null))[_0x360f('0x22')](function(_0x20f096){if(_0x20f096){_0x276cbe=_0x20f096;_0x43eba4[_0x360f('0x2f')]=_[_0x360f('0x31')](db[_0x360f('0x4a')][_0x360f('0x2c')]);_0x43eba4[_0x360f('0x30')]=_[_0x360f('0x31')](_0x29bc04[_0x360f('0x30')]);_0x43eba4[_0x360f('0x32')]=_[_0x360f('0x33')](_0x43eba4[_0x360f('0x2f')],_0x43eba4[_0x360f('0x30')]);_0x705da1[_0x360f('0x34')]=_[_0x360f('0x33')](_0x43eba4[_0x360f('0x2f')],qs[_0x360f('0x35')](_0x29bc04[_0x360f('0x30')]['fields']));_0x705da1[_0x360f('0x34')]=_0x705da1[_0x360f('0x34')][_0x360f('0x44')]?_0x705da1['attributes']:_0x43eba4['model'];_0x705da1['order']=qs[_0x360f('0x37')](_0x29bc04[_0x360f('0x30')][_0x360f('0x37')]);_0x705da1['where']=qs[_0x360f('0x32')](_['pick'](_0x29bc04[_0x360f('0x30')],_0x43eba4[_0x360f('0x32')]));if(_0x29bc04[_0x360f('0x30')][_0x360f('0x3b')]){_0x705da1[_0x360f('0x38')]=_['merge'](_0x705da1[_0x360f('0x38')],{'$or':_[_0x360f('0x2a')](_0x705da1[_0x360f('0x34')],function(_0x4f3d11){var _0x2f405e={};_0x2f405e[_0x4f3d11]={'$like':'%'+_0x29bc04['query']['filter']+'%'};return _0x2f405e;})});}_0x705da1=_[_0x360f('0x3c')]({},_0x705da1,_0x29bc04[_0x360f('0x3d')]);return _0x276cbe['getDescriptions'](_0x705da1);}})[_0x360f('0x22')](function(_0x2874d7){if(_0x2874d7){_0x9a3e3b=_0x2874d7['length'];if(!_0x29bc04['query'][_0x360f('0x4c')]('nolimit')){_0x705da1[_0x360f('0x1a')]=qs['limit'](_0x29bc04[_0x360f('0x30')][_0x360f('0x1a')]);_0x705da1[_0x360f('0x19')]=qs['offset'](_0x29bc04['query']['offset']);}return _0x276cbe[_0x360f('0x4e')](_0x705da1);}})['then'](function(_0x3729ab){if(_0x3729ab){return _0x3729ab?{'count':_0x9a3e3b,'rows':_0x3729ab}:null;}})[_0x360f('0x22')](respondWithResult(_0x203881,null))['catch'](handleError(_0x203881,null));};
\ No newline at end of file
+var _0x3830=['query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','merge','where','filter','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','SalesforceField','order','getFields','getSubjects','findOne','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','then','destroy','end','error','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model'];(function(_0x2f5008,_0x4ab03e){var _0x5a9731=function(_0x468b3a){while(--_0x468b3a){_0x2f5008['push'](_0x2f5008['shift']());}};_0x5a9731(++_0x4ab03e);}(_0x3830,0xb9));var _0x0383=function(_0x36641f,_0x1de996){_0x36641f=_0x36641f-0x0;var _0x264197=_0x3830[_0x36641f];return _0x264197;};'use strict';var emlformat=require(_0x0383('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0383('0x1'));var rp=require(_0x0383('0x2'));var moment=require(_0x0383('0x3'));var BPromise=require(_0x0383('0x4'));var Mustache=require('mustache');var util=require(_0x0383('0x5'));var path=require(_0x0383('0x6'));var sox=require(_0x0383('0x7'));var csv=require('to-csv');var ejs=require(_0x0383('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0383('0x9'));var squel=require(_0x0383('0xa'));var crypto=require(_0x0383('0xb'));var jsforce=require(_0x0383('0xc'));var deskjs=require(_0x0383('0xd'));var toCsv=require(_0x0383('0xe'));var querystring=require(_0x0383('0xf'));var Papa=require('papaparse');var Redis=require(_0x0383('0x10'));var authService=require(_0x0383('0x11'));var qs=require(_0x0383('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0383('0x13'));var logger=require('../../config/logger')(_0x0383('0x14'));var utils=require(_0x0383('0x15'));var config=require(_0x0383('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0383('0x17'))['db'];function respondWithStatusCode(_0x2d54f3,_0x100c6a){_0x100c6a=_0x100c6a||0xcc;return function(_0x379707){if(_0x379707){return _0x2d54f3[_0x0383('0x18')](_0x100c6a);}return _0x2d54f3[_0x0383('0x19')](_0x100c6a)['end']();};}function respondWithResult(_0x4eeebc,_0x12da90){_0x12da90=_0x12da90||0xc8;return function(_0x16123f){if(_0x16123f){return _0x4eeebc['status'](_0x12da90)['json'](_0x16123f);}};}function respondWithFilteredResult(_0x2bd20d,_0x1c0ad9){return function(_0x38541c){if(_0x38541c){var _0x56c2d6=typeof _0x1c0ad9[_0x0383('0x1a')]===_0x0383('0x1b')&&typeof _0x1c0ad9[_0x0383('0x1c')]===_0x0383('0x1b');var _0x24cc5e=_0x38541c[_0x0383('0x1d')];var _0x5a2f62=_0x56c2d6?0x0:_0x1c0ad9[_0x0383('0x1a')];var _0x32c8b5=_0x56c2d6?_0x38541c[_0x0383('0x1d')]:_0x1c0ad9[_0x0383('0x1a')]+_0x1c0ad9[_0x0383('0x1c')];var _0x143c6d;if(_0x32c8b5>=_0x24cc5e){_0x32c8b5=_0x24cc5e;_0x143c6d=0xc8;}else{_0x143c6d=0xce;}_0x2bd20d[_0x0383('0x19')](_0x143c6d);return _0x2bd20d[_0x0383('0x1e')]('Content-Range',_0x5a2f62+'-'+_0x32c8b5+'/'+_0x24cc5e)['json'](_0x38541c);}return null;};}function patchUpdates(_0x5f489a){return function(_0x325f46){try{jsonpatch[_0x0383('0x1f')](_0x325f46,_0x5f489a,!![]);}catch(_0x47bd57){return BPromise['reject'](_0x47bd57);}return _0x325f46['save']();};}function saveUpdates(_0xf3aa85,_0x4c3db4){return function(_0x39f670){if(_0x39f670){return _0x39f670['update'](_0xf3aa85)[_0x0383('0x20')](function(_0x429504){return _0x429504;});}return null;};}function removeEntity(_0x3088f2,_0x25799d){return function(_0x3af351){if(_0x3af351){return _0x3af351[_0x0383('0x21')]()[_0x0383('0x20')](function(){_0x3088f2['status'](0xcc)[_0x0383('0x22')]();});}};}function handleEntityNotFound(_0x53a385,_0x19e9ad){return function(_0x5b2f21){if(!_0x5b2f21){_0x53a385[_0x0383('0x18')](0x194);}return _0x5b2f21;};}function handleError(_0x1a4931,_0x50dad3){_0x50dad3=_0x50dad3||0x1f4;return function(_0x56efda){logger[_0x0383('0x23')](_0x56efda[_0x0383('0x24')]);if(_0x56efda[_0x0383('0x25')]){delete _0x56efda['name'];}_0x1a4931['status'](_0x50dad3)[_0x0383('0x26')](_0x56efda);};}exports[_0x0383('0x27')]=function(_0x441240,_0x390e41){var _0x51c906={},_0x3a940b={},_0x327e9b={'count':0x0,'rows':[]};var _0x3d27ef=_[_0x0383('0x28')](db[_0x0383('0x29')]['rawAttributes'],function(_0x1a5c58){return{'name':_0x1a5c58[_0x0383('0x2a')],'type':_0x1a5c58[_0x0383('0x2b')][_0x0383('0x2c')]};});_0x3a940b[_0x0383('0x2d')]=_['map'](_0x3d27ef,'name');_0x3a940b[_0x0383('0x2e')]=_[_0x0383('0x2f')](_0x441240['query']);_0x3a940b[_0x0383('0x30')]=_[_0x0383('0x31')](_0x3a940b[_0x0383('0x2d')],_0x3a940b[_0x0383('0x2e')]);_0x51c906['attributes']=_[_0x0383('0x31')](_0x3a940b['model'],qs[_0x0383('0x32')](_0x441240[_0x0383('0x2e')][_0x0383('0x32')]));_0x51c906['attributes']=_0x51c906['attributes'][_0x0383('0x33')]?_0x51c906[_0x0383('0x34')]:_0x3a940b[_0x0383('0x2d')];if(!_0x441240['query'][_0x0383('0x35')](_0x0383('0x36'))){_0x51c906['limit']=qs[_0x0383('0x1c')](_0x441240[_0x0383('0x2e')][_0x0383('0x1c')]);_0x51c906[_0x0383('0x1a')]=qs[_0x0383('0x1a')](_0x441240[_0x0383('0x2e')][_0x0383('0x1a')]);}_0x51c906['order']=qs[_0x0383('0x37')](_0x441240[_0x0383('0x2e')][_0x0383('0x37')]);_0x51c906['where']=qs['filters'](_[_0x0383('0x38')](_0x441240[_0x0383('0x2e')],_0x3a940b[_0x0383('0x30')]),_0x3d27ef);if(_0x441240[_0x0383('0x2e')]['filter']){_0x51c906['where']=_[_0x0383('0x39')](_0x51c906[_0x0383('0x3a')],{'$or':_[_0x0383('0x28')](_0x3d27ef,function(_0x28acb0){if(_0x28acb0[_0x0383('0x2b')]!=='VIRTUAL'){var _0x6a6c4a={};_0x6a6c4a[_0x28acb0['name']]={'$like':'%'+_0x441240[_0x0383('0x2e')][_0x0383('0x3b')]+'%'};return _0x6a6c4a;}})});}_0x51c906=_[_0x0383('0x39')]({},_0x51c906,_0x441240[_0x0383('0x3c')]);var _0x7c9dc1={'where':_0x51c906['where']};return db[_0x0383('0x29')][_0x0383('0x1d')](_0x7c9dc1)[_0x0383('0x20')](function(_0x2a4021){_0x327e9b[_0x0383('0x1d')]=_0x2a4021;if(_0x441240[_0x0383('0x2e')][_0x0383('0x3d')]){_0x51c906[_0x0383('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x51c906);})[_0x0383('0x20')](function(_0x5e2710){_0x327e9b[_0x0383('0x3f')]=_0x5e2710;return _0x327e9b;})[_0x0383('0x20')](respondWithFilteredResult(_0x390e41,_0x51c906))[_0x0383('0x40')](handleError(_0x390e41,null));};exports['show']=function(_0x124842,_0x1b38b6){var _0xe16c04={'raw':![],'where':{'id':_0x124842[_0x0383('0x41')]['id']}},_0x3564e0={};_0x3564e0[_0x0383('0x2d')]=_[_0x0383('0x2f')](db['SalesforceConfiguration'][_0x0383('0x42')]);_0x3564e0[_0x0383('0x2e')]=_['keys'](_0x124842[_0x0383('0x2e')]);_0x3564e0[_0x0383('0x30')]=_['intersection'](_0x3564e0[_0x0383('0x2d')],_0x3564e0[_0x0383('0x2e')]);_0xe16c04['attributes']=_[_0x0383('0x31')](_0x3564e0['model'],qs[_0x0383('0x32')](_0x124842[_0x0383('0x2e')][_0x0383('0x32')]));_0xe16c04[_0x0383('0x34')]=_0xe16c04['attributes'][_0x0383('0x33')]?_0xe16c04[_0x0383('0x34')]:_0x3564e0['model'];if(_0x124842[_0x0383('0x2e')][_0x0383('0x3d')]){_0xe16c04['include']=[{'all':!![]}];}_0xe16c04=_['merge']({},_0xe16c04,_0x124842[_0x0383('0x3c')]);return db['SalesforceConfiguration'][_0x0383('0x43')](_0xe16c04)[_0x0383('0x20')](handleEntityNotFound(_0x1b38b6,null))[_0x0383('0x20')](respondWithResult(_0x1b38b6,null))[_0x0383('0x40')](handleError(_0x1b38b6,null));};exports[_0x0383('0x44')]=function(_0xe3c8da,_0x5c9216){return db[_0x0383('0x29')]['create'](_0xe3c8da[_0x0383('0x45')],{})['then'](respondWithResult(_0x5c9216,0xc9))[_0x0383('0x40')](handleError(_0x5c9216,null));};exports[_0x0383('0x46')]=function(_0x4aaeae,_0x450d35){if(_0x4aaeae[_0x0383('0x45')]['id']){delete _0x4aaeae[_0x0383('0x45')]['id'];}return db[_0x0383('0x29')][_0x0383('0x43')]({'where':{'id':_0x4aaeae[_0x0383('0x41')]['id']}})[_0x0383('0x20')](handleEntityNotFound(_0x450d35,null))[_0x0383('0x20')](saveUpdates(_0x4aaeae[_0x0383('0x45')],null))['then'](respondWithResult(_0x450d35,null))[_0x0383('0x40')](handleError(_0x450d35,null));};exports['destroy']=function(_0x214b98,_0x45b29c){return db['SalesforceConfiguration'][_0x0383('0x43')]({'where':{'id':_0x214b98[_0x0383('0x41')]['id']}})['then'](handleEntityNotFound(_0x45b29c,null))['then'](removeEntity(_0x45b29c,null))[_0x0383('0x40')](handleError(_0x45b29c,null));};exports['getFields']=function(_0x1e4e7a,_0x139fd9,_0x562a31){var _0x36ea78={};var _0x458a6b={};var _0x4e50ea;var _0x4fa5b8;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1e4e7a[_0x0383('0x41')]['id']}})[_0x0383('0x20')](handleEntityNotFound(_0x139fd9,null))[_0x0383('0x20')](function(_0x31a1ae){if(_0x31a1ae){_0x4e50ea=_0x31a1ae;_0x458a6b[_0x0383('0x2d')]=_[_0x0383('0x2f')](db[_0x0383('0x47')][_0x0383('0x42')]);_0x458a6b[_0x0383('0x2e')]=_[_0x0383('0x2f')](_0x1e4e7a[_0x0383('0x2e')]);_0x458a6b[_0x0383('0x30')]=_[_0x0383('0x31')](_0x458a6b[_0x0383('0x2d')],_0x458a6b[_0x0383('0x2e')]);_0x36ea78[_0x0383('0x34')]=_['intersection'](_0x458a6b[_0x0383('0x2d')],qs[_0x0383('0x32')](_0x1e4e7a[_0x0383('0x2e')][_0x0383('0x32')]));_0x36ea78[_0x0383('0x34')]=_0x36ea78[_0x0383('0x34')][_0x0383('0x33')]?_0x36ea78[_0x0383('0x34')]:_0x458a6b[_0x0383('0x2d')];_0x36ea78[_0x0383('0x48')]=qs[_0x0383('0x37')](_0x1e4e7a[_0x0383('0x2e')][_0x0383('0x37')]);_0x36ea78['where']=qs['filters'](_[_0x0383('0x38')](_0x1e4e7a['query'],_0x458a6b[_0x0383('0x30')]));if(_0x1e4e7a[_0x0383('0x2e')]['filter']){_0x36ea78[_0x0383('0x3a')]=_[_0x0383('0x39')](_0x36ea78['where'],{'$or':_[_0x0383('0x28')](_0x36ea78[_0x0383('0x34')],function(_0x55df58){var _0x1aae0f={};_0x1aae0f[_0x55df58]={'$like':'%'+_0x1e4e7a[_0x0383('0x2e')][_0x0383('0x3b')]+'%'};return _0x1aae0f;})});}_0x36ea78=_[_0x0383('0x39')]({},_0x36ea78,_0x1e4e7a['options']);return _0x4e50ea[_0x0383('0x49')](_0x36ea78);}})[_0x0383('0x20')](function(_0x2ff103){if(_0x2ff103){_0x4fa5b8=_0x2ff103['length'];if(!_0x1e4e7a[_0x0383('0x2e')][_0x0383('0x35')](_0x0383('0x36'))){_0x36ea78['limit']=qs[_0x0383('0x1c')](_0x1e4e7a['query'][_0x0383('0x1c')]);_0x36ea78[_0x0383('0x1a')]=qs['offset'](_0x1e4e7a[_0x0383('0x2e')][_0x0383('0x1a')]);}return _0x4e50ea[_0x0383('0x49')](_0x36ea78);}})['then'](function(_0x1a4628){if(_0x1a4628){return _0x1a4628?{'count':_0x4fa5b8,'rows':_0x1a4628}:null;}})['then'](respondWithResult(_0x139fd9,null))[_0x0383('0x40')](handleError(_0x139fd9,null));};exports[_0x0383('0x4a')]=function(_0x39e5f5,_0x5013ac,_0x1b4bf1){var _0x5e1f82={};var _0x151e95={};var _0x2d7948;var _0x9e9854;return db[_0x0383('0x29')][_0x0383('0x4b')]({'where':{'id':_0x39e5f5[_0x0383('0x41')]['id']}})[_0x0383('0x20')](handleEntityNotFound(_0x5013ac,null))[_0x0383('0x20')](function(_0xb7a504){if(_0xb7a504){_0x2d7948=_0xb7a504;_0x151e95['model']=_[_0x0383('0x2f')](db['SalesforceField']['rawAttributes']);_0x151e95['query']=_[_0x0383('0x2f')](_0x39e5f5['query']);_0x151e95[_0x0383('0x30')]=_['intersection'](_0x151e95[_0x0383('0x2d')],_0x151e95[_0x0383('0x2e')]);_0x5e1f82[_0x0383('0x34')]=_['intersection'](_0x151e95[_0x0383('0x2d')],qs[_0x0383('0x32')](_0x39e5f5[_0x0383('0x2e')][_0x0383('0x32')]));_0x5e1f82[_0x0383('0x34')]=_0x5e1f82[_0x0383('0x34')][_0x0383('0x33')]?_0x5e1f82['attributes']:_0x151e95['model'];_0x5e1f82[_0x0383('0x48')]=qs['sort'](_0x39e5f5[_0x0383('0x2e')]['sort']);_0x5e1f82['where']=qs[_0x0383('0x30')](_[_0x0383('0x38')](_0x39e5f5[_0x0383('0x2e')],_0x151e95['filters']));if(_0x39e5f5[_0x0383('0x2e')][_0x0383('0x3b')]){_0x5e1f82['where']=_[_0x0383('0x39')](_0x5e1f82[_0x0383('0x3a')],{'$or':_[_0x0383('0x28')](_0x5e1f82['attributes'],function(_0x5abbb3){var _0x4dbc94={};_0x4dbc94[_0x5abbb3]={'$like':'%'+_0x39e5f5[_0x0383('0x2e')][_0x0383('0x3b')]+'%'};return _0x4dbc94;})});}_0x5e1f82=_[_0x0383('0x39')]({},_0x5e1f82,_0x39e5f5[_0x0383('0x3c')]);return _0x2d7948[_0x0383('0x4a')](_0x5e1f82);}})[_0x0383('0x20')](function(_0xb60cc){if(_0xb60cc){_0x9e9854=_0xb60cc[_0x0383('0x33')];if(!_0x39e5f5[_0x0383('0x2e')][_0x0383('0x35')](_0x0383('0x36'))){_0x5e1f82[_0x0383('0x1c')]=qs['limit'](_0x39e5f5[_0x0383('0x2e')][_0x0383('0x1c')]);_0x5e1f82[_0x0383('0x1a')]=qs[_0x0383('0x1a')](_0x39e5f5[_0x0383('0x2e')][_0x0383('0x1a')]);}return _0x2d7948[_0x0383('0x4a')](_0x5e1f82);}})[_0x0383('0x20')](function(_0x7eee31){if(_0x7eee31){return _0x7eee31?{'count':_0x9e9854,'rows':_0x7eee31}:null;}})['then'](respondWithResult(_0x5013ac,null))[_0x0383('0x40')](handleError(_0x5013ac,null));};exports[_0x0383('0x4c')]=function(_0x50a21f,_0x2b770e,_0x5dccb2){var _0x504a25={};var _0x4af9ec={};var _0x1e2222;var _0x548909;return db[_0x0383('0x29')]['findOne']({'where':{'id':_0x50a21f[_0x0383('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b770e,null))[_0x0383('0x20')](function(_0x56aef6){if(_0x56aef6){_0x1e2222=_0x56aef6;_0x4af9ec['model']=_[_0x0383('0x2f')](db[_0x0383('0x47')][_0x0383('0x42')]);_0x4af9ec['query']=_['keys'](_0x50a21f[_0x0383('0x2e')]);_0x4af9ec['filters']=_['intersection'](_0x4af9ec[_0x0383('0x2d')],_0x4af9ec['query']);_0x504a25['attributes']=_['intersection'](_0x4af9ec[_0x0383('0x2d')],qs[_0x0383('0x32')](_0x50a21f[_0x0383('0x2e')][_0x0383('0x32')]));_0x504a25[_0x0383('0x34')]=_0x504a25[_0x0383('0x34')][_0x0383('0x33')]?_0x504a25[_0x0383('0x34')]:_0x4af9ec['model'];_0x504a25[_0x0383('0x48')]=qs[_0x0383('0x37')](_0x50a21f[_0x0383('0x2e')][_0x0383('0x37')]);_0x504a25[_0x0383('0x3a')]=qs[_0x0383('0x30')](_['pick'](_0x50a21f['query'],_0x4af9ec[_0x0383('0x30')]));if(_0x50a21f['query'][_0x0383('0x3b')]){_0x504a25['where']=_[_0x0383('0x39')](_0x504a25[_0x0383('0x3a')],{'$or':_[_0x0383('0x28')](_0x504a25[_0x0383('0x34')],function(_0x4fb4e4){var _0x346265={};_0x346265[_0x4fb4e4]={'$like':'%'+_0x50a21f[_0x0383('0x2e')][_0x0383('0x3b')]+'%'};return _0x346265;})});}_0x504a25=_['merge']({},_0x504a25,_0x50a21f[_0x0383('0x3c')]);return _0x1e2222[_0x0383('0x4c')](_0x504a25);}})[_0x0383('0x20')](function(_0x177a82){if(_0x177a82){_0x548909=_0x177a82[_0x0383('0x33')];if(!_0x50a21f[_0x0383('0x2e')][_0x0383('0x35')]('nolimit')){_0x504a25['limit']=qs[_0x0383('0x1c')](_0x50a21f[_0x0383('0x2e')][_0x0383('0x1c')]);_0x504a25[_0x0383('0x1a')]=qs['offset'](_0x50a21f[_0x0383('0x2e')]['offset']);}return _0x1e2222[_0x0383('0x4c')](_0x504a25);}})['then'](function(_0x187ce6){if(_0x187ce6){return _0x187ce6?{'count':_0x548909,'rows':_0x187ce6}:null;}})['then'](respondWithResult(_0x2b770e,null))[_0x0383('0x40')](handleError(_0x2b770e,null));};
\ No newline at end of file
index bae87be..eab1cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe73a=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x1c883e,_0x560644){var _0x328c3a=function(_0x1960dc){while(--_0x1960dc){_0x1c883e['push'](_0x1c883e['shift']());}};_0x328c3a(++_0x560644);}(_0xe73a,0xb5));var _0xae73=function(_0x2ed919,_0x48314b){_0x2ed919=_0x2ed919-0x0;var _0x574174=_0xe73a[_0x2ed919];return _0x574174;};'use strict';var _=require(_0xae73('0x0'));var util=require(_0xae73('0x1'));var logger=require(_0xae73('0x2'))(_0xae73('0x3'));var moment=require(_0xae73('0x4'));var BPromise=require(_0xae73('0x5'));var rp=require(_0xae73('0x6'));var fs=require('fs');var path=require(_0xae73('0x7'));var rimraf=require('rimraf');var config=require(_0xae73('0x8'));var attributes=require(_0xae73('0x9'));module[_0xae73('0xa')]=function(_0x4cc6a5,_0x3925a8){return _0x4cc6a5['define'](_0xae73('0xb'),attributes,{'tableName':_0xae73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb256=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0xc0de09,_0x3ba30c){var _0x3a4b2f=function(_0x5675b1){while(--_0x5675b1){_0xc0de09['push'](_0xc0de09['shift']());}};_0x3a4b2f(++_0x3ba30c);}(_0xb256,0xb8));var _0x6b25=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xb256[_0x15af0f];return _0x2bd1cb;};'use strict';var _=require(_0x6b25('0x0'));var util=require(_0x6b25('0x1'));var logger=require(_0x6b25('0x2'))(_0x6b25('0x3'));var moment=require('moment');var BPromise=require(_0x6b25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b25('0x5'));var rimraf=require('rimraf');var config=require(_0x6b25('0x6'));var attributes=require(_0x6b25('0x7'));module[_0x6b25('0x8')]=function(_0x5de5ac,_0x16873f){return _0x5de5ac[_0x6b25('0x9')](_0x6b25('0xa'),attributes,{'tableName':_0x6b25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8138d2..9df8323 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x455b=['client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x455b,0xe3));var _0xb455=function(_0x4df1d9,_0x40055a){_0x4df1d9=_0x4df1d9-0x0;var _0x4badc8=_0x455b[_0x4df1d9];return _0x4badc8;};'use strict';var _=require(_0xb455('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb455('0x1'));var fs=require('fs');var Redis=require(_0xb455('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb455('0x3'));var logger=require(_0xb455('0x4'))('rpc');var config=require(_0xb455('0x5'));var jayson=require(_0xb455('0x6'));var client=jayson[_0xb455('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x182c9c,_0x238f1b,_0x47e4ff){return new BPromise(function(_0x658cd9,_0x3bd253){return client['request'](_0x182c9c,_0x47e4ff)[_0xb455('0x8')](function(_0x1b884e){logger[_0xb455('0x9')](_0xb455('0xa'),_0x238f1b,_0xb455('0xb'));logger[_0xb455('0xc')](_0xb455('0xd'),_0x238f1b,_0xb455('0xb'),JSON[_0xb455('0xe')](_0x1b884e));if(_0x1b884e[_0xb455('0xf')]){if(_0x1b884e[_0xb455('0xf')][_0xb455('0x10')]===0x1f4){logger[_0xb455('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x238f1b,_0x1b884e[_0xb455('0xf')][_0xb455('0x11')]);return _0x3bd253(_0x1b884e['error'][_0xb455('0x11')]);}logger[_0xb455('0xf')](_0xb455('0xa'),_0x238f1b,_0x1b884e[_0xb455('0xf')][_0xb455('0x11')]);return _0x658cd9(_0x1b884e[_0xb455('0xf')][_0xb455('0x11')]);}else{logger['info'](_0xb455('0xa'),_0x238f1b,_0xb455('0xb'));_0x658cd9(_0x1b884e['result'][_0xb455('0x11')]);}})['catch'](function(_0x438c0f){logger[_0xb455('0xf')](_0xb455('0xa'),_0x238f1b,_0x438c0f);_0x3bd253(_0x438c0f);});});}
\ No newline at end of file
+var _0x559e=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x24012e,_0x5a6e34){var _0x31dc05=function(_0x5d34c6){while(--_0x5d34c6){_0x24012e['push'](_0x24012e['shift']());}};_0x31dc05(++_0x5a6e34);}(_0x559e,0xc8));var _0xe559=function(_0x1b76e0,_0x1ee945){_0x1b76e0=_0x1b76e0-0x0;var _0xa76688=_0x559e[_0x1b76e0];return _0xa76688;};'use strict';var _=require(_0xe559('0x0'));var util=require(_0xe559('0x1'));var moment=require('moment');var BPromise=require(_0xe559('0x2'));var rs=require(_0xe559('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe559('0x4'));var logger=require(_0xe559('0x5'))(_0xe559('0x6'));var config=require('../../config/environment');var jayson=require(_0xe559('0x7'));var client=jayson[_0xe559('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x478131,_0x1d7ff2,_0x5b42e4){return new BPromise(function(_0x576acb,_0x2cf9d6){return client[_0xe559('0x9')](_0x478131,_0x5b42e4)[_0xe559('0xa')](function(_0x431ad2){logger[_0xe559('0xb')](_0xe559('0xc'),_0x1d7ff2,_0xe559('0xd'));logger[_0xe559('0xe')](_0xe559('0xf'),_0x1d7ff2,_0xe559('0xd'),JSON[_0xe559('0x10')](_0x431ad2));if(_0x431ad2[_0xe559('0x11')]){if(_0x431ad2[_0xe559('0x11')][_0xe559('0x12')]===0x1f4){logger['error'](_0xe559('0xc'),_0x1d7ff2,_0x431ad2[_0xe559('0x11')][_0xe559('0x13')]);return _0x2cf9d6(_0x431ad2[_0xe559('0x11')][_0xe559('0x13')]);}logger[_0xe559('0x11')](_0xe559('0xc'),_0x1d7ff2,_0x431ad2[_0xe559('0x11')][_0xe559('0x13')]);return _0x576acb(_0x431ad2[_0xe559('0x11')][_0xe559('0x13')]);}else{logger[_0xe559('0xb')](_0xe559('0xc'),_0x1d7ff2,'request\x20sent');_0x576acb(_0x431ad2[_0xe559('0x14')][_0xe559('0x13')]);}})['catch'](function(_0x595110){logger[_0xe559('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1d7ff2,_0x595110);_0x2cf9d6(_0x595110);});});}
\ No newline at end of file
index 6704ec2..aaa0a61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba0c=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x599887,_0x5353e9){var _0x5a638e=function(_0x176442){while(--_0x176442){_0x599887['push'](_0x599887['shift']());}};_0x5a638e(++_0x5353e9);}(_0xba0c,0x16a));var _0xcba0=function(_0x9e9100,_0x3d6b8c){_0x9e9100=_0x9e9100-0x0;var _0x1381e2=_0xba0c[_0x9e9100];return _0x1381e2;};'use strict';var multer=require(_0xcba0('0x0'));var util=require(_0xcba0('0x1'));var path=require(_0xcba0('0x2'));var timeout=require(_0xcba0('0x3'));var express=require(_0xcba0('0x4'));var router=express['Router']();var fs_extra=require(_0xcba0('0x5'));var auth=require(_0xcba0('0x6'));var interaction=require(_0xcba0('0x7'));var config=require(_0xcba0('0x8'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xcba0('0x9')](),controller['index']);router['get'](_0xcba0('0xa'),auth[_0xcba0('0x9')](),controller[_0xcba0('0xb')]);router[_0xcba0('0xc')]('/',auth[_0xcba0('0x9')](),controller[_0xcba0('0xd')]);router[_0xcba0('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcba0('0xf')](_0xcba0('0xa'),auth[_0xcba0('0x9')](),controller[_0xcba0('0x10')]);module[_0xcba0('0x11')]=router;
\ No newline at end of file
+var _0x47b2=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x110e43,_0x30a922){var _0x6e3d42=function(_0x719d95){while(--_0x719d95){_0x110e43['push'](_0x110e43['shift']());}};_0x6e3d42(++_0x30a922);}(_0x47b2,0xda));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x247b('0x0'));var path=require('path');var timeout=require(_0x247b('0x1'));var express=require('express');var router=express[_0x247b('0x2')]();var fs_extra=require(_0x247b('0x3'));var auth=require(_0x247b('0x4'));var interaction=require(_0x247b('0x5'));var config=require(_0x247b('0x6'));var controller=require(_0x247b('0x7'));router['get']('/',auth[_0x247b('0x8')](),controller[_0x247b('0x9')]);router['get'](_0x247b('0xa'),auth[_0x247b('0x8')](),controller[_0x247b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x247b('0xc')]);router[_0x247b('0xd')](_0x247b('0xa'),auth[_0x247b('0x8')](),controller[_0x247b('0xe')]);router[_0x247b('0xf')](_0x247b('0xa'),auth[_0x247b('0x8')](),controller[_0x247b('0x10')]);module[_0x247b('0x11')]=router;
\ No newline at end of file
index 43cb1ff..755ed78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6495=['exports','string','variable','customVariable','keyValue','STRING','ENUM','sequelize'];(function(_0x3d1c73,_0x493643){var _0x159db3=function(_0x79bcab){while(--_0x79bcab){_0x3d1c73['push'](_0x3d1c73['shift']());}};_0x159db3(++_0x493643);}(_0x6495,0x187));var _0x5649=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6495[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x5649('0x0'));module[_0x5649('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5649('0x2'),_0x5649('0x3'),_0x5649('0x4'),_0x5649('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5649('0x6')]},'key':{'type':Sequelize[_0x5649('0x6')]},'keyType':{'type':Sequelize[_0x5649('0x7')]('string',_0x5649('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5649('0x6')]},'idField':{'type':Sequelize[_0x5649('0x6')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1a45=['sequelize','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x4e55aa,_0x48bfd2){var _0x2f48d6=function(_0x29b734){while(--_0x29b734){_0x4e55aa['push'](_0x4e55aa['shift']());}};_0x2f48d6(++_0x48bfd2);}(_0x1a45,0x8c));var _0x51a4=function(_0x5c84a4,_0x1c7842){_0x5c84a4=_0x5c84a4-0x0;var _0x60b9f0=_0x1a45[_0x5c84a4];return _0x60b9f0;};'use strict';var Sequelize=require(_0x51a4('0x0'));module['exports']={'type':{'type':Sequelize[_0x51a4('0x1')](_0x51a4('0x2'),_0x51a4('0x3'),'customVariable',_0x51a4('0x4'),_0x51a4('0x5')),'defaultValue':_0x51a4('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x51a4('0x6')]},'keyType':{'type':Sequelize[_0x51a4('0x1')](_0x51a4('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x51a4('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x51a4('0x6')]}};
\ No newline at end of file
index bf65df1..3f3a28c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf7=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','error','stack','name','index','map','SalesforceField','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4d0826,_0x26c552){var _0x3236eb=function(_0xd23de1){while(--_0xd23de1){_0x4d0826['push'](_0x4d0826['shift']());}};_0x3236eb(++_0x26c552);}(_0x6bf7,0x150));var _0x76bf=function(_0x4ec897,_0x4871b5){_0x4ec897=_0x4ec897-0x0;var _0xde868=_0x6bf7[_0x4ec897];return _0xde868;};'use strict';var emlformat=require(_0x76bf('0x0'));var rimraf=require(_0x76bf('0x1'));var zipdir=require(_0x76bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76bf('0x3'));var moment=require(_0x76bf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x76bf('0x5'));var path=require(_0x76bf('0x6'));var sox=require(_0x76bf('0x7'));var csv=require(_0x76bf('0x8'));var ejs=require(_0x76bf('0x9'));var fs=require('fs');var fs_extra=require(_0x76bf('0xa'));var _=require(_0x76bf('0xb'));var squel=require(_0x76bf('0xc'));var crypto=require(_0x76bf('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76bf('0x8'));var querystring=require('querystring');var Papa=require(_0x76bf('0xe'));var Redis=require(_0x76bf('0xf'));var authService=require(_0x76bf('0x10'));var qs=require(_0x76bf('0x11'));var as=require(_0x76bf('0x12'));var hardwareService=require(_0x76bf('0x13'));var logger=require(_0x76bf('0x14'))('api');var utils=require(_0x76bf('0x15'));var config=require(_0x76bf('0x16'));var licenseUtil=require(_0x76bf('0x17'));var db=require(_0x76bf('0x18'))['db'];function respondWithStatusCode(_0x252b95,_0xec700a){_0xec700a=_0xec700a||0xcc;return function(_0x653ff2){if(_0x653ff2){return _0x252b95[_0x76bf('0x19')](_0xec700a);}return _0x252b95[_0x76bf('0x1a')](_0xec700a)[_0x76bf('0x1b')]();};}function respondWithResult(_0x379ae8,_0x28b2d4){_0x28b2d4=_0x28b2d4||0xc8;return function(_0x52fc92){if(_0x52fc92){return _0x379ae8['status'](_0x28b2d4)[_0x76bf('0x1c')](_0x52fc92);}};}function respondWithFilteredResult(_0x5c2207,_0x5b00e8){return function(_0x37ca8b){if(_0x37ca8b){var _0x5cd41a=typeof _0x5b00e8[_0x76bf('0x1d')]===_0x76bf('0x1e')&&typeof _0x5b00e8['limit']===_0x76bf('0x1e');var _0x15fd8a=_0x37ca8b[_0x76bf('0x1f')];var _0x476ea0=_0x5cd41a?0x0:_0x5b00e8[_0x76bf('0x1d')];var _0x3aa0c3=_0x5cd41a?_0x37ca8b[_0x76bf('0x1f')]:_0x5b00e8[_0x76bf('0x1d')]+_0x5b00e8['limit'];var _0x5ede87;if(_0x3aa0c3>=_0x15fd8a){_0x3aa0c3=_0x15fd8a;_0x5ede87=0xc8;}else{_0x5ede87=0xce;}_0x5c2207[_0x76bf('0x1a')](_0x5ede87);return _0x5c2207['set'](_0x76bf('0x20'),_0x476ea0+'-'+_0x3aa0c3+'/'+_0x15fd8a)['json'](_0x37ca8b);}return null;};}function patchUpdates(_0x3082be){return function(_0x1ef30b){try{jsonpatch['apply'](_0x1ef30b,_0x3082be,!![]);}catch(_0x52aa43){return BPromise[_0x76bf('0x21')](_0x52aa43);}return _0x1ef30b[_0x76bf('0x22')]();};}function saveUpdates(_0x4cdfbf,_0x96d9ec){return function(_0x466c8b){if(_0x466c8b){return _0x466c8b[_0x76bf('0x23')](_0x4cdfbf)[_0x76bf('0x24')](function(_0x55953d){return _0x55953d;});}return null;};}function removeEntity(_0x4d1922,_0x434ef0){return function(_0x1950c8){if(_0x1950c8){return _0x1950c8['destroy']()[_0x76bf('0x24')](function(){_0x4d1922['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0afc,_0x8fb67){return function(_0x50ea2e){if(!_0x50ea2e){_0x3e0afc['sendStatus'](0x194);}return _0x50ea2e;};}function handleError(_0x508389,_0x38e239){_0x38e239=_0x38e239||0x1f4;return function(_0x50952b){logger[_0x76bf('0x25')](_0x50952b[_0x76bf('0x26')]);if(_0x50952b['name']){delete _0x50952b[_0x76bf('0x27')];}_0x508389[_0x76bf('0x1a')](_0x38e239)['send'](_0x50952b);};}exports[_0x76bf('0x28')]=function(_0x35441e,_0x5823bd){var _0x265104={},_0x1f46a3={},_0x1e18fa={'count':0x0,'rows':[]};var _0x1ebd10=_[_0x76bf('0x29')](db[_0x76bf('0x2a')][_0x76bf('0x2b')],function(_0x3a9a16){return{'name':_0x3a9a16['fieldName'],'type':_0x3a9a16[_0x76bf('0x2c')]['key']};});_0x1f46a3['model']=_['map'](_0x1ebd10,_0x76bf('0x27'));_0x1f46a3[_0x76bf('0x2d')]=_[_0x76bf('0x2e')](_0x35441e[_0x76bf('0x2d')]);_0x1f46a3[_0x76bf('0x2f')]=_[_0x76bf('0x30')](_0x1f46a3[_0x76bf('0x31')],_0x1f46a3[_0x76bf('0x2d')]);_0x265104[_0x76bf('0x32')]=_[_0x76bf('0x30')](_0x1f46a3[_0x76bf('0x31')],qs['fields'](_0x35441e[_0x76bf('0x2d')][_0x76bf('0x33')]));_0x265104['attributes']=_0x265104['attributes'][_0x76bf('0x34')]?_0x265104[_0x76bf('0x32')]:_0x1f46a3[_0x76bf('0x31')];if(!_0x35441e['query'][_0x76bf('0x35')]('nolimit')){_0x265104[_0x76bf('0x36')]=qs[_0x76bf('0x36')](_0x35441e['query'][_0x76bf('0x36')]);_0x265104[_0x76bf('0x1d')]=qs['offset'](_0x35441e[_0x76bf('0x2d')][_0x76bf('0x1d')]);}_0x265104[_0x76bf('0x37')]=qs['sort'](_0x35441e[_0x76bf('0x2d')]['sort']);_0x265104[_0x76bf('0x38')]=qs[_0x76bf('0x2f')](_[_0x76bf('0x39')](_0x35441e['query'],_0x1f46a3[_0x76bf('0x2f')]),_0x1ebd10);if(_0x35441e[_0x76bf('0x2d')][_0x76bf('0x3a')]){_0x265104[_0x76bf('0x38')]=_[_0x76bf('0x3b')](_0x265104[_0x76bf('0x38')],{'$or':_[_0x76bf('0x29')](_0x1ebd10,function(_0x40f992){if(_0x40f992[_0x76bf('0x2c')]!==_0x76bf('0x3c')){var _0x336c79={};_0x336c79[_0x40f992[_0x76bf('0x27')]]={'$like':'%'+_0x35441e[_0x76bf('0x2d')][_0x76bf('0x3a')]+'%'};return _0x336c79;}})});}_0x265104=_[_0x76bf('0x3b')]({},_0x265104,_0x35441e[_0x76bf('0x3d')]);var _0x333370={'where':_0x265104[_0x76bf('0x38')]};return db[_0x76bf('0x2a')][_0x76bf('0x1f')](_0x333370)[_0x76bf('0x24')](function(_0x5420ec){_0x1e18fa[_0x76bf('0x1f')]=_0x5420ec;if(_0x35441e[_0x76bf('0x2d')][_0x76bf('0x3e')]){_0x265104[_0x76bf('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0x76bf('0x40')](_0x265104);})[_0x76bf('0x24')](function(_0x1730a2){_0x1e18fa['rows']=_0x1730a2;return _0x1e18fa;})['then'](respondWithFilteredResult(_0x5823bd,_0x265104))[_0x76bf('0x41')](handleError(_0x5823bd,null));};exports[_0x76bf('0x42')]=function(_0x214828,_0x1d7a6c){var _0x4202b={'raw':!![],'where':{'id':_0x214828[_0x76bf('0x43')]['id']}},_0x54a8d8={};_0x54a8d8[_0x76bf('0x31')]=_[_0x76bf('0x2e')](db[_0x76bf('0x2a')]['rawAttributes']);_0x54a8d8[_0x76bf('0x2d')]=_[_0x76bf('0x2e')](_0x214828[_0x76bf('0x2d')]);_0x54a8d8[_0x76bf('0x2f')]=_[_0x76bf('0x30')](_0x54a8d8[_0x76bf('0x31')],_0x54a8d8[_0x76bf('0x2d')]);_0x4202b[_0x76bf('0x32')]=_[_0x76bf('0x30')](_0x54a8d8['model'],qs[_0x76bf('0x33')](_0x214828[_0x76bf('0x2d')][_0x76bf('0x33')]));_0x4202b['attributes']=_0x4202b[_0x76bf('0x32')][_0x76bf('0x34')]?_0x4202b[_0x76bf('0x32')]:_0x54a8d8[_0x76bf('0x31')];if(_0x214828[_0x76bf('0x2d')]['includeAll']){_0x4202b[_0x76bf('0x3f')]=[{'all':!![]}];}_0x4202b=_['merge']({},_0x4202b,_0x214828[_0x76bf('0x3d')]);return db[_0x76bf('0x2a')][_0x76bf('0x44')](_0x4202b)[_0x76bf('0x24')](handleEntityNotFound(_0x1d7a6c,null))[_0x76bf('0x24')](respondWithResult(_0x1d7a6c,null))['catch'](handleError(_0x1d7a6c,null));};exports[_0x76bf('0x45')]=function(_0x4b9647,_0x343a17){return db['SalesforceField']['create'](_0x4b9647[_0x76bf('0x46')],{})['then'](respondWithResult(_0x343a17,0xc9))[_0x76bf('0x41')](handleError(_0x343a17,null));};exports[_0x76bf('0x23')]=function(_0x4e8ab1,_0x561553){if(_0x4e8ab1['body']['id']){delete _0x4e8ab1['body']['id'];}return db[_0x76bf('0x2a')][_0x76bf('0x44')]({'where':{'id':_0x4e8ab1[_0x76bf('0x43')]['id']}})[_0x76bf('0x24')](handleEntityNotFound(_0x561553,null))[_0x76bf('0x24')](saveUpdates(_0x4e8ab1[_0x76bf('0x46')],null))[_0x76bf('0x24')](respondWithResult(_0x561553,null))[_0x76bf('0x41')](handleError(_0x561553,null));};exports[_0x76bf('0x47')]=function(_0x176eba,_0xa060cf){return db[_0x76bf('0x2a')]['find']({'where':{'id':_0x176eba['params']['id']}})['then'](handleEntityNotFound(_0xa060cf,null))[_0x76bf('0x24')](removeEntity(_0xa060cf,null))[_0x76bf('0x41')](handleError(_0xa060cf,null));};
\ No newline at end of file
+var _0x4882=['body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','fields','find','create'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4882,0x1c4));var _0x2488=function(_0x2c10b1,_0x267e73){_0x2c10b1=_0x2c10b1-0x0;var _0x186faa=_0x4882[_0x2c10b1];return _0x186faa;};'use strict';var emlformat=require(_0x2488('0x0'));var rimraf=require(_0x2488('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2488('0x2'));var rp=require('request-promise');var moment=require(_0x2488('0x3'));var BPromise=require(_0x2488('0x4'));var Mustache=require(_0x2488('0x5'));var util=require(_0x2488('0x6'));var path=require(_0x2488('0x7'));var sox=require(_0x2488('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2488('0x9'));var _=require(_0x2488('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2488('0xb'));var deskjs=require(_0x2488('0xc'));var toCsv=require(_0x2488('0xd'));var querystring=require(_0x2488('0xe'));var Papa=require(_0x2488('0xf'));var Redis=require(_0x2488('0x10'));var authService=require(_0x2488('0x11'));var qs=require(_0x2488('0x12'));var as=require(_0x2488('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2488('0x14'))(_0x2488('0x15'));var utils=require(_0x2488('0x16'));var config=require(_0x2488('0x17'));var licenseUtil=require(_0x2488('0x18'));var db=require(_0x2488('0x19'))['db'];function respondWithStatusCode(_0x1e4c95,_0x49bd92){_0x49bd92=_0x49bd92||0xcc;return function(_0x7c0bcc){if(_0x7c0bcc){return _0x1e4c95['sendStatus'](_0x49bd92);}return _0x1e4c95[_0x2488('0x1a')](_0x49bd92)[_0x2488('0x1b')]();};}function respondWithResult(_0x1b8e5e,_0x402752){_0x402752=_0x402752||0xc8;return function(_0x2e78cf){if(_0x2e78cf){return _0x1b8e5e[_0x2488('0x1a')](_0x402752)[_0x2488('0x1c')](_0x2e78cf);}};}function respondWithFilteredResult(_0x5ac6f3,_0x1c318d){return function(_0x73c0c5){if(_0x73c0c5){var _0x317cf2=typeof _0x1c318d[_0x2488('0x1d')]==='undefined'&&typeof _0x1c318d['limit']===_0x2488('0x1e');var _0x1348f3=_0x73c0c5[_0x2488('0x1f')];var _0x46decf=_0x317cf2?0x0:_0x1c318d[_0x2488('0x1d')];var _0x413897=_0x317cf2?_0x73c0c5[_0x2488('0x1f')]:_0x1c318d[_0x2488('0x1d')]+_0x1c318d[_0x2488('0x20')];var _0x3d590a;if(_0x413897>=_0x1348f3){_0x413897=_0x1348f3;_0x3d590a=0xc8;}else{_0x3d590a=0xce;}_0x5ac6f3[_0x2488('0x1a')](_0x3d590a);return _0x5ac6f3['set'](_0x2488('0x21'),_0x46decf+'-'+_0x413897+'/'+_0x1348f3)[_0x2488('0x1c')](_0x73c0c5);}return null;};}function patchUpdates(_0x5a7015){return function(_0x194758){try{jsonpatch[_0x2488('0x22')](_0x194758,_0x5a7015,!![]);}catch(_0x16e781){return BPromise[_0x2488('0x23')](_0x16e781);}return _0x194758[_0x2488('0x24')]();};}function saveUpdates(_0x5deffb,_0x5ad615){return function(_0x1d655e){if(_0x1d655e){return _0x1d655e['update'](_0x5deffb)[_0x2488('0x25')](function(_0x504adb){return _0x504adb;});}return null;};}function removeEntity(_0x40b871,_0x32a5a9){return function(_0x3fc7d2){if(_0x3fc7d2){return _0x3fc7d2[_0x2488('0x26')]()['then'](function(){_0x40b871[_0x2488('0x1a')](0xcc)[_0x2488('0x1b')]();});}};}function handleEntityNotFound(_0x11f046,_0x25d840){return function(_0xb5473a){if(!_0xb5473a){_0x11f046[_0x2488('0x27')](0x194);}return _0xb5473a;};}function handleError(_0x43cfc1,_0x133594){_0x133594=_0x133594||0x1f4;return function(_0x1609ea){logger['error'](_0x1609ea['stack']);if(_0x1609ea[_0x2488('0x28')]){delete _0x1609ea['name'];}_0x43cfc1[_0x2488('0x1a')](_0x133594)[_0x2488('0x29')](_0x1609ea);};}exports['index']=function(_0x536a0a,_0x5827e4){var _0x3ab08d={},_0x314bb2={},_0x1cc2e8={'count':0x0,'rows':[]};var _0x4c9353=_[_0x2488('0x2a')](db[_0x2488('0x2b')][_0x2488('0x2c')],function(_0xb89a4e){return{'name':_0xb89a4e[_0x2488('0x2d')],'type':_0xb89a4e[_0x2488('0x2e')][_0x2488('0x2f')]};});_0x314bb2['model']=_[_0x2488('0x2a')](_0x4c9353,_0x2488('0x28'));_0x314bb2[_0x2488('0x30')]=_[_0x2488('0x31')](_0x536a0a[_0x2488('0x30')]);_0x314bb2[_0x2488('0x32')]=_[_0x2488('0x33')](_0x314bb2[_0x2488('0x34')],_0x314bb2[_0x2488('0x30')]);_0x3ab08d['attributes']=_[_0x2488('0x33')](_0x314bb2[_0x2488('0x34')],qs['fields'](_0x536a0a[_0x2488('0x30')]['fields']));_0x3ab08d['attributes']=_0x3ab08d['attributes'][_0x2488('0x35')]?_0x3ab08d[_0x2488('0x36')]:_0x314bb2['model'];if(!_0x536a0a['query'][_0x2488('0x37')](_0x2488('0x38'))){_0x3ab08d[_0x2488('0x20')]=qs[_0x2488('0x20')](_0x536a0a[_0x2488('0x30')][_0x2488('0x20')]);_0x3ab08d[_0x2488('0x1d')]=qs[_0x2488('0x1d')](_0x536a0a[_0x2488('0x30')]['offset']);}_0x3ab08d[_0x2488('0x39')]=qs['sort'](_0x536a0a[_0x2488('0x30')][_0x2488('0x3a')]);_0x3ab08d[_0x2488('0x3b')]=qs['filters'](_[_0x2488('0x3c')](_0x536a0a[_0x2488('0x30')],_0x314bb2['filters']),_0x4c9353);if(_0x536a0a[_0x2488('0x30')][_0x2488('0x3d')]){_0x3ab08d[_0x2488('0x3b')]=_[_0x2488('0x3e')](_0x3ab08d[_0x2488('0x3b')],{'$or':_[_0x2488('0x2a')](_0x4c9353,function(_0x32eb53){if(_0x32eb53[_0x2488('0x2e')]!==_0x2488('0x3f')){var _0x18d674={};_0x18d674[_0x32eb53['name']]={'$like':'%'+_0x536a0a[_0x2488('0x30')][_0x2488('0x3d')]+'%'};return _0x18d674;}})});}_0x3ab08d=_['merge']({},_0x3ab08d,_0x536a0a[_0x2488('0x40')]);var _0x124fc7={'where':_0x3ab08d[_0x2488('0x3b')]};return db[_0x2488('0x2b')][_0x2488('0x1f')](_0x124fc7)[_0x2488('0x25')](function(_0x2226c2){_0x1cc2e8[_0x2488('0x1f')]=_0x2226c2;if(_0x536a0a[_0x2488('0x30')][_0x2488('0x41')]){_0x3ab08d[_0x2488('0x42')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x3ab08d);})[_0x2488('0x25')](function(_0x7d7bfe){_0x1cc2e8['rows']=_0x7d7bfe;return _0x1cc2e8;})[_0x2488('0x25')](respondWithFilteredResult(_0x5827e4,_0x3ab08d))[_0x2488('0x43')](handleError(_0x5827e4,null));};exports[_0x2488('0x44')]=function(_0x358a61,_0x28c279){var _0x442c3d={'raw':!![],'where':{'id':_0x358a61[_0x2488('0x45')]['id']}},_0x224d72={};_0x224d72[_0x2488('0x34')]=_[_0x2488('0x31')](db['SalesforceField'][_0x2488('0x2c')]);_0x224d72[_0x2488('0x30')]=_[_0x2488('0x31')](_0x358a61[_0x2488('0x30')]);_0x224d72[_0x2488('0x32')]=_[_0x2488('0x33')](_0x224d72['model'],_0x224d72[_0x2488('0x30')]);_0x442c3d[_0x2488('0x36')]=_['intersection'](_0x224d72['model'],qs[_0x2488('0x46')](_0x358a61[_0x2488('0x30')]['fields']));_0x442c3d[_0x2488('0x36')]=_0x442c3d[_0x2488('0x36')][_0x2488('0x35')]?_0x442c3d[_0x2488('0x36')]:_0x224d72[_0x2488('0x34')];if(_0x358a61['query'][_0x2488('0x41')]){_0x442c3d[_0x2488('0x42')]=[{'all':!![]}];}_0x442c3d=_[_0x2488('0x3e')]({},_0x442c3d,_0x358a61[_0x2488('0x40')]);return db['SalesforceField'][_0x2488('0x47')](_0x442c3d)[_0x2488('0x25')](handleEntityNotFound(_0x28c279,null))[_0x2488('0x25')](respondWithResult(_0x28c279,null))['catch'](handleError(_0x28c279,null));};exports[_0x2488('0x48')]=function(_0x19f6a5,_0x180eb5){return db[_0x2488('0x2b')][_0x2488('0x48')](_0x19f6a5[_0x2488('0x49')],{})[_0x2488('0x25')](respondWithResult(_0x180eb5,0xc9))[_0x2488('0x43')](handleError(_0x180eb5,null));};exports[_0x2488('0x4a')]=function(_0x4ddd2f,_0x65d7c6){if(_0x4ddd2f['body']['id']){delete _0x4ddd2f[_0x2488('0x49')]['id'];}return db[_0x2488('0x2b')][_0x2488('0x47')]({'where':{'id':_0x4ddd2f['params']['id']}})['then'](handleEntityNotFound(_0x65d7c6,null))[_0x2488('0x25')](saveUpdates(_0x4ddd2f[_0x2488('0x49')],null))[_0x2488('0x25')](respondWithResult(_0x65d7c6,null))[_0x2488('0x43')](handleError(_0x65d7c6,null));};exports[_0x2488('0x26')]=function(_0x2d06ab,_0x3f447b){return db[_0x2488('0x2b')]['find']({'where':{'id':_0x2d06ab[_0x2488('0x45')]['id']}})[_0x2488('0x25')](handleEntityNotFound(_0x3f447b,null))['then'](removeEntity(_0x3f447b,null))[_0x2488('0x43')](handleError(_0x3f447b,null));};
\ No newline at end of file
index 61e3001..eee624a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d8f=['api','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9d8f,0x183));var _0xf9d8=function(_0x40b1bf,_0x1325b8){_0x40b1bf=_0x40b1bf-0x0;var _0x56ec30=_0x9d8f[_0x40b1bf];return _0x56ec30;};'use strict';var _=require(_0xf9d8('0x0'));var util=require(_0xf9d8('0x1'));var logger=require(_0xf9d8('0x2'))(_0xf9d8('0x3'));var moment=require('moment');var BPromise=require(_0xf9d8('0x4'));var rp=require(_0xf9d8('0x5'));var fs=require('fs');var path=require(_0xf9d8('0x6'));var rimraf=require(_0xf9d8('0x7'));var config=require('../../config/environment');var attributes=require(_0xf9d8('0x8'));module[_0xf9d8('0x9')]=function(_0x5c7c05,_0x197154){return _0x5c7c05[_0xf9d8('0xa')](_0xf9d8('0xb'),attributes,{'tableName':_0xf9d8('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xf9d8('0xd'),_0xf9d8('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9cb2=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x11908b,_0x2fcdd9){var _0x1f7b25=function(_0x22770a){while(--_0x22770a){_0x11908b['push'](_0x11908b['shift']());}};_0x1f7b25(++_0x2fcdd9);}(_0x9cb2,0x15b));var _0x29cb=function(_0x5a4bb5,_0x48520e){_0x5a4bb5=_0x5a4bb5-0x0;var _0x591b91=_0x9cb2[_0x5a4bb5];return _0x591b91;};'use strict';var _=require(_0x29cb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29cb('0x1'));var moment=require(_0x29cb('0x2'));var BPromise=require(_0x29cb('0x3'));var rp=require(_0x29cb('0x4'));var fs=require('fs');var path=require(_0x29cb('0x5'));var rimraf=require(_0x29cb('0x6'));var config=require(_0x29cb('0x7'));var attributes=require(_0x29cb('0x8'));module[_0x29cb('0x9')]=function(_0x3b634f,_0x285f26){return _0x3b634f[_0x29cb('0xa')](_0x29cb('0xb'),attributes,{'tableName':_0x29cb('0xc'),'paranoid':![],'indexes':[{'name':_0x29cb('0xd'),'fields':[_0x29cb('0xe'),_0x29cb('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 881984d..be0fdda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3300=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x415fa5,_0x122781){var _0x58a0d5=function(_0x2aa025){while(--_0x2aa025){_0x415fa5['push'](_0x415fa5['shift']());}};_0x58a0d5(++_0x122781);}(_0x3300,0xa3));var _0x0330=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x3300[_0x513047];return _0x15b779;};'use strict';var _=require(_0x0330('0x0'));var util=require(_0x0330('0x1'));var moment=require('moment');var BPromise=require(_0x0330('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0330('0x3'));var db=require(_0x0330('0x4'))['db'];var utils=require(_0x0330('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0330('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0330('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x118596,_0x4609dc,_0x226b2d){return new BPromise(function(_0x22b964,_0x196af6){return client[_0x0330('0x8')](_0x118596,_0x226b2d)[_0x0330('0x9')](function(_0x553367){logger[_0x0330('0xa')](_0x0330('0xb'),_0x4609dc,_0x0330('0xc'));logger[_0x0330('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4609dc,_0x0330('0xc'),JSON[_0x0330('0xe')](_0x553367));if(_0x553367[_0x0330('0xf')]){if(_0x553367['error'][_0x0330('0x10')]===0x1f4){logger[_0x0330('0xf')](_0x0330('0xb'),_0x4609dc,_0x553367[_0x0330('0xf')]['message']);return _0x196af6(_0x553367[_0x0330('0xf')]['message']);}logger[_0x0330('0xf')](_0x0330('0xb'),_0x4609dc,_0x553367['error'][_0x0330('0x11')]);return _0x22b964(_0x553367['error'][_0x0330('0x11')]);}else{logger[_0x0330('0xa')](_0x0330('0xb'),_0x4609dc,_0x0330('0xc'));_0x22b964(_0x553367[_0x0330('0x12')]['message']);}})[_0x0330('0x13')](function(_0x1b867a){logger[_0x0330('0xf')](_0x0330('0xb'),_0x4609dc,_0x1b867a);_0x196af6(_0x1b867a);});});}
\ No newline at end of file
+var _0x44c7=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x1b591b,_0x6d2e2b){var _0x3c24f0=function(_0x265093){while(--_0x265093){_0x1b591b['push'](_0x1b591b['shift']());}};_0x3c24f0(++_0x6d2e2b);}(_0x44c7,0xaf));var _0x744c=function(_0x4239ae,_0x1a12fb){_0x4239ae=_0x4239ae-0x0;var _0x1b46f8=_0x44c7[_0x4239ae];return _0x1b46f8;};'use strict';var _=require(_0x744c('0x0'));var util=require(_0x744c('0x1'));var moment=require(_0x744c('0x2'));var BPromise=require(_0x744c('0x3'));var rs=require(_0x744c('0x4'));var fs=require('fs');var Redis=require(_0x744c('0x5'));var db=require(_0x744c('0x6'))['db'];var utils=require(_0x744c('0x7'));var logger=require('../../config/logger')(_0x744c('0x8'));var config=require(_0x744c('0x9'));var jayson=require(_0x744c('0xa'));var client=jayson[_0x744c('0xb')][_0x744c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a55dd,_0x430abb,_0x206555){return new BPromise(function(_0x2f5783,_0x4d9da2){return client['request'](_0x7a55dd,_0x206555)[_0x744c('0xd')](function(_0x49c516){logger[_0x744c('0xe')](_0x744c('0xf'),_0x430abb,_0x744c('0x10'));logger[_0x744c('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x430abb,'request\x20sent',JSON[_0x744c('0x12')](_0x49c516));if(_0x49c516[_0x744c('0x13')]){if(_0x49c516['error'][_0x744c('0x14')]===0x1f4){logger[_0x744c('0x13')](_0x744c('0xf'),_0x430abb,_0x49c516['error'][_0x744c('0x15')]);return _0x4d9da2(_0x49c516['error']['message']);}logger['error'](_0x744c('0xf'),_0x430abb,_0x49c516[_0x744c('0x13')][_0x744c('0x15')]);return _0x2f5783(_0x49c516[_0x744c('0x13')][_0x744c('0x15')]);}else{logger[_0x744c('0xe')](_0x744c('0xf'),_0x430abb,_0x744c('0x10'));_0x2f5783(_0x49c516[_0x744c('0x16')][_0x744c('0x15')]);}})[_0x744c('0x17')](function(_0x31fd91){logger[_0x744c('0x13')](_0x744c('0xf'),_0x430abb,_0x31fd91);_0x4d9da2(_0x31fd91);});});}
\ No newline at end of file
index 52556ec..f3fc58c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9db3=['../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xe82249,_0x295dad){var _0x1cc69e=function(_0x53a1dc){while(--_0x53a1dc){_0xe82249['push'](_0xe82249['shift']());}};_0x1cc69e(++_0x295dad);}(_0x9db3,0xe0));var _0x39db=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x9db3[_0x599f41];return _0x2e4d58;};'use strict';var multer=require('multer');var util=require(_0x39db('0x0'));var path=require(_0x39db('0x1'));var timeout=require(_0x39db('0x2'));var express=require(_0x39db('0x3'));var router=express[_0x39db('0x4')]();var fs_extra=require(_0x39db('0x5'));var auth=require(_0x39db('0x6'));var interaction=require(_0x39db('0x7'));var config=require('../../config/environment');var controller=require(_0x39db('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x39db('0x9')]('/:id',auth[_0x39db('0xa')](),controller['show']);router[_0x39db('0x9')](_0x39db('0xb'),auth[_0x39db('0xa')](),controller['getConfigurations']);router[_0x39db('0x9')](_0x39db('0xc'),auth[_0x39db('0xa')](),controller[_0x39db('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x39db('0xe')]);router[_0x39db('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x39db('0x10')]);router[_0x39db('0x11')]('/:id',auth[_0x39db('0xa')](),controller['update']);router[_0x39db('0x12')](_0x39db('0x13'),auth[_0x39db('0xa')](),controller[_0x39db('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd90e=['multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','delete','destroy','exports'];(function(_0x14e8b9,_0x78433f){var _0x49279e=function(_0x202eb1){while(--_0x202eb1){_0x14e8b9['push'](_0x14e8b9['shift']());}};_0x49279e(++_0x78433f);}(_0xd90e,0x17c));var _0xed90=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd90e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xed90('0x0'));var util=require('util');var path=require(_0xed90('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xed90('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xed90('0x3'));var interaction=require(_0xed90('0x4'));var config=require(_0xed90('0x5'));var controller=require(_0xed90('0x6'));router['get']('/',auth[_0xed90('0x7')](),controller['index']);router[_0xed90('0x8')](_0xed90('0x9'),auth[_0xed90('0x7')](),controller[_0xed90('0xa')]);router[_0xed90('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xed90('0xb')]);router['get'](_0xed90('0xc'),auth[_0xed90('0x7')](),controller[_0xed90('0xd')]);router[_0xed90('0xe')]('/',auth['isAuthenticated'](),controller[_0xed90('0xf')]);router['post'](_0xed90('0x10'),auth[_0xed90('0x7')](),controller['addConfiguration']);router['put'](_0xed90('0x9'),auth[_0xed90('0x7')](),controller['update']);router[_0xed90('0x11')](_0xed90('0x9'),auth[_0xed90('0x7')](),controller[_0xed90('0x12')]);module[_0xed90('0x13')]=router;
\ No newline at end of file
index 49523e4..4188a37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e33=['STRING','username','remoteUri','sequelize','exports'];(function(_0x5e7734,_0x106d6f){var _0x34ef37=function(_0x2bb712){while(--_0x2bb712){_0x5e7734['push'](_0x5e7734['shift']());}};_0x34ef37(++_0x106d6f);}(_0x9e33,0x8f));var _0x39e3=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x9e33[_0x44cb92];return _0x56b9e6;};'use strict';var Sequelize=require(_0x39e3('0x0'));module[_0x39e3('0x1')]={'name':{'type':Sequelize[_0x39e3('0x2')]},'description':{'type':Sequelize[_0x39e3('0x2')]},'username':{'type':Sequelize[_0x39e3('0x2')],'unique':_0x39e3('0x3')},'password':{'type':Sequelize[_0x39e3('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x39e3('0x2')],'unique':_0x39e3('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xe5a9=['STRING','username','exports'];(function(_0x1e6770,_0x37fbbf){var _0x351e78=function(_0x29b42d){while(--_0x29b42d){_0x1e6770['push'](_0x1e6770['shift']());}};_0x351e78(++_0x37fbbf);}(_0xe5a9,0x143));var _0x9e5a=function(_0x31f207,_0x33353a){_0x31f207=_0x31f207-0x0;var _0x1089ef=_0xe5a9[_0x31f207];return _0x1089ef;};'use strict';var Sequelize=require('sequelize');module[_0x9e5a('0x0')]={'name':{'type':Sequelize[_0x9e5a('0x1')]},'description':{'type':Sequelize[_0x9e5a('0x1')]},'username':{'type':Sequelize[_0x9e5a('0x1')],'unique':_0x9e5a('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9e5a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x9e5a('0x1')],'allowNull':![]}};
\ No newline at end of file
index 010ea9f..3dfe4d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ec=['closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','reopened_time','caller_id','approval_set','work_notes','close_code','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','push','concat','ServiceNow\x20error:\x20','test','statusCode','error','stack','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','count','offset','set','apply','reject','update','then','sendStatus','send','map','ServicenowAccount','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','destroy','getConfigurations','addConfiguration','findOne','Subjects','getDescriptions','channel','ServicenowConfiguration','ServicenowField','Descriptions','getFields','hold_reason','knowledge','subcategory','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','calendar_stc'];(function(_0x5a39f5,_0x2cbb0d){var _0xe02ffb=function(_0x469a62){while(--_0x469a62){_0x5a39f5['push'](_0x5a39f5['shift']());}};_0xe02ffb(++_0x2cbb0d);}(_0xa9ec,0x10d));var _0xca9e=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0xa9ec[_0x3df3c6];return _0x254c43;};'use strict';var emlformat=require(_0xca9e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca9e('0x1'));var rp=require('request-promise');var moment=require(_0xca9e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xca9e('0x3'));var util=require(_0xca9e('0x4'));var path=require(_0xca9e('0x5'));var sox=require('sox');var csv=require(_0xca9e('0x6'));var ejs=require(_0xca9e('0x7'));var fs=require('fs');var fs_extra=require(_0xca9e('0x8'));var _=require(_0xca9e('0x9'));var squel=require(_0xca9e('0xa'));var crypto=require(_0xca9e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xca9e('0x6'));var querystring=require(_0xca9e('0xc'));var Papa=require('papaparse');var Redis=require(_0xca9e('0xd'));var authService=require(_0xca9e('0xe'));var qs=require(_0xca9e('0xf'));var as=require(_0xca9e('0x10'));var hardwareService=require(_0xca9e('0x11'));var logger=require(_0xca9e('0x12'))('api');var utils=require(_0xca9e('0x13'));var config=require(_0xca9e('0x14'));var licenseUtil=require(_0xca9e('0x15'));var db=require(_0xca9e('0x16'))['db'];var integrations=require(_0xca9e('0x17'));function respondWithStatusCode(_0x375651,_0x4a8bb2){_0x4a8bb2=_0x4a8bb2||0xcc;return function(_0x5d3fae){if(_0x5d3fae){return _0x375651['sendStatus'](_0x4a8bb2);}return _0x375651[_0xca9e('0x18')](_0x4a8bb2)[_0xca9e('0x19')]();};}function respondWithResult(_0x2d097d,_0x37e8ea){_0x37e8ea=_0x37e8ea||0xc8;return function(_0x1751e1){if(_0x1751e1){return _0x2d097d[_0xca9e('0x18')](_0x37e8ea)[_0xca9e('0x1a')](_0x1751e1);}};}function respondWithFilteredResult(_0x1c2359,_0x38d486){return function(_0x4a2424){if(_0x4a2424){var _0xdae226=typeof _0x38d486['offset']===_0xca9e('0x1b')&&typeof _0x38d486['limit']==='undefined';var _0x5d7da0=_0x4a2424[_0xca9e('0x1c')];var _0x48643=_0xdae226?0x0:_0x38d486[_0xca9e('0x1d')];var _0x1a51c5=_0xdae226?_0x4a2424['count']:_0x38d486['offset']+_0x38d486['limit'];var _0x3c5ded;if(_0x1a51c5>=_0x5d7da0){_0x1a51c5=_0x5d7da0;_0x3c5ded=0xc8;}else{_0x3c5ded=0xce;}_0x1c2359[_0xca9e('0x18')](_0x3c5ded);return _0x1c2359[_0xca9e('0x1e')]('Content-Range',_0x48643+'-'+_0x1a51c5+'/'+_0x5d7da0)[_0xca9e('0x1a')](_0x4a2424);}return null;};}function patchUpdates(_0x5b8be3){return function(_0x311525){try{jsonpatch[_0xca9e('0x1f')](_0x311525,_0x5b8be3,!![]);}catch(_0x4619be){return BPromise[_0xca9e('0x20')](_0x4619be);}return _0x311525['save']();};}function saveUpdates(_0x4b4ca5,_0x2d7d05){return function(_0x1229c3){if(_0x1229c3){return _0x1229c3[_0xca9e('0x21')](_0x4b4ca5)[_0xca9e('0x22')](function(_0x114ac8){return _0x114ac8;});}return null;};}function removeEntity(_0x276ef1,_0x5f47e6){return function(_0x15ba2c){if(_0x15ba2c){return _0x15ba2c['destroy']()[_0xca9e('0x22')](function(){_0x276ef1[_0xca9e('0x18')](0xcc)[_0xca9e('0x19')]();});}};}function handleEntityNotFound(_0x46d0a8,_0x5ea5e8){return function(_0x4260ce){if(!_0x4260ce){_0x46d0a8[_0xca9e('0x23')](0x194);}return _0x4260ce;};}function handleError(_0x161b99,_0x48eb7c){_0x48eb7c=_0x48eb7c||0x1f4;return function(_0x1c4ec4){logger['error'](_0x1c4ec4['stack']);if(_0x1c4ec4['name']){delete _0x1c4ec4['name'];}_0x161b99['status'](_0x48eb7c)[_0xca9e('0x24')](_0x1c4ec4);};}exports['index']=function(_0x58f4d9,_0x5d10e8){var _0x1fd3e4={},_0x596bf9={},_0x3a2c88={'count':0x0,'rows':[]};var _0x13a8d0=_[_0xca9e('0x25')](db[_0xca9e('0x26')][_0xca9e('0x27')],function(_0x3c9b57){return{'name':_0x3c9b57[_0xca9e('0x28')],'type':_0x3c9b57[_0xca9e('0x29')]['key']};});_0x596bf9[_0xca9e('0x2a')]=_['map'](_0x13a8d0,_0xca9e('0x2b'));_0x596bf9[_0xca9e('0x2c')]=_['keys'](_0x58f4d9[_0xca9e('0x2c')]);_0x596bf9[_0xca9e('0x2d')]=_[_0xca9e('0x2e')](_0x596bf9[_0xca9e('0x2a')],_0x596bf9['query']);_0x1fd3e4['attributes']=_['intersection'](_0x596bf9[_0xca9e('0x2a')],qs[_0xca9e('0x2f')](_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x2f')]));_0x1fd3e4[_0xca9e('0x30')]=_0x1fd3e4[_0xca9e('0x30')][_0xca9e('0x31')]?_0x1fd3e4[_0xca9e('0x30')]:_0x596bf9[_0xca9e('0x2a')];if(!_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x32')](_0xca9e('0x33'))){_0x1fd3e4[_0xca9e('0x34')]=qs[_0xca9e('0x34')](_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x34')]);_0x1fd3e4[_0xca9e('0x1d')]=qs[_0xca9e('0x1d')](_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x1d')]);}_0x1fd3e4[_0xca9e('0x35')]=qs['sort'](_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x36')]);_0x1fd3e4[_0xca9e('0x37')]=qs['filters'](_[_0xca9e('0x38')](_0x58f4d9[_0xca9e('0x2c')],_0x596bf9[_0xca9e('0x2d')]),_0x13a8d0);if(_0x58f4d9[_0xca9e('0x2c')]['filter']){_0x1fd3e4['where']=_[_0xca9e('0x39')](_0x1fd3e4[_0xca9e('0x37')],{'$or':_['map'](_0x13a8d0,function(_0x30b432){if(_0x30b432[_0xca9e('0x29')]!=='VIRTUAL'){var _0x397c96={};_0x397c96[_0x30b432['name']]={'$like':'%'+_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x3a')]+'%'};return _0x397c96;}})});}_0x1fd3e4=_[_0xca9e('0x39')]({},_0x1fd3e4,_0x58f4d9[_0xca9e('0x3b')]);var _0x178792={'where':_0x1fd3e4[_0xca9e('0x37')]};return db['ServicenowAccount']['count'](_0x178792)[_0xca9e('0x22')](function(_0x1e8f22){_0x3a2c88['count']=_0x1e8f22;if(_0x58f4d9[_0xca9e('0x2c')][_0xca9e('0x3c')]){_0x1fd3e4[_0xca9e('0x3d')]=[{'all':!![]}];}return db[_0xca9e('0x26')]['findAll'](_0x1fd3e4);})[_0xca9e('0x22')](function(_0x20f2e8){_0x3a2c88[_0xca9e('0x3e')]=_0x20f2e8;return _0x3a2c88;})[_0xca9e('0x22')](respondWithFilteredResult(_0x5d10e8,_0x1fd3e4))[_0xca9e('0x3f')](handleError(_0x5d10e8,null));};exports['show']=function(_0x1e4ec3,_0x463620){var _0xf0718c={'raw':![],'where':{'id':_0x1e4ec3[_0xca9e('0x40')]['id']}},_0x3af0d6={};_0x3af0d6[_0xca9e('0x2a')]=_[_0xca9e('0x41')](db[_0xca9e('0x26')][_0xca9e('0x27')]);_0x3af0d6[_0xca9e('0x2c')]=_[_0xca9e('0x41')](_0x1e4ec3[_0xca9e('0x2c')]);_0x3af0d6['filters']=_[_0xca9e('0x2e')](_0x3af0d6[_0xca9e('0x2a')],_0x3af0d6[_0xca9e('0x2c')]);_0xf0718c[_0xca9e('0x30')]=_[_0xca9e('0x2e')](_0x3af0d6[_0xca9e('0x2a')],qs[_0xca9e('0x2f')](_0x1e4ec3[_0xca9e('0x2c')][_0xca9e('0x2f')]));_0xf0718c[_0xca9e('0x30')]=_0xf0718c[_0xca9e('0x30')]['length']?_0xf0718c[_0xca9e('0x30')]:_0x3af0d6[_0xca9e('0x2a')];if(_0x1e4ec3[_0xca9e('0x2c')][_0xca9e('0x3c')]){_0xf0718c['include']=[{'all':!![]}];}_0xf0718c=_[_0xca9e('0x39')]({},_0xf0718c,_0x1e4ec3[_0xca9e('0x3b')]);return db[_0xca9e('0x26')][_0xca9e('0x42')](_0xf0718c)[_0xca9e('0x22')](handleEntityNotFound(_0x463620,null))[_0xca9e('0x22')](respondWithResult(_0x463620,null))[_0xca9e('0x3f')](handleError(_0x463620,null));};exports['create']=function(_0x27cdcb,_0x588a5d){return db[_0xca9e('0x26')][_0xca9e('0x43')](_0x27cdcb['body'],{})[_0xca9e('0x22')](respondWithResult(_0x588a5d,0xc9))['catch'](handleError(_0x588a5d,null));};exports[_0xca9e('0x21')]=function(_0x52508b,_0x4ab94b){if(_0x52508b['body']['id']){delete _0x52508b[_0xca9e('0x44')]['id'];}return db[_0xca9e('0x26')][_0xca9e('0x42')]({'where':{'id':_0x52508b['params']['id']}})[_0xca9e('0x22')](handleEntityNotFound(_0x4ab94b,null))[_0xca9e('0x22')](saveUpdates(_0x52508b['body'],null))[_0xca9e('0x22')](respondWithResult(_0x4ab94b,null))['catch'](handleError(_0x4ab94b,null));};exports[_0xca9e('0x45')]=function(_0x1f0afe,_0x7ce76e){return db['ServicenowAccount'][_0xca9e('0x42')]({'where':{'id':_0x1f0afe['params']['id']}})[_0xca9e('0x22')](handleEntityNotFound(_0x7ce76e,null))['then'](removeEntity(_0x7ce76e,null))[_0xca9e('0x3f')](handleError(_0x7ce76e,null));};exports['getConfigurations']=function(_0xcd033b,_0x4c10a8,_0xbe7e2d){var _0x4b700e={};var _0x4885cd={};var _0x330bae;var _0x28186a;return db[_0xca9e('0x26')]['findOne']({'where':{'id':_0xcd033b[_0xca9e('0x40')]['id']}})[_0xca9e('0x22')](handleEntityNotFound(_0x4c10a8,null))['then'](function(_0x4f32ae){if(_0x4f32ae){_0x330bae=_0x4f32ae;_0x4885cd[_0xca9e('0x2a')]=_[_0xca9e('0x41')](db['ServicenowConfiguration'][_0xca9e('0x27')]);_0x4885cd['query']=_[_0xca9e('0x41')](_0xcd033b[_0xca9e('0x2c')]);_0x4885cd['filters']=_['intersection'](_0x4885cd[_0xca9e('0x2a')],_0x4885cd[_0xca9e('0x2c')]);_0x4b700e[_0xca9e('0x30')]=_[_0xca9e('0x2e')](_0x4885cd[_0xca9e('0x2a')],qs[_0xca9e('0x2f')](_0xcd033b['query'][_0xca9e('0x2f')]));_0x4b700e[_0xca9e('0x30')]=_0x4b700e[_0xca9e('0x30')]['length']?_0x4b700e['attributes']:_0x4885cd['model'];_0x4b700e[_0xca9e('0x35')]=qs[_0xca9e('0x36')](_0xcd033b[_0xca9e('0x2c')]['sort']);_0x4b700e[_0xca9e('0x37')]=qs['filters'](_[_0xca9e('0x38')](_0xcd033b['query'],_0x4885cd[_0xca9e('0x2d')]));if(_0xcd033b['query'][_0xca9e('0x3a')]){_0x4b700e[_0xca9e('0x37')]=_[_0xca9e('0x39')](_0x4b700e['where'],{'$or':_[_0xca9e('0x25')](_0x4b700e['attributes'],function(_0x327a43){var _0x48c288={};_0x48c288[_0x327a43]={'$like':'%'+_0xcd033b[_0xca9e('0x2c')]['filter']+'%'};return _0x48c288;})});}_0x4b700e=_[_0xca9e('0x39')]({},_0x4b700e,_0xcd033b[_0xca9e('0x3b')]);return _0x330bae['getConfigurations'](_0x4b700e);}})['then'](function(_0x54201f){if(_0x54201f){_0x28186a=_0x54201f[_0xca9e('0x31')];if(!_0xcd033b['query'][_0xca9e('0x32')]('nolimit')){_0x4b700e[_0xca9e('0x34')]=qs['limit'](_0xcd033b[_0xca9e('0x2c')]['limit']);_0x4b700e[_0xca9e('0x1d')]=qs[_0xca9e('0x1d')](_0xcd033b[_0xca9e('0x2c')][_0xca9e('0x1d')]);}return _0x330bae[_0xca9e('0x46')](_0x4b700e);}})[_0xca9e('0x22')](function(_0x21e473){if(_0x21e473){return _0x21e473?{'count':_0x28186a,'rows':_0x21e473}:null;}})[_0xca9e('0x22')](respondWithResult(_0x4c10a8,null))['catch'](handleError(_0x4c10a8,null));};exports[_0xca9e('0x47')]=function(_0x3d9b19,_0xf71695,_0x8c9253){if(_0x3d9b19[_0xca9e('0x44')]['id']){delete _0x3d9b19[_0xca9e('0x44')]['id'];}return db[_0xca9e('0x26')][_0xca9e('0x48')]({'where':{'id':_0x3d9b19[_0xca9e('0x40')]['id']}})[_0xca9e('0x22')](handleEntityNotFound(_0xf71695,null))[_0xca9e('0x22')](function(_0x23771b){if(_0x23771b){_0x3d9b19[_0xca9e('0x44')]['AccountId']=_0x23771b['id'];_0x3d9b19[_0xca9e('0x44')][_0xca9e('0x49')]=integrations['getSubjects'](_0x3d9b19[_0xca9e('0x44')]['channel'],_0x3d9b19['body'][_0xca9e('0x29')]);_0x3d9b19[_0xca9e('0x44')]['Descriptions']=integrations[_0xca9e('0x4a')](_0x3d9b19[_0xca9e('0x44')][_0xca9e('0x4b')],_0x3d9b19[_0xca9e('0x44')][_0xca9e('0x29')]);return db[_0xca9e('0x4c')]['create'](_0x3d9b19[_0xca9e('0x44')],{'include':[{'model':db[_0xca9e('0x4d')],'as':_0xca9e('0x49')},{'model':db[_0xca9e('0x4d')],'as':_0xca9e('0x4e')}]});}return null;})[_0xca9e('0x22')](respondWithResult(_0xf71695,null))[_0xca9e('0x3f')](handleError(_0xf71695,null));};exports[_0xca9e('0x4f')]=function(_0x367b74,_0x46cb6b,_0x18fd4d){var _0x152788=['made_sla',_0xca9e('0x50'),_0xca9e('0x51'),_0xca9e('0x52'),'close_code',_0xca9e('0x53'),'incident_state',_0xca9e('0x54'),_0xca9e('0x55')];var _0x3f4d30=[_0xca9e('0x56'),_0xca9e('0x57'),_0xca9e('0x58'),_0xca9e('0x59'),_0xca9e('0x5a'),_0xca9e('0x5b'),'child_incidents',_0xca9e('0x50'),_0xca9e('0x5c'),_0xca9e('0x5d'),_0xca9e('0x5e'),_0xca9e('0x5f'),_0xca9e('0x60'),_0xca9e('0x61'),'sys_created_on',_0xca9e('0x62'),_0xca9e('0x63'),'sys_created_by',_0xca9e('0x51'),'order',_0xca9e('0x64'),_0xca9e('0x65'),_0xca9e('0x66'),_0xca9e('0x67'),_0xca9e('0x68'),_0xca9e('0x69'),_0xca9e('0x6a'),_0xca9e('0x6b'),_0xca9e('0x6c'),_0xca9e('0x6d'),_0xca9e('0x6e'),_0xca9e('0x6f'),_0xca9e('0x70'),'opened_at',_0xca9e('0x71'),_0xca9e('0x72'),'work_end',_0xca9e('0x73'),'resolved_at',_0xca9e('0x74'),_0xca9e('0x75'),_0xca9e('0x52'),_0xca9e('0x76'),'short_description',_0xca9e('0x77'),_0xca9e('0x78'),_0xca9e('0x79'),_0xca9e('0x7a'),_0xca9e('0x7b'),'business_stc',_0xca9e('0x7c'),_0xca9e('0x7d'),'calendar_duration',_0xca9e('0x53'),_0xca9e('0x7e'),_0xca9e('0x7f'),_0xca9e('0x80'),_0xca9e('0x81'),_0xca9e('0x82'),_0xca9e('0x83'),_0xca9e('0x84'),_0xca9e('0x85'),_0xca9e('0x86'),_0xca9e('0x87'),'problem_id',_0xca9e('0x88'),_0xca9e('0x89'),'activity_due',_0xca9e('0x8a'),_0xca9e('0x54'),'comments',_0xca9e('0x8b'),_0xca9e('0x8c'),_0xca9e('0x8d'),_0xca9e('0x8e'),_0xca9e('0x8f'),_0xca9e('0x90'),_0xca9e('0x91'),_0xca9e('0x92'),_0xca9e('0x93'),'correlation_id',_0xca9e('0x94'),'category'];var _0x4a2986='';var _0x9d4f16='';var _0x1ccfd8=[];var _0x4210b8='';var _0x3c6afd='';var _0xe9ddc=[];var _0x5a8d32='';var _0x29726c='';var _0xe83fdb={};var _0x113a7f='';return db[_0xca9e('0x26')][_0xca9e('0x48')]({'where':{'id':_0x367b74[_0xca9e('0x40')]['id']},'attributes':['id',_0xca9e('0x95'),_0xca9e('0x96'),'email',_0xca9e('0x97'),_0xca9e('0x98')]})['then'](handleEntityNotFound(_0x46cb6b,null))[_0xca9e('0x22')](function(_0x5f05f7){if(_0x5f05f7){_0x113a7f=_0x5f05f7['remoteUri'];var _0x3835fa=_0x113a7f[_0xca9e('0x99')](-0x1);if(_0x3835fa==='/'){_0x113a7f=_0x113a7f[_0xca9e('0x9a')](0x0,_0x113a7f[_0xca9e('0x9b')](_0x3835fa));}_0x29726c=util[_0xca9e('0x9c')](_0xca9e('0x9d'),_0x113a7f);_0x5a8d32=util[_0xca9e('0x9c')]('%s/api/now/table/',_0x113a7f);_0xe83fdb={'user':_0x5f05f7[_0xca9e('0x95')],'pass':_0x5f05f7[_0xca9e('0x96')]};var _0x207dd3={'method':'GET','uri':_0x29726c+_0xca9e('0x9e'),'auth':_0xe83fdb,'json':!![]};return rp(_0x207dd3);}})[_0xca9e('0x22')](function(_0x52c263){if(_0x52c263['result'][_0xca9e('0x31')]>0x0){_0x4a2986=_0x52c263[_0xca9e('0x9f')];}console['log'](_0xca9e('0xa0'),_0x4a2986);_0xe9ddc=[];_0x9d4f16=Object[_0xca9e('0xa1')]([],_0x4a2986);_[_0xca9e('0xa2')](_0x9d4f16,function(_0xe715f3){return!_0x152788[_0xca9e('0xa3')](_0xe715f3[_0xca9e('0x2b')]);});_0x9d4f16[_0xca9e('0xa4')](function(_0x5d31ed){var _0x1c8892=createFieldObject(_0x5a8d32,_0xe83fdb,_0x5d31ed['internalType'],_0x5d31ed[_0xca9e('0x2b')],_0x5d31ed['label'],![]);_0xe9ddc['push'](_0x1c8892);});return Promise[_0xca9e('0xa5')](_0xe9ddc);})['then'](function(_0x317377){_0x1ccfd8=_0x317377;_0x4210b8=Object[_0xca9e('0xa1')]([],_0x4a2986);console[_0xca9e('0xa6')](_0xca9e('0xa7'),_0x4a2986);_[_0xca9e('0xa2')](_0x4210b8,function(_0x368285){return _0x3f4d30[_0xca9e('0xa3')](_0x368285[_0xca9e('0x2b')]);});console[_0xca9e('0xa6')](_0xca9e('0xa8'),_0x4210b8);_0xe9ddc=[];_0x4210b8[_0xca9e('0xa4')](function(_0x301eca){var _0x120cbc=createFieldObject(_0x5a8d32,_0xe83fdb,_0x301eca[_0xca9e('0xa9')],_0x301eca[_0xca9e('0x2b')],_0x301eca[_0xca9e('0xaa')],!![]);_0xe9ddc[_0xca9e('0xab')](_0x120cbc);});return Promise[_0xca9e('0xa5')](_0xe9ddc);})['then'](function(_0xb714db){_0x3c6afd=_0xb714db;var _0x37523b=_0x1ccfd8[_0xca9e('0xac')](_0x3c6afd);return{'count':_0x37523b['length'],'rows':_0x37523b};})['then'](respondWithResult(_0x46cb6b,null))[_0xca9e('0x3f')](function(_0x4dcc0f){console[_0xca9e('0xa6')](_0xca9e('0xad')+_0x4dcc0f);var _0x8b3355=_0x367b74[_0xca9e('0x2c')][_0xca9e('0xae')]?0x1f4:_0x4dcc0f[_0xca9e('0xaf')]||0x1f4;logger[_0xca9e('0xb0')](_0x4dcc0f[_0xca9e('0xb1')]);delete _0x4dcc0f[_0xca9e('0x2b')];if(_0x8b3355===0x191){_0x8b3355=0x190;}_0x46cb6b['status'](_0x8b3355)[_0xca9e('0x24')](_0x367b74['query'][_0xca9e('0xae')]?{'message':_0xca9e('0xb2'),'statusCode':_0x4dcc0f[_0xca9e('0xaf')]}:_0x4dcc0f);});};function createFieldObject(_0x2bda36,_0x5666b3,_0x2dd3fc,_0x308f5d,_0xc31605,_0xb5c19){return new Promise(function(_0x39c407,_0x2c80f0){var _0x4911f5={'id':_0x308f5d,'name':_0xc31605,'custom':_0xb5c19};if(_0x2dd3fc===_0xca9e('0xb3')){_0x4911f5['options']=[{'name':'True','value':_0xca9e('0xb4')},{'name':_0xca9e('0xb5'),'value':_0xca9e('0xb6')}];_0x39c407(_0x4911f5);}else{var _0x2fb0ed={'method':'GET','uri':_0x2bda36+_0xca9e('0xb7')+_0x308f5d,'auth':_0x5666b3,'json':!![]};return rp(_0x2fb0ed)[_0xca9e('0x22')](function(_0x51a851){var _0x267ea1=[];if(_0x51a851[_0xca9e('0x9f')]['length']>0x0){_0x51a851[_0xca9e('0x9f')][_0xca9e('0xa4')](function(_0x2b0092){if(_0x2b0092[_0xca9e('0xb8')]===_0xca9e('0xb6')){var _0x1c16d4={'name':_0x2b0092[_0xca9e('0xaa')],'value':_0x2b0092['value']};_0x267ea1[_0xca9e('0xab')](_0x1c16d4);}});}_0x4911f5[_0xca9e('0x3b')]=_0x267ea1;if(_0x4911f5['options']['length']>0x0){_0x39c407(_0x4911f5);}else{if(_0xb5c19==![]){_0x39c407();}else{_0x39c407(_0x4911f5);}}});}});}
\ No newline at end of file
+var _0x61a0=['contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','approval','due_date','sys_mod_count','reopen_count','sys_tags','correlation_id','location','username','password','email','remoteUri','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','result','log','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','Wrong\x20credentials','boolean','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','ServicenowAccount','then','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','destroy','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','close_code','notify','incident_state','severity','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','knowledge','closed_at','cmdb_ci','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','reopened_time','resolved_at','caller_id','work_notes','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id'];(function(_0x50c1b3,_0x3ed97f){var _0x1f5160=function(_0x18dd22){while(--_0x18dd22){_0x50c1b3['push'](_0x50c1b3['shift']());}};_0x1f5160(++_0x3ed97f);}(_0x61a0,0x18e));var _0x061a=function(_0x29c8c4,_0x2cdf25){_0x29c8c4=_0x29c8c4-0x0;var _0xf11b18=_0x61a0[_0x29c8c4];return _0xf11b18;};'use strict';var emlformat=require(_0x061a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x061a('0x1'));var jsonpatch=require(_0x061a('0x2'));var rp=require(_0x061a('0x3'));var moment=require(_0x061a('0x4'));var BPromise=require(_0x061a('0x5'));var Mustache=require(_0x061a('0x6'));var util=require(_0x061a('0x7'));var path=require('path');var sox=require(_0x061a('0x8'));var csv=require(_0x061a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x061a('0xa'));var _=require(_0x061a('0xb'));var squel=require(_0x061a('0xc'));var crypto=require('crypto');var jsforce=require(_0x061a('0xd'));var deskjs=require(_0x061a('0xe'));var toCsv=require(_0x061a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x061a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x061a('0x10'));var as=require(_0x061a('0x11'));var hardwareService=require(_0x061a('0x12'));var logger=require(_0x061a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x061a('0x14'));var db=require(_0x061a('0x15'))['db'];var integrations=require(_0x061a('0x16'));function respondWithStatusCode(_0x278229,_0x10b0f5){_0x10b0f5=_0x10b0f5||0xcc;return function(_0x85a035){if(_0x85a035){return _0x278229[_0x061a('0x17')](_0x10b0f5);}return _0x278229[_0x061a('0x18')](_0x10b0f5)[_0x061a('0x19')]();};}function respondWithResult(_0x38c165,_0xbf5ae){_0xbf5ae=_0xbf5ae||0xc8;return function(_0x62a9bc){if(_0x62a9bc){return _0x38c165['status'](_0xbf5ae)[_0x061a('0x1a')](_0x62a9bc);}};}function respondWithFilteredResult(_0x205fe8,_0x3febb0){return function(_0x36c0c5){if(_0x36c0c5){var _0x6c2127=typeof _0x3febb0[_0x061a('0x1b')]===_0x061a('0x1c')&&typeof _0x3febb0[_0x061a('0x1d')]===_0x061a('0x1c');var _0x2dedae=_0x36c0c5[_0x061a('0x1e')];var _0x387fa1=_0x6c2127?0x0:_0x3febb0[_0x061a('0x1b')];var _0xa231f9=_0x6c2127?_0x36c0c5[_0x061a('0x1e')]:_0x3febb0[_0x061a('0x1b')]+_0x3febb0[_0x061a('0x1d')];var _0x1c3eaf;if(_0xa231f9>=_0x2dedae){_0xa231f9=_0x2dedae;_0x1c3eaf=0xc8;}else{_0x1c3eaf=0xce;}_0x205fe8[_0x061a('0x18')](_0x1c3eaf);return _0x205fe8[_0x061a('0x1f')](_0x061a('0x20'),_0x387fa1+'-'+_0xa231f9+'/'+_0x2dedae)[_0x061a('0x1a')](_0x36c0c5);}return null;};}function patchUpdates(_0x1c91b8){return function(_0x3181c6){try{jsonpatch['apply'](_0x3181c6,_0x1c91b8,!![]);}catch(_0x3f6489){return BPromise['reject'](_0x3f6489);}return _0x3181c6[_0x061a('0x21')]();};}function saveUpdates(_0xfb555d,_0x2652c4){return function(_0x3a8878){if(_0x3a8878){return _0x3a8878['update'](_0xfb555d)['then'](function(_0x83b1d0){return _0x83b1d0;});}return null;};}function removeEntity(_0x2b4ece,_0x44e651){return function(_0xee93b9){if(_0xee93b9){return _0xee93b9['destroy']()['then'](function(){_0x2b4ece[_0x061a('0x18')](0xcc)[_0x061a('0x19')]();});}};}function handleEntityNotFound(_0x31aa57,_0x1b954f){return function(_0xf4e91c){if(!_0xf4e91c){_0x31aa57[_0x061a('0x17')](0x194);}return _0xf4e91c;};}function handleError(_0x2c3ffb,_0x4f8c1b){_0x4f8c1b=_0x4f8c1b||0x1f4;return function(_0x5bf519){logger[_0x061a('0x22')](_0x5bf519[_0x061a('0x23')]);if(_0x5bf519['name']){delete _0x5bf519[_0x061a('0x24')];}_0x2c3ffb['status'](_0x4f8c1b)[_0x061a('0x25')](_0x5bf519);};}exports[_0x061a('0x26')]=function(_0x3823da,_0x5c2ba3){var _0x572f7a={},_0x249427={},_0x27aad7={'count':0x0,'rows':[]};var _0x2f7443=_[_0x061a('0x27')](db['ServicenowAccount']['rawAttributes'],function(_0x4086b9){return{'name':_0x4086b9[_0x061a('0x28')],'type':_0x4086b9['type'][_0x061a('0x29')]};});_0x249427[_0x061a('0x2a')]=_[_0x061a('0x27')](_0x2f7443,_0x061a('0x24'));_0x249427[_0x061a('0x2b')]=_[_0x061a('0x2c')](_0x3823da[_0x061a('0x2b')]);_0x249427[_0x061a('0x2d')]=_[_0x061a('0x2e')](_0x249427[_0x061a('0x2a')],_0x249427[_0x061a('0x2b')]);_0x572f7a[_0x061a('0x2f')]=_['intersection'](_0x249427[_0x061a('0x2a')],qs[_0x061a('0x30')](_0x3823da[_0x061a('0x2b')][_0x061a('0x30')]));_0x572f7a[_0x061a('0x2f')]=_0x572f7a['attributes'][_0x061a('0x31')]?_0x572f7a[_0x061a('0x2f')]:_0x249427[_0x061a('0x2a')];if(!_0x3823da[_0x061a('0x2b')][_0x061a('0x32')](_0x061a('0x33'))){_0x572f7a[_0x061a('0x1d')]=qs[_0x061a('0x1d')](_0x3823da[_0x061a('0x2b')][_0x061a('0x1d')]);_0x572f7a['offset']=qs['offset'](_0x3823da['query'][_0x061a('0x1b')]);}_0x572f7a[_0x061a('0x34')]=qs[_0x061a('0x35')](_0x3823da['query'][_0x061a('0x35')]);_0x572f7a['where']=qs['filters'](_[_0x061a('0x36')](_0x3823da[_0x061a('0x2b')],_0x249427[_0x061a('0x2d')]),_0x2f7443);if(_0x3823da[_0x061a('0x2b')][_0x061a('0x37')]){_0x572f7a['where']=_[_0x061a('0x38')](_0x572f7a[_0x061a('0x39')],{'$or':_[_0x061a('0x27')](_0x2f7443,function(_0xbb1969){if(_0xbb1969[_0x061a('0x3a')]!=='VIRTUAL'){var _0x21d654={};_0x21d654[_0xbb1969[_0x061a('0x24')]]={'$like':'%'+_0x3823da['query']['filter']+'%'};return _0x21d654;}})});}_0x572f7a=_[_0x061a('0x38')]({},_0x572f7a,_0x3823da[_0x061a('0x3b')]);var _0x58e514={'where':_0x572f7a[_0x061a('0x39')]};return db[_0x061a('0x3c')][_0x061a('0x1e')](_0x58e514)[_0x061a('0x3d')](function(_0x280d3e){_0x27aad7[_0x061a('0x1e')]=_0x280d3e;if(_0x3823da[_0x061a('0x2b')][_0x061a('0x3e')]){_0x572f7a[_0x061a('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x061a('0x40')](_0x572f7a);})['then'](function(_0x5a943e){_0x27aad7[_0x061a('0x41')]=_0x5a943e;return _0x27aad7;})['then'](respondWithFilteredResult(_0x5c2ba3,_0x572f7a))['catch'](handleError(_0x5c2ba3,null));};exports[_0x061a('0x42')]=function(_0x418d87,_0x3b7b71){var _0x2c1eaa={'raw':![],'where':{'id':_0x418d87[_0x061a('0x43')]['id']}},_0xafe9b3={};_0xafe9b3[_0x061a('0x2a')]=_[_0x061a('0x2c')](db['ServicenowAccount'][_0x061a('0x44')]);_0xafe9b3[_0x061a('0x2b')]=_['keys'](_0x418d87[_0x061a('0x2b')]);_0xafe9b3[_0x061a('0x2d')]=_[_0x061a('0x2e')](_0xafe9b3['model'],_0xafe9b3[_0x061a('0x2b')]);_0x2c1eaa[_0x061a('0x2f')]=_[_0x061a('0x2e')](_0xafe9b3[_0x061a('0x2a')],qs[_0x061a('0x30')](_0x418d87[_0x061a('0x2b')][_0x061a('0x30')]));_0x2c1eaa[_0x061a('0x2f')]=_0x2c1eaa[_0x061a('0x2f')]['length']?_0x2c1eaa['attributes']:_0xafe9b3['model'];if(_0x418d87['query'][_0x061a('0x3e')]){_0x2c1eaa[_0x061a('0x3f')]=[{'all':!![]}];}_0x2c1eaa=_[_0x061a('0x38')]({},_0x2c1eaa,_0x418d87[_0x061a('0x3b')]);return db[_0x061a('0x3c')][_0x061a('0x45')](_0x2c1eaa)[_0x061a('0x3d')](handleEntityNotFound(_0x3b7b71,null))[_0x061a('0x3d')](respondWithResult(_0x3b7b71,null))[_0x061a('0x46')](handleError(_0x3b7b71,null));};exports['create']=function(_0x3b0d68,_0x1a37c2){return db['ServicenowAccount'][_0x061a('0x47')](_0x3b0d68[_0x061a('0x48')],{})[_0x061a('0x3d')](respondWithResult(_0x1a37c2,0xc9))[_0x061a('0x46')](handleError(_0x1a37c2,null));};exports[_0x061a('0x49')]=function(_0xcac87d,_0x271bf7){if(_0xcac87d['body']['id']){delete _0xcac87d[_0x061a('0x48')]['id'];}return db[_0x061a('0x3c')][_0x061a('0x45')]({'where':{'id':_0xcac87d[_0x061a('0x43')]['id']}})['then'](handleEntityNotFound(_0x271bf7,null))[_0x061a('0x3d')](saveUpdates(_0xcac87d[_0x061a('0x48')],null))[_0x061a('0x3d')](respondWithResult(_0x271bf7,null))[_0x061a('0x46')](handleError(_0x271bf7,null));};exports[_0x061a('0x4a')]=function(_0x1e23e5,_0x528a3c){return db[_0x061a('0x3c')][_0x061a('0x45')]({'where':{'id':_0x1e23e5[_0x061a('0x43')]['id']}})[_0x061a('0x3d')](handleEntityNotFound(_0x528a3c,null))['then'](removeEntity(_0x528a3c,null))[_0x061a('0x46')](handleError(_0x528a3c,null));};exports[_0x061a('0x4b')]=function(_0x29b2ea,_0x3a31aa,_0x92d201){var _0x1a9659={};var _0x5efde4={};var _0x4535ac;var _0x318733;return db[_0x061a('0x3c')]['findOne']({'where':{'id':_0x29b2ea[_0x061a('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a31aa,null))['then'](function(_0xedb29b){if(_0xedb29b){_0x4535ac=_0xedb29b;_0x5efde4['model']=_[_0x061a('0x2c')](db[_0x061a('0x4c')][_0x061a('0x44')]);_0x5efde4['query']=_['keys'](_0x29b2ea[_0x061a('0x2b')]);_0x5efde4['filters']=_[_0x061a('0x2e')](_0x5efde4[_0x061a('0x2a')],_0x5efde4[_0x061a('0x2b')]);_0x1a9659[_0x061a('0x2f')]=_[_0x061a('0x2e')](_0x5efde4['model'],qs[_0x061a('0x30')](_0x29b2ea[_0x061a('0x2b')][_0x061a('0x30')]));_0x1a9659[_0x061a('0x2f')]=_0x1a9659[_0x061a('0x2f')][_0x061a('0x31')]?_0x1a9659['attributes']:_0x5efde4[_0x061a('0x2a')];_0x1a9659[_0x061a('0x34')]=qs[_0x061a('0x35')](_0x29b2ea[_0x061a('0x2b')]['sort']);_0x1a9659[_0x061a('0x39')]=qs['filters'](_[_0x061a('0x36')](_0x29b2ea[_0x061a('0x2b')],_0x5efde4['filters']));if(_0x29b2ea[_0x061a('0x2b')][_0x061a('0x37')]){_0x1a9659['where']=_[_0x061a('0x38')](_0x1a9659[_0x061a('0x39')],{'$or':_[_0x061a('0x27')](_0x1a9659[_0x061a('0x2f')],function(_0x26e0a4){var _0x1a6b15={};_0x1a6b15[_0x26e0a4]={'$like':'%'+_0x29b2ea[_0x061a('0x2b')][_0x061a('0x37')]+'%'};return _0x1a6b15;})});}_0x1a9659=_[_0x061a('0x38')]({},_0x1a9659,_0x29b2ea['options']);return _0x4535ac['getConfigurations'](_0x1a9659);}})[_0x061a('0x3d')](function(_0x4b0c4d){if(_0x4b0c4d){_0x318733=_0x4b0c4d[_0x061a('0x31')];if(!_0x29b2ea[_0x061a('0x2b')]['hasOwnProperty'](_0x061a('0x33'))){_0x1a9659['limit']=qs[_0x061a('0x1d')](_0x29b2ea[_0x061a('0x2b')]['limit']);_0x1a9659[_0x061a('0x1b')]=qs['offset'](_0x29b2ea[_0x061a('0x2b')]['offset']);}return _0x4535ac['getConfigurations'](_0x1a9659);}})[_0x061a('0x3d')](function(_0x2b9fcf){if(_0x2b9fcf){return _0x2b9fcf?{'count':_0x318733,'rows':_0x2b9fcf}:null;}})[_0x061a('0x3d')](respondWithResult(_0x3a31aa,null))[_0x061a('0x46')](handleError(_0x3a31aa,null));};exports[_0x061a('0x4d')]=function(_0x1060ba,_0x52c9da,_0x4c1da9){if(_0x1060ba['body']['id']){delete _0x1060ba[_0x061a('0x48')]['id'];}return db[_0x061a('0x3c')][_0x061a('0x4e')]({'where':{'id':_0x1060ba[_0x061a('0x43')]['id']}})[_0x061a('0x3d')](handleEntityNotFound(_0x52c9da,null))[_0x061a('0x3d')](function(_0xe9ef1){if(_0xe9ef1){_0x1060ba[_0x061a('0x48')]['AccountId']=_0xe9ef1['id'];_0x1060ba[_0x061a('0x48')]['Subjects']=integrations[_0x061a('0x4f')](_0x1060ba[_0x061a('0x48')][_0x061a('0x50')],_0x1060ba['body'][_0x061a('0x3a')]);_0x1060ba[_0x061a('0x48')][_0x061a('0x51')]=integrations[_0x061a('0x52')](_0x1060ba[_0x061a('0x48')][_0x061a('0x50')],_0x1060ba[_0x061a('0x48')][_0x061a('0x3a')]);return db['ServicenowConfiguration']['create'](_0x1060ba[_0x061a('0x48')],{'include':[{'model':db[_0x061a('0x53')],'as':'Subjects'},{'model':db[_0x061a('0x53')],'as':_0x061a('0x51')}]});}return null;})[_0x061a('0x3d')](respondWithResult(_0x52c9da,null))[_0x061a('0x46')](handleError(_0x52c9da,null));};exports[_0x061a('0x54')]=function(_0xf06353,_0x49f0cc,_0x3372c1){var _0x4348b2=['made_sla',_0x061a('0x55'),'knowledge','subcategory',_0x061a('0x56'),_0x061a('0x57'),_0x061a('0x58'),_0x061a('0x59'),_0x061a('0x5a')];var _0xe7dccc=['parent',_0x061a('0x5b'),_0x061a('0x5c'),_0x061a('0x5d'),_0x061a('0x5e'),_0x061a('0x5f'),_0x061a('0x60'),'hold_reason',_0x061a('0x61'),_0x061a('0x62'),_0x061a('0x63'),_0x061a('0x64'),_0x061a('0x65'),_0x061a('0x66'),'sys_created_on',_0x061a('0x67'),'state',_0x061a('0x68'),_0x061a('0x69'),'order','calendar_stc',_0x061a('0x6a'),_0x061a('0x6b'),'delivery_plan',_0x061a('0x6c'),'active',_0x061a('0x6d'),_0x061a('0x6e'),_0x061a('0x6f'),_0x061a('0x70'),_0x061a('0x71'),'time_worked',_0x061a('0x72'),_0x061a('0x73'),_0x061a('0x74'),'group_list','work_end',_0x061a('0x75'),_0x061a('0x76'),_0x061a('0x77'),'approval_set','subcategory',_0x061a('0x78'),'short_description',_0x061a('0x56'),_0x061a('0x79'),_0x061a('0x7a'),_0x061a('0x7b'),'assignment_group',_0x061a('0x7c'),_0x061a('0x7d'),_0x061a('0x7e'),_0x061a('0x7f'),'notify',_0x061a('0x80'),_0x061a('0x81'),'closed_by',_0x061a('0x82'),_0x061a('0x83'),_0x061a('0x84'),_0x061a('0x85'),'reopened_by','incident_state',_0x061a('0x86'),_0x061a('0x87'),_0x061a('0x88'),_0x061a('0x89'),_0x061a('0x8a'),_0x061a('0x8b'),_0x061a('0x59'),'comments','sla_due',_0x061a('0x8c'),'comments_and_work_notes',_0x061a('0x8d'),_0x061a('0x8e'),_0x061a('0x8f'),_0x061a('0x90'),'escalation','upon_approval',_0x061a('0x91'),_0x061a('0x92'),_0x061a('0x5a')];var _0x5ba3a0='';var _0x75b5fc='';var _0xcc3d9b=[];var _0x4a89a1='';var _0x5c3be4='';var _0x46f43c=[];var _0x548867='';var _0x86404='';var _0xe98018={};var _0xb73023='';return db[_0x061a('0x3c')]['findOne']({'where':{'id':_0xf06353[_0x061a('0x43')]['id']},'attributes':['id',_0x061a('0x93'),_0x061a('0x94'),_0x061a('0x95'),_0x061a('0x96'),'serverUrl']})[_0x061a('0x3d')](handleEntityNotFound(_0x49f0cc,null))[_0x061a('0x3d')](function(_0x4f6a88){if(_0x4f6a88){_0xb73023=_0x4f6a88[_0x061a('0x96')];var _0xf46e5c=_0xb73023['slice'](-0x1);if(_0xf46e5c==='/'){_0xb73023=_0xb73023[_0x061a('0x97')](0x0,_0xb73023['lastIndexOf'](_0xf46e5c));}_0x86404=util[_0x061a('0x98')](_0x061a('0x99'),_0xb73023);_0x548867=util[_0x061a('0x98')](_0x061a('0x9a'),_0xb73023);_0xe98018={'user':_0x4f6a88[_0x061a('0x93')],'pass':_0x4f6a88[_0x061a('0x94')]};var _0x2f3ac1={'method':'GET','uri':_0x86404+'incident?sysparm_display_value=all','auth':_0xe98018,'json':!![]};return rp(_0x2f3ac1);}})[_0x061a('0x3d')](function(_0x558f91){if(_0x558f91[_0x061a('0x9b')][_0x061a('0x31')]>0x0){_0x5ba3a0=_0x558f91['result'];}console[_0x061a('0x9c')]('incident\x20table\x20objects',_0x5ba3a0);_0x46f43c=[];_0x75b5fc=Object['assign']([],_0x5ba3a0);_['remove'](_0x75b5fc,function(_0x5bcf5b){return!_0x4348b2[_0x061a('0x9d')](_0x5bcf5b['name']);});_0x75b5fc[_0x061a('0x9e')](function(_0x269a29){var _0xc21d58=createFieldObject(_0x548867,_0xe98018,_0x269a29[_0x061a('0x9f')],_0x269a29[_0x061a('0x24')],_0x269a29[_0x061a('0xa0')],![]);_0x46f43c[_0x061a('0xa1')](_0xc21d58);});return Promise[_0x061a('0xa2')](_0x46f43c);})[_0x061a('0x3d')](function(_0xabd3bb){_0xcc3d9b=_0xabd3bb;_0x4a89a1=Object['assign']([],_0x5ba3a0);console['log'](_0x061a('0xa3'),_0x5ba3a0);_[_0x061a('0xa4')](_0x4a89a1,function(_0x1b2639){return _0xe7dccc[_0x061a('0x9d')](_0x1b2639[_0x061a('0x24')]);});console[_0x061a('0x9c')](_0x061a('0xa5'),_0x4a89a1);_0x46f43c=[];_0x4a89a1['forEach'](function(_0x265710){var _0x426479=createFieldObject(_0x548867,_0xe98018,_0x265710[_0x061a('0x9f')],_0x265710[_0x061a('0x24')],_0x265710[_0x061a('0xa0')],!![]);_0x46f43c['push'](_0x426479);});return Promise[_0x061a('0xa2')](_0x46f43c);})[_0x061a('0x3d')](function(_0x3c4556){_0x5c3be4=_0x3c4556;var _0x58e378=_0xcc3d9b[_0x061a('0xa6')](_0x5c3be4);return{'count':_0x58e378[_0x061a('0x31')],'rows':_0x58e378};})[_0x061a('0x3d')](respondWithResult(_0x49f0cc,null))[_0x061a('0x46')](function(_0x12e265){console[_0x061a('0x9c')]('ServiceNow\x20error:\x20'+_0x12e265);var _0x2c2fa9=_0xf06353[_0x061a('0x2b')][_0x061a('0xa7')]?0x1f4:_0x12e265[_0x061a('0xa8')]||0x1f4;logger[_0x061a('0x22')](_0x12e265[_0x061a('0x23')]);delete _0x12e265[_0x061a('0x24')];if(_0x2c2fa9===0x191){_0x2c2fa9=0x190;}_0x49f0cc[_0x061a('0x18')](_0x2c2fa9)[_0x061a('0x25')](_0xf06353[_0x061a('0x2b')][_0x061a('0xa7')]?{'message':_0x061a('0xa9'),'statusCode':_0x12e265[_0x061a('0xa8')]}:_0x12e265);});};function createFieldObject(_0x3d5cf0,_0x5caf2b,_0x2c2c94,_0x1e5660,_0xd84ec0,_0x5a4f30){return new Promise(function(_0x21215a,_0x44bf35){var _0x241252={'id':_0x1e5660,'name':_0xd84ec0,'custom':_0x5a4f30};if(_0x2c2c94===_0x061a('0xaa')){_0x241252['options']=[{'name':'True','value':_0x061a('0xab')},{'name':_0x061a('0xac'),'value':_0x061a('0xad')}];_0x21215a(_0x241252);}else{var _0x3c06bd={'method':_0x061a('0xae'),'uri':_0x3d5cf0+_0x061a('0xaf')+_0x1e5660,'auth':_0x5caf2b,'json':!![]};return rp(_0x3c06bd)[_0x061a('0x3d')](function(_0x2e37f6){var _0x1e3231=[];if(_0x2e37f6[_0x061a('0x9b')][_0x061a('0x31')]>0x0){_0x2e37f6[_0x061a('0x9b')]['forEach'](function(_0x2ad7e5){if(_0x2ad7e5['inactive']===_0x061a('0xad')){var _0x3205f8={'name':_0x2ad7e5[_0x061a('0xa0')],'value':_0x2ad7e5[_0x061a('0xb0')]};_0x1e3231[_0x061a('0xa1')](_0x3205f8);}});}_0x241252[_0x061a('0x3b')]=_0x1e3231;if(_0x241252['options'][_0x061a('0x31')]>0x0){_0x21215a(_0x241252);}else{if(_0x5a4f30==![]){_0x21215a();}else{_0x21215a(_0x241252);}}});}});}
\ No newline at end of file
index e2cf571..1b5aba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x326f,0xd1));var _0xf326=function(_0x3b76d5,_0xd7917a){_0x3b76d5=_0x3b76d5-0x0;var _0x540a3b=_0x326f[_0x3b76d5];return _0x540a3b;};'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
+var _0xa630=['moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x19b4f6,_0x1e28e4){var _0x5ac725=function(_0x37fb1f){while(--_0x37fb1f){_0x19b4f6['push'](_0x19b4f6['shift']());}};_0x5ac725(++_0x1e28e4);}(_0xa630,0xbe));var _0x0a63=function(_0x3d84d5,_0x200bba){_0x3d84d5=_0x3d84d5-0x0;var _0x13b15b=_0xa630[_0x3d84d5];return _0x13b15b;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));var integrations=require(_0x0a63('0x7'));module[_0x0a63('0x8')]=function(_0x4b7474,_0x2760b0){return _0x4b7474[_0x0a63('0x9')](_0x0a63('0xa'),attributes,{'tableName':_0x0a63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index badb416..2cecf6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc807=['ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetServicenowAccount','ShowServicenowAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x4455bc,_0x25c254){var _0x721c22=function(_0x29e62e){while(--_0x29e62e){_0x4455bc['push'](_0x4455bc['shift']());}};_0x721c22(++_0x25c254);}(_0xc807,0x10a));var _0x7c80=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xc807[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c80('0x0'));var BPromise=require(_0x7c80('0x1'));var rs=require(_0x7c80('0x2'));var fs=require('fs');var Redis=require(_0x7c80('0x3'));var db=require(_0x7c80('0x4'))['db'];var utils=require(_0x7c80('0x5'));var logger=require('../../config/logger')(_0x7c80('0x6'));var config=require(_0x7c80('0x7'));var jayson=require(_0x7c80('0x8'));var client=jayson[_0x7c80('0x9')][_0x7c80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b6757,_0x1ddd8c,_0x1dabcc){return new BPromise(function(_0x364975,_0x517ae7){return client[_0x7c80('0xb')](_0x1b6757,_0x1dabcc)['then'](function(_0x805520){logger[_0x7c80('0xc')](_0x7c80('0xd'),_0x1ddd8c,_0x7c80('0xe'));logger[_0x7c80('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1ddd8c,_0x7c80('0xe'),JSON[_0x7c80('0x10')](_0x805520));if(_0x805520[_0x7c80('0x11')]){if(_0x805520[_0x7c80('0x11')][_0x7c80('0x12')]===0x1f4){logger[_0x7c80('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1ddd8c,_0x805520['error'][_0x7c80('0x13')]);return _0x517ae7(_0x805520[_0x7c80('0x11')][_0x7c80('0x13')]);}logger[_0x7c80('0x11')](_0x7c80('0xd'),_0x1ddd8c,_0x805520[_0x7c80('0x11')][_0x7c80('0x13')]);return _0x364975(_0x805520['error'][_0x7c80('0x13')]);}else{logger[_0x7c80('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x1ddd8c,'request\x20sent');_0x364975(_0x805520[_0x7c80('0x14')][_0x7c80('0x13')]);}})[_0x7c80('0x15')](function(_0x55b329){logger[_0x7c80('0x11')](_0x7c80('0xd'),_0x1ddd8c,_0x55b329);_0x517ae7(_0x55b329);});});}exports['GetServicenowAccount']=function(_0xf2c128){var _0x27b98e=this;return new Promise(function(_0x5ba1bc,_0x3ae912){return db[_0x7c80('0x16')][_0x7c80('0x17')]({'raw':_0xf2c128[_0x7c80('0x18')]?_0xf2c128['options'][_0x7c80('0x19')]===undefined?!![]:![]:!![],'where':_0xf2c128['options']?_0xf2c128['options'][_0x7c80('0x1a')]||null:null,'attributes':_0xf2c128[_0x7c80('0x18')]?_0xf2c128[_0x7c80('0x18')][_0x7c80('0x1b')]||null:null,'limit':_0xf2c128[_0x7c80('0x18')]?_0xf2c128[_0x7c80('0x18')][_0x7c80('0x1c')]||null:null,'include':_0xf2c128[_0x7c80('0x18')]?_0xf2c128[_0x7c80('0x18')][_0x7c80('0x1d')]?_[_0x7c80('0x1e')](_0xf2c128['options'][_0x7c80('0x1d')],function(_0x2e573c){return{'model':db[_0x2e573c['model']],'as':_0x2e573c['as'],'attributes':_0x2e573c[_0x7c80('0x1b')],'include':_0x2e573c[_0x7c80('0x1d')]?_['map'](_0x2e573c['include'],function(_0x5c4c87){return{'model':db[_0x5c4c87[_0x7c80('0x1f')]],'as':_0x5c4c87['as'],'attributes':_0x5c4c87[_0x7c80('0x1b')],'include':_0x5c4c87[_0x7c80('0x1d')]?_[_0x7c80('0x1e')](_0x5c4c87[_0x7c80('0x1d')],function(_0x40d1a2){return{'model':db[_0x40d1a2[_0x7c80('0x1f')]],'as':_0x40d1a2['as'],'attributes':_0x40d1a2[_0x7c80('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7c80('0x20')](function(_0x484abd){logger[_0x7c80('0xc')]('GetServicenowAccount',_0xf2c128);logger[_0x7c80('0xf')]('GetServicenowAccount',_0xf2c128,JSON['stringify'](_0x484abd));_0x5ba1bc(_0x484abd);})[_0x7c80('0x15')](function(_0x22cc6a){logger['error'](_0x7c80('0x21'),_0x22cc6a[_0x7c80('0x13')],_0xf2c128);_0x3ae912(_0x27b98e[_0x7c80('0x11')](0x1f4,_0x22cc6a[_0x7c80('0x13')]));});});};exports[_0x7c80('0x22')]=function(_0x1eaa9d){var _0x4e9955=this;return new Promise(function(_0x5ca107,_0x5b2370){return db[_0x7c80('0x16')][_0x7c80('0x23')]({'raw':_0x1eaa9d['options']?_0x1eaa9d[_0x7c80('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1eaa9d[_0x7c80('0x18')]?_0x1eaa9d['options'][_0x7c80('0x1a')]||null:null,'attributes':_0x1eaa9d[_0x7c80('0x18')]?_0x1eaa9d['options'][_0x7c80('0x1b')]||null:null,'include':_0x1eaa9d['options']?_0x1eaa9d[_0x7c80('0x18')]['include']?_[_0x7c80('0x1e')](_0x1eaa9d['options'][_0x7c80('0x1d')],function(_0x6057f3){return{'model':db[_0x6057f3[_0x7c80('0x1f')]],'as':_0x6057f3['as'],'attributes':_0x6057f3[_0x7c80('0x1b')],'include':_0x6057f3['include']?_['map'](_0x6057f3[_0x7c80('0x1d')],function(_0x400ff9){return{'model':db[_0x400ff9[_0x7c80('0x1f')]],'as':_0x400ff9['as'],'attributes':_0x400ff9['attributes'],'include':_0x400ff9[_0x7c80('0x1d')]?_['map'](_0x400ff9[_0x7c80('0x1d')],function(_0xce7ae0){return{'model':db[_0xce7ae0['model']],'as':_0xce7ae0['as'],'attributes':_0xce7ae0[_0x7c80('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7c80('0x20')](function(_0x43dbb1){logger['info'](_0x7c80('0x22'),_0x1eaa9d);logger[_0x7c80('0xf')]('ShowServicenowAccount',_0x1eaa9d,JSON[_0x7c80('0x10')](_0x43dbb1));_0x5ca107(_0x43dbb1);})[_0x7c80('0x15')](function(_0x20c2e8){logger[_0x7c80('0x11')]('ShowServicenowAccount',_0x20c2e8[_0x7c80('0x13')],_0x1eaa9d);_0x5b2370(_0x4e9955[_0x7c80('0x11')](0x1f4,_0x20c2e8[_0x7c80('0x13')]));});});};
\ No newline at end of file
+var _0x3ca6=['where','attributes','limit','include','map','model','ShowServicenowAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','ServicenowAccount','options'];(function(_0x5c91ee,_0x40540f){var _0x20a7c6=function(_0x3ab1e9){while(--_0x3ab1e9){_0x5c91ee['push'](_0x5c91ee['shift']());}};_0x20a7c6(++_0x40540f);}(_0x3ca6,0xe1));var _0x63ca=function(_0x33c9d4,_0x4ac01f){_0x33c9d4=_0x33c9d4-0x0;var _0x55cfee=_0x3ca6[_0x33c9d4];return _0x55cfee;};'use strict';var _=require('lodash');var util=require(_0x63ca('0x0'));var moment=require(_0x63ca('0x1'));var BPromise=require(_0x63ca('0x2'));var rs=require(_0x63ca('0x3'));var fs=require('fs');var Redis=require(_0x63ca('0x4'));var db=require(_0x63ca('0x5'))['db'];var utils=require(_0x63ca('0x6'));var logger=require(_0x63ca('0x7'))(_0x63ca('0x8'));var config=require(_0x63ca('0x9'));var jayson=require(_0x63ca('0xa'));var client=jayson['client'][_0x63ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e847f,_0x3a6f83,_0x1143be){return new BPromise(function(_0x56a41c,_0x38e6c9){return client[_0x63ca('0xc')](_0x2e847f,_0x1143be)[_0x63ca('0xd')](function(_0x5d76cc){logger[_0x63ca('0xe')](_0x63ca('0xf'),_0x3a6f83,_0x63ca('0x10'));logger[_0x63ca('0x11')](_0x63ca('0x12'),_0x3a6f83,_0x63ca('0x10'),JSON[_0x63ca('0x13')](_0x5d76cc));if(_0x5d76cc['error']){if(_0x5d76cc[_0x63ca('0x14')]['code']===0x1f4){logger[_0x63ca('0x14')](_0x63ca('0xf'),_0x3a6f83,_0x5d76cc[_0x63ca('0x14')][_0x63ca('0x15')]);return _0x38e6c9(_0x5d76cc[_0x63ca('0x14')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x3a6f83,_0x5d76cc[_0x63ca('0x14')][_0x63ca('0x15')]);return _0x56a41c(_0x5d76cc[_0x63ca('0x14')][_0x63ca('0x15')]);}else{logger[_0x63ca('0xe')](_0x63ca('0xf'),_0x3a6f83,_0x63ca('0x10'));_0x56a41c(_0x5d76cc[_0x63ca('0x16')][_0x63ca('0x15')]);}})[_0x63ca('0x17')](function(_0x4e6325){logger[_0x63ca('0x14')](_0x63ca('0xf'),_0x3a6f83,_0x4e6325);_0x38e6c9(_0x4e6325);});});}exports[_0x63ca('0x18')]=function(_0x2d5abb){var _0x2099eb=this;return new Promise(function(_0x73f42b,_0x85077b){return db[_0x63ca('0x19')]['findAll']({'raw':_0x2d5abb['options']?_0x2d5abb[_0x63ca('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2d5abb[_0x63ca('0x1a')]?_0x2d5abb[_0x63ca('0x1a')][_0x63ca('0x1b')]||null:null,'attributes':_0x2d5abb['options']?_0x2d5abb[_0x63ca('0x1a')][_0x63ca('0x1c')]||null:null,'limit':_0x2d5abb[_0x63ca('0x1a')]?_0x2d5abb[_0x63ca('0x1a')][_0x63ca('0x1d')]||null:null,'include':_0x2d5abb[_0x63ca('0x1a')]?_0x2d5abb[_0x63ca('0x1a')][_0x63ca('0x1e')]?_[_0x63ca('0x1f')](_0x2d5abb[_0x63ca('0x1a')]['include'],function(_0x2762e9){return{'model':db[_0x2762e9['model']],'as':_0x2762e9['as'],'attributes':_0x2762e9['attributes'],'include':_0x2762e9['include']?_[_0x63ca('0x1f')](_0x2762e9[_0x63ca('0x1e')],function(_0x1908dd){return{'model':db[_0x1908dd[_0x63ca('0x20')]],'as':_0x1908dd['as'],'attributes':_0x1908dd[_0x63ca('0x1c')],'include':_0x1908dd[_0x63ca('0x1e')]?_[_0x63ca('0x1f')](_0x1908dd[_0x63ca('0x1e')],function(_0x54ced4){return{'model':db[_0x54ced4[_0x63ca('0x20')]],'as':_0x54ced4['as'],'attributes':_0x54ced4[_0x63ca('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x63ca('0xd')](function(_0x1867cb){logger['info'](_0x63ca('0x18'),_0x2d5abb);logger['debug']('GetServicenowAccount',_0x2d5abb,JSON[_0x63ca('0x13')](_0x1867cb));_0x73f42b(_0x1867cb);})[_0x63ca('0x17')](function(_0x115b0c){logger[_0x63ca('0x14')](_0x63ca('0x18'),_0x115b0c[_0x63ca('0x15')],_0x2d5abb);_0x85077b(_0x2099eb[_0x63ca('0x14')](0x1f4,_0x115b0c[_0x63ca('0x15')]));});});};exports[_0x63ca('0x21')]=function(_0x1b483e){var _0x115398=this;return new Promise(function(_0x389b1f,_0x5d8bdf){return db[_0x63ca('0x19')][_0x63ca('0x22')]({'raw':_0x1b483e['options']?_0x1b483e[_0x63ca('0x1a')][_0x63ca('0x23')]===undefined?!![]:![]:!![],'where':_0x1b483e[_0x63ca('0x1a')]?_0x1b483e[_0x63ca('0x1a')]['where']||null:null,'attributes':_0x1b483e[_0x63ca('0x1a')]?_0x1b483e[_0x63ca('0x1a')]['attributes']||null:null,'include':_0x1b483e[_0x63ca('0x1a')]?_0x1b483e[_0x63ca('0x1a')][_0x63ca('0x1e')]?_[_0x63ca('0x1f')](_0x1b483e['options'][_0x63ca('0x1e')],function(_0x5e7746){return{'model':db[_0x5e7746['model']],'as':_0x5e7746['as'],'attributes':_0x5e7746[_0x63ca('0x1c')],'include':_0x5e7746[_0x63ca('0x1e')]?_[_0x63ca('0x1f')](_0x5e7746['include'],function(_0x55a958){return{'model':db[_0x55a958[_0x63ca('0x20')]],'as':_0x55a958['as'],'attributes':_0x55a958[_0x63ca('0x1c')],'include':_0x55a958['include']?_[_0x63ca('0x1f')](_0x55a958[_0x63ca('0x1e')],function(_0xd4cfe0){return{'model':db[_0xd4cfe0[_0x63ca('0x20')]],'as':_0xd4cfe0['as'],'attributes':_0xd4cfe0[_0x63ca('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x63ca('0xd')](function(_0x3c40d1){logger['info'](_0x63ca('0x21'),_0x1b483e);logger['debug'](_0x63ca('0x21'),_0x1b483e,JSON['stringify'](_0x3c40d1));_0x389b1f(_0x3c40d1);})[_0x63ca('0x17')](function(_0x5f1566){logger['error']('ShowServicenowAccount',_0x5f1566[_0x63ca('0x15')],_0x1b483e);_0x5d8bdf(_0x115398[_0x63ca('0x14')](0x1f4,_0x5f1566[_0x63ca('0x15')]));});});};
\ No newline at end of file
index 629b9bf..d75fa70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa809=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show'];(function(_0x146eed,_0x547c97){var _0x17cdc4=function(_0xeac53){while(--_0xeac53){_0x146eed['push'](_0x146eed['shift']());}};_0x17cdc4(++_0x547c97);}(_0xa809,0x1c5));var _0x9a80=function(_0x5295a3,_0x132b12){_0x5295a3=_0x5295a3-0x0;var _0x282fb3=_0xa809[_0x5295a3];return _0x282fb3;};'use strict';var multer=require(_0x9a80('0x0'));var util=require(_0x9a80('0x1'));var path=require(_0x9a80('0x2'));var timeout=require(_0x9a80('0x3'));var express=require(_0x9a80('0x4'));var router=express[_0x9a80('0x5')]();var fs_extra=require(_0x9a80('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9a80('0x7'));var config=require(_0x9a80('0x8'));var controller=require(_0x9a80('0x9'));router['get']('/',auth[_0x9a80('0xa')](),controller[_0x9a80('0xb')]);router[_0x9a80('0xc')](_0x9a80('0xd'),auth[_0x9a80('0xa')](),controller[_0x9a80('0xe')]);router[_0x9a80('0xc')](_0x9a80('0xf'),auth[_0x9a80('0xa')](),controller[_0x9a80('0x10')]);router[_0x9a80('0xc')](_0x9a80('0x11'),auth[_0x9a80('0xa')](),controller[_0x9a80('0x12')]);router[_0x9a80('0xc')](_0x9a80('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9a80('0x14')]('/',auth['isAuthenticated'](),controller[_0x9a80('0x15')]);router[_0x9a80('0x16')](_0x9a80('0xd'),auth[_0x9a80('0xa')](),controller[_0x9a80('0x17')]);router[_0x9a80('0x18')](_0x9a80('0xd'),auth[_0x9a80('0xa')](),controller['destroy']);module[_0x9a80('0x19')]=router;
\ No newline at end of file
+var _0xd04f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x1da2ea,_0x4359ee){var _0x5f4fee=function(_0x38c4e6){while(--_0x38c4e6){_0x1da2ea['push'](_0x1da2ea['shift']());}};_0x5f4fee(++_0x4359ee);}(_0xd04f,0xb8));var _0xfd04=function(_0x54da0a,_0x14ace4){_0x54da0a=_0x54da0a-0x0;var _0x334934=_0xd04f[_0x54da0a];return _0x334934;};'use strict';var multer=require(_0xfd04('0x0'));var util=require(_0xfd04('0x1'));var path=require(_0xfd04('0x2'));var timeout=require(_0xfd04('0x3'));var express=require('express');var router=express[_0xfd04('0x4')]();var fs_extra=require(_0xfd04('0x5'));var auth=require(_0xfd04('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xfd04('0x7')]('/',auth[_0xfd04('0x8')](),controller[_0xfd04('0x9')]);router[_0xfd04('0x7')](_0xfd04('0xa'),auth[_0xfd04('0x8')](),controller[_0xfd04('0xb')]);router[_0xfd04('0x7')](_0xfd04('0xc'),auth[_0xfd04('0x8')](),controller[_0xfd04('0xd')]);router[_0xfd04('0x7')](_0xfd04('0xe'),auth[_0xfd04('0x8')](),controller[_0xfd04('0xf')]);router['get']('/:id/descriptions',auth[_0xfd04('0x8')](),controller[_0xfd04('0x10')]);router[_0xfd04('0x11')]('/',auth[_0xfd04('0x8')](),controller[_0xfd04('0x12')]);router[_0xfd04('0x13')]('/:id',auth[_0xfd04('0x8')](),controller[_0xfd04('0x14')]);router[_0xfd04('0x15')](_0xfd04('0xa'),auth[_0xfd04('0x8')](),controller[_0xfd04('0x16')]);module['exports']=router;
\ No newline at end of file
index 820af61..b521e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x983a=['STRING','exports'];(function(_0x248ce8,_0x5b33fb){var _0x46552b=function(_0x5d9a6f){while(--_0x5d9a6f){_0x248ce8['push'](_0x248ce8['shift']());}};_0x46552b(++_0x5b33fb);}(_0x983a,0xb7));var _0xa983=function(_0x1703c1,_0x4ae857){_0x1703c1=_0x1703c1-0x0;var _0x42a796=_0x983a[_0x1703c1];return _0x42a796;};'use strict';var Sequelize=require('sequelize');module[_0xa983('0x0')]={'name':{'type':Sequelize[_0xa983('0x1')]},'description':{'type':Sequelize[_0xa983('0x1')]}};
\ No newline at end of file
+var _0x93a3=['exports','STRING'];(function(_0x3d5045,_0x509fe2){var _0x3c62e8=function(_0x4aaaaa){while(--_0x4aaaaa){_0x3d5045['push'](_0x3d5045['shift']());}};_0x3c62e8(++_0x509fe2);}(_0x93a3,0x166));var _0x393a=function(_0x2b32c8,_0x16aed3){_0x2b32c8=_0x2b32c8-0x0;var _0x5223cb=_0x93a3[_0x2b32c8];return _0x5223cb;};'use strict';var Sequelize=require('sequelize');module[_0x393a('0x0')]={'name':{'type':Sequelize[_0x393a('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index edf8a1c..f18bffe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6140=['VIRTUAL','filter','options','ServicenowConfiguration','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','getFields','findOne','getSubjects','getDescriptions','ServicenowField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge'];(function(_0x202deb,_0xd8b1b0){var _0x575447=function(_0x4c8f1c){while(--_0x4c8f1c){_0x202deb['push'](_0x202deb['shift']());}};_0x575447(++_0xd8b1b0);}(_0x6140,0xae));var _0x0614=function(_0x24dbad,_0x38302c){_0x24dbad=_0x24dbad-0x0;var _0x8624ac=_0x6140[_0x24dbad];return _0x8624ac;};'use strict';var emlformat=require(_0x0614('0x0'));var rimraf=require(_0x0614('0x1'));var zipdir=require(_0x0614('0x2'));var jsonpatch=require(_0x0614('0x3'));var rp=require(_0x0614('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0614('0x5'));var path=require('path');var sox=require(_0x0614('0x6'));var csv=require('to-csv');var ejs=require(_0x0614('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0614('0x8'));var squel=require(_0x0614('0x9'));var crypto=require(_0x0614('0xa'));var jsforce=require(_0x0614('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0614('0xc'));var querystring=require(_0x0614('0xd'));var Papa=require(_0x0614('0xe'));var Redis=require(_0x0614('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0614('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0614('0x11'));var config=require(_0x0614('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0614('0x13'))['db'];function respondWithStatusCode(_0x178d80,_0x3e4a83){_0x3e4a83=_0x3e4a83||0xcc;return function(_0x17af74){if(_0x17af74){return _0x178d80[_0x0614('0x14')](_0x3e4a83);}return _0x178d80['status'](_0x3e4a83)[_0x0614('0x15')]();};}function respondWithResult(_0x32c663,_0x15cb2f){_0x15cb2f=_0x15cb2f||0xc8;return function(_0x14c88d){if(_0x14c88d){return _0x32c663[_0x0614('0x16')](_0x15cb2f)['json'](_0x14c88d);}};}function respondWithFilteredResult(_0x4a529,_0xa890bb){return function(_0x11ebcb){if(_0x11ebcb){var _0x466a70=typeof _0xa890bb[_0x0614('0x17')]===_0x0614('0x18')&&typeof _0xa890bb['limit']===_0x0614('0x18');var _0x2ca7eb=_0x11ebcb['count'];var _0x36d381=_0x466a70?0x0:_0xa890bb['offset'];var _0x18ffee=_0x466a70?_0x11ebcb[_0x0614('0x19')]:_0xa890bb['offset']+_0xa890bb[_0x0614('0x1a')];var _0x37fe6a;if(_0x18ffee>=_0x2ca7eb){_0x18ffee=_0x2ca7eb;_0x37fe6a=0xc8;}else{_0x37fe6a=0xce;}_0x4a529[_0x0614('0x16')](_0x37fe6a);return _0x4a529[_0x0614('0x1b')](_0x0614('0x1c'),_0x36d381+'-'+_0x18ffee+'/'+_0x2ca7eb)[_0x0614('0x1d')](_0x11ebcb);}return null;};}function patchUpdates(_0x11563d){return function(_0x52f1bb){try{jsonpatch[_0x0614('0x1e')](_0x52f1bb,_0x11563d,!![]);}catch(_0x424fba){return BPromise[_0x0614('0x1f')](_0x424fba);}return _0x52f1bb[_0x0614('0x20')]();};}function saveUpdates(_0x82e4c4,_0x20c417){return function(_0x217442){if(_0x217442){return _0x217442[_0x0614('0x21')](_0x82e4c4)[_0x0614('0x22')](function(_0x3bc7f2){return _0x3bc7f2;});}return null;};}function removeEntity(_0x3325ee,_0x145209){return function(_0x1f97c2){if(_0x1f97c2){return _0x1f97c2[_0x0614('0x23')]()['then'](function(){_0x3325ee[_0x0614('0x16')](0xcc)[_0x0614('0x15')]();});}};}function handleEntityNotFound(_0x238cd3,_0x5326bc){return function(_0xd360d0){if(!_0xd360d0){_0x238cd3[_0x0614('0x14')](0x194);}return _0xd360d0;};}function handleError(_0x2ef776,_0x53d366){_0x53d366=_0x53d366||0x1f4;return function(_0x46789a){logger[_0x0614('0x24')](_0x46789a[_0x0614('0x25')]);if(_0x46789a['name']){delete _0x46789a[_0x0614('0x26')];}_0x2ef776[_0x0614('0x16')](_0x53d366)['send'](_0x46789a);};}exports[_0x0614('0x27')]=function(_0x3ba0a3,_0x40f3ff){var _0x1466a4={},_0x329b7c={},_0x30a421={'count':0x0,'rows':[]};var _0x504ce1=_[_0x0614('0x28')](db['ServicenowConfiguration'][_0x0614('0x29')],function(_0x5b42ec){return{'name':_0x5b42ec[_0x0614('0x2a')],'type':_0x5b42ec['type'][_0x0614('0x2b')]};});_0x329b7c['model']=_['map'](_0x504ce1,'name');_0x329b7c[_0x0614('0x2c')]=_['keys'](_0x3ba0a3['query']);_0x329b7c['filters']=_[_0x0614('0x2d')](_0x329b7c[_0x0614('0x2e')],_0x329b7c['query']);_0x1466a4[_0x0614('0x2f')]=_[_0x0614('0x2d')](_0x329b7c['model'],qs[_0x0614('0x30')](_0x3ba0a3[_0x0614('0x2c')]['fields']));_0x1466a4[_0x0614('0x2f')]=_0x1466a4[_0x0614('0x2f')]['length']?_0x1466a4['attributes']:_0x329b7c[_0x0614('0x2e')];if(!_0x3ba0a3[_0x0614('0x2c')][_0x0614('0x31')](_0x0614('0x32'))){_0x1466a4[_0x0614('0x1a')]=qs['limit'](_0x3ba0a3[_0x0614('0x2c')][_0x0614('0x1a')]);_0x1466a4[_0x0614('0x17')]=qs[_0x0614('0x17')](_0x3ba0a3[_0x0614('0x2c')][_0x0614('0x17')]);}_0x1466a4[_0x0614('0x33')]=qs[_0x0614('0x34')](_0x3ba0a3[_0x0614('0x2c')][_0x0614('0x34')]);_0x1466a4[_0x0614('0x35')]=qs[_0x0614('0x36')](_[_0x0614('0x37')](_0x3ba0a3[_0x0614('0x2c')],_0x329b7c[_0x0614('0x36')]),_0x504ce1);if(_0x3ba0a3[_0x0614('0x2c')]['filter']){_0x1466a4['where']=_[_0x0614('0x38')](_0x1466a4[_0x0614('0x35')],{'$or':_[_0x0614('0x28')](_0x504ce1,function(_0x4ba07f){if(_0x4ba07f['type']!==_0x0614('0x39')){var _0x28ed78={};_0x28ed78[_0x4ba07f['name']]={'$like':'%'+_0x3ba0a3['query'][_0x0614('0x3a')]+'%'};return _0x28ed78;}})});}_0x1466a4=_['merge']({},_0x1466a4,_0x3ba0a3[_0x0614('0x3b')]);var _0x5c9382={'where':_0x1466a4[_0x0614('0x35')]};return db[_0x0614('0x3c')][_0x0614('0x19')](_0x5c9382)[_0x0614('0x22')](function(_0x9a9178){_0x30a421['count']=_0x9a9178;if(_0x3ba0a3['query'][_0x0614('0x3d')]){_0x1466a4[_0x0614('0x3e')]=[{'all':!![]}];}return db[_0x0614('0x3c')][_0x0614('0x3f')](_0x1466a4);})[_0x0614('0x22')](function(_0x3b2207){_0x30a421['rows']=_0x3b2207;return _0x30a421;})['then'](respondWithFilteredResult(_0x40f3ff,_0x1466a4))[_0x0614('0x40')](handleError(_0x40f3ff,null));};exports[_0x0614('0x41')]=function(_0x320060,_0x5e15ad){var _0x4ffc3b={'raw':![],'where':{'id':_0x320060[_0x0614('0x42')]['id']}},_0x522b63={};_0x522b63[_0x0614('0x2e')]=_[_0x0614('0x43')](db[_0x0614('0x3c')][_0x0614('0x29')]);_0x522b63[_0x0614('0x2c')]=_[_0x0614('0x43')](_0x320060[_0x0614('0x2c')]);_0x522b63[_0x0614('0x36')]=_['intersection'](_0x522b63[_0x0614('0x2e')],_0x522b63[_0x0614('0x2c')]);_0x4ffc3b[_0x0614('0x2f')]=_['intersection'](_0x522b63['model'],qs['fields'](_0x320060['query'][_0x0614('0x30')]));_0x4ffc3b['attributes']=_0x4ffc3b[_0x0614('0x2f')][_0x0614('0x44')]?_0x4ffc3b[_0x0614('0x2f')]:_0x522b63[_0x0614('0x2e')];if(_0x320060['query'][_0x0614('0x3d')]){_0x4ffc3b[_0x0614('0x3e')]=[{'all':!![]}];}_0x4ffc3b=_[_0x0614('0x38')]({},_0x4ffc3b,_0x320060['options']);return db[_0x0614('0x3c')][_0x0614('0x45')](_0x4ffc3b)[_0x0614('0x22')](handleEntityNotFound(_0x5e15ad,null))[_0x0614('0x22')](respondWithResult(_0x5e15ad,null))[_0x0614('0x40')](handleError(_0x5e15ad,null));};exports['create']=function(_0x2e0340,_0x216656){return db[_0x0614('0x3c')][_0x0614('0x46')](_0x2e0340[_0x0614('0x47')],{})['then'](respondWithResult(_0x216656,0xc9))['catch'](handleError(_0x216656,null));};exports[_0x0614('0x21')]=function(_0x20e649,_0x45a6ca){if(_0x20e649['body']['id']){delete _0x20e649['body']['id'];}return db[_0x0614('0x3c')][_0x0614('0x45')]({'where':{'id':_0x20e649[_0x0614('0x42')]['id']}})[_0x0614('0x22')](handleEntityNotFound(_0x45a6ca,null))['then'](saveUpdates(_0x20e649[_0x0614('0x47')],null))[_0x0614('0x22')](respondWithResult(_0x45a6ca,null))['catch'](handleError(_0x45a6ca,null));};exports[_0x0614('0x23')]=function(_0x3f600f,_0x294100){return db[_0x0614('0x3c')][_0x0614('0x45')]({'where':{'id':_0x3f600f[_0x0614('0x42')]['id']}})[_0x0614('0x22')](handleEntityNotFound(_0x294100,null))[_0x0614('0x22')](removeEntity(_0x294100,null))[_0x0614('0x40')](handleError(_0x294100,null));};exports[_0x0614('0x48')]=function(_0x4ed13a,_0x18358a,_0x423ab4){var _0x1fdfc9={};var _0x3fce97={};var _0x48ae85;var _0x19cbe0;return db[_0x0614('0x3c')][_0x0614('0x49')]({'where':{'id':_0x4ed13a['params']['id']}})[_0x0614('0x22')](handleEntityNotFound(_0x18358a,null))[_0x0614('0x22')](function(_0x5a2a64){if(_0x5a2a64){_0x48ae85=_0x5a2a64;_0x3fce97[_0x0614('0x2e')]=_[_0x0614('0x43')](db['ServicenowField'][_0x0614('0x29')]);_0x3fce97[_0x0614('0x2c')]=_[_0x0614('0x43')](_0x4ed13a['query']);_0x3fce97[_0x0614('0x36')]=_[_0x0614('0x2d')](_0x3fce97[_0x0614('0x2e')],_0x3fce97[_0x0614('0x2c')]);_0x1fdfc9[_0x0614('0x2f')]=_[_0x0614('0x2d')](_0x3fce97[_0x0614('0x2e')],qs[_0x0614('0x30')](_0x4ed13a[_0x0614('0x2c')]['fields']));_0x1fdfc9[_0x0614('0x2f')]=_0x1fdfc9[_0x0614('0x2f')][_0x0614('0x44')]?_0x1fdfc9[_0x0614('0x2f')]:_0x3fce97[_0x0614('0x2e')];_0x1fdfc9[_0x0614('0x33')]=qs[_0x0614('0x34')](_0x4ed13a[_0x0614('0x2c')][_0x0614('0x34')]);_0x1fdfc9[_0x0614('0x35')]=qs[_0x0614('0x36')](_['pick'](_0x4ed13a[_0x0614('0x2c')],_0x3fce97[_0x0614('0x36')]));if(_0x4ed13a[_0x0614('0x2c')][_0x0614('0x3a')]){_0x1fdfc9['where']=_[_0x0614('0x38')](_0x1fdfc9[_0x0614('0x35')],{'$or':_[_0x0614('0x28')](_0x1fdfc9[_0x0614('0x2f')],function(_0x190eff){var _0x11e20a={};_0x11e20a[_0x190eff]={'$like':'%'+_0x4ed13a[_0x0614('0x2c')][_0x0614('0x3a')]+'%'};return _0x11e20a;})});}_0x1fdfc9=_[_0x0614('0x38')]({},_0x1fdfc9,_0x4ed13a[_0x0614('0x3b')]);return _0x48ae85[_0x0614('0x48')](_0x1fdfc9);}})[_0x0614('0x22')](function(_0x332633){if(_0x332633){_0x19cbe0=_0x332633[_0x0614('0x44')];if(!_0x4ed13a['query']['hasOwnProperty'](_0x0614('0x32'))){_0x1fdfc9[_0x0614('0x1a')]=qs[_0x0614('0x1a')](_0x4ed13a[_0x0614('0x2c')][_0x0614('0x1a')]);_0x1fdfc9[_0x0614('0x17')]=qs[_0x0614('0x17')](_0x4ed13a[_0x0614('0x2c')][_0x0614('0x17')]);}return _0x48ae85[_0x0614('0x48')](_0x1fdfc9);}})[_0x0614('0x22')](function(_0x24ab0c){if(_0x24ab0c){return _0x24ab0c?{'count':_0x19cbe0,'rows':_0x24ab0c}:null;}})['then'](respondWithResult(_0x18358a,null))['catch'](handleError(_0x18358a,null));};exports['getSubjects']=function(_0x7d5add,_0x24fa6f,_0x4e9145){var _0x3209d0={};var _0x3116fb={};var _0x54665b;var _0x4b3b61;return db[_0x0614('0x3c')][_0x0614('0x49')]({'where':{'id':_0x7d5add[_0x0614('0x42')]['id']}})[_0x0614('0x22')](handleEntityNotFound(_0x24fa6f,null))[_0x0614('0x22')](function(_0x54113a){if(_0x54113a){_0x54665b=_0x54113a;_0x3116fb[_0x0614('0x2e')]=_[_0x0614('0x43')](db['ServicenowField'][_0x0614('0x29')]);_0x3116fb[_0x0614('0x2c')]=_['keys'](_0x7d5add['query']);_0x3116fb[_0x0614('0x36')]=_[_0x0614('0x2d')](_0x3116fb['model'],_0x3116fb[_0x0614('0x2c')]);_0x3209d0[_0x0614('0x2f')]=_[_0x0614('0x2d')](_0x3116fb['model'],qs[_0x0614('0x30')](_0x7d5add['query']['fields']));_0x3209d0[_0x0614('0x2f')]=_0x3209d0[_0x0614('0x2f')]['length']?_0x3209d0['attributes']:_0x3116fb['model'];_0x3209d0['order']=qs['sort'](_0x7d5add[_0x0614('0x2c')][_0x0614('0x34')]);_0x3209d0[_0x0614('0x35')]=qs['filters'](_[_0x0614('0x37')](_0x7d5add['query'],_0x3116fb['filters']));if(_0x7d5add[_0x0614('0x2c')]['filter']){_0x3209d0[_0x0614('0x35')]=_[_0x0614('0x38')](_0x3209d0['where'],{'$or':_[_0x0614('0x28')](_0x3209d0[_0x0614('0x2f')],function(_0x4e079f){var _0x13a05d={};_0x13a05d[_0x4e079f]={'$like':'%'+_0x7d5add[_0x0614('0x2c')][_0x0614('0x3a')]+'%'};return _0x13a05d;})});}_0x3209d0=_[_0x0614('0x38')]({},_0x3209d0,_0x7d5add[_0x0614('0x3b')]);return _0x54665b[_0x0614('0x4a')](_0x3209d0);}})['then'](function(_0x44611a){if(_0x44611a){_0x4b3b61=_0x44611a['length'];if(!_0x7d5add[_0x0614('0x2c')][_0x0614('0x31')](_0x0614('0x32'))){_0x3209d0[_0x0614('0x1a')]=qs[_0x0614('0x1a')](_0x7d5add[_0x0614('0x2c')][_0x0614('0x1a')]);_0x3209d0[_0x0614('0x17')]=qs[_0x0614('0x17')](_0x7d5add[_0x0614('0x2c')]['offset']);}return _0x54665b[_0x0614('0x4a')](_0x3209d0);}})[_0x0614('0x22')](function(_0xd4a994){if(_0xd4a994){return _0xd4a994?{'count':_0x4b3b61,'rows':_0xd4a994}:null;}})[_0x0614('0x22')](respondWithResult(_0x24fa6f,null))[_0x0614('0x40')](handleError(_0x24fa6f,null));};exports[_0x0614('0x4b')]=function(_0x43d114,_0x1dbd02,_0x5c0f85){var _0x2e7d23={};var _0x4abd7f={};var _0x28aa69;var _0x521326;return db[_0x0614('0x3c')][_0x0614('0x49')]({'where':{'id':_0x43d114[_0x0614('0x42')]['id']}})[_0x0614('0x22')](handleEntityNotFound(_0x1dbd02,null))[_0x0614('0x22')](function(_0x4744b0){if(_0x4744b0){_0x28aa69=_0x4744b0;_0x4abd7f[_0x0614('0x2e')]=_[_0x0614('0x43')](db[_0x0614('0x4c')][_0x0614('0x29')]);_0x4abd7f[_0x0614('0x2c')]=_[_0x0614('0x43')](_0x43d114['query']);_0x4abd7f[_0x0614('0x36')]=_['intersection'](_0x4abd7f['model'],_0x4abd7f[_0x0614('0x2c')]);_0x2e7d23[_0x0614('0x2f')]=_[_0x0614('0x2d')](_0x4abd7f[_0x0614('0x2e')],qs['fields'](_0x43d114['query'][_0x0614('0x30')]));_0x2e7d23['attributes']=_0x2e7d23[_0x0614('0x2f')][_0x0614('0x44')]?_0x2e7d23['attributes']:_0x4abd7f[_0x0614('0x2e')];_0x2e7d23['order']=qs['sort'](_0x43d114[_0x0614('0x2c')][_0x0614('0x34')]);_0x2e7d23[_0x0614('0x35')]=qs['filters'](_[_0x0614('0x37')](_0x43d114['query'],_0x4abd7f[_0x0614('0x36')]));if(_0x43d114['query'][_0x0614('0x3a')]){_0x2e7d23['where']=_['merge'](_0x2e7d23[_0x0614('0x35')],{'$or':_[_0x0614('0x28')](_0x2e7d23[_0x0614('0x2f')],function(_0x577df6){var _0x9c235c={};_0x9c235c[_0x577df6]={'$like':'%'+_0x43d114[_0x0614('0x2c')][_0x0614('0x3a')]+'%'};return _0x9c235c;})});}_0x2e7d23=_['merge']({},_0x2e7d23,_0x43d114[_0x0614('0x3b')]);return _0x28aa69['getDescriptions'](_0x2e7d23);}})['then'](function(_0x4a3257){if(_0x4a3257){_0x521326=_0x4a3257['length'];if(!_0x43d114[_0x0614('0x2c')][_0x0614('0x31')](_0x0614('0x32'))){_0x2e7d23[_0x0614('0x1a')]=qs[_0x0614('0x1a')](_0x43d114[_0x0614('0x2c')][_0x0614('0x1a')]);_0x2e7d23[_0x0614('0x17')]=qs[_0x0614('0x17')](_0x43d114[_0x0614('0x2c')][_0x0614('0x17')]);}return _0x28aa69[_0x0614('0x4b')](_0x2e7d23);}})[_0x0614('0x22')](function(_0x36d9a8){if(_0x36d9a8){return _0x36d9a8?{'count':_0x521326,'rows':_0x36d9a8}:null;}})[_0x0614('0x22')](respondWithResult(_0x1dbd02,null))[_0x0614('0x40')](handleError(_0x1dbd02,null));};
\ No newline at end of file
+var _0x5bb8=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ServicenowConfiguration','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','ServicenowField','rawAttributes','getSubjects','filter','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3b5cba,_0x187170){var _0x363866=function(_0xd185cb){while(--_0xd185cb){_0x3b5cba['push'](_0x3b5cba['shift']());}};_0x363866(++_0x187170);}(_0x5bb8,0x18f));var _0x85bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5bb8[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x85bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85bb('0x1'));var jsonpatch=require(_0x85bb('0x2'));var rp=require(_0x85bb('0x3'));var moment=require(_0x85bb('0x4'));var BPromise=require(_0x85bb('0x5'));var Mustache=require(_0x85bb('0x6'));var util=require(_0x85bb('0x7'));var path=require(_0x85bb('0x8'));var sox=require(_0x85bb('0x9'));var csv=require(_0x85bb('0xa'));var ejs=require(_0x85bb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85bb('0xc'));var squel=require(_0x85bb('0xd'));var crypto=require(_0x85bb('0xe'));var jsforce=require(_0x85bb('0xf'));var deskjs=require(_0x85bb('0x10'));var toCsv=require('to-csv');var querystring=require(_0x85bb('0x11'));var Papa=require(_0x85bb('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x85bb('0x13'));var as=require(_0x85bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x85bb('0x15'))(_0x85bb('0x16'));var utils=require(_0x85bb('0x17'));var config=require(_0x85bb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x85bb('0x19'))['db'];function respondWithStatusCode(_0x29193d,_0x1fad96){_0x1fad96=_0x1fad96||0xcc;return function(_0x5244d6){if(_0x5244d6){return _0x29193d[_0x85bb('0x1a')](_0x1fad96);}return _0x29193d[_0x85bb('0x1b')](_0x1fad96)[_0x85bb('0x1c')]();};}function respondWithResult(_0x34f606,_0x34c0f3){_0x34c0f3=_0x34c0f3||0xc8;return function(_0x3c3182){if(_0x3c3182){return _0x34f606[_0x85bb('0x1b')](_0x34c0f3)[_0x85bb('0x1d')](_0x3c3182);}};}function respondWithFilteredResult(_0xb261a7,_0x25be48){return function(_0xe23dbc){if(_0xe23dbc){var _0x40d857=typeof _0x25be48[_0x85bb('0x1e')]===_0x85bb('0x1f')&&typeof _0x25be48[_0x85bb('0x20')]===_0x85bb('0x1f');var _0x46a1fa=_0xe23dbc[_0x85bb('0x21')];var _0x1c9057=_0x40d857?0x0:_0x25be48[_0x85bb('0x1e')];var _0x1e322f=_0x40d857?_0xe23dbc[_0x85bb('0x21')]:_0x25be48[_0x85bb('0x1e')]+_0x25be48[_0x85bb('0x20')];var _0x1804b0;if(_0x1e322f>=_0x46a1fa){_0x1e322f=_0x46a1fa;_0x1804b0=0xc8;}else{_0x1804b0=0xce;}_0xb261a7[_0x85bb('0x1b')](_0x1804b0);return _0xb261a7[_0x85bb('0x22')](_0x85bb('0x23'),_0x1c9057+'-'+_0x1e322f+'/'+_0x46a1fa)[_0x85bb('0x1d')](_0xe23dbc);}return null;};}function patchUpdates(_0xc7b670){return function(_0x52b0d6){try{jsonpatch[_0x85bb('0x24')](_0x52b0d6,_0xc7b670,!![]);}catch(_0x2a2cc1){return BPromise['reject'](_0x2a2cc1);}return _0x52b0d6[_0x85bb('0x25')]();};}function saveUpdates(_0xf0f00d,_0x1f971f){return function(_0x5378f9){if(_0x5378f9){return _0x5378f9[_0x85bb('0x26')](_0xf0f00d)[_0x85bb('0x27')](function(_0x6535d3){return _0x6535d3;});}return null;};}function removeEntity(_0x56b0d0,_0x52b261){return function(_0x5d2883){if(_0x5d2883){return _0x5d2883[_0x85bb('0x28')]()[_0x85bb('0x27')](function(){_0x56b0d0['status'](0xcc)[_0x85bb('0x1c')]();});}};}function handleEntityNotFound(_0x5b36c1,_0x47bed5){return function(_0x5bf6e8){if(!_0x5bf6e8){_0x5b36c1[_0x85bb('0x1a')](0x194);}return _0x5bf6e8;};}function handleError(_0x2ba4d0,_0x1e9cb3){_0x1e9cb3=_0x1e9cb3||0x1f4;return function(_0x47da70){logger['error'](_0x47da70[_0x85bb('0x29')]);if(_0x47da70['name']){delete _0x47da70[_0x85bb('0x2a')];}_0x2ba4d0['status'](_0x1e9cb3)[_0x85bb('0x2b')](_0x47da70);};}exports[_0x85bb('0x2c')]=function(_0x5d545c,_0x51ff73){var _0x5a1d05={},_0x1f715b={},_0x1af27a={'count':0x0,'rows':[]};var _0x34ad53=_[_0x85bb('0x2d')](db[_0x85bb('0x2e')]['rawAttributes'],function(_0x5379fb){return{'name':_0x5379fb[_0x85bb('0x2f')],'type':_0x5379fb['type'][_0x85bb('0x30')]};});_0x1f715b[_0x85bb('0x31')]=_['map'](_0x34ad53,_0x85bb('0x2a'));_0x1f715b[_0x85bb('0x32')]=_['keys'](_0x5d545c[_0x85bb('0x32')]);_0x1f715b['filters']=_['intersection'](_0x1f715b['model'],_0x1f715b['query']);_0x5a1d05[_0x85bb('0x33')]=_[_0x85bb('0x34')](_0x1f715b[_0x85bb('0x31')],qs['fields'](_0x5d545c[_0x85bb('0x32')][_0x85bb('0x35')]));_0x5a1d05[_0x85bb('0x33')]=_0x5a1d05[_0x85bb('0x33')][_0x85bb('0x36')]?_0x5a1d05[_0x85bb('0x33')]:_0x1f715b[_0x85bb('0x31')];if(!_0x5d545c[_0x85bb('0x32')][_0x85bb('0x37')](_0x85bb('0x38'))){_0x5a1d05[_0x85bb('0x20')]=qs[_0x85bb('0x20')](_0x5d545c[_0x85bb('0x32')][_0x85bb('0x20')]);_0x5a1d05[_0x85bb('0x1e')]=qs[_0x85bb('0x1e')](_0x5d545c[_0x85bb('0x32')][_0x85bb('0x1e')]);}_0x5a1d05[_0x85bb('0x39')]=qs[_0x85bb('0x3a')](_0x5d545c['query'][_0x85bb('0x3a')]);_0x5a1d05[_0x85bb('0x3b')]=qs[_0x85bb('0x3c')](_[_0x85bb('0x3d')](_0x5d545c[_0x85bb('0x32')],_0x1f715b['filters']),_0x34ad53);if(_0x5d545c[_0x85bb('0x32')]['filter']){_0x5a1d05[_0x85bb('0x3b')]=_[_0x85bb('0x3e')](_0x5a1d05[_0x85bb('0x3b')],{'$or':_['map'](_0x34ad53,function(_0x553b0e){if(_0x553b0e[_0x85bb('0x3f')]!==_0x85bb('0x40')){var _0x18ef3f={};_0x18ef3f[_0x553b0e['name']]={'$like':'%'+_0x5d545c[_0x85bb('0x32')]['filter']+'%'};return _0x18ef3f;}})});}_0x5a1d05=_[_0x85bb('0x3e')]({},_0x5a1d05,_0x5d545c[_0x85bb('0x41')]);var _0x5719dd={'where':_0x5a1d05['where']};return db['ServicenowConfiguration'][_0x85bb('0x21')](_0x5719dd)['then'](function(_0x4078ec){_0x1af27a[_0x85bb('0x21')]=_0x4078ec;if(_0x5d545c['query'][_0x85bb('0x42')]){_0x5a1d05[_0x85bb('0x43')]=[{'all':!![]}];}return db[_0x85bb('0x2e')][_0x85bb('0x44')](_0x5a1d05);})[_0x85bb('0x27')](function(_0x162990){_0x1af27a[_0x85bb('0x45')]=_0x162990;return _0x1af27a;})[_0x85bb('0x27')](respondWithFilteredResult(_0x51ff73,_0x5a1d05))[_0x85bb('0x46')](handleError(_0x51ff73,null));};exports[_0x85bb('0x47')]=function(_0x3dab45,_0x240869){var _0x326d55={'raw':![],'where':{'id':_0x3dab45[_0x85bb('0x48')]['id']}},_0x28aa3f={};_0x28aa3f[_0x85bb('0x31')]=_[_0x85bb('0x49')](db['ServicenowConfiguration']['rawAttributes']);_0x28aa3f[_0x85bb('0x32')]=_[_0x85bb('0x49')](_0x3dab45[_0x85bb('0x32')]);_0x28aa3f[_0x85bb('0x3c')]=_[_0x85bb('0x34')](_0x28aa3f[_0x85bb('0x31')],_0x28aa3f['query']);_0x326d55[_0x85bb('0x33')]=_[_0x85bb('0x34')](_0x28aa3f[_0x85bb('0x31')],qs[_0x85bb('0x35')](_0x3dab45[_0x85bb('0x32')]['fields']));_0x326d55[_0x85bb('0x33')]=_0x326d55[_0x85bb('0x33')][_0x85bb('0x36')]?_0x326d55[_0x85bb('0x33')]:_0x28aa3f[_0x85bb('0x31')];if(_0x3dab45[_0x85bb('0x32')]['includeAll']){_0x326d55['include']=[{'all':!![]}];}_0x326d55=_[_0x85bb('0x3e')]({},_0x326d55,_0x3dab45[_0x85bb('0x41')]);return db[_0x85bb('0x2e')][_0x85bb('0x4a')](_0x326d55)['then'](handleEntityNotFound(_0x240869,null))[_0x85bb('0x27')](respondWithResult(_0x240869,null))[_0x85bb('0x46')](handleError(_0x240869,null));};exports[_0x85bb('0x4b')]=function(_0x29e5ba,_0x1c6781){return db[_0x85bb('0x2e')][_0x85bb('0x4b')](_0x29e5ba[_0x85bb('0x4c')],{})[_0x85bb('0x27')](respondWithResult(_0x1c6781,0xc9))[_0x85bb('0x46')](handleError(_0x1c6781,null));};exports[_0x85bb('0x26')]=function(_0x23ade8,_0x11d4cf){if(_0x23ade8[_0x85bb('0x4c')]['id']){delete _0x23ade8[_0x85bb('0x4c')]['id'];}return db[_0x85bb('0x2e')][_0x85bb('0x4a')]({'where':{'id':_0x23ade8[_0x85bb('0x48')]['id']}})[_0x85bb('0x27')](handleEntityNotFound(_0x11d4cf,null))[_0x85bb('0x27')](saveUpdates(_0x23ade8[_0x85bb('0x4c')],null))['then'](respondWithResult(_0x11d4cf,null))[_0x85bb('0x46')](handleError(_0x11d4cf,null));};exports['destroy']=function(_0x2beccb,_0x350051){return db[_0x85bb('0x2e')][_0x85bb('0x4a')]({'where':{'id':_0x2beccb[_0x85bb('0x48')]['id']}})[_0x85bb('0x27')](handleEntityNotFound(_0x350051,null))['then'](removeEntity(_0x350051,null))[_0x85bb('0x46')](handleError(_0x350051,null));};exports[_0x85bb('0x4d')]=function(_0x1633fc,_0x16e80f,_0x2e3fe3){var _0x3ed04a={};var _0x302c60={};var _0x4a78db;var _0x19c549;return db['ServicenowConfiguration'][_0x85bb('0x4e')]({'where':{'id':_0x1633fc[_0x85bb('0x48')]['id']}})[_0x85bb('0x27')](handleEntityNotFound(_0x16e80f,null))[_0x85bb('0x27')](function(_0x54b15d){if(_0x54b15d){_0x4a78db=_0x54b15d;_0x302c60[_0x85bb('0x31')]=_[_0x85bb('0x49')](db[_0x85bb('0x4f')][_0x85bb('0x50')]);_0x302c60[_0x85bb('0x32')]=_[_0x85bb('0x49')](_0x1633fc[_0x85bb('0x32')]);_0x302c60[_0x85bb('0x3c')]=_['intersection'](_0x302c60[_0x85bb('0x31')],_0x302c60[_0x85bb('0x32')]);_0x3ed04a[_0x85bb('0x33')]=_[_0x85bb('0x34')](_0x302c60[_0x85bb('0x31')],qs[_0x85bb('0x35')](_0x1633fc[_0x85bb('0x32')]['fields']));_0x3ed04a[_0x85bb('0x33')]=_0x3ed04a['attributes'][_0x85bb('0x36')]?_0x3ed04a[_0x85bb('0x33')]:_0x302c60[_0x85bb('0x31')];_0x3ed04a[_0x85bb('0x39')]=qs['sort'](_0x1633fc[_0x85bb('0x32')]['sort']);_0x3ed04a['where']=qs[_0x85bb('0x3c')](_[_0x85bb('0x3d')](_0x1633fc[_0x85bb('0x32')],_0x302c60[_0x85bb('0x3c')]));if(_0x1633fc[_0x85bb('0x32')]['filter']){_0x3ed04a[_0x85bb('0x3b')]=_[_0x85bb('0x3e')](_0x3ed04a[_0x85bb('0x3b')],{'$or':_['map'](_0x3ed04a[_0x85bb('0x33')],function(_0xdbe952){var _0x53f13f={};_0x53f13f[_0xdbe952]={'$like':'%'+_0x1633fc[_0x85bb('0x32')]['filter']+'%'};return _0x53f13f;})});}_0x3ed04a=_['merge']({},_0x3ed04a,_0x1633fc[_0x85bb('0x41')]);return _0x4a78db[_0x85bb('0x4d')](_0x3ed04a);}})[_0x85bb('0x27')](function(_0x30f60c){if(_0x30f60c){_0x19c549=_0x30f60c[_0x85bb('0x36')];if(!_0x1633fc[_0x85bb('0x32')][_0x85bb('0x37')](_0x85bb('0x38'))){_0x3ed04a[_0x85bb('0x20')]=qs[_0x85bb('0x20')](_0x1633fc[_0x85bb('0x32')][_0x85bb('0x20')]);_0x3ed04a['offset']=qs[_0x85bb('0x1e')](_0x1633fc[_0x85bb('0x32')][_0x85bb('0x1e')]);}return _0x4a78db[_0x85bb('0x4d')](_0x3ed04a);}})[_0x85bb('0x27')](function(_0x249bdc){if(_0x249bdc){return _0x249bdc?{'count':_0x19c549,'rows':_0x249bdc}:null;}})[_0x85bb('0x27')](respondWithResult(_0x16e80f,null))[_0x85bb('0x46')](handleError(_0x16e80f,null));};exports[_0x85bb('0x51')]=function(_0x3db3a9,_0x3dc4c0,_0x4b0ce5){var _0x3447fb={};var _0x1932b6={};var _0x1e659a;var _0x47da87;return db[_0x85bb('0x2e')]['findOne']({'where':{'id':_0x3db3a9[_0x85bb('0x48')]['id']}})['then'](handleEntityNotFound(_0x3dc4c0,null))[_0x85bb('0x27')](function(_0x4e2f7e){if(_0x4e2f7e){_0x1e659a=_0x4e2f7e;_0x1932b6['model']=_[_0x85bb('0x49')](db[_0x85bb('0x4f')][_0x85bb('0x50')]);_0x1932b6[_0x85bb('0x32')]=_['keys'](_0x3db3a9['query']);_0x1932b6[_0x85bb('0x3c')]=_[_0x85bb('0x34')](_0x1932b6[_0x85bb('0x31')],_0x1932b6[_0x85bb('0x32')]);_0x3447fb[_0x85bb('0x33')]=_[_0x85bb('0x34')](_0x1932b6[_0x85bb('0x31')],qs[_0x85bb('0x35')](_0x3db3a9[_0x85bb('0x32')]['fields']));_0x3447fb['attributes']=_0x3447fb[_0x85bb('0x33')][_0x85bb('0x36')]?_0x3447fb[_0x85bb('0x33')]:_0x1932b6[_0x85bb('0x31')];_0x3447fb[_0x85bb('0x39')]=qs[_0x85bb('0x3a')](_0x3db3a9[_0x85bb('0x32')][_0x85bb('0x3a')]);_0x3447fb[_0x85bb('0x3b')]=qs['filters'](_['pick'](_0x3db3a9[_0x85bb('0x32')],_0x1932b6['filters']));if(_0x3db3a9['query']['filter']){_0x3447fb[_0x85bb('0x3b')]=_[_0x85bb('0x3e')](_0x3447fb[_0x85bb('0x3b')],{'$or':_[_0x85bb('0x2d')](_0x3447fb[_0x85bb('0x33')],function(_0x2997b3){var _0xa77b0e={};_0xa77b0e[_0x2997b3]={'$like':'%'+_0x3db3a9[_0x85bb('0x32')][_0x85bb('0x52')]+'%'};return _0xa77b0e;})});}_0x3447fb=_[_0x85bb('0x3e')]({},_0x3447fb,_0x3db3a9[_0x85bb('0x41')]);return _0x1e659a[_0x85bb('0x51')](_0x3447fb);}})[_0x85bb('0x27')](function(_0x539ef8){if(_0x539ef8){_0x47da87=_0x539ef8[_0x85bb('0x36')];if(!_0x3db3a9['query']['hasOwnProperty']('nolimit')){_0x3447fb[_0x85bb('0x20')]=qs[_0x85bb('0x20')](_0x3db3a9[_0x85bb('0x32')][_0x85bb('0x20')]);_0x3447fb[_0x85bb('0x1e')]=qs['offset'](_0x3db3a9['query'][_0x85bb('0x1e')]);}return _0x1e659a['getSubjects'](_0x3447fb);}})[_0x85bb('0x27')](function(_0x5a14ff){if(_0x5a14ff){return _0x5a14ff?{'count':_0x47da87,'rows':_0x5a14ff}:null;}})[_0x85bb('0x27')](respondWithResult(_0x3dc4c0,null))[_0x85bb('0x46')](handleError(_0x3dc4c0,null));};exports[_0x85bb('0x53')]=function(_0x50d6d,_0x4adc8a,_0x23b9d2){var _0x4ed65d={};var _0x509dcd={};var _0x5545b9;var _0x1b4547;return db[_0x85bb('0x2e')][_0x85bb('0x4e')]({'where':{'id':_0x50d6d['params']['id']}})[_0x85bb('0x27')](handleEntityNotFound(_0x4adc8a,null))[_0x85bb('0x27')](function(_0x2c90ae){if(_0x2c90ae){_0x5545b9=_0x2c90ae;_0x509dcd['model']=_[_0x85bb('0x49')](db[_0x85bb('0x4f')][_0x85bb('0x50')]);_0x509dcd[_0x85bb('0x32')]=_['keys'](_0x50d6d[_0x85bb('0x32')]);_0x509dcd[_0x85bb('0x3c')]=_[_0x85bb('0x34')](_0x509dcd[_0x85bb('0x31')],_0x509dcd[_0x85bb('0x32')]);_0x4ed65d['attributes']=_[_0x85bb('0x34')](_0x509dcd['model'],qs[_0x85bb('0x35')](_0x50d6d[_0x85bb('0x32')][_0x85bb('0x35')]));_0x4ed65d[_0x85bb('0x33')]=_0x4ed65d[_0x85bb('0x33')][_0x85bb('0x36')]?_0x4ed65d[_0x85bb('0x33')]:_0x509dcd[_0x85bb('0x31')];_0x4ed65d[_0x85bb('0x39')]=qs[_0x85bb('0x3a')](_0x50d6d['query']['sort']);_0x4ed65d[_0x85bb('0x3b')]=qs[_0x85bb('0x3c')](_[_0x85bb('0x3d')](_0x50d6d['query'],_0x509dcd[_0x85bb('0x3c')]));if(_0x50d6d[_0x85bb('0x32')]['filter']){_0x4ed65d['where']=_[_0x85bb('0x3e')](_0x4ed65d[_0x85bb('0x3b')],{'$or':_[_0x85bb('0x2d')](_0x4ed65d[_0x85bb('0x33')],function(_0x38923f){var _0x261864={};_0x261864[_0x38923f]={'$like':'%'+_0x50d6d[_0x85bb('0x32')][_0x85bb('0x52')]+'%'};return _0x261864;})});}_0x4ed65d=_[_0x85bb('0x3e')]({},_0x4ed65d,_0x50d6d[_0x85bb('0x41')]);return _0x5545b9[_0x85bb('0x53')](_0x4ed65d);}})['then'](function(_0x445807){if(_0x445807){_0x1b4547=_0x445807[_0x85bb('0x36')];if(!_0x50d6d['query'][_0x85bb('0x37')](_0x85bb('0x38'))){_0x4ed65d[_0x85bb('0x20')]=qs['limit'](_0x50d6d['query'][_0x85bb('0x20')]);_0x4ed65d[_0x85bb('0x1e')]=qs['offset'](_0x50d6d[_0x85bb('0x32')][_0x85bb('0x1e')]);}return _0x5545b9[_0x85bb('0x53')](_0x4ed65d);}})[_0x85bb('0x27')](function(_0x49fc51){if(_0x49fc51){return _0x49fc51?{'count':_0x1b4547,'rows':_0x49fc51}:null;}})[_0x85bb('0x27')](respondWithResult(_0x4adc8a,null))[_0x85bb('0x46')](handleError(_0x4adc8a,null));};
\ No newline at end of file
index 256eca0..9cbb3d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de3=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x3de3,0x1ce));var _0x33de=function(_0x10b53e,_0x4b1725){_0x10b53e=_0x10b53e-0x0;var _0x43398d=_0x3de3[_0x10b53e];return _0x43398d;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var logger=require(_0x33de('0x1'))(_0x33de('0x2'));var moment=require('moment');var BPromise=require(_0x33de('0x3'));var rp=require(_0x33de('0x4'));var fs=require('fs');var path=require(_0x33de('0x5'));var rimraf=require(_0x33de('0x6'));var config=require('../../config/environment');var attributes=require(_0x33de('0x7'));module[_0x33de('0x8')]=function(_0x558f98,_0x142716){return _0x558f98['define'](_0x33de('0x9'),attributes,{'tableName':_0x33de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40ac=['api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0x40ac,0x1de));var _0xc40a=function(_0x291b93,_0x44b715){_0x291b93=_0x291b93-0x0;var _0x4183c8=_0x40ac[_0x291b93];return _0x4183c8;};'use strict';var _=require(_0xc40a('0x0'));var util=require('util');var logger=require(_0xc40a('0x1'))(_0xc40a('0x2'));var moment=require(_0xc40a('0x3'));var BPromise=require(_0xc40a('0x4'));var rp=require(_0xc40a('0x5'));var fs=require('fs');var path=require(_0xc40a('0x6'));var rimraf=require(_0xc40a('0x7'));var config=require('../../config/environment');var attributes=require(_0xc40a('0x8'));module[_0xc40a('0x9')]=function(_0xd6d891,_0x5e179f){return _0xd6d891['define'](_0xc40a('0xa'),attributes,{'tableName':_0xc40a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c50d46..55df30f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf417=['info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','http','then'];(function(_0x2ec78d,_0x4c5241){var _0x258c00=function(_0x10f17c){while(--_0x10f17c){_0x2ec78d['push'](_0x2ec78d['shift']());}};_0x258c00(++_0x4c5241);}(_0xf417,0x8f));var _0x7f41=function(_0x5b445b,_0xd251da){_0x5b445b=_0x5b445b-0x0;var _0x1a40fe=_0xf417[_0x5b445b];return _0x1a40fe;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var moment=require(_0x7f41('0x1'));var BPromise=require(_0x7f41('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f41('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f41('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4e37b5,_0x34e466,_0x295136){return new BPromise(function(_0x507ac0,_0x26cfb2){return client['request'](_0x4e37b5,_0x295136)[_0x7f41('0x6')](function(_0x5f3a44){logger[_0x7f41('0x7')](_0x7f41('0x8'),_0x34e466,'request\x20sent');logger['debug'](_0x7f41('0x9'),_0x34e466,'request\x20sent',JSON['stringify'](_0x5f3a44));if(_0x5f3a44[_0x7f41('0xa')]){if(_0x5f3a44[_0x7f41('0xa')][_0x7f41('0xb')]===0x1f4){logger[_0x7f41('0xa')](_0x7f41('0x8'),_0x34e466,_0x5f3a44[_0x7f41('0xa')][_0x7f41('0xc')]);return _0x26cfb2(_0x5f3a44['error']['message']);}logger[_0x7f41('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x34e466,_0x5f3a44['error'][_0x7f41('0xc')]);return _0x507ac0(_0x5f3a44[_0x7f41('0xa')][_0x7f41('0xc')]);}else{logger['info'](_0x7f41('0x8'),_0x34e466,'request\x20sent');_0x507ac0(_0x5f3a44[_0x7f41('0xd')][_0x7f41('0xc')]);}})[_0x7f41('0xe')](function(_0x54b159){logger[_0x7f41('0xa')](_0x7f41('0x8'),_0x34e466,_0x54b159);_0x26cfb2(_0x54b159);});});}
\ No newline at end of file
+var _0xdb1e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdb1e,0x18b));var _0xedb1=function(_0x2d56b4,_0x1ee0c9){_0x2d56b4=_0x2d56b4-0x0;var _0x1d868f=_0xdb1e[_0x2d56b4];return _0x1d868f;};'use strict';var _=require(_0xedb1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xedb1('0x1'));var rs=require(_0xedb1('0x2'));var fs=require('fs');var Redis=require(_0xedb1('0x3'));var db=require(_0xedb1('0x4'))['db'];var utils=require(_0xedb1('0x5'));var logger=require(_0xedb1('0x6'))('rpc');var config=require(_0xedb1('0x7'));var jayson=require(_0xedb1('0x8'));var client=jayson[_0xedb1('0x9')][_0xedb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x156238,_0x1b77ec,_0x2e54c1){return new BPromise(function(_0x24483a,_0x49aa54){return client[_0xedb1('0xb')](_0x156238,_0x2e54c1)[_0xedb1('0xc')](function(_0x3e6894){logger[_0xedb1('0xd')](_0xedb1('0xe'),_0x1b77ec,'request\x20sent');logger['debug'](_0xedb1('0xf'),_0x1b77ec,'request\x20sent',JSON[_0xedb1('0x10')](_0x3e6894));if(_0x3e6894[_0xedb1('0x11')]){if(_0x3e6894[_0xedb1('0x11')]['code']===0x1f4){logger[_0xedb1('0x11')](_0xedb1('0xe'),_0x1b77ec,_0x3e6894[_0xedb1('0x11')][_0xedb1('0x12')]);return _0x49aa54(_0x3e6894[_0xedb1('0x11')][_0xedb1('0x12')]);}logger[_0xedb1('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1b77ec,_0x3e6894[_0xedb1('0x11')]['message']);return _0x24483a(_0x3e6894[_0xedb1('0x11')][_0xedb1('0x12')]);}else{logger[_0xedb1('0xd')](_0xedb1('0xe'),_0x1b77ec,_0xedb1('0x13'));_0x24483a(_0x3e6894[_0xedb1('0x14')][_0xedb1('0x12')]);}})[_0xedb1('0x15')](function(_0x305504){logger[_0xedb1('0x11')](_0xedb1('0xe'),_0x1b77ec,_0x305504);_0x49aa54(_0x305504);});});}
\ No newline at end of file
index e71486f..63ed764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f29=['show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id'];(function(_0x14c7b9,_0x2338a8){var _0x530911=function(_0x5e0324){while(--_0x5e0324){_0x14c7b9['push'](_0x14c7b9['shift']());}};_0x530911(++_0x2338a8);}(_0x9f29,0xf4));var _0x99f2=function(_0x50e9ad,_0x3c0929){_0x50e9ad=_0x50e9ad-0x0;var _0x2fb1eb=_0x9f29[_0x50e9ad];return _0x2fb1eb;};'use strict';var multer=require(_0x99f2('0x0'));var util=require('util');var path=require(_0x99f2('0x1'));var timeout=require(_0x99f2('0x2'));var express=require(_0x99f2('0x3'));var router=express[_0x99f2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x99f2('0x5'));var config=require(_0x99f2('0x6'));var controller=require(_0x99f2('0x7'));router[_0x99f2('0x8')]('/',auth[_0x99f2('0x9')](),controller['index']);router[_0x99f2('0x8')](_0x99f2('0xa'),auth[_0x99f2('0x9')](),controller[_0x99f2('0xb')]);router[_0x99f2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x99f2('0x9')](),controller[_0x99f2('0xd')]);router[_0x99f2('0xe')](_0x99f2('0xa'),auth[_0x99f2('0x9')](),controller[_0x99f2('0xf')]);module[_0x99f2('0x10')]=router;
\ No newline at end of file
+var _0x3e47=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5e13e4,_0x5c8a04){var _0x42994e=function(_0x24ff98){while(--_0x24ff98){_0x5e13e4['push'](_0x5e13e4['shift']());}};_0x42994e(++_0x5c8a04);}(_0x3e47,0x13d));var _0x73e4=function(_0x40197b,_0x4e763f){_0x40197b=_0x40197b-0x0;var _0x3b9c2f=_0x3e47[_0x40197b];return _0x3b9c2f;};'use strict';var multer=require(_0x73e4('0x0'));var util=require(_0x73e4('0x1'));var path=require(_0x73e4('0x2'));var timeout=require(_0x73e4('0x3'));var express=require(_0x73e4('0x4'));var router=express['Router']();var fs_extra=require(_0x73e4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x73e4('0x6'));var controller=require(_0x73e4('0x7'));router[_0x73e4('0x8')]('/',auth[_0x73e4('0x9')](),controller[_0x73e4('0xa')]);router[_0x73e4('0x8')](_0x73e4('0xb'),auth[_0x73e4('0x9')](),controller['show']);router[_0x73e4('0xc')]('/',auth['isAuthenticated'](),controller[_0x73e4('0xd')]);router[_0x73e4('0xe')](_0x73e4('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x73e4('0xf')](_0x73e4('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x73e4('0x10')]=router;
\ No newline at end of file
index db30c28..f366ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b9=['exports','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN'];(function(_0x3a42e9,_0x591cd2){var _0x4d7a6c=function(_0x5b6ae0){while(--_0x5b6ae0){_0x3a42e9['push'](_0x3a42e9['shift']());}};_0x4d7a6c(++_0x591cd2);}(_0x95b9,0x1e8));var _0x995b=function(_0x54463b,_0x5f1646){_0x54463b=_0x54463b-0x0;var _0x2b1977=_0x95b9[_0x54463b];return _0x2b1977;};'use strict';var Sequelize=require('sequelize');module[_0x995b('0x0')]={'type':{'type':Sequelize[_0x995b('0x1')](_0x995b('0x2'),_0x995b('0x3'),'customVariable','keyValue',_0x995b('0x4')),'defaultValue':_0x995b('0x2')},'content':{'type':Sequelize[_0x995b('0x5')]},'key':{'type':Sequelize[_0x995b('0x5')]},'keyType':{'type':Sequelize[_0x995b('0x1')](_0x995b('0x2'),_0x995b('0x3'),_0x995b('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x995b('0x5')]},'customField':{'type':Sequelize[_0x995b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x995b('0x5')]}};
\ No newline at end of file
+var _0x460c=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x432c7d,_0x2d5024){var _0x28425b=function(_0x3fad26){while(--_0x3fad26){_0x432c7d['push'](_0x432c7d['shift']());}};_0x28425b(++_0x2d5024);}(_0x460c,0xc6));var _0xc460=function(_0x2b0a01,_0x4d4304){_0x2b0a01=_0x2b0a01-0x0;var _0x5ca7c9=_0x460c[_0x2b0a01];return _0x5ca7c9;};'use strict';var Sequelize=require(_0xc460('0x0'));module[_0xc460('0x1')]={'type':{'type':Sequelize[_0xc460('0x2')](_0xc460('0x3'),_0xc460('0x4'),_0xc460('0x5'),'keyValue',_0xc460('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc460('0x7')]},'keyType':{'type':Sequelize[_0xc460('0x2')]('string',_0xc460('0x4'),_0xc460('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc460('0x7')]},'nameField':{'type':Sequelize[_0xc460('0x7')]},'customField':{'type':Sequelize[_0xc460('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc460('0x7')]}};
\ No newline at end of file
index 31fa171..86215a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67ff=['end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','name','send','map','ServicenowField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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/license/util','sendStatus'];(function(_0x29b88a,_0x956e44){var _0x8eaa95=function(_0x128da1){while(--_0x128da1){_0x29b88a['push'](_0x29b88a['shift']());}};_0x8eaa95(++_0x956e44);}(_0x67ff,0x18b));var _0xf67f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x67ff[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf67f('0x0'));var rimraf=require(_0xf67f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf67f('0x2'));var rp=require(_0xf67f('0x3'));var moment=require(_0xf67f('0x4'));var BPromise=require(_0xf67f('0x5'));var Mustache=require(_0xf67f('0x6'));var util=require(_0xf67f('0x7'));var path=require('path');var sox=require(_0xf67f('0x8'));var csv=require('to-csv');var ejs=require(_0xf67f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf67f('0xa'));var crypto=require(_0xf67f('0xb'));var jsforce=require(_0xf67f('0xc'));var deskjs=require(_0xf67f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf67f('0xe'));var Papa=require(_0xf67f('0xf'));var Redis=require(_0xf67f('0x10'));var authService=require(_0xf67f('0x11'));var qs=require(_0xf67f('0x12'));var as=require(_0xf67f('0x13'));var hardwareService=require(_0xf67f('0x14'));var logger=require('../../config/logger')(_0xf67f('0x15'));var utils=require(_0xf67f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf67f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ce790,_0x3cd4d2){_0x3cd4d2=_0x3cd4d2||0xcc;return function(_0x32de74){if(_0x32de74){return _0x4ce790[_0xf67f('0x18')](_0x3cd4d2);}return _0x4ce790['status'](_0x3cd4d2)[_0xf67f('0x19')]();};}function respondWithResult(_0x275c9e,_0x1a58db){_0x1a58db=_0x1a58db||0xc8;return function(_0x3ca679){if(_0x3ca679){return _0x275c9e[_0xf67f('0x1a')](_0x1a58db)[_0xf67f('0x1b')](_0x3ca679);}};}function respondWithFilteredResult(_0x57a7e5,_0x3ad255){return function(_0x57901d){if(_0x57901d){var _0x1007a4=typeof _0x3ad255[_0xf67f('0x1c')]==='undefined'&&typeof _0x3ad255[_0xf67f('0x1d')]===_0xf67f('0x1e');var _0x49fe54=_0x57901d[_0xf67f('0x1f')];var _0x2dc9d=_0x1007a4?0x0:_0x3ad255[_0xf67f('0x1c')];var _0x505e7b=_0x1007a4?_0x57901d[_0xf67f('0x1f')]:_0x3ad255[_0xf67f('0x1c')]+_0x3ad255['limit'];var _0xebd4ca;if(_0x505e7b>=_0x49fe54){_0x505e7b=_0x49fe54;_0xebd4ca=0xc8;}else{_0xebd4ca=0xce;}_0x57a7e5[_0xf67f('0x1a')](_0xebd4ca);return _0x57a7e5[_0xf67f('0x20')]('Content-Range',_0x2dc9d+'-'+_0x505e7b+'/'+_0x49fe54)[_0xf67f('0x1b')](_0x57901d);}return null;};}function patchUpdates(_0x27eb3f){return function(_0x3b86f7){try{jsonpatch[_0xf67f('0x21')](_0x3b86f7,_0x27eb3f,!![]);}catch(_0x3e7309){return BPromise[_0xf67f('0x22')](_0x3e7309);}return _0x3b86f7[_0xf67f('0x23')]();};}function saveUpdates(_0x29a09b,_0x488188){return function(_0xdb63e8){if(_0xdb63e8){return _0xdb63e8[_0xf67f('0x24')](_0x29a09b)['then'](function(_0x1f0808){return _0x1f0808;});}return null;};}function removeEntity(_0x346fd0,_0x4f4572){return function(_0x40b590){if(_0x40b590){return _0x40b590[_0xf67f('0x25')]()[_0xf67f('0x26')](function(){_0x346fd0[_0xf67f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x485082,_0x1668ed){return function(_0x2ce3ae){if(!_0x2ce3ae){_0x485082[_0xf67f('0x18')](0x194);}return _0x2ce3ae;};}function handleError(_0x7fd42d,_0x3eab37){_0x3eab37=_0x3eab37||0x1f4;return function(_0x432dfc){logger['error'](_0x432dfc['stack']);if(_0x432dfc[_0xf67f('0x27')]){delete _0x432dfc['name'];}_0x7fd42d[_0xf67f('0x1a')](_0x3eab37)[_0xf67f('0x28')](_0x432dfc);};}exports['index']=function(_0x5b44ab,_0x15354a){var _0x127328={},_0x18e6b1={},_0x56168e={'count':0x0,'rows':[]};var _0x3945f2=_[_0xf67f('0x29')](db[_0xf67f('0x2a')][_0xf67f('0x2b')],function(_0xa583e5){return{'name':_0xa583e5[_0xf67f('0x2c')],'type':_0xa583e5[_0xf67f('0x2d')]['key']};});_0x18e6b1[_0xf67f('0x2e')]=_[_0xf67f('0x29')](_0x3945f2,_0xf67f('0x27'));_0x18e6b1['query']=_[_0xf67f('0x2f')](_0x5b44ab['query']);_0x18e6b1[_0xf67f('0x30')]=_[_0xf67f('0x31')](_0x18e6b1[_0xf67f('0x2e')],_0x18e6b1[_0xf67f('0x32')]);_0x127328[_0xf67f('0x33')]=_[_0xf67f('0x31')](_0x18e6b1[_0xf67f('0x2e')],qs['fields'](_0x5b44ab[_0xf67f('0x32')][_0xf67f('0x34')]));_0x127328['attributes']=_0x127328[_0xf67f('0x33')][_0xf67f('0x35')]?_0x127328[_0xf67f('0x33')]:_0x18e6b1[_0xf67f('0x2e')];if(!_0x5b44ab[_0xf67f('0x32')]['hasOwnProperty']('nolimit')){_0x127328[_0xf67f('0x1d')]=qs['limit'](_0x5b44ab['query'][_0xf67f('0x1d')]);_0x127328[_0xf67f('0x1c')]=qs[_0xf67f('0x1c')](_0x5b44ab['query']['offset']);}_0x127328[_0xf67f('0x36')]=qs[_0xf67f('0x37')](_0x5b44ab[_0xf67f('0x32')][_0xf67f('0x37')]);_0x127328['where']=qs[_0xf67f('0x30')](_[_0xf67f('0x38')](_0x5b44ab[_0xf67f('0x32')],_0x18e6b1[_0xf67f('0x30')]),_0x3945f2);if(_0x5b44ab['query'][_0xf67f('0x39')]){_0x127328['where']=_['merge'](_0x127328[_0xf67f('0x3a')],{'$or':_[_0xf67f('0x29')](_0x3945f2,function(_0x247849){if(_0x247849[_0xf67f('0x2d')]!=='VIRTUAL'){var _0xf5305b={};_0xf5305b[_0x247849[_0xf67f('0x27')]]={'$like':'%'+_0x5b44ab[_0xf67f('0x32')]['filter']+'%'};return _0xf5305b;}})});}_0x127328=_[_0xf67f('0x3b')]({},_0x127328,_0x5b44ab['options']);var _0x4abfb8={'where':_0x127328['where']};return db['ServicenowField'][_0xf67f('0x1f')](_0x4abfb8)[_0xf67f('0x26')](function(_0xee7268){_0x56168e[_0xf67f('0x1f')]=_0xee7268;if(_0x5b44ab[_0xf67f('0x32')][_0xf67f('0x3c')]){_0x127328[_0xf67f('0x3d')]=[{'all':!![]}];}return db[_0xf67f('0x2a')]['findAll'](_0x127328);})[_0xf67f('0x26')](function(_0x1113f6){_0x56168e[_0xf67f('0x3e')]=_0x1113f6;return _0x56168e;})[_0xf67f('0x26')](respondWithFilteredResult(_0x15354a,_0x127328))[_0xf67f('0x3f')](handleError(_0x15354a,null));};exports[_0xf67f('0x40')]=function(_0x2a2dd1,_0x52e375){var _0x3576ca={'raw':!![],'where':{'id':_0x2a2dd1[_0xf67f('0x41')]['id']}},_0x53146d={};_0x53146d[_0xf67f('0x2e')]=_[_0xf67f('0x2f')](db[_0xf67f('0x2a')][_0xf67f('0x2b')]);_0x53146d['query']=_[_0xf67f('0x2f')](_0x2a2dd1['query']);_0x53146d[_0xf67f('0x30')]=_[_0xf67f('0x31')](_0x53146d[_0xf67f('0x2e')],_0x53146d[_0xf67f('0x32')]);_0x3576ca[_0xf67f('0x33')]=_[_0xf67f('0x31')](_0x53146d[_0xf67f('0x2e')],qs['fields'](_0x2a2dd1[_0xf67f('0x32')][_0xf67f('0x34')]));_0x3576ca['attributes']=_0x3576ca[_0xf67f('0x33')][_0xf67f('0x35')]?_0x3576ca[_0xf67f('0x33')]:_0x53146d[_0xf67f('0x2e')];if(_0x2a2dd1[_0xf67f('0x32')][_0xf67f('0x3c')]){_0x3576ca[_0xf67f('0x3d')]=[{'all':!![]}];}_0x3576ca=_[_0xf67f('0x3b')]({},_0x3576ca,_0x2a2dd1[_0xf67f('0x42')]);return db['ServicenowField'][_0xf67f('0x43')](_0x3576ca)['then'](handleEntityNotFound(_0x52e375,null))['then'](respondWithResult(_0x52e375,null))[_0xf67f('0x3f')](handleError(_0x52e375,null));};exports[_0xf67f('0x44')]=function(_0x480ba3,_0x3f96e3){return db['ServicenowField'][_0xf67f('0x44')](_0x480ba3[_0xf67f('0x45')],{})[_0xf67f('0x26')](respondWithResult(_0x3f96e3,0xc9))[_0xf67f('0x3f')](handleError(_0x3f96e3,null));};exports['update']=function(_0x5c14e4,_0x23f35c){if(_0x5c14e4['body']['id']){delete _0x5c14e4['body']['id'];}return db[_0xf67f('0x2a')]['find']({'where':{'id':_0x5c14e4[_0xf67f('0x41')]['id']}})[_0xf67f('0x26')](handleEntityNotFound(_0x23f35c,null))['then'](saveUpdates(_0x5c14e4[_0xf67f('0x45')],null))['then'](respondWithResult(_0x23f35c,null))[_0xf67f('0x3f')](handleError(_0x23f35c,null));};exports['destroy']=function(_0x1f65cc,_0x562e47){return db['ServicenowField'][_0xf67f('0x43')]({'where':{'id':_0x1f65cc['params']['id']}})[_0xf67f('0x26')](handleEntityNotFound(_0x562e47,null))[_0xf67f('0x26')](removeEntity(_0x562e47,null))[_0xf67f('0x3f')](handleError(_0x562e47,null));};
\ No newline at end of file
+var _0x0acb=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','index','rawAttributes','fieldName','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','ServicenowField','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto'];(function(_0x2fbb21,_0x1f3785){var _0x1caa91=function(_0x339eef){while(--_0x339eef){_0x2fbb21['push'](_0x2fbb21['shift']());}};_0x1caa91(++_0x1f3785);}(_0x0acb,0xcf));var _0xb0ac=function(_0x49e8f8,_0x32f59d){_0x49e8f8=_0x49e8f8-0x0;var _0x5b194f=_0x0acb[_0x49e8f8];return _0x5b194f;};'use strict';var emlformat=require(_0xb0ac('0x0'));var rimraf=require(_0xb0ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb0ac('0x2'));var moment=require(_0xb0ac('0x3'));var BPromise=require(_0xb0ac('0x4'));var Mustache=require('mustache');var util=require(_0xb0ac('0x5'));var path=require(_0xb0ac('0x6'));var sox=require(_0xb0ac('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0ac('0x8'));var _=require(_0xb0ac('0x9'));var squel=require(_0xb0ac('0xa'));var crypto=require(_0xb0ac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb0ac('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb0ac('0xd'));var Papa=require(_0xb0ac('0xe'));var Redis=require(_0xb0ac('0xf'));var authService=require(_0xb0ac('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb0ac('0x11'));var hardwareService=require(_0xb0ac('0x12'));var logger=require(_0xb0ac('0x13'))('api');var utils=require(_0xb0ac('0x14'));var config=require(_0xb0ac('0x15'));var licenseUtil=require(_0xb0ac('0x16'));var db=require(_0xb0ac('0x17'))['db'];function respondWithStatusCode(_0x16ce8d,_0x482859){_0x482859=_0x482859||0xcc;return function(_0x17ad57){if(_0x17ad57){return _0x16ce8d[_0xb0ac('0x18')](_0x482859);}return _0x16ce8d[_0xb0ac('0x19')](_0x482859)[_0xb0ac('0x1a')]();};}function respondWithResult(_0x5c90c4,_0x10ba28){_0x10ba28=_0x10ba28||0xc8;return function(_0xa61101){if(_0xa61101){return _0x5c90c4[_0xb0ac('0x19')](_0x10ba28)[_0xb0ac('0x1b')](_0xa61101);}};}function respondWithFilteredResult(_0x583b1e,_0x16e6d1){return function(_0x29593e){if(_0x29593e){var _0x332bd0=typeof _0x16e6d1[_0xb0ac('0x1c')]==='undefined'&&typeof _0x16e6d1[_0xb0ac('0x1d')]===_0xb0ac('0x1e');var _0x5163f8=_0x29593e['count'];var _0x50a71b=_0x332bd0?0x0:_0x16e6d1[_0xb0ac('0x1c')];var _0xc9b6c1=_0x332bd0?_0x29593e[_0xb0ac('0x1f')]:_0x16e6d1[_0xb0ac('0x1c')]+_0x16e6d1[_0xb0ac('0x1d')];var _0x54f768;if(_0xc9b6c1>=_0x5163f8){_0xc9b6c1=_0x5163f8;_0x54f768=0xc8;}else{_0x54f768=0xce;}_0x583b1e[_0xb0ac('0x19')](_0x54f768);return _0x583b1e[_0xb0ac('0x20')](_0xb0ac('0x21'),_0x50a71b+'-'+_0xc9b6c1+'/'+_0x5163f8)['json'](_0x29593e);}return null;};}function patchUpdates(_0x1057dc){return function(_0x4105e1){try{jsonpatch[_0xb0ac('0x22')](_0x4105e1,_0x1057dc,!![]);}catch(_0x4a7779){return BPromise['reject'](_0x4a7779);}return _0x4105e1[_0xb0ac('0x23')]();};}function saveUpdates(_0xe064cd,_0x4a6225){return function(_0x113c92){if(_0x113c92){return _0x113c92[_0xb0ac('0x24')](_0xe064cd)[_0xb0ac('0x25')](function(_0x22e100){return _0x22e100;});}return null;};}function removeEntity(_0x2810f4,_0x5840ad){return function(_0x7ccb1){if(_0x7ccb1){return _0x7ccb1[_0xb0ac('0x26')]()[_0xb0ac('0x25')](function(){_0x2810f4[_0xb0ac('0x19')](0xcc)[_0xb0ac('0x1a')]();});}};}function handleEntityNotFound(_0x2d7dbe,_0x372c14){return function(_0x3b973a){if(!_0x3b973a){_0x2d7dbe['sendStatus'](0x194);}return _0x3b973a;};}function handleError(_0x2a2f67,_0x3fb59a){_0x3fb59a=_0x3fb59a||0x1f4;return function(_0x371091){logger[_0xb0ac('0x27')](_0x371091['stack']);if(_0x371091['name']){delete _0x371091['name'];}_0x2a2f67['status'](_0x3fb59a)['send'](_0x371091);};}exports[_0xb0ac('0x28')]=function(_0x5be7ac,_0x10d6c5){var _0x180a2a={},_0x5ba107={},_0x5c150c={'count':0x0,'rows':[]};var _0x3ae3bd=_['map'](db['ServicenowField'][_0xb0ac('0x29')],function(_0x29248d){return{'name':_0x29248d[_0xb0ac('0x2a')],'type':_0x29248d['type']['key']};});_0x5ba107[_0xb0ac('0x2b')]=_[_0xb0ac('0x2c')](_0x3ae3bd,_0xb0ac('0x2d'));_0x5ba107[_0xb0ac('0x2e')]=_['keys'](_0x5be7ac[_0xb0ac('0x2e')]);_0x5ba107[_0xb0ac('0x2f')]=_[_0xb0ac('0x30')](_0x5ba107[_0xb0ac('0x2b')],_0x5ba107[_0xb0ac('0x2e')]);_0x180a2a[_0xb0ac('0x31')]=_[_0xb0ac('0x30')](_0x5ba107[_0xb0ac('0x2b')],qs[_0xb0ac('0x32')](_0x5be7ac['query'][_0xb0ac('0x32')]));_0x180a2a['attributes']=_0x180a2a['attributes'][_0xb0ac('0x33')]?_0x180a2a[_0xb0ac('0x31')]:_0x5ba107[_0xb0ac('0x2b')];if(!_0x5be7ac[_0xb0ac('0x2e')][_0xb0ac('0x34')](_0xb0ac('0x35'))){_0x180a2a[_0xb0ac('0x1d')]=qs[_0xb0ac('0x1d')](_0x5be7ac['query'][_0xb0ac('0x1d')]);_0x180a2a[_0xb0ac('0x1c')]=qs[_0xb0ac('0x1c')](_0x5be7ac['query'][_0xb0ac('0x1c')]);}_0x180a2a[_0xb0ac('0x36')]=qs[_0xb0ac('0x37')](_0x5be7ac[_0xb0ac('0x2e')][_0xb0ac('0x37')]);_0x180a2a['where']=qs[_0xb0ac('0x2f')](_[_0xb0ac('0x38')](_0x5be7ac[_0xb0ac('0x2e')],_0x5ba107[_0xb0ac('0x2f')]),_0x3ae3bd);if(_0x5be7ac[_0xb0ac('0x2e')][_0xb0ac('0x39')]){_0x180a2a[_0xb0ac('0x3a')]=_[_0xb0ac('0x3b')](_0x180a2a[_0xb0ac('0x3a')],{'$or':_[_0xb0ac('0x2c')](_0x3ae3bd,function(_0x43664c){if(_0x43664c[_0xb0ac('0x3c')]!==_0xb0ac('0x3d')){var _0x2ac645={};_0x2ac645[_0x43664c[_0xb0ac('0x2d')]]={'$like':'%'+_0x5be7ac[_0xb0ac('0x2e')][_0xb0ac('0x39')]+'%'};return _0x2ac645;}})});}_0x180a2a=_[_0xb0ac('0x3b')]({},_0x180a2a,_0x5be7ac[_0xb0ac('0x3e')]);var _0x2bf955={'where':_0x180a2a['where']};return db['ServicenowField']['count'](_0x2bf955)['then'](function(_0x2186d6){_0x5c150c[_0xb0ac('0x1f')]=_0x2186d6;if(_0x5be7ac[_0xb0ac('0x2e')]['includeAll']){_0x180a2a[_0xb0ac('0x3f')]=[{'all':!![]}];}return db[_0xb0ac('0x40')]['findAll'](_0x180a2a);})[_0xb0ac('0x25')](function(_0x807c20){_0x5c150c['rows']=_0x807c20;return _0x5c150c;})[_0xb0ac('0x25')](respondWithFilteredResult(_0x10d6c5,_0x180a2a))[_0xb0ac('0x41')](handleError(_0x10d6c5,null));};exports[_0xb0ac('0x42')]=function(_0x518523,_0x54a839){var _0x2a0a93={'raw':!![],'where':{'id':_0x518523[_0xb0ac('0x43')]['id']}},_0x3d0ffc={};_0x3d0ffc[_0xb0ac('0x2b')]=_[_0xb0ac('0x44')](db['ServicenowField'][_0xb0ac('0x29')]);_0x3d0ffc[_0xb0ac('0x2e')]=_[_0xb0ac('0x44')](_0x518523[_0xb0ac('0x2e')]);_0x3d0ffc[_0xb0ac('0x2f')]=_[_0xb0ac('0x30')](_0x3d0ffc['model'],_0x3d0ffc[_0xb0ac('0x2e')]);_0x2a0a93['attributes']=_[_0xb0ac('0x30')](_0x3d0ffc['model'],qs[_0xb0ac('0x32')](_0x518523[_0xb0ac('0x2e')]['fields']));_0x2a0a93[_0xb0ac('0x31')]=_0x2a0a93[_0xb0ac('0x31')][_0xb0ac('0x33')]?_0x2a0a93[_0xb0ac('0x31')]:_0x3d0ffc[_0xb0ac('0x2b')];if(_0x518523[_0xb0ac('0x2e')][_0xb0ac('0x45')]){_0x2a0a93[_0xb0ac('0x3f')]=[{'all':!![]}];}_0x2a0a93=_[_0xb0ac('0x3b')]({},_0x2a0a93,_0x518523[_0xb0ac('0x3e')]);return db[_0xb0ac('0x40')][_0xb0ac('0x46')](_0x2a0a93)['then'](handleEntityNotFound(_0x54a839,null))['then'](respondWithResult(_0x54a839,null))[_0xb0ac('0x41')](handleError(_0x54a839,null));};exports[_0xb0ac('0x47')]=function(_0x5bc5c5,_0x5b642d){return db[_0xb0ac('0x40')][_0xb0ac('0x47')](_0x5bc5c5[_0xb0ac('0x48')],{})['then'](respondWithResult(_0x5b642d,0xc9))[_0xb0ac('0x41')](handleError(_0x5b642d,null));};exports[_0xb0ac('0x24')]=function(_0x1b1075,_0x5739a1){if(_0x1b1075[_0xb0ac('0x48')]['id']){delete _0x1b1075[_0xb0ac('0x48')]['id'];}return db[_0xb0ac('0x40')]['find']({'where':{'id':_0x1b1075[_0xb0ac('0x43')]['id']}})[_0xb0ac('0x25')](handleEntityNotFound(_0x5739a1,null))[_0xb0ac('0x25')](saveUpdates(_0x1b1075['body'],null))['then'](respondWithResult(_0x5739a1,null))[_0xb0ac('0x41')](handleError(_0x5739a1,null));};exports[_0xb0ac('0x26')]=function(_0x4aa060,_0x8603dd){return db[_0xb0ac('0x40')]['find']({'where':{'id':_0x4aa060[_0xb0ac('0x43')]['id']}})[_0xb0ac('0x25')](handleEntityNotFound(_0x8603dd,null))[_0xb0ac('0x25')](removeEntity(_0x8603dd,null))['catch'](handleError(_0x8603dd,null));};
\ No newline at end of file
index eb94f2d..1d0e84b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0f=['int_servicenow_fields','FieldId','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ServicenowField'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0xeb0f,0x10a));var _0xfeb0=function(_0x1c803d,_0x355124){_0x1c803d=_0x1c803d-0x0;var _0x351a85=_0xeb0f[_0x1c803d];return _0x351a85;};'use strict';var _=require('lodash');var util=require(_0xfeb0('0x0'));var logger=require('../../config/logger')(_0xfeb0('0x1'));var moment=require(_0xfeb0('0x2'));var BPromise=require(_0xfeb0('0x3'));var rp=require(_0xfeb0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfeb0('0x5'));var config=require(_0xfeb0('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xfeb0('0x7')]=function(_0x43adac,_0x5b26f7){return _0x43adac['define'](_0xfeb0('0x8'),attributes,{'tableName':_0xfeb0('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xfeb0('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b99=['servicenow_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intServicenowField.attributes','define','int_servicenow_fields'];(function(_0x29ad84,_0x2a2857){var _0x5397b8=function(_0xd7cb4d){while(--_0xd7cb4d){_0x29ad84['push'](_0x29ad84['shift']());}};_0x5397b8(++_0x2a2857);}(_0x5b99,0x1a6));var _0x95b9=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x5b99[_0x2706da];return _0x3ba87e;};'use strict';var _=require(_0x95b9('0x0'));var util=require(_0x95b9('0x1'));var logger=require(_0x95b9('0x2'))('api');var moment=require(_0x95b9('0x3'));var BPromise=require(_0x95b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95b9('0x5'));var rimraf=require(_0x95b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x95b9('0x7'));module['exports']=function(_0x44950d,_0x2493ff){return _0x44950d[_0x95b9('0x8')]('ServicenowField',attributes,{'tableName':_0x95b9('0x9'),'paranoid':![],'indexes':[{'name':_0x95b9('0xa'),'fields':['idField',_0x95b9('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 253733b..68b2b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xda3f,0xec));var _0xfda3=function(_0x43fb33,_0x399b85){_0x43fb33=_0x43fb33-0x0;var _0x19e569=_0xda3f[_0x43fb33];return _0x19e569;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
+var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2a242a,_0x54e374){var _0x5c6faa=function(_0x418d91){while(--_0x418d91){_0x2a242a['push'](_0x2a242a['shift']());}};_0x5c6faa(++_0x54e374);}(_0xf4eb,0xec));var _0xbf4e=function(_0x425246,_0x2a2854){_0x425246=_0x425246-0x0;var _0x5eac52=_0xf4eb[_0x425246];return _0x5eac52;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index b12a924..4b6f3ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xb0d5bc,_0x1fb221){var _0x42d38d=function(_0x389690){while(--_0x389690){_0xb0d5bc['push'](_0xb0d5bc['shift']());}};_0x42d38d(++_0x1fb221);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+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(_0x72d7af,_0x3ec829){var _0xa86deb=function(_0x50d8fc){while(--_0x50d8fc){_0x72d7af['push'](_0x72d7af['shift']());}};_0xa86deb(++_0x3ec829);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 1956d78..7d1d4f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x57c05e,_0x4d47af){var _0x4d7859=function(_0x44515c){while(--_0x44515c){_0x57c05e['push'](_0x57c05e['shift']());}};_0x4d7859(++_0x4d47af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x2cf541,_0x54c2a6){var _0x40fd98=function(_0x52532a){while(--_0x52532a){_0x2cf541['push'](_0x2cf541['shift']());}};_0x40fd98(++_0x54c2a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 4f0c94b..8cb3642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26e6=['SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','name','assigned_user_id','created_by','description','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','error','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','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','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','end','send','map'];(function(_0xa4040,_0x140440){var _0x18bae5=function(_0x1df7fc){while(--_0x1df7fc){_0xa4040['push'](_0xa4040['shift']());}};_0x18bae5(++_0x140440);}(_0x26e6,0x1ab));var _0x626e=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x26e6[_0x297c55];return _0x120389;};'use strict';var emlformat=require(_0x626e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x626e('0x1'));var jsonpatch=require(_0x626e('0x2'));var rp=require('request-promise');var moment=require(_0x626e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x626e('0x4'));var path=require(_0x626e('0x5'));var sox=require(_0x626e('0x6'));var csv=require(_0x626e('0x7'));var ejs=require(_0x626e('0x8'));var fs=require('fs');var fs_extra=require(_0x626e('0x9'));var _=require('lodash');var squel=require(_0x626e('0xa'));var crypto=require('crypto');var jsforce=require(_0x626e('0xb'));var deskjs=require(_0x626e('0xc'));var toCsv=require(_0x626e('0x7'));var querystring=require(_0x626e('0xd'));var Papa=require(_0x626e('0xe'));var Redis=require(_0x626e('0xf'));var authService=require(_0x626e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x626e('0x11'));var hardwareService=require(_0x626e('0x12'));var logger=require(_0x626e('0x13'))(_0x626e('0x14'));var utils=require(_0x626e('0x15'));var config=require(_0x626e('0x16'));var licenseUtil=require(_0x626e('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x626e('0x18'));function respondWithStatusCode(_0x3a8c7e,_0xaebe13){_0xaebe13=_0xaebe13||0xcc;return function(_0x35602f){if(_0x35602f){return _0x3a8c7e[_0x626e('0x19')](_0xaebe13);}return _0x3a8c7e[_0x626e('0x1a')](_0xaebe13)['end']();};}function respondWithResult(_0x5e54ff,_0x21e282){_0x21e282=_0x21e282||0xc8;return function(_0x207e47){if(_0x207e47){return _0x5e54ff[_0x626e('0x1a')](_0x21e282)[_0x626e('0x1b')](_0x207e47);}};}function respondWithFilteredResult(_0x5b5d82,_0x48bc2f){return function(_0x44df77){if(_0x44df77){var _0x2fb88d=typeof _0x48bc2f['offset']==='undefined'&&typeof _0x48bc2f[_0x626e('0x1c')]===_0x626e('0x1d');var _0x2d03c1=_0x44df77[_0x626e('0x1e')];var _0x44c963=_0x2fb88d?0x0:_0x48bc2f[_0x626e('0x1f')];var _0x3c12cd=_0x2fb88d?_0x44df77[_0x626e('0x1e')]:_0x48bc2f[_0x626e('0x1f')]+_0x48bc2f[_0x626e('0x1c')];var _0x17318a;if(_0x3c12cd>=_0x2d03c1){_0x3c12cd=_0x2d03c1;_0x17318a=0xc8;}else{_0x17318a=0xce;}_0x5b5d82['status'](_0x17318a);return _0x5b5d82['set'](_0x626e('0x20'),_0x44c963+'-'+_0x3c12cd+'/'+_0x2d03c1)['json'](_0x44df77);}return null;};}function patchUpdates(_0x3b40c9){return function(_0x4d9f3d){try{jsonpatch[_0x626e('0x21')](_0x4d9f3d,_0x3b40c9,!![]);}catch(_0x37f321){return BPromise['reject'](_0x37f321);}return _0x4d9f3d[_0x626e('0x22')]();};}function saveUpdates(_0x1bdcb3,_0x2da7e3){return function(_0x315bca){if(_0x315bca){return _0x315bca[_0x626e('0x23')](_0x1bdcb3)[_0x626e('0x24')](function(_0x4a6ef2){return _0x4a6ef2;});}return null;};}function removeEntity(_0x54a22c,_0x1b927b){return function(_0x58caee){if(_0x58caee){return _0x58caee[_0x626e('0x25')]()['then'](function(){_0x54a22c['status'](0xcc)[_0x626e('0x26')]();});}};}function handleEntityNotFound(_0x93667d,_0x476339){return function(_0x366095){if(!_0x366095){_0x93667d[_0x626e('0x19')](0x194);}return _0x366095;};}function handleError(_0x336373,_0x39a009){_0x39a009=_0x39a009||0x1f4;return function(_0x28f4f0){logger['error'](_0x28f4f0['stack']);if(_0x28f4f0['name']){delete _0x28f4f0['name'];}_0x336373[_0x626e('0x1a')](_0x39a009)[_0x626e('0x27')](_0x28f4f0);};}exports['index']=function(_0x15831b,_0x3b97f4){var _0x4789d5={},_0x5c809b={},_0x537ac6={'count':0x0,'rows':[]};var _0x308f60=_[_0x626e('0x28')](db[_0x626e('0x29')][_0x626e('0x2a')],function(_0x120cc7){return{'name':_0x120cc7[_0x626e('0x2b')],'type':_0x120cc7['type'][_0x626e('0x2c')]};});_0x5c809b[_0x626e('0x2d')]=_[_0x626e('0x28')](_0x308f60,'name');_0x5c809b[_0x626e('0x2e')]=_[_0x626e('0x2f')](_0x15831b[_0x626e('0x2e')]);_0x5c809b[_0x626e('0x30')]=_[_0x626e('0x31')](_0x5c809b['model'],_0x5c809b[_0x626e('0x2e')]);_0x4789d5[_0x626e('0x32')]=_['intersection'](_0x5c809b[_0x626e('0x2d')],qs[_0x626e('0x33')](_0x15831b[_0x626e('0x2e')][_0x626e('0x33')]));_0x4789d5[_0x626e('0x32')]=_0x4789d5[_0x626e('0x32')][_0x626e('0x34')]?_0x4789d5[_0x626e('0x32')]:_0x5c809b[_0x626e('0x2d')];if(!_0x15831b[_0x626e('0x2e')][_0x626e('0x35')](_0x626e('0x36'))){_0x4789d5[_0x626e('0x1c')]=qs[_0x626e('0x1c')](_0x15831b['query']['limit']);_0x4789d5[_0x626e('0x1f')]=qs[_0x626e('0x1f')](_0x15831b[_0x626e('0x2e')]['offset']);}_0x4789d5['order']=qs[_0x626e('0x37')](_0x15831b[_0x626e('0x2e')][_0x626e('0x37')]);_0x4789d5[_0x626e('0x38')]=qs['filters'](_[_0x626e('0x39')](_0x15831b['query'],_0x5c809b[_0x626e('0x30')]),_0x308f60);if(_0x15831b[_0x626e('0x2e')][_0x626e('0x3a')]){_0x4789d5[_0x626e('0x38')]=_[_0x626e('0x3b')](_0x4789d5['where'],{'$or':_[_0x626e('0x28')](_0x308f60,function(_0x2306b6){if(_0x2306b6['type']!==_0x626e('0x3c')){var _0x1549c3={};_0x1549c3[_0x2306b6['name']]={'$like':'%'+_0x15831b[_0x626e('0x2e')][_0x626e('0x3a')]+'%'};return _0x1549c3;}})});}_0x4789d5=_[_0x626e('0x3b')]({},_0x4789d5,_0x15831b[_0x626e('0x3d')]);var _0x5889af={'where':_0x4789d5[_0x626e('0x38')]};return db['SugarcrmAccount'][_0x626e('0x1e')](_0x5889af)[_0x626e('0x24')](function(_0xb46f3a){_0x537ac6[_0x626e('0x1e')]=_0xb46f3a;if(_0x15831b[_0x626e('0x2e')]['includeAll']){_0x4789d5[_0x626e('0x3e')]=[{'all':!![]}];}return db[_0x626e('0x29')]['findAll'](_0x4789d5);})[_0x626e('0x24')](function(_0x29f0d8){_0x537ac6[_0x626e('0x3f')]=_0x29f0d8;return _0x537ac6;})[_0x626e('0x24')](respondWithFilteredResult(_0x3b97f4,_0x4789d5))[_0x626e('0x40')](handleError(_0x3b97f4,null));};exports[_0x626e('0x41')]=function(_0x3d2bda,_0x55c4b4){var _0x413f72={'raw':![],'where':{'id':_0x3d2bda[_0x626e('0x42')]['id']}},_0x3665fa={};_0x3665fa[_0x626e('0x2d')]=_[_0x626e('0x2f')](db[_0x626e('0x29')][_0x626e('0x2a')]);_0x3665fa[_0x626e('0x2e')]=_[_0x626e('0x2f')](_0x3d2bda[_0x626e('0x2e')]);_0x3665fa[_0x626e('0x30')]=_[_0x626e('0x31')](_0x3665fa['model'],_0x3665fa[_0x626e('0x2e')]);_0x413f72[_0x626e('0x32')]=_[_0x626e('0x31')](_0x3665fa[_0x626e('0x2d')],qs[_0x626e('0x33')](_0x3d2bda[_0x626e('0x2e')]['fields']));_0x413f72[_0x626e('0x32')]=_0x413f72['attributes'][_0x626e('0x34')]?_0x413f72[_0x626e('0x32')]:_0x3665fa[_0x626e('0x2d')];if(_0x3d2bda[_0x626e('0x2e')]['includeAll']){_0x413f72[_0x626e('0x3e')]=[{'all':!![]}];}_0x413f72=_[_0x626e('0x3b')]({},_0x413f72,_0x3d2bda[_0x626e('0x3d')]);return db[_0x626e('0x29')][_0x626e('0x43')](_0x413f72)[_0x626e('0x24')](handleEntityNotFound(_0x55c4b4,null))[_0x626e('0x24')](respondWithResult(_0x55c4b4,null))['catch'](handleError(_0x55c4b4,null));};exports['create']=function(_0x462131,_0x5116db){return db['SugarcrmAccount'][_0x626e('0x44')](_0x462131[_0x626e('0x45')],{})['then'](respondWithResult(_0x5116db,0xc9))[_0x626e('0x40')](handleError(_0x5116db,null));};exports[_0x626e('0x23')]=function(_0x363cc3,_0x603390){if(_0x363cc3[_0x626e('0x45')]['id']){delete _0x363cc3[_0x626e('0x45')]['id'];}return db[_0x626e('0x29')][_0x626e('0x43')]({'where':{'id':_0x363cc3[_0x626e('0x42')]['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x603390,null))[_0x626e('0x24')](saveUpdates(_0x363cc3[_0x626e('0x45')],null))[_0x626e('0x24')](respondWithResult(_0x603390,null))[_0x626e('0x40')](handleError(_0x603390,null));};exports[_0x626e('0x25')]=function(_0x3c1e0e,_0x1577a6){return db[_0x626e('0x29')][_0x626e('0x43')]({'where':{'id':_0x3c1e0e['params']['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x1577a6,null))['then'](removeEntity(_0x1577a6,null))[_0x626e('0x40')](handleError(_0x1577a6,null));};exports[_0x626e('0x46')]=function(_0x53dd08,_0xbc6cbf,_0x52b84d){var _0x573d36={};var _0x57cf78={};var _0x1ccae9;var _0x587e49;return db[_0x626e('0x29')][_0x626e('0x47')]({'where':{'id':_0x53dd08[_0x626e('0x42')]['id']}})[_0x626e('0x24')](handleEntityNotFound(_0xbc6cbf,null))[_0x626e('0x24')](function(_0x32b60c){if(_0x32b60c){_0x1ccae9=_0x32b60c;_0x57cf78['model']=_[_0x626e('0x2f')](db[_0x626e('0x48')][_0x626e('0x2a')]);_0x57cf78['query']=_[_0x626e('0x2f')](_0x53dd08[_0x626e('0x2e')]);_0x57cf78[_0x626e('0x30')]=_[_0x626e('0x31')](_0x57cf78['model'],_0x57cf78['query']);_0x573d36[_0x626e('0x32')]=_[_0x626e('0x31')](_0x57cf78[_0x626e('0x2d')],qs[_0x626e('0x33')](_0x53dd08[_0x626e('0x2e')][_0x626e('0x33')]));_0x573d36[_0x626e('0x32')]=_0x573d36[_0x626e('0x32')][_0x626e('0x34')]?_0x573d36[_0x626e('0x32')]:_0x57cf78[_0x626e('0x2d')];_0x573d36[_0x626e('0x49')]=qs['sort'](_0x53dd08[_0x626e('0x2e')][_0x626e('0x37')]);_0x573d36[_0x626e('0x38')]=qs[_0x626e('0x30')](_['pick'](_0x53dd08[_0x626e('0x2e')],_0x57cf78[_0x626e('0x30')]));if(_0x53dd08[_0x626e('0x2e')][_0x626e('0x3a')]){_0x573d36['where']=_[_0x626e('0x3b')](_0x573d36['where'],{'$or':_[_0x626e('0x28')](_0x573d36[_0x626e('0x32')],function(_0x1c44ba){var _0x4b2d10={};_0x4b2d10[_0x1c44ba]={'$like':'%'+_0x53dd08[_0x626e('0x2e')][_0x626e('0x3a')]+'%'};return _0x4b2d10;})});}_0x573d36=_[_0x626e('0x3b')]({},_0x573d36,_0x53dd08[_0x626e('0x3d')]);return _0x1ccae9[_0x626e('0x46')](_0x573d36);}})[_0x626e('0x24')](function(_0xa6b0ac){if(_0xa6b0ac){_0x587e49=_0xa6b0ac[_0x626e('0x34')];if(!_0x53dd08['query'][_0x626e('0x35')](_0x626e('0x36'))){_0x573d36[_0x626e('0x1c')]=qs[_0x626e('0x1c')](_0x53dd08['query']['limit']);_0x573d36[_0x626e('0x1f')]=qs[_0x626e('0x1f')](_0x53dd08[_0x626e('0x2e')][_0x626e('0x1f')]);}return _0x1ccae9[_0x626e('0x46')](_0x573d36);}})[_0x626e('0x24')](function(_0x1e13e0){if(_0x1e13e0){return _0x1e13e0?{'count':_0x587e49,'rows':_0x1e13e0}:null;}})[_0x626e('0x24')](respondWithResult(_0xbc6cbf,null))[_0x626e('0x40')](handleError(_0xbc6cbf,null));};exports['addConfiguration']=function(_0x783aff,_0x4887fe,_0x484927){if(_0x783aff[_0x626e('0x45')]['id']){delete _0x783aff[_0x626e('0x45')]['id'];}return db['SugarcrmAccount'][_0x626e('0x47')]({'where':{'id':_0x783aff[_0x626e('0x42')]['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x4887fe,null))[_0x626e('0x24')](function(_0x11587e){if(_0x11587e){_0x783aff['body'][_0x626e('0x4a')]=_0x11587e['id'];_0x783aff['body'][_0x626e('0x4b')]=integrations[_0x626e('0x4c')](_0x783aff[_0x626e('0x45')][_0x626e('0x4d')],_0x783aff[_0x626e('0x45')]['type']);_0x783aff[_0x626e('0x45')][_0x626e('0x4e')]=integrations[_0x626e('0x4f')](_0x783aff[_0x626e('0x45')][_0x626e('0x4d')],_0x783aff[_0x626e('0x45')]['type']);return db[_0x626e('0x48')][_0x626e('0x44')](_0x783aff[_0x626e('0x45')],{'include':[{'model':db[_0x626e('0x50')],'as':_0x626e('0x4b')},{'model':db[_0x626e('0x50')],'as':_0x626e('0x4e')}]});}return null;})['then'](respondWithResult(_0x4887fe,null))[_0x626e('0x40')](handleError(_0x4887fe,null));};exports['getFields']=function(_0x2a04a1,_0xf3f10a,_0x54dda4){var _0x2b96a9='';var _0x3a2656=['id',_0x626e('0x51'),_0x626e('0x52'),_0x626e('0x53'),_0x626e('0x54'),'date_start','duration_hours',_0x626e('0x55'),_0x626e('0x56'),_0x626e('0x57'),_0x626e('0x58'),_0x626e('0x59')];return db[_0x626e('0x29')][_0x626e('0x47')]({'where':{'id':_0x2a04a1['params']['id']},'attributes':['id',_0x626e('0x5a'),_0x626e('0x5b'),'remoteUri']})[_0x626e('0x24')](handleEntityNotFound(_0xf3f10a,null))[_0x626e('0x24')](function(_0x6ae79d){if(_0x6ae79d){_0x2b96a9=_0x6ae79d[_0x626e('0x5c')];var _0x2c4f89=_0x2b96a9[_0x626e('0x5d')](-0x1);if(_0x2c4f89==='/'){_0x2b96a9=_0x2b96a9[_0x626e('0x5e')](0x0,_0x2b96a9['lastIndexOf'](_0x2c4f89));}return rp({'method':_0x626e('0x5f'),'uri':util[_0x626e('0x60')](_0x626e('0x61'),_0x2b96a9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x626e('0x62'),'input_type':_0x626e('0x63'),'response_type':_0x626e('0x63'),'rest_data':JSON[_0x626e('0x64')]({'user_auth':{'user_name':_0x6ae79d[_0x626e('0x5a')],'password':_0x6ae79d['password'],'encryption':'PLAIN'},'application':_0x626e('0x65')})}});}})['then'](function(_0x255029){if(_0x255029&&_0x255029['name']!==_0x626e('0x66')&&_0x255029[_0x626e('0x51')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util['format'](_0x626e('0x61'),_0x2b96a9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x626e('0x67'),'input_type':_0x626e('0x63'),'response_type':_0x626e('0x63'),'rest_data':JSON[_0x626e('0x64')]({'session':_0x255029['id'],'module_name':_0x626e('0x68')})}})[_0x626e('0x24')](function(_0x44207c){if(_0x44207c){var _0x14f17a=_[_0x626e('0x69')](_0x44207c[_0x626e('0x6a')]);_[_0x626e('0x6b')](_0x14f17a,function(_0x15506d){return _0x3a2656[_0x626e('0x6c')](_0x15506d[_0x626e('0x51')]);});return{'count':_0x14f17a[_0x626e('0x34')],'rows':_[_0x626e('0x28')](_0x14f17a,function(_0x2a5d30){return{'id':_0x2a5d30['name'],'name':_0x2a5d30[_0x626e('0x6d')],'custom':_[_0x626e('0x6e')](_0x2a5d30[_0x626e('0x51')],'_c')?!![]:![],'options':_0x2a5d30[_0x626e('0x3d')]?_[_0x626e('0x28')](_[_0x626e('0x69')](_0x2a5d30[_0x626e('0x3d')]),function(_0x46c99b){return{'name':_0x46c99b[_0x626e('0x6f')],'value':_0x46c99b[_0x626e('0x51')]};}):[]};})};}})[_0x626e('0x24')](respondWithResult(_0xf3f10a,null))[_0x626e('0x40')](function(_0x1ba6d5){var _0x461cea=_0x2a04a1['query'][_0x626e('0x70')]?0x1f4:_0x1ba6d5['statusCode']||0x1f4;logger[_0x626e('0x71')](_0x626e('0x72'),'getFields',_0x461cea,JSON[_0x626e('0x64')](_0x1ba6d5));delete _0x1ba6d5['name'];if(_0x461cea===0x191){_0x461cea=0x190;}_0xf3f10a[_0x626e('0x1a')](_0x461cea)['send'](_0x2a04a1[_0x626e('0x2e')][_0x626e('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x1ba6d5[_0x626e('0x73')]}:_0x1ba6d5);});}else{var _0x3a641a=0x1f4;_0xf3f10a[_0x626e('0x1a')](_0x3a641a)[_0x626e('0x27')]({'message':_0x626e('0x74'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x569d=['format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','get_module_fields','stringify','values','module_fields','includes','label','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','SugarcrmField','Subjects','created_by','description','date_start','duration_hours','duration_minutes','parent_type','direction','username','remoteUri','slice','substring','POST'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x569d,0x174));var _0xd569=function(_0x1f2941,_0x3544ce){_0x1f2941=_0x1f2941-0x0;var _0x31e313=_0x569d[_0x1f2941];return _0x31e313;};'use strict';var emlformat=require(_0xd569('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd569('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd569('0x2'));var moment=require('moment');var BPromise=require(_0xd569('0x3'));var Mustache=require(_0xd569('0x4'));var util=require(_0xd569('0x5'));var path=require(_0xd569('0x6'));var sox=require(_0xd569('0x7'));var csv=require('to-csv');var ejs=require(_0xd569('0x8'));var fs=require('fs');var fs_extra=require(_0xd569('0x9'));var _=require('lodash');var squel=require(_0xd569('0xa'));var crypto=require(_0xd569('0xb'));var jsforce=require(_0xd569('0xc'));var deskjs=require(_0xd569('0xd'));var toCsv=require(_0xd569('0xe'));var querystring=require(_0xd569('0xf'));var Papa=require(_0xd569('0x10'));var Redis=require(_0xd569('0x11'));var authService=require(_0xd569('0x12'));var qs=require(_0xd569('0x13'));var as=require(_0xd569('0x14'));var hardwareService=require(_0xd569('0x15'));var logger=require(_0xd569('0x16'))('api');var utils=require(_0xd569('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd569('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3abb60,_0x22b24a){_0x22b24a=_0x22b24a||0xcc;return function(_0x53bb3e){if(_0x53bb3e){return _0x3abb60[_0xd569('0x19')](_0x22b24a);}return _0x3abb60[_0xd569('0x1a')](_0x22b24a)[_0xd569('0x1b')]();};}function respondWithResult(_0x416df2,_0x2625c6){_0x2625c6=_0x2625c6||0xc8;return function(_0x4a0325){if(_0x4a0325){return _0x416df2[_0xd569('0x1a')](_0x2625c6)[_0xd569('0x1c')](_0x4a0325);}};}function respondWithFilteredResult(_0x401055,_0x458d40){return function(_0x3acc41){if(_0x3acc41){var _0x40b274=typeof _0x458d40['offset']===_0xd569('0x1d')&&typeof _0x458d40[_0xd569('0x1e')]===_0xd569('0x1d');var _0x4ca1f4=_0x3acc41['count'];var _0x3b16f6=_0x40b274?0x0:_0x458d40['offset'];var _0x3ba516=_0x40b274?_0x3acc41[_0xd569('0x1f')]:_0x458d40[_0xd569('0x20')]+_0x458d40['limit'];var _0x463a4e;if(_0x3ba516>=_0x4ca1f4){_0x3ba516=_0x4ca1f4;_0x463a4e=0xc8;}else{_0x463a4e=0xce;}_0x401055['status'](_0x463a4e);return _0x401055['set'](_0xd569('0x21'),_0x3b16f6+'-'+_0x3ba516+'/'+_0x4ca1f4)[_0xd569('0x1c')](_0x3acc41);}return null;};}function patchUpdates(_0x29421d){return function(_0x19d3a7){try{jsonpatch[_0xd569('0x22')](_0x19d3a7,_0x29421d,!![]);}catch(_0x4f7df5){return BPromise[_0xd569('0x23')](_0x4f7df5);}return _0x19d3a7[_0xd569('0x24')]();};}function saveUpdates(_0x177531,_0x64f77a){return function(_0x2eea52){if(_0x2eea52){return _0x2eea52[_0xd569('0x25')](_0x177531)[_0xd569('0x26')](function(_0x30a946){return _0x30a946;});}return null;};}function removeEntity(_0x378af6,_0x27a10c){return function(_0x4c5eeb){if(_0x4c5eeb){return _0x4c5eeb[_0xd569('0x27')]()['then'](function(){_0x378af6[_0xd569('0x1a')](0xcc)[_0xd569('0x1b')]();});}};}function handleEntityNotFound(_0x1d81cd,_0x33f43c){return function(_0x2aa81b){if(!_0x2aa81b){_0x1d81cd[_0xd569('0x19')](0x194);}return _0x2aa81b;};}function handleError(_0xc0195b,_0x5299c6){_0x5299c6=_0x5299c6||0x1f4;return function(_0x5706c6){logger['error'](_0x5706c6['stack']);if(_0x5706c6[_0xd569('0x28')]){delete _0x5706c6[_0xd569('0x28')];}_0xc0195b[_0xd569('0x1a')](_0x5299c6)['send'](_0x5706c6);};}exports[_0xd569('0x29')]=function(_0x3c042c,_0x79529e){var _0x2ce787={},_0x186dbe={},_0x58d443={'count':0x0,'rows':[]};var _0x48270d=_[_0xd569('0x2a')](db[_0xd569('0x2b')][_0xd569('0x2c')],function(_0x5b293e){return{'name':_0x5b293e[_0xd569('0x2d')],'type':_0x5b293e[_0xd569('0x2e')][_0xd569('0x2f')]};});_0x186dbe[_0xd569('0x30')]=_[_0xd569('0x2a')](_0x48270d,_0xd569('0x28'));_0x186dbe[_0xd569('0x31')]=_['keys'](_0x3c042c[_0xd569('0x31')]);_0x186dbe[_0xd569('0x32')]=_['intersection'](_0x186dbe[_0xd569('0x30')],_0x186dbe[_0xd569('0x31')]);_0x2ce787[_0xd569('0x33')]=_[_0xd569('0x34')](_0x186dbe[_0xd569('0x30')],qs[_0xd569('0x35')](_0x3c042c[_0xd569('0x31')]['fields']));_0x2ce787[_0xd569('0x33')]=_0x2ce787[_0xd569('0x33')][_0xd569('0x36')]?_0x2ce787['attributes']:_0x186dbe['model'];if(!_0x3c042c[_0xd569('0x31')]['hasOwnProperty'](_0xd569('0x37'))){_0x2ce787[_0xd569('0x1e')]=qs['limit'](_0x3c042c[_0xd569('0x31')][_0xd569('0x1e')]);_0x2ce787[_0xd569('0x20')]=qs[_0xd569('0x20')](_0x3c042c[_0xd569('0x31')][_0xd569('0x20')]);}_0x2ce787[_0xd569('0x38')]=qs['sort'](_0x3c042c[_0xd569('0x31')][_0xd569('0x39')]);_0x2ce787[_0xd569('0x3a')]=qs[_0xd569('0x32')](_[_0xd569('0x3b')](_0x3c042c[_0xd569('0x31')],_0x186dbe['filters']),_0x48270d);if(_0x3c042c['query'][_0xd569('0x3c')]){_0x2ce787[_0xd569('0x3a')]=_['merge'](_0x2ce787[_0xd569('0x3a')],{'$or':_[_0xd569('0x2a')](_0x48270d,function(_0x3ae8c3){if(_0x3ae8c3['type']!==_0xd569('0x3d')){var _0x4db701={};_0x4db701[_0x3ae8c3[_0xd569('0x28')]]={'$like':'%'+_0x3c042c[_0xd569('0x31')]['filter']+'%'};return _0x4db701;}})});}_0x2ce787=_[_0xd569('0x3e')]({},_0x2ce787,_0x3c042c[_0xd569('0x3f')]);var _0x238d19={'where':_0x2ce787[_0xd569('0x3a')]};return db[_0xd569('0x2b')]['count'](_0x238d19)[_0xd569('0x26')](function(_0x152a9d){_0x58d443['count']=_0x152a9d;if(_0x3c042c[_0xd569('0x31')][_0xd569('0x40')]){_0x2ce787[_0xd569('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x2ce787);})[_0xd569('0x26')](function(_0x5c1761){_0x58d443['rows']=_0x5c1761;return _0x58d443;})[_0xd569('0x26')](respondWithFilteredResult(_0x79529e,_0x2ce787))[_0xd569('0x42')](handleError(_0x79529e,null));};exports[_0xd569('0x43')]=function(_0x114742,_0x3b80ff){var _0x4ca8d2={'raw':![],'where':{'id':_0x114742[_0xd569('0x44')]['id']}},_0x17882f={};_0x17882f[_0xd569('0x30')]=_[_0xd569('0x45')](db['SugarcrmAccount'][_0xd569('0x2c')]);_0x17882f[_0xd569('0x31')]=_[_0xd569('0x45')](_0x114742[_0xd569('0x31')]);_0x17882f[_0xd569('0x32')]=_['intersection'](_0x17882f[_0xd569('0x30')],_0x17882f[_0xd569('0x31')]);_0x4ca8d2[_0xd569('0x33')]=_['intersection'](_0x17882f[_0xd569('0x30')],qs[_0xd569('0x35')](_0x114742[_0xd569('0x31')][_0xd569('0x35')]));_0x4ca8d2[_0xd569('0x33')]=_0x4ca8d2[_0xd569('0x33')][_0xd569('0x36')]?_0x4ca8d2[_0xd569('0x33')]:_0x17882f[_0xd569('0x30')];if(_0x114742[_0xd569('0x31')][_0xd569('0x40')]){_0x4ca8d2['include']=[{'all':!![]}];}_0x4ca8d2=_[_0xd569('0x3e')]({},_0x4ca8d2,_0x114742[_0xd569('0x3f')]);return db[_0xd569('0x2b')]['find'](_0x4ca8d2)[_0xd569('0x26')](handleEntityNotFound(_0x3b80ff,null))[_0xd569('0x26')](respondWithResult(_0x3b80ff,null))[_0xd569('0x42')](handleError(_0x3b80ff,null));};exports[_0xd569('0x46')]=function(_0x4a6a3a,_0x4e129f){return db[_0xd569('0x2b')][_0xd569('0x46')](_0x4a6a3a[_0xd569('0x47')],{})[_0xd569('0x26')](respondWithResult(_0x4e129f,0xc9))['catch'](handleError(_0x4e129f,null));};exports['update']=function(_0x593bb2,_0x382bef){if(_0x593bb2[_0xd569('0x47')]['id']){delete _0x593bb2[_0xd569('0x47')]['id'];}return db['SugarcrmAccount'][_0xd569('0x48')]({'where':{'id':_0x593bb2[_0xd569('0x44')]['id']}})[_0xd569('0x26')](handleEntityNotFound(_0x382bef,null))[_0xd569('0x26')](saveUpdates(_0x593bb2[_0xd569('0x47')],null))[_0xd569('0x26')](respondWithResult(_0x382bef,null))[_0xd569('0x42')](handleError(_0x382bef,null));};exports['destroy']=function(_0x5cae16,_0x18556d){return db['SugarcrmAccount'][_0xd569('0x48')]({'where':{'id':_0x5cae16[_0xd569('0x44')]['id']}})[_0xd569('0x26')](handleEntityNotFound(_0x18556d,null))[_0xd569('0x26')](removeEntity(_0x18556d,null))[_0xd569('0x42')](handleError(_0x18556d,null));};exports[_0xd569('0x49')]=function(_0x3c5ee9,_0x47c27e,_0x4d6d9a){var _0x4b83af={};var _0x7741fb={};var _0x10fcd6;var _0x54e60d;return db[_0xd569('0x2b')][_0xd569('0x4a')]({'where':{'id':_0x3c5ee9[_0xd569('0x44')]['id']}})[_0xd569('0x26')](handleEntityNotFound(_0x47c27e,null))['then'](function(_0x1078e3){if(_0x1078e3){_0x10fcd6=_0x1078e3;_0x7741fb[_0xd569('0x30')]=_[_0xd569('0x45')](db[_0xd569('0x4b')][_0xd569('0x2c')]);_0x7741fb[_0xd569('0x31')]=_[_0xd569('0x45')](_0x3c5ee9[_0xd569('0x31')]);_0x7741fb[_0xd569('0x32')]=_[_0xd569('0x34')](_0x7741fb[_0xd569('0x30')],_0x7741fb[_0xd569('0x31')]);_0x4b83af[_0xd569('0x33')]=_[_0xd569('0x34')](_0x7741fb['model'],qs['fields'](_0x3c5ee9[_0xd569('0x31')][_0xd569('0x35')]));_0x4b83af[_0xd569('0x33')]=_0x4b83af['attributes'][_0xd569('0x36')]?_0x4b83af[_0xd569('0x33')]:_0x7741fb[_0xd569('0x30')];_0x4b83af['order']=qs[_0xd569('0x39')](_0x3c5ee9['query']['sort']);_0x4b83af[_0xd569('0x3a')]=qs[_0xd569('0x32')](_[_0xd569('0x3b')](_0x3c5ee9[_0xd569('0x31')],_0x7741fb[_0xd569('0x32')]));if(_0x3c5ee9[_0xd569('0x31')][_0xd569('0x3c')]){_0x4b83af[_0xd569('0x3a')]=_[_0xd569('0x3e')](_0x4b83af[_0xd569('0x3a')],{'$or':_[_0xd569('0x2a')](_0x4b83af['attributes'],function(_0x1af393){var _0x3bfe39={};_0x3bfe39[_0x1af393]={'$like':'%'+_0x3c5ee9[_0xd569('0x31')][_0xd569('0x3c')]+'%'};return _0x3bfe39;})});}_0x4b83af=_[_0xd569('0x3e')]({},_0x4b83af,_0x3c5ee9[_0xd569('0x3f')]);return _0x10fcd6[_0xd569('0x49')](_0x4b83af);}})[_0xd569('0x26')](function(_0x286122){if(_0x286122){_0x54e60d=_0x286122['length'];if(!_0x3c5ee9['query'][_0xd569('0x4c')](_0xd569('0x37'))){_0x4b83af['limit']=qs[_0xd569('0x1e')](_0x3c5ee9[_0xd569('0x31')]['limit']);_0x4b83af[_0xd569('0x20')]=qs[_0xd569('0x20')](_0x3c5ee9[_0xd569('0x31')]['offset']);}return _0x10fcd6[_0xd569('0x49')](_0x4b83af);}})[_0xd569('0x26')](function(_0x41f636){if(_0x41f636){return _0x41f636?{'count':_0x54e60d,'rows':_0x41f636}:null;}})[_0xd569('0x26')](respondWithResult(_0x47c27e,null))[_0xd569('0x42')](handleError(_0x47c27e,null));};exports[_0xd569('0x4d')]=function(_0x1b9c1b,_0x1d37af,_0x3e109){if(_0x1b9c1b[_0xd569('0x47')]['id']){delete _0x1b9c1b[_0xd569('0x47')]['id'];}return db[_0xd569('0x2b')]['findOne']({'where':{'id':_0x1b9c1b[_0xd569('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d37af,null))[_0xd569('0x26')](function(_0x3e695f){if(_0x3e695f){_0x1b9c1b['body'][_0xd569('0x4e')]=_0x3e695f['id'];_0x1b9c1b[_0xd569('0x47')]['Subjects']=integrations[_0xd569('0x4f')](_0x1b9c1b[_0xd569('0x47')][_0xd569('0x50')],_0x1b9c1b[_0xd569('0x47')]['type']);_0x1b9c1b[_0xd569('0x47')][_0xd569('0x51')]=integrations['getDescriptions'](_0x1b9c1b['body'][_0xd569('0x50')],_0x1b9c1b[_0xd569('0x47')][_0xd569('0x2e')]);return db['SugarcrmConfiguration'][_0xd569('0x46')](_0x1b9c1b[_0xd569('0x47')],{'include':[{'model':db[_0xd569('0x52')],'as':_0xd569('0x53')},{'model':db[_0xd569('0x52')],'as':'Descriptions'}]});}return null;})[_0xd569('0x26')](respondWithResult(_0x1d37af,null))[_0xd569('0x42')](handleError(_0x1d37af,null));};exports['getFields']=function(_0x523b03,_0x52352d,_0x189f6c){var _0x3ab3f2='';var _0x216d1e=['id',_0xd569('0x28'),'assigned_user_id',_0xd569('0x54'),_0xd569('0x55'),_0xd569('0x56'),_0xd569('0x57'),_0xd569('0x58'),'parent_id',_0xd569('0x59'),'parent_name',_0xd569('0x5a')];return db[_0xd569('0x2b')]['findOne']({'where':{'id':_0x523b03['params']['id']},'attributes':['id',_0xd569('0x5b'),'password',_0xd569('0x5c')]})[_0xd569('0x26')](handleEntityNotFound(_0x52352d,null))[_0xd569('0x26')](function(_0x311617){if(_0x311617){_0x3ab3f2=_0x311617[_0xd569('0x5c')];var _0x3dac2d=_0x3ab3f2[_0xd569('0x5d')](-0x1);if(_0x3dac2d==='/'){_0x3ab3f2=_0x3ab3f2[_0xd569('0x5e')](0x0,_0x3ab3f2['lastIndexOf'](_0x3dac2d));}return rp({'method':_0xd569('0x5f'),'uri':util[_0xd569('0x60')](_0xd569('0x61'),_0x3ab3f2,_0xd569('0x62')),'json':!![],'form':{'method':_0xd569('0x63'),'input_type':_0xd569('0x64'),'response_type':_0xd569('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x311617[_0xd569('0x5b')],'password':_0x311617[_0xd569('0x65')],'encryption':_0xd569('0x66')},'application':_0xd569('0x67')})}});}})['then'](function(_0x5d6b2e){if(_0x5d6b2e&&_0x5d6b2e['name']!=='Invalid\x20Login'&&_0x5d6b2e[_0xd569('0x28')]!=='Password\x20Expired'){return rp({'method':_0xd569('0x5f'),'uri':util[_0xd569('0x60')](_0xd569('0x61'),_0x3ab3f2,_0xd569('0x62')),'json':!![],'form':{'method':_0xd569('0x68'),'input_type':'JSON','response_type':_0xd569('0x64'),'rest_data':JSON[_0xd569('0x69')]({'session':_0x5d6b2e['id'],'module_name':'Calls'})}})[_0xd569('0x26')](function(_0x3d1dd0){if(_0x3d1dd0){var _0x91ae4f=_[_0xd569('0x6a')](_0x3d1dd0[_0xd569('0x6b')]);_['remove'](_0x91ae4f,function(_0x3644ce){return _0x216d1e[_0xd569('0x6c')](_0x3644ce['name']);});return{'count':_0x91ae4f[_0xd569('0x36')],'rows':_['map'](_0x91ae4f,function(_0x1e7c9e){return{'id':_0x1e7c9e[_0xd569('0x28')],'name':_0x1e7c9e[_0xd569('0x6d')],'custom':_['endsWith'](_0x1e7c9e[_0xd569('0x28')],'_c')?!![]:![],'options':_0x1e7c9e[_0xd569('0x3f')]?_[_0xd569('0x2a')](_[_0xd569('0x6a')](_0x1e7c9e[_0xd569('0x3f')]),function(_0x86288){return{'name':_0x86288['value'],'value':_0x86288[_0xd569('0x28')]};}):[]};})};}})['then'](respondWithResult(_0x52352d,null))[_0xd569('0x42')](function(_0x7bd9eb){var _0x460ea1=_0x523b03[_0xd569('0x31')][_0xd569('0x6e')]?0x1f4:_0x7bd9eb['statusCode']||0x1f4;logger[_0xd569('0x6f')](_0xd569('0x70'),_0xd569('0x71'),_0x460ea1,JSON['stringify'](_0x7bd9eb));delete _0x7bd9eb[_0xd569('0x28')];if(_0x460ea1===0x191){_0x460ea1=0x190;}_0x52352d[_0xd569('0x1a')](_0x460ea1)[_0xd569('0x72')](_0x523b03[_0xd569('0x31')][_0xd569('0x6e')]?{'message':_0xd569('0x73'),'statusCode':_0x7bd9eb[_0xd569('0x74')]}:_0x7bd9eb);});}else{var _0xb4e820=0x1f4;_0x52352d[_0xd569('0x1a')](_0xb4e820)['send']({'message':_0xd569('0x73'),'statusCode':0x190});}});};
\ No newline at end of file
index fc175d3..b5206cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffaf=['../../components/integrations/configuration','define','int_sugarcrm_accounts','../../config/logger','api','request-promise','path','rimraf'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0xffaf,0x1c3));var _0xfffa=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0xffaf[_0x5d61b4];return _0x183fc5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfffa('0x0'))(_0xfffa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfffa('0x2'));var fs=require('fs');var path=require(_0xfffa('0x3'));var rimraf=require(_0xfffa('0x4'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xfffa('0x5'));module['exports']=function(_0x5b8340,_0x3662d6){return _0x5b8340[_0xfffa('0x6')]('SugarcrmAccount',attributes,{'tableName':_0xfffa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf92=['SugarcrmAccount','int_sugarcrm_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x70f852,_0xe40f27){var _0x2c921c=function(_0x8f1d40){while(--_0x8f1d40){_0x70f852['push'](_0x70f852['shift']());}};_0x2c921c(++_0xe40f27);}(_0xdf92,0x10c));var _0x2df9=function(_0xa3a325,_0x538cc0){_0xa3a325=_0xa3a325-0x0;var _0x3367c6=_0xdf92[_0xa3a325];return _0x3367c6;};'use strict';var _=require(_0x2df9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2df9('0x1'));var moment=require(_0x2df9('0x2'));var BPromise=require(_0x2df9('0x3'));var rp=require(_0x2df9('0x4'));var fs=require('fs');var path=require(_0x2df9('0x5'));var rimraf=require(_0x2df9('0x6'));var config=require(_0x2df9('0x7'));var attributes=require(_0x2df9('0x8'));var integrations=require(_0x2df9('0x9'));module[_0x2df9('0xa')]=function(_0x5b6e79,_0x353f73){return _0x5b6e79[_0x2df9('0xb')](_0x2df9('0xc'),attributes,{'tableName':_0x2df9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c2f8e6..5eff2b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d40=['model','then','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','GetSugarcrmAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x36feaf,_0x38b8a0){var _0x4bbc6b=function(_0x1f8906){while(--_0x1f8906){_0x36feaf['push'](_0x36feaf['shift']());}};_0x4bbc6b(++_0x38b8a0);}(_0x3d40,0x1f1));var _0x03d4=function(_0x206ddd,_0x5bdb9e){_0x206ddd=_0x206ddd-0x0;var _0x3b8c32=_0x3d40[_0x206ddd];return _0x3b8c32;};'use strict';var _=require(_0x03d4('0x0'));var util=require(_0x03d4('0x1'));var moment=require(_0x03d4('0x2'));var BPromise=require(_0x03d4('0x3'));var rs=require(_0x03d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03d4('0x5'))['db'];var utils=require(_0x03d4('0x6'));var logger=require(_0x03d4('0x7'))(_0x03d4('0x8'));var config=require(_0x03d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x03d4('0xa')][_0x03d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb77f,_0x2379aa,_0xf8eb4a){return new BPromise(function(_0x54dcf0,_0x17b5db){return client['request'](_0x1bb77f,_0xf8eb4a)['then'](function(_0x42d371){logger[_0x03d4('0xc')](_0x03d4('0xd'),_0x2379aa,'request\x20sent');logger[_0x03d4('0xe')](_0x03d4('0xf'),_0x2379aa,_0x03d4('0x10'),JSON['stringify'](_0x42d371));if(_0x42d371[_0x03d4('0x11')]){if(_0x42d371[_0x03d4('0x11')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2379aa,_0x42d371[_0x03d4('0x11')][_0x03d4('0x12')]);return _0x17b5db(_0x42d371[_0x03d4('0x11')]['message']);}logger['error'](_0x03d4('0xd'),_0x2379aa,_0x42d371[_0x03d4('0x11')]['message']);return _0x54dcf0(_0x42d371['error']['message']);}else{logger[_0x03d4('0xc')](_0x03d4('0xd'),_0x2379aa,_0x03d4('0x10'));_0x54dcf0(_0x42d371['result'][_0x03d4('0x12')]);}})[_0x03d4('0x13')](function(_0x25119a){logger[_0x03d4('0x11')](_0x03d4('0xd'),_0x2379aa,_0x25119a);_0x17b5db(_0x25119a);});});}exports[_0x03d4('0x14')]=function(_0x32755e){var _0x3abe3e=this;return new Promise(function(_0x30d96d,_0x1823a1){return db['SugarcrmAccount'][_0x03d4('0x15')]({'raw':_0x32755e['options']?_0x32755e[_0x03d4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x32755e[_0x03d4('0x16')]?_0x32755e[_0x03d4('0x16')][_0x03d4('0x17')]||null:null,'attributes':_0x32755e[_0x03d4('0x16')]?_0x32755e['options'][_0x03d4('0x18')]||null:null,'limit':_0x32755e[_0x03d4('0x16')]?_0x32755e[_0x03d4('0x16')][_0x03d4('0x19')]||null:null,'include':_0x32755e[_0x03d4('0x16')]?_0x32755e[_0x03d4('0x16')][_0x03d4('0x1a')]?_[_0x03d4('0x1b')](_0x32755e[_0x03d4('0x16')]['include'],function(_0x46829a){return{'model':db[_0x46829a[_0x03d4('0x1c')]],'as':_0x46829a['as'],'attributes':_0x46829a['attributes'],'include':_0x46829a[_0x03d4('0x1a')]?_['map'](_0x46829a[_0x03d4('0x1a')],function(_0x20d5ac){return{'model':db[_0x20d5ac[_0x03d4('0x1c')]],'as':_0x20d5ac['as'],'attributes':_0x20d5ac[_0x03d4('0x18')],'include':_0x20d5ac[_0x03d4('0x1a')]?_[_0x03d4('0x1b')](_0x20d5ac['include'],function(_0x24d617){return{'model':db[_0x24d617[_0x03d4('0x1c')]],'as':_0x24d617['as'],'attributes':_0x24d617[_0x03d4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x03d4('0x1d')](function(_0x2338d2){logger[_0x03d4('0xc')]('GetSugarcrmAccount',_0x32755e);logger[_0x03d4('0xe')](_0x03d4('0x14'),_0x32755e,JSON[_0x03d4('0x1e')](_0x2338d2));_0x30d96d(_0x2338d2);})[_0x03d4('0x13')](function(_0x1c85c1){logger['error']('GetSugarcrmAccount',_0x1c85c1[_0x03d4('0x12')],_0x32755e);_0x1823a1(_0x3abe3e[_0x03d4('0x11')](0x1f4,_0x1c85c1[_0x03d4('0x12')]));});});};exports[_0x03d4('0x1f')]=function(_0x1dc18f){var _0x4a0c96=this;return new Promise(function(_0x1defad,_0x55f4c7){return db[_0x03d4('0x20')][_0x03d4('0x21')]({'raw':_0x1dc18f[_0x03d4('0x16')]?_0x1dc18f[_0x03d4('0x16')][_0x03d4('0x22')]===undefined?!![]:![]:!![],'where':_0x1dc18f['options']?_0x1dc18f[_0x03d4('0x16')][_0x03d4('0x17')]||null:null,'attributes':_0x1dc18f['options']?_0x1dc18f[_0x03d4('0x16')]['attributes']||null:null,'include':_0x1dc18f['options']?_0x1dc18f['options'][_0x03d4('0x1a')]?_[_0x03d4('0x1b')](_0x1dc18f[_0x03d4('0x16')]['include'],function(_0x3b337c){return{'model':db[_0x3b337c['model']],'as':_0x3b337c['as'],'attributes':_0x3b337c[_0x03d4('0x18')],'include':_0x3b337c[_0x03d4('0x1a')]?_['map'](_0x3b337c['include'],function(_0x3795e4){return{'model':db[_0x3795e4[_0x03d4('0x1c')]],'as':_0x3795e4['as'],'attributes':_0x3795e4[_0x03d4('0x18')],'include':_0x3795e4[_0x03d4('0x1a')]?_[_0x03d4('0x1b')](_0x3795e4[_0x03d4('0x1a')],function(_0x3d6c9d){return{'model':db[_0x3d6c9d['model']],'as':_0x3d6c9d['as'],'attributes':_0x3d6c9d[_0x03d4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x03d4('0x1d')](function(_0xf2c581){logger['info'](_0x03d4('0x1f'),_0x1dc18f);logger[_0x03d4('0xe')](_0x03d4('0x1f'),_0x1dc18f,JSON[_0x03d4('0x1e')](_0xf2c581));_0x1defad(_0xf2c581);})['catch'](function(_0x37e8ed){logger[_0x03d4('0x11')](_0x03d4('0x1f'),_0x37e8ed[_0x03d4('0x12')],_0x1dc18f);_0x55f4c7(_0x4a0c96[_0x03d4('0x11')](0x1f4,_0x37e8ed[_0x03d4('0x12')]));});});};
\ No newline at end of file
+var _0xe1d8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSugarcrmAccount','util','moment','bluebird','randomstring'];(function(_0x51aee0,_0x253ba6){var _0x483ac7=function(_0x2a4b13){while(--_0x2a4b13){_0x51aee0['push'](_0x51aee0['shift']());}};_0x483ac7(++_0x253ba6);}(_0xe1d8,0xce));var _0x8e1d=function(_0x214f93,_0x78bac5){_0x214f93=_0x214f93-0x0;var _0x10d891=_0xe1d8[_0x214f93];return _0x10d891;};'use strict';var _=require('lodash');var util=require(_0x8e1d('0x0'));var moment=require(_0x8e1d('0x1'));var BPromise=require(_0x8e1d('0x2'));var rs=require(_0x8e1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e1d('0x4'));var logger=require(_0x8e1d('0x5'))(_0x8e1d('0x6'));var config=require(_0x8e1d('0x7'));var jayson=require(_0x8e1d('0x8'));var client=jayson[_0x8e1d('0x9')][_0x8e1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x474851,_0xa0dfe0,_0x57f76d){return new BPromise(function(_0x1ad9ed,_0x4f81ea){return client[_0x8e1d('0xb')](_0x474851,_0x57f76d)['then'](function(_0x192a72){logger[_0x8e1d('0xc')](_0x8e1d('0xd'),_0xa0dfe0,_0x8e1d('0xe'));logger[_0x8e1d('0xf')](_0x8e1d('0x10'),_0xa0dfe0,_0x8e1d('0xe'),JSON[_0x8e1d('0x11')](_0x192a72));if(_0x192a72[_0x8e1d('0x12')]){if(_0x192a72[_0x8e1d('0x12')][_0x8e1d('0x13')]===0x1f4){logger[_0x8e1d('0x12')](_0x8e1d('0xd'),_0xa0dfe0,_0x192a72[_0x8e1d('0x12')][_0x8e1d('0x14')]);return _0x4f81ea(_0x192a72[_0x8e1d('0x12')]['message']);}logger['error'](_0x8e1d('0xd'),_0xa0dfe0,_0x192a72[_0x8e1d('0x12')][_0x8e1d('0x14')]);return _0x1ad9ed(_0x192a72[_0x8e1d('0x12')][_0x8e1d('0x14')]);}else{logger['info'](_0x8e1d('0xd'),_0xa0dfe0,'request\x20sent');_0x1ad9ed(_0x192a72['result'][_0x8e1d('0x14')]);}})[_0x8e1d('0x15')](function(_0x2dd0bb){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0xa0dfe0,_0x2dd0bb);_0x4f81ea(_0x2dd0bb);});});}exports[_0x8e1d('0x16')]=function(_0x436e6d){var _0x47565c=this;return new Promise(function(_0x224616,_0x51ac07){return db[_0x8e1d('0x17')][_0x8e1d('0x18')]({'raw':_0x436e6d['options']?_0x436e6d[_0x8e1d('0x19')][_0x8e1d('0x1a')]===undefined?!![]:![]:!![],'where':_0x436e6d[_0x8e1d('0x19')]?_0x436e6d[_0x8e1d('0x19')][_0x8e1d('0x1b')]||null:null,'attributes':_0x436e6d[_0x8e1d('0x19')]?_0x436e6d[_0x8e1d('0x19')][_0x8e1d('0x1c')]||null:null,'limit':_0x436e6d[_0x8e1d('0x19')]?_0x436e6d[_0x8e1d('0x19')][_0x8e1d('0x1d')]||null:null,'include':_0x436e6d[_0x8e1d('0x19')]?_0x436e6d[_0x8e1d('0x19')][_0x8e1d('0x1e')]?_['map'](_0x436e6d[_0x8e1d('0x19')][_0x8e1d('0x1e')],function(_0x328a94){return{'model':db[_0x328a94['model']],'as':_0x328a94['as'],'attributes':_0x328a94['attributes'],'include':_0x328a94[_0x8e1d('0x1e')]?_[_0x8e1d('0x1f')](_0x328a94[_0x8e1d('0x1e')],function(_0x927022){return{'model':db[_0x927022[_0x8e1d('0x20')]],'as':_0x927022['as'],'attributes':_0x927022[_0x8e1d('0x1c')],'include':_0x927022[_0x8e1d('0x1e')]?_[_0x8e1d('0x1f')](_0x927022[_0x8e1d('0x1e')],function(_0x7263a9){return{'model':db[_0x7263a9['model']],'as':_0x7263a9['as'],'attributes':_0x7263a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e1d('0x21')](function(_0x475689){logger[_0x8e1d('0xc')](_0x8e1d('0x16'),_0x436e6d);logger[_0x8e1d('0xf')](_0x8e1d('0x16'),_0x436e6d,JSON[_0x8e1d('0x11')](_0x475689));_0x224616(_0x475689);})[_0x8e1d('0x15')](function(_0x389f51){logger[_0x8e1d('0x12')](_0x8e1d('0x16'),_0x389f51[_0x8e1d('0x14')],_0x436e6d);_0x51ac07(_0x47565c[_0x8e1d('0x12')](0x1f4,_0x389f51[_0x8e1d('0x14')]));});});};exports[_0x8e1d('0x22')]=function(_0x24769a){var _0x161a5b=this;return new Promise(function(_0x62c0d9,_0x401a54){return db[_0x8e1d('0x17')]['find']({'raw':_0x24769a[_0x8e1d('0x19')]?_0x24769a[_0x8e1d('0x19')][_0x8e1d('0x1a')]===undefined?!![]:![]:!![],'where':_0x24769a[_0x8e1d('0x19')]?_0x24769a['options'][_0x8e1d('0x1b')]||null:null,'attributes':_0x24769a[_0x8e1d('0x19')]?_0x24769a[_0x8e1d('0x19')][_0x8e1d('0x1c')]||null:null,'include':_0x24769a[_0x8e1d('0x19')]?_0x24769a[_0x8e1d('0x19')][_0x8e1d('0x1e')]?_['map'](_0x24769a[_0x8e1d('0x19')]['include'],function(_0xc570ee){return{'model':db[_0xc570ee[_0x8e1d('0x20')]],'as':_0xc570ee['as'],'attributes':_0xc570ee[_0x8e1d('0x1c')],'include':_0xc570ee[_0x8e1d('0x1e')]?_['map'](_0xc570ee[_0x8e1d('0x1e')],function(_0x100ea7){return{'model':db[_0x100ea7['model']],'as':_0x100ea7['as'],'attributes':_0x100ea7['attributes'],'include':_0x100ea7[_0x8e1d('0x1e')]?_[_0x8e1d('0x1f')](_0x100ea7[_0x8e1d('0x1e')],function(_0xa40aa0){return{'model':db[_0xa40aa0[_0x8e1d('0x20')]],'as':_0xa40aa0['as'],'attributes':_0xa40aa0[_0x8e1d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8e1d('0x21')](function(_0x3b05db){logger[_0x8e1d('0xc')](_0x8e1d('0x22'),_0x24769a);logger['debug'](_0x8e1d('0x22'),_0x24769a,JSON[_0x8e1d('0x11')](_0x3b05db));_0x62c0d9(_0x3b05db);})['catch'](function(_0x2b5710){logger['error'](_0x8e1d('0x22'),_0x2b5710[_0x8e1d('0x14')],_0x24769a);_0x401a54(_0x161a5b[_0x8e1d('0x12')](0x1f4,_0x2b5710[_0x8e1d('0x14')]));});});};
\ No newline at end of file
index 662fcb8..42b8b9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df7=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6df7,0x171));var _0x76df=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x6df7[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x76df('0x0'));var util=require(_0x76df('0x1'));var path=require(_0x76df('0x2'));var timeout=require('connect-timeout');var express=require(_0x76df('0x3'));var router=express['Router']();var fs_extra=require(_0x76df('0x4'));var auth=require(_0x76df('0x5'));var interaction=require(_0x76df('0x6'));var config=require(_0x76df('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x76df('0x8')]('/',auth[_0x76df('0x9')](),controller[_0x76df('0xa')]);router[_0x76df('0x8')](_0x76df('0xb'),auth[_0x76df('0x9')](),controller[_0x76df('0xc')]);router['get'](_0x76df('0xd'),auth[_0x76df('0x9')](),controller[_0x76df('0xe')]);router[_0x76df('0x8')](_0x76df('0xf'),auth[_0x76df('0x9')](),controller[_0x76df('0x10')]);router['get'](_0x76df('0x11'),auth[_0x76df('0x9')](),controller[_0x76df('0x12')]);router['post']('/',auth[_0x76df('0x9')](),controller[_0x76df('0x13')]);router[_0x76df('0x14')](_0x76df('0xb'),auth[_0x76df('0x9')](),controller[_0x76df('0x15')]);router['delete'](_0x76df('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x76df('0x16')]=router;
\ No newline at end of file
+var _0xef96=['/:id','isAuthenticated','show','/:id/fields','getSubjects','getDescriptions','post','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index'];(function(_0x4e6c5f,_0x3ea7bb){var _0x3dafbd=function(_0x11acbd){while(--_0x11acbd){_0x4e6c5f['push'](_0x4e6c5f['shift']());}};_0x3dafbd(++_0x3ea7bb);}(_0xef96,0xb3));var _0x6ef9=function(_0x1c35c9,_0x5b1e75){_0x1c35c9=_0x1c35c9-0x0;var _0x2d9209=_0xef96[_0x1c35c9];return _0x2d9209;};'use strict';var multer=require('multer');var util=require(_0x6ef9('0x0'));var path=require(_0x6ef9('0x1'));var timeout=require(_0x6ef9('0x2'));var express=require('express');var router=express[_0x6ef9('0x3')]();var fs_extra=require(_0x6ef9('0x4'));var auth=require(_0x6ef9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ef9('0x6'));var controller=require(_0x6ef9('0x7'));router[_0x6ef9('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ef9('0x9')]);router[_0x6ef9('0x8')](_0x6ef9('0xa'),auth[_0x6ef9('0xb')](),controller[_0x6ef9('0xc')]);router['get'](_0x6ef9('0xd'),auth[_0x6ef9('0xb')](),controller['getFields']);router[_0x6ef9('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x6ef9('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6ef9('0xf')]);router[_0x6ef9('0x10')]('/',auth[_0x6ef9('0xb')](),controller['create']);router[_0x6ef9('0x11')](_0x6ef9('0xa'),auth[_0x6ef9('0xb')](),controller[_0x6ef9('0x12')]);router[_0x6ef9('0x13')](_0x6ef9('0xa'),auth['isAuthenticated'](),controller[_0x6ef9('0x14')]);module['exports']=router;
\ No newline at end of file
index e94fcde..7595390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee0=['STRING','sequelize'];(function(_0x2ed1cf,_0x4c9d9b){var _0x16c0f0=function(_0x3647c9){while(--_0x3647c9){_0x2ed1cf['push'](_0x2ed1cf['shift']());}};_0x16c0f0(++_0x4c9d9b);}(_0xaee0,0x19f));var _0x0aee=function(_0x26b3be,_0x71dc78){_0x26b3be=_0x26b3be-0x0;var _0x12379e=_0xaee0[_0x26b3be];return _0x12379e;};'use strict';var Sequelize=require(_0x0aee('0x0'));module['exports']={'name':{'type':Sequelize[_0x0aee('0x1')]},'description':{'type':Sequelize[_0x0aee('0x1')]}};
\ No newline at end of file
+var _0xdfb3=['sequelize','exports','STRING'];(function(_0x15cef4,_0x448b97){var _0x384430=function(_0x38ebce){while(--_0x38ebce){_0x15cef4['push'](_0x15cef4['shift']());}};_0x384430(++_0x448b97);}(_0xdfb3,0x6f));var _0x3dfb=function(_0x146ac6,_0x1f34bf){_0x146ac6=_0x146ac6-0x0;var _0x2892bd=_0xdfb3[_0x146ac6];return _0x2892bd;};'use strict';var Sequelize=require(_0x3dfb('0x0'));module[_0x3dfb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3dfb('0x2')]}};
\ No newline at end of file
index ffbbf07..9ea07e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf01a=['SugarcrmField','sort','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','options','SugarcrmConfiguration','rows','catch','show','params','keys','include','find','create','body','destroy','getFields'];(function(_0x296402,_0x44efc3){var _0x4f30b7=function(_0x4b6727){while(--_0x4b6727){_0x296402['push'](_0x296402['shift']());}};_0x4f30b7(++_0x44efc3);}(_0xf01a,0xf0));var _0xaf01=function(_0x2f4a3e,_0x4f751c){_0x2f4a3e=_0x2f4a3e-0x0;var _0x556341=_0xf01a[_0x2f4a3e];return _0x556341;};'use strict';var emlformat=require(_0xaf01('0x0'));var rimraf=require(_0xaf01('0x1'));var zipdir=require(_0xaf01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaf01('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaf01('0x4'));var util=require(_0xaf01('0x5'));var path=require(_0xaf01('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf01('0x7'));var fs=require('fs');var fs_extra=require(_0xaf01('0x8'));var _=require(_0xaf01('0x9'));var squel=require(_0xaf01('0xa'));var crypto=require(_0xaf01('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaf01('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaf01('0xd'));var Papa=require(_0xaf01('0xe'));var Redis=require('ioredis');var authService=require(_0xaf01('0xf'));var qs=require(_0xaf01('0x10'));var as=require(_0xaf01('0x11'));var hardwareService=require(_0xaf01('0x12'));var logger=require(_0xaf01('0x13'))(_0xaf01('0x14'));var utils=require(_0xaf01('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf01('0x16'));var db=require(_0xaf01('0x17'))['db'];function respondWithStatusCode(_0xff4e24,_0x1233c0){_0x1233c0=_0x1233c0||0xcc;return function(_0x4f6556){if(_0x4f6556){return _0xff4e24[_0xaf01('0x18')](_0x1233c0);}return _0xff4e24['status'](_0x1233c0)[_0xaf01('0x19')]();};}function respondWithResult(_0x12b0c0,_0x3933ed){_0x3933ed=_0x3933ed||0xc8;return function(_0x40fd04){if(_0x40fd04){return _0x12b0c0[_0xaf01('0x1a')](_0x3933ed)['json'](_0x40fd04);}};}function respondWithFilteredResult(_0x5cb665,_0x2ee926){return function(_0x10bb91){if(_0x10bb91){var _0x8be082=typeof _0x2ee926['offset']==='undefined'&&typeof _0x2ee926[_0xaf01('0x1b')]===_0xaf01('0x1c');var _0x172d78=_0x10bb91[_0xaf01('0x1d')];var _0x4a1605=_0x8be082?0x0:_0x2ee926[_0xaf01('0x1e')];var _0x3a128c=_0x8be082?_0x10bb91['count']:_0x2ee926['offset']+_0x2ee926['limit'];var _0x27f462;if(_0x3a128c>=_0x172d78){_0x3a128c=_0x172d78;_0x27f462=0xc8;}else{_0x27f462=0xce;}_0x5cb665['status'](_0x27f462);return _0x5cb665[_0xaf01('0x1f')](_0xaf01('0x20'),_0x4a1605+'-'+_0x3a128c+'/'+_0x172d78)[_0xaf01('0x21')](_0x10bb91);}return null;};}function patchUpdates(_0x1ec673){return function(_0x4c7f8b){try{jsonpatch[_0xaf01('0x22')](_0x4c7f8b,_0x1ec673,!![]);}catch(_0x58c8ab){return BPromise[_0xaf01('0x23')](_0x58c8ab);}return _0x4c7f8b['save']();};}function saveUpdates(_0x4e8479,_0x41bd75){return function(_0xac3040){if(_0xac3040){return _0xac3040[_0xaf01('0x24')](_0x4e8479)[_0xaf01('0x25')](function(_0x13e830){return _0x13e830;});}return null;};}function removeEntity(_0x2269f1,_0x2094e1){return function(_0x30ace8){if(_0x30ace8){return _0x30ace8['destroy']()[_0xaf01('0x25')](function(){_0x2269f1[_0xaf01('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f593a,_0xad8793){return function(_0x10a3d3){if(!_0x10a3d3){_0x3f593a['sendStatus'](0x194);}return _0x10a3d3;};}function handleError(_0x575f62,_0xddc421){_0xddc421=_0xddc421||0x1f4;return function(_0x58021b){logger[_0xaf01('0x26')](_0x58021b['stack']);if(_0x58021b[_0xaf01('0x27')]){delete _0x58021b[_0xaf01('0x27')];}_0x575f62[_0xaf01('0x1a')](_0xddc421)[_0xaf01('0x28')](_0x58021b);};}exports['index']=function(_0x25438d,_0xe8e84d){var _0x58aabe={},_0x165a8b={},_0x391503={'count':0x0,'rows':[]};var _0x57c619=_[_0xaf01('0x29')](db['SugarcrmConfiguration'][_0xaf01('0x2a')],function(_0x101bac){return{'name':_0x101bac[_0xaf01('0x2b')],'type':_0x101bac[_0xaf01('0x2c')][_0xaf01('0x2d')]};});_0x165a8b[_0xaf01('0x2e')]=_[_0xaf01('0x29')](_0x57c619,'name');_0x165a8b[_0xaf01('0x2f')]=_['keys'](_0x25438d['query']);_0x165a8b[_0xaf01('0x30')]=_[_0xaf01('0x31')](_0x165a8b[_0xaf01('0x2e')],_0x165a8b[_0xaf01('0x2f')]);_0x58aabe['attributes']=_[_0xaf01('0x31')](_0x165a8b['model'],qs[_0xaf01('0x32')](_0x25438d[_0xaf01('0x2f')][_0xaf01('0x32')]));_0x58aabe[_0xaf01('0x33')]=_0x58aabe['attributes'][_0xaf01('0x34')]?_0x58aabe[_0xaf01('0x33')]:_0x165a8b['model'];if(!_0x25438d[_0xaf01('0x2f')]['hasOwnProperty'](_0xaf01('0x35'))){_0x58aabe[_0xaf01('0x1b')]=qs[_0xaf01('0x1b')](_0x25438d['query'][_0xaf01('0x1b')]);_0x58aabe['offset']=qs[_0xaf01('0x1e')](_0x25438d[_0xaf01('0x2f')][_0xaf01('0x1e')]);}_0x58aabe[_0xaf01('0x36')]=qs['sort'](_0x25438d['query']['sort']);_0x58aabe[_0xaf01('0x37')]=qs[_0xaf01('0x30')](_[_0xaf01('0x38')](_0x25438d[_0xaf01('0x2f')],_0x165a8b['filters']),_0x57c619);if(_0x25438d[_0xaf01('0x2f')][_0xaf01('0x39')]){_0x58aabe[_0xaf01('0x37')]=_['merge'](_0x58aabe[_0xaf01('0x37')],{'$or':_[_0xaf01('0x29')](_0x57c619,function(_0x49ba50){if(_0x49ba50[_0xaf01('0x2c')]!=='VIRTUAL'){var _0x2db4ed={};_0x2db4ed[_0x49ba50[_0xaf01('0x27')]]={'$like':'%'+_0x25438d['query']['filter']+'%'};return _0x2db4ed;}})});}_0x58aabe=_[_0xaf01('0x3a')]({},_0x58aabe,_0x25438d[_0xaf01('0x3b')]);var _0x3bfcab={'where':_0x58aabe[_0xaf01('0x37')]};return db[_0xaf01('0x3c')]['count'](_0x3bfcab)[_0xaf01('0x25')](function(_0x560e1d){_0x391503[_0xaf01('0x1d')]=_0x560e1d;if(_0x25438d[_0xaf01('0x2f')]['includeAll']){_0x58aabe['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x58aabe);})[_0xaf01('0x25')](function(_0x1daf41){_0x391503[_0xaf01('0x3d')]=_0x1daf41;return _0x391503;})[_0xaf01('0x25')](respondWithFilteredResult(_0xe8e84d,_0x58aabe))[_0xaf01('0x3e')](handleError(_0xe8e84d,null));};exports[_0xaf01('0x3f')]=function(_0x535fdb,_0x2b5c63){var _0x174614={'raw':![],'where':{'id':_0x535fdb[_0xaf01('0x40')]['id']}},_0x1d8e48={};_0x1d8e48['model']=_[_0xaf01('0x41')](db[_0xaf01('0x3c')][_0xaf01('0x2a')]);_0x1d8e48['query']=_[_0xaf01('0x41')](_0x535fdb['query']);_0x1d8e48['filters']=_['intersection'](_0x1d8e48[_0xaf01('0x2e')],_0x1d8e48[_0xaf01('0x2f')]);_0x174614['attributes']=_[_0xaf01('0x31')](_0x1d8e48[_0xaf01('0x2e')],qs[_0xaf01('0x32')](_0x535fdb['query'][_0xaf01('0x32')]));_0x174614[_0xaf01('0x33')]=_0x174614[_0xaf01('0x33')]['length']?_0x174614[_0xaf01('0x33')]:_0x1d8e48[_0xaf01('0x2e')];if(_0x535fdb['query']['includeAll']){_0x174614[_0xaf01('0x42')]=[{'all':!![]}];}_0x174614=_[_0xaf01('0x3a')]({},_0x174614,_0x535fdb['options']);return db[_0xaf01('0x3c')][_0xaf01('0x43')](_0x174614)[_0xaf01('0x25')](handleEntityNotFound(_0x2b5c63,null))[_0xaf01('0x25')](respondWithResult(_0x2b5c63,null))[_0xaf01('0x3e')](handleError(_0x2b5c63,null));};exports[_0xaf01('0x44')]=function(_0x2353c2,_0x20e9c4){return db[_0xaf01('0x3c')][_0xaf01('0x44')](_0x2353c2[_0xaf01('0x45')],{})['then'](respondWithResult(_0x20e9c4,0xc9))['catch'](handleError(_0x20e9c4,null));};exports[_0xaf01('0x24')]=function(_0x345c67,_0x44df6d){if(_0x345c67[_0xaf01('0x45')]['id']){delete _0x345c67[_0xaf01('0x45')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x345c67[_0xaf01('0x40')]['id']}})[_0xaf01('0x25')](handleEntityNotFound(_0x44df6d,null))[_0xaf01('0x25')](saveUpdates(_0x345c67['body'],null))[_0xaf01('0x25')](respondWithResult(_0x44df6d,null))[_0xaf01('0x3e')](handleError(_0x44df6d,null));};exports[_0xaf01('0x46')]=function(_0x3a50cc,_0x1a214d){return db[_0xaf01('0x3c')][_0xaf01('0x43')]({'where':{'id':_0x3a50cc['params']['id']}})['then'](handleEntityNotFound(_0x1a214d,null))[_0xaf01('0x25')](removeEntity(_0x1a214d,null))[_0xaf01('0x3e')](handleError(_0x1a214d,null));};exports[_0xaf01('0x47')]=function(_0x485c8f,_0x37f910,_0x37f903){var _0xb3c788={};var _0x22df19={};var _0x3f734d;var _0x2c6618;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x485c8f['params']['id']}})['then'](handleEntityNotFound(_0x37f910,null))[_0xaf01('0x25')](function(_0x93422f){if(_0x93422f){_0x3f734d=_0x93422f;_0x22df19['model']=_[_0xaf01('0x41')](db[_0xaf01('0x48')][_0xaf01('0x2a')]);_0x22df19[_0xaf01('0x2f')]=_[_0xaf01('0x41')](_0x485c8f['query']);_0x22df19[_0xaf01('0x30')]=_[_0xaf01('0x31')](_0x22df19[_0xaf01('0x2e')],_0x22df19[_0xaf01('0x2f')]);_0xb3c788[_0xaf01('0x33')]=_[_0xaf01('0x31')](_0x22df19['model'],qs[_0xaf01('0x32')](_0x485c8f[_0xaf01('0x2f')]['fields']));_0xb3c788[_0xaf01('0x33')]=_0xb3c788[_0xaf01('0x33')][_0xaf01('0x34')]?_0xb3c788[_0xaf01('0x33')]:_0x22df19[_0xaf01('0x2e')];_0xb3c788['order']=qs[_0xaf01('0x49')](_0x485c8f[_0xaf01('0x2f')][_0xaf01('0x49')]);_0xb3c788[_0xaf01('0x37')]=qs[_0xaf01('0x30')](_['pick'](_0x485c8f['query'],_0x22df19[_0xaf01('0x30')]));if(_0x485c8f[_0xaf01('0x2f')]['filter']){_0xb3c788[_0xaf01('0x37')]=_[_0xaf01('0x3a')](_0xb3c788[_0xaf01('0x37')],{'$or':_[_0xaf01('0x29')](_0xb3c788[_0xaf01('0x33')],function(_0x926fc8){var _0x5069b1={};_0x5069b1[_0x926fc8]={'$like':'%'+_0x485c8f[_0xaf01('0x2f')]['filter']+'%'};return _0x5069b1;})});}_0xb3c788=_[_0xaf01('0x3a')]({},_0xb3c788,_0x485c8f['options']);return _0x3f734d[_0xaf01('0x47')](_0xb3c788);}})[_0xaf01('0x25')](function(_0x2bcd9b){if(_0x2bcd9b){_0x2c6618=_0x2bcd9b[_0xaf01('0x34')];if(!_0x485c8f[_0xaf01('0x2f')][_0xaf01('0x4a')](_0xaf01('0x35'))){_0xb3c788[_0xaf01('0x1b')]=qs[_0xaf01('0x1b')](_0x485c8f[_0xaf01('0x2f')][_0xaf01('0x1b')]);_0xb3c788['offset']=qs[_0xaf01('0x1e')](_0x485c8f['query'][_0xaf01('0x1e')]);}return _0x3f734d[_0xaf01('0x47')](_0xb3c788);}})['then'](function(_0x1398a9){if(_0x1398a9){return _0x1398a9?{'count':_0x2c6618,'rows':_0x1398a9}:null;}})[_0xaf01('0x25')](respondWithResult(_0x37f910,null))[_0xaf01('0x3e')](handleError(_0x37f910,null));};exports[_0xaf01('0x4b')]=function(_0x35e8d6,_0x2ca9de,_0x95d858){var _0x4ce145={};var _0x3928f3={};var _0xda9d84;var _0x52fc35;return db['SugarcrmConfiguration'][_0xaf01('0x4c')]({'where':{'id':_0x35e8d6[_0xaf01('0x40')]['id']}})[_0xaf01('0x25')](handleEntityNotFound(_0x2ca9de,null))[_0xaf01('0x25')](function(_0x5e02ef){if(_0x5e02ef){_0xda9d84=_0x5e02ef;_0x3928f3[_0xaf01('0x2e')]=_[_0xaf01('0x41')](db[_0xaf01('0x48')][_0xaf01('0x2a')]);_0x3928f3['query']=_[_0xaf01('0x41')](_0x35e8d6[_0xaf01('0x2f')]);_0x3928f3[_0xaf01('0x30')]=_['intersection'](_0x3928f3[_0xaf01('0x2e')],_0x3928f3[_0xaf01('0x2f')]);_0x4ce145[_0xaf01('0x33')]=_[_0xaf01('0x31')](_0x3928f3[_0xaf01('0x2e')],qs['fields'](_0x35e8d6[_0xaf01('0x2f')][_0xaf01('0x32')]));_0x4ce145[_0xaf01('0x33')]=_0x4ce145[_0xaf01('0x33')]['length']?_0x4ce145['attributes']:_0x3928f3[_0xaf01('0x2e')];_0x4ce145['order']=qs[_0xaf01('0x49')](_0x35e8d6[_0xaf01('0x2f')][_0xaf01('0x49')]);_0x4ce145[_0xaf01('0x37')]=qs[_0xaf01('0x30')](_[_0xaf01('0x38')](_0x35e8d6[_0xaf01('0x2f')],_0x3928f3['filters']));if(_0x35e8d6[_0xaf01('0x2f')]['filter']){_0x4ce145[_0xaf01('0x37')]=_[_0xaf01('0x3a')](_0x4ce145[_0xaf01('0x37')],{'$or':_[_0xaf01('0x29')](_0x4ce145[_0xaf01('0x33')],function(_0x2a29b1){var _0x1d890e={};_0x1d890e[_0x2a29b1]={'$like':'%'+_0x35e8d6[_0xaf01('0x2f')][_0xaf01('0x39')]+'%'};return _0x1d890e;})});}_0x4ce145=_['merge']({},_0x4ce145,_0x35e8d6[_0xaf01('0x3b')]);return _0xda9d84[_0xaf01('0x4b')](_0x4ce145);}})[_0xaf01('0x25')](function(_0xaa8a16){if(_0xaa8a16){_0x52fc35=_0xaa8a16[_0xaf01('0x34')];if(!_0x35e8d6['query'][_0xaf01('0x4a')](_0xaf01('0x35'))){_0x4ce145[_0xaf01('0x1b')]=qs[_0xaf01('0x1b')](_0x35e8d6[_0xaf01('0x2f')][_0xaf01('0x1b')]);_0x4ce145[_0xaf01('0x1e')]=qs[_0xaf01('0x1e')](_0x35e8d6['query']['offset']);}return _0xda9d84['getSubjects'](_0x4ce145);}})[_0xaf01('0x25')](function(_0x2b1feb){if(_0x2b1feb){return _0x2b1feb?{'count':_0x52fc35,'rows':_0x2b1feb}:null;}})[_0xaf01('0x25')](respondWithResult(_0x2ca9de,null))[_0xaf01('0x3e')](handleError(_0x2ca9de,null));};exports[_0xaf01('0x4d')]=function(_0x3e5cf6,_0x1f2cb2,_0x57f50d){var _0x32d4e1={};var _0x13f57b={};var _0x31733f;var _0x5d9d05;return db[_0xaf01('0x3c')][_0xaf01('0x4c')]({'where':{'id':_0x3e5cf6[_0xaf01('0x40')]['id']}})[_0xaf01('0x25')](handleEntityNotFound(_0x1f2cb2,null))['then'](function(_0x551769){if(_0x551769){_0x31733f=_0x551769;_0x13f57b[_0xaf01('0x2e')]=_[_0xaf01('0x41')](db['SugarcrmField']['rawAttributes']);_0x13f57b[_0xaf01('0x2f')]=_[_0xaf01('0x41')](_0x3e5cf6[_0xaf01('0x2f')]);_0x13f57b['filters']=_[_0xaf01('0x31')](_0x13f57b[_0xaf01('0x2e')],_0x13f57b[_0xaf01('0x2f')]);_0x32d4e1[_0xaf01('0x33')]=_[_0xaf01('0x31')](_0x13f57b[_0xaf01('0x2e')],qs['fields'](_0x3e5cf6[_0xaf01('0x2f')][_0xaf01('0x32')]));_0x32d4e1['attributes']=_0x32d4e1['attributes'][_0xaf01('0x34')]?_0x32d4e1[_0xaf01('0x33')]:_0x13f57b[_0xaf01('0x2e')];_0x32d4e1[_0xaf01('0x36')]=qs['sort'](_0x3e5cf6[_0xaf01('0x2f')]['sort']);_0x32d4e1[_0xaf01('0x37')]=qs['filters'](_['pick'](_0x3e5cf6[_0xaf01('0x2f')],_0x13f57b[_0xaf01('0x30')]));if(_0x3e5cf6[_0xaf01('0x2f')][_0xaf01('0x39')]){_0x32d4e1[_0xaf01('0x37')]=_[_0xaf01('0x3a')](_0x32d4e1['where'],{'$or':_['map'](_0x32d4e1[_0xaf01('0x33')],function(_0x857b38){var _0x51160b={};_0x51160b[_0x857b38]={'$like':'%'+_0x3e5cf6[_0xaf01('0x2f')][_0xaf01('0x39')]+'%'};return _0x51160b;})});}_0x32d4e1=_[_0xaf01('0x3a')]({},_0x32d4e1,_0x3e5cf6[_0xaf01('0x3b')]);return _0x31733f[_0xaf01('0x4d')](_0x32d4e1);}})[_0xaf01('0x25')](function(_0x5e3743){if(_0x5e3743){_0x5d9d05=_0x5e3743[_0xaf01('0x34')];if(!_0x3e5cf6['query'][_0xaf01('0x4a')](_0xaf01('0x35'))){_0x32d4e1[_0xaf01('0x1b')]=qs[_0xaf01('0x1b')](_0x3e5cf6[_0xaf01('0x2f')][_0xaf01('0x1b')]);_0x32d4e1[_0xaf01('0x1e')]=qs[_0xaf01('0x1e')](_0x3e5cf6[_0xaf01('0x2f')][_0xaf01('0x1e')]);}return _0x31733f[_0xaf01('0x4d')](_0x32d4e1);}})[_0xaf01('0x25')](function(_0x9d4611){if(_0x9d4611){return _0x9d4611?{'count':_0x5d9d05,'rows':_0x9d4611}:null;}})[_0xaf01('0x25')](respondWithResult(_0x1f2cb2,null))[_0xaf01('0x3e')](handleError(_0x1f2cb2,null));};
\ No newline at end of file
+var _0xcf7a=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','SugarcrmConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','offset','sort','filters','where','merge','includeAll','include','findAll','show','params','fields','options','find','catch','create','body','destroy','getFields','findOne','pick','filter','getSubjects','SugarcrmField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','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'];(function(_0x28d6e0,_0x4d0a2c){var _0x41048b=function(_0x4d29e2){while(--_0x4d29e2){_0x28d6e0['push'](_0x28d6e0['shift']());}};_0x41048b(++_0x4d0a2c);}(_0xcf7a,0x1da));var _0xacf7=function(_0x4d2987,_0x7e3a05){_0x4d2987=_0x4d2987-0x0;var _0x16a790=_0xcf7a[_0x4d2987];return _0x16a790;};'use strict';var emlformat=require(_0xacf7('0x0'));var rimraf=require(_0xacf7('0x1'));var zipdir=require(_0xacf7('0x2'));var jsonpatch=require(_0xacf7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xacf7('0x4'));var Mustache=require(_0xacf7('0x5'));var util=require(_0xacf7('0x6'));var path=require(_0xacf7('0x7'));var sox=require(_0xacf7('0x8'));var csv=require(_0xacf7('0x9'));var ejs=require(_0xacf7('0xa'));var fs=require('fs');var fs_extra=require(_0xacf7('0xb'));var _=require(_0xacf7('0xc'));var squel=require(_0xacf7('0xd'));var crypto=require(_0xacf7('0xe'));var jsforce=require(_0xacf7('0xf'));var deskjs=require(_0xacf7('0x10'));var toCsv=require(_0xacf7('0x9'));var querystring=require(_0xacf7('0x11'));var Papa=require(_0xacf7('0x12'));var Redis=require(_0xacf7('0x13'));var authService=require(_0xacf7('0x14'));var qs=require(_0xacf7('0x15'));var as=require(_0xacf7('0x16'));var hardwareService=require(_0xacf7('0x17'));var logger=require(_0xacf7('0x18'))(_0xacf7('0x19'));var utils=require(_0xacf7('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xacf7('0x1b'));var db=require(_0xacf7('0x1c'))['db'];function respondWithStatusCode(_0x1c8832,_0x5260e6){_0x5260e6=_0x5260e6||0xcc;return function(_0x2f7b64){if(_0x2f7b64){return _0x1c8832[_0xacf7('0x1d')](_0x5260e6);}return _0x1c8832[_0xacf7('0x1e')](_0x5260e6)[_0xacf7('0x1f')]();};}function respondWithResult(_0x12378e,_0x4e1402){_0x4e1402=_0x4e1402||0xc8;return function(_0x531d6e){if(_0x531d6e){return _0x12378e[_0xacf7('0x1e')](_0x4e1402)[_0xacf7('0x20')](_0x531d6e);}};}function respondWithFilteredResult(_0x6880a2,_0x546ca8){return function(_0x405f11){if(_0x405f11){var _0x53af4c=typeof _0x546ca8['offset']===_0xacf7('0x21')&&typeof _0x546ca8[_0xacf7('0x22')]==='undefined';var _0x468603=_0x405f11[_0xacf7('0x23')];var _0x565f28=_0x53af4c?0x0:_0x546ca8['offset'];var _0x2438e3=_0x53af4c?_0x405f11[_0xacf7('0x23')]:_0x546ca8['offset']+_0x546ca8[_0xacf7('0x22')];var _0x44df66;if(_0x2438e3>=_0x468603){_0x2438e3=_0x468603;_0x44df66=0xc8;}else{_0x44df66=0xce;}_0x6880a2[_0xacf7('0x1e')](_0x44df66);return _0x6880a2[_0xacf7('0x24')](_0xacf7('0x25'),_0x565f28+'-'+_0x2438e3+'/'+_0x468603)[_0xacf7('0x20')](_0x405f11);}return null;};}function patchUpdates(_0x1ef06c){return function(_0xeb87ee){try{jsonpatch[_0xacf7('0x26')](_0xeb87ee,_0x1ef06c,!![]);}catch(_0x6ac82f){return BPromise[_0xacf7('0x27')](_0x6ac82f);}return _0xeb87ee[_0xacf7('0x28')]();};}function saveUpdates(_0x2ebb26,_0x2f61cb){return function(_0x2a5903){if(_0x2a5903){return _0x2a5903[_0xacf7('0x29')](_0x2ebb26)[_0xacf7('0x2a')](function(_0xee9f85){return _0xee9f85;});}return null;};}function removeEntity(_0x27668e,_0x471b27){return function(_0x55c74d){if(_0x55c74d){return _0x55c74d['destroy']()[_0xacf7('0x2a')](function(){_0x27668e[_0xacf7('0x1e')](0xcc)[_0xacf7('0x1f')]();});}};}function handleEntityNotFound(_0x2372eb,_0x3a8ff3){return function(_0x56bf07){if(!_0x56bf07){_0x2372eb[_0xacf7('0x1d')](0x194);}return _0x56bf07;};}function handleError(_0x400d46,_0x386c00){_0x386c00=_0x386c00||0x1f4;return function(_0x40a1b6){logger[_0xacf7('0x2b')](_0x40a1b6['stack']);if(_0x40a1b6[_0xacf7('0x2c')]){delete _0x40a1b6[_0xacf7('0x2c')];}_0x400d46[_0xacf7('0x1e')](_0x386c00)[_0xacf7('0x2d')](_0x40a1b6);};}exports['index']=function(_0x3bb35a,_0x43b6c0){var _0xfe0fba={},_0x406679={},_0x543f7e={'count':0x0,'rows':[]};var _0xf80bdf=_[_0xacf7('0x2e')](db[_0xacf7('0x2f')][_0xacf7('0x30')],function(_0x3a8027){return{'name':_0x3a8027['fieldName'],'type':_0x3a8027[_0xacf7('0x31')]['key']};});_0x406679[_0xacf7('0x32')]=_[_0xacf7('0x2e')](_0xf80bdf,_0xacf7('0x2c'));_0x406679[_0xacf7('0x33')]=_[_0xacf7('0x34')](_0x3bb35a['query']);_0x406679['filters']=_[_0xacf7('0x35')](_0x406679['model'],_0x406679[_0xacf7('0x33')]);_0xfe0fba[_0xacf7('0x36')]=_[_0xacf7('0x35')](_0x406679[_0xacf7('0x32')],qs['fields'](_0x3bb35a['query']['fields']));_0xfe0fba[_0xacf7('0x36')]=_0xfe0fba[_0xacf7('0x36')][_0xacf7('0x37')]?_0xfe0fba[_0xacf7('0x36')]:_0x406679['model'];if(!_0x3bb35a[_0xacf7('0x33')][_0xacf7('0x38')](_0xacf7('0x39'))){_0xfe0fba[_0xacf7('0x22')]=qs['limit'](_0x3bb35a[_0xacf7('0x33')][_0xacf7('0x22')]);_0xfe0fba['offset']=qs[_0xacf7('0x3a')](_0x3bb35a[_0xacf7('0x33')][_0xacf7('0x3a')]);}_0xfe0fba['order']=qs[_0xacf7('0x3b')](_0x3bb35a[_0xacf7('0x33')][_0xacf7('0x3b')]);_0xfe0fba['where']=qs['filters'](_['pick'](_0x3bb35a[_0xacf7('0x33')],_0x406679[_0xacf7('0x3c')]),_0xf80bdf);if(_0x3bb35a[_0xacf7('0x33')]['filter']){_0xfe0fba[_0xacf7('0x3d')]=_[_0xacf7('0x3e')](_0xfe0fba[_0xacf7('0x3d')],{'$or':_['map'](_0xf80bdf,function(_0x3188e9){if(_0x3188e9[_0xacf7('0x31')]!=='VIRTUAL'){var _0x273d76={};_0x273d76[_0x3188e9['name']]={'$like':'%'+_0x3bb35a['query']['filter']+'%'};return _0x273d76;}})});}_0xfe0fba=_[_0xacf7('0x3e')]({},_0xfe0fba,_0x3bb35a['options']);var _0x336b9a={'where':_0xfe0fba['where']};return db['SugarcrmConfiguration'][_0xacf7('0x23')](_0x336b9a)[_0xacf7('0x2a')](function(_0x2542eb){_0x543f7e['count']=_0x2542eb;if(_0x3bb35a[_0xacf7('0x33')][_0xacf7('0x3f')]){_0xfe0fba[_0xacf7('0x40')]=[{'all':!![]}];}return db[_0xacf7('0x2f')][_0xacf7('0x41')](_0xfe0fba);})['then'](function(_0x2148c1){_0x543f7e['rows']=_0x2148c1;return _0x543f7e;})[_0xacf7('0x2a')](respondWithFilteredResult(_0x43b6c0,_0xfe0fba))['catch'](handleError(_0x43b6c0,null));};exports[_0xacf7('0x42')]=function(_0x52d6b1,_0x325a58){var _0x317b6f={'raw':![],'where':{'id':_0x52d6b1[_0xacf7('0x43')]['id']}},_0xfe2d7e={};_0xfe2d7e[_0xacf7('0x32')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0xfe2d7e[_0xacf7('0x33')]=_['keys'](_0x52d6b1['query']);_0xfe2d7e['filters']=_[_0xacf7('0x35')](_0xfe2d7e['model'],_0xfe2d7e[_0xacf7('0x33')]);_0x317b6f[_0xacf7('0x36')]=_[_0xacf7('0x35')](_0xfe2d7e[_0xacf7('0x32')],qs[_0xacf7('0x44')](_0x52d6b1['query']['fields']));_0x317b6f[_0xacf7('0x36')]=_0x317b6f[_0xacf7('0x36')][_0xacf7('0x37')]?_0x317b6f[_0xacf7('0x36')]:_0xfe2d7e['model'];if(_0x52d6b1[_0xacf7('0x33')][_0xacf7('0x3f')]){_0x317b6f['include']=[{'all':!![]}];}_0x317b6f=_[_0xacf7('0x3e')]({},_0x317b6f,_0x52d6b1[_0xacf7('0x45')]);return db[_0xacf7('0x2f')][_0xacf7('0x46')](_0x317b6f)['then'](handleEntityNotFound(_0x325a58,null))['then'](respondWithResult(_0x325a58,null))[_0xacf7('0x47')](handleError(_0x325a58,null));};exports['create']=function(_0x1ed00f,_0x198d0f){return db['SugarcrmConfiguration'][_0xacf7('0x48')](_0x1ed00f[_0xacf7('0x49')],{})['then'](respondWithResult(_0x198d0f,0xc9))['catch'](handleError(_0x198d0f,null));};exports['update']=function(_0x32ed66,_0x3b50e3){if(_0x32ed66[_0xacf7('0x49')]['id']){delete _0x32ed66[_0xacf7('0x49')]['id'];}return db[_0xacf7('0x2f')][_0xacf7('0x46')]({'where':{'id':_0x32ed66[_0xacf7('0x43')]['id']}})[_0xacf7('0x2a')](handleEntityNotFound(_0x3b50e3,null))[_0xacf7('0x2a')](saveUpdates(_0x32ed66[_0xacf7('0x49')],null))[_0xacf7('0x2a')](respondWithResult(_0x3b50e3,null))[_0xacf7('0x47')](handleError(_0x3b50e3,null));};exports[_0xacf7('0x4a')]=function(_0x3d1719,_0x283dbb){return db[_0xacf7('0x2f')][_0xacf7('0x46')]({'where':{'id':_0x3d1719[_0xacf7('0x43')]['id']}})['then'](handleEntityNotFound(_0x283dbb,null))[_0xacf7('0x2a')](removeEntity(_0x283dbb,null))[_0xacf7('0x47')](handleError(_0x283dbb,null));};exports[_0xacf7('0x4b')]=function(_0x533011,_0x4380ad,_0xfeb4db){var _0x367d38={};var _0x1fa753={};var _0x1c397c;var _0x4089f6;return db[_0xacf7('0x2f')][_0xacf7('0x4c')]({'where':{'id':_0x533011['params']['id']}})[_0xacf7('0x2a')](handleEntityNotFound(_0x4380ad,null))[_0xacf7('0x2a')](function(_0x37efae){if(_0x37efae){_0x1c397c=_0x37efae;_0x1fa753[_0xacf7('0x32')]=_['keys'](db['SugarcrmField'][_0xacf7('0x30')]);_0x1fa753[_0xacf7('0x33')]=_[_0xacf7('0x34')](_0x533011[_0xacf7('0x33')]);_0x1fa753[_0xacf7('0x3c')]=_[_0xacf7('0x35')](_0x1fa753[_0xacf7('0x32')],_0x1fa753[_0xacf7('0x33')]);_0x367d38[_0xacf7('0x36')]=_[_0xacf7('0x35')](_0x1fa753[_0xacf7('0x32')],qs[_0xacf7('0x44')](_0x533011[_0xacf7('0x33')][_0xacf7('0x44')]));_0x367d38[_0xacf7('0x36')]=_0x367d38[_0xacf7('0x36')][_0xacf7('0x37')]?_0x367d38[_0xacf7('0x36')]:_0x1fa753[_0xacf7('0x32')];_0x367d38['order']=qs[_0xacf7('0x3b')](_0x533011[_0xacf7('0x33')][_0xacf7('0x3b')]);_0x367d38[_0xacf7('0x3d')]=qs['filters'](_[_0xacf7('0x4d')](_0x533011[_0xacf7('0x33')],_0x1fa753[_0xacf7('0x3c')]));if(_0x533011['query']['filter']){_0x367d38['where']=_['merge'](_0x367d38['where'],{'$or':_[_0xacf7('0x2e')](_0x367d38[_0xacf7('0x36')],function(_0x3e9605){var _0x223c87={};_0x223c87[_0x3e9605]={'$like':'%'+_0x533011['query'][_0xacf7('0x4e')]+'%'};return _0x223c87;})});}_0x367d38=_[_0xacf7('0x3e')]({},_0x367d38,_0x533011['options']);return _0x1c397c[_0xacf7('0x4b')](_0x367d38);}})[_0xacf7('0x2a')](function(_0x2efe03){if(_0x2efe03){_0x4089f6=_0x2efe03['length'];if(!_0x533011['query'][_0xacf7('0x38')](_0xacf7('0x39'))){_0x367d38[_0xacf7('0x22')]=qs[_0xacf7('0x22')](_0x533011[_0xacf7('0x33')][_0xacf7('0x22')]);_0x367d38[_0xacf7('0x3a')]=qs[_0xacf7('0x3a')](_0x533011['query'][_0xacf7('0x3a')]);}return _0x1c397c['getFields'](_0x367d38);}})['then'](function(_0x2ec117){if(_0x2ec117){return _0x2ec117?{'count':_0x4089f6,'rows':_0x2ec117}:null;}})[_0xacf7('0x2a')](respondWithResult(_0x4380ad,null))[_0xacf7('0x47')](handleError(_0x4380ad,null));};exports[_0xacf7('0x4f')]=function(_0x54f4b7,_0x43c71e,_0x45f163){var _0x67f7a={};var _0x2882ed={};var _0xf44ab9;var _0x5ca73b;return db[_0xacf7('0x2f')][_0xacf7('0x4c')]({'where':{'id':_0x54f4b7[_0xacf7('0x43')]['id']}})[_0xacf7('0x2a')](handleEntityNotFound(_0x43c71e,null))['then'](function(_0x2369a8){if(_0x2369a8){_0xf44ab9=_0x2369a8;_0x2882ed[_0xacf7('0x32')]=_[_0xacf7('0x34')](db[_0xacf7('0x50')]['rawAttributes']);_0x2882ed[_0xacf7('0x33')]=_['keys'](_0x54f4b7[_0xacf7('0x33')]);_0x2882ed[_0xacf7('0x3c')]=_[_0xacf7('0x35')](_0x2882ed['model'],_0x2882ed[_0xacf7('0x33')]);_0x67f7a['attributes']=_[_0xacf7('0x35')](_0x2882ed[_0xacf7('0x32')],qs[_0xacf7('0x44')](_0x54f4b7[_0xacf7('0x33')][_0xacf7('0x44')]));_0x67f7a[_0xacf7('0x36')]=_0x67f7a[_0xacf7('0x36')][_0xacf7('0x37')]?_0x67f7a[_0xacf7('0x36')]:_0x2882ed['model'];_0x67f7a['order']=qs[_0xacf7('0x3b')](_0x54f4b7[_0xacf7('0x33')][_0xacf7('0x3b')]);_0x67f7a[_0xacf7('0x3d')]=qs[_0xacf7('0x3c')](_[_0xacf7('0x4d')](_0x54f4b7[_0xacf7('0x33')],_0x2882ed[_0xacf7('0x3c')]));if(_0x54f4b7[_0xacf7('0x33')]['filter']){_0x67f7a['where']=_['merge'](_0x67f7a[_0xacf7('0x3d')],{'$or':_[_0xacf7('0x2e')](_0x67f7a['attributes'],function(_0x5f1756){var _0x1d6764={};_0x1d6764[_0x5f1756]={'$like':'%'+_0x54f4b7['query'][_0xacf7('0x4e')]+'%'};return _0x1d6764;})});}_0x67f7a=_[_0xacf7('0x3e')]({},_0x67f7a,_0x54f4b7[_0xacf7('0x45')]);return _0xf44ab9[_0xacf7('0x4f')](_0x67f7a);}})[_0xacf7('0x2a')](function(_0x35a7f2){if(_0x35a7f2){_0x5ca73b=_0x35a7f2[_0xacf7('0x37')];if(!_0x54f4b7[_0xacf7('0x33')][_0xacf7('0x38')](_0xacf7('0x39'))){_0x67f7a[_0xacf7('0x22')]=qs[_0xacf7('0x22')](_0x54f4b7[_0xacf7('0x33')][_0xacf7('0x22')]);_0x67f7a['offset']=qs[_0xacf7('0x3a')](_0x54f4b7[_0xacf7('0x33')][_0xacf7('0x3a')]);}return _0xf44ab9['getSubjects'](_0x67f7a);}})['then'](function(_0x654ec4){if(_0x654ec4){return _0x654ec4?{'count':_0x5ca73b,'rows':_0x654ec4}:null;}})[_0xacf7('0x2a')](respondWithResult(_0x43c71e,null))[_0xacf7('0x47')](handleError(_0x43c71e,null));};exports['getDescriptions']=function(_0x5eaea1,_0x83b58d,_0x446a29){var _0x55222e={};var _0x19bc00={};var _0x3f2725;var _0x5565a8;return db[_0xacf7('0x2f')][_0xacf7('0x4c')]({'where':{'id':_0x5eaea1['params']['id']}})['then'](handleEntityNotFound(_0x83b58d,null))['then'](function(_0x592742){if(_0x592742){_0x3f2725=_0x592742;_0x19bc00[_0xacf7('0x32')]=_[_0xacf7('0x34')](db[_0xacf7('0x50')][_0xacf7('0x30')]);_0x19bc00['query']=_[_0xacf7('0x34')](_0x5eaea1[_0xacf7('0x33')]);_0x19bc00[_0xacf7('0x3c')]=_[_0xacf7('0x35')](_0x19bc00['model'],_0x19bc00['query']);_0x55222e[_0xacf7('0x36')]=_[_0xacf7('0x35')](_0x19bc00[_0xacf7('0x32')],qs[_0xacf7('0x44')](_0x5eaea1['query'][_0xacf7('0x44')]));_0x55222e[_0xacf7('0x36')]=_0x55222e['attributes'][_0xacf7('0x37')]?_0x55222e[_0xacf7('0x36')]:_0x19bc00['model'];_0x55222e[_0xacf7('0x51')]=qs['sort'](_0x5eaea1[_0xacf7('0x33')][_0xacf7('0x3b')]);_0x55222e[_0xacf7('0x3d')]=qs['filters'](_[_0xacf7('0x4d')](_0x5eaea1['query'],_0x19bc00[_0xacf7('0x3c')]));if(_0x5eaea1[_0xacf7('0x33')][_0xacf7('0x4e')]){_0x55222e[_0xacf7('0x3d')]=_[_0xacf7('0x3e')](_0x55222e['where'],{'$or':_['map'](_0x55222e[_0xacf7('0x36')],function(_0x5b7ebd){var _0x3511b5={};_0x3511b5[_0x5b7ebd]={'$like':'%'+_0x5eaea1['query'][_0xacf7('0x4e')]+'%'};return _0x3511b5;})});}_0x55222e=_[_0xacf7('0x3e')]({},_0x55222e,_0x5eaea1[_0xacf7('0x45')]);return _0x3f2725[_0xacf7('0x52')](_0x55222e);}})['then'](function(_0x1eea03){if(_0x1eea03){_0x5565a8=_0x1eea03['length'];if(!_0x5eaea1[_0xacf7('0x33')][_0xacf7('0x38')](_0xacf7('0x39'))){_0x55222e[_0xacf7('0x22')]=qs[_0xacf7('0x22')](_0x5eaea1['query']['limit']);_0x55222e[_0xacf7('0x3a')]=qs[_0xacf7('0x3a')](_0x5eaea1['query'][_0xacf7('0x3a')]);}return _0x3f2725[_0xacf7('0x52')](_0x55222e);}})[_0xacf7('0x2a')](function(_0x591f7f){if(_0x591f7f){return _0x591f7f?{'count':_0x5565a8,'rows':_0x591f7f}:null;}})[_0xacf7('0x2a')](respondWithResult(_0x83b58d,null))[_0xacf7('0x47')](handleError(_0x83b58d,null));};
\ No newline at end of file
index 873d55e..f3e6854 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2be6=['./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d6573,_0xdb8966){var _0x4136ba=function(_0x1ec555){while(--_0x1ec555){_0x3d6573['push'](_0x3d6573['shift']());}};_0x4136ba(++_0xdb8966);}(_0x2be6,0xc3));var _0x62be=function(_0x554046,_0x134664){_0x554046=_0x554046-0x0;var _0x527fc5=_0x2be6[_0x554046];return _0x527fc5;};'use strict';var _=require(_0x62be('0x0'));var util=require(_0x62be('0x1'));var logger=require(_0x62be('0x2'))(_0x62be('0x3'));var moment=require('moment');var BPromise=require(_0x62be('0x4'));var rp=require(_0x62be('0x5'));var fs=require('fs');var path=require(_0x62be('0x6'));var rimraf=require(_0x62be('0x7'));var config=require(_0x62be('0x8'));var attributes=require(_0x62be('0x9'));module['exports']=function(_0x1258a8,_0x4b105b){return _0x1258a8[_0x62be('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x62be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xddfa=['define','SugarcrmConfiguration','int_sugarcrm_configurations','api','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xddfa,0x103));var _0xaddf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xddfa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xaddf('0x0'));var moment=require('moment');var BPromise=require(_0xaddf('0x1'));var rp=require(_0xaddf('0x2'));var fs=require('fs');var path=require(_0xaddf('0x3'));var rimraf=require(_0xaddf('0x4'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x2c45a4,_0x87a150){return _0x2c45a4[_0xaddf('0x5')](_0xaddf('0x6'),attributes,{'tableName':_0xaddf('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f87bb5..42a68ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5827=['request\x20sent','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x5738c2,_0x41f87b){var _0x4478a1=function(_0x451d35){while(--_0x451d35){_0x5738c2['push'](_0x5738c2['shift']());}};_0x4478a1(++_0x41f87b);}(_0x5827,0xb6));var _0x7582=function(_0x3ff554,_0x4064ab){_0x3ff554=_0x3ff554-0x0;var _0x507107=_0x5827[_0x3ff554];return _0x507107;};'use strict';var _=require(_0x7582('0x0'));var util=require(_0x7582('0x1'));var moment=require(_0x7582('0x2'));var BPromise=require('bluebird');var rs=require(_0x7582('0x3'));var fs=require('fs');var Redis=require(_0x7582('0x4'));var db=require(_0x7582('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7582('0x6'))(_0x7582('0x7'));var config=require(_0x7582('0x8'));var jayson=require(_0x7582('0x9'));var client=jayson[_0x7582('0xa')][_0x7582('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x525724,_0x2f4faa,_0x5aeb09){return new BPromise(function(_0x5caf1f,_0x1011d0){return client[_0x7582('0xc')](_0x525724,_0x5aeb09)['then'](function(_0x57c3b5){logger['info'](_0x7582('0xd'),_0x2f4faa,'request\x20sent');logger[_0x7582('0xe')](_0x7582('0xf'),_0x2f4faa,_0x7582('0x10'),JSON['stringify'](_0x57c3b5));if(_0x57c3b5[_0x7582('0x11')]){if(_0x57c3b5[_0x7582('0x11')][_0x7582('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f4faa,_0x57c3b5['error'][_0x7582('0x13')]);return _0x1011d0(_0x57c3b5[_0x7582('0x11')][_0x7582('0x13')]);}logger[_0x7582('0x11')](_0x7582('0xd'),_0x2f4faa,_0x57c3b5[_0x7582('0x11')][_0x7582('0x13')]);return _0x5caf1f(_0x57c3b5[_0x7582('0x11')][_0x7582('0x13')]);}else{logger[_0x7582('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f4faa,_0x7582('0x10'));_0x5caf1f(_0x57c3b5['result']['message']);}})[_0x7582('0x15')](function(_0x5b4a57){logger[_0x7582('0x11')](_0x7582('0xd'),_0x2f4faa,_0x5b4a57);_0x1011d0(_0x5b4a57);});});}
\ No newline at end of file
+var _0xfaaa=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfaaa,0x69));var _0xafaa=function(_0x8e286a,_0x50c307){_0x8e286a=_0x8e286a-0x0;var _0x4cb6ee=_0xfaaa[_0x8e286a];return _0x4cb6ee;};'use strict';var _=require(_0xafaa('0x0'));var util=require(_0xafaa('0x1'));var moment=require(_0xafaa('0x2'));var BPromise=require(_0xafaa('0x3'));var rs=require(_0xafaa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xafaa('0x5'));var logger=require(_0xafaa('0x6'))(_0xafaa('0x7'));var config=require(_0xafaa('0x8'));var jayson=require(_0xafaa('0x9'));var client=jayson[_0xafaa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xea9c0a,_0x4b0d01,_0x116729){return new BPromise(function(_0x33ca0d,_0x266932){return client[_0xafaa('0xb')](_0xea9c0a,_0x116729)['then'](function(_0x183665){logger[_0xafaa('0xc')](_0xafaa('0xd'),_0x4b0d01,_0xafaa('0xe'));logger[_0xafaa('0xf')](_0xafaa('0x10'),_0x4b0d01,'request\x20sent',JSON['stringify'](_0x183665));if(_0x183665[_0xafaa('0x11')]){if(_0x183665['error'][_0xafaa('0x12')]===0x1f4){logger['error'](_0xafaa('0xd'),_0x4b0d01,_0x183665[_0xafaa('0x11')][_0xafaa('0x13')]);return _0x266932(_0x183665[_0xafaa('0x11')][_0xafaa('0x13')]);}logger[_0xafaa('0x11')](_0xafaa('0xd'),_0x4b0d01,_0x183665[_0xafaa('0x11')][_0xafaa('0x13')]);return _0x33ca0d(_0x183665[_0xafaa('0x11')][_0xafaa('0x13')]);}else{logger[_0xafaa('0xc')](_0xafaa('0xd'),_0x4b0d01,_0xafaa('0xe'));_0x33ca0d(_0x183665[_0xafaa('0x14')][_0xafaa('0x13')]);}})['catch'](function(_0x2fb269){logger[_0xafaa('0x11')](_0xafaa('0xd'),_0x4b0d01,_0x2fb269);_0x266932(_0x2fb269);});});}
\ No newline at end of file
index c02165e..eda3cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a8=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x21eca6,_0x478a5f){var _0x21473f=function(_0x2bf5a6){while(--_0x2bf5a6){_0x21eca6['push'](_0x21eca6['shift']());}};_0x21473f(++_0x478a5f);}(_0x73a8,0xca));var _0x873a=function(_0x388562,_0x46a9ac){_0x388562=_0x388562-0x0;var _0x29a03b=_0x73a8[_0x388562];return _0x29a03b;};'use strict';var multer=require(_0x873a('0x0'));var util=require(_0x873a('0x1'));var path=require('path');var timeout=require(_0x873a('0x2'));var express=require('express');var router=express[_0x873a('0x3')]();var fs_extra=require(_0x873a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x873a('0x5'));var config=require(_0x873a('0x6'));var controller=require(_0x873a('0x7'));router[_0x873a('0x8')]('/',auth[_0x873a('0x9')](),controller[_0x873a('0xa')]);router['get'](_0x873a('0xb'),auth[_0x873a('0x9')](),controller['show']);router[_0x873a('0xc')]('/',auth['isAuthenticated'](),controller[_0x873a('0xd')]);router[_0x873a('0xe')](_0x873a('0xb'),auth[_0x873a('0x9')](),controller['update']);router[_0x873a('0xf')](_0x873a('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x46e1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x3028e2,_0x1dfcf1){var _0x27ebc7=function(_0x3bd5ac){while(--_0x3bd5ac){_0x3028e2['push'](_0x3028e2['shift']());}};_0x27ebc7(++_0x1dfcf1);}(_0x46e1,0x164));var _0x146e=function(_0x1a30da,_0x307615){_0x1a30da=_0x1a30da-0x0;var _0x411b8f=_0x46e1[_0x1a30da];return _0x411b8f;};'use strict';var multer=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var path=require(_0x146e('0x2'));var timeout=require(_0x146e('0x3'));var express=require(_0x146e('0x4'));var router=express[_0x146e('0x5')]();var fs_extra=require(_0x146e('0x6'));var auth=require(_0x146e('0x7'));var interaction=require(_0x146e('0x8'));var config=require(_0x146e('0x9'));var controller=require(_0x146e('0xa'));router['get']('/',auth[_0x146e('0xb')](),controller[_0x146e('0xc')]);router['get'](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0xe')]);router[_0x146e('0xf')]('/',auth[_0x146e('0xb')](),controller['create']);router[_0x146e('0x10')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0x11')]);router[_0x146e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x146e('0x13')]);module[_0x146e('0x14')]=router;
\ No newline at end of file
index 7abd5b5..8bce573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8166=['variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8166,0x15e));var _0x6816=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0x8166[_0x434804];return _0x573fc8;};'use strict';var Sequelize=require(_0x6816('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x6816('0x1'),_0x6816('0x2'),_0x6816('0x3'),_0x6816('0x4')),'defaultValue':_0x6816('0x5')},'content':{'type':Sequelize[_0x6816('0x6')]},'key':{'type':Sequelize[_0x6816('0x6')]},'keyType':{'type':Sequelize[_0x6816('0x7')](_0x6816('0x5'),_0x6816('0x1'),_0x6816('0x2'))},'keyContent':{'type':Sequelize[_0x6816('0x6')]},'idField':{'type':Sequelize[_0x6816('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6816('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6816('0x6')]}};
\ No newline at end of file
+var _0x128a=['ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x1efd72,_0x12e750){var _0x59770b=function(_0x153182){while(--_0x153182){_0x1efd72['push'](_0x1efd72['shift']());}};_0x59770b(++_0x12e750);}(_0x128a,0x1d5));var _0xa128=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0x128a[_0x55af86];return _0x58df3b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xa128('0x0'),_0xa128('0x1'),_0xa128('0x2'),'keyValue',_0xa128('0x3')),'defaultValue':_0xa128('0x0')},'content':{'type':Sequelize[_0xa128('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa128('0x5')]('string',_0xa128('0x1'),_0xa128('0x2'))},'keyContent':{'type':Sequelize[_0xa128('0x4')]},'idField':{'type':Sequelize[_0xa128('0x4')]},'nameField':{'type':Sequelize[_0xa128('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa128('0x4')]}};
\ No newline at end of file
index 73febc2..d7b5bc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52b5=['SugarcrmField','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','params','keys','rawAttributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map'];(function(_0x2211ed,_0x402602){var _0x486437=function(_0x13d4b9){while(--_0x13d4b9){_0x2211ed['push'](_0x2211ed['shift']());}};_0x486437(++_0x402602);}(_0x52b5,0x6c));var _0x552b=function(_0x1bc4f6,_0x3e1963){_0x1bc4f6=_0x1bc4f6-0x0;var _0x36b55a=_0x52b5[_0x1bc4f6];return _0x36b55a;};'use strict';var emlformat=require(_0x552b('0x0'));var rimraf=require(_0x552b('0x1'));var zipdir=require(_0x552b('0x2'));var jsonpatch=require(_0x552b('0x3'));var rp=require(_0x552b('0x4'));var moment=require(_0x552b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x552b('0x6'));var util=require(_0x552b('0x7'));var path=require(_0x552b('0x8'));var sox=require('sox');var csv=require(_0x552b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x552b('0xa'));var _=require(_0x552b('0xb'));var squel=require(_0x552b('0xc'));var crypto=require(_0x552b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x552b('0xe'));var toCsv=require(_0x552b('0x9'));var querystring=require(_0x552b('0xf'));var Papa=require(_0x552b('0x10'));var Redis=require(_0x552b('0x11'));var authService=require(_0x552b('0x12'));var qs=require(_0x552b('0x13'));var as=require(_0x552b('0x14'));var hardwareService=require(_0x552b('0x15'));var logger=require(_0x552b('0x16'))(_0x552b('0x17'));var utils=require(_0x552b('0x18'));var config=require(_0x552b('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45b978,_0x37e464){_0x37e464=_0x37e464||0xcc;return function(_0x38b5f5){if(_0x38b5f5){return _0x45b978[_0x552b('0x1a')](_0x37e464);}return _0x45b978[_0x552b('0x1b')](_0x37e464)[_0x552b('0x1c')]();};}function respondWithResult(_0x4430de,_0x4aa1bd){_0x4aa1bd=_0x4aa1bd||0xc8;return function(_0x21b350){if(_0x21b350){return _0x4430de['status'](_0x4aa1bd)[_0x552b('0x1d')](_0x21b350);}};}function respondWithFilteredResult(_0x3ae317,_0x3c42a4){return function(_0x5df3e5){if(_0x5df3e5){var _0x344e05=typeof _0x3c42a4[_0x552b('0x1e')]===_0x552b('0x1f')&&typeof _0x3c42a4[_0x552b('0x20')]===_0x552b('0x1f');var _0x45f93f=_0x5df3e5['count'];var _0x5afc52=_0x344e05?0x0:_0x3c42a4[_0x552b('0x1e')];var _0x51bbb1=_0x344e05?_0x5df3e5[_0x552b('0x21')]:_0x3c42a4[_0x552b('0x1e')]+_0x3c42a4['limit'];var _0x6b2cd7;if(_0x51bbb1>=_0x45f93f){_0x51bbb1=_0x45f93f;_0x6b2cd7=0xc8;}else{_0x6b2cd7=0xce;}_0x3ae317[_0x552b('0x1b')](_0x6b2cd7);return _0x3ae317['set'](_0x552b('0x22'),_0x5afc52+'-'+_0x51bbb1+'/'+_0x45f93f)[_0x552b('0x1d')](_0x5df3e5);}return null;};}function patchUpdates(_0x388513){return function(_0x4ca7fb){try{jsonpatch[_0x552b('0x23')](_0x4ca7fb,_0x388513,!![]);}catch(_0xaa1c4a){return BPromise[_0x552b('0x24')](_0xaa1c4a);}return _0x4ca7fb[_0x552b('0x25')]();};}function saveUpdates(_0x8538ac,_0x1ee082){return function(_0x58724c){if(_0x58724c){return _0x58724c[_0x552b('0x26')](_0x8538ac)[_0x552b('0x27')](function(_0x1b234a){return _0x1b234a;});}return null;};}function removeEntity(_0x52f042,_0x4a2abe){return function(_0x5daf45){if(_0x5daf45){return _0x5daf45[_0x552b('0x28')]()[_0x552b('0x27')](function(){_0x52f042['status'](0xcc)[_0x552b('0x1c')]();});}};}function handleEntityNotFound(_0x46d8d9,_0x1b9076){return function(_0x162b63){if(!_0x162b63){_0x46d8d9[_0x552b('0x1a')](0x194);}return _0x162b63;};}function handleError(_0x586557,_0x52c3ce){_0x52c3ce=_0x52c3ce||0x1f4;return function(_0x3ea8d6){logger['error'](_0x3ea8d6[_0x552b('0x29')]);if(_0x3ea8d6[_0x552b('0x2a')]){delete _0x3ea8d6[_0x552b('0x2a')];}_0x586557[_0x552b('0x1b')](_0x52c3ce)[_0x552b('0x2b')](_0x3ea8d6);};}exports[_0x552b('0x2c')]=function(_0x5c7064,_0x36fa78){var _0x554c07={},_0x14d1ad={},_0x583d9a={'count':0x0,'rows':[]};var _0x255e01=_[_0x552b('0x2d')](db[_0x552b('0x2e')]['rawAttributes'],function(_0x5a4ebf){return{'name':_0x5a4ebf[_0x552b('0x2f')],'type':_0x5a4ebf[_0x552b('0x30')][_0x552b('0x31')]};});_0x14d1ad[_0x552b('0x32')]=_[_0x552b('0x2d')](_0x255e01,_0x552b('0x2a'));_0x14d1ad[_0x552b('0x33')]=_['keys'](_0x5c7064[_0x552b('0x33')]);_0x14d1ad[_0x552b('0x34')]=_['intersection'](_0x14d1ad[_0x552b('0x32')],_0x14d1ad['query']);_0x554c07[_0x552b('0x35')]=_[_0x552b('0x36')](_0x14d1ad[_0x552b('0x32')],qs['fields'](_0x5c7064[_0x552b('0x33')][_0x552b('0x37')]));_0x554c07[_0x552b('0x35')]=_0x554c07[_0x552b('0x35')][_0x552b('0x38')]?_0x554c07['attributes']:_0x14d1ad['model'];if(!_0x5c7064[_0x552b('0x33')][_0x552b('0x39')](_0x552b('0x3a'))){_0x554c07['limit']=qs[_0x552b('0x20')](_0x5c7064['query']['limit']);_0x554c07[_0x552b('0x1e')]=qs[_0x552b('0x1e')](_0x5c7064[_0x552b('0x33')][_0x552b('0x1e')]);}_0x554c07['order']=qs['sort'](_0x5c7064['query'][_0x552b('0x3b')]);_0x554c07['where']=qs[_0x552b('0x34')](_[_0x552b('0x3c')](_0x5c7064[_0x552b('0x33')],_0x14d1ad[_0x552b('0x34')]),_0x255e01);if(_0x5c7064[_0x552b('0x33')][_0x552b('0x3d')]){_0x554c07['where']=_[_0x552b('0x3e')](_0x554c07[_0x552b('0x3f')],{'$or':_[_0x552b('0x2d')](_0x255e01,function(_0x5957b6){if(_0x5957b6[_0x552b('0x30')]!==_0x552b('0x40')){var _0x497522={};_0x497522[_0x5957b6[_0x552b('0x2a')]]={'$like':'%'+_0x5c7064['query'][_0x552b('0x3d')]+'%'};return _0x497522;}})});}_0x554c07=_['merge']({},_0x554c07,_0x5c7064[_0x552b('0x41')]);var _0xa4ef63={'where':_0x554c07[_0x552b('0x3f')]};return db[_0x552b('0x2e')][_0x552b('0x21')](_0xa4ef63)['then'](function(_0x3de822){_0x583d9a[_0x552b('0x21')]=_0x3de822;if(_0x5c7064['query']['includeAll']){_0x554c07['include']=[{'all':!![]}];}return db[_0x552b('0x2e')][_0x552b('0x42')](_0x554c07);})[_0x552b('0x27')](function(_0x57e928){_0x583d9a[_0x552b('0x43')]=_0x57e928;return _0x583d9a;})[_0x552b('0x27')](respondWithFilteredResult(_0x36fa78,_0x554c07))[_0x552b('0x44')](handleError(_0x36fa78,null));};exports['show']=function(_0x54e360,_0x470d15){var _0x3d2a26={'raw':!![],'where':{'id':_0x54e360[_0x552b('0x45')]['id']}},_0x5b5f16={};_0x5b5f16[_0x552b('0x32')]=_[_0x552b('0x46')](db[_0x552b('0x2e')][_0x552b('0x47')]);_0x5b5f16[_0x552b('0x33')]=_['keys'](_0x54e360[_0x552b('0x33')]);_0x5b5f16[_0x552b('0x34')]=_[_0x552b('0x36')](_0x5b5f16['model'],_0x5b5f16['query']);_0x3d2a26[_0x552b('0x35')]=_[_0x552b('0x36')](_0x5b5f16[_0x552b('0x32')],qs['fields'](_0x54e360[_0x552b('0x33')][_0x552b('0x37')]));_0x3d2a26[_0x552b('0x35')]=_0x3d2a26[_0x552b('0x35')][_0x552b('0x38')]?_0x3d2a26[_0x552b('0x35')]:_0x5b5f16['model'];if(_0x54e360[_0x552b('0x33')][_0x552b('0x48')]){_0x3d2a26[_0x552b('0x49')]=[{'all':!![]}];}_0x3d2a26=_[_0x552b('0x3e')]({},_0x3d2a26,_0x54e360['options']);return db['SugarcrmField'][_0x552b('0x4a')](_0x3d2a26)['then'](handleEntityNotFound(_0x470d15,null))[_0x552b('0x27')](respondWithResult(_0x470d15,null))[_0x552b('0x44')](handleError(_0x470d15,null));};exports[_0x552b('0x4b')]=function(_0x394b98,_0x39e8d1){return db['SugarcrmField'][_0x552b('0x4b')](_0x394b98[_0x552b('0x4c')],{})[_0x552b('0x27')](respondWithResult(_0x39e8d1,0xc9))[_0x552b('0x44')](handleError(_0x39e8d1,null));};exports[_0x552b('0x26')]=function(_0x1c7e09,_0x239160){if(_0x1c7e09['body']['id']){delete _0x1c7e09['body']['id'];}return db[_0x552b('0x2e')][_0x552b('0x4a')]({'where':{'id':_0x1c7e09['params']['id']}})[_0x552b('0x27')](handleEntityNotFound(_0x239160,null))[_0x552b('0x27')](saveUpdates(_0x1c7e09['body'],null))[_0x552b('0x27')](respondWithResult(_0x239160,null))['catch'](handleError(_0x239160,null));};exports[_0x552b('0x28')]=function(_0xf19396,_0x2d4d23){return db[_0x552b('0x2e')][_0x552b('0x4a')]({'where':{'id':_0xf19396['params']['id']}})[_0x552b('0x27')](handleEntityNotFound(_0x2d4d23,null))['then'](removeEntity(_0x2d4d23,null))[_0x552b('0x44')](handleError(_0x2d4d23,null));};
\ No newline at end of file
+var _0xe778=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','SugarcrmField','fieldName','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','then','includeAll','include','findAll','params','rawAttributes','merge','find','create','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe778,0x117));var _0x8e77=function(_0x69c538,_0x4479cc){_0x69c538=_0x69c538-0x0;var _0x555a55=_0xe778[_0x69c538];return _0x555a55;};'use strict';var emlformat=require(_0x8e77('0x0'));var rimraf=require(_0x8e77('0x1'));var zipdir=require(_0x8e77('0x2'));var jsonpatch=require(_0x8e77('0x3'));var rp=require(_0x8e77('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8e77('0x5'));var util=require('util');var path=require(_0x8e77('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e77('0x7'));var fs=require('fs');var fs_extra=require(_0x8e77('0x8'));var _=require('lodash');var squel=require(_0x8e77('0x9'));var crypto=require(_0x8e77('0xa'));var jsforce=require(_0x8e77('0xb'));var deskjs=require(_0x8e77('0xc'));var toCsv=require(_0x8e77('0xd'));var querystring=require('querystring');var Papa=require(_0x8e77('0xe'));var Redis=require(_0x8e77('0xf'));var authService=require(_0x8e77('0x10'));var qs=require(_0x8e77('0x11'));var as=require(_0x8e77('0x12'));var hardwareService=require(_0x8e77('0x13'));var logger=require('../../config/logger')(_0x8e77('0x14'));var utils=require(_0x8e77('0x15'));var config=require(_0x8e77('0x16'));var licenseUtil=require(_0x8e77('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31594c,_0x4bf6fa){_0x4bf6fa=_0x4bf6fa||0xcc;return function(_0x4b36a9){if(_0x4b36a9){return _0x31594c[_0x8e77('0x18')](_0x4bf6fa);}return _0x31594c[_0x8e77('0x19')](_0x4bf6fa)['end']();};}function respondWithResult(_0xbb09c3,_0x331e26){_0x331e26=_0x331e26||0xc8;return function(_0x9ff0bb){if(_0x9ff0bb){return _0xbb09c3[_0x8e77('0x19')](_0x331e26)[_0x8e77('0x1a')](_0x9ff0bb);}};}function respondWithFilteredResult(_0x50677c,_0x442e73){return function(_0x3a1552){if(_0x3a1552){var _0x2f2c8b=typeof _0x442e73[_0x8e77('0x1b')]==='undefined'&&typeof _0x442e73['limit']===_0x8e77('0x1c');var _0xcb61b7=_0x3a1552['count'];var _0x59f7d8=_0x2f2c8b?0x0:_0x442e73[_0x8e77('0x1b')];var _0x279a89=_0x2f2c8b?_0x3a1552[_0x8e77('0x1d')]:_0x442e73[_0x8e77('0x1b')]+_0x442e73[_0x8e77('0x1e')];var _0x3b9264;if(_0x279a89>=_0xcb61b7){_0x279a89=_0xcb61b7;_0x3b9264=0xc8;}else{_0x3b9264=0xce;}_0x50677c['status'](_0x3b9264);return _0x50677c[_0x8e77('0x1f')](_0x8e77('0x20'),_0x59f7d8+'-'+_0x279a89+'/'+_0xcb61b7)[_0x8e77('0x1a')](_0x3a1552);}return null;};}function patchUpdates(_0x177bb5){return function(_0x518c92){try{jsonpatch[_0x8e77('0x21')](_0x518c92,_0x177bb5,!![]);}catch(_0x3882ad){return BPromise[_0x8e77('0x22')](_0x3882ad);}return _0x518c92[_0x8e77('0x23')]();};}function saveUpdates(_0x333a34,_0x349611){return function(_0x47862c){if(_0x47862c){return _0x47862c['update'](_0x333a34)['then'](function(_0x42dddb){return _0x42dddb;});}return null;};}function removeEntity(_0x5d885d,_0x28258c){return function(_0xcff3d6){if(_0xcff3d6){return _0xcff3d6[_0x8e77('0x24')]()['then'](function(){_0x5d885d['status'](0xcc)[_0x8e77('0x25')]();});}};}function handleEntityNotFound(_0x403ec0,_0x596dc6){return function(_0x251c31){if(!_0x251c31){_0x403ec0[_0x8e77('0x18')](0x194);}return _0x251c31;};}function handleError(_0x54731f,_0x500d48){_0x500d48=_0x500d48||0x1f4;return function(_0x43d91d){logger[_0x8e77('0x26')](_0x43d91d[_0x8e77('0x27')]);if(_0x43d91d[_0x8e77('0x28')]){delete _0x43d91d[_0x8e77('0x28')];}_0x54731f[_0x8e77('0x19')](_0x500d48)[_0x8e77('0x29')](_0x43d91d);};}exports[_0x8e77('0x2a')]=function(_0x3b210b,_0x1de32b){var _0x15ad62={},_0x460e33={},_0x49de1b={'count':0x0,'rows':[]};var _0x1e2306=_[_0x8e77('0x2b')](db[_0x8e77('0x2c')]['rawAttributes'],function(_0xa4a051){return{'name':_0xa4a051[_0x8e77('0x2d')],'type':_0xa4a051['type']['key']};});_0x460e33[_0x8e77('0x2e')]=_['map'](_0x1e2306,_0x8e77('0x28'));_0x460e33['query']=_[_0x8e77('0x2f')](_0x3b210b[_0x8e77('0x30')]);_0x460e33[_0x8e77('0x31')]=_['intersection'](_0x460e33['model'],_0x460e33['query']);_0x15ad62['attributes']=_[_0x8e77('0x32')](_0x460e33['model'],qs[_0x8e77('0x33')](_0x3b210b[_0x8e77('0x30')][_0x8e77('0x33')]));_0x15ad62[_0x8e77('0x34')]=_0x15ad62[_0x8e77('0x34')][_0x8e77('0x35')]?_0x15ad62[_0x8e77('0x34')]:_0x460e33[_0x8e77('0x2e')];if(!_0x3b210b[_0x8e77('0x30')]['hasOwnProperty'](_0x8e77('0x36'))){_0x15ad62[_0x8e77('0x1e')]=qs[_0x8e77('0x1e')](_0x3b210b['query'][_0x8e77('0x1e')]);_0x15ad62['offset']=qs[_0x8e77('0x1b')](_0x3b210b[_0x8e77('0x30')][_0x8e77('0x1b')]);}_0x15ad62[_0x8e77('0x37')]=qs[_0x8e77('0x38')](_0x3b210b[_0x8e77('0x30')][_0x8e77('0x38')]);_0x15ad62[_0x8e77('0x39')]=qs[_0x8e77('0x31')](_[_0x8e77('0x3a')](_0x3b210b['query'],_0x460e33[_0x8e77('0x31')]),_0x1e2306);if(_0x3b210b[_0x8e77('0x30')][_0x8e77('0x3b')]){_0x15ad62[_0x8e77('0x39')]=_['merge'](_0x15ad62[_0x8e77('0x39')],{'$or':_[_0x8e77('0x2b')](_0x1e2306,function(_0x55e1a7){if(_0x55e1a7['type']!==_0x8e77('0x3c')){var _0x2836a2={};_0x2836a2[_0x55e1a7['name']]={'$like':'%'+_0x3b210b[_0x8e77('0x30')][_0x8e77('0x3b')]+'%'};return _0x2836a2;}})});}_0x15ad62=_['merge']({},_0x15ad62,_0x3b210b[_0x8e77('0x3d')]);var _0x404dca={'where':_0x15ad62[_0x8e77('0x39')]};return db[_0x8e77('0x2c')][_0x8e77('0x1d')](_0x404dca)[_0x8e77('0x3e')](function(_0x44be4f){_0x49de1b[_0x8e77('0x1d')]=_0x44be4f;if(_0x3b210b[_0x8e77('0x30')][_0x8e77('0x3f')]){_0x15ad62[_0x8e77('0x40')]=[{'all':!![]}];}return db[_0x8e77('0x2c')][_0x8e77('0x41')](_0x15ad62);})[_0x8e77('0x3e')](function(_0x19c769){_0x49de1b['rows']=_0x19c769;return _0x49de1b;})[_0x8e77('0x3e')](respondWithFilteredResult(_0x1de32b,_0x15ad62))['catch'](handleError(_0x1de32b,null));};exports['show']=function(_0x488b58,_0x2f7a7b){var _0x4a30dd={'raw':!![],'where':{'id':_0x488b58[_0x8e77('0x42')]['id']}},_0x541151={};_0x541151[_0x8e77('0x2e')]=_[_0x8e77('0x2f')](db[_0x8e77('0x2c')][_0x8e77('0x43')]);_0x541151[_0x8e77('0x30')]=_[_0x8e77('0x2f')](_0x488b58['query']);_0x541151[_0x8e77('0x31')]=_[_0x8e77('0x32')](_0x541151[_0x8e77('0x2e')],_0x541151[_0x8e77('0x30')]);_0x4a30dd['attributes']=_[_0x8e77('0x32')](_0x541151['model'],qs[_0x8e77('0x33')](_0x488b58['query'][_0x8e77('0x33')]));_0x4a30dd[_0x8e77('0x34')]=_0x4a30dd[_0x8e77('0x34')][_0x8e77('0x35')]?_0x4a30dd[_0x8e77('0x34')]:_0x541151[_0x8e77('0x2e')];if(_0x488b58['query']['includeAll']){_0x4a30dd['include']=[{'all':!![]}];}_0x4a30dd=_[_0x8e77('0x44')]({},_0x4a30dd,_0x488b58['options']);return db['SugarcrmField'][_0x8e77('0x45')](_0x4a30dd)[_0x8e77('0x3e')](handleEntityNotFound(_0x2f7a7b,null))['then'](respondWithResult(_0x2f7a7b,null))['catch'](handleError(_0x2f7a7b,null));};exports['create']=function(_0x2c2747,_0x2f9dca){return db[_0x8e77('0x2c')][_0x8e77('0x46')](_0x2c2747['body'],{})['then'](respondWithResult(_0x2f9dca,0xc9))['catch'](handleError(_0x2f9dca,null));};exports[_0x8e77('0x47')]=function(_0x2ba548,_0x1641be){if(_0x2ba548[_0x8e77('0x48')]['id']){delete _0x2ba548['body']['id'];}return db[_0x8e77('0x2c')][_0x8e77('0x45')]({'where':{'id':_0x2ba548[_0x8e77('0x42')]['id']}})['then'](handleEntityNotFound(_0x1641be,null))['then'](saveUpdates(_0x2ba548[_0x8e77('0x48')],null))['then'](respondWithResult(_0x1641be,null))[_0x8e77('0x49')](handleError(_0x1641be,null));};exports[_0x8e77('0x24')]=function(_0x38453e,_0x76992e){return db['SugarcrmField'][_0x8e77('0x45')]({'where':{'id':_0x38453e[_0x8e77('0x42')]['id']}})['then'](handleEntityNotFound(_0x76992e,null))[_0x8e77('0x3e')](removeEntity(_0x76992e,null))[_0x8e77('0x49')](handleError(_0x76992e,null));};
\ No newline at end of file
index 40277f4..3d133ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x826a=['request-promise','path','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','api','moment','bluebird'];(function(_0x1e9edc,_0xe06de0){var _0x684def=function(_0x113f6d){while(--_0x113f6d){_0x1e9edc['push'](_0x1e9edc['shift']());}};_0x684def(++_0xe06de0);}(_0x826a,0x14b));var _0xa826=function(_0x4eec61,_0x45cb2b){_0x4eec61=_0x4eec61-0x0;var _0x5b8227=_0x826a[_0x4eec61];return _0x5b8227;};'use strict';var _=require(_0xa826('0x0'));var util=require(_0xa826('0x1'));var logger=require('../../config/logger')(_0xa826('0x2'));var moment=require(_0xa826('0x3'));var BPromise=require(_0xa826('0x4'));var rp=require(_0xa826('0x5'));var fs=require('fs');var path=require(_0xa826('0x6'));var rimraf=require('rimraf');var config=require(_0xa826('0x7'));var attributes=require(_0xa826('0x8'));module['exports']=function(_0x3a0f90,_0x551e5e){return _0x3a0f90[_0xa826('0x9')](_0xa826('0xa'),attributes,{'tableName':_0xa826('0xb'),'paranoid':![],'indexes':[{'name':_0xa826('0xc'),'fields':['idField',_0xa826('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a99=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','FieldId','lodash'];(function(_0x29387e,_0x64172f){var _0x100df2=function(_0xacf982){while(--_0xacf982){_0x29387e['push'](_0x29387e['shift']());}};_0x100df2(++_0x64172f);}(_0x9a99,0x1c1));var _0x99a9=function(_0x32b8c4,_0x261a91){_0x32b8c4=_0x32b8c4-0x0;var _0xb7ed9=_0x9a99[_0x32b8c4];return _0xb7ed9;};'use strict';var _=require(_0x99a9('0x0'));var util=require(_0x99a9('0x1'));var logger=require(_0x99a9('0x2'))(_0x99a9('0x3'));var moment=require(_0x99a9('0x4'));var BPromise=require(_0x99a9('0x5'));var rp=require(_0x99a9('0x6'));var fs=require('fs');var path=require(_0x99a9('0x7'));var rimraf=require('rimraf');var config=require(_0x99a9('0x8'));var attributes=require(_0x99a9('0x9'));module[_0x99a9('0xa')]=function(_0x2a2c51,_0x52079b){return _0x2a2c51[_0x99a9('0xb')](_0x99a9('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x99a9('0xd'),'fields':['idField',_0x99a9('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ae58658..3808c50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x337e=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x337e,0x1a4));var _0xe337=function(_0x228855,_0x1e10ea){_0x228855=_0x228855-0x0;var _0x21cf7c=_0x337e[_0x228855];return _0x21cf7c;};'use strict';var _=require('lodash');var util=require(_0xe337('0x0'));var moment=require(_0xe337('0x1'));var BPromise=require(_0xe337('0x2'));var rs=require(_0xe337('0x3'));var fs=require('fs');var Redis=require(_0xe337('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe337('0x5'));var logger=require('../../config/logger')(_0xe337('0x6'));var config=require('../../config/environment');var jayson=require(_0xe337('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9be3,_0x2ad2af,_0x303743){return new BPromise(function(_0x5bebfb,_0x2391ef){return client[_0xe337('0x8')](_0x2b9be3,_0x303743)[_0xe337('0x9')](function(_0x3a78be){logger[_0xe337('0xa')](_0xe337('0xb'),_0x2ad2af,'request\x20sent');logger[_0xe337('0xc')](_0xe337('0xd'),_0x2ad2af,_0xe337('0xe'),JSON[_0xe337('0xf')](_0x3a78be));if(_0x3a78be[_0xe337('0x10')]){if(_0x3a78be['error'][_0xe337('0x11')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2ad2af,_0x3a78be[_0xe337('0x10')][_0xe337('0x12')]);return _0x2391ef(_0x3a78be[_0xe337('0x10')][_0xe337('0x12')]);}logger[_0xe337('0x10')](_0xe337('0xb'),_0x2ad2af,_0x3a78be['error'][_0xe337('0x12')]);return _0x5bebfb(_0x3a78be[_0xe337('0x10')][_0xe337('0x12')]);}else{logger[_0xe337('0xa')](_0xe337('0xb'),_0x2ad2af,_0xe337('0xe'));_0x5bebfb(_0x3a78be[_0xe337('0x13')][_0xe337('0x12')]);}})[_0xe337('0x14')](function(_0x5e1aac){logger[_0xe337('0x10')](_0xe337('0xb'),_0x2ad2af,_0x5e1aac);_0x2391ef(_0x5e1aac);});});}
\ No newline at end of file
+var _0x5952=['error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x5952,0x83));var _0x2595=function(_0x3acd6a,_0x277fad){_0x3acd6a=_0x3acd6a-0x0;var _0x36be36=_0x5952[_0x3acd6a];return _0x36be36;};'use strict';var _=require(_0x2595('0x0'));var util=require(_0x2595('0x1'));var moment=require('moment');var BPromise=require(_0x2595('0x2'));var rs=require(_0x2595('0x3'));var fs=require('fs');var Redis=require(_0x2595('0x4'));var db=require(_0x2595('0x5'))['db'];var utils=require(_0x2595('0x6'));var logger=require(_0x2595('0x7'))(_0x2595('0x8'));var config=require(_0x2595('0x9'));var jayson=require(_0x2595('0xa'));var client=jayson[_0x2595('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d8764,_0x8e9b8e,_0x15112){return new BPromise(function(_0x357d70,_0x1c8498){return client['request'](_0x3d8764,_0x15112)[_0x2595('0xc')](function(_0x42152d){logger['info'](_0x2595('0xd'),_0x8e9b8e,_0x2595('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x8e9b8e,_0x2595('0xe'),JSON[_0x2595('0xf')](_0x42152d));if(_0x42152d[_0x2595('0x10')]){if(_0x42152d[_0x2595('0x10')][_0x2595('0x11')]===0x1f4){logger['error'](_0x2595('0xd'),_0x8e9b8e,_0x42152d[_0x2595('0x10')][_0x2595('0x12')]);return _0x1c8498(_0x42152d[_0x2595('0x10')][_0x2595('0x12')]);}logger[_0x2595('0x10')](_0x2595('0xd'),_0x8e9b8e,_0x42152d[_0x2595('0x10')][_0x2595('0x12')]);return _0x357d70(_0x42152d['error']['message']);}else{logger[_0x2595('0x13')](_0x2595('0xd'),_0x8e9b8e,'request\x20sent');_0x357d70(_0x42152d[_0x2595('0x14')][_0x2595('0x12')]);}})['catch'](function(_0x56d0fa){logger[_0x2595('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x8e9b8e,_0x56d0fa);_0x1c8498(_0x56d0fa);});});}
\ No newline at end of file
index bdf9200..1448fbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x569b=['express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x569b,0x173));var _0xb569=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x569b[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var path=require('path');var timeout=require(_0xb569('0x2'));var express=require(_0xb569('0x3'));var router=express[_0xb569('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb569('0x5'));var interaction=require(_0xb569('0x6'));var config=require('../../config/environment');var controller=require(_0xb569('0x7'));router[_0xb569('0x8')]('/',auth[_0xb569('0x9')](),controller['index']);router[_0xb569('0x8')](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0xb')]);router['get'](_0xb569('0xc'),auth['isAuthenticated'](),controller[_0xb569('0xd')]);router[_0xb569('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb569('0xe')]);router[_0xb569('0xf')]('/',auth[_0xb569('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0xb569('0x9')](),controller[_0xb569('0x10')]);router[_0xb569('0x11')](_0xb569('0xa'),auth[_0xb569('0x9')](),controller[_0xb569('0x12')]);router[_0xb569('0x13')]('/:id',auth[_0xb569('0x9')](),controller[_0xb569('0x14')]);module[_0xb569('0x15')]=router;
\ No newline at end of file
+var _0xf15e=['Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0xf15e,0xb9));var _0xef15=function(_0x1996df,_0x606387){_0x1996df=_0x1996df-0x0;var _0x4e2ee1=_0xf15e[_0x1996df];return _0x4e2ee1;};'use strict';var multer=require(_0xef15('0x0'));var util=require('util');var path=require(_0xef15('0x1'));var timeout=require(_0xef15('0x2'));var express=require(_0xef15('0x3'));var router=express[_0xef15('0x4')]();var fs_extra=require(_0xef15('0x5'));var auth=require(_0xef15('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xef15('0x7'));var controller=require(_0xef15('0x8'));router[_0xef15('0x9')]('/',auth[_0xef15('0xa')](),controller['index']);router[_0xef15('0x9')](_0xef15('0xb'),auth[_0xef15('0xa')](),controller['show']);router[_0xef15('0x9')](_0xef15('0xc'),auth[_0xef15('0xa')](),controller[_0xef15('0xd')]);router['get'](_0xef15('0xe'),auth[_0xef15('0xa')](),controller[_0xef15('0xf')]);router['post']('/',auth[_0xef15('0xa')](),controller[_0xef15('0x10')]);router[_0xef15('0x11')](_0xef15('0xc'),auth[_0xef15('0xa')](),controller['addConfiguration']);router['put'](_0xef15('0xb'),auth[_0xef15('0xa')](),controller[_0xef15('0x12')]);router['delete'](_0xef15('0xb'),auth['isAuthenticated'](),controller[_0xef15('0x13')]);module[_0xef15('0x14')]=router;
\ No newline at end of file
index dda313a..8c1af15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75c3=['exports','STRING','HelpDesk'];(function(_0x1a7457,_0x17cf5f){var _0x1f87d7=function(_0x169ccc){while(--_0x169ccc){_0x1a7457['push'](_0x1a7457['shift']());}};_0x1f87d7(++_0x17cf5f);}(_0x75c3,0x165));var _0x375c=function(_0x3d9476,_0x5b391b){_0x3d9476=_0x3d9476-0x0;var _0x21f0e=_0x75c3[_0x3d9476];return _0x21f0e;};'use strict';var Sequelize=require('sequelize');module[_0x375c('0x0')]={'name':{'type':Sequelize[_0x375c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x375c('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x375c('0x1')],'allowNull':![],'defaultValue':_0x375c('0x2')},'remoteUri':{'type':Sequelize[_0x375c('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x375c('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x7836=['sequelize','exports','STRING','HelpDesk'];(function(_0x1a799e,_0x5d63c7){var _0x1c8b3a=function(_0x5dd088){while(--_0x5dd088){_0x1a799e['push'](_0x1a799e['shift']());}};_0x1c8b3a(++_0x5d63c7);}(_0x7836,0x1a8));var _0x6783=function(_0x34022f,_0x21134c){_0x34022f=_0x34022f-0x0;var _0x1bebdf=_0x7836[_0x34022f];return _0x1bebdf;};'use strict';var Sequelize=require(_0x6783('0x0'));module[_0x6783('0x1')]={'name':{'type':Sequelize[_0x6783('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6783('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6783('0x3')},'remoteUri':{'type':Sequelize[_0x6783('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6783('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 1142a4e..b1922c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaec2=['getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','picklist','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VtigerAccount','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','substring','lastIndexOf','%s/webservice.php'];(function(_0x441b5c,_0x7eff00){var _0x4f69cb=function(_0x4547a9){while(--_0x4547a9){_0x441b5c['push'](_0x441b5c['shift']());}};_0x4f69cb(++_0x7eff00);}(_0xaec2,0x90));var _0x2aec=function(_0x4753f3,_0xfa186e){_0x4753f3=_0x4753f3-0x0;var _0x124353=_0xaec2[_0x4753f3];return _0x124353;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2aec('0x0'));var zipdir=require(_0x2aec('0x1'));var jsonpatch=require(_0x2aec('0x2'));var rp=require(_0x2aec('0x3'));var moment=require(_0x2aec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2aec('0x5'));var util=require(_0x2aec('0x6'));var path=require('path');var sox=require(_0x2aec('0x7'));var csv=require(_0x2aec('0x8'));var ejs=require(_0x2aec('0x9'));var fs=require('fs');var fs_extra=require(_0x2aec('0xa'));var _=require('lodash');var squel=require(_0x2aec('0xb'));var crypto=require(_0x2aec('0xc'));var jsforce=require(_0x2aec('0xd'));var deskjs=require(_0x2aec('0xe'));var toCsv=require(_0x2aec('0x8'));var querystring=require('querystring');var Papa=require(_0x2aec('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2aec('0x10'));var as=require(_0x2aec('0x11'));var hardwareService=require(_0x2aec('0x12'));var logger=require(_0x2aec('0x13'))(_0x2aec('0x14'));var utils=require('../../config/utils');var config=require(_0x2aec('0x15'));var licenseUtil=require(_0x2aec('0x16'));var db=require(_0x2aec('0x17'))['db'];var integrations=require(_0x2aec('0x18'));function respondWithStatusCode(_0x262314,_0x401d98){_0x401d98=_0x401d98||0xcc;return function(_0x4b39e0){if(_0x4b39e0){return _0x262314[_0x2aec('0x19')](_0x401d98);}return _0x262314[_0x2aec('0x1a')](_0x401d98)[_0x2aec('0x1b')]();};}function respondWithResult(_0x5bdde3,_0x511506){_0x511506=_0x511506||0xc8;return function(_0x599466){if(_0x599466){return _0x5bdde3[_0x2aec('0x1a')](_0x511506)[_0x2aec('0x1c')](_0x599466);}};}function respondWithFilteredResult(_0x7325d9,_0x3b7c25){return function(_0x2bbc4d){if(_0x2bbc4d){var _0x396f46=typeof _0x3b7c25[_0x2aec('0x1d')]===_0x2aec('0x1e')&&typeof _0x3b7c25[_0x2aec('0x1f')]==='undefined';var _0x5a06c2=_0x2bbc4d[_0x2aec('0x20')];var _0x1b1a39=_0x396f46?0x0:_0x3b7c25[_0x2aec('0x1d')];var _0x19d647=_0x396f46?_0x2bbc4d[_0x2aec('0x20')]:_0x3b7c25['offset']+_0x3b7c25[_0x2aec('0x1f')];var _0x273cef;if(_0x19d647>=_0x5a06c2){_0x19d647=_0x5a06c2;_0x273cef=0xc8;}else{_0x273cef=0xce;}_0x7325d9[_0x2aec('0x1a')](_0x273cef);return _0x7325d9['set'](_0x2aec('0x21'),_0x1b1a39+'-'+_0x19d647+'/'+_0x5a06c2)[_0x2aec('0x1c')](_0x2bbc4d);}return null;};}function patchUpdates(_0xa76792){return function(_0x4367bc){try{jsonpatch[_0x2aec('0x22')](_0x4367bc,_0xa76792,!![]);}catch(_0x4c6dd1){return BPromise[_0x2aec('0x23')](_0x4c6dd1);}return _0x4367bc[_0x2aec('0x24')]();};}function saveUpdates(_0x3111fb,_0x5789ec){return function(_0x5ded5f){if(_0x5ded5f){return _0x5ded5f[_0x2aec('0x25')](_0x3111fb)[_0x2aec('0x26')](function(_0x2acf22){return _0x2acf22;});}return null;};}function removeEntity(_0xd93a90,_0xda209d){return function(_0x43894b){if(_0x43894b){return _0x43894b['destroy']()['then'](function(){_0xd93a90['status'](0xcc)[_0x2aec('0x1b')]();});}};}function handleEntityNotFound(_0x1ac365,_0x49c91d){return function(_0x17281d){if(!_0x17281d){_0x1ac365[_0x2aec('0x19')](0x194);}return _0x17281d;};}function handleError(_0x273bbe,_0x39dfbb){_0x39dfbb=_0x39dfbb||0x1f4;return function(_0x4076ea){logger[_0x2aec('0x27')](_0x4076ea[_0x2aec('0x28')]);if(_0x4076ea[_0x2aec('0x29')]){delete _0x4076ea[_0x2aec('0x29')];}_0x273bbe[_0x2aec('0x1a')](_0x39dfbb)[_0x2aec('0x2a')](_0x4076ea);};}exports[_0x2aec('0x2b')]=function(_0x59d1ba,_0x1cfb18){var _0x597723={},_0x4deb7e={},_0x7b72ca={'count':0x0,'rows':[]};var _0x231085=_['map'](db[_0x2aec('0x2c')]['rawAttributes'],function(_0x17a7dd){return{'name':_0x17a7dd['fieldName'],'type':_0x17a7dd[_0x2aec('0x2d')][_0x2aec('0x2e')]};});_0x4deb7e[_0x2aec('0x2f')]=_[_0x2aec('0x30')](_0x231085,_0x2aec('0x29'));_0x4deb7e[_0x2aec('0x31')]=_[_0x2aec('0x32')](_0x59d1ba['query']);_0x4deb7e[_0x2aec('0x33')]=_[_0x2aec('0x34')](_0x4deb7e[_0x2aec('0x2f')],_0x4deb7e[_0x2aec('0x31')]);_0x597723[_0x2aec('0x35')]=_[_0x2aec('0x34')](_0x4deb7e['model'],qs[_0x2aec('0x36')](_0x59d1ba['query'][_0x2aec('0x36')]));_0x597723[_0x2aec('0x35')]=_0x597723[_0x2aec('0x35')][_0x2aec('0x37')]?_0x597723[_0x2aec('0x35')]:_0x4deb7e[_0x2aec('0x2f')];if(!_0x59d1ba[_0x2aec('0x31')]['hasOwnProperty'](_0x2aec('0x38'))){_0x597723['limit']=qs[_0x2aec('0x1f')](_0x59d1ba['query'][_0x2aec('0x1f')]);_0x597723['offset']=qs[_0x2aec('0x1d')](_0x59d1ba['query'][_0x2aec('0x1d')]);}_0x597723[_0x2aec('0x39')]=qs['sort'](_0x59d1ba[_0x2aec('0x31')][_0x2aec('0x3a')]);_0x597723[_0x2aec('0x3b')]=qs['filters'](_[_0x2aec('0x3c')](_0x59d1ba[_0x2aec('0x31')],_0x4deb7e['filters']),_0x231085);if(_0x59d1ba[_0x2aec('0x31')][_0x2aec('0x3d')]){_0x597723[_0x2aec('0x3b')]=_[_0x2aec('0x3e')](_0x597723[_0x2aec('0x3b')],{'$or':_[_0x2aec('0x30')](_0x231085,function(_0x10f2a6){if(_0x10f2a6[_0x2aec('0x2d')]!=='VIRTUAL'){var _0x420f18={};_0x420f18[_0x10f2a6[_0x2aec('0x29')]]={'$like':'%'+_0x59d1ba[_0x2aec('0x31')][_0x2aec('0x3d')]+'%'};return _0x420f18;}})});}_0x597723=_[_0x2aec('0x3e')]({},_0x597723,_0x59d1ba[_0x2aec('0x3f')]);var _0x28d3c2={'where':_0x597723[_0x2aec('0x3b')]};return db['VtigerAccount'][_0x2aec('0x20')](_0x28d3c2)[_0x2aec('0x26')](function(_0x8aa1ef){_0x7b72ca[_0x2aec('0x20')]=_0x8aa1ef;if(_0x59d1ba[_0x2aec('0x31')]['includeAll']){_0x597723[_0x2aec('0x40')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x597723);})['then'](function(_0x54693c){_0x7b72ca[_0x2aec('0x41')]=_0x54693c;return _0x7b72ca;})['then'](respondWithFilteredResult(_0x1cfb18,_0x597723))[_0x2aec('0x42')](handleError(_0x1cfb18,null));};exports[_0x2aec('0x43')]=function(_0x1f68ad,_0x41e3e3){var _0x2f4b25={'raw':![],'where':{'id':_0x1f68ad[_0x2aec('0x44')]['id']}},_0x2bb9b9={};_0x2bb9b9[_0x2aec('0x2f')]=_[_0x2aec('0x32')](db[_0x2aec('0x2c')][_0x2aec('0x45')]);_0x2bb9b9[_0x2aec('0x31')]=_['keys'](_0x1f68ad[_0x2aec('0x31')]);_0x2bb9b9['filters']=_[_0x2aec('0x34')](_0x2bb9b9[_0x2aec('0x2f')],_0x2bb9b9[_0x2aec('0x31')]);_0x2f4b25['attributes']=_['intersection'](_0x2bb9b9[_0x2aec('0x2f')],qs['fields'](_0x1f68ad[_0x2aec('0x31')][_0x2aec('0x36')]));_0x2f4b25[_0x2aec('0x35')]=_0x2f4b25[_0x2aec('0x35')]['length']?_0x2f4b25[_0x2aec('0x35')]:_0x2bb9b9[_0x2aec('0x2f')];if(_0x1f68ad['query']['includeAll']){_0x2f4b25[_0x2aec('0x40')]=[{'all':!![]}];}_0x2f4b25=_[_0x2aec('0x3e')]({},_0x2f4b25,_0x1f68ad['options']);return db['VtigerAccount'][_0x2aec('0x46')](_0x2f4b25)[_0x2aec('0x26')](handleEntityNotFound(_0x41e3e3,null))[_0x2aec('0x26')](respondWithResult(_0x41e3e3,null))[_0x2aec('0x42')](handleError(_0x41e3e3,null));};exports[_0x2aec('0x47')]=function(_0x263628,_0x62b21b){return db[_0x2aec('0x2c')][_0x2aec('0x47')](_0x263628[_0x2aec('0x48')],{})['then'](respondWithResult(_0x62b21b,0xc9))[_0x2aec('0x42')](handleError(_0x62b21b,null));};exports[_0x2aec('0x25')]=function(_0x4ca39b,_0x485cf5){if(_0x4ca39b[_0x2aec('0x48')]['id']){delete _0x4ca39b[_0x2aec('0x48')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x4ca39b['params']['id']}})['then'](handleEntityNotFound(_0x485cf5,null))[_0x2aec('0x26')](saveUpdates(_0x4ca39b[_0x2aec('0x48')],null))['then'](respondWithResult(_0x485cf5,null))[_0x2aec('0x42')](handleError(_0x485cf5,null));};exports[_0x2aec('0x49')]=function(_0x1caf1e,_0x4ce416){return db[_0x2aec('0x2c')][_0x2aec('0x46')]({'where':{'id':_0x1caf1e[_0x2aec('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ce416,null))['then'](removeEntity(_0x4ce416,null))[_0x2aec('0x42')](handleError(_0x4ce416,null));};exports[_0x2aec('0x4a')]=function(_0x3cab89,_0x950333,_0x4b8577){var _0x3f27a5={};var _0x457170={};var _0x40a0fd;var _0x407eab;return db[_0x2aec('0x2c')][_0x2aec('0x4b')]({'where':{'id':_0x3cab89[_0x2aec('0x44')]['id']}})[_0x2aec('0x26')](handleEntityNotFound(_0x950333,null))[_0x2aec('0x26')](function(_0x3b484d){if(_0x3b484d){_0x40a0fd=_0x3b484d;_0x457170[_0x2aec('0x2f')]=_[_0x2aec('0x32')](db[_0x2aec('0x4c')]['rawAttributes']);_0x457170[_0x2aec('0x31')]=_[_0x2aec('0x32')](_0x3cab89['query']);_0x457170['filters']=_['intersection'](_0x457170['model'],_0x457170[_0x2aec('0x31')]);_0x3f27a5[_0x2aec('0x35')]=_[_0x2aec('0x34')](_0x457170[_0x2aec('0x2f')],qs['fields'](_0x3cab89[_0x2aec('0x31')]['fields']));_0x3f27a5[_0x2aec('0x35')]=_0x3f27a5['attributes'][_0x2aec('0x37')]?_0x3f27a5[_0x2aec('0x35')]:_0x457170[_0x2aec('0x2f')];_0x3f27a5[_0x2aec('0x39')]=qs[_0x2aec('0x3a')](_0x3cab89[_0x2aec('0x31')][_0x2aec('0x3a')]);_0x3f27a5[_0x2aec('0x3b')]=qs[_0x2aec('0x33')](_[_0x2aec('0x3c')](_0x3cab89[_0x2aec('0x31')],_0x457170['filters']));if(_0x3cab89['query'][_0x2aec('0x3d')]){_0x3f27a5[_0x2aec('0x3b')]=_[_0x2aec('0x3e')](_0x3f27a5[_0x2aec('0x3b')],{'$or':_[_0x2aec('0x30')](_0x3f27a5[_0x2aec('0x35')],function(_0x5d868e){var _0x518f22={};_0x518f22[_0x5d868e]={'$like':'%'+_0x3cab89[_0x2aec('0x31')][_0x2aec('0x3d')]+'%'};return _0x518f22;})});}_0x3f27a5=_['merge']({},_0x3f27a5,_0x3cab89[_0x2aec('0x3f')]);return _0x40a0fd[_0x2aec('0x4a')](_0x3f27a5);}})[_0x2aec('0x26')](function(_0x4ec16f){if(_0x4ec16f){_0x407eab=_0x4ec16f[_0x2aec('0x37')];if(!_0x3cab89['query'][_0x2aec('0x4d')]('nolimit')){_0x3f27a5['limit']=qs[_0x2aec('0x1f')](_0x3cab89[_0x2aec('0x31')]['limit']);_0x3f27a5[_0x2aec('0x1d')]=qs['offset'](_0x3cab89['query'][_0x2aec('0x1d')]);}return _0x40a0fd[_0x2aec('0x4a')](_0x3f27a5);}})['then'](function(_0x4d6539){if(_0x4d6539){return _0x4d6539?{'count':_0x407eab,'rows':_0x4d6539}:null;}})['then'](respondWithResult(_0x950333,null))[_0x2aec('0x42')](handleError(_0x950333,null));};exports[_0x2aec('0x4e')]=function(_0x1948b1,_0x31ab14,_0x5f021e){if(_0x1948b1[_0x2aec('0x48')]['id']){delete _0x1948b1[_0x2aec('0x48')]['id'];}return db[_0x2aec('0x2c')][_0x2aec('0x4b')]({'where':{'id':_0x1948b1[_0x2aec('0x44')]['id']}})[_0x2aec('0x26')](handleEntityNotFound(_0x31ab14,null))[_0x2aec('0x26')](function(_0x4f3865){if(_0x4f3865){_0x1948b1[_0x2aec('0x48')][_0x2aec('0x4f')]=_0x4f3865['id'];_0x1948b1[_0x2aec('0x48')][_0x2aec('0x50')]=integrations[_0x2aec('0x51')](_0x1948b1[_0x2aec('0x48')]['channel'],_0x1948b1[_0x2aec('0x48')][_0x2aec('0x2d')]);_0x1948b1[_0x2aec('0x48')][_0x2aec('0x52')]=integrations[_0x2aec('0x53')](_0x1948b1['body'][_0x2aec('0x54')],_0x1948b1[_0x2aec('0x48')]['type']);return db['VtigerConfiguration']['create'](_0x1948b1[_0x2aec('0x48')],{'include':[{'model':db[_0x2aec('0x55')],'as':_0x2aec('0x50')},{'model':db['VtigerField'],'as':_0x2aec('0x52')}]});}return null;})[_0x2aec('0x26')](respondWithResult(_0x31ab14,null))[_0x2aec('0x42')](handleError(_0x31ab14,null));};var md5=require(_0x2aec('0x56'));exports[_0x2aec('0x57')]=function(_0x3060f8,_0x3b70bb,_0x20c1c9){var _0x34a355=null;var _0x53408c=null;var _0x50345f=null;var _0x289f5a=null;var _0x2ed71f='';return db[_0x2aec('0x2c')][_0x2aec('0x4b')]({'where':{'id':_0x3060f8[_0x2aec('0x44')]['id']},'attributes':['id',_0x2aec('0x29'),_0x2aec('0x58'),_0x2aec('0x59'),_0x2aec('0x5a'),_0x2aec('0x5b'),'serverUrl',_0x2aec('0x5c')]})[_0x2aec('0x26')](handleEntityNotFound(_0x3b70bb,null))[_0x2aec('0x26')](function(_0x2d4fc4){if(_0x2d4fc4){_0x34a355=_0x2d4fc4[_0x2aec('0x58')];_0x53408c=_0x2d4fc4[_0x2aec('0x5c')];_0x50345f=_0x2d4fc4[_0x2aec('0x5a')];_0x2ed71f=_0x2d4fc4[_0x2aec('0x5b')];var _0x281437=_0x2ed71f['slice'](-0x1);if(_0x281437==='/'){_0x2ed71f=_0x2ed71f[_0x2aec('0x5d')](0x0,_0x2ed71f[_0x2aec('0x5e')](_0x281437));}_0x289f5a=util['format'](_0x2aec('0x5f'),_0x2ed71f);var _0x1e1cb0={'method':'GET','uri':_0x289f5a,'qs':{'operation':_0x2aec('0x60'),'username':_0x2d4fc4['username']},'json':!![]};return rp(_0x1e1cb0);}})[_0x2aec('0x26')](function(_0x590972){if(_0x590972[_0x2aec('0x61')]){var _0x556af9={'method':_0x2aec('0x62'),'uri':_0x289f5a,'form':{'operation':_0x2aec('0x63'),'username':_0x34a355,'accessKey':md5(_0x590972[_0x2aec('0x64')][_0x2aec('0x65')]+_0x53408c)},'json':!![]};return rp(_0x556af9);}})['then'](function(_0x557df7){if(_0x557df7['success']){var _0x414389={'method':'GET','uri':_0x289f5a,'qs':{'operation':_0x2aec('0x66'),'username':_0x34a355,'sessionName':_0x557df7[_0x2aec('0x64')][_0x2aec('0x67')],'elementType':_0x50345f},'json':!![]};return rp(_0x414389);}})[_0x2aec('0x26')](function(_0x2b5e61){if(_0x2b5e61[_0x2aec('0x61')]){var _0x46db7c=[_0x2aec('0x68'),_0x2aec('0x69'),_0x2aec('0x6a')];_[_0x2aec('0x6b')](_0x2b5e61[_0x2aec('0x64')][_0x2aec('0x36')],function(_0x45ac95){return _0x46db7c[_0x2aec('0x6c')](_0x45ac95[_0x2aec('0x2d')]['name']);});_[_0x2aec('0x6b')](_0x2b5e61[_0x2aec('0x64')][_0x2aec('0x36')],function(_0x3bc956){return _0x3bc956[_0x2aec('0x6d')]===_0x2aec('0x6e');});return{'count':_0x2b5e61[_0x2aec('0x64')][_0x2aec('0x36')][_0x2aec('0x37')],'rows':_[_0x2aec('0x30')](_0x2b5e61[_0x2aec('0x64')][_0x2aec('0x36')],function(_0x14de2a){return{'id':_0x14de2a[_0x2aec('0x29')],'name':_0x14de2a[_0x2aec('0x6f')],'custom':_[_0x2aec('0x70')](_0x14de2a[_0x2aec('0x29')],'cf_')?!![]:![],'options':_0x14de2a['type'][_0x2aec('0x29')]===_0x2aec('0x71')&&_0x14de2a[_0x2aec('0x2d')]['picklistValues'][_0x2aec('0x37')]>0x0?_[_0x2aec('0x30')](_0x14de2a[_0x2aec('0x2d')]['picklistValues'],function(_0x429778){return{'name':_0x429778[_0x2aec('0x6f')],'value':_0x429778[_0x2aec('0x72')]};}):[]};})};}})[_0x2aec('0x26')](respondWithResult(_0x3b70bb,null))['catch'](function(_0x4552bd){console['log'](_0x2aec('0x73')+_0x4552bd);var _0x1967b9=_0x3060f8['query'][_0x2aec('0x74')]?0x1f4:_0x4552bd[_0x2aec('0x75')]||0x1f4;logger['error'](_0x2aec('0x76'),_0x2aec('0x57'),_0x1967b9,JSON['stringify'](_0x4552bd));delete _0x4552bd['name'];if(_0x1967b9===0x191){_0x1967b9=0x190;}_0x3b70bb[_0x2aec('0x1a')](_0x1967b9)[_0x2aec('0x2a')](_0x3060f8['query'][_0x2aec('0x74')]?{'message':_0x2aec('0x77'),'statusCode':_0x4552bd['statusCode']}:_0x4552bd);});};
\ No newline at end of file
+var _0x2d36=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','then','error','stack','name','send','map','VtigerAccount','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','includeAll','include','catch','show','params','keys','merge','options','find','create','body','update','destroy','getConfigurations','VtigerConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','channel','VtigerField','Descriptions','md5','getFields','findOne','username','description','moduleName','accessKey','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','login','result','token','describe','sessionName','autogenerated','remove','includes','editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xb1ce29,_0x3326b1){var _0x10dbd4=function(_0x351192){while(--_0x351192){_0xb1ce29['push'](_0xb1ce29['shift']());}};_0x10dbd4(++_0x3326b1);}(_0x2d36,0xd3));var _0x62d3=function(_0x5f1883,_0x36486c){_0x5f1883=_0x5f1883-0x0;var _0x226573=_0x2d36[_0x5f1883];return _0x226573;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62d3('0x0'));var rp=require(_0x62d3('0x1'));var moment=require(_0x62d3('0x2'));var BPromise=require(_0x62d3('0x3'));var Mustache=require('mustache');var util=require(_0x62d3('0x4'));var path=require(_0x62d3('0x5'));var sox=require(_0x62d3('0x6'));var csv=require(_0x62d3('0x7'));var ejs=require(_0x62d3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62d3('0x9'));var squel=require(_0x62d3('0xa'));var crypto=require(_0x62d3('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62d3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x62d3('0xc'));var authService=require(_0x62d3('0xd'));var qs=require(_0x62d3('0xe'));var as=require(_0x62d3('0xf'));var hardwareService=require(_0x62d3('0x10'));var logger=require(_0x62d3('0x11'))('api');var utils=require(_0x62d3('0x12'));var config=require(_0x62d3('0x13'));var licenseUtil=require(_0x62d3('0x14'));var db=require(_0x62d3('0x15'))['db'];var integrations=require(_0x62d3('0x16'));function respondWithStatusCode(_0x5d5116,_0x18d2ce){_0x18d2ce=_0x18d2ce||0xcc;return function(_0x232751){if(_0x232751){return _0x5d5116[_0x62d3('0x17')](_0x18d2ce);}return _0x5d5116[_0x62d3('0x18')](_0x18d2ce)[_0x62d3('0x19')]();};}function respondWithResult(_0xf0d206,_0x31e14c){_0x31e14c=_0x31e14c||0xc8;return function(_0xccdfc7){if(_0xccdfc7){return _0xf0d206[_0x62d3('0x18')](_0x31e14c)['json'](_0xccdfc7);}};}function respondWithFilteredResult(_0x2633dd,_0x19f514){return function(_0x23bd84){if(_0x23bd84){var _0x288252=typeof _0x19f514[_0x62d3('0x1a')]===_0x62d3('0x1b')&&typeof _0x19f514[_0x62d3('0x1c')]===_0x62d3('0x1b');var _0x117f78=_0x23bd84[_0x62d3('0x1d')];var _0x56e904=_0x288252?0x0:_0x19f514[_0x62d3('0x1a')];var _0x475a6b=_0x288252?_0x23bd84[_0x62d3('0x1d')]:_0x19f514[_0x62d3('0x1a')]+_0x19f514[_0x62d3('0x1c')];var _0x2c6768;if(_0x475a6b>=_0x117f78){_0x475a6b=_0x117f78;_0x2c6768=0xc8;}else{_0x2c6768=0xce;}_0x2633dd[_0x62d3('0x18')](_0x2c6768);return _0x2633dd[_0x62d3('0x1e')]('Content-Range',_0x56e904+'-'+_0x475a6b+'/'+_0x117f78)[_0x62d3('0x1f')](_0x23bd84);}return null;};}function patchUpdates(_0x10fde9){return function(_0x3d2579){try{jsonpatch['apply'](_0x3d2579,_0x10fde9,!![]);}catch(_0x4136a3){return BPromise[_0x62d3('0x20')](_0x4136a3);}return _0x3d2579[_0x62d3('0x21')]();};}function saveUpdates(_0x1a5ad6,_0x3ae70a){return function(_0x461cef){if(_0x461cef){return _0x461cef['update'](_0x1a5ad6)[_0x62d3('0x22')](function(_0x5dba32){return _0x5dba32;});}return null;};}function removeEntity(_0x2bb50d,_0x412415){return function(_0x26f12b){if(_0x26f12b){return _0x26f12b['destroy']()['then'](function(){_0x2bb50d[_0x62d3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x546161,_0xd6026d){return function(_0xac03ba){if(!_0xac03ba){_0x546161['sendStatus'](0x194);}return _0xac03ba;};}function handleError(_0xca8176,_0x3eb3e7){_0x3eb3e7=_0x3eb3e7||0x1f4;return function(_0x10939e){logger[_0x62d3('0x23')](_0x10939e[_0x62d3('0x24')]);if(_0x10939e[_0x62d3('0x25')]){delete _0x10939e[_0x62d3('0x25')];}_0xca8176[_0x62d3('0x18')](_0x3eb3e7)[_0x62d3('0x26')](_0x10939e);};}exports['index']=function(_0x30c742,_0x18ab99){var _0x12b7f9={},_0x5893aa={},_0x3e7a92={'count':0x0,'rows':[]};var _0x217b28=_[_0x62d3('0x27')](db[_0x62d3('0x28')][_0x62d3('0x29')],function(_0xa5edb9){return{'name':_0xa5edb9['fieldName'],'type':_0xa5edb9[_0x62d3('0x2a')]['key']};});_0x5893aa[_0x62d3('0x2b')]=_['map'](_0x217b28,_0x62d3('0x25'));_0x5893aa['query']=_['keys'](_0x30c742[_0x62d3('0x2c')]);_0x5893aa[_0x62d3('0x2d')]=_['intersection'](_0x5893aa['model'],_0x5893aa[_0x62d3('0x2c')]);_0x12b7f9[_0x62d3('0x2e')]=_[_0x62d3('0x2f')](_0x5893aa['model'],qs['fields'](_0x30c742[_0x62d3('0x2c')][_0x62d3('0x30')]));_0x12b7f9['attributes']=_0x12b7f9[_0x62d3('0x2e')][_0x62d3('0x31')]?_0x12b7f9[_0x62d3('0x2e')]:_0x5893aa[_0x62d3('0x2b')];if(!_0x30c742[_0x62d3('0x2c')][_0x62d3('0x32')]('nolimit')){_0x12b7f9[_0x62d3('0x1c')]=qs['limit'](_0x30c742[_0x62d3('0x2c')][_0x62d3('0x1c')]);_0x12b7f9[_0x62d3('0x1a')]=qs['offset'](_0x30c742['query'][_0x62d3('0x1a')]);}_0x12b7f9['order']=qs['sort'](_0x30c742[_0x62d3('0x2c')][_0x62d3('0x33')]);_0x12b7f9[_0x62d3('0x34')]=qs[_0x62d3('0x2d')](_['pick'](_0x30c742['query'],_0x5893aa['filters']),_0x217b28);if(_0x30c742[_0x62d3('0x2c')][_0x62d3('0x35')]){_0x12b7f9[_0x62d3('0x34')]=_['merge'](_0x12b7f9[_0x62d3('0x34')],{'$or':_[_0x62d3('0x27')](_0x217b28,function(_0x3e0f5b){if(_0x3e0f5b[_0x62d3('0x2a')]!==_0x62d3('0x36')){var _0x4655f9={};_0x4655f9[_0x3e0f5b['name']]={'$like':'%'+_0x30c742[_0x62d3('0x2c')][_0x62d3('0x35')]+'%'};return _0x4655f9;}})});}_0x12b7f9=_['merge']({},_0x12b7f9,_0x30c742['options']);var _0x3eae7f={'where':_0x12b7f9[_0x62d3('0x34')]};return db[_0x62d3('0x28')][_0x62d3('0x1d')](_0x3eae7f)['then'](function(_0x1cc9ad){_0x3e7a92[_0x62d3('0x1d')]=_0x1cc9ad;if(_0x30c742[_0x62d3('0x2c')][_0x62d3('0x37')]){_0x12b7f9[_0x62d3('0x38')]=[{'all':!![]}];}return db[_0x62d3('0x28')]['findAll'](_0x12b7f9);})[_0x62d3('0x22')](function(_0x238d76){_0x3e7a92['rows']=_0x238d76;return _0x3e7a92;})[_0x62d3('0x22')](respondWithFilteredResult(_0x18ab99,_0x12b7f9))[_0x62d3('0x39')](handleError(_0x18ab99,null));};exports[_0x62d3('0x3a')]=function(_0x1702c6,_0x52e530){var _0x28e13d={'raw':![],'where':{'id':_0x1702c6[_0x62d3('0x3b')]['id']}},_0xd86dd0={};_0xd86dd0['model']=_[_0x62d3('0x3c')](db[_0x62d3('0x28')][_0x62d3('0x29')]);_0xd86dd0['query']=_[_0x62d3('0x3c')](_0x1702c6['query']);_0xd86dd0[_0x62d3('0x2d')]=_[_0x62d3('0x2f')](_0xd86dd0[_0x62d3('0x2b')],_0xd86dd0[_0x62d3('0x2c')]);_0x28e13d['attributes']=_['intersection'](_0xd86dd0[_0x62d3('0x2b')],qs['fields'](_0x1702c6['query'][_0x62d3('0x30')]));_0x28e13d[_0x62d3('0x2e')]=_0x28e13d[_0x62d3('0x2e')][_0x62d3('0x31')]?_0x28e13d[_0x62d3('0x2e')]:_0xd86dd0[_0x62d3('0x2b')];if(_0x1702c6['query'][_0x62d3('0x37')]){_0x28e13d[_0x62d3('0x38')]=[{'all':!![]}];}_0x28e13d=_[_0x62d3('0x3d')]({},_0x28e13d,_0x1702c6[_0x62d3('0x3e')]);return db[_0x62d3('0x28')][_0x62d3('0x3f')](_0x28e13d)[_0x62d3('0x22')](handleEntityNotFound(_0x52e530,null))['then'](respondWithResult(_0x52e530,null))['catch'](handleError(_0x52e530,null));};exports[_0x62d3('0x40')]=function(_0x43bbb3,_0x20dd8d){return db[_0x62d3('0x28')][_0x62d3('0x40')](_0x43bbb3[_0x62d3('0x41')],{})[_0x62d3('0x22')](respondWithResult(_0x20dd8d,0xc9))[_0x62d3('0x39')](handleError(_0x20dd8d,null));};exports[_0x62d3('0x42')]=function(_0x2d8390,_0x17bd62){if(_0x2d8390[_0x62d3('0x41')]['id']){delete _0x2d8390['body']['id'];}return db[_0x62d3('0x28')][_0x62d3('0x3f')]({'where':{'id':_0x2d8390[_0x62d3('0x3b')]['id']}})[_0x62d3('0x22')](handleEntityNotFound(_0x17bd62,null))['then'](saveUpdates(_0x2d8390['body'],null))[_0x62d3('0x22')](respondWithResult(_0x17bd62,null))[_0x62d3('0x39')](handleError(_0x17bd62,null));};exports[_0x62d3('0x43')]=function(_0x4528fe,_0x5c2ed9){return db[_0x62d3('0x28')][_0x62d3('0x3f')]({'where':{'id':_0x4528fe['params']['id']}})[_0x62d3('0x22')](handleEntityNotFound(_0x5c2ed9,null))['then'](removeEntity(_0x5c2ed9,null))[_0x62d3('0x39')](handleError(_0x5c2ed9,null));};exports[_0x62d3('0x44')]=function(_0x1c2113,_0x14b127,_0x1b7785){var _0x30bc86={};var _0x306311={};var _0x1ffda0;var _0x30b8ec;return db[_0x62d3('0x28')]['findOne']({'where':{'id':_0x1c2113[_0x62d3('0x3b')]['id']}})[_0x62d3('0x22')](handleEntityNotFound(_0x14b127,null))['then'](function(_0x4e8fba){if(_0x4e8fba){_0x1ffda0=_0x4e8fba;_0x306311[_0x62d3('0x2b')]=_[_0x62d3('0x3c')](db[_0x62d3('0x45')][_0x62d3('0x29')]);_0x306311[_0x62d3('0x2c')]=_['keys'](_0x1c2113[_0x62d3('0x2c')]);_0x306311[_0x62d3('0x2d')]=_['intersection'](_0x306311[_0x62d3('0x2b')],_0x306311[_0x62d3('0x2c')]);_0x30bc86[_0x62d3('0x2e')]=_[_0x62d3('0x2f')](_0x306311['model'],qs[_0x62d3('0x30')](_0x1c2113[_0x62d3('0x2c')][_0x62d3('0x30')]));_0x30bc86[_0x62d3('0x2e')]=_0x30bc86[_0x62d3('0x2e')]['length']?_0x30bc86[_0x62d3('0x2e')]:_0x306311[_0x62d3('0x2b')];_0x30bc86[_0x62d3('0x46')]=qs[_0x62d3('0x33')](_0x1c2113['query'][_0x62d3('0x33')]);_0x30bc86[_0x62d3('0x34')]=qs['filters'](_['pick'](_0x1c2113[_0x62d3('0x2c')],_0x306311[_0x62d3('0x2d')]));if(_0x1c2113['query'][_0x62d3('0x35')]){_0x30bc86[_0x62d3('0x34')]=_[_0x62d3('0x3d')](_0x30bc86[_0x62d3('0x34')],{'$or':_[_0x62d3('0x27')](_0x30bc86[_0x62d3('0x2e')],function(_0x1c3426){var _0x3b3eca={};_0x3b3eca[_0x1c3426]={'$like':'%'+_0x1c2113[_0x62d3('0x2c')][_0x62d3('0x35')]+'%'};return _0x3b3eca;})});}_0x30bc86=_['merge']({},_0x30bc86,_0x1c2113['options']);return _0x1ffda0[_0x62d3('0x44')](_0x30bc86);}})[_0x62d3('0x22')](function(_0x3c4ce7){if(_0x3c4ce7){_0x30b8ec=_0x3c4ce7[_0x62d3('0x31')];if(!_0x1c2113[_0x62d3('0x2c')][_0x62d3('0x32')](_0x62d3('0x47'))){_0x30bc86[_0x62d3('0x1c')]=qs[_0x62d3('0x1c')](_0x1c2113[_0x62d3('0x2c')]['limit']);_0x30bc86[_0x62d3('0x1a')]=qs[_0x62d3('0x1a')](_0x1c2113['query']['offset']);}return _0x1ffda0[_0x62d3('0x44')](_0x30bc86);}})[_0x62d3('0x22')](function(_0x274980){if(_0x274980){return _0x274980?{'count':_0x30b8ec,'rows':_0x274980}:null;}})[_0x62d3('0x22')](respondWithResult(_0x14b127,null))[_0x62d3('0x39')](handleError(_0x14b127,null));};exports[_0x62d3('0x48')]=function(_0x59b48c,_0x2331cb,_0x25df2a){if(_0x59b48c[_0x62d3('0x41')]['id']){delete _0x59b48c['body']['id'];}return db[_0x62d3('0x28')]['findOne']({'where':{'id':_0x59b48c[_0x62d3('0x3b')]['id']}})[_0x62d3('0x22')](handleEntityNotFound(_0x2331cb,null))[_0x62d3('0x22')](function(_0x5eddb0){if(_0x5eddb0){_0x59b48c[_0x62d3('0x41')][_0x62d3('0x49')]=_0x5eddb0['id'];_0x59b48c[_0x62d3('0x41')][_0x62d3('0x4a')]=integrations['getSubjects'](_0x59b48c[_0x62d3('0x41')][_0x62d3('0x4b')],_0x59b48c[_0x62d3('0x41')][_0x62d3('0x2a')]);_0x59b48c['body']['Descriptions']=integrations['getDescriptions'](_0x59b48c[_0x62d3('0x41')][_0x62d3('0x4b')],_0x59b48c[_0x62d3('0x41')][_0x62d3('0x2a')]);return db['VtigerConfiguration'][_0x62d3('0x40')](_0x59b48c[_0x62d3('0x41')],{'include':[{'model':db[_0x62d3('0x4c')],'as':_0x62d3('0x4a')},{'model':db[_0x62d3('0x4c')],'as':_0x62d3('0x4d')}]});}return null;})[_0x62d3('0x22')](respondWithResult(_0x2331cb,null))[_0x62d3('0x39')](handleError(_0x2331cb,null));};var md5=require(_0x62d3('0x4e'));exports[_0x62d3('0x4f')]=function(_0x57df4d,_0x4dadfd,_0x4ebf51){var _0x4bcf1d=null;var _0x409a82=null;var _0xe5cadb=null;var _0x1c2534=null;var _0x496d8b='';return db[_0x62d3('0x28')][_0x62d3('0x50')]({'where':{'id':_0x57df4d[_0x62d3('0x3b')]['id']},'attributes':['id',_0x62d3('0x25'),_0x62d3('0x51'),_0x62d3('0x52'),_0x62d3('0x53'),'remoteUri','serverUrl',_0x62d3('0x54')]})[_0x62d3('0x22')](handleEntityNotFound(_0x4dadfd,null))['then'](function(_0x546a61){if(_0x546a61){_0x4bcf1d=_0x546a61[_0x62d3('0x51')];_0x409a82=_0x546a61[_0x62d3('0x54')];_0xe5cadb=_0x546a61[_0x62d3('0x53')];_0x496d8b=_0x546a61['remoteUri'];var _0x2c7704=_0x496d8b['slice'](-0x1);if(_0x2c7704==='/'){_0x496d8b=_0x496d8b[_0x62d3('0x55')](0x0,_0x496d8b[_0x62d3('0x56')](_0x2c7704));}_0x1c2534=util['format'](_0x62d3('0x57'),_0x496d8b);var _0x5b978e={'method':_0x62d3('0x58'),'uri':_0x1c2534,'qs':{'operation':_0x62d3('0x59'),'username':_0x546a61[_0x62d3('0x51')]},'json':!![]};return rp(_0x5b978e);}})[_0x62d3('0x22')](function(_0x2dde5b){if(_0x2dde5b[_0x62d3('0x5a')]){var _0x119263={'method':'POST','uri':_0x1c2534,'form':{'operation':_0x62d3('0x5b'),'username':_0x4bcf1d,'accessKey':md5(_0x2dde5b[_0x62d3('0x5c')][_0x62d3('0x5d')]+_0x409a82)},'json':!![]};return rp(_0x119263);}})[_0x62d3('0x22')](function(_0x1bad51){if(_0x1bad51[_0x62d3('0x5a')]){var _0xc75f98={'method':'GET','uri':_0x1c2534,'qs':{'operation':_0x62d3('0x5e'),'username':_0x4bcf1d,'sessionName':_0x1bad51[_0x62d3('0x5c')][_0x62d3('0x5f')],'elementType':_0xe5cadb},'json':!![]};return rp(_0xc75f98);}})[_0x62d3('0x22')](function(_0xe7c3e8){if(_0xe7c3e8['success']){var _0x533876=[_0x62d3('0x60'),'reference','owner'];_[_0x62d3('0x61')](_0xe7c3e8['result'][_0x62d3('0x30')],function(_0x2c07c4){return _0x533876[_0x62d3('0x62')](_0x2c07c4[_0x62d3('0x2a')][_0x62d3('0x25')]);});_[_0x62d3('0x61')](_0xe7c3e8['result'][_0x62d3('0x30')],function(_0x51df9c){return _0x51df9c[_0x62d3('0x63')]==='false';});return{'count':_0xe7c3e8[_0x62d3('0x5c')]['fields'][_0x62d3('0x31')],'rows':_[_0x62d3('0x27')](_0xe7c3e8['result'][_0x62d3('0x30')],function(_0x274faa){return{'id':_0x274faa[_0x62d3('0x25')],'name':_0x274faa[_0x62d3('0x64')],'custom':_[_0x62d3('0x65')](_0x274faa[_0x62d3('0x25')],_0x62d3('0x66'))?!![]:![],'options':_0x274faa['type'][_0x62d3('0x25')]===_0x62d3('0x67')&&_0x274faa[_0x62d3('0x2a')]['picklistValues']['length']>0x0?_[_0x62d3('0x27')](_0x274faa[_0x62d3('0x2a')][_0x62d3('0x68')],function(_0x42e38a){return{'name':_0x42e38a[_0x62d3('0x64')],'value':_0x42e38a[_0x62d3('0x69')]};}):[]};})};}})['then'](respondWithResult(_0x4dadfd,null))[_0x62d3('0x39')](function(_0x5725a4){console[_0x62d3('0x6a')](_0x62d3('0x6b')+_0x5725a4);var _0x26fec8=_0x57df4d[_0x62d3('0x2c')]['test']?0x1f4:_0x5725a4[_0x62d3('0x6c')]||0x1f4;logger[_0x62d3('0x23')](_0x62d3('0x6d'),'getFields',_0x26fec8,JSON[_0x62d3('0x6e')](_0x5725a4));delete _0x5725a4[_0x62d3('0x25')];if(_0x26fec8===0x191){_0x26fec8=0x190;}_0x4dadfd['status'](_0x26fec8)['send'](_0x57df4d[_0x62d3('0x2c')][_0x62d3('0x6f')]?{'message':_0x62d3('0x70'),'statusCode':_0x5725a4[_0x62d3('0x6c')]}:_0x5725a4);});};
\ No newline at end of file
index 8147598..b32c110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6348=['../../config/logger','moment','request-promise','path','../../config/environment','./intVtigerAccount.attributes','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x34e868,_0x2df496){var _0x521766=function(_0x5d5a1c){while(--_0x5d5a1c){_0x34e868['push'](_0x34e868['shift']());}};_0x521766(++_0x2df496);}(_0x6348,0x132));var _0x8634=function(_0xf0e0c4,_0x5449ee){_0xf0e0c4=_0xf0e0c4-0x0;var _0x432bcb=_0x6348[_0xf0e0c4];return _0x432bcb;};'use strict';var _=require(_0x8634('0x0'));var util=require(_0x8634('0x1'));var logger=require(_0x8634('0x2'))('api');var moment=require(_0x8634('0x3'));var BPromise=require('bluebird');var rp=require(_0x8634('0x4'));var fs=require('fs');var path=require(_0x8634('0x5'));var rimraf=require('rimraf');var config=require(_0x8634('0x6'));var attributes=require(_0x8634('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x522d3a,_0x388fce){return _0x522d3a[_0x8634('0x8')](_0x8634('0x9'),attributes,{'tableName':_0x8634('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fc6=['define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x2a46c8,_0x301107){var _0x4817a4=function(_0x80bc8b){while(--_0x80bc8b){_0x2a46c8['push'](_0x2a46c8['shift']());}};_0x4817a4(++_0x301107);}(_0x8fc6,0x17f));var _0x68fc=function(_0x489b01,_0x597248){_0x489b01=_0x489b01-0x0;var _0x5dcc6c=_0x8fc6[_0x489b01];return _0x5dcc6c;};'use strict';var _=require(_0x68fc('0x0'));var util=require('util');var logger=require(_0x68fc('0x1'))('api');var moment=require(_0x68fc('0x2'));var BPromise=require(_0x68fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x68fc('0x4'));var config=require(_0x68fc('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x68fc('0x6')]=function(_0x1000ff,_0x1bd7ad){return _0x1000ff[_0x68fc('0x7')](_0x68fc('0x8'),attributes,{'tableName':_0x68fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57e6a44..1c04c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3c=['catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xed3c,0x1a6));var _0xced3=function(_0x18d38c,_0xc5c2d3){_0x18d38c=_0x18d38c-0x0;var _0x474ba7=_0xed3c[_0x18d38c];return _0x474ba7;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['GetVtigerAccount']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')]({'raw':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x4569af[_0xced3('0x17')]?_0x4569af['options']['attributes']||null:null,'limit':_0x4569af['options']?_0x4569af[_0xced3('0x17')][_0xced3('0x1a')]||null:null,'include':_0x4569af[_0xced3('0x17')]?_0x4569af['options'][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x4569af['options']['include'],function(_0x3adf14){return{'model':db[_0x3adf14[_0xced3('0x1d')]],'as':_0x3adf14['as'],'attributes':_0x3adf14[_0xced3('0x1e')],'include':_0x3adf14[_0xced3('0x1b')]?_['map'](_0x3adf14[_0xced3('0x1b')],function(_0x23f92b){return{'model':db[_0x23f92b['model']],'as':_0x23f92b['as'],'attributes':_0x23f92b[_0xced3('0x1e')],'include':_0x23f92b['include']?_[_0xced3('0x1c')](_0x23f92b[_0xced3('0x1b')],function(_0x3b728d){return{'model':db[_0x3b728d[_0xced3('0x1d')]],'as':_0x3b728d['as'],'attributes':_0x3b728d[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5454c0){logger[_0xced3('0xb')]('GetVtigerAccount',_0x4569af);logger[_0xced3('0xe')](_0xced3('0x1f'),_0x4569af,JSON['stringify'](_0x5454c0));_0x353580(_0x5454c0);})[_0xced3('0x14')](function(_0x4024fa){logger[_0xced3('0x10')](_0xced3('0x1f'),_0x4024fa[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe[_0xced3('0x10')](0x1f4,_0x4024fa[_0xced3('0x12')]));});});};exports[_0xced3('0x20')]=function(_0x116cc7){var _0x559b8e=this;return new Promise(function(_0xa78899,_0x1b8baa){return db[_0xced3('0x15')][_0xced3('0x21')]({'raw':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1e')]||null:null,'include':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')],function(_0xcd0fe3){return{'model':db[_0xcd0fe3[_0xced3('0x1d')]],'as':_0xcd0fe3['as'],'attributes':_0xcd0fe3['attributes'],'include':_0xcd0fe3[_0xced3('0x1b')]?_['map'](_0xcd0fe3[_0xced3('0x1b')],function(_0x28f674){return{'model':db[_0x28f674[_0xced3('0x1d')]],'as':_0x28f674['as'],'attributes':_0x28f674[_0xced3('0x1e')],'include':_0x28f674[_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x28f674[_0xced3('0x1b')],function(_0x340be1){return{'model':db[_0x340be1[_0xced3('0x1d')]],'as':_0x340be1['as'],'attributes':_0x340be1[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x342c11){logger[_0xced3('0xb')]('ShowVtigerAccount',_0x116cc7);logger[_0xced3('0xe')](_0xced3('0x20'),_0x116cc7,JSON[_0xced3('0xf')](_0x342c11));_0xa78899(_0x342c11);})['catch'](function(_0x59c3aa){logger[_0xced3('0x10')]('ShowVtigerAccount',_0x59c3aa[_0xced3('0x12')],_0x116cc7);_0x1b8baa(_0x559b8e[_0xced3('0x10')](0x1f4,_0x59c3aa['message']));});});};
\ No newline at end of file
+var _0x91a7=['VtigerAccount,\x20%s,\x20%s','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','ShowVtigerAccount','VtigerAccount','find','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x3046da,_0x599123){var _0x467db2=function(_0x17aa26){while(--_0x17aa26){_0x3046da['push'](_0x3046da['shift']());}};_0x467db2(++_0x599123);}(_0x91a7,0xe7));var _0x791a=function(_0x201817,_0x4d84c0){_0x201817=_0x201817-0x0;var _0x3716dc=_0x91a7[_0x201817];return _0x3716dc;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});}exports[_0x791a('0x13')]=function(_0x52941d){var _0x4a84ee=this;return new Promise(function(_0x588d00,_0x40f0d3){return db['VtigerAccount']['findAll']({'raw':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x15')]===undefined?!![]:![]:!![],'where':_0x52941d[_0x791a('0x14')]?_0x52941d['options'][_0x791a('0x16')]||null:null,'attributes':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x17')]||null:null,'limit':_0x52941d['options']?_0x52941d[_0x791a('0x14')][_0x791a('0x18')]||null:null,'include':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x52941d[_0x791a('0x14')][_0x791a('0x19')],function(_0x323c6a){return{'model':db[_0x323c6a[_0x791a('0x1b')]],'as':_0x323c6a['as'],'attributes':_0x323c6a[_0x791a('0x17')],'include':_0x323c6a['include']?_[_0x791a('0x1a')](_0x323c6a[_0x791a('0x19')],function(_0x380329){return{'model':db[_0x380329[_0x791a('0x1b')]],'as':_0x380329['as'],'attributes':_0x380329['attributes'],'include':_0x380329[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x380329['include'],function(_0xdfa84f){return{'model':db[_0xdfa84f[_0x791a('0x1b')]],'as':_0xdfa84f['as'],'attributes':_0xdfa84f[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29194d){logger[_0x791a('0xa')](_0x791a('0x13'),_0x52941d);logger[_0x791a('0xc')](_0x791a('0x13'),_0x52941d,JSON[_0x791a('0xd')](_0x29194d));_0x588d00(_0x29194d);})[_0x791a('0x12')](function(_0x889534){logger['error'](_0x791a('0x13'),_0x889534[_0x791a('0x10')],_0x52941d);_0x40f0d3(_0x4a84ee[_0x791a('0xe')](0x1f4,_0x889534['message']));});});};exports[_0x791a('0x1c')]=function(_0x5df656){var _0xc59f5e=this;return new Promise(function(_0x2e4ec8,_0xcde862){return db[_0x791a('0x1d')][_0x791a('0x1e')]({'raw':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x16')]||null:null,'attributes':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['attributes']||null:null,'include':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x5df656[_0x791a('0x14')]['include'],function(_0x305836){return{'model':db[_0x305836[_0x791a('0x1b')]],'as':_0x305836['as'],'attributes':_0x305836[_0x791a('0x17')],'include':_0x305836[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x305836['include'],function(_0xd5609){return{'model':db[_0xd5609['model']],'as':_0xd5609['as'],'attributes':_0xd5609[_0x791a('0x17')],'include':_0xd5609['include']?_['map'](_0xd5609[_0x791a('0x19')],function(_0x404530){return{'model':db[_0x404530[_0x791a('0x1b')]],'as':_0x404530['as'],'attributes':_0x404530[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x791a('0x9')](function(_0x3f46be){logger[_0x791a('0xa')]('ShowVtigerAccount',_0x5df656);logger[_0x791a('0xc')]('ShowVtigerAccount',_0x5df656,JSON[_0x791a('0xd')](_0x3f46be));_0x2e4ec8(_0x3f46be);})['catch'](function(_0x25e8cc){logger[_0x791a('0xe')]('ShowVtigerAccount',_0x25e8cc[_0x791a('0x10')],_0x5df656);_0xcde862(_0xc59f5e[_0x791a('0xe')](0x1f4,_0x25e8cc['message']));});});};
\ No newline at end of file
index acf2a09..681d76c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a07=['update','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','getDescriptions','post'];(function(_0x31333a,_0x15296c){var _0x5329d1=function(_0x5beb61){while(--_0x5beb61){_0x31333a['push'](_0x31333a['shift']());}};_0x5329d1(++_0x15296c);}(_0x4a07,0xff));var _0x74a0=function(_0x20588d,_0x14e6e2){_0x20588d=_0x20588d-0x0;var _0x3ff0a1=_0x4a07[_0x20588d];return _0x3ff0a1;};'use strict';var multer=require('multer');var util=require(_0x74a0('0x0'));var path=require(_0x74a0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x74a0('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x74a0('0x3'));var config=require(_0x74a0('0x4'));var controller=require(_0x74a0('0x5'));router[_0x74a0('0x6')]('/',auth[_0x74a0('0x7')](),controller[_0x74a0('0x8')]);router[_0x74a0('0x6')](_0x74a0('0x9'),auth[_0x74a0('0x7')](),controller[_0x74a0('0xa')]);router[_0x74a0('0x6')](_0x74a0('0xb'),auth[_0x74a0('0x7')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x74a0('0x7')](),controller[_0x74a0('0xc')]);router['get']('/:id/descriptions',auth[_0x74a0('0x7')](),controller[_0x74a0('0xd')]);router[_0x74a0('0xe')]('/',auth[_0x74a0('0x7')](),controller['create']);router['put'](_0x74a0('0x9'),auth['isAuthenticated'](),controller[_0x74a0('0xf')]);router['delete'](_0x74a0('0x9'),auth[_0x74a0('0x7')](),controller[_0x74a0('0x10')]);module[_0x74a0('0x11')]=router;
\ No newline at end of file
+var _0x52c1=['path','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','/:id/fields','getFields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer'];(function(_0x581d53,_0x4ad997){var _0x56c2d8=function(_0x32350b){while(--_0x32350b){_0x581d53['push'](_0x581d53['shift']());}};_0x56c2d8(++_0x4ad997);}(_0x52c1,0xd1));var _0x152c=function(_0x25cf9d,_0x5742ff){_0x25cf9d=_0x25cf9d-0x0;var _0x24f116=_0x52c1[_0x25cf9d];return _0x24f116;};'use strict';var multer=require(_0x152c('0x0'));var util=require('util');var path=require(_0x152c('0x1'));var timeout=require('connect-timeout');var express=require(_0x152c('0x2'));var router=express['Router']();var fs_extra=require(_0x152c('0x3'));var auth=require(_0x152c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x152c('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0x152c('0x6')]('/',auth['isAuthenticated'](),controller[_0x152c('0x7')]);router['get'](_0x152c('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x152c('0x6')](_0x152c('0x9'),auth['isAuthenticated'](),controller[_0x152c('0xa')]);router[_0x152c('0x6')](_0x152c('0xb'),auth[_0x152c('0xc')](),controller['getSubjects']);router[_0x152c('0x6')](_0x152c('0xd'),auth[_0x152c('0xc')](),controller[_0x152c('0xe')]);router[_0x152c('0xf')]('/',auth[_0x152c('0xc')](),controller[_0x152c('0x10')]);router[_0x152c('0x11')](_0x152c('0x8'),auth[_0x152c('0xc')](),controller['update']);router[_0x152c('0x12')](_0x152c('0x8'),auth['isAuthenticated'](),controller[_0x152c('0x13')]);module[_0x152c('0x14')]=router;
\ No newline at end of file
index fdc878e..bfbe1a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5cf=['sequelize','exports','STRING'];(function(_0x582ae6,_0x57aa08){var _0x303447=function(_0x158d7b){while(--_0x158d7b){_0x582ae6['push'](_0x582ae6['shift']());}};_0x303447(++_0x57aa08);}(_0xd5cf,0x7e));var _0xfd5c=function(_0x49a9d7,_0x4a84ec){_0x49a9d7=_0x49a9d7-0x0;var _0x5a5f75=_0xd5cf[_0x49a9d7];return _0x5a5f75;};'use strict';var Sequelize=require(_0xfd5c('0x0'));module[_0xfd5c('0x1')]={'name':{'type':Sequelize[_0xfd5c('0x2')]},'description':{'type':Sequelize[_0xfd5c('0x2')]}};
\ No newline at end of file
+var _0x9b53=['sequelize','exports','STRING'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0x9b53,0x1d7));var _0x39b5=function(_0x265573,_0x3e99bd){_0x265573=_0x265573-0x0;var _0x479b38=_0x9b53[_0x265573];return _0x479b38;};'use strict';var Sequelize=require(_0x39b5('0x0'));module[_0x39b5('0x1')]={'name':{'type':Sequelize[_0x39b5('0x2')]},'description':{'type':Sequelize[_0x39b5('0x2')]}};
\ No newline at end of file
index cc79dc0..19468b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f3=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','undefined','limit','count','offset','Content-Range','json','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','map','keys','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','VtigerConfiguration','include','findAll','rows','catch','show','params','length','includeAll','find','body','getFields','nolimit','getSubjects','findOne','VtigerField','getDescriptions','rimraf','fast-json-patch','request-promise'];(function(_0x443e7a,_0x2d6688){var _0x539947=function(_0x228bb4){while(--_0x228bb4){_0x443e7a['push'](_0x443e7a['shift']());}};_0x539947(++_0x2d6688);}(_0x44f3,0x192));var _0x344f=function(_0x99d82b,_0xb161b8){_0x99d82b=_0x99d82b-0x0;var _0x1c85f0=_0x44f3[_0x99d82b];return _0x1c85f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x344f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x344f('0x1'));var rp=require(_0x344f('0x2'));var moment=require(_0x344f('0x3'));var BPromise=require(_0x344f('0x4'));var Mustache=require('mustache');var util=require(_0x344f('0x5'));var path=require(_0x344f('0x6'));var sox=require(_0x344f('0x7'));var csv=require(_0x344f('0x8'));var ejs=require(_0x344f('0x9'));var fs=require('fs');var fs_extra=require(_0x344f('0xa'));var _=require(_0x344f('0xb'));var squel=require(_0x344f('0xc'));var crypto=require(_0x344f('0xd'));var jsforce=require(_0x344f('0xe'));var deskjs=require(_0x344f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x344f('0x10'));var Papa=require(_0x344f('0x11'));var Redis=require(_0x344f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x344f('0x13'));var as=require(_0x344f('0x14'));var hardwareService=require(_0x344f('0x15'));var logger=require('../../config/logger')(_0x344f('0x16'));var utils=require(_0x344f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54456a,_0x17479d){_0x17479d=_0x17479d||0xcc;return function(_0x1189a7){if(_0x1189a7){return _0x54456a['sendStatus'](_0x17479d);}return _0x54456a[_0x344f('0x18')](_0x17479d)['end']();};}function respondWithResult(_0x473fdd,_0x1d5567){_0x1d5567=_0x1d5567||0xc8;return function(_0x4bd58f){if(_0x4bd58f){return _0x473fdd[_0x344f('0x18')](_0x1d5567)['json'](_0x4bd58f);}};}function respondWithFilteredResult(_0x268c2c,_0x36040f){return function(_0x145d86){if(_0x145d86){var _0x233c42=typeof _0x36040f['offset']===_0x344f('0x19')&&typeof _0x36040f[_0x344f('0x1a')]===_0x344f('0x19');var _0xf8b37f=_0x145d86[_0x344f('0x1b')];var _0x465d06=_0x233c42?0x0:_0x36040f[_0x344f('0x1c')];var _0x3a6108=_0x233c42?_0x145d86[_0x344f('0x1b')]:_0x36040f[_0x344f('0x1c')]+_0x36040f[_0x344f('0x1a')];var _0xc558df;if(_0x3a6108>=_0xf8b37f){_0x3a6108=_0xf8b37f;_0xc558df=0xc8;}else{_0xc558df=0xce;}_0x268c2c[_0x344f('0x18')](_0xc558df);return _0x268c2c['set'](_0x344f('0x1d'),_0x465d06+'-'+_0x3a6108+'/'+_0xf8b37f)[_0x344f('0x1e')](_0x145d86);}return null;};}function patchUpdates(_0x1da5b0){return function(_0x379954){try{jsonpatch['apply'](_0x379954,_0x1da5b0,!![]);}catch(_0x5dafd6){return BPromise[_0x344f('0x1f')](_0x5dafd6);}return _0x379954[_0x344f('0x20')]();};}function saveUpdates(_0x372b69,_0x389f33){return function(_0x94ea6){if(_0x94ea6){return _0x94ea6[_0x344f('0x21')](_0x372b69)['then'](function(_0x5b6484){return _0x5b6484;});}return null;};}function removeEntity(_0x51d875,_0x2ed220){return function(_0x4c3819){if(_0x4c3819){return _0x4c3819[_0x344f('0x22')]()[_0x344f('0x23')](function(){_0x51d875[_0x344f('0x18')](0xcc)[_0x344f('0x24')]();});}};}function handleEntityNotFound(_0x54d047,_0x5d25ae){return function(_0xe61411){if(!_0xe61411){_0x54d047[_0x344f('0x25')](0x194);}return _0xe61411;};}function handleError(_0x97583a,_0xa1646c){_0xa1646c=_0xa1646c||0x1f4;return function(_0x56af63){logger[_0x344f('0x26')](_0x56af63[_0x344f('0x27')]);if(_0x56af63[_0x344f('0x28')]){delete _0x56af63['name'];}_0x97583a[_0x344f('0x18')](_0xa1646c)[_0x344f('0x29')](_0x56af63);};}exports[_0x344f('0x2a')]=function(_0x10d436,_0x2dbd2a){var _0x338990={},_0xdecb85={},_0x29d954={'count':0x0,'rows':[]};var _0x9226cf=_['map'](db['VtigerConfiguration'][_0x344f('0x2b')],function(_0x452a0e){return{'name':_0x452a0e[_0x344f('0x2c')],'type':_0x452a0e['type'][_0x344f('0x2d')]};});_0xdecb85['model']=_[_0x344f('0x2e')](_0x9226cf,_0x344f('0x28'));_0xdecb85['query']=_[_0x344f('0x2f')](_0x10d436[_0x344f('0x30')]);_0xdecb85['filters']=_[_0x344f('0x31')](_0xdecb85[_0x344f('0x32')],_0xdecb85[_0x344f('0x30')]);_0x338990[_0x344f('0x33')]=_[_0x344f('0x31')](_0xdecb85['model'],qs[_0x344f('0x34')](_0x10d436[_0x344f('0x30')][_0x344f('0x34')]));_0x338990[_0x344f('0x33')]=_0x338990['attributes']['length']?_0x338990['attributes']:_0xdecb85[_0x344f('0x32')];if(!_0x10d436[_0x344f('0x30')][_0x344f('0x35')]('nolimit')){_0x338990[_0x344f('0x1a')]=qs['limit'](_0x10d436[_0x344f('0x30')][_0x344f('0x1a')]);_0x338990[_0x344f('0x1c')]=qs['offset'](_0x10d436[_0x344f('0x30')][_0x344f('0x1c')]);}_0x338990[_0x344f('0x36')]=qs[_0x344f('0x37')](_0x10d436[_0x344f('0x30')][_0x344f('0x37')]);_0x338990[_0x344f('0x38')]=qs[_0x344f('0x39')](_[_0x344f('0x3a')](_0x10d436[_0x344f('0x30')],_0xdecb85['filters']),_0x9226cf);if(_0x10d436['query']['filter']){_0x338990[_0x344f('0x38')]=_[_0x344f('0x3b')](_0x338990['where'],{'$or':_[_0x344f('0x2e')](_0x9226cf,function(_0x2754df){if(_0x2754df[_0x344f('0x3c')]!==_0x344f('0x3d')){var _0x1f9454={};_0x1f9454[_0x2754df['name']]={'$like':'%'+_0x10d436['query'][_0x344f('0x3e')]+'%'};return _0x1f9454;}})});}_0x338990=_[_0x344f('0x3b')]({},_0x338990,_0x10d436[_0x344f('0x3f')]);var _0xfa05b2={'where':_0x338990['where']};return db[_0x344f('0x40')][_0x344f('0x1b')](_0xfa05b2)[_0x344f('0x23')](function(_0xa9bdbe){_0x29d954[_0x344f('0x1b')]=_0xa9bdbe;if(_0x10d436[_0x344f('0x30')]['includeAll']){_0x338990[_0x344f('0x41')]=[{'all':!![]}];}return db[_0x344f('0x40')][_0x344f('0x42')](_0x338990);})[_0x344f('0x23')](function(_0x5ba250){_0x29d954[_0x344f('0x43')]=_0x5ba250;return _0x29d954;})[_0x344f('0x23')](respondWithFilteredResult(_0x2dbd2a,_0x338990))[_0x344f('0x44')](handleError(_0x2dbd2a,null));};exports[_0x344f('0x45')]=function(_0x110b83,_0x4ee711){var _0x281ca0={'raw':![],'where':{'id':_0x110b83[_0x344f('0x46')]['id']}},_0x220216={};_0x220216[_0x344f('0x32')]=_[_0x344f('0x2f')](db[_0x344f('0x40')][_0x344f('0x2b')]);_0x220216[_0x344f('0x30')]=_[_0x344f('0x2f')](_0x110b83[_0x344f('0x30')]);_0x220216[_0x344f('0x39')]=_[_0x344f('0x31')](_0x220216['model'],_0x220216['query']);_0x281ca0[_0x344f('0x33')]=_[_0x344f('0x31')](_0x220216[_0x344f('0x32')],qs[_0x344f('0x34')](_0x110b83[_0x344f('0x30')]['fields']));_0x281ca0[_0x344f('0x33')]=_0x281ca0[_0x344f('0x33')][_0x344f('0x47')]?_0x281ca0['attributes']:_0x220216[_0x344f('0x32')];if(_0x110b83[_0x344f('0x30')][_0x344f('0x48')]){_0x281ca0[_0x344f('0x41')]=[{'all':!![]}];}_0x281ca0=_['merge']({},_0x281ca0,_0x110b83['options']);return db[_0x344f('0x40')][_0x344f('0x49')](_0x281ca0)[_0x344f('0x23')](handleEntityNotFound(_0x4ee711,null))['then'](respondWithResult(_0x4ee711,null))[_0x344f('0x44')](handleError(_0x4ee711,null));};exports['create']=function(_0x3bd176,_0x2fd491){return db[_0x344f('0x40')]['create'](_0x3bd176['body'],{})['then'](respondWithResult(_0x2fd491,0xc9))[_0x344f('0x44')](handleError(_0x2fd491,null));};exports['update']=function(_0x4aace5,_0x35a6eb){if(_0x4aace5[_0x344f('0x4a')]['id']){delete _0x4aace5['body']['id'];}return db[_0x344f('0x40')]['find']({'where':{'id':_0x4aace5['params']['id']}})[_0x344f('0x23')](handleEntityNotFound(_0x35a6eb,null))['then'](saveUpdates(_0x4aace5['body'],null))[_0x344f('0x23')](respondWithResult(_0x35a6eb,null))['catch'](handleError(_0x35a6eb,null));};exports['destroy']=function(_0x186dc9,_0x4a1900){return db['VtigerConfiguration']['find']({'where':{'id':_0x186dc9[_0x344f('0x46')]['id']}})[_0x344f('0x23')](handleEntityNotFound(_0x4a1900,null))[_0x344f('0x23')](removeEntity(_0x4a1900,null))['catch'](handleError(_0x4a1900,null));};exports[_0x344f('0x4b')]=function(_0x387c17,_0x5e20fa,_0x5c461){var _0x36bd70={};var _0x4d069a={};var _0x2177fe;var _0x31b86c;return db[_0x344f('0x40')]['findOne']({'where':{'id':_0x387c17[_0x344f('0x46')]['id']}})[_0x344f('0x23')](handleEntityNotFound(_0x5e20fa,null))[_0x344f('0x23')](function(_0x37d8ec){if(_0x37d8ec){_0x2177fe=_0x37d8ec;_0x4d069a[_0x344f('0x32')]=_[_0x344f('0x2f')](db['VtigerField'][_0x344f('0x2b')]);_0x4d069a[_0x344f('0x30')]=_[_0x344f('0x2f')](_0x387c17[_0x344f('0x30')]);_0x4d069a[_0x344f('0x39')]=_[_0x344f('0x31')](_0x4d069a['model'],_0x4d069a[_0x344f('0x30')]);_0x36bd70[_0x344f('0x33')]=_[_0x344f('0x31')](_0x4d069a['model'],qs['fields'](_0x387c17[_0x344f('0x30')][_0x344f('0x34')]));_0x36bd70[_0x344f('0x33')]=_0x36bd70[_0x344f('0x33')][_0x344f('0x47')]?_0x36bd70[_0x344f('0x33')]:_0x4d069a[_0x344f('0x32')];_0x36bd70[_0x344f('0x36')]=qs[_0x344f('0x37')](_0x387c17[_0x344f('0x30')]['sort']);_0x36bd70[_0x344f('0x38')]=qs[_0x344f('0x39')](_['pick'](_0x387c17['query'],_0x4d069a['filters']));if(_0x387c17[_0x344f('0x30')][_0x344f('0x3e')]){_0x36bd70[_0x344f('0x38')]=_[_0x344f('0x3b')](_0x36bd70['where'],{'$or':_[_0x344f('0x2e')](_0x36bd70[_0x344f('0x33')],function(_0x8d9c0f){var _0x151631={};_0x151631[_0x8d9c0f]={'$like':'%'+_0x387c17['query'][_0x344f('0x3e')]+'%'};return _0x151631;})});}_0x36bd70=_[_0x344f('0x3b')]({},_0x36bd70,_0x387c17[_0x344f('0x3f')]);return _0x2177fe[_0x344f('0x4b')](_0x36bd70);}})[_0x344f('0x23')](function(_0x244889){if(_0x244889){_0x31b86c=_0x244889[_0x344f('0x47')];if(!_0x387c17[_0x344f('0x30')][_0x344f('0x35')](_0x344f('0x4c'))){_0x36bd70[_0x344f('0x1a')]=qs[_0x344f('0x1a')](_0x387c17[_0x344f('0x30')][_0x344f('0x1a')]);_0x36bd70['offset']=qs['offset'](_0x387c17[_0x344f('0x30')]['offset']);}return _0x2177fe[_0x344f('0x4b')](_0x36bd70);}})[_0x344f('0x23')](function(_0x392bae){if(_0x392bae){return _0x392bae?{'count':_0x31b86c,'rows':_0x392bae}:null;}})[_0x344f('0x23')](respondWithResult(_0x5e20fa,null))[_0x344f('0x44')](handleError(_0x5e20fa,null));};exports[_0x344f('0x4d')]=function(_0x1318ee,_0x239328,_0x3e915f){var _0x546b0c={};var _0x2b1062={};var _0x3edd8a;var _0x4f9bae;return db[_0x344f('0x40')][_0x344f('0x4e')]({'where':{'id':_0x1318ee['params']['id']}})['then'](handleEntityNotFound(_0x239328,null))[_0x344f('0x23')](function(_0x58e450){if(_0x58e450){_0x3edd8a=_0x58e450;_0x2b1062[_0x344f('0x32')]=_['keys'](db[_0x344f('0x4f')][_0x344f('0x2b')]);_0x2b1062[_0x344f('0x30')]=_[_0x344f('0x2f')](_0x1318ee[_0x344f('0x30')]);_0x2b1062[_0x344f('0x39')]=_[_0x344f('0x31')](_0x2b1062[_0x344f('0x32')],_0x2b1062['query']);_0x546b0c[_0x344f('0x33')]=_[_0x344f('0x31')](_0x2b1062[_0x344f('0x32')],qs[_0x344f('0x34')](_0x1318ee[_0x344f('0x30')]['fields']));_0x546b0c[_0x344f('0x33')]=_0x546b0c['attributes']['length']?_0x546b0c[_0x344f('0x33')]:_0x2b1062[_0x344f('0x32')];_0x546b0c['order']=qs[_0x344f('0x37')](_0x1318ee['query'][_0x344f('0x37')]);_0x546b0c['where']=qs[_0x344f('0x39')](_[_0x344f('0x3a')](_0x1318ee[_0x344f('0x30')],_0x2b1062[_0x344f('0x39')]));if(_0x1318ee[_0x344f('0x30')][_0x344f('0x3e')]){_0x546b0c[_0x344f('0x38')]=_['merge'](_0x546b0c[_0x344f('0x38')],{'$or':_[_0x344f('0x2e')](_0x546b0c[_0x344f('0x33')],function(_0x4f4e7f){var _0x25a632={};_0x25a632[_0x4f4e7f]={'$like':'%'+_0x1318ee['query']['filter']+'%'};return _0x25a632;})});}_0x546b0c=_[_0x344f('0x3b')]({},_0x546b0c,_0x1318ee[_0x344f('0x3f')]);return _0x3edd8a['getSubjects'](_0x546b0c);}})['then'](function(_0x4da88b){if(_0x4da88b){_0x4f9bae=_0x4da88b['length'];if(!_0x1318ee[_0x344f('0x30')][_0x344f('0x35')](_0x344f('0x4c'))){_0x546b0c[_0x344f('0x1a')]=qs[_0x344f('0x1a')](_0x1318ee[_0x344f('0x30')][_0x344f('0x1a')]);_0x546b0c['offset']=qs[_0x344f('0x1c')](_0x1318ee[_0x344f('0x30')]['offset']);}return _0x3edd8a[_0x344f('0x4d')](_0x546b0c);}})[_0x344f('0x23')](function(_0x2b23be){if(_0x2b23be){return _0x2b23be?{'count':_0x4f9bae,'rows':_0x2b23be}:null;}})['then'](respondWithResult(_0x239328,null))[_0x344f('0x44')](handleError(_0x239328,null));};exports['getDescriptions']=function(_0x484e54,_0x421a5c,_0x1b1d99){var _0x48dc69={};var _0x3661dc={};var _0x14582a;var _0x13c5b8;return db[_0x344f('0x40')]['findOne']({'where':{'id':_0x484e54['params']['id']}})[_0x344f('0x23')](handleEntityNotFound(_0x421a5c,null))['then'](function(_0x2d7ccc){if(_0x2d7ccc){_0x14582a=_0x2d7ccc;_0x3661dc[_0x344f('0x32')]=_['keys'](db['VtigerField'][_0x344f('0x2b')]);_0x3661dc['query']=_[_0x344f('0x2f')](_0x484e54[_0x344f('0x30')]);_0x3661dc[_0x344f('0x39')]=_[_0x344f('0x31')](_0x3661dc[_0x344f('0x32')],_0x3661dc['query']);_0x48dc69['attributes']=_['intersection'](_0x3661dc[_0x344f('0x32')],qs[_0x344f('0x34')](_0x484e54[_0x344f('0x30')][_0x344f('0x34')]));_0x48dc69[_0x344f('0x33')]=_0x48dc69['attributes']['length']?_0x48dc69[_0x344f('0x33')]:_0x3661dc[_0x344f('0x32')];_0x48dc69['order']=qs[_0x344f('0x37')](_0x484e54[_0x344f('0x30')]['sort']);_0x48dc69[_0x344f('0x38')]=qs['filters'](_[_0x344f('0x3a')](_0x484e54['query'],_0x3661dc[_0x344f('0x39')]));if(_0x484e54[_0x344f('0x30')][_0x344f('0x3e')]){_0x48dc69[_0x344f('0x38')]=_['merge'](_0x48dc69['where'],{'$or':_[_0x344f('0x2e')](_0x48dc69[_0x344f('0x33')],function(_0x534d8b){var _0x245c2b={};_0x245c2b[_0x534d8b]={'$like':'%'+_0x484e54['query'][_0x344f('0x3e')]+'%'};return _0x245c2b;})});}_0x48dc69=_[_0x344f('0x3b')]({},_0x48dc69,_0x484e54[_0x344f('0x3f')]);return _0x14582a[_0x344f('0x50')](_0x48dc69);}})[_0x344f('0x23')](function(_0x469653){if(_0x469653){_0x13c5b8=_0x469653[_0x344f('0x47')];if(!_0x484e54[_0x344f('0x30')][_0x344f('0x35')](_0x344f('0x4c'))){_0x48dc69[_0x344f('0x1a')]=qs[_0x344f('0x1a')](_0x484e54[_0x344f('0x30')][_0x344f('0x1a')]);_0x48dc69[_0x344f('0x1c')]=qs['offset'](_0x484e54[_0x344f('0x30')][_0x344f('0x1c')]);}return _0x14582a[_0x344f('0x50')](_0x48dc69);}})[_0x344f('0x23')](function(_0x690549){if(_0x690549){return _0x690549?{'count':_0x13c5b8,'rows':_0x690549}:null;}})[_0x344f('0x23')](respondWithResult(_0x421a5c,null))[_0x344f('0x44')](handleError(_0x421a5c,null));};
\ No newline at end of file
+var _0xf93b=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','getFields','findOne','VtigerField','length','pick','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x46df88,_0x3365be){var _0x306c87=function(_0x3dad4e){while(--_0x3dad4e){_0x46df88['push'](_0x46df88['shift']());}};_0x306c87(++_0x3365be);}(_0xf93b,0x1d1));var _0xbf93=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0xf93b[_0x22bee0];return _0x2d295b;};'use strict';var emlformat=require(_0xbf93('0x0'));var rimraf=require(_0xbf93('0x1'));var zipdir=require(_0xbf93('0x2'));var jsonpatch=require(_0xbf93('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbf93('0x4'));var Mustache=require(_0xbf93('0x5'));var util=require(_0xbf93('0x6'));var path=require('path');var sox=require(_0xbf93('0x7'));var csv=require(_0xbf93('0x8'));var ejs=require(_0xbf93('0x9'));var fs=require('fs');var fs_extra=require(_0xbf93('0xa'));var _=require(_0xbf93('0xb'));var squel=require(_0xbf93('0xc'));var crypto=require('crypto');var jsforce=require(_0xbf93('0xd'));var deskjs=require(_0xbf93('0xe'));var toCsv=require(_0xbf93('0x8'));var querystring=require(_0xbf93('0xf'));var Papa=require(_0xbf93('0x10'));var Redis=require('ioredis');var authService=require(_0xbf93('0x11'));var qs=require(_0xbf93('0x12'));var as=require(_0xbf93('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf93('0x14'))('api');var utils=require(_0xbf93('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbf93('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554b68,_0x224cfa){_0x224cfa=_0x224cfa||0xcc;return function(_0x574597){if(_0x574597){return _0x554b68[_0xbf93('0x17')](_0x224cfa);}return _0x554b68[_0xbf93('0x18')](_0x224cfa)[_0xbf93('0x19')]();};}function respondWithResult(_0x2df781,_0x39477b){_0x39477b=_0x39477b||0xc8;return function(_0x509ced){if(_0x509ced){return _0x2df781['status'](_0x39477b)[_0xbf93('0x1a')](_0x509ced);}};}function respondWithFilteredResult(_0x4236c7,_0x79f6f5){return function(_0x4c41b2){if(_0x4c41b2){var _0x1edc06=typeof _0x79f6f5[_0xbf93('0x1b')]==='undefined'&&typeof _0x79f6f5[_0xbf93('0x1c')]===_0xbf93('0x1d');var _0x370269=_0x4c41b2[_0xbf93('0x1e')];var _0x18ae44=_0x1edc06?0x0:_0x79f6f5[_0xbf93('0x1b')];var _0xdaba6b=_0x1edc06?_0x4c41b2[_0xbf93('0x1e')]:_0x79f6f5[_0xbf93('0x1b')]+_0x79f6f5['limit'];var _0x288b4c;if(_0xdaba6b>=_0x370269){_0xdaba6b=_0x370269;_0x288b4c=0xc8;}else{_0x288b4c=0xce;}_0x4236c7[_0xbf93('0x18')](_0x288b4c);return _0x4236c7[_0xbf93('0x1f')]('Content-Range',_0x18ae44+'-'+_0xdaba6b+'/'+_0x370269)[_0xbf93('0x1a')](_0x4c41b2);}return null;};}function patchUpdates(_0x47229c){return function(_0x543a0b){try{jsonpatch[_0xbf93('0x20')](_0x543a0b,_0x47229c,!![]);}catch(_0x276123){return BPromise[_0xbf93('0x21')](_0x276123);}return _0x543a0b[_0xbf93('0x22')]();};}function saveUpdates(_0x48a67a,_0x5da149){return function(_0x509f3f){if(_0x509f3f){return _0x509f3f[_0xbf93('0x23')](_0x48a67a)[_0xbf93('0x24')](function(_0x5bd9c0){return _0x5bd9c0;});}return null;};}function removeEntity(_0x4fdb73,_0x3fea2c){return function(_0xe1ef0a){if(_0xe1ef0a){return _0xe1ef0a['destroy']()['then'](function(){_0x4fdb73['status'](0xcc)[_0xbf93('0x19')]();});}};}function handleEntityNotFound(_0x192e05,_0x24d0df){return function(_0x12ec49){if(!_0x12ec49){_0x192e05[_0xbf93('0x17')](0x194);}return _0x12ec49;};}function handleError(_0x25c821,_0x5c15d5){_0x5c15d5=_0x5c15d5||0x1f4;return function(_0xeaba21){logger[_0xbf93('0x25')](_0xeaba21[_0xbf93('0x26')]);if(_0xeaba21[_0xbf93('0x27')]){delete _0xeaba21[_0xbf93('0x27')];}_0x25c821[_0xbf93('0x18')](_0x5c15d5)[_0xbf93('0x28')](_0xeaba21);};}exports['index']=function(_0x21c270,_0x2a79f3){var _0xe473d2={},_0x18d706={},_0x1bcaf9={'count':0x0,'rows':[]};var _0x7c4413=_[_0xbf93('0x29')](db[_0xbf93('0x2a')][_0xbf93('0x2b')],function(_0xd2b0d6){return{'name':_0xd2b0d6[_0xbf93('0x2c')],'type':_0xd2b0d6[_0xbf93('0x2d')][_0xbf93('0x2e')]};});_0x18d706['model']=_[_0xbf93('0x29')](_0x7c4413,_0xbf93('0x27'));_0x18d706[_0xbf93('0x2f')]=_['keys'](_0x21c270['query']);_0x18d706['filters']=_[_0xbf93('0x30')](_0x18d706[_0xbf93('0x31')],_0x18d706['query']);_0xe473d2[_0xbf93('0x32')]=_['intersection'](_0x18d706[_0xbf93('0x31')],qs[_0xbf93('0x33')](_0x21c270[_0xbf93('0x2f')][_0xbf93('0x33')]));_0xe473d2['attributes']=_0xe473d2['attributes']['length']?_0xe473d2[_0xbf93('0x32')]:_0x18d706[_0xbf93('0x31')];if(!_0x21c270['query'][_0xbf93('0x34')](_0xbf93('0x35'))){_0xe473d2[_0xbf93('0x1c')]=qs['limit'](_0x21c270[_0xbf93('0x2f')][_0xbf93('0x1c')]);_0xe473d2['offset']=qs[_0xbf93('0x1b')](_0x21c270['query']['offset']);}_0xe473d2['order']=qs[_0xbf93('0x36')](_0x21c270['query'][_0xbf93('0x36')]);_0xe473d2[_0xbf93('0x37')]=qs[_0xbf93('0x38')](_['pick'](_0x21c270['query'],_0x18d706[_0xbf93('0x38')]),_0x7c4413);if(_0x21c270['query'][_0xbf93('0x39')]){_0xe473d2[_0xbf93('0x37')]=_['merge'](_0xe473d2[_0xbf93('0x37')],{'$or':_['map'](_0x7c4413,function(_0x2fc582){if(_0x2fc582['type']!=='VIRTUAL'){var _0x42edac={};_0x42edac[_0x2fc582['name']]={'$like':'%'+_0x21c270[_0xbf93('0x2f')]['filter']+'%'};return _0x42edac;}})});}_0xe473d2=_[_0xbf93('0x3a')]({},_0xe473d2,_0x21c270[_0xbf93('0x3b')]);var _0x91d816={'where':_0xe473d2[_0xbf93('0x37')]};return db['VtigerConfiguration']['count'](_0x91d816)[_0xbf93('0x24')](function(_0x2addc1){_0x1bcaf9[_0xbf93('0x1e')]=_0x2addc1;if(_0x21c270[_0xbf93('0x2f')][_0xbf93('0x3c')]){_0xe473d2[_0xbf93('0x3d')]=[{'all':!![]}];}return db[_0xbf93('0x2a')][_0xbf93('0x3e')](_0xe473d2);})[_0xbf93('0x24')](function(_0x3f096b){_0x1bcaf9[_0xbf93('0x3f')]=_0x3f096b;return _0x1bcaf9;})[_0xbf93('0x24')](respondWithFilteredResult(_0x2a79f3,_0xe473d2))[_0xbf93('0x40')](handleError(_0x2a79f3,null));};exports[_0xbf93('0x41')]=function(_0x1768df,_0x23a54c){var _0xf7c4b8={'raw':![],'where':{'id':_0x1768df[_0xbf93('0x42')]['id']}},_0x277ec4={};_0x277ec4[_0xbf93('0x31')]=_['keys'](db[_0xbf93('0x2a')]['rawAttributes']);_0x277ec4[_0xbf93('0x2f')]=_[_0xbf93('0x43')](_0x1768df['query']);_0x277ec4['filters']=_[_0xbf93('0x30')](_0x277ec4['model'],_0x277ec4[_0xbf93('0x2f')]);_0xf7c4b8['attributes']=_['intersection'](_0x277ec4['model'],qs[_0xbf93('0x33')](_0x1768df['query'][_0xbf93('0x33')]));_0xf7c4b8[_0xbf93('0x32')]=_0xf7c4b8[_0xbf93('0x32')]['length']?_0xf7c4b8[_0xbf93('0x32')]:_0x277ec4[_0xbf93('0x31')];if(_0x1768df['query']['includeAll']){_0xf7c4b8['include']=[{'all':!![]}];}_0xf7c4b8=_[_0xbf93('0x3a')]({},_0xf7c4b8,_0x1768df[_0xbf93('0x3b')]);return db[_0xbf93('0x2a')]['find'](_0xf7c4b8)[_0xbf93('0x24')](handleEntityNotFound(_0x23a54c,null))[_0xbf93('0x24')](respondWithResult(_0x23a54c,null))[_0xbf93('0x40')](handleError(_0x23a54c,null));};exports[_0xbf93('0x44')]=function(_0x10a6cc,_0x53de3a){return db[_0xbf93('0x2a')][_0xbf93('0x44')](_0x10a6cc[_0xbf93('0x45')],{})['then'](respondWithResult(_0x53de3a,0xc9))[_0xbf93('0x40')](handleError(_0x53de3a,null));};exports[_0xbf93('0x23')]=function(_0x51a0a2,_0x33a6a4){if(_0x51a0a2[_0xbf93('0x45')]['id']){delete _0x51a0a2[_0xbf93('0x45')]['id'];}return db[_0xbf93('0x2a')][_0xbf93('0x46')]({'where':{'id':_0x51a0a2['params']['id']}})[_0xbf93('0x24')](handleEntityNotFound(_0x33a6a4,null))[_0xbf93('0x24')](saveUpdates(_0x51a0a2[_0xbf93('0x45')],null))[_0xbf93('0x24')](respondWithResult(_0x33a6a4,null))['catch'](handleError(_0x33a6a4,null));};exports[_0xbf93('0x47')]=function(_0x17d663,_0xe79f32){return db[_0xbf93('0x2a')][_0xbf93('0x46')]({'where':{'id':_0x17d663[_0xbf93('0x42')]['id']}})['then'](handleEntityNotFound(_0xe79f32,null))[_0xbf93('0x24')](removeEntity(_0xe79f32,null))[_0xbf93('0x40')](handleError(_0xe79f32,null));};exports[_0xbf93('0x48')]=function(_0x4581a4,_0x48e994,_0x5603d1){var _0x2bacf5={};var _0x2ec888={};var _0x1815f3;var _0x3a2824;return db['VtigerConfiguration'][_0xbf93('0x49')]({'where':{'id':_0x4581a4[_0xbf93('0x42')]['id']}})[_0xbf93('0x24')](handleEntityNotFound(_0x48e994,null))[_0xbf93('0x24')](function(_0x55213c){if(_0x55213c){_0x1815f3=_0x55213c;_0x2ec888[_0xbf93('0x31')]=_[_0xbf93('0x43')](db[_0xbf93('0x4a')][_0xbf93('0x2b')]);_0x2ec888['query']=_['keys'](_0x4581a4['query']);_0x2ec888['filters']=_[_0xbf93('0x30')](_0x2ec888[_0xbf93('0x31')],_0x2ec888[_0xbf93('0x2f')]);_0x2bacf5[_0xbf93('0x32')]=_['intersection'](_0x2ec888[_0xbf93('0x31')],qs[_0xbf93('0x33')](_0x4581a4[_0xbf93('0x2f')][_0xbf93('0x33')]));_0x2bacf5['attributes']=_0x2bacf5['attributes'][_0xbf93('0x4b')]?_0x2bacf5[_0xbf93('0x32')]:_0x2ec888['model'];_0x2bacf5['order']=qs[_0xbf93('0x36')](_0x4581a4[_0xbf93('0x2f')][_0xbf93('0x36')]);_0x2bacf5['where']=qs[_0xbf93('0x38')](_[_0xbf93('0x4c')](_0x4581a4[_0xbf93('0x2f')],_0x2ec888[_0xbf93('0x38')]));if(_0x4581a4[_0xbf93('0x2f')][_0xbf93('0x39')]){_0x2bacf5[_0xbf93('0x37')]=_[_0xbf93('0x3a')](_0x2bacf5[_0xbf93('0x37')],{'$or':_[_0xbf93('0x29')](_0x2bacf5['attributes'],function(_0x2309e9){var _0x4b227c={};_0x4b227c[_0x2309e9]={'$like':'%'+_0x4581a4[_0xbf93('0x2f')]['filter']+'%'};return _0x4b227c;})});}_0x2bacf5=_[_0xbf93('0x3a')]({},_0x2bacf5,_0x4581a4[_0xbf93('0x3b')]);return _0x1815f3[_0xbf93('0x48')](_0x2bacf5);}})[_0xbf93('0x24')](function(_0x56fa53){if(_0x56fa53){_0x3a2824=_0x56fa53[_0xbf93('0x4b')];if(!_0x4581a4['query']['hasOwnProperty'](_0xbf93('0x35'))){_0x2bacf5[_0xbf93('0x1c')]=qs[_0xbf93('0x1c')](_0x4581a4[_0xbf93('0x2f')][_0xbf93('0x1c')]);_0x2bacf5[_0xbf93('0x1b')]=qs['offset'](_0x4581a4['query']['offset']);}return _0x1815f3[_0xbf93('0x48')](_0x2bacf5);}})[_0xbf93('0x24')](function(_0x4e1112){if(_0x4e1112){return _0x4e1112?{'count':_0x3a2824,'rows':_0x4e1112}:null;}})[_0xbf93('0x24')](respondWithResult(_0x48e994,null))[_0xbf93('0x40')](handleError(_0x48e994,null));};exports[_0xbf93('0x4d')]=function(_0x4d5dc9,_0x3db06a,_0xe6c985){var _0x12a245={};var _0x371b5b={};var _0x588a52;var _0xd9beb3;return db[_0xbf93('0x2a')][_0xbf93('0x49')]({'where':{'id':_0x4d5dc9['params']['id']}})[_0xbf93('0x24')](handleEntityNotFound(_0x3db06a,null))[_0xbf93('0x24')](function(_0x16924b){if(_0x16924b){_0x588a52=_0x16924b;_0x371b5b[_0xbf93('0x31')]=_[_0xbf93('0x43')](db[_0xbf93('0x4a')]['rawAttributes']);_0x371b5b[_0xbf93('0x2f')]=_[_0xbf93('0x43')](_0x4d5dc9[_0xbf93('0x2f')]);_0x371b5b[_0xbf93('0x38')]=_[_0xbf93('0x30')](_0x371b5b[_0xbf93('0x31')],_0x371b5b[_0xbf93('0x2f')]);_0x12a245[_0xbf93('0x32')]=_[_0xbf93('0x30')](_0x371b5b['model'],qs[_0xbf93('0x33')](_0x4d5dc9[_0xbf93('0x2f')]['fields']));_0x12a245[_0xbf93('0x32')]=_0x12a245[_0xbf93('0x32')][_0xbf93('0x4b')]?_0x12a245[_0xbf93('0x32')]:_0x371b5b[_0xbf93('0x31')];_0x12a245[_0xbf93('0x4e')]=qs[_0xbf93('0x36')](_0x4d5dc9[_0xbf93('0x2f')][_0xbf93('0x36')]);_0x12a245[_0xbf93('0x37')]=qs['filters'](_[_0xbf93('0x4c')](_0x4d5dc9[_0xbf93('0x2f')],_0x371b5b[_0xbf93('0x38')]));if(_0x4d5dc9['query'][_0xbf93('0x39')]){_0x12a245[_0xbf93('0x37')]=_[_0xbf93('0x3a')](_0x12a245[_0xbf93('0x37')],{'$or':_[_0xbf93('0x29')](_0x12a245[_0xbf93('0x32')],function(_0x28f4ed){var _0x4fbf16={};_0x4fbf16[_0x28f4ed]={'$like':'%'+_0x4d5dc9[_0xbf93('0x2f')][_0xbf93('0x39')]+'%'};return _0x4fbf16;})});}_0x12a245=_[_0xbf93('0x3a')]({},_0x12a245,_0x4d5dc9[_0xbf93('0x3b')]);return _0x588a52['getSubjects'](_0x12a245);}})[_0xbf93('0x24')](function(_0x42f155){if(_0x42f155){_0xd9beb3=_0x42f155['length'];if(!_0x4d5dc9['query'][_0xbf93('0x34')](_0xbf93('0x35'))){_0x12a245[_0xbf93('0x1c')]=qs[_0xbf93('0x1c')](_0x4d5dc9[_0xbf93('0x2f')][_0xbf93('0x1c')]);_0x12a245[_0xbf93('0x1b')]=qs['offset'](_0x4d5dc9[_0xbf93('0x2f')][_0xbf93('0x1b')]);}return _0x588a52['getSubjects'](_0x12a245);}})[_0xbf93('0x24')](function(_0x10d97c){if(_0x10d97c){return _0x10d97c?{'count':_0xd9beb3,'rows':_0x10d97c}:null;}})[_0xbf93('0x24')](respondWithResult(_0x3db06a,null))[_0xbf93('0x40')](handleError(_0x3db06a,null));};exports[_0xbf93('0x4f')]=function(_0x4a13d5,_0x22f9f6,_0xfc0a15){var _0x1b3157={};var _0x3ace6a={};var _0x356782;var _0x597268;return db[_0xbf93('0x2a')][_0xbf93('0x49')]({'where':{'id':_0x4a13d5[_0xbf93('0x42')]['id']}})[_0xbf93('0x24')](handleEntityNotFound(_0x22f9f6,null))[_0xbf93('0x24')](function(_0xdd097a){if(_0xdd097a){_0x356782=_0xdd097a;_0x3ace6a[_0xbf93('0x31')]=_[_0xbf93('0x43')](db[_0xbf93('0x4a')][_0xbf93('0x2b')]);_0x3ace6a[_0xbf93('0x2f')]=_[_0xbf93('0x43')](_0x4a13d5[_0xbf93('0x2f')]);_0x3ace6a[_0xbf93('0x38')]=_[_0xbf93('0x30')](_0x3ace6a[_0xbf93('0x31')],_0x3ace6a[_0xbf93('0x2f')]);_0x1b3157['attributes']=_[_0xbf93('0x30')](_0x3ace6a[_0xbf93('0x31')],qs[_0xbf93('0x33')](_0x4a13d5[_0xbf93('0x2f')][_0xbf93('0x33')]));_0x1b3157[_0xbf93('0x32')]=_0x1b3157['attributes']['length']?_0x1b3157[_0xbf93('0x32')]:_0x3ace6a[_0xbf93('0x31')];_0x1b3157[_0xbf93('0x4e')]=qs[_0xbf93('0x36')](_0x4a13d5[_0xbf93('0x2f')]['sort']);_0x1b3157[_0xbf93('0x37')]=qs['filters'](_[_0xbf93('0x4c')](_0x4a13d5['query'],_0x3ace6a[_0xbf93('0x38')]));if(_0x4a13d5[_0xbf93('0x2f')][_0xbf93('0x39')]){_0x1b3157[_0xbf93('0x37')]=_[_0xbf93('0x3a')](_0x1b3157[_0xbf93('0x37')],{'$or':_[_0xbf93('0x29')](_0x1b3157[_0xbf93('0x32')],function(_0x195dae){var _0x13d46c={};_0x13d46c[_0x195dae]={'$like':'%'+_0x4a13d5[_0xbf93('0x2f')][_0xbf93('0x39')]+'%'};return _0x13d46c;})});}_0x1b3157=_[_0xbf93('0x3a')]({},_0x1b3157,_0x4a13d5['options']);return _0x356782[_0xbf93('0x4f')](_0x1b3157);}})[_0xbf93('0x24')](function(_0xdb958c){if(_0xdb958c){_0x597268=_0xdb958c[_0xbf93('0x4b')];if(!_0x4a13d5[_0xbf93('0x2f')]['hasOwnProperty']('nolimit')){_0x1b3157['limit']=qs['limit'](_0x4a13d5[_0xbf93('0x2f')]['limit']);_0x1b3157[_0xbf93('0x1b')]=qs[_0xbf93('0x1b')](_0x4a13d5[_0xbf93('0x2f')][_0xbf93('0x1b')]);}return _0x356782['getDescriptions'](_0x1b3157);}})['then'](function(_0x20e425){if(_0x20e425){return _0x20e425?{'count':_0x597268,'rows':_0x20e425}:null;}})['then'](respondWithResult(_0x22f9f6,null))[_0xbf93('0x40')](handleError(_0x22f9f6,null));};
\ No newline at end of file
index e153cd1..73dbd72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf35f=['lodash','util','api','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations'];(function(_0x5d8101,_0x185169){var _0x419bb1=function(_0x1b2ac6){while(--_0x1b2ac6){_0x5d8101['push'](_0x5d8101['shift']());}};_0x419bb1(++_0x185169);}(_0xf35f,0x10e));var _0xff35=function(_0x72527e,_0x313f59){_0x72527e=_0x72527e-0x0;var _0x345f19=_0xf35f[_0x72527e];return _0x345f19;};'use strict';var _=require(_0xff35('0x0'));var util=require(_0xff35('0x1'));var logger=require('../../config/logger')(_0xff35('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xff35('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff35('0x4'));var config=require(_0xff35('0x5'));var attributes=require(_0xff35('0x6'));module[_0xff35('0x7')]=function(_0x38f566,_0xcdbd0b){return _0x38f566['define'](_0xff35('0x8'),attributes,{'tableName':_0xff35('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x75a5=['VtigerConfiguration','int_vtiger_configurations','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x3efc5f,_0x2875e7){var _0x361724=function(_0x4321f7){while(--_0x4321f7){_0x3efc5f['push'](_0x3efc5f['shift']());}};_0x361724(++_0x2875e7);}(_0x75a5,0xc2));var _0x575a=function(_0x3609a9,_0x429884){_0x3609a9=_0x3609a9-0x0;var _0x4e706c=_0x75a5[_0x3609a9];return _0x4e706c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x575a('0x0'))(_0x575a('0x1'));var moment=require(_0x575a('0x2'));var BPromise=require(_0x575a('0x3'));var rp=require(_0x575a('0x4'));var fs=require('fs');var path=require(_0x575a('0x5'));var rimraf=require('rimraf');var config=require(_0x575a('0x6'));var attributes=require(_0x575a('0x7'));module[_0x575a('0x8')]=function(_0x4097a7,_0x4ff6f3){return _0x4097a7[_0x575a('0x9')](_0x575a('0xa'),attributes,{'tableName':_0x575a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eaa7386..160dd21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1e0=['client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x751d30,_0x471a14){var _0x24cdda=function(_0x10456){while(--_0x10456){_0x751d30['push'](_0x751d30['shift']());}};_0x24cdda(++_0x471a14);}(_0xf1e0,0x158));var _0x0f1e=function(_0x6b1a63,_0x15431f){_0x6b1a63=_0x6b1a63-0x0;var _0xad160c=_0xf1e0[_0x6b1a63];return _0xad160c;};'use strict';var _=require(_0x0f1e('0x0'));var util=require(_0x0f1e('0x1'));var moment=require(_0x0f1e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f1e('0x3'))['db'];var utils=require(_0x0f1e('0x4'));var logger=require(_0x0f1e('0x5'))('rpc');var config=require(_0x0f1e('0x6'));var jayson=require(_0x0f1e('0x7'));var client=jayson[_0x0f1e('0x8')][_0x0f1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x364055,_0x4ce346,_0x5320fe){return new BPromise(function(_0x37d66e,_0x367a3a){return client[_0x0f1e('0xa')](_0x364055,_0x5320fe)[_0x0f1e('0xb')](function(_0x32b9a9){logger[_0x0f1e('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x4ce346,_0x0f1e('0xd'));logger[_0x0f1e('0xe')](_0x0f1e('0xf'),_0x4ce346,_0x0f1e('0xd'),JSON[_0x0f1e('0x10')](_0x32b9a9));if(_0x32b9a9[_0x0f1e('0x11')]){if(_0x32b9a9['error'][_0x0f1e('0x12')]===0x1f4){logger[_0x0f1e('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x4ce346,_0x32b9a9[_0x0f1e('0x11')]['message']);return _0x367a3a(_0x32b9a9[_0x0f1e('0x11')][_0x0f1e('0x13')]);}logger[_0x0f1e('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x4ce346,_0x32b9a9[_0x0f1e('0x11')]['message']);return _0x37d66e(_0x32b9a9[_0x0f1e('0x11')][_0x0f1e('0x13')]);}else{logger[_0x0f1e('0xc')](_0x0f1e('0x14'),_0x4ce346,_0x0f1e('0xd'));_0x37d66e(_0x32b9a9[_0x0f1e('0x15')][_0x0f1e('0x13')]);}})['catch'](function(_0x3a24c1){logger[_0x0f1e('0x11')](_0x0f1e('0x14'),_0x4ce346,_0x3a24c1);_0x367a3a(_0x3a24c1);});});}
\ No newline at end of file
+var _0x1ec3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x1beda9,_0x5a3849){var _0x3fe3b1=function(_0x1169b2){while(--_0x1169b2){_0x1beda9['push'](_0x1beda9['shift']());}};_0x3fe3b1(++_0x5a3849);}(_0x1ec3,0x12b));var _0x31ec=function(_0x4c73cb,_0x280bd7){_0x4c73cb=_0x4c73cb-0x0;var _0x3e99ff=_0x1ec3[_0x4c73cb];return _0x3e99ff;};'use strict';var _=require(_0x31ec('0x0'));var util=require(_0x31ec('0x1'));var moment=require(_0x31ec('0x2'));var BPromise=require(_0x31ec('0x3'));var rs=require(_0x31ec('0x4'));var fs=require('fs');var Redis=require(_0x31ec('0x5'));var db=require(_0x31ec('0x6'))['db'];var utils=require(_0x31ec('0x7'));var logger=require(_0x31ec('0x8'))(_0x31ec('0x9'));var config=require(_0x31ec('0xa'));var jayson=require(_0x31ec('0xb'));var client=jayson['client'][_0x31ec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43b1e3,_0x224d5e,_0x5a2bb6){return new BPromise(function(_0x4878ea,_0x3ac212){return client[_0x31ec('0xd')](_0x43b1e3,_0x5a2bb6)[_0x31ec('0xe')](function(_0x20e3c8){logger[_0x31ec('0xf')](_0x31ec('0x10'),_0x224d5e,_0x31ec('0x11'));logger['debug'](_0x31ec('0x12'),_0x224d5e,_0x31ec('0x11'),JSON['stringify'](_0x20e3c8));if(_0x20e3c8[_0x31ec('0x13')]){if(_0x20e3c8[_0x31ec('0x13')][_0x31ec('0x14')]===0x1f4){logger[_0x31ec('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x224d5e,_0x20e3c8['error'][_0x31ec('0x15')]);return _0x3ac212(_0x20e3c8[_0x31ec('0x13')][_0x31ec('0x15')]);}logger[_0x31ec('0x13')](_0x31ec('0x10'),_0x224d5e,_0x20e3c8['error'][_0x31ec('0x15')]);return _0x4878ea(_0x20e3c8['error']['message']);}else{logger[_0x31ec('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x224d5e,'request\x20sent');_0x4878ea(_0x20e3c8[_0x31ec('0x16')][_0x31ec('0x15')]);}})['catch'](function(_0x205433){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x224d5e,_0x205433);_0x3ac212(_0x205433);});});}
\ No newline at end of file
index 441cc5f..210dcde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6891=['post','create','put','/:id','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','get','isAuthenticated','show'];(function(_0x2b2e87,_0xae0371){var _0x5eb8b2=function(_0x1ec629){while(--_0x1ec629){_0x2b2e87['push'](_0x2b2e87['shift']());}};_0x5eb8b2(++_0xae0371);}(_0x6891,0x180));var _0x1689=function(_0x10639d,_0x1fad09){_0x10639d=_0x10639d-0x0;var _0x206332=_0x6891[_0x10639d];return _0x206332;};'use strict';var multer=require(_0x1689('0x0'));var util=require('util');var path=require(_0x1689('0x1'));var timeout=require(_0x1689('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1689('0x3'));var auth=require(_0x1689('0x4'));var interaction=require(_0x1689('0x5'));var config=require(_0x1689('0x6'));var controller=require(_0x1689('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1689('0x8')]);router[_0x1689('0x9')]('/:id',auth[_0x1689('0xa')](),controller[_0x1689('0xb')]);router[_0x1689('0xc')]('/',auth[_0x1689('0xa')](),controller[_0x1689('0xd')]);router[_0x1689('0xe')](_0x1689('0xf'),auth[_0x1689('0xa')](),controller[_0x1689('0x10')]);router[_0x1689('0x11')]('/:id',auth[_0x1689('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf1e7=['update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5df35c,_0x2ab072){var _0x5233be=function(_0x52649a){while(--_0x52649a){_0x5df35c['push'](_0x5df35c['shift']());}};_0x5233be(++_0x2ab072);}(_0xf1e7,0x158));var _0x7f1e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xf1e7[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x7f1e('0x0'));var util=require('util');var path=require(_0x7f1e('0x1'));var timeout=require(_0x7f1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7f1e('0x3'));var auth=require(_0x7f1e('0x4'));var interaction=require(_0x7f1e('0x5'));var config=require(_0x7f1e('0x6'));var controller=require(_0x7f1e('0x7'));router[_0x7f1e('0x8')]('/',auth[_0x7f1e('0x9')](),controller[_0x7f1e('0xa')]);router[_0x7f1e('0x8')](_0x7f1e('0xb'),auth['isAuthenticated'](),controller[_0x7f1e('0xc')]);router[_0x7f1e('0xd')]('/',auth[_0x7f1e('0x9')](),controller[_0x7f1e('0xe')]);router[_0x7f1e('0xf')](_0x7f1e('0xb'),auth[_0x7f1e('0x9')](),controller[_0x7f1e('0x10')]);router[_0x7f1e('0x11')](_0x7f1e('0xb'),auth[_0x7f1e('0x9')](),controller[_0x7f1e('0x12')]);module[_0x7f1e('0x13')]=router;
\ No newline at end of file
index 4e3bda9..b6699f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x470f=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0xaf4f1,_0x493103){var _0xcc733=function(_0x533869){while(--_0x533869){_0xaf4f1['push'](_0xaf4f1['shift']());}};_0xcc733(++_0x493103);}(_0x470f,0xaf));var _0xf470=function(_0x44e827,_0x145ed8){_0x44e827=_0x44e827-0x0;var _0xa19d97=_0x470f[_0x44e827];return _0xa19d97;};'use strict';var Sequelize=require('sequelize');module[_0xf470('0x0')]={'type':{'type':Sequelize[_0xf470('0x1')](_0xf470('0x2'),_0xf470('0x3'),_0xf470('0x4'),_0xf470('0x5'),_0xf470('0x6')),'defaultValue':_0xf470('0x2')},'content':{'type':Sequelize[_0xf470('0x7')]},'key':{'type':Sequelize[_0xf470('0x7')]},'keyType':{'type':Sequelize[_0xf470('0x1')]('string',_0xf470('0x3'),_0xf470('0x4'))},'keyContent':{'type':Sequelize[_0xf470('0x7')]},'idField':{'type':Sequelize[_0xf470('0x7')]},'nameField':{'type':Sequelize[_0xf470('0x7')]},'customField':{'type':Sequelize[_0xf470('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1813=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string'];(function(_0x413f2a,_0x1006e4){var _0x1932ec=function(_0x1953a9){while(--_0x1953a9){_0x413f2a['push'](_0x413f2a['shift']());}};_0x1932ec(++_0x1006e4);}(_0x1813,0x1a9));var _0x3181=function(_0xc72eda,_0x1c9e5f){_0xc72eda=_0xc72eda-0x0;var _0x750cad=_0x1813[_0xc72eda];return _0x750cad;};'use strict';var Sequelize=require(_0x3181('0x0'));module[_0x3181('0x1')]={'type':{'type':Sequelize[_0x3181('0x2')]('string',_0x3181('0x3'),_0x3181('0x4'),'keyValue',_0x3181('0x5')),'defaultValue':_0x3181('0x6')},'content':{'type':Sequelize[_0x3181('0x7')]},'key':{'type':Sequelize[_0x3181('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3181('0x3'),_0x3181('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3181('0x7')]},'customField':{'type':Sequelize[_0x3181('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3181('0x7')]}};
\ No newline at end of file
index 30a73ab..d9bb44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe5a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../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','save','update','destroy','end','error','stack','name','send','VtigerField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','then','findAll','show','params','includeAll','include','catch','create','body','find'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xbe5a,0x12c));var _0xabe5=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xbe5a[_0xf79bae];return _0x5d2cb7;};'use strict';var emlformat=require(_0xabe5('0x0'));var rimraf=require(_0xabe5('0x1'));var zipdir=require(_0xabe5('0x2'));var jsonpatch=require(_0xabe5('0x3'));var rp=require(_0xabe5('0x4'));var moment=require(_0xabe5('0x5'));var BPromise=require(_0xabe5('0x6'));var Mustache=require('mustache');var util=require(_0xabe5('0x7'));var path=require(_0xabe5('0x8'));var sox=require('sox');var csv=require(_0xabe5('0x9'));var ejs=require(_0xabe5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabe5('0xb'));var squel=require(_0xabe5('0xc'));var crypto=require('crypto');var jsforce=require(_0xabe5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xabe5('0x9'));var querystring=require(_0xabe5('0xe'));var Papa=require(_0xabe5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xabe5('0x10'));var as=require(_0xabe5('0x11'));var hardwareService=require(_0xabe5('0x12'));var logger=require(_0xabe5('0x13'))(_0xabe5('0x14'));var utils=require(_0xabe5('0x15'));var config=require(_0xabe5('0x16'));var licenseUtil=require(_0xabe5('0x17'));var db=require(_0xabe5('0x18'))['db'];function respondWithStatusCode(_0x5024ff,_0x558531){_0x558531=_0x558531||0xcc;return function(_0x1dbe59){if(_0x1dbe59){return _0x5024ff[_0xabe5('0x19')](_0x558531);}return _0x5024ff[_0xabe5('0x1a')](_0x558531)['end']();};}function respondWithResult(_0x4bc261,_0x16ad19){_0x16ad19=_0x16ad19||0xc8;return function(_0x4a9bae){if(_0x4a9bae){return _0x4bc261[_0xabe5('0x1a')](_0x16ad19)[_0xabe5('0x1b')](_0x4a9bae);}};}function respondWithFilteredResult(_0x5e4843,_0x9a1546){return function(_0x53183b){if(_0x53183b){var _0xff1810=typeof _0x9a1546[_0xabe5('0x1c')]===_0xabe5('0x1d')&&typeof _0x9a1546[_0xabe5('0x1e')]==='undefined';var _0x3b8e38=_0x53183b[_0xabe5('0x1f')];var _0x5e8e5b=_0xff1810?0x0:_0x9a1546['offset'];var _0x48bdb7=_0xff1810?_0x53183b[_0xabe5('0x1f')]:_0x9a1546[_0xabe5('0x1c')]+_0x9a1546['limit'];var _0x598461;if(_0x48bdb7>=_0x3b8e38){_0x48bdb7=_0x3b8e38;_0x598461=0xc8;}else{_0x598461=0xce;}_0x5e4843[_0xabe5('0x1a')](_0x598461);return _0x5e4843[_0xabe5('0x20')](_0xabe5('0x21'),_0x5e8e5b+'-'+_0x48bdb7+'/'+_0x3b8e38)[_0xabe5('0x1b')](_0x53183b);}return null;};}function patchUpdates(_0x518281){return function(_0x2e5b58){try{jsonpatch[_0xabe5('0x22')](_0x2e5b58,_0x518281,!![]);}catch(_0x172f3c){return BPromise['reject'](_0x172f3c);}return _0x2e5b58[_0xabe5('0x23')]();};}function saveUpdates(_0x52e867,_0x2c62aa){return function(_0x3e5bcc){if(_0x3e5bcc){return _0x3e5bcc[_0xabe5('0x24')](_0x52e867)['then'](function(_0x3cb901){return _0x3cb901;});}return null;};}function removeEntity(_0x4759a4,_0x4a6291){return function(_0xe6eb77){if(_0xe6eb77){return _0xe6eb77[_0xabe5('0x25')]()['then'](function(){_0x4759a4[_0xabe5('0x1a')](0xcc)[_0xabe5('0x26')]();});}};}function handleEntityNotFound(_0x449375,_0x147244){return function(_0x1004da){if(!_0x1004da){_0x449375[_0xabe5('0x19')](0x194);}return _0x1004da;};}function handleError(_0x299a8b,_0x14ce6e){_0x14ce6e=_0x14ce6e||0x1f4;return function(_0xc7a549){logger[_0xabe5('0x27')](_0xc7a549[_0xabe5('0x28')]);if(_0xc7a549[_0xabe5('0x29')]){delete _0xc7a549[_0xabe5('0x29')];}_0x299a8b[_0xabe5('0x1a')](_0x14ce6e)[_0xabe5('0x2a')](_0xc7a549);};}exports['index']=function(_0x24f595,_0x25e702){var _0x5b0222={},_0x3e6140={},_0x247cbc={'count':0x0,'rows':[]};var _0x33cbfa=_['map'](db[_0xabe5('0x2b')][_0xabe5('0x2c')],function(_0x350646){return{'name':_0x350646[_0xabe5('0x2d')],'type':_0x350646['type'][_0xabe5('0x2e')]};});_0x3e6140[_0xabe5('0x2f')]=_[_0xabe5('0x30')](_0x33cbfa,'name');_0x3e6140[_0xabe5('0x31')]=_[_0xabe5('0x32')](_0x24f595[_0xabe5('0x31')]);_0x3e6140[_0xabe5('0x33')]=_[_0xabe5('0x34')](_0x3e6140[_0xabe5('0x2f')],_0x3e6140['query']);_0x5b0222[_0xabe5('0x35')]=_[_0xabe5('0x34')](_0x3e6140[_0xabe5('0x2f')],qs[_0xabe5('0x36')](_0x24f595[_0xabe5('0x31')]['fields']));_0x5b0222[_0xabe5('0x35')]=_0x5b0222[_0xabe5('0x35')][_0xabe5('0x37')]?_0x5b0222['attributes']:_0x3e6140['model'];if(!_0x24f595['query'][_0xabe5('0x38')](_0xabe5('0x39'))){_0x5b0222[_0xabe5('0x1e')]=qs[_0xabe5('0x1e')](_0x24f595[_0xabe5('0x31')]['limit']);_0x5b0222[_0xabe5('0x1c')]=qs['offset'](_0x24f595['query'][_0xabe5('0x1c')]);}_0x5b0222[_0xabe5('0x3a')]=qs[_0xabe5('0x3b')](_0x24f595[_0xabe5('0x31')][_0xabe5('0x3b')]);_0x5b0222[_0xabe5('0x3c')]=qs[_0xabe5('0x33')](_[_0xabe5('0x3d')](_0x24f595[_0xabe5('0x31')],_0x3e6140[_0xabe5('0x33')]),_0x33cbfa);if(_0x24f595['query']['filter']){_0x5b0222['where']=_[_0xabe5('0x3e')](_0x5b0222['where'],{'$or':_[_0xabe5('0x30')](_0x33cbfa,function(_0x191ec7){if(_0x191ec7['type']!=='VIRTUAL'){var _0x340659={};_0x340659[_0x191ec7['name']]={'$like':'%'+_0x24f595[_0xabe5('0x31')][_0xabe5('0x3f')]+'%'};return _0x340659;}})});}_0x5b0222=_[_0xabe5('0x3e')]({},_0x5b0222,_0x24f595[_0xabe5('0x40')]);var _0x20374f={'where':_0x5b0222[_0xabe5('0x3c')]};return db[_0xabe5('0x2b')]['count'](_0x20374f)[_0xabe5('0x41')](function(_0x187bca){_0x247cbc[_0xabe5('0x1f')]=_0x187bca;if(_0x24f595[_0xabe5('0x31')]['includeAll']){_0x5b0222['include']=[{'all':!![]}];}return db['VtigerField'][_0xabe5('0x42')](_0x5b0222);})['then'](function(_0x2c12b0){_0x247cbc['rows']=_0x2c12b0;return _0x247cbc;})[_0xabe5('0x41')](respondWithFilteredResult(_0x25e702,_0x5b0222))['catch'](handleError(_0x25e702,null));};exports[_0xabe5('0x43')]=function(_0x4e6999,_0x34bf76){var _0x2c4183={'raw':!![],'where':{'id':_0x4e6999[_0xabe5('0x44')]['id']}},_0xa3e672={};_0xa3e672['model']=_['keys'](db[_0xabe5('0x2b')][_0xabe5('0x2c')]);_0xa3e672[_0xabe5('0x31')]=_[_0xabe5('0x32')](_0x4e6999['query']);_0xa3e672['filters']=_['intersection'](_0xa3e672[_0xabe5('0x2f')],_0xa3e672['query']);_0x2c4183['attributes']=_[_0xabe5('0x34')](_0xa3e672['model'],qs['fields'](_0x4e6999[_0xabe5('0x31')][_0xabe5('0x36')]));_0x2c4183[_0xabe5('0x35')]=_0x2c4183['attributes']['length']?_0x2c4183[_0xabe5('0x35')]:_0xa3e672['model'];if(_0x4e6999['query'][_0xabe5('0x45')]){_0x2c4183[_0xabe5('0x46')]=[{'all':!![]}];}_0x2c4183=_['merge']({},_0x2c4183,_0x4e6999[_0xabe5('0x40')]);return db[_0xabe5('0x2b')]['find'](_0x2c4183)['then'](handleEntityNotFound(_0x34bf76,null))['then'](respondWithResult(_0x34bf76,null))[_0xabe5('0x47')](handleError(_0x34bf76,null));};exports[_0xabe5('0x48')]=function(_0x5ab01d,_0x587a03){return db['VtigerField']['create'](_0x5ab01d[_0xabe5('0x49')],{})[_0xabe5('0x41')](respondWithResult(_0x587a03,0xc9))['catch'](handleError(_0x587a03,null));};exports[_0xabe5('0x24')]=function(_0x3cb25a,_0x72d015){if(_0x3cb25a[_0xabe5('0x49')]['id']){delete _0x3cb25a['body']['id'];}return db[_0xabe5('0x2b')]['find']({'where':{'id':_0x3cb25a[_0xabe5('0x44')]['id']}})[_0xabe5('0x41')](handleEntityNotFound(_0x72d015,null))[_0xabe5('0x41')](saveUpdates(_0x3cb25a[_0xabe5('0x49')],null))[_0xabe5('0x41')](respondWithResult(_0x72d015,null))[_0xabe5('0x47')](handleError(_0x72d015,null));};exports[_0xabe5('0x25')]=function(_0x987f63,_0x1097e8){return db[_0xabe5('0x2b')][_0xabe5('0x4a')]({'where':{'id':_0x987f63[_0xabe5('0x44')]['id']}})[_0xabe5('0x41')](handleEntityNotFound(_0x1097e8,null))[_0xabe5('0x41')](removeEntity(_0x1097e8,null))[_0xabe5('0x47')](handleError(_0x1097e8,null));};
\ No newline at end of file
+var _0xd902=['attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','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','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','VtigerField','rawAttributes','fieldName','type','query','keys','filters','model'];(function(_0x2c9f85,_0x166f1a){var _0x4da33b=function(_0x87e307){while(--_0x87e307){_0x2c9f85['push'](_0x2c9f85['shift']());}};_0x4da33b(++_0x166f1a);}(_0xd902,0xe9));var _0x2d90=function(_0x5cd23e,_0x20777b){_0x5cd23e=_0x5cd23e-0x0;var _0x216550=_0xd902[_0x5cd23e];return _0x216550;};'use strict';var emlformat=require(_0x2d90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d90('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d90('0x2'));var BPromise=require(_0x2d90('0x3'));var Mustache=require(_0x2d90('0x4'));var util=require(_0x2d90('0x5'));var path=require('path');var sox=require(_0x2d90('0x6'));var csv=require('to-csv');var ejs=require(_0x2d90('0x7'));var fs=require('fs');var fs_extra=require(_0x2d90('0x8'));var _=require(_0x2d90('0x9'));var squel=require(_0x2d90('0xa'));var crypto=require(_0x2d90('0xb'));var jsforce=require(_0x2d90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2d90('0xd'));var querystring=require(_0x2d90('0xe'));var Papa=require(_0x2d90('0xf'));var Redis=require(_0x2d90('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2d90('0x11'));var as=require(_0x2d90('0x12'));var hardwareService=require(_0x2d90('0x13'));var logger=require(_0x2d90('0x14'))(_0x2d90('0x15'));var utils=require(_0x2d90('0x16'));var config=require(_0x2d90('0x17'));var licenseUtil=require(_0x2d90('0x18'));var db=require(_0x2d90('0x19'))['db'];function respondWithStatusCode(_0x5e615a,_0x47cfd8){_0x47cfd8=_0x47cfd8||0xcc;return function(_0x5e5dbb){if(_0x5e5dbb){return _0x5e615a[_0x2d90('0x1a')](_0x47cfd8);}return _0x5e615a['status'](_0x47cfd8)[_0x2d90('0x1b')]();};}function respondWithResult(_0x2af6d0,_0x33539b){_0x33539b=_0x33539b||0xc8;return function(_0x3a451b){if(_0x3a451b){return _0x2af6d0[_0x2d90('0x1c')](_0x33539b)[_0x2d90('0x1d')](_0x3a451b);}};}function respondWithFilteredResult(_0x2b412f,_0x1ee65e){return function(_0x36640d){if(_0x36640d){var _0x836ccf=typeof _0x1ee65e['offset']===_0x2d90('0x1e')&&typeof _0x1ee65e[_0x2d90('0x1f')]===_0x2d90('0x1e');var _0x1c9af9=_0x36640d[_0x2d90('0x20')];var _0x2f2b25=_0x836ccf?0x0:_0x1ee65e['offset'];var _0x1de108=_0x836ccf?_0x36640d[_0x2d90('0x20')]:_0x1ee65e[_0x2d90('0x21')]+_0x1ee65e[_0x2d90('0x1f')];var _0x47de7e;if(_0x1de108>=_0x1c9af9){_0x1de108=_0x1c9af9;_0x47de7e=0xc8;}else{_0x47de7e=0xce;}_0x2b412f[_0x2d90('0x1c')](_0x47de7e);return _0x2b412f['set'](_0x2d90('0x22'),_0x2f2b25+'-'+_0x1de108+'/'+_0x1c9af9)[_0x2d90('0x1d')](_0x36640d);}return null;};}function patchUpdates(_0xdb53ed){return function(_0x2af1f3){try{jsonpatch[_0x2d90('0x23')](_0x2af1f3,_0xdb53ed,!![]);}catch(_0x5436a6){return BPromise[_0x2d90('0x24')](_0x5436a6);}return _0x2af1f3[_0x2d90('0x25')]();};}function saveUpdates(_0xcb730b,_0x29be12){return function(_0xff5939){if(_0xff5939){return _0xff5939[_0x2d90('0x26')](_0xcb730b)[_0x2d90('0x27')](function(_0x5516e5){return _0x5516e5;});}return null;};}function removeEntity(_0x55edf5,_0x33564c){return function(_0x553756){if(_0x553756){return _0x553756[_0x2d90('0x28')]()[_0x2d90('0x27')](function(){_0x55edf5[_0x2d90('0x1c')](0xcc)[_0x2d90('0x1b')]();});}};}function handleEntityNotFound(_0x19cf34,_0x360629){return function(_0x468a12){if(!_0x468a12){_0x19cf34['sendStatus'](0x194);}return _0x468a12;};}function handleError(_0x3e1907,_0x3f1075){_0x3f1075=_0x3f1075||0x1f4;return function(_0x4dee51){logger[_0x2d90('0x29')](_0x4dee51['stack']);if(_0x4dee51[_0x2d90('0x2a')]){delete _0x4dee51[_0x2d90('0x2a')];}_0x3e1907['status'](_0x3f1075)['send'](_0x4dee51);};}exports['index']=function(_0x5dff8e,_0x57bad0){var _0x4da9fb={},_0xd8df37={},_0x446cc7={'count':0x0,'rows':[]};var _0x28394f=_['map'](db[_0x2d90('0x2b')][_0x2d90('0x2c')],function(_0x2b4884){return{'name':_0x2b4884[_0x2d90('0x2d')],'type':_0x2b4884[_0x2d90('0x2e')]['key']};});_0xd8df37['model']=_['map'](_0x28394f,_0x2d90('0x2a'));_0xd8df37[_0x2d90('0x2f')]=_[_0x2d90('0x30')](_0x5dff8e['query']);_0xd8df37[_0x2d90('0x31')]=_['intersection'](_0xd8df37[_0x2d90('0x32')],_0xd8df37['query']);_0x4da9fb[_0x2d90('0x33')]=_[_0x2d90('0x34')](_0xd8df37['model'],qs['fields'](_0x5dff8e[_0x2d90('0x2f')][_0x2d90('0x35')]));_0x4da9fb[_0x2d90('0x33')]=_0x4da9fb['attributes'][_0x2d90('0x36')]?_0x4da9fb['attributes']:_0xd8df37[_0x2d90('0x32')];if(!_0x5dff8e[_0x2d90('0x2f')]['hasOwnProperty'](_0x2d90('0x37'))){_0x4da9fb[_0x2d90('0x1f')]=qs[_0x2d90('0x1f')](_0x5dff8e[_0x2d90('0x2f')]['limit']);_0x4da9fb[_0x2d90('0x21')]=qs['offset'](_0x5dff8e[_0x2d90('0x2f')]['offset']);}_0x4da9fb['order']=qs[_0x2d90('0x38')](_0x5dff8e[_0x2d90('0x2f')][_0x2d90('0x38')]);_0x4da9fb[_0x2d90('0x39')]=qs[_0x2d90('0x31')](_[_0x2d90('0x3a')](_0x5dff8e['query'],_0xd8df37[_0x2d90('0x31')]),_0x28394f);if(_0x5dff8e[_0x2d90('0x2f')][_0x2d90('0x3b')]){_0x4da9fb[_0x2d90('0x39')]=_[_0x2d90('0x3c')](_0x4da9fb[_0x2d90('0x39')],{'$or':_['map'](_0x28394f,function(_0x385333){if(_0x385333[_0x2d90('0x2e')]!=='VIRTUAL'){var _0x1338c8={};_0x1338c8[_0x385333[_0x2d90('0x2a')]]={'$like':'%'+_0x5dff8e['query'][_0x2d90('0x3b')]+'%'};return _0x1338c8;}})});}_0x4da9fb=_[_0x2d90('0x3c')]({},_0x4da9fb,_0x5dff8e[_0x2d90('0x3d')]);var _0x10de1e={'where':_0x4da9fb[_0x2d90('0x39')]};return db['VtigerField'][_0x2d90('0x20')](_0x10de1e)[_0x2d90('0x27')](function(_0x4d82eb){_0x446cc7[_0x2d90('0x20')]=_0x4d82eb;if(_0x5dff8e['query'][_0x2d90('0x3e')]){_0x4da9fb[_0x2d90('0x3f')]=[{'all':!![]}];}return db[_0x2d90('0x2b')][_0x2d90('0x40')](_0x4da9fb);})[_0x2d90('0x27')](function(_0x576bba){_0x446cc7['rows']=_0x576bba;return _0x446cc7;})[_0x2d90('0x27')](respondWithFilteredResult(_0x57bad0,_0x4da9fb))[_0x2d90('0x41')](handleError(_0x57bad0,null));};exports[_0x2d90('0x42')]=function(_0x4ce179,_0x31a432){var _0x192a19={'raw':!![],'where':{'id':_0x4ce179[_0x2d90('0x43')]['id']}},_0x2faba9={};_0x2faba9[_0x2d90('0x32')]=_[_0x2d90('0x30')](db['VtigerField']['rawAttributes']);_0x2faba9[_0x2d90('0x2f')]=_[_0x2d90('0x30')](_0x4ce179['query']);_0x2faba9['filters']=_[_0x2d90('0x34')](_0x2faba9[_0x2d90('0x32')],_0x2faba9[_0x2d90('0x2f')]);_0x192a19[_0x2d90('0x33')]=_[_0x2d90('0x34')](_0x2faba9['model'],qs[_0x2d90('0x35')](_0x4ce179['query'][_0x2d90('0x35')]));_0x192a19[_0x2d90('0x33')]=_0x192a19[_0x2d90('0x33')][_0x2d90('0x36')]?_0x192a19[_0x2d90('0x33')]:_0x2faba9[_0x2d90('0x32')];if(_0x4ce179[_0x2d90('0x2f')][_0x2d90('0x3e')]){_0x192a19[_0x2d90('0x3f')]=[{'all':!![]}];}_0x192a19=_['merge']({},_0x192a19,_0x4ce179[_0x2d90('0x3d')]);return db[_0x2d90('0x2b')][_0x2d90('0x44')](_0x192a19)[_0x2d90('0x27')](handleEntityNotFound(_0x31a432,null))[_0x2d90('0x27')](respondWithResult(_0x31a432,null))[_0x2d90('0x41')](handleError(_0x31a432,null));};exports['create']=function(_0x4c4eb9,_0x137b5d){return db[_0x2d90('0x2b')][_0x2d90('0x45')](_0x4c4eb9['body'],{})['then'](respondWithResult(_0x137b5d,0xc9))[_0x2d90('0x41')](handleError(_0x137b5d,null));};exports['update']=function(_0x139fad,_0x1697e8){if(_0x139fad[_0x2d90('0x46')]['id']){delete _0x139fad[_0x2d90('0x46')]['id'];}return db[_0x2d90('0x2b')][_0x2d90('0x44')]({'where':{'id':_0x139fad['params']['id']}})[_0x2d90('0x27')](handleEntityNotFound(_0x1697e8,null))[_0x2d90('0x27')](saveUpdates(_0x139fad[_0x2d90('0x46')],null))[_0x2d90('0x27')](respondWithResult(_0x1697e8,null))['catch'](handleError(_0x1697e8,null));};exports[_0x2d90('0x28')]=function(_0x2d641a,_0x4bf7c8){return db['VtigerField'][_0x2d90('0x44')]({'where':{'id':_0x2d641a[_0x2d90('0x43')]['id']}})[_0x2d90('0x27')](handleEntityNotFound(_0x4bf7c8,null))['then'](removeEntity(_0x4bf7c8,null))['catch'](handleError(_0x4bf7c8,null));};
\ No newline at end of file
index 23ed059..dc970de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6959=['vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields'];(function(_0x30d33c,_0x37cf27){var _0x3e1ed4=function(_0x4c5603){while(--_0x4c5603){_0x30d33c['push'](_0x30d33c['shift']());}};_0x3e1ed4(++_0x37cf27);}(_0x6959,0x12e));var _0x9695=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6959[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9695('0x0'));var util=require(_0x9695('0x1'));var logger=require(_0x9695('0x2'))(_0x9695('0x3'));var moment=require(_0x9695('0x4'));var BPromise=require(_0x9695('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9695('0x6'));var rimraf=require(_0x9695('0x7'));var config=require(_0x9695('0x8'));var attributes=require(_0x9695('0x9'));module['exports']=function(_0x77ccec,_0xd18a10){return _0x77ccec[_0x9695('0xa')](_0x9695('0xb'),attributes,{'tableName':_0x9695('0xc'),'paranoid':![],'indexes':[{'name':_0x9695('0xd'),'fields':['idField',_0x9695('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8eb=['api','moment','bluebird','request-promise','path','rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe8eb,0x7c));var _0xbe8e=function(_0x73bde,_0x17fa7f){_0x73bde=_0x73bde-0x0;var _0x38f5c2=_0xe8eb[_0x73bde];return _0x38f5c2;};'use strict';var _=require(_0xbe8e('0x0'));var util=require(_0xbe8e('0x1'));var logger=require('../../config/logger')(_0xbe8e('0x2'));var moment=require(_0xbe8e('0x3'));var BPromise=require(_0xbe8e('0x4'));var rp=require(_0xbe8e('0x5'));var fs=require('fs');var path=require(_0xbe8e('0x6'));var rimraf=require(_0xbe8e('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xbe8e('0x8')]=function(_0x41d2cc,_0x365f19){return _0x41d2cc[_0xbe8e('0x9')](_0xbe8e('0xa'),attributes,{'tableName':_0xbe8e('0xb'),'paranoid':![],'indexes':[{'name':_0xbe8e('0xc'),'fields':['idField',_0xbe8e('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c78b880..1dc272d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a5b=['error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a5b,0x153));var _0xb1a5=function(_0x58b024,_0x2848ea){_0x58b024=_0x58b024-0x0;var _0x4c699b=_0x1a5b[_0x58b024];return _0x4c699b;};'use strict';var _=require(_0xb1a5('0x0'));var util=require(_0xb1a5('0x1'));var moment=require(_0xb1a5('0x2'));var BPromise=require(_0xb1a5('0x3'));var rs=require(_0xb1a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1a5('0x5'))['db'];var utils=require(_0xb1a5('0x6'));var logger=require(_0xb1a5('0x7'))(_0xb1a5('0x8'));var config=require(_0xb1a5('0x9'));var jayson=require(_0xb1a5('0xa'));var client=jayson[_0xb1a5('0xb')][_0xb1a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f433e,_0x2a315d,_0x5a40a4){return new BPromise(function(_0x411797,_0x11f5c8){return client[_0xb1a5('0xd')](_0x3f433e,_0x5a40a4)[_0xb1a5('0xe')](function(_0x3fd94e){logger[_0xb1a5('0xf')](_0xb1a5('0x10'),_0x2a315d,_0xb1a5('0x11'));logger[_0xb1a5('0x12')](_0xb1a5('0x13'),_0x2a315d,'request\x20sent',JSON[_0xb1a5('0x14')](_0x3fd94e));if(_0x3fd94e[_0xb1a5('0x15')]){if(_0x3fd94e[_0xb1a5('0x15')][_0xb1a5('0x16')]===0x1f4){logger[_0xb1a5('0x15')](_0xb1a5('0x10'),_0x2a315d,_0x3fd94e[_0xb1a5('0x15')]['message']);return _0x11f5c8(_0x3fd94e['error'][_0xb1a5('0x17')]);}logger[_0xb1a5('0x15')]('VtigerField,\x20%s,\x20%s',_0x2a315d,_0x3fd94e['error'][_0xb1a5('0x17')]);return _0x411797(_0x3fd94e[_0xb1a5('0x15')]['message']);}else{logger['info'](_0xb1a5('0x10'),_0x2a315d,'request\x20sent');_0x411797(_0x3fd94e['result'][_0xb1a5('0x17')]);}})['catch'](function(_0x4bd264){logger[_0xb1a5('0x15')](_0xb1a5('0x10'),_0x2a315d,_0x4bd264);_0x11f5c8(_0x4bd264);});});}
\ No newline at end of file
+var _0xf53b=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x48bc44,_0x1510f0){var _0x186cf6=function(_0x117a2b){while(--_0x117a2b){_0x48bc44['push'](_0x48bc44['shift']());}};_0x186cf6(++_0x1510f0);}(_0xf53b,0x1ef));var _0xbf53=function(_0x18a304,_0x19e2a3){_0x18a304=_0x18a304-0x0;var _0x1a0266=_0xf53b[_0x18a304];return _0x1a0266;};'use strict';var _=require(_0xbf53('0x0'));var util=require(_0xbf53('0x1'));var moment=require('moment');var BPromise=require(_0xbf53('0x2'));var rs=require(_0xbf53('0x3'));var fs=require('fs');var Redis=require(_0xbf53('0x4'));var db=require(_0xbf53('0x5'))['db'];var utils=require(_0xbf53('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xbf53('0x7'));var jayson=require(_0xbf53('0x8'));var client=jayson[_0xbf53('0x9')][_0xbf53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x463500,_0x3af2c1,_0x21a0db){return new BPromise(function(_0x247292,_0x3a5d33){return client['request'](_0x463500,_0x21a0db)[_0xbf53('0xb')](function(_0x6e6505){logger['info']('VtigerField,\x20%s,\x20%s',_0x3af2c1,_0xbf53('0xc'));logger['debug'](_0xbf53('0xd'),_0x3af2c1,_0xbf53('0xc'),JSON[_0xbf53('0xe')](_0x6e6505));if(_0x6e6505['error']){if(_0x6e6505[_0xbf53('0xf')][_0xbf53('0x10')]===0x1f4){logger[_0xbf53('0xf')](_0xbf53('0x11'),_0x3af2c1,_0x6e6505[_0xbf53('0xf')]['message']);return _0x3a5d33(_0x6e6505['error'][_0xbf53('0x12')]);}logger[_0xbf53('0xf')]('VtigerField,\x20%s,\x20%s',_0x3af2c1,_0x6e6505[_0xbf53('0xf')][_0xbf53('0x12')]);return _0x247292(_0x6e6505[_0xbf53('0xf')][_0xbf53('0x12')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x3af2c1,'request\x20sent');_0x247292(_0x6e6505['result']['message']);}})[_0xbf53('0x13')](function(_0x110221){logger['error']('VtigerField,\x20%s,\x20%s',_0x3af2c1,_0x110221);_0x3a5d33(_0x110221);});});}
\ No newline at end of file
index ef2c70c..83f6460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3468=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','index','/:id','get','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','put','update'];(function(_0x3908b3,_0x50a758){var _0x5eb0c2=function(_0x322816){while(--_0x322816){_0x3908b3['push'](_0x3908b3['shift']());}};_0x5eb0c2(++_0x50a758);}(_0x3468,0x141));var _0x8346=function(_0x5adb16,_0x8ecde0){_0x5adb16=_0x5adb16-0x0;var _0x17519d=_0x3468[_0x5adb16];return _0x17519d;};'use strict';var multer=require(_0x8346('0x0'));var util=require(_0x8346('0x1'));var path=require(_0x8346('0x2'));var timeout=require(_0x8346('0x3'));var express=require('express');var router=express[_0x8346('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8346('0x5'));var interaction=require(_0x8346('0x6'));var config=require('../../config/environment');var controller=require(_0x8346('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8346('0x8')]);router['get'](_0x8346('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8346('0xa')](_0x8346('0xb'),auth[_0x8346('0xc')](),controller[_0x8346('0xd')]);router[_0x8346('0xa')](_0x8346('0xe'),auth[_0x8346('0xc')](),controller[_0x8346('0xf')]);router[_0x8346('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8346('0x10')](_0x8346('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8346('0x11')](_0x8346('0x9'),auth[_0x8346('0xc')](),controller[_0x8346('0x12')]);router['delete']('/:id',auth[_0x8346('0xc')](),controller['destroy']);module[_0x8346('0x13')]=router;
\ No newline at end of file
+var _0xc92c=['getFields','create','post','/:id/configurations','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields'];(function(_0x447a4b,_0x353246){var _0x56044b=function(_0xbac711){while(--_0xbac711){_0x447a4b['push'](_0x447a4b['shift']());}};_0x56044b(++_0x353246);}(_0xc92c,0x128));var _0xcc92=function(_0x150320,_0x2bb74e){_0x150320=_0x150320-0x0;var _0x35d60e=_0xc92c[_0x150320];return _0x35d60e;};'use strict';var multer=require(_0xcc92('0x0'));var util=require(_0xcc92('0x1'));var path=require('path');var timeout=require(_0xcc92('0x2'));var express=require(_0xcc92('0x3'));var router=express[_0xcc92('0x4')]();var fs_extra=require(_0xcc92('0x5'));var auth=require(_0xcc92('0x6'));var interaction=require(_0xcc92('0x7'));var config=require(_0xcc92('0x8'));var controller=require(_0xcc92('0x9'));router[_0xcc92('0xa')]('/',auth[_0xcc92('0xb')](),controller[_0xcc92('0xc')]);router[_0xcc92('0xa')]('/:id',auth[_0xcc92('0xb')](),controller[_0xcc92('0xd')]);router[_0xcc92('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xcc92('0xe')]);router['get'](_0xcc92('0xf'),auth['isAuthenticated'](),controller[_0xcc92('0x10')]);router['post']('/',auth[_0xcc92('0xb')](),controller[_0xcc92('0x11')]);router[_0xcc92('0x12')](_0xcc92('0x13'),auth[_0xcc92('0xb')](),controller[_0xcc92('0x14')]);router[_0xcc92('0x15')](_0xcc92('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xcc92('0x17')](_0xcc92('0x16'),auth[_0xcc92('0xb')](),controller[_0xcc92('0x18')]);module[_0xcc92('0x19')]=router;
\ No newline at end of file
index 42cb9eb..5ceb737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85de=['username','remoteUri','ENUM','password','integrationTab','sequelize','exports','STRING'];(function(_0x27d443,_0x4ee5ec){var _0x21b822=function(_0x4c6296){while(--_0x4c6296){_0x27d443['push'](_0x27d443['shift']());}};_0x21b822(++_0x4ee5ec);}(_0x85de,0x65));var _0xe85d=function(_0xf55e77,_0x23a116){_0xf55e77=_0xf55e77-0x0;var _0x2d60de=_0x85de[_0xf55e77];return _0x2d60de;};'use strict';var Sequelize=require(_0xe85d('0x0'));module[_0xe85d('0x1')]={'name':{'type':Sequelize[_0xe85d('0x2')]},'description':{'type':Sequelize[_0xe85d('0x2')]},'username':{'type':Sequelize[_0xe85d('0x2')],'unique':_0xe85d('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe85d('0x2')]},'remoteUri':{'type':Sequelize[_0xe85d('0x2')],'unique':_0xe85d('0x4')},'authType':{'type':Sequelize[_0xe85d('0x5')]('password','token'),'defaultValue':_0xe85d('0x6')},'serverUrl':{'type':Sequelize[_0xe85d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe85d('0x5')](_0xe85d('0x7'),'newTab'),'defaultValue':_0xe85d('0x7')}};
\ No newline at end of file
+var _0xdeb3=['newTab','exports','STRING','remoteUri','ENUM','token','integrationTab'];(function(_0x5b38c8,_0xdf5f90){var _0xd2a86c=function(_0x2d4267){while(--_0x2d4267){_0x5b38c8['push'](_0x5b38c8['shift']());}};_0xd2a86c(++_0xdf5f90);}(_0xdeb3,0xb7));var _0x3deb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdeb3[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0x3deb('0x0')]={'name':{'type':Sequelize[_0x3deb('0x1')]},'description':{'type':Sequelize[_0x3deb('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x3deb('0x1')]},'token':{'type':Sequelize[_0x3deb('0x1')]},'remoteUri':{'type':Sequelize[_0x3deb('0x1')],'unique':_0x3deb('0x2')},'authType':{'type':Sequelize[_0x3deb('0x3')]('password',_0x3deb('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3deb('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3deb('0x5'),_0x3deb('0x6')),'defaultValue':_0x3deb('0x5')}};
\ No newline at end of file
index c50f183..f090a5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2547=['Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','system_field_options','custom_field_options','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ZendeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','create','catch','body','find','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','%s/token:%s'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x2547,0x1cd));var _0x7254=function(_0x91a26b,_0x493ee4){_0x91a26b=_0x91a26b-0x0;var _0x1fa497=_0x2547[_0x91a26b];return _0x1fa497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16c08e,_0x2bfff8){_0x2bfff8=_0x2bfff8||0xcc;return function(_0x348d4e){if(_0x348d4e){return _0x16c08e[_0x7254('0x17')](_0x2bfff8);}return _0x16c08e[_0x7254('0x18')](_0x2bfff8)[_0x7254('0x19')]();};}function respondWithResult(_0x124192,_0x21cecc){_0x21cecc=_0x21cecc||0xc8;return function(_0x1625ea){if(_0x1625ea){return _0x124192[_0x7254('0x18')](_0x21cecc)[_0x7254('0x1a')](_0x1625ea);}};}function respondWithFilteredResult(_0x1ee5cb,_0x163c8c){return function(_0x535065){if(_0x535065){var _0x265293=typeof _0x163c8c[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x163c8c[_0x7254('0x1d')]===_0x7254('0x1c');var _0x1e4aff=_0x535065[_0x7254('0x1e')];var _0x5dd23b=_0x265293?0x0:_0x163c8c[_0x7254('0x1b')];var _0x2283b7=_0x265293?_0x535065[_0x7254('0x1e')]:_0x163c8c[_0x7254('0x1b')]+_0x163c8c[_0x7254('0x1d')];var _0x301f00;if(_0x2283b7>=_0x1e4aff){_0x2283b7=_0x1e4aff;_0x301f00=0xc8;}else{_0x301f00=0xce;}_0x1ee5cb[_0x7254('0x18')](_0x301f00);return _0x1ee5cb[_0x7254('0x1f')](_0x7254('0x20'),_0x5dd23b+'-'+_0x2283b7+'/'+_0x1e4aff)[_0x7254('0x1a')](_0x535065);}return null;};}function patchUpdates(_0x2594b8){return function(_0x24bc73){try{jsonpatch[_0x7254('0x21')](_0x24bc73,_0x2594b8,!![]);}catch(_0x41ef72){return BPromise[_0x7254('0x22')](_0x41ef72);}return _0x24bc73[_0x7254('0x23')]();};}function saveUpdates(_0x2bb2fe,_0x46c0a2){return function(_0x195fd2){if(_0x195fd2){return _0x195fd2[_0x7254('0x24')](_0x2bb2fe)[_0x7254('0x25')](function(_0x50c34b){return _0x50c34b;});}return null;};}function removeEntity(_0x493bfd,_0x136ea3){return function(_0xd91c1f){if(_0xd91c1f){return _0xd91c1f[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x493bfd[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x133aee,_0x5d6df5){return function(_0x133287){if(!_0x133287){_0x133aee[_0x7254('0x17')](0x194);}return _0x133287;};}function handleError(_0x2b4f46,_0x494cdb){_0x494cdb=_0x494cdb||0x1f4;return function(_0x3c22d0){logger['error'](_0x3c22d0[_0x7254('0x27')]);if(_0x3c22d0[_0x7254('0x28')]){delete _0x3c22d0['name'];}_0x2b4f46[_0x7254('0x18')](_0x494cdb)[_0x7254('0x29')](_0x3c22d0);};}exports['index']=function(_0x14cbea,_0x6c4927){var _0x37cb5c={},_0xb9198b={},_0x43bf02={'count':0x0,'rows':[]};var _0xfe02ea=_['map'](db[_0x7254('0x2a')][_0x7254('0x2b')],function(_0x5569be){return{'name':_0x5569be[_0x7254('0x2c')],'type':_0x5569be[_0x7254('0x2d')][_0x7254('0x2e')]};});_0xb9198b['model']=_[_0x7254('0x2f')](_0xfe02ea,_0x7254('0x28'));_0xb9198b[_0x7254('0x30')]=_[_0x7254('0x31')](_0x14cbea[_0x7254('0x30')]);_0xb9198b[_0x7254('0x32')]=_[_0x7254('0x33')](_0xb9198b['model'],_0xb9198b[_0x7254('0x30')]);_0x37cb5c['attributes']=_['intersection'](_0xb9198b[_0x7254('0x34')],qs[_0x7254('0x35')](_0x14cbea[_0x7254('0x30')][_0x7254('0x35')]));_0x37cb5c[_0x7254('0x36')]=_0x37cb5c[_0x7254('0x36')][_0x7254('0x37')]?_0x37cb5c[_0x7254('0x36')]:_0xb9198b[_0x7254('0x34')];if(!_0x14cbea[_0x7254('0x30')][_0x7254('0x38')](_0x7254('0x39'))){_0x37cb5c[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x14cbea['query'][_0x7254('0x1d')]);_0x37cb5c[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x14cbea[_0x7254('0x30')][_0x7254('0x1b')]);}_0x37cb5c['order']=qs[_0x7254('0x3a')](_0x14cbea['query'][_0x7254('0x3a')]);_0x37cb5c[_0x7254('0x3b')]=qs[_0x7254('0x32')](_[_0x7254('0x3c')](_0x14cbea[_0x7254('0x30')],_0xb9198b['filters']),_0xfe02ea);if(_0x14cbea[_0x7254('0x30')]['filter']){_0x37cb5c[_0x7254('0x3b')]=_[_0x7254('0x3d')](_0x37cb5c['where'],{'$or':_[_0x7254('0x2f')](_0xfe02ea,function(_0x3c5bf4){if(_0x3c5bf4[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x14b625={};_0x14b625[_0x3c5bf4[_0x7254('0x28')]]={'$like':'%'+_0x14cbea['query'][_0x7254('0x3f')]+'%'};return _0x14b625;}})});}_0x37cb5c=_[_0x7254('0x3d')]({},_0x37cb5c,_0x14cbea[_0x7254('0x40')]);var _0x4eca7a={'where':_0x37cb5c[_0x7254('0x3b')]};return db[_0x7254('0x2a')][_0x7254('0x1e')](_0x4eca7a)['then'](function(_0xc09711){_0x43bf02[_0x7254('0x1e')]=_0xc09711;if(_0x14cbea[_0x7254('0x30')][_0x7254('0x41')]){_0x37cb5c[_0x7254('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x37cb5c);})[_0x7254('0x25')](function(_0x17bc29){_0x43bf02[_0x7254('0x43')]=_0x17bc29;return _0x43bf02;})[_0x7254('0x25')](respondWithFilteredResult(_0x6c4927,_0x37cb5c))['catch'](handleError(_0x6c4927,null));};exports['show']=function(_0x29821a,_0x565cd8){var _0x2ae22e={'raw':![],'where':{'id':_0x29821a[_0x7254('0x44')]['id']}},_0x3187b0={};_0x3187b0[_0x7254('0x34')]=_['keys'](db['ZendeskAccount'][_0x7254('0x2b')]);_0x3187b0[_0x7254('0x30')]=_[_0x7254('0x31')](_0x29821a[_0x7254('0x30')]);_0x3187b0[_0x7254('0x32')]=_['intersection'](_0x3187b0['model'],_0x3187b0[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x36')]=_[_0x7254('0x33')](_0x3187b0['model'],qs[_0x7254('0x35')](_0x29821a[_0x7254('0x30')]['fields']));_0x2ae22e[_0x7254('0x36')]=_0x2ae22e[_0x7254('0x36')][_0x7254('0x37')]?_0x2ae22e[_0x7254('0x36')]:_0x3187b0['model'];if(_0x29821a[_0x7254('0x30')][_0x7254('0x41')]){_0x2ae22e['include']=[{'all':!![]}];}_0x2ae22e=_[_0x7254('0x3d')]({},_0x2ae22e,_0x29821a[_0x7254('0x40')]);return db[_0x7254('0x2a')]['find'](_0x2ae22e)[_0x7254('0x25')](handleEntityNotFound(_0x565cd8,null))[_0x7254('0x25')](respondWithResult(_0x565cd8,null))['catch'](handleError(_0x565cd8,null));};exports['create']=function(_0x10b32f,_0x54c792){return db[_0x7254('0x2a')][_0x7254('0x45')](_0x10b32f['body'],{})['then'](respondWithResult(_0x54c792,0xc9))[_0x7254('0x46')](handleError(_0x54c792,null));};exports[_0x7254('0x24')]=function(_0x38bcd5,_0x104d98){if(_0x38bcd5[_0x7254('0x47')]['id']){delete _0x38bcd5[_0x7254('0x47')]['id'];}return db['ZendeskAccount'][_0x7254('0x48')]({'where':{'id':_0x38bcd5['params']['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x104d98,null))[_0x7254('0x25')](saveUpdates(_0x38bcd5[_0x7254('0x47')],null))['then'](respondWithResult(_0x104d98,null))[_0x7254('0x46')](handleError(_0x104d98,null));};exports[_0x7254('0x26')]=function(_0x252758,_0x5b3b6e){return db[_0x7254('0x2a')][_0x7254('0x48')]({'where':{'id':_0x252758[_0x7254('0x44')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x5b3b6e,null))[_0x7254('0x25')](removeEntity(_0x5b3b6e,null))['catch'](handleError(_0x5b3b6e,null));};exports['getConfigurations']=function(_0x24c532,_0x2cb7cd,_0x441d23){var _0x10e1cb={};var _0x3b0002={};var _0x4c6838;var _0x5a44fb;return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x24c532[_0x7254('0x44')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x2cb7cd,null))['then'](function(_0xaf6d3d){if(_0xaf6d3d){_0x4c6838=_0xaf6d3d;_0x3b0002[_0x7254('0x34')]=_['keys'](db[_0x7254('0x4a')]['rawAttributes']);_0x3b0002[_0x7254('0x30')]=_['keys'](_0x24c532[_0x7254('0x30')]);_0x3b0002['filters']=_['intersection'](_0x3b0002[_0x7254('0x34')],_0x3b0002[_0x7254('0x30')]);_0x10e1cb[_0x7254('0x36')]=_[_0x7254('0x33')](_0x3b0002['model'],qs[_0x7254('0x35')](_0x24c532['query'][_0x7254('0x35')]));_0x10e1cb[_0x7254('0x36')]=_0x10e1cb[_0x7254('0x36')][_0x7254('0x37')]?_0x10e1cb[_0x7254('0x36')]:_0x3b0002[_0x7254('0x34')];_0x10e1cb['order']=qs[_0x7254('0x3a')](_0x24c532[_0x7254('0x30')][_0x7254('0x3a')]);_0x10e1cb[_0x7254('0x3b')]=qs[_0x7254('0x32')](_[_0x7254('0x3c')](_0x24c532['query'],_0x3b0002[_0x7254('0x32')]));if(_0x24c532[_0x7254('0x30')][_0x7254('0x3f')]){_0x10e1cb[_0x7254('0x3b')]=_[_0x7254('0x3d')](_0x10e1cb[_0x7254('0x3b')],{'$or':_[_0x7254('0x2f')](_0x10e1cb['attributes'],function(_0x5dd108){var _0xac4d0={};_0xac4d0[_0x5dd108]={'$like':'%'+_0x24c532['query']['filter']+'%'};return _0xac4d0;})});}_0x10e1cb=_[_0x7254('0x3d')]({},_0x10e1cb,_0x24c532[_0x7254('0x40')]);return _0x4c6838[_0x7254('0x4b')](_0x10e1cb);}})['then'](function(_0x1821f0){if(_0x1821f0){_0x5a44fb=_0x1821f0['length'];if(!_0x24c532[_0x7254('0x30')][_0x7254('0x38')](_0x7254('0x39'))){_0x10e1cb[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x24c532['query'][_0x7254('0x1d')]);_0x10e1cb[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x24c532[_0x7254('0x30')]['offset']);}return _0x4c6838['getConfigurations'](_0x10e1cb);}})[_0x7254('0x25')](function(_0x41355e){if(_0x41355e){return _0x41355e?{'count':_0x5a44fb,'rows':_0x41355e}:null;}})[_0x7254('0x25')](respondWithResult(_0x2cb7cd,null))[_0x7254('0x46')](handleError(_0x2cb7cd,null));};exports[_0x7254('0x4c')]=function(_0x1cf028,_0x464680,_0x38cba1){if(_0x1cf028[_0x7254('0x47')]['id']){delete _0x1cf028[_0x7254('0x47')]['id'];}return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x1cf028[_0x7254('0x44')]['id']}})['then'](handleEntityNotFound(_0x464680,null))[_0x7254('0x25')](function(_0x4716a2){if(_0x4716a2){_0x1cf028[_0x7254('0x47')]['AccountId']=_0x4716a2['id'];_0x1cf028[_0x7254('0x47')][_0x7254('0x4d')]=integrations[_0x7254('0x4e')](_0x1cf028[_0x7254('0x47')]['channel'],_0x1cf028[_0x7254('0x47')]['type']);_0x1cf028[_0x7254('0x47')][_0x7254('0x4f')]=integrations[_0x7254('0x50')](_0x1cf028[_0x7254('0x47')]['channel'],_0x1cf028[_0x7254('0x47')]['type']);return db[_0x7254('0x4a')]['create'](_0x1cf028[_0x7254('0x47')],{'include':[{'model':db[_0x7254('0x51')],'as':_0x7254('0x4d')},{'model':db[_0x7254('0x51')],'as':_0x7254('0x4f')}]});}return null;})[_0x7254('0x25')](respondWithResult(_0x464680,null))[_0x7254('0x46')](handleError(_0x464680,null));};exports[_0x7254('0x52')]=function(_0x4e07c6,_0x37562a,_0x57c0a0){var _0x12c36e='';return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x4e07c6[_0x7254('0x44')]['id']},'attributes':['id',_0x7254('0x53'),_0x7254('0x54'),_0x7254('0x55'),_0x7254('0x56'),'remoteUri']})[_0x7254('0x25')](handleEntityNotFound(_0x37562a,null))['then'](function(_0x231184){if(_0x231184){_0x12c36e=_0x231184[_0x7254('0x57')];var _0x2399ef=_0x12c36e[_0x7254('0x58')](-0x1);if(_0x2399ef==='/'){_0x12c36e=_0x12c36e[_0x7254('0x59')](0x0,_0x12c36e[_0x7254('0x5a')](_0x2399ef));}var _0xb65570={'method':_0x7254('0x5b'),'uri':util[_0x7254('0x5c')](_0x7254('0x5d'),_0x12c36e,_0x7254('0x5e')),'json':!![]};switch(_0x231184[_0x7254('0x56')]){case _0x7254('0x54'):_0xb65570[_0x7254('0x5f')]={'Authorization':util[_0x7254('0x5c')](_0x7254('0x60'),new Buffer(util[_0x7254('0x5c')]('%s:%s',_0x231184['username'],_0x231184[_0x7254('0x54')]))[_0x7254('0x61')]('base64'))};break;case'token':_0xb65570['headers']={'Authorization':util[_0x7254('0x5c')](_0x7254('0x60'),new Buffer(util[_0x7254('0x5c')](_0x7254('0x62'),_0x231184['username'],_0x231184[_0x7254('0x55')]))[_0x7254('0x61')]('base64'))};break;default:throw new db[(_0x7254('0x63'))][(_0x7254('0x64'))](_0x7254('0x65'));}return rp(_0xb65570);}})['then'](function(_0x4aa036){if(_0x4aa036){var _0x220066=[_0x7254('0x66'),'description',_0x7254('0x67'),_0x7254('0x68')];_[_0x7254('0x69')](_0x4aa036[_0x7254('0x5e')],function(_0x24fcb1){return _0x220066['includes'](_0x24fcb1[_0x7254('0x2d')]);});return{'count':_0x4aa036[_0x7254('0x5e')][_0x7254('0x37')],'rows':_['map'](_0x4aa036[_0x7254('0x5e')],function(_0x4cf18d){return{'id':_0x4cf18d['id'],'name':_0x4cf18d['position']>0x7?_0x4cf18d['title']:_0x4cf18d[_0x7254('0x2d')],'custom':_0x4cf18d['position']>0x7?!![]:![],'options':_0x4cf18d['system_field_options']?_0x4cf18d[_0x7254('0x6a')]:_0x4cf18d[_0x7254('0x6b')]?_0x4cf18d[_0x7254('0x6b')]:[]};})};}})['then'](respondWithResult(_0x37562a,null))[_0x7254('0x46')](function(_0x5a0c41){var _0x175379=_0x4e07c6[_0x7254('0x30')]['test']?0x1f4:_0x5a0c41[_0x7254('0x6c')]||0x1f4;logger[_0x7254('0x6d')](_0x7254('0x6e'),_0x7254('0x52'),_0x175379,JSON[_0x7254('0x6f')](_0x5a0c41));delete _0x5a0c41[_0x7254('0x28')];if(_0x175379===0x191){_0x175379=0x190;}_0x37562a[_0x7254('0x18')](_0x175379)['send'](_0x4e07c6[_0x7254('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5a0c41[_0x7254('0x6c')]}:_0x5a0c41);});};
\ No newline at end of file
+var _0x1775=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','body','destroy','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','password','headers','%s:%s','base64','Basic\x20%s','%s/token:%s','ValidationError','subject','description','assignee','remove','ticket_fields','includes','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x515aeb,_0x5d2c3e){var _0xcc7d6a=function(_0x44a0e3){while(--_0x44a0e3){_0x515aeb['push'](_0x515aeb['shift']());}};_0xcc7d6a(++_0x5d2c3e);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];var integrations=require(_0x5177('0x1c'));function respondWithStatusCode(_0x3c4ced,_0x111e99){_0x111e99=_0x111e99||0xcc;return function(_0x299eba){if(_0x299eba){return _0x3c4ced[_0x5177('0x1d')](_0x111e99);}return _0x3c4ced[_0x5177('0x1e')](_0x111e99)[_0x5177('0x1f')]();};}function respondWithResult(_0x1eb9dd,_0x41bef4){_0x41bef4=_0x41bef4||0xc8;return function(_0x2bf5bb){if(_0x2bf5bb){return _0x1eb9dd[_0x5177('0x1e')](_0x41bef4)[_0x5177('0x20')](_0x2bf5bb);}};}function respondWithFilteredResult(_0x1b32e6,_0x175ca6){return function(_0x2ab5e5){if(_0x2ab5e5){var _0x7dba6f=typeof _0x175ca6[_0x5177('0x21')]==='undefined'&&typeof _0x175ca6[_0x5177('0x22')]===_0x5177('0x23');var _0x3f5ab5=_0x2ab5e5[_0x5177('0x24')];var _0x5f5bd4=_0x7dba6f?0x0:_0x175ca6[_0x5177('0x21')];var _0x2ebf91=_0x7dba6f?_0x2ab5e5[_0x5177('0x24')]:_0x175ca6['offset']+_0x175ca6[_0x5177('0x22')];var _0x4cf600;if(_0x2ebf91>=_0x3f5ab5){_0x2ebf91=_0x3f5ab5;_0x4cf600=0xc8;}else{_0x4cf600=0xce;}_0x1b32e6[_0x5177('0x1e')](_0x4cf600);return _0x1b32e6[_0x5177('0x25')](_0x5177('0x26'),_0x5f5bd4+'-'+_0x2ebf91+'/'+_0x3f5ab5)[_0x5177('0x20')](_0x2ab5e5);}return null;};}function patchUpdates(_0x451e5c){return function(_0x3314f2){try{jsonpatch[_0x5177('0x27')](_0x3314f2,_0x451e5c,!![]);}catch(_0xfc1bd4){return BPromise[_0x5177('0x28')](_0xfc1bd4);}return _0x3314f2[_0x5177('0x29')]();};}function saveUpdates(_0x23dad2,_0x3b0c37){return function(_0x5d9a9c){if(_0x5d9a9c){return _0x5d9a9c[_0x5177('0x2a')](_0x23dad2)['then'](function(_0x30b60f){return _0x30b60f;});}return null;};}function removeEntity(_0x2c68d8,_0x3b39b5){return function(_0x2d51d0){if(_0x2d51d0){return _0x2d51d0['destroy']()[_0x5177('0x2b')](function(){_0x2c68d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a0c2,_0x15cb93){return function(_0x577bf7){if(!_0x577bf7){_0x19a0c2[_0x5177('0x1d')](0x194);}return _0x577bf7;};}function handleError(_0x4eba3a,_0x231d35){_0x231d35=_0x231d35||0x1f4;return function(_0x1cbd29){logger['error'](_0x1cbd29[_0x5177('0x2c')]);if(_0x1cbd29[_0x5177('0x2d')]){delete _0x1cbd29[_0x5177('0x2d')];}_0x4eba3a[_0x5177('0x1e')](_0x231d35)[_0x5177('0x2e')](_0x1cbd29);};}exports[_0x5177('0x2f')]=function(_0x5577bb,_0x498fcd){var _0x45cf20={},_0x1c660e={},_0x7dae59={'count':0x0,'rows':[]};var _0x174f7a=_[_0x5177('0x30')](db[_0x5177('0x31')][_0x5177('0x32')],function(_0x72dced){return{'name':_0x72dced['fieldName'],'type':_0x72dced[_0x5177('0x33')][_0x5177('0x34')]};});_0x1c660e['model']=_[_0x5177('0x30')](_0x174f7a,'name');_0x1c660e[_0x5177('0x35')]=_[_0x5177('0x36')](_0x5577bb[_0x5177('0x35')]);_0x1c660e['filters']=_['intersection'](_0x1c660e[_0x5177('0x37')],_0x1c660e[_0x5177('0x35')]);_0x45cf20[_0x5177('0x38')]=_[_0x5177('0x39')](_0x1c660e[_0x5177('0x37')],qs[_0x5177('0x3a')](_0x5577bb[_0x5177('0x35')][_0x5177('0x3a')]));_0x45cf20['attributes']=_0x45cf20[_0x5177('0x38')][_0x5177('0x3b')]?_0x45cf20['attributes']:_0x1c660e[_0x5177('0x37')];if(!_0x5577bb[_0x5177('0x35')][_0x5177('0x3c')](_0x5177('0x3d'))){_0x45cf20[_0x5177('0x22')]=qs[_0x5177('0x22')](_0x5577bb['query'][_0x5177('0x22')]);_0x45cf20[_0x5177('0x21')]=qs[_0x5177('0x21')](_0x5577bb[_0x5177('0x35')][_0x5177('0x21')]);}_0x45cf20[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x5577bb['query'][_0x5177('0x3f')]);_0x45cf20[_0x5177('0x40')]=qs['filters'](_['pick'](_0x5577bb[_0x5177('0x35')],_0x1c660e[_0x5177('0x41')]),_0x174f7a);if(_0x5577bb[_0x5177('0x35')][_0x5177('0x42')]){_0x45cf20[_0x5177('0x40')]=_[_0x5177('0x43')](_0x45cf20[_0x5177('0x40')],{'$or':_[_0x5177('0x30')](_0x174f7a,function(_0xa2ed49){if(_0xa2ed49[_0x5177('0x33')]!==_0x5177('0x44')){var _0x1f15f8={};_0x1f15f8[_0xa2ed49[_0x5177('0x2d')]]={'$like':'%'+_0x5577bb['query'][_0x5177('0x42')]+'%'};return _0x1f15f8;}})});}_0x45cf20=_[_0x5177('0x43')]({},_0x45cf20,_0x5577bb['options']);var _0x7341c0={'where':_0x45cf20['where']};return db[_0x5177('0x31')][_0x5177('0x24')](_0x7341c0)[_0x5177('0x2b')](function(_0x5742aa){_0x7dae59['count']=_0x5742aa;if(_0x5577bb[_0x5177('0x35')][_0x5177('0x45')]){_0x45cf20[_0x5177('0x46')]=[{'all':!![]}];}return db[_0x5177('0x31')][_0x5177('0x47')](_0x45cf20);})[_0x5177('0x2b')](function(_0x41d874){_0x7dae59[_0x5177('0x48')]=_0x41d874;return _0x7dae59;})['then'](respondWithFilteredResult(_0x498fcd,_0x45cf20))[_0x5177('0x49')](handleError(_0x498fcd,null));};exports['show']=function(_0x5e3d30,_0x30e4f3){var _0x17dc98={'raw':![],'where':{'id':_0x5e3d30[_0x5177('0x4a')]['id']}},_0x5172f8={};_0x5172f8['model']=_['keys'](db[_0x5177('0x31')][_0x5177('0x32')]);_0x5172f8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x5e3d30[_0x5177('0x35')]);_0x5172f8[_0x5177('0x41')]=_[_0x5177('0x39')](_0x5172f8['model'],_0x5172f8['query']);_0x17dc98[_0x5177('0x38')]=_['intersection'](_0x5172f8[_0x5177('0x37')],qs[_0x5177('0x3a')](_0x5e3d30[_0x5177('0x35')][_0x5177('0x3a')]));_0x17dc98['attributes']=_0x17dc98[_0x5177('0x38')][_0x5177('0x3b')]?_0x17dc98[_0x5177('0x38')]:_0x5172f8[_0x5177('0x37')];if(_0x5e3d30[_0x5177('0x35')][_0x5177('0x45')]){_0x17dc98[_0x5177('0x46')]=[{'all':!![]}];}_0x17dc98=_[_0x5177('0x43')]({},_0x17dc98,_0x5e3d30[_0x5177('0x4b')]);return db[_0x5177('0x31')][_0x5177('0x4c')](_0x17dc98)['then'](handleEntityNotFound(_0x30e4f3,null))[_0x5177('0x2b')](respondWithResult(_0x30e4f3,null))['catch'](handleError(_0x30e4f3,null));};exports['create']=function(_0x5bda8a,_0x2f9ff9){return db[_0x5177('0x31')]['create'](_0x5bda8a[_0x5177('0x4d')],{})[_0x5177('0x2b')](respondWithResult(_0x2f9ff9,0xc9))[_0x5177('0x49')](handleError(_0x2f9ff9,null));};exports['update']=function(_0x1d4ae4,_0x5981dc){if(_0x1d4ae4['body']['id']){delete _0x1d4ae4['body']['id'];}return db[_0x5177('0x31')][_0x5177('0x4c')]({'where':{'id':_0x1d4ae4[_0x5177('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5981dc,null))['then'](saveUpdates(_0x1d4ae4[_0x5177('0x4d')],null))['then'](respondWithResult(_0x5981dc,null))[_0x5177('0x49')](handleError(_0x5981dc,null));};exports[_0x5177('0x4e')]=function(_0x430e8e,_0x31a6e1){return db[_0x5177('0x31')][_0x5177('0x4c')]({'where':{'id':_0x430e8e[_0x5177('0x4a')]['id']}})[_0x5177('0x2b')](handleEntityNotFound(_0x31a6e1,null))[_0x5177('0x2b')](removeEntity(_0x31a6e1,null))[_0x5177('0x49')](handleError(_0x31a6e1,null));};exports[_0x5177('0x4f')]=function(_0xb08267,_0x422d6c,_0x4c2068){var _0x59376b={};var _0x29ff0f={};var _0x5d5016;var _0x649c6f;return db['ZendeskAccount'][_0x5177('0x50')]({'where':{'id':_0xb08267[_0x5177('0x4a')]['id']}})[_0x5177('0x2b')](handleEntityNotFound(_0x422d6c,null))['then'](function(_0x5be224){if(_0x5be224){_0x5d5016=_0x5be224;_0x29ff0f[_0x5177('0x37')]=_[_0x5177('0x36')](db[_0x5177('0x51')][_0x5177('0x32')]);_0x29ff0f['query']=_['keys'](_0xb08267[_0x5177('0x35')]);_0x29ff0f[_0x5177('0x41')]=_[_0x5177('0x39')](_0x29ff0f[_0x5177('0x37')],_0x29ff0f['query']);_0x59376b[_0x5177('0x38')]=_[_0x5177('0x39')](_0x29ff0f[_0x5177('0x37')],qs['fields'](_0xb08267[_0x5177('0x35')][_0x5177('0x3a')]));_0x59376b[_0x5177('0x38')]=_0x59376b['attributes'][_0x5177('0x3b')]?_0x59376b['attributes']:_0x29ff0f[_0x5177('0x37')];_0x59376b[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0xb08267['query'][_0x5177('0x3f')]);_0x59376b[_0x5177('0x40')]=qs[_0x5177('0x41')](_[_0x5177('0x52')](_0xb08267[_0x5177('0x35')],_0x29ff0f[_0x5177('0x41')]));if(_0xb08267[_0x5177('0x35')][_0x5177('0x42')]){_0x59376b['where']=_['merge'](_0x59376b['where'],{'$or':_[_0x5177('0x30')](_0x59376b[_0x5177('0x38')],function(_0x35aa22){var _0x75cc0e={};_0x75cc0e[_0x35aa22]={'$like':'%'+_0xb08267[_0x5177('0x35')][_0x5177('0x42')]+'%'};return _0x75cc0e;})});}_0x59376b=_['merge']({},_0x59376b,_0xb08267['options']);return _0x5d5016[_0x5177('0x4f')](_0x59376b);}})[_0x5177('0x2b')](function(_0x1f294e){if(_0x1f294e){_0x649c6f=_0x1f294e[_0x5177('0x3b')];if(!_0xb08267[_0x5177('0x35')][_0x5177('0x3c')](_0x5177('0x3d'))){_0x59376b[_0x5177('0x22')]=qs[_0x5177('0x22')](_0xb08267['query'][_0x5177('0x22')]);_0x59376b[_0x5177('0x21')]=qs['offset'](_0xb08267[_0x5177('0x35')][_0x5177('0x21')]);}return _0x5d5016['getConfigurations'](_0x59376b);}})[_0x5177('0x2b')](function(_0x2f3344){if(_0x2f3344){return _0x2f3344?{'count':_0x649c6f,'rows':_0x2f3344}:null;}})[_0x5177('0x2b')](respondWithResult(_0x422d6c,null))['catch'](handleError(_0x422d6c,null));};exports[_0x5177('0x53')]=function(_0x400e27,_0x5f5bd5,_0x52a6c2){if(_0x400e27[_0x5177('0x4d')]['id']){delete _0x400e27['body']['id'];}return db[_0x5177('0x31')]['findOne']({'where':{'id':_0x400e27[_0x5177('0x4a')]['id']}})[_0x5177('0x2b')](handleEntityNotFound(_0x5f5bd5,null))['then'](function(_0x2af938){if(_0x2af938){_0x400e27[_0x5177('0x4d')][_0x5177('0x54')]=_0x2af938['id'];_0x400e27[_0x5177('0x4d')][_0x5177('0x55')]=integrations[_0x5177('0x56')](_0x400e27[_0x5177('0x4d')]['channel'],_0x400e27[_0x5177('0x4d')]['type']);_0x400e27['body'][_0x5177('0x57')]=integrations[_0x5177('0x58')](_0x400e27['body'][_0x5177('0x59')],_0x400e27[_0x5177('0x4d')][_0x5177('0x33')]);return db[_0x5177('0x51')][_0x5177('0x5a')](_0x400e27[_0x5177('0x4d')],{'include':[{'model':db[_0x5177('0x5b')],'as':_0x5177('0x55')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x5177('0x2b')](respondWithResult(_0x5f5bd5,null))[_0x5177('0x49')](handleError(_0x5f5bd5,null));};exports[_0x5177('0x5c')]=function(_0x2d24b3,_0x3de0b5,_0x3dd58f){var _0x4fc289='';return db[_0x5177('0x31')][_0x5177('0x50')]({'where':{'id':_0x2d24b3[_0x5177('0x4a')]['id']},'attributes':['id',_0x5177('0x5d'),'password',_0x5177('0x5e'),_0x5177('0x5f'),_0x5177('0x60')]})[_0x5177('0x2b')](handleEntityNotFound(_0x3de0b5,null))[_0x5177('0x2b')](function(_0x5130e6){if(_0x5130e6){_0x4fc289=_0x5130e6[_0x5177('0x60')];var _0x4aa8d3=_0x4fc289[_0x5177('0x61')](-0x1);if(_0x4aa8d3==='/'){_0x4fc289=_0x4fc289[_0x5177('0x62')](0x0,_0x4fc289['lastIndexOf'](_0x4aa8d3));}var _0x67d605={'method':_0x5177('0x63'),'uri':util[_0x5177('0x64')](_0x5177('0x65'),_0x4fc289,'ticket_fields'),'json':!![]};switch(_0x5130e6[_0x5177('0x5f')]){case _0x5177('0x66'):_0x67d605[_0x5177('0x67')]={'Authorization':util[_0x5177('0x64')]('Basic\x20%s',new Buffer(util[_0x5177('0x64')](_0x5177('0x68'),_0x5130e6[_0x5177('0x5d')],_0x5130e6['password']))['toString'](_0x5177('0x69')))};break;case _0x5177('0x5e'):_0x67d605[_0x5177('0x67')]={'Authorization':util[_0x5177('0x64')](_0x5177('0x6a'),new Buffer(util[_0x5177('0x64')](_0x5177('0x6b'),_0x5130e6[_0x5177('0x5d')],_0x5130e6[_0x5177('0x5e')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x5177('0x6c'))]('Unknown\x20authentication\x20type');}return rp(_0x67d605);}})[_0x5177('0x2b')](function(_0x3255a2){if(_0x3255a2){var _0x56c1aa=[_0x5177('0x6d'),_0x5177('0x6e'),'group',_0x5177('0x6f')];_[_0x5177('0x70')](_0x3255a2[_0x5177('0x71')],function(_0x4fce32){return _0x56c1aa[_0x5177('0x72')](_0x4fce32['type']);});return{'count':_0x3255a2[_0x5177('0x71')][_0x5177('0x3b')],'rows':_['map'](_0x3255a2[_0x5177('0x71')],function(_0x3f3031){return{'id':_0x3f3031['id'],'name':_0x3f3031['position']>0x7?_0x3f3031['title']:_0x3f3031[_0x5177('0x33')],'custom':_0x3f3031['position']>0x7?!![]:![],'options':_0x3f3031[_0x5177('0x73')]?_0x3f3031[_0x5177('0x73')]:_0x3f3031['custom_field_options']?_0x3f3031[_0x5177('0x74')]:[]};})};}})[_0x5177('0x2b')](respondWithResult(_0x3de0b5,null))[_0x5177('0x49')](function(_0x20ceb9){var _0x43a584=_0x2d24b3[_0x5177('0x35')][_0x5177('0x75')]?0x1f4:_0x20ceb9[_0x5177('0x76')]||0x1f4;logger['error'](_0x5177('0x77'),'getFields',_0x43a584,JSON[_0x5177('0x78')](_0x20ceb9));delete _0x20ceb9[_0x5177('0x2d')];if(_0x43a584===0x191){_0x43a584=0x190;}_0x3de0b5[_0x5177('0x1e')](_0x43a584)[_0x5177('0x2e')](_0x2d24b3['query'][_0x5177('0x75')]?{'message':_0x5177('0x79'),'statusCode':_0x20ceb9['statusCode']}:_0x20ceb9);});};
\ No newline at end of file
index c8dbcaa..8e1bf10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x195f=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts'];(function(_0x3e2760,_0x57f161){var _0x4713b8=function(_0x3fba27){while(--_0x3fba27){_0x3e2760['push'](_0x3e2760['shift']());}};_0x4713b8(++_0x57f161);}(_0x195f,0x113));var _0xf195=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x195f[_0x305b20];return _0x26d64a;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var logger=require('../../config/logger')(_0xf195('0x2'));var moment=require(_0xf195('0x3'));var BPromise=require('bluebird');var rp=require(_0xf195('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf195('0x5'));var config=require(_0xf195('0x6'));var attributes=require(_0xf195('0x7'));var integrations=require(_0xf195('0x8'));module[_0xf195('0x9')]=function(_0x7aeadd,_0x2770db){return _0x7aeadd['define']('ZendeskAccount',attributes,{'tableName':_0xf195('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xccad=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x927391,_0x357652){var _0x56586a=function(_0x595049){while(--_0x595049){_0x927391['push'](_0x927391['shift']());}};_0x56586a(++_0x357652);}(_0xccad,0x107));var _0xdcca=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0xccad[_0x289891];return _0x31cf2e;};'use strict';var _=require('lodash');var util=require(_0xdcca('0x0'));var logger=require(_0xdcca('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdcca('0x2'));var rp=require(_0xdcca('0x3'));var fs=require('fs');var path=require(_0xdcca('0x4'));var rimraf=require(_0xdcca('0x5'));var config=require(_0xdcca('0x6'));var attributes=require(_0xdcca('0x7'));var integrations=require(_0xdcca('0x8'));module['exports']=function(_0x5cb8f6,_0x5bc7f1){return _0x5cb8f6[_0xdcca('0x9')](_0xdcca('0xa'),attributes,{'tableName':_0xdcca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd28240..5574b65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0f=['map','model','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','attributes'];(function(_0x34a212,_0x98de95){var _0x4eb628=function(_0x4ee00f){while(--_0x4ee00f){_0x34a212['push'](_0x34a212['shift']());}};_0x4eb628(++_0x98de95);}(_0x8d0f,0x100));var _0xf8d0=function(_0x598b13,_0x1fe3b1){_0x598b13=_0x598b13-0x0;var _0x5aea0f=_0x8d0f[_0x598b13];return _0x5aea0f;};'use strict';var _=require(_0xf8d0('0x0'));var util=require(_0xf8d0('0x1'));var moment=require('moment');var BPromise=require(_0xf8d0('0x2'));var rs=require(_0xf8d0('0x3'));var fs=require('fs');var Redis=require(_0xf8d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8d0('0x5'));var logger=require('../../config/logger')(_0xf8d0('0x6'));var config=require(_0xf8d0('0x7'));var jayson=require(_0xf8d0('0x8'));var client=jayson[_0xf8d0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf4a2,_0x1b14d7,_0xbcc645){return new BPromise(function(_0x4a5879,_0xab6038){return client[_0xf8d0('0xa')](_0x1bf4a2,_0xbcc645)[_0xf8d0('0xb')](function(_0x389415){logger[_0xf8d0('0xc')](_0xf8d0('0xd'),_0x1b14d7,_0xf8d0('0xe'));logger[_0xf8d0('0xf')](_0xf8d0('0x10'),_0x1b14d7,'request\x20sent',JSON[_0xf8d0('0x11')](_0x389415));if(_0x389415[_0xf8d0('0x12')]){if(_0x389415[_0xf8d0('0x12')][_0xf8d0('0x13')]===0x1f4){logger[_0xf8d0('0x12')](_0xf8d0('0xd'),_0x1b14d7,_0x389415[_0xf8d0('0x12')][_0xf8d0('0x14')]);return _0xab6038(_0x389415[_0xf8d0('0x12')][_0xf8d0('0x14')]);}logger['error'](_0xf8d0('0xd'),_0x1b14d7,_0x389415[_0xf8d0('0x12')][_0xf8d0('0x14')]);return _0x4a5879(_0x389415['error']['message']);}else{logger[_0xf8d0('0xc')](_0xf8d0('0xd'),_0x1b14d7,_0xf8d0('0xe'));_0x4a5879(_0x389415[_0xf8d0('0x15')]['message']);}})[_0xf8d0('0x16')](function(_0x23a657){logger[_0xf8d0('0x12')](_0xf8d0('0xd'),_0x1b14d7,_0x23a657);_0xab6038(_0x23a657);});});}exports[_0xf8d0('0x17')]=function(_0x57dd3d){var _0x4afe33=this;return new Promise(function(_0x57f8d9,_0x5c5100){return db[_0xf8d0('0x18')][_0xf8d0('0x19')]({'raw':_0x57dd3d['options']?_0x57dd3d[_0xf8d0('0x1a')][_0xf8d0('0x1b')]===undefined?!![]:![]:!![],'where':_0x57dd3d[_0xf8d0('0x1a')]?_0x57dd3d[_0xf8d0('0x1a')][_0xf8d0('0x1c')]||null:null,'attributes':_0x57dd3d[_0xf8d0('0x1a')]?_0x57dd3d['options']['attributes']||null:null,'limit':_0x57dd3d[_0xf8d0('0x1a')]?_0x57dd3d[_0xf8d0('0x1a')][_0xf8d0('0x1d')]||null:null,'include':_0x57dd3d[_0xf8d0('0x1a')]?_0x57dd3d[_0xf8d0('0x1a')][_0xf8d0('0x1e')]?_['map'](_0x57dd3d[_0xf8d0('0x1a')][_0xf8d0('0x1e')],function(_0x3f9237){return{'model':db[_0x3f9237['model']],'as':_0x3f9237['as'],'attributes':_0x3f9237[_0xf8d0('0x1f')],'include':_0x3f9237[_0xf8d0('0x1e')]?_[_0xf8d0('0x20')](_0x3f9237['include'],function(_0x79b16f){return{'model':db[_0x79b16f[_0xf8d0('0x21')]],'as':_0x79b16f['as'],'attributes':_0x79b16f[_0xf8d0('0x1f')],'include':_0x79b16f[_0xf8d0('0x1e')]?_[_0xf8d0('0x20')](_0x79b16f[_0xf8d0('0x1e')],function(_0xd52004){return{'model':db[_0xd52004[_0xf8d0('0x21')]],'as':_0xd52004['as'],'attributes':_0xd52004[_0xf8d0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f3d59){logger[_0xf8d0('0xc')](_0xf8d0('0x17'),_0x57dd3d);logger[_0xf8d0('0xf')](_0xf8d0('0x17'),_0x57dd3d,JSON[_0xf8d0('0x11')](_0x3f3d59));_0x57f8d9(_0x3f3d59);})[_0xf8d0('0x16')](function(_0x1506a5){logger[_0xf8d0('0x12')](_0xf8d0('0x17'),_0x1506a5['message'],_0x57dd3d);_0x5c5100(_0x4afe33[_0xf8d0('0x12')](0x1f4,_0x1506a5['message']));});});};exports[_0xf8d0('0x22')]=function(_0x557782){var _0x4ccbac=this;return new Promise(function(_0x54e19d,_0xd2db92){return db[_0xf8d0('0x18')][_0xf8d0('0x23')]({'raw':_0x557782[_0xf8d0('0x1a')]?_0x557782[_0xf8d0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x557782[_0xf8d0('0x1a')]?_0x557782[_0xf8d0('0x1a')][_0xf8d0('0x1c')]||null:null,'attributes':_0x557782[_0xf8d0('0x1a')]?_0x557782[_0xf8d0('0x1a')][_0xf8d0('0x1f')]||null:null,'include':_0x557782[_0xf8d0('0x1a')]?_0x557782[_0xf8d0('0x1a')][_0xf8d0('0x1e')]?_[_0xf8d0('0x20')](_0x557782[_0xf8d0('0x1a')]['include'],function(_0x128591){return{'model':db[_0x128591[_0xf8d0('0x21')]],'as':_0x128591['as'],'attributes':_0x128591[_0xf8d0('0x1f')],'include':_0x128591[_0xf8d0('0x1e')]?_[_0xf8d0('0x20')](_0x128591['include'],function(_0x51f695){return{'model':db[_0x51f695['model']],'as':_0x51f695['as'],'attributes':_0x51f695[_0xf8d0('0x1f')],'include':_0x51f695['include']?_[_0xf8d0('0x20')](_0x51f695['include'],function(_0x20008){return{'model':db[_0x20008[_0xf8d0('0x21')]],'as':_0x20008['as'],'attributes':_0x20008[_0xf8d0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf8d0('0xb')](function(_0x23e46b){logger[_0xf8d0('0xc')](_0xf8d0('0x22'),_0x557782);logger['debug'](_0xf8d0('0x22'),_0x557782,JSON['stringify'](_0x23e46b));_0x54e19d(_0x23e46b);})[_0xf8d0('0x16')](function(_0x35a900){logger[_0xf8d0('0x12')]('ShowZendeskAccount',_0x35a900[_0xf8d0('0x14')],_0x557782);_0xd2db92(_0x4ccbac[_0xf8d0('0x12')](0x1f4,_0x35a900[_0xf8d0('0x14')]));});});};
\ No newline at end of file
+var _0x4aaf=['code','message','result','ZendeskAccount','findAll','options','where','include','map','model','attributes','then','GetZendeskAccount','catch','raw','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5306d3,_0x4f03b8){var _0x39801d=function(_0x659acc){while(--_0x659acc){_0x5306d3['push'](_0x5306d3['shift']());}};_0x39801d(++_0x4f03b8);}(_0x4aaf,0x1d0));var _0xf4aa=function(_0x2bd6b7,_0x40dc70){_0x2bd6b7=_0x2bd6b7-0x0;var _0x1e607a=_0x4aaf[_0x2bd6b7];return _0x1e607a;};'use strict';var _=require(_0xf4aa('0x0'));var util=require(_0xf4aa('0x1'));var moment=require('moment');var BPromise=require(_0xf4aa('0x2'));var rs=require(_0xf4aa('0x3'));var fs=require('fs');var Redis=require(_0xf4aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4aa('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf4aa('0x6'));var client=jayson[_0xf4aa('0x7')][_0xf4aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x66e190,_0xde1c81,_0x1ce7fb){return new BPromise(function(_0x20e069,_0x2c0018){return client[_0xf4aa('0x9')](_0x66e190,_0x1ce7fb)['then'](function(_0x2597e5){logger[_0xf4aa('0xa')](_0xf4aa('0xb'),_0xde1c81,_0xf4aa('0xc'));logger[_0xf4aa('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xde1c81,'request\x20sent',JSON[_0xf4aa('0xe')](_0x2597e5));if(_0x2597e5[_0xf4aa('0xf')]){if(_0x2597e5['error'][_0xf4aa('0x10')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0xde1c81,_0x2597e5[_0xf4aa('0xf')][_0xf4aa('0x11')]);return _0x2c0018(_0x2597e5[_0xf4aa('0xf')][_0xf4aa('0x11')]);}logger[_0xf4aa('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0xde1c81,_0x2597e5[_0xf4aa('0xf')][_0xf4aa('0x11')]);return _0x20e069(_0x2597e5[_0xf4aa('0xf')][_0xf4aa('0x11')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0xde1c81,_0xf4aa('0xc'));_0x20e069(_0x2597e5[_0xf4aa('0x12')]['message']);}})['catch'](function(_0x511e4e){logger[_0xf4aa('0xf')](_0xf4aa('0xb'),_0xde1c81,_0x511e4e);_0x2c0018(_0x511e4e);});});}exports['GetZendeskAccount']=function(_0x2e05e8){var _0x4d82dc=this;return new Promise(function(_0x3a5780,_0x14584e){return db[_0xf4aa('0x13')][_0xf4aa('0x14')]({'raw':_0x2e05e8['options']?_0x2e05e8[_0xf4aa('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e05e8['options']?_0x2e05e8[_0xf4aa('0x15')][_0xf4aa('0x16')]||null:null,'attributes':_0x2e05e8[_0xf4aa('0x15')]?_0x2e05e8['options']['attributes']||null:null,'limit':_0x2e05e8[_0xf4aa('0x15')]?_0x2e05e8['options']['limit']||null:null,'include':_0x2e05e8[_0xf4aa('0x15')]?_0x2e05e8['options'][_0xf4aa('0x17')]?_[_0xf4aa('0x18')](_0x2e05e8[_0xf4aa('0x15')][_0xf4aa('0x17')],function(_0x3133cf){return{'model':db[_0x3133cf['model']],'as':_0x3133cf['as'],'attributes':_0x3133cf['attributes'],'include':_0x3133cf[_0xf4aa('0x17')]?_[_0xf4aa('0x18')](_0x3133cf[_0xf4aa('0x17')],function(_0x2b203c){return{'model':db[_0x2b203c[_0xf4aa('0x19')]],'as':_0x2b203c['as'],'attributes':_0x2b203c[_0xf4aa('0x1a')],'include':_0x2b203c[_0xf4aa('0x17')]?_[_0xf4aa('0x18')](_0x2b203c[_0xf4aa('0x17')],function(_0x35c1ca){return{'model':db[_0x35c1ca[_0xf4aa('0x19')]],'as':_0x35c1ca['as'],'attributes':_0x35c1ca[_0xf4aa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf4aa('0x1b')](function(_0x3e19b0){logger['info'](_0xf4aa('0x1c'),_0x2e05e8);logger[_0xf4aa('0xd')](_0xf4aa('0x1c'),_0x2e05e8,JSON['stringify'](_0x3e19b0));_0x3a5780(_0x3e19b0);})[_0xf4aa('0x1d')](function(_0x29ae14){logger[_0xf4aa('0xf')](_0xf4aa('0x1c'),_0x29ae14[_0xf4aa('0x11')],_0x2e05e8);_0x14584e(_0x4d82dc['error'](0x1f4,_0x29ae14[_0xf4aa('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x4d3e6a){var _0x35e7b9=this;return new Promise(function(_0xdbf2bf,_0x40c82a){return db['ZendeskAccount']['find']({'raw':_0x4d3e6a[_0xf4aa('0x15')]?_0x4d3e6a[_0xf4aa('0x15')][_0xf4aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d3e6a[_0xf4aa('0x15')]?_0x4d3e6a['options'][_0xf4aa('0x16')]||null:null,'attributes':_0x4d3e6a['options']?_0x4d3e6a['options'][_0xf4aa('0x1a')]||null:null,'include':_0x4d3e6a[_0xf4aa('0x15')]?_0x4d3e6a[_0xf4aa('0x15')][_0xf4aa('0x17')]?_[_0xf4aa('0x18')](_0x4d3e6a[_0xf4aa('0x15')][_0xf4aa('0x17')],function(_0x150da1){return{'model':db[_0x150da1['model']],'as':_0x150da1['as'],'attributes':_0x150da1['attributes'],'include':_0x150da1['include']?_[_0xf4aa('0x18')](_0x150da1[_0xf4aa('0x17')],function(_0x3152b0){return{'model':db[_0x3152b0[_0xf4aa('0x19')]],'as':_0x3152b0['as'],'attributes':_0x3152b0[_0xf4aa('0x1a')],'include':_0x3152b0['include']?_[_0xf4aa('0x18')](_0x3152b0['include'],function(_0xb3554d){return{'model':db[_0xb3554d[_0xf4aa('0x19')]],'as':_0xb3554d['as'],'attributes':_0xb3554d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e722f){logger['info'](_0xf4aa('0x1f'),_0x4d3e6a);logger['debug']('ShowZendeskAccount',_0x4d3e6a,JSON[_0xf4aa('0xe')](_0x2e722f));_0xdbf2bf(_0x2e722f);})[_0xf4aa('0x1d')](function(_0x502dfa){logger[_0xf4aa('0xf')](_0xf4aa('0x1f'),_0x502dfa[_0xf4aa('0x11')],_0x4d3e6a);_0x40c82a(_0x35e7b9['error'](0x1f4,_0x502dfa[_0xf4aa('0x11')]));});});};
\ No newline at end of file
index 060970f..ec22a71 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','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x3a7bdf,_0x58bdd8){var _0x35a9a8=function(_0x21da98){while(--_0x21da98){_0x3a7bdf['push'](_0x3a7bdf['shift']());}};_0x35a9a8(++_0x58bdd8);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router;
\ No newline at end of file
+var _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0x4483,0x1a3));var _0x3448=function(_0x750062,_0x2b741e){_0x750062=_0x750062-0x0;var _0x2201af=_0x4483[_0x750062];return _0x2201af;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router;
\ No newline at end of file
index 5d10bd9..6e0cac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01ac=['exports','STRING','sequelize'];(function(_0x4d62e4,_0x35f575){var _0x2d0fb7=function(_0x736ad9){while(--_0x736ad9){_0x4d62e4['push'](_0x4d62e4['shift']());}};_0x2d0fb7(++_0x35f575);}(_0x01ac,0x101));var _0xc01a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x01ac[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xc01a('0x0'));module[_0xc01a('0x1')]={'name':{'type':Sequelize[_0xc01a('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3a02=['exports','STRING','sequelize'];(function(_0x37996a,_0x39ad77){var _0x237797=function(_0x31eff2){while(--_0x31eff2){_0x37996a['push'](_0x37996a['shift']());}};_0x237797(++_0x39ad77);}(_0x3a02,0x13a));var _0x23a0=function(_0x55c94a,_0x175001){_0x55c94a=_0x55c94a-0x0;var _0x51af47=_0x3a02[_0x55c94a];return _0x51af47;};'use strict';var Sequelize=require(_0x23a0('0x0'));module[_0x23a0('0x1')]={'name':{'type':Sequelize[_0x23a0('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0ef94e1..2e046ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23d3=['VIRTUAL','ZendeskConfiguration','includeAll','include','rows','catch','params','options','find','create','body','getFields','findOne','length','pick','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x349cbd,_0x516aad){var _0x2804b1=function(_0x452f6c){while(--_0x452f6c){_0x349cbd['push'](_0x349cbd['shift']());}};_0x2804b1(++_0x516aad);}(_0x23d3,0x6a));var _0x323d=function(_0x3b4ab5,_0x430de6){_0x3b4ab5=_0x3b4ab5-0x0;var _0x157bba=_0x23d3[_0x3b4ab5];return _0x157bba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x323d('0x0'));var zipdir=require(_0x323d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x323d('0x2'));var moment=require(_0x323d('0x3'));var BPromise=require(_0x323d('0x4'));var Mustache=require('mustache');var util=require(_0x323d('0x5'));var path=require(_0x323d('0x6'));var sox=require('sox');var csv=require(_0x323d('0x7'));var ejs=require(_0x323d('0x8'));var fs=require('fs');var fs_extra=require(_0x323d('0x9'));var _=require(_0x323d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x323d('0xb'));var deskjs=require(_0x323d('0xc'));var toCsv=require(_0x323d('0x7'));var querystring=require(_0x323d('0xd'));var Papa=require('papaparse');var Redis=require(_0x323d('0xe'));var authService=require(_0x323d('0xf'));var qs=require(_0x323d('0x10'));var as=require(_0x323d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x323d('0x12'))(_0x323d('0x13'));var utils=require(_0x323d('0x14'));var config=require(_0x323d('0x15'));var licenseUtil=require(_0x323d('0x16'));var db=require(_0x323d('0x17'))['db'];function respondWithStatusCode(_0x4a9188,_0x265279){_0x265279=_0x265279||0xcc;return function(_0x2ec97f){if(_0x2ec97f){return _0x4a9188['sendStatus'](_0x265279);}return _0x4a9188['status'](_0x265279)[_0x323d('0x18')]();};}function respondWithResult(_0x38868d,_0x4bdb97){_0x4bdb97=_0x4bdb97||0xc8;return function(_0xcb3fad){if(_0xcb3fad){return _0x38868d['status'](_0x4bdb97)['json'](_0xcb3fad);}};}function respondWithFilteredResult(_0x5dc9b9,_0x1cdf0f){return function(_0x201ca9){if(_0x201ca9){var _0x4d4168=typeof _0x1cdf0f[_0x323d('0x19')]===_0x323d('0x1a')&&typeof _0x1cdf0f[_0x323d('0x1b')]===_0x323d('0x1a');var _0x5831ea=_0x201ca9[_0x323d('0x1c')];var _0x116ac9=_0x4d4168?0x0:_0x1cdf0f[_0x323d('0x19')];var _0x275b96=_0x4d4168?_0x201ca9[_0x323d('0x1c')]:_0x1cdf0f['offset']+_0x1cdf0f[_0x323d('0x1b')];var _0x43bbda;if(_0x275b96>=_0x5831ea){_0x275b96=_0x5831ea;_0x43bbda=0xc8;}else{_0x43bbda=0xce;}_0x5dc9b9['status'](_0x43bbda);return _0x5dc9b9[_0x323d('0x1d')](_0x323d('0x1e'),_0x116ac9+'-'+_0x275b96+'/'+_0x5831ea)[_0x323d('0x1f')](_0x201ca9);}return null;};}function patchUpdates(_0x299013){return function(_0x40d5ed){try{jsonpatch[_0x323d('0x20')](_0x40d5ed,_0x299013,!![]);}catch(_0x59ba0c){return BPromise[_0x323d('0x21')](_0x59ba0c);}return _0x40d5ed[_0x323d('0x22')]();};}function saveUpdates(_0xc60804,_0x40fb20){return function(_0x599388){if(_0x599388){return _0x599388[_0x323d('0x23')](_0xc60804)[_0x323d('0x24')](function(_0xfdc764){return _0xfdc764;});}return null;};}function removeEntity(_0x2a8980,_0x148533){return function(_0x213bba){if(_0x213bba){return _0x213bba[_0x323d('0x25')]()['then'](function(){_0x2a8980[_0x323d('0x26')](0xcc)[_0x323d('0x18')]();});}};}function handleEntityNotFound(_0x22b903,_0x10277e){return function(_0x2e3154){if(!_0x2e3154){_0x22b903[_0x323d('0x27')](0x194);}return _0x2e3154;};}function handleError(_0x2754fe,_0x481717){_0x481717=_0x481717||0x1f4;return function(_0x26c86d){logger[_0x323d('0x28')](_0x26c86d[_0x323d('0x29')]);if(_0x26c86d[_0x323d('0x2a')]){delete _0x26c86d[_0x323d('0x2a')];}_0x2754fe[_0x323d('0x26')](_0x481717)[_0x323d('0x2b')](_0x26c86d);};}exports[_0x323d('0x2c')]=function(_0x35887a,_0x5477c6){var _0x25b0fd={},_0x19c36a={},_0x123791={'count':0x0,'rows':[]};var _0x42ef75=_[_0x323d('0x2d')](db['ZendeskConfiguration'][_0x323d('0x2e')],function(_0x701494){return{'name':_0x701494[_0x323d('0x2f')],'type':_0x701494[_0x323d('0x30')][_0x323d('0x31')]};});_0x19c36a[_0x323d('0x32')]=_[_0x323d('0x2d')](_0x42ef75,_0x323d('0x2a'));_0x19c36a['query']=_[_0x323d('0x33')](_0x35887a[_0x323d('0x34')]);_0x19c36a[_0x323d('0x35')]=_[_0x323d('0x36')](_0x19c36a[_0x323d('0x32')],_0x19c36a['query']);_0x25b0fd[_0x323d('0x37')]=_[_0x323d('0x36')](_0x19c36a[_0x323d('0x32')],qs[_0x323d('0x38')](_0x35887a[_0x323d('0x34')]['fields']));_0x25b0fd['attributes']=_0x25b0fd['attributes']['length']?_0x25b0fd[_0x323d('0x37')]:_0x19c36a[_0x323d('0x32')];if(!_0x35887a['query'][_0x323d('0x39')](_0x323d('0x3a'))){_0x25b0fd['limit']=qs[_0x323d('0x1b')](_0x35887a[_0x323d('0x34')][_0x323d('0x1b')]);_0x25b0fd[_0x323d('0x19')]=qs[_0x323d('0x19')](_0x35887a['query'][_0x323d('0x19')]);}_0x25b0fd[_0x323d('0x3b')]=qs['sort'](_0x35887a['query'][_0x323d('0x3c')]);_0x25b0fd[_0x323d('0x3d')]=qs[_0x323d('0x35')](_['pick'](_0x35887a[_0x323d('0x34')],_0x19c36a[_0x323d('0x35')]),_0x42ef75);if(_0x35887a[_0x323d('0x34')][_0x323d('0x3e')]){_0x25b0fd[_0x323d('0x3d')]=_[_0x323d('0x3f')](_0x25b0fd[_0x323d('0x3d')],{'$or':_['map'](_0x42ef75,function(_0x32151c){if(_0x32151c[_0x323d('0x30')]!==_0x323d('0x40')){var _0xa41b1e={};_0xa41b1e[_0x32151c[_0x323d('0x2a')]]={'$like':'%'+_0x35887a[_0x323d('0x34')][_0x323d('0x3e')]+'%'};return _0xa41b1e;}})});}_0x25b0fd=_[_0x323d('0x3f')]({},_0x25b0fd,_0x35887a['options']);var _0x2aebd7={'where':_0x25b0fd['where']};return db[_0x323d('0x41')][_0x323d('0x1c')](_0x2aebd7)[_0x323d('0x24')](function(_0x3247e1){_0x123791[_0x323d('0x1c')]=_0x3247e1;if(_0x35887a[_0x323d('0x34')][_0x323d('0x42')]){_0x25b0fd[_0x323d('0x43')]=[{'all':!![]}];}return db[_0x323d('0x41')]['findAll'](_0x25b0fd);})[_0x323d('0x24')](function(_0x3b8bb7){_0x123791[_0x323d('0x44')]=_0x3b8bb7;return _0x123791;})[_0x323d('0x24')](respondWithFilteredResult(_0x5477c6,_0x25b0fd))[_0x323d('0x45')](handleError(_0x5477c6,null));};exports['show']=function(_0x17e44b,_0x385b09){var _0x4da2b4={'raw':![],'where':{'id':_0x17e44b[_0x323d('0x46')]['id']}},_0x2b54e4={};_0x2b54e4['model']=_['keys'](db[_0x323d('0x41')][_0x323d('0x2e')]);_0x2b54e4[_0x323d('0x34')]=_[_0x323d('0x33')](_0x17e44b['query']);_0x2b54e4[_0x323d('0x35')]=_['intersection'](_0x2b54e4[_0x323d('0x32')],_0x2b54e4['query']);_0x4da2b4[_0x323d('0x37')]=_[_0x323d('0x36')](_0x2b54e4[_0x323d('0x32')],qs[_0x323d('0x38')](_0x17e44b['query'][_0x323d('0x38')]));_0x4da2b4['attributes']=_0x4da2b4[_0x323d('0x37')]['length']?_0x4da2b4['attributes']:_0x2b54e4['model'];if(_0x17e44b[_0x323d('0x34')][_0x323d('0x42')]){_0x4da2b4['include']=[{'all':!![]}];}_0x4da2b4=_[_0x323d('0x3f')]({},_0x4da2b4,_0x17e44b[_0x323d('0x47')]);return db[_0x323d('0x41')][_0x323d('0x48')](_0x4da2b4)[_0x323d('0x24')](handleEntityNotFound(_0x385b09,null))[_0x323d('0x24')](respondWithResult(_0x385b09,null))[_0x323d('0x45')](handleError(_0x385b09,null));};exports[_0x323d('0x49')]=function(_0x2b7f1f,_0xf63f30){return db[_0x323d('0x41')]['create'](_0x2b7f1f[_0x323d('0x4a')],{})['then'](respondWithResult(_0xf63f30,0xc9))['catch'](handleError(_0xf63f30,null));};exports[_0x323d('0x23')]=function(_0x12091a,_0x2f96ed){if(_0x12091a[_0x323d('0x4a')]['id']){delete _0x12091a[_0x323d('0x4a')]['id'];}return db[_0x323d('0x41')][_0x323d('0x48')]({'where':{'id':_0x12091a[_0x323d('0x46')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x2f96ed,null))[_0x323d('0x24')](saveUpdates(_0x12091a['body'],null))[_0x323d('0x24')](respondWithResult(_0x2f96ed,null))[_0x323d('0x45')](handleError(_0x2f96ed,null));};exports[_0x323d('0x25')]=function(_0x5dcba4,_0x5ad76d){return db[_0x323d('0x41')]['find']({'where':{'id':_0x5dcba4['params']['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x5ad76d,null))[_0x323d('0x24')](removeEntity(_0x5ad76d,null))[_0x323d('0x45')](handleError(_0x5ad76d,null));};exports[_0x323d('0x4b')]=function(_0x5ed5f1,_0x1feeb9,_0x4c287f){var _0x495420={};var _0x3537e7={};var _0x301d9d;var _0x3517dc;return db[_0x323d('0x41')][_0x323d('0x4c')]({'where':{'id':_0x5ed5f1[_0x323d('0x46')]['id']}})['then'](handleEntityNotFound(_0x1feeb9,null))['then'](function(_0x3170df){if(_0x3170df){_0x301d9d=_0x3170df;_0x3537e7['model']=_['keys'](db['ZendeskField']['rawAttributes']);_0x3537e7[_0x323d('0x34')]=_[_0x323d('0x33')](_0x5ed5f1[_0x323d('0x34')]);_0x3537e7[_0x323d('0x35')]=_[_0x323d('0x36')](_0x3537e7[_0x323d('0x32')],_0x3537e7['query']);_0x495420[_0x323d('0x37')]=_[_0x323d('0x36')](_0x3537e7[_0x323d('0x32')],qs[_0x323d('0x38')](_0x5ed5f1[_0x323d('0x34')][_0x323d('0x38')]));_0x495420[_0x323d('0x37')]=_0x495420[_0x323d('0x37')][_0x323d('0x4d')]?_0x495420[_0x323d('0x37')]:_0x3537e7[_0x323d('0x32')];_0x495420['order']=qs[_0x323d('0x3c')](_0x5ed5f1['query'][_0x323d('0x3c')]);_0x495420[_0x323d('0x3d')]=qs['filters'](_[_0x323d('0x4e')](_0x5ed5f1[_0x323d('0x34')],_0x3537e7['filters']));if(_0x5ed5f1[_0x323d('0x34')][_0x323d('0x3e')]){_0x495420[_0x323d('0x3d')]=_['merge'](_0x495420['where'],{'$or':_[_0x323d('0x2d')](_0x495420[_0x323d('0x37')],function(_0x5c081c){var _0x673157={};_0x673157[_0x5c081c]={'$like':'%'+_0x5ed5f1[_0x323d('0x34')]['filter']+'%'};return _0x673157;})});}_0x495420=_[_0x323d('0x3f')]({},_0x495420,_0x5ed5f1['options']);return _0x301d9d[_0x323d('0x4b')](_0x495420);}})[_0x323d('0x24')](function(_0x8384db){if(_0x8384db){_0x3517dc=_0x8384db['length'];if(!_0x5ed5f1[_0x323d('0x34')][_0x323d('0x39')]('nolimit')){_0x495420[_0x323d('0x1b')]=qs[_0x323d('0x1b')](_0x5ed5f1[_0x323d('0x34')][_0x323d('0x1b')]);_0x495420['offset']=qs[_0x323d('0x19')](_0x5ed5f1[_0x323d('0x34')][_0x323d('0x19')]);}return _0x301d9d['getFields'](_0x495420);}})[_0x323d('0x24')](function(_0x15a936){if(_0x15a936){return _0x15a936?{'count':_0x3517dc,'rows':_0x15a936}:null;}})[_0x323d('0x24')](respondWithResult(_0x1feeb9,null))[_0x323d('0x45')](handleError(_0x1feeb9,null));};exports['getSubjects']=function(_0x506567,_0x27947b,_0x5dd4e0){var _0x501053={};var _0x4a3e3a={};var _0x49fc57;var _0x3efabe;return db[_0x323d('0x41')][_0x323d('0x4c')]({'where':{'id':_0x506567[_0x323d('0x46')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x27947b,null))[_0x323d('0x24')](function(_0x2a213e){if(_0x2a213e){_0x49fc57=_0x2a213e;_0x4a3e3a[_0x323d('0x32')]=_[_0x323d('0x33')](db[_0x323d('0x4f')]['rawAttributes']);_0x4a3e3a[_0x323d('0x34')]=_[_0x323d('0x33')](_0x506567[_0x323d('0x34')]);_0x4a3e3a[_0x323d('0x35')]=_[_0x323d('0x36')](_0x4a3e3a['model'],_0x4a3e3a['query']);_0x501053['attributes']=_['intersection'](_0x4a3e3a['model'],qs[_0x323d('0x38')](_0x506567['query'][_0x323d('0x38')]));_0x501053[_0x323d('0x37')]=_0x501053['attributes']['length']?_0x501053[_0x323d('0x37')]:_0x4a3e3a[_0x323d('0x32')];_0x501053[_0x323d('0x3b')]=qs[_0x323d('0x3c')](_0x506567[_0x323d('0x34')][_0x323d('0x3c')]);_0x501053[_0x323d('0x3d')]=qs[_0x323d('0x35')](_[_0x323d('0x4e')](_0x506567['query'],_0x4a3e3a[_0x323d('0x35')]));if(_0x506567['query'][_0x323d('0x3e')]){_0x501053[_0x323d('0x3d')]=_[_0x323d('0x3f')](_0x501053[_0x323d('0x3d')],{'$or':_[_0x323d('0x2d')](_0x501053[_0x323d('0x37')],function(_0x504d17){var _0x4a0329={};_0x4a0329[_0x504d17]={'$like':'%'+_0x506567[_0x323d('0x34')][_0x323d('0x3e')]+'%'};return _0x4a0329;})});}_0x501053=_['merge']({},_0x501053,_0x506567['options']);return _0x49fc57[_0x323d('0x50')](_0x501053);}})[_0x323d('0x24')](function(_0x5d57a7){if(_0x5d57a7){_0x3efabe=_0x5d57a7[_0x323d('0x4d')];if(!_0x506567[_0x323d('0x34')][_0x323d('0x39')](_0x323d('0x3a'))){_0x501053[_0x323d('0x1b')]=qs['limit'](_0x506567[_0x323d('0x34')][_0x323d('0x1b')]);_0x501053['offset']=qs[_0x323d('0x19')](_0x506567[_0x323d('0x34')][_0x323d('0x19')]);}return _0x49fc57[_0x323d('0x50')](_0x501053);}})['then'](function(_0x5e7711){if(_0x5e7711){return _0x5e7711?{'count':_0x3efabe,'rows':_0x5e7711}:null;}})['then'](respondWithResult(_0x27947b,null))[_0x323d('0x45')](handleError(_0x27947b,null));};exports[_0x323d('0x51')]=function(_0x54bc74,_0x4709e9,_0x22b9a5){var _0x5571f7={};var _0x39fc74={};var _0x58196d;var _0x802678;return db[_0x323d('0x41')][_0x323d('0x4c')]({'where':{'id':_0x54bc74[_0x323d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4709e9,null))['then'](function(_0x1b4403){if(_0x1b4403){_0x58196d=_0x1b4403;_0x39fc74['model']=_[_0x323d('0x33')](db['ZendeskField'][_0x323d('0x2e')]);_0x39fc74['query']=_['keys'](_0x54bc74['query']);_0x39fc74[_0x323d('0x35')]=_[_0x323d('0x36')](_0x39fc74['model'],_0x39fc74[_0x323d('0x34')]);_0x5571f7['attributes']=_[_0x323d('0x36')](_0x39fc74[_0x323d('0x32')],qs[_0x323d('0x38')](_0x54bc74['query'][_0x323d('0x38')]));_0x5571f7[_0x323d('0x37')]=_0x5571f7[_0x323d('0x37')][_0x323d('0x4d')]?_0x5571f7[_0x323d('0x37')]:_0x39fc74[_0x323d('0x32')];_0x5571f7['order']=qs['sort'](_0x54bc74[_0x323d('0x34')][_0x323d('0x3c')]);_0x5571f7[_0x323d('0x3d')]=qs[_0x323d('0x35')](_[_0x323d('0x4e')](_0x54bc74[_0x323d('0x34')],_0x39fc74[_0x323d('0x35')]));if(_0x54bc74[_0x323d('0x34')]['filter']){_0x5571f7[_0x323d('0x3d')]=_['merge'](_0x5571f7['where'],{'$or':_[_0x323d('0x2d')](_0x5571f7[_0x323d('0x37')],function(_0x4a6fa6){var _0x43d22f={};_0x43d22f[_0x4a6fa6]={'$like':'%'+_0x54bc74[_0x323d('0x34')]['filter']+'%'};return _0x43d22f;})});}_0x5571f7=_[_0x323d('0x3f')]({},_0x5571f7,_0x54bc74[_0x323d('0x47')]);return _0x58196d[_0x323d('0x51')](_0x5571f7);}})['then'](function(_0x485aea){if(_0x485aea){_0x802678=_0x485aea['length'];if(!_0x54bc74['query']['hasOwnProperty'](_0x323d('0x3a'))){_0x5571f7[_0x323d('0x1b')]=qs['limit'](_0x54bc74[_0x323d('0x34')][_0x323d('0x1b')]);_0x5571f7[_0x323d('0x19')]=qs[_0x323d('0x19')](_0x54bc74[_0x323d('0x34')][_0x323d('0x19')]);}return _0x58196d['getDescriptions'](_0x5571f7);}})['then'](function(_0x1e010f){if(_0x1e010f){return _0x1e010f?{'count':_0x802678,'rows':_0x1e010f}:null;}})[_0x323d('0x24')](respondWithResult(_0x4709e9,null))[_0x323d('0x45')](handleError(_0x4709e9,null));};exports['getTags']=function(_0x185a49,_0x57e5c8,_0x5da4e9){var _0x2c5574={};var _0x4b0422={};var _0x10a013;var _0x492507;return db[_0x323d('0x41')][_0x323d('0x4c')]({'where':{'id':_0x185a49[_0x323d('0x46')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x57e5c8,null))[_0x323d('0x24')](function(_0x41e016){if(_0x41e016){_0x10a013=_0x41e016;_0x4b0422[_0x323d('0x32')]=_['keys'](db['Tag'][_0x323d('0x2e')]);_0x4b0422[_0x323d('0x34')]=_[_0x323d('0x33')](_0x185a49[_0x323d('0x34')]);_0x4b0422[_0x323d('0x35')]=_[_0x323d('0x36')](_0x4b0422[_0x323d('0x32')],_0x4b0422[_0x323d('0x34')]);_0x2c5574[_0x323d('0x37')]=_[_0x323d('0x36')](_0x4b0422[_0x323d('0x32')],qs[_0x323d('0x38')](_0x185a49[_0x323d('0x34')]['fields']));_0x2c5574[_0x323d('0x37')]=_0x2c5574['attributes'][_0x323d('0x4d')]?_0x2c5574[_0x323d('0x37')]:_0x4b0422[_0x323d('0x32')];_0x2c5574[_0x323d('0x3b')]=qs[_0x323d('0x3c')](_0x185a49[_0x323d('0x34')][_0x323d('0x3c')]);_0x2c5574[_0x323d('0x3d')]=qs['filters'](_['pick'](_0x185a49['query'],_0x4b0422[_0x323d('0x35')]));if(_0x185a49[_0x323d('0x34')][_0x323d('0x3e')]){_0x2c5574[_0x323d('0x3d')]=_[_0x323d('0x3f')](_0x2c5574['where'],{'$or':_[_0x323d('0x2d')](_0x2c5574[_0x323d('0x37')],function(_0x2b1a52){var _0x52c5bb={};_0x52c5bb[_0x2b1a52]={'$like':'%'+_0x185a49['query'][_0x323d('0x3e')]+'%'};return _0x52c5bb;})});}_0x2c5574=_[_0x323d('0x3f')]({},_0x2c5574,_0x185a49[_0x323d('0x47')]);return _0x10a013[_0x323d('0x52')](_0x2c5574);}})[_0x323d('0x24')](function(_0x15d87c){if(_0x15d87c){_0x492507=_0x15d87c[_0x323d('0x4d')];if(!_0x185a49[_0x323d('0x34')]['hasOwnProperty'](_0x323d('0x3a'))){_0x2c5574['limit']=qs[_0x323d('0x1b')](_0x185a49[_0x323d('0x34')]['limit']);_0x2c5574['offset']=qs['offset'](_0x185a49[_0x323d('0x34')]['offset']);}return _0x10a013[_0x323d('0x52')](_0x2c5574);}})[_0x323d('0x24')](function(_0x4d7c8a){if(_0x4d7c8a){return _0x4d7c8a?{'count':_0x492507,'rows':_0x4d7c8a}:null;}})['then'](respondWithResult(_0x57e5c8,null))[_0x323d('0x45')](handleError(_0x57e5c8,null));};exports[_0x323d('0x53')]=function(_0x31383c,_0x3757ab,_0x2bde3a){if(_0x31383c[_0x323d('0x4a')]['id']){delete _0x31383c[_0x323d('0x4a')]['id'];}return db[_0x323d('0x41')][_0x323d('0x4c')]({'where':{'id':_0x31383c[_0x323d('0x46')]['id']}})[_0x323d('0x24')](handleEntityNotFound(_0x3757ab,null))[_0x323d('0x24')](function(_0x1d3a05){if(_0x1d3a05){return _0x1d3a05['setTags'](_0x31383c[_0x323d('0x4a')][_0x323d('0x54')]||[]);}return null;})[_0x323d('0x24')](respondWithResult(_0x3757ab,null))[_0x323d('0x45')](handleError(_0x3757ab,null));};
\ No newline at end of file
+var _0xb53e=['getSubjects','sort','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','reject','then','error','name','send','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','destroy','params','getFields','findOne','ZendeskField','pick'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0xb53e,0x1a6));var _0xeb53=function(_0x43cf4e,_0x4100cf){_0x43cf4e=_0x43cf4e-0x0;var _0x537b07=_0xb53e[_0x43cf4e];return _0x537b07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb53('0x0'));var jsonpatch=require(_0xeb53('0x1'));var rp=require(_0xeb53('0x2'));var moment=require(_0xeb53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeb53('0x4'));var util=require(_0xeb53('0x5'));var path=require('path');var sox=require(_0xeb53('0x6'));var csv=require('to-csv');var ejs=require(_0xeb53('0x7'));var fs=require('fs');var fs_extra=require(_0xeb53('0x8'));var _=require(_0xeb53('0x9'));var squel=require(_0xeb53('0xa'));var crypto=require(_0xeb53('0xb'));var jsforce=require(_0xeb53('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeb53('0xd'));var querystring=require(_0xeb53('0xe'));var Papa=require(_0xeb53('0xf'));var Redis=require(_0xeb53('0x10'));var authService=require(_0xeb53('0x11'));var qs=require(_0xeb53('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb53('0x13'));var logger=require(_0xeb53('0x14'))(_0xeb53('0x15'));var utils=require(_0xeb53('0x16'));var config=require(_0xeb53('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb53('0x18'))['db'];function respondWithStatusCode(_0x27daf2,_0x551111){_0x551111=_0x551111||0xcc;return function(_0xa03ab6){if(_0xa03ab6){return _0x27daf2[_0xeb53('0x19')](_0x551111);}return _0x27daf2[_0xeb53('0x1a')](_0x551111)[_0xeb53('0x1b')]();};}function respondWithResult(_0x3a66c4,_0x57b3d0){_0x57b3d0=_0x57b3d0||0xc8;return function(_0x1eeced){if(_0x1eeced){return _0x3a66c4[_0xeb53('0x1a')](_0x57b3d0)[_0xeb53('0x1c')](_0x1eeced);}};}function respondWithFilteredResult(_0x1ebf3f,_0x22d959){return function(_0x469135){if(_0x469135){var _0x212e56=typeof _0x22d959['offset']===_0xeb53('0x1d')&&typeof _0x22d959['limit']===_0xeb53('0x1d');var _0x428866=_0x469135['count'];var _0x2edc23=_0x212e56?0x0:_0x22d959['offset'];var _0x569b3c=_0x212e56?_0x469135[_0xeb53('0x1e')]:_0x22d959[_0xeb53('0x1f')]+_0x22d959['limit'];var _0x33ee92;if(_0x569b3c>=_0x428866){_0x569b3c=_0x428866;_0x33ee92=0xc8;}else{_0x33ee92=0xce;}_0x1ebf3f[_0xeb53('0x1a')](_0x33ee92);return _0x1ebf3f[_0xeb53('0x20')]('Content-Range',_0x2edc23+'-'+_0x569b3c+'/'+_0x428866)[_0xeb53('0x1c')](_0x469135);}return null;};}function patchUpdates(_0x19c3fc){return function(_0x46bfd0){try{jsonpatch['apply'](_0x46bfd0,_0x19c3fc,!![]);}catch(_0x11e783){return BPromise[_0xeb53('0x21')](_0x11e783);}return _0x46bfd0['save']();};}function saveUpdates(_0xe7fb2d,_0x5afa55){return function(_0xc1f372){if(_0xc1f372){return _0xc1f372['update'](_0xe7fb2d)['then'](function(_0x1c5d45){return _0x1c5d45;});}return null;};}function removeEntity(_0x12a4c9,_0x1ca4a){return function(_0x5428fc){if(_0x5428fc){return _0x5428fc['destroy']()[_0xeb53('0x22')](function(){_0x12a4c9['status'](0xcc)[_0xeb53('0x1b')]();});}};}function handleEntityNotFound(_0x49d1fd,_0x2d0352){return function(_0x496b3c){if(!_0x496b3c){_0x49d1fd[_0xeb53('0x19')](0x194);}return _0x496b3c;};}function handleError(_0x608731,_0x53c684){_0x53c684=_0x53c684||0x1f4;return function(_0x4232b7){logger[_0xeb53('0x23')](_0x4232b7['stack']);if(_0x4232b7[_0xeb53('0x24')]){delete _0x4232b7[_0xeb53('0x24')];}_0x608731['status'](_0x53c684)[_0xeb53('0x25')](_0x4232b7);};}exports['index']=function(_0x136770,_0x30d2c4){var _0xbc8210={},_0x110dfb={},_0x43e9d7={'count':0x0,'rows':[]};var _0x34ff40=_[_0xeb53('0x26')](db[_0xeb53('0x27')][_0xeb53('0x28')],function(_0x3a4623){return{'name':_0x3a4623['fieldName'],'type':_0x3a4623[_0xeb53('0x29')][_0xeb53('0x2a')]};});_0x110dfb[_0xeb53('0x2b')]=_[_0xeb53('0x26')](_0x34ff40,'name');_0x110dfb[_0xeb53('0x2c')]=_[_0xeb53('0x2d')](_0x136770['query']);_0x110dfb['filters']=_[_0xeb53('0x2e')](_0x110dfb[_0xeb53('0x2b')],_0x110dfb[_0xeb53('0x2c')]);_0xbc8210[_0xeb53('0x2f')]=_[_0xeb53('0x2e')](_0x110dfb[_0xeb53('0x2b')],qs[_0xeb53('0x30')](_0x136770[_0xeb53('0x2c')][_0xeb53('0x30')]));_0xbc8210[_0xeb53('0x2f')]=_0xbc8210['attributes'][_0xeb53('0x31')]?_0xbc8210[_0xeb53('0x2f')]:_0x110dfb['model'];if(!_0x136770[_0xeb53('0x2c')][_0xeb53('0x32')](_0xeb53('0x33'))){_0xbc8210[_0xeb53('0x34')]=qs[_0xeb53('0x34')](_0x136770[_0xeb53('0x2c')][_0xeb53('0x34')]);_0xbc8210['offset']=qs['offset'](_0x136770[_0xeb53('0x2c')]['offset']);}_0xbc8210[_0xeb53('0x35')]=qs['sort'](_0x136770['query']['sort']);_0xbc8210[_0xeb53('0x36')]=qs['filters'](_['pick'](_0x136770['query'],_0x110dfb[_0xeb53('0x37')]),_0x34ff40);if(_0x136770[_0xeb53('0x2c')][_0xeb53('0x38')]){_0xbc8210[_0xeb53('0x36')]=_[_0xeb53('0x39')](_0xbc8210[_0xeb53('0x36')],{'$or':_[_0xeb53('0x26')](_0x34ff40,function(_0x1b38ac){if(_0x1b38ac['type']!==_0xeb53('0x3a')){var _0x1a9d3c={};_0x1a9d3c[_0x1b38ac['name']]={'$like':'%'+_0x136770[_0xeb53('0x2c')]['filter']+'%'};return _0x1a9d3c;}})});}_0xbc8210=_[_0xeb53('0x39')]({},_0xbc8210,_0x136770[_0xeb53('0x3b')]);var _0x4c9cb3={'where':_0xbc8210[_0xeb53('0x36')]};return db[_0xeb53('0x27')][_0xeb53('0x1e')](_0x4c9cb3)[_0xeb53('0x22')](function(_0x45d467){_0x43e9d7[_0xeb53('0x1e')]=_0x45d467;if(_0x136770['query'][_0xeb53('0x3c')]){_0xbc8210[_0xeb53('0x3d')]=[{'all':!![]}];}return db[_0xeb53('0x27')][_0xeb53('0x3e')](_0xbc8210);})[_0xeb53('0x22')](function(_0x2146a8){_0x43e9d7[_0xeb53('0x3f')]=_0x2146a8;return _0x43e9d7;})[_0xeb53('0x22')](respondWithFilteredResult(_0x30d2c4,_0xbc8210))[_0xeb53('0x40')](handleError(_0x30d2c4,null));};exports[_0xeb53('0x41')]=function(_0x4ad68b,_0x4229e3){var _0x5574c8={'raw':![],'where':{'id':_0x4ad68b['params']['id']}},_0x54c25c={};_0x54c25c[_0xeb53('0x2b')]=_['keys'](db[_0xeb53('0x27')][_0xeb53('0x28')]);_0x54c25c[_0xeb53('0x2c')]=_[_0xeb53('0x2d')](_0x4ad68b[_0xeb53('0x2c')]);_0x54c25c[_0xeb53('0x37')]=_[_0xeb53('0x2e')](_0x54c25c['model'],_0x54c25c['query']);_0x5574c8['attributes']=_[_0xeb53('0x2e')](_0x54c25c['model'],qs['fields'](_0x4ad68b['query'][_0xeb53('0x30')]));_0x5574c8[_0xeb53('0x2f')]=_0x5574c8['attributes'][_0xeb53('0x31')]?_0x5574c8['attributes']:_0x54c25c[_0xeb53('0x2b')];if(_0x4ad68b[_0xeb53('0x2c')][_0xeb53('0x3c')]){_0x5574c8[_0xeb53('0x3d')]=[{'all':!![]}];}_0x5574c8=_[_0xeb53('0x39')]({},_0x5574c8,_0x4ad68b[_0xeb53('0x3b')]);return db[_0xeb53('0x27')][_0xeb53('0x42')](_0x5574c8)[_0xeb53('0x22')](handleEntityNotFound(_0x4229e3,null))[_0xeb53('0x22')](respondWithResult(_0x4229e3,null))[_0xeb53('0x40')](handleError(_0x4229e3,null));};exports[_0xeb53('0x43')]=function(_0x5ae984,_0x51d410){return db[_0xeb53('0x27')][_0xeb53('0x43')](_0x5ae984[_0xeb53('0x44')],{})[_0xeb53('0x22')](respondWithResult(_0x51d410,0xc9))[_0xeb53('0x40')](handleError(_0x51d410,null));};exports[_0xeb53('0x45')]=function(_0x1455ef,_0x31c779){if(_0x1455ef['body']['id']){delete _0x1455ef[_0xeb53('0x44')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x1455ef['params']['id']}})[_0xeb53('0x22')](handleEntityNotFound(_0x31c779,null))[_0xeb53('0x22')](saveUpdates(_0x1455ef['body'],null))[_0xeb53('0x22')](respondWithResult(_0x31c779,null))['catch'](handleError(_0x31c779,null));};exports[_0xeb53('0x46')]=function(_0x43163c,_0x23f500){return db[_0xeb53('0x27')][_0xeb53('0x42')]({'where':{'id':_0x43163c[_0xeb53('0x47')]['id']}})[_0xeb53('0x22')](handleEntityNotFound(_0x23f500,null))[_0xeb53('0x22')](removeEntity(_0x23f500,null))[_0xeb53('0x40')](handleError(_0x23f500,null));};exports[_0xeb53('0x48')]=function(_0x2c4de1,_0x24bd6c,_0x522149){var _0x72fe45={};var _0x4ca915={};var _0x4d7175;var _0xd25984;return db[_0xeb53('0x27')][_0xeb53('0x49')]({'where':{'id':_0x2c4de1['params']['id']}})[_0xeb53('0x22')](handleEntityNotFound(_0x24bd6c,null))[_0xeb53('0x22')](function(_0x77900d){if(_0x77900d){_0x4d7175=_0x77900d;_0x4ca915[_0xeb53('0x2b')]=_['keys'](db[_0xeb53('0x4a')][_0xeb53('0x28')]);_0x4ca915[_0xeb53('0x2c')]=_['keys'](_0x2c4de1[_0xeb53('0x2c')]);_0x4ca915[_0xeb53('0x37')]=_[_0xeb53('0x2e')](_0x4ca915['model'],_0x4ca915['query']);_0x72fe45[_0xeb53('0x2f')]=_[_0xeb53('0x2e')](_0x4ca915['model'],qs[_0xeb53('0x30')](_0x2c4de1[_0xeb53('0x2c')]['fields']));_0x72fe45[_0xeb53('0x2f')]=_0x72fe45[_0xeb53('0x2f')][_0xeb53('0x31')]?_0x72fe45[_0xeb53('0x2f')]:_0x4ca915[_0xeb53('0x2b')];_0x72fe45[_0xeb53('0x35')]=qs['sort'](_0x2c4de1[_0xeb53('0x2c')]['sort']);_0x72fe45[_0xeb53('0x36')]=qs['filters'](_[_0xeb53('0x4b')](_0x2c4de1['query'],_0x4ca915[_0xeb53('0x37')]));if(_0x2c4de1[_0xeb53('0x2c')][_0xeb53('0x38')]){_0x72fe45['where']=_[_0xeb53('0x39')](_0x72fe45[_0xeb53('0x36')],{'$or':_['map'](_0x72fe45[_0xeb53('0x2f')],function(_0x33d69a){var _0x382932={};_0x382932[_0x33d69a]={'$like':'%'+_0x2c4de1[_0xeb53('0x2c')][_0xeb53('0x38')]+'%'};return _0x382932;})});}_0x72fe45=_[_0xeb53('0x39')]({},_0x72fe45,_0x2c4de1[_0xeb53('0x3b')]);return _0x4d7175[_0xeb53('0x48')](_0x72fe45);}})[_0xeb53('0x22')](function(_0x18e0a1){if(_0x18e0a1){_0xd25984=_0x18e0a1[_0xeb53('0x31')];if(!_0x2c4de1[_0xeb53('0x2c')]['hasOwnProperty']('nolimit')){_0x72fe45['limit']=qs[_0xeb53('0x34')](_0x2c4de1['query'][_0xeb53('0x34')]);_0x72fe45[_0xeb53('0x1f')]=qs[_0xeb53('0x1f')](_0x2c4de1[_0xeb53('0x2c')]['offset']);}return _0x4d7175['getFields'](_0x72fe45);}})[_0xeb53('0x22')](function(_0x3b6568){if(_0x3b6568){return _0x3b6568?{'count':_0xd25984,'rows':_0x3b6568}:null;}})[_0xeb53('0x22')](respondWithResult(_0x24bd6c,null))[_0xeb53('0x40')](handleError(_0x24bd6c,null));};exports[_0xeb53('0x4c')]=function(_0xfa60f6,_0x15b585,_0x41e343){var _0xa5b663={};var _0x37469f={};var _0xb6ced4;var _0x344f14;return db[_0xeb53('0x27')][_0xeb53('0x49')]({'where':{'id':_0xfa60f6[_0xeb53('0x47')]['id']}})[_0xeb53('0x22')](handleEntityNotFound(_0x15b585,null))[_0xeb53('0x22')](function(_0x51a0bc){if(_0x51a0bc){_0xb6ced4=_0x51a0bc;_0x37469f[_0xeb53('0x2b')]=_[_0xeb53('0x2d')](db[_0xeb53('0x4a')][_0xeb53('0x28')]);_0x37469f['query']=_['keys'](_0xfa60f6[_0xeb53('0x2c')]);_0x37469f[_0xeb53('0x37')]=_['intersection'](_0x37469f[_0xeb53('0x2b')],_0x37469f['query']);_0xa5b663[_0xeb53('0x2f')]=_[_0xeb53('0x2e')](_0x37469f[_0xeb53('0x2b')],qs[_0xeb53('0x30')](_0xfa60f6[_0xeb53('0x2c')]['fields']));_0xa5b663[_0xeb53('0x2f')]=_0xa5b663[_0xeb53('0x2f')][_0xeb53('0x31')]?_0xa5b663[_0xeb53('0x2f')]:_0x37469f[_0xeb53('0x2b')];_0xa5b663[_0xeb53('0x35')]=qs[_0xeb53('0x4d')](_0xfa60f6[_0xeb53('0x2c')]['sort']);_0xa5b663[_0xeb53('0x36')]=qs[_0xeb53('0x37')](_['pick'](_0xfa60f6[_0xeb53('0x2c')],_0x37469f['filters']));if(_0xfa60f6[_0xeb53('0x2c')][_0xeb53('0x38')]){_0xa5b663[_0xeb53('0x36')]=_[_0xeb53('0x39')](_0xa5b663['where'],{'$or':_['map'](_0xa5b663[_0xeb53('0x2f')],function(_0x5d5ac3){var _0x566531={};_0x566531[_0x5d5ac3]={'$like':'%'+_0xfa60f6['query'][_0xeb53('0x38')]+'%'};return _0x566531;})});}_0xa5b663=_[_0xeb53('0x39')]({},_0xa5b663,_0xfa60f6[_0xeb53('0x3b')]);return _0xb6ced4[_0xeb53('0x4c')](_0xa5b663);}})[_0xeb53('0x22')](function(_0x59a14b){if(_0x59a14b){_0x344f14=_0x59a14b['length'];if(!_0xfa60f6[_0xeb53('0x2c')][_0xeb53('0x32')](_0xeb53('0x33'))){_0xa5b663[_0xeb53('0x34')]=qs[_0xeb53('0x34')](_0xfa60f6[_0xeb53('0x2c')][_0xeb53('0x34')]);_0xa5b663[_0xeb53('0x1f')]=qs[_0xeb53('0x1f')](_0xfa60f6[_0xeb53('0x2c')][_0xeb53('0x1f')]);}return _0xb6ced4['getSubjects'](_0xa5b663);}})['then'](function(_0x422e4b){if(_0x422e4b){return _0x422e4b?{'count':_0x344f14,'rows':_0x422e4b}:null;}})[_0xeb53('0x22')](respondWithResult(_0x15b585,null))[_0xeb53('0x40')](handleError(_0x15b585,null));};exports[_0xeb53('0x4e')]=function(_0x3df0b5,_0x102b3f,_0x4d99b5){var _0x4dbce5={};var _0x14345e={};var _0x232f7b;var _0x1d3ea3;return db['ZendeskConfiguration'][_0xeb53('0x49')]({'where':{'id':_0x3df0b5[_0xeb53('0x47')]['id']}})['then'](handleEntityNotFound(_0x102b3f,null))[_0xeb53('0x22')](function(_0x591433){if(_0x591433){_0x232f7b=_0x591433;_0x14345e[_0xeb53('0x2b')]=_[_0xeb53('0x2d')](db['ZendeskField'][_0xeb53('0x28')]);_0x14345e[_0xeb53('0x2c')]=_[_0xeb53('0x2d')](_0x3df0b5[_0xeb53('0x2c')]);_0x14345e['filters']=_[_0xeb53('0x2e')](_0x14345e['model'],_0x14345e[_0xeb53('0x2c')]);_0x4dbce5['attributes']=_['intersection'](_0x14345e[_0xeb53('0x2b')],qs[_0xeb53('0x30')](_0x3df0b5[_0xeb53('0x2c')][_0xeb53('0x30')]));_0x4dbce5['attributes']=_0x4dbce5[_0xeb53('0x2f')][_0xeb53('0x31')]?_0x4dbce5[_0xeb53('0x2f')]:_0x14345e[_0xeb53('0x2b')];_0x4dbce5[_0xeb53('0x35')]=qs['sort'](_0x3df0b5[_0xeb53('0x2c')]['sort']);_0x4dbce5[_0xeb53('0x36')]=qs[_0xeb53('0x37')](_[_0xeb53('0x4b')](_0x3df0b5[_0xeb53('0x2c')],_0x14345e[_0xeb53('0x37')]));if(_0x3df0b5[_0xeb53('0x2c')][_0xeb53('0x38')]){_0x4dbce5[_0xeb53('0x36')]=_[_0xeb53('0x39')](_0x4dbce5[_0xeb53('0x36')],{'$or':_[_0xeb53('0x26')](_0x4dbce5[_0xeb53('0x2f')],function(_0x5b41ea){var _0x8e7059={};_0x8e7059[_0x5b41ea]={'$like':'%'+_0x3df0b5[_0xeb53('0x2c')][_0xeb53('0x38')]+'%'};return _0x8e7059;})});}_0x4dbce5=_[_0xeb53('0x39')]({},_0x4dbce5,_0x3df0b5[_0xeb53('0x3b')]);return _0x232f7b[_0xeb53('0x4e')](_0x4dbce5);}})[_0xeb53('0x22')](function(_0x2867b4){if(_0x2867b4){_0x1d3ea3=_0x2867b4[_0xeb53('0x31')];if(!_0x3df0b5[_0xeb53('0x2c')][_0xeb53('0x32')](_0xeb53('0x33'))){_0x4dbce5['limit']=qs[_0xeb53('0x34')](_0x3df0b5[_0xeb53('0x2c')][_0xeb53('0x34')]);_0x4dbce5[_0xeb53('0x1f')]=qs[_0xeb53('0x1f')](_0x3df0b5['query'][_0xeb53('0x1f')]);}return _0x232f7b[_0xeb53('0x4e')](_0x4dbce5);}})[_0xeb53('0x22')](function(_0x26981b){if(_0x26981b){return _0x26981b?{'count':_0x1d3ea3,'rows':_0x26981b}:null;}})[_0xeb53('0x22')](respondWithResult(_0x102b3f,null))[_0xeb53('0x40')](handleError(_0x102b3f,null));};exports[_0xeb53('0x4f')]=function(_0x5a0b3e,_0xe1a3bd,_0x34282b){var _0x24aec8={};var _0x3fffde={};var _0x5eec1e;var _0x31fbb2;return db[_0xeb53('0x27')][_0xeb53('0x49')]({'where':{'id':_0x5a0b3e[_0xeb53('0x47')]['id']}})[_0xeb53('0x22')](handleEntityNotFound(_0xe1a3bd,null))[_0xeb53('0x22')](function(_0x430c20){if(_0x430c20){_0x5eec1e=_0x430c20;_0x3fffde['model']=_[_0xeb53('0x2d')](db[_0xeb53('0x50')][_0xeb53('0x28')]);_0x3fffde[_0xeb53('0x2c')]=_['keys'](_0x5a0b3e[_0xeb53('0x2c')]);_0x3fffde[_0xeb53('0x37')]=_[_0xeb53('0x2e')](_0x3fffde['model'],_0x3fffde[_0xeb53('0x2c')]);_0x24aec8['attributes']=_[_0xeb53('0x2e')](_0x3fffde[_0xeb53('0x2b')],qs[_0xeb53('0x30')](_0x5a0b3e[_0xeb53('0x2c')][_0xeb53('0x30')]));_0x24aec8[_0xeb53('0x2f')]=_0x24aec8[_0xeb53('0x2f')][_0xeb53('0x31')]?_0x24aec8['attributes']:_0x3fffde[_0xeb53('0x2b')];_0x24aec8[_0xeb53('0x35')]=qs[_0xeb53('0x4d')](_0x5a0b3e['query']['sort']);_0x24aec8['where']=qs['filters'](_[_0xeb53('0x4b')](_0x5a0b3e[_0xeb53('0x2c')],_0x3fffde[_0xeb53('0x37')]));if(_0x5a0b3e[_0xeb53('0x2c')][_0xeb53('0x38')]){_0x24aec8[_0xeb53('0x36')]=_[_0xeb53('0x39')](_0x24aec8['where'],{'$or':_[_0xeb53('0x26')](_0x24aec8['attributes'],function(_0x4a2362){var _0x2ffe4b={};_0x2ffe4b[_0x4a2362]={'$like':'%'+_0x5a0b3e[_0xeb53('0x2c')][_0xeb53('0x38')]+'%'};return _0x2ffe4b;})});}_0x24aec8=_[_0xeb53('0x39')]({},_0x24aec8,_0x5a0b3e[_0xeb53('0x3b')]);return _0x5eec1e[_0xeb53('0x4f')](_0x24aec8);}})[_0xeb53('0x22')](function(_0x3de7d5){if(_0x3de7d5){_0x31fbb2=_0x3de7d5[_0xeb53('0x31')];if(!_0x5a0b3e['query'][_0xeb53('0x32')](_0xeb53('0x33'))){_0x24aec8[_0xeb53('0x34')]=qs[_0xeb53('0x34')](_0x5a0b3e[_0xeb53('0x2c')]['limit']);_0x24aec8[_0xeb53('0x1f')]=qs[_0xeb53('0x1f')](_0x5a0b3e['query']['offset']);}return _0x5eec1e[_0xeb53('0x4f')](_0x24aec8);}})[_0xeb53('0x22')](function(_0x5e81f3){if(_0x5e81f3){return _0x5e81f3?{'count':_0x31fbb2,'rows':_0x5e81f3}:null;}})[_0xeb53('0x22')](respondWithResult(_0xe1a3bd,null))[_0xeb53('0x40')](handleError(_0xe1a3bd,null));};exports[_0xeb53('0x51')]=function(_0x489c91,_0x5de051,_0x51494e){if(_0x489c91[_0xeb53('0x44')]['id']){delete _0x489c91[_0xeb53('0x44')]['id'];}return db[_0xeb53('0x27')][_0xeb53('0x49')]({'where':{'id':_0x489c91[_0xeb53('0x47')]['id']}})[_0xeb53('0x22')](handleEntityNotFound(_0x5de051,null))[_0xeb53('0x22')](function(_0x2443ba){if(_0x2443ba){return _0x2443ba[_0xeb53('0x51')](_0x489c91[_0xeb53('0x44')][_0xeb53('0x52')]||[]);}return null;})[_0xeb53('0x22')](respondWithResult(_0x5de051,null))[_0xeb53('0x40')](handleError(_0x5de051,null));};
\ No newline at end of file
index d735c6d..cee3f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x888a97,_0x1e5344){var _0x3c17c9=function(_0xacd36b){while(--_0xacd36b){_0x888a97['push'](_0x888a97['shift']());}};_0x3c17c9(++_0x1e5344);}(_0x93e9,0xcc));var _0x993e=function(_0x3e52e0,_0x3cc5d5){_0x3e52e0=_0x3e52e0-0x0;var _0x51da61=_0x93e9[_0x3e52e0];return _0x51da61;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7916=['../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','ZendeskConfiguration','lodash'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x7916,0x128));var _0x6791=function(_0x531e9e,_0x9abb2b){_0x531e9e=_0x531e9e-0x0;var _0x400930=_0x7916[_0x531e9e];return _0x400930;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var logger=require(_0x6791('0x1'))(_0x6791('0x2'));var moment=require('moment');var BPromise=require(_0x6791('0x3'));var rp=require(_0x6791('0x4'));var fs=require('fs');var path=require(_0x6791('0x5'));var rimraf=require(_0x6791('0x6'));var config=require('../../config/environment');var attributes=require(_0x6791('0x7'));module['exports']=function(_0x3ca328,_0x3277a8){return _0x3ca328['define'](_0x6791('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c7006a..82cecd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb625=['request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb625,0x67));var _0x5b62=function(_0x5998c7,_0x514254){_0x5998c7=_0x5998c7-0x0;var _0x321421=_0xb625[_0x5998c7];return _0x321421;};'use strict';var _=require(_0x5b62('0x0'));var util=require(_0x5b62('0x1'));var moment=require(_0x5b62('0x2'));var BPromise=require(_0x5b62('0x3'));var rs=require(_0x5b62('0x4'));var fs=require('fs');var Redis=require(_0x5b62('0x5'));var db=require(_0x5b62('0x6'))['db'];var utils=require(_0x5b62('0x7'));var logger=require(_0x5b62('0x8'))(_0x5b62('0x9'));var config=require(_0x5b62('0xa'));var jayson=require(_0x5b62('0xb'));var client=jayson[_0x5b62('0xc')][_0x5b62('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x49c3d6,_0x1bd13a,_0x454cf8){return new BPromise(function(_0x8fdbc0,_0x1f369a){return client['request'](_0x49c3d6,_0x454cf8)[_0x5b62('0xe')](function(_0x484347){logger[_0x5b62('0xf')](_0x5b62('0x10'),_0x1bd13a,_0x5b62('0x11'));logger[_0x5b62('0x12')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1bd13a,_0x5b62('0x11'),JSON[_0x5b62('0x13')](_0x484347));if(_0x484347['error']){if(_0x484347[_0x5b62('0x14')][_0x5b62('0x15')]===0x1f4){logger[_0x5b62('0x14')](_0x5b62('0x10'),_0x1bd13a,_0x484347['error'][_0x5b62('0x16')]);return _0x1f369a(_0x484347[_0x5b62('0x14')][_0x5b62('0x16')]);}logger[_0x5b62('0x14')](_0x5b62('0x10'),_0x1bd13a,_0x484347[_0x5b62('0x14')][_0x5b62('0x16')]);return _0x8fdbc0(_0x484347[_0x5b62('0x14')]['message']);}else{logger[_0x5b62('0xf')](_0x5b62('0x10'),_0x1bd13a,'request\x20sent');_0x8fdbc0(_0x484347['result'][_0x5b62('0x16')]);}})[_0x5b62('0x17')](function(_0x16eaac){logger[_0x5b62('0x14')](_0x5b62('0x10'),_0x1bd13a,_0x16eaac);_0x1f369a(_0x16eaac);});});}
\ No newline at end of file
+var _0x4716=['debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5e4e4f,_0x3de352){var _0x3fad97=function(_0x352e88){while(--_0x352e88){_0x5e4e4f['push'](_0x5e4e4f['shift']());}};_0x3fad97(++_0x3de352);}(_0x4716,0x131));var _0x6471=function(_0x5ea60d,_0xf1b6f3){_0x5ea60d=_0x5ea60d-0x0;var _0x1d14eb=_0x4716[_0x5ea60d];return _0x1d14eb;};'use strict';var _=require(_0x6471('0x0'));var util=require(_0x6471('0x1'));var moment=require('moment');var BPromise=require(_0x6471('0x2'));var rs=require(_0x6471('0x3'));var fs=require('fs');var Redis=require(_0x6471('0x4'));var db=require(_0x6471('0x5'))['db'];var utils=require(_0x6471('0x6'));var logger=require('../../config/logger')(_0x6471('0x7'));var config=require(_0x6471('0x8'));var jayson=require(_0x6471('0x9'));var client=jayson[_0x6471('0xa')][_0x6471('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45548c,_0x2d2a6b,_0x1863ae){return new BPromise(function(_0x4f19a6,_0x575171){return client[_0x6471('0xc')](_0x45548c,_0x1863ae)[_0x6471('0xd')](function(_0x7f161d){logger[_0x6471('0xe')](_0x6471('0xf'),_0x2d2a6b,_0x6471('0x10'));logger[_0x6471('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2d2a6b,_0x6471('0x10'),JSON[_0x6471('0x12')](_0x7f161d));if(_0x7f161d[_0x6471('0x13')]){if(_0x7f161d[_0x6471('0x13')][_0x6471('0x14')]===0x1f4){logger[_0x6471('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2d2a6b,_0x7f161d[_0x6471('0x13')][_0x6471('0x15')]);return _0x575171(_0x7f161d[_0x6471('0x13')][_0x6471('0x15')]);}logger[_0x6471('0x13')](_0x6471('0xf'),_0x2d2a6b,_0x7f161d[_0x6471('0x13')][_0x6471('0x15')]);return _0x4f19a6(_0x7f161d[_0x6471('0x13')][_0x6471('0x15')]);}else{logger[_0x6471('0xe')](_0x6471('0xf'),_0x2d2a6b,_0x6471('0x10'));_0x4f19a6(_0x7f161d[_0x6471('0x16')][_0x6471('0x15')]);}})['catch'](function(_0x260df8){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2d2a6b,_0x260df8);_0x575171(_0x260df8);});});}
\ No newline at end of file
index c496eee..97e0df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fab=['path','connect-timeout','express','fs-extra','../../config/environment','get','index','isAuthenticated','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7fab,0x1da));var _0xb7fa=function(_0xcd2975,_0x27d718){_0xcd2975=_0xcd2975-0x0;var _0x284074=_0x7fab[_0xcd2975];return _0x284074;};'use strict';var multer=require(_0xb7fa('0x0'));var util=require(_0xb7fa('0x1'));var path=require(_0xb7fa('0x2'));var timeout=require(_0xb7fa('0x3'));var express=require(_0xb7fa('0x4'));var router=express['Router']();var fs_extra=require(_0xb7fa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7fa('0x6'));var controller=require('./intZendeskField.controller');router[_0xb7fa('0x7')]('/',auth['isAuthenticated'](),controller[_0xb7fa('0x8')]);router['get']('/:id',auth[_0xb7fa('0x9')](),controller['show']);router[_0xb7fa('0xa')]('/',auth[_0xb7fa('0x9')](),controller[_0xb7fa('0xb')]);router[_0xb7fa('0xc')](_0xb7fa('0xd'),auth[_0xb7fa('0x9')](),controller[_0xb7fa('0xe')]);router['delete'](_0xb7fa('0xd'),auth[_0xb7fa('0x9')](),controller[_0xb7fa('0xf')]);module[_0xb7fa('0x10')]=router;
\ No newline at end of file
+var _0xea8c=['./intZendeskField.controller','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xea8c,0x1d5));var _0xcea8=function(_0x507fee,_0x520fe7){_0x507fee=_0x507fee-0x0;var _0x31c14b=_0xea8c[_0x507fee];return _0x31c14b;};'use strict';var multer=require(_0xcea8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcea8('0x1'));var express=require(_0xcea8('0x2'));var router=express['Router']();var fs_extra=require(_0xcea8('0x3'));var auth=require(_0xcea8('0x4'));var interaction=require(_0xcea8('0x5'));var config=require(_0xcea8('0x6'));var controller=require(_0xcea8('0x7'));router['get']('/',auth[_0xcea8('0x8')](),controller['index']);router['get'](_0xcea8('0x9'),auth[_0xcea8('0x8')](),controller['show']);router[_0xcea8('0xa')]('/',auth[_0xcea8('0x8')](),controller[_0xcea8('0xb')]);router[_0xcea8('0xc')](_0xcea8('0x9'),auth['isAuthenticated'](),controller[_0xcea8('0xd')]);router[_0xcea8('0xe')](_0xcea8('0x9'),auth['isAuthenticated'](),controller[_0xcea8('0xf')]);module[_0xcea8('0x10')]=router;
\ No newline at end of file
index 2edf43e..581f221 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa786=['string','customVariable','STRING','ENUM','BOOLEAN','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa786,0x1cd));var _0x6a78=function(_0x50fe9d,_0x152cf8){_0x50fe9d=_0x50fe9d-0x0;var _0x23f415=_0xa786[_0x50fe9d];return _0x23f415;};'use strict';var Sequelize=require('sequelize');module[_0x6a78('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6a78('0x1'),'variable',_0x6a78('0x2'),'keyValue','picklist'),'defaultValue':_0x6a78('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6a78('0x3')]},'keyType':{'type':Sequelize[_0x6a78('0x4')](_0x6a78('0x1'),'variable',_0x6a78('0x2'))},'keyContent':{'type':Sequelize[_0x6a78('0x3')]},'idField':{'type':Sequelize[_0x6a78('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6a78('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a78('0x3')]}};
\ No newline at end of file
+var _0x8e36=['customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x5d0818,_0x2125d3){var _0x3229b7=function(_0x52549b){while(--_0x52549b){_0x5d0818['push'](_0x5d0818['shift']());}};_0x3229b7(++_0x2125d3);}(_0x8e36,0xe4));var _0x68e3=function(_0x1cf203,_0x3c21d0){_0x1cf203=_0x1cf203-0x0;var _0xc8e1dd=_0x8e36[_0x1cf203];return _0xc8e1dd;};'use strict';var Sequelize=require(_0x68e3('0x0'));module['exports']={'type':{'type':Sequelize[_0x68e3('0x1')](_0x68e3('0x2'),_0x68e3('0x3'),_0x68e3('0x4'),'keyValue',_0x68e3('0x5')),'defaultValue':_0x68e3('0x2')},'content':{'type':Sequelize[_0x68e3('0x6')]},'key':{'type':Sequelize[_0x68e3('0x6')]},'keyType':{'type':Sequelize[_0x68e3('0x1')](_0x68e3('0x2'),_0x68e3('0x3'),_0x68e3('0x4'))},'keyContent':{'type':Sequelize[_0x68e3('0x6')]},'idField':{'type':Sequelize[_0x68e3('0x6')]},'nameField':{'type':Sequelize[_0x68e3('0x6')]},'customField':{'type':Sequelize[_0x68e3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6c968e7..19d978e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2812=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x8d23db,_0x3e948f){var _0x43c60f=function(_0x569f94){while(--_0x569f94){_0x8d23db['push'](_0x8d23db['shift']());}};_0x43c60f(++_0x3e948f);}(_0x2812,0xda));var _0x2281=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x2812[_0x43a1b8];return _0x324ecc;};'use strict';var emlformat=require(_0x2281('0x0'));var rimraf=require(_0x2281('0x1'));var zipdir=require(_0x2281('0x2'));var jsonpatch=require(_0x2281('0x3'));var rp=require(_0x2281('0x4'));var moment=require(_0x2281('0x5'));var BPromise=require(_0x2281('0x6'));var Mustache=require('mustache');var util=require(_0x2281('0x7'));var path=require(_0x2281('0x8'));var sox=require('sox');var csv=require(_0x2281('0x9'));var ejs=require(_0x2281('0xa'));var fs=require('fs');var fs_extra=require(_0x2281('0xb'));var _=require(_0x2281('0xc'));var squel=require(_0x2281('0xd'));var crypto=require(_0x2281('0xe'));var jsforce=require(_0x2281('0xf'));var deskjs=require(_0x2281('0x10'));var toCsv=require(_0x2281('0x9'));var querystring=require('querystring');var Papa=require(_0x2281('0x11'));var Redis=require(_0x2281('0x12'));var authService=require(_0x2281('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2281('0x14'));var logger=require('../../config/logger')(_0x2281('0x15'));var utils=require(_0x2281('0x16'));var config=require(_0x2281('0x17'));var licenseUtil=require(_0x2281('0x18'));var db=require(_0x2281('0x19'))['db'];function respondWithStatusCode(_0x10444a,_0x26ac90){_0x26ac90=_0x26ac90||0xcc;return function(_0x22fea6){if(_0x22fea6){return _0x10444a[_0x2281('0x1a')](_0x26ac90);}return _0x10444a[_0x2281('0x1b')](_0x26ac90)['end']();};}function respondWithResult(_0x3d332b,_0x5747b2){_0x5747b2=_0x5747b2||0xc8;return function(_0x31ff52){if(_0x31ff52){return _0x3d332b[_0x2281('0x1b')](_0x5747b2)[_0x2281('0x1c')](_0x31ff52);}};}function respondWithFilteredResult(_0x11b0b1,_0x242c75){return function(_0x28d778){if(_0x28d778){var _0x5543a6=typeof _0x242c75[_0x2281('0x1d')]===_0x2281('0x1e')&&typeof _0x242c75[_0x2281('0x1f')]===_0x2281('0x1e');var _0xf68cba=_0x28d778[_0x2281('0x20')];var _0x53bebe=_0x5543a6?0x0:_0x242c75[_0x2281('0x1d')];var _0x3aa1db=_0x5543a6?_0x28d778[_0x2281('0x20')]:_0x242c75[_0x2281('0x1d')]+_0x242c75[_0x2281('0x1f')];var _0x4991ac;if(_0x3aa1db>=_0xf68cba){_0x3aa1db=_0xf68cba;_0x4991ac=0xc8;}else{_0x4991ac=0xce;}_0x11b0b1[_0x2281('0x1b')](_0x4991ac);return _0x11b0b1[_0x2281('0x21')](_0x2281('0x22'),_0x53bebe+'-'+_0x3aa1db+'/'+_0xf68cba)[_0x2281('0x1c')](_0x28d778);}return null;};}function patchUpdates(_0x3ac9e7){return function(_0x4304be){try{jsonpatch[_0x2281('0x23')](_0x4304be,_0x3ac9e7,!![]);}catch(_0x43661e){return BPromise[_0x2281('0x24')](_0x43661e);}return _0x4304be[_0x2281('0x25')]();};}function saveUpdates(_0x20cfd7,_0x594493){return function(_0x2e2123){if(_0x2e2123){return _0x2e2123[_0x2281('0x26')](_0x20cfd7)['then'](function(_0x16de9b){return _0x16de9b;});}return null;};}function removeEntity(_0x5acee7,_0xe1b709){return function(_0x17343b){if(_0x17343b){return _0x17343b[_0x2281('0x27')]()['then'](function(){_0x5acee7[_0x2281('0x1b')](0xcc)[_0x2281('0x28')]();});}};}function handleEntityNotFound(_0x5b1d01,_0x2c3621){return function(_0x4b884d){if(!_0x4b884d){_0x5b1d01['sendStatus'](0x194);}return _0x4b884d;};}function handleError(_0x239f1f,_0x563b61){_0x563b61=_0x563b61||0x1f4;return function(_0x78386e){logger['error'](_0x78386e[_0x2281('0x29')]);if(_0x78386e[_0x2281('0x2a')]){delete _0x78386e[_0x2281('0x2a')];}_0x239f1f['status'](_0x563b61)[_0x2281('0x2b')](_0x78386e);};}exports['index']=function(_0x2609f0,_0x4a7370){var _0x211f3e={},_0x521bc2={},_0x25d033={'count':0x0,'rows':[]};var _0x36ca2b=_[_0x2281('0x2c')](db[_0x2281('0x2d')][_0x2281('0x2e')],function(_0x35fd09){return{'name':_0x35fd09[_0x2281('0x2f')],'type':_0x35fd09[_0x2281('0x30')][_0x2281('0x31')]};});_0x521bc2[_0x2281('0x32')]=_['map'](_0x36ca2b,_0x2281('0x2a'));_0x521bc2['query']=_[_0x2281('0x33')](_0x2609f0[_0x2281('0x34')]);_0x521bc2[_0x2281('0x35')]=_['intersection'](_0x521bc2[_0x2281('0x32')],_0x521bc2[_0x2281('0x34')]);_0x211f3e[_0x2281('0x36')]=_[_0x2281('0x37')](_0x521bc2[_0x2281('0x32')],qs['fields'](_0x2609f0[_0x2281('0x34')][_0x2281('0x38')]));_0x211f3e[_0x2281('0x36')]=_0x211f3e[_0x2281('0x36')][_0x2281('0x39')]?_0x211f3e[_0x2281('0x36')]:_0x521bc2[_0x2281('0x32')];if(!_0x2609f0[_0x2281('0x34')][_0x2281('0x3a')](_0x2281('0x3b'))){_0x211f3e[_0x2281('0x1f')]=qs[_0x2281('0x1f')](_0x2609f0[_0x2281('0x34')][_0x2281('0x1f')]);_0x211f3e[_0x2281('0x1d')]=qs[_0x2281('0x1d')](_0x2609f0[_0x2281('0x34')][_0x2281('0x1d')]);}_0x211f3e[_0x2281('0x3c')]=qs[_0x2281('0x3d')](_0x2609f0['query'][_0x2281('0x3d')]);_0x211f3e[_0x2281('0x3e')]=qs[_0x2281('0x35')](_[_0x2281('0x3f')](_0x2609f0['query'],_0x521bc2[_0x2281('0x35')]),_0x36ca2b);if(_0x2609f0[_0x2281('0x34')]['filter']){_0x211f3e[_0x2281('0x3e')]=_['merge'](_0x211f3e[_0x2281('0x3e')],{'$or':_['map'](_0x36ca2b,function(_0x5e849d){if(_0x5e849d[_0x2281('0x30')]!==_0x2281('0x40')){var _0x275b8a={};_0x275b8a[_0x5e849d[_0x2281('0x2a')]]={'$like':'%'+_0x2609f0[_0x2281('0x34')]['filter']+'%'};return _0x275b8a;}})});}_0x211f3e=_[_0x2281('0x41')]({},_0x211f3e,_0x2609f0[_0x2281('0x42')]);var _0x4dea71={'where':_0x211f3e[_0x2281('0x3e')]};return db[_0x2281('0x2d')][_0x2281('0x20')](_0x4dea71)['then'](function(_0x21e2e4){_0x25d033[_0x2281('0x20')]=_0x21e2e4;if(_0x2609f0['query']['includeAll']){_0x211f3e['include']=[{'all':!![]}];}return db['ZendeskField'][_0x2281('0x43')](_0x211f3e);})[_0x2281('0x44')](function(_0x11f2b8){_0x25d033[_0x2281('0x45')]=_0x11f2b8;return _0x25d033;})[_0x2281('0x44')](respondWithFilteredResult(_0x4a7370,_0x211f3e))[_0x2281('0x46')](handleError(_0x4a7370,null));};exports[_0x2281('0x47')]=function(_0xfaf8e6,_0x2b3e97){var _0xa96b16={'raw':!![],'where':{'id':_0xfaf8e6[_0x2281('0x48')]['id']}},_0x433e1f={};_0x433e1f[_0x2281('0x32')]=_[_0x2281('0x33')](db[_0x2281('0x2d')][_0x2281('0x2e')]);_0x433e1f[_0x2281('0x34')]=_[_0x2281('0x33')](_0xfaf8e6['query']);_0x433e1f[_0x2281('0x35')]=_['intersection'](_0x433e1f[_0x2281('0x32')],_0x433e1f['query']);_0xa96b16[_0x2281('0x36')]=_[_0x2281('0x37')](_0x433e1f[_0x2281('0x32')],qs[_0x2281('0x38')](_0xfaf8e6[_0x2281('0x34')][_0x2281('0x38')]));_0xa96b16[_0x2281('0x36')]=_0xa96b16[_0x2281('0x36')]['length']?_0xa96b16['attributes']:_0x433e1f[_0x2281('0x32')];if(_0xfaf8e6[_0x2281('0x34')][_0x2281('0x49')]){_0xa96b16['include']=[{'all':!![]}];}_0xa96b16=_['merge']({},_0xa96b16,_0xfaf8e6['options']);return db[_0x2281('0x2d')]['find'](_0xa96b16)[_0x2281('0x44')](handleEntityNotFound(_0x2b3e97,null))[_0x2281('0x44')](respondWithResult(_0x2b3e97,null))[_0x2281('0x46')](handleError(_0x2b3e97,null));};exports['create']=function(_0x51cbcf,_0x28fa59){return db['ZendeskField'][_0x2281('0x4a')](_0x51cbcf['body'],{})[_0x2281('0x44')](respondWithResult(_0x28fa59,0xc9))[_0x2281('0x46')](handleError(_0x28fa59,null));};exports[_0x2281('0x26')]=function(_0x8a6717,_0x8cea60){if(_0x8a6717[_0x2281('0x4b')]['id']){delete _0x8a6717[_0x2281('0x4b')]['id'];}return db['ZendeskField'][_0x2281('0x4c')]({'where':{'id':_0x8a6717['params']['id']}})[_0x2281('0x44')](handleEntityNotFound(_0x8cea60,null))[_0x2281('0x44')](saveUpdates(_0x8a6717['body'],null))[_0x2281('0x44')](respondWithResult(_0x8cea60,null))['catch'](handleError(_0x8cea60,null));};exports[_0x2281('0x27')]=function(_0x226979,_0x34b9e1){return db['ZendeskField'][_0x2281('0x4c')]({'where':{'id':_0x226979[_0x2281('0x48')]['id']}})[_0x2281('0x44')](handleEntityNotFound(_0x34b9e1,null))['then'](removeEntity(_0x34b9e1,null))[_0x2281('0x46')](handleError(_0x34b9e1,null));};
\ No newline at end of file
+var _0xcc8d=['limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ZendeskField','rawAttributes','key','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','params','intersection','length','options','find','create','body','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x5d7f34,_0x8aed03){var _0xc3b7ed=function(_0x58f60f){while(--_0x58f60f){_0x5d7f34['push'](_0x5d7f34['shift']());}};_0xc3b7ed(++_0x8aed03);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0xcc8d[_0x3e8930];return _0x15b38f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdcc8('0x0'));var zipdir=require(_0xdcc8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdcc8('0x2'));var BPromise=require(_0xdcc8('0x3'));var Mustache=require(_0xdcc8('0x4'));var util=require(_0xdcc8('0x5'));var path=require(_0xdcc8('0x6'));var sox=require(_0xdcc8('0x7'));var csv=require(_0xdcc8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdcc8('0x9'));var _=require(_0xdcc8('0xa'));var squel=require(_0xdcc8('0xb'));var crypto=require(_0xdcc8('0xc'));var jsforce=require(_0xdcc8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdcc8('0x8'));var querystring=require(_0xdcc8('0xe'));var Papa=require(_0xdcc8('0xf'));var Redis=require(_0xdcc8('0x10'));var authService=require(_0xdcc8('0x11'));var qs=require(_0xdcc8('0x12'));var as=require(_0xdcc8('0x13'));var hardwareService=require(_0xdcc8('0x14'));var logger=require(_0xdcc8('0x15'))(_0xdcc8('0x16'));var utils=require(_0xdcc8('0x17'));var config=require(_0xdcc8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcc8('0x19'))['db'];function respondWithStatusCode(_0x37d3c1,_0x5d5554){_0x5d5554=_0x5d5554||0xcc;return function(_0x2b658e){if(_0x2b658e){return _0x37d3c1[_0xdcc8('0x1a')](_0x5d5554);}return _0x37d3c1[_0xdcc8('0x1b')](_0x5d5554)[_0xdcc8('0x1c')]();};}function respondWithResult(_0x583375,_0xe19af5){_0xe19af5=_0xe19af5||0xc8;return function(_0x446b5c){if(_0x446b5c){return _0x583375['status'](_0xe19af5)[_0xdcc8('0x1d')](_0x446b5c);}};}function respondWithFilteredResult(_0x54541f,_0x5f599){return function(_0x3dfd45){if(_0x3dfd45){var _0xc04807=typeof _0x5f599[_0xdcc8('0x1e')]===_0xdcc8('0x1f')&&typeof _0x5f599[_0xdcc8('0x20')]===_0xdcc8('0x1f');var _0x593092=_0x3dfd45['count'];var _0x5f515b=_0xc04807?0x0:_0x5f599['offset'];var _0x509fae=_0xc04807?_0x3dfd45[_0xdcc8('0x21')]:_0x5f599['offset']+_0x5f599[_0xdcc8('0x20')];var _0x249f47;if(_0x509fae>=_0x593092){_0x509fae=_0x593092;_0x249f47=0xc8;}else{_0x249f47=0xce;}_0x54541f[_0xdcc8('0x1b')](_0x249f47);return _0x54541f[_0xdcc8('0x22')](_0xdcc8('0x23'),_0x5f515b+'-'+_0x509fae+'/'+_0x593092)['json'](_0x3dfd45);}return null;};}function patchUpdates(_0x4a34a0){return function(_0x35ec9b){try{jsonpatch[_0xdcc8('0x24')](_0x35ec9b,_0x4a34a0,!![]);}catch(_0x203f8d){return BPromise[_0xdcc8('0x25')](_0x203f8d);}return _0x35ec9b[_0xdcc8('0x26')]();};}function saveUpdates(_0x25e9e6,_0x4122a6){return function(_0x3d4554){if(_0x3d4554){return _0x3d4554[_0xdcc8('0x27')](_0x25e9e6)[_0xdcc8('0x28')](function(_0x415514){return _0x415514;});}return null;};}function removeEntity(_0x4fe330,_0x5400f7){return function(_0x552b11){if(_0x552b11){return _0x552b11['destroy']()[_0xdcc8('0x28')](function(){_0x4fe330[_0xdcc8('0x1b')](0xcc)[_0xdcc8('0x1c')]();});}};}function handleEntityNotFound(_0x289ee9,_0x1f7c0a){return function(_0x2271d7){if(!_0x2271d7){_0x289ee9[_0xdcc8('0x1a')](0x194);}return _0x2271d7;};}function handleError(_0x2f4541,_0x1e9051){_0x1e9051=_0x1e9051||0x1f4;return function(_0x79f872){logger['error'](_0x79f872[_0xdcc8('0x29')]);if(_0x79f872[_0xdcc8('0x2a')]){delete _0x79f872[_0xdcc8('0x2a')];}_0x2f4541['status'](_0x1e9051)[_0xdcc8('0x2b')](_0x79f872);};}exports['index']=function(_0x3c5d48,_0x7f0684){var _0x333d40={},_0x25e80d={},_0x16c40c={'count':0x0,'rows':[]};var _0x55fd9f=_[_0xdcc8('0x2c')](db[_0xdcc8('0x2d')][_0xdcc8('0x2e')],function(_0x4722f9){return{'name':_0x4722f9['fieldName'],'type':_0x4722f9['type'][_0xdcc8('0x2f')]};});_0x25e80d[_0xdcc8('0x30')]=_['map'](_0x55fd9f,_0xdcc8('0x2a'));_0x25e80d['query']=_[_0xdcc8('0x31')](_0x3c5d48['query']);_0x25e80d[_0xdcc8('0x32')]=_['intersection'](_0x25e80d[_0xdcc8('0x30')],_0x25e80d[_0xdcc8('0x33')]);_0x333d40[_0xdcc8('0x34')]=_['intersection'](_0x25e80d[_0xdcc8('0x30')],qs['fields'](_0x3c5d48[_0xdcc8('0x33')][_0xdcc8('0x35')]));_0x333d40['attributes']=_0x333d40['attributes']['length']?_0x333d40[_0xdcc8('0x34')]:_0x25e80d[_0xdcc8('0x30')];if(!_0x3c5d48[_0xdcc8('0x33')][_0xdcc8('0x36')](_0xdcc8('0x37'))){_0x333d40[_0xdcc8('0x20')]=qs[_0xdcc8('0x20')](_0x3c5d48[_0xdcc8('0x33')]['limit']);_0x333d40[_0xdcc8('0x1e')]=qs['offset'](_0x3c5d48['query'][_0xdcc8('0x1e')]);}_0x333d40[_0xdcc8('0x38')]=qs['sort'](_0x3c5d48[_0xdcc8('0x33')]['sort']);_0x333d40[_0xdcc8('0x39')]=qs[_0xdcc8('0x32')](_[_0xdcc8('0x3a')](_0x3c5d48[_0xdcc8('0x33')],_0x25e80d[_0xdcc8('0x32')]),_0x55fd9f);if(_0x3c5d48['query'][_0xdcc8('0x3b')]){_0x333d40['where']=_[_0xdcc8('0x3c')](_0x333d40['where'],{'$or':_[_0xdcc8('0x2c')](_0x55fd9f,function(_0x374df4){if(_0x374df4[_0xdcc8('0x3d')]!==_0xdcc8('0x3e')){var _0x54c73a={};_0x54c73a[_0x374df4[_0xdcc8('0x2a')]]={'$like':'%'+_0x3c5d48[_0xdcc8('0x33')][_0xdcc8('0x3b')]+'%'};return _0x54c73a;}})});}_0x333d40=_[_0xdcc8('0x3c')]({},_0x333d40,_0x3c5d48['options']);var _0x22f9f3={'where':_0x333d40['where']};return db[_0xdcc8('0x2d')][_0xdcc8('0x21')](_0x22f9f3)[_0xdcc8('0x28')](function(_0x5e63fc){_0x16c40c[_0xdcc8('0x21')]=_0x5e63fc;if(_0x3c5d48['query'][_0xdcc8('0x3f')]){_0x333d40[_0xdcc8('0x40')]=[{'all':!![]}];}return db[_0xdcc8('0x2d')]['findAll'](_0x333d40);})[_0xdcc8('0x28')](function(_0x4d5c6a){_0x16c40c['rows']=_0x4d5c6a;return _0x16c40c;})['then'](respondWithFilteredResult(_0x7f0684,_0x333d40))[_0xdcc8('0x41')](handleError(_0x7f0684,null));};exports['show']=function(_0x1cbc51,_0x48c641){var _0x380e71={'raw':!![],'where':{'id':_0x1cbc51[_0xdcc8('0x42')]['id']}},_0x37a395={};_0x37a395[_0xdcc8('0x30')]=_[_0xdcc8('0x31')](db[_0xdcc8('0x2d')][_0xdcc8('0x2e')]);_0x37a395['query']=_['keys'](_0x1cbc51[_0xdcc8('0x33')]);_0x37a395[_0xdcc8('0x32')]=_[_0xdcc8('0x43')](_0x37a395['model'],_0x37a395[_0xdcc8('0x33')]);_0x380e71[_0xdcc8('0x34')]=_['intersection'](_0x37a395['model'],qs[_0xdcc8('0x35')](_0x1cbc51[_0xdcc8('0x33')][_0xdcc8('0x35')]));_0x380e71['attributes']=_0x380e71[_0xdcc8('0x34')][_0xdcc8('0x44')]?_0x380e71[_0xdcc8('0x34')]:_0x37a395[_0xdcc8('0x30')];if(_0x1cbc51[_0xdcc8('0x33')]['includeAll']){_0x380e71[_0xdcc8('0x40')]=[{'all':!![]}];}_0x380e71=_[_0xdcc8('0x3c')]({},_0x380e71,_0x1cbc51[_0xdcc8('0x45')]);return db[_0xdcc8('0x2d')][_0xdcc8('0x46')](_0x380e71)[_0xdcc8('0x28')](handleEntityNotFound(_0x48c641,null))[_0xdcc8('0x28')](respondWithResult(_0x48c641,null))[_0xdcc8('0x41')](handleError(_0x48c641,null));};exports[_0xdcc8('0x47')]=function(_0x3736f8,_0x3d4284){return db[_0xdcc8('0x2d')]['create'](_0x3736f8[_0xdcc8('0x48')],{})[_0xdcc8('0x28')](respondWithResult(_0x3d4284,0xc9))['catch'](handleError(_0x3d4284,null));};exports[_0xdcc8('0x27')]=function(_0x5a2a7e,_0x11665c){if(_0x5a2a7e[_0xdcc8('0x48')]['id']){delete _0x5a2a7e['body']['id'];}return db[_0xdcc8('0x2d')][_0xdcc8('0x46')]({'where':{'id':_0x5a2a7e[_0xdcc8('0x42')]['id']}})[_0xdcc8('0x28')](handleEntityNotFound(_0x11665c,null))[_0xdcc8('0x28')](saveUpdates(_0x5a2a7e[_0xdcc8('0x48')],null))[_0xdcc8('0x28')](respondWithResult(_0x11665c,null))[_0xdcc8('0x41')](handleError(_0x11665c,null));};exports['destroy']=function(_0x75080b,_0x22ab90){return db[_0xdcc8('0x2d')][_0xdcc8('0x46')]({'where':{'id':_0x75080b['params']['id']}})[_0xdcc8('0x28')](handleEntityNotFound(_0x22ab90,null))[_0xdcc8('0x28')](removeEntity(_0x22ab90,null))[_0xdcc8('0x41')](handleError(_0x22ab90,null));};
\ No newline at end of file
index 40ed07c..a72244f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa089=['idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa089,0x1a6));var _0x9a08=function(_0x2ba17f,_0x482805){_0x2ba17f=_0x2ba17f-0x0;var _0xb9a385=_0xa089[_0x2ba17f];return _0xb9a385;};'use strict';var _=require(_0x9a08('0x0'));var util=require(_0x9a08('0x1'));var logger=require('../../config/logger')(_0x9a08('0x2'));var moment=require(_0x9a08('0x3'));var BPromise=require(_0x9a08('0x4'));var rp=require(_0x9a08('0x5'));var fs=require('fs');var path=require(_0x9a08('0x6'));var rimraf=require('rimraf');var config=require(_0x9a08('0x7'));var attributes=require(_0x9a08('0x8'));module[_0x9a08('0x9')]=function(_0x1b17d8,_0x485dff){return _0x1b17d8[_0x9a08('0xa')]('ZendeskField',attributes,{'tableName':_0x9a08('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x9a08('0xc'),_0x9a08('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7900=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField'];(function(_0x1c09f4,_0x3d1a97){var _0x2c2b6a=function(_0x42aea7){while(--_0x42aea7){_0x1c09f4['push'](_0x1c09f4['shift']());}};_0x2c2b6a(++_0x3d1a97);}(_0x7900,0x184));var _0x0790=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7900[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0790('0x0'));var util=require(_0x0790('0x1'));var logger=require(_0x0790('0x2'))(_0x0790('0x3'));var moment=require(_0x0790('0x4'));var BPromise=require(_0x0790('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0790('0x6'));var rimraf=require(_0x0790('0x7'));var config=require(_0x0790('0x8'));var attributes=require(_0x0790('0x9'));module[_0x0790('0xa')]=function(_0x33f8e2,_0x240822){return _0x33f8e2['define'](_0x0790('0xb'),attributes,{'tableName':_0x0790('0xc'),'paranoid':![],'indexes':[{'name':_0x0790('0xd'),'fields':[_0x0790('0xe'),_0x0790('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d51e9c2..b25c53d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3936=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','message','ZendeskField,\x20%s,\x20%s'];(function(_0x2ea839,_0x388c4f){var _0x40eeed=function(_0x4fd3da){while(--_0x4fd3da){_0x2ea839['push'](_0x2ea839['shift']());}};_0x40eeed(++_0x388c4f);}(_0x3936,0x1a4));var _0x6393=function(_0x2c6484,_0x4fe72c){_0x2c6484=_0x2c6484-0x0;var _0x3b9d94=_0x3936[_0x2c6484];return _0x3b9d94;};'use strict';var _=require(_0x6393('0x0'));var util=require('util');var moment=require(_0x6393('0x1'));var BPromise=require(_0x6393('0x2'));var rs=require(_0x6393('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6393('0x4'))['db'];var utils=require(_0x6393('0x5'));var logger=require(_0x6393('0x6'))(_0x6393('0x7'));var config=require(_0x6393('0x8'));var jayson=require(_0x6393('0x9'));var client=jayson[_0x6393('0xa')][_0x6393('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x395c1a,_0x42be97,_0x535c0e){return new BPromise(function(_0x3ecf42,_0x2ea515){return client[_0x6393('0xc')](_0x395c1a,_0x535c0e)[_0x6393('0xd')](function(_0x28f711){logger[_0x6393('0xe')]('ZendeskField,\x20%s,\x20%s',_0x42be97,_0x6393('0xf'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x42be97,_0x6393('0xf'),JSON['stringify'](_0x28f711));if(_0x28f711[_0x6393('0x10')]){if(_0x28f711['error'][_0x6393('0x11')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x42be97,_0x28f711[_0x6393('0x10')][_0x6393('0x12')]);return _0x2ea515(_0x28f711[_0x6393('0x10')]['message']);}logger[_0x6393('0x10')](_0x6393('0x13'),_0x42be97,_0x28f711[_0x6393('0x10')][_0x6393('0x12')]);return _0x3ecf42(_0x28f711[_0x6393('0x10')][_0x6393('0x12')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x42be97,_0x6393('0xf'));_0x3ecf42(_0x28f711[_0x6393('0x14')][_0x6393('0x12')]);}})[_0x6393('0x15')](function(_0x252a13){logger[_0x6393('0x10')](_0x6393('0x13'),_0x42be97,_0x252a13);_0x2ea515(_0x252a13);});});}
\ No newline at end of file
+var _0x853e=['request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s'];(function(_0x1554a7,_0x1fdb2b){var _0x562f96=function(_0x54fc04){while(--_0x54fc04){_0x1554a7['push'](_0x1554a7['shift']());}};_0x562f96(++_0x1fdb2b);}(_0x853e,0x194));var _0xe853=function(_0x2e126a,_0x2aca96){_0x2e126a=_0x2e126a-0x0;var _0xa943a3=_0x853e[_0x2e126a];return _0xa943a3;};'use strict';var _=require(_0xe853('0x0'));var util=require(_0xe853('0x1'));var moment=require('moment');var BPromise=require(_0xe853('0x2'));var rs=require(_0xe853('0x3'));var fs=require('fs');var Redis=require(_0xe853('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe853('0x5'));var logger=require(_0xe853('0x6'))('rpc');var config=require(_0xe853('0x7'));var jayson=require(_0xe853('0x8'));var client=jayson[_0xe853('0x9')][_0xe853('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43747b,_0xf4c9cc,_0x13b6bd){return new BPromise(function(_0x2e3bc0,_0x1a0ddf){return client[_0xe853('0xb')](_0x43747b,_0x13b6bd)[_0xe853('0xc')](function(_0x50a493){logger['info'](_0xe853('0xd'),_0xf4c9cc,_0xe853('0xe'));logger['debug'](_0xe853('0xf'),_0xf4c9cc,_0xe853('0xe'),JSON['stringify'](_0x50a493));if(_0x50a493[_0xe853('0x10')]){if(_0x50a493[_0xe853('0x10')]['code']===0x1f4){logger[_0xe853('0x10')](_0xe853('0xd'),_0xf4c9cc,_0x50a493[_0xe853('0x10')][_0xe853('0x11')]);return _0x1a0ddf(_0x50a493[_0xe853('0x10')][_0xe853('0x11')]);}logger[_0xe853('0x10')](_0xe853('0xd'),_0xf4c9cc,_0x50a493['error'][_0xe853('0x11')]);return _0x2e3bc0(_0x50a493[_0xe853('0x10')]['message']);}else{logger['info'](_0xe853('0xd'),_0xf4c9cc,_0xe853('0xe'));_0x2e3bc0(_0x50a493['result']['message']);}})[_0xe853('0x12')](function(_0x22ecf7){logger['error'](_0xe853('0xd'),_0xf4c9cc,_0x22ecf7);_0x1a0ddf(_0x22ecf7);});});}
\ No newline at end of file
index 0ed836a..22de484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb18=['index','show','/:id/configurations','getConfigurations','post','create','addConfiguration','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x53a960,_0x1b83d0){var _0x4463d0=function(_0x358e7f){while(--_0x358e7f){_0x53a960['push'](_0x53a960['shift']());}};_0x4463d0(++_0x1b83d0);}(_0xdb18,0x127));var _0x8db1=function(_0x5adac0,_0x2fada3){_0x5adac0=_0x5adac0-0x0;var _0x42481c=_0xdb18[_0x5adac0];return _0x42481c;};'use strict';var multer=require('multer');var util=require(_0x8db1('0x0'));var path=require('path');var timeout=require(_0x8db1('0x1'));var express=require(_0x8db1('0x2'));var router=express[_0x8db1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8db1('0x4'));var config=require(_0x8db1('0x5'));var controller=require(_0x8db1('0x6'));router[_0x8db1('0x7')]('/',auth[_0x8db1('0x8')](),controller[_0x8db1('0x9')]);router[_0x8db1('0x7')]('/:id',auth[_0x8db1('0x8')](),controller[_0x8db1('0xa')]);router[_0x8db1('0x7')](_0x8db1('0xb'),auth[_0x8db1('0x8')](),controller[_0x8db1('0xc')]);router[_0x8db1('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8db1('0xd')]('/',auth[_0x8db1('0x8')](),controller[_0x8db1('0xe')]);router[_0x8db1('0xd')](_0x8db1('0xb'),auth[_0x8db1('0x8')](),controller[_0x8db1('0xf')]);router['put']('/:id',auth[_0x8db1('0x8')](),controller[_0x8db1('0x10')]);router[_0x8db1('0x11')]('/:id',auth[_0x8db1('0x8')](),controller['destroy']);module[_0x8db1('0x12')]=router;
\ No newline at end of file
+var _0x5872=['show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated'];(function(_0x587210,_0xfe116){var _0x319a8e=function(_0x3afddf){while(--_0x3afddf){_0x587210['push'](_0x587210['shift']());}};_0x319a8e(++_0xfe116);}(_0x5872,0x18b));var _0x2587=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x5872[_0x2d89ce];return _0x3fad10;};'use strict';var multer=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var path=require(_0x2587('0x2'));var timeout=require(_0x2587('0x3'));var express=require(_0x2587('0x4'));var router=express['Router']();var fs_extra=require(_0x2587('0x5'));var auth=require(_0x2587('0x6'));var interaction=require(_0x2587('0x7'));var config=require('../../config/environment');var controller=require(_0x2587('0x8'));router[_0x2587('0x9')]('/',auth['isAuthenticated'](),controller[_0x2587('0xa')]);router[_0x2587('0x9')](_0x2587('0xb'),auth[_0x2587('0xc')](),controller[_0x2587('0xd')]);router['get'](_0x2587('0xe'),auth['isAuthenticated'](),controller[_0x2587('0xf')]);router[_0x2587('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2587('0x10')]);router[_0x2587('0x11')]('/',auth[_0x2587('0xc')](),controller[_0x2587('0x12')]);router[_0x2587('0x11')](_0x2587('0xe'),auth[_0x2587('0xc')](),controller[_0x2587('0x13')]);router[_0x2587('0x14')](_0x2587('0xb'),auth['isAuthenticated'](),controller[_0x2587('0x15')]);router[_0x2587('0x16')](_0x2587('0xb'),auth[_0x2587('0xc')](),controller['destroy']);module[_0x2587('0x17')]=router;
\ No newline at end of file
index 5dbe782..8fa04e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['STRING','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbec5,0xe5));var _0x5bec=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xbec5[_0x1daaa9];return _0x1dd221;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}};
\ No newline at end of file
+var _0x2750=['STRING','sequelize'];(function(_0x51f4fc,_0x1fe3ef){var _0x4d96fc=function(_0xddc9){while(--_0xddc9){_0x51f4fc['push'](_0x51f4fc['shift']());}};_0x4d96fc(++_0x1fe3ef);}(_0x2750,0x13b));var _0x0275=function(_0x139626,_0x1c233b){_0x139626=_0x139626-0x0;var _0x302d3d=_0x2750[_0x139626];return _0x302d3d;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}};
\ No newline at end of file
index 7ca6407..f1015bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9152=['../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','destroy','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','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','Subject','Description','WhoId','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1d5cfa,_0x57efb0){var _0x19a273=function(_0x2fe3f5){while(--_0x2fe3f5){_0x1d5cfa['push'](_0x1d5cfa['shift']());}};_0x19a273(++_0x57efb0);}(_0x9152,0xee));var _0x2915=function(_0x36e198,_0x177c76){_0x36e198=_0x36e198-0x0;var _0x3e8493=_0x9152[_0x36e198];return _0x3e8493;};'use strict';var emlformat=require(_0x2915('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2915('0x1'));var jsonpatch=require(_0x2915('0x2'));var rp=require(_0x2915('0x3'));var moment=require(_0x2915('0x4'));var BPromise=require(_0x2915('0x5'));var Mustache=require(_0x2915('0x6'));var util=require(_0x2915('0x7'));var path=require(_0x2915('0x8'));var sox=require(_0x2915('0x9'));var csv=require(_0x2915('0xa'));var ejs=require(_0x2915('0xb'));var fs=require('fs');var fs_extra=require(_0x2915('0xc'));var _=require('lodash');var squel=require(_0x2915('0xd'));var crypto=require(_0x2915('0xe'));var jsforce=require(_0x2915('0xf'));var deskjs=require(_0x2915('0x10'));var toCsv=require(_0x2915('0xa'));var querystring=require(_0x2915('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2915('0x12'));var qs=require(_0x2915('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2915('0x14'));var utils=require('../../config/utils');var config=require(_0x2915('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2915('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x343d62,_0x4f141e){_0x4f141e=_0x4f141e||0xcc;return function(_0x43a39b){if(_0x43a39b){return _0x343d62[_0x2915('0x17')](_0x4f141e);}return _0x343d62[_0x2915('0x18')](_0x4f141e)[_0x2915('0x19')]();};}function respondWithResult(_0x17dd09,_0x1b1a5b){_0x1b1a5b=_0x1b1a5b||0xc8;return function(_0x1ccae1){if(_0x1ccae1){return _0x17dd09[_0x2915('0x18')](_0x1b1a5b)[_0x2915('0x1a')](_0x1ccae1);}};}function respondWithFilteredResult(_0x288c19,_0x1100a9){return function(_0x23043b){if(_0x23043b){var _0x4519d4=typeof _0x1100a9[_0x2915('0x1b')]===_0x2915('0x1c')&&typeof _0x1100a9['limit']===_0x2915('0x1c');var _0x286f70=_0x23043b[_0x2915('0x1d')];var _0x227f7c=_0x4519d4?0x0:_0x1100a9['offset'];var _0x138dea=_0x4519d4?_0x23043b[_0x2915('0x1d')]:_0x1100a9['offset']+_0x1100a9['limit'];var _0x9f84ea;if(_0x138dea>=_0x286f70){_0x138dea=_0x286f70;_0x9f84ea=0xc8;}else{_0x9f84ea=0xce;}_0x288c19[_0x2915('0x18')](_0x9f84ea);return _0x288c19[_0x2915('0x1e')]('Content-Range',_0x227f7c+'-'+_0x138dea+'/'+_0x286f70)['json'](_0x23043b);}return null;};}function patchUpdates(_0x7f7402){return function(_0x382d9c){try{jsonpatch[_0x2915('0x1f')](_0x382d9c,_0x7f7402,!![]);}catch(_0x5d00b4){return BPromise[_0x2915('0x20')](_0x5d00b4);}return _0x382d9c[_0x2915('0x21')]();};}function saveUpdates(_0x4c1a1f,_0x76bf53){return function(_0x18854a){if(_0x18854a){return _0x18854a[_0x2915('0x22')](_0x4c1a1f)[_0x2915('0x23')](function(_0x4a6fa7){return _0x4a6fa7;});}return null;};}function removeEntity(_0x229776,_0x4b5e05){return function(_0x35bebc){if(_0x35bebc){return _0x35bebc['destroy']()[_0x2915('0x23')](function(){_0x229776[_0x2915('0x18')](0xcc)[_0x2915('0x19')]();});}};}function handleEntityNotFound(_0x5a145c,_0x9a4235){return function(_0x290dcd){if(!_0x290dcd){_0x5a145c[_0x2915('0x17')](0x194);}return _0x290dcd;};}function handleError(_0x50f33a,_0x221ddb){_0x221ddb=_0x221ddb||0x1f4;return function(_0x520148){logger[_0x2915('0x24')](_0x520148['stack']);if(_0x520148['name']){delete _0x520148[_0x2915('0x25')];}_0x50f33a[_0x2915('0x18')](_0x221ddb)[_0x2915('0x26')](_0x520148);};}exports[_0x2915('0x27')]=function(_0x471f91,_0x3e438b){var _0x277ff1={},_0x5f87e7={},_0x391f5b={'count':0x0,'rows':[]};var _0x1a90f1=_[_0x2915('0x28')](db[_0x2915('0x29')][_0x2915('0x2a')],function(_0x481e3b){return{'name':_0x481e3b[_0x2915('0x2b')],'type':_0x481e3b[_0x2915('0x2c')][_0x2915('0x2d')]};});_0x5f87e7[_0x2915('0x2e')]=_['map'](_0x1a90f1,_0x2915('0x25'));_0x5f87e7['query']=_[_0x2915('0x2f')](_0x471f91[_0x2915('0x30')]);_0x5f87e7['filters']=_[_0x2915('0x31')](_0x5f87e7['model'],_0x5f87e7[_0x2915('0x30')]);_0x277ff1[_0x2915('0x32')]=_[_0x2915('0x31')](_0x5f87e7['model'],qs['fields'](_0x471f91['query'][_0x2915('0x33')]));_0x277ff1['attributes']=_0x277ff1[_0x2915('0x32')][_0x2915('0x34')]?_0x277ff1['attributes']:_0x5f87e7[_0x2915('0x2e')];if(!_0x471f91['query'][_0x2915('0x35')]('nolimit')){_0x277ff1[_0x2915('0x36')]=qs[_0x2915('0x36')](_0x471f91[_0x2915('0x30')]['limit']);_0x277ff1[_0x2915('0x1b')]=qs[_0x2915('0x1b')](_0x471f91[_0x2915('0x30')][_0x2915('0x1b')]);}_0x277ff1[_0x2915('0x37')]=qs[_0x2915('0x38')](_0x471f91[_0x2915('0x30')][_0x2915('0x38')]);_0x277ff1[_0x2915('0x39')]=qs[_0x2915('0x3a')](_[_0x2915('0x3b')](_0x471f91[_0x2915('0x30')],_0x5f87e7[_0x2915('0x3a')]),_0x1a90f1);if(_0x471f91[_0x2915('0x30')][_0x2915('0x3c')]){_0x277ff1[_0x2915('0x39')]=_['merge'](_0x277ff1['where'],{'$or':_[_0x2915('0x28')](_0x1a90f1,function(_0x1f28fc){if(_0x1f28fc['type']!==_0x2915('0x3d')){var _0x1c39f8={};_0x1c39f8[_0x1f28fc[_0x2915('0x25')]]={'$like':'%'+_0x471f91[_0x2915('0x30')][_0x2915('0x3c')]+'%'};return _0x1c39f8;}})});}_0x277ff1=_[_0x2915('0x3e')]({},_0x277ff1,_0x471f91['options']);var _0x5a359d={'where':_0x277ff1[_0x2915('0x39')]};return db[_0x2915('0x29')][_0x2915('0x1d')](_0x5a359d)[_0x2915('0x23')](function(_0x48d619){_0x391f5b[_0x2915('0x1d')]=_0x48d619;if(_0x471f91['query'][_0x2915('0x3f')]){_0x277ff1['include']=[{'all':!![]}];}return db[_0x2915('0x29')][_0x2915('0x40')](_0x277ff1);})[_0x2915('0x23')](function(_0xba2cb5){_0x391f5b[_0x2915('0x41')]=_0xba2cb5;return _0x391f5b;})[_0x2915('0x23')](respondWithFilteredResult(_0x3e438b,_0x277ff1))[_0x2915('0x42')](handleError(_0x3e438b,null));};exports[_0x2915('0x43')]=function(_0x107094,_0x30b156){var _0x55bb5e={'raw':![],'where':{'id':_0x107094[_0x2915('0x44')]['id']}},_0x43e8d6={};_0x43e8d6[_0x2915('0x2e')]=_[_0x2915('0x2f')](db[_0x2915('0x29')][_0x2915('0x2a')]);_0x43e8d6[_0x2915('0x30')]=_[_0x2915('0x2f')](_0x107094[_0x2915('0x30')]);_0x43e8d6[_0x2915('0x3a')]=_[_0x2915('0x31')](_0x43e8d6[_0x2915('0x2e')],_0x43e8d6[_0x2915('0x30')]);_0x55bb5e[_0x2915('0x32')]=_[_0x2915('0x31')](_0x43e8d6[_0x2915('0x2e')],qs[_0x2915('0x33')](_0x107094[_0x2915('0x30')][_0x2915('0x33')]));_0x55bb5e[_0x2915('0x32')]=_0x55bb5e[_0x2915('0x32')][_0x2915('0x34')]?_0x55bb5e['attributes']:_0x43e8d6[_0x2915('0x2e')];if(_0x107094[_0x2915('0x30')]['includeAll']){_0x55bb5e[_0x2915('0x45')]=[{'all':!![]}];}_0x55bb5e=_[_0x2915('0x3e')]({},_0x55bb5e,_0x107094[_0x2915('0x46')]);return db['ZohoAccount'][_0x2915('0x47')](_0x55bb5e)['then'](handleEntityNotFound(_0x30b156,null))[_0x2915('0x23')](respondWithResult(_0x30b156,null))[_0x2915('0x42')](handleError(_0x30b156,null));};exports[_0x2915('0x48')]=function(_0x288ce1,_0x34754b){return db[_0x2915('0x29')][_0x2915('0x48')](_0x288ce1[_0x2915('0x49')],{})[_0x2915('0x23')](respondWithResult(_0x34754b,0xc9))[_0x2915('0x42')](handleError(_0x34754b,null));};exports[_0x2915('0x22')]=function(_0x22ee5b,_0x5a201f){if(_0x22ee5b[_0x2915('0x49')]['id']){delete _0x22ee5b['body']['id'];}return db[_0x2915('0x29')][_0x2915('0x47')]({'where':{'id':_0x22ee5b['params']['id']}})[_0x2915('0x23')](handleEntityNotFound(_0x5a201f,null))['then'](saveUpdates(_0x22ee5b['body'],null))[_0x2915('0x23')](respondWithResult(_0x5a201f,null))[_0x2915('0x42')](handleError(_0x5a201f,null));};exports[_0x2915('0x4a')]=function(_0x29af16,_0x2867a1){return db[_0x2915('0x29')][_0x2915('0x47')]({'where':{'id':_0x29af16[_0x2915('0x44')]['id']}})[_0x2915('0x23')](handleEntityNotFound(_0x2867a1,null))[_0x2915('0x23')](removeEntity(_0x2867a1,null))['catch'](handleError(_0x2867a1,null));};exports['getConfigurations']=function(_0x3bd4aa,_0x2a6208,_0x331487){var _0x4ab767={};var _0x1762d0={};var _0x39e52f;var _0x137f68;return db['ZohoAccount'][_0x2915('0x4b')]({'where':{'id':_0x3bd4aa['params']['id']}})[_0x2915('0x23')](handleEntityNotFound(_0x2a6208,null))[_0x2915('0x23')](function(_0x5e0bf3){if(_0x5e0bf3){_0x39e52f=_0x5e0bf3;_0x1762d0[_0x2915('0x2e')]=_['keys'](db[_0x2915('0x4c')][_0x2915('0x2a')]);_0x1762d0[_0x2915('0x30')]=_[_0x2915('0x2f')](_0x3bd4aa[_0x2915('0x30')]);_0x1762d0[_0x2915('0x3a')]=_['intersection'](_0x1762d0[_0x2915('0x2e')],_0x1762d0[_0x2915('0x30')]);_0x4ab767[_0x2915('0x32')]=_[_0x2915('0x31')](_0x1762d0[_0x2915('0x2e')],qs['fields'](_0x3bd4aa[_0x2915('0x30')]['fields']));_0x4ab767[_0x2915('0x32')]=_0x4ab767[_0x2915('0x32')][_0x2915('0x34')]?_0x4ab767['attributes']:_0x1762d0[_0x2915('0x2e')];_0x4ab767[_0x2915('0x37')]=qs[_0x2915('0x38')](_0x3bd4aa[_0x2915('0x30')][_0x2915('0x38')]);_0x4ab767[_0x2915('0x39')]=qs[_0x2915('0x3a')](_[_0x2915('0x3b')](_0x3bd4aa[_0x2915('0x30')],_0x1762d0[_0x2915('0x3a')]));if(_0x3bd4aa['query']['filter']){_0x4ab767[_0x2915('0x39')]=_['merge'](_0x4ab767[_0x2915('0x39')],{'$or':_[_0x2915('0x28')](_0x4ab767[_0x2915('0x32')],function(_0x46471f){var _0x6c34f0={};_0x6c34f0[_0x46471f]={'$like':'%'+_0x3bd4aa[_0x2915('0x30')][_0x2915('0x3c')]+'%'};return _0x6c34f0;})});}_0x4ab767=_[_0x2915('0x3e')]({},_0x4ab767,_0x3bd4aa[_0x2915('0x46')]);return _0x39e52f[_0x2915('0x4d')](_0x4ab767);}})[_0x2915('0x23')](function(_0x2e3295){if(_0x2e3295){_0x137f68=_0x2e3295[_0x2915('0x34')];if(!_0x3bd4aa[_0x2915('0x30')][_0x2915('0x35')](_0x2915('0x4e'))){_0x4ab767[_0x2915('0x36')]=qs[_0x2915('0x36')](_0x3bd4aa[_0x2915('0x30')][_0x2915('0x36')]);_0x4ab767[_0x2915('0x1b')]=qs[_0x2915('0x1b')](_0x3bd4aa[_0x2915('0x30')]['offset']);}return _0x39e52f[_0x2915('0x4d')](_0x4ab767);}})['then'](function(_0x80e40a){if(_0x80e40a){return _0x80e40a?{'count':_0x137f68,'rows':_0x80e40a}:null;}})['then'](respondWithResult(_0x2a6208,null))[_0x2915('0x42')](handleError(_0x2a6208,null));};exports[_0x2915('0x4f')]=function(_0x53e8e5,_0x4a8c5d,_0x4d8e11){if(_0x53e8e5[_0x2915('0x49')]['id']){delete _0x53e8e5[_0x2915('0x49')]['id'];}return db[_0x2915('0x29')]['findOne']({'where':{'id':_0x53e8e5[_0x2915('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a8c5d,null))['then'](function(_0x24cbc2){if(_0x24cbc2){_0x53e8e5[_0x2915('0x49')][_0x2915('0x50')]=_0x24cbc2['id'];_0x53e8e5[_0x2915('0x49')][_0x2915('0x51')]=integrations['getSubjects'](_0x53e8e5[_0x2915('0x49')][_0x2915('0x52')],_0x53e8e5['body'][_0x2915('0x2c')]);_0x53e8e5[_0x2915('0x49')][_0x2915('0x53')]=integrations['getDescriptions'](_0x53e8e5[_0x2915('0x49')]['channel'],_0x53e8e5[_0x2915('0x49')][_0x2915('0x2c')]);return db[_0x2915('0x4c')][_0x2915('0x48')](_0x53e8e5[_0x2915('0x49')],{'include':[{'model':db['ZohoField'],'as':_0x2915('0x51')},{'model':db[_0x2915('0x54')],'as':_0x2915('0x53')}]});}return null;})[_0x2915('0x23')](respondWithResult(_0x4a8c5d,null))[_0x2915('0x42')](handleError(_0x4a8c5d,null));};function getAccessToken(_0x1b4453){return new Promise(function(_0x3f4a87,_0x322db0){var _0x15cd07;switch(_0x1b4453['zone']){case'US':_0x15cd07=_0x2915('0x55');break;case'AU':_0x15cd07=_0x2915('0x56');break;case'EU':_0x15cd07='https://accounts.zoho.eu';break;case'IN':_0x15cd07='https://accounts.zoho.in';break;case'CN':_0x15cd07=_0x2915('0x57');break;default:_0x15cd07='https://accounts.zoho.eu';break;}var _0x3853fd={'method':_0x2915('0x58'),'uri':_0x15cd07+_0x2915('0x59'),'qs':{'refresh_token':_0x1b4453[_0x2915('0x5a')],'client_id':_0x1b4453['clientId'],'client_secret':_0x1b4453[_0x2915('0x5b')],'grant_type':_0x2915('0x5c')},'json':!![]};return rp(_0x3853fd)[_0x2915('0x23')](function(_0x2bc757){if(_0x2bc757[_0x2915('0x5d')]){_0x3f4a87(_0x2bc757['access_token']);}else{_0x322db0(_0x2915('0x5e'));}})[_0x2915('0x42')](function(_0x2965dd){_0x322db0(_0x2965dd);});});}exports['getFields']=function(_0x12b915,_0x18e3e0,_0x151fd2){var _0x479ad5,_0x1c8f57,_0x2cab72,_0x1fb77e,_0x2bfd55;return db[_0x2915('0x29')][_0x2915('0x4b')]({'where':{'id':_0x12b915[_0x2915('0x44')]['id']},'attributes':['id',_0x2915('0x5f'),_0x2915('0x60'),'clientId',_0x2915('0x5b'),_0x2915('0x61'),_0x2915('0x62'),_0x2915('0x5a')]})[_0x2915('0x23')](handleEntityNotFound(_0x18e3e0,null))['then'](function(_0x93d925){_0x2bfd55=_0x93d925;_0x479ad5=_0x2bfd55['host'];_0x1c8f57=_0x479ad5===_0x2915('0x63')?'eu':_0x2915('0x64');_0x2cab72=_0x2bfd55[_0x2915('0x61')];var _0x55e419=_0x2cab72[_0x2915('0x65')](-0x1);if(_0x55e419==='/'||_0x55e419==='\x5c'||_0x55e419===':'){_0x2cab72=_0x2cab72[_0x2915('0x66')](0x0,_0x2cab72[_0x2915('0x67')](_0x55e419));}if(!_0x2bfd55[_0x2915('0x5a')]){throw new Error(_0x2915('0x68'));}return getAccessToken(_0x2bfd55);})['then'](function(_0x347ddc){if(_0x347ddc){return rp({'method':_0x2915('0x69'),'uri':util[_0x2915('0x6a')](_0x2915('0x6b'),_0x1c8f57),'qs':{'module':_0x2915('0x6c')},'headers':{'Authorization':_0x2915('0x6d')+_0x347ddc},'json':!![]});}})[_0x2915('0x23')](function(_0x2bd81a){if(_0x2bd81a){if(_0x2bd81a[_0x2915('0x6e')]&&_0x2bd81a[_0x2915('0x6e')]['error']){throw new Error(_0x2bd81a[_0x2915('0x6e')][_0x2915('0x24')]['message']);}var _0x13adc4=[];var _0x4211eb=[];var _0x833678=['Owner',_0x2915('0x6f'),_0x2915('0x70'),_0x2915('0x71'),'Call_Duration','Call_Result',_0x2915('0x72'),_0x2915('0x73')];_0x4211eb=_['remove'](_0x2bd81a[_0x2915('0x33')],function(_0x1c8f9f){return _0x833678[_0x2915('0x74')](_0x1c8f9f[_0x2915('0x75')]);});for(var _0x50966f=0x0;_0x50966f<_0x4211eb[_0x2915('0x34')];_0x50966f++){if(_0x4211eb[_0x50966f][_0x2915('0x76')]===![]){_0x13adc4[_0x2915('0x77')]({'id':_0x4211eb[_0x50966f]['id'],'name':_0x4211eb[_0x50966f][_0x2915('0x78')],'custom':_0x4211eb[_0x50966f]['custom_field'],'options':_0x4211eb[_0x50966f][_0x2915('0x79')]===_0x2915('0x7a')&&_0x4211eb[_0x50966f][_0x2915('0x7b')][_0x2915('0x34')]>-0x1?_[_0x2915('0x28')](_0x4211eb[_0x50966f]['pick_list_values'],function(_0x10598c){return{'name':_0x10598c,'value':_0x10598c};}):[]});}}return{'count':_0x13adc4[_0x2915('0x34')],'rows':_0x13adc4};}else{return{'count':0x0,'rows':[]};}})[_0x2915('0x23')](respondWithResult(_0x18e3e0,null))[_0x2915('0x42')](function(_0xcbf0f0){var _0x537cff=_0x12b915['query'][_0x2915('0x7c')]?0x1f4:_0xcbf0f0['statusCode']||0x1f4;logger[_0x2915('0x24')](_0x2915('0x7d'),'getFields',_0x537cff,JSON[_0x2915('0x7e')](_0xcbf0f0));delete _0xcbf0f0[_0x2915('0x25')];if(_0x537cff===0x191){_0x537cff=0x190;}_0x18e3e0[_0x2915('0x18')](_0x537cff)[_0x2915('0x26')](_0x12b915[_0x2915('0x30')][_0x2915('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0xcbf0f0[_0x2915('0x7f')]}:_0xcbf0f0);});};
\ No newline at end of file
+var _0x8684=['Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','create','body','update','find','ZohoConfiguration','pick','options','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','clientSecret','serverUrl','zoho.eu','com','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x8684,0x90));var _0x4868=function(_0x9d0642,_0x55c12d){_0x9d0642=_0x9d0642-0x0;var _0x33ff84=_0x8684[_0x9d0642];return _0x33ff84;};'use strict';var emlformat=require(_0x4868('0x0'));var rimraf=require(_0x4868('0x1'));var zipdir=require(_0x4868('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4868('0x3'));var moment=require(_0x4868('0x4'));var BPromise=require(_0x4868('0x5'));var Mustache=require(_0x4868('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4868('0x7'));var fs=require('fs');var fs_extra=require(_0x4868('0x8'));var _=require(_0x4868('0x9'));var squel=require(_0x4868('0xa'));var crypto=require('crypto');var jsforce=require(_0x4868('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4868('0xc'));var querystring=require('querystring');var Papa=require(_0x4868('0xd'));var Redis=require(_0x4868('0xe'));var authService=require(_0x4868('0xf'));var qs=require(_0x4868('0x10'));var as=require(_0x4868('0x11'));var hardwareService=require(_0x4868('0x12'));var logger=require(_0x4868('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4868('0x14'));var licenseUtil=require(_0x4868('0x15'));var db=require(_0x4868('0x16'))['db'];var integrations=require(_0x4868('0x17'));function respondWithStatusCode(_0x34daf6,_0x85584f){_0x85584f=_0x85584f||0xcc;return function(_0x1c39c1){if(_0x1c39c1){return _0x34daf6[_0x4868('0x18')](_0x85584f);}return _0x34daf6[_0x4868('0x19')](_0x85584f)[_0x4868('0x1a')]();};}function respondWithResult(_0x236f09,_0x536219){_0x536219=_0x536219||0xc8;return function(_0x5e70c5){if(_0x5e70c5){return _0x236f09[_0x4868('0x19')](_0x536219)['json'](_0x5e70c5);}};}function respondWithFilteredResult(_0x402d7a,_0x196d70){return function(_0x486b26){if(_0x486b26){var _0x3fe6de=typeof _0x196d70[_0x4868('0x1b')]===_0x4868('0x1c')&&typeof _0x196d70['limit']===_0x4868('0x1c');var _0x33cde9=_0x486b26[_0x4868('0x1d')];var _0x41d431=_0x3fe6de?0x0:_0x196d70['offset'];var _0x564344=_0x3fe6de?_0x486b26[_0x4868('0x1d')]:_0x196d70['offset']+_0x196d70[_0x4868('0x1e')];var _0x160694;if(_0x564344>=_0x33cde9){_0x564344=_0x33cde9;_0x160694=0xc8;}else{_0x160694=0xce;}_0x402d7a['status'](_0x160694);return _0x402d7a[_0x4868('0x1f')](_0x4868('0x20'),_0x41d431+'-'+_0x564344+'/'+_0x33cde9)[_0x4868('0x21')](_0x486b26);}return null;};}function patchUpdates(_0x5a7bf1){return function(_0x29e1ae){try{jsonpatch['apply'](_0x29e1ae,_0x5a7bf1,!![]);}catch(_0x53083e){return BPromise[_0x4868('0x22')](_0x53083e);}return _0x29e1ae['save']();};}function saveUpdates(_0x46fe6f,_0x4dc54a){return function(_0x148b48){if(_0x148b48){return _0x148b48['update'](_0x46fe6f)[_0x4868('0x23')](function(_0x30ac02){return _0x30ac02;});}return null;};}function removeEntity(_0x36a77a,_0x1fc760){return function(_0x3d7faf){if(_0x3d7faf){return _0x3d7faf[_0x4868('0x24')]()['then'](function(){_0x36a77a[_0x4868('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x170d2e,_0x21cd3c){return function(_0x5022cc){if(!_0x5022cc){_0x170d2e['sendStatus'](0x194);}return _0x5022cc;};}function handleError(_0x348520,_0xf50295){_0xf50295=_0xf50295||0x1f4;return function(_0x3ab706){logger[_0x4868('0x25')](_0x3ab706[_0x4868('0x26')]);if(_0x3ab706[_0x4868('0x27')]){delete _0x3ab706[_0x4868('0x27')];}_0x348520[_0x4868('0x19')](_0xf50295)[_0x4868('0x28')](_0x3ab706);};}exports[_0x4868('0x29')]=function(_0x2cc46a,_0x71b1bb){var _0x1db08b={},_0x2ccf2a={},_0x508388={'count':0x0,'rows':[]};var _0x4e21fc=_[_0x4868('0x2a')](db[_0x4868('0x2b')][_0x4868('0x2c')],function(_0x5df656){return{'name':_0x5df656['fieldName'],'type':_0x5df656['type']['key']};});_0x2ccf2a[_0x4868('0x2d')]=_[_0x4868('0x2a')](_0x4e21fc,_0x4868('0x27'));_0x2ccf2a[_0x4868('0x2e')]=_[_0x4868('0x2f')](_0x2cc46a['query']);_0x2ccf2a['filters']=_['intersection'](_0x2ccf2a[_0x4868('0x2d')],_0x2ccf2a[_0x4868('0x2e')]);_0x1db08b['attributes']=_[_0x4868('0x30')](_0x2ccf2a[_0x4868('0x2d')],qs[_0x4868('0x31')](_0x2cc46a[_0x4868('0x2e')][_0x4868('0x31')]));_0x1db08b[_0x4868('0x32')]=_0x1db08b[_0x4868('0x32')][_0x4868('0x33')]?_0x1db08b[_0x4868('0x32')]:_0x2ccf2a[_0x4868('0x2d')];if(!_0x2cc46a[_0x4868('0x2e')][_0x4868('0x34')]('nolimit')){_0x1db08b[_0x4868('0x1e')]=qs[_0x4868('0x1e')](_0x2cc46a[_0x4868('0x2e')][_0x4868('0x1e')]);_0x1db08b[_0x4868('0x1b')]=qs[_0x4868('0x1b')](_0x2cc46a['query'][_0x4868('0x1b')]);}_0x1db08b[_0x4868('0x35')]=qs['sort'](_0x2cc46a['query'][_0x4868('0x36')]);_0x1db08b[_0x4868('0x37')]=qs['filters'](_['pick'](_0x2cc46a[_0x4868('0x2e')],_0x2ccf2a[_0x4868('0x38')]),_0x4e21fc);if(_0x2cc46a[_0x4868('0x2e')][_0x4868('0x39')]){_0x1db08b[_0x4868('0x37')]=_[_0x4868('0x3a')](_0x1db08b[_0x4868('0x37')],{'$or':_[_0x4868('0x2a')](_0x4e21fc,function(_0x29f246){if(_0x29f246[_0x4868('0x3b')]!==_0x4868('0x3c')){var _0x1dde0b={};_0x1dde0b[_0x29f246[_0x4868('0x27')]]={'$like':'%'+_0x2cc46a[_0x4868('0x2e')][_0x4868('0x39')]+'%'};return _0x1dde0b;}})});}_0x1db08b=_['merge']({},_0x1db08b,_0x2cc46a['options']);var _0x1c97e3={'where':_0x1db08b[_0x4868('0x37')]};return db[_0x4868('0x2b')][_0x4868('0x1d')](_0x1c97e3)[_0x4868('0x23')](function(_0x2c5c4b){_0x508388[_0x4868('0x1d')]=_0x2c5c4b;if(_0x2cc46a['query'][_0x4868('0x3d')]){_0x1db08b['include']=[{'all':!![]}];}return db[_0x4868('0x2b')][_0x4868('0x3e')](_0x1db08b);})[_0x4868('0x23')](function(_0x15c764){_0x508388[_0x4868('0x3f')]=_0x15c764;return _0x508388;})[_0x4868('0x23')](respondWithFilteredResult(_0x71b1bb,_0x1db08b))[_0x4868('0x40')](handleError(_0x71b1bb,null));};exports['show']=function(_0x56fb2a,_0x174342){var _0x3ef8d6={'raw':![],'where':{'id':_0x56fb2a[_0x4868('0x41')]['id']}},_0x10e644={};_0x10e644[_0x4868('0x2d')]=_[_0x4868('0x2f')](db[_0x4868('0x2b')][_0x4868('0x2c')]);_0x10e644[_0x4868('0x2e')]=_[_0x4868('0x2f')](_0x56fb2a['query']);_0x10e644[_0x4868('0x38')]=_[_0x4868('0x30')](_0x10e644[_0x4868('0x2d')],_0x10e644[_0x4868('0x2e')]);_0x3ef8d6[_0x4868('0x32')]=_[_0x4868('0x30')](_0x10e644[_0x4868('0x2d')],qs[_0x4868('0x31')](_0x56fb2a[_0x4868('0x2e')]['fields']));_0x3ef8d6['attributes']=_0x3ef8d6['attributes'][_0x4868('0x33')]?_0x3ef8d6[_0x4868('0x32')]:_0x10e644[_0x4868('0x2d')];if(_0x56fb2a[_0x4868('0x2e')][_0x4868('0x3d')]){_0x3ef8d6[_0x4868('0x42')]=[{'all':!![]}];}_0x3ef8d6=_[_0x4868('0x3a')]({},_0x3ef8d6,_0x56fb2a['options']);return db[_0x4868('0x2b')]['find'](_0x3ef8d6)[_0x4868('0x23')](handleEntityNotFound(_0x174342,null))['then'](respondWithResult(_0x174342,null))[_0x4868('0x40')](handleError(_0x174342,null));};exports[_0x4868('0x43')]=function(_0xe31f8c,_0x4711fe){return db[_0x4868('0x2b')]['create'](_0xe31f8c[_0x4868('0x44')],{})[_0x4868('0x23')](respondWithResult(_0x4711fe,0xc9))['catch'](handleError(_0x4711fe,null));};exports[_0x4868('0x45')]=function(_0xd9e344,_0x156bb4){if(_0xd9e344['body']['id']){delete _0xd9e344[_0x4868('0x44')]['id'];}return db[_0x4868('0x2b')]['find']({'where':{'id':_0xd9e344[_0x4868('0x41')]['id']}})[_0x4868('0x23')](handleEntityNotFound(_0x156bb4,null))[_0x4868('0x23')](saveUpdates(_0xd9e344['body'],null))[_0x4868('0x23')](respondWithResult(_0x156bb4,null))[_0x4868('0x40')](handleError(_0x156bb4,null));};exports['destroy']=function(_0x43ca50,_0x160af9){return db[_0x4868('0x2b')][_0x4868('0x46')]({'where':{'id':_0x43ca50[_0x4868('0x41')]['id']}})[_0x4868('0x23')](handleEntityNotFound(_0x160af9,null))[_0x4868('0x23')](removeEntity(_0x160af9,null))['catch'](handleError(_0x160af9,null));};exports['getConfigurations']=function(_0x4a838d,_0x54b514,_0x4275da){var _0x2d7a98={};var _0x22e478={};var _0x511826;var _0x51c550;return db[_0x4868('0x2b')]['findOne']({'where':{'id':_0x4a838d[_0x4868('0x41')]['id']}})[_0x4868('0x23')](handleEntityNotFound(_0x54b514,null))['then'](function(_0x114800){if(_0x114800){_0x511826=_0x114800;_0x22e478['model']=_[_0x4868('0x2f')](db[_0x4868('0x47')]['rawAttributes']);_0x22e478[_0x4868('0x2e')]=_[_0x4868('0x2f')](_0x4a838d[_0x4868('0x2e')]);_0x22e478[_0x4868('0x38')]=_['intersection'](_0x22e478[_0x4868('0x2d')],_0x22e478['query']);_0x2d7a98[_0x4868('0x32')]=_['intersection'](_0x22e478[_0x4868('0x2d')],qs[_0x4868('0x31')](_0x4a838d['query'][_0x4868('0x31')]));_0x2d7a98[_0x4868('0x32')]=_0x2d7a98[_0x4868('0x32')][_0x4868('0x33')]?_0x2d7a98[_0x4868('0x32')]:_0x22e478[_0x4868('0x2d')];_0x2d7a98[_0x4868('0x35')]=qs['sort'](_0x4a838d[_0x4868('0x2e')][_0x4868('0x36')]);_0x2d7a98[_0x4868('0x37')]=qs['filters'](_[_0x4868('0x48')](_0x4a838d[_0x4868('0x2e')],_0x22e478[_0x4868('0x38')]));if(_0x4a838d[_0x4868('0x2e')]['filter']){_0x2d7a98['where']=_[_0x4868('0x3a')](_0x2d7a98[_0x4868('0x37')],{'$or':_[_0x4868('0x2a')](_0x2d7a98['attributes'],function(_0x38b523){var _0x394f0d={};_0x394f0d[_0x38b523]={'$like':'%'+_0x4a838d[_0x4868('0x2e')][_0x4868('0x39')]+'%'};return _0x394f0d;})});}_0x2d7a98=_[_0x4868('0x3a')]({},_0x2d7a98,_0x4a838d[_0x4868('0x49')]);return _0x511826[_0x4868('0x4a')](_0x2d7a98);}})[_0x4868('0x23')](function(_0xec901){if(_0xec901){_0x51c550=_0xec901['length'];if(!_0x4a838d[_0x4868('0x2e')]['hasOwnProperty']('nolimit')){_0x2d7a98[_0x4868('0x1e')]=qs[_0x4868('0x1e')](_0x4a838d[_0x4868('0x2e')][_0x4868('0x1e')]);_0x2d7a98[_0x4868('0x1b')]=qs[_0x4868('0x1b')](_0x4a838d[_0x4868('0x2e')]['offset']);}return _0x511826[_0x4868('0x4a')](_0x2d7a98);}})['then'](function(_0x53a83b){if(_0x53a83b){return _0x53a83b?{'count':_0x51c550,'rows':_0x53a83b}:null;}})[_0x4868('0x23')](respondWithResult(_0x54b514,null))['catch'](handleError(_0x54b514,null));};exports['addConfiguration']=function(_0x422274,_0x1c75db,_0x523227){if(_0x422274[_0x4868('0x44')]['id']){delete _0x422274['body']['id'];}return db['ZohoAccount'][_0x4868('0x4b')]({'where':{'id':_0x422274[_0x4868('0x41')]['id']}})[_0x4868('0x23')](handleEntityNotFound(_0x1c75db,null))[_0x4868('0x23')](function(_0x139594){if(_0x139594){_0x422274[_0x4868('0x44')][_0x4868('0x4c')]=_0x139594['id'];_0x422274['body'][_0x4868('0x4d')]=integrations['getSubjects'](_0x422274[_0x4868('0x44')][_0x4868('0x4e')],_0x422274[_0x4868('0x44')][_0x4868('0x3b')]);_0x422274[_0x4868('0x44')][_0x4868('0x4f')]=integrations[_0x4868('0x50')](_0x422274[_0x4868('0x44')][_0x4868('0x4e')],_0x422274['body'][_0x4868('0x3b')]);return db[_0x4868('0x47')][_0x4868('0x43')](_0x422274[_0x4868('0x44')],{'include':[{'model':db[_0x4868('0x51')],'as':_0x4868('0x4d')},{'model':db[_0x4868('0x51')],'as':_0x4868('0x4f')}]});}return null;})[_0x4868('0x23')](respondWithResult(_0x1c75db,null))[_0x4868('0x40')](handleError(_0x1c75db,null));};function getAccessToken(_0x78a192){return new Promise(function(_0x25bdbc,_0x20e357){var _0x491505;switch(_0x78a192[_0x4868('0x52')]){case'US':_0x491505=_0x4868('0x53');break;case'AU':_0x491505=_0x4868('0x54');break;case'EU':_0x491505=_0x4868('0x55');break;case'IN':_0x491505=_0x4868('0x56');break;case'CN':_0x491505=_0x4868('0x57');break;default:_0x491505=_0x4868('0x55');break;}var _0x5d8e8a={'method':_0x4868('0x58'),'uri':_0x491505+_0x4868('0x59'),'qs':{'refresh_token':_0x78a192[_0x4868('0x5a')],'client_id':_0x78a192['clientId'],'client_secret':_0x78a192['clientSecret'],'grant_type':_0x4868('0x5b')},'json':!![]};return rp(_0x5d8e8a)['then'](function(_0x3c0b9e){if(_0x3c0b9e[_0x4868('0x5c')]){_0x25bdbc(_0x3c0b9e['access_token']);}else{_0x20e357(_0x4868('0x5d'));}})[_0x4868('0x40')](function(_0x43fbf3){_0x20e357(_0x43fbf3);});});}exports['getFields']=function(_0x2cacf1,_0x390205,_0x570eec){var _0x4950c1,_0x57e881,_0x2ff6f8,_0x3eee09,_0x53c921;return db[_0x4868('0x2b')][_0x4868('0x4b')]({'where':{'id':_0x2cacf1[_0x4868('0x41')]['id']},'attributes':['id',_0x4868('0x5e'),_0x4868('0x52'),_0x4868('0x5f'),_0x4868('0x60'),_0x4868('0x61'),'code',_0x4868('0x5a')]})[_0x4868('0x23')](handleEntityNotFound(_0x390205,null))[_0x4868('0x23')](function(_0xfa5aaa){_0x53c921=_0xfa5aaa;_0x4950c1=_0x53c921['host'];_0x57e881=_0x4950c1===_0x4868('0x62')?'eu':_0x4868('0x63');_0x2ff6f8=_0x53c921['serverUrl'];var _0x3c4f35=_0x2ff6f8[_0x4868('0x64')](-0x1);if(_0x3c4f35==='/'||_0x3c4f35==='\x5c'||_0x3c4f35===':'){_0x2ff6f8=_0x2ff6f8[_0x4868('0x65')](0x0,_0x2ff6f8['lastIndexOf'](_0x3c4f35));}if(!_0x53c921[_0x4868('0x5a')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x53c921);})[_0x4868('0x23')](function(_0xdb0ad){if(_0xdb0ad){return rp({'method':_0x4868('0x66'),'uri':util[_0x4868('0x67')](_0x4868('0x68'),_0x57e881),'qs':{'module':_0x4868('0x69')},'headers':{'Authorization':_0x4868('0x6a')+_0xdb0ad},'json':!![]});}})[_0x4868('0x23')](function(_0x2bf9f8){if(_0x2bf9f8){if(_0x2bf9f8[_0x4868('0x6b')]&&_0x2bf9f8[_0x4868('0x6b')]['error']){throw new Error(_0x2bf9f8[_0x4868('0x6b')][_0x4868('0x25')]['message']);}var _0x3150ce=[];var _0x48a0ce=[];var _0x2d47a0=[_0x4868('0x6c'),_0x4868('0x6d'),_0x4868('0x6e'),_0x4868('0x6f'),_0x4868('0x70'),'Call_Result',_0x4868('0x71'),_0x4868('0x72')];_0x48a0ce=_[_0x4868('0x73')](_0x2bf9f8['fields'],function(_0xde51b){return _0x2d47a0['includes'](_0xde51b[_0x4868('0x74')]);});for(var _0x24a1aa=0x0;_0x24a1aa<_0x48a0ce['length'];_0x24a1aa++){if(_0x48a0ce[_0x24a1aa][_0x4868('0x75')]===![]){_0x3150ce[_0x4868('0x76')]({'id':_0x48a0ce[_0x24a1aa]['id'],'name':_0x48a0ce[_0x24a1aa][_0x4868('0x77')],'custom':_0x48a0ce[_0x24a1aa][_0x4868('0x78')],'options':_0x48a0ce[_0x24a1aa][_0x4868('0x79')]==='picklist'&&_0x48a0ce[_0x24a1aa][_0x4868('0x7a')][_0x4868('0x33')]>-0x1?_[_0x4868('0x2a')](_0x48a0ce[_0x24a1aa][_0x4868('0x7a')],function(_0x469b13){return{'name':_0x469b13,'value':_0x469b13};}):[]});}}return{'count':_0x3150ce['length'],'rows':_0x3150ce};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x390205,null))[_0x4868('0x40')](function(_0x1bda4f){var _0x3fe55a=_0x2cacf1['query'][_0x4868('0x7b')]?0x1f4:_0x1bda4f['statusCode']||0x1f4;logger[_0x4868('0x25')](_0x4868('0x7c'),_0x4868('0x7d'),_0x3fe55a,JSON[_0x4868('0x7e')](_0x1bda4f));delete _0x1bda4f[_0x4868('0x27')];if(_0x3fe55a===0x191){_0x3fe55a=0x190;}_0x390205[_0x4868('0x19')](_0x3fe55a)['send'](_0x2cacf1[_0x4868('0x2e')][_0x4868('0x7b')]?{'message':_0x4868('0x7f'),'statusCode':_0x1bda4f[_0x4868('0x80')]}:_0x1bda4f);});};
\ No newline at end of file
index 355b505..1575b6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b4e=['refreshToken','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf','authorization_code','application/x-www-form-urlencoded','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','code','parse'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x4b4e,0xef));var _0xe4b4=function(_0x299be4,_0x146234){_0x299be4=_0x299be4-0x0;var _0x36f2e7=_0x4b4e[_0x299be4];return _0x36f2e7;};'use strict';var _=require(_0xe4b4('0x0'));var util=require(_0xe4b4('0x1'));var logger=require(_0xe4b4('0x2'))(_0xe4b4('0x3'));var moment=require(_0xe4b4('0x4'));var BPromise=require(_0xe4b4('0x5'));var rp=require(_0xe4b4('0x6'));var fs=require('fs');var path=require(_0xe4b4('0x7'));var rimraf=require(_0xe4b4('0x8'));var config=require(_0xe4b4('0x9'));var attributes=require(_0xe4b4('0xa'));var integrations=require(_0xe4b4('0xb'));module['exports']=function(_0x1b0e3f,_0xe1868e){return _0x1b0e3f[_0xe4b4('0xc')](_0xe4b4('0xd'),attributes,{'tableName':_0xe4b4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x491b61,_0x35a3ee,_0x2f5def){if(_0x491b61[_0xe4b4('0xf')](_0xe4b4('0x10'))||_0x491b61[_0xe4b4('0xf')](_0xe4b4('0x11'))||_0x491b61[_0xe4b4('0xf')](_0xe4b4('0x12'))||_0x491b61[_0xe4b4('0xf')](_0xe4b4('0x13'))||_0x491b61[_0xe4b4('0xf')]('code')||_0x491b61[_0xe4b4('0xf')](_0xe4b4('0x14'))){var _0xd58f16,_0x4687ff;_0xd58f16=_0x491b61['serverUrl'];var _0x288179=_0xd58f16[_0xe4b4('0x15')](-0x1);if(_0x288179==='/'||_0x288179==='\x5c'||_0x288179===':'){_0xd58f16=_0xd58f16[_0xe4b4('0x16')](0x0,_0xd58f16['lastIndexOf'](_0x288179));}switch(_0x491b61[_0xe4b4('0x10')]){case'US':_0x4687ff=_0xe4b4('0x17');break;case'AU':_0x4687ff=_0xe4b4('0x18');break;case'IN':_0x4687ff=_0xe4b4('0x19');break;case'CN':_0x4687ff=_0xe4b4('0x1a');break;default:_0x4687ff='https://accounts.zoho.eu';break;}var _0x1b5915={'method':_0xe4b4('0x1b'),'uri':_0x4687ff+_0xe4b4('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x491b61['clientId'],'client_secret':_0x491b61[_0xe4b4('0x13')],'redirect_uri':_0x491b61[_0xe4b4('0x11')],'code':_0x491b61[_0xe4b4('0x1d')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1b5915)['then'](function(_0x1d8e21){var _0x280619=JSON[_0xe4b4('0x1e')](_0x1d8e21);if(_0x280619['refresh_token']){_0x491b61[_0xe4b4('0x1f')]=_0x280619[_0xe4b4('0x20')];logger[_0xe4b4('0x21')](util['format'](_0xe4b4('0x22'),_0x491b61[_0xe4b4('0x23')],_0x491b61['id']));}else{logger[_0xe4b4('0x24')](util[_0xe4b4('0x25')](_0xe4b4('0x26'),_0x491b61['name'],_0x491b61['id']),util[_0xe4b4('0x27')](_0x280619,{'showHidden':![],'depth':null}));}return _0x2f5def(null,_0x35a3ee);})[_0xe4b4('0x28')](function(_0x2bef40){logger[_0xe4b4('0x24')](util[_0xe4b4('0x25')](_0xe4b4('0x26'),_0x491b61['name'],_0x491b61['id']),util[_0xe4b4('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x2f5def(_0x2bef40);});}else{return _0x2f5def(null,_0x35a3ee);}},'beforeUpdate':function(_0x138ffb,_0x4145b5,_0x3f90e1){if(_0x138ffb['changed'](_0xe4b4('0x10'))||_0x138ffb[_0xe4b4('0xf')](_0xe4b4('0x11'))||_0x138ffb['changed'](_0xe4b4('0x12'))||_0x138ffb['changed'](_0xe4b4('0x13'))||_0x138ffb[_0xe4b4('0xf')](_0xe4b4('0x1d'))||_0x138ffb[_0xe4b4('0xf')](_0xe4b4('0x14'))){var _0x636d29,_0x2a9fe2;_0x636d29=_0x138ffb[_0xe4b4('0x11')];var _0x5b3077=_0x636d29[_0xe4b4('0x15')](-0x1);if(_0x5b3077==='/'||_0x5b3077==='\x5c'||_0x5b3077===':'){_0x636d29=_0x636d29[_0xe4b4('0x16')](0x0,_0x636d29[_0xe4b4('0x29')](_0x5b3077));}switch(_0x138ffb[_0xe4b4('0x10')]){case'US':_0x2a9fe2=_0xe4b4('0x17');break;case'AU':_0x2a9fe2=_0xe4b4('0x18');break;case'IN':_0x2a9fe2=_0xe4b4('0x19');break;case'CN':_0x2a9fe2=_0xe4b4('0x1a');break;default:_0x2a9fe2='https://accounts.zoho.eu';break;}var _0x5764a9={'method':_0xe4b4('0x1b'),'uri':_0x2a9fe2+_0xe4b4('0x1c'),'form':{'grant_type':_0xe4b4('0x2a'),'client_id':_0x138ffb[_0xe4b4('0x12')],'client_secret':_0x138ffb[_0xe4b4('0x13')],'redirect_uri':_0x138ffb[_0xe4b4('0x11')],'code':_0x138ffb[_0xe4b4('0x1d')]},'headers':{'Content-Type':_0xe4b4('0x2b')}};return rp(_0x5764a9)[_0xe4b4('0x2c')](function(_0x2abd6c){var _0x24e0cc=JSON[_0xe4b4('0x1e')](_0x2abd6c);if(_0x24e0cc['refresh_token']){_0x138ffb['refreshToken']=_0x24e0cc['refresh_token'];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x138ffb[_0xe4b4('0x23')],_0x138ffb['id']));}else{logger[_0xe4b4('0x24')](util[_0xe4b4('0x25')](_0xe4b4('0x26'),_0x138ffb[_0xe4b4('0x23')],_0x138ffb['id']),util[_0xe4b4('0x27')](_0x24e0cc,{'showHidden':![],'depth':null}));}return _0x3f90e1(null,_0x4145b5);})[_0xe4b4('0x28')](function(_0x36a73e){logger[_0xe4b4('0x24')](util[_0xe4b4('0x25')](_0xe4b4('0x26'),_0x138ffb[_0xe4b4('0x23')],_0x138ffb['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3f90e1(_0x36a73e);});}else{return _0x3f90e1(null,_0x4145b5);}}}});};
\ No newline at end of file
+var _0x8f0e=['code','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','substring','https://accounts.zoho.com.au','/oauth/v2/token','refreshToken','catch','error','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x8f0e,0x1da));var _0xe8f0=function(_0x57c925,_0x50cd5e){_0x57c925=_0x57c925-0x0;var _0xd4be18=_0x8f0e[_0x57c925];return _0xd4be18;};'use strict';var _=require(_0xe8f0('0x0'));var util=require(_0xe8f0('0x1'));var logger=require(_0xe8f0('0x2'))(_0xe8f0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8f0('0x4'));var fs=require('fs');var path=require(_0xe8f0('0x5'));var rimraf=require(_0xe8f0('0x6'));var config=require(_0xe8f0('0x7'));var attributes=require(_0xe8f0('0x8'));var integrations=require(_0xe8f0('0x9'));module['exports']=function(_0x315ecd,_0x783213){return _0x315ecd[_0xe8f0('0xa')](_0xe8f0('0xb'),attributes,{'tableName':_0xe8f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x579c7b,_0x2055ed,_0xedb2a0){if(_0x579c7b[_0xe8f0('0xd')](_0xe8f0('0xe'))||_0x579c7b[_0xe8f0('0xd')](_0xe8f0('0xf'))||_0x579c7b[_0xe8f0('0xd')](_0xe8f0('0x10'))||_0x579c7b[_0xe8f0('0xd')](_0xe8f0('0x11'))||_0x579c7b['changed'](_0xe8f0('0x12'))||_0x579c7b['changed']('host')){var _0x5ae508,_0x2e7516;_0x5ae508=_0x579c7b['serverUrl'];var _0x476665=_0x5ae508[_0xe8f0('0x13')](-0x1);if(_0x476665==='/'||_0x476665==='\x5c'||_0x476665===':'){_0x5ae508=_0x5ae508['substring'](0x0,_0x5ae508['lastIndexOf'](_0x476665));}switch(_0x579c7b['zone']){case'US':_0x2e7516=_0xe8f0('0x14');break;case'AU':_0x2e7516='https://accounts.zoho.com.au';break;case'IN':_0x2e7516='https://accounts.zoho.in';break;case'CN':_0x2e7516=_0xe8f0('0x15');break;default:_0x2e7516=_0xe8f0('0x16');break;}var _0x517572={'method':_0xe8f0('0x17'),'uri':_0x2e7516+'/oauth/v2/token','form':{'grant_type':_0xe8f0('0x18'),'client_id':_0x579c7b[_0xe8f0('0x10')],'client_secret':_0x579c7b[_0xe8f0('0x11')],'redirect_uri':_0x579c7b[_0xe8f0('0xf')],'code':_0x579c7b[_0xe8f0('0x12')]},'headers':{'Content-Type':_0xe8f0('0x19')}};return rp(_0x517572)[_0xe8f0('0x1a')](function(_0x3d983a){var _0x43a5f4=JSON[_0xe8f0('0x1b')](_0x3d983a);if(_0x43a5f4[_0xe8f0('0x1c')]){_0x579c7b['refreshToken']=_0x43a5f4[_0xe8f0('0x1c')];logger[_0xe8f0('0x1d')](util['format'](_0xe8f0('0x1e'),_0x579c7b[_0xe8f0('0x1f')],_0x579c7b['id']));}else{logger['error'](util[_0xe8f0('0x20')](_0xe8f0('0x21'),_0x579c7b[_0xe8f0('0x1f')],_0x579c7b['id']),util[_0xe8f0('0x22')](_0x43a5f4,{'showHidden':![],'depth':null}));}return _0xedb2a0(null,_0x2055ed);})['catch'](function(_0x296524){logger['error'](util['format'](_0xe8f0('0x21'),_0x579c7b[_0xe8f0('0x1f')],_0x579c7b['id']),util[_0xe8f0('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0xedb2a0(_0x296524);});}else{return _0xedb2a0(null,_0x2055ed);}},'beforeUpdate':function(_0x529630,_0x417387,_0x27fd68){if(_0x529630['changed'](_0xe8f0('0xe'))||_0x529630[_0xe8f0('0xd')]('serverUrl')||_0x529630[_0xe8f0('0xd')](_0xe8f0('0x10'))||_0x529630['changed']('clientSecret')||_0x529630[_0xe8f0('0xd')](_0xe8f0('0x12'))||_0x529630['changed']('host')){var _0x100443,_0x18088d;_0x100443=_0x529630[_0xe8f0('0xf')];var _0x5071ef=_0x100443[_0xe8f0('0x13')](-0x1);if(_0x5071ef==='/'||_0x5071ef==='\x5c'||_0x5071ef===':'){_0x100443=_0x100443[_0xe8f0('0x23')](0x0,_0x100443['lastIndexOf'](_0x5071ef));}switch(_0x529630[_0xe8f0('0xe')]){case'US':_0x18088d='https://accounts.zoho.com';break;case'AU':_0x18088d=_0xe8f0('0x24');break;case'IN':_0x18088d='https://accounts.zoho.in';break;case'CN':_0x18088d=_0xe8f0('0x15');break;default:_0x18088d=_0xe8f0('0x16');break;}var _0x23faba={'method':_0xe8f0('0x17'),'uri':_0x18088d+_0xe8f0('0x25'),'form':{'grant_type':_0xe8f0('0x18'),'client_id':_0x529630['clientId'],'client_secret':_0x529630['clientSecret'],'redirect_uri':_0x529630[_0xe8f0('0xf')],'code':_0x529630[_0xe8f0('0x12')]},'headers':{'Content-Type':_0xe8f0('0x19')}};return rp(_0x23faba)[_0xe8f0('0x1a')](function(_0x4fe049){var _0x4dc69b=JSON[_0xe8f0('0x1b')](_0x4fe049);if(_0x4dc69b[_0xe8f0('0x1c')]){_0x529630[_0xe8f0('0x26')]=_0x4dc69b[_0xe8f0('0x1c')];logger['info'](util[_0xe8f0('0x20')](_0xe8f0('0x1e'),_0x529630['name'],_0x529630['id']));}else{logger['error'](util[_0xe8f0('0x20')](_0xe8f0('0x21'),_0x529630[_0xe8f0('0x1f')],_0x529630['id']),util[_0xe8f0('0x22')](_0x4dc69b,{'showHidden':![],'depth':null}));}return _0x27fd68(null,_0x417387);})[_0xe8f0('0x27')](function(_0x5da644){logger[_0xe8f0('0x28')](util[_0xe8f0('0x20')](_0xe8f0('0x21'),_0x529630[_0xe8f0('0x1f')],_0x529630['id']),util[_0xe8f0('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x27fd68(_0x5da644);});}else{return _0x27fd68(null,_0x417387);}}}});};
\ No newline at end of file
index 022e87f..1d44788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0936=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','ZohoAccount','find'];(function(_0x3f3053,_0x3940c9){var _0x105221=function(_0x98d89){while(--_0x98d89){_0x3f3053['push'](_0x3f3053['shift']());}};_0x105221(++_0x3940c9);}(_0x0936,0xde));var _0x6093=function(_0x579344,_0x244053){_0x579344=_0x579344-0x0;var _0x5ba8ae=_0x0936[_0x579344];return _0x5ba8ae;};'use strict';var _=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var moment=require(_0x6093('0x2'));var BPromise=require(_0x6093('0x3'));var rs=require(_0x6093('0x4'));var fs=require('fs');var Redis=require(_0x6093('0x5'));var db=require(_0x6093('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6093('0x7'));var config=require(_0x6093('0x8'));var jayson=require(_0x6093('0x9'));var client=jayson[_0x6093('0xa')][_0x6093('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d812e,_0x478323,_0x54df66){return new BPromise(function(_0x5280b8,_0x219592){return client[_0x6093('0xc')](_0x7d812e,_0x54df66)[_0x6093('0xd')](function(_0x178aba){logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));logger[_0x6093('0x11')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x478323,'request\x20sent',JSON[_0x6093('0x12')](_0x178aba));if(_0x178aba[_0x6093('0x13')]){if(_0x178aba[_0x6093('0x13')][_0x6093('0x14')]===0x1f4){logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x219592(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x5280b8(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}else{logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));_0x5280b8(_0x178aba[_0x6093('0x16')][_0x6093('0x15')]);}})[_0x6093('0x17')](function(_0x5c8f2a){logger['error'](_0x6093('0xf'),_0x478323,_0x5c8f2a);_0x219592(_0x5c8f2a);});});}exports[_0x6093('0x18')]=function(_0x3403b7){var _0x13afe7=this;return new Promise(function(_0x37b62b,_0x429035){return db['ZohoAccount'][_0x6093('0x19')]({'raw':_0x3403b7[_0x6093('0x1a')]?_0x3403b7[_0x6093('0x1a')][_0x6093('0x1b')]===undefined?!![]:![]:!![],'where':_0x3403b7['options']?_0x3403b7[_0x6093('0x1a')][_0x6093('0x1c')]||null:null,'attributes':_0x3403b7['options']?_0x3403b7[_0x6093('0x1a')][_0x6093('0x1d')]||null:null,'limit':_0x3403b7[_0x6093('0x1a')]?_0x3403b7[_0x6093('0x1a')][_0x6093('0x1e')]||null:null,'include':_0x3403b7['options']?_0x3403b7[_0x6093('0x1a')][_0x6093('0x1f')]?_['map'](_0x3403b7[_0x6093('0x1a')][_0x6093('0x1f')],function(_0x4c1674){return{'model':db[_0x4c1674[_0x6093('0x20')]],'as':_0x4c1674['as'],'attributes':_0x4c1674['attributes'],'include':_0x4c1674['include']?_[_0x6093('0x21')](_0x4c1674[_0x6093('0x1f')],function(_0x543aed){return{'model':db[_0x543aed[_0x6093('0x20')]],'as':_0x543aed['as'],'attributes':_0x543aed['attributes'],'include':_0x543aed[_0x6093('0x1f')]?_[_0x6093('0x21')](_0x543aed[_0x6093('0x1f')],function(_0x158f62){return{'model':db[_0x158f62[_0x6093('0x20')]],'as':_0x158f62['as'],'attributes':_0x158f62[_0x6093('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6093('0xd')](function(_0x36cc99){logger[_0x6093('0xe')]('GetZohoAccount',_0x3403b7);logger[_0x6093('0x11')](_0x6093('0x18'),_0x3403b7,JSON[_0x6093('0x12')](_0x36cc99));_0x37b62b(_0x36cc99);})[_0x6093('0x17')](function(_0x44e657){logger[_0x6093('0x13')](_0x6093('0x18'),_0x44e657[_0x6093('0x15')],_0x3403b7);_0x429035(_0x13afe7[_0x6093('0x13')](0x1f4,_0x44e657[_0x6093('0x15')]));});});};exports[_0x6093('0x22')]=function(_0x49cd16){var _0x826889=this;return new Promise(function(_0x426e81,_0x1f96b8){return db[_0x6093('0x23')][_0x6093('0x24')]({'raw':_0x49cd16['options']?_0x49cd16[_0x6093('0x1a')][_0x6093('0x1b')]===undefined?!![]:![]:!![],'where':_0x49cd16[_0x6093('0x1a')]?_0x49cd16['options'][_0x6093('0x1c')]||null:null,'attributes':_0x49cd16['options']?_0x49cd16['options'][_0x6093('0x1d')]||null:null,'include':_0x49cd16[_0x6093('0x1a')]?_0x49cd16[_0x6093('0x1a')][_0x6093('0x1f')]?_[_0x6093('0x21')](_0x49cd16['options']['include'],function(_0x1bc4e3){return{'model':db[_0x1bc4e3[_0x6093('0x20')]],'as':_0x1bc4e3['as'],'attributes':_0x1bc4e3[_0x6093('0x1d')],'include':_0x1bc4e3[_0x6093('0x1f')]?_[_0x6093('0x21')](_0x1bc4e3[_0x6093('0x1f')],function(_0xf840b7){return{'model':db[_0xf840b7['model']],'as':_0xf840b7['as'],'attributes':_0xf840b7[_0x6093('0x1d')],'include':_0xf840b7[_0x6093('0x1f')]?_[_0x6093('0x21')](_0xf840b7[_0x6093('0x1f')],function(_0x3bfe4c){return{'model':db[_0x3bfe4c['model']],'as':_0x3bfe4c['as'],'attributes':_0x3bfe4c[_0x6093('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6093('0xd')](function(_0x328aa4){logger['info'](_0x6093('0x22'),_0x49cd16);logger[_0x6093('0x11')](_0x6093('0x22'),_0x49cd16,JSON[_0x6093('0x12')](_0x328aa4));_0x426e81(_0x328aa4);})[_0x6093('0x17')](function(_0xbce376){logger[_0x6093('0x13')](_0x6093('0x22'),_0xbce376['message'],_0x49cd16);_0x1f96b8(_0x826889[_0x6093('0x13')](0x1f4,_0xbce376['message']));});});};
\ No newline at end of file
+var _0xe8e8=['jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','find','ShowZohoAccount','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x63e8e5,_0x4cf70e){var _0x39fc05=function(_0x213824){while(--_0x213824){_0x63e8e5['push'](_0x63e8e5['shift']());}};_0x39fc05(++_0x4cf70e);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x49d5c6,_0x27c59c){_0x49d5c6=_0x49d5c6-0x0;var _0x521d80=_0xe8e8[_0x49d5c6];return _0x521d80;};'use strict';var _=require(_0x8e8e('0x0'));var util=require(_0x8e8e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e8e('0x2'));var fs=require('fs');var Redis=require(_0x8e8e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e8e('0x4'))('rpc');var config=require(_0x8e8e('0x5'));var jayson=require(_0x8e8e('0x6'));var client=jayson[_0x8e8e('0x7')][_0x8e8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x559147,_0x2d5ad4,_0x4edd6c){return new BPromise(function(_0x21703a,_0x35e125){return client[_0x8e8e('0x9')](_0x559147,_0x4edd6c)[_0x8e8e('0xa')](function(_0x40be2d){logger[_0x8e8e('0xb')](_0x8e8e('0xc'),_0x2d5ad4,'request\x20sent');logger[_0x8e8e('0xd')](_0x8e8e('0xe'),_0x2d5ad4,_0x8e8e('0xf'),JSON[_0x8e8e('0x10')](_0x40be2d));if(_0x40be2d['error']){if(_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x12')]===0x1f4){logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x13')]);return _0x35e125(_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x13')]);}logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x40be2d['error'][_0x8e8e('0x13')]);return _0x21703a(_0x40be2d[_0x8e8e('0x11')]['message']);}else{logger[_0x8e8e('0xb')](_0x8e8e('0xc'),_0x2d5ad4,'request\x20sent');_0x21703a(_0x40be2d[_0x8e8e('0x14')][_0x8e8e('0x13')]);}})[_0x8e8e('0x15')](function(_0x3b958a){logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x3b958a);_0x35e125(_0x3b958a);});});}exports[_0x8e8e('0x16')]=function(_0x27f7f6){var _0x17261d=this;return new Promise(function(_0xdbde13,_0x497b32){return db[_0x8e8e('0x17')][_0x8e8e('0x18')]({'raw':_0x27f7f6['options']?_0x27f7f6[_0x8e8e('0x19')][_0x8e8e('0x1a')]===undefined?!![]:![]:!![],'where':_0x27f7f6[_0x8e8e('0x19')]?_0x27f7f6[_0x8e8e('0x19')]['where']||null:null,'attributes':_0x27f7f6['options']?_0x27f7f6['options'][_0x8e8e('0x1b')]||null:null,'limit':_0x27f7f6[_0x8e8e('0x19')]?_0x27f7f6[_0x8e8e('0x19')][_0x8e8e('0x1c')]||null:null,'include':_0x27f7f6['options']?_0x27f7f6[_0x8e8e('0x19')][_0x8e8e('0x1d')]?_[_0x8e8e('0x1e')](_0x27f7f6['options'][_0x8e8e('0x1d')],function(_0x4c685e){return{'model':db[_0x4c685e['model']],'as':_0x4c685e['as'],'attributes':_0x4c685e[_0x8e8e('0x1b')],'include':_0x4c685e[_0x8e8e('0x1d')]?_['map'](_0x4c685e[_0x8e8e('0x1d')],function(_0x338f91){return{'model':db[_0x338f91[_0x8e8e('0x1f')]],'as':_0x338f91['as'],'attributes':_0x338f91[_0x8e8e('0x1b')],'include':_0x338f91['include']?_[_0x8e8e('0x1e')](_0x338f91[_0x8e8e('0x1d')],function(_0x1ca842){return{'model':db[_0x1ca842[_0x8e8e('0x1f')]],'as':_0x1ca842['as'],'attributes':_0x1ca842[_0x8e8e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8e8e('0xa')](function(_0x258f56){logger[_0x8e8e('0xb')](_0x8e8e('0x16'),_0x27f7f6);logger[_0x8e8e('0xd')]('GetZohoAccount',_0x27f7f6,JSON[_0x8e8e('0x10')](_0x258f56));_0xdbde13(_0x258f56);})[_0x8e8e('0x15')](function(_0x2536df){logger['error'](_0x8e8e('0x16'),_0x2536df[_0x8e8e('0x13')],_0x27f7f6);_0x497b32(_0x17261d[_0x8e8e('0x11')](0x1f4,_0x2536df[_0x8e8e('0x13')]));});});};exports['ShowZohoAccount']=function(_0x2bc5a5){var _0x17de8e=this;return new Promise(function(_0x12870b,_0x5d020d){return db[_0x8e8e('0x17')][_0x8e8e('0x20')]({'raw':_0x2bc5a5['options']?_0x2bc5a5[_0x8e8e('0x19')][_0x8e8e('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bc5a5['options']?_0x2bc5a5['options']['where']||null:null,'attributes':_0x2bc5a5[_0x8e8e('0x19')]?_0x2bc5a5[_0x8e8e('0x19')][_0x8e8e('0x1b')]||null:null,'include':_0x2bc5a5[_0x8e8e('0x19')]?_0x2bc5a5['options'][_0x8e8e('0x1d')]?_['map'](_0x2bc5a5['options'][_0x8e8e('0x1d')],function(_0x12d62c){return{'model':db[_0x12d62c['model']],'as':_0x12d62c['as'],'attributes':_0x12d62c[_0x8e8e('0x1b')],'include':_0x12d62c[_0x8e8e('0x1d')]?_['map'](_0x12d62c[_0x8e8e('0x1d')],function(_0x3b53b5){return{'model':db[_0x3b53b5[_0x8e8e('0x1f')]],'as':_0x3b53b5['as'],'attributes':_0x3b53b5[_0x8e8e('0x1b')],'include':_0x3b53b5[_0x8e8e('0x1d')]?_[_0x8e8e('0x1e')](_0x3b53b5[_0x8e8e('0x1d')],function(_0x2fddf4){return{'model':db[_0x2fddf4[_0x8e8e('0x1f')]],'as':_0x2fddf4['as'],'attributes':_0x2fddf4[_0x8e8e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8e8e('0xa')](function(_0x508943){logger[_0x8e8e('0xb')]('ShowZohoAccount',_0x2bc5a5);logger[_0x8e8e('0xd')](_0x8e8e('0x21'),_0x2bc5a5,JSON[_0x8e8e('0x10')](_0x508943));_0x12870b(_0x508943);})[_0x8e8e('0x15')](function(_0x3fea55){logger['error'](_0x8e8e('0x21'),_0x3fea55['message'],_0x2bc5a5);_0x5d020d(_0x17de8e[_0x8e8e('0x11')](0x1f4,_0x3fea55[_0x8e8e('0x13')]));});});};
\ No newline at end of file
index b4f3f07..c50b8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a5c=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x1bef73,_0x26b098){var _0x3c655a=function(_0x1fc424){while(--_0x1fc424){_0x1bef73['push'](_0x1bef73['shift']());}};_0x3c655a(++_0x26b098);}(_0x4a5c,0x110));var _0xc4a5=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0x4a5c[_0x2c534a];return _0x3f5c99;};'use strict';var multer=require(_0xc4a5('0x0'));var util=require(_0xc4a5('0x1'));var path=require(_0xc4a5('0x2'));var timeout=require(_0xc4a5('0x3'));var express=require(_0xc4a5('0x4'));var router=express[_0xc4a5('0x5')]();var fs_extra=require(_0xc4a5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc4a5('0x7'));var config=require(_0xc4a5('0x8'));var controller=require(_0xc4a5('0x9'));router[_0xc4a5('0xa')]('/',auth[_0xc4a5('0xb')](),controller[_0xc4a5('0xc')]);router[_0xc4a5('0xa')]('/:id',auth[_0xc4a5('0xb')](),controller['show']);router[_0xc4a5('0xa')](_0xc4a5('0xd'),auth[_0xc4a5('0xb')](),controller[_0xc4a5('0xe')]);router[_0xc4a5('0xa')](_0xc4a5('0xf'),auth[_0xc4a5('0xb')](),controller[_0xc4a5('0x10')]);router['get'](_0xc4a5('0x11'),auth[_0xc4a5('0xb')](),controller[_0xc4a5('0x12')]);router[_0xc4a5('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc4a5('0x14')](_0xc4a5('0x15'),auth['isAuthenticated'](),controller[_0xc4a5('0x16')]);router['delete']('/:id',auth[_0xc4a5('0xb')](),controller[_0xc4a5('0x17')]);module[_0xc4a5('0x18')]=router;
\ No newline at end of file
+var _0xb0e2=['post','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','/:id','show','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb0e2,0x138));var _0x2b0e=function(_0x40c0c7,_0x35a35d){_0x40c0c7=_0x40c0c7-0x0;var _0x14feaf=_0xb0e2[_0x40c0c7];return _0x14feaf;};'use strict';var multer=require('multer');var util=require(_0x2b0e('0x0'));var path=require(_0x2b0e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b0e('0x2'));var router=express[_0x2b0e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b0e('0x4'));var interaction=require(_0x2b0e('0x5'));var config=require(_0x2b0e('0x6'));var controller=require(_0x2b0e('0x7'));router['get']('/',auth[_0x2b0e('0x8')](),controller[_0x2b0e('0x9')]);router['get'](_0x2b0e('0xa'),auth['isAuthenticated'](),controller[_0x2b0e('0xb')]);router[_0x2b0e('0xc')]('/:id/fields',auth[_0x2b0e('0x8')](),controller[_0x2b0e('0xd')]);router[_0x2b0e('0xc')](_0x2b0e('0xe'),auth[_0x2b0e('0x8')](),controller[_0x2b0e('0xf')]);router[_0x2b0e('0xc')](_0x2b0e('0x10'),auth['isAuthenticated'](),controller[_0x2b0e('0x11')]);router[_0x2b0e('0x12')]('/',auth[_0x2b0e('0x8')](),controller['create']);router['put']('/:id',auth[_0x2b0e('0x8')](),controller[_0x2b0e('0x13')]);router[_0x2b0e('0x14')](_0x2b0e('0xa'),auth[_0x2b0e('0x8')](),controller['destroy']);module[_0x2b0e('0x15')]=router;
\ No newline at end of file
index 9266886..c397928 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe10b=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0xe10b,0x1b0));var _0xbe10=function(_0x2beddc,_0x6e05fb){_0x2beddc=_0x2beddc-0x0;var _0x40cac2=_0xe10b[_0x2beddc];return _0x40cac2;};'use strict';var Sequelize=require(_0xbe10('0x0'));module[_0xbe10('0x1')]={'name':{'type':Sequelize[_0xbe10('0x2')]},'moduleCreate':{'type':Sequelize[_0xbe10('0x3')](_0xbe10('0x4'),_0xbe10('0x5'),_0xbe10('0x6')),'defaultValue':_0xbe10('0x4')},'moduleSearch':{'type':Sequelize[_0xbe10('0x3')](_0xbe10('0x7'),_0xbe10('0x5'),'lead'),'defaultValue':_0xbe10('0x7')},'description':{'type':Sequelize[_0xbe10('0x2')]}};
\ No newline at end of file
+var _0xd61f=['nothing','ENUM','contact_lead','sequelize','exports','STRING','lead','contact'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd61f,0x113));var _0xfd61=function(_0x148ba4,_0x4baf46){_0x148ba4=_0x148ba4-0x0;var _0x10d205=_0xd61f[_0x148ba4];return _0x10d205;};'use strict';var Sequelize=require(_0xfd61('0x0'));module[_0xfd61('0x1')]={'name':{'type':Sequelize[_0xfd61('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xfd61('0x3'),_0xfd61('0x4'),_0xfd61('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xfd61('0x6')](_0xfd61('0x7'),_0xfd61('0x4'),_0xfd61('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xfd61('0x2')]}};
\ No newline at end of file
index 11a0b67..0dee447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26fb=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','params','rawAttributes','include','find','create','body','catch','getFields','ZohoField','getSubjects','findOne','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1cd517,_0x3ca47e){var _0x415ecc=function(_0x5c1b95){while(--_0x5c1b95){_0x1cd517['push'](_0x1cd517['shift']());}};_0x415ecc(++_0x3ca47e);}(_0x26fb,0x13f));var _0xb26f=function(_0x4055df,_0x2846aa){_0x4055df=_0x4055df-0x0;var _0x1301b6=_0x26fb[_0x4055df];return _0x1301b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb26f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb26f('0x1'));var rp=require(_0xb26f('0x2'));var moment=require(_0xb26f('0x3'));var BPromise=require(_0xb26f('0x4'));var Mustache=require(_0xb26f('0x5'));var util=require(_0xb26f('0x6'));var path=require('path');var sox=require(_0xb26f('0x7'));var csv=require(_0xb26f('0x8'));var ejs=require(_0xb26f('0x9'));var fs=require('fs');var fs_extra=require(_0xb26f('0xa'));var _=require(_0xb26f('0xb'));var squel=require(_0xb26f('0xc'));var crypto=require(_0xb26f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb26f('0xe'));var toCsv=require(_0xb26f('0x8'));var querystring=require(_0xb26f('0xf'));var Papa=require(_0xb26f('0x10'));var Redis=require('ioredis');var authService=require(_0xb26f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb26f('0x12'));var hardwareService=require(_0xb26f('0x13'));var logger=require(_0xb26f('0x14'))(_0xb26f('0x15'));var utils=require(_0xb26f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb26f('0x17'));var db=require(_0xb26f('0x18'))['db'];function respondWithStatusCode(_0x2cae3d,_0x11efcf){_0x11efcf=_0x11efcf||0xcc;return function(_0x4f6167){if(_0x4f6167){return _0x2cae3d['sendStatus'](_0x11efcf);}return _0x2cae3d[_0xb26f('0x19')](_0x11efcf)[_0xb26f('0x1a')]();};}function respondWithResult(_0x468e9f,_0x4f56cf){_0x4f56cf=_0x4f56cf||0xc8;return function(_0x1f8809){if(_0x1f8809){return _0x468e9f[_0xb26f('0x19')](_0x4f56cf)[_0xb26f('0x1b')](_0x1f8809);}};}function respondWithFilteredResult(_0x50ea4c,_0x1309aa){return function(_0x10308a){if(_0x10308a){var _0x1d4bad=typeof _0x1309aa[_0xb26f('0x1c')]===_0xb26f('0x1d')&&typeof _0x1309aa[_0xb26f('0x1e')]===_0xb26f('0x1d');var _0x36ea48=_0x10308a['count'];var _0x37fa88=_0x1d4bad?0x0:_0x1309aa[_0xb26f('0x1c')];var _0x4143f2=_0x1d4bad?_0x10308a['count']:_0x1309aa[_0xb26f('0x1c')]+_0x1309aa[_0xb26f('0x1e')];var _0x2032bf;if(_0x4143f2>=_0x36ea48){_0x4143f2=_0x36ea48;_0x2032bf=0xc8;}else{_0x2032bf=0xce;}_0x50ea4c[_0xb26f('0x19')](_0x2032bf);return _0x50ea4c['set'](_0xb26f('0x1f'),_0x37fa88+'-'+_0x4143f2+'/'+_0x36ea48)[_0xb26f('0x1b')](_0x10308a);}return null;};}function patchUpdates(_0x1f0709){return function(_0x2bdb1b){try{jsonpatch[_0xb26f('0x20')](_0x2bdb1b,_0x1f0709,!![]);}catch(_0x5ae187){return BPromise[_0xb26f('0x21')](_0x5ae187);}return _0x2bdb1b[_0xb26f('0x22')]();};}function saveUpdates(_0x581c7d,_0x58cbd7){return function(_0x138713){if(_0x138713){return _0x138713[_0xb26f('0x23')](_0x581c7d)[_0xb26f('0x24')](function(_0xbe6277){return _0xbe6277;});}return null;};}function removeEntity(_0x5969f5,_0x3d1068){return function(_0x2971d8){if(_0x2971d8){return _0x2971d8[_0xb26f('0x25')]()[_0xb26f('0x24')](function(){_0x5969f5[_0xb26f('0x19')](0xcc)[_0xb26f('0x1a')]();});}};}function handleEntityNotFound(_0x566d12,_0x383373){return function(_0x4c8fbd){if(!_0x4c8fbd){_0x566d12['sendStatus'](0x194);}return _0x4c8fbd;};}function handleError(_0x3def67,_0x380ec1){_0x380ec1=_0x380ec1||0x1f4;return function(_0x57f6d7){logger[_0xb26f('0x26')](_0x57f6d7[_0xb26f('0x27')]);if(_0x57f6d7[_0xb26f('0x28')]){delete _0x57f6d7[_0xb26f('0x28')];}_0x3def67[_0xb26f('0x19')](_0x380ec1)[_0xb26f('0x29')](_0x57f6d7);};}exports[_0xb26f('0x2a')]=function(_0x479b9c,_0x559ae5){var _0x2dfa51={},_0x12deaf={},_0x99b44={'count':0x0,'rows':[]};var _0x2acdd7=_[_0xb26f('0x2b')](db[_0xb26f('0x2c')]['rawAttributes'],function(_0x5dd3ec){return{'name':_0x5dd3ec[_0xb26f('0x2d')],'type':_0x5dd3ec[_0xb26f('0x2e')][_0xb26f('0x2f')]};});_0x12deaf['model']=_[_0xb26f('0x2b')](_0x2acdd7,'name');_0x12deaf['query']=_[_0xb26f('0x30')](_0x479b9c[_0xb26f('0x31')]);_0x12deaf[_0xb26f('0x32')]=_[_0xb26f('0x33')](_0x12deaf['model'],_0x12deaf[_0xb26f('0x31')]);_0x2dfa51['attributes']=_[_0xb26f('0x33')](_0x12deaf[_0xb26f('0x34')],qs[_0xb26f('0x35')](_0x479b9c[_0xb26f('0x31')][_0xb26f('0x35')]));_0x2dfa51[_0xb26f('0x36')]=_0x2dfa51['attributes'][_0xb26f('0x37')]?_0x2dfa51['attributes']:_0x12deaf[_0xb26f('0x34')];if(!_0x479b9c['query'][_0xb26f('0x38')](_0xb26f('0x39'))){_0x2dfa51[_0xb26f('0x1e')]=qs[_0xb26f('0x1e')](_0x479b9c[_0xb26f('0x31')][_0xb26f('0x1e')]);_0x2dfa51['offset']=qs[_0xb26f('0x1c')](_0x479b9c[_0xb26f('0x31')][_0xb26f('0x1c')]);}_0x2dfa51[_0xb26f('0x3a')]=qs[_0xb26f('0x3b')](_0x479b9c['query'][_0xb26f('0x3b')]);_0x2dfa51[_0xb26f('0x3c')]=qs[_0xb26f('0x32')](_[_0xb26f('0x3d')](_0x479b9c[_0xb26f('0x31')],_0x12deaf[_0xb26f('0x32')]),_0x2acdd7);if(_0x479b9c[_0xb26f('0x31')][_0xb26f('0x3e')]){_0x2dfa51[_0xb26f('0x3c')]=_['merge'](_0x2dfa51[_0xb26f('0x3c')],{'$or':_[_0xb26f('0x2b')](_0x2acdd7,function(_0x6e5c6){if(_0x6e5c6[_0xb26f('0x2e')]!==_0xb26f('0x3f')){var _0x3a5f9c={};_0x3a5f9c[_0x6e5c6[_0xb26f('0x28')]]={'$like':'%'+_0x479b9c[_0xb26f('0x31')][_0xb26f('0x3e')]+'%'};return _0x3a5f9c;}})});}_0x2dfa51=_[_0xb26f('0x40')]({},_0x2dfa51,_0x479b9c[_0xb26f('0x41')]);var _0x49c626={'where':_0x2dfa51[_0xb26f('0x3c')]};return db['ZohoConfiguration']['count'](_0x49c626)[_0xb26f('0x24')](function(_0x22230f){_0x99b44[_0xb26f('0x42')]=_0x22230f;if(_0x479b9c[_0xb26f('0x31')][_0xb26f('0x43')]){_0x2dfa51['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0xb26f('0x44')](_0x2dfa51);})[_0xb26f('0x24')](function(_0x3660c2){_0x99b44[_0xb26f('0x45')]=_0x3660c2;return _0x99b44;})['then'](respondWithFilteredResult(_0x559ae5,_0x2dfa51))['catch'](handleError(_0x559ae5,null));};exports['show']=function(_0x201ea2,_0x25d95f){var _0x2bd38e={'raw':![],'where':{'id':_0x201ea2[_0xb26f('0x46')]['id']}},_0x3a571d={};_0x3a571d[_0xb26f('0x34')]=_[_0xb26f('0x30')](db[_0xb26f('0x2c')][_0xb26f('0x47')]);_0x3a571d[_0xb26f('0x31')]=_['keys'](_0x201ea2['query']);_0x3a571d[_0xb26f('0x32')]=_[_0xb26f('0x33')](_0x3a571d[_0xb26f('0x34')],_0x3a571d[_0xb26f('0x31')]);_0x2bd38e['attributes']=_['intersection'](_0x3a571d[_0xb26f('0x34')],qs[_0xb26f('0x35')](_0x201ea2[_0xb26f('0x31')][_0xb26f('0x35')]));_0x2bd38e['attributes']=_0x2bd38e[_0xb26f('0x36')][_0xb26f('0x37')]?_0x2bd38e[_0xb26f('0x36')]:_0x3a571d['model'];if(_0x201ea2[_0xb26f('0x31')][_0xb26f('0x43')]){_0x2bd38e[_0xb26f('0x48')]=[{'all':!![]}];}_0x2bd38e=_[_0xb26f('0x40')]({},_0x2bd38e,_0x201ea2[_0xb26f('0x41')]);return db[_0xb26f('0x2c')][_0xb26f('0x49')](_0x2bd38e)[_0xb26f('0x24')](handleEntityNotFound(_0x25d95f,null))[_0xb26f('0x24')](respondWithResult(_0x25d95f,null))['catch'](handleError(_0x25d95f,null));};exports[_0xb26f('0x4a')]=function(_0x388c38,_0x1e919f){return db[_0xb26f('0x2c')][_0xb26f('0x4a')](_0x388c38[_0xb26f('0x4b')],{})['then'](respondWithResult(_0x1e919f,0xc9))[_0xb26f('0x4c')](handleError(_0x1e919f,null));};exports[_0xb26f('0x23')]=function(_0x527071,_0x195e95){if(_0x527071['body']['id']){delete _0x527071[_0xb26f('0x4b')]['id'];}return db[_0xb26f('0x2c')][_0xb26f('0x49')]({'where':{'id':_0x527071[_0xb26f('0x46')]['id']}})[_0xb26f('0x24')](handleEntityNotFound(_0x195e95,null))[_0xb26f('0x24')](saveUpdates(_0x527071[_0xb26f('0x4b')],null))[_0xb26f('0x24')](respondWithResult(_0x195e95,null))[_0xb26f('0x4c')](handleError(_0x195e95,null));};exports[_0xb26f('0x25')]=function(_0x150693,_0x4f44a8){return db[_0xb26f('0x2c')][_0xb26f('0x49')]({'where':{'id':_0x150693['params']['id']}})[_0xb26f('0x24')](handleEntityNotFound(_0x4f44a8,null))[_0xb26f('0x24')](removeEntity(_0x4f44a8,null))[_0xb26f('0x4c')](handleError(_0x4f44a8,null));};exports[_0xb26f('0x4d')]=function(_0x55be06,_0x4da620,_0x134f3f){var _0x42f0d2={};var _0xfa194e={};var _0x4795af;var _0x1a82e8;return db[_0xb26f('0x2c')]['findOne']({'where':{'id':_0x55be06[_0xb26f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4da620,null))['then'](function(_0x55d054){if(_0x55d054){_0x4795af=_0x55d054;_0xfa194e[_0xb26f('0x34')]=_[_0xb26f('0x30')](db[_0xb26f('0x4e')][_0xb26f('0x47')]);_0xfa194e[_0xb26f('0x31')]=_[_0xb26f('0x30')](_0x55be06[_0xb26f('0x31')]);_0xfa194e[_0xb26f('0x32')]=_[_0xb26f('0x33')](_0xfa194e[_0xb26f('0x34')],_0xfa194e[_0xb26f('0x31')]);_0x42f0d2[_0xb26f('0x36')]=_[_0xb26f('0x33')](_0xfa194e[_0xb26f('0x34')],qs[_0xb26f('0x35')](_0x55be06[_0xb26f('0x31')][_0xb26f('0x35')]));_0x42f0d2[_0xb26f('0x36')]=_0x42f0d2[_0xb26f('0x36')][_0xb26f('0x37')]?_0x42f0d2[_0xb26f('0x36')]:_0xfa194e['model'];_0x42f0d2[_0xb26f('0x3a')]=qs[_0xb26f('0x3b')](_0x55be06[_0xb26f('0x31')]['sort']);_0x42f0d2[_0xb26f('0x3c')]=qs[_0xb26f('0x32')](_[_0xb26f('0x3d')](_0x55be06['query'],_0xfa194e[_0xb26f('0x32')]));if(_0x55be06['query'][_0xb26f('0x3e')]){_0x42f0d2[_0xb26f('0x3c')]=_[_0xb26f('0x40')](_0x42f0d2[_0xb26f('0x3c')],{'$or':_[_0xb26f('0x2b')](_0x42f0d2[_0xb26f('0x36')],function(_0x4b4440){var _0x4f55c2={};_0x4f55c2[_0x4b4440]={'$like':'%'+_0x55be06['query'][_0xb26f('0x3e')]+'%'};return _0x4f55c2;})});}_0x42f0d2=_[_0xb26f('0x40')]({},_0x42f0d2,_0x55be06[_0xb26f('0x41')]);return _0x4795af[_0xb26f('0x4d')](_0x42f0d2);}})['then'](function(_0x16a2bb){if(_0x16a2bb){_0x1a82e8=_0x16a2bb[_0xb26f('0x37')];if(!_0x55be06['query'][_0xb26f('0x38')](_0xb26f('0x39'))){_0x42f0d2[_0xb26f('0x1e')]=qs[_0xb26f('0x1e')](_0x55be06[_0xb26f('0x31')][_0xb26f('0x1e')]);_0x42f0d2[_0xb26f('0x1c')]=qs[_0xb26f('0x1c')](_0x55be06[_0xb26f('0x31')][_0xb26f('0x1c')]);}return _0x4795af[_0xb26f('0x4d')](_0x42f0d2);}})[_0xb26f('0x24')](function(_0x1fa28c){if(_0x1fa28c){return _0x1fa28c?{'count':_0x1a82e8,'rows':_0x1fa28c}:null;}})[_0xb26f('0x24')](respondWithResult(_0x4da620,null))[_0xb26f('0x4c')](handleError(_0x4da620,null));};exports[_0xb26f('0x4f')]=function(_0x2de9e6,_0x5b24ce,_0x16c708){var _0x5568d6={};var _0x47a153={};var _0xcee05;var _0x87fc52;return db[_0xb26f('0x2c')]['findOne']({'where':{'id':_0x2de9e6[_0xb26f('0x46')]['id']}})[_0xb26f('0x24')](handleEntityNotFound(_0x5b24ce,null))[_0xb26f('0x24')](function(_0x4cbb96){if(_0x4cbb96){_0xcee05=_0x4cbb96;_0x47a153[_0xb26f('0x34')]=_['keys'](db[_0xb26f('0x4e')][_0xb26f('0x47')]);_0x47a153[_0xb26f('0x31')]=_[_0xb26f('0x30')](_0x2de9e6[_0xb26f('0x31')]);_0x47a153[_0xb26f('0x32')]=_[_0xb26f('0x33')](_0x47a153[_0xb26f('0x34')],_0x47a153[_0xb26f('0x31')]);_0x5568d6['attributes']=_['intersection'](_0x47a153['model'],qs['fields'](_0x2de9e6['query']['fields']));_0x5568d6[_0xb26f('0x36')]=_0x5568d6[_0xb26f('0x36')]['length']?_0x5568d6[_0xb26f('0x36')]:_0x47a153[_0xb26f('0x34')];_0x5568d6[_0xb26f('0x3a')]=qs[_0xb26f('0x3b')](_0x2de9e6[_0xb26f('0x31')][_0xb26f('0x3b')]);_0x5568d6[_0xb26f('0x3c')]=qs[_0xb26f('0x32')](_[_0xb26f('0x3d')](_0x2de9e6[_0xb26f('0x31')],_0x47a153[_0xb26f('0x32')]));if(_0x2de9e6['query'][_0xb26f('0x3e')]){_0x5568d6[_0xb26f('0x3c')]=_[_0xb26f('0x40')](_0x5568d6[_0xb26f('0x3c')],{'$or':_[_0xb26f('0x2b')](_0x5568d6['attributes'],function(_0x379c45){var _0x1c1f6b={};_0x1c1f6b[_0x379c45]={'$like':'%'+_0x2de9e6[_0xb26f('0x31')]['filter']+'%'};return _0x1c1f6b;})});}_0x5568d6=_[_0xb26f('0x40')]({},_0x5568d6,_0x2de9e6[_0xb26f('0x41')]);return _0xcee05[_0xb26f('0x4f')](_0x5568d6);}})[_0xb26f('0x24')](function(_0x30933d){if(_0x30933d){_0x87fc52=_0x30933d['length'];if(!_0x2de9e6[_0xb26f('0x31')]['hasOwnProperty'](_0xb26f('0x39'))){_0x5568d6[_0xb26f('0x1e')]=qs['limit'](_0x2de9e6[_0xb26f('0x31')]['limit']);_0x5568d6[_0xb26f('0x1c')]=qs[_0xb26f('0x1c')](_0x2de9e6[_0xb26f('0x31')][_0xb26f('0x1c')]);}return _0xcee05[_0xb26f('0x4f')](_0x5568d6);}})[_0xb26f('0x24')](function(_0x327221){if(_0x327221){return _0x327221?{'count':_0x87fc52,'rows':_0x327221}:null;}})[_0xb26f('0x24')](respondWithResult(_0x5b24ce,null))['catch'](handleError(_0x5b24ce,null));};exports['getDescriptions']=function(_0x4fb714,_0x5c0841,_0x3287fc){var _0x24b936={};var _0x1040de={};var _0x57c2b5;var _0x38c8f0;return db[_0xb26f('0x2c')][_0xb26f('0x50')]({'where':{'id':_0x4fb714[_0xb26f('0x46')]['id']}})[_0xb26f('0x24')](handleEntityNotFound(_0x5c0841,null))[_0xb26f('0x24')](function(_0x43651b){if(_0x43651b){_0x57c2b5=_0x43651b;_0x1040de[_0xb26f('0x34')]=_[_0xb26f('0x30')](db[_0xb26f('0x4e')][_0xb26f('0x47')]);_0x1040de['query']=_[_0xb26f('0x30')](_0x4fb714[_0xb26f('0x31')]);_0x1040de[_0xb26f('0x32')]=_['intersection'](_0x1040de[_0xb26f('0x34')],_0x1040de[_0xb26f('0x31')]);_0x24b936['attributes']=_['intersection'](_0x1040de[_0xb26f('0x34')],qs[_0xb26f('0x35')](_0x4fb714[_0xb26f('0x31')]['fields']));_0x24b936[_0xb26f('0x36')]=_0x24b936[_0xb26f('0x36')]['length']?_0x24b936['attributes']:_0x1040de[_0xb26f('0x34')];_0x24b936['order']=qs[_0xb26f('0x3b')](_0x4fb714['query'][_0xb26f('0x3b')]);_0x24b936['where']=qs[_0xb26f('0x32')](_[_0xb26f('0x3d')](_0x4fb714[_0xb26f('0x31')],_0x1040de[_0xb26f('0x32')]));if(_0x4fb714['query']['filter']){_0x24b936[_0xb26f('0x3c')]=_[_0xb26f('0x40')](_0x24b936[_0xb26f('0x3c')],{'$or':_[_0xb26f('0x2b')](_0x24b936[_0xb26f('0x36')],function(_0x12a64e){var _0x380ba9={};_0x380ba9[_0x12a64e]={'$like':'%'+_0x4fb714[_0xb26f('0x31')][_0xb26f('0x3e')]+'%'};return _0x380ba9;})});}_0x24b936=_['merge']({},_0x24b936,_0x4fb714[_0xb26f('0x41')]);return _0x57c2b5['getDescriptions'](_0x24b936);}})[_0xb26f('0x24')](function(_0x2b8b30){if(_0x2b8b30){_0x38c8f0=_0x2b8b30[_0xb26f('0x37')];if(!_0x4fb714[_0xb26f('0x31')]['hasOwnProperty'](_0xb26f('0x39'))){_0x24b936['limit']=qs[_0xb26f('0x1e')](_0x4fb714[_0xb26f('0x31')][_0xb26f('0x1e')]);_0x24b936['offset']=qs['offset'](_0x4fb714[_0xb26f('0x31')][_0xb26f('0x1c')]);}return _0x57c2b5['getDescriptions'](_0x24b936);}})[_0xb26f('0x24')](function(_0x49d423){if(_0x49d423){return _0x49d423?{'count':_0x38c8f0,'rows':_0x49d423}:null;}})['then'](respondWithResult(_0x5c0841,null))[_0xb26f('0x4c')](handleError(_0x5c0841,null));};
\ No newline at end of file
+var _0x276e=['order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','then','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','ZohoConfiguration','includeAll','include','rows','catch','show','params','options','find','create','body','update','destroy','getFields','findOne','ZohoField'];(function(_0x21639c,_0x2837d9){var _0x16e21c=function(_0x50ec62){while(--_0x50ec62){_0x21639c['push'](_0x21639c['shift']());}};_0x16e21c(++_0x2837d9);}(_0x276e,0x9f));var _0xe276=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x276e[_0x34a8c8];return _0x1fe6e5;};'use strict';var emlformat=require(_0xe276('0x0'));var rimraf=require(_0xe276('0x1'));var zipdir=require(_0xe276('0x2'));var jsonpatch=require(_0xe276('0x3'));var rp=require(_0xe276('0x4'));var moment=require(_0xe276('0x5'));var BPromise=require(_0xe276('0x6'));var Mustache=require(_0xe276('0x7'));var util=require(_0xe276('0x8'));var path=require('path');var sox=require(_0xe276('0x9'));var csv=require(_0xe276('0xa'));var ejs=require(_0xe276('0xb'));var fs=require('fs');var fs_extra=require(_0xe276('0xc'));var _=require('lodash');var squel=require(_0xe276('0xd'));var crypto=require(_0xe276('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe276('0xa'));var querystring=require('querystring');var Papa=require(_0xe276('0xf'));var Redis=require(_0xe276('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe276('0x11'));var as=require(_0xe276('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe276('0x13'))(_0xe276('0x14'));var utils=require(_0xe276('0x15'));var config=require(_0xe276('0x16'));var licenseUtil=require(_0xe276('0x17'));var db=require(_0xe276('0x18'))['db'];function respondWithStatusCode(_0x5113c3,_0x4bc60d){_0x4bc60d=_0x4bc60d||0xcc;return function(_0x3f945d){if(_0x3f945d){return _0x5113c3[_0xe276('0x19')](_0x4bc60d);}return _0x5113c3[_0xe276('0x1a')](_0x4bc60d)[_0xe276('0x1b')]();};}function respondWithResult(_0x286183,_0x3976ca){_0x3976ca=_0x3976ca||0xc8;return function(_0x1300be){if(_0x1300be){return _0x286183[_0xe276('0x1a')](_0x3976ca)[_0xe276('0x1c')](_0x1300be);}};}function respondWithFilteredResult(_0x531a19,_0x3745f6){return function(_0x446a39){if(_0x446a39){var _0x39ab29=typeof _0x3745f6[_0xe276('0x1d')]===_0xe276('0x1e')&&typeof _0x3745f6['limit']==='undefined';var _0x557c1d=_0x446a39[_0xe276('0x1f')];var _0x373fad=_0x39ab29?0x0:_0x3745f6['offset'];var _0x1c9e42=_0x39ab29?_0x446a39[_0xe276('0x1f')]:_0x3745f6[_0xe276('0x1d')]+_0x3745f6[_0xe276('0x20')];var _0x33b934;if(_0x1c9e42>=_0x557c1d){_0x1c9e42=_0x557c1d;_0x33b934=0xc8;}else{_0x33b934=0xce;}_0x531a19[_0xe276('0x1a')](_0x33b934);return _0x531a19['set'](_0xe276('0x21'),_0x373fad+'-'+_0x1c9e42+'/'+_0x557c1d)[_0xe276('0x1c')](_0x446a39);}return null;};}function patchUpdates(_0x10ca58){return function(_0x5699fe){try{jsonpatch['apply'](_0x5699fe,_0x10ca58,!![]);}catch(_0x59cfe2){return BPromise['reject'](_0x59cfe2);}return _0x5699fe[_0xe276('0x22')]();};}function saveUpdates(_0x28e567,_0x34742d){return function(_0x58ca01){if(_0x58ca01){return _0x58ca01['update'](_0x28e567)['then'](function(_0x1297e1){return _0x1297e1;});}return null;};}function removeEntity(_0x5518d0,_0x4f7583){return function(_0xc66cc7){if(_0xc66cc7){return _0xc66cc7['destroy']()[_0xe276('0x23')](function(){_0x5518d0[_0xe276('0x1a')](0xcc)[_0xe276('0x1b')]();});}};}function handleEntityNotFound(_0x3d4b77,_0x1e36ae){return function(_0x3d8257){if(!_0x3d8257){_0x3d4b77[_0xe276('0x19')](0x194);}return _0x3d8257;};}function handleError(_0x3a4e68,_0xb34974){_0xb34974=_0xb34974||0x1f4;return function(_0x36afb3){logger['error'](_0x36afb3[_0xe276('0x24')]);if(_0x36afb3['name']){delete _0x36afb3[_0xe276('0x25')];}_0x3a4e68[_0xe276('0x1a')](_0xb34974)['send'](_0x36afb3);};}exports[_0xe276('0x26')]=function(_0x723f1,_0x2aa286){var _0x117701={},_0x4d8ca0={},_0x8bed4c={'count':0x0,'rows':[]};var _0x1292cb=_[_0xe276('0x27')](db['ZohoConfiguration'][_0xe276('0x28')],function(_0x9ab109){return{'name':_0x9ab109[_0xe276('0x29')],'type':_0x9ab109[_0xe276('0x2a')][_0xe276('0x2b')]};});_0x4d8ca0['model']=_[_0xe276('0x27')](_0x1292cb,'name');_0x4d8ca0[_0xe276('0x2c')]=_[_0xe276('0x2d')](_0x723f1[_0xe276('0x2c')]);_0x4d8ca0['filters']=_[_0xe276('0x2e')](_0x4d8ca0[_0xe276('0x2f')],_0x4d8ca0[_0xe276('0x2c')]);_0x117701[_0xe276('0x30')]=_[_0xe276('0x2e')](_0x4d8ca0[_0xe276('0x2f')],qs[_0xe276('0x31')](_0x723f1['query'][_0xe276('0x31')]));_0x117701[_0xe276('0x30')]=_0x117701[_0xe276('0x30')][_0xe276('0x32')]?_0x117701['attributes']:_0x4d8ca0[_0xe276('0x2f')];if(!_0x723f1['query'][_0xe276('0x33')](_0xe276('0x34'))){_0x117701['limit']=qs[_0xe276('0x20')](_0x723f1[_0xe276('0x2c')][_0xe276('0x20')]);_0x117701[_0xe276('0x1d')]=qs[_0xe276('0x1d')](_0x723f1['query']['offset']);}_0x117701['order']=qs[_0xe276('0x35')](_0x723f1[_0xe276('0x2c')][_0xe276('0x35')]);_0x117701[_0xe276('0x36')]=qs[_0xe276('0x37')](_[_0xe276('0x38')](_0x723f1[_0xe276('0x2c')],_0x4d8ca0[_0xe276('0x37')]),_0x1292cb);if(_0x723f1[_0xe276('0x2c')][_0xe276('0x39')]){_0x117701[_0xe276('0x36')]=_[_0xe276('0x3a')](_0x117701[_0xe276('0x36')],{'$or':_[_0xe276('0x27')](_0x1292cb,function(_0x301ee5){if(_0x301ee5[_0xe276('0x2a')]!=='VIRTUAL'){var _0x111177={};_0x111177[_0x301ee5[_0xe276('0x25')]]={'$like':'%'+_0x723f1['query'][_0xe276('0x39')]+'%'};return _0x111177;}})});}_0x117701=_[_0xe276('0x3a')]({},_0x117701,_0x723f1['options']);var _0x488b1e={'where':_0x117701[_0xe276('0x36')]};return db[_0xe276('0x3b')][_0xe276('0x1f')](_0x488b1e)['then'](function(_0x583ea6){_0x8bed4c['count']=_0x583ea6;if(_0x723f1['query'][_0xe276('0x3c')]){_0x117701[_0xe276('0x3d')]=[{'all':!![]}];}return db[_0xe276('0x3b')]['findAll'](_0x117701);})[_0xe276('0x23')](function(_0x2f1c0a){_0x8bed4c[_0xe276('0x3e')]=_0x2f1c0a;return _0x8bed4c;})[_0xe276('0x23')](respondWithFilteredResult(_0x2aa286,_0x117701))[_0xe276('0x3f')](handleError(_0x2aa286,null));};exports[_0xe276('0x40')]=function(_0x41cf37,_0x136742){var _0x25bf94={'raw':![],'where':{'id':_0x41cf37[_0xe276('0x41')]['id']}},_0x3164a9={};_0x3164a9[_0xe276('0x2f')]=_[_0xe276('0x2d')](db[_0xe276('0x3b')][_0xe276('0x28')]);_0x3164a9[_0xe276('0x2c')]=_[_0xe276('0x2d')](_0x41cf37['query']);_0x3164a9['filters']=_[_0xe276('0x2e')](_0x3164a9[_0xe276('0x2f')],_0x3164a9[_0xe276('0x2c')]);_0x25bf94[_0xe276('0x30')]=_['intersection'](_0x3164a9[_0xe276('0x2f')],qs[_0xe276('0x31')](_0x41cf37[_0xe276('0x2c')][_0xe276('0x31')]));_0x25bf94[_0xe276('0x30')]=_0x25bf94[_0xe276('0x30')][_0xe276('0x32')]?_0x25bf94[_0xe276('0x30')]:_0x3164a9[_0xe276('0x2f')];if(_0x41cf37[_0xe276('0x2c')]['includeAll']){_0x25bf94['include']=[{'all':!![]}];}_0x25bf94=_[_0xe276('0x3a')]({},_0x25bf94,_0x41cf37[_0xe276('0x42')]);return db[_0xe276('0x3b')][_0xe276('0x43')](_0x25bf94)['then'](handleEntityNotFound(_0x136742,null))[_0xe276('0x23')](respondWithResult(_0x136742,null))[_0xe276('0x3f')](handleError(_0x136742,null));};exports['create']=function(_0x523d7e,_0xa3106e){return db[_0xe276('0x3b')][_0xe276('0x44')](_0x523d7e[_0xe276('0x45')],{})['then'](respondWithResult(_0xa3106e,0xc9))[_0xe276('0x3f')](handleError(_0xa3106e,null));};exports[_0xe276('0x46')]=function(_0x5a78de,_0x10fac9){if(_0x5a78de[_0xe276('0x45')]['id']){delete _0x5a78de[_0xe276('0x45')]['id'];}return db[_0xe276('0x3b')][_0xe276('0x43')]({'where':{'id':_0x5a78de[_0xe276('0x41')]['id']}})['then'](handleEntityNotFound(_0x10fac9,null))[_0xe276('0x23')](saveUpdates(_0x5a78de[_0xe276('0x45')],null))[_0xe276('0x23')](respondWithResult(_0x10fac9,null))[_0xe276('0x3f')](handleError(_0x10fac9,null));};exports[_0xe276('0x47')]=function(_0x29017b,_0x35673b){return db['ZohoConfiguration'][_0xe276('0x43')]({'where':{'id':_0x29017b[_0xe276('0x41')]['id']}})[_0xe276('0x23')](handleEntityNotFound(_0x35673b,null))[_0xe276('0x23')](removeEntity(_0x35673b,null))['catch'](handleError(_0x35673b,null));};exports[_0xe276('0x48')]=function(_0x11545b,_0x4d27fb,_0xc188d5){var _0x3ac6bf={};var _0x36f337={};var _0x204e59;var _0x4ebf53;return db['ZohoConfiguration'][_0xe276('0x49')]({'where':{'id':_0x11545b[_0xe276('0x41')]['id']}})[_0xe276('0x23')](handleEntityNotFound(_0x4d27fb,null))[_0xe276('0x23')](function(_0x3b9a00){if(_0x3b9a00){_0x204e59=_0x3b9a00;_0x36f337[_0xe276('0x2f')]=_[_0xe276('0x2d')](db[_0xe276('0x4a')][_0xe276('0x28')]);_0x36f337[_0xe276('0x2c')]=_[_0xe276('0x2d')](_0x11545b[_0xe276('0x2c')]);_0x36f337[_0xe276('0x37')]=_[_0xe276('0x2e')](_0x36f337[_0xe276('0x2f')],_0x36f337[_0xe276('0x2c')]);_0x3ac6bf[_0xe276('0x30')]=_[_0xe276('0x2e')](_0x36f337[_0xe276('0x2f')],qs[_0xe276('0x31')](_0x11545b[_0xe276('0x2c')]['fields']));_0x3ac6bf[_0xe276('0x30')]=_0x3ac6bf[_0xe276('0x30')][_0xe276('0x32')]?_0x3ac6bf['attributes']:_0x36f337[_0xe276('0x2f')];_0x3ac6bf[_0xe276('0x4b')]=qs['sort'](_0x11545b[_0xe276('0x2c')][_0xe276('0x35')]);_0x3ac6bf['where']=qs['filters'](_[_0xe276('0x38')](_0x11545b[_0xe276('0x2c')],_0x36f337[_0xe276('0x37')]));if(_0x11545b[_0xe276('0x2c')]['filter']){_0x3ac6bf[_0xe276('0x36')]=_['merge'](_0x3ac6bf['where'],{'$or':_['map'](_0x3ac6bf[_0xe276('0x30')],function(_0x5dd905){var _0x1a1484={};_0x1a1484[_0x5dd905]={'$like':'%'+_0x11545b[_0xe276('0x2c')][_0xe276('0x39')]+'%'};return _0x1a1484;})});}_0x3ac6bf=_[_0xe276('0x3a')]({},_0x3ac6bf,_0x11545b['options']);return _0x204e59['getFields'](_0x3ac6bf);}})[_0xe276('0x23')](function(_0xa79436){if(_0xa79436){_0x4ebf53=_0xa79436[_0xe276('0x32')];if(!_0x11545b['query'][_0xe276('0x33')](_0xe276('0x34'))){_0x3ac6bf[_0xe276('0x20')]=qs[_0xe276('0x20')](_0x11545b[_0xe276('0x2c')]['limit']);_0x3ac6bf[_0xe276('0x1d')]=qs[_0xe276('0x1d')](_0x11545b[_0xe276('0x2c')][_0xe276('0x1d')]);}return _0x204e59[_0xe276('0x48')](_0x3ac6bf);}})[_0xe276('0x23')](function(_0x4f1198){if(_0x4f1198){return _0x4f1198?{'count':_0x4ebf53,'rows':_0x4f1198}:null;}})[_0xe276('0x23')](respondWithResult(_0x4d27fb,null))[_0xe276('0x3f')](handleError(_0x4d27fb,null));};exports['getSubjects']=function(_0x481996,_0x501606,_0x309d02){var _0x329960={};var _0x3615be={};var _0xc3825b;var _0x52410c;return db[_0xe276('0x3b')][_0xe276('0x49')]({'where':{'id':_0x481996['params']['id']}})['then'](handleEntityNotFound(_0x501606,null))[_0xe276('0x23')](function(_0x40d5b3){if(_0x40d5b3){_0xc3825b=_0x40d5b3;_0x3615be['model']=_[_0xe276('0x2d')](db[_0xe276('0x4a')][_0xe276('0x28')]);_0x3615be['query']=_['keys'](_0x481996[_0xe276('0x2c')]);_0x3615be[_0xe276('0x37')]=_[_0xe276('0x2e')](_0x3615be['model'],_0x3615be['query']);_0x329960[_0xe276('0x30')]=_[_0xe276('0x2e')](_0x3615be[_0xe276('0x2f')],qs[_0xe276('0x31')](_0x481996[_0xe276('0x2c')][_0xe276('0x31')]));_0x329960[_0xe276('0x30')]=_0x329960[_0xe276('0x30')][_0xe276('0x32')]?_0x329960[_0xe276('0x30')]:_0x3615be[_0xe276('0x2f')];_0x329960[_0xe276('0x4b')]=qs[_0xe276('0x35')](_0x481996[_0xe276('0x2c')][_0xe276('0x35')]);_0x329960[_0xe276('0x36')]=qs[_0xe276('0x37')](_[_0xe276('0x38')](_0x481996[_0xe276('0x2c')],_0x3615be[_0xe276('0x37')]));if(_0x481996[_0xe276('0x2c')][_0xe276('0x39')]){_0x329960[_0xe276('0x36')]=_[_0xe276('0x3a')](_0x329960[_0xe276('0x36')],{'$or':_['map'](_0x329960[_0xe276('0x30')],function(_0x10ad15){var _0x2179e0={};_0x2179e0[_0x10ad15]={'$like':'%'+_0x481996['query'][_0xe276('0x39')]+'%'};return _0x2179e0;})});}_0x329960=_[_0xe276('0x3a')]({},_0x329960,_0x481996[_0xe276('0x42')]);return _0xc3825b[_0xe276('0x4c')](_0x329960);}})[_0xe276('0x23')](function(_0x4d8055){if(_0x4d8055){_0x52410c=_0x4d8055['length'];if(!_0x481996[_0xe276('0x2c')][_0xe276('0x33')](_0xe276('0x34'))){_0x329960['limit']=qs[_0xe276('0x20')](_0x481996[_0xe276('0x2c')][_0xe276('0x20')]);_0x329960[_0xe276('0x1d')]=qs[_0xe276('0x1d')](_0x481996['query']['offset']);}return _0xc3825b[_0xe276('0x4c')](_0x329960);}})[_0xe276('0x23')](function(_0x13c1f9){if(_0x13c1f9){return _0x13c1f9?{'count':_0x52410c,'rows':_0x13c1f9}:null;}})[_0xe276('0x23')](respondWithResult(_0x501606,null))['catch'](handleError(_0x501606,null));};exports[_0xe276('0x4d')]=function(_0x2e3474,_0x1224b9,_0x5cda2b){var _0x2eb992={};var _0x2e24ba={};var _0x3f01dd;var _0x349c18;return db[_0xe276('0x3b')][_0xe276('0x49')]({'where':{'id':_0x2e3474['params']['id']}})[_0xe276('0x23')](handleEntityNotFound(_0x1224b9,null))[_0xe276('0x23')](function(_0x2caf1a){if(_0x2caf1a){_0x3f01dd=_0x2caf1a;_0x2e24ba[_0xe276('0x2f')]=_[_0xe276('0x2d')](db[_0xe276('0x4a')][_0xe276('0x28')]);_0x2e24ba[_0xe276('0x2c')]=_[_0xe276('0x2d')](_0x2e3474[_0xe276('0x2c')]);_0x2e24ba[_0xe276('0x37')]=_[_0xe276('0x2e')](_0x2e24ba['model'],_0x2e24ba['query']);_0x2eb992[_0xe276('0x30')]=_[_0xe276('0x2e')](_0x2e24ba[_0xe276('0x2f')],qs[_0xe276('0x31')](_0x2e3474['query'][_0xe276('0x31')]));_0x2eb992[_0xe276('0x30')]=_0x2eb992[_0xe276('0x30')][_0xe276('0x32')]?_0x2eb992[_0xe276('0x30')]:_0x2e24ba['model'];_0x2eb992[_0xe276('0x4b')]=qs['sort'](_0x2e3474['query'][_0xe276('0x35')]);_0x2eb992[_0xe276('0x36')]=qs[_0xe276('0x37')](_[_0xe276('0x38')](_0x2e3474['query'],_0x2e24ba['filters']));if(_0x2e3474[_0xe276('0x2c')][_0xe276('0x39')]){_0x2eb992[_0xe276('0x36')]=_['merge'](_0x2eb992[_0xe276('0x36')],{'$or':_['map'](_0x2eb992['attributes'],function(_0x3b7d53){var _0x1900c3={};_0x1900c3[_0x3b7d53]={'$like':'%'+_0x2e3474['query'][_0xe276('0x39')]+'%'};return _0x1900c3;})});}_0x2eb992=_[_0xe276('0x3a')]({},_0x2eb992,_0x2e3474[_0xe276('0x42')]);return _0x3f01dd[_0xe276('0x4d')](_0x2eb992);}})[_0xe276('0x23')](function(_0x407d72){if(_0x407d72){_0x349c18=_0x407d72['length'];if(!_0x2e3474['query'][_0xe276('0x33')](_0xe276('0x34'))){_0x2eb992[_0xe276('0x20')]=qs['limit'](_0x2e3474[_0xe276('0x2c')][_0xe276('0x20')]);_0x2eb992[_0xe276('0x1d')]=qs[_0xe276('0x1d')](_0x2e3474[_0xe276('0x2c')][_0xe276('0x1d')]);}return _0x3f01dd[_0xe276('0x4d')](_0x2eb992);}})[_0xe276('0x23')](function(_0x315edf){if(_0x315edf){return _0x315edf?{'count':_0x349c18,'rows':_0x315edf}:null;}})[_0xe276('0x23')](respondWithResult(_0x1224b9,null))['catch'](handleError(_0x1224b9,null));};
\ No newline at end of file
index 3935147..f15f633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2871=['../../config/logger','api','bluebird','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x3b0999,_0x3c9835){var _0x585226=function(_0x3314f9){while(--_0x3314f9){_0x3b0999['push'](_0x3b0999['shift']());}};_0x585226(++_0x3c9835);}(_0x2871,0x6c));var _0x1287=function(_0x134fdd,_0x45e64c){_0x134fdd=_0x134fdd-0x0;var _0x58e2e4=_0x2871[_0x134fdd];return _0x58e2e4;};'use strict';var _=require(_0x1287('0x0'));var util=require(_0x1287('0x1'));var logger=require(_0x1287('0x2'))(_0x1287('0x3'));var moment=require('moment');var BPromise=require(_0x1287('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1287('0x5'));var config=require('../../config/environment');var attributes=require(_0x1287('0x6'));module[_0x1287('0x7')]=function(_0x450da8,_0x590762){return _0x450da8[_0x1287('0x8')](_0x1287('0x9'),attributes,{'tableName':_0x1287('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c42=['define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x50856f,_0x262f2c){var _0x505ca2=function(_0x4df2f2){while(--_0x4df2f2){_0x50856f['push'](_0x50856f['shift']());}};_0x505ca2(++_0x262f2c);}(_0x9c42,0x1a2));var _0x29c4=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0x9c42[_0x348652];return _0x18a9ea;};'use strict';var _=require(_0x29c4('0x0'));var util=require(_0x29c4('0x1'));var logger=require(_0x29c4('0x2'))(_0x29c4('0x3'));var moment=require(_0x29c4('0x4'));var BPromise=require(_0x29c4('0x5'));var rp=require(_0x29c4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29c4('0x7'));var config=require(_0x29c4('0x8'));var attributes=require(_0x29c4('0x9'));module[_0x29c4('0xa')]=function(_0x292890,_0xd0b57e){return _0x292890[_0x29c4('0xb')](_0x29c4('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 359fdc5..ee1aa8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca58=['../../config/environment','jayson/promise','client','then','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4c4259,_0x4b5d22){var _0xb39b40=function(_0x5069bf){while(--_0x5069bf){_0x4c4259['push'](_0x4c4259['shift']());}};_0xb39b40(++_0x4b5d22);}(_0xca58,0x183));var _0x8ca5=function(_0x53e382,_0x2764a8){_0x53e382=_0x53e382-0x0;var _0x1888c2=_0xca58[_0x53e382];return _0x1888c2;};'use strict';var _=require(_0x8ca5('0x0'));var util=require(_0x8ca5('0x1'));var moment=require(_0x8ca5('0x2'));var BPromise=require(_0x8ca5('0x3'));var rs=require(_0x8ca5('0x4'));var fs=require('fs');var Redis=require(_0x8ca5('0x5'));var db=require(_0x8ca5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ca5('0x7'))(_0x8ca5('0x8'));var config=require(_0x8ca5('0x9'));var jayson=require(_0x8ca5('0xa'));var client=jayson[_0x8ca5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f25a1,_0x3f782c,_0x257911){return new BPromise(function(_0x36f919,_0x503d7f){return client['request'](_0x1f25a1,_0x257911)[_0x8ca5('0xc')](function(_0xce8f03){logger['info'](_0x8ca5('0xd'),_0x3f782c,'request\x20sent');logger[_0x8ca5('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f782c,_0x8ca5('0xf'),JSON[_0x8ca5('0x10')](_0xce8f03));if(_0xce8f03[_0x8ca5('0x11')]){if(_0xce8f03[_0x8ca5('0x11')]['code']===0x1f4){logger[_0x8ca5('0x11')](_0x8ca5('0xd'),_0x3f782c,_0xce8f03[_0x8ca5('0x11')][_0x8ca5('0x12')]);return _0x503d7f(_0xce8f03[_0x8ca5('0x11')][_0x8ca5('0x12')]);}logger[_0x8ca5('0x11')](_0x8ca5('0xd'),_0x3f782c,_0xce8f03['error'][_0x8ca5('0x12')]);return _0x36f919(_0xce8f03[_0x8ca5('0x11')][_0x8ca5('0x12')]);}else{logger[_0x8ca5('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f782c,'request\x20sent');_0x36f919(_0xce8f03[_0x8ca5('0x14')][_0x8ca5('0x12')]);}})[_0x8ca5('0x15')](function(_0x49d222){logger[_0x8ca5('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f782c,_0x49d222);_0x503d7f(_0x49d222);});});}
\ No newline at end of file
+var _0xce43=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b73b5,_0xe86495){var _0x1a6e20=function(_0x4c6b71){while(--_0x4c6b71){_0x3b73b5['push'](_0x3b73b5['shift']());}};_0x1a6e20(++_0xe86495);}(_0xce43,0x9a));var _0x3ce4=function(_0x15fc01,_0xcdaebe){_0x15fc01=_0x15fc01-0x0;var _0x75d045=_0xce43[_0x15fc01];return _0x75d045;};'use strict';var _=require(_0x3ce4('0x0'));var util=require(_0x3ce4('0x1'));var moment=require(_0x3ce4('0x2'));var BPromise=require(_0x3ce4('0x3'));var rs=require(_0x3ce4('0x4'));var fs=require('fs');var Redis=require(_0x3ce4('0x5'));var db=require(_0x3ce4('0x6'))['db'];var utils=require(_0x3ce4('0x7'));var logger=require(_0x3ce4('0x8'))(_0x3ce4('0x9'));var config=require(_0x3ce4('0xa'));var jayson=require(_0x3ce4('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d9fe3,_0x4241d1,_0x2a5b36){return new BPromise(function(_0x1d90da,_0x54c108){return client['request'](_0x1d9fe3,_0x2a5b36)[_0x3ce4('0xc')](function(_0x46f101){logger[_0x3ce4('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x4241d1,_0x3ce4('0xe'));logger['debug'](_0x3ce4('0xf'),_0x4241d1,'request\x20sent',JSON[_0x3ce4('0x10')](_0x46f101));if(_0x46f101[_0x3ce4('0x11')]){if(_0x46f101[_0x3ce4('0x11')][_0x3ce4('0x12')]===0x1f4){logger[_0x3ce4('0x11')](_0x3ce4('0x13'),_0x4241d1,_0x46f101[_0x3ce4('0x11')][_0x3ce4('0x14')]);return _0x54c108(_0x46f101[_0x3ce4('0x11')][_0x3ce4('0x14')]);}logger[_0x3ce4('0x11')](_0x3ce4('0x13'),_0x4241d1,_0x46f101[_0x3ce4('0x11')][_0x3ce4('0x14')]);return _0x1d90da(_0x46f101[_0x3ce4('0x11')]['message']);}else{logger[_0x3ce4('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x4241d1,_0x3ce4('0xe'));_0x1d90da(_0x46f101[_0x3ce4('0x15')][_0x3ce4('0x14')]);}})[_0x3ce4('0x16')](function(_0x36caa1){logger[_0x3ce4('0x11')](_0x3ce4('0x13'),_0x4241d1,_0x36caa1);_0x54c108(_0x36caa1);});});}
\ No newline at end of file
index 34f5853..fc43328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc52=['create','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post'];(function(_0x595e7b,_0x32000d){var _0x330302=function(_0x1c8f61){while(--_0x1c8f61){_0x595e7b['push'](_0x595e7b['shift']());}};_0x330302(++_0x32000d);}(_0xfc52,0x19d));var _0x2fc5=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xfc52[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x2fc5('0x0'));var util=require(_0x2fc5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2fc5('0x2'));var router=express[_0x2fc5('0x3')]();var fs_extra=require(_0x2fc5('0x4'));var auth=require(_0x2fc5('0x5'));var interaction=require(_0x2fc5('0x6'));var config=require(_0x2fc5('0x7'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2fc5('0x8')](_0x2fc5('0x9'),auth[_0x2fc5('0xa')](),controller['show']);router[_0x2fc5('0xb')]('/',auth[_0x2fc5('0xa')](),controller[_0x2fc5('0xc')]);router[_0x2fc5('0xd')](_0x2fc5('0x9'),auth[_0x2fc5('0xa')](),controller[_0x2fc5('0xe')]);router['delete'](_0x2fc5('0x9'),auth[_0x2fc5('0xa')](),controller[_0x2fc5('0xf')]);module[_0x2fc5('0x10')]=router;
\ No newline at end of file
+var _0xa1e4=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','create','put','update','delete'];(function(_0x117ebe,_0x4bebbe){var _0x28fc6f=function(_0xe318b7){while(--_0xe318b7){_0x117ebe['push'](_0x117ebe['shift']());}};_0x28fc6f(++_0x4bebbe);}(_0xa1e4,0x110));var _0x4a1e=function(_0x472ee7,_0x302242){_0x472ee7=_0x472ee7-0x0;var _0x6aa3f3=_0xa1e4[_0x472ee7];return _0x6aa3f3;};'use strict';var multer=require(_0x4a1e('0x0'));var util=require(_0x4a1e('0x1'));var path=require('path');var timeout=require(_0x4a1e('0x2'));var express=require(_0x4a1e('0x3'));var router=express[_0x4a1e('0x4')]();var fs_extra=require(_0x4a1e('0x5'));var auth=require(_0x4a1e('0x6'));var interaction=require(_0x4a1e('0x7'));var config=require(_0x4a1e('0x8'));var controller=require(_0x4a1e('0x9'));router[_0x4a1e('0xa')]('/',auth[_0x4a1e('0xb')](),controller['index']);router[_0x4a1e('0xa')]('/:id',auth[_0x4a1e('0xb')](),controller[_0x4a1e('0xc')]);router['post']('/',auth[_0x4a1e('0xb')](),controller[_0x4a1e('0xd')]);router[_0x4a1e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4a1e('0xf')]);router[_0x4a1e('0x10')]('/:id',auth[_0x4a1e('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 0643540..4434c3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4643=['exports','ENUM','customVariable','keyValue','picklist','STRING','string','variable','BOOLEAN'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x4643,0x144));var _0x3464=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4643[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require('sequelize');module[_0x3464('0x0')]={'type':{'type':Sequelize[_0x3464('0x1')]('string','variable',_0x3464('0x2'),_0x3464('0x3'),_0x3464('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3464('0x5')]},'key':{'type':Sequelize[_0x3464('0x5')]},'keyType':{'type':Sequelize[_0x3464('0x1')](_0x3464('0x6'),_0x3464('0x7'),_0x3464('0x2'))},'keyContent':{'type':Sequelize[_0x3464('0x5')]},'idField':{'type':Sequelize[_0x3464('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3464('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3464('0x5')]}};
\ No newline at end of file
+var _0x6a9f=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x27c388,_0x587474){var _0x13b460=function(_0x4c3b85){while(--_0x4c3b85){_0x27c388['push'](_0x27c388['shift']());}};_0x13b460(++_0x587474);}(_0x6a9f,0x1ba));var _0xf6a9=function(_0x520627,_0xfcbe84){_0x520627=_0x520627-0x0;var _0x3da6ab=_0x6a9f[_0x520627];return _0x3da6ab;};'use strict';var Sequelize=require(_0xf6a9('0x0'));module[_0xf6a9('0x1')]={'type':{'type':Sequelize[_0xf6a9('0x2')](_0xf6a9('0x3'),'variable',_0xf6a9('0x4'),_0xf6a9('0x5'),_0xf6a9('0x6')),'defaultValue':_0xf6a9('0x3')},'content':{'type':Sequelize[_0xf6a9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf6a9('0x2')]('string','variable',_0xf6a9('0x4'))},'keyContent':{'type':Sequelize[_0xf6a9('0x7')]},'idField':{'type':Sequelize[_0xf6a9('0x7')]},'nameField':{'type':Sequelize[_0xf6a9('0x7')]},'customField':{'type':Sequelize[_0xf6a9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 60fcc45..168e1c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e2d=['json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','stack','name','send','map','ZohoField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','catch','show','keys','include','find','create','body','params','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0x3e2d,0x142));var _0xd3e2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3e2d[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xd3e2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd3e2('0x1'));var moment=require(_0xd3e2('0x2'));var BPromise=require(_0xd3e2('0x3'));var Mustache=require(_0xd3e2('0x4'));var util=require(_0xd3e2('0x5'));var path=require(_0xd3e2('0x6'));var sox=require(_0xd3e2('0x7'));var csv=require(_0xd3e2('0x8'));var ejs=require(_0xd3e2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3e2('0xa'));var squel=require('squel');var crypto=require(_0xd3e2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd3e2('0x8'));var querystring=require(_0xd3e2('0xc'));var Papa=require(_0xd3e2('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd3e2('0xe'));var as=require(_0xd3e2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e2('0x10'))(_0xd3e2('0x11'));var utils=require(_0xd3e2('0x12'));var config=require(_0xd3e2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd3e2('0x14'))['db'];function respondWithStatusCode(_0x3c6b8c,_0xfe8f14){_0xfe8f14=_0xfe8f14||0xcc;return function(_0x3126dc){if(_0x3126dc){return _0x3c6b8c[_0xd3e2('0x15')](_0xfe8f14);}return _0x3c6b8c['status'](_0xfe8f14)[_0xd3e2('0x16')]();};}function respondWithResult(_0x3fc2c4,_0x11b93a){_0x11b93a=_0x11b93a||0xc8;return function(_0x5bba70){if(_0x5bba70){return _0x3fc2c4['status'](_0x11b93a)[_0xd3e2('0x17')](_0x5bba70);}};}function respondWithFilteredResult(_0x2b3a7e,_0x45fa65){return function(_0x4c94f3){if(_0x4c94f3){var _0x1d25b7=typeof _0x45fa65[_0xd3e2('0x18')]===_0xd3e2('0x19')&&typeof _0x45fa65[_0xd3e2('0x1a')]==='undefined';var _0x5080fa=_0x4c94f3[_0xd3e2('0x1b')];var _0x4951e8=_0x1d25b7?0x0:_0x45fa65['offset'];var _0x1996c4=_0x1d25b7?_0x4c94f3[_0xd3e2('0x1b')]:_0x45fa65[_0xd3e2('0x18')]+_0x45fa65[_0xd3e2('0x1a')];var _0x80a81b;if(_0x1996c4>=_0x5080fa){_0x1996c4=_0x5080fa;_0x80a81b=0xc8;}else{_0x80a81b=0xce;}_0x2b3a7e[_0xd3e2('0x1c')](_0x80a81b);return _0x2b3a7e[_0xd3e2('0x1d')]('Content-Range',_0x4951e8+'-'+_0x1996c4+'/'+_0x5080fa)['json'](_0x4c94f3);}return null;};}function patchUpdates(_0x5a8de2){return function(_0x680cd7){try{jsonpatch['apply'](_0x680cd7,_0x5a8de2,!![]);}catch(_0x395516){return BPromise[_0xd3e2('0x1e')](_0x395516);}return _0x680cd7[_0xd3e2('0x1f')]();};}function saveUpdates(_0x2facf5,_0x48fb8b){return function(_0x222a8a){if(_0x222a8a){return _0x222a8a[_0xd3e2('0x20')](_0x2facf5)[_0xd3e2('0x21')](function(_0x5427a1){return _0x5427a1;});}return null;};}function removeEntity(_0x2d2bb7,_0x1e3cef){return function(_0x5ed392){if(_0x5ed392){return _0x5ed392[_0xd3e2('0x22')]()['then'](function(){_0x2d2bb7[_0xd3e2('0x1c')](0xcc)[_0xd3e2('0x16')]();});}};}function handleEntityNotFound(_0x45484d,_0x5ed773){return function(_0x2db52f){if(!_0x2db52f){_0x45484d['sendStatus'](0x194);}return _0x2db52f;};}function handleError(_0x21ad11,_0x7a93ee){_0x7a93ee=_0x7a93ee||0x1f4;return function(_0x419d93){logger['error'](_0x419d93[_0xd3e2('0x23')]);if(_0x419d93[_0xd3e2('0x24')]){delete _0x419d93[_0xd3e2('0x24')];}_0x21ad11['status'](_0x7a93ee)[_0xd3e2('0x25')](_0x419d93);};}exports['index']=function(_0x2a6fb8,_0x5655be){var _0x58fd7f={},_0x133969={},_0x136869={'count':0x0,'rows':[]};var _0x3bbdd4=_[_0xd3e2('0x26')](db[_0xd3e2('0x27')][_0xd3e2('0x28')],function(_0x151d72){return{'name':_0x151d72[_0xd3e2('0x29')],'type':_0x151d72['type'][_0xd3e2('0x2a')]};});_0x133969[_0xd3e2('0x2b')]=_[_0xd3e2('0x26')](_0x3bbdd4,'name');_0x133969['query']=_['keys'](_0x2a6fb8[_0xd3e2('0x2c')]);_0x133969[_0xd3e2('0x2d')]=_[_0xd3e2('0x2e')](_0x133969['model'],_0x133969['query']);_0x58fd7f[_0xd3e2('0x2f')]=_[_0xd3e2('0x2e')](_0x133969[_0xd3e2('0x2b')],qs[_0xd3e2('0x30')](_0x2a6fb8[_0xd3e2('0x2c')][_0xd3e2('0x30')]));_0x58fd7f[_0xd3e2('0x2f')]=_0x58fd7f['attributes'][_0xd3e2('0x31')]?_0x58fd7f['attributes']:_0x133969['model'];if(!_0x2a6fb8['query'][_0xd3e2('0x32')]('nolimit')){_0x58fd7f[_0xd3e2('0x1a')]=qs[_0xd3e2('0x1a')](_0x2a6fb8['query'][_0xd3e2('0x1a')]);_0x58fd7f[_0xd3e2('0x18')]=qs[_0xd3e2('0x18')](_0x2a6fb8[_0xd3e2('0x2c')][_0xd3e2('0x18')]);}_0x58fd7f[_0xd3e2('0x33')]=qs[_0xd3e2('0x34')](_0x2a6fb8[_0xd3e2('0x2c')]['sort']);_0x58fd7f[_0xd3e2('0x35')]=qs[_0xd3e2('0x2d')](_[_0xd3e2('0x36')](_0x2a6fb8[_0xd3e2('0x2c')],_0x133969[_0xd3e2('0x2d')]),_0x3bbdd4);if(_0x2a6fb8[_0xd3e2('0x2c')][_0xd3e2('0x37')]){_0x58fd7f[_0xd3e2('0x35')]=_[_0xd3e2('0x38')](_0x58fd7f['where'],{'$or':_[_0xd3e2('0x26')](_0x3bbdd4,function(_0x43661b){if(_0x43661b[_0xd3e2('0x39')]!==_0xd3e2('0x3a')){var _0x3785e5={};_0x3785e5[_0x43661b[_0xd3e2('0x24')]]={'$like':'%'+_0x2a6fb8['query'][_0xd3e2('0x37')]+'%'};return _0x3785e5;}})});}_0x58fd7f=_[_0xd3e2('0x38')]({},_0x58fd7f,_0x2a6fb8[_0xd3e2('0x3b')]);var _0x45170d={'where':_0x58fd7f[_0xd3e2('0x35')]};return db[_0xd3e2('0x27')][_0xd3e2('0x1b')](_0x45170d)['then'](function(_0xb9fc20){_0x136869['count']=_0xb9fc20;if(_0x2a6fb8[_0xd3e2('0x2c')][_0xd3e2('0x3c')]){_0x58fd7f['include']=[{'all':!![]}];}return db[_0xd3e2('0x27')]['findAll'](_0x58fd7f);})['then'](function(_0x5c541d){_0x136869['rows']=_0x5c541d;return _0x136869;})[_0xd3e2('0x21')](respondWithFilteredResult(_0x5655be,_0x58fd7f))[_0xd3e2('0x3d')](handleError(_0x5655be,null));};exports[_0xd3e2('0x3e')]=function(_0x43430c,_0x14c83e){var _0x48dfc8={'raw':!![],'where':{'id':_0x43430c['params']['id']}},_0x5f5840={};_0x5f5840[_0xd3e2('0x2b')]=_[_0xd3e2('0x3f')](db[_0xd3e2('0x27')][_0xd3e2('0x28')]);_0x5f5840[_0xd3e2('0x2c')]=_[_0xd3e2('0x3f')](_0x43430c[_0xd3e2('0x2c')]);_0x5f5840[_0xd3e2('0x2d')]=_[_0xd3e2('0x2e')](_0x5f5840[_0xd3e2('0x2b')],_0x5f5840[_0xd3e2('0x2c')]);_0x48dfc8[_0xd3e2('0x2f')]=_[_0xd3e2('0x2e')](_0x5f5840[_0xd3e2('0x2b')],qs[_0xd3e2('0x30')](_0x43430c[_0xd3e2('0x2c')][_0xd3e2('0x30')]));_0x48dfc8[_0xd3e2('0x2f')]=_0x48dfc8[_0xd3e2('0x2f')][_0xd3e2('0x31')]?_0x48dfc8[_0xd3e2('0x2f')]:_0x5f5840[_0xd3e2('0x2b')];if(_0x43430c[_0xd3e2('0x2c')][_0xd3e2('0x3c')]){_0x48dfc8[_0xd3e2('0x40')]=[{'all':!![]}];}_0x48dfc8=_[_0xd3e2('0x38')]({},_0x48dfc8,_0x43430c[_0xd3e2('0x3b')]);return db[_0xd3e2('0x27')][_0xd3e2('0x41')](_0x48dfc8)['then'](handleEntityNotFound(_0x14c83e,null))[_0xd3e2('0x21')](respondWithResult(_0x14c83e,null))['catch'](handleError(_0x14c83e,null));};exports[_0xd3e2('0x42')]=function(_0x599e10,_0x4ca43b){return db[_0xd3e2('0x27')][_0xd3e2('0x42')](_0x599e10[_0xd3e2('0x43')],{})['then'](respondWithResult(_0x4ca43b,0xc9))['catch'](handleError(_0x4ca43b,null));};exports[_0xd3e2('0x20')]=function(_0x3c865f,_0x5e0bc4){if(_0x3c865f[_0xd3e2('0x43')]['id']){delete _0x3c865f[_0xd3e2('0x43')]['id'];}return db[_0xd3e2('0x27')][_0xd3e2('0x41')]({'where':{'id':_0x3c865f[_0xd3e2('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e0bc4,null))[_0xd3e2('0x21')](saveUpdates(_0x3c865f[_0xd3e2('0x43')],null))['then'](respondWithResult(_0x5e0bc4,null))[_0xd3e2('0x3d')](handleError(_0x5e0bc4,null));};exports[_0xd3e2('0x22')]=function(_0x45891f,_0x1ba828){return db[_0xd3e2('0x27')][_0xd3e2('0x41')]({'where':{'id':_0x45891f[_0xd3e2('0x44')]['id']}})[_0xd3e2('0x21')](handleEntityNotFound(_0x1ba828,null))['then'](removeEntity(_0x1ba828,null))[_0xd3e2('0x3d')](handleError(_0x1ba828,null));};
\ No newline at end of file
+var _0x381e=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','send','index','ZohoField','rawAttributes','fieldName','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','show','params','keys','find','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js'];(function(_0x49d0f0,_0x461781){var _0x1190e1=function(_0x1c781a){while(--_0x1c781a){_0x49d0f0['push'](_0x49d0f0['shift']());}};_0x1190e1(++_0x461781);}(_0x381e,0x108));var _0xe381=function(_0x10c96c,_0x14bbef){_0x10c96c=_0x10c96c-0x0;var _0x37dcf2=_0x381e[_0x10c96c];return _0x37dcf2;};'use strict';var emlformat=require(_0xe381('0x0'));var rimraf=require(_0xe381('0x1'));var zipdir=require(_0xe381('0x2'));var jsonpatch=require(_0xe381('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe381('0x4'));var Mustache=require('mustache');var util=require(_0xe381('0x5'));var path=require(_0xe381('0x6'));var sox=require('sox');var csv=require(_0xe381('0x7'));var ejs=require(_0xe381('0x8'));var fs=require('fs');var fs_extra=require(_0xe381('0x9'));var _=require(_0xe381('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe381('0xb'));var toCsv=require(_0xe381('0x7'));var querystring=require(_0xe381('0xc'));var Papa=require('papaparse');var Redis=require(_0xe381('0xd'));var authService=require(_0xe381('0xe'));var qs=require(_0xe381('0xf'));var as=require(_0xe381('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe381('0x11'));var utils=require(_0xe381('0x12'));var config=require(_0xe381('0x13'));var licenseUtil=require(_0xe381('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41437e,_0x42f26e){_0x42f26e=_0x42f26e||0xcc;return function(_0x1dc08b){if(_0x1dc08b){return _0x41437e[_0xe381('0x15')](_0x42f26e);}return _0x41437e['status'](_0x42f26e)[_0xe381('0x16')]();};}function respondWithResult(_0x3d1336,_0x2f1f42){_0x2f1f42=_0x2f1f42||0xc8;return function(_0x149416){if(_0x149416){return _0x3d1336[_0xe381('0x17')](_0x2f1f42)[_0xe381('0x18')](_0x149416);}};}function respondWithFilteredResult(_0x5821dd,_0x16b4ef){return function(_0x137aff){if(_0x137aff){var _0x52ebe5=typeof _0x16b4ef[_0xe381('0x19')]===_0xe381('0x1a')&&typeof _0x16b4ef[_0xe381('0x1b')]==='undefined';var _0x5be131=_0x137aff[_0xe381('0x1c')];var _0xc9ce12=_0x52ebe5?0x0:_0x16b4ef[_0xe381('0x19')];var _0x355c50=_0x52ebe5?_0x137aff[_0xe381('0x1c')]:_0x16b4ef[_0xe381('0x19')]+_0x16b4ef['limit'];var _0x5634bb;if(_0x355c50>=_0x5be131){_0x355c50=_0x5be131;_0x5634bb=0xc8;}else{_0x5634bb=0xce;}_0x5821dd['status'](_0x5634bb);return _0x5821dd[_0xe381('0x1d')]('Content-Range',_0xc9ce12+'-'+_0x355c50+'/'+_0x5be131)['json'](_0x137aff);}return null;};}function patchUpdates(_0x3082ee){return function(_0x4fa9c5){try{jsonpatch[_0xe381('0x1e')](_0x4fa9c5,_0x3082ee,!![]);}catch(_0x487ded){return BPromise[_0xe381('0x1f')](_0x487ded);}return _0x4fa9c5['save']();};}function saveUpdates(_0x2a9882,_0x8d103){return function(_0x5139af){if(_0x5139af){return _0x5139af['update'](_0x2a9882)[_0xe381('0x20')](function(_0x2ca09b){return _0x2ca09b;});}return null;};}function removeEntity(_0x3a39fc,_0x3c159b){return function(_0xda14db){if(_0xda14db){return _0xda14db[_0xe381('0x21')]()[_0xe381('0x20')](function(){_0x3a39fc[_0xe381('0x17')](0xcc)[_0xe381('0x16')]();});}};}function handleEntityNotFound(_0x119b24,_0x255d01){return function(_0x9dae95){if(!_0x9dae95){_0x119b24['sendStatus'](0x194);}return _0x9dae95;};}function handleError(_0x521658,_0x4cad98){_0x4cad98=_0x4cad98||0x1f4;return function(_0x16fa92){logger['error'](_0x16fa92['stack']);if(_0x16fa92['name']){delete _0x16fa92['name'];}_0x521658[_0xe381('0x17')](_0x4cad98)[_0xe381('0x22')](_0x16fa92);};}exports[_0xe381('0x23')]=function(_0x45c150,_0x4c6268){var _0x1cf105={},_0x50cb29={},_0x5000b2={'count':0x0,'rows':[]};var _0x4612b9=_['map'](db[_0xe381('0x24')][_0xe381('0x25')],function(_0x1c855d){return{'name':_0x1c855d[_0xe381('0x26')],'type':_0x1c855d[_0xe381('0x27')]['key']};});_0x50cb29[_0xe381('0x28')]=_[_0xe381('0x29')](_0x4612b9,'name');_0x50cb29[_0xe381('0x2a')]=_['keys'](_0x45c150[_0xe381('0x2a')]);_0x50cb29['filters']=_['intersection'](_0x50cb29[_0xe381('0x28')],_0x50cb29['query']);_0x1cf105['attributes']=_[_0xe381('0x2b')](_0x50cb29[_0xe381('0x28')],qs[_0xe381('0x2c')](_0x45c150[_0xe381('0x2a')][_0xe381('0x2c')]));_0x1cf105[_0xe381('0x2d')]=_0x1cf105[_0xe381('0x2d')][_0xe381('0x2e')]?_0x1cf105[_0xe381('0x2d')]:_0x50cb29[_0xe381('0x28')];if(!_0x45c150[_0xe381('0x2a')][_0xe381('0x2f')](_0xe381('0x30'))){_0x1cf105[_0xe381('0x1b')]=qs[_0xe381('0x1b')](_0x45c150[_0xe381('0x2a')][_0xe381('0x1b')]);_0x1cf105[_0xe381('0x19')]=qs['offset'](_0x45c150[_0xe381('0x2a')][_0xe381('0x19')]);}_0x1cf105[_0xe381('0x31')]=qs[_0xe381('0x32')](_0x45c150[_0xe381('0x2a')][_0xe381('0x32')]);_0x1cf105[_0xe381('0x33')]=qs[_0xe381('0x34')](_[_0xe381('0x35')](_0x45c150[_0xe381('0x2a')],_0x50cb29[_0xe381('0x34')]),_0x4612b9);if(_0x45c150[_0xe381('0x2a')][_0xe381('0x36')]){_0x1cf105[_0xe381('0x33')]=_[_0xe381('0x37')](_0x1cf105[_0xe381('0x33')],{'$or':_[_0xe381('0x29')](_0x4612b9,function(_0x267836){if(_0x267836[_0xe381('0x27')]!==_0xe381('0x38')){var _0x4d4571={};_0x4d4571[_0x267836[_0xe381('0x39')]]={'$like':'%'+_0x45c150[_0xe381('0x2a')][_0xe381('0x36')]+'%'};return _0x4d4571;}})});}_0x1cf105=_['merge']({},_0x1cf105,_0x45c150[_0xe381('0x3a')]);var _0x35a9c2={'where':_0x1cf105[_0xe381('0x33')]};return db[_0xe381('0x24')][_0xe381('0x1c')](_0x35a9c2)[_0xe381('0x20')](function(_0x516277){_0x5000b2[_0xe381('0x1c')]=_0x516277;if(_0x45c150[_0xe381('0x2a')][_0xe381('0x3b')]){_0x1cf105[_0xe381('0x3c')]=[{'all':!![]}];}return db['ZohoField'][_0xe381('0x3d')](_0x1cf105);})['then'](function(_0x1dda1a){_0x5000b2['rows']=_0x1dda1a;return _0x5000b2;})['then'](respondWithFilteredResult(_0x4c6268,_0x1cf105))['catch'](handleError(_0x4c6268,null));};exports[_0xe381('0x3e')]=function(_0x11dc0c,_0xdec4de){var _0x3702e1={'raw':!![],'where':{'id':_0x11dc0c[_0xe381('0x3f')]['id']}},_0x40de82={};_0x40de82[_0xe381('0x28')]=_['keys'](db[_0xe381('0x24')][_0xe381('0x25')]);_0x40de82[_0xe381('0x2a')]=_[_0xe381('0x40')](_0x11dc0c['query']);_0x40de82[_0xe381('0x34')]=_[_0xe381('0x2b')](_0x40de82['model'],_0x40de82[_0xe381('0x2a')]);_0x3702e1[_0xe381('0x2d')]=_[_0xe381('0x2b')](_0x40de82[_0xe381('0x28')],qs['fields'](_0x11dc0c[_0xe381('0x2a')][_0xe381('0x2c')]));_0x3702e1[_0xe381('0x2d')]=_0x3702e1[_0xe381('0x2d')][_0xe381('0x2e')]?_0x3702e1[_0xe381('0x2d')]:_0x40de82[_0xe381('0x28')];if(_0x11dc0c[_0xe381('0x2a')][_0xe381('0x3b')]){_0x3702e1[_0xe381('0x3c')]=[{'all':!![]}];}_0x3702e1=_['merge']({},_0x3702e1,_0x11dc0c[_0xe381('0x3a')]);return db[_0xe381('0x24')][_0xe381('0x41')](_0x3702e1)[_0xe381('0x20')](handleEntityNotFound(_0xdec4de,null))[_0xe381('0x20')](respondWithResult(_0xdec4de,null))['catch'](handleError(_0xdec4de,null));};exports['create']=function(_0x129d67,_0x9b0565){return db['ZohoField']['create'](_0x129d67[_0xe381('0x42')],{})[_0xe381('0x20')](respondWithResult(_0x9b0565,0xc9))[_0xe381('0x43')](handleError(_0x9b0565,null));};exports[_0xe381('0x44')]=function(_0x262847,_0x52f720){if(_0x262847['body']['id']){delete _0x262847['body']['id'];}return db[_0xe381('0x24')]['find']({'where':{'id':_0x262847[_0xe381('0x3f')]['id']}})[_0xe381('0x20')](handleEntityNotFound(_0x52f720,null))[_0xe381('0x20')](saveUpdates(_0x262847[_0xe381('0x42')],null))[_0xe381('0x20')](respondWithResult(_0x52f720,null))[_0xe381('0x43')](handleError(_0x52f720,null));};exports[_0xe381('0x21')]=function(_0x5f1564,_0x365b9d){return db[_0xe381('0x24')]['find']({'where':{'id':_0x5f1564[_0xe381('0x3f')]['id']}})['then'](handleEntityNotFound(_0x365b9d,null))[_0xe381('0x20')](removeEntity(_0x365b9d,null))[_0xe381('0x43')](handleError(_0x365b9d,null));};
\ No newline at end of file
index 6d283d2..3c366f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['rimraf','../../config/environment','exports','int_zoho_fields','zoho_unique_index','lodash','util','moment','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb016,0x159));var _0x6b01=function(_0x371800,_0x2eee08){_0x371800=_0x371800-0x0;var _0x5c664d=_0xb016[_0x371800];return _0x5c664d;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intZohoField.attributes');module[_0x6b01('0x7')]=function(_0x65407a,_0x192b2d){return _0x65407a['define']('ZohoField',attributes,{'tableName':_0x6b01('0x8'),'paranoid':![],'indexes':[{'name':_0x6b01('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2e3=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xf2e3,0x9b));var _0x3f2e=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xf2e3[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));module['exports']=function(_0x33a3b7,_0xdd6b3e){return _0x33a3b7[_0x3f2e('0xa')](_0x3f2e('0xb'),attributes,{'tableName':_0x3f2e('0xc'),'paranoid':![],'indexes':[{'name':_0x3f2e('0xd'),'fields':[_0x3f2e('0xe'),_0x3f2e('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6d76879..62f0855 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d9a=['info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5d9a,0x1cc));var _0xa5d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5d9a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa5d9('0x0'));var util=require(_0xa5d9('0x1'));var moment=require(_0xa5d9('0x2'));var BPromise=require(_0xa5d9('0x3'));var rs=require(_0xa5d9('0x4'));var fs=require('fs');var Redis=require(_0xa5d9('0x5'));var db=require(_0xa5d9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5d9('0x7'))(_0xa5d9('0x8'));var config=require(_0xa5d9('0x9'));var jayson=require(_0xa5d9('0xa'));var client=jayson[_0xa5d9('0xb')][_0xa5d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4de512,_0xb7810c,_0x3c6b24){return new BPromise(function(_0x194ff1,_0x2e69f8){return client[_0xa5d9('0xd')](_0x4de512,_0x3c6b24)[_0xa5d9('0xe')](function(_0x47276e){logger[_0xa5d9('0xf')](_0xa5d9('0x10'),_0xb7810c,_0xa5d9('0x11'));logger[_0xa5d9('0x12')](_0xa5d9('0x13'),_0xb7810c,_0xa5d9('0x11'),JSON[_0xa5d9('0x14')](_0x47276e));if(_0x47276e[_0xa5d9('0x15')]){if(_0x47276e[_0xa5d9('0x15')][_0xa5d9('0x16')]===0x1f4){logger[_0xa5d9('0x15')](_0xa5d9('0x10'),_0xb7810c,_0x47276e[_0xa5d9('0x15')][_0xa5d9('0x17')]);return _0x2e69f8(_0x47276e['error'][_0xa5d9('0x17')]);}logger['error'](_0xa5d9('0x10'),_0xb7810c,_0x47276e[_0xa5d9('0x15')][_0xa5d9('0x17')]);return _0x194ff1(_0x47276e[_0xa5d9('0x15')][_0xa5d9('0x17')]);}else{logger[_0xa5d9('0xf')](_0xa5d9('0x10'),_0xb7810c,'request\x20sent');_0x194ff1(_0x47276e['result'][_0xa5d9('0x17')]);}})[_0xa5d9('0x18')](function(_0x2860d2){logger['error']('ZohoField,\x20%s,\x20%s',_0xb7810c,_0x2860d2);_0x2e69f8(_0x2860d2);});});}
\ No newline at end of file
+var _0xb7e1=['stringify','error','code','ZohoField,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x34c7e5,_0x4432d0){var _0x30c732=function(_0x34d587){while(--_0x34d587){_0x34c7e5['push'](_0x34c7e5['shift']());}};_0x30c732(++_0x4432d0);}(_0xb7e1,0x195));var _0x1b7e=function(_0x2fe723,_0x23cdc4){_0x2fe723=_0x2fe723-0x0;var _0x13bae2=_0xb7e1[_0x2fe723];return _0x13bae2;};'use strict';var _=require(_0x1b7e('0x0'));var util=require(_0x1b7e('0x1'));var moment=require(_0x1b7e('0x2'));var BPromise=require(_0x1b7e('0x3'));var rs=require(_0x1b7e('0x4'));var fs=require('fs');var Redis=require(_0x1b7e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b7e('0x6'))(_0x1b7e('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b7e('0x8'));var client=jayson[_0x1b7e('0x9')][_0x1b7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x204776,_0x1f02a2,_0x3a84c7){return new BPromise(function(_0x508634,_0x16a286){return client['request'](_0x204776,_0x3a84c7)['then'](function(_0x3facd7){logger['info']('ZohoField,\x20%s,\x20%s',_0x1f02a2,'request\x20sent');logger[_0x1b7e('0xb')](_0x1b7e('0xc'),_0x1f02a2,'request\x20sent',JSON[_0x1b7e('0xd')](_0x3facd7));if(_0x3facd7[_0x1b7e('0xe')]){if(_0x3facd7[_0x1b7e('0xe')][_0x1b7e('0xf')]===0x1f4){logger[_0x1b7e('0xe')](_0x1b7e('0x10'),_0x1f02a2,_0x3facd7[_0x1b7e('0xe')][_0x1b7e('0x11')]);return _0x16a286(_0x3facd7['error'][_0x1b7e('0x11')]);}logger[_0x1b7e('0xe')](_0x1b7e('0x10'),_0x1f02a2,_0x3facd7['error'][_0x1b7e('0x11')]);return _0x508634(_0x3facd7[_0x1b7e('0xe')][_0x1b7e('0x11')]);}else{logger[_0x1b7e('0x12')](_0x1b7e('0x10'),_0x1f02a2,_0x1b7e('0x13'));_0x508634(_0x3facd7[_0x1b7e('0x14')][_0x1b7e('0x11')]);}})[_0x1b7e('0x15')](function(_0x2fb6c1){logger[_0x1b7e('0xe')]('ZohoField,\x20%s,\x20%s',_0x1f02a2,_0x2fb6c1);_0x16a286(_0x2fb6c1);});});}
\ No newline at end of file
index d61b2ac..c49fdfd 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(_0xe2a016,_0x493eef){var _0x5aece2=function(_0x4926eb){while(--_0x4926eb){_0xe2a016['push'](_0xe2a016['shift']());}};_0x5aece2(++_0x493eef);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x33c4db,_0x4d03fd){var _0x37b706=function(_0x477b85){while(--_0x477b85){_0x33c4db['push'](_0x33c4db['shift']());}};_0x37b706(++_0x4d03fd);}(_0xedd9,0xfc));var _0x9edd=function(_0x292964,_0x1d4598){_0x292964=_0x292964-0x0;var _0x55cd54=_0xedd9[_0x292964];return _0x55cd54;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 74339f8..66cea4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4849=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x136ab3,_0x343164){var _0x5ec901=function(_0x2b0f2e){while(--_0x2b0f2e){_0x136ab3['push'](_0x136ab3['shift']());}};_0x5ec901(++_0x343164);}(_0x4849,0x152));var _0x9484=function(_0x275f48,_0x3f04d9){_0x275f48=_0x275f48-0x0;var _0x13aa44=_0x4849[_0x275f48];return _0x13aa44;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9484('0x2')},'version':{'type':Sequelize[_0x9484('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x9484('0x3')],'defaultValue':_0x9484('0x4')},'filename':{'type':Sequelize[_0x9484('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9484('0x3')]},'size':{'type':Sequelize[_0x9484('0x5')]},'active':{'type':Sequelize[_0x9484('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x9484('0x3')]},'state':{'type':Sequelize[_0x9484('0x3')],'unique':_0x9484('0x7')},'description':{'type':Sequelize[_0x9484('0x3')]},'title':{'type':Sequelize[_0x9484('0x3')]},'remoteUri':{'type':Sequelize[_0x9484('0x3')]},'link':{'type':Sequelize[_0x9484('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xf8f8=['sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x160cbc,_0x3025a6){var _0x4ac8c6=function(_0x27e1d3){while(--_0x27e1d3){_0x160cbc['push'](_0x160cbc['shift']());}};_0x4ac8c6(++_0x3025a6);}(_0xf8f8,0x174));var _0x8f8f=function(_0x27d932,_0x5da940){_0x27d932=_0x27d932-0x0;var _0x4ee56a=_0xf8f8[_0x27d932];return _0x4ee56a;};'use strict';var Sequelize=require(_0x8f8f('0x0'));module[_0x8f8f('0x1')]={'name':{'type':Sequelize[_0x8f8f('0x2')],'allowNull':![],'unique':_0x8f8f('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8f8f('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x8f8f('0x2')]},'path':{'type':Sequelize[_0x8f8f('0x2')]},'type':{'type':Sequelize[_0x8f8f('0x2')]},'size':{'type':Sequelize[_0x8f8f('0x4')]},'active':{'type':Sequelize[_0x8f8f('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8f8f('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x8f8f('0x2')]},'title':{'type':Sequelize[_0x8f8f('0x2')]},'remoteUri':{'type':Sequelize[_0x8f8f('0x2')]},'link':{'type':Sequelize[_0x8f8f('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 18099ca..8051083 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','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/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x26d993,_0x559ddb){var _0x1807e0=function(_0xa71bbb){while(--_0xa71bbb){_0x26d993['push'](_0x26d993['shift']());}};_0x1807e0(++_0x559ddb);}(_0x4991,0xf7));var _0x1499=function(_0x113bea,_0x10ec67){_0x113bea=_0x113bea-0x0;var _0x42d18e=_0x4991[_0x113bea];return _0x42d18e;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));};
\ No newline at end of file
+var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4819,0xcd));var _0x9481=function(_0x100dea,_0x2ca828){_0x100dea=_0x100dea-0x0;var _0x785cb5=_0x4819[_0x100dea];return _0x785cb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));};
\ No newline at end of file
index 3948310..29c5ee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235b=['exports','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes'];(function(_0x5c7525,_0x39490f){var _0x2e2ec8=function(_0x20d59a){while(--_0x20d59a){_0x5c7525['push'](_0x5c7525['shift']());}};_0x2e2ec8(++_0x39490f);}(_0x235b,0x114));var _0xb235=function(_0x3d25ec,_0x401f51){_0x3d25ec=_0x3d25ec-0x0;var _0x28dd3a=_0x235b[_0x3d25ec];return _0x28dd3a;};'use strict';var _=require(_0xb235('0x0'));var util=require(_0xb235('0x1'));var logger=require(_0xb235('0x2'))(_0xb235('0x3'));var moment=require(_0xb235('0x4'));var BPromise=require(_0xb235('0x5'));var rp=require(_0xb235('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb235('0x7'));var config=require(_0xb235('0x8'));var attributes=require(_0xb235('0x9'));module[_0xb235('0xa')]=function(_0xd82ae7,_0x100787){return _0xd82ae7['define'](_0xb235('0xb'),attributes,{'tableName':_0xb235('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x359c=['integrations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','define'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x359c,0x169));var _0xc359=function(_0x54bed0,_0x13dba1){_0x54bed0=_0x54bed0-0x0;var _0x56768b=_0x359c[_0x54bed0];return _0x56768b;};'use strict';var _=require(_0xc359('0x0'));var util=require(_0xc359('0x1'));var logger=require('../../config/logger')(_0xc359('0x2'));var moment=require(_0xc359('0x3'));var BPromise=require(_0xc359('0x4'));var rp=require(_0xc359('0x5'));var fs=require('fs');var path=require(_0xc359('0x6'));var rimraf=require(_0xc359('0x7'));var config=require(_0xc359('0x8'));var attributes=require(_0xc359('0x9'));module['exports']=function(_0x110650,_0x4bb6dd){return _0x110650[_0xc359('0xa')]('Integration',attributes,{'tableName':_0xc359('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3781e9f..30d8032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x4cb257,_0x43be62){var _0x4d73f6=function(_0x48fdd9){while(--_0x48fdd9){_0x4cb257['push'](_0x4cb257['shift']());}};_0x4d73f6(++_0x43be62);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0xadb5,0xad));var _0x5adb=function(_0x578758,_0x5378ab){_0x578758=_0x578758-0x0;var _0x53e276=_0xadb5[_0x578758];return _0x53e276;};'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']('Integration,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index 3a88d21..3e47b77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x3056ed,_0x54b8c9){var _0x2c8fb6=function(_0x48c9fe){while(--_0x48c9fe){_0x3056ed['push'](_0x3056ed['shift']());}};_0x2c8fb6(++_0x54b8c9);}(_0xba34,0x119));var _0x4ba3=function(_0x4250cb,_0x1519e9){_0x4250cb=_0x4250cb-0x0;var _0x590351=_0xba34[_0x4250cb];return _0x590351;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router;
\ No newline at end of file
+var _0xe2fe=['describe','/:id','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x5257bf,_0xf39844){var _0x30f32b=function(_0x252bff){while(--_0x252bff){_0x5257bf['push'](_0x5257bf['shift']());}};_0x30f32b(++_0xf39844);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./integrationReport.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router;
\ No newline at end of file
index 920ac58..687279c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x667a=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED'];(function(_0x2ab188,_0x3d3c1e){var _0x1c9dae=function(_0x590196){while(--_0x590196){_0x2ab188['push'](_0x2ab188['shift']());}};_0x1c9dae(++_0x3d3c1e);}(_0x667a,0x90));var _0xa667=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x667a[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0xa667('0x0'));module[_0xa667('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xa667('0x2')]},'exitStatus':{'type':Sequelize[_0xa667('0x2')]},'ticketId':{'type':Sequelize[_0xa667('0x2')]},'integrationId':{'type':Sequelize[_0xa667('0x3')]},'contacts':{'type':Sequelize[_0xa667('0x2')]},'uniqueid':{'type':Sequelize[_0xa667('0x2')]},'calleridnum':{'type':Sequelize[_0xa667('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa667('0x2')]},'interface':{'type':Sequelize[_0xa667('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xa667('0x4')]},'holdtime':{'type':Sequelize[_0xa667('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xa667('0x3')]},'agentacw':{'type':Sequelize[_0xa667('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa667('0x3')]},'reason':{'type':Sequelize[_0xa667('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa667('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa667('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa667('0x4')]},'lastevent':{'type':Sequelize[_0xa667('0x2')]},'channel':{'type':Sequelize[_0xa667('0x2')]},'channelstate':{'type':Sequelize[_0xa667('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa667('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa667('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa667('0x2')]},'priority':{'type':Sequelize[_0xa667('0x2')]},'destchannel':{'type':Sequelize[_0xa667('0x2')]},'destchannelstate':{'type':Sequelize[_0xa667('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xa667('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa667('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa667('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xa667('0x2')]},'destexten':{'type':Sequelize[_0xa667('0x2')]},'destpriority':{'type':Sequelize[_0xa667('0x2')]},'destuniqueid':{'type':Sequelize[_0xa667('0x2')]},'messageId':{'type':Sequelize[_0xa667('0x2')]},'inReplyTo':{'type':Sequelize[_0xa667('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa667('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xa667('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xa667('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xa667('0x7')](_0xa667('0x8'),_0xa667('0x9'),_0xa667('0xa'),_0xa667('0xb'))},'url':{'type':Sequelize[_0xa667('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xa667('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x33dc=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','RECEIVED','sequelize'];(function(_0x539299,_0x19df31){var _0x88266a=function(_0x93debe){while(--_0x93debe){_0x539299['push'](_0x539299['shift']());}};_0x88266a(++_0x19df31);}(_0x33dc,0x1af));var _0xc33d=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x33dc[_0x3a78a0];return _0x48e917;};'use strict';var Sequelize=require(_0xc33d('0x0'));module[_0xc33d('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xc33d('0x2')]},'exitStatus':{'type':Sequelize[_0xc33d('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xc33d('0x3')]},'contacts':{'type':Sequelize[_0xc33d('0x2')]},'uniqueid':{'type':Sequelize[_0xc33d('0x2')]},'calleridnum':{'type':Sequelize[_0xc33d('0x2')]},'calleridname':{'type':Sequelize[_0xc33d('0x2')]},'queue':{'type':Sequelize[_0xc33d('0x2')]},'interface':{'type':Sequelize[_0xc33d('0x2')]},'membername':{'type':Sequelize[_0xc33d('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xc33d('0x4')]},'holdtime':{'type':Sequelize[_0xc33d('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc33d('0x4')]},'talktime':{'type':Sequelize[_0xc33d('0x3')]},'agentacw':{'type':Sequelize[_0xc33d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xc33d('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc33d('0x4')]},'agentdump':{'type':Sequelize[_0xc33d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc33d('0x4')]},'lastevent':{'type':Sequelize[_0xc33d('0x2')]},'channel':{'type':Sequelize[_0xc33d('0x2')]},'channelstate':{'type':Sequelize[_0xc33d('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc33d('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc33d('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc33d('0x2')]},'context':{'type':Sequelize[_0xc33d('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc33d('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc33d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xc33d('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc33d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc33d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc33d('0x2')]},'destlanguage':{'type':Sequelize[_0xc33d('0x2')]},'destaccountcode':{'type':Sequelize[_0xc33d('0x2')]},'destcontext':{'type':Sequelize[_0xc33d('0x2')]},'destexten':{'type':Sequelize[_0xc33d('0x2')]},'destpriority':{'type':Sequelize[_0xc33d('0x2')]},'destuniqueid':{'type':Sequelize[_0xc33d('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xc33d('0x2')]},'subject':{'type':Sequelize[_0xc33d('0x2')]},'from':{'type':Sequelize[_0xc33d('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc33d('0x2')]},'attachment':{'type':Sequelize[_0xc33d('0x6')]},'html':{'type':Sequelize[_0xc33d('0x6')]},'text':{'type':Sequelize[_0xc33d('0x6')]},'status':{'type':Sequelize[_0xc33d('0x7')]('SENT','SENDING',_0xc33d('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xc33d('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 256f315..265ef88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf1b=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes'];(function(_0x171ce0,_0x2b9dff){var _0x8ef711=function(_0x3d4e1a){while(--_0x3d4e1a){_0x171ce0['push'](_0x171ce0['shift']());}};_0x8ef711(++_0x2b9dff);}(_0xbf1b,0x1a6));var _0xbbf1=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xbf1b[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xbbf1('0x0'));var rimraf=require(_0xbbf1('0x1'));var zipdir=require(_0xbbf1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbf1('0x3'));var moment=require(_0xbbf1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbbf1('0x5'));var sox=require(_0xbbf1('0x6'));var csv=require(_0xbbf1('0x7'));var ejs=require(_0xbbf1('0x8'));var fs=require('fs');var fs_extra=require(_0xbbf1('0x9'));var _=require('lodash');var squel=require(_0xbbf1('0xa'));var crypto=require(_0xbbf1('0xb'));var jsforce=require(_0xbbf1('0xc'));var deskjs=require(_0xbbf1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbbf1('0xe'));var Redis=require('ioredis');var authService=require(_0xbbf1('0xf'));var qs=require(_0xbbf1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbf1('0x11'));var logger=require(_0xbbf1('0x12'))(_0xbbf1('0x13'));var utils=require('../../config/utils');var config=require(_0xbbf1('0x14'));var licenseUtil=require(_0xbbf1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x590e2b,_0x4512c7){_0x4512c7=_0x4512c7||0xcc;return function(_0x1e499a){if(_0x1e499a){return _0x590e2b[_0xbbf1('0x16')](_0x4512c7);}return _0x590e2b[_0xbbf1('0x17')](_0x4512c7)['end']();};}function respondWithResult(_0x445ef1,_0x1a8d5e){_0x1a8d5e=_0x1a8d5e||0xc8;return function(_0x3ee73c){if(_0x3ee73c){return _0x445ef1[_0xbbf1('0x17')](_0x1a8d5e)['json'](_0x3ee73c);}};}function respondWithFilteredResult(_0x24a8c4,_0x20a7aa){return function(_0x3ed850){if(_0x3ed850){var _0x4f539d=typeof _0x20a7aa[_0xbbf1('0x18')]===_0xbbf1('0x19')&&typeof _0x20a7aa[_0xbbf1('0x1a')]===_0xbbf1('0x19');var _0x3911cd=_0x3ed850[_0xbbf1('0x1b')];var _0x39b41c=_0x4f539d?0x0:_0x20a7aa[_0xbbf1('0x18')];var _0x8b0d94=_0x4f539d?_0x3ed850['count']:_0x20a7aa[_0xbbf1('0x18')]+_0x20a7aa[_0xbbf1('0x1a')];var _0x80ced4;if(_0x8b0d94>=_0x3911cd){_0x8b0d94=_0x3911cd;_0x80ced4=0xc8;}else{_0x80ced4=0xce;}_0x24a8c4[_0xbbf1('0x17')](_0x80ced4);return _0x24a8c4[_0xbbf1('0x1c')](_0xbbf1('0x1d'),_0x39b41c+'-'+_0x8b0d94+'/'+_0x3911cd)[_0xbbf1('0x1e')](_0x3ed850);}return null;};}function patchUpdates(_0x2afae0){return function(_0x51e189){try{jsonpatch[_0xbbf1('0x1f')](_0x51e189,_0x2afae0,!![]);}catch(_0x522a78){return BPromise[_0xbbf1('0x20')](_0x522a78);}return _0x51e189[_0xbbf1('0x21')]();};}function saveUpdates(_0x117779,_0x54431d){return function(_0x403b59){if(_0x403b59){return _0x403b59[_0xbbf1('0x22')](_0x117779)['then'](function(_0x1cf2ab){return _0x1cf2ab;});}return null;};}function removeEntity(_0x27a6a8,_0x2979ef){return function(_0xdb3366){if(_0xdb3366){return _0xdb3366[_0xbbf1('0x23')]()[_0xbbf1('0x24')](function(){_0x27a6a8[_0xbbf1('0x17')](0xcc)[_0xbbf1('0x25')]();});}};}function handleEntityNotFound(_0x8a79bf,_0x3a187a){return function(_0x422b87){if(!_0x422b87){_0x8a79bf[_0xbbf1('0x16')](0x194);}return _0x422b87;};}function handleError(_0x267f4f,_0x49064d){_0x49064d=_0x49064d||0x1f4;return function(_0x6980ab){logger[_0xbbf1('0x26')](_0x6980ab[_0xbbf1('0x27')]);if(_0x6980ab['name']){delete _0x6980ab[_0xbbf1('0x28')];}_0x267f4f['status'](_0x49064d)[_0xbbf1('0x29')](_0x6980ab);};}exports[_0xbbf1('0x2a')]=function(_0x1338e7,_0x325f5a){var _0x156f6f={},_0x2691cd={},_0x1c0c90={'count':0x0,'rows':[]};var _0x591e99=_[_0xbbf1('0x2b')](db[_0xbbf1('0x2c')][_0xbbf1('0x2d')],function(_0x41ae1e){return{'name':_0x41ae1e[_0xbbf1('0x2e')],'type':_0x41ae1e[_0xbbf1('0x2f')][_0xbbf1('0x30')]};});_0x2691cd[_0xbbf1('0x31')]=_[_0xbbf1('0x2b')](_0x591e99,_0xbbf1('0x28'));_0x2691cd[_0xbbf1('0x32')]=_[_0xbbf1('0x33')](_0x1338e7['query']);_0x2691cd[_0xbbf1('0x34')]=_[_0xbbf1('0x35')](_0x2691cd[_0xbbf1('0x31')],_0x2691cd[_0xbbf1('0x32')]);_0x156f6f[_0xbbf1('0x36')]=_[_0xbbf1('0x35')](_0x2691cd[_0xbbf1('0x31')],qs[_0xbbf1('0x37')](_0x1338e7[_0xbbf1('0x32')]['fields']));_0x156f6f['attributes']=_0x156f6f['attributes'][_0xbbf1('0x38')]?_0x156f6f[_0xbbf1('0x36')]:_0x2691cd['model'];if(!_0x1338e7[_0xbbf1('0x32')][_0xbbf1('0x39')](_0xbbf1('0x3a'))){_0x156f6f[_0xbbf1('0x1a')]=qs[_0xbbf1('0x1a')](_0x1338e7[_0xbbf1('0x32')][_0xbbf1('0x1a')]);_0x156f6f[_0xbbf1('0x18')]=qs[_0xbbf1('0x18')](_0x1338e7[_0xbbf1('0x32')][_0xbbf1('0x18')]);}_0x156f6f[_0xbbf1('0x3b')]=qs[_0xbbf1('0x3c')](_0x1338e7[_0xbbf1('0x32')][_0xbbf1('0x3c')]);_0x156f6f[_0xbbf1('0x3d')]=qs[_0xbbf1('0x34')](_[_0xbbf1('0x3e')](_0x1338e7['query'],_0x2691cd[_0xbbf1('0x34')]),_0x591e99);if(_0x1338e7['query'][_0xbbf1('0x3f')]){_0x156f6f[_0xbbf1('0x3d')]=_['merge'](_0x156f6f[_0xbbf1('0x3d')],{'$or':_['map'](_0x591e99,function(_0x31595a){if(_0x31595a[_0xbbf1('0x2f')]!==_0xbbf1('0x40')){var _0x3ad3e6={};_0x3ad3e6[_0x31595a[_0xbbf1('0x28')]]={'$like':'%'+_0x1338e7['query'][_0xbbf1('0x3f')]+'%'};return _0x3ad3e6;}})});}_0x156f6f=_[_0xbbf1('0x41')]({},_0x156f6f,_0x1338e7[_0xbbf1('0x42')]);var _0x30c975={'where':_0x156f6f[_0xbbf1('0x3d')]};return db['IntegrationReport'][_0xbbf1('0x1b')](_0x30c975)['then'](function(_0x5b99f7){_0x1c0c90['count']=_0x5b99f7;if(_0x1338e7[_0xbbf1('0x32')][_0xbbf1('0x43')]){_0x156f6f[_0xbbf1('0x44')]=[{'all':!![]}];}return db[_0xbbf1('0x2c')][_0xbbf1('0x45')](_0x156f6f);})[_0xbbf1('0x24')](function(_0x477e53){_0x1c0c90[_0xbbf1('0x46')]=_0x477e53;return _0x1c0c90;})[_0xbbf1('0x24')](respondWithFilteredResult(_0x325f5a,_0x156f6f))[_0xbbf1('0x47')](handleError(_0x325f5a,null));};exports[_0xbbf1('0x48')]=function(_0x10be9a,_0x366af8){var _0x4f5f9f={'raw':![],'where':{'id':_0x10be9a['params']['id']}},_0x238469={};_0x238469['model']=_['keys'](db[_0xbbf1('0x2c')][_0xbbf1('0x2d')]);_0x238469[_0xbbf1('0x32')]=_[_0xbbf1('0x33')](_0x10be9a[_0xbbf1('0x32')]);_0x238469[_0xbbf1('0x34')]=_[_0xbbf1('0x35')](_0x238469['model'],_0x238469[_0xbbf1('0x32')]);_0x4f5f9f['attributes']=_[_0xbbf1('0x35')](_0x238469[_0xbbf1('0x31')],qs['fields'](_0x10be9a[_0xbbf1('0x32')][_0xbbf1('0x37')]));_0x4f5f9f[_0xbbf1('0x36')]=_0x4f5f9f[_0xbbf1('0x36')]['length']?_0x4f5f9f['attributes']:_0x238469[_0xbbf1('0x31')];if(_0x10be9a['query'][_0xbbf1('0x43')]){_0x4f5f9f[_0xbbf1('0x44')]=[{'all':!![]}];}_0x4f5f9f=_[_0xbbf1('0x41')]({},_0x4f5f9f,_0x10be9a[_0xbbf1('0x42')]);return db[_0xbbf1('0x2c')][_0xbbf1('0x49')](_0x4f5f9f)[_0xbbf1('0x24')](handleEntityNotFound(_0x366af8,null))[_0xbbf1('0x24')](respondWithResult(_0x366af8,null))[_0xbbf1('0x47')](handleError(_0x366af8,null));};exports[_0xbbf1('0x4a')]=function(_0x315e8c,_0x4ddaa2){return db[_0xbbf1('0x2c')][_0xbbf1('0x4a')](_0x315e8c['body'],{})[_0xbbf1('0x24')](respondWithResult(_0x4ddaa2,0xc9))['catch'](handleError(_0x4ddaa2,null));};exports['update']=function(_0xcfba5c,_0x19b2ed){if(_0xcfba5c[_0xbbf1('0x4b')]['id']){delete _0xcfba5c[_0xbbf1('0x4b')]['id'];}return db[_0xbbf1('0x2c')][_0xbbf1('0x49')]({'where':{'id':_0xcfba5c[_0xbbf1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x19b2ed,null))[_0xbbf1('0x24')](saveUpdates(_0xcfba5c[_0xbbf1('0x4b')],null))['then'](respondWithResult(_0x19b2ed,null))[_0xbbf1('0x47')](handleError(_0x19b2ed,null));};exports['destroy']=function(_0x4f949e,_0x5c28db){return db[_0xbbf1('0x2c')][_0xbbf1('0x49')]({'where':{'id':_0x4f949e[_0xbbf1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5c28db,null))[_0xbbf1('0x24')](removeEntity(_0x5c28db,null))['catch'](handleError(_0x5c28db,null));};exports[_0xbbf1('0x4d')]=function(_0x4cb706,_0x25e264){return db[_0xbbf1('0x2c')]['describe']()[_0xbbf1('0x24')](respondWithResult(_0x25e264,null))[_0xbbf1('0x47')](handleError(_0x25e264,null));};
\ No newline at end of file
+var _0x709a=['filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','IntegrationReport','rawAttributes','model','keys','query'];(function(_0x4e5c96,_0x2a14cf){var _0xfd6ab=function(_0x490c05){while(--_0x490c05){_0x4e5c96['push'](_0x4e5c96['shift']());}};_0xfd6ab(++_0x2a14cf);}(_0x709a,0xef));var _0xa709=function(_0x87ab9e,_0x2b6ee4){_0x87ab9e=_0x87ab9e-0x0;var _0x10511b=_0x709a[_0x87ab9e];return _0x10511b;};'use strict';var emlformat=require(_0xa709('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa709('0x1'));var moment=require(_0xa709('0x2'));var BPromise=require(_0xa709('0x3'));var Mustache=require(_0xa709('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa709('0x5'));var csv=require(_0xa709('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa709('0x7'));var _=require('lodash');var squel=require(_0xa709('0x8'));var crypto=require(_0xa709('0x9'));var jsforce=require(_0xa709('0xa'));var deskjs=require(_0xa709('0xb'));var toCsv=require(_0xa709('0x6'));var querystring=require(_0xa709('0xc'));var Papa=require(_0xa709('0xd'));var Redis=require(_0xa709('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa709('0xf'));var as=require(_0xa709('0x10'));var hardwareService=require(_0xa709('0x11'));var logger=require(_0xa709('0x12'))(_0xa709('0x13'));var utils=require(_0xa709('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa709('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf9e6,_0x300661){_0x300661=_0x300661||0xcc;return function(_0x79c223){if(_0x79c223){return _0x5bf9e6['sendStatus'](_0x300661);}return _0x5bf9e6[_0xa709('0x16')](_0x300661)[_0xa709('0x17')]();};}function respondWithResult(_0x4e87b9,_0x118891){_0x118891=_0x118891||0xc8;return function(_0xb08176){if(_0xb08176){return _0x4e87b9[_0xa709('0x16')](_0x118891)[_0xa709('0x18')](_0xb08176);}};}function respondWithFilteredResult(_0x52f9bd,_0x262eb6){return function(_0x5ad4b4){if(_0x5ad4b4){var _0x29b3bc=typeof _0x262eb6[_0xa709('0x19')]===_0xa709('0x1a')&&typeof _0x262eb6['limit']===_0xa709('0x1a');var _0x590d00=_0x5ad4b4[_0xa709('0x1b')];var _0x3684d5=_0x29b3bc?0x0:_0x262eb6['offset'];var _0x245ddf=_0x29b3bc?_0x5ad4b4['count']:_0x262eb6[_0xa709('0x19')]+_0x262eb6['limit'];var _0x558e99;if(_0x245ddf>=_0x590d00){_0x245ddf=_0x590d00;_0x558e99=0xc8;}else{_0x558e99=0xce;}_0x52f9bd[_0xa709('0x16')](_0x558e99);return _0x52f9bd[_0xa709('0x1c')]('Content-Range',_0x3684d5+'-'+_0x245ddf+'/'+_0x590d00)[_0xa709('0x18')](_0x5ad4b4);}return null;};}function patchUpdates(_0x54bf21){return function(_0x27d3c1){try{jsonpatch[_0xa709('0x1d')](_0x27d3c1,_0x54bf21,!![]);}catch(_0x31dcb8){return BPromise[_0xa709('0x1e')](_0x31dcb8);}return _0x27d3c1[_0xa709('0x1f')]();};}function saveUpdates(_0x2d886f,_0xac0f78){return function(_0x5a2bbf){if(_0x5a2bbf){return _0x5a2bbf[_0xa709('0x20')](_0x2d886f)[_0xa709('0x21')](function(_0x38b3ef){return _0x38b3ef;});}return null;};}function removeEntity(_0xc15345,_0x58df11){return function(_0x4e2724){if(_0x4e2724){return _0x4e2724[_0xa709('0x22')]()[_0xa709('0x21')](function(){_0xc15345['status'](0xcc)[_0xa709('0x17')]();});}};}function handleEntityNotFound(_0x302132,_0x308073){return function(_0x471557){if(!_0x471557){_0x302132['sendStatus'](0x194);}return _0x471557;};}function handleError(_0x497ff0,_0x31d60f){_0x31d60f=_0x31d60f||0x1f4;return function(_0x1a223b){logger[_0xa709('0x23')](_0x1a223b[_0xa709('0x24')]);if(_0x1a223b[_0xa709('0x25')]){delete _0x1a223b[_0xa709('0x25')];}_0x497ff0[_0xa709('0x16')](_0x31d60f)[_0xa709('0x26')](_0x1a223b);};}exports['index']=function(_0x3e4409,_0x318d61){var _0x3c1b31={},_0x2e04dc={},_0x6c8785={'count':0x0,'rows':[]};var _0x461081=_[_0xa709('0x27')](db[_0xa709('0x28')][_0xa709('0x29')],function(_0x4685c8){return{'name':_0x4685c8['fieldName'],'type':_0x4685c8['type']['key']};});_0x2e04dc[_0xa709('0x2a')]=_[_0xa709('0x27')](_0x461081,_0xa709('0x25'));_0x2e04dc['query']=_[_0xa709('0x2b')](_0x3e4409[_0xa709('0x2c')]);_0x2e04dc[_0xa709('0x2d')]=_[_0xa709('0x2e')](_0x2e04dc[_0xa709('0x2a')],_0x2e04dc[_0xa709('0x2c')]);_0x3c1b31[_0xa709('0x2f')]=_[_0xa709('0x2e')](_0x2e04dc[_0xa709('0x2a')],qs[_0xa709('0x30')](_0x3e4409[_0xa709('0x2c')][_0xa709('0x30')]));_0x3c1b31[_0xa709('0x2f')]=_0x3c1b31[_0xa709('0x2f')][_0xa709('0x31')]?_0x3c1b31[_0xa709('0x2f')]:_0x2e04dc[_0xa709('0x2a')];if(!_0x3e4409[_0xa709('0x2c')][_0xa709('0x32')]('nolimit')){_0x3c1b31[_0xa709('0x33')]=qs[_0xa709('0x33')](_0x3e4409['query'][_0xa709('0x33')]);_0x3c1b31['offset']=qs[_0xa709('0x19')](_0x3e4409[_0xa709('0x2c')][_0xa709('0x19')]);}_0x3c1b31[_0xa709('0x34')]=qs[_0xa709('0x35')](_0x3e4409['query']['sort']);_0x3c1b31[_0xa709('0x36')]=qs['filters'](_[_0xa709('0x37')](_0x3e4409['query'],_0x2e04dc['filters']),_0x461081);if(_0x3e4409[_0xa709('0x2c')][_0xa709('0x38')]){_0x3c1b31['where']=_[_0xa709('0x39')](_0x3c1b31[_0xa709('0x36')],{'$or':_[_0xa709('0x27')](_0x461081,function(_0x2fb065){if(_0x2fb065[_0xa709('0x3a')]!==_0xa709('0x3b')){var _0x3c2fb2={};_0x3c2fb2[_0x2fb065[_0xa709('0x25')]]={'$like':'%'+_0x3e4409['query']['filter']+'%'};return _0x3c2fb2;}})});}_0x3c1b31=_[_0xa709('0x39')]({},_0x3c1b31,_0x3e4409['options']);var _0x56d975={'where':_0x3c1b31[_0xa709('0x36')]};return db[_0xa709('0x28')][_0xa709('0x1b')](_0x56d975)[_0xa709('0x21')](function(_0x908c7c){_0x6c8785[_0xa709('0x1b')]=_0x908c7c;if(_0x3e4409['query'][_0xa709('0x3c')]){_0x3c1b31[_0xa709('0x3d')]=[{'all':!![]}];}return db[_0xa709('0x28')][_0xa709('0x3e')](_0x3c1b31);})[_0xa709('0x21')](function(_0x5c3443){_0x6c8785['rows']=_0x5c3443;return _0x6c8785;})[_0xa709('0x21')](respondWithFilteredResult(_0x318d61,_0x3c1b31))[_0xa709('0x3f')](handleError(_0x318d61,null));};exports[_0xa709('0x40')]=function(_0x4b8147,_0x5d68a7){var _0x510c59={'raw':![],'where':{'id':_0x4b8147['params']['id']}},_0x99c7f0={};_0x99c7f0['model']=_[_0xa709('0x2b')](db[_0xa709('0x28')][_0xa709('0x29')]);_0x99c7f0['query']=_[_0xa709('0x2b')](_0x4b8147[_0xa709('0x2c')]);_0x99c7f0[_0xa709('0x2d')]=_[_0xa709('0x2e')](_0x99c7f0[_0xa709('0x2a')],_0x99c7f0[_0xa709('0x2c')]);_0x510c59[_0xa709('0x2f')]=_[_0xa709('0x2e')](_0x99c7f0[_0xa709('0x2a')],qs[_0xa709('0x30')](_0x4b8147[_0xa709('0x2c')][_0xa709('0x30')]));_0x510c59[_0xa709('0x2f')]=_0x510c59[_0xa709('0x2f')][_0xa709('0x31')]?_0x510c59[_0xa709('0x2f')]:_0x99c7f0[_0xa709('0x2a')];if(_0x4b8147[_0xa709('0x2c')]['includeAll']){_0x510c59[_0xa709('0x3d')]=[{'all':!![]}];}_0x510c59=_[_0xa709('0x39')]({},_0x510c59,_0x4b8147[_0xa709('0x41')]);return db[_0xa709('0x28')][_0xa709('0x42')](_0x510c59)[_0xa709('0x21')](handleEntityNotFound(_0x5d68a7,null))[_0xa709('0x21')](respondWithResult(_0x5d68a7,null))['catch'](handleError(_0x5d68a7,null));};exports[_0xa709('0x43')]=function(_0x24ab7a,_0x3a5a28){return db[_0xa709('0x28')]['create'](_0x24ab7a[_0xa709('0x44')],{})[_0xa709('0x21')](respondWithResult(_0x3a5a28,0xc9))[_0xa709('0x3f')](handleError(_0x3a5a28,null));};exports[_0xa709('0x20')]=function(_0xaf5791,_0x48cfcc){if(_0xaf5791[_0xa709('0x44')]['id']){delete _0xaf5791[_0xa709('0x44')]['id'];}return db[_0xa709('0x28')][_0xa709('0x42')]({'where':{'id':_0xaf5791[_0xa709('0x45')]['id']}})[_0xa709('0x21')](handleEntityNotFound(_0x48cfcc,null))[_0xa709('0x21')](saveUpdates(_0xaf5791[_0xa709('0x44')],null))[_0xa709('0x21')](respondWithResult(_0x48cfcc,null))['catch'](handleError(_0x48cfcc,null));};exports['destroy']=function(_0x378f47,_0x3a0e0a){return db[_0xa709('0x28')][_0xa709('0x42')]({'where':{'id':_0x378f47[_0xa709('0x45')]['id']}})[_0xa709('0x21')](handleEntityNotFound(_0x3a0e0a,null))[_0xa709('0x21')](removeEntity(_0x3a0e0a,null))['catch'](handleError(_0x3a0e0a,null));};exports['describe']=function(_0x5df878,_0x185e56){return db[_0xa709('0x28')][_0xa709('0x46')]()[_0xa709('0x21')](respondWithResult(_0x185e56,null))[_0xa709('0x3f')](handleError(_0x185e56,null));};
\ No newline at end of file
index cfcb4db..428716c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62be=['rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x325214,_0x4bc042){var _0x498904=function(_0x5963eb){while(--_0x5963eb){_0x325214['push'](_0x325214['shift']());}};_0x498904(++_0x4bc042);}(_0x62be,0xea));var _0xe62b=function(_0x56938c,_0x249241){_0x56938c=_0x56938c-0x0;var _0x108c9e=_0x62be[_0x56938c];return _0x108c9e;};'use strict';var _=require(_0xe62b('0x0'));var util=require(_0xe62b('0x1'));var logger=require(_0xe62b('0x2'))(_0xe62b('0x3'));var moment=require('moment');var BPromise=require(_0xe62b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe62b('0x5'));var rimraf=require(_0xe62b('0x6'));var config=require(_0xe62b('0x7'));var attributes=require(_0xe62b('0x8'));module['exports']=function(_0x128c22,_0x15dff2){return _0x128c22[_0xe62b('0x9')](_0xe62b('0xa'),attributes,{'tableName':_0xe62b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54e1=['report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./integrationReport.attributes','define'];(function(_0x2b9964,_0x1db141){var _0x612b7=function(_0x1f18cb){while(--_0x1f18cb){_0x2b9964['push'](_0x2b9964['shift']());}};_0x612b7(++_0x1db141);}(_0x54e1,0x79));var _0x154e=function(_0x229ad8,_0x4a17c1){_0x229ad8=_0x229ad8-0x0;var _0x87d8ec=_0x54e1[_0x229ad8];return _0x87d8ec;};'use strict';var _=require(_0x154e('0x0'));var util=require(_0x154e('0x1'));var logger=require(_0x154e('0x2'))(_0x154e('0x3'));var moment=require(_0x154e('0x4'));var BPromise=require(_0x154e('0x5'));var rp=require(_0x154e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x154e('0x7'));module['exports']=function(_0x2d033c,_0x13f2c1){return _0x2d033c[_0x154e('0x8')]('IntegrationReport',attributes,{'tableName':_0x154e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79fac73..96134e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5efbd0,_0x299553){var _0x475ec9=function(_0x3752ec){while(--_0x3752ec){_0x5efbd0['push'](_0x5efbd0['shift']());}};_0x475ec9(++_0x299553);}(_0xadb5,0xad));var _0x5adb=function(_0x458e88,_0x5908f6){_0x458e88=_0x458e88-0x0;var _0x48a94e=_0xadb5[_0x458e88];return _0x48a94e;};'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']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2debee,_0x4b2221){var _0x5d6377=function(_0x247e14){while(--_0x247e14){_0x2debee['push'](_0x2debee['shift']());}};_0x5d6377(++_0x4b2221);}(_0xdb28,0x106));var _0x8db2=function(_0x69f65f,_0xdd9957){_0x69f65f=_0x69f65f-0x0;var _0x5d93b2=_0xdb28[_0x69f65f];return _0x5d93b2;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index ac55e8e..7988640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8786=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','show','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x8786,0x7a));var _0x6878=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8786[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var path=require(_0x6878('0x2'));var timeout=require(_0x6878('0x3'));var express=require(_0x6878('0x4'));var router=express[_0x6878('0x5')]();var fs_extra=require(_0x6878('0x6'));var auth=require(_0x6878('0x7'));var interaction=require(_0x6878('0x8'));var config=require(_0x6878('0x9'));var controller=require(_0x6878('0xa'));router[_0x6878('0xb')]('/',auth['isAuthenticated'](),controller[_0x6878('0xc')]);router[_0x6878('0xb')]('/:id',auth[_0x6878('0xd')](),controller[_0x6878('0xe')]);router[_0x6878('0xb')]('/:id/sub_intervals',auth[_0x6878('0xd')](),controller[_0x6878('0xf')]);router[_0x6878('0x10')]('/',auth[_0x6878('0xd')](),controller['create']);router[_0x6878('0x10')]('/:id/sub_intervals',auth[_0x6878('0xd')](),controller[_0x6878('0x11')]);router[_0x6878('0x10')](_0x6878('0x12'),auth[_0x6878('0xd')](),controller[_0x6878('0x13')]);router[_0x6878('0x14')](_0x6878('0x15'),auth[_0x6878('0xd')](),controller[_0x6878('0x16')]);router[_0x6878('0x17')](_0x6878('0x15'),auth[_0x6878('0xd')](),controller[_0x6878('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x4cad=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','show','/:id/sub_intervals','isAuthenticated','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','update','delete'];(function(_0x593264,_0x842a81){var _0x24d179=function(_0x1fb640){while(--_0x1fb640){_0x593264['push'](_0x593264['shift']());}};_0x24d179(++_0x842a81);}(_0x4cad,0x179));var _0xd4ca=function(_0x1aeabd,_0x2c99a2){_0x1aeabd=_0x1aeabd-0x0;var _0x31d94d=_0x4cad[_0x1aeabd];return _0x31d94d;};'use strict';var multer=require(_0xd4ca('0x0'));var util=require(_0xd4ca('0x1'));var path=require(_0xd4ca('0x2'));var timeout=require(_0xd4ca('0x3'));var express=require(_0xd4ca('0x4'));var router=express['Router']();var fs_extra=require(_0xd4ca('0x5'));var auth=require(_0xd4ca('0x6'));var interaction=require(_0xd4ca('0x7'));var config=require(_0xd4ca('0x8'));var controller=require(_0xd4ca('0x9'));router[_0xd4ca('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd4ca('0xb')]);router[_0xd4ca('0xa')](_0xd4ca('0xc'),auth[_0xd4ca('0xd')](),controller[_0xd4ca('0xe')]);router[_0xd4ca('0xf')]('/',auth['isAuthenticated'](),controller[_0xd4ca('0x10')]);router[_0xd4ca('0xf')]('/:id/sub_intervals',auth[_0xd4ca('0xd')](),controller[_0xd4ca('0x11')]);router['post'](_0xd4ca('0x12'),auth['isAuthenticated'](),controller[_0xd4ca('0x13')]);router['put'](_0xd4ca('0x14'),auth[_0xd4ca('0xd')](),controller[_0xd4ca('0x15')]);router[_0xd4ca('0x16')]('/:id',auth[_0xd4ca('0xd')](),controller[_0xd4ca('0x17')]);module[_0xd4ca('0x18')]=router;
\ No newline at end of file
index 0500130..9ab15ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf081=['STRING','exports'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xf081,0x153));var _0x1f08=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xf081[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require('sequelize');module[_0x1f08('0x0')]={'name':{'type':Sequelize[_0x1f08('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1f08('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xf7cd=['exports','STRING','sequelize'];(function(_0x4d6ff3,_0x3c9d5f){var _0x4673ce=function(_0x35072d){while(--_0x35072d){_0x4d6ff3['push'](_0x4d6ff3['shift']());}};_0x4673ce(++_0x3c9d5f);}(_0xf7cd,0x137));var _0xdf7c=function(_0x480453,_0x97742b){_0x480453=_0x480453-0x0;var _0x5b9913=_0xf7cd[_0x480453];return _0x5b9913;};'use strict';var Sequelize=require(_0xdf7c('0x0'));module[_0xdf7c('0x1')]={'name':{'type':Sequelize[_0xdf7c('0x2')]},'description':{'type':Sequelize[_0xdf7c('0x2')]},'interval':{'type':Sequelize[_0xdf7c('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 429c942..bb39647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc495=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','findOne','length','getIntervals','addIntervals','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','map','Interval','rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','keys','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x4338ce,_0x1c4f85){var _0x3d88dc=function(_0x2dd813){while(--_0x2dd813){_0x4338ce['push'](_0x4338ce['shift']());}};_0x3d88dc(++_0x1c4f85);}(_0xc495,0x1bd));var _0x5c49=function(_0x4cd14f,_0x6dcf1d){_0x4cd14f=_0x4cd14f-0x0;var _0x48ede2=_0xc495[_0x4cd14f];return _0x48ede2;};'use strict';var emlformat=require(_0x5c49('0x0'));var rimraf=require(_0x5c49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c49('0x2'));var rp=require('request-promise');var moment=require(_0x5c49('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c49('0x4'));var path=require(_0x5c49('0x5'));var sox=require(_0x5c49('0x6'));var csv=require(_0x5c49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c49('0x8'));var _=require(_0x5c49('0x9'));var squel=require(_0x5c49('0xa'));var crypto=require(_0x5c49('0xb'));var jsforce=require(_0x5c49('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5c49('0x7'));var querystring=require(_0x5c49('0xd'));var Papa=require('papaparse');var Redis=require(_0x5c49('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c49('0xf'));var logger=require(_0x5c49('0x10'))(_0x5c49('0x11'));var utils=require(_0x5c49('0x12'));var config=require(_0x5c49('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c49('0x14'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x59d6d6,_0x2511aa){_0x2511aa=_0x2511aa||0xcc;return function(_0x51b0f1){if(_0x51b0f1){return _0x59d6d6[_0x5c49('0x15')](_0x2511aa);}return _0x59d6d6['status'](_0x2511aa)[_0x5c49('0x16')]();};}function respondWithResult(_0x57bfaa,_0x5ac8ce){_0x5ac8ce=_0x5ac8ce||0xc8;return function(_0x3213ad){if(_0x3213ad){return _0x57bfaa['status'](_0x5ac8ce)[_0x5c49('0x17')](_0x3213ad);}};}function respondWithFilteredResult(_0x124fbd,_0xf9b734){return function(_0x399df6){if(_0x399df6){var _0x7f831f=typeof _0xf9b734[_0x5c49('0x18')]===_0x5c49('0x19')&&typeof _0xf9b734[_0x5c49('0x1a')]===_0x5c49('0x19');var _0x3a5277=_0x399df6[_0x5c49('0x1b')];var _0x1cfe27=_0x7f831f?0x0:_0xf9b734[_0x5c49('0x18')];var _0x43fb7c=_0x7f831f?_0x399df6[_0x5c49('0x1b')]:_0xf9b734[_0x5c49('0x18')]+_0xf9b734[_0x5c49('0x1a')];var _0x313e7e;if(_0x43fb7c>=_0x3a5277){_0x43fb7c=_0x3a5277;_0x313e7e=0xc8;}else{_0x313e7e=0xce;}_0x124fbd[_0x5c49('0x1c')](_0x313e7e);return _0x124fbd[_0x5c49('0x1d')](_0x5c49('0x1e'),_0x1cfe27+'-'+_0x43fb7c+'/'+_0x3a5277)[_0x5c49('0x17')](_0x399df6);}return null;};}function patchUpdates(_0x45f076){return function(_0x3111eb){try{jsonpatch['apply'](_0x3111eb,_0x45f076,!![]);}catch(_0x5b4a3c){return BPromise['reject'](_0x5b4a3c);}return _0x3111eb['save']();};}function saveUpdates(_0x23dca8,_0xcbd7c8){return function(_0x2f7e0f){if(_0x2f7e0f){return _0x2f7e0f[_0x5c49('0x1f')](_0x23dca8)[_0x5c49('0x20')](function(_0x54e9f2){return _0x54e9f2;});}return null;};}function removeEntity(_0xd116a8,_0x439193){return function(_0x273131){if(_0x273131){return _0x273131[_0x5c49('0x21')]()[_0x5c49('0x20')](function(){var _0x445f54=_0x273131[_0x5c49('0x22')]({'plain':!![]});var _0x43e37f=_0x5c49('0x23');return db[_0x5c49('0x24')][_0x5c49('0x21')]({'where':{'type':_0x43e37f,'resourceId':_0x445f54['id']}})[_0x5c49('0x20')](function(){return _0x273131;});})[_0x5c49('0x20')](function(){_0xd116a8[_0x5c49('0x1c')](0xcc)[_0x5c49('0x16')]();});}};}function handleEntityNotFound(_0x212bbd,_0x3fa3d8){return function(_0x4e3158){if(!_0x4e3158){_0x212bbd[_0x5c49('0x15')](0x194);}return _0x4e3158;};}function handleError(_0x59ad8d,_0x25ce9c){_0x25ce9c=_0x25ce9c||0x1f4;return function(_0x445b2e){logger[_0x5c49('0x25')](_0x445b2e[_0x5c49('0x26')]);if(_0x445b2e[_0x5c49('0x27')]){delete _0x445b2e[_0x5c49('0x27')];}_0x59ad8d[_0x5c49('0x1c')](_0x25ce9c)['send'](_0x445b2e);};}exports['index']=function(_0x1fdbce,_0x306c5b){var _0x5b7931={},_0x1d8d1d={},_0x17e150={'count':0x0,'rows':[]};var _0x31e4e7=_[_0x5c49('0x28')](db[_0x5c49('0x29')][_0x5c49('0x2a')],function(_0x484c74){return{'name':_0x484c74['fieldName'],'type':_0x484c74[_0x5c49('0x2b')][_0x5c49('0x2c')]};});_0x1d8d1d[_0x5c49('0x2d')]=_[_0x5c49('0x28')](_0x31e4e7,_0x5c49('0x27'));_0x1d8d1d[_0x5c49('0x2e')]=_['keys'](_0x1fdbce['query']);_0x1d8d1d['filters']=_[_0x5c49('0x2f')](_0x1d8d1d[_0x5c49('0x2d')],_0x1d8d1d[_0x5c49('0x2e')]);_0x5b7931['attributes']=_[_0x5c49('0x2f')](_0x1d8d1d[_0x5c49('0x2d')],qs['fields'](_0x1fdbce[_0x5c49('0x2e')][_0x5c49('0x30')]));_0x5b7931[_0x5c49('0x31')]=_0x5b7931[_0x5c49('0x31')]['length']?_0x5b7931['attributes']:_0x1d8d1d[_0x5c49('0x2d')];if(!_0x1fdbce[_0x5c49('0x2e')][_0x5c49('0x32')](_0x5c49('0x33'))){_0x5b7931[_0x5c49('0x1a')]=qs[_0x5c49('0x1a')](_0x1fdbce[_0x5c49('0x2e')][_0x5c49('0x1a')]);_0x5b7931[_0x5c49('0x18')]=qs['offset'](_0x1fdbce['query'][_0x5c49('0x18')]);}_0x5b7931[_0x5c49('0x34')]=qs[_0x5c49('0x35')](_0x1fdbce[_0x5c49('0x2e')][_0x5c49('0x35')]);_0x5b7931['where']=qs[_0x5c49('0x36')](_[_0x5c49('0x37')](_0x1fdbce['query'],_0x1d8d1d[_0x5c49('0x36')]),_0x31e4e7);if(_0x1fdbce['query'][_0x5c49('0x38')]){_0x5b7931['where']=_[_0x5c49('0x39')](_0x5b7931['where'],{'$or':_[_0x5c49('0x28')](_0x31e4e7,function(_0x101b08){if(_0x101b08[_0x5c49('0x2b')]!==_0x5c49('0x3a')){var _0x3ee266={};_0x3ee266[_0x101b08[_0x5c49('0x27')]]={'$like':'%'+_0x1fdbce[_0x5c49('0x2e')][_0x5c49('0x38')]+'%'};return _0x3ee266;}})});}_0x5b7931=_[_0x5c49('0x39')]({},_0x5b7931,_0x1fdbce[_0x5c49('0x3b')]);var _0x40b3a9={'where':_0x5b7931[_0x5c49('0x3c')]};return db[_0x5c49('0x29')][_0x5c49('0x1b')](_0x40b3a9)[_0x5c49('0x20')](function(_0x4b7793){_0x17e150[_0x5c49('0x1b')]=_0x4b7793;if(_0x1fdbce[_0x5c49('0x2e')][_0x5c49('0x3d')]){_0x5b7931[_0x5c49('0x3e')]=[{'all':!![]}];}return db[_0x5c49('0x29')][_0x5c49('0x3f')](_0x5b7931);})[_0x5c49('0x20')](function(_0x17e07b){_0x17e150[_0x5c49('0x40')]=_0x17e07b;return _0x17e150;})['then'](respondWithFilteredResult(_0x306c5b,_0x5b7931))['catch'](handleError(_0x306c5b,null));};exports[_0x5c49('0x41')]=function(_0xa9af8b,_0x140a14){var _0x25ba6={'raw':!![],'where':{'id':_0xa9af8b[_0x5c49('0x42')]['id']}},_0x3b89e5={};_0x3b89e5[_0x5c49('0x2d')]=_[_0x5c49('0x43')](db[_0x5c49('0x29')]['rawAttributes']);_0x3b89e5[_0x5c49('0x2e')]=_[_0x5c49('0x43')](_0xa9af8b[_0x5c49('0x2e')]);_0x3b89e5['filters']=_[_0x5c49('0x2f')](_0x3b89e5[_0x5c49('0x2d')],_0x3b89e5[_0x5c49('0x2e')]);_0x25ba6[_0x5c49('0x31')]=_[_0x5c49('0x2f')](_0x3b89e5[_0x5c49('0x2d')],qs[_0x5c49('0x30')](_0xa9af8b[_0x5c49('0x2e')]['fields']));_0x25ba6[_0x5c49('0x31')]=_0x25ba6[_0x5c49('0x31')]['length']?_0x25ba6[_0x5c49('0x31')]:_0x3b89e5['model'];if(_0xa9af8b[_0x5c49('0x2e')][_0x5c49('0x3d')]){_0x25ba6[_0x5c49('0x3e')]=[{'all':!![]}];}_0x25ba6=_[_0x5c49('0x39')]({},_0x25ba6,_0xa9af8b[_0x5c49('0x3b')]);return db['Interval']['find'](_0x25ba6)[_0x5c49('0x20')](handleEntityNotFound(_0x140a14,null))['then'](respondWithResult(_0x140a14,null))[_0x5c49('0x44')](handleError(_0x140a14,null));};exports[_0x5c49('0x45')]=function(_0x33ea12,_0x55b120){return db[_0x5c49('0x29')][_0x5c49('0x45')](_0x33ea12['body'],{})[_0x5c49('0x20')](function(_0x3b2ec2){var _0x454b0f=_0x33ea12[_0x5c49('0x46')][_0x5c49('0x22')]({'plain':!![]});if(!_0x454b0f)throw new Error(_0x5c49('0x47'));if(_0x454b0f[_0x5c49('0x48')]===_0x5c49('0x46')){var _0x573298=_0x3b2ec2['get']({'plain':!![]});var _0x4e6456='Intervals';return db[_0x5c49('0x49')][_0x5c49('0x4a')]({'where':{'name':_0x4e6456,'userProfileId':_0x454b0f[_0x5c49('0x4b')]},'raw':!![]})['then'](function(_0x3827ed){if(_0x3827ed&&_0x3827ed[_0x5c49('0x4c')]===0x0){return db[_0x5c49('0x24')][_0x5c49('0x45')]({'name':_0x573298[_0x5c49('0x27')],'resourceId':_0x573298['id'],'type':_0x3827ed[_0x5c49('0x27')],'sectionId':_0x3827ed['id']},{})[_0x5c49('0x20')](function(){return _0x3b2ec2;});}else{return _0x3b2ec2;}})[_0x5c49('0x44')](function(_0x1d8324){logger[_0x5c49('0x25')](_0x5c49('0x4d'),_0x1d8324);throw _0x1d8324;});}return _0x3b2ec2;})[_0x5c49('0x20')](respondWithResult(_0x55b120,0xc9))[_0x5c49('0x44')](handleError(_0x55b120,null));};exports['update']=function(_0x7e09d6,_0x246538){if(_0x7e09d6[_0x5c49('0x4e')]['id']){delete _0x7e09d6[_0x5c49('0x4e')]['id'];}return db[_0x5c49('0x29')]['find']({'where':{'id':_0x7e09d6[_0x5c49('0x42')]['id']}})[_0x5c49('0x20')](handleEntityNotFound(_0x246538,null))[_0x5c49('0x20')](saveUpdates(_0x7e09d6[_0x5c49('0x4e')],null))[_0x5c49('0x20')](respondWithResult(_0x246538,null))['catch'](handleError(_0x246538,null));};exports['destroy']=function(_0x527f65,_0x5b5c3b){return db[_0x5c49('0x29')][_0x5c49('0x4a')]({'where':{'id':_0x527f65[_0x5c49('0x42')]['id']}})[_0x5c49('0x20')](handleEntityNotFound(_0x5b5c3b,null))[_0x5c49('0x20')](removeEntity(_0x5b5c3b,null))[_0x5c49('0x44')](handleError(_0x5b5c3b,null));};exports[_0x5c49('0x4f')]=function(_0x164d53,_0x174bf1,_0xf821b9){if(_0x164d53[_0x5c49('0x4e')]['id']){delete _0x164d53['body']['id'];}return db[_0x5c49('0x29')][_0x5c49('0x4a')]({'where':{'id':_0x164d53[_0x5c49('0x42')]['id']}})['then'](handleEntityNotFound(_0x174bf1,null))['then'](function(_0x5462bc){if(_0x5462bc){_0x164d53[_0x5c49('0x4e')][_0x5c49('0x50')]=_0x5462bc['id'];return db[_0x5c49('0x29')][_0x5c49('0x45')](_0x164d53[_0x5c49('0x4e')]);}})[_0x5c49('0x20')](respondWithResult(_0x174bf1,null))[_0x5c49('0x44')](handleError(_0x174bf1,null));};exports['getIntervals']=function(_0x59f0c1,_0x5bd1e7,_0x1fb251){var _0x11a53f={};var _0x14356f={};var _0x8222d5;var _0x30bf62;return db['Interval'][_0x5c49('0x51')]({'where':{'id':_0x59f0c1[_0x5c49('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bd1e7,null))[_0x5c49('0x20')](function(_0x156221){if(_0x156221){_0x8222d5=_0x156221;_0x14356f[_0x5c49('0x2d')]=_[_0x5c49('0x43')](db[_0x5c49('0x29')][_0x5c49('0x2a')]);_0x14356f['query']=_['keys'](_0x59f0c1[_0x5c49('0x2e')]);_0x14356f[_0x5c49('0x36')]=_['intersection'](_0x14356f[_0x5c49('0x2d')],_0x14356f[_0x5c49('0x2e')]);_0x11a53f[_0x5c49('0x31')]=_[_0x5c49('0x2f')](_0x14356f[_0x5c49('0x2d')],qs['fields'](_0x59f0c1[_0x5c49('0x2e')][_0x5c49('0x30')]));_0x11a53f[_0x5c49('0x31')]=_0x11a53f[_0x5c49('0x31')][_0x5c49('0x52')]?_0x11a53f[_0x5c49('0x31')]:_0x14356f[_0x5c49('0x2d')];_0x11a53f['order']=qs[_0x5c49('0x35')](_0x59f0c1[_0x5c49('0x2e')][_0x5c49('0x35')]);_0x11a53f[_0x5c49('0x3c')]=qs[_0x5c49('0x36')](_['pick'](_0x59f0c1[_0x5c49('0x2e')],_0x14356f['filters']));if(_0x59f0c1['query'][_0x5c49('0x38')]){_0x11a53f[_0x5c49('0x3c')]=_[_0x5c49('0x39')](_0x11a53f[_0x5c49('0x3c')],{'$or':_[_0x5c49('0x28')](_0x11a53f[_0x5c49('0x31')],function(_0x36fb4e){var _0xb545e4={};_0xb545e4[_0x36fb4e]={'$like':'%'+_0x59f0c1[_0x5c49('0x2e')][_0x5c49('0x38')]+'%'};return _0xb545e4;})});}_0x11a53f=_['merge']({},_0x11a53f,_0x59f0c1[_0x5c49('0x3b')]);return _0x8222d5[_0x5c49('0x53')](_0x11a53f);}})[_0x5c49('0x20')](function(_0x4a840a){if(_0x4a840a){_0x30bf62=_0x4a840a['length'];if(!_0x59f0c1[_0x5c49('0x2e')]['hasOwnProperty'](_0x5c49('0x33'))){_0x11a53f[_0x5c49('0x1a')]=qs[_0x5c49('0x1a')](_0x59f0c1[_0x5c49('0x2e')][_0x5c49('0x1a')]);_0x11a53f[_0x5c49('0x18')]=qs[_0x5c49('0x18')](_0x59f0c1['query']['offset']);}return _0x8222d5['getIntervals'](_0x11a53f);}})['then'](function(_0x12ac0e){if(_0x12ac0e){return _0x12ac0e?{'count':_0x30bf62,'rows':_0x12ac0e}:null;}})[_0x5c49('0x20')](respondWithResult(_0x5bd1e7,null))['catch'](handleError(_0x5bd1e7,null));};exports[_0x5c49('0x54')]=function(_0x27e460,_0x3003ac,_0x456f1e){return db[_0x5c49('0x29')][_0x5c49('0x51')]({'where':{'id':_0x27e460['params']['id']}})[_0x5c49('0x20')](handleEntityNotFound(_0x3003ac,null))[_0x5c49('0x20')](function(_0x457e04){if(_0x457e04){return db[_0x5c49('0x55')]['transaction'](function(_0x51a58d){return db['Interval'][_0x5c49('0x21')]({'where':{'IntervalId':_0x27e460[_0x5c49('0x42')]['id']},'transaction':_0x51a58d})['then'](function(_0x6b2f1f){var _0x852836=_['map'](_0x27e460['body'],function(_0x160bf0){delete _0x160bf0['id'];_0x160bf0[_0x5c49('0x50')]=_0x27e460[_0x5c49('0x42')]['id'];return _0x160bf0;});return db[_0x5c49('0x29')][_0x5c49('0x56')](_0x852836,{'transaction':_0x51a58d});});})['then'](function(){return db[_0x5c49('0x29')][_0x5c49('0x3f')]({'where':{'IntervalId':_0x27e460[_0x5c49('0x42')]['id']}});});}})[_0x5c49('0x20')](respondWithResult(_0x3003ac,null))[_0x5c49('0x44')](handleError(_0x3003ac,null));};
\ No newline at end of file
+var _0x1e6a=['include','findAll','show','params','rawAttributes','length','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','options','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','Intervals','UserProfileResource','end','error','stack','name','send','index','Interval','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll'];(function(_0x36af12,_0x33e825){var _0x5b126e=function(_0x3366a6){while(--_0x3366a6){_0x36af12['push'](_0x36af12['shift']());}};_0x5b126e(++_0x33e825);}(_0x1e6a,0x77));var _0xa1e6=function(_0x524c6b,_0x538e2e){_0x524c6b=_0x524c6b-0x0;var _0x18b409=_0x1e6a[_0x524c6b];return _0x18b409;};'use strict';var emlformat=require(_0xa1e6('0x0'));var rimraf=require(_0xa1e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1e6('0x2'));var moment=require(_0xa1e6('0x3'));var BPromise=require(_0xa1e6('0x4'));var Mustache=require('mustache');var util=require(_0xa1e6('0x5'));var path=require('path');var sox=require(_0xa1e6('0x6'));var csv=require(_0xa1e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa1e6('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa1e6('0x9'));var toCsv=require(_0xa1e6('0x7'));var querystring=require(_0xa1e6('0xa'));var Papa=require('papaparse');var Redis=require(_0xa1e6('0xb'));var authService=require(_0xa1e6('0xc'));var qs=require(_0xa1e6('0xd'));var as=require(_0xa1e6('0xe'));var hardwareService=require(_0xa1e6('0xf'));var logger=require(_0xa1e6('0x10'))(_0xa1e6('0x11'));var utils=require(_0xa1e6('0x12'));var config=require(_0xa1e6('0x13'));var licenseUtil=require(_0xa1e6('0x14'));var db=require(_0xa1e6('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x3b48bf,_0x5901f1){_0x5901f1=_0x5901f1||0xcc;return function(_0x42908f){if(_0x42908f){return _0x3b48bf[_0xa1e6('0x16')](_0x5901f1);}return _0x3b48bf[_0xa1e6('0x17')](_0x5901f1)['end']();};}function respondWithResult(_0x1e9960,_0x15e1d3){_0x15e1d3=_0x15e1d3||0xc8;return function(_0x5217f9){if(_0x5217f9){return _0x1e9960[_0xa1e6('0x17')](_0x15e1d3)[_0xa1e6('0x18')](_0x5217f9);}};}function respondWithFilteredResult(_0x2c205e,_0x2d7335){return function(_0xb6f87c){if(_0xb6f87c){var _0x5a87a4=typeof _0x2d7335[_0xa1e6('0x19')]==='undefined'&&typeof _0x2d7335[_0xa1e6('0x1a')]===_0xa1e6('0x1b');var _0x2842d8=_0xb6f87c[_0xa1e6('0x1c')];var _0x555f4d=_0x5a87a4?0x0:_0x2d7335[_0xa1e6('0x19')];var _0xe480c2=_0x5a87a4?_0xb6f87c[_0xa1e6('0x1c')]:_0x2d7335[_0xa1e6('0x19')]+_0x2d7335['limit'];var _0x1e6a9e;if(_0xe480c2>=_0x2842d8){_0xe480c2=_0x2842d8;_0x1e6a9e=0xc8;}else{_0x1e6a9e=0xce;}_0x2c205e['status'](_0x1e6a9e);return _0x2c205e[_0xa1e6('0x1d')]('Content-Range',_0x555f4d+'-'+_0xe480c2+'/'+_0x2842d8)[_0xa1e6('0x18')](_0xb6f87c);}return null;};}function patchUpdates(_0x1726a3){return function(_0x1017c7){try{jsonpatch[_0xa1e6('0x1e')](_0x1017c7,_0x1726a3,!![]);}catch(_0x2036a2){return BPromise['reject'](_0x2036a2);}return _0x1017c7[_0xa1e6('0x1f')]();};}function saveUpdates(_0x2ebe68,_0x1650d6){return function(_0x52388d){if(_0x52388d){return _0x52388d[_0xa1e6('0x20')](_0x2ebe68)[_0xa1e6('0x21')](function(_0x1b7484){return _0x1b7484;});}return null;};}function removeEntity(_0x3bfeca,_0x49de6c){return function(_0x2008da){if(_0x2008da){return _0x2008da[_0xa1e6('0x22')]()[_0xa1e6('0x21')](function(){var _0x52d689=_0x2008da['get']({'plain':!![]});var _0x5f1a4c=_0xa1e6('0x23');return db[_0xa1e6('0x24')]['destroy']({'where':{'type':_0x5f1a4c,'resourceId':_0x52d689['id']}})[_0xa1e6('0x21')](function(){return _0x2008da;});})[_0xa1e6('0x21')](function(){_0x3bfeca[_0xa1e6('0x17')](0xcc)[_0xa1e6('0x25')]();});}};}function handleEntityNotFound(_0x36c6dc,_0x781bdc){return function(_0x472734){if(!_0x472734){_0x36c6dc['sendStatus'](0x194);}return _0x472734;};}function handleError(_0x1c3779,_0x49c7ed){_0x49c7ed=_0x49c7ed||0x1f4;return function(_0x4bb393){logger[_0xa1e6('0x26')](_0x4bb393[_0xa1e6('0x27')]);if(_0x4bb393[_0xa1e6('0x28')]){delete _0x4bb393[_0xa1e6('0x28')];}_0x1c3779['status'](_0x49c7ed)[_0xa1e6('0x29')](_0x4bb393);};}exports[_0xa1e6('0x2a')]=function(_0x58f20e,_0x14b612){var _0x47a377={},_0x525a54={},_0x1e66af={'count':0x0,'rows':[]};var _0x270c28=_['map'](db[_0xa1e6('0x2b')]['rawAttributes'],function(_0x456f21){return{'name':_0x456f21[_0xa1e6('0x2c')],'type':_0x456f21[_0xa1e6('0x2d')][_0xa1e6('0x2e')]};});_0x525a54[_0xa1e6('0x2f')]=_['map'](_0x270c28,_0xa1e6('0x28'));_0x525a54[_0xa1e6('0x30')]=_[_0xa1e6('0x31')](_0x58f20e[_0xa1e6('0x30')]);_0x525a54[_0xa1e6('0x32')]=_[_0xa1e6('0x33')](_0x525a54['model'],_0x525a54[_0xa1e6('0x30')]);_0x47a377[_0xa1e6('0x34')]=_[_0xa1e6('0x33')](_0x525a54[_0xa1e6('0x2f')],qs['fields'](_0x58f20e[_0xa1e6('0x30')][_0xa1e6('0x35')]));_0x47a377[_0xa1e6('0x34')]=_0x47a377['attributes']['length']?_0x47a377[_0xa1e6('0x34')]:_0x525a54['model'];if(!_0x58f20e[_0xa1e6('0x30')][_0xa1e6('0x36')](_0xa1e6('0x37'))){_0x47a377[_0xa1e6('0x1a')]=qs[_0xa1e6('0x1a')](_0x58f20e['query'][_0xa1e6('0x1a')]);_0x47a377['offset']=qs[_0xa1e6('0x19')](_0x58f20e[_0xa1e6('0x30')][_0xa1e6('0x19')]);}_0x47a377[_0xa1e6('0x38')]=qs[_0xa1e6('0x39')](_0x58f20e[_0xa1e6('0x30')][_0xa1e6('0x39')]);_0x47a377[_0xa1e6('0x3a')]=qs[_0xa1e6('0x32')](_[_0xa1e6('0x3b')](_0x58f20e[_0xa1e6('0x30')],_0x525a54[_0xa1e6('0x32')]),_0x270c28);if(_0x58f20e[_0xa1e6('0x30')][_0xa1e6('0x3c')]){_0x47a377['where']=_[_0xa1e6('0x3d')](_0x47a377[_0xa1e6('0x3a')],{'$or':_[_0xa1e6('0x3e')](_0x270c28,function(_0x5295af){if(_0x5295af[_0xa1e6('0x2d')]!==_0xa1e6('0x3f')){var _0x14feae={};_0x14feae[_0x5295af[_0xa1e6('0x28')]]={'$like':'%'+_0x58f20e[_0xa1e6('0x30')][_0xa1e6('0x3c')]+'%'};return _0x14feae;}})});}_0x47a377=_[_0xa1e6('0x3d')]({},_0x47a377,_0x58f20e['options']);var _0x27f744={'where':_0x47a377[_0xa1e6('0x3a')]};return db[_0xa1e6('0x2b')][_0xa1e6('0x1c')](_0x27f744)[_0xa1e6('0x21')](function(_0x3a924e){_0x1e66af[_0xa1e6('0x1c')]=_0x3a924e;if(_0x58f20e['query'][_0xa1e6('0x40')]){_0x47a377[_0xa1e6('0x41')]=[{'all':!![]}];}return db[_0xa1e6('0x2b')][_0xa1e6('0x42')](_0x47a377);})[_0xa1e6('0x21')](function(_0x13ef41){_0x1e66af['rows']=_0x13ef41;return _0x1e66af;})[_0xa1e6('0x21')](respondWithFilteredResult(_0x14b612,_0x47a377))['catch'](handleError(_0x14b612,null));};exports[_0xa1e6('0x43')]=function(_0x2d6a71,_0x12263d){var _0x5196b1={'raw':!![],'where':{'id':_0x2d6a71[_0xa1e6('0x44')]['id']}},_0x529b16={};_0x529b16['model']=_['keys'](db[_0xa1e6('0x2b')][_0xa1e6('0x45')]);_0x529b16[_0xa1e6('0x30')]=_['keys'](_0x2d6a71[_0xa1e6('0x30')]);_0x529b16[_0xa1e6('0x32')]=_[_0xa1e6('0x33')](_0x529b16[_0xa1e6('0x2f')],_0x529b16[_0xa1e6('0x30')]);_0x5196b1[_0xa1e6('0x34')]=_[_0xa1e6('0x33')](_0x529b16[_0xa1e6('0x2f')],qs[_0xa1e6('0x35')](_0x2d6a71[_0xa1e6('0x30')][_0xa1e6('0x35')]));_0x5196b1[_0xa1e6('0x34')]=_0x5196b1[_0xa1e6('0x34')][_0xa1e6('0x46')]?_0x5196b1[_0xa1e6('0x34')]:_0x529b16[_0xa1e6('0x2f')];if(_0x2d6a71['query'][_0xa1e6('0x40')]){_0x5196b1['include']=[{'all':!![]}];}_0x5196b1=_['merge']({},_0x5196b1,_0x2d6a71['options']);return db[_0xa1e6('0x2b')]['find'](_0x5196b1)['then'](handleEntityNotFound(_0x12263d,null))[_0xa1e6('0x21')](respondWithResult(_0x12263d,null))[_0xa1e6('0x47')](handleError(_0x12263d,null));};exports['create']=function(_0x49f9a8,_0x4340fd){return db[_0xa1e6('0x2b')][_0xa1e6('0x48')](_0x49f9a8['body'],{})['then'](function(_0x205126){var _0x30619a=_0x49f9a8[_0xa1e6('0x49')][_0xa1e6('0x4a')]({'plain':!![]});if(!_0x30619a)throw new Error(_0xa1e6('0x4b'));if(_0x30619a[_0xa1e6('0x4c')]===_0xa1e6('0x49')){var _0x13f28=_0x205126['get']({'plain':!![]});var _0x2d6601=_0xa1e6('0x23');return db[_0xa1e6('0x4d')][_0xa1e6('0x4e')]({'where':{'name':_0x2d6601,'userProfileId':_0x30619a[_0xa1e6('0x4f')]},'raw':!![]})[_0xa1e6('0x21')](function(_0x140a77){if(_0x140a77&&_0x140a77[_0xa1e6('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x13f28[_0xa1e6('0x28')],'resourceId':_0x13f28['id'],'type':_0x140a77[_0xa1e6('0x28')],'sectionId':_0x140a77['id']},{})[_0xa1e6('0x21')](function(){return _0x205126;});}else{return _0x205126;}})['catch'](function(_0x50825c){logger[_0xa1e6('0x26')](_0xa1e6('0x51'),_0x50825c);throw _0x50825c;});}return _0x205126;})[_0xa1e6('0x21')](respondWithResult(_0x4340fd,0xc9))[_0xa1e6('0x47')](handleError(_0x4340fd,null));};exports['update']=function(_0xb6c5ca,_0x1ce59b){if(_0xb6c5ca['body']['id']){delete _0xb6c5ca['body']['id'];}return db[_0xa1e6('0x2b')]['find']({'where':{'id':_0xb6c5ca['params']['id']}})[_0xa1e6('0x21')](handleEntityNotFound(_0x1ce59b,null))['then'](saveUpdates(_0xb6c5ca[_0xa1e6('0x52')],null))[_0xa1e6('0x21')](respondWithResult(_0x1ce59b,null))[_0xa1e6('0x47')](handleError(_0x1ce59b,null));};exports['destroy']=function(_0x4cf0cd,_0x12044e){return db[_0xa1e6('0x2b')]['find']({'where':{'id':_0x4cf0cd[_0xa1e6('0x44')]['id']}})[_0xa1e6('0x21')](handleEntityNotFound(_0x12044e,null))[_0xa1e6('0x21')](removeEntity(_0x12044e,null))['catch'](handleError(_0x12044e,null));};exports[_0xa1e6('0x53')]=function(_0x3bce97,_0x576c80,_0x1e9a1e){if(_0x3bce97['body']['id']){delete _0x3bce97[_0xa1e6('0x52')]['id'];}return db[_0xa1e6('0x2b')]['find']({'where':{'id':_0x3bce97[_0xa1e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x576c80,null))[_0xa1e6('0x21')](function(_0x2a6e8c){if(_0x2a6e8c){_0x3bce97['body'][_0xa1e6('0x54')]=_0x2a6e8c['id'];return db['Interval'][_0xa1e6('0x48')](_0x3bce97[_0xa1e6('0x52')]);}})[_0xa1e6('0x21')](respondWithResult(_0x576c80,null))[_0xa1e6('0x47')](handleError(_0x576c80,null));};exports[_0xa1e6('0x55')]=function(_0x18145e,_0x1f3ac7,_0x4b2bf6){var _0x47dc1b={};var _0x26aff3={};var _0x4db9df;var _0x1bc751;return db[_0xa1e6('0x2b')][_0xa1e6('0x56')]({'where':{'id':_0x18145e[_0xa1e6('0x44')]['id']}})[_0xa1e6('0x21')](handleEntityNotFound(_0x1f3ac7,null))['then'](function(_0x3cab86){if(_0x3cab86){_0x4db9df=_0x3cab86;_0x26aff3[_0xa1e6('0x2f')]=_['keys'](db['Interval']['rawAttributes']);_0x26aff3[_0xa1e6('0x30')]=_[_0xa1e6('0x31')](_0x18145e[_0xa1e6('0x30')]);_0x26aff3[_0xa1e6('0x32')]=_[_0xa1e6('0x33')](_0x26aff3['model'],_0x26aff3['query']);_0x47dc1b['attributes']=_[_0xa1e6('0x33')](_0x26aff3[_0xa1e6('0x2f')],qs[_0xa1e6('0x35')](_0x18145e['query'][_0xa1e6('0x35')]));_0x47dc1b['attributes']=_0x47dc1b[_0xa1e6('0x34')][_0xa1e6('0x46')]?_0x47dc1b[_0xa1e6('0x34')]:_0x26aff3[_0xa1e6('0x2f')];_0x47dc1b['order']=qs[_0xa1e6('0x39')](_0x18145e['query'][_0xa1e6('0x39')]);_0x47dc1b['where']=qs[_0xa1e6('0x32')](_[_0xa1e6('0x3b')](_0x18145e['query'],_0x26aff3[_0xa1e6('0x32')]));if(_0x18145e[_0xa1e6('0x30')][_0xa1e6('0x3c')]){_0x47dc1b['where']=_['merge'](_0x47dc1b[_0xa1e6('0x3a')],{'$or':_[_0xa1e6('0x3e')](_0x47dc1b[_0xa1e6('0x34')],function(_0x474125){var _0xbf7f05={};_0xbf7f05[_0x474125]={'$like':'%'+_0x18145e[_0xa1e6('0x30')][_0xa1e6('0x3c')]+'%'};return _0xbf7f05;})});}_0x47dc1b=_['merge']({},_0x47dc1b,_0x18145e[_0xa1e6('0x57')]);return _0x4db9df['getIntervals'](_0x47dc1b);}})[_0xa1e6('0x21')](function(_0x421ea8){if(_0x421ea8){_0x1bc751=_0x421ea8[_0xa1e6('0x46')];if(!_0x18145e[_0xa1e6('0x30')][_0xa1e6('0x36')](_0xa1e6('0x37'))){_0x47dc1b[_0xa1e6('0x1a')]=qs[_0xa1e6('0x1a')](_0x18145e['query'][_0xa1e6('0x1a')]);_0x47dc1b[_0xa1e6('0x19')]=qs[_0xa1e6('0x19')](_0x18145e['query'][_0xa1e6('0x19')]);}return _0x4db9df[_0xa1e6('0x55')](_0x47dc1b);}})['then'](function(_0x176f47){if(_0x176f47){return _0x176f47?{'count':_0x1bc751,'rows':_0x176f47}:null;}})['then'](respondWithResult(_0x1f3ac7,null))[_0xa1e6('0x47')](handleError(_0x1f3ac7,null));};exports[_0xa1e6('0x58')]=function(_0x48b265,_0x3a77e4,_0x7299b8){return db[_0xa1e6('0x2b')][_0xa1e6('0x56')]({'where':{'id':_0x48b265[_0xa1e6('0x44')]['id']}})[_0xa1e6('0x21')](handleEntityNotFound(_0x3a77e4,null))['then'](function(_0x22f9aa){if(_0x22f9aa){return db[_0xa1e6('0x59')][_0xa1e6('0x5a')](function(_0x21f2c8){return db[_0xa1e6('0x2b')][_0xa1e6('0x22')]({'where':{'IntervalId':_0x48b265[_0xa1e6('0x44')]['id']},'transaction':_0x21f2c8})[_0xa1e6('0x21')](function(_0x5a19f7){var _0x2971b4=_['map'](_0x48b265[_0xa1e6('0x52')],function(_0x2eca0f){delete _0x2eca0f['id'];_0x2eca0f[_0xa1e6('0x54')]=_0x48b265['params']['id'];return _0x2eca0f;});return db['Interval'][_0xa1e6('0x5b')](_0x2971b4,{'transaction':_0x21f2c8});});})[_0xa1e6('0x21')](function(){return db['Interval'][_0xa1e6('0x42')]({'where':{'IntervalId':_0x48b265[_0xa1e6('0x44')]['id']}});});}})[_0xa1e6('0x21')](respondWithResult(_0x3a77e4,null))[_0xa1e6('0x47')](handleError(_0x3a77e4,null));};
\ No newline at end of file
index 9583fbc..d8fe4f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be4=['all','map','ifTime','./interval.attributes','../../components/extensions/rewrite','iftime','exports','Interval','rewrite','interval','getIntervals','then'];(function(_0xf33afd,_0x2363b6){var _0x5f432a=function(_0x2599b5){while(--_0x2599b5){_0xf33afd['push'](_0xf33afd['shift']());}};_0x5f432a(++_0x2363b6);}(_0x7be4,0x87));var _0x47be=function(_0x30b6b2,_0x41eed7){_0x30b6b2=_0x30b6b2-0x0;var _0x2fb301=_0x7be4[_0x30b6b2];return _0x2fb301;};'use strict';var attributes=require(_0x47be('0x0'));var extensions=require(_0x47be('0x1'));var iftime=require('../../utils/iftime')[_0x47be('0x2')];module[_0x47be('0x3')]=function(_0x409bed){return _0x409bed['define'](_0x47be('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cfd29){extensions['rewrite'](_0x409bed,_0x5cfd29);},'afterBulkCreate':function(_0x375d0d,_0x49ceeb,_0x4635e7){_0x4635e7();extensions[_0x47be('0x5')](_0x409bed,_0x375d0d[0x0]);},'afterUpdate':function(_0x4ca0e1){extensions[_0x47be('0x5')](_0x409bed,_0x4ca0e1);},'afterDestroy':function(_0x51b91c){extensions[_0x47be('0x5')](_0x409bed,_0x51b91c);}},'instanceMethods':{'ifTime':function(_0x4d2e96=undefined,_0x371ee2=new Date()){if(typeof this[_0x47be('0x6')]==='string'){return iftime(this[_0x47be('0x6')],_0x4d2e96,_0x371ee2);}else{return this[_0x47be('0x7')]()[_0x47be('0x8')](function(_0x45dc8d){return Promise[_0x47be('0x9')](_0x45dc8d[_0x47be('0xa')](function(_0x418f7f){return _0x418f7f[_0x47be('0xb')](_0x4d2e96,_0x371ee2);}));})[_0x47be('0x8')](function(_0x4e67c9){return _0x4e67c9['reduce'](function(_0x367b55,_0xed986f){return _0x367b55||_0xed986f;},![]);});}}}});};
\ No newline at end of file
+var _0xa529=['Interval','rewrite','getIntervals','all','ifTime','then','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports'];(function(_0x55811e,_0x59f0d7){var _0x2880a7=function(_0x4629a9){while(--_0x4629a9){_0x55811e['push'](_0x55811e['shift']());}};_0x2880a7(++_0x59f0d7);}(_0xa529,0x6a));var _0x9a52=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa529[_0xa464c9];return _0x3d73c4;};'use strict';var attributes=require(_0x9a52('0x0'));var extensions=require(_0x9a52('0x1'));var iftime=require(_0x9a52('0x2'))['iftime'];module[_0x9a52('0x3')]=function(_0x34d358){return _0x34d358['define'](_0x9a52('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4030b3){extensions['rewrite'](_0x34d358,_0x4030b3);},'afterBulkCreate':function(_0x57beb7,_0x7769ee,_0x544948){_0x544948();extensions[_0x9a52('0x5')](_0x34d358,_0x57beb7[0x0]);},'afterUpdate':function(_0x4fc55){extensions[_0x9a52('0x5')](_0x34d358,_0x4fc55);},'afterDestroy':function(_0x26c082){extensions[_0x9a52('0x5')](_0x34d358,_0x26c082);}},'instanceMethods':{'ifTime':function(_0x2c3d45=undefined,_0x51197d=new Date()){if(typeof this['interval']==='string'){return iftime(this['interval'],_0x2c3d45,_0x51197d);}else{return this[_0x9a52('0x6')]()['then'](function(_0x53db17){return Promise[_0x9a52('0x7')](_0x53db17['map'](function(_0x2d88ec){return _0x2d88ec[_0x9a52('0x8')](_0x2c3d45,_0x51197d);}));})[_0x9a52('0x9')](function(_0x3d21eb){return _0x3d21eb['reduce'](function(_0x1f1676,_0x1fa39e){return _0x1f1676||_0x1fa39e;},![]);});}}}});};
\ No newline at end of file
index 67e48ff..aba8a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c4=['../../config/logger','rpc','Interval','findAll','options','where','limit','include','map','model','attributes','info','debug','GetInterval','stringify','error','message','ShowInterval','find','raw','catch','then','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','resolve','lodash','util','../../utils/iftime','iftime'];(function(_0x1a9dbf,_0x56e71a){var _0x16273b=function(_0x234d40){while(--_0x234d40){_0x1a9dbf['push'](_0x1a9dbf['shift']());}};_0x16273b(++_0x56e71a);}(_0x59c4,0x154));var _0x459c=function(_0x11d0db,_0x555564){_0x11d0db=_0x11d0db-0x0;var _0x4c6db6=_0x59c4[_0x11d0db];return _0x4c6db6;};'use strict';var _=require(_0x459c('0x0'));var util=require(_0x459c('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x459c('0x2'))[_0x459c('0x3')];var logger=require(_0x459c('0x4'))(_0x459c('0x5'));exports['GetInterval']=function(_0x2bb3b1){var _0x444212=this;return new Promise(function(_0x3f83c9,_0x27e7b7){return db[_0x459c('0x6')][_0x459c('0x7')]({'raw':_0x2bb3b1['options']?_0x2bb3b1[_0x459c('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2bb3b1[_0x459c('0x8')]?_0x2bb3b1[_0x459c('0x8')][_0x459c('0x9')]||null:null,'attributes':_0x2bb3b1[_0x459c('0x8')]?_0x2bb3b1[_0x459c('0x8')]['attributes']||null:null,'limit':_0x2bb3b1[_0x459c('0x8')]?_0x2bb3b1[_0x459c('0x8')][_0x459c('0xa')]||null:null,'include':_0x2bb3b1[_0x459c('0x8')]?_0x2bb3b1[_0x459c('0x8')][_0x459c('0xb')]?_[_0x459c('0xc')](_0x2bb3b1['options'][_0x459c('0xb')],function(_0x2f07c5){return{'model':db[_0x2f07c5[_0x459c('0xd')]],'as':_0x2f07c5['as'],'attributes':_0x2f07c5['attributes'],'include':_0x2f07c5[_0x459c('0xb')]?_[_0x459c('0xc')](_0x2f07c5[_0x459c('0xb')],function(_0x182693){return{'model':db[_0x182693['model']],'as':_0x182693['as'],'attributes':_0x182693[_0x459c('0xe')],'include':_0x182693['include']?_[_0x459c('0xc')](_0x182693[_0x459c('0xb')],function(_0x47fd2e){return{'model':db[_0x47fd2e['model']],'as':_0x47fd2e['as'],'attributes':_0x47fd2e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x526bbc){logger[_0x459c('0xf')]('GetInterval',_0x2bb3b1);logger[_0x459c('0x10')](_0x459c('0x11'),_0x2bb3b1,JSON[_0x459c('0x12')](_0x526bbc));_0x3f83c9(_0x526bbc);})['catch'](function(_0x1f7c10){logger[_0x459c('0x13')](_0x459c('0x11'),_0x1f7c10[_0x459c('0x14')],_0x2bb3b1);_0x27e7b7(_0x444212['error'](0x1f4,_0x1f7c10[_0x459c('0x14')]));});});};exports[_0x459c('0x15')]=function(_0x300f86){var _0x4adb76=this;return new Promise(function(_0x4427e1,_0x5f2081){return db[_0x459c('0x6')][_0x459c('0x16')]({'raw':_0x300f86[_0x459c('0x8')]?_0x300f86[_0x459c('0x8')][_0x459c('0x17')]===undefined?!![]:![]:!![],'where':_0x300f86[_0x459c('0x8')]?_0x300f86[_0x459c('0x8')]['where']||null:null,'attributes':_0x300f86[_0x459c('0x8')]?_0x300f86['options'][_0x459c('0xe')]||null:null,'include':_0x300f86[_0x459c('0x8')]?_0x300f86[_0x459c('0x8')][_0x459c('0xb')]?_[_0x459c('0xc')](_0x300f86[_0x459c('0x8')][_0x459c('0xb')],function(_0x122613){return{'model':db[_0x122613['model']],'as':_0x122613['as'],'attributes':_0x122613[_0x459c('0xe')],'include':_0x122613['include']?_[_0x459c('0xc')](_0x122613[_0x459c('0xb')],function(_0x122add){return{'model':db[_0x122add[_0x459c('0xd')]],'as':_0x122add['as'],'attributes':_0x122add['attributes'],'include':_0x122add[_0x459c('0xb')]?_[_0x459c('0xc')](_0x122add[_0x459c('0xb')],function(_0x4dbe3e){return{'model':db[_0x4dbe3e[_0x459c('0xd')]],'as':_0x4dbe3e['as'],'attributes':_0x4dbe3e[_0x459c('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c343c){logger[_0x459c('0xf')](_0x459c('0x15'),_0x300f86);logger['debug'](_0x459c('0x15'),_0x300f86,JSON['stringify'](_0x3c343c));_0x4427e1(_0x3c343c);})[_0x459c('0x18')](function(_0x23484f){logger[_0x459c('0x13')](_0x459c('0x15'),_0x23484f[_0x459c('0x14')],_0x300f86);_0x5f2081(_0x4adb76['error'](0x1f4,_0x23484f[_0x459c('0x14')]));});});};function checkArrayOfIntervals(_0x90e01c,_0x4c0ed9){var _0x469aa1=[];return db['Interval'][_0x459c('0x7')]({'where':{'id':_0x90e01c}})[_0x459c('0x19')](function(_0x5c6640){_0x469aa1=_0x5c6640;return Promise['all'](_0x469aa1['map'](function(_0x285307){return _0x285307[_0x459c('0x1a')](_0x4c0ed9);}));})[_0x459c('0x19')](function(_0x81c1ed){var _0x3fda1f=_0x81c1ed[_0x459c('0x1b')](function(_0x46213f,_0x57e4b4){return _0x46213f||_0x57e4b4;},![]);logger[_0x459c('0xf')](util[_0x459c('0x1c')](_0x459c('0x1d'),_0x469aa1[_0x459c('0xc')](function(_0x43b8bd){return _0x43b8bd[_0x459c('0x1e')];})[_0x459c('0x1f')](',\x20'),_0x469aa1[_0x459c('0xc')](function(_0x451ae3){return _0x451ae3['id'];})[_0x459c('0x1f')](',\x20')));return _0x3fda1f;});}function checkSingleInterval(_0x119295,_0xdc4bb4){return db[_0x459c('0x6')][_0x459c('0x20')](_0x119295)[_0x459c('0x19')](function(_0x88a573){if(_0x88a573){logger[_0x459c('0xf')](util[_0x459c('0x1c')](_0x459c('0x21'),_0x88a573[_0x459c('0x1e')],_0x88a573['id']));return _0x88a573[_0x459c('0x1a')](_0xdc4bb4);}});}exports[_0x459c('0x22')]=function(_0x1a4fe4){var _0x4e5e18=_0x1a4fe4[_0x459c('0x23')];var _0x4c5311=Array[_0x459c('0x24')](_0x1a4fe4['intervals'])?_0x1a4fe4[_0x459c('0x25')]:typeof _0x1a4fe4['intervals']===_0x459c('0x26')?[_0x1a4fe4[_0x459c('0x25')]]:[];var _0x2346e2=_0x1a4fe4['timezone']||undefined;var _0x2da287=![];if(_0x4c5311[_0x459c('0x27')]){logger['info'](util[_0x459c('0x1c')](_0x459c('0x28'),_0x4c5311[_0x459c('0x1f')](';\x20')));}if(_0x2346e2){logger[_0x459c('0xf')](util['format']('IntervalIftime:\x20timezone\x20=\x20%s',_0x2346e2));}logger['debug'](_0x459c('0x29'),_0x2da287);logger['silly']('IntervalIftime',_0x1a4fe4);return Promise[_0x459c('0x2a')]()[_0x459c('0x19')](function(){if(Array['isArray'](_0x4e5e18)){return checkArrayOfIntervals(_0x4e5e18,_0x2346e2);}else if(_0x4e5e18){return checkSingleInterval(_0x4e5e18,_0x2346e2);}})[_0x459c('0x19')](function(_0x409d07){var _0x20e0a7=_0x4c5311[_0x459c('0x1b')](function(_0x3a45cf,_0x2092f4){return _0x3a45cf||iftime(_0x2092f4,_0x2346e2);},![]);_0x2da287=_0x409d07||_0x20e0a7;return _0x2da287;})['catch'](function(_0x25d416){logger[_0x459c('0x13')](_0x459c('0x22'),_0x1a4fe4,_0x25d416);throw this[_0x459c('0x13')](0x1f4,_0x25d416['message']);});};
\ No newline at end of file
+var _0xbb1d=['IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','isArray','intervals','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','reduce','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','options','where','attributes','include','map','model','then','stringify','catch','error','message','ShowInterval','find','debug','findAll','all','ifTime','info'];(function(_0xd4d532,_0x27ba2b){var _0x4c40e9=function(_0x1be1c4){while(--_0x1be1c4){_0xd4d532['push'](_0xd4d532['shift']());}};_0x4c40e9(++_0x27ba2b);}(_0xbb1d,0xae));var _0xdbb1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbb1d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xdbb1('0x0'));var util=require('util');var db=require(_0xdbb1('0x1'))['db'];var iftime=require(_0xdbb1('0x2'))[_0xdbb1('0x3')];var logger=require(_0xdbb1('0x4'))(_0xdbb1('0x5'));exports[_0xdbb1('0x6')]=function(_0x2c4387){var _0x57fe17=this;return new Promise(function(_0x31286c,_0x3181f4){return db[_0xdbb1('0x7')]['findAll']({'raw':_0x2c4387[_0xdbb1('0x8')]?_0x2c4387[_0xdbb1('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2c4387[_0xdbb1('0x8')]?_0x2c4387[_0xdbb1('0x8')][_0xdbb1('0x9')]||null:null,'attributes':_0x2c4387['options']?_0x2c4387[_0xdbb1('0x8')][_0xdbb1('0xa')]||null:null,'limit':_0x2c4387[_0xdbb1('0x8')]?_0x2c4387[_0xdbb1('0x8')]['limit']||null:null,'include':_0x2c4387[_0xdbb1('0x8')]?_0x2c4387[_0xdbb1('0x8')][_0xdbb1('0xb')]?_[_0xdbb1('0xc')](_0x2c4387[_0xdbb1('0x8')]['include'],function(_0x5adb15){return{'model':db[_0x5adb15[_0xdbb1('0xd')]],'as':_0x5adb15['as'],'attributes':_0x5adb15[_0xdbb1('0xa')],'include':_0x5adb15['include']?_['map'](_0x5adb15['include'],function(_0x535942){return{'model':db[_0x535942[_0xdbb1('0xd')]],'as':_0x535942['as'],'attributes':_0x535942[_0xdbb1('0xa')],'include':_0x535942[_0xdbb1('0xb')]?_[_0xdbb1('0xc')](_0x535942['include'],function(_0xf73d72){return{'model':db[_0xf73d72[_0xdbb1('0xd')]],'as':_0xf73d72['as'],'attributes':_0xf73d72[_0xdbb1('0xa')]};}):[]};}):[]};}):[]:[]})[_0xdbb1('0xe')](function(_0x8268f5){logger['info'](_0xdbb1('0x6'),_0x2c4387);logger['debug']('GetInterval',_0x2c4387,JSON[_0xdbb1('0xf')](_0x8268f5));_0x31286c(_0x8268f5);})[_0xdbb1('0x10')](function(_0x5bf633){logger[_0xdbb1('0x11')](_0xdbb1('0x6'),_0x5bf633['message'],_0x2c4387);_0x3181f4(_0x57fe17['error'](0x1f4,_0x5bf633[_0xdbb1('0x12')]));});});};exports[_0xdbb1('0x13')]=function(_0x51119b){var _0x2f07df=this;return new Promise(function(_0x34eae5,_0x5043eb){return db[_0xdbb1('0x7')][_0xdbb1('0x14')]({'raw':_0x51119b[_0xdbb1('0x8')]?_0x51119b[_0xdbb1('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x51119b[_0xdbb1('0x8')]?_0x51119b[_0xdbb1('0x8')][_0xdbb1('0x9')]||null:null,'attributes':_0x51119b[_0xdbb1('0x8')]?_0x51119b[_0xdbb1('0x8')]['attributes']||null:null,'include':_0x51119b[_0xdbb1('0x8')]?_0x51119b[_0xdbb1('0x8')]['include']?_[_0xdbb1('0xc')](_0x51119b[_0xdbb1('0x8')][_0xdbb1('0xb')],function(_0x10c6dd){return{'model':db[_0x10c6dd[_0xdbb1('0xd')]],'as':_0x10c6dd['as'],'attributes':_0x10c6dd[_0xdbb1('0xa')],'include':_0x10c6dd[_0xdbb1('0xb')]?_[_0xdbb1('0xc')](_0x10c6dd['include'],function(_0x403a1b){return{'model':db[_0x403a1b[_0xdbb1('0xd')]],'as':_0x403a1b['as'],'attributes':_0x403a1b[_0xdbb1('0xa')],'include':_0x403a1b[_0xdbb1('0xb')]?_[_0xdbb1('0xc')](_0x403a1b['include'],function(_0x20eee3){return{'model':db[_0x20eee3[_0xdbb1('0xd')]],'as':_0x20eee3['as'],'attributes':_0x20eee3[_0xdbb1('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f32e6){logger['info'](_0xdbb1('0x13'),_0x51119b);logger[_0xdbb1('0x15')]('ShowInterval',_0x51119b,JSON['stringify'](_0x1f32e6));_0x34eae5(_0x1f32e6);})[_0xdbb1('0x10')](function(_0x57332c){logger[_0xdbb1('0x11')](_0xdbb1('0x13'),_0x57332c[_0xdbb1('0x12')],_0x51119b);_0x5043eb(_0x2f07df['error'](0x1f4,_0x57332c[_0xdbb1('0x12')]));});});};function checkArrayOfIntervals(_0x563dd0,_0x1691d8){var _0x544087=[];return db['Interval'][_0xdbb1('0x16')]({'where':{'id':_0x563dd0}})[_0xdbb1('0xe')](function(_0xc6cae){_0x544087=_0xc6cae;return Promise[_0xdbb1('0x17')](_0x544087['map'](function(_0x3ffa93){return _0x3ffa93[_0xdbb1('0x18')](_0x1691d8);}));})['then'](function(_0x2b1859){var _0x286923=_0x2b1859['reduce'](function(_0x2cbc91,_0xec8768){return _0x2cbc91||_0xec8768;},![]);logger[_0xdbb1('0x19')](util['format'](_0xdbb1('0x1a'),_0x544087[_0xdbb1('0xc')](function(_0x3bd945){return _0x3bd945[_0xdbb1('0x1b')];})['join'](',\x20'),_0x544087[_0xdbb1('0xc')](function(_0x1ee629){return _0x1ee629['id'];})[_0xdbb1('0x1c')](',\x20')));return _0x286923;});}function checkSingleInterval(_0x14437a,_0x5648b6){return db['Interval']['findById'](_0x14437a)[_0xdbb1('0xe')](function(_0x3aab9e){if(_0x3aab9e){logger[_0xdbb1('0x19')](util[_0xdbb1('0x1d')](_0xdbb1('0x1e'),_0x3aab9e[_0xdbb1('0x1b')],_0x3aab9e['id']));return _0x3aab9e[_0xdbb1('0x18')](_0x5648b6);}});}exports['IntervalIftime']=function(_0xfe9aed){var _0x3bcc47=_0xfe9aed[_0xdbb1('0x1f')];var _0x4d3824=Array[_0xdbb1('0x20')](_0xfe9aed[_0xdbb1('0x21')])?_0xfe9aed['intervals']:typeof _0xfe9aed[_0xdbb1('0x21')]==='string'?[_0xfe9aed[_0xdbb1('0x21')]]:[];var _0x496a28=_0xfe9aed['timezone']||undefined;var _0x4bd3eb=![];if(_0x4d3824['length']){logger['info'](util['format'](_0xdbb1('0x22'),_0x4d3824[_0xdbb1('0x1c')](';\x20')));}if(_0x496a28){logger[_0xdbb1('0x19')](util[_0xdbb1('0x1d')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x496a28));}logger[_0xdbb1('0x15')](_0xdbb1('0x23'),_0x4bd3eb);logger[_0xdbb1('0x24')](_0xdbb1('0x25'),_0xfe9aed);return Promise[_0xdbb1('0x26')]()[_0xdbb1('0xe')](function(){if(Array['isArray'](_0x3bcc47)){return checkArrayOfIntervals(_0x3bcc47,_0x496a28);}else if(_0x3bcc47){return checkSingleInterval(_0x3bcc47,_0x496a28);}})['then'](function(_0x4a1ac6){var _0x5aeda7=_0x4d3824[_0xdbb1('0x27')](function(_0x1d58a2,_0x5b82df){return _0x1d58a2||iftime(_0x5b82df,_0x496a28);},![]);_0x4bd3eb=_0x4a1ac6||_0x5aeda7;return _0x4bd3eb;})[_0xdbb1('0x10')](function(_0x526773){logger[_0xdbb1('0x11')](_0xdbb1('0x25'),_0xfe9aed,_0x526773);throw this['error'](0x1f4,_0x526773['message']);});};
\ No newline at end of file
index 07b1157..ad38e34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1de2bd,_0x953fb){_0x1de2bd=_0x1de2bd-0x0;var _0x595960=_0x0b0e[_0x1de2bd];return _0x595960;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router;
\ No newline at end of file
+var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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 35e0f2e..7ceb261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9628=['bluebird','https','../../config/logger','api','support','key','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','utf8','data','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','connection','remoteAddress','socket'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x9628,0x102));var _0x8962=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9628[_0x432682];return _0x463d05;};'use strict';var BPromise=require(_0x8962('0x0'));var https=require(_0x8962('0x1'));var logger=require(_0x8962('0x2'))(_0x8962('0x3'));var USERNAME=_0x8962('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0xeca013,_0x54c39e){var _0x1e1ca5={'fields':{'project':{'key':_0xeca013[_0x8962('0x5')]||'MOTGUI'},'summary':(_0xeca013['summary']||_0x8962('0x6'))+_0x8962('0x7')+_0xeca013['ip'],'description':_0xeca013[_0x8962('0x8')]||JSON[_0x8962('0x9')](_0xeca013),'issuetype':{'name':_0xeca013[_0x8962('0xa')]||_0x8962('0xb')}}};_0x1e1ca5[_0x8962('0xc')][_0x8962('0xd')]=_0xeca013[_0x8962('0xe')];_0x1e1ca5['fields'][_0x8962('0xf')]=_0xeca013[_0x8962('0x10')];_0x1e1ca5[_0x8962('0xc')][_0x8962('0x11')]=_0xeca013[_0x8962('0x12')];_0x1e1ca5[_0x8962('0xc')]['customfield_11503']=_0xeca013[_0x8962('0x13')];_0x1e1ca5[_0x8962('0xc')][_0x8962('0x14')]=_0xeca013[_0x8962('0x15')];_0x1e1ca5[_0x8962('0xc')]['customfield_10102']=_0xeca013['ip'];var _0x2d4010={'host':_0x8962('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x8962('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x8962('0x18'),'Authorization':_0x8962('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x8962('0x1a')](_0x8962('0x1b'))}};var _0x1cf692=JSON[_0x8962('0x9')](_0x1e1ca5);var _0x611c3=https[_0x8962('0x1c')](_0x2d4010,function(_0x4dcf93){_0x4dcf93['setEncoding'](_0x8962('0x1d'));var _0x3efa42='';_0x4dcf93['on'](_0x8962('0x1e'),function(_0x3e50b5){_0x3efa42+=_0x3e50b5;});_0x4dcf93['on']('end',function(){if(_0x54c39e){return _0x54c39e[_0x8962('0x1f')](_0x4dcf93['statusCode'])[_0x8962('0x20')](JSON[_0x8962('0x21')](_0x3efa42));}});});_0x611c3['on'](_0x8962('0x22'),function(_0x412313){if(_0x54c39e){return _0x54c39e['status'](0x1f4)[_0x8962('0x20')]({'errors':[{'message':_0x8962('0x23'),'type':_0x8962('0x24')}]});}});_0x611c3[_0x8962('0x25')](_0x1cf692);_0x611c3['end']();}exports['openIssue']=openIssue;exports[_0x8962('0x26')]=function(_0x14272f,_0x3ddb33){_0x14272f[_0x8962('0x27')]['ip']=_0x14272f['headers']['x-forwarded-for']||_0x14272f[_0x8962('0x28')][_0x8962('0x29')]||_0x14272f[_0x8962('0x2a')]['remoteAddress']||_0x14272f[_0x8962('0x28')][_0x8962('0x2a')][_0x8962('0x29')];return openIssue(_0x14272f[_0x8962('0x27')],_0x3ddb33);};
\ No newline at end of file
+var _0xdbb3=['customfield_11501','oldToken','customfield_11502','fields','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','base64','stringify','request','setEncoding','data','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','headers','connection','socket','bluebird','https','../../config/logger','support','key','summary','Report','\x20from\x20','issuetype','email'];(function(_0xeb97e7,_0x1307a4){var _0x1ad39a=function(_0x416e05){while(--_0x416e05){_0xeb97e7['push'](_0xeb97e7['shift']());}};_0x1ad39a(++_0x1307a4);}(_0xdbb3,0x1d7));var _0x3dbb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdbb3[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x3dbb('0x0'));var https=require(_0x3dbb('0x1'));var logger=require(_0x3dbb('0x2'))('api');var USERNAME=_0x3dbb('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2f1423,_0x1e1467){var _0x3a21b6={'fields':{'project':{'key':_0x2f1423[_0x3dbb('0x4')]||'MOTGUI'},'summary':(_0x2f1423[_0x3dbb('0x5')]||_0x3dbb('0x6'))+_0x3dbb('0x7')+_0x2f1423['ip'],'description':_0x2f1423['description']||JSON['stringify'](_0x2f1423),'issuetype':{'name':_0x2f1423[_0x3dbb('0x8')]||'Bug'}}};_0x3a21b6['fields']['customfield_11500']=_0x2f1423[_0x3dbb('0x9')];_0x3a21b6['fields'][_0x3dbb('0xa')]=_0x2f1423[_0x3dbb('0xb')];_0x3a21b6['fields'][_0x3dbb('0xc')]=_0x2f1423['newToken'];_0x3a21b6[_0x3dbb('0xd')][_0x3dbb('0xe')]=_0x2f1423[_0x3dbb('0xf')];_0x3a21b6[_0x3dbb('0xd')]['customfield_11504']=_0x2f1423[_0x3dbb('0x10')];_0x3a21b6[_0x3dbb('0xd')][_0x3dbb('0x11')]=_0x2f1423['ip'];var _0x12f48e={'host':_0x3dbb('0x12'),'port':0x1bb,'path':_0x3dbb('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3dbb('0x14'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3dbb('0x15'))}};var _0x56b8a8=JSON[_0x3dbb('0x16')](_0x3a21b6);var _0x5297d5=https[_0x3dbb('0x17')](_0x12f48e,function(_0xc397a2){_0xc397a2[_0x3dbb('0x18')]('utf8');var _0x3f3382='';_0xc397a2['on'](_0x3dbb('0x19'),function(_0x90e871){_0x3f3382+=_0x90e871;});_0xc397a2['on']('end',function(){if(_0x1e1467){return _0x1e1467['status'](_0xc397a2['statusCode'])[_0x3dbb('0x1a')](JSON[_0x3dbb('0x1b')](_0x3f3382));}});});_0x5297d5['on']('error',function(_0x454bb4){if(_0x1e1467){return _0x1e1467['status'](0x1f4)[_0x3dbb('0x1a')]({'errors':[{'message':_0x3dbb('0x1c'),'type':_0x3dbb('0x1d')}]});}});_0x5297d5[_0x3dbb('0x1e')](_0x56b8a8);_0x5297d5[_0x3dbb('0x1f')]();}exports['openIssue']=openIssue;exports[_0x3dbb('0x20')]=function(_0x4dfe55,_0x15a39f){_0x4dfe55[_0x3dbb('0x21')]['ip']=_0x4dfe55[_0x3dbb('0x22')]['x-forwarded-for']||_0x4dfe55[_0x3dbb('0x23')]['remoteAddress']||_0x4dfe55[_0x3dbb('0x24')]['remoteAddress']||_0x4dfe55['connection']['socket']['remoteAddress'];return openIssue(_0x4dfe55[_0x3dbb('0x21')],_0x15a39f);};
\ No newline at end of file
index cee4fad..0ffd244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update'];(function(_0x1ec7b5,_0x4a7a06){var _0x262ac8=function(_0x116fae){while(--_0x116fae){_0x1ec7b5['push'](_0x1ec7b5['shift']());}};_0x262ac8(++_0x4a7a06);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xf3cd[_0x21090b];return _0x3c68d7;};'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('./jscriptyAnswerReport.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('0xe')]('/',auth['isAuthenticated'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x10')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x12')]);router[_0xdf3c('0x13')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller['destroy']);module[_0xdf3c('0x14')]=router;
\ No newline at end of file
+var _0x22fb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a0dec,_0xf58f2){var _0x2e6a05=function(_0x1be135){while(--_0x1be135){_0x2a0dec['push'](_0x2a0dec['shift']());}};_0x2e6a05(++_0xf58f2);}(_0x22fb,0x192));var _0xb22f=function(_0x5742c1,_0x51f7e5){_0x5742c1=_0x5742c1-0x0;var _0x4c70d4=_0x22fb[_0x5742c1];return _0x4c70d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb22f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1c13b3b..32871be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a54,0x106));var _0x47a5=function(_0x3de057,_0x22f23f){_0x3de057=_0x3de057-0x0;var _0x5f127c=_0x7a54[_0x3de057];return _0x5f127c;};'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(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7a54,0x106));var _0x47a5=function(_0x41f513,_0x465341){_0x41f513=_0x41f513-0x0;var _0x3a93f5=_0x7a54[_0x41f513];return _0x3a93f5;};'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 e9e7c1e..02c6cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x598a=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','JscriptyAnswerReport','include','findAll','rows','show','rawAttributes','includeAll','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map'];(function(_0x1f1dfc,_0x45d55b){var _0x1b68de=function(_0x5db0fe){while(--_0x5db0fe){_0x1f1dfc['push'](_0x1f1dfc['shift']());}};_0x1b68de(++_0x45d55b);}(_0x598a,0xfb));var _0xa598=function(_0x1d25bd,_0x1a0374){_0x1d25bd=_0x1d25bd-0x0;var _0x499507=_0x598a[_0x1d25bd];return _0x499507;};'use strict';var emlformat=require(_0xa598('0x0'));var rimraf=require(_0xa598('0x1'));var zipdir=require(_0xa598('0x2'));var jsonpatch=require(_0xa598('0x3'));var rp=require(_0xa598('0x4'));var moment=require('moment');var BPromise=require(_0xa598('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa598('0x6'));var csv=require(_0xa598('0x7'));var ejs=require(_0xa598('0x8'));var fs=require('fs');var fs_extra=require(_0xa598('0x9'));var _=require(_0xa598('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa598('0xb'));var deskjs=require(_0xa598('0xc'));var toCsv=require(_0xa598('0x7'));var querystring=require(_0xa598('0xd'));var Papa=require(_0xa598('0xe'));var Redis=require(_0xa598('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa598('0x10'));var hardwareService=require(_0xa598('0x11'));var logger=require(_0xa598('0x12'))(_0xa598('0x13'));var utils=require(_0xa598('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa598('0x15'));var db=require(_0xa598('0x16'))['db'];function respondWithStatusCode(_0x468710,_0x5041d4){_0x5041d4=_0x5041d4||0xcc;return function(_0xe8f905){if(_0xe8f905){return _0x468710['sendStatus'](_0x5041d4);}return _0x468710[_0xa598('0x17')](_0x5041d4)[_0xa598('0x18')]();};}function respondWithResult(_0xb3288a,_0x38afa9){_0x38afa9=_0x38afa9||0xc8;return function(_0x1949b5){if(_0x1949b5){return _0xb3288a[_0xa598('0x17')](_0x38afa9)[_0xa598('0x19')](_0x1949b5);}};}function respondWithFilteredResult(_0x41d3fe,_0x28534a){return function(_0x4b100b){if(_0x4b100b){var _0x88df86=typeof _0x28534a[_0xa598('0x1a')]===_0xa598('0x1b')&&typeof _0x28534a[_0xa598('0x1c')]===_0xa598('0x1b');var _0xecb39d=_0x4b100b[_0xa598('0x1d')];var _0x2746e3=_0x88df86?0x0:_0x28534a[_0xa598('0x1a')];var _0x44c872=_0x88df86?_0x4b100b['count']:_0x28534a[_0xa598('0x1a')]+_0x28534a[_0xa598('0x1c')];var _0x3fd5a4;if(_0x44c872>=_0xecb39d){_0x44c872=_0xecb39d;_0x3fd5a4=0xc8;}else{_0x3fd5a4=0xce;}_0x41d3fe[_0xa598('0x17')](_0x3fd5a4);return _0x41d3fe[_0xa598('0x1e')](_0xa598('0x1f'),_0x2746e3+'-'+_0x44c872+'/'+_0xecb39d)['json'](_0x4b100b);}return null;};}function patchUpdates(_0x56fc63){return function(_0x2923d5){try{jsonpatch['apply'](_0x2923d5,_0x56fc63,!![]);}catch(_0x3ac469){return BPromise[_0xa598('0x20')](_0x3ac469);}return _0x2923d5[_0xa598('0x21')]();};}function saveUpdates(_0x2222b0,_0x261868){return function(_0x24f4f0){if(_0x24f4f0){return _0x24f4f0['update'](_0x2222b0)[_0xa598('0x22')](function(_0x46d225){return _0x46d225;});}return null;};}function removeEntity(_0x470663,_0x14643d){return function(_0x802679){if(_0x802679){return _0x802679[_0xa598('0x23')]()[_0xa598('0x22')](function(){_0x470663[_0xa598('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x473d07,_0x414d2c){return function(_0x499565){if(!_0x499565){_0x473d07['sendStatus'](0x194);}return _0x499565;};}function handleError(_0x35b669,_0x559038){_0x559038=_0x559038||0x1f4;return function(_0x527c9f){logger[_0xa598('0x24')](_0x527c9f['stack']);if(_0x527c9f[_0xa598('0x25')]){delete _0x527c9f['name'];}_0x35b669['status'](_0x559038)[_0xa598('0x26')](_0x527c9f);};}exports[_0xa598('0x27')]=function(_0x554d3b,_0x16f00d){var _0x2823f7={},_0x3cdc59={},_0x29bfe3={'count':0x0,'rows':[]};var _0x523392=_[_0xa598('0x28')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x587d11){return{'name':_0x587d11[_0xa598('0x29')],'type':_0x587d11['type'][_0xa598('0x2a')]};});_0x3cdc59[_0xa598('0x2b')]=_[_0xa598('0x28')](_0x523392,'name');_0x3cdc59[_0xa598('0x2c')]=_[_0xa598('0x2d')](_0x554d3b[_0xa598('0x2c')]);_0x3cdc59[_0xa598('0x2e')]=_[_0xa598('0x2f')](_0x3cdc59['model'],_0x3cdc59[_0xa598('0x2c')]);_0x2823f7[_0xa598('0x30')]=_[_0xa598('0x2f')](_0x3cdc59[_0xa598('0x2b')],qs['fields'](_0x554d3b[_0xa598('0x2c')][_0xa598('0x31')]));_0x2823f7['attributes']=_0x2823f7['attributes'][_0xa598('0x32')]?_0x2823f7[_0xa598('0x30')]:_0x3cdc59[_0xa598('0x2b')];if(!_0x554d3b['query'][_0xa598('0x33')](_0xa598('0x34'))){_0x2823f7['limit']=qs[_0xa598('0x1c')](_0x554d3b['query'][_0xa598('0x1c')]);_0x2823f7[_0xa598('0x1a')]=qs['offset'](_0x554d3b[_0xa598('0x2c')][_0xa598('0x1a')]);}_0x2823f7['order']=qs[_0xa598('0x35')](_0x554d3b[_0xa598('0x2c')][_0xa598('0x35')]);_0x2823f7['where']=qs[_0xa598('0x2e')](_[_0xa598('0x36')](_0x554d3b[_0xa598('0x2c')],_0x3cdc59['filters']),_0x523392);if(_0x554d3b[_0xa598('0x2c')]['filter']){_0x2823f7[_0xa598('0x37')]=_[_0xa598('0x38')](_0x2823f7[_0xa598('0x37')],{'$or':_['map'](_0x523392,function(_0x5bd98a){if(_0x5bd98a['type']!=='VIRTUAL'){var _0x3358ad={};_0x3358ad[_0x5bd98a[_0xa598('0x25')]]={'$like':'%'+_0x554d3b[_0xa598('0x2c')][_0xa598('0x39')]+'%'};return _0x3358ad;}})});}_0x2823f7=_[_0xa598('0x38')]({},_0x2823f7,_0x554d3b[_0xa598('0x3a')]);var _0x4526d7={'where':_0x2823f7[_0xa598('0x37')]};return db[_0xa598('0x3b')][_0xa598('0x1d')](_0x4526d7)['then'](function(_0x1833fb){_0x29bfe3[_0xa598('0x1d')]=_0x1833fb;if(_0x554d3b[_0xa598('0x2c')]['includeAll']){_0x2823f7[_0xa598('0x3c')]=[{'all':!![]}];}return db[_0xa598('0x3b')][_0xa598('0x3d')](_0x2823f7);})[_0xa598('0x22')](function(_0x307497){_0x29bfe3[_0xa598('0x3e')]=_0x307497;return _0x29bfe3;})['then'](respondWithFilteredResult(_0x16f00d,_0x2823f7))['catch'](handleError(_0x16f00d,null));};exports[_0xa598('0x3f')]=function(_0x10f2f7,_0x5a772d){var _0x45bc68={'raw':!![],'where':{'id':_0x10f2f7['params']['id']}},_0x54bb73={};_0x54bb73[_0xa598('0x2b')]=_['keys'](db[_0xa598('0x3b')][_0xa598('0x40')]);_0x54bb73[_0xa598('0x2c')]=_[_0xa598('0x2d')](_0x10f2f7[_0xa598('0x2c')]);_0x54bb73[_0xa598('0x2e')]=_[_0xa598('0x2f')](_0x54bb73[_0xa598('0x2b')],_0x54bb73[_0xa598('0x2c')]);_0x45bc68[_0xa598('0x30')]=_['intersection'](_0x54bb73[_0xa598('0x2b')],qs[_0xa598('0x31')](_0x10f2f7[_0xa598('0x2c')][_0xa598('0x31')]));_0x45bc68[_0xa598('0x30')]=_0x45bc68[_0xa598('0x30')][_0xa598('0x32')]?_0x45bc68['attributes']:_0x54bb73[_0xa598('0x2b')];if(_0x10f2f7[_0xa598('0x2c')][_0xa598('0x41')]){_0x45bc68[_0xa598('0x3c')]=[{'all':!![]}];}_0x45bc68=_[_0xa598('0x38')]({},_0x45bc68,_0x10f2f7[_0xa598('0x3a')]);return db[_0xa598('0x3b')][_0xa598('0x42')](_0x45bc68)['then'](handleEntityNotFound(_0x5a772d,null))[_0xa598('0x22')](respondWithResult(_0x5a772d,null))['catch'](handleError(_0x5a772d,null));};exports[_0xa598('0x43')]=function(_0x1ec7d8,_0x2710d){return db[_0xa598('0x3b')][_0xa598('0x43')](_0x1ec7d8[_0xa598('0x44')],{})[_0xa598('0x22')](respondWithResult(_0x2710d,0xc9))[_0xa598('0x45')](handleError(_0x2710d,null));};exports[_0xa598('0x46')]=function(_0x51e0e9,_0x57e82c){if(_0x51e0e9[_0xa598('0x44')]['id']){delete _0x51e0e9[_0xa598('0x44')]['id'];}return db[_0xa598('0x3b')][_0xa598('0x42')]({'where':{'id':_0x51e0e9['params']['id']}})['then'](handleEntityNotFound(_0x57e82c,null))['then'](saveUpdates(_0x51e0e9[_0xa598('0x44')],null))[_0xa598('0x22')](respondWithResult(_0x57e82c,null))['catch'](handleError(_0x57e82c,null));};exports['destroy']=function(_0x54b287,_0x315a01){return db[_0xa598('0x3b')][_0xa598('0x42')]({'where':{'id':_0x54b287[_0xa598('0x47')]['id']}})['then'](handleEntityNotFound(_0x315a01,null))[_0xa598('0x22')](removeEntity(_0x315a01,null))[_0xa598('0x45')](handleError(_0x315a01,null));};exports[_0xa598('0x48')]=function(_0x3a4ec4,_0x333182){return db[_0xa598('0x3b')][_0xa598('0x48')]()[_0xa598('0x22')](respondWithResult(_0x333182,null))[_0xa598('0x45')](handleError(_0x333182,null));};
\ No newline at end of file
+var _0x6011=['ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','find','describe','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x3d86a8,_0x223a49){var _0x5a3dc4=function(_0x44b874){while(--_0x44b874){_0x3d86a8['push'](_0x3d86a8['shift']());}};_0x5a3dc4(++_0x223a49);}(_0x6011,0x196));var _0x1601=function(_0x3fe5d3,_0x4cc69c){_0x3fe5d3=_0x3fe5d3-0x0;var _0x312150=_0x6011[_0x3fe5d3];return _0x312150;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1601('0x0'));var BPromise=require(_0x1601('0x1'));var Mustache=require('mustache');var util=require(_0x1601('0x2'));var path=require(_0x1601('0x3'));var sox=require(_0x1601('0x4'));var csv=require(_0x1601('0x5'));var ejs=require(_0x1601('0x6'));var fs=require('fs');var fs_extra=require(_0x1601('0x7'));var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x5'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1601('0x10'))('api');var utils=require(_0x1601('0x11'));var config=require(_0x1601('0x12'));var licenseUtil=require(_0x1601('0x13'));var db=require(_0x1601('0x14'))['db'];function respondWithStatusCode(_0x263bef,_0x322025){_0x322025=_0x322025||0xcc;return function(_0x3ac50b){if(_0x3ac50b){return _0x263bef[_0x1601('0x15')](_0x322025);}return _0x263bef['status'](_0x322025)[_0x1601('0x16')]();};}function respondWithResult(_0x555d4f,_0x4705f0){_0x4705f0=_0x4705f0||0xc8;return function(_0x5d642d){if(_0x5d642d){return _0x555d4f[_0x1601('0x17')](_0x4705f0)[_0x1601('0x18')](_0x5d642d);}};}function respondWithFilteredResult(_0x4bb5c1,_0x1b40be){return function(_0x39873a){if(_0x39873a){var _0x12ddb0=typeof _0x1b40be['offset']==='undefined'&&typeof _0x1b40be[_0x1601('0x19')]===_0x1601('0x1a');var _0x3621e2=_0x39873a[_0x1601('0x1b')];var _0x1d8563=_0x12ddb0?0x0:_0x1b40be[_0x1601('0x1c')];var _0x23b992=_0x12ddb0?_0x39873a[_0x1601('0x1b')]:_0x1b40be[_0x1601('0x1c')]+_0x1b40be['limit'];var _0x4d077e;if(_0x23b992>=_0x3621e2){_0x23b992=_0x3621e2;_0x4d077e=0xc8;}else{_0x4d077e=0xce;}_0x4bb5c1[_0x1601('0x17')](_0x4d077e);return _0x4bb5c1[_0x1601('0x1d')](_0x1601('0x1e'),_0x1d8563+'-'+_0x23b992+'/'+_0x3621e2)['json'](_0x39873a);}return null;};}function patchUpdates(_0x2c3b5d){return function(_0x380157){try{jsonpatch[_0x1601('0x1f')](_0x380157,_0x2c3b5d,!![]);}catch(_0x2e2e0d){return BPromise[_0x1601('0x20')](_0x2e2e0d);}return _0x380157['save']();};}function saveUpdates(_0x1b8314,_0x296023){return function(_0x220313){if(_0x220313){return _0x220313['update'](_0x1b8314)[_0x1601('0x21')](function(_0x330033){return _0x330033;});}return null;};}function removeEntity(_0x4f918b,_0x2b01da){return function(_0xa8e856){if(_0xa8e856){return _0xa8e856['destroy']()['then'](function(){_0x4f918b[_0x1601('0x17')](0xcc)[_0x1601('0x16')]();});}};}function handleEntityNotFound(_0x34d021,_0x4919f2){return function(_0x362f51){if(!_0x362f51){_0x34d021[_0x1601('0x15')](0x194);}return _0x362f51;};}function handleError(_0x23a6a9,_0x250fcc){_0x250fcc=_0x250fcc||0x1f4;return function(_0x296c34){logger['error'](_0x296c34['stack']);if(_0x296c34[_0x1601('0x22')]){delete _0x296c34[_0x1601('0x22')];}_0x23a6a9[_0x1601('0x17')](_0x250fcc)['send'](_0x296c34);};}exports[_0x1601('0x23')]=function(_0x57eb42,_0x2dcbc9){var _0x3c6bc1={},_0x389f0f={},_0x4d4d0b={'count':0x0,'rows':[]};var _0x388530=_[_0x1601('0x24')](db[_0x1601('0x25')][_0x1601('0x26')],function(_0x5cdcfb){return{'name':_0x5cdcfb[_0x1601('0x27')],'type':_0x5cdcfb[_0x1601('0x28')][_0x1601('0x29')]};});_0x389f0f[_0x1601('0x2a')]=_[_0x1601('0x24')](_0x388530,_0x1601('0x22'));_0x389f0f[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x57eb42[_0x1601('0x2b')]);_0x389f0f[_0x1601('0x2d')]=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],_0x389f0f[_0x1601('0x2b')]);_0x3c6bc1['attributes']=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x2f')]));_0x3c6bc1['attributes']=_0x3c6bc1[_0x1601('0x30')][_0x1601('0x31')]?_0x3c6bc1['attributes']:_0x389f0f[_0x1601('0x2a')];if(!_0x57eb42['query'][_0x1601('0x32')](_0x1601('0x33'))){_0x3c6bc1['limit']=qs[_0x1601('0x19')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x19')]);_0x3c6bc1[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x1c')]);}_0x3c6bc1['order']=qs[_0x1601('0x34')](_0x57eb42[_0x1601('0x2b')]['sort']);_0x3c6bc1['where']=qs[_0x1601('0x2d')](_[_0x1601('0x35')](_0x57eb42[_0x1601('0x2b')],_0x389f0f[_0x1601('0x2d')]),_0x388530);if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x36')]){_0x3c6bc1[_0x1601('0x37')]=_['merge'](_0x3c6bc1[_0x1601('0x37')],{'$or':_[_0x1601('0x24')](_0x388530,function(_0x482379){if(_0x482379['type']!==_0x1601('0x38')){var _0x52034d={};_0x52034d[_0x482379['name']]={'$like':'%'+_0x57eb42['query'][_0x1601('0x36')]+'%'};return _0x52034d;}})});}_0x3c6bc1=_[_0x1601('0x39')]({},_0x3c6bc1,_0x57eb42[_0x1601('0x3a')]);var _0xb8146e={'where':_0x3c6bc1[_0x1601('0x37')]};return db[_0x1601('0x25')][_0x1601('0x1b')](_0xb8146e)[_0x1601('0x21')](function(_0x388f3b){_0x4d4d0b[_0x1601('0x1b')]=_0x388f3b;if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3c6bc1[_0x1601('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x1601('0x3d')](_0x3c6bc1);})['then'](function(_0x5acf66){_0x4d4d0b['rows']=_0x5acf66;return _0x4d4d0b;})[_0x1601('0x21')](respondWithFilteredResult(_0x2dcbc9,_0x3c6bc1))[_0x1601('0x3e')](handleError(_0x2dcbc9,null));};exports[_0x1601('0x3f')]=function(_0x5a06dc,_0x581941){var _0x3aef1a={'raw':!![],'where':{'id':_0x5a06dc[_0x1601('0x40')]['id']}},_0x3ce65d={};_0x3ce65d['model']=_[_0x1601('0x2c')](db['JscriptyAnswerReport'][_0x1601('0x26')]);_0x3ce65d[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x5a06dc[_0x1601('0x2b')]);_0x3ce65d['filters']=_[_0x1601('0x2e')](_0x3ce65d['model'],_0x3ce65d[_0x1601('0x2b')]);_0x3aef1a[_0x1601('0x30')]=_['intersection'](_0x3ce65d[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x5a06dc[_0x1601('0x2b')]['fields']));_0x3aef1a[_0x1601('0x30')]=_0x3aef1a['attributes'][_0x1601('0x31')]?_0x3aef1a[_0x1601('0x30')]:_0x3ce65d[_0x1601('0x2a')];if(_0x5a06dc[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3aef1a[_0x1601('0x3c')]=[{'all':!![]}];}_0x3aef1a=_[_0x1601('0x39')]({},_0x3aef1a,_0x5a06dc[_0x1601('0x3a')]);return db[_0x1601('0x25')]['find'](_0x3aef1a)[_0x1601('0x21')](handleEntityNotFound(_0x581941,null))['then'](respondWithResult(_0x581941,null))[_0x1601('0x3e')](handleError(_0x581941,null));};exports[_0x1601('0x41')]=function(_0x4a8039,_0xbaeefc){return db[_0x1601('0x25')]['create'](_0x4a8039[_0x1601('0x42')],{})[_0x1601('0x21')](respondWithResult(_0xbaeefc,0xc9))[_0x1601('0x3e')](handleError(_0xbaeefc,null));};exports[_0x1601('0x43')]=function(_0x30f2bf,_0xf14c98){if(_0x30f2bf[_0x1601('0x42')]['id']){delete _0x30f2bf[_0x1601('0x42')]['id'];}return db[_0x1601('0x25')][_0x1601('0x44')]({'where':{'id':_0x30f2bf['params']['id']}})[_0x1601('0x21')](handleEntityNotFound(_0xf14c98,null))['then'](saveUpdates(_0x30f2bf[_0x1601('0x42')],null))[_0x1601('0x21')](respondWithResult(_0xf14c98,null))[_0x1601('0x3e')](handleError(_0xf14c98,null));};exports['destroy']=function(_0x56b904,_0x26ba09){return db[_0x1601('0x25')]['find']({'where':{'id':_0x56b904['params']['id']}})['then'](handleEntityNotFound(_0x26ba09,null))[_0x1601('0x21')](removeEntity(_0x26ba09,null))['catch'](handleError(_0x26ba09,null));};exports[_0x1601('0x45')]=function(_0x174eee,_0x50edf3){return db[_0x1601('0x25')]['describe']()['then'](respondWithResult(_0x50edf3,null))[_0x1601('0x3e')](handleError(_0x50edf3,null));};
\ No newline at end of file
index 7748d4b..dec52e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dee=['define','report_jscripty_answers','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x358f87,_0x5a4d20){var _0x4b2fdb=function(_0x384222){while(--_0x384222){_0x358f87['push'](_0x358f87['shift']());}};_0x4b2fdb(++_0x5a4d20);}(_0x9dee,0x1ee));var _0xe9de=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x9dee[_0x1dfa63];return _0x26f2a9;};'use strict';var _=require(_0xe9de('0x0'));var util=require(_0xe9de('0x1'));var logger=require('../../config/logger')(_0xe9de('0x2'));var moment=require(_0xe9de('0x3'));var BPromise=require(_0xe9de('0x4'));var rp=require(_0xe9de('0x5'));var fs=require('fs');var path=require(_0xe9de('0x6'));var rimraf=require(_0xe9de('0x7'));var config=require(_0xe9de('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xe9de('0x9')]=function(_0x21295b,_0x3239fd){return _0x21295b[_0xe9de('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0xe9de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d59=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x310da1,_0x390f65){var _0x333d17=function(_0x27d0f8){while(--_0x27d0f8){_0x310da1['push'](_0x310da1['shift']());}};_0x333d17(++_0x390f65);}(_0x4d59,0x185));var _0x94d5=function(_0xa37e7d,_0x2719e8){_0xa37e7d=_0xa37e7d-0x0;var _0x152f43=_0x4d59[_0xa37e7d];return _0x152f43;};'use strict';var _=require(_0x94d5('0x0'));var util=require(_0x94d5('0x1'));var logger=require(_0x94d5('0x2'))(_0x94d5('0x3'));var moment=require('moment');var BPromise=require(_0x94d5('0x4'));var rp=require(_0x94d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x94d5('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x94d5('0x7')]=function(_0x36328f,_0x154bce){return _0x36328f[_0x94d5('0x8')](_0x94d5('0x9'),attributes,{'tableName':_0x94d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35b53da..3147cf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad5c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash'];(function(_0x4cff74,_0x4195f1){var _0x5d4ae4=function(_0x44ecf2){while(--_0x44ecf2){_0x4cff74['push'](_0x4cff74['shift']());}};_0x5d4ae4(++_0x4195f1);}(_0xad5c,0x153));var _0xcad5=function(_0x3583b6,_0x532993){_0x3583b6=_0x3583b6-0x0;var _0x3b3753=_0xad5c[_0x3583b6];return _0x3b3753;};'use strict';var _=require(_0xcad5('0x0'));var util=require(_0xcad5('0x1'));var moment=require('moment');var BPromise=require(_0xcad5('0x2'));var rs=require(_0xcad5('0x3'));var fs=require('fs');var Redis=require(_0xcad5('0x4'));var db=require(_0xcad5('0x5'))['db'];var utils=require(_0xcad5('0x6'));var logger=require('../../config/logger')(_0xcad5('0x7'));var config=require(_0xcad5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcad5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57c4eb,_0x4dd256,_0x2be67f){return new BPromise(function(_0x3feed1,_0x46e226){return client['request'](_0x57c4eb,_0x2be67f)[_0xcad5('0xa')](function(_0x2cf5b3){logger['info'](_0xcad5('0xb'),_0x4dd256,_0xcad5('0xc'));logger[_0xcad5('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4dd256,'request\x20sent',JSON['stringify'](_0x2cf5b3));if(_0x2cf5b3[_0xcad5('0xe')]){if(_0x2cf5b3[_0xcad5('0xe')][_0xcad5('0xf')]===0x1f4){logger['error'](_0xcad5('0xb'),_0x4dd256,_0x2cf5b3[_0xcad5('0xe')][_0xcad5('0x10')]);return _0x46e226(_0x2cf5b3[_0xcad5('0xe')][_0xcad5('0x10')]);}logger[_0xcad5('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4dd256,_0x2cf5b3[_0xcad5('0xe')][_0xcad5('0x10')]);return _0x3feed1(_0x2cf5b3[_0xcad5('0xe')]['message']);}else{logger[_0xcad5('0x11')](_0xcad5('0xb'),_0x4dd256,_0xcad5('0xc'));_0x3feed1(_0x2cf5b3[_0xcad5('0x12')][_0xcad5('0x10')]);}})[_0xcad5('0x13')](function(_0x4e86a0){logger[_0xcad5('0xe')](_0xcad5('0xb'),_0x4dd256,_0x4e86a0);_0x46e226(_0x4e86a0);});});}
\ No newline at end of file
+var _0xd786=['request','then','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd786,0x171));var _0x6d78=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xd786[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require(_0x6d78('0x4'));var fs=require('fs');var Redis=require(_0x6d78('0x5'));var db=require(_0x6d78('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d78('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6d78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c7692,_0x172133,_0xd67cd2){return new BPromise(function(_0x457d48,_0x4abbc0){return client[_0x6d78('0x9')](_0x2c7692,_0xd67cd2)[_0x6d78('0xa')](function(_0x27d2bc){logger['info'](_0x6d78('0xb'),_0x172133,'request\x20sent');logger['debug'](_0x6d78('0xc'),_0x172133,_0x6d78('0xd'),JSON['stringify'](_0x27d2bc));if(_0x27d2bc[_0x6d78('0xe')]){if(_0x27d2bc[_0x6d78('0xe')][_0x6d78('0xf')]===0x1f4){logger[_0x6d78('0xe')](_0x6d78('0xb'),_0x172133,_0x27d2bc[_0x6d78('0xe')][_0x6d78('0x10')]);return _0x4abbc0(_0x27d2bc[_0x6d78('0xe')][_0x6d78('0x10')]);}logger[_0x6d78('0xe')](_0x6d78('0xb'),_0x172133,_0x27d2bc[_0x6d78('0xe')]['message']);return _0x457d48(_0x27d2bc['error']['message']);}else{logger['info'](_0x6d78('0xb'),_0x172133,_0x6d78('0xd'));_0x457d48(_0x27d2bc[_0x6d78('0x11')][_0x6d78('0x10')]);}})['catch'](function(_0x5999f6){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x172133,_0x5999f6);_0x4abbc0(_0x5999f6);});});}
\ No newline at end of file
index 46e6b1a..1865014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6877=['/:id/clone','clone','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','getSessions','/:id/answers','getAnswers','30s','getSummary','post'];(function(_0x5a1632,_0x2191bc){var _0x39892a=function(_0x5a4ee9){while(--_0x5a4ee9){_0x5a1632['push'](_0x5a1632['shift']());}};_0x39892a(++_0x2191bc);}(_0x6877,0x17c));var _0x7687=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x6877[_0x2e8418];return _0x548fe6;};'use strict';var multer=require(_0x7687('0x0'));var util=require(_0x7687('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7687('0x2'));var router=express[_0x7687('0x3')]();var fs_extra=require(_0x7687('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7687('0x5'));var controller=require(_0x7687('0x6'));router[_0x7687('0x7')]('/',auth[_0x7687('0x8')](),controller['index']);router[_0x7687('0x7')](_0x7687('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/sessions',auth[_0x7687('0x8')](),controller[_0x7687('0xa')]);router[_0x7687('0x7')](_0x7687('0xb'),auth[_0x7687('0x8')](),controller[_0x7687('0xc')]);router['get']('/:id/summary',auth[_0x7687('0x8')](),timeout(_0x7687('0xd')),controller[_0x7687('0xe')]);router[_0x7687('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7687('0xf')](_0x7687('0x10'),auth[_0x7687('0x8')](),controller[_0x7687('0x11')]);router['put'](_0x7687('0x9'),auth[_0x7687('0x8')](),controller[_0x7687('0x12')]);router[_0x7687('0x13')](_0x7687('0x9'),auth[_0x7687('0x8')](),controller[_0x7687('0x14')]);module[_0x7687('0x15')]=router;
\ No newline at end of file
+var _0x7247=['isAuthenticated','/:id','show','/:id/sessions','/:id/answers','getAnswers','getSummary','post','create','/:id/clone','clone','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xc0f486,_0x2ba54a){var _0x4e5c1f=function(_0x1235c0){while(--_0x1235c0){_0xc0f486['push'](_0xc0f486['shift']());}};_0x4e5c1f(++_0x2ba54a);}(_0x7247,0x85));var _0x7724=function(_0xb0bfd6,_0xc3164f){_0xb0bfd6=_0xb0bfd6-0x0;var _0x59e733=_0x7247[_0xb0bfd6];return _0x59e733;};'use strict';var multer=require(_0x7724('0x0'));var util=require(_0x7724('0x1'));var path=require(_0x7724('0x2'));var timeout=require(_0x7724('0x3'));var express=require(_0x7724('0x4'));var router=express[_0x7724('0x5')]();var fs_extra=require(_0x7724('0x6'));var auth=require(_0x7724('0x7'));var interaction=require(_0x7724('0x8'));var config=require(_0x7724('0x9'));var controller=require('./jscriptyProject.controller');router[_0x7724('0xa')]('/',auth[_0x7724('0xb')](),controller['index']);router[_0x7724('0xa')](_0x7724('0xc'),auth[_0x7724('0xb')](),controller[_0x7724('0xd')]);router[_0x7724('0xa')](_0x7724('0xe'),auth['isAuthenticated'](),controller['getSessions']);router[_0x7724('0xa')](_0x7724('0xf'),auth[_0x7724('0xb')](),controller[_0x7724('0x10')]);router[_0x7724('0xa')]('/:id/summary',auth['isAuthenticated'](),timeout('30s'),controller[_0x7724('0x11')]);router[_0x7724('0x12')]('/',auth['isAuthenticated'](),controller[_0x7724('0x13')]);router[_0x7724('0x12')](_0x7724('0x14'),auth[_0x7724('0xb')](),controller[_0x7724('0x15')]);router['put'](_0x7724('0xc'),auth[_0x7724('0xb')](),controller[_0x7724('0x16')]);router['delete'](_0x7724('0xc'),auth[_0x7724('0xb')](),controller['destroy']);module[_0x7724('0x17')]=router;
\ No newline at end of file
index 8cd3847..8898966 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9df=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','sequelize','lodash','util','exports','name','long','formData','stringify','isString','setDataValue'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xd9df,0x10e));var _0xfd9d=function(_0x5cd1ed,_0x2dcb18){_0x5cd1ed=_0x5cd1ed-0x0;var _0xbb6e0=_0xd9df[_0x5cd1ed];return _0xbb6e0;};'use strict';var Sequelize=require(_0xfd9d('0x0'));var _=require(_0xfd9d('0x1'));var util=require(_0xfd9d('0x2'));module[_0xfd9d('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xfd9d('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xfd9d('0x5')),'set':function(_0x2570fa){if(_['isObjectLike'](_0x2570fa)){this['setDataValue'](_0xfd9d('0x6'),JSON[_0xfd9d('0x7')](_0x2570fa));}else if(_[_0xfd9d('0x8')](_0x2570fa)){this['setDataValue'](_0xfd9d('0x6'),_0x2570fa);}else{this[_0xfd9d('0x9')](_0xfd9d('0x6'),util[_0xfd9d('0xa')](_0xfd9d('0xb'),this['getDataValue']('name')||'',this[_0xfd9d('0xc')](_0xfd9d('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1d59=['STRING','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','BOOLEAN','sequelize','lodash','util','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d59,0x7c));var _0x91d5=function(_0x4f1eca,_0x49faa6){_0x4f1eca=_0x4f1eca-0x0;var _0x230610=_0x1d59[_0x4f1eca];return _0x230610;};'use strict';var Sequelize=require(_0x91d5('0x0'));var _=require(_0x91d5('0x1'));var util=require(_0x91d5('0x2'));module[_0x91d5('0x3')]={'name':{'type':Sequelize[_0x91d5('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x91d5('0x4')]},'formData':{'type':Sequelize[_0x91d5('0x5')](_0x91d5('0x6')),'set':function(_0x17789a){if(_[_0x91d5('0x7')](_0x17789a)){this['setDataValue'](_0x91d5('0x8'),JSON[_0x91d5('0x9')](_0x17789a));}else if(_[_0x91d5('0xa')](_0x17789a)){this[_0x91d5('0xb')](_0x91d5('0x8'),_0x17789a);}else{this['setDataValue'](_0x91d5('0x8'),util['format'](_0x91d5('0xc'),this['getDataValue'](_0x91d5('0xd'))||'',this[_0x91d5('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x91d5('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 536d2a5..3c8c74e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e05=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','findOne','JscriptySessionReport','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','order','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','question','format','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x2a0f56,_0x531deb){var _0x5e1c8d=function(_0x400fae){while(--_0x400fae){_0x2a0f56['push'](_0x2a0f56['shift']());}};_0x5e1c8d(++_0x531deb);}(_0x7e05,0x69));var _0x57e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e05[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x57e0('0x0'));var rimraf=require(_0x57e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57e0('0x2'));var rp=require('request-promise');var moment=require(_0x57e0('0x3'));var BPromise=require(_0x57e0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x57e0('0x5'));var sox=require(_0x57e0('0x6'));var csv=require(_0x57e0('0x7'));var ejs=require(_0x57e0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57e0('0x9'));var squel=require('squel');var crypto=require(_0x57e0('0xa'));var jsforce=require(_0x57e0('0xb'));var deskjs=require(_0x57e0('0xc'));var toCsv=require(_0x57e0('0x7'));var querystring=require(_0x57e0('0xd'));var Papa=require(_0x57e0('0xe'));var Redis=require(_0x57e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x57e0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57e0('0x11'));var logger=require('../../config/logger')(_0x57e0('0x12'));var utils=require(_0x57e0('0x13'));var config=require(_0x57e0('0x14'));var licenseUtil=require(_0x57e0('0x15'));var db=require(_0x57e0('0x16'))['db'];function respondWithStatusCode(_0x254141,_0x142d1f){_0x142d1f=_0x142d1f||0xcc;return function(_0x114d14){if(_0x114d14){return _0x254141[_0x57e0('0x17')](_0x142d1f);}return _0x254141['status'](_0x142d1f)[_0x57e0('0x18')]();};}function respondWithResult(_0x1ed2c1,_0x4a4562){_0x4a4562=_0x4a4562||0xc8;return function(_0x32babd){if(_0x32babd){return _0x1ed2c1['status'](_0x4a4562)[_0x57e0('0x19')](_0x32babd);}};}function respondWithFilteredResult(_0x3797e2,_0x746a9d){return function(_0x2e0beb){if(_0x2e0beb){var _0x304ec4=typeof _0x746a9d['offset']===_0x57e0('0x1a')&&typeof _0x746a9d[_0x57e0('0x1b')]===_0x57e0('0x1a');var _0x22c344=_0x2e0beb[_0x57e0('0x1c')];var _0x52cf5a=_0x304ec4?0x0:_0x746a9d[_0x57e0('0x1d')];var _0x2500ea=_0x304ec4?_0x2e0beb[_0x57e0('0x1c')]:_0x746a9d[_0x57e0('0x1d')]+_0x746a9d[_0x57e0('0x1b')];var _0x1f5dce;if(_0x2500ea>=_0x22c344){_0x2500ea=_0x22c344;_0x1f5dce=0xc8;}else{_0x1f5dce=0xce;}_0x3797e2[_0x57e0('0x1e')](_0x1f5dce);return _0x3797e2['set'](_0x57e0('0x1f'),_0x52cf5a+'-'+_0x2500ea+'/'+_0x22c344)[_0x57e0('0x19')](_0x2e0beb);}return null;};}function patchUpdates(_0x2007ff){return function(_0x3814a3){try{jsonpatch['apply'](_0x3814a3,_0x2007ff,!![]);}catch(_0x143e51){return BPromise[_0x57e0('0x20')](_0x143e51);}return _0x3814a3[_0x57e0('0x21')]();};}function saveUpdates(_0x3bc1c0,_0x5d83c6){return function(_0xc5b15){if(_0xc5b15){return _0xc5b15[_0x57e0('0x22')](_0x3bc1c0)[_0x57e0('0x23')](function(_0x4dbdc7){return _0x4dbdc7;});}return null;};}function removeEntity(_0x595696,_0x44e84c){return function(_0x3a6a14){if(_0x3a6a14){return _0x3a6a14[_0x57e0('0x24')]()[_0x57e0('0x23')](function(){var _0xe9c8b=_0x3a6a14[_0x57e0('0x25')]({'plain':!![]});var _0x46fff4=_0x57e0('0x26');return db[_0x57e0('0x27')]['destroy']({'where':{'type':_0x46fff4,'resourceId':_0xe9c8b['id']}})[_0x57e0('0x23')](function(){return _0x3a6a14;});})['then'](function(){_0x595696[_0x57e0('0x1e')](0xcc)[_0x57e0('0x18')]();});}};}function handleEntityNotFound(_0x55c77f,_0x21c4fb){return function(_0xb97120){if(!_0xb97120){_0x55c77f['sendStatus'](0x194);}return _0xb97120;};}function handleError(_0x17302b,_0x5b9f4e){_0x5b9f4e=_0x5b9f4e||0x1f4;return function(_0x5d06bc){logger[_0x57e0('0x28')](_0x5d06bc[_0x57e0('0x29')]);if(_0x5d06bc[_0x57e0('0x2a')]){delete _0x5d06bc[_0x57e0('0x2a')];}_0x17302b['status'](_0x5b9f4e)[_0x57e0('0x2b')](_0x5d06bc);};}exports[_0x57e0('0x2c')]=function(_0x490aa5,_0x4cb537){var _0x50c156={},_0x7e3b17={},_0xcc8439={'count':0x0,'rows':[]};var _0x5b0e29=_[_0x57e0('0x2d')](db[_0x57e0('0x2e')][_0x57e0('0x2f')],function(_0x382509){return{'name':_0x382509['fieldName'],'type':_0x382509[_0x57e0('0x30')][_0x57e0('0x31')]};});_0x7e3b17['model']=_['map'](_0x5b0e29,'name');_0x7e3b17['query']=_['keys'](_0x490aa5[_0x57e0('0x32')]);_0x7e3b17[_0x57e0('0x33')]=_[_0x57e0('0x34')](_0x7e3b17[_0x57e0('0x35')],_0x7e3b17[_0x57e0('0x32')]);_0x50c156['attributes']=_['intersection'](_0x7e3b17[_0x57e0('0x35')],qs[_0x57e0('0x36')](_0x490aa5[_0x57e0('0x32')][_0x57e0('0x36')]));_0x50c156[_0x57e0('0x37')]=_0x50c156[_0x57e0('0x37')][_0x57e0('0x38')]?_0x50c156[_0x57e0('0x37')]:_0x7e3b17[_0x57e0('0x35')];if(!_0x490aa5[_0x57e0('0x32')][_0x57e0('0x39')]('nolimit')){_0x50c156[_0x57e0('0x1b')]=qs[_0x57e0('0x1b')](_0x490aa5['query']['limit']);_0x50c156[_0x57e0('0x1d')]=qs['offset'](_0x490aa5[_0x57e0('0x32')][_0x57e0('0x1d')]);}_0x50c156['order']=qs['sort'](_0x490aa5[_0x57e0('0x32')][_0x57e0('0x3a')]);_0x50c156[_0x57e0('0x3b')]=qs[_0x57e0('0x33')](_[_0x57e0('0x3c')](_0x490aa5[_0x57e0('0x32')],_0x7e3b17['filters']),_0x5b0e29);if(_0x490aa5[_0x57e0('0x32')][_0x57e0('0x3d')]){_0x50c156[_0x57e0('0x3b')]=_['merge'](_0x50c156[_0x57e0('0x3b')],{'$or':_[_0x57e0('0x2d')](_0x5b0e29,function(_0x140d8e){if(_0x140d8e[_0x57e0('0x30')]!=='VIRTUAL'){var _0x257d9f={};_0x257d9f[_0x140d8e[_0x57e0('0x2a')]]={'$like':'%'+_0x490aa5[_0x57e0('0x32')][_0x57e0('0x3d')]+'%'};return _0x257d9f;}})});}_0x50c156=_[_0x57e0('0x3e')]({},_0x50c156,_0x490aa5[_0x57e0('0x3f')]);var _0x2af8d1={'where':_0x50c156[_0x57e0('0x3b')]};return db[_0x57e0('0x2e')][_0x57e0('0x1c')](_0x2af8d1)[_0x57e0('0x23')](function(_0x243ecf){_0xcc8439[_0x57e0('0x1c')]=_0x243ecf;if(_0x490aa5['query'][_0x57e0('0x40')]){_0x50c156['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x57e0('0x41')](_0x50c156);})[_0x57e0('0x23')](function(_0x424a06){_0xcc8439[_0x57e0('0x42')]=_0x424a06;return _0xcc8439;})[_0x57e0('0x23')](respondWithFilteredResult(_0x4cb537,_0x50c156))[_0x57e0('0x43')](handleError(_0x4cb537,null));};exports['show']=function(_0xd5ffbf,_0x28a3db){var _0x206d49={'raw':![],'where':{'id':_0xd5ffbf[_0x57e0('0x44')]['id']}},_0xdf4981={};_0xdf4981[_0x57e0('0x35')]=_['keys'](db['JscriptyProject'][_0x57e0('0x2f')]);_0xdf4981[_0x57e0('0x32')]=_[_0x57e0('0x45')](_0xd5ffbf[_0x57e0('0x32')]);_0xdf4981[_0x57e0('0x33')]=_[_0x57e0('0x34')](_0xdf4981[_0x57e0('0x35')],_0xdf4981[_0x57e0('0x32')]);_0x206d49['attributes']=_['intersection'](_0xdf4981[_0x57e0('0x35')],qs['fields'](_0xd5ffbf[_0x57e0('0x32')]['fields']));_0x206d49[_0x57e0('0x37')]=_0x206d49['attributes'][_0x57e0('0x38')]?_0x206d49[_0x57e0('0x37')]:_0xdf4981[_0x57e0('0x35')];if(_0xd5ffbf['query'][_0x57e0('0x40')]){_0x206d49[_0x57e0('0x46')]=[{'all':!![]}];}_0x206d49=_[_0x57e0('0x3e')]({},_0x206d49,_0xd5ffbf[_0x57e0('0x3f')]);return db[_0x57e0('0x2e')][_0x57e0('0x47')](_0x206d49)[_0x57e0('0x23')](handleEntityNotFound(_0x28a3db,null))[_0x57e0('0x23')](respondWithResult(_0x28a3db,null))[_0x57e0('0x43')](handleError(_0x28a3db,null));};exports['create']=function(_0x646ee4,_0x33dbdd){return db[_0x57e0('0x2e')][_0x57e0('0x48')](_0x646ee4[_0x57e0('0x49')],{})[_0x57e0('0x23')](function(_0x11e182){var _0x3a5761=_0x646ee4[_0x57e0('0x4a')][_0x57e0('0x25')]({'plain':!![]});if(!_0x3a5761)throw new Error(_0x57e0('0x4b'));if(_0x3a5761[_0x57e0('0x4c')]===_0x57e0('0x4a')){var _0x5178aa=_0x11e182[_0x57e0('0x25')]({'plain':!![]});var _0x5c0ce0=_0x57e0('0x26');return db[_0x57e0('0x4d')][_0x57e0('0x47')]({'where':{'name':_0x5c0ce0,'userProfileId':_0x3a5761[_0x57e0('0x4e')]},'raw':!![]})['then'](function(_0x4b6e3d){if(_0x4b6e3d&&_0x4b6e3d[_0x57e0('0x4f')]===0x0){return db['UserProfileResource'][_0x57e0('0x48')]({'name':_0x5178aa[_0x57e0('0x2a')],'resourceId':_0x5178aa['id'],'type':_0x4b6e3d[_0x57e0('0x2a')],'sectionId':_0x4b6e3d['id']},{})['then'](function(){return _0x11e182;});}else{return _0x11e182;}})[_0x57e0('0x43')](function(_0x7a9807){logger[_0x57e0('0x28')](_0x57e0('0x50'),_0x7a9807);throw _0x7a9807;});}return _0x11e182;})[_0x57e0('0x23')](respondWithResult(_0x33dbdd,0xc9))[_0x57e0('0x43')](handleError(_0x33dbdd,null));};exports[_0x57e0('0x51')]=function(_0x1ee94a,_0x1de87d){var _0xa93399={'where':{'id':_0x1ee94a[_0x57e0('0x44')]['id']}},_0x59a547={};_0x59a547['model']=_[_0x57e0('0x45')](db[_0x57e0('0x2e')][_0x57e0('0x2f')]);_0xa93399[_0x57e0('0x37')]=_[_0x57e0('0x34')](_0x59a547[_0x57e0('0x35')],qs[_0x57e0('0x36')](_0x1ee94a[_0x57e0('0x32')][_0x57e0('0x36')]));_0xa93399[_0x57e0('0x37')]=_0xa93399['attributes']['length']?_0xa93399['attributes']:_0x59a547['model'];if(_0x1ee94a[_0x57e0('0x32')][_0x57e0('0x40')]){_0xa93399[_0x57e0('0x46')]=[{'all':!![]}];}_0xa93399=_[_0x57e0('0x3e')]({},_0xa93399,_0x1ee94a['options']);return db['JscriptyProject'][_0x57e0('0x47')](_0xa93399)['then'](handleEntityNotFound(_0x1de87d,null))[_0x57e0('0x23')](function(_0x3751fc){if(_0x3751fc){var _0x365b56=_0x3751fc[_0x57e0('0x25')]({'plain':!![]});_0x365b56=qs['omit'](_0x365b56,['id',_0x57e0('0x52'),_0x57e0('0x53')]);_0x1ee94a[_0x57e0('0x49')]=_[_0x57e0('0x54')](_0x1ee94a[_0x57e0('0x49')],['id',_0x57e0('0x52'),_0x57e0('0x53')]);return db['JscriptyProject'][_0x57e0('0x48')](_[_0x57e0('0x3e')](_0x365b56,_0x1ee94a[_0x57e0('0x49')]),{'include':_0x1ee94a[_0x57e0('0x32')][_0x57e0('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x5879d8){var _0x354048=_0x1ee94a[_0x57e0('0x4a')][_0x57e0('0x25')]({'plain':!![]});if(!_0x354048)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x354048[_0x57e0('0x4c')]===_0x57e0('0x4a')){var _0x160aae=_0x5879d8['get']({'plain':!![]});var _0xb9bc25=_0x57e0('0x26');return db[_0x57e0('0x4d')]['find']({'where':{'name':_0xb9bc25,'userProfileId':_0x354048[_0x57e0('0x4e')]},'raw':!![]})[_0x57e0('0x23')](function(_0x5f5a1d){if(_0x5f5a1d&&_0x5f5a1d[_0x57e0('0x4f')]===0x0){return db[_0x57e0('0x27')][_0x57e0('0x48')]({'name':_0x160aae[_0x57e0('0x2a')],'resourceId':_0x160aae['id'],'type':_0x5f5a1d['name'],'sectionId':_0x5f5a1d['id']},{})['then'](function(){return _0x5879d8;});}else{return _0x5879d8;}})[_0x57e0('0x43')](function(_0x15fac3){logger[_0x57e0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15fac3);throw _0x15fac3;});}return _0x5879d8;});}})[_0x57e0('0x23')](respondWithResult(_0x1de87d,0xc9))[_0x57e0('0x43')](handleError(_0x1de87d,null));};exports[_0x57e0('0x22')]=function(_0x3c76ad,_0x8f26fc){if(_0x3c76ad['body']['id']){delete _0x3c76ad[_0x57e0('0x49')]['id'];}return db[_0x57e0('0x2e')][_0x57e0('0x47')]({'where':{'id':_0x3c76ad['params']['id']}})['then'](handleEntityNotFound(_0x8f26fc,null))[_0x57e0('0x23')](saveUpdates(_0x3c76ad[_0x57e0('0x49')],null))[_0x57e0('0x23')](respondWithResult(_0x8f26fc,null))[_0x57e0('0x43')](handleError(_0x8f26fc,null));};exports['destroy']=function(_0x5b3aa5,_0x216c0b){return db[_0x57e0('0x2e')][_0x57e0('0x47')]({'where':{'id':_0x5b3aa5['params']['id']}})[_0x57e0('0x23')](handleEntityNotFound(_0x216c0b,null))[_0x57e0('0x23')](removeEntity(_0x216c0b,null))['catch'](handleError(_0x216c0b,null));};exports['getSessions']=function(_0x237d7f,_0x297595,_0x20d8a1){var _0x44a6e4={'raw':!![],'where':{}};var _0xaa1584={};var _0x49f2fb={'count':0x0,'rows':[]};return db[_0x57e0('0x2e')][_0x57e0('0x55')]({'where':{'id':_0x237d7f[_0x57e0('0x44')]['id']}})[_0x57e0('0x23')](handleEntityNotFound(_0x297595,null))[_0x57e0('0x23')](function(_0x579633){if(_0x579633){_0xaa1584['model']=_['keys'](db[_0x57e0('0x56')][_0x57e0('0x2f')]);_0xaa1584[_0x57e0('0x32')]=_[_0x57e0('0x45')](_0x237d7f[_0x57e0('0x32')]);_0xaa1584['filters']=_[_0x57e0('0x34')](_0xaa1584[_0x57e0('0x35')],_0xaa1584[_0x57e0('0x32')]);_0x44a6e4[_0x57e0('0x37')]=_[_0x57e0('0x34')](_0xaa1584[_0x57e0('0x35')],qs[_0x57e0('0x36')](_0x237d7f[_0x57e0('0x32')][_0x57e0('0x36')]));_0x44a6e4[_0x57e0('0x37')]=_0x44a6e4['attributes'][_0x57e0('0x38')]?_0x44a6e4[_0x57e0('0x37')]:_0xaa1584[_0x57e0('0x35')];if(!_0x237d7f[_0x57e0('0x32')][_0x57e0('0x39')](_0x57e0('0x57'))){_0x44a6e4[_0x57e0('0x1b')]=qs[_0x57e0('0x1b')](_0x237d7f[_0x57e0('0x32')]['limit']);_0x44a6e4[_0x57e0('0x1d')]=qs[_0x57e0('0x1d')](_0x237d7f[_0x57e0('0x32')][_0x57e0('0x1d')]);}_0x44a6e4['order']=qs[_0x57e0('0x3a')](_0x237d7f[_0x57e0('0x32')][_0x57e0('0x3a')]);_0x44a6e4[_0x57e0('0x3b')]=qs[_0x57e0('0x33')](_[_0x57e0('0x3c')](_0x237d7f[_0x57e0('0x32')],_0xaa1584[_0x57e0('0x33')]));_0x44a6e4[_0x57e0('0x3b')][_0x57e0('0x58')]=_0x579633['id'];if(_0x237d7f[_0x57e0('0x32')]['filter']){_0x44a6e4[_0x57e0('0x3b')]=_[_0x57e0('0x3e')](_0x44a6e4[_0x57e0('0x3b')],{'$or':_[_0x57e0('0x2d')](_0x44a6e4[_0x57e0('0x37')],function(_0x2509df){var _0x51e731={};_0x51e731[_0x2509df]={'$like':'%'+_0x237d7f[_0x57e0('0x32')][_0x57e0('0x3d')]+'%'};return _0x51e731;})});}_0x44a6e4=_[_0x57e0('0x3e')]({},_0x44a6e4,_0x237d7f[_0x57e0('0x3f')]);return db[_0x57e0('0x56')][_0x57e0('0x1c')]({'where':_0x44a6e4[_0x57e0('0x3b')]})['then'](function(_0x2b1833){_0x49f2fb[_0x57e0('0x1c')]=_0x2b1833;if(_0x237d7f[_0x57e0('0x32')][_0x57e0('0x40')]){_0x44a6e4[_0x57e0('0x46')]=[{'all':!![]}];}return db[_0x57e0('0x56')][_0x57e0('0x41')](_0x44a6e4);})[_0x57e0('0x23')](function(_0x52b72f){_0x49f2fb[_0x57e0('0x42')]=_0x52b72f;return _0x49f2fb;});}})[_0x57e0('0x23')](respondWithFilteredResult(_0x297595,_0x44a6e4))[_0x57e0('0x43')](handleError(_0x297595,null));};exports[_0x57e0('0x59')]=function(_0x1777f8,_0x22dc26,_0x3637a8){var _0x56bdbd={'raw':!![],'where':{}};var _0x50c0ea={};var _0x5f38aa={'count':0x0,'rows':[]};return db[_0x57e0('0x2e')][_0x57e0('0x55')]({'where':{'id':_0x1777f8[_0x57e0('0x44')]['id']}})[_0x57e0('0x23')](handleEntityNotFound(_0x22dc26,null))[_0x57e0('0x23')](function(_0x2639fd){if(_0x2639fd){_0x50c0ea['model']=_[_0x57e0('0x45')](db[_0x57e0('0x5a')][_0x57e0('0x2f')]);_0x50c0ea[_0x57e0('0x32')]=_[_0x57e0('0x45')](_0x1777f8[_0x57e0('0x32')]);_0x50c0ea[_0x57e0('0x33')]=_[_0x57e0('0x34')](_0x50c0ea['model'],_0x50c0ea[_0x57e0('0x32')]);_0x56bdbd[_0x57e0('0x37')]=_[_0x57e0('0x34')](_0x50c0ea['model'],qs[_0x57e0('0x36')](_0x1777f8[_0x57e0('0x32')]['fields']));_0x56bdbd['attributes']=_0x56bdbd[_0x57e0('0x37')]['length']?_0x56bdbd[_0x57e0('0x37')]:_0x50c0ea[_0x57e0('0x35')];if(!_0x1777f8[_0x57e0('0x32')]['hasOwnProperty'](_0x57e0('0x57'))){_0x56bdbd['limit']=qs[_0x57e0('0x1b')](_0x1777f8[_0x57e0('0x32')][_0x57e0('0x1b')]);_0x56bdbd[_0x57e0('0x1d')]=qs[_0x57e0('0x1d')](_0x1777f8[_0x57e0('0x32')][_0x57e0('0x1d')]);}_0x56bdbd[_0x57e0('0x5b')]=qs['sort'](_0x1777f8['query']['sort']);_0x56bdbd[_0x57e0('0x3b')]=qs[_0x57e0('0x33')](_[_0x57e0('0x3c')](_0x1777f8['query'],_0x50c0ea[_0x57e0('0x33')]));_0x56bdbd[_0x57e0('0x3b')]['ProjectId']=_0x2639fd['id'];if(_0x1777f8[_0x57e0('0x32')]['filter']){_0x56bdbd[_0x57e0('0x3b')]=_[_0x57e0('0x3e')](_0x56bdbd[_0x57e0('0x3b')],{'$or':_[_0x57e0('0x2d')](_0x56bdbd['attributes'],function(_0x470ecc){var _0x45209e={};_0x45209e[_0x470ecc]={'$like':'%'+_0x1777f8[_0x57e0('0x32')][_0x57e0('0x3d')]+'%'};return _0x45209e;})});}_0x56bdbd=_[_0x57e0('0x3e')]({},_0x56bdbd,_0x1777f8[_0x57e0('0x3f')]);return db['JscriptyAnswerReport'][_0x57e0('0x1c')]({'where':_0x56bdbd[_0x57e0('0x3b')]})[_0x57e0('0x23')](function(_0x2bf86f){_0x5f38aa[_0x57e0('0x1c')]=_0x2bf86f;if(_0x1777f8['query'][_0x57e0('0x40')]){_0x56bdbd[_0x57e0('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x56bdbd);})[_0x57e0('0x23')](function(_0x2718aa){_0x5f38aa['rows']=_0x2718aa;return _0x5f38aa;});}})[_0x57e0('0x23')](respondWithFilteredResult(_0x22dc26,_0x56bdbd))['catch'](handleError(_0x22dc26,null));};function char(_0x3ad06a){return _0x57e0('0x5c')===typeof _0x3ad06a?String[_0x57e0('0x5d')][_0x57e0('0x5e')](null,arguments):_0x3ad06a;}function needsEncapsulation(_0x2f72ec){return!!_0x2f72ec&&(_0x2f72ec[_0x57e0('0x5f')]()[_0x57e0('0x60')](char(0xd))>=0x0||_0x2f72ec['toString']()[_0x57e0('0x60')](char(0xa))>=0x0||_0x2f72ec['toString']()['indexOf'](char(0x2c))>=0x0||_0x2f72ec['toString']()[_0x57e0('0x60')](char(0x22))>=0x0);}function encapsulate(_0x407784){var _0xa3ab90=char(0x22),_0x173ad1='\x5c'+char(0x22),_0xc3620b=_0x407784['toString']()[_0x57e0('0x61')](new RegExp(_0xa3ab90,'g'),_0x173ad1);return _0xa3ab90+_0xc3620b+_0xa3ab90;}exports[_0x57e0('0x62')]=function(_0x5ef5c0,_0xe01b57,_0x31908d){var _0x3fabfa,_0x3fc9b1;var _0x3baa1a={'where':{'ProjectId':_0x5ef5c0['params']['id']}};if(_0x5ef5c0[_0x57e0('0x32')][_0x57e0('0x63')]){_0x3baa1a[_0x57e0('0x3b')][_0x57e0('0x64')]=JSON[_0x57e0('0x65')](_0x5ef5c0['query']['startTime']);}return db[_0x57e0('0x56')]['findAll'](_0x3baa1a)[_0x57e0('0x23')](handleEntityNotFound(_0xe01b57,null))[_0x57e0('0x23')](function(_0x4b2683){if(_0x4b2683){_0x3fabfa=_0x4b2683;return db[_0x57e0('0x66')][_0x57e0('0x41')]({'where':{'SessionId':{'$in':_[_0x57e0('0x2d')](_0x3fabfa,'id')},'ProjectId':_0x5ef5c0[_0x57e0('0x44')]['id']},'order':'-createdAt'});}})[_0x57e0('0x23')](handleEntityNotFound(_0xe01b57,null))[_0x57e0('0x23')](function(_0xc3b3cf){if(_0xc3b3cf){_0x3fc9b1=_0xc3b3cf;var _0x258939={};for(var _0x881870=0x0,_0x4394f5=_0x3fc9b1[_0x57e0('0x38')];_0x881870<_0x4394f5;_0x881870++){if(!_0x258939[_0x57e0('0x39')](_0x3fc9b1[_0x881870]['questionId'])){_0x258939[_0x3fc9b1[_0x881870]['questionId']]=needsEncapsulation(_0x3fc9b1[_0x881870][_0x57e0('0x67')])?encapsulate(_0x3fc9b1[_0x881870]['question']):_0x3fc9b1[_0x881870][_0x57e0('0x67')];}}var _0x2f9b18=[],_0x4bd759={};for(var _0x10865d=0x0,_0x31f581=_0x3fabfa['length'];_0x10865d<_0x31f581;_0x10865d++){_0x4bd759={'ProjectId':_0x5ef5c0['params']['id'],'SessionId':_0x3fabfa[_0x10865d]['id'],'StartTime':moment(_0x3fabfa[_0x10865d][_0x57e0('0x64')])[_0x57e0('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x58ca0c=0x0,_0x27989c=_0x3fc9b1[_0x57e0('0x38')];_0x58ca0c<_0x27989c;_0x58ca0c++){if(_0x3fc9b1[_0x58ca0c][_0x57e0('0x69')]==_0x3fabfa[_0x10865d]['id']&&_0x258939[_0x57e0('0x39')](_0x3fc9b1[_0x58ca0c][_0x57e0('0x6a')])){_0x4bd759[_0x258939[_0x3fc9b1[_0x58ca0c][_0x57e0('0x6a')]]]=_0x3fc9b1[_0x58ca0c][_0x57e0('0x6b')];}}for(var _0x1eabfc in _0x258939){if(!_0x4bd759['hasOwnProperty'](_0x258939[_0x1eabfc])){_0x4bd759[_0x258939[_0x1eabfc]]=null;}}_0x2f9b18[_0x57e0('0x6c')](_0x4bd759);}return _0x2f9b18;}})['then'](function(_0x552f24){if(!_[_0x57e0('0x6d')](_0x552f24)){var _0x347e66=toCsv(_0x552f24);var _0x262ad4=Date[_0x57e0('0x6e')]();fs[_0x57e0('0x6f')](util[_0x57e0('0x68')](_0x57e0('0x70'),_0x5ef5c0[_0x57e0('0x44')]['id'],_0x262ad4),_0x347e66);_0xe01b57[_0x57e0('0x71')](_0x57e0('0x72'),'attachment;\x20filename='+util[_0x57e0('0x68')](_0x57e0('0x73'),_0x5ef5c0['params']['id'],_0x262ad4));_0xe01b57[_0x57e0('0x71')](_0x57e0('0x74'),_0x57e0('0x75'));return _0xe01b57[_0x57e0('0x76')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5ef5c0[_0x57e0('0x44')]['id'],_0x262ad4));}else{return _0xe01b57[_0x57e0('0x17')](0xcc);}})['catch'](handleError(_0xe01b57,null));};
\ No newline at end of file
+var _0x52ed=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','user','UserProfileSection','userProfileId','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','setHeader','Content-disposition','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x4bb809,_0x2acf6d){var _0x53dba5=function(_0x2b9cca){while(--_0x2b9cca){_0x4bb809['push'](_0x4bb809['shift']());}};_0x53dba5(++_0x2acf6d);}(_0x52ed,0x132));var _0xd52e=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0x52ed[_0x2fb356];return _0x27fb4b;};'use strict';var emlformat=require(_0xd52e('0x0'));var rimraf=require(_0xd52e('0x1'));var zipdir=require(_0xd52e('0x2'));var jsonpatch=require(_0xd52e('0x3'));var rp=require(_0xd52e('0x4'));var moment=require('moment');var BPromise=require(_0xd52e('0x5'));var Mustache=require(_0xd52e('0x6'));var util=require(_0xd52e('0x7'));var path=require(_0xd52e('0x8'));var sox=require(_0xd52e('0x9'));var csv=require('to-csv');var ejs=require(_0xd52e('0xa'));var fs=require('fs');var fs_extra=require(_0xd52e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd52e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd52e('0xd'));var querystring=require(_0xd52e('0xe'));var Papa=require(_0xd52e('0xf'));var Redis=require(_0xd52e('0x10'));var authService=require(_0xd52e('0x11'));var qs=require(_0xd52e('0x12'));var as=require(_0xd52e('0x13'));var hardwareService=require(_0xd52e('0x14'));var logger=require(_0xd52e('0x15'))(_0xd52e('0x16'));var utils=require(_0xd52e('0x17'));var config=require(_0xd52e('0x18'));var licenseUtil=require(_0xd52e('0x19'));var db=require(_0xd52e('0x1a'))['db'];function respondWithStatusCode(_0x43a5ba,_0x5a2cd9){_0x5a2cd9=_0x5a2cd9||0xcc;return function(_0x57a3c4){if(_0x57a3c4){return _0x43a5ba[_0xd52e('0x1b')](_0x5a2cd9);}return _0x43a5ba[_0xd52e('0x1c')](_0x5a2cd9)[_0xd52e('0x1d')]();};}function respondWithResult(_0xddca04,_0x2f0812){_0x2f0812=_0x2f0812||0xc8;return function(_0x58b39f){if(_0x58b39f){return _0xddca04['status'](_0x2f0812)[_0xd52e('0x1e')](_0x58b39f);}};}function respondWithFilteredResult(_0x466516,_0x1b6d05){return function(_0xd01ea0){if(_0xd01ea0){var _0x33230a=typeof _0x1b6d05['offset']===_0xd52e('0x1f')&&typeof _0x1b6d05[_0xd52e('0x20')]===_0xd52e('0x1f');var _0x22e1b7=_0xd01ea0[_0xd52e('0x21')];var _0xdab253=_0x33230a?0x0:_0x1b6d05[_0xd52e('0x22')];var _0x592dac=_0x33230a?_0xd01ea0['count']:_0x1b6d05['offset']+_0x1b6d05[_0xd52e('0x20')];var _0x25298f;if(_0x592dac>=_0x22e1b7){_0x592dac=_0x22e1b7;_0x25298f=0xc8;}else{_0x25298f=0xce;}_0x466516['status'](_0x25298f);return _0x466516[_0xd52e('0x23')](_0xd52e('0x24'),_0xdab253+'-'+_0x592dac+'/'+_0x22e1b7)[_0xd52e('0x1e')](_0xd01ea0);}return null;};}function patchUpdates(_0x2b3ac5){return function(_0xb7470f){try{jsonpatch[_0xd52e('0x25')](_0xb7470f,_0x2b3ac5,!![]);}catch(_0x1ea394){return BPromise[_0xd52e('0x26')](_0x1ea394);}return _0xb7470f[_0xd52e('0x27')]();};}function saveUpdates(_0x435508,_0xf33269){return function(_0x3eefce){if(_0x3eefce){return _0x3eefce[_0xd52e('0x28')](_0x435508)[_0xd52e('0x29')](function(_0x3a4baa){return _0x3a4baa;});}return null;};}function removeEntity(_0x245317,_0x180602){return function(_0x182974){if(_0x182974){return _0x182974[_0xd52e('0x2a')]()['then'](function(){var _0x3c3599=_0x182974[_0xd52e('0x2b')]({'plain':!![]});var _0x3a4142=_0xd52e('0x2c');return db['UserProfileResource'][_0xd52e('0x2a')]({'where':{'type':_0x3a4142,'resourceId':_0x3c3599['id']}})[_0xd52e('0x29')](function(){return _0x182974;});})['then'](function(){_0x245317['status'](0xcc)[_0xd52e('0x1d')]();});}};}function handleEntityNotFound(_0xe2c249,_0x17caaf){return function(_0x586232){if(!_0x586232){_0xe2c249[_0xd52e('0x1b')](0x194);}return _0x586232;};}function handleError(_0x4b27bc,_0x349642){_0x349642=_0x349642||0x1f4;return function(_0xda4aac){logger['error'](_0xda4aac[_0xd52e('0x2d')]);if(_0xda4aac[_0xd52e('0x2e')]){delete _0xda4aac['name'];}_0x4b27bc['status'](_0x349642)[_0xd52e('0x2f')](_0xda4aac);};}exports[_0xd52e('0x30')]=function(_0x5e47c0,_0x588f25){var _0x750f2c={},_0x401429={},_0x421333={'count':0x0,'rows':[]};var _0xc089c4=_[_0xd52e('0x31')](db[_0xd52e('0x32')][_0xd52e('0x33')],function(_0x2bfba5){return{'name':_0x2bfba5[_0xd52e('0x34')],'type':_0x2bfba5[_0xd52e('0x35')][_0xd52e('0x36')]};});_0x401429[_0xd52e('0x37')]=_[_0xd52e('0x31')](_0xc089c4,'name');_0x401429[_0xd52e('0x38')]=_[_0xd52e('0x39')](_0x5e47c0['query']);_0x401429[_0xd52e('0x3a')]=_[_0xd52e('0x3b')](_0x401429[_0xd52e('0x37')],_0x401429[_0xd52e('0x38')]);_0x750f2c[_0xd52e('0x3c')]=_[_0xd52e('0x3b')](_0x401429[_0xd52e('0x37')],qs[_0xd52e('0x3d')](_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x3d')]));_0x750f2c[_0xd52e('0x3c')]=_0x750f2c[_0xd52e('0x3c')][_0xd52e('0x3e')]?_0x750f2c['attributes']:_0x401429['model'];if(!_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x3f')](_0xd52e('0x40'))){_0x750f2c[_0xd52e('0x20')]=qs[_0xd52e('0x20')](_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x20')]);_0x750f2c[_0xd52e('0x22')]=qs[_0xd52e('0x22')](_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x22')]);}_0x750f2c[_0xd52e('0x41')]=qs[_0xd52e('0x42')](_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x42')]);_0x750f2c[_0xd52e('0x43')]=qs[_0xd52e('0x3a')](_['pick'](_0x5e47c0[_0xd52e('0x38')],_0x401429[_0xd52e('0x3a')]),_0xc089c4);if(_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x44')]){_0x750f2c[_0xd52e('0x43')]=_[_0xd52e('0x45')](_0x750f2c[_0xd52e('0x43')],{'$or':_[_0xd52e('0x31')](_0xc089c4,function(_0x133408){if(_0x133408[_0xd52e('0x35')]!==_0xd52e('0x46')){var _0x5bafc1={};_0x5bafc1[_0x133408[_0xd52e('0x2e')]]={'$like':'%'+_0x5e47c0['query']['filter']+'%'};return _0x5bafc1;}})});}_0x750f2c=_[_0xd52e('0x45')]({},_0x750f2c,_0x5e47c0[_0xd52e('0x47')]);var _0x229b0d={'where':_0x750f2c[_0xd52e('0x43')]};return db[_0xd52e('0x32')][_0xd52e('0x21')](_0x229b0d)['then'](function(_0x5e3e06){_0x421333[_0xd52e('0x21')]=_0x5e3e06;if(_0x5e47c0[_0xd52e('0x38')][_0xd52e('0x48')]){_0x750f2c[_0xd52e('0x49')]=[{'all':!![]}];}return db[_0xd52e('0x32')][_0xd52e('0x4a')](_0x750f2c);})[_0xd52e('0x29')](function(_0x2737d8){_0x421333[_0xd52e('0x4b')]=_0x2737d8;return _0x421333;})[_0xd52e('0x29')](respondWithFilteredResult(_0x588f25,_0x750f2c))[_0xd52e('0x4c')](handleError(_0x588f25,null));};exports[_0xd52e('0x4d')]=function(_0x178660,_0x4e6e66){var _0x59a5eb={'raw':![],'where':{'id':_0x178660['params']['id']}},_0x41c2b1={};_0x41c2b1[_0xd52e('0x37')]=_['keys'](db[_0xd52e('0x32')][_0xd52e('0x33')]);_0x41c2b1[_0xd52e('0x38')]=_[_0xd52e('0x39')](_0x178660['query']);_0x41c2b1['filters']=_[_0xd52e('0x3b')](_0x41c2b1[_0xd52e('0x37')],_0x41c2b1['query']);_0x59a5eb[_0xd52e('0x3c')]=_[_0xd52e('0x3b')](_0x41c2b1[_0xd52e('0x37')],qs[_0xd52e('0x3d')](_0x178660['query'][_0xd52e('0x3d')]));_0x59a5eb[_0xd52e('0x3c')]=_0x59a5eb[_0xd52e('0x3c')][_0xd52e('0x3e')]?_0x59a5eb['attributes']:_0x41c2b1[_0xd52e('0x37')];if(_0x178660[_0xd52e('0x38')][_0xd52e('0x48')]){_0x59a5eb['include']=[{'all':!![]}];}_0x59a5eb=_[_0xd52e('0x45')]({},_0x59a5eb,_0x178660['options']);return db[_0xd52e('0x32')][_0xd52e('0x4e')](_0x59a5eb)['then'](handleEntityNotFound(_0x4e6e66,null))['then'](respondWithResult(_0x4e6e66,null))[_0xd52e('0x4c')](handleError(_0x4e6e66,null));};exports[_0xd52e('0x4f')]=function(_0x4a1104,_0x40fb1b){return db[_0xd52e('0x32')]['create'](_0x4a1104[_0xd52e('0x50')],{})[_0xd52e('0x29')](function(_0x1ddd94){var _0xe4720a=_0x4a1104['user']['get']({'plain':!![]});if(!_0xe4720a)throw new Error(_0xd52e('0x51'));if(_0xe4720a[_0xd52e('0x52')]==='user'){var _0x3cf620=_0x1ddd94[_0xd52e('0x2b')]({'plain':!![]});var _0x55cc4a='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x55cc4a,'userProfileId':_0xe4720a['userProfileId']},'raw':!![]})['then'](function(_0x54a96a){if(_0x54a96a&&_0x54a96a[_0xd52e('0x53')]===0x0){return db[_0xd52e('0x54')][_0xd52e('0x4f')]({'name':_0x3cf620[_0xd52e('0x2e')],'resourceId':_0x3cf620['id'],'type':_0x54a96a[_0xd52e('0x2e')],'sectionId':_0x54a96a['id']},{})[_0xd52e('0x29')](function(){return _0x1ddd94;});}else{return _0x1ddd94;}})[_0xd52e('0x4c')](function(_0x597ffb){logger[_0xd52e('0x55')](_0xd52e('0x56'),_0x597ffb);throw _0x597ffb;});}return _0x1ddd94;})[_0xd52e('0x29')](respondWithResult(_0x40fb1b,0xc9))[_0xd52e('0x4c')](handleError(_0x40fb1b,null));};exports[_0xd52e('0x57')]=function(_0x55e44a,_0x428063){var _0x1b921a={'where':{'id':_0x55e44a[_0xd52e('0x58')]['id']}},_0x5d4479={};_0x5d4479[_0xd52e('0x37')]=_[_0xd52e('0x39')](db[_0xd52e('0x32')][_0xd52e('0x33')]);_0x1b921a[_0xd52e('0x3c')]=_[_0xd52e('0x3b')](_0x5d4479[_0xd52e('0x37')],qs[_0xd52e('0x3d')](_0x55e44a[_0xd52e('0x38')][_0xd52e('0x3d')]));_0x1b921a[_0xd52e('0x3c')]=_0x1b921a['attributes'][_0xd52e('0x3e')]?_0x1b921a[_0xd52e('0x3c')]:_0x5d4479[_0xd52e('0x37')];if(_0x55e44a[_0xd52e('0x38')][_0xd52e('0x48')]){_0x1b921a[_0xd52e('0x49')]=[{'all':!![]}];}_0x1b921a=_['merge']({},_0x1b921a,_0x55e44a[_0xd52e('0x47')]);return db['JscriptyProject'][_0xd52e('0x4e')](_0x1b921a)[_0xd52e('0x29')](handleEntityNotFound(_0x428063,null))[_0xd52e('0x29')](function(_0x2fe096){if(_0x2fe096){var _0x483bbe=_0x2fe096[_0xd52e('0x2b')]({'plain':!![]});_0x483bbe=qs[_0xd52e('0x59')](_0x483bbe,['id',_0xd52e('0x5a'),_0xd52e('0x5b')]);_0x55e44a[_0xd52e('0x50')]=_[_0xd52e('0x59')](_0x55e44a[_0xd52e('0x50')],['id',_0xd52e('0x5a'),_0xd52e('0x5b')]);return db[_0xd52e('0x32')][_0xd52e('0x4f')](_['merge'](_0x483bbe,_0x55e44a[_0xd52e('0x50')]),{'include':_0x55e44a['query'][_0xd52e('0x48')]?[{'all':!![]}]:undefined})[_0xd52e('0x29')](function(_0x19a7b2){var _0x56367f=_0x55e44a[_0xd52e('0x5c')][_0xd52e('0x2b')]({'plain':!![]});if(!_0x56367f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56367f[_0xd52e('0x52')]===_0xd52e('0x5c')){var _0x32fee8=_0x19a7b2['get']({'plain':!![]});var _0x30b4fc=_0xd52e('0x2c');return db[_0xd52e('0x5d')][_0xd52e('0x4e')]({'where':{'name':_0x30b4fc,'userProfileId':_0x56367f[_0xd52e('0x5e')]},'raw':!![]})[_0xd52e('0x29')](function(_0x4360e7){if(_0x4360e7&&_0x4360e7[_0xd52e('0x53')]===0x0){return db['UserProfileResource'][_0xd52e('0x4f')]({'name':_0x32fee8[_0xd52e('0x2e')],'resourceId':_0x32fee8['id'],'type':_0x4360e7[_0xd52e('0x2e')],'sectionId':_0x4360e7['id']},{})[_0xd52e('0x29')](function(){return _0x19a7b2;});}else{return _0x19a7b2;}})[_0xd52e('0x4c')](function(_0x43bdc9){logger[_0xd52e('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43bdc9);throw _0x43bdc9;});}return _0x19a7b2;});}})[_0xd52e('0x29')](respondWithResult(_0x428063,0xc9))[_0xd52e('0x4c')](handleError(_0x428063,null));};exports[_0xd52e('0x28')]=function(_0x5410cd,_0x4c499e){if(_0x5410cd[_0xd52e('0x50')]['id']){delete _0x5410cd['body']['id'];}return db[_0xd52e('0x32')][_0xd52e('0x4e')]({'where':{'id':_0x5410cd[_0xd52e('0x58')]['id']}})[_0xd52e('0x29')](handleEntityNotFound(_0x4c499e,null))[_0xd52e('0x29')](saveUpdates(_0x5410cd[_0xd52e('0x50')],null))[_0xd52e('0x29')](respondWithResult(_0x4c499e,null))[_0xd52e('0x4c')](handleError(_0x4c499e,null));};exports[_0xd52e('0x2a')]=function(_0x2a8ad1,_0xc447eb){return db['JscriptyProject'][_0xd52e('0x4e')]({'where':{'id':_0x2a8ad1[_0xd52e('0x58')]['id']}})[_0xd52e('0x29')](handleEntityNotFound(_0xc447eb,null))[_0xd52e('0x29')](removeEntity(_0xc447eb,null))[_0xd52e('0x4c')](handleError(_0xc447eb,null));};exports[_0xd52e('0x5f')]=function(_0x16be1f,_0x595c41,_0x5ed614){var _0x12b4c1={'raw':!![],'where':{}};var _0x56407c={};var _0x2705d7={'count':0x0,'rows':[]};return db[_0xd52e('0x32')][_0xd52e('0x60')]({'where':{'id':_0x16be1f[_0xd52e('0x58')]['id']}})[_0xd52e('0x29')](handleEntityNotFound(_0x595c41,null))[_0xd52e('0x29')](function(_0x3f3ce2){if(_0x3f3ce2){_0x56407c[_0xd52e('0x37')]=_[_0xd52e('0x39')](db[_0xd52e('0x61')][_0xd52e('0x33')]);_0x56407c['query']=_['keys'](_0x16be1f[_0xd52e('0x38')]);_0x56407c['filters']=_[_0xd52e('0x3b')](_0x56407c['model'],_0x56407c[_0xd52e('0x38')]);_0x12b4c1['attributes']=_[_0xd52e('0x3b')](_0x56407c[_0xd52e('0x37')],qs['fields'](_0x16be1f[_0xd52e('0x38')][_0xd52e('0x3d')]));_0x12b4c1[_0xd52e('0x3c')]=_0x12b4c1[_0xd52e('0x3c')][_0xd52e('0x3e')]?_0x12b4c1['attributes']:_0x56407c[_0xd52e('0x37')];if(!_0x16be1f[_0xd52e('0x38')][_0xd52e('0x3f')](_0xd52e('0x40'))){_0x12b4c1[_0xd52e('0x20')]=qs[_0xd52e('0x20')](_0x16be1f[_0xd52e('0x38')][_0xd52e('0x20')]);_0x12b4c1['offset']=qs[_0xd52e('0x22')](_0x16be1f['query'][_0xd52e('0x22')]);}_0x12b4c1[_0xd52e('0x41')]=qs[_0xd52e('0x42')](_0x16be1f[_0xd52e('0x38')]['sort']);_0x12b4c1[_0xd52e('0x43')]=qs[_0xd52e('0x3a')](_[_0xd52e('0x62')](_0x16be1f[_0xd52e('0x38')],_0x56407c[_0xd52e('0x3a')]));_0x12b4c1[_0xd52e('0x43')][_0xd52e('0x63')]=_0x3f3ce2['id'];if(_0x16be1f[_0xd52e('0x38')][_0xd52e('0x44')]){_0x12b4c1[_0xd52e('0x43')]=_['merge'](_0x12b4c1['where'],{'$or':_[_0xd52e('0x31')](_0x12b4c1[_0xd52e('0x3c')],function(_0x17cd04){var _0xe3d74a={};_0xe3d74a[_0x17cd04]={'$like':'%'+_0x16be1f[_0xd52e('0x38')]['filter']+'%'};return _0xe3d74a;})});}_0x12b4c1=_[_0xd52e('0x45')]({},_0x12b4c1,_0x16be1f[_0xd52e('0x47')]);return db[_0xd52e('0x61')][_0xd52e('0x21')]({'where':_0x12b4c1['where']})[_0xd52e('0x29')](function(_0x392fb6){_0x2705d7[_0xd52e('0x21')]=_0x392fb6;if(_0x16be1f['query'][_0xd52e('0x48')]){_0x12b4c1['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd52e('0x4a')](_0x12b4c1);})[_0xd52e('0x29')](function(_0x4b17c4){_0x2705d7[_0xd52e('0x4b')]=_0x4b17c4;return _0x2705d7;});}})['then'](respondWithFilteredResult(_0x595c41,_0x12b4c1))[_0xd52e('0x4c')](handleError(_0x595c41,null));};exports[_0xd52e('0x64')]=function(_0x57124a,_0x37f2cd,_0x51b1f1){var _0x2311e3={'raw':!![],'where':{}};var _0x1ab29d={};var _0x44032a={'count':0x0,'rows':[]};return db[_0xd52e('0x32')][_0xd52e('0x60')]({'where':{'id':_0x57124a['params']['id']}})[_0xd52e('0x29')](handleEntityNotFound(_0x37f2cd,null))[_0xd52e('0x29')](function(_0x3b600b){if(_0x3b600b){_0x1ab29d[_0xd52e('0x37')]=_[_0xd52e('0x39')](db[_0xd52e('0x65')]['rawAttributes']);_0x1ab29d[_0xd52e('0x38')]=_['keys'](_0x57124a[_0xd52e('0x38')]);_0x1ab29d[_0xd52e('0x3a')]=_[_0xd52e('0x3b')](_0x1ab29d['model'],_0x1ab29d[_0xd52e('0x38')]);_0x2311e3[_0xd52e('0x3c')]=_[_0xd52e('0x3b')](_0x1ab29d['model'],qs[_0xd52e('0x3d')](_0x57124a['query']['fields']));_0x2311e3['attributes']=_0x2311e3[_0xd52e('0x3c')][_0xd52e('0x3e')]?_0x2311e3['attributes']:_0x1ab29d['model'];if(!_0x57124a[_0xd52e('0x38')][_0xd52e('0x3f')](_0xd52e('0x40'))){_0x2311e3['limit']=qs['limit'](_0x57124a[_0xd52e('0x38')][_0xd52e('0x20')]);_0x2311e3['offset']=qs[_0xd52e('0x22')](_0x57124a[_0xd52e('0x38')][_0xd52e('0x22')]);}_0x2311e3[_0xd52e('0x41')]=qs[_0xd52e('0x42')](_0x57124a[_0xd52e('0x38')][_0xd52e('0x42')]);_0x2311e3[_0xd52e('0x43')]=qs['filters'](_[_0xd52e('0x62')](_0x57124a[_0xd52e('0x38')],_0x1ab29d[_0xd52e('0x3a')]));_0x2311e3[_0xd52e('0x43')][_0xd52e('0x63')]=_0x3b600b['id'];if(_0x57124a[_0xd52e('0x38')]['filter']){_0x2311e3['where']=_[_0xd52e('0x45')](_0x2311e3['where'],{'$or':_[_0xd52e('0x31')](_0x2311e3['attributes'],function(_0x1ae8a4){var _0x55446e={};_0x55446e[_0x1ae8a4]={'$like':'%'+_0x57124a[_0xd52e('0x38')][_0xd52e('0x44')]+'%'};return _0x55446e;})});}_0x2311e3=_['merge']({},_0x2311e3,_0x57124a[_0xd52e('0x47')]);return db['JscriptyAnswerReport'][_0xd52e('0x21')]({'where':_0x2311e3['where']})[_0xd52e('0x29')](function(_0x312b21){_0x44032a[_0xd52e('0x21')]=_0x312b21;if(_0x57124a[_0xd52e('0x38')][_0xd52e('0x48')]){_0x2311e3[_0xd52e('0x49')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xd52e('0x4a')](_0x2311e3);})[_0xd52e('0x29')](function(_0x3ba3ff){_0x44032a['rows']=_0x3ba3ff;return _0x44032a;});}})['then'](respondWithFilteredResult(_0x37f2cd,_0x2311e3))['catch'](handleError(_0x37f2cd,null));};function char(_0x4f7141){return _0xd52e('0x66')===typeof _0x4f7141?String[_0xd52e('0x67')][_0xd52e('0x25')](null,arguments):_0x4f7141;}function needsEncapsulation(_0x3b47f0){return!!_0x3b47f0&&(_0x3b47f0[_0xd52e('0x68')]()[_0xd52e('0x69')](char(0xd))>=0x0||_0x3b47f0[_0xd52e('0x68')]()[_0xd52e('0x69')](char(0xa))>=0x0||_0x3b47f0['toString']()[_0xd52e('0x69')](char(0x2c))>=0x0||_0x3b47f0[_0xd52e('0x68')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x589339){var _0x3e63f4=char(0x22),_0x2df25b='\x5c'+char(0x22),_0x19a10c=_0x589339[_0xd52e('0x68')]()['replace'](new RegExp(_0x3e63f4,'g'),_0x2df25b);return _0x3e63f4+_0x19a10c+_0x3e63f4;}exports[_0xd52e('0x6a')]=function(_0xea828f,_0x31a241,_0x571ceb){var _0x3d3593,_0x435c0b;var _0x293a8a={'where':{'ProjectId':_0xea828f[_0xd52e('0x58')]['id']}};if(_0xea828f[_0xd52e('0x38')][_0xd52e('0x6b')]){_0x293a8a[_0xd52e('0x43')]['starttime']=JSON[_0xd52e('0x6c')](_0xea828f[_0xd52e('0x38')][_0xd52e('0x6b')]);}return db[_0xd52e('0x61')][_0xd52e('0x4a')](_0x293a8a)[_0xd52e('0x29')](handleEntityNotFound(_0x31a241,null))[_0xd52e('0x29')](function(_0x5dae6e){if(_0x5dae6e){_0x3d3593=_0x5dae6e;return db[_0xd52e('0x6d')]['findAll']({'where':{'SessionId':{'$in':_[_0xd52e('0x31')](_0x3d3593,'id')},'ProjectId':_0xea828f[_0xd52e('0x58')]['id']},'order':_0xd52e('0x6e')});}})[_0xd52e('0x29')](handleEntityNotFound(_0x31a241,null))[_0xd52e('0x29')](function(_0x26c99a){if(_0x26c99a){_0x435c0b=_0x26c99a;var _0x1a7827={};for(var _0x17c96a=0x0,_0x346bfc=_0x435c0b[_0xd52e('0x3e')];_0x17c96a<_0x346bfc;_0x17c96a++){if(!_0x1a7827['hasOwnProperty'](_0x435c0b[_0x17c96a][_0xd52e('0x6f')])){_0x1a7827[_0x435c0b[_0x17c96a]['questionId']]=needsEncapsulation(_0x435c0b[_0x17c96a][_0xd52e('0x70')])?encapsulate(_0x435c0b[_0x17c96a]['question']):_0x435c0b[_0x17c96a][_0xd52e('0x70')];}}var _0x342343=[],_0x2fcfba={};for(var _0x4a4e82=0x0,_0x1765b1=_0x3d3593[_0xd52e('0x3e')];_0x4a4e82<_0x1765b1;_0x4a4e82++){_0x2fcfba={'ProjectId':_0xea828f[_0xd52e('0x58')]['id'],'SessionId':_0x3d3593[_0x4a4e82]['id'],'StartTime':moment(_0x3d3593[_0x4a4e82]['starttime'])[_0xd52e('0x71')](_0xd52e('0x72'))};for(var _0x379fb9=0x0,_0x1ce3e9=_0x435c0b[_0xd52e('0x3e')];_0x379fb9<_0x1ce3e9;_0x379fb9++){if(_0x435c0b[_0x379fb9][_0xd52e('0x73')]==_0x3d3593[_0x4a4e82]['id']&&_0x1a7827[_0xd52e('0x3f')](_0x435c0b[_0x379fb9][_0xd52e('0x6f')])){_0x2fcfba[_0x1a7827[_0x435c0b[_0x379fb9]['questionId']]]=_0x435c0b[_0x379fb9]['answer'];}}for(var _0x534ecf in _0x1a7827){if(!_0x2fcfba[_0xd52e('0x3f')](_0x1a7827[_0x534ecf])){_0x2fcfba[_0x1a7827[_0x534ecf]]=null;}}_0x342343[_0xd52e('0x74')](_0x2fcfba);}return _0x342343;}})[_0xd52e('0x29')](function(_0x2ca012){if(!_[_0xd52e('0x75')](_0x2ca012)){var _0x94839f=toCsv(_0x2ca012);var _0x5bbd15=Date[_0xd52e('0x76')]();fs['writeFileSync'](util[_0xd52e('0x71')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xea828f[_0xd52e('0x58')]['id'],_0x5bbd15),_0x94839f);_0x31a241[_0xd52e('0x77')](_0xd52e('0x78'),'attachment;\x20filename='+util[_0xd52e('0x71')]('Jscripty_Project_%d_Summary_%s.csv',_0xea828f[_0xd52e('0x58')]['id'],_0x5bbd15));_0x31a241['setHeader'](_0xd52e('0x79'),_0xd52e('0x7a'));return _0x31a241[_0xd52e('0x7b')](util['format'](_0xd52e('0x7c'),_0xea828f[_0xd52e('0x58')]['id'],_0x5bbd15));}else{return _0x31a241['sendStatus'](0xcc);}})['catch'](handleError(_0x31a241,null));};
\ No newline at end of file
index 61ce5ca..6ad844e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['lodash','api','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects'];(function(_0x10345d,_0x776a72){var _0x5740f1=function(_0x4c8968){while(--_0x4c8968){_0x10345d['push'](_0x10345d['shift']());}};_0x5740f1(++_0x776a72);}(_0x24ca,0x8c));var _0xa24c=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0x24ca[_0x470f63];return _0x4f09e2;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa24c('0x1'));var moment=require('moment');var BPromise=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var fs=require('fs');var path=require(_0xa24c('0x4'));var rimraf=require('rimraf');var config=require(_0xa24c('0x5'));var attributes=require(_0xa24c('0x6'));module[_0xa24c('0x7')]=function(_0x5a37ae,_0x5377ed){return _0x5a37ae['define'](_0xa24c('0x8'),attributes,{'tableName':_0xa24c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb66c=['jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x1ea99e,_0x5dc711){var _0x119e59=function(_0x35135d){while(--_0x35135d){_0x1ea99e['push'](_0x1ea99e['shift']());}};_0x119e59(++_0x5dc711);}(_0xb66c,0x175));var _0xcb66=function(_0x371940,_0x932d4b){_0x371940=_0x371940-0x0;var _0x379754=_0xb66c[_0x371940];return _0x379754;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e493092..8c7b878 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(_0x1b361c,_0x1e904a){var _0x4440a1=function(_0x52f73b){while(--_0x52f73b){_0x1b361c['push'](_0x1b361c['shift']());}};_0x4440a1(++_0x1e904a);}(_0xaa88,0x137));var _0x8aa8=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0xaa88[_0x4e783c];return _0x2fbd6d;};'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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x13b70f,_0x5c1116){var _0x51427c=function(_0x54bb0b){while(--_0x54bb0b){_0x13b70f['push'](_0x13b70f['shift']());}};_0x51427c(++_0x5c1116);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58ac4d,_0x49b83d){_0x58ac4d=_0x58ac4d-0x0;var _0x175525=_0xf4eb[_0x58ac4d];return _0x175525;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 2d9f1c4..647b904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83a7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0x3b88e2,_0x37c217){var _0x1a08a9=function(_0x59657b){while(--_0x59657b){_0x3b88e2['push'](_0x3b88e2['shift']());}};_0x1a08a9(++_0x37c217);}(_0x83a7,0x1a1));var _0x783a=function(_0x5c3386,_0x528dcb){_0x5c3386=_0x5c3386-0x0;var _0x2b6255=_0x83a7[_0x5c3386];return _0x2b6255;};'use strict';var multer=require('multer');var util=require(_0x783a('0x0'));var path=require(_0x783a('0x1'));var timeout=require(_0x783a('0x2'));var express=require(_0x783a('0x3'));var router=express[_0x783a('0x4')]();var fs_extra=require(_0x783a('0x5'));var auth=require(_0x783a('0x6'));var interaction=require(_0x783a('0x7'));var config=require(_0x783a('0x8'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x783a('0x9')]);router[_0x783a('0xa')](_0x783a('0xb'),auth['isAuthenticated'](),controller[_0x783a('0xc')]);router[_0x783a('0xa')](_0x783a('0xd'),auth[_0x783a('0xe')](),controller[_0x783a('0xf')]);router['post']('/',auth[_0x783a('0xe')](),controller[_0x783a('0x10')]);router[_0x783a('0x11')](_0x783a('0xd'),auth[_0x783a('0xe')](),controller[_0x783a('0x12')]);router[_0x783a('0x13')](_0x783a('0xd'),auth[_0x783a('0xe')](),controller['destroy']);module[_0x783a('0x14')]=router;
\ No newline at end of file
+var _0x9475=['connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x58477c,_0x345c6b){var _0x536aa0=function(_0x44f037){while(--_0x44f037){_0x58477c['push'](_0x58477c['shift']());}};_0x536aa0(++_0x345c6b);}(_0x9475,0xc3));var _0x5947=function(_0x527083,_0x123387){_0x527083=_0x527083-0x0;var _0x53e246=_0x9475[_0x527083];return _0x53e246;};'use strict';var multer=require(_0x5947('0x0'));var util=require(_0x5947('0x1'));var path=require(_0x5947('0x2'));var timeout=require(_0x5947('0x3'));var express=require(_0x5947('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5947('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5947('0x6'));var controller=require(_0x5947('0x7'));router['get']('/',auth[_0x5947('0x8')](),controller['index']);router[_0x5947('0x9')]('/describe',auth[_0x5947('0x8')](),controller['describe']);router[_0x5947('0x9')](_0x5947('0xa'),auth[_0x5947('0x8')](),controller[_0x5947('0xb')]);router[_0x5947('0xc')]('/',auth[_0x5947('0x8')](),controller[_0x5947('0xd')]);router[_0x5947('0xe')]('/:id',auth[_0x5947('0x8')](),controller['update']);router[_0x5947('0xf')](_0x5947('0xa'),auth[_0x5947('0x8')](),controller[_0x5947('0x10')]);module[_0x5947('0x11')]=router;
\ No newline at end of file
index cbd0a81..b73dcee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1da4f3,_0xef7373){_0x1da4f3=_0x1da4f3-0x0;var _0x5057a7=_0x7a54[_0x1da4f3];return _0x5057a7;};'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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x5767f4,_0x2ddb9b){_0x5767f4=_0x5767f4-0x0;var _0x5bd6ae=_0x7a54[_0x5767f4];return _0x5bd6ae;};'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 4210e77..bef2a4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5672=['options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x2d934a,_0x1cb21c){var _0x1571bc=function(_0x89fec3){while(--_0x89fec3){_0x2d934a['push'](_0x2d934a['shift']());}};_0x1571bc(++_0x1cb21c);}(_0x5672,0x184));var _0x2567=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0x5672[_0x262323];return _0xa963c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2567('0x0'));var zipdir=require(_0x2567('0x1'));var jsonpatch=require(_0x2567('0x2'));var rp=require(_0x2567('0x3'));var moment=require(_0x2567('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2567('0x5'));var util=require(_0x2567('0x6'));var path=require(_0x2567('0x7'));var sox=require(_0x2567('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2567('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2567('0xa'));var deskjs=require(_0x2567('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2567('0xc'));var Papa=require(_0x2567('0xd'));var Redis=require(_0x2567('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2567('0xf'));var hardwareService=require(_0x2567('0x10'));var logger=require(_0x2567('0x11'))(_0x2567('0x12'));var utils=require(_0x2567('0x13'));var config=require(_0x2567('0x14'));var licenseUtil=require(_0x2567('0x15'));var db=require(_0x2567('0x16'))['db'];function respondWithStatusCode(_0x5ecc48,_0x5847d1){_0x5847d1=_0x5847d1||0xcc;return function(_0x187df0){if(_0x187df0){return _0x5ecc48['sendStatus'](_0x5847d1);}return _0x5ecc48['status'](_0x5847d1)[_0x2567('0x17')]();};}function respondWithResult(_0x1dbffd,_0x19b3ee){_0x19b3ee=_0x19b3ee||0xc8;return function(_0x4e0a4d){if(_0x4e0a4d){return _0x1dbffd[_0x2567('0x18')](_0x19b3ee)[_0x2567('0x19')](_0x4e0a4d);}};}function respondWithFilteredResult(_0x341b12,_0x29bd21){return function(_0x1ed868){if(_0x1ed868){var _0x509fba=typeof _0x29bd21['offset']===_0x2567('0x1a')&&typeof _0x29bd21[_0x2567('0x1b')]===_0x2567('0x1a');var _0x57c317=_0x1ed868[_0x2567('0x1c')];var _0x622326=_0x509fba?0x0:_0x29bd21[_0x2567('0x1d')];var _0x5d6d6d=_0x509fba?_0x1ed868[_0x2567('0x1c')]:_0x29bd21['offset']+_0x29bd21[_0x2567('0x1b')];var _0x3c406a;if(_0x5d6d6d>=_0x57c317){_0x5d6d6d=_0x57c317;_0x3c406a=0xc8;}else{_0x3c406a=0xce;}_0x341b12[_0x2567('0x18')](_0x3c406a);return _0x341b12[_0x2567('0x1e')](_0x2567('0x1f'),_0x622326+'-'+_0x5d6d6d+'/'+_0x57c317)['json'](_0x1ed868);}return null;};}function patchUpdates(_0x2b5337){return function(_0x55a095){try{jsonpatch[_0x2567('0x20')](_0x55a095,_0x2b5337,!![]);}catch(_0x272227){return BPromise[_0x2567('0x21')](_0x272227);}return _0x55a095[_0x2567('0x22')]();};}function saveUpdates(_0x5e1023,_0x5436ea){return function(_0x59b174){if(_0x59b174){return _0x59b174[_0x2567('0x23')](_0x5e1023)['then'](function(_0x10c090){return _0x10c090;});}return null;};}function removeEntity(_0x1aa27b,_0x4559d9){return function(_0xfa7f99){if(_0xfa7f99){return _0xfa7f99['destroy']()[_0x2567('0x24')](function(){_0x1aa27b['status'](0xcc)[_0x2567('0x17')]();});}};}function handleEntityNotFound(_0x6716f5,_0x52dbb5){return function(_0x4a461d){if(!_0x4a461d){_0x6716f5[_0x2567('0x25')](0x194);}return _0x4a461d;};}function handleError(_0xbd20fb,_0x2b91a7){_0x2b91a7=_0x2b91a7||0x1f4;return function(_0x2366b2){logger['error'](_0x2366b2[_0x2567('0x26')]);if(_0x2366b2[_0x2567('0x27')]){delete _0x2366b2[_0x2567('0x27')];}_0xbd20fb[_0x2567('0x18')](_0x2b91a7)[_0x2567('0x28')](_0x2366b2);};}exports['index']=function(_0x3550d7,_0x1bd847){var _0x4c15e2={},_0x122d2b={},_0x3a58de={'count':0x0,'rows':[]};var _0x57ec2a=_[_0x2567('0x29')](db[_0x2567('0x2a')][_0x2567('0x2b')],function(_0x34a3e5){return{'name':_0x34a3e5[_0x2567('0x2c')],'type':_0x34a3e5[_0x2567('0x2d')][_0x2567('0x2e')]};});_0x122d2b[_0x2567('0x2f')]=_[_0x2567('0x29')](_0x57ec2a,_0x2567('0x27'));_0x122d2b[_0x2567('0x30')]=_[_0x2567('0x31')](_0x3550d7['query']);_0x122d2b['filters']=_[_0x2567('0x32')](_0x122d2b[_0x2567('0x2f')],_0x122d2b[_0x2567('0x30')]);_0x4c15e2[_0x2567('0x33')]=_['intersection'](_0x122d2b[_0x2567('0x2f')],qs[_0x2567('0x34')](_0x3550d7[_0x2567('0x30')][_0x2567('0x34')]));_0x4c15e2[_0x2567('0x33')]=_0x4c15e2['attributes']['length']?_0x4c15e2[_0x2567('0x33')]:_0x122d2b[_0x2567('0x2f')];if(!_0x3550d7[_0x2567('0x30')][_0x2567('0x35')](_0x2567('0x36'))){_0x4c15e2[_0x2567('0x1b')]=qs['limit'](_0x3550d7[_0x2567('0x30')][_0x2567('0x1b')]);_0x4c15e2[_0x2567('0x1d')]=qs['offset'](_0x3550d7[_0x2567('0x30')][_0x2567('0x1d')]);}_0x4c15e2[_0x2567('0x37')]=qs[_0x2567('0x38')](_0x3550d7[_0x2567('0x30')][_0x2567('0x38')]);_0x4c15e2[_0x2567('0x39')]=qs[_0x2567('0x3a')](_[_0x2567('0x3b')](_0x3550d7[_0x2567('0x30')],_0x122d2b[_0x2567('0x3a')]),_0x57ec2a);if(_0x3550d7['query'][_0x2567('0x3c')]){_0x4c15e2['where']=_[_0x2567('0x3d')](_0x4c15e2[_0x2567('0x39')],{'$or':_['map'](_0x57ec2a,function(_0x28b405){if(_0x28b405['type']!=='VIRTUAL'){var _0xab75ac={};_0xab75ac[_0x28b405[_0x2567('0x27')]]={'$like':'%'+_0x3550d7[_0x2567('0x30')][_0x2567('0x3c')]+'%'};return _0xab75ac;}})});}_0x4c15e2=_[_0x2567('0x3d')]({},_0x4c15e2,_0x3550d7[_0x2567('0x3e')]);var _0x3b4f48={'where':_0x4c15e2[_0x2567('0x39')]};return db['JscriptyQuestionReport'][_0x2567('0x1c')](_0x3b4f48)[_0x2567('0x24')](function(_0x1ced20){_0x3a58de[_0x2567('0x1c')]=_0x1ced20;if(_0x3550d7[_0x2567('0x30')][_0x2567('0x3f')]){_0x4c15e2[_0x2567('0x40')]=[{'all':!![]}];}return db[_0x2567('0x2a')][_0x2567('0x41')](_0x4c15e2);})[_0x2567('0x24')](function(_0x5317a0){_0x3a58de[_0x2567('0x42')]=_0x5317a0;return _0x3a58de;})[_0x2567('0x24')](respondWithFilteredResult(_0x1bd847,_0x4c15e2))[_0x2567('0x43')](handleError(_0x1bd847,null));};exports['show']=function(_0x3427c2,_0x30ff2a){var _0xd929={'raw':!![],'where':{'id':_0x3427c2[_0x2567('0x44')]['id']}},_0x48d042={};_0x48d042[_0x2567('0x2f')]=_[_0x2567('0x31')](db[_0x2567('0x2a')]['rawAttributes']);_0x48d042[_0x2567('0x30')]=_[_0x2567('0x31')](_0x3427c2['query']);_0x48d042['filters']=_[_0x2567('0x32')](_0x48d042[_0x2567('0x2f')],_0x48d042[_0x2567('0x30')]);_0xd929[_0x2567('0x33')]=_[_0x2567('0x32')](_0x48d042[_0x2567('0x2f')],qs['fields'](_0x3427c2[_0x2567('0x30')][_0x2567('0x34')]));_0xd929[_0x2567('0x33')]=_0xd929[_0x2567('0x33')][_0x2567('0x45')]?_0xd929[_0x2567('0x33')]:_0x48d042[_0x2567('0x2f')];if(_0x3427c2['query'][_0x2567('0x3f')]){_0xd929['include']=[{'all':!![]}];}_0xd929=_['merge']({},_0xd929,_0x3427c2[_0x2567('0x3e')]);return db['JscriptyQuestionReport'][_0x2567('0x46')](_0xd929)[_0x2567('0x24')](handleEntityNotFound(_0x30ff2a,null))[_0x2567('0x24')](respondWithResult(_0x30ff2a,null))[_0x2567('0x43')](handleError(_0x30ff2a,null));};exports[_0x2567('0x47')]=function(_0x5cf8df,_0x4d70b2){return db[_0x2567('0x2a')][_0x2567('0x47')](_0x5cf8df[_0x2567('0x48')],{})['then'](respondWithResult(_0x4d70b2,0xc9))[_0x2567('0x43')](handleError(_0x4d70b2,null));};exports[_0x2567('0x23')]=function(_0x28caa7,_0xacf026){if(_0x28caa7[_0x2567('0x48')]['id']){delete _0x28caa7['body']['id'];}return db['JscriptyQuestionReport'][_0x2567('0x46')]({'where':{'id':_0x28caa7[_0x2567('0x44')]['id']}})[_0x2567('0x24')](handleEntityNotFound(_0xacf026,null))[_0x2567('0x24')](saveUpdates(_0x28caa7[_0x2567('0x48')],null))[_0x2567('0x24')](respondWithResult(_0xacf026,null))[_0x2567('0x43')](handleError(_0xacf026,null));};exports[_0x2567('0x49')]=function(_0x815829,_0x414022){return db[_0x2567('0x2a')][_0x2567('0x46')]({'where':{'id':_0x815829[_0x2567('0x44')]['id']}})[_0x2567('0x24')](handleEntityNotFound(_0x414022,null))['then'](removeEntity(_0x414022,null))[_0x2567('0x43')](handleError(_0x414022,null));};exports[_0x2567('0x4a')]=function(_0x396a50,_0x3cfaf7){return db[_0x2567('0x2a')][_0x2567('0x4a')]()[_0x2567('0x24')](respondWithResult(_0x3cfaf7,null))[_0x2567('0x43')](handleError(_0x3cfaf7,null));};
\ No newline at end of file
+var _0x43ee=['JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x43ee,0xb1));var _0xe43e=function(_0x5338fe,_0x5e71d1){_0x5338fe=_0x5338fe-0x0;var _0xf0a1be=_0x43ee[_0x5338fe];return _0xf0a1be;};'use strict';var emlformat=require(_0xe43e('0x0'));var rimraf=require(_0xe43e('0x1'));var zipdir=require(_0xe43e('0x2'));var jsonpatch=require(_0xe43e('0x3'));var rp=require(_0xe43e('0x4'));var moment=require(_0xe43e('0x5'));var BPromise=require(_0xe43e('0x6'));var Mustache=require(_0xe43e('0x7'));var util=require(_0xe43e('0x8'));var path=require(_0xe43e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe43e('0xa'));var _=require(_0xe43e('0xb'));var squel=require(_0xe43e('0xc'));var crypto=require(_0xe43e('0xd'));var jsforce=require(_0xe43e('0xe'));var deskjs=require(_0xe43e('0xf'));var toCsv=require(_0xe43e('0x10'));var querystring=require(_0xe43e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe43e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe43e('0x13'))(_0xe43e('0x14'));var utils=require(_0xe43e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe43e('0x16'));var db=require(_0xe43e('0x17'))['db'];function respondWithStatusCode(_0x10d6af,_0x179e6f){_0x179e6f=_0x179e6f||0xcc;return function(_0x4bdeb8){if(_0x4bdeb8){return _0x10d6af[_0xe43e('0x18')](_0x179e6f);}return _0x10d6af[_0xe43e('0x19')](_0x179e6f)[_0xe43e('0x1a')]();};}function respondWithResult(_0x386c72,_0x249f5f){_0x249f5f=_0x249f5f||0xc8;return function(_0x182033){if(_0x182033){return _0x386c72[_0xe43e('0x19')](_0x249f5f)['json'](_0x182033);}};}function respondWithFilteredResult(_0x177173,_0x3b67a7){return function(_0x3d7291){if(_0x3d7291){var _0x30e3f4=typeof _0x3b67a7[_0xe43e('0x1b')]==='undefined'&&typeof _0x3b67a7[_0xe43e('0x1c')]===_0xe43e('0x1d');var _0x2f321d=_0x3d7291[_0xe43e('0x1e')];var _0x112b50=_0x30e3f4?0x0:_0x3b67a7[_0xe43e('0x1b')];var _0x4297be=_0x30e3f4?_0x3d7291['count']:_0x3b67a7[_0xe43e('0x1b')]+_0x3b67a7[_0xe43e('0x1c')];var _0x44684c;if(_0x4297be>=_0x2f321d){_0x4297be=_0x2f321d;_0x44684c=0xc8;}else{_0x44684c=0xce;}_0x177173['status'](_0x44684c);return _0x177173[_0xe43e('0x1f')](_0xe43e('0x20'),_0x112b50+'-'+_0x4297be+'/'+_0x2f321d)[_0xe43e('0x21')](_0x3d7291);}return null;};}function patchUpdates(_0x18e82f){return function(_0x41dc4e){try{jsonpatch['apply'](_0x41dc4e,_0x18e82f,!![]);}catch(_0x58820f){return BPromise[_0xe43e('0x22')](_0x58820f);}return _0x41dc4e[_0xe43e('0x23')]();};}function saveUpdates(_0x1386ee,_0x2d4595){return function(_0x441187){if(_0x441187){return _0x441187[_0xe43e('0x24')](_0x1386ee)[_0xe43e('0x25')](function(_0x5536fd){return _0x5536fd;});}return null;};}function removeEntity(_0x21c3f7,_0x431c0f){return function(_0xc27aa7){if(_0xc27aa7){return _0xc27aa7[_0xe43e('0x26')]()['then'](function(){_0x21c3f7[_0xe43e('0x19')](0xcc)[_0xe43e('0x1a')]();});}};}function handleEntityNotFound(_0x2861cf,_0xfe7ded){return function(_0x3f6f89){if(!_0x3f6f89){_0x2861cf['sendStatus'](0x194);}return _0x3f6f89;};}function handleError(_0x31df20,_0x49efc5){_0x49efc5=_0x49efc5||0x1f4;return function(_0x3cc934){logger[_0xe43e('0x27')](_0x3cc934[_0xe43e('0x28')]);if(_0x3cc934[_0xe43e('0x29')]){delete _0x3cc934[_0xe43e('0x29')];}_0x31df20['status'](_0x49efc5)[_0xe43e('0x2a')](_0x3cc934);};}exports[_0xe43e('0x2b')]=function(_0x226582,_0x4c18f2){var _0x3394c6={},_0xb21397={},_0xc4ad8f={'count':0x0,'rows':[]};var _0x3dff1f=_[_0xe43e('0x2c')](db[_0xe43e('0x2d')]['rawAttributes'],function(_0x32a739){return{'name':_0x32a739[_0xe43e('0x2e')],'type':_0x32a739[_0xe43e('0x2f')][_0xe43e('0x30')]};});_0xb21397[_0xe43e('0x31')]=_[_0xe43e('0x2c')](_0x3dff1f,_0xe43e('0x29'));_0xb21397[_0xe43e('0x32')]=_[_0xe43e('0x33')](_0x226582['query']);_0xb21397[_0xe43e('0x34')]=_[_0xe43e('0x35')](_0xb21397[_0xe43e('0x31')],_0xb21397['query']);_0x3394c6[_0xe43e('0x36')]=_[_0xe43e('0x35')](_0xb21397[_0xe43e('0x31')],qs[_0xe43e('0x37')](_0x226582[_0xe43e('0x32')]['fields']));_0x3394c6[_0xe43e('0x36')]=_0x3394c6['attributes']['length']?_0x3394c6[_0xe43e('0x36')]:_0xb21397['model'];if(!_0x226582[_0xe43e('0x32')]['hasOwnProperty']('nolimit')){_0x3394c6[_0xe43e('0x1c')]=qs[_0xe43e('0x1c')](_0x226582[_0xe43e('0x32')]['limit']);_0x3394c6[_0xe43e('0x1b')]=qs[_0xe43e('0x1b')](_0x226582['query']['offset']);}_0x3394c6[_0xe43e('0x38')]=qs[_0xe43e('0x39')](_0x226582[_0xe43e('0x32')]['sort']);_0x3394c6['where']=qs[_0xe43e('0x34')](_['pick'](_0x226582[_0xe43e('0x32')],_0xb21397[_0xe43e('0x34')]),_0x3dff1f);if(_0x226582[_0xe43e('0x32')][_0xe43e('0x3a')]){_0x3394c6[_0xe43e('0x3b')]=_[_0xe43e('0x3c')](_0x3394c6[_0xe43e('0x3b')],{'$or':_[_0xe43e('0x2c')](_0x3dff1f,function(_0xb3e886){if(_0xb3e886[_0xe43e('0x2f')]!==_0xe43e('0x3d')){var _0x1a8951={};_0x1a8951[_0xb3e886[_0xe43e('0x29')]]={'$like':'%'+_0x226582[_0xe43e('0x32')][_0xe43e('0x3a')]+'%'};return _0x1a8951;}})});}_0x3394c6=_['merge']({},_0x3394c6,_0x226582[_0xe43e('0x3e')]);var _0x3c6d47={'where':_0x3394c6[_0xe43e('0x3b')]};return db[_0xe43e('0x2d')][_0xe43e('0x1e')](_0x3c6d47)[_0xe43e('0x25')](function(_0x37ca45){_0xc4ad8f[_0xe43e('0x1e')]=_0x37ca45;if(_0x226582[_0xe43e('0x32')][_0xe43e('0x3f')]){_0x3394c6[_0xe43e('0x40')]=[{'all':!![]}];}return db[_0xe43e('0x2d')]['findAll'](_0x3394c6);})['then'](function(_0x1f2f99){_0xc4ad8f[_0xe43e('0x41')]=_0x1f2f99;return _0xc4ad8f;})['then'](respondWithFilteredResult(_0x4c18f2,_0x3394c6))[_0xe43e('0x42')](handleError(_0x4c18f2,null));};exports['show']=function(_0x5aeb34,_0x14aa7f){var _0x5884c4={'raw':!![],'where':{'id':_0x5aeb34[_0xe43e('0x43')]['id']}},_0x49ed49={};_0x49ed49[_0xe43e('0x31')]=_[_0xe43e('0x33')](db[_0xe43e('0x2d')][_0xe43e('0x44')]);_0x49ed49[_0xe43e('0x32')]=_[_0xe43e('0x33')](_0x5aeb34[_0xe43e('0x32')]);_0x49ed49[_0xe43e('0x34')]=_[_0xe43e('0x35')](_0x49ed49['model'],_0x49ed49[_0xe43e('0x32')]);_0x5884c4['attributes']=_[_0xe43e('0x35')](_0x49ed49[_0xe43e('0x31')],qs[_0xe43e('0x37')](_0x5aeb34[_0xe43e('0x32')]['fields']));_0x5884c4[_0xe43e('0x36')]=_0x5884c4[_0xe43e('0x36')][_0xe43e('0x45')]?_0x5884c4['attributes']:_0x49ed49[_0xe43e('0x31')];if(_0x5aeb34[_0xe43e('0x32')][_0xe43e('0x3f')]){_0x5884c4['include']=[{'all':!![]}];}_0x5884c4=_['merge']({},_0x5884c4,_0x5aeb34[_0xe43e('0x3e')]);return db['JscriptyQuestionReport'][_0xe43e('0x46')](_0x5884c4)[_0xe43e('0x25')](handleEntityNotFound(_0x14aa7f,null))[_0xe43e('0x25')](respondWithResult(_0x14aa7f,null))[_0xe43e('0x42')](handleError(_0x14aa7f,null));};exports[_0xe43e('0x47')]=function(_0x2d320c,_0x5a6eea){return db[_0xe43e('0x2d')]['create'](_0x2d320c[_0xe43e('0x48')],{})[_0xe43e('0x25')](respondWithResult(_0x5a6eea,0xc9))[_0xe43e('0x42')](handleError(_0x5a6eea,null));};exports[_0xe43e('0x24')]=function(_0x3d28af,_0x5f1cfe){if(_0x3d28af['body']['id']){delete _0x3d28af['body']['id'];}return db['JscriptyQuestionReport'][_0xe43e('0x46')]({'where':{'id':_0x3d28af[_0xe43e('0x43')]['id']}})[_0xe43e('0x25')](handleEntityNotFound(_0x5f1cfe,null))[_0xe43e('0x25')](saveUpdates(_0x3d28af[_0xe43e('0x48')],null))[_0xe43e('0x25')](respondWithResult(_0x5f1cfe,null))[_0xe43e('0x42')](handleError(_0x5f1cfe,null));};exports[_0xe43e('0x26')]=function(_0x8568be,_0x2c031f){return db[_0xe43e('0x2d')][_0xe43e('0x46')]({'where':{'id':_0x8568be[_0xe43e('0x43')]['id']}})[_0xe43e('0x25')](handleEntityNotFound(_0x2c031f,null))[_0xe43e('0x25')](removeEntity(_0x2c031f,null))[_0xe43e('0x42')](handleError(_0x2c031f,null));};exports[_0xe43e('0x49')]=function(_0x5b15f8,_0x4649f4){return db['JscriptyQuestionReport'][_0xe43e('0x49')]()['then'](respondWithResult(_0x4649f4,null))[_0xe43e('0x42')](handleError(_0x4649f4,null));};
\ No newline at end of file
index 2ff56e0..001dd09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c84=['exports','report_jscripty_questions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x2846f8,_0x24e575){var _0x1559b7=function(_0x40ef17){while(--_0x40ef17){_0x2846f8['push'](_0x2846f8['shift']());}};_0x1559b7(++_0x24e575);}(_0x0c84,0x18e));var _0x40c8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x0c84[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x40c8('0x0'));var util=require(_0x40c8('0x1'));var logger=require('../../config/logger')(_0x40c8('0x2'));var moment=require(_0x40c8('0x3'));var BPromise=require('bluebird');var rp=require(_0x40c8('0x4'));var fs=require('fs');var path=require(_0x40c8('0x5'));var rimraf=require(_0x40c8('0x6'));var config=require(_0x40c8('0x7'));var attributes=require(_0x40c8('0x8'));module[_0x40c8('0x9')]=function(_0x393df3,_0x1b2bc1){return _0x393df3['define']('JscriptyQuestionReport',attributes,{'tableName':_0x40c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ff5=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1ff5,0xa8));var _0x51ff=function(_0x26df46,_0x3a8786){_0x26df46=_0x26df46-0x0;var _0x4d9646=_0x1ff5[_0x26df46];return _0x4d9646;};'use strict';var _=require('lodash');var util=require(_0x51ff('0x0'));var logger=require(_0x51ff('0x1'))(_0x51ff('0x2'));var moment=require(_0x51ff('0x3'));var BPromise=require(_0x51ff('0x4'));var rp=require(_0x51ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51ff('0x6'));var config=require(_0x51ff('0x7'));var attributes=require(_0x51ff('0x8'));module[_0x51ff('0x9')]=function(_0x4ca0cf,_0x1cb61e){return _0x4ca0cf[_0x51ff('0xa')](_0x51ff('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b9a9909..c5eefb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1da=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x593ff2,_0x4f27ec){var _0x1dd710=function(_0x28159a){while(--_0x28159a){_0x593ff2['push'](_0x593ff2['shift']());}};_0x1dd710(++_0x4f27ec);}(_0xf1da,0x136));var _0xaf1d=function(_0x3bf266,_0x4f2609){_0x3bf266=_0x3bf266-0x0;var _0x211ec8=_0xf1da[_0x3bf266];return _0x211ec8;};'use strict';var _=require(_0xaf1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaf1d('0x1'));var rs=require(_0xaf1d('0x2'));var fs=require('fs');var Redis=require(_0xaf1d('0x3'));var db=require(_0xaf1d('0x4'))['db'];var utils=require(_0xaf1d('0x5'));var logger=require(_0xaf1d('0x6'))(_0xaf1d('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf1d('0x8'));var client=jayson[_0xaf1d('0x9')][_0xaf1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f8316,_0x5a39d9,_0x1e9044){return new BPromise(function(_0x2640d6,_0x4b1601){return client['request'](_0x4f8316,_0x1e9044)[_0xaf1d('0xb')](function(_0x15ec1a){logger[_0xaf1d('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5a39d9,_0xaf1d('0xd'));logger[_0xaf1d('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5a39d9,'request\x20sent',JSON[_0xaf1d('0xf')](_0x15ec1a));if(_0x15ec1a[_0xaf1d('0x10')]){if(_0x15ec1a[_0xaf1d('0x10')]['code']===0x1f4){logger[_0xaf1d('0x10')](_0xaf1d('0x11'),_0x5a39d9,_0x15ec1a[_0xaf1d('0x10')]['message']);return _0x4b1601(_0x15ec1a[_0xaf1d('0x10')][_0xaf1d('0x12')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5a39d9,_0x15ec1a[_0xaf1d('0x10')]['message']);return _0x2640d6(_0x15ec1a['error'][_0xaf1d('0x12')]);}else{logger[_0xaf1d('0xc')](_0xaf1d('0x11'),_0x5a39d9,_0xaf1d('0xd'));_0x2640d6(_0x15ec1a[_0xaf1d('0x13')][_0xaf1d('0x12')]);}})[_0xaf1d('0x14')](function(_0x5c8fc7){logger[_0xaf1d('0x10')](_0xaf1d('0x11'),_0x5a39d9,_0x5c8fc7);_0x4b1601(_0x5c8fc7);});});}
\ No newline at end of file
+var _0xb894=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x3242fc,_0x3d809e){var _0xae2530=function(_0x13cf6b){while(--_0x13cf6b){_0x3242fc['push'](_0x3242fc['shift']());}};_0xae2530(++_0x3d809e);}(_0xb894,0x74));var _0x4b89=function(_0x1e09de,_0x5182fe){_0x1e09de=_0x1e09de-0x0;var _0x3f2909=_0xb894[_0x1e09de];return _0x3f2909;};'use strict';var _=require(_0x4b89('0x0'));var util=require(_0x4b89('0x1'));var moment=require(_0x4b89('0x2'));var BPromise=require(_0x4b89('0x3'));var rs=require(_0x4b89('0x4'));var fs=require('fs');var Redis=require(_0x4b89('0x5'));var db=require(_0x4b89('0x6'))['db'];var utils=require(_0x4b89('0x7'));var logger=require(_0x4b89('0x8'))(_0x4b89('0x9'));var config=require(_0x4b89('0xa'));var jayson=require(_0x4b89('0xb'));var client=jayson[_0x4b89('0xc')][_0x4b89('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4da89a,_0x54303d,_0x471a1d){return new BPromise(function(_0x231245,_0x3a10b7){return client[_0x4b89('0xe')](_0x4da89a,_0x471a1d)[_0x4b89('0xf')](function(_0x3ece51){logger[_0x4b89('0x10')](_0x4b89('0x11'),_0x54303d,_0x4b89('0x12'));logger['debug'](_0x4b89('0x13'),_0x54303d,_0x4b89('0x12'),JSON[_0x4b89('0x14')](_0x3ece51));if(_0x3ece51['error']){if(_0x3ece51[_0x4b89('0x15')]['code']===0x1f4){logger[_0x4b89('0x15')](_0x4b89('0x11'),_0x54303d,_0x3ece51[_0x4b89('0x15')][_0x4b89('0x16')]);return _0x3a10b7(_0x3ece51[_0x4b89('0x15')][_0x4b89('0x16')]);}logger[_0x4b89('0x15')](_0x4b89('0x11'),_0x54303d,_0x3ece51['error']['message']);return _0x231245(_0x3ece51['error'][_0x4b89('0x16')]);}else{logger[_0x4b89('0x10')](_0x4b89('0x11'),_0x54303d,'request\x20sent');_0x231245(_0x3ece51[_0x4b89('0x17')]['message']);}})['catch'](function(_0x3f3956){logger[_0x4b89('0x15')](_0x4b89('0x11'),_0x54303d,_0x3f3956);_0x3a10b7(_0x3f3956);});});}
\ No newline at end of file
index bceb6d4..3c8e28a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x872a=['delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put','update'];(function(_0x4a3a5f,_0x1cd5da){var _0x106fa8=function(_0x5b968e){while(--_0x5b968e){_0x4a3a5f['push'](_0x4a3a5f['shift']());}};_0x106fa8(++_0x1cd5da);}(_0x872a,0x167));var _0xa872=function(_0x62cd84,_0x1f02a1){_0x62cd84=_0x62cd84-0x0;var _0x1e4420=_0x872a[_0x62cd84];return _0x1e4420;};'use strict';var multer=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var path=require(_0xa872('0x2'));var timeout=require('connect-timeout');var express=require(_0xa872('0x3'));var router=express[_0xa872('0x4')]();var fs_extra=require(_0xa872('0x5'));var auth=require(_0xa872('0x6'));var interaction=require(_0xa872('0x7'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xa872('0x8')]('/',auth[_0xa872('0x9')](),controller['index']);router[_0xa872('0x8')](_0xa872('0xa'),auth['isAuthenticated'](),controller[_0xa872('0xb')]);router['get'](_0xa872('0xc'),auth[_0xa872('0x9')](),controller[_0xa872('0xd')]);router[_0xa872('0x8')](_0xa872('0xe'),auth[_0xa872('0x9')](),controller[_0xa872('0xf')]);router['post']('/',auth[_0xa872('0x9')](),controller[_0xa872('0x10')]);router[_0xa872('0x11')]('/:id',auth[_0xa872('0x9')](),controller[_0xa872('0x12')]);router[_0xa872('0x13')](_0xa872('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa872('0x14')]=router;
\ No newline at end of file
+var _0x71bf=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','create','put','/:id','update','delete'];(function(_0x372ef2,_0x183c21){var _0x5d29bf=function(_0x43013b){while(--_0x43013b){_0x372ef2['push'](_0x372ef2['shift']());}};_0x5d29bf(++_0x183c21);}(_0x71bf,0x74));var _0xf71b=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x71bf[_0x5f0501];return _0x3c2c45;};'use strict';var multer=require(_0xf71b('0x0'));var util=require(_0xf71b('0x1'));var path=require('path');var timeout=require(_0xf71b('0x2'));var express=require(_0xf71b('0x3'));var router=express[_0xf71b('0x4')]();var fs_extra=require(_0xf71b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf71b('0x6'));var config=require(_0xf71b('0x7'));var controller=require(_0xf71b('0x8'));router[_0xf71b('0x9')]('/',auth[_0xf71b('0xa')](),controller[_0xf71b('0xb')]);router[_0xf71b('0x9')](_0xf71b('0xc'),auth['isAuthenticated'](),controller[_0xf71b('0xd')]);router[_0xf71b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf71b('0xe')]);router[_0xf71b('0x9')](_0xf71b('0xf'),auth['isAuthenticated'](),controller[_0xf71b('0x10')]);router['post']('/',auth[_0xf71b('0xa')](),controller[_0xf71b('0x11')]);router[_0xf71b('0x12')](_0xf71b('0x13'),auth['isAuthenticated'](),controller[_0xf71b('0x14')]);router[_0xf71b('0x15')](_0xf71b('0x13'),auth[_0xf71b('0xa')](),controller['destroy']);module[_0xf71b('0x16')]=router;
\ No newline at end of file
index 675ddc8..5570350 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93f2=['setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE'];(function(_0xba6b88,_0x4f1e92){var _0x575135=function(_0x52cf18){while(--_0x52cf18){_0xba6b88['push'](_0xba6b88['shift']());}};_0x575135(++_0x4f1e92);}(_0x93f2,0x15d));var _0x293f=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x93f2[_0x2dadb9];return _0x2f0097;};'use strict';var moment=require(_0x293f('0x0'));var Sequelize=require('sequelize');module[_0x293f('0x1')]={'starttime':{'type':Sequelize[_0x293f('0x2')],'set':function(_0x3ffad9){this[_0x293f('0x3')](_0x293f('0x4'),_0x3ffad9);this['setDataValue'](_0x293f('0x5'),moment()['format'](_0x293f('0x6')));}},'endtime':{'type':Sequelize[_0x293f('0x2')]},'membername':{'type':Sequelize[_0x293f('0x7')]},'projectname':{'type':Sequelize[_0x293f('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x293f('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x293f('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x680d=['sequelize','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x513725,_0x5a5a17){var _0x5069ce=function(_0xf1d4e8){while(--_0xf1d4e8){_0x513725['push'](_0x513725['shift']());}};_0x5069ce(++_0x5a5a17);}(_0x680d,0x75));var _0xd680=function(_0x56eb37,_0x1101ec){_0x56eb37=_0x56eb37-0x0;var _0x22ae50=_0x680d[_0x56eb37];return _0x22ae50;};'use strict';var moment=require('moment');var Sequelize=require(_0xd680('0x0'));module[_0xd680('0x1')]={'starttime':{'type':Sequelize[_0xd680('0x2')],'set':function(_0x4f8565){this['setDataValue']('starttime',_0x4f8565);this[_0xd680('0x3')](_0xd680('0x4'),moment()[_0xd680('0x5')](_0xd680('0x6')));}},'endtime':{'type':Sequelize[_0xd680('0x2')]},'membername':{'type':Sequelize[_0xd680('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd680('0x7')]},'uniqueid':{'type':Sequelize[_0xd680('0x7')]},'calleridname':{'type':Sequelize[_0xd680('0x7')]},'calleridnum':{'type':Sequelize[_0xd680('0x7')]},'completed':{'type':Sequelize[_0xd680('0x8')],'defaultValue':![]}};
\ No newline at end of file
index 323e0ca..5a5d545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb60=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','describe','findOne','SessionId','JscriptyQuestionReport','rimraf','zip-dir','request-promise','moment','bluebird','path'];(function(_0x1fc14c,_0x533111){var _0x1a44b2=function(_0x317f98){while(--_0x317f98){_0x1fc14c['push'](_0x1fc14c['shift']());}};_0x1a44b2(++_0x533111);}(_0xfb60,0x9e));var _0x0fb6=function(_0xe196b9,_0x8cca03){_0xe196b9=_0xe196b9-0x0;var _0x35d0e4=_0xfb60[_0xe196b9];return _0x35d0e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fb6('0x0'));var zipdir=require(_0x0fb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fb6('0x2'));var moment=require(_0x0fb6('0x3'));var BPromise=require(_0x0fb6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0fb6('0x5'));var sox=require(_0x0fb6('0x6'));var csv=require(_0x0fb6('0x7'));var ejs=require(_0x0fb6('0x8'));var fs=require('fs');var fs_extra=require(_0x0fb6('0x9'));var _=require(_0x0fb6('0xa'));var squel=require(_0x0fb6('0xb'));var crypto=require(_0x0fb6('0xc'));var jsforce=require(_0x0fb6('0xd'));var deskjs=require(_0x0fb6('0xe'));var toCsv=require(_0x0fb6('0x7'));var querystring=require(_0x0fb6('0xf'));var Papa=require(_0x0fb6('0x10'));var Redis=require('ioredis');var authService=require(_0x0fb6('0x11'));var qs=require(_0x0fb6('0x12'));var as=require(_0x0fb6('0x13'));var hardwareService=require(_0x0fb6('0x14'));var logger=require(_0x0fb6('0x15'))(_0x0fb6('0x16'));var utils=require('../../config/utils');var config=require(_0x0fb6('0x17'));var licenseUtil=require(_0x0fb6('0x18'));var db=require(_0x0fb6('0x19'))['db'];function respondWithStatusCode(_0x39961c,_0x3cdc69){_0x3cdc69=_0x3cdc69||0xcc;return function(_0x2023ca){if(_0x2023ca){return _0x39961c[_0x0fb6('0x1a')](_0x3cdc69);}return _0x39961c[_0x0fb6('0x1b')](_0x3cdc69)[_0x0fb6('0x1c')]();};}function respondWithResult(_0x4b2919,_0x545788){_0x545788=_0x545788||0xc8;return function(_0xe5ff2d){if(_0xe5ff2d){return _0x4b2919[_0x0fb6('0x1b')](_0x545788)[_0x0fb6('0x1d')](_0xe5ff2d);}};}function respondWithFilteredResult(_0xf8efef,_0x580d34){return function(_0x30a8f6){if(_0x30a8f6){var _0x15288a=typeof _0x580d34[_0x0fb6('0x1e')]==='undefined'&&typeof _0x580d34['limit']===_0x0fb6('0x1f');var _0x4a2933=_0x30a8f6[_0x0fb6('0x20')];var _0xea93e4=_0x15288a?0x0:_0x580d34[_0x0fb6('0x1e')];var _0x7853bf=_0x15288a?_0x30a8f6[_0x0fb6('0x20')]:_0x580d34[_0x0fb6('0x1e')]+_0x580d34[_0x0fb6('0x21')];var _0x1f39d1;if(_0x7853bf>=_0x4a2933){_0x7853bf=_0x4a2933;_0x1f39d1=0xc8;}else{_0x1f39d1=0xce;}_0xf8efef[_0x0fb6('0x1b')](_0x1f39d1);return _0xf8efef[_0x0fb6('0x22')](_0x0fb6('0x23'),_0xea93e4+'-'+_0x7853bf+'/'+_0x4a2933)[_0x0fb6('0x1d')](_0x30a8f6);}return null;};}function patchUpdates(_0x347d1d){return function(_0x541411){try{jsonpatch[_0x0fb6('0x24')](_0x541411,_0x347d1d,!![]);}catch(_0x480985){return BPromise[_0x0fb6('0x25')](_0x480985);}return _0x541411[_0x0fb6('0x26')]();};}function saveUpdates(_0x5a6e90,_0x2c472e){return function(_0x1c89c7){if(_0x1c89c7){return _0x1c89c7[_0x0fb6('0x27')](_0x5a6e90)[_0x0fb6('0x28')](function(_0x39bcb0){return _0x39bcb0;});}return null;};}function removeEntity(_0x3dae89,_0x429e1b){return function(_0x79a063){if(_0x79a063){return _0x79a063[_0x0fb6('0x29')]()['then'](function(){_0x3dae89['status'](0xcc)[_0x0fb6('0x1c')]();});}};}function handleEntityNotFound(_0x51a959,_0xd83b9){return function(_0x59cd51){if(!_0x59cd51){_0x51a959[_0x0fb6('0x1a')](0x194);}return _0x59cd51;};}function handleError(_0xd22528,_0x249f20){_0x249f20=_0x249f20||0x1f4;return function(_0x4cfdbe){logger['error'](_0x4cfdbe['stack']);if(_0x4cfdbe[_0x0fb6('0x2a')]){delete _0x4cfdbe['name'];}_0xd22528['status'](_0x249f20)[_0x0fb6('0x2b')](_0x4cfdbe);};}exports[_0x0fb6('0x2c')]=function(_0x50418f,_0x8db0d3){var _0x2a4289={},_0x24d211={},_0x202392={'count':0x0,'rows':[]};var _0x49157f=_[_0x0fb6('0x2d')](db[_0x0fb6('0x2e')][_0x0fb6('0x2f')],function(_0xa2f71f){return{'name':_0xa2f71f[_0x0fb6('0x30')],'type':_0xa2f71f[_0x0fb6('0x31')]['key']};});_0x24d211['model']=_['map'](_0x49157f,_0x0fb6('0x2a'));_0x24d211[_0x0fb6('0x32')]=_[_0x0fb6('0x33')](_0x50418f[_0x0fb6('0x32')]);_0x24d211[_0x0fb6('0x34')]=_[_0x0fb6('0x35')](_0x24d211[_0x0fb6('0x36')],_0x24d211[_0x0fb6('0x32')]);_0x2a4289[_0x0fb6('0x37')]=_['intersection'](_0x24d211[_0x0fb6('0x36')],qs['fields'](_0x50418f[_0x0fb6('0x32')]['fields']));_0x2a4289[_0x0fb6('0x37')]=_0x2a4289[_0x0fb6('0x37')][_0x0fb6('0x38')]?_0x2a4289[_0x0fb6('0x37')]:_0x24d211['model'];if(!_0x50418f[_0x0fb6('0x32')][_0x0fb6('0x39')](_0x0fb6('0x3a'))){_0x2a4289['limit']=qs[_0x0fb6('0x21')](_0x50418f['query'][_0x0fb6('0x21')]);_0x2a4289[_0x0fb6('0x1e')]=qs[_0x0fb6('0x1e')](_0x50418f[_0x0fb6('0x32')][_0x0fb6('0x1e')]);}_0x2a4289[_0x0fb6('0x3b')]=qs[_0x0fb6('0x3c')](_0x50418f[_0x0fb6('0x32')][_0x0fb6('0x3c')]);_0x2a4289[_0x0fb6('0x3d')]=qs[_0x0fb6('0x34')](_[_0x0fb6('0x3e')](_0x50418f['query'],_0x24d211['filters']),_0x49157f);if(_0x50418f['query'][_0x0fb6('0x3f')]){_0x2a4289['where']=_[_0x0fb6('0x40')](_0x2a4289[_0x0fb6('0x3d')],{'$or':_['map'](_0x49157f,function(_0xc3aff6){if(_0xc3aff6[_0x0fb6('0x31')]!==_0x0fb6('0x41')){var _0x3feef4={};_0x3feef4[_0xc3aff6[_0x0fb6('0x2a')]]={'$like':'%'+_0x50418f[_0x0fb6('0x32')]['filter']+'%'};return _0x3feef4;}})});}_0x2a4289=_[_0x0fb6('0x40')]({},_0x2a4289,_0x50418f[_0x0fb6('0x42')]);var _0x550bef={'where':_0x2a4289[_0x0fb6('0x3d')]};return db['JscriptySessionReport'][_0x0fb6('0x20')](_0x550bef)[_0x0fb6('0x28')](function(_0x3e2a36){_0x202392[_0x0fb6('0x20')]=_0x3e2a36;if(_0x50418f['query'][_0x0fb6('0x43')]){_0x2a4289['include']=[{'all':!![]}];}return db[_0x0fb6('0x2e')][_0x0fb6('0x44')](_0x2a4289);})[_0x0fb6('0x28')](function(_0x8e4c71){_0x202392[_0x0fb6('0x45')]=_0x8e4c71;return _0x202392;})[_0x0fb6('0x28')](respondWithFilteredResult(_0x8db0d3,_0x2a4289))[_0x0fb6('0x46')](handleError(_0x8db0d3,null));};exports[_0x0fb6('0x47')]=function(_0x3b44eb,_0x2fd2d8){var _0xaeb18c={'raw':!![],'where':{'id':_0x3b44eb[_0x0fb6('0x48')]['id']}},_0x4cd492={};_0x4cd492[_0x0fb6('0x36')]=_[_0x0fb6('0x33')](db[_0x0fb6('0x2e')]['rawAttributes']);_0x4cd492[_0x0fb6('0x32')]=_[_0x0fb6('0x33')](_0x3b44eb[_0x0fb6('0x32')]);_0x4cd492[_0x0fb6('0x34')]=_[_0x0fb6('0x35')](_0x4cd492[_0x0fb6('0x36')],_0x4cd492[_0x0fb6('0x32')]);_0xaeb18c[_0x0fb6('0x37')]=_[_0x0fb6('0x35')](_0x4cd492[_0x0fb6('0x36')],qs[_0x0fb6('0x49')](_0x3b44eb[_0x0fb6('0x32')][_0x0fb6('0x49')]));_0xaeb18c[_0x0fb6('0x37')]=_0xaeb18c[_0x0fb6('0x37')]['length']?_0xaeb18c[_0x0fb6('0x37')]:_0x4cd492['model'];if(_0x3b44eb[_0x0fb6('0x32')][_0x0fb6('0x43')]){_0xaeb18c[_0x0fb6('0x4a')]=[{'all':!![]}];}_0xaeb18c=_[_0x0fb6('0x40')]({},_0xaeb18c,_0x3b44eb[_0x0fb6('0x42')]);return db[_0x0fb6('0x2e')][_0x0fb6('0x4b')](_0xaeb18c)[_0x0fb6('0x28')](handleEntityNotFound(_0x2fd2d8,null))['then'](respondWithResult(_0x2fd2d8,null))[_0x0fb6('0x46')](handleError(_0x2fd2d8,null));};exports[_0x0fb6('0x4c')]=function(_0x3035fb,_0x39525a){return db[_0x0fb6('0x2e')][_0x0fb6('0x4c')](_0x3035fb['body'],{})[_0x0fb6('0x28')](respondWithResult(_0x39525a,0xc9))[_0x0fb6('0x46')](handleError(_0x39525a,null));};exports[_0x0fb6('0x27')]=function(_0x4ca7d6,_0x2b6f8c){if(_0x4ca7d6['body']['id']){delete _0x4ca7d6[_0x0fb6('0x4d')]['id'];}return db[_0x0fb6('0x2e')]['find']({'where':{'id':_0x4ca7d6[_0x0fb6('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b6f8c,null))[_0x0fb6('0x28')](saveUpdates(_0x4ca7d6[_0x0fb6('0x4d')],null))[_0x0fb6('0x28')](respondWithResult(_0x2b6f8c,null))[_0x0fb6('0x46')](handleError(_0x2b6f8c,null));};exports['destroy']=function(_0xf82c18,_0xec9513){return db[_0x0fb6('0x2e')][_0x0fb6('0x4b')]({'where':{'id':_0xf82c18[_0x0fb6('0x48')]['id']}})['then'](handleEntityNotFound(_0xec9513,null))[_0x0fb6('0x28')](removeEntity(_0xec9513,null))['catch'](handleError(_0xec9513,null));};exports[_0x0fb6('0x4e')]=function(_0x3ce08c,_0x18bf94){return db['JscriptySessionReport']['describe']()[_0x0fb6('0x28')](respondWithResult(_0x18bf94,null))[_0x0fb6('0x46')](handleError(_0x18bf94,null));};exports['getQuestions']=function(_0x5bb985,_0x479fc2,_0x3e3ac7){var _0x5c226e={'raw':!![],'where':{}};var _0x3b7723={};var _0x248cab={'count':0x0,'rows':[]};return db[_0x0fb6('0x2e')][_0x0fb6('0x4f')]({'where':{'id':_0x5bb985[_0x0fb6('0x48')]['id']}})[_0x0fb6('0x28')](handleEntityNotFound(_0x479fc2,null))[_0x0fb6('0x28')](function(_0x7743c6){if(_0x7743c6){_0x3b7723['model']=_[_0x0fb6('0x33')](db['JscriptyQuestionReport'][_0x0fb6('0x2f')]);_0x3b7723['query']=_['keys'](_0x5bb985[_0x0fb6('0x32')]);_0x3b7723['filters']=_[_0x0fb6('0x35')](_0x3b7723[_0x0fb6('0x36')],_0x3b7723[_0x0fb6('0x32')]);_0x5c226e[_0x0fb6('0x37')]=_[_0x0fb6('0x35')](_0x3b7723[_0x0fb6('0x36')],qs['fields'](_0x5bb985[_0x0fb6('0x32')][_0x0fb6('0x49')]));_0x5c226e[_0x0fb6('0x37')]=_0x5c226e[_0x0fb6('0x37')]['length']?_0x5c226e[_0x0fb6('0x37')]:_0x3b7723[_0x0fb6('0x36')];if(!_0x5bb985[_0x0fb6('0x32')]['hasOwnProperty'](_0x0fb6('0x3a'))){_0x5c226e[_0x0fb6('0x21')]=qs['limit'](_0x5bb985[_0x0fb6('0x32')]['limit']);_0x5c226e[_0x0fb6('0x1e')]=qs[_0x0fb6('0x1e')](_0x5bb985[_0x0fb6('0x32')][_0x0fb6('0x1e')]);}_0x5c226e['order']=qs['sort'](_0x5bb985[_0x0fb6('0x32')][_0x0fb6('0x3c')]);_0x5c226e[_0x0fb6('0x3d')]=qs[_0x0fb6('0x34')](_[_0x0fb6('0x3e')](_0x5bb985[_0x0fb6('0x32')],_0x3b7723[_0x0fb6('0x34')]));_0x5c226e[_0x0fb6('0x3d')][_0x0fb6('0x50')]=_0x7743c6['id'];if(_0x5bb985[_0x0fb6('0x32')]['filter']){_0x5c226e[_0x0fb6('0x3d')]=_[_0x0fb6('0x40')](_0x5c226e[_0x0fb6('0x3d')],{'$or':_[_0x0fb6('0x2d')](_0x5c226e[_0x0fb6('0x37')],function(_0xa01ae5){var _0x560acd={};_0x560acd[_0xa01ae5]={'$like':'%'+_0x5bb985[_0x0fb6('0x32')]['filter']+'%'};return _0x560acd;})});}_0x5c226e=_['merge']({},_0x5c226e,_0x5bb985[_0x0fb6('0x42')]);return db[_0x0fb6('0x51')][_0x0fb6('0x20')]({'where':_0x5c226e['where']})['then'](function(_0x495015){_0x248cab[_0x0fb6('0x20')]=_0x495015;if(_0x5bb985[_0x0fb6('0x32')]['includeAll']){_0x5c226e[_0x0fb6('0x4a')]=[{'all':!![]}];}return db[_0x0fb6('0x51')][_0x0fb6('0x44')](_0x5c226e);})[_0x0fb6('0x28')](function(_0x5335bf){_0x248cab[_0x0fb6('0x45')]=_0x5335bf;return _0x248cab;});}})[_0x0fb6('0x28')](respondWithFilteredResult(_0x479fc2,_0x5c226e))['catch'](handleError(_0x479fc2,null));};
\ No newline at end of file
+var _0xde1e=['nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','show','params','keys','create','body','find','describe','JscriptyQuestionReport','SessionId','include','findAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','then','error','name','send','index','JscriptySessionReport','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x434cc4,_0x30c31e){var _0x3e5ac4=function(_0x3e40ab){while(--_0x3e40ab){_0x434cc4['push'](_0x434cc4['shift']());}};_0x3e5ac4(++_0x30c31e);}(_0xde1e,0x137));var _0xede1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xde1e[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xede1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xede1('0x1'));var jsonpatch=require(_0xede1('0x2'));var rp=require(_0xede1('0x3'));var moment=require('moment');var BPromise=require(_0xede1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xede1('0x5'));var sox=require(_0xede1('0x6'));var csv=require(_0xede1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xede1('0x8'));var _=require(_0xede1('0x9'));var squel=require('squel');var crypto=require(_0xede1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xede1('0xb'));var toCsv=require(_0xede1('0x7'));var querystring=require(_0xede1('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xede1('0xd'));var qs=require(_0xede1('0xe'));var as=require(_0xede1('0xf'));var hardwareService=require(_0xede1('0x10'));var logger=require(_0xede1('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xede1('0x12'));var licenseUtil=require(_0xede1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41d169,_0x1672f0){_0x1672f0=_0x1672f0||0xcc;return function(_0x24956f){if(_0x24956f){return _0x41d169[_0xede1('0x14')](_0x1672f0);}return _0x41d169[_0xede1('0x15')](_0x1672f0)[_0xede1('0x16')]();};}function respondWithResult(_0x110afa,_0x2df8b8){_0x2df8b8=_0x2df8b8||0xc8;return function(_0x123ae2){if(_0x123ae2){return _0x110afa['status'](_0x2df8b8)['json'](_0x123ae2);}};}function respondWithFilteredResult(_0x15bfe4,_0xa61b58){return function(_0x30029a){if(_0x30029a){var _0x26b843=typeof _0xa61b58[_0xede1('0x17')]==='undefined'&&typeof _0xa61b58['limit']===_0xede1('0x18');var _0xaae7de=_0x30029a[_0xede1('0x19')];var _0x33a3aa=_0x26b843?0x0:_0xa61b58['offset'];var _0x44b269=_0x26b843?_0x30029a[_0xede1('0x19')]:_0xa61b58['offset']+_0xa61b58[_0xede1('0x1a')];var _0x43b80f;if(_0x44b269>=_0xaae7de){_0x44b269=_0xaae7de;_0x43b80f=0xc8;}else{_0x43b80f=0xce;}_0x15bfe4[_0xede1('0x15')](_0x43b80f);return _0x15bfe4[_0xede1('0x1b')]('Content-Range',_0x33a3aa+'-'+_0x44b269+'/'+_0xaae7de)[_0xede1('0x1c')](_0x30029a);}return null;};}function patchUpdates(_0x97a015){return function(_0x1e69c7){try{jsonpatch[_0xede1('0x1d')](_0x1e69c7,_0x97a015,!![]);}catch(_0x2ff33d){return BPromise[_0xede1('0x1e')](_0x2ff33d);}return _0x1e69c7[_0xede1('0x1f')]();};}function saveUpdates(_0x41ee51,_0x22a39f){return function(_0xff93fb){if(_0xff93fb){return _0xff93fb[_0xede1('0x20')](_0x41ee51)['then'](function(_0x44d79a){return _0x44d79a;});}return null;};}function removeEntity(_0x17846d,_0x5bbcaa){return function(_0x1f8ce7){if(_0x1f8ce7){return _0x1f8ce7[_0xede1('0x21')]()[_0xede1('0x22')](function(){_0x17846d[_0xede1('0x15')](0xcc)[_0xede1('0x16')]();});}};}function handleEntityNotFound(_0x12f12b,_0x498b3e){return function(_0x25b42b){if(!_0x25b42b){_0x12f12b[_0xede1('0x14')](0x194);}return _0x25b42b;};}function handleError(_0x5459b7,_0x51b561){_0x51b561=_0x51b561||0x1f4;return function(_0x4956b7){logger[_0xede1('0x23')](_0x4956b7['stack']);if(_0x4956b7[_0xede1('0x24')]){delete _0x4956b7[_0xede1('0x24')];}_0x5459b7[_0xede1('0x15')](_0x51b561)[_0xede1('0x25')](_0x4956b7);};}exports[_0xede1('0x26')]=function(_0x171704,_0x55348d){var _0x1ee8d6={},_0x22dd0d={},_0x46cd3f={'count':0x0,'rows':[]};var _0x2200c2=_['map'](db[_0xede1('0x27')][_0xede1('0x28')],function(_0x191e25){return{'name':_0x191e25['fieldName'],'type':_0x191e25[_0xede1('0x29')]['key']};});_0x22dd0d[_0xede1('0x2a')]=_['map'](_0x2200c2,_0xede1('0x24'));_0x22dd0d[_0xede1('0x2b')]=_['keys'](_0x171704[_0xede1('0x2b')]);_0x22dd0d[_0xede1('0x2c')]=_[_0xede1('0x2d')](_0x22dd0d[_0xede1('0x2a')],_0x22dd0d['query']);_0x1ee8d6['attributes']=_['intersection'](_0x22dd0d[_0xede1('0x2a')],qs[_0xede1('0x2e')](_0x171704[_0xede1('0x2b')][_0xede1('0x2e')]));_0x1ee8d6[_0xede1('0x2f')]=_0x1ee8d6[_0xede1('0x2f')]['length']?_0x1ee8d6[_0xede1('0x2f')]:_0x22dd0d[_0xede1('0x2a')];if(!_0x171704['query'][_0xede1('0x30')](_0xede1('0x31'))){_0x1ee8d6[_0xede1('0x1a')]=qs[_0xede1('0x1a')](_0x171704[_0xede1('0x2b')]['limit']);_0x1ee8d6[_0xede1('0x17')]=qs['offset'](_0x171704[_0xede1('0x2b')][_0xede1('0x17')]);}_0x1ee8d6[_0xede1('0x32')]=qs[_0xede1('0x33')](_0x171704['query'][_0xede1('0x33')]);_0x1ee8d6[_0xede1('0x34')]=qs['filters'](_['pick'](_0x171704[_0xede1('0x2b')],_0x22dd0d[_0xede1('0x2c')]),_0x2200c2);if(_0x171704[_0xede1('0x2b')][_0xede1('0x35')]){_0x1ee8d6['where']=_[_0xede1('0x36')](_0x1ee8d6[_0xede1('0x34')],{'$or':_[_0xede1('0x37')](_0x2200c2,function(_0x53023a){if(_0x53023a[_0xede1('0x29')]!==_0xede1('0x38')){var _0x443067={};_0x443067[_0x53023a[_0xede1('0x24')]]={'$like':'%'+_0x171704[_0xede1('0x2b')][_0xede1('0x35')]+'%'};return _0x443067;}})});}_0x1ee8d6=_[_0xede1('0x36')]({},_0x1ee8d6,_0x171704[_0xede1('0x39')]);var _0x385666={'where':_0x1ee8d6['where']};return db[_0xede1('0x27')][_0xede1('0x19')](_0x385666)[_0xede1('0x22')](function(_0x20a922){_0x46cd3f[_0xede1('0x19')]=_0x20a922;if(_0x171704[_0xede1('0x2b')][_0xede1('0x3a')]){_0x1ee8d6['include']=[{'all':!![]}];}return db[_0xede1('0x27')]['findAll'](_0x1ee8d6);})['then'](function(_0x587795){_0x46cd3f[_0xede1('0x3b')]=_0x587795;return _0x46cd3f;})['then'](respondWithFilteredResult(_0x55348d,_0x1ee8d6))[_0xede1('0x3c')](handleError(_0x55348d,null));};exports[_0xede1('0x3d')]=function(_0x19a597,_0x2ddc8e){var _0xde5bed={'raw':!![],'where':{'id':_0x19a597[_0xede1('0x3e')]['id']}},_0xdb57d3={};_0xdb57d3[_0xede1('0x2a')]=_[_0xede1('0x3f')](db['JscriptySessionReport'][_0xede1('0x28')]);_0xdb57d3[_0xede1('0x2b')]=_[_0xede1('0x3f')](_0x19a597[_0xede1('0x2b')]);_0xdb57d3[_0xede1('0x2c')]=_['intersection'](_0xdb57d3['model'],_0xdb57d3[_0xede1('0x2b')]);_0xde5bed['attributes']=_['intersection'](_0xdb57d3[_0xede1('0x2a')],qs[_0xede1('0x2e')](_0x19a597[_0xede1('0x2b')][_0xede1('0x2e')]));_0xde5bed['attributes']=_0xde5bed['attributes']['length']?_0xde5bed[_0xede1('0x2f')]:_0xdb57d3[_0xede1('0x2a')];if(_0x19a597[_0xede1('0x2b')][_0xede1('0x3a')]){_0xde5bed['include']=[{'all':!![]}];}_0xde5bed=_[_0xede1('0x36')]({},_0xde5bed,_0x19a597['options']);return db[_0xede1('0x27')]['find'](_0xde5bed)[_0xede1('0x22')](handleEntityNotFound(_0x2ddc8e,null))['then'](respondWithResult(_0x2ddc8e,null))[_0xede1('0x3c')](handleError(_0x2ddc8e,null));};exports[_0xede1('0x40')]=function(_0x4f5dbf,_0x5dc7a3){return db[_0xede1('0x27')]['create'](_0x4f5dbf[_0xede1('0x41')],{})['then'](respondWithResult(_0x5dc7a3,0xc9))[_0xede1('0x3c')](handleError(_0x5dc7a3,null));};exports['update']=function(_0x583cff,_0x5b029c){if(_0x583cff[_0xede1('0x41')]['id']){delete _0x583cff[_0xede1('0x41')]['id'];}return db[_0xede1('0x27')][_0xede1('0x42')]({'where':{'id':_0x583cff[_0xede1('0x3e')]['id']}})[_0xede1('0x22')](handleEntityNotFound(_0x5b029c,null))[_0xede1('0x22')](saveUpdates(_0x583cff[_0xede1('0x41')],null))[_0xede1('0x22')](respondWithResult(_0x5b029c,null))[_0xede1('0x3c')](handleError(_0x5b029c,null));};exports[_0xede1('0x21')]=function(_0x3d1f74,_0x1aa759){return db['JscriptySessionReport']['find']({'where':{'id':_0x3d1f74[_0xede1('0x3e')]['id']}})[_0xede1('0x22')](handleEntityNotFound(_0x1aa759,null))[_0xede1('0x22')](removeEntity(_0x1aa759,null))[_0xede1('0x3c')](handleError(_0x1aa759,null));};exports[_0xede1('0x43')]=function(_0x30f4f7,_0x421a99){return db[_0xede1('0x27')]['describe']()['then'](respondWithResult(_0x421a99,null))[_0xede1('0x3c')](handleError(_0x421a99,null));};exports['getQuestions']=function(_0x408fd,_0x31b937,_0x11c415){var _0x3dbac3={'raw':!![],'where':{}};var _0x4036ba={};var _0x17fe3b={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x408fd['params']['id']}})[_0xede1('0x22')](handleEntityNotFound(_0x31b937,null))[_0xede1('0x22')](function(_0x26dbbd){if(_0x26dbbd){_0x4036ba[_0xede1('0x2a')]=_[_0xede1('0x3f')](db[_0xede1('0x44')][_0xede1('0x28')]);_0x4036ba['query']=_[_0xede1('0x3f')](_0x408fd[_0xede1('0x2b')]);_0x4036ba[_0xede1('0x2c')]=_[_0xede1('0x2d')](_0x4036ba[_0xede1('0x2a')],_0x4036ba['query']);_0x3dbac3[_0xede1('0x2f')]=_[_0xede1('0x2d')](_0x4036ba[_0xede1('0x2a')],qs['fields'](_0x408fd[_0xede1('0x2b')][_0xede1('0x2e')]));_0x3dbac3['attributes']=_0x3dbac3[_0xede1('0x2f')]['length']?_0x3dbac3[_0xede1('0x2f')]:_0x4036ba[_0xede1('0x2a')];if(!_0x408fd[_0xede1('0x2b')][_0xede1('0x30')](_0xede1('0x31'))){_0x3dbac3[_0xede1('0x1a')]=qs[_0xede1('0x1a')](_0x408fd[_0xede1('0x2b')][_0xede1('0x1a')]);_0x3dbac3[_0xede1('0x17')]=qs[_0xede1('0x17')](_0x408fd['query']['offset']);}_0x3dbac3[_0xede1('0x32')]=qs[_0xede1('0x33')](_0x408fd[_0xede1('0x2b')]['sort']);_0x3dbac3[_0xede1('0x34')]=qs[_0xede1('0x2c')](_['pick'](_0x408fd[_0xede1('0x2b')],_0x4036ba['filters']));_0x3dbac3[_0xede1('0x34')][_0xede1('0x45')]=_0x26dbbd['id'];if(_0x408fd[_0xede1('0x2b')][_0xede1('0x35')]){_0x3dbac3[_0xede1('0x34')]=_[_0xede1('0x36')](_0x3dbac3[_0xede1('0x34')],{'$or':_[_0xede1('0x37')](_0x3dbac3[_0xede1('0x2f')],function(_0x3bb81d){var _0x555086={};_0x555086[_0x3bb81d]={'$like':'%'+_0x408fd[_0xede1('0x2b')][_0xede1('0x35')]+'%'};return _0x555086;})});}_0x3dbac3=_[_0xede1('0x36')]({},_0x3dbac3,_0x408fd[_0xede1('0x39')]);return db[_0xede1('0x44')][_0xede1('0x19')]({'where':_0x3dbac3['where']})[_0xede1('0x22')](function(_0x3c4198){_0x17fe3b[_0xede1('0x19')]=_0x3c4198;if(_0x408fd[_0xede1('0x2b')]['includeAll']){_0x3dbac3[_0xede1('0x46')]=[{'all':!![]}];}return db[_0xede1('0x44')][_0xede1('0x47')](_0x3dbac3);})[_0xede1('0x22')](function(_0x2e93bc){_0x17fe3b[_0xede1('0x3b')]=_0x2e93bc;return _0x17fe3b;});}})[_0xede1('0x22')](respondWithFilteredResult(_0x31b937,_0x3dbac3))[_0xede1('0x3c')](handleError(_0x31b937,null));};
\ No newline at end of file
index 0ae1b5b..706a7f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb138=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x123f2c,_0x239edb){var _0x1e32c2=function(_0x3d93b4){while(--_0x3d93b4){_0x123f2c['push'](_0x123f2c['shift']());}};_0x1e32c2(++_0x239edb);}(_0xb138,0x1dd));var _0x8b13=function(_0x216edc,_0x57df05){_0x216edc=_0x216edc-0x0;var _0x745d3e=_0xb138[_0x216edc];return _0x745d3e;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x57f891,_0x3bc045){var _0x59cdae=function(_0x3fad09){while(--_0x3fad09){_0x57f891['push'](_0x57f891['shift']());}};_0x59cdae(++_0x3bc045);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f9ada8..0a035c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['then','info','JscriptySessionReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x47ad4f,_0xefa6e1){var _0x441870=function(_0x47060b){while(--_0x47060b){_0x47ad4f['push'](_0x47ad4f['shift']());}};_0x441870(++_0xefa6e1);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
+var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1e8ce5,_0x41dada){var _0x121b86=function(_0xc499cc){while(--_0xc499cc){_0x1e8ce5['push'](_0x1e8ce5['shift']());}};_0x121b86(++_0x41dada);}(_0x66fa,0x117));var _0xa66f=function(_0x955a70,_0x3b24f3){_0x955a70=_0x955a70-0x0;var _0x327619=_0x66fa[_0x955a70];return _0x327619;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}
\ No newline at end of file
index d15afc6..7c89e96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe73d=['index','put','/:id','isAuthenticated','update','downloadLogFile','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get'];(function(_0x2fd342,_0x378154){var _0x332121=function(_0x5226af){while(--_0x5226af){_0x2fd342['push'](_0x2fd342['shift']());}};_0x332121(++_0x378154);}(_0xe73d,0x124));var _0xde73=function(_0x3ec95f,_0x5b0c1e){_0x3ec95f=_0x3ec95f-0x0;var _0x4c8e6b=_0xe73d[_0x3ec95f];return _0x4c8e6b;};'use strict';var multer=require('multer');var util=require(_0xde73('0x0'));var path=require('path');var timeout=require(_0xde73('0x1'));var express=require(_0xde73('0x2'));var router=express['Router']();var fs_extra=require(_0xde73('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xde73('0x4'));var config=require(_0xde73('0x5'));var controller=require(_0xde73('0x6'));router[_0xde73('0x7')]('/',controller[_0xde73('0x8')]);router[_0xde73('0x9')](_0xde73('0xa'),auth[_0xde73('0xb')](),controller[_0xde73('0xc')]);router[_0xde73('0x7')]('/download_log_file',auth[_0xde73('0xb')](),controller[_0xde73('0xd')]);module[_0xde73('0xe')]=router;
\ No newline at end of file
+var _0x2f40=['index','put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','express','../../components/interaction/service','../../config/environment','./license.controller','get'];(function(_0x397fc3,_0x2dcc51){var _0x17ba62=function(_0x8e7c66){while(--_0x8e7c66){_0x397fc3['push'](_0x397fc3['shift']());}};_0x17ba62(++_0x2dcc51);}(_0x2f40,0x149));var _0x02f4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2f40[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require(_0x02f4('0x0'));var path=require(_0x02f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x02f4('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x02f4('0x3'));var config=require(_0x02f4('0x4'));var controller=require(_0x02f4('0x5'));router[_0x02f4('0x6')]('/',controller[_0x02f4('0x7')]);router[_0x02f4('0x8')]('/:id',auth[_0x02f4('0x9')](),controller[_0x02f4('0xa')]);router[_0x02f4('0x6')](_0x02f4('0xb'),auth['isAuthenticated'](),controller[_0x02f4('0xc')]);module[_0x02f4('0xd')]=router;
\ No newline at end of file
index 5e648e2..6970db6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13ac=['INTEGER','exports','TEXT','STRING'];(function(_0x4c9ef3,_0x3f56b8){var _0x5cbff9=function(_0x958ec6){while(--_0x958ec6){_0x4c9ef3['push'](_0x4c9ef3['shift']());}};_0x5cbff9(++_0x3f56b8);}(_0x13ac,0xb9));var _0xc13a=function(_0x182048,_0x45f2ae){_0x182048=_0x182048-0x0;var _0xbdba26=_0x13ac[_0x182048];return _0xbdba26;};'use strict';var Sequelize=require('sequelize');module[_0xc13a('0x0')]={'license':{'type':Sequelize[_0xc13a('0x1')]},'data1':{'type':Sequelize[_0xc13a('0x2')]},'data2':{'type':Sequelize[_0xc13a('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xc13a('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xecc3=['STRING'];(function(_0x9f70d3,_0x3d6485){var _0x4893e5=function(_0x2ba91b){while(--_0x2ba91b){_0x9f70d3['push'](_0x9f70d3['shift']());}};_0x4893e5(++_0x3d6485);}(_0xecc3,0x1a3));var _0x3ecc=function(_0x4a28ae,_0x4c7d2d){_0x4a28ae=_0x4a28ae-0x0;var _0x5dac7b=_0xecc3[_0x4a28ae];return _0x5dac7b;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x3ecc('0x0')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cbc225e..5e53d84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6379=['squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','json','reject','then','error','stack','name','index','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','merge','options','catch','update','body','find','checkLicense','key','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','set','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash'];(function(_0x8d1200,_0x4e9108){var _0x281b71=function(_0x73c195){while(--_0x73c195){_0x8d1200['push'](_0x8d1200['shift']());}};_0x281b71(++_0x4e9108);}(_0x6379,0x79));var _0x9637=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0x6379[_0x53174f];return _0x1cbd1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9637('0x0'));var zipdir=require(_0x9637('0x1'));var jsonpatch=require(_0x9637('0x2'));var rp=require(_0x9637('0x3'));var moment=require(_0x9637('0x4'));var BPromise=require(_0x9637('0x5'));var Mustache=require(_0x9637('0x6'));var util=require('util');var path=require(_0x9637('0x7'));var sox=require('sox');var csv=require(_0x9637('0x8'));var ejs=require(_0x9637('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9637('0xa'));var squel=require(_0x9637('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9637('0xc'));var toCsv=require(_0x9637('0x8'));var querystring=require(_0x9637('0xd'));var Papa=require(_0x9637('0xe'));var Redis=require(_0x9637('0xf'));var authService=require(_0x9637('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9637('0x11'));var hardwareService=require(_0x9637('0x12'));var logger=require(_0x9637('0x13'))(_0x9637('0x14'));var utils=require('../../config/utils');var config=require(_0x9637('0x15'));var licenseUtil=require(_0x9637('0x16'));var db=require(_0x9637('0x17'))['db'];function respondWithStatusCode(_0x3f04ec,_0x585cbb){_0x585cbb=_0x585cbb||0xcc;return function(_0x12aa3f){if(_0x12aa3f){return _0x3f04ec[_0x9637('0x18')](_0x585cbb);}return _0x3f04ec[_0x9637('0x19')](_0x585cbb)['end']();};}function respondWithResult(_0x57cae5,_0x4bb2cc){_0x4bb2cc=_0x4bb2cc||0xc8;return function(_0x3e910a){if(_0x3e910a){return _0x57cae5[_0x9637('0x19')](_0x4bb2cc)['json'](_0x3e910a);}};}function respondWithFilteredResult(_0x2dcb5e,_0x5d8d02){return function(_0x1b2461){if(_0x1b2461){var _0x1b1660=typeof _0x5d8d02['offset']===_0x9637('0x1a')&&typeof _0x5d8d02['limit']===_0x9637('0x1a');var _0x5630b5=_0x1b2461[_0x9637('0x1b')];var _0x78c893=_0x1b1660?0x0:_0x5d8d02[_0x9637('0x1c')];var _0x57ff72=_0x1b1660?_0x1b2461['count']:_0x5d8d02[_0x9637('0x1c')]+_0x5d8d02[_0x9637('0x1d')];var _0x59d7f0;if(_0x57ff72>=_0x5630b5){_0x57ff72=_0x5630b5;_0x59d7f0=0xc8;}else{_0x59d7f0=0xce;}_0x2dcb5e[_0x9637('0x19')](_0x59d7f0);return _0x2dcb5e['set']('Content-Range',_0x78c893+'-'+_0x57ff72+'/'+_0x5630b5)[_0x9637('0x1e')](_0x1b2461);}return null;};}function patchUpdates(_0x27c9f9){return function(_0x17e79e){try{jsonpatch['apply'](_0x17e79e,_0x27c9f9,!![]);}catch(_0x39ee79){return BPromise[_0x9637('0x1f')](_0x39ee79);}return _0x17e79e['save']();};}function saveUpdates(_0x422fc4,_0x10c7ec){return function(_0x458942){if(_0x458942){return _0x458942['update'](_0x422fc4)[_0x9637('0x20')](function(_0x20aca7){return _0x20aca7;});}return null;};}function removeEntity(_0x2f4807,_0x13c513){return function(_0x5dbc85){if(_0x5dbc85){return _0x5dbc85['destroy']()['then'](function(){_0x2f4807[_0x9637('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fbe41,_0x48604f){return function(_0x411e80){if(!_0x411e80){_0x4fbe41[_0x9637('0x18')](0x194);}return _0x411e80;};}function handleError(_0x2814a9,_0x2a61e6){_0x2a61e6=_0x2a61e6||0x1f4;return function(_0x33d8d8){logger[_0x9637('0x21')](_0x33d8d8[_0x9637('0x22')]);if(_0x33d8d8[_0x9637('0x23')]){delete _0x33d8d8['name'];}_0x2814a9[_0x9637('0x19')](_0x2a61e6)['send'](_0x33d8d8);};}var utilLicense=require('../../config/license/util');exports[_0x9637('0x24')]=function(_0x2e06ce,_0x45b664){var _0x28e989={'raw':!![],'where':{'id':0x1}},_0x232824={};_0x232824[_0x9637('0x25')]=_[_0x9637('0x26')](db[_0x9637('0x27')][_0x9637('0x28')]);_0x232824[_0x9637('0x29')]=_[_0x9637('0x26')](_0x2e06ce[_0x9637('0x29')]);_0x232824[_0x9637('0x2a')]=_['intersection'](_0x232824[_0x9637('0x25')],_0x232824[_0x9637('0x29')]);_0x28e989[_0x9637('0x2b')]=_[_0x9637('0x2c')](_0x232824[_0x9637('0x25')],qs[_0x9637('0x2d')](_0x2e06ce['query'][_0x9637('0x2d')]));_0x28e989[_0x9637('0x2b')]=_0x28e989[_0x9637('0x2b')][_0x9637('0x2e')]?_0x28e989[_0x9637('0x2b')]:_0x232824[_0x9637('0x25')];_0x28e989=_[_0x9637('0x2f')]({},_0x28e989,_0x2e06ce[_0x9637('0x30')]);return utilLicense['getLicense'](_0x28e989)[_0x9637('0x20')](respondWithResult(_0x45b664,null))[_0x9637('0x31')](handleError(_0x45b664,null));};exports[_0x9637('0x32')]=function(_0xa07b18,_0x28ae9c){if(_0xa07b18[_0x9637('0x33')]['id']){delete _0xa07b18['body']['id'];}return db['License'][_0x9637('0x34')]({'where':{'id':_0xa07b18['params']['id']}})[_0x9637('0x20')](handleEntityNotFound(_0x28ae9c,null))[_0x9637('0x20')](function(_0x57c320){var _0x5c9b21=_0x57c320['get']({'plain':!![]});return utilLicense[_0x9637('0x35')](_0x5c9b21,_0xa07b18[_0x9637('0x33')][_0x9637('0x36')]);})[_0x9637('0x20')](function(_0x2d82d4){if(!_0x2d82d4['demo']){return saveUpdates(_0xa07b18[_0x9637('0x33')],null);}return _0x2d82d4;})[_0x9637('0x20')](respondWithResult(_0x28ae9c,null))['catch'](handleError(_0x28ae9c,null));};exports[_0x9637('0x37')]=function(_0x3c1833,_0x2e1014){var _0x20879f=_0x9637('0x38');var _0x1e0596=path[_0x9637('0x39')](_0x9637('0x3a'),'log',_0x9637('0x3b'),_0x20879f);_0x2e1014[_0x9637('0x3c')](_0x9637('0x3d'),'attachment;\x20filename='+_0x20879f);_0x2e1014[_0x9637('0x3e')](_0x9637('0x3f'),_0x9637('0x40'));_0x2e1014[_0x9637('0x41')](_0x1e0596);};
\ No newline at end of file
+var _0x67ec=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','body','find','params','checkLicense','demo','license-info.log','/var','log','setHeader','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash'];(function(_0x44cb0c,_0x5c52b9){var _0x3664b7=function(_0x2f23e6){while(--_0x2f23e6){_0x44cb0c['push'](_0x44cb0c['shift']());}};_0x3664b7(++_0x5c52b9);}(_0x67ec,0x1e6));var _0xc67e=function(_0x535e6b,_0x5c0c51){_0x535e6b=_0x535e6b-0x0;var _0x2701d7=_0x67ec[_0x535e6b];return _0x2701d7;};'use strict';var emlformat=require(_0xc67e('0x0'));var rimraf=require(_0xc67e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc67e('0x2'));var rp=require(_0xc67e('0x3'));var moment=require(_0xc67e('0x4'));var BPromise=require(_0xc67e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc67e('0x6'));var sox=require(_0xc67e('0x7'));var csv=require('to-csv');var ejs=require(_0xc67e('0x8'));var fs=require('fs');var fs_extra=require(_0xc67e('0x9'));var _=require(_0xc67e('0xa'));var squel=require(_0xc67e('0xb'));var crypto=require(_0xc67e('0xc'));var jsforce=require(_0xc67e('0xd'));var deskjs=require(_0xc67e('0xe'));var toCsv=require(_0xc67e('0xf'));var querystring=require(_0xc67e('0x10'));var Papa=require(_0xc67e('0x11'));var Redis=require(_0xc67e('0x12'));var authService=require(_0xc67e('0x13'));var qs=require(_0xc67e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc67e('0x15'));var logger=require(_0xc67e('0x16'))(_0xc67e('0x17'));var utils=require(_0xc67e('0x18'));var config=require(_0xc67e('0x19'));var licenseUtil=require(_0xc67e('0x1a'));var db=require(_0xc67e('0x1b'))['db'];function respondWithStatusCode(_0x397a4d,_0x1ec893){_0x1ec893=_0x1ec893||0xcc;return function(_0xa76613){if(_0xa76613){return _0x397a4d[_0xc67e('0x1c')](_0x1ec893);}return _0x397a4d[_0xc67e('0x1d')](_0x1ec893)['end']();};}function respondWithResult(_0x317799,_0x21879c){_0x21879c=_0x21879c||0xc8;return function(_0xa57f43){if(_0xa57f43){return _0x317799[_0xc67e('0x1d')](_0x21879c)[_0xc67e('0x1e')](_0xa57f43);}};}function respondWithFilteredResult(_0x441b20,_0x5e49e9){return function(_0x377b5b){if(_0x377b5b){var _0xc228b6=typeof _0x5e49e9[_0xc67e('0x1f')]===_0xc67e('0x20')&&typeof _0x5e49e9[_0xc67e('0x21')]===_0xc67e('0x20');var _0x347d1c=_0x377b5b[_0xc67e('0x22')];var _0x2c1fc6=_0xc228b6?0x0:_0x5e49e9[_0xc67e('0x1f')];var _0x40d0e2=_0xc228b6?_0x377b5b['count']:_0x5e49e9[_0xc67e('0x1f')]+_0x5e49e9[_0xc67e('0x21')];var _0x399a51;if(_0x40d0e2>=_0x347d1c){_0x40d0e2=_0x347d1c;_0x399a51=0xc8;}else{_0x399a51=0xce;}_0x441b20['status'](_0x399a51);return _0x441b20[_0xc67e('0x23')]('Content-Range',_0x2c1fc6+'-'+_0x40d0e2+'/'+_0x347d1c)[_0xc67e('0x1e')](_0x377b5b);}return null;};}function patchUpdates(_0x553d53){return function(_0x4adf5f){try{jsonpatch[_0xc67e('0x24')](_0x4adf5f,_0x553d53,!![]);}catch(_0x27970b){return BPromise['reject'](_0x27970b);}return _0x4adf5f['save']();};}function saveUpdates(_0x1f8928,_0x4447bc){return function(_0x866de9){if(_0x866de9){return _0x866de9[_0xc67e('0x25')](_0x1f8928)[_0xc67e('0x26')](function(_0x144d46){return _0x144d46;});}return null;};}function removeEntity(_0x1eaa23,_0x5cb1f4){return function(_0x436926){if(_0x436926){return _0x436926[_0xc67e('0x27')]()[_0xc67e('0x26')](function(){_0x1eaa23[_0xc67e('0x1d')](0xcc)[_0xc67e('0x28')]();});}};}function handleEntityNotFound(_0x4a7df2,_0x4136f4){return function(_0x3f8713){if(!_0x3f8713){_0x4a7df2['sendStatus'](0x194);}return _0x3f8713;};}function handleError(_0xdaaa0,_0x5c0fc6){_0x5c0fc6=_0x5c0fc6||0x1f4;return function(_0x16e4da){logger[_0xc67e('0x29')](_0x16e4da[_0xc67e('0x2a')]);if(_0x16e4da['name']){delete _0x16e4da[_0xc67e('0x2b')];}_0xdaaa0[_0xc67e('0x1d')](_0x5c0fc6)[_0xc67e('0x2c')](_0x16e4da);};}var utilLicense=require(_0xc67e('0x1a'));exports[_0xc67e('0x2d')]=function(_0x5bf0eb,_0x2b3ee7){var _0x181c04={'raw':!![],'where':{'id':0x1}},_0x337668={};_0x337668[_0xc67e('0x2e')]=_[_0xc67e('0x2f')](db[_0xc67e('0x30')][_0xc67e('0x31')]);_0x337668['query']=_[_0xc67e('0x2f')](_0x5bf0eb[_0xc67e('0x32')]);_0x337668[_0xc67e('0x33')]=_[_0xc67e('0x34')](_0x337668['model'],_0x337668[_0xc67e('0x32')]);_0x181c04[_0xc67e('0x35')]=_[_0xc67e('0x34')](_0x337668[_0xc67e('0x2e')],qs[_0xc67e('0x36')](_0x5bf0eb[_0xc67e('0x32')][_0xc67e('0x36')]));_0x181c04[_0xc67e('0x35')]=_0x181c04[_0xc67e('0x35')][_0xc67e('0x37')]?_0x181c04[_0xc67e('0x35')]:_0x337668['model'];_0x181c04=_[_0xc67e('0x38')]({},_0x181c04,_0x5bf0eb[_0xc67e('0x39')]);return utilLicense[_0xc67e('0x3a')](_0x181c04)[_0xc67e('0x26')](respondWithResult(_0x2b3ee7,null))['catch'](handleError(_0x2b3ee7,null));};exports['update']=function(_0x56347b,_0x3ba10e){if(_0x56347b['body']['id']){delete _0x56347b[_0xc67e('0x3b')]['id'];}return db[_0xc67e('0x30')][_0xc67e('0x3c')]({'where':{'id':_0x56347b[_0xc67e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3ba10e,null))[_0xc67e('0x26')](function(_0x3cbf9d){var _0x19b146=_0x3cbf9d['get']({'plain':!![]});return utilLicense[_0xc67e('0x3e')](_0x19b146,_0x56347b['body']['key']);})[_0xc67e('0x26')](function(_0x284711){if(!_0x284711[_0xc67e('0x3f')]){return saveUpdates(_0x56347b[_0xc67e('0x3b')],null);}return _0x284711;})[_0xc67e('0x26')](respondWithResult(_0x3ba10e,null))['catch'](handleError(_0x3ba10e,null));};exports['downloadLogFile']=function(_0x4b26d3,_0x1e680a){var _0x4e53e0=_0xc67e('0x40');var _0xb444e=path['join'](_0xc67e('0x41'),_0xc67e('0x42'),'xcally',_0x4e53e0);_0x1e680a[_0xc67e('0x43')]('Content-disposition',_0xc67e('0x44')+_0x4e53e0);_0x1e680a[_0xc67e('0x23')](_0xc67e('0x45'),_0xc67e('0x46'));_0x1e680a['download'](_0xb444e);};
\ No newline at end of file
index 691f071..e448ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c75=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','License','license'];(function(_0x43cc69,_0x401eea){var _0xde43ae=function(_0x43608f){while(--_0x43608f){_0x43cc69['push'](_0x43cc69['shift']());}};_0xde43ae(++_0x401eea);}(_0x8c75,0x18c));var _0x58c7=function(_0x56ca54,_0x2f017f){_0x56ca54=_0x56ca54-0x0;var _0x45dbb0=_0x8c75[_0x56ca54];return _0x45dbb0;};'use strict';var _=require('lodash');var util=require(_0x58c7('0x0'));var logger=require(_0x58c7('0x1'))(_0x58c7('0x2'));var moment=require(_0x58c7('0x3'));var BPromise=require('bluebird');var rp=require(_0x58c7('0x4'));var fs=require('fs');var path=require(_0x58c7('0x5'));var rimraf=require('rimraf');var config=require(_0x58c7('0x6'));var attributes=require('./license.attributes');module[_0x58c7('0x7')]=function(_0xb0eac9,_0x4f36b4){return _0xb0eac9[_0x58c7('0x8')](_0x58c7('0x9'),attributes,{'tableName':_0x58c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b41=['define','license','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x36f811,_0x11c494){var _0x303a8a=function(_0x2829a0){while(--_0x2829a0){_0x36f811['push'](_0x36f811['shift']());}};_0x303a8a(++_0x11c494);}(_0x8b41,0x141));var _0x18b4=function(_0x41d5d7,_0x48bf14){_0x41d5d7=_0x41d5d7-0x0;var _0x1a7fa3=_0x8b41[_0x41d5d7];return _0x1a7fa3;};'use strict';var _=require(_0x18b4('0x0'));var util=require('util');var logger=require(_0x18b4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x18b4('0x2'));var rp=require(_0x18b4('0x3'));var fs=require('fs');var path=require(_0x18b4('0x4'));var rimraf=require(_0x18b4('0x5'));var config=require(_0x18b4('0x6'));var attributes=require(_0x18b4('0x7'));module[_0x18b4('0x8')]=function(_0xf63e4,_0x448772){return _0xf63e4[_0x18b4('0x9')]('License',attributes,{'tableName':_0x18b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b1ff91e..bd1ff57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0fe=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','info'];(function(_0x19c80a,_0x210be1){var _0x2783f4=function(_0x69d3dc){while(--_0x69d3dc){_0x19c80a['push'](_0x19c80a['shift']());}};_0x2783f4(++_0x210be1);}(_0xc0fe,0xbd));var _0xec0f=function(_0x3114e4,_0x306fac){_0x3114e4=_0x3114e4-0x0;var _0x12f325=_0xc0fe[_0x3114e4];return _0x12f325;};'use strict';var _=require(_0xec0f('0x0'));var util=require(_0xec0f('0x1'));var moment=require('moment');var BPromise=require(_0xec0f('0x2'));var rs=require(_0xec0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xec0f('0x4'));var logger=require('../../config/logger')(_0xec0f('0x5'));var config=require('../../config/environment');var jayson=require(_0xec0f('0x6'));var client=jayson[_0xec0f('0x7')][_0xec0f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdd06f,_0x410b8e,_0x4652cb){return new BPromise(function(_0x5877c3,_0x10b37b){return client[_0xec0f('0x9')](_0xdd06f,_0x4652cb)['then'](function(_0x3d1ade){logger[_0xec0f('0xa')]('License,\x20%s,\x20%s',_0x410b8e,_0xec0f('0xb'));logger[_0xec0f('0xc')](_0xec0f('0xd'),_0x410b8e,_0xec0f('0xb'),JSON[_0xec0f('0xe')](_0x3d1ade));if(_0x3d1ade[_0xec0f('0xf')]){if(_0x3d1ade[_0xec0f('0xf')][_0xec0f('0x10')]===0x1f4){logger[_0xec0f('0xf')](_0xec0f('0x11'),_0x410b8e,_0x3d1ade[_0xec0f('0xf')]['message']);return _0x10b37b(_0x3d1ade[_0xec0f('0xf')][_0xec0f('0x12')]);}logger['error'](_0xec0f('0x11'),_0x410b8e,_0x3d1ade[_0xec0f('0xf')][_0xec0f('0x12')]);return _0x5877c3(_0x3d1ade[_0xec0f('0xf')][_0xec0f('0x12')]);}else{logger['info'](_0xec0f('0x11'),_0x410b8e,_0xec0f('0xb'));_0x5877c3(_0x3d1ade[_0xec0f('0x13')][_0xec0f('0x12')]);}})['catch'](function(_0x4a1be8){logger[_0xec0f('0xf')](_0xec0f('0x11'),_0x410b8e,_0x4a1be8);_0x10b37b(_0x4a1be8);});});}
\ No newline at end of file
+var _0x153b=['then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x323d4a,_0x42c21c){var _0x5efadc=function(_0x104d2e){while(--_0x104d2e){_0x323d4a['push'](_0x323d4a['shift']());}};_0x5efadc(++_0x42c21c);}(_0x153b,0x102));var _0xb153=function(_0x3abf4d,_0x2581eb){_0x3abf4d=_0x3abf4d-0x0;var _0x4c1d41=_0x153b[_0x3abf4d];return _0x4c1d41;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb153('0x0'));var fs=require('fs');var Redis=require(_0xb153('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xb153('0x2'));var logger=require(_0xb153('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb153('0x4'));var client=jayson[_0xb153('0x5')][_0xb153('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4033af,_0x9f0df2,_0x2e440a){return new BPromise(function(_0x466451,_0x5c3c9f){return client[_0xb153('0x7')](_0x4033af,_0x2e440a)[_0xb153('0x8')](function(_0x2edeb5){logger[_0xb153('0x9')]('License,\x20%s,\x20%s',_0x9f0df2,_0xb153('0xa'));logger[_0xb153('0xb')](_0xb153('0xc'),_0x9f0df2,_0xb153('0xa'),JSON[_0xb153('0xd')](_0x2edeb5));if(_0x2edeb5[_0xb153('0xe')]){if(_0x2edeb5[_0xb153('0xe')]['code']===0x1f4){logger[_0xb153('0xe')](_0xb153('0xf'),_0x9f0df2,_0x2edeb5[_0xb153('0xe')][_0xb153('0x10')]);return _0x5c3c9f(_0x2edeb5[_0xb153('0xe')]['message']);}logger[_0xb153('0xe')]('License,\x20%s,\x20%s',_0x9f0df2,_0x2edeb5['error'][_0xb153('0x10')]);return _0x466451(_0x2edeb5[_0xb153('0xe')][_0xb153('0x10')]);}else{logger['info'](_0xb153('0xf'),_0x9f0df2,_0xb153('0xa'));_0x466451(_0x2edeb5[_0xb153('0x11')]['message']);}})[_0xb153('0x12')](function(_0x54c89f){logger[_0xb153('0xe')](_0xb153('0xf'),_0x9f0df2,_0x54c89f);_0x5c3c9f(_0x54c89f);});});}
\ No newline at end of file
index bc120f0..fe58940 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a6b=['describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getSmtp','/:id/interactions','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','get','/describe','isAuthenticated'];(function(_0x1ace9c,_0xc832d3){var _0x322cb3=function(_0x5d9983){while(--_0x5d9983){_0x1ace9c['push'](_0x1ace9c['shift']());}};_0x322cb3(++_0xc832d3);}(_0x4a6b,0x7e));var _0xb4a6=function(_0x18d29b,_0x3034d2){_0x18d29b=_0x18d29b-0x0;var _0x3c354f=_0x4a6b[_0x18d29b];return _0x3c354f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb4a6('0x0'));var timeout=require(_0xb4a6('0x1'));var express=require('express');var router=express[_0xb4a6('0x2')]();var fs_extra=require(_0xb4a6('0x3'));var auth=require(_0xb4a6('0x4'));var interaction=require(_0xb4a6('0x5'));var config=require(_0xb4a6('0x6'));var controller=require(_0xb4a6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb4a6('0x8')]);router[_0xb4a6('0x9')](_0xb4a6('0xa'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0xc')]);router[_0xb4a6('0x9')](_0xb4a6('0xd'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0xe')]);router[_0xb4a6('0x9')]('/:id/dispositions',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0xf')]);router[_0xb4a6('0x9')](_0xb4a6('0x10'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x11')]);router[_0xb4a6('0x9')]('/:id/in_servers',auth[_0xb4a6('0xb')](),controller['getImap']);router[_0xb4a6('0x9')]('/:id/out_servers',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x12')]);router[_0xb4a6('0x9')](_0xb4a6('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xb4a6('0x9')]('/:id/applications',auth[_0xb4a6('0xb')](),controller['getApplications']);router['get'](_0xb4a6('0x14'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x15')]);router[_0xb4a6('0x9')]('/:id/verify',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x16')]);router[_0xb4a6('0x9')](_0xb4a6('0x17'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x18')]);router[_0xb4a6('0x19')](_0xb4a6('0x1a'),auth[_0xb4a6('0xb')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x1b')]);router[_0xb4a6('0x19')]('/',auth['isAuthenticated'](),controller[_0xb4a6('0x1c')]);router['post']('/:id/in_servers',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x1d')]);router['post'](_0xb4a6('0x1e'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x1f')]);router['post'](_0xb4a6('0x13'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x20')]);router[_0xb4a6('0x19')](_0xb4a6('0x21'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb4a6('0x19')](_0xb4a6('0x22'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x23')]);router['post'](_0xb4a6('0x17'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x24')]);router[_0xb4a6('0x25')](_0xb4a6('0xd'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x26')]);router[_0xb4a6('0x27')](_0xb4a6('0x1a'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x28')]);router['delete']('/:id/canned_answers',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x29')]);router[_0xb4a6('0x27')]('/:id/in_servers',auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x2a')]);router['delete'](_0xb4a6('0x1e'),auth[_0xb4a6('0xb')](),controller['removeSmtp']);router[_0xb4a6('0x27')](_0xb4a6('0xd'),auth[_0xb4a6('0xb')](),controller[_0xb4a6('0x2b')]);router['delete'](_0xb4a6('0x17'),auth['isAuthenticated'](),controller[_0xb4a6('0x2c')]);module[_0xb4a6('0x2d')]=router;
\ No newline at end of file
+var _0x64d3=['/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','addDisposition','post','/:id/canned_answers','addAnswer','create','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x14c36d,_0x22ec7e){var _0x2a0c41=function(_0xda0d24){while(--_0xda0d24){_0x14c36d['push'](_0x14c36d['shift']());}};_0x2a0c41(++_0x22ec7e);}(_0x64d3,0x121));var _0x364d=function(_0x1f8763,_0x3b44d6){_0x1f8763=_0x1f8763-0x0;var _0x4a4285=_0x64d3[_0x1f8763];return _0x4a4285;};'use strict';var multer=require(_0x364d('0x0'));var util=require(_0x364d('0x1'));var path=require('path');var timeout=require(_0x364d('0x2'));var express=require(_0x364d('0x3'));var router=express[_0x364d('0x4')]();var fs_extra=require(_0x364d('0x5'));var auth=require(_0x364d('0x6'));var interaction=require(_0x364d('0x7'));var config=require(_0x364d('0x8'));var controller=require(_0x364d('0x9'));router['get']('/',auth[_0x364d('0xa')](),controller[_0x364d('0xb')]);router['get'](_0x364d('0xc'),auth[_0x364d('0xa')](),controller[_0x364d('0xd')]);router[_0x364d('0xe')](_0x364d('0xf'),auth[_0x364d('0xa')](),controller[_0x364d('0x10')]);router[_0x364d('0xe')](_0x364d('0x11'),auth[_0x364d('0xa')](),controller[_0x364d('0x12')]);router[_0x364d('0xe')]('/:id/canned_answers',auth[_0x364d('0xa')](),controller[_0x364d('0x13')]);router[_0x364d('0xe')](_0x364d('0x14'),auth[_0x364d('0xa')](),controller[_0x364d('0x15')]);router[_0x364d('0xe')](_0x364d('0x16'),auth[_0x364d('0xa')](),controller[_0x364d('0x17')]);router[_0x364d('0xe')](_0x364d('0x18'),auth[_0x364d('0xa')](),controller[_0x364d('0x19')]);router[_0x364d('0xe')](_0x364d('0x1a'),auth[_0x364d('0xa')](),controller[_0x364d('0x1b')]);router[_0x364d('0xe')](_0x364d('0x1c'),auth[_0x364d('0xa')](),controller[_0x364d('0x1d')]);router['get'](_0x364d('0x1e'),auth[_0x364d('0xa')](),controller['verifySmtp']);router[_0x364d('0xe')](_0x364d('0x1f'),auth[_0x364d('0xa')](),controller['getAgents']);router['post'](_0x364d('0x11'),auth[_0x364d('0xa')](),controller[_0x364d('0x20')]);router[_0x364d('0x21')](_0x364d('0x22'),auth[_0x364d('0xa')](),controller[_0x364d('0x23')]);router[_0x364d('0x21')]('/',auth[_0x364d('0xa')](),controller[_0x364d('0x24')]);router[_0x364d('0x21')](_0x364d('0x14'),auth[_0x364d('0xa')](),controller['addImap']);router[_0x364d('0x21')](_0x364d('0x16'),auth[_0x364d('0xa')](),controller[_0x364d('0x25')]);router[_0x364d('0x21')]('/:id/interactions',auth[_0x364d('0xa')](),controller[_0x364d('0x26')]);router[_0x364d('0x21')](_0x364d('0x1a'),auth[_0x364d('0xa')](),controller[_0x364d('0x27')]);router[_0x364d('0x21')](_0x364d('0x28'),auth[_0x364d('0xa')](),controller[_0x364d('0x29')]);router['post']('/:id/users',auth[_0x364d('0xa')](),controller[_0x364d('0x2a')]);router['put'](_0x364d('0xf'),auth[_0x364d('0xa')](),controller[_0x364d('0x2b')]);router[_0x364d('0x2c')](_0x364d('0x11'),auth['isAuthenticated'](),controller[_0x364d('0x2d')]);router[_0x364d('0x2c')](_0x364d('0x22'),auth[_0x364d('0xa')](),controller['removeAnswers']);router[_0x364d('0x2c')](_0x364d('0x14'),auth[_0x364d('0xa')](),controller[_0x364d('0x2e')]);router['delete'](_0x364d('0x16'),auth[_0x364d('0xa')](),controller[_0x364d('0x2f')]);router[_0x364d('0x2c')]('/:id',auth[_0x364d('0xa')](),controller[_0x364d('0x30')]);router[_0x364d('0x2c')](_0x364d('0x1f'),auth[_0x364d('0xa')](),controller[_0x364d('0x31')]);module[_0x364d('0x32')]=router;
\ No newline at end of file
index 05a7274..6ab85a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ae1=['yahoo','outlook365','getDataValue','provider','custom','setDataValue','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','mandatoryDispositionPauseId','gmail','hotmail'];(function(_0x5e515c,_0x3319a7){var _0x4f3109=function(_0xc823f5){while(--_0xc823f5){_0x5e515c['push'](_0x5e515c['shift']());}};_0x4f3109(++_0x3319a7);}(_0x5ae1,0x1c8));var _0x15ae=function(_0x22c17e,_0x57d5c1){_0x22c17e=_0x22c17e-0x0;var _0x5b1961=_0x5ae1[_0x22c17e];return _0x5b1961;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x15ae('0x0')]},'name':{'type':Sequelize[_0x15ae('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x15ae('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x15ae('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x15ae('0x1')]},'markAsUnread':{'type':Sequelize[_0x15ae('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15ae('0x3')},'fontSize':{'type':Sequelize[_0x15ae('0x4')](0x2)[_0x15ae('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x15ae('0x1')],'defaultValue':function(){return _0x15ae('0x6');}},'notificationSound':{'type':Sequelize[_0x15ae('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x15ae('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x15ae('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x15ae('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15ae('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x15ae('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x15ae('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x15ae('0x2')],'defaultValue':![],'comment':_0x15ae('0x8'),'set':function(_0xfb9ac6){if(!_0xfb9ac6)this['setDataValue'](_0x15ae('0x9'),null);this['setDataValue']('mandatoryDisposition',_0xfb9ac6);}},'provider':{'type':Sequelize['ENUM'](_0x15ae('0xa'),_0x15ae('0xb'),_0x15ae('0xc'),_0x15ae('0xd')),'defaultValue':null,'get':function(){if(!this[_0x15ae('0xe')](_0x15ae('0xf')))return _0x15ae('0x10');return this[_0x15ae('0xe')](_0x15ae('0xf'));},'set':function(_0x440fb9){if(_0x440fb9===_0x15ae('0x10'))_0x440fb9=null;return this[_0x15ae('0x11')]('provider',_0x440fb9);}}};
\ No newline at end of file
+var _0x61b1=['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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','getDataValue','provider','custom','STRING','BOOLEAN','TEXT'];(function(_0x210d66,_0x546c9f){var _0x31bb7f=function(_0x7074bb){while(--_0x7074bb){_0x210d66['push'](_0x210d66['shift']());}};_0x31bb7f(++_0x546c9f);}(_0x61b1,0xcd));var _0x161b=function(_0x3d0528,_0x21a0b7){_0x3d0528=_0x3d0528-0x0;var _0x4ebb2d=_0x61b1[_0x3d0528];return _0x4ebb2d;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x161b('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x161b('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x161b('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x161b('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x161b('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x161b('0x2')]},'markAsUnread':{'type':Sequelize[_0x161b('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x161b('0x0')],'allowNull':![],'defaultValue':_0x161b('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x161b('0x2')],'defaultValue':function(){return _0x161b('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x161b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x161b('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x161b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x161b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x161b('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x161b('0x1')],'defaultValue':![],'comment':_0x161b('0x6'),'set':function(_0x5215a9){if(!_0x5215a9)this[_0x161b('0x7')](_0x161b('0x8'),null);this[_0x161b('0x7')](_0x161b('0x9'),_0x5215a9);}},'provider':{'type':Sequelize[_0x161b('0xa')](_0x161b('0xb'),_0x161b('0xc'),'yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this[_0x161b('0xd')](_0x161b('0xe')))return _0x161b('0xf');return this['getDataValue'](_0x161b('0xe'));},'set':function(_0x324284){if(_0x324284===_0x161b('0xf'))_0x324284=null;return this['setDataValue'](_0x161b('0xe'),_0x324284);}}};
\ No newline at end of file
index 2777156..8132a43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3671=['register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Pause','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','sort','ids','addAnswer','CannedAnswer','findOne','removeAnswers','key','isNil','active','description','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','stack','finally','sendStatus','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','root','server/files/attachments','basename','defaults','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./mailAccount.socket'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x3671,0x170));var _0x1367=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x3671[_0x4ded65];return _0x5864fb;};'use strict';var moment=require(_0x1367('0x0'));var BPromise=require(_0x1367('0x1'));var util=require(_0x1367('0x2'));var path=require(_0x1367('0x3'));var _=require(_0x1367('0x4'));var juice=require(_0x1367('0x5'));var Redis=require(_0x1367('0x6'));var qs=require(_0x1367('0x7'));var logger=require(_0x1367('0x8'))(_0x1367('0x9'));var config=require('../../config/environment');var db=require(_0x1367('0xa'))['db'];config[_0x1367('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1367('0xc'))(new Redis(config[_0x1367('0xb')]));require(_0x1367('0xd'))[_0x1367('0xe')](socket);var jayson=require(_0x1367('0xf'));var client=jayson[_0x1367('0x10')][_0x1367('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x5073be,_0x451804,_0x52b44f,_0x1503db){return new BPromise(function(_0x4a1034,_0x520a88){var _0x48fc70=_0x1503db||client;return _0x48fc70[_0x1367('0x12')](_0x5073be,_0x52b44f)[_0x1367('0x13')](function(_0x3333ef){logger[_0x1367('0x14')](_0x1367('0x15'),_0x451804,_0x1367('0x16'));logger[_0x1367('0x17')](_0x1367('0x18'),_0x451804,'request\x20sent',JSON[_0x1367('0x19')](_0x3333ef));if(_0x3333ef[_0x1367('0x1a')]){if(_0x3333ef[_0x1367('0x1a')][_0x1367('0x1b')]===0x1f4){logger[_0x1367('0x1a')](_0x1367('0x15'),_0x451804,_0x3333ef[_0x1367('0x1a')][_0x1367('0x1c')]);return _0x520a88(_0x3333ef[_0x1367('0x1a')]['message']);}logger[_0x1367('0x1a')]('MailAccount,\x20%s,\x20%s',_0x451804,_0x3333ef[_0x1367('0x1a')][_0x1367('0x1c')]);return _0x4a1034(_0x3333ef[_0x1367('0x1a')]['message']);}else{logger[_0x1367('0x14')](_0x1367('0x15'),_0x451804,_0x1367('0x16'));_0x4a1034(_0x3333ef[_0x1367('0x1d')][_0x1367('0x1c')]);}})['catch'](function(_0x31cd33){logger[_0x1367('0x1a')](_0x1367('0x15'),_0x451804,_0x31cd33);_0x520a88(_0x31cd33);});});}function respondWithStatusCode(_0x2002e1,_0x50f5a4){_0x50f5a4=_0x50f5a4||0xcc;return function(_0x4dfeba){if(_0x4dfeba){return _0x2002e1['sendStatus'](_0x50f5a4);}return _0x2002e1['status'](_0x50f5a4)[_0x1367('0x1e')]();};}function respondWithResult(_0x4ee05b,_0x5c0790){_0x5c0790=_0x5c0790||0xc8;return function(_0x1f7372){if(_0x1f7372){return _0x4ee05b['status'](_0x5c0790)[_0x1367('0x1f')](_0x1f7372);}};}function respondWithFilteredResult(_0x2833c6,_0x18a295){return function(_0x55cce5){if(_0x55cce5){var _0x51134e=typeof _0x18a295[_0x1367('0x20')]==='undefined'&&typeof _0x18a295[_0x1367('0x21')]===_0x1367('0x22');var _0x46b00c=_0x55cce5[_0x1367('0x23')];var _0x4cb04d=_0x51134e?0x0:_0x18a295[_0x1367('0x20')];var _0x6cda6a=_0x51134e?_0x55cce5['count']:_0x18a295[_0x1367('0x20')]+_0x18a295[_0x1367('0x21')];var _0x115f00;if(_0x6cda6a>=_0x46b00c){_0x6cda6a=_0x46b00c;_0x115f00=0xc8;}else{_0x115f00=0xce;}_0x2833c6[_0x1367('0x24')](_0x115f00);return _0x2833c6[_0x1367('0x25')](_0x1367('0x26'),_0x4cb04d+'-'+_0x6cda6a+'/'+_0x46b00c)[_0x1367('0x1f')](_0x55cce5);}return null;};}function saveUpdates(_0x137e57){return function(_0x25519f){if(_0x25519f){return _0x25519f[_0x1367('0x27')](_0x137e57)['then'](function(_0x532b91){return _0x532b91;});}return null;};}function removeEntity(_0x38832a){return function(_0x53fa00){if(_0x53fa00){return _0x53fa00[_0x1367('0x28')]()[_0x1367('0x13')](function(){var _0x45d024=_0x53fa00[_0x1367('0x29')]({'plain':!![]});var _0x3d2ead=_0x1367('0x2a');return db[_0x1367('0x2b')]['destroy']({'where':{'type':_0x3d2ead,'resourceId':_0x45d024['id']}})[_0x1367('0x13')](function(){return _0x53fa00;});})['then'](function(){_0x38832a['status'](0xcc)[_0x1367('0x1e')]();});}};}function handleEntityNotFound(_0x5ce3c7){return function(_0x4e3ec3){if(!_0x4e3ec3){_0x5ce3c7['sendStatus'](0x194);}return _0x4e3ec3;};}function handleError(_0x2143b4,_0x4094bd){_0x4094bd=_0x4094bd||0x1f4;return function(_0x2eb6ed){logger[_0x1367('0x1a')](_0x2eb6ed['stack']);if(_0x2eb6ed['name']){delete _0x2eb6ed['name'];}_0x2143b4[_0x1367('0x24')](_0x4094bd)[_0x1367('0x2c')](_0x2eb6ed);};}function getImapHost(_0x402ac1){switch(_0x402ac1){case _0x1367('0x2d'):return _0x1367('0x2e');case _0x1367('0x2f'):return _0x1367('0x30');case _0x1367('0x31'):return _0x1367('0x32');case _0x1367('0x33'):return'outlook.office365.com';}throw new Error(_0x1367('0x34'),_0x402ac1);}function getSmtpHost(_0x4e52d1){switch(_0x4e52d1){case _0x1367('0x2d'):return _0x1367('0x35');case _0x1367('0x2f'):return'smtp.mail.yahoo.com';case _0x1367('0x31'):return _0x1367('0x36');case _0x1367('0x33'):return'smtp.office365.com';}throw new Error(_0x1367('0x34'),_0x4e52d1);}function getAuthenticationOptions(_0x31b5ae,_0x13b69d){var _0x2be89a={};var _0x2655b6={};if(_0x31b5ae){_0x2be89a[_0x1367('0x37')]=_0x2655b6[_0x1367('0x37')]=_0x13b69d[_0x1367('0x38')];_0x2be89a[_0x1367('0x39')]=_0x2655b6[_0x1367('0x3a')]=_0x13b69d[_0x1367('0x39')];if(_0x13b69d[_0x1367('0x3b')]){_0x2be89a[_0x1367('0x3b')]=_0x2655b6[_0x1367('0x3b')]=!![];_0x2be89a[_0x1367('0x3c')]=_0x2655b6['CloudProviderId']=_0x13b69d['CloudProviderId'];_0x2be89a[_0x1367('0x39')]=_0x2655b6['pass']=null;}else{_0x2be89a[_0x1367('0x3c')]=_0x2655b6[_0x1367('0x3c')]=null;}_0x2be89a[_0x1367('0x3d')]=getImapHost(_0x31b5ae);_0x2be89a[_0x1367('0x3e')]=0x3e1;_0x2655b6[_0x1367('0x3d')]=getSmtpHost(_0x31b5ae);_0x2655b6[_0x1367('0x3e')]=0x24b;_0x2655b6[_0x1367('0x3f')]=![];_0x2be89a['service']=_0x2655b6[_0x1367('0x40')]=null;}else{if(_0x13b69d[_0x1367('0x41')]){_0x2be89a['user']=_0x2655b6[_0x1367('0x37')]=_0x13b69d[_0x1367('0x38')];_0x2be89a[_0x1367('0x39')]=_0x2655b6['pass']=_0x13b69d[_0x1367('0x39')];}else{_0x2be89a[_0x1367('0x41')]=_0x2655b6[_0x1367('0x41')]=![];_0x2be89a[_0x1367('0x37')]=_0x2655b6[_0x1367('0x37')]=null;_0x2be89a['password']=_0x2655b6[_0x1367('0x3a')]=null;}_0x2be89a[_0x1367('0x3d')]=_0x13b69d[_0x1367('0x42')][_0x1367('0x3d')];_0x2be89a[_0x1367('0x3e')]=_0x13b69d[_0x1367('0x42')][_0x1367('0x3e')];_0x2655b6['host']=_0x13b69d['Smtp'][_0x1367('0x3d')];_0x2655b6[_0x1367('0x3e')]=_0x13b69d['Smtp'][_0x1367('0x3e')];}return{'Imap':_0x2be89a,'Smtp':_0x2655b6};}exports[_0x1367('0x43')]=function(_0x36a3a6,_0x58cf9d){var _0x3aba78={'include':[{'model':db[_0x1367('0x44')],'as':_0x1367('0x42')},{'model':db[_0x1367('0x45')],'as':_0x1367('0x46')},{'model':db['Pause'],'as':_0x1367('0x47')}]},_0x10e83d={},_0x47aa7e={'count':0x0,'rows':[]};var _0x194fe2=_[_0x1367('0x48')](db[_0x1367('0x49')][_0x1367('0x4a')],function(_0x3e7dc5){return{'name':_0x3e7dc5[_0x1367('0x4b')],'type':_0x3e7dc5[_0x1367('0x4c')]['key']};});_0x10e83d[_0x1367('0x4d')]=_[_0x1367('0x48')](_0x194fe2,_0x1367('0x4e'));_0x10e83d[_0x1367('0x4f')]=_[_0x1367('0x50')](_0x36a3a6[_0x1367('0x4f')]);_0x10e83d['filters']=_[_0x1367('0x51')](_0x10e83d[_0x1367('0x4d')],_0x10e83d[_0x1367('0x4f')]);_0x3aba78[_0x1367('0x52')]=_[_0x1367('0x51')](_0x10e83d[_0x1367('0x4d')],qs[_0x1367('0x53')](_0x36a3a6['query']['fields']));_0x3aba78[_0x1367('0x52')]=_0x3aba78[_0x1367('0x52')][_0x1367('0x54')]?_0x3aba78['attributes']:_0x10e83d[_0x1367('0x4d')];if(!_0x36a3a6['query'][_0x1367('0x55')](_0x1367('0x56'))){_0x3aba78['limit']=qs[_0x1367('0x21')](_0x36a3a6[_0x1367('0x4f')][_0x1367('0x21')]);_0x3aba78[_0x1367('0x20')]=qs[_0x1367('0x20')](_0x36a3a6[_0x1367('0x4f')][_0x1367('0x20')]);}_0x3aba78[_0x1367('0x57')]=qs['sort'](_0x36a3a6[_0x1367('0x4f')]['sort']);_0x3aba78[_0x1367('0x58')]=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x36a3a6[_0x1367('0x4f')],_0x10e83d[_0x1367('0x59')]),_0x194fe2);if(_0x36a3a6[_0x1367('0x4f')][_0x1367('0x5b')]){_0x3aba78[_0x1367('0x58')]=_[_0x1367('0x5c')](_0x3aba78[_0x1367('0x58')],{'$or':_[_0x1367('0x48')](_0x194fe2,function(_0xf4652a){if(_0xf4652a[_0x1367('0x4c')]!==_0x1367('0x5d')){var _0x15109d={};_0x15109d[_0xf4652a[_0x1367('0x4e')]]={'$like':'%'+_0x36a3a6[_0x1367('0x4f')][_0x1367('0x5b')]+'%'};return _0x15109d;}})});}_0x3aba78=_[_0x1367('0x5c')]({},_0x3aba78,_0x36a3a6[_0x1367('0x5e')]);var _0x4b36b3={'where':_0x3aba78[_0x1367('0x58')]};return db[_0x1367('0x49')][_0x1367('0x23')](_0x4b36b3)['then'](function(_0x471084){_0x47aa7e[_0x1367('0x23')]=_0x471084;if(_0x36a3a6[_0x1367('0x4f')][_0x1367('0x5f')]){_0x3aba78[_0x1367('0x60')]=[{'all':!![]}];}return db['MailAccount'][_0x1367('0x61')](_0x3aba78);})[_0x1367('0x13')](function(_0x2f5b01){_0x47aa7e[_0x1367('0x62')]=_0x2f5b01;return _0x47aa7e;})[_0x1367('0x13')](respondWithFilteredResult(_0x58cf9d,_0x3aba78))[_0x1367('0x63')](handleError(_0x58cf9d,null));};exports[_0x1367('0x64')]=function(_0x584bff,_0x3037f3){var _0x3ef7b5={'raw':![],'where':{'id':_0x584bff[_0x1367('0x65')]['id']},'include':[{'model':db[_0x1367('0x44')],'as':_0x1367('0x42')},{'model':db[_0x1367('0x45')],'as':_0x1367('0x46')},{'model':db[_0x1367('0x66')],'as':_0x1367('0x47')}]},_0xc803fc={};_0xc803fc[_0x1367('0x4d')]=_['keys'](db['MailAccount'][_0x1367('0x4a')]);_0xc803fc['query']=_[_0x1367('0x50')](_0x584bff[_0x1367('0x4f')]);_0xc803fc[_0x1367('0x59')]=_[_0x1367('0x51')](_0xc803fc['model'],_0xc803fc['query']);_0x3ef7b5['attributes']=_[_0x1367('0x51')](_0xc803fc['model'],qs[_0x1367('0x53')](_0x584bff['query']['fields']));_0x3ef7b5[_0x1367('0x52')]=_0x3ef7b5[_0x1367('0x52')][_0x1367('0x54')]?_0x3ef7b5['attributes']:_0xc803fc[_0x1367('0x4d')];if(_0x584bff[_0x1367('0x4f')][_0x1367('0x5f')]){_0x3ef7b5[_0x1367('0x60')]=[{'all':!![]}];}_0x3ef7b5=_[_0x1367('0x5c')]({},_0x3ef7b5,_0x584bff[_0x1367('0x5e')]);return db[_0x1367('0x49')][_0x1367('0x67')](_0x3ef7b5)[_0x1367('0x13')](handleEntityNotFound(_0x3037f3,null))['then'](respondWithResult(_0x3037f3,null))[_0x1367('0x63')](handleError(_0x3037f3,null));};exports['update']=function(_0x4fb7f0,_0x5d4f20){if(_0x4fb7f0[_0x1367('0x68')]['id']){delete _0x4fb7f0[_0x1367('0x68')]['id'];}var _0xeab898=_0x4fb7f0['body'][_0x1367('0x69')]===_0x1367('0x6a')?null:_0x4fb7f0[_0x1367('0x68')][_0x1367('0x69')];var _0x40e8b7=_0x4fb7f0[_0x1367('0x68')][_0x1367('0x42')]||{};var _0x32049e=_0x4fb7f0[_0x1367('0x68')][_0x1367('0x46')]||{};if(_0xeab898){_0x40e8b7['host']=getImapHost(_0xeab898);_0x40e8b7[_0x1367('0x3e')]=0x3e1;_0x32049e[_0x1367('0x3d')]=getSmtpHost(_0xeab898);_0x32049e[_0x1367('0x3e')]=0x24b;_0x32049e[_0x1367('0x3f')]=![];}if(_0x32049e[_0x1367('0x3b')]){_0x32049e[_0x1367('0x3f')]=![];}else{_0x32049e[_0x1367('0x3c')]=null;}if(!_0x40e8b7['modernAuthentication'])_0x40e8b7[_0x1367('0x3c')]=null;_0x4fb7f0[_0x1367('0x68')][_0x1367('0x42')]=_0x40e8b7;_0x4fb7f0['body'][_0x1367('0x46')]=_0x32049e;return db['MailAccount'][_0x1367('0x67')]({'where':{'id':_0x4fb7f0[_0x1367('0x65')]['id']},'include':[{'model':db[_0x1367('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x1367('0x46')},{'model':db['Pause'],'as':_0x1367('0x47')}]})['then'](handleEntityNotFound(_0x5d4f20,null))['then'](function(_0x501d2a){if(!_0x501d2a)throw new Error(_0x1367('0x6b'));if(_0x501d2a[_0x1367('0x40')])delete _0x4fb7f0[_0x1367('0x68')][_0x1367('0x42')];return _0x501d2a;})[_0x1367('0x13')](saveUpdates(_0x4fb7f0[_0x1367('0x68')],null))[_0x1367('0x13')](function(_0x2273f6){if(!_0x4fb7f0[_0x1367('0x68')][_0x1367('0x42')])return _0x2273f6;return db[_0x1367('0x44')][_0x1367('0x27')](_0x4fb7f0['body'][_0x1367('0x42')],{'where':{'MailAccountId':_0x2273f6['id']}})[_0x1367('0x13')](function(){return _0x2273f6;});})[_0x1367('0x13')](function(_0x5ab40a){if(!_0x4fb7f0[_0x1367('0x68')][_0x1367('0x46')])return _0x5ab40a;return db[_0x1367('0x45')]['update'](_0x4fb7f0[_0x1367('0x68')][_0x1367('0x46')],{'where':{'MailAccountId':_0x5ab40a['id']}})[_0x1367('0x13')](function(){return _0x5ab40a;});})[_0x1367('0x13')](respondWithResult(_0x5d4f20,null))['catch'](handleError(_0x5d4f20,null));};exports[_0x1367('0x6c')]=function(_0x238466,_0x388a53){return db[_0x1367('0x49')]['describe']()['then'](respondWithResult(_0x388a53,null))[_0x1367('0x63')](handleError(_0x388a53,null));};exports[_0x1367('0x6d')]=function(_0x7a545f,_0x4f078a){if(_0x7a545f[_0x1367('0x68')]['id']){delete _0x7a545f[_0x1367('0x68')]['id'];}return db[_0x1367('0x49')]['find']({'where':{'id':_0x7a545f[_0x1367('0x65')]['id']}})['then'](handleEntityNotFound(_0x4f078a,null))[_0x1367('0x13')](function(_0xd7b939){if(_0xd7b939){_0x7a545f[_0x1367('0x68')][_0x1367('0x6e')]=_0xd7b939['id'];return db[_0x1367('0x6f')][_0x1367('0x70')](_0x7a545f[_0x1367('0x68')]);}})['then'](respondWithResult(_0x4f078a,null))[_0x1367('0x63')](handleError(_0x4f078a,null));};exports['getDispositions']=function(_0x2a437d,_0x4a3dfc){var _0x509262={'raw':![],'where':{}};var _0x140acc={};var _0x847e9c={'count':0x0,'rows':[]};return db[_0x1367('0x49')]['findOne']({'where':{'id':_0x2a437d[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x4a3dfc,null))[_0x1367('0x13')](function(_0x336ef4){if(_0x336ef4){_0x140acc['model']=_[_0x1367('0x50')](db[_0x1367('0x6f')][_0x1367('0x4a')]);_0x140acc[_0x1367('0x4f')]=_[_0x1367('0x50')](_0x2a437d[_0x1367('0x4f')]);_0x140acc['filters']=_[_0x1367('0x51')](_0x140acc[_0x1367('0x4d')],_0x140acc['query']);_0x509262[_0x1367('0x52')]=_[_0x1367('0x51')](_0x140acc[_0x1367('0x4d')],qs[_0x1367('0x53')](_0x2a437d[_0x1367('0x4f')]['fields']));_0x509262[_0x1367('0x52')]=_0x509262[_0x1367('0x52')][_0x1367('0x54')]?_0x509262[_0x1367('0x52')]:_0x140acc['model'];if(!_0x2a437d[_0x1367('0x4f')][_0x1367('0x55')](_0x1367('0x56'))){_0x509262[_0x1367('0x21')]=qs[_0x1367('0x21')](_0x2a437d[_0x1367('0x4f')][_0x1367('0x21')]);_0x509262[_0x1367('0x20')]=qs[_0x1367('0x20')](_0x2a437d[_0x1367('0x4f')][_0x1367('0x20')]);}_0x509262[_0x1367('0x57')]=qs['sort'](_0x2a437d[_0x1367('0x4f')][_0x1367('0x71')]);_0x509262[_0x1367('0x58')]=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x2a437d['query'],_0x140acc['filters']));_0x509262['where'][_0x1367('0x6e')]=_0x336ef4['id'];if(_0x2a437d[_0x1367('0x4f')][_0x1367('0x5b')]){_0x509262[_0x1367('0x58')]=_[_0x1367('0x5c')](_0x509262[_0x1367('0x58')],{'$or':_['map'](_0x509262[_0x1367('0x52')],function(_0x314d5e){var _0x203fdf={};_0x203fdf[_0x314d5e]={'$like':'%'+_0x2a437d[_0x1367('0x4f')][_0x1367('0x5b')]+'%'};return _0x203fdf;})});}_0x509262=_[_0x1367('0x5c')]({},_0x509262,_0x2a437d[_0x1367('0x5e')]);return db[_0x1367('0x6f')]['count']({'where':_0x509262[_0x1367('0x58')]})['then'](function(_0x2eb947){_0x847e9c[_0x1367('0x23')]=_0x2eb947;if(_0x2a437d[_0x1367('0x4f')]['includeAll']){_0x509262[_0x1367('0x60')]=[{'all':!![]}];}return db[_0x1367('0x6f')][_0x1367('0x61')](_0x509262);})[_0x1367('0x13')](function(_0x37bca9){_0x847e9c[_0x1367('0x62')]=_0x37bca9;return _0x847e9c;});}})[_0x1367('0x13')](respondWithFilteredResult(_0x4a3dfc,_0x509262))[_0x1367('0x63')](handleError(_0x4a3dfc,null));};exports['removeDispositions']=function(_0x3524db,_0x78eaaa){return db[_0x1367('0x49')][_0x1367('0x67')]({'where':{'id':_0x3524db[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x78eaaa,null))[_0x1367('0x13')](function(_0x302960){if(_0x302960){return _0x302960['removeDispositions'](_0x3524db[_0x1367('0x4f')][_0x1367('0x72')]);}})[_0x1367('0x13')](respondWithStatusCode(_0x78eaaa,null))[_0x1367('0x63')](handleError(_0x78eaaa,null));};exports[_0x1367('0x73')]=function(_0x266611,_0x206fa7){if(_0x266611['body']['id']){delete _0x266611[_0x1367('0x68')]['id'];}return db['MailAccount'][_0x1367('0x67')]({'where':{'id':_0x266611[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x206fa7,null))[_0x1367('0x13')](function(_0xf40808){if(_0xf40808){_0x266611[_0x1367('0x68')][_0x1367('0x6e')]=_0xf40808['id'];return db[_0x1367('0x74')][_0x1367('0x70')](_0x266611[_0x1367('0x68')]);}})[_0x1367('0x13')](respondWithResult(_0x206fa7,null))['catch'](handleError(_0x206fa7,null));};exports['getAnswers']=function(_0x354e1d,_0x2c971b){var _0x31d948={'raw':![],'where':{}};var _0x406cb1={};var _0x211c6a={'count':0x0,'rows':[]};return db['MailAccount'][_0x1367('0x75')]({'where':{'id':_0x354e1d[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x2c971b,null))['then'](function(_0x25d923){if(_0x25d923){_0x406cb1['model']=_[_0x1367('0x50')](db[_0x1367('0x74')][_0x1367('0x4a')]);_0x406cb1[_0x1367('0x4f')]=_[_0x1367('0x50')](_0x354e1d[_0x1367('0x4f')]);_0x406cb1[_0x1367('0x59')]=_[_0x1367('0x51')](_0x406cb1[_0x1367('0x4d')],_0x406cb1['query']);_0x31d948[_0x1367('0x52')]=_[_0x1367('0x51')](_0x406cb1[_0x1367('0x4d')],qs['fields'](_0x354e1d[_0x1367('0x4f')][_0x1367('0x53')]));_0x31d948[_0x1367('0x52')]=_0x31d948[_0x1367('0x52')][_0x1367('0x54')]?_0x31d948[_0x1367('0x52')]:_0x406cb1['model'];if(!_0x354e1d['query'][_0x1367('0x55')](_0x1367('0x56'))){_0x31d948[_0x1367('0x21')]=qs['limit'](_0x354e1d[_0x1367('0x4f')]['limit']);_0x31d948[_0x1367('0x20')]=qs[_0x1367('0x20')](_0x354e1d[_0x1367('0x4f')]['offset']);}_0x31d948[_0x1367('0x57')]=qs[_0x1367('0x71')](_0x354e1d[_0x1367('0x4f')][_0x1367('0x71')]);_0x31d948['where']=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x354e1d[_0x1367('0x4f')],_0x406cb1['filters']));_0x31d948[_0x1367('0x58')][_0x1367('0x6e')]=_0x25d923['id'];if(_0x354e1d[_0x1367('0x4f')][_0x1367('0x5b')]){_0x31d948['where']=_[_0x1367('0x5c')](_0x31d948[_0x1367('0x58')],{'$or':_['map'](_0x31d948[_0x1367('0x52')],function(_0x37ace6){var _0x47c8f8={};_0x47c8f8[_0x37ace6]={'$like':'%'+_0x354e1d[_0x1367('0x4f')][_0x1367('0x5b')]+'%'};return _0x47c8f8;})});}_0x31d948=_['merge']({},_0x31d948,_0x354e1d[_0x1367('0x5e')]);return db[_0x1367('0x74')][_0x1367('0x23')]({'where':_0x31d948[_0x1367('0x58')]})[_0x1367('0x13')](function(_0x53d837){_0x211c6a[_0x1367('0x23')]=_0x53d837;if(_0x354e1d[_0x1367('0x4f')][_0x1367('0x5f')]){_0x31d948[_0x1367('0x60')]=[{'all':!![]}];}return db[_0x1367('0x74')][_0x1367('0x61')](_0x31d948);})[_0x1367('0x13')](function(_0x5eb75e){_0x211c6a['rows']=_0x5eb75e;return _0x211c6a;});}})[_0x1367('0x13')](respondWithFilteredResult(_0x2c971b,_0x31d948))[_0x1367('0x63')](handleError(_0x2c971b,null));};exports[_0x1367('0x76')]=function(_0x31511b,_0x2733c4){return db[_0x1367('0x49')]['find']({'where':{'id':_0x31511b[_0x1367('0x65')]['id']}})['then'](handleEntityNotFound(_0x2733c4,null))[_0x1367('0x13')](function(_0x3d80c9){if(_0x3d80c9){return _0x3d80c9[_0x1367('0x76')](_0x31511b['query'][_0x1367('0x72')]);}})[_0x1367('0x13')](respondWithStatusCode(_0x2733c4,null))[_0x1367('0x63')](handleError(_0x2733c4,null));};exports[_0x1367('0x70')]=function(_0x2106f,_0x691989){var _0x537f83={'name':_0x2106f[_0x1367('0x68')][_0x1367('0x4e')],'key':_0x2106f[_0x1367('0x68')][_0x1367('0x77')],'provider':_0x2106f[_0x1367('0x68')][_0x1367('0x69')]===_0x1367('0x6a')?null:_0x2106f[_0x1367('0x68')][_0x1367('0x69')],'email':_0x2106f[_0x1367('0x68')]['email'],'ListId':_0x2106f[_0x1367('0x68')]['ListId'],'active':!_[_0x1367('0x78')](_0x2106f[_0x1367('0x68')][_0x1367('0x79')])?_0x2106f['body'][_0x1367('0x79')]:!![],'description':_0x2106f['body'][_0x1367('0x7a')]||null};var _0xfaa421=getAuthenticationOptions(_0x537f83[_0x1367('0x69')],_0x2106f[_0x1367('0x68')]);_0x537f83[_0x1367('0x42')]=_0xfaa421[_0x1367('0x42')];_0x537f83[_0x1367('0x46')]=_0xfaa421['Smtp'];return db[_0x1367('0x49')][_0x1367('0x70')](_0x537f83,{'include':[{'model':db[_0x1367('0x45')],'as':_0x1367('0x46')},{'model':db[_0x1367('0x44')],'as':'Imap'}]})[_0x1367('0x13')](function(_0x2076b2){var _0x33054c=_0x2106f['user'][_0x1367('0x29')]({'plain':!![]});if(!_0x33054c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33054c['role']===_0x1367('0x37')){var _0x1fe5e7=_0x2076b2['get']({'plain':!![]});return db[_0x1367('0x7b')][_0x1367('0x67')]({'where':{'name':'MailAccounts','userProfileId':_0x33054c['userProfileId']},'raw':!![]})[_0x1367('0x13')](function(_0x5826bc){if(_0x5826bc&&_0x5826bc['autoAssociation']===0x0){return db[_0x1367('0x2b')][_0x1367('0x70')]({'name':_0x1fe5e7[_0x1367('0x4e')],'resourceId':_0x1fe5e7['id'],'type':_0x5826bc[_0x1367('0x4e')],'sectionId':_0x5826bc['id']},{})[_0x1367('0x13')](function(){return _0x2076b2;});}else{return _0x2076b2;}})[_0x1367('0x63')](function(_0xcabc53){logger['error'](_0x1367('0x7c'),_0xcabc53);throw _0xcabc53;});}return _0x2076b2;})[_0x1367('0x13')](respondWithResult(_0x691989,0xc9))[_0x1367('0x63')](handleError(_0x691989,null));};exports[_0x1367('0x7d')]=function(_0x260f0f,_0x38fde5){return db[_0x1367('0x49')]['findOne']({'where':{'id':_0x260f0f['params']['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x38fde5,null))['then'](function(_0xf1f42b){if(_0xf1f42b){return _0xf1f42b[_0x1367('0x7d')]();}return null;})[_0x1367('0x13')](respondWithResult(_0x38fde5,null))[_0x1367('0x63')](handleError(_0x38fde5,null));};exports['addImap']=function(_0x4a8c78,_0x1a6806){if(_0x4a8c78[_0x1367('0x68')]['id']){delete _0x4a8c78[_0x1367('0x68')]['id'];}return db['MailAccount'][_0x1367('0x67')]({'where':{'id':_0x4a8c78[_0x1367('0x65')]['id']}})['then'](handleEntityNotFound(_0x1a6806,null))[_0x1367('0x13')](function(_0x49a6f9){if(_0x49a6f9){_0x4a8c78['body']['MailAccountId']=_0x49a6f9['id'];return db[_0x1367('0x44')]['create'](_0x4a8c78['body']);}})[_0x1367('0x13')](respondWithResult(_0x1a6806,null))[_0x1367('0x63')](handleError(_0x1a6806,null));};exports[_0x1367('0x7e')]=function(_0x2c613a,_0x4f8171){return db['MailAccount'][_0x1367('0x75')]({'where':{'id':_0x2c613a[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x4f8171,null))[_0x1367('0x13')](function(_0x367432){if(_0x367432){return _0x367432[_0x1367('0x7f')](null);}return null;})[_0x1367('0x13')](respondWithStatusCode(_0x4f8171,null))[_0x1367('0x63')](handleError(_0x4f8171,null));};exports[_0x1367('0x80')]=function(_0x2c8d10,_0x22d943){return db[_0x1367('0x49')][_0x1367('0x75')]({'where':{'id':_0x2c8d10['params']['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x22d943,null))['then'](function(_0x2cef57){if(_0x2cef57){return _0x2cef57[_0x1367('0x80')]();}return null;})[_0x1367('0x13')](respondWithResult(_0x22d943,null))[_0x1367('0x63')](handleError(_0x22d943,null));};exports[_0x1367('0x81')]=function(_0x39985e,_0x46d070){if(_0x39985e[_0x1367('0x68')]['id']){delete _0x39985e[_0x1367('0x68')]['id'];}return db[_0x1367('0x49')][_0x1367('0x67')]({'where':{'id':_0x39985e[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x46d070,null))[_0x1367('0x13')](function(_0x54a5c2){if(_0x54a5c2){_0x39985e[_0x1367('0x68')][_0x1367('0x6e')]=_0x54a5c2['id'];return db[_0x1367('0x45')][_0x1367('0x70')](_0x39985e[_0x1367('0x68')]);}})[_0x1367('0x13')](respondWithResult(_0x46d070,null))[_0x1367('0x63')](handleError(_0x46d070,null));};exports[_0x1367('0x82')]=function(_0x494805,_0x184a05){return db['MailAccount'][_0x1367('0x75')]({'where':{'id':_0x494805['params']['id']}})['then'](handleEntityNotFound(_0x184a05,null))['then'](function(_0x3d4440){if(_0x3d4440){return _0x3d4440[_0x1367('0x83')](null);}return null;})[_0x1367('0x13')](respondWithStatusCode(_0x184a05,null))[_0x1367('0x63')](handleError(_0x184a05,null));};exports['addInteraction']=function(_0x224566,_0x476714){return db[_0x1367('0x84')][_0x1367('0x67')]({'where':{'id':_0x224566[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x476714,null))[_0x1367('0x13')](function(_0xc6d14c){if(_0xc6d14c){return _0xc6d14c[_0x1367('0x85')](_0x224566['body'][_0x1367('0x72')],_[_0x1367('0x86')](_0x224566[_0x1367('0x68')],[_0x1367('0x72'),'id'])||{});}})[_0x1367('0x13')](respondWithResult(_0x476714,null))[_0x1367('0x63')](handleError(_0x476714,null));};exports['getInteractions']=function(_0x2f5fc6,_0x1dd378){var _0x229d95={'raw':![],'where':{}};var _0x2d24be={};var _0x1c3664={'count':0x0,'rows':[]};return db[_0x1367('0x49')]['findOne']({'where':{'id':_0x2f5fc6[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x1dd378,null))['then'](function(_0x168037){if(_0x168037){_0x2d24be[_0x1367('0x4d')]=_[_0x1367('0x50')](db[_0x1367('0x84')][_0x1367('0x4a')]);_0x2d24be[_0x1367('0x4f')]=_[_0x1367('0x50')](_0x2f5fc6[_0x1367('0x4f')]);_0x2d24be[_0x1367('0x59')]=_[_0x1367('0x51')](_0x2d24be[_0x1367('0x4d')],_0x2d24be[_0x1367('0x4f')]);_0x229d95[_0x1367('0x52')]=_[_0x1367('0x51')](_0x2d24be[_0x1367('0x4d')],qs[_0x1367('0x53')](_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x53')]));_0x229d95['attributes']=_0x229d95[_0x1367('0x52')][_0x1367('0x54')]?_0x229d95[_0x1367('0x52')]:_0x2d24be[_0x1367('0x4d')];if(!_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x55')](_0x1367('0x56'))){_0x229d95[_0x1367('0x21')]=qs[_0x1367('0x21')](_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x21')]);_0x229d95[_0x1367('0x20')]=qs[_0x1367('0x20')](_0x2f5fc6[_0x1367('0x4f')]['offset']);}_0x229d95['order']=qs[_0x1367('0x71')](_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x71')]);_0x229d95[_0x1367('0x58')]=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x2f5fc6[_0x1367('0x4f')],_0x2d24be['filters']));_0x229d95['where'][_0x1367('0x6e')]=_0x168037['id'];if(_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x5b')]){_0x229d95[_0x1367('0x58')]=_['merge'](_0x229d95[_0x1367('0x58')],{'$or':_[_0x1367('0x48')](_0x229d95[_0x1367('0x52')],function(_0x234903){var _0x7ab0ec={};_0x7ab0ec[_0x234903]={'$like':'%'+_0x2f5fc6[_0x1367('0x4f')]['filter']+'%'};return _0x7ab0ec;})});}_0x229d95=_[_0x1367('0x5c')]({},_0x229d95,_0x2f5fc6['options']);return db[_0x1367('0x84')][_0x1367('0x23')]({'where':_0x229d95[_0x1367('0x58')]})['then'](function(_0x5b7361){_0x1c3664[_0x1367('0x23')]=_0x5b7361;if(_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x5f')]){_0x229d95['include']=[{'model':db[_0x1367('0x87')],'as':'Contact','required':![]},{'model':db[_0x1367('0x88')],'as':_0x1367('0x89'),'attributes':[_0x1367('0x4e'),_0x1367('0x8a'),_0x1367('0x8b')],'required':![]},{'model':db[_0x1367('0x8c')],'as':'Tags','attributes':['id',_0x1367('0x4e'),_0x1367('0x8d')],'where':_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x8e')]?{'id':_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x8e')]}:undefined,'required':_0x2f5fc6[_0x1367('0x4f')][_0x1367('0x8e')]?!![]:![]}];}return db[_0x1367('0x84')][_0x1367('0x61')](_0x229d95);})['then'](function(_0x4f1c69){_0x1c3664['rows']=_0x4f1c69;return _0x1c3664;});}})[_0x1367('0x13')](respondWithFilteredResult(_0x1dd378,_0x229d95))[_0x1367('0x63')](handleError(_0x1dd378,null));};exports[_0x1367('0x8f')]=function addApplications(_0x167b72,_0x2ce0ad){var _0x3ca38a=_0x167b72[_0x1367('0x65')]['id'];var _0x4a593c=_0x167b72['body'];var _0x8c5095=0xc8;var _0x284fcd=null;return db[_0x1367('0x90')][_0x1367('0x91')]({'isolationLevel':db['sequelize'][_0x1367('0x92')][_0x1367('0x93')][_0x1367('0x94')]},function(_0x24c76f){return db['MailAccount']['findOne']({'where':{'id':_0x3ca38a},'transaction':_0x24c76f})[_0x1367('0x13')](function(_0x174560){if(_0x174560){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x3ca38a},'transaction':_0x24c76f})[_0x1367('0x13')](function(){var _0x4067eb=_[_0x1367('0x48')](_0x4a593c,function(_0x1a7849){_0x1a7849[_0x1367('0x6e')]=_0x3ca38a;return _0x1a7849;});return db[_0x1367('0x95')][_0x1367('0x96')](_0x4067eb,{'transaction':_0x24c76f});});}else{_0x8c5095=0x194;_0x284fcd=[];}});})['then'](function(){if(_0x8c5095!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x3ca38a},'order':'priority'})[_0x1367('0x13')](function(_0x4f5cda){_0x284fcd=_0x4f5cda;});}})[_0x1367('0x63')](function(_0x2ebe98){_0x8c5095=0x1f4;logger[_0x1367('0x1a')](_0x2ebe98[_0x1367('0x97')]);if(_0x2ebe98[_0x1367('0x4e')]){delete _0x2ebe98[_0x1367('0x4e')];}_0x284fcd=_0x2ebe98;})[_0x1367('0x98')](function(){if(_0x284fcd===null){_0x2ce0ad[_0x1367('0x99')](_0x8c5095);}else{if(_0x8c5095===0x1f4){_0x2ce0ad[_0x1367('0x24')](_0x8c5095)['send'](_0x284fcd);}else{_0x2ce0ad['status'](_0x8c5095)[_0x1367('0x1f')](_0x284fcd);}}});};exports[_0x1367('0x9a')]=function(_0x1798b5,_0x1feab2){var _0x326a78={};var _0x438759={};var _0x320067;var _0x34e037;return db[_0x1367('0x49')]['findOne']({'where':{'id':_0x1798b5[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x1feab2,null))[_0x1367('0x13')](function(_0x9d22eb){if(_0x9d22eb){_0x320067=_0x9d22eb;_0x438759[_0x1367('0x4d')]=_[_0x1367('0x50')](db[_0x1367('0x95')][_0x1367('0x4a')]);_0x438759['query']=_[_0x1367('0x50')](_0x1798b5[_0x1367('0x4f')]);_0x438759[_0x1367('0x59')]=_[_0x1367('0x51')](_0x438759[_0x1367('0x4d')],_0x438759['query']);_0x326a78['attributes']=_[_0x1367('0x51')](_0x438759[_0x1367('0x4d')],qs[_0x1367('0x53')](_0x1798b5[_0x1367('0x4f')][_0x1367('0x53')]));_0x326a78[_0x1367('0x52')]=_0x326a78['attributes']['length']?_0x326a78[_0x1367('0x52')]:_0x438759['model'];_0x326a78[_0x1367('0x57')]=qs[_0x1367('0x71')](_0x1798b5[_0x1367('0x4f')]['sort']);_0x326a78[_0x1367('0x58')]=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x1798b5[_0x1367('0x4f')],_0x438759[_0x1367('0x59')]));if(_0x1798b5[_0x1367('0x4f')]['filter']){_0x326a78[_0x1367('0x58')]=_[_0x1367('0x5c')](_0x326a78[_0x1367('0x58')],{'$or':_[_0x1367('0x48')](_0x326a78['attributes'],function(_0x17548f){var _0xb6f73b={};_0xb6f73b[_0x17548f]={'$like':'%'+_0x1798b5[_0x1367('0x4f')][_0x1367('0x5b')]+'%'};return _0xb6f73b;})});}_0x326a78=_[_0x1367('0x5c')]({},_0x326a78,_0x1798b5[_0x1367('0x5e')]);return _0x320067[_0x1367('0x9a')](_0x326a78);}})[_0x1367('0x13')](function(_0x541963){if(_0x541963){_0x34e037=_0x541963[_0x1367('0x54')];if(!_0x1798b5[_0x1367('0x4f')][_0x1367('0x55')]('nolimit')){_0x326a78[_0x1367('0x21')]=qs[_0x1367('0x21')](_0x1798b5['query'][_0x1367('0x21')]);_0x326a78[_0x1367('0x20')]=qs[_0x1367('0x20')](_0x1798b5['query'][_0x1367('0x20')]);}return _0x320067['getApplications'](_0x326a78);}})['then'](function(_0x1b3ca4){if(_0x1b3ca4){return _0x1b3ca4?{'count':_0x34e037,'rows':_0x1b3ca4}:null;}})[_0x1367('0x13')](respondWithResult(_0x1feab2,null))[_0x1367('0x63')](handleError(_0x1feab2,null));};exports['getMessages']=function(_0x587e3d,_0xae9753){var _0x42569c={'raw':!![],'where':{}};var _0x15dcf0={};var _0x22eb4a={'count':0x0,'rows':[]};return db[_0x1367('0x49')][_0x1367('0x75')]({'where':{'id':_0x587e3d[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0xae9753,null))[_0x1367('0x13')](function(_0x5bb705){if(_0x5bb705){_0x15dcf0['model']=_[_0x1367('0x50')](db['MailMessage'][_0x1367('0x4a')]);_0x15dcf0['query']=_['keys'](_0x587e3d['query']);_0x15dcf0[_0x1367('0x59')]=_[_0x1367('0x51')](_0x15dcf0['model'],_0x15dcf0[_0x1367('0x4f')]);_0x42569c[_0x1367('0x52')]=_['intersection'](_0x15dcf0[_0x1367('0x4d')],qs[_0x1367('0x53')](_0x587e3d[_0x1367('0x4f')]['fields']));_0x42569c['attributes']=_0x42569c['attributes'][_0x1367('0x54')]?_0x42569c[_0x1367('0x52')]:_0x15dcf0[_0x1367('0x4d')];if(!_0x587e3d['query'][_0x1367('0x55')](_0x1367('0x56'))){_0x42569c[_0x1367('0x21')]=qs[_0x1367('0x21')](_0x587e3d[_0x1367('0x4f')]['limit']);_0x42569c['offset']=qs['offset'](_0x587e3d[_0x1367('0x4f')][_0x1367('0x20')]);}_0x42569c[_0x1367('0x57')]=qs['sort'](_0x587e3d[_0x1367('0x4f')][_0x1367('0x71')]);_0x42569c[_0x1367('0x58')]=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x587e3d[_0x1367('0x4f')],_0x15dcf0[_0x1367('0x59')]));_0x42569c[_0x1367('0x58')][_0x1367('0x6e')]=_0x5bb705['id'];if(_0x587e3d[_0x1367('0x4f')][_0x1367('0x5b')]){_0x42569c[_0x1367('0x58')]=_['merge'](_0x42569c[_0x1367('0x58')],{'$or':_[_0x1367('0x48')](_0x42569c[_0x1367('0x52')],function(_0x6d5384){var _0x3bccd1={};_0x3bccd1[_0x6d5384]={'$like':'%'+_0x587e3d[_0x1367('0x4f')][_0x1367('0x5b')]+'%'};return _0x3bccd1;})});}if(_0x587e3d[_0x1367('0x4f')]['$gte']){var _0x8320c2=_0x587e3d[_0x1367('0x4f')][_0x1367('0x9b')][_0x1367('0x9c')](',');var _0x5c5d66={};_0x5c5d66[_0x8320c2[0x0]]={'$gte':moment(_0x8320c2[0x1])[_0x1367('0x9d')](_0x1367('0x9e'))};_0x42569c[_0x1367('0x58')]=_[_0x1367('0x5c')](_0x42569c[_0x1367('0x58')],_0x5c5d66);}_0x42569c=_[_0x1367('0x5c')]({},_0x42569c,_0x587e3d[_0x1367('0x5e')]);return db[_0x1367('0x9f')][_0x1367('0x23')]({'where':_0x42569c['where']})[_0x1367('0x13')](function(_0x22da1c){_0x22eb4a[_0x1367('0x23')]=_0x22da1c;if(_0x587e3d[_0x1367('0x4f')]['includeAll']){_0x42569c['include']=[{'all':!![]}];}return db['MailMessage'][_0x1367('0x61')](_0x42569c);})[_0x1367('0x13')](function(_0x42990e){if(_0x587e3d['query'][_0x1367('0xa0')]===_0x1367('0xa1')){for(var _0x38abaa=0x0;_0x38abaa<_0x42990e[_0x1367('0x54')];_0x38abaa++){_0x42990e[_0x38abaa]['body']=juice(_0x42990e[_0x38abaa][_0x1367('0x68')]);}}_0x22eb4a[_0x1367('0x62')]=_0x42990e;return _0x22eb4a;});}})[_0x1367('0x13')](respondWithFilteredResult(_0xae9753,_0x42569c))[_0x1367('0x63')](handleError(_0xae9753,null));};exports[_0x1367('0x2c')]=function(_0x5dacae,_0x4c548a){var _0x59e54e,_0x253c92={},_0x2568f8;if(_0x5dacae[_0x1367('0x68')]['to']){_0x2568f8=_0x5dacae[_0x1367('0x68')]['to'][_0x1367('0x9c')](',')[0x0];}return db[_0x1367('0x49')][_0x1367('0x67')]({'where':{'id':_0x5dacae['params']['id']},'include':[{'model':db[_0x1367('0xa2')],'as':_0x1367('0xa3'),'include':[{'model':db[_0x1367('0x87')],'as':_0x1367('0xa4'),'where':{'email':_0x2568f8},'limit':0x1,'order':[['updatedAt',_0x1367('0xa5')]]}]},{'model':db[_0x1367('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1367('0xa6')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x4c548a,null))[_0x1367('0x13')](function(_0x3cf1ec){if(!_0x3cf1ec)return;_0x59e54e=_0x3cf1ec;if(!_0x3cf1ec['Smtp'])throw new Error(_0x1367('0xa7'));if(_[_0x1367('0x78')](_0x5dacae[_0x1367('0x68')]['from'])){_0x5dacae[_0x1367('0x68')][_0x1367('0xa8')]=util['format']('%s\x20<%s>',_0x3cf1ec[_0x1367('0x4e')],_0x3cf1ec['email']||_0x3cf1ec['Smtp'][_0x1367('0x37')]);}if(_0x5dacae[_0x1367('0x68')][_0x1367('0xa9')]&&_0x5dacae[_0x1367('0x68')][_0x1367('0xa9')][_0x1367('0x54')]){for(var _0x50c0f8=0x0;_0x50c0f8<_0x5dacae[_0x1367('0x68')]['attachments'][_0x1367('0x54')];_0x50c0f8+=0x1){_0x5dacae[_0x1367('0x68')][_0x1367('0xa9')][_0x50c0f8]={'filename':_0x5dacae[_0x1367('0x68')][_0x1367('0xa9')][_0x50c0f8][_0x1367('0x4e')],'path':path['join'](config[_0x1367('0xaa')],_0x1367('0xab'),_0x5dacae[_0x1367('0x68')][_0x1367('0xa9')][_0x50c0f8][_0x1367('0xac')])};}}var _0x1e9814=_0x3cf1ec['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1e9814,'message':_0x5dacae[_0x1367('0x68')]});})[_0x1367('0x13')](function(_0x265a16){if(!_0x265a16)return;_0x253c92=_0x265a16;if(!_0x59e54e[_0x1367('0xa3')])throw new Error('List\x20not\x20found');if(_0x59e54e[_0x1367('0xa3')][_0x1367('0xa4')][_0x1367('0x54')])return _0x59e54e[_0x1367('0xa3')][_0x1367('0xa4')][0x0];return db[_0x1367('0x87')][_0x1367('0x70')](_[_0x1367('0xad')](_0x5dacae['body'],{'firstName':_0x5dacae[_0x1367('0x68')]['to'],'email':_0x5dacae['body']['to'],'phone':_0x5dacae[_0x1367('0x68')]['to'],'ListId':_0x59e54e[_0x1367('0xae')]}));})[_0x1367('0x13')](function(_0xfcb3c7){if(!_0xfcb3c7)return;var _0x278674={'UserId':_0x5dacae[_0x1367('0x37')]['id'],'ContactId':_0xfcb3c7['id'],'MailAccountId':_0x59e54e['id'],'inReplyTo':_0x253c92[_0x1367('0xaf')],'to':_0x5dacae[_0x1367('0x68')][_0x1367('0xa8')],'cc':_0x5dacae[_0x1367('0x68')]['cc'],'subject':_0x5dacae[_0x1367('0x68')][_0x1367('0xb0')],'attach':_0x5dacae[_0x1367('0x68')][_0x1367('0xb1')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x1367('0x9d')](_0x1367('0x9e')),'lastMsgDirection':_0x1367('0xb2'),'Messages':[_['merge'](_0x5dacae['body'],{'messageId':_0x253c92['messageId'],'sentAt':moment()[_0x1367('0x9d')](_0x1367('0x9e')),'read':!![],'MailAccountId':_0x59e54e['id'],'UserId':_0x5dacae['user']['id'],'ContactId':_0xfcb3c7['id']})]};if(_0x5dacae[_0x1367('0x68')][_0x1367('0xb3')]){_0x278674=_[_0x1367('0x5c')](_0x278674,_0x5dacae[_0x1367('0x68')][_0x1367('0xb3')]);}return db['MailInteraction']['create'](_0x278674,{'include':[{'model':db[_0x1367('0x9f')],'as':_0x1367('0xb4')}]});})[_0x1367('0x13')](respondWithResult(_0x4c548a,null))['catch'](handleError(_0x4c548a,null));};exports[_0x1367('0xb5')]=function(_0x1764ba,_0x1567d9){return db[_0x1367('0x49')][_0x1367('0x67')]({'where':{'id':_0x1764ba[_0x1367('0x65')]['id']},'include':[{'model':db[_0x1367('0x45')],'as':_0x1367('0x46'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1367('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1567d9,null))[_0x1367('0x13')](function(_0x69a95d){if(!_0x69a95d[_0x1367('0x46')])return;var _0x58a6b0=_0x69a95d['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x1367('0xb5'),{'account':_0x58a6b0});})[_0x1367('0x13')](respondWithResult(_0x1567d9,null))[_0x1367('0x63')](handleError(_0x1567d9,null));};exports[_0x1367('0x28')]=function(_0x321c41,_0x4e4c4b){return db[_0x1367('0x49')]['find']({'where':{'id':_0x321c41[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x4e4c4b,null))[_0x1367('0x13')](function(_0x155c82){if(_0x155c82&&_0x155c82[_0x1367('0x40')]){throw new db['Sequelize'][(_0x1367('0xb6'))](_0x1367('0xb7'));}return _0x155c82;})[_0x1367('0x13')](removeEntity(_0x4e4c4b,null))[_0x1367('0x63')](handleError(_0x4e4c4b,null));};exports[_0x1367('0xb8')]=function(_0x5a58d0,_0x5c4887){return db['MailAccount'][_0x1367('0x67')]({'where':{'id':_0x5a58d0[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x5c4887,null))[_0x1367('0x13')](function(_0x443d48){if(_0x443d48){return _0x443d48[_0x1367('0xb8')](_0x5a58d0[_0x1367('0x68')]['ids'],_[_0x1367('0x86')](_0x5a58d0[_0x1367('0x68')],[_0x1367('0x72'),'id'])||{})[_0x1367('0xb9')](function(_0x38cdbb){for(var _0x584494=0x0;_0x584494<_0x5a58d0[_0x1367('0x68')]['ids'][_0x1367('0x54')];_0x584494+=0x1){socket[_0x1367('0xba')](_0x1367('0xbb'),{'UserId':Number(_0x5a58d0[_0x1367('0x68')]['ids'][_0x584494]),'MailAccountId':Number(_0x5a58d0['params']['id'])});}return _0x38cdbb;});}})['then'](respondWithResult(_0x5c4887,null))[_0x1367('0x63')](handleError(_0x5c4887,null));};exports[_0x1367('0xbc')]=function(_0x185666,_0x34c1f6){return db['MailAccount'][_0x1367('0x67')]({'where':{'id':_0x185666[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0x34c1f6,null))[_0x1367('0x13')](function(_0x15e0a6){if(_0x15e0a6){return _0x15e0a6[_0x1367('0xbc')](_0x185666[_0x1367('0x4f')][_0x1367('0x72')])[_0x1367('0x13')](function(){if(_['isArray'](_0x185666[_0x1367('0x4f')][_0x1367('0x72')])){for(var _0x45f77e=0x0;_0x45f77e<_0x185666['query'][_0x1367('0x72')]['length'];_0x45f77e+=0x1){socket['emit'](_0x1367('0xbd'),{'UserId':Number(_0x185666[_0x1367('0x4f')]['ids'][_0x45f77e]),'MailAccountId':Number(_0x185666[_0x1367('0x65')]['id'])});}}else{socket[_0x1367('0xba')]('userMailAccount:remove',{'UserId':Number(_0x185666[_0x1367('0x4f')][_0x1367('0x72')]),'MailAccountId':Number(_0x185666[_0x1367('0x65')]['id'])});}});}})[_0x1367('0x13')](respondWithStatusCode(_0x34c1f6,null))['catch'](handleError(_0x34c1f6,null));};exports['getAgents']=function(_0x49ccf3,_0xae014){var _0x41f345={};var _0x2349d8={};var _0x257846;var _0x1b1f6a;return db[_0x1367('0x49')][_0x1367('0x75')]({'where':{'id':_0x49ccf3[_0x1367('0x65')]['id']}})[_0x1367('0x13')](handleEntityNotFound(_0xae014,null))[_0x1367('0x13')](function(_0x1a7a21){if(_0x1a7a21){_0x257846=_0x1a7a21;_0x2349d8[_0x1367('0x4d')]=_[_0x1367('0x50')](db[_0x1367('0x88')][_0x1367('0x4a')]);_0x2349d8[_0x1367('0x4f')]=_[_0x1367('0x50')](_0x49ccf3[_0x1367('0x4f')]);_0x2349d8[_0x1367('0x59')]=_[_0x1367('0x51')](_0x2349d8[_0x1367('0x4d')],_0x2349d8[_0x1367('0x4f')]);_0x41f345[_0x1367('0x52')]=_[_0x1367('0x51')](_0x2349d8['model'],qs['fields'](_0x49ccf3[_0x1367('0x4f')][_0x1367('0x53')]));_0x41f345[_0x1367('0x52')]=_0x41f345[_0x1367('0x52')]['length']?_0x41f345[_0x1367('0x52')]:_0x2349d8['model'];_0x41f345['order']=qs[_0x1367('0x71')](_0x49ccf3[_0x1367('0x4f')][_0x1367('0x71')]);_0x41f345[_0x1367('0x58')]=qs[_0x1367('0x59')](_[_0x1367('0x5a')](_0x49ccf3[_0x1367('0x4f')],_0x2349d8['filters']));if(_0x49ccf3['query'][_0x1367('0x5b')]){_0x41f345[_0x1367('0x58')]=_['merge'](_0x41f345[_0x1367('0x58')],{'$or':_[_0x1367('0x48')](_0x41f345[_0x1367('0x52')],function(_0x48ba5a){var _0x707a32={};_0x707a32[_0x48ba5a]={'$like':'%'+_0x49ccf3[_0x1367('0x4f')][_0x1367('0x5b')]+'%'};return _0x707a32;})});}_0x41f345=_['merge']({},_0x41f345,_0x49ccf3['options']);return _0x257846[_0x1367('0xbe')](_0x41f345);}})['then'](function(_0x1eb837){if(_0x1eb837){_0x1b1f6a=_0x1eb837[_0x1367('0x54')];if(!_0x49ccf3[_0x1367('0x4f')][_0x1367('0x55')](_0x1367('0x56'))){_0x41f345[_0x1367('0x21')]=qs[_0x1367('0x21')](_0x49ccf3[_0x1367('0x4f')][_0x1367('0x21')]);_0x41f345['offset']=qs[_0x1367('0x20')](_0x49ccf3[_0x1367('0x4f')]['offset']);}return _0x257846[_0x1367('0xbe')](_0x41f345);}})[_0x1367('0x13')](function(_0x305d23){if(_0x305d23){return _0x305d23?{'count':_0x1b1f6a,'rows':_0x305d23}:null;}})[_0x1367('0x13')](respondWithResult(_0xae014,null))[_0x1367('0x63')](handleError(_0xae014,null));};
\ No newline at end of file
+var _0x62fb=['offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','secure','service','authentication','host','Imap','Smtp','MailServerOut','Pause','map','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','catch','params','MailServerIn','mandatoryDispositionPause','rawAttributes','length','find','body','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','custom','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','email','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','path','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json'];(function(_0x1ac635,_0x1f57e7){var _0x54dc75=function(_0x245a90){while(--_0x245a90){_0x1ac635['push'](_0x1ac635['shift']());}};_0x54dc75(++_0x1f57e7);}(_0x62fb,0x16c));var _0xb62f=function(_0x273d18,_0x18642d){_0x273d18=_0x273d18-0x0;var _0x213d5a=_0x62fb[_0x273d18];return _0x213d5a;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xb62f('0x0'));var _=require(_0xb62f('0x1'));var juice=require('juice');var Redis=require(_0xb62f('0x2'));var qs=require(_0xb62f('0x3'));var logger=require('../../config/logger')(_0xb62f('0x4'));var config=require(_0xb62f('0x5'));var db=require('../../mysqldb')['db'];config[_0xb62f('0x6')]=_[_0xb62f('0x7')](config['redis'],{'host':_0xb62f('0x8'),'port':0x18eb});var socket=require(_0xb62f('0x9'))(new Redis(config['redis']));require(_0xb62f('0xa'))[_0xb62f('0xb')](socket);var jayson=require(_0xb62f('0xc'));var client=jayson[_0xb62f('0xd')][_0xb62f('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x36a34e,_0xefe6e4,_0x909960,_0x65f1a0){return new BPromise(function(_0x595873,_0xf7a357){var _0x1a6846=_0x65f1a0||client;return _0x1a6846[_0xb62f('0xf')](_0x36a34e,_0x909960)[_0xb62f('0x10')](function(_0x4870a7){logger[_0xb62f('0x11')](_0xb62f('0x12'),_0xefe6e4,_0xb62f('0x13'));logger[_0xb62f('0x14')](_0xb62f('0x15'),_0xefe6e4,'request\x20sent',JSON[_0xb62f('0x16')](_0x4870a7));if(_0x4870a7[_0xb62f('0x17')]){if(_0x4870a7['error'][_0xb62f('0x18')]===0x1f4){logger[_0xb62f('0x17')](_0xb62f('0x12'),_0xefe6e4,_0x4870a7[_0xb62f('0x17')][_0xb62f('0x19')]);return _0xf7a357(_0x4870a7['error']['message']);}logger['error'](_0xb62f('0x12'),_0xefe6e4,_0x4870a7[_0xb62f('0x17')][_0xb62f('0x19')]);return _0x595873(_0x4870a7[_0xb62f('0x17')][_0xb62f('0x19')]);}else{logger[_0xb62f('0x11')](_0xb62f('0x12'),_0xefe6e4,_0xb62f('0x13'));_0x595873(_0x4870a7['result'][_0xb62f('0x19')]);}})['catch'](function(_0x44a778){logger[_0xb62f('0x17')](_0xb62f('0x12'),_0xefe6e4,_0x44a778);_0xf7a357(_0x44a778);});});}function respondWithStatusCode(_0x1b93f6,_0x21abc6){_0x21abc6=_0x21abc6||0xcc;return function(_0x496ac9){if(_0x496ac9){return _0x1b93f6[_0xb62f('0x1a')](_0x21abc6);}return _0x1b93f6[_0xb62f('0x1b')](_0x21abc6)[_0xb62f('0x1c')]();};}function respondWithResult(_0x164842,_0xea750){_0xea750=_0xea750||0xc8;return function(_0x3bb9a1){if(_0x3bb9a1){return _0x164842[_0xb62f('0x1b')](_0xea750)[_0xb62f('0x1d')](_0x3bb9a1);}};}function respondWithFilteredResult(_0x48dcc5,_0xe34cde){return function(_0x2dd9d5){if(_0x2dd9d5){var _0x5e894a=typeof _0xe34cde[_0xb62f('0x1e')]===_0xb62f('0x1f')&&typeof _0xe34cde[_0xb62f('0x20')]===_0xb62f('0x1f');var _0x206155=_0x2dd9d5[_0xb62f('0x21')];var _0x31a54f=_0x5e894a?0x0:_0xe34cde['offset'];var _0x12dfbf=_0x5e894a?_0x2dd9d5[_0xb62f('0x21')]:_0xe34cde[_0xb62f('0x1e')]+_0xe34cde[_0xb62f('0x20')];var _0x27b695;if(_0x12dfbf>=_0x206155){_0x12dfbf=_0x206155;_0x27b695=0xc8;}else{_0x27b695=0xce;}_0x48dcc5[_0xb62f('0x1b')](_0x27b695);return _0x48dcc5[_0xb62f('0x22')](_0xb62f('0x23'),_0x31a54f+'-'+_0x12dfbf+'/'+_0x206155)[_0xb62f('0x1d')](_0x2dd9d5);}return null;};}function saveUpdates(_0x53906d){return function(_0x189ab7){if(_0x189ab7){return _0x189ab7[_0xb62f('0x24')](_0x53906d)[_0xb62f('0x10')](function(_0x12b237){return _0x12b237;});}return null;};}function removeEntity(_0x178d32){return function(_0x3fcba9){if(_0x3fcba9){return _0x3fcba9[_0xb62f('0x25')]()[_0xb62f('0x10')](function(){var _0x4f1301=_0x3fcba9[_0xb62f('0x26')]({'plain':!![]});var _0xd0c9ee=_0xb62f('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0xd0c9ee,'resourceId':_0x4f1301['id']}})[_0xb62f('0x10')](function(){return _0x3fcba9;});})['then'](function(){_0x178d32[_0xb62f('0x1b')](0xcc)[_0xb62f('0x1c')]();});}};}function handleEntityNotFound(_0x405150){return function(_0x4242d5){if(!_0x4242d5){_0x405150[_0xb62f('0x1a')](0x194);}return _0x4242d5;};}function handleError(_0x3efe9c,_0x1ff6dd){_0x1ff6dd=_0x1ff6dd||0x1f4;return function(_0x412a1d){logger[_0xb62f('0x17')](_0x412a1d[_0xb62f('0x28')]);if(_0x412a1d[_0xb62f('0x29')]){delete _0x412a1d['name'];}_0x3efe9c[_0xb62f('0x1b')](_0x1ff6dd)[_0xb62f('0x2a')](_0x412a1d);};}function getImapHost(_0x596fbe){switch(_0x596fbe){case _0xb62f('0x2b'):return _0xb62f('0x2c');case _0xb62f('0x2d'):return'imap.mail.yahoo.com';case _0xb62f('0x2e'):return _0xb62f('0x2f');case _0xb62f('0x30'):return _0xb62f('0x31');}throw new Error(_0xb62f('0x32'),_0x596fbe);}function getSmtpHost(_0x3a4907){switch(_0x3a4907){case _0xb62f('0x2b'):return _0xb62f('0x33');case _0xb62f('0x2d'):return _0xb62f('0x34');case _0xb62f('0x2e'):return _0xb62f('0x35');case _0xb62f('0x30'):return _0xb62f('0x36');}throw new Error(_0xb62f('0x32'),_0x3a4907);}function getAuthenticationOptions(_0x504496,_0x4f1a61){var _0x1414ea={};var _0x5138a5={};if(_0x504496){_0x1414ea[_0xb62f('0x37')]=_0x5138a5[_0xb62f('0x37')]=_0x4f1a61[_0xb62f('0x38')];_0x1414ea[_0xb62f('0x39')]=_0x5138a5[_0xb62f('0x3a')]=_0x4f1a61['password'];if(_0x4f1a61[_0xb62f('0x3b')]){_0x1414ea[_0xb62f('0x3b')]=_0x5138a5['modernAuthentication']=!![];_0x1414ea[_0xb62f('0x3c')]=_0x5138a5[_0xb62f('0x3c')]=_0x4f1a61[_0xb62f('0x3c')];_0x1414ea[_0xb62f('0x39')]=_0x5138a5[_0xb62f('0x3a')]=null;}else{_0x1414ea[_0xb62f('0x3c')]=_0x5138a5[_0xb62f('0x3c')]=null;}_0x1414ea['host']=getImapHost(_0x504496);_0x1414ea[_0xb62f('0x3d')]=0x3e1;_0x5138a5['host']=getSmtpHost(_0x504496);_0x5138a5['port']=0x24b;_0x5138a5[_0xb62f('0x3e')]=![];_0x1414ea['service']=_0x5138a5[_0xb62f('0x3f')]=null;}else{if(_0x4f1a61['authentication']){_0x1414ea['user']=_0x5138a5[_0xb62f('0x37')]=_0x4f1a61[_0xb62f('0x38')];_0x1414ea[_0xb62f('0x39')]=_0x5138a5[_0xb62f('0x3a')]=_0x4f1a61[_0xb62f('0x39')];}else{_0x1414ea['authentication']=_0x5138a5[_0xb62f('0x40')]=![];_0x1414ea[_0xb62f('0x37')]=_0x5138a5['user']=null;_0x1414ea[_0xb62f('0x39')]=_0x5138a5[_0xb62f('0x3a')]=null;}_0x1414ea[_0xb62f('0x41')]=_0x4f1a61[_0xb62f('0x42')][_0xb62f('0x41')];_0x1414ea[_0xb62f('0x3d')]=_0x4f1a61[_0xb62f('0x42')][_0xb62f('0x3d')];_0x5138a5[_0xb62f('0x41')]=_0x4f1a61[_0xb62f('0x43')][_0xb62f('0x41')];_0x5138a5[_0xb62f('0x3d')]=_0x4f1a61[_0xb62f('0x43')]['port'];}return{'Imap':_0x1414ea,'Smtp':_0x5138a5};}exports['index']=function(_0x5c667a,_0x29e2c5){var _0x4ca567={'include':[{'model':db['MailServerIn'],'as':_0xb62f('0x42')},{'model':db[_0xb62f('0x44')],'as':'Smtp'},{'model':db[_0xb62f('0x45')],'as':'mandatoryDispositionPause'}]},_0xd4ef2d={},_0x2ba687={'count':0x0,'rows':[]};var _0x47ef63=_[_0xb62f('0x46')](db['MailAccount']['rawAttributes'],function(_0x39dbe3){return{'name':_0x39dbe3['fieldName'],'type':_0x39dbe3[_0xb62f('0x47')][_0xb62f('0x48')]};});_0xd4ef2d['model']=_[_0xb62f('0x46')](_0x47ef63,'name');_0xd4ef2d[_0xb62f('0x49')]=_[_0xb62f('0x4a')](_0x5c667a[_0xb62f('0x49')]);_0xd4ef2d[_0xb62f('0x4b')]=_[_0xb62f('0x4c')](_0xd4ef2d[_0xb62f('0x4d')],_0xd4ef2d['query']);_0x4ca567['attributes']=_['intersection'](_0xd4ef2d[_0xb62f('0x4d')],qs[_0xb62f('0x4e')](_0x5c667a[_0xb62f('0x49')][_0xb62f('0x4e')]));_0x4ca567[_0xb62f('0x4f')]=_0x4ca567[_0xb62f('0x4f')]['length']?_0x4ca567[_0xb62f('0x4f')]:_0xd4ef2d[_0xb62f('0x4d')];if(!_0x5c667a[_0xb62f('0x49')][_0xb62f('0x50')](_0xb62f('0x51'))){_0x4ca567[_0xb62f('0x20')]=qs['limit'](_0x5c667a[_0xb62f('0x49')]['limit']);_0x4ca567['offset']=qs['offset'](_0x5c667a[_0xb62f('0x49')]['offset']);}_0x4ca567[_0xb62f('0x52')]=qs['sort'](_0x5c667a[_0xb62f('0x49')][_0xb62f('0x53')]);_0x4ca567['where']=qs[_0xb62f('0x4b')](_[_0xb62f('0x54')](_0x5c667a[_0xb62f('0x49')],_0xd4ef2d[_0xb62f('0x4b')]),_0x47ef63);if(_0x5c667a['query'][_0xb62f('0x55')]){_0x4ca567[_0xb62f('0x56')]=_[_0xb62f('0x57')](_0x4ca567[_0xb62f('0x56')],{'$or':_[_0xb62f('0x46')](_0x47ef63,function(_0x5a472d){if(_0x5a472d[_0xb62f('0x47')]!==_0xb62f('0x58')){var _0x5d8023={};_0x5d8023[_0x5a472d[_0xb62f('0x29')]]={'$like':'%'+_0x5c667a[_0xb62f('0x49')]['filter']+'%'};return _0x5d8023;}})});}_0x4ca567=_[_0xb62f('0x57')]({},_0x4ca567,_0x5c667a[_0xb62f('0x59')]);var _0x3587bb={'where':_0x4ca567[_0xb62f('0x56')]};return db[_0xb62f('0x5a')][_0xb62f('0x21')](_0x3587bb)[_0xb62f('0x10')](function(_0x44f084){_0x2ba687[_0xb62f('0x21')]=_0x44f084;if(_0x5c667a['query'][_0xb62f('0x5b')]){_0x4ca567[_0xb62f('0x5c')]=[{'all':!![]}];}return db[_0xb62f('0x5a')][_0xb62f('0x5d')](_0x4ca567);})['then'](function(_0x208339){_0x2ba687['rows']=_0x208339;return _0x2ba687;})[_0xb62f('0x10')](respondWithFilteredResult(_0x29e2c5,_0x4ca567))[_0xb62f('0x5e')](handleError(_0x29e2c5,null));};exports['show']=function(_0x44a541,_0x13875f){var _0x5556a1={'raw':![],'where':{'id':_0x44a541[_0xb62f('0x5f')]['id']},'include':[{'model':db[_0xb62f('0x60')],'as':_0xb62f('0x42')},{'model':db[_0xb62f('0x44')],'as':'Smtp'},{'model':db['Pause'],'as':_0xb62f('0x61')}]},_0x289f7b={};_0x289f7b[_0xb62f('0x4d')]=_[_0xb62f('0x4a')](db['MailAccount'][_0xb62f('0x62')]);_0x289f7b[_0xb62f('0x49')]=_['keys'](_0x44a541[_0xb62f('0x49')]);_0x289f7b[_0xb62f('0x4b')]=_[_0xb62f('0x4c')](_0x289f7b[_0xb62f('0x4d')],_0x289f7b[_0xb62f('0x49')]);_0x5556a1[_0xb62f('0x4f')]=_[_0xb62f('0x4c')](_0x289f7b[_0xb62f('0x4d')],qs[_0xb62f('0x4e')](_0x44a541['query'][_0xb62f('0x4e')]));_0x5556a1['attributes']=_0x5556a1[_0xb62f('0x4f')][_0xb62f('0x63')]?_0x5556a1[_0xb62f('0x4f')]:_0x289f7b[_0xb62f('0x4d')];if(_0x44a541[_0xb62f('0x49')][_0xb62f('0x5b')]){_0x5556a1[_0xb62f('0x5c')]=[{'all':!![]}];}_0x5556a1=_[_0xb62f('0x57')]({},_0x5556a1,_0x44a541[_0xb62f('0x59')]);return db['MailAccount'][_0xb62f('0x64')](_0x5556a1)[_0xb62f('0x10')](handleEntityNotFound(_0x13875f,null))[_0xb62f('0x10')](respondWithResult(_0x13875f,null))[_0xb62f('0x5e')](handleError(_0x13875f,null));};exports[_0xb62f('0x24')]=function(_0x2d5f99,_0x3820b2){if(_0x2d5f99[_0xb62f('0x65')]['id']){delete _0x2d5f99[_0xb62f('0x65')]['id'];}var _0x9ad7c6=_0x2d5f99[_0xb62f('0x65')][_0xb62f('0x66')]==='custom'?null:_0x2d5f99[_0xb62f('0x65')][_0xb62f('0x66')];var _0xda4c6=_0x2d5f99[_0xb62f('0x65')][_0xb62f('0x42')]||{};var _0x6f8b04=_0x2d5f99[_0xb62f('0x65')][_0xb62f('0x43')]||{};if(_0x9ad7c6){_0xda4c6[_0xb62f('0x41')]=getImapHost(_0x9ad7c6);_0xda4c6['port']=0x3e1;_0x6f8b04[_0xb62f('0x41')]=getSmtpHost(_0x9ad7c6);_0x6f8b04[_0xb62f('0x3d')]=0x24b;_0x6f8b04[_0xb62f('0x3e')]=![];}if(_0x6f8b04['modernAuthentication']){_0x6f8b04[_0xb62f('0x3e')]=![];}else{_0x6f8b04[_0xb62f('0x3c')]=null;}if(!_0xda4c6[_0xb62f('0x3b')])_0xda4c6[_0xb62f('0x3c')]=null;_0x2d5f99[_0xb62f('0x65')]['Imap']=_0xda4c6;_0x2d5f99[_0xb62f('0x65')]['Smtp']=_0x6f8b04;return db['MailAccount']['find']({'where':{'id':_0x2d5f99['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xb62f('0x42')},{'model':db['MailServerOut'],'as':_0xb62f('0x43')},{'model':db['Pause'],'as':_0xb62f('0x61')}]})[_0xb62f('0x10')](handleEntityNotFound(_0x3820b2,null))['then'](function(_0x42b630){if(!_0x42b630)throw new Error(_0xb62f('0x67'));if(_0x42b630[_0xb62f('0x3f')])delete _0x2d5f99['body'][_0xb62f('0x42')];return _0x42b630;})[_0xb62f('0x10')](saveUpdates(_0x2d5f99[_0xb62f('0x65')],null))['then'](function(_0x3680d4){if(!_0x2d5f99['body']['Imap'])return _0x3680d4;return db['MailServerIn'][_0xb62f('0x24')](_0x2d5f99[_0xb62f('0x65')][_0xb62f('0x42')],{'where':{'MailAccountId':_0x3680d4['id']}})[_0xb62f('0x10')](function(){return _0x3680d4;});})[_0xb62f('0x10')](function(_0xcd3912){if(!_0x2d5f99['body']['Smtp'])return _0xcd3912;return db[_0xb62f('0x44')][_0xb62f('0x24')](_0x2d5f99[_0xb62f('0x65')][_0xb62f('0x43')],{'where':{'MailAccountId':_0xcd3912['id']}})['then'](function(){return _0xcd3912;});})['then'](respondWithResult(_0x3820b2,null))[_0xb62f('0x5e')](handleError(_0x3820b2,null));};exports[_0xb62f('0x68')]=function(_0x39b212,_0x379e8a){return db['MailAccount']['describe']()['then'](respondWithResult(_0x379e8a,null))[_0xb62f('0x5e')](handleError(_0x379e8a,null));};exports[_0xb62f('0x69')]=function(_0x4c1de7,_0x1a34cd){if(_0x4c1de7['body']['id']){delete _0x4c1de7[_0xb62f('0x65')]['id'];}return db['MailAccount'][_0xb62f('0x64')]({'where':{'id':_0x4c1de7[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x1a34cd,null))[_0xb62f('0x10')](function(_0x27a75d){if(_0x27a75d){_0x4c1de7[_0xb62f('0x65')][_0xb62f('0x6a')]=_0x27a75d['id'];return db[_0xb62f('0x6b')][_0xb62f('0x6c')](_0x4c1de7[_0xb62f('0x65')]);}})[_0xb62f('0x10')](respondWithResult(_0x1a34cd,null))[_0xb62f('0x5e')](handleError(_0x1a34cd,null));};exports[_0xb62f('0x6d')]=function(_0x257fe3,_0x3f2cf4){var _0x529f32={'raw':![],'where':{}};var _0xcc50d9={};var _0x27dce2={'count':0x0,'rows':[]};return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x257fe3[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x3f2cf4,null))[_0xb62f('0x10')](function(_0x249758){if(_0x249758){_0xcc50d9['model']=_[_0xb62f('0x4a')](db[_0xb62f('0x6b')]['rawAttributes']);_0xcc50d9[_0xb62f('0x49')]=_[_0xb62f('0x4a')](_0x257fe3[_0xb62f('0x49')]);_0xcc50d9[_0xb62f('0x4b')]=_[_0xb62f('0x4c')](_0xcc50d9[_0xb62f('0x4d')],_0xcc50d9[_0xb62f('0x49')]);_0x529f32['attributes']=_[_0xb62f('0x4c')](_0xcc50d9[_0xb62f('0x4d')],qs[_0xb62f('0x4e')](_0x257fe3['query'][_0xb62f('0x4e')]));_0x529f32[_0xb62f('0x4f')]=_0x529f32['attributes'][_0xb62f('0x63')]?_0x529f32[_0xb62f('0x4f')]:_0xcc50d9[_0xb62f('0x4d')];if(!_0x257fe3[_0xb62f('0x49')]['hasOwnProperty']('nolimit')){_0x529f32[_0xb62f('0x20')]=qs[_0xb62f('0x20')](_0x257fe3[_0xb62f('0x49')][_0xb62f('0x20')]);_0x529f32['offset']=qs['offset'](_0x257fe3['query'][_0xb62f('0x1e')]);}_0x529f32[_0xb62f('0x52')]=qs[_0xb62f('0x53')](_0x257fe3[_0xb62f('0x49')][_0xb62f('0x53')]);_0x529f32[_0xb62f('0x56')]=qs['filters'](_['pick'](_0x257fe3[_0xb62f('0x49')],_0xcc50d9['filters']));_0x529f32[_0xb62f('0x56')][_0xb62f('0x6a')]=_0x249758['id'];if(_0x257fe3[_0xb62f('0x49')]['filter']){_0x529f32[_0xb62f('0x56')]=_['merge'](_0x529f32['where'],{'$or':_[_0xb62f('0x46')](_0x529f32[_0xb62f('0x4f')],function(_0xfc6b4d){var _0x55e10c={};_0x55e10c[_0xfc6b4d]={'$like':'%'+_0x257fe3[_0xb62f('0x49')]['filter']+'%'};return _0x55e10c;})});}_0x529f32=_[_0xb62f('0x57')]({},_0x529f32,_0x257fe3['options']);return db['Disposition'][_0xb62f('0x21')]({'where':_0x529f32[_0xb62f('0x56')]})[_0xb62f('0x10')](function(_0x4f3706){_0x27dce2['count']=_0x4f3706;if(_0x257fe3[_0xb62f('0x49')]['includeAll']){_0x529f32[_0xb62f('0x5c')]=[{'all':!![]}];}return db[_0xb62f('0x6b')]['findAll'](_0x529f32);})[_0xb62f('0x10')](function(_0x427405){_0x27dce2[_0xb62f('0x6f')]=_0x427405;return _0x27dce2;});}})[_0xb62f('0x10')](respondWithFilteredResult(_0x3f2cf4,_0x529f32))[_0xb62f('0x5e')](handleError(_0x3f2cf4,null));};exports[_0xb62f('0x70')]=function(_0x46d1a8,_0x2cdc7c){return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x46d1a8[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x2cdc7c,null))[_0xb62f('0x10')](function(_0x59b7e1){if(_0x59b7e1){return _0x59b7e1[_0xb62f('0x70')](_0x46d1a8['query']['ids']);}})[_0xb62f('0x10')](respondWithStatusCode(_0x2cdc7c,null))[_0xb62f('0x5e')](handleError(_0x2cdc7c,null));};exports[_0xb62f('0x71')]=function(_0x42c66f,_0x5bde12){if(_0x42c66f['body']['id']){delete _0x42c66f[_0xb62f('0x65')]['id'];}return db['MailAccount'][_0xb62f('0x64')]({'where':{'id':_0x42c66f[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x5bde12,null))[_0xb62f('0x10')](function(_0x2f103d){if(_0x2f103d){_0x42c66f[_0xb62f('0x65')][_0xb62f('0x6a')]=_0x2f103d['id'];return db[_0xb62f('0x72')][_0xb62f('0x6c')](_0x42c66f[_0xb62f('0x65')]);}})[_0xb62f('0x10')](respondWithResult(_0x5bde12,null))['catch'](handleError(_0x5bde12,null));};exports[_0xb62f('0x73')]=function(_0x387db0,_0x136e2a){var _0xb915a4={'raw':![],'where':{}};var _0x8faae5={};var _0x23b2bc={'count':0x0,'rows':[]};return db[_0xb62f('0x5a')]['findOne']({'where':{'id':_0x387db0[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x136e2a,null))[_0xb62f('0x10')](function(_0x1911b4){if(_0x1911b4){_0x8faae5[_0xb62f('0x4d')]=_['keys'](db[_0xb62f('0x72')][_0xb62f('0x62')]);_0x8faae5['query']=_[_0xb62f('0x4a')](_0x387db0[_0xb62f('0x49')]);_0x8faae5[_0xb62f('0x4b')]=_['intersection'](_0x8faae5['model'],_0x8faae5[_0xb62f('0x49')]);_0xb915a4[_0xb62f('0x4f')]=_[_0xb62f('0x4c')](_0x8faae5[_0xb62f('0x4d')],qs[_0xb62f('0x4e')](_0x387db0['query']['fields']));_0xb915a4[_0xb62f('0x4f')]=_0xb915a4[_0xb62f('0x4f')][_0xb62f('0x63')]?_0xb915a4[_0xb62f('0x4f')]:_0x8faae5[_0xb62f('0x4d')];if(!_0x387db0[_0xb62f('0x49')][_0xb62f('0x50')](_0xb62f('0x51'))){_0xb915a4[_0xb62f('0x20')]=qs[_0xb62f('0x20')](_0x387db0['query'][_0xb62f('0x20')]);_0xb915a4[_0xb62f('0x1e')]=qs[_0xb62f('0x1e')](_0x387db0[_0xb62f('0x49')][_0xb62f('0x1e')]);}_0xb915a4[_0xb62f('0x52')]=qs[_0xb62f('0x53')](_0x387db0[_0xb62f('0x49')][_0xb62f('0x53')]);_0xb915a4[_0xb62f('0x56')]=qs[_0xb62f('0x4b')](_['pick'](_0x387db0[_0xb62f('0x49')],_0x8faae5['filters']));_0xb915a4[_0xb62f('0x56')][_0xb62f('0x6a')]=_0x1911b4['id'];if(_0x387db0['query'][_0xb62f('0x55')]){_0xb915a4[_0xb62f('0x56')]=_[_0xb62f('0x57')](_0xb915a4['where'],{'$or':_[_0xb62f('0x46')](_0xb915a4['attributes'],function(_0x10f0a9){var _0x1b8e85={};_0x1b8e85[_0x10f0a9]={'$like':'%'+_0x387db0['query'][_0xb62f('0x55')]+'%'};return _0x1b8e85;})});}_0xb915a4=_['merge']({},_0xb915a4,_0x387db0[_0xb62f('0x59')]);return db['CannedAnswer']['count']({'where':_0xb915a4[_0xb62f('0x56')]})['then'](function(_0x58bc05){_0x23b2bc[_0xb62f('0x21')]=_0x58bc05;if(_0x387db0[_0xb62f('0x49')]['includeAll']){_0xb915a4[_0xb62f('0x5c')]=[{'all':!![]}];}return db[_0xb62f('0x72')][_0xb62f('0x5d')](_0xb915a4);})[_0xb62f('0x10')](function(_0x5091b8){_0x23b2bc['rows']=_0x5091b8;return _0x23b2bc;});}})['then'](respondWithFilteredResult(_0x136e2a,_0xb915a4))[_0xb62f('0x5e')](handleError(_0x136e2a,null));};exports['removeAnswers']=function(_0x3168e6,_0x421492){return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x3168e6[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x421492,null))['then'](function(_0x229d3a){if(_0x229d3a){return _0x229d3a[_0xb62f('0x74')](_0x3168e6[_0xb62f('0x49')][_0xb62f('0x75')]);}})[_0xb62f('0x10')](respondWithStatusCode(_0x421492,null))[_0xb62f('0x5e')](handleError(_0x421492,null));};exports['create']=function(_0x12c797,_0xcbec3b){var _0x2872d2={'name':_0x12c797['body'][_0xb62f('0x29')],'key':_0x12c797[_0xb62f('0x65')][_0xb62f('0x48')],'provider':_0x12c797[_0xb62f('0x65')][_0xb62f('0x66')]===_0xb62f('0x76')?null:_0x12c797[_0xb62f('0x65')][_0xb62f('0x66')],'email':_0x12c797['body']['email'],'ListId':_0x12c797['body']['ListId'],'active':!_[_0xb62f('0x77')](_0x12c797[_0xb62f('0x65')][_0xb62f('0x78')])?_0x12c797[_0xb62f('0x65')][_0xb62f('0x78')]:!![],'description':_0x12c797[_0xb62f('0x65')][_0xb62f('0x79')]||null};var _0x5856a1=getAuthenticationOptions(_0x2872d2['provider'],_0x12c797[_0xb62f('0x65')]);_0x2872d2['Imap']=_0x5856a1[_0xb62f('0x42')];_0x2872d2[_0xb62f('0x43')]=_0x5856a1[_0xb62f('0x43')];return db['MailAccount'][_0xb62f('0x6c')](_0x2872d2,{'include':[{'model':db[_0xb62f('0x44')],'as':_0xb62f('0x43')},{'model':db[_0xb62f('0x60')],'as':_0xb62f('0x42')}]})[_0xb62f('0x10')](function(_0x7e211b){var _0x2905c9=_0x12c797['user'][_0xb62f('0x26')]({'plain':!![]});if(!_0x2905c9)throw new Error(_0xb62f('0x7a'));if(_0x2905c9[_0xb62f('0x7b')]===_0xb62f('0x37')){var _0x2490fb=_0x7e211b['get']({'plain':!![]});return db[_0xb62f('0x7c')][_0xb62f('0x64')]({'where':{'name':_0xb62f('0x27'),'userProfileId':_0x2905c9['userProfileId']},'raw':!![]})[_0xb62f('0x10')](function(_0x14fac7){if(_0x14fac7&&_0x14fac7[_0xb62f('0x7d')]===0x0){return db[_0xb62f('0x7e')][_0xb62f('0x6c')]({'name':_0x2490fb[_0xb62f('0x29')],'resourceId':_0x2490fb['id'],'type':_0x14fac7[_0xb62f('0x29')],'sectionId':_0x14fac7['id']},{})[_0xb62f('0x10')](function(){return _0x7e211b;});}else{return _0x7e211b;}})['catch'](function(_0x3a9714){logger[_0xb62f('0x17')](_0xb62f('0x7f'),_0x3a9714);throw _0x3a9714;});}return _0x7e211b;})[_0xb62f('0x10')](respondWithResult(_0xcbec3b,0xc9))[_0xb62f('0x5e')](handleError(_0xcbec3b,null));};exports[_0xb62f('0x80')]=function(_0x513b06,_0x5706d6){return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x513b06[_0xb62f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5706d6,null))['then'](function(_0x59858d){if(_0x59858d){return _0x59858d['getImap']();}return null;})[_0xb62f('0x10')](respondWithResult(_0x5706d6,null))['catch'](handleError(_0x5706d6,null));};exports[_0xb62f('0x81')]=function(_0x261d20,_0x236edd){if(_0x261d20[_0xb62f('0x65')]['id']){delete _0x261d20[_0xb62f('0x65')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x261d20[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x236edd,null))['then'](function(_0x428aed){if(_0x428aed){_0x261d20[_0xb62f('0x65')][_0xb62f('0x6a')]=_0x428aed['id'];return db[_0xb62f('0x60')][_0xb62f('0x6c')](_0x261d20[_0xb62f('0x65')]);}})[_0xb62f('0x10')](respondWithResult(_0x236edd,null))[_0xb62f('0x5e')](handleError(_0x236edd,null));};exports['removeImap']=function(_0x3715e0,_0x522638){return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x3715e0[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x522638,null))[_0xb62f('0x10')](function(_0x96a7a8){if(_0x96a7a8){return _0x96a7a8[_0xb62f('0x82')](null);}return null;})[_0xb62f('0x10')](respondWithStatusCode(_0x522638,null))[_0xb62f('0x5e')](handleError(_0x522638,null));};exports['getSmtp']=function(_0x3a5e53,_0x497910){return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x3a5e53[_0xb62f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x497910,null))['then'](function(_0xbbc8b7){if(_0xbbc8b7){return _0xbbc8b7[_0xb62f('0x83')]();}return null;})[_0xb62f('0x10')](respondWithResult(_0x497910,null))[_0xb62f('0x5e')](handleError(_0x497910,null));};exports[_0xb62f('0x84')]=function(_0x5bd3c2,_0x5e8b2e){if(_0x5bd3c2[_0xb62f('0x65')]['id']){delete _0x5bd3c2[_0xb62f('0x65')]['id'];}return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x5bd3c2[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x5e8b2e,null))[_0xb62f('0x10')](function(_0x30ca59){if(_0x30ca59){_0x5bd3c2[_0xb62f('0x65')][_0xb62f('0x6a')]=_0x30ca59['id'];return db['MailServerOut'][_0xb62f('0x6c')](_0x5bd3c2[_0xb62f('0x65')]);}})['then'](respondWithResult(_0x5e8b2e,null))[_0xb62f('0x5e')](handleError(_0x5e8b2e,null));};exports['removeSmtp']=function(_0x2be4c6,_0x507798){return db[_0xb62f('0x5a')]['findOne']({'where':{'id':_0x2be4c6['params']['id']}})['then'](handleEntityNotFound(_0x507798,null))[_0xb62f('0x10')](function(_0x2a9201){if(_0x2a9201){return _0x2a9201[_0xb62f('0x85')](null);}return null;})[_0xb62f('0x10')](respondWithStatusCode(_0x507798,null))[_0xb62f('0x5e')](handleError(_0x507798,null));};exports['addInteraction']=function(_0x230b47,_0x363ea4){return db[_0xb62f('0x86')][_0xb62f('0x64')]({'where':{'id':_0x230b47[_0xb62f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x363ea4,null))[_0xb62f('0x10')](function(_0x350fbb){if(_0x350fbb){return _0x350fbb[_0xb62f('0x87')](_0x230b47[_0xb62f('0x65')][_0xb62f('0x75')],_[_0xb62f('0x88')](_0x230b47[_0xb62f('0x65')],[_0xb62f('0x75'),'id'])||{});}})[_0xb62f('0x10')](respondWithResult(_0x363ea4,null))['catch'](handleError(_0x363ea4,null));};exports[_0xb62f('0x89')]=function(_0x497936,_0x31e3af){var _0x3f0968={'raw':![],'where':{}};var _0x4cc20e={};var _0x439b88={'count':0x0,'rows':[]};return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x497936[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x31e3af,null))[_0xb62f('0x10')](function(_0x2abdf0){if(_0x2abdf0){_0x4cc20e['model']=_[_0xb62f('0x4a')](db[_0xb62f('0x86')]['rawAttributes']);_0x4cc20e['query']=_[_0xb62f('0x4a')](_0x497936[_0xb62f('0x49')]);_0x4cc20e[_0xb62f('0x4b')]=_['intersection'](_0x4cc20e['model'],_0x4cc20e[_0xb62f('0x49')]);_0x3f0968[_0xb62f('0x4f')]=_['intersection'](_0x4cc20e[_0xb62f('0x4d')],qs[_0xb62f('0x4e')](_0x497936[_0xb62f('0x49')]['fields']));_0x3f0968['attributes']=_0x3f0968[_0xb62f('0x4f')]['length']?_0x3f0968[_0xb62f('0x4f')]:_0x4cc20e[_0xb62f('0x4d')];if(!_0x497936[_0xb62f('0x49')]['hasOwnProperty']('nolimit')){_0x3f0968[_0xb62f('0x20')]=qs[_0xb62f('0x20')](_0x497936[_0xb62f('0x49')]['limit']);_0x3f0968[_0xb62f('0x1e')]=qs[_0xb62f('0x1e')](_0x497936[_0xb62f('0x49')]['offset']);}_0x3f0968[_0xb62f('0x52')]=qs[_0xb62f('0x53')](_0x497936[_0xb62f('0x49')][_0xb62f('0x53')]);_0x3f0968[_0xb62f('0x56')]=qs[_0xb62f('0x4b')](_[_0xb62f('0x54')](_0x497936[_0xb62f('0x49')],_0x4cc20e['filters']));_0x3f0968[_0xb62f('0x56')]['MailAccountId']=_0x2abdf0['id'];if(_0x497936[_0xb62f('0x49')][_0xb62f('0x55')]){_0x3f0968[_0xb62f('0x56')]=_[_0xb62f('0x57')](_0x3f0968[_0xb62f('0x56')],{'$or':_[_0xb62f('0x46')](_0x3f0968['attributes'],function(_0x3aa9ab){var _0x39cae7={};_0x39cae7[_0x3aa9ab]={'$like':'%'+_0x497936[_0xb62f('0x49')]['filter']+'%'};return _0x39cae7;})});}_0x3f0968=_[_0xb62f('0x57')]({},_0x3f0968,_0x497936[_0xb62f('0x59')]);return db['MailInteraction']['count']({'where':_0x3f0968[_0xb62f('0x56')]})[_0xb62f('0x10')](function(_0x15184f){_0x439b88[_0xb62f('0x21')]=_0x15184f;if(_0x497936[_0xb62f('0x49')][_0xb62f('0x5b')]){_0x3f0968['include']=[{'model':db[_0xb62f('0x8a')],'as':_0xb62f('0x8b'),'required':![]},{'model':db[_0xb62f('0x8c')],'as':_0xb62f('0x8d'),'attributes':[_0xb62f('0x29'),_0xb62f('0x8e'),_0xb62f('0x8f')],'required':![]},{'model':db[_0xb62f('0x90')],'as':_0xb62f('0x91'),'attributes':['id',_0xb62f('0x29'),_0xb62f('0x92')],'where':_0x497936[_0xb62f('0x49')][_0xb62f('0x93')]?{'id':_0x497936[_0xb62f('0x49')][_0xb62f('0x93')]}:undefined,'required':_0x497936[_0xb62f('0x49')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x3f0968);})[_0xb62f('0x10')](function(_0x4e4fa4){_0x439b88[_0xb62f('0x6f')]=_0x4e4fa4;return _0x439b88;});}})[_0xb62f('0x10')](respondWithFilteredResult(_0x31e3af,_0x3f0968))[_0xb62f('0x5e')](handleError(_0x31e3af,null));};exports['addApplications']=function addApplications(_0xea9d0a,_0x54f188){var _0x4844aa=_0xea9d0a['params']['id'];var _0x1fc39f=_0xea9d0a[_0xb62f('0x65')];var _0x195a1a=0xc8;var _0x31c028=null;return db[_0xb62f('0x94')]['transaction']({'isolationLevel':db[_0xb62f('0x94')][_0xb62f('0x95')][_0xb62f('0x96')][_0xb62f('0x97')]},function(_0x33cde3){return db[_0xb62f('0x5a')]['findOne']({'where':{'id':_0x4844aa},'transaction':_0x33cde3})[_0xb62f('0x10')](function(_0x13d910){if(_0x13d910){return db[_0xb62f('0x98')][_0xb62f('0x25')]({'where':{'MailAccountId':_0x4844aa},'transaction':_0x33cde3})['then'](function(){var _0x1d7a48=_[_0xb62f('0x46')](_0x1fc39f,function(_0x298df7){_0x298df7[_0xb62f('0x6a')]=_0x4844aa;return _0x298df7;});return db[_0xb62f('0x98')][_0xb62f('0x99')](_0x1d7a48,{'transaction':_0x33cde3});});}else{_0x195a1a=0x194;_0x31c028=[];}});})[_0xb62f('0x10')](function(){if(_0x195a1a!==0x194){return db[_0xb62f('0x98')][_0xb62f('0x9a')]({'where':{'MailAccountId':_0x4844aa},'order':_0xb62f('0x9b')})[_0xb62f('0x10')](function(_0x66f6f5){_0x31c028=_0x66f6f5;});}})[_0xb62f('0x5e')](function(_0x174185){_0x195a1a=0x1f4;logger[_0xb62f('0x17')](_0x174185[_0xb62f('0x28')]);if(_0x174185[_0xb62f('0x29')]){delete _0x174185[_0xb62f('0x29')];}_0x31c028=_0x174185;})[_0xb62f('0x9c')](function(){if(_0x31c028===null){_0x54f188[_0xb62f('0x1a')](_0x195a1a);}else{if(_0x195a1a===0x1f4){_0x54f188[_0xb62f('0x1b')](_0x195a1a)[_0xb62f('0x2a')](_0x31c028);}else{_0x54f188[_0xb62f('0x1b')](_0x195a1a)['json'](_0x31c028);}}});};exports[_0xb62f('0x9d')]=function(_0x46391e,_0x3821bd){var _0x4d812f={};var _0x13dcb3={};var _0x53c91e;var _0x48848c;return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x46391e[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x3821bd,null))[_0xb62f('0x10')](function(_0x1fcf14){if(_0x1fcf14){_0x53c91e=_0x1fcf14;_0x13dcb3[_0xb62f('0x4d')]=_[_0xb62f('0x4a')](db[_0xb62f('0x98')][_0xb62f('0x62')]);_0x13dcb3['query']=_[_0xb62f('0x4a')](_0x46391e['query']);_0x13dcb3['filters']=_['intersection'](_0x13dcb3[_0xb62f('0x4d')],_0x13dcb3[_0xb62f('0x49')]);_0x4d812f[_0xb62f('0x4f')]=_[_0xb62f('0x4c')](_0x13dcb3[_0xb62f('0x4d')],qs[_0xb62f('0x4e')](_0x46391e[_0xb62f('0x49')][_0xb62f('0x4e')]));_0x4d812f[_0xb62f('0x4f')]=_0x4d812f[_0xb62f('0x4f')][_0xb62f('0x63')]?_0x4d812f[_0xb62f('0x4f')]:_0x13dcb3[_0xb62f('0x4d')];_0x4d812f[_0xb62f('0x52')]=qs['sort'](_0x46391e[_0xb62f('0x49')][_0xb62f('0x53')]);_0x4d812f[_0xb62f('0x56')]=qs[_0xb62f('0x4b')](_[_0xb62f('0x54')](_0x46391e[_0xb62f('0x49')],_0x13dcb3[_0xb62f('0x4b')]));if(_0x46391e['query'][_0xb62f('0x55')]){_0x4d812f[_0xb62f('0x56')]=_['merge'](_0x4d812f[_0xb62f('0x56')],{'$or':_[_0xb62f('0x46')](_0x4d812f[_0xb62f('0x4f')],function(_0x4a643c){var _0x35f072={};_0x35f072[_0x4a643c]={'$like':'%'+_0x46391e[_0xb62f('0x49')][_0xb62f('0x55')]+'%'};return _0x35f072;})});}_0x4d812f=_[_0xb62f('0x57')]({},_0x4d812f,_0x46391e['options']);return _0x53c91e[_0xb62f('0x9d')](_0x4d812f);}})[_0xb62f('0x10')](function(_0x576b90){if(_0x576b90){_0x48848c=_0x576b90[_0xb62f('0x63')];if(!_0x46391e[_0xb62f('0x49')][_0xb62f('0x50')](_0xb62f('0x51'))){_0x4d812f['limit']=qs[_0xb62f('0x20')](_0x46391e[_0xb62f('0x49')][_0xb62f('0x20')]);_0x4d812f[_0xb62f('0x1e')]=qs[_0xb62f('0x1e')](_0x46391e['query'][_0xb62f('0x1e')]);}return _0x53c91e[_0xb62f('0x9d')](_0x4d812f);}})[_0xb62f('0x10')](function(_0xa1f399){if(_0xa1f399){return _0xa1f399?{'count':_0x48848c,'rows':_0xa1f399}:null;}})[_0xb62f('0x10')](respondWithResult(_0x3821bd,null))[_0xb62f('0x5e')](handleError(_0x3821bd,null));};exports[_0xb62f('0x9e')]=function(_0x501637,_0x4f4563){var _0x539c9a={'raw':!![],'where':{}};var _0xec9f54={};var _0x21c5ce={'count':0x0,'rows':[]};return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x501637[_0xb62f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4f4563,null))[_0xb62f('0x10')](function(_0x5184ee){if(_0x5184ee){_0xec9f54[_0xb62f('0x4d')]=_[_0xb62f('0x4a')](db['MailMessage'][_0xb62f('0x62')]);_0xec9f54[_0xb62f('0x49')]=_[_0xb62f('0x4a')](_0x501637['query']);_0xec9f54[_0xb62f('0x4b')]=_[_0xb62f('0x4c')](_0xec9f54[_0xb62f('0x4d')],_0xec9f54[_0xb62f('0x49')]);_0x539c9a[_0xb62f('0x4f')]=_[_0xb62f('0x4c')](_0xec9f54['model'],qs[_0xb62f('0x4e')](_0x501637[_0xb62f('0x49')]['fields']));_0x539c9a[_0xb62f('0x4f')]=_0x539c9a[_0xb62f('0x4f')][_0xb62f('0x63')]?_0x539c9a[_0xb62f('0x4f')]:_0xec9f54[_0xb62f('0x4d')];if(!_0x501637[_0xb62f('0x49')][_0xb62f('0x50')](_0xb62f('0x51'))){_0x539c9a[_0xb62f('0x20')]=qs[_0xb62f('0x20')](_0x501637[_0xb62f('0x49')][_0xb62f('0x20')]);_0x539c9a[_0xb62f('0x1e')]=qs[_0xb62f('0x1e')](_0x501637[_0xb62f('0x49')][_0xb62f('0x1e')]);}_0x539c9a[_0xb62f('0x52')]=qs[_0xb62f('0x53')](_0x501637[_0xb62f('0x49')][_0xb62f('0x53')]);_0x539c9a['where']=qs[_0xb62f('0x4b')](_[_0xb62f('0x54')](_0x501637['query'],_0xec9f54[_0xb62f('0x4b')]));_0x539c9a[_0xb62f('0x56')][_0xb62f('0x6a')]=_0x5184ee['id'];if(_0x501637['query'][_0xb62f('0x55')]){_0x539c9a[_0xb62f('0x56')]=_[_0xb62f('0x57')](_0x539c9a[_0xb62f('0x56')],{'$or':_[_0xb62f('0x46')](_0x539c9a[_0xb62f('0x4f')],function(_0x406356){var _0x21ef97={};_0x21ef97[_0x406356]={'$like':'%'+_0x501637[_0xb62f('0x49')][_0xb62f('0x55')]+'%'};return _0x21ef97;})});}if(_0x501637[_0xb62f('0x49')][_0xb62f('0x9f')]){var _0x10dd35=_0x501637[_0xb62f('0x49')][_0xb62f('0x9f')][_0xb62f('0xa0')](',');var _0x336a33={};_0x336a33[_0x10dd35[0x0]]={'$gte':moment(_0x10dd35[0x1])[_0xb62f('0xa1')](_0xb62f('0xa2'))};_0x539c9a[_0xb62f('0x56')]=_[_0xb62f('0x57')](_0x539c9a[_0xb62f('0x56')],_0x336a33);}_0x539c9a=_[_0xb62f('0x57')]({},_0x539c9a,_0x501637[_0xb62f('0x59')]);return db['MailMessage'][_0xb62f('0x21')]({'where':_0x539c9a[_0xb62f('0x56')]})['then'](function(_0x487fb3){_0x21c5ce[_0xb62f('0x21')]=_0x487fb3;if(_0x501637['query'][_0xb62f('0x5b')]){_0x539c9a[_0xb62f('0x5c')]=[{'all':!![]}];}return db[_0xb62f('0xa3')]['findAll'](_0x539c9a);})[_0xb62f('0x10')](function(_0x3e349f){if(_0x501637['query'][_0xb62f('0xa4')]===_0xb62f('0xa5')){for(var _0x54bf38=0x0;_0x54bf38<_0x3e349f[_0xb62f('0x63')];_0x54bf38++){_0x3e349f[_0x54bf38][_0xb62f('0x65')]=juice(_0x3e349f[_0x54bf38]['body']);}}_0x21c5ce['rows']=_0x3e349f;return _0x21c5ce;});}})[_0xb62f('0x10')](respondWithFilteredResult(_0x4f4563,_0x539c9a))[_0xb62f('0x5e')](handleError(_0x4f4563,null));};exports[_0xb62f('0x2a')]=function(_0x739066,_0x3942e4){var _0x2136a7,_0x5e1621={},_0x5f1790;if(_0x739066['body']['to']){_0x5f1790=_0x739066[_0xb62f('0x65')]['to']['split'](',')[0x0];}return db[_0xb62f('0x5a')]['find']({'where':{'id':_0x739066[_0xb62f('0x5f')]['id']},'include':[{'model':db[_0xb62f('0xa6')],'as':_0xb62f('0xa7'),'include':[{'model':db[_0xb62f('0x8a')],'as':'Contacts','where':{'email':_0x5f1790},'limit':0x1,'order':[[_0xb62f('0xa8'),_0xb62f('0xa9')]]}]},{'model':db['MailServerOut'],'as':_0xb62f('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb62f('0xaa'),'raw':!![]}]}]})[_0xb62f('0x10')](handleEntityNotFound(_0x3942e4,null))['then'](function(_0x5bf41f){if(!_0x5bf41f)return;_0x2136a7=_0x5bf41f;if(!_0x5bf41f[_0xb62f('0x43')])throw new Error(_0xb62f('0xab'));if(_[_0xb62f('0x77')](_0x739066[_0xb62f('0x65')][_0xb62f('0xac')])){_0x739066[_0xb62f('0x65')]['from']=util[_0xb62f('0xa1')]('%s\x20<%s>',_0x5bf41f[_0xb62f('0x29')],_0x5bf41f[_0xb62f('0xad')]||_0x5bf41f[_0xb62f('0x43')]['user']);}if(_0x739066[_0xb62f('0x65')]['attachments']&&_0x739066[_0xb62f('0x65')][_0xb62f('0xae')][_0xb62f('0x63')]){for(var _0xdc1868=0x0;_0xdc1868<_0x739066[_0xb62f('0x65')][_0xb62f('0xae')][_0xb62f('0x63')];_0xdc1868+=0x1){_0x739066[_0xb62f('0x65')]['attachments'][_0xdc1868]={'filename':_0x739066[_0xb62f('0x65')][_0xb62f('0xae')][_0xdc1868][_0xb62f('0x29')],'path':path['join'](config[_0xb62f('0xaf')],_0xb62f('0xb0'),_0x739066[_0xb62f('0x65')][_0xb62f('0xae')][_0xdc1868][_0xb62f('0xb1')])};}}var _0x27122c=_0x5bf41f[_0xb62f('0xb2')]();return respondWithRpcPromise(_0xb62f('0xb3'),_0xb62f('0xb4'),{'account':_0x27122c,'message':_0x739066['body']});})[_0xb62f('0x10')](function(_0x20ad00){if(!_0x20ad00)return;_0x5e1621=_0x20ad00;if(!_0x2136a7[_0xb62f('0xa7')])throw new Error(_0xb62f('0xb5'));if(_0x2136a7[_0xb62f('0xa7')][_0xb62f('0xb6')]['length'])return _0x2136a7[_0xb62f('0xa7')][_0xb62f('0xb6')][0x0];return db[_0xb62f('0x8a')][_0xb62f('0x6c')](_[_0xb62f('0x7')](_0x739066['body'],{'firstName':_0x739066[_0xb62f('0x65')]['to'],'email':_0x739066[_0xb62f('0x65')]['to'],'phone':_0x739066[_0xb62f('0x65')]['to'],'ListId':_0x2136a7['ListId']}));})[_0xb62f('0x10')](function(_0x526b3f){if(!_0x526b3f)return;var _0xe01834={'UserId':_0x739066[_0xb62f('0x37')]['id'],'ContactId':_0x526b3f['id'],'MailAccountId':_0x2136a7['id'],'inReplyTo':_0x5e1621[_0xb62f('0xb7')],'to':_0x739066[_0xb62f('0x65')]['from'],'cc':_0x739066[_0xb62f('0x65')]['cc'],'subject':_0x739066[_0xb62f('0x65')][_0xb62f('0xb8')],'attach':_0x739066['body'][_0xb62f('0xb9')],'firstMsgDirection':_0xb62f('0xba'),'lastMsgAt':moment()['format'](_0xb62f('0xa2')),'lastMsgDirection':_0xb62f('0xba'),'Messages':[_[_0xb62f('0x57')](_0x739066[_0xb62f('0x65')],{'messageId':_0x5e1621[_0xb62f('0xb7')],'sentAt':moment()[_0xb62f('0xa1')](_0xb62f('0xa2')),'read':!![],'MailAccountId':_0x2136a7['id'],'UserId':_0x739066['user']['id'],'ContactId':_0x526b3f['id']})]};if(_0x739066[_0xb62f('0x65')][_0xb62f('0xbb')]){_0xe01834=_[_0xb62f('0x57')](_0xe01834,_0x739066[_0xb62f('0x65')][_0xb62f('0xbb')]);}return db[_0xb62f('0x86')]['create'](_0xe01834,{'include':[{'model':db[_0xb62f('0xa3')],'as':_0xb62f('0xbc')}]});})[_0xb62f('0x10')](respondWithResult(_0x3942e4,null))[_0xb62f('0x5e')](handleError(_0x3942e4,null));};exports['verifySmtp']=function(_0x2147d2,_0x4c4339){return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x2147d2[_0xb62f('0x5f')]['id']},'include':[{'model':db[_0xb62f('0x44')],'as':_0xb62f('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb62f('0xaa'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4c4339,null))[_0xb62f('0x10')](function(_0xea34d8){if(!_0xea34d8['Smtp'])return;var _0x49068b=_0xea34d8[_0xb62f('0xb2')]();return respondWithRpcPromise(_0xb62f('0xbd'),_0xb62f('0xbe'),{'account':_0x49068b});})[_0xb62f('0x10')](respondWithResult(_0x4c4339,null))[_0xb62f('0x5e')](handleError(_0x4c4339,null));};exports[_0xb62f('0x25')]=function(_0x5d2f4a,_0x413928){return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x5d2f4a[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x413928,null))[_0xb62f('0x10')](function(_0x1fbdb8){if(_0x1fbdb8&&_0x1fbdb8['service']){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1fbdb8;})[_0xb62f('0x10')](removeEntity(_0x413928,null))['catch'](handleError(_0x413928,null));};exports[_0xb62f('0xbf')]=function(_0x24d849,_0x38d0b1){return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x24d849[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x38d0b1,null))['then'](function(_0x556941){if(_0x556941){return _0x556941[_0xb62f('0xbf')](_0x24d849[_0xb62f('0x65')][_0xb62f('0x75')],_[_0xb62f('0x88')](_0x24d849[_0xb62f('0x65')],[_0xb62f('0x75'),'id'])||{})['spread'](function(_0xf3449e){for(var _0x121d02=0x0;_0x121d02<_0x24d849[_0xb62f('0x65')][_0xb62f('0x75')][_0xb62f('0x63')];_0x121d02+=0x1){socket[_0xb62f('0xc0')]('userMailAccount:save',{'UserId':Number(_0x24d849[_0xb62f('0x65')][_0xb62f('0x75')][_0x121d02]),'MailAccountId':Number(_0x24d849[_0xb62f('0x5f')]['id'])});}return _0xf3449e;});}})['then'](respondWithResult(_0x38d0b1,null))['catch'](handleError(_0x38d0b1,null));};exports[_0xb62f('0xc1')]=function(_0x15c68b,_0x274419){return db[_0xb62f('0x5a')][_0xb62f('0x64')]({'where':{'id':_0x15c68b[_0xb62f('0x5f')]['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x274419,null))['then'](function(_0x126e96){if(_0x126e96){return _0x126e96['removeAgents'](_0x15c68b[_0xb62f('0x49')]['ids'])[_0xb62f('0x10')](function(){if(_[_0xb62f('0xc2')](_0x15c68b[_0xb62f('0x49')][_0xb62f('0x75')])){for(var _0x29072f=0x0;_0x29072f<_0x15c68b['query'][_0xb62f('0x75')][_0xb62f('0x63')];_0x29072f+=0x1){socket[_0xb62f('0xc0')](_0xb62f('0xc3'),{'UserId':Number(_0x15c68b['query'][_0xb62f('0x75')][_0x29072f]),'MailAccountId':Number(_0x15c68b[_0xb62f('0x5f')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x15c68b[_0xb62f('0x49')][_0xb62f('0x75')]),'MailAccountId':Number(_0x15c68b[_0xb62f('0x5f')]['id'])});}});}})[_0xb62f('0x10')](respondWithStatusCode(_0x274419,null))['catch'](handleError(_0x274419,null));};exports[_0xb62f('0xc4')]=function(_0x1500fd,_0x4a0b93){var _0x2abafe={};var _0x4a9009={};var _0x1974b4;var _0x15832f;return db[_0xb62f('0x5a')][_0xb62f('0x6e')]({'where':{'id':_0x1500fd['params']['id']}})[_0xb62f('0x10')](handleEntityNotFound(_0x4a0b93,null))[_0xb62f('0x10')](function(_0x370c3c){if(_0x370c3c){_0x1974b4=_0x370c3c;_0x4a9009[_0xb62f('0x4d')]=_['keys'](db['User'][_0xb62f('0x62')]);_0x4a9009[_0xb62f('0x49')]=_['keys'](_0x1500fd[_0xb62f('0x49')]);_0x4a9009[_0xb62f('0x4b')]=_[_0xb62f('0x4c')](_0x4a9009[_0xb62f('0x4d')],_0x4a9009[_0xb62f('0x49')]);_0x2abafe[_0xb62f('0x4f')]=_['intersection'](_0x4a9009[_0xb62f('0x4d')],qs['fields'](_0x1500fd[_0xb62f('0x49')][_0xb62f('0x4e')]));_0x2abafe[_0xb62f('0x4f')]=_0x2abafe[_0xb62f('0x4f')][_0xb62f('0x63')]?_0x2abafe[_0xb62f('0x4f')]:_0x4a9009[_0xb62f('0x4d')];_0x2abafe[_0xb62f('0x52')]=qs[_0xb62f('0x53')](_0x1500fd[_0xb62f('0x49')][_0xb62f('0x53')]);_0x2abafe[_0xb62f('0x56')]=qs[_0xb62f('0x4b')](_['pick'](_0x1500fd[_0xb62f('0x49')],_0x4a9009['filters']));if(_0x1500fd[_0xb62f('0x49')][_0xb62f('0x55')]){_0x2abafe[_0xb62f('0x56')]=_[_0xb62f('0x57')](_0x2abafe[_0xb62f('0x56')],{'$or':_[_0xb62f('0x46')](_0x2abafe[_0xb62f('0x4f')],function(_0x2c4a88){var _0xa673dc={};_0xa673dc[_0x2c4a88]={'$like':'%'+_0x1500fd[_0xb62f('0x49')][_0xb62f('0x55')]+'%'};return _0xa673dc;})});}_0x2abafe=_[_0xb62f('0x57')]({},_0x2abafe,_0x1500fd['options']);return _0x1974b4['getAgents'](_0x2abafe);}})[_0xb62f('0x10')](function(_0x1b387a){if(_0x1b387a){_0x15832f=_0x1b387a['length'];if(!_0x1500fd['query'][_0xb62f('0x50')](_0xb62f('0x51'))){_0x2abafe['limit']=qs[_0xb62f('0x20')](_0x1500fd[_0xb62f('0x49')][_0xb62f('0x20')]);_0x2abafe['offset']=qs[_0xb62f('0x1e')](_0x1500fd[_0xb62f('0x49')][_0xb62f('0x1e')]);}return _0x1974b4[_0xb62f('0xc4')](_0x2abafe);}})[_0xb62f('0x10')](function(_0x4a3e05){if(_0x4a3e05){return _0x4a3e05?{'count':_0x15832f,'rows':_0x4a3e05}:null;}})[_0xb62f('0x10')](respondWithResult(_0x4a0b93,null))[_0xb62f('0x5e')](handleError(_0x4a0b93,null));};
\ No newline at end of file
index 24455dc..f457151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8658=['../../mysqldb','MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x8658,0x1d3));var _0x8865=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8658[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0x8865('0x0'));var MailAccount=require(_0x8865('0x1'))['db'][_0x8865('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8865('0x3')](0x0);var events={'afterCreate':_0x8865('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x120c22){return function(_0x58ff93,_0x48c6a6,_0x9e1929){MailAccountEvents[_0x8865('0x5')](_0x120c22+':'+_0x58ff93['id'],_0x58ff93);MailAccountEvents[_0x8865('0x5')](_0x120c22,_0x58ff93);_0x9e1929(null);};}for(var e in events){if(events[_0x8865('0x6')](e)){var event=events[e];MailAccount[_0x8865('0x7')](e,emitEvent(event));}}module[_0x8865('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0x68fd=['exports','events','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x68fd,0x1e9));var _0xd68f=function(_0x41ee82,_0x2f7470){_0x41ee82=_0x41ee82-0x0;var _0x2d90b8=_0x68fd[_0x41ee82];return _0x2d90b8;};'use strict';var EventEmitter=require(_0xd68f('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xd68f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd68f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd68f('0x3'),'afterDestroy':_0xd68f('0x4')};function emitEvent(_0x96d959){return function(_0x3e5e78,_0x37c481,_0x9814cb){MailAccountEvents[_0xd68f('0x5')](_0x96d959+':'+_0x3e5e78['id'],_0x3e5e78);MailAccountEvents[_0xd68f('0x5')](_0x96d959,_0x3e5e78);_0x9814cb(null);};}for(var e in events){if(events[_0xd68f('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xd68f('0x7')]=MailAccountEvents;
\ No newline at end of file
index 2571cba..e9ad755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x874a=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','user','pass','./mailAccount.attributes','exports','define','MailAccount','provider','custom','service','host','Smtp','secure','authentication','modernAuthentication'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x874a,0xfe));var _0xa874=function(_0x4b2537,_0x101c79){_0x4b2537=_0x4b2537-0x0;var _0x16ba52=_0x874a[_0x4b2537];return _0x16ba52;};'use strict';var attributes=require(_0xa874('0x0'));module[_0xa874('0x1')]=function(_0x4ccdbb){return _0x4ccdbb[_0xa874('0x2')](_0xa874('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4ad792=this;var _0x57fc15={'id':_0x4ad792['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4ad792[_0xa874('0x4')]!==_0xa874('0x5')){_0x57fc15[_0xa874('0x6')]=_0x4ad792[_0xa874('0x4')];}else{_0x57fc15[_0xa874('0x7')]=_0x4ad792[_0xa874('0x8')]['host'];_0x57fc15['port']=_0x4ad792[_0xa874('0x8')]['port'];_0x57fc15[_0xa874('0x9')]=_0x4ad792[_0xa874('0x8')][_0xa874('0x9')];}if(_0x4ad792[_0xa874('0x8')][_0xa874('0xa')]){if(_0x4ad792[_0xa874('0x8')][_0xa874('0xb')]){if(!_0x4ad792[_0xa874('0x8')][_0xa874('0xc')])throw new Error(_0xa874('0xd'));_0x57fc15[_0xa874('0xe')]={'type':_0xa874('0xf'),'user':_0x4ad792[_0xa874('0x8')]['user'],'accessToken':_0x4ad792['Smtp'][_0xa874('0xc')][_0xa874('0x10')]};}else{_0x57fc15[_0xa874('0xe')]={'user':_0x4ad792[_0xa874('0x8')][_0xa874('0x11')],'pass':_0x4ad792[_0xa874('0x8')][_0xa874('0x12')]};}}return _0x57fc15;}}});};
\ No newline at end of file
+var _0xe002=['host','Smtp','port','secure','authentication','CloudProvider','auth','OAuth2','user','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','service'];(function(_0x28cc8b,_0x17856f){var _0x24e8cc=function(_0x4523bf){while(--_0x4523bf){_0x28cc8b['push'](_0x28cc8b['shift']());}};_0x24e8cc(++_0x17856f);}(_0xe002,0x18f));var _0x2e00=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xe002[_0x4eafed];return _0x159c85;};'use strict';var attributes=require(_0x2e00('0x0'));module['exports']=function(_0x5a1036){return _0x5a1036[_0x2e00('0x1')](_0x2e00('0x2'),attributes,{'tableName':_0x2e00('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1699df=this;var _0x3af421={'id':_0x1699df['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1699df[_0x2e00('0x4')]!=='custom'){_0x3af421[_0x2e00('0x5')]=_0x1699df['provider'];}else{_0x3af421[_0x2e00('0x6')]=_0x1699df[_0x2e00('0x7')]['host'];_0x3af421[_0x2e00('0x8')]=_0x1699df[_0x2e00('0x7')][_0x2e00('0x8')];_0x3af421[_0x2e00('0x9')]=_0x1699df[_0x2e00('0x7')][_0x2e00('0x9')];}if(_0x1699df[_0x2e00('0x7')][_0x2e00('0xa')]){if(_0x1699df[_0x2e00('0x7')]['modernAuthentication']){if(!_0x1699df[_0x2e00('0x7')][_0x2e00('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3af421[_0x2e00('0xc')]={'type':_0x2e00('0xd'),'user':_0x1699df[_0x2e00('0x7')]['user'],'accessToken':_0x1699df[_0x2e00('0x7')][_0x2e00('0xb')]['data5']};}else{_0x3af421[_0x2e00('0xc')]={'user':_0x1699df[_0x2e00('0x7')][_0x2e00('0xe')],'pass':_0x1699df[_0x2e00('0x7')]['pass']};}}return _0x3af421;}}});};
\ No newline at end of file
index def06eb..4397781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['Applications','MailServerOut','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','body','mail','difference','keys','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','MailApplication'];(function(_0x220bd8,_0x481b7d){var _0x10fd23=function(_0xd9f463){while(--_0xd9f463){_0x220bd8['push'](_0x220bd8['shift']());}};_0x10fd23(++_0x481b7d);}(_0xef0f,0x168));var _0xfef0=function(_0x1cad6c,_0x28ed12){_0x1cad6c=_0x1cad6c-0x0;var _0x4c4072=_0xef0f[_0x1cad6c];return _0x4c4072;};'use strict';var _=require(_0xfef0('0x0'));var moment=require('moment');var BPromise=require(_0xfef0('0x1'));var rs=require(_0xfef0('0x2'));var Redis=require(_0xfef0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xfef0('0x4'))(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfef0('0x7')][_0xfef0('0x8')]({'port':0x232c});config[_0xfef0('0x9')]=_[_0xfef0('0xa')](config[_0xfef0('0x9')],{'host':_0xfef0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0x9')]));require('./mailAccount.socket')[_0xfef0('0xc')](socket);function respondWithRpcPromise(_0x100e3a,_0x3a81cc,_0x2d42dc){return new BPromise(function(_0x334e74,_0x402dff){return client[_0xfef0('0xd')](_0x100e3a,_0x2d42dc)[_0xfef0('0xe')](function(_0x11bbca){logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x3a81cc,'request\x20sent',JSON[_0xfef0('0x14')](_0x11bbca));if(_0x11bbca[_0xfef0('0x15')]){if(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x16')]===0x1f4){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x11bbca[_0xfef0('0x15')]['message']);return _0x402dff(_0x11bbca[_0xfef0('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3a81cc,_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);return _0x334e74(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);}else{logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));_0x334e74(_0x11bbca[_0xfef0('0x18')]['message']);}})[_0xfef0('0x19')](function(_0x1642cd){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x1642cd);_0x402dff(_0x1642cd);});});}exports[_0xfef0('0x1a')]=function(_0x55912f){var _0x5283e1=this;return new Promise(function(_0x4e24de,_0x20826b){return db[_0xfef0('0x1b')][_0xfef0('0x1c')]({'raw':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')]['where']||null:null,'attributes':_0x55912f['options']?_0x55912f['options'][_0xfef0('0x1e')]||null:null,'limit':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x1f')]||null:null,'include':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x55912f['options']['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x22')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1e')],'include':_0x316e20[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x316e20[_0xfef0('0x20')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x22')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1e')],'include':_0x5df04f['include']?_[_0xfef0('0x21')](_0x5df04f[_0xfef0('0x20')],function(_0xca0cce){return{'model':db[_0xca0cce[_0xfef0('0x22')]],'as':_0xca0cce['as'],'attributes':_0xca0cce[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x3e3c4c){logger[_0xfef0('0xf')](_0xfef0('0x1a'),_0x55912f);logger[_0xfef0('0x12')](_0xfef0('0x1a'),_0x55912f,JSON[_0xfef0('0x14')](_0x3e3c4c));_0x4e24de(_0x3e3c4c);})['catch'](function(_0x445625){logger['error']('GetMailAccount',_0x445625[_0xfef0('0x17')],_0x55912f);_0x20826b(_0x5283e1[_0xfef0('0x15')](0x1f4,_0x445625['message']));});});};exports['ShowMailAccount']=function(_0x5cf518){var _0x4f65cd=this;return new Promise(function(_0x4cce8a,_0x417535){return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'raw':_0x5cf518['options']?_0x5cf518['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x24')]||null:null,'attributes':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518[_0xfef0('0x1d')]['attributes']||null:null,'include':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x5cf518[_0xfef0('0x1d')][_0xfef0('0x20')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x22')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1e')],'include':_0x3e1a64[_0xfef0('0x20')]?_['map'](_0x3e1a64[_0xfef0('0x20')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x22')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1e')],'include':_0xea09ec[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0xea09ec[_0xfef0('0x20')],function(_0xeb75e2){return{'model':db[_0xeb75e2[_0xfef0('0x22')]],'as':_0xeb75e2['as'],'attributes':_0xeb75e2[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x22acf9){if(_0x5cf518[_0xfef0('0x1d')]['smtp']===!![])_0x22acf9[_0xfef0('0x25')]('smtpOptions',_0x22acf9[_0xfef0('0x26')]());logger[_0xfef0('0xf')](_0xfef0('0x27'),_0x5cf518);logger['debug'](_0xfef0('0x27'),_0x5cf518,JSON[_0xfef0('0x14')](_0x22acf9));_0x4cce8a(_0x22acf9);})[_0xfef0('0x19')](function(_0x5537c8){logger[_0xfef0('0x15')](_0xfef0('0x27'),_0x5537c8[_0xfef0('0x17')],_0x5cf518);_0x417535(_0x4f65cd['error'](0x1f4,_0x5537c8[_0xfef0('0x17')]));});});};exports['NotifyMailAccount']=function(_0x49ed48){var _0xf30aff=this;return new Promise(function(_0x547a5d,_0x5c3305){var _0xbf6ddd={'body':_0x49ed48[_0xfef0('0x28')],'channel':_0xfef0('0x29')};var _0x1a6593=_[_0xfef0('0x2a')](_[_0xfef0('0x2b')](db['CmContact'][_0xfef0('0x2c')]),[_0xfef0('0x2d'),'updatedAt','CompanyId',_0xfef0('0x2e')]);var _0x5dc824=![];if(_0x49ed48[_0xfef0('0x28')]['id']){delete _0x49ed48[_0xfef0('0x28')]['id'];}if(_[_0xfef0('0x2f')](_0x49ed48[_0xfef0('0x28')][_0xfef0('0x30')])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x31')));}if(_[_0xfef0('0x2f')](_0x49ed48['body'][_0xfef0('0x28')])||_0x49ed48['body']['body']===''){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x32')));}if(_['isNil'](_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x33')+_0x1a6593));}if(!_[_0xfef0('0x34')](_0x1a6593,_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x35')+_0x1a6593));}var _0x504967={};_0x504967[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body'][_0xfef0('0x30')];return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'where':{'id':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x38')],'as':_0xfef0('0x39'),'include':[{'model':db['CmContact'],'as':_0xfef0('0x3a'),'where':_0x504967,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfef0('0x3b')],'as':_0xfef0('0x3c')},{'model':db[_0xfef0('0x3d')],'as':'Smtp','include':[{'model':db[_0xfef0('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x51f207){if(_0x51f207&&_0x51f207[_0xfef0('0x39')]){var _0x3d471c=_0x51f207[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x37')]=_[_0xfef0('0x40')](_0x3d471c,[_0xfef0('0x3c'),_0xfef0('0x39')]);_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x41')]=_0x51f207['getSmtpOptions']();_0xbf6ddd['applications']=_0x3d471c[_0xfef0('0x3c')];_0xbf6ddd[_0xfef0('0x42')]=_0x3d471c[_0xfef0('0x39')];_0xbf6ddd[_0xfef0('0x43')]=_[_0xfef0('0x44')](_0xbf6ddd[_0xfef0('0x43')],[_0xfef0('0x45')],[_0xfef0('0x46')]);if(_0xbf6ddd['account']&&_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x47')]){_0xbf6ddd[_0xfef0('0x43')][_0xfef0('0x48')]({'id':0x0,'priority':_0xbf6ddd[_0xfef0('0x43')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0xfef0('0x49')});}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x3c')]){delete _0xbf6ddd[_0xfef0('0x37')]['Applications'];}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')]){delete _0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')];}if(_0x3d471c[_0xfef0('0x39')][_0xfef0('0x3a')][_0xfef0('0x4a')]){return _0x3d471c['List'][_0xfef0('0x3a')][0x0];}var _0x163255=_['defaults'](_0x49ed48[_0xfef0('0x28')],{'firstName':_0x49ed48['body'][_0xfef0('0x30')],'ListId':_0x3d471c[_0xfef0('0x2e')]});_0x163255[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body']['from'];return db['CmContact'][_0xfef0('0x4b')](_0x163255);}else{throw new Error(_0xfef0('0x4c'));}})[_0xfef0('0xe')](function(_0x34fda3){_0xbf6ddd[_0xfef0('0x4d')]=_0x34fda3;if(_0x34fda3){if(!_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x4e')]){_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')]=rs[_0xfef0('0x4f')]()+'\x20'+_0x49ed48['body'][_0xfef0('0x17')]['from'];}var _0x135653={'ContactId':_0x34fda3['id'],'MailAccountId':_0x49ed48['account']['id'],'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['from'],'cc':_0x49ed48[_0xfef0('0x28')]['message']['cc'],'subject':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['subject'],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'lastMsgAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgDirection':'in'};return db[_0xfef0('0x53')][_0xfef0('0x23')]({'where':{'closed':![],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x54')],'as':_0xfef0('0x55'),'attributes':[_0xfef0('0x4e')],'where':{'messageId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x56')]}}]})[_0xfef0('0xe')](function(_0x28cab7){if(_0x28cab7){return[_0x28cab7,![]];}return db[_0xfef0('0x53')][_0xfef0('0x4b')](_0x135653)['then'](function(_0x12e383){return[_0x12e383,!![]];});});}else{throw new Error(_0xfef0('0x57'));}})[_0xfef0('0x58')](function(_0x3c6bb8,_0x176fc7){if(_0x3c6bb8){_0x5dc824=_0x176fc7;if(!_0x176fc7){return _0x3c6bb8[_0xfef0('0x59')]({'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x30')],'cc':_0x49ed48['body'][_0xfef0('0x17')]['cc'],'subject':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5a')],'attach':_0x3c6bb8[_0xfef0('0x50')]?_0x3c6bb8[_0xfef0('0x50')]:_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgAt':moment()[_0xfef0('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c6bb8;}}})[_0xfef0('0xe')](function(_0x2ab666){_0xbf6ddd[_0xfef0('0x5b')]=_0x2ab666[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x5c')]=_0x5dc824;return db[_0xfef0('0x54')]['create']({'body':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x28')],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id'],'MailInteractionId':_0x2ab666['id'],'direction':'in','ContactId':_0xbf6ddd[_0xfef0('0x4d')]['id'],'messageId':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['messageId'],'from':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x30')],'to':_0x49ed48[_0xfef0('0x28')]['message']['to'],'cc':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['cc'],'subject':_0x49ed48['body'][_0xfef0('0x17')][_0xfef0('0x5a')],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'Attachments':_0x49ed48['body']['message']['attachments'],'originTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x5d')],'originCc':_0x49ed48['body'][_0xfef0('0x17')]['originCc'],'bcc':_0x49ed48['body']['message'][_0xfef0('0x5e')],'ChatWebsiteId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5f')]||null,'originChannel':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['originChannel']||_0xfef0('0x60'),'ChatOfflineMessageId':_0x49ed48['body']['message'][_0xfef0('0x61')]||null},{'include':[{'model':db[_0xfef0('0x62')],'as':_0xfef0('0x63')}]});})[_0xfef0('0xe')](function(_0x4df63b){_0xbf6ddd['message']=_0x4df63b;if(_0xbf6ddd['interaction'][_0xfef0('0x64')]){return db['User'][_0xfef0('0x23')]({'attributes':['id',_0xfef0('0x65')],'where':{'id':_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x64')]}})[_0xfef0('0xe')](function(_0x4be622){if(_0x4be622){_0xbf6ddd[_0xfef0('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4be622[_0xfef0('0x65')]+','+(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x66')]||0xa),'interval':_0xfef0('0x49')});}return respondWithRpcPromise('Start','startRouting',_0xbf6ddd);});}return respondWithRpcPromise(_0xfef0('0x67'),_0xfef0('0x68'),_0xbf6ddd);})['then'](function(_0x872f99){_0x547a5d(_0x872f99);})[_0xfef0('0x19')](function(_0x4690c0){_0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0x4690c0[_0xfef0('0x17')]));});});};
\ No newline at end of file
+var _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0xcb3218,_0x5020c3){var _0x4eb224=function(_0x5ccf61){while(--_0x5ccf61){_0xcb3218['push'](_0xcb3218['shift']());}};_0x4eb224(++_0x5020c3);}(_0xc2c7,0x134));var _0x7c2c=function(_0x35a3be,_0x3a7e72){_0x35a3be=_0x35a3be-0x0;var _0x5d4360=_0xc2c7[_0x35a3be];return _0x5d4360;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});};
\ No newline at end of file
index 7eb5e4c..5fa2794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54cc=['remove','update','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x54cc,0xa0));var _0xc54c=function(_0x4ae2be,_0x168117){_0x4ae2be=_0x4ae2be-0x0;var _0x34db68=_0x54cc[_0x4ae2be];return _0x34db68;};'use strict';var MailAccountEvents=require(_0xc54c('0x0'));var events=['save',_0xc54c('0x1'),_0xc54c('0x2')];function createListener(_0x539064,_0x1bf605){return function(_0x2e5e3a){_0x1bf605['emit'](_0x539064,_0x2e5e3a);};}function removeListener(_0x455d09,_0x11a953){return function(){MailAccountEvents[_0xc54c('0x3')](_0x455d09,_0x11a953);};}exports[_0xc54c('0x4')]=function(_0x2bf5ff){for(var _0x3c7210=0x0,_0x6dca6c=events[_0xc54c('0x5')];_0x3c7210<_0x6dca6c;_0x3c7210++){var _0x370893=events[_0x3c7210];var _0x2b3e0e=createListener(_0xc54c('0x6')+_0x370893,_0x2bf5ff);MailAccountEvents['on'](_0x370893,_0x2b3e0e);}};
\ No newline at end of file
+var _0x4329=['./mailAccount.events','save','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x13dc4c,_0x2e95db){var _0x4b9d90=function(_0x448031){while(--_0x448031){_0x13dc4c['push'](_0x13dc4c['shift']());}};_0x4b9d90(++_0x2e95db);}(_0x4329,0x13b));var _0x9432=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x4329[_0x13ea00];return _0x1f7347;};'use strict';var MailAccountEvents=require(_0x9432('0x0'));var events=[_0x9432('0x1'),_0x9432('0x2'),_0x9432('0x3')];function createListener(_0x7dd03d,_0x12e585){return function(_0xf64078){_0x12e585[_0x9432('0x4')](_0x7dd03d,_0xf64078);};}function removeListener(_0x2b1e79,_0x5796ef){return function(){MailAccountEvents[_0x9432('0x5')](_0x2b1e79,_0x5796ef);};}exports[_0x9432('0x6')]=function(_0x1ca7e0){for(var _0x27edef=0x0,_0x5568ad=events[_0x9432('0x7')];_0x27edef<_0x5568ad;_0x27edef++){var _0x5346c3=events[_0x27edef];var _0x10509f=createListener(_0x9432('0x8')+_0x5346c3,_0x1ca7e0);MailAccountEvents['on'](_0x5346c3,_0x10509f);}};
\ No newline at end of file
index 1744d24..3a8a85b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cfc=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6cfc,0xab));var _0xc6cf=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x6cfc[_0x1098db];return _0x14f090;};'use strict';var multer=require('multer');var util=require(_0xc6cf('0x0'));var path=require(_0xc6cf('0x1'));var timeout=require('connect-timeout');var express=require(_0xc6cf('0x2'));var router=express[_0xc6cf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc6cf('0x4'));var interaction=require(_0xc6cf('0x5'));var config=require(_0xc6cf('0x6'));var controller=require(_0xc6cf('0x7'));router[_0xc6cf('0x8')](_0xc6cf('0x9'),auth[_0xc6cf('0xa')](),controller[_0xc6cf('0xb')]);router[_0xc6cf('0xc')](_0xc6cf('0x9'),auth[_0xc6cf('0xa')](),controller[_0xc6cf('0xd')]);router[_0xc6cf('0xe')](_0xc6cf('0x9'),auth[_0xc6cf('0xa')](),controller[_0xc6cf('0xf')]);module[_0xc6cf('0x10')]=router;
\ No newline at end of file
+var _0x22c2=['get','isAuthenticated','show','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x4b580a,_0x5150a9){var _0x496f46=function(_0x4eccc1){while(--_0x4eccc1){_0x4b580a['push'](_0x4b580a['shift']());}};_0x496f46(++_0x5150a9);}(_0x22c2,0xcf));var _0x222c=function(_0xe6a15c,_0x16c091){_0xe6a15c=_0xe6a15c-0x0;var _0x4f429c=_0x22c2[_0xe6a15c];return _0x4f429c;};'use strict';var multer=require(_0x222c('0x0'));var util=require('util');var path=require(_0x222c('0x1'));var timeout=require(_0x222c('0x2'));var express=require(_0x222c('0x3'));var router=express[_0x222c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x222c('0x5'));var interaction=require(_0x222c('0x6'));var config=require(_0x222c('0x7'));var controller=require(_0x222c('0x8'));router[_0x222c('0x9')]('/:id',auth[_0x222c('0xa')](),controller[_0x222c('0xb')]);router[_0x222c('0xc')]('/:id',auth[_0x222c('0xa')](),controller[_0x222c('0xd')]);router[_0x222c('0xe')](_0x222c('0xf'),auth['isAuthenticated'](),controller[_0x222c('0x10')]);module[_0x222c('0x11')]=router;
\ No newline at end of file
index 32dd024..d39f2da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9efa=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x1dac10,_0x2fc35d){var _0x5e6f6a=function(_0xc7bf9){while(--_0xc7bf9){_0x1dac10['push'](_0x1dac10['shift']());}};_0x5e6f6a(++_0x2fc35d);}(_0x9efa,0x83));var _0xa9ef=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9efa[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0xa9ef('0x0')]={'priority':{'type':Sequelize[_0xa9ef('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa9ef('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa9ef('0x3')]()},'description':{'type':Sequelize[_0xa9ef('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa9ef('0x4')}};
\ No newline at end of file
+var _0x9551=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x19fb9a,_0x4631cb){var _0x142c00=function(_0x5ecc30){while(--_0x5ecc30){_0x19fb9a['push'](_0x19fb9a['shift']());}};_0x142c00(++_0x4631cb);}(_0x9551,0x11e));var _0x1955=function(_0x19a2eb,_0x2df439){_0x19a2eb=_0x19a2eb-0x0;var _0x3c8514=_0x9551[_0x19a2eb];return _0x3c8514;};'use strict';var Sequelize=require(_0x1955('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1955('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1955('0x2')],'allowNull':![],'defaultValue':_0x1955('0x3')},'appdata':{'type':Sequelize[_0x1955('0x4')]()},'description':{'type':Sequelize[_0x1955('0x2')]},'interval':{'type':Sequelize[_0x1955('0x2')],'defaultValue':_0x1955('0x5')}};
\ No newline at end of file
index 1ac9ab6..11a4dbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xedd9,0xfc));var _0x9edd=function(_0x38133b,_0x50d797){_0x38133b=_0x38133b-0x0;var _0x5e617d=_0xedd9[_0x38133b];return _0x5e617d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));};
\ No newline at end of file
+var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x1231ce,_0x25c858){var _0x73344c=function(_0x17ead1){while(--_0x17ead1){_0x1231ce['push'](_0x1231ce['shift']());}};_0x73344c(++_0x25c858);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));};
\ No newline at end of file
index 5ca5797..da49469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b07=['api','bluebird','request-promise','rimraf','../../config/environment','exports','MailApplication','utf8mb4','util','../../config/logger'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x6b07,0x184));var _0x76b0=function(_0x203268,_0x55dba3){_0x203268=_0x203268-0x0;var _0x5aee33=_0x6b07[_0x203268];return _0x5aee33;};'use strict';var _=require('lodash');var util=require(_0x76b0('0x0'));var logger=require(_0x76b0('0x1'))(_0x76b0('0x2'));var moment=require('moment');var BPromise=require(_0x76b0('0x3'));var rp=require(_0x76b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b0('0x5'));var config=require(_0x76b0('0x6'));var attributes=require('./mailApplication.attributes');module[_0x76b0('0x7')]=function(_0x151628,_0xdaa460){return _0x151628['define'](_0x76b0('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x76b0('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1fe4=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1b7b78,_0x2ae082){var _0x13f9e2=function(_0x571399){while(--_0x571399){_0x1b7b78['push'](_0x1b7b78['shift']());}};_0x13f9e2(++_0x2ae082);}(_0x1fe4,0x1bb));var _0x41fe=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0x1fe4[_0x1d4449];return _0x4dcde3;};'use strict';var _=require(_0x41fe('0x0'));var util=require(_0x41fe('0x1'));var logger=require(_0x41fe('0x2'))('api');var moment=require('moment');var BPromise=require(_0x41fe('0x3'));var rp=require(_0x41fe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41fe('0x5'));var config=require(_0x41fe('0x6'));var attributes=require(_0x41fe('0x7'));module['exports']=function(_0x27322d,_0x1955c1){return _0x27322d[_0x41fe('0x8')]('MailApplication',attributes,{'tableName':_0x41fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x41fe('0xa'),'collate':_0x41fe('0xb')});};
\ No newline at end of file
index 425d318..4b4dd83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d6c=['request','then','info','MailApplication,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateMailApplication','body','options','raw','attributes','limit','stringify','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x257268,_0x2d5655){var _0x5a7a98=function(_0x8f3db4){while(--_0x8f3db4){_0x257268['push'](_0x257268['shift']());}};_0x5a7a98(++_0x2d5655);}(_0x3d6c,0x17e));var _0xc3d6=function(_0x3db8d9,_0x29130f){_0x3db8d9=_0x3db8d9-0x0;var _0x9cfc04=_0x3d6c[_0x3db8d9];return _0x9cfc04;};'use strict';var _=require('lodash');var util=require(_0xc3d6('0x0'));var moment=require(_0xc3d6('0x1'));var BPromise=require(_0xc3d6('0x2'));var rs=require(_0xc3d6('0x3'));var fs=require('fs');var Redis=require(_0xc3d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3d6('0x5'))(_0xc3d6('0x6'));var config=require('../../config/environment');var jayson=require(_0xc3d6('0x7'));var client=jayson[_0xc3d6('0x8')][_0xc3d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b9e1c,_0x128f40,_0x440cd2){return new BPromise(function(_0x41d991,_0x5f0791){return client[_0xc3d6('0xa')](_0x5b9e1c,_0x440cd2)[_0xc3d6('0xb')](function(_0x58fae0){logger[_0xc3d6('0xc')](_0xc3d6('0xd'),_0x128f40,'request\x20sent');logger[_0xc3d6('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x128f40,_0xc3d6('0xf'),JSON['stringify'](_0x58fae0));if(_0x58fae0[_0xc3d6('0x10')]){if(_0x58fae0[_0xc3d6('0x10')][_0xc3d6('0x11')]===0x1f4){logger[_0xc3d6('0x10')](_0xc3d6('0xd'),_0x128f40,_0x58fae0[_0xc3d6('0x10')][_0xc3d6('0x12')]);return _0x5f0791(_0x58fae0[_0xc3d6('0x10')][_0xc3d6('0x12')]);}logger[_0xc3d6('0x10')](_0xc3d6('0xd'),_0x128f40,_0x58fae0[_0xc3d6('0x10')][_0xc3d6('0x12')]);return _0x41d991(_0x58fae0['error'][_0xc3d6('0x12')]);}else{logger['info'](_0xc3d6('0xd'),_0x128f40,'request\x20sent');_0x41d991(_0x58fae0[_0xc3d6('0x13')]['message']);}})[_0xc3d6('0x14')](function(_0xa4ad04){logger[_0xc3d6('0x10')](_0xc3d6('0xd'),_0x128f40,_0xa4ad04);_0x5f0791(_0xa4ad04);});});}exports[_0xc3d6('0x15')]=function(_0x4991fb){var _0x50226d=this;return new Promise(function(_0x114210,_0x3b2d74){return db['MailApplication']['update'](_0x4991fb[_0xc3d6('0x16')],{'raw':_0x4991fb['options']?_0x4991fb[_0xc3d6('0x17')][_0xc3d6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4991fb['options']?_0x4991fb[_0xc3d6('0x17')]['where']||null:null,'attributes':_0x4991fb[_0xc3d6('0x17')]?_0x4991fb['options'][_0xc3d6('0x19')]||null:null,'limit':_0x4991fb[_0xc3d6('0x17')]?_0x4991fb[_0xc3d6('0x17')][_0xc3d6('0x1a')]||null:null})[_0xc3d6('0xb')](function(_0x432966){logger[_0xc3d6('0xc')]('UpdateMailApplication',_0x4991fb);logger[_0xc3d6('0xe')](_0xc3d6('0x15'),_0x4991fb,JSON[_0xc3d6('0x1b')](_0x432966));_0x114210(_0x432966);})[_0xc3d6('0x14')](function(_0x4f31c8){logger[_0xc3d6('0x10')](_0xc3d6('0x15'),_0x4f31c8[_0xc3d6('0x12')],_0x4991fb);_0x3b2d74(_0x50226d[_0xc3d6('0x10')](0x1f4,_0x4f31c8[_0xc3d6('0x12')]));});});};
\ No newline at end of file
+var _0x82df=['catch','update','body','options','raw','limit','UpdateMailApplication','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x82df,0x164));var _0xf82d=function(_0x1425e8,_0x2c195b){_0x1425e8=_0x1425e8-0x0;var _0x1cd239=_0x82df[_0x1425e8];return _0x1cd239;};'use strict';var _=require(_0xf82d('0x0'));var util=require(_0xf82d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf82d('0x2'));var fs=require('fs');var Redis=require(_0xf82d('0x3'));var db=require(_0xf82d('0x4'))['db'];var utils=require(_0xf82d('0x5'));var logger=require(_0xf82d('0x6'))('rpc');var config=require(_0xf82d('0x7'));var jayson=require(_0xf82d('0x8'));var client=jayson[_0xf82d('0x9')][_0xf82d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4816b2,_0xbe3838,_0x1360c3){return new BPromise(function(_0x3c06ed,_0x53afc5){return client[_0xf82d('0xb')](_0x4816b2,_0x1360c3)[_0xf82d('0xc')](function(_0x19db0d){logger['info'](_0xf82d('0xd'),_0xbe3838,_0xf82d('0xe'));logger[_0xf82d('0xf')](_0xf82d('0x10'),_0xbe3838,'request\x20sent',JSON['stringify'](_0x19db0d));if(_0x19db0d[_0xf82d('0x11')]){if(_0x19db0d[_0xf82d('0x11')]['code']===0x1f4){logger[_0xf82d('0x11')](_0xf82d('0xd'),_0xbe3838,_0x19db0d['error']['message']);return _0x53afc5(_0x19db0d[_0xf82d('0x11')][_0xf82d('0x12')]);}logger['error'](_0xf82d('0xd'),_0xbe3838,_0x19db0d[_0xf82d('0x11')][_0xf82d('0x12')]);return _0x3c06ed(_0x19db0d[_0xf82d('0x11')][_0xf82d('0x12')]);}else{logger[_0xf82d('0x13')](_0xf82d('0xd'),_0xbe3838,_0xf82d('0xe'));_0x3c06ed(_0x19db0d[_0xf82d('0x14')][_0xf82d('0x12')]);}})[_0xf82d('0x15')](function(_0x17d3ea){logger[_0xf82d('0x11')](_0xf82d('0xd'),_0xbe3838,_0x17d3ea);_0x53afc5(_0x17d3ea);});});}exports['UpdateMailApplication']=function(_0x346ebb){var _0x132de8=this;return new Promise(function(_0x503bfb,_0x91a962){return db['MailApplication'][_0xf82d('0x16')](_0x346ebb[_0xf82d('0x17')],{'raw':_0x346ebb[_0xf82d('0x18')]?_0x346ebb[_0xf82d('0x18')][_0xf82d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x346ebb[_0xf82d('0x18')]?_0x346ebb[_0xf82d('0x18')]['where']||null:null,'attributes':_0x346ebb[_0xf82d('0x18')]?_0x346ebb[_0xf82d('0x18')]['attributes']||null:null,'limit':_0x346ebb[_0xf82d('0x18')]?_0x346ebb[_0xf82d('0x18')][_0xf82d('0x1a')]||null:null})[_0xf82d('0xc')](function(_0x142316){logger['info'](_0xf82d('0x1b'),_0x346ebb);logger[_0xf82d('0xf')]('UpdateMailApplication',_0x346ebb,JSON[_0xf82d('0x1c')](_0x142316));_0x503bfb(_0x142316);})['catch'](function(_0x1ecb15){logger[_0xf82d('0x11')]('UpdateMailApplication',_0x1ecb15[_0xf82d('0x12')],_0x346ebb);_0x91a962(_0x132de8[_0xf82d('0x11')](0x1f4,_0x1ecb15['message']));});});};
\ No newline at end of file
index 6e07d8d..c796e30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','addTags','put','/:id','tracked','update','delete','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller','isAuthenticated','index','get'];(function(_0x123183,_0x5361d5){var _0x401015=function(_0x1b7dfe){while(--_0x1b7dfe){_0x123183['push'](_0x123183['shift']());}};_0x401015(++_0x5361d5);}(_0xb688,0x85));var _0x8b68=function(_0x2442ac,_0x439929){_0x2442ac=_0x2442ac-0x0;var _0xd119f5=_0xb688[_0x2442ac];return _0xd119f5;};'use strict';var express=require(_0x8b68('0x0'));var router=express[_0x8b68('0x1')]();var auth=require(_0x8b68('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x8b68('0x3'));router['get']('/',auth[_0x8b68('0x4')](),controller[_0x8b68('0x5')]);router[_0x8b68('0x6')](_0x8b68('0x7'),auth[_0x8b68('0x4')](),controller[_0x8b68('0x8')]);router[_0x8b68('0x6')]('/:id',auth[_0x8b68('0x4')](),controller[_0x8b68('0x9')]);router[_0x8b68('0x6')](_0x8b68('0xa'),auth[_0x8b68('0x4')](),controller[_0x8b68('0xb')]);router[_0x8b68('0x6')](_0x8b68('0xc'),auth[_0x8b68('0x4')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0x4')](),controller[_0x8b68('0xf')]);router[_0x8b68('0xe')](_0x8b68('0xa'),auth[_0x8b68('0x4')](),controller[_0x8b68('0x10')]);router[_0x8b68('0xe')](_0x8b68('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x8b68('0x12'),'mailinteraction:addtags'),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')](_0x8b68('0x15'),auth[_0x8b68('0x4')](),interaction[_0x8b68('0x16')]('mail','mailinteraction:update'),controller[_0x8b68('0x17')]);router[_0x8b68('0x18')](_0x8b68('0x15'),auth[_0x8b68('0x4')](),interaction[_0x8b68('0x16')](_0x8b68('0x12'),_0x8b68('0x19')),controller[_0x8b68('0x1a')]);router[_0x8b68('0x18')](_0x8b68('0x11'),auth[_0x8b68('0x4')](),controller[_0x8b68('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x7a64=['/:id/tags','tracked','mail','mailinteraction:addtags','mailinteraction:update','update','mailinteraction:destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','post','create','addMessage'];(function(_0x1e2ee8,_0x51bb43){var _0x1134b5=function(_0x1fec42){while(--_0x1fec42){_0x1e2ee8['push'](_0x1e2ee8['shift']());}};_0x1134b5(++_0x51bb43);}(_0x7a64,0x11c));var _0x47a6=function(_0x319052,_0x1792bd){_0x319052=_0x319052-0x0;var _0x36e5b6=_0x7a64[_0x319052];return _0x36e5b6;};'use strict';var express=require(_0x47a6('0x0'));var router=express[_0x47a6('0x1')]();var auth=require(_0x47a6('0x2'));var interaction=require(_0x47a6('0x3'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x47a6('0x4')](),controller[_0x47a6('0x5')]);router[_0x47a6('0x6')](_0x47a6('0x7'),auth[_0x47a6('0x4')](),controller[_0x47a6('0x8')]);router[_0x47a6('0x6')](_0x47a6('0x9'),auth[_0x47a6('0x4')](),controller[_0x47a6('0xa')]);router[_0x47a6('0x6')](_0x47a6('0xb'),auth[_0x47a6('0x4')](),controller['getMessages']);router[_0x47a6('0x6')]('/:id/download',auth[_0x47a6('0x4')](),controller['download']);router[_0x47a6('0xc')]('/',auth[_0x47a6('0x4')](),controller[_0x47a6('0xd')]);router[_0x47a6('0xc')](_0x47a6('0xb'),auth[_0x47a6('0x4')](),controller[_0x47a6('0xe')]);router[_0x47a6('0xc')](_0x47a6('0xf'),auth[_0x47a6('0x4')](),interaction[_0x47a6('0x10')](_0x47a6('0x11'),_0x47a6('0x12')),controller['addTags']);router['put'](_0x47a6('0x9'),auth['isAuthenticated'](),interaction[_0x47a6('0x10')]('mail',_0x47a6('0x13')),controller[_0x47a6('0x14')]);router['delete'](_0x47a6('0x9'),auth[_0x47a6('0x4')](),interaction['tracked'](_0x47a6('0x11'),_0x47a6('0x15')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x47a6('0x16')]=router;
\ No newline at end of file
index 399c525..267a601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x621f=['DATE','STRING','TEXT','long','out','sequelize','exports','BOOLEAN'];(function(_0x1cfb0b,_0x4381a4){var _0x240ddb=function(_0x5337d1){while(--_0x5337d1){_0x1cfb0b['push'](_0x1cfb0b['shift']());}};_0x240ddb(++_0x4381a4);}(_0x621f,0xed));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf621('0x0'));var iconv=require('iconv');module[_0xf621('0x1')]={'closed':{'type':Sequelize[_0xf621('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf621('0x3')]},'disposition':{'type':Sequelize[_0xf621('0x4')]},'secondDisposition':{'type':Sequelize[_0xf621('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf621('0x4')]},'cc':{'type':Sequelize[_0xf621('0x5')](_0xf621('0x6'))},'subject':{'type':Sequelize[_0xf621('0x5')]()},'attach':{'type':Sequelize[_0xf621('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf621('0x3')]},'substatus':{'type':Sequelize[_0xf621('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xf621('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf621('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf621('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xcd1b=['BOOLEAN','DATE','STRING','long','ENUM','out','sequelize','iconv'];(function(_0x13adc2,_0x456fac){var _0x46f01f=function(_0x7bc52d){while(--_0x7bc52d){_0x13adc2['push'](_0x13adc2['shift']());}};_0x46f01f(++_0x456fac);}(_0xcd1b,0x18e));var _0xbcd1=function(_0x1199cf,_0x792ce0){_0x1199cf=_0x1199cf-0x0;var _0x4ac991=_0xcd1b[_0x1199cf];return _0x4ac991;};'use strict';var Sequelize=require(_0xbcd1('0x0'));var iconv=require(_0xbcd1('0x1'));module['exports']={'closed':{'type':Sequelize[_0xbcd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbcd1('0x3')]},'disposition':{'type':Sequelize[_0xbcd1('0x4')]},'secondDisposition':{'type':Sequelize[_0xbcd1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbcd1('0x4')]},'inReplyTo':{'type':Sequelize[_0xbcd1('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0xbcd1('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xbcd1('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbcd1('0x3')]},'substatus':{'type':Sequelize[_0xbcd1('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xbcd1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbcd1('0x6')]('in',_0xbcd1('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbcd1('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index cb27143..bc84b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54a9=['unix','toString','join','root','server','files','attachments','push','Attachment','Messages','from','bcc','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','writeFileSync','unlinkSync','eml-format','zip-dir','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','index','fieldName','type','key','getOptions','findAll','catch','show','params','model','MailInteraction','rawAttributes','query','keys','filters','intersection','attributes','fields','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','length','order','sort','where','pick','MailInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x54a9,0x175));var _0x954a=function(_0x29a784,_0x4d7a2d){_0x29a784=_0x29a784-0x0;var _0xc6c9a2=_0x54a9[_0x29a784];return _0xc6c9a2;};'use strict';var emlformat=require(_0x954a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x954a('0x1'));var moment=require('moment');var BPromise=require(_0x954a('0x2'));var util=require(_0x954a('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x954a('0x4'));var juice=require(_0x954a('0x5'));var Redis=require(_0x954a('0x6'));var interaction=require(_0x954a('0x7'));var qs=require(_0x954a('0x8'));var logger=require(_0x954a('0x9'))(_0x954a('0xa'));var config=require(_0x954a('0xb'));var db=require(_0x954a('0xc'))['db'];var htmlEntities=require(_0x954a('0xd'));config[_0x954a('0xe')]=_['defaults'](config[_0x954a('0xe')],{'host':_0x954a('0xf'),'port':0x18eb});var socket=require(_0x954a('0x10'))(new Redis(config['redis']));require(_0x954a('0x11'))[_0x954a('0x12')](socket);function respondWithStatusCode(_0x56ab46,_0x14dce0){_0x14dce0=_0x14dce0||0xcc;return function(_0xa1a8ea){if(_0xa1a8ea){return _0x56ab46[_0x954a('0x13')](_0x14dce0);}return _0x56ab46[_0x954a('0x14')](_0x14dce0)['end']();};}function respondWithResult(_0x2fcbed,_0x1787f9){_0x1787f9=_0x1787f9||0xc8;return function(_0x209818){if(_0x209818){return _0x2fcbed[_0x954a('0x14')](_0x1787f9)[_0x954a('0x15')](_0x209818);}};}function respondWithFilteredResult(_0x5c01d2,_0xdc1953){return function(_0x5ec0bc){if(_0x5ec0bc){var _0x4f8e5d=typeof _0xdc1953[_0x954a('0x16')]===_0x954a('0x17')&&typeof _0xdc1953[_0x954a('0x18')]===_0x954a('0x17');var _0x389ab1=_0x5ec0bc[_0x954a('0x19')];var _0x4e1ec0=_0x4f8e5d?0x0:_0xdc1953[_0x954a('0x16')];var _0x22ce71=_0x4f8e5d?_0x5ec0bc['count']:_0xdc1953[_0x954a('0x16')]+_0xdc1953[_0x954a('0x18')];var _0x1bddbb;if(_0x22ce71>=_0x389ab1){_0x22ce71=_0x389ab1;_0x1bddbb=0xc8;}else{_0x1bddbb=0xce;}_0x5c01d2[_0x954a('0x14')](_0x1bddbb);return _0x5c01d2[_0x954a('0x1a')](_0x954a('0x1b'),_0x4e1ec0+'-'+_0x22ce71+'/'+_0x389ab1)[_0x954a('0x15')](_0x5ec0bc);}return null;};}function saveUpdates(_0x270890){return function(_0xbbccf3){if(_0xbbccf3){return _0xbbccf3[_0x954a('0x1c')](_0x270890)[_0x954a('0x1d')](function(_0x2cadc7){return _0x2cadc7;});}return null;};}function removeEntity(_0x48dd5b){return function(_0x4ccab4){if(_0x4ccab4){return _0x4ccab4[_0x954a('0x1e')]()[_0x954a('0x1d')](function(){_0x48dd5b[_0x954a('0x14')](0xcc)[_0x954a('0x1f')]();});}};}function handleEntityNotFound(_0x3c40dc){return function(_0x56d3e8){if(!_0x56d3e8){_0x3c40dc['sendStatus'](0x194);}return _0x56d3e8;};}function handleError(_0x3b66ef,_0x4e1c47){_0x4e1c47=_0x4e1c47||0x1f4;return function(_0x23ee37){logger[_0x954a('0x20')](_0x23ee37['stack']);if(_0x23ee37[_0x954a('0x21')]){delete _0x23ee37[_0x954a('0x21')];}_0x3b66ef[_0x954a('0x14')](_0x4e1c47)[_0x954a('0x22')](_0x23ee37);};}exports[_0x954a('0x23')]=function(_0x323940,_0x2f84da){var _0x5eccea={};var _0x1d18f9=_['map'](db['MailInteraction']['rawAttributes'],function(_0x3c275d){return{'name':_0x3c275d[_0x954a('0x24')],'type':_0x3c275d[_0x954a('0x25')][_0x954a('0x26')]};});_0x5eccea=qs[_0x954a('0x27')](_0x1d18f9,_0x323940);return interaction[_0x954a('0x28')]('mail',_0x323940['query'],_0x323940['user'],_0x5eccea,_0x1d18f9)[_0x954a('0x1d')](respondWithFilteredResult(_0x2f84da,_0x5eccea))[_0x954a('0x29')](handleError(_0x2f84da,null));};exports[_0x954a('0x2a')]=function(_0x349c50,_0x32ee81){var _0x37a523={'raw':![],'where':{'id':_0x349c50[_0x954a('0x2b')]['id']}},_0x574b97={};_0x574b97[_0x954a('0x2c')]=_['keys'](db[_0x954a('0x2d')][_0x954a('0x2e')]);_0x574b97[_0x954a('0x2f')]=_[_0x954a('0x30')](_0x349c50[_0x954a('0x2f')]);_0x574b97[_0x954a('0x31')]=_[_0x954a('0x32')](_0x574b97[_0x954a('0x2c')],_0x574b97['query']);_0x37a523[_0x954a('0x33')]=_['intersection'](_0x574b97['model'],qs[_0x954a('0x34')](_0x349c50['query']['fields']));_0x37a523['attributes']=_0x37a523[_0x954a('0x33')]['length']?_0x37a523[_0x954a('0x33')]:_0x574b97[_0x954a('0x2c')];if(_0x349c50[_0x954a('0x2f')]['includeAll']){_0x37a523[_0x954a('0x35')]=[{'all':!![]}];}_0x37a523=_[_0x954a('0x36')]({},_0x37a523,_0x349c50[_0x954a('0x37')]);return db[_0x954a('0x2d')][_0x954a('0x38')](_0x37a523)[_0x954a('0x1d')](handleEntityNotFound(_0x32ee81,null))[_0x954a('0x1d')](respondWithResult(_0x32ee81,null))['catch'](handleError(_0x32ee81,null));};exports[_0x954a('0x39')]=function(_0x5cd50b,_0x22cb8f){return db[_0x954a('0x2d')][_0x954a('0x39')](_0x5cd50b[_0x954a('0x3a')],{})[_0x954a('0x1d')](respondWithResult(_0x22cb8f,0xc9))['catch'](handleError(_0x22cb8f,null));};exports[_0x954a('0x1c')]=function(_0x42dfb0,_0x1a49d8){if(_0x42dfb0['body']['id']){delete _0x42dfb0[_0x954a('0x3a')]['id'];}return db['MailInteraction'][_0x954a('0x38')]({'where':{'id':_0x42dfb0['params']['id']}})[_0x954a('0x1d')](handleEntityNotFound(_0x1a49d8,null))[_0x954a('0x1d')](saveUpdates(_0x42dfb0[_0x954a('0x3a')],null))['then'](respondWithResult(_0x1a49d8,null))['catch'](handleError(_0x1a49d8,null));};exports[_0x954a('0x1e')]=function(_0x13f606,_0x48c3f4){return db['MailInteraction'][_0x954a('0x38')]({'where':{'id':_0x13f606[_0x954a('0x2b')]['id']}})[_0x954a('0x1d')](handleEntityNotFound(_0x48c3f4,null))[_0x954a('0x1d')](removeEntity(_0x48c3f4,null))[_0x954a('0x29')](handleError(_0x48c3f4,null));};exports[_0x954a('0x3b')]=function(_0x517cd4,_0x538d66){return db[_0x954a('0x2d')][_0x954a('0x3b')]()['then'](respondWithResult(_0x538d66,null))[_0x954a('0x29')](handleError(_0x538d66,null));};exports[_0x954a('0x3c')]=function(_0x474724,_0x94511b){return db['MailMessage']['find']({'where':{'id':_0x474724[_0x954a('0x2b')]['id']}})[_0x954a('0x1d')](handleEntityNotFound(_0x94511b,null))[_0x954a('0x1d')](function(_0x565ee3){if(_0x565ee3){return _0x565ee3[_0x954a('0x3c')](_0x474724['body'][_0x954a('0x3d')],_[_0x954a('0x3e')](_0x474724['body'],[_0x954a('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x94511b,null))[_0x954a('0x29')](handleError(_0x94511b,null));};exports[_0x954a('0x3f')]=function(_0x27069a,_0x57bc88){var _0x8cfa04={'raw':![],'where':{}};var _0x5ea2ea={};var _0x29dbf7={'count':0x0,'rows':[]};return db['MailInteraction'][_0x954a('0x40')]({'where':{'id':_0x27069a['params']['id']}})[_0x954a('0x1d')](handleEntityNotFound(_0x57bc88,null))[_0x954a('0x1d')](function(_0x4e567c){if(_0x4e567c){_0x5ea2ea['model']=_[_0x954a('0x30')](db[_0x954a('0x41')]['rawAttributes']);_0x5ea2ea[_0x954a('0x2f')]=_[_0x954a('0x30')](_0x27069a[_0x954a('0x2f')]);_0x5ea2ea['filters']=_[_0x954a('0x32')](_0x5ea2ea[_0x954a('0x2c')],_0x5ea2ea[_0x954a('0x2f')]);_0x8cfa04['attributes']=_['intersection'](_0x5ea2ea[_0x954a('0x2c')],qs[_0x954a('0x34')](_0x27069a[_0x954a('0x2f')][_0x954a('0x34')]));_0x8cfa04['attributes']=_0x8cfa04['attributes'][_0x954a('0x42')]?_0x8cfa04[_0x954a('0x33')]:_0x5ea2ea[_0x954a('0x2c')];if(!_0x27069a[_0x954a('0x2f')]['hasOwnProperty']('nolimit')){_0x8cfa04[_0x954a('0x18')]=qs[_0x954a('0x18')](_0x27069a[_0x954a('0x2f')][_0x954a('0x18')]);_0x8cfa04[_0x954a('0x16')]=qs[_0x954a('0x16')](_0x27069a[_0x954a('0x2f')]['offset']);}_0x8cfa04[_0x954a('0x43')]=qs['sort'](_0x27069a[_0x954a('0x2f')][_0x954a('0x44')]);_0x8cfa04[_0x954a('0x45')]=qs[_0x954a('0x31')](_[_0x954a('0x46')](_0x27069a[_0x954a('0x2f')],_0x5ea2ea['filters']));_0x8cfa04[_0x954a('0x45')][_0x954a('0x47')]=_0x4e567c['id'];if(_0x27069a['query'][_0x954a('0x48')]){_0x8cfa04[_0x954a('0x45')]=_[_0x954a('0x36')](_0x8cfa04[_0x954a('0x45')],{'$or':_[_0x954a('0x49')](_0x8cfa04[_0x954a('0x33')],function(_0x25bb02){var _0x40107c={};_0x40107c[_0x25bb02]={'$like':'%'+_0x27069a[_0x954a('0x2f')][_0x954a('0x48')]+'%'};return _0x40107c;})});}if(_0x27069a[_0x954a('0x2f')][_0x954a('0x4a')]){var _0x207696=_0x27069a['query'][_0x954a('0x4a')][_0x954a('0x4b')](',');var _0x3803b3={};_0x3803b3[_0x207696[0x0]]={'$gte':moment(_0x207696[0x1])['format'](_0x954a('0x4c'))};_0x8cfa04[_0x954a('0x45')]=_[_0x954a('0x36')](_0x8cfa04['where'],_0x3803b3);}_0x8cfa04=_[_0x954a('0x36')]({},_0x8cfa04,_0x27069a[_0x954a('0x37')]);return db['MailMessage'][_0x954a('0x19')]({'where':_0x8cfa04[_0x954a('0x45')]})[_0x954a('0x1d')](function(_0x1ff5a3){_0x29dbf7[_0x954a('0x19')]=_0x1ff5a3;if(_0x27069a[_0x954a('0x2f')]['includeAll']){_0x8cfa04[_0x954a('0x35')]=[{'all':!![]}];}return db[_0x954a('0x41')]['findAll'](_0x8cfa04);})['then'](function(_0x2f3e1c){if(_0x27069a[_0x954a('0x2f')][_0x954a('0x4d')]==='true'){for(var _0x1966b6=0x0;_0x1966b6<_0x2f3e1c[_0x954a('0x42')];_0x1966b6++){_0x2f3e1c[_0x1966b6][_0x954a('0x3a')]=juice(_0x2f3e1c[_0x1966b6][_0x954a('0x3a')]);}}_0x29dbf7[_0x954a('0x4e')]=_0x2f3e1c;return _0x29dbf7;});}})[_0x954a('0x1d')](respondWithFilteredResult(_0x57bc88,_0x8cfa04))[_0x954a('0x29')](handleError(_0x57bc88,null));};exports[_0x954a('0x4f')]=function(_0x1d34dc,_0x2f716b){return db[_0x954a('0x2d')][_0x954a('0x38')]({'where':{'id':_0x1d34dc[_0x954a('0x2b')]['id']}})[_0x954a('0x1d')](handleEntityNotFound(_0x2f716b,null))['then'](function(_0x537415){if(_0x537415){return _0x537415[_0x954a('0x50')](_0x1d34dc[_0x954a('0x3a')][_0x954a('0x3d')],_[_0x954a('0x3e')](_0x1d34dc['body'],[_0x954a('0x3d'),'id'])||{})[_0x954a('0x51')](function(){return db['Tag'][_0x954a('0x28')]({'attributes':['id',_0x954a('0x21'),_0x954a('0x52')],'where':{'id':_0x1d34dc[_0x954a('0x3a')][_0x954a('0x3d')]}});})[_0x954a('0x1d')](function(_0x6a0afc){socket[_0x954a('0x53')](_0x954a('0x54'),{'id':Number(_0x1d34dc[_0x954a('0x2b')]['id']),'tags':_0x6a0afc||[]});return{'id':Number(_0x1d34dc[_0x954a('0x2b')]['id']),'tags':_0x6a0afc||[]};});}})['then'](respondWithResult(_0x2f716b,null))[_0x954a('0x29')](handleError(_0x2f716b,null));};exports[_0x954a('0x55')]=function(_0x89c692,_0x1e46fe){return db[_0x954a('0x2d')][_0x954a('0x38')]({'where':{'id':_0x89c692[_0x954a('0x2b')]['id']}})[_0x954a('0x1d')](handleEntityNotFound(_0x1e46fe,null))['then'](function(_0x3a7739){if(_0x3a7739){return _0x3a7739['removeTags'](_0x89c692[_0x954a('0x2f')][_0x954a('0x3d')]);}})[_0x954a('0x1d')](respondWithStatusCode(_0x1e46fe,null))[_0x954a('0x29')](handleError(_0x1e46fe,null));};exports[_0x954a('0x56')]=function(_0xc7956f,_0x7b261c){var _0x1752d2=moment()[_0x954a('0x57')]()[_0x954a('0x58')]();var _0x408dbb=path[_0x954a('0x59')](config[_0x954a('0x5a')],_0x954a('0x5b'),'files','tmp');var _0x15ed40=path[_0x954a('0x59')](config[_0x954a('0x5a')],_0x954a('0x5b'),_0x954a('0x5c'),_0x954a('0x5d'));var _0x4becb8=path[_0x954a('0x59')](_0x408dbb,_0x1752d2);var _0x574bb1=util['format']('transcript-%d-%s.zip',_0xc7956f['params']['id'],_0x1752d2);var _0x24ca2e=path['join'](_0x408dbb,_0x574bb1);var _0x52588f=[];if(_0xc7956f[_0x954a('0x2f')]['attachments']){_0x52588f[_0x954a('0x5e')]({'model':db[_0x954a('0x5f')],'as':'Attachments','raw':!![]});}var _0x3b3405=[{'model':db[_0x954a('0x41')],'as':_0x954a('0x60'),'attributes':['id',_0x954a('0x3a'),_0x954a('0x61'),'to','cc',_0x954a('0x62'),'subject',_0x954a('0x63')],'where':{'secret':![]},'order':qs[_0x954a('0x44')]('id'),'include':_0x52588f}];return db[_0x954a('0x2d')][_0x954a('0x38')]({'where':{'id':_0xc7956f[_0x954a('0x2b')]['id']},'include':_0x3b3405})[_0x954a('0x1d')](handleEntityNotFound(_0x7b261c,null))[_0x954a('0x1d')](function(_0xa262e4){if(_0xa262e4&&_0xa262e4[_0x954a('0x60')]){var _0x1c378f=_0xa262e4[_0x954a('0x64')]({'plain':!![]});fs[_0x954a('0x65')](_0x4becb8);return BPromise[_0x954a('0x66')](_0x1c378f[_0x954a('0x60')],function(_0x162143,_0x5d15f0){var _0x3e6158={'from':_0x162143[_0x954a('0x61')],'to':_0x162143['to']||_0x954a('0x67'),'subject':_0x162143['subject'],'html':htmlEntities[_0x954a('0x68')](_0x162143[_0x954a('0x3a')]),'headers':{'Date':moment(_0x162143[_0x954a('0x63')])[_0x954a('0x69')](_0x954a('0x6a'))},'attachments':[]};if(_0x162143['cc']){_0x3e6158[_0x954a('0x6b')]['Cc']=_0x162143['cc'];}if(_0x162143[_0x954a('0x62')]){_0x3e6158[_0x954a('0x6b')][_0x954a('0x6c')]=_0x162143[_0x954a('0x62')];}return new BPromise(function(_0x305646,_0x447343){if(_0x162143[_0x954a('0x6d')]){for(var _0x19c91f=0x0;_0x19c91f<_0x162143['Attachments'][_0x954a('0x42')];_0x19c91f++){var _0xf3b256=_0x162143['Attachments'][_0x19c91f];var _0x2d84d7=path['join'](_0x15ed40,_0xf3b256[_0x954a('0x6e')]);if(fs[_0x954a('0x6f')](_0x2d84d7)){_0x3e6158['attachments'][_0x954a('0x5e')]({'name':_0xf3b256[_0x954a('0x21')],'contentType':_0xf3b256[_0x954a('0x25')],'data':fs[_0x954a('0x70')](_0x2d84d7)});}}}emlformat['build'](_0x3e6158,function(_0x5b7e2b,_0x42a4cf){if(_0x5b7e2b)return _0x447343(_0x5b7e2b);fs[_0x954a('0x71')](path[_0x954a('0x59')](_0x4becb8,util[_0x954a('0x69')]('message%d.eml',_0x5d15f0)),_0x42a4cf);return _0x305646(_0x42a4cf);});});})[_0x954a('0x1d')](function(){return new BPromise(function(_0x4fbb0f,_0xdc9412){zipdir(_0x4becb8,{'saveTo':_0x24ca2e},function(_0x2f55b0,_0x42f886){if(_0x2f55b0)return _0xdc9412(_0x2f55b0);return _0x4fbb0f(_0x42f886);});})[_0x954a('0x1d')](function(){return new BPromise(function(_0x1d9f6f,_0x3b86b8){rimraf(_0x4becb8,function(_0x3a8f79){if(_0x3a8f79)_0x3b86b8(_0x3a8f79);return _0x1d9f6f();});});})['then'](function(){return _0x7b261c[_0x954a('0x56')](_0x24ca2e,_0x574bb1,function(_0x3b57d3){if(!_0x3b57d3)fs[_0x954a('0x72')](_0x24ca2e);});});});}else{return _0x7b261c[_0x954a('0x13')](0xc8);}})['catch'](handleError(_0x7b261c,null));};
\ No newline at end of file
+var _0xc5b2=['rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','html-entities','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','update','then','destroy','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','key','getOptions','findAll','mail','query','user','catch','show','model','keys','attributes','fields','length','includeAll','merge','options','find','create','body','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','intersection','nolimit','order','sort','where','filters','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','spread','color','mailInteractionTags:save','removeTags','download','unix','toString','root','files','tmp','join','server','attachments','format','push','Attachments','from','bcc','subject','get','mkdirSync','each','Messages','missing.recipient@your.company.com','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','type','readFileSync','writeFileSync','message%d.eml','unlinkSync'];(function(_0x1220b3,_0x116386){var _0x4b3e86=function(_0x423be0){while(--_0x423be0){_0x1220b3['push'](_0x1220b3['shift']());}};_0x4b3e86(++_0x116386);}(_0xc5b2,0xec));var _0x2c5b=function(_0x471d7b,_0x2ba60e){_0x471d7b=_0x471d7b-0x0;var _0x225df0=_0xc5b2[_0x471d7b];return _0x225df0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c5b('0x0'));var zipdir=require(_0x2c5b('0x1'));var moment=require(_0x2c5b('0x2'));var BPromise=require(_0x2c5b('0x3'));var util=require(_0x2c5b('0x4'));var path=require(_0x2c5b('0x5'));var fs=require('fs');var _=require(_0x2c5b('0x6'));var juice=require(_0x2c5b('0x7'));var Redis=require(_0x2c5b('0x8'));var interaction=require(_0x2c5b('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0x2c5b('0xa'))('api');var config=require(_0x2c5b('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x2c5b('0xc'));config[_0x2c5b('0xd')]=_[_0x2c5b('0xe')](config[_0x2c5b('0xd')],{'host':_0x2c5b('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c5b('0xd')]));require('./mailInteraction.socket')[_0x2c5b('0x10')](socket);function respondWithStatusCode(_0x273548,_0x178078){_0x178078=_0x178078||0xcc;return function(_0x3d0bc2){if(_0x3d0bc2){return _0x273548[_0x2c5b('0x11')](_0x178078);}return _0x273548[_0x2c5b('0x12')](_0x178078)[_0x2c5b('0x13')]();};}function respondWithResult(_0xe900a7,_0x49987a){_0x49987a=_0x49987a||0xc8;return function(_0x250fdd){if(_0x250fdd){return _0xe900a7[_0x2c5b('0x12')](_0x49987a)[_0x2c5b('0x14')](_0x250fdd);}};}function respondWithFilteredResult(_0x24aa09,_0x1512c6){return function(_0x1b5e6){if(_0x1b5e6){var _0x4086a=typeof _0x1512c6['offset']==='undefined'&&typeof _0x1512c6['limit']===_0x2c5b('0x15');var _0x38b537=_0x1b5e6['count'];var _0x1381b9=_0x4086a?0x0:_0x1512c6[_0x2c5b('0x16')];var _0xc8b7a1=_0x4086a?_0x1b5e6[_0x2c5b('0x17')]:_0x1512c6[_0x2c5b('0x16')]+_0x1512c6[_0x2c5b('0x18')];var _0x796b8c;if(_0xc8b7a1>=_0x38b537){_0xc8b7a1=_0x38b537;_0x796b8c=0xc8;}else{_0x796b8c=0xce;}_0x24aa09[_0x2c5b('0x12')](_0x796b8c);return _0x24aa09['set'](_0x2c5b('0x19'),_0x1381b9+'-'+_0xc8b7a1+'/'+_0x38b537)[_0x2c5b('0x14')](_0x1b5e6);}return null;};}function saveUpdates(_0x1ac7ea){return function(_0x62c9cd){if(_0x62c9cd){return _0x62c9cd[_0x2c5b('0x1a')](_0x1ac7ea)[_0x2c5b('0x1b')](function(_0x1534ab){return _0x1534ab;});}return null;};}function removeEntity(_0x2b5536){return function(_0x394a9c){if(_0x394a9c){return _0x394a9c[_0x2c5b('0x1c')]()['then'](function(){_0x2b5536[_0x2c5b('0x12')](0xcc)[_0x2c5b('0x13')]();});}};}function handleEntityNotFound(_0x1dcdf6){return function(_0x3cdae0){if(!_0x3cdae0){_0x1dcdf6[_0x2c5b('0x11')](0x194);}return _0x3cdae0;};}function handleError(_0x3c7289,_0x54be9b){_0x54be9b=_0x54be9b||0x1f4;return function(_0x15ae2e){logger[_0x2c5b('0x1d')](_0x15ae2e[_0x2c5b('0x1e')]);if(_0x15ae2e[_0x2c5b('0x1f')]){delete _0x15ae2e[_0x2c5b('0x1f')];}_0x3c7289[_0x2c5b('0x12')](_0x54be9b)[_0x2c5b('0x20')](_0x15ae2e);};}exports[_0x2c5b('0x21')]=function(_0x1a19f5,_0x5b3d6d){var _0x2ab07a={};var _0x1e1004=_[_0x2c5b('0x22')](db[_0x2c5b('0x23')][_0x2c5b('0x24')],function(_0x2fc709){return{'name':_0x2fc709[_0x2c5b('0x25')],'type':_0x2fc709['type'][_0x2c5b('0x26')]};});_0x2ab07a=qs[_0x2c5b('0x27')](_0x1e1004,_0x1a19f5);return interaction[_0x2c5b('0x28')](_0x2c5b('0x29'),_0x1a19f5[_0x2c5b('0x2a')],_0x1a19f5[_0x2c5b('0x2b')],_0x2ab07a,_0x1e1004)['then'](respondWithFilteredResult(_0x5b3d6d,_0x2ab07a))[_0x2c5b('0x2c')](handleError(_0x5b3d6d,null));};exports[_0x2c5b('0x2d')]=function(_0x315a78,_0x20b995){var _0x3dfcd5={'raw':![],'where':{'id':_0x315a78['params']['id']}},_0x1c54b1={};_0x1c54b1[_0x2c5b('0x2e')]=_[_0x2c5b('0x2f')](db[_0x2c5b('0x23')][_0x2c5b('0x24')]);_0x1c54b1['query']=_[_0x2c5b('0x2f')](_0x315a78['query']);_0x1c54b1['filters']=_['intersection'](_0x1c54b1[_0x2c5b('0x2e')],_0x1c54b1[_0x2c5b('0x2a')]);_0x3dfcd5[_0x2c5b('0x30')]=_['intersection'](_0x1c54b1[_0x2c5b('0x2e')],qs['fields'](_0x315a78[_0x2c5b('0x2a')][_0x2c5b('0x31')]));_0x3dfcd5[_0x2c5b('0x30')]=_0x3dfcd5[_0x2c5b('0x30')][_0x2c5b('0x32')]?_0x3dfcd5[_0x2c5b('0x30')]:_0x1c54b1[_0x2c5b('0x2e')];if(_0x315a78['query'][_0x2c5b('0x33')]){_0x3dfcd5['include']=[{'all':!![]}];}_0x3dfcd5=_[_0x2c5b('0x34')]({},_0x3dfcd5,_0x315a78[_0x2c5b('0x35')]);return db['MailInteraction'][_0x2c5b('0x36')](_0x3dfcd5)['then'](handleEntityNotFound(_0x20b995,null))['then'](respondWithResult(_0x20b995,null))[_0x2c5b('0x2c')](handleError(_0x20b995,null));};exports[_0x2c5b('0x37')]=function(_0x3bc76f,_0x421bcb){return db['MailInteraction'][_0x2c5b('0x37')](_0x3bc76f[_0x2c5b('0x38')],{})[_0x2c5b('0x1b')](respondWithResult(_0x421bcb,0xc9))[_0x2c5b('0x2c')](handleError(_0x421bcb,null));};exports['update']=function(_0x344cdd,_0x589a8c){if(_0x344cdd[_0x2c5b('0x38')]['id']){delete _0x344cdd[_0x2c5b('0x38')]['id'];}return db['MailInteraction'][_0x2c5b('0x36')]({'where':{'id':_0x344cdd[_0x2c5b('0x39')]['id']}})[_0x2c5b('0x1b')](handleEntityNotFound(_0x589a8c,null))['then'](saveUpdates(_0x344cdd['body'],null))['then'](respondWithResult(_0x589a8c,null))[_0x2c5b('0x2c')](handleError(_0x589a8c,null));};exports[_0x2c5b('0x1c')]=function(_0xb81d05,_0x2fd288){return db['MailInteraction']['find']({'where':{'id':_0xb81d05[_0x2c5b('0x39')]['id']}})[_0x2c5b('0x1b')](handleEntityNotFound(_0x2fd288,null))[_0x2c5b('0x1b')](removeEntity(_0x2fd288,null))[_0x2c5b('0x2c')](handleError(_0x2fd288,null));};exports[_0x2c5b('0x3a')]=function(_0x566e2b,_0x8d7426){return db[_0x2c5b('0x23')][_0x2c5b('0x3a')]()['then'](respondWithResult(_0x8d7426,null))[_0x2c5b('0x2c')](handleError(_0x8d7426,null));};exports[_0x2c5b('0x3b')]=function(_0x827f71,_0x2f6dd3){return db[_0x2c5b('0x3c')][_0x2c5b('0x36')]({'where':{'id':_0x827f71['params']['id']}})['then'](handleEntityNotFound(_0x2f6dd3,null))['then'](function(_0x1a05f0){if(_0x1a05f0){return _0x1a05f0['addMessage'](_0x827f71[_0x2c5b('0x38')][_0x2c5b('0x3d')],_[_0x2c5b('0x3e')](_0x827f71['body'],[_0x2c5b('0x3d'),'id'])||{});}})[_0x2c5b('0x1b')](respondWithResult(_0x2f6dd3,null))[_0x2c5b('0x2c')](handleError(_0x2f6dd3,null));};exports[_0x2c5b('0x3f')]=function(_0x436078,_0x2b031d){var _0x4bb0ad={'raw':![],'where':{}};var _0x45d3e9={};var _0x752c1={'count':0x0,'rows':[]};return db[_0x2c5b('0x23')][_0x2c5b('0x40')]({'where':{'id':_0x436078[_0x2c5b('0x39')]['id']}})[_0x2c5b('0x1b')](handleEntityNotFound(_0x2b031d,null))[_0x2c5b('0x1b')](function(_0x4ff6fc){if(_0x4ff6fc){_0x45d3e9['model']=_[_0x2c5b('0x2f')](db[_0x2c5b('0x3c')][_0x2c5b('0x24')]);_0x45d3e9[_0x2c5b('0x2a')]=_[_0x2c5b('0x2f')](_0x436078['query']);_0x45d3e9['filters']=_[_0x2c5b('0x41')](_0x45d3e9[_0x2c5b('0x2e')],_0x45d3e9[_0x2c5b('0x2a')]);_0x4bb0ad[_0x2c5b('0x30')]=_[_0x2c5b('0x41')](_0x45d3e9[_0x2c5b('0x2e')],qs['fields'](_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x31')]));_0x4bb0ad[_0x2c5b('0x30')]=_0x4bb0ad[_0x2c5b('0x30')][_0x2c5b('0x32')]?_0x4bb0ad[_0x2c5b('0x30')]:_0x45d3e9[_0x2c5b('0x2e')];if(!_0x436078[_0x2c5b('0x2a')]['hasOwnProperty'](_0x2c5b('0x42'))){_0x4bb0ad[_0x2c5b('0x18')]=qs[_0x2c5b('0x18')](_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x18')]);_0x4bb0ad[_0x2c5b('0x16')]=qs['offset'](_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x16')]);}_0x4bb0ad[_0x2c5b('0x43')]=qs[_0x2c5b('0x44')](_0x436078[_0x2c5b('0x2a')]['sort']);_0x4bb0ad[_0x2c5b('0x45')]=qs[_0x2c5b('0x46')](_[_0x2c5b('0x47')](_0x436078['query'],_0x45d3e9['filters']));_0x4bb0ad['where'][_0x2c5b('0x48')]=_0x4ff6fc['id'];if(_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x49')]){_0x4bb0ad['where']=_[_0x2c5b('0x34')](_0x4bb0ad[_0x2c5b('0x45')],{'$or':_[_0x2c5b('0x22')](_0x4bb0ad[_0x2c5b('0x30')],function(_0x502d49){var _0x1df890={};_0x1df890[_0x502d49]={'$like':'%'+_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x49')]+'%'};return _0x1df890;})});}if(_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x4a')]){var _0x26c50f=_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x4a')][_0x2c5b('0x4b')](',');var _0x2c8311={};_0x2c8311[_0x26c50f[0x0]]={'$gte':moment(_0x26c50f[0x1])['format'](_0x2c5b('0x4c'))};_0x4bb0ad[_0x2c5b('0x45')]=_[_0x2c5b('0x34')](_0x4bb0ad[_0x2c5b('0x45')],_0x2c8311);}_0x4bb0ad=_['merge']({},_0x4bb0ad,_0x436078['options']);return db[_0x2c5b('0x3c')]['count']({'where':_0x4bb0ad[_0x2c5b('0x45')]})[_0x2c5b('0x1b')](function(_0x4df17e){_0x752c1[_0x2c5b('0x17')]=_0x4df17e;if(_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x33')]){_0x4bb0ad['include']=[{'all':!![]}];}return db[_0x2c5b('0x3c')][_0x2c5b('0x28')](_0x4bb0ad);})[_0x2c5b('0x1b')](function(_0x4ffcf2){if(_0x436078[_0x2c5b('0x2a')][_0x2c5b('0x4d')]===_0x2c5b('0x4e')){for(var _0x36c651=0x0;_0x36c651<_0x4ffcf2['length'];_0x36c651++){_0x4ffcf2[_0x36c651]['body']=juice(_0x4ffcf2[_0x36c651][_0x2c5b('0x38')]);}}_0x752c1[_0x2c5b('0x4f')]=_0x4ffcf2;return _0x752c1;});}})[_0x2c5b('0x1b')](respondWithFilteredResult(_0x2b031d,_0x4bb0ad))[_0x2c5b('0x2c')](handleError(_0x2b031d,null));};exports[_0x2c5b('0x50')]=function(_0x138e17,_0x4e07ee){return db[_0x2c5b('0x23')][_0x2c5b('0x36')]({'where':{'id':_0x138e17['params']['id']}})[_0x2c5b('0x1b')](handleEntityNotFound(_0x4e07ee,null))[_0x2c5b('0x1b')](function(_0x201318){if(_0x201318){return _0x201318[_0x2c5b('0x51')](_0x138e17[_0x2c5b('0x38')][_0x2c5b('0x3d')],_['omit'](_0x138e17[_0x2c5b('0x38')],['ids','id'])||{})[_0x2c5b('0x52')](function(){return db['Tag'][_0x2c5b('0x28')]({'attributes':['id','name',_0x2c5b('0x53')],'where':{'id':_0x138e17[_0x2c5b('0x38')][_0x2c5b('0x3d')]}});})[_0x2c5b('0x1b')](function(_0x2f6769){socket['emit'](_0x2c5b('0x54'),{'id':Number(_0x138e17[_0x2c5b('0x39')]['id']),'tags':_0x2f6769||[]});return{'id':Number(_0x138e17[_0x2c5b('0x39')]['id']),'tags':_0x2f6769||[]};});}})['then'](respondWithResult(_0x4e07ee,null))['catch'](handleError(_0x4e07ee,null));};exports[_0x2c5b('0x55')]=function(_0x4c0b85,_0x1cb2e2){return db['MailInteraction']['find']({'where':{'id':_0x4c0b85[_0x2c5b('0x39')]['id']}})[_0x2c5b('0x1b')](handleEntityNotFound(_0x1cb2e2,null))[_0x2c5b('0x1b')](function(_0x5dd7b4){if(_0x5dd7b4){return _0x5dd7b4[_0x2c5b('0x55')](_0x4c0b85[_0x2c5b('0x2a')]['ids']);}})['then'](respondWithStatusCode(_0x1cb2e2,null))[_0x2c5b('0x2c')](handleError(_0x1cb2e2,null));};exports[_0x2c5b('0x56')]=function(_0x2c8d6f,_0x4eaebf){var _0x58f1ac=moment()[_0x2c5b('0x57')]()[_0x2c5b('0x58')]();var _0x13329e=path['join'](config[_0x2c5b('0x59')],'server',_0x2c5b('0x5a'),_0x2c5b('0x5b'));var _0x2d68aa=path[_0x2c5b('0x5c')](config[_0x2c5b('0x59')],_0x2c5b('0x5d'),'files',_0x2c5b('0x5e'));var _0x2c73c2=path[_0x2c5b('0x5c')](_0x13329e,_0x58f1ac);var _0x2c2a7a=util[_0x2c5b('0x5f')]('transcript-%d-%s.zip',_0x2c8d6f[_0x2c5b('0x39')]['id'],_0x58f1ac);var _0x2f6b50=path[_0x2c5b('0x5c')](_0x13329e,_0x2c2a7a);var _0x368bac=[];if(_0x2c8d6f[_0x2c5b('0x2a')][_0x2c5b('0x5e')]){_0x368bac[_0x2c5b('0x60')]({'model':db['Attachment'],'as':_0x2c5b('0x61'),'raw':!![]});}var _0x34a435=[{'model':db[_0x2c5b('0x3c')],'as':'Messages','attributes':['id',_0x2c5b('0x38'),_0x2c5b('0x62'),'to','cc',_0x2c5b('0x63'),_0x2c5b('0x64'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x368bac}];return db[_0x2c5b('0x23')][_0x2c5b('0x36')]({'where':{'id':_0x2c8d6f[_0x2c5b('0x39')]['id']},'include':_0x34a435})[_0x2c5b('0x1b')](handleEntityNotFound(_0x4eaebf,null))[_0x2c5b('0x1b')](function(_0x4f9396){if(_0x4f9396&&_0x4f9396['Messages']){var _0x1ac9d0=_0x4f9396[_0x2c5b('0x65')]({'plain':!![]});fs[_0x2c5b('0x66')](_0x2c73c2);return BPromise[_0x2c5b('0x67')](_0x1ac9d0[_0x2c5b('0x68')],function(_0x43b4cc,_0x4088d4){var _0x177998={'from':_0x43b4cc[_0x2c5b('0x62')],'to':_0x43b4cc['to']||_0x2c5b('0x69'),'subject':_0x43b4cc[_0x2c5b('0x64')],'html':htmlEntities[_0x2c5b('0x6a')](_0x43b4cc[_0x2c5b('0x38')]),'headers':{'Date':moment(_0x43b4cc[_0x2c5b('0x6b')])[_0x2c5b('0x5f')](_0x2c5b('0x6c'))},'attachments':[]};if(_0x43b4cc['cc']){_0x177998[_0x2c5b('0x6d')]['Cc']=_0x43b4cc['cc'];}if(_0x43b4cc[_0x2c5b('0x63')]){_0x177998[_0x2c5b('0x6d')][_0x2c5b('0x6e')]=_0x43b4cc[_0x2c5b('0x63')];}return new BPromise(function(_0x5dff60,_0x11f5d1){if(_0x43b4cc[_0x2c5b('0x61')]){for(var _0x38bc32=0x0;_0x38bc32<_0x43b4cc['Attachments'][_0x2c5b('0x32')];_0x38bc32++){var _0x46ee6c=_0x43b4cc[_0x2c5b('0x61')][_0x38bc32];var _0xee233e=path['join'](_0x2d68aa,_0x46ee6c[_0x2c5b('0x6f')]);if(fs[_0x2c5b('0x70')](_0xee233e)){_0x177998[_0x2c5b('0x5e')][_0x2c5b('0x60')]({'name':_0x46ee6c[_0x2c5b('0x1f')],'contentType':_0x46ee6c[_0x2c5b('0x71')],'data':fs[_0x2c5b('0x72')](_0xee233e)});}}}emlformat['build'](_0x177998,function(_0xe75f30,_0x35202f){if(_0xe75f30)return _0x11f5d1(_0xe75f30);fs[_0x2c5b('0x73')](path[_0x2c5b('0x5c')](_0x2c73c2,util['format'](_0x2c5b('0x74'),_0x4088d4)),_0x35202f);return _0x5dff60(_0x35202f);});});})[_0x2c5b('0x1b')](function(){return new BPromise(function(_0x576163,_0x4e2998){zipdir(_0x2c73c2,{'saveTo':_0x2f6b50},function(_0x224c6b,_0x346732){if(_0x224c6b)return _0x4e2998(_0x224c6b);return _0x576163(_0x346732);});})[_0x2c5b('0x1b')](function(){return new BPromise(function(_0x59a866,_0x4741fd){rimraf(_0x2c73c2,function(_0x2a34d0){if(_0x2a34d0)_0x4741fd(_0x2a34d0);return _0x59a866();});});})[_0x2c5b('0x1b')](function(){return _0x4eaebf[_0x2c5b('0x56')](_0x2f6b50,_0x2c2a7a,function(_0x49ebc){if(!_0x49ebc)fs[_0x2c5b('0x75')](_0x2f6b50);});});});}else{return _0x4eaebf[_0x2c5b('0x11')](0xc8);}})[_0x2c5b('0x2c')](handleError(_0x4eaebf,null));};
\ No newline at end of file
index 8258b13..acf46db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceb5=['then','setDataValue','Users','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','MailInteraction','MailMessage','save','getUsers'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xceb5,0x13d));var _0x5ceb=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xceb5[_0x125ff8];return _0x2d9ef;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x5ceb('0x0'))['db'][_0x5ceb('0x1')];var MailMessage=require(_0x5ceb('0x0'))['db'][_0x5ceb('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ceb('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a30c1){return function(_0x14223c,_0x158590,_0x40a88b){_0x14223c[_0x5ceb('0x4')]({'attributes':['id'],'raw':!![]})[_0x5ceb('0x5')](function(_0x5e6e89){_0x14223c[_0x5ceb('0x6')](_0x5ceb('0x7'),_0x5e6e89['map'](function(_0x241686){return{'id':_0x241686['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x14223c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5ceb('0x5')](function(_0x2a5afc){_0x14223c[_0x5ceb('0x6')](_0x5ceb('0x8'),_0x2a5afc[_0x5ceb('0x9')]);MailInteractionEvents['emit'](_0x5a30c1+':'+_0x14223c['id'],_0x14223c);MailInteractionEvents[_0x5ceb('0xa')](_0x5a30c1,_0x14223c);_0x40a88b(null);})[_0x5ceb('0xb')](_0x40a88b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x5ceb('0xc')](e,emitEvent(event));}}module[_0x5ceb('0xd')]=MailInteractionEvents;
\ No newline at end of file
+var _0xe89f=['setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','MailMessage'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe89f,0x96));var _0xfe89=function(_0x30b398,_0xcd8300){_0x30b398=_0x30b398-0x0;var _0x5b5516=_0xe89f[_0x30b398];return _0x5b5516;};'use strict';var EventEmitter=require(_0xfe89('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xfe89('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xfe89('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xfe89('0x3')](0x0);var events={'afterCreate':_0xfe89('0x4'),'afterUpdate':'update','afterDestroy':_0xfe89('0x5')};function emitEvent(_0x4a3f9f){return function(_0x838735,_0x240279,_0x2ab459){_0x838735[_0xfe89('0x6')]({'attributes':['id'],'raw':!![]})[_0xfe89('0x7')](function(_0x26ccfc){_0x838735[_0xfe89('0x8')]('Users',_0x26ccfc[_0xfe89('0x9')](function(_0x4cd028){return{'id':_0x4cd028['id']};}));return MailMessage[_0xfe89('0xa')]({'where':{'MailInteractionId':_0x838735['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfe89('0x7')](function(_0x5448b8){_0x838735['setDataValue']('unreadMessages',_0x5448b8[_0xfe89('0xb')]);MailInteractionEvents[_0xfe89('0xc')](_0x4a3f9f+':'+_0x838735['id'],_0x838735);MailInteractionEvents[_0xfe89('0xc')](_0x4a3f9f,_0x838735);_0x2ab459(null);})[_0xfe89('0xd')](_0x2ab459(null));};}for(var e in events){if(events[_0xfe89('0xe')](e)){var event=events[e];MailInteraction[_0xfe89('0xf')](e,emitEvent(event));}}module[_0xfe89('0x10')]=MailInteractionEvents;
\ No newline at end of file
index b345068..5a3018f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4858=['./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x8d9399,_0x490955){var _0x5a0645=function(_0x404d19){while(--_0x404d19){_0x8d9399['push'](_0x8d9399['shift']());}};_0x5a0645(++_0x490955);}(_0x4858,0xe9));var _0x8485=function(_0x122b1c,_0x1de475){_0x122b1c=_0x122b1c-0x0;var _0x5b42b6=_0x4858[_0x122b1c];return _0x5b42b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8485('0x0'))(_0x8485('0x1'));var moment=require(_0x8485('0x2'));var BPromise=require(_0x8485('0x3'));var rp=require(_0x8485('0x4'));var fs=require('fs');var path=require(_0x8485('0x5'));var rimraf=require(_0x8485('0x6'));var config=require('../../config/environment');var attributes=require(_0x8485('0x7'));module[_0x8485('0x8')]=function(_0x22f284,_0x170890){return _0x22f284['define'](_0x8485('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x8485('0xa'),'fields':[_0x8485('0xb'),'to'],'type':_0x8485('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xc6a21c,_0x19ea4c,_0xc05656){if(_0xc6a21c[_0x8485('0xd')]){_0xc6a21c[_0x8485('0xe')]=moment()[_0x8485('0xf')](_0x8485('0x10'));}if(_0xc6a21c[_0x8485('0x11')]){_0xc6a21c[_0x8485('0x12')]=moment()['format'](_0x8485('0x10'));}_0xc05656(null,_0x19ea4c);},'beforeUpdate':function(_0x30ba32,_0x38ef28,_0x5840cb){if(_0x30ba32[_0x8485('0x13')](_0x8485('0xd'))){_0x30ba32[_0x8485('0xe')]=_0x30ba32[_0x8485('0xd')]?moment()[_0x8485('0xf')](_0x8485('0x10')):null;}if(_0x30ba32['changed']('closed')){_0x30ba32[_0x8485('0x12')]=moment()[_0x8485('0xf')](_0x8485('0x10'));_0x30ba32['substatus']=null;_0x30ba32[_0x8485('0xe')]=null;}_0x5840cb(null,_0x30ba32);},'afterUpdate':function(_0x2b084d,_0x30b436,_0x568cd6){var _0x3c071d=_0x22f284[_0x8485('0x14')];var _0x4118fb=_0x2b084d[_0x8485('0x15')]({'plain':!![]});if(_0x4118fb[_0x8485('0x11')]){return _0x3c071d['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x4118fb['id']}})['then'](function(){_0x568cd6();})['catch'](function(_0x579f26){_0x568cd6(_0x579f26);});}else{_0x568cd6();}}},'charset':_0x8485('0x16'),'collate':_0x8485('0x17')});};
\ No newline at end of file
+var _0x7b60=['subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','mail_interactions','fti_mail_interactions'];(function(_0x5cfdf6,_0x3e1f36){var _0x39a9a5=function(_0x432cb8){while(--_0x432cb8){_0x5cfdf6['push'](_0x5cfdf6['shift']());}};_0x39a9a5(++_0x3e1f36);}(_0x7b60,0x1f0));var _0x07b6=function(_0x1aef48,_0x19708e){_0x1aef48=_0x1aef48-0x0;var _0xf02a32=_0x7b60[_0x1aef48];return _0xf02a32;};'use strict';var _=require(_0x07b6('0x0'));var util=require(_0x07b6('0x1'));var logger=require(_0x07b6('0x2'))(_0x07b6('0x3'));var moment=require(_0x07b6('0x4'));var BPromise=require(_0x07b6('0x5'));var rp=require(_0x07b6('0x6'));var fs=require('fs');var path=require(_0x07b6('0x7'));var rimraf=require(_0x07b6('0x8'));var config=require(_0x07b6('0x9'));var attributes=require(_0x07b6('0xa'));module['exports']=function(_0x59c3f9,_0x38b9cf){return _0x59c3f9[_0x07b6('0xb')]('MailInteraction',attributes,{'tableName':_0x07b6('0xc'),'paranoid':![],'indexes':[{'name':_0x07b6('0xd'),'fields':[_0x07b6('0xe'),'to'],'type':_0x07b6('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7d2efe,_0x326da6,_0x3624e7){if(_0x7d2efe[_0x07b6('0x10')]){_0x7d2efe[_0x07b6('0x11')]=moment()[_0x07b6('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7d2efe[_0x07b6('0x13')]){_0x7d2efe[_0x07b6('0x14')]=moment()[_0x07b6('0x12')](_0x07b6('0x15'));}_0x3624e7(null,_0x326da6);},'beforeUpdate':function(_0x302284,_0x662869,_0xab2430){if(_0x302284[_0x07b6('0x16')](_0x07b6('0x10'))){_0x302284[_0x07b6('0x11')]=_0x302284[_0x07b6('0x10')]?moment()[_0x07b6('0x12')](_0x07b6('0x15')):null;}if(_0x302284[_0x07b6('0x16')](_0x07b6('0x13'))){_0x302284[_0x07b6('0x14')]=moment()[_0x07b6('0x12')](_0x07b6('0x15'));_0x302284['substatus']=null;_0x302284[_0x07b6('0x11')]=null;}_0xab2430(null,_0x302284);},'afterUpdate':function(_0x3aad52,_0x17743a,_0x2e0a96){var _0x1dd260=_0x59c3f9[_0x07b6('0x17')];var _0x671b0e=_0x3aad52[_0x07b6('0x18')]({'plain':!![]});if(_0x671b0e[_0x07b6('0x13')]){return _0x1dd260[_0x07b6('0x19')][_0x07b6('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x671b0e['id']}})[_0x07b6('0x1b')](function(){_0x2e0a96();})[_0x07b6('0x1c')](function(_0x2ab02e){_0x2e0a96(_0x2ab02e);});}else{_0x2e0a96();}}},'charset':_0x07b6('0x1d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index e91bcd7..745053c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f5=['code','message','result','catch','update','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','find','addTags','body','omit','ids','spread','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3fde5c,_0x48512f){var _0xa433f8=function(_0x18d4e2){while(--_0x18d4e2){_0x3fde5c['push'](_0x3fde5c['shift']());}};_0xa433f8(++_0x48512f);}(_0xe1f5,0x1ec));var _0x5e1f=function(_0x2e83e5,_0x5ef8d5){_0x2e83e5=_0x2e83e5-0x0;var _0x18867b=_0xe1f5[_0x2e83e5];return _0x18867b;};'use strict';var _=require(_0x5e1f('0x0'));var util=require(_0x5e1f('0x1'));var moment=require('moment');var BPromise=require(_0x5e1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e1f('0x3'));var db=require(_0x5e1f('0x4'))['db'];var utils=require(_0x5e1f('0x5'));var logger=require(_0x5e1f('0x6'))('rpc');var config=require(_0x5e1f('0x7'));var jayson=require(_0x5e1f('0x8'));var client=jayson[_0x5e1f('0x9')][_0x5e1f('0xa')]({'port':0x232a});config[_0x5e1f('0xb')]=_[_0x5e1f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e1f('0xd'))(new Redis(config[_0x5e1f('0xb')]));require(_0x5e1f('0xe'))['register'](socket);function respondWithRpcPromise(_0x1108f3,_0x1213ee,_0x1ab549){return new BPromise(function(_0x7a2ebc,_0x5d0057){return client[_0x5e1f('0xf')](_0x1108f3,_0x1ab549)[_0x5e1f('0x10')](function(_0x17e9bb){logger[_0x5e1f('0x11')](_0x5e1f('0x12'),_0x1213ee,'request\x20sent');logger[_0x5e1f('0x13')](_0x5e1f('0x14'),_0x1213ee,_0x5e1f('0x15'),JSON[_0x5e1f('0x16')](_0x17e9bb));if(_0x17e9bb[_0x5e1f('0x17')]){if(_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x18')]===0x1f4){logger['error'](_0x5e1f('0x12'),_0x1213ee,_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x19')]);return _0x5d0057(_0x17e9bb[_0x5e1f('0x17')]['message']);}logger[_0x5e1f('0x17')](_0x5e1f('0x12'),_0x1213ee,_0x17e9bb['error'][_0x5e1f('0x19')]);return _0x7a2ebc(_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x19')]);}else{logger[_0x5e1f('0x11')]('MailInteraction,\x20%s,\x20%s',_0x1213ee,_0x5e1f('0x15'));_0x7a2ebc(_0x17e9bb[_0x5e1f('0x1a')][_0x5e1f('0x19')]);}})[_0x5e1f('0x1b')](function(_0x516b8c){logger[_0x5e1f('0x17')](_0x5e1f('0x12'),_0x1213ee,_0x516b8c);_0x5d0057(_0x516b8c);});});}exports['UpdateMailInteraction']=function(_0x3a9d50){var _0x496293=this;return new Promise(function(_0x4d7b56,_0x2d2710){return db['MailInteraction'][_0x5e1f('0x1c')](_0x3a9d50['body'],{'raw':_0x3a9d50[_0x5e1f('0x1d')]?_0x3a9d50['options'][_0x5e1f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a9d50[_0x5e1f('0x1d')]?_0x3a9d50[_0x5e1f('0x1d')][_0x5e1f('0x1f')]||null:null,'attributes':_0x3a9d50['options']?_0x3a9d50['options'][_0x5e1f('0x20')]||null:null,'limit':_0x3a9d50[_0x5e1f('0x1d')]?_0x3a9d50['options'][_0x5e1f('0x21')]||null:null})[_0x5e1f('0x10')](function(_0x47b680){logger[_0x5e1f('0x11')](_0x5e1f('0x22'),_0x3a9d50);logger['debug']('UpdateMailInteraction',_0x3a9d50,JSON['stringify'](_0x47b680));_0x4d7b56(_0x47b680);})[_0x5e1f('0x1b')](function(_0x2ef95c){logger[_0x5e1f('0x17')](_0x5e1f('0x22'),_0x2ef95c[_0x5e1f('0x19')],_0x3a9d50);_0x2d2710(_0x496293[_0x5e1f('0x17')](0x1f4,_0x2ef95c[_0x5e1f('0x19')]));});});};exports[_0x5e1f('0x23')]=function(_0x57c9dc){return new Promise(function(_0x4a562b,_0x57239d){return db[_0x5e1f('0x24')][_0x5e1f('0x25')]({'where':_0x57c9dc['options']?_0x57c9dc[_0x5e1f('0x1d')][_0x5e1f('0x1f')]||null:null})[_0x5e1f('0x10')](function(_0xbdbedd){if(_0xbdbedd){return _0xbdbedd[_0x5e1f('0x26')](_0x57c9dc[_0x5e1f('0x27')]['ids'],_[_0x5e1f('0x28')](_0x57c9dc[_0x5e1f('0x27')],[_0x5e1f('0x29'),'id'])||{});}})[_0x5e1f('0x2a')](function(_0xd35099){logger['info']('AddTags',_0x57c9dc);logger[_0x5e1f('0x13')]('AddTags',_0x57c9dc,JSON[_0x5e1f('0x16')](_0xd35099));_0x4a562b(_0xd35099);})['catch'](function(_0x8f196a){logger['error']('AddTags',_0x8f196a[_0x5e1f('0x19')],_0x57c9dc);_0x57239d(_this['error'](0x1f4,_0x8f196a[_0x5e1f('0x19')]));});});};
\ No newline at end of file
+var _0x054c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','then','debug','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x1dd572,_0x55ba87){var _0x14064e=function(_0xaf68c8){while(--_0xaf68c8){_0x1dd572['push'](_0x1dd572['shift']());}};_0x14064e(++_0x55ba87);}(_0x054c,0x194));var _0xc054=function(_0x329624,_0xa07a63){_0x329624=_0x329624-0x0;var _0x3d6812=_0x054c[_0x329624];return _0x3d6812;};'use strict';var _=require(_0xc054('0x0'));var util=require(_0xc054('0x1'));var moment=require('moment');var BPromise=require(_0xc054('0x2'));var rs=require(_0xc054('0x3'));var fs=require('fs');var Redis=require(_0xc054('0x4'));var db=require(_0xc054('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc054('0x6'))(_0xc054('0x7'));var config=require(_0xc054('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc054('0x9')][_0xc054('0xa')]({'port':0x232a});config[_0xc054('0xb')]=_[_0xc054('0xc')](config['redis'],{'host':_0xc054('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc054('0xb')]));require(_0xc054('0xe'))[_0xc054('0xf')](socket);function respondWithRpcPromise(_0x198e51,_0x1f3d41,_0x48d0ed){return new BPromise(function(_0xbeade,_0x490644){return client[_0xc054('0x10')](_0x198e51,_0x48d0ed)['then'](function(_0x2b8189){logger[_0xc054('0x11')](_0xc054('0x12'),_0x1f3d41,_0xc054('0x13'));logger['debug'](_0xc054('0x14'),_0x1f3d41,_0xc054('0x13'),JSON[_0xc054('0x15')](_0x2b8189));if(_0x2b8189[_0xc054('0x16')]){if(_0x2b8189['error'][_0xc054('0x17')]===0x1f4){logger[_0xc054('0x16')]('MailInteraction,\x20%s,\x20%s',_0x1f3d41,_0x2b8189[_0xc054('0x16')][_0xc054('0x18')]);return _0x490644(_0x2b8189[_0xc054('0x16')][_0xc054('0x18')]);}logger[_0xc054('0x16')](_0xc054('0x12'),_0x1f3d41,_0x2b8189[_0xc054('0x16')][_0xc054('0x18')]);return _0xbeade(_0x2b8189[_0xc054('0x16')][_0xc054('0x18')]);}else{logger['info'](_0xc054('0x12'),_0x1f3d41,_0xc054('0x13'));_0xbeade(_0x2b8189[_0xc054('0x19')][_0xc054('0x18')]);}})[_0xc054('0x1a')](function(_0x2216cd){logger[_0xc054('0x16')](_0xc054('0x12'),_0x1f3d41,_0x2216cd);_0x490644(_0x2216cd);});});}exports[_0xc054('0x1b')]=function(_0x2803c3){var _0x2c2aef=this;return new Promise(function(_0x1fc85a,_0x4670bb){return db[_0xc054('0x1c')][_0xc054('0x1d')](_0x2803c3[_0xc054('0x1e')],{'raw':_0x2803c3[_0xc054('0x1f')]?_0x2803c3[_0xc054('0x1f')][_0xc054('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2803c3['options']?_0x2803c3['options'][_0xc054('0x21')]||null:null,'attributes':_0x2803c3[_0xc054('0x1f')]?_0x2803c3[_0xc054('0x1f')][_0xc054('0x22')]||null:null,'limit':_0x2803c3[_0xc054('0x1f')]?_0x2803c3['options'][_0xc054('0x23')]||null:null})[_0xc054('0x24')](function(_0x1a8a12){logger[_0xc054('0x11')](_0xc054('0x1b'),_0x2803c3);logger[_0xc054('0x25')](_0xc054('0x1b'),_0x2803c3,JSON[_0xc054('0x15')](_0x1a8a12));_0x1fc85a(_0x1a8a12);})[_0xc054('0x1a')](function(_0x4fae55){logger[_0xc054('0x16')](_0xc054('0x1b'),_0x4fae55[_0xc054('0x18')],_0x2803c3);_0x4670bb(_0x2c2aef[_0xc054('0x16')](0x1f4,_0x4fae55[_0xc054('0x18')]));});});};exports[_0xc054('0x26')]=function(_0x1c9272){return new Promise(function(_0x106fa2,_0x2a1b5f){return db['MailInteraction'][_0xc054('0x27')]({'where':_0x1c9272['options']?_0x1c9272['options'][_0xc054('0x21')]||null:null})[_0xc054('0x24')](function(_0x83506){if(_0x83506){return _0x83506[_0xc054('0x28')](_0x1c9272[_0xc054('0x1e')][_0xc054('0x29')],_[_0xc054('0x2a')](_0x1c9272[_0xc054('0x1e')],[_0xc054('0x29'),'id'])||{});}})[_0xc054('0x2b')](function(_0x2bec07){logger[_0xc054('0x11')](_0xc054('0x2c'),_0x1c9272);logger[_0xc054('0x25')](_0xc054('0x2c'),_0x1c9272,JSON[_0xc054('0x15')](_0x2bec07));_0x106fa2(_0x2bec07);})['catch'](function(_0x48425d){logger[_0xc054('0x16')](_0xc054('0x2c'),_0x48425d[_0xc054('0x18')],_0x1c9272);_0x2a1b5f(_this[_0xc054('0x16')](0x1f4,_0x48425d[_0xc054('0x18')]));});});};
\ No newline at end of file
index d93ec45..3d377a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62b5=['length','save','remove','update','emit','removeListener','register'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x62b5,0xfd));var _0x562b=function(_0x133d96,_0x7da881){_0x133d96=_0x133d96-0x0;var _0x709593=_0x62b5[_0x133d96];return _0x709593;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x562b('0x0'),_0x562b('0x1'),_0x562b('0x2')];function createListener(_0x51cc2a,_0x4c3935){return function(_0x164a22){_0x4c3935[_0x562b('0x3')](_0x51cc2a,_0x164a22);};}function removeListener(_0x31ea97,_0x5df308){return function(){MailInteractionEvents[_0x562b('0x4')](_0x31ea97,_0x5df308);};}exports[_0x562b('0x5')]=function(_0x487904){for(var _0x47ed09=0x0,_0x5d70b2=events[_0x562b('0x6')];_0x47ed09<_0x5d70b2;_0x47ed09++){var _0x14fc13=events[_0x47ed09];var _0x231e44=createListener('mailInteraction:'+_0x14fc13,_0x487904);MailInteractionEvents['on'](_0x14fc13,_0x231e44);}};
\ No newline at end of file
+var _0x5ee8=['mailInteraction:','save','remove','emit','removeListener','register','length'];(function(_0x44aaab,_0x57bb6b){var _0x1d9385=function(_0xf0ca55){while(--_0xf0ca55){_0x44aaab['push'](_0x44aaab['shift']());}};_0x1d9385(++_0x57bb6b);}(_0x5ee8,0x8d));var _0x85ee=function(_0x40a687,_0x237971){_0x40a687=_0x40a687-0x0;var _0x41dd26=_0x5ee8[_0x40a687];return _0x41dd26;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x85ee('0x0'),_0x85ee('0x1'),'update'];function createListener(_0x466577,_0x236006){return function(_0x3925e2){_0x236006[_0x85ee('0x2')](_0x466577,_0x3925e2);};}function removeListener(_0x22ded8,_0x4d2505){return function(){MailInteractionEvents[_0x85ee('0x3')](_0x22ded8,_0x4d2505);};}exports[_0x85ee('0x4')]=function(_0x25869d){for(var _0x1192cf=0x0,_0xf50432=events[_0x85ee('0x5')];_0x1192cf<_0xf50432;_0x1192cf++){var _0x1ee26f=events[_0x1192cf];var _0x4b64e6=createListener(_0x85ee('0x6')+_0x1ee26f,_0x25869d);MailInteractionEvents['on'](_0x1ee26f,_0x4b64e6);}};
\ No newline at end of file
index 33a2214..dc23f89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x119c=['create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','tracked','mailmessage:create'];(function(_0x5ac892,_0x4e9058){var _0x552792=function(_0x2ebacf){while(--_0x2ebacf){_0x5ac892['push'](_0x5ac892['shift']());}};_0x552792(++_0x4e9058);}(_0x119c,0xa5));var _0xc119=function(_0x5713b5,_0x423f83){_0x5713b5=_0x5713b5-0x0;var _0x2f795d=_0x119c[_0x5713b5];return _0x2f795d;};'use strict';var multer=require(_0xc119('0x0'));var util=require('util');var path=require(_0xc119('0x1'));var timeout=require(_0xc119('0x2'));var express=require(_0xc119('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc119('0x4'));var interaction=require(_0xc119('0x5'));var config=require(_0xc119('0x6'));var controller=require(_0xc119('0x7'));router[_0xc119('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc119('0x8')]('/describe',auth[_0xc119('0x9')](),controller[_0xc119('0xa')]);router[_0xc119('0x8')](_0xc119('0xb'),auth[_0xc119('0x9')](),controller[_0xc119('0xc')]);router[_0xc119('0x8')](_0xc119('0xd'),auth[_0xc119('0x9')](),controller[_0xc119('0xe')]);router['post']('/',auth[_0xc119('0x9')](),interaction[_0xc119('0xf')]('mail',_0xc119('0x10')),controller[_0xc119('0x11')]);router[_0xc119('0x12')](_0xc119('0xb'),auth[_0xc119('0x9')](),controller[_0xc119('0x13')]);router[_0xc119('0x12')](_0xc119('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0xc119('0x12')](_0xc119('0x15'),auth['isAuthenticated'](),controller[_0xc119('0x16')]);router[_0xc119('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc119('0x18')]);module[_0xc119('0x19')]=router;
\ No newline at end of file
+var _0x557d=['../../components/auth/service','get','index','/describe','describe','/:id','/:id/download','isAuthenticated','download','post','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x557d,0xcb));var _0xd557=function(_0x1d098d,_0x25f323){_0x1d098d=_0x1d098d-0x0;var _0x41f81c=_0x557d[_0x1d098d];return _0x41f81c;};'use strict';var multer=require(_0xd557('0x0'));var util=require(_0xd557('0x1'));var path=require(_0xd557('0x2'));var timeout=require(_0xd557('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd557('0x4'));var auth=require(_0xd557('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xd557('0x6')]('/',auth['isAuthenticated'](),controller[_0xd557('0x7')]);router[_0xd557('0x6')](_0xd557('0x8'),auth['isAuthenticated'](),controller[_0xd557('0x9')]);router['get'](_0xd557('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd557('0x6')](_0xd557('0xb'),auth[_0xd557('0xc')](),controller[_0xd557('0xd')]);router[_0xd557('0xe')]('/',auth[_0xd557('0xc')](),interaction['tracked'](_0xd557('0xf'),_0xd557('0x10')),controller[_0xd557('0x11')]);router[_0xd557('0x12')](_0xd557('0xa'),auth[_0xd557('0xc')](),controller[_0xd557('0x13')]);router[_0xd557('0x12')](_0xd557('0x14'),auth[_0xd557('0xc')](),controller['accept']);router[_0xd557('0x12')](_0xd557('0x15'),auth[_0xd557('0xc')](),controller[_0xd557('0x16')]);router[_0xd557('0x17')](_0xd557('0xa'),auth[_0xd557('0xc')](),controller[_0xd557('0x18')]);module[_0xd557('0x19')]=router;
\ No newline at end of file
index 229119c..c8661b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce01=['DATE','INTEGER','BOOLEAN','Email','sequelize','exports','TEXT','medium','ENUM','out','STRING','long'];(function(_0x3e2480,_0x2eed70){var _0x652c0=function(_0xaae5d2){while(--_0xaae5d2){_0x3e2480['push'](_0x3e2480['shift']());}};_0x652c0(++_0x2eed70);}(_0xce01,0x1b4));var _0x1ce0=function(_0x237389,_0x5943df){_0x237389=_0x237389-0x0;var _0xd99e62=_0xce01[_0x237389];return _0xd99e62;};'use strict';var Sequelize=require(_0x1ce0('0x0'));var _=require('lodash');module[_0x1ce0('0x1')]={'body':{'type':Sequelize[_0x1ce0('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ce0('0x4')]('in',_0x1ce0('0x5')),'defaultValue':_0x1ce0('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x1ce0('0x6')]},'to':{'type':Sequelize[_0x1ce0('0x2')]('long')},'cc':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x7'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x1ce0('0x2')]},'sentAt':{'type':Sequelize[_0x1ce0('0x8')]},'attach':{'type':Sequelize[_0x1ce0('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1ce0('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1ce0('0x8')]},'originTo':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x7'))},'originCc':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x7'))},'originChannel':{'type':Sequelize[_0x1ce0('0x4')](_0x1ce0('0xb'),'Chat'),'defaultValue':_0x1ce0('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0x0d40=['INTEGER','Email','Chat','sequelize','lodash','exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3bf957,_0x168c65){var _0x551cc=function(_0x5368e8){while(--_0x5368e8){_0x3bf957['push'](_0x3bf957['shift']());}};_0x551cc(++_0x168c65);}(_0x0d40,0xac));var _0x00d4=function(_0x35c718,_0x33a696){_0x35c718=_0x35c718-0x0;var _0x5c3099=_0x0d40[_0x35c718];return _0x5c3099;};'use strict';var Sequelize=require(_0x00d4('0x0'));var _=require(_0x00d4('0x1'));module[_0x00d4('0x2')]={'body':{'type':Sequelize['TEXT'](_0x00d4('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x00d4('0x4')](_0x00d4('0x5'))},'read':{'type':Sequelize[_0x00d4('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00d4('0x7')]('in',_0x00d4('0x8')),'defaultValue':_0x00d4('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x00d4('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x00d4('0x3'))},'cc':{'type':Sequelize[_0x00d4('0x4')](_0x00d4('0x3'))},'bcc':{'type':Sequelize[_0x00d4('0x4')]('long')},'subject':{'type':Sequelize[_0x00d4('0x4')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x00d4('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x00d4('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x00d4('0x3'))},'originCc':{'type':Sequelize[_0x00d4('0x4')](_0x00d4('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0x00d4('0xb'),_0x00d4('0xc')),'defaultValue':_0x00d4('0xb'),'allowNull':![]}};
\ No newline at end of file
index dfa7acb..7e2d6fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf0d=['lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','html-entities','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','undefined','limit','count','offset','set','json','update','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','catch','show','rawAttributes','includeAll','find','body','params','describe','create','direction','out','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','length','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','sendMail','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','rejectMessage','rejectmessage','download','unix','server','tmp','join','files','from','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','push','readFileSync','build','writeFileSync','moment','bluebird','util','path'];(function(_0x1781d6,_0x5881eb){var _0x40f7b1=function(_0x421531){while(--_0x421531){_0x1781d6['push'](_0x1781d6['shift']());}};_0x40f7b1(++_0x5881eb);}(_0xdf0d,0x1b8));var _0xddf0=function(_0x255faf,_0x2263ae){_0x255faf=_0x255faf-0x0;var _0x403477=_0xdf0d[_0x255faf];return _0x403477;};'use strict';var emlformat=require('eml-format');var moment=require(_0xddf0('0x0'));var BPromise=require(_0xddf0('0x1'));var util=require(_0xddf0('0x2'));var path=require(_0xddf0('0x3'));var fs=require('fs');var _=require(_0xddf0('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xddf0('0x5'));var qs=require(_0xddf0('0x6'));var logger=require(_0xddf0('0x7'))(_0xddf0('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xddf0('0x9'));var db=require(_0xddf0('0xa'))['db'];config['redis']=_['defaults'](config[_0xddf0('0xb')],{'host':_0xddf0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddf0('0xb')]));var htmlEntities=require(_0xddf0('0xd'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xddf0('0xe'));var client=jayson[_0xddf0('0xf')][_0xddf0('0x10')]({'port':0x232c});var client9003=jayson[_0xddf0('0xf')][_0xddf0('0x10')]({'port':0x232b});var client9002=jayson[_0xddf0('0xf')][_0xddf0('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x444fad,_0x539473,_0x3617f0,_0x37eda5){return new BPromise(function(_0x3ce520,_0x3e7a81){var _0x30c7e6=_0x37eda5||client;return _0x30c7e6[_0xddf0('0x11')](_0x444fad,_0x3617f0)['then'](function(_0x395a2f){logger[_0xddf0('0x12')](_0xddf0('0x13'),_0x539473,_0xddf0('0x14'));logger[_0xddf0('0x15')](_0xddf0('0x16'),_0x539473,'request\x20sent',JSON[_0xddf0('0x17')](_0x395a2f));if(_0x395a2f[_0xddf0('0x18')]){if(_0x395a2f[_0xddf0('0x18')]['code']===0x1f4){logger['error'](_0xddf0('0x13'),_0x539473,_0x395a2f[_0xddf0('0x18')]['message']);return _0x3e7a81(_0x395a2f[_0xddf0('0x18')][_0xddf0('0x19')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x539473,_0x395a2f[_0xddf0('0x18')][_0xddf0('0x19')]);return _0x3ce520(_0x395a2f['error'][_0xddf0('0x19')]);}else{logger[_0xddf0('0x12')]('MailMessage,\x20%s,\x20%s',_0x539473,_0xddf0('0x14'));_0x3ce520(_0x395a2f[_0xddf0('0x1a')][_0xddf0('0x19')]);}})['catch'](function(_0xe34a1b){logger[_0xddf0('0x18')](_0xddf0('0x13'),_0x539473,_0xe34a1b);_0x3e7a81(_0xe34a1b);});});}function respondWithResult(_0x12e19b,_0x228bfe){_0x228bfe=_0x228bfe||0xc8;return function(_0x100512){if(_0x100512){return _0x12e19b[_0xddf0('0x1b')](_0x228bfe)['json'](_0x100512);}};}function respondWithFilteredResult(_0x2c7e36,_0x562e7c){return function(_0x14ed9a){if(_0x14ed9a){var _0x5fe9d7=typeof _0x562e7c['offset']===_0xddf0('0x1c')&&typeof _0x562e7c[_0xddf0('0x1d')]===_0xddf0('0x1c');var _0x4729f0=_0x14ed9a[_0xddf0('0x1e')];var _0x513522=_0x5fe9d7?0x0:_0x562e7c[_0xddf0('0x1f')];var _0x5686d4=_0x5fe9d7?_0x14ed9a[_0xddf0('0x1e')]:_0x562e7c[_0xddf0('0x1f')]+_0x562e7c[_0xddf0('0x1d')];var _0x5cb9ef;if(_0x5686d4>=_0x4729f0){_0x5686d4=_0x4729f0;_0x5cb9ef=0xc8;}else{_0x5cb9ef=0xce;}_0x2c7e36[_0xddf0('0x1b')](_0x5cb9ef);return _0x2c7e36[_0xddf0('0x20')]('Content-Range',_0x513522+'-'+_0x5686d4+'/'+_0x4729f0)[_0xddf0('0x21')](_0x14ed9a);}return null;};}function saveUpdates(_0x14b064){return function(_0x4319ae){if(_0x4319ae){return _0x4319ae[_0xddf0('0x22')](_0x14b064)[_0xddf0('0x23')](function(_0x4ed14a){return _0x4ed14a;});}return null;};}function removeEntity(_0x1db94e){return function(_0x5f1fc7){if(_0x5f1fc7){return _0x5f1fc7[_0xddf0('0x24')]()[_0xddf0('0x23')](function(){_0x1db94e[_0xddf0('0x1b')](0xcc)[_0xddf0('0x25')]();});}};}function handleEntityNotFound(_0x3991f6){return function(_0x187e6a){if(!_0x187e6a){_0x3991f6[_0xddf0('0x26')](0x194);}return _0x187e6a;};}function handleError(_0x834686,_0x323d5e){_0x323d5e=_0x323d5e||0x1f4;return function(_0x1b1987){logger[_0xddf0('0x18')](_0x1b1987[_0xddf0('0x27')]);if(_0x1b1987[_0xddf0('0x28')]){delete _0x1b1987[_0xddf0('0x28')];}_0x834686[_0xddf0('0x1b')](_0x323d5e)[_0xddf0('0x29')](_0x1b1987);};}exports[_0xddf0('0x2a')]=function(_0x386577,_0x4b7215){var _0x1fe35d={},_0x4e649f={},_0x16e1b2={'count':0x0,'rows':[]};var _0xea1155=_[_0xddf0('0x2b')](db[_0xddf0('0x2c')]['rawAttributes'],function(_0x4709f0){return{'name':_0x4709f0[_0xddf0('0x2d')],'type':_0x4709f0[_0xddf0('0x2e')][_0xddf0('0x2f')]};});_0x4e649f[_0xddf0('0x30')]=_[_0xddf0('0x2b')](_0xea1155,_0xddf0('0x28'));_0x4e649f[_0xddf0('0x31')]=_[_0xddf0('0x32')](_0x386577[_0xddf0('0x31')]);_0x4e649f[_0xddf0('0x33')]=_[_0xddf0('0x34')](_0x4e649f['model'],_0x4e649f[_0xddf0('0x31')]);_0x1fe35d['attributes']=_[_0xddf0('0x34')](_0x4e649f['model'],qs[_0xddf0('0x35')](_0x386577[_0xddf0('0x31')][_0xddf0('0x35')]));_0x1fe35d[_0xddf0('0x36')]=_0x1fe35d[_0xddf0('0x36')]['length']?_0x1fe35d[_0xddf0('0x36')]:_0x4e649f[_0xddf0('0x30')];if(!_0x386577[_0xddf0('0x31')][_0xddf0('0x37')](_0xddf0('0x38'))){_0x1fe35d[_0xddf0('0x1d')]=qs['limit'](_0x386577['query'][_0xddf0('0x1d')]);_0x1fe35d[_0xddf0('0x1f')]=qs[_0xddf0('0x1f')](_0x386577['query'][_0xddf0('0x1f')]);}_0x1fe35d[_0xddf0('0x39')]=qs['sort'](_0x386577['query'][_0xddf0('0x3a')]);_0x1fe35d[_0xddf0('0x3b')]=qs[_0xddf0('0x33')](_[_0xddf0('0x3c')](_0x386577[_0xddf0('0x31')],_0x4e649f[_0xddf0('0x33')]),_0xea1155);if(_0x386577[_0xddf0('0x31')][_0xddf0('0x3d')]){_0x1fe35d[_0xddf0('0x3b')]=_['merge'](_0x1fe35d['where'],{'$or':_[_0xddf0('0x2b')](_0xea1155,function(_0x16bed3){if(_0x16bed3['type']!==_0xddf0('0x3e')){var _0x1df2b1={};_0x1df2b1[_0x16bed3[_0xddf0('0x28')]]={'$like':'%'+_0x386577['query']['filter']+'%'};return _0x1df2b1;}})});}_0x1fe35d=_[_0xddf0('0x3f')]({},_0x1fe35d,_0x386577[_0xddf0('0x40')]);var _0x861c6c={'where':_0x1fe35d['where']};return db['MailMessage'][_0xddf0('0x1e')](_0x861c6c)[_0xddf0('0x23')](function(_0x469008){_0x16e1b2[_0xddf0('0x1e')]=_0x469008;if(_0x386577['query']['includeAll']){_0x1fe35d[_0xddf0('0x41')]=[{'all':!![]}];}return db[_0xddf0('0x2c')]['findAll'](_0x1fe35d);})[_0xddf0('0x23')](function(_0x4e7f98){_0x16e1b2['rows']=_0x4e7f98;return _0x16e1b2;})[_0xddf0('0x23')](respondWithFilteredResult(_0x4b7215,_0x1fe35d))[_0xddf0('0x42')](handleError(_0x4b7215,null));};exports[_0xddf0('0x43')]=function(_0x259314,_0x191308){var _0x4bc07e={'raw':!![],'where':{'id':_0x259314['params']['id']}},_0x1e9d5f={};_0x1e9d5f[_0xddf0('0x30')]=_[_0xddf0('0x32')](db[_0xddf0('0x2c')][_0xddf0('0x44')]);_0x1e9d5f[_0xddf0('0x31')]=_[_0xddf0('0x32')](_0x259314[_0xddf0('0x31')]);_0x1e9d5f['filters']=_[_0xddf0('0x34')](_0x1e9d5f[_0xddf0('0x30')],_0x1e9d5f[_0xddf0('0x31')]);_0x4bc07e[_0xddf0('0x36')]=_[_0xddf0('0x34')](_0x1e9d5f[_0xddf0('0x30')],qs[_0xddf0('0x35')](_0x259314[_0xddf0('0x31')][_0xddf0('0x35')]));_0x4bc07e['attributes']=_0x4bc07e[_0xddf0('0x36')]['length']?_0x4bc07e[_0xddf0('0x36')]:_0x1e9d5f[_0xddf0('0x30')];if(_0x259314[_0xddf0('0x31')][_0xddf0('0x45')]){_0x4bc07e[_0xddf0('0x41')]=[{'all':!![]}];}_0x4bc07e=_[_0xddf0('0x3f')]({},_0x4bc07e,_0x259314[_0xddf0('0x40')]);return db[_0xddf0('0x2c')][_0xddf0('0x46')](_0x4bc07e)[_0xddf0('0x23')](handleEntityNotFound(_0x191308,null))['then'](respondWithResult(_0x191308,null))['catch'](handleError(_0x191308,null));};exports[_0xddf0('0x22')]=function(_0x2e2029,_0x1a06b5){if(_0x2e2029[_0xddf0('0x47')]['id']){delete _0x2e2029['body']['id'];}return db[_0xddf0('0x2c')][_0xddf0('0x46')]({'where':{'id':_0x2e2029['params']['id']}})[_0xddf0('0x23')](handleEntityNotFound(_0x1a06b5,null))[_0xddf0('0x23')](saveUpdates(_0x2e2029[_0xddf0('0x47')],null))[_0xddf0('0x23')](respondWithResult(_0x1a06b5,null))[_0xddf0('0x42')](handleError(_0x1a06b5,null));};exports[_0xddf0('0x24')]=function(_0x4ceafe,_0x4a7f15){return db[_0xddf0('0x2c')][_0xddf0('0x46')]({'where':{'id':_0x4ceafe[_0xddf0('0x48')]['id']}})[_0xddf0('0x23')](handleEntityNotFound(_0x4a7f15,null))['then'](removeEntity(_0x4a7f15,null))[_0xddf0('0x42')](handleError(_0x4a7f15,null));};exports[_0xddf0('0x49')]=function(_0x236ba5,_0x2cc854){return db[_0xddf0('0x2c')][_0xddf0('0x49')]()[_0xddf0('0x23')](respondWithResult(_0x2cc854,null))['catch'](handleError(_0x2cc854,null));};exports[_0xddf0('0x4a')]=function(_0x1554b4,_0x243c91){return db['MailMessage']['create'](_0x1554b4[_0xddf0('0x47')])['then'](function(_0x38c963){if(_0x38c963){if(_0x38c963[_0xddf0('0x4b')]===_0xddf0('0x4c')&&!_0x38c963['secret']){var _0x1177e7,_0x2a0b90,_0x46a296;if(_0x1554b4[_0xddf0('0x47')]['to']){_0x2a0b90=_0x1554b4[_0xddf0('0x47')]['to']['split'](',')[0x0];}return db[_0xddf0('0x4d')]['findOne']({'where':{'id':_0x38c963[_0xddf0('0x4e')]},'include':[{'model':db[_0xddf0('0x4f')],'as':_0xddf0('0x50'),'include':[{'model':db[_0xddf0('0x51')],'as':_0xddf0('0x52'),'where':{'email':_0x2a0b90},'limit':0x1,'order':[['updatedAt',_0xddf0('0x53')]]}]},{'model':db['MailServerOut'],'as':_0xddf0('0x54'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xddf0('0x55'),'raw':!![]}]}]})[_0xddf0('0x23')](function(_0x23b512){_0x1177e7=_0x23b512;if(!_0x1177e7||!_0x1177e7[_0xddf0('0x54')])return;var _0x23cb03=_0x1177e7[_0xddf0('0x56')]();if(_0x1554b4['body'][_0xddf0('0x57')]&&_0x1554b4[_0xddf0('0x47')][_0xddf0('0x57')][_0xddf0('0x58')]){for(var _0x44d3a7=0x0;_0x44d3a7<_0x1554b4[_0xddf0('0x47')][_0xddf0('0x57')][_0xddf0('0x58')];_0x44d3a7+=0x1){_0x1554b4['body'][_0xddf0('0x57')][_0x44d3a7]={'filename':_0x1554b4[_0xddf0('0x47')][_0xddf0('0x57')][_0x44d3a7][_0xddf0('0x28')],'path':path['join'](config[_0xddf0('0x59')],_0xddf0('0x5a'),_0x1554b4[_0xddf0('0x47')][_0xddf0('0x57')][_0x44d3a7][_0xddf0('0x5b')])};}}_0x46a296={'account':_0x23cb03,'message':_0x1554b4[_0xddf0('0x47')]};return;})['then'](function(){if(_0x1177e7[_0xddf0('0x50')]){if(_0x1177e7[_0xddf0('0x50')]['Contacts'][_0xddf0('0x58')]){return _0x1177e7[_0xddf0('0x50')][_0xddf0('0x52')][0x0];}else{return db[_0xddf0('0x51')][_0xddf0('0x4a')](_[_0xddf0('0x5c')](_0x1554b4['body'],{'firstName':_0x1554b4['body']['to'],'email':_0x1554b4[_0xddf0('0x47')]['to'],'phone':_0x1554b4[_0xddf0('0x47')]['to'],'ListId':_0x1177e7[_0xddf0('0x5d')]}));}}else{throw new Error(_0xddf0('0x5e'));}})[_0xddf0('0x23')](function(){if(_0x46a296){return respondWithRpcPromise('SendMail',_0xddf0('0x5f'),_0x46a296,client9003)[_0xddf0('0x23')](function(_0x4b3f54){return _0x38c963[_0xddf0('0x22')]({'read':!![],'messageId':_0x4b3f54['messageId'],'sentAt':moment()[_0xddf0('0x60')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xddf0('0x42')](function(_0x1b891c){logger[_0xddf0('0x18')]('%s',JSON[_0xddf0('0x17')](_0x1b891c));return _0x38c963;});}return _0x38c963;});}return _0x38c963;}})[_0xddf0('0x23')](respondWithResult(_0x243c91,0xc9))['catch'](handleError(_0x243c91,null));};exports[_0xddf0('0x61')]=function(_0x4c247a,_0xe5af82){var _0x59e1d5={'agent':{},'channel':_0xddf0('0x62')};if(_0x4c247a[_0xddf0('0x47')]['id']){delete _0x4c247a['body']['id'];}_0x4c247a['body']['read']=!![];_0x4c247a[_0xddf0('0x47')][_0xddf0('0x63')]=moment()['format'](_0xddf0('0x64'));_0x4c247a[_0xddf0('0x47')][_0xddf0('0x65')]=_0x4c247a[_0xddf0('0x47')][_0xddf0('0x65')]||_0x4c247a[_0xddf0('0x66')]['id'];_0x59e1d5[_0xddf0('0x67')]['id']=_0x4c247a['body']['UserId'];return db[_0xddf0('0x2c')][_0xddf0('0x46')]({'where':{'id':_0x4c247a[_0xddf0('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe5af82,null))[_0xddf0('0x23')](saveUpdates(_0x4c247a['body'],null))['then'](function(_0x1bba95){if(_0x1bba95){_0x59e1d5[_0xddf0('0x19')]=_0x1bba95[_0xddf0('0x68')]({'plain':!![]});return db['MailInteraction'][_0xddf0('0x46')]({'where':{'id':_0x1bba95['MailInteractionId']}});}return null;})[_0xddf0('0x23')](handleEntityNotFound(_0xe5af82,null))[_0xddf0('0x23')](function(_0x2e480e){if(_0x2e480e){return _0x2e480e[_0xddf0('0x22')]({'UserId':_0x4c247a[_0xddf0('0x47')]['UserId'],'read1stAt':_[_0xddf0('0x69')](_0x2e480e[_0xddf0('0x6a')])?moment()['format'](_0xddf0('0x64')):undefined});}return null;})[_0xddf0('0x23')](function(_0xd8eea3){if(_0xd8eea3){_0x59e1d5['interaction']=_0xd8eea3[_0xddf0('0x68')]({'plain':!![]});interaction_log[_0xddf0('0x12')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c247a[_0xddf0('0x66')]['id'],_0x4c247a[_0xddf0('0x66')][_0xddf0('0x28')],_0x4c247a[_0xddf0('0x66')]['role'],_0x59e1d5[_0xddf0('0x6b')]['id'],_0x4c247a[_0xddf0('0x47')]?JSON[_0xddf0('0x17')](_0x4c247a[_0xddf0('0x47')]):_0xddf0('0x6c'));return respondWithRpcPromise(_0xddf0('0x6d'),'acceptMessage',_0x59e1d5);}return null;})[_0xddf0('0x23')](function(_0x4d3f24){var _0x410132=_0xddf0('0x6e')+_0x4d3f24[_0xddf0('0x19')][_0xddf0('0x6f')];return db[_0xddf0('0x70')]['query'](_0x410132,{'type':db['Sequelize'][_0xddf0('0x71')][_0xddf0('0x72')],'raw':!![]})[_0xddf0('0x23')](function(_0x29da3b){return _0x29da3b;});})[_0xddf0('0x23')](function(_0x4cefaf){if(_0x4cefaf){_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x73')]=_0x4cefaf[0x0];if(!_0x4c247a[_0xddf0('0x47')][_0xddf0('0x65')])return;return db['User'][_0xddf0('0x46')]({'where':{'id':_0x4c247a[_0xddf0('0x47')]['UserId'],'role':_0xddf0('0x67')},'attributes':['id',_0xddf0('0x28'),'fullname',_0xddf0('0x74'),_0xddf0('0x75')],'raw':!![]});}return null;})[_0xddf0('0x23')](function(_0x296a47){if(!_0x296a47)return null;_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x67')]=_0x296a47;return _0x59e1d5;})['then'](function(_0x386cd6){if(_0x386cd6){if(_0x4c247a['body'][_0xddf0('0x76')]){_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x77')]=util[_0xddf0('0x60')](_0xddf0('0x78'),_0x4c247a['user'][_0xddf0('0x28')]);_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x79')]=_0x59e1d5['channel'];_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x7a')]=_0x59e1d5['channel'];_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x7b')]=_0xddf0('0x61');_0x59e1d5['message'][_0xddf0('0x47')]=htmlToText[_0xddf0('0x7c')](_0x59e1d5[_0xddf0('0x19')][_0xddf0('0x47')]);return respondWithRpcPromise(_0xddf0('0x7d'),'EventManager',{'event':'acceptmessage','message':_0x59e1d5[_0xddf0('0x19')]},client9002)['then'](function(){return _0x59e1d5;});}return _0x59e1d5;}return null;})[_0xddf0('0x23')](respondWithResult(_0xe5af82,null))[_0xddf0('0x42')](handleError(_0xe5af82,null));};exports[_0xddf0('0x7e')]=function(_0x14c68a,_0x372104){var _0x430fb5={'agent':{},'channel':_0xddf0('0x62')};if(_0x14c68a[_0xddf0('0x47')]['id']){delete _0x14c68a[_0xddf0('0x47')]['id'];}_0x14c68a[_0xddf0('0x47')][_0xddf0('0x65')]=_0x14c68a['body'][_0xddf0('0x65')]||_0x14c68a[_0xddf0('0x66')]['id'];_0x430fb5[_0xddf0('0x67')]['id']=_0x14c68a[_0xddf0('0x47')]['UserId'];return db['MailMessage'][_0xddf0('0x46')]({'where':{'id':_0x14c68a[_0xddf0('0x48')]['id'],'UserId':null}})[_0xddf0('0x23')](handleEntityNotFound(_0x372104,null))[_0xddf0('0x23')](function(_0x3a475d){if(_0x3a475d){_0x430fb5['message']=_0x3a475d[_0xddf0('0x68')]({'plain':!![]});return db['MailInteraction'][_0xddf0('0x46')]({'where':{'id':_0x3a475d['MailInteractionId']}});}return null;})[_0xddf0('0x23')](handleEntityNotFound(_0x372104,null))[_0xddf0('0x23')](function(_0x32a0f5){if(_0x32a0f5){_0x430fb5[_0xddf0('0x6b')]=_0x32a0f5[_0xddf0('0x68')]({'plain':!![]});interaction_log[_0xddf0('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14c68a['user']['id'],_0x14c68a[_0xddf0('0x66')][_0xddf0('0x28')],_0x14c68a[_0xddf0('0x66')]['role'],_0x430fb5[_0xddf0('0x6b')]['id'],_0x14c68a[_0xddf0('0x47')]?JSON[_0xddf0('0x17')](_0x14c68a[_0xddf0('0x47')]):'null');return respondWithRpcPromise('RejectMessage',_0xddf0('0x7f'),_0x430fb5);}return null;})[_0xddf0('0x23')](function(_0x3c6547){var _0x11aee6=_0xddf0('0x6e')+_0x3c6547['message']['ContactId'];return db[_0xddf0('0x70')][_0xddf0('0x31')](_0x11aee6,{'type':db['Sequelize'][_0xddf0('0x71')]['SELECT'],'raw':!![]})[_0xddf0('0x23')](function(_0x3bf76f){return _0x3bf76f;});})['then'](function(_0x1b9366){if(_0x1b9366){_0x430fb5[_0xddf0('0x19')][_0xddf0('0x73')]=_0x1b9366[0x0];if(!_0x14c68a['body'][_0xddf0('0x65')])return;return db['User']['find']({'where':{'id':_0x14c68a['body'][_0xddf0('0x65')],'role':_0xddf0('0x67')},'attributes':['id','name','fullname',_0xddf0('0x74'),_0xddf0('0x75')],'raw':!![]});}return null;})[_0xddf0('0x23')](function(_0x183090){if(!_0x183090)return null;_0x430fb5[_0xddf0('0x19')][_0xddf0('0x67')]=_0x183090;return _0x430fb5;})[_0xddf0('0x23')](function(_0x138940){if(_0x138940){_0x138940[_0xddf0('0x19')][_0xddf0('0x77')]=util['format'](_0xddf0('0x78'),_0x14c68a[_0xddf0('0x66')][_0xddf0('0x28')]);_0x138940[_0xddf0('0x19')][_0xddf0('0x79')]=_0x430fb5[_0xddf0('0x79')];_0x138940[_0xddf0('0x19')][_0xddf0('0x7a')]=_0x430fb5['channel'];_0x138940['message'][_0xddf0('0x7b')]=_0xddf0('0x7e');_0x138940[_0xddf0('0x19')]['body']=htmlToText['fromString'](_0x430fb5['message'][_0xddf0('0x47')]);respondWithRpcPromise(_0xddf0('0x7d'),'EventManager',{'event':_0xddf0('0x80'),'message':_0x138940[_0xddf0('0x19')]},client9002);return _0x430fb5;}return null;})[_0xddf0('0x23')](respondWithResult(_0x372104,null))[_0xddf0('0x42')](handleError(_0x372104,null));};exports[_0xddf0('0x81')]=function(_0x323ef2,_0x4463c6){var _0x51fe98=moment()[_0xddf0('0x82')]()['toString']();var _0xdb8c1c=path['join'](config['root'],_0xddf0('0x83'),'files',_0xddf0('0x84'));var _0x4be833=path[_0xddf0('0x85')](config[_0xddf0('0x59')],_0xddf0('0x83'),_0xddf0('0x86'),_0xddf0('0x57'));var _0x66e4fc=util['format']('message-%s.eml',_0x51fe98);return db[_0xddf0('0x2c')]['find']({'where':{'id':_0x323ef2[_0xddf0('0x48')]['id']},'attributes':['id',_0xddf0('0x47'),_0xddf0('0x87'),'to','cc','bcc',_0xddf0('0x88'),_0xddf0('0x89')],'include':_0x323ef2['query'][_0xddf0('0x57')]?[{'model':db[_0xddf0('0x8a')],'as':_0xddf0('0x8b')}]:undefined})[_0xddf0('0x23')](handleEntityNotFound(_0x4463c6,null))[_0xddf0('0x23')](function(_0x3c1c21){if(_0x3c1c21){var _0x59188c=_0x3c1c21;var _0xc70023={'from':_0x59188c['from'],'to':_0x59188c['to'],'subject':_0x59188c[_0xddf0('0x88')],'html':htmlEntities['decode'](_0x59188c[_0xddf0('0x47')]),'headers':{'Date':moment(_0x59188c[_0xddf0('0x89')])['format'](_0xddf0('0x8c'))},'attachments':[]};if(_0x3c1c21['cc']){_0xc70023[_0xddf0('0x8d')]['Cc']=_0x3c1c21['cc'];}if(_0x3c1c21[_0xddf0('0x8e')]){_0xc70023[_0xddf0('0x8d')][_0xddf0('0x8f')]=_0x3c1c21['bcc'];}return new BPromise(function(_0x40ac07,_0x2a6c34){if(_0x3c1c21[_0xddf0('0x8b')]){for(var _0x23b13e=0x0;_0x23b13e<_0x3c1c21[_0xddf0('0x8b')][_0xddf0('0x58')];_0x23b13e++){var _0x34acee=_0x3c1c21['Attachments'][_0x23b13e];var _0x26825e=path[_0xddf0('0x85')](_0x4be833,_0x34acee[_0xddf0('0x5b')]);if(fs['existsSync'](_0x26825e)){_0xc70023['attachments'][_0xddf0('0x90')]({'name':_0x34acee[_0xddf0('0x28')],'contentType':_0x34acee[_0xddf0('0x2e')],'data':fs[_0xddf0('0x91')](_0x26825e)});}}}emlformat[_0xddf0('0x92')](_0xc70023,function(_0x30aab6,_0x329ae8){if(_0x30aab6)return _0x2a6c34(_0x30aab6);fs[_0xddf0('0x93')](path[_0xddf0('0x85')](_0xdb8c1c,_0x66e4fc),_0x329ae8);return _0x40ac07(_0x329ae8);});});}})[_0xddf0('0x23')](function(_0x40da7b){if(_0x40da7b){return _0x4463c6[_0xddf0('0x81')](path[_0xddf0('0x85')](_0xdb8c1c,_0x66e4fc),_0x66e4fc,function(_0x2ae8f0){if(!_0x2ae8f0)fs['unlinkSync'](path[_0xddf0('0x85')](_0xdb8c1c,_0x66e4fc));});}})[_0xddf0('0x42')](handleError(_0x4463c6,null));};
\ No newline at end of file
+var _0xaae1=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','MailMessage','include','findAll','rows','params','includeAll','find','update','body','destroy','create','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','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','get','MailInteraction','MailInteractionId','isNil','read1stAt','user','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','fromString','EventManager','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','SELECT','motionChannel','event','reject','rejectmessage','toString','server','files','tmp','message-%s.eml','from','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','readFileSync','download','eml-format','moment','bluebird','util','path','html-to-text','../../config/logger','api','mail-interactions','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','http','client','then','info'];(function(_0x59830f,_0x42ddb5){var _0x5d34d9=function(_0xa1afc6){while(--_0xa1afc6){_0x59830f['push'](_0x59830f['shift']());}};_0x5d34d9(++_0x42ddb5);}(_0xaae1,0x1b1));var _0x1aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1aae('0x0'));var moment=require(_0x1aae('0x1'));var BPromise=require(_0x1aae('0x2'));var util=require(_0x1aae('0x3'));var path=require(_0x1aae('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0x1aae('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x1aae('0x6'))(_0x1aae('0x7'));var interaction_log=require(_0x1aae('0x6'))(_0x1aae('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1aae('0x9')]=_[_0x1aae('0xa')](config[_0x1aae('0x9')],{'host':_0x1aae('0xb'),'port':0x18eb});var socket=require(_0x1aae('0xc'))(new Redis(config[_0x1aae('0x9')]));var htmlEntities=require(_0x1aae('0xd'));require(_0x1aae('0xe'))['register'](socket);var jayson=require(_0x1aae('0xf'));var client=jayson['client'][_0x1aae('0x10')]({'port':0x232c});var client9003=jayson[_0x1aae('0x11')][_0x1aae('0x10')]({'port':0x232b});var client9002=jayson[_0x1aae('0x11')][_0x1aae('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x1b80f1,_0x23fc20,_0x252cb6,_0x1f5cff){return new BPromise(function(_0x4c9093,_0x1dd896){var _0x2e4564=_0x1f5cff||client;return _0x2e4564['request'](_0x1b80f1,_0x252cb6)[_0x1aae('0x12')](function(_0x4a8d55){logger[_0x1aae('0x13')](_0x1aae('0x14'),_0x23fc20,_0x1aae('0x15'));logger[_0x1aae('0x16')](_0x1aae('0x17'),_0x23fc20,_0x1aae('0x15'),JSON[_0x1aae('0x18')](_0x4a8d55));if(_0x4a8d55['error']){if(_0x4a8d55[_0x1aae('0x19')][_0x1aae('0x1a')]===0x1f4){logger[_0x1aae('0x19')]('MailMessage,\x20%s,\x20%s',_0x23fc20,_0x4a8d55[_0x1aae('0x19')][_0x1aae('0x1b')]);return _0x1dd896(_0x4a8d55['error'][_0x1aae('0x1b')]);}logger[_0x1aae('0x19')](_0x1aae('0x14'),_0x23fc20,_0x4a8d55[_0x1aae('0x19')][_0x1aae('0x1b')]);return _0x4c9093(_0x4a8d55[_0x1aae('0x19')][_0x1aae('0x1b')]);}else{logger[_0x1aae('0x13')](_0x1aae('0x14'),_0x23fc20,_0x1aae('0x15'));_0x4c9093(_0x4a8d55[_0x1aae('0x1c')][_0x1aae('0x1b')]);}})[_0x1aae('0x1d')](function(_0x3d74f1){logger['error'](_0x1aae('0x14'),_0x23fc20,_0x3d74f1);_0x1dd896(_0x3d74f1);});});}function respondWithResult(_0xf9b21b,_0x510216){_0x510216=_0x510216||0xc8;return function(_0x416e33){if(_0x416e33){return _0xf9b21b[_0x1aae('0x1e')](_0x510216)[_0x1aae('0x1f')](_0x416e33);}};}function respondWithFilteredResult(_0x5af622,_0x16c371){return function(_0x749e24){if(_0x749e24){var _0x5cbcc3=typeof _0x16c371[_0x1aae('0x20')]===_0x1aae('0x21')&&typeof _0x16c371[_0x1aae('0x22')]===_0x1aae('0x21');var _0x4ad30e=_0x749e24['count'];var _0x46806c=_0x5cbcc3?0x0:_0x16c371[_0x1aae('0x20')];var _0x490cc3=_0x5cbcc3?_0x749e24[_0x1aae('0x23')]:_0x16c371[_0x1aae('0x20')]+_0x16c371['limit'];var _0xde0e39;if(_0x490cc3>=_0x4ad30e){_0x490cc3=_0x4ad30e;_0xde0e39=0xc8;}else{_0xde0e39=0xce;}_0x5af622[_0x1aae('0x1e')](_0xde0e39);return _0x5af622[_0x1aae('0x24')]('Content-Range',_0x46806c+'-'+_0x490cc3+'/'+_0x4ad30e)[_0x1aae('0x1f')](_0x749e24);}return null;};}function saveUpdates(_0x2e1669){return function(_0x5c7074){if(_0x5c7074){return _0x5c7074['update'](_0x2e1669)[_0x1aae('0x12')](function(_0x3e3e17){return _0x3e3e17;});}return null;};}function removeEntity(_0x35a71f){return function(_0x41367d){if(_0x41367d){return _0x41367d['destroy']()['then'](function(){_0x35a71f[_0x1aae('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cfe1c){return function(_0x136675){if(!_0x136675){_0x5cfe1c['sendStatus'](0x194);}return _0x136675;};}function handleError(_0x330aa7,_0x5c950b){_0x5c950b=_0x5c950b||0x1f4;return function(_0x416e06){logger[_0x1aae('0x19')](_0x416e06['stack']);if(_0x416e06[_0x1aae('0x25')]){delete _0x416e06[_0x1aae('0x25')];}_0x330aa7[_0x1aae('0x1e')](_0x5c950b)['send'](_0x416e06);};}exports[_0x1aae('0x26')]=function(_0x5d1b7f,_0x3dc183){var _0x4076b5={},_0x8c06cb={},_0x3f6f94={'count':0x0,'rows':[]};var _0x2eeeb6=_[_0x1aae('0x27')](db['MailMessage'][_0x1aae('0x28')],function(_0x2d655f){return{'name':_0x2d655f['fieldName'],'type':_0x2d655f[_0x1aae('0x29')][_0x1aae('0x2a')]};});_0x8c06cb[_0x1aae('0x2b')]=_['map'](_0x2eeeb6,'name');_0x8c06cb[_0x1aae('0x2c')]=_[_0x1aae('0x2d')](_0x5d1b7f['query']);_0x8c06cb[_0x1aae('0x2e')]=_[_0x1aae('0x2f')](_0x8c06cb[_0x1aae('0x2b')],_0x8c06cb['query']);_0x4076b5[_0x1aae('0x30')]=_['intersection'](_0x8c06cb[_0x1aae('0x2b')],qs[_0x1aae('0x31')](_0x5d1b7f[_0x1aae('0x2c')][_0x1aae('0x31')]));_0x4076b5[_0x1aae('0x30')]=_0x4076b5[_0x1aae('0x30')][_0x1aae('0x32')]?_0x4076b5[_0x1aae('0x30')]:_0x8c06cb['model'];if(!_0x5d1b7f[_0x1aae('0x2c')][_0x1aae('0x33')](_0x1aae('0x34'))){_0x4076b5[_0x1aae('0x22')]=qs['limit'](_0x5d1b7f[_0x1aae('0x2c')][_0x1aae('0x22')]);_0x4076b5[_0x1aae('0x20')]=qs[_0x1aae('0x20')](_0x5d1b7f[_0x1aae('0x2c')][_0x1aae('0x20')]);}_0x4076b5[_0x1aae('0x35')]=qs[_0x1aae('0x36')](_0x5d1b7f[_0x1aae('0x2c')][_0x1aae('0x36')]);_0x4076b5['where']=qs[_0x1aae('0x2e')](_['pick'](_0x5d1b7f[_0x1aae('0x2c')],_0x8c06cb['filters']),_0x2eeeb6);if(_0x5d1b7f[_0x1aae('0x2c')][_0x1aae('0x37')]){_0x4076b5[_0x1aae('0x38')]=_['merge'](_0x4076b5['where'],{'$or':_[_0x1aae('0x27')](_0x2eeeb6,function(_0x3b16c8){if(_0x3b16c8['type']!=='VIRTUAL'){var _0x518a3e={};_0x518a3e[_0x3b16c8['name']]={'$like':'%'+_0x5d1b7f[_0x1aae('0x2c')]['filter']+'%'};return _0x518a3e;}})});}_0x4076b5=_[_0x1aae('0x39')]({},_0x4076b5,_0x5d1b7f[_0x1aae('0x3a')]);var _0xcf0c3d={'where':_0x4076b5[_0x1aae('0x38')]};return db[_0x1aae('0x3b')]['count'](_0xcf0c3d)[_0x1aae('0x12')](function(_0x27800b){_0x3f6f94['count']=_0x27800b;if(_0x5d1b7f[_0x1aae('0x2c')]['includeAll']){_0x4076b5[_0x1aae('0x3c')]=[{'all':!![]}];}return db[_0x1aae('0x3b')][_0x1aae('0x3d')](_0x4076b5);})[_0x1aae('0x12')](function(_0x3f3f03){_0x3f6f94[_0x1aae('0x3e')]=_0x3f3f03;return _0x3f6f94;})['then'](respondWithFilteredResult(_0x3dc183,_0x4076b5))[_0x1aae('0x1d')](handleError(_0x3dc183,null));};exports['show']=function(_0x5d703c,_0x1dd40e){var _0x46a2ab={'raw':!![],'where':{'id':_0x5d703c[_0x1aae('0x3f')]['id']}},_0x614148={};_0x614148[_0x1aae('0x2b')]=_[_0x1aae('0x2d')](db[_0x1aae('0x3b')][_0x1aae('0x28')]);_0x614148['query']=_['keys'](_0x5d703c['query']);_0x614148[_0x1aae('0x2e')]=_['intersection'](_0x614148[_0x1aae('0x2b')],_0x614148['query']);_0x46a2ab[_0x1aae('0x30')]=_[_0x1aae('0x2f')](_0x614148[_0x1aae('0x2b')],qs[_0x1aae('0x31')](_0x5d703c[_0x1aae('0x2c')][_0x1aae('0x31')]));_0x46a2ab['attributes']=_0x46a2ab[_0x1aae('0x30')][_0x1aae('0x32')]?_0x46a2ab['attributes']:_0x614148['model'];if(_0x5d703c['query'][_0x1aae('0x40')]){_0x46a2ab[_0x1aae('0x3c')]=[{'all':!![]}];}_0x46a2ab=_['merge']({},_0x46a2ab,_0x5d703c[_0x1aae('0x3a')]);return db[_0x1aae('0x3b')][_0x1aae('0x41')](_0x46a2ab)[_0x1aae('0x12')](handleEntityNotFound(_0x1dd40e,null))[_0x1aae('0x12')](respondWithResult(_0x1dd40e,null))[_0x1aae('0x1d')](handleError(_0x1dd40e,null));};exports[_0x1aae('0x42')]=function(_0x36076e,_0x4700e9){if(_0x36076e[_0x1aae('0x43')]['id']){delete _0x36076e[_0x1aae('0x43')]['id'];}return db[_0x1aae('0x3b')][_0x1aae('0x41')]({'where':{'id':_0x36076e[_0x1aae('0x3f')]['id']}})[_0x1aae('0x12')](handleEntityNotFound(_0x4700e9,null))[_0x1aae('0x12')](saveUpdates(_0x36076e['body'],null))[_0x1aae('0x12')](respondWithResult(_0x4700e9,null))['catch'](handleError(_0x4700e9,null));};exports[_0x1aae('0x44')]=function(_0x1c3083,_0x3d9ed1){return db[_0x1aae('0x3b')][_0x1aae('0x41')]({'where':{'id':_0x1c3083[_0x1aae('0x3f')]['id']}})[_0x1aae('0x12')](handleEntityNotFound(_0x3d9ed1,null))['then'](removeEntity(_0x3d9ed1,null))[_0x1aae('0x1d')](handleError(_0x3d9ed1,null));};exports['describe']=function(_0x2a2236,_0x3bc88a){return db['MailMessage']['describe']()['then'](respondWithResult(_0x3bc88a,null))[_0x1aae('0x1d')](handleError(_0x3bc88a,null));};exports['create']=function(_0x4b3add,_0x2725db){return db['MailMessage'][_0x1aae('0x45')](_0x4b3add[_0x1aae('0x43')])[_0x1aae('0x12')](function(_0x13a642){if(_0x13a642){if(_0x13a642['direction']==='out'&&!_0x13a642['secret']){var _0x543d1f,_0x2d1db4,_0x4caf4f;if(_0x4b3add[_0x1aae('0x43')]['to']){_0x2d1db4=_0x4b3add[_0x1aae('0x43')]['to'][_0x1aae('0x46')](',')[0x0];}return db[_0x1aae('0x47')][_0x1aae('0x48')]({'where':{'id':_0x13a642[_0x1aae('0x49')]},'include':[{'model':db[_0x1aae('0x4a')],'as':_0x1aae('0x4b'),'include':[{'model':db[_0x1aae('0x4c')],'as':_0x1aae('0x4d'),'where':{'email':_0x2d1db4},'limit':0x1,'order':[[_0x1aae('0x4e'),_0x1aae('0x4f')]]}]},{'model':db['MailServerOut'],'as':_0x1aae('0x50'),'raw':!![],'include':[{'model':db[_0x1aae('0x51')],'as':_0x1aae('0x51'),'raw':!![]}]}]})[_0x1aae('0x12')](function(_0x2b62e2){_0x543d1f=_0x2b62e2;if(!_0x543d1f||!_0x543d1f[_0x1aae('0x50')])return;var _0x3c2bc8=_0x543d1f[_0x1aae('0x52')]();if(_0x4b3add[_0x1aae('0x43')][_0x1aae('0x53')]&&_0x4b3add['body']['attachments'][_0x1aae('0x32')]){for(var _0x5e74f5=0x0;_0x5e74f5<_0x4b3add[_0x1aae('0x43')]['attachments'][_0x1aae('0x32')];_0x5e74f5+=0x1){_0x4b3add[_0x1aae('0x43')][_0x1aae('0x53')][_0x5e74f5]={'filename':_0x4b3add[_0x1aae('0x43')][_0x1aae('0x53')][_0x5e74f5][_0x1aae('0x25')],'path':path[_0x1aae('0x54')](config[_0x1aae('0x55')],_0x1aae('0x56'),_0x4b3add[_0x1aae('0x43')]['attachments'][_0x5e74f5][_0x1aae('0x57')])};}}_0x4caf4f={'account':_0x3c2bc8,'message':_0x4b3add['body']};return;})[_0x1aae('0x12')](function(){if(_0x543d1f['List']){if(_0x543d1f['List']['Contacts'][_0x1aae('0x32')]){return _0x543d1f[_0x1aae('0x4b')][_0x1aae('0x4d')][0x0];}else{return db[_0x1aae('0x4c')][_0x1aae('0x45')](_['defaults'](_0x4b3add[_0x1aae('0x43')],{'firstName':_0x4b3add['body']['to'],'email':_0x4b3add[_0x1aae('0x43')]['to'],'phone':_0x4b3add['body']['to'],'ListId':_0x543d1f['ListId']}));}}else{throw new Error(_0x1aae('0x58'));}})[_0x1aae('0x12')](function(){if(_0x4caf4f){return respondWithRpcPromise(_0x1aae('0x59'),_0x1aae('0x5a'),_0x4caf4f,client9003)['then'](function(_0x4d7cd4){return _0x13a642[_0x1aae('0x42')]({'read':!![],'messageId':_0x4d7cd4[_0x1aae('0x5b')],'sentAt':moment()[_0x1aae('0x5c')](_0x1aae('0x5d'))});})[_0x1aae('0x1d')](function(_0xb11ca1){logger[_0x1aae('0x19')]('%s',JSON[_0x1aae('0x18')](_0xb11ca1));return _0x13a642;});}return _0x13a642;});}return _0x13a642;}})[_0x1aae('0x12')](respondWithResult(_0x2725db,0xc9))[_0x1aae('0x1d')](handleError(_0x2725db,null));};exports[_0x1aae('0x5e')]=function(_0x2dcc31,_0x5b885a){var _0x1b4690={'agent':{},'channel':_0x1aae('0x5f')};if(_0x2dcc31[_0x1aae('0x43')]['id']){delete _0x2dcc31[_0x1aae('0x43')]['id'];}_0x2dcc31[_0x1aae('0x43')][_0x1aae('0x60')]=!![];_0x2dcc31[_0x1aae('0x43')][_0x1aae('0x61')]=moment()[_0x1aae('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2dcc31['body']['UserId']=_0x2dcc31[_0x1aae('0x43')]['UserId']||_0x2dcc31['user']['id'];_0x1b4690['agent']['id']=_0x2dcc31[_0x1aae('0x43')][_0x1aae('0x62')];return db['MailMessage'][_0x1aae('0x41')]({'where':{'id':_0x2dcc31['params']['id'],'UserId':null}})[_0x1aae('0x12')](handleEntityNotFound(_0x5b885a,null))[_0x1aae('0x12')](saveUpdates(_0x2dcc31[_0x1aae('0x43')],null))[_0x1aae('0x12')](function(_0x1e5649){if(_0x1e5649){_0x1b4690['message']=_0x1e5649[_0x1aae('0x63')]({'plain':!![]});return db[_0x1aae('0x64')][_0x1aae('0x41')]({'where':{'id':_0x1e5649[_0x1aae('0x65')]}});}return null;})[_0x1aae('0x12')](handleEntityNotFound(_0x5b885a,null))['then'](function(_0x5bd1cf){if(_0x5bd1cf){return _0x5bd1cf[_0x1aae('0x42')]({'UserId':_0x2dcc31[_0x1aae('0x43')][_0x1aae('0x62')],'read1stAt':_[_0x1aae('0x66')](_0x5bd1cf[_0x1aae('0x67')])?moment()[_0x1aae('0x5c')](_0x1aae('0x5d')):undefined});}return null;})[_0x1aae('0x12')](function(_0x2ea9c8){if(_0x2ea9c8){_0x1b4690['interaction']=_0x2ea9c8[_0x1aae('0x63')]({'plain':!![]});interaction_log[_0x1aae('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2dcc31['user']['id'],_0x2dcc31['user'][_0x1aae('0x25')],_0x2dcc31[_0x1aae('0x68')][_0x1aae('0x69')],_0x1b4690[_0x1aae('0x6a')]['id'],_0x2dcc31[_0x1aae('0x43')]?JSON['stringify'](_0x2dcc31[_0x1aae('0x43')]):_0x1aae('0x6b'));return respondWithRpcPromise(_0x1aae('0x6c'),'acceptMessage',_0x1b4690);}return null;})[_0x1aae('0x12')](function(_0x19441e){var _0x579322=_0x1aae('0x6d')+_0x19441e[_0x1aae('0x1b')][_0x1aae('0x6e')];return db['sequelize']['query'](_0x579322,{'type':db['Sequelize'][_0x1aae('0x6f')]['SELECT'],'raw':!![]})[_0x1aae('0x12')](function(_0x441822){return _0x441822;});})['then'](function(_0x52dbb7){if(_0x52dbb7){_0x1b4690[_0x1aae('0x1b')][_0x1aae('0x70')]=_0x52dbb7[0x0];if(!_0x2dcc31[_0x1aae('0x43')][_0x1aae('0x62')])return;return db['User'][_0x1aae('0x41')]({'where':{'id':_0x2dcc31['body'][_0x1aae('0x62')],'role':_0x1aae('0x71')},'attributes':['id',_0x1aae('0x25'),_0x1aae('0x72'),_0x1aae('0x73'),_0x1aae('0x74')],'raw':!![]});}return null;})[_0x1aae('0x12')](function(_0x16aefc){if(!_0x16aefc)return null;_0x1b4690[_0x1aae('0x1b')][_0x1aae('0x71')]=_0x16aefc;return _0x1b4690;})[_0x1aae('0x12')](function(_0x5e427d){if(_0x5e427d){if(_0x2dcc31['body'][_0x1aae('0x75')]){_0x1b4690[_0x1aae('0x1b')][_0x1aae('0x76')]=util[_0x1aae('0x5c')](_0x1aae('0x77'),_0x2dcc31[_0x1aae('0x68')][_0x1aae('0x25')]);_0x1b4690[_0x1aae('0x1b')][_0x1aae('0x78')]=_0x1b4690['channel'];_0x1b4690[_0x1aae('0x1b')]['motionChannel']=_0x1b4690['channel'];_0x1b4690[_0x1aae('0x1b')]['event']='accept';_0x1b4690[_0x1aae('0x1b')][_0x1aae('0x43')]=htmlToText[_0x1aae('0x79')](_0x1b4690['message'][_0x1aae('0x43')]);return respondWithRpcPromise(_0x1aae('0x7a'),_0x1aae('0x7a'),{'event':'acceptmessage','message':_0x1b4690['message']},client9002)['then'](function(){return _0x1b4690;});}return _0x1b4690;}return null;})[_0x1aae('0x12')](respondWithResult(_0x5b885a,null))[_0x1aae('0x1d')](handleError(_0x5b885a,null));};exports['reject']=function(_0xf5e7b4,_0xa67d48){var _0xd42116={'agent':{},'channel':_0x1aae('0x5f')};if(_0xf5e7b4[_0x1aae('0x43')]['id']){delete _0xf5e7b4[_0x1aae('0x43')]['id'];}_0xf5e7b4[_0x1aae('0x43')]['UserId']=_0xf5e7b4[_0x1aae('0x43')]['UserId']||_0xf5e7b4['user']['id'];_0xd42116[_0x1aae('0x71')]['id']=_0xf5e7b4['body'][_0x1aae('0x62')];return db['MailMessage']['find']({'where':{'id':_0xf5e7b4['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa67d48,null))[_0x1aae('0x12')](function(_0xb69fe9){if(_0xb69fe9){_0xd42116['message']=_0xb69fe9[_0x1aae('0x63')]({'plain':!![]});return db[_0x1aae('0x64')][_0x1aae('0x41')]({'where':{'id':_0xb69fe9[_0x1aae('0x65')]}});}return null;})[_0x1aae('0x12')](handleEntityNotFound(_0xa67d48,null))[_0x1aae('0x12')](function(_0x107636){if(_0x107636){_0xd42116[_0x1aae('0x6a')]=_0x107636['get']({'plain':!![]});interaction_log[_0x1aae('0x13')](_0x1aae('0x7b'),_0xf5e7b4[_0x1aae('0x68')]['id'],_0xf5e7b4[_0x1aae('0x68')][_0x1aae('0x25')],_0xf5e7b4[_0x1aae('0x68')][_0x1aae('0x69')],_0xd42116['interaction']['id'],_0xf5e7b4['body']?JSON[_0x1aae('0x18')](_0xf5e7b4[_0x1aae('0x43')]):_0x1aae('0x6b'));return respondWithRpcPromise(_0x1aae('0x7c'),_0x1aae('0x7d'),_0xd42116);}return null;})[_0x1aae('0x12')](function(_0xaf8d52){var _0x194de3=_0x1aae('0x6d')+_0xaf8d52[_0x1aae('0x1b')]['ContactId'];return db[_0x1aae('0x7e')][_0x1aae('0x2c')](_0x194de3,{'type':db['Sequelize'][_0x1aae('0x6f')][_0x1aae('0x7f')],'raw':!![]})[_0x1aae('0x12')](function(_0x617569){return _0x617569;});})[_0x1aae('0x12')](function(_0x39d20d){if(_0x39d20d){_0xd42116[_0x1aae('0x1b')][_0x1aae('0x70')]=_0x39d20d[0x0];if(!_0xf5e7b4[_0x1aae('0x43')][_0x1aae('0x62')])return;return db['User'][_0x1aae('0x41')]({'where':{'id':_0xf5e7b4[_0x1aae('0x43')][_0x1aae('0x62')],'role':_0x1aae('0x71')},'attributes':['id',_0x1aae('0x25'),_0x1aae('0x72'),_0x1aae('0x73'),_0x1aae('0x74')],'raw':!![]});}return null;})[_0x1aae('0x12')](function(_0x284aa2){if(!_0x284aa2)return null;_0xd42116[_0x1aae('0x1b')][_0x1aae('0x71')]=_0x284aa2;return _0xd42116;})['then'](function(_0x241971){if(_0x241971){_0x241971[_0x1aae('0x1b')][_0x1aae('0x76')]=util[_0x1aae('0x5c')](_0x1aae('0x77'),_0xf5e7b4[_0x1aae('0x68')][_0x1aae('0x25')]);_0x241971['message'][_0x1aae('0x78')]=_0xd42116[_0x1aae('0x78')];_0x241971['message'][_0x1aae('0x80')]=_0xd42116[_0x1aae('0x78')];_0x241971[_0x1aae('0x1b')][_0x1aae('0x81')]=_0x1aae('0x82');_0x241971[_0x1aae('0x1b')][_0x1aae('0x43')]=htmlToText[_0x1aae('0x79')](_0xd42116[_0x1aae('0x1b')][_0x1aae('0x43')]);respondWithRpcPromise(_0x1aae('0x7a'),'EventManager',{'event':_0x1aae('0x83'),'message':_0x241971['message']},client9002);return _0xd42116;}return null;})[_0x1aae('0x12')](respondWithResult(_0xa67d48,null))[_0x1aae('0x1d')](handleError(_0xa67d48,null));};exports['download']=function(_0x1c5d31,_0x33c824){var _0x40c91c=moment()['unix']()[_0x1aae('0x84')]();var _0x41e972=path[_0x1aae('0x54')](config['root'],_0x1aae('0x85'),_0x1aae('0x86'),_0x1aae('0x87'));var _0x3a9ed3=path['join'](config[_0x1aae('0x55')],_0x1aae('0x85'),'files',_0x1aae('0x53'));var _0x3751e3=util['format'](_0x1aae('0x88'),_0x40c91c);return db[_0x1aae('0x3b')][_0x1aae('0x41')]({'where':{'id':_0x1c5d31[_0x1aae('0x3f')]['id']},'attributes':['id',_0x1aae('0x43'),_0x1aae('0x89'),'to','cc','bcc','subject',_0x1aae('0x8a')],'include':_0x1c5d31[_0x1aae('0x2c')]['attachments']?[{'model':db[_0x1aae('0x8b')],'as':_0x1aae('0x8c')}]:undefined})[_0x1aae('0x12')](handleEntityNotFound(_0x33c824,null))[_0x1aae('0x12')](function(_0x1be9ac){if(_0x1be9ac){var _0x4bbc87=_0x1be9ac;var _0x593446={'from':_0x4bbc87[_0x1aae('0x89')],'to':_0x4bbc87['to'],'subject':_0x4bbc87[_0x1aae('0x8d')],'html':htmlEntities[_0x1aae('0x8e')](_0x4bbc87[_0x1aae('0x43')]),'headers':{'Date':moment(_0x4bbc87[_0x1aae('0x8a')])['format'](_0x1aae('0x8f'))},'attachments':[]};if(_0x1be9ac['cc']){_0x593446[_0x1aae('0x90')]['Cc']=_0x1be9ac['cc'];}if(_0x1be9ac[_0x1aae('0x91')]){_0x593446[_0x1aae('0x90')][_0x1aae('0x92')]=_0x1be9ac[_0x1aae('0x91')];}return new BPromise(function(_0x4e5d6d,_0x2150c0){if(_0x1be9ac['Attachments']){for(var _0x162b90=0x0;_0x162b90<_0x1be9ac[_0x1aae('0x8c')]['length'];_0x162b90++){var _0x1dbcd1=_0x1be9ac[_0x1aae('0x8c')][_0x162b90];var _0x4db843=path[_0x1aae('0x54')](_0x3a9ed3,_0x1dbcd1[_0x1aae('0x57')]);if(fs[_0x1aae('0x93')](_0x4db843)){_0x593446[_0x1aae('0x53')][_0x1aae('0x94')]({'name':_0x1dbcd1[_0x1aae('0x25')],'contentType':_0x1dbcd1[_0x1aae('0x29')],'data':fs[_0x1aae('0x95')](_0x4db843)});}}}emlformat['build'](_0x593446,function(_0x4d228a,_0x1ff46a){if(_0x4d228a)return _0x2150c0(_0x4d228a);fs['writeFileSync'](path[_0x1aae('0x54')](_0x41e972,_0x3751e3),_0x1ff46a);return _0x4e5d6d(_0x1ff46a);});});}})[_0x1aae('0x12')](function(_0x4bbb27){if(_0x4bbb27){return _0x33c824[_0x1aae('0x96')](path['join'](_0x41e972,_0x3751e3),_0x3751e3,function(_0x324f12){if(!_0x324f12)fs['unlinkSync'](path[_0x1aae('0x54')](_0x41e972,_0x3751e3));});}})['catch'](handleError(_0x33c824,null));};
\ No newline at end of file
index bedbf30..f767382 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6a4=['save','update','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x20747b,_0x3e7044){var _0x4dee0c=function(_0x34d4de){while(--_0x34d4de){_0x20747b['push'](_0x20747b['shift']());}};_0x4dee0c(++_0x3e7044);}(_0xe6a4,0x1bd));var _0x4e6a=function(_0x496af1,_0x2d5f59){_0x496af1=_0x496af1-0x0;var _0x5700b3=_0xe6a4[_0x496af1];return _0x5700b3;};'use strict';var EventEmitter=require(_0x4e6a('0x0'));var MailMessage=require(_0x4e6a('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4e6a('0x2')](0x0);var events={'afterCreate':_0x4e6a('0x3'),'afterUpdate':_0x4e6a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51b55b){return function(_0x50b794,_0x11c686,_0x27f57f){MailMessageEvents[_0x4e6a('0x5')](_0x51b55b+':'+_0x50b794['id'],_0x50b794);MailMessageEvents[_0x4e6a('0x5')](_0x51b55b,_0x50b794);_0x27f57f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x4e6a('0x6')]=MailMessageEvents;
\ No newline at end of file
+var _0xfb05=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5665b7,_0x634f29){var _0x21418c=function(_0x4e7741){while(--_0x4e7741){_0x5665b7['push'](_0x5665b7['shift']());}};_0x21418c(++_0x634f29);}(_0xfb05,0x6a));var _0x5fb0=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xfb05[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require(_0x5fb0('0x0'));var MailMessage=require(_0x5fb0('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5fb0('0x2')](0x0);var events={'afterCreate':_0x5fb0('0x3'),'afterUpdate':_0x5fb0('0x4'),'afterDestroy':_0x5fb0('0x5')};function emitEvent(_0x23dc7e){return function(_0x4e8b18,_0x2c0066,_0x2eb078){MailMessageEvents['emit'](_0x23dc7e+':'+_0x4e8b18['id'],_0x4e8b18);MailMessageEvents[_0x5fb0('0x6')](_0x23dc7e,_0x4e8b18);_0x2eb078(null);};}for(var e in events){if(events[_0x5fb0('0x7')](e)){var event=events[e];MailMessage[_0x5fb0('0x8')](e,emitEvent(event));}}module[_0x5fb0('0x9')]=MailMessageEvents;
\ No newline at end of file
index b3d5fc1..51db2b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd22c=['messageId','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','MailInteraction','findOne','MailInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports','define','mail_messages'];(function(_0x56304e,_0x24bfb0){var _0x10ced7=function(_0x35f769){while(--_0x35f769){_0x56304e['push'](_0x56304e['shift']());}};_0x10ced7(++_0x24bfb0);}(_0xd22c,0x1b5));var _0xcd22=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0xd22c[_0x10e840];return _0x405caa;};'use strict';var _=require(_0xcd22('0x0'));var util=require(_0xcd22('0x1'));var logger=require(_0xcd22('0x2'))(_0xcd22('0x3'));var moment=require(_0xcd22('0x4'));var BPromise=require(_0xcd22('0x5'));var rp=require(_0xcd22('0x6'));var htmlToText=require(_0xcd22('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd22('0x8'));var config=require('../../config/environment');var attributes=require(_0xcd22('0x9'));module[_0xcd22('0xa')]=function(_0x1d8a33,_0x2a522c){return _0x1d8a33[_0xcd22('0xb')]('MailMessage',attributes,{'tableName':_0xcd22('0xc'),'paranoid':![],'indexes':[{'name':_0xcd22('0xd'),'fields':[_0xcd22('0xd')]},{'name':'fti_mail_messages','fields':[_0xcd22('0xe'),_0xcd22('0xf')],'type':_0xcd22('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b1043,_0x34505c,_0x4e4953){if(_0x4b1043[_0xcd22('0x11')]){_0x4b1043[_0xcd22('0xe')]=htmlToText['fromString'](_0x4b1043[_0xcd22('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4e4953(null,_0x34505c);},'afterCreate':function(_0x43527b,_0x52ee29,_0x4fdccc){var _0x3981d2=_0x1d8a33[_0xcd22('0x12')];var _0x11ca01=_0x43527b[_0xcd22('0x13')]({'plain':!![]});if(_0x11ca01[_0xcd22('0x14')][_0xcd22('0x15')]()==='in'||_0x11ca01[_0xcd22('0x14')][_0xcd22('0x15')]()==='out'&&!_0x11ca01['secret']&&!_['isNil'](_0x11ca01['UserId'])){_0x3981d2[_0xcd22('0x16')][_0xcd22('0x17')]({'where':{'id':_0x11ca01[_0xcd22('0x18')]}})[_0xcd22('0x19')](function(_0x24ca13){if(_0x24ca13){_0x24ca13[_0xcd22('0x1a')]({'lastMsgAt':_0x11ca01[_0xcd22('0x1b')],'lastMsgDirection':_0x11ca01[_0xcd22('0x14')][_0xcd22('0x15')]()});}})['catch'](function(_0x3a274f){console['error'](_0x3a274f);});}_0x4fdccc();}},'charset':_0xcd22('0x1c'),'collate':_0xcd22('0x1d')});};
\ No newline at end of file
+var _0x6b78=['html-to-text','path','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','update','error','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x3ef1e8,_0x5ed53f){var _0x50acb7=function(_0x49ad89){while(--_0x49ad89){_0x3ef1e8['push'](_0x3ef1e8['shift']());}};_0x50acb7(++_0x5ed53f);}(_0x6b78,0x8d));var _0x86b7=function(_0x459f8e,_0x1fc98e){_0x459f8e=_0x459f8e-0x0;var _0x3f0449=_0x6b78[_0x459f8e];return _0x3f0449;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x86b7('0x0'))(_0x86b7('0x1'));var moment=require(_0x86b7('0x2'));var BPromise=require(_0x86b7('0x3'));var rp=require('request-promise');var htmlToText=require(_0x86b7('0x4'));var fs=require('fs');var path=require(_0x86b7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x86b7('0x6'));module[_0x86b7('0x7')]=function(_0xfbbf16,_0x4145ec){return _0xfbbf16[_0x86b7('0x8')](_0x86b7('0x9'),attributes,{'tableName':_0x86b7('0xa'),'paranoid':![],'indexes':[{'name':_0x86b7('0xb'),'fields':[_0x86b7('0xb')]},{'name':'fti_mail_messages','fields':[_0x86b7('0xc'),_0x86b7('0xd')],'type':_0x86b7('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x29d99d,_0x2b1070,_0x1c643e){if(_0x29d99d['body']){_0x29d99d[_0x86b7('0xc')]=htmlToText[_0x86b7('0xf')](_0x29d99d['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1c643e(null,_0x2b1070);},'afterCreate':function(_0x1c509a,_0x1c09d4,_0x37eb9a){var _0x13e3d6=_0xfbbf16[_0x86b7('0x10')];var _0x3fb143=_0x1c509a[_0x86b7('0x11')]({'plain':!![]});if(_0x3fb143[_0x86b7('0x12')][_0x86b7('0x13')]()==='in'||_0x3fb143['direction'][_0x86b7('0x13')]()===_0x86b7('0x14')&&!_0x3fb143[_0x86b7('0x15')]&&!_['isNil'](_0x3fb143[_0x86b7('0x16')])){_0x13e3d6[_0x86b7('0x17')][_0x86b7('0x18')]({'where':{'id':_0x3fb143[_0x86b7('0x19')]}})['then'](function(_0xf2bfe2){if(_0xf2bfe2){_0xf2bfe2[_0x86b7('0x1a')]({'lastMsgAt':_0x3fb143['createdAt'],'lastMsgDirection':_0x3fb143['direction'][_0x86b7('0x13')]()});}})['catch'](function(_0x2503f2){console[_0x86b7('0x1b')](_0x2503f2);});}_0x37eb9a();}},'charset':'utf8mb4','collate':_0x86b7('0x1c')});};
\ No newline at end of file
index a31e4b0..fd4219e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ed=['create','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage','MailMessage'];(function(_0x215fe7,_0x541d89){var _0x5e90bd=function(_0x43e246){while(--_0x43e246){_0x215fe7['push'](_0x215fe7['shift']());}};_0x5e90bd(++_0x541d89);}(_0x80ed,0x11c));var _0xd80e=function(_0x6baad4,_0x4bfdb5){_0x6baad4=_0x6baad4-0x0;var _0x2166a3=_0x80ed[_0x6baad4];return _0x2166a3;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('MailMessage,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});}exports[_0xd80e('0x1d')]=function(_0x527237){var _0x41417d=this;return new Promise(function(_0x2ef8a1,_0x2765ea){return db[_0xd80e('0x1e')][_0xd80e('0x1f')](_0x527237['body'],{'raw':_0x527237['options']?_0x527237[_0xd80e('0x20')][_0xd80e('0x21')]===undefined?!![]:![]:!![]})[_0xd80e('0x12')](function(_0x2d46e7){logger[_0xd80e('0x13')](_0xd80e('0x1d'),_0x527237);logger[_0xd80e('0x16')]('CreateMailMessage',_0x527237,JSON[_0xd80e('0x22')](_0x2d46e7));_0x2ef8a1(_0x2d46e7);})[_0xd80e('0x1c')](function(_0x170109){logger['error'](_0xd80e('0x1d'),_0x170109[_0xd80e('0x1a')],_0x527237);_0x2765ea(_0x41417d[_0xd80e('0x19')](0x1f4,_0x170109['message']));});});};
\ No newline at end of file
+var _0x1399=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','raw','debug','stringify'];(function(_0x2416b2,_0x134439){var _0x159c30=function(_0x2e335c){while(--_0x2e335c){_0x2416b2['push'](_0x2416b2['shift']());}};_0x159c30(++_0x134439);}(_0x1399,0x16c));var _0x9139=function(_0x263cfa,_0x443531){_0x263cfa=_0x263cfa-0x0;var _0x14b8ec=_0x1399[_0x263cfa];return _0x14b8ec;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});config[_0x9139('0xa')]=_[_0x9139('0xb')](config['redis'],{'host':_0x9139('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9139('0xd'))[_0x9139('0xe')](socket);function respondWithRpcPromise(_0x4830cd,_0x315de8,_0x1bfa6b){return new BPromise(function(_0x5c90eb,_0x4f7f3a){return client[_0x9139('0xf')](_0x4830cd,_0x1bfa6b)[_0x9139('0x10')](function(_0x23357c){logger[_0x9139('0x11')](_0x9139('0x12'),_0x315de8,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'),JSON['stringify'](_0x23357c));if(_0x23357c[_0x9139('0x14')]){if(_0x23357c[_0x9139('0x14')][_0x9139('0x15')]===0x1f4){logger[_0x9139('0x14')]('MailMessage,\x20%s,\x20%s',_0x315de8,_0x23357c[_0x9139('0x14')]['message']);return _0x4f7f3a(_0x23357c['error']['message']);}logger[_0x9139('0x14')](_0x9139('0x12'),_0x315de8,_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);return _0x5c90eb(_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'));_0x5c90eb(_0x23357c[_0x9139('0x17')]['message']);}})['catch'](function(_0x30a363){logger[_0x9139('0x14')]('MailMessage,\x20%s,\x20%s',_0x315de8,_0x30a363);_0x4f7f3a(_0x30a363);});});}exports[_0x9139('0x18')]=function(_0x1ef57b){var _0x1a592e=this;return new Promise(function(_0x3c8296,_0xd2eb33){return db[_0x9139('0x19')][_0x9139('0x1a')](_0x1ef57b[_0x9139('0x1b')],{'raw':_0x1ef57b[_0x9139('0x1c')]?_0x1ef57b[_0x9139('0x1c')][_0x9139('0x1d')]===undefined?!![]:![]:!![]})[_0x9139('0x10')](function(_0x5a3e2e){logger[_0x9139('0x11')](_0x9139('0x18'),_0x1ef57b);logger[_0x9139('0x1e')](_0x9139('0x18'),_0x1ef57b,JSON[_0x9139('0x1f')](_0x5a3e2e));_0x3c8296(_0x5a3e2e);})[_0x9139('0x20')](function(_0x4b7fe0){logger[_0x9139('0x14')](_0x9139('0x18'),_0x4b7fe0['message'],_0x1ef57b);_0xd2eb33(_0x1a592e[_0x9139('0x14')](0x1f4,_0x4b7fe0[_0x9139('0x16')]));});});};
\ No newline at end of file
index 5172860..54a40a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ed=['save','remove','update','emit','removeListener','register','length','./mailMessage.events'];(function(_0x552c27,_0x478dc2){var _0x2a0922=function(_0x22617c){while(--_0x22617c){_0x552c27['push'](_0x552c27['shift']());}};_0x2a0922(++_0x478dc2);}(_0xa9ed,0x187));var _0xda9e=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0xa9ed[_0x1559a5];return _0x17a783;};'use strict';var MailMessageEvents=require(_0xda9e('0x0'));var events=[_0xda9e('0x1'),_0xda9e('0x2'),_0xda9e('0x3')];function createListener(_0xa4ea43,_0x5745f3){return function(_0x2bdc44){_0x5745f3[_0xda9e('0x4')](_0xa4ea43,_0x2bdc44);};}function removeListener(_0xb313eb,_0x6a4f63){return function(){MailMessageEvents[_0xda9e('0x5')](_0xb313eb,_0x6a4f63);};}exports[_0xda9e('0x6')]=function(_0x424183){for(var _0xcf4678=0x0,_0x3dd15e=events[_0xda9e('0x7')];_0xcf4678<_0x3dd15e;_0xcf4678++){var _0x15b384=events[_0xcf4678];var _0x2a66c6=createListener('mailMessage:'+_0x15b384,_0x424183);MailMessageEvents['on'](_0x15b384,_0x2a66c6);}};
\ No newline at end of file
+var _0x2d0d=['emit','removeListener','length','mailMessage:','save','remove','update'];(function(_0x4a3b58,_0x62742f){var _0x4d4001=function(_0x272e95){while(--_0x272e95){_0x4a3b58['push'](_0x4a3b58['shift']());}};_0x4d4001(++_0x62742f);}(_0x2d0d,0xa5));var _0xd2d0=function(_0x2af766,_0x269fdd){_0x2af766=_0x2af766-0x0;var _0x5e21a5=_0x2d0d[_0x2af766];return _0x5e21a5;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xd2d0('0x0'),_0xd2d0('0x1'),_0xd2d0('0x2')];function createListener(_0x340c96,_0x3fc99b){return function(_0x4526a3){_0x3fc99b[_0xd2d0('0x3')](_0x340c96,_0x4526a3);};}function removeListener(_0x3a42e1,_0x5bcd7e){return function(){MailMessageEvents[_0xd2d0('0x4')](_0x3a42e1,_0x5bcd7e);};}exports['register']=function(_0x39afb2){for(var _0x1651da=0x0,_0x48e664=events[_0xd2d0('0x5')];_0x1651da<_0x48e664;_0x1651da++){var _0x25a728=events[_0x1651da];var _0x1a9ada=createListener(_0xd2d0('0x6')+_0x25a728,_0x39afb2);MailMessageEvents['on'](_0x25a728,_0x1a9ada);}};
\ No newline at end of file
index 8487d05..c1055d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e33=['fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','index','get','/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','/:id','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x32b5f5,_0x4e6054){var _0x4905f7=function(_0x17c894){while(--_0x17c894){_0x32b5f5['push'](_0x32b5f5['shift']());}};_0x4905f7(++_0x4e6054);}(_0x2e33,0xf2));var _0x32e3=function(_0xa8accf,_0x14fbe4){_0xa8accf=_0xa8accf-0x0;var _0x56347a=_0x2e33[_0xa8accf];return _0x56347a;};'use strict';var multer=require(_0x32e3('0x0'));var util=require(_0x32e3('0x1'));var path=require(_0x32e3('0x2'));var timeout=require(_0x32e3('0x3'));var express=require(_0x32e3('0x4'));var router=express[_0x32e3('0x5')]();var fs_extra=require(_0x32e3('0x6'));var auth=require(_0x32e3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x32e3('0x8'));var controller=require(_0x32e3('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x32e3('0xa')]);router[_0x32e3('0xb')](_0x32e3('0xc'),auth[_0x32e3('0xd')](),controller['describe']);router['get']('/:id',auth[_0x32e3('0xd')](),controller[_0x32e3('0xe')]);router['get'](_0x32e3('0xf'),auth[_0x32e3('0xd')](),controller[_0x32e3('0x10')]);router['get'](_0x32e3('0x11'),auth[_0x32e3('0xd')](),controller[_0x32e3('0x12')]);router[_0x32e3('0xb')]('/:id/users',auth[_0x32e3('0xd')](),controller[_0x32e3('0x13')]);router['post']('/',auth[_0x32e3('0xd')](),controller[_0x32e3('0x14')]);router[_0x32e3('0x15')]('/:id/teams',auth[_0x32e3('0xd')](),controller[_0x32e3('0x16')]);router[_0x32e3('0x15')](_0x32e3('0x17'),auth['isAuthenticated'](),controller['addAgents']);router[_0x32e3('0x18')](_0x32e3('0x19'),auth[_0x32e3('0xd')](),controller[_0x32e3('0x1a')]);router[_0x32e3('0x1b')](_0x32e3('0x19'),auth[_0x32e3('0xd')](),controller[_0x32e3('0x1c')]);router[_0x32e3('0x1b')]('/:id/teams',auth[_0x32e3('0xd')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x32e3('0xd')](),controller[_0x32e3('0x1d')]);module[_0x32e3('0x1e')]=router;
\ No newline at end of file
+var _0x3aec=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3aec,0x122));var _0xc3ae=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x3aec[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0xc3ae('0x0'));var util=require(_0xc3ae('0x1'));var path=require(_0xc3ae('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3ae('0x3'));var router=express[_0xc3ae('0x4')]();var fs_extra=require(_0xc3ae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc3ae('0x6'));var config=require(_0xc3ae('0x7'));var controller=require(_0xc3ae('0x8'));router[_0xc3ae('0x9')]('/',auth[_0xc3ae('0xa')](),controller[_0xc3ae('0xb')]);router[_0xc3ae('0x9')](_0xc3ae('0xc'),auth[_0xc3ae('0xa')](),controller[_0xc3ae('0xd')]);router[_0xc3ae('0x9')](_0xc3ae('0xe'),auth[_0xc3ae('0xa')](),controller['show']);router[_0xc3ae('0x9')](_0xc3ae('0xf'),auth['isAuthenticated'](),controller[_0xc3ae('0x10')]);router[_0xc3ae('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc3ae('0x11')]);router[_0xc3ae('0x9')](_0xc3ae('0x12'),auth['isAuthenticated'](),controller[_0xc3ae('0x13')]);router[_0xc3ae('0x14')]('/',auth[_0xc3ae('0xa')](),controller['create']);router['post'](_0xc3ae('0x15'),auth[_0xc3ae('0xa')](),controller[_0xc3ae('0x16')]);router[_0xc3ae('0x14')](_0xc3ae('0x12'),auth['isAuthenticated'](),controller[_0xc3ae('0x17')]);router['put'](_0xc3ae('0xe'),auth['isAuthenticated'](),controller[_0xc3ae('0x18')]);router[_0xc3ae('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xc3ae('0x1a')]);router[_0xc3ae('0x19')](_0xc3ae('0x15'),auth[_0xc3ae('0xa')](),controller[_0xc3ae('0x1b')]);router[_0xc3ae('0x19')](_0xc3ae('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xc3ae('0x1c')]=router;
\ No newline at end of file
index e775756..1d767f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1713=['rrmemory','beepall','roundrobin','sequelize','exports','name','INTEGER','ENUM'];(function(_0x8c78,_0x3b91c2){var _0x384510=function(_0x92d7a2){while(--_0x92d7a2){_0x8c78['push'](_0x8c78['shift']());}};_0x384510(++_0x3b91c2);}(_0x1713,0x153));var _0x3171=function(_0x22eea5,_0x4a6083){_0x22eea5=_0x22eea5-0x0;var _0x35ca78=_0x1713[_0x22eea5];return _0x35ca78;};'use strict';var Sequelize=require(_0x3171('0x0'));module[_0x3171('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3171('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3171('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3171('0x4')](_0x3171('0x5'),_0x3171('0x6'),_0x3171('0x7'))}};
\ No newline at end of file
+var _0x600e=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x600e,0x130));var _0xe600=function(_0x468def,_0x20da6e){_0x468def=_0x468def-0x0;var _0x4aa6c0=_0x600e[_0x468def];return _0x4aa6c0;};'use strict';var Sequelize=require(_0xe600('0x0'));module[_0xe600('0x1')]={'name':{'type':Sequelize[_0xe600('0x2')],'unique':_0xe600('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe600('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe600('0x5'),_0xe600('0x6'),_0xe600('0x7'))}};
\ No newline at end of file
index 47f72b7..f05e538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d0=['userMailQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','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','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','MailQueues','UserProfileResource','destroy','then','end','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','each','findOrCreate','emit','select','field','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','spread'];(function(_0x3a4f18,_0x1af741){var _0x4c20fc=function(_0x27115f){while(--_0x27115f){_0x3a4f18['push'](_0x3a4f18['shift']());}};_0x4c20fc(++_0x1af741);}(_0x38d0,0x123));var _0x038d=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x38d0[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x038d('0x0'));var zipdir=require(_0x038d('0x1'));var jsonpatch=require(_0x038d('0x2'));var rp=require('request-promise');var moment=require(_0x038d('0x3'));var BPromise=require(_0x038d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x038d('0x5'));var sox=require('sox');var csv=require(_0x038d('0x6'));var ejs=require(_0x038d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x038d('0x8'));var squel=require(_0x038d('0x9'));var crypto=require(_0x038d('0xa'));var jsforce=require(_0x038d('0xb'));var deskjs=require(_0x038d('0xc'));var toCsv=require(_0x038d('0x6'));var querystring=require(_0x038d('0xd'));var Papa=require(_0x038d('0xe'));var Redis=require(_0x038d('0xf'));var authService=require(_0x038d('0x10'));var qs=require(_0x038d('0x11'));var as=require(_0x038d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x038d('0x13'))(_0x038d('0x14'));var utils=require(_0x038d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x038d('0x16'));var db=require(_0x038d('0x17'))['db'];config[_0x038d('0x18')]=_[_0x038d('0x19')](config[_0x038d('0x18')],{'host':_0x038d('0x1a'),'port':0x18eb});var socket=require(_0x038d('0x1b'))(new Redis(config[_0x038d('0x18')]));require(_0x038d('0x1c'))['register'](socket);function respondWithStatusCode(_0x5adcd5,_0x5b764a){_0x5b764a=_0x5b764a||0xcc;return function(_0xd27ef8){if(_0xd27ef8){return _0x5adcd5[_0x038d('0x1d')](_0x5b764a);}return _0x5adcd5['status'](_0x5b764a)['end']();};}function respondWithResult(_0x4e4960,_0x483822){_0x483822=_0x483822||0xc8;return function(_0x1be3f6){if(_0x1be3f6){return _0x4e4960[_0x038d('0x1e')](_0x483822)[_0x038d('0x1f')](_0x1be3f6);}};}function respondWithFilteredResult(_0x2b5feb,_0x39cca1){return function(_0x42c17f){if(_0x42c17f){var _0x3e8d0f=typeof _0x39cca1[_0x038d('0x20')]===_0x038d('0x21')&&typeof _0x39cca1[_0x038d('0x22')]===_0x038d('0x21');var _0x21773e=_0x42c17f[_0x038d('0x23')];var _0x34206d=_0x3e8d0f?0x0:_0x39cca1['offset'];var _0x5a1bc8=_0x3e8d0f?_0x42c17f[_0x038d('0x23')]:_0x39cca1[_0x038d('0x20')]+_0x39cca1[_0x038d('0x22')];var _0x1a8efc;if(_0x5a1bc8>=_0x21773e){_0x5a1bc8=_0x21773e;_0x1a8efc=0xc8;}else{_0x1a8efc=0xce;}_0x2b5feb[_0x038d('0x1e')](_0x1a8efc);return _0x2b5feb[_0x038d('0x24')](_0x038d('0x25'),_0x34206d+'-'+_0x5a1bc8+'/'+_0x21773e)['json'](_0x42c17f);}return null;};}function patchUpdates(_0x89c6f1){return function(_0x4d1100){try{jsonpatch[_0x038d('0x26')](_0x4d1100,_0x89c6f1,!![]);}catch(_0x4eaaff){return BPromise['reject'](_0x4eaaff);}return _0x4d1100[_0x038d('0x27')]();};}function saveUpdates(_0x3611ff,_0x230020){return function(_0x1e3709){if(_0x1e3709){return _0x1e3709[_0x038d('0x28')](_0x3611ff)['then'](function(_0x107d51){return _0x107d51;});}return null;};}function removeEntity(_0x3e1286,_0x1dc3f3){return function(_0x5c7db6){if(_0x5c7db6){return _0x5c7db6['destroy']()['then'](function(){var _0x4379d9=_0x5c7db6[_0x038d('0x29')]({'plain':!![]});var _0x15babc=_0x038d('0x2a');return db[_0x038d('0x2b')][_0x038d('0x2c')]({'where':{'type':_0x15babc,'resourceId':_0x4379d9['id']}})[_0x038d('0x2d')](function(){return _0x5c7db6;});})['then'](function(){_0x3e1286['status'](0xcc)[_0x038d('0x2e')]();});}};}function handleEntityNotFound(_0x1f7cdb,_0x33fa99){return function(_0x56df41){if(!_0x56df41){_0x1f7cdb[_0x038d('0x1d')](0x194);}return _0x56df41;};}function handleError(_0x215b2e,_0x595188){_0x595188=_0x595188||0x1f4;return function(_0x5a5c4e){logger[_0x038d('0x2f')](_0x5a5c4e[_0x038d('0x30')]);if(_0x5a5c4e[_0x038d('0x31')]){delete _0x5a5c4e[_0x038d('0x31')];}_0x215b2e['status'](_0x595188)[_0x038d('0x32')](_0x5a5c4e);};}exports['index']=function(_0x1ea796,_0x7fa97b){var _0x53e114={},_0x217ab6={},_0x412c6a={'count':0x0,'rows':[]};var _0x22911b=_['map'](db[_0x038d('0x33')][_0x038d('0x34')],function(_0x5203a1){return{'name':_0x5203a1[_0x038d('0x35')],'type':_0x5203a1[_0x038d('0x36')][_0x038d('0x37')]};});_0x217ab6['model']=_[_0x038d('0x38')](_0x22911b,_0x038d('0x31'));_0x217ab6[_0x038d('0x39')]=_[_0x038d('0x3a')](_0x1ea796['query']);_0x217ab6[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x217ab6[_0x038d('0x3d')],_0x217ab6[_0x038d('0x39')]);_0x53e114[_0x038d('0x3e')]=_['intersection'](_0x217ab6[_0x038d('0x3d')],qs[_0x038d('0x3f')](_0x1ea796[_0x038d('0x39')][_0x038d('0x3f')]));_0x53e114['attributes']=_0x53e114[_0x038d('0x3e')][_0x038d('0x40')]?_0x53e114[_0x038d('0x3e')]:_0x217ab6[_0x038d('0x3d')];if(!_0x1ea796['query'][_0x038d('0x41')](_0x038d('0x42'))){_0x53e114['limit']=qs[_0x038d('0x22')](_0x1ea796['query'][_0x038d('0x22')]);_0x53e114[_0x038d('0x20')]=qs['offset'](_0x1ea796['query']['offset']);}_0x53e114[_0x038d('0x43')]=qs[_0x038d('0x44')](_0x1ea796[_0x038d('0x39')]['sort']);_0x53e114['where']=qs['filters'](_[_0x038d('0x45')](_0x1ea796[_0x038d('0x39')],_0x217ab6[_0x038d('0x3b')]),_0x22911b);if(_0x1ea796[_0x038d('0x39')]['filter']){_0x53e114[_0x038d('0x46')]=_[_0x038d('0x47')](_0x53e114[_0x038d('0x46')],{'$or':_[_0x038d('0x38')](_0x22911b,function(_0xa7c1c4){if(_0xa7c1c4[_0x038d('0x36')]!==_0x038d('0x48')){var _0x223c97={};_0x223c97[_0xa7c1c4[_0x038d('0x31')]]={'$like':'%'+_0x1ea796[_0x038d('0x39')][_0x038d('0x49')]+'%'};return _0x223c97;}})});}_0x53e114=_[_0x038d('0x47')]({},_0x53e114,_0x1ea796[_0x038d('0x4a')]);var _0x3051a2={'where':_0x53e114[_0x038d('0x46')]};return db[_0x038d('0x33')][_0x038d('0x23')](_0x3051a2)[_0x038d('0x2d')](function(_0x171545){_0x412c6a[_0x038d('0x23')]=_0x171545;if(_0x1ea796[_0x038d('0x39')][_0x038d('0x4b')]){_0x53e114[_0x038d('0x4c')]=[{'all':!![]}];}return db['MailQueue'][_0x038d('0x4d')](_0x53e114);})['then'](function(_0x547f4b){_0x412c6a[_0x038d('0x4e')]=_0x547f4b;return _0x412c6a;})[_0x038d('0x2d')](respondWithFilteredResult(_0x7fa97b,_0x53e114))[_0x038d('0x4f')](handleError(_0x7fa97b,null));};exports[_0x038d('0x50')]=function(_0x299e94,_0x38f7e1){var _0x2911ed={'raw':!![],'where':{'id':_0x299e94[_0x038d('0x51')]['id']}},_0x27b774={};_0x27b774[_0x038d('0x3d')]=_[_0x038d('0x3a')](db[_0x038d('0x33')][_0x038d('0x34')]);_0x27b774['query']=_[_0x038d('0x3a')](_0x299e94[_0x038d('0x39')]);_0x27b774[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x27b774[_0x038d('0x3d')],_0x27b774[_0x038d('0x39')]);_0x2911ed[_0x038d('0x3e')]=_[_0x038d('0x3c')](_0x27b774['model'],qs[_0x038d('0x3f')](_0x299e94[_0x038d('0x39')][_0x038d('0x3f')]));_0x2911ed[_0x038d('0x3e')]=_0x2911ed[_0x038d('0x3e')][_0x038d('0x40')]?_0x2911ed[_0x038d('0x3e')]:_0x27b774[_0x038d('0x3d')];if(_0x299e94[_0x038d('0x39')][_0x038d('0x4b')]){_0x2911ed['include']=[{'all':!![]}];}_0x2911ed=_[_0x038d('0x47')]({},_0x2911ed,_0x299e94[_0x038d('0x4a')]);return db['MailQueue'][_0x038d('0x52')](_0x2911ed)[_0x038d('0x2d')](handleEntityNotFound(_0x38f7e1,null))[_0x038d('0x2d')](respondWithResult(_0x38f7e1,null))[_0x038d('0x4f')](handleError(_0x38f7e1,null));};exports[_0x038d('0x53')]=function(_0x4780ca,_0x4e35dd){return db['MailQueue']['create'](_0x4780ca[_0x038d('0x54')],{})[_0x038d('0x2d')](function(_0x519530){var _0xb3d498=_0x4780ca[_0x038d('0x55')]['get']({'plain':!![]});if(!_0xb3d498)throw new Error(_0x038d('0x56'));if(_0xb3d498['role']===_0x038d('0x55')){var _0x34596f=_0x519530['get']({'plain':!![]});var _0x458153=_0x038d('0x2a');return db[_0x038d('0x57')][_0x038d('0x52')]({'where':{'name':_0x458153,'userProfileId':_0xb3d498[_0x038d('0x58')]},'raw':!![]})[_0x038d('0x2d')](function(_0x55f50f){if(_0x55f50f&&_0x55f50f[_0x038d('0x59')]===0x0){return db[_0x038d('0x2b')]['create']({'name':_0x34596f[_0x038d('0x31')],'resourceId':_0x34596f['id'],'type':_0x55f50f[_0x038d('0x31')],'sectionId':_0x55f50f['id']},{})[_0x038d('0x2d')](function(){return _0x519530;});}else{return _0x519530;}})['catch'](function(_0xa4b217){logger[_0x038d('0x2f')](_0x038d('0x5a'),_0xa4b217);throw _0xa4b217;});}return _0x519530;})[_0x038d('0x2d')](respondWithResult(_0x4e35dd,0xc9))[_0x038d('0x4f')](handleError(_0x4e35dd,null));};exports[_0x038d('0x28')]=function(_0xb3b46d,_0x50f1f2){if(_0xb3b46d[_0x038d('0x54')]['id']){delete _0xb3b46d[_0x038d('0x54')]['id'];}return db[_0x038d('0x33')][_0x038d('0x52')]({'where':{'id':_0xb3b46d[_0x038d('0x51')]['id']}})['then'](handleEntityNotFound(_0x50f1f2,null))[_0x038d('0x2d')](saveUpdates(_0xb3b46d['body'],null))[_0x038d('0x2d')](respondWithResult(_0x50f1f2,null))[_0x038d('0x4f')](handleError(_0x50f1f2,null));};exports[_0x038d('0x2c')]=function(_0x2ef626,_0x2e9ab7){return db['MailQueue'][_0x038d('0x52')]({'where':{'id':_0x2ef626[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x2e9ab7,null))[_0x038d('0x2d')](removeEntity(_0x2e9ab7,null))[_0x038d('0x4f')](handleError(_0x2e9ab7,null));};exports[_0x038d('0x5b')]=function(_0xacc1c0,_0x397373){return db['MailQueue'][_0x038d('0x5b')]()[_0x038d('0x2d')](respondWithResult(_0x397373,null))[_0x038d('0x4f')](handleError(_0x397373,null));};exports[_0x038d('0x5c')]=function(_0x5ea2a6,_0x244ca3,_0x1ad8a5){var _0x401676={'raw':!![],'where':{}},_0x3342db={},_0x27bad1;return db[_0x038d('0x33')][_0x038d('0x5d')]({'where':{'id':_0x5ea2a6['params']['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x244ca3,null))[_0x038d('0x2d')](function(_0x4f6d18){if(_0x4f6d18){_0x27bad1=_0x4f6d18['get']({'plain':!![]});_0x3342db[_0x038d('0x3d')]=_[_0x038d('0x3a')](db['UserMailQueue']['rawAttributes']);_0x3342db[_0x038d('0x39')]=_[_0x038d('0x3a')](_0x5ea2a6[_0x038d('0x39')]);_0x3342db['filters']=_[_0x038d('0x3c')](_0x3342db['model'],_0x3342db[_0x038d('0x39')]);_0x401676['attributes']=_[_0x038d('0x3c')](_0x3342db[_0x038d('0x3d')],qs[_0x038d('0x3f')](_0x5ea2a6[_0x038d('0x39')]['fields']));_0x401676['attributes']=_0x401676[_0x038d('0x3e')][_0x038d('0x40')]?_0x401676[_0x038d('0x3e')]:_0x3342db[_0x038d('0x3d')];if(!_0x5ea2a6[_0x038d('0x39')][_0x038d('0x41')](_0x038d('0x42'))){_0x401676[_0x038d('0x22')]=qs[_0x038d('0x22')](_0x5ea2a6['query'][_0x038d('0x22')]);_0x401676[_0x038d('0x20')]=qs[_0x038d('0x20')](_0x5ea2a6['query'][_0x038d('0x20')]);}_0x401676[_0x038d('0x43')]=qs[_0x038d('0x44')](_0x5ea2a6[_0x038d('0x39')]['sort']);_0x401676[_0x038d('0x46')]=qs['filters'](_['pick'](_0x5ea2a6['query'],_0x3342db[_0x038d('0x3b')]));_0x401676[_0x038d('0x46')]['MailQueueId']=_0x4f6d18['id'];if(_0x5ea2a6[_0x038d('0x39')]['filter']){_0x401676['where']=_['merge'](_0x401676['where'],{'$or':_[_0x038d('0x38')](_0x401676[_0x038d('0x3e')],function(_0x1c0a04){var _0x2d32e0={};_0x2d32e0[_0x1c0a04]={'$like':'%'+_0x5ea2a6[_0x038d('0x39')][_0x038d('0x49')]+'%'};return _0x2d32e0;})});}_0x401676=_[_0x038d('0x47')]({},_0x401676,_0x5ea2a6[_0x038d('0x4a')]);return db[_0x038d('0x5e')][_0x038d('0x4d')](_0x401676);}})['then'](function(_0x13abac){if(_0x13abac){return db[_0x038d('0x5f')]['findAndCountAll']({'where':{'id':_[_0x038d('0x38')](_0x13abac,_0x038d('0x60')),'role':_0x038d('0x61')},'attributes':['id',_0x038d('0x31'),_0x038d('0x62'),_0x038d('0x63'),_0x038d('0x64')]});}})['then'](function(_0x13dc25){if(_0x13dc25){return{'count':_0x13dc25['count'],'rows':_[_0x038d('0x38')](_0x13dc25[_0x038d('0x4e')],function(_0x4aa479){return{'membername':_0x4aa479[_0x038d('0x31')],'UserId':_0x4aa479['id'],'queue_name':_0x27bad1['name'],'MailQueueId':_0x27bad1['id'],'interface':util[_0x038d('0x65')](_0x038d('0x66'),'SIP',_0x4aa479['name']),'penalty':0x0,'paused':_0x4aa479['mailPause'],'createdAt':_0x4aa479[_0x038d('0x64')],'updatedAt':_0x4aa479[_0x038d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x244ca3,_0x401676))[_0x038d('0x4f')](handleError(_0x244ca3,null));};exports[_0x038d('0x67')]=function(_0xea137c,_0x15f1ff,_0x1d3a80){var _0x16545a={};var _0x13a5d7={};var _0x4c1595;var _0x3af5e8;return db[_0x038d('0x33')][_0x038d('0x5d')]({'where':{'id':_0xea137c[_0x038d('0x51')]['id']}})['then'](handleEntityNotFound(_0x15f1ff,null))[_0x038d('0x2d')](function(_0x1b12e9){if(_0x1b12e9){_0x4c1595=_0x1b12e9;_0x13a5d7[_0x038d('0x3d')]=_[_0x038d('0x3a')](db[_0x038d('0x68')][_0x038d('0x34')]);_0x13a5d7[_0x038d('0x39')]=_[_0x038d('0x3a')](_0xea137c[_0x038d('0x39')]);_0x13a5d7[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x13a5d7[_0x038d('0x3d')],_0x13a5d7[_0x038d('0x39')]);_0x16545a[_0x038d('0x3e')]=_[_0x038d('0x3c')](_0x13a5d7[_0x038d('0x3d')],qs['fields'](_0xea137c['query']['fields']));_0x16545a[_0x038d('0x3e')]=_0x16545a['attributes'][_0x038d('0x40')]?_0x16545a[_0x038d('0x3e')]:_0x13a5d7[_0x038d('0x3d')];_0x16545a[_0x038d('0x43')]=qs[_0x038d('0x44')](_0xea137c[_0x038d('0x39')]['sort']);_0x16545a[_0x038d('0x46')]=qs['filters'](_['pick'](_0xea137c[_0x038d('0x39')],_0x13a5d7[_0x038d('0x3b')]));if(_0xea137c[_0x038d('0x39')][_0x038d('0x49')]){_0x16545a[_0x038d('0x46')]=_[_0x038d('0x47')](_0x16545a[_0x038d('0x46')],{'$or':_[_0x038d('0x38')](_0x16545a[_0x038d('0x3e')],function(_0x220d27){var _0x3506dd={};_0x3506dd[_0x220d27]={'$like':'%'+_0xea137c[_0x038d('0x39')]['filter']+'%'};return _0x3506dd;})});}_0x16545a=_[_0x038d('0x47')]({},_0x16545a,_0xea137c[_0x038d('0x4a')]);return _0x4c1595[_0x038d('0x67')](_0x16545a);}})[_0x038d('0x2d')](function(_0x7d2904){if(_0x7d2904){_0x3af5e8=_0x7d2904[_0x038d('0x40')];if(!_0xea137c['query'][_0x038d('0x41')](_0x038d('0x42'))){_0x16545a[_0x038d('0x22')]=qs['limit'](_0xea137c[_0x038d('0x39')][_0x038d('0x22')]);_0x16545a['offset']=qs[_0x038d('0x20')](_0xea137c[_0x038d('0x39')]['offset']);}return _0x4c1595[_0x038d('0x67')](_0x16545a);}})['then'](function(_0x4aa2e9){if(_0x4aa2e9){return _0x4aa2e9?{'count':_0x3af5e8,'rows':_0x4aa2e9}:null;}})[_0x038d('0x2d')](respondWithResult(_0x15f1ff,null))[_0x038d('0x4f')](handleError(_0x15f1ff,null));};exports[_0x038d('0x69')]=function(_0x19f7ed,_0x37f82f,_0x2b6f0a){var _0x246d4b=_0x19f7ed[_0x038d('0x54')][_0x038d('0x6a')];return db[_0x038d('0x68')][_0x038d('0x4d')]({'where':{'id':_0x246d4b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x038d('0x31'),'online',_0x038d('0x6b'),_0x038d('0x6c')],'raw':!![]}]})[_0x038d('0x2d')](function(_0x57f97d){if(_0x57f97d){var _0x2258ce=_[_0x038d('0x6d')](_0x57f97d,function(_0xdf8d5){var _0x3c6689=_0xdf8d5['get']({'plain':!![]});return _0x3c6689['Agents'];});return db[_0x038d('0x33')][_0x038d('0x52')]({'where':{'id':_0x19f7ed[_0x038d('0x51')]['id']}})['then'](function(_0x44770c){return db['sequelize']['transaction'](function(_0x2e4663){return _0x44770c[_0x038d('0x69')](_0x246d4b,{'transaction':_0x2e4663})['then'](function(){return BPromise[_0x038d('0x6e')](_0x2258ce,function(_0x188de1){return db[_0x038d('0x5e')][_0x038d('0x6f')]({'where':{'UserId':_0x188de1['id'],'MailQueueId':_0x19f7ed[_0x038d('0x51')]['id']},'transaction':_0x2e4663});});})['then'](function(){_0x2258ce['forEach'](function(_0x491bbd){socket[_0x038d('0x70')]('userMailQueue:save',{'UserId':_0x491bbd['id'],'MailQueueId':_0x44770c['id']});});});});});}})[_0x038d('0x2d')](respondWithStatusCode(_0x37f82f,null))[_0x038d('0x4f')](handleError(_0x37f82f,null));};exports['removeTeams']=function(_0xad0cbc,_0x10cdfb,_0x50ba45){return db[_0x038d('0x68')][_0x038d('0x4d')]({'where':{'id':_0xad0cbc['query'][_0x038d('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x038d('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x10cdfb,null))[_0x038d('0x2d')](function(_0xb8099d){var _0x3cb74e=_[_0x038d('0x38')](_0xb8099d,'id');var _0x43b2aa=[];var _0x35c014=[];var _0x11917a=squel[_0x038d('0x71')]();_0x11917a[_0x038d('0x72')]('tq.TeamId')[_0x038d('0x73')](_0x038d('0x74'),'tq')['join'](_0x038d('0x75'),'ut',_0x038d('0x76'))[_0x038d('0x46')](_0x038d('0x77'),_0xad0cbc[_0x038d('0x51')]['id']);for(var _0x5e021a=0x0;_0x5e021a<_0xb8099d[_0x038d('0x40')];_0x5e021a+=0x1){let _0x553b08=_0xb8099d[_0x5e021a];for(var _0x524590=0x0;_0x524590<_0x553b08[_0x038d('0x78')][_0x038d('0x40')];_0x524590+=0x1){let _0x358475=_0x553b08[_0x038d('0x78')][_0x524590];var _0x1c1910=_0x11917a[_0x038d('0x79')]();_0x1c1910[_0x038d('0x46')](_0x038d('0x7a'),_0x358475['id']);_0x35c014['push'](db[_0x038d('0x7b')][_0x038d('0x39')](_0x1c1910['toString'](),{'type':db[_0x038d('0x7b')][_0x038d('0x7c')][_0x038d('0x7d')]})[_0x038d('0x2d')](function(_0x5872d8){if(_0x5872d8[_0x038d('0x40')]===0x1){return _0x358475['id'];}else{var _0x5721a0=_[_0x038d('0x7e')](_['map'](_0x5872d8,_0x038d('0x7f')),function(_0x1d14ca){return _[_0x038d('0x80')](_0x3cb74e,_0x1d14ca);});if(_0x5721a0){return _0x358475['id'];}}}));}}return BPromise[_0x038d('0x81')](_0x35c014)['then'](function(_0x31eea5){_0x43b2aa=_(_0x43b2aa)[_0x038d('0x82')](_0x31eea5)[_0x038d('0x83')]()[_0x038d('0x84')]();return db[_0x038d('0x33')][_0x038d('0x52')]({'where':{'id':_0xad0cbc[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](function(_0x404a14){return db[_0x038d('0x7b')][_0x038d('0x85')](function(_0x3da9aa){return _0x404a14[_0x038d('0x86')](_0xad0cbc[_0x038d('0x39')][_0x038d('0x6a')],{'transaction':_0x3da9aa})[_0x038d('0x2d')](function(){if(!_[_0x038d('0x87')](_0x43b2aa)){return _0x404a14[_0x038d('0x88')](_0x43b2aa,{'transaction':_0x3da9aa});}})[_0x038d('0x2d')](function(){_0x43b2aa[_0x038d('0x89')](function(_0x1e12e8){socket['emit'](_0x038d('0x8a'),{'UserId':_0x1e12e8,'MailQueueId':_0x404a14['id']});});});});});});})[_0x038d('0x2d')](respondWithStatusCode(_0x10cdfb,null))[_0x038d('0x4f')](handleError(_0x10cdfb,null));};exports['addAgents']=function(_0x5c9b89,_0xee5ac8,_0x23150e){return db['MailQueue'][_0x038d('0x52')]({'where':{'id':_0x5c9b89[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0xee5ac8,null))[_0x038d('0x2d')](function(_0x337b91){if(_0x337b91){return _0x337b91[_0x038d('0x8b')](_0x5c9b89[_0x038d('0x54')]['ids'],_['omit'](_0x5c9b89[_0x038d('0x54')],[_0x038d('0x6a'),'id'])||{})[_0x038d('0x8c')](function(_0x1f019a){for(var _0x49a680=0x0;_0x49a680<_0x5c9b89[_0x038d('0x54')][_0x038d('0x6a')]['length'];_0x49a680+=0x1){socket['emit'](_0x038d('0x8d'),{'UserId':Number(_0x5c9b89[_0x038d('0x54')][_0x038d('0x6a')][_0x49a680]),'MailQueueId':Number(_0x5c9b89[_0x038d('0x51')]['id'])});}return _0x1f019a;});}})[_0x038d('0x2d')](respondWithResult(_0xee5ac8,null))[_0x038d('0x4f')](handleError(_0xee5ac8,null));};exports[_0x038d('0x88')]=function(_0x4ee07e,_0x3b2f8f,_0x4b61a3){return db[_0x038d('0x33')][_0x038d('0x52')]({'where':{'id':_0x4ee07e[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x3b2f8f,null))[_0x038d('0x2d')](function(_0x33ce85){if(_0x33ce85){return _0x33ce85[_0x038d('0x88')](_0x4ee07e[_0x038d('0x39')]['ids'])[_0x038d('0x2d')](function(){if(_[_0x038d('0x8e')](_0x4ee07e['query']['ids'])){for(var _0x3681df=0x0;_0x3681df<_0x4ee07e['query'][_0x038d('0x6a')][_0x038d('0x40')];_0x3681df+=0x1){socket[_0x038d('0x70')]('userMailQueue:remove',{'UserId':Number(_0x4ee07e[_0x038d('0x39')]['ids'][_0x3681df]),'MailQueueId':Number(_0x4ee07e[_0x038d('0x51')]['id'])});}}else{socket[_0x038d('0x70')](_0x038d('0x8a'),{'UserId':Number(_0x4ee07e[_0x038d('0x39')][_0x038d('0x6a')]),'MailQueueId':Number(_0x4ee07e['params']['id'])});}});}})[_0x038d('0x2d')](respondWithStatusCode(_0x3b2f8f,null))[_0x038d('0x4f')](handleError(_0x3b2f8f,null));};exports['getAgents']=function(_0x5bbcea,_0x4c0d55,_0x10d81a){var _0x579f03={};var _0x2570cd={};var _0x4a80fd;var _0xefa367;return db[_0x038d('0x33')][_0x038d('0x5d')]({'where':{'id':_0x5bbcea[_0x038d('0x51')]['id']}})[_0x038d('0x2d')](handleEntityNotFound(_0x4c0d55,null))[_0x038d('0x2d')](function(_0x4eb689){if(_0x4eb689){_0x4a80fd=_0x4eb689;_0x2570cd[_0x038d('0x3d')]=_[_0x038d('0x3a')](db[_0x038d('0x5f')]['rawAttributes']);_0x2570cd[_0x038d('0x39')]=_[_0x038d('0x3a')](_0x5bbcea[_0x038d('0x39')]);_0x2570cd[_0x038d('0x3b')]=_[_0x038d('0x3c')](_0x2570cd[_0x038d('0x3d')],_0x2570cd['query']);_0x579f03[_0x038d('0x3e')]=_['intersection'](_0x2570cd[_0x038d('0x3d')],qs['fields'](_0x5bbcea[_0x038d('0x39')][_0x038d('0x3f')]));_0x579f03[_0x038d('0x3e')]=_0x579f03[_0x038d('0x3e')][_0x038d('0x40')]?_0x579f03[_0x038d('0x3e')]:_0x2570cd[_0x038d('0x3d')];_0x579f03[_0x038d('0x43')]=qs[_0x038d('0x44')](_0x5bbcea[_0x038d('0x39')]['sort']);_0x579f03[_0x038d('0x46')]=qs[_0x038d('0x3b')](_[_0x038d('0x45')](_0x5bbcea['query'],_0x2570cd['filters']));if(_0x5bbcea['query'][_0x038d('0x49')]){_0x579f03['where']=_[_0x038d('0x47')](_0x579f03[_0x038d('0x46')],{'$or':_[_0x038d('0x38')](_0x579f03[_0x038d('0x3e')],function(_0x33b0c6){var _0x1298d4={};_0x1298d4[_0x33b0c6]={'$like':'%'+_0x5bbcea[_0x038d('0x39')]['filter']+'%'};return _0x1298d4;})});}_0x579f03=_[_0x038d('0x47')]({},_0x579f03,_0x5bbcea['options']);return _0x4a80fd['getAgents'](_0x579f03);}})[_0x038d('0x2d')](function(_0x1cf0dc){if(_0x1cf0dc){_0xefa367=_0x1cf0dc[_0x038d('0x40')];if(!_0x5bbcea[_0x038d('0x39')][_0x038d('0x41')]('nolimit')){_0x579f03[_0x038d('0x22')]=qs[_0x038d('0x22')](_0x5bbcea[_0x038d('0x39')][_0x038d('0x22')]);_0x579f03['offset']=qs[_0x038d('0x20')](_0x5bbcea[_0x038d('0x39')][_0x038d('0x20')]);}return _0x4a80fd[_0x038d('0x8f')](_0x579f03);}})['then'](function(_0x3a2b43){if(_0x3a2b43){return _0x3a2b43?{'count':_0xefa367,'rows':_0x3a2b43}:null;}})['then'](respondWithResult(_0x4c0d55,null))[_0x038d('0x4f')](handleError(_0x4c0d55,null));};
\ No newline at end of file
+var _0xf81b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','MailQueue','findAll','catch','show','params','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserMailQueue','sort','MailQueueId','User','findAndCountAll','updatedAt','createdAt','rows','format','%s/%s','SIP','mailPause','getTeams','addTeams','ids','Team','Agents','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','findOne','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4807b8,_0x48ec96){var _0x3c3dd0=function(_0x488d03){while(--_0x488d03){_0x4807b8['push'](_0x4807b8['shift']());}};_0x3c3dd0(++_0x48ec96);}(_0xf81b,0x81));var _0xbf81=function(_0x51c1e3,_0x226769){_0x51c1e3=_0x51c1e3-0x0;var _0x234770=_0xf81b[_0x51c1e3];return _0x234770;};'use strict';var emlformat=require(_0xbf81('0x0'));var rimraf=require(_0xbf81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf81('0x2'));var rp=require(_0xbf81('0x3'));var moment=require('moment');var BPromise=require(_0xbf81('0x4'));var Mustache=require(_0xbf81('0x5'));var util=require(_0xbf81('0x6'));var path=require(_0xbf81('0x7'));var sox=require(_0xbf81('0x8'));var csv=require(_0xbf81('0x9'));var ejs=require(_0xbf81('0xa'));var fs=require('fs');var fs_extra=require(_0xbf81('0xb'));var _=require(_0xbf81('0xc'));var squel=require(_0xbf81('0xd'));var crypto=require(_0xbf81('0xe'));var jsforce=require(_0xbf81('0xf'));var deskjs=require(_0xbf81('0x10'));var toCsv=require(_0xbf81('0x9'));var querystring=require(_0xbf81('0x11'));var Papa=require(_0xbf81('0x12'));var Redis=require(_0xbf81('0x13'));var authService=require(_0xbf81('0x14'));var qs=require(_0xbf81('0x15'));var as=require(_0xbf81('0x16'));var hardwareService=require(_0xbf81('0x17'));var logger=require(_0xbf81('0x18'))(_0xbf81('0x19'));var utils=require(_0xbf81('0x1a'));var config=require(_0xbf81('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf81('0x1c'))['db'];config[_0xbf81('0x1d')]=_[_0xbf81('0x1e')](config['redis'],{'host':_0xbf81('0x1f'),'port':0x18eb});var socket=require(_0xbf81('0x20'))(new Redis(config[_0xbf81('0x1d')]));require(_0xbf81('0x21'))[_0xbf81('0x22')](socket);function respondWithStatusCode(_0x33d0d8,_0x261bc1){_0x261bc1=_0x261bc1||0xcc;return function(_0x40fedf){if(_0x40fedf){return _0x33d0d8[_0xbf81('0x23')](_0x261bc1);}return _0x33d0d8[_0xbf81('0x24')](_0x261bc1)[_0xbf81('0x25')]();};}function respondWithResult(_0x30f774,_0x53810c){_0x53810c=_0x53810c||0xc8;return function(_0x88507e){if(_0x88507e){return _0x30f774[_0xbf81('0x24')](_0x53810c)[_0xbf81('0x26')](_0x88507e);}};}function respondWithFilteredResult(_0xf7da36,_0x1c86a9){return function(_0x3d4b2b){if(_0x3d4b2b){var _0x504f0a=typeof _0x1c86a9[_0xbf81('0x27')]==='undefined'&&typeof _0x1c86a9[_0xbf81('0x28')]===_0xbf81('0x29');var _0x1a2e99=_0x3d4b2b[_0xbf81('0x2a')];var _0x102f64=_0x504f0a?0x0:_0x1c86a9['offset'];var _0x53caf4=_0x504f0a?_0x3d4b2b[_0xbf81('0x2a')]:_0x1c86a9['offset']+_0x1c86a9['limit'];var _0x10d8f2;if(_0x53caf4>=_0x1a2e99){_0x53caf4=_0x1a2e99;_0x10d8f2=0xc8;}else{_0x10d8f2=0xce;}_0xf7da36['status'](_0x10d8f2);return _0xf7da36[_0xbf81('0x2b')](_0xbf81('0x2c'),_0x102f64+'-'+_0x53caf4+'/'+_0x1a2e99)[_0xbf81('0x26')](_0x3d4b2b);}return null;};}function patchUpdates(_0x55ac70){return function(_0x265acd){try{jsonpatch[_0xbf81('0x2d')](_0x265acd,_0x55ac70,!![]);}catch(_0x51e383){return BPromise[_0xbf81('0x2e')](_0x51e383);}return _0x265acd[_0xbf81('0x2f')]();};}function saveUpdates(_0x41d6dc,_0x5629ca){return function(_0x4d7a56){if(_0x4d7a56){return _0x4d7a56['update'](_0x41d6dc)['then'](function(_0x1cb87a){return _0x1cb87a;});}return null;};}function removeEntity(_0xf68e0f,_0x6284e1){return function(_0x3b4d5c){if(_0x3b4d5c){return _0x3b4d5c[_0xbf81('0x30')]()[_0xbf81('0x31')](function(){var _0x34ff74=_0x3b4d5c[_0xbf81('0x32')]({'plain':!![]});var _0x2fb45d=_0xbf81('0x33');return db[_0xbf81('0x34')][_0xbf81('0x30')]({'where':{'type':_0x2fb45d,'resourceId':_0x34ff74['id']}})[_0xbf81('0x31')](function(){return _0x3b4d5c;});})[_0xbf81('0x31')](function(){_0xf68e0f['status'](0xcc)[_0xbf81('0x25')]();});}};}function handleEntityNotFound(_0x4d7529,_0xdc186a){return function(_0x4452bd){if(!_0x4452bd){_0x4d7529[_0xbf81('0x23')](0x194);}return _0x4452bd;};}function handleError(_0x1f9ed7,_0x2fa90b){_0x2fa90b=_0x2fa90b||0x1f4;return function(_0x5a8de8){logger[_0xbf81('0x35')](_0x5a8de8[_0xbf81('0x36')]);if(_0x5a8de8[_0xbf81('0x37')]){delete _0x5a8de8[_0xbf81('0x37')];}_0x1f9ed7[_0xbf81('0x24')](_0x2fa90b)[_0xbf81('0x38')](_0x5a8de8);};}exports[_0xbf81('0x39')]=function(_0x5d888a,_0x56ab5b){var _0x18749={},_0x101740={},_0x104f12={'count':0x0,'rows':[]};var _0x57cd41=_[_0xbf81('0x3a')](db['MailQueue'][_0xbf81('0x3b')],function(_0x455017){return{'name':_0x455017[_0xbf81('0x3c')],'type':_0x455017[_0xbf81('0x3d')][_0xbf81('0x3e')]};});_0x101740[_0xbf81('0x3f')]=_[_0xbf81('0x3a')](_0x57cd41,_0xbf81('0x37'));_0x101740[_0xbf81('0x40')]=_[_0xbf81('0x41')](_0x5d888a[_0xbf81('0x40')]);_0x101740[_0xbf81('0x42')]=_[_0xbf81('0x43')](_0x101740['model'],_0x101740['query']);_0x18749[_0xbf81('0x44')]=_['intersection'](_0x101740['model'],qs['fields'](_0x5d888a['query'][_0xbf81('0x45')]));_0x18749[_0xbf81('0x44')]=_0x18749['attributes'][_0xbf81('0x46')]?_0x18749[_0xbf81('0x44')]:_0x101740[_0xbf81('0x3f')];if(!_0x5d888a[_0xbf81('0x40')][_0xbf81('0x47')](_0xbf81('0x48'))){_0x18749[_0xbf81('0x28')]=qs['limit'](_0x5d888a['query']['limit']);_0x18749[_0xbf81('0x27')]=qs['offset'](_0x5d888a[_0xbf81('0x40')][_0xbf81('0x27')]);}_0x18749[_0xbf81('0x49')]=qs['sort'](_0x5d888a['query']['sort']);_0x18749[_0xbf81('0x4a')]=qs['filters'](_[_0xbf81('0x4b')](_0x5d888a[_0xbf81('0x40')],_0x101740[_0xbf81('0x42')]),_0x57cd41);if(_0x5d888a['query']['filter']){_0x18749[_0xbf81('0x4a')]=_['merge'](_0x18749[_0xbf81('0x4a')],{'$or':_[_0xbf81('0x3a')](_0x57cd41,function(_0x4eb9e8){if(_0x4eb9e8[_0xbf81('0x3d')]!==_0xbf81('0x4c')){var _0x1f6e6c={};_0x1f6e6c[_0x4eb9e8[_0xbf81('0x37')]]={'$like':'%'+_0x5d888a[_0xbf81('0x40')][_0xbf81('0x4d')]+'%'};return _0x1f6e6c;}})});}_0x18749=_[_0xbf81('0x4e')]({},_0x18749,_0x5d888a['options']);var _0xc36e07={'where':_0x18749[_0xbf81('0x4a')]};return db[_0xbf81('0x4f')][_0xbf81('0x2a')](_0xc36e07)[_0xbf81('0x31')](function(_0x39e458){_0x104f12['count']=_0x39e458;if(_0x5d888a['query']['includeAll']){_0x18749['include']=[{'all':!![]}];}return db[_0xbf81('0x4f')][_0xbf81('0x50')](_0x18749);})[_0xbf81('0x31')](function(_0x279c56){_0x104f12['rows']=_0x279c56;return _0x104f12;})[_0xbf81('0x31')](respondWithFilteredResult(_0x56ab5b,_0x18749))[_0xbf81('0x51')](handleError(_0x56ab5b,null));};exports[_0xbf81('0x52')]=function(_0xcfbab4,_0x10715f){var _0x5528e4={'raw':!![],'where':{'id':_0xcfbab4[_0xbf81('0x53')]['id']}},_0x3c6b7e={};_0x3c6b7e[_0xbf81('0x3f')]=_[_0xbf81('0x41')](db['MailQueue'][_0xbf81('0x3b')]);_0x3c6b7e[_0xbf81('0x40')]=_['keys'](_0xcfbab4[_0xbf81('0x40')]);_0x3c6b7e[_0xbf81('0x42')]=_[_0xbf81('0x43')](_0x3c6b7e[_0xbf81('0x3f')],_0x3c6b7e[_0xbf81('0x40')]);_0x5528e4[_0xbf81('0x44')]=_[_0xbf81('0x43')](_0x3c6b7e[_0xbf81('0x3f')],qs['fields'](_0xcfbab4[_0xbf81('0x40')][_0xbf81('0x45')]));_0x5528e4[_0xbf81('0x44')]=_0x5528e4[_0xbf81('0x44')]['length']?_0x5528e4[_0xbf81('0x44')]:_0x3c6b7e[_0xbf81('0x3f')];if(_0xcfbab4['query'][_0xbf81('0x54')]){_0x5528e4[_0xbf81('0x55')]=[{'all':!![]}];}_0x5528e4=_[_0xbf81('0x4e')]({},_0x5528e4,_0xcfbab4[_0xbf81('0x56')]);return db['MailQueue'][_0xbf81('0x57')](_0x5528e4)[_0xbf81('0x31')](handleEntityNotFound(_0x10715f,null))['then'](respondWithResult(_0x10715f,null))[_0xbf81('0x51')](handleError(_0x10715f,null));};exports[_0xbf81('0x58')]=function(_0x5008c8,_0x2a65fa){return db[_0xbf81('0x4f')]['create'](_0x5008c8[_0xbf81('0x59')],{})['then'](function(_0x31ba09){var _0x202f50=_0x5008c8[_0xbf81('0x5a')]['get']({'plain':!![]});if(!_0x202f50)throw new Error(_0xbf81('0x5b'));if(_0x202f50[_0xbf81('0x5c')]===_0xbf81('0x5a')){var _0x2f97fb=_0x31ba09['get']({'plain':!![]});var _0x123c7a=_0xbf81('0x33');return db[_0xbf81('0x5d')][_0xbf81('0x57')]({'where':{'name':_0x123c7a,'userProfileId':_0x202f50['userProfileId']},'raw':!![]})[_0xbf81('0x31')](function(_0x2d415b){if(_0x2d415b&&_0x2d415b[_0xbf81('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2f97fb[_0xbf81('0x37')],'resourceId':_0x2f97fb['id'],'type':_0x2d415b['name'],'sectionId':_0x2d415b['id']},{})[_0xbf81('0x31')](function(){return _0x31ba09;});}else{return _0x31ba09;}})['catch'](function(_0x4232ba){logger['error'](_0xbf81('0x5f'),_0x4232ba);throw _0x4232ba;});}return _0x31ba09;})[_0xbf81('0x31')](respondWithResult(_0x2a65fa,0xc9))['catch'](handleError(_0x2a65fa,null));};exports[_0xbf81('0x60')]=function(_0x3ce410,_0x19c9dd){if(_0x3ce410[_0xbf81('0x59')]['id']){delete _0x3ce410['body']['id'];}return db['MailQueue'][_0xbf81('0x57')]({'where':{'id':_0x3ce410[_0xbf81('0x53')]['id']}})[_0xbf81('0x31')](handleEntityNotFound(_0x19c9dd,null))[_0xbf81('0x31')](saveUpdates(_0x3ce410['body'],null))[_0xbf81('0x31')](respondWithResult(_0x19c9dd,null))[_0xbf81('0x51')](handleError(_0x19c9dd,null));};exports['destroy']=function(_0x129481,_0x1f6576){return db[_0xbf81('0x4f')][_0xbf81('0x57')]({'where':{'id':_0x129481['params']['id']}})[_0xbf81('0x31')](handleEntityNotFound(_0x1f6576,null))[_0xbf81('0x31')](removeEntity(_0x1f6576,null))['catch'](handleError(_0x1f6576,null));};exports[_0xbf81('0x61')]=function(_0x583d9c,_0x29c2cc){return db[_0xbf81('0x4f')][_0xbf81('0x61')]()['then'](respondWithResult(_0x29c2cc,null))[_0xbf81('0x51')](handleError(_0x29c2cc,null));};exports[_0xbf81('0x62')]=function(_0x315372,_0x2f810b,_0x585c7b){var _0x217e63={'raw':!![],'where':{}},_0x44a3e1={},_0x4220e8;return db[_0xbf81('0x4f')]['findOne']({'where':{'id':_0x315372[_0xbf81('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f810b,null))[_0xbf81('0x31')](function(_0x4c2ad4){if(_0x4c2ad4){_0x4220e8=_0x4c2ad4[_0xbf81('0x32')]({'plain':!![]});_0x44a3e1[_0xbf81('0x3f')]=_[_0xbf81('0x41')](db[_0xbf81('0x63')][_0xbf81('0x3b')]);_0x44a3e1[_0xbf81('0x40')]=_['keys'](_0x315372[_0xbf81('0x40')]);_0x44a3e1[_0xbf81('0x42')]=_[_0xbf81('0x43')](_0x44a3e1[_0xbf81('0x3f')],_0x44a3e1['query']);_0x217e63['attributes']=_['intersection'](_0x44a3e1[_0xbf81('0x3f')],qs[_0xbf81('0x45')](_0x315372[_0xbf81('0x40')]['fields']));_0x217e63[_0xbf81('0x44')]=_0x217e63[_0xbf81('0x44')][_0xbf81('0x46')]?_0x217e63[_0xbf81('0x44')]:_0x44a3e1[_0xbf81('0x3f')];if(!_0x315372[_0xbf81('0x40')]['hasOwnProperty'](_0xbf81('0x48'))){_0x217e63[_0xbf81('0x28')]=qs[_0xbf81('0x28')](_0x315372['query'][_0xbf81('0x28')]);_0x217e63[_0xbf81('0x27')]=qs[_0xbf81('0x27')](_0x315372[_0xbf81('0x40')][_0xbf81('0x27')]);}_0x217e63[_0xbf81('0x49')]=qs[_0xbf81('0x64')](_0x315372[_0xbf81('0x40')]['sort']);_0x217e63[_0xbf81('0x4a')]=qs[_0xbf81('0x42')](_[_0xbf81('0x4b')](_0x315372[_0xbf81('0x40')],_0x44a3e1['filters']));_0x217e63[_0xbf81('0x4a')][_0xbf81('0x65')]=_0x4c2ad4['id'];if(_0x315372[_0xbf81('0x40')][_0xbf81('0x4d')]){_0x217e63[_0xbf81('0x4a')]=_['merge'](_0x217e63[_0xbf81('0x4a')],{'$or':_[_0xbf81('0x3a')](_0x217e63['attributes'],function(_0x2940b7){var _0x5a694a={};_0x5a694a[_0x2940b7]={'$like':'%'+_0x315372[_0xbf81('0x40')][_0xbf81('0x4d')]+'%'};return _0x5a694a;})});}_0x217e63=_[_0xbf81('0x4e')]({},_0x217e63,_0x315372[_0xbf81('0x56')]);return db[_0xbf81('0x63')]['findAll'](_0x217e63);}})[_0xbf81('0x31')](function(_0x38bbca){if(_0x38bbca){return db[_0xbf81('0x66')][_0xbf81('0x67')]({'where':{'id':_[_0xbf81('0x3a')](_0x38bbca,'UserId'),'role':'agent'},'attributes':['id',_0xbf81('0x37'),'mailPause',_0xbf81('0x68'),_0xbf81('0x69')]});}})[_0xbf81('0x31')](function(_0x531b3f){if(_0x531b3f){return{'count':_0x531b3f[_0xbf81('0x2a')],'rows':_[_0xbf81('0x3a')](_0x531b3f[_0xbf81('0x6a')],function(_0x242a5c){return{'membername':_0x242a5c[_0xbf81('0x37')],'UserId':_0x242a5c['id'],'queue_name':_0x4220e8[_0xbf81('0x37')],'MailQueueId':_0x4220e8['id'],'interface':util[_0xbf81('0x6b')](_0xbf81('0x6c'),_0xbf81('0x6d'),_0x242a5c[_0xbf81('0x37')]),'penalty':0x0,'paused':_0x242a5c[_0xbf81('0x6e')],'createdAt':_0x242a5c[_0xbf81('0x69')],'updatedAt':_0x242a5c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf81('0x31')](respondWithFilteredResult(_0x2f810b,_0x217e63))[_0xbf81('0x51')](handleError(_0x2f810b,null));};exports[_0xbf81('0x6f')]=function(_0xf8b46e,_0x1fa79e,_0xa48cd2){var _0x5e1d0e={};var _0x8271cb={};var _0x1e26c4;var _0x54bc5b;return db[_0xbf81('0x4f')]['findOne']({'where':{'id':_0xf8b46e[_0xbf81('0x53')]['id']}})[_0xbf81('0x31')](handleEntityNotFound(_0x1fa79e,null))[_0xbf81('0x31')](function(_0x4e200c){if(_0x4e200c){_0x1e26c4=_0x4e200c;_0x8271cb[_0xbf81('0x3f')]=_[_0xbf81('0x41')](db['Team'][_0xbf81('0x3b')]);_0x8271cb[_0xbf81('0x40')]=_[_0xbf81('0x41')](_0xf8b46e[_0xbf81('0x40')]);_0x8271cb['filters']=_[_0xbf81('0x43')](_0x8271cb[_0xbf81('0x3f')],_0x8271cb[_0xbf81('0x40')]);_0x5e1d0e[_0xbf81('0x44')]=_['intersection'](_0x8271cb[_0xbf81('0x3f')],qs[_0xbf81('0x45')](_0xf8b46e[_0xbf81('0x40')]['fields']));_0x5e1d0e[_0xbf81('0x44')]=_0x5e1d0e[_0xbf81('0x44')][_0xbf81('0x46')]?_0x5e1d0e[_0xbf81('0x44')]:_0x8271cb[_0xbf81('0x3f')];_0x5e1d0e['order']=qs[_0xbf81('0x64')](_0xf8b46e[_0xbf81('0x40')]['sort']);_0x5e1d0e[_0xbf81('0x4a')]=qs[_0xbf81('0x42')](_[_0xbf81('0x4b')](_0xf8b46e[_0xbf81('0x40')],_0x8271cb[_0xbf81('0x42')]));if(_0xf8b46e[_0xbf81('0x40')][_0xbf81('0x4d')]){_0x5e1d0e[_0xbf81('0x4a')]=_['merge'](_0x5e1d0e[_0xbf81('0x4a')],{'$or':_[_0xbf81('0x3a')](_0x5e1d0e[_0xbf81('0x44')],function(_0xbbc1f2){var _0x4df8f0={};_0x4df8f0[_0xbbc1f2]={'$like':'%'+_0xf8b46e[_0xbf81('0x40')][_0xbf81('0x4d')]+'%'};return _0x4df8f0;})});}_0x5e1d0e=_['merge']({},_0x5e1d0e,_0xf8b46e['options']);return _0x1e26c4[_0xbf81('0x6f')](_0x5e1d0e);}})['then'](function(_0x201a36){if(_0x201a36){_0x54bc5b=_0x201a36[_0xbf81('0x46')];if(!_0xf8b46e[_0xbf81('0x40')][_0xbf81('0x47')]('nolimit')){_0x5e1d0e[_0xbf81('0x28')]=qs[_0xbf81('0x28')](_0xf8b46e[_0xbf81('0x40')][_0xbf81('0x28')]);_0x5e1d0e[_0xbf81('0x27')]=qs[_0xbf81('0x27')](_0xf8b46e[_0xbf81('0x40')][_0xbf81('0x27')]);}return _0x1e26c4[_0xbf81('0x6f')](_0x5e1d0e);}})['then'](function(_0x532943){if(_0x532943){return _0x532943?{'count':_0x54bc5b,'rows':_0x532943}:null;}})[_0xbf81('0x31')](respondWithResult(_0x1fa79e,null))['catch'](handleError(_0x1fa79e,null));};exports[_0xbf81('0x70')]=function(_0x3614d7,_0x107002,_0x500473){var _0x369a6c=_0x3614d7[_0xbf81('0x59')][_0xbf81('0x71')];return db[_0xbf81('0x72')][_0xbf81('0x50')]({'where':{'id':_0x369a6c},'attributes':['id'],'include':[{'model':db[_0xbf81('0x66')],'as':_0xbf81('0x73'),'attributes':['id',_0xbf81('0x37'),'online',_0xbf81('0x74'),'interface'],'raw':!![]}]})[_0xbf81('0x31')](function(_0x18b00a){if(_0x18b00a){var _0x3761aa=_['flatMap'](_0x18b00a,function(_0x2010a9){var _0x17d909=_0x2010a9[_0xbf81('0x32')]({'plain':!![]});return _0x17d909[_0xbf81('0x73')];});return db['MailQueue'][_0xbf81('0x57')]({'where':{'id':_0x3614d7[_0xbf81('0x53')]['id']}})['then'](function(_0x24c06a){return db[_0xbf81('0x75')][_0xbf81('0x76')](function(_0x1bba16){return _0x24c06a[_0xbf81('0x70')](_0x369a6c,{'transaction':_0x1bba16})['then'](function(){return BPromise[_0xbf81('0x77')](_0x3761aa,function(_0x23f024){return db['UserMailQueue'][_0xbf81('0x78')]({'where':{'UserId':_0x23f024['id'],'MailQueueId':_0x3614d7[_0xbf81('0x53')]['id']},'transaction':_0x1bba16});});})[_0xbf81('0x31')](function(){_0x3761aa[_0xbf81('0x79')](function(_0x2975e1){socket[_0xbf81('0x7a')](_0xbf81('0x7b'),{'UserId':_0x2975e1['id'],'MailQueueId':_0x24c06a['id']});});});});});}})[_0xbf81('0x31')](respondWithStatusCode(_0x107002,null))[_0xbf81('0x51')](handleError(_0x107002,null));};exports[_0xbf81('0x7c')]=function(_0x727a88,_0x56f131,_0x4c7287){return db[_0xbf81('0x72')]['findAll']({'where':{'id':_0x727a88[_0xbf81('0x40')][_0xbf81('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x56f131,null))[_0xbf81('0x31')](function(_0x547ed4){var _0x302f4f=_[_0xbf81('0x3a')](_0x547ed4,'id');var _0x5e8723=[];var _0x187f93=[];var _0x2e2e51=squel[_0xbf81('0x7d')]();_0x2e2e51['field'](_0xbf81('0x7e'))[_0xbf81('0x7f')]('team_has_mail_queues','tq')[_0xbf81('0x80')](_0xbf81('0x81'),'ut',_0xbf81('0x82'))[_0xbf81('0x4a')](_0xbf81('0x83'),_0x727a88[_0xbf81('0x53')]['id']);for(var _0x3dc5dc=0x0;_0x3dc5dc<_0x547ed4['length'];_0x3dc5dc+=0x1){let _0x3cfffa=_0x547ed4[_0x3dc5dc];for(var _0x5ab4e4=0x0;_0x5ab4e4<_0x3cfffa['Agents']['length'];_0x5ab4e4+=0x1){let _0x3b43be=_0x3cfffa[_0xbf81('0x73')][_0x5ab4e4];var _0x55f73f=_0x2e2e51[_0xbf81('0x84')]();_0x55f73f['where'](_0xbf81('0x85'),_0x3b43be['id']);_0x187f93['push'](db[_0xbf81('0x75')][_0xbf81('0x40')](_0x55f73f[_0xbf81('0x86')](),{'type':db[_0xbf81('0x75')]['QueryTypes'][_0xbf81('0x87')]})[_0xbf81('0x31')](function(_0x12e06b){if(_0x12e06b[_0xbf81('0x46')]===0x1){return _0x3b43be['id'];}else{var _0x5e2a10=_['every'](_['map'](_0x12e06b,_0xbf81('0x88')),function(_0x1f93b8){return _[_0xbf81('0x89')](_0x302f4f,_0x1f93b8);});if(_0x5e2a10){return _0x3b43be['id'];}}}));}}return BPromise[_0xbf81('0x8a')](_0x187f93)[_0xbf81('0x31')](function(_0x517308){_0x5e8723=_(_0x5e8723)[_0xbf81('0x8b')](_0x517308)[_0xbf81('0x8c')]()[_0xbf81('0x8d')]();return db[_0xbf81('0x4f')][_0xbf81('0x57')]({'where':{'id':_0x727a88[_0xbf81('0x53')]['id']}})[_0xbf81('0x31')](function(_0x2820e0){return db[_0xbf81('0x75')][_0xbf81('0x76')](function(_0x2c48fb){return _0x2820e0['removeTeams'](_0x727a88[_0xbf81('0x40')][_0xbf81('0x71')],{'transaction':_0x2c48fb})['then'](function(){if(!_[_0xbf81('0x8e')](_0x5e8723)){return _0x2820e0[_0xbf81('0x8f')](_0x5e8723,{'transaction':_0x2c48fb});}})[_0xbf81('0x31')](function(){_0x5e8723[_0xbf81('0x79')](function(_0x1c43eb){socket[_0xbf81('0x7a')](_0xbf81('0x90'),{'UserId':_0x1c43eb,'MailQueueId':_0x2820e0['id']});});});});});});})[_0xbf81('0x31')](respondWithStatusCode(_0x56f131,null))[_0xbf81('0x51')](handleError(_0x56f131,null));};exports[_0xbf81('0x91')]=function(_0x234824,_0x101840,_0x2fbe0a){return db[_0xbf81('0x4f')][_0xbf81('0x57')]({'where':{'id':_0x234824[_0xbf81('0x53')]['id']}})[_0xbf81('0x31')](handleEntityNotFound(_0x101840,null))[_0xbf81('0x31')](function(_0x3ca946){if(_0x3ca946){return _0x3ca946[_0xbf81('0x91')](_0x234824[_0xbf81('0x59')]['ids'],_[_0xbf81('0x92')](_0x234824[_0xbf81('0x59')],[_0xbf81('0x71'),'id'])||{})[_0xbf81('0x93')](function(_0x307c37){for(var _0x4b7aab=0x0;_0x4b7aab<_0x234824[_0xbf81('0x59')][_0xbf81('0x71')]['length'];_0x4b7aab+=0x1){socket[_0xbf81('0x7a')](_0xbf81('0x7b'),{'UserId':Number(_0x234824[_0xbf81('0x59')][_0xbf81('0x71')][_0x4b7aab]),'MailQueueId':Number(_0x234824['params']['id'])});}return _0x307c37;});}})['then'](respondWithResult(_0x101840,null))[_0xbf81('0x51')](handleError(_0x101840,null));};exports['removeAgents']=function(_0x3b5524,_0x202cd1,_0x579c53){return db[_0xbf81('0x4f')][_0xbf81('0x57')]({'where':{'id':_0x3b5524[_0xbf81('0x53')]['id']}})[_0xbf81('0x31')](handleEntityNotFound(_0x202cd1,null))[_0xbf81('0x31')](function(_0xb3b3c3){if(_0xb3b3c3){return _0xb3b3c3['removeAgents'](_0x3b5524[_0xbf81('0x40')][_0xbf81('0x71')])['then'](function(){if(_['isArray'](_0x3b5524['query']['ids'])){for(var _0x45a52f=0x0;_0x45a52f<_0x3b5524['query']['ids'][_0xbf81('0x46')];_0x45a52f+=0x1){socket[_0xbf81('0x7a')](_0xbf81('0x90'),{'UserId':Number(_0x3b5524[_0xbf81('0x40')]['ids'][_0x45a52f]),'MailQueueId':Number(_0x3b5524[_0xbf81('0x53')]['id'])});}}else{socket['emit'](_0xbf81('0x90'),{'UserId':Number(_0x3b5524[_0xbf81('0x40')][_0xbf81('0x71')]),'MailQueueId':Number(_0x3b5524[_0xbf81('0x53')]['id'])});}});}})[_0xbf81('0x31')](respondWithStatusCode(_0x202cd1,null))['catch'](handleError(_0x202cd1,null));};exports['getAgents']=function(_0xf4424,_0x1e89ca,_0xd045ab){var _0x3935cf={};var _0x550531={};var _0x2e7260;var _0x353b37;return db['MailQueue'][_0xbf81('0x94')]({'where':{'id':_0xf4424['params']['id']}})['then'](handleEntityNotFound(_0x1e89ca,null))[_0xbf81('0x31')](function(_0x89c623){if(_0x89c623){_0x2e7260=_0x89c623;_0x550531[_0xbf81('0x3f')]=_['keys'](db[_0xbf81('0x66')][_0xbf81('0x3b')]);_0x550531[_0xbf81('0x40')]=_['keys'](_0xf4424['query']);_0x550531[_0xbf81('0x42')]=_['intersection'](_0x550531[_0xbf81('0x3f')],_0x550531['query']);_0x3935cf['attributes']=_[_0xbf81('0x43')](_0x550531[_0xbf81('0x3f')],qs[_0xbf81('0x45')](_0xf4424[_0xbf81('0x40')][_0xbf81('0x45')]));_0x3935cf[_0xbf81('0x44')]=_0x3935cf[_0xbf81('0x44')][_0xbf81('0x46')]?_0x3935cf[_0xbf81('0x44')]:_0x550531[_0xbf81('0x3f')];_0x3935cf[_0xbf81('0x49')]=qs[_0xbf81('0x64')](_0xf4424['query'][_0xbf81('0x64')]);_0x3935cf['where']=qs[_0xbf81('0x42')](_[_0xbf81('0x4b')](_0xf4424[_0xbf81('0x40')],_0x550531[_0xbf81('0x42')]));if(_0xf4424[_0xbf81('0x40')][_0xbf81('0x4d')]){_0x3935cf['where']=_[_0xbf81('0x4e')](_0x3935cf[_0xbf81('0x4a')],{'$or':_['map'](_0x3935cf[_0xbf81('0x44')],function(_0x4bcd58){var _0x4fcb2a={};_0x4fcb2a[_0x4bcd58]={'$like':'%'+_0xf4424[_0xbf81('0x40')][_0xbf81('0x4d')]+'%'};return _0x4fcb2a;})});}_0x3935cf=_['merge']({},_0x3935cf,_0xf4424['options']);return _0x2e7260[_0xbf81('0x95')](_0x3935cf);}})[_0xbf81('0x31')](function(_0x59c772){if(_0x59c772){_0x353b37=_0x59c772['length'];if(!_0xf4424[_0xbf81('0x40')][_0xbf81('0x47')](_0xbf81('0x48'))){_0x3935cf[_0xbf81('0x28')]=qs[_0xbf81('0x28')](_0xf4424[_0xbf81('0x40')][_0xbf81('0x28')]);_0x3935cf[_0xbf81('0x27')]=qs[_0xbf81('0x27')](_0xf4424[_0xbf81('0x40')][_0xbf81('0x27')]);}return _0x2e7260['getAgents'](_0x3935cf);}})[_0xbf81('0x31')](function(_0x443fbb){if(_0x443fbb){return _0x443fbb?{'count':_0x353b37,'rows':_0x443fbb}:null;}})[_0xbf81('0x31')](respondWithResult(_0x1e89ca,null))[_0xbf81('0x51')](handleError(_0x1e89ca,null));};
\ No newline at end of file
index 13fbaf7..a815819 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878c=['emit','exports','events','../../mysqldb','update','remove'];(function(_0x4a2378,_0x14106e){var _0x1ce2e0=function(_0x1d6b89){while(--_0x1d6b89){_0x4a2378['push'](_0x4a2378['shift']());}};_0x1ce2e0(++_0x14106e);}(_0x878c,0xf2));var _0xc878=function(_0x25dca6,_0x3fe0c8){_0x25dca6=_0x25dca6-0x0;var _0x174424=_0x878c[_0x25dca6];return _0x174424;};'use strict';var EventEmitter=require(_0xc878('0x0'));var MailQueue=require(_0xc878('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc878('0x2'),'afterDestroy':_0xc878('0x3')};function emitEvent(_0x5137de){return function(_0x5ad110,_0xb80623,_0x4c3557){MailQueueEvents[_0xc878('0x4')](_0x5137de+':'+_0x5ad110['id'],_0x5ad110);MailQueueEvents[_0xc878('0x4')](_0x5137de,_0x5ad110);_0x4c3557(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xc878('0x5')]=MailQueueEvents;
\ No newline at end of file
+var _0xbf3a=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue'];(function(_0x4112cc,_0x18b043){var _0x49b3c4=function(_0x25ada2){while(--_0x25ada2){_0x4112cc['push'](_0x4112cc['shift']());}};_0x49b3c4(++_0x18b043);}(_0xbf3a,0xf5));var _0xabf3=function(_0x506002,_0x17ad62){_0x506002=_0x506002-0x0;var _0x5a020c=_0xbf3a[_0x506002];return _0x5a020c;};'use strict';var EventEmitter=require(_0xabf3('0x0'));var MailQueue=require(_0xabf3('0x1'))['db'][_0xabf3('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabf3('0x3'),'afterUpdate':_0xabf3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x340d8f){return function(_0x44c59b,_0x37612e,_0x5b51c4){MailQueueEvents['emit'](_0x340d8f+':'+_0x44c59b['id'],_0x44c59b);MailQueueEvents[_0xabf3('0x5')](_0x340d8f,_0x44c59b);_0x5b51c4(null);};}for(var e in events){if(events[_0xabf3('0x6')](e)){var event=events[e];MailQueue[_0xabf3('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index 3986891..d29ad4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x009e=['path','rimraf','./mailQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xb87118,_0x3a8da3){var _0x46b353=function(_0xbf20d5){while(--_0xbf20d5){_0xb87118['push'](_0xb87118['shift']());}};_0x46b353(++_0x3a8da3);}(_0x009e,0x94));var _0xe009=function(_0x14ddff,_0x515a39){_0x14ddff=_0x14ddff-0x0;var _0x5d5534=_0x009e[_0x14ddff];return _0x5d5534;};'use strict';var _=require(_0xe009('0x0'));var util=require(_0xe009('0x1'));var logger=require(_0xe009('0x2'))(_0xe009('0x3'));var moment=require(_0xe009('0x4'));var BPromise=require('bluebird');var rp=require(_0xe009('0x5'));var fs=require('fs');var path=require(_0xe009('0x6'));var rimraf=require(_0xe009('0x7'));var config=require('../../config/environment');var attributes=require(_0xe009('0x8'));module[_0xe009('0x9')]=function(_0x2c05aa,_0x47bac3){return _0x2c05aa[_0xe009('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3d6=['request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash','util','api','moment','bluebird'];(function(_0x177440,_0x27e65d){var _0x2766bd=function(_0x5e1dfd){while(--_0x5e1dfd){_0x177440['push'](_0x177440['shift']());}};_0x2766bd(++_0x27e65d);}(_0xa3d6,0x1cf));var _0x6a3d=function(_0x3561b2,_0x1e7444){_0x3561b2=_0x3561b2-0x0;var _0x40e7ef=_0xa3d6[_0x3561b2];return _0x40e7ef;};'use strict';var _=require(_0x6a3d('0x0'));var util=require(_0x6a3d('0x1'));var logger=require('../../config/logger')(_0x6a3d('0x2'));var moment=require(_0x6a3d('0x3'));var BPromise=require(_0x6a3d('0x4'));var rp=require(_0x6a3d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a3d('0x6'));var config=require(_0x6a3d('0x7'));var attributes=require(_0x6a3d('0x8'));module[_0x6a3d('0x9')]=function(_0x45405f,_0x5a3e93){return _0x45405f[_0x6a3d('0xa')]('MailQueue',attributes,{'tableName':_0x6a3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b0777d8..3c57585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63bf=['raw','where','attributes','include','map','model','GetMailQueue','ShowMailQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options'];(function(_0x670d29,_0x405e64){var _0x348982=function(_0x121413){while(--_0x121413){_0x670d29['push'](_0x670d29['shift']());}};_0x348982(++_0x405e64);}(_0x63bf,0x199));var _0xf63b=function(_0x348af0,_0x308e41){_0x348af0=_0x348af0-0x0;var _0x3a40a2=_0x63bf[_0x348af0];return _0x3a40a2;};'use strict';var _=require(_0xf63b('0x0'));var util=require('util');var moment=require(_0xf63b('0x1'));var BPromise=require(_0xf63b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf63b('0x3'));var db=require(_0xf63b('0x4'))['db'];var utils=require(_0xf63b('0x5'));var logger=require(_0xf63b('0x6'))(_0xf63b('0x7'));var config=require(_0xf63b('0x8'));var jayson=require(_0xf63b('0x9'));var client=jayson[_0xf63b('0xa')][_0xf63b('0xb')]({'port':0x232a});config['redis']=_[_0xf63b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf63b('0xd'))(new Redis(config[_0xf63b('0xe')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x16968a,_0x8a45d1,_0x729ee){return new BPromise(function(_0x8659ff,_0x24d1aa){return client[_0xf63b('0xf')](_0x16968a,_0x729ee)[_0xf63b('0x10')](function(_0x51a68d){logger[_0xf63b('0x11')](_0xf63b('0x12'),_0x8a45d1,_0xf63b('0x13'));logger[_0xf63b('0x14')](_0xf63b('0x15'),_0x8a45d1,_0xf63b('0x13'),JSON[_0xf63b('0x16')](_0x51a68d));if(_0x51a68d[_0xf63b('0x17')]){if(_0x51a68d[_0xf63b('0x17')][_0xf63b('0x18')]===0x1f4){logger[_0xf63b('0x17')]('MailQueue,\x20%s,\x20%s',_0x8a45d1,_0x51a68d[_0xf63b('0x17')][_0xf63b('0x19')]);return _0x24d1aa(_0x51a68d['error'][_0xf63b('0x19')]);}logger['error'](_0xf63b('0x12'),_0x8a45d1,_0x51a68d['error'][_0xf63b('0x19')]);return _0x8659ff(_0x51a68d[_0xf63b('0x17')]['message']);}else{logger['info'](_0xf63b('0x12'),_0x8a45d1,_0xf63b('0x13'));_0x8659ff(_0x51a68d[_0xf63b('0x1a')]['message']);}})[_0xf63b('0x1b')](function(_0x1377c9){logger['error'](_0xf63b('0x12'),_0x8a45d1,_0x1377c9);_0x24d1aa(_0x1377c9);});});}exports['GetMailQueue']=function(_0x321829){var _0x5eac9b=this;return new Promise(function(_0x1716d5,_0x975078){return db[_0xf63b('0x1c')][_0xf63b('0x1d')]({'raw':_0x321829[_0xf63b('0x1e')]?_0x321829['options'][_0xf63b('0x1f')]===undefined?!![]:![]:!![],'where':_0x321829[_0xf63b('0x1e')]?_0x321829[_0xf63b('0x1e')][_0xf63b('0x20')]||null:null,'attributes':_0x321829[_0xf63b('0x1e')]?_0x321829[_0xf63b('0x1e')][_0xf63b('0x21')]||null:null,'limit':_0x321829['options']?_0x321829[_0xf63b('0x1e')]['limit']||null:null,'include':_0x321829['options']?_0x321829['options'][_0xf63b('0x22')]?_[_0xf63b('0x23')](_0x321829[_0xf63b('0x1e')]['include'],function(_0x2dc3cc){return{'model':db[_0x2dc3cc['model']],'as':_0x2dc3cc['as'],'attributes':_0x2dc3cc[_0xf63b('0x21')],'include':_0x2dc3cc[_0xf63b('0x22')]?_[_0xf63b('0x23')](_0x2dc3cc[_0xf63b('0x22')],function(_0xfe867b){return{'model':db[_0xfe867b[_0xf63b('0x24')]],'as':_0xfe867b['as'],'attributes':_0xfe867b[_0xf63b('0x21')],'include':_0xfe867b[_0xf63b('0x22')]?_[_0xf63b('0x23')](_0xfe867b[_0xf63b('0x22')],function(_0x317d45){return{'model':db[_0x317d45['model']],'as':_0x317d45['as'],'attributes':_0x317d45[_0xf63b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf63b('0x10')](function(_0x3aee2b){logger['info'](_0xf63b('0x25'),_0x321829);logger[_0xf63b('0x14')](_0xf63b('0x25'),_0x321829,JSON[_0xf63b('0x16')](_0x3aee2b));_0x1716d5(_0x3aee2b);})[_0xf63b('0x1b')](function(_0x575851){logger['error'](_0xf63b('0x25'),_0x575851[_0xf63b('0x19')],_0x321829);_0x975078(_0x5eac9b[_0xf63b('0x17')](0x1f4,_0x575851[_0xf63b('0x19')]));});});};exports[_0xf63b('0x26')]=function(_0x798e70){var _0x424d2d=this;return new Promise(function(_0x400c15,_0x2ba91a){return db['MailQueue'][_0xf63b('0x27')]({'raw':_0x798e70['options']?_0x798e70[_0xf63b('0x1e')][_0xf63b('0x1f')]===undefined?!![]:![]:!![],'where':_0x798e70[_0xf63b('0x1e')]?_0x798e70[_0xf63b('0x1e')][_0xf63b('0x20')]||null:null,'attributes':_0x798e70[_0xf63b('0x1e')]?_0x798e70['options'][_0xf63b('0x21')]||null:null,'include':_0x798e70[_0xf63b('0x1e')]?_0x798e70[_0xf63b('0x1e')][_0xf63b('0x22')]?_['map'](_0x798e70[_0xf63b('0x1e')][_0xf63b('0x22')],function(_0x3c8ef5){return{'model':db[_0x3c8ef5[_0xf63b('0x24')]],'as':_0x3c8ef5['as'],'attributes':_0x3c8ef5[_0xf63b('0x21')],'include':_0x3c8ef5[_0xf63b('0x22')]?_[_0xf63b('0x23')](_0x3c8ef5[_0xf63b('0x22')],function(_0x44c582){return{'model':db[_0x44c582['model']],'as':_0x44c582['as'],'attributes':_0x44c582[_0xf63b('0x21')],'include':_0x44c582[_0xf63b('0x22')]?_['map'](_0x44c582[_0xf63b('0x22')],function(_0x380092){return{'model':db[_0x380092['model']],'as':_0x380092['as'],'attributes':_0x380092[_0xf63b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf63b('0x10')](function(_0x22ca4a){logger['info']('ShowMailQueue',_0x798e70);logger['debug'](_0xf63b('0x26'),_0x798e70,JSON[_0xf63b('0x16')](_0x22ca4a));_0x400c15(_0x22ca4a);})[_0xf63b('0x1b')](function(_0x578cc0){logger['error']('ShowMailQueue',_0x578cc0[_0xf63b('0x19')],_0x798e70);_0x2ba91a(_0x424d2d[_0xf63b('0x17')](0x1f4,_0x578cc0[_0xf63b('0x19')]));});});};
\ No newline at end of file
+var _0x5bb1=['http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','info','stringify','error','MailQueue,\x20%s,\x20%s','message','request\x20sent','result','MailQueue','findAll','options','raw','where','limit','include','model','attributes','map','then','debug','GetMailQueue','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0x5bb1,0x1cc));var _0x15bb=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5bb1[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x15bb('0x0'));var util=require(_0x15bb('0x1'));var moment=require(_0x15bb('0x2'));var BPromise=require(_0x15bb('0x3'));var rs=require(_0x15bb('0x4'));var fs=require('fs');var Redis=require(_0x15bb('0x5'));var db=require(_0x15bb('0x6'))['db'];var utils=require(_0x15bb('0x7'));var logger=require(_0x15bb('0x8'))(_0x15bb('0x9'));var config=require(_0x15bb('0xa'));var jayson=require(_0x15bb('0xb'));var client=jayson[_0x15bb('0xc')][_0x15bb('0xd')]({'port':0x232a});config[_0x15bb('0xe')]=_[_0x15bb('0xf')](config[_0x15bb('0xe')],{'host':_0x15bb('0x10'),'port':0x18eb});var socket=require(_0x15bb('0x11'))(new Redis(config[_0x15bb('0xe')]));require(_0x15bb('0x12'))['register'](socket);function respondWithRpcPromise(_0x1b0270,_0x212045,_0x4b6692){return new BPromise(function(_0x2c6898,_0x1881db){return client[_0x15bb('0x13')](_0x1b0270,_0x4b6692)['then'](function(_0xaf4bb7){logger[_0x15bb('0x14')]('MailQueue,\x20%s,\x20%s',_0x212045,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x212045,'request\x20sent',JSON[_0x15bb('0x15')](_0xaf4bb7));if(_0xaf4bb7['error']){if(_0xaf4bb7[_0x15bb('0x16')]['code']===0x1f4){logger[_0x15bb('0x16')](_0x15bb('0x17'),_0x212045,_0xaf4bb7['error'][_0x15bb('0x18')]);return _0x1881db(_0xaf4bb7[_0x15bb('0x16')][_0x15bb('0x18')]);}logger[_0x15bb('0x16')]('MailQueue,\x20%s,\x20%s',_0x212045,_0xaf4bb7[_0x15bb('0x16')][_0x15bb('0x18')]);return _0x2c6898(_0xaf4bb7[_0x15bb('0x16')][_0x15bb('0x18')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x212045,_0x15bb('0x19'));_0x2c6898(_0xaf4bb7[_0x15bb('0x1a')][_0x15bb('0x18')]);}})['catch'](function(_0xeea055){logger[_0x15bb('0x16')](_0x15bb('0x17'),_0x212045,_0xeea055);_0x1881db(_0xeea055);});});}exports['GetMailQueue']=function(_0x52ef0f){var _0x64a4e6=this;return new Promise(function(_0x67e47,_0x3c7286){return db[_0x15bb('0x1b')][_0x15bb('0x1c')]({'raw':_0x52ef0f[_0x15bb('0x1d')]?_0x52ef0f[_0x15bb('0x1d')][_0x15bb('0x1e')]===undefined?!![]:![]:!![],'where':_0x52ef0f[_0x15bb('0x1d')]?_0x52ef0f[_0x15bb('0x1d')][_0x15bb('0x1f')]||null:null,'attributes':_0x52ef0f['options']?_0x52ef0f[_0x15bb('0x1d')]['attributes']||null:null,'limit':_0x52ef0f[_0x15bb('0x1d')]?_0x52ef0f['options'][_0x15bb('0x20')]||null:null,'include':_0x52ef0f[_0x15bb('0x1d')]?_0x52ef0f['options'][_0x15bb('0x21')]?_['map'](_0x52ef0f['options'][_0x15bb('0x21')],function(_0x144a74){return{'model':db[_0x144a74[_0x15bb('0x22')]],'as':_0x144a74['as'],'attributes':_0x144a74[_0x15bb('0x23')],'include':_0x144a74[_0x15bb('0x21')]?_[_0x15bb('0x24')](_0x144a74[_0x15bb('0x21')],function(_0x1fb2b9){return{'model':db[_0x1fb2b9[_0x15bb('0x22')]],'as':_0x1fb2b9['as'],'attributes':_0x1fb2b9['attributes'],'include':_0x1fb2b9[_0x15bb('0x21')]?_[_0x15bb('0x24')](_0x1fb2b9['include'],function(_0x16c401){return{'model':db[_0x16c401['model']],'as':_0x16c401['as'],'attributes':_0x16c401[_0x15bb('0x23')]};}):[]};}):[]};}):[]:[]})[_0x15bb('0x25')](function(_0x14df37){logger['info']('GetMailQueue',_0x52ef0f);logger[_0x15bb('0x26')](_0x15bb('0x27'),_0x52ef0f,JSON[_0x15bb('0x15')](_0x14df37));_0x67e47(_0x14df37);})[_0x15bb('0x28')](function(_0x59dd2b){logger[_0x15bb('0x16')](_0x15bb('0x27'),_0x59dd2b['message'],_0x52ef0f);_0x3c7286(_0x64a4e6[_0x15bb('0x16')](0x1f4,_0x59dd2b['message']));});});};exports[_0x15bb('0x29')]=function(_0x492f59){var _0x3bb1bd=this;return new Promise(function(_0x122eea,_0x23dc82){return db['MailQueue'][_0x15bb('0x2a')]({'raw':_0x492f59[_0x15bb('0x1d')]?_0x492f59[_0x15bb('0x1d')][_0x15bb('0x1e')]===undefined?!![]:![]:!![],'where':_0x492f59[_0x15bb('0x1d')]?_0x492f59['options'][_0x15bb('0x1f')]||null:null,'attributes':_0x492f59[_0x15bb('0x1d')]?_0x492f59[_0x15bb('0x1d')][_0x15bb('0x23')]||null:null,'include':_0x492f59['options']?_0x492f59[_0x15bb('0x1d')]['include']?_[_0x15bb('0x24')](_0x492f59[_0x15bb('0x1d')][_0x15bb('0x21')],function(_0x5f1bf2){return{'model':db[_0x5f1bf2['model']],'as':_0x5f1bf2['as'],'attributes':_0x5f1bf2[_0x15bb('0x23')],'include':_0x5f1bf2[_0x15bb('0x21')]?_[_0x15bb('0x24')](_0x5f1bf2['include'],function(_0x4f1257){return{'model':db[_0x4f1257[_0x15bb('0x22')]],'as':_0x4f1257['as'],'attributes':_0x4f1257[_0x15bb('0x23')],'include':_0x4f1257[_0x15bb('0x21')]?_[_0x15bb('0x24')](_0x4f1257[_0x15bb('0x21')],function(_0x36ddf8){return{'model':db[_0x36ddf8['model']],'as':_0x36ddf8['as'],'attributes':_0x36ddf8[_0x15bb('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af28f){logger[_0x15bb('0x14')](_0x15bb('0x29'),_0x492f59);logger[_0x15bb('0x26')](_0x15bb('0x29'),_0x492f59,JSON[_0x15bb('0x15')](_0x1af28f));_0x122eea(_0x1af28f);})['catch'](function(_0x4a181b){logger[_0x15bb('0x16')]('ShowMailQueue',_0x4a181b[_0x15bb('0x18')],_0x492f59);_0x23dc82(_0x3bb1bd[_0x15bb('0x16')](0x1f4,_0x4a181b[_0x15bb('0x18')]));});});};
\ No newline at end of file
index c68a957..db29715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecac=['mailQueue:','./mailQueue.events','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xecac,0x100));var _0xceca=function(_0x2984d8,_0x5e5cae){_0x2984d8=_0x2984d8-0x0;var _0x5224c9=_0xecac[_0x2984d8];return _0x5224c9;};'use strict';var MailQueueEvents=require(_0xceca('0x0'));var events=['save','remove','update'];function createListener(_0x3fffbc,_0x367973){return function(_0x54eae2){_0x367973[_0xceca('0x1')](_0x3fffbc,_0x54eae2);};}function removeListener(_0x2bd188,_0x46a607){return function(){MailQueueEvents['removeListener'](_0x2bd188,_0x46a607);};}exports['register']=function(_0x2de07e){for(var _0x1ff54f=0x0,_0x5e1f77=events['length'];_0x1ff54f<_0x5e1f77;_0x1ff54f++){var _0x3bace3=events[_0x1ff54f];var _0x2b7056=createListener(_0xceca('0x2')+_0x3bace3,_0x2de07e);MailQueueEvents['on'](_0x3bace3,_0x2b7056);}};
\ No newline at end of file
+var _0x77b7=['save','remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events'];(function(_0x27fe43,_0x4e834f){var _0x568dbf=function(_0x81844a){while(--_0x81844a){_0x27fe43['push'](_0x27fe43['shift']());}};_0x568dbf(++_0x4e834f);}(_0x77b7,0x19d));var _0x777b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x77b7[_0x432682];return _0x463d05;};'use strict';var MailQueueEvents=require(_0x777b('0x0'));var events=[_0x777b('0x1'),_0x777b('0x2'),_0x777b('0x3')];function createListener(_0x19f8e7,_0x5dac2c){return function(_0x3275ed){_0x5dac2c[_0x777b('0x4')](_0x19f8e7,_0x3275ed);};}function removeListener(_0x179014,_0x65e4c8){return function(){MailQueueEvents[_0x777b('0x5')](_0x179014,_0x65e4c8);};}exports[_0x777b('0x6')]=function(_0x3ce141){for(var _0x1613a9=0x0,_0x32daab=events[_0x777b('0x7')];_0x1613a9<_0x32daab;_0x1613a9++){var _0x28d7e4=events[_0x1613a9];var _0x4628ff=createListener(_0x777b('0x8')+_0x28d7e4,_0x3ce141);MailQueueEvents['on'](_0x28d7e4,_0x4628ff);}};
\ No newline at end of file
index 08bf920..2213790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc39e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer'];(function(_0xc3bdf3,_0x322cd3){var _0x486000=function(_0xc3f2d8){while(--_0xc3f2d8){_0xc3bdf3['push'](_0xc3bdf3['shift']());}};_0x486000(++_0x322cd3);}(_0xc39e,0x13f));var _0xec39=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xc39e[_0xa8883];return _0x479426;};'use strict';var multer=require(_0xec39('0x0'));var util=require(_0xec39('0x1'));var path=require(_0xec39('0x2'));var timeout=require(_0xec39('0x3'));var express=require(_0xec39('0x4'));var router=express[_0xec39('0x5')]();var fs_extra=require(_0xec39('0x6'));var auth=require(_0xec39('0x7'));var interaction=require(_0xec39('0x8'));var config=require('../../config/environment');var controller=require(_0xec39('0x9'));router[_0xec39('0xa')]('/',auth[_0xec39('0xb')](),controller[_0xec39('0xc')]);router['get']('/describe',auth[_0xec39('0xb')](),controller['describe']);router[_0xec39('0xa')]('/:id',auth[_0xec39('0xb')](),controller[_0xec39('0xd')]);router[_0xec39('0xe')]('/',auth[_0xec39('0xb')](),controller['create']);router[_0xec39('0xf')](_0xec39('0x10'),auth[_0xec39('0xb')](),controller[_0xec39('0x11')]);router['delete'](_0xec39('0x10'),auth[_0xec39('0xb')](),controller[_0xec39('0x12')]);module[_0xec39('0x13')]=router;
\ No newline at end of file
+var _0xd60b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','/describe','describe','/:id','create','put','update','delete','exports','path'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0xd60b,0xfb));var _0xbd60=function(_0x599e65,_0x1e6a98){_0x599e65=_0x599e65-0x0;var _0x432688=_0xd60b[_0x599e65];return _0x432688;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbd60('0x0'));var timeout=require(_0xbd60('0x1'));var express=require(_0xbd60('0x2'));var router=express[_0xbd60('0x3')]();var fs_extra=require(_0xbd60('0x4'));var auth=require(_0xbd60('0x5'));var interaction=require(_0xbd60('0x6'));var config=require(_0xbd60('0x7'));var controller=require(_0xbd60('0x8'));router['get']('/',auth[_0xbd60('0x9')](),controller['index']);router['get'](_0xbd60('0xa'),auth['isAuthenticated'](),controller[_0xbd60('0xb')]);router['get'](_0xbd60('0xc'),auth[_0xbd60('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbd60('0xd')]);router[_0xbd60('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xbd60('0xf')]);router[_0xbd60('0x10')](_0xbd60('0xc'),auth[_0xbd60('0x9')](),controller['destroy']);module[_0xbd60('0x11')]=router;
\ No newline at end of file
index d09b0b4..c827968 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff16=['sequelize','STRING','DATE','moment'];(function(_0x9fb061,_0x1584ea){var _0x387214=function(_0x697ffb){while(--_0x697ffb){_0x9fb061['push'](_0x9fb061['shift']());}};_0x387214(++_0x1584ea);}(_0xff16,0x7f));var _0x6ff1=function(_0x4d6714,_0x40b3d9){_0x4d6714=_0x4d6714-0x0;var _0x5b4c9e=_0xff16[_0x4d6714];return _0x5b4c9e;};'use strict';var moment=require(_0x6ff1('0x0'));var Sequelize=require(_0x6ff1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6ff1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6ff1('0x2')]},'joinAt':{'type':Sequelize[_0x6ff1('0x3')]},'leaveAt':{'type':Sequelize[_0x6ff1('0x3')]},'acceptAt':{'type':Sequelize[_0x6ff1('0x3')]},'exitAt':{'type':Sequelize[_0x6ff1('0x3')]},'reason':{'type':Sequelize[_0x6ff1('0x2')]}};
\ No newline at end of file
+var _0x09fa=['DATE','moment','sequelize','STRING'];(function(_0x2ea355,_0x120e27){var _0x2b4055=function(_0xe6ae1e){while(--_0xe6ae1e){_0x2ea355['push'](_0x2ea355['shift']());}};_0x2b4055(++_0x120e27);}(_0x09fa,0x14d));var _0xa09f=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x09fa[_0x45783c];return _0x1161da;};'use strict';var moment=require(_0xa09f('0x0'));var Sequelize=require(_0xa09f('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa09f('0x2')]},'joinAt':{'type':Sequelize[_0xa09f('0x3')]},'leaveAt':{'type':Sequelize[_0xa09f('0x3')]},'acceptAt':{'type':Sequelize[_0xa09f('0x3')]},'exitAt':{'type':Sequelize[_0xa09f('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5383f21..22418c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x378aca,_0x13e103){var _0x1b7b4b=function(_0xed42d6){while(--_0xed42d6){_0x378aca['push'](_0x378aca['shift']());}};_0x1b7b4b(++_0x13e103);}(_0x2542,0x169));var _0x2254=function(_0x48b91a,_0x55c771){_0x48b91a=_0x48b91a-0x0;var _0x296fdb=_0x2542[_0x48b91a];return _0x296fdb;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['MailQueueReport'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));};
\ No newline at end of file
+var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x5b012e,_0x5cb94c){var _0xd6daf0=function(_0x1e9d33){while(--_0x1e9d33){_0x5b012e['push'](_0x5b012e['shift']());}};_0xd6daf0(++_0x5cb94c);}(_0x0295,0x1f0));var _0x5029=function(_0x2e6c75,_0x1bdbb7){_0x2e6c75=_0x2e6c75-0x0;var _0x13a9ea=_0x0295[_0x2e6c75];return _0x13a9ea;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['MailQueueReport'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['MailQueueReport'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));};
\ No newline at end of file
index 22d15b5..68c4628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74c7=['bluebird','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','moment'];(function(_0x3c8d6c,_0x51ae3a){var _0x146521=function(_0x4cd1ed){while(--_0x4cd1ed){_0x3c8d6c['push'](_0x3c8d6c['shift']());}};_0x146521(++_0x51ae3a);}(_0x74c7,0x194));var _0x774c=function(_0x49f38a,_0x6cb25){_0x49f38a=_0x49f38a-0x0;var _0x21cc8c=_0x74c7[_0x49f38a];return _0x21cc8c;};'use strict';var _=require('lodash');var util=require(_0x774c('0x0'));var logger=require(_0x774c('0x1'))('api');var moment=require(_0x774c('0x2'));var BPromise=require(_0x774c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x774c('0x4'));var rimraf=require(_0x774c('0x5'));var config=require(_0x774c('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x774c('0x7')]=function(_0x324896,_0x23aa92){return _0x324896['define'](_0x774c('0x8'),attributes,{'tableName':_0x774c('0x9'),'paranoid':![],'indexes':[{'name':_0x774c('0xa'),'fields':[_0x774c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d1b=['define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0xb22ab4,_0x39fb1c){var _0x249294=function(_0x31d08c){while(--_0x31d08c){_0xb22ab4['push'](_0xb22ab4['shift']());}};_0x249294(++_0x39fb1c);}(_0x2d1b,0x1bf));var _0xb2d1=function(_0x56161d,_0x5dcdab){_0x56161d=_0x56161d-0x0;var _0x39cf7e=_0x2d1b[_0x56161d];return _0x39cf7e;};'use strict';var _=require(_0xb2d1('0x0'));var util=require(_0xb2d1('0x1'));var logger=require(_0xb2d1('0x2'))(_0xb2d1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2d1('0x4'));var fs=require('fs');var path=require(_0xb2d1('0x5'));var rimraf=require('rimraf');var config=require(_0xb2d1('0x6'));var attributes=require(_0xb2d1('0x7'));module[_0xb2d1('0x8')]=function(_0x53f6fb,_0x11179c){return _0x53f6fb[_0xb2d1('0x9')](_0xb2d1('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xb2d1('0xb'),'fields':[_0xb2d1('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 132ab73..2aa0e83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdb1d35,_0x2ed080){var _0x2c50c7=function(_0x47c136){while(--_0x47c136){_0xdb1d35['push'](_0xdb1d35['shift']());}};_0x2c50c7(++_0x2ed080);}(_0x326f,0xd1));var _0xf326=function(_0x48610f,_0x221424){_0x48610f=_0x48610f-0x0;var _0x30c898=_0x326f[_0x48610f];return _0x30c898;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
+var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x94dd49,_0x2661bc){var _0x44571f=function(_0x397528){while(--_0x397528){_0x94dd49['push'](_0x94dd49['shift']());}};_0x44571f(++_0x2661bc);}(_0x2ef3,0xba));var _0x32ef=function(_0x2898d4,_0x328db1){_0x2898d4=_0x2898d4-0x0;var _0x2d029a=_0x2ef3[_0x2898d4];return _0x2d029a;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});};
\ No newline at end of file
index 2ff1f9c..2f5800f 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(_0xe6029e,_0x58f6d6){var _0x272b71=function(_0x28a769){while(--_0x28a769){_0xe6029e['push'](_0xe6029e['shift']());}};_0x272b71(++_0x58f6d6);}(_0x70e0,0x17b));var _0x070e=function(_0x1bd23d,_0x199f3d){_0x1bd23d=_0x1bd23d-0x0;var _0x2fece0=_0x70e0[_0x1bd23d];return _0x2fece0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3e6603,_0x5cb852){var _0x5bcf52=function(_0x28879e){while(--_0x28879e){_0x3e6603['push'](_0x3e6603['shift']());}};_0x5bcf52(++_0x5cb852);}(_0xedd9,0xfc));var _0x9edd=function(_0x52c203,_0x2434ba){_0x52c203=_0x52c203-0x0;var _0x1255a2=_0xedd9[_0x52c203];return _0x1255a2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index f7b6713..c5666ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe785=['INBOX','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x42f1db,_0x1be62e){var _0x57e412=function(_0x56fede){while(--_0x56fede){_0x42f1db['push'](_0x42f1db['shift']());}};_0x57e412(++_0x1be62e);}(_0xe785,0x128));var _0x5e78=function(_0x5b964b,_0xe2062a){_0x5b964b=_0x5b964b-0x0;var _0x2f187d=_0xe785[_0x5b964b];return _0x2f187d;};'use strict';var Sequelize=require(_0x5e78('0x0'));module[_0x5e78('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5e78('0x2')]},'authentication':{'type':Sequelize[_0x5e78('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x5e78('0x2')]},'password':{'type':Sequelize[_0x5e78('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x5e78('0x2')],'defaultValue':_0x5e78('0x4')},'connTimeout':{'type':Sequelize[_0x5e78('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x5e78('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x94b3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94b3,0x161));var _0x394b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x94b3[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x394b('0x0'));module[_0x394b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x394b('0x2')]},'authentication':{'type':Sequelize[_0x394b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x394b('0x2')]},'password':{'type':Sequelize[_0x394b('0x2')]},'port':{'type':Sequelize[_0x394b('0x4')]},'tls':{'type':Sequelize[_0x394b('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x394b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x394b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x394b('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 6a48343..fd168e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9629=['define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x150fa2,_0x156632){var _0x88e6ba=function(_0x23536e){while(--_0x23536e){_0x150fa2['push'](_0x150fa2['shift']());}};_0x88e6ba(++_0x156632);}(_0x9629,0xdb));var _0x9962=function(_0x1836d2,_0x1da514){_0x1836d2=_0x1836d2-0x0;var _0x2b645e=_0x9629[_0x1836d2];return _0x2b645e;};'use strict';var _=require(_0x9962('0x0'));var util=require(_0x9962('0x1'));var logger=require('../../config/logger')(_0x9962('0x2'));var moment=require(_0x9962('0x3'));var BPromise=require(_0x9962('0x4'));var rp=require(_0x9962('0x5'));var fs=require('fs');var path=require(_0x9962('0x6'));var rimraf=require('rimraf');var config=require(_0x9962('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x9962('0x8')]=function(_0x34679d,_0x3afe39){return _0x34679d[_0x9962('0x9')](_0x9962('0xa'),attributes,{'tableName':_0x9962('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74f6=['mail_servers_in','lodash','../../config/logger','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x74f6,0x169));var _0x674f=function(_0x424e02,_0x388077){_0x424e02=_0x424e02-0x0;var _0x371aad=_0x74f6[_0x424e02];return _0x371aad;};'use strict';var _=require(_0x674f('0x0'));var util=require('util');var logger=require(_0x674f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x674f('0x2'));var rimraf=require(_0x674f('0x3'));var config=require(_0x674f('0x4'));var attributes=require(_0x674f('0x5'));module[_0x674f('0x6')]=function(_0xb7f4bf,_0x2e4549){return _0xb7f4bf[_0x674f('0x7')]('MailServerIn',attributes,{'tableName':_0x674f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 326fa19..80682b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x606e=['MailServerIn','findAll','options','raw','attributes','limit','model','include','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn'];(function(_0xfc339c,_0x408b48){var _0xe379b8=function(_0xb7178d){while(--_0xb7178d){_0xfc339c['push'](_0xfc339c['shift']());}};_0xe379b8(++_0x408b48);}(_0x606e,0xc9));var _0xe606=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x606e[_0xa3c06b];return _0x33aa1d;};'use strict';var _=require(_0xe606('0x0'));var util=require(_0xe606('0x1'));var moment=require(_0xe606('0x2'));var BPromise=require(_0xe606('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe606('0x4'));var db=require(_0xe606('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe606('0x6'));var config=require(_0xe606('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe606('0x8')][_0xe606('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33b11d,_0x25f1dd,_0x426f1f){return new BPromise(function(_0x14de0d,_0x3e83bf){return client[_0xe606('0xa')](_0x33b11d,_0x426f1f)[_0xe606('0xb')](function(_0x37ca4a){logger[_0xe606('0xc')](_0xe606('0xd'),_0x25f1dd,_0xe606('0xe'));logger[_0xe606('0xf')](_0xe606('0x10'),_0x25f1dd,_0xe606('0xe'),JSON[_0xe606('0x11')](_0x37ca4a));if(_0x37ca4a['error']){if(_0x37ca4a[_0xe606('0x12')][_0xe606('0x13')]===0x1f4){logger['error'](_0xe606('0xd'),_0x25f1dd,_0x37ca4a[_0xe606('0x12')][_0xe606('0x14')]);return _0x3e83bf(_0x37ca4a[_0xe606('0x12')][_0xe606('0x14')]);}logger[_0xe606('0x12')](_0xe606('0xd'),_0x25f1dd,_0x37ca4a[_0xe606('0x12')][_0xe606('0x14')]);return _0x14de0d(_0x37ca4a[_0xe606('0x12')][_0xe606('0x14')]);}else{logger[_0xe606('0xc')](_0xe606('0xd'),_0x25f1dd,_0xe606('0xe'));_0x14de0d(_0x37ca4a[_0xe606('0x15')][_0xe606('0x14')]);}})['catch'](function(_0x2e41fe){logger[_0xe606('0x12')](_0xe606('0xd'),_0x25f1dd,_0x2e41fe);_0x3e83bf(_0x2e41fe);});});}exports[_0xe606('0x16')]=function(_0x1281cf){var _0x153ba1=this;return new Promise(function(_0x1bbc45,_0x4f73f9){return db[_0xe606('0x17')][_0xe606('0x18')]({'raw':_0x1281cf[_0xe606('0x19')]?_0x1281cf['options'][_0xe606('0x1a')]===undefined?!![]:![]:!![],'where':_0x1281cf[_0xe606('0x19')]?_0x1281cf[_0xe606('0x19')]['where']||null:null,'attributes':_0x1281cf['options']?_0x1281cf['options'][_0xe606('0x1b')]||null:null,'limit':_0x1281cf[_0xe606('0x19')]?_0x1281cf[_0xe606('0x19')][_0xe606('0x1c')]||null:null,'include':_0x1281cf['options']?_0x1281cf['options']['include']?_['map'](_0x1281cf[_0xe606('0x19')]['include'],function(_0x4e7049){return{'model':db[_0x4e7049[_0xe606('0x1d')]],'as':_0x4e7049['as'],'attributes':_0x4e7049[_0xe606('0x1b')],'include':_0x4e7049['include']?_['map'](_0x4e7049[_0xe606('0x1e')],function(_0x2fe8d0){return{'model':db[_0x2fe8d0[_0xe606('0x1d')]],'as':_0x2fe8d0['as'],'attributes':_0x2fe8d0[_0xe606('0x1b')],'include':_0x2fe8d0[_0xe606('0x1e')]?_['map'](_0x2fe8d0[_0xe606('0x1e')],function(_0x5ecff0){return{'model':db[_0x5ecff0[_0xe606('0x1d')]],'as':_0x5ecff0['as'],'attributes':_0x5ecff0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe606('0xb')](function(_0x341cd5){logger[_0xe606('0xc')](_0xe606('0x16'),_0x1281cf);logger[_0xe606('0xf')]('GetMailServerIn',_0x1281cf,JSON[_0xe606('0x11')](_0x341cd5));_0x1bbc45(_0x341cd5);})[_0xe606('0x1f')](function(_0x276f79){logger['error'](_0xe606('0x16'),_0x276f79[_0xe606('0x14')],_0x1281cf);_0x4f73f9(_0x153ba1['error'](0x1f4,_0x276f79[_0xe606('0x14')]));});});};
\ No newline at end of file
+var _0x9b69=['options','raw','attributes','limit','include','map','model','debug','GetMailServerIn','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailServerIn','findAll'];(function(_0x5e3f0f,_0x16c6c7){var _0xbd8d66=function(_0x3f4da4){while(--_0x3f4da4){_0x5e3f0f['push'](_0x5e3f0f['shift']());}};_0xbd8d66(++_0x16c6c7);}(_0x9b69,0x196));var _0x99b6=function(_0x10d55b,_0x136a72){_0x10d55b=_0x10d55b-0x0;var _0x32ad24=_0x9b69[_0x10d55b];return _0x32ad24;};'use strict';var _=require(_0x99b6('0x0'));var util=require('util');var moment=require(_0x99b6('0x1'));var BPromise=require(_0x99b6('0x2'));var rs=require(_0x99b6('0x3'));var fs=require('fs');var Redis=require(_0x99b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x5'));var logger=require('../../config/logger')(_0x99b6('0x6'));var config=require(_0x99b6('0x7'));var jayson=require(_0x99b6('0x8'));var client=jayson[_0x99b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55a5ad,_0x5d0ca6,_0x49d176){return new BPromise(function(_0x38c76a,_0x2d14a8){return client[_0x99b6('0xa')](_0x55a5ad,_0x49d176)[_0x99b6('0xb')](function(_0xaf4c11){logger[_0x99b6('0xc')](_0x99b6('0xd'),_0x5d0ca6,_0x99b6('0xe'));logger['debug'](_0x99b6('0xf'),_0x5d0ca6,'request\x20sent',JSON['stringify'](_0xaf4c11));if(_0xaf4c11[_0x99b6('0x10')]){if(_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x11')]===0x1f4){logger[_0x99b6('0x10')]('MailServerIn,\x20%s,\x20%s',_0x5d0ca6,_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x12')]);return _0x2d14a8(_0xaf4c11['error']['message']);}logger['error'](_0x99b6('0xd'),_0x5d0ca6,_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x12')]);return _0x38c76a(_0xaf4c11['error']['message']);}else{logger[_0x99b6('0xc')]('MailServerIn,\x20%s,\x20%s',_0x5d0ca6,_0x99b6('0xe'));_0x38c76a(_0xaf4c11[_0x99b6('0x13')][_0x99b6('0x12')]);}})[_0x99b6('0x14')](function(_0x389ded){logger[_0x99b6('0x10')](_0x99b6('0xd'),_0x5d0ca6,_0x389ded);_0x2d14a8(_0x389ded);});});}exports['GetMailServerIn']=function(_0x1f7f33){var _0x29f844=this;return new Promise(function(_0xf23455,_0x3711ee){return db[_0x99b6('0x15')][_0x99b6('0x16')]({'raw':_0x1f7f33[_0x99b6('0x17')]?_0x1f7f33[_0x99b6('0x17')][_0x99b6('0x18')]===undefined?!![]:![]:!![],'where':_0x1f7f33[_0x99b6('0x17')]?_0x1f7f33[_0x99b6('0x17')]['where']||null:null,'attributes':_0x1f7f33[_0x99b6('0x17')]?_0x1f7f33[_0x99b6('0x17')][_0x99b6('0x19')]||null:null,'limit':_0x1f7f33['options']?_0x1f7f33[_0x99b6('0x17')][_0x99b6('0x1a')]||null:null,'include':_0x1f7f33[_0x99b6('0x17')]?_0x1f7f33['options'][_0x99b6('0x1b')]?_[_0x99b6('0x1c')](_0x1f7f33[_0x99b6('0x17')][_0x99b6('0x1b')],function(_0x382ab8){return{'model':db[_0x382ab8[_0x99b6('0x1d')]],'as':_0x382ab8['as'],'attributes':_0x382ab8[_0x99b6('0x19')],'include':_0x382ab8[_0x99b6('0x1b')]?_[_0x99b6('0x1c')](_0x382ab8[_0x99b6('0x1b')],function(_0x269c21){return{'model':db[_0x269c21[_0x99b6('0x1d')]],'as':_0x269c21['as'],'attributes':_0x269c21[_0x99b6('0x19')],'include':_0x269c21[_0x99b6('0x1b')]?_[_0x99b6('0x1c')](_0x269c21[_0x99b6('0x1b')],function(_0x5416c7){return{'model':db[_0x5416c7[_0x99b6('0x1d')]],'as':_0x5416c7['as'],'attributes':_0x5416c7[_0x99b6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x99b6('0xb')](function(_0x2cc099){logger['info']('GetMailServerIn',_0x1f7f33);logger[_0x99b6('0x1e')](_0x99b6('0x1f'),_0x1f7f33,JSON[_0x99b6('0x20')](_0x2cc099));_0xf23455(_0x2cc099);})['catch'](function(_0x330f8b){logger[_0x99b6('0x10')]('GetMailServerIn',_0x330f8b['message'],_0x1f7f33);_0x3711ee(_0x29f844[_0x99b6('0x10')](0x1f4,_0x330f8b['message']));});});};
\ No newline at end of file
index fcfdd1e..c538aca 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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+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(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x1159ee,_0x4aab49){_0x1159ee=_0x1159ee-0x0;var _0x3c474b=_0x7a54[_0x1159ee];return _0x3c474b;};'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 f265491..93822de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7c=['sequelize','exports','STRING','BOOLEAN'];(function(_0x58a15a,_0xbd13cc){var _0x17a6a0=function(_0x10eb0e){while(--_0x10eb0e){_0x58a15a['push'](_0x58a15a['shift']());}};_0x17a6a0(++_0xbd13cc);}(_0x1c7c,0x164));var _0xc1c7=function(_0x475837,_0x28ad7a){_0x475837=_0x475837-0x0;var _0x3a3966=_0x1c7c[_0x475837];return _0x3a3966;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'description':{'type':Sequelize[_0xc1c7('0x2')]},'host':{'type':Sequelize[_0xc1c7('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xc1c7('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xc1c7('0x2')]},'authentication':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2547=['BOOLEAN','exports','STRING','INTEGER'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x2547,0x1cd));var _0x7254=function(_0x488118,_0x5d804d){_0x488118=_0x488118-0x0;var _0x50ceb2=_0x2547[_0x488118];return _0x50ceb2;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'description':{'type':Sequelize[_0x7254('0x1')]},'host':{'type':Sequelize[_0x7254('0x1')]},'user':{'type':Sequelize[_0x7254('0x1')]},'pass':{'type':Sequelize[_0x7254('0x1')]},'port':{'type':Sequelize[_0x7254('0x2')]},'secure':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x7254('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 25dc78b..fd2cdef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48c1=['keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailServerOut','type','key','query'];(function(_0x2de758,_0x20fc8b){var _0xeb5ebb=function(_0x1bcc8d){while(--_0x1bcc8d){_0x2de758['push'](_0x2de758['shift']());}};_0xeb5ebb(++_0x20fc8b);}(_0x48c1,0xf8));var _0x148c=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x48c1[_0x45d1fd];return _0xd0e542;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x148c('0x0'));var zipdir=require(_0x148c('0x1'));var jsonpatch=require(_0x148c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x148c('0x3'));var Mustache=require('mustache');var util=require(_0x148c('0x4'));var path=require(_0x148c('0x5'));var sox=require(_0x148c('0x6'));var csv=require(_0x148c('0x7'));var ejs=require(_0x148c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x148c('0x9'));var crypto=require(_0x148c('0xa'));var jsforce=require(_0x148c('0xb'));var deskjs=require(_0x148c('0xc'));var toCsv=require(_0x148c('0x7'));var querystring=require(_0x148c('0xd'));var Papa=require(_0x148c('0xe'));var Redis=require('ioredis');var authService=require(_0x148c('0xf'));var qs=require(_0x148c('0x10'));var as=require(_0x148c('0x11'));var hardwareService=require(_0x148c('0x12'));var logger=require(_0x148c('0x13'))(_0x148c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x148c('0x15'));var db=require(_0x148c('0x16'))['db'];function respondWithStatusCode(_0x52498c,_0x46fe95){_0x46fe95=_0x46fe95||0xcc;return function(_0x17b348){if(_0x17b348){return _0x52498c[_0x148c('0x17')](_0x46fe95);}return _0x52498c[_0x148c('0x18')](_0x46fe95)[_0x148c('0x19')]();};}function respondWithResult(_0x12f32d,_0x17a4e4){_0x17a4e4=_0x17a4e4||0xc8;return function(_0x274b58){if(_0x274b58){return _0x12f32d[_0x148c('0x18')](_0x17a4e4)[_0x148c('0x1a')](_0x274b58);}};}function respondWithFilteredResult(_0x41591d,_0x462206){return function(_0x122117){if(_0x122117){var _0x48bed8=typeof _0x462206['offset']===_0x148c('0x1b')&&typeof _0x462206[_0x148c('0x1c')]===_0x148c('0x1b');var _0x3c9cae=_0x122117['count'];var _0x754fcc=_0x48bed8?0x0:_0x462206[_0x148c('0x1d')];var _0x25f0fe=_0x48bed8?_0x122117[_0x148c('0x1e')]:_0x462206[_0x148c('0x1d')]+_0x462206[_0x148c('0x1c')];var _0x2b6f5e;if(_0x25f0fe>=_0x3c9cae){_0x25f0fe=_0x3c9cae;_0x2b6f5e=0xc8;}else{_0x2b6f5e=0xce;}_0x41591d[_0x148c('0x18')](_0x2b6f5e);return _0x41591d[_0x148c('0x1f')](_0x148c('0x20'),_0x754fcc+'-'+_0x25f0fe+'/'+_0x3c9cae)['json'](_0x122117);}return null;};}function patchUpdates(_0x5f0d99){return function(_0x38cf66){try{jsonpatch[_0x148c('0x21')](_0x38cf66,_0x5f0d99,!![]);}catch(_0x371e16){return BPromise[_0x148c('0x22')](_0x371e16);}return _0x38cf66[_0x148c('0x23')]();};}function saveUpdates(_0x271b7e,_0x3612d3){return function(_0xbbe108){if(_0xbbe108){return _0xbbe108[_0x148c('0x24')](_0x271b7e)[_0x148c('0x25')](function(_0x54de30){return _0x54de30;});}return null;};}function removeEntity(_0x21fc5c,_0x1b4ea9){return function(_0x5f99ce){if(_0x5f99ce){return _0x5f99ce[_0x148c('0x26')]()[_0x148c('0x25')](function(){_0x21fc5c[_0x148c('0x18')](0xcc)[_0x148c('0x19')]();});}};}function handleEntityNotFound(_0x44326d,_0x329d29){return function(_0x32ab2b){if(!_0x32ab2b){_0x44326d['sendStatus'](0x194);}return _0x32ab2b;};}function handleError(_0x554d82,_0x3ff1cd){_0x3ff1cd=_0x3ff1cd||0x1f4;return function(_0x491ce0){logger['error'](_0x491ce0[_0x148c('0x27')]);if(_0x491ce0[_0x148c('0x28')]){delete _0x491ce0[_0x148c('0x28')];}_0x554d82[_0x148c('0x18')](_0x3ff1cd)[_0x148c('0x29')](_0x491ce0);};}exports[_0x148c('0x2a')]=function(_0x236eee,_0x30d16c){var _0x123439={},_0x336015={},_0x32ca25={'count':0x0,'rows':[]};var _0xeb592a=_[_0x148c('0x2b')](db[_0x148c('0x2c')]['rawAttributes'],function(_0x4b94e4){return{'name':_0x4b94e4['fieldName'],'type':_0x4b94e4[_0x148c('0x2d')][_0x148c('0x2e')]};});_0x336015['model']=_[_0x148c('0x2b')](_0xeb592a,_0x148c('0x28'));_0x336015[_0x148c('0x2f')]=_[_0x148c('0x30')](_0x236eee[_0x148c('0x2f')]);_0x336015['filters']=_[_0x148c('0x31')](_0x336015[_0x148c('0x32')],_0x336015[_0x148c('0x2f')]);_0x123439[_0x148c('0x33')]=_['intersection'](_0x336015[_0x148c('0x32')],qs[_0x148c('0x34')](_0x236eee[_0x148c('0x2f')][_0x148c('0x34')]));_0x123439[_0x148c('0x33')]=_0x123439['attributes']['length']?_0x123439[_0x148c('0x33')]:_0x336015['model'];if(!_0x236eee[_0x148c('0x2f')][_0x148c('0x35')](_0x148c('0x36'))){_0x123439[_0x148c('0x1c')]=qs['limit'](_0x236eee['query'][_0x148c('0x1c')]);_0x123439['offset']=qs[_0x148c('0x1d')](_0x236eee[_0x148c('0x2f')][_0x148c('0x1d')]);}_0x123439[_0x148c('0x37')]=qs[_0x148c('0x38')](_0x236eee[_0x148c('0x2f')][_0x148c('0x38')]);_0x123439[_0x148c('0x39')]=qs['filters'](_[_0x148c('0x3a')](_0x236eee[_0x148c('0x2f')],_0x336015['filters']),_0xeb592a);if(_0x236eee[_0x148c('0x2f')]['filter']){_0x123439[_0x148c('0x39')]=_['merge'](_0x123439['where'],{'$or':_[_0x148c('0x2b')](_0xeb592a,function(_0x1f37ad){if(_0x1f37ad[_0x148c('0x2d')]!==_0x148c('0x3b')){var _0x148f43={};_0x148f43[_0x1f37ad[_0x148c('0x28')]]={'$like':'%'+_0x236eee[_0x148c('0x2f')][_0x148c('0x3c')]+'%'};return _0x148f43;}})});}_0x123439=_[_0x148c('0x3d')]({},_0x123439,_0x236eee['options']);var _0x98a32f={'where':_0x123439[_0x148c('0x39')]};return db[_0x148c('0x2c')][_0x148c('0x1e')](_0x98a32f)[_0x148c('0x25')](function(_0x4283bb){_0x32ca25[_0x148c('0x1e')]=_0x4283bb;if(_0x236eee['query'][_0x148c('0x3e')]){_0x123439[_0x148c('0x3f')]=[{'all':!![]}];}return db[_0x148c('0x2c')][_0x148c('0x40')](_0x123439);})[_0x148c('0x25')](function(_0x5b56b7){_0x32ca25[_0x148c('0x41')]=_0x5b56b7;return _0x32ca25;})[_0x148c('0x25')](respondWithFilteredResult(_0x30d16c,_0x123439))[_0x148c('0x42')](handleError(_0x30d16c,null));};exports[_0x148c('0x43')]=function(_0x451222,_0x1f846c){var _0xd28f1a={'raw':!![],'where':{'id':_0x451222[_0x148c('0x44')]['id']}},_0x1a7bfc={};_0x1a7bfc[_0x148c('0x32')]=_[_0x148c('0x30')](db[_0x148c('0x2c')][_0x148c('0x45')]);_0x1a7bfc[_0x148c('0x2f')]=_[_0x148c('0x30')](_0x451222[_0x148c('0x2f')]);_0x1a7bfc[_0x148c('0x46')]=_['intersection'](_0x1a7bfc[_0x148c('0x32')],_0x1a7bfc['query']);_0xd28f1a[_0x148c('0x33')]=_[_0x148c('0x31')](_0x1a7bfc[_0x148c('0x32')],qs[_0x148c('0x34')](_0x451222[_0x148c('0x2f')][_0x148c('0x34')]));_0xd28f1a[_0x148c('0x33')]=_0xd28f1a[_0x148c('0x33')]['length']?_0xd28f1a[_0x148c('0x33')]:_0x1a7bfc[_0x148c('0x32')];if(_0x451222[_0x148c('0x2f')][_0x148c('0x3e')]){_0xd28f1a[_0x148c('0x3f')]=[{'all':!![]}];}_0xd28f1a=_[_0x148c('0x3d')]({},_0xd28f1a,_0x451222['options']);return db[_0x148c('0x2c')][_0x148c('0x47')](_0xd28f1a)[_0x148c('0x25')](handleEntityNotFound(_0x1f846c,null))[_0x148c('0x25')](respondWithResult(_0x1f846c,null))[_0x148c('0x42')](handleError(_0x1f846c,null));};exports[_0x148c('0x48')]=function(_0x6906e9,_0x36be6a){return db['MailServerOut']['create'](_0x6906e9['body'],{})[_0x148c('0x25')](respondWithResult(_0x36be6a,0xc9))[_0x148c('0x42')](handleError(_0x36be6a,null));};exports[_0x148c('0x24')]=function(_0x476678,_0x542e76){if(_0x476678[_0x148c('0x49')]['id']){delete _0x476678[_0x148c('0x49')]['id'];}return db[_0x148c('0x2c')]['find']({'where':{'id':_0x476678[_0x148c('0x44')]['id']}})[_0x148c('0x25')](handleEntityNotFound(_0x542e76,null))[_0x148c('0x25')](saveUpdates(_0x476678[_0x148c('0x49')],null))['then'](respondWithResult(_0x542e76,null))[_0x148c('0x42')](handleError(_0x542e76,null));};exports[_0x148c('0x26')]=function(_0x5468cc,_0x4acdaa){return db[_0x148c('0x2c')][_0x148c('0x47')]({'where':{'id':_0x5468cc['params']['id']}})[_0x148c('0x25')](handleEntityNotFound(_0x4acdaa,null))[_0x148c('0x25')](removeEntity(_0x4acdaa,null))[_0x148c('0x42')](handleError(_0x4acdaa,null));};
\ No newline at end of file
+var _0x9ef5=['fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','params','keys','rawAttributes','length','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','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','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','then','destroy','sendStatus','error','name','send','index','map','MailServerOut','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x9ef5,0x1cb));var _0x59ef=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9ef5[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0x59ef('0x0'));var rimraf=require(_0x59ef('0x1'));var zipdir=require(_0x59ef('0x2'));var jsonpatch=require(_0x59ef('0x3'));var rp=require(_0x59ef('0x4'));var moment=require(_0x59ef('0x5'));var BPromise=require(_0x59ef('0x6'));var Mustache=require(_0x59ef('0x7'));var util=require('util');var path=require('path');var sox=require(_0x59ef('0x8'));var csv=require(_0x59ef('0x9'));var ejs=require(_0x59ef('0xa'));var fs=require('fs');var fs_extra=require(_0x59ef('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x59ef('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x59ef('0x9'));var querystring=require(_0x59ef('0xd'));var Papa=require(_0x59ef('0xe'));var Redis=require(_0x59ef('0xf'));var authService=require(_0x59ef('0x10'));var qs=require(_0x59ef('0x11'));var as=require(_0x59ef('0x12'));var hardwareService=require(_0x59ef('0x13'));var logger=require(_0x59ef('0x14'))(_0x59ef('0x15'));var utils=require('../../config/utils');var config=require(_0x59ef('0x16'));var licenseUtil=require(_0x59ef('0x17'));var db=require(_0x59ef('0x18'))['db'];function respondWithStatusCode(_0x122a4c,_0x1360dc){_0x1360dc=_0x1360dc||0xcc;return function(_0x4c4ac2){if(_0x4c4ac2){return _0x122a4c['sendStatus'](_0x1360dc);}return _0x122a4c['status'](_0x1360dc)[_0x59ef('0x19')]();};}function respondWithResult(_0x465b7f,_0x577d8d){_0x577d8d=_0x577d8d||0xc8;return function(_0x436648){if(_0x436648){return _0x465b7f['status'](_0x577d8d)[_0x59ef('0x1a')](_0x436648);}};}function respondWithFilteredResult(_0x4aa5c8,_0x43cad1){return function(_0xe76d13){if(_0xe76d13){var _0x2cab10=typeof _0x43cad1[_0x59ef('0x1b')]===_0x59ef('0x1c')&&typeof _0x43cad1[_0x59ef('0x1d')]===_0x59ef('0x1c');var _0x36ca1a=_0xe76d13[_0x59ef('0x1e')];var _0x4fef77=_0x2cab10?0x0:_0x43cad1[_0x59ef('0x1b')];var _0x3ecc65=_0x2cab10?_0xe76d13[_0x59ef('0x1e')]:_0x43cad1[_0x59ef('0x1b')]+_0x43cad1[_0x59ef('0x1d')];var _0x42eb61;if(_0x3ecc65>=_0x36ca1a){_0x3ecc65=_0x36ca1a;_0x42eb61=0xc8;}else{_0x42eb61=0xce;}_0x4aa5c8[_0x59ef('0x1f')](_0x42eb61);return _0x4aa5c8['set'](_0x59ef('0x20'),_0x4fef77+'-'+_0x3ecc65+'/'+_0x36ca1a)[_0x59ef('0x1a')](_0xe76d13);}return null;};}function patchUpdates(_0x12cb1b){return function(_0x5c3d65){try{jsonpatch[_0x59ef('0x21')](_0x5c3d65,_0x12cb1b,!![]);}catch(_0x238c62){return BPromise['reject'](_0x238c62);}return _0x5c3d65[_0x59ef('0x22')]();};}function saveUpdates(_0x12ff62,_0x1f7540){return function(_0x236f4b){if(_0x236f4b){return _0x236f4b['update'](_0x12ff62)[_0x59ef('0x23')](function(_0x2de1df){return _0x2de1df;});}return null;};}function removeEntity(_0x51eaf6,_0x291a37){return function(_0xf0ea14){if(_0xf0ea14){return _0xf0ea14[_0x59ef('0x24')]()[_0x59ef('0x23')](function(){_0x51eaf6[_0x59ef('0x1f')](0xcc)[_0x59ef('0x19')]();});}};}function handleEntityNotFound(_0x5f0d57,_0x243eb0){return function(_0x1d8e1c){if(!_0x1d8e1c){_0x5f0d57[_0x59ef('0x25')](0x194);}return _0x1d8e1c;};}function handleError(_0x34aebc,_0x17d1f3){_0x17d1f3=_0x17d1f3||0x1f4;return function(_0xb7325b){logger[_0x59ef('0x26')](_0xb7325b['stack']);if(_0xb7325b['name']){delete _0xb7325b[_0x59ef('0x27')];}_0x34aebc['status'](_0x17d1f3)[_0x59ef('0x28')](_0xb7325b);};}exports[_0x59ef('0x29')]=function(_0x53fad3,_0x1493e2){var _0x10fd1d={},_0x51898a={},_0x2082e4={'count':0x0,'rows':[]};var _0x872251=_[_0x59ef('0x2a')](db[_0x59ef('0x2b')]['rawAttributes'],function(_0x5e4abe){return{'name':_0x5e4abe[_0x59ef('0x2c')],'type':_0x5e4abe[_0x59ef('0x2d')][_0x59ef('0x2e')]};});_0x51898a[_0x59ef('0x2f')]=_[_0x59ef('0x2a')](_0x872251,_0x59ef('0x27'));_0x51898a[_0x59ef('0x30')]=_['keys'](_0x53fad3[_0x59ef('0x30')]);_0x51898a[_0x59ef('0x31')]=_[_0x59ef('0x32')](_0x51898a[_0x59ef('0x2f')],_0x51898a[_0x59ef('0x30')]);_0x10fd1d[_0x59ef('0x33')]=_[_0x59ef('0x32')](_0x51898a['model'],qs[_0x59ef('0x34')](_0x53fad3[_0x59ef('0x30')][_0x59ef('0x34')]));_0x10fd1d[_0x59ef('0x33')]=_0x10fd1d[_0x59ef('0x33')]['length']?_0x10fd1d[_0x59ef('0x33')]:_0x51898a['model'];if(!_0x53fad3[_0x59ef('0x30')][_0x59ef('0x35')]('nolimit')){_0x10fd1d[_0x59ef('0x1d')]=qs[_0x59ef('0x1d')](_0x53fad3[_0x59ef('0x30')][_0x59ef('0x1d')]);_0x10fd1d[_0x59ef('0x1b')]=qs[_0x59ef('0x1b')](_0x53fad3[_0x59ef('0x30')][_0x59ef('0x1b')]);}_0x10fd1d[_0x59ef('0x36')]=qs[_0x59ef('0x37')](_0x53fad3[_0x59ef('0x30')][_0x59ef('0x37')]);_0x10fd1d[_0x59ef('0x38')]=qs[_0x59ef('0x31')](_[_0x59ef('0x39')](_0x53fad3[_0x59ef('0x30')],_0x51898a['filters']),_0x872251);if(_0x53fad3[_0x59ef('0x30')][_0x59ef('0x3a')]){_0x10fd1d[_0x59ef('0x38')]=_[_0x59ef('0x3b')](_0x10fd1d[_0x59ef('0x38')],{'$or':_[_0x59ef('0x2a')](_0x872251,function(_0x5ac71f){if(_0x5ac71f[_0x59ef('0x2d')]!==_0x59ef('0x3c')){var _0x2c080b={};_0x2c080b[_0x5ac71f['name']]={'$like':'%'+_0x53fad3[_0x59ef('0x30')][_0x59ef('0x3a')]+'%'};return _0x2c080b;}})});}_0x10fd1d=_[_0x59ef('0x3b')]({},_0x10fd1d,_0x53fad3['options']);var _0x568c4a={'where':_0x10fd1d['where']};return db[_0x59ef('0x2b')][_0x59ef('0x1e')](_0x568c4a)['then'](function(_0x128461){_0x2082e4[_0x59ef('0x1e')]=_0x128461;if(_0x53fad3['query'][_0x59ef('0x3d')]){_0x10fd1d['include']=[{'all':!![]}];}return db[_0x59ef('0x2b')]['findAll'](_0x10fd1d);})[_0x59ef('0x23')](function(_0x3d4b70){_0x2082e4['rows']=_0x3d4b70;return _0x2082e4;})[_0x59ef('0x23')](respondWithFilteredResult(_0x1493e2,_0x10fd1d))[_0x59ef('0x3e')](handleError(_0x1493e2,null));};exports[_0x59ef('0x3f')]=function(_0x370eef,_0x545379){var _0x4e9c48={'raw':!![],'where':{'id':_0x370eef[_0x59ef('0x40')]['id']}},_0x222e5d={};_0x222e5d[_0x59ef('0x2f')]=_[_0x59ef('0x41')](db[_0x59ef('0x2b')][_0x59ef('0x42')]);_0x222e5d[_0x59ef('0x30')]=_['keys'](_0x370eef['query']);_0x222e5d[_0x59ef('0x31')]=_['intersection'](_0x222e5d[_0x59ef('0x2f')],_0x222e5d[_0x59ef('0x30')]);_0x4e9c48[_0x59ef('0x33')]=_[_0x59ef('0x32')](_0x222e5d[_0x59ef('0x2f')],qs[_0x59ef('0x34')](_0x370eef[_0x59ef('0x30')][_0x59ef('0x34')]));_0x4e9c48[_0x59ef('0x33')]=_0x4e9c48[_0x59ef('0x33')][_0x59ef('0x43')]?_0x4e9c48[_0x59ef('0x33')]:_0x222e5d[_0x59ef('0x2f')];if(_0x370eef[_0x59ef('0x30')][_0x59ef('0x3d')]){_0x4e9c48[_0x59ef('0x44')]=[{'all':!![]}];}_0x4e9c48=_[_0x59ef('0x3b')]({},_0x4e9c48,_0x370eef['options']);return db[_0x59ef('0x2b')][_0x59ef('0x45')](_0x4e9c48)[_0x59ef('0x23')](handleEntityNotFound(_0x545379,null))[_0x59ef('0x23')](respondWithResult(_0x545379,null))[_0x59ef('0x3e')](handleError(_0x545379,null));};exports[_0x59ef('0x46')]=function(_0x4486df,_0x46e6e4){return db[_0x59ef('0x2b')][_0x59ef('0x46')](_0x4486df[_0x59ef('0x47')],{})[_0x59ef('0x23')](respondWithResult(_0x46e6e4,0xc9))[_0x59ef('0x3e')](handleError(_0x46e6e4,null));};exports[_0x59ef('0x48')]=function(_0x8a9772,_0x5027af){if(_0x8a9772[_0x59ef('0x47')]['id']){delete _0x8a9772['body']['id'];}return db[_0x59ef('0x2b')][_0x59ef('0x45')]({'where':{'id':_0x8a9772['params']['id']}})['then'](handleEntityNotFound(_0x5027af,null))[_0x59ef('0x23')](saveUpdates(_0x8a9772[_0x59ef('0x47')],null))[_0x59ef('0x23')](respondWithResult(_0x5027af,null))[_0x59ef('0x3e')](handleError(_0x5027af,null));};exports['destroy']=function(_0xe36590,_0x30f82e){return db[_0x59ef('0x2b')][_0x59ef('0x45')]({'where':{'id':_0xe36590[_0x59ef('0x40')]['id']}})[_0x59ef('0x23')](handleEntityNotFound(_0x30f82e,null))[_0x59ef('0x23')](removeEntity(_0x30f82e,null))[_0x59ef('0x3e')](handleError(_0x30f82e,null));};
\ No newline at end of file
index 62581e0..f426cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4587=['../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','../../config/logger','moment','bluebird','request-promise'];(function(_0x1cd14d,_0x31074d){var _0x1c7dd2=function(_0x123a6b){while(--_0x123a6b){_0x1cd14d['push'](_0x1cd14d['shift']());}};_0x1c7dd2(++_0x31074d);}(_0x4587,0x11c));var _0x7458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4587[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7458('0x0'))('api');var moment=require(_0x7458('0x1'));var BPromise=require(_0x7458('0x2'));var rp=require(_0x7458('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7458('0x4'));var attributes=require(_0x7458('0x5'));module[_0x7458('0x6')]=function(_0x163fd5,_0x49b476){return _0x163fd5['define'](_0x7458('0x7'),attributes,{'tableName':_0x7458('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ac0=['bluebird','rimraf','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x7d653b,_0x3f3341){var _0x3a30e7=function(_0x4e7b60){while(--_0x4e7b60){_0x7d653b['push'](_0x7d653b['shift']());}};_0x3a30e7(++_0x3f3341);}(_0x5ac0,0x87));var _0x05ac=function(_0x1c4931,_0x39d4da){_0x1c4931=_0x1c4931-0x0;var _0x468025=_0x5ac0[_0x1c4931];return _0x468025;};'use strict';var _=require(_0x05ac('0x0'));var util=require(_0x05ac('0x1'));var logger=require(_0x05ac('0x2'))(_0x05ac('0x3'));var moment=require(_0x05ac('0x4'));var BPromise=require(_0x05ac('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x05ac('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0x05ac('0x7')]=function(_0x100aa5,_0x2c6c91){return _0x100aa5[_0x05ac('0x8')]('MailServerOut',attributes,{'tableName':_0x05ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c3c18d0..d549d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3d4725,_0x5decd3){var _0x18d66e=function(_0x166401){while(--_0x166401){_0x3d4725['push'](_0x3d4725['shift']());}};_0x18d66e(++_0x5decd3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xae8512,_0x1e470e){var _0x2acde0=function(_0x5b5441){while(--_0x5b5441){_0xae8512['push'](_0xae8512['shift']());}};_0x2acde0(++_0x1e470e);}(_0xdb28,0x106));var _0x8db2=function(_0x3b68a5,_0x2d657f){_0x3b68a5=_0x3b68a5-0x0;var _0x4176a4=_0xdb28[_0x3b68a5];return _0x4176a4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index df66f37..030d029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7506=['delete','destroy','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x7506,0xda));var _0x6750=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7506[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x6750('0x0'));var path=require('path');var timeout=require(_0x6750('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6750('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6750('0x3'));var config=require(_0x6750('0x4'));var controller=require(_0x6750('0x5'));router['get']('/',auth[_0x6750('0x6')](),controller['index']);router[_0x6750('0x7')](_0x6750('0x8'),auth[_0x6750('0x6')](),controller[_0x6750('0x9')]);router[_0x6750('0x7')](_0x6750('0xa'),auth[_0x6750('0x6')](),controller[_0x6750('0xb')]);router[_0x6750('0xc')]('/',auth[_0x6750('0x6')](),controller[_0x6750('0xd')]);router[_0x6750('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6750('0xf')]);router[_0x6750('0x10')](_0x6750('0xa'),auth[_0x6750('0x6')](),controller[_0x6750('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7a2e=['put','update','delete','destroy','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x4bd349,_0x5b041e){var _0x4c40b4=function(_0x1a9de5){while(--_0x1a9de5){_0x4bd349['push'](_0x4bd349['shift']());}};_0x4c40b4(++_0x5b041e);}(_0x7a2e,0x190));var _0xe7a2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7a2e[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xe7a2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe7a2('0x1'));var router=express[_0xe7a2('0x2')]();var fs_extra=require(_0xe7a2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe7a2('0x4'));var config=require(_0xe7a2('0x5'));var controller=require(_0xe7a2('0x6'));router[_0xe7a2('0x7')]('/',auth[_0xe7a2('0x8')](),controller[_0xe7a2('0x9')]);router[_0xe7a2('0x7')](_0xe7a2('0xa'),auth[_0xe7a2('0x8')](),controller[_0xe7a2('0xb')]);router['get'](_0xe7a2('0xc'),auth[_0xe7a2('0x8')](),controller['show']);router[_0xe7a2('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe7a2('0xe')]('/:id',auth[_0xe7a2('0x8')](),controller[_0xe7a2('0xf')]);router[_0xe7a2('0x10')](_0xe7a2('0xc'),auth[_0xe7a2('0x8')](),controller[_0xe7a2('0x11')]);module['exports']=router;
\ No newline at end of file
index b27f8ee..1858295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d9f=['sequelize','exports','STRING','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7d9f[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0xf7d9('0x0'));module[_0xf7d9('0x1')]={'name':{'type':Sequelize[_0xf7d9('0x2')],'unique':_0xf7d9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf7d9('0x2')]}};
\ No newline at end of file
+var _0x6eed=['exports','STRING','name','sequelize'];(function(_0x3c7869,_0x207240){var _0x23bc0b=function(_0x1d5f28){while(--_0x1d5f28){_0x3c7869['push'](_0x3c7869['shift']());}};_0x23bc0b(++_0x207240);}(_0x6eed,0xff));var _0xd6ee=function(_0x2e1371,_0x1321d3){_0x2e1371=_0x2e1371-0x0;var _0x5e80e6=_0x6eed[_0x2e1371];return _0x5e80e6;};'use strict';var Sequelize=require(_0xd6ee('0x0'));module[_0xd6ee('0x1')]={'name':{'type':Sequelize[_0xd6ee('0x2')],'unique':_0xd6ee('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd6ee('0x2')]}};
\ No newline at end of file
index 64578bb..51a1687 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe006=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','index','map','MailSubstatus','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','keys','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','jsforce','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b4eef,_0xa4906d){var _0x1fb272=function(_0x21349d){while(--_0x21349d){_0x4b4eef['push'](_0x4b4eef['shift']());}};_0x1fb272(++_0xa4906d);}(_0xe006,0x138));var _0x6e00=function(_0xd58fc1,_0x1d931c){_0xd58fc1=_0xd58fc1-0x0;var _0xc71c40=_0xe006[_0xd58fc1];return _0xc71c40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e00('0x0'));var zipdir=require(_0x6e00('0x1'));var jsonpatch=require(_0x6e00('0x2'));var rp=require(_0x6e00('0x3'));var moment=require('moment');var BPromise=require(_0x6e00('0x4'));var Mustache=require(_0x6e00('0x5'));var util=require(_0x6e00('0x6'));var path=require(_0x6e00('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e00('0x8'));var _=require(_0x6e00('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6e00('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e00('0xb'));var qs=require(_0x6e00('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e00('0xd'))('api');var utils=require('../../config/utils');var config=require(_0x6e00('0xe'));var licenseUtil=require(_0x6e00('0xf'));var db=require(_0x6e00('0x10'))['db'];function respondWithStatusCode(_0xd9a0ec,_0xbd1cb3){_0xbd1cb3=_0xbd1cb3||0xcc;return function(_0x557a80){if(_0x557a80){return _0xd9a0ec[_0x6e00('0x11')](_0xbd1cb3);}return _0xd9a0ec[_0x6e00('0x12')](_0xbd1cb3)[_0x6e00('0x13')]();};}function respondWithResult(_0x31c7c0,_0x26bf28){_0x26bf28=_0x26bf28||0xc8;return function(_0xbd3b5e){if(_0xbd3b5e){return _0x31c7c0[_0x6e00('0x12')](_0x26bf28)[_0x6e00('0x14')](_0xbd3b5e);}};}function respondWithFilteredResult(_0x6a14b9,_0x45ee7c){return function(_0x40ac88){if(_0x40ac88){var _0xfb772f=typeof _0x45ee7c[_0x6e00('0x15')]===_0x6e00('0x16')&&typeof _0x45ee7c[_0x6e00('0x17')]===_0x6e00('0x16');var _0x5c781e=_0x40ac88[_0x6e00('0x18')];var _0x19ac79=_0xfb772f?0x0:_0x45ee7c[_0x6e00('0x15')];var _0x1b0ba0=_0xfb772f?_0x40ac88[_0x6e00('0x18')]:_0x45ee7c[_0x6e00('0x15')]+_0x45ee7c[_0x6e00('0x17')];var _0x405db7;if(_0x1b0ba0>=_0x5c781e){_0x1b0ba0=_0x5c781e;_0x405db7=0xc8;}else{_0x405db7=0xce;}_0x6a14b9[_0x6e00('0x12')](_0x405db7);return _0x6a14b9[_0x6e00('0x19')]('Content-Range',_0x19ac79+'-'+_0x1b0ba0+'/'+_0x5c781e)[_0x6e00('0x14')](_0x40ac88);}return null;};}function patchUpdates(_0x5f53a1){return function(_0x1192d5){try{jsonpatch[_0x6e00('0x1a')](_0x1192d5,_0x5f53a1,!![]);}catch(_0x271769){return BPromise['reject'](_0x271769);}return _0x1192d5['save']();};}function saveUpdates(_0x409db6,_0x3c2820){return function(_0x450e7b){if(_0x450e7b){return _0x450e7b[_0x6e00('0x1b')](_0x409db6)[_0x6e00('0x1c')](function(_0x8bf69c){return _0x8bf69c;});}return null;};}function removeEntity(_0x39bc31,_0x1c5aec){return function(_0x171ce5){if(_0x171ce5){return _0x171ce5[_0x6e00('0x1d')]()['then'](function(){_0x39bc31[_0x6e00('0x12')](0xcc)[_0x6e00('0x13')]();});}};}function handleEntityNotFound(_0x1eef89,_0x4b07f8){return function(_0x51dac4){if(!_0x51dac4){_0x1eef89[_0x6e00('0x11')](0x194);}return _0x51dac4;};}function handleError(_0x41043f,_0x3ab8fb){_0x3ab8fb=_0x3ab8fb||0x1f4;return function(_0x407d3a){logger['error'](_0x407d3a[_0x6e00('0x1e')]);if(_0x407d3a[_0x6e00('0x1f')]){delete _0x407d3a[_0x6e00('0x1f')];}_0x41043f[_0x6e00('0x12')](_0x3ab8fb)[_0x6e00('0x20')](_0x407d3a);};}exports[_0x6e00('0x21')]=function(_0x2eb2a8,_0x23b99a){var _0x3ed84={},_0x5f41c0={},_0x2212b3={'count':0x0,'rows':[]};var _0x3a42e7=_[_0x6e00('0x22')](db[_0x6e00('0x23')][_0x6e00('0x24')],function(_0x263878){return{'name':_0x263878['fieldName'],'type':_0x263878[_0x6e00('0x25')]['key']};});_0x5f41c0[_0x6e00('0x26')]=_[_0x6e00('0x22')](_0x3a42e7,_0x6e00('0x1f'));_0x5f41c0[_0x6e00('0x27')]=_['keys'](_0x2eb2a8[_0x6e00('0x27')]);_0x5f41c0[_0x6e00('0x28')]=_[_0x6e00('0x29')](_0x5f41c0[_0x6e00('0x26')],_0x5f41c0[_0x6e00('0x27')]);_0x3ed84[_0x6e00('0x2a')]=_[_0x6e00('0x29')](_0x5f41c0[_0x6e00('0x26')],qs['fields'](_0x2eb2a8['query'][_0x6e00('0x2b')]));_0x3ed84[_0x6e00('0x2a')]=_0x3ed84[_0x6e00('0x2a')][_0x6e00('0x2c')]?_0x3ed84[_0x6e00('0x2a')]:_0x5f41c0[_0x6e00('0x26')];if(!_0x2eb2a8['query'][_0x6e00('0x2d')](_0x6e00('0x2e'))){_0x3ed84[_0x6e00('0x17')]=qs[_0x6e00('0x17')](_0x2eb2a8['query']['limit']);_0x3ed84[_0x6e00('0x15')]=qs[_0x6e00('0x15')](_0x2eb2a8[_0x6e00('0x27')][_0x6e00('0x15')]);}_0x3ed84[_0x6e00('0x2f')]=qs[_0x6e00('0x30')](_0x2eb2a8[_0x6e00('0x27')]['sort']);_0x3ed84[_0x6e00('0x31')]=qs[_0x6e00('0x28')](_[_0x6e00('0x32')](_0x2eb2a8[_0x6e00('0x27')],_0x5f41c0[_0x6e00('0x28')]),_0x3a42e7);if(_0x2eb2a8[_0x6e00('0x27')][_0x6e00('0x33')]){_0x3ed84[_0x6e00('0x31')]=_[_0x6e00('0x34')](_0x3ed84['where'],{'$or':_[_0x6e00('0x22')](_0x3a42e7,function(_0x3a9560){if(_0x3a9560[_0x6e00('0x25')]!=='VIRTUAL'){var _0x1ef353={};_0x1ef353[_0x3a9560[_0x6e00('0x1f')]]={'$like':'%'+_0x2eb2a8['query'][_0x6e00('0x33')]+'%'};return _0x1ef353;}})});}_0x3ed84=_[_0x6e00('0x34')]({},_0x3ed84,_0x2eb2a8[_0x6e00('0x35')]);var _0x57f42e={'where':_0x3ed84['where']};return db['MailSubstatus'][_0x6e00('0x18')](_0x57f42e)[_0x6e00('0x1c')](function(_0x32906a){_0x2212b3[_0x6e00('0x18')]=_0x32906a;if(_0x2eb2a8[_0x6e00('0x27')][_0x6e00('0x36')]){_0x3ed84[_0x6e00('0x37')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x3ed84);})[_0x6e00('0x1c')](function(_0x25aa54){_0x2212b3[_0x6e00('0x38')]=_0x25aa54;return _0x2212b3;})[_0x6e00('0x1c')](respondWithFilteredResult(_0x23b99a,_0x3ed84))[_0x6e00('0x39')](handleError(_0x23b99a,null));};exports[_0x6e00('0x3a')]=function(_0x54ea14,_0x25eaaa){var _0x25b7e0={'raw':!![],'where':{'id':_0x54ea14['params']['id']}},_0x376720={};_0x376720[_0x6e00('0x26')]=_[_0x6e00('0x3b')](db[_0x6e00('0x23')]['rawAttributes']);_0x376720[_0x6e00('0x27')]=_[_0x6e00('0x3b')](_0x54ea14[_0x6e00('0x27')]);_0x376720[_0x6e00('0x28')]=_[_0x6e00('0x29')](_0x376720['model'],_0x376720[_0x6e00('0x27')]);_0x25b7e0[_0x6e00('0x2a')]=_['intersection'](_0x376720[_0x6e00('0x26')],qs[_0x6e00('0x2b')](_0x54ea14[_0x6e00('0x27')]['fields']));_0x25b7e0[_0x6e00('0x2a')]=_0x25b7e0[_0x6e00('0x2a')][_0x6e00('0x2c')]?_0x25b7e0[_0x6e00('0x2a')]:_0x376720['model'];if(_0x54ea14[_0x6e00('0x27')][_0x6e00('0x36')]){_0x25b7e0[_0x6e00('0x37')]=[{'all':!![]}];}_0x25b7e0=_[_0x6e00('0x34')]({},_0x25b7e0,_0x54ea14['options']);return db[_0x6e00('0x23')][_0x6e00('0x3c')](_0x25b7e0)['then'](handleEntityNotFound(_0x25eaaa,null))['then'](respondWithResult(_0x25eaaa,null))[_0x6e00('0x39')](handleError(_0x25eaaa,null));};exports['create']=function(_0x9a66ac,_0x1e969a){return db[_0x6e00('0x23')][_0x6e00('0x3d')](_0x9a66ac['body'],{})[_0x6e00('0x1c')](respondWithResult(_0x1e969a,0xc9))[_0x6e00('0x39')](handleError(_0x1e969a,null));};exports[_0x6e00('0x1b')]=function(_0x48e25b,_0x16e58e){if(_0x48e25b[_0x6e00('0x3e')]['id']){delete _0x48e25b['body']['id'];}return db[_0x6e00('0x23')][_0x6e00('0x3c')]({'where':{'id':_0x48e25b[_0x6e00('0x3f')]['id']}})['then'](handleEntityNotFound(_0x16e58e,null))[_0x6e00('0x1c')](saveUpdates(_0x48e25b[_0x6e00('0x3e')],null))['then'](respondWithResult(_0x16e58e,null))[_0x6e00('0x39')](handleError(_0x16e58e,null));};exports[_0x6e00('0x1d')]=function(_0x4a995e,_0x58d6c2){return db[_0x6e00('0x23')][_0x6e00('0x3c')]({'where':{'id':_0x4a995e[_0x6e00('0x3f')]['id']}})[_0x6e00('0x1c')](handleEntityNotFound(_0x58d6c2,null))['then'](removeEntity(_0x58d6c2,null))['catch'](handleError(_0x58d6c2,null));};exports['describe']=function(_0x16fe62,_0x431502){return db[_0x6e00('0x23')][_0x6e00('0x40')]()[_0x6e00('0x1c')](respondWithResult(_0x431502,null))[_0x6e00('0x39')](handleError(_0x431502,null));};
\ No newline at end of file
+var _0x05c9=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x5e0a09,_0x4ec565){var _0x4b31c6=function(_0x140cc5){while(--_0x140cc5){_0x5e0a09['push'](_0x5e0a09['shift']());}};_0x4b31c6(++_0x4ec565);}(_0x05c9,0x19f));var _0x905c=function(_0x4a6051,_0xf10b60){_0x4a6051=_0x4a6051-0x0;var _0x41ea0e=_0x05c9[_0x4a6051];return _0x41ea0e;};'use strict';var emlformat=require(_0x905c('0x0'));var rimraf=require(_0x905c('0x1'));var zipdir=require(_0x905c('0x2'));var jsonpatch=require(_0x905c('0x3'));var rp=require('request-promise');var moment=require(_0x905c('0x4'));var BPromise=require(_0x905c('0x5'));var Mustache=require(_0x905c('0x6'));var util=require(_0x905c('0x7'));var path=require('path');var sox=require(_0x905c('0x8'));var csv=require(_0x905c('0x9'));var ejs=require(_0x905c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x905c('0xb'));var crypto=require('crypto');var jsforce=require(_0x905c('0xc'));var deskjs=require(_0x905c('0xd'));var toCsv=require(_0x905c('0x9'));var querystring=require('querystring');var Papa=require(_0x905c('0xe'));var Redis=require(_0x905c('0xf'));var authService=require(_0x905c('0x10'));var qs=require(_0x905c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x905c('0x12'));var logger=require('../../config/logger')(_0x905c('0x13'));var utils=require(_0x905c('0x14'));var config=require(_0x905c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x905c('0x16'))['db'];function respondWithStatusCode(_0x1cf265,_0x381175){_0x381175=_0x381175||0xcc;return function(_0x5625a4){if(_0x5625a4){return _0x1cf265[_0x905c('0x17')](_0x381175);}return _0x1cf265[_0x905c('0x18')](_0x381175)['end']();};}function respondWithResult(_0x181de6,_0x8151f1){_0x8151f1=_0x8151f1||0xc8;return function(_0x127ae3){if(_0x127ae3){return _0x181de6[_0x905c('0x18')](_0x8151f1)[_0x905c('0x19')](_0x127ae3);}};}function respondWithFilteredResult(_0x24ef1f,_0x5ef435){return function(_0xf67539){if(_0xf67539){var _0x43fb41=typeof _0x5ef435['offset']===_0x905c('0x1a')&&typeof _0x5ef435['limit']==='undefined';var _0xe079b=_0xf67539['count'];var _0x24f926=_0x43fb41?0x0:_0x5ef435[_0x905c('0x1b')];var _0x2205d3=_0x43fb41?_0xf67539[_0x905c('0x1c')]:_0x5ef435['offset']+_0x5ef435[_0x905c('0x1d')];var _0x538444;if(_0x2205d3>=_0xe079b){_0x2205d3=_0xe079b;_0x538444=0xc8;}else{_0x538444=0xce;}_0x24ef1f['status'](_0x538444);return _0x24ef1f[_0x905c('0x1e')](_0x905c('0x1f'),_0x24f926+'-'+_0x2205d3+'/'+_0xe079b)[_0x905c('0x19')](_0xf67539);}return null;};}function patchUpdates(_0x1d4a21){return function(_0x5592e5){try{jsonpatch[_0x905c('0x20')](_0x5592e5,_0x1d4a21,!![]);}catch(_0x20926c){return BPromise[_0x905c('0x21')](_0x20926c);}return _0x5592e5[_0x905c('0x22')]();};}function saveUpdates(_0x2511df,_0x497816){return function(_0x3540c2){if(_0x3540c2){return _0x3540c2[_0x905c('0x23')](_0x2511df)[_0x905c('0x24')](function(_0x23f840){return _0x23f840;});}return null;};}function removeEntity(_0xa84b29,_0x20b372){return function(_0x7aae05){if(_0x7aae05){return _0x7aae05['destroy']()['then'](function(){_0xa84b29[_0x905c('0x18')](0xcc)[_0x905c('0x25')]();});}};}function handleEntityNotFound(_0x28dd9b,_0x424ddc){return function(_0x248422){if(!_0x248422){_0x28dd9b[_0x905c('0x17')](0x194);}return _0x248422;};}function handleError(_0x1c0afb,_0x277e2a){_0x277e2a=_0x277e2a||0x1f4;return function(_0x2be5de){logger[_0x905c('0x26')](_0x2be5de[_0x905c('0x27')]);if(_0x2be5de[_0x905c('0x28')]){delete _0x2be5de[_0x905c('0x28')];}_0x1c0afb[_0x905c('0x18')](_0x277e2a)[_0x905c('0x29')](_0x2be5de);};}exports[_0x905c('0x2a')]=function(_0x43202e,_0x29c920){var _0x45cf48={},_0x4b0647={},_0x41b384={'count':0x0,'rows':[]};var _0x4b0835=_[_0x905c('0x2b')](db[_0x905c('0x2c')][_0x905c('0x2d')],function(_0x101706){return{'name':_0x101706[_0x905c('0x2e')],'type':_0x101706['type'][_0x905c('0x2f')]};});_0x4b0647[_0x905c('0x30')]=_['map'](_0x4b0835,'name');_0x4b0647[_0x905c('0x31')]=_[_0x905c('0x32')](_0x43202e[_0x905c('0x31')]);_0x4b0647[_0x905c('0x33')]=_[_0x905c('0x34')](_0x4b0647[_0x905c('0x30')],_0x4b0647[_0x905c('0x31')]);_0x45cf48[_0x905c('0x35')]=_[_0x905c('0x34')](_0x4b0647[_0x905c('0x30')],qs[_0x905c('0x36')](_0x43202e[_0x905c('0x31')][_0x905c('0x36')]));_0x45cf48['attributes']=_0x45cf48['attributes'][_0x905c('0x37')]?_0x45cf48[_0x905c('0x35')]:_0x4b0647[_0x905c('0x30')];if(!_0x43202e[_0x905c('0x31')][_0x905c('0x38')]('nolimit')){_0x45cf48['limit']=qs['limit'](_0x43202e['query'][_0x905c('0x1d')]);_0x45cf48[_0x905c('0x1b')]=qs[_0x905c('0x1b')](_0x43202e[_0x905c('0x31')]['offset']);}_0x45cf48[_0x905c('0x39')]=qs[_0x905c('0x3a')](_0x43202e['query'][_0x905c('0x3a')]);_0x45cf48[_0x905c('0x3b')]=qs[_0x905c('0x33')](_[_0x905c('0x3c')](_0x43202e[_0x905c('0x31')],_0x4b0647[_0x905c('0x33')]),_0x4b0835);if(_0x43202e[_0x905c('0x31')][_0x905c('0x3d')]){_0x45cf48[_0x905c('0x3b')]=_[_0x905c('0x3e')](_0x45cf48[_0x905c('0x3b')],{'$or':_[_0x905c('0x2b')](_0x4b0835,function(_0x39e19a){if(_0x39e19a[_0x905c('0x3f')]!==_0x905c('0x40')){var _0x42fb2a={};_0x42fb2a[_0x39e19a['name']]={'$like':'%'+_0x43202e[_0x905c('0x31')][_0x905c('0x3d')]+'%'};return _0x42fb2a;}})});}_0x45cf48=_[_0x905c('0x3e')]({},_0x45cf48,_0x43202e[_0x905c('0x41')]);var _0xb34119={'where':_0x45cf48['where']};return db['MailSubstatus']['count'](_0xb34119)[_0x905c('0x24')](function(_0x3a7977){_0x41b384[_0x905c('0x1c')]=_0x3a7977;if(_0x43202e['query'][_0x905c('0x42')]){_0x45cf48[_0x905c('0x43')]=[{'all':!![]}];}return db['MailSubstatus'][_0x905c('0x44')](_0x45cf48);})[_0x905c('0x24')](function(_0x435bf7){_0x41b384[_0x905c('0x45')]=_0x435bf7;return _0x41b384;})[_0x905c('0x24')](respondWithFilteredResult(_0x29c920,_0x45cf48))[_0x905c('0x46')](handleError(_0x29c920,null));};exports[_0x905c('0x47')]=function(_0x37bb15,_0x17c55b){var _0x4d290a={'raw':!![],'where':{'id':_0x37bb15[_0x905c('0x48')]['id']}},_0x238baa={};_0x238baa['model']=_[_0x905c('0x32')](db[_0x905c('0x2c')]['rawAttributes']);_0x238baa[_0x905c('0x31')]=_[_0x905c('0x32')](_0x37bb15[_0x905c('0x31')]);_0x238baa['filters']=_[_0x905c('0x34')](_0x238baa[_0x905c('0x30')],_0x238baa[_0x905c('0x31')]);_0x4d290a[_0x905c('0x35')]=_['intersection'](_0x238baa[_0x905c('0x30')],qs[_0x905c('0x36')](_0x37bb15['query'][_0x905c('0x36')]));_0x4d290a[_0x905c('0x35')]=_0x4d290a[_0x905c('0x35')][_0x905c('0x37')]?_0x4d290a['attributes']:_0x238baa[_0x905c('0x30')];if(_0x37bb15['query'][_0x905c('0x42')]){_0x4d290a[_0x905c('0x43')]=[{'all':!![]}];}_0x4d290a=_[_0x905c('0x3e')]({},_0x4d290a,_0x37bb15['options']);return db[_0x905c('0x2c')][_0x905c('0x49')](_0x4d290a)[_0x905c('0x24')](handleEntityNotFound(_0x17c55b,null))[_0x905c('0x24')](respondWithResult(_0x17c55b,null))[_0x905c('0x46')](handleError(_0x17c55b,null));};exports[_0x905c('0x4a')]=function(_0x1ee39b,_0x3a8066){return db[_0x905c('0x2c')][_0x905c('0x4a')](_0x1ee39b['body'],{})[_0x905c('0x24')](respondWithResult(_0x3a8066,0xc9))[_0x905c('0x46')](handleError(_0x3a8066,null));};exports[_0x905c('0x23')]=function(_0xb45d40,_0x2d1e30){if(_0xb45d40[_0x905c('0x4b')]['id']){delete _0xb45d40[_0x905c('0x4b')]['id'];}return db['MailSubstatus'][_0x905c('0x49')]({'where':{'id':_0xb45d40['params']['id']}})['then'](handleEntityNotFound(_0x2d1e30,null))[_0x905c('0x24')](saveUpdates(_0xb45d40['body'],null))['then'](respondWithResult(_0x2d1e30,null))[_0x905c('0x46')](handleError(_0x2d1e30,null));};exports[_0x905c('0x4c')]=function(_0x5030b0,_0x317b4f){return db['MailSubstatus']['find']({'where':{'id':_0x5030b0['params']['id']}})[_0x905c('0x24')](handleEntityNotFound(_0x317b4f,null))[_0x905c('0x24')](removeEntity(_0x317b4f,null))[_0x905c('0x46')](handleError(_0x317b4f,null));};exports[_0x905c('0x4d')]=function(_0x1494b7,_0x517446){return db[_0x905c('0x2c')]['describe']()[_0x905c('0x24')](respondWithResult(_0x517446,null))['catch'](handleError(_0x517446,null));};
\ No newline at end of file
index c2c2c31..d8eef24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6374=['../../mysqldb','MailSubstatus','emit','hook','events'];(function(_0x3a1dbf,_0x7ff2e3){var _0xfe0bf=function(_0x544b8d){while(--_0x544b8d){_0x3a1dbf['push'](_0x3a1dbf['shift']());}};_0xfe0bf(++_0x7ff2e3);}(_0x6374,0x144));var _0x4637=function(_0x1b787,_0x2aa862){_0x1b787=_0x1b787-0x0;var _0x260555=_0x6374[_0x1b787];return _0x260555;};'use strict';var EventEmitter=require(_0x4637('0x0'));var MailSubstatus=require(_0x4637('0x1'))['db'][_0x4637('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x28b4a9){return function(_0x56132a,_0x2125fd,_0x31c302){MailSubstatusEvents[_0x4637('0x3')](_0x28b4a9+':'+_0x56132a['id'],_0x56132a);MailSubstatusEvents[_0x4637('0x3')](_0x28b4a9,_0x56132a);_0x31c302(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x4637('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
+var _0xf9f3=['update','hasOwnProperty','exports','events','../../mysqldb','MailSubstatus'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0xf9f3,0xb1));var _0x3f9f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf9f3[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0x3f9f('0x0'));var MailSubstatus=require(_0x3f9f('0x1'))['db'][_0x3f9f('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x3f9f('0x3')};function emitEvent(_0x582637){return function(_0x17f67c,_0x5c8f3b,_0x53f3cc){MailSubstatusEvents['emit'](_0x582637+':'+_0x17f67c['id'],_0x17f67c);MailSubstatusEvents['emit'](_0x582637,_0x17f67c);_0x53f3cc(null);};}for(var e in events){if(events[_0x3f9f('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x3f9f('0x5')]=MailSubstatusEvents;
\ No newline at end of file
index 6011049..3eceeb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d74=['exports','models','MailSubstatus','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x244f0b,_0x136eaf){var _0x5e168c=function(_0x51c880){while(--_0x51c880){_0x244f0b['push'](_0x244f0b['shift']());}};_0x5e168c(++_0x136eaf);}(_0x3d74,0x149));var _0x43d7=function(_0x375adc,_0x324e5a){_0x375adc=_0x375adc-0x0;var _0x2af5e4=_0x3d74[_0x375adc];return _0x2af5e4;};'use strict';var attributes=require(_0x43d7('0x0'));module[_0x43d7('0x1')]=function(_0xd71bd4){var _0xbbdf4b=_0xd71bd4[_0x43d7('0x2')];return _0xd71bd4['define'](_0x43d7('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x29534b,_0x5245c0,_0x503297){return _0xbbdf4b[_0x43d7('0x4')][_0x43d7('0x5')]({'value':_0x29534b[_0x43d7('0x6')]},{'where':{'field':_0x43d7('0x7'),'value':_0x29534b[_0x43d7('0x8')][_0x43d7('0x6')]}})[_0x43d7('0x9')](function(){_0x503297();})[_0x43d7('0xa')](function(_0x27a691){_0x503297(_0x27a691);});}}});};
\ No newline at end of file
+var _0x0feb=['models','define','MailSubstatus','mail_substatuses','name','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0x10874b,_0x5b0cca){var _0x567477=function(_0x3f33ef){while(--_0x3f33ef){_0x10874b['push'](_0x10874b['shift']());}};_0x567477(++_0x5b0cca);}(_0x0feb,0x6c));var _0xb0fe=function(_0x285611,_0x45b0df){_0x285611=_0x285611-0x0;var _0x2e593b=_0x0feb[_0x285611];return _0x2e593b;};'use strict';var attributes=require(_0xb0fe('0x0'));module[_0xb0fe('0x1')]=function(_0x3837fb){var _0x17cc3f=_0x3837fb[_0xb0fe('0x2')];return _0x3837fb[_0xb0fe('0x3')](_0xb0fe('0x4'),attributes,{'tableName':_0xb0fe('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x568df6,_0x37ad68,_0x2a4eab){return _0x17cc3f['Condition']['update']({'value':_0x568df6[_0xb0fe('0x6')]},{'where':{'field':'mailSubstatus','value':_0x568df6[_0xb0fe('0x7')]['name']}})[_0xb0fe('0x8')](function(){_0x2a4eab();})[_0xb0fe('0x9')](function(_0x25cb23){_0x2a4eab(_0x25cb23);});}}});};
\ No newline at end of file
index f83a053..78364be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x419fa1,_0x580e54){var _0x3f5ebf=function(_0x17a198){while(--_0x17a198){_0x419fa1['push'](_0x419fa1['shift']());}};_0x3f5ebf(++_0x580e54);}(_0xe5b5,0xd3));var _0x5e5b=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0xe5b5[_0x553150];return _0x18193d;};'use strict';var _=require('lodash');var util=require(_0x5e5b('0x0'));var moment=require(_0x5e5b('0x1'));var BPromise=require('bluebird');var rs=require(_0x5e5b('0x2'));var fs=require('fs');var Redis=require(_0x5e5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e5b('0x4'));var logger=require(_0x5e5b('0x5'))(_0x5e5b('0x6'));var config=require(_0x5e5b('0x7'));var jayson=require(_0x5e5b('0x8'));var client=jayson[_0x5e5b('0x9')][_0x5e5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e3375,_0x4e33ad,_0xd18b51){return new BPromise(function(_0x1a7773,_0x14abbe){return client[_0x5e5b('0xb')](_0x1e3375,_0xd18b51)[_0x5e5b('0xc')](function(_0x13e46b){logger[_0x5e5b('0xd')](_0x5e5b('0xe'),_0x4e33ad,'request\x20sent');logger['debug'](_0x5e5b('0xf'),_0x4e33ad,_0x5e5b('0x10'),JSON[_0x5e5b('0x11')](_0x13e46b));if(_0x13e46b[_0x5e5b('0x12')]){if(_0x13e46b[_0x5e5b('0x12')]['code']===0x1f4){logger['error'](_0x5e5b('0xe'),_0x4e33ad,_0x13e46b[_0x5e5b('0x12')]['message']);return _0x14abbe(_0x13e46b[_0x5e5b('0x12')][_0x5e5b('0x13')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x4e33ad,_0x13e46b['error'][_0x5e5b('0x13')]);return _0x1a7773(_0x13e46b[_0x5e5b('0x12')][_0x5e5b('0x13')]);}else{logger[_0x5e5b('0xd')](_0x5e5b('0xe'),_0x4e33ad,_0x5e5b('0x10'));_0x1a7773(_0x13e46b[_0x5e5b('0x14')][_0x5e5b('0x13')]);}})[_0x5e5b('0x15')](function(_0x5766d1){logger['error'](_0x5e5b('0xe'),_0x4e33ad,_0x5766d1);_0x14abbe(_0x5766d1);});});}
\ No newline at end of file
+var _0xc592=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2b07be,_0x1079c7){var _0x4ef850=function(_0x3495c8){while(--_0x3495c8){_0x2b07be['push'](_0x2b07be['shift']());}};_0x4ef850(++_0x1079c7);}(_0xc592,0x18c));var _0x2c59=function(_0x450e13,_0x1d6fb6){_0x450e13=_0x450e13-0x0;var _0x215fba=_0xc592[_0x450e13];return _0x215fba;};'use strict';var _=require(_0x2c59('0x0'));var util=require(_0x2c59('0x1'));var moment=require('moment');var BPromise=require(_0x2c59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c59('0x3'));var db=require(_0x2c59('0x4'))['db'];var utils=require(_0x2c59('0x5'));var logger=require(_0x2c59('0x6'))(_0x2c59('0x7'));var config=require(_0x2c59('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c59('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318aa0,_0x31ad44,_0x2b6877){return new BPromise(function(_0x1a19c2,_0xbc4374){return client['request'](_0x318aa0,_0x2b6877)['then'](function(_0x3d1556){logger[_0x2c59('0xa')](_0x2c59('0xb'),_0x31ad44,_0x2c59('0xc'));logger['debug'](_0x2c59('0xd'),_0x31ad44,_0x2c59('0xc'),JSON['stringify'](_0x3d1556));if(_0x3d1556[_0x2c59('0xe')]){if(_0x3d1556[_0x2c59('0xe')][_0x2c59('0xf')]===0x1f4){logger[_0x2c59('0xe')](_0x2c59('0xb'),_0x31ad44,_0x3d1556['error']['message']);return _0xbc4374(_0x3d1556[_0x2c59('0xe')]['message']);}logger[_0x2c59('0xe')](_0x2c59('0xb'),_0x31ad44,_0x3d1556[_0x2c59('0xe')][_0x2c59('0x10')]);return _0x1a19c2(_0x3d1556['error'][_0x2c59('0x10')]);}else{logger[_0x2c59('0xa')](_0x2c59('0xb'),_0x31ad44,_0x2c59('0xc'));_0x1a19c2(_0x3d1556[_0x2c59('0x11')][_0x2c59('0x10')]);}})['catch'](function(_0x20a003){logger[_0x2c59('0xe')](_0x2c59('0xb'),_0x31ad44,_0x20a003);_0xbc4374(_0x20a003);});});}
\ No newline at end of file
index dd7fc95..9e504d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03ec=['/describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index'];(function(_0x4fcf16,_0x2c952c){var _0x7cd20f=function(_0x20d8c3){while(--_0x20d8c3){_0x4fcf16['push'](_0x4fcf16['shift']());}};_0x7cd20f(++_0x2c952c);}(_0x03ec,0x112));var _0xc03e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x03ec[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc03e('0x0'));var util=require(_0xc03e('0x1'));var path=require('path');var timeout=require(_0xc03e('0x2'));var express=require(_0xc03e('0x3'));var router=express[_0xc03e('0x4')]();var fs_extra=require(_0xc03e('0x5'));var auth=require(_0xc03e('0x6'));var interaction=require(_0xc03e('0x7'));var config=require(_0xc03e('0x8'));var controller=require(_0xc03e('0x9'));router[_0xc03e('0xa')]('/',auth['isAuthenticated'](),controller[_0xc03e('0xb')]);router[_0xc03e('0xa')](_0xc03e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc03e('0xa')](_0xc03e('0xd'),auth[_0xc03e('0xe')](),controller['show']);router[_0xc03e('0xf')]('/',auth[_0xc03e('0xe')](),controller[_0xc03e('0x10')]);router[_0xc03e('0x11')](_0xc03e('0xd'),auth[_0xc03e('0xe')](),controller[_0xc03e('0x12')]);router[_0xc03e('0x13')](_0xc03e('0xd'),auth['isAuthenticated'](),controller[_0xc03e('0x14')]);module[_0xc03e('0x15')]=router;
\ No newline at end of file
+var _0xda48=['put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show','post'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xda48,0x1f2));var _0x8da4=function(_0x3e898c,_0x3cbc0d){_0x3e898c=_0x3e898c-0x0;var _0x42f71c=_0xda48[_0x3e898c];return _0x42f71c;};'use strict';var multer=require(_0x8da4('0x0'));var util=require(_0x8da4('0x1'));var path=require(_0x8da4('0x2'));var timeout=require(_0x8da4('0x3'));var express=require('express');var router=express[_0x8da4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8da4('0x5'));var interaction=require(_0x8da4('0x6'));var config=require(_0x8da4('0x7'));var controller=require(_0x8da4('0x8'));router[_0x8da4('0x9')]('/',auth[_0x8da4('0xa')](),controller['index']);router[_0x8da4('0x9')](_0x8da4('0xb'),auth['isAuthenticated'](),controller[_0x8da4('0xc')]);router[_0x8da4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8da4('0xd')]);router[_0x8da4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8da4('0xf')](_0x8da4('0x10'),auth[_0x8da4('0xa')](),controller[_0x8da4('0x11')]);router[_0x8da4('0x12')](_0x8da4('0x10'),auth[_0x8da4('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fd9bb31..301a99f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4b352f,_0x2c3ac1){var _0xb78495=function(_0x1d47df){while(--_0x1d47df){_0x4b352f['push'](_0x4b352f['shift']());}};_0xb78495(++_0x2c3ac1);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x56503a,_0x1c4b81){var _0x52e0d4=function(_0x4544d0){while(--_0x4544d0){_0x56503a['push'](_0x56503a['shift']());}};_0x52e0d4(++_0x1c4b81);}(_0x54ef,0x112));var _0xf54e=function(_0x52f35a,_0x565468){_0x52f35a=_0x52f35a-0x0;var _0x158341=_0x54ef[_0x52f35a];return _0x158341;};'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
index f1fa1e1..e6434af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c1=['find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','catch','show','params','keys','include'];(function(_0x5ab61c,_0x57bd09){var _0x1249c5=function(_0x3f9de8){while(--_0x3f9de8){_0x5ab61c['push'](_0x5ab61c['shift']());}};_0x1249c5(++_0x57bd09);}(_0x94c1,0x17c));var _0x194c=function(_0x37e743,_0x11a05b){_0x37e743=_0x37e743-0x0;var _0x5ea592=_0x94c1[_0x37e743];return _0x5ea592;};'use strict';var emlformat=require(_0x194c('0x0'));var rimraf=require(_0x194c('0x1'));var zipdir=require(_0x194c('0x2'));var jsonpatch=require(_0x194c('0x3'));var rp=require(_0x194c('0x4'));var moment=require(_0x194c('0x5'));var BPromise=require(_0x194c('0x6'));var Mustache=require(_0x194c('0x7'));var util=require(_0x194c('0x8'));var path=require(_0x194c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x194c('0xa'));var _=require(_0x194c('0xb'));var squel=require(_0x194c('0xc'));var crypto=require('crypto');var jsforce=require(_0x194c('0xd'));var deskjs=require(_0x194c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x194c('0xf'));var Redis=require(_0x194c('0x10'));var authService=require(_0x194c('0x11'));var qs=require(_0x194c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x194c('0x13'));var logger=require(_0x194c('0x14'))('api');var utils=require(_0x194c('0x15'));var config=require(_0x194c('0x16'));var licenseUtil=require(_0x194c('0x17'));var db=require(_0x194c('0x18'))['db'];function respondWithStatusCode(_0x3258e5,_0x1a694f){_0x1a694f=_0x1a694f||0xcc;return function(_0x1eaddb){if(_0x1eaddb){return _0x3258e5[_0x194c('0x19')](_0x1a694f);}return _0x3258e5['status'](_0x1a694f)[_0x194c('0x1a')]();};}function respondWithResult(_0x229080,_0x4d299a){_0x4d299a=_0x4d299a||0xc8;return function(_0x334f6f){if(_0x334f6f){return _0x229080['status'](_0x4d299a)[_0x194c('0x1b')](_0x334f6f);}};}function respondWithFilteredResult(_0x16b3f6,_0x1ccc2d){return function(_0x4de7fa){if(_0x4de7fa){var _0x1e529c=typeof _0x1ccc2d[_0x194c('0x1c')]===_0x194c('0x1d')&&typeof _0x1ccc2d[_0x194c('0x1e')]===_0x194c('0x1d');var _0x256912=_0x4de7fa['count'];var _0x35070b=_0x1e529c?0x0:_0x1ccc2d[_0x194c('0x1c')];var _0x2f28c8=_0x1e529c?_0x4de7fa[_0x194c('0x1f')]:_0x1ccc2d[_0x194c('0x1c')]+_0x1ccc2d['limit'];var _0x28d4d1;if(_0x2f28c8>=_0x256912){_0x2f28c8=_0x256912;_0x28d4d1=0xc8;}else{_0x28d4d1=0xce;}_0x16b3f6[_0x194c('0x20')](_0x28d4d1);return _0x16b3f6[_0x194c('0x21')](_0x194c('0x22'),_0x35070b+'-'+_0x2f28c8+'/'+_0x256912)[_0x194c('0x1b')](_0x4de7fa);}return null;};}function patchUpdates(_0x6c0495){return function(_0x3e71a3){try{jsonpatch[_0x194c('0x23')](_0x3e71a3,_0x6c0495,!![]);}catch(_0x2e5565){return BPromise[_0x194c('0x24')](_0x2e5565);}return _0x3e71a3[_0x194c('0x25')]();};}function saveUpdates(_0x3a83aa,_0x4f65a2){return function(_0x4dee68){if(_0x4dee68){return _0x4dee68[_0x194c('0x26')](_0x3a83aa)['then'](function(_0x872ed2){return _0x872ed2;});}return null;};}function removeEntity(_0x3a558f,_0x158233){return function(_0x794bb3){if(_0x794bb3){return _0x794bb3['destroy']()[_0x194c('0x27')](function(){_0x3a558f[_0x194c('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ad8f,_0x8a723e){return function(_0xb9a273){if(!_0xb9a273){_0x49ad8f[_0x194c('0x19')](0x194);}return _0xb9a273;};}function handleError(_0x30e477,_0x5c390f){_0x5c390f=_0x5c390f||0x1f4;return function(_0x4815eb){logger['error'](_0x4815eb[_0x194c('0x28')]);if(_0x4815eb[_0x194c('0x29')]){delete _0x4815eb[_0x194c('0x29')];}_0x30e477[_0x194c('0x20')](_0x5c390f)[_0x194c('0x2a')](_0x4815eb);};}exports[_0x194c('0x2b')]=function(_0x380464,_0x52f004){var _0x391e5f={},_0x10e4d7={},_0x3af76c={'count':0x0,'rows':[]};var _0x56f30b=_[_0x194c('0x2c')](db[_0x194c('0x2d')][_0x194c('0x2e')],function(_0x216ad6){return{'name':_0x216ad6[_0x194c('0x2f')],'type':_0x216ad6['type'][_0x194c('0x30')]};});_0x10e4d7[_0x194c('0x31')]=_[_0x194c('0x2c')](_0x56f30b,'name');_0x10e4d7[_0x194c('0x32')]=_['keys'](_0x380464[_0x194c('0x32')]);_0x10e4d7[_0x194c('0x33')]=_[_0x194c('0x34')](_0x10e4d7[_0x194c('0x31')],_0x10e4d7[_0x194c('0x32')]);_0x391e5f[_0x194c('0x35')]=_[_0x194c('0x34')](_0x10e4d7[_0x194c('0x31')],qs['fields'](_0x380464[_0x194c('0x32')][_0x194c('0x36')]));_0x391e5f[_0x194c('0x35')]=_0x391e5f[_0x194c('0x35')]['length']?_0x391e5f['attributes']:_0x10e4d7[_0x194c('0x31')];if(!_0x380464[_0x194c('0x32')][_0x194c('0x37')](_0x194c('0x38'))){_0x391e5f[_0x194c('0x1e')]=qs[_0x194c('0x1e')](_0x380464['query'][_0x194c('0x1e')]);_0x391e5f[_0x194c('0x1c')]=qs[_0x194c('0x1c')](_0x380464[_0x194c('0x32')][_0x194c('0x1c')]);}_0x391e5f[_0x194c('0x39')]=qs[_0x194c('0x3a')](_0x380464[_0x194c('0x32')]['sort']);_0x391e5f[_0x194c('0x3b')]=qs[_0x194c('0x33')](_[_0x194c('0x3c')](_0x380464[_0x194c('0x32')],_0x10e4d7[_0x194c('0x33')]),_0x56f30b);if(_0x380464['query'][_0x194c('0x3d')]){_0x391e5f[_0x194c('0x3b')]=_['merge'](_0x391e5f[_0x194c('0x3b')],{'$or':_[_0x194c('0x2c')](_0x56f30b,function(_0x23b1fc){if(_0x23b1fc['type']!==_0x194c('0x3e')){var _0x1f7e7a={};_0x1f7e7a[_0x23b1fc['name']]={'$like':'%'+_0x380464[_0x194c('0x32')][_0x194c('0x3d')]+'%'};return _0x1f7e7a;}})});}_0x391e5f=_['merge']({},_0x391e5f,_0x380464[_0x194c('0x3f')]);var _0x452b15={'where':_0x391e5f[_0x194c('0x3b')]};return db[_0x194c('0x2d')]['count'](_0x452b15)[_0x194c('0x27')](function(_0x58a3af){_0x3af76c[_0x194c('0x1f')]=_0x58a3af;if(_0x380464[_0x194c('0x32')][_0x194c('0x40')]){_0x391e5f['include']=[{'all':!![]}];}return db[_0x194c('0x2d')]['findAll'](_0x391e5f);})[_0x194c('0x27')](function(_0x1b8c85){_0x3af76c['rows']=_0x1b8c85;return _0x3af76c;})[_0x194c('0x27')](respondWithFilteredResult(_0x52f004,_0x391e5f))[_0x194c('0x41')](handleError(_0x52f004,null));};exports[_0x194c('0x42')]=function(_0x16d336,_0x4be02d){var _0x1b3c67={'raw':!![],'where':{'id':_0x16d336[_0x194c('0x43')]['id']}},_0x676057={};_0x676057['model']=_[_0x194c('0x44')](db[_0x194c('0x2d')][_0x194c('0x2e')]);_0x676057[_0x194c('0x32')]=_[_0x194c('0x44')](_0x16d336[_0x194c('0x32')]);_0x676057[_0x194c('0x33')]=_[_0x194c('0x34')](_0x676057[_0x194c('0x31')],_0x676057[_0x194c('0x32')]);_0x1b3c67[_0x194c('0x35')]=_[_0x194c('0x34')](_0x676057[_0x194c('0x31')],qs[_0x194c('0x36')](_0x16d336[_0x194c('0x32')][_0x194c('0x36')]));_0x1b3c67[_0x194c('0x35')]=_0x1b3c67['attributes']['length']?_0x1b3c67['attributes']:_0x676057['model'];if(_0x16d336['query'][_0x194c('0x40')]){_0x1b3c67[_0x194c('0x45')]=[{'all':!![]}];}_0x1b3c67=_['merge']({},_0x1b3c67,_0x16d336[_0x194c('0x3f')]);return db['MailTransferReport'][_0x194c('0x46')](_0x1b3c67)[_0x194c('0x27')](handleEntityNotFound(_0x4be02d,null))[_0x194c('0x27')](respondWithResult(_0x4be02d,null))[_0x194c('0x41')](handleError(_0x4be02d,null));};exports[_0x194c('0x47')]=function(_0x367cb2,_0x4a2788){return db[_0x194c('0x2d')][_0x194c('0x47')](_0x367cb2[_0x194c('0x48')],{})['then'](respondWithResult(_0x4a2788,0xc9))[_0x194c('0x41')](handleError(_0x4a2788,null));};exports[_0x194c('0x26')]=function(_0x5ec115,_0x1aa7d9){if(_0x5ec115[_0x194c('0x48')]['id']){delete _0x5ec115[_0x194c('0x48')]['id'];}return db[_0x194c('0x2d')][_0x194c('0x46')]({'where':{'id':_0x5ec115[_0x194c('0x43')]['id']}})[_0x194c('0x27')](handleEntityNotFound(_0x1aa7d9,null))[_0x194c('0x27')](saveUpdates(_0x5ec115['body'],null))[_0x194c('0x27')](respondWithResult(_0x1aa7d9,null))['catch'](handleError(_0x1aa7d9,null));};exports[_0x194c('0x49')]=function(_0xe85fec,_0x43d42c){return db[_0x194c('0x2d')][_0x194c('0x46')]({'where':{'id':_0xe85fec[_0x194c('0x43')]['id']}})[_0x194c('0x27')](handleEntityNotFound(_0x43d42c,null))[_0x194c('0x27')](removeEntity(_0x43d42c,null))[_0x194c('0x41')](handleError(_0x43d42c,null));};exports[_0x194c('0x4a')]=function(_0x4d66be,_0x21c099){return db[_0x194c('0x2d')]['describe']()['then'](respondWithResult(_0x21c099,null))[_0x194c('0x41')](handleError(_0x21c099,null));};
\ No newline at end of file
+var _0x823f=['findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x5b0144,_0x48dcce){var _0x17903f=function(_0x404099){while(--_0x404099){_0x5b0144['push'](_0x5b0144['shift']());}};_0x17903f(++_0x48dcce);}(_0x823f,0x98));var _0xf823=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x823f[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf823('0x0'));var zipdir=require(_0xf823('0x1'));var jsonpatch=require(_0xf823('0x2'));var rp=require(_0xf823('0x3'));var moment=require(_0xf823('0x4'));var BPromise=require(_0xf823('0x5'));var Mustache=require(_0xf823('0x6'));var util=require(_0xf823('0x7'));var path=require('path');var sox=require(_0xf823('0x8'));var csv=require(_0xf823('0x9'));var ejs=require(_0xf823('0xa'));var fs=require('fs');var fs_extra=require(_0xf823('0xb'));var _=require(_0xf823('0xc'));var squel=require('squel');var crypto=require(_0xf823('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf823('0xe'));var toCsv=require(_0xf823('0x9'));var querystring=require(_0xf823('0xf'));var Papa=require('papaparse');var Redis=require(_0xf823('0x10'));var authService=require(_0xf823('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf823('0x12'));var logger=require('../../config/logger')(_0xf823('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf823('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c7b6b,_0xe46ac0){_0xe46ac0=_0xe46ac0||0xcc;return function(_0x3d6136){if(_0x3d6136){return _0x1c7b6b['sendStatus'](_0xe46ac0);}return _0x1c7b6b[_0xf823('0x15')](_0xe46ac0)[_0xf823('0x16')]();};}function respondWithResult(_0x447db8,_0x2f18d6){_0x2f18d6=_0x2f18d6||0xc8;return function(_0x5ca5c5){if(_0x5ca5c5){return _0x447db8[_0xf823('0x15')](_0x2f18d6)[_0xf823('0x17')](_0x5ca5c5);}};}function respondWithFilteredResult(_0x447ec7,_0x382666){return function(_0x30d4aa){if(_0x30d4aa){var _0x15f1bf=typeof _0x382666['offset']===_0xf823('0x18')&&typeof _0x382666[_0xf823('0x19')]===_0xf823('0x18');var _0x289a02=_0x30d4aa[_0xf823('0x1a')];var _0x172243=_0x15f1bf?0x0:_0x382666[_0xf823('0x1b')];var _0x4176ce=_0x15f1bf?_0x30d4aa[_0xf823('0x1a')]:_0x382666[_0xf823('0x1b')]+_0x382666['limit'];var _0x2481f5;if(_0x4176ce>=_0x289a02){_0x4176ce=_0x289a02;_0x2481f5=0xc8;}else{_0x2481f5=0xce;}_0x447ec7[_0xf823('0x15')](_0x2481f5);return _0x447ec7['set']('Content-Range',_0x172243+'-'+_0x4176ce+'/'+_0x289a02)['json'](_0x30d4aa);}return null;};}function patchUpdates(_0x54cc9e){return function(_0xa43e6b){try{jsonpatch[_0xf823('0x1c')](_0xa43e6b,_0x54cc9e,!![]);}catch(_0x339c4d){return BPromise[_0xf823('0x1d')](_0x339c4d);}return _0xa43e6b[_0xf823('0x1e')]();};}function saveUpdates(_0x206c4b,_0x222920){return function(_0x266627){if(_0x266627){return _0x266627[_0xf823('0x1f')](_0x206c4b)[_0xf823('0x20')](function(_0x47bda0){return _0x47bda0;});}return null;};}function removeEntity(_0x3c7c6d,_0x160f4a){return function(_0x3cfb2e){if(_0x3cfb2e){return _0x3cfb2e[_0xf823('0x21')]()[_0xf823('0x20')](function(){_0x3c7c6d[_0xf823('0x15')](0xcc)[_0xf823('0x16')]();});}};}function handleEntityNotFound(_0x692769,_0x39667c){return function(_0x52ffb0){if(!_0x52ffb0){_0x692769['sendStatus'](0x194);}return _0x52ffb0;};}function handleError(_0x12f800,_0x256d62){_0x256d62=_0x256d62||0x1f4;return function(_0x11cf6f){logger[_0xf823('0x22')](_0x11cf6f[_0xf823('0x23')]);if(_0x11cf6f[_0xf823('0x24')]){delete _0x11cf6f[_0xf823('0x24')];}_0x12f800[_0xf823('0x15')](_0x256d62)['send'](_0x11cf6f);};}exports[_0xf823('0x25')]=function(_0x283117,_0x1ce6d8){var _0xeb084a={},_0x13428a={},_0x1826cb={'count':0x0,'rows':[]};var _0x377e94=_[_0xf823('0x26')](db[_0xf823('0x27')][_0xf823('0x28')],function(_0x56121d){return{'name':_0x56121d[_0xf823('0x29')],'type':_0x56121d[_0xf823('0x2a')]['key']};});_0x13428a[_0xf823('0x2b')]=_['map'](_0x377e94,_0xf823('0x24'));_0x13428a['query']=_[_0xf823('0x2c')](_0x283117[_0xf823('0x2d')]);_0x13428a[_0xf823('0x2e')]=_[_0xf823('0x2f')](_0x13428a[_0xf823('0x2b')],_0x13428a[_0xf823('0x2d')]);_0xeb084a[_0xf823('0x30')]=_[_0xf823('0x2f')](_0x13428a[_0xf823('0x2b')],qs[_0xf823('0x31')](_0x283117[_0xf823('0x2d')][_0xf823('0x31')]));_0xeb084a['attributes']=_0xeb084a[_0xf823('0x30')]['length']?_0xeb084a[_0xf823('0x30')]:_0x13428a[_0xf823('0x2b')];if(!_0x283117[_0xf823('0x2d')][_0xf823('0x32')](_0xf823('0x33'))){_0xeb084a[_0xf823('0x19')]=qs['limit'](_0x283117[_0xf823('0x2d')][_0xf823('0x19')]);_0xeb084a['offset']=qs[_0xf823('0x1b')](_0x283117[_0xf823('0x2d')][_0xf823('0x1b')]);}_0xeb084a[_0xf823('0x34')]=qs[_0xf823('0x35')](_0x283117['query'][_0xf823('0x35')]);_0xeb084a[_0xf823('0x36')]=qs[_0xf823('0x2e')](_[_0xf823('0x37')](_0x283117[_0xf823('0x2d')],_0x13428a[_0xf823('0x2e')]),_0x377e94);if(_0x283117[_0xf823('0x2d')][_0xf823('0x38')]){_0xeb084a[_0xf823('0x36')]=_[_0xf823('0x39')](_0xeb084a[_0xf823('0x36')],{'$or':_[_0xf823('0x26')](_0x377e94,function(_0x516777){if(_0x516777[_0xf823('0x2a')]!=='VIRTUAL'){var _0x416a86={};_0x416a86[_0x516777[_0xf823('0x24')]]={'$like':'%'+_0x283117[_0xf823('0x2d')][_0xf823('0x38')]+'%'};return _0x416a86;}})});}_0xeb084a=_[_0xf823('0x39')]({},_0xeb084a,_0x283117[_0xf823('0x3a')]);var _0x38b6ac={'where':_0xeb084a[_0xf823('0x36')]};return db[_0xf823('0x27')][_0xf823('0x1a')](_0x38b6ac)[_0xf823('0x20')](function(_0xce1a9){_0x1826cb['count']=_0xce1a9;if(_0x283117['query'][_0xf823('0x3b')]){_0xeb084a[_0xf823('0x3c')]=[{'all':!![]}];}return db[_0xf823('0x27')][_0xf823('0x3d')](_0xeb084a);})[_0xf823('0x20')](function(_0x18707a){_0x1826cb[_0xf823('0x3e')]=_0x18707a;return _0x1826cb;})[_0xf823('0x20')](respondWithFilteredResult(_0x1ce6d8,_0xeb084a))[_0xf823('0x3f')](handleError(_0x1ce6d8,null));};exports[_0xf823('0x40')]=function(_0xbc537d,_0x4db378){var _0x3f7971={'raw':!![],'where':{'id':_0xbc537d[_0xf823('0x41')]['id']}},_0x4e6589={};_0x4e6589[_0xf823('0x2b')]=_[_0xf823('0x2c')](db[_0xf823('0x27')][_0xf823('0x28')]);_0x4e6589[_0xf823('0x2d')]=_['keys'](_0xbc537d['query']);_0x4e6589[_0xf823('0x2e')]=_[_0xf823('0x2f')](_0x4e6589[_0xf823('0x2b')],_0x4e6589[_0xf823('0x2d')]);_0x3f7971[_0xf823('0x30')]=_[_0xf823('0x2f')](_0x4e6589[_0xf823('0x2b')],qs['fields'](_0xbc537d['query'][_0xf823('0x31')]));_0x3f7971['attributes']=_0x3f7971[_0xf823('0x30')][_0xf823('0x42')]?_0x3f7971[_0xf823('0x30')]:_0x4e6589['model'];if(_0xbc537d[_0xf823('0x2d')][_0xf823('0x3b')]){_0x3f7971[_0xf823('0x3c')]=[{'all':!![]}];}_0x3f7971=_['merge']({},_0x3f7971,_0xbc537d[_0xf823('0x3a')]);return db[_0xf823('0x27')][_0xf823('0x43')](_0x3f7971)[_0xf823('0x20')](handleEntityNotFound(_0x4db378,null))['then'](respondWithResult(_0x4db378,null))['catch'](handleError(_0x4db378,null));};exports[_0xf823('0x44')]=function(_0x428bb4,_0x41d4ab){return db['MailTransferReport'][_0xf823('0x44')](_0x428bb4[_0xf823('0x45')],{})[_0xf823('0x20')](respondWithResult(_0x41d4ab,0xc9))['catch'](handleError(_0x41d4ab,null));};exports[_0xf823('0x1f')]=function(_0x59b94a,_0x20c965){if(_0x59b94a[_0xf823('0x45')]['id']){delete _0x59b94a[_0xf823('0x45')]['id'];}return db[_0xf823('0x27')]['find']({'where':{'id':_0x59b94a[_0xf823('0x41')]['id']}})[_0xf823('0x20')](handleEntityNotFound(_0x20c965,null))[_0xf823('0x20')](saveUpdates(_0x59b94a[_0xf823('0x45')],null))[_0xf823('0x20')](respondWithResult(_0x20c965,null))[_0xf823('0x3f')](handleError(_0x20c965,null));};exports[_0xf823('0x21')]=function(_0x135fbc,_0x3c46fb){return db['MailTransferReport'][_0xf823('0x43')]({'where':{'id':_0x135fbc[_0xf823('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c46fb,null))[_0xf823('0x20')](removeEntity(_0x3c46fb,null))[_0xf823('0x3f')](handleError(_0x3c46fb,null));};exports[_0xf823('0x46')]=function(_0x5361d0,_0x2f8a92){return db[_0xf823('0x27')][_0xf823('0x46')]()['then'](respondWithResult(_0x2f8a92,null))[_0xf823('0x3f')](handleError(_0x2f8a92,null));};
\ No newline at end of file
index ff7830a..0ca4739 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5ec=['request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x22c3e7,_0x59b5d3){var _0x284f6d=function(_0x3c0060){while(--_0x3c0060){_0x22c3e7['push'](_0x22c3e7['shift']());}};_0x284f6d(++_0x59b5d3);}(_0xb5ec,0x97));var _0xcb5e=function(_0x31eb95,_0x2c2330){_0x31eb95=_0x31eb95-0x0;var _0x55d8c9=_0xb5ec[_0x31eb95];return _0x55d8c9;};'use strict';var _=require(_0xcb5e('0x0'));var util=require(_0xcb5e('0x1'));var logger=require(_0xcb5e('0x2'))(_0xcb5e('0x3'));var moment=require('moment');var BPromise=require(_0xcb5e('0x4'));var rp=require(_0xcb5e('0x5'));var fs=require('fs');var path=require(_0xcb5e('0x6'));var rimraf=require('rimraf');var config=require(_0xcb5e('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xcb5e('0x8')]=function(_0xfbd838,_0x38fd3e){return _0xfbd838[_0xcb5e('0x9')](_0xcb5e('0xa'),attributes,{'tableName':_0xcb5e('0xb'),'paranoid':![],'indexes':[{'name':_0xcb5e('0xc'),'fields':[_0xcb5e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d99=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x10e650,_0x4f367a){var _0x61a2a8=function(_0x5ed205){while(--_0x5ed205){_0x10e650['push'](_0x10e650['shift']());}};_0x61a2a8(++_0x4f367a);}(_0x1d99,0xaa));var _0x91d9=function(_0x1f84f3,_0x3f8137){_0x1f84f3=_0x1f84f3-0x0;var _0x4c912c=_0x1d99[_0x1f84f3];return _0x4c912c;};'use strict';var _=require(_0x91d9('0x0'));var util=require(_0x91d9('0x1'));var logger=require(_0x91d9('0x2'))('api');var moment=require(_0x91d9('0x3'));var BPromise=require(_0x91d9('0x4'));var rp=require(_0x91d9('0x5'));var fs=require('fs');var path=require(_0x91d9('0x6'));var rimraf=require(_0x91d9('0x7'));var config=require('../../config/environment');var attributes=require(_0x91d9('0x8'));module[_0x91d9('0x9')]=function(_0x10f31b,_0x57a450){return _0x10f31b[_0x91d9('0xa')](_0x91d9('0xb'),attributes,{'tableName':_0x91d9('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x91d9('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 814ff88..10b54bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e4=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','ioredis'];(function(_0x5db27a,_0x20f71a){var _0x20de06=function(_0x276081){while(--_0x276081){_0x5db27a['push'](_0x5db27a['shift']());}};_0x20de06(++_0x20f71a);}(_0x28e4,0x1b2));var _0x428e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x428e('0x0'));var util=require(_0x428e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x428e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x428e('0x3'));var logger=require(_0x428e('0x4'))('rpc');var config=require(_0x428e('0x5'));var jayson=require(_0x428e('0x6'));var client=jayson[_0x428e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5216,_0x155d69,_0x598fcb){return new BPromise(function(_0x577c08,_0x237a1c){return client['request'](_0x3a5216,_0x598fcb)[_0x428e('0x8')](function(_0xd9c7c5){logger[_0x428e('0x9')]('MailTransferReport,\x20%s,\x20%s',_0x155d69,'request\x20sent');logger[_0x428e('0xa')](_0x428e('0xb'),_0x155d69,_0x428e('0xc'),JSON[_0x428e('0xd')](_0xd9c7c5));if(_0xd9c7c5[_0x428e('0xe')]){if(_0xd9c7c5[_0x428e('0xe')][_0x428e('0xf')]===0x1f4){logger['error'](_0x428e('0x10'),_0x155d69,_0xd9c7c5[_0x428e('0xe')]['message']);return _0x237a1c(_0xd9c7c5[_0x428e('0xe')]['message']);}logger[_0x428e('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x155d69,_0xd9c7c5[_0x428e('0xe')][_0x428e('0x11')]);return _0x577c08(_0xd9c7c5[_0x428e('0xe')][_0x428e('0x11')]);}else{logger[_0x428e('0x9')](_0x428e('0x10'),_0x155d69,_0x428e('0xc'));_0x577c08(_0xd9c7c5['result']['message']);}})[_0x428e('0x12')](function(_0x353127){logger['error'](_0x428e('0x10'),_0x155d69,_0x353127);_0x237a1c(_0x353127);});});}
\ No newline at end of file
+var _0xc522=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0xc522,0x1cd));var _0x2c52=function(_0x215f75,_0x3aeabd){_0x215f75=_0x215f75-0x0;var _0x428eb7=_0xc522[_0x215f75];return _0x428eb7;};'use strict';var _=require(_0x2c52('0x0'));var util=require(_0x2c52('0x1'));var moment=require(_0x2c52('0x2'));var BPromise=require(_0x2c52('0x3'));var rs=require(_0x2c52('0x4'));var fs=require('fs');var Redis=require(_0x2c52('0x5'));var db=require(_0x2c52('0x6'))['db'];var utils=require(_0x2c52('0x7'));var logger=require(_0x2c52('0x8'))('rpc');var config=require(_0x2c52('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2c52('0xa')][_0x2c52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435fe8,_0x2f4e03,_0x574e78){return new BPromise(function(_0x277adf,_0x5253d6){return client[_0x2c52('0xc')](_0x435fe8,_0x574e78)[_0x2c52('0xd')](function(_0x9029d5){logger['info'](_0x2c52('0xe'),_0x2f4e03,'request\x20sent');logger[_0x2c52('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2f4e03,_0x2c52('0x10'),JSON[_0x2c52('0x11')](_0x9029d5));if(_0x9029d5[_0x2c52('0x12')]){if(_0x9029d5['error'][_0x2c52('0x13')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2f4e03,_0x9029d5['error'][_0x2c52('0x14')]);return _0x5253d6(_0x9029d5['error']['message']);}logger[_0x2c52('0x12')](_0x2c52('0xe'),_0x2f4e03,_0x9029d5['error'][_0x2c52('0x14')]);return _0x277adf(_0x9029d5['error'][_0x2c52('0x14')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2f4e03,_0x2c52('0x10'));_0x277adf(_0x9029d5[_0x2c52('0x15')][_0x2c52('0x14')]);}})[_0x2c52('0x16')](function(_0x30681b){logger[_0x2c52('0x12')](_0x2c52('0xe'),_0x2f4e03,_0x30681b);_0x5253d6(_0x30681b);});});}
\ No newline at end of file
index 137b8b2..4d03773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ed=['show','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0x36ed,0x1c5));var _0xd36e=function(_0xd73c2e,_0x10dd87){_0xd73c2e=_0xd73c2e-0x0;var _0x3a4508=_0x36ed[_0xd73c2e];return _0x3a4508;};'use strict';var multer=require(_0xd36e('0x0'));var util=require(_0xd36e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd36e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd36e('0x3'));var interaction=require(_0xd36e('0x4'));var config=require(_0xd36e('0x5'));var controller=require(_0xd36e('0x6'));router[_0xd36e('0x7')]('/',auth[_0xd36e('0x8')](),controller[_0xd36e('0x9')]);router[_0xd36e('0x7')]('/describe',auth[_0xd36e('0x8')](),controller[_0xd36e('0xa')]);router[_0xd36e('0x7')](_0xd36e('0xb'),auth[_0xd36e('0x8')](),controller[_0xd36e('0xc')]);router['post']('/',auth[_0xd36e('0x8')](),controller['create']);router['put'](_0xd36e('0xb'),auth[_0xd36e('0x8')](),controller['update']);router[_0xd36e('0xd')](_0xd36e('0xb'),auth[_0xd36e('0x8')](),controller['destroy']);module[_0xd36e('0xe')]=router;
\ No newline at end of file
+var _0x9f21=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x9f21,0x166));var _0x19f2=function(_0x4660b9,_0x172664){_0x4660b9=_0x4660b9-0x0;var _0x3d0b6b=_0x9f21[_0x4660b9];return _0x3d0b6b;};'use strict';var multer=require(_0x19f2('0x0'));var util=require(_0x19f2('0x1'));var path=require(_0x19f2('0x2'));var timeout=require(_0x19f2('0x3'));var express=require(_0x19f2('0x4'));var router=express[_0x19f2('0x5')]();var fs_extra=require(_0x19f2('0x6'));var auth=require(_0x19f2('0x7'));var interaction=require(_0x19f2('0x8'));var config=require(_0x19f2('0x9'));var controller=require(_0x19f2('0xa'));router['get']('/',auth[_0x19f2('0xb')](),controller[_0x19f2('0xc')]);router[_0x19f2('0xd')](_0x19f2('0xe'),auth[_0x19f2('0xb')](),controller[_0x19f2('0xf')]);router[_0x19f2('0xd')](_0x19f2('0x10'),auth[_0x19f2('0xb')](),controller[_0x19f2('0x11')]);router[_0x19f2('0x12')]('/',auth[_0x19f2('0xb')](),controller[_0x19f2('0x13')]);router[_0x19f2('0x14')]('/:id',auth[_0x19f2('0xb')](),controller['update']);router[_0x19f2('0x15')](_0x19f2('0x10'),auth[_0x19f2('0xb')](),controller[_0x19f2('0x16')]);module[_0x19f2('0x17')]=router;
\ No newline at end of file
index 41867d6..de74027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0a4=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[queue]','sequelize','exports'];(function(_0x1adf69,_0x19a50f){var _0x2e13dd=function(_0xf88d4f){while(--_0xf88d4f){_0x1adf69['push'](_0x1adf69['shift']());}};_0x2e13dd(++_0x19a50f);}(_0xc0a4,0x11b));var _0x4c0a=function(_0xfc88e5,_0x36cd00){_0xfc88e5=_0xfc88e5-0x0;var _0x10b302=_0xc0a4[_0xfc88e5];return _0x10b302;};'use strict';var Sequelize=require(_0x4c0a('0x0'));var moment=require('moment');module[_0x4c0a('0x1')]={'channel':{'type':Sequelize[_0x4c0a('0x2')]},'membername':{'type':Sequelize[_0x4c0a('0x2')]},'interface':{'type':Sequelize[_0x4c0a('0x2')]},'type':{'type':Sequelize[_0x4c0a('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x4c0a('0x3')},'duration':{'type':Sequelize[_0x4c0a('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4c0a('0x5')],'set':function(_0x277196){var _0x174a43=moment(_0x277196);var _0x1a2c79=moment(this[_0x4c0a('0x6')](_0x4c0a('0x7')));var _0x5da096=_0x174a43[_0x4c0a('0x8')](_0x1a2c79,_0x4c0a('0x9'));this[_0x4c0a('0xa')](_0x4c0a('0xb'),_0x277196);this[_0x4c0a('0xa')](_0x4c0a('0xc'),_0x5da096>=0x0?_0x5da096:null);}},'data1':{'type':Sequelize[_0x4c0a('0x2')],'comment':_0x4c0a('0xd')},'data2':{'type':Sequelize[_0x4c0a('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x4c0a('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x4c0a('0x2')],'comment':_0x4c0a('0xe')},'role':{'type':Sequelize[_0x4c0a('0x2')]},'internal':{'type':Sequelize[_0x4c0a('0x4')]},'uniqueid':{'type':Sequelize[_0x4c0a('0x2')]}};
\ No newline at end of file
+var _0x3253=['LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','moment','exports','STRING'];(function(_0x4dc4bd,_0x490bf0){var _0x22a362=function(_0x1512b1){while(--_0x1512b1){_0x4dc4bd['push'](_0x4dc4bd['shift']());}};_0x22a362(++_0x490bf0);}(_0x3253,0xc9));var _0x3325=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x3253[_0x1d1219];return _0x5b5b89;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3325('0x0'));module[_0x3325('0x1')]={'channel':{'type':Sequelize[_0x3325('0x2')]},'membername':{'type':Sequelize[_0x3325('0x2')]},'interface':{'type':Sequelize[_0x3325('0x2')]},'type':{'type':Sequelize[_0x3325('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x3325('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x3325('0x4')]},'exitAt':{'type':Sequelize[_0x3325('0x4')],'set':function(_0x3dac15){var _0x1d84b4=moment(_0x3dac15);var _0x417571=moment(this[_0x3325('0x5')](_0x3325('0x6')));var _0x15d91a=_0x1d84b4[_0x3325('0x7')](_0x417571,_0x3325('0x8'));this[_0x3325('0x9')](_0x3325('0xa'),_0x3dac15);this[_0x3325('0x9')](_0x3325('0xb'),_0x15d91a>=0x0?_0x15d91a:null);}},'data1':{'type':Sequelize[_0x3325('0x2')],'comment':_0x3325('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x3325('0xd')},'data3':{'type':Sequelize[_0x3325('0x2')],'comment':_0x3325('0xe')},'data4':{'type':Sequelize[_0x3325('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x3325('0x2')],'comment':_0x3325('0xf')},'role':{'type':Sequelize[_0x3325('0x2')]},'internal':{'type':Sequelize[_0x3325('0x10')]},'uniqueid':{'type':Sequelize[_0x3325('0x2')]}};
\ No newline at end of file
index 52ae845..0da20ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x59ff01,_0x295452){var _0x16cf73=function(_0x1243fe){while(--_0x1243fe){_0x59ff01['push'](_0x59ff01['shift']());}};_0x16cf73(++_0x295452);}(_0x008c,0x188));var _0xc008=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x008c[_0x3df3c6];return _0x254c43;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));};
\ No newline at end of file
+var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x1fd0b0,_0x28626c){var _0x5df9d3=function(_0x5cb49a){while(--_0x5cb49a){_0x1fd0b0['push'](_0x1fd0b0['shift']());}};_0x5df9d3(++_0x28626c);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));};
\ No newline at end of file
index f4d9364..a935843 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e08=['api','moment','bluebird','path','rimraf','define','membername_interface','membername','interface','util'];(function(_0x4e2482,_0x455f99){var _0x1a66af=function(_0x38bc34){while(--_0x38bc34){_0x4e2482['push'](_0x4e2482['shift']());}};_0x1a66af(++_0x455f99);}(_0x8e08,0xf9));var _0x88e0=function(_0x4afdd7,_0x2f3876){_0x4afdd7=_0x4afdd7-0x0;var _0x4af7bd=_0x8e08[_0x4afdd7];return _0x4af7bd;};'use strict';var _=require('lodash');var util=require(_0x88e0('0x0'));var logger=require('../../config/logger')(_0x88e0('0x1'));var moment=require(_0x88e0('0x2'));var BPromise=require(_0x88e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88e0('0x4'));var rimraf=require(_0x88e0('0x5'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x3f3c31,_0x455c61){return _0x3f3c31[_0x88e0('0x6')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x88e0('0x7'),'fields':[_0x88e0('0x8'),_0x88e0('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd482=['interface','lodash','util','bluebird','path','rimraf','./memberReport.attributes','exports','MemberReport','report_member','membername'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd482,0x156));var _0x2d48=function(_0x5f0a52,_0x2768ae){_0x5f0a52=_0x5f0a52-0x0;var _0x582312=_0xd482[_0x5f0a52];return _0x582312;};'use strict';var _=require(_0x2d48('0x0'));var util=require(_0x2d48('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2d48('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d48('0x3'));var rimraf=require(_0x2d48('0x4'));var config=require('../../config/environment');var attributes=require(_0x2d48('0x5'));module[_0x2d48('0x6')]=function(_0x54ae83,_0x336264){return _0x54ae83['define'](_0x2d48('0x7'),attributes,{'tableName':_0x2d48('0x8'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x2d48('0x9'),_0x2d48('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 473cd03..d56979b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ca=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','MemberReport','options','raw','where','limit','map','include','attributes','model','GetMemberReport','debug','CreateMemberReport','create','body','UpdateMemberReport','update','lodash'];(function(_0x2bf557,_0x1ea4ba){var _0x55f6c2=function(_0x34b6f9){while(--_0x34b6f9){_0x2bf557['push'](_0x2bf557['shift']());}};_0x55f6c2(++_0x1ea4ba);}(_0x02ca,0x97));var _0xa02c=function(_0x2d418c,_0x46bdec){_0x2d418c=_0x2d418c-0x0;var _0x5528e1=_0x02ca[_0x2d418c];return _0x5528e1;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var moment=require(_0xa02c('0x1'));var BPromise=require(_0xa02c('0x2'));var rs=require(_0xa02c('0x3'));var fs=require('fs');var Redis=require(_0xa02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa02c('0x5'));var logger=require(_0xa02c('0x6'))(_0xa02c('0x7'));var config=require(_0xa02c('0x8'));var jayson=require(_0xa02c('0x9'));var client=jayson[_0xa02c('0xa')][_0xa02c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c64a,_0x2c87ec,_0x2b96c5){return new BPromise(function(_0x4033b9,_0x4dd173){return client[_0xa02c('0xc')](_0x29c64a,_0x2b96c5)[_0xa02c('0xd')](function(_0x203db6){logger[_0xa02c('0xe')](_0xa02c('0xf'),_0x2c87ec,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x2c87ec,'request\x20sent',JSON[_0xa02c('0x10')](_0x203db6));if(_0x203db6[_0xa02c('0x11')]){if(_0x203db6[_0xa02c('0x11')][_0xa02c('0x12')]===0x1f4){logger['error'](_0xa02c('0xf'),_0x2c87ec,_0x203db6[_0xa02c('0x11')][_0xa02c('0x13')]);return _0x4dd173(_0x203db6[_0xa02c('0x11')]['message']);}logger[_0xa02c('0x11')](_0xa02c('0xf'),_0x2c87ec,_0x203db6[_0xa02c('0x11')]['message']);return _0x4033b9(_0x203db6[_0xa02c('0x11')][_0xa02c('0x13')]);}else{logger['info'](_0xa02c('0xf'),_0x2c87ec,_0xa02c('0x14'));_0x4033b9(_0x203db6['result'][_0xa02c('0x13')]);}})[_0xa02c('0x15')](function(_0x2db206){logger['error'](_0xa02c('0xf'),_0x2c87ec,_0x2db206);_0x4dd173(_0x2db206);});});}exports['GetMemberReport']=function(_0x4d7cb5){var _0x592de1=this;return new Promise(function(_0x3fcc66,_0x10df83){return db[_0xa02c('0x16')]['findAll']({'raw':_0x4d7cb5[_0xa02c('0x17')]?_0x4d7cb5['options'][_0xa02c('0x18')]===undefined?!![]:![]:!![],'where':_0x4d7cb5[_0xa02c('0x17')]?_0x4d7cb5[_0xa02c('0x17')][_0xa02c('0x19')]||null:null,'attributes':_0x4d7cb5['options']?_0x4d7cb5[_0xa02c('0x17')]['attributes']||null:null,'limit':_0x4d7cb5[_0xa02c('0x17')]?_0x4d7cb5[_0xa02c('0x17')][_0xa02c('0x1a')]||null:null,'include':_0x4d7cb5['options']?_0x4d7cb5['options']['include']?_[_0xa02c('0x1b')](_0x4d7cb5[_0xa02c('0x17')][_0xa02c('0x1c')],function(_0x514ef1){return{'model':db[_0x514ef1['model']],'as':_0x514ef1['as'],'attributes':_0x514ef1[_0xa02c('0x1d')],'include':_0x514ef1[_0xa02c('0x1c')]?_[_0xa02c('0x1b')](_0x514ef1[_0xa02c('0x1c')],function(_0x437308){return{'model':db[_0x437308['model']],'as':_0x437308['as'],'attributes':_0x437308['attributes'],'include':_0x437308[_0xa02c('0x1c')]?_[_0xa02c('0x1b')](_0x437308[_0xa02c('0x1c')],function(_0x39124e){return{'model':db[_0x39124e[_0xa02c('0x1e')]],'as':_0x39124e['as'],'attributes':_0x39124e[_0xa02c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa02c('0xd')](function(_0x419037){logger['info'](_0xa02c('0x1f'),_0x4d7cb5);logger[_0xa02c('0x20')](_0xa02c('0x1f'),_0x4d7cb5,JSON[_0xa02c('0x10')](_0x419037));_0x3fcc66(_0x419037);})[_0xa02c('0x15')](function(_0x402f72){logger[_0xa02c('0x11')](_0xa02c('0x1f'),_0x402f72[_0xa02c('0x13')],_0x4d7cb5);_0x10df83(_0x592de1['error'](0x1f4,_0x402f72[_0xa02c('0x13')]));});});};exports[_0xa02c('0x21')]=function(_0x279410){var _0x4de1ac=this;return new Promise(function(_0x58542a,_0x186fe9){return db[_0xa02c('0x16')][_0xa02c('0x22')](_0x279410[_0xa02c('0x23')],{'raw':_0x279410[_0xa02c('0x17')]?_0x279410[_0xa02c('0x17')][_0xa02c('0x18')]===undefined?!![]:![]:!![]})[_0xa02c('0xd')](function(_0x254124){logger[_0xa02c('0xe')]('CreateMemberReport',_0x279410);logger['debug'](_0xa02c('0x21'),_0x279410,JSON[_0xa02c('0x10')](_0x254124));_0x58542a(_0x254124);})[_0xa02c('0x15')](function(_0x3b93fb){logger[_0xa02c('0x11')](_0xa02c('0x21'),_0x3b93fb[_0xa02c('0x13')],_0x279410);_0x186fe9(_0x4de1ac[_0xa02c('0x11')](0x1f4,_0x3b93fb[_0xa02c('0x13')]));});});};exports[_0xa02c('0x24')]=function(_0x2ec390){var _0x4abc4d=this;return new Promise(function(_0x356095,_0x42f238){return db[_0xa02c('0x16')][_0xa02c('0x25')](_0x2ec390['body'],{'raw':_0x2ec390['options']?_0x2ec390[_0xa02c('0x17')][_0xa02c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ec390['options']?_0x2ec390['options']['where']||null:null,'attributes':_0x2ec390['options']?_0x2ec390[_0xa02c('0x17')][_0xa02c('0x1d')]||null:null,'limit':_0x2ec390[_0xa02c('0x17')]?_0x2ec390[_0xa02c('0x17')]['limit']||null:null})[_0xa02c('0xd')](function(_0x281455){logger[_0xa02c('0xe')](_0xa02c('0x24'),_0x2ec390);logger[_0xa02c('0x20')](_0xa02c('0x24'),_0x2ec390,JSON[_0xa02c('0x10')](_0x281455));_0x356095(_0x281455);})[_0xa02c('0x15')](function(_0x520764){logger['error'](_0xa02c('0x24'),_0x520764[_0xa02c('0x13')],_0x2ec390);_0x42f238(_0x4abc4d[_0xa02c('0x11')](0x1f4,_0x520764[_0xa02c('0x13')]));});});};
\ No newline at end of file
+var _0x6f72=['rpc','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','catch','CreateMemberReport','body','UpdateMemberReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6f72,0xae));var _0x26f7=function(_0x113324,_0x273ee0){_0x113324=_0x113324-0x0;var _0x29604d=_0x6f72[_0x113324];return _0x29604d;};'use strict';var _=require('lodash');var util=require(_0x26f7('0x0'));var moment=require(_0x26f7('0x1'));var BPromise=require(_0x26f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26f7('0x3'));var db=require(_0x26f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x26f7('0x5'))(_0x26f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x26f7('0x7'));var client=jayson['client'][_0x26f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x529e3f,_0x36ea93,_0x21de0c){return new BPromise(function(_0x4db9d0,_0x57d0f2){return client[_0x26f7('0x9')](_0x529e3f,_0x21de0c)[_0x26f7('0xa')](function(_0x169b61){logger[_0x26f7('0xb')](_0x26f7('0xc'),_0x36ea93,_0x26f7('0xd'));logger[_0x26f7('0xe')](_0x26f7('0xf'),_0x36ea93,'request\x20sent',JSON[_0x26f7('0x10')](_0x169b61));if(_0x169b61['error']){if(_0x169b61[_0x26f7('0x11')][_0x26f7('0x12')]===0x1f4){logger[_0x26f7('0x11')](_0x26f7('0xc'),_0x36ea93,_0x169b61[_0x26f7('0x11')][_0x26f7('0x13')]);return _0x57d0f2(_0x169b61[_0x26f7('0x11')][_0x26f7('0x13')]);}logger[_0x26f7('0x11')](_0x26f7('0xc'),_0x36ea93,_0x169b61[_0x26f7('0x11')][_0x26f7('0x13')]);return _0x4db9d0(_0x169b61['error'][_0x26f7('0x13')]);}else{logger[_0x26f7('0xb')](_0x26f7('0xc'),_0x36ea93,_0x26f7('0xd'));_0x4db9d0(_0x169b61['result'][_0x26f7('0x13')]);}})['catch'](function(_0xd1b95d){logger[_0x26f7('0x11')](_0x26f7('0xc'),_0x36ea93,_0xd1b95d);_0x57d0f2(_0xd1b95d);});});}exports[_0x26f7('0x14')]=function(_0x528786){var _0x491518=this;return new Promise(function(_0x3b48b6,_0x49b3de){return db[_0x26f7('0x15')][_0x26f7('0x16')]({'raw':_0x528786[_0x26f7('0x17')]?_0x528786[_0x26f7('0x17')][_0x26f7('0x18')]===undefined?!![]:![]:!![],'where':_0x528786[_0x26f7('0x17')]?_0x528786[_0x26f7('0x17')][_0x26f7('0x19')]||null:null,'attributes':_0x528786[_0x26f7('0x17')]?_0x528786[_0x26f7('0x17')]['attributes']||null:null,'limit':_0x528786[_0x26f7('0x17')]?_0x528786[_0x26f7('0x17')][_0x26f7('0x1a')]||null:null,'include':_0x528786[_0x26f7('0x17')]?_0x528786[_0x26f7('0x17')][_0x26f7('0x1b')]?_[_0x26f7('0x1c')](_0x528786[_0x26f7('0x17')][_0x26f7('0x1b')],function(_0x3c5216){return{'model':db[_0x3c5216[_0x26f7('0x1d')]],'as':_0x3c5216['as'],'attributes':_0x3c5216['attributes'],'include':_0x3c5216[_0x26f7('0x1b')]?_['map'](_0x3c5216['include'],function(_0x46fedb){return{'model':db[_0x46fedb[_0x26f7('0x1d')]],'as':_0x46fedb['as'],'attributes':_0x46fedb[_0x26f7('0x1e')],'include':_0x46fedb[_0x26f7('0x1b')]?_[_0x26f7('0x1c')](_0x46fedb['include'],function(_0x337eee){return{'model':db[_0x337eee[_0x26f7('0x1d')]],'as':_0x337eee['as'],'attributes':_0x337eee[_0x26f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x26f7('0xa')](function(_0x2ef05c){logger[_0x26f7('0xb')]('GetMemberReport',_0x528786);logger[_0x26f7('0xe')]('GetMemberReport',_0x528786,JSON['stringify'](_0x2ef05c));_0x3b48b6(_0x2ef05c);})[_0x26f7('0x1f')](function(_0x4c02a0){logger['error']('GetMemberReport',_0x4c02a0[_0x26f7('0x13')],_0x528786);_0x49b3de(_0x491518[_0x26f7('0x11')](0x1f4,_0x4c02a0[_0x26f7('0x13')]));});});};exports[_0x26f7('0x20')]=function(_0x2e38f1){var _0x5bfb69=this;return new Promise(function(_0x2accb9,_0x5ca32b){return db['MemberReport']['create'](_0x2e38f1[_0x26f7('0x21')],{'raw':_0x2e38f1[_0x26f7('0x17')]?_0x2e38f1[_0x26f7('0x17')][_0x26f7('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x504c75){logger['info'](_0x26f7('0x20'),_0x2e38f1);logger[_0x26f7('0xe')]('CreateMemberReport',_0x2e38f1,JSON[_0x26f7('0x10')](_0x504c75));_0x2accb9(_0x504c75);})[_0x26f7('0x1f')](function(_0x1052dc){logger[_0x26f7('0x11')](_0x26f7('0x20'),_0x1052dc[_0x26f7('0x13')],_0x2e38f1);_0x5ca32b(_0x5bfb69['error'](0x1f4,_0x1052dc[_0x26f7('0x13')]));});});};exports[_0x26f7('0x22')]=function(_0x1fc71b){var _0x544bde=this;return new Promise(function(_0x6e371c,_0x421e87){return db['MemberReport'][_0x26f7('0x23')](_0x1fc71b['body'],{'raw':_0x1fc71b[_0x26f7('0x17')]?_0x1fc71b[_0x26f7('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fc71b[_0x26f7('0x17')]?_0x1fc71b[_0x26f7('0x17')][_0x26f7('0x19')]||null:null,'attributes':_0x1fc71b['options']?_0x1fc71b['options'][_0x26f7('0x1e')]||null:null,'limit':_0x1fc71b['options']?_0x1fc71b[_0x26f7('0x17')][_0x26f7('0x1a')]||null:null})[_0x26f7('0xa')](function(_0x179c76){logger['info'](_0x26f7('0x22'),_0x1fc71b);logger[_0x26f7('0xe')](_0x26f7('0x22'),_0x1fc71b,JSON[_0x26f7('0x10')](_0x179c76));_0x6e371c(_0x179c76);})[_0x26f7('0x1f')](function(_0x46eaca){logger[_0x26f7('0x11')](_0x26f7('0x22'),_0x46eaca[_0x26f7('0x13')],_0x1fc71b);_0x421e87(_0x544bde[_0x26f7('0x11')](0x1f4,_0x46eaca[_0x26f7('0x13')]));});});};
\ No newline at end of file
index 5c27208..41bb0e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7479=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x292f33,_0x4cc4cc){var _0x522f97=function(_0x23c185){while(--_0x23c185){_0x292f33['push'](_0x292f33['shift']());}};_0x522f97(++_0x4cc4cc);}(_0x7479,0x18d));var _0x9747=function(_0x553a62,_0x58d2bb){_0x553a62=_0x553a62-0x0;var _0x1868cf=_0x7479[_0x553a62];return _0x1868cf;};'use strict';var multer=require('multer');var util=require(_0x9747('0x0'));var path=require(_0x9747('0x1'));var timeout=require(_0x9747('0x2'));var express=require('express');var router=express[_0x9747('0x3')]();var fs_extra=require(_0x9747('0x4'));var auth=require(_0x9747('0x5'));var interaction=require(_0x9747('0x6'));var config=require(_0x9747('0x7'));var controller=require('./migration.controller');router[_0x9747('0x8')]('/',controller[_0x9747('0x9')]);module[_0x9747('0xa')]=router;
\ No newline at end of file
+var _0x3cd2=['get','util','path','express','Router','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x3bee27,_0x211a75){var _0x500445=function(_0x2f30a2){while(--_0x2f30a2){_0x3bee27['push'](_0x3bee27['shift']());}};_0x500445(++_0x211a75);}(_0x3cd2,0xd1));var _0x23cd=function(_0x2cd0e0,_0x2f08f9){_0x2cd0e0=_0x2cd0e0-0x0;var _0x179c8d=_0x3cd2[_0x2cd0e0];return _0x179c8d;};'use strict';var multer=require('multer');var util=require(_0x23cd('0x0'));var path=require(_0x23cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x23cd('0x2'));var router=express[_0x23cd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x23cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23cd('0x5'));var controller=require(_0x23cd('0x6'));router[_0x23cd('0x7')]('/',controller['index']);module['exports']=router;
\ No newline at end of file
index a35b591..423a229 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x608f=['STRING','version','exports'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0x608f,0x137));var _0xf608=function(_0x3f13b3,_0xcf3a03){_0x3f13b3=_0x3f13b3-0x0;var _0x747798=_0x608f[_0x3f13b3];return _0x747798;};'use strict';var Sequelize=require('sequelize');module[_0xf608('0x0')]={'version':{'type':Sequelize[_0xf608('0x1')],'unique':_0xf608('0x2')}};
\ No newline at end of file
+var _0x17a7=['STRING'];(function(_0x3a303b,_0x1bed3d){var _0xc90be9=function(_0x2039df){while(--_0x2039df){_0x3a303b['push'](_0x3a303b['shift']());}};_0xc90be9(++_0x1bed3d);}(_0x17a7,0x145));var _0x717a=function(_0x358983,_0x3cfeb7){_0x358983=_0x358983-0x0;var _0xd4b449=_0x17a7[_0x358983];return _0xd4b449;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x717a('0x0')],'unique':'version'}};
\ No newline at end of file
index 6385406..182433c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x388e=['json','apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','count','includeAll','Migration','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range'];(function(_0x2c2a94,_0x118c36){var _0x5ca219=function(_0x46528a){while(--_0x46528a){_0x2c2a94['push'](_0x2c2a94['shift']());}};_0x5ca219(++_0x118c36);}(_0x388e,0x17d));var _0xe388=function(_0x847fbf,_0x102de8){_0x847fbf=_0x847fbf-0x0;var _0x4533d1=_0x388e[_0x847fbf];return _0x4533d1;};'use strict';var emlformat=require(_0xe388('0x0'));var rimraf=require(_0xe388('0x1'));var zipdir=require(_0xe388('0x2'));var jsonpatch=require(_0xe388('0x3'));var rp=require(_0xe388('0x4'));var moment=require(_0xe388('0x5'));var BPromise=require(_0xe388('0x6'));var Mustache=require(_0xe388('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe388('0x8'));var csv=require(_0xe388('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe388('0xa'));var squel=require(_0xe388('0xb'));var crypto=require(_0xe388('0xc'));var jsforce=require(_0xe388('0xd'));var deskjs=require(_0xe388('0xe'));var toCsv=require(_0xe388('0x9'));var querystring=require(_0xe388('0xf'));var Papa=require(_0xe388('0x10'));var Redis=require(_0xe388('0x11'));var authService=require(_0xe388('0x12'));var qs=require(_0xe388('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe388('0x14'))(_0xe388('0x15'));var utils=require(_0xe388('0x16'));var config=require(_0xe388('0x17'));var licenseUtil=require(_0xe388('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e4856,_0x270399){_0x270399=_0x270399||0xcc;return function(_0x7d674e){if(_0x7d674e){return _0x3e4856[_0xe388('0x19')](_0x270399);}return _0x3e4856[_0xe388('0x1a')](_0x270399)[_0xe388('0x1b')]();};}function respondWithResult(_0x23b77b,_0x3abbde){_0x3abbde=_0x3abbde||0xc8;return function(_0x35e1b1){if(_0x35e1b1){return _0x23b77b[_0xe388('0x1a')](_0x3abbde)['json'](_0x35e1b1);}};}function respondWithFilteredResult(_0x3c5f0c,_0x4eb7e0){return function(_0x323a8f){if(_0x323a8f){var _0x7e4f00=typeof _0x4eb7e0[_0xe388('0x1c')]===_0xe388('0x1d')&&typeof _0x4eb7e0[_0xe388('0x1e')]==='undefined';var _0x52dd77=_0x323a8f['count'];var _0x53244d=_0x7e4f00?0x0:_0x4eb7e0[_0xe388('0x1c')];var _0x316598=_0x7e4f00?_0x323a8f['count']:_0x4eb7e0[_0xe388('0x1c')]+_0x4eb7e0['limit'];var _0x2878ba;if(_0x316598>=_0x52dd77){_0x316598=_0x52dd77;_0x2878ba=0xc8;}else{_0x2878ba=0xce;}_0x3c5f0c[_0xe388('0x1a')](_0x2878ba);return _0x3c5f0c[_0xe388('0x1f')](_0xe388('0x20'),_0x53244d+'-'+_0x316598+'/'+_0x52dd77)[_0xe388('0x21')](_0x323a8f);}return null;};}function patchUpdates(_0x5f23d8){return function(_0x285fdf){try{jsonpatch[_0xe388('0x22')](_0x285fdf,_0x5f23d8,!![]);}catch(_0xe57bb0){return BPromise[_0xe388('0x23')](_0xe57bb0);}return _0x285fdf[_0xe388('0x24')]();};}function saveUpdates(_0x21c95e,_0x52d5fa){return function(_0x4dba64){if(_0x4dba64){return _0x4dba64['update'](_0x21c95e)[_0xe388('0x25')](function(_0x469a15){return _0x469a15;});}return null;};}function removeEntity(_0xd6d2fc,_0x1c3046){return function(_0x2b40e6){if(_0x2b40e6){return _0x2b40e6[_0xe388('0x26')]()[_0xe388('0x25')](function(){_0xd6d2fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x413eb1,_0x1f2bc7){return function(_0x446dce){if(!_0x446dce){_0x413eb1[_0xe388('0x19')](0x194);}return _0x446dce;};}function handleError(_0x1015eb,_0xd3e44e){_0xd3e44e=_0xd3e44e||0x1f4;return function(_0x1084dc){logger[_0xe388('0x27')](_0x1084dc[_0xe388('0x28')]);if(_0x1084dc[_0xe388('0x29')]){delete _0x1084dc[_0xe388('0x29')];}_0x1015eb[_0xe388('0x1a')](_0xd3e44e)['send'](_0x1084dc);};}exports['index']=function(_0x5c50d0,_0x1dc558){var _0x105801={},_0x370b12={},_0x267634={'count':0x0,'rows':[]};var _0x400dcf=_[_0xe388('0x2a')](db['Migration'][_0xe388('0x2b')],function(_0x58f35a){return{'name':_0x58f35a[_0xe388('0x2c')],'type':_0x58f35a[_0xe388('0x2d')][_0xe388('0x2e')]};});_0x370b12['model']=_['map'](_0x400dcf,_0xe388('0x29'));_0x370b12[_0xe388('0x2f')]=_['keys'](_0x5c50d0[_0xe388('0x2f')]);_0x370b12['filters']=_[_0xe388('0x30')](_0x370b12[_0xe388('0x31')],_0x370b12[_0xe388('0x2f')]);_0x105801['attributes']=_[_0xe388('0x30')](_0x370b12['model'],qs['fields'](_0x5c50d0[_0xe388('0x2f')][_0xe388('0x32')]));_0x105801[_0xe388('0x33')]=_0x105801[_0xe388('0x33')][_0xe388('0x34')]?_0x105801[_0xe388('0x33')]:_0x370b12[_0xe388('0x31')];if(!_0x5c50d0[_0xe388('0x2f')][_0xe388('0x35')](_0xe388('0x36'))){_0x105801['limit']=qs['limit'](_0x5c50d0[_0xe388('0x2f')][_0xe388('0x1e')]);_0x105801[_0xe388('0x1c')]=qs['offset'](_0x5c50d0[_0xe388('0x2f')][_0xe388('0x1c')]);}_0x105801[_0xe388('0x37')]=qs['sort'](_0x5c50d0['query'][_0xe388('0x38')]);_0x105801['where']=qs['filters'](_[_0xe388('0x39')](_0x5c50d0[_0xe388('0x2f')],_0x370b12[_0xe388('0x3a')]),_0x400dcf);if(_0x5c50d0[_0xe388('0x2f')][_0xe388('0x3b')]){_0x105801[_0xe388('0x3c')]=_[_0xe388('0x3d')](_0x105801['where'],{'$or':_[_0xe388('0x2a')](_0x400dcf,function(_0x527470){if(_0x527470['type']!=='VIRTUAL'){var _0x43ca51={};_0x43ca51[_0x527470[_0xe388('0x29')]]={'$like':'%'+_0x5c50d0['query'][_0xe388('0x3b')]+'%'};return _0x43ca51;}})});}_0x105801=_['merge']({},_0x105801,_0x5c50d0[_0xe388('0x3e')]);var _0x330e27={'where':_0x105801[_0xe388('0x3c')]};return db['Migration'][_0xe388('0x3f')](_0x330e27)[_0xe388('0x25')](function(_0x3d7dc7){_0x267634[_0xe388('0x3f')]=_0x3d7dc7;if(_0x5c50d0['query'][_0xe388('0x40')]){_0x105801['include']=[{'all':!![]}];}return db[_0xe388('0x41')][_0xe388('0x42')](_0x105801);})['then'](function(_0xc6a791){_0x267634[_0xe388('0x43')]=_0xc6a791;return _0x267634;})[_0xe388('0x25')](respondWithFilteredResult(_0x1dc558,_0x105801))[_0xe388('0x44')](handleError(_0x1dc558,null));};
\ No newline at end of file
+var _0xde5e=['limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','map','Migration','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','eml-format','rimraf','fast-json-patch','moment','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x399c17,_0x411a30){var _0x489ab7=function(_0x10902f){while(--_0x10902f){_0x399c17['push'](_0x399c17['shift']());}};_0x489ab7(++_0x411a30);}(_0xde5e,0x1aa));var _0xede5=function(_0x22a741,_0x4b4979){_0x22a741=_0x22a741-0x0;var _0x43b728=_0xde5e[_0x22a741];return _0x43b728;};'use strict';var emlformat=require(_0xede5('0x0'));var rimraf=require(_0xede5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xede5('0x2'));var rp=require('request-promise');var moment=require(_0xede5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xede5('0x4'));var csv=require('to-csv');var ejs=require(_0xede5('0x5'));var fs=require('fs');var fs_extra=require(_0xede5('0x6'));var _=require(_0xede5('0x7'));var squel=require(_0xede5('0x8'));var crypto=require(_0xede5('0x9'));var jsforce=require(_0xede5('0xa'));var deskjs=require(_0xede5('0xb'));var toCsv=require(_0xede5('0xc'));var querystring=require(_0xede5('0xd'));var Papa=require(_0xede5('0xe'));var Redis=require('ioredis');var authService=require(_0xede5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xede5('0x10'));var hardwareService=require(_0xede5('0x11'));var logger=require('../../config/logger')(_0xede5('0x12'));var utils=require(_0xede5('0x13'));var config=require(_0xede5('0x14'));var licenseUtil=require(_0xede5('0x15'));var db=require(_0xede5('0x16'))['db'];function respondWithStatusCode(_0x2a8a2e,_0x57c31a){_0x57c31a=_0x57c31a||0xcc;return function(_0x4135ec){if(_0x4135ec){return _0x2a8a2e[_0xede5('0x17')](_0x57c31a);}return _0x2a8a2e[_0xede5('0x18')](_0x57c31a)[_0xede5('0x19')]();};}function respondWithResult(_0x34329d,_0x5e00ee){_0x5e00ee=_0x5e00ee||0xc8;return function(_0x4df134){if(_0x4df134){return _0x34329d[_0xede5('0x18')](_0x5e00ee)[_0xede5('0x1a')](_0x4df134);}};}function respondWithFilteredResult(_0x4a449f,_0x56d5e8){return function(_0x362e54){if(_0x362e54){var _0x5e9347=typeof _0x56d5e8[_0xede5('0x1b')]===_0xede5('0x1c')&&typeof _0x56d5e8[_0xede5('0x1d')]===_0xede5('0x1c');var _0x4fa7d3=_0x362e54[_0xede5('0x1e')];var _0x24c6e4=_0x5e9347?0x0:_0x56d5e8[_0xede5('0x1b')];var _0x36cd8b=_0x5e9347?_0x362e54[_0xede5('0x1e')]:_0x56d5e8['offset']+_0x56d5e8['limit'];var _0x4bb734;if(_0x36cd8b>=_0x4fa7d3){_0x36cd8b=_0x4fa7d3;_0x4bb734=0xc8;}else{_0x4bb734=0xce;}_0x4a449f[_0xede5('0x18')](_0x4bb734);return _0x4a449f[_0xede5('0x1f')](_0xede5('0x20'),_0x24c6e4+'-'+_0x36cd8b+'/'+_0x4fa7d3)[_0xede5('0x1a')](_0x362e54);}return null;};}function patchUpdates(_0x11665f){return function(_0x4c4b6c){try{jsonpatch[_0xede5('0x21')](_0x4c4b6c,_0x11665f,!![]);}catch(_0x463510){return BPromise[_0xede5('0x22')](_0x463510);}return _0x4c4b6c[_0xede5('0x23')]();};}function saveUpdates(_0x328f88,_0x58d5a4){return function(_0x20f70f){if(_0x20f70f){return _0x20f70f[_0xede5('0x24')](_0x328f88)['then'](function(_0x4d8eee){return _0x4d8eee;});}return null;};}function removeEntity(_0xba9eba,_0x43fe99){return function(_0x20964e){if(_0x20964e){return _0x20964e[_0xede5('0x25')]()[_0xede5('0x26')](function(){_0xba9eba[_0xede5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36be07,_0x122ba2){return function(_0x423227){if(!_0x423227){_0x36be07[_0xede5('0x17')](0x194);}return _0x423227;};}function handleError(_0x4e1c9b,_0x2b4bd4){_0x2b4bd4=_0x2b4bd4||0x1f4;return function(_0x3717ac){logger['error'](_0x3717ac[_0xede5('0x27')]);if(_0x3717ac[_0xede5('0x28')]){delete _0x3717ac[_0xede5('0x28')];}_0x4e1c9b['status'](_0x2b4bd4)['send'](_0x3717ac);};}exports['index']=function(_0x16271f,_0x2233ef){var _0x4f3035={},_0x2e181b={},_0x2ec4f3={'count':0x0,'rows':[]};var _0x14c3b2=_[_0xede5('0x29')](db[_0xede5('0x2a')]['rawAttributes'],function(_0x4847ac){return{'name':_0x4847ac['fieldName'],'type':_0x4847ac['type'][_0xede5('0x2b')]};});_0x2e181b[_0xede5('0x2c')]=_[_0xede5('0x29')](_0x14c3b2,'name');_0x2e181b[_0xede5('0x2d')]=_['keys'](_0x16271f['query']);_0x2e181b['filters']=_[_0xede5('0x2e')](_0x2e181b[_0xede5('0x2c')],_0x2e181b[_0xede5('0x2d')]);_0x4f3035[_0xede5('0x2f')]=_[_0xede5('0x2e')](_0x2e181b[_0xede5('0x2c')],qs[_0xede5('0x30')](_0x16271f[_0xede5('0x2d')][_0xede5('0x30')]));_0x4f3035[_0xede5('0x2f')]=_0x4f3035[_0xede5('0x2f')]['length']?_0x4f3035[_0xede5('0x2f')]:_0x2e181b[_0xede5('0x2c')];if(!_0x16271f[_0xede5('0x2d')][_0xede5('0x31')](_0xede5('0x32'))){_0x4f3035[_0xede5('0x1d')]=qs[_0xede5('0x1d')](_0x16271f[_0xede5('0x2d')][_0xede5('0x1d')]);_0x4f3035[_0xede5('0x1b')]=qs[_0xede5('0x1b')](_0x16271f[_0xede5('0x2d')][_0xede5('0x1b')]);}_0x4f3035[_0xede5('0x33')]=qs['sort'](_0x16271f[_0xede5('0x2d')][_0xede5('0x34')]);_0x4f3035[_0xede5('0x35')]=qs[_0xede5('0x36')](_[_0xede5('0x37')](_0x16271f[_0xede5('0x2d')],_0x2e181b[_0xede5('0x36')]),_0x14c3b2);if(_0x16271f[_0xede5('0x2d')][_0xede5('0x38')]){_0x4f3035[_0xede5('0x35')]=_[_0xede5('0x39')](_0x4f3035['where'],{'$or':_[_0xede5('0x29')](_0x14c3b2,function(_0xcc8eae){if(_0xcc8eae[_0xede5('0x3a')]!==_0xede5('0x3b')){var _0xfcba42={};_0xfcba42[_0xcc8eae[_0xede5('0x28')]]={'$like':'%'+_0x16271f['query'][_0xede5('0x38')]+'%'};return _0xfcba42;}})});}_0x4f3035=_[_0xede5('0x39')]({},_0x4f3035,_0x16271f[_0xede5('0x3c')]);var _0x1f307b={'where':_0x4f3035[_0xede5('0x35')]};return db[_0xede5('0x2a')][_0xede5('0x1e')](_0x1f307b)['then'](function(_0x4daf9e){_0x2ec4f3['count']=_0x4daf9e;if(_0x16271f['query'][_0xede5('0x3d')]){_0x4f3035[_0xede5('0x3e')]=[{'all':!![]}];}return db['Migration'][_0xede5('0x3f')](_0x4f3035);})[_0xede5('0x26')](function(_0x7780b1){_0x2ec4f3['rows']=_0x7780b1;return _0x2ec4f3;})[_0xede5('0x26')](respondWithFilteredResult(_0x2233ef,_0x4f3035))[_0xede5('0x40')](handleError(_0x2233ef,null));};
\ No newline at end of file
index 9e407c2..713c07f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d9b=['bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','Migration','migrations','lodash','../../config/logger','api','moment'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x8d9b,0x130));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require('util');var logger=require(_0xb8d9('0x1'))(_0xb8d9('0x2'));var moment=require(_0xb8d9('0x3'));var BPromise=require(_0xb8d9('0x4'));var rp=require(_0xb8d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var attributes=require(_0xb8d9('0x8'));module['exports']=function(_0x2d8830,_0x3af093){return _0x2d8830['define'](_0xb8d9('0x9'),attributes,{'tableName':_0xb8d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9350=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','migrations','lodash','../../config/logger','api','moment'];(function(_0x503b76,_0x3383b0){var _0x41664a=function(_0xebcedc){while(--_0xebcedc){_0x503b76['push'](_0x503b76['shift']());}};_0x41664a(++_0x3383b0);}(_0x9350,0x140));var _0x0935=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x9350[_0x43b584];return _0x48f27b;};'use strict';var _=require(_0x0935('0x0'));var util=require('util');var logger=require(_0x0935('0x1'))(_0x0935('0x2'));var moment=require(_0x0935('0x3'));var BPromise=require(_0x0935('0x4'));var rp=require(_0x0935('0x5'));var fs=require('fs');var path=require(_0x0935('0x6'));var rimraf=require(_0x0935('0x7'));var config=require(_0x0935('0x8'));var attributes=require('./migration.attributes');module[_0x0935('0x9')]=function(_0x1074e5,_0x30d962){return _0x1074e5[_0x0935('0xa')]('Migration',attributes,{'tableName':_0x0935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b5bf0d6..45ef812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['code','message','Migration,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3a7c90,_0x44a547){var _0x4a1eac=function(_0x365e55){while(--_0x365e55){_0x3a7c90['push'](_0x3a7c90['shift']());}};_0x4a1eac(++_0x44a547);}(_0x9bde,0xe1));var _0xe9bd=function(_0x57648f,_0x322bf3){_0x57648f=_0x57648f-0x0;var _0x407fc1=_0x9bde[_0x57648f];return _0x407fc1;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('Migration,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('Migration,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('Migration,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('Migration,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
+var _0x05b0=['client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b0,0x188));var _0x005b=function(_0x4ab9da,_0x3d892f){_0x4ab9da=_0x4ab9da-0x0;var _0x25c00a=_0x05b0[_0x4ab9da];return _0x25c00a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x005b('0x0'));var BPromise=require(_0x005b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x005b('0x2'));var db=require(_0x005b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x005b('0x4'))(_0x005b('0x5'));var config=require('../../config/environment');var jayson=require(_0x005b('0x6'));var client=jayson[_0x005b('0x7')][_0x005b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x98e71c,_0x224c8d,_0x35998d){return new BPromise(function(_0x263bc9,_0x5cff7f){return client[_0x005b('0x9')](_0x98e71c,_0x35998d)[_0x005b('0xa')](function(_0x4c5552){logger['info'](_0x005b('0xb'),_0x224c8d,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x224c8d,_0x005b('0xc'),JSON[_0x005b('0xd')](_0x4c5552));if(_0x4c5552['error']){if(_0x4c5552[_0x005b('0xe')][_0x005b('0xf')]===0x1f4){logger[_0x005b('0xe')](_0x005b('0xb'),_0x224c8d,_0x4c5552[_0x005b('0xe')][_0x005b('0x10')]);return _0x5cff7f(_0x4c5552[_0x005b('0xe')]['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x224c8d,_0x4c5552[_0x005b('0xe')]['message']);return _0x263bc9(_0x4c5552[_0x005b('0xe')]['message']);}else{logger[_0x005b('0x11')](_0x005b('0xb'),_0x224c8d,_0x005b('0xc'));_0x263bc9(_0x4c5552[_0x005b('0x12')][_0x005b('0x10')]);}})['catch'](function(_0xa3c3fb){logger[_0x005b('0xe')](_0x005b('0xb'),_0x224c8d,_0xa3c3fb);_0x5cff7f(_0xa3c3fb);});});}
\ No newline at end of file
index 48d45f3..60b4142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b59=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','util'];(function(_0xd01739,_0x1a9dea){var _0x165820=function(_0x230885){while(--_0x230885){_0xd01739['push'](_0xd01739['shift']());}};_0x165820(++_0x1a9dea);}(_0x2b59,0x1de));var _0x92b5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2b59[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x92b5('0x0'));var util=require(_0x92b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x92b5('0x2'));var router=express[_0x92b5('0x3')]();var fs_extra=require(_0x92b5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x92b5('0x5'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x92b5('0x6')]('/',auth[_0x92b5('0x7')](),controller[_0x92b5('0x8')]);router[_0x92b5('0x6')](_0x92b5('0x9'),auth[_0x92b5('0x7')](),controller['show']);router[_0x92b5('0xa')]('/',auth[_0x92b5('0x7')](),controller[_0x92b5('0xb')]);router['put'](_0x92b5('0x9'),auth['isAuthenticated'](),controller[_0x92b5('0xc')]);router[_0x92b5('0xd')]('/:id',auth[_0x92b5('0x7')](),controller[_0x92b5('0xe')]);module[_0x92b5('0xf')]=router;
\ No newline at end of file
+var _0x307e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1d9033,_0x18b6da){var _0x3d0e75=function(_0x55294e){while(--_0x55294e){_0x1d9033['push'](_0x1d9033['shift']());}};_0x3d0e75(++_0x18b6da);}(_0x307e,0xc9));var _0xe307=function(_0x56ecd9,_0x5dfe78){_0x56ecd9=_0x56ecd9-0x0;var _0x2c15ff=_0x307e[_0x56ecd9];return _0x2c15ff;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var fs_extra=require(_0xe307('0x5'));var auth=require(_0xe307('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe307('0x7'));var controller=require('./network.controller');router[_0xe307('0x8')]('/',auth[_0xe307('0x9')](),controller[_0xe307('0xa')]);router['get'](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0xc')]);router[_0xe307('0xd')]('/',auth[_0xe307('0x9')](),controller[_0xe307('0xe')]);router[_0xe307('0xf')](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0x10')]);router[_0xe307('0x11')](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0x12')]);module[_0xe307('0x13')]=router;
\ No newline at end of file
index d7654cd..c7cf90b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb142=['sequelize','exports','ENUM','localnet','stun','turn','STRING'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xb142,0x77));var _0x2b14=function(_0x3f99fd,_0x13cc6f){_0x3f99fd=_0x3f99fd-0x0;var _0x5ba2c9=_0xb142[_0x3f99fd];return _0x5ba2c9;};'use strict';var Sequelize=require(_0x2b14('0x0'));module[_0x2b14('0x1')]={'type':{'type':Sequelize[_0x2b14('0x2')](_0x2b14('0x3'),'externip',_0x2b14('0x4'),_0x2b14('0x5'))},'value':{'type':Sequelize[_0x2b14('0x6')]},'username':{'type':Sequelize[_0x2b14('0x6')]},'password':{'type':Sequelize[_0x2b14('0x6')]}};
\ No newline at end of file
+var _0x5cc4=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x24ae09,_0x4cfda5){var _0x468352=function(_0x18958b){while(--_0x18958b){_0x24ae09['push'](_0x24ae09['shift']());}};_0x468352(++_0x4cfda5);}(_0x5cc4,0x1c4));var _0x45cc=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x5cc4[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0x45cc('0x0'));module[_0x45cc('0x1')]={'type':{'type':Sequelize[_0x45cc('0x2')](_0x45cc('0x3'),_0x45cc('0x4'),_0x45cc('0x5'),_0x45cc('0x6'))},'value':{'type':Sequelize[_0x45cc('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x45cc('0x7')]}};
\ No newline at end of file
index 3574e4c..ff63008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c2=['send','index','map','Network','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','rawAttributes','filters','includeAll','find','create','body','findAll','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','join','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','code','error','message','result','status','offset','undefined','limit','count','set','json','update','destroy','end','sendStatus','stack','name'];(function(_0x5e58c7,_0x109b42){var _0xb7764d=function(_0xae680d){while(--_0xae680d){_0x5e58c7['push'](_0x5e58c7['shift']());}};_0xb7764d(++_0x109b42);}(_0xf1c2,0x188));var _0x2f1c=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0xf1c2[_0x45ee03];return _0x13d535;};'use strict';var util=require(_0x2f1c('0x0'));var path=require(_0x2f1c('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2f1c('0x2'));var qs=require(_0x2f1c('0x3'));var logger=require(_0x2f1c('0x4'))(_0x2f1c('0x5'));var config=require(_0x2f1c('0x6'));var db=require(_0x2f1c('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2f1c('0x8')][_0x2f1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7d52,_0x3d0273,_0x3fd963,_0x1af5f1){return new Promise(function(_0x347df6,_0x394926){var _0x3068ba=_0x1af5f1||client;return _0x3068ba['request'](_0x3e7d52,_0x3fd963)[_0x2f1c('0xa')](function(_0x3de7f1){logger[_0x2f1c('0xb')](_0x2f1c('0xc'),_0x3d0273,_0x2f1c('0xd'));logger[_0x2f1c('0xe')](_0x2f1c('0xf'),_0x3d0273,'request\x20sent',JSON['stringify'](_0x3de7f1));if(_0x3de7f1['error']){if(_0x3de7f1['error'][_0x2f1c('0x10')]===0x1f4){logger['error'](_0x2f1c('0xc'),_0x3d0273,_0x3de7f1[_0x2f1c('0x11')]['message']);return _0x394926(_0x3de7f1['error'][_0x2f1c('0x12')]);}logger[_0x2f1c('0x11')](_0x2f1c('0xc'),_0x3d0273,_0x3de7f1[_0x2f1c('0x11')]['message']);return _0x347df6(_0x3de7f1['error'][_0x2f1c('0x12')]);}else{logger[_0x2f1c('0xb')](_0x2f1c('0xc'),_0x3d0273,_0x2f1c('0xd'));_0x347df6(_0x3de7f1[_0x2f1c('0x13')]['message']);}})['catch'](function(_0x559f41){logger[_0x2f1c('0x11')]('Network,\x20%s,\x20%s',_0x3d0273,_0x559f41);_0x394926(_0x559f41);});});}function respondWithResult(_0x56ba21,_0x5920ef){_0x5920ef=_0x5920ef||0xc8;return function(_0x45b01b){if(_0x45b01b){return _0x56ba21[_0x2f1c('0x14')](_0x5920ef)['json'](_0x45b01b);}};}function respondWithFilteredResult(_0x398e5e,_0x35af1d){return function(_0x1ac5d5){if(_0x1ac5d5){var _0x925a79=typeof _0x35af1d[_0x2f1c('0x15')]===_0x2f1c('0x16')&&typeof _0x35af1d[_0x2f1c('0x17')]==='undefined';var _0xcc65a3=_0x1ac5d5['count'];var _0x31e588=_0x925a79?0x0:_0x35af1d[_0x2f1c('0x15')];var _0x21d850=_0x925a79?_0x1ac5d5[_0x2f1c('0x18')]:_0x35af1d['offset']+_0x35af1d[_0x2f1c('0x17')];var _0x5159d3;if(_0x21d850>=_0xcc65a3){_0x21d850=_0xcc65a3;_0x5159d3=0xc8;}else{_0x5159d3=0xce;}_0x398e5e[_0x2f1c('0x14')](_0x5159d3);return _0x398e5e[_0x2f1c('0x19')]('Content-Range',_0x31e588+'-'+_0x21d850+'/'+_0xcc65a3)[_0x2f1c('0x1a')](_0x1ac5d5);}return null;};}function saveUpdates(_0x87fe26){return function(_0x308cec){if(_0x308cec){return _0x308cec[_0x2f1c('0x1b')](_0x87fe26)[_0x2f1c('0xa')](function(_0x4af815){return _0x4af815;});}return null;};}function removeEntity(_0x5077e4){return function(_0x2bb5ad){if(_0x2bb5ad){return _0x2bb5ad[_0x2f1c('0x1c')]()[_0x2f1c('0xa')](function(){_0x5077e4[_0x2f1c('0x14')](0xcc)[_0x2f1c('0x1d')]();});}};}function handleEntityNotFound(_0xf719c3){return function(_0x1eac5c){if(!_0x1eac5c){_0xf719c3[_0x2f1c('0x1e')](0x194);}return _0x1eac5c;};}function handleError(_0x498ac8,_0x1c08e4){_0x1c08e4=_0x1c08e4||0x1f4;return function(_0x4e4dab){logger[_0x2f1c('0x11')](_0x4e4dab[_0x2f1c('0x1f')]);if(_0x4e4dab[_0x2f1c('0x20')]){delete _0x4e4dab[_0x2f1c('0x20')];}_0x498ac8['status'](_0x1c08e4)[_0x2f1c('0x21')](_0x4e4dab);};}exports[_0x2f1c('0x22')]=function(_0x26ec81,_0x2a11c3){var _0x24035f={},_0x2bf9a4={},_0x49050e={'count':0x0,'rows':[]};var _0x4d71a8=_[_0x2f1c('0x23')](db[_0x2f1c('0x24')]['rawAttributes'],function(_0x385d34){return{'name':_0x385d34[_0x2f1c('0x25')],'type':_0x385d34['type'][_0x2f1c('0x26')]};});_0x2bf9a4[_0x2f1c('0x27')]=_[_0x2f1c('0x23')](_0x4d71a8,'name');_0x2bf9a4['query']=_[_0x2f1c('0x28')](_0x26ec81[_0x2f1c('0x29')]);_0x2bf9a4['filters']=_[_0x2f1c('0x2a')](_0x2bf9a4[_0x2f1c('0x27')],_0x2bf9a4[_0x2f1c('0x29')]);_0x24035f[_0x2f1c('0x2b')]=_[_0x2f1c('0x2a')](_0x2bf9a4[_0x2f1c('0x27')],qs[_0x2f1c('0x2c')](_0x26ec81[_0x2f1c('0x29')]['fields']));_0x24035f[_0x2f1c('0x2b')]=_0x24035f[_0x2f1c('0x2b')][_0x2f1c('0x2d')]?_0x24035f['attributes']:_0x2bf9a4[_0x2f1c('0x27')];if(!_0x26ec81[_0x2f1c('0x29')][_0x2f1c('0x2e')]('nolimit')){_0x24035f[_0x2f1c('0x17')]=qs[_0x2f1c('0x17')](_0x26ec81['query'][_0x2f1c('0x17')]);_0x24035f[_0x2f1c('0x15')]=qs['offset'](_0x26ec81[_0x2f1c('0x29')][_0x2f1c('0x15')]);}_0x24035f['order']=qs[_0x2f1c('0x2f')](_0x26ec81['query'][_0x2f1c('0x2f')]);_0x24035f[_0x2f1c('0x30')]=qs['filters'](_['pick'](_0x26ec81[_0x2f1c('0x29')],_0x2bf9a4['filters']),_0x4d71a8);if(_0x26ec81[_0x2f1c('0x29')]['filter']){_0x24035f[_0x2f1c('0x30')]=_[_0x2f1c('0x31')](_0x24035f[_0x2f1c('0x30')],{'$or':_[_0x2f1c('0x23')](_0x4d71a8,function(_0x1fde2f){if(_0x1fde2f[_0x2f1c('0x32')]!==_0x2f1c('0x33')){var _0x299c03={};_0x299c03[_0x1fde2f[_0x2f1c('0x20')]]={'$like':'%'+_0x26ec81[_0x2f1c('0x29')][_0x2f1c('0x34')]+'%'};return _0x299c03;}})});}_0x24035f=_[_0x2f1c('0x31')]({},_0x24035f,_0x26ec81[_0x2f1c('0x35')]);var _0x20c71c={'where':_0x24035f[_0x2f1c('0x30')]};return db[_0x2f1c('0x24')]['count'](_0x20c71c)[_0x2f1c('0xa')](function(_0x5e0fce){_0x49050e[_0x2f1c('0x18')]=_0x5e0fce;if(_0x26ec81[_0x2f1c('0x29')]['includeAll']){_0x24035f[_0x2f1c('0x36')]=[{'all':!![]}];}return db[_0x2f1c('0x24')]['findAll'](_0x24035f);})[_0x2f1c('0xa')](function(_0x580d03){_0x49050e[_0x2f1c('0x37')]=_0x580d03;return _0x49050e;})[_0x2f1c('0xa')](respondWithFilteredResult(_0x2a11c3,_0x24035f))[_0x2f1c('0x38')](handleError(_0x2a11c3,null));};exports[_0x2f1c('0x39')]=function(_0xae8ac1,_0x3bba2f){var _0x5b40cf={'raw':!![],'where':{'id':_0xae8ac1[_0x2f1c('0x3a')]['id']}},_0x59219b={};_0x59219b[_0x2f1c('0x27')]=_[_0x2f1c('0x28')](db[_0x2f1c('0x24')][_0x2f1c('0x3b')]);_0x59219b['query']=_[_0x2f1c('0x28')](_0xae8ac1[_0x2f1c('0x29')]);_0x59219b[_0x2f1c('0x3c')]=_['intersection'](_0x59219b[_0x2f1c('0x27')],_0x59219b[_0x2f1c('0x29')]);_0x5b40cf['attributes']=_['intersection'](_0x59219b[_0x2f1c('0x27')],qs['fields'](_0xae8ac1[_0x2f1c('0x29')][_0x2f1c('0x2c')]));_0x5b40cf[_0x2f1c('0x2b')]=_0x5b40cf[_0x2f1c('0x2b')][_0x2f1c('0x2d')]?_0x5b40cf[_0x2f1c('0x2b')]:_0x59219b[_0x2f1c('0x27')];if(_0xae8ac1[_0x2f1c('0x29')][_0x2f1c('0x3d')]){_0x5b40cf['include']=[{'all':!![]}];}_0x5b40cf=_['merge']({},_0x5b40cf,_0xae8ac1['options']);return db[_0x2f1c('0x24')][_0x2f1c('0x3e')](_0x5b40cf)['then'](handleEntityNotFound(_0x3bba2f,null))[_0x2f1c('0xa')](respondWithResult(_0x3bba2f,null))[_0x2f1c('0x38')](handleError(_0x3bba2f,null));};exports[_0x2f1c('0x3f')]=function(_0x5f4f59,_0x43f034){var _0x4127ad;return db['Network'][_0x2f1c('0x3f')](_0x5f4f59[_0x2f1c('0x40')],{'raw':!![]})[_0x2f1c('0xa')](function(_0x167708){_0x4127ad=_0x167708;return db[_0x2f1c('0x24')][_0x2f1c('0x41')]({'where':{'type':_0x5f4f59[_0x2f1c('0x40')][_0x2f1c('0x32')]},'raw':!![]});})[_0x2f1c('0xa')](function(_0x5a5d75){if(_0x4127ad[_0x2f1c('0x32')]['toUpperCase']()==_0x2f1c('0x42')){var _0xa592dc=fs[_0x2f1c('0x43')](path['join'](config[_0x2f1c('0x44')],_0x2f1c('0x45')),_0x2f1c('0x46'));var _0x1c13a7=ejs[_0x2f1c('0x47')](_0xa592dc,{'networks':_0x5a5d75||[]});fs[_0x2f1c('0x48')](_0x2f1c('0x49'),_0x1c13a7);return respondWithRpcPromise(_0x2f1c('0x4a'),_0x2f1c('0x3f'),{'module':_0x2f1c('0x4b')});}else if(_0x4127ad[_0x2f1c('0x32')][_0x2f1c('0x4c')]()==_0x2f1c('0x4d')){var _0x3f1920=fs[_0x2f1c('0x43')](path[_0x2f1c('0x4e')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x2f1c('0x46'));var _0x4c0c48=ejs[_0x2f1c('0x47')](_0x3f1920,{'networks':_0x5a5d75||[]});fs[_0x2f1c('0x48')](_0x2f1c('0x4f'),_0x4c0c48);return respondWithRpcPromise(_0x2f1c('0x4a'),'create',{'module':'res_stun_monitor.so'});}else{var _0x538410=fs[_0x2f1c('0x43')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x2f1c('0x46'));var _0x45b67f=ejs[_0x2f1c('0x47')](_0x538410,{'networks':_0x5a5d75||[]});fs[_0x2f1c('0x48')](util[_0x2f1c('0x50')](_0x2f1c('0x51'),_0x5f4f59[_0x2f1c('0x40')]['type'][_0x2f1c('0x52')]()),_0x45b67f);return respondWithRpcPromise('Reload',_0x2f1c('0x3f'),{'module':'chan_sip.so'});}})['then'](function(){return _0x4127ad;})[_0x2f1c('0xa')](respondWithResult(_0x43f034,0xc9))[_0x2f1c('0x38')](handleError(_0x43f034,null));};exports[_0x2f1c('0x1b')]=function(_0x461063,_0x3d1dac){var _0x5496e6;return db['Network'][_0x2f1c('0x3e')]({'where':{'id':_0x461063[_0x2f1c('0x3a')]['id']}})[_0x2f1c('0xa')](handleEntityNotFound(_0x3d1dac,null))['then'](saveUpdates(_0x461063[_0x2f1c('0x40')],null))[_0x2f1c('0xa')](function(_0x42abf1){if(_0x42abf1){_0x5496e6=_0x42abf1;return db[_0x2f1c('0x24')][_0x2f1c('0x41')]({'where':{'type':_0x5496e6[_0x2f1c('0x32')]},'raw':!![]});}return null;})[_0x2f1c('0xa')](function(_0x3d631c){if(_0x5496e6[_0x2f1c('0x32')]['toUpperCase']()==_0x2f1c('0x42')){var _0x272b60=fs['readFileSync'](path[_0x2f1c('0x4e')](config[_0x2f1c('0x44')],_0x2f1c('0x45')),_0x2f1c('0x46'));var _0x20963d=ejs[_0x2f1c('0x47')](_0x272b60,{'networks':_0x3d631c||[]});fs[_0x2f1c('0x48')](_0x2f1c('0x49'),_0x20963d);return respondWithRpcPromise(_0x2f1c('0x4a'),_0x2f1c('0x1b'),{'module':_0x2f1c('0x4b')});}else if(_0x5496e6[_0x2f1c('0x32')][_0x2f1c('0x4c')]()=='TURN'){var _0x349769=fs['readFileSync'](path[_0x2f1c('0x4e')](config[_0x2f1c('0x44')],_0x2f1c('0x53')),_0x2f1c('0x46'));var _0x576c5b=ejs['render'](_0x349769,{'networks':_0x3d631c||[]});fs['writeFileSync'](_0x2f1c('0x4f'),_0x576c5b);return respondWithRpcPromise(_0x2f1c('0x4a'),'update',{'module':_0x2f1c('0x4b')});}else{var _0x40db7e=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0x2f1c('0x46'));var _0x25a274=ejs['render'](_0x40db7e,{'networks':_0x3d631c||[]});fs[_0x2f1c('0x48')](util[_0x2f1c('0x50')](_0x2f1c('0x51'),_0x461063['body']['type'][_0x2f1c('0x52')]()),_0x25a274);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}})['then'](function(_0x54ab8b){if(_0x54ab8b){return _0x5496e6;}return null;})[_0x2f1c('0xa')](respondWithResult(_0x3d1dac,null))['catch'](handleError(_0x3d1dac,null));};exports['destroy']=function(_0x29b449,_0x4bf0da){var _0x502527;return db[_0x2f1c('0x24')]['find']({'where':{'id':_0x29b449[_0x2f1c('0x3a')]['id']}})[_0x2f1c('0xa')](function(_0x17b9b0){_0x502527=_0x17b9b0;return _0x17b9b0;})[_0x2f1c('0xa')](handleEntityNotFound(_0x4bf0da,null))[_0x2f1c('0xa')](removeEntity(_0x4bf0da,null))[_0x2f1c('0xa')](function(){if(_0x502527){return db[_0x2f1c('0x24')][_0x2f1c('0x41')]({'where':{'type':_0x502527[_0x2f1c('0x32')]},'raw':!![]});}})[_0x2f1c('0xa')](function(_0x5db184){if(_0x502527[_0x2f1c('0x32')][_0x2f1c('0x4c')]()==_0x2f1c('0x42')){var _0x3a17cf=fs[_0x2f1c('0x43')](path[_0x2f1c('0x4e')](config[_0x2f1c('0x44')],_0x2f1c('0x45')),_0x2f1c('0x46'));var _0x16c669=ejs[_0x2f1c('0x47')](_0x3a17cf,{'networks':_0x5db184||[]});fs[_0x2f1c('0x48')]('/etc/asterisk/stun_xcally.conf',_0x16c669);return respondWithRpcPromise('Reload',_0x2f1c('0x1c'),{'module':'res_stun_monitor.so'});}else if(_0x502527[_0x2f1c('0x32')][_0x2f1c('0x4c')]()==_0x2f1c('0x4d')){var _0x394f0a=fs[_0x2f1c('0x43')](path[_0x2f1c('0x4e')](config[_0x2f1c('0x44')],_0x2f1c('0x53')),_0x2f1c('0x46'));var _0x1c7df5=ejs[_0x2f1c('0x47')](_0x394f0a,{'networks':_0x5db184||[]});fs['writeFileSync'](_0x2f1c('0x4f'),_0x1c7df5);return respondWithRpcPromise(_0x2f1c('0x4a'),_0x2f1c('0x1c'),{'module':_0x2f1c('0x4b')});}else{var _0x3830b7=fs[_0x2f1c('0x43')](path[_0x2f1c('0x4e')](config[_0x2f1c('0x44')],_0x2f1c('0x54')),_0x2f1c('0x46'));var _0x142c9f=ejs[_0x2f1c('0x47')](_0x3830b7,{'networks':_0x5db184||[]});fs['writeFileSync'](util[_0x2f1c('0x50')]('/etc/asterisk/sip_xcally_%s.conf',_0x502527[_0x2f1c('0x32')][_0x2f1c('0x52')]()),_0x142c9f);return respondWithRpcPromise(_0x2f1c('0x4a'),'destroy',{'module':'chan_sip.so'});}})[_0x2f1c('0x38')](handleError(_0x4bf0da,null));};
\ No newline at end of file
+var _0x934b=['../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','status','limit','undefined','count','offset','Content-Range','json','update','end','sendStatus','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','rows','show','params','Network','rawAttributes','length','include','options','catch','body','findAll','toUpperCase','STUN','readFileSync','join','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','TURN','root','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','toLowerCase','destroy','util','path','ejs','lodash','../../components/parsers/qs','api'];(function(_0x5cb47e,_0x566bd4){var _0x5502bd=function(_0x4f77a0){while(--_0x4f77a0){_0x5cb47e['push'](_0x5cb47e['shift']());}};_0x5502bd(++_0x566bd4);}(_0x934b,0xfc));var _0xb934=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x934b[_0x29e0eb];return _0x597d2d;};'use strict';var util=require(_0xb934('0x0'));var path=require(_0xb934('0x1'));var ejs=require(_0xb934('0x2'));var fs=require('fs');var _=require(_0xb934('0x3'));var qs=require(_0xb934('0x4'));var logger=require('../../config/logger')(_0xb934('0x5'));var config=require('../../config/environment');var db=require(_0xb934('0x6'))['db'];var jayson=require(_0xb934('0x7'));var client=jayson['client'][_0xb934('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe2ad98,_0x479181,_0x3e86ed,_0x2a33dc){return new Promise(function(_0x4d46a2,_0x5ec3c9){var _0xe97fd1=_0x2a33dc||client;return _0xe97fd1[_0xb934('0x9')](_0xe2ad98,_0x3e86ed)[_0xb934('0xa')](function(_0x28a1a0){logger['info'](_0xb934('0xb'),_0x479181,_0xb934('0xc'));logger[_0xb934('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x479181,_0xb934('0xc'),JSON['stringify'](_0x28a1a0));if(_0x28a1a0[_0xb934('0xe')]){if(_0x28a1a0[_0xb934('0xe')][_0xb934('0xf')]===0x1f4){logger[_0xb934('0xe')](_0xb934('0xb'),_0x479181,_0x28a1a0[_0xb934('0xe')]['message']);return _0x5ec3c9(_0x28a1a0['error'][_0xb934('0x10')]);}logger[_0xb934('0xe')]('Network,\x20%s,\x20%s',_0x479181,_0x28a1a0[_0xb934('0xe')][_0xb934('0x10')]);return _0x4d46a2(_0x28a1a0[_0xb934('0xe')][_0xb934('0x10')]);}else{logger[_0xb934('0x11')](_0xb934('0xb'),_0x479181,'request\x20sent');_0x4d46a2(_0x28a1a0[_0xb934('0x12')][_0xb934('0x10')]);}})['catch'](function(_0x1e8400){logger[_0xb934('0xe')](_0xb934('0xb'),_0x479181,_0x1e8400);_0x5ec3c9(_0x1e8400);});});}function respondWithResult(_0x3e20d8,_0x45ec2e){_0x45ec2e=_0x45ec2e||0xc8;return function(_0x33ad6e){if(_0x33ad6e){return _0x3e20d8[_0xb934('0x13')](_0x45ec2e)['json'](_0x33ad6e);}};}function respondWithFilteredResult(_0x70f9a0,_0x13d90){return function(_0x8f929e){if(_0x8f929e){var _0x329892=typeof _0x13d90['offset']==='undefined'&&typeof _0x13d90[_0xb934('0x14')]===_0xb934('0x15');var _0x1d669b=_0x8f929e[_0xb934('0x16')];var _0x2bb5c7=_0x329892?0x0:_0x13d90[_0xb934('0x17')];var _0x18ac59=_0x329892?_0x8f929e[_0xb934('0x16')]:_0x13d90[_0xb934('0x17')]+_0x13d90[_0xb934('0x14')];var _0x3d3fdd;if(_0x18ac59>=_0x1d669b){_0x18ac59=_0x1d669b;_0x3d3fdd=0xc8;}else{_0x3d3fdd=0xce;}_0x70f9a0[_0xb934('0x13')](_0x3d3fdd);return _0x70f9a0['set'](_0xb934('0x18'),_0x2bb5c7+'-'+_0x18ac59+'/'+_0x1d669b)[_0xb934('0x19')](_0x8f929e);}return null;};}function saveUpdates(_0x28fe1b){return function(_0x488147){if(_0x488147){return _0x488147[_0xb934('0x1a')](_0x28fe1b)[_0xb934('0xa')](function(_0x49a779){return _0x49a779;});}return null;};}function removeEntity(_0x36714a){return function(_0x2e3692){if(_0x2e3692){return _0x2e3692['destroy']()[_0xb934('0xa')](function(){_0x36714a[_0xb934('0x13')](0xcc)[_0xb934('0x1b')]();});}};}function handleEntityNotFound(_0x2481a3){return function(_0x1270c7){if(!_0x1270c7){_0x2481a3[_0xb934('0x1c')](0x194);}return _0x1270c7;};}function handleError(_0x23c79c,_0x28978a){_0x28978a=_0x28978a||0x1f4;return function(_0x5b7c81){logger['error'](_0x5b7c81[_0xb934('0x1d')]);if(_0x5b7c81[_0xb934('0x1e')]){delete _0x5b7c81[_0xb934('0x1e')];}_0x23c79c[_0xb934('0x13')](_0x28978a)[_0xb934('0x1f')](_0x5b7c81);};}exports['index']=function(_0x4fb92a,_0xe0d981){var _0x5e818b={},_0xd57470={},_0x33127d={'count':0x0,'rows':[]};var _0x253a08=_[_0xb934('0x20')](db['Network']['rawAttributes'],function(_0x4c90e4){return{'name':_0x4c90e4[_0xb934('0x21')],'type':_0x4c90e4[_0xb934('0x22')][_0xb934('0x23')]};});_0xd57470[_0xb934('0x24')]=_['map'](_0x253a08,_0xb934('0x1e'));_0xd57470[_0xb934('0x25')]=_[_0xb934('0x26')](_0x4fb92a[_0xb934('0x25')]);_0xd57470[_0xb934('0x27')]=_[_0xb934('0x28')](_0xd57470['model'],_0xd57470[_0xb934('0x25')]);_0x5e818b[_0xb934('0x29')]=_[_0xb934('0x28')](_0xd57470[_0xb934('0x24')],qs[_0xb934('0x2a')](_0x4fb92a[_0xb934('0x25')]['fields']));_0x5e818b[_0xb934('0x29')]=_0x5e818b['attributes']['length']?_0x5e818b['attributes']:_0xd57470[_0xb934('0x24')];if(!_0x4fb92a['query'][_0xb934('0x2b')](_0xb934('0x2c'))){_0x5e818b['limit']=qs[_0xb934('0x14')](_0x4fb92a['query']['limit']);_0x5e818b[_0xb934('0x17')]=qs[_0xb934('0x17')](_0x4fb92a[_0xb934('0x25')]['offset']);}_0x5e818b[_0xb934('0x2d')]=qs[_0xb934('0x2e')](_0x4fb92a['query']['sort']);_0x5e818b['where']=qs['filters'](_['pick'](_0x4fb92a[_0xb934('0x25')],_0xd57470[_0xb934('0x27')]),_0x253a08);if(_0x4fb92a[_0xb934('0x25')][_0xb934('0x2f')]){_0x5e818b[_0xb934('0x30')]=_[_0xb934('0x31')](_0x5e818b[_0xb934('0x30')],{'$or':_[_0xb934('0x20')](_0x253a08,function(_0x3dbc6a){if(_0x3dbc6a['type']!==_0xb934('0x32')){var _0x5cca43={};_0x5cca43[_0x3dbc6a[_0xb934('0x1e')]]={'$like':'%'+_0x4fb92a[_0xb934('0x25')][_0xb934('0x2f')]+'%'};return _0x5cca43;}})});}_0x5e818b=_[_0xb934('0x31')]({},_0x5e818b,_0x4fb92a['options']);var _0x43bca2={'where':_0x5e818b[_0xb934('0x30')]};return db['Network']['count'](_0x43bca2)[_0xb934('0xa')](function(_0x9d5e6d){_0x33127d[_0xb934('0x16')]=_0x9d5e6d;if(_0x4fb92a[_0xb934('0x25')][_0xb934('0x33')]){_0x5e818b['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x5e818b);})['then'](function(_0x553b44){_0x33127d[_0xb934('0x34')]=_0x553b44;return _0x33127d;})[_0xb934('0xa')](respondWithFilteredResult(_0xe0d981,_0x5e818b))['catch'](handleError(_0xe0d981,null));};exports[_0xb934('0x35')]=function(_0x28b1c4,_0x55f5e0){var _0x55d151={'raw':!![],'where':{'id':_0x28b1c4[_0xb934('0x36')]['id']}},_0x576a6c={};_0x576a6c[_0xb934('0x24')]=_[_0xb934('0x26')](db[_0xb934('0x37')][_0xb934('0x38')]);_0x576a6c['query']=_[_0xb934('0x26')](_0x28b1c4[_0xb934('0x25')]);_0x576a6c['filters']=_[_0xb934('0x28')](_0x576a6c['model'],_0x576a6c[_0xb934('0x25')]);_0x55d151[_0xb934('0x29')]=_[_0xb934('0x28')](_0x576a6c[_0xb934('0x24')],qs[_0xb934('0x2a')](_0x28b1c4[_0xb934('0x25')][_0xb934('0x2a')]));_0x55d151[_0xb934('0x29')]=_0x55d151[_0xb934('0x29')][_0xb934('0x39')]?_0x55d151[_0xb934('0x29')]:_0x576a6c[_0xb934('0x24')];if(_0x28b1c4['query']['includeAll']){_0x55d151[_0xb934('0x3a')]=[{'all':!![]}];}_0x55d151=_[_0xb934('0x31')]({},_0x55d151,_0x28b1c4[_0xb934('0x3b')]);return db[_0xb934('0x37')]['find'](_0x55d151)[_0xb934('0xa')](handleEntityNotFound(_0x55f5e0,null))['then'](respondWithResult(_0x55f5e0,null))[_0xb934('0x3c')](handleError(_0x55f5e0,null));};exports['create']=function(_0x248c7a,_0x32feab){var _0x2ca53e;return db[_0xb934('0x37')]['create'](_0x248c7a[_0xb934('0x3d')],{'raw':!![]})[_0xb934('0xa')](function(_0x1b9ef3){_0x2ca53e=_0x1b9ef3;return db[_0xb934('0x37')][_0xb934('0x3e')]({'where':{'type':_0x248c7a[_0xb934('0x3d')][_0xb934('0x22')]},'raw':!![]});})[_0xb934('0xa')](function(_0x28c0fe){if(_0x2ca53e['type'][_0xb934('0x3f')]()==_0xb934('0x40')){var _0x6503d3=fs[_0xb934('0x41')](path[_0xb934('0x42')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xb934('0x43'));var _0x2e3e99=ejs[_0xb934('0x44')](_0x6503d3,{'networks':_0x28c0fe||[]});fs[_0xb934('0x45')](_0xb934('0x46'),_0x2e3e99);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x48'),{'module':'res_stun_monitor.so'});}else if(_0x2ca53e['type'][_0xb934('0x3f')]()==_0xb934('0x49')){var _0x441433=fs[_0xb934('0x41')](path[_0xb934('0x42')](config[_0xb934('0x4a')],'server/files/templates/turn_multiple.ejs'),_0xb934('0x43'));var _0x1f19b9=ejs[_0xb934('0x44')](_0x441433,{'networks':_0x28c0fe||[]});fs[_0xb934('0x45')]('/etc/asterisk/turn_xcally.conf',_0x1f19b9);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x48'),{'module':'res_stun_monitor.so'});}else{var _0x4e6784=fs['readFileSync'](path[_0xb934('0x42')](config[_0xb934('0x4a')],'server/files/templates/network.ejs'),_0xb934('0x43'));var _0x306509=ejs[_0xb934('0x44')](_0x4e6784,{'networks':_0x28c0fe||[]});fs[_0xb934('0x45')](util[_0xb934('0x4b')](_0xb934('0x4c'),_0x248c7a[_0xb934('0x3d')][_0xb934('0x22')]['toLowerCase']()),_0x306509);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x48'),{'module':_0xb934('0x4d')});}})[_0xb934('0xa')](function(){return _0x2ca53e;})['then'](respondWithResult(_0x32feab,0xc9))[_0xb934('0x3c')](handleError(_0x32feab,null));};exports[_0xb934('0x1a')]=function(_0x3d5c93,_0x2512b5){var _0x5568ab;return db[_0xb934('0x37')][_0xb934('0x4e')]({'where':{'id':_0x3d5c93['params']['id']}})[_0xb934('0xa')](handleEntityNotFound(_0x2512b5,null))['then'](saveUpdates(_0x3d5c93[_0xb934('0x3d')],null))[_0xb934('0xa')](function(_0x1d34e9){if(_0x1d34e9){_0x5568ab=_0x1d34e9;return db['Network'][_0xb934('0x3e')]({'where':{'type':_0x5568ab[_0xb934('0x22')]},'raw':!![]});}return null;})[_0xb934('0xa')](function(_0x225cdb){if(_0x5568ab[_0xb934('0x22')][_0xb934('0x3f')]()==_0xb934('0x40')){var _0x4b5b3b=fs[_0xb934('0x41')](path[_0xb934('0x42')](config[_0xb934('0x4a')],_0xb934('0x4f')),_0xb934('0x43'));var _0xef66bc=ejs['render'](_0x4b5b3b,{'networks':_0x225cdb||[]});fs['writeFileSync'](_0xb934('0x46'),_0xef66bc);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x1a'),{'module':'res_stun_monitor.so'});}else if(_0x5568ab[_0xb934('0x22')]['toUpperCase']()==_0xb934('0x49')){var _0x2fc5f5=fs[_0xb934('0x41')](path[_0xb934('0x42')](config[_0xb934('0x4a')],_0xb934('0x50')),'utf8');var _0x241908=ejs[_0xb934('0x44')](_0x2fc5f5,{'networks':_0x225cdb||[]});fs['writeFileSync'](_0xb934('0x51'),_0x241908);return respondWithRpcPromise('Reload',_0xb934('0x1a'),{'module':_0xb934('0x52')});}else{var _0x1f2938=fs[_0xb934('0x41')](path[_0xb934('0x42')](config[_0xb934('0x4a')],_0xb934('0x53')),_0xb934('0x43'));var _0x186cef=ejs[_0xb934('0x44')](_0x1f2938,{'networks':_0x225cdb||[]});fs[_0xb934('0x45')](util[_0xb934('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x3d5c93['body'][_0xb934('0x22')][_0xb934('0x54')]()),_0x186cef);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x1a'),{'module':'chan_sip.so'});}})[_0xb934('0xa')](function(_0xf99dd2){if(_0xf99dd2){return _0x5568ab;}return null;})[_0xb934('0xa')](respondWithResult(_0x2512b5,null))[_0xb934('0x3c')](handleError(_0x2512b5,null));};exports[_0xb934('0x55')]=function(_0x1ccb66,_0x2cdfef){var _0x1508a6;return db[_0xb934('0x37')]['find']({'where':{'id':_0x1ccb66[_0xb934('0x36')]['id']}})[_0xb934('0xa')](function(_0x22307f){_0x1508a6=_0x22307f;return _0x22307f;})[_0xb934('0xa')](handleEntityNotFound(_0x2cdfef,null))[_0xb934('0xa')](removeEntity(_0x2cdfef,null))['then'](function(){if(_0x1508a6){return db['Network']['findAll']({'where':{'type':_0x1508a6['type']},'raw':!![]});}})[_0xb934('0xa')](function(_0x25f11d){if(_0x1508a6[_0xb934('0x22')][_0xb934('0x3f')]()==_0xb934('0x40')){var _0x437d79=fs['readFileSync'](path[_0xb934('0x42')](config[_0xb934('0x4a')],_0xb934('0x4f')),_0xb934('0x43'));var _0x511884=ejs['render'](_0x437d79,{'networks':_0x25f11d||[]});fs[_0xb934('0x45')](_0xb934('0x46'),_0x511884);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x1508a6[_0xb934('0x22')][_0xb934('0x3f')]()==_0xb934('0x49')){var _0x185606=fs[_0xb934('0x41')](path[_0xb934('0x42')](config['root'],_0xb934('0x50')),_0xb934('0x43'));var _0x5ed87f=ejs['render'](_0x185606,{'networks':_0x25f11d||[]});fs[_0xb934('0x45')]('/etc/asterisk/turn_xcally.conf',_0x5ed87f);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x55'),{'module':_0xb934('0x52')});}else{var _0x1d3a94=fs[_0xb934('0x41')](path[_0xb934('0x42')](config[_0xb934('0x4a')],_0xb934('0x53')),_0xb934('0x43'));var _0x9f2b42=ejs[_0xb934('0x44')](_0x1d3a94,{'networks':_0x25f11d||[]});fs[_0xb934('0x45')](util[_0xb934('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x1508a6[_0xb934('0x22')][_0xb934('0x54')]()),_0x9f2b42);return respondWithRpcPromise(_0xb934('0x47'),_0xb934('0x55'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x2cdfef,null));};
\ No newline at end of file
index 551aff6..acf84a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['request-promise','path','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','api','moment','bluebird'];(function(_0x365233,_0x3d2dc6){var _0x2a1547=function(_0x5d89a1){while(--_0x5d89a1){_0x365233['push'](_0x365233['shift']());}};_0x2a1547(++_0x3d2dc6);}(_0xbec5,0xe5));var _0x5bec=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xbec5[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b24=['api','moment','rimraf','./network.attributes','Network','network','util','../../config/logger'];(function(_0x1626e8,_0x545374){var _0x4e3278=function(_0x55cd20){while(--_0x55cd20){_0x1626e8['push'](_0x1626e8['shift']());}};_0x4e3278(++_0x545374);}(_0x6b24,0x1ce));var _0x46b2=function(_0x51fc7c,_0x475586){_0x51fc7c=_0x51fc7c-0x0;var _0x1482a7=_0x6b24[_0x51fc7c];return _0x1482a7;};'use strict';var _=require('lodash');var util=require(_0x46b2('0x0'));var logger=require(_0x46b2('0x1'))(_0x46b2('0x2'));var moment=require(_0x46b2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x46b2('0x4'));var config=require('../../config/environment');var attributes=require(_0x46b2('0x5'));module['exports']=function(_0x2e5227,_0x5598df){return _0x2e5227['define'](_0x46b2('0x6'),attributes,{'tableName':_0x46b2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b0892e..df4b1dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x57d135,_0x48a49b){var _0x239119=function(_0x203dd9){while(--_0x203dd9){_0x57d135['push'](_0x57d135['shift']());}};_0x239119(++_0x48a49b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x4f99c7,_0xf4f41e){_0x4f99c7=_0x4f99c7-0x0;var _0x1752f4=_0x7a54[_0x4f99c7];return _0x1752f4;};'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 078d11e..9f2b733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ccb=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','addApplications','addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAgents'];(function(_0x529022,_0x183d35){var _0x36f580=function(_0x182363){while(--_0x182363){_0x529022['push'](_0x529022['shift']());}};_0x36f580(++_0x183d35);}(_0x4ccb,0x145));var _0xb4cc=function(_0x31f2b9,_0x522806){_0x31f2b9=_0x31f2b9-0x0;var _0x213fa4=_0x4ccb[_0x31f2b9];return _0x213fa4;};'use strict';var multer=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var path=require(_0xb4cc('0x2'));var timeout=require(_0xb4cc('0x3'));var express=require(_0xb4cc('0x4'));var router=express['Router']();var fs_extra=require(_0xb4cc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var controller=require(_0xb4cc('0x8'));router[_0xb4cc('0x9')]('/',auth[_0xb4cc('0xa')](),controller[_0xb4cc('0xb')]);router[_0xb4cc('0x9')]('/describe',auth[_0xb4cc('0xa')](),controller[_0xb4cc('0xc')]);router[_0xb4cc('0x9')](_0xb4cc('0xd'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0xe')]);router[_0xb4cc('0x9')](_0xb4cc('0xf'),auth[_0xb4cc('0xa')](),controller['getDispositions']);router['get'](_0xb4cc('0x10'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x11')]);router['get'](_0xb4cc('0x12'),auth[_0xb4cc('0xa')](),controller['getApplications']);router['get'](_0xb4cc('0x13'),auth[_0xb4cc('0xa')](),controller['getInteractions']);router[_0xb4cc('0x9')](_0xb4cc('0x14'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x15')]);router[_0xb4cc('0x16')]('/',auth['isAuthenticated'](),controller[_0xb4cc('0x17')]);router[_0xb4cc('0x16')](_0xb4cc('0xf'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x18')]);router[_0xb4cc('0x16')]('/:id/canned_answers',auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x19')]);router[_0xb4cc('0x16')]('/:id/notify',controller['notify']);router[_0xb4cc('0x16')](_0xb4cc('0x12'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x1a')]);router[_0xb4cc('0x16')]('/:id/users',auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x1b')]);router[_0xb4cc('0x16')](_0xb4cc('0x1c'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x1d')]);router[_0xb4cc('0x1e')]('/:id',auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x1f')]);router[_0xb4cc('0x20')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xb4cc('0xf'),auth[_0xb4cc('0xa')](),controller[_0xb4cc('0x21')]);router[_0xb4cc('0x20')](_0xb4cc('0x10'),auth[_0xb4cc('0xa')](),controller['removeAnswers']);router[_0xb4cc('0x20')](_0xb4cc('0x14'),auth['isAuthenticated'](),controller[_0xb4cc('0x22')]);module[_0xb4cc('0x23')]=router;
\ No newline at end of file
+var _0x9574=['/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','/:id/notify','/:id/send','put','delete','destroy','removeAnswers','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers'];(function(_0x4c5787,_0x2c96de){var _0xac9099=function(_0x249ff3){while(--_0x249ff3){_0x4c5787['push'](_0x4c5787['shift']());}};_0xac9099(++_0x2c96de);}(_0x9574,0x1dd));var _0x4957=function(_0x36bb63,_0x331157){_0x36bb63=_0x36bb63-0x0;var _0x13ed4c=_0x9574[_0x36bb63];return _0x13ed4c;};'use strict';var multer=require('multer');var util=require(_0x4957('0x0'));var path=require(_0x4957('0x1'));var timeout=require('connect-timeout');var express=require(_0x4957('0x2'));var router=express[_0x4957('0x3')]();var fs_extra=require(_0x4957('0x4'));var auth=require(_0x4957('0x5'));var interaction=require(_0x4957('0x6'));var config=require('../../config/environment');var controller=require(_0x4957('0x7'));router['get']('/',auth[_0x4957('0x8')](),controller[_0x4957('0x9')]);router[_0x4957('0xa')](_0x4957('0xb'),auth[_0x4957('0x8')](),controller[_0x4957('0xc')]);router[_0x4957('0xa')](_0x4957('0xd'),auth[_0x4957('0x8')](),controller[_0x4957('0xe')]);router[_0x4957('0xa')](_0x4957('0xf'),auth[_0x4957('0x8')](),controller[_0x4957('0x10')]);router[_0x4957('0xa')]('/:id/canned_answers',auth[_0x4957('0x8')](),controller[_0x4957('0x11')]);router[_0x4957('0xa')](_0x4957('0x12'),auth[_0x4957('0x8')](),controller[_0x4957('0x13')]);router['get'](_0x4957('0x14'),auth[_0x4957('0x8')](),controller['getInteractions']);router[_0x4957('0xa')](_0x4957('0x15'),auth[_0x4957('0x8')](),controller[_0x4957('0x16')]);router[_0x4957('0x17')]('/',auth[_0x4957('0x8')](),controller[_0x4957('0x18')]);router[_0x4957('0x17')]('/:id/dispositions',auth[_0x4957('0x8')](),controller[_0x4957('0x19')]);router[_0x4957('0x17')](_0x4957('0x1a'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x4957('0x17')](_0x4957('0x1b'),controller['notify']);router[_0x4957('0x17')](_0x4957('0x12'),auth[_0x4957('0x8')](),controller['addApplications']);router['post'](_0x4957('0x15'),auth[_0x4957('0x8')](),controller['addAgents']);router[_0x4957('0x17')](_0x4957('0x1c'),auth['isAuthenticated'](),controller['send']);router[_0x4957('0x1d')]('/:id',auth[_0x4957('0x8')](),controller['update']);router[_0x4957('0x1e')](_0x4957('0xd'),auth[_0x4957('0x8')](),controller[_0x4957('0x1f')]);router[_0x4957('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x4957('0x1e')](_0x4957('0x1a'),auth[_0x4957('0x8')](),controller[_0x4957('0x20')]);router[_0x4957('0x1e')](_0x4957('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 82ec938..faacaca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c3=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT'];(function(_0x2c6431,_0x19f934){var _0x43de19=function(_0x561f96){while(--_0x561f96){_0x2c6431['push'](_0x2c6431['shift']());}};_0x43de19(++_0x19f934);}(_0x97c3,0xbd));var _0x397c=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x97c3[_0x7b173];return _0x1c598c;};'use strict';var Sequelize=require(_0x397c('0x0'));var rs=require(_0x397c('0x1'));module[_0x397c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x397c('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x397c('0x4')]();}},'replyUri':{'type':Sequelize[_0x397c('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x397c('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x397c('0x5')],'defaultValue':function(){return _0x397c('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x397c('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x397c('0x3')]},'queueTransfer':{'type':Sequelize[_0x397c('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x397c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x397c('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x397c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x397c('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x397c('0x7')],'defaultValue':![],'comment':_0x397c('0x9'),'set':function(_0x203458){if(!_0x203458)this[_0x397c('0xa')](_0x397c('0xb'),null);this[_0x397c('0xa')](_0x397c('0xc'),_0x203458);}}};
\ No newline at end of file
+var _0xcc26=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','TEXT','BOOLEAN'];(function(_0x3f366b,_0x28e382){var _0x54bb94=function(_0x531832){while(--_0x531832){_0x3f366b['push'](_0x3f366b['shift']());}};_0x54bb94(++_0x28e382);}(_0xcc26,0x17f));var _0x6cc2=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xcc26[_0x38eb23];return _0x48506a;};'use strict';var Sequelize=require(_0x6cc2('0x0'));var rs=require('randomstring');module[_0x6cc2('0x1')]={'name':{'type':Sequelize[_0x6cc2('0x2')],'unique':_0x6cc2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6cc2('0x2')]},'token':{'type':Sequelize[_0x6cc2('0x2')],'defaultValue':function(){return rs[_0x6cc2('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6cc2('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6cc2('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6cc2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6cc2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6cc2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x6cc2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6cc2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6cc2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6cc2('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6cc2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6cc2('0x6')],'defaultValue':![],'comment':_0x6cc2('0x9'),'set':function(_0x37bacd){if(!_0x37bacd)this[_0x6cc2('0xa')](_0x6cc2('0xb'),null);this[_0x6cc2('0xa')](_0x6cc2('0xc'),_0x37bacd);}}};
\ No newline at end of file
index 5e6c3b1..67c2ab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e5c=['http','request','then','info','request\x20sent','debug','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','update','get','OpenchannelAccounts','UserProfileResource','destroy','end','stack','name','send','map','OpenchannelAccount','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','includeAll','include','findAll','rows','show','params','Pause','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','OpenchannelAccountId','Disposition','rawAttributes','length','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from','Sequelize','from\x20is\x20mandatory','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','finally','getApplications','Contact','Tag','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','client'];(function(_0x21899f,_0x362b5b){var _0x1672ea=function(_0x4ab4ab){while(--_0x4ab4ab){_0x21899f['push'](_0x21899f['shift']());}};_0x1672ea(++_0x362b5b);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x40781a,_0x42bdf2){_0x40781a=_0x40781a-0x0;var _0x1148e6=_0x3e5c[_0x40781a];return _0x1148e6;};'use strict';var emlformat=require(_0xc3e5('0x0'));var rimraf=require(_0xc3e5('0x1'));var zipdir=require(_0xc3e5('0x2'));var jsonpatch=require(_0xc3e5('0x3'));var rp=require('request-promise');var moment=require(_0xc3e5('0x4'));var BPromise=require(_0xc3e5('0x5'));var Mustache=require(_0xc3e5('0x6'));var util=require(_0xc3e5('0x7'));var path=require(_0xc3e5('0x8'));var sox=require(_0xc3e5('0x9'));var csv=require('to-csv');var ejs=require(_0xc3e5('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e5('0xb'));var _=require(_0xc3e5('0xc'));var squel=require(_0xc3e5('0xd'));var crypto=require(_0xc3e5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e5('0xf'));var toCsv=require(_0xc3e5('0x10'));var querystring=require(_0xc3e5('0x11'));var Papa=require(_0xc3e5('0x12'));var Redis=require(_0xc3e5('0x13'));var authService=require(_0xc3e5('0x14'));var qs=require(_0xc3e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e5('0x16'));var logger=require(_0xc3e5('0x17'))(_0xc3e5('0x18'));var utils=require(_0xc3e5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e5('0x1a'));var db=require(_0xc3e5('0x1b'))['db'];config[_0xc3e5('0x1c')]=_[_0xc3e5('0x1d')](config[_0xc3e5('0x1c')],{'host':_0xc3e5('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xc3e5('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc3e5('0x20')][_0xc3e5('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xc3e5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3e3eaa,_0x2cc476,_0x1829f9,_0x43abef){return new BPromise(function(_0x47cfd8,_0x38d0ad){var _0x277063=_0x43abef||client;return _0x277063[_0xc3e5('0x22')](_0x3e3eaa,_0x1829f9)[_0xc3e5('0x23')](function(_0x1e884a){logger[_0xc3e5('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x2cc476,_0xc3e5('0x25'));logger[_0xc3e5('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2cc476,_0xc3e5('0x25'),JSON['stringify'](_0x1e884a));if(_0x1e884a[_0xc3e5('0x27')]){if(_0x1e884a[_0xc3e5('0x27')][_0xc3e5('0x28')]===0x1f4){logger[_0xc3e5('0x27')](_0xc3e5('0x29'),_0x2cc476,_0x1e884a['error'][_0xc3e5('0x2a')]);return _0x38d0ad(_0x1e884a[_0xc3e5('0x27')][_0xc3e5('0x2a')]);}logger[_0xc3e5('0x27')](_0xc3e5('0x29'),_0x2cc476,_0x1e884a[_0xc3e5('0x27')][_0xc3e5('0x2a')]);return _0x47cfd8(_0x1e884a['error'][_0xc3e5('0x2a')]);}else{logger[_0xc3e5('0x24')](_0xc3e5('0x29'),_0x2cc476,_0xc3e5('0x25'));_0x47cfd8(_0x1e884a[_0xc3e5('0x2b')][_0xc3e5('0x2a')]);}})[_0xc3e5('0x2c')](function(_0x45556e){logger['error'](_0xc3e5('0x29'),_0x2cc476,_0x45556e);_0x38d0ad(_0x45556e);});});}function respondWithStatusCode(_0x4c33d9,_0x4c0cf4){_0x4c0cf4=_0x4c0cf4||0xcc;return function(_0x8815af){if(_0x8815af){return _0x4c33d9[_0xc3e5('0x2d')](_0x4c0cf4);}return _0x4c33d9[_0xc3e5('0x2e')](_0x4c0cf4)['end']();};}function respondWithResult(_0x31f49b,_0x38a961){_0x38a961=_0x38a961||0xc8;return function(_0x2d3702){if(_0x2d3702){return _0x31f49b[_0xc3e5('0x2e')](_0x38a961)['json'](_0x2d3702);}};}function respondWithFilteredResult(_0xa6766d,_0x497ecf){return function(_0x45ca6d){if(_0x45ca6d){var _0xc0e6e7=typeof _0x497ecf[_0xc3e5('0x2f')]==='undefined'&&typeof _0x497ecf['limit']==='undefined';var _0x1dcc51=_0x45ca6d[_0xc3e5('0x30')];var _0x144172=_0xc0e6e7?0x0:_0x497ecf[_0xc3e5('0x2f')];var _0xeea535=_0xc0e6e7?_0x45ca6d[_0xc3e5('0x30')]:_0x497ecf['offset']+_0x497ecf[_0xc3e5('0x31')];var _0x2ecda2;if(_0xeea535>=_0x1dcc51){_0xeea535=_0x1dcc51;_0x2ecda2=0xc8;}else{_0x2ecda2=0xce;}_0xa6766d[_0xc3e5('0x2e')](_0x2ecda2);return _0xa6766d[_0xc3e5('0x32')](_0xc3e5('0x33'),_0x144172+'-'+_0xeea535+'/'+_0x1dcc51)[_0xc3e5('0x34')](_0x45ca6d);}return null;};}function patchUpdates(_0x471317){return function(_0x133a46){try{jsonpatch[_0xc3e5('0x35')](_0x133a46,_0x471317,!![]);}catch(_0x8a084f){return BPromise[_0xc3e5('0x36')](_0x8a084f);}return _0x133a46['save']();};}function saveUpdates(_0x3d7b87,_0x4a8bd4){return function(_0x322891){if(_0x322891){return _0x322891[_0xc3e5('0x37')](_0x3d7b87)[_0xc3e5('0x23')](function(_0x1d7c3a){return _0x1d7c3a;});}return null;};}function removeEntity(_0x5af959,_0x1de880){return function(_0x5e576b){if(_0x5e576b){return _0x5e576b['destroy']()[_0xc3e5('0x23')](function(){var _0x4f6fe1=_0x5e576b[_0xc3e5('0x38')]({'plain':!![]});var _0x3952dd=_0xc3e5('0x39');return db[_0xc3e5('0x3a')][_0xc3e5('0x3b')]({'where':{'type':_0x3952dd,'resourceId':_0x4f6fe1['id']}})['then'](function(){return _0x5e576b;});})[_0xc3e5('0x23')](function(){_0x5af959[_0xc3e5('0x2e')](0xcc)[_0xc3e5('0x3c')]();});}};}function handleEntityNotFound(_0xe62f2d,_0x32135c){return function(_0x57a919){if(!_0x57a919){_0xe62f2d[_0xc3e5('0x2d')](0x194);}return _0x57a919;};}function handleError(_0x484e21,_0x219ca5){_0x219ca5=_0x219ca5||0x1f4;return function(_0x29ea43){logger['error'](_0x29ea43[_0xc3e5('0x3d')]);if(_0x29ea43['name']){delete _0x29ea43[_0xc3e5('0x3e')];}_0x484e21[_0xc3e5('0x2e')](_0x219ca5)[_0xc3e5('0x3f')](_0x29ea43);};}exports['index']=function(_0xfe940f,_0x3c496f){var _0xc410aa={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xb81cef={},_0x80a2e2={'count':0x0,'rows':[]};var _0x5ebe00=_[_0xc3e5('0x40')](db[_0xc3e5('0x41')]['rawAttributes'],function(_0x35358e){return{'name':_0x35358e['fieldName'],'type':_0x35358e[_0xc3e5('0x42')]['key']};});_0xb81cef[_0xc3e5('0x43')]=_['map'](_0x5ebe00,_0xc3e5('0x3e'));_0xb81cef[_0xc3e5('0x44')]=_[_0xc3e5('0x45')](_0xfe940f[_0xc3e5('0x44')]);_0xb81cef[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0xb81cef['model'],_0xb81cef['query']);_0xc410aa[_0xc3e5('0x48')]=_['intersection'](_0xb81cef[_0xc3e5('0x43')],qs[_0xc3e5('0x49')](_0xfe940f[_0xc3e5('0x44')][_0xc3e5('0x49')]));_0xc410aa[_0xc3e5('0x48')]=_0xc410aa[_0xc3e5('0x48')]['length']?_0xc410aa[_0xc3e5('0x48')]:_0xb81cef[_0xc3e5('0x43')];if(!_0xfe940f[_0xc3e5('0x44')][_0xc3e5('0x4a')](_0xc3e5('0x4b'))){_0xc410aa[_0xc3e5('0x31')]=qs[_0xc3e5('0x31')](_0xfe940f[_0xc3e5('0x44')][_0xc3e5('0x31')]);_0xc410aa[_0xc3e5('0x2f')]=qs['offset'](_0xfe940f['query']['offset']);}_0xc410aa[_0xc3e5('0x4c')]=qs['sort'](_0xfe940f[_0xc3e5('0x44')][_0xc3e5('0x4d')]);_0xc410aa[_0xc3e5('0x4e')]=qs[_0xc3e5('0x46')](_['pick'](_0xfe940f[_0xc3e5('0x44')],_0xb81cef[_0xc3e5('0x46')]),_0x5ebe00);if(_0xfe940f[_0xc3e5('0x44')][_0xc3e5('0x4f')]){_0xc410aa['where']=_['merge'](_0xc410aa[_0xc3e5('0x4e')],{'$or':_[_0xc3e5('0x40')](_0x5ebe00,function(_0x4c6974){if(_0x4c6974[_0xc3e5('0x42')]!=='VIRTUAL'){var _0xdd42ac={};_0xdd42ac[_0x4c6974['name']]={'$like':'%'+_0xfe940f[_0xc3e5('0x44')]['filter']+'%'};return _0xdd42ac;}})});}_0xc410aa=_['merge']({},_0xc410aa,_0xfe940f['options']);var _0x87855d={'where':_0xc410aa[_0xc3e5('0x4e')]};return db[_0xc3e5('0x41')]['count'](_0x87855d)['then'](function(_0x2f9d0c){_0x80a2e2['count']=_0x2f9d0c;if(_0xfe940f[_0xc3e5('0x44')][_0xc3e5('0x50')]){_0xc410aa[_0xc3e5('0x51')]=[{'all':!![]}];}return db[_0xc3e5('0x41')][_0xc3e5('0x52')](_0xc410aa);})[_0xc3e5('0x23')](function(_0x5cd31c){_0x80a2e2[_0xc3e5('0x53')]=_0x5cd31c;return _0x80a2e2;})['then'](respondWithFilteredResult(_0x3c496f,_0xc410aa))['catch'](handleError(_0x3c496f,null));};exports[_0xc3e5('0x54')]=function(_0x5c7fc8,_0x38f5db){var _0x567343={'raw':![],'where':{'id':_0x5c7fc8[_0xc3e5('0x55')]['id']},'include':[{'model':db[_0xc3e5('0x56')],'as':'mandatoryDispositionPause'}]},_0x4eb2e1={};_0x4eb2e1['model']=_[_0xc3e5('0x45')](db[_0xc3e5('0x41')]['rawAttributes']);_0x4eb2e1[_0xc3e5('0x44')]=_[_0xc3e5('0x45')](_0x5c7fc8[_0xc3e5('0x44')]);_0x4eb2e1[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0x4eb2e1[_0xc3e5('0x43')],_0x4eb2e1[_0xc3e5('0x44')]);_0x567343['attributes']=_[_0xc3e5('0x47')](_0x4eb2e1[_0xc3e5('0x43')],qs['fields'](_0x5c7fc8['query'][_0xc3e5('0x49')]));_0x567343[_0xc3e5('0x48')]=_0x567343['attributes']['length']?_0x567343['attributes']:_0x4eb2e1['model'];if(_0x5c7fc8[_0xc3e5('0x44')][_0xc3e5('0x50')]){_0x567343[_0xc3e5('0x51')]=[{'all':!![]}];}_0x567343=_[_0xc3e5('0x57')]({},_0x567343,_0x5c7fc8[_0xc3e5('0x58')]);return db['OpenchannelAccount'][_0xc3e5('0x59')](_0x567343)[_0xc3e5('0x23')](handleEntityNotFound(_0x38f5db,null))[_0xc3e5('0x23')](respondWithResult(_0x38f5db,null))['catch'](handleError(_0x38f5db,null));};exports[_0xc3e5('0x5a')]=function(_0x4079ef,_0x18e774){return db[_0xc3e5('0x41')][_0xc3e5('0x5a')](_0x4079ef['body'],{})['then'](function(_0x2a4396){var _0x2efe19=_0x4079ef['user'][_0xc3e5('0x38')]({'plain':!![]});if(!_0x2efe19)throw new Error(_0xc3e5('0x5b'));if(_0x2efe19['role']===_0xc3e5('0x5c')){var _0x9ec7d5=_0x2a4396[_0xc3e5('0x38')]({'plain':!![]});var _0x378fdf=_0xc3e5('0x39');return db[_0xc3e5('0x5d')][_0xc3e5('0x59')]({'where':{'name':_0x378fdf,'userProfileId':_0x2efe19[_0xc3e5('0x5e')]},'raw':!![]})['then'](function(_0x35d2b2){if(_0x35d2b2&&_0x35d2b2[_0xc3e5('0x5f')]===0x0){return db[_0xc3e5('0x3a')]['create']({'name':_0x9ec7d5['name'],'resourceId':_0x9ec7d5['id'],'type':_0x35d2b2[_0xc3e5('0x3e')],'sectionId':_0x35d2b2['id']},{})[_0xc3e5('0x23')](function(){return _0x2a4396;});}else{return _0x2a4396;}})[_0xc3e5('0x2c')](function(_0x27157c){logger[_0xc3e5('0x27')](_0xc3e5('0x60'),_0x27157c);throw _0x27157c;});}return _0x2a4396;})['then'](respondWithResult(_0x18e774,0xc9))[_0xc3e5('0x2c')](handleError(_0x18e774,null));};exports['update']=function(_0xdc503b,_0xe72090){if(_0xdc503b[_0xc3e5('0x61')]['id']){delete _0xdc503b[_0xc3e5('0x61')]['id'];}return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0xdc503b[_0xc3e5('0x55')]['id']},'include':[{'model':db[_0xc3e5('0x56')],'as':_0xc3e5('0x62')}]})[_0xc3e5('0x23')](handleEntityNotFound(_0xe72090,null))['then'](saveUpdates(_0xdc503b['body'],null))[_0xc3e5('0x23')](respondWithResult(_0xe72090,null))[_0xc3e5('0x2c')](handleError(_0xe72090,null));};exports[_0xc3e5('0x3b')]=function(_0x217dda,_0x198e90){return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0x217dda[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x198e90,null))['then'](removeEntity(_0x198e90,null))['catch'](handleError(_0x198e90,null));};exports[_0xc3e5('0x63')]=function(_0x1a8d1c,_0x44bf4f){return db[_0xc3e5('0x41')]['describe']()[_0xc3e5('0x23')](respondWithResult(_0x44bf4f,null))[_0xc3e5('0x2c')](handleError(_0x44bf4f,null));};exports['addDisposition']=function(_0x1cf94c,_0x447bdc,_0x14680e){if(_0x1cf94c[_0xc3e5('0x61')]['id']){delete _0x1cf94c['body']['id'];}return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0x1cf94c['params']['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x447bdc,null))[_0xc3e5('0x23')](function(_0x215509){if(_0x215509){_0x1cf94c[_0xc3e5('0x61')][_0xc3e5('0x64')]=_0x215509['id'];return db[_0xc3e5('0x65')][_0xc3e5('0x5a')](_0x1cf94c[_0xc3e5('0x61')]);}})[_0xc3e5('0x23')](respondWithResult(_0x447bdc,null))[_0xc3e5('0x2c')](handleError(_0x447bdc,null));};exports['getDispositions']=function(_0x209126,_0x1de7d1,_0x65c755){var _0x1c2647={'raw':![],'where':{}};var _0x264eb4={};var _0x600ed8={'count':0x0,'rows':[]};return db[_0xc3e5('0x41')]['findOne']({'where':{'id':_0x209126[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x1de7d1,null))[_0xc3e5('0x23')](function(_0x45f4f7){if(_0x45f4f7){_0x264eb4[_0xc3e5('0x43')]=_[_0xc3e5('0x45')](db[_0xc3e5('0x65')][_0xc3e5('0x66')]);_0x264eb4['query']=_['keys'](_0x209126[_0xc3e5('0x44')]);_0x264eb4[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0x264eb4[_0xc3e5('0x43')],_0x264eb4[_0xc3e5('0x44')]);_0x1c2647[_0xc3e5('0x48')]=_['intersection'](_0x264eb4['model'],qs[_0xc3e5('0x49')](_0x209126[_0xc3e5('0x44')][_0xc3e5('0x49')]));_0x1c2647['attributes']=_0x1c2647[_0xc3e5('0x48')][_0xc3e5('0x67')]?_0x1c2647[_0xc3e5('0x48')]:_0x264eb4[_0xc3e5('0x43')];if(!_0x209126['query'][_0xc3e5('0x4a')]('nolimit')){_0x1c2647[_0xc3e5('0x31')]=qs[_0xc3e5('0x31')](_0x209126['query']['limit']);_0x1c2647[_0xc3e5('0x2f')]=qs[_0xc3e5('0x2f')](_0x209126[_0xc3e5('0x44')][_0xc3e5('0x2f')]);}_0x1c2647[_0xc3e5('0x4c')]=qs[_0xc3e5('0x4d')](_0x209126['query'][_0xc3e5('0x4d')]);_0x1c2647[_0xc3e5('0x4e')]=qs['filters'](_[_0xc3e5('0x68')](_0x209126[_0xc3e5('0x44')],_0x264eb4[_0xc3e5('0x46')]));_0x1c2647[_0xc3e5('0x4e')]['OpenchannelAccountId']=_0x45f4f7['id'];if(_0x209126[_0xc3e5('0x44')][_0xc3e5('0x4f')]){_0x1c2647['where']=_[_0xc3e5('0x57')](_0x1c2647['where'],{'$or':_['map'](_0x1c2647[_0xc3e5('0x48')],function(_0x957419){var _0x1164b5={};_0x1164b5[_0x957419]={'$like':'%'+_0x209126[_0xc3e5('0x44')]['filter']+'%'};return _0x1164b5;})});}_0x1c2647=_['merge']({},_0x1c2647,_0x209126[_0xc3e5('0x58')]);return db[_0xc3e5('0x65')][_0xc3e5('0x30')]({'where':_0x1c2647[_0xc3e5('0x4e')]})[_0xc3e5('0x23')](function(_0x5c7945){_0x600ed8[_0xc3e5('0x30')]=_0x5c7945;if(_0x209126[_0xc3e5('0x44')][_0xc3e5('0x50')]){_0x1c2647[_0xc3e5('0x51')]=[{'all':!![]}];}return db[_0xc3e5('0x65')][_0xc3e5('0x52')](_0x1c2647);})[_0xc3e5('0x23')](function(_0x4bd008){_0x600ed8[_0xc3e5('0x53')]=_0x4bd008;return _0x600ed8;});}})[_0xc3e5('0x23')](respondWithFilteredResult(_0x1de7d1,_0x1c2647))[_0xc3e5('0x2c')](handleError(_0x1de7d1,null));};exports[_0xc3e5('0x69')]=function(_0x33432a,_0x4542c1,_0x587736){return db[_0xc3e5('0x41')]['find']({'where':{'id':_0x33432a[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x4542c1,null))[_0xc3e5('0x23')](function(_0x245149){if(_0x245149){return _0x245149['removeDispositions'](_0x33432a[_0xc3e5('0x44')][_0xc3e5('0x6a')]);}})[_0xc3e5('0x23')](respondWithStatusCode(_0x4542c1,null))[_0xc3e5('0x2c')](handleError(_0x4542c1,null));};exports[_0xc3e5('0x6b')]=function(_0x375560,_0x38f8a5,_0x109a07){if(_0x375560[_0xc3e5('0x61')]['id']){delete _0x375560[_0xc3e5('0x61')]['id'];}return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0x375560['params']['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x38f8a5,null))[_0xc3e5('0x23')](function(_0x1717bd){if(_0x1717bd){_0x375560[_0xc3e5('0x61')][_0xc3e5('0x64')]=_0x1717bd['id'];return db['CannedAnswer']['create'](_0x375560[_0xc3e5('0x61')]);}})['then'](respondWithResult(_0x38f8a5,null))[_0xc3e5('0x2c')](handleError(_0x38f8a5,null));};exports[_0xc3e5('0x6c')]=function(_0x2953ad,_0x1fcb85,_0xa3c477){var _0x52aaa8={'raw':![],'where':{}};var _0x217e1b={};var _0x1ee85a={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2953ad[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x1fcb85,null))[_0xc3e5('0x23')](function(_0x3e3fd9){if(_0x3e3fd9){_0x217e1b[_0xc3e5('0x43')]=_[_0xc3e5('0x45')](db[_0xc3e5('0x6d')][_0xc3e5('0x66')]);_0x217e1b['query']=_[_0xc3e5('0x45')](_0x2953ad[_0xc3e5('0x44')]);_0x217e1b[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0x217e1b['model'],_0x217e1b[_0xc3e5('0x44')]);_0x52aaa8['attributes']=_[_0xc3e5('0x47')](_0x217e1b[_0xc3e5('0x43')],qs['fields'](_0x2953ad[_0xc3e5('0x44')][_0xc3e5('0x49')]));_0x52aaa8['attributes']=_0x52aaa8['attributes'][_0xc3e5('0x67')]?_0x52aaa8[_0xc3e5('0x48')]:_0x217e1b[_0xc3e5('0x43')];if(!_0x2953ad[_0xc3e5('0x44')]['hasOwnProperty'](_0xc3e5('0x4b'))){_0x52aaa8['limit']=qs[_0xc3e5('0x31')](_0x2953ad[_0xc3e5('0x44')][_0xc3e5('0x31')]);_0x52aaa8[_0xc3e5('0x2f')]=qs[_0xc3e5('0x2f')](_0x2953ad['query'][_0xc3e5('0x2f')]);}_0x52aaa8[_0xc3e5('0x4c')]=qs[_0xc3e5('0x4d')](_0x2953ad[_0xc3e5('0x44')][_0xc3e5('0x4d')]);_0x52aaa8[_0xc3e5('0x4e')]=qs[_0xc3e5('0x46')](_['pick'](_0x2953ad[_0xc3e5('0x44')],_0x217e1b[_0xc3e5('0x46')]));_0x52aaa8['where']['OpenchannelAccountId']=_0x3e3fd9['id'];if(_0x2953ad[_0xc3e5('0x44')][_0xc3e5('0x4f')]){_0x52aaa8['where']=_['merge'](_0x52aaa8['where'],{'$or':_[_0xc3e5('0x40')](_0x52aaa8['attributes'],function(_0x1c6dbe){var _0x25e437={};_0x25e437[_0x1c6dbe]={'$like':'%'+_0x2953ad['query']['filter']+'%'};return _0x25e437;})});}_0x52aaa8=_[_0xc3e5('0x57')]({},_0x52aaa8,_0x2953ad[_0xc3e5('0x58')]);return db[_0xc3e5('0x6d')][_0xc3e5('0x30')]({'where':_0x52aaa8[_0xc3e5('0x4e')]})['then'](function(_0x54b9b1){_0x1ee85a[_0xc3e5('0x30')]=_0x54b9b1;if(_0x2953ad['query'][_0xc3e5('0x50')]){_0x52aaa8[_0xc3e5('0x51')]=[{'all':!![]}];}return db[_0xc3e5('0x6d')][_0xc3e5('0x52')](_0x52aaa8);})[_0xc3e5('0x23')](function(_0x2fc1e8){_0x1ee85a[_0xc3e5('0x53')]=_0x2fc1e8;return _0x1ee85a;});}})['then'](respondWithFilteredResult(_0x1fcb85,_0x52aaa8))['catch'](handleError(_0x1fcb85,null));};exports[_0xc3e5('0x6e')]=function(_0x59133c,_0x3deb85,_0x2e3ed3){return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0x59133c[_0xc3e5('0x55')]['id']}})['then'](handleEntityNotFound(_0x3deb85,null))[_0xc3e5('0x23')](function(_0x220324){if(_0x220324){return _0x220324[_0xc3e5('0x6e')](_0x59133c[_0xc3e5('0x44')][_0xc3e5('0x6a')]);}})['then'](respondWithStatusCode(_0x3deb85,null))[_0xc3e5('0x2c')](handleError(_0x3deb85,null));};exports[_0xc3e5('0x6f')]=function(_0x10cc1e,_0x39144f,_0xfa87be){var _0x3e0b5b={'body':_0x10cc1e[_0xc3e5('0x61')],'channel':_0xc3e5('0x70')};var _0x5add78=[];var _0x382d31=[];var _0x270fbf={};var _0x36a6bf=![];return db['CmContact'][_0xc3e5('0x63')]()[_0xc3e5('0x23')](function(_0x2066fc){if(!_0x2066fc){throw new db['Sequelize']['ValidationError'](_0xc3e5('0x71'));}_0x5add78=_[_0xc3e5('0x72')](_[_0xc3e5('0x45')](_0x2066fc),[_0xc3e5('0x73'),_0xc3e5('0x74')]);_0x382d31=_['difference'](_[_0xc3e5('0x45')](_0x2066fc),['createdAt',_0xc3e5('0x74'),'CompanyId','ListId']);if(_0x10cc1e[_0xc3e5('0x61')]['id']){delete _0x10cc1e[_0xc3e5('0x61')]['id'];}if(_[_0xc3e5('0x75')](_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x76')])){throw new db[(_0xc3e5('0x77'))]['ValidationError'](_0xc3e5('0x78'));}if(_[_0xc3e5('0x75')](_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x61')])||_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x61')]===''){throw new db['Sequelize'][(_0xc3e5('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc3e5('0x75')](_0x10cc1e[_0xc3e5('0x61')]['mapKey'])){throw new db[(_0xc3e5('0x77'))][(_0xc3e5('0x79'))](_0xc3e5('0x7a')+_0x382d31);}if(!_['includes'](_0x382d31,_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x7b')])){throw new db['Sequelize'][(_0xc3e5('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x382d31);}_0x270fbf[_0x10cc1e[_0xc3e5('0x61')]['mapKey']]=_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x76')];})[_0xc3e5('0x23')](function(){return db[_0xc3e5('0x41')]['find']({'where':{'id':_0x10cc1e[_0xc3e5('0x55')]['id']},'include':[{'model':db[_0xc3e5('0x7c')],'as':_0xc3e5('0x7d'),'include':[{'model':db[_0xc3e5('0x7e')],'as':_0xc3e5('0x7f'),'where':_0x270fbf,'limit':0x1,'order':[[_0xc3e5('0x74'),_0xc3e5('0x80')]]}]},{'model':db[_0xc3e5('0x81')],'as':_0xc3e5('0x82')}]});})['then'](handleEntityNotFound(_0x39144f,null))[_0xc3e5('0x23')](function(_0x119c5a){if(_0x119c5a&&_0x119c5a[_0xc3e5('0x7d')]){_0x3e0b5b[_0xc3e5('0x83')]=_0x119c5a;_0x3e0b5b[_0xc3e5('0x84')]=_0x119c5a[_0xc3e5('0x82')];_0x3e0b5b[_0xc3e5('0x85')]=_0x119c5a[_0xc3e5('0x7d')];_0x3e0b5b['applications']=_[_0xc3e5('0x86')](_0x3e0b5b['applications'],[_0xc3e5('0x87')],[_0xc3e5('0x88')]);if(_0x3e0b5b[_0xc3e5('0x83')][_0xc3e5('0x82')]){delete _0x3e0b5b[_0xc3e5('0x83')][_0xc3e5('0x82')];}if(_0x3e0b5b['account'][_0xc3e5('0x7d')]&&_0x3e0b5b[_0xc3e5('0x83')][_0xc3e5('0x7d')][_0xc3e5('0x7f')][_0xc3e5('0x67')]){return _0x3e0b5b['account']['List'][_0xc3e5('0x7f')][0x0];}var _0x221405=_[_0xc3e5('0x1d')](_0x10cc1e[_0xc3e5('0x61')],{'firstName':_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x76')],'ListId':_0x119c5a[_0xc3e5('0x89')]});_0x221405[_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x7b')]]=_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x76')];return db[_0xc3e5('0x7e')][_0xc3e5('0x5a')](_0x221405,{'fields':_0x5add78,'raw':!![]});}})['then'](handleEntityNotFound(_0x39144f,null))[_0xc3e5('0x23')](function(_0x280640){_0x3e0b5b[_0xc3e5('0x8a')]=_0x280640;if(_0x280640){var _0x12543a={'ContactId':_0x280640['id'],'OpenchannelAccountId':_0x10cc1e[_0xc3e5('0x55')]['id'],'from':(_0x280640[_0xc3e5('0x8b')]||'')+'\x20'+(_0x280640[_0xc3e5('0x8c')]||'')};var _0x5137e2={'OpenchannelAccountId':_0x10cc1e['params']['id'],'closed':![]};if(_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x8d')]){_0x5137e2[_0xc3e5('0x8d')]=_0x10cc1e['body'][_0xc3e5('0x8d')];return db[_0xc3e5('0x8e')][_0xc3e5('0x59')]({'where':_0x5137e2})[_0xc3e5('0x23')](function(_0x1b61b7){if(_0x1b61b7){return[_0x1b61b7,![]];}_0x12543a['threadId']=_0x10cc1e['body'][_0xc3e5('0x8d')];_0x12543a['externalUrl']=_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x8f')];return db[_0xc3e5('0x8e')]['create'](_0x12543a)['then'](function(_0x1e5d7d){return[_0x1e5d7d,!![]];});});}else{_0x5137e2[_0xc3e5('0x8d')]=null;}_0x5137e2[_0xc3e5('0x90')]=_0x280640['id'];return db['OpenchannelInteraction']['find']({'where':_0x5137e2})[_0xc3e5('0x23')](function(_0x2f260b){if(_0x2f260b){return[_0x2f260b,![]];}return db[_0xc3e5('0x8e')][_0xc3e5('0x5a')](_0x12543a)[_0xc3e5('0x23')](function(_0x4c4fc6){return[_0x4c4fc6,!![]];});});}})['spread'](function(_0x3b6804,_0x1ee859){if(_0x3b6804){_0x36a6bf=_0x1ee859;if(!_0x1ee859){var _0x2681d5={'from':(_0x3e0b5b[_0xc3e5('0x8a')][_0xc3e5('0x8b')]||'')+'\x20'+(_0x3e0b5b[_0xc3e5('0x8a')][_0xc3e5('0x8c')]||'')};if(_0x10cc1e[_0xc3e5('0x61')]['threadId']&&_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x91')]&&_0x10cc1e['body']['threadId']!=_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x91')]){_0x2681d5[_0xc3e5('0x8d')]=_0x10cc1e[_0xc3e5('0x61')][_0xc3e5('0x91')];}return _0x3b6804['update'](_0x2681d5);}else{return _0x3b6804;}}})[_0xc3e5('0x23')](function(_0xd528ad){_0x3e0b5b[_0xc3e5('0x92')]=_0xd528ad['get']({'plain':!![]});_0x3e0b5b[_0xc3e5('0x92')][_0xc3e5('0x93')]=_0x36a6bf;if(_0x3e0b5b['interaction'][_0xc3e5('0x93')]){if(_0x3e0b5b[_0xc3e5('0x83')][_0xc3e5('0x94')]){_0x3e0b5b[_0xc3e5('0x84')][_0xc3e5('0x95')]({'id':0x0,'priority':_0x3e0b5b[_0xc3e5('0x84')][_0xc3e5('0x67')]+0x1,'app':_0xc3e5('0x96'),'appdata':'unmanaged','interval':_0xc3e5('0x97')});}}return db['OpenchannelMessage']['create']({'body':_0x10cc1e[_0xc3e5('0x61')]['body'],'OpenchannelAccountId':_0x10cc1e['params']['id'],'OpenchannelInteractionId':_0xd528ad['id'],'direction':'in','ContactId':_0x3e0b5b['contact']['id'],'AttachmentId':_0x10cc1e[_0xc3e5('0x61')]['AttachmentId']});})[_0xc3e5('0x23')](function(_0x132aad){_0x3e0b5b[_0xc3e5('0x2a')]=_0x132aad;if(_0x3e0b5b[_0xc3e5('0x92')][_0xc3e5('0x98')]){return db[_0xc3e5('0x99')][_0xc3e5('0x59')]({'attributes':['id',_0xc3e5('0x3e')],'where':{'id':_0x3e0b5b[_0xc3e5('0x92')]['UserId']}})[_0xc3e5('0x23')](function(_0x553ec2){if(_0x553ec2){_0x3e0b5b[_0xc3e5('0x84')][_0xc3e5('0x9a')]({'id':0x0,'priority':0x0,'app':_0xc3e5('0x9b'),'appdata':_0x553ec2[_0xc3e5('0x3e')]+','+(_0x3e0b5b[_0xc3e5('0x83')][_0xc3e5('0x9c')]||0xa),'interval':_0xc3e5('0x97')});_0x3e0b5b[_0xc3e5('0x9d')]=![];}return respondWithRpcPromise(_0xc3e5('0x9e'),_0xc3e5('0x9f'),_0x3e0b5b);});}return respondWithRpcPromise(_0xc3e5('0x9e'),'startRouting',_0x3e0b5b);})[_0xc3e5('0x23')](function(_0x3b5763){respondWithRpcPromise(_0xc3e5('0xa0'),_0xc3e5('0xa0'),{'event':_0xc3e5('0x6f'),'message':_0x3b5763},client9002);return _0x3b5763;})['then'](respondWithResult(_0x39144f,null))[_0xc3e5('0x2c')](handleError(_0x39144f,null));};exports['addApplications']=function(_0x4cafcf,_0x4cd840){var _0x368ba9=_0x4cafcf[_0xc3e5('0x55')]['id'];var _0x1bdccf=_0x4cafcf[_0xc3e5('0x61')];var _0x32025e=0xc8;var _0x28e515=null;return db[_0xc3e5('0xa1')]['transaction']({'isolationLevel':db[_0xc3e5('0xa1')][_0xc3e5('0xa2')][_0xc3e5('0xa3')][_0xc3e5('0xa4')]},function(_0x306430){return db['OpenchannelAccount'][_0xc3e5('0xa5')]({'where':{'id':_0x368ba9},'transaction':_0x306430})[_0xc3e5('0x23')](function(_0x4d3dc3){if(_0x4d3dc3){return db['OpenchannelApplication'][_0xc3e5('0x3b')]({'where':{'OpenchannelAccountId':_0x368ba9},'transaction':_0x306430})[_0xc3e5('0x23')](function(){var _0x1b9f21=_['map'](_0x1bdccf,function(_0x2614bd){_0x2614bd[_0xc3e5('0x64')]=_0x368ba9;return _0x2614bd;});return db[_0xc3e5('0x81')][_0xc3e5('0xa6')](_0x1b9f21,{'transaction':_0x306430});});}else{_0x32025e=0x194;_0x28e515=[];}});})['then'](function(){if(_0x32025e!==0x194){return db[_0xc3e5('0x81')][_0xc3e5('0xa7')]({'where':{'OpenchannelAccountId':_0x368ba9},'order':_0xc3e5('0x87')})[_0xc3e5('0x23')](function(_0x3d28c9){_0x28e515=_0x3d28c9;});}})['catch'](function(_0x525673){_0x32025e=0x1f4;logger[_0xc3e5('0x27')](_0x525673[_0xc3e5('0x3d')]);if(_0x525673[_0xc3e5('0x3e')]){delete _0x525673[_0xc3e5('0x3e')];}_0x28e515=_0x525673;})[_0xc3e5('0xa8')](function(){if(_0x28e515===null){_0x4cd840[_0xc3e5('0x2d')](_0x32025e);}else{if(_0x32025e===0x1f4){_0x4cd840[_0xc3e5('0x2e')](_0x32025e)[_0xc3e5('0x3f')](_0x28e515);}else{_0x4cd840[_0xc3e5('0x2e')](_0x32025e)[_0xc3e5('0x34')](_0x28e515);}}});};exports[_0xc3e5('0xa9')]=function(_0x4d9e03,_0x3c3767,_0x281af2){var _0x4af7d9={};var _0x3d37bd={};var _0x264fe3;var _0xbaf75d;return db[_0xc3e5('0x41')][_0xc3e5('0xa5')]({'where':{'id':_0x4d9e03[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x3c3767,null))[_0xc3e5('0x23')](function(_0x2fab44){if(_0x2fab44){_0x264fe3=_0x2fab44;_0x3d37bd[_0xc3e5('0x43')]=_[_0xc3e5('0x45')](db[_0xc3e5('0x81')][_0xc3e5('0x66')]);_0x3d37bd[_0xc3e5('0x44')]=_[_0xc3e5('0x45')](_0x4d9e03[_0xc3e5('0x44')]);_0x3d37bd[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0x3d37bd[_0xc3e5('0x43')],_0x3d37bd[_0xc3e5('0x44')]);_0x4af7d9['attributes']=_[_0xc3e5('0x47')](_0x3d37bd[_0xc3e5('0x43')],qs[_0xc3e5('0x49')](_0x4d9e03[_0xc3e5('0x44')][_0xc3e5('0x49')]));_0x4af7d9[_0xc3e5('0x48')]=_0x4af7d9[_0xc3e5('0x48')][_0xc3e5('0x67')]?_0x4af7d9[_0xc3e5('0x48')]:_0x3d37bd[_0xc3e5('0x43')];_0x4af7d9[_0xc3e5('0x4c')]=qs[_0xc3e5('0x4d')](_0x4d9e03[_0xc3e5('0x44')][_0xc3e5('0x4d')]);_0x4af7d9[_0xc3e5('0x4e')]=qs[_0xc3e5('0x46')](_[_0xc3e5('0x68')](_0x4d9e03[_0xc3e5('0x44')],_0x3d37bd['filters']));if(_0x4d9e03['query'][_0xc3e5('0x4f')]){_0x4af7d9['where']=_[_0xc3e5('0x57')](_0x4af7d9[_0xc3e5('0x4e')],{'$or':_[_0xc3e5('0x40')](_0x4af7d9[_0xc3e5('0x48')],function(_0x116f7e){var _0x33d252={};_0x33d252[_0x116f7e]={'$like':'%'+_0x4d9e03['query'][_0xc3e5('0x4f')]+'%'};return _0x33d252;})});}_0x4af7d9=_[_0xc3e5('0x57')]({},_0x4af7d9,_0x4d9e03[_0xc3e5('0x58')]);return _0x264fe3[_0xc3e5('0xa9')](_0x4af7d9);}})[_0xc3e5('0x23')](function(_0x38af68){if(_0x38af68){_0xbaf75d=_0x38af68[_0xc3e5('0x67')];if(!_0x4d9e03['query'][_0xc3e5('0x4a')](_0xc3e5('0x4b'))){_0x4af7d9[_0xc3e5('0x31')]=qs[_0xc3e5('0x31')](_0x4d9e03[_0xc3e5('0x44')][_0xc3e5('0x31')]);_0x4af7d9[_0xc3e5('0x2f')]=qs[_0xc3e5('0x2f')](_0x4d9e03[_0xc3e5('0x44')][_0xc3e5('0x2f')]);}return _0x264fe3['getApplications'](_0x4af7d9);}})['then'](function(_0x25b981){if(_0x25b981){return _0x25b981?{'count':_0xbaf75d,'rows':_0x25b981}:null;}})[_0xc3e5('0x23')](respondWithResult(_0x3c3767,null))[_0xc3e5('0x2c')](handleError(_0x3c3767,null));};exports['getInteractions']=function(_0x1296c3,_0x43f9d4,_0x2e4b7a){var _0x317110={'raw':![],'where':{}};var _0x714975={};var _0xe69dd6={'count':0x0,'rows':[]};return db[_0xc3e5('0x41')]['findOne']({'where':{'id':_0x1296c3[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x43f9d4,null))[_0xc3e5('0x23')](function(_0x783db5){if(_0x783db5){_0x714975[_0xc3e5('0x43')]=_[_0xc3e5('0x45')](db[_0xc3e5('0x8e')]['rawAttributes']);_0x714975[_0xc3e5('0x44')]=_[_0xc3e5('0x45')](_0x1296c3[_0xc3e5('0x44')]);_0x714975[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0x714975[_0xc3e5('0x43')],_0x714975['query']);_0x317110[_0xc3e5('0x48')]=_[_0xc3e5('0x47')](_0x714975[_0xc3e5('0x43')],qs['fields'](_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0x49')]));_0x317110[_0xc3e5('0x48')]=_0x317110[_0xc3e5('0x48')]['length']?_0x317110[_0xc3e5('0x48')]:_0x714975[_0xc3e5('0x43')];if(!_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0x4a')](_0xc3e5('0x4b'))){_0x317110[_0xc3e5('0x31')]=qs[_0xc3e5('0x31')](_0x1296c3['query']['limit']);_0x317110['offset']=qs[_0xc3e5('0x2f')](_0x1296c3[_0xc3e5('0x44')]['offset']);}_0x317110['order']=qs[_0xc3e5('0x4d')](_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0x4d')]);_0x317110[_0xc3e5('0x4e')]=qs[_0xc3e5('0x46')](_[_0xc3e5('0x68')](_0x1296c3['query'],_0x714975[_0xc3e5('0x46')]));_0x317110[_0xc3e5('0x4e')][_0xc3e5('0x64')]=_0x783db5['id'];if(_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0x4f')]){_0x317110[_0xc3e5('0x4e')]=_[_0xc3e5('0x57')](_0x317110[_0xc3e5('0x4e')],{'$or':_[_0xc3e5('0x40')](_0x317110[_0xc3e5('0x48')],function(_0x5547b5){var _0x5bf21c={};_0x5bf21c[_0x5547b5]={'$like':'%'+_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0x4f')]+'%'};return _0x5bf21c;})});}_0x317110=_[_0xc3e5('0x57')]({},_0x317110,_0x1296c3[_0xc3e5('0x58')]);return db[_0xc3e5('0x8e')]['count']({'where':_0x317110[_0xc3e5('0x4e')]})['then'](function(_0x5f4294){_0xe69dd6[_0xc3e5('0x30')]=_0x5f4294;if(_0x1296c3['query'][_0xc3e5('0x50')]){_0x317110[_0xc3e5('0x51')]=[{'model':db[_0xc3e5('0x7e')],'as':_0xc3e5('0xaa'),'required':![]},{'model':db[_0xc3e5('0x99')],'as':'Owner','attributes':[_0xc3e5('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0xc3e5('0xab')],'as':'Tags','attributes':['id','name',_0xc3e5('0xac')],'where':_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0xad')]?{'id':_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0xad')]}:undefined,'required':_0x1296c3[_0xc3e5('0x44')][_0xc3e5('0xad')]?!![]:![]}];}return db[_0xc3e5('0x8e')][_0xc3e5('0x52')](_0x317110);})[_0xc3e5('0x23')](function(_0x5e90f5){_0xe69dd6['rows']=_0x5e90f5;return _0xe69dd6;});}})[_0xc3e5('0x23')](respondWithFilteredResult(_0x43f9d4,_0x317110))[_0xc3e5('0x2c')](handleError(_0x43f9d4,null));};exports[_0xc3e5('0xae')]=function(_0x17afdd,_0x59f25a,_0xa78bcb){return db[_0xc3e5('0x41')]['find']({'where':{'id':_0x17afdd[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x59f25a,null))[_0xc3e5('0x23')](function(_0x2de265){if(_0x2de265){return _0x2de265[_0xc3e5('0xae')](_0x17afdd[_0xc3e5('0x61')][_0xc3e5('0x6a')],_[_0xc3e5('0xaf')](_0x17afdd['body'],['ids','id'])||{})[_0xc3e5('0xb0')](function(_0x21f273){for(var _0x1123f9=0x0;_0x1123f9<_0x17afdd[_0xc3e5('0x61')][_0xc3e5('0x6a')][_0xc3e5('0x67')];_0x1123f9+=0x1){socket[_0xc3e5('0xb1')]('userOpenchannelAccount:save',{'UserId':Number(_0x17afdd['body'][_0xc3e5('0x6a')][_0x1123f9]),'OpenchannelAccountId':Number(_0x17afdd[_0xc3e5('0x55')]['id'])});}return _0x21f273;});}})[_0xc3e5('0x23')](respondWithResult(_0x59f25a,null))[_0xc3e5('0x2c')](handleError(_0x59f25a,null));};exports['removeAgents']=function(_0x25fcd1,_0x11b4bc,_0xa30706){return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0x25fcd1['params']['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x11b4bc,null))[_0xc3e5('0x23')](function(_0x35f769){if(_0x35f769){return _0x35f769[_0xc3e5('0xb2')](_0x25fcd1[_0xc3e5('0x44')][_0xc3e5('0x6a')])[_0xc3e5('0x23')](function(){if(_[_0xc3e5('0xb3')](_0x25fcd1[_0xc3e5('0x44')][_0xc3e5('0x6a')])){for(var _0x4272e9=0x0;_0x4272e9<_0x25fcd1[_0xc3e5('0x44')][_0xc3e5('0x6a')]['length'];_0x4272e9+=0x1){socket[_0xc3e5('0xb1')](_0xc3e5('0xb4'),{'UserId':Number(_0x25fcd1[_0xc3e5('0x44')][_0xc3e5('0x6a')][_0x4272e9]),'OpenchannelAccountId':Number(_0x25fcd1['params']['id'])});}}else{socket[_0xc3e5('0xb1')](_0xc3e5('0xb4'),{'UserId':Number(_0x25fcd1[_0xc3e5('0x44')][_0xc3e5('0x6a')]),'OpenchannelAccountId':Number(_0x25fcd1[_0xc3e5('0x55')]['id'])});}});}})[_0xc3e5('0x23')](respondWithStatusCode(_0x11b4bc,null))['catch'](handleError(_0x11b4bc,null));};exports[_0xc3e5('0xb5')]=function(_0x4944f3,_0x13e5ef,_0x44475d){var _0x1e2b1f={};var _0x41f308={};var _0x2fda67;var _0x4ffb44;return db[_0xc3e5('0x41')][_0xc3e5('0xa5')]({'where':{'id':_0x4944f3[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x13e5ef,null))[_0xc3e5('0x23')](function(_0x5d1e2b){if(_0x5d1e2b){_0x2fda67=_0x5d1e2b;_0x41f308[_0xc3e5('0x43')]=_['keys'](db[_0xc3e5('0x99')]['rawAttributes']);_0x41f308[_0xc3e5('0x44')]=_[_0xc3e5('0x45')](_0x4944f3['query']);_0x41f308[_0xc3e5('0x46')]=_[_0xc3e5('0x47')](_0x41f308[_0xc3e5('0x43')],_0x41f308['query']);_0x1e2b1f[_0xc3e5('0x48')]=_['intersection'](_0x41f308[_0xc3e5('0x43')],qs[_0xc3e5('0x49')](_0x4944f3[_0xc3e5('0x44')][_0xc3e5('0x49')]));_0x1e2b1f[_0xc3e5('0x48')]=_0x1e2b1f[_0xc3e5('0x48')][_0xc3e5('0x67')]?_0x1e2b1f[_0xc3e5('0x48')]:_0x41f308[_0xc3e5('0x43')];_0x1e2b1f[_0xc3e5('0x4c')]=qs[_0xc3e5('0x4d')](_0x4944f3['query']['sort']);_0x1e2b1f[_0xc3e5('0x4e')]=qs['filters'](_[_0xc3e5('0x68')](_0x4944f3[_0xc3e5('0x44')],_0x41f308[_0xc3e5('0x46')]));if(_0x4944f3[_0xc3e5('0x44')]['filter']){_0x1e2b1f[_0xc3e5('0x4e')]=_[_0xc3e5('0x57')](_0x1e2b1f['where'],{'$or':_[_0xc3e5('0x40')](_0x1e2b1f['attributes'],function(_0x145512){var _0x283caf={};_0x283caf[_0x145512]={'$like':'%'+_0x4944f3['query'][_0xc3e5('0x4f')]+'%'};return _0x283caf;})});}_0x1e2b1f=_['merge']({},_0x1e2b1f,_0x4944f3[_0xc3e5('0x58')]);return _0x2fda67[_0xc3e5('0xb5')](_0x1e2b1f);}})[_0xc3e5('0x23')](function(_0x34042d){if(_0x34042d){_0x4ffb44=_0x34042d[_0xc3e5('0x67')];if(!_0x4944f3[_0xc3e5('0x44')][_0xc3e5('0x4a')](_0xc3e5('0x4b'))){_0x1e2b1f['limit']=qs[_0xc3e5('0x31')](_0x4944f3[_0xc3e5('0x44')][_0xc3e5('0x31')]);_0x1e2b1f[_0xc3e5('0x2f')]=qs[_0xc3e5('0x2f')](_0x4944f3[_0xc3e5('0x44')][_0xc3e5('0x2f')]);}return _0x2fda67['getAgents'](_0x1e2b1f);}})[_0xc3e5('0x23')](function(_0x4699c9){if(_0x4699c9){return _0x4699c9?{'count':_0x4ffb44,'rows':_0x4699c9}:null;}})['then'](respondWithResult(_0x13e5ef,null))[_0xc3e5('0x2c')](handleError(_0x13e5ef,null));};exports[_0xc3e5('0x3f')]=function(_0x30587c,_0x39303c,_0x311569){var _0x8d9cc3,_0x1fbf20,_0x9bde59;if(_[_0xc3e5('0x75')](_0x30587c['body']['body'])||_0x30587c[_0xc3e5('0x61')][_0xc3e5('0x61')]===''){throw new db['Sequelize'][(_0xc3e5('0x79'))](_0xc3e5('0xb6'));}if(_[_0xc3e5('0x75')](_0x30587c['body']['to'])){}_0x8d9cc3=_0x30587c['body']['to'];return db[_0xc3e5('0x41')][_0xc3e5('0xa5')]({'where':{'id':_0x30587c[_0xc3e5('0x55')]['id']}})[_0xc3e5('0x23')](handleEntityNotFound(_0x39303c,null))[_0xc3e5('0x23')](function(_0x161efc){if(_0x161efc){return db[_0xc3e5('0x41')][_0xc3e5('0x59')]({'where':{'id':_0x161efc['id']},'include':[{'model':db[_0xc3e5('0x7c')],'as':_0xc3e5('0x7d'),'include':[{'model':db[_0xc3e5('0x7e')],'as':_0xc3e5('0x7f'),'where':{[_0x161efc[_0xc3e5('0x7b')]]:_0x8d9cc3},'limit':0x1,'order':[['updatedAt',_0xc3e5('0x80')]]}]}]})[_0xc3e5('0x23')](handleEntityNotFound(_0x39303c,null))['then'](function(_0x206e9a){if(_0x206e9a&&_0x206e9a[_0xc3e5('0x7d')]){_0x1fbf20=_0x206e9a[_0xc3e5('0x38')]({'plain':!![]});if(_0x1fbf20[_0xc3e5('0x7d')]&&_0x1fbf20[_0xc3e5('0x7d')]['Contacts'][_0xc3e5('0x67')]){return _0x1fbf20[_0xc3e5('0x7d')][_0xc3e5('0x7f')][0x0];}return db['CmContact'][_0xc3e5('0x5a')](_['defaults'](_0x30587c['body'],{'firstName':_0x8d9cc3,[_0x206e9a['mapKey']]:_0x8d9cc3,'phone':_0x8d9cc3,'ListId':_0x1fbf20[_0xc3e5('0x89')]}));}})[_0xc3e5('0x23')](handleEntityNotFound(_0x39303c,null))[_0xc3e5('0x23')](function(_0x6b8abb){if(_0x6b8abb){_0x9bde59=_0x6b8abb;return db[_0xc3e5('0x8e')]['find']({'where':{'ContactId':_0x9bde59['id'],'closed':![],'OpenchannelAccountId':_0x1fbf20['id']}})[_0xc3e5('0x23')](function(_0x17b77c){if(_0x17b77c){return[_0x17b77c,![]];}return db[_0xc3e5('0x8e')]['create']({'UserId':_0x30587c[_0xc3e5('0x5c')]['id'],'ContactId':_0x9bde59['id'],'OpenchannelAccountId':_0x1fbf20['id'],'lastMsgDirection':_0xc3e5('0xb7'),'firstMsgDirection':_0xc3e5('0xb7'),'Messages':[_[_0xc3e5('0x57')](_0x30587c[_0xc3e5('0x61')],{'read':![],'body':_0x30587c[_0xc3e5('0x61')]['body'],'OpenchannelAccountId':_0x1fbf20['id'],'UserId':_0x30587c[_0xc3e5('0x5c')]['id'],'ContactId':_0x9bde59['id']})]},{'include':[{'model':db[_0xc3e5('0xb8')],'as':_0xc3e5('0xb9')}]})[_0xc3e5('0x23')](function(_0x3d8ac4){return[_0x3d8ac4,!![]];});});}})['spread'](function(_0x5dcded,_0x3e5155){if(_0x3e5155){return _0x5dcded;}return db[_0xc3e5('0xb8')][_0xc3e5('0x5a')](_['merge'](_0x30587c[_0xc3e5('0x61')],{'read':![],'body':_0x30587c[_0xc3e5('0x61')]['body'],'OpenchannelAccountId':_0x1fbf20['id'],'OpenchannelInteractionId':_0x5dcded['id'],'UserId':_0x30587c[_0xc3e5('0x5c')]['id'],'ContactId':_0x9bde59['id']}))[_0xc3e5('0x23')](function(_0x1dbaf9){_0x5dcded[_0xc3e5('0xba')][_0xc3e5('0xb9')]=[];_0x5dcded[_0xc3e5('0xba')][_0xc3e5('0xb9')][_0xc3e5('0x95')](_0x1dbaf9[_0xc3e5('0xba')]);return _0x5dcded;});});}})[_0xc3e5('0x23')](respondWithResult(_0x39303c,null))['catch'](handleError(_0x39303c,null));};
\ No newline at end of file
+var _0x6953=['message','result','catch','status','end','undefined','limit','count','offset','Content-Range','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','params','fields','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','OpenchannelAccounts','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','pick','map','findAll','rows','removeDispositions','ids','CannedAnswer','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','list','applications','orderBy','ListId','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','messageId','interaction','created','autoclose','push','close','unmanaged','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','fullname','tag','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','isNil','out','OpenchannelMessage','Messages','eml-format','rimraf','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x26416b,_0x3676ae){var _0x2c37ce=function(_0x1d5892){while(--_0x1d5892){_0x26416b['push'](_0x26416b['shift']());}};_0x2c37ce(++_0x3676ae);}(_0x6953,0x91));var _0x3695=function(_0x1f021d,_0x2b3376){_0x1f021d=_0x1f021d-0x0;var _0x2d0390=_0x6953[_0x1f021d];return _0x2d0390;};'use strict';var emlformat=require(_0x3695('0x0'));var rimraf=require(_0x3695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3695('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3695('0x3'));var util=require(_0x3695('0x4'));var path=require(_0x3695('0x5'));var sox=require('sox');var csv=require(_0x3695('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3695('0x7'));var _=require(_0x3695('0x8'));var squel=require(_0x3695('0x9'));var crypto=require(_0x3695('0xa'));var jsforce=require(_0x3695('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3695('0x6'));var querystring=require('querystring');var Papa=require(_0x3695('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3695('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3695('0xe'));var logger=require(_0x3695('0xf'))(_0x3695('0x10'));var utils=require(_0x3695('0x11'));var config=require(_0x3695('0x12'));var licenseUtil=require(_0x3695('0x13'));var db=require('../../mysqldb')['db'];config[_0x3695('0x14')]=_[_0x3695('0x15')](config[_0x3695('0x14')],{'host':_0x3695('0x16'),'port':0x18eb});var socket=require(_0x3695('0x17'))(new Redis(config[_0x3695('0x14')]));require(_0x3695('0x18'))[_0x3695('0x19')](socket);var jayson=require(_0x3695('0x1a'));var client=jayson[_0x3695('0x1b')][_0x3695('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x3695('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x231c7d,_0x2cdd3,_0x3cb320,_0x367191){return new BPromise(function(_0x1973ee,_0x36c3a4){var _0x4fa2d9=_0x367191||client;return _0x4fa2d9[_0x3695('0x1d')](_0x231c7d,_0x3cb320)['then'](function(_0x1082db){logger[_0x3695('0x1e')](_0x3695('0x1f'),_0x2cdd3,_0x3695('0x20'));logger[_0x3695('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2cdd3,_0x3695('0x20'),JSON[_0x3695('0x22')](_0x1082db));if(_0x1082db[_0x3695('0x23')]){if(_0x1082db[_0x3695('0x23')][_0x3695('0x24')]===0x1f4){logger[_0x3695('0x23')](_0x3695('0x1f'),_0x2cdd3,_0x1082db[_0x3695('0x23')][_0x3695('0x25')]);return _0x36c3a4(_0x1082db[_0x3695('0x23')][_0x3695('0x25')]);}logger[_0x3695('0x23')](_0x3695('0x1f'),_0x2cdd3,_0x1082db[_0x3695('0x23')]['message']);return _0x1973ee(_0x1082db[_0x3695('0x23')][_0x3695('0x25')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2cdd3,_0x3695('0x20'));_0x1973ee(_0x1082db[_0x3695('0x26')][_0x3695('0x25')]);}})[_0x3695('0x27')](function(_0x534d38){logger[_0x3695('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x2cdd3,_0x534d38);_0x36c3a4(_0x534d38);});});}function respondWithStatusCode(_0xeddb06,_0x5319f4){_0x5319f4=_0x5319f4||0xcc;return function(_0xe085de){if(_0xe085de){return _0xeddb06['sendStatus'](_0x5319f4);}return _0xeddb06[_0x3695('0x28')](_0x5319f4)[_0x3695('0x29')]();};}function respondWithResult(_0x462ff0,_0x18a474){_0x18a474=_0x18a474||0xc8;return function(_0x3d4442){if(_0x3d4442){return _0x462ff0[_0x3695('0x28')](_0x18a474)['json'](_0x3d4442);}};}function respondWithFilteredResult(_0x2be6ee,_0x354ae0){return function(_0x5f193c){if(_0x5f193c){var _0x392107=typeof _0x354ae0['offset']===_0x3695('0x2a')&&typeof _0x354ae0[_0x3695('0x2b')]===_0x3695('0x2a');var _0x23ac01=_0x5f193c[_0x3695('0x2c')];var _0x21f379=_0x392107?0x0:_0x354ae0[_0x3695('0x2d')];var _0x190323=_0x392107?_0x5f193c['count']:_0x354ae0[_0x3695('0x2d')]+_0x354ae0[_0x3695('0x2b')];var _0xe6455e;if(_0x190323>=_0x23ac01){_0x190323=_0x23ac01;_0xe6455e=0xc8;}else{_0xe6455e=0xce;}_0x2be6ee['status'](_0xe6455e);return _0x2be6ee['set'](_0x3695('0x2e'),_0x21f379+'-'+_0x190323+'/'+_0x23ac01)['json'](_0x5f193c);}return null;};}function patchUpdates(_0x12dbce){return function(_0x471e4b){try{jsonpatch['apply'](_0x471e4b,_0x12dbce,!![]);}catch(_0x25fa82){return BPromise['reject'](_0x25fa82);}return _0x471e4b[_0x3695('0x2f')]();};}function saveUpdates(_0x197396,_0x185e48){return function(_0x3c3da6){if(_0x3c3da6){return _0x3c3da6[_0x3695('0x30')](_0x197396)[_0x3695('0x31')](function(_0x47a18f){return _0x47a18f;});}return null;};}function removeEntity(_0x3ab2a0,_0x33043e){return function(_0x4cd1ac){if(_0x4cd1ac){return _0x4cd1ac[_0x3695('0x32')]()[_0x3695('0x31')](function(){var _0x542d33=_0x4cd1ac['get']({'plain':!![]});var _0x4c359d='OpenchannelAccounts';return db[_0x3695('0x33')][_0x3695('0x32')]({'where':{'type':_0x4c359d,'resourceId':_0x542d33['id']}})['then'](function(){return _0x4cd1ac;});})[_0x3695('0x31')](function(){_0x3ab2a0[_0x3695('0x28')](0xcc)[_0x3695('0x29')]();});}};}function handleEntityNotFound(_0x33d5c6,_0x4b7fdf){return function(_0x5170a5){if(!_0x5170a5){_0x33d5c6[_0x3695('0x34')](0x194);}return _0x5170a5;};}function handleError(_0x470907,_0x59c271){_0x59c271=_0x59c271||0x1f4;return function(_0x12ebe9){logger[_0x3695('0x23')](_0x12ebe9[_0x3695('0x35')]);if(_0x12ebe9[_0x3695('0x36')]){delete _0x12ebe9[_0x3695('0x36')];}_0x470907[_0x3695('0x28')](_0x59c271)[_0x3695('0x37')](_0x12ebe9);};}exports[_0x3695('0x38')]=function(_0x2beab3,_0x927c71){var _0x460b49={'include':[{'model':db[_0x3695('0x39')],'as':_0x3695('0x3a')}]},_0x264b06={},_0x1411cd={'count':0x0,'rows':[]};var _0x318551=_['map'](db[_0x3695('0x3b')][_0x3695('0x3c')],function(_0x377c86){return{'name':_0x377c86[_0x3695('0x3d')],'type':_0x377c86[_0x3695('0x3e')][_0x3695('0x3f')]};});_0x264b06[_0x3695('0x40')]=_['map'](_0x318551,_0x3695('0x36'));_0x264b06[_0x3695('0x41')]=_[_0x3695('0x42')](_0x2beab3['query']);_0x264b06[_0x3695('0x43')]=_[_0x3695('0x44')](_0x264b06[_0x3695('0x40')],_0x264b06[_0x3695('0x41')]);_0x460b49[_0x3695('0x45')]=_[_0x3695('0x44')](_0x264b06[_0x3695('0x40')],qs['fields'](_0x2beab3[_0x3695('0x41')]['fields']));_0x460b49['attributes']=_0x460b49[_0x3695('0x45')]['length']?_0x460b49[_0x3695('0x45')]:_0x264b06[_0x3695('0x40')];if(!_0x2beab3[_0x3695('0x41')][_0x3695('0x46')]('nolimit')){_0x460b49[_0x3695('0x2b')]=qs[_0x3695('0x2b')](_0x2beab3[_0x3695('0x41')]['limit']);_0x460b49[_0x3695('0x2d')]=qs[_0x3695('0x2d')](_0x2beab3[_0x3695('0x41')][_0x3695('0x2d')]);}_0x460b49[_0x3695('0x47')]=qs[_0x3695('0x48')](_0x2beab3[_0x3695('0x41')][_0x3695('0x48')]);_0x460b49[_0x3695('0x49')]=qs['filters'](_['pick'](_0x2beab3[_0x3695('0x41')],_0x264b06[_0x3695('0x43')]),_0x318551);if(_0x2beab3[_0x3695('0x41')]['filter']){_0x460b49[_0x3695('0x49')]=_[_0x3695('0x4a')](_0x460b49[_0x3695('0x49')],{'$or':_['map'](_0x318551,function(_0x155849){if(_0x155849[_0x3695('0x3e')]!==_0x3695('0x4b')){var _0x1abe89={};_0x1abe89[_0x155849[_0x3695('0x36')]]={'$like':'%'+_0x2beab3['query'][_0x3695('0x4c')]+'%'};return _0x1abe89;}})});}_0x460b49=_[_0x3695('0x4a')]({},_0x460b49,_0x2beab3[_0x3695('0x4d')]);var _0x361a9f={'where':_0x460b49['where']};return db[_0x3695('0x3b')]['count'](_0x361a9f)['then'](function(_0x2d77f5){_0x1411cd[_0x3695('0x2c')]=_0x2d77f5;if(_0x2beab3[_0x3695('0x41')][_0x3695('0x4e')]){_0x460b49[_0x3695('0x4f')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x460b49);})['then'](function(_0x5173b8){_0x1411cd['rows']=_0x5173b8;return _0x1411cd;})['then'](respondWithFilteredResult(_0x927c71,_0x460b49))['catch'](handleError(_0x927c71,null));};exports['show']=function(_0x3b1c1c,_0x4153a6){var _0x5561a5={'raw':![],'where':{'id':_0x3b1c1c[_0x3695('0x50')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x44e8d5={};_0x44e8d5[_0x3695('0x40')]=_[_0x3695('0x42')](db[_0x3695('0x3b')]['rawAttributes']);_0x44e8d5[_0x3695('0x41')]=_[_0x3695('0x42')](_0x3b1c1c[_0x3695('0x41')]);_0x44e8d5[_0x3695('0x43')]=_[_0x3695('0x44')](_0x44e8d5[_0x3695('0x40')],_0x44e8d5[_0x3695('0x41')]);_0x5561a5[_0x3695('0x45')]=_[_0x3695('0x44')](_0x44e8d5[_0x3695('0x40')],qs[_0x3695('0x51')](_0x3b1c1c[_0x3695('0x41')][_0x3695('0x51')]));_0x5561a5[_0x3695('0x45')]=_0x5561a5[_0x3695('0x45')][_0x3695('0x52')]?_0x5561a5[_0x3695('0x45')]:_0x44e8d5[_0x3695('0x40')];if(_0x3b1c1c[_0x3695('0x41')][_0x3695('0x4e')]){_0x5561a5[_0x3695('0x4f')]=[{'all':!![]}];}_0x5561a5=_[_0x3695('0x4a')]({},_0x5561a5,_0x3b1c1c[_0x3695('0x4d')]);return db['OpenchannelAccount']['find'](_0x5561a5)[_0x3695('0x31')](handleEntityNotFound(_0x4153a6,null))[_0x3695('0x31')](respondWithResult(_0x4153a6,null))['catch'](handleError(_0x4153a6,null));};exports[_0x3695('0x53')]=function(_0x43f6f5,_0x362605){return db[_0x3695('0x3b')][_0x3695('0x53')](_0x43f6f5[_0x3695('0x54')],{})[_0x3695('0x31')](function(_0x9a8d31){var _0x520fd3=_0x43f6f5[_0x3695('0x55')]['get']({'plain':!![]});if(!_0x520fd3)throw new Error(_0x3695('0x56'));if(_0x520fd3[_0x3695('0x57')]===_0x3695('0x55')){var _0x37ae94=_0x9a8d31[_0x3695('0x58')]({'plain':!![]});var _0x59f506=_0x3695('0x59');return db[_0x3695('0x5a')][_0x3695('0x5b')]({'where':{'name':_0x59f506,'userProfileId':_0x520fd3['userProfileId']},'raw':!![]})[_0x3695('0x31')](function(_0x218cad){if(_0x218cad&&_0x218cad['autoAssociation']===0x0){return db['UserProfileResource'][_0x3695('0x53')]({'name':_0x37ae94['name'],'resourceId':_0x37ae94['id'],'type':_0x218cad['name'],'sectionId':_0x218cad['id']},{})[_0x3695('0x31')](function(){return _0x9a8d31;});}else{return _0x9a8d31;}})[_0x3695('0x27')](function(_0xade517){logger[_0x3695('0x23')](_0x3695('0x5c'),_0xade517);throw _0xade517;});}return _0x9a8d31;})['then'](respondWithResult(_0x362605,0xc9))[_0x3695('0x27')](handleError(_0x362605,null));};exports[_0x3695('0x30')]=function(_0x2e9762,_0x5cbdd6){if(_0x2e9762[_0x3695('0x54')]['id']){delete _0x2e9762[_0x3695('0x54')]['id'];}return db[_0x3695('0x3b')][_0x3695('0x5b')]({'where':{'id':_0x2e9762[_0x3695('0x50')]['id']},'include':[{'model':db[_0x3695('0x39')],'as':'mandatoryDispositionPause'}]})[_0x3695('0x31')](handleEntityNotFound(_0x5cbdd6,null))[_0x3695('0x31')](saveUpdates(_0x2e9762[_0x3695('0x54')],null))[_0x3695('0x31')](respondWithResult(_0x5cbdd6,null))[_0x3695('0x27')](handleError(_0x5cbdd6,null));};exports['destroy']=function(_0x35fde9,_0x19b3e3){return db[_0x3695('0x3b')][_0x3695('0x5b')]({'where':{'id':_0x35fde9[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x19b3e3,null))['then'](removeEntity(_0x19b3e3,null))[_0x3695('0x27')](handleError(_0x19b3e3,null));};exports[_0x3695('0x5d')]=function(_0x5c1fb1,_0x4e7d7a){return db[_0x3695('0x3b')][_0x3695('0x5d')]()[_0x3695('0x31')](respondWithResult(_0x4e7d7a,null))['catch'](handleError(_0x4e7d7a,null));};exports[_0x3695('0x5e')]=function(_0x40e542,_0x1bd95d,_0x46ca05){if(_0x40e542[_0x3695('0x54')]['id']){delete _0x40e542['body']['id'];}return db[_0x3695('0x3b')]['find']({'where':{'id':_0x40e542['params']['id']}})['then'](handleEntityNotFound(_0x1bd95d,null))[_0x3695('0x31')](function(_0x278fbd){if(_0x278fbd){_0x40e542[_0x3695('0x54')][_0x3695('0x5f')]=_0x278fbd['id'];return db[_0x3695('0x60')][_0x3695('0x53')](_0x40e542[_0x3695('0x54')]);}})[_0x3695('0x31')](respondWithResult(_0x1bd95d,null))[_0x3695('0x27')](handleError(_0x1bd95d,null));};exports[_0x3695('0x61')]=function(_0x375d29,_0x45578e,_0x209990){var _0x18ac2c={'raw':![],'where':{}};var _0x90035f={};var _0x3c64f7={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3695('0x62')]({'where':{'id':_0x375d29[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x45578e,null))[_0x3695('0x31')](function(_0x2bfe00){if(_0x2bfe00){_0x90035f[_0x3695('0x40')]=_['keys'](db[_0x3695('0x60')][_0x3695('0x3c')]);_0x90035f['query']=_['keys'](_0x375d29[_0x3695('0x41')]);_0x90035f['filters']=_[_0x3695('0x44')](_0x90035f[_0x3695('0x40')],_0x90035f[_0x3695('0x41')]);_0x18ac2c[_0x3695('0x45')]=_[_0x3695('0x44')](_0x90035f['model'],qs[_0x3695('0x51')](_0x375d29[_0x3695('0x41')][_0x3695('0x51')]));_0x18ac2c['attributes']=_0x18ac2c['attributes']['length']?_0x18ac2c[_0x3695('0x45')]:_0x90035f[_0x3695('0x40')];if(!_0x375d29['query'][_0x3695('0x46')](_0x3695('0x63'))){_0x18ac2c[_0x3695('0x2b')]=qs[_0x3695('0x2b')](_0x375d29[_0x3695('0x41')][_0x3695('0x2b')]);_0x18ac2c[_0x3695('0x2d')]=qs[_0x3695('0x2d')](_0x375d29['query'][_0x3695('0x2d')]);}_0x18ac2c[_0x3695('0x47')]=qs[_0x3695('0x48')](_0x375d29[_0x3695('0x41')][_0x3695('0x48')]);_0x18ac2c[_0x3695('0x49')]=qs[_0x3695('0x43')](_[_0x3695('0x64')](_0x375d29['query'],_0x90035f[_0x3695('0x43')]));_0x18ac2c[_0x3695('0x49')][_0x3695('0x5f')]=_0x2bfe00['id'];if(_0x375d29[_0x3695('0x41')][_0x3695('0x4c')]){_0x18ac2c[_0x3695('0x49')]=_[_0x3695('0x4a')](_0x18ac2c[_0x3695('0x49')],{'$or':_[_0x3695('0x65')](_0x18ac2c[_0x3695('0x45')],function(_0xd78b9b){var _0x92fcea={};_0x92fcea[_0xd78b9b]={'$like':'%'+_0x375d29[_0x3695('0x41')]['filter']+'%'};return _0x92fcea;})});}_0x18ac2c=_['merge']({},_0x18ac2c,_0x375d29[_0x3695('0x4d')]);return db[_0x3695('0x60')][_0x3695('0x2c')]({'where':_0x18ac2c['where']})[_0x3695('0x31')](function(_0x11ae95){_0x3c64f7[_0x3695('0x2c')]=_0x11ae95;if(_0x375d29['query'][_0x3695('0x4e')]){_0x18ac2c['include']=[{'all':!![]}];}return db[_0x3695('0x60')][_0x3695('0x66')](_0x18ac2c);})[_0x3695('0x31')](function(_0xf9d475){_0x3c64f7[_0x3695('0x67')]=_0xf9d475;return _0x3c64f7;});}})['then'](respondWithFilteredResult(_0x45578e,_0x18ac2c))[_0x3695('0x27')](handleError(_0x45578e,null));};exports[_0x3695('0x68')]=function(_0x432200,_0x2a7cb3,_0x2d971f){return db[_0x3695('0x3b')][_0x3695('0x5b')]({'where':{'id':_0x432200[_0x3695('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a7cb3,null))[_0x3695('0x31')](function(_0x5c2b14){if(_0x5c2b14){return _0x5c2b14['removeDispositions'](_0x432200['query'][_0x3695('0x69')]);}})[_0x3695('0x31')](respondWithStatusCode(_0x2a7cb3,null))[_0x3695('0x27')](handleError(_0x2a7cb3,null));};exports['addAnswer']=function(_0x3e67e8,_0x47b55e,_0x2f5a49){if(_0x3e67e8[_0x3695('0x54')]['id']){delete _0x3e67e8[_0x3695('0x54')]['id'];}return db['OpenchannelAccount'][_0x3695('0x5b')]({'where':{'id':_0x3e67e8[_0x3695('0x50')]['id']}})['then'](handleEntityNotFound(_0x47b55e,null))['then'](function(_0x5beb74){if(_0x5beb74){_0x3e67e8[_0x3695('0x54')][_0x3695('0x5f')]=_0x5beb74['id'];return db[_0x3695('0x6a')]['create'](_0x3e67e8['body']);}})['then'](respondWithResult(_0x47b55e,null))['catch'](handleError(_0x47b55e,null));};exports['getAnswers']=function(_0x2bc2e2,_0x3b0bc8,_0xca57bf){var _0xdd3b27={'raw':![],'where':{}};var _0x2cb137={};var _0x43e3c4={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3695('0x62')]({'where':{'id':_0x2bc2e2[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x3b0bc8,null))[_0x3695('0x31')](function(_0x3c7a40){if(_0x3c7a40){_0x2cb137[_0x3695('0x40')]=_[_0x3695('0x42')](db[_0x3695('0x6a')][_0x3695('0x3c')]);_0x2cb137[_0x3695('0x41')]=_[_0x3695('0x42')](_0x2bc2e2[_0x3695('0x41')]);_0x2cb137[_0x3695('0x43')]=_[_0x3695('0x44')](_0x2cb137[_0x3695('0x40')],_0x2cb137[_0x3695('0x41')]);_0xdd3b27[_0x3695('0x45')]=_[_0x3695('0x44')](_0x2cb137[_0x3695('0x40')],qs[_0x3695('0x51')](_0x2bc2e2[_0x3695('0x41')][_0x3695('0x51')]));_0xdd3b27[_0x3695('0x45')]=_0xdd3b27[_0x3695('0x45')][_0x3695('0x52')]?_0xdd3b27[_0x3695('0x45')]:_0x2cb137[_0x3695('0x40')];if(!_0x2bc2e2['query'][_0x3695('0x46')](_0x3695('0x63'))){_0xdd3b27['limit']=qs[_0x3695('0x2b')](_0x2bc2e2['query'][_0x3695('0x2b')]);_0xdd3b27['offset']=qs[_0x3695('0x2d')](_0x2bc2e2[_0x3695('0x41')][_0x3695('0x2d')]);}_0xdd3b27[_0x3695('0x47')]=qs[_0x3695('0x48')](_0x2bc2e2[_0x3695('0x41')]['sort']);_0xdd3b27[_0x3695('0x49')]=qs[_0x3695('0x43')](_[_0x3695('0x64')](_0x2bc2e2[_0x3695('0x41')],_0x2cb137[_0x3695('0x43')]));_0xdd3b27[_0x3695('0x49')][_0x3695('0x5f')]=_0x3c7a40['id'];if(_0x2bc2e2['query']['filter']){_0xdd3b27[_0x3695('0x49')]=_['merge'](_0xdd3b27[_0x3695('0x49')],{'$or':_[_0x3695('0x65')](_0xdd3b27[_0x3695('0x45')],function(_0xd3253e){var _0x5bee7b={};_0x5bee7b[_0xd3253e]={'$like':'%'+_0x2bc2e2[_0x3695('0x41')][_0x3695('0x4c')]+'%'};return _0x5bee7b;})});}_0xdd3b27=_['merge']({},_0xdd3b27,_0x2bc2e2[_0x3695('0x4d')]);return db['CannedAnswer'][_0x3695('0x2c')]({'where':_0xdd3b27[_0x3695('0x49')]})[_0x3695('0x31')](function(_0x1ae555){_0x43e3c4[_0x3695('0x2c')]=_0x1ae555;if(_0x2bc2e2[_0x3695('0x41')][_0x3695('0x4e')]){_0xdd3b27['include']=[{'all':!![]}];}return db[_0x3695('0x6a')][_0x3695('0x66')](_0xdd3b27);})[_0x3695('0x31')](function(_0x2dc5e6){_0x43e3c4[_0x3695('0x67')]=_0x2dc5e6;return _0x43e3c4;});}})[_0x3695('0x31')](respondWithFilteredResult(_0x3b0bc8,_0xdd3b27))['catch'](handleError(_0x3b0bc8,null));};exports['removeAnswers']=function(_0x2e7978,_0x4e09ad,_0x5edbf1){return db[_0x3695('0x3b')]['find']({'where':{'id':_0x2e7978[_0x3695('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e09ad,null))[_0x3695('0x31')](function(_0xe4a250){if(_0xe4a250){return _0xe4a250['removeAnswers'](_0x2e7978[_0x3695('0x41')][_0x3695('0x69')]);}})[_0x3695('0x31')](respondWithStatusCode(_0x4e09ad,null))[_0x3695('0x27')](handleError(_0x4e09ad,null));};exports['notify']=function(_0x1dfdba,_0x8b2e57,_0x3de9a9){var _0x33f958={'body':_0x1dfdba[_0x3695('0x54')],'channel':_0x3695('0x6b')};var _0x56edd6=[];var _0x4f4bf6=[];var _0xb3a4c0={};var _0x427a1a=![];return db[_0x3695('0x6c')]['describe']()['then'](function(_0x3fee26){if(!_0x3fee26){throw new db['Sequelize'][(_0x3695('0x6d'))](_0x3695('0x6e'));}_0x56edd6=_[_0x3695('0x6f')](_[_0x3695('0x42')](_0x3fee26),[_0x3695('0x70'),_0x3695('0x71')]);_0x4f4bf6=_[_0x3695('0x6f')](_['keys'](_0x3fee26),[_0x3695('0x70'),'updatedAt',_0x3695('0x72'),'ListId']);if(_0x1dfdba['body']['id']){delete _0x1dfdba[_0x3695('0x54')]['id'];}if(_['isNil'](_0x1dfdba[_0x3695('0x54')][_0x3695('0x73')])){throw new db['Sequelize'][(_0x3695('0x6d'))](_0x3695('0x74'));}if(_['isNil'](_0x1dfdba['body'][_0x3695('0x54')])||_0x1dfdba['body'][_0x3695('0x54')]===''){throw new db[(_0x3695('0x75'))][(_0x3695('0x6d'))](_0x3695('0x76'));}if(_['isNil'](_0x1dfdba[_0x3695('0x54')][_0x3695('0x77')])){throw new db[(_0x3695('0x75'))][(_0x3695('0x6d'))](_0x3695('0x78')+_0x4f4bf6);}if(!_[_0x3695('0x79')](_0x4f4bf6,_0x1dfdba[_0x3695('0x54')]['mapKey'])){throw new db[(_0x3695('0x75'))][(_0x3695('0x6d'))](_0x3695('0x7a')+_0x4f4bf6);}_0xb3a4c0[_0x1dfdba[_0x3695('0x54')][_0x3695('0x77')]]=_0x1dfdba[_0x3695('0x54')][_0x3695('0x73')];})[_0x3695('0x31')](function(){return db['OpenchannelAccount'][_0x3695('0x5b')]({'where':{'id':_0x1dfdba['params']['id']},'include':[{'model':db[_0x3695('0x7b')],'as':'List','include':[{'model':db[_0x3695('0x6c')],'as':_0x3695('0x7c'),'where':_0xb3a4c0,'limit':0x1,'order':[['updatedAt',_0x3695('0x7d')]]}]},{'model':db['OpenchannelApplication'],'as':_0x3695('0x7e')}]});})[_0x3695('0x31')](handleEntityNotFound(_0x8b2e57,null))[_0x3695('0x31')](function(_0x386e2a){if(_0x386e2a&&_0x386e2a[_0x3695('0x7f')]){_0x33f958[_0x3695('0x80')]=_0x386e2a;_0x33f958['applications']=_0x386e2a[_0x3695('0x7e')];_0x33f958[_0x3695('0x81')]=_0x386e2a['List'];_0x33f958[_0x3695('0x82')]=_[_0x3695('0x83')](_0x33f958[_0x3695('0x82')],['priority'],['asc']);if(_0x33f958[_0x3695('0x80')]['Applications']){delete _0x33f958[_0x3695('0x80')]['Applications'];}if(_0x33f958[_0x3695('0x80')]['List']&&_0x33f958[_0x3695('0x80')][_0x3695('0x7f')]['Contacts']['length']){return _0x33f958['account'][_0x3695('0x7f')][_0x3695('0x7c')][0x0];}var _0x4ab8f2=_['defaults'](_0x1dfdba[_0x3695('0x54')],{'firstName':_0x1dfdba[_0x3695('0x54')]['from'],'ListId':_0x386e2a[_0x3695('0x84')]});_0x4ab8f2[_0x1dfdba[_0x3695('0x54')][_0x3695('0x77')]]=_0x1dfdba[_0x3695('0x54')][_0x3695('0x73')];return db[_0x3695('0x6c')][_0x3695('0x53')](_0x4ab8f2,{'fields':_0x56edd6,'raw':!![]});}})[_0x3695('0x31')](handleEntityNotFound(_0x8b2e57,null))['then'](function(_0x35633c){_0x33f958[_0x3695('0x85')]=_0x35633c;if(_0x35633c){var _0x49dcdd={'ContactId':_0x35633c['id'],'OpenchannelAccountId':_0x1dfdba[_0x3695('0x50')]['id'],'from':(_0x35633c[_0x3695('0x86')]||'')+'\x20'+(_0x35633c[_0x3695('0x87')]||'')};var _0x27d4fb={'OpenchannelAccountId':_0x1dfdba[_0x3695('0x50')]['id'],'closed':![]};if(_0x1dfdba['body'][_0x3695('0x88')]){_0x27d4fb[_0x3695('0x88')]=_0x1dfdba[_0x3695('0x54')][_0x3695('0x88')];return db['OpenchannelInteraction'][_0x3695('0x5b')]({'where':_0x27d4fb})[_0x3695('0x31')](function(_0x3a7be5){if(_0x3a7be5){return[_0x3a7be5,![]];}_0x49dcdd[_0x3695('0x88')]=_0x1dfdba[_0x3695('0x54')]['threadId'];_0x49dcdd[_0x3695('0x89')]=_0x1dfdba[_0x3695('0x54')][_0x3695('0x89')];return db[_0x3695('0x8a')][_0x3695('0x53')](_0x49dcdd)[_0x3695('0x31')](function(_0x106f3d){return[_0x106f3d,!![]];});});}else{_0x27d4fb[_0x3695('0x88')]=null;}_0x27d4fb[_0x3695('0x8b')]=_0x35633c['id'];return db['OpenchannelInteraction'][_0x3695('0x5b')]({'where':_0x27d4fb})[_0x3695('0x31')](function(_0x482906){if(_0x482906){return[_0x482906,![]];}return db['OpenchannelInteraction'][_0x3695('0x53')](_0x49dcdd)[_0x3695('0x31')](function(_0x6bfa93){return[_0x6bfa93,!![]];});});}})['spread'](function(_0x2cd518,_0x3618da){if(_0x2cd518){_0x427a1a=_0x3618da;if(!_0x3618da){var _0x4ece50={'from':(_0x33f958['contact'][_0x3695('0x86')]||'')+'\x20'+(_0x33f958[_0x3695('0x85')][_0x3695('0x87')]||'')};if(_0x1dfdba['body'][_0x3695('0x88')]&&_0x1dfdba['body'][_0x3695('0x8c')]&&_0x1dfdba[_0x3695('0x54')]['threadId']!=_0x1dfdba[_0x3695('0x54')][_0x3695('0x8c')]){_0x4ece50[_0x3695('0x88')]=_0x1dfdba[_0x3695('0x54')]['messageId'];}return _0x2cd518['update'](_0x4ece50);}else{return _0x2cd518;}}})['then'](function(_0x5520a5){_0x33f958[_0x3695('0x8d')]=_0x5520a5[_0x3695('0x58')]({'plain':!![]});_0x33f958[_0x3695('0x8d')]['created']=_0x427a1a;if(_0x33f958['interaction'][_0x3695('0x8e')]){if(_0x33f958[_0x3695('0x80')][_0x3695('0x8f')]){_0x33f958['applications'][_0x3695('0x90')]({'id':0x0,'priority':_0x33f958[_0x3695('0x82')][_0x3695('0x52')]+0x1,'app':_0x3695('0x91'),'appdata':_0x3695('0x92'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x1dfdba[_0x3695('0x54')][_0x3695('0x54')],'OpenchannelAccountId':_0x1dfdba[_0x3695('0x50')]['id'],'OpenchannelInteractionId':_0x5520a5['id'],'direction':'in','ContactId':_0x33f958[_0x3695('0x85')]['id'],'AttachmentId':_0x1dfdba[_0x3695('0x54')]['AttachmentId']});})[_0x3695('0x31')](function(_0x57509d){_0x33f958[_0x3695('0x25')]=_0x57509d;if(_0x33f958['interaction'][_0x3695('0x93')]){return db[_0x3695('0x94')][_0x3695('0x5b')]({'attributes':['id','name'],'where':{'id':_0x33f958['interaction']['UserId']}})[_0x3695('0x31')](function(_0x38bee4){if(_0x38bee4){_0x33f958[_0x3695('0x82')][_0x3695('0x95')]({'id':0x0,'priority':0x0,'app':_0x3695('0x96'),'appdata':_0x38bee4[_0x3695('0x36')]+','+(_0x33f958[_0x3695('0x80')][_0x3695('0x97')]||0xa),'interval':_0x3695('0x98')});_0x33f958[_0x3695('0x99')]=![];}return respondWithRpcPromise(_0x3695('0x9a'),_0x3695('0x9b'),_0x33f958);});}return respondWithRpcPromise(_0x3695('0x9a'),_0x3695('0x9b'),_0x33f958);})[_0x3695('0x31')](function(_0x1986be){respondWithRpcPromise(_0x3695('0x9c'),'EventManager',{'event':_0x3695('0x9d'),'message':_0x1986be},client9002);return _0x1986be;})[_0x3695('0x31')](respondWithResult(_0x8b2e57,null))[_0x3695('0x27')](handleError(_0x8b2e57,null));};exports[_0x3695('0x9e')]=function(_0x569c57,_0xcee34e){var _0x241ef6=_0x569c57[_0x3695('0x50')]['id'];var _0x4d9449=_0x569c57[_0x3695('0x54')];var _0x2d2afc=0xc8;var _0x17c090=null;return db[_0x3695('0x9f')]['transaction']({'isolationLevel':db[_0x3695('0x9f')]['Transaction']['ISOLATION_LEVELS'][_0x3695('0xa0')]},function(_0x3af56d){return db['OpenchannelAccount'][_0x3695('0x62')]({'where':{'id':_0x241ef6},'transaction':_0x3af56d})[_0x3695('0x31')](function(_0x4fbf18){if(_0x4fbf18){return db[_0x3695('0xa1')][_0x3695('0x32')]({'where':{'OpenchannelAccountId':_0x241ef6},'transaction':_0x3af56d})[_0x3695('0x31')](function(){var _0x237160=_[_0x3695('0x65')](_0x4d9449,function(_0x8682f2){_0x8682f2[_0x3695('0x5f')]=_0x241ef6;return _0x8682f2;});return db[_0x3695('0xa1')][_0x3695('0xa2')](_0x237160,{'transaction':_0x3af56d});});}else{_0x2d2afc=0x194;_0x17c090=[];}});})[_0x3695('0x31')](function(){if(_0x2d2afc!==0x194){return db[_0x3695('0xa1')][_0x3695('0xa3')]({'where':{'OpenchannelAccountId':_0x241ef6},'order':_0x3695('0xa4')})[_0x3695('0x31')](function(_0x5cce14){_0x17c090=_0x5cce14;});}})[_0x3695('0x27')](function(_0x4e8ddc){_0x2d2afc=0x1f4;logger[_0x3695('0x23')](_0x4e8ddc[_0x3695('0x35')]);if(_0x4e8ddc['name']){delete _0x4e8ddc['name'];}_0x17c090=_0x4e8ddc;})[_0x3695('0xa5')](function(){if(_0x17c090===null){_0xcee34e[_0x3695('0x34')](_0x2d2afc);}else{if(_0x2d2afc===0x1f4){_0xcee34e['status'](_0x2d2afc)[_0x3695('0x37')](_0x17c090);}else{_0xcee34e[_0x3695('0x28')](_0x2d2afc)[_0x3695('0xa6')](_0x17c090);}}});};exports[_0x3695('0xa7')]=function(_0x2ddc20,_0x1b19ac,_0x3dd8f0){var _0x31ffb9={};var _0xe3a87b={};var _0x18a7a9;var _0x31e7d3;return db[_0x3695('0x3b')]['findOne']({'where':{'id':_0x2ddc20[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x1b19ac,null))[_0x3695('0x31')](function(_0x398686){if(_0x398686){_0x18a7a9=_0x398686;_0xe3a87b[_0x3695('0x40')]=_[_0x3695('0x42')](db[_0x3695('0xa1')][_0x3695('0x3c')]);_0xe3a87b[_0x3695('0x41')]=_[_0x3695('0x42')](_0x2ddc20[_0x3695('0x41')]);_0xe3a87b[_0x3695('0x43')]=_[_0x3695('0x44')](_0xe3a87b['model'],_0xe3a87b[_0x3695('0x41')]);_0x31ffb9['attributes']=_[_0x3695('0x44')](_0xe3a87b[_0x3695('0x40')],qs['fields'](_0x2ddc20['query'][_0x3695('0x51')]));_0x31ffb9[_0x3695('0x45')]=_0x31ffb9[_0x3695('0x45')][_0x3695('0x52')]?_0x31ffb9[_0x3695('0x45')]:_0xe3a87b[_0x3695('0x40')];_0x31ffb9[_0x3695('0x47')]=qs['sort'](_0x2ddc20['query'][_0x3695('0x48')]);_0x31ffb9[_0x3695('0x49')]=qs['filters'](_[_0x3695('0x64')](_0x2ddc20[_0x3695('0x41')],_0xe3a87b[_0x3695('0x43')]));if(_0x2ddc20[_0x3695('0x41')][_0x3695('0x4c')]){_0x31ffb9['where']=_[_0x3695('0x4a')](_0x31ffb9[_0x3695('0x49')],{'$or':_[_0x3695('0x65')](_0x31ffb9[_0x3695('0x45')],function(_0x3d5a6d){var _0x36e84c={};_0x36e84c[_0x3d5a6d]={'$like':'%'+_0x2ddc20[_0x3695('0x41')][_0x3695('0x4c')]+'%'};return _0x36e84c;})});}_0x31ffb9=_[_0x3695('0x4a')]({},_0x31ffb9,_0x2ddc20[_0x3695('0x4d')]);return _0x18a7a9[_0x3695('0xa7')](_0x31ffb9);}})[_0x3695('0x31')](function(_0x236a79){if(_0x236a79){_0x31e7d3=_0x236a79[_0x3695('0x52')];if(!_0x2ddc20[_0x3695('0x41')][_0x3695('0x46')]('nolimit')){_0x31ffb9[_0x3695('0x2b')]=qs[_0x3695('0x2b')](_0x2ddc20[_0x3695('0x41')][_0x3695('0x2b')]);_0x31ffb9[_0x3695('0x2d')]=qs[_0x3695('0x2d')](_0x2ddc20['query'][_0x3695('0x2d')]);}return _0x18a7a9[_0x3695('0xa7')](_0x31ffb9);}})[_0x3695('0x31')](function(_0x504811){if(_0x504811){return _0x504811?{'count':_0x31e7d3,'rows':_0x504811}:null;}})['then'](respondWithResult(_0x1b19ac,null))[_0x3695('0x27')](handleError(_0x1b19ac,null));};exports['getInteractions']=function(_0x48dffa,_0x14a440,_0x590e05){var _0x1ffb98={'raw':![],'where':{}};var _0x58070b={};var _0xc72d76={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3695('0x62')]({'where':{'id':_0x48dffa[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x14a440,null))[_0x3695('0x31')](function(_0x491971){if(_0x491971){_0x58070b[_0x3695('0x40')]=_[_0x3695('0x42')](db[_0x3695('0x8a')]['rawAttributes']);_0x58070b[_0x3695('0x41')]=_[_0x3695('0x42')](_0x48dffa[_0x3695('0x41')]);_0x58070b['filters']=_[_0x3695('0x44')](_0x58070b['model'],_0x58070b[_0x3695('0x41')]);_0x1ffb98[_0x3695('0x45')]=_['intersection'](_0x58070b[_0x3695('0x40')],qs[_0x3695('0x51')](_0x48dffa[_0x3695('0x41')][_0x3695('0x51')]));_0x1ffb98[_0x3695('0x45')]=_0x1ffb98['attributes']['length']?_0x1ffb98[_0x3695('0x45')]:_0x58070b[_0x3695('0x40')];if(!_0x48dffa[_0x3695('0x41')][_0x3695('0x46')](_0x3695('0x63'))){_0x1ffb98[_0x3695('0x2b')]=qs['limit'](_0x48dffa[_0x3695('0x41')][_0x3695('0x2b')]);_0x1ffb98[_0x3695('0x2d')]=qs['offset'](_0x48dffa['query']['offset']);}_0x1ffb98[_0x3695('0x47')]=qs[_0x3695('0x48')](_0x48dffa['query'][_0x3695('0x48')]);_0x1ffb98[_0x3695('0x49')]=qs[_0x3695('0x43')](_[_0x3695('0x64')](_0x48dffa[_0x3695('0x41')],_0x58070b[_0x3695('0x43')]));_0x1ffb98[_0x3695('0x49')]['OpenchannelAccountId']=_0x491971['id'];if(_0x48dffa[_0x3695('0x41')][_0x3695('0x4c')]){_0x1ffb98[_0x3695('0x49')]=_['merge'](_0x1ffb98[_0x3695('0x49')],{'$or':_['map'](_0x1ffb98[_0x3695('0x45')],function(_0x335253){var _0x477cf6={};_0x477cf6[_0x335253]={'$like':'%'+_0x48dffa[_0x3695('0x41')][_0x3695('0x4c')]+'%'};return _0x477cf6;})});}_0x1ffb98=_[_0x3695('0x4a')]({},_0x1ffb98,_0x48dffa[_0x3695('0x4d')]);return db[_0x3695('0x8a')][_0x3695('0x2c')]({'where':_0x1ffb98['where']})[_0x3695('0x31')](function(_0x7cbcbc){_0xc72d76['count']=_0x7cbcbc;if(_0x48dffa[_0x3695('0x41')][_0x3695('0x4e')]){_0x1ffb98[_0x3695('0x4f')]=[{'model':db[_0x3695('0x6c')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x3695('0x36'),_0x3695('0xa8'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x3695('0x36'),'color'],'where':_0x48dffa[_0x3695('0x41')][_0x3695('0xa9')]?{'id':_0x48dffa[_0x3695('0x41')][_0x3695('0xa9')]}:undefined,'required':_0x48dffa[_0x3695('0x41')][_0x3695('0xa9')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x3695('0x66')](_0x1ffb98);})[_0x3695('0x31')](function(_0x1bc5e4){_0xc72d76['rows']=_0x1bc5e4;return _0xc72d76;});}})['then'](respondWithFilteredResult(_0x14a440,_0x1ffb98))[_0x3695('0x27')](handleError(_0x14a440,null));};exports[_0x3695('0xaa')]=function(_0x1ee6f4,_0x669dc9,_0x47f347){return db['OpenchannelAccount'][_0x3695('0x5b')]({'where':{'id':_0x1ee6f4['params']['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x669dc9,null))[_0x3695('0x31')](function(_0xdb700e){if(_0xdb700e){return _0xdb700e[_0x3695('0xaa')](_0x1ee6f4[_0x3695('0x54')][_0x3695('0x69')],_[_0x3695('0xab')](_0x1ee6f4['body'],[_0x3695('0x69'),'id'])||{})[_0x3695('0xac')](function(_0x42c83e){for(var _0x3c5f9e=0x0;_0x3c5f9e<_0x1ee6f4['body'][_0x3695('0x69')][_0x3695('0x52')];_0x3c5f9e+=0x1){socket['emit'](_0x3695('0xad'),{'UserId':Number(_0x1ee6f4[_0x3695('0x54')]['ids'][_0x3c5f9e]),'OpenchannelAccountId':Number(_0x1ee6f4[_0x3695('0x50')]['id'])});}return _0x42c83e;});}})[_0x3695('0x31')](respondWithResult(_0x669dc9,null))[_0x3695('0x27')](handleError(_0x669dc9,null));};exports[_0x3695('0xae')]=function(_0x3e56b0,_0x18b40a,_0x56e479){return db[_0x3695('0x3b')][_0x3695('0x5b')]({'where':{'id':_0x3e56b0[_0x3695('0x50')]['id']}})['then'](handleEntityNotFound(_0x18b40a,null))['then'](function(_0x437ab5){if(_0x437ab5){return _0x437ab5['removeAgents'](_0x3e56b0[_0x3695('0x41')][_0x3695('0x69')])[_0x3695('0x31')](function(){if(_['isArray'](_0x3e56b0[_0x3695('0x41')]['ids'])){for(var _0x799c35=0x0;_0x799c35<_0x3e56b0[_0x3695('0x41')][_0x3695('0x69')][_0x3695('0x52')];_0x799c35+=0x1){socket[_0x3695('0xaf')](_0x3695('0xb0'),{'UserId':Number(_0x3e56b0[_0x3695('0x41')][_0x3695('0x69')][_0x799c35]),'OpenchannelAccountId':Number(_0x3e56b0['params']['id'])});}}else{socket[_0x3695('0xaf')](_0x3695('0xb0'),{'UserId':Number(_0x3e56b0[_0x3695('0x41')][_0x3695('0x69')]),'OpenchannelAccountId':Number(_0x3e56b0[_0x3695('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x18b40a,null))[_0x3695('0x27')](handleError(_0x18b40a,null));};exports[_0x3695('0xb1')]=function(_0x535840,_0x1f7e1d,_0x34e4cd){var _0x5b71f2={};var _0xc95655={};var _0x5b61c1;var _0x1cb930;return db[_0x3695('0x3b')][_0x3695('0x62')]({'where':{'id':_0x535840[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x1f7e1d,null))[_0x3695('0x31')](function(_0xd9d16e){if(_0xd9d16e){_0x5b61c1=_0xd9d16e;_0xc95655[_0x3695('0x40')]=_[_0x3695('0x42')](db[_0x3695('0x94')]['rawAttributes']);_0xc95655[_0x3695('0x41')]=_[_0x3695('0x42')](_0x535840[_0x3695('0x41')]);_0xc95655[_0x3695('0x43')]=_['intersection'](_0xc95655['model'],_0xc95655['query']);_0x5b71f2[_0x3695('0x45')]=_['intersection'](_0xc95655[_0x3695('0x40')],qs[_0x3695('0x51')](_0x535840[_0x3695('0x41')][_0x3695('0x51')]));_0x5b71f2['attributes']=_0x5b71f2[_0x3695('0x45')]['length']?_0x5b71f2[_0x3695('0x45')]:_0xc95655[_0x3695('0x40')];_0x5b71f2[_0x3695('0x47')]=qs['sort'](_0x535840[_0x3695('0x41')]['sort']);_0x5b71f2[_0x3695('0x49')]=qs[_0x3695('0x43')](_[_0x3695('0x64')](_0x535840[_0x3695('0x41')],_0xc95655[_0x3695('0x43')]));if(_0x535840[_0x3695('0x41')][_0x3695('0x4c')]){_0x5b71f2[_0x3695('0x49')]=_[_0x3695('0x4a')](_0x5b71f2['where'],{'$or':_[_0x3695('0x65')](_0x5b71f2['attributes'],function(_0x197632){var _0x38e389={};_0x38e389[_0x197632]={'$like':'%'+_0x535840[_0x3695('0x41')][_0x3695('0x4c')]+'%'};return _0x38e389;})});}_0x5b71f2=_[_0x3695('0x4a')]({},_0x5b71f2,_0x535840[_0x3695('0x4d')]);return _0x5b61c1['getAgents'](_0x5b71f2);}})[_0x3695('0x31')](function(_0x3fa16a){if(_0x3fa16a){_0x1cb930=_0x3fa16a['length'];if(!_0x535840[_0x3695('0x41')][_0x3695('0x46')]('nolimit')){_0x5b71f2['limit']=qs['limit'](_0x535840[_0x3695('0x41')][_0x3695('0x2b')]);_0x5b71f2[_0x3695('0x2d')]=qs[_0x3695('0x2d')](_0x535840[_0x3695('0x41')]['offset']);}return _0x5b61c1[_0x3695('0xb1')](_0x5b71f2);}})[_0x3695('0x31')](function(_0x37974a){if(_0x37974a){return _0x37974a?{'count':_0x1cb930,'rows':_0x37974a}:null;}})[_0x3695('0x31')](respondWithResult(_0x1f7e1d,null))[_0x3695('0x27')](handleError(_0x1f7e1d,null));};exports[_0x3695('0x37')]=function(_0x1df689,_0x17e983,_0x5260fe){var _0x59583d,_0x13b720,_0x5a59e5;if(_[_0x3695('0xb2')](_0x1df689[_0x3695('0x54')][_0x3695('0x54')])||_0x1df689[_0x3695('0x54')][_0x3695('0x54')]===''){throw new db[(_0x3695('0x75'))][(_0x3695('0x6d'))](_0x3695('0x76'));}if(_[_0x3695('0xb2')](_0x1df689['body']['to'])){}_0x59583d=_0x1df689[_0x3695('0x54')]['to'];return db[_0x3695('0x3b')][_0x3695('0x62')]({'where':{'id':_0x1df689[_0x3695('0x50')]['id']}})[_0x3695('0x31')](handleEntityNotFound(_0x17e983,null))[_0x3695('0x31')](function(_0x20eb65){if(_0x20eb65){return db[_0x3695('0x3b')][_0x3695('0x5b')]({'where':{'id':_0x20eb65['id']},'include':[{'model':db[_0x3695('0x7b')],'as':_0x3695('0x7f'),'include':[{'model':db['CmContact'],'as':_0x3695('0x7c'),'where':{[_0x20eb65[_0x3695('0x77')]]:_0x59583d},'limit':0x1,'order':[[_0x3695('0x71'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x17e983,null))[_0x3695('0x31')](function(_0x58a7d0){if(_0x58a7d0&&_0x58a7d0['List']){_0x13b720=_0x58a7d0[_0x3695('0x58')]({'plain':!![]});if(_0x13b720[_0x3695('0x7f')]&&_0x13b720['List'][_0x3695('0x7c')][_0x3695('0x52')]){return _0x13b720[_0x3695('0x7f')]['Contacts'][0x0];}return db[_0x3695('0x6c')][_0x3695('0x53')](_[_0x3695('0x15')](_0x1df689['body'],{'firstName':_0x59583d,[_0x58a7d0[_0x3695('0x77')]]:_0x59583d,'phone':_0x59583d,'ListId':_0x13b720[_0x3695('0x84')]}));}})[_0x3695('0x31')](handleEntityNotFound(_0x17e983,null))['then'](function(_0x57a684){if(_0x57a684){_0x5a59e5=_0x57a684;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x5a59e5['id'],'closed':![],'OpenchannelAccountId':_0x13b720['id']}})[_0x3695('0x31')](function(_0x1292fd){if(_0x1292fd){return[_0x1292fd,![]];}return db[_0x3695('0x8a')][_0x3695('0x53')]({'UserId':_0x1df689[_0x3695('0x55')]['id'],'ContactId':_0x5a59e5['id'],'OpenchannelAccountId':_0x13b720['id'],'lastMsgDirection':_0x3695('0xb3'),'firstMsgDirection':_0x3695('0xb3'),'Messages':[_[_0x3695('0x4a')](_0x1df689[_0x3695('0x54')],{'read':![],'body':_0x1df689[_0x3695('0x54')][_0x3695('0x54')],'OpenchannelAccountId':_0x13b720['id'],'UserId':_0x1df689[_0x3695('0x55')]['id'],'ContactId':_0x5a59e5['id']})]},{'include':[{'model':db[_0x3695('0xb4')],'as':'Messages'}]})[_0x3695('0x31')](function(_0x2f10bd){return[_0x2f10bd,!![]];});});}})[_0x3695('0xac')](function(_0x2ad720,_0x3126d4){if(_0x3126d4){return _0x2ad720;}return db['OpenchannelMessage'][_0x3695('0x53')](_['merge'](_0x1df689[_0x3695('0x54')],{'read':![],'body':_0x1df689[_0x3695('0x54')]['body'],'OpenchannelAccountId':_0x13b720['id'],'OpenchannelInteractionId':_0x2ad720['id'],'UserId':_0x1df689[_0x3695('0x55')]['id'],'ContactId':_0x5a59e5['id']}))[_0x3695('0x31')](function(_0x3b9c7c){_0x2ad720['dataValues'][_0x3695('0xb5')]=[];_0x2ad720['dataValues']['Messages'][_0x3695('0x90')](_0x3b9c7c['dataValues']);return _0x2ad720;});});}})[_0x3695('0x31')](respondWithResult(_0x17e983,null))[_0x3695('0x27')](handleError(_0x17e983,null));};
\ No newline at end of file
index 8f02f1f..1019c7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x96cc=['remove','emit','hook','exports','events','OpenchannelAccount','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96cc,0x16c));var _0xc96c=function(_0x5738d7,_0x424f69){_0x5738d7=_0x5738d7-0x0;var _0x19dd9c=_0x96cc[_0x5738d7];return _0x19dd9c;};'use strict';var EventEmitter=require(_0xc96c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xc96c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc96c('0x2'),'afterUpdate':_0xc96c('0x3'),'afterDestroy':_0xc96c('0x4')};function emitEvent(_0x421701){return function(_0x71140d,_0x29b6f1,_0x377e6c){OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701+':'+_0x71140d['id'],_0x71140d);OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701,_0x71140d);_0x377e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc96c('0x6')](e,emitEvent(event));}}module[_0xc96c('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index cd3c151..11b0aba 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(_0x3a9fc1,_0x28cd13){var _0x3342a6=function(_0x20893b){while(--_0x20893b){_0x3a9fc1['push'](_0x3a9fc1['shift']());}};_0x3342a6(++_0x28cd13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x56e69d,_0x19a8ff){var _0x220a96=function(_0x1ee6a8){while(--_0x1ee6a8){_0x56e69d['push'](_0x56e69d['shift']());}};_0x220a96(++_0x19a8ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 ec22dbe..1d95e49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5423=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5423,0xe3));var _0x3542=function(_0x54b95c,_0x419631){_0x54b95c=_0x54b95c-0x0;var _0x1524bd=_0x5423[_0x54b95c];return _0x1524bd;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var moment=require('moment');var BPromise=require(_0x3542('0x2'));var rs=require(_0x3542('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3542('0x4'))['db'];var utils=require(_0x3542('0x5'));var logger=require(_0x3542('0x6'))(_0x3542('0x7'));var config=require('../../config/environment');var jayson=require(_0x3542('0x8'));var client=jayson[_0x3542('0x9')][_0x3542('0xa')]({'port':0x232a});config[_0x3542('0xb')]=_[_0x3542('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3542('0xd'))(new Redis(config[_0x3542('0xb')]));require('./openchannelAccount.socket')[_0x3542('0xe')](socket);function respondWithRpcPromise(_0x592409,_0x4bb8b3,_0xf7da7f){return new BPromise(function(_0x45f497,_0x57eee2){return client[_0x3542('0xf')](_0x592409,_0xf7da7f)[_0x3542('0x10')](function(_0x48ae2a){logger[_0x3542('0x11')](_0x3542('0x12'),_0x4bb8b3,_0x3542('0x13'));logger[_0x3542('0x14')](_0x3542('0x15'),_0x4bb8b3,_0x3542('0x13'),JSON[_0x3542('0x16')](_0x48ae2a));if(_0x48ae2a[_0x3542('0x17')]){if(_0x48ae2a[_0x3542('0x17')][_0x3542('0x18')]===0x1f4){logger['error'](_0x3542('0x12'),_0x4bb8b3,_0x48ae2a['error'][_0x3542('0x19')]);return _0x57eee2(_0x48ae2a[_0x3542('0x17')][_0x3542('0x19')]);}logger['error'](_0x3542('0x12'),_0x4bb8b3,_0x48ae2a[_0x3542('0x17')][_0x3542('0x19')]);return _0x45f497(_0x48ae2a['error'][_0x3542('0x19')]);}else{logger[_0x3542('0x11')](_0x3542('0x12'),_0x4bb8b3,_0x3542('0x13'));_0x45f497(_0x48ae2a['result'][_0x3542('0x19')]);}})['catch'](function(_0x2fa983){logger[_0x3542('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x4bb8b3,_0x2fa983);_0x57eee2(_0x2fa983);});});}
\ No newline at end of file
+var _0xd7a0=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x47caea,_0xecdd70){var _0x14dae4=function(_0x5afce7){while(--_0x5afce7){_0x47caea['push'](_0x47caea['shift']());}};_0x14dae4(++_0xecdd70);}(_0xd7a0,0x163));var _0x0d7a=function(_0x2590f9,_0x57deb0){_0x2590f9=_0x2590f9-0x0;var _0x2b2779=_0xd7a0[_0x2590f9];return _0x2b2779;};'use strict';var _=require(_0x0d7a('0x0'));var util=require(_0x0d7a('0x1'));var moment=require('moment');var BPromise=require(_0x0d7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d7a('0x3'));var db=require(_0x0d7a('0x4'))['db'];var utils=require(_0x0d7a('0x5'));var logger=require(_0x0d7a('0x6'))(_0x0d7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d7a('0x8'));var client=jayson[_0x0d7a('0x9')][_0x0d7a('0xa')]({'port':0x232a});config[_0x0d7a('0xb')]=_[_0x0d7a('0xc')](config[_0x0d7a('0xb')],{'host':_0x0d7a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d7a('0xb')]));require(_0x0d7a('0xe'))[_0x0d7a('0xf')](socket);function respondWithRpcPromise(_0x4688bf,_0x5107c7,_0x410bdd){return new BPromise(function(_0x842056,_0x5064ac){return client[_0x0d7a('0x10')](_0x4688bf,_0x410bdd)[_0x0d7a('0x11')](function(_0x4275a9){logger[_0x0d7a('0x12')](_0x0d7a('0x13'),_0x5107c7,'request\x20sent');logger['debug'](_0x0d7a('0x14'),_0x5107c7,_0x0d7a('0x15'),JSON[_0x0d7a('0x16')](_0x4275a9));if(_0x4275a9['error']){if(_0x4275a9[_0x0d7a('0x17')]['code']===0x1f4){logger['error'](_0x0d7a('0x13'),_0x5107c7,_0x4275a9['error'][_0x0d7a('0x18')]);return _0x5064ac(_0x4275a9[_0x0d7a('0x17')][_0x0d7a('0x18')]);}logger[_0x0d7a('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x5107c7,_0x4275a9[_0x0d7a('0x17')][_0x0d7a('0x18')]);return _0x842056(_0x4275a9['error'][_0x0d7a('0x18')]);}else{logger[_0x0d7a('0x12')](_0x0d7a('0x13'),_0x5107c7,_0x0d7a('0x15'));_0x842056(_0x4275a9['result'][_0x0d7a('0x18')]);}})['catch'](function(_0x569285){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5107c7,_0x569285);_0x5064ac(_0x569285);});});}
\ No newline at end of file
index e6d0ebd..12ea9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c6f=['length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x4f250b,_0x31dee5){var _0x283a61=function(_0x4aa376){while(--_0x4aa376){_0x4f250b['push'](_0x4f250b['shift']());}};_0x283a61(++_0x31dee5);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x9c18e9,_0x43448d){_0x9c18e9=_0x9c18e9-0x0;var _0x544250=_0x6c6f[_0x9c18e9];return _0x544250;};'use strict';var OpenchannelAccountEvents=require(_0xf6c6('0x0'));var events=[_0xf6c6('0x1'),_0xf6c6('0x2'),_0xf6c6('0x3')];function createListener(_0x2f571d,_0x3c8fc3){return function(_0x332916){_0x3c8fc3[_0xf6c6('0x4')](_0x2f571d,_0x332916);};}function removeListener(_0x36fcd2,_0xa1183){return function(){OpenchannelAccountEvents[_0xf6c6('0x5')](_0x36fcd2,_0xa1183);};}exports['register']=function(_0x3b4e7b){for(var _0x4f8e34=0x0,_0x4c27f8=events[_0xf6c6('0x6')];_0x4f8e34<_0x4c27f8;_0x4f8e34++){var _0x5b34df=events[_0x4f8e34];var _0x308c42=createListener(_0xf6c6('0x7')+_0x5b34df,_0x3b4e7b);OpenchannelAccountEvents['on'](_0x5b34df,_0x308c42);}};
\ No newline at end of file
+var _0x8696=['openchannelAccount:','./openchannelAccount.events','save','update','emit','register','length'];(function(_0x517869,_0x1f383b){var _0x2e6dd7=function(_0x550e2e){while(--_0x550e2e){_0x517869['push'](_0x517869['shift']());}};_0x2e6dd7(++_0x1f383b);}(_0x8696,0x143));var _0x6869=function(_0x4bae84,_0x396334){_0x4bae84=_0x4bae84-0x0;var _0x167893=_0x8696[_0x4bae84];return _0x167893;};'use strict';var OpenchannelAccountEvents=require(_0x6869('0x0'));var events=[_0x6869('0x1'),'remove',_0x6869('0x2')];function createListener(_0x596fbb,_0x3d6bc2){return function(_0x5befa3){_0x3d6bc2[_0x6869('0x3')](_0x596fbb,_0x5befa3);};}function removeListener(_0x4dadb5,_0x46c26d){return function(){OpenchannelAccountEvents['removeListener'](_0x4dadb5,_0x46c26d);};}exports[_0x6869('0x4')]=function(_0x45542c){for(var _0x54d39b=0x0,_0x4c8ad5=events[_0x6869('0x5')];_0x54d39b<_0x4c8ad5;_0x54d39b++){var _0x1e667d=events[_0x54d39b];var _0xa343ab=createListener(_0x6869('0x6')+_0x1e667d,_0x45542c);OpenchannelAccountEvents['on'](_0x1e667d,_0xa343ab);}};
\ No newline at end of file
index fd5edc5..4d68307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb02=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy'];(function(_0x47649a,_0x5de7a4){var _0x46f3c0=function(_0x1a57fc){while(--_0x1a57fc){_0x47649a['push'](_0x47649a['shift']());}};_0x46f3c0(++_0x5de7a4);}(_0xbb02,0x1db));var _0x2bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2bb0('0x0'));var path=require(_0x2bb0('0x1'));var timeout=require(_0x2bb0('0x2'));var express=require(_0x2bb0('0x3'));var router=express[_0x2bb0('0x4')]();var fs_extra=require(_0x2bb0('0x5'));var auth=require(_0x2bb0('0x6'));var interaction=require(_0x2bb0('0x7'));var config=require(_0x2bb0('0x8'));var controller=require(_0x2bb0('0x9'));router[_0x2bb0('0xa')]('/',auth[_0x2bb0('0xb')](),controller[_0x2bb0('0xc')]);router[_0x2bb0('0xa')](_0x2bb0('0xd'),auth[_0x2bb0('0xb')](),controller[_0x2bb0('0xe')]);router['post']('/',auth[_0x2bb0('0xb')](),controller['create']);router[_0x2bb0('0xf')](_0x2bb0('0xd'),auth[_0x2bb0('0xb')](),controller[_0x2bb0('0x10')]);router[_0x2bb0('0x11')](_0x2bb0('0xd'),auth[_0x2bb0('0xb')](),controller[_0x2bb0('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0ca8=['get','index','/:id','isAuthenticated','post','create','put','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller'];(function(_0x4362c4,_0x57b51f){var _0x4e2876=function(_0x208a59){while(--_0x208a59){_0x4362c4['push'](_0x4362c4['shift']());}};_0x4e2876(++_0x57b51f);}(_0x0ca8,0xe5));var _0x80ca=function(_0x235784,_0xf01b54){_0x235784=_0x235784-0x0;var _0x45709d=_0x0ca8[_0x235784];return _0x45709d;};'use strict';var multer=require(_0x80ca('0x0'));var util=require(_0x80ca('0x1'));var path=require(_0x80ca('0x2'));var timeout=require(_0x80ca('0x3'));var express=require('express');var router=express[_0x80ca('0x4')]();var fs_extra=require(_0x80ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80ca('0x6'));var config=require(_0x80ca('0x7'));var controller=require(_0x80ca('0x8'));router[_0x80ca('0x9')]('/',auth['isAuthenticated'](),controller[_0x80ca('0xa')]);router[_0x80ca('0x9')](_0x80ca('0xb'),auth[_0x80ca('0xc')](),controller['show']);router[_0x80ca('0xd')]('/',auth['isAuthenticated'](),controller[_0x80ca('0xe')]);router[_0x80ca('0xf')](_0x80ca('0xb'),auth[_0x80ca('0xc')](),controller['update']);router['delete'](_0x80ca('0xb'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x10')]);module['exports']=router;
\ No newline at end of file
index afd35dd..114ab72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b4=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xf8b4,0x1e5));var _0x4f8b=function(_0x29cdb9,_0x195ffe){_0x29cdb9=_0x29cdb9-0x0;var _0x273089=_0xf8b4[_0x29cdb9];return _0x273089;};'use strict';var Sequelize=require(_0x4f8b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4f8b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4f8b('0x2')],'allowNull':![],'defaultValue':_0x4f8b('0x3')},'appdata':{'type':Sequelize[_0x4f8b('0x4')]()},'description':{'type':Sequelize[_0x4f8b('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4f8b('0x5')}};
\ No newline at end of file
+var _0xa820=['sequelize','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x438075,_0x59ca9e){var _0x3c2ff0=function(_0x305e6e){while(--_0x305e6e){_0x438075['push'](_0x438075['shift']());}};_0x3c2ff0(++_0x59ca9e);}(_0xa820,0x1c7));var _0x0a82=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xa820[_0x374ccf];return _0x443cde;};'use strict';var Sequelize=require(_0x0a82('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0a82('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0a82('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0a82('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a82('0x2')],'defaultValue':_0x0a82('0x4')}};
\ No newline at end of file
index 66748d2..87ab334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x113a=['../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','json','apply','reject','save','then','destroy','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','update','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x113a,0x1e9));var _0xa113=function(_0x550f66,_0x341393){_0x550f66=_0x550f66-0x0;var _0x5b9b22=_0x113a[_0x550f66];return _0x5b9b22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa113('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa113('0x1'));var moment=require(_0xa113('0x2'));var BPromise=require(_0xa113('0x3'));var Mustache=require(_0xa113('0x4'));var util=require(_0xa113('0x5'));var path=require(_0xa113('0x6'));var sox=require(_0xa113('0x7'));var csv=require(_0xa113('0x8'));var ejs=require(_0xa113('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa113('0xa'));var squel=require(_0xa113('0xb'));var crypto=require(_0xa113('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa113('0xd'));var toCsv=require(_0xa113('0x8'));var querystring=require(_0xa113('0xe'));var Papa=require(_0xa113('0xf'));var Redis=require(_0xa113('0x10'));var authService=require(_0xa113('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa113('0x12'));var hardwareService=require(_0xa113('0x13'));var logger=require('../../config/logger')(_0xa113('0x14'));var utils=require('../../config/utils');var config=require(_0xa113('0x15'));var licenseUtil=require(_0xa113('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a4643,_0x1473d7){_0x1473d7=_0x1473d7||0xcc;return function(_0x374204){if(_0x374204){return _0x3a4643[_0xa113('0x17')](_0x1473d7);}return _0x3a4643['status'](_0x1473d7)[_0xa113('0x18')]();};}function respondWithResult(_0x31c124,_0x57dfe8){_0x57dfe8=_0x57dfe8||0xc8;return function(_0x56762f){if(_0x56762f){return _0x31c124[_0xa113('0x19')](_0x57dfe8)['json'](_0x56762f);}};}function respondWithFilteredResult(_0x32c791,_0x33316e){return function(_0x53ac48){if(_0x53ac48){var _0x3bd154=typeof _0x33316e[_0xa113('0x1a')]===_0xa113('0x1b')&&typeof _0x33316e['limit']===_0xa113('0x1b');var _0x52e0c2=_0x53ac48[_0xa113('0x1c')];var _0x5d38f2=_0x3bd154?0x0:_0x33316e[_0xa113('0x1a')];var _0x5d9c6a=_0x3bd154?_0x53ac48[_0xa113('0x1c')]:_0x33316e[_0xa113('0x1a')]+_0x33316e[_0xa113('0x1d')];var _0x4e4755;if(_0x5d9c6a>=_0x52e0c2){_0x5d9c6a=_0x52e0c2;_0x4e4755=0xc8;}else{_0x4e4755=0xce;}_0x32c791['status'](_0x4e4755);return _0x32c791['set']('Content-Range',_0x5d38f2+'-'+_0x5d9c6a+'/'+_0x52e0c2)[_0xa113('0x1e')](_0x53ac48);}return null;};}function patchUpdates(_0x2c5731){return function(_0x1d76b3){try{jsonpatch[_0xa113('0x1f')](_0x1d76b3,_0x2c5731,!![]);}catch(_0x4a4cf8){return BPromise[_0xa113('0x20')](_0x4a4cf8);}return _0x1d76b3[_0xa113('0x21')]();};}function saveUpdates(_0x1b89c0,_0x3eb305){return function(_0x2d821b){if(_0x2d821b){return _0x2d821b['update'](_0x1b89c0)[_0xa113('0x22')](function(_0xe47a07){return _0xe47a07;});}return null;};}function removeEntity(_0x2f6e47,_0x120f63){return function(_0x583480){if(_0x583480){return _0x583480[_0xa113('0x23')]()['then'](function(){_0x2f6e47[_0xa113('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31dab8,_0x3d27c8){return function(_0x21d277){if(!_0x21d277){_0x31dab8[_0xa113('0x17')](0x194);}return _0x21d277;};}function handleError(_0x304295,_0x28cca3){_0x28cca3=_0x28cca3||0x1f4;return function(_0x4fae98){logger[_0xa113('0x24')](_0x4fae98['stack']);if(_0x4fae98[_0xa113('0x25')]){delete _0x4fae98[_0xa113('0x25')];}_0x304295[_0xa113('0x19')](_0x28cca3)[_0xa113('0x26')](_0x4fae98);};}exports[_0xa113('0x27')]=function(_0x1dd0fb,_0x14e305){var _0x2d4bb4={},_0x2c3752={},_0x16ee05={'count':0x0,'rows':[]};var _0x47e42b=_[_0xa113('0x28')](db[_0xa113('0x29')][_0xa113('0x2a')],function(_0x476331){return{'name':_0x476331[_0xa113('0x2b')],'type':_0x476331['type'][_0xa113('0x2c')]};});_0x2c3752[_0xa113('0x2d')]=_[_0xa113('0x28')](_0x47e42b,_0xa113('0x25'));_0x2c3752[_0xa113('0x2e')]=_[_0xa113('0x2f')](_0x1dd0fb[_0xa113('0x2e')]);_0x2c3752[_0xa113('0x30')]=_['intersection'](_0x2c3752[_0xa113('0x2d')],_0x2c3752[_0xa113('0x2e')]);_0x2d4bb4['attributes']=_[_0xa113('0x31')](_0x2c3752[_0xa113('0x2d')],qs[_0xa113('0x32')](_0x1dd0fb['query']['fields']));_0x2d4bb4['attributes']=_0x2d4bb4[_0xa113('0x33')][_0xa113('0x34')]?_0x2d4bb4[_0xa113('0x33')]:_0x2c3752[_0xa113('0x2d')];if(!_0x1dd0fb['query']['hasOwnProperty'](_0xa113('0x35'))){_0x2d4bb4[_0xa113('0x1d')]=qs['limit'](_0x1dd0fb[_0xa113('0x2e')]['limit']);_0x2d4bb4[_0xa113('0x1a')]=qs['offset'](_0x1dd0fb[_0xa113('0x2e')][_0xa113('0x1a')]);}_0x2d4bb4[_0xa113('0x36')]=qs['sort'](_0x1dd0fb['query'][_0xa113('0x37')]);_0x2d4bb4['where']=qs['filters'](_[_0xa113('0x38')](_0x1dd0fb[_0xa113('0x2e')],_0x2c3752[_0xa113('0x30')]),_0x47e42b);if(_0x1dd0fb[_0xa113('0x2e')][_0xa113('0x39')]){_0x2d4bb4[_0xa113('0x3a')]=_[_0xa113('0x3b')](_0x2d4bb4[_0xa113('0x3a')],{'$or':_[_0xa113('0x28')](_0x47e42b,function(_0x5f017d){if(_0x5f017d[_0xa113('0x3c')]!==_0xa113('0x3d')){var _0x81c81c={};_0x81c81c[_0x5f017d[_0xa113('0x25')]]={'$like':'%'+_0x1dd0fb[_0xa113('0x2e')][_0xa113('0x39')]+'%'};return _0x81c81c;}})});}_0x2d4bb4=_[_0xa113('0x3b')]({},_0x2d4bb4,_0x1dd0fb[_0xa113('0x3e')]);var _0x41d5ed={'where':_0x2d4bb4[_0xa113('0x3a')]};return db[_0xa113('0x29')][_0xa113('0x1c')](_0x41d5ed)[_0xa113('0x22')](function(_0x4cb5cf){_0x16ee05[_0xa113('0x1c')]=_0x4cb5cf;if(_0x1dd0fb[_0xa113('0x2e')][_0xa113('0x3f')]){_0x2d4bb4[_0xa113('0x40')]=[{'all':!![]}];}return db[_0xa113('0x29')][_0xa113('0x41')](_0x2d4bb4);})['then'](function(_0x4218a9){_0x16ee05[_0xa113('0x42')]=_0x4218a9;return _0x16ee05;})[_0xa113('0x22')](respondWithFilteredResult(_0x14e305,_0x2d4bb4))['catch'](handleError(_0x14e305,null));};exports['show']=function(_0x5dfa0f,_0x216e9a){var _0x1535fc={'raw':!![],'where':{'id':_0x5dfa0f[_0xa113('0x43')]['id']}},_0x55516f={};_0x55516f[_0xa113('0x2d')]=_['keys'](db[_0xa113('0x29')][_0xa113('0x2a')]);_0x55516f['query']=_['keys'](_0x5dfa0f[_0xa113('0x2e')]);_0x55516f[_0xa113('0x30')]=_['intersection'](_0x55516f[_0xa113('0x2d')],_0x55516f[_0xa113('0x2e')]);_0x1535fc['attributes']=_[_0xa113('0x31')](_0x55516f['model'],qs[_0xa113('0x32')](_0x5dfa0f[_0xa113('0x2e')][_0xa113('0x32')]));_0x1535fc[_0xa113('0x33')]=_0x1535fc['attributes']['length']?_0x1535fc['attributes']:_0x55516f[_0xa113('0x2d')];if(_0x5dfa0f[_0xa113('0x2e')][_0xa113('0x3f')]){_0x1535fc[_0xa113('0x40')]=[{'all':!![]}];}_0x1535fc=_['merge']({},_0x1535fc,_0x5dfa0f[_0xa113('0x3e')]);return db['OpenchannelApplication'][_0xa113('0x44')](_0x1535fc)[_0xa113('0x22')](handleEntityNotFound(_0x216e9a,null))[_0xa113('0x22')](respondWithResult(_0x216e9a,null))[_0xa113('0x45')](handleError(_0x216e9a,null));};exports['create']=function(_0x3f6b64,_0x5ab788){return db['OpenchannelApplication'][_0xa113('0x46')](_0x3f6b64[_0xa113('0x47')],{})[_0xa113('0x22')](respondWithResult(_0x5ab788,0xc9))[_0xa113('0x45')](handleError(_0x5ab788,null));};exports[_0xa113('0x48')]=function(_0x20eb87,_0x1e6f20){if(_0x20eb87[_0xa113('0x47')]['id']){delete _0x20eb87['body']['id'];}return db['OpenchannelApplication'][_0xa113('0x44')]({'where':{'id':_0x20eb87[_0xa113('0x43')]['id']}})[_0xa113('0x22')](handleEntityNotFound(_0x1e6f20,null))['then'](saveUpdates(_0x20eb87[_0xa113('0x47')],null))[_0xa113('0x22')](respondWithResult(_0x1e6f20,null))[_0xa113('0x45')](handleError(_0x1e6f20,null));};exports[_0xa113('0x23')]=function(_0x57b255,_0x153cd8){return db[_0xa113('0x29')][_0xa113('0x44')]({'where':{'id':_0x57b255[_0xa113('0x43')]['id']}})[_0xa113('0x22')](handleEntityNotFound(_0x153cd8,null))[_0xa113('0x22')](removeEntity(_0x153cd8,null))[_0xa113('0x45')](handleError(_0x153cd8,null));};
\ No newline at end of file
+var _0xb7ff=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xbfa3d5,_0x3cec07){var _0x590429=function(_0x5c3285){while(--_0x5c3285){_0xbfa3d5['push'](_0xbfa3d5['shift']());}};_0x590429(++_0x3cec07);}(_0xb7ff,0x11d));var _0xfb7f=function(_0x4f3104,_0x1d2d99){_0x4f3104=_0x4f3104-0x0;var _0x51521a=_0xb7ff[_0x4f3104];return _0x51521a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb7f('0x0'));var zipdir=require(_0xfb7f('0x1'));var jsonpatch=require(_0xfb7f('0x2'));var rp=require(_0xfb7f('0x3'));var moment=require('moment');var BPromise=require(_0xfb7f('0x4'));var Mustache=require(_0xfb7f('0x5'));var util=require(_0xfb7f('0x6'));var path=require('path');var sox=require(_0xfb7f('0x7'));var csv=require(_0xfb7f('0x8'));var ejs=require(_0xfb7f('0x9'));var fs=require('fs');var fs_extra=require(_0xfb7f('0xa'));var _=require(_0xfb7f('0xb'));var squel=require(_0xfb7f('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb7f('0xd'));var deskjs=require(_0xfb7f('0xe'));var toCsv=require(_0xfb7f('0x8'));var querystring=require('querystring');var Papa=require(_0xfb7f('0xf'));var Redis=require(_0xfb7f('0x10'));var authService=require(_0xfb7f('0x11'));var qs=require(_0xfb7f('0x12'));var as=require(_0xfb7f('0x13'));var hardwareService=require(_0xfb7f('0x14'));var logger=require('../../config/logger')(_0xfb7f('0x15'));var utils=require(_0xfb7f('0x16'));var config=require(_0xfb7f('0x17'));var licenseUtil=require(_0xfb7f('0x18'));var db=require(_0xfb7f('0x19'))['db'];function respondWithStatusCode(_0x9d1299,_0xf4186d){_0xf4186d=_0xf4186d||0xcc;return function(_0x57123f){if(_0x57123f){return _0x9d1299[_0xfb7f('0x1a')](_0xf4186d);}return _0x9d1299[_0xfb7f('0x1b')](_0xf4186d)[_0xfb7f('0x1c')]();};}function respondWithResult(_0x10f123,_0x20d6aa){_0x20d6aa=_0x20d6aa||0xc8;return function(_0x2a8720){if(_0x2a8720){return _0x10f123[_0xfb7f('0x1b')](_0x20d6aa)['json'](_0x2a8720);}};}function respondWithFilteredResult(_0xf50e36,_0x2ea4b4){return function(_0x1828d3){if(_0x1828d3){var _0x254a85=typeof _0x2ea4b4[_0xfb7f('0x1d')]==='undefined'&&typeof _0x2ea4b4[_0xfb7f('0x1e')]===_0xfb7f('0x1f');var _0x1ea881=_0x1828d3[_0xfb7f('0x20')];var _0x25638d=_0x254a85?0x0:_0x2ea4b4[_0xfb7f('0x1d')];var _0x417075=_0x254a85?_0x1828d3[_0xfb7f('0x20')]:_0x2ea4b4[_0xfb7f('0x1d')]+_0x2ea4b4[_0xfb7f('0x1e')];var _0x25c223;if(_0x417075>=_0x1ea881){_0x417075=_0x1ea881;_0x25c223=0xc8;}else{_0x25c223=0xce;}_0xf50e36['status'](_0x25c223);return _0xf50e36[_0xfb7f('0x21')]('Content-Range',_0x25638d+'-'+_0x417075+'/'+_0x1ea881)['json'](_0x1828d3);}return null;};}function patchUpdates(_0x52e3b1){return function(_0x1af25e){try{jsonpatch['apply'](_0x1af25e,_0x52e3b1,!![]);}catch(_0x4077f4){return BPromise[_0xfb7f('0x22')](_0x4077f4);}return _0x1af25e[_0xfb7f('0x23')]();};}function saveUpdates(_0x2c8e4a,_0x24d37b){return function(_0x2eddcd){if(_0x2eddcd){return _0x2eddcd[_0xfb7f('0x24')](_0x2c8e4a)[_0xfb7f('0x25')](function(_0x23e13f){return _0x23e13f;});}return null;};}function removeEntity(_0x5848c1,_0x3da6a3){return function(_0x34e6ff){if(_0x34e6ff){return _0x34e6ff[_0xfb7f('0x26')]()[_0xfb7f('0x25')](function(){_0x5848c1[_0xfb7f('0x1b')](0xcc)[_0xfb7f('0x1c')]();});}};}function handleEntityNotFound(_0x2f8c07,_0x203447){return function(_0xb70011){if(!_0xb70011){_0x2f8c07[_0xfb7f('0x1a')](0x194);}return _0xb70011;};}function handleError(_0x4844a7,_0x3f350a){_0x3f350a=_0x3f350a||0x1f4;return function(_0xcc8ee1){logger['error'](_0xcc8ee1[_0xfb7f('0x27')]);if(_0xcc8ee1[_0xfb7f('0x28')]){delete _0xcc8ee1[_0xfb7f('0x28')];}_0x4844a7['status'](_0x3f350a)[_0xfb7f('0x29')](_0xcc8ee1);};}exports[_0xfb7f('0x2a')]=function(_0x706b1d,_0x149781){var _0x4ead1f={},_0x858bce={},_0x48cfa9={'count':0x0,'rows':[]};var _0xf96970=_[_0xfb7f('0x2b')](db[_0xfb7f('0x2c')][_0xfb7f('0x2d')],function(_0x1964b9){return{'name':_0x1964b9[_0xfb7f('0x2e')],'type':_0x1964b9[_0xfb7f('0x2f')]['key']};});_0x858bce[_0xfb7f('0x30')]=_[_0xfb7f('0x2b')](_0xf96970,_0xfb7f('0x28'));_0x858bce[_0xfb7f('0x31')]=_[_0xfb7f('0x32')](_0x706b1d[_0xfb7f('0x31')]);_0x858bce[_0xfb7f('0x33')]=_[_0xfb7f('0x34')](_0x858bce['model'],_0x858bce[_0xfb7f('0x31')]);_0x4ead1f['attributes']=_[_0xfb7f('0x34')](_0x858bce[_0xfb7f('0x30')],qs[_0xfb7f('0x35')](_0x706b1d[_0xfb7f('0x31')][_0xfb7f('0x35')]));_0x4ead1f['attributes']=_0x4ead1f[_0xfb7f('0x36')][_0xfb7f('0x37')]?_0x4ead1f[_0xfb7f('0x36')]:_0x858bce[_0xfb7f('0x30')];if(!_0x706b1d[_0xfb7f('0x31')][_0xfb7f('0x38')](_0xfb7f('0x39'))){_0x4ead1f[_0xfb7f('0x1e')]=qs[_0xfb7f('0x1e')](_0x706b1d['query'][_0xfb7f('0x1e')]);_0x4ead1f['offset']=qs[_0xfb7f('0x1d')](_0x706b1d[_0xfb7f('0x31')][_0xfb7f('0x1d')]);}_0x4ead1f[_0xfb7f('0x3a')]=qs[_0xfb7f('0x3b')](_0x706b1d[_0xfb7f('0x31')][_0xfb7f('0x3b')]);_0x4ead1f[_0xfb7f('0x3c')]=qs[_0xfb7f('0x33')](_[_0xfb7f('0x3d')](_0x706b1d[_0xfb7f('0x31')],_0x858bce[_0xfb7f('0x33')]),_0xf96970);if(_0x706b1d['query']['filter']){_0x4ead1f[_0xfb7f('0x3c')]=_[_0xfb7f('0x3e')](_0x4ead1f[_0xfb7f('0x3c')],{'$or':_[_0xfb7f('0x2b')](_0xf96970,function(_0x2fd652){if(_0x2fd652[_0xfb7f('0x2f')]!==_0xfb7f('0x3f')){var _0x5060d6={};_0x5060d6[_0x2fd652['name']]={'$like':'%'+_0x706b1d[_0xfb7f('0x31')]['filter']+'%'};return _0x5060d6;}})});}_0x4ead1f=_[_0xfb7f('0x3e')]({},_0x4ead1f,_0x706b1d['options']);var _0x1c235c={'where':_0x4ead1f[_0xfb7f('0x3c')]};return db['OpenchannelApplication']['count'](_0x1c235c)['then'](function(_0x57821c){_0x48cfa9[_0xfb7f('0x20')]=_0x57821c;if(_0x706b1d['query'][_0xfb7f('0x40')]){_0x4ead1f[_0xfb7f('0x41')]=[{'all':!![]}];}return db[_0xfb7f('0x2c')][_0xfb7f('0x42')](_0x4ead1f);})[_0xfb7f('0x25')](function(_0x1d6b48){_0x48cfa9[_0xfb7f('0x43')]=_0x1d6b48;return _0x48cfa9;})[_0xfb7f('0x25')](respondWithFilteredResult(_0x149781,_0x4ead1f))['catch'](handleError(_0x149781,null));};exports['show']=function(_0x29c75d,_0x3ddd39){var _0x4653a4={'raw':!![],'where':{'id':_0x29c75d[_0xfb7f('0x44')]['id']}},_0x41cfbc={};_0x41cfbc['model']=_[_0xfb7f('0x32')](db['OpenchannelApplication'][_0xfb7f('0x2d')]);_0x41cfbc[_0xfb7f('0x31')]=_['keys'](_0x29c75d['query']);_0x41cfbc[_0xfb7f('0x33')]=_[_0xfb7f('0x34')](_0x41cfbc[_0xfb7f('0x30')],_0x41cfbc['query']);_0x4653a4['attributes']=_['intersection'](_0x41cfbc[_0xfb7f('0x30')],qs[_0xfb7f('0x35')](_0x29c75d[_0xfb7f('0x31')][_0xfb7f('0x35')]));_0x4653a4[_0xfb7f('0x36')]=_0x4653a4[_0xfb7f('0x36')]['length']?_0x4653a4[_0xfb7f('0x36')]:_0x41cfbc['model'];if(_0x29c75d[_0xfb7f('0x31')][_0xfb7f('0x40')]){_0x4653a4[_0xfb7f('0x41')]=[{'all':!![]}];}_0x4653a4=_[_0xfb7f('0x3e')]({},_0x4653a4,_0x29c75d['options']);return db[_0xfb7f('0x2c')][_0xfb7f('0x45')](_0x4653a4)[_0xfb7f('0x25')](handleEntityNotFound(_0x3ddd39,null))[_0xfb7f('0x25')](respondWithResult(_0x3ddd39,null))[_0xfb7f('0x46')](handleError(_0x3ddd39,null));};exports[_0xfb7f('0x47')]=function(_0x5c26ac,_0x310b9f){return db[_0xfb7f('0x2c')]['create'](_0x5c26ac[_0xfb7f('0x48')],{})[_0xfb7f('0x25')](respondWithResult(_0x310b9f,0xc9))[_0xfb7f('0x46')](handleError(_0x310b9f,null));};exports[_0xfb7f('0x24')]=function(_0x320203,_0x209252){if(_0x320203[_0xfb7f('0x48')]['id']){delete _0x320203[_0xfb7f('0x48')]['id'];}return db[_0xfb7f('0x2c')]['find']({'where':{'id':_0x320203[_0xfb7f('0x44')]['id']}})[_0xfb7f('0x25')](handleEntityNotFound(_0x209252,null))[_0xfb7f('0x25')](saveUpdates(_0x320203['body'],null))[_0xfb7f('0x25')](respondWithResult(_0x209252,null))[_0xfb7f('0x46')](handleError(_0x209252,null));};exports['destroy']=function(_0x3792c6,_0x5067b1){return db[_0xfb7f('0x2c')][_0xfb7f('0x45')]({'where':{'id':_0x3792c6['params']['id']}})['then'](handleEntityNotFound(_0x5067b1,null))['then'](removeEntity(_0x5067b1,null))[_0xfb7f('0x46')](handleError(_0x5067b1,null));};
\ No newline at end of file
index 493d0df..207d5d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebce=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x17dfc4,_0x5343ae){var _0x273036=function(_0x29ad58){while(--_0x29ad58){_0x17dfc4['push'](_0x17dfc4['shift']());}};_0x273036(++_0x5343ae);}(_0xebce,0xa0));var _0xeebc=function(_0x2d7712,_0x39aba4){_0x2d7712=_0x2d7712-0x0;var _0x2efa08=_0xebce[_0x2d7712];return _0x2efa08;};'use strict';var _=require(_0xeebc('0x0'));var util=require(_0xeebc('0x1'));var logger=require(_0xeebc('0x2'))('api');var moment=require(_0xeebc('0x3'));var BPromise=require(_0xeebc('0x4'));var rp=require(_0xeebc('0x5'));var fs=require('fs');var path=require(_0xeebc('0x6'));var rimraf=require('rimraf');var config=require(_0xeebc('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0xeebc('0x8')]=function(_0x1295d6,_0x3690ac){return _0x1295d6[_0xeebc('0x9')](_0xeebc('0xa'),attributes,{'tableName':_0xeebc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeebc('0xc'),'collate':_0xeebc('0xd')});};
\ No newline at end of file
+var _0x6cea=['request-promise','path','rimraf','./openchannelApplication.attributes','exports','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x53d78a,_0x178d43){var _0x268716=function(_0xfb2e62){while(--_0xfb2e62){_0x53d78a['push'](_0x53d78a['shift']());}};_0x268716(++_0x178d43);}(_0x6cea,0x192));var _0xa6ce=function(_0x296acd,_0x4b9279){_0x296acd=_0x296acd-0x0;var _0x121252=_0x6cea[_0x296acd];return _0x121252;};'use strict';var _=require(_0xa6ce('0x0'));var util=require(_0xa6ce('0x1'));var logger=require(_0xa6ce('0x2'))(_0xa6ce('0x3'));var moment=require(_0xa6ce('0x4'));var BPromise=require(_0xa6ce('0x5'));var rp=require(_0xa6ce('0x6'));var fs=require('fs');var path=require(_0xa6ce('0x7'));var rimraf=require(_0xa6ce('0x8'));var config=require('../../config/environment');var attributes=require(_0xa6ce('0x9'));module[_0xa6ce('0xa')]=function(_0x52fef9,_0x46dea3){return _0x52fef9['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa6ce('0xb')});};
\ No newline at end of file
index e077679..bb55134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca7b=['debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','then','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x5d1cdc,_0x110689){var _0x33fb31=function(_0x557810){while(--_0x557810){_0x5d1cdc['push'](_0x5d1cdc['shift']());}};_0x33fb31(++_0x110689);}(_0xca7b,0x1a6));var _0xbca7=function(_0x2e9ebf,_0x2c547b){_0x2e9ebf=_0x2e9ebf-0x0;var _0x1340d2=_0xca7b[_0x2e9ebf];return _0x1340d2;};'use strict';var _=require(_0xbca7('0x0'));var util=require(_0xbca7('0x1'));var moment=require(_0xbca7('0x2'));var BPromise=require(_0xbca7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbca7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbca7('0x5'))(_0xbca7('0x6'));var config=require(_0xbca7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbca7('0x8')][_0xbca7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd59cb9,_0x2fb080,_0x140a98){return new BPromise(function(_0x457a8a,_0x32e8c8){return client[_0xbca7('0xa')](_0xd59cb9,_0x140a98)['then'](function(_0x4d1d55){logger['info'](_0xbca7('0xb'),_0x2fb080,_0xbca7('0xc'));logger[_0xbca7('0xd')](_0xbca7('0xe'),_0x2fb080,_0xbca7('0xc'),JSON[_0xbca7('0xf')](_0x4d1d55));if(_0x4d1d55[_0xbca7('0x10')]){if(_0x4d1d55[_0xbca7('0x10')][_0xbca7('0x11')]===0x1f4){logger['error'](_0xbca7('0xb'),_0x2fb080,_0x4d1d55[_0xbca7('0x10')]['message']);return _0x32e8c8(_0x4d1d55[_0xbca7('0x10')][_0xbca7('0x12')]);}logger[_0xbca7('0x10')](_0xbca7('0xb'),_0x2fb080,_0x4d1d55[_0xbca7('0x10')][_0xbca7('0x12')]);return _0x457a8a(_0x4d1d55[_0xbca7('0x10')]['message']);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x2fb080,_0xbca7('0xc'));_0x457a8a(_0x4d1d55[_0xbca7('0x13')]['message']);}})[_0xbca7('0x14')](function(_0x5d150e){logger[_0xbca7('0x10')](_0xbca7('0xb'),_0x2fb080,_0x5d150e);_0x32e8c8(_0x5d150e);});});}exports[_0xbca7('0x15')]=function(_0x1ebea3){var _0x519d8e=this;return new Promise(function(_0x4cc871,_0x1b7981){return db[_0xbca7('0x16')]['update'](_0x1ebea3[_0xbca7('0x17')],{'raw':_0x1ebea3[_0xbca7('0x18')]?_0x1ebea3[_0xbca7('0x18')][_0xbca7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ebea3['options']?_0x1ebea3[_0xbca7('0x18')][_0xbca7('0x1a')]||null:null,'attributes':_0x1ebea3[_0xbca7('0x18')]?_0x1ebea3[_0xbca7('0x18')][_0xbca7('0x1b')]||null:null,'limit':_0x1ebea3[_0xbca7('0x18')]?_0x1ebea3['options']['limit']||null:null})[_0xbca7('0x1c')](function(_0x5ea4fe){logger['info'](_0xbca7('0x15'),_0x1ebea3);logger[_0xbca7('0xd')](_0xbca7('0x15'),_0x1ebea3,JSON[_0xbca7('0xf')](_0x5ea4fe));_0x4cc871(_0x5ea4fe);})[_0xbca7('0x14')](function(_0x2e0895){logger[_0xbca7('0x10')]('UpdateOpenchannelApplication',_0x2e0895[_0xbca7('0x12')],_0x1ebea3);_0x1b7981(_0x519d8e[_0xbca7('0x10')](0x1f4,_0x2e0895[_0xbca7('0x12')]));});});};
\ No newline at end of file
+var _0x91d1=['options','where','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','body'];(function(_0x58bd14,_0xb70c31){var _0x19ae10=function(_0x291004){while(--_0x291004){_0x58bd14['push'](_0x58bd14['shift']());}};_0x19ae10(++_0xb70c31);}(_0x91d1,0xd7));var _0x191d=function(_0x2df8f2,_0x184bc1){_0x2df8f2=_0x2df8f2-0x0;var _0x158faf=_0x91d1[_0x2df8f2];return _0x158faf;};'use strict';var _=require('lodash');var util=require(_0x191d('0x0'));var moment=require(_0x191d('0x1'));var BPromise=require(_0x191d('0x2'));var rs=require(_0x191d('0x3'));var fs=require('fs');var Redis=require(_0x191d('0x4'));var db=require(_0x191d('0x5'))['db'];var utils=require(_0x191d('0x6'));var logger=require(_0x191d('0x7'))(_0x191d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x191d('0x9')][_0x191d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32fabb,_0x9877eb,_0x3afa10){return new BPromise(function(_0x259281,_0x453ac0){return client[_0x191d('0xb')](_0x32fabb,_0x3afa10)[_0x191d('0xc')](function(_0x34785a){logger[_0x191d('0xd')](_0x191d('0xe'),_0x9877eb,_0x191d('0xf'));logger[_0x191d('0x10')](_0x191d('0x11'),_0x9877eb,_0x191d('0xf'),JSON[_0x191d('0x12')](_0x34785a));if(_0x34785a[_0x191d('0x13')]){if(_0x34785a[_0x191d('0x13')][_0x191d('0x14')]===0x1f4){logger[_0x191d('0x13')](_0x191d('0xe'),_0x9877eb,_0x34785a['error'][_0x191d('0x15')]);return _0x453ac0(_0x34785a[_0x191d('0x13')][_0x191d('0x15')]);}logger[_0x191d('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x9877eb,_0x34785a[_0x191d('0x13')]['message']);return _0x259281(_0x34785a[_0x191d('0x13')][_0x191d('0x15')]);}else{logger[_0x191d('0xd')](_0x191d('0xe'),_0x9877eb,_0x191d('0xf'));_0x259281(_0x34785a[_0x191d('0x16')]['message']);}})['catch'](function(_0xe9b974){logger[_0x191d('0x13')](_0x191d('0xe'),_0x9877eb,_0xe9b974);_0x453ac0(_0xe9b974);});});}exports[_0x191d('0x17')]=function(_0x24e1c8){var _0x563464=this;return new Promise(function(_0x1fcc17,_0x210a1c){return db['OpenchannelApplication']['update'](_0x24e1c8[_0x191d('0x18')],{'raw':_0x24e1c8[_0x191d('0x19')]?_0x24e1c8[_0x191d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e1c8[_0x191d('0x19')]?_0x24e1c8['options'][_0x191d('0x1a')]||null:null,'attributes':_0x24e1c8[_0x191d('0x19')]?_0x24e1c8['options'][_0x191d('0x1b')]||null:null,'limit':_0x24e1c8['options']?_0x24e1c8[_0x191d('0x19')][_0x191d('0x1c')]||null:null})[_0x191d('0xc')](function(_0x587c27){logger[_0x191d('0xd')]('UpdateOpenchannelApplication',_0x24e1c8);logger[_0x191d('0x10')](_0x191d('0x17'),_0x24e1c8,JSON[_0x191d('0x12')](_0x587c27));_0x1fcc17(_0x587c27);})[_0x191d('0x1d')](function(_0x37548a){logger[_0x191d('0x13')]('UpdateOpenchannelApplication',_0x37548a['message'],_0x24e1c8);_0x210a1c(_0x563464['error'](0x1f4,_0x37548a[_0x191d('0x15')]));});});};
\ No newline at end of file
index c2df594..e6c779f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','exports','multer','path','connect-timeout'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xabb1,0x193));var _0x1abb=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xabb1[_0xe73080];return _0x12cbc4;};'use strict';var multer=require(_0x1abb('0x0'));var util=require('util');var path=require(_0x1abb('0x1'));var timeout=require(_0x1abb('0x2'));var express=require(_0x1abb('0x3'));var router=express[_0x1abb('0x4')]();var fs_extra=require(_0x1abb('0x5'));var auth=require(_0x1abb('0x6'));var interaction=require(_0x1abb('0x7'));var config=require('../../config/environment');var controller=require(_0x1abb('0x8'));router['get']('/',auth[_0x1abb('0x9')](),controller[_0x1abb('0xa')]);router[_0x1abb('0xb')](_0x1abb('0xc'),auth[_0x1abb('0x9')](),controller[_0x1abb('0xd')]);router[_0x1abb('0xb')](_0x1abb('0xe'),auth['isAuthenticated'](),controller[_0x1abb('0xf')]);router['get'](_0x1abb('0x10'),auth[_0x1abb('0x9')](),controller['getMessages']);router['get']('/:id/download',auth[_0x1abb('0x9')](),controller['download']);router[_0x1abb('0x11')]('/',auth['isAuthenticated'](),controller[_0x1abb('0x12')]);router['post'](_0x1abb('0x10'),auth[_0x1abb('0x9')](),controller[_0x1abb('0x13')]);router[_0x1abb('0x11')](_0x1abb('0x14'),auth['isAuthenticated'](),interaction[_0x1abb('0x15')]('openchannel',_0x1abb('0x16')),controller['addTags']);router['put']('/:id',auth[_0x1abb('0x9')](),interaction[_0x1abb('0x15')](_0x1abb('0x17'),_0x1abb('0x18')),controller[_0x1abb('0x19')]);router[_0x1abb('0x1a')](_0x1abb('0xe'),auth[_0x1abb('0x9')](),interaction[_0x1abb('0x15')]('openchannel',_0x1abb('0x1b')),controller['destroy']);router[_0x1abb('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x1abb('0x1c')]=router;
\ No newline at end of file
+var _0xf872=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannelinteraction:update','delete','openchannel','openchannelinteraction:destroy','destroy','removeTags','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xf872,0xa8));var _0x2f87=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xf872[_0x17c483];return _0x112bdb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2f87('0x0'));var timeout=require('connect-timeout');var express=require(_0x2f87('0x1'));var router=express['Router']();var fs_extra=require(_0x2f87('0x2'));var auth=require(_0x2f87('0x3'));var interaction=require(_0x2f87('0x4'));var config=require('../../config/environment');var controller=require(_0x2f87('0x5'));router[_0x2f87('0x6')]('/',auth[_0x2f87('0x7')](),controller[_0x2f87('0x8')]);router[_0x2f87('0x6')](_0x2f87('0x9'),auth['isAuthenticated'](),controller[_0x2f87('0xa')]);router['get'](_0x2f87('0xb'),auth[_0x2f87('0x7')](),controller['show']);router[_0x2f87('0x6')]('/:id/messages',auth[_0x2f87('0x7')](),controller['getMessages']);router[_0x2f87('0x6')](_0x2f87('0xc'),auth[_0x2f87('0x7')](),controller['download']);router[_0x2f87('0xd')]('/',auth[_0x2f87('0x7')](),controller[_0x2f87('0xe')]);router[_0x2f87('0xd')](_0x2f87('0xf'),auth[_0x2f87('0x7')](),controller[_0x2f87('0x10')]);router[_0x2f87('0xd')](_0x2f87('0x11'),auth[_0x2f87('0x7')](),interaction[_0x2f87('0x12')]('openchannel',_0x2f87('0x13')),controller['addTags']);router[_0x2f87('0x14')](_0x2f87('0xb'),auth[_0x2f87('0x7')](),interaction['tracked']('openchannel',_0x2f87('0x15')),controller['update']);router[_0x2f87('0x16')]('/:id',auth[_0x2f87('0x7')](),interaction[_0x2f87('0x12')](_0x2f87('0x17'),_0x2f87('0x18')),controller[_0x2f87('0x19')]);router[_0x2f87('0x16')](_0x2f87('0x11'),auth['isAuthenticated'](),controller[_0x2f87('0x1a')]);module[_0x2f87('0x1b')]=router;
\ No newline at end of file
index 1b65685..e1af672 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe57=['DATE','ENUM','out','sequelize','exports','STRING'];(function(_0x4a2ab1,_0x37fa0f){var _0x1ea9f3=function(_0x18db57){while(--_0x18db57){_0x4a2ab1['push'](_0x4a2ab1['shift']());}};_0x1ea9f3(++_0x37fa0f);}(_0xfe57,0x195));var _0x7fe5=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xfe57[_0x5b6cf1];return _0x46278c;};'use strict';var Sequelize=require(_0x7fe5('0x0'));module[_0x7fe5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7fe5('0x2')]},'secondDisposition':{'type':Sequelize[_0x7fe5('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7fe5('0x2')]},'note':{'type':Sequelize[_0x7fe5('0x2')]},'read1stAt':{'type':Sequelize[_0x7fe5('0x3')]},'threadId':{'type':Sequelize[_0x7fe5('0x2')]},'externalUrl':{'type':Sequelize[_0x7fe5('0x2')]},'lastMsgAt':{'type':Sequelize[_0x7fe5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7fe5('0x4')]('in',_0x7fe5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7fe5('0x4')]('in',_0x7fe5('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7fe5('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6732=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x378487,_0x1fdc2c){var _0x3bb63b=function(_0x38c2e0){while(--_0x38c2e0){_0x378487['push'](_0x378487['shift']());}};_0x3bb63b(++_0x1fdc2c);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2673('0x0'));module[_0x2673('0x1')]={'closed':{'type':Sequelize[_0x2673('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2673('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2673('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2673('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2673('0x3')]},'threadId':{'type':Sequelize[_0x2673('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2673('0x5')]('in',_0x2673('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x2673('0x5')]('in',_0x2673('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2673('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2673('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 4c3961d..afb0414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29e4=['create','body','describe','OpenchannelMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','setTags','spread','Tag','name','emit','openchannelInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','fullname','get','Owner','closedAt','toString','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','download','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','stack','send','index','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','openchannel','query','catch','show','from','params','model','keys','intersection','attributes','fields','length','include','merge','find'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x29e4,0x1df));var _0x429e=function(_0x49866f,_0x5c28e5){_0x49866f=_0x49866f-0x0;var _0x319df0=_0x29e4[_0x49866f];return _0x319df0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x429e('0x0'));var moment=require(_0x429e('0x1'));var util=require(_0x429e('0x2'));var path=require(_0x429e('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x429e('0x4'));var Redis=require('ioredis');var interaction=require(_0x429e('0x5'));var qs=require(_0x429e('0x6'));var pdf=require(_0x429e('0x7'));var logger=require(_0x429e('0x8'))(_0x429e('0x9'));var config=require(_0x429e('0xa'));var db=require(_0x429e('0xb'))['db'];config[_0x429e('0xc')]=_['defaults'](config[_0x429e('0xc')],{'host':_0x429e('0xd'),'port':0x18eb});var socket=require(_0x429e('0xe'))(new Redis(config[_0x429e('0xc')]));require(_0x429e('0xf'))['register'](socket);function respondWithStatusCode(_0xd34809,_0x249164){_0x249164=_0x249164||0xcc;return function(_0x372a22){if(_0x372a22){return _0xd34809[_0x429e('0x10')](_0x249164);}return _0xd34809['status'](_0x249164)[_0x429e('0x11')]();};}function respondWithResult(_0x5f402a,_0x136693){_0x136693=_0x136693||0xc8;return function(_0x5be12b){if(_0x5be12b){return _0x5f402a[_0x429e('0x12')](_0x136693)['json'](_0x5be12b);}};}function respondWithFilteredResult(_0x38f6a9,_0x136d46){return function(_0x51bf80){if(_0x51bf80){var _0x53088e=typeof _0x136d46['offset']===_0x429e('0x13')&&typeof _0x136d46[_0x429e('0x14')]===_0x429e('0x13');var _0x52e350=_0x51bf80[_0x429e('0x15')];var _0x167e6f=_0x53088e?0x0:_0x136d46[_0x429e('0x16')];var _0x5bd024=_0x53088e?_0x51bf80['count']:_0x136d46[_0x429e('0x16')]+_0x136d46[_0x429e('0x14')];var _0x10a9a6;if(_0x5bd024>=_0x52e350){_0x5bd024=_0x52e350;_0x10a9a6=0xc8;}else{_0x10a9a6=0xce;}_0x38f6a9[_0x429e('0x12')](_0x10a9a6);return _0x38f6a9[_0x429e('0x17')](_0x429e('0x18'),_0x167e6f+'-'+_0x5bd024+'/'+_0x52e350)[_0x429e('0x19')](_0x51bf80);}return null;};}function saveUpdates(_0x49534e){return function(_0x31ad27){if(_0x31ad27){return _0x31ad27[_0x429e('0x1a')](_0x49534e)[_0x429e('0x1b')](function(_0x5d8398){return _0x5d8398;});}return null;};}function removeEntity(_0x4d02d8){return function(_0x517b41){if(_0x517b41){return _0x517b41[_0x429e('0x1c')]()['then'](function(){_0x4d02d8['status'](0xcc)[_0x429e('0x11')]();});}};}function handleEntityNotFound(_0x144c8c){return function(_0x5f4037){if(!_0x5f4037){_0x144c8c[_0x429e('0x10')](0x194);}return _0x5f4037;};}function handleError(_0x317c7d,_0x586a64){_0x586a64=_0x586a64||0x1f4;return function(_0x10cd26){logger['error'](_0x10cd26[_0x429e('0x1d')]);if(_0x10cd26['name']){delete _0x10cd26['name'];}_0x317c7d['status'](_0x586a64)[_0x429e('0x1e')](_0x10cd26);};}exports[_0x429e('0x1f')]=function(_0x40dd4c,_0x414f90){var _0x178e25={};var _0x513ecc=_[_0x429e('0x20')](db[_0x429e('0x21')][_0x429e('0x22')],function(_0x49a383){return{'name':_0x49a383['fieldName'],'type':_0x49a383[_0x429e('0x23')][_0x429e('0x24')]};});_0x178e25=qs[_0x429e('0x25')](_0x513ecc,_0x40dd4c);return interaction['findAll'](_0x429e('0x26'),_0x40dd4c[_0x429e('0x27')],_0x40dd4c['user'],_0x178e25,_0x513ecc)['then'](respondWithFilteredResult(_0x414f90,_0x178e25))[_0x429e('0x28')](handleError(_0x414f90,null));};exports[_0x429e('0x29')]=function(_0x1aa8fb,_0x242778){var _0x3f132a={};if(_0x1aa8fb[_0x429e('0x27')][_0x429e('0x23')]&&_0x1aa8fb[_0x429e('0x27')][_0x429e('0x23')]===_0x429e('0x2a')){_0x3f132a[_0x429e('0x2a')]=_0x1aa8fb[_0x429e('0x2b')]['id'];}else{_0x3f132a['id']=_0x1aa8fb[_0x429e('0x2b')]['id'];}var _0x54b772={'raw':![],'where':_0x3f132a},_0x75f4bc={};_0x75f4bc[_0x429e('0x2c')]=_[_0x429e('0x2d')](db[_0x429e('0x21')]['rawAttributes']);_0x75f4bc['query']=_[_0x429e('0x2d')](_0x1aa8fb[_0x429e('0x27')]);_0x75f4bc['filters']=_[_0x429e('0x2e')](_0x75f4bc[_0x429e('0x2c')],_0x75f4bc[_0x429e('0x27')]);_0x54b772[_0x429e('0x2f')]=_['intersection'](_0x75f4bc[_0x429e('0x2c')],qs[_0x429e('0x30')](_0x1aa8fb['query'][_0x429e('0x30')]));_0x54b772['attributes']=_0x54b772[_0x429e('0x2f')][_0x429e('0x31')]?_0x54b772[_0x429e('0x2f')]:_0x75f4bc[_0x429e('0x2c')];if(_0x1aa8fb['query']['includeAll']){_0x54b772[_0x429e('0x32')]=[{'all':!![]}];}_0x54b772=_[_0x429e('0x33')]({},_0x54b772,_0x1aa8fb['options']);return db[_0x429e('0x21')][_0x429e('0x34')](_0x54b772)[_0x429e('0x1b')](handleEntityNotFound(_0x242778,null))[_0x429e('0x1b')](respondWithResult(_0x242778,null))['catch'](handleError(_0x242778,null));};exports[_0x429e('0x35')]=function(_0xaacf0d,_0xcaf48a){return db[_0x429e('0x21')][_0x429e('0x35')](_0xaacf0d[_0x429e('0x36')],{})['then'](respondWithResult(_0xcaf48a,0xc9))[_0x429e('0x28')](handleError(_0xcaf48a,null));};exports['update']=function(_0x17d2fa,_0x366744){if(_0x17d2fa[_0x429e('0x36')]['id']){delete _0x17d2fa[_0x429e('0x36')]['id'];}return db[_0x429e('0x21')][_0x429e('0x34')]({'where':{'id':_0x17d2fa[_0x429e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x366744,null))[_0x429e('0x1b')](saveUpdates(_0x17d2fa['body'],null))['then'](respondWithResult(_0x366744,null))[_0x429e('0x28')](handleError(_0x366744,null));};exports[_0x429e('0x1c')]=function(_0x5ab6ad,_0x2ce94c){return db[_0x429e('0x21')]['find']({'where':{'id':_0x5ab6ad['params']['id']}})[_0x429e('0x1b')](handleEntityNotFound(_0x2ce94c,null))[_0x429e('0x1b')](removeEntity(_0x2ce94c,null))[_0x429e('0x28')](handleError(_0x2ce94c,null));};exports[_0x429e('0x37')]=function(_0x243fbf,_0x17e9b2){return db[_0x429e('0x21')][_0x429e('0x37')]()[_0x429e('0x1b')](respondWithResult(_0x17e9b2,null))[_0x429e('0x28')](handleError(_0x17e9b2,null));};exports['addMessage']=function(_0x44840b,_0x314e4f){return db[_0x429e('0x38')][_0x429e('0x34')]({'where':{'id':_0x44840b[_0x429e('0x2b')]['id']}})[_0x429e('0x1b')](handleEntityNotFound(_0x314e4f,null))[_0x429e('0x1b')](function(_0x9a7fbb){if(_0x9a7fbb){return _0x9a7fbb['addMessage'](_0x44840b[_0x429e('0x36')]['ids'],_[_0x429e('0x39')](_0x44840b[_0x429e('0x36')],[_0x429e('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x314e4f,null))[_0x429e('0x28')](handleError(_0x314e4f,null));};exports[_0x429e('0x3b')]=function(_0x4d57ff,_0x51a722){var _0x45a1a7={'raw':![],'where':{}};var _0x1bf231={};var _0x895280={'count':0x0,'rows':[]};return db[_0x429e('0x21')][_0x429e('0x3c')]({'where':{'id':_0x4d57ff['params']['id']}})[_0x429e('0x1b')](handleEntityNotFound(_0x51a722,null))['then'](function(_0x1bf792){if(_0x1bf792){_0x1bf231['model']=_[_0x429e('0x2d')](db[_0x429e('0x38')][_0x429e('0x22')]);_0x1bf231[_0x429e('0x27')]=_['keys'](_0x4d57ff[_0x429e('0x27')]);_0x1bf231[_0x429e('0x3d')]=_[_0x429e('0x2e')](_0x1bf231['model'],_0x1bf231[_0x429e('0x27')]);_0x45a1a7['attributes']=_[_0x429e('0x2e')](_0x1bf231[_0x429e('0x2c')],qs['fields'](_0x4d57ff[_0x429e('0x27')][_0x429e('0x30')]));_0x45a1a7[_0x429e('0x2f')]=_0x45a1a7[_0x429e('0x2f')][_0x429e('0x31')]?_0x45a1a7[_0x429e('0x2f')]:_0x1bf231[_0x429e('0x2c')];if(!_0x4d57ff['query'][_0x429e('0x3e')](_0x429e('0x3f'))){_0x45a1a7[_0x429e('0x14')]=qs[_0x429e('0x14')](_0x4d57ff[_0x429e('0x27')][_0x429e('0x14')]);_0x45a1a7['offset']=qs[_0x429e('0x16')](_0x4d57ff[_0x429e('0x27')][_0x429e('0x16')]);}_0x45a1a7[_0x429e('0x40')]=qs[_0x429e('0x41')](_0x4d57ff[_0x429e('0x27')][_0x429e('0x41')]);_0x45a1a7[_0x429e('0x42')]=qs['filters'](_[_0x429e('0x43')](_0x4d57ff[_0x429e('0x27')],_0x1bf231[_0x429e('0x3d')]));_0x45a1a7['where']['OpenchannelInteractionId']=_0x1bf792['id'];if(_0x4d57ff[_0x429e('0x27')][_0x429e('0x44')]){_0x45a1a7[_0x429e('0x42')]=_['merge'](_0x45a1a7[_0x429e('0x42')],{'$or':_['map'](_0x45a1a7['attributes'],function(_0x430903){var _0x1b22ce={};_0x1b22ce[_0x430903]={'$like':'%'+_0x4d57ff[_0x429e('0x27')][_0x429e('0x44')]+'%'};return _0x1b22ce;})});}if(_0x4d57ff['query'][_0x429e('0x45')]){var _0x22e3ae=_0x4d57ff[_0x429e('0x27')]['$gte'][_0x429e('0x46')](',');var _0x2efd2d={};_0x2efd2d[_0x22e3ae[0x0]]={'$gte':moment(_0x22e3ae[0x1])[_0x429e('0x47')](_0x429e('0x48'))};_0x45a1a7[_0x429e('0x42')]=_['merge'](_0x45a1a7['where'],_0x2efd2d);}_0x45a1a7=_['merge']({},_0x45a1a7,_0x4d57ff[_0x429e('0x49')]);return db[_0x429e('0x38')][_0x429e('0x15')]({'where':_0x45a1a7[_0x429e('0x42')]})[_0x429e('0x1b')](function(_0x412c48){_0x895280[_0x429e('0x15')]=_0x412c48;if(_0x4d57ff[_0x429e('0x27')][_0x429e('0x4a')]){_0x45a1a7[_0x429e('0x32')]=[{'all':!![]}];}return db[_0x429e('0x38')][_0x429e('0x4b')](_0x45a1a7);})['then'](function(_0x1ee32f){_0x895280[_0x429e('0x4c')]=_0x1ee32f;return _0x895280;});}})['then'](respondWithFilteredResult(_0x51a722,_0x45a1a7))['catch'](handleError(_0x51a722,null));};exports[_0x429e('0x4d')]=function(_0x1c3fa1,_0x3ceb87){return db[_0x429e('0x21')][_0x429e('0x34')]({'where':{'id':_0x1c3fa1[_0x429e('0x2b')]['id']}})[_0x429e('0x1b')](handleEntityNotFound(_0x3ceb87,null))[_0x429e('0x1b')](function(_0x42901f){if(_0x42901f){return _0x42901f[_0x429e('0x4e')](_0x1c3fa1['body'][_0x429e('0x3a')],_[_0x429e('0x39')](_0x1c3fa1[_0x429e('0x36')],[_0x429e('0x3a'),'id'])||{})[_0x429e('0x4f')](function(){return db[_0x429e('0x50')][_0x429e('0x4b')]({'attributes':['id',_0x429e('0x51'),'color'],'where':{'id':_0x1c3fa1['body'][_0x429e('0x3a')]}});})[_0x429e('0x1b')](function(_0x4c8a62){socket[_0x429e('0x52')](_0x429e('0x53'),{'id':Number(_0x1c3fa1[_0x429e('0x2b')]['id']),'tags':_0x4c8a62||[]});return{'id':Number(_0x1c3fa1['params']['id']),'tags':_0x4c8a62||[]};});}})[_0x429e('0x1b')](respondWithResult(_0x3ceb87,null))[_0x429e('0x28')](handleError(_0x3ceb87,null));};exports[_0x429e('0x54')]=function(_0x418462,_0x324ea3){return db[_0x429e('0x21')]['find']({'where':{'id':_0x418462[_0x429e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x324ea3,null))[_0x429e('0x1b')](function(_0x5c45b4){if(_0x5c45b4){return _0x5c45b4['removeTags'](_0x418462[_0x429e('0x27')][_0x429e('0x3a')]);}})['then'](respondWithStatusCode(_0x324ea3,null))[_0x429e('0x28')](handleError(_0x324ea3,null));};exports['download']=function(_0x3ec4e1,_0x57c882){var _0x474dc4=moment()['unix']()['toString']();var _0x4a91ce=path[_0x429e('0x55')](config[_0x429e('0x56')],_0x429e('0x57'),_0x429e('0x58'),_0x429e('0x59'));var _0x1a07ad=path[_0x429e('0x55')](config['root'],_0x429e('0x57'),_0x429e('0x58'),_0x429e('0x5a'));var _0x58c397=path[_0x429e('0x55')](_0x4a91ce,_0x474dc4);var _0xc2b48e=util[_0x429e('0x47')](_0x429e('0x5b'),_0x3ec4e1[_0x429e('0x2b')]['id'],_0x474dc4);var _0x13d088=path[_0x429e('0x55')](_0x4a91ce,_0xc2b48e);var _0x380e2b=[];_0x380e2b[_0x429e('0x5c')]({'model':db[_0x429e('0x5d')],'as':_0x429e('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0x380e2b[_0x429e('0x5c')]({'model':db[_0x429e('0x5e')],'as':_0x429e('0x5f'),'attributes':['id',_0x429e('0x60'),_0x429e('0x61')],'raw':!![]});if(_0x3ec4e1['query'][_0x429e('0x5a')]){_0x380e2b[_0x429e('0x5c')]({'model':db['Attachment'],'as':_0x429e('0x62'),'raw':!![]});}var _0x25b77b=[{'model':db[_0x429e('0x38')],'as':_0x429e('0x63'),'attributes':['id',_0x429e('0x36'),_0x429e('0x64'),_0x429e('0x65'),_0x429e('0x66'),_0x429e('0x67')],'include':_0x380e2b}];_0x25b77b['push']({'model':db[_0x429e('0x68')],'as':_0x429e('0x69'),'attributes':['id','name']});_0x25b77b[_0x429e('0x5c')]({'model':db[_0x429e('0x5d')],'as':'Owner','attributes':['id',_0x429e('0x6a')]});return db[_0x429e('0x21')][_0x429e('0x34')]({'where':{'id':_0x3ec4e1['params']['id']},'include':_0x25b77b})['then'](handleEntityNotFound(_0x57c882,null))[_0x429e('0x1b')](function(_0x18c5c8){if(_0x18c5c8){var _0x2e1c07=_0x18c5c8[_0x429e('0x6b')]({'plain':!![]});fs['mkdirSync'](_0x58c397);var _0x272961={'channel':'Openchannel','account':_0x2e1c07[_0x429e('0x69')][_0x429e('0x51')],'agent':_0x2e1c07['Owner']?_0x2e1c07[_0x429e('0x6c')][_0x429e('0x6a')]:'N.A.','createdAt':moment(_0x2e1c07[_0x429e('0x64')])[_0x429e('0x47')](_0x429e('0x48'))['toString'](),'closedAt':_0x2e1c07['closed']?moment(_0x2e1c07[_0x429e('0x6d')])[_0x429e('0x47')](_0x429e('0x48'))[_0x429e('0x6e')]():'','disposition':_0x2e1c07[_0x429e('0x6f')],'visibility':_0x2e1c07[_0x429e('0x70')]?_0x429e('0x71'):_0x429e('0x72'),'messages':_(_0x2e1c07[_0x429e('0x63')])[_0x429e('0x44')]({'secret':![]})['map'](function(_0x487e78){if(_0x487e78[_0x429e('0x62')]){var _0x31f360=path[_0x429e('0x55')](_0x1a07ad,_0x487e78[_0x429e('0x62')][_0x429e('0x73')]);if(fs[_0x429e('0x74')](_0x31f360)){fs[_0x429e('0x75')](_0x31f360)[_0x429e('0x76')](fs[_0x429e('0x77')](path[_0x429e('0x55')](_0x58c397,_0x487e78[_0x429e('0x62')][_0x429e('0x73')])));}}return{'date':moment(_0x487e78[_0x429e('0x64')])[_0x429e('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x487e78[_0x429e('0x65')]===_0x429e('0x78')?_0x487e78[_0x429e('0x5d')]?_0x487e78[_0x429e('0x5d')]['fullname']:_0x429e('0x79'):_0x487e78[_0x429e('0x5f')][_0x429e('0x60')]+(_0x487e78['Contact'][_0x429e('0x61')]?'\x20'+_0x487e78[_0x429e('0x5f')][_0x429e('0x61')]:''),'body':_0x487e78[_0x429e('0x62')]?_0x487e78[_0x429e('0x62')][_0x429e('0x73')]:_0x487e78['body'],'direction':_0x487e78[_0x429e('0x65')]===_0x429e('0x78')?'A':'C','secret':_0x487e78['secret'],'read':_0x487e78[_0x429e('0x67')],'attachment':_0x487e78[_0x429e('0x62')]};})[_0x429e('0x7a')]()};return ejs['renderFile'](path[_0x429e('0x55')](config['root'],_0x429e('0x57'),_0x429e('0x7b'),_0x429e('0x7c')),{'interaction':_0x272961})[_0x429e('0x1b')](function(_0x1cfd69){var _0x1f0a09=path[_0x429e('0x55')](_0x58c397,_0x429e('0x7d')+_0x2e1c07['id']+'-'+_0x474dc4+_0x429e('0x7e'));var _0x78df9f={'path':_0x1f0a09,'channel':_0x429e('0x7f'),'interactionId':_0x2e1c07['id']};return pdf[_0x429e('0x80')](_0x1cfd69,_0x78df9f);})['then'](function(){return new Promise(function(_0xf0a288,_0x333dc9){zipdir(_0x58c397,{'saveTo':_0x13d088},function(_0x5f13ab,_0x5ce2f6){if(_0x5f13ab)return _0x333dc9(_0x5f13ab);return _0xf0a288(_0x5ce2f6);});})[_0x429e('0x1b')](function(){return new Promise(function(_0x21a0c6,_0x28de3f){rimraf(_0x58c397,function(_0x39dc71){if(_0x39dc71)_0x28de3f(_0x39dc71);return _0x21a0c6();});});})['then'](function(){return _0x57c882[_0x429e('0x81')](_0x13d088,_0xc2b48e,function(_0x583a6c){if(_0x583a6c){logger[_0x429e('0x82')](_0x429e('0x83'),_0x583a6c);}else{fs[_0x429e('0x84')](_0x13d088);}});});});}else{return _0x57c882[_0x429e('0x10')](0xc8);}})[_0x429e('0x28')](handleError(_0x57c882,null));};
\ No newline at end of file
+var _0xbbb4=['fieldName','type','key','getOptions','findAll','openchannel','query','catch','show','from','params','OpenchannelInteraction','keys','intersection','attributes','model','fields','includeAll','include','merge','create','body','find','describe','addMessage','ids','findOne','OpenchannelMessage','filters','length','hasOwnProperty','nolimit','where','OpenchannelInteractionId','filter','$gte','split','format','options','rows','addTags','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','N.A.','createdAt','toString','closed','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','value','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','offset','undefined','count','limit','set','Content-Range','update','destroy','then','status','error','stack','name','index','map','rawAttributes'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xbbb4,0xe0));var _0x4bbb=function(_0x58ff33,_0x362a7d){_0x58ff33=_0x58ff33-0x0;var _0x5943eb=_0xbbb4[_0x58ff33];return _0x5943eb;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4bbb('0x0'));var moment=require('moment');var util=require(_0x4bbb('0x1'));var path=require(_0x4bbb('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x4bbb('0x3'));var interaction=require(_0x4bbb('0x4'));var qs=require(_0x4bbb('0x5'));var pdf=require('../../components/export/pdf');var logger=require(_0x4bbb('0x6'))(_0x4bbb('0x7'));var config=require(_0x4bbb('0x8'));var db=require('../../mysqldb')['db'];config[_0x4bbb('0x9')]=_[_0x4bbb('0xa')](config['redis'],{'host':_0x4bbb('0xb'),'port':0x18eb});var socket=require(_0x4bbb('0xc'))(new Redis(config[_0x4bbb('0x9')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x57b624,_0xcf9339){_0xcf9339=_0xcf9339||0xcc;return function(_0x4189d0){if(_0x4189d0){return _0x57b624[_0x4bbb('0xd')](_0xcf9339);}return _0x57b624['status'](_0xcf9339)['end']();};}function respondWithResult(_0x359fcc,_0x36659f){_0x36659f=_0x36659f||0xc8;return function(_0x3ad10f){if(_0x3ad10f){return _0x359fcc['status'](_0x36659f)['json'](_0x3ad10f);}};}function respondWithFilteredResult(_0x5b2a0a,_0x26b8c1){return function(_0x190531){if(_0x190531){var _0x5d159e=typeof _0x26b8c1[_0x4bbb('0xe')]===_0x4bbb('0xf')&&typeof _0x26b8c1['limit']==='undefined';var _0x11c802=_0x190531[_0x4bbb('0x10')];var _0x554201=_0x5d159e?0x0:_0x26b8c1[_0x4bbb('0xe')];var _0x7f8bdb=_0x5d159e?_0x190531[_0x4bbb('0x10')]:_0x26b8c1['offset']+_0x26b8c1[_0x4bbb('0x11')];var _0x3c77e6;if(_0x7f8bdb>=_0x11c802){_0x7f8bdb=_0x11c802;_0x3c77e6=0xc8;}else{_0x3c77e6=0xce;}_0x5b2a0a['status'](_0x3c77e6);return _0x5b2a0a[_0x4bbb('0x12')](_0x4bbb('0x13'),_0x554201+'-'+_0x7f8bdb+'/'+_0x11c802)['json'](_0x190531);}return null;};}function saveUpdates(_0x4a6256){return function(_0x30bf31){if(_0x30bf31){return _0x30bf31[_0x4bbb('0x14')](_0x4a6256)['then'](function(_0x394ebe){return _0x394ebe;});}return null;};}function removeEntity(_0x338f48){return function(_0x37b0bc){if(_0x37b0bc){return _0x37b0bc[_0x4bbb('0x15')]()[_0x4bbb('0x16')](function(){_0x338f48[_0x4bbb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c80df){return function(_0x2a6e70){if(!_0x2a6e70){_0x1c80df['sendStatus'](0x194);}return _0x2a6e70;};}function handleError(_0x6cbd50,_0x4963fe){_0x4963fe=_0x4963fe||0x1f4;return function(_0x1c89c0){logger[_0x4bbb('0x18')](_0x1c89c0[_0x4bbb('0x19')]);if(_0x1c89c0[_0x4bbb('0x1a')]){delete _0x1c89c0[_0x4bbb('0x1a')];}_0x6cbd50['status'](_0x4963fe)['send'](_0x1c89c0);};}exports[_0x4bbb('0x1b')]=function(_0x320921,_0x1f3628){var _0x3c0205={};var _0x5271e3=_[_0x4bbb('0x1c')](db['OpenchannelInteraction'][_0x4bbb('0x1d')],function(_0x2b3afe){return{'name':_0x2b3afe[_0x4bbb('0x1e')],'type':_0x2b3afe[_0x4bbb('0x1f')][_0x4bbb('0x20')]};});_0x3c0205=qs[_0x4bbb('0x21')](_0x5271e3,_0x320921);return interaction[_0x4bbb('0x22')](_0x4bbb('0x23'),_0x320921[_0x4bbb('0x24')],_0x320921['user'],_0x3c0205,_0x5271e3)['then'](respondWithFilteredResult(_0x1f3628,_0x3c0205))[_0x4bbb('0x25')](handleError(_0x1f3628,null));};exports[_0x4bbb('0x26')]=function(_0x1c214d,_0xe81c1a){var _0x1aaf60={};if(_0x1c214d[_0x4bbb('0x24')]['type']&&_0x1c214d[_0x4bbb('0x24')]['type']===_0x4bbb('0x27')){_0x1aaf60[_0x4bbb('0x27')]=_0x1c214d['params']['id'];}else{_0x1aaf60['id']=_0x1c214d[_0x4bbb('0x28')]['id'];}var _0x213515={'raw':![],'where':_0x1aaf60},_0x13ad19={};_0x13ad19['model']=_['keys'](db[_0x4bbb('0x29')][_0x4bbb('0x1d')]);_0x13ad19[_0x4bbb('0x24')]=_[_0x4bbb('0x2a')](_0x1c214d['query']);_0x13ad19['filters']=_[_0x4bbb('0x2b')](_0x13ad19['model'],_0x13ad19['query']);_0x213515[_0x4bbb('0x2c')]=_[_0x4bbb('0x2b')](_0x13ad19[_0x4bbb('0x2d')],qs[_0x4bbb('0x2e')](_0x1c214d[_0x4bbb('0x24')]['fields']));_0x213515[_0x4bbb('0x2c')]=_0x213515[_0x4bbb('0x2c')]['length']?_0x213515[_0x4bbb('0x2c')]:_0x13ad19[_0x4bbb('0x2d')];if(_0x1c214d[_0x4bbb('0x24')][_0x4bbb('0x2f')]){_0x213515[_0x4bbb('0x30')]=[{'all':!![]}];}_0x213515=_[_0x4bbb('0x31')]({},_0x213515,_0x1c214d['options']);return db[_0x4bbb('0x29')]['find'](_0x213515)[_0x4bbb('0x16')](handleEntityNotFound(_0xe81c1a,null))[_0x4bbb('0x16')](respondWithResult(_0xe81c1a,null))['catch'](handleError(_0xe81c1a,null));};exports[_0x4bbb('0x32')]=function(_0x3677a2,_0x12d0fa){return db['OpenchannelInteraction'][_0x4bbb('0x32')](_0x3677a2[_0x4bbb('0x33')],{})[_0x4bbb('0x16')](respondWithResult(_0x12d0fa,0xc9))['catch'](handleError(_0x12d0fa,null));};exports[_0x4bbb('0x14')]=function(_0x3c048e,_0x1b4b65){if(_0x3c048e[_0x4bbb('0x33')]['id']){delete _0x3c048e[_0x4bbb('0x33')]['id'];}return db[_0x4bbb('0x29')][_0x4bbb('0x34')]({'where':{'id':_0x3c048e['params']['id']}})['then'](handleEntityNotFound(_0x1b4b65,null))[_0x4bbb('0x16')](saveUpdates(_0x3c048e[_0x4bbb('0x33')],null))[_0x4bbb('0x16')](respondWithResult(_0x1b4b65,null))['catch'](handleError(_0x1b4b65,null));};exports['destroy']=function(_0x4b9e08,_0x19b9b3){return db[_0x4bbb('0x29')][_0x4bbb('0x34')]({'where':{'id':_0x4b9e08['params']['id']}})['then'](handleEntityNotFound(_0x19b9b3,null))['then'](removeEntity(_0x19b9b3,null))[_0x4bbb('0x25')](handleError(_0x19b9b3,null));};exports[_0x4bbb('0x35')]=function(_0x453f2a,_0xc0ce87){return db[_0x4bbb('0x29')][_0x4bbb('0x35')]()['then'](respondWithResult(_0xc0ce87,null))[_0x4bbb('0x25')](handleError(_0xc0ce87,null));};exports[_0x4bbb('0x36')]=function(_0x56743b,_0xf9fbfc){return db['OpenchannelMessage'][_0x4bbb('0x34')]({'where':{'id':_0x56743b['params']['id']}})['then'](handleEntityNotFound(_0xf9fbfc,null))['then'](function(_0xcc47e1){if(_0xcc47e1){return _0xcc47e1[_0x4bbb('0x36')](_0x56743b[_0x4bbb('0x33')][_0x4bbb('0x37')],_['omit'](_0x56743b['body'],['ids','id'])||{});}})[_0x4bbb('0x16')](respondWithResult(_0xf9fbfc,null))['catch'](handleError(_0xf9fbfc,null));};exports['getMessages']=function(_0x4f7f99,_0x24c3e1){var _0x1bcdd7={'raw':![],'where':{}};var _0xff6515={};var _0x2c5103={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x4bbb('0x38')]({'where':{'id':_0x4f7f99[_0x4bbb('0x28')]['id']}})[_0x4bbb('0x16')](handleEntityNotFound(_0x24c3e1,null))[_0x4bbb('0x16')](function(_0x3dce22){if(_0x3dce22){_0xff6515['model']=_[_0x4bbb('0x2a')](db[_0x4bbb('0x39')][_0x4bbb('0x1d')]);_0xff6515['query']=_['keys'](_0x4f7f99[_0x4bbb('0x24')]);_0xff6515[_0x4bbb('0x3a')]=_[_0x4bbb('0x2b')](_0xff6515[_0x4bbb('0x2d')],_0xff6515[_0x4bbb('0x24')]);_0x1bcdd7[_0x4bbb('0x2c')]=_[_0x4bbb('0x2b')](_0xff6515[_0x4bbb('0x2d')],qs[_0x4bbb('0x2e')](_0x4f7f99[_0x4bbb('0x24')][_0x4bbb('0x2e')]));_0x1bcdd7[_0x4bbb('0x2c')]=_0x1bcdd7['attributes'][_0x4bbb('0x3b')]?_0x1bcdd7['attributes']:_0xff6515['model'];if(!_0x4f7f99['query'][_0x4bbb('0x3c')](_0x4bbb('0x3d'))){_0x1bcdd7['limit']=qs[_0x4bbb('0x11')](_0x4f7f99[_0x4bbb('0x24')][_0x4bbb('0x11')]);_0x1bcdd7[_0x4bbb('0xe')]=qs[_0x4bbb('0xe')](_0x4f7f99[_0x4bbb('0x24')]['offset']);}_0x1bcdd7['order']=qs['sort'](_0x4f7f99[_0x4bbb('0x24')]['sort']);_0x1bcdd7['where']=qs[_0x4bbb('0x3a')](_['pick'](_0x4f7f99[_0x4bbb('0x24')],_0xff6515[_0x4bbb('0x3a')]));_0x1bcdd7[_0x4bbb('0x3e')][_0x4bbb('0x3f')]=_0x3dce22['id'];if(_0x4f7f99['query'][_0x4bbb('0x40')]){_0x1bcdd7['where']=_['merge'](_0x1bcdd7['where'],{'$or':_[_0x4bbb('0x1c')](_0x1bcdd7['attributes'],function(_0x188707){var _0x4240f5={};_0x4240f5[_0x188707]={'$like':'%'+_0x4f7f99[_0x4bbb('0x24')][_0x4bbb('0x40')]+'%'};return _0x4240f5;})});}if(_0x4f7f99[_0x4bbb('0x24')][_0x4bbb('0x41')]){var _0x53318f=_0x4f7f99['query'][_0x4bbb('0x41')][_0x4bbb('0x42')](',');var _0x45350d={};_0x45350d[_0x53318f[0x0]]={'$gte':moment(_0x53318f[0x1])[_0x4bbb('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1bcdd7[_0x4bbb('0x3e')]=_[_0x4bbb('0x31')](_0x1bcdd7[_0x4bbb('0x3e')],_0x45350d);}_0x1bcdd7=_[_0x4bbb('0x31')]({},_0x1bcdd7,_0x4f7f99[_0x4bbb('0x44')]);return db[_0x4bbb('0x39')][_0x4bbb('0x10')]({'where':_0x1bcdd7[_0x4bbb('0x3e')]})[_0x4bbb('0x16')](function(_0x5580b5){_0x2c5103[_0x4bbb('0x10')]=_0x5580b5;if(_0x4f7f99[_0x4bbb('0x24')][_0x4bbb('0x2f')]){_0x1bcdd7['include']=[{'all':!![]}];}return db[_0x4bbb('0x39')][_0x4bbb('0x22')](_0x1bcdd7);})[_0x4bbb('0x16')](function(_0x587500){_0x2c5103[_0x4bbb('0x45')]=_0x587500;return _0x2c5103;});}})[_0x4bbb('0x16')](respondWithFilteredResult(_0x24c3e1,_0x1bcdd7))[_0x4bbb('0x25')](handleError(_0x24c3e1,null));};exports[_0x4bbb('0x46')]=function(_0x5a0a6d,_0x2c6692){return db[_0x4bbb('0x29')]['find']({'where':{'id':_0x5a0a6d[_0x4bbb('0x28')]['id']}})[_0x4bbb('0x16')](handleEntityNotFound(_0x2c6692,null))[_0x4bbb('0x16')](function(_0x17b947){if(_0x17b947){return _0x17b947[_0x4bbb('0x47')](_0x5a0a6d[_0x4bbb('0x33')][_0x4bbb('0x37')],_[_0x4bbb('0x48')](_0x5a0a6d[_0x4bbb('0x33')],[_0x4bbb('0x37'),'id'])||{})[_0x4bbb('0x49')](function(){return db[_0x4bbb('0x4a')]['findAll']({'attributes':['id',_0x4bbb('0x1a'),_0x4bbb('0x4b')],'where':{'id':_0x5a0a6d[_0x4bbb('0x33')]['ids']}});})[_0x4bbb('0x16')](function(_0x51caea){socket[_0x4bbb('0x4c')](_0x4bbb('0x4d'),{'id':Number(_0x5a0a6d['params']['id']),'tags':_0x51caea||[]});return{'id':Number(_0x5a0a6d[_0x4bbb('0x28')]['id']),'tags':_0x51caea||[]};});}})[_0x4bbb('0x16')](respondWithResult(_0x2c6692,null))['catch'](handleError(_0x2c6692,null));};exports['removeTags']=function(_0x1329c5,_0x57535d){return db[_0x4bbb('0x29')]['find']({'where':{'id':_0x1329c5[_0x4bbb('0x28')]['id']}})['then'](handleEntityNotFound(_0x57535d,null))['then'](function(_0x2f7834){if(_0x2f7834){return _0x2f7834[_0x4bbb('0x4e')](_0x1329c5[_0x4bbb('0x24')][_0x4bbb('0x37')]);}})[_0x4bbb('0x16')](respondWithStatusCode(_0x57535d,null))[_0x4bbb('0x25')](handleError(_0x57535d,null));};exports[_0x4bbb('0x4f')]=function(_0x4e95af,_0xe7d704){var _0x426719=moment()[_0x4bbb('0x50')]()['toString']();var _0x252d08=path[_0x4bbb('0x51')](config[_0x4bbb('0x52')],_0x4bbb('0x53'),'files',_0x4bbb('0x54'));var _0x213209=path[_0x4bbb('0x51')](config[_0x4bbb('0x52')],_0x4bbb('0x53'),_0x4bbb('0x55'),_0x4bbb('0x56'));var _0xa3d508=path[_0x4bbb('0x51')](_0x252d08,_0x426719);var _0x1fa92e=util[_0x4bbb('0x43')](_0x4bbb('0x57'),_0x4e95af[_0x4bbb('0x28')]['id'],_0x426719);var _0x32535b=path[_0x4bbb('0x51')](_0x252d08,_0x1fa92e);var _0x4d4f5f=[];_0x4d4f5f[_0x4bbb('0x58')]({'model':db[_0x4bbb('0x59')],'as':_0x4bbb('0x59'),'attributes':['id',_0x4bbb('0x5a')],'raw':!![]});_0x4d4f5f[_0x4bbb('0x58')]({'model':db[_0x4bbb('0x5b')],'as':'Contact','attributes':['id',_0x4bbb('0x5c'),_0x4bbb('0x5d')],'raw':!![]});if(_0x4e95af[_0x4bbb('0x24')][_0x4bbb('0x56')]){_0x4d4f5f[_0x4bbb('0x58')]({'model':db[_0x4bbb('0x5e')],'as':_0x4bbb('0x5e'),'raw':!![]});}var _0x398535=[{'model':db['OpenchannelMessage'],'as':_0x4bbb('0x5f'),'attributes':['id',_0x4bbb('0x33'),'createdAt',_0x4bbb('0x60'),_0x4bbb('0x61'),'read'],'include':_0x4d4f5f}];_0x398535[_0x4bbb('0x58')]({'model':db[_0x4bbb('0x62')],'as':_0x4bbb('0x63'),'attributes':['id','name']});_0x398535[_0x4bbb('0x58')]({'model':db[_0x4bbb('0x59')],'as':_0x4bbb('0x64'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0x4bbb('0x34')]({'where':{'id':_0x4e95af['params']['id']},'include':_0x398535})['then'](handleEntityNotFound(_0xe7d704,null))[_0x4bbb('0x16')](function(_0x3993c9){if(_0x3993c9){var _0x13b430=_0x3993c9[_0x4bbb('0x65')]({'plain':!![]});fs['mkdirSync'](_0xa3d508);var _0x3f37b9={'channel':'Openchannel','account':_0x13b430['Account'][_0x4bbb('0x1a')],'agent':_0x13b430[_0x4bbb('0x64')]?_0x13b430[_0x4bbb('0x64')][_0x4bbb('0x5a')]:_0x4bbb('0x66'),'createdAt':moment(_0x13b430[_0x4bbb('0x67')])[_0x4bbb('0x43')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4bbb('0x68')](),'closedAt':_0x13b430[_0x4bbb('0x69')]?moment(_0x13b430['closedAt'])[_0x4bbb('0x43')](_0x4bbb('0x6a'))[_0x4bbb('0x68')]():'','disposition':_0x13b430[_0x4bbb('0x6b')],'visibility':_0x13b430[_0x4bbb('0x6c')]?'Public':_0x4bbb('0x6d'),'messages':_(_0x13b430[_0x4bbb('0x5f')])[_0x4bbb('0x40')]({'secret':![]})[_0x4bbb('0x1c')](function(_0x4608a2){if(_0x4608a2[_0x4bbb('0x5e')]){var _0x23491d=path['join'](_0x213209,_0x4608a2['Attachment'][_0x4bbb('0x6e')]);if(fs[_0x4bbb('0x6f')](_0x23491d)){fs[_0x4bbb('0x70')](_0x23491d)[_0x4bbb('0x71')](fs[_0x4bbb('0x72')](path[_0x4bbb('0x51')](_0xa3d508,_0x4608a2[_0x4bbb('0x5e')][_0x4bbb('0x6e')])));}}return{'date':moment(_0x4608a2['createdAt'])[_0x4bbb('0x43')](_0x4bbb('0x6a'))[_0x4bbb('0x68')](),'sender':_0x4608a2[_0x4bbb('0x60')]===_0x4bbb('0x73')?_0x4608a2[_0x4bbb('0x59')]?_0x4608a2[_0x4bbb('0x59')][_0x4bbb('0x5a')]:_0x4bbb('0x74'):_0x4608a2[_0x4bbb('0x75')]['firstName']+(_0x4608a2[_0x4bbb('0x75')][_0x4bbb('0x5d')]?'\x20'+_0x4608a2[_0x4bbb('0x75')][_0x4bbb('0x5d')]:''),'body':_0x4608a2[_0x4bbb('0x5e')]?_0x4608a2[_0x4bbb('0x5e')]['basename']:_0x4608a2['body'],'direction':_0x4608a2[_0x4bbb('0x60')]==='out'?'A':'C','secret':_0x4608a2[_0x4bbb('0x61')],'read':_0x4608a2['read'],'attachment':_0x4608a2[_0x4bbb('0x5e')]};})[_0x4bbb('0x76')]()};return ejs['renderFile'](path[_0x4bbb('0x51')](config[_0x4bbb('0x52')],_0x4bbb('0x53'),_0x4bbb('0x77'),_0x4bbb('0x78')),{'interaction':_0x3f37b9})[_0x4bbb('0x16')](function(_0x410953){var _0x1a1af5=path[_0x4bbb('0x51')](_0xa3d508,_0x4bbb('0x79')+_0x13b430['id']+'-'+_0x426719+_0x4bbb('0x7a'));var _0x5eb9bc={'path':_0x1a1af5,'channel':_0x4bbb('0x7b'),'interactionId':_0x13b430['id']};return pdf[_0x4bbb('0x7c')](_0x410953,_0x5eb9bc);})[_0x4bbb('0x16')](function(){return new Promise(function(_0x49600c,_0x289f90){zipdir(_0xa3d508,{'saveTo':_0x32535b},function(_0x3b0a0c,_0x24142a){if(_0x3b0a0c)return _0x289f90(_0x3b0a0c);return _0x49600c(_0x24142a);});})[_0x4bbb('0x16')](function(){return new Promise(function(_0x57e9ff,_0x140a84){rimraf(_0xa3d508,function(_0x3c96cb){if(_0x3c96cb)_0x140a84(_0x3c96cb);return _0x57e9ff();});});})[_0x4bbb('0x16')](function(){return _0xe7d704['download'](_0x32535b,_0x1fa92e,function(_0x4b2c9c){if(_0x4b2c9c){logger[_0x4bbb('0x18')](_0x4bbb('0x7d'),_0x4b2c9c);}else{fs[_0x4bbb('0x7e')](_0x32535b);}});});});}else{return _0xe7d704[_0x4bbb('0xd')](0xc8);}})[_0x4bbb('0x25')](handleError(_0xe7d704,null));};
\ No newline at end of file
index 1ab8310..7b92dc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd997=['events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch'];(function(_0x2d1da8,_0x967420){var _0x131c8d=function(_0x3bef6c){while(--_0x3bef6c){_0x2d1da8['push'](_0x2d1da8['shift']());}};_0x131c8d(++_0x967420);}(_0xd997,0x1a0));var _0x7d99=function(_0xf9fd37,_0x518e62){_0xf9fd37=_0xf9fd37-0x0;var _0x1ae5f2=_0xd997[_0xf9fd37];return _0x1ae5f2;};'use strict';var EventEmitter=require(_0x7d99('0x0'));var OpenchannelInteraction=require(_0x7d99('0x1'))['db'][_0x7d99('0x2')];var OpenchannelMessage=require(_0x7d99('0x1'))['db'][_0x7d99('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7d99('0x4')](0x0);var events={'afterCreate':_0x7d99('0x5'),'afterUpdate':_0x7d99('0x6'),'afterDestroy':_0x7d99('0x7')};function emitEvent(_0x6a8f){return function(_0x11ad4f,_0x49c579,_0x346d85){_0x11ad4f['getUsers']({'attributes':['id'],'raw':!![]})[_0x7d99('0x8')](function(_0xdbe34){_0x11ad4f[_0x7d99('0x9')](_0x7d99('0xa'),_0xdbe34[_0x7d99('0xb')](function(_0x2332d9){return{'id':_0x2332d9['id']};}));return OpenchannelMessage[_0x7d99('0xc')]({'where':{'OpenchannelInteractionId':_0x11ad4f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7d99('0x8')](function(_0x3e6bed){_0x11ad4f['setDataValue'](_0x7d99('0xd'),_0x3e6bed['length']);OpenchannelInteractionEvents[_0x7d99('0xe')](_0x6a8f+':'+_0x11ad4f['id'],_0x11ad4f);OpenchannelInteractionEvents['emit'](_0x6a8f,_0x11ad4f);_0x346d85(null);})[_0x7d99('0xf')](_0x346d85(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x4a12=['update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x33d5c1,_0xfcf540){var _0x284a0f=function(_0x413a00){while(--_0x413a00){_0x33d5c1['push'](_0x33d5c1['shift']());}};_0x284a0f(++_0xfcf540);}(_0x4a12,0x83));var _0x24a1=function(_0x40dc7e,_0x322488){_0x40dc7e=_0x40dc7e-0x0;var _0x31f6d4=_0x4a12[_0x40dc7e];return _0x31f6d4;};'use strict';var EventEmitter=require(_0x24a1('0x0'));var OpenchannelInteraction=require(_0x24a1('0x1'))['db'][_0x24a1('0x2')];var OpenchannelMessage=require(_0x24a1('0x1'))['db'][_0x24a1('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x24a1('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x24a1('0x5'),'afterDestroy':_0x24a1('0x6')};function emitEvent(_0x1df8e0){return function(_0x53cf8d,_0x51fa70,_0x357fdd){_0x53cf8d[_0x24a1('0x7')]({'attributes':['id'],'raw':!![]})[_0x24a1('0x8')](function(_0x55670a){_0x53cf8d['setDataValue'](_0x24a1('0x9'),_0x55670a[_0x24a1('0xa')](function(_0x125798){return{'id':_0x125798['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x53cf8d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x331eb5){_0x53cf8d[_0x24a1('0xb')](_0x24a1('0xc'),_0x331eb5[_0x24a1('0xd')]);OpenchannelInteractionEvents['emit'](_0x1df8e0+':'+_0x53cf8d['id'],_0x53cf8d);OpenchannelInteractionEvents[_0x24a1('0xe')](_0x1df8e0,_0x53cf8d);_0x357fdd(null);})['catch'](_0x357fdd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x24a1('0xf')](e,emitEvent(event));}}module[_0x24a1('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 29db398..e01a14e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6929=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0xc85513,_0x49e852){var _0x3e70be=function(_0x53bbd6){while(--_0x53bbd6){_0xc85513['push'](_0xc85513['shift']());}};_0x3e70be(++_0x49e852);}(_0x6929,0xc0));var _0x9692=function(_0x1ea153,_0x1e5d49){_0x1ea153=_0x1ea153-0x0;var _0x1fc872=_0x6929[_0x1ea153];return _0x1fc872;};'use strict';var _=require(_0x9692('0x0'));var util=require(_0x9692('0x1'));var logger=require(_0x9692('0x2'))('api');var moment=require(_0x9692('0x3'));var BPromise=require(_0x9692('0x4'));var rp=require(_0x9692('0x5'));var fs=require('fs');var path=require(_0x9692('0x6'));var rimraf=require(_0x9692('0x7'));var config=require(_0x9692('0x8'));var attributes=require(_0x9692('0x9'));module[_0x9692('0xa')]=function(_0x36cbb9,_0x2ba531){return _0x36cbb9[_0x9692('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x9692('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9692('0xd'),'collate':_0x9692('0xe'),'hooks':{'beforeUpdate':function(_0x5cc286,_0x2d4059,_0x2e12d1){if(_0x5cc286[_0x9692('0xf')]('closed')){_0x5cc286[_0x9692('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2e12d1(null,_0x5cc286);}}});};
\ No newline at end of file
+var _0x6c4c=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6c4c,0xd9));var _0xc6c4=function(_0x439a62,_0x140fbd){_0x439a62=_0x439a62-0x0;var _0x1bcbf8=_0x6c4c[_0x439a62];return _0x1bcbf8;};'use strict';var _=require(_0xc6c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc6c4('0x1'));var moment=require(_0xc6c4('0x2'));var BPromise=require('bluebird');var rp=require(_0xc6c4('0x3'));var fs=require('fs');var path=require(_0xc6c4('0x4'));var rimraf=require(_0xc6c4('0x5'));var config=require(_0xc6c4('0x6'));var attributes=require(_0xc6c4('0x7'));module['exports']=function(_0x1a6670,_0x5bed0d){return _0x1a6670[_0xc6c4('0x8')](_0xc6c4('0x9'),attributes,{'tableName':_0xc6c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6c4('0xb'),'collate':_0xc6c4('0xc'),'hooks':{'beforeUpdate':function(_0xa29818,_0x103ac6,_0x1f0bd5){if(_0xa29818[_0xc6c4('0xd')]('closed')){_0xa29818[_0xc6c4('0xe')]=moment()[_0xc6c4('0xf')](_0xc6c4('0x10'));}_0x1f0bd5(null,_0xa29818);}}});};
\ No newline at end of file
index db0e532..950c6e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f3a=['message','result','catch','OpenchannelInteraction','update','body','options','raw','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','where','addTags','ids','omit','spread','AddTags','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x191d62,_0x16520a){var _0x59c62d=function(_0x1a275c){while(--_0x1a275c){_0x191d62['push'](_0x191d62['shift']());}};_0x59c62d(++_0x16520a);}(_0x1f3a,0x10e));var _0xa1f3=function(_0x1882da,_0x29e8a3){_0x1882da=_0x1882da-0x0;var _0x5cfd55=_0x1f3a[_0x1882da];return _0x5cfd55;};'use strict';var _=require('lodash');var util=require(_0xa1f3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1f3('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1f3('0x2'));var logger=require(_0xa1f3('0x3'))(_0xa1f3('0x4'));var config=require(_0xa1f3('0x5'));var jayson=require(_0xa1f3('0x6'));var client=jayson[_0xa1f3('0x7')][_0xa1f3('0x8')]({'port':0x232a});config[_0xa1f3('0x9')]=_[_0xa1f3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa1f3('0xb'))(new Redis(config['redis']));require(_0xa1f3('0xc'))[_0xa1f3('0xd')](socket);function respondWithRpcPromise(_0x13b2ba,_0x4ea76e,_0x2f9428){return new BPromise(function(_0x7e34ac,_0x172672){return client[_0xa1f3('0xe')](_0x13b2ba,_0x2f9428)[_0xa1f3('0xf')](function(_0x2e1d9f){logger[_0xa1f3('0x10')](_0xa1f3('0x11'),_0x4ea76e,_0xa1f3('0x12'));logger[_0xa1f3('0x13')](_0xa1f3('0x14'),_0x4ea76e,_0xa1f3('0x12'),JSON[_0xa1f3('0x15')](_0x2e1d9f));if(_0x2e1d9f['error']){if(_0x2e1d9f[_0xa1f3('0x16')][_0xa1f3('0x17')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4ea76e,_0x2e1d9f[_0xa1f3('0x16')][_0xa1f3('0x18')]);return _0x172672(_0x2e1d9f[_0xa1f3('0x16')]['message']);}logger['error'](_0xa1f3('0x11'),_0x4ea76e,_0x2e1d9f['error'][_0xa1f3('0x18')]);return _0x7e34ac(_0x2e1d9f[_0xa1f3('0x16')][_0xa1f3('0x18')]);}else{logger[_0xa1f3('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4ea76e,_0xa1f3('0x12'));_0x7e34ac(_0x2e1d9f[_0xa1f3('0x19')][_0xa1f3('0x18')]);}})[_0xa1f3('0x1a')](function(_0xb103c5){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4ea76e,_0xb103c5);_0x172672(_0xb103c5);});});}exports['UpdateOpenchannelInteraction']=function(_0x4aa3a5){var _0x1755e8=this;return new Promise(function(_0x368a65,_0x5736fe){return db[_0xa1f3('0x1b')][_0xa1f3('0x1c')](_0x4aa3a5[_0xa1f3('0x1d')],{'raw':_0x4aa3a5[_0xa1f3('0x1e')]?_0x4aa3a5[_0xa1f3('0x1e')][_0xa1f3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aa3a5[_0xa1f3('0x1e')]?_0x4aa3a5[_0xa1f3('0x1e')]['where']||null:null,'attributes':_0x4aa3a5[_0xa1f3('0x1e')]?_0x4aa3a5[_0xa1f3('0x1e')][_0xa1f3('0x20')]||null:null,'limit':_0x4aa3a5[_0xa1f3('0x1e')]?_0x4aa3a5[_0xa1f3('0x1e')][_0xa1f3('0x21')]||null:null})['then'](function(_0xe25cb4){logger[_0xa1f3('0x10')](_0xa1f3('0x22'),_0x4aa3a5);logger[_0xa1f3('0x13')](_0xa1f3('0x22'),_0x4aa3a5,JSON['stringify'](_0xe25cb4));_0x368a65(_0xe25cb4);})[_0xa1f3('0x1a')](function(_0x1631ab){logger[_0xa1f3('0x16')]('UpdateOpenchannelInteraction',_0x1631ab[_0xa1f3('0x18')],_0x4aa3a5);_0x5736fe(_0x1755e8['error'](0x1f4,_0x1631ab['message']));});});};exports[_0xa1f3('0x23')]=function(_0x13fd8f){return new Promise(function(_0x31ef6f,_0x28ae70){return db['OpenchannelInteraction']['find']({'where':_0x13fd8f[_0xa1f3('0x1e')]?_0x13fd8f[_0xa1f3('0x1e')][_0xa1f3('0x24')]||null:null})[_0xa1f3('0xf')](function(_0x2b5737){if(_0x2b5737){return _0x2b5737[_0xa1f3('0x25')](_0x13fd8f['body'][_0xa1f3('0x26')],_[_0xa1f3('0x27')](_0x13fd8f[_0xa1f3('0x1d')],[_0xa1f3('0x26'),'id'])||{});}})[_0xa1f3('0x28')](function(_0x3a3fb7){logger['info'](_0xa1f3('0x29'),_0x13fd8f);logger[_0xa1f3('0x13')]('AddTags',_0x13fd8f,JSON[_0xa1f3('0x15')](_0x3a3fb7));_0x31ef6f(_0x3a3fb7);})[_0xa1f3('0x1a')](function(_0x1227d5){logger[_0xa1f3('0x16')]('AddTags',_0x1227d5[_0xa1f3('0x18')],_0x13fd8f);_0x28ae70(_this[_0xa1f3('0x16')](0x1f4,_0x1227d5[_0xa1f3('0x18')]));});});};
\ No newline at end of file
+var _0x0900=['OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','attributes','limit','find','where','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x3f6f78,_0x222d85){var _0x534963=function(_0x42a95b){while(--_0x42a95b){_0x3f6f78['push'](_0x3f6f78['shift']());}};_0x534963(++_0x222d85);}(_0x0900,0x1b1));var _0x0090=function(_0xd006b2,_0x300238){_0xd006b2=_0xd006b2-0x0;var _0xded2ef=_0x0900[_0xd006b2];return _0xded2ef;};'use strict';var _=require(_0x0090('0x0'));var util=require(_0x0090('0x1'));var moment=require(_0x0090('0x2'));var BPromise=require('bluebird');var rs=require(_0x0090('0x3'));var fs=require('fs');var Redis=require(_0x0090('0x4'));var db=require(_0x0090('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0090('0x6'))(_0x0090('0x7'));var config=require(_0x0090('0x8'));var jayson=require(_0x0090('0x9'));var client=jayson[_0x0090('0xa')]['http']({'port':0x232a});config[_0x0090('0xb')]=_['defaults'](config[_0x0090('0xb')],{'host':_0x0090('0xc'),'port':0x18eb});var socket=require(_0x0090('0xd'))(new Redis(config[_0x0090('0xb')]));require('./openchannelInteraction.socket')[_0x0090('0xe')](socket);function respondWithRpcPromise(_0x452f61,_0x3f1ecd,_0x386dad){return new BPromise(function(_0x26ecd4,_0x32119f){return client[_0x0090('0xf')](_0x452f61,_0x386dad)[_0x0090('0x10')](function(_0x3e3e74){logger[_0x0090('0x11')](_0x0090('0x12'),_0x3f1ecd,'request\x20sent');logger[_0x0090('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3f1ecd,_0x0090('0x14'),JSON[_0x0090('0x15')](_0x3e3e74));if(_0x3e3e74[_0x0090('0x16')]){if(_0x3e3e74[_0x0090('0x16')][_0x0090('0x17')]===0x1f4){logger[_0x0090('0x16')](_0x0090('0x12'),_0x3f1ecd,_0x3e3e74[_0x0090('0x16')][_0x0090('0x18')]);return _0x32119f(_0x3e3e74['error'][_0x0090('0x18')]);}logger[_0x0090('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3f1ecd,_0x3e3e74['error'][_0x0090('0x18')]);return _0x26ecd4(_0x3e3e74[_0x0090('0x16')][_0x0090('0x18')]);}else{logger[_0x0090('0x11')](_0x0090('0x12'),_0x3f1ecd,_0x0090('0x14'));_0x26ecd4(_0x3e3e74[_0x0090('0x19')][_0x0090('0x18')]);}})['catch'](function(_0x1283ec){logger[_0x0090('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3f1ecd,_0x1283ec);_0x32119f(_0x1283ec);});});}exports[_0x0090('0x1a')]=function(_0x2dff08){var _0x5ca6b8=this;return new Promise(function(_0x29be0a,_0x39875c){return db[_0x0090('0x1b')][_0x0090('0x1c')](_0x2dff08[_0x0090('0x1d')],{'raw':_0x2dff08['options']?_0x2dff08[_0x0090('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dff08['options']?_0x2dff08[_0x0090('0x1e')]['where']||null:null,'attributes':_0x2dff08[_0x0090('0x1e')]?_0x2dff08[_0x0090('0x1e')][_0x0090('0x1f')]||null:null,'limit':_0x2dff08[_0x0090('0x1e')]?_0x2dff08[_0x0090('0x1e')][_0x0090('0x20')]||null:null})[_0x0090('0x10')](function(_0x4adecf){logger['info'](_0x0090('0x1a'),_0x2dff08);logger[_0x0090('0x13')](_0x0090('0x1a'),_0x2dff08,JSON[_0x0090('0x15')](_0x4adecf));_0x29be0a(_0x4adecf);})['catch'](function(_0x1f7a88){logger[_0x0090('0x16')](_0x0090('0x1a'),_0x1f7a88[_0x0090('0x18')],_0x2dff08);_0x39875c(_0x5ca6b8[_0x0090('0x16')](0x1f4,_0x1f7a88['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x3340a3){return new Promise(function(_0x2eda73,_0x18d073){return db['OpenchannelInteraction'][_0x0090('0x21')]({'where':_0x3340a3[_0x0090('0x1e')]?_0x3340a3['options'][_0x0090('0x22')]||null:null})['then'](function(_0x4799e7){if(_0x4799e7){return _0x4799e7[_0x0090('0x23')](_0x3340a3[_0x0090('0x1d')][_0x0090('0x24')],_[_0x0090('0x25')](_0x3340a3['body'],['ids','id'])||{});}})[_0x0090('0x26')](function(_0x1758d3){logger['info'](_0x0090('0x27'),_0x3340a3);logger[_0x0090('0x13')](_0x0090('0x27'),_0x3340a3,JSON[_0x0090('0x15')](_0x1758d3));_0x2eda73(_0x1758d3);})[_0x0090('0x28')](function(_0x2af451){logger[_0x0090('0x16')](_0x0090('0x27'),_0x2af451[_0x0090('0x18')],_0x3340a3);_0x18d073(_this[_0x0090('0x16')](0x1f4,_0x2af451[_0x0090('0x18')]));});});};
\ No newline at end of file
index e769f6a..2fed810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8ce=['remove','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xd8ce,0x181));var _0xed8c=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xd8ce[_0x3bab09];return _0x164376;};'use strict';var OpenchannelInteractionEvents=require(_0xed8c('0x0'));var events=[_0xed8c('0x1'),_0xed8c('0x2'),_0xed8c('0x3')];function createListener(_0x4b5339,_0x1c410a){return function(_0x4bd951){_0x1c410a[_0xed8c('0x4')](_0x4b5339,_0x4bd951);};}function removeListener(_0x148169,_0x4f0f3a){return function(){OpenchannelInteractionEvents[_0xed8c('0x5')](_0x148169,_0x4f0f3a);};}exports[_0xed8c('0x6')]=function(_0x1efbe9){for(var _0x8d26c5=0x0,_0xff8c48=events[_0xed8c('0x7')];_0x8d26c5<_0xff8c48;_0x8d26c5++){var _0x50adc8=events[_0x8d26c5];var _0x52872b=createListener(_0xed8c('0x8')+_0x50adc8,_0x1efbe9);OpenchannelInteractionEvents['on'](_0x50adc8,_0x52872b);}};
\ No newline at end of file
+var _0x2d07=['emit','removeListener','register','length','./openchannelInteraction.events','save','remove','update'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x2d07,0x1a4));var _0x72d0=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0x2d07[_0x45f6cb];return _0x5b7f93;};'use strict';var OpenchannelInteractionEvents=require(_0x72d0('0x0'));var events=[_0x72d0('0x1'),_0x72d0('0x2'),_0x72d0('0x3')];function createListener(_0x1e076b,_0x465bd2){return function(_0x2dab6c){_0x465bd2[_0x72d0('0x4')](_0x1e076b,_0x2dab6c);};}function removeListener(_0x568312,_0x39240e){return function(){OpenchannelInteractionEvents[_0x72d0('0x5')](_0x568312,_0x39240e);};}exports[_0x72d0('0x6')]=function(_0x1a69d1){for(var _0x50b32a=0x0,_0x24f5b3=events[_0x72d0('0x7')];_0x50b32a<_0x24f5b3;_0x50b32a++){var _0x55ec9a=events[_0x50b32a];var _0x4f44b7=createListener('openchannelInteraction:'+_0x55ec9a,_0x1a69d1);OpenchannelInteractionEvents['on'](_0x55ec9a,_0x4f44b7);}};
\ No newline at end of file
index b9938aa..9c5799d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x5cc926,_0x5ee930){_0x5cc926=_0x5cc926-0x0;var _0x2315b9=_0x70e0[_0x5cc926];return _0x2315b9;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=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(_0x3267ff,_0x177378){var _0xa98fd8=function(_0x21f86e){while(--_0x21f86e){_0x3267ff['push'](_0x3267ff['shift']());}};_0xa98fd8(++_0x177378);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'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 ccbd777..d7e6e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b4=['STRING','TEXT','sequelize','medium','BOOLEAN','out','DATE'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0xf7b4,0x152));var _0x4f7b=function(_0x42ee8f,_0x35dca8){_0x42ee8f=_0x42ee8f-0x0;var _0x448cc3=_0xf7b4[_0x42ee8f];return _0x448cc3;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4f7b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4f7b('0x3')),'defaultValue':_0x4f7b('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4f7b('0x4')]},'providerName':{'type':Sequelize[_0x4f7b('0x5')]},'providerResponse':{'type':Sequelize[_0x4f7b('0x6')]}};
\ No newline at end of file
+var _0x9ccd=['TEXT','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x426a36,_0x4fab8b){var _0x2d3173=function(_0xef2a0d){while(--_0xef2a0d){_0x426a36['push'](_0x426a36['shift']());}};_0x2d3173(++_0x4fab8b);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xd9cc('0x1')](_0xd9cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cc('0x3')]('in','out'),'defaultValue':_0xd9cc('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9cc('0x5')]},'providerName':{'type':Sequelize[_0xd9cc('0x6')]},'providerResponse':{'type':Sequelize[_0xd9cc('0x1')]}};
\ No newline at end of file
index 3663d78..1a9970e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0560=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','reject','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','util','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','offset','count','set','Content-Range','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','options','find','create','body','update','describe','openchannel-interactions','accept','format','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','role','null','acceptMessage'];(function(_0x1658a2,_0xc580dd){var _0x3cb916=function(_0xed1ea){while(--_0xed1ea){_0x1658a2['push'](_0x1658a2['shift']());}};_0x3cb916(++_0xc580dd);}(_0x0560,0x95));var _0x0056=function(_0x1d9ba2,_0x318ee5){_0x1d9ba2=_0x1d9ba2-0x0;var _0x180c4c=_0x0560[_0x1d9ba2];return _0x180c4c;};'use strict';var emlformat=require(_0x0056('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0056('0x1'));var jsonpatch=require(_0x0056('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0056('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x0056('0x4'));var ejs=require(_0x0056('0x5'));var fs=require('fs');var fs_extra=require(_0x0056('0x6'));var _=require('lodash');var squel=require(_0x0056('0x7'));var crypto=require(_0x0056('0x8'));var jsforce=require(_0x0056('0x9'));var deskjs=require(_0x0056('0xa'));var toCsv=require('to-csv');var querystring=require(_0x0056('0xb'));var Papa=require(_0x0056('0xc'));var Redis=require(_0x0056('0xd'));var authService=require(_0x0056('0xe'));var qs=require(_0x0056('0xf'));var as=require(_0x0056('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0056('0x11'))(_0x0056('0x12'));var utils=require(_0x0056('0x13'));var config=require(_0x0056('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0056('0x15'))['db'];config[_0x0056('0x16')]=_[_0x0056('0x17')](config[_0x0056('0x16')],{'host':_0x0056('0x18'),'port':0x18eb});var socket=require(_0x0056('0x19'))(new Redis(config[_0x0056('0x16')]));require(_0x0056('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0056('0x1b')]({'port':0x232c});var client9002=jayson[_0x0056('0x1c')][_0x0056('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x15dc77,_0x3317b8,_0x1a6470,_0x133c91){return new BPromise(function(_0x16176d,_0x48058d){var _0x3bd528=_0x133c91||client;return _0x3bd528[_0x0056('0x1d')](_0x15dc77,_0x1a6470)[_0x0056('0x1e')](function(_0x194162){logger[_0x0056('0x1f')](_0x0056('0x20'),_0x3317b8,_0x0056('0x21'));logger[_0x0056('0x22')](_0x0056('0x23'),_0x3317b8,_0x0056('0x21'),JSON[_0x0056('0x24')](_0x194162));if(_0x194162[_0x0056('0x25')]){if(_0x194162[_0x0056('0x25')]['code']===0x1f4){logger[_0x0056('0x25')](_0x0056('0x20'),_0x3317b8,_0x194162['error'][_0x0056('0x26')]);return _0x48058d(_0x194162[_0x0056('0x25')][_0x0056('0x26')]);}logger[_0x0056('0x25')](_0x0056('0x20'),_0x3317b8,_0x194162[_0x0056('0x25')][_0x0056('0x26')]);return _0x16176d(_0x194162[_0x0056('0x25')][_0x0056('0x26')]);}else{logger[_0x0056('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x3317b8,_0x0056('0x21'));_0x16176d(_0x194162[_0x0056('0x27')][_0x0056('0x26')]);}})[_0x0056('0x28')](function(_0x3cf70b){logger[_0x0056('0x25')](_0x0056('0x20'),_0x3317b8,_0x3cf70b);_0x48058d(_0x3cf70b);});});}function respondWithStatusCode(_0x58b32b,_0x55f961){_0x55f961=_0x55f961||0xcc;return function(_0x108673){if(_0x108673){return _0x58b32b[_0x0056('0x29')](_0x55f961);}return _0x58b32b['status'](_0x55f961)[_0x0056('0x2a')]();};}function respondWithResult(_0x33193f,_0x54618e){_0x54618e=_0x54618e||0xc8;return function(_0x163c53){if(_0x163c53){return _0x33193f[_0x0056('0x2b')](_0x54618e)[_0x0056('0x2c')](_0x163c53);}};}function respondWithFilteredResult(_0x46e6e1,_0x102059){return function(_0x3911ce){if(_0x3911ce){var _0x4f190d=typeof _0x102059['offset']==='undefined'&&typeof _0x102059['limit']===_0x0056('0x2d');var _0x1aa64d=_0x3911ce['count'];var _0x5b346c=_0x4f190d?0x0:_0x102059[_0x0056('0x2e')];var _0xc7e48c=_0x4f190d?_0x3911ce[_0x0056('0x2f')]:_0x102059['offset']+_0x102059['limit'];var _0x302e9b;if(_0xc7e48c>=_0x1aa64d){_0xc7e48c=_0x1aa64d;_0x302e9b=0xc8;}else{_0x302e9b=0xce;}_0x46e6e1[_0x0056('0x2b')](_0x302e9b);return _0x46e6e1[_0x0056('0x30')](_0x0056('0x31'),_0x5b346c+'-'+_0xc7e48c+'/'+_0x1aa64d)[_0x0056('0x2c')](_0x3911ce);}return null;};}function patchUpdates(_0x4f3e5d){return function(_0x5718c7){try{jsonpatch['apply'](_0x5718c7,_0x4f3e5d,!![]);}catch(_0x4c237e){return BPromise['reject'](_0x4c237e);}return _0x5718c7['save']();};}function saveUpdates(_0x12428b,_0x1b3e72){return function(_0x55dd83){if(_0x55dd83){return _0x55dd83['update'](_0x12428b)['then'](function(_0x771371){return _0x771371;});}return null;};}function removeEntity(_0x22452a,_0x40a05c){return function(_0x4b6c27){if(_0x4b6c27){return _0x4b6c27[_0x0056('0x32')]()['then'](function(){_0x22452a[_0x0056('0x2b')](0xcc)[_0x0056('0x2a')]();});}};}function handleEntityNotFound(_0x183884,_0x161699){return function(_0x263369){if(!_0x263369){_0x183884[_0x0056('0x29')](0x194);}return _0x263369;};}function handleError(_0x576cfd,_0x87eb25){_0x87eb25=_0x87eb25||0x1f4;return function(_0x2e4db8){logger[_0x0056('0x25')](_0x2e4db8[_0x0056('0x33')]);if(_0x2e4db8[_0x0056('0x34')]){delete _0x2e4db8['name'];}_0x576cfd[_0x0056('0x2b')](_0x87eb25)[_0x0056('0x35')](_0x2e4db8);};}exports[_0x0056('0x36')]=function(_0x1b5a13,_0x3a966b){var _0x1d8236={},_0xc2bc3d={},_0x20c953={'count':0x0,'rows':[]};var _0x4080a4=_[_0x0056('0x37')](db[_0x0056('0x38')][_0x0056('0x39')],function(_0x1369d0){return{'name':_0x1369d0[_0x0056('0x3a')],'type':_0x1369d0['type'][_0x0056('0x3b')]};});_0xc2bc3d[_0x0056('0x3c')]=_[_0x0056('0x37')](_0x4080a4,_0x0056('0x34'));_0xc2bc3d[_0x0056('0x3d')]=_['keys'](_0x1b5a13[_0x0056('0x3d')]);_0xc2bc3d['filters']=_[_0x0056('0x3e')](_0xc2bc3d[_0x0056('0x3c')],_0xc2bc3d[_0x0056('0x3d')]);_0x1d8236[_0x0056('0x3f')]=_[_0x0056('0x3e')](_0xc2bc3d[_0x0056('0x3c')],qs[_0x0056('0x40')](_0x1b5a13[_0x0056('0x3d')][_0x0056('0x40')]));_0x1d8236[_0x0056('0x3f')]=_0x1d8236[_0x0056('0x3f')]['length']?_0x1d8236['attributes']:_0xc2bc3d['model'];if(!_0x1b5a13[_0x0056('0x3d')][_0x0056('0x41')](_0x0056('0x42'))){_0x1d8236['limit']=qs[_0x0056('0x43')](_0x1b5a13[_0x0056('0x3d')][_0x0056('0x43')]);_0x1d8236[_0x0056('0x2e')]=qs[_0x0056('0x2e')](_0x1b5a13[_0x0056('0x3d')][_0x0056('0x2e')]);}_0x1d8236[_0x0056('0x44')]=qs[_0x0056('0x45')](_0x1b5a13[_0x0056('0x3d')]['sort']);_0x1d8236[_0x0056('0x46')]=qs[_0x0056('0x47')](_[_0x0056('0x48')](_0x1b5a13['query'],_0xc2bc3d[_0x0056('0x47')]),_0x4080a4);if(_0x1b5a13[_0x0056('0x3d')][_0x0056('0x49')]){_0x1d8236[_0x0056('0x46')]=_[_0x0056('0x4a')](_0x1d8236[_0x0056('0x46')],{'$or':_['map'](_0x4080a4,function(_0x474894){if(_0x474894[_0x0056('0x4b')]!==_0x0056('0x4c')){var _0xd892a6={};_0xd892a6[_0x474894[_0x0056('0x34')]]={'$like':'%'+_0x1b5a13[_0x0056('0x3d')]['filter']+'%'};return _0xd892a6;}})});}_0x1d8236=_['merge']({},_0x1d8236,_0x1b5a13['options']);var _0x593730={'where':_0x1d8236[_0x0056('0x46')]};return db[_0x0056('0x38')][_0x0056('0x2f')](_0x593730)[_0x0056('0x1e')](function(_0x5570c9){_0x20c953[_0x0056('0x2f')]=_0x5570c9;if(_0x1b5a13[_0x0056('0x3d')][_0x0056('0x4d')]){_0x1d8236[_0x0056('0x4e')]=[{'all':!![]}];}return db[_0x0056('0x38')][_0x0056('0x4f')](_0x1d8236);})['then'](function(_0x867ab6){_0x20c953[_0x0056('0x50')]=_0x867ab6;return _0x20c953;})[_0x0056('0x1e')](respondWithFilteredResult(_0x3a966b,_0x1d8236))[_0x0056('0x28')](handleError(_0x3a966b,null));};exports[_0x0056('0x51')]=function(_0x542205,_0x977988){var _0x5db233={'raw':!![],'where':{'id':_0x542205[_0x0056('0x52')]['id']}},_0x4ef329={};_0x4ef329[_0x0056('0x3c')]=_[_0x0056('0x53')](db[_0x0056('0x38')][_0x0056('0x39')]);_0x4ef329[_0x0056('0x3d')]=_[_0x0056('0x53')](_0x542205[_0x0056('0x3d')]);_0x4ef329[_0x0056('0x47')]=_[_0x0056('0x3e')](_0x4ef329[_0x0056('0x3c')],_0x4ef329[_0x0056('0x3d')]);_0x5db233[_0x0056('0x3f')]=_[_0x0056('0x3e')](_0x4ef329[_0x0056('0x3c')],qs[_0x0056('0x40')](_0x542205[_0x0056('0x3d')][_0x0056('0x40')]));_0x5db233[_0x0056('0x3f')]=_0x5db233[_0x0056('0x3f')][_0x0056('0x54')]?_0x5db233[_0x0056('0x3f')]:_0x4ef329[_0x0056('0x3c')];if(_0x542205['query']['includeAll']){_0x5db233[_0x0056('0x4e')]=[{'all':!![]}];}_0x5db233=_[_0x0056('0x4a')]({},_0x5db233,_0x542205[_0x0056('0x55')]);return db[_0x0056('0x38')][_0x0056('0x56')](_0x5db233)['then'](handleEntityNotFound(_0x977988,null))[_0x0056('0x1e')](respondWithResult(_0x977988,null))['catch'](handleError(_0x977988,null));};exports[_0x0056('0x57')]=function(_0x573a41,_0xbb045){return db[_0x0056('0x38')][_0x0056('0x57')](_0x573a41[_0x0056('0x58')],{})[_0x0056('0x1e')](respondWithResult(_0xbb045,0xc9))[_0x0056('0x28')](handleError(_0xbb045,null));};exports[_0x0056('0x59')]=function(_0x1a87cf,_0x3f489a){if(_0x1a87cf[_0x0056('0x58')]['id']){delete _0x1a87cf['body']['id'];}return db[_0x0056('0x38')][_0x0056('0x56')]({'where':{'id':_0x1a87cf[_0x0056('0x52')]['id']}})['then'](handleEntityNotFound(_0x3f489a,null))[_0x0056('0x1e')](saveUpdates(_0x1a87cf[_0x0056('0x58')],null))[_0x0056('0x1e')](respondWithResult(_0x3f489a,null))[_0x0056('0x28')](handleError(_0x3f489a,null));};exports[_0x0056('0x32')]=function(_0x1f8df1,_0x13c0c2){return db[_0x0056('0x38')][_0x0056('0x56')]({'where':{'id':_0x1f8df1[_0x0056('0x52')]['id']}})['then'](handleEntityNotFound(_0x13c0c2,null))[_0x0056('0x1e')](removeEntity(_0x13c0c2,null))['catch'](handleError(_0x13c0c2,null));};exports[_0x0056('0x5a')]=function(_0x49d83f,_0x1bfd9a){return db[_0x0056('0x38')][_0x0056('0x5a')]()[_0x0056('0x1e')](respondWithResult(_0x1bfd9a,null))['catch'](handleError(_0x1bfd9a,null));};var interaction_log=require('../../config/logger')(_0x0056('0x5b'));exports[_0x0056('0x5c')]=function(_0x3fa0b6,_0x5acbc3,_0x31fe5a){var _0x200f78={'agent':{},'channel':'openchannel'};if(_0x3fa0b6[_0x0056('0x58')]['id']){delete _0x3fa0b6[_0x0056('0x58')]['id'];}_0x3fa0b6[_0x0056('0x58')]['read']=!![];_0x3fa0b6[_0x0056('0x58')]['readAt']=moment()[_0x0056('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fa0b6[_0x0056('0x58')][_0x0056('0x5e')]=_0x3fa0b6[_0x0056('0x58')]['UserId']||_0x3fa0b6[_0x0056('0x5f')]['id'];_0x200f78[_0x0056('0x60')]['id']=_0x3fa0b6[_0x0056('0x58')][_0x0056('0x5e')];return db['OpenchannelMessage']['find']({'where':{'id':_0x3fa0b6[_0x0056('0x52')]['id'],'UserId':null}})[_0x0056('0x1e')](handleEntityNotFound(_0x5acbc3,null))[_0x0056('0x1e')](saveUpdates(_0x3fa0b6[_0x0056('0x58')],null))[_0x0056('0x1e')](function(_0x3a8b69){if(_0x3a8b69){_0x200f78['message']=_0x3a8b69['get']({'plain':!![]});return db[_0x0056('0x61')][_0x0056('0x56')]({'where':{'id':_0x3a8b69['OpenchannelInteractionId']}});}return null;})[_0x0056('0x1e')](handleEntityNotFound(_0x5acbc3,null))[_0x0056('0x1e')](function(_0x4166ec){if(_0x4166ec){return _0x4166ec['update']({'UserId':_0x3fa0b6[_0x0056('0x58')][_0x0056('0x5e')],'read1stAt':_[_0x0056('0x62')](_0x4166ec[_0x0056('0x63')])?moment()[_0x0056('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0056('0x1e')](function(_0x5ce663){if(_0x5ce663){_0x200f78[_0x0056('0x64')]=_0x5ce663[_0x0056('0x65')]({'plain':!![]});interaction_log[_0x0056('0x1f')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3fa0b6[_0x0056('0x5f')]['id'],_0x3fa0b6['user'][_0x0056('0x34')],_0x3fa0b6[_0x0056('0x5f')][_0x0056('0x66')],_0x200f78[_0x0056('0x64')]['id'],_0x3fa0b6[_0x0056('0x58')]?JSON['stringify'](_0x3fa0b6['body']):_0x0056('0x67'));return respondWithRpcPromise('AcceptMessage',_0x0056('0x68'),_0x200f78);}return null;})['then'](function(_0x3a4103){var _0x159e51=_0x0056('0x69')+_0x3a4103[_0x0056('0x26')][_0x0056('0x6a')];return db[_0x0056('0x6b')][_0x0056('0x3d')](_0x159e51,{'type':db[_0x0056('0x6c')][_0x0056('0x6d')]['SELECT'],'raw':!![]})[_0x0056('0x1e')](function(_0x283ea6){return _0x283ea6;});})[_0x0056('0x1e')](function(_0x1f13d9){if(_0x1f13d9){_0x200f78[_0x0056('0x26')]['contact']=_0x1f13d9[0x0];if(!_0x3fa0b6[_0x0056('0x58')][_0x0056('0x5e')])return;return db[_0x0056('0x6e')][_0x0056('0x56')]({'where':{'id':_0x3fa0b6[_0x0056('0x58')][_0x0056('0x5e')],'role':'agent'},'attributes':['id',_0x0056('0x34'),_0x0056('0x6f'),_0x0056('0x70'),_0x0056('0x71')],'raw':!![]});}return null;})[_0x0056('0x1e')](function(_0x21ffae){if(!_0x21ffae)return null;_0x200f78[_0x0056('0x26')][_0x0056('0x60')]=_0x21ffae;return _0x200f78;})[_0x0056('0x1e')](function(_0x54ffd5){if(_0x54ffd5){if(_0x3fa0b6['body'][_0x0056('0x72')]){_0x200f78[_0x0056('0x26')][_0x0056('0x73')]=util[_0x0056('0x5d')]('SIP/%s',_0x3fa0b6[_0x0056('0x5f')][_0x0056('0x34')]);_0x200f78[_0x0056('0x26')][_0x0056('0x74')]=_0x200f78['channel'];_0x200f78[_0x0056('0x26')][_0x0056('0x75')]=_0x200f78['channel'];_0x200f78[_0x0056('0x26')][_0x0056('0x76')]=_0x0056('0x5c');return respondWithRpcPromise(_0x0056('0x77'),_0x0056('0x77'),{'event':'acceptmessage','message':_0x200f78[_0x0056('0x26')]},client9002)['then'](function(){return _0x200f78;});}return _0x200f78;}return null;})[_0x0056('0x1e')](respondWithResult(_0x5acbc3,null))[_0x0056('0x28')](handleError(_0x5acbc3,null));};var interaction_log=require(_0x0056('0x11'))(_0x0056('0x5b'));exports[_0x0056('0x78')]=function(_0x2d6bb8,_0x6688b,_0x50191e){var _0x1e9936={'agent':{},'channel':_0x0056('0x79')};if(_0x2d6bb8['body']['id']){delete _0x2d6bb8[_0x0056('0x58')]['id'];}_0x2d6bb8['body'][_0x0056('0x5e')]=_0x2d6bb8[_0x0056('0x58')][_0x0056('0x5e')]||_0x2d6bb8[_0x0056('0x5f')]['id'];_0x1e9936[_0x0056('0x60')]['id']=_0x2d6bb8[_0x0056('0x58')]['UserId'];return db[_0x0056('0x38')]['find']({'where':{'id':_0x2d6bb8['params']['id'],'UserId':null}})[_0x0056('0x1e')](handleEntityNotFound(_0x6688b,null))[_0x0056('0x1e')](function(_0x32e9ef){if(_0x32e9ef){_0x1e9936[_0x0056('0x26')]=_0x32e9ef[_0x0056('0x65')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x32e9ef[_0x0056('0x7a')]}});}return null;})[_0x0056('0x1e')](handleEntityNotFound(_0x6688b,null))['then'](function(_0x5eafcf){if(_0x5eafcf){_0x1e9936[_0x0056('0x64')]=_0x5eafcf[_0x0056('0x65')]({'plain':!![]});interaction_log[_0x0056('0x1f')](_0x0056('0x7b'),_0x2d6bb8[_0x0056('0x5f')]['id'],_0x2d6bb8[_0x0056('0x5f')]['name'],_0x2d6bb8[_0x0056('0x5f')][_0x0056('0x66')],_0x1e9936[_0x0056('0x64')]['id'],_0x2d6bb8[_0x0056('0x58')]?JSON[_0x0056('0x24')](_0x2d6bb8[_0x0056('0x58')]):'null');return respondWithRpcPromise(_0x0056('0x7c'),'rejectMessage',_0x1e9936);}return null;})['then'](function(_0x26917f){var _0xa74194=_0x0056('0x69')+_0x26917f[_0x0056('0x26')][_0x0056('0x6a')];return db[_0x0056('0x6b')][_0x0056('0x3d')](_0xa74194,{'type':db[_0x0056('0x6c')][_0x0056('0x6d')]['SELECT'],'raw':!![]})[_0x0056('0x1e')](function(_0x5b0a10){return _0x5b0a10;});})['then'](function(_0x2fd5f9){if(_0x2fd5f9){_0x1e9936[_0x0056('0x26')]['contact']=_0x2fd5f9[0x0];if(!_0x2d6bb8[_0x0056('0x58')][_0x0056('0x5e')])return;return db[_0x0056('0x6e')]['find']({'where':{'id':_0x2d6bb8[_0x0056('0x58')][_0x0056('0x5e')],'role':_0x0056('0x60')},'attributes':['id',_0x0056('0x34'),'fullname','email',_0x0056('0x71')],'raw':!![]});}return null;})[_0x0056('0x1e')](function(_0x1c3707){if(!_0x1c3707)return null;_0x1e9936[_0x0056('0x26')][_0x0056('0x60')]=_0x1c3707;return _0x1e9936;})[_0x0056('0x1e')](function(_0x271ead){if(_0x271ead){_0x271ead[_0x0056('0x26')][_0x0056('0x73')]=util[_0x0056('0x5d')](_0x0056('0x7d'),_0x2d6bb8[_0x0056('0x5f')][_0x0056('0x34')]);_0x271ead[_0x0056('0x26')][_0x0056('0x74')]=_0x1e9936[_0x0056('0x74')];_0x271ead[_0x0056('0x26')][_0x0056('0x75')]=_0x1e9936[_0x0056('0x74')];_0x271ead[_0x0056('0x26')][_0x0056('0x76')]=_0x0056('0x78');respondWithRpcPromise(_0x0056('0x77'),_0x0056('0x77'),{'event':_0x0056('0x7e'),'message':_0x271ead[_0x0056('0x26')]},client9002);return _0x1e9936;}return null;})[_0x0056('0x1e')](respondWithResult(_0x6688b,null))[_0x0056('0x28')](handleError(_0x6688b,null));};
\ No newline at end of file
+var _0x0c46=['then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','undefined','count','set','reject','save','update','destroy','name','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','VIRTUAL','merge','rows','show','includeAll','include','options','body','find','describe','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','OpenchannelInteraction','isNil','format','get','[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','SELECT','contact','fullname','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','interaction','role','rejectMessage','User','email','interface','SIP/%s','rejectmessage','eml-format','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','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','request'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x0c46,0xe6));var _0x60c4=function(_0x4c761a,_0xddb259){_0x4c761a=_0x4c761a-0x0;var _0x1b24e6=_0x0c46[_0x4c761a];return _0x1b24e6;};'use strict';var emlformat=require(_0x60c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x60c4('0x1'));var jsonpatch=require(_0x60c4('0x2'));var rp=require(_0x60c4('0x3'));var moment=require(_0x60c4('0x4'));var BPromise=require(_0x60c4('0x5'));var Mustache=require(_0x60c4('0x6'));var util=require(_0x60c4('0x7'));var path=require(_0x60c4('0x8'));var sox=require(_0x60c4('0x9'));var csv=require('to-csv');var ejs=require(_0x60c4('0xa'));var fs=require('fs');var fs_extra=require(_0x60c4('0xb'));var _=require(_0x60c4('0xc'));var squel=require(_0x60c4('0xd'));var crypto=require(_0x60c4('0xe'));var jsforce=require(_0x60c4('0xf'));var deskjs=require(_0x60c4('0x10'));var toCsv=require(_0x60c4('0x11'));var querystring=require(_0x60c4('0x12'));var Papa=require(_0x60c4('0x13'));var Redis=require(_0x60c4('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x60c4('0x15'));var hardwareService=require(_0x60c4('0x16'));var logger=require(_0x60c4('0x17'))(_0x60c4('0x18'));var utils=require(_0x60c4('0x19'));var config=require(_0x60c4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x60c4('0x1b'))['db'];config[_0x60c4('0x1c')]=_[_0x60c4('0x1d')](config[_0x60c4('0x1c')],{'host':_0x60c4('0x1e'),'port':0x18eb});var socket=require(_0x60c4('0x1f'))(new Redis(config[_0x60c4('0x1c')]));require(_0x60c4('0x20'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x60c4('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x60c4('0x21')][_0x60c4('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x422484,_0x2634c3,_0x343fd5,_0x32f357){return new BPromise(function(_0x3df50b,_0x8ddac5){var _0x166b11=_0x32f357||client;return _0x166b11[_0x60c4('0x23')](_0x422484,_0x343fd5)[_0x60c4('0x24')](function(_0x4755c5){logger[_0x60c4('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x2634c3,_0x60c4('0x26'));logger[_0x60c4('0x27')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2634c3,'request\x20sent',JSON[_0x60c4('0x28')](_0x4755c5));if(_0x4755c5[_0x60c4('0x29')]){if(_0x4755c5[_0x60c4('0x29')][_0x60c4('0x2a')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2634c3,_0x4755c5[_0x60c4('0x29')][_0x60c4('0x2b')]);return _0x8ddac5(_0x4755c5['error'][_0x60c4('0x2b')]);}logger[_0x60c4('0x29')](_0x60c4('0x2c'),_0x2634c3,_0x4755c5[_0x60c4('0x29')][_0x60c4('0x2b')]);return _0x3df50b(_0x4755c5[_0x60c4('0x29')][_0x60c4('0x2b')]);}else{logger[_0x60c4('0x25')](_0x60c4('0x2c'),_0x2634c3,'request\x20sent');_0x3df50b(_0x4755c5[_0x60c4('0x2d')][_0x60c4('0x2b')]);}})[_0x60c4('0x2e')](function(_0x532ed7){logger[_0x60c4('0x29')](_0x60c4('0x2c'),_0x2634c3,_0x532ed7);_0x8ddac5(_0x532ed7);});});}function respondWithStatusCode(_0x577b47,_0x2b4e6e){_0x2b4e6e=_0x2b4e6e||0xcc;return function(_0x28bd33){if(_0x28bd33){return _0x577b47[_0x60c4('0x2f')](_0x2b4e6e);}return _0x577b47['status'](_0x2b4e6e)[_0x60c4('0x30')]();};}function respondWithResult(_0x29bca3,_0x2bb0f6){_0x2bb0f6=_0x2bb0f6||0xc8;return function(_0x5eaf46){if(_0x5eaf46){return _0x29bca3[_0x60c4('0x31')](_0x2bb0f6)[_0x60c4('0x32')](_0x5eaf46);}};}function respondWithFilteredResult(_0x145e88,_0x4d9b2a){return function(_0x12ad8c){if(_0x12ad8c){var _0x3deb28=typeof _0x4d9b2a[_0x60c4('0x33')]===_0x60c4('0x34')&&typeof _0x4d9b2a['limit']===_0x60c4('0x34');var _0x102197=_0x12ad8c[_0x60c4('0x35')];var _0x48ea93=_0x3deb28?0x0:_0x4d9b2a[_0x60c4('0x33')];var _0x47ea74=_0x3deb28?_0x12ad8c[_0x60c4('0x35')]:_0x4d9b2a[_0x60c4('0x33')]+_0x4d9b2a['limit'];var _0x3680ec;if(_0x47ea74>=_0x102197){_0x47ea74=_0x102197;_0x3680ec=0xc8;}else{_0x3680ec=0xce;}_0x145e88['status'](_0x3680ec);return _0x145e88[_0x60c4('0x36')]('Content-Range',_0x48ea93+'-'+_0x47ea74+'/'+_0x102197)[_0x60c4('0x32')](_0x12ad8c);}return null;};}function patchUpdates(_0x126824){return function(_0x24f6c9){try{jsonpatch['apply'](_0x24f6c9,_0x126824,!![]);}catch(_0x35c71e){return BPromise[_0x60c4('0x37')](_0x35c71e);}return _0x24f6c9[_0x60c4('0x38')]();};}function saveUpdates(_0x129b85,_0x5a544b){return function(_0x3455c8){if(_0x3455c8){return _0x3455c8[_0x60c4('0x39')](_0x129b85)[_0x60c4('0x24')](function(_0x3af644){return _0x3af644;});}return null;};}function removeEntity(_0x5ad304,_0x3d5bc2){return function(_0x9d3e85){if(_0x9d3e85){return _0x9d3e85[_0x60c4('0x3a')]()['then'](function(){_0x5ad304[_0x60c4('0x31')](0xcc)[_0x60c4('0x30')]();});}};}function handleEntityNotFound(_0x3553cf,_0x502a6a){return function(_0x31a4d6){if(!_0x31a4d6){_0x3553cf[_0x60c4('0x2f')](0x194);}return _0x31a4d6;};}function handleError(_0x1d64c4,_0x37756f){_0x37756f=_0x37756f||0x1f4;return function(_0xef7bf4){logger[_0x60c4('0x29')](_0xef7bf4['stack']);if(_0xef7bf4[_0x60c4('0x3b')]){delete _0xef7bf4[_0x60c4('0x3b')];}_0x1d64c4[_0x60c4('0x31')](_0x37756f)['send'](_0xef7bf4);};}exports[_0x60c4('0x3c')]=function(_0x172ac1,_0x2cf8b6){var _0x37d5d8={},_0x40a0e4={},_0x39dafa={'count':0x0,'rows':[]};var _0x41f9f3=_['map'](db[_0x60c4('0x3d')][_0x60c4('0x3e')],function(_0x1d0637){return{'name':_0x1d0637[_0x60c4('0x3f')],'type':_0x1d0637[_0x60c4('0x40')][_0x60c4('0x41')]};});_0x40a0e4[_0x60c4('0x42')]=_['map'](_0x41f9f3,_0x60c4('0x3b'));_0x40a0e4[_0x60c4('0x43')]=_[_0x60c4('0x44')](_0x172ac1[_0x60c4('0x43')]);_0x40a0e4[_0x60c4('0x45')]=_['intersection'](_0x40a0e4[_0x60c4('0x42')],_0x40a0e4[_0x60c4('0x43')]);_0x37d5d8[_0x60c4('0x46')]=_[_0x60c4('0x47')](_0x40a0e4['model'],qs[_0x60c4('0x48')](_0x172ac1[_0x60c4('0x43')][_0x60c4('0x48')]));_0x37d5d8[_0x60c4('0x46')]=_0x37d5d8[_0x60c4('0x46')][_0x60c4('0x49')]?_0x37d5d8['attributes']:_0x40a0e4['model'];if(!_0x172ac1[_0x60c4('0x43')][_0x60c4('0x4a')](_0x60c4('0x4b'))){_0x37d5d8['limit']=qs['limit'](_0x172ac1[_0x60c4('0x43')][_0x60c4('0x4c')]);_0x37d5d8[_0x60c4('0x33')]=qs[_0x60c4('0x33')](_0x172ac1[_0x60c4('0x43')][_0x60c4('0x33')]);}_0x37d5d8[_0x60c4('0x4d')]=qs[_0x60c4('0x4e')](_0x172ac1[_0x60c4('0x43')][_0x60c4('0x4e')]);_0x37d5d8[_0x60c4('0x4f')]=qs[_0x60c4('0x45')](_[_0x60c4('0x50')](_0x172ac1[_0x60c4('0x43')],_0x40a0e4[_0x60c4('0x45')]),_0x41f9f3);if(_0x172ac1['query'][_0x60c4('0x51')]){_0x37d5d8[_0x60c4('0x4f')]=_['merge'](_0x37d5d8['where'],{'$or':_[_0x60c4('0x52')](_0x41f9f3,function(_0x536626){if(_0x536626['type']!==_0x60c4('0x53')){var _0x4fac61={};_0x4fac61[_0x536626[_0x60c4('0x3b')]]={'$like':'%'+_0x172ac1['query'][_0x60c4('0x51')]+'%'};return _0x4fac61;}})});}_0x37d5d8=_[_0x60c4('0x54')]({},_0x37d5d8,_0x172ac1['options']);var _0x46a7c1={'where':_0x37d5d8[_0x60c4('0x4f')]};return db['OpenchannelMessage']['count'](_0x46a7c1)[_0x60c4('0x24')](function(_0x2431a5){_0x39dafa[_0x60c4('0x35')]=_0x2431a5;if(_0x172ac1['query']['includeAll']){_0x37d5d8['include']=[{'all':!![]}];}return db[_0x60c4('0x3d')]['findAll'](_0x37d5d8);})[_0x60c4('0x24')](function(_0x3f6f0c){_0x39dafa[_0x60c4('0x55')]=_0x3f6f0c;return _0x39dafa;})[_0x60c4('0x24')](respondWithFilteredResult(_0x2cf8b6,_0x37d5d8))['catch'](handleError(_0x2cf8b6,null));};exports[_0x60c4('0x56')]=function(_0x104099,_0x55e03d){var _0x296a3c={'raw':!![],'where':{'id':_0x104099['params']['id']}},_0xcf5c62={};_0xcf5c62[_0x60c4('0x42')]=_['keys'](db['OpenchannelMessage'][_0x60c4('0x3e')]);_0xcf5c62[_0x60c4('0x43')]=_[_0x60c4('0x44')](_0x104099[_0x60c4('0x43')]);_0xcf5c62['filters']=_['intersection'](_0xcf5c62[_0x60c4('0x42')],_0xcf5c62[_0x60c4('0x43')]);_0x296a3c[_0x60c4('0x46')]=_[_0x60c4('0x47')](_0xcf5c62[_0x60c4('0x42')],qs[_0x60c4('0x48')](_0x104099['query'][_0x60c4('0x48')]));_0x296a3c['attributes']=_0x296a3c[_0x60c4('0x46')][_0x60c4('0x49')]?_0x296a3c['attributes']:_0xcf5c62['model'];if(_0x104099[_0x60c4('0x43')][_0x60c4('0x57')]){_0x296a3c[_0x60c4('0x58')]=[{'all':!![]}];}_0x296a3c=_[_0x60c4('0x54')]({},_0x296a3c,_0x104099[_0x60c4('0x59')]);return db[_0x60c4('0x3d')]['find'](_0x296a3c)[_0x60c4('0x24')](handleEntityNotFound(_0x55e03d,null))[_0x60c4('0x24')](respondWithResult(_0x55e03d,null))[_0x60c4('0x2e')](handleError(_0x55e03d,null));};exports['create']=function(_0x18392b,_0x4f9e3a){return db[_0x60c4('0x3d')]['create'](_0x18392b[_0x60c4('0x5a')],{})['then'](respondWithResult(_0x4f9e3a,0xc9))[_0x60c4('0x2e')](handleError(_0x4f9e3a,null));};exports[_0x60c4('0x39')]=function(_0x3b83ce,_0x1f7b1f){if(_0x3b83ce[_0x60c4('0x5a')]['id']){delete _0x3b83ce['body']['id'];}return db[_0x60c4('0x3d')][_0x60c4('0x5b')]({'where':{'id':_0x3b83ce['params']['id']}})[_0x60c4('0x24')](handleEntityNotFound(_0x1f7b1f,null))[_0x60c4('0x24')](saveUpdates(_0x3b83ce[_0x60c4('0x5a')],null))[_0x60c4('0x24')](respondWithResult(_0x1f7b1f,null))[_0x60c4('0x2e')](handleError(_0x1f7b1f,null));};exports[_0x60c4('0x3a')]=function(_0x17541f,_0x13ae22){return db['OpenchannelMessage'][_0x60c4('0x5b')]({'where':{'id':_0x17541f['params']['id']}})[_0x60c4('0x24')](handleEntityNotFound(_0x13ae22,null))['then'](removeEntity(_0x13ae22,null))[_0x60c4('0x2e')](handleError(_0x13ae22,null));};exports[_0x60c4('0x5c')]=function(_0xa70b0b,_0x5cc165){return db[_0x60c4('0x3d')][_0x60c4('0x5c')]()['then'](respondWithResult(_0x5cc165,null))['catch'](handleError(_0x5cc165,null));};var interaction_log=require(_0x60c4('0x17'))('openchannel-interactions');exports[_0x60c4('0x5d')]=function(_0x4c9b64,_0x201e3d,_0x527925){var _0x8b2f7={'agent':{},'channel':_0x60c4('0x5e')};if(_0x4c9b64[_0x60c4('0x5a')]['id']){delete _0x4c9b64[_0x60c4('0x5a')]['id'];}_0x4c9b64[_0x60c4('0x5a')][_0x60c4('0x5f')]=!![];_0x4c9b64[_0x60c4('0x5a')]['readAt']=moment()['format'](_0x60c4('0x60'));_0x4c9b64[_0x60c4('0x5a')][_0x60c4('0x61')]=_0x4c9b64['body'][_0x60c4('0x61')]||_0x4c9b64[_0x60c4('0x62')]['id'];_0x8b2f7[_0x60c4('0x63')]['id']=_0x4c9b64[_0x60c4('0x5a')][_0x60c4('0x61')];return db[_0x60c4('0x3d')][_0x60c4('0x5b')]({'where':{'id':_0x4c9b64[_0x60c4('0x64')]['id'],'UserId':null}})[_0x60c4('0x24')](handleEntityNotFound(_0x201e3d,null))[_0x60c4('0x24')](saveUpdates(_0x4c9b64[_0x60c4('0x5a')],null))[_0x60c4('0x24')](function(_0xb407e1){if(_0xb407e1){_0x8b2f7[_0x60c4('0x2b')]=_0xb407e1['get']({'plain':!![]});return db[_0x60c4('0x65')][_0x60c4('0x5b')]({'where':{'id':_0xb407e1['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x201e3d,null))[_0x60c4('0x24')](function(_0x4f7fc4){if(_0x4f7fc4){return _0x4f7fc4[_0x60c4('0x39')]({'UserId':_0x4c9b64[_0x60c4('0x5a')]['UserId'],'read1stAt':_[_0x60c4('0x66')](_0x4f7fc4['read1stAt'])?moment()[_0x60c4('0x67')](_0x60c4('0x60')):undefined});}return null;})[_0x60c4('0x24')](function(_0x4944f3){if(_0x4944f3){_0x8b2f7['interaction']=_0x4944f3[_0x60c4('0x68')]({'plain':!![]});interaction_log[_0x60c4('0x25')](_0x60c4('0x69'),_0x4c9b64[_0x60c4('0x62')]['id'],_0x4c9b64[_0x60c4('0x62')][_0x60c4('0x3b')],_0x4c9b64[_0x60c4('0x62')]['role'],_0x8b2f7['interaction']['id'],_0x4c9b64['body']?JSON['stringify'](_0x4c9b64[_0x60c4('0x5a')]):_0x60c4('0x6a'));return respondWithRpcPromise(_0x60c4('0x6b'),_0x60c4('0x6c'),_0x8b2f7);}return null;})[_0x60c4('0x24')](function(_0x26ae55){var _0x40eeec=_0x60c4('0x6d')+_0x26ae55['message'][_0x60c4('0x6e')];return db[_0x60c4('0x6f')][_0x60c4('0x43')](_0x40eeec,{'type':db[_0x60c4('0x70')][_0x60c4('0x71')][_0x60c4('0x72')],'raw':!![]})[_0x60c4('0x24')](function(_0x88a607){return _0x88a607;});})[_0x60c4('0x24')](function(_0x1b4874){if(_0x1b4874){_0x8b2f7[_0x60c4('0x2b')][_0x60c4('0x73')]=_0x1b4874[0x0];if(!_0x4c9b64[_0x60c4('0x5a')][_0x60c4('0x61')])return;return db['User'][_0x60c4('0x5b')]({'where':{'id':_0x4c9b64[_0x60c4('0x5a')][_0x60c4('0x61')],'role':_0x60c4('0x63')},'attributes':['id',_0x60c4('0x3b'),_0x60c4('0x74'),'email',_0x60c4('0x75')],'raw':!![]});}return null;})[_0x60c4('0x24')](function(_0x3c8e6d){if(!_0x3c8e6d)return null;_0x8b2f7[_0x60c4('0x2b')][_0x60c4('0x63')]=_0x3c8e6d;return _0x8b2f7;})[_0x60c4('0x24')](function(_0x4538ab){if(_0x4538ab){if(_0x4c9b64[_0x60c4('0x5a')][_0x60c4('0x76')]){_0x8b2f7[_0x60c4('0x2b')]['interface']=util[_0x60c4('0x67')]('SIP/%s',_0x4c9b64['user'][_0x60c4('0x3b')]);_0x8b2f7[_0x60c4('0x2b')][_0x60c4('0x77')]=_0x8b2f7[_0x60c4('0x77')];_0x8b2f7[_0x60c4('0x2b')][_0x60c4('0x78')]=_0x8b2f7[_0x60c4('0x77')];_0x8b2f7[_0x60c4('0x2b')][_0x60c4('0x79')]='accept';return respondWithRpcPromise('EventManager',_0x60c4('0x7a'),{'event':_0x60c4('0x7b'),'message':_0x8b2f7['message']},client9002)['then'](function(){return _0x8b2f7;});}return _0x8b2f7;}return null;})[_0x60c4('0x24')](respondWithResult(_0x201e3d,null))[_0x60c4('0x2e')](handleError(_0x201e3d,null));};var interaction_log=require(_0x60c4('0x17'))(_0x60c4('0x7c'));exports[_0x60c4('0x37')]=function(_0x3608c0,_0x133f8e,_0x2a251d){var _0x55ef4e={'agent':{},'channel':_0x60c4('0x5e')};if(_0x3608c0[_0x60c4('0x5a')]['id']){delete _0x3608c0[_0x60c4('0x5a')]['id'];}_0x3608c0[_0x60c4('0x5a')][_0x60c4('0x61')]=_0x3608c0[_0x60c4('0x5a')][_0x60c4('0x61')]||_0x3608c0[_0x60c4('0x62')]['id'];_0x55ef4e[_0x60c4('0x63')]['id']=_0x3608c0['body']['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x3608c0[_0x60c4('0x64')]['id'],'UserId':null}})[_0x60c4('0x24')](handleEntityNotFound(_0x133f8e,null))[_0x60c4('0x24')](function(_0x5dbcd3){if(_0x5dbcd3){_0x55ef4e[_0x60c4('0x2b')]=_0x5dbcd3[_0x60c4('0x68')]({'plain':!![]});return db[_0x60c4('0x65')]['find']({'where':{'id':_0x5dbcd3['OpenchannelInteractionId']}});}return null;})[_0x60c4('0x24')](handleEntityNotFound(_0x133f8e,null))['then'](function(_0x256f01){if(_0x256f01){_0x55ef4e[_0x60c4('0x7d')]=_0x256f01[_0x60c4('0x68')]({'plain':!![]});interaction_log[_0x60c4('0x25')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3608c0[_0x60c4('0x62')]['id'],_0x3608c0['user'][_0x60c4('0x3b')],_0x3608c0[_0x60c4('0x62')][_0x60c4('0x7e')],_0x55ef4e['interaction']['id'],_0x3608c0['body']?JSON[_0x60c4('0x28')](_0x3608c0[_0x60c4('0x5a')]):'null');return respondWithRpcPromise('RejectMessage',_0x60c4('0x7f'),_0x55ef4e);}return null;})['then'](function(_0x428346){var _0x3fc844=_0x60c4('0x6d')+_0x428346[_0x60c4('0x2b')][_0x60c4('0x6e')];return db[_0x60c4('0x6f')]['query'](_0x3fc844,{'type':db['Sequelize']['QueryTypes'][_0x60c4('0x72')],'raw':!![]})[_0x60c4('0x24')](function(_0xd89f4){return _0xd89f4;});})['then'](function(_0x213d7e){if(_0x213d7e){_0x55ef4e[_0x60c4('0x2b')][_0x60c4('0x73')]=_0x213d7e[0x0];if(!_0x3608c0[_0x60c4('0x5a')][_0x60c4('0x61')])return;return db[_0x60c4('0x80')][_0x60c4('0x5b')]({'where':{'id':_0x3608c0[_0x60c4('0x5a')][_0x60c4('0x61')],'role':_0x60c4('0x63')},'attributes':['id',_0x60c4('0x3b'),'fullname',_0x60c4('0x81'),'internal'],'raw':!![]});}return null;})[_0x60c4('0x24')](function(_0x469078){if(!_0x469078)return null;_0x55ef4e['message']['agent']=_0x469078;return _0x55ef4e;})[_0x60c4('0x24')](function(_0xe4a307){if(_0xe4a307){_0xe4a307[_0x60c4('0x2b')][_0x60c4('0x82')]=util[_0x60c4('0x67')](_0x60c4('0x83'),_0x3608c0['user'][_0x60c4('0x3b')]);_0xe4a307[_0x60c4('0x2b')]['channel']=_0x55ef4e[_0x60c4('0x77')];_0xe4a307[_0x60c4('0x2b')]['motionChannel']=_0x55ef4e['channel'];_0xe4a307['message']['event']=_0x60c4('0x37');respondWithRpcPromise(_0x60c4('0x7a'),_0x60c4('0x7a'),{'event':_0x60c4('0x84'),'message':_0xe4a307[_0x60c4('0x2b')]},client9002);return _0x55ef4e;}return null;})[_0x60c4('0x24')](respondWithResult(_0x133f8e,null))[_0x60c4('0x2e')](handleError(_0x133f8e,null));};
\ No newline at end of file
index 3236250..883a6cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e80=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1eff7c,_0x357ad0){var _0x304854=function(_0x27f760){while(--_0x27f760){_0x1eff7c['push'](_0x1eff7c['shift']());}};_0x304854(++_0x357ad0);}(_0x8e80,0x136));var _0x08e8=function(_0x33403b,_0x5cca9c){_0x33403b=_0x33403b-0x0;var _0x2d8657=_0x8e80[_0x33403b];return _0x2d8657;};'use strict';var EventEmitter=require(_0x08e8('0x0'));var OpenchannelMessage=require(_0x08e8('0x1'))['db'][_0x08e8('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x08e8('0x3')](0x0);var events={'afterCreate':_0x08e8('0x4'),'afterUpdate':_0x08e8('0x5'),'afterDestroy':_0x08e8('0x6')};function emitEvent(_0x4a0602){return function(_0x44438b,_0x2b06bf,_0xdfd79e){OpenchannelMessageEvents[_0x08e8('0x7')](_0x4a0602+':'+_0x44438b['id'],_0x44438b);OpenchannelMessageEvents['emit'](_0x4a0602,_0x44438b);_0xdfd79e(null);};}for(var e in events){if(events[_0x08e8('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x08e8('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x5ce1=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x38cca7,_0x14fcdb){var _0x181624=function(_0x2fb72a){while(--_0x2fb72a){_0x38cca7['push'](_0x38cca7['shift']());}};_0x181624(++_0x14fcdb);}(_0x5ce1,0x190));var _0x15ce=function(_0x445fca,_0x1d678f){_0x445fca=_0x445fca-0x0;var _0x577fc0=_0x5ce1[_0x445fca];return _0x577fc0;};'use strict';var EventEmitter=require(_0x15ce('0x0'));var OpenchannelMessage=require(_0x15ce('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x15ce('0x2')](0x0);var events={'afterCreate':_0x15ce('0x3'),'afterUpdate':_0x15ce('0x4'),'afterDestroy':_0x15ce('0x5')};function emitEvent(_0x3f7122){return function(_0x356b22,_0x41bcbd,_0x5a406e){OpenchannelMessageEvents[_0x15ce('0x6')](_0x3f7122+':'+_0x356b22['id'],_0x356b22);OpenchannelMessageEvents['emit'](_0x3f7122,_0x356b22);_0x5a406e(null);};}for(var e in events){if(events[_0x15ce('0x7')](e)){var event=events[e];OpenchannelMessage[_0x15ce('0x8')](e,emitEvent(event));}}module[_0x15ce('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
index 0d50a57..6d78d88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe49c=['createdAt','catch','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','direction','toLowerCase','out','secret','UserId','findOne','OpenchannelInteractionId','then'];(function(_0x4bc57a,_0x58a6c2){var _0x1f2ead=function(_0x5df89f){while(--_0x5df89f){_0x4bc57a['push'](_0x4bc57a['shift']());}};_0x1f2ead(++_0x58a6c2);}(_0xe49c,0x1bd));var _0xce49=function(_0x4c7149,_0x335342){_0x4c7149=_0x4c7149-0x0;var _0x200122=_0xe49c[_0x4c7149];return _0x200122;};'use strict';var _=require(_0xce49('0x0'));var util=require(_0xce49('0x1'));var logger=require(_0xce49('0x2'))(_0xce49('0x3'));var moment=require(_0xce49('0x4'));var BPromise=require(_0xce49('0x5'));var rp=require(_0xce49('0x6'));var fs=require('fs');var path=require(_0xce49('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xce49('0x8'));module[_0xce49('0x9')]=function(_0x375801,_0x42ec10){return _0x375801[_0xce49('0xa')](_0xce49('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xce49('0xc'),'fields':[_0xce49('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a053b,_0x1a9628,_0x5adf41){var _0x9abf4=_0x375801[_0xce49('0xe')];var _0xf70710=_0x3a053b['get']({'plain':!![]});if(_0xf70710[_0xce49('0xf')][_0xce49('0x10')]()==='in'||_0xf70710[_0xce49('0xf')][_0xce49('0x10')]()===_0xce49('0x11')&&!_0xf70710[_0xce49('0x12')]&&!_['isNil'](_0xf70710[_0xce49('0x13')])){_0x9abf4['OpenchannelInteraction'][_0xce49('0x14')]({'where':{'id':_0xf70710[_0xce49('0x15')]}})[_0xce49('0x16')](function(_0x2646e7){if(_0x2646e7){_0x2646e7['update']({'lastMsgAt':_0xf70710[_0xce49('0x17')],'lastMsgDirection':_0xf70710[_0xce49('0xf')][_0xce49('0x10')]()});}})[_0xce49('0x18')](function(_0x4ef139){console['error'](_0x4ef139);});}if(_0xf70710['direction']===_0xce49('0x11')&&!_0xf70710[_0xce49('0x12')]){var _0x7e1787;_0x9abf4[_0xce49('0x19')][_0xce49('0x1a')]()[_0xce49('0x16')](function(_0x592c2e){return _0x9abf4['OpenchannelAccount'][_0xce49('0x1b')]({'where':{'id':_0xf70710[_0xce49('0x1c')]},'include':[{'model':_0x9abf4[_0xce49('0x1d')],'as':_0xce49('0x1e'),'where':{'id':_0xf70710['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x9abf4[_0xce49('0x19')],'as':_0xce49('0x1f'),'attributes':_[_0xce49('0x20')](_0x592c2e)}]}]});})[_0xce49('0x16')](function(_0x2f3ec1){_0x7e1787=_0x2f3ec1['get']({'plain':!![]});if(_0x7e1787&&_0x7e1787[_0xce49('0x21')]){logger['info'](_0xce49('0x22'),_0xce49('0x23'),util[_0xce49('0x24')](_0xce49('0x25'),_0xf70710['id'],_0x7e1787['replyUri']));if(_0x7e1787[_0xce49('0x1e')]&&_0x7e1787[_0xce49('0x1e')][_0xce49('0x26')]){_0xf70710[_0xce49('0x27')]=_[_0xce49('0x28')](_0x7e1787['Interactions'][0x0],_0xce49('0x1f'));_0xf70710[_0xce49('0x1f')]=_0x7e1787[_0xce49('0x1e')][0x0][_0xce49('0x1f')];}var _0x1a9628={'method':_0xce49('0x29'),'uri':encodeURI(_0x7e1787[_0xce49('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1a9628[_0xce49('0x2a')]){case _0xce49('0x2b'):_0x1a9628['qs']=_0xf70710;break;case'POST':_0x1a9628[_0xce49('0xd')]=_0xf70710;break;}return rp(_0x1a9628)[_0xce49('0x16')](function(_0x14dfc5){logger[_0xce49('0x2c')](_0xce49('0x22'),_0xce49('0x23'),util['format'](_0xce49('0x2d'),_0xf70710['id'],_0x7e1787[_0xce49('0x21')]));if(_0x14dfc5[_0xce49('0xd')][_0xce49('0x2e')]&&_0x14dfc5[_0xce49('0xd')][_0xce49('0x2e')]!=_0xf70710[_0xce49('0x27')][_0xce49('0x2e')]){return _0x9abf4[_0xce49('0x1d')][_0xce49('0x2f')]({'threadId':_0x14dfc5[_0xce49('0xd')][_0xce49('0x2e')]},{'where':{'id':_0xf70710[_0xce49('0x27')]['id']}});}else{return;}})['then'](function(){return _0x3a053b[_0xce49('0x2f')]({'read':!![]});})['catch'](function(_0x384e2b){logger[_0xce49('0x30')](_0xce49('0x22'),_0xce49('0x23'),util[_0xce49('0x31')](_0x384e2b,{'showHidden':![],'depth':null}));_0x5adf41();});}else{_0x5adf41();}})[_0xce49('0x32')](function(){_0x5adf41();});}else{_0x5adf41();}}},'charset':_0xce49('0x33'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2d68=['POST','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','error','out','secret','CmContact','find','OpenchannelAccountId','replyUri','info','afterCreate','Interactions','length','Interaction','Contact'];(function(_0x42ace1,_0x3556a9){var _0x1dc826=function(_0x467b98){while(--_0x467b98){_0x42ace1['push'](_0x42ace1['shift']());}};_0x1dc826(++_0x3556a9);}(_0x2d68,0x1ba));var _0x82d6=function(_0x7a2a2f,_0x26057a){_0x7a2a2f=_0x7a2a2f-0x0;var _0x4fbb2a=_0x2d68[_0x7a2a2f];return _0x4fbb2a;};'use strict';var _=require(_0x82d6('0x0'));var util=require('util');var logger=require(_0x82d6('0x1'))(_0x82d6('0x2'));var moment=require('moment');var BPromise=require(_0x82d6('0x3'));var rp=require(_0x82d6('0x4'));var fs=require('fs');var path=require(_0x82d6('0x5'));var rimraf=require(_0x82d6('0x6'));var config=require('../../config/environment');var attributes=require(_0x82d6('0x7'));module[_0x82d6('0x8')]=function(_0x380625,_0xfe6703){return _0x380625[_0x82d6('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x82d6('0xa'),'paranoid':![],'indexes':[{'name':_0x82d6('0xb'),'fields':[_0x82d6('0xc')],'type':_0x82d6('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4caab4,_0x294ebb,_0xfc3fe9){var _0x1330e8=_0x380625[_0x82d6('0xe')];var _0x414904=_0x4caab4[_0x82d6('0xf')]({'plain':!![]});if(_0x414904[_0x82d6('0x10')][_0x82d6('0x11')]()==='in'||_0x414904[_0x82d6('0x10')][_0x82d6('0x11')]()==='out'&&!_0x414904['secret']&&!_[_0x82d6('0x12')](_0x414904[_0x82d6('0x13')])){_0x1330e8[_0x82d6('0x14')][_0x82d6('0x15')]({'where':{'id':_0x414904[_0x82d6('0x16')]}})[_0x82d6('0x17')](function(_0x635b10){if(_0x635b10){_0x635b10['update']({'lastMsgAt':_0x414904[_0x82d6('0x18')],'lastMsgDirection':_0x414904['direction'][_0x82d6('0x11')]()});}})['catch'](function(_0x548796){console[_0x82d6('0x19')](_0x548796);});}if(_0x414904[_0x82d6('0x10')]===_0x82d6('0x1a')&&!_0x414904[_0x82d6('0x1b')]){var _0x3c0e4e;_0x1330e8[_0x82d6('0x1c')]['describe']()[_0x82d6('0x17')](function(_0x1186f2){return _0x1330e8['OpenchannelAccount'][_0x82d6('0x1d')]({'where':{'id':_0x414904[_0x82d6('0x1e')]},'include':[{'model':_0x1330e8[_0x82d6('0x14')],'as':'Interactions','where':{'id':_0x414904[_0x82d6('0x16')]},'limit':0x1,'include':[{'model':_0x1330e8[_0x82d6('0x1c')],'as':'Contact','attributes':_['keys'](_0x1186f2)}]}]});})[_0x82d6('0x17')](function(_0x389a14){_0x3c0e4e=_0x389a14[_0x82d6('0xf')]({'plain':!![]});if(_0x3c0e4e&&_0x3c0e4e[_0x82d6('0x1f')]){logger[_0x82d6('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x82d6('0x21'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x414904['id'],_0x3c0e4e[_0x82d6('0x1f')]));if(_0x3c0e4e['Interactions']&&_0x3c0e4e[_0x82d6('0x22')][_0x82d6('0x23')]){_0x414904[_0x82d6('0x24')]=_['omit'](_0x3c0e4e[_0x82d6('0x22')][0x0],_0x82d6('0x25'));_0x414904[_0x82d6('0x25')]=_0x3c0e4e[_0x82d6('0x22')][0x0][_0x82d6('0x25')];}var _0x294ebb={'method':_0x82d6('0x26'),'uri':encodeURI(_0x3c0e4e[_0x82d6('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x294ebb['method']){case _0x82d6('0x27'):_0x294ebb['qs']=_0x414904;break;case _0x82d6('0x26'):_0x294ebb[_0x82d6('0xc')]=_0x414904;break;}return rp(_0x294ebb)[_0x82d6('0x17')](function(_0x139af4){logger['info'](_0x82d6('0x28'),_0x82d6('0x21'),util[_0x82d6('0x29')](_0x82d6('0x2a'),_0x414904['id'],_0x3c0e4e['replyUri']));if(_0x139af4['body'][_0x82d6('0x2b')]&&_0x139af4[_0x82d6('0xc')][_0x82d6('0x2b')]!=_0x414904[_0x82d6('0x24')][_0x82d6('0x2b')]){return _0x1330e8[_0x82d6('0x14')]['update']({'threadId':_0x139af4[_0x82d6('0xc')][_0x82d6('0x2b')]},{'where':{'id':_0x414904['Interaction']['id']}});}else{return;}})[_0x82d6('0x17')](function(){return _0x4caab4['update']({'read':!![]});})[_0x82d6('0x2c')](function(_0x19ab81){logger[_0x82d6('0x19')](_0x82d6('0x28'),_0x82d6('0x21'),util[_0x82d6('0x2d')](_0x19ab81,{'showHidden':![],'depth':null}));_0xfc3fe9();});}else{_0xfc3fe9();}})['finally'](function(){_0xfc3fe9();});}else{_0xfc3fe9();}}},'charset':_0x82d6('0x2e'),'collate':_0x82d6('0x2f')});};
\ No newline at end of file
index 0bfca6c..1b3cfda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x184e13,_0x55bd33){var _0x1690e8=function(_0x12d1f8){while(--_0x12d1f8){_0x184e13['push'](_0x184e13['shift']());}};_0x1690e8(++_0x55bd33);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3f7d36,_0x1b1474){_0x3f7d36=_0x3f7d36-0x0;var _0x1d5259=_0x5f2f[_0x3f7d36];return _0x1d5259;};'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
+var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4593fc,_0xe9e3ed){var _0x2f7b3b=function(_0x20a051){while(--_0x20a051){_0x4593fc['push'](_0x4593fc['shift']());}};_0x2f7b3b(++_0xe9e3ed);}(_0x7a54,0x106));var _0x47a5=function(_0x8070ff,_0x439541){_0x8070ff=_0x8070ff-0x0;var _0x580e4a=_0x7a54[_0x8070ff];return _0x580e4a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});};
\ No newline at end of file
index d4bdce9..d1e3869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb07=['./openchannelMessage.events','save','remove','update','emit','removeListener','length','openchannelMessage:'];(function(_0x267798,_0x323d85){var _0x6e6842=function(_0x1ff066){while(--_0x1ff066){_0x267798['push'](_0x267798['shift']());}};_0x6e6842(++_0x323d85);}(_0xcb07,0x98));var _0x7cb0=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0xcb07[_0x3396cd];return _0x2d6b4a;};'use strict';var OpenchannelMessageEvents=require(_0x7cb0('0x0'));var events=[_0x7cb0('0x1'),_0x7cb0('0x2'),_0x7cb0('0x3')];function createListener(_0x282c97,_0x530c60){return function(_0x451e6f){_0x530c60[_0x7cb0('0x4')](_0x282c97,_0x451e6f);};}function removeListener(_0x1c1e4a,_0x4ce278){return function(){OpenchannelMessageEvents[_0x7cb0('0x5')](_0x1c1e4a,_0x4ce278);};}exports['register']=function(_0x22dfbb){for(var _0x3938a6=0x0,_0x573993=events[_0x7cb0('0x6')];_0x3938a6<_0x573993;_0x3938a6++){var _0x340a39=events[_0x3938a6];var _0x2cf7fd=createListener(_0x7cb0('0x7')+_0x340a39,_0x22dfbb);OpenchannelMessageEvents['on'](_0x340a39,_0x2cf7fd);}};
\ No newline at end of file
+var _0x97bf=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x274302,_0x4a60d4){var _0x16137b=function(_0x3d25e8){while(--_0x3d25e8){_0x274302['push'](_0x274302['shift']());}};_0x16137b(++_0x4a60d4);}(_0x97bf,0x188));var _0xf97b=function(_0x578b3b,_0x3b5f64){_0x578b3b=_0x578b3b-0x0;var _0x17c81a=_0x97bf[_0x578b3b];return _0x17c81a;};'use strict';var OpenchannelMessageEvents=require(_0xf97b('0x0'));var events=[_0xf97b('0x1'),_0xf97b('0x2'),_0xf97b('0x3')];function createListener(_0xb5d224,_0x2ae01f){return function(_0x98219e){_0x2ae01f[_0xf97b('0x4')](_0xb5d224,_0x98219e);};}function removeListener(_0x359faa,_0x54e661){return function(){OpenchannelMessageEvents[_0xf97b('0x5')](_0x359faa,_0x54e661);};}exports[_0xf97b('0x6')]=function(_0x55ad29){for(var _0x4f16fb=0x0,_0x522d6f=events[_0xf97b('0x7')];_0x4f16fb<_0x522d6f;_0x4f16fb++){var _0x1eda46=events[_0x4f16fb];var _0x47b588=createListener(_0xf97b('0x8')+_0x1eda46,_0x55ad29);OpenchannelMessageEvents['on'](_0x1eda46,_0x47b588);}};
\ No newline at end of file
index 58108e0..440fb5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa56=['isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get'];(function(_0x5a3198,_0xb974d8){var _0x31e587=function(_0x214279){while(--_0x214279){_0x5a3198['push'](_0x5a3198['shift']());}};_0x31e587(++_0xb974d8);}(_0xfa56,0x79));var _0x6fa5=function(_0x1b622a,_0x2dfa4b){_0x1b622a=_0x1b622a-0x0;var _0x24a849=_0xfa56[_0x1b622a];return _0x24a849;};'use strict';var multer=require(_0x6fa5('0x0'));var util=require('util');var path=require(_0x6fa5('0x1'));var timeout=require('connect-timeout');var express=require(_0x6fa5('0x2'));var router=express[_0x6fa5('0x3')]();var fs_extra=require(_0x6fa5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6fa5('0x5'));var config=require(_0x6fa5('0x6'));var controller=require(_0x6fa5('0x7'));router[_0x6fa5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6fa5('0x8')]('/describe',auth[_0x6fa5('0x9')](),controller[_0x6fa5('0xa')]);router[_0x6fa5('0x8')](_0x6fa5('0xb'),auth[_0x6fa5('0x9')](),controller[_0x6fa5('0xc')]);router[_0x6fa5('0x8')]('/:id/members',auth[_0x6fa5('0x9')](),controller[_0x6fa5('0xd')]);router[_0x6fa5('0x8')](_0x6fa5('0xe'),auth[_0x6fa5('0x9')](),controller[_0x6fa5('0xf')]);router[_0x6fa5('0x8')](_0x6fa5('0x10'),auth[_0x6fa5('0x9')](),controller[_0x6fa5('0x11')]);router[_0x6fa5('0x12')]('/',auth[_0x6fa5('0x9')](),controller['create']);router[_0x6fa5('0x12')](_0x6fa5('0xe'),auth[_0x6fa5('0x9')](),controller[_0x6fa5('0x13')]);router[_0x6fa5('0x12')](_0x6fa5('0x10'),auth['isAuthenticated'](),controller[_0x6fa5('0x14')]);router[_0x6fa5('0x15')](_0x6fa5('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6fa5('0xb'),auth[_0x6fa5('0x9')](),controller[_0x6fa5('0x16')]);router[_0x6fa5('0x17')](_0x6fa5('0xe'),auth[_0x6fa5('0x9')](),controller[_0x6fa5('0x18')]);router[_0x6fa5('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x6fa5('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x0766=['destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x0766,0x106));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6076('0x0'));var util=require(_0x6076('0x1'));var path=require(_0x6076('0x2'));var timeout=require('connect-timeout');var express=require(_0x6076('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6076('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6076('0x5'));var controller=require(_0x6076('0x6'));router[_0x6076('0x7')]('/',auth[_0x6076('0x8')](),controller[_0x6076('0x9')]);router[_0x6076('0x7')](_0x6076('0xa'),auth[_0x6076('0x8')](),controller['describe']);router[_0x6076('0x7')]('/:id',auth[_0x6076('0x8')](),controller['show']);router[_0x6076('0x7')](_0x6076('0xb'),auth['isAuthenticated'](),controller[_0x6076('0xc')]);router['get'](_0x6076('0xd'),auth[_0x6076('0x8')](),controller[_0x6076('0xe')]);router[_0x6076('0x7')](_0x6076('0xf'),auth[_0x6076('0x8')](),controller[_0x6076('0x10')]);router[_0x6076('0x11')]('/',auth[_0x6076('0x8')](),controller['create']);router[_0x6076('0x11')](_0x6076('0xd'),auth[_0x6076('0x8')](),controller[_0x6076('0x12')]);router['post'](_0x6076('0xf'),auth[_0x6076('0x8')](),controller[_0x6076('0x13')]);router[_0x6076('0x14')](_0x6076('0x15'),auth[_0x6076('0x8')](),controller[_0x6076('0x16')]);router[_0x6076('0x17')]('/:id',auth[_0x6076('0x8')](),controller[_0x6076('0x18')]);router['delete'](_0x6076('0xd'),auth[_0x6076('0x8')](),controller['removeTeams']);router[_0x6076('0x17')]('/:id/users',auth[_0x6076('0x8')](),controller['removeAgents']);module[_0x6076('0x19')]=router;
\ No newline at end of file
index bb8831f..8b0bcce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb93e=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xb93e,0xed));var _0xeb93=function(_0x5bdcb2,_0x5d79be){_0x5bdcb2=_0x5bdcb2-0x0;var _0x28d49f=_0xb93e[_0x5bdcb2];return _0x28d49f;};'use strict';var Sequelize=require(_0xeb93('0x0'));module[_0xeb93('0x1')]={'name':{'type':Sequelize[_0xeb93('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeb93('0x2')]},'timeout':{'type':Sequelize[_0xeb93('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeb93('0x4')](_0xeb93('0x5'),'beepall',_0xeb93('0x6'))}};
\ No newline at end of file
+var _0xa3c8=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x19a8d0,_0x22d91e){var _0x1e1dc8=function(_0x1acd88){while(--_0x1acd88){_0x19a8d0['push'](_0x19a8d0['shift']());}};_0x1e1dc8(++_0x22d91e);}(_0xa3c8,0x8e));var _0x8a3c=function(_0x29c359,_0x4debf2){_0x29c359=_0x29c359-0x0;var _0x2d785d=_0xa3c8[_0x29c359];return _0x2d785d;};'use strict';var Sequelize=require('sequelize');module[_0x8a3c('0x0')]={'name':{'type':Sequelize[_0x8a3c('0x1')],'unique':_0x8a3c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8a3c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8a3c('0x4')](_0x8a3c('0x5'),_0x8a3c('0x6'),_0x8a3c('0x7'))}};
\ No newline at end of file
index b2f562e..f544c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40fa=['SIP','createdAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','keys','filters','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','updatedAt','%s/%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x40fa,0x1c8));var _0xa40f=function(_0x35fd81,_0x4c488e){_0x35fd81=_0x35fd81-0x0;var _0x25b282=_0x40fa[_0x35fd81];return _0x25b282;};'use strict';var emlformat=require(_0xa40f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa40f('0x1'));var jsonpatch=require(_0xa40f('0x2'));var rp=require(_0xa40f('0x3'));var moment=require(_0xa40f('0x4'));var BPromise=require(_0xa40f('0x5'));var Mustache=require('mustache');var util=require(_0xa40f('0x6'));var path=require(_0xa40f('0x7'));var sox=require(_0xa40f('0x8'));var csv=require(_0xa40f('0x9'));var ejs=require(_0xa40f('0xa'));var fs=require('fs');var fs_extra=require(_0xa40f('0xb'));var _=require(_0xa40f('0xc'));var squel=require(_0xa40f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa40f('0x9'));var querystring=require(_0xa40f('0xe'));var Papa=require(_0xa40f('0xf'));var Redis=require(_0xa40f('0x10'));var authService=require(_0xa40f('0x11'));var qs=require(_0xa40f('0x12'));var as=require(_0xa40f('0x13'));var hardwareService=require(_0xa40f('0x14'));var logger=require(_0xa40f('0x15'))('api');var utils=require(_0xa40f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa40f('0x17'))['db'];config[_0xa40f('0x18')]=_[_0xa40f('0x19')](config[_0xa40f('0x18')],{'host':_0xa40f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa40f('0x1b'))[_0xa40f('0x1c')](socket);function respondWithStatusCode(_0x5c9524,_0x22a493){_0x22a493=_0x22a493||0xcc;return function(_0x24ddc5){if(_0x24ddc5){return _0x5c9524[_0xa40f('0x1d')](_0x22a493);}return _0x5c9524[_0xa40f('0x1e')](_0x22a493)['end']();};}function respondWithResult(_0x580f56,_0x206164){_0x206164=_0x206164||0xc8;return function(_0x5a6204){if(_0x5a6204){return _0x580f56[_0xa40f('0x1e')](_0x206164)['json'](_0x5a6204);}};}function respondWithFilteredResult(_0x50725d,_0x32cb80){return function(_0x30ea05){if(_0x30ea05){var _0x45f971=typeof _0x32cb80[_0xa40f('0x1f')]===_0xa40f('0x20')&&typeof _0x32cb80['limit']==='undefined';var _0x2f323a=_0x30ea05['count'];var _0x5da61d=_0x45f971?0x0:_0x32cb80[_0xa40f('0x1f')];var _0x41eaae=_0x45f971?_0x30ea05[_0xa40f('0x21')]:_0x32cb80[_0xa40f('0x1f')]+_0x32cb80[_0xa40f('0x22')];var _0x2c6ba3;if(_0x41eaae>=_0x2f323a){_0x41eaae=_0x2f323a;_0x2c6ba3=0xc8;}else{_0x2c6ba3=0xce;}_0x50725d[_0xa40f('0x1e')](_0x2c6ba3);return _0x50725d['set'](_0xa40f('0x23'),_0x5da61d+'-'+_0x41eaae+'/'+_0x2f323a)['json'](_0x30ea05);}return null;};}function patchUpdates(_0x388746){return function(_0x5a998e){try{jsonpatch[_0xa40f('0x24')](_0x5a998e,_0x388746,!![]);}catch(_0x15d44e){return BPromise[_0xa40f('0x25')](_0x15d44e);}return _0x5a998e[_0xa40f('0x26')]();};}function saveUpdates(_0x4d6fb9,_0x419bb1){return function(_0x291a25){if(_0x291a25){return _0x291a25[_0xa40f('0x27')](_0x4d6fb9)[_0xa40f('0x28')](function(_0x1000ef){return _0x1000ef;});}return null;};}function removeEntity(_0xead7c1,_0x4ac487){return function(_0x4347e2){if(_0x4347e2){return _0x4347e2[_0xa40f('0x29')]()[_0xa40f('0x28')](function(){var _0x1a089d=_0x4347e2[_0xa40f('0x2a')]({'plain':!![]});var _0x545849=_0xa40f('0x2b');return db[_0xa40f('0x2c')][_0xa40f('0x29')]({'where':{'type':_0x545849,'resourceId':_0x1a089d['id']}})[_0xa40f('0x28')](function(){return _0x4347e2;});})[_0xa40f('0x28')](function(){_0xead7c1[_0xa40f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e9e6,_0x340b61){return function(_0x543107){if(!_0x543107){_0x45e9e6[_0xa40f('0x1d')](0x194);}return _0x543107;};}function handleError(_0x1fb087,_0x4c2e88){_0x4c2e88=_0x4c2e88||0x1f4;return function(_0xbd9734){logger[_0xa40f('0x2d')](_0xbd9734[_0xa40f('0x2e')]);if(_0xbd9734[_0xa40f('0x2f')]){delete _0xbd9734[_0xa40f('0x2f')];}_0x1fb087[_0xa40f('0x1e')](_0x4c2e88)['send'](_0xbd9734);};}exports['index']=function(_0x4858eb,_0x436120){var _0x13faa2={},_0x257a2d={},_0x42fe2b={'count':0x0,'rows':[]};var _0x29ca6f=_[_0xa40f('0x30')](db[_0xa40f('0x31')][_0xa40f('0x32')],function(_0x437ae4){return{'name':_0x437ae4[_0xa40f('0x33')],'type':_0x437ae4[_0xa40f('0x34')]['key']};});_0x257a2d[_0xa40f('0x35')]=_['map'](_0x29ca6f,_0xa40f('0x2f'));_0x257a2d['query']=_['keys'](_0x4858eb[_0xa40f('0x36')]);_0x257a2d['filters']=_[_0xa40f('0x37')](_0x257a2d['model'],_0x257a2d[_0xa40f('0x36')]);_0x13faa2[_0xa40f('0x38')]=_['intersection'](_0x257a2d[_0xa40f('0x35')],qs['fields'](_0x4858eb[_0xa40f('0x36')][_0xa40f('0x39')]));_0x13faa2['attributes']=_0x13faa2[_0xa40f('0x38')][_0xa40f('0x3a')]?_0x13faa2['attributes']:_0x257a2d[_0xa40f('0x35')];if(!_0x4858eb[_0xa40f('0x36')][_0xa40f('0x3b')](_0xa40f('0x3c'))){_0x13faa2['limit']=qs[_0xa40f('0x22')](_0x4858eb[_0xa40f('0x36')]['limit']);_0x13faa2['offset']=qs['offset'](_0x4858eb['query']['offset']);}_0x13faa2[_0xa40f('0x3d')]=qs['sort'](_0x4858eb['query'][_0xa40f('0x3e')]);_0x13faa2[_0xa40f('0x3f')]=qs['filters'](_[_0xa40f('0x40')](_0x4858eb[_0xa40f('0x36')],_0x257a2d['filters']),_0x29ca6f);if(_0x4858eb[_0xa40f('0x36')]['filter']){_0x13faa2[_0xa40f('0x3f')]=_[_0xa40f('0x41')](_0x13faa2['where'],{'$or':_[_0xa40f('0x30')](_0x29ca6f,function(_0xbd92bf){if(_0xbd92bf['type']!=='VIRTUAL'){var _0x210f96={};_0x210f96[_0xbd92bf['name']]={'$like':'%'+_0x4858eb[_0xa40f('0x36')][_0xa40f('0x42')]+'%'};return _0x210f96;}})});}_0x13faa2=_[_0xa40f('0x41')]({},_0x13faa2,_0x4858eb[_0xa40f('0x43')]);var _0x24bd97={'where':_0x13faa2[_0xa40f('0x3f')]};return db[_0xa40f('0x31')][_0xa40f('0x21')](_0x24bd97)['then'](function(_0x29ec73){_0x42fe2b[_0xa40f('0x21')]=_0x29ec73;if(_0x4858eb[_0xa40f('0x36')][_0xa40f('0x44')]){_0x13faa2['include']=[{'all':!![]}];}return db[_0xa40f('0x31')][_0xa40f('0x45')](_0x13faa2);})['then'](function(_0x4ea746){_0x42fe2b[_0xa40f('0x46')]=_0x4ea746;return _0x42fe2b;})['then'](respondWithFilteredResult(_0x436120,_0x13faa2))[_0xa40f('0x47')](handleError(_0x436120,null));};exports[_0xa40f('0x48')]=function(_0x18c3a4,_0x5adf9e){var _0x23d2cc={'raw':!![],'where':{'id':_0x18c3a4[_0xa40f('0x49')]['id']}},_0x1fbd98={};_0x1fbd98[_0xa40f('0x35')]=_[_0xa40f('0x4a')](db['OpenchannelQueue'][_0xa40f('0x32')]);_0x1fbd98[_0xa40f('0x36')]=_[_0xa40f('0x4a')](_0x18c3a4[_0xa40f('0x36')]);_0x1fbd98[_0xa40f('0x4b')]=_[_0xa40f('0x37')](_0x1fbd98[_0xa40f('0x35')],_0x1fbd98['query']);_0x23d2cc[_0xa40f('0x38')]=_[_0xa40f('0x37')](_0x1fbd98['model'],qs[_0xa40f('0x39')](_0x18c3a4['query'][_0xa40f('0x39')]));_0x23d2cc[_0xa40f('0x38')]=_0x23d2cc[_0xa40f('0x38')][_0xa40f('0x3a')]?_0x23d2cc[_0xa40f('0x38')]:_0x1fbd98[_0xa40f('0x35')];if(_0x18c3a4[_0xa40f('0x36')][_0xa40f('0x44')]){_0x23d2cc[_0xa40f('0x4c')]=[{'all':!![]}];}_0x23d2cc=_['merge']({},_0x23d2cc,_0x18c3a4[_0xa40f('0x43')]);return db[_0xa40f('0x31')][_0xa40f('0x4d')](_0x23d2cc)[_0xa40f('0x28')](handleEntityNotFound(_0x5adf9e,null))[_0xa40f('0x28')](respondWithResult(_0x5adf9e,null))['catch'](handleError(_0x5adf9e,null));};exports['create']=function(_0x54c9ff,_0x3d9180){return db[_0xa40f('0x31')][_0xa40f('0x4e')](_0x54c9ff['body'],{})[_0xa40f('0x28')](function(_0x3a854e){var _0x563d7e=_0x54c9ff[_0xa40f('0x4f')][_0xa40f('0x2a')]({'plain':!![]});if(!_0x563d7e)throw new Error(_0xa40f('0x50'));if(_0x563d7e[_0xa40f('0x51')]===_0xa40f('0x4f')){var _0x115803=_0x3a854e[_0xa40f('0x2a')]({'plain':!![]});var _0x368cd5=_0xa40f('0x2b');return db[_0xa40f('0x52')][_0xa40f('0x4d')]({'where':{'name':_0x368cd5,'userProfileId':_0x563d7e[_0xa40f('0x53')]},'raw':!![]})[_0xa40f('0x28')](function(_0x2fb89e){if(_0x2fb89e&&_0x2fb89e[_0xa40f('0x54')]===0x0){return db['UserProfileResource'][_0xa40f('0x4e')]({'name':_0x115803['name'],'resourceId':_0x115803['id'],'type':_0x2fb89e[_0xa40f('0x2f')],'sectionId':_0x2fb89e['id']},{})[_0xa40f('0x28')](function(){return _0x3a854e;});}else{return _0x3a854e;}})['catch'](function(_0xc2f99a){logger[_0xa40f('0x2d')](_0xa40f('0x55'),_0xc2f99a);throw _0xc2f99a;});}return _0x3a854e;})[_0xa40f('0x28')](respondWithResult(_0x3d9180,0xc9))[_0xa40f('0x47')](handleError(_0x3d9180,null));};exports[_0xa40f('0x27')]=function(_0x480e4b,_0x2a6b44){if(_0x480e4b['body']['id']){delete _0x480e4b[_0xa40f('0x56')]['id'];}return db[_0xa40f('0x31')][_0xa40f('0x4d')]({'where':{'id':_0x480e4b[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](handleEntityNotFound(_0x2a6b44,null))[_0xa40f('0x28')](saveUpdates(_0x480e4b['body'],null))[_0xa40f('0x28')](respondWithResult(_0x2a6b44,null))[_0xa40f('0x47')](handleError(_0x2a6b44,null));};exports[_0xa40f('0x29')]=function(_0x13519a,_0x17d8aa){return db[_0xa40f('0x31')][_0xa40f('0x4d')]({'where':{'id':_0x13519a[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](handleEntityNotFound(_0x17d8aa,null))[_0xa40f('0x28')](removeEntity(_0x17d8aa,null))[_0xa40f('0x47')](handleError(_0x17d8aa,null));};exports['describe']=function(_0x530f53,_0x330ab5){return db[_0xa40f('0x31')][_0xa40f('0x57')]()[_0xa40f('0x28')](respondWithResult(_0x330ab5,null))[_0xa40f('0x47')](handleError(_0x330ab5,null));};exports['getMembers']=function(_0x1f57f8,_0x393577,_0x2f1af2){var _0x507f61={'raw':!![],'where':{}},_0x11d913={},_0x554766;return db[_0xa40f('0x31')][_0xa40f('0x58')]({'where':{'id':_0x1f57f8[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](handleEntityNotFound(_0x393577,null))['then'](function(_0x157ca2){if(_0x157ca2){_0x554766=_0x157ca2[_0xa40f('0x2a')]({'plain':!![]});_0x11d913[_0xa40f('0x35')]=_[_0xa40f('0x4a')](db[_0xa40f('0x59')]['rawAttributes']);_0x11d913[_0xa40f('0x36')]=_[_0xa40f('0x4a')](_0x1f57f8['query']);_0x11d913[_0xa40f('0x4b')]=_[_0xa40f('0x37')](_0x11d913[_0xa40f('0x35')],_0x11d913[_0xa40f('0x36')]);_0x507f61[_0xa40f('0x38')]=_[_0xa40f('0x37')](_0x11d913['model'],qs[_0xa40f('0x39')](_0x1f57f8['query'][_0xa40f('0x39')]));_0x507f61['attributes']=_0x507f61[_0xa40f('0x38')][_0xa40f('0x3a')]?_0x507f61[_0xa40f('0x38')]:_0x11d913['model'];if(!_0x1f57f8[_0xa40f('0x36')]['hasOwnProperty'](_0xa40f('0x3c'))){_0x507f61[_0xa40f('0x22')]=qs[_0xa40f('0x22')](_0x1f57f8[_0xa40f('0x36')]['limit']);_0x507f61[_0xa40f('0x1f')]=qs['offset'](_0x1f57f8[_0xa40f('0x36')][_0xa40f('0x1f')]);}_0x507f61[_0xa40f('0x3d')]=qs[_0xa40f('0x3e')](_0x1f57f8[_0xa40f('0x36')]['sort']);_0x507f61[_0xa40f('0x3f')]=qs[_0xa40f('0x4b')](_[_0xa40f('0x40')](_0x1f57f8['query'],_0x11d913[_0xa40f('0x4b')]));_0x507f61['where']['OpenchannelQueueId']=_0x157ca2['id'];if(_0x1f57f8[_0xa40f('0x36')]['filter']){_0x507f61[_0xa40f('0x3f')]=_[_0xa40f('0x41')](_0x507f61[_0xa40f('0x3f')],{'$or':_[_0xa40f('0x30')](_0x507f61[_0xa40f('0x38')],function(_0x124f70){var _0x2794e3={};_0x2794e3[_0x124f70]={'$like':'%'+_0x1f57f8[_0xa40f('0x36')][_0xa40f('0x42')]+'%'};return _0x2794e3;})});}_0x507f61=_['merge']({},_0x507f61,_0x1f57f8[_0xa40f('0x43')]);return db['UserOpenchannelQueue'][_0xa40f('0x45')](_0x507f61);}})['then'](function(_0x37b30d){if(_0x37b30d){return db['User'][_0xa40f('0x5a')]({'where':{'id':_[_0xa40f('0x30')](_0x37b30d,_0xa40f('0x5b')),'role':_0xa40f('0x5c')},'attributes':['id',_0xa40f('0x2f'),_0xa40f('0x5d'),_0xa40f('0x5e'),'createdAt']});}})[_0xa40f('0x28')](function(_0x2ba0fb){if(_0x2ba0fb){return{'count':_0x2ba0fb['count'],'rows':_[_0xa40f('0x30')](_0x2ba0fb[_0xa40f('0x46')],function(_0x35c731){return{'membername':_0x35c731[_0xa40f('0x2f')],'UserId':_0x35c731['id'],'queue_name':_0x554766[_0xa40f('0x2f')],'OpenchannelQueueId':_0x554766['id'],'interface':util['format'](_0xa40f('0x5f'),_0xa40f('0x60'),_0x35c731[_0xa40f('0x2f')]),'penalty':0x0,'paused':_0x35c731[_0xa40f('0x5d')],'createdAt':_0x35c731[_0xa40f('0x61')],'updatedAt':_0x35c731[_0xa40f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa40f('0x28')](respondWithFilteredResult(_0x393577,_0x507f61))[_0xa40f('0x47')](handleError(_0x393577,null));};exports['getTeams']=function(_0xfd15b1,_0x4d16d2,_0x28dcce){var _0x30ecf2={};var _0x143ec1={};var _0x313fc3;var _0x3dcd40;return db['OpenchannelQueue'][_0xa40f('0x58')]({'where':{'id':_0xfd15b1[_0xa40f('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d16d2,null))['then'](function(_0x43107e){if(_0x43107e){_0x313fc3=_0x43107e;_0x143ec1[_0xa40f('0x35')]=_[_0xa40f('0x4a')](db[_0xa40f('0x62')]['rawAttributes']);_0x143ec1['query']=_[_0xa40f('0x4a')](_0xfd15b1['query']);_0x143ec1['filters']=_[_0xa40f('0x37')](_0x143ec1['model'],_0x143ec1[_0xa40f('0x36')]);_0x30ecf2[_0xa40f('0x38')]=_['intersection'](_0x143ec1[_0xa40f('0x35')],qs[_0xa40f('0x39')](_0xfd15b1[_0xa40f('0x36')][_0xa40f('0x39')]));_0x30ecf2[_0xa40f('0x38')]=_0x30ecf2[_0xa40f('0x38')][_0xa40f('0x3a')]?_0x30ecf2[_0xa40f('0x38')]:_0x143ec1[_0xa40f('0x35')];_0x30ecf2[_0xa40f('0x3d')]=qs['sort'](_0xfd15b1['query']['sort']);_0x30ecf2[_0xa40f('0x3f')]=qs[_0xa40f('0x4b')](_[_0xa40f('0x40')](_0xfd15b1[_0xa40f('0x36')],_0x143ec1[_0xa40f('0x4b')]));if(_0xfd15b1[_0xa40f('0x36')][_0xa40f('0x42')]){_0x30ecf2[_0xa40f('0x3f')]=_[_0xa40f('0x41')](_0x30ecf2[_0xa40f('0x3f')],{'$or':_['map'](_0x30ecf2['attributes'],function(_0x46664c){var _0x4c2e47={};_0x4c2e47[_0x46664c]={'$like':'%'+_0xfd15b1[_0xa40f('0x36')][_0xa40f('0x42')]+'%'};return _0x4c2e47;})});}_0x30ecf2=_['merge']({},_0x30ecf2,_0xfd15b1[_0xa40f('0x43')]);return _0x313fc3[_0xa40f('0x63')](_0x30ecf2);}})[_0xa40f('0x28')](function(_0x4ef877){if(_0x4ef877){_0x3dcd40=_0x4ef877['length'];if(!_0xfd15b1[_0xa40f('0x36')][_0xa40f('0x3b')](_0xa40f('0x3c'))){_0x30ecf2[_0xa40f('0x22')]=qs[_0xa40f('0x22')](_0xfd15b1[_0xa40f('0x36')]['limit']);_0x30ecf2[_0xa40f('0x1f')]=qs[_0xa40f('0x1f')](_0xfd15b1[_0xa40f('0x36')][_0xa40f('0x1f')]);}return _0x313fc3[_0xa40f('0x63')](_0x30ecf2);}})[_0xa40f('0x28')](function(_0x5dd83c){if(_0x5dd83c){return _0x5dd83c?{'count':_0x3dcd40,'rows':_0x5dd83c}:null;}})[_0xa40f('0x28')](respondWithResult(_0x4d16d2,null))['catch'](handleError(_0x4d16d2,null));};exports[_0xa40f('0x64')]=function(_0x34ab71,_0x6ad03b,_0xba78a5){var _0x2d22a9=_0x34ab71[_0xa40f('0x56')][_0xa40f('0x65')];return db[_0xa40f('0x62')][_0xa40f('0x45')]({'where':{'id':_0x2d22a9},'attributes':['id'],'include':[{'model':db[_0xa40f('0x66')],'as':_0xa40f('0x67'),'attributes':['id','name',_0xa40f('0x68'),_0xa40f('0x69'),_0xa40f('0x6a')],'raw':!![]}]})[_0xa40f('0x28')](function(_0x20373f){if(_0x20373f){var _0x1e32f2=_[_0xa40f('0x6b')](_0x20373f,function(_0x5cd555){var _0x214998=_0x5cd555[_0xa40f('0x2a')]({'plain':!![]});return _0x214998[_0xa40f('0x67')];});return db[_0xa40f('0x31')][_0xa40f('0x4d')]({'where':{'id':_0x34ab71[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](function(_0x2678b2){return db[_0xa40f('0x6c')][_0xa40f('0x6d')](function(_0x1f8490){return _0x2678b2[_0xa40f('0x64')](_0x2d22a9,{'transaction':_0x1f8490})[_0xa40f('0x28')](function(){return BPromise[_0xa40f('0x6e')](_0x1e32f2,function(_0x594f85){return db[_0xa40f('0x59')]['findOrCreate']({'where':{'UserId':_0x594f85['id'],'OpenchannelQueueId':_0x34ab71['params']['id']},'transaction':_0x1f8490});});})[_0xa40f('0x28')](function(){_0x1e32f2[_0xa40f('0x6f')](function(_0xb2c36a){socket[_0xa40f('0x70')](_0xa40f('0x71'),{'UserId':_0xb2c36a['id'],'OpenchannelQueueId':_0x2678b2['id']});});});});});}})['then'](respondWithStatusCode(_0x6ad03b,null))[_0xa40f('0x47')](handleError(_0x6ad03b,null));};exports[_0xa40f('0x72')]=function(_0x1f201a,_0x2e5150,_0x309c9a){return db[_0xa40f('0x62')][_0xa40f('0x45')]({'where':{'id':_0x1f201a['query'][_0xa40f('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa40f('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa40f('0x28')](handleEntityNotFound(_0x2e5150,null))[_0xa40f('0x28')](function(_0x4d1602){var _0x1a1fa8=_[_0xa40f('0x30')](_0x4d1602,'id');var _0x2fc638=[];var _0xa2e83e=[];var _0xd04988=squel[_0xa40f('0x73')]();_0xd04988[_0xa40f('0x74')](_0xa40f('0x75'))[_0xa40f('0x76')](_0xa40f('0x77'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa40f('0x3f')](_0xa40f('0x78'),_0x1f201a[_0xa40f('0x49')]['id']);for(var _0xc3b26a=0x0;_0xc3b26a<_0x4d1602[_0xa40f('0x3a')];_0xc3b26a+=0x1){let _0x3bea88=_0x4d1602[_0xc3b26a];for(var _0x4378b7=0x0;_0x4378b7<_0x3bea88[_0xa40f('0x67')][_0xa40f('0x3a')];_0x4378b7+=0x1){let _0x4d66dd=_0x3bea88[_0xa40f('0x67')][_0x4378b7];var _0xa5821c=_0xd04988[_0xa40f('0x79')]();_0xa5821c[_0xa40f('0x3f')](_0xa40f('0x7a'),_0x4d66dd['id']);_0xa2e83e[_0xa40f('0x7b')](db[_0xa40f('0x6c')][_0xa40f('0x36')](_0xa5821c['toString'](),{'type':db[_0xa40f('0x6c')]['QueryTypes'][_0xa40f('0x7c')]})[_0xa40f('0x28')](function(_0x3ada02){if(_0x3ada02[_0xa40f('0x3a')]===0x1){return _0x4d66dd['id'];}else{var _0x5085c1=_[_0xa40f('0x7d')](_[_0xa40f('0x30')](_0x3ada02,_0xa40f('0x7e')),function(_0x532fe3){return _['includes'](_0x1a1fa8,_0x532fe3);});if(_0x5085c1){return _0x4d66dd['id'];}}}));}}return BPromise[_0xa40f('0x7f')](_0xa2e83e)['then'](function(_0x52ef93){_0x2fc638=_(_0x2fc638)[_0xa40f('0x80')](_0x52ef93)[_0xa40f('0x81')]()[_0xa40f('0x82')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x1f201a[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](function(_0x10532b){return db[_0xa40f('0x6c')][_0xa40f('0x6d')](function(_0x4e7fef){return _0x10532b[_0xa40f('0x72')](_0x1f201a[_0xa40f('0x36')][_0xa40f('0x65')],{'transaction':_0x4e7fef})[_0xa40f('0x28')](function(){if(!_[_0xa40f('0x83')](_0x2fc638)){return _0x10532b['removeAgents'](_0x2fc638,{'transaction':_0x4e7fef});}})['then'](function(){_0x2fc638[_0xa40f('0x6f')](function(_0x426b53){socket[_0xa40f('0x70')]('userOpenchannelQueue:remove',{'UserId':_0x426b53,'OpenchannelQueueId':_0x10532b['id']});});});});});});})['then'](respondWithStatusCode(_0x2e5150,null))[_0xa40f('0x47')](handleError(_0x2e5150,null));};exports[_0xa40f('0x84')]=function(_0xc05ac,_0x205540,_0xc85278){return db[_0xa40f('0x31')][_0xa40f('0x4d')]({'where':{'id':_0xc05ac[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](handleEntityNotFound(_0x205540,null))[_0xa40f('0x28')](function(_0x5c08c3){if(_0x5c08c3){return _0x5c08c3['addAgents'](_0xc05ac[_0xa40f('0x56')][_0xa40f('0x65')],_[_0xa40f('0x85')](_0xc05ac[_0xa40f('0x56')],[_0xa40f('0x65'),'id'])||{})['spread'](function(_0x67a485){for(var _0x4a7e77=0x0;_0x4a7e77<_0xc05ac[_0xa40f('0x56')][_0xa40f('0x65')][_0xa40f('0x3a')];_0x4a7e77+=0x1){socket['emit'](_0xa40f('0x71'),{'UserId':Number(_0xc05ac[_0xa40f('0x56')][_0xa40f('0x65')][_0x4a7e77]),'OpenchannelQueueId':Number(_0xc05ac[_0xa40f('0x49')]['id'])});}return _0x67a485;});}})[_0xa40f('0x28')](respondWithResult(_0x205540,null))[_0xa40f('0x47')](handleError(_0x205540,null));};exports[_0xa40f('0x86')]=function(_0x5c3c89,_0x5bc546,_0x2131af){return db[_0xa40f('0x31')][_0xa40f('0x4d')]({'where':{'id':_0x5c3c89[_0xa40f('0x49')]['id']}})[_0xa40f('0x28')](handleEntityNotFound(_0x5bc546,null))[_0xa40f('0x28')](function(_0x2399ae){if(_0x2399ae){return _0x2399ae[_0xa40f('0x86')](_0x5c3c89['query'][_0xa40f('0x65')])['then'](function(){if(_[_0xa40f('0x87')](_0x5c3c89[_0xa40f('0x36')][_0xa40f('0x65')])){for(var _0xc09cd2=0x0;_0xc09cd2<_0x5c3c89[_0xa40f('0x36')][_0xa40f('0x65')]['length'];_0xc09cd2+=0x1){socket[_0xa40f('0x70')](_0xa40f('0x88'),{'UserId':Number(_0x5c3c89[_0xa40f('0x36')][_0xa40f('0x65')][_0xc09cd2]),'OpenchannelQueueId':Number(_0x5c3c89['params']['id'])});}}else{socket[_0xa40f('0x70')](_0xa40f('0x88'),{'UserId':Number(_0x5c3c89['query'][_0xa40f('0x65')]),'OpenchannelQueueId':Number(_0x5c3c89[_0xa40f('0x49')]['id'])});}});}})[_0xa40f('0x28')](respondWithStatusCode(_0x5bc546,null))['catch'](handleError(_0x5bc546,null));};exports[_0xa40f('0x89')]=function(_0x25f557,_0x35a21f,_0x592fba){var _0x60593d={};var _0x8db1e2={};var _0x143872;var _0x127f4b;return db[_0xa40f('0x31')][_0xa40f('0x58')]({'where':{'id':_0x25f557[_0xa40f('0x49')]['id']}})['then'](handleEntityNotFound(_0x35a21f,null))['then'](function(_0x3d45ac){if(_0x3d45ac){_0x143872=_0x3d45ac;_0x8db1e2[_0xa40f('0x35')]=_[_0xa40f('0x4a')](db['User']['rawAttributes']);_0x8db1e2[_0xa40f('0x36')]=_[_0xa40f('0x4a')](_0x25f557[_0xa40f('0x36')]);_0x8db1e2[_0xa40f('0x4b')]=_[_0xa40f('0x37')](_0x8db1e2['model'],_0x8db1e2['query']);_0x60593d['attributes']=_[_0xa40f('0x37')](_0x8db1e2['model'],qs[_0xa40f('0x39')](_0x25f557[_0xa40f('0x36')][_0xa40f('0x39')]));_0x60593d[_0xa40f('0x38')]=_0x60593d[_0xa40f('0x38')][_0xa40f('0x3a')]?_0x60593d[_0xa40f('0x38')]:_0x8db1e2['model'];_0x60593d[_0xa40f('0x3d')]=qs[_0xa40f('0x3e')](_0x25f557[_0xa40f('0x36')][_0xa40f('0x3e')]);_0x60593d[_0xa40f('0x3f')]=qs[_0xa40f('0x4b')](_[_0xa40f('0x40')](_0x25f557[_0xa40f('0x36')],_0x8db1e2[_0xa40f('0x4b')]));if(_0x25f557[_0xa40f('0x36')][_0xa40f('0x42')]){_0x60593d[_0xa40f('0x3f')]=_[_0xa40f('0x41')](_0x60593d[_0xa40f('0x3f')],{'$or':_[_0xa40f('0x30')](_0x60593d[_0xa40f('0x38')],function(_0x196f1c){var _0x5bcff7={};_0x5bcff7[_0x196f1c]={'$like':'%'+_0x25f557[_0xa40f('0x36')][_0xa40f('0x42')]+'%'};return _0x5bcff7;})});}_0x60593d=_[_0xa40f('0x41')]({},_0x60593d,_0x25f557[_0xa40f('0x43')]);return _0x143872[_0xa40f('0x89')](_0x60593d);}})[_0xa40f('0x28')](function(_0x1802ac){if(_0x1802ac){_0x127f4b=_0x1802ac[_0xa40f('0x3a')];if(!_0x25f557[_0xa40f('0x36')][_0xa40f('0x3b')](_0xa40f('0x3c'))){_0x60593d[_0xa40f('0x22')]=qs[_0xa40f('0x22')](_0x25f557[_0xa40f('0x36')][_0xa40f('0x22')]);_0x60593d[_0xa40f('0x1f')]=qs['offset'](_0x25f557[_0xa40f('0x36')][_0xa40f('0x1f')]);}return _0x143872[_0xa40f('0x89')](_0x60593d);}})[_0xa40f('0x28')](function(_0x3aa86b){if(_0x3aa86b){return _0x3aa86b?{'count':_0x127f4b,'rows':_0x3aa86b}:null;}})['then'](respondWithResult(_0x35a21f,null))['catch'](handleError(_0x35a21f,null));};
\ No newline at end of file
+var _0x5e80=['findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','transaction','each','emit','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','params','OpenchannelQueueId','User'];(function(_0x1408b4,_0x22e866){var _0x39276b=function(_0x5d7918){while(--_0x5d7918){_0x1408b4['push'](_0x1408b4['shift']());}};_0x39276b(++_0x22e866);}(_0x5e80,0xba));var _0x05e8=function(_0x43d00f,_0x3636d7){_0x43d00f=_0x43d00f-0x0;var _0x27103d=_0x5e80[_0x43d00f];return _0x27103d;};'use strict';var emlformat=require(_0x05e8('0x0'));var rimraf=require(_0x05e8('0x1'));var zipdir=require(_0x05e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05e8('0x3'));var moment=require(_0x05e8('0x4'));var BPromise=require(_0x05e8('0x5'));var Mustache=require(_0x05e8('0x6'));var util=require('util');var path=require(_0x05e8('0x7'));var sox=require(_0x05e8('0x8'));var csv=require(_0x05e8('0x9'));var ejs=require(_0x05e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05e8('0xb'));var squel=require(_0x05e8('0xc'));var crypto=require('crypto');var jsforce=require(_0x05e8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x05e8('0x9'));var querystring=require('querystring');var Papa=require(_0x05e8('0xe'));var Redis=require('ioredis');var authService=require(_0x05e8('0xf'));var qs=require(_0x05e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05e8('0x11'));var logger=require(_0x05e8('0x12'))(_0x05e8('0x13'));var utils=require(_0x05e8('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x05e8('0x15'))['db'];config['redis']=_[_0x05e8('0x16')](config[_0x05e8('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x05e8('0x18'))(new Redis(config[_0x05e8('0x17')]));require(_0x05e8('0x19'))[_0x05e8('0x1a')](socket);function respondWithStatusCode(_0x2c7881,_0x4784bc){_0x4784bc=_0x4784bc||0xcc;return function(_0x159a1f){if(_0x159a1f){return _0x2c7881[_0x05e8('0x1b')](_0x4784bc);}return _0x2c7881[_0x05e8('0x1c')](_0x4784bc)[_0x05e8('0x1d')]();};}function respondWithResult(_0xd27927,_0x4775a3){_0x4775a3=_0x4775a3||0xc8;return function(_0x32798d){if(_0x32798d){return _0xd27927[_0x05e8('0x1c')](_0x4775a3)[_0x05e8('0x1e')](_0x32798d);}};}function respondWithFilteredResult(_0x45fde7,_0x3f9f34){return function(_0x2aa1bd){if(_0x2aa1bd){var _0x2cbf12=typeof _0x3f9f34['offset']===_0x05e8('0x1f')&&typeof _0x3f9f34[_0x05e8('0x20')]===_0x05e8('0x1f');var _0x468830=_0x2aa1bd[_0x05e8('0x21')];var _0x2ccee4=_0x2cbf12?0x0:_0x3f9f34['offset'];var _0x10a248=_0x2cbf12?_0x2aa1bd[_0x05e8('0x21')]:_0x3f9f34['offset']+_0x3f9f34[_0x05e8('0x20')];var _0x4ad82b;if(_0x10a248>=_0x468830){_0x10a248=_0x468830;_0x4ad82b=0xc8;}else{_0x4ad82b=0xce;}_0x45fde7[_0x05e8('0x1c')](_0x4ad82b);return _0x45fde7[_0x05e8('0x22')](_0x05e8('0x23'),_0x2ccee4+'-'+_0x10a248+'/'+_0x468830)[_0x05e8('0x1e')](_0x2aa1bd);}return null;};}function patchUpdates(_0x2eff27){return function(_0x54bd33){try{jsonpatch[_0x05e8('0x24')](_0x54bd33,_0x2eff27,!![]);}catch(_0x3e8ad8){return BPromise[_0x05e8('0x25')](_0x3e8ad8);}return _0x54bd33['save']();};}function saveUpdates(_0x433cf3,_0x2b32e7){return function(_0x43492c){if(_0x43492c){return _0x43492c[_0x05e8('0x26')](_0x433cf3)[_0x05e8('0x27')](function(_0x238f5e){return _0x238f5e;});}return null;};}function removeEntity(_0x4c7c59,_0x5f1171){return function(_0x3770fd){if(_0x3770fd){return _0x3770fd[_0x05e8('0x28')]()[_0x05e8('0x27')](function(){var _0x1ca3a3=_0x3770fd['get']({'plain':!![]});var _0x2d70f2=_0x05e8('0x29');return db[_0x05e8('0x2a')][_0x05e8('0x28')]({'where':{'type':_0x2d70f2,'resourceId':_0x1ca3a3['id']}})[_0x05e8('0x27')](function(){return _0x3770fd;});})[_0x05e8('0x27')](function(){_0x4c7c59[_0x05e8('0x1c')](0xcc)[_0x05e8('0x1d')]();});}};}function handleEntityNotFound(_0x261082,_0x40a5f5){return function(_0x540398){if(!_0x540398){_0x261082[_0x05e8('0x1b')](0x194);}return _0x540398;};}function handleError(_0x260d1f,_0x17ceda){_0x17ceda=_0x17ceda||0x1f4;return function(_0xf5ab06){logger[_0x05e8('0x2b')](_0xf5ab06[_0x05e8('0x2c')]);if(_0xf5ab06['name']){delete _0xf5ab06[_0x05e8('0x2d')];}_0x260d1f[_0x05e8('0x1c')](_0x17ceda)[_0x05e8('0x2e')](_0xf5ab06);};}exports[_0x05e8('0x2f')]=function(_0x5dd628,_0x567c6d){var _0x3b7973={},_0x544d4d={},_0x7edf26={'count':0x0,'rows':[]};var _0x2fc53c=_[_0x05e8('0x30')](db[_0x05e8('0x31')][_0x05e8('0x32')],function(_0x3870c9){return{'name':_0x3870c9['fieldName'],'type':_0x3870c9[_0x05e8('0x33')]['key']};});_0x544d4d[_0x05e8('0x34')]=_['map'](_0x2fc53c,_0x05e8('0x2d'));_0x544d4d[_0x05e8('0x35')]=_[_0x05e8('0x36')](_0x5dd628[_0x05e8('0x35')]);_0x544d4d[_0x05e8('0x37')]=_[_0x05e8('0x38')](_0x544d4d[_0x05e8('0x34')],_0x544d4d[_0x05e8('0x35')]);_0x3b7973[_0x05e8('0x39')]=_['intersection'](_0x544d4d[_0x05e8('0x34')],qs[_0x05e8('0x3a')](_0x5dd628[_0x05e8('0x35')][_0x05e8('0x3a')]));_0x3b7973[_0x05e8('0x39')]=_0x3b7973[_0x05e8('0x39')][_0x05e8('0x3b')]?_0x3b7973['attributes']:_0x544d4d[_0x05e8('0x34')];if(!_0x5dd628['query'][_0x05e8('0x3c')](_0x05e8('0x3d'))){_0x3b7973['limit']=qs[_0x05e8('0x20')](_0x5dd628[_0x05e8('0x35')][_0x05e8('0x20')]);_0x3b7973['offset']=qs[_0x05e8('0x3e')](_0x5dd628['query']['offset']);}_0x3b7973[_0x05e8('0x3f')]=qs[_0x05e8('0x40')](_0x5dd628[_0x05e8('0x35')][_0x05e8('0x40')]);_0x3b7973['where']=qs[_0x05e8('0x37')](_[_0x05e8('0x41')](_0x5dd628[_0x05e8('0x35')],_0x544d4d[_0x05e8('0x37')]),_0x2fc53c);if(_0x5dd628['query'][_0x05e8('0x42')]){_0x3b7973[_0x05e8('0x43')]=_[_0x05e8('0x44')](_0x3b7973[_0x05e8('0x43')],{'$or':_[_0x05e8('0x30')](_0x2fc53c,function(_0x2303af){if(_0x2303af[_0x05e8('0x33')]!==_0x05e8('0x45')){var _0x1dbf7c={};_0x1dbf7c[_0x2303af[_0x05e8('0x2d')]]={'$like':'%'+_0x5dd628[_0x05e8('0x35')]['filter']+'%'};return _0x1dbf7c;}})});}_0x3b7973=_['merge']({},_0x3b7973,_0x5dd628[_0x05e8('0x46')]);var _0x1ac268={'where':_0x3b7973[_0x05e8('0x43')]};return db[_0x05e8('0x31')][_0x05e8('0x21')](_0x1ac268)[_0x05e8('0x27')](function(_0x1de5ab){_0x7edf26[_0x05e8('0x21')]=_0x1de5ab;if(_0x5dd628[_0x05e8('0x35')]['includeAll']){_0x3b7973[_0x05e8('0x47')]=[{'all':!![]}];}return db[_0x05e8('0x31')][_0x05e8('0x48')](_0x3b7973);})['then'](function(_0xf4c064){_0x7edf26[_0x05e8('0x49')]=_0xf4c064;return _0x7edf26;})[_0x05e8('0x27')](respondWithFilteredResult(_0x567c6d,_0x3b7973))[_0x05e8('0x4a')](handleError(_0x567c6d,null));};exports['show']=function(_0x26457f,_0x463074){var _0x236f76={'raw':!![],'where':{'id':_0x26457f['params']['id']}},_0x2ff729={};_0x2ff729[_0x05e8('0x34')]=_[_0x05e8('0x36')](db[_0x05e8('0x31')][_0x05e8('0x32')]);_0x2ff729[_0x05e8('0x35')]=_[_0x05e8('0x36')](_0x26457f[_0x05e8('0x35')]);_0x2ff729[_0x05e8('0x37')]=_[_0x05e8('0x38')](_0x2ff729[_0x05e8('0x34')],_0x2ff729[_0x05e8('0x35')]);_0x236f76['attributes']=_['intersection'](_0x2ff729['model'],qs[_0x05e8('0x3a')](_0x26457f[_0x05e8('0x35')][_0x05e8('0x3a')]));_0x236f76[_0x05e8('0x39')]=_0x236f76[_0x05e8('0x39')][_0x05e8('0x3b')]?_0x236f76[_0x05e8('0x39')]:_0x2ff729['model'];if(_0x26457f['query'][_0x05e8('0x4b')]){_0x236f76[_0x05e8('0x47')]=[{'all':!![]}];}_0x236f76=_[_0x05e8('0x44')]({},_0x236f76,_0x26457f['options']);return db[_0x05e8('0x31')]['find'](_0x236f76)[_0x05e8('0x27')](handleEntityNotFound(_0x463074,null))[_0x05e8('0x27')](respondWithResult(_0x463074,null))[_0x05e8('0x4a')](handleError(_0x463074,null));};exports[_0x05e8('0x4c')]=function(_0x2ff47d,_0x36fae7){return db[_0x05e8('0x31')][_0x05e8('0x4c')](_0x2ff47d[_0x05e8('0x4d')],{})[_0x05e8('0x27')](function(_0x3b90fe){var _0x231924=_0x2ff47d[_0x05e8('0x4e')][_0x05e8('0x4f')]({'plain':!![]});if(!_0x231924)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x231924[_0x05e8('0x50')]==='user'){var _0x13d0fe=_0x3b90fe['get']({'plain':!![]});var _0x3174c7=_0x05e8('0x29');return db[_0x05e8('0x51')]['find']({'where':{'name':_0x3174c7,'userProfileId':_0x231924[_0x05e8('0x52')]},'raw':!![]})['then'](function(_0x267afa){if(_0x267afa&&_0x267afa[_0x05e8('0x53')]===0x0){return db[_0x05e8('0x2a')]['create']({'name':_0x13d0fe[_0x05e8('0x2d')],'resourceId':_0x13d0fe['id'],'type':_0x267afa[_0x05e8('0x2d')],'sectionId':_0x267afa['id']},{})[_0x05e8('0x27')](function(){return _0x3b90fe;});}else{return _0x3b90fe;}})['catch'](function(_0x38eedb){logger[_0x05e8('0x2b')](_0x05e8('0x54'),_0x38eedb);throw _0x38eedb;});}return _0x3b90fe;})[_0x05e8('0x27')](respondWithResult(_0x36fae7,0xc9))[_0x05e8('0x4a')](handleError(_0x36fae7,null));};exports[_0x05e8('0x26')]=function(_0x30acef,_0x2d97ba){if(_0x30acef[_0x05e8('0x4d')]['id']){delete _0x30acef[_0x05e8('0x4d')]['id'];}return db[_0x05e8('0x31')][_0x05e8('0x55')]({'where':{'id':_0x30acef['params']['id']}})[_0x05e8('0x27')](handleEntityNotFound(_0x2d97ba,null))[_0x05e8('0x27')](saveUpdates(_0x30acef['body'],null))[_0x05e8('0x27')](respondWithResult(_0x2d97ba,null))[_0x05e8('0x4a')](handleError(_0x2d97ba,null));};exports[_0x05e8('0x28')]=function(_0x73c12d,_0x20c221){return db[_0x05e8('0x31')]['find']({'where':{'id':_0x73c12d['params']['id']}})[_0x05e8('0x27')](handleEntityNotFound(_0x20c221,null))['then'](removeEntity(_0x20c221,null))[_0x05e8('0x4a')](handleError(_0x20c221,null));};exports['describe']=function(_0x2572c5,_0xcaed27){return db[_0x05e8('0x31')][_0x05e8('0x56')]()[_0x05e8('0x27')](respondWithResult(_0xcaed27,null))[_0x05e8('0x4a')](handleError(_0xcaed27,null));};exports[_0x05e8('0x57')]=function(_0x435121,_0xcbc303,_0x5a8899){var _0x467a3b={'raw':!![],'where':{}},_0x53804f={},_0xdeb926;return db[_0x05e8('0x31')][_0x05e8('0x58')]({'where':{'id':_0x435121[_0x05e8('0x59')]['id']}})['then'](handleEntityNotFound(_0xcbc303,null))[_0x05e8('0x27')](function(_0x580f4c){if(_0x580f4c){_0xdeb926=_0x580f4c[_0x05e8('0x4f')]({'plain':!![]});_0x53804f['model']=_[_0x05e8('0x36')](db['UserOpenchannelQueue']['rawAttributes']);_0x53804f[_0x05e8('0x35')]=_[_0x05e8('0x36')](_0x435121[_0x05e8('0x35')]);_0x53804f[_0x05e8('0x37')]=_[_0x05e8('0x38')](_0x53804f['model'],_0x53804f['query']);_0x467a3b[_0x05e8('0x39')]=_['intersection'](_0x53804f['model'],qs[_0x05e8('0x3a')](_0x435121[_0x05e8('0x35')]['fields']));_0x467a3b['attributes']=_0x467a3b[_0x05e8('0x39')][_0x05e8('0x3b')]?_0x467a3b[_0x05e8('0x39')]:_0x53804f[_0x05e8('0x34')];if(!_0x435121['query'][_0x05e8('0x3c')]('nolimit')){_0x467a3b[_0x05e8('0x20')]=qs['limit'](_0x435121[_0x05e8('0x35')]['limit']);_0x467a3b[_0x05e8('0x3e')]=qs[_0x05e8('0x3e')](_0x435121[_0x05e8('0x35')][_0x05e8('0x3e')]);}_0x467a3b[_0x05e8('0x3f')]=qs[_0x05e8('0x40')](_0x435121['query'][_0x05e8('0x40')]);_0x467a3b[_0x05e8('0x43')]=qs[_0x05e8('0x37')](_['pick'](_0x435121[_0x05e8('0x35')],_0x53804f[_0x05e8('0x37')]));_0x467a3b[_0x05e8('0x43')][_0x05e8('0x5a')]=_0x580f4c['id'];if(_0x435121[_0x05e8('0x35')][_0x05e8('0x42')]){_0x467a3b[_0x05e8('0x43')]=_[_0x05e8('0x44')](_0x467a3b[_0x05e8('0x43')],{'$or':_[_0x05e8('0x30')](_0x467a3b['attributes'],function(_0x15a5b3){var _0x206915={};_0x206915[_0x15a5b3]={'$like':'%'+_0x435121[_0x05e8('0x35')][_0x05e8('0x42')]+'%'};return _0x206915;})});}_0x467a3b=_['merge']({},_0x467a3b,_0x435121[_0x05e8('0x46')]);return db['UserOpenchannelQueue'][_0x05e8('0x48')](_0x467a3b);}})[_0x05e8('0x27')](function(_0x4af869){if(_0x4af869){return db[_0x05e8('0x5b')][_0x05e8('0x5c')]({'where':{'id':_['map'](_0x4af869,_0x05e8('0x5d')),'role':'agent'},'attributes':['id',_0x05e8('0x2d'),_0x05e8('0x5e'),_0x05e8('0x5f'),_0x05e8('0x60')]});}})[_0x05e8('0x27')](function(_0x1a8536){if(_0x1a8536){return{'count':_0x1a8536[_0x05e8('0x21')],'rows':_[_0x05e8('0x30')](_0x1a8536[_0x05e8('0x49')],function(_0x30f1a9){return{'membername':_0x30f1a9[_0x05e8('0x2d')],'UserId':_0x30f1a9['id'],'queue_name':_0xdeb926[_0x05e8('0x2d')],'OpenchannelQueueId':_0xdeb926['id'],'interface':util[_0x05e8('0x61')](_0x05e8('0x62'),_0x05e8('0x63'),_0x30f1a9[_0x05e8('0x2d')]),'penalty':0x0,'paused':_0x30f1a9[_0x05e8('0x5e')],'createdAt':_0x30f1a9[_0x05e8('0x60')],'updatedAt':_0x30f1a9[_0x05e8('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x05e8('0x27')](respondWithFilteredResult(_0xcbc303,_0x467a3b))['catch'](handleError(_0xcbc303,null));};exports[_0x05e8('0x64')]=function(_0x3df4d7,_0x15fdf1,_0x43aff8){var _0x381eca={};var _0x5c4766={};var _0x3ed465;var _0xf34b5;return db[_0x05e8('0x31')]['findOne']({'where':{'id':_0x3df4d7[_0x05e8('0x59')]['id']}})[_0x05e8('0x27')](handleEntityNotFound(_0x15fdf1,null))['then'](function(_0x4e147c){if(_0x4e147c){_0x3ed465=_0x4e147c;_0x5c4766['model']=_[_0x05e8('0x36')](db[_0x05e8('0x65')]['rawAttributes']);_0x5c4766[_0x05e8('0x35')]=_[_0x05e8('0x36')](_0x3df4d7[_0x05e8('0x35')]);_0x5c4766[_0x05e8('0x37')]=_['intersection'](_0x5c4766['model'],_0x5c4766[_0x05e8('0x35')]);_0x381eca[_0x05e8('0x39')]=_[_0x05e8('0x38')](_0x5c4766[_0x05e8('0x34')],qs['fields'](_0x3df4d7[_0x05e8('0x35')][_0x05e8('0x3a')]));_0x381eca[_0x05e8('0x39')]=_0x381eca[_0x05e8('0x39')][_0x05e8('0x3b')]?_0x381eca[_0x05e8('0x39')]:_0x5c4766[_0x05e8('0x34')];_0x381eca['order']=qs[_0x05e8('0x40')](_0x3df4d7['query'][_0x05e8('0x40')]);_0x381eca['where']=qs['filters'](_['pick'](_0x3df4d7['query'],_0x5c4766[_0x05e8('0x37')]));if(_0x3df4d7['query'][_0x05e8('0x42')]){_0x381eca['where']=_[_0x05e8('0x44')](_0x381eca[_0x05e8('0x43')],{'$or':_[_0x05e8('0x30')](_0x381eca[_0x05e8('0x39')],function(_0x505325){var _0x5c68be={};_0x5c68be[_0x505325]={'$like':'%'+_0x3df4d7['query'][_0x05e8('0x42')]+'%'};return _0x5c68be;})});}_0x381eca=_['merge']({},_0x381eca,_0x3df4d7[_0x05e8('0x46')]);return _0x3ed465['getTeams'](_0x381eca);}})[_0x05e8('0x27')](function(_0x20605a){if(_0x20605a){_0xf34b5=_0x20605a['length'];if(!_0x3df4d7[_0x05e8('0x35')]['hasOwnProperty'](_0x05e8('0x3d'))){_0x381eca[_0x05e8('0x20')]=qs[_0x05e8('0x20')](_0x3df4d7['query'][_0x05e8('0x20')]);_0x381eca[_0x05e8('0x3e')]=qs['offset'](_0x3df4d7[_0x05e8('0x35')][_0x05e8('0x3e')]);}return _0x3ed465[_0x05e8('0x64')](_0x381eca);}})[_0x05e8('0x27')](function(_0x1480b0){if(_0x1480b0){return _0x1480b0?{'count':_0xf34b5,'rows':_0x1480b0}:null;}})[_0x05e8('0x27')](respondWithResult(_0x15fdf1,null))[_0x05e8('0x4a')](handleError(_0x15fdf1,null));};exports[_0x05e8('0x66')]=function(_0x582628,_0xff39d6,_0x3de6bd){var _0x4e42f9=_0x582628[_0x05e8('0x4d')]['ids'];return db[_0x05e8('0x65')]['findAll']({'where':{'id':_0x4e42f9},'attributes':['id'],'include':[{'model':db[_0x05e8('0x5b')],'as':_0x05e8('0x67'),'attributes':['id',_0x05e8('0x2d'),_0x05e8('0x68'),_0x05e8('0x69'),'interface'],'raw':!![]}]})[_0x05e8('0x27')](function(_0x1ec9ab){if(_0x1ec9ab){var _0x264670=_[_0x05e8('0x6a')](_0x1ec9ab,function(_0x324879){var _0x24e591=_0x324879[_0x05e8('0x4f')]({'plain':!![]});return _0x24e591[_0x05e8('0x67')];});return db[_0x05e8('0x31')]['find']({'where':{'id':_0x582628['params']['id']}})['then'](function(_0x2987a8){return db['sequelize'][_0x05e8('0x6b')](function(_0x146a16){return _0x2987a8[_0x05e8('0x66')](_0x4e42f9,{'transaction':_0x146a16})['then'](function(){return BPromise[_0x05e8('0x6c')](_0x264670,function(_0x32cb2b){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x32cb2b['id'],'OpenchannelQueueId':_0x582628['params']['id']},'transaction':_0x146a16});});})[_0x05e8('0x27')](function(){_0x264670['forEach'](function(_0x39b5f7){socket[_0x05e8('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x39b5f7['id'],'OpenchannelQueueId':_0x2987a8['id']});});});});});}})[_0x05e8('0x27')](respondWithStatusCode(_0xff39d6,null))['catch'](handleError(_0xff39d6,null));};exports['removeTeams']=function(_0x5e21d1,_0x391a84,_0x2cfc45){return db[_0x05e8('0x65')][_0x05e8('0x48')]({'where':{'id':_0x5e21d1[_0x05e8('0x35')][_0x05e8('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x05e8('0x5b')],'as':_0x05e8('0x67'),'attributes':['id'],'raw':!![]}]})[_0x05e8('0x27')](handleEntityNotFound(_0x391a84,null))[_0x05e8('0x27')](function(_0x4e624b){var _0x536c5d=_['map'](_0x4e624b,'id');var _0x4ed169=[];var _0x22043f=[];var _0x2c0433=squel['select']();_0x2c0433[_0x05e8('0x6f')](_0x05e8('0x70'))[_0x05e8('0x71')]('team_has_openchannel_queues','tq')[_0x05e8('0x72')](_0x05e8('0x73'),'ut',_0x05e8('0x74'))['where'](_0x05e8('0x75'),_0x5e21d1[_0x05e8('0x59')]['id']);for(var _0x20a7dc=0x0;_0x20a7dc<_0x4e624b[_0x05e8('0x3b')];_0x20a7dc+=0x1){let _0x58a10=_0x4e624b[_0x20a7dc];for(var _0x162370=0x0;_0x162370<_0x58a10[_0x05e8('0x67')][_0x05e8('0x3b')];_0x162370+=0x1){let _0x5517b6=_0x58a10[_0x05e8('0x67')][_0x162370];var _0xcb903c=_0x2c0433['clone']();_0xcb903c[_0x05e8('0x43')](_0x05e8('0x76'),_0x5517b6['id']);_0x22043f[_0x05e8('0x77')](db[_0x05e8('0x78')]['query'](_0xcb903c[_0x05e8('0x79')](),{'type':db[_0x05e8('0x78')][_0x05e8('0x7a')][_0x05e8('0x7b')]})[_0x05e8('0x27')](function(_0x18bf7a){if(_0x18bf7a['length']===0x1){return _0x5517b6['id'];}else{var _0x26f88c=_[_0x05e8('0x7c')](_[_0x05e8('0x30')](_0x18bf7a,'TeamId'),function(_0x372e5a){return _[_0x05e8('0x7d')](_0x536c5d,_0x372e5a);});if(_0x26f88c){return _0x5517b6['id'];}}}));}}return BPromise[_0x05e8('0x7e')](_0x22043f)['then'](function(_0x3c4158){_0x4ed169=_(_0x4ed169)[_0x05e8('0x7f')](_0x3c4158)[_0x05e8('0x80')]()['value']();return db[_0x05e8('0x31')][_0x05e8('0x55')]({'where':{'id':_0x5e21d1[_0x05e8('0x59')]['id']}})[_0x05e8('0x27')](function(_0x474971){return db[_0x05e8('0x78')]['transaction'](function(_0x3dff7e){return _0x474971['removeTeams'](_0x5e21d1[_0x05e8('0x35')]['ids'],{'transaction':_0x3dff7e})['then'](function(){if(!_[_0x05e8('0x81')](_0x4ed169)){return _0x474971[_0x05e8('0x82')](_0x4ed169,{'transaction':_0x3dff7e});}})['then'](function(){_0x4ed169[_0x05e8('0x83')](function(_0x243542){socket[_0x05e8('0x6d')](_0x05e8('0x84'),{'UserId':_0x243542,'OpenchannelQueueId':_0x474971['id']});});});});});});})[_0x05e8('0x27')](respondWithStatusCode(_0x391a84,null))[_0x05e8('0x4a')](handleError(_0x391a84,null));};exports[_0x05e8('0x85')]=function(_0x48fa82,_0xb575df,_0x3e9584){return db[_0x05e8('0x31')][_0x05e8('0x55')]({'where':{'id':_0x48fa82['params']['id']}})['then'](handleEntityNotFound(_0xb575df,null))[_0x05e8('0x27')](function(_0x16a326){if(_0x16a326){return _0x16a326['addAgents'](_0x48fa82[_0x05e8('0x4d')][_0x05e8('0x6e')],_[_0x05e8('0x86')](_0x48fa82[_0x05e8('0x4d')],[_0x05e8('0x6e'),'id'])||{})[_0x05e8('0x87')](function(_0x419f20){for(var _0x21e4ae=0x0;_0x21e4ae<_0x48fa82['body'][_0x05e8('0x6e')]['length'];_0x21e4ae+=0x1){socket[_0x05e8('0x6d')](_0x05e8('0x88'),{'UserId':Number(_0x48fa82['body'][_0x05e8('0x6e')][_0x21e4ae]),'OpenchannelQueueId':Number(_0x48fa82['params']['id'])});}return _0x419f20;});}})['then'](respondWithResult(_0xb575df,null))[_0x05e8('0x4a')](handleError(_0xb575df,null));};exports[_0x05e8('0x82')]=function(_0x254d8b,_0x171b29,_0x342640){return db[_0x05e8('0x31')][_0x05e8('0x55')]({'where':{'id':_0x254d8b[_0x05e8('0x59')]['id']}})[_0x05e8('0x27')](handleEntityNotFound(_0x171b29,null))[_0x05e8('0x27')](function(_0x300be8){if(_0x300be8){return _0x300be8[_0x05e8('0x82')](_0x254d8b['query'][_0x05e8('0x6e')])['then'](function(){if(_[_0x05e8('0x89')](_0x254d8b[_0x05e8('0x35')][_0x05e8('0x6e')])){for(var _0x1c5436=0x0;_0x1c5436<_0x254d8b['query'][_0x05e8('0x6e')][_0x05e8('0x3b')];_0x1c5436+=0x1){socket[_0x05e8('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x254d8b['query'][_0x05e8('0x6e')][_0x1c5436]),'OpenchannelQueueId':Number(_0x254d8b[_0x05e8('0x59')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x254d8b['query'][_0x05e8('0x6e')]),'OpenchannelQueueId':Number(_0x254d8b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x171b29,null))[_0x05e8('0x4a')](handleError(_0x171b29,null));};exports[_0x05e8('0x8a')]=function(_0x328b92,_0xc93d7d,_0x33eab1){var _0xd19f30={};var _0x4673e9={};var _0x100a4e;var _0x552a62;return db[_0x05e8('0x31')][_0x05e8('0x58')]({'where':{'id':_0x328b92['params']['id']}})['then'](handleEntityNotFound(_0xc93d7d,null))['then'](function(_0x49e5ae){if(_0x49e5ae){_0x100a4e=_0x49e5ae;_0x4673e9[_0x05e8('0x34')]=_[_0x05e8('0x36')](db[_0x05e8('0x5b')][_0x05e8('0x32')]);_0x4673e9[_0x05e8('0x35')]=_[_0x05e8('0x36')](_0x328b92[_0x05e8('0x35')]);_0x4673e9[_0x05e8('0x37')]=_['intersection'](_0x4673e9[_0x05e8('0x34')],_0x4673e9[_0x05e8('0x35')]);_0xd19f30[_0x05e8('0x39')]=_[_0x05e8('0x38')](_0x4673e9[_0x05e8('0x34')],qs[_0x05e8('0x3a')](_0x328b92['query'][_0x05e8('0x3a')]));_0xd19f30['attributes']=_0xd19f30[_0x05e8('0x39')][_0x05e8('0x3b')]?_0xd19f30[_0x05e8('0x39')]:_0x4673e9['model'];_0xd19f30[_0x05e8('0x3f')]=qs['sort'](_0x328b92[_0x05e8('0x35')][_0x05e8('0x40')]);_0xd19f30[_0x05e8('0x43')]=qs[_0x05e8('0x37')](_['pick'](_0x328b92['query'],_0x4673e9['filters']));if(_0x328b92[_0x05e8('0x35')][_0x05e8('0x42')]){_0xd19f30[_0x05e8('0x43')]=_['merge'](_0xd19f30['where'],{'$or':_['map'](_0xd19f30[_0x05e8('0x39')],function(_0x5af5b6){var _0x3f15bd={};_0x3f15bd[_0x5af5b6]={'$like':'%'+_0x328b92['query'][_0x05e8('0x42')]+'%'};return _0x3f15bd;})});}_0xd19f30=_['merge']({},_0xd19f30,_0x328b92[_0x05e8('0x46')]);return _0x100a4e['getAgents'](_0xd19f30);}})['then'](function(_0x4f3997){if(_0x4f3997){_0x552a62=_0x4f3997[_0x05e8('0x3b')];if(!_0x328b92[_0x05e8('0x35')][_0x05e8('0x3c')](_0x05e8('0x3d'))){_0xd19f30[_0x05e8('0x20')]=qs['limit'](_0x328b92[_0x05e8('0x35')][_0x05e8('0x20')]);_0xd19f30[_0x05e8('0x3e')]=qs[_0x05e8('0x3e')](_0x328b92[_0x05e8('0x35')]['offset']);}return _0x100a4e[_0x05e8('0x8a')](_0xd19f30);}})[_0x05e8('0x27')](function(_0x10014e){if(_0x10014e){return _0x10014e?{'count':_0x552a62,'rows':_0x10014e}:null;}})[_0x05e8('0x27')](respondWithResult(_0xc93d7d,null))[_0x05e8('0x4a')](handleError(_0xc93d7d,null));};
\ No newline at end of file
index 76ef3b7..103fb1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1536=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1536,0xde));var _0x6153=function(_0x3805b3,_0x826b6c){_0x3805b3=_0x3805b3-0x0;var _0x15a1b0=_0x1536[_0x3805b3];return _0x15a1b0;};'use strict';var EventEmitter=require(_0x6153('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6153('0x1')](0x0);var events={'afterCreate':_0x6153('0x2'),'afterUpdate':_0x6153('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4098e8){return function(_0x482d1e,_0x29dc24,_0x21ff5c){OpenchannelQueueEvents[_0x6153('0x4')](_0x4098e8+':'+_0x482d1e['id'],_0x482d1e);OpenchannelQueueEvents[_0x6153('0x4')](_0x4098e8,_0x482d1e);_0x21ff5c(null);};}for(var e in events){if(events[_0x6153('0x5')](e)){var event=events[e];OpenchannelQueue[_0x6153('0x6')](e,emitEvent(event));}}module[_0x6153('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x9170=['hook','exports','../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x1ddc57,_0x34b87f){var _0x526d7d=function(_0x3ba658){while(--_0x3ba658){_0x1ddc57['push'](_0x1ddc57['shift']());}};_0x526d7d(++_0x34b87f);}(_0x9170,0x1df));var _0x0917=function(_0x472e3f,_0x59c9c3){_0x472e3f=_0x472e3f-0x0;var _0x5c8da3=_0x9170[_0x472e3f];return _0x5c8da3;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x0917('0x0'))['db'][_0x0917('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0917('0x2'),'afterUpdate':_0x0917('0x3'),'afterDestroy':_0x0917('0x4')};function emitEvent(_0x3bb2f7){return function(_0x3b6e25,_0x4ddcdb,_0x519432){OpenchannelQueueEvents[_0x0917('0x5')](_0x3bb2f7+':'+_0x3b6e25['id'],_0x3b6e25);OpenchannelQueueEvents[_0x0917('0x5')](_0x3bb2f7,_0x3b6e25);_0x519432(null);};}for(var e in events){if(events[_0x0917('0x6')](e)){var event=events[e];OpenchannelQueue[_0x0917('0x7')](e,emitEvent(event));}}module[_0x0917('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index 3fda261..6f758bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2b3=['exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./openchannelQueue.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd2b3,0x148));var _0x3d2b=function(_0x11da31,_0x5d576f){_0x11da31=_0x11da31-0x0;var _0x6bb4c8=_0xd2b3[_0x11da31];return _0x6bb4c8;};'use strict';var _=require(_0x3d2b('0x0'));var util=require(_0x3d2b('0x1'));var logger=require(_0x3d2b('0x2'))('api');var moment=require(_0x3d2b('0x3'));var BPromise=require(_0x3d2b('0x4'));var rp=require(_0x3d2b('0x5'));var fs=require('fs');var path=require(_0x3d2b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3d2b('0x7'));module[_0x3d2b('0x8')]=function(_0x4e88be,_0x3be99f){return _0x4e88be[_0x3d2b('0x9')](_0x3d2b('0xa'),attributes,{'tableName':_0x3d2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d65=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','define','OpenchannelQueue','openchannel_queues'];(function(_0x2bcd61,_0x10be4a){var _0x40b193=function(_0xadfc5){while(--_0xadfc5){_0x2bcd61['push'](_0x2bcd61['shift']());}};_0x40b193(++_0x10be4a);}(_0x5d65,0x1f4));var _0x55d6=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x5d65[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0x55d6('0x0'));var util=require(_0x55d6('0x1'));var logger=require(_0x55d6('0x2'))('api');var moment=require(_0x55d6('0x3'));var BPromise=require(_0x55d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55d6('0x5'));var rimraf=require('rimraf');var config=require(_0x55d6('0x6'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x4996d9,_0x5ca685){return _0x4996d9[_0x55d6('0x7')](_0x55d6('0x8'),attributes,{'tableName':_0x55d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc8d302..1f1b2c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb7=['raw','where','limit','map','include','model','attributes','debug','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','options'];(function(_0xca581e,_0x5975df){var _0x5ddecd=function(_0x38e8ed){while(--_0x38e8ed){_0xca581e['push'](_0xca581e['shift']());}};_0x5ddecd(++_0x5975df);}(_0x6bb7,0x125));var _0x76bb=function(_0x29f179,_0x1d290b){_0x29f179=_0x29f179-0x0;var _0x2ff7ec=_0x6bb7[_0x29f179];return _0x2ff7ec;};'use strict';var _=require(_0x76bb('0x0'));var util=require(_0x76bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x76bb('0x2'));var fs=require('fs');var Redis=require(_0x76bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x76bb('0x4'))(_0x76bb('0x5'));var config=require(_0x76bb('0x6'));var jayson=require(_0x76bb('0x7'));var client=jayson[_0x76bb('0x8')][_0x76bb('0x9')]({'port':0x232a});config[_0x76bb('0xa')]=_['defaults'](config['redis'],{'host':_0x76bb('0xb'),'port':0x18eb});var socket=require(_0x76bb('0xc'))(new Redis(config['redis']));require(_0x76bb('0xd'))[_0x76bb('0xe')](socket);function respondWithRpcPromise(_0x596868,_0x474a9e,_0x341af0){return new BPromise(function(_0x2487e6,_0x102d1b){return client[_0x76bb('0xf')](_0x596868,_0x341af0)[_0x76bb('0x10')](function(_0x4cff9c){logger['info'](_0x76bb('0x11'),_0x474a9e,_0x76bb('0x12'));logger['debug'](_0x76bb('0x13'),_0x474a9e,_0x76bb('0x12'),JSON['stringify'](_0x4cff9c));if(_0x4cff9c[_0x76bb('0x14')]){if(_0x4cff9c[_0x76bb('0x14')][_0x76bb('0x15')]===0x1f4){logger['error'](_0x76bb('0x11'),_0x474a9e,_0x4cff9c[_0x76bb('0x14')][_0x76bb('0x16')]);return _0x102d1b(_0x4cff9c[_0x76bb('0x14')][_0x76bb('0x16')]);}logger[_0x76bb('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x474a9e,_0x4cff9c['error'][_0x76bb('0x16')]);return _0x2487e6(_0x4cff9c[_0x76bb('0x14')][_0x76bb('0x16')]);}else{logger[_0x76bb('0x17')](_0x76bb('0x11'),_0x474a9e,'request\x20sent');_0x2487e6(_0x4cff9c[_0x76bb('0x18')]['message']);}})[_0x76bb('0x19')](function(_0x1ebe9d){logger[_0x76bb('0x14')](_0x76bb('0x11'),_0x474a9e,_0x1ebe9d);_0x102d1b(_0x1ebe9d);});});}exports['GetOpenchannelQueue']=function(_0x44ee91){var _0x52ba40=this;return new Promise(function(_0x189444,_0x4d8a33){return db['OpenchannelQueue']['findAll']({'raw':_0x44ee91['options']?_0x44ee91[_0x76bb('0x1a')][_0x76bb('0x1b')]===undefined?!![]:![]:!![],'where':_0x44ee91['options']?_0x44ee91[_0x76bb('0x1a')][_0x76bb('0x1c')]||null:null,'attributes':_0x44ee91[_0x76bb('0x1a')]?_0x44ee91['options']['attributes']||null:null,'limit':_0x44ee91[_0x76bb('0x1a')]?_0x44ee91[_0x76bb('0x1a')][_0x76bb('0x1d')]||null:null,'include':_0x44ee91[_0x76bb('0x1a')]?_0x44ee91['options']['include']?_[_0x76bb('0x1e')](_0x44ee91[_0x76bb('0x1a')][_0x76bb('0x1f')],function(_0x29efa9){return{'model':db[_0x29efa9[_0x76bb('0x20')]],'as':_0x29efa9['as'],'attributes':_0x29efa9[_0x76bb('0x21')],'include':_0x29efa9[_0x76bb('0x1f')]?_[_0x76bb('0x1e')](_0x29efa9['include'],function(_0x4ee3a3){return{'model':db[_0x4ee3a3['model']],'as':_0x4ee3a3['as'],'attributes':_0x4ee3a3[_0x76bb('0x21')],'include':_0x4ee3a3[_0x76bb('0x1f')]?_['map'](_0x4ee3a3[_0x76bb('0x1f')],function(_0x2323cf){return{'model':db[_0x2323cf[_0x76bb('0x20')]],'as':_0x2323cf['as'],'attributes':_0x2323cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x76bb('0x10')](function(_0x109ef1){logger[_0x76bb('0x17')]('GetOpenchannelQueue',_0x44ee91);logger[_0x76bb('0x22')](_0x76bb('0x23'),_0x44ee91,JSON[_0x76bb('0x24')](_0x109ef1));_0x189444(_0x109ef1);})[_0x76bb('0x19')](function(_0x37d8d7){logger[_0x76bb('0x14')](_0x76bb('0x23'),_0x37d8d7[_0x76bb('0x16')],_0x44ee91);_0x4d8a33(_0x52ba40['error'](0x1f4,_0x37d8d7[_0x76bb('0x16')]));});});};exports[_0x76bb('0x25')]=function(_0x37b28b){var _0x2cb11d=this;return new Promise(function(_0x243561,_0x39e7af){return db[_0x76bb('0x26')][_0x76bb('0x27')]({'raw':_0x37b28b['options']?_0x37b28b[_0x76bb('0x1a')][_0x76bb('0x1b')]===undefined?!![]:![]:!![],'where':_0x37b28b[_0x76bb('0x1a')]?_0x37b28b[_0x76bb('0x1a')][_0x76bb('0x1c')]||null:null,'attributes':_0x37b28b[_0x76bb('0x1a')]?_0x37b28b[_0x76bb('0x1a')][_0x76bb('0x21')]||null:null,'include':_0x37b28b[_0x76bb('0x1a')]?_0x37b28b['options']['include']?_[_0x76bb('0x1e')](_0x37b28b['options'][_0x76bb('0x1f')],function(_0x4dbdab){return{'model':db[_0x4dbdab[_0x76bb('0x20')]],'as':_0x4dbdab['as'],'attributes':_0x4dbdab[_0x76bb('0x21')],'include':_0x4dbdab[_0x76bb('0x1f')]?_[_0x76bb('0x1e')](_0x4dbdab[_0x76bb('0x1f')],function(_0x4a414b){return{'model':db[_0x4a414b['model']],'as':_0x4a414b['as'],'attributes':_0x4a414b['attributes'],'include':_0x4a414b[_0x76bb('0x1f')]?_[_0x76bb('0x1e')](_0x4a414b[_0x76bb('0x1f')],function(_0x2e3ab8){return{'model':db[_0x2e3ab8[_0x76bb('0x20')]],'as':_0x2e3ab8['as'],'attributes':_0x2e3ab8['attributes']};}):[]};}):[]};}):[]:[]})[_0x76bb('0x10')](function(_0x371603){logger['info']('ShowOpenchannelQueue',_0x37b28b);logger['debug'](_0x76bb('0x25'),_0x37b28b,JSON['stringify'](_0x371603));_0x243561(_0x371603);})[_0x76bb('0x19')](function(_0xf095d7){logger[_0x76bb('0x14')](_0x76bb('0x25'),_0xf095d7[_0x76bb('0x16')],_0x37b28b);_0x39e7af(_0x2cb11d[_0x76bb('0x14')](0x1f4,_0xf095d7[_0x76bb('0x16')]));});});};
\ No newline at end of file
+var _0x1041=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','where','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./openchannelQueue.socket','register','info','request\x20sent'];(function(_0x21bb5a,_0x106c58){var _0x21ebc3=function(_0x12d93b){while(--_0x12d93b){_0x21bb5a['push'](_0x21bb5a['shift']());}};_0x21ebc3(++_0x106c58);}(_0x1041,0x87));var _0x1104=function(_0x596f3f,_0x53c5bf){_0x596f3f=_0x596f3f-0x0;var _0x2c1225=_0x1041[_0x596f3f];return _0x2c1225;};'use strict';var _=require(_0x1104('0x0'));var util=require(_0x1104('0x1'));var moment=require('moment');var BPromise=require(_0x1104('0x2'));var rs=require(_0x1104('0x3'));var fs=require('fs');var Redis=require(_0x1104('0x4'));var db=require(_0x1104('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1104('0x6'))(_0x1104('0x7'));var config=require(_0x1104('0x8'));var jayson=require(_0x1104('0x9'));var client=jayson[_0x1104('0xa')]['http']({'port':0x232a});config[_0x1104('0xb')]=_[_0x1104('0xc')](config[_0x1104('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1104('0xd'))[_0x1104('0xe')](socket);function respondWithRpcPromise(_0x2cabb4,_0x36552a,_0x20057a){return new BPromise(function(_0x30bbb8,_0x282447){return client['request'](_0x2cabb4,_0x20057a)['then'](function(_0x1993b9){logger[_0x1104('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x36552a,_0x1104('0x10'));logger[_0x1104('0x11')](_0x1104('0x12'),_0x36552a,_0x1104('0x10'),JSON['stringify'](_0x1993b9));if(_0x1993b9[_0x1104('0x13')]){if(_0x1993b9['error'][_0x1104('0x14')]===0x1f4){logger[_0x1104('0x13')](_0x1104('0x15'),_0x36552a,_0x1993b9[_0x1104('0x13')]['message']);return _0x282447(_0x1993b9[_0x1104('0x13')][_0x1104('0x16')]);}logger[_0x1104('0x13')](_0x1104('0x15'),_0x36552a,_0x1993b9[_0x1104('0x13')][_0x1104('0x16')]);return _0x30bbb8(_0x1993b9[_0x1104('0x13')][_0x1104('0x16')]);}else{logger['info'](_0x1104('0x15'),_0x36552a,_0x1104('0x10'));_0x30bbb8(_0x1993b9[_0x1104('0x17')][_0x1104('0x16')]);}})[_0x1104('0x18')](function(_0x4258a3){logger[_0x1104('0x13')](_0x1104('0x15'),_0x36552a,_0x4258a3);_0x282447(_0x4258a3);});});}exports[_0x1104('0x19')]=function(_0x24dda3){var _0x121937=this;return new Promise(function(_0x539a91,_0x3aed8e){return db[_0x1104('0x1a')]['findAll']({'raw':_0x24dda3[_0x1104('0x1b')]?_0x24dda3[_0x1104('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x24dda3[_0x1104('0x1b')]?_0x24dda3[_0x1104('0x1b')][_0x1104('0x1c')]||null:null,'attributes':_0x24dda3[_0x1104('0x1b')]?_0x24dda3[_0x1104('0x1b')][_0x1104('0x1d')]||null:null,'limit':_0x24dda3[_0x1104('0x1b')]?_0x24dda3[_0x1104('0x1b')][_0x1104('0x1e')]||null:null,'include':_0x24dda3['options']?_0x24dda3[_0x1104('0x1b')][_0x1104('0x1f')]?_[_0x1104('0x20')](_0x24dda3['options'][_0x1104('0x1f')],function(_0xc9a798){return{'model':db[_0xc9a798[_0x1104('0x21')]],'as':_0xc9a798['as'],'attributes':_0xc9a798[_0x1104('0x1d')],'include':_0xc9a798['include']?_[_0x1104('0x20')](_0xc9a798['include'],function(_0x182984){return{'model':db[_0x182984[_0x1104('0x21')]],'as':_0x182984['as'],'attributes':_0x182984[_0x1104('0x1d')],'include':_0x182984[_0x1104('0x1f')]?_[_0x1104('0x20')](_0x182984[_0x1104('0x1f')],function(_0x958a93){return{'model':db[_0x958a93[_0x1104('0x21')]],'as':_0x958a93['as'],'attributes':_0x958a93[_0x1104('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x255c77){logger['info']('GetOpenchannelQueue',_0x24dda3);logger[_0x1104('0x11')](_0x1104('0x19'),_0x24dda3,JSON[_0x1104('0x22')](_0x255c77));_0x539a91(_0x255c77);})[_0x1104('0x18')](function(_0x146905){logger[_0x1104('0x13')](_0x1104('0x19'),_0x146905[_0x1104('0x16')],_0x24dda3);_0x3aed8e(_0x121937['error'](0x1f4,_0x146905['message']));});});};exports[_0x1104('0x23')]=function(_0x3b89df){var _0x9bbbf1=this;return new Promise(function(_0x35b4d5,_0x3cb49c){return db[_0x1104('0x1a')]['find']({'raw':_0x3b89df[_0x1104('0x1b')]?_0x3b89df[_0x1104('0x1b')][_0x1104('0x24')]===undefined?!![]:![]:!![],'where':_0x3b89df[_0x1104('0x1b')]?_0x3b89df[_0x1104('0x1b')][_0x1104('0x1c')]||null:null,'attributes':_0x3b89df[_0x1104('0x1b')]?_0x3b89df[_0x1104('0x1b')][_0x1104('0x1d')]||null:null,'include':_0x3b89df[_0x1104('0x1b')]?_0x3b89df[_0x1104('0x1b')][_0x1104('0x1f')]?_[_0x1104('0x20')](_0x3b89df[_0x1104('0x1b')][_0x1104('0x1f')],function(_0x3093db){return{'model':db[_0x3093db[_0x1104('0x21')]],'as':_0x3093db['as'],'attributes':_0x3093db['attributes'],'include':_0x3093db[_0x1104('0x1f')]?_['map'](_0x3093db[_0x1104('0x1f')],function(_0x2a6091){return{'model':db[_0x2a6091[_0x1104('0x21')]],'as':_0x2a6091['as'],'attributes':_0x2a6091[_0x1104('0x1d')],'include':_0x2a6091[_0x1104('0x1f')]?_[_0x1104('0x20')](_0x2a6091[_0x1104('0x1f')],function(_0x2153dc){return{'model':db[_0x2153dc[_0x1104('0x21')]],'as':_0x2153dc['as'],'attributes':_0x2153dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x1104('0x25')](function(_0x42d89e){logger[_0x1104('0xf')](_0x1104('0x23'),_0x3b89df);logger[_0x1104('0x11')]('ShowOpenchannelQueue',_0x3b89df,JSON['stringify'](_0x42d89e));_0x35b4d5(_0x42d89e);})[_0x1104('0x18')](function(_0x36eb21){logger['error'](_0x1104('0x23'),_0x36eb21[_0x1104('0x16')],_0x3b89df);_0x3cb49c(_0x9bbbf1[_0x1104('0x13')](0x1f4,_0x36eb21['message']));});});};
\ No newline at end of file
index 1395928..81a83d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62fc=['remove','update','removeListener','register','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x2bf545,_0x2d96e0){var _0x49c5c3=function(_0x1b31a3){while(--_0x1b31a3){_0x2bf545['push'](_0x2bf545['shift']());}};_0x49c5c3(++_0x2d96e0);}(_0x62fc,0x139));var _0xc62f=function(_0x33e9e7,_0x10f0f9){_0x33e9e7=_0x33e9e7-0x0;var _0x3f2fb3=_0x62fc[_0x33e9e7];return _0x3f2fb3;};'use strict';var OpenchannelQueueEvents=require(_0xc62f('0x0'));var events=[_0xc62f('0x1'),_0xc62f('0x2'),_0xc62f('0x3')];function createListener(_0x17fa07,_0x500373){return function(_0x5cb8e1){_0x500373['emit'](_0x17fa07,_0x5cb8e1);};}function removeListener(_0x2f2dd0,_0x2d327c){return function(){OpenchannelQueueEvents[_0xc62f('0x4')](_0x2f2dd0,_0x2d327c);};}exports[_0xc62f('0x5')]=function(_0x22a285){for(var _0x26a672=0x0,_0x4b6ed5=events['length'];_0x26a672<_0x4b6ed5;_0x26a672++){var _0x4fc036=events[_0x26a672];var _0x37a286=createListener(_0xc62f('0x6')+_0x4fc036,_0x22a285);OpenchannelQueueEvents['on'](_0x4fc036,_0x37a286);}};
\ No newline at end of file
+var _0x8c6a=['save','remove','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8c6a,0x1b7));var _0xa8c6=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x8c6a[_0x2d91c6];return _0x3a8d19;};'use strict';var OpenchannelQueueEvents=require(_0xa8c6('0x0'));var events=[_0xa8c6('0x1'),_0xa8c6('0x2'),'update'];function createListener(_0x3acd42,_0x533ca6){return function(_0x55299c){_0x533ca6[_0xa8c6('0x3')](_0x3acd42,_0x55299c);};}function removeListener(_0x256025,_0x28ca58){return function(){OpenchannelQueueEvents[_0xa8c6('0x4')](_0x256025,_0x28ca58);};}exports[_0xa8c6('0x5')]=function(_0x47161a){for(var _0x5cf4af=0x0,_0xad65c1=events[_0xa8c6('0x6')];_0x5cf4af<_0xad65c1;_0x5cf4af++){var _0x536302=events[_0x5cf4af];var _0x1821a4=createListener(_0xa8c6('0x7')+_0x536302,_0x47161a);OpenchannelQueueEvents['on'](_0x536302,_0x1821a4);}};
\ No newline at end of file
index 2b90049..4a97553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4578=['update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated','get','/describe','put','/:id'];(function(_0x349ed,_0x5101b0){var _0x18ad54=function(_0x49ae79){while(--_0x49ae79){_0x349ed['push'](_0x349ed['shift']());}};_0x18ad54(++_0x5101b0);}(_0x4578,0x1f3));var _0x8457=function(_0x1c143e,_0x53f10c){_0x1c143e=_0x1c143e-0x0;var _0x5599de=_0x4578[_0x1c143e];return _0x5599de;};'use strict';var multer=require(_0x8457('0x0'));var util=require('util');var path=require(_0x8457('0x1'));var timeout=require(_0x8457('0x2'));var express=require(_0x8457('0x3'));var router=express['Router']();var fs_extra=require(_0x8457('0x4'));var auth=require(_0x8457('0x5'));var interaction=require(_0x8457('0x6'));var config=require('../../config/environment');var controller=require(_0x8457('0x7'));router['get']('/',auth[_0x8457('0x8')](),controller['index']);router[_0x8457('0x9')](_0x8457('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8457('0x9')]('/:id',auth[_0x8457('0x8')](),controller['show']);router['post']('/',auth[_0x8457('0x8')](),controller['create']);router[_0x8457('0xb')](_0x8457('0xc'),auth[_0x8457('0x8')](),controller[_0x8457('0xd')]);router[_0x8457('0xe')](_0x8457('0xc'),auth[_0x8457('0x8')](),controller['destroy']);module[_0x8457('0xf')]=router;
\ No newline at end of file
+var _0xcdcb=['post','create','put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x56d87d,_0x341cf3){var _0x43caa5=function(_0x3d3cbb){while(--_0x3d3cbb){_0x56d87d['push'](_0x56d87d['shift']());}};_0x43caa5(++_0x341cf3);}(_0xcdcb,0xcb));var _0xbcdc=function(_0x33303c,_0x233706){_0x33303c=_0x33303c-0x0;var _0x331554=_0xcdcb[_0x33303c];return _0x331554;};'use strict';var multer=require('multer');var util=require(_0xbcdc('0x0'));var path=require(_0xbcdc('0x1'));var timeout=require(_0xbcdc('0x2'));var express=require(_0xbcdc('0x3'));var router=express['Router']();var fs_extra=require(_0xbcdc('0x4'));var auth=require(_0xbcdc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbcdc('0x6'));router[_0xbcdc('0x7')]('/',auth[_0xbcdc('0x8')](),controller[_0xbcdc('0x9')]);router[_0xbcdc('0x7')](_0xbcdc('0xa'),auth[_0xbcdc('0x8')](),controller['describe']);router[_0xbcdc('0x7')](_0xbcdc('0xb'),auth[_0xbcdc('0x8')](),controller[_0xbcdc('0xc')]);router[_0xbcdc('0xd')]('/',auth['isAuthenticated'](),controller[_0xbcdc('0xe')]);router[_0xbcdc('0xf')](_0xbcdc('0xb'),auth[_0xbcdc('0x8')](),controller['update']);router['delete'](_0xbcdc('0xb'),auth[_0xbcdc('0x8')](),controller[_0xbcdc('0x10')]);module[_0xbcdc('0x11')]=router;
\ No newline at end of file
index 13b5b6f..2f84f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x395d=['exports','STRING','DATE','moment','sequelize'];(function(_0x1dcda4,_0x45c1ed){var _0x313231=function(_0x16171c){while(--_0x16171c){_0x1dcda4['push'](_0x1dcda4['shift']());}};_0x313231(++_0x45c1ed);}(_0x395d,0x166));var _0xd395=function(_0x4cf4b2,_0x1576eb){_0x4cf4b2=_0x4cf4b2-0x0;var _0x178c75=_0x395d[_0x4cf4b2];return _0x178c75;};'use strict';var moment=require(_0xd395('0x0'));var Sequelize=require(_0xd395('0x1'));module[_0xd395('0x2')]={'uniqueid':{'type':Sequelize[_0xd395('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd395('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd395('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd395('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4bf6=['DATE','moment','exports','STRING'];(function(_0x24717a,_0x26f6dc){var _0x32cf54=function(_0x1282a6){while(--_0x1282a6){_0x24717a['push'](_0x24717a['shift']());}};_0x32cf54(++_0x26f6dc);}(_0x4bf6,0x1e5));var _0x64bf=function(_0x3a9b4e,_0x57077e){_0x3a9b4e=_0x3a9b4e-0x0;var _0x3d2fa9=_0x4bf6[_0x3a9b4e];return _0x3d2fa9;};'use strict';var moment=require(_0x64bf('0x0'));var Sequelize=require('sequelize');module[_0x64bf('0x1')]={'uniqueid':{'type':Sequelize[_0x64bf('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x64bf('0x3')]},'leaveAt':{'type':Sequelize[_0x64bf('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x64bf('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7426905..de7db7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500b=['describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','OpenchannelQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body'];(function(_0x5dd2e2,_0x4a0afa){var _0x25f4b4=function(_0x24b4a4){while(--_0x24b4a4){_0x5dd2e2['push'](_0x5dd2e2['shift']());}};_0x25f4b4(++_0x4a0afa);}(_0x500b,0x182));var _0xb500=function(_0x2f9849,_0x209c0e){_0x2f9849=_0x2f9849-0x0;var _0x1aefac=_0x500b[_0x2f9849];return _0x1aefac;};'use strict';var emlformat=require(_0xb500('0x0'));var rimraf=require(_0xb500('0x1'));var zipdir=require(_0xb500('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb500('0x3'));var moment=require(_0xb500('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb500('0x5'));var util=require(_0xb500('0x6'));var path=require(_0xb500('0x7'));var sox=require(_0xb500('0x8'));var csv=require('to-csv');var ejs=require(_0xb500('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb500('0xa'));var crypto=require(_0xb500('0xb'));var jsforce=require(_0xb500('0xc'));var deskjs=require(_0xb500('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb500('0xe'));var Papa=require(_0xb500('0xf'));var Redis=require('ioredis');var authService=require(_0xb500('0x10'));var qs=require(_0xb500('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb500('0x12'));var utils=require(_0xb500('0x13'));var config=require(_0xb500('0x14'));var licenseUtil=require(_0xb500('0x15'));var db=require(_0xb500('0x16'))['db'];function respondWithStatusCode(_0x2ac9c8,_0x518476){_0x518476=_0x518476||0xcc;return function(_0x40619a){if(_0x40619a){return _0x2ac9c8[_0xb500('0x17')](_0x518476);}return _0x2ac9c8[_0xb500('0x18')](_0x518476)[_0xb500('0x19')]();};}function respondWithResult(_0x4ba6b2,_0x1ddeb2){_0x1ddeb2=_0x1ddeb2||0xc8;return function(_0x20ee6c){if(_0x20ee6c){return _0x4ba6b2['status'](_0x1ddeb2)[_0xb500('0x1a')](_0x20ee6c);}};}function respondWithFilteredResult(_0xc9b3ea,_0x17a504){return function(_0x1ebe69){if(_0x1ebe69){var _0x4ee02a=typeof _0x17a504[_0xb500('0x1b')]===_0xb500('0x1c')&&typeof _0x17a504[_0xb500('0x1d')]===_0xb500('0x1c');var _0x25a9b9=_0x1ebe69['count'];var _0x1dd676=_0x4ee02a?0x0:_0x17a504['offset'];var _0x25cd9d=_0x4ee02a?_0x1ebe69[_0xb500('0x1e')]:_0x17a504[_0xb500('0x1b')]+_0x17a504[_0xb500('0x1d')];var _0x11818a;if(_0x25cd9d>=_0x25a9b9){_0x25cd9d=_0x25a9b9;_0x11818a=0xc8;}else{_0x11818a=0xce;}_0xc9b3ea['status'](_0x11818a);return _0xc9b3ea[_0xb500('0x1f')](_0xb500('0x20'),_0x1dd676+'-'+_0x25cd9d+'/'+_0x25a9b9)[_0xb500('0x1a')](_0x1ebe69);}return null;};}function patchUpdates(_0x6102be){return function(_0x153870){try{jsonpatch['apply'](_0x153870,_0x6102be,!![]);}catch(_0x1dc2b4){return BPromise[_0xb500('0x21')](_0x1dc2b4);}return _0x153870[_0xb500('0x22')]();};}function saveUpdates(_0x3ae8cb,_0x95c5f5){return function(_0x24a496){if(_0x24a496){return _0x24a496[_0xb500('0x23')](_0x3ae8cb)['then'](function(_0x167986){return _0x167986;});}return null;};}function removeEntity(_0x29c8e7,_0x263047){return function(_0x2849cf){if(_0x2849cf){return _0x2849cf[_0xb500('0x24')]()[_0xb500('0x25')](function(){_0x29c8e7['status'](0xcc)[_0xb500('0x19')]();});}};}function handleEntityNotFound(_0x33a5d6,_0x382f0b){return function(_0x32ae60){if(!_0x32ae60){_0x33a5d6[_0xb500('0x17')](0x194);}return _0x32ae60;};}function handleError(_0x2ba6bc,_0xbeee6e){_0xbeee6e=_0xbeee6e||0x1f4;return function(_0x19b619){logger[_0xb500('0x26')](_0x19b619[_0xb500('0x27')]);if(_0x19b619[_0xb500('0x28')]){delete _0x19b619[_0xb500('0x28')];}_0x2ba6bc['status'](_0xbeee6e)[_0xb500('0x29')](_0x19b619);};}exports['index']=function(_0x585e0a,_0x51f2c0){var _0x9a865d={},_0x4cc89c={},_0x36d415={'count':0x0,'rows':[]};var _0x193d1a=_[_0xb500('0x2a')](db[_0xb500('0x2b')]['rawAttributes'],function(_0x2b20b3){return{'name':_0x2b20b3[_0xb500('0x2c')],'type':_0x2b20b3['type'][_0xb500('0x2d')]};});_0x4cc89c[_0xb500('0x2e')]=_[_0xb500('0x2a')](_0x193d1a,_0xb500('0x28'));_0x4cc89c[_0xb500('0x2f')]=_[_0xb500('0x30')](_0x585e0a[_0xb500('0x2f')]);_0x4cc89c[_0xb500('0x31')]=_[_0xb500('0x32')](_0x4cc89c[_0xb500('0x2e')],_0x4cc89c['query']);_0x9a865d['attributes']=_['intersection'](_0x4cc89c[_0xb500('0x2e')],qs['fields'](_0x585e0a[_0xb500('0x2f')]['fields']));_0x9a865d[_0xb500('0x33')]=_0x9a865d['attributes'][_0xb500('0x34')]?_0x9a865d[_0xb500('0x33')]:_0x4cc89c['model'];if(!_0x585e0a[_0xb500('0x2f')][_0xb500('0x35')](_0xb500('0x36'))){_0x9a865d[_0xb500('0x1d')]=qs[_0xb500('0x1d')](_0x585e0a[_0xb500('0x2f')][_0xb500('0x1d')]);_0x9a865d[_0xb500('0x1b')]=qs['offset'](_0x585e0a[_0xb500('0x2f')][_0xb500('0x1b')]);}_0x9a865d[_0xb500('0x37')]=qs[_0xb500('0x38')](_0x585e0a['query']['sort']);_0x9a865d['where']=qs[_0xb500('0x31')](_[_0xb500('0x39')](_0x585e0a[_0xb500('0x2f')],_0x4cc89c[_0xb500('0x31')]),_0x193d1a);if(_0x585e0a['query']['filter']){_0x9a865d[_0xb500('0x3a')]=_['merge'](_0x9a865d[_0xb500('0x3a')],{'$or':_['map'](_0x193d1a,function(_0x356a9f){if(_0x356a9f[_0xb500('0x3b')]!==_0xb500('0x3c')){var _0x248620={};_0x248620[_0x356a9f[_0xb500('0x28')]]={'$like':'%'+_0x585e0a[_0xb500('0x2f')][_0xb500('0x3d')]+'%'};return _0x248620;}})});}_0x9a865d=_[_0xb500('0x3e')]({},_0x9a865d,_0x585e0a[_0xb500('0x3f')]);var _0x14bc83={'where':_0x9a865d[_0xb500('0x3a')]};return db[_0xb500('0x2b')][_0xb500('0x1e')](_0x14bc83)['then'](function(_0x2ad801){_0x36d415[_0xb500('0x1e')]=_0x2ad801;if(_0x585e0a[_0xb500('0x2f')]['includeAll']){_0x9a865d[_0xb500('0x40')]=[{'all':!![]}];}return db[_0xb500('0x2b')][_0xb500('0x41')](_0x9a865d);})['then'](function(_0x57f7ba){_0x36d415[_0xb500('0x42')]=_0x57f7ba;return _0x36d415;})[_0xb500('0x25')](respondWithFilteredResult(_0x51f2c0,_0x9a865d))[_0xb500('0x43')](handleError(_0x51f2c0,null));};exports[_0xb500('0x44')]=function(_0x3669de,_0x13507e){var _0x2a7b8f={'raw':!![],'where':{'id':_0x3669de[_0xb500('0x45')]['id']}},_0x44b815={};_0x44b815['model']=_['keys'](db[_0xb500('0x2b')][_0xb500('0x46')]);_0x44b815['query']=_[_0xb500('0x30')](_0x3669de[_0xb500('0x2f')]);_0x44b815[_0xb500('0x31')]=_[_0xb500('0x32')](_0x44b815[_0xb500('0x2e')],_0x44b815['query']);_0x2a7b8f[_0xb500('0x33')]=_[_0xb500('0x32')](_0x44b815['model'],qs[_0xb500('0x47')](_0x3669de[_0xb500('0x2f')][_0xb500('0x47')]));_0x2a7b8f[_0xb500('0x33')]=_0x2a7b8f['attributes']['length']?_0x2a7b8f[_0xb500('0x33')]:_0x44b815[_0xb500('0x2e')];if(_0x3669de[_0xb500('0x2f')][_0xb500('0x48')]){_0x2a7b8f[_0xb500('0x40')]=[{'all':!![]}];}_0x2a7b8f=_['merge']({},_0x2a7b8f,_0x3669de['options']);return db[_0xb500('0x2b')][_0xb500('0x49')](_0x2a7b8f)[_0xb500('0x25')](handleEntityNotFound(_0x13507e,null))[_0xb500('0x25')](respondWithResult(_0x13507e,null))[_0xb500('0x43')](handleError(_0x13507e,null));};exports[_0xb500('0x4a')]=function(_0x55c566,_0x2d76e9){return db[_0xb500('0x2b')][_0xb500('0x4a')](_0x55c566['body'],{})['then'](respondWithResult(_0x2d76e9,0xc9))[_0xb500('0x43')](handleError(_0x2d76e9,null));};exports[_0xb500('0x23')]=function(_0x2d3d2c,_0x1a436b){if(_0x2d3d2c[_0xb500('0x4b')]['id']){delete _0x2d3d2c[_0xb500('0x4b')]['id'];}return db['OpenchannelQueueReport'][_0xb500('0x49')]({'where':{'id':_0x2d3d2c['params']['id']}})['then'](handleEntityNotFound(_0x1a436b,null))[_0xb500('0x25')](saveUpdates(_0x2d3d2c[_0xb500('0x4b')],null))[_0xb500('0x25')](respondWithResult(_0x1a436b,null))[_0xb500('0x43')](handleError(_0x1a436b,null));};exports[_0xb500('0x24')]=function(_0x5d090e,_0x307e7d){return db['OpenchannelQueueReport'][_0xb500('0x49')]({'where':{'id':_0x5d090e[_0xb500('0x45')]['id']}})[_0xb500('0x25')](handleEntityNotFound(_0x307e7d,null))[_0xb500('0x25')](removeEntity(_0x307e7d,null))[_0xb500('0x43')](handleError(_0x307e7d,null));};exports[_0xb500('0x4c')]=function(_0x45fbf9,_0x54b0cc){return db['OpenchannelQueueReport'][_0xb500('0x4c')]()[_0xb500('0x25')](respondWithResult(_0x54b0cc,null))[_0xb500('0x43')](handleError(_0x54b0cc,null));};
\ No newline at end of file
+var _0xae74=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','merge','options','find','create','body','describe','eml-format','rimraf','moment','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x47db90,_0x35c889){var _0x9df3ba=function(_0x23680d){while(--_0x23680d){_0x47db90['push'](_0x47db90['shift']());}};_0x9df3ba(++_0x35c889);}(_0xae74,0x122));var _0x4ae7=function(_0x1ca4c6,_0x29a9f5){_0x1ca4c6=_0x1ca4c6-0x0;var _0x236b63=_0xae74[_0x1ca4c6];return _0x236b63;};'use strict';var emlformat=require(_0x4ae7('0x0'));var rimraf=require(_0x4ae7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4ae7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ae7('0x3'));var path=require(_0x4ae7('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4ae7('0x5'));var fs=require('fs');var fs_extra=require(_0x4ae7('0x6'));var _=require('lodash');var squel=require(_0x4ae7('0x7'));var crypto=require(_0x4ae7('0x8'));var jsforce=require(_0x4ae7('0x9'));var deskjs=require(_0x4ae7('0xa'));var toCsv=require(_0x4ae7('0xb'));var querystring=require(_0x4ae7('0xc'));var Papa=require(_0x4ae7('0xd'));var Redis=require(_0x4ae7('0xe'));var authService=require(_0x4ae7('0xf'));var qs=require(_0x4ae7('0x10'));var as=require(_0x4ae7('0x11'));var hardwareService=require(_0x4ae7('0x12'));var logger=require('../../config/logger')(_0x4ae7('0x13'));var utils=require(_0x4ae7('0x14'));var config=require(_0x4ae7('0x15'));var licenseUtil=require(_0x4ae7('0x16'));var db=require(_0x4ae7('0x17'))['db'];function respondWithStatusCode(_0x5aa838,_0x579098){_0x579098=_0x579098||0xcc;return function(_0x11db11){if(_0x11db11){return _0x5aa838[_0x4ae7('0x18')](_0x579098);}return _0x5aa838['status'](_0x579098)[_0x4ae7('0x19')]();};}function respondWithResult(_0x20a4ba,_0x199abd){_0x199abd=_0x199abd||0xc8;return function(_0x1154d7){if(_0x1154d7){return _0x20a4ba['status'](_0x199abd)['json'](_0x1154d7);}};}function respondWithFilteredResult(_0x34c27a,_0x5f4e35){return function(_0x361a33){if(_0x361a33){var _0xcdd8cb=typeof _0x5f4e35['offset']===_0x4ae7('0x1a')&&typeof _0x5f4e35[_0x4ae7('0x1b')]===_0x4ae7('0x1a');var _0x3448c5=_0x361a33[_0x4ae7('0x1c')];var _0x3498ac=_0xcdd8cb?0x0:_0x5f4e35[_0x4ae7('0x1d')];var _0x42cf33=_0xcdd8cb?_0x361a33[_0x4ae7('0x1c')]:_0x5f4e35[_0x4ae7('0x1d')]+_0x5f4e35['limit'];var _0x4a703c;if(_0x42cf33>=_0x3448c5){_0x42cf33=_0x3448c5;_0x4a703c=0xc8;}else{_0x4a703c=0xce;}_0x34c27a[_0x4ae7('0x1e')](_0x4a703c);return _0x34c27a[_0x4ae7('0x1f')](_0x4ae7('0x20'),_0x3498ac+'-'+_0x42cf33+'/'+_0x3448c5)[_0x4ae7('0x21')](_0x361a33);}return null;};}function patchUpdates(_0x172770){return function(_0x148060){try{jsonpatch[_0x4ae7('0x22')](_0x148060,_0x172770,!![]);}catch(_0x4ed0eb){return BPromise['reject'](_0x4ed0eb);}return _0x148060[_0x4ae7('0x23')]();};}function saveUpdates(_0x4b1a0e,_0x5662c9){return function(_0x2b1b0d){if(_0x2b1b0d){return _0x2b1b0d[_0x4ae7('0x24')](_0x4b1a0e)[_0x4ae7('0x25')](function(_0x314a95){return _0x314a95;});}return null;};}function removeEntity(_0x4aa47d,_0x4069dc){return function(_0xadc9f2){if(_0xadc9f2){return _0xadc9f2[_0x4ae7('0x26')]()[_0x4ae7('0x25')](function(){_0x4aa47d[_0x4ae7('0x1e')](0xcc)[_0x4ae7('0x19')]();});}};}function handleEntityNotFound(_0x148040,_0x1ea94d){return function(_0xe39224){if(!_0xe39224){_0x148040[_0x4ae7('0x18')](0x194);}return _0xe39224;};}function handleError(_0x132f10,_0x2f9edc){_0x2f9edc=_0x2f9edc||0x1f4;return function(_0x3bc5c3){logger[_0x4ae7('0x27')](_0x3bc5c3[_0x4ae7('0x28')]);if(_0x3bc5c3[_0x4ae7('0x29')]){delete _0x3bc5c3[_0x4ae7('0x29')];}_0x132f10[_0x4ae7('0x1e')](_0x2f9edc)[_0x4ae7('0x2a')](_0x3bc5c3);};}exports[_0x4ae7('0x2b')]=function(_0x42a230,_0x4ac3b1){var _0xe667df={},_0x1db6ab={},_0x3bd24b={'count':0x0,'rows':[]};var _0x429a4e=_[_0x4ae7('0x2c')](db[_0x4ae7('0x2d')][_0x4ae7('0x2e')],function(_0x660c73){return{'name':_0x660c73[_0x4ae7('0x2f')],'type':_0x660c73['type'][_0x4ae7('0x30')]};});_0x1db6ab[_0x4ae7('0x31')]=_[_0x4ae7('0x2c')](_0x429a4e,_0x4ae7('0x29'));_0x1db6ab[_0x4ae7('0x32')]=_[_0x4ae7('0x33')](_0x42a230[_0x4ae7('0x32')]);_0x1db6ab[_0x4ae7('0x34')]=_[_0x4ae7('0x35')](_0x1db6ab[_0x4ae7('0x31')],_0x1db6ab[_0x4ae7('0x32')]);_0xe667df[_0x4ae7('0x36')]=_['intersection'](_0x1db6ab[_0x4ae7('0x31')],qs[_0x4ae7('0x37')](_0x42a230[_0x4ae7('0x32')][_0x4ae7('0x37')]));_0xe667df['attributes']=_0xe667df[_0x4ae7('0x36')][_0x4ae7('0x38')]?_0xe667df['attributes']:_0x1db6ab['model'];if(!_0x42a230['query'][_0x4ae7('0x39')]('nolimit')){_0xe667df[_0x4ae7('0x1b')]=qs['limit'](_0x42a230['query'][_0x4ae7('0x1b')]);_0xe667df[_0x4ae7('0x1d')]=qs[_0x4ae7('0x1d')](_0x42a230['query'][_0x4ae7('0x1d')]);}_0xe667df[_0x4ae7('0x3a')]=qs[_0x4ae7('0x3b')](_0x42a230[_0x4ae7('0x32')]['sort']);_0xe667df[_0x4ae7('0x3c')]=qs[_0x4ae7('0x34')](_['pick'](_0x42a230[_0x4ae7('0x32')],_0x1db6ab[_0x4ae7('0x34')]),_0x429a4e);if(_0x42a230[_0x4ae7('0x32')]['filter']){_0xe667df[_0x4ae7('0x3c')]=_['merge'](_0xe667df[_0x4ae7('0x3c')],{'$or':_[_0x4ae7('0x2c')](_0x429a4e,function(_0x28a81c){if(_0x28a81c[_0x4ae7('0x3d')]!==_0x4ae7('0x3e')){var _0x2a41c6={};_0x2a41c6[_0x28a81c[_0x4ae7('0x29')]]={'$like':'%'+_0x42a230['query']['filter']+'%'};return _0x2a41c6;}})});}_0xe667df=_['merge']({},_0xe667df,_0x42a230['options']);var _0x445c75={'where':_0xe667df['where']};return db[_0x4ae7('0x2d')][_0x4ae7('0x1c')](_0x445c75)['then'](function(_0x45e090){_0x3bd24b[_0x4ae7('0x1c')]=_0x45e090;if(_0x42a230['query']['includeAll']){_0xe667df[_0x4ae7('0x3f')]=[{'all':!![]}];}return db[_0x4ae7('0x2d')][_0x4ae7('0x40')](_0xe667df);})[_0x4ae7('0x25')](function(_0x54c366){_0x3bd24b[_0x4ae7('0x41')]=_0x54c366;return _0x3bd24b;})[_0x4ae7('0x25')](respondWithFilteredResult(_0x4ac3b1,_0xe667df))[_0x4ae7('0x42')](handleError(_0x4ac3b1,null));};exports[_0x4ae7('0x43')]=function(_0x16e4e9,_0x6751b1){var _0x8590f1={'raw':!![],'where':{'id':_0x16e4e9[_0x4ae7('0x44')]['id']}},_0x3991e3={};_0x3991e3[_0x4ae7('0x31')]=_['keys'](db['OpenchannelQueueReport'][_0x4ae7('0x2e')]);_0x3991e3[_0x4ae7('0x32')]=_['keys'](_0x16e4e9[_0x4ae7('0x32')]);_0x3991e3['filters']=_[_0x4ae7('0x35')](_0x3991e3[_0x4ae7('0x31')],_0x3991e3[_0x4ae7('0x32')]);_0x8590f1['attributes']=_[_0x4ae7('0x35')](_0x3991e3[_0x4ae7('0x31')],qs['fields'](_0x16e4e9[_0x4ae7('0x32')]['fields']));_0x8590f1[_0x4ae7('0x36')]=_0x8590f1['attributes'][_0x4ae7('0x38')]?_0x8590f1['attributes']:_0x3991e3[_0x4ae7('0x31')];if(_0x16e4e9[_0x4ae7('0x32')][_0x4ae7('0x45')]){_0x8590f1[_0x4ae7('0x3f')]=[{'all':!![]}];}_0x8590f1=_[_0x4ae7('0x46')]({},_0x8590f1,_0x16e4e9[_0x4ae7('0x47')]);return db[_0x4ae7('0x2d')][_0x4ae7('0x48')](_0x8590f1)[_0x4ae7('0x25')](handleEntityNotFound(_0x6751b1,null))[_0x4ae7('0x25')](respondWithResult(_0x6751b1,null))[_0x4ae7('0x42')](handleError(_0x6751b1,null));};exports[_0x4ae7('0x49')]=function(_0x48a99d,_0x85aa51){return db[_0x4ae7('0x2d')][_0x4ae7('0x49')](_0x48a99d[_0x4ae7('0x4a')],{})[_0x4ae7('0x25')](respondWithResult(_0x85aa51,0xc9))['catch'](handleError(_0x85aa51,null));};exports[_0x4ae7('0x24')]=function(_0x323594,_0xb6b975){if(_0x323594[_0x4ae7('0x4a')]['id']){delete _0x323594[_0x4ae7('0x4a')]['id'];}return db[_0x4ae7('0x2d')]['find']({'where':{'id':_0x323594[_0x4ae7('0x44')]['id']}})[_0x4ae7('0x25')](handleEntityNotFound(_0xb6b975,null))[_0x4ae7('0x25')](saveUpdates(_0x323594['body'],null))[_0x4ae7('0x25')](respondWithResult(_0xb6b975,null))[_0x4ae7('0x42')](handleError(_0xb6b975,null));};exports[_0x4ae7('0x26')]=function(_0x403d62,_0x262ba1){return db[_0x4ae7('0x2d')][_0x4ae7('0x48')]({'where':{'id':_0x403d62['params']['id']}})[_0x4ae7('0x25')](handleEntityNotFound(_0x262ba1,null))['then'](removeEntity(_0x262ba1,null))[_0x4ae7('0x42')](handleError(_0x262ba1,null));};exports[_0x4ae7('0x4b')]=function(_0x428f6b,_0x494ff7){return db[_0x4ae7('0x2d')][_0x4ae7('0x4b')]()['then'](respondWithResult(_0x494ff7,null))['catch'](handleError(_0x494ff7,null));};
\ No newline at end of file
index 3cce789..342c459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x1fa6ec,_0x54953b){var _0x16a3d3=function(_0x2c179f){while(--_0x2c179f){_0x1fa6ec['push'](_0x1fa6ec['shift']());}};_0x16a3d3(++_0x54953b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x5fc3[_0x3f3f40];return _0x403b7a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x376e99,_0x1eb6e2){var _0x18df41=function(_0x463bf0){while(--_0x463bf0){_0x376e99['push'](_0x376e99['shift']());}};_0x18df41(++_0x1eb6e2);}(_0x7a54,0x106));var _0x47a5=function(_0x56441d,_0x2f1e0c){_0x56441d=_0x56441d-0x0;var _0x1259a5=_0x7a54[_0x56441d];return _0x1259a5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4804ade..b9ca91e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['raw','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x192552,_0x47dbe9){_0x192552=_0x192552-0x0;var _0x5d0d06=_0x9ffd[_0x192552];return _0x5d0d06;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')](_0x3afd19[_0xd9ff('0x1a')],{'raw':_0x3afd19[_0xd9ff('0x1b')]?_0x3afd19[_0xd9ff('0x1b')][_0xd9ff('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4cf8ec){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug']('CreateOpenchannelQueueReport',_0x3afd19,JSON['stringify'](_0x4cf8ec));_0x2d4df1(_0x4cf8ec);})['catch'](function(_0x1f4d9e){logger['error'](_0xd9ff('0x17'),_0x1f4d9e[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x1f4d9e[_0xd9ff('0x13')]));});});};exports[_0xd9ff('0x1d')]=function(_0x42a828){var _0x4b058a=this;return new Promise(function(_0x4fada1,_0x1136e9){return db['OpenchannelQueueReport'][_0xd9ff('0x1e')](_0x42a828['body'],{'raw':_0x42a828[_0xd9ff('0x1b')]?_0x42a828['options'][_0xd9ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a828[_0xd9ff('0x1b')]?_0x42a828[_0xd9ff('0x1b')][_0xd9ff('0x1f')]||null:null,'attributes':_0x42a828['options']?_0x42a828[_0xd9ff('0x1b')][_0xd9ff('0x20')]||null:null,'limit':_0x42a828[_0xd9ff('0x1b')]?_0x42a828[_0xd9ff('0x1b')]['limit']||null:null})[_0xd9ff('0xc')](function(_0x3792d9){logger[_0xd9ff('0x15')](_0xd9ff('0x1d'),_0x42a828);logger[_0xd9ff('0xd')](_0xd9ff('0x1d'),_0x42a828,JSON[_0xd9ff('0x10')](_0x3792d9));_0x4fada1(_0x3792d9);})[_0xd9ff('0x16')](function(_0x3dc443){logger['error'](_0xd9ff('0x1d'),_0x3dc443['message'],_0x42a828);_0x1136e9(_0x4b058a[_0xd9ff('0x11')](0x1f4,_0x3dc443[_0xd9ff('0x13')]));});});};
\ No newline at end of file
+var _0x0972=['UpdateOpenchannelQueueReport','update','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch'];(function(_0x2c0fd5,_0x68443e){var _0x499136=function(_0x2d9579){while(--_0x2d9579){_0x2c0fd5['push'](_0x2c0fd5['shift']());}};_0x499136(++_0x68443e);}(_0x0972,0x64));var _0x2097=function(_0x220f21,_0x2348fd){_0x220f21=_0x220f21-0x0;var _0xb30acb=_0x0972[_0x220f21];return _0xb30acb;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4f21,_0x59739f,_0x332aac){return new BPromise(function(_0x1e661a,_0x11d263){return client[_0x2097('0xa')](_0x2b4f21,_0x332aac)[_0x2097('0xb')](function(_0x59d947){logger[_0x2097('0xc')](_0x2097('0xd'),_0x59739f,_0x2097('0xe'));logger[_0x2097('0xf')](_0x2097('0x10'),_0x59739f,_0x2097('0xe'),JSON[_0x2097('0x11')](_0x59d947));if(_0x59d947[_0x2097('0x12')]){if(_0x59d947[_0x2097('0x12')][_0x2097('0x13')]===0x1f4){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x11d263(_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);}logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x1e661a(_0x59d947['error'][_0x2097('0x14')]);}else{logger[_0x2097('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x59739f,'request\x20sent');_0x1e661a(_0x59d947['result'][_0x2097('0x14')]);}})['catch'](function(_0x28c35c){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x28c35c);_0x11d263(_0x28c35c);});});}exports[_0x2097('0x15')]=function(_0x44c584){var _0x53e2b4=this;return new Promise(function(_0x324652,_0x140094){return db[_0x2097('0x16')][_0x2097('0x17')](_0x44c584[_0x2097('0x18')],{'raw':_0x44c584[_0x2097('0x19')]?_0x44c584[_0x2097('0x19')][_0x2097('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4d957e){logger[_0x2097('0xc')]('CreateOpenchannelQueueReport',_0x44c584);logger[_0x2097('0xf')](_0x2097('0x15'),_0x44c584,JSON['stringify'](_0x4d957e));_0x324652(_0x4d957e);})[_0x2097('0x1b')](function(_0x5b0582){logger[_0x2097('0x12')](_0x2097('0x15'),_0x5b0582[_0x2097('0x14')],_0x44c584);_0x140094(_0x53e2b4[_0x2097('0x12')](0x1f4,_0x5b0582[_0x2097('0x14')]));});});};exports[_0x2097('0x1c')]=function(_0x56390a){var _0xae5f9=this;return new Promise(function(_0x500234,_0x3f9279){return db[_0x2097('0x16')][_0x2097('0x1d')](_0x56390a[_0x2097('0x18')],{'raw':_0x56390a['options']?_0x56390a[_0x2097('0x19')][_0x2097('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56390a['options']?_0x56390a[_0x2097('0x19')]['where']||null:null,'attributes':_0x56390a[_0x2097('0x19')]?_0x56390a['options'][_0x2097('0x1e')]||null:null,'limit':_0x56390a[_0x2097('0x19')]?_0x56390a[_0x2097('0x19')][_0x2097('0x1f')]||null:null})[_0x2097('0xb')](function(_0x36228c){logger[_0x2097('0xc')]('UpdateOpenchannelQueueReport',_0x56390a);logger[_0x2097('0xf')](_0x2097('0x1c'),_0x56390a,JSON['stringify'](_0x36228c));_0x500234(_0x36228c);})[_0x2097('0x1b')](function(_0x41487d){logger['error']('UpdateOpenchannelQueueReport',_0x41487d[_0x2097('0x14')],_0x56390a);_0x3f9279(_0xae5f9[_0x2097('0x12')](0x1f4,_0x41487d[_0x2097('0x14')]));});});};
\ No newline at end of file
index 44e2f8c..9948771 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x501f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x501f,0x107));var _0xf501=function(_0xa564ec,_0x99b1d){_0xa564ec=_0xa564ec-0x0;var _0x5d0ae6=_0x501f[_0xa564ec];return _0x5d0ae6;};'use strict';var multer=require('multer');var util=require(_0xf501('0x0'));var path=require('path');var timeout=require(_0xf501('0x1'));var express=require(_0xf501('0x2'));var router=express[_0xf501('0x3')]();var fs_extra=require(_0xf501('0x4'));var auth=require(_0xf501('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf501('0x6'));var controller=require(_0xf501('0x7'));router[_0xf501('0x8')]('/',auth['isAuthenticated'](),controller[_0xf501('0x9')]);router[_0xf501('0x8')](_0xf501('0xa'),auth[_0xf501('0xb')](),controller[_0xf501('0xc')]);router[_0xf501('0x8')](_0xf501('0xd'),auth[_0xf501('0xb')](),controller[_0xf501('0xe')]);router[_0xf501('0xf')]('/',auth[_0xf501('0xb')](),controller[_0xf501('0x10')]);router[_0xf501('0x11')]('/:id',auth[_0xf501('0xb')](),controller[_0xf501('0x12')]);router[_0xf501('0x13')]('/:id',auth[_0xf501('0xb')](),controller[_0xf501('0x14')]);module[_0xf501('0x15')]=router;
\ No newline at end of file
+var _0x9af2=['../../config/environment','./openchannelTransferReport.controller','isAuthenticated','/describe','describe','get','show','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b6fdf,_0x2900ea){var _0x27132a=function(_0x156f9a){while(--_0x156f9a){_0x1b6fdf['push'](_0x1b6fdf['shift']());}};_0x27132a(++_0x2900ea);}(_0x9af2,0x83));var _0x29af=function(_0x45b44c,_0x4f2dda){_0x45b44c=_0x45b44c-0x0;var _0x441ffe=_0x9af2[_0x45b44c];return _0x441ffe;};'use strict';var multer=require(_0x29af('0x0'));var util=require(_0x29af('0x1'));var path=require(_0x29af('0x2'));var timeout=require(_0x29af('0x3'));var express=require(_0x29af('0x4'));var router=express[_0x29af('0x5')]();var fs_extra=require(_0x29af('0x6'));var auth=require(_0x29af('0x7'));var interaction=require(_0x29af('0x8'));var config=require(_0x29af('0x9'));var controller=require(_0x29af('0xa'));router['get']('/',auth[_0x29af('0xb')](),controller['index']);router['get'](_0x29af('0xc'),auth[_0x29af('0xb')](),controller[_0x29af('0xd')]);router[_0x29af('0xe')]('/:id',auth[_0x29af('0xb')](),controller[_0x29af('0xf')]);router['post']('/',auth[_0x29af('0xb')](),controller[_0x29af('0x10')]);router[_0x29af('0x11')](_0x29af('0x12'),auth[_0x29af('0xb')](),controller['update']);router['delete'](_0x29af('0x12'),auth[_0x29af('0xb')](),controller['destroy']);module[_0x29af('0x13')]=router;
\ No newline at end of file
index bdda703..a811b38 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(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x34e8,0x12c));var _0x834e=function(_0x5ac9be,_0x334890){_0x5ac9be=_0x5ac9be-0x0;var _0x25eda3=_0x34e8[_0x5ac9be];return _0x25eda3;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x503325,_0x24a407){var _0x452fff=function(_0x42bf26){while(--_0x42bf26){_0x503325['push'](_0x503325['shift']());}};_0x452fff(++_0x24a407);}(_0x34e8,0x12c));var _0x834e=function(_0x12178d,_0x5fb1c8){_0x12178d=_0x12178d-0x0;var _0x47eeb2=_0x34e8[_0x12178d];return _0x47eeb2;};'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 b4f97f7..0956f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4c3=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','undefined','limit','offset','set','apply','then','end','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2e7fc4,_0x7de89e){var _0x3bde06=function(_0x484445){while(--_0x484445){_0x2e7fc4['push'](_0x2e7fc4['shift']());}};_0x3bde06(++_0x7de89e);}(_0xd4c3,0x86));var _0x3d4c=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0xd4c3[_0x28fbe3];return _0x45db6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d4c('0x0'));var zipdir=require(_0x3d4c('0x1'));var jsonpatch=require(_0x3d4c('0x2'));var rp=require(_0x3d4c('0x3'));var moment=require(_0x3d4c('0x4'));var BPromise=require(_0x3d4c('0x5'));var Mustache=require(_0x3d4c('0x6'));var util=require(_0x3d4c('0x7'));var path=require(_0x3d4c('0x8'));var sox=require(_0x3d4c('0x9'));var csv=require(_0x3d4c('0xa'));var ejs=require(_0x3d4c('0xb'));var fs=require('fs');var fs_extra=require(_0x3d4c('0xc'));var _=require(_0x3d4c('0xd'));var squel=require('squel');var crypto=require(_0x3d4c('0xe'));var jsforce=require(_0x3d4c('0xf'));var deskjs=require(_0x3d4c('0x10'));var toCsv=require(_0x3d4c('0xa'));var querystring=require(_0x3d4c('0x11'));var Papa=require(_0x3d4c('0x12'));var Redis=require(_0x3d4c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3d4c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d4c('0x15'));var logger=require('../../config/logger')(_0x3d4c('0x16'));var utils=require(_0x3d4c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3d4c('0x18'))['db'];function respondWithStatusCode(_0x13233e,_0x2d21eb){_0x2d21eb=_0x2d21eb||0xcc;return function(_0x4fd96b){if(_0x4fd96b){return _0x13233e['sendStatus'](_0x2d21eb);}return _0x13233e[_0x3d4c('0x19')](_0x2d21eb)['end']();};}function respondWithResult(_0x485f3e,_0x3f3d6e){_0x3f3d6e=_0x3f3d6e||0xc8;return function(_0x47c1dc){if(_0x47c1dc){return _0x485f3e[_0x3d4c('0x19')](_0x3f3d6e)[_0x3d4c('0x1a')](_0x47c1dc);}};}function respondWithFilteredResult(_0x13d63a,_0x5a2223){return function(_0x463cb5){if(_0x463cb5){var _0x4ba35b=typeof _0x5a2223['offset']===_0x3d4c('0x1b')&&typeof _0x5a2223[_0x3d4c('0x1c')]===_0x3d4c('0x1b');var _0x3ed01f=_0x463cb5['count'];var _0x4c1f79=_0x4ba35b?0x0:_0x5a2223[_0x3d4c('0x1d')];var _0x5daf09=_0x4ba35b?_0x463cb5['count']:_0x5a2223['offset']+_0x5a2223[_0x3d4c('0x1c')];var _0x5ceb35;if(_0x5daf09>=_0x3ed01f){_0x5daf09=_0x3ed01f;_0x5ceb35=0xc8;}else{_0x5ceb35=0xce;}_0x13d63a[_0x3d4c('0x19')](_0x5ceb35);return _0x13d63a[_0x3d4c('0x1e')]('Content-Range',_0x4c1f79+'-'+_0x5daf09+'/'+_0x3ed01f)[_0x3d4c('0x1a')](_0x463cb5);}return null;};}function patchUpdates(_0x13b62c){return function(_0x947334){try{jsonpatch[_0x3d4c('0x1f')](_0x947334,_0x13b62c,!![]);}catch(_0x2535e2){return BPromise['reject'](_0x2535e2);}return _0x947334['save']();};}function saveUpdates(_0x48cea4,_0x567e0d){return function(_0x3663ea){if(_0x3663ea){return _0x3663ea['update'](_0x48cea4)[_0x3d4c('0x20')](function(_0xd8122b){return _0xd8122b;});}return null;};}function removeEntity(_0xf24da1,_0x139b22){return function(_0x4af6e8){if(_0x4af6e8){return _0x4af6e8['destroy']()['then'](function(){_0xf24da1[_0x3d4c('0x19')](0xcc)[_0x3d4c('0x21')]();});}};}function handleEntityNotFound(_0x435b78,_0x4a9e76){return function(_0x4183ef){if(!_0x4183ef){_0x435b78['sendStatus'](0x194);}return _0x4183ef;};}function handleError(_0x8c460c,_0x440f08){_0x440f08=_0x440f08||0x1f4;return function(_0x43aabd){logger['error'](_0x43aabd[_0x3d4c('0x22')]);if(_0x43aabd[_0x3d4c('0x23')]){delete _0x43aabd[_0x3d4c('0x23')];}_0x8c460c[_0x3d4c('0x19')](_0x440f08)[_0x3d4c('0x24')](_0x43aabd);};}exports['index']=function(_0x1259ba,_0x5b297b){var _0x56dc0b={},_0x423b51={},_0x5070e8={'count':0x0,'rows':[]};var _0x1a2b17=_[_0x3d4c('0x25')](db[_0x3d4c('0x26')][_0x3d4c('0x27')],function(_0x289308){return{'name':_0x289308[_0x3d4c('0x28')],'type':_0x289308[_0x3d4c('0x29')][_0x3d4c('0x2a')]};});_0x423b51[_0x3d4c('0x2b')]=_['map'](_0x1a2b17,_0x3d4c('0x23'));_0x423b51[_0x3d4c('0x2c')]=_['keys'](_0x1259ba[_0x3d4c('0x2c')]);_0x423b51[_0x3d4c('0x2d')]=_[_0x3d4c('0x2e')](_0x423b51[_0x3d4c('0x2b')],_0x423b51['query']);_0x56dc0b[_0x3d4c('0x2f')]=_[_0x3d4c('0x2e')](_0x423b51[_0x3d4c('0x2b')],qs[_0x3d4c('0x30')](_0x1259ba[_0x3d4c('0x2c')][_0x3d4c('0x30')]));_0x56dc0b[_0x3d4c('0x2f')]=_0x56dc0b[_0x3d4c('0x2f')][_0x3d4c('0x31')]?_0x56dc0b[_0x3d4c('0x2f')]:_0x423b51[_0x3d4c('0x2b')];if(!_0x1259ba[_0x3d4c('0x2c')]['hasOwnProperty'](_0x3d4c('0x32'))){_0x56dc0b[_0x3d4c('0x1c')]=qs['limit'](_0x1259ba['query']['limit']);_0x56dc0b['offset']=qs[_0x3d4c('0x1d')](_0x1259ba[_0x3d4c('0x2c')][_0x3d4c('0x1d')]);}_0x56dc0b[_0x3d4c('0x33')]=qs[_0x3d4c('0x34')](_0x1259ba[_0x3d4c('0x2c')][_0x3d4c('0x34')]);_0x56dc0b[_0x3d4c('0x35')]=qs[_0x3d4c('0x2d')](_[_0x3d4c('0x36')](_0x1259ba[_0x3d4c('0x2c')],_0x423b51[_0x3d4c('0x2d')]),_0x1a2b17);if(_0x1259ba[_0x3d4c('0x2c')][_0x3d4c('0x37')]){_0x56dc0b[_0x3d4c('0x35')]=_[_0x3d4c('0x38')](_0x56dc0b[_0x3d4c('0x35')],{'$or':_['map'](_0x1a2b17,function(_0x44ebaf){if(_0x44ebaf['type']!==_0x3d4c('0x39')){var _0x49437a={};_0x49437a[_0x44ebaf[_0x3d4c('0x23')]]={'$like':'%'+_0x1259ba[_0x3d4c('0x2c')][_0x3d4c('0x37')]+'%'};return _0x49437a;}})});}_0x56dc0b=_[_0x3d4c('0x38')]({},_0x56dc0b,_0x1259ba['options']);var _0x107111={'where':_0x56dc0b[_0x3d4c('0x35')]};return db['OpenchannelTransferReport']['count'](_0x107111)[_0x3d4c('0x20')](function(_0x65e760){_0x5070e8[_0x3d4c('0x3a')]=_0x65e760;if(_0x1259ba[_0x3d4c('0x2c')][_0x3d4c('0x3b')]){_0x56dc0b[_0x3d4c('0x3c')]=[{'all':!![]}];}return db[_0x3d4c('0x26')][_0x3d4c('0x3d')](_0x56dc0b);})[_0x3d4c('0x20')](function(_0x4aa98a){_0x5070e8[_0x3d4c('0x3e')]=_0x4aa98a;return _0x5070e8;})['then'](respondWithFilteredResult(_0x5b297b,_0x56dc0b))['catch'](handleError(_0x5b297b,null));};exports[_0x3d4c('0x3f')]=function(_0x2fbd91,_0xf753cc){var _0x491060={'raw':!![],'where':{'id':_0x2fbd91[_0x3d4c('0x40')]['id']}},_0x3076d4={};_0x3076d4[_0x3d4c('0x2b')]=_['keys'](db['OpenchannelTransferReport'][_0x3d4c('0x27')]);_0x3076d4[_0x3d4c('0x2c')]=_[_0x3d4c('0x41')](_0x2fbd91[_0x3d4c('0x2c')]);_0x3076d4[_0x3d4c('0x2d')]=_['intersection'](_0x3076d4[_0x3d4c('0x2b')],_0x3076d4[_0x3d4c('0x2c')]);_0x491060[_0x3d4c('0x2f')]=_[_0x3d4c('0x2e')](_0x3076d4[_0x3d4c('0x2b')],qs['fields'](_0x2fbd91[_0x3d4c('0x2c')][_0x3d4c('0x30')]));_0x491060[_0x3d4c('0x2f')]=_0x491060['attributes']['length']?_0x491060[_0x3d4c('0x2f')]:_0x3076d4[_0x3d4c('0x2b')];if(_0x2fbd91[_0x3d4c('0x2c')][_0x3d4c('0x3b')]){_0x491060['include']=[{'all':!![]}];}_0x491060=_['merge']({},_0x491060,_0x2fbd91[_0x3d4c('0x42')]);return db[_0x3d4c('0x26')][_0x3d4c('0x43')](_0x491060)[_0x3d4c('0x20')](handleEntityNotFound(_0xf753cc,null))['then'](respondWithResult(_0xf753cc,null))[_0x3d4c('0x44')](handleError(_0xf753cc,null));};exports[_0x3d4c('0x45')]=function(_0x47a894,_0x55d273){return db[_0x3d4c('0x26')][_0x3d4c('0x45')](_0x47a894[_0x3d4c('0x46')],{})[_0x3d4c('0x20')](respondWithResult(_0x55d273,0xc9))[_0x3d4c('0x44')](handleError(_0x55d273,null));};exports[_0x3d4c('0x47')]=function(_0x4386c4,_0x48867b){if(_0x4386c4[_0x3d4c('0x46')]['id']){delete _0x4386c4[_0x3d4c('0x46')]['id'];}return db[_0x3d4c('0x26')][_0x3d4c('0x43')]({'where':{'id':_0x4386c4[_0x3d4c('0x40')]['id']}})[_0x3d4c('0x20')](handleEntityNotFound(_0x48867b,null))[_0x3d4c('0x20')](saveUpdates(_0x4386c4['body'],null))['then'](respondWithResult(_0x48867b,null))['catch'](handleError(_0x48867b,null));};exports[_0x3d4c('0x48')]=function(_0x2c0569,_0x35a9ff){return db[_0x3d4c('0x26')]['find']({'where':{'id':_0x2c0569[_0x3d4c('0x40')]['id']}})[_0x3d4c('0x20')](handleEntityNotFound(_0x35a9ff,null))[_0x3d4c('0x20')](removeEntity(_0x35a9ff,null))['catch'](handleError(_0x35a9ff,null));};exports['describe']=function(_0x243341,_0x3a2b40){return db[_0x3d4c('0x26')][_0x3d4c('0x49')]()['then'](respondWithResult(_0x3a2b40,null))['catch'](handleError(_0x3a2b40,null));};
\ No newline at end of file
+var _0xea35=['sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','map','OpenchannelTransferReport','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x18fa6f,_0x1067a7){var _0x11c9d9=function(_0x202885){while(--_0x202885){_0x18fa6f['push'](_0x18fa6f['shift']());}};_0x11c9d9(++_0x1067a7);}(_0xea35,0x11b));var _0x5ea3=function(_0x2ae16e,_0x3ce019){_0x2ae16e=_0x2ae16e-0x0;var _0x2e7e2c=_0xea35[_0x2ae16e];return _0x2e7e2c;};'use strict';var emlformat=require(_0x5ea3('0x0'));var rimraf=require(_0x5ea3('0x1'));var zipdir=require(_0x5ea3('0x2'));var jsonpatch=require(_0x5ea3('0x3'));var rp=require(_0x5ea3('0x4'));var moment=require('moment');var BPromise=require(_0x5ea3('0x5'));var Mustache=require(_0x5ea3('0x6'));var util=require(_0x5ea3('0x7'));var path=require(_0x5ea3('0x8'));var sox=require(_0x5ea3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ea3('0xa'));var _=require(_0x5ea3('0xb'));var squel=require('squel');var crypto=require(_0x5ea3('0xc'));var jsforce=require(_0x5ea3('0xd'));var deskjs=require(_0x5ea3('0xe'));var toCsv=require(_0x5ea3('0xf'));var querystring=require(_0x5ea3('0x10'));var Papa=require(_0x5ea3('0x11'));var Redis=require(_0x5ea3('0x12'));var authService=require(_0x5ea3('0x13'));var qs=require(_0x5ea3('0x14'));var as=require(_0x5ea3('0x15'));var hardwareService=require(_0x5ea3('0x16'));var logger=require(_0x5ea3('0x17'))(_0x5ea3('0x18'));var utils=require(_0x5ea3('0x19'));var config=require(_0x5ea3('0x1a'));var licenseUtil=require(_0x5ea3('0x1b'));var db=require(_0x5ea3('0x1c'))['db'];function respondWithStatusCode(_0x267d22,_0x5d6f47){_0x5d6f47=_0x5d6f47||0xcc;return function(_0x262a19){if(_0x262a19){return _0x267d22[_0x5ea3('0x1d')](_0x5d6f47);}return _0x267d22[_0x5ea3('0x1e')](_0x5d6f47)[_0x5ea3('0x1f')]();};}function respondWithResult(_0x243184,_0x55da96){_0x55da96=_0x55da96||0xc8;return function(_0x57e998){if(_0x57e998){return _0x243184['status'](_0x55da96)[_0x5ea3('0x20')](_0x57e998);}};}function respondWithFilteredResult(_0x3bd531,_0x1c45a3){return function(_0x148e67){if(_0x148e67){var _0x201650=typeof _0x1c45a3['offset']===_0x5ea3('0x21')&&typeof _0x1c45a3[_0x5ea3('0x22')]===_0x5ea3('0x21');var _0x496a05=_0x148e67[_0x5ea3('0x23')];var _0x96dc=_0x201650?0x0:_0x1c45a3[_0x5ea3('0x24')];var _0x19d65c=_0x201650?_0x148e67[_0x5ea3('0x23')]:_0x1c45a3[_0x5ea3('0x24')]+_0x1c45a3[_0x5ea3('0x22')];var _0x241663;if(_0x19d65c>=_0x496a05){_0x19d65c=_0x496a05;_0x241663=0xc8;}else{_0x241663=0xce;}_0x3bd531['status'](_0x241663);return _0x3bd531[_0x5ea3('0x25')]('Content-Range',_0x96dc+'-'+_0x19d65c+'/'+_0x496a05)[_0x5ea3('0x20')](_0x148e67);}return null;};}function patchUpdates(_0x5505b4){return function(_0x13dc0b){try{jsonpatch[_0x5ea3('0x26')](_0x13dc0b,_0x5505b4,!![]);}catch(_0x456cd5){return BPromise[_0x5ea3('0x27')](_0x456cd5);}return _0x13dc0b[_0x5ea3('0x28')]();};}function saveUpdates(_0x56e76d,_0x5b0a3b){return function(_0x48b309){if(_0x48b309){return _0x48b309['update'](_0x56e76d)[_0x5ea3('0x29')](function(_0x9cd794){return _0x9cd794;});}return null;};}function removeEntity(_0x5ecd0b,_0x5b6d34){return function(_0xd3d076){if(_0xd3d076){return _0xd3d076[_0x5ea3('0x2a')]()[_0x5ea3('0x29')](function(){_0x5ecd0b[_0x5ea3('0x1e')](0xcc)[_0x5ea3('0x1f')]();});}};}function handleEntityNotFound(_0x4683b2,_0x559626){return function(_0x399a85){if(!_0x399a85){_0x4683b2[_0x5ea3('0x1d')](0x194);}return _0x399a85;};}function handleError(_0x1a1805,_0x480e3a){_0x480e3a=_0x480e3a||0x1f4;return function(_0x4d998f){logger[_0x5ea3('0x2b')](_0x4d998f[_0x5ea3('0x2c')]);if(_0x4d998f['name']){delete _0x4d998f[_0x5ea3('0x2d')];}_0x1a1805[_0x5ea3('0x1e')](_0x480e3a)['send'](_0x4d998f);};}exports['index']=function(_0x1dd4a6,_0x4c6446){var _0x44ccb8={},_0x31770c={},_0x22de8c={'count':0x0,'rows':[]};var _0x39f7ab=_[_0x5ea3('0x2e')](db[_0x5ea3('0x2f')]['rawAttributes'],function(_0x1d84ee){return{'name':_0x1d84ee[_0x5ea3('0x30')],'type':_0x1d84ee[_0x5ea3('0x31')]['key']};});_0x31770c['model']=_[_0x5ea3('0x2e')](_0x39f7ab,'name');_0x31770c['query']=_[_0x5ea3('0x32')](_0x1dd4a6[_0x5ea3('0x33')]);_0x31770c[_0x5ea3('0x34')]=_[_0x5ea3('0x35')](_0x31770c[_0x5ea3('0x36')],_0x31770c[_0x5ea3('0x33')]);_0x44ccb8[_0x5ea3('0x37')]=_[_0x5ea3('0x35')](_0x31770c[_0x5ea3('0x36')],qs[_0x5ea3('0x38')](_0x1dd4a6['query'][_0x5ea3('0x38')]));_0x44ccb8[_0x5ea3('0x37')]=_0x44ccb8[_0x5ea3('0x37')]['length']?_0x44ccb8[_0x5ea3('0x37')]:_0x31770c[_0x5ea3('0x36')];if(!_0x1dd4a6[_0x5ea3('0x33')][_0x5ea3('0x39')](_0x5ea3('0x3a'))){_0x44ccb8['limit']=qs[_0x5ea3('0x22')](_0x1dd4a6['query']['limit']);_0x44ccb8['offset']=qs[_0x5ea3('0x24')](_0x1dd4a6['query'][_0x5ea3('0x24')]);}_0x44ccb8[_0x5ea3('0x3b')]=qs['sort'](_0x1dd4a6['query'][_0x5ea3('0x3c')]);_0x44ccb8[_0x5ea3('0x3d')]=qs[_0x5ea3('0x34')](_[_0x5ea3('0x3e')](_0x1dd4a6[_0x5ea3('0x33')],_0x31770c[_0x5ea3('0x34')]),_0x39f7ab);if(_0x1dd4a6[_0x5ea3('0x33')][_0x5ea3('0x3f')]){_0x44ccb8['where']=_[_0x5ea3('0x40')](_0x44ccb8[_0x5ea3('0x3d')],{'$or':_[_0x5ea3('0x2e')](_0x39f7ab,function(_0x4c4ad0){if(_0x4c4ad0['type']!=='VIRTUAL'){var _0x419d95={};_0x419d95[_0x4c4ad0['name']]={'$like':'%'+_0x1dd4a6[_0x5ea3('0x33')]['filter']+'%'};return _0x419d95;}})});}_0x44ccb8=_[_0x5ea3('0x40')]({},_0x44ccb8,_0x1dd4a6[_0x5ea3('0x41')]);var _0x235010={'where':_0x44ccb8[_0x5ea3('0x3d')]};return db[_0x5ea3('0x2f')][_0x5ea3('0x23')](_0x235010)['then'](function(_0x146f28){_0x22de8c[_0x5ea3('0x23')]=_0x146f28;if(_0x1dd4a6[_0x5ea3('0x33')][_0x5ea3('0x42')]){_0x44ccb8[_0x5ea3('0x43')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x44ccb8);})[_0x5ea3('0x29')](function(_0x2ce556){_0x22de8c[_0x5ea3('0x44')]=_0x2ce556;return _0x22de8c;})[_0x5ea3('0x29')](respondWithFilteredResult(_0x4c6446,_0x44ccb8))[_0x5ea3('0x45')](handleError(_0x4c6446,null));};exports[_0x5ea3('0x46')]=function(_0x5b89d5,_0x5db0b0){var _0x342a31={'raw':!![],'where':{'id':_0x5b89d5[_0x5ea3('0x47')]['id']}},_0x1f8c17={};_0x1f8c17[_0x5ea3('0x36')]=_[_0x5ea3('0x32')](db[_0x5ea3('0x2f')][_0x5ea3('0x48')]);_0x1f8c17[_0x5ea3('0x33')]=_[_0x5ea3('0x32')](_0x5b89d5[_0x5ea3('0x33')]);_0x1f8c17['filters']=_[_0x5ea3('0x35')](_0x1f8c17['model'],_0x1f8c17[_0x5ea3('0x33')]);_0x342a31[_0x5ea3('0x37')]=_['intersection'](_0x1f8c17[_0x5ea3('0x36')],qs[_0x5ea3('0x38')](_0x5b89d5[_0x5ea3('0x33')][_0x5ea3('0x38')]));_0x342a31['attributes']=_0x342a31['attributes']['length']?_0x342a31[_0x5ea3('0x37')]:_0x1f8c17[_0x5ea3('0x36')];if(_0x5b89d5[_0x5ea3('0x33')][_0x5ea3('0x42')]){_0x342a31[_0x5ea3('0x43')]=[{'all':!![]}];}_0x342a31=_[_0x5ea3('0x40')]({},_0x342a31,_0x5b89d5[_0x5ea3('0x41')]);return db[_0x5ea3('0x2f')][_0x5ea3('0x49')](_0x342a31)[_0x5ea3('0x29')](handleEntityNotFound(_0x5db0b0,null))[_0x5ea3('0x29')](respondWithResult(_0x5db0b0,null))[_0x5ea3('0x45')](handleError(_0x5db0b0,null));};exports['create']=function(_0x5996ba,_0x45412b){return db[_0x5ea3('0x2f')][_0x5ea3('0x4a')](_0x5996ba['body'],{})['then'](respondWithResult(_0x45412b,0xc9))[_0x5ea3('0x45')](handleError(_0x45412b,null));};exports[_0x5ea3('0x4b')]=function(_0xca1128,_0x51fa20){if(_0xca1128[_0x5ea3('0x4c')]['id']){delete _0xca1128[_0x5ea3('0x4c')]['id'];}return db[_0x5ea3('0x2f')][_0x5ea3('0x49')]({'where':{'id':_0xca1128['params']['id']}})[_0x5ea3('0x29')](handleEntityNotFound(_0x51fa20,null))[_0x5ea3('0x29')](saveUpdates(_0xca1128['body'],null))[_0x5ea3('0x29')](respondWithResult(_0x51fa20,null))[_0x5ea3('0x45')](handleError(_0x51fa20,null));};exports[_0x5ea3('0x2a')]=function(_0x25be58,_0x56e93c){return db['OpenchannelTransferReport'][_0x5ea3('0x49')]({'where':{'id':_0x25be58[_0x5ea3('0x47')]['id']}})[_0x5ea3('0x29')](handleEntityNotFound(_0x56e93c,null))['then'](removeEntity(_0x56e93c,null))[_0x5ea3('0x45')](handleError(_0x56e93c,null));};exports['describe']=function(_0x658e3d,_0x89744c){return db['OpenchannelTransferReport'][_0x5ea3('0x4d')]()[_0x5ea3('0x29')](respondWithResult(_0x89744c,null))[_0x5ea3('0x45')](handleError(_0x89744c,null));};
\ No newline at end of file
index bcae203..7d0c1bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53fe=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x53fe,0x9d));var _0xe53f=function(_0x498f85,_0x51ddb1){_0x498f85=_0x498f85-0x0;var _0xd23752=_0x53fe[_0x498f85];return _0xd23752;};'use strict';var _=require('lodash');var util=require(_0xe53f('0x0'));var logger=require(_0xe53f('0x1'))(_0xe53f('0x2'));var moment=require(_0xe53f('0x3'));var BPromise=require(_0xe53f('0x4'));var rp=require(_0xe53f('0x5'));var fs=require('fs');var path=require(_0xe53f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe53f('0x7'));module[_0xe53f('0x8')]=function(_0x3b220f,_0x3f8304){return _0x3b220f[_0xe53f('0x9')](_0xe53f('0xa'),attributes,{'tableName':_0xe53f('0xb'),'paranoid':![],'indexes':[{'name':_0xe53f('0xc'),'fields':[_0xe53f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xff30=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x31e05a,_0x300207){var _0x420d44=function(_0x1e29dc){while(--_0x1e29dc){_0x31e05a['push'](_0x31e05a['shift']());}};_0x420d44(++_0x300207);}(_0xff30,0xa5));var _0x0ff3=function(_0x1f18f7,_0x4d97b9){_0x1f18f7=_0x1f18f7-0x0;var _0x1e8654=_0xff30[_0x1f18f7];return _0x1e8654;};'use strict';var _=require(_0x0ff3('0x0'));var util=require(_0x0ff3('0x1'));var logger=require(_0x0ff3('0x2'))('api');var moment=require(_0x0ff3('0x3'));var BPromise=require(_0x0ff3('0x4'));var rp=require(_0x0ff3('0x5'));var fs=require('fs');var path=require(_0x0ff3('0x6'));var rimraf=require(_0x0ff3('0x7'));var config=require(_0x0ff3('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x0ff3('0x9')]=function(_0x3c1483,_0x376677){return _0x3c1483[_0x0ff3('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x0ff3('0xb'),'paranoid':![],'indexes':[{'name':_0x0ff3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 567cd37..b8b93a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bac=['message','info','result','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','then','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x22e5ed,_0x3ec8d2){var _0x4a5d18=function(_0x8f2c9d){while(--_0x8f2c9d){_0x22e5ed['push'](_0x22e5ed['shift']());}};_0x4a5d18(++_0x3ec8d2);}(_0x6bac,0xa5));var _0xc6ba=function(_0x549148,_0x1c1f3c){_0x549148=_0x549148-0x0;var _0x5d5485=_0x6bac[_0x549148];return _0x5d5485;};'use strict';var _=require(_0xc6ba('0x0'));var util=require('util');var moment=require(_0xc6ba('0x1'));var BPromise=require(_0xc6ba('0x2'));var rs=require(_0xc6ba('0x3'));var fs=require('fs');var Redis=require(_0xc6ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc6ba('0x5'));var config=require(_0xc6ba('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc6ba('0x7')][_0xc6ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33167e,_0x42858b,_0x12d6e9){return new BPromise(function(_0x1fa2a8,_0x5b98f9){return client['request'](_0x33167e,_0x12d6e9)[_0xc6ba('0x9')](function(_0x481755){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x42858b,'request\x20sent');logger['debug'](_0xc6ba('0xa'),_0x42858b,_0xc6ba('0xb'),JSON[_0xc6ba('0xc')](_0x481755));if(_0x481755[_0xc6ba('0xd')]){if(_0x481755[_0xc6ba('0xd')]['code']===0x1f4){logger['error'](_0xc6ba('0xe'),_0x42858b,_0x481755[_0xc6ba('0xd')][_0xc6ba('0xf')]);return _0x5b98f9(_0x481755[_0xc6ba('0xd')][_0xc6ba('0xf')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x42858b,_0x481755['error'][_0xc6ba('0xf')]);return _0x1fa2a8(_0x481755[_0xc6ba('0xd')][_0xc6ba('0xf')]);}else{logger[_0xc6ba('0x10')](_0xc6ba('0xe'),_0x42858b,_0xc6ba('0xb'));_0x1fa2a8(_0x481755[_0xc6ba('0x11')][_0xc6ba('0xf')]);}})['catch'](function(_0x52c811){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x42858b,_0x52c811);_0x5b98f9(_0x52c811);});});}
\ No newline at end of file
+var _0xfcbd=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x438cdd,_0x4abeff){var _0x5cc961=function(_0x5ae452){while(--_0x5ae452){_0x438cdd['push'](_0x438cdd['shift']());}};_0x5cc961(++_0x4abeff);}(_0xfcbd,0x160));var _0xdfcb=function(_0x338701,_0x394b64){_0x338701=_0x338701-0x0;var _0x3e6a44=_0xfcbd[_0x338701];return _0x3e6a44;};'use strict';var _=require(_0xdfcb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdfcb('0x1'));var rs=require(_0xdfcb('0x2'));var fs=require('fs');var Redis=require(_0xdfcb('0x3'));var db=require(_0xdfcb('0x4'))['db'];var utils=require(_0xdfcb('0x5'));var logger=require(_0xdfcb('0x6'))(_0xdfcb('0x7'));var config=require(_0xdfcb('0x8'));var jayson=require(_0xdfcb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46956c,_0x183ea8,_0xb8de95){return new BPromise(function(_0x3c5431,_0xbe50d6){return client[_0xdfcb('0xa')](_0x46956c,_0xb8de95)[_0xdfcb('0xb')](function(_0x5e650d){logger[_0xdfcb('0xc')](_0xdfcb('0xd'),_0x183ea8,_0xdfcb('0xe'));logger[_0xdfcb('0xf')](_0xdfcb('0x10'),_0x183ea8,_0xdfcb('0xe'),JSON[_0xdfcb('0x11')](_0x5e650d));if(_0x5e650d[_0xdfcb('0x12')]){if(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x13')]===0x1f4){logger[_0xdfcb('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0xbe50d6(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}logger[_0xdfcb('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0x3c5431(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}else{logger[_0xdfcb('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x183ea8,_0xdfcb('0xe'));_0x3c5431(_0x5e650d[_0xdfcb('0x15')][_0xdfcb('0x14')]);}})[_0xdfcb('0x16')](function(_0x11437d){logger[_0xdfcb('0x12')](_0xdfcb('0xd'),_0x183ea8,_0x11437d);_0xbe50d6(_0x11437d);});});}
\ No newline at end of file
index 55d000e..edcc5e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4380=['show','post','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./pause.controller','get','isAuthenticated','/:id'];(function(_0x1c29e1,_0x5e2a5c){var _0x43be98=function(_0x1d365a){while(--_0x1d365a){_0x1c29e1['push'](_0x1c29e1['shift']());}};_0x43be98(++_0x5e2a5c);}(_0x4380,0x186));var _0x0438=function(_0x505196,_0x5da9c7){_0x505196=_0x505196-0x0;var _0x3e77c1=_0x4380[_0x505196];return _0x3e77c1;};'use strict';var multer=require(_0x0438('0x0'));var util=require(_0x0438('0x1'));var path=require('path');var timeout=require(_0x0438('0x2'));var express=require(_0x0438('0x3'));var router=express['Router']();var fs_extra=require(_0x0438('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0438('0x5'));var controller=require(_0x0438('0x6'));router[_0x0438('0x7')]('/',auth[_0x0438('0x8')](),controller['index']);router[_0x0438('0x7')](_0x0438('0x9'),auth[_0x0438('0x8')](),controller[_0x0438('0xa')]);router[_0x0438('0xb')]('/',auth[_0x0438('0x8')](),controller['create']);router['put'](_0x0438('0x9'),auth['isAuthenticated'](),controller[_0x0438('0xc')]);router[_0x0438('0xd')](_0x0438('0x9'),auth['isAuthenticated'](),controller[_0x0438('0xe')]);module[_0x0438('0xf')]=router;
\ No newline at end of file
+var _0x6cf9=['../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x136036,_0x42bbcc){var _0x151f45=function(_0x8864cc){while(--_0x8864cc){_0x136036['push'](_0x136036['shift']());}};_0x151f45(++_0x42bbcc);}(_0x6cf9,0x9b));var _0x96cf=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x6cf9[_0x102e37];return _0x35a07c;};'use strict';var multer=require('multer');var util=require(_0x96cf('0x0'));var path=require(_0x96cf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96cf('0x2')]();var fs_extra=require(_0x96cf('0x3'));var auth=require(_0x96cf('0x4'));var interaction=require(_0x96cf('0x5'));var config=require(_0x96cf('0x6'));var controller=require(_0x96cf('0x7'));router[_0x96cf('0x8')]('/',auth[_0x96cf('0x9')](),controller[_0x96cf('0xa')]);router[_0x96cf('0x8')](_0x96cf('0xb'),auth[_0x96cf('0x9')](),controller[_0x96cf('0xc')]);router[_0x96cf('0xd')]('/',auth['isAuthenticated'](),controller[_0x96cf('0xe')]);router[_0x96cf('0xf')](_0x96cf('0xb'),auth['isAuthenticated'](),controller[_0x96cf('0x10')]);router[_0x96cf('0x11')](_0x96cf('0xb'),auth[_0x96cf('0x9')](),controller[_0x96cf('0x12')]);module[_0x96cf('0x13')]=router;
\ No newline at end of file
index f3ce792..a8cab3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc01a=['sequelize','STRING'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0xc01a,0x1be));var _0xac01=function(_0x251807,_0x1c2111){_0x251807=_0x251807-0x0;var _0x2cb100=_0xc01a[_0x251807];return _0x2cb100;};'use strict';var Sequelize=require(_0xac01('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xac01('0x1')]}};
\ No newline at end of file
+var _0xc383=['STRING','name','exports'];(function(_0x47ad8d,_0x12af81){var _0x1e78cf=function(_0x390e0b){while(--_0x390e0b){_0x47ad8d['push'](_0x47ad8d['shift']());}};_0x1e78cf(++_0x12af81);}(_0xc383,0x197));var _0x3c38=function(_0x2ab25f,_0x371a39){_0x2ab25f=_0x2ab25f-0x0;var _0xe72614=_0xc383[_0x2ab25f];return _0xe72614;};'use strict';var Sequelize=require('sequelize');module[_0x3c38('0x0')]={'name':{'type':Sequelize[_0x3c38('0x1')],'unique':_0x3c38('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3c38('0x1')]}};
\ No newline at end of file
index 448097d..6d12e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f68=['where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','length','include','find','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','eml-format','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','destroy','Pauses','UserProfileResource','then','error','stack','name','send','map','Pause','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort'];(function(_0x42b04e,_0x3224db){var _0xd6cfce=function(_0x3a3de7){while(--_0x3a3de7){_0x42b04e['push'](_0x42b04e['shift']());}};_0xd6cfce(++_0x3224db);}(_0x6f68,0x67));var _0x86f6=function(_0x492c95,_0x357a6f){_0x492c95=_0x492c95-0x0;var _0x453616=_0x6f68[_0x492c95];return _0x453616;};'use strict';var emlformat=require(_0x86f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86f6('0x1'));var BPromise=require(_0x86f6('0x2'));var Mustache=require(_0x86f6('0x3'));var util=require('util');var path=require(_0x86f6('0x4'));var sox=require(_0x86f6('0x5'));var csv=require(_0x86f6('0x6'));var ejs=require(_0x86f6('0x7'));var fs=require('fs');var fs_extra=require(_0x86f6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x86f6('0x9'));var jsforce=require(_0x86f6('0xa'));var deskjs=require(_0x86f6('0xb'));var toCsv=require(_0x86f6('0x6'));var querystring=require(_0x86f6('0xc'));var Papa=require(_0x86f6('0xd'));var Redis=require(_0x86f6('0xe'));var authService=require(_0x86f6('0xf'));var qs=require(_0x86f6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86f6('0x11'));var logger=require('../../config/logger')(_0x86f6('0x12'));var utils=require(_0x86f6('0x13'));var config=require(_0x86f6('0x14'));var licenseUtil=require(_0x86f6('0x15'));var db=require(_0x86f6('0x16'))['db'];function respondWithStatusCode(_0x41d785,_0x1a92d1){_0x1a92d1=_0x1a92d1||0xcc;return function(_0x2f03a5){if(_0x2f03a5){return _0x41d785[_0x86f6('0x17')](_0x1a92d1);}return _0x41d785[_0x86f6('0x18')](_0x1a92d1)[_0x86f6('0x19')]();};}function respondWithResult(_0xf0fc2e,_0x1ae4af){_0x1ae4af=_0x1ae4af||0xc8;return function(_0x162bcd){if(_0x162bcd){return _0xf0fc2e['status'](_0x1ae4af)[_0x86f6('0x1a')](_0x162bcd);}};}function respondWithFilteredResult(_0x58a211,_0x114a28){return function(_0x24a58d){if(_0x24a58d){var _0x1a35d8=typeof _0x114a28['offset']===_0x86f6('0x1b')&&typeof _0x114a28[_0x86f6('0x1c')]==='undefined';var _0x57f92d=_0x24a58d[_0x86f6('0x1d')];var _0x376b73=_0x1a35d8?0x0:_0x114a28[_0x86f6('0x1e')];var _0x326742=_0x1a35d8?_0x24a58d[_0x86f6('0x1d')]:_0x114a28[_0x86f6('0x1e')]+_0x114a28[_0x86f6('0x1c')];var _0x30fd18;if(_0x326742>=_0x57f92d){_0x326742=_0x57f92d;_0x30fd18=0xc8;}else{_0x30fd18=0xce;}_0x58a211[_0x86f6('0x18')](_0x30fd18);return _0x58a211[_0x86f6('0x1f')](_0x86f6('0x20'),_0x376b73+'-'+_0x326742+'/'+_0x57f92d)[_0x86f6('0x1a')](_0x24a58d);}return null;};}function patchUpdates(_0x134955){return function(_0x5d2e23){try{jsonpatch['apply'](_0x5d2e23,_0x134955,!![]);}catch(_0xd5025a){return BPromise['reject'](_0xd5025a);}return _0x5d2e23[_0x86f6('0x21')]();};}function saveUpdates(_0x1ffdfa,_0x27bc05){return function(_0x4c5ab2){if(_0x4c5ab2){return _0x4c5ab2['update'](_0x1ffdfa)['then'](function(_0x1122e9){return _0x1122e9;});}return null;};}function removeEntity(_0x482bd6,_0xc8636d){return function(_0x3f97c9){if(_0x3f97c9){return _0x3f97c9[_0x86f6('0x22')]()['then'](function(){var _0x2d48d7=_0x3f97c9['get']({'plain':!![]});var _0x2b83ae=_0x86f6('0x23');return db[_0x86f6('0x24')]['destroy']({'where':{'type':_0x2b83ae,'resourceId':_0x2d48d7['id']}})[_0x86f6('0x25')](function(){return _0x3f97c9;});})['then'](function(){_0x482bd6['status'](0xcc)[_0x86f6('0x19')]();});}};}function handleEntityNotFound(_0x4949d3,_0x2650c2){return function(_0x38f8f6){if(!_0x38f8f6){_0x4949d3[_0x86f6('0x17')](0x194);}return _0x38f8f6;};}function handleError(_0x31d116,_0x116075){_0x116075=_0x116075||0x1f4;return function(_0x35d245){logger[_0x86f6('0x26')](_0x35d245[_0x86f6('0x27')]);if(_0x35d245[_0x86f6('0x28')]){delete _0x35d245[_0x86f6('0x28')];}_0x31d116[_0x86f6('0x18')](_0x116075)[_0x86f6('0x29')](_0x35d245);};}exports['index']=function(_0x1801d2,_0x39b046){var _0x35421f={},_0x47b251={},_0x2c4f93={'count':0x0,'rows':[]};var _0x509d94=_[_0x86f6('0x2a')](db[_0x86f6('0x2b')]['rawAttributes'],function(_0x285905){return{'name':_0x285905[_0x86f6('0x2c')],'type':_0x285905[_0x86f6('0x2d')][_0x86f6('0x2e')]};});_0x47b251[_0x86f6('0x2f')]=_[_0x86f6('0x2a')](_0x509d94,'name');_0x47b251[_0x86f6('0x30')]=_[_0x86f6('0x31')](_0x1801d2[_0x86f6('0x30')]);_0x47b251[_0x86f6('0x32')]=_[_0x86f6('0x33')](_0x47b251['model'],_0x47b251[_0x86f6('0x30')]);_0x35421f[_0x86f6('0x34')]=_[_0x86f6('0x33')](_0x47b251['model'],qs[_0x86f6('0x35')](_0x1801d2[_0x86f6('0x30')][_0x86f6('0x35')]));_0x35421f[_0x86f6('0x34')]=_0x35421f[_0x86f6('0x34')]['length']?_0x35421f['attributes']:_0x47b251[_0x86f6('0x2f')];if(!_0x1801d2['query']['hasOwnProperty'](_0x86f6('0x36'))){_0x35421f['limit']=qs[_0x86f6('0x1c')](_0x1801d2['query']['limit']);_0x35421f[_0x86f6('0x1e')]=qs[_0x86f6('0x1e')](_0x1801d2[_0x86f6('0x30')][_0x86f6('0x1e')]);}_0x35421f[_0x86f6('0x37')]=qs[_0x86f6('0x38')](_0x1801d2['query']['sort']);_0x35421f[_0x86f6('0x39')]=qs[_0x86f6('0x32')](_['pick'](_0x1801d2[_0x86f6('0x30')],_0x47b251[_0x86f6('0x32')]),_0x509d94);if(_0x1801d2[_0x86f6('0x30')]['filter']){_0x35421f[_0x86f6('0x39')]=_[_0x86f6('0x3a')](_0x35421f['where'],{'$or':_['map'](_0x509d94,function(_0x26fc9c){if(_0x26fc9c[_0x86f6('0x2d')]!==_0x86f6('0x3b')){var _0xa0ec47={};_0xa0ec47[_0x26fc9c[_0x86f6('0x28')]]={'$like':'%'+_0x1801d2['query']['filter']+'%'};return _0xa0ec47;}})});}_0x35421f=_['merge']({},_0x35421f,_0x1801d2[_0x86f6('0x3c')]);var _0x5ac70b={'where':_0x35421f[_0x86f6('0x39')]};return db['Pause']['count'](_0x5ac70b)[_0x86f6('0x25')](function(_0x54a306){_0x2c4f93[_0x86f6('0x1d')]=_0x54a306;if(_0x1801d2[_0x86f6('0x30')][_0x86f6('0x3d')]){_0x35421f['include']=[{'all':!![]}];}return db[_0x86f6('0x2b')]['findAll'](_0x35421f);})[_0x86f6('0x25')](function(_0x29cc33){_0x2c4f93[_0x86f6('0x3e')]=_0x29cc33;return _0x2c4f93;})['then'](respondWithFilteredResult(_0x39b046,_0x35421f))[_0x86f6('0x3f')](handleError(_0x39b046,null));};exports[_0x86f6('0x40')]=function(_0x3f5615,_0x2bddb2){var _0x4fd033={'raw':!![],'where':{'id':_0x3f5615[_0x86f6('0x41')]['id']}},_0x169c63={};_0x169c63[_0x86f6('0x2f')]=_['keys'](db['Pause'][_0x86f6('0x42')]);_0x169c63[_0x86f6('0x30')]=_[_0x86f6('0x31')](_0x3f5615['query']);_0x169c63[_0x86f6('0x32')]=_[_0x86f6('0x33')](_0x169c63[_0x86f6('0x2f')],_0x169c63[_0x86f6('0x30')]);_0x4fd033[_0x86f6('0x34')]=_[_0x86f6('0x33')](_0x169c63['model'],qs[_0x86f6('0x35')](_0x3f5615[_0x86f6('0x30')][_0x86f6('0x35')]));_0x4fd033[_0x86f6('0x34')]=_0x4fd033[_0x86f6('0x34')][_0x86f6('0x43')]?_0x4fd033[_0x86f6('0x34')]:_0x169c63[_0x86f6('0x2f')];if(_0x3f5615[_0x86f6('0x30')][_0x86f6('0x3d')]){_0x4fd033[_0x86f6('0x44')]=[{'all':!![]}];}_0x4fd033=_[_0x86f6('0x3a')]({},_0x4fd033,_0x3f5615[_0x86f6('0x3c')]);return db['Pause'][_0x86f6('0x45')](_0x4fd033)['then'](handleEntityNotFound(_0x2bddb2,null))[_0x86f6('0x25')](respondWithResult(_0x2bddb2,null))[_0x86f6('0x3f')](handleError(_0x2bddb2,null));};exports[_0x86f6('0x46')]=function(_0x44d8de,_0x245d39){return db[_0x86f6('0x2b')][_0x86f6('0x46')](_0x44d8de[_0x86f6('0x47')],{})[_0x86f6('0x25')](function(_0x5b972c){var _0x25214a=_0x44d8de[_0x86f6('0x48')][_0x86f6('0x49')]({'plain':!![]});if(!_0x25214a)throw new Error(_0x86f6('0x4a'));if(_0x25214a[_0x86f6('0x4b')]===_0x86f6('0x48')){var _0xf015f5=_0x5b972c['get']({'plain':!![]});var _0x2186e1='Pauses';return db['UserProfileSection'][_0x86f6('0x45')]({'where':{'name':_0x2186e1,'userProfileId':_0x25214a[_0x86f6('0x4c')]},'raw':!![]})['then'](function(_0x4104b3){if(_0x4104b3&&_0x4104b3[_0x86f6('0x4d')]===0x0){return db[_0x86f6('0x24')][_0x86f6('0x46')]({'name':_0xf015f5['name'],'resourceId':_0xf015f5['id'],'type':_0x4104b3[_0x86f6('0x28')],'sectionId':_0x4104b3['id']},{})[_0x86f6('0x25')](function(){return _0x5b972c;});}else{return _0x5b972c;}})['catch'](function(_0x183873){logger[_0x86f6('0x26')](_0x86f6('0x4e'),_0x183873);throw _0x183873;});}return _0x5b972c;})[_0x86f6('0x25')](respondWithResult(_0x245d39,0xc9))[_0x86f6('0x3f')](handleError(_0x245d39,null));};exports[_0x86f6('0x4f')]=function(_0x2b2724,_0x11f054){if(_0x2b2724[_0x86f6('0x47')]['id']){delete _0x2b2724[_0x86f6('0x47')]['id'];}return db[_0x86f6('0x2b')][_0x86f6('0x45')]({'where':{'id':_0x2b2724[_0x86f6('0x41')]['id']}})[_0x86f6('0x25')](handleEntityNotFound(_0x11f054,null))[_0x86f6('0x25')](saveUpdates(_0x2b2724[_0x86f6('0x47')],null))[_0x86f6('0x25')](respondWithResult(_0x11f054,null))[_0x86f6('0x3f')](handleError(_0x11f054,null));};exports['destroy']=function(_0x50f8bf,_0x1c8e38){return db['Pause']['find']({'where':{'id':_0x50f8bf[_0x86f6('0x41')]['id']}})[_0x86f6('0x25')](handleEntityNotFound(_0x1c8e38,null))[_0x86f6('0x25')](removeEntity(_0x1c8e38,null))[_0x86f6('0x3f')](handleError(_0x1c8e38,null));};
\ No newline at end of file
+var _0xb8a8=['fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','send','index','Pause','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb8a8,0x14d));var _0x8b8a=function(_0x3a7e87,_0x40a791){_0x3a7e87=_0x3a7e87-0x0;var _0x3457e7=_0xb8a8[_0x3a7e87];return _0x3457e7;};'use strict';var emlformat=require(_0x8b8a('0x0'));var rimraf=require(_0x8b8a('0x1'));var zipdir=require(_0x8b8a('0x2'));var jsonpatch=require(_0x8b8a('0x3'));var rp=require(_0x8b8a('0x4'));var moment=require(_0x8b8a('0x5'));var BPromise=require(_0x8b8a('0x6'));var Mustache=require('mustache');var util=require(_0x8b8a('0x7'));var path=require('path');var sox=require(_0x8b8a('0x8'));var csv=require(_0x8b8a('0x9'));var ejs=require(_0x8b8a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b8a('0xb'));var crypto=require('crypto');var jsforce=require(_0x8b8a('0xc'));var deskjs=require(_0x8b8a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8b8a('0xe'));var Redis=require(_0x8b8a('0xf'));var authService=require(_0x8b8a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b8a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8b8a('0x12'));var config=require(_0x8b8a('0x13'));var licenseUtil=require(_0x8b8a('0x14'));var db=require(_0x8b8a('0x15'))['db'];function respondWithStatusCode(_0x1f9d3e,_0x1cd162){_0x1cd162=_0x1cd162||0xcc;return function(_0x6e68c1){if(_0x6e68c1){return _0x1f9d3e[_0x8b8a('0x16')](_0x1cd162);}return _0x1f9d3e[_0x8b8a('0x17')](_0x1cd162)[_0x8b8a('0x18')]();};}function respondWithResult(_0x25c0de,_0x1321b3){_0x1321b3=_0x1321b3||0xc8;return function(_0x55b3ab){if(_0x55b3ab){return _0x25c0de['status'](_0x1321b3)['json'](_0x55b3ab);}};}function respondWithFilteredResult(_0x3c641f,_0xc0b645){return function(_0x39d72a){if(_0x39d72a){var _0x4f0fa9=typeof _0xc0b645[_0x8b8a('0x19')]===_0x8b8a('0x1a')&&typeof _0xc0b645[_0x8b8a('0x1b')]===_0x8b8a('0x1a');var _0xae8bff=_0x39d72a[_0x8b8a('0x1c')];var _0x1dde5b=_0x4f0fa9?0x0:_0xc0b645[_0x8b8a('0x19')];var _0x182b6b=_0x4f0fa9?_0x39d72a[_0x8b8a('0x1c')]:_0xc0b645[_0x8b8a('0x19')]+_0xc0b645[_0x8b8a('0x1b')];var _0x48c126;if(_0x182b6b>=_0xae8bff){_0x182b6b=_0xae8bff;_0x48c126=0xc8;}else{_0x48c126=0xce;}_0x3c641f[_0x8b8a('0x17')](_0x48c126);return _0x3c641f[_0x8b8a('0x1d')](_0x8b8a('0x1e'),_0x1dde5b+'-'+_0x182b6b+'/'+_0xae8bff)[_0x8b8a('0x1f')](_0x39d72a);}return null;};}function patchUpdates(_0x1fae33){return function(_0xc653fa){try{jsonpatch[_0x8b8a('0x20')](_0xc653fa,_0x1fae33,!![]);}catch(_0x32b64f){return BPromise[_0x8b8a('0x21')](_0x32b64f);}return _0xc653fa[_0x8b8a('0x22')]();};}function saveUpdates(_0x15fe34,_0x3087ac){return function(_0x3e676d){if(_0x3e676d){return _0x3e676d[_0x8b8a('0x23')](_0x15fe34)[_0x8b8a('0x24')](function(_0x162853){return _0x162853;});}return null;};}function removeEntity(_0xac362,_0x2864f4){return function(_0x2e7317){if(_0x2e7317){return _0x2e7317[_0x8b8a('0x25')]()[_0x8b8a('0x24')](function(){var _0x16146e=_0x2e7317[_0x8b8a('0x26')]({'plain':!![]});var _0x37498a=_0x8b8a('0x27');return db[_0x8b8a('0x28')][_0x8b8a('0x25')]({'where':{'type':_0x37498a,'resourceId':_0x16146e['id']}})['then'](function(){return _0x2e7317;});})[_0x8b8a('0x24')](function(){_0xac362['status'](0xcc)[_0x8b8a('0x18')]();});}};}function handleEntityNotFound(_0x5c7f43,_0x1a9a34){return function(_0x2f1428){if(!_0x2f1428){_0x5c7f43[_0x8b8a('0x16')](0x194);}return _0x2f1428;};}function handleError(_0x5ab214,_0x4dc9e4){_0x4dc9e4=_0x4dc9e4||0x1f4;return function(_0x2e8e81){logger[_0x8b8a('0x29')](_0x2e8e81['stack']);if(_0x2e8e81['name']){delete _0x2e8e81[_0x8b8a('0x2a')];}_0x5ab214[_0x8b8a('0x17')](_0x4dc9e4)[_0x8b8a('0x2b')](_0x2e8e81);};}exports[_0x8b8a('0x2c')]=function(_0x49c3fe,_0x2a3163){var _0x18c49b={},_0x37d2c5={},_0x38038d={'count':0x0,'rows':[]};var _0xe5a7c4=_['map'](db[_0x8b8a('0x2d')][_0x8b8a('0x2e')],function(_0x405e5f){return{'name':_0x405e5f['fieldName'],'type':_0x405e5f[_0x8b8a('0x2f')][_0x8b8a('0x30')]};});_0x37d2c5[_0x8b8a('0x31')]=_[_0x8b8a('0x32')](_0xe5a7c4,_0x8b8a('0x2a'));_0x37d2c5[_0x8b8a('0x33')]=_['keys'](_0x49c3fe[_0x8b8a('0x33')]);_0x37d2c5['filters']=_[_0x8b8a('0x34')](_0x37d2c5[_0x8b8a('0x31')],_0x37d2c5['query']);_0x18c49b[_0x8b8a('0x35')]=_['intersection'](_0x37d2c5['model'],qs[_0x8b8a('0x36')](_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x36')]));_0x18c49b[_0x8b8a('0x35')]=_0x18c49b[_0x8b8a('0x35')][_0x8b8a('0x37')]?_0x18c49b[_0x8b8a('0x35')]:_0x37d2c5['model'];if(!_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x38')](_0x8b8a('0x39'))){_0x18c49b['limit']=qs[_0x8b8a('0x1b')](_0x49c3fe[_0x8b8a('0x33')]['limit']);_0x18c49b[_0x8b8a('0x19')]=qs[_0x8b8a('0x19')](_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x19')]);}_0x18c49b[_0x8b8a('0x3a')]=qs[_0x8b8a('0x3b')](_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x3b')]);_0x18c49b[_0x8b8a('0x3c')]=qs[_0x8b8a('0x3d')](_[_0x8b8a('0x3e')](_0x49c3fe[_0x8b8a('0x33')],_0x37d2c5[_0x8b8a('0x3d')]),_0xe5a7c4);if(_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x3f')]){_0x18c49b['where']=_[_0x8b8a('0x40')](_0x18c49b['where'],{'$or':_[_0x8b8a('0x32')](_0xe5a7c4,function(_0x2f7bc6){if(_0x2f7bc6['type']!==_0x8b8a('0x41')){var _0x2baa50={};_0x2baa50[_0x2f7bc6[_0x8b8a('0x2a')]]={'$like':'%'+_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x3f')]+'%'};return _0x2baa50;}})});}_0x18c49b=_['merge']({},_0x18c49b,_0x49c3fe[_0x8b8a('0x42')]);var _0x242a4c={'where':_0x18c49b['where']};return db['Pause'][_0x8b8a('0x1c')](_0x242a4c)['then'](function(_0xb3e6d0){_0x38038d[_0x8b8a('0x1c')]=_0xb3e6d0;if(_0x49c3fe[_0x8b8a('0x33')][_0x8b8a('0x43')]){_0x18c49b[_0x8b8a('0x44')]=[{'all':!![]}];}return db['Pause'][_0x8b8a('0x45')](_0x18c49b);})['then'](function(_0x726931){_0x38038d[_0x8b8a('0x46')]=_0x726931;return _0x38038d;})[_0x8b8a('0x24')](respondWithFilteredResult(_0x2a3163,_0x18c49b))['catch'](handleError(_0x2a3163,null));};exports[_0x8b8a('0x47')]=function(_0xd54b91,_0x2a30de){var _0x39ef1b={'raw':!![],'where':{'id':_0xd54b91[_0x8b8a('0x48')]['id']}},_0x501678={};_0x501678[_0x8b8a('0x31')]=_['keys'](db[_0x8b8a('0x2d')][_0x8b8a('0x2e')]);_0x501678[_0x8b8a('0x33')]=_[_0x8b8a('0x49')](_0xd54b91['query']);_0x501678[_0x8b8a('0x3d')]=_['intersection'](_0x501678[_0x8b8a('0x31')],_0x501678[_0x8b8a('0x33')]);_0x39ef1b['attributes']=_[_0x8b8a('0x34')](_0x501678['model'],qs[_0x8b8a('0x36')](_0xd54b91[_0x8b8a('0x33')][_0x8b8a('0x36')]));_0x39ef1b[_0x8b8a('0x35')]=_0x39ef1b['attributes'][_0x8b8a('0x37')]?_0x39ef1b[_0x8b8a('0x35')]:_0x501678['model'];if(_0xd54b91[_0x8b8a('0x33')][_0x8b8a('0x43')]){_0x39ef1b[_0x8b8a('0x44')]=[{'all':!![]}];}_0x39ef1b=_['merge']({},_0x39ef1b,_0xd54b91['options']);return db['Pause']['find'](_0x39ef1b)[_0x8b8a('0x24')](handleEntityNotFound(_0x2a30de,null))[_0x8b8a('0x24')](respondWithResult(_0x2a30de,null))[_0x8b8a('0x4a')](handleError(_0x2a30de,null));};exports[_0x8b8a('0x4b')]=function(_0x318dc8,_0x5c866e){return db[_0x8b8a('0x2d')]['create'](_0x318dc8[_0x8b8a('0x4c')],{})['then'](function(_0x4e3524){var _0x306051=_0x318dc8['user'][_0x8b8a('0x26')]({'plain':!![]});if(!_0x306051)throw new Error(_0x8b8a('0x4d'));if(_0x306051[_0x8b8a('0x4e')]===_0x8b8a('0x4f')){var _0x394081=_0x4e3524[_0x8b8a('0x26')]({'plain':!![]});var _0x15699a='Pauses';return db[_0x8b8a('0x50')]['find']({'where':{'name':_0x15699a,'userProfileId':_0x306051[_0x8b8a('0x51')]},'raw':!![]})['then'](function(_0x2ddeed){if(_0x2ddeed&&_0x2ddeed['autoAssociation']===0x0){return db[_0x8b8a('0x28')]['create']({'name':_0x394081[_0x8b8a('0x2a')],'resourceId':_0x394081['id'],'type':_0x2ddeed[_0x8b8a('0x2a')],'sectionId':_0x2ddeed['id']},{})[_0x8b8a('0x24')](function(){return _0x4e3524;});}else{return _0x4e3524;}})[_0x8b8a('0x4a')](function(_0x471fb3){logger[_0x8b8a('0x29')](_0x8b8a('0x52'),_0x471fb3);throw _0x471fb3;});}return _0x4e3524;})[_0x8b8a('0x24')](respondWithResult(_0x5c866e,0xc9))[_0x8b8a('0x4a')](handleError(_0x5c866e,null));};exports['update']=function(_0x30507f,_0x3362c6){if(_0x30507f[_0x8b8a('0x4c')]['id']){delete _0x30507f[_0x8b8a('0x4c')]['id'];}return db[_0x8b8a('0x2d')][_0x8b8a('0x53')]({'where':{'id':_0x30507f[_0x8b8a('0x48')]['id']}})[_0x8b8a('0x24')](handleEntityNotFound(_0x3362c6,null))[_0x8b8a('0x24')](saveUpdates(_0x30507f[_0x8b8a('0x4c')],null))[_0x8b8a('0x24')](respondWithResult(_0x3362c6,null))[_0x8b8a('0x4a')](handleError(_0x3362c6,null));};exports[_0x8b8a('0x25')]=function(_0x41bd9b,_0x54bd60){return db['Pause'][_0x8b8a('0x53')]({'where':{'id':_0x41bd9b['params']['id']}})[_0x8b8a('0x24')](handleEntityNotFound(_0x54bd60,null))[_0x8b8a('0x24')](removeEntity(_0x54bd60,null))[_0x8b8a('0x4a')](handleError(_0x54bd60,null));};
\ No newline at end of file
index 7426131..b6213db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x29a4dc,_0x269775){var _0xc14e43=function(_0xc2957c){while(--_0xc2957c){_0x29a4dc['push'](_0x29a4dc['shift']());}};_0xc14e43(++_0x269775);}(_0xabce,0x103));var _0xeabc=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xabce[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x5d8af4,_0x1a3756){var _0x469ce6=function(_0x1c84fc){while(--_0x1c84fc){_0x5d8af4['push'](_0x5d8af4['shift']());}};_0x469ce6(++_0x1a3756);}(_0x5fc3,0xa8));var _0x35fc=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x5fc3[_0x492af5];return _0x59f529;};'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 f7022d3..8df351a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x29aeb8,_0x5005a0){var _0x487aed=function(_0x539569){while(--_0x539569){_0x29aeb8['push'](_0x29aeb8['shift']());}};_0x487aed(++_0x5005a0);}(_0x7a54,0x106));var _0x47a5=function(_0xb6620a,_0x266907){_0xb6620a=_0xb6620a-0x0;var _0x4454d3=_0x7a54[_0xb6620a];return _0x4454d3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x31ee4f,_0x2d957a){var _0x1bdaa3=function(_0x567453){while(--_0x567453){_0x31ee4f['push'](_0x31ee4f['shift']());}};_0x1bdaa3(++_0x2d957a);}(_0x7a54,0x106));var _0x47a5=function(_0x5a6e77,_0x2c2924){_0x5a6e77=_0x5a6e77-0x0;var _0x418b14=_0x7a54[_0x5a6e77];return _0x418b14;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 7ed892e..2b6f160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','file','upload'];(function(_0x130a03,_0x421e8c){var _0x5ade13=function(_0x1190d1){while(--_0x1190d1){_0x130a03['push'](_0x130a03['shift']());}};_0x5ade13(++_0x421e8c);}(_0x2dae,0xc3));var _0xe2da=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x2dae[_0x5959c9];return _0x4ffcbc;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),controller[_0xe2da('0xc')]);router[_0xe2da('0x9')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0xf')]);router[_0xe2da('0x9')]('/:id/download',auth[_0xe2da('0xe')](),controller[_0xe2da('0x10')]);var upload=multer({'storage':multer[_0xe2da('0x11')]({'destination':function(_0x17086c,_0x3c1309,_0x44ec3e){_0x44ec3e(null,path[_0xe2da('0x12')](config[_0xe2da('0x13')],'server/files/plugins'));},'filename':function(_0xb98909,_0x5200b1,_0x4377c6){_0x5200b1[_0xe2da('0x14')]=_0x5200b1[_0xe2da('0x14')][_0xe2da('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4377c6(null,util[_0xe2da('0x16')](_0xe2da('0x17'),path[_0xe2da('0x18')](_0x5200b1['originalname'],path[_0xe2da('0x19')](_0x5200b1['originalname'])),Date['now'](),path[_0xe2da('0x19')](_0x5200b1[_0xe2da('0x14')])));}})});router[_0xe2da('0x1a')]('/',upload['single'](_0xe2da('0x1b')),controller[_0xe2da('0x1c')]);router[_0xe2da('0x1a')](_0xe2da('0xb'),controller['webhookPost']);router[_0xe2da('0x1d')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0x1e')]);router[_0xe2da('0x1f')]('/:id',auth[_0xe2da('0xe')](),controller[_0xe2da('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xbd50=['extname','post','single','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/webhook','webhookGet','show','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename'];(function(_0x4d3924,_0x327b56){var _0x844555=function(_0x387a6d){while(--_0x387a6d){_0x4d3924['push'](_0x4d3924['shift']());}};_0x844555(++_0x327b56);}(_0xbd50,0x196));var _0x0bd5=function(_0x144756,_0x200cee){_0x144756=_0x144756-0x0;var _0x3f23d3=_0xbd50[_0x144756];return _0x3f23d3;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),controller[_0x0bd5('0xc')]);router['get']('/:id',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0xa')]('/:id/download',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x210f45,_0x7db86e,_0x4d7d17){_0x4d7d17(null,path[_0x0bd5('0xf')](config[_0x0bd5('0x10')],_0x0bd5('0x11')));},'filename':function(_0x5f49ee,_0x2f7a0c,_0x23982f){_0x2f7a0c[_0x0bd5('0x12')]=_0x2f7a0c[_0x0bd5('0x12')][_0x0bd5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23982f(null,util[_0x0bd5('0x14')](_0x0bd5('0x15'),path[_0x0bd5('0x16')](_0x2f7a0c['originalname'],path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])),Date['now'](),path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])));}})});router[_0x0bd5('0x18')]('/',upload[_0x0bd5('0x19')]('file'),controller[_0x0bd5('0x1a')]);router[_0x0bd5('0x18')](_0x0bd5('0xb'),controller[_0x0bd5('0x1b')]);router[_0x0bd5('0x1c')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1e')]);router[_0x0bd5('0x1f')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1f')]);module[_0x0bd5('0x20')]=router;
\ No newline at end of file
index bcb957b..d95c847 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07a9=['never','always','sequelize','exports','STRING','ENUM','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.','adminOnly','agentOnly'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0x07a9,0x160));var _0x907a=function(_0x26b716,_0x119c32){_0x26b716=_0x26b716-0x0;var _0x4057ad=_0x07a9[_0x26b716];return _0x4057ad;};'use strict';var Sequelize=require(_0x907a('0x0'));module[_0x907a('0x1')]={'name':{'type':Sequelize[_0x907a('0x2')]},'type':{'type':Sequelize[_0x907a('0x3')](_0x907a('0x4'),_0x907a('0x5'))},'description':{'type':Sequelize[_0x907a('0x6')]},'version':{'type':Sequelize[_0x907a('0x6')]},'path':{'type':Sequelize[_0x907a('0x2')],'comment':_0x907a('0x7')},'active':{'type':Sequelize[_0x907a('0x8')],'defaultValue':0x0,'comment':_0x907a('0x9')},'sidebar':{'type':Sequelize[_0x907a('0x3')](_0x907a('0xa'),_0x907a('0xb'),'always',_0x907a('0xc')),'defaultValue':_0x907a('0xd'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x907a('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x907a('0x2')]},'scriptPath':{'type':Sequelize[_0x907a('0x2')]}};
\ No newline at end of file
+var _0xe4fc=['STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize'];(function(_0x5159e3,_0x10fa9a){var _0x216fdb=function(_0x3c64ca){while(--_0x3c64ca){_0x5159e3['push'](_0x5159e3['shift']());}};_0x216fdb(++_0x10fa9a);}(_0xe4fc,0x8e));var _0xce4f=function(_0x2d8290,_0x3558ed){_0x2d8290=_0x2d8290-0x0;var _0x33c614=_0xe4fc[_0x2d8290];return _0x33c614;};'use strict';var Sequelize=require(_0xce4f('0x0'));module['exports']={'name':{'type':Sequelize[_0xce4f('0x1')]},'type':{'type':Sequelize['ENUM'](_0xce4f('0x2'),_0xce4f('0x3'))},'description':{'type':Sequelize[_0xce4f('0x4')]},'version':{'type':Sequelize[_0xce4f('0x4')]},'path':{'type':Sequelize[_0xce4f('0x1')],'comment':_0xce4f('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xce4f('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0xce4f('0x7'),_0xce4f('0x8'),_0xce4f('0x9'),_0xce4f('0xa')),'defaultValue':_0xce4f('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xce4f('0x1')]},'adminUrl':{'type':Sequelize[_0xce4f('0x1')]},'agentUrl':{'type':Sequelize[_0xce4f('0x1')]},'scriptName':{'type':Sequelize[_0xce4f('0x1')]},'scriptPath':{'type':Sequelize[_0xce4f('0x1')]}};
\ No newline at end of file
index 6fd35d3..bc82945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91e6=['manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','method','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','encoding','%s%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','Plugins','UserProfileResource','then','stack','name','send','index','map','Plugin','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','fields','merge','find','catch','root','server/files/plugins','format','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x91e6,0xe0));var _0x691e=function(_0x13b01b,_0x1a9f25){_0x13b01b=_0x13b01b-0x0;var _0x2bf5d5=_0x91e6[_0x13b01b];return _0x2bf5d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x691e('0x0'));var zipdir=require(_0x691e('0x1'));var jsonpatch=require(_0x691e('0x2'));var rp=require(_0x691e('0x3'));var moment=require('moment');var BPromise=require(_0x691e('0x4'));var Mustache=require(_0x691e('0x5'));var util=require('util');var path=require(_0x691e('0x6'));var sox=require('sox');var csv=require(_0x691e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x691e('0x8'));var squel=require(_0x691e('0x9'));var crypto=require(_0x691e('0xa'));var jsforce=require(_0x691e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x691e('0x7'));var querystring=require(_0x691e('0xc'));var Papa=require('papaparse');var extract=require(_0x691e('0xd'));var rimraf=require('rimraf');var archiver=require(_0x691e('0xe'));var Redis=require(_0x691e('0xf'));var authService=require(_0x691e('0x10'));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(_0x691e('0x11'));var config=require(_0x691e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x691e('0x13'))['db'];config[_0x691e('0x14')]=_['defaults'](config[_0x691e('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x691e('0x15'))(new Redis(config[_0x691e('0x14')]));require(_0x691e('0x16'))[_0x691e('0x17')](socket);function respondWithStatusCode(_0x54f900,_0x2cda2b){_0x2cda2b=_0x2cda2b||0xcc;return function(_0x3ff1b0){if(_0x3ff1b0){return _0x54f900[_0x691e('0x18')](_0x2cda2b);}return _0x54f900[_0x691e('0x19')](_0x2cda2b)[_0x691e('0x1a')]();};}function respondWithResult(_0x425596,_0x51a7a0){_0x51a7a0=_0x51a7a0||0xc8;return function(_0x1e7a29){if(_0x1e7a29){return _0x425596[_0x691e('0x19')](_0x51a7a0)['json'](_0x1e7a29);}};}function respondWithFilteredResult(_0x223d39,_0x4e55b2){return function(_0x3283f1){if(_0x3283f1){var _0xa8db19=typeof _0x4e55b2[_0x691e('0x1b')]===_0x691e('0x1c')&&typeof _0x4e55b2[_0x691e('0x1d')]===_0x691e('0x1c');var _0x490ce1=_0x3283f1[_0x691e('0x1e')];var _0x38cb0c=_0xa8db19?0x0:_0x4e55b2[_0x691e('0x1b')];var _0x5415e1=_0xa8db19?_0x3283f1[_0x691e('0x1e')]:_0x4e55b2[_0x691e('0x1b')]+_0x4e55b2['limit'];var _0x476b41;if(_0x5415e1>=_0x490ce1){_0x5415e1=_0x490ce1;_0x476b41=0xc8;}else{_0x476b41=0xce;}_0x223d39[_0x691e('0x19')](_0x476b41);return _0x223d39[_0x691e('0x1f')](_0x691e('0x20'),_0x38cb0c+'-'+_0x5415e1+'/'+_0x490ce1)[_0x691e('0x21')](_0x3283f1);}return null;};}function patchUpdates(_0x6cadea){return function(_0x3dd6c3){try{jsonpatch[_0x691e('0x22')](_0x3dd6c3,_0x6cadea,!![]);}catch(_0x39ceb5){return BPromise['reject'](_0x39ceb5);}return _0x3dd6c3[_0x691e('0x23')]();};}function saveUpdates(_0x963340,_0x4abe97){return function(_0x31defc){if(_0x31defc){return _0x31defc[_0x691e('0x24')](_0x963340)['then'](function(_0x493be3){return _0x493be3;});}return null;};}function removeEntity(_0x11b58a,_0x3ca9ff){return function(_0x3a1310){if(_0x3a1310){return _0x3a1310[_0x691e('0x25')]()['then'](function(){var _0x2fec09=_0x3a1310['get']({'plain':!![]});var _0xff6f97=_0x691e('0x26');return db[_0x691e('0x27')][_0x691e('0x25')]({'where':{'type':_0xff6f97,'resourceId':_0x2fec09['id']}})[_0x691e('0x28')](function(){return _0x3a1310;});})['then'](function(){_0x11b58a[_0x691e('0x19')](0xcc)[_0x691e('0x1a')]();});}};}function handleEntityNotFound(_0x5610f0,_0x271c2a){return function(_0x36eae2){if(!_0x36eae2){_0x5610f0['sendStatus'](0x194);}return _0x36eae2;};}function handleError(_0x402454,_0x2f8a65){_0x2f8a65=_0x2f8a65||0x1f4;return function(_0x199f35){logger['error'](_0x199f35[_0x691e('0x29')]);if(_0x199f35['name']){delete _0x199f35[_0x691e('0x2a')];}_0x402454[_0x691e('0x19')](_0x2f8a65)[_0x691e('0x2b')](_0x199f35);};}exports[_0x691e('0x2c')]=function(_0xf127e7,_0x190d11){var _0xccce45={},_0x53a174={},_0x5765c0={'count':0x0,'rows':[]};var _0x44a954=_[_0x691e('0x2d')](db[_0x691e('0x2e')][_0x691e('0x2f')],function(_0x3af3d8){return{'name':_0x3af3d8['fieldName'],'type':_0x3af3d8[_0x691e('0x30')][_0x691e('0x31')]};});_0x53a174['model']=_['map'](_0x44a954,_0x691e('0x2a'));_0x53a174['query']=_[_0x691e('0x32')](_0xf127e7[_0x691e('0x33')]);_0x53a174[_0x691e('0x34')]=_[_0x691e('0x35')](_0x53a174[_0x691e('0x36')],_0x53a174[_0x691e('0x33')]);_0xccce45['attributes']=_[_0x691e('0x35')](_0x53a174[_0x691e('0x36')],qs['fields'](_0xf127e7[_0x691e('0x33')]['fields']));_0xccce45[_0x691e('0x37')]=_0xccce45[_0x691e('0x37')][_0x691e('0x38')]?_0xccce45[_0x691e('0x37')]:_0x53a174[_0x691e('0x36')];if(!_0xf127e7[_0x691e('0x33')][_0x691e('0x39')](_0x691e('0x3a'))){_0xccce45[_0x691e('0x1d')]=qs[_0x691e('0x1d')](_0xf127e7[_0x691e('0x33')][_0x691e('0x1d')]);_0xccce45[_0x691e('0x1b')]=qs[_0x691e('0x1b')](_0xf127e7['query'][_0x691e('0x1b')]);}_0xccce45[_0x691e('0x3b')]=qs[_0x691e('0x3c')](_0xf127e7[_0x691e('0x33')][_0x691e('0x3c')]);_0xccce45[_0x691e('0x3d')]=qs[_0x691e('0x34')](_[_0x691e('0x3e')](_0xf127e7[_0x691e('0x33')],_0x53a174[_0x691e('0x34')]),_0x44a954);if(_0xf127e7[_0x691e('0x33')][_0x691e('0x3f')]){_0xccce45['where']=_['merge'](_0xccce45[_0x691e('0x3d')],{'$or':_[_0x691e('0x2d')](_0x44a954,function(_0xe2ef9a){if(_0xe2ef9a[_0x691e('0x30')]!==_0x691e('0x40')){var _0x29a977={};_0x29a977[_0xe2ef9a['name']]={'$like':'%'+_0xf127e7['query']['filter']+'%'};return _0x29a977;}})});}_0xccce45=_['merge']({},_0xccce45,_0xf127e7[_0x691e('0x41')]);var _0x242e7d={'where':_0xccce45[_0x691e('0x3d')]};return db['Plugin'][_0x691e('0x1e')](_0x242e7d)[_0x691e('0x28')](function(_0x26c849){_0x5765c0[_0x691e('0x1e')]=_0x26c849;if(_0xf127e7[_0x691e('0x33')]['includeAll']){_0xccce45[_0x691e('0x42')]=[{'all':!![]}];}return db[_0x691e('0x2e')][_0x691e('0x43')](_0xccce45);})['then'](function(_0x289687){_0x5765c0[_0x691e('0x44')]=_0x289687;return _0x5765c0;})[_0x691e('0x28')](respondWithFilteredResult(_0x190d11,_0xccce45))['catch'](handleError(_0x190d11,null));};exports[_0x691e('0x45')]=function(_0x19a001,_0x456cc3){var _0x4dcdb9={'raw':!![],'where':{'id':_0x19a001[_0x691e('0x46')]['id']}},_0x3c7ec8={};_0x3c7ec8[_0x691e('0x36')]=_[_0x691e('0x32')](db[_0x691e('0x2e')]['rawAttributes']);_0x3c7ec8[_0x691e('0x33')]=_['keys'](_0x19a001[_0x691e('0x33')]);_0x3c7ec8['filters']=_['intersection'](_0x3c7ec8[_0x691e('0x36')],_0x3c7ec8[_0x691e('0x33')]);_0x4dcdb9[_0x691e('0x37')]=_[_0x691e('0x35')](_0x3c7ec8[_0x691e('0x36')],qs[_0x691e('0x47')](_0x19a001[_0x691e('0x33')][_0x691e('0x47')]));_0x4dcdb9[_0x691e('0x37')]=_0x4dcdb9[_0x691e('0x37')][_0x691e('0x38')]?_0x4dcdb9['attributes']:_0x3c7ec8['model'];if(_0x19a001[_0x691e('0x33')]['includeAll']){_0x4dcdb9[_0x691e('0x42')]=[{'all':!![]}];}_0x4dcdb9=_[_0x691e('0x48')]({},_0x4dcdb9,_0x19a001[_0x691e('0x41')]);return db['Plugin'][_0x691e('0x49')](_0x4dcdb9)[_0x691e('0x28')](handleEntityNotFound(_0x456cc3,null))[_0x691e('0x28')](respondWithResult(_0x456cc3,null))[_0x691e('0x4a')](handleError(_0x456cc3,null));};exports['download']=function(_0x40f26d,_0x5e761e,_0x2e6c7b){return db[_0x691e('0x2e')][_0x691e('0x49')]({'where':{'id':_0x40f26d['params']['id']},'attributes':['name',_0x691e('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x5e761e,null))['then'](function(_0x51918a){if(_0x51918a){var _0x1ef7b0=path['join'](config[_0x691e('0x4b')],_0x691e('0x4c'),util[_0x691e('0x4d')]('%s.zip',path[_0x691e('0x4e')](_0x51918a['path'])));var _0x3b4e2b=fs[_0x691e('0x4f')](_0x1ef7b0);var _0x31ee56=archiver(_0x691e('0x50'),{'zlib':{'level':0x9}});_0x31ee56['on'](_0x691e('0x51'),function(_0x59e416){if(_0x59e416['code']===_0x691e('0x52')){logger['error'](_0x59e416);}else{throw new db[(_0x691e('0x53'))][(_0x691e('0x54'))](_0x691e('0x55'));}});_0x31ee56['on'](_0x691e('0x56'),function(_0x5d4713){throw new db[(_0x691e('0x53'))][(_0x691e('0x54'))](_0x691e('0x55'));});_0x31ee56['pipe'](_0x3b4e2b);_0x31ee56['glob'](_0x691e('0x57'),{'cwd':path[_0x691e('0x58')](config[_0x691e('0x4b')],_0x691e('0x4c'),path[_0x691e('0x59')](_0x51918a[_0x691e('0x6')])),'ignore':[path['join'](path[_0x691e('0x4e')](_0x51918a['path']),_0x691e('0x5a')),path['join'](path['basename'](_0x51918a[_0x691e('0x6')]),_0x691e('0x5b'))],'nodir':!![]})[_0x691e('0x5c')]();_0x3b4e2b['on'](_0x691e('0x5d'),function(){if(!fs['existsSync'](_0x1ef7b0)){throw new db[(_0x691e('0x53'))][(_0x691e('0x54'))](_0x691e('0x5e'));}return _0x5e761e[_0x691e('0x5f')](_0x1ef7b0,util['format'](_0x691e('0x60'),path[_0x691e('0x4e')](_0x51918a[_0x691e('0x6')])),function(_0x5f3c3e){if(_0x5f3c3e){throw new db['Sequelize'][(_0x691e('0x54'))](_0x691e('0x61'));}fs[_0x691e('0x62')](_0x1ef7b0);logger[_0x691e('0x63')](_0x691e('0x64'));logger['info'](_0x691e('0x65'));});});}return null;})[_0x691e('0x4a')](handleError(_0x5e761e,null));};exports[_0x691e('0x66')]=function(_0x469ddf,_0x187f76,_0x24bd27){var _0x3483f2=path['basename'](_0x469ddf[_0x691e('0x67')][_0x691e('0x68')],path['extname'](_0x469ddf[_0x691e('0x67')][_0x691e('0x68')]));var _0x2423c8=path[_0x691e('0x58')](config[_0x691e('0x4b')],_0x691e('0x4c'),_0x469ddf['file'][_0x691e('0x68')]);var _0x54828e=path[_0x691e('0x58')](config[_0x691e('0x4b')],_0x691e('0x4c'),_0x3483f2);logger[_0x691e('0x63')](_0x691e('0x69'),_0x2423c8);logger['info'](_0x691e('0x6a'),_0x54828e);try{fs[_0x691e('0x6b')](_0x2423c8,parseInt(_0x691e('0x6c'),0x8));extract(_0x2423c8,{'dir':_0x54828e},function(_0x56ef63){if(_0x56ef63){logger['error'](_0x56ef63);handleError(_0x56ef63,!![]);};var _0x13f932=fs[_0x691e('0x6d')](_0x54828e);if(_0x13f932[_0x691e('0x38')]>0x1){removeReferences(_0x2423c8,_0x54828e);logger[_0x691e('0x56')](_0x691e('0x6e'));return _0x24bd27(new Error('Invalid\x20plugin\x20structure'));}var _0x53d498=fs[_0x691e('0x6f')](path[_0x691e('0x58')](_0x54828e,_0x13f932[0x0]));if(_0x53d498[_0x691e('0x70')]()){removeReferences(_0x2423c8,_0x54828e);logger[_0x691e('0x56')](_0x691e('0x6e'));return _0x24bd27(new Error(_0x691e('0x6e')));}if(_0x53d498[_0x691e('0x71')]()){var _0x2ca860=fs[_0x691e('0x6d')](path[_0x691e('0x58')](_0x54828e,_0x13f932[0x0]));if(_0x2ca860[_0x691e('0x38')]===0x0){removeReferences(_0x2423c8,_0x54828e);logger[_0x691e('0x56')](_0x691e('0x6e'));return _0x24bd27(new Error(_0x691e('0x6e')));}var _0x2d70d7=_0x2ca860['some'](function(_0x54fbb5){return _0x54fbb5===_0x691e('0x72');});if(!_0x2d70d7){return _0x24bd27(new Error(_0x691e('0x73')));}var _0x486cee=fs[_0x691e('0x74')](path[_0x691e('0x58')](_0x54828e,_0x13f932[0x0],_0x691e('0x72')));var _0x48793f=JSON[_0x691e('0x75')](_0x486cee);if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x2a')]){return _0x24bd27(new Error(_0x691e('0x76')));}if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x30')]){return _0x24bd27(new Error(_0x691e('0x77')));}if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x78')]){return _0x24bd27(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x79')]){return _0x24bd27(new Error(_0x691e('0x7a')));}if(_0x48793f[_0x691e('0x30')]===_0x691e('0x7b')){if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x79')][_0x691e('0x7c')]){return _0x24bd27(new Error(_0x691e('0x7d')));}if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x79')][_0x691e('0x7c')][_0x691e('0x7e')]&&'undefined'==typeof _0x48793f[_0x691e('0x79')][_0x691e('0x7c')]['agent']){return _0x24bd27(new Error(_0x691e('0x7f')));}}else if(_0x48793f['type']==='script'){if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x79')]['scriptName']){return _0x24bd27(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x691e('0x1c')==typeof _0x48793f[_0x691e('0x79')][_0x691e('0x80')]){return _0x24bd27(new Error(_0x691e('0x81')));}}else{return _0x24bd27(new Error(_0x691e('0x82')));}var _0x5929b3=_0x48793f[_0x691e('0x2a')];var _0x24abfb=_0x48793f[_0x691e('0x83')];var _0x3506ea=_0x48793f['type'];var _0x546ce5=_0x48793f[_0x691e('0x84')]?_0x48793f[_0x691e('0x84')]:_0x691e('0x85');var _0x1ab1ca=_0x48793f[_0x691e('0x86')]?_0x48793f[_0x691e('0x86')]:_0x691e('0x87');var _0x29abae='';var _0xd1157c='';var _0x2737d3='';var _0x818641='';var _0x121bd0=_0x48793f[_0x691e('0x78')];if(_0x3506ea===_0x691e('0x7b')){if(_0x691e('0x1c')!=typeof _0x48793f[_0x691e('0x79')]['views'][_0x691e('0x7e')]){var _0x470298=_0x48793f[_0x691e('0x79')][_0x691e('0x7c')][_0x691e('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x691e('0x88')](_0x470298)){_0x29abae=path[_0x691e('0x58')](_0x691e('0x89'),_0x3483f2,_0x13f932[0x0],_0x470298);}else{_0x29abae=_0x470298;}}else{logger[_0x691e('0x63')](_0x691e('0x8a'));}if(_0x691e('0x1c')!=typeof _0x48793f[_0x691e('0x79')][_0x691e('0x7c')]['agent']){var _0x51f583=_0x48793f[_0x691e('0x79')][_0x691e('0x7c')][_0x691e('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x51f583)){_0xd1157c=path[_0x691e('0x58')](_0x691e('0x89'),_0x3483f2,_0x13f932[0x0],_0x51f583);}else{_0xd1157c=_0x51f583;}}else{logger[_0x691e('0x63')](_0x691e('0x8c'));}}else if(_0x3506ea===_0x691e('0x8d')){_0x2737d3=_0x48793f[_0x691e('0x79')][_0x691e('0x8e')];_0x818641=_0x48793f[_0x691e('0x79')]['scriptPath'];if(_0x691e('0x1c')!=typeof _0x48793f[_0x691e('0x79')][_0x691e('0x7c')]){if(_0x691e('0x1c')!=typeof _0x48793f[_0x691e('0x79')][_0x691e('0x7c')][_0x691e('0x7e')]){var _0x470298=_0x48793f[_0x691e('0x79')][_0x691e('0x7c')][_0x691e('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x470298)){_0x29abae=path[_0x691e('0x58')](_0x691e('0x89'),_0x3483f2,_0x13f932[0x0],_0x470298);}else{_0x29abae=_0x470298;}}if(_0x691e('0x1c')!=typeof _0x48793f[_0x691e('0x79')]['views']['agent']){var _0x51f583=_0x48793f[_0x691e('0x79')][_0x691e('0x7c')][_0x691e('0x8b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x51f583)){_0xd1157c=path[_0x691e('0x58')](_0x691e('0x89'),_0x3483f2,_0x13f932[0x0],_0x51f583);}else{_0xd1157c=_0x51f583;}}}}var _0x21bfc9={'name':_0x5929b3,'description':_0x24abfb,'path':path['join'](_0x3483f2,_0x13f932[0x0]),'type':_0x3506ea,'sidebar':_0x546ce5,'icon':_0x1ab1ca,'adminUrl':_0x29abae,'agentUrl':_0xd1157c,'scriptName':_0x2737d3,'scriptPath':_0x818641,'version':_0x121bd0};removeReferences(_0x2423c8,null);return db[_0x691e('0x2e')][_0x691e('0x8f')](_0x21bfc9)['then'](function(_0x443918){var _0x42e0cb={'role':_0x469ddf[_0x691e('0x90')][_0x691e('0x91')],'userProfileId':_0x469ddf[_0x691e('0x90')][_0x691e('0x92')]};if(!_0x42e0cb)throw new Error(_0x691e('0x93'));if(_0x42e0cb[_0x691e('0x91')]===_0x691e('0x94')){var _0x151704=_0x443918[_0x691e('0x95')]({'plain':!![]});return db[_0x691e('0x96')]['find']({'where':{'name':_0x691e('0x26'),'userProfileId':_0x42e0cb[_0x691e('0x92')]},'raw':!![]})[_0x691e('0x28')](function(_0x1de779){if(_0x1de779&&_0x1de779[_0x691e('0x97')]===0x0){return db[_0x691e('0x27')][_0x691e('0x8f')]({'name':_0x151704['name'],'resourceId':_0x151704['id'],'type':_0x1de779[_0x691e('0x2a')],'sectionId':_0x1de779['id']},{})[_0x691e('0x28')](function(){return _0x443918;});}else{return _0x443918;}})['catch'](function(_0x15f013){logger[_0x691e('0x56')](_0x691e('0x98'),_0x15f013);throw _0x15f013;});}return _0x443918;})[_0x691e('0x28')](respondWithResult(_0x187f76,null))[_0x691e('0x4a')](handleError(_0x187f76,null));}});}catch(_0x5abc1a){_0x187f76[_0x691e('0x19')](0x1f4)['send'](_0x5abc1a);}};function removeReferences(_0x5d7114,_0x1998f8){try{if(_0x5d7114){fs['unlinkSync'](_0x5d7114);logger['info'](_0x691e('0x99'));}if(_0x1998f8){rimraf(_0x1998f8,function(){});logger[_0x691e('0x63')]('Extracted\x20folder\x20removed');}}catch(_0x1eaba1){logger[_0x691e('0x56')](_0x1eaba1);}}exports['update']=function(_0x36870f,_0x5808e2,_0xe960d7){return db[_0x691e('0x2e')]['find']({'where':{'id':_0x36870f['params']['id']}})['then'](handleEntityNotFound(_0x5808e2,null))[_0x691e('0x28')](saveUpdates(_0x36870f[_0x691e('0x90')],null))[_0x691e('0x28')](respondWithResult(_0x5808e2,null))[_0x691e('0x4a')](handleError(_0x5808e2,null));};exports[_0x691e('0x9a')]=function(_0x37abb0,_0x25731f,_0x5d4762){return db['Plugin'][_0x691e('0x49')]({'where':{'id':_0x37abb0['params']['id']}})[_0x691e('0x28')](function(_0x2ef11f){if(_0x2ef11f){return _0x2ef11f[_0x691e('0x25')]();}})['then'](function(_0xdff105){rimraf(path['join'](config[_0x691e('0x4b')],_0x691e('0x4c'),path['dirname'](_0xdff105[_0x691e('0x6')])),function(){});return _0xdff105;})[_0x691e('0x28')](handleEntityNotFound(_0x25731f,null))[_0x691e('0x28')](respondWithStatusCode(_0x25731f,null))['catch'](handleError(_0x25731f,null));};exports[_0x691e('0x9b')]=function(_0x24a092,_0x3cbd65,_0x477a72){return BPromise['resolve']()['then'](function(){if(!_0x24a092[_0x691e('0x33')][_0x691e('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x24a092[_0x691e('0x33')][_0x691e('0x9c')]){throw new Error(_0x691e('0x9d'));}var _0x378307=_0x24a092[_0x691e('0x33')][_0x691e('0x9e')]?_0x24a092['query']['hostname']+':'+_0x24a092[_0x691e('0x33')][_0x691e('0x9c')]:_0x691e('0x9f')+_0x24a092[_0x691e('0x33')][_0x691e('0x9c')];var _0x28cf55=_0x24a092[_0x691e('0x33')][_0x691e('0x21')]?_0x24a092[_0x691e('0x33')][_0x691e('0x21')]:!![];var _0x3a7ef1=_0x24a092[_0x691e('0x33')]['encoding']?_0x24a092['query']['encoding']:null;var _0x418940={'method':_0x24a092[_0x691e('0xa0')],'uri':util[_0x691e('0x4d')]('%s%s',_0x378307,_0x24a092['query'][_0x691e('0x6')]),'json':_0x28cf55,'resolveWithFullResponse':!![],'encoding':_0x3a7ef1,'qs':_0x24a092[_0x691e('0x33')]};if(_0x24a092['headers']){_0x418940[_0x691e('0xa1')]=_0x24a092['headers'];if(_0x418940[_0x691e('0xa1')][_0x691e('0xa2')]){delete _0x418940[_0x691e('0xa1')]['content-length'];}}if(_0x418940[_0x691e('0xa1')][_0x691e('0xa3')]){delete _0x418940[_0x691e('0xa1')]['content-type'];}return rp(_0x418940);})[_0x691e('0x28')](function(_0x3053c0){if(_0x3053c0){_0x3cbd65[_0x691e('0x1f')](_0x3053c0[_0x691e('0xa1')]);logger[_0x691e('0x63')](_0x3053c0[_0x691e('0x90')]);if(_[_0x691e('0xa4')](_0x24a092[_0x691e('0x33')][_0x691e('0x6')],_0x691e('0x5f'))&&_0x3053c0['statusCode']==0x1f4){return _0x3cbd65[_0x691e('0x18')](_0x3053c0['statusCode']);}else{return _0x3cbd65[_0x691e('0x19')](_0x3053c0[_0x691e('0xa5')])['send'](_0x3053c0[_0x691e('0x90')]);}}else{return _0x3cbd65[_0x691e('0x18')](0xc8);}})[_0x691e('0x4a')](handleError(_0x3cbd65,null));};exports['webhookPost']=function(_0x58fd2a,_0x3e06ca,_0x2eec0f){return BPromise['resolve']()[_0x691e('0x28')](function(){if(!_0x58fd2a[_0x691e('0x33')][_0x691e('0x6')]){throw new Error(_0x691e('0xa6'));}if(!_0x58fd2a[_0x691e('0x33')][_0x691e('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x59c86a=_0x58fd2a[_0x691e('0x33')][_0x691e('0x9e')]?_0x58fd2a[_0x691e('0x33')]['hostname']+':'+_0x58fd2a[_0x691e('0x33')][_0x691e('0x9c')]:_0x691e('0x9f')+_0x58fd2a[_0x691e('0x33')]['port'];var _0x5bdabb=_0x58fd2a[_0x691e('0x33')]['json']?_0x58fd2a[_0x691e('0x33')][_0x691e('0x21')]:!![];var _0x52fc3c=_0x58fd2a['query'][_0x691e('0xa7')]?_0x58fd2a[_0x691e('0x33')][_0x691e('0xa7')]:null;var _0x5bb529={'method':_0x58fd2a[_0x691e('0xa0')],'uri':util[_0x691e('0x4d')](_0x691e('0xa8'),_0x59c86a,_0x58fd2a[_0x691e('0x33')][_0x691e('0x6')]),'json':_0x5bdabb,'resolveWithFullResponse':!![],'encoding':_0x52fc3c,'body':_0x58fd2a['body']};if(_0x58fd2a[_0x691e('0xa1')]){_0x5bb529[_0x691e('0xa1')]=_0x58fd2a['headers'];if(_0x5bb529[_0x691e('0xa1')][_0x691e('0xa2')]){delete _0x5bb529[_0x691e('0xa1')][_0x691e('0xa2')];}}if(_0x5bb529[_0x691e('0xa1')][_0x691e('0xa3')]){delete _0x5bb529[_0x691e('0xa1')][_0x691e('0xa3')];}return rp(_0x5bb529);})['then'](function(_0x34e386){if(_0x34e386){_0x3e06ca['set'](_0x34e386['headers']);logger[_0x691e('0x63')](_0x34e386[_0x691e('0x90')]);return _0x3e06ca[_0x691e('0x19')](_0x34e386[_0x691e('0xa5')])[_0x691e('0x2b')](_0x34e386[_0x691e('0x90')]);}else{return _0x3e06ca[_0x691e('0x18')](0xc8);}})[_0x691e('0x4a')](handleError(_0x3e06ca,null));};
\ No newline at end of file
+var _0x877e=['close','existsSync','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','webhookPost','%s%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','Plugin','includeAll','findAll','rows','show','params','rawAttributes','length','include','catch','download','find','root','format','basename','createWriteStream','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','join','server/files/plugins','dirname','node_modules/**/*','attachments/**/*'];(function(_0x177c2f,_0x8bbb86){var _0x17a5ff=function(_0x129927){while(--_0x129927){_0x177c2f['push'](_0x177c2f['shift']());}};_0x17a5ff(++_0x8bbb86);}(_0x877e,0x193));var _0xe877=function(_0x5c3887,_0x51aec1){_0x5c3887=_0x5c3887-0x0;var _0x28cba5=_0x877e[_0x5c3887];return _0x28cba5;};'use strict';var emlformat=require(_0xe877('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe877('0x1'));var jsonpatch=require(_0xe877('0x2'));var rp=require(_0xe877('0x3'));var moment=require(_0xe877('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe877('0x5'));var util=require(_0xe877('0x6'));var path=require(_0xe877('0x7'));var sox=require(_0xe877('0x8'));var csv=require(_0xe877('0x9'));var ejs=require(_0xe877('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe877('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe877('0xc'));var deskjs=require(_0xe877('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe877('0xe'));var Papa=require(_0xe877('0xf'));var extract=require('extract-zip');var rimraf=require(_0xe877('0x10'));var archiver=require('archiver');var Redis=require(_0xe877('0x11'));var authService=require(_0xe877('0x12'));var qs=require(_0xe877('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe877('0x14'));var logger=require(_0xe877('0x15'))(_0xe877('0x16'));var utils=require(_0xe877('0x17'));var config=require(_0xe877('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe877('0x19')]=_[_0xe877('0x1a')](config[_0xe877('0x19')],{'host':_0xe877('0x1b'),'port':0x18eb});var socket=require(_0xe877('0x1c'))(new Redis(config[_0xe877('0x19')]));require(_0xe877('0x1d'))[_0xe877('0x1e')](socket);function respondWithStatusCode(_0x2b916e,_0xe46632){_0xe46632=_0xe46632||0xcc;return function(_0x21eee1){if(_0x21eee1){return _0x2b916e['sendStatus'](_0xe46632);}return _0x2b916e['status'](_0xe46632)[_0xe877('0x1f')]();};}function respondWithResult(_0x32ac94,_0x2252a){_0x2252a=_0x2252a||0xc8;return function(_0x4e59e4){if(_0x4e59e4){return _0x32ac94[_0xe877('0x20')](_0x2252a)['json'](_0x4e59e4);}};}function respondWithFilteredResult(_0x3cf25a,_0x401c7e){return function(_0x4c4824){if(_0x4c4824){var _0x5582eb=typeof _0x401c7e['offset']===_0xe877('0x21')&&typeof _0x401c7e[_0xe877('0x22')]===_0xe877('0x21');var _0x3c4c40=_0x4c4824['count'];var _0x2eae05=_0x5582eb?0x0:_0x401c7e[_0xe877('0x23')];var _0x2f5a70=_0x5582eb?_0x4c4824[_0xe877('0x24')]:_0x401c7e[_0xe877('0x23')]+_0x401c7e['limit'];var _0x5bc417;if(_0x2f5a70>=_0x3c4c40){_0x2f5a70=_0x3c4c40;_0x5bc417=0xc8;}else{_0x5bc417=0xce;}_0x3cf25a[_0xe877('0x20')](_0x5bc417);return _0x3cf25a[_0xe877('0x25')](_0xe877('0x26'),_0x2eae05+'-'+_0x2f5a70+'/'+_0x3c4c40)[_0xe877('0x27')](_0x4c4824);}return null;};}function patchUpdates(_0x20c43e){return function(_0x1dc33c){try{jsonpatch[_0xe877('0x28')](_0x1dc33c,_0x20c43e,!![]);}catch(_0x25ffd0){return BPromise[_0xe877('0x29')](_0x25ffd0);}return _0x1dc33c['save']();};}function saveUpdates(_0x42c89a,_0x4bd287){return function(_0x59a0a5){if(_0x59a0a5){return _0x59a0a5[_0xe877('0x2a')](_0x42c89a)[_0xe877('0x2b')](function(_0x577061){return _0x577061;});}return null;};}function removeEntity(_0x2d08fd,_0x1fc019){return function(_0x5d5bd8){if(_0x5d5bd8){return _0x5d5bd8[_0xe877('0x2c')]()[_0xe877('0x2b')](function(){var _0x2fbf25=_0x5d5bd8[_0xe877('0x2d')]({'plain':!![]});var _0x432f22=_0xe877('0x2e');return db[_0xe877('0x2f')]['destroy']({'where':{'type':_0x432f22,'resourceId':_0x2fbf25['id']}})[_0xe877('0x2b')](function(){return _0x5d5bd8;});})[_0xe877('0x2b')](function(){_0x2d08fd[_0xe877('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a2bc,_0x4e97ba){return function(_0x10307b){if(!_0x10307b){_0x18a2bc[_0xe877('0x30')](0x194);}return _0x10307b;};}function handleError(_0x2670be,_0x4f7bf0){_0x4f7bf0=_0x4f7bf0||0x1f4;return function(_0x162037){logger[_0xe877('0x31')](_0x162037[_0xe877('0x32')]);if(_0x162037[_0xe877('0x33')]){delete _0x162037[_0xe877('0x33')];}_0x2670be['status'](_0x4f7bf0)[_0xe877('0x34')](_0x162037);};}exports[_0xe877('0x35')]=function(_0x3c4981,_0x1628d3){var _0x2dbde2={},_0xbe8ab3={},_0x843b1f={'count':0x0,'rows':[]};var _0xefb7f2=_[_0xe877('0x36')](db['Plugin']['rawAttributes'],function(_0x21cc1e){return{'name':_0x21cc1e[_0xe877('0x37')],'type':_0x21cc1e['type'][_0xe877('0x38')]};});_0xbe8ab3[_0xe877('0x39')]=_['map'](_0xefb7f2,_0xe877('0x33'));_0xbe8ab3['query']=_[_0xe877('0x3a')](_0x3c4981[_0xe877('0x3b')]);_0xbe8ab3[_0xe877('0x3c')]=_[_0xe877('0x3d')](_0xbe8ab3[_0xe877('0x39')],_0xbe8ab3[_0xe877('0x3b')]);_0x2dbde2[_0xe877('0x3e')]=_[_0xe877('0x3d')](_0xbe8ab3['model'],qs[_0xe877('0x3f')](_0x3c4981[_0xe877('0x3b')]['fields']));_0x2dbde2[_0xe877('0x3e')]=_0x2dbde2[_0xe877('0x3e')]['length']?_0x2dbde2[_0xe877('0x3e')]:_0xbe8ab3[_0xe877('0x39')];if(!_0x3c4981['query'][_0xe877('0x40')](_0xe877('0x41'))){_0x2dbde2['limit']=qs[_0xe877('0x22')](_0x3c4981['query']['limit']);_0x2dbde2[_0xe877('0x23')]=qs[_0xe877('0x23')](_0x3c4981[_0xe877('0x3b')][_0xe877('0x23')]);}_0x2dbde2[_0xe877('0x42')]=qs[_0xe877('0x43')](_0x3c4981[_0xe877('0x3b')][_0xe877('0x43')]);_0x2dbde2[_0xe877('0x44')]=qs[_0xe877('0x3c')](_['pick'](_0x3c4981[_0xe877('0x3b')],_0xbe8ab3[_0xe877('0x3c')]),_0xefb7f2);if(_0x3c4981[_0xe877('0x3b')]['filter']){_0x2dbde2[_0xe877('0x44')]=_[_0xe877('0x45')](_0x2dbde2['where'],{'$or':_['map'](_0xefb7f2,function(_0x36c169){if(_0x36c169[_0xe877('0x46')]!==_0xe877('0x47')){var _0x588c12={};_0x588c12[_0x36c169[_0xe877('0x33')]]={'$like':'%'+_0x3c4981[_0xe877('0x3b')][_0xe877('0x48')]+'%'};return _0x588c12;}})});}_0x2dbde2=_['merge']({},_0x2dbde2,_0x3c4981[_0xe877('0x49')]);var _0x4cddcf={'where':_0x2dbde2[_0xe877('0x44')]};return db[_0xe877('0x4a')][_0xe877('0x24')](_0x4cddcf)[_0xe877('0x2b')](function(_0x47251b){_0x843b1f[_0xe877('0x24')]=_0x47251b;if(_0x3c4981[_0xe877('0x3b')][_0xe877('0x4b')]){_0x2dbde2['include']=[{'all':!![]}];}return db[_0xe877('0x4a')][_0xe877('0x4c')](_0x2dbde2);})[_0xe877('0x2b')](function(_0x526df7){_0x843b1f[_0xe877('0x4d')]=_0x526df7;return _0x843b1f;})[_0xe877('0x2b')](respondWithFilteredResult(_0x1628d3,_0x2dbde2))['catch'](handleError(_0x1628d3,null));};exports[_0xe877('0x4e')]=function(_0xebc1fd,_0x9f3588){var _0x4409d5={'raw':!![],'where':{'id':_0xebc1fd[_0xe877('0x4f')]['id']}},_0x425257={};_0x425257[_0xe877('0x39')]=_[_0xe877('0x3a')](db[_0xe877('0x4a')][_0xe877('0x50')]);_0x425257[_0xe877('0x3b')]=_[_0xe877('0x3a')](_0xebc1fd[_0xe877('0x3b')]);_0x425257[_0xe877('0x3c')]=_[_0xe877('0x3d')](_0x425257['model'],_0x425257[_0xe877('0x3b')]);_0x4409d5[_0xe877('0x3e')]=_[_0xe877('0x3d')](_0x425257['model'],qs[_0xe877('0x3f')](_0xebc1fd[_0xe877('0x3b')][_0xe877('0x3f')]));_0x4409d5[_0xe877('0x3e')]=_0x4409d5[_0xe877('0x3e')][_0xe877('0x51')]?_0x4409d5[_0xe877('0x3e')]:_0x425257[_0xe877('0x39')];if(_0xebc1fd[_0xe877('0x3b')][_0xe877('0x4b')]){_0x4409d5[_0xe877('0x52')]=[{'all':!![]}];}_0x4409d5=_[_0xe877('0x45')]({},_0x4409d5,_0xebc1fd['options']);return db[_0xe877('0x4a')]['find'](_0x4409d5)['then'](handleEntityNotFound(_0x9f3588,null))[_0xe877('0x2b')](respondWithResult(_0x9f3588,null))[_0xe877('0x53')](handleError(_0x9f3588,null));};exports[_0xe877('0x54')]=function(_0xc125eb,_0x361dc0,_0x452584){return db[_0xe877('0x4a')][_0xe877('0x55')]({'where':{'id':_0xc125eb[_0xe877('0x4f')]['id']},'attributes':['name',_0xe877('0x7')],'raw':!![]})[_0xe877('0x2b')](handleEntityNotFound(_0x361dc0,null))[_0xe877('0x2b')](function(_0x3a517b){if(_0x3a517b){var _0x4ee700=path['join'](config[_0xe877('0x56')],'server/files/plugins',util[_0xe877('0x57')]('%s.zip',path[_0xe877('0x58')](_0x3a517b[_0xe877('0x7')])));var _0x171822=fs[_0xe877('0x59')](_0x4ee700);var _0x2590d7=archiver('zip',{'zlib':{'level':0x9}});_0x2590d7['on'](_0xe877('0x5a'),function(_0x2a14fd){if(_0x2a14fd[_0xe877('0x5b')]==='ENOENT'){logger['error'](_0x2a14fd);}else{throw new db[(_0xe877('0x5c'))][(_0xe877('0x5d'))](_0xe877('0x5e'));}});_0x2590d7['on'](_0xe877('0x31'),function(_0x5aa05e){throw new db[(_0xe877('0x5c'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2590d7['pipe'](_0x171822);_0x2590d7['glob'](_0xe877('0x5f'),{'cwd':path[_0xe877('0x60')](config['root'],_0xe877('0x61'),path[_0xe877('0x62')](_0x3a517b['path'])),'ignore':[path[_0xe877('0x60')](path[_0xe877('0x58')](_0x3a517b[_0xe877('0x7')]),_0xe877('0x63')),path['join'](path[_0xe877('0x58')](_0x3a517b[_0xe877('0x7')]),_0xe877('0x64'))],'nodir':!![]})['finalize']();_0x171822['on'](_0xe877('0x65'),function(){if(!fs[_0xe877('0x66')](_0x4ee700)){throw new db[(_0xe877('0x5c'))][(_0xe877('0x5d'))]('Plugin\x20not\x20found');}return _0x361dc0['download'](_0x4ee700,util['format'](_0xe877('0x67'),path[_0xe877('0x58')](_0x3a517b['path'])),function(_0x14d4d0){if(_0x14d4d0){throw new db['Sequelize']['Error'](_0xe877('0x68'));}fs[_0xe877('0x69')](_0x4ee700);logger[_0xe877('0x6a')](_0xe877('0x6b'));logger[_0xe877('0x6a')](_0xe877('0x6c'));});});}return null;})[_0xe877('0x53')](handleError(_0x361dc0,null));};exports['upload']=function(_0x34f28e,_0x54ae32,_0x2b028c){var _0xf7deea=path[_0xe877('0x58')](_0x34f28e['file'][_0xe877('0x6d')],path[_0xe877('0x6e')](_0x34f28e['file'][_0xe877('0x6d')]));var _0x1e2fcd=path['join'](config['root'],_0xe877('0x61'),_0x34f28e[_0xe877('0x6f')][_0xe877('0x6d')]);var _0x220a96=path['join'](config[_0xe877('0x56')],'server/files/plugins',_0xf7deea);logger[_0xe877('0x6a')](_0xe877('0x70'),_0x1e2fcd);logger[_0xe877('0x6a')](_0xe877('0x71'),_0x220a96);try{fs[_0xe877('0x72')](_0x1e2fcd,parseInt(_0xe877('0x73'),0x8));extract(_0x1e2fcd,{'dir':_0x220a96},function(_0x53a9d0){if(_0x53a9d0){logger[_0xe877('0x31')](_0x53a9d0);handleError(_0x53a9d0,!![]);};var _0x433cf3=fs[_0xe877('0x74')](_0x220a96);if(_0x433cf3[_0xe877('0x51')]>0x1){removeReferences(_0x1e2fcd,_0x220a96);logger[_0xe877('0x31')](_0xe877('0x75'));return _0x2b028c(new Error(_0xe877('0x75')));}var _0x4bab24=fs['lstatSync'](path[_0xe877('0x60')](_0x220a96,_0x433cf3[0x0]));if(_0x4bab24[_0xe877('0x76')]()){removeReferences(_0x1e2fcd,_0x220a96);logger[_0xe877('0x31')](_0xe877('0x75'));return _0x2b028c(new Error(_0xe877('0x75')));}if(_0x4bab24['isDirectory']()){var _0x573389=fs[_0xe877('0x74')](path[_0xe877('0x60')](_0x220a96,_0x433cf3[0x0]));if(_0x573389[_0xe877('0x51')]===0x0){removeReferences(_0x1e2fcd,_0x220a96);logger[_0xe877('0x31')](_0xe877('0x75'));return _0x2b028c(new Error(_0xe877('0x75')));}var _0xa52b82=_0x573389[_0xe877('0x77')](function(_0x54e1d5){return _0x54e1d5===_0xe877('0x78');});if(!_0xa52b82){return _0x2b028c(new Error(_0xe877('0x79')));}var _0x4237b8=fs[_0xe877('0x7a')](path[_0xe877('0x60')](_0x220a96,_0x433cf3[0x0],'manifest.json'));var _0x1a4550=JSON[_0xe877('0x7b')](_0x4237b8);if(_0xe877('0x21')==typeof _0x1a4550[_0xe877('0x33')]){return _0x2b028c(new Error(_0xe877('0x7c')));}if('undefined'==typeof _0x1a4550[_0xe877('0x46')]){return _0x2b028c(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xe877('0x21')==typeof _0x1a4550[_0xe877('0x7d')]){return _0x2b028c(new Error(_0xe877('0x7e')));}if(_0xe877('0x21')==typeof _0x1a4550[_0xe877('0x7f')]){return _0x2b028c(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1a4550[_0xe877('0x46')]===_0xe877('0x80')){if(_0xe877('0x21')==typeof _0x1a4550['parameters'][_0xe877('0x81')]){return _0x2b028c(new Error(_0xe877('0x82')));}if(_0xe877('0x21')==typeof _0x1a4550[_0xe877('0x7f')][_0xe877('0x81')][_0xe877('0x83')]&&'undefined'==typeof _0x1a4550[_0xe877('0x7f')][_0xe877('0x81')]['agent']){return _0x2b028c(new Error(_0xe877('0x84')));}}else if(_0x1a4550[_0xe877('0x46')]===_0xe877('0x85')){if(_0xe877('0x21')==typeof _0x1a4550[_0xe877('0x7f')]['scriptName']){return _0x2b028c(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xe877('0x21')==typeof _0x1a4550[_0xe877('0x7f')][_0xe877('0x86')]){return _0x2b028c(new Error(_0xe877('0x87')));}}else{return _0x2b028c(new Error(_0xe877('0x88')));}var _0x2db41c=_0x1a4550[_0xe877('0x33')];var _0x1af487=_0x1a4550[_0xe877('0x89')];var _0x240569=_0x1a4550['type'];var _0x2c368c=_0x1a4550['sidebar']?_0x1a4550[_0xe877('0x8a')]:_0xe877('0x8b');var _0x5a7929=_0x1a4550[_0xe877('0x8c')]?_0x1a4550['icon']:_0xe877('0x8d');var _0x58fa80='';var _0x12d990='';var _0xae9170='';var _0x525593='';var _0x24da50=_0x1a4550[_0xe877('0x7d')];if(_0x240569==='html'){if(_0xe877('0x21')!=typeof _0x1a4550[_0xe877('0x7f')][_0xe877('0x81')][_0xe877('0x83')]){var _0x16d65e=_0x1a4550[_0xe877('0x7f')][_0xe877('0x81')][_0xe877('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xe877('0x8e')](_0x16d65e)){_0x58fa80=path[_0xe877('0x60')](_0xe877('0x8f'),_0xf7deea,_0x433cf3[0x0],_0x16d65e);}else{_0x58fa80=_0x16d65e;}}else{logger[_0xe877('0x6a')](_0xe877('0x90'));}if('undefined'!=typeof _0x1a4550[_0xe877('0x7f')][_0xe877('0x81')]['agent']){var _0x188506=_0x1a4550[_0xe877('0x7f')]['views'][_0xe877('0x91')];if(!/^(f|ht)tps?:\/\//i[_0xe877('0x8e')](_0x188506)){_0x12d990=path['join'](_0xe877('0x8f'),_0xf7deea,_0x433cf3[0x0],_0x188506);}else{_0x12d990=_0x188506;}}else{logger[_0xe877('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x240569==='script'){_0xae9170=_0x1a4550[_0xe877('0x7f')][_0xe877('0x92')];_0x525593=_0x1a4550[_0xe877('0x7f')][_0xe877('0x86')];if(_0xe877('0x21')!=typeof _0x1a4550['parameters'][_0xe877('0x81')]){if(_0xe877('0x21')!=typeof _0x1a4550['parameters']['views']['admin']){var _0x16d65e=_0x1a4550[_0xe877('0x7f')]['views'][_0xe877('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x16d65e)){_0x58fa80=path[_0xe877('0x60')](_0xe877('0x8f'),_0xf7deea,_0x433cf3[0x0],_0x16d65e);}else{_0x58fa80=_0x16d65e;}}if(_0xe877('0x21')!=typeof _0x1a4550[_0xe877('0x7f')][_0xe877('0x81')][_0xe877('0x91')]){var _0x188506=_0x1a4550[_0xe877('0x7f')]['views'][_0xe877('0x91')];if(!/^(f|ht)tps?:\/\//i[_0xe877('0x8e')](_0x188506)){_0x12d990=path['join']('plugins',_0xf7deea,_0x433cf3[0x0],_0x188506);}else{_0x12d990=_0x188506;}}}}var _0xb7b4fb={'name':_0x2db41c,'description':_0x1af487,'path':path[_0xe877('0x60')](_0xf7deea,_0x433cf3[0x0]),'type':_0x240569,'sidebar':_0x2c368c,'icon':_0x5a7929,'adminUrl':_0x58fa80,'agentUrl':_0x12d990,'scriptName':_0xae9170,'scriptPath':_0x525593,'version':_0x24da50};removeReferences(_0x1e2fcd,null);return db[_0xe877('0x4a')][_0xe877('0x93')](_0xb7b4fb)[_0xe877('0x2b')](function(_0x54ec41){var _0x1811fc={'role':_0x34f28e['body'][_0xe877('0x94')],'userProfileId':_0x34f28e[_0xe877('0x95')][_0xe877('0x96')]};if(!_0x1811fc)throw new Error(_0xe877('0x97'));if(_0x1811fc['role']==='user'){var _0x378222=_0x54ec41[_0xe877('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0xe877('0x55')]({'where':{'name':_0xe877('0x2e'),'userProfileId':_0x1811fc[_0xe877('0x96')]},'raw':!![]})[_0xe877('0x2b')](function(_0x1fb228){if(_0x1fb228&&_0x1fb228['autoAssociation']===0x0){return db[_0xe877('0x2f')][_0xe877('0x93')]({'name':_0x378222[_0xe877('0x33')],'resourceId':_0x378222['id'],'type':_0x1fb228[_0xe877('0x33')],'sectionId':_0x1fb228['id']},{})[_0xe877('0x2b')](function(){return _0x54ec41;});}else{return _0x54ec41;}})['catch'](function(_0x8c0d19){logger[_0xe877('0x31')](_0xe877('0x98'),_0x8c0d19);throw _0x8c0d19;});}return _0x54ec41;})[_0xe877('0x2b')](respondWithResult(_0x54ae32,null))[_0xe877('0x53')](handleError(_0x54ae32,null));}});}catch(_0x693eb1){_0x54ae32[_0xe877('0x20')](0x1f4)[_0xe877('0x34')](_0x693eb1);}};function removeReferences(_0x2b7933,_0x806ffd){try{if(_0x2b7933){fs[_0xe877('0x69')](_0x2b7933);logger[_0xe877('0x6a')]('Zip\x20archive\x20removed');}if(_0x806ffd){rimraf(_0x806ffd,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x58b8f2){logger[_0xe877('0x31')](_0x58b8f2);}}exports[_0xe877('0x2a')]=function(_0x390448,_0x1dfc2e,_0x29882d){return db[_0xe877('0x4a')][_0xe877('0x55')]({'where':{'id':_0x390448[_0xe877('0x4f')]['id']}})[_0xe877('0x2b')](handleEntityNotFound(_0x1dfc2e,null))['then'](saveUpdates(_0x390448[_0xe877('0x95')],null))['then'](respondWithResult(_0x1dfc2e,null))['catch'](handleError(_0x1dfc2e,null));};exports[_0xe877('0x99')]=function(_0x50c640,_0x137830,_0x52109e){return db['Plugin'][_0xe877('0x55')]({'where':{'id':_0x50c640[_0xe877('0x4f')]['id']}})[_0xe877('0x2b')](function(_0x363067){if(_0x363067){return _0x363067[_0xe877('0x2c')]();}})[_0xe877('0x2b')](function(_0xd223c9){rimraf(path[_0xe877('0x60')](config[_0xe877('0x56')],_0xe877('0x61'),path['dirname'](_0xd223c9[_0xe877('0x7')])),function(){});return _0xd223c9;})['then'](handleEntityNotFound(_0x137830,null))[_0xe877('0x2b')](respondWithStatusCode(_0x137830,null))[_0xe877('0x53')](handleError(_0x137830,null));};exports[_0xe877('0x9a')]=function(_0x467bce,_0x3b8b2d,_0x4e030d){return BPromise['resolve']()[_0xe877('0x2b')](function(){if(!_0x467bce[_0xe877('0x3b')][_0xe877('0x7')]){throw new Error(_0xe877('0x9b'));}if(!_0x467bce[_0xe877('0x3b')][_0xe877('0x9c')]){throw new Error(_0xe877('0x9d'));}var _0x6a4695=_0x467bce['query'][_0xe877('0x9e')]?_0x467bce[_0xe877('0x3b')]['hostname']+':'+_0x467bce['query'][_0xe877('0x9c')]:_0xe877('0x9f')+_0x467bce[_0xe877('0x3b')][_0xe877('0x9c')];var _0x2c6c19=_0x467bce[_0xe877('0x3b')][_0xe877('0x27')]?_0x467bce[_0xe877('0x3b')][_0xe877('0x27')]:!![];var _0x218f1a=_0x467bce[_0xe877('0x3b')][_0xe877('0xa0')]?_0x467bce[_0xe877('0x3b')]['encoding']:null;var _0x526310={'method':_0x467bce[_0xe877('0xa1')],'uri':util[_0xe877('0x57')]('%s%s',_0x6a4695,_0x467bce[_0xe877('0x3b')][_0xe877('0x7')]),'json':_0x2c6c19,'resolveWithFullResponse':!![],'encoding':_0x218f1a,'qs':_0x467bce['query']};if(_0x467bce['headers']){_0x526310[_0xe877('0xa2')]=_0x467bce[_0xe877('0xa2')];if(_0x526310['headers'][_0xe877('0xa3')]){delete _0x526310[_0xe877('0xa2')][_0xe877('0xa3')];}}if(_0x526310[_0xe877('0xa2')][_0xe877('0xa4')]){delete _0x526310[_0xe877('0xa2')][_0xe877('0xa4')];}return rp(_0x526310);})[_0xe877('0x2b')](function(_0x44134d){if(_0x44134d){_0x3b8b2d['set'](_0x44134d['headers']);logger[_0xe877('0x6a')](_0x44134d['body']);if(_['endsWith'](_0x467bce[_0xe877('0x3b')][_0xe877('0x7')],_0xe877('0x54'))&&_0x44134d[_0xe877('0xa5')]==0x1f4){return _0x3b8b2d[_0xe877('0x30')](_0x44134d['statusCode']);}else{return _0x3b8b2d[_0xe877('0x20')](_0x44134d[_0xe877('0xa5')])[_0xe877('0x34')](_0x44134d[_0xe877('0x95')]);}}else{return _0x3b8b2d['sendStatus'](0xc8);}})[_0xe877('0x53')](handleError(_0x3b8b2d,null));};exports[_0xe877('0xa6')]=function(_0x323d12,_0x3d3e67,_0x42fd54){return BPromise['resolve']()[_0xe877('0x2b')](function(){if(!_0x323d12[_0xe877('0x3b')][_0xe877('0x7')]){throw new Error(_0xe877('0x9b'));}if(!_0x323d12[_0xe877('0x3b')][_0xe877('0x9c')]){throw new Error(_0xe877('0x9d'));}var _0x2e3f1a=_0x323d12[_0xe877('0x3b')]['hostname']?_0x323d12[_0xe877('0x3b')][_0xe877('0x9e')]+':'+_0x323d12[_0xe877('0x3b')]['port']:_0xe877('0x9f')+_0x323d12[_0xe877('0x3b')][_0xe877('0x9c')];var _0x13d42b=_0x323d12[_0xe877('0x3b')][_0xe877('0x27')]?_0x323d12[_0xe877('0x3b')][_0xe877('0x27')]:!![];var _0x53675d=_0x323d12[_0xe877('0x3b')]['encoding']?_0x323d12['query'][_0xe877('0xa0')]:null;var _0x28a3b3={'method':_0x323d12[_0xe877('0xa1')],'uri':util['format'](_0xe877('0xa7'),_0x2e3f1a,_0x323d12[_0xe877('0x3b')][_0xe877('0x7')]),'json':_0x13d42b,'resolveWithFullResponse':!![],'encoding':_0x53675d,'body':_0x323d12[_0xe877('0x95')]};if(_0x323d12[_0xe877('0xa2')]){_0x28a3b3[_0xe877('0xa2')]=_0x323d12[_0xe877('0xa2')];if(_0x28a3b3[_0xe877('0xa2')][_0xe877('0xa3')]){delete _0x28a3b3[_0xe877('0xa2')]['content-length'];}}if(_0x28a3b3[_0xe877('0xa2')][_0xe877('0xa4')]){delete _0x28a3b3[_0xe877('0xa2')][_0xe877('0xa4')];}return rp(_0x28a3b3);})['then'](function(_0xce001f){if(_0xce001f){_0x3d3e67[_0xe877('0x25')](_0xce001f['headers']);logger[_0xe877('0x6a')](_0xce001f['body']);return _0x3d3e67[_0xe877('0x20')](_0xce001f[_0xe877('0xa5')])[_0xe877('0x34')](_0xce001f[_0xe877('0x95')]);}else{return _0x3d3e67[_0xe877('0x30')](0xc8);}})['catch'](handleError(_0x3d3e67,null));};
\ No newline at end of file
index b021976..e7514d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadf0=['save','update','remove','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x273c20,_0x2c328f){var _0x31554a=function(_0x1266dc){while(--_0x1266dc){_0x273c20['push'](_0x273c20['shift']());}};_0x31554a(++_0x2c328f);}(_0xadf0,0x12d));var _0x0adf=function(_0x446e90,_0x135ca3){_0x446e90=_0x446e90-0x0;var _0x136091=_0xadf0[_0x446e90];return _0x136091;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x0adf('0x0'))['db'][_0x0adf('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0adf('0x2')](0x0);var events={'afterCreate':_0x0adf('0x3'),'afterUpdate':_0x0adf('0x4'),'afterDestroy':_0x0adf('0x5')};function emitEvent(_0x911855){return function(_0x4b4b16,_0xb48987,_0x567ca2){PluginEvents['emit'](_0x911855+':'+_0x4b4b16['id'],_0x4b4b16);PluginEvents['emit'](_0x911855,_0x4b4b16);_0x567ca2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x0adf('0x6')](e,emitEvent(event));}}module[_0x0adf('0x7')]=PluginEvents;
\ No newline at end of file
+var _0x0619=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','update','remove'];(function(_0x44e477,_0x4146de){var _0x3a4c4a=function(_0x1b749c){while(--_0x1b749c){_0x44e477['push'](_0x44e477['shift']());}};_0x3a4c4a(++_0x4146de);}(_0x0619,0x90));var _0x9061=function(_0x4ce36b,_0x471955){_0x4ce36b=_0x4ce36b-0x0;var _0x2f3503=_0x0619[_0x4ce36b];return _0x2f3503;};'use strict';var EventEmitter=require(_0x9061('0x0'));var Plugin=require(_0x9061('0x1'))['db'][_0x9061('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x9061('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9061('0x4'),'afterDestroy':_0x9061('0x5')};function emitEvent(_0x1f0fe8){return function(_0x1384a7,_0x1bc8ce,_0xa713e1){PluginEvents[_0x9061('0x6')](_0x1f0fe8+':'+_0x1384a7['id'],_0x1384a7);PluginEvents[_0x9061('0x6')](_0x1f0fe8,_0x1384a7);_0xa713e1(null);};}for(var e in events){if(events[_0x9061('0x7')](e)){var event=events[e];Plugin[_0x9061('0x8')](e,emitEvent(event));}}module[_0x9061('0x9')]=PluginEvents;
\ No newline at end of file
index b1305b2..5db7734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x442b=['api','moment','bluebird','request-promise','path','./plugin.attributes','exports','define','Plugin','lodash','../../config/logger'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x442b,0x15e));var _0xb442=function(_0x4ce7ff,_0x54e9f1){_0x4ce7ff=_0x4ce7ff-0x0;var _0x2bd78f=_0x442b[_0x4ce7ff];return _0x2bd78f;};'use strict';var _=require(_0xb442('0x0'));var util=require('util');var logger=require(_0xb442('0x1'))(_0xb442('0x2'));var moment=require(_0xb442('0x3'));var BPromise=require(_0xb442('0x4'));var rp=require(_0xb442('0x5'));var fs=require('fs');var path=require(_0xb442('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb442('0x7'));module[_0xb442('0x8')]=function(_0x249efc,_0xcd0945){return _0x249efc[_0xb442('0x9')](_0xb442('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb0d=['request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','api','moment','bluebird'];(function(_0x2a8043,_0x14b375){var _0x290f17=function(_0x2407e7){while(--_0x2407e7){_0x2a8043['push'](_0x2a8043['shift']());}};_0x290f17(++_0x14b375);}(_0xeb0d,0xd9));var _0xdeb0=function(_0x17ea29,_0x377f97){_0x17ea29=_0x17ea29-0x0;var _0x2cb4ae=_0xeb0d[_0x17ea29];return _0x2cb4ae;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdeb0('0x0'));var moment=require(_0xdeb0('0x1'));var BPromise=require(_0xdeb0('0x2'));var rp=require(_0xdeb0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb0('0x4'));var config=require(_0xdeb0('0x5'));var attributes=require(_0xdeb0('0x6'));module[_0xdeb0('0x7')]=function(_0x1a38c7,_0xc491b2){return _0x1a38c7[_0xdeb0('0x8')]('Plugin',attributes,{'tableName':_0xdeb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54fe71a..daa2176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2134=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreatePlugin','Plugin','create','options','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x2134,0x157));var _0x4213=function(_0x2cc380,_0x5b8db9){_0x2cc380=_0x2cc380-0x0;var _0x38d51d=_0x2134[_0x2cc380];return _0x38d51d;};'use strict';var _=require(_0x4213('0x0'));var util=require(_0x4213('0x1'));var moment=require(_0x4213('0x2'));var BPromise=require(_0x4213('0x3'));var rs=require(_0x4213('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4213('0x5'))['db'];var utils=require(_0x4213('0x6'));var logger=require(_0x4213('0x7'))(_0x4213('0x8'));var config=require(_0x4213('0x9'));var jayson=require(_0x4213('0xa'));var client=jayson[_0x4213('0xb')][_0x4213('0xc')]({'port':0x232a});config[_0x4213('0xd')]=_[_0x4213('0xe')](config[_0x4213('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4213('0xf'))(new Redis(config[_0x4213('0xd')]));require(_0x4213('0x10'))[_0x4213('0x11')](socket);function respondWithRpcPromise(_0x576137,_0xed0711,_0x1c91e5){return new BPromise(function(_0x3e0b66,_0x631c7e){return client[_0x4213('0x12')](_0x576137,_0x1c91e5)[_0x4213('0x13')](function(_0x117c6d){logger['info'](_0x4213('0x14'),_0xed0711,_0x4213('0x15'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0xed0711,_0x4213('0x15'),JSON['stringify'](_0x117c6d));if(_0x117c6d[_0x4213('0x16')]){if(_0x117c6d['error'][_0x4213('0x17')]===0x1f4){logger[_0x4213('0x16')](_0x4213('0x14'),_0xed0711,_0x117c6d['error'][_0x4213('0x18')]);return _0x631c7e(_0x117c6d[_0x4213('0x16')]['message']);}logger[_0x4213('0x16')](_0x4213('0x14'),_0xed0711,_0x117c6d[_0x4213('0x16')][_0x4213('0x18')]);return _0x3e0b66(_0x117c6d[_0x4213('0x16')][_0x4213('0x18')]);}else{logger[_0x4213('0x19')](_0x4213('0x14'),_0xed0711,_0x4213('0x15'));_0x3e0b66(_0x117c6d[_0x4213('0x1a')][_0x4213('0x18')]);}})['catch'](function(_0x24a09b){logger['error'](_0x4213('0x14'),_0xed0711,_0x24a09b);_0x631c7e(_0x24a09b);});});}exports[_0x4213('0x1b')]=function(_0x1e1e3a){var _0xcf834f=this;return new Promise(function(_0x5b0616,_0x14ab33){return db[_0x4213('0x1c')][_0x4213('0x1d')](_0x1e1e3a['body'],{'raw':_0x1e1e3a[_0x4213('0x1e')]?_0x1e1e3a[_0x4213('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x31beca){logger[_0x4213('0x19')](_0x4213('0x1b'),_0x1e1e3a);logger[_0x4213('0x1f')](_0x4213('0x1b'),_0x1e1e3a,JSON['stringify'](_0x31beca));_0x5b0616(_0x31beca);})['catch'](function(_0x705f7a){logger[_0x4213('0x16')]('CreatePlugin',_0x705f7a['message'],_0x1e1e3a);_0x14ab33(_0xcf834f[_0x4213('0x16')](0x1f4,_0x705f7a[_0x4213('0x18')]));});});};
\ No newline at end of file
+var _0xbf57=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','CreatePlugin','Plugin','create','body','options','raw','catch','lodash','bluebird'];(function(_0x4f7cb2,_0x3df316){var _0xc5b36f=function(_0x202ede){while(--_0x202ede){_0x4f7cb2['push'](_0x4f7cb2['shift']());}};_0xc5b36f(++_0x3df316);}(_0xbf57,0x16a));var _0x7bf5=function(_0x3702ba,_0x460951){_0x3702ba=_0x3702ba-0x0;var _0x115695=_0xbf57[_0x3702ba];return _0x115695;};'use strict';var _=require(_0x7bf5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7bf5('0x1'));var rs=require(_0x7bf5('0x2'));var fs=require('fs');var Redis=require(_0x7bf5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bf5('0x4'));var logger=require('../../config/logger')(_0x7bf5('0x5'));var config=require(_0x7bf5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7bf5('0x7')][_0x7bf5('0x8')]({'port':0x232a});config[_0x7bf5('0x9')]=_[_0x7bf5('0xa')](config[_0x7bf5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bf5('0xb'))(new Redis(config[_0x7bf5('0x9')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x2f767d,_0x475903,_0x33dc28){return new BPromise(function(_0x26e0fb,_0x439e2){return client[_0x7bf5('0xc')](_0x2f767d,_0x33dc28)[_0x7bf5('0xd')](function(_0x4cffb2){logger[_0x7bf5('0xe')](_0x7bf5('0xf'),_0x475903,_0x7bf5('0x10'));logger[_0x7bf5('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x475903,_0x7bf5('0x10'),JSON[_0x7bf5('0x12')](_0x4cffb2));if(_0x4cffb2[_0x7bf5('0x13')]){if(_0x4cffb2['error']['code']===0x1f4){logger['error'](_0x7bf5('0xf'),_0x475903,_0x4cffb2[_0x7bf5('0x13')][_0x7bf5('0x14')]);return _0x439e2(_0x4cffb2['error']['message']);}logger['error']('Plugin,\x20%s,\x20%s',_0x475903,_0x4cffb2[_0x7bf5('0x13')][_0x7bf5('0x14')]);return _0x26e0fb(_0x4cffb2[_0x7bf5('0x13')][_0x7bf5('0x14')]);}else{logger[_0x7bf5('0xe')]('Plugin,\x20%s,\x20%s',_0x475903,_0x7bf5('0x10'));_0x26e0fb(_0x4cffb2['result'][_0x7bf5('0x14')]);}})['catch'](function(_0x3355d3){logger[_0x7bf5('0x13')]('Plugin,\x20%s,\x20%s',_0x475903,_0x3355d3);_0x439e2(_0x3355d3);});});}exports[_0x7bf5('0x15')]=function(_0x18015a){var _0xdaa594=this;return new Promise(function(_0x27175b,_0xa6178){return db[_0x7bf5('0x16')][_0x7bf5('0x17')](_0x18015a[_0x7bf5('0x18')],{'raw':_0x18015a[_0x7bf5('0x19')]?_0x18015a[_0x7bf5('0x19')][_0x7bf5('0x1a')]===undefined?!![]:![]:!![]})[_0x7bf5('0xd')](function(_0x26a509){logger['info']('CreatePlugin',_0x18015a);logger['debug'](_0x7bf5('0x15'),_0x18015a,JSON[_0x7bf5('0x12')](_0x26a509));_0x27175b(_0x26a509);})[_0x7bf5('0x1b')](function(_0x33d582){logger[_0x7bf5('0x13')](_0x7bf5('0x15'),_0x33d582[_0x7bf5('0x14')],_0x18015a);_0xa6178(_0xdaa594[_0x7bf5('0x13')](0x1f4,_0x33d582[_0x7bf5('0x14')]));});});};
\ No newline at end of file
index d050bc0..fe95187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc884=['save','update','emit','register','length','plugin:','./plugin.events'];(function(_0x8e8f89,_0x4254f3){var _0x151938=function(_0x21c367){while(--_0x21c367){_0x8e8f89['push'](_0x8e8f89['shift']());}};_0x151938(++_0x4254f3);}(_0xc884,0xf4));var _0x4c88=function(_0x5a3557,_0x4a5714){_0x5a3557=_0x5a3557-0x0;var _0x17bec2=_0xc884[_0x5a3557];return _0x17bec2;};'use strict';var PluginEvents=require(_0x4c88('0x0'));var events=[_0x4c88('0x1'),'remove',_0x4c88('0x2')];function createListener(_0x287cc9,_0x2fed7f){return function(_0xc537eb){_0x2fed7f[_0x4c88('0x3')](_0x287cc9,_0xc537eb);};}function removeListener(_0x2a32bb,_0x4c2830){return function(){PluginEvents['removeListener'](_0x2a32bb,_0x4c2830);};}exports[_0x4c88('0x4')]=function(_0x27dc8a){for(var _0x267a37=0x0,_0x51f499=events[_0x4c88('0x5')];_0x267a37<_0x51f499;_0x267a37++){var _0x8e6696=events[_0x267a37];var _0x282ad8=createListener(_0x4c88('0x6')+_0x8e6696,_0x27dc8a);PluginEvents['on'](_0x8e6696,_0x282ad8);}};
\ No newline at end of file
+var _0x3375=['save','remove','emit','removeListener','register','length','plugin:','./plugin.events'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3375,0x97));var _0x5337=function(_0x59fa48,_0x56361d){_0x59fa48=_0x59fa48-0x0;var _0x4c9733=_0x3375[_0x59fa48];return _0x4c9733;};'use strict';var PluginEvents=require(_0x5337('0x0'));var events=[_0x5337('0x1'),_0x5337('0x2'),'update'];function createListener(_0x2e8225,_0x2c108d){return function(_0x2c4596){_0x2c108d[_0x5337('0x3')](_0x2e8225,_0x2c4596);};}function removeListener(_0x1da2a8,_0x5e1270){return function(){PluginEvents[_0x5337('0x4')](_0x1da2a8,_0x5e1270);};}exports[_0x5337('0x5')]=function(_0xb8d7c5){for(var _0x11c624=0x0,_0x47631d=events[_0x5337('0x6')];_0x11c624<_0x47631d;_0x11c624++){var _0x5e0b61=events[_0x11c624];var _0x4a545a=createListener(_0x5337('0x7')+_0x5e0b61,_0xb8d7c5);PluginEvents['on'](_0x5e0b61,_0x4a545a);}};
\ No newline at end of file
index 88127fb..bb6abc2 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(_0x4c4845,_0x275ffe){var _0x5a14b4=function(_0x4e6d60){while(--_0x4e6d60){_0x4c4845['push'](_0x4c4845['shift']());}};_0x5a14b4(++_0x275ffe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x56ab5a,_0x3a320d){var _0x1744fd=function(_0x239aeb){while(--_0x239aeb){_0x56ab5a['push'](_0x56ab5a['shift']());}};_0x1744fd(++_0x3a320d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 e87e939..6f0643c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','params','create','body','script','../../files/plugins','chdir'];(function(_0x25b738,_0x5c3de6){var _0x2c1051=function(_0x3f2548){while(--_0x3f2548){_0x25b738['push'](_0x25b738['shift']());}};_0x2c1051(++_0x5c3de6);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x34ea('0x0'));var pm2=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var path=require('path');var exec=require(_0x34ea('0x4'))['exec'];var BPromise=require(_0x34ea('0x5'));function handleEntityNotFound(_0x571f1b,_0x5e5a84){return function(_0x2ce955){if(!_0x2ce955){_0x571f1b[_0x34ea('0x6')](0x194);;}return _0x2ce955;};}function respondWithResult(_0x962596,_0x123d48){_0x123d48=_0x123d48||0xc8;return function(_0x40434e){if(_0x40434e){return _0x962596[_0x34ea('0x7')](_0x123d48)[_0x34ea('0x8')](_0x40434e);}return null;};}function handleError(_0x5bec7c,_0x341727){_0x341727=_0x341727||0x1f4;return function(_0x6e9ccc){logger[_0x34ea('0x9')](_0x6e9ccc['stack']);if(_0x6e9ccc[_0x34ea('0xa')]){delete _0x6e9ccc[_0x34ea('0xa')];}_0x5bec7c['status'](_0x341727)['send'](_0x6e9ccc);};}function execChildProcess(){return new BPromise(function(_0x5bd8b6,_0x346287){exec(_0x34ea('0xb'),function(_0x58bb0d,_0x11229e,_0x29a5c8){logger[_0x34ea('0xc')](_0x11229e);logger[_0x34ea('0xc')](_0x29a5c8);if(_0x58bb0d){logger[_0x34ea('0x9')](_0x58bb0d);return _0x346287(_0x58bb0d);}return _0x5bd8b6(_0x11229e);});});}exports[_0x34ea('0xd')]=function(_0x37e1b4,_0x36af43){return pm2[_0x34ea('0xe')]()[_0x34ea('0xf')](function(_0x36a4c6){if(_0x36a4c6){var _0x5ef9ae=_[_0x34ea('0x10')](_0x36a4c6,function(_0x89e3f2){return _0x89e3f2[_0x34ea('0xa')]===_0x34ea('0x11')||_0x89e3f2[_0x34ea('0xa')]==='motion2';});return{'rows':_0x5ef9ae,'count':_0x5ef9ae[_0x34ea('0x12')]};}return null;})[_0x34ea('0xf')](respondWithResult(_0x36af43,null))[_0x34ea('0x13')](handleError(_0x36af43,null));};exports[_0x34ea('0x14')]=function(_0x5f420f,_0x2680e0){return pm2[_0x34ea('0x15')](_0x5f420f[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x2680e0,null))[_0x34ea('0xf')](handleEntityNotFound(_0x2680e0,null))[_0x34ea('0x13')](handleError(_0x2680e0,null));};exports[_0x34ea('0x17')]=function(_0x127308,_0x52af16){if(_0x127308[_0x34ea('0x18')][_0x34ea('0xa')]&&_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]){var _0x4fc1a2=path['join'](__dirname,_0x34ea('0x1a'),_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]);var _0x51022f=process['cwd']();process[_0x34ea('0x1b')](path[_0x34ea('0x1c')](_0x4fc1a2));return execChildProcess()[_0x34ea('0xf')](function(_0x30c4b0){process[_0x34ea('0x1b')](_0x51022f);return pm2[_0x34ea('0x1d')]({'name':_0x127308['body'][_0x34ea('0xa')],'script':_0x4fc1a2});})[_0x34ea('0xf')](function(_0x3c0983){pm2[_0x34ea('0x1e')]();return _0x3c0983[0x0];})['then'](respondWithResult(_0x52af16,0xc9))['catch'](handleError(_0x52af16,null));}else{return _0x52af16['status'](0x1f4)[_0x34ea('0x1f')]({'message':_0x34ea('0x20')});}};exports[_0x34ea('0x21')]=function(_0x4204d7,_0x5b8b3e){if(_0x4204d7[_0x34ea('0x18')]['id']){delete _0x4204d7[_0x34ea('0x18')]['id'];}var _0x27c6f7={'online':'restart','stopped':'stop'};if(_0x27c6f7['hasOwnProperty'](_0x4204d7['body'][_0x34ea('0x7')])){return pm2[_0x27c6f7[_0x4204d7[_0x34ea('0x18')][_0x34ea('0x7')]]](_0x4204d7[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x5b8b3e,0xc8))[_0x34ea('0x13')](handleError(_0x5b8b3e,null));}else{return _0x5b8b3e['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x34ea('0x22')]=function(_0x14e018,_0x3cb968){if(_0x14e018['body']['id']){delete _0x14e018[_0x34ea('0x18')]['id'];}if(_0x14e018[_0x34ea('0x16')]['id']){return pm2['delete'](_0x14e018[_0x34ea('0x16')]['id'])['then'](function(_0x1392b6){pm2[_0x34ea('0x1e')]();return _0x1392b6[0x0];})[_0x34ea('0xf')](respondWithResult(_0x3cb968,null))['catch'](handleError(_0x3cb968,null));}else{return _0x3cb968['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0x3c81=['../../config/pm2','api','path','sendStatus','status','error','stack','name','send','npm\x20install','info','index','then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3c81,0x102));var _0x13c8=function(_0x41b90e,_0x5efe27){_0x41b90e=_0x41b90e-0x0;var _0x1f0ad4=_0x3c81[_0x41b90e];return _0x1f0ad4;};'use strict';var _=require(_0x13c8('0x0'));var pm2=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var path=require(_0x13c8('0x3'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x548599,_0x101d4f){return function(_0x3ec886){if(!_0x3ec886){_0x548599[_0x13c8('0x4')](0x194);;}return _0x3ec886;};}function respondWithResult(_0x1c16f1,_0x2a4d66){_0x2a4d66=_0x2a4d66||0xc8;return function(_0x3f0bd2){if(_0x3f0bd2){return _0x1c16f1[_0x13c8('0x5')](_0x2a4d66)['json'](_0x3f0bd2);}return null;};}function handleError(_0x17c228,_0x4905c3){_0x4905c3=_0x4905c3||0x1f4;return function(_0x380aed){logger[_0x13c8('0x6')](_0x380aed[_0x13c8('0x7')]);if(_0x380aed[_0x13c8('0x8')]){delete _0x380aed[_0x13c8('0x8')];}_0x17c228[_0x13c8('0x5')](_0x4905c3)[_0x13c8('0x9')](_0x380aed);};}function execChildProcess(){return new BPromise(function(_0x2ce95a,_0x26e7d9){exec(_0x13c8('0xa'),function(_0x3ca0a6,_0x2468b3,_0x28417e){logger[_0x13c8('0xb')](_0x2468b3);logger['info'](_0x28417e);if(_0x3ca0a6){logger[_0x13c8('0x6')](_0x3ca0a6);return _0x26e7d9(_0x3ca0a6);}return _0x2ce95a(_0x2468b3);});});}exports[_0x13c8('0xc')]=function(_0x2304b5,_0x1f9b6f){return pm2['list']()[_0x13c8('0xd')](function(_0x515681){if(_0x515681){var _0x4d7a88=_['reject'](_0x515681,function(_0x126359){return _0x126359['name']===_0x13c8('0xe')||_0x126359[_0x13c8('0x8')]===_0x13c8('0xf');});return{'rows':_0x4d7a88,'count':_0x4d7a88[_0x13c8('0x10')]};}return null;})['then'](respondWithResult(_0x1f9b6f,null))[_0x13c8('0x11')](handleError(_0x1f9b6f,null));};exports[_0x13c8('0x12')]=function(_0x31ae02,_0x3bc5a9){return pm2[_0x13c8('0x13')](_0x31ae02[_0x13c8('0x14')]['id'])[_0x13c8('0xd')](respondWithResult(_0x3bc5a9,null))[_0x13c8('0xd')](handleEntityNotFound(_0x3bc5a9,null))[_0x13c8('0x11')](handleError(_0x3bc5a9,null));};exports[_0x13c8('0x15')]=function(_0xe9386a,_0x5ac776){if(_0xe9386a[_0x13c8('0x16')][_0x13c8('0x8')]&&_0xe9386a[_0x13c8('0x16')][_0x13c8('0x17')]){var _0x513085=path[_0x13c8('0x18')](__dirname,_0x13c8('0x19'),_0xe9386a[_0x13c8('0x16')][_0x13c8('0x17')]);var _0x436d5d=process[_0x13c8('0x1a')]();process['chdir'](path[_0x13c8('0x1b')](_0x513085));return execChildProcess()[_0x13c8('0xd')](function(_0x315d6c){process[_0x13c8('0x1c')](_0x436d5d);return pm2['start']({'name':_0xe9386a[_0x13c8('0x16')][_0x13c8('0x8')],'script':_0x513085});})['then'](function(_0x49b552){pm2[_0x13c8('0x1d')]();return _0x49b552[0x0];})[_0x13c8('0xd')](respondWithResult(_0x5ac776,0xc9))['catch'](handleError(_0x5ac776,null));}else{return _0x5ac776['status'](0x1f4)[_0x13c8('0x9')]({'message':_0x13c8('0x1e')});}};exports['update']=function(_0x4df077,_0x196983){if(_0x4df077['body']['id']){delete _0x4df077['body']['id'];}var _0x1c7dc4={'online':_0x13c8('0x1f'),'stopped':_0x13c8('0x20')};if(_0x1c7dc4['hasOwnProperty'](_0x4df077['body'][_0x13c8('0x5')])){return pm2[_0x1c7dc4[_0x4df077[_0x13c8('0x16')][_0x13c8('0x5')]]](_0x4df077[_0x13c8('0x14')]['id'])[_0x13c8('0xd')](respondWithResult(_0x196983,0xc8))[_0x13c8('0x11')](handleError(_0x196983,null));}else{return _0x196983[_0x13c8('0x5')](0x1f4)['send']({'message':_0x13c8('0x21')});}};exports[_0x13c8('0x22')]=function(_0x5a5911,_0x5c85e4){if(_0x5a5911[_0x13c8('0x16')]['id']){delete _0x5a5911[_0x13c8('0x16')]['id'];}if(_0x5a5911['params']['id']){return pm2[_0x13c8('0x23')](_0x5a5911[_0x13c8('0x14')]['id'])['then'](function(_0x21224a){pm2[_0x13c8('0x1d')]();return _0x21224a[0x0];})[_0x13c8('0xd')](respondWithResult(_0x5c85e4,null))[_0x13c8('0x11')](handleError(_0x5c85e4,null));}else{return _0x5c85e4[_0x13c8('0x5')](0x1f4)[_0x13c8('0x9')]({'message':_0x13c8('0x24')});}};
\ No newline at end of file
index d0c0253..47bf5f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf35e=['/agents','getAgents','/queues','isAuthenticated','getQueues','exports','express','../../components/auth/service','./realtime.controller','get'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xf35e,0x74));var _0xef35=function(_0x2c07dd,_0x2a3938){_0x2c07dd=_0x2c07dd-0x0;var _0x334417=_0xf35e[_0x2c07dd];return _0x334417;};'use strict';var express=require(_0xef35('0x0'));var router=express['Router']();var auth=require(_0xef35('0x1'));var controller=require(_0xef35('0x2'));router[_0xef35('0x3')](_0xef35('0x4'),auth['isAuthenticated'](),controller[_0xef35('0x5')]);router[_0xef35('0x3')](_0xef35('0x6'),auth[_0xef35('0x7')](),controller[_0xef35('0x8')]);module[_0xef35('0x9')]=router;
\ No newline at end of file
+var _0x74df=['/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','/agents','isAuthenticated','get'];(function(_0x574e21,_0x373299){var _0x587c0f=function(_0xc7a7ee){while(--_0xc7a7ee){_0x574e21['push'](_0x574e21['shift']());}};_0x587c0f(++_0x373299);}(_0x74df,0x111));var _0xf74d=function(_0x406324,_0x39a087){_0x406324=_0x406324-0x0;var _0x4eedd4=_0x74df[_0x406324];return _0x4eedd4;};'use strict';var express=require(_0xf74d('0x0'));var router=express[_0xf74d('0x1')]();var auth=require(_0xf74d('0x2'));var controller=require(_0xf74d('0x3'));router['get'](_0xf74d('0x4'),auth[_0xf74d('0x5')](),controller['getAgents']);router[_0xf74d('0x6')](_0xf74d('0x7'),auth['isAuthenticated'](),controller[_0xf74d('0x8')]);module[_0xf74d('0x9')]=router;
\ No newline at end of file
index 2de1e8e..47eb8b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['APIBadRequestError','handleError','offset','limit','undefined','count','status','set','Content-Range','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','resolve','then','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','agent','online','getOptions','push','sequelize','literal','forEach','*pause','Pause','where','user','role','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','User','find','filterAgentAttributes','merge','globalStatus','getAgentStatus','rows','catch','getQueues','format','startCase','Queue','key','name','voice','type','dialActive','outbound','QueueCampaigns','findAndCountAll','getRealtimeQueues','initializeQueues','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x7fbe[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require('lodash');var util=require('util');var rta=require(_0xe7fb('0x0'));var rtq=require(_0xe7fb('0x1'));var qs=require(_0xe7fb('0x2'));var utils=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var APIBadRequestError=require(_0xe7fb('0x5'))[_0xe7fb('0x6')];var APIHandleError=require(_0xe7fb('0x5'))[_0xe7fb('0x7')];function respondWithFilteredResult(_0x5dbf04,_0x290172){return function(_0x12d1b0){if(_0x12d1b0){var _0x24cd67=typeof _0x290172[_0xe7fb('0x8')]==='undefined'&&typeof _0x290172[_0xe7fb('0x9')]===_0xe7fb('0xa');var _0x1d0741=_0x12d1b0[_0xe7fb('0xb')];var _0x4ba197=_0x24cd67?0x0:_0x290172['offset'];var _0x29edb2=_0x24cd67?_0x12d1b0[_0xe7fb('0xb')]:_0x290172[_0xe7fb('0x8')]+_0x290172[_0xe7fb('0x9')];var _0x2a2223;if(_0x29edb2>=_0x1d0741){_0x29edb2=_0x1d0741;_0x2a2223=0xc8;}else{_0x2a2223=0xce;}_0x5dbf04[_0xe7fb('0xc')](_0x2a2223);return _0x5dbf04[_0xe7fb('0xd')](_0xe7fb('0xe'),_0x4ba197+'-'+_0x29edb2+'/'+_0x1d0741)[_0xe7fb('0xf')](_0x12d1b0);}return null;};}exports[_0xe7fb('0x10')]=function(_0x2437d4,_0x188e1d){var _0xdf9760={'count':0x0,'rows':[]};var _0x45fe75={};var _0x7fe4d3;var _0x598729=utils[_0xe7fb('0x11')]();var _0x2225e5;var _0x5573ab;var _0x30015a=_0x2437d4[_0xe7fb('0x12')]['globalQueueFilter'];var _0xa76acf=_0x2437d4['query'][_0xe7fb('0x13')];var _0x18d23c=_0x2437d4[_0xe7fb('0x12')][_0xe7fb('0x14')];var _0x562262=_0xa76acf===_0xe7fb('0x15')||_0xa76acf==='*pause'?!![]:![];var _0x293a47=[];var _0x546463;var _0x1e77fd;Promise[_0xe7fb('0x16')]()[_0xe7fb('0x17')](function(){if(_0x2437d4[_0xe7fb('0x12')]['channel']){if(!utils[_0xe7fb('0x18')](_0x2437d4['query'][_0xe7fb('0x19')])){throw new APIBadRequestError(util['format'](_0xe7fb('0x1a'),_0x2437d4['query'][_0xe7fb('0x19')]));}_0x7fe4d3=_0x2437d4[_0xe7fb('0x12')]['channel'][_0xe7fb('0x1b')]();}if(!_0x2437d4[_0xe7fb('0x12')][_0xe7fb('0x1c')]||!_0x2437d4['query'][_0xe7fb('0x1c')][_0xe7fb('0x1d')]('globalStatus')){_0x2437d4['query']['sort']=rta[_0xe7fb('0x1e')](_0x2437d4['query']['sort']);return;}var _0x4026b1=rta[_0xe7fb('0x1f')](_0x2437d4[_0xe7fb('0x12')]['sort']);_0x2437d4[_0xe7fb('0x12')][_0xe7fb('0x1c')]=_0x4026b1[_0xe7fb('0x20')][_0xe7fb('0x21')](',');_0x546463=_0x4026b1[_0xe7fb('0x22')];})[_0xe7fb('0x17')](function(){if(!_0x30015a){return[];}return rta[_0xe7fb('0x23')](_0x30015a,_0x7fe4d3);})['then'](function(_0x5df9f2){_0x293a47=_0x5df9f2;return rta[_0xe7fb('0x24')]();})[_0xe7fb('0x17')](function(_0xead63){_0x5573ab=_0xead63['rows'];if((!_0xa76acf||_0x562262)&&!_0x546463){return _0x293a47;}if(_0x546463&&!_0xa76acf){return rta[_0xe7fb('0x25')](_0x5573ab,_0x293a47,_0x546463);}else{return rta[_0xe7fb('0x26')](_0x5573ab,_0x293a47,_0xa76acf);}})[_0xe7fb('0x17')](function(_0x5f265f){_0x293a47=_0x5f265f;var _0x219554=![];if(_0x293a47[_0xe7fb('0x27')]===0x0){if(_0x30015a||_0xa76acf){_0x219554=!![];}if(_0x562262){_0x219554=![];}}if(_0x219554){return _0xdf9760;}var _0x1d57a7=_[_0xe7fb('0x28')](db['User'][_0xe7fb('0x29')],function(_0x1742f3){return{'name':_0x1742f3[_0xe7fb('0x2a')],'type':_0x1742f3['type']['key']};});_0x2437d4[_0xe7fb('0x12')]['role']=_0xe7fb('0x2b');_0x2437d4[_0xe7fb('0x12')][_0xe7fb('0x2c')]=!![];_0x45fe75=qs[_0xe7fb('0x2d')](_0x1d57a7,_0x2437d4);_0x45fe75['raw']=!![];var _0x1af472=[];if(_0x293a47[_0xe7fb('0x27')]>0x0){_0x1af472[_0xe7fb('0x2e')]({'id':{'$in':_0x293a47}});if(_0x546463&&!_0xa76acf){_0x1e77fd=[db[_0xe7fb('0x2f')][_0xe7fb('0x30')]('FIELD(id,'+_0x293a47+')')];_0x45fe75[_0xe7fb('0x22')]=_0x1e77fd;}}if(_0x562262){_0x598729[_0xe7fb('0x31')](function(_0x209eaa){var _0x32a7cd=!![];if(_0xa76acf===_0xe7fb('0x32')&&_0x7fe4d3!==_0x209eaa){_0x32a7cd=![];}_0x1af472[_0xe7fb('0x2e')]({[_0x209eaa+_0xe7fb('0x33')]:_0x32a7cd});});if(_0x18d23c){_0x1af472[_0xe7fb('0x2e')]({'pauseType':_0x18d23c});}}else if(_0xa76acf){_0x598729[_0xe7fb('0x31')](function(_0x59f9df){_0x1af472[_0xe7fb('0x2e')]({[_0x59f9df+_0xe7fb('0x33')]:![]});});}_0x45fe75[_0xe7fb('0x34')]=_['merge'](_0x45fe75[_0xe7fb('0x34')],{'$and':_0x1af472});if(_0x2437d4[_0xe7fb('0x35')][_0xe7fb('0x36')]===_0xe7fb('0x35')){var _0x402ca3={'params':{'id':_0x2437d4[_0xe7fb('0x35')][_0xe7fb('0x37')]},'query':{'section':_0xe7fb('0x38'),'role':_0xe7fb('0x2b'),'online':!![],'raw':!![],'ids':_0x293a47,'customSorting':_0x1e77fd}};if(_0x562262){_0x402ca3[_0xe7fb('0x12')][_0xe7fb('0x39')]=_0x1af472;}_0x402ca3[_0xe7fb('0x12')]=Object[_0xe7fb('0x3a')](_0x402ca3[_0xe7fb('0x12')],_0x2437d4[_0xe7fb('0x12')]);delete _0x402ca3[_0xe7fb('0x12')]['id'];return db[_0xe7fb('0x3b')][_0xe7fb('0x3c')](_0x402ca3);}return db[_0xe7fb('0x3d')]['findAndCountAll'](_0x45fe75);})[_0xe7fb('0x17')](function(_0x23f9f9){_0xdf9760[_0xe7fb('0xb')]=_0x23f9f9[_0xe7fb('0xb')];_0x2225e5=_0x23f9f9['rows'];return _0x2225e5[_0xe7fb('0x28')](function(_0x186418){var _0xd472d=_[_0xe7fb('0x3e')](_0x5573ab,['id',_0x186418['id']]);if(_0xd472d){var _0x49fe9d=rta[_0xe7fb('0x3f')](_0xd472d);_[_0xe7fb('0x40')](_0x186418,_0x49fe9d);}_0x186418[_0xe7fb('0x41')]=rta[_0xe7fb('0x42')](_0x186418);if(_0x186418[_0xe7fb('0x41')][_0xe7fb('0x1d')]('pause')){_0x598729[_0xe7fb('0x31')](function(_0x35139f){if(_0x186418[_0x35139f+_0xe7fb('0x33')]){_0x186418[_0x35139f+'Status']=_0xe7fb('0x15');}});}return _0x186418;});})[_0xe7fb('0x17')](function(_0x5d42ac){if(!_0x546463||_0x1e77fd){return _0x5d42ac;}return rta['sortAgentsByStatus'](_0x5d42ac,_0x546463);})['then'](function(_0x5ed3d4){var _0x5e0153=null;if(_0x2437d4[_0xe7fb('0x12')][_0xe7fb('0x20')]){var _0xed62e9=_0x2437d4['query'][_0xe7fb('0x20')]['split'](',');_0x5e0153=_0x5ed3d4[_0xe7fb('0x28')](function(_0x32cfa4){return _['pick'](_0x32cfa4,_0xed62e9);});}_0xdf9760[_0xe7fb('0x43')]=_0x5e0153||_0x5ed3d4;return _0xdf9760;})[_0xe7fb('0x17')](respondWithFilteredResult(_0x188e1d,_0x45fe75))[_0xe7fb('0x44')](APIHandleError(_0x188e1d));};exports[_0xe7fb('0x45')]=function(_0x54dbd8,_0x29fcd3){var _0x694ee9={'count':0x0,'rows':[]};var _0x1b8a34={};var _0x56a84f;var _0x27760f;var _0x6eb1ab;Promise[_0xe7fb('0x16')]()[_0xe7fb('0x17')](function(){if(_0x54dbd8[_0xe7fb('0x12')]['channel']){if(!utils[_0xe7fb('0x18')](_0x54dbd8['query'][_0xe7fb('0x19')])){throw new APIBadRequestError(util[_0xe7fb('0x46')](_0xe7fb('0x1a'),_0x54dbd8[_0xe7fb('0x12')][_0xe7fb('0x19')]));}_0x56a84f=_0x54dbd8['query'][_0xe7fb('0x19')]['toLowerCase']();}var _0x511759=_[_0xe7fb('0x47')](_0x56a84f)+_0xe7fb('0x48');var _0x16327f=_['map'](db[_0x511759][_0xe7fb('0x29')],function(_0x4cefe7){return{'name':_0x4cefe7['fieldName'],'type':_0x4cefe7['type'][_0xe7fb('0x49')]};});if(!_0x54dbd8[_0xe7fb('0x12')][_0xe7fb('0x20')]){var _0x3dd6bf=['id',_0xe7fb('0x4a')];if(_0x56a84f===_0xe7fb('0x4b')){_0x3dd6bf[_0xe7fb('0x2e')](_0xe7fb('0x4c'));if(_0x54dbd8['query'][_0xe7fb('0x4c')]==='outbound'){_0x3dd6bf[_0xe7fb('0x2e')]([_0xe7fb('0x4d'),'dialMethod']);}}_0x54dbd8[_0xe7fb('0x12')]['fields']=_0x3dd6bf[_0xe7fb('0x21')](',');}_0x1b8a34=qs['getOptions'](_0x16327f,_0x54dbd8);if(_0x54dbd8[_0xe7fb('0x35')]['role']===_0xe7fb('0x35')){var _0x59158c={'params':{'id':_0x54dbd8[_0xe7fb('0x35')][_0xe7fb('0x37')]},'query':{'section':_0x56a84f===_0xe7fb('0x4b')&&_0x54dbd8[_0xe7fb('0x12')][_0xe7fb('0x4c')]===_0xe7fb('0x4e')?_0xe7fb('0x4f'):_['startCase'](_0x56a84f)+'Queues','type':_0x54dbd8[_0xe7fb('0x12')]['type'],'nolimit':!![],'sort':'name','filter':_0x54dbd8['query']['filter']}};_0x59158c['query']=Object[_0xe7fb('0x3a')](_0x59158c[_0xe7fb('0x12')],_0x54dbd8[_0xe7fb('0x12')]);delete _0x59158c[_0xe7fb('0x12')]['id'];return db['UserProfile'][_0xe7fb('0x3c')](_0x59158c);}return db[_0x511759][_0xe7fb('0x50')](_0x1b8a34);})[_0xe7fb('0x17')](function(_0x4a9372){_0x694ee9['count']=_0x4a9372[_0xe7fb('0xb')];_0x27760f=_0x4a9372[_0xe7fb('0x43')];return rtq[_0xe7fb('0x51')](_0x54dbd8,_0x56a84f);})['then'](function(_0x27f860){_0x6eb1ab=_0x27f860[_0xe7fb('0x43')];return rtq[_0xe7fb('0x52')](_0x27760f,_0x6eb1ab,_0x56a84f,_0x54dbd8[_0xe7fb('0x12')]['type']);})['then'](function(_0x2f620d){_0x694ee9[_0xe7fb('0x43')]=_0x2f620d;return _0x694ee9;})[_0xe7fb('0x17')](respondWithFilteredResult(_0x29fcd3,_0x1b8a34))[_0xe7fb('0x44')](APIHandleError(_0x29fcd3));};
\ No newline at end of file
+var _0x6737=['format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','getAgentIdsByQueues','getRealtimeAgents','getAgentIdsByStatus','length','map','fieldName','type','key','role','online','getOptions','raw','push','sequelize','literal','FIELD(id,','order','forEach','Pause','merge','where','user','Agents','agent','extraQueryConditions','assign','UserProfile','User','findAndCountAll','rows','filterAgentAttributes','getAgentStatus','pause','Status','sortAgentsByStatus','split','getQueues','startCase','Queue','name','voice','outbound','dialMethod','join','userProfileId','QueueCampaigns','Queues','getResources','getRealtimeQueues','initializeQueues','catch','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','undefined','count','offset','status','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','isValidChannel'];(function(_0x49c7bd,_0x1432db){var _0x1ba37d=function(_0x30f525){while(--_0x30f525){_0x49c7bd['push'](_0x49c7bd['shift']());}};_0x1ba37d(++_0x1432db);}(_0x6737,0xe2));var _0x7673=function(_0x5c8283,_0x132ea7){_0x5c8283=_0x5c8283-0x0;var _0x4503c4=_0x6737[_0x5c8283];return _0x4503c4;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var rta=require(_0x7673('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0x7673('0x2'));var utils=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var APIBadRequestError=require(_0x7673('0x5'))['APIBadRequestError'];var APIHandleError=require(_0x7673('0x5'))[_0x7673('0x6')];function respondWithFilteredResult(_0x543b61,_0x2f5edc){return function(_0x15230f){if(_0x15230f){var _0x5af802=typeof _0x2f5edc['offset']==='undefined'&&typeof _0x2f5edc['limit']===_0x7673('0x7');var _0x5bede8=_0x15230f[_0x7673('0x8')];var _0x1fb769=_0x5af802?0x0:_0x2f5edc['offset'];var _0x29fdbc=_0x5af802?_0x15230f[_0x7673('0x8')]:_0x2f5edc[_0x7673('0x9')]+_0x2f5edc['limit'];var _0x49fcb2;if(_0x29fdbc>=_0x5bede8){_0x29fdbc=_0x5bede8;_0x49fcb2=0xc8;}else{_0x49fcb2=0xce;}_0x543b61[_0x7673('0xa')](_0x49fcb2);return _0x543b61['set'](_0x7673('0xb'),_0x1fb769+'-'+_0x29fdbc+'/'+_0x5bede8)[_0x7673('0xc')](_0x15230f);}return null;};}exports[_0x7673('0xd')]=function(_0x451c87,_0x41d6bd){var _0x119e42={'count':0x0,'rows':[]};var _0x1c57a5={};var _0x457ffe;var _0x1da115=utils[_0x7673('0xe')]();var _0x5c8626;var _0x26f0c4;var _0x4738bd=_0x451c87[_0x7673('0xf')][_0x7673('0x10')];var _0x224cea=_0x451c87[_0x7673('0xf')][_0x7673('0x11')];var _0x4a8ea0=_0x451c87['query'][_0x7673('0x12')];var _0x3b0e20=_0x224cea==='pause'||_0x224cea===_0x7673('0x13')?!![]:![];var _0x17699a=[];var _0x58a821;var _0x33ff7d;Promise[_0x7673('0x14')]()[_0x7673('0x15')](function(){if(_0x451c87['query']['channel']){if(!utils[_0x7673('0x16')](_0x451c87[_0x7673('0xf')]['channel'])){throw new APIBadRequestError(util[_0x7673('0x17')](_0x7673('0x18'),_0x451c87[_0x7673('0xf')][_0x7673('0x19')]));}_0x457ffe=_0x451c87[_0x7673('0xf')][_0x7673('0x19')]['toLowerCase']();}if(!_0x451c87['query'][_0x7673('0x1a')]||!_0x451c87[_0x7673('0xf')][_0x7673('0x1a')][_0x7673('0x1b')](_0x7673('0x1c'))){_0x451c87['query'][_0x7673('0x1a')]=rta[_0x7673('0x1d')](_0x451c87[_0x7673('0xf')][_0x7673('0x1a')]);return;}var _0x132dc6=rta[_0x7673('0x1e')](_0x451c87['query'][_0x7673('0x1a')]);_0x451c87[_0x7673('0xf')][_0x7673('0x1a')]=_0x132dc6[_0x7673('0x1f')]['join'](',');_0x58a821=_0x132dc6['order'];})[_0x7673('0x15')](function(){if(!_0x4738bd){return[];}return rta[_0x7673('0x20')](_0x4738bd,_0x457ffe);})[_0x7673('0x15')](function(_0x9d9eab){_0x17699a=_0x9d9eab;return rta[_0x7673('0x21')]();})[_0x7673('0x15')](function(_0x442f42){_0x26f0c4=_0x442f42['rows'];if((!_0x224cea||_0x3b0e20)&&!_0x58a821){return _0x17699a;}if(_0x58a821&&!_0x224cea){return rta['getSortedAgentsIdsByStatus'](_0x26f0c4,_0x17699a,_0x58a821);}else{return rta[_0x7673('0x22')](_0x26f0c4,_0x17699a,_0x224cea);}})[_0x7673('0x15')](function(_0x1dd436){_0x17699a=_0x1dd436;var _0x335743=![];if(_0x17699a[_0x7673('0x23')]===0x0){if(_0x4738bd||_0x224cea){_0x335743=!![];}if(_0x3b0e20){_0x335743=![];}}if(_0x335743){return _0x119e42;}var _0x3aaf6b=_[_0x7673('0x24')](db['User']['rawAttributes'],function(_0xe7e528){return{'name':_0xe7e528[_0x7673('0x25')],'type':_0xe7e528[_0x7673('0x26')][_0x7673('0x27')]};});_0x451c87['query'][_0x7673('0x28')]='agent';_0x451c87[_0x7673('0xf')][_0x7673('0x29')]=!![];_0x1c57a5=qs[_0x7673('0x2a')](_0x3aaf6b,_0x451c87);_0x1c57a5[_0x7673('0x2b')]=!![];var _0x2be805=[];if(_0x17699a[_0x7673('0x23')]>0x0){_0x2be805[_0x7673('0x2c')]({'id':{'$in':_0x17699a}});if(_0x58a821&&!_0x224cea){_0x33ff7d=[db[_0x7673('0x2d')][_0x7673('0x2e')](_0x7673('0x2f')+_0x17699a+')')];_0x1c57a5[_0x7673('0x30')]=_0x33ff7d;}}if(_0x3b0e20){_0x1da115[_0x7673('0x31')](function(_0x26cccd){var _0x485b39=!![];if(_0x224cea===_0x7673('0x13')&&_0x457ffe!==_0x26cccd){_0x485b39=![];}_0x2be805[_0x7673('0x2c')]({[_0x26cccd+_0x7673('0x32')]:_0x485b39});});if(_0x4a8ea0){_0x2be805[_0x7673('0x2c')]({'pauseType':_0x4a8ea0});}}else if(_0x224cea){_0x1da115[_0x7673('0x31')](function(_0x7b2313){_0x2be805[_0x7673('0x2c')]({[_0x7b2313+'Pause']:![]});});}_0x1c57a5['where']=_[_0x7673('0x33')](_0x1c57a5[_0x7673('0x34')],{'$and':_0x2be805});if(_0x451c87[_0x7673('0x35')][_0x7673('0x28')]===_0x7673('0x35')){var _0x101e03={'params':{'id':_0x451c87[_0x7673('0x35')]['userProfileId']},'query':{'section':_0x7673('0x36'),'role':_0x7673('0x37'),'online':!![],'raw':!![],'ids':_0x17699a,'customSorting':_0x33ff7d}};if(_0x3b0e20){_0x101e03['query'][_0x7673('0x38')]=_0x2be805;}_0x101e03[_0x7673('0xf')]=Object[_0x7673('0x39')](_0x101e03[_0x7673('0xf')],_0x451c87['query']);delete _0x101e03[_0x7673('0xf')]['id'];return db[_0x7673('0x3a')]['getResources'](_0x101e03);}return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x1c57a5);})[_0x7673('0x15')](function(_0x51f938){_0x119e42[_0x7673('0x8')]=_0x51f938[_0x7673('0x8')];_0x5c8626=_0x51f938[_0x7673('0x3d')];return _0x5c8626['map'](function(_0x4c6106){var _0x13ce30=_['find'](_0x26f0c4,['id',_0x4c6106['id']]);if(_0x13ce30){var _0x4ba2b4=rta[_0x7673('0x3e')](_0x13ce30);_[_0x7673('0x33')](_0x4c6106,_0x4ba2b4);}_0x4c6106['globalStatus']=rta[_0x7673('0x3f')](_0x4c6106);if(_0x4c6106[_0x7673('0x1c')][_0x7673('0x1b')](_0x7673('0x40'))){_0x1da115[_0x7673('0x31')](function(_0x2466b8){if(_0x4c6106[_0x2466b8+'Pause']){_0x4c6106[_0x2466b8+_0x7673('0x41')]='pause';}});}return _0x4c6106;});})[_0x7673('0x15')](function(_0x52f803){if(!_0x58a821||_0x33ff7d){return _0x52f803;}return rta[_0x7673('0x42')](_0x52f803,_0x58a821);})[_0x7673('0x15')](function(_0x5ec867){var _0x5b2e69=null;if(_0x451c87[_0x7673('0xf')]['fields']){var _0x23dca4=_0x451c87[_0x7673('0xf')][_0x7673('0x1f')][_0x7673('0x43')](',');_0x5b2e69=_0x5ec867[_0x7673('0x24')](function(_0x545357){return _['pick'](_0x545357,_0x23dca4);});}_0x119e42[_0x7673('0x3d')]=_0x5b2e69||_0x5ec867;return _0x119e42;})[_0x7673('0x15')](respondWithFilteredResult(_0x41d6bd,_0x1c57a5))['catch'](APIHandleError(_0x41d6bd));};exports[_0x7673('0x44')]=function(_0xb10099,_0x143d0f){var _0x5991d7={'count':0x0,'rows':[]};var _0x1a9017={};var _0x378648;var _0x46ecbb;var _0x229c13;Promise[_0x7673('0x14')]()[_0x7673('0x15')](function(){if(_0xb10099[_0x7673('0xf')][_0x7673('0x19')]){if(!utils[_0x7673('0x16')](_0xb10099['query'][_0x7673('0x19')])){throw new APIBadRequestError(util[_0x7673('0x17')](_0x7673('0x18'),_0xb10099[_0x7673('0xf')][_0x7673('0x19')]));}_0x378648=_0xb10099[_0x7673('0xf')][_0x7673('0x19')]['toLowerCase']();}var _0x3db9d5=_[_0x7673('0x45')](_0x378648)+_0x7673('0x46');var _0x2de2e9=_[_0x7673('0x24')](db[_0x3db9d5]['rawAttributes'],function(_0x289aaa){return{'name':_0x289aaa[_0x7673('0x25')],'type':_0x289aaa[_0x7673('0x26')][_0x7673('0x27')]};});if(!_0xb10099[_0x7673('0xf')]['fields']){var _0x56cd7a=['id',_0x7673('0x47')];if(_0x378648===_0x7673('0x48')){_0x56cd7a['push'](_0x7673('0x26'));if(_0xb10099[_0x7673('0xf')][_0x7673('0x26')]===_0x7673('0x49')){_0x56cd7a[_0x7673('0x2c')](['dialActive',_0x7673('0x4a')]);}}_0xb10099[_0x7673('0xf')][_0x7673('0x1f')]=_0x56cd7a[_0x7673('0x4b')](',');}_0x1a9017=qs['getOptions'](_0x2de2e9,_0xb10099);if(_0xb10099[_0x7673('0x35')][_0x7673('0x28')]===_0x7673('0x35')){var _0xa93124={'params':{'id':_0xb10099[_0x7673('0x35')][_0x7673('0x4c')]},'query':{'section':_0x378648===_0x7673('0x48')&&_0xb10099[_0x7673('0xf')][_0x7673('0x26')]===_0x7673('0x49')?_0x7673('0x4d'):_['startCase'](_0x378648)+_0x7673('0x4e'),'type':_0xb10099['query'][_0x7673('0x26')],'nolimit':!![],'sort':_0x7673('0x47'),'filter':_0xb10099[_0x7673('0xf')]['filter']}};_0xa93124[_0x7673('0xf')]=Object[_0x7673('0x39')](_0xa93124[_0x7673('0xf')],_0xb10099[_0x7673('0xf')]);delete _0xa93124[_0x7673('0xf')]['id'];return db[_0x7673('0x3a')][_0x7673('0x4f')](_0xa93124);}return db[_0x3db9d5][_0x7673('0x3c')](_0x1a9017);})[_0x7673('0x15')](function(_0x1064d5){_0x5991d7[_0x7673('0x8')]=_0x1064d5[_0x7673('0x8')];_0x46ecbb=_0x1064d5[_0x7673('0x3d')];return rtq[_0x7673('0x50')](_0xb10099,_0x378648);})['then'](function(_0x29dc1a){_0x229c13=_0x29dc1a['rows'];return rtq[_0x7673('0x51')](_0x46ecbb,_0x229c13,_0x378648,_0xb10099[_0x7673('0xf')][_0x7673('0x26')]);})['then'](function(_0x6b8332){_0x5991d7['rows']=_0x6b8332;return _0x5991d7;})['then'](respondWithFilteredResult(_0x143d0f,_0x1a9017))[_0x7673('0x52')](APIHandleError(_0x143d0f));};
\ No newline at end of file
index ce62551..58dc62e 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(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'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(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'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 4fc2dfe..b9b6ef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf767=['STRING','DATE','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf767,0x76));var _0x7f76=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0xf767[_0x27c24e];return _0x39004a;};'use strict';var Sequelize=require('sequelize');module[_0x7f76('0x0')]={'state':{'type':Sequelize[_0x7f76('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7f76('0x2')]},'scheduledat':{'type':Sequelize[_0x7f76('0x3')]},'uniqueid':{'type':Sequelize[_0x7f76('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7f76('0x3')]},'ringtime':{'type':Sequelize[_0x7f76('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7f76('0x2')]},'campaigntype':{'type':Sequelize[_0x7f76('0x2')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xecb2=['DATE','INTEGER','sequelize','STRING'];(function(_0x59f7a9,_0x2b5df5){var _0x48bef7=function(_0x1580f5){while(--_0x1580f5){_0x59f7a9['push'](_0x59f7a9['shift']());}};_0x48bef7(++_0x2b5df5);}(_0xecb2,0xf6));var _0x2ecb=function(_0x8f9fe,_0x523a96){_0x8f9fe=_0x8f9fe-0x0;var _0x5376d3=_0xecb2[_0x8f9fe];return _0x5376d3;};'use strict';var Sequelize=require(_0x2ecb('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2ecb('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2ecb('0x2')]},'responsetime':{'type':Sequelize[_0x2ecb('0x2')]},'ringtime':{'type':Sequelize[_0x2ecb('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x2ecb('0x1')]},'campaigntype':{'type':Sequelize[_0x2ecb('0x1')]},'membername':{'type':Sequelize[_0x2ecb('0x1')]}};
\ No newline at end of file
index 9187d80..aeb84b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf29d=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ReportAgentPreview','util','../../config/logger'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0xf29d,0xee));var _0xdf29=function(_0x4a2a17,_0x23e07b){_0x4a2a17=_0x4a2a17-0x0;var _0x2e3361=_0xf29d[_0x4a2a17];return _0x2e3361;};'use strict';var _=require('lodash');var util=require(_0xdf29('0x0'));var logger=require(_0xdf29('0x1'))('api');var moment=require(_0xdf29('0x2'));var BPromise=require(_0xdf29('0x3'));var rp=require(_0xdf29('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf29('0x5'));var config=require(_0xdf29('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xdf29('0x7')]=function(_0x2e96fa,_0x46b053){return _0x2e96fa[_0xdf29('0x8')](_0xdf29('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1afc=['ReportAgentPreview','report_agent_preview','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define'];(function(_0x4e5969,_0x59d73e){var _0x59d7ce=function(_0x13a624){while(--_0x13a624){_0x4e5969['push'](_0x4e5969['shift']());}};_0x59d7ce(++_0x59d73e);}(_0x1afc,0x136));var _0xc1af=function(_0x84996e,_0x30388d){_0x84996e=_0x84996e-0x0;var _0x118789=_0x1afc[_0x84996e];return _0x118789;};'use strict';var _=require('lodash');var util=require(_0xc1af('0x0'));var logger=require(_0xc1af('0x1'))('api');var moment=require(_0xc1af('0x2'));var BPromise=require('bluebird');var rp=require(_0xc1af('0x3'));var fs=require('fs');var path=require(_0xc1af('0x4'));var rimraf=require(_0xc1af('0x5'));var config=require(_0xc1af('0x6'));var attributes=require(_0xc1af('0x7'));module['exports']=function(_0x40731e,_0x47d8fb){return _0x40731e[_0xc1af('0x8')](_0xc1af('0x9'),attributes,{'tableName':_0xc1af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b01177..df30102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfcf=['info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','ReportAgentPreview,\x20%s,\x20%s','message','result','ReportAgentPreview','create','body','CreateReportAgentPreview','stringify','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http','then'];(function(_0x29ce19,_0x16424e){var _0x42e2fc=function(_0x3b46dd){while(--_0x3b46dd){_0x29ce19['push'](_0x29ce19['shift']());}};_0x42e2fc(++_0x16424e);}(_0xbfcf,0x6e));var _0xfbfc=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xbfcf[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var moment=require(_0xfbfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfbfc('0x5'));var config=require('../../config/environment');var jayson=require(_0xfbfc('0x6'));var client=jayson[_0xfbfc('0x7')][_0xfbfc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37211e,_0x11c05f,_0x1ac305){return new BPromise(function(_0x3647c1,_0x3c061f){return client['request'](_0x37211e,_0x1ac305)[_0xfbfc('0x9')](function(_0x26eaf0){logger[_0xfbfc('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x11c05f,'request\x20sent');logger[_0xfbfc('0xb')](_0xfbfc('0xc'),_0x11c05f,_0xfbfc('0xd'),JSON['stringify'](_0x26eaf0));if(_0x26eaf0[_0xfbfc('0xe')]){if(_0x26eaf0[_0xfbfc('0xe')]['code']===0x1f4){logger[_0xfbfc('0xe')](_0xfbfc('0xf'),_0x11c05f,_0x26eaf0[_0xfbfc('0xe')][_0xfbfc('0x10')]);return _0x3c061f(_0x26eaf0[_0xfbfc('0xe')][_0xfbfc('0x10')]);}logger[_0xfbfc('0xe')](_0xfbfc('0xf'),_0x11c05f,_0x26eaf0[_0xfbfc('0xe')][_0xfbfc('0x10')]);return _0x3647c1(_0x26eaf0['error'][_0xfbfc('0x10')]);}else{logger[_0xfbfc('0xa')](_0xfbfc('0xf'),_0x11c05f,'request\x20sent');_0x3647c1(_0x26eaf0[_0xfbfc('0x11')][_0xfbfc('0x10')]);}})['catch'](function(_0x508569){logger['error'](_0xfbfc('0xf'),_0x11c05f,_0x508569);_0x3c061f(_0x508569);});});}exports['CreateReportAgentPreview']=function(_0x3f6fbf){var _0x59caea=this;return new Promise(function(_0x30d3e1,_0x4e8f81){return db[_0xfbfc('0x12')][_0xfbfc('0x13')](_0x3f6fbf[_0xfbfc('0x14')],{'raw':_0x3f6fbf['options']?_0x3f6fbf['options']['raw']===undefined?!![]:![]:!![]})[_0xfbfc('0x9')](function(_0x1729f5){logger['info'](_0xfbfc('0x15'),_0x3f6fbf);logger[_0xfbfc('0xb')](_0xfbfc('0x15'),_0x3f6fbf,JSON[_0xfbfc('0x16')](_0x1729f5));_0x30d3e1(_0x1729f5);})[_0xfbfc('0x17')](function(_0x2a8fe2){logger[_0xfbfc('0xe')]('CreateReportAgentPreview',_0x2a8fe2['message'],_0x3f6fbf);_0x4e8f81(_0x59caea[_0xfbfc('0xe')](0x1f4,_0x2a8fe2['message']));});});};
\ No newline at end of file
+var _0xfcaf=['request','then','info','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5a2c76,_0x18344d){var _0xb00e10=function(_0x2c0198){while(--_0x2c0198){_0x5a2c76['push'](_0x5a2c76['shift']());}};_0xb00e10(++_0x18344d);}(_0xfcaf,0x7d));var _0xffca=function(_0xbec2cd,_0xcf1938){_0xbec2cd=_0xbec2cd-0x0;var _0x38142e=_0xfcaf[_0xbec2cd];return _0x38142e;};'use strict';var _=require('lodash');var util=require(_0xffca('0x0'));var moment=require('moment');var BPromise=require(_0xffca('0x1'));var rs=require(_0xffca('0x2'));var fs=require('fs');var Redis=require(_0xffca('0x3'));var db=require(_0xffca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xffca('0x5'))('rpc');var config=require(_0xffca('0x6'));var jayson=require(_0xffca('0x7'));var client=jayson[_0xffca('0x8')][_0xffca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2beded,_0x2e41fc,_0xf409b7){return new BPromise(function(_0x618d02,_0x163ab8){return client[_0xffca('0xa')](_0x2beded,_0xf409b7)[_0xffca('0xb')](function(_0x368412){logger[_0xffca('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x2e41fc,'request\x20sent');logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x2e41fc,'request\x20sent',JSON[_0xffca('0xd')](_0x368412));if(_0x368412[_0xffca('0xe')]){if(_0x368412[_0xffca('0xe')]['code']===0x1f4){logger['error'](_0xffca('0xf'),_0x2e41fc,_0x368412[_0xffca('0xe')][_0xffca('0x10')]);return _0x163ab8(_0x368412[_0xffca('0xe')][_0xffca('0x10')]);}logger['error'](_0xffca('0xf'),_0x2e41fc,_0x368412['error'][_0xffca('0x10')]);return _0x618d02(_0x368412[_0xffca('0xe')]['message']);}else{logger['info'](_0xffca('0xf'),_0x2e41fc,_0xffca('0x11'));_0x618d02(_0x368412[_0xffca('0x12')][_0xffca('0x10')]);}})[_0xffca('0x13')](function(_0x5e8f4a){logger[_0xffca('0xe')](_0xffca('0xf'),_0x2e41fc,_0x5e8f4a);_0x163ab8(_0x5e8f4a);});});}exports[_0xffca('0x14')]=function(_0x3510ba){var _0xa3d807=this;return new Promise(function(_0x4d1280,_0x1da19c){return db[_0xffca('0x15')][_0xffca('0x16')](_0x3510ba[_0xffca('0x17')],{'raw':_0x3510ba[_0xffca('0x18')]?_0x3510ba[_0xffca('0x18')][_0xffca('0x19')]===undefined?!![]:![]:!![]})[_0xffca('0xb')](function(_0x399355){logger[_0xffca('0xc')](_0xffca('0x14'),_0x3510ba);logger[_0xffca('0x1a')]('CreateReportAgentPreview',_0x3510ba,JSON['stringify'](_0x399355));_0x4d1280(_0x399355);})['catch'](function(_0x40048d){logger[_0xffca('0xe')]('CreateReportAgentPreview',_0x40048d[_0xffca('0x10')],_0x3510ba);_0x1da19c(_0xa3d807[_0xffca('0xe')](0x1f4,_0x40048d[_0xffca('0x10')]));});});};
\ No newline at end of file
index 554cef6..908f14a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe30f=['voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues'];(function(_0xad917c,_0x3b1c8d){var _0x36d2a3=function(_0x3bf10b){while(--_0x3bf10b){_0xad917c['push'](_0xad917c['shift']());}};_0x36d2a3(++_0x3b1c8d);}(_0xe30f,0xed));var _0xfe30=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe30f[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xfe30('0x0'));var util=require(_0xfe30('0x1'));var path=require('path');var express=require(_0xfe30('0x2'));var router=express[_0xfe30('0x3')]();var auth=require(_0xfe30('0x4'));var controller=require(_0xfe30('0x5'));router[_0xfe30('0x6')](_0xfe30('0x7'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x9')]);router[_0xfe30('0x6')](_0xfe30('0xa'),auth[_0xfe30('0x8')](),controller[_0xfe30('0xb')]);router[_0xfe30('0x6')](_0xfe30('0xc'),auth[_0xfe30('0x8')](),controller[_0xfe30('0xd')]);router[_0xfe30('0x6')](_0xfe30('0xe'),auth[_0xfe30('0x8')](),controller[_0xfe30('0xf')]);router[_0xfe30('0x6')](_0xfe30('0x10'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x11')]);router[_0xfe30('0x6')](_0xfe30('0x12'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x13')]);router[_0xfe30('0x6')]('/mail/accounts',auth[_0xfe30('0x8')](),controller[_0xfe30('0x14')]);router[_0xfe30('0x6')]('/openchannel/queues',auth[_0xfe30('0x8')](),controller[_0xfe30('0x15')]);router[_0xfe30('0x6')]('/sms/queues',auth[_0xfe30('0x8')](),controller[_0xfe30('0x16')]);router[_0xfe30('0x6')](_0xfe30('0x17'),auth['isAuthenticated'](),controller[_0xfe30('0x18')]);router[_0xfe30('0x6')](_0xfe30('0x19'),auth['isAuthenticated'](),controller['faxQueues']);router['get'](_0xfe30('0x1a'),auth['isAuthenticated'](),controller[_0xfe30('0x1b')]);router[_0xfe30('0x6')]('/voice/queues/channels',auth[_0xfe30('0x8')](),controller[_0xfe30('0x1c')]);router[_0xfe30('0x6')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xfe30('0x1d')]);router[_0xfe30('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xfe30('0x8')](),controller[_0xfe30('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xfe30('0x6')](_0xfe30('0x1f'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x20')]);router[_0xfe30('0x21')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xfe30('0x22')]);router['get']('/outbound',auth['isAuthenticated'](),controller[_0xfe30('0x23')]);router[_0xfe30('0x6')]('/outbound/channels',auth[_0xfe30('0x8')](),controller[_0xfe30('0x24')]);router[_0xfe30('0x6')](_0xfe30('0x25'),auth['isAuthenticated'](),controller[_0xfe30('0x26')]);router[_0xfe30('0x21')](_0xfe30('0x27'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x28')]);router[_0xfe30('0x6')](_0xfe30('0x29'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x2a')]);router[_0xfe30('0x6')](_0xfe30('0x2b'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x2c')]);router[_0xfe30('0x6')](_0xfe30('0x2d'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x2e')]);router[_0xfe30('0x6')]('/fax/accounts',auth[_0xfe30('0x8')](),controller[_0xfe30('0x2f')]);router['get'](_0xfe30('0x30'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x31')]);router[_0xfe30('0x6')](_0xfe30('0x32'),auth['isAuthenticated'](),controller[_0xfe30('0x33')]);router[_0xfe30('0x6')](_0xfe30('0x34'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x35')]);router[_0xfe30('0x6')](_0xfe30('0x36'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x37')]);router[_0xfe30('0x6')](_0xfe30('0x38'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x39')]);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xfe30('0x3a')]);router[_0xfe30('0x6')](_0xfe30('0x3b'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x3c')]);router[_0xfe30('0x3d')]('/mail/queues/:id/notify',auth[_0xfe30('0x8')](),controller[_0xfe30('0x3e')](_0xfe30('0x3f')));router[_0xfe30('0x6')](_0xfe30('0x40'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xfe30('0x3d')](_0xfe30('0x41'),auth['isAuthenticated'](),controller[_0xfe30('0x3e')]('chat'));router[_0xfe30('0x6')](_0xfe30('0x42'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x43')]);router['post'](_0xfe30('0x44'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x3e')](_0xfe30('0x45')));router[_0xfe30('0x6')](_0xfe30('0x46'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x47')]);router[_0xfe30('0x3d')]('/openchannel/queues/:id/notify',auth[_0xfe30('0x8')](),controller[_0xfe30('0x3e')](_0xfe30('0x48')));router['get'](_0xfe30('0x49'),auth[_0xfe30('0x8')](),controller['showOpenchannelQueues']);router[_0xfe30('0x3d')](_0xfe30('0x4a'),auth[_0xfe30('0x8')](),controller['queueNotify'](_0xfe30('0x4b')));router[_0xfe30('0x3d')](_0xfe30('0x4c'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x3e')](_0xfe30('0x4d')));router[_0xfe30('0x6')](_0xfe30('0x4e'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x4f')]);router[_0xfe30('0x6')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0xfe30('0x50')]);router[_0xfe30('0x3d')](_0xfe30('0x51'),auth[_0xfe30('0x8')](),controller[_0xfe30('0x52')]);module[_0xfe30('0x53')]=router;
\ No newline at end of file
+var _0x8c43=['/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','/telephones','telephones','/trunks','trunks','/campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0x8c43,0x1e5));var _0x38c4=function(_0x272607,_0x13ee11){_0x272607=_0x272607-0x0;var _0xe4cc79=_0x8c43[_0x272607];return _0xe4cc79;};'use strict';var multer=require(_0x38c4('0x0'));var util=require(_0x38c4('0x1'));var path=require(_0x38c4('0x2'));var express=require(_0x38c4('0x3'));var router=express[_0x38c4('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x38c4('0x5'));router[_0x38c4('0x6')]('/voice/channels',auth['isAuthenticated'](),controller[_0x38c4('0x7')]);router[_0x38c4('0x6')](_0x38c4('0x8'),auth['isAuthenticated'](),controller[_0x38c4('0x9')]);router[_0x38c4('0x6')](_0x38c4('0xa'),auth[_0x38c4('0xb')](),controller[_0x38c4('0xc')]);router[_0x38c4('0x6')](_0x38c4('0xd'),auth[_0x38c4('0xb')](),controller['voiceQueues']);router[_0x38c4('0x6')]('/chat/queues',auth[_0x38c4('0xb')](),controller[_0x38c4('0xe')]);router[_0x38c4('0x6')](_0x38c4('0xf'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x38c4('0x6')](_0x38c4('0x10'),auth[_0x38c4('0xb')](),controller['mailAccounts']);router[_0x38c4('0x6')](_0x38c4('0x11'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x12')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x38c4('0x13'),auth['isAuthenticated'](),controller[_0x38c4('0x14')]);router['get'](_0x38c4('0x15'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x16')]);router[_0x38c4('0x6')](_0x38c4('0x17'),auth[_0x38c4('0xb')](),controller['voiceQueuesPreview']);router['get'](_0x38c4('0x18'),auth[_0x38c4('0xb')](),controller['voiceQueuesChannels']);router[_0x38c4('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x38c4('0xb')](),controller['voiceQueuesChannel']);router[_0x38c4('0x6')](_0x38c4('0x19'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x1a')]);router[_0x38c4('0x6')](_0x38c4('0x1b'),auth['isAuthenticated'](),controller[_0x38c4('0x1c')]);router[_0x38c4('0x6')](_0x38c4('0x1d'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x1e')]);router[_0x38c4('0x1f')]('/voice/queues/:id',auth[_0x38c4('0xb')](),controller[_0x38c4('0x20')]);router[_0x38c4('0x6')](_0x38c4('0x21'),auth[_0x38c4('0xb')](),controller['outbound']);router['get'](_0x38c4('0x22'),auth[_0x38c4('0xb')](),controller['outboundChannels']);router[_0x38c4('0x6')](_0x38c4('0x23'),auth[_0x38c4('0xb')](),controller['agents']);router[_0x38c4('0x1f')]('/agents/:id/capacity',auth[_0x38c4('0xb')](),controller['agentCapacity']);router[_0x38c4('0x6')](_0x38c4('0x24'),auth['isAuthenticated'](),controller[_0x38c4('0x25')]);router['get'](_0x38c4('0x26'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x27')]);router[_0x38c4('0x6')](_0x38c4('0x28'),auth[_0x38c4('0xb')](),controller['campaigns']);router[_0x38c4('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0x38c4('0x6')](_0x38c4('0x29'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x2a')]);router[_0x38c4('0x6')](_0x38c4('0x2b'),auth['isAuthenticated'](),controller[_0x38c4('0x2c')]);router[_0x38c4('0x6')](_0x38c4('0x2d'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x38c4('0x6')](_0x38c4('0x2e'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x2f')]);router['get'](_0x38c4('0x30'),auth[_0x38c4('0xb')](),controller['smsQueuesWaitingInteractions']);router[_0x38c4('0x6')](_0x38c4('0x31'),auth['isAuthenticated'](),controller[_0x38c4('0x32')]);router[_0x38c4('0x6')](_0x38c4('0x33'),auth['isAuthenticated'](),controller[_0x38c4('0x34')]);router[_0x38c4('0x35')](_0x38c4('0x36'),auth['isAuthenticated'](),controller[_0x38c4('0x37')](_0x38c4('0x38')));router[_0x38c4('0x6')](_0x38c4('0x39'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x3a')]);router[_0x38c4('0x35')](_0x38c4('0x3b'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x37')](_0x38c4('0x3c')));router[_0x38c4('0x6')](_0x38c4('0x3d'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x3e')]);router['post'](_0x38c4('0x3f'),auth['isAuthenticated'](),controller[_0x38c4('0x37')](_0x38c4('0x40')));router[_0x38c4('0x6')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x38c4('0x41')]);router[_0x38c4('0x35')](_0x38c4('0x42'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x37')](_0x38c4('0x43')));router['get'](_0x38c4('0x44'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x45')]);router[_0x38c4('0x35')]('/sms/queues/:id/notify',auth[_0x38c4('0xb')](),controller[_0x38c4('0x37')](_0x38c4('0x46')));router[_0x38c4('0x35')](_0x38c4('0x47'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x37')](_0x38c4('0x48')));router[_0x38c4('0x6')](_0x38c4('0x49'),auth['isAuthenticated'](),controller[_0x38c4('0x4a')]);router[_0x38c4('0x6')](_0x38c4('0x4b'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x4c')]);router[_0x38c4('0x35')](_0x38c4('0x4d'),auth[_0x38c4('0xb')](),controller[_0x38c4('0x4e')]);module[_0x38c4('0x4f')]=router;
\ No newline at end of file
index 6dab538..fded5d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d30=['capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','queue','InteractionId','From','create','Start','queueTransferTimeout','*,*,*,*','Channel\x20field\x20is\x20mandatory','capitalize','User','messageId','TransferReport','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','body','params','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','interface','agent','AgentCapacity'];(function(_0x217919,_0x261bda){var _0x57742c=function(_0x422fb9){while(--_0x422fb9){_0x217919['push'](_0x217919['shift']());}};_0x57742c(++_0x261bda);}(_0x3d30,0x145));var _0x03d3=function(_0x4295fe,_0x2964df){_0x4295fe=_0x4295fe-0x0;var _0x1708da=_0x3d30[_0x4295fe];return _0x1708da;};'use strict';var BPromise=require(_0x03d3('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0x03d3('0x1'));var db=require(_0x03d3('0x2'))['db'];var logger=require(_0x03d3('0x3'))(_0x03d3('0x4'));var jayson=require(_0x03d3('0x5'));var amiClient=jayson[_0x03d3('0x6')][_0x03d3('0x7')]({'port':0x232a});var mailClient=jayson[_0x03d3('0x6')][_0x03d3('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x03d3('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1ea4e4,_0x53b132,_0x166e80){return new BPromise(function(_0x92ed0a,_0x50d311){var _0x1f4cd3=_0x166e80?_0x166e80:amiClient;return _0x1f4cd3[_0x03d3('0x8')](_0x1ea4e4,_0x53b132)[_0x03d3('0x9')](function(_0x5d4ab4){if(_0x5d4ab4[_0x03d3('0xa')]){if(_0x5d4ab4[_0x03d3('0xa')]['code']===0x1f4){return _0x50d311(_0x5d4ab4[_0x03d3('0xa')][_0x03d3('0xb')]);}return _0x92ed0a(_0x5d4ab4[_0x03d3('0xa')][_0x03d3('0xb')]);}else{_0x92ed0a(_0x5d4ab4['result']);}})['catch'](function(_0x110cf6){_0x50d311(_0x110cf6);});});}function respondWithResult(_0x5ddb98,_0x30fdc4){_0x30fdc4=_0x30fdc4||0xc8;return function(_0x6618f2){if(_0x6618f2){return _0x5ddb98[_0x03d3('0xc')](_0x30fdc4)[_0x03d3('0xd')](_0x6618f2);}return _0x5ddb98[_0x03d3('0xe')](0x194);};}function handleError(_0x454195,_0x4f9f6b){_0x4f9f6b=_0x4f9f6b||0x1f4;return function(_0x52080d){logger[_0x03d3('0xa')](_0x52080d[_0x03d3('0xf')]);if(_0x52080d[_0x03d3('0x10')]){delete _0x52080d[_0x03d3('0x10')];}_0x454195[_0x03d3('0xc')](_0x4f9f6b)[_0x03d3('0x11')](_0x52080d);};}function findById(_0x5851ec){return function(_0x404131){if(!_[_0x03d3('0x12')](_0x5851ec)&&!_[_0x03d3('0x12')](_0x404131)&&!_['isNil'](_0x404131[_0x03d3('0x13')])){return _[_0x03d3('0x14')](_0x404131[_0x03d3('0x13')],function(_0x208364){return _0x208364['id']==_0x5851ec;});}return null;};}exports[_0x03d3('0x15')]=function(_0x2c6cbc,_0x28df4b){return respondWithRpcPromise(_0x03d3('0x16'),_0x2c6cbc['query'])[_0x03d3('0x9')](respondWithResult(_0x28df4b,null))['catch'](handleError(_0x28df4b,null));};exports[_0x03d3('0x17')]=function(_0x13fad5,_0x19a600){return respondWithRpcPromise(_0x03d3('0x18'),_[_0x03d3('0x19')](_0x13fad5[_0x03d3('0x1a')],_0x13fad5['params']))[_0x03d3('0x9')](respondWithResult(_0x19a600,null))[_0x03d3('0x1b')](handleError(_0x19a600,null));};exports[_0x03d3('0x1c')]=function(_0x225917,_0x2d1a88){return respondWithRpcPromise(_0x03d3('0x1d'),_[_0x03d3('0x19')](_0x225917['query'],_0x225917['params']))[_0x03d3('0x9')](respondWithResult(_0x2d1a88,null))[_0x03d3('0x1b')](handleError(_0x2d1a88,null));};exports['voiceQueues']=function(_0x14fe6a,_0x3dd836){return respondWithRpcPromise(_0x03d3('0x1e'),_0x14fe6a['query'])[_0x03d3('0x9')](respondWithResult(_0x3dd836,null))[_0x03d3('0x1b')](handleError(_0x3dd836,null));};exports[_0x03d3('0x1f')]=function(_0x41b767,_0x2df2f1){return respondWithRpcPromise(_0x03d3('0x1e'),_0x41b767[_0x03d3('0x1a')])[_0x03d3('0x9')](findById(_0x41b767['params']['id']))['then'](respondWithResult(_0x2df2f1,null))['catch'](handleError(_0x2df2f1,null));};exports['updateVoiceQueue']=function(_0x35829c,_0x4c1d88){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x03d3('0x19')](_0x35829c[_0x03d3('0x20')],_0x35829c[_0x03d3('0x21')]))[_0x03d3('0x9')](respondWithResult(_0x4c1d88,null))['catch'](handleError(_0x4c1d88,null));};exports[_0x03d3('0x22')]=function(_0x1a2295,_0x259638){return respondWithRpcPromise(_0x03d3('0x23'),_[_0x03d3('0x19')](_0x1a2295[_0x03d3('0x1a')],_0x1a2295[_0x03d3('0x21')]))['then'](respondWithResult(_0x259638,null))[_0x03d3('0x1b')](handleError(_0x259638,null));};exports[_0x03d3('0x24')]=function(_0x52eae2,_0x10e41a){return respondWithRpcPromise(_0x03d3('0x25'),_0x52eae2[_0x03d3('0x1a')])[_0x03d3('0x9')](respondWithResult(_0x10e41a,null))[_0x03d3('0x1b')](handleError(_0x10e41a,null));};exports[_0x03d3('0x26')]=function(_0x1dbcdf,_0xe10d97){return respondWithRpcPromise(_0x03d3('0x27'),_[_0x03d3('0x19')](_0x1dbcdf[_0x03d3('0x1a')],_0x1dbcdf[_0x03d3('0x21')]))['then'](respondWithResult(_0xe10d97,null))[_0x03d3('0x1b')](handleError(_0xe10d97,null));};exports[_0x03d3('0x28')]=function(_0x11ada1,_0x489619){return respondWithRpcPromise(_0x03d3('0x29'),_[_0x03d3('0x19')](_0x11ada1[_0x03d3('0x1a')],_0x11ada1['params']))[_0x03d3('0x9')](respondWithResult(_0x489619,null))[_0x03d3('0x1b')](handleError(_0x489619,null));};exports[_0x03d3('0x2a')]=function(_0x5a1624,_0x1b28c7){return respondWithRpcPromise(_0x03d3('0x2b'),_[_0x03d3('0x19')](_0x5a1624[_0x03d3('0x1a')],_0x5a1624['params']))['then'](respondWithResult(_0x1b28c7,null))[_0x03d3('0x1b')](handleError(_0x1b28c7,null));};exports[_0x03d3('0x2c')]=function(_0x39fc40,_0x1c99b6){return respondWithRpcPromise(_0x03d3('0x2d'),_0x39fc40[_0x03d3('0x1a')])[_0x03d3('0x9')](respondWithResult(_0x1c99b6,null))[_0x03d3('0x1b')](handleError(_0x1c99b6,null));};exports[_0x03d3('0x2e')]=function(_0x3720a2,_0x6ff439){return respondWithRpcPromise(_0x03d3('0x2f'),_0x3720a2[_0x03d3('0x1a')])[_0x03d3('0x9')](respondWithResult(_0x6ff439,null))['catch'](handleError(_0x6ff439,null));};exports['agents']=function(_0x55886d,_0x5ef7e9){var _0x31d41e;return respondWithRpcPromise(_0x03d3('0x30'),_0x55886d[_0x03d3('0x1a')])[_0x03d3('0x9')](function(_0x4d4bc8){_0x31d41e=_0x4d4bc8;return respondWithRpcPromise(_0x03d3('0x30'),_0x55886d[_0x03d3('0x1a')],routingClient);})[_0x03d3('0x9')](function(_0x129d02){return _['merge']({},_0x129d02,_0x31d41e);})[_0x03d3('0x9')](respondWithResult(_0x5ef7e9,null))[_0x03d3('0x1b')](handleError(_0x5ef7e9,null));};exports[_0x03d3('0x31')]=function(_0x1d934e,_0x53a1ba){if(_0x1d934e[_0x03d3('0x20')]&&_0x1d934e['body'][_0x03d3('0x32')]&&_0x1d934e[_0x03d3('0x33')]&&_0x1d934e[_0x03d3('0x33')]['name']){for(var _0xe68ff2 in _0x1d934e[_0x03d3('0x20')]['interaction']){if(_0x1d934e[_0x03d3('0x20')]['interaction'][_0x03d3('0x34')](_0xe68ff2)){db[_0x03d3('0x35')][_0x03d3('0x36')]({'where':{'channel':_0xe68ff2,'membername':_0x1d934e[_0x03d3('0x33')][_0x03d3('0x10')],'type':_0x03d3('0x37'),'exitAt':null,'uniqueid':_0x1d934e[_0x03d3('0x20')][_0x03d3('0x32')][_0xe68ff2]&&_0x1d934e[_0x03d3('0x20')][_0x03d3('0x32')][_0xe68ff2][_0x03d3('0x38')]?{'$notIn':_0x1d934e[_0x03d3('0x20')][_0x03d3('0x32')][_0xe68ff2]}:{'$ne':null}}})[_0x03d3('0x9')](function(_0x4b7204){var _0x26d9b7=moment()[_0x03d3('0x39')](_0x03d3('0x3a'));for(var _0x3d196d=0x0,_0x22785a=_0x4b7204[_0x03d3('0x38')];_0x3d196d<_0x22785a;_0x3d196d+=0x1){_0x4b7204[_0x3d196d][_0x03d3('0x3b')]({'exitAt':_0x26d9b7});}});for(var _0x4e2b31=0x0;_0x4e2b31<_0x1d934e['body'][_0x03d3('0x32')][_0xe68ff2][_0x03d3('0x38')];_0x4e2b31+=0x1){db[_0x03d3('0x35')][_0x03d3('0x3c')]({'where':{'channel':_0xe68ff2,'membername':_0x1d934e[_0x03d3('0x33')][_0x03d3('0x10')],'type':'INTERACTION','uniqueid':_0x1d934e[_0x03d3('0x20')][_0x03d3('0x32')][_0xe68ff2][_0x4e2b31],'exitAt':null},'defaults':{'channel':_0xe68ff2,'membername':_0x1d934e[_0x03d3('0x33')][_0x03d3('0x10')],'interface':_[_0x03d3('0x12')](_0x1d934e[_0x03d3('0x33')]['interface'])?util[_0x03d3('0x39')](_0x03d3('0x3d'),_0x1d934e[_0x03d3('0x33')]['name']):_0x1d934e['user'][_0x03d3('0x3e')],'type':_0x03d3('0x37'),'enterAt':moment()[_0x03d3('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x03d3('0x3f'),'internal':_0x1d934e[_0x03d3('0x33')]['internal'],'uniqueid':_0x1d934e[_0x03d3('0x20')][_0x03d3('0x32')][_0xe68ff2][_0x4e2b31]}});}}}}return respondWithRpcPromise(_0x03d3('0x40'),{'id':_0x1d934e[_0x03d3('0x21')]['id'],'capacity':_0x1d934e['body'][_0x03d3('0x41')]},routingClient)[_0x03d3('0x9')](respondWithResult(_0x53a1ba,null))[_0x03d3('0x1b')](handleError(_0x53a1ba,null));};exports[_0x03d3('0x42')]=function(_0x1e2349,_0x504e24){return respondWithRpcPromise(_0x03d3('0x43'),_0x1e2349[_0x03d3('0x1a')])[_0x03d3('0x9')](respondWithResult(_0x504e24,null))[_0x03d3('0x1b')](handleError(_0x504e24,null));};exports[_0x03d3('0x44')]=function(_0x16fddd,_0x125bf5){return respondWithRpcPromise('Trunks',_0x16fddd['query'])['then'](respondWithResult(_0x125bf5,null))[_0x03d3('0x1b')](handleError(_0x125bf5,null));};exports[_0x03d3('0x45')]=function(_0x53c584,_0x2c0ed1){return respondWithRpcPromise(_0x03d3('0x46'),_0x53c584[_0x03d3('0x1a')])[_0x03d3('0x9')](respondWithResult(_0x2c0ed1,null))[_0x03d3('0x1b')](handleError(_0x2c0ed1,null));};exports[_0x03d3('0x47')]=function(_0x3e45ed,_0x120ec4){return respondWithRpcPromise(_0x03d3('0x48'),_0x3e45ed[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x120ec4,null))[_0x03d3('0x1b')](handleError(_0x120ec4,null));};exports['showChatQueues']=function(_0x1a1e33,_0x8ea0d){return respondWithRpcPromise(_0x03d3('0x48'),_0x1a1e33[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](findById(_0x1a1e33[_0x03d3('0x21')]['id']))['then'](respondWithResult(_0x8ea0d,null))[_0x03d3('0x1b')](handleError(_0x8ea0d,null));};exports[_0x03d3('0x49')]=function(_0x2cf06d,_0x3444b9){return respondWithRpcPromise(_0x03d3('0x4a'),_0x2cf06d[_0x03d3('0x1a')],routingClient)['then'](respondWithResult(_0x3444b9,null))[_0x03d3('0x1b')](handleError(_0x3444b9,null));};exports['showMailQueues']=function(_0x3cf1d6,_0x583f2c){return respondWithRpcPromise(_0x03d3('0x4a'),_0x3cf1d6[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](findById(_0x3cf1d6[_0x03d3('0x21')]['id']))[_0x03d3('0x9')](respondWithResult(_0x583f2c,null))[_0x03d3('0x1b')](handleError(_0x583f2c,null));};exports[_0x03d3('0x4b')]=function(_0x2aab97,_0x346496){return respondWithRpcPromise(_0x03d3('0x4c'),_0x2aab97['query'],mailClient)[_0x03d3('0x9')](respondWithResult(_0x346496,null))[_0x03d3('0x1b')](handleError(_0x346496,null));};exports['openchannelQueues']=function(_0x4bfacc,_0x5ca442){return respondWithRpcPromise(_0x03d3('0x4d'),_0x4bfacc[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x5ca442,null))[_0x03d3('0x1b')](handleError(_0x5ca442,null));};exports[_0x03d3('0x4e')]=function(_0x5d68dc,_0x1f33ed){return respondWithRpcPromise('OpenchannelQueues',_0x5d68dc['query'],routingClient)[_0x03d3('0x9')](findById(_0x5d68dc[_0x03d3('0x21')]['id']))[_0x03d3('0x9')](respondWithResult(_0x1f33ed,null))[_0x03d3('0x1b')](handleError(_0x1f33ed,null));};exports['smsQueues']=function(_0xf71dfb,_0x2b6203){return respondWithRpcPromise(_0x03d3('0x4f'),_0xf71dfb[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x2b6203,null))['catch'](handleError(_0x2b6203,null));};exports[_0x03d3('0x50')]=function(_0x11c310,_0x465161){return respondWithRpcPromise(_0x03d3('0x4f'),_0x11c310[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](findById(_0x11c310[_0x03d3('0x21')]['id']))['then'](respondWithResult(_0x465161,null))['catch'](handleError(_0x465161,null));};exports[_0x03d3('0x51')]=function(_0x3ca5ee,_0x3234fd){return respondWithRpcPromise(_0x03d3('0x52'),_0x3ca5ee['query'],routingClient)['then'](respondWithResult(_0x3234fd,null))['catch'](handleError(_0x3234fd,null));};exports[_0x03d3('0x53')]=function(_0x39e4e5,_0x2e4d30){return respondWithRpcPromise(_0x03d3('0x52'),_0x39e4e5['query'],routingClient)[_0x03d3('0x9')](findById(_0x39e4e5[_0x03d3('0x21')]['id']))[_0x03d3('0x9')](respondWithResult(_0x2e4d30,null))[_0x03d3('0x1b')](handleError(_0x2e4d30,null));};exports[_0x03d3('0x54')]=function(_0x84bc5e,_0x4d2a87){return respondWithRpcPromise(_0x03d3('0x55'),_0x84bc5e['query'],routingClient)[_0x03d3('0x9')](respondWithResult(_0x4d2a87,null))[_0x03d3('0x1b')](handleError(_0x4d2a87,null));};exports[_0x03d3('0x56')]=function(_0xafdbe7,_0x1961cf){return respondWithRpcPromise(_0x03d3('0x55'),_0xafdbe7['query'],routingClient)[_0x03d3('0x9')](findById(_0xafdbe7['params']['id']))[_0x03d3('0x9')](respondWithResult(_0x1961cf,null))[_0x03d3('0x1b')](handleError(_0x1961cf,null));};exports[_0x03d3('0x57')]=function(_0x13d94c,_0x4a31d7){return respondWithRpcPromise('FaxAccounts',_0x13d94c[_0x03d3('0x1a')])['then'](respondWithResult(_0x4a31d7,null))[_0x03d3('0x1b')](handleError(_0x4a31d7,null));};exports[_0x03d3('0x58')]=function(_0x4e8f6f,_0x3c4aed){return respondWithRpcPromise(_0x03d3('0x59'),_0x4e8f6f[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x3c4aed,null))['catch'](handleError(_0x3c4aed,null));};exports[_0x03d3('0x5a')]=function(_0x1e38cd,_0x5ea08e){return respondWithRpcPromise(_0x03d3('0x5b'),_0x1e38cd[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x5ea08e,null))['catch'](handleError(_0x5ea08e,null));};exports[_0x03d3('0x5c')]=function(_0x13d2a6,_0x473b28){return respondWithRpcPromise(_0x03d3('0x5d'),_0x13d2a6[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x473b28,null))['catch'](handleError(_0x473b28,null));};exports[_0x03d3('0x5e')]=function(_0x29fece,_0x1d4221){return respondWithRpcPromise(_0x03d3('0x5d'),_0x29fece[_0x03d3('0x1a')],routingClient)['then'](function(_0x52b2f6){if(_0x29fece[_0x03d3('0x1a')][_0x03d3('0x5f')]!==undefined){var _0x5c0bee=_(_0x52b2f6['rows'])['filter']([_0x29fece[_0x03d3('0x1a')][_0x03d3('0x5f')],_0x29fece[_0x03d3('0x21')]['id']])[_0x03d3('0x60')](_0x03d3('0x61'))[_0x03d3('0x62')]()[_0x03d3('0x63')]();return _0x52b2f6[_0x03d3('0x13')][_0x03d3('0x64')](function(_0x597610){return _0x5c0bee['indexOf'](_0x597610['queue_id'])>-0x1;});}else{return _0x52b2f6[_0x03d3('0x13')][_0x03d3('0x64')](function(_0x577711){return _0x577711[_0x03d3('0x61')]===parseInt(_0x29fece['params']['id']);});}})[_0x03d3('0x9')](respondWithResult(_0x1d4221,null))[_0x03d3('0x1b')](handleError(_0x1d4221,null));};exports[_0x03d3('0x65')]=function(_0x103f1e,_0x5b0ba1){return respondWithRpcPromise(_0x03d3('0x66'),_0x103f1e[_0x03d3('0x1a')],routingClient)['then'](respondWithResult(_0x5b0ba1,null))[_0x03d3('0x1b')](handleError(_0x5b0ba1,null));};exports[_0x03d3('0x67')]=function(_0x541568,_0x5c5023){return respondWithRpcPromise(_0x03d3('0x68'),_0x541568[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x5c5023,null))[_0x03d3('0x1b')](handleError(_0x5c5023,null));};exports[_0x03d3('0x69')]=function(_0x269d34,_0x16b442){return respondWithRpcPromise(_0x03d3('0x6a'),_0x269d34[_0x03d3('0x1a')],routingClient)[_0x03d3('0x9')](respondWithResult(_0x16b442,null))[_0x03d3('0x1b')](handleError(_0x16b442,null));};exports[_0x03d3('0x6b')]=function(_0x59a489){return function(_0x4871c4,_0x5520bb){var _0x475a3b,_0x52ca0f;var _0x3943df=_['capitalize'](_0x59a489);var _0x42f9c=_0x59a489===_0x03d3('0x6c')?_0x03d3('0x6d'):_0x03d3('0x6e');return db[_0x3943df+_0x03d3('0x6f')][_0x03d3('0x70')]({'raw':!![],'where':{'id':_0x4871c4['params']['id']}})['then'](function(_0x4ffc1f){if(_[_0x03d3('0x12')](_0x4ffc1f)){throw new Error(_0x3943df+_0x03d3('0x71'));}_0x475a3b=_0x4ffc1f;return db[_0x3943df+_0x03d3('0x72')]['findOne']({'where':{'id':_0x4871c4['body']['messageId']},'include':[{'model':db[_0x3943df+_0x03d3('0x73')],'as':_0x03d3('0x73')},{'model':db[_0x3943df+_0x42f9c],'as':'Account'}]});})['then'](function(_0x564d05){if(_[_0x03d3('0x12')](_0x564d05)){throw new Error(_0x3943df+_0x03d3('0x74'));}_0x52ca0f=_0x564d05;return _0x564d05['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x03d3('0x9')](function(){var _0x23573a={'uniqueid':_0x59a489+'.'+_0x52ca0f['id']+'.'+_0x52ca0f['Interaction']['id'],'FromUserId':_0x4871c4[_0x03d3('0x33')]['id'],'type':_0x03d3('0x75')};_0x23573a[_0x3943df+'MessageId']=_0x52ca0f['id'];_0x23573a[_0x3943df+_0x03d3('0x76')]=_0x52ca0f[_0x03d3('0x73')]['id'];_0x23573a[_0x03d3('0x77')+_0x3943df+_0x42f9c+'Id']=_0x52ca0f[_0x03d3('0x6e')]['id'];_0x23573a['To'+_0x3943df+'QueueId']=_0x475a3b['id'];return db[_0x3943df+'TransferReport'][_0x03d3('0x78')](_0x23573a);})['then'](function(){return respondWithRpcPromise(_0x03d3('0x79'),{'channel':_0x59a489,'interaction':_0x52ca0f[_0x03d3('0x73')],'message':_0x52ca0f,'account':_0x52ca0f[_0x03d3('0x6e')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x475a3b[_0x03d3('0x10')]+','+(_0x52ca0f[_0x03d3('0x6e')][_0x03d3('0x7a')]||0x12c),'interval':_0x03d3('0x7b')}]},routingClient);})['then'](respondWithResult(_0x5520bb,null))[_0x03d3('0x1b')](handleError(_0x5520bb,null));};};exports['agentNotify']=function(_0x10c47f,_0x481b09){var _0x53ea2b,_0x140e0e;if(_['isNil'](_0x10c47f[_0x03d3('0x20')]['channel'])){throw new Error(_0x03d3('0x7c'));}var _0xc5e5f7=_0x10c47f[_0x03d3('0x20')]['channel'];var _0x548cef=_[_0x03d3('0x7d')](_0xc5e5f7);var _0x39fb45=_0xc5e5f7===_0x03d3('0x6c')?'Website':_0x03d3('0x6e');return db[_0x03d3('0x7e')][_0x03d3('0x70')]({'raw':!![],'where':{'id':_0x10c47f[_0x03d3('0x21')]['id'],'role':_0x03d3('0x3f')}})[_0x03d3('0x9')](function(_0x2620c1){if(_['isNil'](_0x2620c1)){throw new Error('Agent\x20not\x20found');}_0x53ea2b=_0x2620c1;return db[_0x548cef+_0x03d3('0x72')][_0x03d3('0x70')]({'where':{'id':_0x10c47f['body'][_0x03d3('0x7f')]},'include':[{'model':db[_0x548cef+_0x03d3('0x73')],'as':_0x03d3('0x73')},{'model':db[_0x548cef+_0x39fb45],'as':_0x03d3('0x6e')}]});})[_0x03d3('0x9')](function(_0x531ae8){if(_['isNil'](_0x531ae8)){throw new Error(_0x548cef+_0x03d3('0x74'));}_0x140e0e=_0x531ae8;return _0x531ae8['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x417845={'uniqueid':_0xc5e5f7+'.'+_0x140e0e['id']+'.'+_0x140e0e[_0x03d3('0x73')]['id'],'FromUserId':_0x10c47f[_0x03d3('0x33')]['id'],'type':_0x03d3('0x3f'),'ToUserId':_0x53ea2b['id']};_0x417845[_0x548cef+'MessageId']=_0x140e0e['id'];_0x417845[_0x548cef+_0x03d3('0x76')]=_0x140e0e['Interaction']['id'];_0x417845['From'+_0x548cef+_0x39fb45+'Id']=_0x140e0e[_0x03d3('0x6e')]['id'];return db[_0x548cef+_0x03d3('0x80')][_0x03d3('0x78')](_0x417845);})[_0x03d3('0x9')](function(){return respondWithRpcPromise(_0x03d3('0x79'),{'channel':_0xc5e5f7,'interaction':_0x140e0e[_0x03d3('0x73')],'message':_0x140e0e,'account':_0x140e0e[_0x03d3('0x6e')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x53ea2b[_0x03d3('0x10')]+','+(_0x140e0e[_0x03d3('0x6e')][_0x03d3('0x81')]||0x12c),'interval':_0x03d3('0x7b')}]},routingClient);})['then'](respondWithResult(_0x481b09,null))['catch'](handleError(_0x481b09,null));};
\ No newline at end of file
+var _0x848d=['code','message','catch','status','stack','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','findOrCreate','interface','SIP/%s','agent','internal','capacity','telephones','Trunks','campaigns','chatQueues','showChatQueues','ChatQueues','MailQueues','mailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','value','indexOf','queue_id','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','InteractionId','create','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0x848d,0x6e));var _0xd848=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x848d[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var moment=require(_0xd848('0x0'));var _=require(_0xd848('0x1'));var util=require(_0xd848('0x2'));var db=require(_0xd848('0x3'))['db'];var logger=require(_0xd848('0x4'))(_0xd848('0x5'));var jayson=require(_0xd848('0x6'));var amiClient=jayson[_0xd848('0x7')][_0xd848('0x8')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0xd848('0x7')][_0xd848('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x43c73f,_0x1272c3,_0x3fc7d3){return new BPromise(function(_0x484a99,_0x1e2e62){var _0x1a5081=_0x3fc7d3?_0x3fc7d3:amiClient;return _0x1a5081[_0xd848('0x9')](_0x43c73f,_0x1272c3)[_0xd848('0xa')](function(_0x232af0){if(_0x232af0[_0xd848('0xb')]){if(_0x232af0['error'][_0xd848('0xc')]===0x1f4){return _0x1e2e62(_0x232af0[_0xd848('0xb')][_0xd848('0xd')]);}return _0x484a99(_0x232af0[_0xd848('0xb')][_0xd848('0xd')]);}else{_0x484a99(_0x232af0['result']);}})[_0xd848('0xe')](function(_0x1e8b4e){_0x1e2e62(_0x1e8b4e);});});}function respondWithResult(_0x4043a8,_0x438a36){_0x438a36=_0x438a36||0xc8;return function(_0x440aa2){if(_0x440aa2){return _0x4043a8[_0xd848('0xf')](_0x438a36)['json'](_0x440aa2);}return _0x4043a8['sendStatus'](0x194);};}function handleError(_0xe68173,_0x4c407a){_0x4c407a=_0x4c407a||0x1f4;return function(_0x5d1859){logger[_0xd848('0xb')](_0x5d1859[_0xd848('0x10')]);if(_0x5d1859[_0xd848('0x11')]){delete _0x5d1859['name'];}_0xe68173[_0xd848('0xf')](_0x4c407a)[_0xd848('0x12')](_0x5d1859);};}function findById(_0x8423a8){return function(_0x56f849){if(!_[_0xd848('0x13')](_0x8423a8)&&!_[_0xd848('0x13')](_0x56f849)&&!_[_0xd848('0x13')](_0x56f849[_0xd848('0x14')])){return _['find'](_0x56f849['rows'],function(_0x413df9){return _0x413df9['id']==_0x8423a8;});}return null;};}exports[_0xd848('0x15')]=function(_0x5ea8ef,_0x5c35e0){return respondWithRpcPromise(_0xd848('0x16'),_0x5ea8ef[_0xd848('0x17')])[_0xd848('0xa')](respondWithResult(_0x5c35e0,null))[_0xd848('0xe')](handleError(_0x5c35e0,null));};exports[_0xd848('0x18')]=function(_0xd808b3,_0x193875){return respondWithRpcPromise(_0xd848('0x19'),_[_0xd848('0x1a')](_0xd808b3[_0xd848('0x17')],_0xd808b3['params']))[_0xd848('0xa')](respondWithResult(_0x193875,null))[_0xd848('0xe')](handleError(_0x193875,null));};exports[_0xd848('0x1b')]=function(_0x2232cc,_0x10df42){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x2232cc[_0xd848('0x17')],_0x2232cc[_0xd848('0x1c')]))[_0xd848('0xa')](respondWithResult(_0x10df42,null))[_0xd848('0xe')](handleError(_0x10df42,null));};exports[_0xd848('0x1d')]=function(_0x49f2ac,_0x1c9142){return respondWithRpcPromise(_0xd848('0x1e'),_0x49f2ac[_0xd848('0x17')])[_0xd848('0xa')](respondWithResult(_0x1c9142,null))[_0xd848('0xe')](handleError(_0x1c9142,null));};exports[_0xd848('0x1f')]=function(_0x2e3a7b,_0x3e51fd){return respondWithRpcPromise('VoiceQueues',_0x2e3a7b[_0xd848('0x17')])[_0xd848('0xa')](findById(_0x2e3a7b[_0xd848('0x1c')]['id']))[_0xd848('0xa')](respondWithResult(_0x3e51fd,null))['catch'](handleError(_0x3e51fd,null));};exports[_0xd848('0x20')]=function(_0x400c98,_0x5c9b15){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xd848('0x1a')](_0x400c98[_0xd848('0x21')],_0x400c98['params']))[_0xd848('0xa')](respondWithResult(_0x5c9b15,null))[_0xd848('0xe')](handleError(_0x5c9b15,null));};exports[_0xd848('0x22')]=function(_0x169eb5,_0x27821a){return respondWithRpcPromise(_0xd848('0x23'),_[_0xd848('0x1a')](_0x169eb5[_0xd848('0x17')],_0x169eb5[_0xd848('0x1c')]))[_0xd848('0xa')](respondWithResult(_0x27821a,null))[_0xd848('0xe')](handleError(_0x27821a,null));};exports[_0xd848('0x24')]=function(_0x1a83bd,_0x4dd24f){return respondWithRpcPromise(_0xd848('0x25'),_0x1a83bd[_0xd848('0x17')])['then'](respondWithResult(_0x4dd24f,null))['catch'](handleError(_0x4dd24f,null));};exports[_0xd848('0x26')]=function(_0x2fc00a,_0x11ef6e){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x2fc00a[_0xd848('0x17')],_0x2fc00a[_0xd848('0x1c')]))[_0xd848('0xa')](respondWithResult(_0x11ef6e,null))[_0xd848('0xe')](handleError(_0x11ef6e,null));};exports['voiceQueuesChannelHangup']=function(_0x20c590,_0x2c382f){return respondWithRpcPromise(_0xd848('0x27'),_[_0xd848('0x1a')](_0x20c590[_0xd848('0x17')],_0x20c590[_0xd848('0x1c')]))[_0xd848('0xa')](respondWithResult(_0x2c382f,null))['catch'](handleError(_0x2c382f,null));};exports[_0xd848('0x28')]=function(_0x574e9f,_0x43b5b7){return respondWithRpcPromise(_0xd848('0x29'),_['merge'](_0x574e9f[_0xd848('0x17')],_0x574e9f[_0xd848('0x1c')]))['then'](respondWithResult(_0x43b5b7,null))[_0xd848('0xe')](handleError(_0x43b5b7,null));};exports[_0xd848('0x2a')]=function(_0x41d1df,_0x34c268){return respondWithRpcPromise(_0xd848('0x2b'),_0x41d1df[_0xd848('0x17')])[_0xd848('0xa')](respondWithResult(_0x34c268,null))[_0xd848('0xe')](handleError(_0x34c268,null));};exports['outboundChannels']=function(_0x39d5a6,_0x2d307a){return respondWithRpcPromise(_0xd848('0x2c'),_0x39d5a6['query'])[_0xd848('0xa')](respondWithResult(_0x2d307a,null))[_0xd848('0xe')](handleError(_0x2d307a,null));};exports[_0xd848('0x2d')]=function(_0x3f5aed,_0x20d467){var _0x2e16b7;return respondWithRpcPromise('Agents',_0x3f5aed[_0xd848('0x17')])['then'](function(_0x16060e){_0x2e16b7=_0x16060e;return respondWithRpcPromise(_0xd848('0x2e'),_0x3f5aed['query'],routingClient);})['then'](function(_0x54fdc2){return _[_0xd848('0x1a')]({},_0x54fdc2,_0x2e16b7);})[_0xd848('0xa')](respondWithResult(_0x20d467,null))['catch'](handleError(_0x20d467,null));};exports[_0xd848('0x2f')]=function(_0x50db30,_0x3b6e36){if(_0x50db30[_0xd848('0x21')]&&_0x50db30['body'][_0xd848('0x30')]&&_0x50db30[_0xd848('0x31')]&&_0x50db30[_0xd848('0x31')][_0xd848('0x11')]){for(var _0x3f50bf in _0x50db30[_0xd848('0x21')]['interaction']){if(_0x50db30[_0xd848('0x21')][_0xd848('0x30')]['hasOwnProperty'](_0x3f50bf)){db[_0xd848('0x32')][_0xd848('0x33')]({'where':{'channel':_0x3f50bf,'membername':_0x50db30[_0xd848('0x31')][_0xd848('0x11')],'type':_0xd848('0x34'),'exitAt':null,'uniqueid':_0x50db30[_0xd848('0x21')][_0xd848('0x30')][_0x3f50bf]&&_0x50db30[_0xd848('0x21')][_0xd848('0x30')][_0x3f50bf]['length']?{'$notIn':_0x50db30[_0xd848('0x21')]['interaction'][_0x3f50bf]}:{'$ne':null}}})[_0xd848('0xa')](function(_0x638857){var _0x55a4bd=moment()[_0xd848('0x35')](_0xd848('0x36'));for(var _0x2d0b9b=0x0,_0x58c523=_0x638857[_0xd848('0x37')];_0x2d0b9b<_0x58c523;_0x2d0b9b+=0x1){_0x638857[_0x2d0b9b]['updateAttributes']({'exitAt':_0x55a4bd});}});for(var _0x5ded6a=0x0;_0x5ded6a<_0x50db30[_0xd848('0x21')]['interaction'][_0x3f50bf]['length'];_0x5ded6a+=0x1){db['MemberReport'][_0xd848('0x38')]({'where':{'channel':_0x3f50bf,'membername':_0x50db30['user'][_0xd848('0x11')],'type':_0xd848('0x34'),'uniqueid':_0x50db30[_0xd848('0x21')][_0xd848('0x30')][_0x3f50bf][_0x5ded6a],'exitAt':null},'defaults':{'channel':_0x3f50bf,'membername':_0x50db30[_0xd848('0x31')][_0xd848('0x11')],'interface':_[_0xd848('0x13')](_0x50db30['user'][_0xd848('0x39')])?util['format'](_0xd848('0x3a'),_0x50db30[_0xd848('0x31')][_0xd848('0x11')]):_0x50db30[_0xd848('0x31')][_0xd848('0x39')],'type':_0xd848('0x34'),'enterAt':moment()[_0xd848('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd848('0x3b'),'internal':_0x50db30[_0xd848('0x31')][_0xd848('0x3c')],'uniqueid':_0x50db30[_0xd848('0x21')][_0xd848('0x30')][_0x3f50bf][_0x5ded6a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x50db30[_0xd848('0x1c')]['id'],'capacity':_0x50db30[_0xd848('0x21')][_0xd848('0x3d')]},routingClient)[_0xd848('0xa')](respondWithResult(_0x3b6e36,null))[_0xd848('0xe')](handleError(_0x3b6e36,null));};exports[_0xd848('0x3e')]=function(_0x1c854e,_0x52f15d){return respondWithRpcPromise('Telephones',_0x1c854e[_0xd848('0x17')])[_0xd848('0xa')](respondWithResult(_0x52f15d,null))[_0xd848('0xe')](handleError(_0x52f15d,null));};exports['trunks']=function(_0x73f514,_0x34bd20){return respondWithRpcPromise(_0xd848('0x3f'),_0x73f514['query'])[_0xd848('0xa')](respondWithResult(_0x34bd20,null))['catch'](handleError(_0x34bd20,null));};exports[_0xd848('0x40')]=function(_0x23aac6,_0x1c583c){return respondWithRpcPromise('Campaigns',_0x23aac6[_0xd848('0x17')])[_0xd848('0xa')](respondWithResult(_0x1c583c,null))[_0xd848('0xe')](handleError(_0x1c583c,null));};exports[_0xd848('0x41')]=function(_0x22b005,_0xa150ba){return respondWithRpcPromise('ChatQueues',_0x22b005[_0xd848('0x17')],routingClient)['then'](respondWithResult(_0xa150ba,null))[_0xd848('0xe')](handleError(_0xa150ba,null));};exports[_0xd848('0x42')]=function(_0x29e26a,_0x158b63){return respondWithRpcPromise(_0xd848('0x43'),_0x29e26a['query'],routingClient)[_0xd848('0xa')](findById(_0x29e26a[_0xd848('0x1c')]['id']))['then'](respondWithResult(_0x158b63,null))[_0xd848('0xe')](handleError(_0x158b63,null));};exports['mailQueues']=function(_0x157f0f,_0x32602d){return respondWithRpcPromise(_0xd848('0x44'),_0x157f0f[_0xd848('0x17')],routingClient)[_0xd848('0xa')](respondWithResult(_0x32602d,null))['catch'](handleError(_0x32602d,null));};exports['showMailQueues']=function(_0x544455,_0x480b1a){return respondWithRpcPromise(_0xd848('0x44'),_0x544455[_0xd848('0x17')],routingClient)[_0xd848('0xa')](findById(_0x544455[_0xd848('0x1c')]['id']))['then'](respondWithResult(_0x480b1a,null))[_0xd848('0xe')](handleError(_0x480b1a,null));};exports[_0xd848('0x45')]=function(_0x18afb0,_0x547fe6){return respondWithRpcPromise('MailAccounts',_0x18afb0[_0xd848('0x17')],mailClient)['then'](respondWithResult(_0x547fe6,null))[_0xd848('0xe')](handleError(_0x547fe6,null));};exports['openchannelQueues']=function(_0x2917ec,_0x556a50){return respondWithRpcPromise(_0xd848('0x46'),_0x2917ec[_0xd848('0x17')],routingClient)['then'](respondWithResult(_0x556a50,null))['catch'](handleError(_0x556a50,null));};exports['showOpenchannelQueues']=function(_0x1ab3ca,_0x182354){return respondWithRpcPromise('OpenchannelQueues',_0x1ab3ca[_0xd848('0x17')],routingClient)[_0xd848('0xa')](findById(_0x1ab3ca[_0xd848('0x1c')]['id']))[_0xd848('0xa')](respondWithResult(_0x182354,null))[_0xd848('0xe')](handleError(_0x182354,null));};exports[_0xd848('0x47')]=function(_0x3b0027,_0x5a2d2c){return respondWithRpcPromise(_0xd848('0x48'),_0x3b0027[_0xd848('0x17')],routingClient)[_0xd848('0xa')](respondWithResult(_0x5a2d2c,null))[_0xd848('0xe')](handleError(_0x5a2d2c,null));};exports[_0xd848('0x49')]=function(_0x5bc3ae,_0x122eba){return respondWithRpcPromise(_0xd848('0x48'),_0x5bc3ae[_0xd848('0x17')],routingClient)[_0xd848('0xa')](findById(_0x5bc3ae['params']['id']))['then'](respondWithResult(_0x122eba,null))['catch'](handleError(_0x122eba,null));};exports[_0xd848('0x4a')]=function(_0x2a9e8c,_0x30429c){return respondWithRpcPromise(_0xd848('0x4b'),_0x2a9e8c['query'],routingClient)['then'](respondWithResult(_0x30429c,null))[_0xd848('0xe')](handleError(_0x30429c,null));};exports[_0xd848('0x4c')]=function(_0x305834,_0x3ec9d3){return respondWithRpcPromise(_0xd848('0x4b'),_0x305834[_0xd848('0x17')],routingClient)[_0xd848('0xa')](findById(_0x305834[_0xd848('0x1c')]['id']))[_0xd848('0xa')](respondWithResult(_0x3ec9d3,null))[_0xd848('0xe')](handleError(_0x3ec9d3,null));};exports[_0xd848('0x4d')]=function(_0x53c3a2,_0x162eba){return respondWithRpcPromise(_0xd848('0x4e'),_0x53c3a2[_0xd848('0x17')],routingClient)[_0xd848('0xa')](respondWithResult(_0x162eba,null))[_0xd848('0xe')](handleError(_0x162eba,null));};exports['showFaxQueues']=function(_0x2e1328,_0x102adf){return respondWithRpcPromise('FaxQueues',_0x2e1328[_0xd848('0x17')],routingClient)['then'](findById(_0x2e1328[_0xd848('0x1c')]['id']))[_0xd848('0xa')](respondWithResult(_0x102adf,null))[_0xd848('0xe')](handleError(_0x102adf,null));};exports['faxAccounts']=function(_0x454118,_0x1a9545){return respondWithRpcPromise(_0xd848('0x4f'),_0x454118['query'])[_0xd848('0xa')](respondWithResult(_0x1a9545,null))['catch'](handleError(_0x1a9545,null));};exports[_0xd848('0x50')]=function(_0x3e4929,_0x401747){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3e4929[_0xd848('0x17')],routingClient)[_0xd848('0xa')](respondWithResult(_0x401747,null))[_0xd848('0xe')](handleError(_0x401747,null));};exports['mailQueuesWaitingInteractions']=function(_0x1e3127,_0x46ed9a){return respondWithRpcPromise(_0xd848('0x51'),_0x1e3127['query'],routingClient)[_0xd848('0xa')](respondWithResult(_0x46ed9a,null))[_0xd848('0xe')](handleError(_0x46ed9a,null));};exports[_0xd848('0x52')]=function(_0x4fd01c,_0x136d97){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4fd01c[_0xd848('0x17')],routingClient)[_0xd848('0xa')](respondWithResult(_0x136d97,null))[_0xd848('0xe')](handleError(_0x136d97,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x164db4,_0x59215b){return respondWithRpcPromise(_0xd848('0x53'),_0x164db4[_0xd848('0x17')],routingClient)[_0xd848('0xa')](function(_0x1c3563){if(_0x164db4[_0xd848('0x17')][_0xd848('0x54')]!==undefined){var _0x4ea1e3=_(_0x1c3563[_0xd848('0x14')])[_0xd848('0x55')]([_0x164db4[_0xd848('0x17')][_0xd848('0x54')],_0x164db4['params']['id']])['map']('queue_id')[_0xd848('0x56')]()[_0xd848('0x57')]();return _0x1c3563[_0xd848('0x14')][_0xd848('0x55')](function(_0x10a956){return _0x4ea1e3[_0xd848('0x58')](_0x10a956[_0xd848('0x59')])>-0x1;});}else{return _0x1c3563['rows'][_0xd848('0x55')](function(_0x5a758a){return _0x5a758a[_0xd848('0x59')]===parseInt(_0x164db4[_0xd848('0x1c')]['id']);});}})[_0xd848('0xa')](respondWithResult(_0x59215b,null))[_0xd848('0xe')](handleError(_0x59215b,null));};exports['smsQueuesWaitingInteractions']=function(_0x489c2,_0x5d8b8b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x489c2['query'],routingClient)[_0xd848('0xa')](respondWithResult(_0x5d8b8b,null))[_0xd848('0xe')](handleError(_0x5d8b8b,null));};exports[_0xd848('0x5a')]=function(_0x557267,_0x3ec9c2){return respondWithRpcPromise(_0xd848('0x5b'),_0x557267[_0xd848('0x17')],routingClient)['then'](respondWithResult(_0x3ec9c2,null))[_0xd848('0xe')](handleError(_0x3ec9c2,null));};exports[_0xd848('0x5c')]=function(_0x7b43e6,_0x2c4e24){return respondWithRpcPromise(_0xd848('0x5d'),_0x7b43e6['query'],routingClient)[_0xd848('0xa')](respondWithResult(_0x2c4e24,null))[_0xd848('0xe')](handleError(_0x2c4e24,null));};exports[_0xd848('0x5e')]=function(_0x2fc47c){return function(_0xdae202,_0x566daf){var _0x40f290,_0x167f2e;var _0x287123=_['capitalize'](_0x2fc47c);var _0x4ef5d1=_0x2fc47c===_0xd848('0x5f')?_0xd848('0x60'):_0xd848('0x61');return db[_0x287123+_0xd848('0x62')][_0xd848('0x63')]({'raw':!![],'where':{'id':_0xdae202[_0xd848('0x1c')]['id']}})['then'](function(_0x14eafc){if(_[_0xd848('0x13')](_0x14eafc)){throw new Error(_0x287123+_0xd848('0x64'));}_0x40f290=_0x14eafc;return db[_0x287123+_0xd848('0x65')][_0xd848('0x63')]({'where':{'id':_0xdae202[_0xd848('0x21')][_0xd848('0x66')]},'include':[{'model':db[_0x287123+_0xd848('0x67')],'as':_0xd848('0x67')},{'model':db[_0x287123+_0x4ef5d1],'as':_0xd848('0x61')}]});})[_0xd848('0xa')](function(_0x42b48f){if(_['isNil'](_0x42b48f)){throw new Error(_0x287123+_0xd848('0x68'));}_0x167f2e=_0x42b48f;return _0x42b48f[_0xd848('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd848('0xa')](function(){var _0x461ad3={'uniqueid':_0x2fc47c+'.'+_0x167f2e['id']+'.'+_0x167f2e[_0xd848('0x67')]['id'],'FromUserId':_0xdae202[_0xd848('0x31')]['id'],'type':_0xd848('0x6a')};_0x461ad3[_0x287123+_0xd848('0x6b')]=_0x167f2e['id'];_0x461ad3[_0x287123+'InteractionId']=_0x167f2e[_0xd848('0x67')]['id'];_0x461ad3['From'+_0x287123+_0x4ef5d1+'Id']=_0x167f2e['Account']['id'];_0x461ad3['To'+_0x287123+_0xd848('0x6c')]=_0x40f290['id'];return db[_0x287123+_0xd848('0x6d')]['create'](_0x461ad3);})['then'](function(){return respondWithRpcPromise(_0xd848('0x6e'),{'channel':_0x2fc47c,'interaction':_0x167f2e['Interaction'],'message':_0x167f2e,'account':_0x167f2e[_0xd848('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x40f290[_0xd848('0x11')]+','+(_0x167f2e['Account'][_0xd848('0x6f')]||0x12c),'interval':_0xd848('0x70')}]},routingClient);})['then'](respondWithResult(_0x566daf,null))[_0xd848('0xe')](handleError(_0x566daf,null));};};exports[_0xd848('0x71')]=function(_0x1bd467,_0x40476f){var _0x491c36,_0x3078c2;if(_[_0xd848('0x13')](_0x1bd467['body'][_0xd848('0x72')])){throw new Error(_0xd848('0x73'));}var _0x4e201a=_0x1bd467[_0xd848('0x21')][_0xd848('0x72')];var _0x48ec5b=_[_0xd848('0x74')](_0x4e201a);var _0x4073a6=_0x4e201a===_0xd848('0x5f')?'Website':_0xd848('0x61');return db[_0xd848('0x75')][_0xd848('0x63')]({'raw':!![],'where':{'id':_0x1bd467['params']['id'],'role':_0xd848('0x3b')}})[_0xd848('0xa')](function(_0x514d06){if(_[_0xd848('0x13')](_0x514d06)){throw new Error(_0xd848('0x76'));}_0x491c36=_0x514d06;return db[_0x48ec5b+_0xd848('0x65')][_0xd848('0x63')]({'where':{'id':_0x1bd467['body'][_0xd848('0x66')]},'include':[{'model':db[_0x48ec5b+_0xd848('0x67')],'as':_0xd848('0x67')},{'model':db[_0x48ec5b+_0x4073a6],'as':_0xd848('0x61')}]});})['then'](function(_0x11887f){if(_['isNil'](_0x11887f)){throw new Error(_0x48ec5b+'\x20Message\x20not\x20found');}_0x3078c2=_0x11887f;return _0x11887f[_0xd848('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5a2514={'uniqueid':_0x4e201a+'.'+_0x3078c2['id']+'.'+_0x3078c2[_0xd848('0x67')]['id'],'FromUserId':_0x1bd467[_0xd848('0x31')]['id'],'type':_0xd848('0x3b'),'ToUserId':_0x491c36['id']};_0x5a2514[_0x48ec5b+'MessageId']=_0x3078c2['id'];_0x5a2514[_0x48ec5b+_0xd848('0x77')]=_0x3078c2[_0xd848('0x67')]['id'];_0x5a2514['From'+_0x48ec5b+_0x4073a6+'Id']=_0x3078c2[_0xd848('0x61')]['id'];return db[_0x48ec5b+_0xd848('0x6d')][_0xd848('0x78')](_0x5a2514);})[_0xd848('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x4e201a,'interaction':_0x3078c2[_0xd848('0x67')],'message':_0x3078c2,'account':_0x3078c2[_0xd848('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x491c36[_0xd848('0x11')]+','+(_0x3078c2[_0xd848('0x61')][_0xd848('0x79')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd848('0xa')](respondWithResult(_0x40476f,null))[_0xd848('0xe')](handleError(_0x40476f,null));};
\ No newline at end of file
index cc243b2..4063041 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8075=['isAuthenticated','index','/:id','/:id/run','run','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get'];(function(_0x36409d,_0x563892){var _0x567b1d=function(_0x588932){while(--_0x588932){_0x36409d['push'](_0x36409d['shift']());}};_0x567b1d(++_0x563892);}(_0x8075,0x1c3));var _0x5807=function(_0x15ed4d,_0x592e47){_0x15ed4d=_0x15ed4d-0x0;var _0xda0026=_0x8075[_0x15ed4d];return _0xda0026;};'use strict';var multer=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var path=require('path');var timeout=require(_0x5807('0x2'));var express=require(_0x5807('0x3'));var router=express['Router']();var fs_extra=require(_0x5807('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5807('0x5'));var config=require(_0x5807('0x6'));var controller=require(_0x5807('0x7'));router[_0x5807('0x8')]('/',auth[_0x5807('0x9')](),controller[_0x5807('0xa')]);router['get'](_0x5807('0xb'),auth[_0x5807('0x9')](),controller['show']);router['get'](_0x5807('0xc'),auth[_0x5807('0x9')](),controller[_0x5807('0xd')]);router[_0x5807('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5807('0xf')]('/:id',auth[_0x5807('0x9')](),controller[_0x5807('0x10')]);router[_0x5807('0x11')](_0x5807('0xb'),auth['isAuthenticated'](),controller[_0x5807('0x12')]);module[_0x5807('0x13')]=router;
\ No newline at end of file
+var _0x13e6=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/run','run','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13e6,0xb7));var _0x613e=function(_0x36737f,_0x536e2a){_0x36737f=_0x36737f-0x0;var _0x4971aa=_0x13e6[_0x36737f];return _0x4971aa;};'use strict';var multer=require(_0x613e('0x0'));var util=require('util');var path=require(_0x613e('0x1'));var timeout=require(_0x613e('0x2'));var express=require(_0x613e('0x3'));var router=express[_0x613e('0x4')]();var fs_extra=require(_0x613e('0x5'));var auth=require(_0x613e('0x6'));var interaction=require(_0x613e('0x7'));var config=require(_0x613e('0x8'));var controller=require('./schedule.controller');router[_0x613e('0x9')]('/',auth[_0x613e('0xa')](),controller['index']);router[_0x613e('0x9')]('/:id',auth[_0x613e('0xa')](),controller[_0x613e('0xb')]);router[_0x613e('0x9')](_0x613e('0xc'),auth[_0x613e('0xa')](),controller[_0x613e('0xd')]);router['post']('/',auth[_0x613e('0xa')](),controller[_0x613e('0xe')]);router[_0x613e('0xf')](_0x613e('0x10'),auth['isAuthenticated'](),controller[_0x613e('0x11')]);router[_0x613e('0x12')](_0x613e('0x10'),auth[_0x613e('0xa')](),controller[_0x613e('0x13')]);module[_0x613e('0x14')]=router;
\ No newline at end of file
index fd8d106..782a0d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf357=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','months','weeks','minutes','days','csv','custom','default','TEXT','exports'];(function(_0x56fd29,_0x17790b){var _0x2a0bf7=function(_0x568f20){while(--_0x568f20){_0x56fd29['push'](_0x56fd29['shift']());}};_0x2a0bf7(++_0x17790b);}(_0xf357,0x1df));var _0x7f35=function(_0x3e5b60,_0x15a41e){_0x3e5b60=_0x3e5b60-0x0;var _0x3e53e0=_0xf357[_0x3e5b60];return _0x3e53e0;};'use strict';var Sequelize=require('sequelize');module[_0x7f35('0x0')]={'name':{'type':Sequelize[_0x7f35('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7f35('0x1')]},'active':{'type':Sequelize[_0x7f35('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7f35('0x1')],'allowNull':![],'defaultValue':_0x7f35('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7f35('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7f35('0x5')](_0x7f35('0x6'),'quarters',_0x7f35('0x7'),_0x7f35('0x8'),'days','hours',_0x7f35('0x9')),'allowNull':![],'defaultValue':_0x7f35('0xa')},'output':{'type':Sequelize[_0x7f35('0x5')](_0x7f35('0xb'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x7f35('0xb')},'type':{'type':Sequelize[_0x7f35('0x5')](_0x7f35('0xc'),_0x7f35('0xd')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x7f35('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x7f35('0x1')]},'cc':{'type':Sequelize[_0x7f35('0xe')]},'bcc':{'type':Sequelize[_0x7f35('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x7f35('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xaa16=['INTEGER','ENUM','quarters','weeks','days','hours','csv','pdf','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0xbea629,_0x1b0d08){var _0x200187=function(_0x49da77){while(--_0x49da77){_0xbea629['push'](_0xbea629['shift']());}};_0x200187(++_0x1b0d08);}(_0xaa16,0x14e));var _0x6aa1=function(_0x482dde,_0x526bd4){_0x482dde=_0x482dde-0x0;var _0x353008=_0xaa16[_0x482dde];return _0x353008;};'use strict';var Sequelize=require(_0x6aa1('0x0'));module[_0x6aa1('0x1')]={'name':{'type':Sequelize[_0x6aa1('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6aa1('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6aa1('0x2')],'allowNull':![],'defaultValue':_0x6aa1('0x4')},'startAt':{'type':Sequelize[_0x6aa1('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6aa1('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6aa1('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6aa1('0x7')]('years',_0x6aa1('0x8'),'months',_0x6aa1('0x9'),_0x6aa1('0xa'),_0x6aa1('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x6aa1('0xa')},'output':{'type':Sequelize[_0x6aa1('0x7')](_0x6aa1('0xc'),_0x6aa1('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x6aa1('0xc')},'type':{'type':Sequelize[_0x6aa1('0x7')]('custom',_0x6aa1('0xe')),'allowNull':![],'defaultValue':_0x6aa1('0xf')},'sendMail':{'type':Sequelize[_0x6aa1('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6aa1('0x2')]},'cc':{'type':Sequelize[_0x6aa1('0x10')]},'bcc':{'type':Sequelize[_0x6aa1('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x6aa1('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 453d33f..e589751 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfba=['rows','show','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','squel','crypto','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','end','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','map','Schedule','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x485e4c,_0x31c528){var _0x37dc9d=function(_0x5e0c0e){while(--_0x5e0c0e){_0x485e4c['push'](_0x485e4c['shift']());}};_0x37dc9d(++_0x31c528);}(_0xbfba,0x66));var _0xabfb=function(_0x5548ca,_0x15a18e){_0x5548ca=_0x5548ca-0x0;var _0x5d8b05=_0xbfba[_0x5548ca];return _0x5d8b05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabfb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabfb('0x1'));var rp=require(_0xabfb('0x2'));var moment=require(_0xabfb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xabfb('0x4'));var util=require(_0xabfb('0x5'));var path=require('path');var sox=require(_0xabfb('0x6'));var csv=require('to-csv');var ejs=require(_0xabfb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabfb('0x8'));var crypto=require(_0xabfb('0x9'));var jsforce=require(_0xabfb('0xa'));var deskjs=require(_0xabfb('0xb'));var toCsv=require(_0xabfb('0xc'));var querystring=require(_0xabfb('0xd'));var Papa=require(_0xabfb('0xe'));var Redis=require(_0xabfb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xabfb('0x10'));var as=require(_0xabfb('0x11'));var hardwareService=require(_0xabfb('0x12'));var logger=require(_0xabfb('0x13'))(_0xabfb('0x14'));var utils=require('../../config/utils');var config=require(_0xabfb('0x15'));var licenseUtil=require(_0xabfb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b6d5a,_0x20a429){_0x20a429=_0x20a429||0xcc;return function(_0x1791b6){if(_0x1791b6){return _0x3b6d5a['sendStatus'](_0x20a429);}return _0x3b6d5a['status'](_0x20a429)[_0xabfb('0x17')]();};}function respondWithResult(_0x4a69b6,_0x124e6e){_0x124e6e=_0x124e6e||0xc8;return function(_0x26ab16){if(_0x26ab16){return _0x4a69b6[_0xabfb('0x18')](_0x124e6e)[_0xabfb('0x19')](_0x26ab16);}};}function respondWithFilteredResult(_0xc1b688,_0x3631f1){return function(_0x1ed94b){if(_0x1ed94b){var _0x3f289c=typeof _0x3631f1['offset']===_0xabfb('0x1a')&&typeof _0x3631f1[_0xabfb('0x1b')]===_0xabfb('0x1a');var _0x2e3e5f=_0x1ed94b[_0xabfb('0x1c')];var _0x5cdb0d=_0x3f289c?0x0:_0x3631f1[_0xabfb('0x1d')];var _0xaad8d9=_0x3f289c?_0x1ed94b[_0xabfb('0x1c')]:_0x3631f1[_0xabfb('0x1d')]+_0x3631f1[_0xabfb('0x1b')];var _0x4234ea;if(_0xaad8d9>=_0x2e3e5f){_0xaad8d9=_0x2e3e5f;_0x4234ea=0xc8;}else{_0x4234ea=0xce;}_0xc1b688[_0xabfb('0x18')](_0x4234ea);return _0xc1b688['set']('Content-Range',_0x5cdb0d+'-'+_0xaad8d9+'/'+_0x2e3e5f)['json'](_0x1ed94b);}return null;};}function patchUpdates(_0x5983cc){return function(_0x340bb2){try{jsonpatch[_0xabfb('0x1e')](_0x340bb2,_0x5983cc,!![]);}catch(_0x2f4c6e){return BPromise[_0xabfb('0x1f')](_0x2f4c6e);}return _0x340bb2[_0xabfb('0x20')]();};}function saveUpdates(_0xf216d9,_0x2b7248){return function(_0x3b4174){if(_0x3b4174){return _0x3b4174[_0xabfb('0x21')](_0xf216d9)[_0xabfb('0x22')](function(_0x37a2b0){return _0x37a2b0;});}return null;};}function removeEntity(_0x28c228,_0x1cf797){return function(_0x28afce){if(_0x28afce){return _0x28afce[_0xabfb('0x23')]()[_0xabfb('0x22')](function(){var _0x5b47dc=_0x28afce[_0xabfb('0x24')]({'plain':!![]});var _0x4b1773=_0xabfb('0x25');return db[_0xabfb('0x26')][_0xabfb('0x23')]({'where':{'type':_0x4b1773,'resourceId':_0x5b47dc['id']}})['then'](function(){return _0x28afce;});})[_0xabfb('0x22')](function(){_0x28c228[_0xabfb('0x18')](0xcc)[_0xabfb('0x17')]();});}};}function handleEntityNotFound(_0x2b1fd1,_0x250b59){return function(_0x29916a){if(!_0x29916a){_0x2b1fd1[_0xabfb('0x27')](0x194);}return _0x29916a;};}function handleError(_0x5cea3d,_0x59a8eb){_0x59a8eb=_0x59a8eb||0x1f4;return function(_0x300adb){logger[_0xabfb('0x28')](_0x300adb[_0xabfb('0x29')]);if(_0x300adb[_0xabfb('0x2a')]){delete _0x300adb['name'];}_0x5cea3d[_0xabfb('0x18')](_0x59a8eb)[_0xabfb('0x2b')](_0x300adb);};}exports['index']=function(_0x1c205f,_0x3a8dba){var _0x625cfc={},_0x133395={},_0x204840={'count':0x0,'rows':[]};var _0x4e57a1=_[_0xabfb('0x2c')](db[_0xabfb('0x2d')]['rawAttributes'],function(_0x29740c){return{'name':_0x29740c[_0xabfb('0x2e')],'type':_0x29740c[_0xabfb('0x2f')][_0xabfb('0x30')]};});_0x133395[_0xabfb('0x31')]=_[_0xabfb('0x2c')](_0x4e57a1,'name');_0x133395[_0xabfb('0x32')]=_[_0xabfb('0x33')](_0x1c205f['query']);_0x133395[_0xabfb('0x34')]=_[_0xabfb('0x35')](_0x133395[_0xabfb('0x31')],_0x133395['query']);_0x625cfc[_0xabfb('0x36')]=_[_0xabfb('0x35')](_0x133395[_0xabfb('0x31')],qs[_0xabfb('0x37')](_0x1c205f[_0xabfb('0x32')][_0xabfb('0x37')]));_0x625cfc['attributes']=_0x625cfc[_0xabfb('0x36')][_0xabfb('0x38')]?_0x625cfc[_0xabfb('0x36')]:_0x133395['model'];if(!_0x1c205f[_0xabfb('0x32')][_0xabfb('0x39')](_0xabfb('0x3a'))){_0x625cfc[_0xabfb('0x1b')]=qs[_0xabfb('0x1b')](_0x1c205f['query'][_0xabfb('0x1b')]);_0x625cfc[_0xabfb('0x1d')]=qs[_0xabfb('0x1d')](_0x1c205f[_0xabfb('0x32')]['offset']);}_0x625cfc[_0xabfb('0x3b')]=qs[_0xabfb('0x3c')](_0x1c205f[_0xabfb('0x32')][_0xabfb('0x3c')]);_0x625cfc[_0xabfb('0x3d')]=qs[_0xabfb('0x34')](_[_0xabfb('0x3e')](_0x1c205f[_0xabfb('0x32')],_0x133395[_0xabfb('0x34')]),_0x4e57a1);if(_0x1c205f[_0xabfb('0x32')][_0xabfb('0x3f')]){_0x625cfc['where']=_['merge'](_0x625cfc[_0xabfb('0x3d')],{'$or':_['map'](_0x4e57a1,function(_0x56c554){if(_0x56c554[_0xabfb('0x2f')]!==_0xabfb('0x40')){var _0x49323b={};_0x49323b[_0x56c554['name']]={'$like':'%'+_0x1c205f[_0xabfb('0x32')][_0xabfb('0x3f')]+'%'};return _0x49323b;}})});}_0x625cfc=_[_0xabfb('0x41')]({},_0x625cfc,_0x1c205f[_0xabfb('0x42')]);var _0x2b95c4={'where':_0x625cfc[_0xabfb('0x3d')]};return db[_0xabfb('0x2d')][_0xabfb('0x1c')](_0x2b95c4)[_0xabfb('0x22')](function(_0x2d2cf1){_0x204840[_0xabfb('0x1c')]=_0x2d2cf1;if(_0x1c205f['query'][_0xabfb('0x43')]){_0x625cfc[_0xabfb('0x44')]=[{'all':!![]}];}return db[_0xabfb('0x2d')][_0xabfb('0x45')](_0x625cfc);})['then'](function(_0x115787){_0x204840[_0xabfb('0x46')]=_0x115787;return _0x204840;})[_0xabfb('0x22')](respondWithFilteredResult(_0x3a8dba,_0x625cfc))['catch'](handleError(_0x3a8dba,null));};exports[_0xabfb('0x47')]=function(_0x106870,_0x40f286){var _0x386b2c={'raw':![],'where':{'id':_0x106870['params']['id']}},_0x5d1ebe={};_0x5d1ebe[_0xabfb('0x31')]=_['keys'](db['Schedule']['rawAttributes']);_0x5d1ebe['query']=_[_0xabfb('0x33')](_0x106870['query']);_0x5d1ebe['filters']=_[_0xabfb('0x35')](_0x5d1ebe[_0xabfb('0x31')],_0x5d1ebe[_0xabfb('0x32')]);_0x386b2c[_0xabfb('0x36')]=_[_0xabfb('0x35')](_0x5d1ebe[_0xabfb('0x31')],qs['fields'](_0x106870[_0xabfb('0x32')][_0xabfb('0x37')]));_0x386b2c[_0xabfb('0x36')]=_0x386b2c[_0xabfb('0x36')][_0xabfb('0x38')]?_0x386b2c['attributes']:_0x5d1ebe[_0xabfb('0x31')];if(_0x106870[_0xabfb('0x32')]['includeAll']){_0x386b2c['include']=[{'all':!![]}];}_0x386b2c=_[_0xabfb('0x41')]({},_0x386b2c,_0x106870[_0xabfb('0x42')]);return db[_0xabfb('0x2d')][_0xabfb('0x48')](_0x386b2c)['then'](handleEntityNotFound(_0x40f286,null))[_0xabfb('0x22')](respondWithResult(_0x40f286,null))[_0xabfb('0x49')](handleError(_0x40f286,null));};exports['create']=function(_0x198f4d,_0x2a9aeb){return db['Schedule'][_0xabfb('0x4a')](_0x198f4d['body'],{})['then'](function(_0x5dfd95){var _0x3e0094=_0x198f4d['user'][_0xabfb('0x24')]({'plain':!![]});if(!_0x3e0094)throw new Error(_0xabfb('0x4b'));if(_0x3e0094[_0xabfb('0x4c')]===_0xabfb('0x4d')){var _0x1d2b64=_0x5dfd95[_0xabfb('0x24')]({'plain':!![]});var _0x350205=_0xabfb('0x25');return db[_0xabfb('0x4e')][_0xabfb('0x48')]({'where':{'name':_0x350205,'userProfileId':_0x3e0094[_0xabfb('0x4f')]},'raw':!![]})[_0xabfb('0x22')](function(_0x12a906){if(_0x12a906&&_0x12a906[_0xabfb('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d2b64[_0xabfb('0x2a')],'resourceId':_0x1d2b64['id'],'type':_0x12a906['name'],'sectionId':_0x12a906['id']},{})[_0xabfb('0x22')](function(){return _0x5dfd95;});}else{return _0x5dfd95;}})[_0xabfb('0x49')](function(_0xbb49b0){logger[_0xabfb('0x28')](_0xabfb('0x51'),_0xbb49b0);throw _0xbb49b0;});}return _0x5dfd95;})['then'](respondWithResult(_0x2a9aeb,0xc9))['catch'](handleError(_0x2a9aeb,null));};exports[_0xabfb('0x21')]=function(_0x5814f1,_0x332a22){if(_0x5814f1[_0xabfb('0x52')]['id']){delete _0x5814f1[_0xabfb('0x52')]['id'];}return db[_0xabfb('0x2d')]['find']({'where':{'id':_0x5814f1[_0xabfb('0x53')]['id']}})['then'](handleEntityNotFound(_0x332a22,null))[_0xabfb('0x22')](saveUpdates(_0x5814f1[_0xabfb('0x52')],null))[_0xabfb('0x22')](respondWithResult(_0x332a22,null))[_0xabfb('0x49')](handleError(_0x332a22,null));};exports[_0xabfb('0x23')]=function(_0x1b215c,_0x32dcc7){return db[_0xabfb('0x2d')][_0xabfb('0x48')]({'where':{'id':_0x1b215c['params']['id']}})[_0xabfb('0x22')](handleEntityNotFound(_0x32dcc7,null))[_0xabfb('0x22')](removeEntity(_0x32dcc7,null))['catch'](handleError(_0x32dcc7,null));};exports[_0xabfb('0x54')]=function(_0x3e89f9,_0x12d576,_0xbddc81){var _0x453d12=require(_0xabfb('0x55'));return db[_0xabfb('0x2d')][_0xabfb('0x48')]({'where':{'id':_0x3e89f9[_0xabfb('0x53')]['id']},'raw':!![]})[_0xabfb('0x22')](handleEntityNotFound(_0x12d576,null))[_0xabfb('0x22')](function(){_0x453d12[_0xabfb('0x54')](_0x3e89f9[_0xabfb('0x53')]['id']);})['then'](respondWithStatusCode(_0x12d576,null))['catch'](handleError(_0x12d576,null));};
\ No newline at end of file
+var _0x09d9=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','run','../../config/schedule','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Scheduler','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x09d9,0x17b));var _0x909d=function(_0x48da68,_0x132675){_0x48da68=_0x48da68-0x0;var _0x512f87=_0x09d9[_0x48da68];return _0x512f87;};'use strict';var emlformat=require(_0x909d('0x0'));var rimraf=require(_0x909d('0x1'));var zipdir=require(_0x909d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x909d('0x3'));var BPromise=require(_0x909d('0x4'));var Mustache=require(_0x909d('0x5'));var util=require(_0x909d('0x6'));var path=require(_0x909d('0x7'));var sox=require(_0x909d('0x8'));var csv=require(_0x909d('0x9'));var ejs=require(_0x909d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x909d('0xb'));var squel=require(_0x909d('0xc'));var crypto=require(_0x909d('0xd'));var jsforce=require(_0x909d('0xe'));var deskjs=require(_0x909d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x909d('0x10'));var Papa=require(_0x909d('0x11'));var Redis=require(_0x909d('0x12'));var authService=require(_0x909d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x909d('0x14'));var hardwareService=require(_0x909d('0x15'));var logger=require('../../config/logger')(_0x909d('0x16'));var utils=require(_0x909d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x909d('0x18'));var db=require(_0x909d('0x19'))['db'];function respondWithStatusCode(_0x13f079,_0xff6541){_0xff6541=_0xff6541||0xcc;return function(_0x69e291){if(_0x69e291){return _0x13f079[_0x909d('0x1a')](_0xff6541);}return _0x13f079[_0x909d('0x1b')](_0xff6541)[_0x909d('0x1c')]();};}function respondWithResult(_0x28a818,_0x28672b){_0x28672b=_0x28672b||0xc8;return function(_0x5dc5bf){if(_0x5dc5bf){return _0x28a818['status'](_0x28672b)[_0x909d('0x1d')](_0x5dc5bf);}};}function respondWithFilteredResult(_0x3c4471,_0x36ae23){return function(_0x4157e7){if(_0x4157e7){var _0x380eea=typeof _0x36ae23[_0x909d('0x1e')]===_0x909d('0x1f')&&typeof _0x36ae23['limit']==='undefined';var _0x1156df=_0x4157e7[_0x909d('0x20')];var _0x1caead=_0x380eea?0x0:_0x36ae23[_0x909d('0x1e')];var _0x57e7ec=_0x380eea?_0x4157e7['count']:_0x36ae23[_0x909d('0x1e')]+_0x36ae23[_0x909d('0x21')];var _0x10fab1;if(_0x57e7ec>=_0x1156df){_0x57e7ec=_0x1156df;_0x10fab1=0xc8;}else{_0x10fab1=0xce;}_0x3c4471[_0x909d('0x1b')](_0x10fab1);return _0x3c4471[_0x909d('0x22')](_0x909d('0x23'),_0x1caead+'-'+_0x57e7ec+'/'+_0x1156df)[_0x909d('0x1d')](_0x4157e7);}return null;};}function patchUpdates(_0x5242a1){return function(_0x87afd2){try{jsonpatch[_0x909d('0x24')](_0x87afd2,_0x5242a1,!![]);}catch(_0x1ea538){return BPromise[_0x909d('0x25')](_0x1ea538);}return _0x87afd2[_0x909d('0x26')]();};}function saveUpdates(_0x213cb7,_0xfb3ebf){return function(_0x291a89){if(_0x291a89){return _0x291a89[_0x909d('0x27')](_0x213cb7)[_0x909d('0x28')](function(_0x290424){return _0x290424;});}return null;};}function removeEntity(_0x53cff3,_0x3db4db){return function(_0xdbd7cc){if(_0xdbd7cc){return _0xdbd7cc[_0x909d('0x29')]()['then'](function(){var _0x5335cc=_0xdbd7cc['get']({'plain':!![]});var _0x4c7ec6=_0x909d('0x2a');return db['UserProfileResource'][_0x909d('0x29')]({'where':{'type':_0x4c7ec6,'resourceId':_0x5335cc['id']}})[_0x909d('0x28')](function(){return _0xdbd7cc;});})[_0x909d('0x28')](function(){_0x53cff3[_0x909d('0x1b')](0xcc)[_0x909d('0x1c')]();});}};}function handleEntityNotFound(_0x3ad3d9,_0x3c0bb7){return function(_0x13c89c){if(!_0x13c89c){_0x3ad3d9[_0x909d('0x1a')](0x194);}return _0x13c89c;};}function handleError(_0x6ee159,_0x1292e3){_0x1292e3=_0x1292e3||0x1f4;return function(_0x206da4){logger[_0x909d('0x2b')](_0x206da4[_0x909d('0x2c')]);if(_0x206da4[_0x909d('0x2d')]){delete _0x206da4[_0x909d('0x2d')];}_0x6ee159['status'](_0x1292e3)[_0x909d('0x2e')](_0x206da4);};}exports[_0x909d('0x2f')]=function(_0x234b24,_0x13eb33){var _0x1b926a={},_0x2aada9={},_0x14585e={'count':0x0,'rows':[]};var _0x270049=_[_0x909d('0x30')](db[_0x909d('0x31')][_0x909d('0x32')],function(_0x173a78){return{'name':_0x173a78[_0x909d('0x33')],'type':_0x173a78[_0x909d('0x34')]['key']};});_0x2aada9[_0x909d('0x35')]=_[_0x909d('0x30')](_0x270049,'name');_0x2aada9[_0x909d('0x36')]=_[_0x909d('0x37')](_0x234b24['query']);_0x2aada9[_0x909d('0x38')]=_[_0x909d('0x39')](_0x2aada9[_0x909d('0x35')],_0x2aada9['query']);_0x1b926a[_0x909d('0x3a')]=_[_0x909d('0x39')](_0x2aada9[_0x909d('0x35')],qs[_0x909d('0x3b')](_0x234b24['query']['fields']));_0x1b926a[_0x909d('0x3a')]=_0x1b926a[_0x909d('0x3a')][_0x909d('0x3c')]?_0x1b926a[_0x909d('0x3a')]:_0x2aada9[_0x909d('0x35')];if(!_0x234b24[_0x909d('0x36')][_0x909d('0x3d')](_0x909d('0x3e'))){_0x1b926a['limit']=qs[_0x909d('0x21')](_0x234b24[_0x909d('0x36')]['limit']);_0x1b926a['offset']=qs[_0x909d('0x1e')](_0x234b24[_0x909d('0x36')][_0x909d('0x1e')]);}_0x1b926a[_0x909d('0x3f')]=qs[_0x909d('0x40')](_0x234b24[_0x909d('0x36')]['sort']);_0x1b926a[_0x909d('0x41')]=qs[_0x909d('0x38')](_[_0x909d('0x42')](_0x234b24[_0x909d('0x36')],_0x2aada9[_0x909d('0x38')]),_0x270049);if(_0x234b24[_0x909d('0x36')][_0x909d('0x43')]){_0x1b926a[_0x909d('0x41')]=_[_0x909d('0x44')](_0x1b926a[_0x909d('0x41')],{'$or':_[_0x909d('0x30')](_0x270049,function(_0x710296){if(_0x710296[_0x909d('0x34')]!==_0x909d('0x45')){var _0x5e41fd={};_0x5e41fd[_0x710296[_0x909d('0x2d')]]={'$like':'%'+_0x234b24['query'][_0x909d('0x43')]+'%'};return _0x5e41fd;}})});}_0x1b926a=_['merge']({},_0x1b926a,_0x234b24[_0x909d('0x46')]);var _0x304b99={'where':_0x1b926a[_0x909d('0x41')]};return db['Schedule'][_0x909d('0x20')](_0x304b99)['then'](function(_0x30bf32){_0x14585e[_0x909d('0x20')]=_0x30bf32;if(_0x234b24[_0x909d('0x36')][_0x909d('0x47')]){_0x1b926a[_0x909d('0x48')]=[{'all':!![]}];}return db[_0x909d('0x31')][_0x909d('0x49')](_0x1b926a);})[_0x909d('0x28')](function(_0x57f122){_0x14585e['rows']=_0x57f122;return _0x14585e;})['then'](respondWithFilteredResult(_0x13eb33,_0x1b926a))[_0x909d('0x4a')](handleError(_0x13eb33,null));};exports[_0x909d('0x4b')]=function(_0x15e63b,_0x3a0639){var _0x3280a1={'raw':![],'where':{'id':_0x15e63b[_0x909d('0x4c')]['id']}},_0x2defca={};_0x2defca[_0x909d('0x35')]=_['keys'](db[_0x909d('0x31')][_0x909d('0x32')]);_0x2defca['query']=_[_0x909d('0x37')](_0x15e63b[_0x909d('0x36')]);_0x2defca[_0x909d('0x38')]=_[_0x909d('0x39')](_0x2defca[_0x909d('0x35')],_0x2defca[_0x909d('0x36')]);_0x3280a1[_0x909d('0x3a')]=_[_0x909d('0x39')](_0x2defca['model'],qs[_0x909d('0x3b')](_0x15e63b[_0x909d('0x36')]['fields']));_0x3280a1['attributes']=_0x3280a1[_0x909d('0x3a')][_0x909d('0x3c')]?_0x3280a1['attributes']:_0x2defca['model'];if(_0x15e63b[_0x909d('0x36')][_0x909d('0x47')]){_0x3280a1[_0x909d('0x48')]=[{'all':!![]}];}_0x3280a1=_[_0x909d('0x44')]({},_0x3280a1,_0x15e63b[_0x909d('0x46')]);return db['Schedule']['find'](_0x3280a1)[_0x909d('0x28')](handleEntityNotFound(_0x3a0639,null))['then'](respondWithResult(_0x3a0639,null))['catch'](handleError(_0x3a0639,null));};exports['create']=function(_0x232bda,_0x55efe8){return db[_0x909d('0x31')][_0x909d('0x4d')](_0x232bda['body'],{})[_0x909d('0x28')](function(_0x1de8bb){var _0x112158=_0x232bda[_0x909d('0x4e')]['get']({'plain':!![]});if(!_0x112158)throw new Error(_0x909d('0x4f'));if(_0x112158[_0x909d('0x50')]===_0x909d('0x4e')){var _0x5edf9f=_0x1de8bb['get']({'plain':!![]});var _0x54453a=_0x909d('0x2a');return db[_0x909d('0x51')]['find']({'where':{'name':_0x54453a,'userProfileId':_0x112158['userProfileId']},'raw':!![]})[_0x909d('0x28')](function(_0x435aad){if(_0x435aad&&_0x435aad[_0x909d('0x52')]===0x0){return db[_0x909d('0x53')][_0x909d('0x4d')]({'name':_0x5edf9f[_0x909d('0x2d')],'resourceId':_0x5edf9f['id'],'type':_0x435aad['name'],'sectionId':_0x435aad['id']},{})[_0x909d('0x28')](function(){return _0x1de8bb;});}else{return _0x1de8bb;}})['catch'](function(_0x35f45c){logger[_0x909d('0x2b')](_0x909d('0x54'),_0x35f45c);throw _0x35f45c;});}return _0x1de8bb;})[_0x909d('0x28')](respondWithResult(_0x55efe8,0xc9))[_0x909d('0x4a')](handleError(_0x55efe8,null));};exports[_0x909d('0x27')]=function(_0x27ab14,_0x4233fb){if(_0x27ab14[_0x909d('0x55')]['id']){delete _0x27ab14[_0x909d('0x55')]['id'];}return db[_0x909d('0x31')][_0x909d('0x56')]({'where':{'id':_0x27ab14[_0x909d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4233fb,null))['then'](saveUpdates(_0x27ab14[_0x909d('0x55')],null))[_0x909d('0x28')](respondWithResult(_0x4233fb,null))[_0x909d('0x4a')](handleError(_0x4233fb,null));};exports['destroy']=function(_0x11fa5f,_0x24d2c7){return db[_0x909d('0x31')]['find']({'where':{'id':_0x11fa5f[_0x909d('0x4c')]['id']}})[_0x909d('0x28')](handleEntityNotFound(_0x24d2c7,null))[_0x909d('0x28')](removeEntity(_0x24d2c7,null))[_0x909d('0x4a')](handleError(_0x24d2c7,null));};exports[_0x909d('0x57')]=function(_0x4fd860,_0x3a1ffa,_0x3e84f4){var _0x13c22a=require(_0x909d('0x58'));return db[_0x909d('0x31')][_0x909d('0x56')]({'where':{'id':_0x4fd860['params']['id']},'raw':!![]})[_0x909d('0x28')](handleEntityNotFound(_0x3a1ffa,null))[_0x909d('0x28')](function(){_0x13c22a[_0x909d('0x57')](_0x4fd860[_0x909d('0x4c')]['id']);})[_0x909d('0x28')](respondWithStatusCode(_0x3a1ffa,null))[_0x909d('0x4a')](handleError(_0x3a1ffa,null));};
\ No newline at end of file
index bc1d795..94479ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x533e=['define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./schedule.attributes'];(function(_0x389618,_0x28254a){var _0x45076c=function(_0x469fe9){while(--_0x469fe9){_0x389618['push'](_0x389618['shift']());}};_0x45076c(++_0x28254a);}(_0x533e,0xf3));var _0xe533=function(_0x290a39,_0x4b5d49){_0x290a39=_0x290a39-0x0;var _0x1c989c=_0x533e[_0x290a39];return _0x1c989c;};'use strict';var _=require(_0xe533('0x0'));var util=require(_0xe533('0x1'));var logger=require(_0xe533('0x2'))(_0xe533('0x3'));var moment=require(_0xe533('0x4'));var BPromise=require(_0xe533('0x5'));var rp=require(_0xe533('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe533('0x7'));var config=require('../../config/environment');var attributes=require(_0xe533('0x8'));module['exports']=function(_0x379643,_0x574de3){return _0x379643[_0xe533('0x9')](_0xe533('0xa'),attributes,{'tableName':_0xe533('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x05af=['api','moment','request-promise','rimraf','../../config/environment','./schedule.attributes','Schedule','tools_schedules','lodash'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x05af,0x11f));var _0xf05a=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0x05af[_0x210603];return _0x1bcb7d;};'use strict';var _=require(_0xf05a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf05a('0x1'));var moment=require(_0xf05a('0x2'));var BPromise=require('bluebird');var rp=require(_0xf05a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf05a('0x4'));var config=require(_0xf05a('0x5'));var attributes=require(_0xf05a('0x6'));module['exports']=function(_0x32b841,_0x481516){return _0x32b841['define'](_0xf05a('0x7'),attributes,{'tableName':_0xf05a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfaa299..4dd0e68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5fb=['request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Schedule,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info'];(function(_0x1e0bfd,_0x1e84a4){var _0x15c28d=function(_0x45c2ae){while(--_0x45c2ae){_0x1e0bfd['push'](_0x1e0bfd['shift']());}};_0x15c28d(++_0x1e84a4);}(_0xc5fb,0x1be));var _0xbc5f=function(_0x245772,_0x2c0818){_0x245772=_0x245772-0x0;var _0x1a1c3b=_0xc5fb[_0x245772];return _0x1a1c3b;};'use strict';var _=require(_0xbc5f('0x0'));var util=require(_0xbc5f('0x1'));var moment=require(_0xbc5f('0x2'));var BPromise=require(_0xbc5f('0x3'));var rs=require(_0xbc5f('0x4'));var fs=require('fs');var Redis=require(_0xbc5f('0x5'));var db=require(_0xbc5f('0x6'))['db'];var utils=require(_0xbc5f('0x7'));var logger=require(_0xbc5f('0x8'))(_0xbc5f('0x9'));var config=require(_0xbc5f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbc5f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x169847,_0x17d9e9,_0x3c2307){return new BPromise(function(_0x3da58f,_0x2e7907){return client['request'](_0x169847,_0x3c2307)[_0xbc5f('0xc')](function(_0x53e896){logger[_0xbc5f('0xd')]('Schedule,\x20%s,\x20%s',_0x17d9e9,_0xbc5f('0xe'));logger[_0xbc5f('0xf')](_0xbc5f('0x10'),_0x17d9e9,_0xbc5f('0xe'),JSON[_0xbc5f('0x11')](_0x53e896));if(_0x53e896[_0xbc5f('0x12')]){if(_0x53e896[_0xbc5f('0x12')][_0xbc5f('0x13')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x17d9e9,_0x53e896[_0xbc5f('0x12')]['message']);return _0x2e7907(_0x53e896[_0xbc5f('0x12')][_0xbc5f('0x14')]);}logger['error'](_0xbc5f('0x15'),_0x17d9e9,_0x53e896[_0xbc5f('0x12')][_0xbc5f('0x14')]);return _0x3da58f(_0x53e896[_0xbc5f('0x12')][_0xbc5f('0x14')]);}else{logger[_0xbc5f('0xd')](_0xbc5f('0x15'),_0x17d9e9,'request\x20sent');_0x3da58f(_0x53e896[_0xbc5f('0x16')][_0xbc5f('0x14')]);}})['catch'](function(_0x455b4d){logger['error'](_0xbc5f('0x15'),_0x17d9e9,_0x455b4d);_0x2e7907(_0x455b4d);});});}
\ No newline at end of file
+var _0x020d=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util'];(function(_0x110a5c,_0x20f430){var _0x23acf0=function(_0xf1c8cf){while(--_0xf1c8cf){_0x110a5c['push'](_0x110a5c['shift']());}};_0x23acf0(++_0x20f430);}(_0x020d,0x1ca));var _0xd020=function(_0xd82dae,_0x26e304){_0xd82dae=_0xd82dae-0x0;var _0x21a388=_0x020d[_0xd82dae];return _0x21a388;};'use strict';var _=require(_0xd020('0x0'));var util=require(_0xd020('0x1'));var moment=require('moment');var BPromise=require(_0xd020('0x2'));var rs=require(_0xd020('0x3'));var fs=require('fs');var Redis=require(_0xd020('0x4'));var db=require(_0xd020('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd020('0x6'));var config=require('../../config/environment');var jayson=require(_0xd020('0x7'));var client=jayson[_0xd020('0x8')][_0xd020('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f84d2,_0x54c8b0,_0x3bc43f){return new BPromise(function(_0x52ee57,_0x31b0d7){return client[_0xd020('0xa')](_0x1f84d2,_0x3bc43f)['then'](function(_0x183e40){logger['info'](_0xd020('0xb'),_0x54c8b0,_0xd020('0xc'));logger[_0xd020('0xd')](_0xd020('0xe'),_0x54c8b0,_0xd020('0xc'),JSON[_0xd020('0xf')](_0x183e40));if(_0x183e40[_0xd020('0x10')]){if(_0x183e40[_0xd020('0x10')][_0xd020('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x54c8b0,_0x183e40['error'][_0xd020('0x12')]);return _0x31b0d7(_0x183e40['error']['message']);}logger[_0xd020('0x10')](_0xd020('0xb'),_0x54c8b0,_0x183e40[_0xd020('0x10')]['message']);return _0x52ee57(_0x183e40[_0xd020('0x10')][_0xd020('0x12')]);}else{logger[_0xd020('0x13')](_0xd020('0xb'),_0x54c8b0,_0xd020('0xc'));_0x52ee57(_0x183e40['result']['message']);}})['catch'](function(_0x48ca47){logger[_0xd020('0x10')]('Schedule,\x20%s,\x20%s',_0x54c8b0,_0x48ca47);_0x31b0d7(_0x48ca47);});});}
\ No newline at end of file
index c14283c..70e5a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa44b=['fs-extra','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','create','put','update','destroy','util','path','express','Router'];(function(_0x14a683,_0x10c6e7){var _0x3f7cfb=function(_0x3c318b){while(--_0x3c318b){_0x14a683['push'](_0x14a683['shift']());}};_0x3f7cfb(++_0x10c6e7);}(_0xa44b,0xb0));var _0xba44=function(_0x1ee04b,_0x554b3d){_0x1ee04b=_0x1ee04b-0x0;var _0x412848=_0xa44b[_0x1ee04b];return _0x412848;};'use strict';var multer=require('multer');var util=require(_0xba44('0x0'));var path=require(_0xba44('0x1'));var timeout=require('connect-timeout');var express=require(_0xba44('0x2'));var router=express[_0xba44('0x3')]();var fs_extra=require(_0xba44('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xba44('0x5'));var config=require('../../config/environment');var controller=require(_0xba44('0x6'));router[_0xba44('0x7')]('/',auth[_0xba44('0x8')](),controller[_0xba44('0x9')]);router[_0xba44('0x7')]('/describe',auth[_0xba44('0x8')](),controller[_0xba44('0xa')]);router[_0xba44('0x7')](_0xba44('0xb'),auth[_0xba44('0x8')](),controller[_0xba44('0xc')]);router[_0xba44('0x7')](_0xba44('0xd'),auth[_0xba44('0x8')](),controller[_0xba44('0xe')]);router[_0xba44('0xf')]('/',auth[_0xba44('0x8')](),controller[_0xba44('0x10')]);router[_0xba44('0x11')](_0xba44('0xb'),auth[_0xba44('0x8')](),controller[_0xba44('0x12')]);router['delete']('/:id',auth[_0xba44('0x8')](),controller[_0xba44('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa772=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1cb04a,_0x4f7dcc){var _0x4a2e4d=function(_0x10f355){while(--_0x10f355){_0x1cb04a['push'](_0x1cb04a['shift']());}};_0x4a2e4d(++_0x4f7dcc);}(_0xa772,0x1c3));var _0x2a77=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xa772[_0x207811];return _0x170d56;};'use strict';var multer=require(_0x2a77('0x0'));var util=require(_0x2a77('0x1'));var path=require('path');var timeout=require(_0x2a77('0x2'));var express=require(_0x2a77('0x3'));var router=express[_0x2a77('0x4')]();var fs_extra=require(_0x2a77('0x5'));var auth=require(_0x2a77('0x6'));var interaction=require(_0x2a77('0x7'));var config=require(_0x2a77('0x8'));var controller=require(_0x2a77('0x9'));router[_0x2a77('0xa')]('/',auth[_0x2a77('0xb')](),controller[_0x2a77('0xc')]);router['get']('/describe',auth[_0x2a77('0xb')](),controller[_0x2a77('0xd')]);router[_0x2a77('0xa')](_0x2a77('0xe'),auth[_0x2a77('0xb')](),controller[_0x2a77('0xf')]);router[_0x2a77('0xa')](_0x2a77('0x10'),auth[_0x2a77('0xb')](),controller[_0x2a77('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a77('0x12')]);router[_0x2a77('0x13')](_0x2a77('0xe'),auth[_0x2a77('0xb')](),controller[_0x2a77('0x14')]);router[_0x2a77('0x15')]('/:id',auth[_0x2a77('0xb')](),controller[_0x2a77('0x16')]);module[_0x2a77('0x17')]=router;
\ No newline at end of file
index 3769ac1..8548bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa817=['../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','updatedAt','sequelize','moment','path'];(function(_0x25a39e,_0x528df3){var _0x53525d=function(_0x4043a8){while(--_0x4043a8){_0x25a39e['push'](_0x25a39e['shift']());}};_0x53525d(++_0x528df3);}(_0xa817,0x7b));var _0x7a81=function(_0x47b54b,_0x54ff19){_0x47b54b=_0x47b54b-0x0;var _0x150c7f=_0xa817[_0x47b54b];return _0x150c7f;};'use strict';var Sequelize=require(_0x7a81('0x0'));var moment=require(_0x7a81('0x1'));var path=require(_0x7a81('0x2'));var config=require(_0x7a81('0x3'));module[_0x7a81('0x4')]={'format':{'type':Sequelize[_0x7a81('0x5')],'get':function(){return this[_0x7a81('0x6')](_0x7a81('0x7'))?path[_0x7a81('0x8')](this['getDataValue'](_0x7a81('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x7a81('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x7a81('0x9')],'set':function(_0x35c35a){var _0x3ab25c=_0x35c35a[_0x7a81('0xa')](/\\/g,'/');this[_0x7a81('0xb')](_0x7a81('0x7'),_0x3ab25c);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7a81('0xc')],'set':function(_0x5b3b66){this['setDataValue'](_0x7a81('0xd'),moment()['subtract'](_0x5b3b66,'ms'));this[_0x7a81('0xb')](_0x7a81('0xe'),moment());this[_0x7a81('0xb')](_0x7a81('0xf'),_0x5b3b66);}},'startedAt':{'type':Sequelize[_0x7a81('0x10')],'get':function(){return moment(this[_0x7a81('0x6')](_0x7a81('0xd')))['format'](_0x7a81('0x11'))[_0x7a81('0x12')]();}},'closedAt':{'type':Sequelize[_0x7a81('0x10')],'get':function(){return moment(this['getDataValue'](_0x7a81('0xe')))[_0x7a81('0x13')](_0x7a81('0x11'))[_0x7a81('0x12')]();}},'createdAt':{'type':Sequelize[_0x7a81('0x10')],'get':function(){return moment(this[_0x7a81('0x6')]('createdAt'))['format'](_0x7a81('0x11'))[_0x7a81('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7a81('0x6')](_0x7a81('0x14')))[_0x7a81('0x13')](_0x7a81('0x11'))[_0x7a81('0x12')]();}}};
\ No newline at end of file
+var _0xfa25=['moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt'];(function(_0x441b95,_0x218b3d){var _0xd5ca6c=function(_0x331e26){while(--_0x331e26){_0x441b95['push'](_0x441b95['shift']());}};_0xd5ca6c(++_0x218b3d);}(_0xfa25,0xd1));var _0x5fa2=function(_0x1876c1,_0x339ff0){_0x1876c1=_0x1876c1-0x0;var _0x5168c6=_0xfa25[_0x1876c1];return _0x5168c6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5fa2('0x0'));var path=require(_0x5fa2('0x1'));var config=require(_0x5fa2('0x2'));module[_0x5fa2('0x3')]={'format':{'type':Sequelize[_0x5fa2('0x4')],'get':function(){return this[_0x5fa2('0x5')](_0x5fa2('0x6'))?path[_0x5fa2('0x7')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x5fa2('0x8')]},'channel':{'type':Sequelize[_0x5fa2('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x53a560){var _0x2a9a69=_0x53a560['replace'](/\\/g,'/');this[_0x5fa2('0x9')](_0x5fa2('0x6'),_0x2a9a69);}},'rating':{'type':Sequelize[_0x5fa2('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x36778e){this[_0x5fa2('0x9')](_0x5fa2('0xb'),moment()['subtract'](_0x36778e,'ms'));this[_0x5fa2('0x9')]('closedAt',moment());this['setDataValue'](_0x5fa2('0xc'),_0x36778e);}},'startedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this['getDataValue'](_0x5fa2('0xb')))[_0x5fa2('0xe')](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}},'closedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')](_0x5fa2('0x11')))[_0x5fa2('0xe')](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}},'createdAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')](_0x5fa2('0x12')))[_0x5fa2('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x5fa2('0x10')]();}},'updatedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')]('updatedAt'))['format'](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}}};
\ No newline at end of file
index 6f82d7c..06aec05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x425d,0x1e0));var _0xd425=function(_0x267ad4,_0x1d1b88){_0x267ad4=_0x267ad4-0x0;var _0x2f3a7b=_0x425d[_0x267ad4];return _0x2f3a7b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));};
\ No newline at end of file
+var _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2924e3,_0x562990){var _0x4d1438=function(_0x5c0c4c){while(--_0x5c0c4c){_0x2924e3['push'](_0x2924e3['shift']());}};_0x4d1438(++_0x562990);}(_0x8958,0x93));var _0x8895=function(_0x5ddd3d,_0x20f79d){_0x5ddd3d=_0x5ddd3d-0x0;var _0x5c77c8=_0x8958[_0x5ddd3d];return _0x5c77c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));};
\ No newline at end of file
index 11f3947..b35a596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfa0=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x47c4ad,_0x2f138c){var _0xec0d0c=function(_0xd4ea37){while(--_0xd4ea37){_0x47c4ad['push'](_0x47c4ad['shift']());}};_0xec0d0c(++_0x2f138c);}(_0xbfa0,0xde));var _0x0bfa=function(_0x435bbd,_0xec4e23){_0x435bbd=_0x435bbd-0x0;var _0x464652=_0xbfa0[_0x435bbd];return _0x464652;};'use strict';var _=require(_0x0bfa('0x0'));var util=require('util');var logger=require(_0x0bfa('0x1'))(_0x0bfa('0x2'));var moment=require('moment');var BPromise=require(_0x0bfa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bfa('0x4'));var rimraf=require(_0x0bfa('0x5'));var config=require('../../config/environment');var attributes=require(_0x0bfa('0x6'));module[_0x0bfa('0x7')]=function(_0x194e8c,_0x344370){return _0x194e8c[_0x0bfa('0x8')](_0x0bfa('0x9'),attributes,{'tableName':_0x0bfa('0xa'),'paranoid':![],'indexes':[{'name':_0x0bfa('0xb'),'fields':[_0x0bfa('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xabc0=['request-promise','path','rimraf','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','moment','bluebird'];(function(_0x41613d,_0x3e251f){var _0x38a04e=function(_0x934d2){while(--_0x934d2){_0x41613d['push'](_0x41613d['shift']());}};_0x38a04e(++_0x3e251f);}(_0xabc0,0xec));var _0x0abc=function(_0x4e3fee,_0x471d95){_0x4e3fee=_0x4e3fee-0x0;var _0x5cb78c=_0xabc0[_0x4e3fee];return _0x5cb78c;};'use strict';var _=require(_0x0abc('0x0'));var util=require('util');var logger=require(_0x0abc('0x1'))('api');var moment=require(_0x0abc('0x2'));var BPromise=require(_0x0abc('0x3'));var rp=require(_0x0abc('0x4'));var fs=require('fs');var path=require(_0x0abc('0x5'));var rimraf=require(_0x0abc('0x6'));var config=require(_0x0abc('0x7'));var attributes=require('./screenRecording.attributes');module[_0x0abc('0x8')]=function(_0x53f4c5,_0x24806b){return _0x53f4c5['define'](_0x0abc('0x9'),attributes,{'tableName':_0x0abc('0xa'),'paranoid':![],'indexes':[{'name':_0x0abc('0xb'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index a0e4f64..1079692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae0=['../../config/environment','client','http','request','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xfae0,0xcb));var _0x0fae=function(_0x5b2a15,_0xd200ec){_0x5b2a15=_0x5b2a15-0x0;var _0x33038d=_0xfae0[_0x5b2a15];return _0x33038d;};'use strict';var _=require('lodash');var util=require(_0x0fae('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fae('0x1'));var fs=require('fs');var Redis=require(_0x0fae('0x2'));var db=require(_0x0fae('0x3'))['db'];var utils=require(_0x0fae('0x4'));var logger=require(_0x0fae('0x5'))('rpc');var config=require(_0x0fae('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0fae('0x7')][_0x0fae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f15bf,_0x598624,_0x197969){return new BPromise(function(_0x9e7b30,_0xaf53d5){return client[_0x0fae('0x9')](_0x2f15bf,_0x197969)['then'](function(_0x444c7c){logger[_0x0fae('0xa')](_0x0fae('0xb'),_0x598624,'request\x20sent');logger[_0x0fae('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x598624,_0x0fae('0xd'),JSON[_0x0fae('0xe')](_0x444c7c));if(_0x444c7c[_0x0fae('0xf')]){if(_0x444c7c[_0x0fae('0xf')][_0x0fae('0x10')]===0x1f4){logger[_0x0fae('0xf')](_0x0fae('0xb'),_0x598624,_0x444c7c[_0x0fae('0xf')][_0x0fae('0x11')]);return _0xaf53d5(_0x444c7c[_0x0fae('0xf')][_0x0fae('0x11')]);}logger['error'](_0x0fae('0xb'),_0x598624,_0x444c7c[_0x0fae('0xf')][_0x0fae('0x11')]);return _0x9e7b30(_0x444c7c[_0x0fae('0xf')]['message']);}else{logger[_0x0fae('0xa')](_0x0fae('0xb'),_0x598624,'request\x20sent');_0x9e7b30(_0x444c7c[_0x0fae('0x12')]['message']);}})['catch'](function(_0x3acf1a){logger[_0x0fae('0xf')](_0x0fae('0xb'),_0x598624,_0x3acf1a);_0xaf53d5(_0x3acf1a);});});}
\ No newline at end of file
+var _0x517f=['result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x384447,_0x41669a){var _0x3810db=function(_0x3f1288){while(--_0x3f1288){_0x384447['push'](_0x384447['shift']());}};_0x3810db(++_0x41669a);}(_0x517f,0xf3));var _0xf517=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x517f[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xf517('0x0'));var util=require(_0xf517('0x1'));var moment=require(_0xf517('0x2'));var BPromise=require(_0xf517('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf517('0x4'));var logger=require(_0xf517('0x5'))('rpc');var config=require(_0xf517('0x6'));var jayson=require(_0xf517('0x7'));var client=jayson[_0xf517('0x8')][_0xf517('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c0c82,_0x2d40a6,_0x5ad2b8){return new BPromise(function(_0x65a9a0,_0x19287a){return client[_0xf517('0xa')](_0x1c0c82,_0x5ad2b8)[_0xf517('0xb')](function(_0x5c426b){logger[_0xf517('0xc')](_0xf517('0xd'),_0x2d40a6,'request\x20sent');logger[_0xf517('0xe')](_0xf517('0xf'),_0x2d40a6,_0xf517('0x10'),JSON[_0xf517('0x11')](_0x5c426b));if(_0x5c426b[_0xf517('0x12')]){if(_0x5c426b[_0xf517('0x12')][_0xf517('0x13')]===0x1f4){logger[_0xf517('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2d40a6,_0x5c426b[_0xf517('0x12')]['message']);return _0x19287a(_0x5c426b[_0xf517('0x12')][_0xf517('0x14')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2d40a6,_0x5c426b[_0xf517('0x12')][_0xf517('0x14')]);return _0x65a9a0(_0x5c426b[_0xf517('0x12')][_0xf517('0x14')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x2d40a6,_0xf517('0x10'));_0x65a9a0(_0x5c426b[_0xf517('0x15')]['message']);}})['catch'](function(_0x338131){logger['error'](_0xf517('0xd'),_0x2d40a6,_0x338131);_0x19287a(_0x338131);});});}
\ No newline at end of file
index 690337c..df71459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76ce=['update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','root','%s%s','logo','originalname','post','single','join','server/files/images/logos/','format','logologin','extname','file','addLogoLogin','diskStorage','addFavicon'];(function(_0x484972,_0x38e2ed){var _0x45b58b=function(_0xa1fbfa){while(--_0xa1fbfa){_0x484972['push'](_0x484972['shift']());}};_0x45b58b(++_0x38e2ed);}(_0x76ce,0xc0));var _0xe76c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x76ce[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require('multer');var util=require(_0xe76c('0x0'));var path=require(_0xe76c('0x1'));var timeout=require(_0xe76c('0x2'));var express=require('express');var router=express[_0xe76c('0x3')]();var fs_extra=require(_0xe76c('0x4'));var auth=require(_0xe76c('0x5'));var interaction=require(_0xe76c('0x6'));var config=require(_0xe76c('0x7'));var controller=require(_0xe76c('0x8'));router['get']('/',auth[_0xe76c('0x9')](),controller[_0xe76c('0xa')]);router[_0xe76c('0xb')]('/now',controller['getDate']);router[_0xe76c('0xb')](_0xe76c('0xc'),controller['show']);router[_0xe76c('0xb')]('/:id/logo',controller[_0xe76c('0xd')]);router[_0xe76c('0xb')](_0xe76c('0xe'),controller[_0xe76c('0xf')]);router[_0xe76c('0xb')](_0xe76c('0x10'),controller[_0xe76c('0x11')]);router['get'](_0xe76c('0x12'),controller['getPreferred']);router[_0xe76c('0xb')](_0xe76c('0x13'),controller[_0xe76c('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x421934,_0x4f3e00,_0x266587){_0x266587(null,path['join'](config[_0xe76c('0x15')],'server/files/images/logos/'));},'filename':function(_0x5668b0,_0x44628a,_0x10dfdd){_0x10dfdd(null,util['format'](_0xe76c('0x16'),_0xe76c('0x17'),path['extname'](_0x44628a[_0xe76c('0x18')])));}})});router[_0xe76c('0x19')]('/:id/logo',upload[_0xe76c('0x1a')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43d050,_0x5bfc93,_0x2a2c96){_0x2a2c96(null,path[_0xe76c('0x1b')](config[_0xe76c('0x15')],_0xe76c('0x1c')));},'filename':function(_0xd3c324,_0x58d78a,_0x2378e1){_0x2378e1(null,util[_0xe76c('0x1d')](_0xe76c('0x16'),_0xe76c('0x1e'),path[_0xe76c('0x1f')](_0x58d78a[_0xe76c('0x18')])));}})});router['post'](_0xe76c('0xe'),upload[_0xe76c('0x1a')](_0xe76c('0x20')),controller[_0xe76c('0x21')]);var upload=multer({'storage':multer[_0xe76c('0x22')]({'destination':function(_0xd2f433,_0xcb8948,_0x2e8862){_0x2e8862(null,path[_0xe76c('0x1b')](config[_0xe76c('0x15')],'server/files/images/logos/'));},'filename':function(_0x15a666,_0x3ad458,_0x39aba4){_0x39aba4(null,util[_0xe76c('0x1d')](_0xe76c('0x16'),'preferred',path[_0xe76c('0x1f')](_0x3ad458[_0xe76c('0x18')])));}})});router[_0xe76c('0x19')](_0xe76c('0x12'),upload[_0xe76c('0x1a')](_0xe76c('0x20')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x165e1a,_0x501a76,_0x35ad25){_0x35ad25(null,path[_0xe76c('0x1b')](config[_0xe76c('0x15')],'server/files/images/logos/'));},'filename':function(_0xddbe20,_0x3729fa,_0x32cb12){_0x32cb12(null,util[_0xe76c('0x1d')](_0xe76c('0x16'),'favicon',path[_0xe76c('0x1f')](_0x3729fa[_0xe76c('0x18')])));}})});router['post'](_0xe76c('0x13'),upload[_0xe76c('0x1a')](_0xe76c('0x20')),controller[_0xe76c('0x23')]);router['put'](_0xe76c('0xc'),auth['isAuthenticated'](),controller[_0xe76c('0x24')]);module[_0xe76c('0x25')]=router;
\ No newline at end of file
+var _0xbac0=['addFavicon','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','logo','extname','post','single','file','addLogo','root','format','addLogoLogin','preferred','originalname','favicon','/:id/favicon'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbac0,0xd5));var _0x0bac=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0xbac0[_0x8bb4c1];return _0x67a6e1;};'use strict';var multer=require(_0x0bac('0x0'));var util=require(_0x0bac('0x1'));var path=require(_0x0bac('0x2'));var timeout=require(_0x0bac('0x3'));var express=require('express');var router=express[_0x0bac('0x4')]();var fs_extra=require(_0x0bac('0x5'));var auth=require(_0x0bac('0x6'));var interaction=require(_0x0bac('0x7'));var config=require(_0x0bac('0x8'));var controller=require(_0x0bac('0x9'));router[_0x0bac('0xa')]('/',auth[_0x0bac('0xb')](),controller[_0x0bac('0xc')]);router[_0x0bac('0xa')]('/now',controller['getDate']);router['get'](_0x0bac('0xd'),controller[_0x0bac('0xe')]);router[_0x0bac('0xa')](_0x0bac('0xf'),controller[_0x0bac('0x10')]);router[_0x0bac('0xa')](_0x0bac('0x11'),controller['getLogoLogin']);router[_0x0bac('0xa')](_0x0bac('0x12'),controller['gdpr']);router[_0x0bac('0xa')](_0x0bac('0x13'),controller[_0x0bac('0x14')]);router[_0x0bac('0xa')]('/:id/favicon',controller[_0x0bac('0x15')]);var upload=multer({'storage':multer[_0x0bac('0x16')]({'destination':function(_0xa80f00,_0xe52834,_0x21e41d){_0x21e41d(null,path[_0x0bac('0x17')](config['root'],_0x0bac('0x18')));},'filename':function(_0xe372df,_0x33fd88,_0xfd0fa2){_0xfd0fa2(null,util['format'](_0x0bac('0x19'),_0x0bac('0x1a'),path[_0x0bac('0x1b')](_0x33fd88['originalname'])));}})});router[_0x0bac('0x1c')](_0x0bac('0xf'),upload[_0x0bac('0x1d')](_0x0bac('0x1e')),controller[_0x0bac('0x1f')]);var upload=multer({'storage':multer[_0x0bac('0x16')]({'destination':function(_0x4011f9,_0x141074,_0x16ea82){_0x16ea82(null,path[_0x0bac('0x17')](config[_0x0bac('0x20')],'server/files/images/logos/'));},'filename':function(_0x3e94e1,_0x5609c0,_0x2b1fd5){_0x2b1fd5(null,util[_0x0bac('0x21')](_0x0bac('0x19'),'logologin',path[_0x0bac('0x1b')](_0x5609c0['originalname'])));}})});router[_0x0bac('0x1c')]('/:id/logo_login',upload['single'](_0x0bac('0x1e')),controller[_0x0bac('0x22')]);var upload=multer({'storage':multer[_0x0bac('0x16')]({'destination':function(_0x291bd7,_0x12791f,_0x5897be){_0x5897be(null,path[_0x0bac('0x17')](config[_0x0bac('0x20')],_0x0bac('0x18')));},'filename':function(_0x4165a2,_0x3ecd55,_0x248dae){_0x248dae(null,util[_0x0bac('0x21')](_0x0bac('0x19'),_0x0bac('0x23'),path['extname'](_0x3ecd55[_0x0bac('0x24')])));}})});router['post'](_0x0bac('0x13'),upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x0bac('0x16')]({'destination':function(_0x3eb8ff,_0x2ca874,_0x16cabc){_0x16cabc(null,path[_0x0bac('0x17')](config[_0x0bac('0x20')],'server/files/images/logos/'));},'filename':function(_0x19b3d0,_0x164558,_0x1dbceb){_0x1dbceb(null,util[_0x0bac('0x21')](_0x0bac('0x19'),_0x0bac('0x25'),path[_0x0bac('0x1b')](_0x164558[_0x0bac('0x24')])));}})});router[_0x0bac('0x1c')](_0x0bac('0x26'),upload[_0x0bac('0x1d')](_0x0bac('0x1e')),controller[_0x0bac('0x27')]);router[_0x0bac('0x28')](_0x0bac('0xd'),auth[_0x0bac('0xb')](),controller[_0x0bac('0x29')]);module['exports']=router;
\ No newline at end of file
index 1a87425..40980b0 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(_0x45efd2,_0x9cffb2){var _0x162572=function(_0x41342f){while(--_0x41342f){_0x45efd2['push'](_0x45efd2['shift']());}};_0x162572(++_0x9cffb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x4c4aff,_0x22feab){var _0x1431fe=function(_0x26be69){while(--_0x26be69){_0x4c4aff['push'](_0x4c4aff['shift']());}};_0x1431fe(++_0x22feab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 4ace54e..035e799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8250=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','index','map','Setting','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','count','includeAll','include','findAll','rows','show','keys','find','body','params','addLogo','file','filename','addLogoLogin','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLoginLogo','existsSync','join','toLower','root','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','download','getLogoLogin','loginLogo','defaultLogo','defaultPreferred','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','\x20not\x20found','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send'];(function(_0x216503,_0x53c996){var _0x221a1f=function(_0x73becf){while(--_0x73becf){_0x216503['push'](_0x216503['shift']());}};_0x221a1f(++_0x53c996);}(_0x8250,0xfa));var _0x0825=function(_0x3b7b8c,_0x21a23b){_0x3b7b8c=_0x3b7b8c-0x0;var _0x2604b1=_0x8250[_0x3b7b8c];return _0x2604b1;};'use strict';var emlformat=require(_0x0825('0x0'));var rimraf=require(_0x0825('0x1'));var zipdir=require(_0x0825('0x2'));var jsonpatch=require(_0x0825('0x3'));var rp=require('request-promise');var moment=require(_0x0825('0x4'));var BPromise=require(_0x0825('0x5'));var Mustache=require('mustache');var util=require(_0x0825('0x6'));var path=require('path');var sox=require(_0x0825('0x7'));var csv=require('to-csv');var ejs=require(_0x0825('0x8'));var fs=require('fs');var fs_extra=require(_0x0825('0x9'));var _=require(_0x0825('0xa'));var squel=require('squel');var crypto=require(_0x0825('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0825('0xc'));var toCsv=require(_0x0825('0xd'));var querystring=require(_0x0825('0xe'));var Papa=require(_0x0825('0xf'));var Redis=require(_0x0825('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0825('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0825('0x12'));var logger=require(_0x0825('0x13'))(_0x0825('0x14'));var utils=require(_0x0825('0x15'));var config=require(_0x0825('0x16'));var licenseUtil=require(_0x0825('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0825('0x18'));var client=jayson[_0x0825('0x19')][_0x0825('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x650e44,_0x243e97,_0x2a60c0,_0x43c2ec){return new BPromise(function(_0x5a7546,_0x4bbe11){var _0x5804c0=_0x43c2ec||client;return _0x5804c0[_0x0825('0x1b')](_0x650e44,_0x2a60c0)['then'](function(_0x18c1de){logger[_0x0825('0x1c')](_0x0825('0x1d'),_0x243e97,_0x0825('0x1e'));logger[_0x0825('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x243e97,'request\x20sent',JSON[_0x0825('0x20')](_0x18c1de));if(_0x18c1de['error']){if(_0x18c1de['error'][_0x0825('0x21')]===0x1f4){logger[_0x0825('0x22')](_0x0825('0x1d'),_0x243e97,_0x18c1de[_0x0825('0x22')][_0x0825('0x23')]);return _0x4bbe11(_0x18c1de[_0x0825('0x22')][_0x0825('0x23')]);}logger[_0x0825('0x22')](_0x0825('0x1d'),_0x243e97,_0x18c1de['error'][_0x0825('0x23')]);return _0x5a7546(_0x18c1de[_0x0825('0x22')][_0x0825('0x23')]);}else{logger[_0x0825('0x1c')]('Setting,\x20%s,\x20%s',_0x243e97,_0x0825('0x1e'));_0x5a7546(_0x18c1de[_0x0825('0x24')]['message']);}})[_0x0825('0x25')](function(_0x63ed3e){logger[_0x0825('0x22')](_0x0825('0x1d'),_0x243e97,_0x63ed3e);_0x4bbe11(_0x63ed3e);});});}function respondWithStatusCode(_0x241cd2,_0x544ab7){_0x544ab7=_0x544ab7||0xcc;return function(_0x5e1cf0){if(_0x5e1cf0){return _0x241cd2['sendStatus'](_0x544ab7);}return _0x241cd2[_0x0825('0x26')](_0x544ab7)[_0x0825('0x27')]();};}function respondWithResult(_0x26b211,_0x100452){_0x100452=_0x100452||0xc8;return function(_0x377487){if(_0x377487){return _0x26b211[_0x0825('0x26')](_0x100452)[_0x0825('0x28')](_0x377487);}};}function respondWithFilteredResult(_0x5e0220,_0x18a308){return function(_0x551cd8){if(_0x551cd8){var _0x55aed8=typeof _0x18a308[_0x0825('0x29')]===_0x0825('0x2a')&&typeof _0x18a308['limit']==='undefined';var _0x5d362b=_0x551cd8['count'];var _0x574caf=_0x55aed8?0x0:_0x18a308[_0x0825('0x29')];var _0x283514=_0x55aed8?_0x551cd8['count']:_0x18a308[_0x0825('0x29')]+_0x18a308[_0x0825('0x2b')];var _0x23aa3b;if(_0x283514>=_0x5d362b){_0x283514=_0x5d362b;_0x23aa3b=0xc8;}else{_0x23aa3b=0xce;}_0x5e0220[_0x0825('0x26')](_0x23aa3b);return _0x5e0220[_0x0825('0x2c')](_0x0825('0x2d'),_0x574caf+'-'+_0x283514+'/'+_0x5d362b)['json'](_0x551cd8);}return null;};}function patchUpdates(_0x13cf02){return function(_0x25c899){try{jsonpatch['apply'](_0x25c899,_0x13cf02,!![]);}catch(_0x18afed){return BPromise[_0x0825('0x2e')](_0x18afed);}return _0x25c899[_0x0825('0x2f')]();};}function saveUpdates(_0x51ef7e,_0x2761dd){return function(_0x491baa){if(_0x491baa){return _0x491baa[_0x0825('0x30')](_0x51ef7e)[_0x0825('0x31')](function(_0xc2a166){return _0xc2a166;});}return null;};}function removeEntity(_0x38f2e7,_0x78aba6){return function(_0x417d25){if(_0x417d25){return _0x417d25[_0x0825('0x32')]()[_0x0825('0x31')](function(){_0x38f2e7[_0x0825('0x26')](0xcc)[_0x0825('0x27')]();});}};}function handleEntityNotFound(_0x540d36,_0x4b6409){return function(_0x173c47){if(!_0x173c47){_0x540d36[_0x0825('0x33')](0x194);}return _0x173c47;};}function handleError(_0x9eceda,_0x215cac){_0x215cac=_0x215cac||0x1f4;return function(_0x56e6ce){logger['error'](_0x56e6ce[_0x0825('0x34')]);if(_0x56e6ce[_0x0825('0x35')]){delete _0x56e6ce[_0x0825('0x35')];}_0x9eceda['status'](_0x215cac)['send'](_0x56e6ce);};}exports[_0x0825('0x36')]=function(_0x38bd01,_0x5ecaba){var _0x2ac30d={},_0x5716df={},_0x22c14a={'count':0x0,'rows':[]};var _0x2d1d6c=_[_0x0825('0x37')](db[_0x0825('0x38')][_0x0825('0x39')],function(_0x1f7128){return{'name':_0x1f7128['fieldName'],'type':_0x1f7128[_0x0825('0x3a')][_0x0825('0x3b')]};});_0x5716df[_0x0825('0x3c')]=_[_0x0825('0x37')](_0x2d1d6c,_0x0825('0x35'));_0x5716df[_0x0825('0x3d')]=_['keys'](_0x38bd01['query']);_0x5716df['filters']=_['intersection'](_0x5716df[_0x0825('0x3c')],_0x5716df[_0x0825('0x3d')]);_0x2ac30d[_0x0825('0x3e')]=_[_0x0825('0x3f')](_0x5716df[_0x0825('0x3c')],qs[_0x0825('0x40')](_0x38bd01['query'][_0x0825('0x40')]));_0x2ac30d[_0x0825('0x3e')]=_0x2ac30d['attributes'][_0x0825('0x41')]?_0x2ac30d[_0x0825('0x3e')]:_0x5716df[_0x0825('0x3c')];if(!_0x38bd01['query'][_0x0825('0x42')](_0x0825('0x43'))){_0x2ac30d['limit']=qs[_0x0825('0x2b')](_0x38bd01[_0x0825('0x3d')][_0x0825('0x2b')]);_0x2ac30d[_0x0825('0x29')]=qs['offset'](_0x38bd01[_0x0825('0x3d')]['offset']);}_0x2ac30d['order']=qs[_0x0825('0x44')](_0x38bd01[_0x0825('0x3d')][_0x0825('0x44')]);_0x2ac30d[_0x0825('0x45')]=qs['filters'](_[_0x0825('0x46')](_0x38bd01[_0x0825('0x3d')],_0x5716df[_0x0825('0x47')]),_0x2d1d6c);if(_0x38bd01[_0x0825('0x3d')][_0x0825('0x48')]){_0x2ac30d[_0x0825('0x45')]=_[_0x0825('0x49')](_0x2ac30d[_0x0825('0x45')],{'$or':_[_0x0825('0x37')](_0x2d1d6c,function(_0x34d17e){if(_0x34d17e['type']!=='VIRTUAL'){var _0x5af539={};_0x5af539[_0x34d17e['name']]={'$like':'%'+_0x38bd01[_0x0825('0x3d')]['filter']+'%'};return _0x5af539;}})});}_0x2ac30d=_[_0x0825('0x49')]({},_0x2ac30d,_0x38bd01[_0x0825('0x4a')]);var _0x2610d0={'where':_0x2ac30d['where']};return db['Setting'][_0x0825('0x4b')](_0x2610d0)[_0x0825('0x31')](function(_0x203042){_0x22c14a[_0x0825('0x4b')]=_0x203042;if(_0x38bd01[_0x0825('0x3d')][_0x0825('0x4c')]){_0x2ac30d[_0x0825('0x4d')]=[{'all':!![]}];}return db[_0x0825('0x38')][_0x0825('0x4e')](_0x2ac30d);})[_0x0825('0x31')](function(_0x5f5b5d){_0x22c14a[_0x0825('0x4f')]=_0x5f5b5d;return _0x22c14a;})[_0x0825('0x31')](respondWithFilteredResult(_0x5ecaba,_0x2ac30d))[_0x0825('0x25')](handleError(_0x5ecaba,null));};exports[_0x0825('0x50')]=function(_0x48f7cd,_0x2021e8){var _0x1cf914={'raw':![],'where':{'id':_0x48f7cd['params']['id']}},_0xefe7e8={};_0xefe7e8[_0x0825('0x3c')]=_[_0x0825('0x51')](db[_0x0825('0x38')][_0x0825('0x39')]);_0xefe7e8[_0x0825('0x3d')]=_[_0x0825('0x51')](_0x48f7cd[_0x0825('0x3d')]);_0xefe7e8['filters']=_['intersection'](_0xefe7e8[_0x0825('0x3c')],_0xefe7e8[_0x0825('0x3d')]);_0x1cf914['attributes']=_[_0x0825('0x3f')](_0xefe7e8[_0x0825('0x3c')],qs[_0x0825('0x40')](_0x48f7cd[_0x0825('0x3d')][_0x0825('0x40')]));_0x1cf914[_0x0825('0x3e')]=_0x1cf914['attributes']['length']?_0x1cf914[_0x0825('0x3e')]:_0xefe7e8[_0x0825('0x3c')];if(_0x48f7cd[_0x0825('0x3d')][_0x0825('0x4c')]){_0x1cf914[_0x0825('0x4d')]=[{'all':!![]}];}_0x1cf914=_[_0x0825('0x49')]({},_0x1cf914,_0x48f7cd['options']);return db[_0x0825('0x38')][_0x0825('0x52')](_0x1cf914)[_0x0825('0x31')](handleEntityNotFound(_0x2021e8,null))['then'](respondWithResult(_0x2021e8,null))['catch'](handleError(_0x2021e8,null));};exports['update']=function(_0x5dd65c,_0x3d0d3c){if(_0x5dd65c[_0x0825('0x53')]['id']){delete _0x5dd65c['body']['id'];}return db[_0x0825('0x38')][_0x0825('0x52')]({'where':{'id':_0x5dd65c[_0x0825('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d0d3c,null))[_0x0825('0x31')](saveUpdates(_0x5dd65c[_0x0825('0x53')],null))['then'](respondWithResult(_0x3d0d3c,null))[_0x0825('0x25')](handleError(_0x3d0d3c,null));};exports[_0x0825('0x55')]=function(_0x376c32,_0x48221d,_0x5b1cb8){if(_0x376c32[_0x0825('0x56')]&&_0x376c32[_0x0825('0x56')][_0x0825('0x57')]){_0x376c32[_0x0825('0x53')]['logo']=_0x376c32[_0x0825('0x56')]['filename'];}return db[_0x0825('0x38')]['find']({'where':{'id':_0x376c32['params']['id']}})[_0x0825('0x31')](handleEntityNotFound(_0x48221d,null))[_0x0825('0x31')](saveUpdates(_0x376c32['body'],null))['then'](respondWithResult(_0x48221d,null))[_0x0825('0x25')](handleError(_0x48221d,null));};exports[_0x0825('0x58')]=function(_0x206087,_0x3ecad4,_0x182cd9){if(_0x206087[_0x0825('0x56')]&&_0x206087[_0x0825('0x56')]['filename']){_0x206087['body']['loginLogo']=_0x206087[_0x0825('0x56')][_0x0825('0x57')];}return db[_0x0825('0x38')][_0x0825('0x52')]({'where':{'id':_0x206087[_0x0825('0x54')]['id']}})['then'](handleEntityNotFound(_0x3ecad4,null))[_0x0825('0x31')](saveUpdates(_0x206087['body'],null))[_0x0825('0x31')](respondWithResult(_0x3ecad4,null))[_0x0825('0x25')](handleError(_0x3ecad4,null));};var utilLicense=require(_0x0825('0x17'));exports['getLogo']=function(_0x55ae16,_0x2411cc,_0x4e2721){var _0x26ae81=_0x0825('0x59');var _0x9207cd={'custom':![]};return utilLicense[_0x0825('0x5a')]()['then'](function(_0x5de403){if(_0x5de403){_0x9207cd=_0x5de403;}return db['Setting'][_0x0825('0x52')]({'where':{'id':_0x55ae16[_0x0825('0x54')]['id']},'attributes':[_0x0825('0x5b'),'loginLogo',_0x0825('0x5c'),_0x0825('0x5d'),'defaultLogo',_0x0825('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x0825('0x31')](handleEntityNotFound(_0x2411cc,null))['then'](function(_0x237b7a){if(_0x237b7a){var _0x127c04=_0x237b7a[_0x0825('0x5b')]&&fs[_0x0825('0x5f')](path[_0x0825('0x60')](config['root'],_0x26ae81,_[_0x0825('0x61')](_0x237b7a[_0x0825('0x5b')])))?path[_0x0825('0x60')](config['root'],_0x26ae81,_['toLower'](_0x237b7a[_0x0825('0x5b')])):path[_0x0825('0x60')](config[_0x0825('0x62')],_0x26ae81,_[_0x0825('0x61')]('default_logo.svg'));var _0x22dc3a=_0x0825('0x63')+_[_0x0825('0x64')]('logo');if(_0x237b7a[_0x22dc3a]||!_0x9207cd[_0x0825('0x65')]){_0x127c04=path['join'](config[_0x0825('0x62')],_0x26ae81,_[_0x0825('0x61')](_0x0825('0x66')));}if(!fs[_0x0825('0x5f')](_0x127c04)){throw new db[(_0x0825('0x67'))][(_0x0825('0x68'))](_[_0x0825('0x64')](_0x0825('0x5b'))+'\x20not\x20found');}return _0x2411cc[_0x0825('0x69')](_0x127c04);}})['catch'](handleError(_0x2411cc,null));};var utilLicense=require(_0x0825('0x17'));exports[_0x0825('0x6a')]=function(_0x466288,_0x5f1eb8,_0x300493){var _0x17618c=_0x0825('0x59');var _0x3f8587={'custom':![]};return utilLicense[_0x0825('0x5a')]()[_0x0825('0x31')](function(_0x33d2ac){if(_0x33d2ac){_0x3f8587=_0x33d2ac;}return db['Setting']['find']({'where':{'id':_0x466288['params']['id']},'attributes':[_0x0825('0x5b'),_0x0825('0x6b'),_0x0825('0x5c'),_0x0825('0x5d'),_0x0825('0x6c'),_0x0825('0x5e'),_0x0825('0x6d'),_0x0825('0x6e')],'raw':!![]});})[_0x0825('0x31')](handleEntityNotFound(_0x5f1eb8,null))['then'](function(_0x4eae3b){if(_0x4eae3b){var _0x30d08d=_0x4eae3b[_0x0825('0x6b')]&&fs[_0x0825('0x5f')](path[_0x0825('0x60')](config[_0x0825('0x62')],_0x17618c,_[_0x0825('0x61')](_0x4eae3b[_0x0825('0x6b')])))?path[_0x0825('0x60')](config['root'],_0x17618c,_[_0x0825('0x61')](_0x4eae3b[_0x0825('0x6b')])):path[_0x0825('0x60')](config[_0x0825('0x62')],_0x17618c,_[_0x0825('0x61')](_0x0825('0x6f')));var _0x15f9b2=_0x0825('0x63')+_[_0x0825('0x64')]('loginLogo');if(_0x4eae3b[_0x15f9b2]||!_0x3f8587[_0x0825('0x65')]){_0x30d08d=path[_0x0825('0x60')](config[_0x0825('0x62')],_0x17618c,_[_0x0825('0x61')](_0x0825('0x6f')));}if(!fs[_0x0825('0x5f')](_0x30d08d)){throw new db['Sequelize']['ValidationError'](_[_0x0825('0x64')]('loginLogo')+'\x20not\x20found');}return _0x5f1eb8['download'](_0x30d08d);}})[_0x0825('0x25')](handleError(_0x5f1eb8,null));};exports[_0x0825('0x70')]=function(_0x112361,_0x202f04){return db[_0x0825('0x38')][_0x0825('0x52')]({'where':{'id':_0x112361[_0x0825('0x54')]['id']},'attributes':[_0x0825('0x71')]})['then'](respondWithResult(_0x202f04,null))[_0x0825('0x25')](handleError(_0x202f04,null));};exports[_0x0825('0x72')]=function(_0x29b416,_0x3fc049,_0x2eb55a){if(_0x29b416[_0x0825('0x56')]&&_0x29b416['file']['filename']){_0x29b416['body']['preferred']=_0x29b416[_0x0825('0x56')][_0x0825('0x57')];}return db[_0x0825('0x38')][_0x0825('0x52')]({'where':{'id':_0x29b416['params']['id']}})[_0x0825('0x31')](handleEntityNotFound(_0x3fc049,null))[_0x0825('0x31')](saveUpdates(_0x29b416['body'],null))[_0x0825('0x31')](respondWithResult(_0x3fc049,null))[_0x0825('0x25')](handleError(_0x3fc049,null));};var utilLicense=require(_0x0825('0x17'));exports[_0x0825('0x73')]=function(_0x36ce55,_0x3b62ce,_0x69afe8){var _0x28a9e5=_0x0825('0x59');var _0x183767={'custom':![]};return utilLicense['getLicense']()[_0x0825('0x31')](function(_0x4ff5b0){if(_0x4ff5b0){_0x183767=_0x4ff5b0;}return db['Setting'][_0x0825('0x52')]({'where':{'id':_0x36ce55[_0x0825('0x54')]['id']},'attributes':[_0x0825('0x5b'),'loginLogo',_0x0825('0x5c'),'favicon','defaultLogo',_0x0825('0x5e'),_0x0825('0x6d'),_0x0825('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x3b62ce,null))[_0x0825('0x31')](function(_0x6c7674){if(_0x6c7674){var _0x507f2d=_0x6c7674[_0x0825('0x5c')]&&fs['existsSync'](path[_0x0825('0x60')](config['root'],_0x28a9e5,_[_0x0825('0x61')](_0x6c7674['preferred'])))?path[_0x0825('0x60')](config['root'],_0x28a9e5,_[_0x0825('0x61')](_0x6c7674[_0x0825('0x5c')])):path[_0x0825('0x60')](config['root'],_0x28a9e5,_[_0x0825('0x61')](_0x0825('0x74')));var _0x408754='default'+_[_0x0825('0x64')](_0x0825('0x5c'));if(_0x6c7674[_0x408754]||!_0x183767[_0x0825('0x65')]||!_0x183767[_0x0825('0x5c')]){_0x507f2d=path[_0x0825('0x60')](config[_0x0825('0x62')],_0x28a9e5,_['toLower'](_0x0825('0x74')));}if(!fs[_0x0825('0x5f')](_0x507f2d)){throw new db[(_0x0825('0x67'))][(_0x0825('0x68'))](_['upperFirst'](_0x0825('0x5c'))+'\x20not\x20found');}return _0x3b62ce[_0x0825('0x69')](_0x507f2d);}})['catch'](handleError(_0x3b62ce,null));};exports[_0x0825('0x75')]=function(_0x2bacb3,_0x3df29c,_0x38d021){if(_0x2bacb3[_0x0825('0x56')]&&_0x2bacb3[_0x0825('0x56')][_0x0825('0x57')]){_0x2bacb3['body'][_0x0825('0x5d')]=_0x2bacb3['file'][_0x0825('0x57')];}return db[_0x0825('0x38')][_0x0825('0x52')]({'where':{'id':_0x2bacb3[_0x0825('0x54')]['id']}})['then'](handleEntityNotFound(_0x3df29c,null))[_0x0825('0x31')](saveUpdates(_0x2bacb3[_0x0825('0x53')],null))['then'](respondWithResult(_0x3df29c,null))[_0x0825('0x25')](handleError(_0x3df29c,null));};var utilLicense=require(_0x0825('0x17'));exports['getFavicon']=function(_0x478e17,_0x33ebf4,_0x5cec60){var _0x285920='server/files/images/logos';var _0x3a9248={'custom':![]};return utilLicense[_0x0825('0x5a')]()[_0x0825('0x31')](function(_0x11536b){if(_0x11536b){_0x3a9248=_0x11536b;}return db[_0x0825('0x38')]['find']({'where':{'id':_0x478e17[_0x0825('0x54')]['id']},'attributes':[_0x0825('0x5b'),'loginLogo',_0x0825('0x5c'),_0x0825('0x5d'),_0x0825('0x6c'),_0x0825('0x5e'),_0x0825('0x6d'),'defaultFavicon'],'raw':!![]});})[_0x0825('0x31')](handleEntityNotFound(_0x33ebf4,null))[_0x0825('0x31')](function(_0x207cdc){if(_0x207cdc){var _0x564aa4=_0x207cdc['favicon']&&fs[_0x0825('0x5f')](path[_0x0825('0x60')](config[_0x0825('0x62')],_0x285920,_[_0x0825('0x61')](_0x207cdc['favicon'])))?path[_0x0825('0x60')](config[_0x0825('0x62')],_0x285920,_[_0x0825('0x61')](_0x207cdc[_0x0825('0x5d')])):path['join'](config[_0x0825('0x62')],_0x285920,_['toLower'](_0x0825('0x76')));var _0x465b8f=_0x0825('0x63')+_[_0x0825('0x64')](_0x0825('0x5d'));if(_0x207cdc[_0x465b8f]||!_0x3a9248['custom']){_0x564aa4=path['join'](config[_0x0825('0x62')],_0x285920,_[_0x0825('0x61')](_0x0825('0x76')));}if(!fs[_0x0825('0x5f')](_0x564aa4)){throw new db[(_0x0825('0x67'))]['ValidationError'](_[_0x0825('0x64')](_0x0825('0x5d'))+_0x0825('0x77'));}return _0x33ebf4[_0x0825('0x69')](_0x564aa4);}})[_0x0825('0x25')](handleError(_0x33ebf4,null));};exports[_0x0825('0x78')]=function(_0x12e699,_0x5d8b52){var _0x33218f={'offset':moment()[_0x0825('0x79')]()};_0x33218f[_0x0825('0x7a')]=moment()[_0x0825('0x79')](_0x33218f[_0x0825('0x29')])['format'](_0x0825('0x7b'));return _0x5d8b52[_0x0825('0x26')](0xc8)[_0x0825('0x7c')](_0x33218f);};
\ No newline at end of file
+var _0xde9c=['options','includeAll','include','findAll','rows','show','params','find','body','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','../../config/license/util','getLogoLogin','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultFavicon','default_preferred.png','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','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','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','stack','send','index','map','Setting','rawAttributes','fieldName','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x33a75d,_0x2c22fe){var _0x2774fb=function(_0x877342){while(--_0x877342){_0x33a75d['push'](_0x33a75d['shift']());}};_0x2774fb(++_0x2c22fe);}(_0xde9c,0xa9));var _0xcde9=function(_0x2f7203,_0x4f9261){_0x2f7203=_0x2f7203-0x0;var _0x5aa66e=_0xde9c[_0x2f7203];return _0x5aa66e;};'use strict';var emlformat=require(_0xcde9('0x0'));var rimraf=require(_0xcde9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcde9('0x2'));var rp=require(_0xcde9('0x3'));var moment=require(_0xcde9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcde9('0x5'));var util=require(_0xcde9('0x6'));var path=require(_0xcde9('0x7'));var sox=require(_0xcde9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcde9('0x9'));var _=require(_0xcde9('0xa'));var squel=require(_0xcde9('0xb'));var crypto=require('crypto');var jsforce=require(_0xcde9('0xc'));var deskjs=require(_0xcde9('0xd'));var toCsv=require(_0xcde9('0xe'));var querystring=require(_0xcde9('0xf'));var Papa=require(_0xcde9('0x10'));var Redis=require(_0xcde9('0x11'));var authService=require(_0xcde9('0x12'));var qs=require(_0xcde9('0x13'));var as=require(_0xcde9('0x14'));var hardwareService=require(_0xcde9('0x15'));var logger=require(_0xcde9('0x16'))('api');var utils=require(_0xcde9('0x17'));var config=require(_0xcde9('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xcde9('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcdf4,_0x1681f8,_0x2ea3d2,_0xe08a4f){return new BPromise(function(_0x1d3254,_0x34e58e){var _0xe209f0=_0xe08a4f||client;return _0xe209f0[_0xcde9('0x1a')](_0xcdf4,_0x2ea3d2)[_0xcde9('0x1b')](function(_0x3181c4){logger[_0xcde9('0x1c')](_0xcde9('0x1d'),_0x1681f8,'request\x20sent');logger[_0xcde9('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x1681f8,_0xcde9('0x1f'),JSON[_0xcde9('0x20')](_0x3181c4));if(_0x3181c4['error']){if(_0x3181c4['error'][_0xcde9('0x21')]===0x1f4){logger[_0xcde9('0x22')]('Setting,\x20%s,\x20%s',_0x1681f8,_0x3181c4[_0xcde9('0x22')][_0xcde9('0x23')]);return _0x34e58e(_0x3181c4[_0xcde9('0x22')][_0xcde9('0x23')]);}logger[_0xcde9('0x22')]('Setting,\x20%s,\x20%s',_0x1681f8,_0x3181c4[_0xcde9('0x22')][_0xcde9('0x23')]);return _0x1d3254(_0x3181c4[_0xcde9('0x22')][_0xcde9('0x23')]);}else{logger[_0xcde9('0x1c')](_0xcde9('0x1d'),_0x1681f8,_0xcde9('0x1f'));_0x1d3254(_0x3181c4['result'][_0xcde9('0x23')]);}})[_0xcde9('0x24')](function(_0x40c4ae){logger[_0xcde9('0x22')]('Setting,\x20%s,\x20%s',_0x1681f8,_0x40c4ae);_0x34e58e(_0x40c4ae);});});}function respondWithStatusCode(_0x52899e,_0x2e004c){_0x2e004c=_0x2e004c||0xcc;return function(_0x2f90e6){if(_0x2f90e6){return _0x52899e[_0xcde9('0x25')](_0x2e004c);}return _0x52899e[_0xcde9('0x26')](_0x2e004c)[_0xcde9('0x27')]();};}function respondWithResult(_0x513883,_0x28cc34){_0x28cc34=_0x28cc34||0xc8;return function(_0x4979f3){if(_0x4979f3){return _0x513883[_0xcde9('0x26')](_0x28cc34)[_0xcde9('0x28')](_0x4979f3);}};}function respondWithFilteredResult(_0x43dca1,_0x64e0c8){return function(_0x257172){if(_0x257172){var _0x50a0c6=typeof _0x64e0c8[_0xcde9('0x29')]===_0xcde9('0x2a')&&typeof _0x64e0c8[_0xcde9('0x2b')]===_0xcde9('0x2a');var _0x28ffd3=_0x257172[_0xcde9('0x2c')];var _0x9c075f=_0x50a0c6?0x0:_0x64e0c8[_0xcde9('0x29')];var _0x1be49f=_0x50a0c6?_0x257172[_0xcde9('0x2c')]:_0x64e0c8[_0xcde9('0x29')]+_0x64e0c8[_0xcde9('0x2b')];var _0x58de4c;if(_0x1be49f>=_0x28ffd3){_0x1be49f=_0x28ffd3;_0x58de4c=0xc8;}else{_0x58de4c=0xce;}_0x43dca1[_0xcde9('0x26')](_0x58de4c);return _0x43dca1['set']('Content-Range',_0x9c075f+'-'+_0x1be49f+'/'+_0x28ffd3)[_0xcde9('0x28')](_0x257172);}return null;};}function patchUpdates(_0x29c8f6){return function(_0x5abf36){try{jsonpatch[_0xcde9('0x2d')](_0x5abf36,_0x29c8f6,!![]);}catch(_0x42f95a){return BPromise[_0xcde9('0x2e')](_0x42f95a);}return _0x5abf36[_0xcde9('0x2f')]();};}function saveUpdates(_0x196150,_0x317cb4){return function(_0x234ef1){if(_0x234ef1){return _0x234ef1[_0xcde9('0x30')](_0x196150)[_0xcde9('0x1b')](function(_0x3824d9){return _0x3824d9;});}return null;};}function removeEntity(_0xc11f0b,_0x4a85d4){return function(_0x4ae8f0){if(_0x4ae8f0){return _0x4ae8f0[_0xcde9('0x31')]()[_0xcde9('0x1b')](function(){_0xc11f0b[_0xcde9('0x26')](0xcc)[_0xcde9('0x27')]();});}};}function handleEntityNotFound(_0x3a74bd,_0x16784e){return function(_0x23c978){if(!_0x23c978){_0x3a74bd['sendStatus'](0x194);}return _0x23c978;};}function handleError(_0x19c2c9,_0x24f53a){_0x24f53a=_0x24f53a||0x1f4;return function(_0x5e88f6){logger['error'](_0x5e88f6[_0xcde9('0x32')]);if(_0x5e88f6['name']){delete _0x5e88f6['name'];}_0x19c2c9['status'](_0x24f53a)[_0xcde9('0x33')](_0x5e88f6);};}exports[_0xcde9('0x34')]=function(_0x22a7ae,_0x3cc087){var _0x51c3db={},_0xb5a786={},_0x4ca35a={'count':0x0,'rows':[]};var _0x3c5598=_[_0xcde9('0x35')](db[_0xcde9('0x36')][_0xcde9('0x37')],function(_0x1a6372){return{'name':_0x1a6372[_0xcde9('0x38')],'type':_0x1a6372['type']['key']};});_0xb5a786[_0xcde9('0x39')]=_[_0xcde9('0x35')](_0x3c5598,_0xcde9('0x3a'));_0xb5a786['query']=_['keys'](_0x22a7ae[_0xcde9('0x3b')]);_0xb5a786[_0xcde9('0x3c')]=_[_0xcde9('0x3d')](_0xb5a786[_0xcde9('0x39')],_0xb5a786[_0xcde9('0x3b')]);_0x51c3db['attributes']=_[_0xcde9('0x3d')](_0xb5a786[_0xcde9('0x39')],qs[_0xcde9('0x3e')](_0x22a7ae[_0xcde9('0x3b')][_0xcde9('0x3e')]));_0x51c3db['attributes']=_0x51c3db[_0xcde9('0x3f')][_0xcde9('0x40')]?_0x51c3db['attributes']:_0xb5a786[_0xcde9('0x39')];if(!_0x22a7ae[_0xcde9('0x3b')][_0xcde9('0x41')](_0xcde9('0x42'))){_0x51c3db[_0xcde9('0x2b')]=qs[_0xcde9('0x2b')](_0x22a7ae[_0xcde9('0x3b')][_0xcde9('0x2b')]);_0x51c3db[_0xcde9('0x29')]=qs[_0xcde9('0x29')](_0x22a7ae['query']['offset']);}_0x51c3db['order']=qs[_0xcde9('0x43')](_0x22a7ae['query']['sort']);_0x51c3db[_0xcde9('0x44')]=qs[_0xcde9('0x3c')](_[_0xcde9('0x45')](_0x22a7ae[_0xcde9('0x3b')],_0xb5a786['filters']),_0x3c5598);if(_0x22a7ae[_0xcde9('0x3b')][_0xcde9('0x46')]){_0x51c3db[_0xcde9('0x44')]=_[_0xcde9('0x47')](_0x51c3db[_0xcde9('0x44')],{'$or':_[_0xcde9('0x35')](_0x3c5598,function(_0x31910e){if(_0x31910e['type']!==_0xcde9('0x48')){var _0x159859={};_0x159859[_0x31910e[_0xcde9('0x3a')]]={'$like':'%'+_0x22a7ae[_0xcde9('0x3b')][_0xcde9('0x46')]+'%'};return _0x159859;}})});}_0x51c3db=_[_0xcde9('0x47')]({},_0x51c3db,_0x22a7ae[_0xcde9('0x49')]);var _0x154dfc={'where':_0x51c3db[_0xcde9('0x44')]};return db['Setting'][_0xcde9('0x2c')](_0x154dfc)['then'](function(_0x274e28){_0x4ca35a[_0xcde9('0x2c')]=_0x274e28;if(_0x22a7ae[_0xcde9('0x3b')][_0xcde9('0x4a')]){_0x51c3db[_0xcde9('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xcde9('0x4c')](_0x51c3db);})[_0xcde9('0x1b')](function(_0x228000){_0x4ca35a[_0xcde9('0x4d')]=_0x228000;return _0x4ca35a;})[_0xcde9('0x1b')](respondWithFilteredResult(_0x3cc087,_0x51c3db))[_0xcde9('0x24')](handleError(_0x3cc087,null));};exports[_0xcde9('0x4e')]=function(_0x2611f8,_0x2e47fe){var _0x4667e9={'raw':![],'where':{'id':_0x2611f8[_0xcde9('0x4f')]['id']}},_0x19b80f={};_0x19b80f['model']=_['keys'](db['Setting']['rawAttributes']);_0x19b80f[_0xcde9('0x3b')]=_['keys'](_0x2611f8['query']);_0x19b80f['filters']=_['intersection'](_0x19b80f[_0xcde9('0x39')],_0x19b80f[_0xcde9('0x3b')]);_0x4667e9[_0xcde9('0x3f')]=_[_0xcde9('0x3d')](_0x19b80f[_0xcde9('0x39')],qs[_0xcde9('0x3e')](_0x2611f8[_0xcde9('0x3b')][_0xcde9('0x3e')]));_0x4667e9['attributes']=_0x4667e9['attributes'][_0xcde9('0x40')]?_0x4667e9[_0xcde9('0x3f')]:_0x19b80f[_0xcde9('0x39')];if(_0x2611f8[_0xcde9('0x3b')][_0xcde9('0x4a')]){_0x4667e9[_0xcde9('0x4b')]=[{'all':!![]}];}_0x4667e9=_[_0xcde9('0x47')]({},_0x4667e9,_0x2611f8['options']);return db[_0xcde9('0x36')][_0xcde9('0x50')](_0x4667e9)[_0xcde9('0x1b')](handleEntityNotFound(_0x2e47fe,null))[_0xcde9('0x1b')](respondWithResult(_0x2e47fe,null))[_0xcde9('0x24')](handleError(_0x2e47fe,null));};exports['update']=function(_0x24528a,_0x36bc02){if(_0x24528a['body']['id']){delete _0x24528a[_0xcde9('0x51')]['id'];}return db[_0xcde9('0x36')][_0xcde9('0x50')]({'where':{'id':_0x24528a[_0xcde9('0x4f')]['id']}})[_0xcde9('0x1b')](handleEntityNotFound(_0x36bc02,null))[_0xcde9('0x1b')](saveUpdates(_0x24528a['body'],null))[_0xcde9('0x1b')](respondWithResult(_0x36bc02,null))['catch'](handleError(_0x36bc02,null));};exports['addLogo']=function(_0x23d83a,_0x1e37e8,_0x221fab){if(_0x23d83a[_0xcde9('0x52')]&&_0x23d83a[_0xcde9('0x52')][_0xcde9('0x53')]){_0x23d83a[_0xcde9('0x51')][_0xcde9('0x54')]=_0x23d83a[_0xcde9('0x52')]['filename'];}return db['Setting'][_0xcde9('0x50')]({'where':{'id':_0x23d83a['params']['id']}})[_0xcde9('0x1b')](handleEntityNotFound(_0x1e37e8,null))[_0xcde9('0x1b')](saveUpdates(_0x23d83a[_0xcde9('0x51')],null))[_0xcde9('0x1b')](respondWithResult(_0x1e37e8,null))[_0xcde9('0x24')](handleError(_0x1e37e8,null));};exports[_0xcde9('0x55')]=function(_0x3341ef,_0xdfc11d,_0x421395){if(_0x3341ef[_0xcde9('0x52')]&&_0x3341ef[_0xcde9('0x52')][_0xcde9('0x53')]){_0x3341ef[_0xcde9('0x51')][_0xcde9('0x56')]=_0x3341ef[_0xcde9('0x52')][_0xcde9('0x53')];}return db[_0xcde9('0x36')][_0xcde9('0x50')]({'where':{'id':_0x3341ef[_0xcde9('0x4f')]['id']}})[_0xcde9('0x1b')](handleEntityNotFound(_0xdfc11d,null))['then'](saveUpdates(_0x3341ef[_0xcde9('0x51')],null))[_0xcde9('0x1b')](respondWithResult(_0xdfc11d,null))[_0xcde9('0x24')](handleError(_0xdfc11d,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x5b4422,_0x2920e8,_0x2fa26b){var _0x3a74cd=_0xcde9('0x57');var _0x170c43={'custom':![]};return utilLicense['getLicense']()[_0xcde9('0x1b')](function(_0x3a7582){if(_0x3a7582){_0x170c43=_0x3a7582;}return db['Setting'][_0xcde9('0x50')]({'where':{'id':_0x5b4422[_0xcde9('0x4f')]['id']},'attributes':[_0xcde9('0x54'),_0xcde9('0x56'),_0xcde9('0x58'),_0xcde9('0x59'),_0xcde9('0x5a'),_0xcde9('0x5b'),_0xcde9('0x5c'),'defaultFavicon'],'raw':!![]});})[_0xcde9('0x1b')](handleEntityNotFound(_0x2920e8,null))[_0xcde9('0x1b')](function(_0x390a3e){if(_0x390a3e){var _0x424efd=_0x390a3e[_0xcde9('0x54')]&&fs[_0xcde9('0x5d')](path[_0xcde9('0x5e')](config['root'],_0x3a74cd,_[_0xcde9('0x5f')](_0x390a3e[_0xcde9('0x54')])))?path['join'](config[_0xcde9('0x60')],_0x3a74cd,_[_0xcde9('0x5f')](_0x390a3e[_0xcde9('0x54')])):path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x3a74cd,_[_0xcde9('0x5f')](_0xcde9('0x61')));var _0x3f0d88=_0xcde9('0x62')+_[_0xcde9('0x63')](_0xcde9('0x54'));if(_0x390a3e[_0x3f0d88]||!_0x170c43[_0xcde9('0x64')]){_0x424efd=path['join'](config[_0xcde9('0x60')],_0x3a74cd,_[_0xcde9('0x5f')](_0xcde9('0x61')));}if(!fs[_0xcde9('0x5d')](_0x424efd)){throw new db[(_0xcde9('0x65'))][(_0xcde9('0x66'))](_[_0xcde9('0x63')](_0xcde9('0x54'))+_0xcde9('0x67'));}return _0x2920e8[_0xcde9('0x68')](_0x424efd);}})[_0xcde9('0x24')](handleError(_0x2920e8,null));};var utilLicense=require(_0xcde9('0x69'));exports[_0xcde9('0x6a')]=function(_0x291e52,_0x446188,_0x3fbb03){var _0x572f9e='server/files/images/logos';var _0x4c0aed={'custom':![]};return utilLicense[_0xcde9('0x6b')]()['then'](function(_0xe5ad3f){if(_0xe5ad3f){_0x4c0aed=_0xe5ad3f;}return db[_0xcde9('0x36')]['find']({'where':{'id':_0x291e52['params']['id']},'attributes':[_0xcde9('0x54'),_0xcde9('0x56'),_0xcde9('0x58'),_0xcde9('0x59'),_0xcde9('0x5a'),_0xcde9('0x5b'),_0xcde9('0x5c'),'defaultFavicon'],'raw':!![]});})[_0xcde9('0x1b')](handleEntityNotFound(_0x446188,null))[_0xcde9('0x1b')](function(_0x2f6a7a){if(_0x2f6a7a){var _0x4382b7=_0x2f6a7a[_0xcde9('0x56')]&&fs['existsSync'](path['join'](config[_0xcde9('0x60')],_0x572f9e,_[_0xcde9('0x5f')](_0x2f6a7a[_0xcde9('0x56')])))?path['join'](config[_0xcde9('0x60')],_0x572f9e,_['toLower'](_0x2f6a7a[_0xcde9('0x56')])):path['join'](config[_0xcde9('0x60')],_0x572f9e,_[_0xcde9('0x5f')](_0xcde9('0x6c')));var _0x5d0c3b=_0xcde9('0x62')+_[_0xcde9('0x63')](_0xcde9('0x56'));if(_0x2f6a7a[_0x5d0c3b]||!_0x4c0aed[_0xcde9('0x64')]){_0x4382b7=path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x572f9e,_[_0xcde9('0x5f')](_0xcde9('0x6c')));}if(!fs['existsSync'](_0x4382b7)){throw new db[(_0xcde9('0x65'))][(_0xcde9('0x66'))](_[_0xcde9('0x63')](_0xcde9('0x56'))+_0xcde9('0x67'));}return _0x446188[_0xcde9('0x68')](_0x4382b7);}})[_0xcde9('0x24')](handleError(_0x446188,null));};exports[_0xcde9('0x6d')]=function(_0x1af109,_0x1ea168){return db[_0xcde9('0x36')][_0xcde9('0x50')]({'where':{'id':_0x1af109[_0xcde9('0x4f')]['id']},'attributes':[_0xcde9('0x6e')]})[_0xcde9('0x1b')](respondWithResult(_0x1ea168,null))[_0xcde9('0x24')](handleError(_0x1ea168,null));};exports[_0xcde9('0x6f')]=function(_0x18b651,_0xdc677b,_0x2b416d){if(_0x18b651[_0xcde9('0x52')]&&_0x18b651['file'][_0xcde9('0x53')]){_0x18b651[_0xcde9('0x51')][_0xcde9('0x58')]=_0x18b651['file'][_0xcde9('0x53')];}return db[_0xcde9('0x36')]['find']({'where':{'id':_0x18b651['params']['id']}})[_0xcde9('0x1b')](handleEntityNotFound(_0xdc677b,null))[_0xcde9('0x1b')](saveUpdates(_0x18b651[_0xcde9('0x51')],null))[_0xcde9('0x1b')](respondWithResult(_0xdc677b,null))[_0xcde9('0x24')](handleError(_0xdc677b,null));};var utilLicense=require('../../config/license/util');exports[_0xcde9('0x70')]=function(_0x2e36ea,_0xe18270,_0x406cf3){var _0x30274a=_0xcde9('0x57');var _0x56a255={'custom':![]};return utilLicense[_0xcde9('0x6b')]()['then'](function(_0xb5af86){if(_0xb5af86){_0x56a255=_0xb5af86;}return db[_0xcde9('0x36')][_0xcde9('0x50')]({'where':{'id':_0x2e36ea[_0xcde9('0x4f')]['id']},'attributes':[_0xcde9('0x54'),_0xcde9('0x56'),_0xcde9('0x58'),'favicon','defaultLogo',_0xcde9('0x5b'),'defaultPreferred',_0xcde9('0x71')],'raw':!![]});})['then'](handleEntityNotFound(_0xe18270,null))[_0xcde9('0x1b')](function(_0x12660e){if(_0x12660e){var _0x1c4bc5=_0x12660e[_0xcde9('0x58')]&&fs[_0xcde9('0x5d')](path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x30274a,_['toLower'](_0x12660e[_0xcde9('0x58')])))?path['join'](config[_0xcde9('0x60')],_0x30274a,_['toLower'](_0x12660e[_0xcde9('0x58')])):path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x30274a,_[_0xcde9('0x5f')](_0xcde9('0x72')));var _0x3928b8=_0xcde9('0x62')+_['upperFirst'](_0xcde9('0x58'));if(_0x12660e[_0x3928b8]||!_0x56a255['custom']||!_0x56a255[_0xcde9('0x58')]){_0x1c4bc5=path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x30274a,_[_0xcde9('0x5f')]('default_preferred.png'));}if(!fs[_0xcde9('0x5d')](_0x1c4bc5)){throw new db[(_0xcde9('0x65'))][(_0xcde9('0x66'))](_['upperFirst'](_0xcde9('0x58'))+_0xcde9('0x67'));}return _0xe18270[_0xcde9('0x68')](_0x1c4bc5);}})['catch'](handleError(_0xe18270,null));};exports['addFavicon']=function(_0x3f614e,_0x298d74,_0x3e76ac){if(_0x3f614e[_0xcde9('0x52')]&&_0x3f614e[_0xcde9('0x52')]['filename']){_0x3f614e[_0xcde9('0x51')]['favicon']=_0x3f614e[_0xcde9('0x52')][_0xcde9('0x53')];}return db[_0xcde9('0x36')][_0xcde9('0x50')]({'where':{'id':_0x3f614e[_0xcde9('0x4f')]['id']}})[_0xcde9('0x1b')](handleEntityNotFound(_0x298d74,null))[_0xcde9('0x1b')](saveUpdates(_0x3f614e[_0xcde9('0x51')],null))[_0xcde9('0x1b')](respondWithResult(_0x298d74,null))[_0xcde9('0x24')](handleError(_0x298d74,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0xd6169e,_0x49907d,_0x350041){var _0x5e24c8=_0xcde9('0x57');var _0x781bda={'custom':![]};return utilLicense[_0xcde9('0x6b')]()['then'](function(_0x532a2c){if(_0x532a2c){_0x781bda=_0x532a2c;}return db['Setting']['find']({'where':{'id':_0xd6169e[_0xcde9('0x4f')]['id']},'attributes':[_0xcde9('0x54'),_0xcde9('0x56'),'preferred',_0xcde9('0x59'),_0xcde9('0x5a'),_0xcde9('0x5b'),_0xcde9('0x5c'),'defaultFavicon'],'raw':!![]});})[_0xcde9('0x1b')](handleEntityNotFound(_0x49907d,null))[_0xcde9('0x1b')](function(_0x5d8977){if(_0x5d8977){var _0x39a400=_0x5d8977['favicon']&&fs[_0xcde9('0x5d')](path['join'](config[_0xcde9('0x60')],_0x5e24c8,_['toLower'](_0x5d8977[_0xcde9('0x59')])))?path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x5e24c8,_[_0xcde9('0x5f')](_0x5d8977[_0xcde9('0x59')])):path['join'](config['root'],_0x5e24c8,_[_0xcde9('0x5f')](_0xcde9('0x73')));var _0x20d794=_0xcde9('0x62')+_[_0xcde9('0x63')](_0xcde9('0x59'));if(_0x5d8977[_0x20d794]||!_0x781bda['custom']){_0x39a400=path[_0xcde9('0x5e')](config[_0xcde9('0x60')],_0x5e24c8,_[_0xcde9('0x5f')](_0xcde9('0x73')));}if(!fs[_0xcde9('0x5d')](_0x39a400)){throw new db[(_0xcde9('0x65'))][(_0xcde9('0x66'))](_[_0xcde9('0x63')](_0xcde9('0x59'))+_0xcde9('0x67'));}return _0x49907d[_0xcde9('0x68')](_0x39a400);}})[_0xcde9('0x24')](handleError(_0x49907d,null));};exports[_0xcde9('0x74')]=function(_0x45ee68,_0x5ddeb8){var _0x909640={'offset':moment()[_0xcde9('0x75')]()};_0x909640[_0xcde9('0x76')]=moment()[_0xcde9('0x75')](_0x909640[_0xcde9('0x29')])[_0xcde9('0x77')](_0xcde9('0x78'));return _0x5ddeb8[_0xcde9('0x26')](0xc8)[_0xcde9('0x33')](_0x909640);};
\ No newline at end of file
index ac8707b..72d6970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x1a41b0,_0x3c7f6d){var _0x4b56f3=function(_0x27d640){while(--_0x27d640){_0x1a41b0['push'](_0x1a41b0['shift']());}};_0x4b56f3(++_0x3c7f6d);}(_0x34e8,0x12c));var _0x834e=function(_0x128f18,_0x5242e8){_0x128f18=_0x128f18-0x0;var _0x24f389=_0x34e8[_0x128f18];return _0x24f389;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x7217,0x19e));var _0x7721=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x7217[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5863763..f0ba6f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd7=['code','Setting,\x20%s,\x20%s','message','info','catch','ShowSetting','Setting','find','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error'];(function(_0x5218c0,_0x2591df){var _0xc5dba=function(_0x54f32d){while(--_0x54f32d){_0x5218c0['push'](_0x5218c0['shift']());}};_0xc5dba(++_0x2591df);}(_0x5cd7,0x127));var _0x75cd=function(_0x2ad1b8,_0x1ea09b){_0x2ad1b8=_0x2ad1b8-0x0;var _0x52547d=_0x5cd7[_0x2ad1b8];return _0x52547d;};'use strict';var _=require(_0x75cd('0x0'));var util=require(_0x75cd('0x1'));var moment=require(_0x75cd('0x2'));var BPromise=require(_0x75cd('0x3'));var rs=require(_0x75cd('0x4'));var fs=require('fs');var Redis=require(_0x75cd('0x5'));var db=require(_0x75cd('0x6'))['db'];var utils=require(_0x75cd('0x7'));var logger=require(_0x75cd('0x8'))(_0x75cd('0x9'));var config=require(_0x75cd('0xa'));var jayson=require(_0x75cd('0xb'));var client=jayson[_0x75cd('0xc')][_0x75cd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53acd8,_0x4d19b5,_0xcf0a53){return new BPromise(function(_0x14e107,_0x4b6ce2){return client[_0x75cd('0xe')](_0x53acd8,_0xcf0a53)[_0x75cd('0xf')](function(_0x34b1ca){logger['info']('Setting,\x20%s,\x20%s',_0x4d19b5,_0x75cd('0x10'));logger[_0x75cd('0x11')](_0x75cd('0x12'),_0x4d19b5,_0x75cd('0x10'),JSON['stringify'](_0x34b1ca));if(_0x34b1ca[_0x75cd('0x13')]){if(_0x34b1ca[_0x75cd('0x13')][_0x75cd('0x14')]===0x1f4){logger[_0x75cd('0x13')](_0x75cd('0x15'),_0x4d19b5,_0x34b1ca['error'][_0x75cd('0x16')]);return _0x4b6ce2(_0x34b1ca['error']['message']);}logger[_0x75cd('0x13')](_0x75cd('0x15'),_0x4d19b5,_0x34b1ca[_0x75cd('0x13')][_0x75cd('0x16')]);return _0x14e107(_0x34b1ca['error'][_0x75cd('0x16')]);}else{logger[_0x75cd('0x17')](_0x75cd('0x15'),_0x4d19b5,_0x75cd('0x10'));_0x14e107(_0x34b1ca['result'][_0x75cd('0x16')]);}})[_0x75cd('0x18')](function(_0x2fb657){logger[_0x75cd('0x13')](_0x75cd('0x15'),_0x4d19b5,_0x2fb657);_0x4b6ce2(_0x2fb657);});});}exports[_0x75cd('0x19')]=function(_0xbce6ea){var _0x1402df=this;return new Promise(function(_0x3f27c3,_0x371594){return db[_0x75cd('0x1a')][_0x75cd('0x1b')]({'raw':_0xbce6ea['options']?_0xbce6ea['options']['raw']===undefined?!![]:![]:!![],'where':_0xbce6ea[_0x75cd('0x1c')]?_0xbce6ea[_0x75cd('0x1c')][_0x75cd('0x1d')]||null:null,'attributes':_0xbce6ea['options']?_0xbce6ea['options'][_0x75cd('0x1e')]||null:null,'include':_0xbce6ea['options']?_0xbce6ea[_0x75cd('0x1c')][_0x75cd('0x1f')]?_['map'](_0xbce6ea[_0x75cd('0x1c')][_0x75cd('0x1f')],function(_0x35c7e7){return{'model':db[_0x35c7e7[_0x75cd('0x20')]],'as':_0x35c7e7['as'],'attributes':_0x35c7e7[_0x75cd('0x1e')],'include':_0x35c7e7[_0x75cd('0x1f')]?_[_0x75cd('0x21')](_0x35c7e7['include'],function(_0x1603cd){return{'model':db[_0x1603cd[_0x75cd('0x20')]],'as':_0x1603cd['as'],'attributes':_0x1603cd[_0x75cd('0x1e')],'include':_0x1603cd[_0x75cd('0x1f')]?_[_0x75cd('0x21')](_0x1603cd['include'],function(_0x5f2bb1){return{'model':db[_0x5f2bb1['model']],'as':_0x5f2bb1['as'],'attributes':_0x5f2bb1[_0x75cd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x75cd('0xf')](function(_0x2152b0){logger[_0x75cd('0x17')](_0x75cd('0x19'),_0xbce6ea);logger[_0x75cd('0x11')](_0x75cd('0x19'),_0xbce6ea,JSON[_0x75cd('0x22')](_0x2152b0));_0x3f27c3(_0x2152b0);})[_0x75cd('0x18')](function(_0x4bd32b){logger['error'](_0x75cd('0x19'),_0x4bd32b[_0x75cd('0x16')],_0xbce6ea);_0x371594(_0x1402df[_0x75cd('0x13')](0x1f4,_0x4bd32b[_0x75cd('0x16')]));});});};
\ No newline at end of file
+var _0xb5ce=['request\x20sent','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x483d2b,_0x2dd6d1){var _0x8d6023=function(_0x526a46){while(--_0x526a46){_0x483d2b['push'](_0x483d2b['shift']());}};_0x8d6023(++_0x2dd6d1);}(_0xb5ce,0xd8));var _0xeb5c=function(_0x1f9a81,_0x33ad2d){_0x1f9a81=_0x1f9a81-0x0;var _0xd0a764=_0xb5ce[_0x1f9a81];return _0xd0a764;};'use strict';var _=require(_0xeb5c('0x0'));var util=require(_0xeb5c('0x1'));var moment=require('moment');var BPromise=require(_0xeb5c('0x2'));var rs=require(_0xeb5c('0x3'));var fs=require('fs');var Redis=require(_0xeb5c('0x4'));var db=require(_0xeb5c('0x5'))['db'];var utils=require(_0xeb5c('0x6'));var logger=require(_0xeb5c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb5c('0x8'));var client=jayson[_0xeb5c('0x9')][_0xeb5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d2290,_0x210c21,_0x3d0b25){return new BPromise(function(_0x588ed3,_0x53dfd5){return client['request'](_0x4d2290,_0x3d0b25)[_0xeb5c('0xb')](function(_0x2c4e41){logger[_0xeb5c('0xc')]('Setting,\x20%s,\x20%s',_0x210c21,'request\x20sent');logger[_0xeb5c('0xd')](_0xeb5c('0xe'),_0x210c21,_0xeb5c('0xf'),JSON['stringify'](_0x2c4e41));if(_0x2c4e41[_0xeb5c('0x10')]){if(_0x2c4e41[_0xeb5c('0x10')][_0xeb5c('0x11')]===0x1f4){logger['error'](_0xeb5c('0x12'),_0x210c21,_0x2c4e41[_0xeb5c('0x10')]['message']);return _0x53dfd5(_0x2c4e41['error'][_0xeb5c('0x13')]);}logger[_0xeb5c('0x10')]('Setting,\x20%s,\x20%s',_0x210c21,_0x2c4e41['error'][_0xeb5c('0x13')]);return _0x588ed3(_0x2c4e41[_0xeb5c('0x10')][_0xeb5c('0x13')]);}else{logger[_0xeb5c('0xc')](_0xeb5c('0x12'),_0x210c21,_0xeb5c('0xf'));_0x588ed3(_0x2c4e41[_0xeb5c('0x14')][_0xeb5c('0x13')]);}})[_0xeb5c('0x15')](function(_0x4007c1){logger[_0xeb5c('0x10')](_0xeb5c('0x12'),_0x210c21,_0x4007c1);_0x53dfd5(_0x4007c1);});});}exports[_0xeb5c('0x16')]=function(_0xf44f5a){var _0x4cee64=this;return new Promise(function(_0x54ac67,_0x9dd057){return db[_0xeb5c('0x17')][_0xeb5c('0x18')]({'raw':_0xf44f5a[_0xeb5c('0x19')]?_0xf44f5a['options'][_0xeb5c('0x1a')]===undefined?!![]:![]:!![],'where':_0xf44f5a['options']?_0xf44f5a[_0xeb5c('0x19')][_0xeb5c('0x1b')]||null:null,'attributes':_0xf44f5a[_0xeb5c('0x19')]?_0xf44f5a[_0xeb5c('0x19')][_0xeb5c('0x1c')]||null:null,'include':_0xf44f5a['options']?_0xf44f5a[_0xeb5c('0x19')][_0xeb5c('0x1d')]?_[_0xeb5c('0x1e')](_0xf44f5a['options'][_0xeb5c('0x1d')],function(_0xcb4052){return{'model':db[_0xcb4052[_0xeb5c('0x1f')]],'as':_0xcb4052['as'],'attributes':_0xcb4052[_0xeb5c('0x1c')],'include':_0xcb4052[_0xeb5c('0x1d')]?_['map'](_0xcb4052['include'],function(_0x42319a){return{'model':db[_0x42319a[_0xeb5c('0x1f')]],'as':_0x42319a['as'],'attributes':_0x42319a[_0xeb5c('0x1c')],'include':_0x42319a[_0xeb5c('0x1d')]?_[_0xeb5c('0x1e')](_0x42319a[_0xeb5c('0x1d')],function(_0x45e368){return{'model':db[_0x45e368['model']],'as':_0x45e368['as'],'attributes':_0x45e368[_0xeb5c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeb5c('0xb')](function(_0x4ce561){logger[_0xeb5c('0xc')](_0xeb5c('0x16'),_0xf44f5a);logger[_0xeb5c('0xd')](_0xeb5c('0x16'),_0xf44f5a,JSON[_0xeb5c('0x20')](_0x4ce561));_0x54ac67(_0x4ce561);})[_0xeb5c('0x15')](function(_0x32124a){logger[_0xeb5c('0x10')](_0xeb5c('0x16'),_0x32124a['message'],_0xf44f5a);_0x9dd057(_0x4cee64['error'](0x1f4,_0x32124a[_0xeb5c('0x13')]));});});};
\ No newline at end of file
index 030019d..d8ac4cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x699072,_0x3aca68){var _0x44edc2=function(_0x3c1e8b){while(--_0x3c1e8b){_0x699072['push'](_0x699072['shift']());}};_0x44edc2(++_0x3aca68);}(_0xe14b,0x93));var _0xbe14=function(_0x416b6a,_0x494320){_0x416b6a=_0x416b6a-0x0;var _0x2c34e1=_0xe14b[_0x416b6a];return _0x2c34e1;};'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['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0x5fab,0x177));var _0xb5fa=function(_0x4b5b86,_0x23c37a){_0x4b5b86=_0x4b5b86-0x0;var _0xd965ac=_0x5fab[_0x4b5b86];return _0xd965ac;};'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['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router;
\ No newline at end of file
index a2c92dd..44a885b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a8=['bandwidth','csc','infobip','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','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','skebby'];(function(_0x3d71d3,_0x11caf1){var _0x30ec87=function(_0x308f30){while(--_0x308f30){_0x3d71d3['push'](_0x3d71d3['shift']());}};_0x30ec87(++_0x11caf1);}(_0x58a8,0x187));var _0x858a=function(_0x2631cb,_0x4f5593){_0x2631cb=_0x2631cb-0x0;var _0x13fad3=_0x58a8[_0x2631cb];return _0x13fad3;};'use strict';var Sequelize=require(_0x858a('0x0'));var rs=require(_0x858a('0x1'));module['exports']={'name':{'type':Sequelize[_0x858a('0x2')],'unique':_0x858a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x858a('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x858a('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x858a('0x5')](_0x858a('0x6'),_0x858a('0x7'),'connectel','clicksend','plivo','clickatell',_0x858a('0x8'),_0x858a('0x9'),_0x858a('0xa'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x858a('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x858a('0x2')]},'password':{'type':Sequelize[_0x858a('0x2')]},'apiKey':{'type':Sequelize[_0x858a('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x858a('0x2')]},'senderString':{'type':Sequelize[_0x858a('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x858a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x858a('0xb')],'defaultValue':function(){return _0x858a('0xc');}},'notificationSound':{'type':Sequelize[_0x858a('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x858a('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x858a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x858a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x858a('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x858a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x858a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x858a('0xe')],'comment':_0x858a('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x858a('0xd')],'defaultValue':![],'comment':_0x858a('0x10'),'set':function(_0x1c2a14){if(!_0x1c2a14)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x858a('0x11')](_0x858a('0x12'),_0x1c2a14);}}};
\ No newline at end of file
+var _0xfada=['BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','infobip','intelepeer'];(function(_0x3e6bfc,_0x2d946e){var _0x2ceaa2=function(_0x426f14){while(--_0x426f14){_0x3e6bfc['push'](_0x3e6bfc['shift']());}};_0x2ceaa2(++_0x2d946e);}(_0xfada,0xbb));var _0xafad=function(_0x132a22,_0x4766d6){_0x132a22=_0x132a22-0x0;var _0x23264f=_0xfada[_0x132a22];return _0x23264f;};'use strict';var Sequelize=require(_0xafad('0x0'));var rs=require('randomstring');module[_0xafad('0x1')]={'name':{'type':Sequelize[_0xafad('0x2')],'unique':_0xafad('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xafad('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xafad('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xafad('0x2')]},'type':{'type':Sequelize[_0xafad('0x4')](_0xafad('0x5'),_0xafad('0x6'),_0xafad('0x7'),_0xafad('0x8'),_0xafad('0x9'),'clickatell',_0xafad('0xa'),'csc',_0xafad('0xb'),_0xafad('0xc'))},'accountSid':{'type':Sequelize[_0xafad('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xafad('0x2')]},'smsMethod':{'type':Sequelize[_0xafad('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xafad('0x2')]},'apiKey':{'type':Sequelize[_0xafad('0x2')]},'applicationId':{'type':Sequelize[_0xafad('0x2')]},'accountId':{'type':Sequelize[_0xafad('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xafad('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xafad('0x2')]},'notificationTemplate':{'type':Sequelize[_0xafad('0xe')],'defaultValue':function(){return _0xafad('0xf');}},'notificationSound':{'type':Sequelize[_0xafad('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xafad('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xafad('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xafad('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xafad('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xafad('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xafad('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xafad('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4c115f){if(!_0x4c115f)this[_0xafad('0x11')](_0xafad('0x12'),null);this['setDataValue'](_0xafad('0x13'),_0x4c115f);}}};
\ No newline at end of file
index f34ba1b..6a7118d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4315=['keys','query','filters','intersection','model','fields','attributes','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','SmsAccountId','findOne','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','ids','sms','SmsApplication','Applications','account','applications','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','clicksend','message_id','plivo','Text','MessageUUID','results','text','csc','segmentedMessage','clickatell','bandwidth','intelepeer','refid','ValidationError','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','updatedAt','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key'];(function(_0x5c7d6f,_0x5e14bc){var _0x24f1db=function(_0x12e5a4){while(--_0x12e5a4){_0x5c7d6f['push'](_0x5c7d6f['shift']());}};_0x24f1db(++_0x5e14bc);}(_0x4315,0x180));var _0x5431=function(_0x2c4aef,_0x116fe2){_0x2c4aef=_0x2c4aef-0x0;var _0x3deaed=_0x4315[_0x2c4aef];return _0x3deaed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5431('0x0'));var zipdir=require(_0x5431('0x1'));var jsonpatch=require(_0x5431('0x2'));var rp=require('request-promise');var moment=require(_0x5431('0x3'));var BPromise=require(_0x5431('0x4'));var Mustache=require(_0x5431('0x5'));var util=require(_0x5431('0x6'));var path=require(_0x5431('0x7'));var sox=require('sox');var csv=require(_0x5431('0x8'));var ejs=require(_0x5431('0x9'));var fs=require('fs');var fs_extra=require(_0x5431('0xa'));var _=require(_0x5431('0xb'));var squel=require(_0x5431('0xc'));var crypto=require('crypto');var jsforce=require(_0x5431('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5431('0x8'));var querystring=require(_0x5431('0xe'));var Papa=require(_0x5431('0xf'));var Redis=require(_0x5431('0x10'));var authService=require(_0x5431('0x11'));var qs=require(_0x5431('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5431('0x13'));var logger=require(_0x5431('0x14'))('api');var utils=require(_0x5431('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5431('0x16'))['db'];config['redis']=_[_0x5431('0x17')](config[_0x5431('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5431('0x19'))(new Redis(config[_0x5431('0x18')]));require(_0x5431('0x1a'))[_0x5431('0x1b')](socket);var jayson=require(_0x5431('0x1c'));var client=jayson['client'][_0x5431('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x4225de,_0x3c7e3c,_0x1e3ba9,_0x51e6a0){return new BPromise(function(_0x219c92,_0x5b3980){var _0x386170=_0x51e6a0||client;return _0x386170[_0x5431('0x1e')](_0x4225de,_0x1e3ba9)[_0x5431('0x1f')](function(_0x6998df){logger[_0x5431('0x20')]('SmsAccount,\x20%s,\x20%s',_0x3c7e3c,_0x5431('0x21'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3c7e3c,_0x5431('0x21'),JSON[_0x5431('0x22')](_0x6998df));if(_0x6998df[_0x5431('0x23')]){if(_0x6998df[_0x5431('0x23')][_0x5431('0x24')]===0x1f4){logger[_0x5431('0x23')]('SmsAccount,\x20%s,\x20%s',_0x3c7e3c,_0x6998df[_0x5431('0x23')]['message']);return _0x5b3980(_0x6998df[_0x5431('0x23')][_0x5431('0x25')]);}logger[_0x5431('0x23')]('SmsAccount,\x20%s,\x20%s',_0x3c7e3c,_0x6998df['error'][_0x5431('0x25')]);return _0x219c92(_0x6998df['error']['message']);}else{logger[_0x5431('0x20')]('SmsAccount,\x20%s,\x20%s',_0x3c7e3c,_0x5431('0x21'));_0x219c92(_0x6998df['result'][_0x5431('0x25')]);}})['catch'](function(_0xb762b){logger[_0x5431('0x23')](_0x5431('0x26'),_0x3c7e3c,_0xb762b);_0x5b3980(_0xb762b);});});}function respondWithStatusCode(_0x3dfe85,_0x1cef19){_0x1cef19=_0x1cef19||0xcc;return function(_0x37895b){if(_0x37895b){return _0x3dfe85['sendStatus'](_0x1cef19);}return _0x3dfe85['status'](_0x1cef19)[_0x5431('0x27')]();};}function respondWithResult(_0x50c7c4,_0x673f3e){_0x673f3e=_0x673f3e||0xc8;return function(_0x5a2c80){if(_0x5a2c80){return _0x50c7c4[_0x5431('0x28')](_0x673f3e)['json'](_0x5a2c80);}};}function respondWithFilteredResult(_0x38cfed,_0xc0bb29){return function(_0x5e1e9d){if(_0x5e1e9d){var _0x22f4b2=typeof _0xc0bb29[_0x5431('0x29')]==='undefined'&&typeof _0xc0bb29['limit']===_0x5431('0x2a');var _0x39ae33=_0x5e1e9d['count'];var _0x21de24=_0x22f4b2?0x0:_0xc0bb29[_0x5431('0x29')];var _0x207e43=_0x22f4b2?_0x5e1e9d[_0x5431('0x2b')]:_0xc0bb29['offset']+_0xc0bb29['limit'];var _0x1082bf;if(_0x207e43>=_0x39ae33){_0x207e43=_0x39ae33;_0x1082bf=0xc8;}else{_0x1082bf=0xce;}_0x38cfed[_0x5431('0x28')](_0x1082bf);return _0x38cfed[_0x5431('0x2c')](_0x5431('0x2d'),_0x21de24+'-'+_0x207e43+'/'+_0x39ae33)[_0x5431('0x2e')](_0x5e1e9d);}return null;};}function patchUpdates(_0xe28cdf){return function(_0x2b6253){try{jsonpatch[_0x5431('0x2f')](_0x2b6253,_0xe28cdf,!![]);}catch(_0x4660d3){return BPromise[_0x5431('0x30')](_0x4660d3);}return _0x2b6253['save']();};}function saveUpdates(_0x3b6805,_0x2d18ec){return function(_0x14c529){if(_0x14c529){return _0x14c529[_0x5431('0x31')](_0x3b6805)[_0x5431('0x1f')](function(_0x453ef6){return _0x453ef6;});}return null;};}function removeEntity(_0x37e6a1,_0x59354a){return function(_0x2eca20){if(_0x2eca20){return _0x2eca20[_0x5431('0x32')]()['then'](function(){var _0x4bbb08=_0x2eca20['get']({'plain':!![]});var _0x2157a6='SmsAccounts';return db[_0x5431('0x33')][_0x5431('0x32')]({'where':{'type':_0x2157a6,'resourceId':_0x4bbb08['id']}})[_0x5431('0x1f')](function(){return _0x2eca20;});})['then'](function(){_0x37e6a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46c348,_0x5c8f7f){return function(_0x4f2cc5){if(!_0x4f2cc5){_0x46c348[_0x5431('0x34')](0x194);}return _0x4f2cc5;};}function handleError(_0x5cef96,_0x22287a){_0x22287a=_0x22287a||0x1f4;return function(_0x5e14fc){logger[_0x5431('0x23')](_0x5e14fc[_0x5431('0x35')]);if(_0x5e14fc[_0x5431('0x36')]){delete _0x5e14fc[_0x5431('0x36')];}_0x5cef96[_0x5431('0x28')](_0x22287a)[_0x5431('0x37')](_0x5e14fc);};}exports[_0x5431('0x38')]=function(_0x1a6c67,_0x317b4c){var _0x9fb284={'include':[{'model':db[_0x5431('0x39')],'as':_0x5431('0x3a')}]},_0x5d9cb6={},_0x32ef62={'count':0x0,'rows':[]};var _0x3e87f0=_[_0x5431('0x3b')](db[_0x5431('0x3c')]['rawAttributes'],function(_0xfc9e9){return{'name':_0xfc9e9[_0x5431('0x3d')],'type':_0xfc9e9[_0x5431('0x3e')][_0x5431('0x3f')]};});_0x5d9cb6['model']=_['map'](_0x3e87f0,_0x5431('0x36'));_0x5d9cb6['query']=_[_0x5431('0x40')](_0x1a6c67[_0x5431('0x41')]);_0x5d9cb6[_0x5431('0x42')]=_[_0x5431('0x43')](_0x5d9cb6[_0x5431('0x44')],_0x5d9cb6[_0x5431('0x41')]);_0x9fb284['attributes']=_[_0x5431('0x43')](_0x5d9cb6['model'],qs[_0x5431('0x45')](_0x1a6c67['query']['fields']));_0x9fb284[_0x5431('0x46')]=_0x9fb284[_0x5431('0x46')]['length']?_0x9fb284['attributes']:_0x5d9cb6['model'];if(!_0x1a6c67[_0x5431('0x41')]['hasOwnProperty']('nolimit')){_0x9fb284[_0x5431('0x47')]=qs[_0x5431('0x47')](_0x1a6c67['query'][_0x5431('0x47')]);_0x9fb284[_0x5431('0x29')]=qs[_0x5431('0x29')](_0x1a6c67[_0x5431('0x41')][_0x5431('0x29')]);}_0x9fb284[_0x5431('0x48')]=qs['sort'](_0x1a6c67[_0x5431('0x41')][_0x5431('0x49')]);_0x9fb284[_0x5431('0x4a')]=qs[_0x5431('0x42')](_[_0x5431('0x4b')](_0x1a6c67[_0x5431('0x41')],_0x5d9cb6['filters']),_0x3e87f0);if(_0x1a6c67['query'][_0x5431('0x4c')]){_0x9fb284[_0x5431('0x4a')]=_[_0x5431('0x4d')](_0x9fb284['where'],{'$or':_[_0x5431('0x3b')](_0x3e87f0,function(_0x39b9d1){if(_0x39b9d1['type']!=='VIRTUAL'){var _0x15b571={};_0x15b571[_0x39b9d1[_0x5431('0x36')]]={'$like':'%'+_0x1a6c67[_0x5431('0x41')][_0x5431('0x4c')]+'%'};return _0x15b571;}})});}_0x9fb284=_['merge']({},_0x9fb284,_0x1a6c67[_0x5431('0x4e')]);var _0x57475d={'where':_0x9fb284[_0x5431('0x4a')]};return db[_0x5431('0x3c')][_0x5431('0x2b')](_0x57475d)[_0x5431('0x1f')](function(_0x16e811){_0x32ef62['count']=_0x16e811;if(_0x1a6c67['query'][_0x5431('0x4f')]){_0x9fb284[_0x5431('0x50')]=[{'all':!![]}];}return db[_0x5431('0x3c')][_0x5431('0x51')](_0x9fb284);})[_0x5431('0x1f')](function(_0x7c0d19){_0x32ef62[_0x5431('0x52')]=_0x7c0d19;return _0x32ef62;})['then'](respondWithFilteredResult(_0x317b4c,_0x9fb284))[_0x5431('0x53')](handleError(_0x317b4c,null));};exports[_0x5431('0x54')]=function(_0x3ece04,_0x3cd63f){var _0x4f6206={'raw':![],'where':{'id':_0x3ece04[_0x5431('0x55')]['id']},'include':[{'model':db[_0x5431('0x39')],'as':'mandatoryDispositionPause'}]},_0x4bb60a={};_0x4bb60a[_0x5431('0x44')]=_[_0x5431('0x40')](db[_0x5431('0x3c')][_0x5431('0x56')]);_0x4bb60a['query']=_['keys'](_0x3ece04[_0x5431('0x41')]);_0x4bb60a['filters']=_['intersection'](_0x4bb60a[_0x5431('0x44')],_0x4bb60a[_0x5431('0x41')]);_0x4f6206[_0x5431('0x46')]=_[_0x5431('0x43')](_0x4bb60a[_0x5431('0x44')],qs['fields'](_0x3ece04['query'][_0x5431('0x45')]));_0x4f6206[_0x5431('0x46')]=_0x4f6206['attributes'][_0x5431('0x57')]?_0x4f6206[_0x5431('0x46')]:_0x4bb60a[_0x5431('0x44')];if(_0x3ece04[_0x5431('0x41')][_0x5431('0x4f')]){_0x4f6206[_0x5431('0x50')]=[{'all':!![]}];}_0x4f6206=_[_0x5431('0x4d')]({},_0x4f6206,_0x3ece04[_0x5431('0x4e')]);return db['SmsAccount'][_0x5431('0x58')](_0x4f6206)[_0x5431('0x1f')](handleEntityNotFound(_0x3cd63f,null))['then'](respondWithResult(_0x3cd63f,null))['catch'](handleError(_0x3cd63f,null));};exports[_0x5431('0x59')]=function(_0xb44ee9,_0x193176){return db['SmsAccount'][_0x5431('0x59')](_0xb44ee9[_0x5431('0x5a')],{})[_0x5431('0x1f')](function(_0x678f55){var _0x31482c=_0xb44ee9['user'][_0x5431('0x5b')]({'plain':!![]});if(!_0x31482c)throw new Error(_0x5431('0x5c'));if(_0x31482c[_0x5431('0x5d')]===_0x5431('0x5e')){var _0x1aace6=_0x678f55['get']({'plain':!![]});var _0x1ebe3b=_0x5431('0x5f');return db[_0x5431('0x60')][_0x5431('0x58')]({'where':{'name':_0x1ebe3b,'userProfileId':_0x31482c['userProfileId']},'raw':!![]})[_0x5431('0x1f')](function(_0x42a8d6){if(_0x42a8d6&&_0x42a8d6[_0x5431('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x1aace6[_0x5431('0x36')],'resourceId':_0x1aace6['id'],'type':_0x42a8d6[_0x5431('0x36')],'sectionId':_0x42a8d6['id']},{})['then'](function(){return _0x678f55;});}else{return _0x678f55;}})[_0x5431('0x53')](function(_0x5774f2){logger[_0x5431('0x23')](_0x5431('0x62'),_0x5774f2);throw _0x5774f2;});}return _0x678f55;})[_0x5431('0x1f')](respondWithResult(_0x193176,0xc9))[_0x5431('0x53')](handleError(_0x193176,null));};exports['update']=function(_0x1080fc,_0x488cc1){if(_0x1080fc[_0x5431('0x5a')]['id']){delete _0x1080fc[_0x5431('0x5a')]['id'];}return db['SmsAccount'][_0x5431('0x58')]({'where':{'id':_0x1080fc[_0x5431('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x5431('0x3a')}]})[_0x5431('0x1f')](handleEntityNotFound(_0x488cc1,null))[_0x5431('0x1f')](saveUpdates(_0x1080fc[_0x5431('0x5a')],null))['then'](respondWithResult(_0x488cc1,null))[_0x5431('0x53')](handleError(_0x488cc1,null));};exports['destroy']=function(_0xb70739,_0x37b09c){return db['SmsAccount'][_0x5431('0x58')]({'where':{'id':_0xb70739[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x37b09c,null))[_0x5431('0x1f')](removeEntity(_0x37b09c,null))[_0x5431('0x53')](handleError(_0x37b09c,null));};exports['describe']=function(_0x3f0b73,_0x4aa52b){return db[_0x5431('0x3c')]['describe']()['then'](respondWithResult(_0x4aa52b,null))[_0x5431('0x53')](handleError(_0x4aa52b,null));};exports[_0x5431('0x63')]=function(_0x20d45e,_0x259c5a,_0xfc5baf){if(_0x20d45e[_0x5431('0x5a')]['id']){delete _0x20d45e[_0x5431('0x5a')]['id'];}return db['SmsAccount'][_0x5431('0x58')]({'where':{'id':_0x20d45e[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x259c5a,null))[_0x5431('0x1f')](function(_0x93d3e5){if(_0x93d3e5){_0x20d45e[_0x5431('0x5a')][_0x5431('0x64')]=_0x93d3e5['id'];return db['Disposition']['create'](_0x20d45e[_0x5431('0x5a')]);}})[_0x5431('0x1f')](respondWithResult(_0x259c5a,null))[_0x5431('0x53')](handleError(_0x259c5a,null));};exports['getDispositions']=function(_0x26a4a7,_0x369413,_0x56b4ed){var _0x5e92b8={'raw':![],'where':{}};var _0x17fd1e={};var _0x4a5223={'count':0x0,'rows':[]};return db[_0x5431('0x3c')][_0x5431('0x65')]({'where':{'id':_0x26a4a7[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x369413,null))[_0x5431('0x1f')](function(_0x1db829){if(_0x1db829){_0x17fd1e[_0x5431('0x44')]=_[_0x5431('0x40')](db[_0x5431('0x66')]['rawAttributes']);_0x17fd1e[_0x5431('0x41')]=_['keys'](_0x26a4a7[_0x5431('0x41')]);_0x17fd1e[_0x5431('0x42')]=_[_0x5431('0x43')](_0x17fd1e['model'],_0x17fd1e[_0x5431('0x41')]);_0x5e92b8[_0x5431('0x46')]=_[_0x5431('0x43')](_0x17fd1e['model'],qs[_0x5431('0x45')](_0x26a4a7[_0x5431('0x41')][_0x5431('0x45')]));_0x5e92b8[_0x5431('0x46')]=_0x5e92b8[_0x5431('0x46')][_0x5431('0x57')]?_0x5e92b8[_0x5431('0x46')]:_0x17fd1e[_0x5431('0x44')];if(!_0x26a4a7[_0x5431('0x41')]['hasOwnProperty'](_0x5431('0x67'))){_0x5e92b8[_0x5431('0x47')]=qs[_0x5431('0x47')](_0x26a4a7[_0x5431('0x41')][_0x5431('0x47')]);_0x5e92b8[_0x5431('0x29')]=qs[_0x5431('0x29')](_0x26a4a7['query'][_0x5431('0x29')]);}_0x5e92b8['order']=qs['sort'](_0x26a4a7[_0x5431('0x41')][_0x5431('0x49')]);_0x5e92b8['where']=qs['filters'](_[_0x5431('0x4b')](_0x26a4a7['query'],_0x17fd1e['filters']));_0x5e92b8['where'][_0x5431('0x64')]=_0x1db829['id'];if(_0x26a4a7[_0x5431('0x41')][_0x5431('0x4c')]){_0x5e92b8[_0x5431('0x4a')]=_[_0x5431('0x4d')](_0x5e92b8[_0x5431('0x4a')],{'$or':_['map'](_0x5e92b8[_0x5431('0x46')],function(_0x103897){var _0x244644={};_0x244644[_0x103897]={'$like':'%'+_0x26a4a7[_0x5431('0x41')][_0x5431('0x4c')]+'%'};return _0x244644;})});}_0x5e92b8=_[_0x5431('0x4d')]({},_0x5e92b8,_0x26a4a7[_0x5431('0x4e')]);return db[_0x5431('0x66')][_0x5431('0x2b')]({'where':_0x5e92b8[_0x5431('0x4a')]})['then'](function(_0x490d7d){_0x4a5223[_0x5431('0x2b')]=_0x490d7d;if(_0x26a4a7[_0x5431('0x41')]['includeAll']){_0x5e92b8[_0x5431('0x50')]=[{'all':!![]}];}return db[_0x5431('0x66')]['findAll'](_0x5e92b8);})['then'](function(_0x36a4da){_0x4a5223[_0x5431('0x52')]=_0x36a4da;return _0x4a5223;});}})[_0x5431('0x1f')](respondWithFilteredResult(_0x369413,_0x5e92b8))['catch'](handleError(_0x369413,null));};exports[_0x5431('0x68')]=function(_0x3ebd4a,_0x17bee5,_0x31241f){return db['SmsAccount'][_0x5431('0x58')]({'where':{'id':_0x3ebd4a[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x17bee5,null))[_0x5431('0x1f')](function(_0x527335){if(_0x527335){return _0x527335['removeDispositions'](_0x3ebd4a[_0x5431('0x41')]['ids']);}})[_0x5431('0x1f')](respondWithStatusCode(_0x17bee5,null))[_0x5431('0x53')](handleError(_0x17bee5,null));};exports[_0x5431('0x69')]=function(_0x418073,_0x53cbde,_0x981fa0){if(_0x418073[_0x5431('0x5a')]['id']){delete _0x418073['body']['id'];}return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x418073[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x53cbde,null))[_0x5431('0x1f')](function(_0x5a7851){if(_0x5a7851){_0x418073[_0x5431('0x5a')][_0x5431('0x64')]=_0x5a7851['id'];return db[_0x5431('0x6a')][_0x5431('0x59')](_0x418073[_0x5431('0x5a')]);}})[_0x5431('0x1f')](respondWithResult(_0x53cbde,null))['catch'](handleError(_0x53cbde,null));};exports[_0x5431('0x6b')]=function(_0x5e9a53,_0x1c08e6,_0x8cd3b2){var _0x2672ba={'raw':![],'where':{}};var _0x178305={};var _0x185163={'count':0x0,'rows':[]};return db[_0x5431('0x3c')][_0x5431('0x65')]({'where':{'id':_0x5e9a53[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x1c08e6,null))['then'](function(_0x5a82a2){if(_0x5a82a2){_0x178305[_0x5431('0x44')]=_[_0x5431('0x40')](db[_0x5431('0x6a')][_0x5431('0x56')]);_0x178305['query']=_[_0x5431('0x40')](_0x5e9a53['query']);_0x178305[_0x5431('0x42')]=_['intersection'](_0x178305['model'],_0x178305[_0x5431('0x41')]);_0x2672ba['attributes']=_[_0x5431('0x43')](_0x178305['model'],qs[_0x5431('0x45')](_0x5e9a53['query']['fields']));_0x2672ba[_0x5431('0x46')]=_0x2672ba[_0x5431('0x46')][_0x5431('0x57')]?_0x2672ba['attributes']:_0x178305[_0x5431('0x44')];if(!_0x5e9a53[_0x5431('0x41')][_0x5431('0x6c')](_0x5431('0x67'))){_0x2672ba[_0x5431('0x47')]=qs[_0x5431('0x47')](_0x5e9a53[_0x5431('0x41')]['limit']);_0x2672ba[_0x5431('0x29')]=qs[_0x5431('0x29')](_0x5e9a53['query'][_0x5431('0x29')]);}_0x2672ba[_0x5431('0x48')]=qs[_0x5431('0x49')](_0x5e9a53[_0x5431('0x41')][_0x5431('0x49')]);_0x2672ba['where']=qs[_0x5431('0x42')](_['pick'](_0x5e9a53[_0x5431('0x41')],_0x178305[_0x5431('0x42')]));_0x2672ba['where']['SmsAccountId']=_0x5a82a2['id'];if(_0x5e9a53[_0x5431('0x41')][_0x5431('0x4c')]){_0x2672ba[_0x5431('0x4a')]=_[_0x5431('0x4d')](_0x2672ba['where'],{'$or':_['map'](_0x2672ba[_0x5431('0x46')],function(_0x5caadd){var _0x32e59d={};_0x32e59d[_0x5caadd]={'$like':'%'+_0x5e9a53[_0x5431('0x41')]['filter']+'%'};return _0x32e59d;})});}_0x2672ba=_[_0x5431('0x4d')]({},_0x2672ba,_0x5e9a53[_0x5431('0x4e')]);return db[_0x5431('0x6a')][_0x5431('0x2b')]({'where':_0x2672ba[_0x5431('0x4a')]})[_0x5431('0x1f')](function(_0x2a85bf){_0x185163[_0x5431('0x2b')]=_0x2a85bf;if(_0x5e9a53[_0x5431('0x41')][_0x5431('0x4f')]){_0x2672ba[_0x5431('0x50')]=[{'all':!![]}];}return db[_0x5431('0x6a')][_0x5431('0x51')](_0x2672ba);})[_0x5431('0x1f')](function(_0x18bdd8){_0x185163[_0x5431('0x52')]=_0x18bdd8;return _0x185163;});}})[_0x5431('0x1f')](respondWithFilteredResult(_0x1c08e6,_0x2672ba))[_0x5431('0x53')](handleError(_0x1c08e6,null));};exports['removeAnswers']=function(_0x3d1b4f,_0x5b0fbc,_0x54cbb8){return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x3d1b4f[_0x5431('0x55')]['id']}})['then'](handleEntityNotFound(_0x5b0fbc,null))[_0x5431('0x1f')](function(_0x55bd4a){if(_0x55bd4a){return _0x55bd4a['removeAnswers'](_0x3d1b4f['query'][_0x5431('0x6d')]);}})[_0x5431('0x1f')](respondWithStatusCode(_0x5b0fbc,null))[_0x5431('0x53')](handleError(_0x5b0fbc,null));};exports['notify']=function(_0x4cac8d,_0x1a38aa,_0x3aeb10){var _0x16c5fa={'channel':_0x5431('0x6e')};var _0x3dd012=[];var _0x1b2d68=[];var _0x1a812a={};return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x4cac8d[_0x5431('0x55')]['id']},'include':[{'model':db[_0x5431('0x6f')],'as':_0x5431('0x70')}]})[_0x5431('0x1f')](handleEntityNotFound(_0x1a38aa,null))['then'](function(_0x1e6df6){_0x16c5fa[_0x5431('0x71')]=_0x1e6df6;_0x16c5fa[_0x5431('0x72')]=_['orderBy'](_0x1e6df6[_0x5431('0x70')],['priority'],['asc']);if(_0x16c5fa[_0x5431('0x71')][_0x5431('0x70')]){delete _0x16c5fa[_0x5431('0x71')]['Applications'];}return db[_0x5431('0x73')][_0x5431('0x74')]();})[_0x5431('0x1f')](function(_0x5d7cd4){if(!_0x5d7cd4){throw new db[(_0x5431('0x75'))]['ValidationError'](_0x5431('0x76'));}_0x3dd012=_[_0x5431('0x77')](_[_0x5431('0x40')](_0x5d7cd4),['createdAt','updatedAt']);_0x1b2d68=_['difference'](_[_0x5431('0x40')](_0x5d7cd4),[_0x5431('0x78'),'updatedAt',_0x5431('0x79'),'ListId']);_0x16c5fa[_0x5431('0x5a')]={'mapKey':_0x5431('0x7a')};if(_0x16c5fa[_0x5431('0x71')][_0x5431('0x3e')]){switch(_0x16c5fa['account'][_0x5431('0x3e')]){case _0x5431('0x7b'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x7d')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x7e')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7f')]=_0x4cac8d[_0x5431('0x5a')]['MessageSid'];break;case _0x5431('0x80'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')]='+'+_0x4cac8d[_0x5431('0x5a')]['sender'];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d[_0x5431('0x5a')]['text'];break;case'connectel':_0x16c5fa['body'][_0x5431('0x7c')]=_0x4cac8d[_0x5431('0x5a')]['from'];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x25')];break;case _0x5431('0x81'):_0x16c5fa['body'][_0x5431('0x7c')]=_0x4cac8d[_0x5431('0x5a')]['from'];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d['body'][_0x5431('0x5a')];_0x16c5fa[_0x5431('0x5a')]['messageId']=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x82')];break;case _0x5431('0x83'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')]=_0x4cac8d['body'][_0x5431('0x7d')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x84')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7f')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x85')];break;case'infobip':_0x16c5fa['body']['from']='+'+_0x4cac8d[_0x5431('0x5a')]['results'][0x0][_0x5431('0x7c')];_0x16c5fa[_0x5431('0x5a')]['body']=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x86')][0x0][_0x5431('0x87')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7f')]=_0x4cac8d['body']['results'][0x0][_0x5431('0x7f')];break;case _0x5431('0x88'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')]=_0x4cac8d[_0x5431('0x5a')]['originatingAddress'];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d['body'][_0x5431('0x89')]['message'];break;case _0x5431('0x8a'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')]=_0x4cac8d[_0x5431('0x5a')]['fromNumber'];_0x16c5fa['body'][_0x5431('0x5a')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x87')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7f')]=_0x4cac8d[_0x5431('0x5a')]['replyMessageId'];break;case _0x5431('0x8b'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7f')]=_0x4cac8d[_0x5431('0x5a')][0x0][_0x5431('0x25')]['id'];_0x16c5fa[_0x5431('0x5a')]['from']=_0x4cac8d[_0x5431('0x5a')][0x0]['message'][_0x5431('0x7c')];_0x16c5fa['body'][_0x5431('0x5a')]=_0x4cac8d['body'][0x0]['message'][_0x5431('0x87')];break;case _0x5431('0x8c'):_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x7c')];_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')]=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x25')];_0x16c5fa[_0x5431('0x5a')]['messageId']=_0x4cac8d[_0x5431('0x5a')][_0x5431('0x8d')];break;}}if(_0x16c5fa[_0x5431('0x5a')]['id']){delete _0x16c5fa[_0x5431('0x5a')]['id'];}if(_['isNil'](_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')])){throw new db[(_0x5431('0x75'))][(_0x5431('0x8e'))](_0x5431('0x8f'));}if(_['isNil'](_0x16c5fa[_0x5431('0x5a')][_0x5431('0x5a')])||_0x16c5fa['body'][_0x5431('0x5a')]===''){throw new db[(_0x5431('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5431('0x90')](_0x16c5fa['body'][_0x5431('0x91')])){throw new db['Sequelize']['ValidationError'](_0x5431('0x92')+_0x1b2d68);}if(!_[_0x5431('0x93')](_0x1b2d68,_0x16c5fa[_0x5431('0x5a')][_0x5431('0x91')])){throw new db[(_0x5431('0x75'))][(_0x5431('0x8e'))](_0x5431('0x94')+_0x1b2d68);}_0x1a812a[_0x16c5fa[_0x5431('0x5a')][_0x5431('0x91')]]=_0x16c5fa[_0x5431('0x5a')]['from'];return db[_0x5431('0x95')]['find']({'where':{'id':_0x16c5fa[_0x5431('0x71')][_0x5431('0x96')]},'include':[{'model':db[_0x5431('0x73')],'as':_0x5431('0x97'),'where':_0x1a812a,'limit':0x1,'order':[[_0x5431('0x98'),_0x5431('0x99')]]}]});})[_0x5431('0x1f')](handleEntityNotFound(_0x1a38aa,null))[_0x5431('0x1f')](function(_0x5a1923){if(_0x5a1923){_0x16c5fa[_0x5431('0x9a')]=_['omit'](_0x5a1923,['Contacts']);if(_0x5a1923[_0x5431('0x97')][_0x5431('0x57')]){return _0x5a1923[_0x5431('0x97')][0x0];}var _0x893afa=_[_0x5431('0x17')](_0x16c5fa[_0x5431('0x5a')],{'firstName':_0x16c5fa[_0x5431('0x5a')]['from'],'ListId':_0x5a1923['id']});_0x893afa[_0x16c5fa[_0x5431('0x5a')][_0x5431('0x91')]]=_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')];return db[_0x5431('0x73')][_0x5431('0x59')](_0x893afa,{'fields':_0x3dd012,'raw':!![]});}})[_0x5431('0x1f')](handleEntityNotFound(_0x1a38aa,null))[_0x5431('0x1f')](function(_0x56b6f8){if(_0x56b6f8){_0x16c5fa[_0x5431('0x9b')]=_0x56b6f8;var _0x3c25ec={'ContactId':_0x56b6f8['id'],'phone':_0x16c5fa[_0x5431('0x5a')]['from'],'SmsAccountId':_0x4cac8d[_0x5431('0x55')]['id']};var _0x4c5e34={'ContactId':_0x56b6f8['id'],'SmsAccountId':_0x4cac8d[_0x5431('0x55')]['id'],'closed':![]};return db[_0x5431('0x9c')][_0x5431('0x58')]({'where':_0x4c5e34})[_0x5431('0x1f')](function(_0x449447){if(_0x449447){return[_0x449447,![]];}return db['SmsInteraction'][_0x5431('0x59')](_0x3c25ec)[_0x5431('0x1f')](function(_0x36f293){return[_0x36f293,!![]];});});}})[_0x5431('0x9d')](function(_0x124a01,_0x22a9fc){_0x16c5fa['interaction']=_0x124a01['get']({'plain':!![]});_0x16c5fa[_0x5431('0x9e')][_0x5431('0x9f')]=![];if(_0x22a9fc){if(_0x16c5fa[_0x5431('0x71')][_0x5431('0xa0')]){_0x16c5fa[_0x5431('0x72')][_0x5431('0xa1')]({'id':0x0,'priority':_0x16c5fa['applications'][_0x5431('0x57')]+0x1,'app':_0x5431('0xa2'),'appdata':_0x5431('0xa3'),'interval':_0x5431('0xa4')});}_0x16c5fa[_0x5431('0x9e')][_0x5431('0x9f')]=!![];}return db['SmsMessage']['create']({'phone':_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7c')],'messageId':_0x16c5fa[_0x5431('0x5a')][_0x5431('0x7f')],'body':_0x16c5fa['body'][_0x5431('0x5a')],'SmsAccountId':_0x4cac8d[_0x5431('0x55')]['id'],'SmsInteractionId':_0x124a01['id'],'direction':'in','ContactId':_0x124a01['ContactId'],'AttachmentId':_0x16c5fa['body']['AttachmentId']});})[_0x5431('0x1f')](function(_0x109075){_0x16c5fa['message']=_0x109075;if(_0x16c5fa['interaction'][_0x5431('0xa5')]){return db[_0x5431('0xa6')]['find']({'attributes':['id',_0x5431('0x36')],'where':{'id':_0x16c5fa[_0x5431('0x9e')][_0x5431('0xa5')]}})[_0x5431('0x1f')](function(_0x553770){if(_0x553770){_0x16c5fa[_0x5431('0x72')][_0x5431('0xa7')]({'id':0x0,'priority':0x0,'app':_0x5431('0xa8'),'appdata':_0x553770[_0x5431('0x36')]+','+(_0x16c5fa['account'][_0x5431('0xa9')]||0xa),'interval':_0x5431('0xa4')});}return respondWithRpcPromise('Start',_0x5431('0xaa'),_0x16c5fa);});}return respondWithRpcPromise(_0x5431('0xab'),'startRouting',_0x16c5fa);})[_0x5431('0x1f')](function(_0x37634a){if(_0x37634a){var _0x21f371=0xc8;var _0x5b5b96=_0x5431('0xac');logger[_0x5431('0x20')](_0x5431('0xad'),_0x5b5b96,_0x21f371,_0x5431('0xae'));logger[_0x5431('0xaf')](_0x5431('0xb0'),_0x5b5b96,_0x21f371,_0x5431('0xae'),JSON[_0x5431('0x22')](_0x37634a));if(_0x16c5fa[_0x5431('0x71')][_0x5431('0x3e')]===_0x5431('0x7b')){return _0x1a38aa[_0x5431('0x28')](_0x21f371)['set'](_0x5431('0xb1'),'text/xml')[_0x5431('0x37')](_0x5431('0xb2'));}else{return _0x1a38aa[_0x5431('0x28')](_0x21f371)[_0x5431('0x2e')](_0x37634a);}}})[_0x5431('0x53')](handleError(_0x1a38aa,null));};exports[_0x5431('0xb3')]=function(_0x2025d9,_0x3ad85b){var _0x2e8d4e=_0x2025d9[_0x5431('0x55')]['id'];var _0x12ab28=_0x2025d9[_0x5431('0x5a')];var _0x37161d=0xc8;var _0x47f1b9=null;return db[_0x5431('0xb4')]['transaction']({'isolationLevel':db[_0x5431('0xb4')][_0x5431('0xb5')][_0x5431('0xb6')][_0x5431('0xb7')]},function(_0xd7c92d){return db['SmsAccount'][_0x5431('0x65')]({'where':{'id':_0x2e8d4e},'transaction':_0xd7c92d})[_0x5431('0x1f')](function(_0x56d542){if(_0x56d542){return db[_0x5431('0x6f')][_0x5431('0x32')]({'where':{'SmsAccountId':_0x2e8d4e},'transaction':_0xd7c92d})[_0x5431('0x1f')](function(){var _0x2af079=_[_0x5431('0x3b')](_0x12ab28,function(_0xed6d0b){_0xed6d0b[_0x5431('0x64')]=_0x2e8d4e;return _0xed6d0b;});return db[_0x5431('0x6f')][_0x5431('0xb8')](_0x2af079,{'transaction':_0xd7c92d});});}else{_0x37161d=0x194;_0x47f1b9=[];}});})[_0x5431('0x1f')](function(){if(_0x37161d!==0x194){return db[_0x5431('0x6f')]['findAndCountAll']({'where':{'SmsAccountId':_0x2e8d4e},'order':'priority'})[_0x5431('0x1f')](function(_0x3b3111){_0x47f1b9=_0x3b3111;});}})['catch'](function(_0x265eb5){_0x37161d=0x1f4;logger['error'](_0x265eb5[_0x5431('0x35')]);if(_0x265eb5['name']){delete _0x265eb5[_0x5431('0x36')];}_0x47f1b9=_0x265eb5;})[_0x5431('0xb9')](function(){if(_0x47f1b9===null){_0x3ad85b['sendStatus'](_0x37161d);}else{if(_0x37161d===0x1f4){_0x3ad85b['status'](_0x37161d)[_0x5431('0x37')](_0x47f1b9);}else{_0x3ad85b[_0x5431('0x28')](_0x37161d)[_0x5431('0x2e')](_0x47f1b9);}}});};exports['getApplications']=function(_0xc2229f,_0x221eb6,_0x1d5f3e){var _0x431dd3={};var _0x379235={};var _0x58412f;var _0x5db0cb;return db[_0x5431('0x3c')]['findOne']({'where':{'id':_0xc2229f[_0x5431('0x55')]['id']}})['then'](handleEntityNotFound(_0x221eb6,null))['then'](function(_0x516eb8){if(_0x516eb8){_0x58412f=_0x516eb8;_0x379235[_0x5431('0x44')]=_[_0x5431('0x40')](db[_0x5431('0x6f')]['rawAttributes']);_0x379235['query']=_['keys'](_0xc2229f[_0x5431('0x41')]);_0x379235['filters']=_[_0x5431('0x43')](_0x379235['model'],_0x379235[_0x5431('0x41')]);_0x431dd3[_0x5431('0x46')]=_[_0x5431('0x43')](_0x379235[_0x5431('0x44')],qs[_0x5431('0x45')](_0xc2229f[_0x5431('0x41')][_0x5431('0x45')]));_0x431dd3[_0x5431('0x46')]=_0x431dd3[_0x5431('0x46')]['length']?_0x431dd3[_0x5431('0x46')]:_0x379235['model'];_0x431dd3['order']=qs[_0x5431('0x49')](_0xc2229f['query'][_0x5431('0x49')]);_0x431dd3[_0x5431('0x4a')]=qs[_0x5431('0x42')](_[_0x5431('0x4b')](_0xc2229f['query'],_0x379235[_0x5431('0x42')]));if(_0xc2229f['query'][_0x5431('0x4c')]){_0x431dd3['where']=_[_0x5431('0x4d')](_0x431dd3[_0x5431('0x4a')],{'$or':_['map'](_0x431dd3[_0x5431('0x46')],function(_0x25135a){var _0x3e5117={};_0x3e5117[_0x25135a]={'$like':'%'+_0xc2229f[_0x5431('0x41')][_0x5431('0x4c')]+'%'};return _0x3e5117;})});}_0x431dd3=_[_0x5431('0x4d')]({},_0x431dd3,_0xc2229f[_0x5431('0x4e')]);return _0x58412f['getApplications'](_0x431dd3);}})['then'](function(_0x287bb9){if(_0x287bb9){_0x5db0cb=_0x287bb9[_0x5431('0x57')];if(!_0xc2229f[_0x5431('0x41')][_0x5431('0x6c')](_0x5431('0x67'))){_0x431dd3['limit']=qs[_0x5431('0x47')](_0xc2229f[_0x5431('0x41')][_0x5431('0x47')]);_0x431dd3[_0x5431('0x29')]=qs['offset'](_0xc2229f[_0x5431('0x41')][_0x5431('0x29')]);}return _0x58412f[_0x5431('0xba')](_0x431dd3);}})['then'](function(_0x2aaca8){if(_0x2aaca8){return _0x2aaca8?{'count':_0x5db0cb,'rows':_0x2aaca8}:null;}})[_0x5431('0x1f')](respondWithResult(_0x221eb6,null))[_0x5431('0x53')](handleError(_0x221eb6,null));};exports[_0x5431('0xbb')]=function(_0x972e85,_0x37dd0f,_0x2c4b2f){var _0x1fbe75={'raw':![],'where':{}};var _0x16340e={};var _0x2b56e8={'count':0x0,'rows':[]};return db[_0x5431('0x3c')][_0x5431('0x65')]({'where':{'id':_0x972e85['params']['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x37dd0f,null))['then'](function(_0x18a45e){if(_0x18a45e){_0x16340e[_0x5431('0x44')]=_[_0x5431('0x40')](db[_0x5431('0x9c')][_0x5431('0x56')]);_0x16340e[_0x5431('0x41')]=_['keys'](_0x972e85[_0x5431('0x41')]);_0x16340e['filters']=_[_0x5431('0x43')](_0x16340e[_0x5431('0x44')],_0x16340e['query']);_0x1fbe75['attributes']=_[_0x5431('0x43')](_0x16340e[_0x5431('0x44')],qs[_0x5431('0x45')](_0x972e85[_0x5431('0x41')][_0x5431('0x45')]));_0x1fbe75['attributes']=_0x1fbe75[_0x5431('0x46')][_0x5431('0x57')]?_0x1fbe75[_0x5431('0x46')]:_0x16340e[_0x5431('0x44')];if(!_0x972e85[_0x5431('0x41')][_0x5431('0x6c')](_0x5431('0x67'))){_0x1fbe75[_0x5431('0x47')]=qs[_0x5431('0x47')](_0x972e85[_0x5431('0x41')][_0x5431('0x47')]);_0x1fbe75[_0x5431('0x29')]=qs[_0x5431('0x29')](_0x972e85['query'][_0x5431('0x29')]);}_0x1fbe75['order']=qs['sort'](_0x972e85[_0x5431('0x41')][_0x5431('0x49')]);_0x1fbe75[_0x5431('0x4a')]=qs[_0x5431('0x42')](_['pick'](_0x972e85[_0x5431('0x41')],_0x16340e['filters']));_0x1fbe75['where'][_0x5431('0x64')]=_0x18a45e['id'];if(_0x972e85[_0x5431('0x41')][_0x5431('0x4c')]){_0x1fbe75[_0x5431('0x4a')]=_[_0x5431('0x4d')](_0x1fbe75[_0x5431('0x4a')],{'$or':_[_0x5431('0x3b')](_0x1fbe75[_0x5431('0x46')],function(_0x388e7c){var _0x168b30={};_0x168b30[_0x388e7c]={'$like':'%'+_0x972e85['query']['filter']+'%'};return _0x168b30;})});}_0x1fbe75=_[_0x5431('0x4d')]({},_0x1fbe75,_0x972e85[_0x5431('0x4e')]);return db[_0x5431('0x9c')]['count']({'where':_0x1fbe75[_0x5431('0x4a')]})[_0x5431('0x1f')](function(_0x4ad8c8){_0x2b56e8['count']=_0x4ad8c8;if(_0x972e85[_0x5431('0x41')][_0x5431('0x4f')]){_0x1fbe75[_0x5431('0x50')]=[{'model':db[_0x5431('0x73')],'as':_0x5431('0xbc'),'required':![]},{'model':db[_0x5431('0xa6')],'as':'Owner','attributes':[_0x5431('0x36'),_0x5431('0xbd'),_0x5431('0xbe')],'required':![]},{'model':db[_0x5431('0xbf')],'as':_0x5431('0xc0'),'attributes':['id',_0x5431('0x36'),'color'],'where':_0x972e85['query']['tag']?{'id':_0x972e85[_0x5431('0x41')][_0x5431('0xc1')]}:undefined,'required':_0x972e85[_0x5431('0x41')][_0x5431('0xc1')]?!![]:![]}];}return db[_0x5431('0x9c')][_0x5431('0x51')](_0x1fbe75);})[_0x5431('0x1f')](function(_0x42aa21){_0x2b56e8['rows']=_0x42aa21;return _0x2b56e8;});}})[_0x5431('0x1f')](respondWithFilteredResult(_0x37dd0f,_0x1fbe75))[_0x5431('0x53')](handleError(_0x37dd0f,null));};exports[_0x5431('0x37')]=function(_0x49f854,_0x37b562,_0x37cd0c){var _0x122091,_0x2e4d11,_0x5eea7b;if(_[_0x5431('0x90')](_0x49f854[_0x5431('0x5a')][_0x5431('0x5a')])||_0x49f854['body']['body']===''){throw new db['Sequelize'][(_0x5431('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5431('0x90')](_0x49f854[_0x5431('0x5a')]['to'])){throw new db['Sequelize'][(_0x5431('0x8e'))](_0x5431('0xc2'));}_0x122091=_0x49f854['body']['to'];return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x49f854[_0x5431('0x55')]['id']},'include':[{'model':db[_0x5431('0x95')],'as':_0x5431('0xc3'),'include':[{'model':db['CmContact'],'as':_0x5431('0x97'),'where':{'mobile':_0x122091},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x5431('0x1f')](handleEntityNotFound(_0x37b562,null))['then'](function(_0x3e1aca){if(_0x3e1aca&&_0x3e1aca['List']){_0x2e4d11=_0x3e1aca[_0x5431('0x5b')]({'plain':!![]});if(_0x2e4d11[_0x5431('0xc3')]&&_0x2e4d11[_0x5431('0xc3')][_0x5431('0x97')][_0x5431('0x57')]){return _0x2e4d11[_0x5431('0xc3')]['Contacts'][0x0];}return db[_0x5431('0x73')]['create'](_[_0x5431('0x17')](_0x49f854[_0x5431('0x5a')],{'firstName':_0x122091,'mobile':_0x122091,'phone':_0x122091,'ListId':_0x2e4d11['ListId']}));}})['then'](handleEntityNotFound(_0x37b562,null))[_0x5431('0x1f')](function(_0x53247d){if(_0x53247d){_0x5eea7b=_0x53247d;return db[_0x5431('0x9c')][_0x5431('0x58')]({'where':{'ContactId':_0x5eea7b['id'],'closed':![],'SmsAccountId':_0x2e4d11['id']}})[_0x5431('0x1f')](function(_0x367fb6){if(_0x367fb6){return[_0x367fb6,![]];}return db[_0x5431('0x9c')][_0x5431('0x59')]({'UserId':_0x49f854['user']['id'],'ContactId':_0x5eea7b['id'],'SmsAccountId':_0x2e4d11['id'],'phone':_0x122091,'firstMsgDirection':_0x5431('0xc4'),'Messages':[_[_0x5431('0x4d')](_0x49f854[_0x5431('0x5a')],{'read':![],'body':_0x49f854[_0x5431('0x5a')][_0x5431('0x5a')],'phone':_0x122091,'SmsAccountId':_0x2e4d11['id'],'UserId':_0x49f854[_0x5431('0x5e')]['id'],'ContactId':_0x5eea7b['id']})]},{'include':[{'model':db[_0x5431('0xc5')],'as':_0x5431('0xc6')}]})[_0x5431('0x1f')](function(_0xc2efaf){return[_0xc2efaf,!![]];});});}})[_0x5431('0x9d')](function(_0xe72429,_0x5e9620){if(_0x5e9620){return _0xe72429;}return db[_0x5431('0xc5')][_0x5431('0x59')](_[_0x5431('0x4d')](_0x49f854[_0x5431('0x5a')],{'read':![],'body':_0x49f854[_0x5431('0x5a')][_0x5431('0x5a')],'phone':_0x122091,'SmsAccountId':_0x2e4d11['id'],'SmsInteractionId':_0xe72429['id'],'UserId':_0x49f854[_0x5431('0x5e')]['id'],'ContactId':_0x5eea7b['id']}))[_0x5431('0x1f')](function(_0x5cb632){_0xe72429[_0x5431('0xc7')][_0x5431('0xc6')]=[];_0xe72429[_0x5431('0xc7')][_0x5431('0xc6')][_0x5431('0xa1')](_0x5cb632[_0x5431('0xc7')]);return _0xe72429;});})['then'](respondWithResult(_0x37b562,null))[_0x5431('0x53')](handleError(_0x37b562,null));};exports[_0x5431('0x28')]=function(_0x35e398,_0x42559a,_0x55a2fe){if(_0x35e398['body']['id']){delete _0x35e398[_0x5431('0x5a')]['id'];}var _0x24aae9,_0x3e0356,_0x1ffb66;return db['SmsAccount']['find']({'where':{'id':_0x35e398['params']['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x42559a,null))[_0x5431('0x1f')](function(_0x1177fa){if(_0x1177fa){_0x1ffb66=_0x1177fa;logger['debug'](_0x5431('0xad'),_0x5431('0x28'),_0x5431('0xc8'),_0x1177fa[_0x5431('0x3e')],util['inspect'](_0x35e398['body'],{'showHidden':![],'depth':null}));switch(_0x1177fa[_0x5431('0x3e')]){case'skebby':if(_0x35e398[_0x5431('0x5a')][_0x5431('0xc9')]&&_0x35e398[_0x5431('0x5a')][_0x5431('0x28')]){_0x3e0356=_0x35e398['body'][_0x5431('0x28')];return db[_0x5431('0xc5')]['find']({'where':{'messageId':_0x35e398[_0x5431('0x5a')][_0x5431('0xc9')]}});}break;case _0x5431('0xca'):if(_0x35e398[_0x5431('0x5a')][_0x5431('0xcb')]&&_0x35e398['body'][_0x5431('0xcc')]){_0x3e0356=_0x35e398[_0x5431('0x5a')][_0x5431('0xcc')];return db[_0x5431('0xc5')][_0x5431('0x58')]({'where':{'messageId':_0x35e398['body']['requestid']}});}break;case'clicksend':if(_0x35e398[_0x5431('0x5a')][_0x5431('0x82')]&&_0x35e398['body'][_0x5431('0xcd')]){_0x3e0356=_0x35e398['body'][_0x5431('0xcd')];return db[_0x5431('0xc5')][_0x5431('0x58')]({'where':{'messageId':_0x35e398[_0x5431('0x5a')][_0x5431('0x82')]}});}break;case _0x5431('0xce'):var _0x18c116=_0x35e398[_0x5431('0x5a')][_0x5431('0x86')][0x0];if(_0x18c116[_0x5431('0x7f')]&&_0x18c116[_0x5431('0x28')][_0x5431('0xcf')]===_0x5431('0xd0')){_0x3e0356=_0x18c116[_0x5431('0x28')]['groupName'];return db[_0x5431('0xc5')][_0x5431('0x58')]({'where':{'messageId':_0x18c116[_0x5431('0x7f')]}});}break;case _0x5431('0x8a'):if(_0x35e398[_0x5431('0x5a')][_0x5431('0x7f')]&&_0x35e398['body']['status']){_0x3e0356=_0x35e398['body']['status'];return db[_0x5431('0xc5')]['find']({'where':{'messageId':_0x35e398['body']['messageId']}});}break;case'bandwidth':if(_0x35e398[_0x5431('0x5a')][0x0][_0x5431('0x25')]['id']){_0x3e0356=_0x35e398['body'][0x0][_0x5431('0x3e')];return db[_0x5431('0xc5')]['find']({'where':{'messageId':_0x35e398[_0x5431('0x5a')][0x0]['message']['id']}});}break;case _0x5431('0x8c'):if(_0x35e398['body']['redif']&&_0x35e398[_0x5431('0x5a')][_0x5431('0x28')]){_0x3e0356=_0x35e398[_0x5431('0x5a')][_0x5431('0x28')];return db[_0x5431('0xc5')]['find']({'where':{'messageId':_0x35e398[_0x5431('0x5a')][_0x5431('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x42559a,null))['then'](function(_0xaf52ed){if(_0xaf52ed){_0x24aae9=_0xaf52ed;switch(_0x1ffb66[_0x5431('0x3e')]){case _0x5431('0x80'):if(_0x3e0356===_0x5431('0xd0')){return _0x24aae9[_0x5431('0x31')]({'read':!![]});}else{logger[_0x5431('0x23')](_0x5431('0xad'),_0x5431('0x28'),'skebby',util[_0x5431('0xd2')](_0x35e398[_0x5431('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5431('0xca'):if(_0x3e0356==='1'){return _0x24aae9['update']({'read':!![]});}else{logger[_0x5431('0x23')](_0x5431('0xad'),_0x5431('0x28'),'skebby',util[_0x5431('0xd2')](_0x35e398[_0x5431('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5431('0x81'):if(!_0x35e398['body'][_0x5431('0xd3')]&&_0x3e0356>=0xc8&&_0x3e0356<=0xce){return _0x24aae9[_0x5431('0x31')]({'read':!![]});}else{logger[_0x5431('0x23')](_0x5431('0xad'),_0x5431('0x28'),'clicksend',util[_0x5431('0xd2')](_0x35e398[_0x5431('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5431('0xce'):var _0x24c68f=_0x35e398[_0x5431('0x5a')][_0x5431('0x86')][0x0];if(_0x24c68f['status'][_0x5431('0xcf')]==='DELIVERED'){return _0x24aae9[_0x5431('0x31')]({'read':!![]});}else{logger[_0x5431('0x23')](_0x5431('0xad'),'status',_0x5431('0xce'),util[_0x5431('0xd2')](_0x35e398[_0x5431('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5431('0x8a'):if(_0x3e0356==_0x5431('0xd4')||_0x3e0356==_0x5431('0xd5')){return _0x24aae9[_0x5431('0x31')]({'read':!![]});}else{logger['error'](_0x5431('0xad'),_0x5431('0x28'),_0x5431('0x8a'),util['inspect'](_0x35e398['body'],{'showHidden':![],'depth':null}));}break;case _0x5431('0x8b'):if(_0x3e0356==_0x5431('0xd6')){return _0x24aae9[_0x5431('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5431('0x28'),_0x5431('0x8b'),util['inspect'](_0x35e398[_0x5431('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x5431('0x8c'):if(_0x3e0356==='DELIVRD'||_0x3e0356==='ACCEPTD'){return _0x24aae9['update']({'read':!![]});}else{logger[_0x5431('0x23')](_0x5431('0xad'),_0x5431('0x28'),'intelepeer',util[_0x5431('0xd2')](_0x35e398[_0x5431('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x24aae9;}})[_0x5431('0x1f')](respondWithResult(_0x42559a,null))[_0x5431('0x53')](handleError(_0x42559a,null));};exports[_0x5431('0xd7')]=function(_0x42b74b,_0x11a927,_0x2b9267){var _0x617491,_0x43dd71,_0x496b3e;return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x42b74b[_0x5431('0x55')]['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x11a927,null))[_0x5431('0x1f')](function(_0x288535){if(_0x288535){_0x496b3e=_0x288535;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x288535[_0x5431('0x3e')],util['inspect'](_0x42b74b[_0x5431('0x41')],{'showHidden':![],'depth':null}));switch(_0x288535[_0x5431('0x3e')]){case _0x5431('0x88'):if(_0x42b74b[_0x5431('0x41')][_0x5431('0xd8')]&&_0x42b74b[_0x5431('0x41')][_0x5431('0xd9')]){_0x43dd71=_0x42b74b['query']['state'];return db[_0x5431('0xc5')][_0x5431('0x58')]({'where':{'messageId':_0x42b74b[_0x5431('0x41')][_0x5431('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x11a927,null))[_0x5431('0x1f')](function(_0x297739){if(_0x297739){_0x617491=_0x297739;switch(_0x496b3e['type']){case _0x5431('0x88'):if(_0x43dd71==='2'||_0x43dd71==='6'){return _0x617491[_0x5431('0x31')]({'read':!![]});}else{logger[_0x5431('0x23')](_0x5431('0xad'),_0x5431('0x28'),'csc',util[_0x5431('0xd2')](_0x42b74b[_0x5431('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x617491;}})['then'](respondWithResult(_0x11a927,null))[_0x5431('0x53')](handleError(_0x11a927,null));};exports[_0x5431('0xda')]=function(_0x43aaa9,_0x1a770b,_0x29bf83){return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x43aaa9[_0x5431('0x55')]['id']}})['then'](handleEntityNotFound(_0x1a770b,null))['then'](function(_0x271173){if(_0x271173){return _0x271173['addAgents'](_0x43aaa9[_0x5431('0x5a')]['ids'],_['omit'](_0x43aaa9[_0x5431('0x5a')],[_0x5431('0x6d'),'id'])||{})[_0x5431('0x9d')](function(_0x3157c8){for(var _0x55e8fb=0x0;_0x55e8fb<_0x43aaa9[_0x5431('0x5a')]['ids'][_0x5431('0x57')];_0x55e8fb+=0x1){socket[_0x5431('0xdb')](_0x5431('0xdc'),{'UserId':Number(_0x43aaa9[_0x5431('0x5a')][_0x5431('0x6d')][_0x55e8fb]),'SmsAccountId':Number(_0x43aaa9[_0x5431('0x55')]['id'])});}return _0x3157c8;});}})[_0x5431('0x1f')](respondWithResult(_0x1a770b,null))[_0x5431('0x53')](handleError(_0x1a770b,null));};exports['removeAgents']=function(_0x43e871,_0x725906,_0x28041a){return db[_0x5431('0x3c')][_0x5431('0x58')]({'where':{'id':_0x43e871[_0x5431('0x55')]['id']}})['then'](handleEntityNotFound(_0x725906,null))[_0x5431('0x1f')](function(_0x5bc670){if(_0x5bc670){return _0x5bc670[_0x5431('0xdd')](_0x43e871[_0x5431('0x41')][_0x5431('0x6d')])[_0x5431('0x1f')](function(){if(_['isArray'](_0x43e871[_0x5431('0x41')][_0x5431('0x6d')])){for(var _0x195fb5=0x0;_0x195fb5<_0x43e871[_0x5431('0x41')]['ids'][_0x5431('0x57')];_0x195fb5+=0x1){socket['emit'](_0x5431('0xde'),{'UserId':Number(_0x43e871[_0x5431('0x41')][_0x5431('0x6d')][_0x195fb5]),'SmsAccountId':Number(_0x43e871['params']['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x43e871['query'][_0x5431('0x6d')]),'SmsAccountId':Number(_0x43e871[_0x5431('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x725906,null))[_0x5431('0x53')](handleError(_0x725906,null));};exports[_0x5431('0xdf')]=function(_0x12c951,_0x279554,_0x1ed197){var _0x583970={};var _0x239deb={};var _0x59405b;var _0x10a14e;return db[_0x5431('0x3c')]['findOne']({'where':{'id':_0x12c951['params']['id']}})[_0x5431('0x1f')](handleEntityNotFound(_0x279554,null))[_0x5431('0x1f')](function(_0x1b5d0c){if(_0x1b5d0c){_0x59405b=_0x1b5d0c;_0x239deb[_0x5431('0x44')]=_['keys'](db[_0x5431('0xa6')][_0x5431('0x56')]);_0x239deb[_0x5431('0x41')]=_[_0x5431('0x40')](_0x12c951[_0x5431('0x41')]);_0x239deb['filters']=_[_0x5431('0x43')](_0x239deb[_0x5431('0x44')],_0x239deb[_0x5431('0x41')]);_0x583970[_0x5431('0x46')]=_['intersection'](_0x239deb[_0x5431('0x44')],qs[_0x5431('0x45')](_0x12c951[_0x5431('0x41')][_0x5431('0x45')]));_0x583970[_0x5431('0x46')]=_0x583970[_0x5431('0x46')][_0x5431('0x57')]?_0x583970[_0x5431('0x46')]:_0x239deb[_0x5431('0x44')];_0x583970[_0x5431('0x48')]=qs[_0x5431('0x49')](_0x12c951[_0x5431('0x41')]['sort']);_0x583970[_0x5431('0x4a')]=qs[_0x5431('0x42')](_[_0x5431('0x4b')](_0x12c951[_0x5431('0x41')],_0x239deb[_0x5431('0x42')]));if(_0x12c951[_0x5431('0x41')]['filter']){_0x583970['where']=_[_0x5431('0x4d')](_0x583970[_0x5431('0x4a')],{'$or':_[_0x5431('0x3b')](_0x583970[_0x5431('0x46')],function(_0x4423c7){var _0x20b8f5={};_0x20b8f5[_0x4423c7]={'$like':'%'+_0x12c951[_0x5431('0x41')]['filter']+'%'};return _0x20b8f5;})});}_0x583970=_[_0x5431('0x4d')]({},_0x583970,_0x12c951[_0x5431('0x4e')]);return _0x59405b[_0x5431('0xdf')](_0x583970);}})[_0x5431('0x1f')](function(_0x390ee6){if(_0x390ee6){_0x10a14e=_0x390ee6[_0x5431('0x57')];if(!_0x12c951['query'][_0x5431('0x6c')](_0x5431('0x67'))){_0x583970[_0x5431('0x47')]=qs[_0x5431('0x47')](_0x12c951['query'][_0x5431('0x47')]);_0x583970['offset']=qs[_0x5431('0x29')](_0x12c951['query'][_0x5431('0x29')]);}return _0x59405b[_0x5431('0xdf')](_0x583970);}})[_0x5431('0x1f')](function(_0x5b8887){if(_0x5b8887){return _0x5b8887?{'count':_0x10a14e,'rows':_0x5b8887}:null;}})[_0x5431('0x1f')](respondWithResult(_0x279554,null))['catch'](handleError(_0x279554,null));};
\ No newline at end of file
+var _0xa2c6=['status','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','nolimit','pick','SmsAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','SmsApplication','Applications','applications','priority','asc','account','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','send','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','results','DELIVERED','redif','error_code','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','offset','undefined','count','limit'];(function(_0x74eab1,_0x5d0761){var _0xbc6a75=function(_0x515b7d){while(--_0x515b7d){_0x74eab1['push'](_0x74eab1['shift']());}};_0xbc6a75(++_0x5d0761);}(_0xa2c6,0x1a0));var _0x6a2c=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0xa2c6[_0x35007a];return _0x574f68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a2c('0x0'));var zipdir=require(_0x6a2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a2c('0x2'));var moment=require(_0x6a2c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a2c('0x4'));var util=require(_0x6a2c('0x5'));var path=require(_0x6a2c('0x6'));var sox=require(_0x6a2c('0x7'));var csv=require(_0x6a2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a2c('0x9'));var _=require(_0x6a2c('0xa'));var squel=require(_0x6a2c('0xb'));var crypto=require(_0x6a2c('0xc'));var jsforce=require(_0x6a2c('0xd'));var deskjs=require(_0x6a2c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6a2c('0xf'));var Papa=require('papaparse');var Redis=require(_0x6a2c('0x10'));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(_0x6a2c('0x11'));var config=require(_0x6a2c('0x12'));var licenseUtil=require(_0x6a2c('0x13'));var db=require(_0x6a2c('0x14'))['db'];config[_0x6a2c('0x15')]=_[_0x6a2c('0x16')](config[_0x6a2c('0x15')],{'host':_0x6a2c('0x17'),'port':0x18eb});var socket=require(_0x6a2c('0x18'))(new Redis(config[_0x6a2c('0x15')]));require(_0x6a2c('0x19'))[_0x6a2c('0x1a')](socket);var jayson=require(_0x6a2c('0x1b'));var client=jayson['client'][_0x6a2c('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x1a0a99,_0x166cf1,_0xe86ed4,_0x55063b){return new BPromise(function(_0x4a856b,_0x4c18ac){var _0x464004=_0x55063b||client;return _0x464004[_0x6a2c('0x1d')](_0x1a0a99,_0xe86ed4)[_0x6a2c('0x1e')](function(_0x118c07){logger[_0x6a2c('0x1f')](_0x6a2c('0x20'),_0x166cf1,_0x6a2c('0x21'));logger[_0x6a2c('0x22')](_0x6a2c('0x23'),_0x166cf1,_0x6a2c('0x21'),JSON[_0x6a2c('0x24')](_0x118c07));if(_0x118c07['error']){if(_0x118c07[_0x6a2c('0x25')]['code']===0x1f4){logger['error'](_0x6a2c('0x20'),_0x166cf1,_0x118c07[_0x6a2c('0x25')]['message']);return _0x4c18ac(_0x118c07['error'][_0x6a2c('0x26')]);}logger[_0x6a2c('0x25')](_0x6a2c('0x20'),_0x166cf1,_0x118c07['error'][_0x6a2c('0x26')]);return _0x4a856b(_0x118c07[_0x6a2c('0x25')]['message']);}else{logger['info'](_0x6a2c('0x20'),_0x166cf1,'request\x20sent');_0x4a856b(_0x118c07[_0x6a2c('0x27')][_0x6a2c('0x26')]);}})[_0x6a2c('0x28')](function(_0x5838a2){logger[_0x6a2c('0x25')](_0x6a2c('0x20'),_0x166cf1,_0x5838a2);_0x4c18ac(_0x5838a2);});});}function respondWithStatusCode(_0x34e301,_0x248729){_0x248729=_0x248729||0xcc;return function(_0x4f192b){if(_0x4f192b){return _0x34e301[_0x6a2c('0x29')](_0x248729);}return _0x34e301['status'](_0x248729)[_0x6a2c('0x2a')]();};}function respondWithResult(_0x907a9e,_0x4984a3){_0x4984a3=_0x4984a3||0xc8;return function(_0x548f2e){if(_0x548f2e){return _0x907a9e['status'](_0x4984a3)[_0x6a2c('0x2b')](_0x548f2e);}};}function respondWithFilteredResult(_0x23dbd0,_0x1be582){return function(_0x5ad0d5){if(_0x5ad0d5){var _0x313d41=typeof _0x1be582[_0x6a2c('0x2c')]===_0x6a2c('0x2d')&&typeof _0x1be582['limit']===_0x6a2c('0x2d');var _0x40a038=_0x5ad0d5[_0x6a2c('0x2e')];var _0x5d50c2=_0x313d41?0x0:_0x1be582[_0x6a2c('0x2c')];var _0x9a694b=_0x313d41?_0x5ad0d5['count']:_0x1be582[_0x6a2c('0x2c')]+_0x1be582[_0x6a2c('0x2f')];var _0x763578;if(_0x9a694b>=_0x40a038){_0x9a694b=_0x40a038;_0x763578=0xc8;}else{_0x763578=0xce;}_0x23dbd0[_0x6a2c('0x30')](_0x763578);return _0x23dbd0['set'](_0x6a2c('0x31'),_0x5d50c2+'-'+_0x9a694b+'/'+_0x40a038)[_0x6a2c('0x2b')](_0x5ad0d5);}return null;};}function patchUpdates(_0x3fba6e){return function(_0x191deb){try{jsonpatch[_0x6a2c('0x32')](_0x191deb,_0x3fba6e,!![]);}catch(_0x19d147){return BPromise['reject'](_0x19d147);}return _0x191deb[_0x6a2c('0x33')]();};}function saveUpdates(_0x2decc3,_0x501063){return function(_0x52dca2){if(_0x52dca2){return _0x52dca2[_0x6a2c('0x34')](_0x2decc3)['then'](function(_0x40fae6){return _0x40fae6;});}return null;};}function removeEntity(_0x22897f,_0x30d818){return function(_0x4f563e){if(_0x4f563e){return _0x4f563e[_0x6a2c('0x35')]()['then'](function(){var _0x1a4739=_0x4f563e[_0x6a2c('0x36')]({'plain':!![]});var _0x667075=_0x6a2c('0x37');return db[_0x6a2c('0x38')][_0x6a2c('0x35')]({'where':{'type':_0x667075,'resourceId':_0x1a4739['id']}})[_0x6a2c('0x1e')](function(){return _0x4f563e;});})[_0x6a2c('0x1e')](function(){_0x22897f[_0x6a2c('0x30')](0xcc)[_0x6a2c('0x2a')]();});}};}function handleEntityNotFound(_0x4f21b9,_0x1c1be5){return function(_0x105e6e){if(!_0x105e6e){_0x4f21b9[_0x6a2c('0x29')](0x194);}return _0x105e6e;};}function handleError(_0x8f608e,_0x2d913e){_0x2d913e=_0x2d913e||0x1f4;return function(_0x5b73d0){logger[_0x6a2c('0x25')](_0x5b73d0[_0x6a2c('0x39')]);if(_0x5b73d0[_0x6a2c('0x3a')]){delete _0x5b73d0['name'];}_0x8f608e[_0x6a2c('0x30')](_0x2d913e)['send'](_0x5b73d0);};}exports[_0x6a2c('0x3b')]=function(_0x14e856,_0x5056a1){var _0x427908={'include':[{'model':db[_0x6a2c('0x3c')],'as':_0x6a2c('0x3d')}]},_0x6dab32={},_0xa1e1b6={'count':0x0,'rows':[]};var _0x1f6044=_['map'](db[_0x6a2c('0x3e')][_0x6a2c('0x3f')],function(_0x4d1c84){return{'name':_0x4d1c84['fieldName'],'type':_0x4d1c84[_0x6a2c('0x40')][_0x6a2c('0x41')]};});_0x6dab32[_0x6a2c('0x42')]=_['map'](_0x1f6044,_0x6a2c('0x3a'));_0x6dab32[_0x6a2c('0x43')]=_['keys'](_0x14e856['query']);_0x6dab32[_0x6a2c('0x44')]=_[_0x6a2c('0x45')](_0x6dab32[_0x6a2c('0x42')],_0x6dab32[_0x6a2c('0x43')]);_0x427908[_0x6a2c('0x46')]=_[_0x6a2c('0x45')](_0x6dab32[_0x6a2c('0x42')],qs[_0x6a2c('0x47')](_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x47')]));_0x427908[_0x6a2c('0x46')]=_0x427908[_0x6a2c('0x46')][_0x6a2c('0x48')]?_0x427908['attributes']:_0x6dab32[_0x6a2c('0x42')];if(!_0x14e856[_0x6a2c('0x43')]['hasOwnProperty']('nolimit')){_0x427908['limit']=qs['limit'](_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x2f')]);_0x427908[_0x6a2c('0x2c')]=qs[_0x6a2c('0x2c')](_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x2c')]);}_0x427908[_0x6a2c('0x49')]=qs[_0x6a2c('0x4a')](_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x4a')]);_0x427908[_0x6a2c('0x4b')]=qs[_0x6a2c('0x44')](_['pick'](_0x14e856[_0x6a2c('0x43')],_0x6dab32[_0x6a2c('0x44')]),_0x1f6044);if(_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x4c')]){_0x427908[_0x6a2c('0x4b')]=_[_0x6a2c('0x4d')](_0x427908[_0x6a2c('0x4b')],{'$or':_[_0x6a2c('0x4e')](_0x1f6044,function(_0x310cb6){if(_0x310cb6[_0x6a2c('0x40')]!==_0x6a2c('0x4f')){var _0x3f4d55={};_0x3f4d55[_0x310cb6[_0x6a2c('0x3a')]]={'$like':'%'+_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x4c')]+'%'};return _0x3f4d55;}})});}_0x427908=_[_0x6a2c('0x4d')]({},_0x427908,_0x14e856[_0x6a2c('0x50')]);var _0x2b43f8={'where':_0x427908['where']};return db[_0x6a2c('0x3e')][_0x6a2c('0x2e')](_0x2b43f8)[_0x6a2c('0x1e')](function(_0x1bcd9f){_0xa1e1b6['count']=_0x1bcd9f;if(_0x14e856[_0x6a2c('0x43')][_0x6a2c('0x51')]){_0x427908[_0x6a2c('0x52')]=[{'all':!![]}];}return db[_0x6a2c('0x3e')][_0x6a2c('0x53')](_0x427908);})[_0x6a2c('0x1e')](function(_0x2a4d2c){_0xa1e1b6[_0x6a2c('0x54')]=_0x2a4d2c;return _0xa1e1b6;})[_0x6a2c('0x1e')](respondWithFilteredResult(_0x5056a1,_0x427908))['catch'](handleError(_0x5056a1,null));};exports[_0x6a2c('0x55')]=function(_0x1de43b,_0x43df58){var _0x40125b={'raw':![],'where':{'id':_0x1de43b[_0x6a2c('0x56')]['id']},'include':[{'model':db[_0x6a2c('0x3c')],'as':_0x6a2c('0x3d')}]},_0x15afbc={};_0x15afbc['model']=_[_0x6a2c('0x57')](db[_0x6a2c('0x3e')][_0x6a2c('0x3f')]);_0x15afbc[_0x6a2c('0x43')]=_[_0x6a2c('0x57')](_0x1de43b[_0x6a2c('0x43')]);_0x15afbc[_0x6a2c('0x44')]=_[_0x6a2c('0x45')](_0x15afbc[_0x6a2c('0x42')],_0x15afbc['query']);_0x40125b[_0x6a2c('0x46')]=_[_0x6a2c('0x45')](_0x15afbc[_0x6a2c('0x42')],qs[_0x6a2c('0x47')](_0x1de43b[_0x6a2c('0x43')][_0x6a2c('0x47')]));_0x40125b['attributes']=_0x40125b[_0x6a2c('0x46')][_0x6a2c('0x48')]?_0x40125b[_0x6a2c('0x46')]:_0x15afbc[_0x6a2c('0x42')];if(_0x1de43b[_0x6a2c('0x43')][_0x6a2c('0x51')]){_0x40125b[_0x6a2c('0x52')]=[{'all':!![]}];}_0x40125b=_['merge']({},_0x40125b,_0x1de43b[_0x6a2c('0x50')]);return db[_0x6a2c('0x3e')][_0x6a2c('0x58')](_0x40125b)[_0x6a2c('0x1e')](handleEntityNotFound(_0x43df58,null))[_0x6a2c('0x1e')](respondWithResult(_0x43df58,null))[_0x6a2c('0x28')](handleError(_0x43df58,null));};exports[_0x6a2c('0x59')]=function(_0x1d9a29,_0x2c3d34){return db['SmsAccount'][_0x6a2c('0x59')](_0x1d9a29[_0x6a2c('0x5a')],{})[_0x6a2c('0x1e')](function(_0xf7d111){var _0x2ea84f=_0x1d9a29[_0x6a2c('0x5b')]['get']({'plain':!![]});if(!_0x2ea84f)throw new Error(_0x6a2c('0x5c'));if(_0x2ea84f[_0x6a2c('0x5d')]===_0x6a2c('0x5b')){var _0x14dc81=_0xf7d111[_0x6a2c('0x36')]({'plain':!![]});var _0x4b3c60=_0x6a2c('0x37');return db[_0x6a2c('0x5e')][_0x6a2c('0x58')]({'where':{'name':_0x4b3c60,'userProfileId':_0x2ea84f[_0x6a2c('0x5f')]},'raw':!![]})[_0x6a2c('0x1e')](function(_0x2f78ca){if(_0x2f78ca&&_0x2f78ca['autoAssociation']===0x0){return db[_0x6a2c('0x38')]['create']({'name':_0x14dc81[_0x6a2c('0x3a')],'resourceId':_0x14dc81['id'],'type':_0x2f78ca[_0x6a2c('0x3a')],'sectionId':_0x2f78ca['id']},{})[_0x6a2c('0x1e')](function(){return _0xf7d111;});}else{return _0xf7d111;}})[_0x6a2c('0x28')](function(_0x589515){logger['error'](_0x6a2c('0x60'),_0x589515);throw _0x589515;});}return _0xf7d111;})[_0x6a2c('0x1e')](respondWithResult(_0x2c3d34,0xc9))[_0x6a2c('0x28')](handleError(_0x2c3d34,null));};exports[_0x6a2c('0x34')]=function(_0x4b740e,_0x455baa){if(_0x4b740e[_0x6a2c('0x5a')]['id']){delete _0x4b740e[_0x6a2c('0x5a')]['id'];}return db['SmsAccount'][_0x6a2c('0x58')]({'where':{'id':_0x4b740e['params']['id']},'include':[{'model':db[_0x6a2c('0x3c')],'as':_0x6a2c('0x3d')}]})['then'](handleEntityNotFound(_0x455baa,null))['then'](saveUpdates(_0x4b740e['body'],null))['then'](respondWithResult(_0x455baa,null))[_0x6a2c('0x28')](handleError(_0x455baa,null));};exports[_0x6a2c('0x35')]=function(_0x342f8c,_0x7d35b4){return db[_0x6a2c('0x3e')]['find']({'where':{'id':_0x342f8c[_0x6a2c('0x56')]['id']}})['then'](handleEntityNotFound(_0x7d35b4,null))[_0x6a2c('0x1e')](removeEntity(_0x7d35b4,null))[_0x6a2c('0x28')](handleError(_0x7d35b4,null));};exports[_0x6a2c('0x61')]=function(_0x20aab2,_0x3b83d2){return db['SmsAccount'][_0x6a2c('0x61')]()[_0x6a2c('0x1e')](respondWithResult(_0x3b83d2,null))[_0x6a2c('0x28')](handleError(_0x3b83d2,null));};exports[_0x6a2c('0x62')]=function(_0x566945,_0x33f1bd,_0x36a26a){if(_0x566945[_0x6a2c('0x5a')]['id']){delete _0x566945['body']['id'];}return db[_0x6a2c('0x3e')][_0x6a2c('0x58')]({'where':{'id':_0x566945['params']['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x33f1bd,null))[_0x6a2c('0x1e')](function(_0x5f40fa){if(_0x5f40fa){_0x566945[_0x6a2c('0x5a')]['SmsAccountId']=_0x5f40fa['id'];return db[_0x6a2c('0x63')][_0x6a2c('0x59')](_0x566945['body']);}})[_0x6a2c('0x1e')](respondWithResult(_0x33f1bd,null))[_0x6a2c('0x28')](handleError(_0x33f1bd,null));};exports['getDispositions']=function(_0xf68bc,_0x31bbac,_0x13e58a){var _0x527e8d={'raw':![],'where':{}};var _0x32913e={};var _0x1875db={'count':0x0,'rows':[]};return db[_0x6a2c('0x3e')][_0x6a2c('0x64')]({'where':{'id':_0xf68bc[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x31bbac,null))['then'](function(_0x1020eb){if(_0x1020eb){_0x32913e['model']=_[_0x6a2c('0x57')](db['Disposition'][_0x6a2c('0x3f')]);_0x32913e['query']=_[_0x6a2c('0x57')](_0xf68bc[_0x6a2c('0x43')]);_0x32913e[_0x6a2c('0x44')]=_[_0x6a2c('0x45')](_0x32913e['model'],_0x32913e[_0x6a2c('0x43')]);_0x527e8d[_0x6a2c('0x46')]=_[_0x6a2c('0x45')](_0x32913e[_0x6a2c('0x42')],qs[_0x6a2c('0x47')](_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x47')]));_0x527e8d[_0x6a2c('0x46')]=_0x527e8d[_0x6a2c('0x46')]['length']?_0x527e8d['attributes']:_0x32913e[_0x6a2c('0x42')];if(!_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x65')](_0x6a2c('0x66'))){_0x527e8d['limit']=qs['limit'](_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x2f')]);_0x527e8d['offset']=qs[_0x6a2c('0x2c')](_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x2c')]);}_0x527e8d['order']=qs['sort'](_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x4a')]);_0x527e8d[_0x6a2c('0x4b')]=qs[_0x6a2c('0x44')](_[_0x6a2c('0x67')](_0xf68bc[_0x6a2c('0x43')],_0x32913e[_0x6a2c('0x44')]));_0x527e8d[_0x6a2c('0x4b')][_0x6a2c('0x68')]=_0x1020eb['id'];if(_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x4c')]){_0x527e8d[_0x6a2c('0x4b')]=_['merge'](_0x527e8d[_0x6a2c('0x4b')],{'$or':_[_0x6a2c('0x4e')](_0x527e8d[_0x6a2c('0x46')],function(_0x12e8d9){var _0xb37b11={};_0xb37b11[_0x12e8d9]={'$like':'%'+_0xf68bc['query'][_0x6a2c('0x4c')]+'%'};return _0xb37b11;})});}_0x527e8d=_[_0x6a2c('0x4d')]({},_0x527e8d,_0xf68bc[_0x6a2c('0x50')]);return db[_0x6a2c('0x63')][_0x6a2c('0x2e')]({'where':_0x527e8d[_0x6a2c('0x4b')]})[_0x6a2c('0x1e')](function(_0x24ca94){_0x1875db[_0x6a2c('0x2e')]=_0x24ca94;if(_0xf68bc[_0x6a2c('0x43')][_0x6a2c('0x51')]){_0x527e8d['include']=[{'all':!![]}];}return db[_0x6a2c('0x63')][_0x6a2c('0x53')](_0x527e8d);})['then'](function(_0x3f5cb8){_0x1875db[_0x6a2c('0x54')]=_0x3f5cb8;return _0x1875db;});}})[_0x6a2c('0x1e')](respondWithFilteredResult(_0x31bbac,_0x527e8d))[_0x6a2c('0x28')](handleError(_0x31bbac,null));};exports[_0x6a2c('0x69')]=function(_0x250aa6,_0x4a9c8a,_0x3388a3){return db[_0x6a2c('0x3e')][_0x6a2c('0x58')]({'where':{'id':_0x250aa6['params']['id']}})['then'](handleEntityNotFound(_0x4a9c8a,null))[_0x6a2c('0x1e')](function(_0x54f94e){if(_0x54f94e){return _0x54f94e[_0x6a2c('0x69')](_0x250aa6[_0x6a2c('0x43')][_0x6a2c('0x6a')]);}})[_0x6a2c('0x1e')](respondWithStatusCode(_0x4a9c8a,null))[_0x6a2c('0x28')](handleError(_0x4a9c8a,null));};exports[_0x6a2c('0x6b')]=function(_0xc4ebf3,_0x2d4848,_0x7d2f1e){if(_0xc4ebf3[_0x6a2c('0x5a')]['id']){delete _0xc4ebf3[_0x6a2c('0x5a')]['id'];}return db['SmsAccount'][_0x6a2c('0x58')]({'where':{'id':_0xc4ebf3[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x2d4848,null))[_0x6a2c('0x1e')](function(_0x8ffb4f){if(_0x8ffb4f){_0xc4ebf3[_0x6a2c('0x5a')][_0x6a2c('0x68')]=_0x8ffb4f['id'];return db['CannedAnswer']['create'](_0xc4ebf3[_0x6a2c('0x5a')]);}})[_0x6a2c('0x1e')](respondWithResult(_0x2d4848,null))[_0x6a2c('0x28')](handleError(_0x2d4848,null));};exports[_0x6a2c('0x6c')]=function(_0x1e70b7,_0x1b5a87,_0x2a9677){var _0x5c5fb5={'raw':![],'where':{}};var _0x5c24a0={};var _0x2a9915={'count':0x0,'rows':[]};return db[_0x6a2c('0x3e')][_0x6a2c('0x64')]({'where':{'id':_0x1e70b7[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x1b5a87,null))[_0x6a2c('0x1e')](function(_0x5ef27f){if(_0x5ef27f){_0x5c24a0[_0x6a2c('0x42')]=_[_0x6a2c('0x57')](db[_0x6a2c('0x6d')]['rawAttributes']);_0x5c24a0[_0x6a2c('0x43')]=_[_0x6a2c('0x57')](_0x1e70b7['query']);_0x5c24a0[_0x6a2c('0x44')]=_[_0x6a2c('0x45')](_0x5c24a0[_0x6a2c('0x42')],_0x5c24a0[_0x6a2c('0x43')]);_0x5c5fb5[_0x6a2c('0x46')]=_[_0x6a2c('0x45')](_0x5c24a0[_0x6a2c('0x42')],qs[_0x6a2c('0x47')](_0x1e70b7['query']['fields']));_0x5c5fb5[_0x6a2c('0x46')]=_0x5c5fb5[_0x6a2c('0x46')][_0x6a2c('0x48')]?_0x5c5fb5['attributes']:_0x5c24a0[_0x6a2c('0x42')];if(!_0x1e70b7[_0x6a2c('0x43')][_0x6a2c('0x65')](_0x6a2c('0x66'))){_0x5c5fb5['limit']=qs[_0x6a2c('0x2f')](_0x1e70b7[_0x6a2c('0x43')]['limit']);_0x5c5fb5['offset']=qs['offset'](_0x1e70b7[_0x6a2c('0x43')][_0x6a2c('0x2c')]);}_0x5c5fb5['order']=qs['sort'](_0x1e70b7[_0x6a2c('0x43')][_0x6a2c('0x4a')]);_0x5c5fb5[_0x6a2c('0x4b')]=qs[_0x6a2c('0x44')](_[_0x6a2c('0x67')](_0x1e70b7['query'],_0x5c24a0[_0x6a2c('0x44')]));_0x5c5fb5['where'][_0x6a2c('0x68')]=_0x5ef27f['id'];if(_0x1e70b7['query'][_0x6a2c('0x4c')]){_0x5c5fb5[_0x6a2c('0x4b')]=_[_0x6a2c('0x4d')](_0x5c5fb5['where'],{'$or':_[_0x6a2c('0x4e')](_0x5c5fb5[_0x6a2c('0x46')],function(_0x549535){var _0x1910fc={};_0x1910fc[_0x549535]={'$like':'%'+_0x1e70b7[_0x6a2c('0x43')][_0x6a2c('0x4c')]+'%'};return _0x1910fc;})});}_0x5c5fb5=_[_0x6a2c('0x4d')]({},_0x5c5fb5,_0x1e70b7[_0x6a2c('0x50')]);return db[_0x6a2c('0x6d')][_0x6a2c('0x2e')]({'where':_0x5c5fb5[_0x6a2c('0x4b')]})[_0x6a2c('0x1e')](function(_0x31ea77){_0x2a9915[_0x6a2c('0x2e')]=_0x31ea77;if(_0x1e70b7[_0x6a2c('0x43')][_0x6a2c('0x51')]){_0x5c5fb5[_0x6a2c('0x52')]=[{'all':!![]}];}return db[_0x6a2c('0x6d')][_0x6a2c('0x53')](_0x5c5fb5);})[_0x6a2c('0x1e')](function(_0x19a755){_0x2a9915[_0x6a2c('0x54')]=_0x19a755;return _0x2a9915;});}})[_0x6a2c('0x1e')](respondWithFilteredResult(_0x1b5a87,_0x5c5fb5))['catch'](handleError(_0x1b5a87,null));};exports[_0x6a2c('0x6e')]=function(_0x2894e9,_0xde3132,_0x2f71d5){return db['SmsAccount'][_0x6a2c('0x58')]({'where':{'id':_0x2894e9[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0xde3132,null))[_0x6a2c('0x1e')](function(_0x28c14d){if(_0x28c14d){return _0x28c14d[_0x6a2c('0x6e')](_0x2894e9[_0x6a2c('0x43')][_0x6a2c('0x6a')]);}})[_0x6a2c('0x1e')](respondWithStatusCode(_0xde3132,null))[_0x6a2c('0x28')](handleError(_0xde3132,null));};exports['notify']=function(_0x3282a5,_0x281e0e,_0x127916){var _0x572aac={'channel':'sms'};var _0x364d0c=[];var _0x5b76a5=[];var _0x4ee1e3={};return db[_0x6a2c('0x3e')][_0x6a2c('0x58')]({'where':{'id':_0x3282a5['params']['id']},'include':[{'model':db[_0x6a2c('0x6f')],'as':_0x6a2c('0x70')}]})[_0x6a2c('0x1e')](handleEntityNotFound(_0x281e0e,null))[_0x6a2c('0x1e')](function(_0x45f6cc){_0x572aac['account']=_0x45f6cc;_0x572aac[_0x6a2c('0x71')]=_['orderBy'](_0x45f6cc[_0x6a2c('0x70')],[_0x6a2c('0x72')],[_0x6a2c('0x73')]);if(_0x572aac[_0x6a2c('0x74')][_0x6a2c('0x70')]){delete _0x572aac[_0x6a2c('0x74')][_0x6a2c('0x70')];}return db[_0x6a2c('0x75')][_0x6a2c('0x61')]();})[_0x6a2c('0x1e')](function(_0x341380){if(!_0x341380){throw new db[(_0x6a2c('0x76'))]['ValidationError'](_0x6a2c('0x77'));}_0x364d0c=_[_0x6a2c('0x78')](_[_0x6a2c('0x57')](_0x341380),[_0x6a2c('0x79'),_0x6a2c('0x7a')]);_0x5b76a5=_[_0x6a2c('0x78')](_[_0x6a2c('0x57')](_0x341380),['createdAt','updatedAt','CompanyId',_0x6a2c('0x7b')]);_0x572aac[_0x6a2c('0x5a')]={'mapKey':_0x6a2c('0x7c')};if(_0x572aac[_0x6a2c('0x74')][_0x6a2c('0x40')]){switch(_0x572aac[_0x6a2c('0x74')][_0x6a2c('0x40')]){case'twilio':_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')]=_0x3282a5['body'][_0x6a2c('0x7e')];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x5a')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x7f')];_0x572aac['body'][_0x6a2c('0x80')]=_0x3282a5['body'][_0x6a2c('0x81')];break;case _0x6a2c('0x82'):_0x572aac['body'][_0x6a2c('0x7d')]='+'+_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x83')];_0x572aac[_0x6a2c('0x5a')]['body']=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x84')];break;case _0x6a2c('0x85'):_0x572aac[_0x6a2c('0x5a')]['from']=_0x3282a5['body'][_0x6a2c('0x7d')];_0x572aac['body'][_0x6a2c('0x5a')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x26')];break;case _0x6a2c('0x86'):_0x572aac['body']['from']=_0x3282a5[_0x6a2c('0x5a')]['from'];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x5a')]=_0x3282a5['body'][_0x6a2c('0x5a')];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x80')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x87')];break;case'plivo':_0x572aac['body']['from']=_0x3282a5[_0x6a2c('0x5a')]['From'];_0x572aac['body'][_0x6a2c('0x5a')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x88')];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x80')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x89')];break;case _0x6a2c('0x8a'):_0x572aac[_0x6a2c('0x5a')]['from']='+'+_0x3282a5[_0x6a2c('0x5a')]['results'][0x0][_0x6a2c('0x7d')];_0x572aac['body']['body']=_0x3282a5[_0x6a2c('0x5a')]['results'][0x0][_0x6a2c('0x84')];_0x572aac['body'][_0x6a2c('0x80')]=_0x3282a5[_0x6a2c('0x5a')]['results'][0x0][_0x6a2c('0x80')];break;case _0x6a2c('0x8b'):_0x572aac[_0x6a2c('0x5a')]['from']=_0x3282a5[_0x6a2c('0x5a')]['originatingAddress'];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x5a')]=_0x3282a5['body'][_0x6a2c('0x8c')][_0x6a2c('0x26')];break;case _0x6a2c('0x8d'):_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x8e')];_0x572aac[_0x6a2c('0x5a')]['body']=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x84')];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x80')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x8f')];break;case _0x6a2c('0x90'):_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x80')]=_0x3282a5[_0x6a2c('0x5a')][0x0][_0x6a2c('0x26')]['id'];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')]=_0x3282a5[_0x6a2c('0x5a')][0x0][_0x6a2c('0x26')][_0x6a2c('0x7d')];_0x572aac[_0x6a2c('0x5a')]['body']=_0x3282a5[_0x6a2c('0x5a')][0x0][_0x6a2c('0x26')][_0x6a2c('0x84')];break;case _0x6a2c('0x91'):_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x7d')];_0x572aac[_0x6a2c('0x5a')]['body']=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x26')];_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x80')]=_0x3282a5[_0x6a2c('0x5a')][_0x6a2c('0x92')];break;}}if(_0x572aac['body']['id']){delete _0x572aac[_0x6a2c('0x5a')]['id'];}if(_[_0x6a2c('0x93')](_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')])){throw new db['Sequelize'][(_0x6a2c('0x94'))](_0x6a2c('0x95'));}if(_[_0x6a2c('0x93')](_0x572aac['body'][_0x6a2c('0x5a')])||_0x572aac[_0x6a2c('0x5a')]['body']===''){throw new db[(_0x6a2c('0x76'))][(_0x6a2c('0x94'))](_0x6a2c('0x96'));}if(_[_0x6a2c('0x93')](_0x572aac['body'][_0x6a2c('0x97')])){throw new db['Sequelize'][(_0x6a2c('0x94'))](_0x6a2c('0x98')+_0x5b76a5);}if(!_[_0x6a2c('0x99')](_0x5b76a5,_0x572aac[_0x6a2c('0x5a')]['mapKey'])){throw new db[(_0x6a2c('0x76'))][(_0x6a2c('0x94'))](_0x6a2c('0x9a')+_0x5b76a5);}_0x4ee1e3[_0x572aac['body'][_0x6a2c('0x97')]]=_0x572aac['body'][_0x6a2c('0x7d')];return db[_0x6a2c('0x9b')]['find']({'where':{'id':_0x572aac[_0x6a2c('0x74')][_0x6a2c('0x7b')]},'include':[{'model':db[_0x6a2c('0x75')],'as':_0x6a2c('0x9c'),'where':_0x4ee1e3,'limit':0x1,'order':[['updatedAt',_0x6a2c('0x9d')]]}]});})[_0x6a2c('0x1e')](handleEntityNotFound(_0x281e0e,null))[_0x6a2c('0x1e')](function(_0x337482){if(_0x337482){_0x572aac[_0x6a2c('0x9e')]=_[_0x6a2c('0x9f')](_0x337482,[_0x6a2c('0x9c')]);if(_0x337482['Contacts'][_0x6a2c('0x48')]){return _0x337482['Contacts'][0x0];}var _0x180e4c=_[_0x6a2c('0x16')](_0x572aac[_0x6a2c('0x5a')],{'firstName':_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')],'ListId':_0x337482['id']});_0x180e4c[_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x97')]]=_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')];return db[_0x6a2c('0x75')][_0x6a2c('0x59')](_0x180e4c,{'fields':_0x364d0c,'raw':!![]});}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x281e0e,null))[_0x6a2c('0x1e')](function(_0x492f64){if(_0x492f64){_0x572aac[_0x6a2c('0xa0')]=_0x492f64;var _0x5b58e4={'ContactId':_0x492f64['id'],'phone':_0x572aac['body'][_0x6a2c('0x7d')],'SmsAccountId':_0x3282a5[_0x6a2c('0x56')]['id']};var _0x5b55f7={'ContactId':_0x492f64['id'],'SmsAccountId':_0x3282a5[_0x6a2c('0x56')]['id'],'closed':![]};return db['SmsInteraction'][_0x6a2c('0x58')]({'where':_0x5b55f7})['then'](function(_0x2b0b83){if(_0x2b0b83){return[_0x2b0b83,![]];}return db[_0x6a2c('0xa1')][_0x6a2c('0x59')](_0x5b58e4)[_0x6a2c('0x1e')](function(_0x38962b){return[_0x38962b,!![]];});});}})[_0x6a2c('0xa2')](function(_0x1a3869,_0x39aef9){_0x572aac[_0x6a2c('0xa3')]=_0x1a3869[_0x6a2c('0x36')]({'plain':!![]});_0x572aac['interaction'][_0x6a2c('0xa4')]=![];if(_0x39aef9){if(_0x572aac[_0x6a2c('0x74')][_0x6a2c('0xa5')]){_0x572aac['applications'][_0x6a2c('0xa6')]({'id':0x0,'priority':_0x572aac[_0x6a2c('0x71')][_0x6a2c('0x48')]+0x1,'app':_0x6a2c('0xa7'),'appdata':_0x6a2c('0xa8'),'interval':'*,*,*,*'});}_0x572aac[_0x6a2c('0xa3')][_0x6a2c('0xa4')]=!![];}return db[_0x6a2c('0xa9')]['create']({'phone':_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x7d')],'messageId':_0x572aac['body'][_0x6a2c('0x80')],'body':_0x572aac[_0x6a2c('0x5a')][_0x6a2c('0x5a')],'SmsAccountId':_0x3282a5[_0x6a2c('0x56')]['id'],'SmsInteractionId':_0x1a3869['id'],'direction':'in','ContactId':_0x1a3869[_0x6a2c('0xaa')],'AttachmentId':_0x572aac[_0x6a2c('0x5a')]['AttachmentId']});})['then'](function(_0x4232c1){_0x572aac['message']=_0x4232c1;if(_0x572aac['interaction'][_0x6a2c('0xab')]){return db[_0x6a2c('0xac')][_0x6a2c('0x58')]({'attributes':['id',_0x6a2c('0x3a')],'where':{'id':_0x572aac[_0x6a2c('0xa3')][_0x6a2c('0xab')]}})['then'](function(_0x318192){if(_0x318192){_0x572aac[_0x6a2c('0x71')][_0x6a2c('0xad')]({'id':0x0,'priority':0x0,'app':_0x6a2c('0xae'),'appdata':_0x318192[_0x6a2c('0x3a')]+','+(_0x572aac[_0x6a2c('0x74')][_0x6a2c('0xaf')]||0xa),'interval':_0x6a2c('0xb0')});}return respondWithRpcPromise(_0x6a2c('0xb1'),_0x6a2c('0xb2'),_0x572aac);});}return respondWithRpcPromise(_0x6a2c('0xb1'),_0x6a2c('0xb2'),_0x572aac);})[_0x6a2c('0x1e')](function(_0x3e9a65){if(_0x3e9a65){var _0x4ddf29=0xc8;var _0x17854d=_0x6a2c('0xb3');logger[_0x6a2c('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x17854d,_0x4ddf29,_0x6a2c('0xb4'));logger[_0x6a2c('0x22')](_0x6a2c('0xb5'),_0x17854d,_0x4ddf29,_0x6a2c('0xb4'),JSON[_0x6a2c('0x24')](_0x3e9a65));if(_0x572aac[_0x6a2c('0x74')][_0x6a2c('0x40')]===_0x6a2c('0xb6')){return _0x281e0e[_0x6a2c('0x30')](_0x4ddf29)[_0x6a2c('0xb7')]('Content-Type','text/xml')['send'](_0x6a2c('0xb8'));}else{return _0x281e0e[_0x6a2c('0x30')](_0x4ddf29)[_0x6a2c('0x2b')](_0x3e9a65);}}})['catch'](handleError(_0x281e0e,null));};exports[_0x6a2c('0xb9')]=function(_0x448dcd,_0x4489a7){var _0x414157=_0x448dcd[_0x6a2c('0x56')]['id'];var _0x3d5ef0=_0x448dcd['body'];var _0x5a9885=0xc8;var _0x17e315=null;return db[_0x6a2c('0xba')][_0x6a2c('0xbb')]({'isolationLevel':db[_0x6a2c('0xba')][_0x6a2c('0xbc')][_0x6a2c('0xbd')][_0x6a2c('0xbe')]},function(_0xd66075){return db['SmsAccount']['findOne']({'where':{'id':_0x414157},'transaction':_0xd66075})[_0x6a2c('0x1e')](function(_0x1542fa){if(_0x1542fa){return db[_0x6a2c('0x6f')][_0x6a2c('0x35')]({'where':{'SmsAccountId':_0x414157},'transaction':_0xd66075})['then'](function(){var _0x523947=_[_0x6a2c('0x4e')](_0x3d5ef0,function(_0x4b02cb){_0x4b02cb[_0x6a2c('0x68')]=_0x414157;return _0x4b02cb;});return db['SmsApplication'][_0x6a2c('0xbf')](_0x523947,{'transaction':_0xd66075});});}else{_0x5a9885=0x194;_0x17e315=[];}});})[_0x6a2c('0x1e')](function(){if(_0x5a9885!==0x194){return db['SmsApplication'][_0x6a2c('0xc0')]({'where':{'SmsAccountId':_0x414157},'order':_0x6a2c('0x72')})['then'](function(_0xf3ca7){_0x17e315=_0xf3ca7;});}})[_0x6a2c('0x28')](function(_0x10ad15){_0x5a9885=0x1f4;logger['error'](_0x10ad15['stack']);if(_0x10ad15[_0x6a2c('0x3a')]){delete _0x10ad15[_0x6a2c('0x3a')];}_0x17e315=_0x10ad15;})['finally'](function(){if(_0x17e315===null){_0x4489a7[_0x6a2c('0x29')](_0x5a9885);}else{if(_0x5a9885===0x1f4){_0x4489a7[_0x6a2c('0x30')](_0x5a9885)[_0x6a2c('0xc1')](_0x17e315);}else{_0x4489a7[_0x6a2c('0x30')](_0x5a9885)['json'](_0x17e315);}}});};exports[_0x6a2c('0xc2')]=function(_0x4a770b,_0x5bb22a,_0x14cc3a){var _0x2e9f65={};var _0x312d93={};var _0x28573c;var _0x2525d8;return db[_0x6a2c('0x3e')][_0x6a2c('0x64')]({'where':{'id':_0x4a770b[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x5bb22a,null))['then'](function(_0x2ad7c7){if(_0x2ad7c7){_0x28573c=_0x2ad7c7;_0x312d93[_0x6a2c('0x42')]=_['keys'](db['SmsApplication'][_0x6a2c('0x3f')]);_0x312d93['query']=_[_0x6a2c('0x57')](_0x4a770b[_0x6a2c('0x43')]);_0x312d93['filters']=_[_0x6a2c('0x45')](_0x312d93[_0x6a2c('0x42')],_0x312d93[_0x6a2c('0x43')]);_0x2e9f65[_0x6a2c('0x46')]=_[_0x6a2c('0x45')](_0x312d93[_0x6a2c('0x42')],qs[_0x6a2c('0x47')](_0x4a770b[_0x6a2c('0x43')][_0x6a2c('0x47')]));_0x2e9f65[_0x6a2c('0x46')]=_0x2e9f65['attributes'][_0x6a2c('0x48')]?_0x2e9f65[_0x6a2c('0x46')]:_0x312d93[_0x6a2c('0x42')];_0x2e9f65['order']=qs['sort'](_0x4a770b[_0x6a2c('0x43')]['sort']);_0x2e9f65[_0x6a2c('0x4b')]=qs[_0x6a2c('0x44')](_['pick'](_0x4a770b[_0x6a2c('0x43')],_0x312d93[_0x6a2c('0x44')]));if(_0x4a770b[_0x6a2c('0x43')][_0x6a2c('0x4c')]){_0x2e9f65[_0x6a2c('0x4b')]=_[_0x6a2c('0x4d')](_0x2e9f65[_0x6a2c('0x4b')],{'$or':_[_0x6a2c('0x4e')](_0x2e9f65[_0x6a2c('0x46')],function(_0x4d990d){var _0x3ba4e9={};_0x3ba4e9[_0x4d990d]={'$like':'%'+_0x4a770b[_0x6a2c('0x43')]['filter']+'%'};return _0x3ba4e9;})});}_0x2e9f65=_['merge']({},_0x2e9f65,_0x4a770b[_0x6a2c('0x50')]);return _0x28573c[_0x6a2c('0xc2')](_0x2e9f65);}})[_0x6a2c('0x1e')](function(_0x41b68c){if(_0x41b68c){_0x2525d8=_0x41b68c[_0x6a2c('0x48')];if(!_0x4a770b['query'][_0x6a2c('0x65')]('nolimit')){_0x2e9f65[_0x6a2c('0x2f')]=qs['limit'](_0x4a770b[_0x6a2c('0x43')][_0x6a2c('0x2f')]);_0x2e9f65['offset']=qs[_0x6a2c('0x2c')](_0x4a770b[_0x6a2c('0x43')][_0x6a2c('0x2c')]);}return _0x28573c['getApplications'](_0x2e9f65);}})[_0x6a2c('0x1e')](function(_0x4b0152){if(_0x4b0152){return _0x4b0152?{'count':_0x2525d8,'rows':_0x4b0152}:null;}})['then'](respondWithResult(_0x5bb22a,null))[_0x6a2c('0x28')](handleError(_0x5bb22a,null));};exports[_0x6a2c('0xc3')]=function(_0x62a90b,_0x1c0444,_0x1e61ff){var _0x59d5d3={'raw':![],'where':{}};var _0x638b2b={};var _0x52ecea={'count':0x0,'rows':[]};return db[_0x6a2c('0x3e')][_0x6a2c('0x64')]({'where':{'id':_0x62a90b[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x1c0444,null))[_0x6a2c('0x1e')](function(_0x40f168){if(_0x40f168){_0x638b2b[_0x6a2c('0x42')]=_['keys'](db[_0x6a2c('0xa1')][_0x6a2c('0x3f')]);_0x638b2b[_0x6a2c('0x43')]=_[_0x6a2c('0x57')](_0x62a90b[_0x6a2c('0x43')]);_0x638b2b[_0x6a2c('0x44')]=_['intersection'](_0x638b2b['model'],_0x638b2b[_0x6a2c('0x43')]);_0x59d5d3[_0x6a2c('0x46')]=_['intersection'](_0x638b2b['model'],qs[_0x6a2c('0x47')](_0x62a90b[_0x6a2c('0x43')][_0x6a2c('0x47')]));_0x59d5d3[_0x6a2c('0x46')]=_0x59d5d3[_0x6a2c('0x46')]['length']?_0x59d5d3['attributes']:_0x638b2b[_0x6a2c('0x42')];if(!_0x62a90b['query']['hasOwnProperty'](_0x6a2c('0x66'))){_0x59d5d3[_0x6a2c('0x2f')]=qs[_0x6a2c('0x2f')](_0x62a90b[_0x6a2c('0x43')][_0x6a2c('0x2f')]);_0x59d5d3['offset']=qs[_0x6a2c('0x2c')](_0x62a90b['query'][_0x6a2c('0x2c')]);}_0x59d5d3[_0x6a2c('0x49')]=qs[_0x6a2c('0x4a')](_0x62a90b['query'][_0x6a2c('0x4a')]);_0x59d5d3[_0x6a2c('0x4b')]=qs['filters'](_[_0x6a2c('0x67')](_0x62a90b[_0x6a2c('0x43')],_0x638b2b[_0x6a2c('0x44')]));_0x59d5d3['where']['SmsAccountId']=_0x40f168['id'];if(_0x62a90b['query']['filter']){_0x59d5d3[_0x6a2c('0x4b')]=_[_0x6a2c('0x4d')](_0x59d5d3[_0x6a2c('0x4b')],{'$or':_[_0x6a2c('0x4e')](_0x59d5d3[_0x6a2c('0x46')],function(_0x342804){var _0x2bc119={};_0x2bc119[_0x342804]={'$like':'%'+_0x62a90b[_0x6a2c('0x43')][_0x6a2c('0x4c')]+'%'};return _0x2bc119;})});}_0x59d5d3=_[_0x6a2c('0x4d')]({},_0x59d5d3,_0x62a90b[_0x6a2c('0x50')]);return db[_0x6a2c('0xa1')][_0x6a2c('0x2e')]({'where':_0x59d5d3[_0x6a2c('0x4b')]})[_0x6a2c('0x1e')](function(_0x348286){_0x52ecea[_0x6a2c('0x2e')]=_0x348286;if(_0x62a90b[_0x6a2c('0x43')][_0x6a2c('0x51')]){_0x59d5d3[_0x6a2c('0x52')]=[{'model':db['CmContact'],'as':_0x6a2c('0xc4'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x6a2c('0x3a'),_0x6a2c('0xc5'),_0x6a2c('0xc6')],'required':![]},{'model':db[_0x6a2c('0xc7')],'as':_0x6a2c('0xc8'),'attributes':['id',_0x6a2c('0x3a'),_0x6a2c('0xc9')],'where':_0x62a90b[_0x6a2c('0x43')][_0x6a2c('0xca')]?{'id':_0x62a90b['query'][_0x6a2c('0xca')]}:undefined,'required':_0x62a90b['query'][_0x6a2c('0xca')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x59d5d3);})['then'](function(_0x185e6b){_0x52ecea[_0x6a2c('0x54')]=_0x185e6b;return _0x52ecea;});}})[_0x6a2c('0x1e')](respondWithFilteredResult(_0x1c0444,_0x59d5d3))[_0x6a2c('0x28')](handleError(_0x1c0444,null));};exports[_0x6a2c('0xc1')]=function(_0x81682c,_0x4d2142,_0x560035){var _0x5ef67b,_0x386d19,_0x4d9bde;if(_[_0x6a2c('0x93')](_0x81682c[_0x6a2c('0x5a')]['body'])||_0x81682c[_0x6a2c('0x5a')][_0x6a2c('0x5a')]===''){throw new db[(_0x6a2c('0x76'))][(_0x6a2c('0x94'))](_0x6a2c('0x96'));}if(_['isNil'](_0x81682c[_0x6a2c('0x5a')]['to'])){throw new db['Sequelize'][(_0x6a2c('0x94'))](_0x6a2c('0xcb'));}_0x5ef67b=_0x81682c['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x81682c[_0x6a2c('0x56')]['id']},'include':[{'model':db[_0x6a2c('0x9b')],'as':_0x6a2c('0xcc'),'include':[{'model':db['CmContact'],'as':_0x6a2c('0x9c'),'where':{'mobile':_0x5ef67b},'limit':0x1,'order':[[_0x6a2c('0x7a'),'DESC']]}]}]})[_0x6a2c('0x1e')](handleEntityNotFound(_0x4d2142,null))[_0x6a2c('0x1e')](function(_0x263096){if(_0x263096&&_0x263096['List']){_0x386d19=_0x263096[_0x6a2c('0x36')]({'plain':!![]});if(_0x386d19['List']&&_0x386d19[_0x6a2c('0xcc')][_0x6a2c('0x9c')][_0x6a2c('0x48')]){return _0x386d19[_0x6a2c('0xcc')][_0x6a2c('0x9c')][0x0];}return db[_0x6a2c('0x75')][_0x6a2c('0x59')](_[_0x6a2c('0x16')](_0x81682c['body'],{'firstName':_0x5ef67b,'mobile':_0x5ef67b,'phone':_0x5ef67b,'ListId':_0x386d19['ListId']}));}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x4d2142,null))[_0x6a2c('0x1e')](function(_0x577a30){if(_0x577a30){_0x4d9bde=_0x577a30;return db['SmsInteraction']['find']({'where':{'ContactId':_0x4d9bde['id'],'closed':![],'SmsAccountId':_0x386d19['id']}})['then'](function(_0x4ba6b3){if(_0x4ba6b3){return[_0x4ba6b3,![]];}return db[_0x6a2c('0xa1')][_0x6a2c('0x59')]({'UserId':_0x81682c[_0x6a2c('0x5b')]['id'],'ContactId':_0x4d9bde['id'],'SmsAccountId':_0x386d19['id'],'phone':_0x5ef67b,'firstMsgDirection':_0x6a2c('0xcd'),'Messages':[_[_0x6a2c('0x4d')](_0x81682c[_0x6a2c('0x5a')],{'read':![],'body':_0x81682c[_0x6a2c('0x5a')][_0x6a2c('0x5a')],'phone':_0x5ef67b,'SmsAccountId':_0x386d19['id'],'UserId':_0x81682c[_0x6a2c('0x5b')]['id'],'ContactId':_0x4d9bde['id']})]},{'include':[{'model':db[_0x6a2c('0xa9')],'as':'Messages'}]})['then'](function(_0x4824f6){return[_0x4824f6,!![]];});});}})[_0x6a2c('0xa2')](function(_0x375601,_0xef9dcd){if(_0xef9dcd){return _0x375601;}return db['SmsMessage'][_0x6a2c('0x59')](_[_0x6a2c('0x4d')](_0x81682c[_0x6a2c('0x5a')],{'read':![],'body':_0x81682c[_0x6a2c('0x5a')][_0x6a2c('0x5a')],'phone':_0x5ef67b,'SmsAccountId':_0x386d19['id'],'SmsInteractionId':_0x375601['id'],'UserId':_0x81682c[_0x6a2c('0x5b')]['id'],'ContactId':_0x4d9bde['id']}))['then'](function(_0x1a552e){_0x375601['dataValues'][_0x6a2c('0xce')]=[];_0x375601[_0x6a2c('0xcf')][_0x6a2c('0xce')][_0x6a2c('0xa6')](_0x1a552e[_0x6a2c('0xcf')]);return _0x375601;});})[_0x6a2c('0x1e')](respondWithResult(_0x4d2142,null))[_0x6a2c('0x28')](handleError(_0x4d2142,null));};exports[_0x6a2c('0x30')]=function(_0x54a934,_0x506cbb,_0x43b0e5){if(_0x54a934['body']['id']){delete _0x54a934[_0x6a2c('0x5a')]['id'];}var _0x45944b,_0x3d3418,_0x2f3c4f;return db['SmsAccount'][_0x6a2c('0x58')]({'where':{'id':_0x54a934['params']['id']}})['then'](handleEntityNotFound(_0x506cbb,null))[_0x6a2c('0x1e')](function(_0x3cfe11){if(_0x3cfe11){_0x2f3c4f=_0x3cfe11;logger[_0x6a2c('0x22')](_0x6a2c('0x23'),'status',_0x6a2c('0xd0'),_0x3cfe11[_0x6a2c('0x40')],util[_0x6a2c('0xd1')](_0x54a934[_0x6a2c('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3cfe11[_0x6a2c('0x40')]){case _0x6a2c('0x82'):if(_0x54a934['body'][_0x6a2c('0xd2')]&&_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0x30')]){_0x3d3418=_0x54a934['body'][_0x6a2c('0x30')];return db[_0x6a2c('0xa9')]['find']({'where':{'messageId':_0x54a934['body'][_0x6a2c('0xd2')]}});}break;case _0x6a2c('0x85'):if(_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd3')]&&_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd4')]){_0x3d3418=_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd4')];return db['SmsMessage'][_0x6a2c('0x58')]({'where':{'messageId':_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd3')]}});}break;case'clicksend':if(_0x54a934[_0x6a2c('0x5a')]['message_id']&&_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd5')]){_0x3d3418=_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd5')];return db[_0x6a2c('0xa9')][_0x6a2c('0x58')]({'where':{'messageId':_0x54a934[_0x6a2c('0x5a')]['message_id']}});}break;case _0x6a2c('0x8a'):var _0x3a1134=_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd6')][0x0];if(_0x3a1134[_0x6a2c('0x80')]&&_0x3a1134['status']['groupName']===_0x6a2c('0xd7')){_0x3d3418=_0x3a1134[_0x6a2c('0x30')]['groupName'];return db['SmsMessage'][_0x6a2c('0x58')]({'where':{'messageId':_0x3a1134[_0x6a2c('0x80')]}});}break;case _0x6a2c('0x8d'):if(_0x54a934[_0x6a2c('0x5a')]['messageId']&&_0x54a934['body'][_0x6a2c('0x30')]){_0x3d3418=_0x54a934['body'][_0x6a2c('0x30')];return db[_0x6a2c('0xa9')][_0x6a2c('0x58')]({'where':{'messageId':_0x54a934['body'][_0x6a2c('0x80')]}});}break;case'bandwidth':if(_0x54a934[_0x6a2c('0x5a')][0x0][_0x6a2c('0x26')]['id']){_0x3d3418=_0x54a934[_0x6a2c('0x5a')][0x0]['type'];return db['SmsMessage'][_0x6a2c('0x58')]({'where':{'messageId':_0x54a934[_0x6a2c('0x5a')][0x0][_0x6a2c('0x26')]['id']}});}break;case _0x6a2c('0x91'):if(_0x54a934[_0x6a2c('0x5a')]['redif']&&_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0x30')]){_0x3d3418=_0x54a934['body'][_0x6a2c('0x30')];return db['SmsMessage'][_0x6a2c('0x58')]({'where':{'messageId':_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x506cbb,null))['then'](function(_0x4f8004){if(_0x4f8004){_0x45944b=_0x4f8004;switch(_0x2f3c4f['type']){case'skebby':if(_0x3d3418===_0x6a2c('0xd7')){return _0x45944b[_0x6a2c('0x34')]({'read':!![]});}else{logger[_0x6a2c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x6a2c('0x82'),util['inspect'](_0x54a934['body'],{'showHidden':![],'depth':null}));}break;case _0x6a2c('0x85'):if(_0x3d3418==='1'){return _0x45944b[_0x6a2c('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6a2c('0x30'),'skebby',util[_0x6a2c('0xd1')](_0x54a934['body'],{'showHidden':![],'depth':null}));}break;case _0x6a2c('0x86'):if(!_0x54a934[_0x6a2c('0x5a')][_0x6a2c('0xd9')]&&_0x3d3418>=0xc8&&_0x3d3418<=0xce){return _0x45944b['update']({'read':!![]});}else{logger[_0x6a2c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6a2c('0x30'),_0x6a2c('0x86'),util[_0x6a2c('0xd1')](_0x54a934[_0x6a2c('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x6a2c('0x8a'):var _0x43abba=_0x54a934[_0x6a2c('0x5a')]['results'][0x0];if(_0x43abba['status'][_0x6a2c('0xda')]===_0x6a2c('0xd7')){return _0x45944b[_0x6a2c('0x34')]({'read':!![]});}else{logger['error'](_0x6a2c('0x23'),_0x6a2c('0x30'),'infobip',util['inspect'](_0x54a934[_0x6a2c('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3d3418==_0x6a2c('0xdb')||_0x3d3418==_0x6a2c('0xdc')){return _0x45944b['update']({'read':!![]});}else{logger['error'](_0x6a2c('0x23'),_0x6a2c('0x30'),_0x6a2c('0x8d'),util[_0x6a2c('0xd1')](_0x54a934['body'],{'showHidden':![],'depth':null}));}break;case _0x6a2c('0x90'):if(_0x3d3418=='message-delivered'){return _0x45944b[_0x6a2c('0x34')]({'read':!![]});}else{logger[_0x6a2c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6a2c('0x30'),_0x6a2c('0x90'),util[_0x6a2c('0xd1')](_0x54a934[_0x6a2c('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x6a2c('0x91'):if(_0x3d3418===_0x6a2c('0xdd')||_0x3d3418===_0x6a2c('0xde')){return _0x45944b['update']({'read':!![]});}else{logger[_0x6a2c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6a2c('0x30'),_0x6a2c('0x91'),util[_0x6a2c('0xd1')](_0x54a934['body'],{'showHidden':![],'depth':null}));}break;}return _0x45944b;}})[_0x6a2c('0x1e')](respondWithResult(_0x506cbb,null))['catch'](handleError(_0x506cbb,null));};exports[_0x6a2c('0xdf')]=function(_0x321302,_0x184677,_0x3fde30){var _0x5e72d6,_0x349a3e,_0xe0228a;return db[_0x6a2c('0x3e')][_0x6a2c('0x58')]({'where':{'id':_0x321302[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x184677,null))[_0x6a2c('0x1e')](function(_0x19d80c){if(_0x19d80c){_0xe0228a=_0x19d80c;logger[_0x6a2c('0x22')](_0x6a2c('0x23'),_0x6a2c('0x30'),_0x6a2c('0xd0'),_0x19d80c['type'],util[_0x6a2c('0xd1')](_0x321302[_0x6a2c('0x43')],{'showHidden':![],'depth':null}));switch(_0x19d80c[_0x6a2c('0x40')]){case'csc':if(_0x321302[_0x6a2c('0x43')]['message-id']&&_0x321302[_0x6a2c('0x43')][_0x6a2c('0xe0')]){_0x349a3e=_0x321302[_0x6a2c('0x43')]['state'];return db[_0x6a2c('0xa9')]['find']({'where':{'messageId':_0x321302[_0x6a2c('0x43')][_0x6a2c('0xe1')]}});}break;}}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x184677,null))['then'](function(_0x4b1f65){if(_0x4b1f65){_0x5e72d6=_0x4b1f65;switch(_0xe0228a['type']){case _0x6a2c('0x8b'):if(_0x349a3e==='2'||_0x349a3e==='6'){return _0x5e72d6[_0x6a2c('0x34')]({'read':!![]});}else{logger[_0x6a2c('0x25')](_0x6a2c('0x23'),_0x6a2c('0x30'),_0x6a2c('0x8b'),util['inspect'](_0x321302[_0x6a2c('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x5e72d6;}})[_0x6a2c('0x1e')](respondWithResult(_0x184677,null))[_0x6a2c('0x28')](handleError(_0x184677,null));};exports['addAgents']=function(_0x4e543f,_0x5aa810,_0x168cec){return db[_0x6a2c('0x3e')][_0x6a2c('0x58')]({'where':{'id':_0x4e543f['params']['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x5aa810,null))[_0x6a2c('0x1e')](function(_0x10e850){if(_0x10e850){return _0x10e850[_0x6a2c('0xe2')](_0x4e543f[_0x6a2c('0x5a')]['ids'],_[_0x6a2c('0x9f')](_0x4e543f[_0x6a2c('0x5a')],['ids','id'])||{})[_0x6a2c('0xa2')](function(_0x32e955){for(var _0x38fe0c=0x0;_0x38fe0c<_0x4e543f['body'][_0x6a2c('0x6a')][_0x6a2c('0x48')];_0x38fe0c+=0x1){socket[_0x6a2c('0xe3')]('userSmsAccount:save',{'UserId':Number(_0x4e543f[_0x6a2c('0x5a')][_0x6a2c('0x6a')][_0x38fe0c]),'SmsAccountId':Number(_0x4e543f[_0x6a2c('0x56')]['id'])});}return _0x32e955;});}})[_0x6a2c('0x1e')](respondWithResult(_0x5aa810,null))[_0x6a2c('0x28')](handleError(_0x5aa810,null));};exports[_0x6a2c('0xe4')]=function(_0x53fed2,_0x2f220c,_0x3525bc){return db[_0x6a2c('0x3e')][_0x6a2c('0x58')]({'where':{'id':_0x53fed2[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x2f220c,null))[_0x6a2c('0x1e')](function(_0x5b5daf){if(_0x5b5daf){return _0x5b5daf[_0x6a2c('0xe4')](_0x53fed2['query'][_0x6a2c('0x6a')])[_0x6a2c('0x1e')](function(){if(_[_0x6a2c('0xe5')](_0x53fed2[_0x6a2c('0x43')]['ids'])){for(var _0x55dd8d=0x0;_0x55dd8d<_0x53fed2[_0x6a2c('0x43')]['ids']['length'];_0x55dd8d+=0x1){socket['emit'](_0x6a2c('0xe6'),{'UserId':Number(_0x53fed2[_0x6a2c('0x43')][_0x6a2c('0x6a')][_0x55dd8d]),'SmsAccountId':Number(_0x53fed2[_0x6a2c('0x56')]['id'])});}}else{socket[_0x6a2c('0xe3')](_0x6a2c('0xe6'),{'UserId':Number(_0x53fed2[_0x6a2c('0x43')][_0x6a2c('0x6a')]),'SmsAccountId':Number(_0x53fed2[_0x6a2c('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f220c,null))['catch'](handleError(_0x2f220c,null));};exports[_0x6a2c('0xe7')]=function(_0x36ddf9,_0x9baa77,_0x23a981){var _0x472507={};var _0x3b33e4={};var _0x3dbbdf;var _0x35cc58;return db[_0x6a2c('0x3e')][_0x6a2c('0x64')]({'where':{'id':_0x36ddf9[_0x6a2c('0x56')]['id']}})[_0x6a2c('0x1e')](handleEntityNotFound(_0x9baa77,null))[_0x6a2c('0x1e')](function(_0x1efc31){if(_0x1efc31){_0x3dbbdf=_0x1efc31;_0x3b33e4[_0x6a2c('0x42')]=_[_0x6a2c('0x57')](db[_0x6a2c('0xac')]['rawAttributes']);_0x3b33e4[_0x6a2c('0x43')]=_[_0x6a2c('0x57')](_0x36ddf9[_0x6a2c('0x43')]);_0x3b33e4[_0x6a2c('0x44')]=_[_0x6a2c('0x45')](_0x3b33e4[_0x6a2c('0x42')],_0x3b33e4[_0x6a2c('0x43')]);_0x472507[_0x6a2c('0x46')]=_['intersection'](_0x3b33e4[_0x6a2c('0x42')],qs[_0x6a2c('0x47')](_0x36ddf9[_0x6a2c('0x43')][_0x6a2c('0x47')]));_0x472507[_0x6a2c('0x46')]=_0x472507['attributes']['length']?_0x472507[_0x6a2c('0x46')]:_0x3b33e4[_0x6a2c('0x42')];_0x472507[_0x6a2c('0x49')]=qs[_0x6a2c('0x4a')](_0x36ddf9[_0x6a2c('0x43')]['sort']);_0x472507['where']=qs[_0x6a2c('0x44')](_[_0x6a2c('0x67')](_0x36ddf9[_0x6a2c('0x43')],_0x3b33e4[_0x6a2c('0x44')]));if(_0x36ddf9[_0x6a2c('0x43')][_0x6a2c('0x4c')]){_0x472507[_0x6a2c('0x4b')]=_[_0x6a2c('0x4d')](_0x472507['where'],{'$or':_['map'](_0x472507[_0x6a2c('0x46')],function(_0x344877){var _0x2c795d={};_0x2c795d[_0x344877]={'$like':'%'+_0x36ddf9['query'][_0x6a2c('0x4c')]+'%'};return _0x2c795d;})});}_0x472507=_[_0x6a2c('0x4d')]({},_0x472507,_0x36ddf9[_0x6a2c('0x50')]);return _0x3dbbdf['getAgents'](_0x472507);}})[_0x6a2c('0x1e')](function(_0x368811){if(_0x368811){_0x35cc58=_0x368811[_0x6a2c('0x48')];if(!_0x36ddf9['query'][_0x6a2c('0x65')]('nolimit')){_0x472507[_0x6a2c('0x2f')]=qs[_0x6a2c('0x2f')](_0x36ddf9[_0x6a2c('0x43')][_0x6a2c('0x2f')]);_0x472507[_0x6a2c('0x2c')]=qs[_0x6a2c('0x2c')](_0x36ddf9['query'][_0x6a2c('0x2c')]);}return _0x3dbbdf['getAgents'](_0x472507);}})[_0x6a2c('0x1e')](function(_0x4393ca){if(_0x4393ca){return _0x4393ca?{'count':_0x35cc58,'rows':_0x4393ca}:null;}})[_0x6a2c('0x1e')](respondWithResult(_0x9baa77,null))[_0x6a2c('0x28')](handleError(_0x9baa77,null));};
\ No newline at end of file
index aea64a2..8eec8ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34d8=['hasOwnProperty','hook','exports','events','SmsAccount','setMaxListeners','save','update','emit'];(function(_0x4ab8d9,_0xb5dc7d){var _0x403873=function(_0xb334a9){while(--_0xb334a9){_0x4ab8d9['push'](_0x4ab8d9['shift']());}};_0x403873(++_0xb5dc7d);}(_0x34d8,0x1b3));var _0x834d=function(_0x36e7ba,_0x47513d){_0x36e7ba=_0x36e7ba-0x0;var _0x745c36=_0x34d8[_0x36e7ba];return _0x745c36;};'use strict';var EventEmitter=require(_0x834d('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x834d('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x834d('0x2')](0x0);var events={'afterCreate':_0x834d('0x3'),'afterUpdate':_0x834d('0x4'),'afterDestroy':'remove'};function emitEvent(_0xde8374){return function(_0x351498,_0x18e8ef,_0x3f30ad){SmsAccountEvents[_0x834d('0x5')](_0xde8374+':'+_0x351498['id'],_0x351498);SmsAccountEvents[_0x834d('0x5')](_0xde8374,_0x351498);_0x3f30ad(null);};}for(var e in events){if(events[_0x834d('0x6')](e)){var event=events[e];SmsAccount[_0x834d('0x7')](e,emitEvent(event));}}module[_0x834d('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x268d=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4bdbad,_0x13ba6c){var _0x499bcb=function(_0x22fa33){while(--_0x22fa33){_0x4bdbad['push'](_0x4bdbad['shift']());}};_0x499bcb(++_0x13ba6c);}(_0x268d,0xb3));var _0xd268=function(_0x441e41,_0x36cce4){_0x441e41=_0x441e41-0x0;var _0x3f3452=_0x268d[_0x441e41];return _0x3f3452;};'use strict';var EventEmitter=require(_0xd268('0x0'));var SmsAccount=require(_0xd268('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd268('0x2')](0x0);var events={'afterCreate':_0xd268('0x3'),'afterUpdate':_0xd268('0x4'),'afterDestroy':_0xd268('0x5')};function emitEvent(_0x570cf8){return function(_0xbfdcce,_0x396061,_0x13f4d8){SmsAccountEvents[_0xd268('0x6')](_0x570cf8+':'+_0xbfdcce['id'],_0xbfdcce);SmsAccountEvents['emit'](_0x570cf8,_0xbfdcce);_0x13f4d8(null);};}for(var e in events){if(events[_0xd268('0x7')](e)){var event=events[e];SmsAccount[_0xd268('0x8')](e,emitEvent(event));}}module[_0xd268('0x9')]=SmsAccountEvents;
\ No newline at end of file
index e5d79f3..905b29b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe697=['request-promise','path','../../config/environment','./smsAccount.attributes','exports','sms_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1d67ba,_0x548a8e){var _0x4c9db4=function(_0x172e93){while(--_0x172e93){_0x1d67ba['push'](_0x1d67ba['shift']());}};_0x4c9db4(++_0x548a8e);}(_0xe697,0xa0));var _0x7e69=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0xe697[_0x2389bc];return _0x170548;};'use strict';var _=require(_0x7e69('0x0'));var util=require('util');var logger=require(_0x7e69('0x1'))(_0x7e69('0x2'));var moment=require(_0x7e69('0x3'));var BPromise=require(_0x7e69('0x4'));var rp=require(_0x7e69('0x5'));var fs=require('fs');var path=require(_0x7e69('0x6'));var rimraf=require('rimraf');var config=require(_0x7e69('0x7'));var attributes=require(_0x7e69('0x8'));module[_0x7e69('0x9')]=function(_0x3b7370,_0x280dae){return _0x3b7370['define']('SmsAccount',attributes,{'tableName':_0x7e69('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbbb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','sms_accounts'];(function(_0x18d28c,_0x2cf591){var _0x3553b8=function(_0x2d6474){while(--_0x2d6474){_0x18d28c['push'](_0x18d28c['shift']());}};_0x3553b8(++_0x2cf591);}(_0xcbbb,0x1ee));var _0xbcbb=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xcbbb[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xbcbb('0x0'));var util=require(_0xbcbb('0x1'));var logger=require(_0xbcbb('0x2'))(_0xbcbb('0x3'));var moment=require(_0xbcbb('0x4'));var BPromise=require(_0xbcbb('0x5'));var rp=require(_0xbcbb('0x6'));var fs=require('fs');var path=require(_0xbcbb('0x7'));var rimraf=require(_0xbcbb('0x8'));var config=require(_0xbcbb('0x9'));var attributes=require(_0xbcbb('0xa'));module[_0xbcbb('0xb')]=function(_0x5d593d,_0xcefac7){return _0x5d593d['define']('SmsAccount',attributes,{'tableName':_0xbcbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 729e1c9..badf903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3f2=['message','result','catch','SmsAccount','options','raw','where','attributes','map','include','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','SmsAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3f2,0x11d));var _0x2d3f=function(_0x4874c2,_0x3ce845){_0x4874c2=_0x4874c2-0x0;var _0x3cdd3e=_0xd3f2[_0x4874c2];return _0x3cdd3e;};'use strict';var _=require(_0x2d3f('0x0'));var util=require(_0x2d3f('0x1'));var moment=require(_0x2d3f('0x2'));var BPromise=require(_0x2d3f('0x3'));var rs=require(_0x2d3f('0x4'));var fs=require('fs');var Redis=require(_0x2d3f('0x5'));var db=require(_0x2d3f('0x6'))['db'];var utils=require(_0x2d3f('0x7'));var logger=require(_0x2d3f('0x8'))(_0x2d3f('0x9'));var config=require(_0x2d3f('0xa'));var jayson=require(_0x2d3f('0xb'));var client=jayson[_0x2d3f('0xc')][_0x2d3f('0xd')]({'port':0x232a});config[_0x2d3f('0xe')]=_[_0x2d3f('0xf')](config[_0x2d3f('0xe')],{'host':_0x2d3f('0x10'),'port':0x18eb});var socket=require(_0x2d3f('0x11'))(new Redis(config[_0x2d3f('0xe')]));require(_0x2d3f('0x12'))[_0x2d3f('0x13')](socket);function respondWithRpcPromise(_0x4d12ae,_0x4a1ebf,_0x628f64){return new BPromise(function(_0x36563e,_0x1a0270){return client[_0x2d3f('0x14')](_0x4d12ae,_0x628f64)[_0x2d3f('0x15')](function(_0x4842bb){logger[_0x2d3f('0x16')](_0x2d3f('0x17'),_0x4a1ebf,_0x2d3f('0x18'));logger['debug'](_0x2d3f('0x19'),_0x4a1ebf,'request\x20sent',JSON['stringify'](_0x4842bb));if(_0x4842bb['error']){if(_0x4842bb[_0x2d3f('0x1a')]['code']===0x1f4){logger[_0x2d3f('0x1a')](_0x2d3f('0x17'),_0x4a1ebf,_0x4842bb[_0x2d3f('0x1a')]['message']);return _0x1a0270(_0x4842bb[_0x2d3f('0x1a')][_0x2d3f('0x1b')]);}logger[_0x2d3f('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x4a1ebf,_0x4842bb[_0x2d3f('0x1a')]['message']);return _0x36563e(_0x4842bb['error']['message']);}else{logger[_0x2d3f('0x16')](_0x2d3f('0x17'),_0x4a1ebf,'request\x20sent');_0x36563e(_0x4842bb[_0x2d3f('0x1c')]['message']);}})[_0x2d3f('0x1d')](function(_0x45df33){logger[_0x2d3f('0x1a')](_0x2d3f('0x17'),_0x4a1ebf,_0x45df33);_0x1a0270(_0x45df33);});});}exports['ShowSmsAccount']=function(_0x459463){var _0x1a323f=this;return new Promise(function(_0x481cfc,_0x38ee7c){return db[_0x2d3f('0x1e')]['find']({'raw':_0x459463[_0x2d3f('0x1f')]?_0x459463[_0x2d3f('0x1f')][_0x2d3f('0x20')]===undefined?!![]:![]:!![],'where':_0x459463['options']?_0x459463[_0x2d3f('0x1f')][_0x2d3f('0x21')]||null:null,'attributes':_0x459463['options']?_0x459463[_0x2d3f('0x1f')][_0x2d3f('0x22')]||null:null,'include':_0x459463[_0x2d3f('0x1f')]?_0x459463[_0x2d3f('0x1f')]['include']?_[_0x2d3f('0x23')](_0x459463[_0x2d3f('0x1f')][_0x2d3f('0x24')],function(_0x45bc59){return{'model':db[_0x45bc59[_0x2d3f('0x25')]],'as':_0x45bc59['as'],'attributes':_0x45bc59[_0x2d3f('0x22')],'include':_0x45bc59[_0x2d3f('0x24')]?_['map'](_0x45bc59[_0x2d3f('0x24')],function(_0x2c7565){return{'model':db[_0x2c7565['model']],'as':_0x2c7565['as'],'attributes':_0x2c7565[_0x2d3f('0x22')],'include':_0x2c7565[_0x2d3f('0x24')]?_[_0x2d3f('0x23')](_0x2c7565[_0x2d3f('0x24')],function(_0x28cc2a){return{'model':db[_0x28cc2a['model']],'as':_0x28cc2a['as'],'attributes':_0x28cc2a[_0x2d3f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2d3f('0x15')](function(_0x14a3f6){logger[_0x2d3f('0x16')](_0x2d3f('0x26'),_0x459463);logger['debug'](_0x2d3f('0x26'),_0x459463,JSON['stringify'](_0x14a3f6));_0x481cfc(_0x14a3f6);})['catch'](function(_0x3a819a){logger[_0x2d3f('0x1a')](_0x2d3f('0x26'),_0x3a819a['message'],_0x459463);_0x38ee7c(_0x1a323f[_0x2d3f('0x1a')](0x1f4,_0x3a819a[_0x2d3f('0x1b')]));});});};
\ No newline at end of file
+var _0xd1e4=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','SmsAccount','find','options','where','attributes','include','map','model','ShowSmsAccount'];(function(_0x37b357,_0x48729a){var _0x4bddef=function(_0x2fe625){while(--_0x2fe625){_0x37b357['push'](_0x37b357['shift']());}};_0x4bddef(++_0x48729a);}(_0xd1e4,0xb0));var _0x4d1e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd1e4[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4d1e('0x0'));var util=require('util');var moment=require(_0x4d1e('0x1'));var BPromise=require(_0x4d1e('0x2'));var rs=require(_0x4d1e('0x3'));var fs=require('fs');var Redis=require(_0x4d1e('0x4'));var db=require(_0x4d1e('0x5'))['db'];var utils=require(_0x4d1e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4d1e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d1e('0x8')]({'port':0x232a});config[_0x4d1e('0x9')]=_[_0x4d1e('0xa')](config[_0x4d1e('0x9')],{'host':_0x4d1e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d1e('0x9')]));require(_0x4d1e('0xc'))[_0x4d1e('0xd')](socket);function respondWithRpcPromise(_0x2a5823,_0x9d1a1f,_0x5d47b9){return new BPromise(function(_0x3967a5,_0x41b114){return client[_0x4d1e('0xe')](_0x2a5823,_0x5d47b9)[_0x4d1e('0xf')](function(_0xec972d){logger[_0x4d1e('0x10')](_0x4d1e('0x11'),_0x9d1a1f,_0x4d1e('0x12'));logger[_0x4d1e('0x13')](_0x4d1e('0x14'),_0x9d1a1f,_0x4d1e('0x12'),JSON['stringify'](_0xec972d));if(_0xec972d[_0x4d1e('0x15')]){if(_0xec972d[_0x4d1e('0x15')][_0x4d1e('0x16')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x9d1a1f,_0xec972d[_0x4d1e('0x15')][_0x4d1e('0x17')]);return _0x41b114(_0xec972d[_0x4d1e('0x15')][_0x4d1e('0x17')]);}logger[_0x4d1e('0x15')]('SmsAccount,\x20%s,\x20%s',_0x9d1a1f,_0xec972d['error'][_0x4d1e('0x17')]);return _0x3967a5(_0xec972d['error'][_0x4d1e('0x17')]);}else{logger[_0x4d1e('0x10')](_0x4d1e('0x11'),_0x9d1a1f,_0x4d1e('0x12'));_0x3967a5(_0xec972d['result'][_0x4d1e('0x17')]);}})[_0x4d1e('0x18')](function(_0x226e26){logger['error'](_0x4d1e('0x11'),_0x9d1a1f,_0x226e26);_0x41b114(_0x226e26);});});}exports['ShowSmsAccount']=function(_0x2a97e2){var _0x4b69e9=this;return new Promise(function(_0x13d9fb,_0x1fad20){return db[_0x4d1e('0x19')][_0x4d1e('0x1a')]({'raw':_0x2a97e2[_0x4d1e('0x1b')]?_0x2a97e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a97e2[_0x4d1e('0x1b')]?_0x2a97e2[_0x4d1e('0x1b')][_0x4d1e('0x1c')]||null:null,'attributes':_0x2a97e2[_0x4d1e('0x1b')]?_0x2a97e2[_0x4d1e('0x1b')][_0x4d1e('0x1d')]||null:null,'include':_0x2a97e2[_0x4d1e('0x1b')]?_0x2a97e2[_0x4d1e('0x1b')][_0x4d1e('0x1e')]?_[_0x4d1e('0x1f')](_0x2a97e2[_0x4d1e('0x1b')][_0x4d1e('0x1e')],function(_0x57ceeb){return{'model':db[_0x57ceeb[_0x4d1e('0x20')]],'as':_0x57ceeb['as'],'attributes':_0x57ceeb[_0x4d1e('0x1d')],'include':_0x57ceeb[_0x4d1e('0x1e')]?_[_0x4d1e('0x1f')](_0x57ceeb[_0x4d1e('0x1e')],function(_0x40d62e){return{'model':db[_0x40d62e[_0x4d1e('0x20')]],'as':_0x40d62e['as'],'attributes':_0x40d62e[_0x4d1e('0x1d')],'include':_0x40d62e[_0x4d1e('0x1e')]?_['map'](_0x40d62e[_0x4d1e('0x1e')],function(_0x10c1ef){return{'model':db[_0x10c1ef[_0x4d1e('0x20')]],'as':_0x10c1ef['as'],'attributes':_0x10c1ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d1e('0xf')](function(_0x3236ab){logger[_0x4d1e('0x10')](_0x4d1e('0x21'),_0x2a97e2);logger['debug'](_0x4d1e('0x21'),_0x2a97e2,JSON[_0x4d1e('0x22')](_0x3236ab));_0x13d9fb(_0x3236ab);})[_0x4d1e('0x18')](function(_0x16594c){logger[_0x4d1e('0x15')]('ShowSmsAccount',_0x16594c[_0x4d1e('0x17')],_0x2a97e2);_0x1fad20(_0x4b69e9['error'](0x1f4,_0x16594c[_0x4d1e('0x17')]));});});};
\ No newline at end of file
index 908b1d0..10bea4c 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 9b4f26e..faa6a5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1dcd38,_0x4199d0){var _0x5743c2=function(_0x26190c){while(--_0x26190c){_0x1dcd38['push'](_0x1dcd38['shift']());}};_0x5743c2(++_0x4199d0);}(_0x34e8,0x12c));var _0x834e=function(_0x4feb87,_0x154495){_0x4feb87=_0x4feb87-0x0;var _0xe856bb=_0x34e8[_0x4feb87];return _0xe856bb;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router;
\ No newline at end of file
+var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x52d552,_0x68f606){var _0x4e0050=function(_0x2e9020){while(--_0x2e9020){_0x52d552['push'](_0x52d552['shift']());}};_0x4e0050(++_0x68f606);}(_0xe14b,0x93));var _0xbe14=function(_0x1f817f,_0x54c8c6){_0x1f817f=_0x1f817f-0x0;var _0xe02e00=_0xe14b[_0x1f817f];return _0xe02e00;};'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['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router;
\ No newline at end of file
index 410999d..fe1e338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5261=['*,*,*,*','sequelize','INTEGER','STRING'];(function(_0xda5f80,_0x1a00f1){var _0x55a924=function(_0xb11352){while(--_0xb11352){_0xda5f80['push'](_0xda5f80['shift']());}};_0x55a924(++_0x1a00f1);}(_0x5261,0xd9));var _0x1526=function(_0x556864,_0x49fb40){_0x556864=_0x556864-0x0;var _0x4795ac=_0x5261[_0x556864];return _0x4795ac;};'use strict';var Sequelize=require(_0x1526('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1526('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1526('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1526('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1526('0x3')}};
\ No newline at end of file
+var _0x6309=['TEXT','STRING','*,*,*,*','INTEGER','noop'];(function(_0x36731f,_0x5f581e){var _0x57ad35=function(_0x29166e){while(--_0x29166e){_0x36731f['push'](_0x36731f['shift']());}};_0x57ad35(++_0x5f581e);}(_0x6309,0x1a2));var _0x9630=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x6309[_0x999b85];return _0x1d7124;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9630('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9630('0x1')},'appdata':{'type':Sequelize[_0x9630('0x2')]()},'description':{'type':Sequelize[_0x9630('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9630('0x4')}};
\ No newline at end of file
index f506e6c..137173f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49b5=['merge','VIRTUAL','options','includeAll','include','SmsApplication','findAll','rows','catch','show','length','find','create','body','params','eml-format','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x324319,_0x42aa09){var _0x4aa9f6=function(_0x51699d){while(--_0x51699d){_0x324319['push'](_0x324319['shift']());}};_0x4aa9f6(++_0x42aa09);}(_0x49b5,0x1bf));var _0x549b=function(_0x67ffbe,_0x12535b){_0x67ffbe=_0x67ffbe-0x0;var _0x42c728=_0x49b5[_0x67ffbe];return _0x42c728;};'use strict';var emlformat=require(_0x549b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x549b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x549b('0x2'));var moment=require(_0x549b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x549b('0x4'));var path=require(_0x549b('0x5'));var sox=require('sox');var csv=require(_0x549b('0x6'));var ejs=require(_0x549b('0x7'));var fs=require('fs');var fs_extra=require(_0x549b('0x8'));var _=require(_0x549b('0x9'));var squel=require(_0x549b('0xa'));var crypto=require(_0x549b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x549b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x549b('0xd'));var Redis=require(_0x549b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x549b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x549b('0x10'));var logger=require(_0x549b('0x11'))('api');var utils=require(_0x549b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x549b('0x13'));var db=require(_0x549b('0x14'))['db'];function respondWithStatusCode(_0x221d80,_0x2612cb){_0x2612cb=_0x2612cb||0xcc;return function(_0x46e0cb){if(_0x46e0cb){return _0x221d80[_0x549b('0x15')](_0x2612cb);}return _0x221d80[_0x549b('0x16')](_0x2612cb)['end']();};}function respondWithResult(_0x501419,_0x441904){_0x441904=_0x441904||0xc8;return function(_0x3bac0c){if(_0x3bac0c){return _0x501419[_0x549b('0x16')](_0x441904)[_0x549b('0x17')](_0x3bac0c);}};}function respondWithFilteredResult(_0x4322f1,_0x2447f2){return function(_0x15b804){if(_0x15b804){var _0x322df9=typeof _0x2447f2['offset']===_0x549b('0x18')&&typeof _0x2447f2[_0x549b('0x19')]===_0x549b('0x18');var _0x49eb13=_0x15b804[_0x549b('0x1a')];var _0x1e1fb2=_0x322df9?0x0:_0x2447f2['offset'];var _0x26d3e0=_0x322df9?_0x15b804[_0x549b('0x1a')]:_0x2447f2[_0x549b('0x1b')]+_0x2447f2['limit'];var _0x4ff39f;if(_0x26d3e0>=_0x49eb13){_0x26d3e0=_0x49eb13;_0x4ff39f=0xc8;}else{_0x4ff39f=0xce;}_0x4322f1[_0x549b('0x16')](_0x4ff39f);return _0x4322f1[_0x549b('0x1c')]('Content-Range',_0x1e1fb2+'-'+_0x26d3e0+'/'+_0x49eb13)[_0x549b('0x17')](_0x15b804);}return null;};}function patchUpdates(_0x3f9d1f){return function(_0x12745f){try{jsonpatch[_0x549b('0x1d')](_0x12745f,_0x3f9d1f,!![]);}catch(_0x3a51c9){return BPromise[_0x549b('0x1e')](_0x3a51c9);}return _0x12745f[_0x549b('0x1f')]();};}function saveUpdates(_0x164ba9,_0x51b4d7){return function(_0x49366b){if(_0x49366b){return _0x49366b[_0x549b('0x20')](_0x164ba9)['then'](function(_0x4bf5a5){return _0x4bf5a5;});}return null;};}function removeEntity(_0x1558b4,_0x3e2ff4){return function(_0x144b47){if(_0x144b47){return _0x144b47[_0x549b('0x21')]()[_0x549b('0x22')](function(){_0x1558b4[_0x549b('0x16')](0xcc)[_0x549b('0x23')]();});}};}function handleEntityNotFound(_0xbbe50c,_0x319e60){return function(_0x27efdd){if(!_0x27efdd){_0xbbe50c[_0x549b('0x15')](0x194);}return _0x27efdd;};}function handleError(_0x4b43cf,_0x418e11){_0x418e11=_0x418e11||0x1f4;return function(_0x54de7b){logger['error'](_0x54de7b[_0x549b('0x24')]);if(_0x54de7b[_0x549b('0x25')]){delete _0x54de7b['name'];}_0x4b43cf[_0x549b('0x16')](_0x418e11)[_0x549b('0x26')](_0x54de7b);};}exports[_0x549b('0x27')]=function(_0x4fec88,_0x459574){var _0xb77ceb={},_0x3ef2ac={},_0xdf582d={'count':0x0,'rows':[]};var _0x3976f6=_[_0x549b('0x28')](db['SmsApplication'][_0x549b('0x29')],function(_0x3efbef){return{'name':_0x3efbef[_0x549b('0x2a')],'type':_0x3efbef[_0x549b('0x2b')][_0x549b('0x2c')]};});_0x3ef2ac[_0x549b('0x2d')]=_['map'](_0x3976f6,_0x549b('0x25'));_0x3ef2ac['query']=_[_0x549b('0x2e')](_0x4fec88[_0x549b('0x2f')]);_0x3ef2ac[_0x549b('0x30')]=_[_0x549b('0x31')](_0x3ef2ac[_0x549b('0x2d')],_0x3ef2ac[_0x549b('0x2f')]);_0xb77ceb[_0x549b('0x32')]=_[_0x549b('0x31')](_0x3ef2ac['model'],qs[_0x549b('0x33')](_0x4fec88['query'][_0x549b('0x33')]));_0xb77ceb[_0x549b('0x32')]=_0xb77ceb[_0x549b('0x32')]['length']?_0xb77ceb[_0x549b('0x32')]:_0x3ef2ac[_0x549b('0x2d')];if(!_0x4fec88['query']['hasOwnProperty'](_0x549b('0x34'))){_0xb77ceb['limit']=qs['limit'](_0x4fec88[_0x549b('0x2f')][_0x549b('0x19')]);_0xb77ceb[_0x549b('0x1b')]=qs[_0x549b('0x1b')](_0x4fec88[_0x549b('0x2f')][_0x549b('0x1b')]);}_0xb77ceb[_0x549b('0x35')]=qs[_0x549b('0x36')](_0x4fec88['query'][_0x549b('0x36')]);_0xb77ceb[_0x549b('0x37')]=qs[_0x549b('0x30')](_[_0x549b('0x38')](_0x4fec88[_0x549b('0x2f')],_0x3ef2ac[_0x549b('0x30')]),_0x3976f6);if(_0x4fec88[_0x549b('0x2f')]['filter']){_0xb77ceb[_0x549b('0x37')]=_[_0x549b('0x39')](_0xb77ceb[_0x549b('0x37')],{'$or':_[_0x549b('0x28')](_0x3976f6,function(_0x29cb0d){if(_0x29cb0d['type']!==_0x549b('0x3a')){var _0x4c0980={};_0x4c0980[_0x29cb0d['name']]={'$like':'%'+_0x4fec88['query']['filter']+'%'};return _0x4c0980;}})});}_0xb77ceb=_[_0x549b('0x39')]({},_0xb77ceb,_0x4fec88[_0x549b('0x3b')]);var _0x237d43={'where':_0xb77ceb[_0x549b('0x37')]};return db['SmsApplication']['count'](_0x237d43)['then'](function(_0xdd5190){_0xdf582d['count']=_0xdd5190;if(_0x4fec88[_0x549b('0x2f')][_0x549b('0x3c')]){_0xb77ceb[_0x549b('0x3d')]=[{'all':!![]}];}return db[_0x549b('0x3e')][_0x549b('0x3f')](_0xb77ceb);})[_0x549b('0x22')](function(_0x5e049b){_0xdf582d[_0x549b('0x40')]=_0x5e049b;return _0xdf582d;})['then'](respondWithFilteredResult(_0x459574,_0xb77ceb))[_0x549b('0x41')](handleError(_0x459574,null));};exports[_0x549b('0x42')]=function(_0x5ec499,_0x3c2832){var _0x48315f={'raw':!![],'where':{'id':_0x5ec499['params']['id']}},_0x670af1={};_0x670af1[_0x549b('0x2d')]=_[_0x549b('0x2e')](db['SmsApplication'][_0x549b('0x29')]);_0x670af1[_0x549b('0x2f')]=_['keys'](_0x5ec499[_0x549b('0x2f')]);_0x670af1[_0x549b('0x30')]=_[_0x549b('0x31')](_0x670af1['model'],_0x670af1[_0x549b('0x2f')]);_0x48315f[_0x549b('0x32')]=_[_0x549b('0x31')](_0x670af1[_0x549b('0x2d')],qs[_0x549b('0x33')](_0x5ec499['query'][_0x549b('0x33')]));_0x48315f[_0x549b('0x32')]=_0x48315f[_0x549b('0x32')][_0x549b('0x43')]?_0x48315f[_0x549b('0x32')]:_0x670af1[_0x549b('0x2d')];if(_0x5ec499[_0x549b('0x2f')][_0x549b('0x3c')]){_0x48315f[_0x549b('0x3d')]=[{'all':!![]}];}_0x48315f=_['merge']({},_0x48315f,_0x5ec499['options']);return db[_0x549b('0x3e')][_0x549b('0x44')](_0x48315f)['then'](handleEntityNotFound(_0x3c2832,null))[_0x549b('0x22')](respondWithResult(_0x3c2832,null))[_0x549b('0x41')](handleError(_0x3c2832,null));};exports['create']=function(_0x34ad05,_0x48df8f){return db[_0x549b('0x3e')][_0x549b('0x45')](_0x34ad05[_0x549b('0x46')],{})['then'](respondWithResult(_0x48df8f,0xc9))['catch'](handleError(_0x48df8f,null));};exports[_0x549b('0x20')]=function(_0x336ec6,_0x328b2f){if(_0x336ec6['body']['id']){delete _0x336ec6[_0x549b('0x46')]['id'];}return db[_0x549b('0x3e')]['find']({'where':{'id':_0x336ec6[_0x549b('0x47')]['id']}})[_0x549b('0x22')](handleEntityNotFound(_0x328b2f,null))[_0x549b('0x22')](saveUpdates(_0x336ec6[_0x549b('0x46')],null))[_0x549b('0x22')](respondWithResult(_0x328b2f,null))[_0x549b('0x41')](handleError(_0x328b2f,null));};exports[_0x549b('0x21')]=function(_0x1210fd,_0x136883){return db['SmsApplication'][_0x549b('0x44')]({'where':{'id':_0x1210fd['params']['id']}})[_0x549b('0x22')](handleEntityNotFound(_0x136883,null))['then'](removeEntity(_0x136883,null))[_0x549b('0x41')](handleError(_0x136883,null));};
\ No newline at end of file
+var _0x9606=['includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x9606,0x1c0));var _0x6960=function(_0x314d26,_0xbac058){_0x314d26=_0x314d26-0x0;var _0x14e169=_0x9606[_0x314d26];return _0x14e169;};'use strict';var emlformat=require(_0x6960('0x0'));var rimraf=require(_0x6960('0x1'));var zipdir=require(_0x6960('0x2'));var jsonpatch=require(_0x6960('0x3'));var rp=require(_0x6960('0x4'));var moment=require(_0x6960('0x5'));var BPromise=require(_0x6960('0x6'));var Mustache=require(_0x6960('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6960('0x8'));var fs=require('fs');var fs_extra=require(_0x6960('0x9'));var _=require(_0x6960('0xa'));var squel=require(_0x6960('0xb'));var crypto=require(_0x6960('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6960('0xd'));var toCsv=require(_0x6960('0xe'));var querystring=require(_0x6960('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6960('0x10'));var as=require(_0x6960('0x11'));var hardwareService=require(_0x6960('0x12'));var logger=require('../../config/logger')(_0x6960('0x13'));var utils=require(_0x6960('0x14'));var config=require(_0x6960('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33eb65,_0x2febdb){_0x2febdb=_0x2febdb||0xcc;return function(_0x46c3d2){if(_0x46c3d2){return _0x33eb65['sendStatus'](_0x2febdb);}return _0x33eb65[_0x6960('0x16')](_0x2febdb)[_0x6960('0x17')]();};}function respondWithResult(_0x49b8c9,_0xdd0714){_0xdd0714=_0xdd0714||0xc8;return function(_0x1c49c9){if(_0x1c49c9){return _0x49b8c9[_0x6960('0x16')](_0xdd0714)[_0x6960('0x18')](_0x1c49c9);}};}function respondWithFilteredResult(_0x265057,_0x3eecf7){return function(_0x4665f6){if(_0x4665f6){var _0x2e0b8d=typeof _0x3eecf7[_0x6960('0x19')]===_0x6960('0x1a')&&typeof _0x3eecf7[_0x6960('0x1b')]===_0x6960('0x1a');var _0x484a7a=_0x4665f6[_0x6960('0x1c')];var _0x33d467=_0x2e0b8d?0x0:_0x3eecf7[_0x6960('0x19')];var _0x42a266=_0x2e0b8d?_0x4665f6[_0x6960('0x1c')]:_0x3eecf7[_0x6960('0x19')]+_0x3eecf7[_0x6960('0x1b')];var _0x36d0fd;if(_0x42a266>=_0x484a7a){_0x42a266=_0x484a7a;_0x36d0fd=0xc8;}else{_0x36d0fd=0xce;}_0x265057['status'](_0x36d0fd);return _0x265057[_0x6960('0x1d')]('Content-Range',_0x33d467+'-'+_0x42a266+'/'+_0x484a7a)[_0x6960('0x18')](_0x4665f6);}return null;};}function patchUpdates(_0x2facc0){return function(_0x5f1c01){try{jsonpatch['apply'](_0x5f1c01,_0x2facc0,!![]);}catch(_0x13d427){return BPromise[_0x6960('0x1e')](_0x13d427);}return _0x5f1c01[_0x6960('0x1f')]();};}function saveUpdates(_0x23e691,_0x3c53a3){return function(_0x20fd5a){if(_0x20fd5a){return _0x20fd5a[_0x6960('0x20')](_0x23e691)['then'](function(_0x39fbbf){return _0x39fbbf;});}return null;};}function removeEntity(_0x4768d4,_0x10aa7a){return function(_0x28a54e){if(_0x28a54e){return _0x28a54e[_0x6960('0x21')]()[_0x6960('0x22')](function(){_0x4768d4[_0x6960('0x16')](0xcc)[_0x6960('0x17')]();});}};}function handleEntityNotFound(_0x4426f6,_0x358a1e){return function(_0x3858a2){if(!_0x3858a2){_0x4426f6['sendStatus'](0x194);}return _0x3858a2;};}function handleError(_0x31ef26,_0x5e0b39){_0x5e0b39=_0x5e0b39||0x1f4;return function(_0x278eab){logger[_0x6960('0x23')](_0x278eab[_0x6960('0x24')]);if(_0x278eab[_0x6960('0x25')]){delete _0x278eab[_0x6960('0x25')];}_0x31ef26[_0x6960('0x16')](_0x5e0b39)[_0x6960('0x26')](_0x278eab);};}exports[_0x6960('0x27')]=function(_0x36950a,_0x1b2274){var _0x209311={},_0x433a07={},_0x53a386={'count':0x0,'rows':[]};var _0x18fbf8=_[_0x6960('0x28')](db[_0x6960('0x29')][_0x6960('0x2a')],function(_0xe83e43){return{'name':_0xe83e43[_0x6960('0x2b')],'type':_0xe83e43[_0x6960('0x2c')]['key']};});_0x433a07[_0x6960('0x2d')]=_['map'](_0x18fbf8,_0x6960('0x25'));_0x433a07[_0x6960('0x2e')]=_[_0x6960('0x2f')](_0x36950a['query']);_0x433a07[_0x6960('0x30')]=_[_0x6960('0x31')](_0x433a07[_0x6960('0x2d')],_0x433a07['query']);_0x209311['attributes']=_[_0x6960('0x31')](_0x433a07[_0x6960('0x2d')],qs[_0x6960('0x32')](_0x36950a['query'][_0x6960('0x32')]));_0x209311[_0x6960('0x33')]=_0x209311[_0x6960('0x33')][_0x6960('0x34')]?_0x209311[_0x6960('0x33')]:_0x433a07[_0x6960('0x2d')];if(!_0x36950a[_0x6960('0x2e')][_0x6960('0x35')](_0x6960('0x36'))){_0x209311[_0x6960('0x1b')]=qs[_0x6960('0x1b')](_0x36950a['query'][_0x6960('0x1b')]);_0x209311[_0x6960('0x19')]=qs[_0x6960('0x19')](_0x36950a[_0x6960('0x2e')][_0x6960('0x19')]);}_0x209311[_0x6960('0x37')]=qs['sort'](_0x36950a['query'][_0x6960('0x38')]);_0x209311[_0x6960('0x39')]=qs['filters'](_[_0x6960('0x3a')](_0x36950a[_0x6960('0x2e')],_0x433a07[_0x6960('0x30')]),_0x18fbf8);if(_0x36950a[_0x6960('0x2e')][_0x6960('0x3b')]){_0x209311[_0x6960('0x39')]=_[_0x6960('0x3c')](_0x209311[_0x6960('0x39')],{'$or':_[_0x6960('0x28')](_0x18fbf8,function(_0x4d031a){if(_0x4d031a[_0x6960('0x2c')]!==_0x6960('0x3d')){var _0x5ec744={};_0x5ec744[_0x4d031a[_0x6960('0x25')]]={'$like':'%'+_0x36950a[_0x6960('0x2e')][_0x6960('0x3b')]+'%'};return _0x5ec744;}})});}_0x209311=_['merge']({},_0x209311,_0x36950a[_0x6960('0x3e')]);var _0x34cf6e={'where':_0x209311[_0x6960('0x39')]};return db[_0x6960('0x29')][_0x6960('0x1c')](_0x34cf6e)[_0x6960('0x22')](function(_0x1bf3f8){_0x53a386[_0x6960('0x1c')]=_0x1bf3f8;if(_0x36950a[_0x6960('0x2e')][_0x6960('0x3f')]){_0x209311[_0x6960('0x40')]=[{'all':!![]}];}return db[_0x6960('0x29')][_0x6960('0x41')](_0x209311);})[_0x6960('0x22')](function(_0x4f4994){_0x53a386[_0x6960('0x42')]=_0x4f4994;return _0x53a386;})['then'](respondWithFilteredResult(_0x1b2274,_0x209311))[_0x6960('0x43')](handleError(_0x1b2274,null));};exports[_0x6960('0x44')]=function(_0x3b3149,_0x550906){var _0x118fc6={'raw':!![],'where':{'id':_0x3b3149['params']['id']}},_0x3d63b4={};_0x3d63b4[_0x6960('0x2d')]=_[_0x6960('0x2f')](db[_0x6960('0x29')][_0x6960('0x2a')]);_0x3d63b4['query']=_[_0x6960('0x2f')](_0x3b3149[_0x6960('0x2e')]);_0x3d63b4[_0x6960('0x30')]=_['intersection'](_0x3d63b4[_0x6960('0x2d')],_0x3d63b4[_0x6960('0x2e')]);_0x118fc6[_0x6960('0x33')]=_[_0x6960('0x31')](_0x3d63b4['model'],qs[_0x6960('0x32')](_0x3b3149['query']['fields']));_0x118fc6[_0x6960('0x33')]=_0x118fc6['attributes']['length']?_0x118fc6[_0x6960('0x33')]:_0x3d63b4[_0x6960('0x2d')];if(_0x3b3149[_0x6960('0x2e')][_0x6960('0x3f')]){_0x118fc6[_0x6960('0x40')]=[{'all':!![]}];}_0x118fc6=_['merge']({},_0x118fc6,_0x3b3149[_0x6960('0x3e')]);return db[_0x6960('0x29')][_0x6960('0x45')](_0x118fc6)[_0x6960('0x22')](handleEntityNotFound(_0x550906,null))['then'](respondWithResult(_0x550906,null))[_0x6960('0x43')](handleError(_0x550906,null));};exports['create']=function(_0xe07c59,_0x5c6d16){return db[_0x6960('0x29')][_0x6960('0x46')](_0xe07c59[_0x6960('0x47')],{})['then'](respondWithResult(_0x5c6d16,0xc9))[_0x6960('0x43')](handleError(_0x5c6d16,null));};exports['update']=function(_0x6cb660,_0x5cd92f){if(_0x6cb660[_0x6960('0x47')]['id']){delete _0x6cb660[_0x6960('0x47')]['id'];}return db['SmsApplication'][_0x6960('0x45')]({'where':{'id':_0x6cb660[_0x6960('0x48')]['id']}})[_0x6960('0x22')](handleEntityNotFound(_0x5cd92f,null))[_0x6960('0x22')](saveUpdates(_0x6cb660[_0x6960('0x47')],null))['then'](respondWithResult(_0x5cd92f,null))['catch'](handleError(_0x5cd92f,null));};exports[_0x6960('0x21')]=function(_0x2073af,_0x5ccb01){return db[_0x6960('0x29')]['find']({'where':{'id':_0x2073af['params']['id']}})[_0x6960('0x22')](handleEntityNotFound(_0x5ccb01,null))['then'](removeEntity(_0x5ccb01,null))[_0x6960('0x43')](handleError(_0x5ccb01,null));};
\ No newline at end of file
index bc0691a..7d5ec53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefbd=['api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xefbd,0x15a));var _0xdefb=function(_0x3f8e50,_0x4404f8){_0x3f8e50=_0x3f8e50-0x0;var _0x176dd7=_0xefbd[_0x3f8e50];return _0x176dd7;};'use strict';var _=require(_0xdefb('0x0'));var util=require(_0xdefb('0x1'));var logger=require('../../config/logger')(_0xdefb('0x2'));var moment=require('moment');var BPromise=require(_0xdefb('0x3'));var rp=require(_0xdefb('0x4'));var fs=require('fs');var path=require(_0xdefb('0x5'));var rimraf=require(_0xdefb('0x6'));var config=require(_0xdefb('0x7'));var attributes=require(_0xdefb('0x8'));module['exports']=function(_0x1e3d1c,_0x2adbc3){return _0x1e3d1c['define'](_0xdefb('0x9'),attributes,{'tableName':_0xdefb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdefb('0xb')});};
\ No newline at end of file
+var _0x85da=['bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x311dd8,_0x48f5b7){var _0x2db58b=function(_0x44136c){while(--_0x44136c){_0x311dd8['push'](_0x311dd8['shift']());}};_0x2db58b(++_0x48f5b7);}(_0x85da,0x1ae));var _0xa85d=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x85da[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xa85d('0x0'));var util=require('util');var logger=require(_0xa85d('0x1'))(_0xa85d('0x2'));var moment=require(_0xa85d('0x3'));var BPromise=require(_0xa85d('0x4'));var rp=require(_0xa85d('0x5'));var fs=require('fs');var path=require(_0xa85d('0x6'));var rimraf=require(_0xa85d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa85d('0x8'));module[_0xa85d('0x9')]=function(_0x11def0,_0x2ab9b7){return _0x11def0[_0xa85d('0xa')](_0xa85d('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa85d('0xc'),'collate':_0xa85d('0xd')});};
\ No newline at end of file
index 68ad2cf..37d94d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x964b=['../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x191291,_0x5d6177){var _0x809cba=function(_0x5a55f3){while(--_0x5a55f3){_0x191291['push'](_0x191291['shift']());}};_0x809cba(++_0x5d6177);}(_0x964b,0x112));var _0xb964=function(_0x4efc72,_0xbe5033){_0x4efc72=_0x4efc72-0x0;var _0x3479eb=_0x964b[_0x4efc72];return _0x3479eb;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x204c7d,_0xde47d5,_0x3fe401){return new BPromise(function(_0x53b463,_0x58e49e){return client[_0xb964('0xa')](_0x204c7d,_0x3fe401)['then'](function(_0x55e697){logger[_0xb964('0xb')](_0xb964('0xc'),_0xde47d5,_0xb964('0xd'));logger[_0xb964('0xe')](_0xb964('0xf'),_0xde47d5,_0xb964('0xd'),JSON['stringify'](_0x55e697));if(_0x55e697[_0xb964('0x10')]){if(_0x55e697[_0xb964('0x10')][_0xb964('0x11')]===0x1f4){logger[_0xb964('0x10')]('SmsApplication,\x20%s,\x20%s',_0xde47d5,_0x55e697[_0xb964('0x10')]['message']);return _0x58e49e(_0x55e697['error'][_0xb964('0x12')]);}logger[_0xb964('0x10')](_0xb964('0xc'),_0xde47d5,_0x55e697[_0xb964('0x10')][_0xb964('0x12')]);return _0x53b463(_0x55e697[_0xb964('0x10')][_0xb964('0x12')]);}else{logger['info'](_0xb964('0xc'),_0xde47d5,'request\x20sent');_0x53b463(_0x55e697['result'][_0xb964('0x12')]);}})[_0xb964('0x13')](function(_0x26aa2c){logger[_0xb964('0x10')](_0xb964('0xc'),_0xde47d5,_0x26aa2c);_0x58e49e(_0x26aa2c);});});}
\ No newline at end of file
+var _0xcd4d=['http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xcd4d,0xe4));var _0xdcd4=function(_0x57d1d6,_0xf2230c){_0x57d1d6=_0x57d1d6-0x0;var _0xdb31fb=_0xcd4d[_0x57d1d6];return _0xdb31fb;};'use strict';var _=require(_0xdcd4('0x0'));var util=require(_0xdcd4('0x1'));var moment=require('moment');var BPromise=require(_0xdcd4('0x2'));var rs=require(_0xdcd4('0x3'));var fs=require('fs');var Redis=require(_0xdcd4('0x4'));var db=require(_0xdcd4('0x5'))['db'];var utils=require(_0xdcd4('0x6'));var logger=require(_0xdcd4('0x7'))(_0xdcd4('0x8'));var config=require(_0xdcd4('0x9'));var jayson=require(_0xdcd4('0xa'));var client=jayson[_0xdcd4('0xb')][_0xdcd4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x302b60,_0x5b57f6,_0x17f848){return new BPromise(function(_0x198d6c,_0xc0cf59){return client['request'](_0x302b60,_0x17f848)[_0xdcd4('0xd')](function(_0x3cae6d){logger['info'](_0xdcd4('0xe'),_0x5b57f6,_0xdcd4('0xf'));logger[_0xdcd4('0x10')](_0xdcd4('0x11'),_0x5b57f6,_0xdcd4('0xf'),JSON['stringify'](_0x3cae6d));if(_0x3cae6d[_0xdcd4('0x12')]){if(_0x3cae6d[_0xdcd4('0x12')][_0xdcd4('0x13')]===0x1f4){logger[_0xdcd4('0x12')](_0xdcd4('0xe'),_0x5b57f6,_0x3cae6d['error'][_0xdcd4('0x14')]);return _0xc0cf59(_0x3cae6d[_0xdcd4('0x12')]['message']);}logger[_0xdcd4('0x12')](_0xdcd4('0xe'),_0x5b57f6,_0x3cae6d['error']['message']);return _0x198d6c(_0x3cae6d[_0xdcd4('0x12')][_0xdcd4('0x14')]);}else{logger[_0xdcd4('0x15')](_0xdcd4('0xe'),_0x5b57f6,_0xdcd4('0xf'));_0x198d6c(_0x3cae6d[_0xdcd4('0x16')][_0xdcd4('0x14')]);}})[_0xdcd4('0x17')](function(_0xf57175){logger[_0xdcd4('0x12')](_0xdcd4('0xe'),_0x5b57f6,_0xf57175);_0xc0cf59(_0xf57175);});});}
\ No newline at end of file
index f786081..c11c3f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','sms','addTags','put','tracked','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','express'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x4ee059,_0x206a5e){_0x4ee059=_0x4ee059-0x0;var _0x57b5f4=_0xdd4f[_0x4ee059];return _0x57b5f4;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./smsInteraction.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['get'](_0xfdd4('0xb'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xc')]);router['get'](_0xfdd4('0xd'),auth['isAuthenticated'](),controller[_0xfdd4('0xe')]);router[_0xfdd4('0x6')](_0xfdd4('0xf'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x10')]);router[_0xfdd4('0x11')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x12')]);router[_0xfdd4('0x11')](_0xfdd4('0xd'),auth[_0xfdd4('0x7')](),controller['addMessage']);router[_0xfdd4('0x11')](_0xfdd4('0x13'),auth[_0xfdd4('0x7')](),interaction['tracked'](_0xfdd4('0x14'),'smsinteraction:addtags'),controller[_0xfdd4('0x15')]);router[_0xfdd4('0x16')](_0xfdd4('0xb'),auth[_0xfdd4('0x7')](),interaction[_0xfdd4('0x17')]('sms','smsinteraction:update'),controller['update']);router[_0xfdd4('0x18')](_0xfdd4('0xb'),auth[_0xfdd4('0x7')](),interaction[_0xfdd4('0x17')](_0xfdd4('0x14'),_0xfdd4('0x19')),controller[_0xfdd4('0x1a')]);router[_0xfdd4('0x18')](_0xfdd4('0x13'),auth['isAuthenticated'](),controller[_0xfdd4('0x1b')]);module[_0xfdd4('0x1c')]=router;
\ No newline at end of file
+var _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x18e829,_0x5e4051){var _0x892b0c=function(_0x2098eb){while(--_0x2098eb){_0x18e829['push'](_0x18e829['shift']());}};_0x892b0c(++_0x5e4051);}(_0x3c81,0x102));var _0x13c8=function(_0x5cf717,_0x1652fd){_0x5cf717=_0x5cf717-0x0;var _0x50da04=_0x3c81[_0x5cf717];return _0x50da04;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router;
\ No newline at end of file
index 52b697c..e65443d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1501=['moment','exports','BOOLEAN','STRING','DATE','out','ENUM'];(function(_0x4e2d37,_0x2c3baa){var _0x6bce8b=function(_0x585bc2){while(--_0x585bc2){_0x4e2d37['push'](_0x4e2d37['shift']());}};_0x6bce8b(++_0x2c3baa);}(_0x1501,0x126));var _0x1150=function(_0x57aeed,_0x26c4bc){_0x57aeed=_0x57aeed-0x0;var _0x6cff87=_0x1501[_0x57aeed];return _0x6cff87;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1150('0x0'));module[_0x1150('0x1')]={'closed':{'type':Sequelize[_0x1150('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1150('0x3')]},'secondDisposition':{'type':Sequelize[_0x1150('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1150('0x3')]},'note':{'type':Sequelize[_0x1150('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1150('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1150('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1150('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1150('0x6')]('in',_0x1150('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1150('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x23f4=['DATE','STRING','ENUM','out','moment'];(function(_0x4d2f9b,_0x46b6a7){var _0x5d4a2d=function(_0x3a4a48){while(--_0x3a4a48){_0x4d2f9b['push'](_0x4d2f9b['shift']());}};_0x5d4a2d(++_0x46b6a7);}(_0x23f4,0x1ee));var _0x423f=function(_0x4a826e,_0x195794){_0x4a826e=_0x4a826e-0x0;var _0x1e3dbf=_0x23f4[_0x4a826e];return _0x1e3dbf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x423f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x423f('0x1')]},'disposition':{'type':Sequelize[_0x423f('0x2')]},'secondDisposition':{'type':Sequelize[_0x423f('0x2')]},'thirdDisposition':{'type':Sequelize[_0x423f('0x2')]},'note':{'type':Sequelize[_0x423f('0x2')]},'phone':{'type':Sequelize[_0x423f('0x2')]},'read1stAt':{'type':Sequelize[_0x423f('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x423f('0x3')]('in',_0x423f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x423f('0x3')]('in',_0x423f('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index fd7746b..6818a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ccf=['transcript-','.pdf','log','err','unlinkSync','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','fieldName','type','key','findAll','sms','query','user','catch','show','model','keys','SmsInteraction','rawAttributes','intersection','fields','attributes','length','include','merge','options','create','body','find','params','describe','addMessage','SmsMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','Messages','createdAt','read','SmsAccount','Account','Owner','fullname','get','Sms','N.A.','closed','closedAt','disposition','direction','out','System','lastName','secret','value','renderFile','views','downloadInteraction.ejs'];(function(_0x17e492,_0x2c17c5){var _0x3a99d3=function(_0xbc964f){while(--_0xbc964f){_0x17e492['push'](_0x17e492['shift']());}};_0x3a99d3(++_0x2c17c5);}(_0x4ccf,0xff));var _0xf4cc=function(_0x1477de,_0x3e444d){_0x1477de=_0x1477de-0x0;var _0x5d9813=_0x4ccf[_0x1477de];return _0x5d9813;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xf4cc('0x0'));var BPromise=require(_0xf4cc('0x1'));var util=require('util');var path=require(_0xf4cc('0x2'));var ejs=require(_0xf4cc('0x3'));var fs=require('fs');var _=require(_0xf4cc('0x4'));var Redis=require(_0xf4cc('0x5'));var interaction=require(_0xf4cc('0x6'));var qs=require(_0xf4cc('0x7'));var pdf=require(_0xf4cc('0x8'));var logger=require(_0xf4cc('0x9'))('api');var config=require('../../config/environment');var db=require(_0xf4cc('0xa'))['db'];config[_0xf4cc('0xb')]=_[_0xf4cc('0xc')](config[_0xf4cc('0xb')],{'host':_0xf4cc('0xd'),'port':0x18eb});var socket=require(_0xf4cc('0xe'))(new Redis(config[_0xf4cc('0xb')]));require(_0xf4cc('0xf'))[_0xf4cc('0x10')](socket);function respondWithStatusCode(_0x32a472,_0x3791d4){_0x3791d4=_0x3791d4||0xcc;return function(_0x2e961f){if(_0x2e961f){return _0x32a472['sendStatus'](_0x3791d4);}return _0x32a472[_0xf4cc('0x11')](_0x3791d4)['end']();};}function respondWithResult(_0x1bbbea,_0x3fae01){_0x3fae01=_0x3fae01||0xc8;return function(_0x284cc8){if(_0x284cc8){return _0x1bbbea[_0xf4cc('0x11')](_0x3fae01)[_0xf4cc('0x12')](_0x284cc8);}};}function respondWithFilteredResult(_0x1ae20c,_0x131e2d){return function(_0x410604){if(_0x410604){var _0x562bba=typeof _0x131e2d[_0xf4cc('0x13')]===_0xf4cc('0x14')&&typeof _0x131e2d[_0xf4cc('0x15')]===_0xf4cc('0x14');var _0x4dd694=_0x410604[_0xf4cc('0x16')];var _0x47fd43=_0x562bba?0x0:_0x131e2d[_0xf4cc('0x13')];var _0x2e0101=_0x562bba?_0x410604['count']:_0x131e2d[_0xf4cc('0x13')]+_0x131e2d[_0xf4cc('0x15')];var _0x4bf631;if(_0x2e0101>=_0x4dd694){_0x2e0101=_0x4dd694;_0x4bf631=0xc8;}else{_0x4bf631=0xce;}_0x1ae20c['status'](_0x4bf631);return _0x1ae20c[_0xf4cc('0x17')]('Content-Range',_0x47fd43+'-'+_0x2e0101+'/'+_0x4dd694)['json'](_0x410604);}return null;};}function saveUpdates(_0x3ef475){return function(_0x4c404a){if(_0x4c404a){return _0x4c404a[_0xf4cc('0x18')](_0x3ef475)[_0xf4cc('0x19')](function(_0x3d0924){return _0x3d0924;});}return null;};}function removeEntity(_0x4ec7a7){return function(_0x27f676){if(_0x27f676){return _0x27f676[_0xf4cc('0x1a')]()[_0xf4cc('0x19')](function(){_0x4ec7a7[_0xf4cc('0x11')](0xcc)[_0xf4cc('0x1b')]();});}};}function handleEntityNotFound(_0x2db8ed){return function(_0x5aaf4b){if(!_0x5aaf4b){_0x2db8ed[_0xf4cc('0x1c')](0x194);}return _0x5aaf4b;};}function handleError(_0x13694b,_0x13c349){_0x13c349=_0x13c349||0x1f4;return function(_0x3e2032){logger[_0xf4cc('0x1d')](_0x3e2032[_0xf4cc('0x1e')]);if(_0x3e2032[_0xf4cc('0x1f')]){delete _0x3e2032[_0xf4cc('0x1f')];}_0x13694b[_0xf4cc('0x11')](_0x13c349)[_0xf4cc('0x20')](_0x3e2032);};}exports[_0xf4cc('0x21')]=function(_0x1634ce,_0x23ca95){var _0x27f335={};var _0x1b9bcb=_[_0xf4cc('0x22')](db['SmsInteraction']['rawAttributes'],function(_0xaeef91){return{'name':_0xaeef91[_0xf4cc('0x23')],'type':_0xaeef91[_0xf4cc('0x24')][_0xf4cc('0x25')]};});_0x27f335=qs['getOptions'](_0x1b9bcb,_0x1634ce);return interaction[_0xf4cc('0x26')](_0xf4cc('0x27'),_0x1634ce[_0xf4cc('0x28')],_0x1634ce[_0xf4cc('0x29')],_0x27f335,_0x1b9bcb)[_0xf4cc('0x19')](respondWithFilteredResult(_0x23ca95,_0x27f335))[_0xf4cc('0x2a')](handleError(_0x23ca95,null));};exports[_0xf4cc('0x2b')]=function(_0xa2be8e,_0x3ec1e4){var _0x22edfe={'raw':![],'where':{'id':_0xa2be8e['params']['id']}},_0x5b5887={};_0x5b5887[_0xf4cc('0x2c')]=_[_0xf4cc('0x2d')](db[_0xf4cc('0x2e')][_0xf4cc('0x2f')]);_0x5b5887[_0xf4cc('0x28')]=_['keys'](_0xa2be8e[_0xf4cc('0x28')]);_0x5b5887['filters']=_[_0xf4cc('0x30')](_0x5b5887['model'],_0x5b5887['query']);_0x22edfe['attributes']=_[_0xf4cc('0x30')](_0x5b5887['model'],qs['fields'](_0xa2be8e['query'][_0xf4cc('0x31')]));_0x22edfe[_0xf4cc('0x32')]=_0x22edfe[_0xf4cc('0x32')][_0xf4cc('0x33')]?_0x22edfe[_0xf4cc('0x32')]:_0x5b5887[_0xf4cc('0x2c')];if(_0xa2be8e[_0xf4cc('0x28')]['includeAll']){_0x22edfe[_0xf4cc('0x34')]=[{'all':!![]}];}_0x22edfe=_[_0xf4cc('0x35')]({},_0x22edfe,_0xa2be8e[_0xf4cc('0x36')]);return db[_0xf4cc('0x2e')]['find'](_0x22edfe)['then'](handleEntityNotFound(_0x3ec1e4,null))['then'](respondWithResult(_0x3ec1e4,null))[_0xf4cc('0x2a')](handleError(_0x3ec1e4,null));};exports[_0xf4cc('0x37')]=function(_0x4abcf,_0x14e7a9){return db[_0xf4cc('0x2e')][_0xf4cc('0x37')](_0x4abcf[_0xf4cc('0x38')],{})[_0xf4cc('0x19')](respondWithResult(_0x14e7a9,0xc9))[_0xf4cc('0x2a')](handleError(_0x14e7a9,null));};exports['update']=function(_0x1343b6,_0x488960){if(_0x1343b6[_0xf4cc('0x38')]['id']){delete _0x1343b6[_0xf4cc('0x38')]['id'];}return db['SmsInteraction'][_0xf4cc('0x39')]({'where':{'id':_0x1343b6[_0xf4cc('0x3a')]['id']}})[_0xf4cc('0x19')](handleEntityNotFound(_0x488960,null))['then'](saveUpdates(_0x1343b6[_0xf4cc('0x38')],null))['then'](respondWithResult(_0x488960,null))[_0xf4cc('0x2a')](handleError(_0x488960,null));};exports[_0xf4cc('0x1a')]=function(_0x4ff115,_0x5163f9){return db[_0xf4cc('0x2e')][_0xf4cc('0x39')]({'where':{'id':_0x4ff115[_0xf4cc('0x3a')]['id']}})[_0xf4cc('0x19')](handleEntityNotFound(_0x5163f9,null))[_0xf4cc('0x19')](removeEntity(_0x5163f9,null))[_0xf4cc('0x2a')](handleError(_0x5163f9,null));};exports['describe']=function(_0xf3ce4,_0x123655){return db[_0xf4cc('0x2e')][_0xf4cc('0x3b')]()[_0xf4cc('0x19')](respondWithResult(_0x123655,null))[_0xf4cc('0x2a')](handleError(_0x123655,null));};exports[_0xf4cc('0x3c')]=function(_0x4852ec,_0x4f9f16){return db[_0xf4cc('0x3d')][_0xf4cc('0x39')]({'where':{'id':_0x4852ec[_0xf4cc('0x3a')]['id']}})[_0xf4cc('0x19')](handleEntityNotFound(_0x4f9f16,null))[_0xf4cc('0x19')](function(_0x1c63e6){if(_0x1c63e6){return _0x1c63e6[_0xf4cc('0x3c')](_0x4852ec[_0xf4cc('0x38')][_0xf4cc('0x3e')],_[_0xf4cc('0x3f')](_0x4852ec[_0xf4cc('0x38')],[_0xf4cc('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x4f9f16,null))[_0xf4cc('0x2a')](handleError(_0x4f9f16,null));};exports[_0xf4cc('0x40')]=function(_0x538982,_0x239902){var _0x399cb1={'raw':![],'where':{}};var _0x5b0d04={};var _0x341490={'count':0x0,'rows':[]};return db[_0xf4cc('0x2e')]['findOne']({'where':{'id':_0x538982[_0xf4cc('0x3a')]['id']}})[_0xf4cc('0x19')](handleEntityNotFound(_0x239902,null))[_0xf4cc('0x19')](function(_0x4c5844){if(_0x4c5844){_0x5b0d04['model']=_['keys'](db['SmsMessage'][_0xf4cc('0x2f')]);_0x5b0d04[_0xf4cc('0x28')]=_[_0xf4cc('0x2d')](_0x538982['query']);_0x5b0d04[_0xf4cc('0x41')]=_[_0xf4cc('0x30')](_0x5b0d04[_0xf4cc('0x2c')],_0x5b0d04[_0xf4cc('0x28')]);_0x399cb1[_0xf4cc('0x32')]=_[_0xf4cc('0x30')](_0x5b0d04['model'],qs['fields'](_0x538982[_0xf4cc('0x28')]['fields']));_0x399cb1['attributes']=_0x399cb1[_0xf4cc('0x32')][_0xf4cc('0x33')]?_0x399cb1[_0xf4cc('0x32')]:_0x5b0d04[_0xf4cc('0x2c')];if(!_0x538982[_0xf4cc('0x28')][_0xf4cc('0x42')](_0xf4cc('0x43'))){_0x399cb1[_0xf4cc('0x15')]=qs['limit'](_0x538982['query'][_0xf4cc('0x15')]);_0x399cb1['offset']=qs[_0xf4cc('0x13')](_0x538982[_0xf4cc('0x28')][_0xf4cc('0x13')]);}_0x399cb1[_0xf4cc('0x44')]=qs['sort'](_0x538982[_0xf4cc('0x28')][_0xf4cc('0x45')]);_0x399cb1['where']=qs['filters'](_['pick'](_0x538982[_0xf4cc('0x28')],_0x5b0d04['filters']));_0x399cb1[_0xf4cc('0x46')][_0xf4cc('0x47')]=_0x4c5844['id'];if(_0x538982['query'][_0xf4cc('0x48')]){_0x399cb1[_0xf4cc('0x46')]=_[_0xf4cc('0x35')](_0x399cb1[_0xf4cc('0x46')],{'$or':_[_0xf4cc('0x22')](_0x399cb1[_0xf4cc('0x32')],function(_0x4f9681){var _0x1fa1af={};_0x1fa1af[_0x4f9681]={'$like':'%'+_0x538982[_0xf4cc('0x28')][_0xf4cc('0x48')]+'%'};return _0x1fa1af;})});}if(_0x538982[_0xf4cc('0x28')][_0xf4cc('0x49')]){var _0x13c0ae=_0x538982[_0xf4cc('0x28')][_0xf4cc('0x49')][_0xf4cc('0x4a')](',');var _0x2d8cf7={};_0x2d8cf7[_0x13c0ae[0x0]]={'$gte':moment(_0x13c0ae[0x1])[_0xf4cc('0x4b')](_0xf4cc('0x4c'))};_0x399cb1[_0xf4cc('0x46')]=_[_0xf4cc('0x35')](_0x399cb1[_0xf4cc('0x46')],_0x2d8cf7);}_0x399cb1=_['merge']({},_0x399cb1,_0x538982[_0xf4cc('0x36')]);return db[_0xf4cc('0x3d')][_0xf4cc('0x16')]({'where':_0x399cb1[_0xf4cc('0x46')]})[_0xf4cc('0x19')](function(_0x95d76d){_0x341490[_0xf4cc('0x16')]=_0x95d76d;if(_0x538982[_0xf4cc('0x28')][_0xf4cc('0x4d')]){_0x399cb1[_0xf4cc('0x34')]=[{'all':!![]}];}return db[_0xf4cc('0x3d')][_0xf4cc('0x26')](_0x399cb1);})[_0xf4cc('0x19')](function(_0x525ca2){_0x341490[_0xf4cc('0x4e')]=_0x525ca2;return _0x341490;});}})['then'](respondWithFilteredResult(_0x239902,_0x399cb1))['catch'](handleError(_0x239902,null));};exports['addTags']=function(_0x11d4e3,_0x32161d){return db[_0xf4cc('0x2e')][_0xf4cc('0x39')]({'where':{'id':_0x11d4e3[_0xf4cc('0x3a')]['id']}})[_0xf4cc('0x19')](handleEntityNotFound(_0x32161d,null))['then'](function(_0x566cb8){if(_0x566cb8){return _0x566cb8['setTags'](_0x11d4e3[_0xf4cc('0x38')][_0xf4cc('0x3e')],_[_0xf4cc('0x3f')](_0x11d4e3[_0xf4cc('0x38')],['ids','id'])||{})[_0xf4cc('0x4f')](function(){return db['Tag'][_0xf4cc('0x26')]({'attributes':['id',_0xf4cc('0x1f'),_0xf4cc('0x50')],'where':{'id':_0x11d4e3[_0xf4cc('0x38')]['ids']}});})[_0xf4cc('0x19')](function(_0x25a148){socket[_0xf4cc('0x51')](_0xf4cc('0x52'),{'id':Number(_0x11d4e3['params']['id']),'tags':_0x25a148||[]});return{'id':Number(_0x11d4e3[_0xf4cc('0x3a')]['id']),'tags':_0x25a148||[]};});}})['then'](respondWithResult(_0x32161d,null))[_0xf4cc('0x2a')](handleError(_0x32161d,null));};exports['removeTags']=function(_0x3210f0,_0x208907){return db[_0xf4cc('0x2e')]['find']({'where':{'id':_0x3210f0[_0xf4cc('0x3a')]['id']}})[_0xf4cc('0x19')](handleEntityNotFound(_0x208907,null))[_0xf4cc('0x19')](function(_0x37d4f0){if(_0x37d4f0){return _0x37d4f0[_0xf4cc('0x53')](_0x3210f0[_0xf4cc('0x28')][_0xf4cc('0x3e')]);}})['then'](respondWithStatusCode(_0x208907,null))[_0xf4cc('0x2a')](handleError(_0x208907,null));};exports[_0xf4cc('0x54')]=function(_0x221eca,_0x26f15c){var _0x38ca2e=moment()[_0xf4cc('0x55')]()[_0xf4cc('0x56')]();var _0x496e4b=path[_0xf4cc('0x57')](config[_0xf4cc('0x58')],_0xf4cc('0x59'),_0xf4cc('0x5a'),_0xf4cc('0x5b'));var _0x44474f=path[_0xf4cc('0x57')](_0x496e4b,_0x38ca2e);var _0x2b7c10=util['format'](_0xf4cc('0x5c'),_0x221eca[_0xf4cc('0x3a')]['id'],_0x38ca2e);var _0x1addf0=path[_0xf4cc('0x57')](_0x496e4b,_0x2b7c10);var _0x20266f=[];_0x20266f['push']({'model':db['User'],'as':_0xf4cc('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0x20266f[_0xf4cc('0x5e')]({'model':db[_0xf4cc('0x5f')],'as':_0xf4cc('0x60'),'attributes':['id',_0xf4cc('0x61'),'lastName'],'raw':!![]});var _0x436635=[{'model':db[_0xf4cc('0x3d')],'as':_0xf4cc('0x62'),'attributes':['id','body',_0xf4cc('0x63'),'direction','secret',_0xf4cc('0x64')],'include':_0x20266f}];_0x436635[_0xf4cc('0x5e')]({'model':db[_0xf4cc('0x65')],'as':_0xf4cc('0x66'),'attributes':['id','name']});_0x436635[_0xf4cc('0x5e')]({'model':db[_0xf4cc('0x5d')],'as':_0xf4cc('0x67'),'attributes':['id',_0xf4cc('0x68')]});return db[_0xf4cc('0x2e')][_0xf4cc('0x39')]({'where':{'id':_0x221eca[_0xf4cc('0x3a')]['id']},'include':_0x436635})[_0xf4cc('0x19')](handleEntityNotFound(_0x26f15c,null))[_0xf4cc('0x19')](function(_0x5111eb){if(_0x5111eb){var _0x1426c3=_0x5111eb[_0xf4cc('0x69')]({'plain':!![]});fs['mkdirSync'](_0x44474f);var _0x35bf39={'channel':_0xf4cc('0x6a'),'account':_0x1426c3['Account'][_0xf4cc('0x1f')],'agent':_0x1426c3[_0xf4cc('0x67')]?_0x1426c3[_0xf4cc('0x67')]['fullname']:_0xf4cc('0x6b'),'createdAt':moment(_0x1426c3[_0xf4cc('0x63')])[_0xf4cc('0x4b')](_0xf4cc('0x4c'))[_0xf4cc('0x56')](),'closedAt':_0x1426c3[_0xf4cc('0x6c')]?moment(_0x1426c3[_0xf4cc('0x6d')])['format'](_0xf4cc('0x4c'))[_0xf4cc('0x56')]():'','disposition':_0x1426c3[_0xf4cc('0x6e')],'messages':_(_0x1426c3[_0xf4cc('0x62')])[_0xf4cc('0x48')]({'secret':![]})[_0xf4cc('0x22')](function(_0x4fafac){return{'date':moment(_0x4fafac[_0xf4cc('0x63')])['format'](_0xf4cc('0x4c'))['toString'](),'sender':_0x4fafac[_0xf4cc('0x6f')]===_0xf4cc('0x70')?_0x4fafac[_0xf4cc('0x5d')]?_0x4fafac[_0xf4cc('0x5d')][_0xf4cc('0x68')]:_0xf4cc('0x71'):_0x4fafac['Contact'][_0xf4cc('0x61')]+(_0x4fafac[_0xf4cc('0x60')]['lastName']?'\x20'+_0x4fafac[_0xf4cc('0x60')][_0xf4cc('0x72')]:''),'body':_0x4fafac['body'],'direction':_0x4fafac[_0xf4cc('0x6f')]==='out'?'A':'C','secret':_0x4fafac[_0xf4cc('0x73')],'read':_0x4fafac[_0xf4cc('0x64')]};})[_0xf4cc('0x74')]()};return ejs[_0xf4cc('0x75')](path[_0xf4cc('0x57')](config[_0xf4cc('0x58')],_0xf4cc('0x59'),_0xf4cc('0x76'),_0xf4cc('0x77')),{'interaction':_0x35bf39})[_0xf4cc('0x19')](function(_0xef9c52){var _0x248ddc=path[_0xf4cc('0x57')](_0x44474f,_0xf4cc('0x78')+_0x1426c3['id']+'-'+_0x38ca2e+_0xf4cc('0x79'));var _0x4ad609={'path':_0x248ddc,'channel':_0xf4cc('0x6a'),'interactionId':_0x1426c3['id']};return pdf['createPdfFromHTML'](_0xef9c52,_0x4ad609);})[_0xf4cc('0x19')](function(){return new BPromise(function(_0x4a8765,_0x3df290){zipdir(_0x44474f,{'saveTo':_0x1addf0},function(_0x55c1ac,_0x4fbdc4){if(_0x55c1ac)return _0x3df290(_0x55c1ac);return _0x4a8765(_0x4fbdc4);});})[_0xf4cc('0x19')](function(){return new BPromise(function(_0x2f26da,_0x3d8625){rimraf(_0x44474f,function(_0x17f5da){if(_0x17f5da)_0x3d8625(_0x17f5da);return _0x2f26da();});});})[_0xf4cc('0x19')](function(){return _0x26f15c[_0xf4cc('0x54')](_0x1addf0,_0x2b7c10,function(_0x51189a){if(_0x51189a){console[_0xf4cc('0x7a')](_0xf4cc('0x7b'),_0x51189a);}else{fs[_0xf4cc('0x7c')](_0x1addf0);}});});});}else{return _0x26f15c['sendStatus'](0xc8);}})[_0xf4cc('0x2a')](handleError(_0x26f15c,null));};
\ No newline at end of file
+var _0xb046=['spread','color','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','files','tmp','User','push','CmContact','Contact','firstName','lastName','Messages','direction','secret','read','SmsAccount','Account','Owner','fullname','get','Sms','createdAt','closed','out','System','value','renderFile','server','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','set','update','then','destroy','end','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','filters','nolimit','limit','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags'];(function(_0x571f7c,_0x450489){var _0x374a19=function(_0x5ddfdf){while(--_0x5ddfdf){_0x571f7c['push'](_0x571f7c['shift']());}};_0x374a19(++_0x450489);}(_0xb046,0x193));var _0x6b04=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xb046[_0x113a6c];return _0x1ac632;};'use strict';var rimraf=require(_0x6b04('0x0'));var zipdir=require(_0x6b04('0x1'));var moment=require(_0x6b04('0x2'));var BPromise=require(_0x6b04('0x3'));var util=require(_0x6b04('0x4'));var path=require('path');var ejs=require(_0x6b04('0x5'));var fs=require('fs');var _=require(_0x6b04('0x6'));var Redis=require(_0x6b04('0x7'));var interaction=require(_0x6b04('0x8'));var qs=require(_0x6b04('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x6b04('0xa'))(_0x6b04('0xb'));var config=require(_0x6b04('0xc'));var db=require(_0x6b04('0xd'))['db'];config[_0x6b04('0xe')]=_[_0x6b04('0xf')](config[_0x6b04('0xe')],{'host':_0x6b04('0x10'),'port':0x18eb});var socket=require(_0x6b04('0x11'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1921c1,_0x4501d3){_0x4501d3=_0x4501d3||0xcc;return function(_0x1ab5bc){if(_0x1ab5bc){return _0x1921c1[_0x6b04('0x12')](_0x4501d3);}return _0x1921c1[_0x6b04('0x13')](_0x4501d3)['end']();};}function respondWithResult(_0x22f90e,_0x4121c5){_0x4121c5=_0x4121c5||0xc8;return function(_0x38f34c){if(_0x38f34c){return _0x22f90e[_0x6b04('0x13')](_0x4121c5)[_0x6b04('0x14')](_0x38f34c);}};}function respondWithFilteredResult(_0x399e9e,_0x9c6ae9){return function(_0x2a5911){if(_0x2a5911){var _0x819e9f=typeof _0x9c6ae9[_0x6b04('0x15')]===_0x6b04('0x16')&&typeof _0x9c6ae9['limit']===_0x6b04('0x16');var _0x1a25e5=_0x2a5911[_0x6b04('0x17')];var _0x182092=_0x819e9f?0x0:_0x9c6ae9[_0x6b04('0x15')];var _0x12e547=_0x819e9f?_0x2a5911['count']:_0x9c6ae9[_0x6b04('0x15')]+_0x9c6ae9['limit'];var _0x3d1a06;if(_0x12e547>=_0x1a25e5){_0x12e547=_0x1a25e5;_0x3d1a06=0xc8;}else{_0x3d1a06=0xce;}_0x399e9e['status'](_0x3d1a06);return _0x399e9e[_0x6b04('0x18')]('Content-Range',_0x182092+'-'+_0x12e547+'/'+_0x1a25e5)['json'](_0x2a5911);}return null;};}function saveUpdates(_0x4d95d8){return function(_0x38bdd9){if(_0x38bdd9){return _0x38bdd9[_0x6b04('0x19')](_0x4d95d8)[_0x6b04('0x1a')](function(_0x671030){return _0x671030;});}return null;};}function removeEntity(_0x206cfd){return function(_0x3d68f3){if(_0x3d68f3){return _0x3d68f3[_0x6b04('0x1b')]()[_0x6b04('0x1a')](function(){_0x206cfd[_0x6b04('0x13')](0xcc)[_0x6b04('0x1c')]();});}};}function handleEntityNotFound(_0x1d951a){return function(_0x56fd1a){if(!_0x56fd1a){_0x1d951a[_0x6b04('0x12')](0x194);}return _0x56fd1a;};}function handleError(_0x2b95bd,_0x48f632){_0x48f632=_0x48f632||0x1f4;return function(_0xbd6a1f){logger[_0x6b04('0x1d')](_0xbd6a1f[_0x6b04('0x1e')]);if(_0xbd6a1f[_0x6b04('0x1f')]){delete _0xbd6a1f[_0x6b04('0x1f')];}_0x2b95bd['status'](_0x48f632)[_0x6b04('0x20')](_0xbd6a1f);};}exports[_0x6b04('0x21')]=function(_0x3711d2,_0x9112e7){var _0x2fc33f={};var _0x1c7ee9=_[_0x6b04('0x22')](db[_0x6b04('0x23')][_0x6b04('0x24')],function(_0x174ec1){return{'name':_0x174ec1[_0x6b04('0x25')],'type':_0x174ec1[_0x6b04('0x26')][_0x6b04('0x27')]};});_0x2fc33f=qs[_0x6b04('0x28')](_0x1c7ee9,_0x3711d2);return interaction[_0x6b04('0x29')](_0x6b04('0x2a'),_0x3711d2[_0x6b04('0x2b')],_0x3711d2[_0x6b04('0x2c')],_0x2fc33f,_0x1c7ee9)[_0x6b04('0x1a')](respondWithFilteredResult(_0x9112e7,_0x2fc33f))[_0x6b04('0x2d')](handleError(_0x9112e7,null));};exports[_0x6b04('0x2e')]=function(_0x3bbb45,_0x4db038){var _0x3f063b={'raw':![],'where':{'id':_0x3bbb45[_0x6b04('0x2f')]['id']}},_0x1685f0={};_0x1685f0[_0x6b04('0x30')]=_[_0x6b04('0x31')](db['SmsInteraction'][_0x6b04('0x24')]);_0x1685f0[_0x6b04('0x2b')]=_['keys'](_0x3bbb45['query']);_0x1685f0['filters']=_['intersection'](_0x1685f0[_0x6b04('0x30')],_0x1685f0[_0x6b04('0x2b')]);_0x3f063b[_0x6b04('0x32')]=_[_0x6b04('0x33')](_0x1685f0[_0x6b04('0x30')],qs[_0x6b04('0x34')](_0x3bbb45[_0x6b04('0x2b')][_0x6b04('0x34')]));_0x3f063b[_0x6b04('0x32')]=_0x3f063b['attributes'][_0x6b04('0x35')]?_0x3f063b[_0x6b04('0x32')]:_0x1685f0[_0x6b04('0x30')];if(_0x3bbb45[_0x6b04('0x2b')][_0x6b04('0x36')]){_0x3f063b[_0x6b04('0x37')]=[{'all':!![]}];}_0x3f063b=_[_0x6b04('0x38')]({},_0x3f063b,_0x3bbb45[_0x6b04('0x39')]);return db['SmsInteraction'][_0x6b04('0x3a')](_0x3f063b)[_0x6b04('0x1a')](handleEntityNotFound(_0x4db038,null))['then'](respondWithResult(_0x4db038,null))[_0x6b04('0x2d')](handleError(_0x4db038,null));};exports[_0x6b04('0x3b')]=function(_0x23280e,_0x386a87){return db['SmsInteraction'][_0x6b04('0x3b')](_0x23280e[_0x6b04('0x3c')],{})[_0x6b04('0x1a')](respondWithResult(_0x386a87,0xc9))['catch'](handleError(_0x386a87,null));};exports[_0x6b04('0x19')]=function(_0x5bedb5,_0x227d02){if(_0x5bedb5[_0x6b04('0x3c')]['id']){delete _0x5bedb5[_0x6b04('0x3c')]['id'];}return db[_0x6b04('0x23')]['find']({'where':{'id':_0x5bedb5['params']['id']}})[_0x6b04('0x1a')](handleEntityNotFound(_0x227d02,null))[_0x6b04('0x1a')](saveUpdates(_0x5bedb5[_0x6b04('0x3c')],null))['then'](respondWithResult(_0x227d02,null))['catch'](handleError(_0x227d02,null));};exports[_0x6b04('0x1b')]=function(_0x24d6ad,_0x5c2c78){return db[_0x6b04('0x23')][_0x6b04('0x3a')]({'where':{'id':_0x24d6ad[_0x6b04('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5c2c78,null))[_0x6b04('0x1a')](removeEntity(_0x5c2c78,null))[_0x6b04('0x2d')](handleError(_0x5c2c78,null));};exports[_0x6b04('0x3d')]=function(_0x337a1f,_0xedf1ab){return db[_0x6b04('0x23')][_0x6b04('0x3d')]()[_0x6b04('0x1a')](respondWithResult(_0xedf1ab,null))[_0x6b04('0x2d')](handleError(_0xedf1ab,null));};exports[_0x6b04('0x3e')]=function(_0x56e787,_0x729304){return db[_0x6b04('0x3f')][_0x6b04('0x3a')]({'where':{'id':_0x56e787[_0x6b04('0x2f')]['id']}})['then'](handleEntityNotFound(_0x729304,null))['then'](function(_0x569c0a){if(_0x569c0a){return _0x569c0a[_0x6b04('0x3e')](_0x56e787[_0x6b04('0x3c')][_0x6b04('0x40')],_['omit'](_0x56e787[_0x6b04('0x3c')],[_0x6b04('0x40'),'id'])||{});}})[_0x6b04('0x1a')](respondWithResult(_0x729304,null))[_0x6b04('0x2d')](handleError(_0x729304,null));};exports['getMessages']=function(_0x5929ca,_0x422912){var _0x21c6c6={'raw':![],'where':{}};var _0x3fe2e3={};var _0x27ad86={'count':0x0,'rows':[]};return db[_0x6b04('0x23')]['findOne']({'where':{'id':_0x5929ca[_0x6b04('0x2f')]['id']}})['then'](handleEntityNotFound(_0x422912,null))[_0x6b04('0x1a')](function(_0xca2965){if(_0xca2965){_0x3fe2e3[_0x6b04('0x30')]=_[_0x6b04('0x31')](db[_0x6b04('0x3f')][_0x6b04('0x24')]);_0x3fe2e3[_0x6b04('0x2b')]=_[_0x6b04('0x31')](_0x5929ca[_0x6b04('0x2b')]);_0x3fe2e3[_0x6b04('0x41')]=_[_0x6b04('0x33')](_0x3fe2e3[_0x6b04('0x30')],_0x3fe2e3[_0x6b04('0x2b')]);_0x21c6c6[_0x6b04('0x32')]=_[_0x6b04('0x33')](_0x3fe2e3[_0x6b04('0x30')],qs[_0x6b04('0x34')](_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x34')]));_0x21c6c6[_0x6b04('0x32')]=_0x21c6c6[_0x6b04('0x32')][_0x6b04('0x35')]?_0x21c6c6['attributes']:_0x3fe2e3[_0x6b04('0x30')];if(!_0x5929ca['query']['hasOwnProperty'](_0x6b04('0x42'))){_0x21c6c6['limit']=qs[_0x6b04('0x43')](_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x43')]);_0x21c6c6[_0x6b04('0x15')]=qs[_0x6b04('0x15')](_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x15')]);}_0x21c6c6[_0x6b04('0x44')]=qs[_0x6b04('0x45')](_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x45')]);_0x21c6c6[_0x6b04('0x46')]=qs[_0x6b04('0x41')](_[_0x6b04('0x47')](_0x5929ca['query'],_0x3fe2e3['filters']));_0x21c6c6[_0x6b04('0x46')][_0x6b04('0x48')]=_0xca2965['id'];if(_0x5929ca['query']['filter']){_0x21c6c6['where']=_[_0x6b04('0x38')](_0x21c6c6[_0x6b04('0x46')],{'$or':_[_0x6b04('0x22')](_0x21c6c6[_0x6b04('0x32')],function(_0x5c3f27){var _0x5e6fd9={};_0x5e6fd9[_0x5c3f27]={'$like':'%'+_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x49')]+'%'};return _0x5e6fd9;})});}if(_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x4a')]){var _0x4046f7=_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x4a')][_0x6b04('0x4b')](',');var _0x57d2a8={};_0x57d2a8[_0x4046f7[0x0]]={'$gte':moment(_0x4046f7[0x1])[_0x6b04('0x4c')](_0x6b04('0x4d'))};_0x21c6c6[_0x6b04('0x46')]=_[_0x6b04('0x38')](_0x21c6c6['where'],_0x57d2a8);}_0x21c6c6=_[_0x6b04('0x38')]({},_0x21c6c6,_0x5929ca['options']);return db[_0x6b04('0x3f')][_0x6b04('0x17')]({'where':_0x21c6c6['where']})[_0x6b04('0x1a')](function(_0x449020){_0x27ad86[_0x6b04('0x17')]=_0x449020;if(_0x5929ca[_0x6b04('0x2b')][_0x6b04('0x36')]){_0x21c6c6['include']=[{'all':!![]}];}return db[_0x6b04('0x3f')]['findAll'](_0x21c6c6);})[_0x6b04('0x1a')](function(_0xd6df93){_0x27ad86[_0x6b04('0x4e')]=_0xd6df93;return _0x27ad86;});}})['then'](respondWithFilteredResult(_0x422912,_0x21c6c6))['catch'](handleError(_0x422912,null));};exports[_0x6b04('0x4f')]=function(_0x2f33ca,_0x3ebd22){return db[_0x6b04('0x23')][_0x6b04('0x3a')]({'where':{'id':_0x2f33ca[_0x6b04('0x2f')]['id']}})[_0x6b04('0x1a')](handleEntityNotFound(_0x3ebd22,null))[_0x6b04('0x1a')](function(_0x22b0d0){if(_0x22b0d0){return _0x22b0d0[_0x6b04('0x50')](_0x2f33ca[_0x6b04('0x3c')][_0x6b04('0x40')],_['omit'](_0x2f33ca[_0x6b04('0x3c')],['ids','id'])||{})[_0x6b04('0x51')](function(){return db['Tag'][_0x6b04('0x29')]({'attributes':['id',_0x6b04('0x1f'),_0x6b04('0x52')],'where':{'id':_0x2f33ca[_0x6b04('0x3c')][_0x6b04('0x40')]}});})['then'](function(_0x421a20){socket[_0x6b04('0x53')](_0x6b04('0x54'),{'id':Number(_0x2f33ca[_0x6b04('0x2f')]['id']),'tags':_0x421a20||[]});return{'id':Number(_0x2f33ca[_0x6b04('0x2f')]['id']),'tags':_0x421a20||[]};});}})[_0x6b04('0x1a')](respondWithResult(_0x3ebd22,null))[_0x6b04('0x2d')](handleError(_0x3ebd22,null));};exports['removeTags']=function(_0x331c74,_0x22194b){return db[_0x6b04('0x23')][_0x6b04('0x3a')]({'where':{'id':_0x331c74[_0x6b04('0x2f')]['id']}})[_0x6b04('0x1a')](handleEntityNotFound(_0x22194b,null))[_0x6b04('0x1a')](function(_0x3a79f4){if(_0x3a79f4){return _0x3a79f4[_0x6b04('0x55')](_0x331c74['query'][_0x6b04('0x40')]);}})['then'](respondWithStatusCode(_0x22194b,null))['catch'](handleError(_0x22194b,null));};exports['download']=function(_0x5bc458,_0x58677d){var _0x58bcf7=moment()[_0x6b04('0x56')]()[_0x6b04('0x57')]();var _0x53b5de=path[_0x6b04('0x58')](config[_0x6b04('0x59')],'server',_0x6b04('0x5a'),_0x6b04('0x5b'));var _0x5359fc=path[_0x6b04('0x58')](_0x53b5de,_0x58bcf7);var _0x49769a=util[_0x6b04('0x4c')]('transcript-%d-%s.zip',_0x5bc458[_0x6b04('0x2f')]['id'],_0x58bcf7);var _0x586fbd=path[_0x6b04('0x58')](_0x53b5de,_0x49769a);var _0x462042=[];_0x462042['push']({'model':db[_0x6b04('0x5c')],'as':_0x6b04('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x462042[_0x6b04('0x5d')]({'model':db[_0x6b04('0x5e')],'as':_0x6b04('0x5f'),'attributes':['id',_0x6b04('0x60'),_0x6b04('0x61')],'raw':!![]});var _0x46dc03=[{'model':db['SmsMessage'],'as':_0x6b04('0x62'),'attributes':['id',_0x6b04('0x3c'),'createdAt',_0x6b04('0x63'),_0x6b04('0x64'),_0x6b04('0x65')],'include':_0x462042}];_0x46dc03[_0x6b04('0x5d')]({'model':db[_0x6b04('0x66')],'as':_0x6b04('0x67'),'attributes':['id',_0x6b04('0x1f')]});_0x46dc03[_0x6b04('0x5d')]({'model':db[_0x6b04('0x5c')],'as':_0x6b04('0x68'),'attributes':['id',_0x6b04('0x69')]});return db[_0x6b04('0x23')]['find']({'where':{'id':_0x5bc458[_0x6b04('0x2f')]['id']},'include':_0x46dc03})[_0x6b04('0x1a')](handleEntityNotFound(_0x58677d,null))[_0x6b04('0x1a')](function(_0x44c7a3){if(_0x44c7a3){var _0x54a24c=_0x44c7a3[_0x6b04('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x5359fc);var _0x36bb85={'channel':_0x6b04('0x6b'),'account':_0x54a24c[_0x6b04('0x67')][_0x6b04('0x1f')],'agent':_0x54a24c[_0x6b04('0x68')]?_0x54a24c[_0x6b04('0x68')][_0x6b04('0x69')]:'N.A.','createdAt':moment(_0x54a24c[_0x6b04('0x6c')])['format'](_0x6b04('0x4d'))['toString'](),'closedAt':_0x54a24c[_0x6b04('0x6d')]?moment(_0x54a24c['closedAt'])[_0x6b04('0x4c')](_0x6b04('0x4d'))[_0x6b04('0x57')]():'','disposition':_0x54a24c['disposition'],'messages':_(_0x54a24c[_0x6b04('0x62')])[_0x6b04('0x49')]({'secret':![]})[_0x6b04('0x22')](function(_0x21edae){return{'date':moment(_0x21edae['createdAt'])[_0x6b04('0x4c')](_0x6b04('0x4d'))[_0x6b04('0x57')](),'sender':_0x21edae['direction']===_0x6b04('0x6e')?_0x21edae['User']?_0x21edae[_0x6b04('0x5c')]['fullname']:_0x6b04('0x6f'):_0x21edae['Contact'][_0x6b04('0x60')]+(_0x21edae[_0x6b04('0x5f')][_0x6b04('0x61')]?'\x20'+_0x21edae[_0x6b04('0x5f')][_0x6b04('0x61')]:''),'body':_0x21edae[_0x6b04('0x3c')],'direction':_0x21edae[_0x6b04('0x63')]===_0x6b04('0x6e')?'A':'C','secret':_0x21edae[_0x6b04('0x64')],'read':_0x21edae[_0x6b04('0x65')]};})[_0x6b04('0x70')]()};return ejs[_0x6b04('0x71')](path[_0x6b04('0x58')](config['root'],_0x6b04('0x72'),'views',_0x6b04('0x73')),{'interaction':_0x36bb85})['then'](function(_0xfe9a09){var _0x4a3378=path[_0x6b04('0x58')](_0x5359fc,_0x6b04('0x74')+_0x54a24c['id']+'-'+_0x58bcf7+_0x6b04('0x75'));var _0x5e8e24={'path':_0x4a3378,'channel':_0x6b04('0x6b'),'interactionId':_0x54a24c['id']};return pdf[_0x6b04('0x76')](_0xfe9a09,_0x5e8e24);})[_0x6b04('0x1a')](function(){return new BPromise(function(_0x32cb52,_0x512a50){zipdir(_0x5359fc,{'saveTo':_0x586fbd},function(_0x14cd17,_0x1afd76){if(_0x14cd17)return _0x512a50(_0x14cd17);return _0x32cb52(_0x1afd76);});})[_0x6b04('0x1a')](function(){return new BPromise(function(_0xac0cdc,_0x53b9b3){rimraf(_0x5359fc,function(_0x45c975){if(_0x45c975)_0x53b9b3(_0x45c975);return _0xac0cdc();});});})[_0x6b04('0x1a')](function(){return _0x58677d['download'](_0x586fbd,_0x49769a,function(_0x2a720a){if(_0x2a720a){console[_0x6b04('0x77')](_0x6b04('0x78'),_0x2a720a);}else{fs['unlinkSync'](_0x586fbd);}});});});}else{return _0x58677d[_0x6b04('0x12')](0xc8);}})[_0x6b04('0x2d')](handleError(_0x58677d,null));};
\ No newline at end of file
index 9335390..d14fceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5464=['SmsMessage','save','remove','setDataValue','Users','map','findAll','then','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction'];(function(_0x1e2d27,_0x265e0e){var _0xc20da5=function(_0x24d17e){while(--_0x24d17e){_0x1e2d27['push'](_0x1e2d27['shift']());}};_0xc20da5(++_0x265e0e);}(_0x5464,0x15d));var _0x4546=function(_0x1544e8,_0x169b5a){_0x1544e8=_0x1544e8-0x0;var _0x5e97de=_0x5464[_0x1544e8];return _0x5e97de;};'use strict';var EventEmitter=require(_0x4546('0x0'));var SmsInteraction=require(_0x4546('0x1'))['db'][_0x4546('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x4546('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4546('0x4'),'afterUpdate':'update','afterDestroy':_0x4546('0x5')};function emitEvent(_0x396a1d){return function(_0xcc9def,_0x2b1a9b,_0x54228a){_0xcc9def['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x224c7c){_0xcc9def[_0x4546('0x6')](_0x4546('0x7'),_0x224c7c[_0x4546('0x8')](function(_0x2f0376){return{'id':_0x2f0376['id']};}));return SmsMessage[_0x4546('0x9')]({'where':{'SmsInteractionId':_0xcc9def['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4546('0xa')](function(_0x430b2e){_0xcc9def[_0x4546('0x6')]('unreadMessages',_0x430b2e[_0x4546('0xb')]);SmsInteractionEvents[_0x4546('0xc')](_0x396a1d+':'+_0xcc9def['id'],_0xcc9def);SmsInteractionEvents[_0x4546('0xc')](_0x396a1d,_0xcc9def);_0x54228a(null);})['catch'](_0x54228a(null));};}for(var e in events){if(events[_0x4546('0xd')](e)){var event=events[e];SmsInteraction[_0x4546('0xe')](e,emitEvent(event));}}module[_0x4546('0xf')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x2032=['Users','map','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','SmsInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x2032,0xd9));var _0x2203=function(_0x5b3fbe,_0x500f06){_0x5b3fbe=_0x5b3fbe-0x0;var _0x2ba50b=_0x2032[_0x5b3fbe];return _0x2ba50b;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var SmsMessage=require(_0x2203('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2203('0x2')](0x0);var events={'afterCreate':_0x2203('0x3'),'afterUpdate':'update','afterDestroy':_0x2203('0x4')};function emitEvent(_0x880dcd){return function(_0x44ccfd,_0x201796,_0x3f7ba1){_0x44ccfd[_0x2203('0x5')]({'attributes':['id'],'raw':!![]})[_0x2203('0x6')](function(_0x2676aa){_0x44ccfd[_0x2203('0x7')](_0x2203('0x8'),_0x2676aa[_0x2203('0x9')](function(_0x5ecf9e){return{'id':_0x5ecf9e['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x44ccfd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2203('0x6')](function(_0x549908){_0x44ccfd[_0x2203('0x7')](_0x2203('0xa'),_0x549908[_0x2203('0xb')]);SmsInteractionEvents['emit'](_0x880dcd+':'+_0x44ccfd['id'],_0x44ccfd);SmsInteractionEvents[_0x2203('0xc')](_0x880dcd,_0x44ccfd);_0x3f7ba1(null);})['catch'](_0x3f7ba1(null));};}for(var e in events){if(events[_0x2203('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x2203('0xe')]=SmsInteractionEvents;
\ No newline at end of file
index 4fb06d2..9fa1658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f5b=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','path','rimraf','../../config/environment','define','sms_interactions','changed','closed'];(function(_0x31077d,_0x59ede2){var _0x4fc649=function(_0x23785f){while(--_0x23785f){_0x31077d['push'](_0x31077d['shift']());}};_0x4fc649(++_0x59ede2);}(_0x6f5b,0xf9));var _0xb6f5=function(_0x10556c,_0x35c2c4){_0x10556c=_0x10556c-0x0;var _0x19e7d6=_0x6f5b[_0x10556c];return _0x19e7d6;};'use strict';var _=require(_0xb6f5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6f5('0x1'));var moment=require(_0xb6f5('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6f5('0x3'));var fs=require('fs');var path=require(_0xb6f5('0x4'));var rimraf=require(_0xb6f5('0x5'));var config=require(_0xb6f5('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x44de17,_0x625ae2){return _0x44de17[_0xb6f5('0x7')]('SmsInteraction',attributes,{'tableName':_0xb6f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3726b3,_0x117240,_0x24a17e){if(_0x3726b3[_0xb6f5('0x9')](_0xb6f5('0xa'))){_0x3726b3[_0xb6f5('0xb')]=moment()['format'](_0xb6f5('0xc'));}_0x24a17e(null,_0x3726b3);}}});};
\ No newline at end of file
+var _0xf061=['sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction'];(function(_0x25ae9b,_0x46e192){var _0x2d0078=function(_0x165635){while(--_0x165635){_0x25ae9b['push'](_0x25ae9b['shift']());}};_0x2d0078(++_0x46e192);}(_0xf061,0x195));var _0x1f06=function(_0x50e5b1,_0x2d0153){_0x50e5b1=_0x50e5b1-0x0;var _0x4d80af=_0xf061[_0x50e5b1];return _0x4d80af;};'use strict';var _=require(_0x1f06('0x0'));var util=require(_0x1f06('0x1'));var logger=require(_0x1f06('0x2'))(_0x1f06('0x3'));var moment=require(_0x1f06('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f06('0x5'));var fs=require('fs');var path=require(_0x1f06('0x6'));var rimraf=require(_0x1f06('0x7'));var config=require(_0x1f06('0x8'));var attributes=require(_0x1f06('0x9'));module[_0x1f06('0xa')]=function(_0x249eee,_0x2eaefc){return _0x249eee[_0x1f06('0xb')](_0x1f06('0xc'),attributes,{'tableName':_0x1f06('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4504be,_0x530a2f,_0x1ef4b7){if(_0x4504be[_0x1f06('0xe')](_0x1f06('0xf'))){_0x4504be[_0x1f06('0x10')]=moment()[_0x1f06('0x11')](_0x1f06('0x12'));}_0x1ef4b7(null,_0x4504be);}}});};
\ No newline at end of file
index 5786e9c..9015b18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x807a=['SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsInteraction','options','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info'];(function(_0xd44315,_0x3c13c7){var _0x3a8dd8=function(_0x2a8ae3){while(--_0x2a8ae3){_0xd44315['push'](_0xd44315['shift']());}};_0x3a8dd8(++_0x3c13c7);}(_0x807a,0x6a));var _0xa807=function(_0x5ce3bb,_0x4fbaac){_0x5ce3bb=_0x5ce3bb-0x0;var _0x385995=_0x807a[_0x5ce3bb];return _0x385995;};'use strict';var _=require(_0xa807('0x0'));var util=require(_0xa807('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa807('0x2'));var fs=require('fs');var Redis=require(_0xa807('0x3'));var db=require(_0xa807('0x4'))['db'];var utils=require(_0xa807('0x5'));var logger=require(_0xa807('0x6'))(_0xa807('0x7'));var config=require(_0xa807('0x8'));var jayson=require(_0xa807('0x9'));var client=jayson[_0xa807('0xa')][_0xa807('0xb')]({'port':0x232a});config[_0xa807('0xc')]=_[_0xa807('0xd')](config[_0xa807('0xc')],{'host':_0xa807('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa807('0xc')]));require(_0xa807('0xf'))[_0xa807('0x10')](socket);function respondWithRpcPromise(_0x1bb766,_0xc7ff51,_0x39d292){return new BPromise(function(_0x223a3b,_0x4e3a28){return client[_0xa807('0x11')](_0x1bb766,_0x39d292)[_0xa807('0x12')](function(_0x1ca47d){logger[_0xa807('0x13')](_0xa807('0x14'),_0xc7ff51,_0xa807('0x15'));logger[_0xa807('0x16')](_0xa807('0x17'),_0xc7ff51,'request\x20sent',JSON[_0xa807('0x18')](_0x1ca47d));if(_0x1ca47d[_0xa807('0x19')]){if(_0x1ca47d[_0xa807('0x19')][_0xa807('0x1a')]===0x1f4){logger[_0xa807('0x19')](_0xa807('0x14'),_0xc7ff51,_0x1ca47d[_0xa807('0x19')][_0xa807('0x1b')]);return _0x4e3a28(_0x1ca47d[_0xa807('0x19')]['message']);}logger[_0xa807('0x19')](_0xa807('0x14'),_0xc7ff51,_0x1ca47d[_0xa807('0x19')][_0xa807('0x1b')]);return _0x223a3b(_0x1ca47d['error'][_0xa807('0x1b')]);}else{logger[_0xa807('0x13')](_0xa807('0x14'),_0xc7ff51,_0xa807('0x15'));_0x223a3b(_0x1ca47d['result'][_0xa807('0x1b')]);}})[_0xa807('0x1c')](function(_0x4719c0){logger[_0xa807('0x19')](_0xa807('0x14'),_0xc7ff51,_0x4719c0);_0x4e3a28(_0x4719c0);});});}exports['UpdateSmsInteraction']=function(_0x4e69ca){var _0x2513da=this;return new Promise(function(_0x876cc2,_0x4b3cd8){return db[_0xa807('0x1d')]['update'](_0x4e69ca['body'],{'raw':_0x4e69ca['options']?_0x4e69ca[_0xa807('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e69ca[_0xa807('0x1e')]?_0x4e69ca[_0xa807('0x1e')][_0xa807('0x1f')]||null:null,'attributes':_0x4e69ca[_0xa807('0x1e')]?_0x4e69ca[_0xa807('0x1e')][_0xa807('0x20')]||null:null,'limit':_0x4e69ca['options']?_0x4e69ca[_0xa807('0x1e')][_0xa807('0x21')]||null:null})['then'](function(_0x3e1f60){logger[_0xa807('0x13')]('UpdateSmsInteraction',_0x4e69ca);logger[_0xa807('0x16')](_0xa807('0x22'),_0x4e69ca,JSON[_0xa807('0x18')](_0x3e1f60));_0x876cc2(_0x3e1f60);})[_0xa807('0x1c')](function(_0x9e6177){logger[_0xa807('0x19')]('UpdateSmsInteraction',_0x9e6177[_0xa807('0x1b')],_0x4e69ca);_0x4b3cd8(_0x2513da[_0xa807('0x19')](0x1f4,_0x9e6177[_0xa807('0x1b')]));});});};exports[_0xa807('0x23')]=function(_0x386fc6){return new Promise(function(_0x5eef0e,_0x9e266e){return db['SmsInteraction'][_0xa807('0x24')]({'where':_0x386fc6[_0xa807('0x1e')]?_0x386fc6['options'][_0xa807('0x1f')]||null:null})[_0xa807('0x12')](function(_0x366a0f){if(_0x366a0f){return _0x366a0f[_0xa807('0x25')](_0x386fc6[_0xa807('0x26')][_0xa807('0x27')],_[_0xa807('0x28')](_0x386fc6[_0xa807('0x26')],[_0xa807('0x27'),'id'])||{});}})['spread'](function(_0x3ac316){logger['info'](_0xa807('0x29'),_0x386fc6);logger[_0xa807('0x16')](_0xa807('0x29'),_0x386fc6,JSON[_0xa807('0x18')](_0x3ac316));_0x5eef0e(_0x3ac316);})[_0xa807('0x1c')](function(_0x2449aa){logger[_0xa807('0x19')](_0xa807('0x29'),_0x2449aa['message'],_0x386fc6);_0x9e266e(_this['error'](0x1f4,_0x2449aa['message']));});});};
\ No newline at end of file
+var _0x9bbe=['SmsInteraction,\x20%s,\x20%s','UpdateSmsInteraction','update','body','options','raw','where','catch','AddTagsToSmsInteraction','SmsInteraction','then','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x9bbe,0x87));var _0xe9bb=function(_0x38e0d9,_0x333927){_0x38e0d9=_0x38e0d9-0x0;var _0x2c6f49=_0x9bbe[_0x38e0d9];return _0x2c6f49;};'use strict';var _=require(_0xe9bb('0x0'));var util=require(_0xe9bb('0x1'));var moment=require(_0xe9bb('0x2'));var BPromise=require(_0xe9bb('0x3'));var rs=require(_0xe9bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9bb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9bb('0x6'))(_0xe9bb('0x7'));var config=require(_0xe9bb('0x8'));var jayson=require(_0xe9bb('0x9'));var client=jayson[_0xe9bb('0xa')][_0xe9bb('0xb')]({'port':0x232a});config[_0xe9bb('0xc')]=_[_0xe9bb('0xd')](config[_0xe9bb('0xc')],{'host':_0xe9bb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9bb('0xc')]));require(_0xe9bb('0xf'))[_0xe9bb('0x10')](socket);function respondWithRpcPromise(_0x357fea,_0x2e8fdd,_0x5552fb){return new BPromise(function(_0x104c0c,_0x1f1dca){return client[_0xe9bb('0x11')](_0x357fea,_0x5552fb)['then'](function(_0x12ecd1){logger[_0xe9bb('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2e8fdd,'request\x20sent');logger[_0xe9bb('0x13')](_0xe9bb('0x14'),_0x2e8fdd,'request\x20sent',JSON['stringify'](_0x12ecd1));if(_0x12ecd1[_0xe9bb('0x15')]){if(_0x12ecd1[_0xe9bb('0x15')]['code']===0x1f4){logger[_0xe9bb('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x2e8fdd,_0x12ecd1[_0xe9bb('0x15')][_0xe9bb('0x16')]);return _0x1f1dca(_0x12ecd1[_0xe9bb('0x15')][_0xe9bb('0x16')]);}logger[_0xe9bb('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x2e8fdd,_0x12ecd1[_0xe9bb('0x15')]['message']);return _0x104c0c(_0x12ecd1[_0xe9bb('0x15')][_0xe9bb('0x16')]);}else{logger[_0xe9bb('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2e8fdd,_0xe9bb('0x17'));_0x104c0c(_0x12ecd1[_0xe9bb('0x18')]['message']);}})['catch'](function(_0x4c87d0){logger['error'](_0xe9bb('0x19'),_0x2e8fdd,_0x4c87d0);_0x1f1dca(_0x4c87d0);});});}exports[_0xe9bb('0x1a')]=function(_0x557013){var _0x2ec355=this;return new Promise(function(_0x438835,_0x1195ed){return db['SmsInteraction'][_0xe9bb('0x1b')](_0x557013[_0xe9bb('0x1c')],{'raw':_0x557013[_0xe9bb('0x1d')]?_0x557013[_0xe9bb('0x1d')][_0xe9bb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x557013[_0xe9bb('0x1d')]?_0x557013['options'][_0xe9bb('0x1f')]||null:null,'attributes':_0x557013[_0xe9bb('0x1d')]?_0x557013[_0xe9bb('0x1d')]['attributes']||null:null,'limit':_0x557013[_0xe9bb('0x1d')]?_0x557013[_0xe9bb('0x1d')]['limit']||null:null})['then'](function(_0x7f83fa){logger[_0xe9bb('0x12')](_0xe9bb('0x1a'),_0x557013);logger[_0xe9bb('0x13')]('UpdateSmsInteraction',_0x557013,JSON['stringify'](_0x7f83fa));_0x438835(_0x7f83fa);})[_0xe9bb('0x20')](function(_0x253233){logger[_0xe9bb('0x15')](_0xe9bb('0x1a'),_0x253233['message'],_0x557013);_0x1195ed(_0x2ec355[_0xe9bb('0x15')](0x1f4,_0x253233[_0xe9bb('0x16')]));});});};exports[_0xe9bb('0x21')]=function(_0x3156cc){return new Promise(function(_0x4b16d8,_0x92d523){return db[_0xe9bb('0x22')]['find']({'where':_0x3156cc[_0xe9bb('0x1d')]?_0x3156cc[_0xe9bb('0x1d')][_0xe9bb('0x1f')]||null:null})[_0xe9bb('0x23')](function(_0x43131d){if(_0x43131d){return _0x43131d[_0xe9bb('0x24')](_0x3156cc[_0xe9bb('0x1c')]['ids'],_[_0xe9bb('0x25')](_0x3156cc[_0xe9bb('0x1c')],['ids','id'])||{});}})[_0xe9bb('0x26')](function(_0x437d56){logger['info']('AddTags',_0x3156cc);logger['debug']('AddTags',_0x3156cc,JSON['stringify'](_0x437d56));_0x4b16d8(_0x437d56);})[_0xe9bb('0x20')](function(_0x43a9f2){logger['error'](_0xe9bb('0x27'),_0x43a9f2[_0xe9bb('0x16')],_0x3156cc);_0x92d523(_this[_0xe9bb('0x15')](0x1f4,_0x43a9f2[_0xe9bb('0x16')]));});});};
\ No newline at end of file
index c38dd01..64fddb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe357=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x4cb835,_0x52236c){var _0x38f4e9=function(_0xddf85d){while(--_0xddf85d){_0x4cb835['push'](_0x4cb835['shift']());}};_0x38f4e9(++_0x52236c);}(_0xe357,0x132));var _0x7e35=function(_0x597e05,_0x10c7b9){_0x597e05=_0x597e05-0x0;var _0x2283b5=_0xe357[_0x597e05];return _0x2283b5;};'use strict';var SmsInteractionEvents=require(_0x7e35('0x0'));var events=[_0x7e35('0x1'),'remove','update'];function createListener(_0x26f9f4,_0x5f2412){return function(_0x1ed7f0){_0x5f2412[_0x7e35('0x2')](_0x26f9f4,_0x1ed7f0);};}function removeListener(_0x405754,_0x496364){return function(){SmsInteractionEvents[_0x7e35('0x3')](_0x405754,_0x496364);};}exports[_0x7e35('0x4')]=function(_0x1d786c){for(var _0x33bc3b=0x0,_0x40b42b=events[_0x7e35('0x5')];_0x33bc3b<_0x40b42b;_0x33bc3b++){var _0x43828e=events[_0x33bc3b];var _0x47cc7a=createListener(_0x7e35('0x6')+_0x43828e,_0x1d786c);SmsInteractionEvents['on'](_0x43828e,_0x47cc7a);}};
\ No newline at end of file
+var _0x2337=['register','length','smsInteraction:','./smsInteraction.events','emit'];(function(_0x127283,_0x29feee){var _0x113fd4=function(_0x1ce028){while(--_0x1ce028){_0x127283['push'](_0x127283['shift']());}};_0x113fd4(++_0x29feee);}(_0x2337,0x1f2));var _0x7233=function(_0x379cca,_0x58fdd3){_0x379cca=_0x379cca-0x0;var _0x560cd7=_0x2337[_0x379cca];return _0x560cd7;};'use strict';var SmsInteractionEvents=require(_0x7233('0x0'));var events=['save','remove','update'];function createListener(_0x3dd371,_0x721301){return function(_0x212790){_0x721301[_0x7233('0x1')](_0x3dd371,_0x212790);};}function removeListener(_0x15f7b9,_0x1dcfd8){return function(){SmsInteractionEvents['removeListener'](_0x15f7b9,_0x1dcfd8);};}exports[_0x7233('0x2')]=function(_0x4a254c){for(var _0x3d5670=0x0,_0x41b576=events[_0x7233('0x3')];_0x3d5670<_0x41b576;_0x3d5670++){var _0x5c2c8c=events[_0x3d5670];var _0x2186aa=createListener(_0x7233('0x4')+_0x5c2c8c,_0x4a254c);SmsInteractionEvents['on'](_0x5c2c8c,_0x2186aa);}};
\ No newline at end of file
index f7d55a1..6214d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1605=['reject','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','show','post','tracked','sms','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject'];(function(_0x54efa9,_0x8cf1a3){var _0x48b6c7=function(_0x4f59b2){while(--_0x4f59b2){_0x54efa9['push'](_0x54efa9['shift']());}};_0x48b6c7(++_0x8cf1a3);}(_0x1605,0x1d4));var _0x5160=function(_0x3076f0,_0x56a18d){_0x3076f0=_0x3076f0-0x0;var _0x512019=_0x1605[_0x3076f0];return _0x512019;};'use strict';var multer=require('multer');var util=require(_0x5160('0x0'));var path=require(_0x5160('0x1'));var timeout=require('connect-timeout');var express=require(_0x5160('0x2'));var router=express[_0x5160('0x3')]();var fs_extra=require(_0x5160('0x4'));var auth=require(_0x5160('0x5'));var interaction=require(_0x5160('0x6'));var config=require(_0x5160('0x7'));var controller=require(_0x5160('0x8'));router[_0x5160('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5160('0xa'),auth[_0x5160('0xb')](),controller[_0x5160('0xc')]);router[_0x5160('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5160('0xd')]);router[_0x5160('0xe')]('/',auth['isAuthenticated'](),interaction[_0x5160('0xf')](_0x5160('0x10'),_0x5160('0x11')),controller['create']);router[_0x5160('0xe')](_0x5160('0x12'),controller[_0x5160('0x13')]);router[_0x5160('0x14')]('/:id',auth[_0x5160('0xb')](),controller[_0x5160('0x15')]);router['put'](_0x5160('0x16'),auth[_0x5160('0xb')](),controller[_0x5160('0x17')]);router[_0x5160('0x14')](_0x5160('0x18'),auth[_0x5160('0xb')](),controller[_0x5160('0x19')]);router[_0x5160('0x1a')]('/:id',auth[_0x5160('0xb')](),controller[_0x5160('0x1b')]);module[_0x5160('0x1c')]=router;
\ No newline at end of file
+var _0xe7c2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','isAuthenticated','post','tracked','smsmessage:create','create','/:id/status','status','/:id','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path'];(function(_0x3cadf8,_0x107f92){var _0x374092=function(_0x33f37a){while(--_0x33f37a){_0x3cadf8['push'](_0x3cadf8['shift']());}};_0x374092(++_0x107f92);}(_0xe7c2,0xc8));var _0x2e7c=function(_0x4f2462,_0x5261a6){_0x4f2462=_0x4f2462-0x0;var _0x9b3daa=_0xe7c2[_0x4f2462];return _0x9b3daa;};'use strict';var multer=require(_0x2e7c('0x0'));var util=require(_0x2e7c('0x1'));var path=require(_0x2e7c('0x2'));var timeout=require(_0x2e7c('0x3'));var express=require(_0x2e7c('0x4'));var router=express[_0x2e7c('0x5')]();var fs_extra=require(_0x2e7c('0x6'));var auth=require(_0x2e7c('0x7'));var interaction=require(_0x2e7c('0x8'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x2e7c('0x9')]('/',auth['isAuthenticated'](),controller[_0x2e7c('0xa')]);router[_0x2e7c('0x9')](_0x2e7c('0xb'),auth['isAuthenticated'](),controller[_0x2e7c('0xc')]);router[_0x2e7c('0x9')]('/:id',auth[_0x2e7c('0xd')](),controller['show']);router[_0x2e7c('0xe')]('/',auth[_0x2e7c('0xd')](),interaction[_0x2e7c('0xf')]('sms',_0x2e7c('0x10')),controller[_0x2e7c('0x11')]);router['post'](_0x2e7c('0x12'),controller[_0x2e7c('0x13')]);router['put'](_0x2e7c('0x14'),auth[_0x2e7c('0xd')](),controller[_0x2e7c('0x15')]);router[_0x2e7c('0x16')](_0x2e7c('0x17'),auth[_0x2e7c('0xd')](),controller[_0x2e7c('0x18')]);router[_0x2e7c('0x16')](_0x2e7c('0x19'),auth[_0x2e7c('0xd')](),controller['reject']);router[_0x2e7c('0x1a')](_0x2e7c('0x14'),auth['isAuthenticated'](),controller[_0x2e7c('0x1b')]);module[_0x2e7c('0x1c')]=router;
\ No newline at end of file
index a7118c0..7bb55d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd790=['exports','TEXT','medium','ENUM','out','STRING','DATE','sequelize'];(function(_0x4b06eb,_0x58f98e){var _0x489f4a=function(_0x456e77){while(--_0x456e77){_0x4b06eb['push'](_0x4b06eb['shift']());}};_0x489f4a(++_0x58f98e);}(_0xd790,0xaf));var _0x0d79=function(_0x55c72d,_0x5d7876){_0x55c72d=_0x55c72d-0x0;var _0x3b64b6=_0xd790[_0x55c72d];return _0x3b64b6;};'use strict';var Sequelize=require(_0x0d79('0x0'));module[_0x0d79('0x1')]={'body':{'type':Sequelize[_0x0d79('0x2')](_0x0d79('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0d79('0x4')]('in',_0x0d79('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0d79('0x6')]},'readAt':{'type':Sequelize[_0x0d79('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xaeab=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT'];(function(_0x496cba,_0x92dd1f){var _0x248927=function(_0x364ffd){while(--_0x364ffd){_0x496cba['push'](_0x496cba['shift']());}};_0x248927(++_0x92dd1f);}(_0xaeab,0x91));var _0xbaea=function(_0x389b22,_0x4b1150){_0x389b22=_0x389b22-0x0;var _0x29fff2=_0xaeab[_0x389b22];return _0x29fff2;};'use strict';var Sequelize=require(_0xbaea('0x0'));module['exports']={'body':{'type':Sequelize[_0xbaea('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbaea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbaea('0x3')]('in',_0xbaea('0x4')),'defaultValue':_0xbaea('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbaea('0x5')](0xbe)},'phone':{'type':Sequelize[_0xbaea('0x5')]},'readAt':{'type':Sequelize[_0xbaea('0x6')]},'secret':{'type':Sequelize[_0xbaea('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbaea('0x5')]},'providerResponse':{'type':Sequelize[_0xbaea('0x1')]}};
\ No newline at end of file
index ddf0881..e70106b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9972=['SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','map','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','options','where','include','findAll','rows','show','find','create','body','params','describe','../../config/logger','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','email','internal','rejectmessage','SmsAccount'];(function(_0x219a5f,_0x484570){var _0x1d6398=function(_0x377347){while(--_0x377347){_0x219a5f['push'](_0x219a5f['shift']());}};_0x1d6398(++_0x484570);}(_0x9972,0xaa));var _0x2997=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9972[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x2997('0x0'));var rimraf=require(_0x2997('0x1'));var zipdir=require(_0x2997('0x2'));var jsonpatch=require(_0x2997('0x3'));var rp=require('request-promise');var moment=require(_0x2997('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2997('0x5'));var util=require('util');var path=require(_0x2997('0x6'));var sox=require(_0x2997('0x7'));var csv=require('to-csv');var ejs=require(_0x2997('0x8'));var fs=require('fs');var fs_extra=require(_0x2997('0x9'));var _=require(_0x2997('0xa'));var squel=require('squel');var crypto=require(_0x2997('0xb'));var jsforce=require(_0x2997('0xc'));var deskjs=require(_0x2997('0xd'));var toCsv=require(_0x2997('0xe'));var querystring=require(_0x2997('0xf'));var Papa=require(_0x2997('0x10'));var Redis=require('ioredis');var authService=require(_0x2997('0x11'));var qs=require(_0x2997('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2997('0x13'));var logger=require('../../config/logger')(_0x2997('0x14'));var utils=require('../../config/utils');var config=require(_0x2997('0x15'));var licenseUtil=require(_0x2997('0x16'));var db=require(_0x2997('0x17'))['db'];config['redis']=_[_0x2997('0x18')](config[_0x2997('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2997('0x1a'))(new Redis(config[_0x2997('0x19')]));require(_0x2997('0x1b'))[_0x2997('0x1c')](socket);var jayson=require(_0x2997('0x1d'));var client=jayson[_0x2997('0x1e')][_0x2997('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x2997('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x11f5df,_0xd3251c,_0x48bee9,_0x3f147b){return new BPromise(function(_0x2c65d1,_0x400fbf){var _0x42c3e4=_0x3f147b||client;return _0x42c3e4[_0x2997('0x20')](_0x11f5df,_0x48bee9)['then'](function(_0x22746a){logger['info'](_0x2997('0x21'),_0xd3251c,_0x2997('0x22'));logger['debug'](_0x2997('0x23'),_0xd3251c,_0x2997('0x22'),JSON[_0x2997('0x24')](_0x22746a));if(_0x22746a[_0x2997('0x25')]){if(_0x22746a['error'][_0x2997('0x26')]===0x1f4){logger[_0x2997('0x25')](_0x2997('0x21'),_0xd3251c,_0x22746a[_0x2997('0x25')]['message']);return _0x400fbf(_0x22746a['error'][_0x2997('0x27')]);}logger[_0x2997('0x25')](_0x2997('0x21'),_0xd3251c,_0x22746a['error']['message']);return _0x2c65d1(_0x22746a[_0x2997('0x25')][_0x2997('0x27')]);}else{logger[_0x2997('0x28')](_0x2997('0x21'),_0xd3251c,_0x2997('0x22'));_0x2c65d1(_0x22746a[_0x2997('0x29')][_0x2997('0x27')]);}})[_0x2997('0x2a')](function(_0x2510b2){logger[_0x2997('0x25')](_0x2997('0x21'),_0xd3251c,_0x2510b2);_0x400fbf(_0x2510b2);});});}function respondWithStatusCode(_0x56eebd,_0x4396be){_0x4396be=_0x4396be||0xcc;return function(_0x4f4fef){if(_0x4f4fef){return _0x56eebd[_0x2997('0x2b')](_0x4396be);}return _0x56eebd[_0x2997('0x2c')](_0x4396be)[_0x2997('0x2d')]();};}function respondWithResult(_0x1da661,_0x33f9f7){_0x33f9f7=_0x33f9f7||0xc8;return function(_0x587bc6){if(_0x587bc6){return _0x1da661[_0x2997('0x2c')](_0x33f9f7)['json'](_0x587bc6);}};}function respondWithFilteredResult(_0x24b27a,_0x1f088e){return function(_0x5d0bb5){if(_0x5d0bb5){var _0x5d5d59=typeof _0x1f088e[_0x2997('0x2e')]===_0x2997('0x2f')&&typeof _0x1f088e[_0x2997('0x30')]===_0x2997('0x2f');var _0x5bd487=_0x5d0bb5[_0x2997('0x31')];var _0x4a89cf=_0x5d5d59?0x0:_0x1f088e[_0x2997('0x2e')];var _0x53caf3=_0x5d5d59?_0x5d0bb5['count']:_0x1f088e['offset']+_0x1f088e[_0x2997('0x30')];var _0x51827e;if(_0x53caf3>=_0x5bd487){_0x53caf3=_0x5bd487;_0x51827e=0xc8;}else{_0x51827e=0xce;}_0x24b27a[_0x2997('0x2c')](_0x51827e);return _0x24b27a[_0x2997('0x32')]('Content-Range',_0x4a89cf+'-'+_0x53caf3+'/'+_0x5bd487)['json'](_0x5d0bb5);}return null;};}function patchUpdates(_0x2f01d6){return function(_0x3360d7){try{jsonpatch[_0x2997('0x33')](_0x3360d7,_0x2f01d6,!![]);}catch(_0x17beb0){return BPromise[_0x2997('0x34')](_0x17beb0);}return _0x3360d7[_0x2997('0x35')]();};}function saveUpdates(_0x37ec69,_0x3c0c91){return function(_0x2e2200){if(_0x2e2200){return _0x2e2200[_0x2997('0x36')](_0x37ec69)[_0x2997('0x37')](function(_0x5b1939){return _0x5b1939;});}return null;};}function removeEntity(_0x50be57,_0x4dad87){return function(_0x288903){if(_0x288903){return _0x288903[_0x2997('0x38')]()[_0x2997('0x37')](function(){_0x50be57[_0x2997('0x2c')](0xcc)[_0x2997('0x2d')]();});}};}function handleEntityNotFound(_0x389c2f,_0x1cac00){return function(_0x1c5a05){if(!_0x1c5a05){_0x389c2f[_0x2997('0x2b')](0x194);}return _0x1c5a05;};}function handleError(_0x70cb74,_0x55751f){_0x55751f=_0x55751f||0x1f4;return function(_0x53f453){logger[_0x2997('0x25')](_0x53f453[_0x2997('0x39')]);if(_0x53f453[_0x2997('0x3a')]){delete _0x53f453[_0x2997('0x3a')];}_0x70cb74['status'](_0x55751f)[_0x2997('0x3b')](_0x53f453);};}exports[_0x2997('0x3c')]=function(_0x4cf7ae,_0x39dae2){var _0x59d7da={},_0xce691={},_0x296292={'count':0x0,'rows':[]};var _0xdac601=_['map'](db[_0x2997('0x3d')][_0x2997('0x3e')],function(_0x9f69d7){return{'name':_0x9f69d7[_0x2997('0x3f')],'type':_0x9f69d7[_0x2997('0x40')]['key']};});_0xce691['model']=_[_0x2997('0x41')](_0xdac601,'name');_0xce691[_0x2997('0x42')]=_[_0x2997('0x43')](_0x4cf7ae[_0x2997('0x42')]);_0xce691['filters']=_['intersection'](_0xce691['model'],_0xce691[_0x2997('0x42')]);_0x59d7da[_0x2997('0x44')]=_[_0x2997('0x45')](_0xce691[_0x2997('0x46')],qs[_0x2997('0x47')](_0x4cf7ae[_0x2997('0x42')][_0x2997('0x47')]));_0x59d7da['attributes']=_0x59d7da[_0x2997('0x44')][_0x2997('0x48')]?_0x59d7da[_0x2997('0x44')]:_0xce691['model'];if(!_0x4cf7ae[_0x2997('0x42')][_0x2997('0x49')](_0x2997('0x4a'))){_0x59d7da[_0x2997('0x30')]=qs[_0x2997('0x30')](_0x4cf7ae[_0x2997('0x42')][_0x2997('0x30')]);_0x59d7da[_0x2997('0x2e')]=qs[_0x2997('0x2e')](_0x4cf7ae['query'][_0x2997('0x2e')]);}_0x59d7da[_0x2997('0x4b')]=qs[_0x2997('0x4c')](_0x4cf7ae[_0x2997('0x42')]['sort']);_0x59d7da['where']=qs[_0x2997('0x4d')](_[_0x2997('0x4e')](_0x4cf7ae[_0x2997('0x42')],_0xce691['filters']),_0xdac601);if(_0x4cf7ae[_0x2997('0x42')][_0x2997('0x4f')]){_0x59d7da['where']=_[_0x2997('0x50')](_0x59d7da['where'],{'$or':_['map'](_0xdac601,function(_0x3029f7){if(_0x3029f7[_0x2997('0x40')]!=='VIRTUAL'){var _0x189048={};_0x189048[_0x3029f7['name']]={'$like':'%'+_0x4cf7ae['query'][_0x2997('0x4f')]+'%'};return _0x189048;}})});}_0x59d7da=_[_0x2997('0x50')]({},_0x59d7da,_0x4cf7ae[_0x2997('0x51')]);var _0x5ac950={'where':_0x59d7da[_0x2997('0x52')]};return db[_0x2997('0x3d')][_0x2997('0x31')](_0x5ac950)[_0x2997('0x37')](function(_0x108be9){_0x296292['count']=_0x108be9;if(_0x4cf7ae['query']['includeAll']){_0x59d7da[_0x2997('0x53')]=[{'all':!![]}];}return db[_0x2997('0x3d')][_0x2997('0x54')](_0x59d7da);})[_0x2997('0x37')](function(_0x18f95f){_0x296292[_0x2997('0x55')]=_0x18f95f;return _0x296292;})['then'](respondWithFilteredResult(_0x39dae2,_0x59d7da))[_0x2997('0x2a')](handleError(_0x39dae2,null));};exports[_0x2997('0x56')]=function(_0xf58df5,_0x4c9350){var _0x296be3={'raw':!![],'where':{'id':_0xf58df5['params']['id']}},_0x1e33b5={};_0x1e33b5['model']=_[_0x2997('0x43')](db[_0x2997('0x3d')][_0x2997('0x3e')]);_0x1e33b5[_0x2997('0x42')]=_[_0x2997('0x43')](_0xf58df5['query']);_0x1e33b5[_0x2997('0x4d')]=_[_0x2997('0x45')](_0x1e33b5[_0x2997('0x46')],_0x1e33b5[_0x2997('0x42')]);_0x296be3[_0x2997('0x44')]=_[_0x2997('0x45')](_0x1e33b5[_0x2997('0x46')],qs[_0x2997('0x47')](_0xf58df5[_0x2997('0x42')][_0x2997('0x47')]));_0x296be3['attributes']=_0x296be3[_0x2997('0x44')]['length']?_0x296be3[_0x2997('0x44')]:_0x1e33b5[_0x2997('0x46')];if(_0xf58df5[_0x2997('0x42')]['includeAll']){_0x296be3[_0x2997('0x53')]=[{'all':!![]}];}_0x296be3=_[_0x2997('0x50')]({},_0x296be3,_0xf58df5[_0x2997('0x51')]);return db[_0x2997('0x3d')][_0x2997('0x57')](_0x296be3)[_0x2997('0x37')](handleEntityNotFound(_0x4c9350,null))['then'](respondWithResult(_0x4c9350,null))[_0x2997('0x2a')](handleError(_0x4c9350,null));};exports['create']=function(_0x2ac2f3,_0x139528){return db['SmsMessage'][_0x2997('0x58')](_0x2ac2f3['body'],{})['then'](respondWithResult(_0x139528,0xc9))[_0x2997('0x2a')](handleError(_0x139528,null));};exports['update']=function(_0x853b4d,_0x5a9540){if(_0x853b4d[_0x2997('0x59')]['id']){delete _0x853b4d[_0x2997('0x59')]['id'];}return db[_0x2997('0x3d')][_0x2997('0x57')]({'where':{'id':_0x853b4d[_0x2997('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5a9540,null))[_0x2997('0x37')](saveUpdates(_0x853b4d[_0x2997('0x59')],null))[_0x2997('0x37')](respondWithResult(_0x5a9540,null))[_0x2997('0x2a')](handleError(_0x5a9540,null));};exports[_0x2997('0x38')]=function(_0x1c4fad,_0x26dad7){return db[_0x2997('0x3d')]['find']({'where':{'id':_0x1c4fad['params']['id']}})[_0x2997('0x37')](handleEntityNotFound(_0x26dad7,null))[_0x2997('0x37')](removeEntity(_0x26dad7,null))[_0x2997('0x2a')](handleError(_0x26dad7,null));};exports[_0x2997('0x5b')]=function(_0x9358e7,_0x1a3b3e){return db[_0x2997('0x3d')][_0x2997('0x5b')]()[_0x2997('0x37')](respondWithResult(_0x1a3b3e,null))[_0x2997('0x2a')](handleError(_0x1a3b3e,null));};var interaction_log=require(_0x2997('0x5c'))(_0x2997('0x5d'));exports[_0x2997('0x5e')]=function(_0x3952bc,_0x3c4c09,_0x135854){var _0x3b637a={'agent':{},'channel':'sms'};if(_0x3952bc['body']['id']){delete _0x3952bc[_0x2997('0x59')]['id'];}_0x3952bc[_0x2997('0x59')][_0x2997('0x5f')]=!![];_0x3952bc['body']['readAt']=moment()[_0x2997('0x60')](_0x2997('0x61'));_0x3952bc[_0x2997('0x59')][_0x2997('0x62')]=_0x3952bc[_0x2997('0x59')][_0x2997('0x62')]||_0x3952bc[_0x2997('0x63')]['id'];_0x3b637a[_0x2997('0x64')]['id']=_0x3952bc[_0x2997('0x59')][_0x2997('0x62')];return db[_0x2997('0x3d')][_0x2997('0x57')]({'where':{'id':_0x3952bc[_0x2997('0x5a')]['id'],'UserId':null}})[_0x2997('0x37')](handleEntityNotFound(_0x3c4c09,null))[_0x2997('0x37')](saveUpdates(_0x3952bc[_0x2997('0x59')],null))[_0x2997('0x37')](function(_0x531ba2){if(_0x531ba2){_0x3b637a[_0x2997('0x27')]=_0x531ba2[_0x2997('0x65')]({'plain':!![]});return db[_0x2997('0x66')][_0x2997('0x57')]({'where':{'id':_0x531ba2[_0x2997('0x67')]}});}return null;})[_0x2997('0x37')](handleEntityNotFound(_0x3c4c09,null))[_0x2997('0x37')](function(_0x1a6c17){if(_0x1a6c17){return _0x1a6c17[_0x2997('0x36')]({'UserId':_0x3952bc['body'][_0x2997('0x62')],'read1stAt':_[_0x2997('0x68')](_0x1a6c17['read1stAt'])?moment()[_0x2997('0x60')](_0x2997('0x61')):undefined});}return null;})['then'](function(_0x3b114e){if(_0x3b114e){_0x3b637a[_0x2997('0x69')]=_0x3b114e['get']({'plain':!![]});interaction_log[_0x2997('0x28')](_0x2997('0x6a'),_0x3952bc[_0x2997('0x63')]['id'],_0x3952bc['user'][_0x2997('0x3a')],_0x3952bc[_0x2997('0x63')]['role'],_0x3b637a['interaction']['id'],_0x3952bc[_0x2997('0x59')]?JSON[_0x2997('0x24')](_0x3952bc['body']):_0x2997('0x6b'));return respondWithRpcPromise(_0x2997('0x6c'),_0x2997('0x6d'),_0x3b637a);}return null;})[_0x2997('0x37')](function(_0x197b22){var _0x47a274='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x197b22[_0x2997('0x27')][_0x2997('0x6e')];return db[_0x2997('0x6f')][_0x2997('0x42')](_0x47a274,{'type':db[_0x2997('0x70')][_0x2997('0x71')]['SELECT'],'raw':!![]})[_0x2997('0x37')](function(_0x4f738d){return _0x4f738d;});})[_0x2997('0x37')](function(_0x3eba55){if(_0x3eba55){_0x3b637a['message']['contact']=_0x3eba55[0x0];if(!_0x3952bc['body'][_0x2997('0x62')])return;return db[_0x2997('0x72')][_0x2997('0x57')]({'where':{'id':_0x3952bc[_0x2997('0x59')]['UserId'],'role':_0x2997('0x64')},'attributes':['id',_0x2997('0x3a'),_0x2997('0x73'),'email','internal'],'raw':!![]});}return null;})[_0x2997('0x37')](function(_0x5dba2a){if(!_0x5dba2a)return null;_0x3b637a[_0x2997('0x27')]['agent']=_0x5dba2a;return _0x3b637a;})[_0x2997('0x37')](function(_0x246183){if(_0x246183){if(_0x3952bc[_0x2997('0x59')][_0x2997('0x74')]){_0x3b637a[_0x2997('0x27')][_0x2997('0x75')]=util[_0x2997('0x60')](_0x2997('0x76'),_0x3952bc[_0x2997('0x63')]['name']);_0x3b637a[_0x2997('0x27')][_0x2997('0x77')]=_0x3b637a[_0x2997('0x77')];_0x3b637a[_0x2997('0x27')][_0x2997('0x78')]=_0x3b637a[_0x2997('0x77')];_0x3b637a[_0x2997('0x27')][_0x2997('0x79')]=_0x2997('0x5e');return respondWithRpcPromise(_0x2997('0x7a'),_0x2997('0x7a'),{'event':_0x2997('0x7b'),'message':_0x3b637a[_0x2997('0x27')]},client9002)['then'](function(){return _0x3b637a;});}return _0x3b637a;}return null;})['then'](respondWithResult(_0x3c4c09,null))[_0x2997('0x2a')](handleError(_0x3c4c09,null));};var interaction_log=require(_0x2997('0x5c'))(_0x2997('0x5d'));exports[_0x2997('0x34')]=function(_0x4e2482,_0x19e69b,_0x5629fa){var _0x2cf9f4={'agent':{},'channel':_0x2997('0x7c')};if(_0x4e2482[_0x2997('0x59')]['id']){delete _0x4e2482[_0x2997('0x59')]['id'];}_0x4e2482[_0x2997('0x59')][_0x2997('0x62')]=_0x4e2482[_0x2997('0x59')][_0x2997('0x62')]||_0x4e2482[_0x2997('0x63')]['id'];_0x2cf9f4[_0x2997('0x64')]['id']=_0x4e2482[_0x2997('0x59')]['UserId'];return db['SmsMessage'][_0x2997('0x57')]({'where':{'id':_0x4e2482['params']['id'],'UserId':null}})[_0x2997('0x37')](handleEntityNotFound(_0x19e69b,null))[_0x2997('0x37')](function(_0x4d06c3){if(_0x4d06c3){_0x2cf9f4[_0x2997('0x27')]=_0x4d06c3[_0x2997('0x65')]({'plain':!![]});return db[_0x2997('0x66')][_0x2997('0x57')]({'where':{'id':_0x4d06c3[_0x2997('0x67')]}});}return null;})[_0x2997('0x37')](handleEntityNotFound(_0x19e69b,null))[_0x2997('0x37')](function(_0x5660b0){if(_0x5660b0){_0x2cf9f4[_0x2997('0x69')]=_0x5660b0[_0x2997('0x65')]({'plain':!![]});interaction_log['info'](_0x2997('0x7d'),_0x4e2482[_0x2997('0x63')]['id'],_0x4e2482[_0x2997('0x63')][_0x2997('0x3a')],_0x4e2482[_0x2997('0x63')][_0x2997('0x7e')],_0x2cf9f4['interaction']['id'],_0x4e2482[_0x2997('0x59')]?JSON[_0x2997('0x24')](_0x4e2482[_0x2997('0x59')]):_0x2997('0x6b'));return respondWithRpcPromise(_0x2997('0x7f'),'rejectMessage',_0x2cf9f4);}return null;})[_0x2997('0x37')](function(_0xf57ba){var _0x1da86b=_0x2997('0x80')+_0xf57ba[_0x2997('0x27')][_0x2997('0x6e')];return db[_0x2997('0x6f')]['query'](_0x1da86b,{'type':db[_0x2997('0x70')][_0x2997('0x71')][_0x2997('0x81')],'raw':!![]})[_0x2997('0x37')](function(_0x2af888){return _0x2af888;});})[_0x2997('0x37')](function(_0x48ee9f){if(_0x48ee9f){_0x2cf9f4[_0x2997('0x27')]['contact']=_0x48ee9f[0x0];if(!_0x4e2482['body'][_0x2997('0x62')])return;return db['User']['find']({'where':{'id':_0x4e2482[_0x2997('0x59')][_0x2997('0x62')],'role':'agent'},'attributes':['id',_0x2997('0x3a'),_0x2997('0x73'),_0x2997('0x82'),_0x2997('0x83')],'raw':!![]});}return null;})[_0x2997('0x37')](function(_0x4b02eb){if(!_0x4b02eb)return null;_0x2cf9f4[_0x2997('0x27')][_0x2997('0x64')]=_0x4b02eb;return _0x2cf9f4;})[_0x2997('0x37')](function(_0x48abd8){if(_0x48abd8){_0x48abd8[_0x2997('0x27')][_0x2997('0x75')]=util['format'](_0x2997('0x76'),_0x4e2482[_0x2997('0x63')][_0x2997('0x3a')]);_0x48abd8['message'][_0x2997('0x77')]=_0x2cf9f4[_0x2997('0x77')];_0x48abd8[_0x2997('0x27')][_0x2997('0x78')]=_0x2cf9f4[_0x2997('0x77')];_0x48abd8[_0x2997('0x27')][_0x2997('0x79')]=_0x2997('0x34');respondWithRpcPromise(_0x2997('0x7a'),_0x2997('0x7a'),{'event':_0x2997('0x84'),'message':_0x48abd8[_0x2997('0x27')]},client9002);return _0x2cf9f4;}return null;})['then'](respondWithResult(_0x19e69b,null))['catch'](handleError(_0x19e69b,null));};exports[_0x2997('0x2c')]=function(_0x433671,_0x2b5bd5,_0x4be5d4){if(_0x433671[_0x2997('0x59')]['id']){delete _0x433671['body']['id'];}var _0x1d329b;return db['SmsMessage'][_0x2997('0x57')]({'where':{'id':_0x433671[_0x2997('0x5a')]['id']}})[_0x2997('0x37')](handleEntityNotFound(_0x2b5bd5,null))[_0x2997('0x37')](function(_0x277be5){if(_0x277be5){_0x1d329b=_0x277be5;return db[_0x2997('0x85')][_0x2997('0x57')]({'where':{'id':_0x277be5[_0x2997('0x86')]}});}})[_0x2997('0x37')](handleEntityNotFound(_0x2b5bd5,null))[_0x2997('0x37')](function(_0x260d1a){if(_0x260d1a){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2997('0x2c'),_0x2997('0x87'),_0x260d1a[_0x2997('0x40')],util['inspect'](_0x433671[_0x2997('0x59')],{'showHidden':![],'depth':null}));switch(_0x260d1a[_0x2997('0x40')]){case _0x2997('0x88'):if(_0x433671['body'][_0x2997('0x89')]&&_0x433671[_0x2997('0x59')][_0x2997('0x89')]===_0x1d329b[_0x2997('0x8a')]){return _0x1d329b[_0x2997('0x36')]({'read':!![]});}else{logger[_0x2997('0x25')](_0x2997('0x8b'),'status',_0x2997('0x88'),util[_0x2997('0x8c')](_0x433671['body'],{'showHidden':![],'depth':null}));}break;case _0x2997('0x8d'):if(_0x433671[_0x2997('0x59')][_0x2997('0x8e')]&&_0x433671[_0x2997('0x59')][_0x2997('0x8e')]===_0x1d329b[_0x2997('0x8a')]&&_[_0x2997('0x8f')]([_0x2997('0x90'),_0x2997('0x91')],_0x433671[_0x2997('0x59')][_0x2997('0x92')])>=0x0){return _0x1d329b[_0x2997('0x36')]({'read':!![]});}else{logger[_0x2997('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2997('0x2c'),_0x2997('0x93'),util[_0x2997('0x8c')](_0x433671[_0x2997('0x59')],{'showHidden':![],'depth':null}));}break;case _0x2997('0x94'):var _0x4fb9c2=_0x433671['body'][_0x2997('0x95')][0x0];if(_0x4fb9c2[_0x2997('0x2c')][_0x2997('0x96')]===_0x2997('0x97')){return _0x1d329b[_0x2997('0x36')]({'read':!![]});}else{logger[_0x2997('0x25')](_0x2997('0x8b'),_0x2997('0x2c'),_0x2997('0x94'),util[_0x2997('0x8c')](_0x433671['body'],{'showHidden':![],'depth':null}));}break;}return _0x1d329b;}})[_0x2997('0x37')](respondWithResult(_0x2b5bd5,null))[_0x2997('0x2a')](handleError(_0x2b5bd5,null));};
\ No newline at end of file
+var _0x28cd=['destroy','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','SmsMessage','findAll','rows','catch','params','includeAll','options','create','body','find','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteractionId','read1stAt','[SMSMESSAGE: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','User','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','fullname','email','interface','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','groupName','DELIVERED','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update'];(function(_0x3edda6,_0x27e84e){var _0x12d429=function(_0x20fbae){while(--_0x20fbae){_0x3edda6['push'](_0x3edda6['shift']());}};_0x12d429(++_0x27e84e);}(_0x28cd,0x177));var _0xd28c=function(_0x1acb6c,_0x5decee){_0x1acb6c=_0x1acb6c-0x0;var _0x51e28b=_0x28cd[_0x1acb6c];return _0x51e28b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd28c('0x0'));var jsonpatch=require(_0xd28c('0x1'));var rp=require(_0xd28c('0x2'));var moment=require(_0xd28c('0x3'));var BPromise=require(_0xd28c('0x4'));var Mustache=require(_0xd28c('0x5'));var util=require(_0xd28c('0x6'));var path=require(_0xd28c('0x7'));var sox=require(_0xd28c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd28c('0x9'));var squel=require(_0xd28c('0xa'));var crypto=require(_0xd28c('0xb'));var jsforce=require(_0xd28c('0xc'));var deskjs=require(_0xd28c('0xd'));var toCsv=require(_0xd28c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd28c('0xf'));var authService=require(_0xd28c('0x10'));var qs=require(_0xd28c('0x11'));var as=require(_0xd28c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd28c('0x13'))(_0xd28c('0x14'));var utils=require(_0xd28c('0x15'));var config=require(_0xd28c('0x16'));var licenseUtil=require(_0xd28c('0x17'));var db=require(_0xd28c('0x18'))['db'];config['redis']=_[_0xd28c('0x19')](config[_0xd28c('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd28c('0x1a')]));require('./smsMessage.socket')[_0xd28c('0x1b')](socket);var jayson=require(_0xd28c('0x1c'));var client=jayson[_0xd28c('0x1d')][_0xd28c('0x1e')]({'port':0x232c});var client9002=jayson[_0xd28c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41565,_0x6cf0cf,_0xdf604d,_0x6046fb){return new BPromise(function(_0x217e56,_0x1d3968){var _0xa336a9=_0x6046fb||client;return _0xa336a9[_0xd28c('0x1f')](_0x41565,_0xdf604d)[_0xd28c('0x20')](function(_0xc9de51){logger[_0xd28c('0x21')](_0xd28c('0x22'),_0x6cf0cf,_0xd28c('0x23'));logger[_0xd28c('0x24')](_0xd28c('0x25'),_0x6cf0cf,_0xd28c('0x23'),JSON[_0xd28c('0x26')](_0xc9de51));if(_0xc9de51['error']){if(_0xc9de51[_0xd28c('0x27')][_0xd28c('0x28')]===0x1f4){logger['error'](_0xd28c('0x22'),_0x6cf0cf,_0xc9de51[_0xd28c('0x27')][_0xd28c('0x29')]);return _0x1d3968(_0xc9de51[_0xd28c('0x27')][_0xd28c('0x29')]);}logger[_0xd28c('0x27')](_0xd28c('0x22'),_0x6cf0cf,_0xc9de51[_0xd28c('0x27')][_0xd28c('0x29')]);return _0x217e56(_0xc9de51[_0xd28c('0x27')][_0xd28c('0x29')]);}else{logger[_0xd28c('0x21')](_0xd28c('0x22'),_0x6cf0cf,_0xd28c('0x23'));_0x217e56(_0xc9de51['result']['message']);}})['catch'](function(_0xc4b0a1){logger[_0xd28c('0x27')](_0xd28c('0x22'),_0x6cf0cf,_0xc4b0a1);_0x1d3968(_0xc4b0a1);});});}function respondWithStatusCode(_0x5d2af9,_0x179c14){_0x179c14=_0x179c14||0xcc;return function(_0x4f636b){if(_0x4f636b){return _0x5d2af9[_0xd28c('0x2a')](_0x179c14);}return _0x5d2af9['status'](_0x179c14)[_0xd28c('0x2b')]();};}function respondWithResult(_0x40f907,_0x29f764){_0x29f764=_0x29f764||0xc8;return function(_0x49e545){if(_0x49e545){return _0x40f907[_0xd28c('0x2c')](_0x29f764)[_0xd28c('0x2d')](_0x49e545);}};}function respondWithFilteredResult(_0x51d60e,_0x1281b0){return function(_0x27e322){if(_0x27e322){var _0x23d24f=typeof _0x1281b0[_0xd28c('0x2e')]===_0xd28c('0x2f')&&typeof _0x1281b0[_0xd28c('0x30')]===_0xd28c('0x2f');var _0x2f2c77=_0x27e322[_0xd28c('0x31')];var _0x286af6=_0x23d24f?0x0:_0x1281b0[_0xd28c('0x2e')];var _0x131723=_0x23d24f?_0x27e322['count']:_0x1281b0[_0xd28c('0x2e')]+_0x1281b0['limit'];var _0x191d7a;if(_0x131723>=_0x2f2c77){_0x131723=_0x2f2c77;_0x191d7a=0xc8;}else{_0x191d7a=0xce;}_0x51d60e[_0xd28c('0x2c')](_0x191d7a);return _0x51d60e['set'](_0xd28c('0x32'),_0x286af6+'-'+_0x131723+'/'+_0x2f2c77)[_0xd28c('0x2d')](_0x27e322);}return null;};}function patchUpdates(_0x26b803){return function(_0x391104){try{jsonpatch[_0xd28c('0x33')](_0x391104,_0x26b803,!![]);}catch(_0x2bc071){return BPromise[_0xd28c('0x34')](_0x2bc071);}return _0x391104['save']();};}function saveUpdates(_0x34fc1b,_0x3a0b4d){return function(_0x4e428d){if(_0x4e428d){return _0x4e428d[_0xd28c('0x35')](_0x34fc1b)[_0xd28c('0x20')](function(_0x3305f1){return _0x3305f1;});}return null;};}function removeEntity(_0x31fdfd,_0x55e777){return function(_0x34d2f8){if(_0x34d2f8){return _0x34d2f8[_0xd28c('0x36')]()[_0xd28c('0x20')](function(){_0x31fdfd['status'](0xcc)[_0xd28c('0x2b')]();});}};}function handleEntityNotFound(_0x282d8,_0x201afd){return function(_0x31eb05){if(!_0x31eb05){_0x282d8[_0xd28c('0x2a')](0x194);}return _0x31eb05;};}function handleError(_0x2729b6,_0x3ef82e){_0x3ef82e=_0x3ef82e||0x1f4;return function(_0x2c3ff){logger[_0xd28c('0x27')](_0x2c3ff[_0xd28c('0x37')]);if(_0x2c3ff[_0xd28c('0x38')]){delete _0x2c3ff[_0xd28c('0x38')];}_0x2729b6[_0xd28c('0x2c')](_0x3ef82e)['send'](_0x2c3ff);};}exports['index']=function(_0x53545b,_0x15b32b){var _0x29b17b={},_0x5ce586={},_0x37e858={'count':0x0,'rows':[]};var _0x49f168=_[_0xd28c('0x39')](db['SmsMessage'][_0xd28c('0x3a')],function(_0x46af9f){return{'name':_0x46af9f['fieldName'],'type':_0x46af9f[_0xd28c('0x3b')][_0xd28c('0x3c')]};});_0x5ce586[_0xd28c('0x3d')]=_[_0xd28c('0x39')](_0x49f168,_0xd28c('0x38'));_0x5ce586[_0xd28c('0x3e')]=_[_0xd28c('0x3f')](_0x53545b[_0xd28c('0x3e')]);_0x5ce586[_0xd28c('0x40')]=_[_0xd28c('0x41')](_0x5ce586[_0xd28c('0x3d')],_0x5ce586[_0xd28c('0x3e')]);_0x29b17b[_0xd28c('0x42')]=_[_0xd28c('0x41')](_0x5ce586[_0xd28c('0x3d')],qs['fields'](_0x53545b[_0xd28c('0x3e')][_0xd28c('0x43')]));_0x29b17b[_0xd28c('0x42')]=_0x29b17b[_0xd28c('0x42')][_0xd28c('0x44')]?_0x29b17b['attributes']:_0x5ce586[_0xd28c('0x3d')];if(!_0x53545b['query'][_0xd28c('0x45')](_0xd28c('0x46'))){_0x29b17b[_0xd28c('0x30')]=qs[_0xd28c('0x30')](_0x53545b[_0xd28c('0x3e')]['limit']);_0x29b17b[_0xd28c('0x2e')]=qs[_0xd28c('0x2e')](_0x53545b[_0xd28c('0x3e')]['offset']);}_0x29b17b[_0xd28c('0x47')]=qs[_0xd28c('0x48')](_0x53545b['query'][_0xd28c('0x48')]);_0x29b17b[_0xd28c('0x49')]=qs[_0xd28c('0x40')](_['pick'](_0x53545b['query'],_0x5ce586[_0xd28c('0x40')]),_0x49f168);if(_0x53545b['query'][_0xd28c('0x4a')]){_0x29b17b['where']=_[_0xd28c('0x4b')](_0x29b17b[_0xd28c('0x49')],{'$or':_[_0xd28c('0x39')](_0x49f168,function(_0x408a6){if(_0x408a6[_0xd28c('0x3b')]!==_0xd28c('0x4c')){var _0x514d5b={};_0x514d5b[_0x408a6['name']]={'$like':'%'+_0x53545b['query'][_0xd28c('0x4a')]+'%'};return _0x514d5b;}})});}_0x29b17b=_['merge']({},_0x29b17b,_0x53545b['options']);var _0xe38a72={'where':_0x29b17b['where']};return db['SmsMessage']['count'](_0xe38a72)[_0xd28c('0x20')](function(_0x3c36b6){_0x37e858[_0xd28c('0x31')]=_0x3c36b6;if(_0x53545b['query']['includeAll']){_0x29b17b[_0xd28c('0x4d')]=[{'all':!![]}];}return db[_0xd28c('0x4e')][_0xd28c('0x4f')](_0x29b17b);})[_0xd28c('0x20')](function(_0x1b1158){_0x37e858[_0xd28c('0x50')]=_0x1b1158;return _0x37e858;})['then'](respondWithFilteredResult(_0x15b32b,_0x29b17b))[_0xd28c('0x51')](handleError(_0x15b32b,null));};exports['show']=function(_0x21fa90,_0x3b9372){var _0x3ebd20={'raw':!![],'where':{'id':_0x21fa90[_0xd28c('0x52')]['id']}},_0x127846={};_0x127846[_0xd28c('0x3d')]=_[_0xd28c('0x3f')](db[_0xd28c('0x4e')][_0xd28c('0x3a')]);_0x127846[_0xd28c('0x3e')]=_[_0xd28c('0x3f')](_0x21fa90[_0xd28c('0x3e')]);_0x127846['filters']=_[_0xd28c('0x41')](_0x127846[_0xd28c('0x3d')],_0x127846[_0xd28c('0x3e')]);_0x3ebd20[_0xd28c('0x42')]=_[_0xd28c('0x41')](_0x127846[_0xd28c('0x3d')],qs[_0xd28c('0x43')](_0x21fa90[_0xd28c('0x3e')]['fields']));_0x3ebd20[_0xd28c('0x42')]=_0x3ebd20['attributes']['length']?_0x3ebd20[_0xd28c('0x42')]:_0x127846[_0xd28c('0x3d')];if(_0x21fa90[_0xd28c('0x3e')][_0xd28c('0x53')]){_0x3ebd20[_0xd28c('0x4d')]=[{'all':!![]}];}_0x3ebd20=_[_0xd28c('0x4b')]({},_0x3ebd20,_0x21fa90[_0xd28c('0x54')]);return db['SmsMessage']['find'](_0x3ebd20)[_0xd28c('0x20')](handleEntityNotFound(_0x3b9372,null))[_0xd28c('0x20')](respondWithResult(_0x3b9372,null))[_0xd28c('0x51')](handleError(_0x3b9372,null));};exports[_0xd28c('0x55')]=function(_0x38cd68,_0x1553f3){return db[_0xd28c('0x4e')][_0xd28c('0x55')](_0x38cd68[_0xd28c('0x56')],{})['then'](respondWithResult(_0x1553f3,0xc9))['catch'](handleError(_0x1553f3,null));};exports[_0xd28c('0x35')]=function(_0x500eb6,_0x46be97){if(_0x500eb6[_0xd28c('0x56')]['id']){delete _0x500eb6[_0xd28c('0x56')]['id'];}return db[_0xd28c('0x4e')][_0xd28c('0x57')]({'where':{'id':_0x500eb6[_0xd28c('0x52')]['id']}})[_0xd28c('0x20')](handleEntityNotFound(_0x46be97,null))['then'](saveUpdates(_0x500eb6[_0xd28c('0x56')],null))[_0xd28c('0x20')](respondWithResult(_0x46be97,null))[_0xd28c('0x51')](handleError(_0x46be97,null));};exports['destroy']=function(_0xbc30fc,_0x12c9d4){return db[_0xd28c('0x4e')][_0xd28c('0x57')]({'where':{'id':_0xbc30fc[_0xd28c('0x52')]['id']}})[_0xd28c('0x20')](handleEntityNotFound(_0x12c9d4,null))[_0xd28c('0x20')](removeEntity(_0x12c9d4,null))['catch'](handleError(_0x12c9d4,null));};exports[_0xd28c('0x58')]=function(_0x1d255a,_0x1b39bd){return db[_0xd28c('0x4e')][_0xd28c('0x58')]()[_0xd28c('0x20')](respondWithResult(_0x1b39bd,null))[_0xd28c('0x51')](handleError(_0x1b39bd,null));};var interaction_log=require('../../config/logger')(_0xd28c('0x59'));exports[_0xd28c('0x5a')]=function(_0x301bce,_0x11bc65,_0x2eaf39){var _0x54fd26={'agent':{},'channel':_0xd28c('0x5b')};if(_0x301bce[_0xd28c('0x56')]['id']){delete _0x301bce[_0xd28c('0x56')]['id'];}_0x301bce[_0xd28c('0x56')][_0xd28c('0x5c')]=!![];_0x301bce[_0xd28c('0x56')]['readAt']=moment()[_0xd28c('0x5d')](_0xd28c('0x5e'));_0x301bce['body']['UserId']=_0x301bce['body'][_0xd28c('0x5f')]||_0x301bce[_0xd28c('0x60')]['id'];_0x54fd26['agent']['id']=_0x301bce[_0xd28c('0x56')][_0xd28c('0x5f')];return db[_0xd28c('0x4e')][_0xd28c('0x57')]({'where':{'id':_0x301bce['params']['id'],'UserId':null}})[_0xd28c('0x20')](handleEntityNotFound(_0x11bc65,null))[_0xd28c('0x20')](saveUpdates(_0x301bce[_0xd28c('0x56')],null))[_0xd28c('0x20')](function(_0x26094b){if(_0x26094b){_0x54fd26[_0xd28c('0x29')]=_0x26094b[_0xd28c('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xd28c('0x57')]({'where':{'id':_0x26094b[_0xd28c('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x11bc65,null))['then'](function(_0x15aef6){if(_0x15aef6){return _0x15aef6[_0xd28c('0x35')]({'UserId':_0x301bce[_0xd28c('0x56')]['UserId'],'read1stAt':_['isNil'](_0x15aef6[_0xd28c('0x63')])?moment()[_0xd28c('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd28c('0x20')](function(_0x3dcc73){if(_0x3dcc73){_0x54fd26['interaction']=_0x3dcc73['get']({'plain':!![]});interaction_log['info'](_0xd28c('0x64'),_0x301bce[_0xd28c('0x60')]['id'],_0x301bce[_0xd28c('0x60')][_0xd28c('0x38')],_0x301bce[_0xd28c('0x60')][_0xd28c('0x65')],_0x54fd26['interaction']['id'],_0x301bce[_0xd28c('0x56')]?JSON['stringify'](_0x301bce['body']):_0xd28c('0x66'));return respondWithRpcPromise('AcceptMessage',_0xd28c('0x67'),_0x54fd26);}return null;})['then'](function(_0x366bdd){var _0x4b5596=_0xd28c('0x68')+_0x366bdd['message'][_0xd28c('0x69')];return db[_0xd28c('0x6a')][_0xd28c('0x3e')](_0x4b5596,{'type':db[_0xd28c('0x6b')][_0xd28c('0x6c')][_0xd28c('0x6d')],'raw':!![]})[_0xd28c('0x20')](function(_0x26715d){return _0x26715d;});})[_0xd28c('0x20')](function(_0xb235bf){if(_0xb235bf){_0x54fd26[_0xd28c('0x29')][_0xd28c('0x6e')]=_0xb235bf[0x0];if(!_0x301bce[_0xd28c('0x56')][_0xd28c('0x5f')])return;return db[_0xd28c('0x6f')][_0xd28c('0x57')]({'where':{'id':_0x301bce[_0xd28c('0x56')][_0xd28c('0x5f')],'role':'agent'},'attributes':['id',_0xd28c('0x38'),'fullname','email',_0xd28c('0x70')],'raw':!![]});}return null;})['then'](function(_0x1fce3e){if(!_0x1fce3e)return null;_0x54fd26[_0xd28c('0x29')][_0xd28c('0x71')]=_0x1fce3e;return _0x54fd26;})[_0xd28c('0x20')](function(_0x18aa00){if(_0x18aa00){if(_0x301bce['body'][_0xd28c('0x72')]){_0x54fd26['message']['interface']=util[_0xd28c('0x5d')](_0xd28c('0x73'),_0x301bce[_0xd28c('0x60')][_0xd28c('0x38')]);_0x54fd26[_0xd28c('0x29')]['channel']=_0x54fd26[_0xd28c('0x74')];_0x54fd26[_0xd28c('0x29')][_0xd28c('0x75')]=_0x54fd26[_0xd28c('0x74')];_0x54fd26['message'][_0xd28c('0x76')]='accept';return respondWithRpcPromise(_0xd28c('0x77'),_0xd28c('0x77'),{'event':'acceptmessage','message':_0x54fd26[_0xd28c('0x29')]},client9002)['then'](function(){return _0x54fd26;});}return _0x54fd26;}return null;})[_0xd28c('0x20')](respondWithResult(_0x11bc65,null))[_0xd28c('0x51')](handleError(_0x11bc65,null));};var interaction_log=require(_0xd28c('0x13'))(_0xd28c('0x59'));exports['reject']=function(_0x5b98b9,_0x5bc06a,_0x52c39f){var _0x1aa822={'agent':{},'channel':_0xd28c('0x5b')};if(_0x5b98b9[_0xd28c('0x56')]['id']){delete _0x5b98b9[_0xd28c('0x56')]['id'];}_0x5b98b9[_0xd28c('0x56')][_0xd28c('0x5f')]=_0x5b98b9['body'][_0xd28c('0x5f')]||_0x5b98b9['user']['id'];_0x1aa822[_0xd28c('0x71')]['id']=_0x5b98b9[_0xd28c('0x56')][_0xd28c('0x5f')];return db['SmsMessage']['find']({'where':{'id':_0x5b98b9[_0xd28c('0x52')]['id'],'UserId':null}})[_0xd28c('0x20')](handleEntityNotFound(_0x5bc06a,null))[_0xd28c('0x20')](function(_0x1e5ec6){if(_0x1e5ec6){_0x1aa822['message']=_0x1e5ec6[_0xd28c('0x61')]({'plain':!![]});return db[_0xd28c('0x78')][_0xd28c('0x57')]({'where':{'id':_0x1e5ec6[_0xd28c('0x62')]}});}return null;})[_0xd28c('0x20')](handleEntityNotFound(_0x5bc06a,null))[_0xd28c('0x20')](function(_0x24a03d){if(_0x24a03d){_0x1aa822['interaction']=_0x24a03d[_0xd28c('0x61')]({'plain':!![]});interaction_log[_0xd28c('0x21')](_0xd28c('0x79'),_0x5b98b9[_0xd28c('0x60')]['id'],_0x5b98b9[_0xd28c('0x60')]['name'],_0x5b98b9['user']['role'],_0x1aa822[_0xd28c('0x7a')]['id'],_0x5b98b9[_0xd28c('0x56')]?JSON[_0xd28c('0x26')](_0x5b98b9[_0xd28c('0x56')]):_0xd28c('0x66'));return respondWithRpcPromise(_0xd28c('0x7b'),'rejectMessage',_0x1aa822);}return null;})[_0xd28c('0x20')](function(_0x2cfea2){var _0x4672f4=_0xd28c('0x68')+_0x2cfea2[_0xd28c('0x29')]['ContactId'];return db[_0xd28c('0x6a')][_0xd28c('0x3e')](_0x4672f4,{'type':db[_0xd28c('0x6b')][_0xd28c('0x6c')][_0xd28c('0x6d')],'raw':!![]})[_0xd28c('0x20')](function(_0x23c33f){return _0x23c33f;});})[_0xd28c('0x20')](function(_0x5983a4){if(_0x5983a4){_0x1aa822[_0xd28c('0x29')][_0xd28c('0x6e')]=_0x5983a4[0x0];if(!_0x5b98b9[_0xd28c('0x56')][_0xd28c('0x5f')])return;return db[_0xd28c('0x6f')]['find']({'where':{'id':_0x5b98b9[_0xd28c('0x56')][_0xd28c('0x5f')],'role':'agent'},'attributes':['id',_0xd28c('0x38'),_0xd28c('0x7c'),_0xd28c('0x7d'),_0xd28c('0x70')],'raw':!![]});}return null;})[_0xd28c('0x20')](function(_0x545898){if(!_0x545898)return null;_0x1aa822[_0xd28c('0x29')][_0xd28c('0x71')]=_0x545898;return _0x1aa822;})[_0xd28c('0x20')](function(_0x1c63c6){if(_0x1c63c6){_0x1c63c6['message'][_0xd28c('0x7e')]=util['format'](_0xd28c('0x73'),_0x5b98b9[_0xd28c('0x60')][_0xd28c('0x38')]);_0x1c63c6[_0xd28c('0x29')][_0xd28c('0x74')]=_0x1aa822[_0xd28c('0x74')];_0x1c63c6[_0xd28c('0x29')]['motionChannel']=_0x1aa822[_0xd28c('0x74')];_0x1c63c6[_0xd28c('0x29')][_0xd28c('0x76')]=_0xd28c('0x34');respondWithRpcPromise(_0xd28c('0x77'),_0xd28c('0x77'),{'event':'rejectmessage','message':_0x1c63c6['message']},client9002);return _0x1aa822;}return null;})['then'](respondWithResult(_0x5bc06a,null))[_0xd28c('0x51')](handleError(_0x5bc06a,null));};exports[_0xd28c('0x2c')]=function(_0x455705,_0x282f80,_0x4885bf){if(_0x455705['body']['id']){delete _0x455705['body']['id'];}var _0x6482ca;return db['SmsMessage']['find']({'where':{'id':_0x455705[_0xd28c('0x52')]['id']}})[_0xd28c('0x20')](handleEntityNotFound(_0x282f80,null))[_0xd28c('0x20')](function(_0x464817){if(_0x464817){_0x6482ca=_0x464817;return db[_0xd28c('0x7f')][_0xd28c('0x57')]({'where':{'id':_0x464817['SmsAccountId']}});}})[_0xd28c('0x20')](handleEntityNotFound(_0x282f80,null))[_0xd28c('0x20')](function(_0x5ce9ce){if(_0x5ce9ce){logger['debug'](_0xd28c('0x25'),_0xd28c('0x2c'),_0xd28c('0x80'),_0x5ce9ce[_0xd28c('0x3b')],util[_0xd28c('0x81')](_0x455705['body'],{'showHidden':![],'depth':null}));switch(_0x5ce9ce[_0xd28c('0x3b')]){case _0xd28c('0x82'):if(_0x455705[_0xd28c('0x56')][_0xd28c('0x83')]&&_0x455705[_0xd28c('0x56')][_0xd28c('0x83')]===_0x6482ca[_0xd28c('0x84')]){return _0x6482ca[_0xd28c('0x35')]({'read':!![]});}else{logger[_0xd28c('0x27')](_0xd28c('0x85'),_0xd28c('0x2c'),'twilio',util['inspect'](_0x455705[_0xd28c('0x56')],{'showHidden':![],'depth':null}));}break;case _0xd28c('0x86'):if(_0x455705[_0xd28c('0x56')][_0xd28c('0x87')]&&_0x455705[_0xd28c('0x56')][_0xd28c('0x87')]===_0x6482ca[_0xd28c('0x84')]&&_[_0xd28c('0x88')](['sent',_0xd28c('0x89')],_0x455705[_0xd28c('0x56')][_0xd28c('0x8a')])>=0x0){return _0x6482ca[_0xd28c('0x35')]({'read':!![]});}else{logger[_0xd28c('0x27')](_0xd28c('0x85'),_0xd28c('0x2c'),_0xd28c('0x8b'),util[_0xd28c('0x81')](_0x455705[_0xd28c('0x56')],{'showHidden':![],'depth':null}));}break;case _0xd28c('0x8c'):var _0x705c95=_0x455705['body']['results'][0x0];if(_0x705c95['status'][_0xd28c('0x8d')]===_0xd28c('0x8e')){return _0x6482ca[_0xd28c('0x35')]({'read':!![]});}else{logger[_0xd28c('0x27')](_0xd28c('0x85'),_0xd28c('0x2c'),_0xd28c('0x8c'),util[_0xd28c('0x81')](_0x455705[_0xd28c('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x6482ca;}})[_0xd28c('0x20')](respondWithResult(_0x282f80,null))[_0xd28c('0x51')](handleError(_0x282f80,null));};
\ No newline at end of file
index 7252ac1..f9c4115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eef=['update','remove','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x4ef75c,_0x1e2195){var _0x1d918f=function(_0x13ebe6){while(--_0x13ebe6){_0x4ef75c['push'](_0x4ef75c['shift']());}};_0x1d918f(++_0x1e2195);}(_0x3eef,0x1b3));var _0xf3ee=function(_0x2c4fc0,_0x3e7ad4){_0x2c4fc0=_0x2c4fc0-0x0;var _0x43d633=_0x3eef[_0x2c4fc0];return _0x43d633;};'use strict';var EventEmitter=require(_0xf3ee('0x0'));var SmsMessage=require(_0xf3ee('0x1'))['db'][_0xf3ee('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf3ee('0x3')](0x0);var events={'afterCreate':_0xf3ee('0x4'),'afterUpdate':_0xf3ee('0x5'),'afterDestroy':_0xf3ee('0x6')};function emitEvent(_0x1269ba){return function(_0x332680,_0x3422c4,_0x2e8fcd){SmsMessageEvents['emit'](_0x1269ba+':'+_0x332680['id'],_0x332680);SmsMessageEvents[_0xf3ee('0x7')](_0x1269ba,_0x332680);_0x2e8fcd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xf3ee('0x8')](e,emitEvent(event));}}module[_0xf3ee('0x9')]=SmsMessageEvents;
\ No newline at end of file
+var _0x4836=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x4836,0x17e));var _0x6483=function(_0x22525e,_0x4172b2){_0x22525e=_0x22525e-0x0;var _0x25715f=_0x4836[_0x22525e];return _0x25715f;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x6483('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6483('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6483('0x2'),'afterDestroy':_0x6483('0x3')};function emitEvent(_0x9c670){return function(_0x5d10bc,_0x2accf0,_0x10f374){SmsMessageEvents[_0x6483('0x4')](_0x9c670+':'+_0x5d10bc['id'],_0x5d10bc);SmsMessageEvents['emit'](_0x9c670,_0x5d10bc);_0x10f374(null);};}for(var e in events){if(events[_0x6483('0x5')](e)){var event=events[e];SmsMessage[_0x6483('0x6')](e,emitEvent(event));}}module[_0x6483('0x7')]=SmsMessageEvents;
\ No newline at end of file
index b985e55..b88c666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4fa=['clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','base64','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','messages','messageId','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','refid','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','create','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','split','sms','POST','session_key','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id'];(function(_0x544274,_0x731b9b){var _0x328be3=function(_0x293f8e){while(--_0x293f8e){_0x544274['push'](_0x544274['shift']());}};_0x328be3(++_0x731b9b);}(_0xd4fa,0x12c));var _0xad4f=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0xd4fa[_0x419550];return _0x55f9ef;};'use strict';var _=require(_0xad4f('0x0'));var util=require(_0xad4f('0x1'));var logger=require(_0xad4f('0x2'))(_0xad4f('0x3'));var moment=require(_0xad4f('0x4'));var BPromise=require('bluebird');var rp=require(_0xad4f('0x5'));var fs=require('fs');var path=require(_0xad4f('0x6'));var rimraf=require(_0xad4f('0x7'));var config=require(_0xad4f('0x8'));var attributes=require('./smsMessage.attributes');module[_0xad4f('0x9')]=function(_0x3c9cda,_0x5eba9d){return _0x3c9cda[_0xad4f('0xa')](_0xad4f('0xb'),attributes,{'tableName':_0xad4f('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xad4f('0xd')],'type':_0xad4f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45fdb4,_0x4b2d54,_0x33ca0a){var _0x128c19=_0x3c9cda[_0xad4f('0xf')];var _0x1b1a16=_0x45fdb4[_0xad4f('0x10')]({'plain':!![]});if(_0x1b1a16[_0xad4f('0x11')][_0xad4f('0x12')]()==='in'||_0x1b1a16[_0xad4f('0x11')][_0xad4f('0x12')]()===_0xad4f('0x13')&&!_0x1b1a16[_0xad4f('0x14')]&&!_[_0xad4f('0x15')](_0x1b1a16[_0xad4f('0x16')])&&!_['isNil'](_0x1b1a16['SmsInteractionId'])){_0x128c19[_0xad4f('0x17')][_0xad4f('0x18')]({'where':{'id':_0x1b1a16[_0xad4f('0x19')]}})['then'](function(_0x311f31){if(_0x311f31){_0x311f31[_0xad4f('0x1a')]({'lastMsgAt':_0x1b1a16[_0xad4f('0x1b')],'lastMsgDirection':_0x1b1a16[_0xad4f('0x11')][_0xad4f('0x12')]()});}})[_0xad4f('0x1c')](function(_0x5f49e1){console[_0xad4f('0x1d')](_0x5f49e1);});}if(_0x1b1a16[_0xad4f('0x11')]===_0xad4f('0x13')&&!_0x1b1a16[_0xad4f('0x14')]){var _0x3bce7d;_0x128c19[_0xad4f('0x1e')][_0xad4f('0x1f')]({'where':{'id':_0x1b1a16[_0xad4f('0x20')]},'raw':!![]})[_0xad4f('0x21')](function(_0x212c36){_0x3bce7d=_0x212c36;if(_0x3bce7d&&_0x3bce7d[_0xad4f('0x22')]){switch(_0x3bce7d['type']){case _0xad4f('0x23'):var _0x987f5=require(_0xad4f('0x23'));if(_0x3bce7d[_0xad4f('0x24')]&&_0x3bce7d['authToken']&&_0x3bce7d[_0xad4f('0x25')]){var _0x3e2ac7=new _0x987f5(_0x3bce7d[_0xad4f('0x24')],_0x3bce7d['authToken']);_0x3e2ac7['messages'][_0xad4f('0x26')]({'body':_0x1b1a16[_0xad4f('0xd')],'to':_0x1b1a16['phone'],'from':_0x3bce7d['phone'],'statusCallback':_0x3bce7d['remote']+_0xad4f('0x27')+_0x1b1a16['id']+_0xad4f('0x28')+_0x3bce7d[_0xad4f('0x29')]})[_0xad4f('0x21')](function(_0x3ac56e){if(_0x3ac56e[_0xad4f('0x2a')]){return _0x45fdb4['update']({'messageId':_0x3ac56e[_0xad4f('0x2a')]});}})[_0xad4f('0x1c')](function(_0x28f964){logger[_0xad4f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),_0xad4f('0x23'),util[_0xad4f('0x2c')](_0x28f964,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x23'),_0xad4f('0x2e'));}break;case'skebby':var _0x29c028=_0xad4f('0x2f');if(_0x3bce7d[_0xad4f('0x30')]&&_0x3bce7d['password']){var _0x2c0524={'recipient':[_0x1b1a16[_0xad4f('0x25')]],'message':_0x1b1a16[_0xad4f('0xd')],'message_type':_0x3bce7d[_0xad4f('0x31')]};if(_0x3bce7d['smsMethod']&&_0x3bce7d['smsMethod']!=='SI'){_0x2c0524['sender']=_0x3bce7d[_0xad4f('0x25')];}var _0x1d8022={'url':_0x29c028+_0xad4f('0x32')+_0x3bce7d[_0xad4f('0x30')]+_0xad4f('0x33')+_0x3bce7d[_0xad4f('0x34')],'method':'GET'};rp(_0x1d8022)[_0xad4f('0x21')](function(_0x55c09d){var _0x20e72b=_0x55c09d[_0xad4f('0x35')](';');var _0x436b83={'user_key':_0x20e72b[0x0],'session_key':_0x20e72b[0x1]};_0x1d8022={'url':_0x29c028+_0xad4f('0x36'),'method':_0xad4f('0x37'),'headers':{'user_key':_0x436b83['user_key'],'Session_key':_0x436b83[_0xad4f('0x38')]},'json':!![],'body':_0x2c0524};return rp(_0x1d8022);})[_0xad4f('0x21')](function(_0x47751a){if(_0x47751a['total_sent']>=0x1){var _0x3e5611={'messageId':_0x47751a[_0xad4f('0x39')]};if(_0x3bce7d[_0xad4f('0x31')]!=='GP'||!_0x3bce7d[_0xad4f('0x3a')]){_0x3e5611[_0xad4f('0x3b')]=!![];}return _0x45fdb4[_0xad4f('0x1a')](_0x3e5611);}else{return logger[_0xad4f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),_0xad4f('0x3c'),util[_0xad4f('0x2c')](_0x47751a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5fefce){return logger['error'](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x3c'),util[_0xad4f('0x2c')](_0x5fefce,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),_0xad4f('0x3c'),_0xad4f('0x3d'));}break;case _0xad4f('0x3e'):if(_0x3bce7d['authToken']){var _0x18daef={'recipient':_0x1b1a16[_0xad4f('0x25')],'message':_0x1b1a16[_0xad4f('0xd')],'sender':_0x3bce7d[_0xad4f('0x3f')]||_0x3bce7d['phone'],'authorization':_0x3bce7d[_0xad4f('0x40')]};var _0x4b2d54={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x18daef,'json':!![]};rp(_0x4b2d54)[_0xad4f('0x21')](function(_0x49ad92){var _0x22652a={'messageId':_0x49ad92[_0xad4f('0x41')]};if(!_0x3bce7d[_0xad4f('0x3a')]){_0x22652a[_0xad4f('0x3b')]=!![];}return _0x45fdb4[_0xad4f('0x1a')](_0x22652a);})[_0xad4f('0x1c')](function(_0x1f2110){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),_0xad4f('0x3e'),util[_0xad4f('0x2c')](_0x1f2110,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x3e'),_0xad4f('0x42'));}break;case _0xad4f('0x43'):if(_0x3bce7d[_0xad4f('0x30')]&&_0x3bce7d[_0xad4f('0x34')]){var _0x18daef={'messages':[{'source':_0xad4f('0x44'),'to':_0x1b1a16[_0xad4f('0x25')],'body':_0x1b1a16[_0xad4f('0xd')],'from':_0x3bce7d['senderString']||_0x3bce7d[_0xad4f('0x25')]}]};var _0x10af7e=util['format'](_0xad4f('0x45'),_0x3bce7d[_0xad4f('0x30')],_0x3bce7d['password']);var _0x4b2d54={'method':_0xad4f('0x37'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x18daef,'headers':{'Authorization':util[_0xad4f('0x46')](_0xad4f('0x47'),new Buffer(_0x10af7e)[_0xad4f('0x48')]('base64'))},'json':!![]};rp(_0x4b2d54)[_0xad4f('0x21')](function(_0x8d7a87){if(_0x8d7a87[_0xad4f('0x49')]>=0xc8&&_0x8d7a87[_0xad4f('0x49')]<=0xce){if(_0x8d7a87[_0xad4f('0x4a')]&&_0x8d7a87['data'][_0xad4f('0x4b')]>0x0){var _0x5f5525=_[_0xad4f('0x4c')](_0x8d7a87['data']['messages']);var _0x525d73={'messageId':_0x5f5525[_0xad4f('0x4d')]};if(!_0x3bce7d['deliveryReport']){_0x525d73['read']=!![];}return _0x45fdb4[_0xad4f('0x1a')](_0x525d73);}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),'afterCreate','clickSend',util[_0xad4f('0x2c')](_0x8d7a87,{'showHidden':![],'depth':null}));}}else{logger[_0xad4f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),_0xad4f('0x4e'),util['inspect'](_0x8d7a87,{'showHidden':![],'depth':null}));}})['catch'](function(_0x163c35){logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x4e'),util[_0xad4f('0x2c')](_0x163c35,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),'afterCreate',_0xad4f('0x4e'),_0xad4f('0x3d'));}break;case'plivo':if(_0x3bce7d[_0xad4f('0x4f')]&&_0x3bce7d[_0xad4f('0x40')]){var _0x18daef={'dst':_0x1b1a16[_0xad4f('0x25')],'text':_0x1b1a16[_0xad4f('0xd')],'src':_0x3bce7d[_0xad4f('0x3f')]||_0x3bce7d[_0xad4f('0x25')],'url':_0x3bce7d[_0xad4f('0x50')]+_0xad4f('0x27')+_0x1b1a16['id']+'/status?token='+_0x3bce7d[_0xad4f('0x29')]};var _0x10af7e=util['format'](_0xad4f('0x45'),_0x3bce7d[_0xad4f('0x4f')],_0x3bce7d['authToken']);var _0x4b2d54={'method':_0xad4f('0x37'),'uri':util[_0xad4f('0x46')](_0xad4f('0x51'),_0x3bce7d[_0xad4f('0x4f')]),'body':_0x18daef,'headers':{'Authorization':util[_0xad4f('0x46')]('Basic\x20%s',new Buffer(_0x10af7e)[_0xad4f('0x48')](_0xad4f('0x52')))},'json':!![]};rp(_0x4b2d54)['then'](function(_0x38fb11){var _0x11107c={'messageId':_0x38fb11['message_uuid'][0x0]};return _0x45fdb4['update'](_0x11107c);})[_0xad4f('0x1c')](function(_0x143683){logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x53'),util[_0xad4f('0x2c')](_0x143683,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x53'),_0xad4f('0x54'));}break;case _0xad4f('0x55'):if(_0x3bce7d[_0xad4f('0x30')]&&_0x3bce7d[_0xad4f('0x34')]){if(_0x3bce7d[_0xad4f('0x56')]){var _0x46ddaa={'method':_0xad4f('0x37'),'uri':_0x3bce7d[_0xad4f('0x56')]+'/auth/1/session','body':{'username':_0x3bce7d[_0xad4f('0x30')],'password':_0x3bce7d['password']},'json':!![]};return rp(_0x46ddaa)[_0xad4f('0x21')](function(_0x30ae39){var _0x17c6f3={'method':_0xad4f('0x37'),'uri':_0x3bce7d['baseUrl']+_0xad4f('0x57'),'body':{'messages':[{'from':_0x3bce7d[_0xad4f('0x25')],'destinations':[{'to':_0x1b1a16[_0xad4f('0x25')]}],'text':_0x1b1a16[_0xad4f('0xd')],'notifyUrl':_0x3bce7d[_0xad4f('0x50')]+_0xad4f('0x27')+_0x1b1a16['id']+_0xad4f('0x28')+_0x3bce7d[_0xad4f('0x29')],'notifyContentType':'application/json','callbackData':_0x3bce7d[_0xad4f('0x25')]+';'+_0x1b1a16[_0xad4f('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x30ae39[_0xad4f('0x29')]},'json':!![]};return rp(_0x17c6f3)[_0xad4f('0x21')](function(_0x89e435){if(_0x89e435[_0xad4f('0x58')]){var _0x1137cc={'messageId':_0x89e435['messages'][0x0][_0xad4f('0x59')]};if(!_0x3bce7d[_0xad4f('0x3a')]){_0x1137cc[_0xad4f('0x3b')]=!![];}return _0x45fdb4[_0xad4f('0x1a')](_0x1137cc);}else{return logger[_0xad4f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),'infobip',util[_0xad4f('0x2c')](_0x89e435,{'showHidden':![],'depth':null}));}});})[_0xad4f('0x1c')](function(_0xf8bbdb){return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x55'),util['inspect'](_0xf8bbdb,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x55'),_0xad4f('0x5a'));}}else{logger[_0xad4f('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),_0xad4f('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xad4f('0x5b'):var _0x42df63=require(_0xad4f('0x5c'));if(_0x3bce7d[_0xad4f('0x5d')]){var _0x3c2f38={};_0x3c2f38[_0xad4f('0x5e')]=_0x3bce7d[_0xad4f('0x30')];_0x3c2f38['phone']=_0x1b1a16['phone'];_0x3c2f38['sender']=_0x3bce7d[_0xad4f('0x25')];_0x3c2f38[_0xad4f('0x5f')]=_0x1b1a16[_0xad4f('0xd')];_0x3c2f38[_0xad4f('0x60')]=+new Date();var _0x2bbc84='';var _0x57a9a5='';var _0x4b2b19=Object[_0xad4f('0x61')](_0x3c2f38);_0x4b2b19[_0xad4f('0x62')]();for(var _0x394b4b=0x0;_0x394b4b<_0x4b2b19[_0xad4f('0x63')];_0x394b4b++){if(_0x2bbc84!=''){_0x2bbc84+='&';}_0x2bbc84+=_0x4b2b19[_0x394b4b]+'='+encodeURIComponent(_0x3c2f38[_0x4b2b19[_0x394b4b]]);_0x57a9a5+=_0x3c2f38[_0x4b2b19[_0x394b4b]];}_0x57a9a5+=_0x3bce7d['apiKey'];_0x57a9a5=_0x42df63[_0xad4f('0x64')](_0xad4f('0x65'))[_0xad4f('0x1a')](_0x57a9a5)[_0xad4f('0x66')]('hex');if(_0x2bbc84!==''){_0x2bbc84+='&';}_0x2bbc84+=_0xad4f('0x67')+_0x57a9a5;var _0x1d8022={'method':'GET','uri':_0x3bce7d['baseUrl']+_0xad4f('0x68')+_0x2bbc84,'json':!![]};return rp(_0x1d8022)[_0xad4f('0x21')](function(_0x5ee500){var _0x46a78a=Object['keys'](_0x5ee500);if(_0x5ee500[_0x46a78a[0x0]]['error']&&parseInt(_0x5ee500[_0x46a78a[0x0]][_0xad4f('0x1d')])===0x0){var _0x26ae31={'messageId':_0x5ee500[_0x46a78a[0x0]]['id_sms']};if(!_0x3bce7d[_0xad4f('0x3a')]){_0x26ae31['read']=!![];}return _0x45fdb4['update'](_0x26ae31);}else{return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),'csc',util['inspect'](_0x5ee500[_0xad4f('0x1d')],{'showHidden':![],'depth':null}));}})[_0xad4f('0x1c')](function(_0x3c4a8d){return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x5b'),util[_0xad4f('0x2c')](_0x3c4a8d,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),'afterCreate',_0xad4f('0x5b'),_0xad4f('0x69'));}break;case _0xad4f('0x6a'):if(_0x3bce7d[_0xad4f('0x5d')]){var _0xf70bd6={'method':_0xad4f('0x37'),'uri':_0xad4f('0x6b'),'headers':{'Authorization':_0x3bce7d[_0xad4f('0x5d')]},'body':{'content':_0x1b1a16[_0xad4f('0xd')],'to':[_0x1b1a16[_0xad4f('0x25')]],'from':_0x3bce7d[_0xad4f('0x25')],'binary':![],'clientMessageId':_0xad4f('0x6c'),'charset':_0xad4f('0x6d')},'json':!![]};rp(_0xf70bd6)[_0xad4f('0x21')](function(_0x13a763){if(!_0x13a763[_0xad4f('0x1d')]){var _0x422da0={'messageId':_0x13a763[_0xad4f('0x58')][0x0][_0xad4f('0x6e')]};if(!_0x3bce7d[_0xad4f('0x3a')]){_0x422da0[_0xad4f('0x3b')]=!![];}return _0x45fdb4[_0xad4f('0x1a')](_0x422da0);}else{return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x6a'),util[_0xad4f('0x2c')](_0x13a763['error'],{'showHidden':![],'depth':null}));}})[_0xad4f('0x1c')](function(_0xe2290b){return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),'afterCreate','clickatell',util[_0xad4f('0x2c')](_0xe2290b,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x3bce7d[_0xad4f('0x30')]&&_0x3bce7d['password']){var _0x10af7e=util['format']('%s:%s',_0x3bce7d['username'],_0x3bce7d[_0xad4f('0x34')]);var _0x4b2d54={'method':_0xad4f('0x37'),'uri':_0xad4f('0x6f')+_0x3bce7d[_0xad4f('0x70')]+_0xad4f('0x71'),'body':{'to':[_0x1b1a16[_0xad4f('0x25')]],'text':_0x1b1a16[_0xad4f('0xd')],'from':_0x3bce7d[_0xad4f('0x25')],'applicationId':_0x3bce7d[_0xad4f('0x72')]},'headers':{'Authorization':util[_0xad4f('0x46')](_0xad4f('0x47'),new Buffer(_0x10af7e)['toString'](_0xad4f('0x52')))},'json':!![]};rp(_0x4b2d54)['then'](function(_0x5afff8){if(_0x5afff8['id']){var _0x23e1d6={'messageId':_0x5afff8['id']};return _0x45fdb4[_0xad4f('0x1a')](_0x23e1d6);}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),'bandwidth',util['inspect'](_0x5afff8,{'showHidden':![],'depth':null}));}})[_0xad4f('0x1c')](function(_0x524c59){logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),'bandwidth',util['inspect'](_0x524c59,{'showHidden':![],'depth':null}));});}else{logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x73'),_0xad4f('0x3d'));}break;case _0xad4f('0x74'):if(_0x3bce7d[_0xad4f('0x5d')]){var _0x52e2fc={};var _0x1d8022={'method':'POST','uri':_0xad4f('0x75'),'headers':{'Authorization':_0xad4f('0x76')+_0x3bce7d[_0xad4f('0x5d')],'Content-Type':_0xad4f('0x77')},'body':{'from':_0x3bce7d[_0xad4f('0x25')],'to':_0x1b1a16[_0xad4f('0x25')],'text':_0x1b1a16['body']},'json':!![]};return rp(_0x1d8022)['then'](function(_0x37e2de){if(_0x37e2de[_0xad4f('0x78')]==0xca){_0x52e2fc[_0xad4f('0x79')]=_0x37e2de;var _0x1a5694={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x3bce7d[_0xad4f('0x5d')],'Content-Type':_0xad4f('0x77')},'body':{'refid':_0x52e2fc[_0xad4f('0x79')][_0xad4f('0x7a')]},'json':!![]};return rp(_0x1a5694)['then'](function(_0x33d184){_0x52e2fc['status']=_0x33d184;var _0x407c43={'messageId':_0x52e2fc[_0xad4f('0x79')][_0xad4f('0x7a')],'read':!![]};return _0x45fdb4[_0xad4f('0x1a')](_0x407c43);});}else{return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x74'),util[_0xad4f('0x2c')](_0x37e2de,{'showHidden':![],'depth':null}));}})[_0xad4f('0x1c')](function(_0x47de1c){return logger[_0xad4f('0x1d')](_0xad4f('0x2d'),_0xad4f('0x2b'),_0xad4f('0x74'),util[_0xad4f('0x2c')](_0x47de1c,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xad4f('0x2b'),'intelepeer',_0xad4f('0x7b'));}break;}}})[_0xad4f('0x7c')](function(){_0x33ca0a();});}else{_0x33ca0a();}}},'charset':_0xad4f('0x7d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xea0f=['message_id','read','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/status?token=','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','text','keys','sort','createHash','md5','digest','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','apiKey','https://platform.clickatell.com/messages','apiMessageId','accountId','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','SmsInteractionId','findOne','then','update','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head'];(function(_0xb022f3,_0x49fabc){var _0x4f276a=function(_0x57a9aa){while(--_0x57a9aa){_0xb022f3['push'](_0xb022f3['shift']());}};_0x4f276a(++_0x49fabc);}(_0xea0f,0x11e));var _0xfea0=function(_0x5d6aec,_0x433c6b){_0x5d6aec=_0x5d6aec-0x0;var _0x4ec2fb=_0xea0f[_0x5d6aec];return _0x4ec2fb;};'use strict';var _=require(_0xfea0('0x0'));var util=require(_0xfea0('0x1'));var logger=require(_0xfea0('0x2'))(_0xfea0('0x3'));var moment=require(_0xfea0('0x4'));var BPromise=require(_0xfea0('0x5'));var rp=require(_0xfea0('0x6'));var fs=require('fs');var path=require(_0xfea0('0x7'));var rimraf=require('rimraf');var config=require(_0xfea0('0x8'));var attributes=require(_0xfea0('0x9'));module[_0xfea0('0xa')]=function(_0x2064f9,_0x3fcb63){return _0x2064f9[_0xfea0('0xb')](_0xfea0('0xc'),attributes,{'tableName':_0xfea0('0xd'),'paranoid':![],'indexes':[{'name':_0xfea0('0xe'),'fields':['messageId']},{'name':_0xfea0('0xf'),'fields':[_0xfea0('0x10')],'type':_0xfea0('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x581297,_0x2378ce,_0x50907c){var _0x4a206d=_0x2064f9[_0xfea0('0x12')];var _0x1b0f71=_0x581297[_0xfea0('0x13')]({'plain':!![]});if(_0x1b0f71['direction']['toLowerCase']()==='in'||_0x1b0f71[_0xfea0('0x14')][_0xfea0('0x15')]()==='out'&&!_0x1b0f71[_0xfea0('0x16')]&&!_[_0xfea0('0x17')](_0x1b0f71['UserId'])&&!_[_0xfea0('0x17')](_0x1b0f71[_0xfea0('0x18')])){_0x4a206d['SmsInteraction'][_0xfea0('0x19')]({'where':{'id':_0x1b0f71[_0xfea0('0x18')]}})[_0xfea0('0x1a')](function(_0x3dd9b0){if(_0x3dd9b0){_0x3dd9b0[_0xfea0('0x1b')]({'lastMsgAt':_0x1b0f71['createdAt'],'lastMsgDirection':_0x1b0f71['direction'][_0xfea0('0x15')]()});}})['catch'](function(_0x4f3fe9){console['error'](_0x4f3fe9);});}if(_0x1b0f71[_0xfea0('0x14')]===_0xfea0('0x1c')&&!_0x1b0f71['secret']){var _0x3495ab;_0x4a206d[_0xfea0('0x1d')][_0xfea0('0x1e')]({'where':{'id':_0x1b0f71[_0xfea0('0x1f')]},'raw':!![]})['then'](function(_0x2e30a6){_0x3495ab=_0x2e30a6;if(_0x3495ab&&_0x3495ab[_0xfea0('0x20')]){switch(_0x3495ab[_0xfea0('0x20')]){case _0xfea0('0x21'):var _0x55860d=require(_0xfea0('0x21'));if(_0x3495ab[_0xfea0('0x22')]&&_0x3495ab[_0xfea0('0x23')]&&_0x3495ab[_0xfea0('0x24')]){var _0x39c715=new _0x55860d(_0x3495ab[_0xfea0('0x22')],_0x3495ab[_0xfea0('0x23')]);_0x39c715[_0xfea0('0x25')]['create']({'body':_0x1b0f71[_0xfea0('0x10')],'to':_0x1b0f71['phone'],'from':_0x3495ab['phone'],'statusCallback':_0x3495ab[_0xfea0('0x26')]+_0xfea0('0x27')+_0x1b0f71['id']+'/status?token='+_0x3495ab[_0xfea0('0x28')]})[_0xfea0('0x1a')](function(_0x4af59e){if(_0x4af59e['sid']){return _0x581297[_0xfea0('0x1b')]({'messageId':_0x4af59e[_0xfea0('0x29')]});}})[_0xfea0('0x2a')](function(_0x37303f){logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x21'),util['inspect'](_0x37303f,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x21'),_0xfea0('0x2e'));}break;case _0xfea0('0x2f'):var _0xc8cd3c='https://api.skebby.it/API/v1.0/REST/';if(_0x3495ab[_0xfea0('0x30')]&&_0x3495ab['password']){var _0x245c4b={'recipient':[_0x1b0f71['phone']],'message':_0x1b0f71[_0xfea0('0x10')],'message_type':_0x3495ab[_0xfea0('0x31')]};if(_0x3495ab[_0xfea0('0x31')]&&_0x3495ab[_0xfea0('0x31')]!=='SI'){_0x245c4b[_0xfea0('0x32')]=_0x3495ab[_0xfea0('0x24')];}var _0x5d8c7d={'url':_0xc8cd3c+_0xfea0('0x33')+_0x3495ab['username']+_0xfea0('0x34')+_0x3495ab[_0xfea0('0x35')],'method':_0xfea0('0x36')};rp(_0x5d8c7d)[_0xfea0('0x1a')](function(_0xdc2c62){var _0x49dd83=_0xdc2c62[_0xfea0('0x37')](';');var _0x515e99={'user_key':_0x49dd83[0x0],'session_key':_0x49dd83[0x1]};_0x5d8c7d={'url':_0xc8cd3c+_0xfea0('0x38'),'method':_0xfea0('0x39'),'headers':{'user_key':_0x515e99[_0xfea0('0x3a')],'Session_key':_0x515e99['session_key']},'json':!![],'body':_0x245c4b};return rp(_0x5d8c7d);})[_0xfea0('0x1a')](function(_0x126c86){if(_0x126c86[_0xfea0('0x3b')]>=0x1){var _0x396965={'messageId':_0x126c86[_0xfea0('0x3c')]};if(_0x3495ab[_0xfea0('0x31')]!=='GP'||!_0x3495ab[_0xfea0('0x3d')]){_0x396965['read']=!![];}return _0x581297[_0xfea0('0x1b')](_0x396965);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfea0('0x2d'),_0xfea0('0x2f'),util[_0xfea0('0x3e')](_0x126c86,{'showHidden':![],'depth':null}));}})[_0xfea0('0x2a')](function(_0x154279){return logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfea0('0x2d'),_0xfea0('0x2f'),util[_0xfea0('0x3e')](_0x154279,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x2f'),_0xfea0('0x3f'));}break;case'connectel':if(_0x3495ab[_0xfea0('0x23')]){var _0x2195e5={'recipient':_0x1b0f71['phone'],'message':_0x1b0f71[_0xfea0('0x10')],'sender':_0x3495ab['senderString']||_0x3495ab[_0xfea0('0x24')],'authorization':_0x3495ab[_0xfea0('0x23')]};var _0x2378ce={'method':_0xfea0('0x39'),'uri':_0xfea0('0x40'),'body':_0x2195e5,'json':!![]};rp(_0x2378ce)[_0xfea0('0x1a')](function(_0x4096f3){var _0x476e87={'messageId':_0x4096f3['requestid']};if(!_0x3495ab[_0xfea0('0x3d')]){_0x476e87['read']=!![];}return _0x581297[_0xfea0('0x1b')](_0x476e87);})[_0xfea0('0x2a')](function(_0x363dcc){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',util[_0xfea0('0x3e')](_0x363dcc,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfea0('0x41'),_0xfea0('0x42'));}break;case _0xfea0('0x43'):if(_0x3495ab['username']&&_0x3495ab[_0xfea0('0x35')]){var _0x2195e5={'messages':[{'source':_0xfea0('0x44'),'to':_0x1b0f71[_0xfea0('0x24')],'body':_0x1b0f71[_0xfea0('0x10')],'from':_0x3495ab[_0xfea0('0x45')]||_0x3495ab['phone']}]};var _0x53bea3=util[_0xfea0('0x46')](_0xfea0('0x47'),_0x3495ab[_0xfea0('0x30')],_0x3495ab[_0xfea0('0x35')]);var _0x2378ce={'method':_0xfea0('0x39'),'uri':_0xfea0('0x48'),'body':_0x2195e5,'headers':{'Authorization':util[_0xfea0('0x46')](_0xfea0('0x49'),new Buffer(_0x53bea3)[_0xfea0('0x4a')](_0xfea0('0x4b')))},'json':!![]};rp(_0x2378ce)[_0xfea0('0x1a')](function(_0x299340){if(_0x299340[_0xfea0('0x4c')]>=0xc8&&_0x299340[_0xfea0('0x4c')]<=0xce){if(_0x299340[_0xfea0('0x4d')]&&_0x299340[_0xfea0('0x4d')][_0xfea0('0x4e')]>0x0){var _0x3beb7d=_[_0xfea0('0x4f')](_0x299340[_0xfea0('0x4d')][_0xfea0('0x25')]);var _0x1a3af4={'messageId':_0x3beb7d[_0xfea0('0x50')]};if(!_0x3495ab[_0xfea0('0x3d')]){_0x1a3af4[_0xfea0('0x51')]=!![];}return _0x581297['update'](_0x1a3af4);}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x52'),util[_0xfea0('0x3e')](_0x299340,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x52'),util[_0xfea0('0x3e')](_0x299340,{'showHidden':![],'depth':null}));}})[_0xfea0('0x2a')](function(_0x3408a2){logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x52'),util[_0xfea0('0x3e')](_0x3408a2,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),'clickSend',_0xfea0('0x3f'));}break;case _0xfea0('0x53'):if(_0x3495ab[_0xfea0('0x54')]&&_0x3495ab[_0xfea0('0x23')]){var _0x2195e5={'dst':_0x1b0f71[_0xfea0('0x24')],'text':_0x1b0f71['body'],'src':_0x3495ab[_0xfea0('0x45')]||_0x3495ab[_0xfea0('0x24')],'url':_0x3495ab['remote']+_0xfea0('0x27')+_0x1b0f71['id']+'/status?token='+_0x3495ab[_0xfea0('0x28')]};var _0x53bea3=util['format']('%s:%s',_0x3495ab[_0xfea0('0x54')],_0x3495ab[_0xfea0('0x23')]);var _0x2378ce={'method':_0xfea0('0x39'),'uri':util[_0xfea0('0x46')](_0xfea0('0x55'),_0x3495ab[_0xfea0('0x54')]),'body':_0x2195e5,'headers':{'Authorization':util[_0xfea0('0x46')](_0xfea0('0x49'),new Buffer(_0x53bea3)[_0xfea0('0x4a')](_0xfea0('0x4b')))},'json':!![]};rp(_0x2378ce)[_0xfea0('0x1a')](function(_0x31a835){var _0x4b8722={'messageId':_0x31a835[_0xfea0('0x56')][0x0]};return _0x581297[_0xfea0('0x1b')](_0x4b8722);})[_0xfea0('0x2a')](function(_0x17ea3f){logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x53'),util[_0xfea0('0x3e')](_0x17ea3f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x53'),_0xfea0('0x57'));}break;case _0xfea0('0x58'):if(_0x3495ab[_0xfea0('0x30')]&&_0x3495ab[_0xfea0('0x35')]){if(_0x3495ab[_0xfea0('0x59')]){var _0x17c600={'method':_0xfea0('0x39'),'uri':_0x3495ab[_0xfea0('0x59')]+'/auth/1/session','body':{'username':_0x3495ab['username'],'password':_0x3495ab[_0xfea0('0x35')]},'json':!![]};return rp(_0x17c600)[_0xfea0('0x1a')](function(_0x1730ab){var _0x448312={'method':_0xfea0('0x39'),'uri':_0x3495ab[_0xfea0('0x59')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3495ab[_0xfea0('0x24')],'destinations':[{'to':_0x1b0f71['phone']}],'text':_0x1b0f71[_0xfea0('0x10')],'notifyUrl':_0x3495ab[_0xfea0('0x26')]+_0xfea0('0x27')+_0x1b0f71['id']+_0xfea0('0x5a')+_0x3495ab[_0xfea0('0x28')],'notifyContentType':_0xfea0('0x5b'),'callbackData':_0x3495ab['phone']+';'+_0x1b0f71[_0xfea0('0x10')]}]},'headers':{'Authorization':_0xfea0('0x5c')+_0x1730ab['token']},'json':!![]};return rp(_0x448312)['then'](function(_0x4549cd){if(_0x4549cd['messages']){var _0x2f92d3={'messageId':_0x4549cd[_0xfea0('0x25')][0x0]['messageId']};if(!_0x3495ab[_0xfea0('0x3d')]){_0x2f92d3['read']=!![];}return _0x581297['update'](_0x2f92d3);}else{return logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfea0('0x2d'),_0xfea0('0x58'),util[_0xfea0('0x3e')](_0x4549cd,{'showHidden':![],'depth':null}));}});})[_0xfea0('0x2a')](function(_0x1480f7){return logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfea0('0x2d'),_0xfea0('0x58'),util[_0xfea0('0x3e')](_0x1480f7,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x58'),_0xfea0('0x5d'));}}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),'infobip',_0xfea0('0x3f'));}break;case'csc':var _0x209dc8=require(_0xfea0('0x5e'));if(_0x3495ab['apiKey']){var _0x440df9={};_0x440df9[_0xfea0('0x5f')]=_0x3495ab[_0xfea0('0x30')];_0x440df9['phone']=_0x1b0f71[_0xfea0('0x24')];_0x440df9[_0xfea0('0x32')]=_0x3495ab[_0xfea0('0x24')];_0x440df9[_0xfea0('0x60')]=_0x1b0f71[_0xfea0('0x10')];_0x440df9['timestamp']=+new Date();var _0x226bca='';var _0xf1e2b2='';var _0x5957cf=Object[_0xfea0('0x61')](_0x440df9);_0x5957cf[_0xfea0('0x62')]();for(var _0x2737e9=0x0;_0x2737e9<_0x5957cf['length'];_0x2737e9++){if(_0x226bca!=''){_0x226bca+='&';}_0x226bca+=_0x5957cf[_0x2737e9]+'='+encodeURIComponent(_0x440df9[_0x5957cf[_0x2737e9]]);_0xf1e2b2+=_0x440df9[_0x5957cf[_0x2737e9]];}_0xf1e2b2+=_0x3495ab['apiKey'];_0xf1e2b2=_0x209dc8[_0xfea0('0x63')](_0xfea0('0x64'))[_0xfea0('0x1b')](_0xf1e2b2)[_0xfea0('0x65')]('hex');if(_0x226bca!==''){_0x226bca+='&';}_0x226bca+='signature='+_0xf1e2b2;var _0x5d8c7d={'method':'GET','uri':_0x3495ab[_0xfea0('0x59')]+_0xfea0('0x66')+_0x226bca,'json':!![]};return rp(_0x5d8c7d)['then'](function(_0x13da79){var _0x2284dc=Object[_0xfea0('0x61')](_0x13da79);if(_0x13da79[_0x2284dc[0x0]][_0xfea0('0x2b')]&&parseInt(_0x13da79[_0x2284dc[0x0]][_0xfea0('0x2b')])===0x0){var _0xac099c={'messageId':_0x13da79[_0x2284dc[0x0]][_0xfea0('0x67')]};if(!_0x3495ab['deliveryReport']){_0xac099c[_0xfea0('0x51')]=!![];}return _0x581297['update'](_0xac099c);}else{return logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x68'),util[_0xfea0('0x3e')](_0x13da79['error'],{'showHidden':![],'depth':null}));}})[_0xfea0('0x2a')](function(_0x4a7702){return logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x68'),util['inspect'](_0x4a7702,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfea0('0x68'),_0xfea0('0x69'));}break;case _0xfea0('0x6a'):if(_0x3495ab[_0xfea0('0x6b')]){var _0x31345c={'method':'POST','uri':_0xfea0('0x6c'),'headers':{'Authorization':_0x3495ab[_0xfea0('0x6b')]},'body':{'content':_0x1b0f71[_0xfea0('0x10')],'to':[_0x1b0f71[_0xfea0('0x24')]],'from':_0x3495ab[_0xfea0('0x24')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x31345c)[_0xfea0('0x1a')](function(_0x8e0f16){if(!_0x8e0f16[_0xfea0('0x2b')]){var _0x201209={'messageId':_0x8e0f16[_0xfea0('0x25')][0x0][_0xfea0('0x6d')]};if(!_0x3495ab[_0xfea0('0x3d')]){_0x201209[_0xfea0('0x51')]=!![];}return _0x581297[_0xfea0('0x1b')](_0x201209);}else{return logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0xfea0('0x3e')](_0x8e0f16[_0xfea0('0x2b')],{'showHidden':![],'depth':null}));}})[_0xfea0('0x2a')](function(_0xd1d2c3){return logger['error'](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x6a'),util[_0xfea0('0x3e')](_0xd1d2c3,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x6a'),_0xfea0('0x69'));}break;case'bandwidth':if(_0x3495ab[_0xfea0('0x30')]&&_0x3495ab[_0xfea0('0x35')]){var _0x53bea3=util[_0xfea0('0x46')](_0xfea0('0x47'),_0x3495ab[_0xfea0('0x30')],_0x3495ab[_0xfea0('0x35')]);var _0x2378ce={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3495ab[_0xfea0('0x6e')]+'/messages','body':{'to':[_0x1b0f71[_0xfea0('0x24')]],'text':_0x1b0f71[_0xfea0('0x10')],'from':_0x3495ab[_0xfea0('0x24')],'applicationId':_0x3495ab[_0xfea0('0x6f')]},'headers':{'Authorization':util['format'](_0xfea0('0x49'),new Buffer(_0x53bea3)[_0xfea0('0x4a')](_0xfea0('0x4b')))},'json':!![]};rp(_0x2378ce)[_0xfea0('0x1a')](function(_0x369c79){if(_0x369c79['id']){var _0x142658={'messageId':_0x369c79['id']};return _0x581297[_0xfea0('0x1b')](_0x142658);}else{logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),'bandwidth',util[_0xfea0('0x3e')](_0x369c79,{'showHidden':![],'depth':null}));}})[_0xfea0('0x2a')](function(_0x5ade14){logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x70'),util[_0xfea0('0x3e')](_0x5ade14,{'showHidden':![],'depth':null}));});}else{logger[_0xfea0('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xfea0('0x71'):if(_0x3495ab[_0xfea0('0x6b')]){var _0x92db05={};var _0x5d8c7d={'method':_0xfea0('0x39'),'uri':_0xfea0('0x72'),'headers':{'Authorization':_0xfea0('0x73')+_0x3495ab[_0xfea0('0x6b')],'Content-Type':_0xfea0('0x5b')},'body':{'from':_0x3495ab[_0xfea0('0x24')],'to':_0x1b0f71['phone'],'text':_0x1b0f71['body']},'json':!![]};return rp(_0x5d8c7d)[_0xfea0('0x1a')](function(_0x25cfa1){if(_0x25cfa1['code']==0xca){_0x92db05['message']=_0x25cfa1;var _0x4b0b52={'method':_0xfea0('0x39'),'uri':_0xfea0('0x74'),'headers':{'Authorization':_0xfea0('0x73')+_0x3495ab[_0xfea0('0x6b')],'Content-Type':_0xfea0('0x5b')},'body':{'refid':_0x92db05[_0xfea0('0x75')][_0xfea0('0x76')]},'json':!![]};return rp(_0x4b0b52)[_0xfea0('0x1a')](function(_0xa9b25){_0x92db05['status']=_0xa9b25;var _0x4ccee1={'messageId':_0x92db05[_0xfea0('0x75')]['refid'],'read':!![]};return _0x581297['update'](_0x4ccee1);});}else{return logger['error'](_0xfea0('0x2c'),'afterCreate',_0xfea0('0x71'),util[_0xfea0('0x3e')](_0x25cfa1,{'showHidden':![],'depth':null}));}})[_0xfea0('0x2a')](function(_0x23846d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfea0('0x2d'),_0xfea0('0x71'),util[_0xfea0('0x3e')](_0x23846d,{'showHidden':![],'depth':null}));});}else{return logger[_0xfea0('0x2b')](_0xfea0('0x2c'),_0xfea0('0x2d'),_0xfea0('0x71'),_0xfea0('0x77'));}break;}}})[_0xfea0('0x78')](function(){_0x50907c();});}else{_0x50907c();}}},'charset':'utf8mb4','collate':_0xfea0('0x79')});};
\ No newline at end of file
index 99470c9..19c5858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f6=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateSmsMessage','create','body','options','stringify','util','moment','bluebird','randomstring'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x17f6,0x6c));var _0x617f=function(_0x2c3f4f,_0x2448d1){_0x2c3f4f=_0x2c3f4f-0x0;var _0x2a8868=_0x17f6[_0x2c3f4f];return _0x2a8868;};'use strict';var _=require('lodash');var util=require(_0x617f('0x0'));var moment=require(_0x617f('0x1'));var BPromise=require(_0x617f('0x2'));var rs=require(_0x617f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x617f('0x4'))(_0x617f('0x5'));var config=require('../../config/environment');var jayson=require(_0x617f('0x6'));var client=jayson[_0x617f('0x7')][_0x617f('0x8')]({'port':0x232a});config[_0x617f('0x9')]=_[_0x617f('0xa')](config[_0x617f('0x9')],{'host':_0x617f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x617f('0xc'))[_0x617f('0xd')](socket);function respondWithRpcPromise(_0x3702d5,_0x10a378,_0x3c8d4f){return new BPromise(function(_0x226a6a,_0x4337ac){return client[_0x617f('0xe')](_0x3702d5,_0x3c8d4f)[_0x617f('0xf')](function(_0x1b9b77){logger[_0x617f('0x10')](_0x617f('0x11'),_0x10a378,_0x617f('0x12'));logger['debug'](_0x617f('0x13'),_0x10a378,_0x617f('0x12'),JSON['stringify'](_0x1b9b77));if(_0x1b9b77[_0x617f('0x14')]){if(_0x1b9b77['error']['code']===0x1f4){logger[_0x617f('0x14')](_0x617f('0x11'),_0x10a378,_0x1b9b77['error'][_0x617f('0x15')]);return _0x4337ac(_0x1b9b77[_0x617f('0x14')][_0x617f('0x15')]);}logger[_0x617f('0x14')]('SmsMessage,\x20%s,\x20%s',_0x10a378,_0x1b9b77[_0x617f('0x14')]['message']);return _0x226a6a(_0x1b9b77[_0x617f('0x14')]['message']);}else{logger[_0x617f('0x10')]('SmsMessage,\x20%s,\x20%s',_0x10a378,_0x617f('0x12'));_0x226a6a(_0x1b9b77[_0x617f('0x16')][_0x617f('0x15')]);}})['catch'](function(_0x32bd4d){logger[_0x617f('0x14')](_0x617f('0x11'),_0x10a378,_0x32bd4d);_0x4337ac(_0x32bd4d);});});}exports[_0x617f('0x17')]=function(_0x12d301){var _0x1226fc=this;return new Promise(function(_0x5e1ef2,_0x53ce75){return db['SmsMessage'][_0x617f('0x18')](_0x12d301[_0x617f('0x19')],{'raw':_0x12d301[_0x617f('0x1a')]?_0x12d301[_0x617f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x617f('0xf')](function(_0x677d47){logger[_0x617f('0x10')](_0x617f('0x17'),_0x12d301);logger['debug'](_0x617f('0x17'),_0x12d301,JSON[_0x617f('0x1b')](_0x677d47));_0x5e1ef2(_0x677d47);})['catch'](function(_0x125245){logger['error'](_0x617f('0x17'),_0x125245[_0x617f('0x15')],_0x12d301);_0x53ce75(_0x1226fc[_0x617f('0x14')](0x1f4,_0x125245['message']));});});};
\ No newline at end of file
+var _0x74c2=['redis','defaults','socket.io-emitter','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage','create','body','options','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x74c2,0x199));var _0x274c=function(_0x4e6178,_0x2b595d){_0x4e6178=_0x4e6178-0x0;var _0x1fc44f=_0x74c2[_0x4e6178];return _0x1fc44f;};'use strict';var _=require(_0x274c('0x0'));var util=require('util');var moment=require(_0x274c('0x1'));var BPromise=require(_0x274c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x274c('0x3'));var db=require(_0x274c('0x4'))['db'];var utils=require(_0x274c('0x5'));var logger=require(_0x274c('0x6'))(_0x274c('0x7'));var config=require(_0x274c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x274c('0x9')][_0x274c('0xa')]({'port':0x232a});config[_0x274c('0xb')]=_[_0x274c('0xc')](config[_0x274c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x274c('0xd'))(new Redis(config[_0x274c('0xb')]));require('./smsMessage.socket')[_0x274c('0xe')](socket);function respondWithRpcPromise(_0x48f00e,_0x35f615,_0x25f3c9){return new BPromise(function(_0x18e757,_0x3cbc0d){return client['request'](_0x48f00e,_0x25f3c9)[_0x274c('0xf')](function(_0x894c00){logger[_0x274c('0x10')](_0x274c('0x11'),_0x35f615,_0x274c('0x12'));logger[_0x274c('0x13')](_0x274c('0x14'),_0x35f615,'request\x20sent',JSON[_0x274c('0x15')](_0x894c00));if(_0x894c00['error']){if(_0x894c00[_0x274c('0x16')]['code']===0x1f4){logger[_0x274c('0x16')]('SmsMessage,\x20%s,\x20%s',_0x35f615,_0x894c00['error']['message']);return _0x3cbc0d(_0x894c00[_0x274c('0x16')][_0x274c('0x17')]);}logger[_0x274c('0x16')](_0x274c('0x11'),_0x35f615,_0x894c00[_0x274c('0x16')]['message']);return _0x18e757(_0x894c00['error'][_0x274c('0x17')]);}else{logger['info'](_0x274c('0x11'),_0x35f615,'request\x20sent');_0x18e757(_0x894c00[_0x274c('0x18')]['message']);}})[_0x274c('0x19')](function(_0x199770){logger['error'](_0x274c('0x11'),_0x35f615,_0x199770);_0x3cbc0d(_0x199770);});});}exports[_0x274c('0x1a')]=function(_0xe0de3b){var _0x92a35b=this;return new Promise(function(_0x4e5173,_0x5bb8a2){return db['SmsMessage'][_0x274c('0x1b')](_0xe0de3b[_0x274c('0x1c')],{'raw':_0xe0de3b[_0x274c('0x1d')]?_0xe0de3b['options']['raw']===undefined?!![]:![]:!![]})[_0x274c('0xf')](function(_0x27b877){logger['info'](_0x274c('0x1a'),_0xe0de3b);logger[_0x274c('0x13')](_0x274c('0x1a'),_0xe0de3b,JSON['stringify'](_0x27b877));_0x4e5173(_0x27b877);})[_0x274c('0x19')](function(_0x36bb9a){logger[_0x274c('0x16')]('CreateSmsMessage',_0x36bb9a[_0x274c('0x17')],_0xe0de3b);_0x5bb8a2(_0x92a35b[_0x274c('0x16')](0x1f4,_0x36bb9a[_0x274c('0x17')]));});});};
\ No newline at end of file
index 278b0e8..83fbc55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc485=['update','emit','smsMessage:','save'];(function(_0x39f6bd,_0x5d93ec){var _0x44b886=function(_0x4bdde4){while(--_0x4bdde4){_0x39f6bd['push'](_0x39f6bd['shift']());}};_0x44b886(++_0x5d93ec);}(_0xc485,0xfb));var _0x5c48=function(_0x2299e8,_0x3e4063){_0x2299e8=_0x2299e8-0x0;var _0x433c0e=_0xc485[_0x2299e8];return _0x433c0e;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x5c48('0x0'),'remove',_0x5c48('0x1')];function createListener(_0x348873,_0x2e9a3b){return function(_0x11cb9e){_0x2e9a3b[_0x5c48('0x2')](_0x348873,_0x11cb9e);};}function removeListener(_0x1d7ede,_0x923137){return function(){SmsMessageEvents['removeListener'](_0x1d7ede,_0x923137);};}exports['register']=function(_0x2718cb){for(var _0x20f986=0x0,_0x2b54af=events['length'];_0x20f986<_0x2b54af;_0x20f986++){var _0x23912b=events[_0x20f986];var _0x425673=createListener(_0x5c48('0x3')+_0x23912b,_0x2718cb);SmsMessageEvents['on'](_0x23912b,_0x425673);}};
\ No newline at end of file
+var _0x1c52=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x33b648,_0xd5a7f3){var _0x4665de=function(_0x266b9d){while(--_0x266b9d){_0x33b648['push'](_0x33b648['shift']());}};_0x4665de(++_0xd5a7f3);}(_0x1c52,0x84));var _0x21c5=function(_0x11e925,_0xd4024f){_0x11e925=_0x11e925-0x0;var _0x49bfb1=_0x1c52[_0x11e925];return _0x49bfb1;};'use strict';var SmsMessageEvents=require(_0x21c5('0x0'));var events=[_0x21c5('0x1'),_0x21c5('0x2'),_0x21c5('0x3')];function createListener(_0xa9abdf,_0x12d6bf){return function(_0xd77754){_0x12d6bf[_0x21c5('0x4')](_0xa9abdf,_0xd77754);};}function removeListener(_0x56f3af,_0xc21678){return function(){SmsMessageEvents[_0x21c5('0x5')](_0x56f3af,_0xc21678);};}exports[_0x21c5('0x6')]=function(_0x3f0219){for(var _0xa10c47=0x0,_0x51e7b0=events[_0x21c5('0x7')];_0xa10c47<_0x51e7b0;_0xa10c47++){var _0x1451bf=events[_0xa10c47];var _0x451252=createListener(_0x21c5('0x8')+_0x1451bf,_0x3f0219);SmsMessageEvents['on'](_0x1451bf,_0x451252);}};
\ No newline at end of file
index 2c0f681..9116a16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x255c=['show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','delete','destroy','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe'];(function(_0x5e6fe1,_0x8f80ad){var _0x5a6018=function(_0x1f1225){while(--_0x1f1225){_0x5e6fe1['push'](_0x5e6fe1['shift']());}};_0x5a6018(++_0x8f80ad);}(_0x255c,0x1bd));var _0xc255=function(_0x46a635,_0x3cf6f0){_0x46a635=_0x46a635-0x0;var _0xff72f1=_0x255c[_0x46a635];return _0xff72f1;};'use strict';var multer=require(_0xc255('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc255('0x1'));var express=require(_0xc255('0x2'));var router=express['Router']();var fs_extra=require(_0xc255('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc255('0x4'));var config=require(_0xc255('0x5'));var controller=require(_0xc255('0x6'));router['get']('/',auth[_0xc255('0x7')](),controller[_0xc255('0x8')]);router[_0xc255('0x9')](_0xc255('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xc255('0x7')](),controller[_0xc255('0xb')]);router[_0xc255('0x9')]('/:id/members',auth[_0xc255('0x7')](),controller[_0xc255('0xc')]);router[_0xc255('0x9')](_0xc255('0xd'),auth[_0xc255('0x7')](),controller[_0xc255('0xe')]);router['get'](_0xc255('0xf'),auth[_0xc255('0x7')](),controller[_0xc255('0x10')]);router[_0xc255('0x11')]('/',auth[_0xc255('0x7')](),controller[_0xc255('0x12')]);router[_0xc255('0x11')](_0xc255('0xd'),auth[_0xc255('0x7')](),controller['addTeams']);router['post']('/:id/users',auth[_0xc255('0x7')](),controller['addAgents']);router[_0xc255('0x13')]('/:id',auth[_0xc255('0x7')](),controller['update']);router[_0xc255('0x14')]('/:id',auth[_0xc255('0x7')](),controller[_0xc255('0x15')]);router[_0xc255('0x14')](_0xc255('0xd'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xc255('0x7')](),controller[_0xc255('0x16')]);module[_0xc255('0x17')]=router;
\ No newline at end of file
+var _0xe8a9=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xe8a9,0xbb));var _0x9e8a=function(_0x43efc6,_0x5324d0){_0x43efc6=_0x43efc6-0x0;var _0x5242ab=_0xe8a9[_0x43efc6];return _0x5242ab;};'use strict';var multer=require(_0x9e8a('0x0'));var util=require('util');var path=require(_0x9e8a('0x1'));var timeout=require(_0x9e8a('0x2'));var express=require(_0x9e8a('0x3'));var router=express[_0x9e8a('0x4')]();var fs_extra=require(_0x9e8a('0x5'));var auth=require(_0x9e8a('0x6'));var interaction=require(_0x9e8a('0x7'));var config=require('../../config/environment');var controller=require(_0x9e8a('0x8'));router[_0x9e8a('0x9')]('/',auth[_0x9e8a('0xa')](),controller[_0x9e8a('0xb')]);router[_0x9e8a('0x9')](_0x9e8a('0xc'),auth[_0x9e8a('0xa')](),controller[_0x9e8a('0xd')]);router['get'](_0x9e8a('0xe'),auth[_0x9e8a('0xa')](),controller[_0x9e8a('0xf')]);router[_0x9e8a('0x9')]('/:id/members',auth[_0x9e8a('0xa')](),controller[_0x9e8a('0x10')]);router[_0x9e8a('0x9')](_0x9e8a('0x11'),auth[_0x9e8a('0xa')](),controller[_0x9e8a('0x12')]);router[_0x9e8a('0x9')](_0x9e8a('0x13'),auth[_0x9e8a('0xa')](),controller[_0x9e8a('0x14')]);router['post']('/',auth[_0x9e8a('0xa')](),controller[_0x9e8a('0x15')]);router[_0x9e8a('0x16')](_0x9e8a('0x11'),auth['isAuthenticated'](),controller[_0x9e8a('0x17')]);router[_0x9e8a('0x16')](_0x9e8a('0x13'),auth[_0x9e8a('0xa')](),controller['addAgents']);router[_0x9e8a('0x18')](_0x9e8a('0xe'),auth['isAuthenticated'](),controller[_0x9e8a('0x19')]);router[_0x9e8a('0x1a')](_0x9e8a('0xe'),auth[_0x9e8a('0xa')](),controller[_0x9e8a('0x1b')]);router['delete'](_0x9e8a('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x9e8a('0x1a')](_0x9e8a('0x13'),auth[_0x9e8a('0xa')](),controller['removeAgents']);module[_0x9e8a('0x1c')]=router;
\ No newline at end of file
index 5f5ed25..caefd4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceaf=['exports','STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x1a0550,_0x3d178d){var _0x5bcfe5=function(_0x327457){while(--_0x327457){_0x1a0550['push'](_0x1a0550['shift']());}};_0x5bcfe5(++_0x3d178d);}(_0xceaf,0x7f));var _0xfcea=function(_0x143cb2,_0x463d10){_0x143cb2=_0x143cb2-0x0;var _0x3d0d97=_0xceaf[_0x143cb2];return _0x3d0d97;};'use strict';var Sequelize=require(_0xfcea('0x0'));module[_0xfcea('0x1')]={'name':{'type':Sequelize[_0xfcea('0x2')],'unique':_0xfcea('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfcea('0x2')]},'timeout':{'type':Sequelize[_0xfcea('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfcea('0x5')]('rrmemory',_0xfcea('0x6'),_0xfcea('0x7'))}};
\ No newline at end of file
+var _0xa68c=['exports','STRING','name','beepall'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0xa68c,0x154));var _0xca68=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa68c[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require('sequelize');module[_0xca68('0x0')]={'name':{'type':Sequelize[_0xca68('0x1')],'unique':_0xca68('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xca68('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xca68('0x3'),'roundrobin')}};
\ No newline at end of file
index d6f66b3..2aeaed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2507=['nolimit','where','filters','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','intersection','order','sort','pick','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','interface','sequelize','transaction','userSmsQueue:save','removeTeams','select','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','toString','QueryTypes','SELECT','every','includes','union','compact','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','rawAttributes','fieldName','model','map','query','attributes','fields','length','hasOwnProperty'];(function(_0x18806d,_0x843cb2){var _0x11ad45=function(_0x4c618d){while(--_0x4c618d){_0x18806d['push'](_0x18806d['shift']());}};_0x11ad45(++_0x843cb2);}(_0x2507,0xda));var _0x7250=function(_0x4bb07f,_0x4f6c63){_0x4bb07f=_0x4bb07f-0x0;var _0x5e0db3=_0x2507[_0x4bb07f];return _0x5e0db3;};'use strict';var emlformat=require(_0x7250('0x0'));var rimraf=require(_0x7250('0x1'));var zipdir=require(_0x7250('0x2'));var jsonpatch=require(_0x7250('0x3'));var rp=require(_0x7250('0x4'));var moment=require('moment');var BPromise=require(_0x7250('0x5'));var Mustache=require('mustache');var util=require(_0x7250('0x6'));var path=require(_0x7250('0x7'));var sox=require(_0x7250('0x8'));var csv=require(_0x7250('0x9'));var ejs=require(_0x7250('0xa'));var fs=require('fs');var fs_extra=require(_0x7250('0xb'));var _=require(_0x7250('0xc'));var squel=require('squel');var crypto=require(_0x7250('0xd'));var jsforce=require(_0x7250('0xe'));var deskjs=require(_0x7250('0xf'));var toCsv=require(_0x7250('0x9'));var querystring=require('querystring');var Papa=require(_0x7250('0x10'));var Redis=require('ioredis');var authService=require(_0x7250('0x11'));var qs=require(_0x7250('0x12'));var as=require(_0x7250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7250('0x14'))(_0x7250('0x15'));var utils=require(_0x7250('0x16'));var config=require(_0x7250('0x17'));var licenseUtil=require(_0x7250('0x18'));var db=require(_0x7250('0x19'))['db'];config['redis']=_[_0x7250('0x1a')](config[_0x7250('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x7250('0x1c')](socket);function respondWithStatusCode(_0x23cef6,_0x11dbb1){_0x11dbb1=_0x11dbb1||0xcc;return function(_0x62b3bb){if(_0x62b3bb){return _0x23cef6[_0x7250('0x1d')](_0x11dbb1);}return _0x23cef6[_0x7250('0x1e')](_0x11dbb1)[_0x7250('0x1f')]();};}function respondWithResult(_0x31641a,_0x5de541){_0x5de541=_0x5de541||0xc8;return function(_0x361bbc){if(_0x361bbc){return _0x31641a['status'](_0x5de541)[_0x7250('0x20')](_0x361bbc);}};}function respondWithFilteredResult(_0x4bee8d,_0x24a6de){return function(_0x540d3c){if(_0x540d3c){var _0x351b67=typeof _0x24a6de[_0x7250('0x21')]===_0x7250('0x22')&&typeof _0x24a6de[_0x7250('0x23')]===_0x7250('0x22');var _0x40f154=_0x540d3c['count'];var _0x4acd29=_0x351b67?0x0:_0x24a6de[_0x7250('0x21')];var _0x2f76df=_0x351b67?_0x540d3c[_0x7250('0x24')]:_0x24a6de[_0x7250('0x21')]+_0x24a6de['limit'];var _0x4c9245;if(_0x2f76df>=_0x40f154){_0x2f76df=_0x40f154;_0x4c9245=0xc8;}else{_0x4c9245=0xce;}_0x4bee8d['status'](_0x4c9245);return _0x4bee8d['set'](_0x7250('0x25'),_0x4acd29+'-'+_0x2f76df+'/'+_0x40f154)[_0x7250('0x20')](_0x540d3c);}return null;};}function patchUpdates(_0x5d2779){return function(_0x49c43c){try{jsonpatch['apply'](_0x49c43c,_0x5d2779,!![]);}catch(_0x4fd807){return BPromise[_0x7250('0x26')](_0x4fd807);}return _0x49c43c[_0x7250('0x27')]();};}function saveUpdates(_0x3fa14f,_0x5b266e){return function(_0x3ce1b1){if(_0x3ce1b1){return _0x3ce1b1[_0x7250('0x28')](_0x3fa14f)[_0x7250('0x29')](function(_0x8d3057){return _0x8d3057;});}return null;};}function removeEntity(_0x18bb44,_0x19fff1){return function(_0x395d95){if(_0x395d95){return _0x395d95[_0x7250('0x2a')]()[_0x7250('0x29')](function(){var _0x37a2c8=_0x395d95[_0x7250('0x2b')]({'plain':!![]});var _0x205472=_0x7250('0x2c');return db[_0x7250('0x2d')][_0x7250('0x2a')]({'where':{'type':_0x205472,'resourceId':_0x37a2c8['id']}})[_0x7250('0x29')](function(){return _0x395d95;});})[_0x7250('0x29')](function(){_0x18bb44[_0x7250('0x1e')](0xcc)[_0x7250('0x1f')]();});}};}function handleEntityNotFound(_0x2c991b,_0x5b1cb1){return function(_0x1efe50){if(!_0x1efe50){_0x2c991b[_0x7250('0x1d')](0x194);}return _0x1efe50;};}function handleError(_0xdf22f3,_0x5a2c80){_0x5a2c80=_0x5a2c80||0x1f4;return function(_0x14497f){logger[_0x7250('0x2e')](_0x14497f['stack']);if(_0x14497f[_0x7250('0x2f')]){delete _0x14497f['name'];}_0xdf22f3[_0x7250('0x1e')](_0x5a2c80)[_0x7250('0x30')](_0x14497f);};}exports[_0x7250('0x31')]=function(_0x3dfe92,_0x535050){var _0x334cbe={},_0x197f4d={},_0x380c82={'count':0x0,'rows':[]};var _0x57bdf4=_['map'](db[_0x7250('0x32')][_0x7250('0x33')],function(_0x208753){return{'name':_0x208753[_0x7250('0x34')],'type':_0x208753['type']['key']};});_0x197f4d[_0x7250('0x35')]=_[_0x7250('0x36')](_0x57bdf4,_0x7250('0x2f'));_0x197f4d[_0x7250('0x37')]=_['keys'](_0x3dfe92[_0x7250('0x37')]);_0x197f4d['filters']=_['intersection'](_0x197f4d[_0x7250('0x35')],_0x197f4d['query']);_0x334cbe[_0x7250('0x38')]=_['intersection'](_0x197f4d['model'],qs[_0x7250('0x39')](_0x3dfe92[_0x7250('0x37')][_0x7250('0x39')]));_0x334cbe[_0x7250('0x38')]=_0x334cbe[_0x7250('0x38')][_0x7250('0x3a')]?_0x334cbe[_0x7250('0x38')]:_0x197f4d['model'];if(!_0x3dfe92[_0x7250('0x37')][_0x7250('0x3b')](_0x7250('0x3c'))){_0x334cbe[_0x7250('0x23')]=qs[_0x7250('0x23')](_0x3dfe92[_0x7250('0x37')]['limit']);_0x334cbe[_0x7250('0x21')]=qs[_0x7250('0x21')](_0x3dfe92[_0x7250('0x37')][_0x7250('0x21')]);}_0x334cbe['order']=qs['sort'](_0x3dfe92[_0x7250('0x37')]['sort']);_0x334cbe[_0x7250('0x3d')]=qs[_0x7250('0x3e')](_['pick'](_0x3dfe92[_0x7250('0x37')],_0x197f4d[_0x7250('0x3e')]),_0x57bdf4);if(_0x3dfe92['query'][_0x7250('0x3f')]){_0x334cbe[_0x7250('0x3d')]=_['merge'](_0x334cbe[_0x7250('0x3d')],{'$or':_[_0x7250('0x36')](_0x57bdf4,function(_0x185187){if(_0x185187[_0x7250('0x40')]!=='VIRTUAL'){var _0x20f437={};_0x20f437[_0x185187[_0x7250('0x2f')]]={'$like':'%'+_0x3dfe92[_0x7250('0x37')][_0x7250('0x3f')]+'%'};return _0x20f437;}})});}_0x334cbe=_[_0x7250('0x41')]({},_0x334cbe,_0x3dfe92[_0x7250('0x42')]);var _0xe99909={'where':_0x334cbe[_0x7250('0x3d')]};return db[_0x7250('0x32')]['count'](_0xe99909)[_0x7250('0x29')](function(_0x504aff){_0x380c82[_0x7250('0x24')]=_0x504aff;if(_0x3dfe92[_0x7250('0x37')][_0x7250('0x43')]){_0x334cbe[_0x7250('0x44')]=[{'all':!![]}];}return db[_0x7250('0x32')][_0x7250('0x45')](_0x334cbe);})[_0x7250('0x29')](function(_0x3bf318){_0x380c82[_0x7250('0x46')]=_0x3bf318;return _0x380c82;})[_0x7250('0x29')](respondWithFilteredResult(_0x535050,_0x334cbe))[_0x7250('0x47')](handleError(_0x535050,null));};exports[_0x7250('0x48')]=function(_0x5f55fa,_0x40ae63){var _0x519138={'raw':!![],'where':{'id':_0x5f55fa['params']['id']}},_0x4df12c={};_0x4df12c[_0x7250('0x35')]=_['keys'](db[_0x7250('0x32')][_0x7250('0x33')]);_0x4df12c[_0x7250('0x37')]=_[_0x7250('0x49')](_0x5f55fa[_0x7250('0x37')]);_0x4df12c[_0x7250('0x3e')]=_['intersection'](_0x4df12c['model'],_0x4df12c[_0x7250('0x37')]);_0x519138['attributes']=_['intersection'](_0x4df12c[_0x7250('0x35')],qs[_0x7250('0x39')](_0x5f55fa[_0x7250('0x37')][_0x7250('0x39')]));_0x519138[_0x7250('0x38')]=_0x519138[_0x7250('0x38')][_0x7250('0x3a')]?_0x519138[_0x7250('0x38')]:_0x4df12c[_0x7250('0x35')];if(_0x5f55fa['query'][_0x7250('0x43')]){_0x519138[_0x7250('0x44')]=[{'all':!![]}];}_0x519138=_[_0x7250('0x41')]({},_0x519138,_0x5f55fa[_0x7250('0x42')]);return db[_0x7250('0x32')][_0x7250('0x4a')](_0x519138)[_0x7250('0x29')](handleEntityNotFound(_0x40ae63,null))[_0x7250('0x29')](respondWithResult(_0x40ae63,null))[_0x7250('0x47')](handleError(_0x40ae63,null));};exports[_0x7250('0x4b')]=function(_0x4e5685,_0x20ee8a){return db[_0x7250('0x32')][_0x7250('0x4b')](_0x4e5685['body'],{})[_0x7250('0x29')](function(_0x52ffe9){var _0x190ae8=_0x4e5685[_0x7250('0x4c')][_0x7250('0x2b')]({'plain':!![]});if(!_0x190ae8)throw new Error(_0x7250('0x4d'));if(_0x190ae8[_0x7250('0x4e')]===_0x7250('0x4c')){var _0xfb30b8=_0x52ffe9[_0x7250('0x2b')]({'plain':!![]});var _0x7cd33a='SmsQueues';return db[_0x7250('0x4f')][_0x7250('0x4a')]({'where':{'name':_0x7cd33a,'userProfileId':_0x190ae8['userProfileId']},'raw':!![]})['then'](function(_0x5f0e0d){if(_0x5f0e0d&&_0x5f0e0d['autoAssociation']===0x0){return db[_0x7250('0x2d')][_0x7250('0x4b')]({'name':_0xfb30b8['name'],'resourceId':_0xfb30b8['id'],'type':_0x5f0e0d[_0x7250('0x2f')],'sectionId':_0x5f0e0d['id']},{})[_0x7250('0x29')](function(){return _0x52ffe9;});}else{return _0x52ffe9;}})[_0x7250('0x47')](function(_0x4da41b){logger[_0x7250('0x2e')](_0x7250('0x50'),_0x4da41b);throw _0x4da41b;});}return _0x52ffe9;})[_0x7250('0x29')](respondWithResult(_0x20ee8a,0xc9))['catch'](handleError(_0x20ee8a,null));};exports[_0x7250('0x28')]=function(_0x674a2f,_0x5e8431){if(_0x674a2f[_0x7250('0x51')]['id']){delete _0x674a2f[_0x7250('0x51')]['id'];}return db[_0x7250('0x32')]['find']({'where':{'id':_0x674a2f[_0x7250('0x52')]['id']}})[_0x7250('0x29')](handleEntityNotFound(_0x5e8431,null))['then'](saveUpdates(_0x674a2f[_0x7250('0x51')],null))[_0x7250('0x29')](respondWithResult(_0x5e8431,null))['catch'](handleError(_0x5e8431,null));};exports['destroy']=function(_0x56cf36,_0x18eeac){return db[_0x7250('0x32')]['find']({'where':{'id':_0x56cf36[_0x7250('0x52')]['id']}})[_0x7250('0x29')](handleEntityNotFound(_0x18eeac,null))[_0x7250('0x29')](removeEntity(_0x18eeac,null))[_0x7250('0x47')](handleError(_0x18eeac,null));};exports[_0x7250('0x53')]=function(_0x56cbc2,_0x387d65){return db[_0x7250('0x32')][_0x7250('0x53')]()[_0x7250('0x29')](respondWithResult(_0x387d65,null))[_0x7250('0x47')](handleError(_0x387d65,null));};exports[_0x7250('0x54')]=function(_0x229101,_0x29c782,_0x4e0b4c){var _0x1f3ff8={'raw':!![],'where':{}},_0x4d8c9a={},_0x1e7921;return db[_0x7250('0x32')][_0x7250('0x55')]({'where':{'id':_0x229101[_0x7250('0x52')]['id']}})['then'](handleEntityNotFound(_0x29c782,null))[_0x7250('0x29')](function(_0x1e9a19){if(_0x1e9a19){_0x1e7921=_0x1e9a19['get']({'plain':!![]});_0x4d8c9a[_0x7250('0x35')]=_[_0x7250('0x49')](db[_0x7250('0x56')][_0x7250('0x33')]);_0x4d8c9a['query']=_[_0x7250('0x49')](_0x229101[_0x7250('0x37')]);_0x4d8c9a[_0x7250('0x3e')]=_[_0x7250('0x57')](_0x4d8c9a['model'],_0x4d8c9a[_0x7250('0x37')]);_0x1f3ff8['attributes']=_[_0x7250('0x57')](_0x4d8c9a[_0x7250('0x35')],qs[_0x7250('0x39')](_0x229101[_0x7250('0x37')][_0x7250('0x39')]));_0x1f3ff8[_0x7250('0x38')]=_0x1f3ff8[_0x7250('0x38')][_0x7250('0x3a')]?_0x1f3ff8[_0x7250('0x38')]:_0x4d8c9a[_0x7250('0x35')];if(!_0x229101[_0x7250('0x37')]['hasOwnProperty'](_0x7250('0x3c'))){_0x1f3ff8[_0x7250('0x23')]=qs[_0x7250('0x23')](_0x229101['query'][_0x7250('0x23')]);_0x1f3ff8['offset']=qs[_0x7250('0x21')](_0x229101['query'][_0x7250('0x21')]);}_0x1f3ff8[_0x7250('0x58')]=qs[_0x7250('0x59')](_0x229101[_0x7250('0x37')][_0x7250('0x59')]);_0x1f3ff8[_0x7250('0x3d')]=qs[_0x7250('0x3e')](_[_0x7250('0x5a')](_0x229101[_0x7250('0x37')],_0x4d8c9a[_0x7250('0x3e')]));_0x1f3ff8[_0x7250('0x3d')][_0x7250('0x5b')]=_0x1e9a19['id'];if(_0x229101['query'][_0x7250('0x3f')]){_0x1f3ff8['where']=_['merge'](_0x1f3ff8['where'],{'$or':_[_0x7250('0x36')](_0x1f3ff8[_0x7250('0x38')],function(_0x197d93){var _0x41b838={};_0x41b838[_0x197d93]={'$like':'%'+_0x229101[_0x7250('0x37')][_0x7250('0x3f')]+'%'};return _0x41b838;})});}_0x1f3ff8=_[_0x7250('0x41')]({},_0x1f3ff8,_0x229101[_0x7250('0x42')]);return db[_0x7250('0x56')][_0x7250('0x45')](_0x1f3ff8);}})[_0x7250('0x29')](function(_0x201b29){if(_0x201b29){return db[_0x7250('0x5c')][_0x7250('0x5d')]({'where':{'id':_[_0x7250('0x36')](_0x201b29,'UserId'),'role':_0x7250('0x5e')},'attributes':['id',_0x7250('0x2f'),_0x7250('0x5f'),_0x7250('0x60'),'createdAt']});}})['then'](function(_0x2346ad){if(_0x2346ad){return{'count':_0x2346ad[_0x7250('0x24')],'rows':_[_0x7250('0x36')](_0x2346ad[_0x7250('0x46')],function(_0x2b0f75){return{'membername':_0x2b0f75[_0x7250('0x2f')],'UserId':_0x2b0f75['id'],'queue_name':_0x1e7921['name'],'SmsQueueId':_0x1e7921['id'],'interface':util[_0x7250('0x61')](_0x7250('0x62'),_0x7250('0x63'),_0x2b0f75[_0x7250('0x2f')]),'penalty':0x0,'paused':_0x2b0f75[_0x7250('0x5f')],'createdAt':_0x2b0f75[_0x7250('0x64')],'updatedAt':_0x2b0f75[_0x7250('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7250('0x29')](respondWithFilteredResult(_0x29c782,_0x1f3ff8))['catch'](handleError(_0x29c782,null));};exports[_0x7250('0x65')]=function(_0x5322a2,_0x38ce97,_0x54a68d){var _0x91bab8={};var _0x2d076b={};var _0x3ed40e;var _0x54b1e3;return db[_0x7250('0x32')][_0x7250('0x55')]({'where':{'id':_0x5322a2[_0x7250('0x52')]['id']}})[_0x7250('0x29')](handleEntityNotFound(_0x38ce97,null))[_0x7250('0x29')](function(_0x2155d7){if(_0x2155d7){_0x3ed40e=_0x2155d7;_0x2d076b[_0x7250('0x35')]=_[_0x7250('0x49')](db[_0x7250('0x66')][_0x7250('0x33')]);_0x2d076b[_0x7250('0x37')]=_[_0x7250('0x49')](_0x5322a2['query']);_0x2d076b['filters']=_[_0x7250('0x57')](_0x2d076b[_0x7250('0x35')],_0x2d076b[_0x7250('0x37')]);_0x91bab8[_0x7250('0x38')]=_[_0x7250('0x57')](_0x2d076b['model'],qs[_0x7250('0x39')](_0x5322a2[_0x7250('0x37')]['fields']));_0x91bab8[_0x7250('0x38')]=_0x91bab8[_0x7250('0x38')]['length']?_0x91bab8[_0x7250('0x38')]:_0x2d076b[_0x7250('0x35')];_0x91bab8[_0x7250('0x58')]=qs['sort'](_0x5322a2[_0x7250('0x37')]['sort']);_0x91bab8[_0x7250('0x3d')]=qs[_0x7250('0x3e')](_[_0x7250('0x5a')](_0x5322a2[_0x7250('0x37')],_0x2d076b[_0x7250('0x3e')]));if(_0x5322a2[_0x7250('0x37')][_0x7250('0x3f')]){_0x91bab8[_0x7250('0x3d')]=_['merge'](_0x91bab8[_0x7250('0x3d')],{'$or':_['map'](_0x91bab8['attributes'],function(_0xdf785e){var _0x4b0b84={};_0x4b0b84[_0xdf785e]={'$like':'%'+_0x5322a2[_0x7250('0x37')][_0x7250('0x3f')]+'%'};return _0x4b0b84;})});}_0x91bab8=_['merge']({},_0x91bab8,_0x5322a2['options']);return _0x3ed40e[_0x7250('0x65')](_0x91bab8);}})[_0x7250('0x29')](function(_0x3ed0df){if(_0x3ed0df){_0x54b1e3=_0x3ed0df[_0x7250('0x3a')];if(!_0x5322a2[_0x7250('0x37')][_0x7250('0x3b')](_0x7250('0x3c'))){_0x91bab8[_0x7250('0x23')]=qs[_0x7250('0x23')](_0x5322a2[_0x7250('0x37')][_0x7250('0x23')]);_0x91bab8[_0x7250('0x21')]=qs[_0x7250('0x21')](_0x5322a2[_0x7250('0x37')]['offset']);}return _0x3ed40e[_0x7250('0x65')](_0x91bab8);}})[_0x7250('0x29')](function(_0x4de060){if(_0x4de060){return _0x4de060?{'count':_0x54b1e3,'rows':_0x4de060}:null;}})[_0x7250('0x29')](respondWithResult(_0x38ce97,null))[_0x7250('0x47')](handleError(_0x38ce97,null));};exports[_0x7250('0x67')]=function(_0x429637,_0x5bebf0,_0x17b5a6){var _0x2bd08f=_0x429637[_0x7250('0x51')][_0x7250('0x68')];return db[_0x7250('0x66')][_0x7250('0x45')]({'where':{'id':_0x2bd08f},'attributes':['id'],'include':[{'model':db[_0x7250('0x5c')],'as':_0x7250('0x69'),'attributes':['id',_0x7250('0x2f'),_0x7250('0x6a'),'voicePause',_0x7250('0x6b')],'raw':!![]}]})['then'](function(_0x1c4f80){if(_0x1c4f80){var _0x2f1b75=_['flatMap'](_0x1c4f80,function(_0x233233){var _0x32332e=_0x233233['get']({'plain':!![]});return _0x32332e[_0x7250('0x69')];});return db['SmsQueue'][_0x7250('0x4a')]({'where':{'id':_0x429637[_0x7250('0x52')]['id']}})[_0x7250('0x29')](function(_0x52e4be){return db[_0x7250('0x6c')][_0x7250('0x6d')](function(_0x312ca9){return _0x52e4be['addTeams'](_0x2bd08f,{'transaction':_0x312ca9})[_0x7250('0x29')](function(){return BPromise['each'](_0x2f1b75,function(_0x4b39e1){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4b39e1['id'],'SmsQueueId':_0x429637[_0x7250('0x52')]['id']},'transaction':_0x312ca9});});})[_0x7250('0x29')](function(){_0x2f1b75['forEach'](function(_0x1a365a){socket['emit'](_0x7250('0x6e'),{'UserId':_0x1a365a['id'],'SmsQueueId':_0x52e4be['id']});});});});});}})[_0x7250('0x29')](respondWithStatusCode(_0x5bebf0,null))[_0x7250('0x47')](handleError(_0x5bebf0,null));};exports[_0x7250('0x6f')]=function(_0x43abe8,_0x47b7ce,_0x396953){return db['Team']['findAll']({'where':{'id':_0x43abe8[_0x7250('0x37')][_0x7250('0x68')]},'attributes':['id'],'include':[{'model':db[_0x7250('0x5c')],'as':_0x7250('0x69'),'attributes':['id'],'raw':!![]}]})[_0x7250('0x29')](handleEntityNotFound(_0x47b7ce,null))[_0x7250('0x29')](function(_0x5b7acd){var _0x29f76e=_[_0x7250('0x36')](_0x5b7acd,'id');var _0x78c1b8=[];var _0x213cfd=[];var _0x3660b1=squel[_0x7250('0x70')]();_0x3660b1[_0x7250('0x71')](_0x7250('0x72'))[_0x7250('0x73')](_0x7250('0x74'),'tq')[_0x7250('0x75')](_0x7250('0x76'),'ut',_0x7250('0x77'))['where'](_0x7250('0x78'),_0x43abe8[_0x7250('0x52')]['id']);for(var _0x5c156f=0x0;_0x5c156f<_0x5b7acd[_0x7250('0x3a')];_0x5c156f+=0x1){let _0x12db43=_0x5b7acd[_0x5c156f];for(var _0x3170d5=0x0;_0x3170d5<_0x12db43['Agents']['length'];_0x3170d5+=0x1){let _0x5e7cfc=_0x12db43[_0x7250('0x69')][_0x3170d5];var _0x379acf=_0x3660b1[_0x7250('0x79')]();_0x379acf[_0x7250('0x3d')](_0x7250('0x7a'),_0x5e7cfc['id']);_0x213cfd[_0x7250('0x7b')](db[_0x7250('0x6c')][_0x7250('0x37')](_0x379acf[_0x7250('0x7c')](),{'type':db['sequelize'][_0x7250('0x7d')][_0x7250('0x7e')]})[_0x7250('0x29')](function(_0x3cba0c){if(_0x3cba0c[_0x7250('0x3a')]===0x1){return _0x5e7cfc['id'];}else{var _0x45a4dc=_[_0x7250('0x7f')](_[_0x7250('0x36')](_0x3cba0c,'TeamId'),function(_0x368ec4){return _[_0x7250('0x80')](_0x29f76e,_0x368ec4);});if(_0x45a4dc){return _0x5e7cfc['id'];}}}));}}return BPromise['all'](_0x213cfd)[_0x7250('0x29')](function(_0x20ed94){_0x78c1b8=_(_0x78c1b8)[_0x7250('0x81')](_0x20ed94)[_0x7250('0x82')]()['value']();return db[_0x7250('0x32')]['find']({'where':{'id':_0x43abe8[_0x7250('0x52')]['id']}})['then'](function(_0xecc791){return db[_0x7250('0x6c')][_0x7250('0x6d')](function(_0x2b03f7){return _0xecc791['removeTeams'](_0x43abe8[_0x7250('0x37')]['ids'],{'transaction':_0x2b03f7})[_0x7250('0x29')](function(){if(!_['isEmpty'](_0x78c1b8)){return _0xecc791[_0x7250('0x83')](_0x78c1b8,{'transaction':_0x2b03f7});}})[_0x7250('0x29')](function(){_0x78c1b8['forEach'](function(_0x413703){socket[_0x7250('0x84')](_0x7250('0x85'),{'UserId':_0x413703,'SmsQueueId':_0xecc791['id']});});});});});});})['then'](respondWithStatusCode(_0x47b7ce,null))['catch'](handleError(_0x47b7ce,null));};exports[_0x7250('0x86')]=function(_0x32a53f,_0x7782ff,_0x17035f){return db[_0x7250('0x32')][_0x7250('0x4a')]({'where':{'id':_0x32a53f[_0x7250('0x52')]['id']}})[_0x7250('0x29')](handleEntityNotFound(_0x7782ff,null))[_0x7250('0x29')](function(_0x4f5f7e){if(_0x4f5f7e){return _0x4f5f7e['addAgents'](_0x32a53f[_0x7250('0x51')]['ids'],_[_0x7250('0x87')](_0x32a53f['body'],[_0x7250('0x68'),'id'])||{})[_0x7250('0x88')](function(_0x362eb8){for(var _0x1d7c72=0x0;_0x1d7c72<_0x32a53f['body'][_0x7250('0x68')][_0x7250('0x3a')];_0x1d7c72+=0x1){socket[_0x7250('0x84')](_0x7250('0x6e'),{'UserId':Number(_0x32a53f[_0x7250('0x51')][_0x7250('0x68')][_0x1d7c72]),'SmsQueueId':Number(_0x32a53f[_0x7250('0x52')]['id'])});}return _0x362eb8;});}})[_0x7250('0x29')](respondWithResult(_0x7782ff,null))[_0x7250('0x47')](handleError(_0x7782ff,null));};exports[_0x7250('0x83')]=function(_0x44a576,_0x2f478c,_0x529489){return db[_0x7250('0x32')]['find']({'where':{'id':_0x44a576[_0x7250('0x52')]['id']}})[_0x7250('0x29')](handleEntityNotFound(_0x2f478c,null))[_0x7250('0x29')](function(_0x270e16){if(_0x270e16){return _0x270e16['removeAgents'](_0x44a576[_0x7250('0x37')][_0x7250('0x68')])['then'](function(){if(_[_0x7250('0x89')](_0x44a576[_0x7250('0x37')][_0x7250('0x68')])){for(var _0x1ddf92=0x0;_0x1ddf92<_0x44a576[_0x7250('0x37')]['ids'][_0x7250('0x3a')];_0x1ddf92+=0x1){socket[_0x7250('0x84')](_0x7250('0x85'),{'UserId':Number(_0x44a576[_0x7250('0x37')][_0x7250('0x68')][_0x1ddf92]),'SmsQueueId':Number(_0x44a576[_0x7250('0x52')]['id'])});}}else{socket[_0x7250('0x84')](_0x7250('0x85'),{'UserId':Number(_0x44a576[_0x7250('0x37')]['ids']),'SmsQueueId':Number(_0x44a576[_0x7250('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f478c,null))[_0x7250('0x47')](handleError(_0x2f478c,null));};exports['getAgents']=function(_0x246c79,_0x20c84f,_0x1f3c09){var _0x2e15ad={};var _0x1d3b8f={};var _0x360315;var _0x44d540;return db[_0x7250('0x32')][_0x7250('0x55')]({'where':{'id':_0x246c79[_0x7250('0x52')]['id']}})[_0x7250('0x29')](handleEntityNotFound(_0x20c84f,null))['then'](function(_0x15d95d){if(_0x15d95d){_0x360315=_0x15d95d;_0x1d3b8f['model']=_['keys'](db[_0x7250('0x5c')]['rawAttributes']);_0x1d3b8f['query']=_['keys'](_0x246c79[_0x7250('0x37')]);_0x1d3b8f[_0x7250('0x3e')]=_[_0x7250('0x57')](_0x1d3b8f[_0x7250('0x35')],_0x1d3b8f['query']);_0x2e15ad[_0x7250('0x38')]=_[_0x7250('0x57')](_0x1d3b8f['model'],qs['fields'](_0x246c79[_0x7250('0x37')][_0x7250('0x39')]));_0x2e15ad['attributes']=_0x2e15ad['attributes']['length']?_0x2e15ad['attributes']:_0x1d3b8f[_0x7250('0x35')];_0x2e15ad['order']=qs[_0x7250('0x59')](_0x246c79['query'][_0x7250('0x59')]);_0x2e15ad[_0x7250('0x3d')]=qs[_0x7250('0x3e')](_['pick'](_0x246c79[_0x7250('0x37')],_0x1d3b8f[_0x7250('0x3e')]));if(_0x246c79['query'][_0x7250('0x3f')]){_0x2e15ad[_0x7250('0x3d')]=_[_0x7250('0x41')](_0x2e15ad[_0x7250('0x3d')],{'$or':_[_0x7250('0x36')](_0x2e15ad[_0x7250('0x38')],function(_0x5526e9){var _0x16a3f2={};_0x16a3f2[_0x5526e9]={'$like':'%'+_0x246c79['query'][_0x7250('0x3f')]+'%'};return _0x16a3f2;})});}_0x2e15ad=_[_0x7250('0x41')]({},_0x2e15ad,_0x246c79[_0x7250('0x42')]);return _0x360315[_0x7250('0x8a')](_0x2e15ad);}})[_0x7250('0x29')](function(_0xec32ff){if(_0xec32ff){_0x44d540=_0xec32ff[_0x7250('0x3a')];if(!_0x246c79[_0x7250('0x37')][_0x7250('0x3b')](_0x7250('0x3c'))){_0x2e15ad[_0x7250('0x23')]=qs[_0x7250('0x23')](_0x246c79['query'][_0x7250('0x23')]);_0x2e15ad[_0x7250('0x21')]=qs[_0x7250('0x21')](_0x246c79[_0x7250('0x37')][_0x7250('0x21')]);}return _0x360315[_0x7250('0x8a')](_0x2e15ad);}})[_0x7250('0x29')](function(_0x1c743e){if(_0x1c743e){return _0x1c743e?{'count':_0x44d540,'rows':_0x1c743e}:null;}})[_0x7250('0x29')](respondWithResult(_0x20c84f,null))['catch'](handleError(_0x20c84f,null));};
\ No newline at end of file
+var _0x909a=['describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','agent','updatedAt','%s/%s','smsPause','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','addTeams','each','emit','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','limit','set','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','params','keys','length','include','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x909a,0xbc));var _0xa909=function(_0x5f5495,_0x30d087){_0x5f5495=_0x5f5495-0x0;var _0x14d8a3=_0x909a[_0x5f5495];return _0x14d8a3;};'use strict';var emlformat=require(_0xa909('0x0'));var rimraf=require(_0xa909('0x1'));var zipdir=require(_0xa909('0x2'));var jsonpatch=require(_0xa909('0x3'));var rp=require('request-promise');var moment=require(_0xa909('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa909('0x5'));var util=require('util');var path=require(_0xa909('0x6'));var sox=require(_0xa909('0x7'));var csv=require('to-csv');var ejs=require(_0xa909('0x8'));var fs=require('fs');var fs_extra=require(_0xa909('0x9'));var _=require(_0xa909('0xa'));var squel=require('squel');var crypto=require(_0xa909('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa909('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa909('0xd'));var Papa=require(_0xa909('0xe'));var Redis=require(_0xa909('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa909('0x10'));var as=require(_0xa909('0x11'));var hardwareService=require(_0xa909('0x12'));var logger=require(_0xa909('0x13'))('api');var utils=require(_0xa909('0x14'));var config=require(_0xa909('0x15'));var licenseUtil=require(_0xa909('0x16'));var db=require('../../mysqldb')['db'];config[_0xa909('0x17')]=_[_0xa909('0x18')](config[_0xa909('0x17')],{'host':_0xa909('0x19'),'port':0x18eb});var socket=require(_0xa909('0x1a'))(new Redis(config[_0xa909('0x17')]));require(_0xa909('0x1b'))[_0xa909('0x1c')](socket);function respondWithStatusCode(_0x1e6e3d,_0x16bd65){_0x16bd65=_0x16bd65||0xcc;return function(_0x46e73c){if(_0x46e73c){return _0x1e6e3d['sendStatus'](_0x16bd65);}return _0x1e6e3d[_0xa909('0x1d')](_0x16bd65)[_0xa909('0x1e')]();};}function respondWithResult(_0x5a0567,_0x190274){_0x190274=_0x190274||0xc8;return function(_0x1d02f7){if(_0x1d02f7){return _0x5a0567[_0xa909('0x1d')](_0x190274)[_0xa909('0x1f')](_0x1d02f7);}};}function respondWithFilteredResult(_0x1339eb,_0x104633){return function(_0x422b33){if(_0x422b33){var _0x48f9df=typeof _0x104633[_0xa909('0x20')]==='undefined'&&typeof _0x104633[_0xa909('0x21')]==='undefined';var _0xd996eb=_0x422b33['count'];var _0x15500a=_0x48f9df?0x0:_0x104633[_0xa909('0x20')];var _0x347cc5=_0x48f9df?_0x422b33['count']:_0x104633[_0xa909('0x20')]+_0x104633[_0xa909('0x21')];var _0x1abd4d;if(_0x347cc5>=_0xd996eb){_0x347cc5=_0xd996eb;_0x1abd4d=0xc8;}else{_0x1abd4d=0xce;}_0x1339eb['status'](_0x1abd4d);return _0x1339eb[_0xa909('0x22')]('Content-Range',_0x15500a+'-'+_0x347cc5+'/'+_0xd996eb)[_0xa909('0x1f')](_0x422b33);}return null;};}function patchUpdates(_0xed8753){return function(_0x5e7d34){try{jsonpatch['apply'](_0x5e7d34,_0xed8753,!![]);}catch(_0x5f2f89){return BPromise['reject'](_0x5f2f89);}return _0x5e7d34[_0xa909('0x23')]();};}function saveUpdates(_0x511fcc,_0x47d3eb){return function(_0x3d23fb){if(_0x3d23fb){return _0x3d23fb[_0xa909('0x24')](_0x511fcc)['then'](function(_0x55d3ec){return _0x55d3ec;});}return null;};}function removeEntity(_0x4ff198,_0x2898d3){return function(_0xe0f7f9){if(_0xe0f7f9){return _0xe0f7f9['destroy']()[_0xa909('0x25')](function(){var _0x5f5122=_0xe0f7f9[_0xa909('0x26')]({'plain':!![]});var _0x2a511c='SmsQueues';return db[_0xa909('0x27')][_0xa909('0x28')]({'where':{'type':_0x2a511c,'resourceId':_0x5f5122['id']}})['then'](function(){return _0xe0f7f9;});})['then'](function(){_0x4ff198[_0xa909('0x1d')](0xcc)[_0xa909('0x1e')]();});}};}function handleEntityNotFound(_0x38132e,_0x3d7e83){return function(_0x452339){if(!_0x452339){_0x38132e[_0xa909('0x29')](0x194);}return _0x452339;};}function handleError(_0x4b23a8,_0x25e91f){_0x25e91f=_0x25e91f||0x1f4;return function(_0xc1f07e){logger['error'](_0xc1f07e[_0xa909('0x2a')]);if(_0xc1f07e[_0xa909('0x2b')]){delete _0xc1f07e['name'];}_0x4b23a8['status'](_0x25e91f)[_0xa909('0x2c')](_0xc1f07e);};}exports[_0xa909('0x2d')]=function(_0xd267be,_0xe1c9e3){var _0x5a2e77={},_0x58330e={},_0x1513ac={'count':0x0,'rows':[]};var _0x53f4ab=_[_0xa909('0x2e')](db[_0xa909('0x2f')][_0xa909('0x30')],function(_0x6e1cda){return{'name':_0x6e1cda[_0xa909('0x31')],'type':_0x6e1cda[_0xa909('0x32')][_0xa909('0x33')]};});_0x58330e[_0xa909('0x34')]=_[_0xa909('0x2e')](_0x53f4ab,_0xa909('0x2b'));_0x58330e['query']=_['keys'](_0xd267be[_0xa909('0x35')]);_0x58330e[_0xa909('0x36')]=_[_0xa909('0x37')](_0x58330e[_0xa909('0x34')],_0x58330e[_0xa909('0x35')]);_0x5a2e77[_0xa909('0x38')]=_[_0xa909('0x37')](_0x58330e[_0xa909('0x34')],qs[_0xa909('0x39')](_0xd267be['query'][_0xa909('0x39')]));_0x5a2e77[_0xa909('0x38')]=_0x5a2e77[_0xa909('0x38')]['length']?_0x5a2e77[_0xa909('0x38')]:_0x58330e[_0xa909('0x34')];if(!_0xd267be[_0xa909('0x35')][_0xa909('0x3a')](_0xa909('0x3b'))){_0x5a2e77[_0xa909('0x21')]=qs[_0xa909('0x21')](_0xd267be[_0xa909('0x35')][_0xa909('0x21')]);_0x5a2e77[_0xa909('0x20')]=qs[_0xa909('0x20')](_0xd267be[_0xa909('0x35')]['offset']);}_0x5a2e77[_0xa909('0x3c')]=qs[_0xa909('0x3d')](_0xd267be[_0xa909('0x35')][_0xa909('0x3d')]);_0x5a2e77[_0xa909('0x3e')]=qs['filters'](_[_0xa909('0x3f')](_0xd267be[_0xa909('0x35')],_0x58330e['filters']),_0x53f4ab);if(_0xd267be[_0xa909('0x35')][_0xa909('0x40')]){_0x5a2e77['where']=_[_0xa909('0x41')](_0x5a2e77[_0xa909('0x3e')],{'$or':_[_0xa909('0x2e')](_0x53f4ab,function(_0xc7010f){if(_0xc7010f[_0xa909('0x32')]!=='VIRTUAL'){var _0x386090={};_0x386090[_0xc7010f[_0xa909('0x2b')]]={'$like':'%'+_0xd267be[_0xa909('0x35')]['filter']+'%'};return _0x386090;}})});}_0x5a2e77=_[_0xa909('0x41')]({},_0x5a2e77,_0xd267be[_0xa909('0x42')]);var _0x39b23e={'where':_0x5a2e77[_0xa909('0x3e')]};return db[_0xa909('0x2f')][_0xa909('0x43')](_0x39b23e)[_0xa909('0x25')](function(_0x1d11d2){_0x1513ac[_0xa909('0x43')]=_0x1d11d2;if(_0xd267be[_0xa909('0x35')][_0xa909('0x44')]){_0x5a2e77['include']=[{'all':!![]}];}return db[_0xa909('0x2f')][_0xa909('0x45')](_0x5a2e77);})[_0xa909('0x25')](function(_0x1b01d7){_0x1513ac[_0xa909('0x46')]=_0x1b01d7;return _0x1513ac;})[_0xa909('0x25')](respondWithFilteredResult(_0xe1c9e3,_0x5a2e77))['catch'](handleError(_0xe1c9e3,null));};exports['show']=function(_0xdd14a2,_0x13cb6d){var _0x51e4c1={'raw':!![],'where':{'id':_0xdd14a2[_0xa909('0x47')]['id']}},_0x467789={};_0x467789[_0xa909('0x34')]=_[_0xa909('0x48')](db[_0xa909('0x2f')][_0xa909('0x30')]);_0x467789[_0xa909('0x35')]=_[_0xa909('0x48')](_0xdd14a2[_0xa909('0x35')]);_0x467789['filters']=_[_0xa909('0x37')](_0x467789[_0xa909('0x34')],_0x467789[_0xa909('0x35')]);_0x51e4c1[_0xa909('0x38')]=_[_0xa909('0x37')](_0x467789['model'],qs['fields'](_0xdd14a2[_0xa909('0x35')]['fields']));_0x51e4c1['attributes']=_0x51e4c1[_0xa909('0x38')][_0xa909('0x49')]?_0x51e4c1[_0xa909('0x38')]:_0x467789[_0xa909('0x34')];if(_0xdd14a2['query'][_0xa909('0x44')]){_0x51e4c1[_0xa909('0x4a')]=[{'all':!![]}];}_0x51e4c1=_[_0xa909('0x41')]({},_0x51e4c1,_0xdd14a2[_0xa909('0x42')]);return db[_0xa909('0x2f')][_0xa909('0x4b')](_0x51e4c1)[_0xa909('0x25')](handleEntityNotFound(_0x13cb6d,null))['then'](respondWithResult(_0x13cb6d,null))['catch'](handleError(_0x13cb6d,null));};exports['create']=function(_0x5bcf1d,_0x257f0a){return db[_0xa909('0x2f')][_0xa909('0x4c')](_0x5bcf1d[_0xa909('0x4d')],{})[_0xa909('0x25')](function(_0xca8ad){var _0x1cc173=_0x5bcf1d[_0xa909('0x4e')][_0xa909('0x26')]({'plain':!![]});if(!_0x1cc173)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cc173[_0xa909('0x4f')]==='user'){var _0x57b02d=_0xca8ad['get']({'plain':!![]});var _0x46a29c='SmsQueues';return db[_0xa909('0x50')][_0xa909('0x4b')]({'where':{'name':_0x46a29c,'userProfileId':_0x1cc173[_0xa909('0x51')]},'raw':!![]})[_0xa909('0x25')](function(_0x4cb36e){if(_0x4cb36e&&_0x4cb36e['autoAssociation']===0x0){return db[_0xa909('0x27')][_0xa909('0x4c')]({'name':_0x57b02d[_0xa909('0x2b')],'resourceId':_0x57b02d['id'],'type':_0x4cb36e[_0xa909('0x2b')],'sectionId':_0x4cb36e['id']},{})['then'](function(){return _0xca8ad;});}else{return _0xca8ad;}})['catch'](function(_0x4b54fb){logger['error'](_0xa909('0x52'),_0x4b54fb);throw _0x4b54fb;});}return _0xca8ad;})[_0xa909('0x25')](respondWithResult(_0x257f0a,0xc9))['catch'](handleError(_0x257f0a,null));};exports[_0xa909('0x24')]=function(_0x29654b,_0x15467f){if(_0x29654b['body']['id']){delete _0x29654b[_0xa909('0x4d')]['id'];}return db[_0xa909('0x2f')]['find']({'where':{'id':_0x29654b[_0xa909('0x47')]['id']}})['then'](handleEntityNotFound(_0x15467f,null))[_0xa909('0x25')](saveUpdates(_0x29654b['body'],null))[_0xa909('0x25')](respondWithResult(_0x15467f,null))[_0xa909('0x53')](handleError(_0x15467f,null));};exports[_0xa909('0x28')]=function(_0x24d74c,_0x322f9f){return db[_0xa909('0x2f')][_0xa909('0x4b')]({'where':{'id':_0x24d74c[_0xa909('0x47')]['id']}})[_0xa909('0x25')](handleEntityNotFound(_0x322f9f,null))[_0xa909('0x25')](removeEntity(_0x322f9f,null))[_0xa909('0x53')](handleError(_0x322f9f,null));};exports[_0xa909('0x54')]=function(_0x445fcd,_0x3ed82a){return db[_0xa909('0x2f')][_0xa909('0x54')]()['then'](respondWithResult(_0x3ed82a,null))[_0xa909('0x53')](handleError(_0x3ed82a,null));};exports[_0xa909('0x55')]=function(_0x3eeb01,_0xab135f,_0x3d0b57){var _0x461283={'raw':!![],'where':{}},_0x56480c={},_0x3c5509;return db[_0xa909('0x2f')][_0xa909('0x56')]({'where':{'id':_0x3eeb01[_0xa909('0x47')]['id']}})[_0xa909('0x25')](handleEntityNotFound(_0xab135f,null))[_0xa909('0x25')](function(_0x4b61c2){if(_0x4b61c2){_0x3c5509=_0x4b61c2[_0xa909('0x26')]({'plain':!![]});_0x56480c['model']=_[_0xa909('0x48')](db[_0xa909('0x57')][_0xa909('0x30')]);_0x56480c[_0xa909('0x35')]=_[_0xa909('0x48')](_0x3eeb01[_0xa909('0x35')]);_0x56480c[_0xa909('0x36')]=_[_0xa909('0x37')](_0x56480c[_0xa909('0x34')],_0x56480c[_0xa909('0x35')]);_0x461283[_0xa909('0x38')]=_[_0xa909('0x37')](_0x56480c[_0xa909('0x34')],qs['fields'](_0x3eeb01[_0xa909('0x35')][_0xa909('0x39')]));_0x461283[_0xa909('0x38')]=_0x461283[_0xa909('0x38')][_0xa909('0x49')]?_0x461283['attributes']:_0x56480c[_0xa909('0x34')];if(!_0x3eeb01[_0xa909('0x35')]['hasOwnProperty'](_0xa909('0x3b'))){_0x461283['limit']=qs[_0xa909('0x21')](_0x3eeb01[_0xa909('0x35')][_0xa909('0x21')]);_0x461283['offset']=qs[_0xa909('0x20')](_0x3eeb01[_0xa909('0x35')][_0xa909('0x20')]);}_0x461283[_0xa909('0x3c')]=qs[_0xa909('0x3d')](_0x3eeb01[_0xa909('0x35')][_0xa909('0x3d')]);_0x461283[_0xa909('0x3e')]=qs[_0xa909('0x36')](_[_0xa909('0x3f')](_0x3eeb01[_0xa909('0x35')],_0x56480c[_0xa909('0x36')]));_0x461283[_0xa909('0x3e')][_0xa909('0x58')]=_0x4b61c2['id'];if(_0x3eeb01[_0xa909('0x35')][_0xa909('0x40')]){_0x461283['where']=_['merge'](_0x461283[_0xa909('0x3e')],{'$or':_[_0xa909('0x2e')](_0x461283[_0xa909('0x38')],function(_0xf6c0cd){var _0x53b06b={};_0x53b06b[_0xf6c0cd]={'$like':'%'+_0x3eeb01[_0xa909('0x35')][_0xa909('0x40')]+'%'};return _0x53b06b;})});}_0x461283=_['merge']({},_0x461283,_0x3eeb01[_0xa909('0x42')]);return db[_0xa909('0x57')][_0xa909('0x45')](_0x461283);}})['then'](function(_0x1a7623){if(_0x1a7623){return db[_0xa909('0x59')][_0xa909('0x5a')]({'where':{'id':_['map'](_0x1a7623,'UserId'),'role':_0xa909('0x5b')},'attributes':['id',_0xa909('0x2b'),'smsPause',_0xa909('0x5c'),'createdAt']});}})[_0xa909('0x25')](function(_0x7e5787){if(_0x7e5787){return{'count':_0x7e5787[_0xa909('0x43')],'rows':_['map'](_0x7e5787['rows'],function(_0x4a6a8b){return{'membername':_0x4a6a8b[_0xa909('0x2b')],'UserId':_0x4a6a8b['id'],'queue_name':_0x3c5509[_0xa909('0x2b')],'SmsQueueId':_0x3c5509['id'],'interface':util['format'](_0xa909('0x5d'),'SIP',_0x4a6a8b['name']),'penalty':0x0,'paused':_0x4a6a8b[_0xa909('0x5e')],'createdAt':_0x4a6a8b[_0xa909('0x5f')],'updatedAt':_0x4a6a8b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa909('0x25')](respondWithFilteredResult(_0xab135f,_0x461283))[_0xa909('0x53')](handleError(_0xab135f,null));};exports[_0xa909('0x60')]=function(_0x1f4733,_0x19521a,_0x156da7){var _0x108c36={};var _0x2b8987={};var _0x226d4b;var _0xf5cbb8;return db['SmsQueue']['findOne']({'where':{'id':_0x1f4733[_0xa909('0x47')]['id']}})['then'](handleEntityNotFound(_0x19521a,null))[_0xa909('0x25')](function(_0xb00b60){if(_0xb00b60){_0x226d4b=_0xb00b60;_0x2b8987[_0xa909('0x34')]=_[_0xa909('0x48')](db[_0xa909('0x61')][_0xa909('0x30')]);_0x2b8987['query']=_[_0xa909('0x48')](_0x1f4733[_0xa909('0x35')]);_0x2b8987[_0xa909('0x36')]=_['intersection'](_0x2b8987['model'],_0x2b8987['query']);_0x108c36[_0xa909('0x38')]=_[_0xa909('0x37')](_0x2b8987[_0xa909('0x34')],qs[_0xa909('0x39')](_0x1f4733['query'][_0xa909('0x39')]));_0x108c36[_0xa909('0x38')]=_0x108c36[_0xa909('0x38')][_0xa909('0x49')]?_0x108c36[_0xa909('0x38')]:_0x2b8987['model'];_0x108c36[_0xa909('0x3c')]=qs['sort'](_0x1f4733[_0xa909('0x35')][_0xa909('0x3d')]);_0x108c36[_0xa909('0x3e')]=qs[_0xa909('0x36')](_[_0xa909('0x3f')](_0x1f4733[_0xa909('0x35')],_0x2b8987['filters']));if(_0x1f4733[_0xa909('0x35')]['filter']){_0x108c36[_0xa909('0x3e')]=_[_0xa909('0x41')](_0x108c36[_0xa909('0x3e')],{'$or':_[_0xa909('0x2e')](_0x108c36[_0xa909('0x38')],function(_0x1fbecc){var _0x52aba6={};_0x52aba6[_0x1fbecc]={'$like':'%'+_0x1f4733[_0xa909('0x35')][_0xa909('0x40')]+'%'};return _0x52aba6;})});}_0x108c36=_['merge']({},_0x108c36,_0x1f4733[_0xa909('0x42')]);return _0x226d4b[_0xa909('0x60')](_0x108c36);}})[_0xa909('0x25')](function(_0xb999c0){if(_0xb999c0){_0xf5cbb8=_0xb999c0[_0xa909('0x49')];if(!_0x1f4733[_0xa909('0x35')][_0xa909('0x3a')](_0xa909('0x3b'))){_0x108c36[_0xa909('0x21')]=qs[_0xa909('0x21')](_0x1f4733['query'][_0xa909('0x21')]);_0x108c36['offset']=qs[_0xa909('0x20')](_0x1f4733[_0xa909('0x35')][_0xa909('0x20')]);}return _0x226d4b['getTeams'](_0x108c36);}})[_0xa909('0x25')](function(_0x26e470){if(_0x26e470){return _0x26e470?{'count':_0xf5cbb8,'rows':_0x26e470}:null;}})[_0xa909('0x25')](respondWithResult(_0x19521a,null))[_0xa909('0x53')](handleError(_0x19521a,null));};exports['addTeams']=function(_0x4b77e2,_0x2d56ad,_0x4ee12c){var _0x728f2d=_0x4b77e2[_0xa909('0x4d')][_0xa909('0x62')];return db['Team']['findAll']({'where':{'id':_0x728f2d},'attributes':['id'],'include':[{'model':db[_0xa909('0x59')],'as':_0xa909('0x63'),'attributes':['id',_0xa909('0x2b'),_0xa909('0x64'),_0xa909('0x65'),_0xa909('0x66')],'raw':!![]}]})[_0xa909('0x25')](function(_0x428bad){if(_0x428bad){var _0x9a7e09=_['flatMap'](_0x428bad,function(_0x34019b){var _0x41c0f2=_0x34019b[_0xa909('0x26')]({'plain':!![]});return _0x41c0f2[_0xa909('0x63')];});return db['SmsQueue'][_0xa909('0x4b')]({'where':{'id':_0x4b77e2['params']['id']}})[_0xa909('0x25')](function(_0xa0f7a6){return db['sequelize']['transaction'](function(_0x174851){return _0xa0f7a6[_0xa909('0x67')](_0x728f2d,{'transaction':_0x174851})[_0xa909('0x25')](function(){return BPromise[_0xa909('0x68')](_0x9a7e09,function(_0x57a89f){return db[_0xa909('0x57')]['findOrCreate']({'where':{'UserId':_0x57a89f['id'],'SmsQueueId':_0x4b77e2[_0xa909('0x47')]['id']},'transaction':_0x174851});});})[_0xa909('0x25')](function(){_0x9a7e09['forEach'](function(_0x53e1ce){socket[_0xa909('0x69')]('userSmsQueue:save',{'UserId':_0x53e1ce['id'],'SmsQueueId':_0xa0f7a6['id']});});});});});}})[_0xa909('0x25')](respondWithStatusCode(_0x2d56ad,null))[_0xa909('0x53')](handleError(_0x2d56ad,null));};exports[_0xa909('0x6a')]=function(_0x1ba7c2,_0xc47a7,_0x5b7221){return db['Team'][_0xa909('0x45')]({'where':{'id':_0x1ba7c2[_0xa909('0x35')][_0xa909('0x62')]},'attributes':['id'],'include':[{'model':db[_0xa909('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa909('0x25')](handleEntityNotFound(_0xc47a7,null))['then'](function(_0x107592){var _0x3845b2=_[_0xa909('0x2e')](_0x107592,'id');var _0x5e1a74=[];var _0x2c116d=[];var _0x4cd043=squel[_0xa909('0x6b')]();_0x4cd043[_0xa909('0x6c')](_0xa909('0x6d'))['from'](_0xa909('0x6e'),'tq')[_0xa909('0x6f')](_0xa909('0x70'),'ut',_0xa909('0x71'))[_0xa909('0x3e')](_0xa909('0x72'),_0x1ba7c2[_0xa909('0x47')]['id']);for(var _0x551eef=0x0;_0x551eef<_0x107592[_0xa909('0x49')];_0x551eef+=0x1){let _0x5591d2=_0x107592[_0x551eef];for(var _0x49a392=0x0;_0x49a392<_0x5591d2['Agents']['length'];_0x49a392+=0x1){let _0x41d5bb=_0x5591d2['Agents'][_0x49a392];var _0x146217=_0x4cd043['clone']();_0x146217[_0xa909('0x3e')](_0xa909('0x73'),_0x41d5bb['id']);_0x2c116d[_0xa909('0x74')](db[_0xa909('0x75')]['query'](_0x146217[_0xa909('0x76')](),{'type':db['sequelize'][_0xa909('0x77')][_0xa909('0x78')]})['then'](function(_0x4ddfc7){if(_0x4ddfc7[_0xa909('0x49')]===0x1){return _0x41d5bb['id'];}else{var _0x342e53=_[_0xa909('0x79')](_[_0xa909('0x2e')](_0x4ddfc7,_0xa909('0x7a')),function(_0x18a2fb){return _[_0xa909('0x7b')](_0x3845b2,_0x18a2fb);});if(_0x342e53){return _0x41d5bb['id'];}}}));}}return BPromise[_0xa909('0x7c')](_0x2c116d)[_0xa909('0x25')](function(_0x44792d){_0x5e1a74=_(_0x5e1a74)['union'](_0x44792d)['compact']()[_0xa909('0x7d')]();return db[_0xa909('0x2f')][_0xa909('0x4b')]({'where':{'id':_0x1ba7c2['params']['id']}})[_0xa909('0x25')](function(_0x3f9a36){return db[_0xa909('0x75')]['transaction'](function(_0x4253f2){return _0x3f9a36[_0xa909('0x6a')](_0x1ba7c2[_0xa909('0x35')][_0xa909('0x62')],{'transaction':_0x4253f2})[_0xa909('0x25')](function(){if(!_[_0xa909('0x7e')](_0x5e1a74)){return _0x3f9a36[_0xa909('0x7f')](_0x5e1a74,{'transaction':_0x4253f2});}})[_0xa909('0x25')](function(){_0x5e1a74[_0xa909('0x80')](function(_0x2fc490){socket[_0xa909('0x69')](_0xa909('0x81'),{'UserId':_0x2fc490,'SmsQueueId':_0x3f9a36['id']});});});});});});})[_0xa909('0x25')](respondWithStatusCode(_0xc47a7,null))[_0xa909('0x53')](handleError(_0xc47a7,null));};exports[_0xa909('0x82')]=function(_0x5a8205,_0x707199,_0x4dffd6){return db['SmsQueue'][_0xa909('0x4b')]({'where':{'id':_0x5a8205[_0xa909('0x47')]['id']}})[_0xa909('0x25')](handleEntityNotFound(_0x707199,null))[_0xa909('0x25')](function(_0x24ee71){if(_0x24ee71){return _0x24ee71['addAgents'](_0x5a8205[_0xa909('0x4d')][_0xa909('0x62')],_[_0xa909('0x83')](_0x5a8205[_0xa909('0x4d')],[_0xa909('0x62'),'id'])||{})[_0xa909('0x84')](function(_0x1cbd98){for(var _0x25c3dc=0x0;_0x25c3dc<_0x5a8205[_0xa909('0x4d')][_0xa909('0x62')]['length'];_0x25c3dc+=0x1){socket[_0xa909('0x69')](_0xa909('0x85'),{'UserId':Number(_0x5a8205[_0xa909('0x4d')][_0xa909('0x62')][_0x25c3dc]),'SmsQueueId':Number(_0x5a8205[_0xa909('0x47')]['id'])});}return _0x1cbd98;});}})[_0xa909('0x25')](respondWithResult(_0x707199,null))[_0xa909('0x53')](handleError(_0x707199,null));};exports[_0xa909('0x7f')]=function(_0x163309,_0x195bae,_0x376059){return db[_0xa909('0x2f')][_0xa909('0x4b')]({'where':{'id':_0x163309[_0xa909('0x47')]['id']}})[_0xa909('0x25')](handleEntityNotFound(_0x195bae,null))[_0xa909('0x25')](function(_0x163a85){if(_0x163a85){return _0x163a85[_0xa909('0x7f')](_0x163309['query'][_0xa909('0x62')])['then'](function(){if(_[_0xa909('0x86')](_0x163309['query'][_0xa909('0x62')])){for(var _0x46f3b2=0x0;_0x46f3b2<_0x163309[_0xa909('0x35')]['ids']['length'];_0x46f3b2+=0x1){socket['emit'](_0xa909('0x81'),{'UserId':Number(_0x163309[_0xa909('0x35')][_0xa909('0x62')][_0x46f3b2]),'SmsQueueId':Number(_0x163309['params']['id'])});}}else{socket[_0xa909('0x69')](_0xa909('0x81'),{'UserId':Number(_0x163309['query'][_0xa909('0x62')]),'SmsQueueId':Number(_0x163309[_0xa909('0x47')]['id'])});}});}})[_0xa909('0x25')](respondWithStatusCode(_0x195bae,null))[_0xa909('0x53')](handleError(_0x195bae,null));};exports[_0xa909('0x87')]=function(_0x5ddd9d,_0x1e1bfb,_0x3aae93){var _0x1b1039={};var _0x4ad642={};var _0x313523;var _0x210b11;return db[_0xa909('0x2f')][_0xa909('0x56')]({'where':{'id':_0x5ddd9d[_0xa909('0x47')]['id']}})[_0xa909('0x25')](handleEntityNotFound(_0x1e1bfb,null))[_0xa909('0x25')](function(_0x50deb0){if(_0x50deb0){_0x313523=_0x50deb0;_0x4ad642[_0xa909('0x34')]=_[_0xa909('0x48')](db[_0xa909('0x59')][_0xa909('0x30')]);_0x4ad642['query']=_[_0xa909('0x48')](_0x5ddd9d['query']);_0x4ad642['filters']=_[_0xa909('0x37')](_0x4ad642[_0xa909('0x34')],_0x4ad642[_0xa909('0x35')]);_0x1b1039[_0xa909('0x38')]=_[_0xa909('0x37')](_0x4ad642[_0xa909('0x34')],qs[_0xa909('0x39')](_0x5ddd9d[_0xa909('0x35')][_0xa909('0x39')]));_0x1b1039['attributes']=_0x1b1039[_0xa909('0x38')][_0xa909('0x49')]?_0x1b1039[_0xa909('0x38')]:_0x4ad642[_0xa909('0x34')];_0x1b1039[_0xa909('0x3c')]=qs[_0xa909('0x3d')](_0x5ddd9d[_0xa909('0x35')]['sort']);_0x1b1039[_0xa909('0x3e')]=qs['filters'](_[_0xa909('0x3f')](_0x5ddd9d[_0xa909('0x35')],_0x4ad642[_0xa909('0x36')]));if(_0x5ddd9d['query'][_0xa909('0x40')]){_0x1b1039[_0xa909('0x3e')]=_['merge'](_0x1b1039[_0xa909('0x3e')],{'$or':_['map'](_0x1b1039['attributes'],function(_0x29c7d1){var _0x4a4cc8={};_0x4a4cc8[_0x29c7d1]={'$like':'%'+_0x5ddd9d[_0xa909('0x35')][_0xa909('0x40')]+'%'};return _0x4a4cc8;})});}_0x1b1039=_[_0xa909('0x41')]({},_0x1b1039,_0x5ddd9d['options']);return _0x313523[_0xa909('0x87')](_0x1b1039);}})[_0xa909('0x25')](function(_0xdde025){if(_0xdde025){_0x210b11=_0xdde025[_0xa909('0x49')];if(!_0x5ddd9d[_0xa909('0x35')][_0xa909('0x3a')]('nolimit')){_0x1b1039[_0xa909('0x21')]=qs[_0xa909('0x21')](_0x5ddd9d[_0xa909('0x35')][_0xa909('0x21')]);_0x1b1039[_0xa909('0x20')]=qs[_0xa909('0x20')](_0x5ddd9d[_0xa909('0x35')][_0xa909('0x20')]);}return _0x313523[_0xa909('0x87')](_0x1b1039);}})[_0xa909('0x25')](function(_0xe70864){if(_0xe70864){return _0xe70864?{'count':_0x210b11,'rows':_0xe70864}:null;}})[_0xa909('0x25')](respondWithResult(_0x1e1bfb,null))[_0xa909('0x53')](handleError(_0x1e1bfb,null));};
\ No newline at end of file
index 89eced3..6348d14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe78d=['setMaxListeners','save','remove','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2498b5,_0x514ddb){var _0x5c48d8=function(_0xee9bb5){while(--_0xee9bb5){_0x2498b5['push'](_0x2498b5['shift']());}};_0x5c48d8(++_0x514ddb);}(_0xe78d,0x10f));var _0xde78=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xe78d[_0xe45118];return _0x15e15d;};'use strict';var EventEmitter=require(_0xde78('0x0'));var SmsQueue=require(_0xde78('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xde78('0x2')](0x0);var events={'afterCreate':_0xde78('0x3'),'afterUpdate':'update','afterDestroy':_0xde78('0x4')};function emitEvent(_0x3dcc35){return function(_0x4856e7,_0x278d5e,_0x32b39c){SmsQueueEvents['emit'](_0x3dcc35+':'+_0x4856e7['id'],_0x4856e7);SmsQueueEvents['emit'](_0x3dcc35,_0x4856e7);_0x32b39c(null);};}for(var e in events){if(events[_0xde78('0x5')](e)){var event=events[e];SmsQueue[_0xde78('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0x88ab=['update','remove','emit','hasOwnProperty','hook','events','save'];(function(_0x410fa8,_0x5f1a74){var _0x6573b0=function(_0x8c0c46){while(--_0x8c0c46){_0x410fa8['push'](_0x410fa8['shift']());}};_0x6573b0(++_0x5f1a74);}(_0x88ab,0x194));var _0xb88a=function(_0x660250,_0x136501){_0x660250=_0x660250-0x0;var _0x5e060d=_0x88ab[_0x660250];return _0x5e060d;};'use strict';var EventEmitter=require(_0xb88a('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb88a('0x1'),'afterUpdate':_0xb88a('0x2'),'afterDestroy':_0xb88a('0x3')};function emitEvent(_0x4bae40){return function(_0x483d8d,_0x54fe98,_0x2c4117){SmsQueueEvents[_0xb88a('0x4')](_0x4bae40+':'+_0x483d8d['id'],_0x483d8d);SmsQueueEvents[_0xb88a('0x4')](_0x4bae40,_0x483d8d);_0x2c4117(null);};}for(var e in events){if(events[_0xb88a('0x5')](e)){var event=events[e];SmsQueue[_0xb88a('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index fa56805..17db3c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0884=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x420525,_0x50dd67){var _0x27fd36=function(_0x29b0cb){while(--_0x29b0cb){_0x420525['push'](_0x420525['shift']());}};_0x27fd36(++_0x50dd67);}(_0x0884,0x14e));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var logger=require(_0x4088('0x2'))(_0x4088('0x3'));var moment=require(_0x4088('0x4'));var BPromise=require(_0x4088('0x5'));var rp=require(_0x4088('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4088('0x7'));var attributes=require('./smsQueue.attributes');module[_0x4088('0x8')]=function(_0x5d3f89,_0x336469){return _0x5d3f89[_0x4088('0x9')](_0x4088('0xa'),attributes,{'tableName':_0x4088('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f30=['path','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2bbb3d,_0x400061){var _0x5739f0=function(_0x5bbc70){while(--_0x5bbc70){_0x2bbb3d['push'](_0x2bbb3d['shift']());}};_0x5739f0(++_0x400061);}(_0x9f30,0xf0));var _0x09f3=function(_0x628bf9,_0x46d26b){_0x628bf9=_0x628bf9-0x0;var _0x452fd0=_0x9f30[_0x628bf9];return _0x452fd0;};'use strict';var _=require(_0x09f3('0x0'));var util=require(_0x09f3('0x1'));var logger=require(_0x09f3('0x2'))(_0x09f3('0x3'));var moment=require(_0x09f3('0x4'));var BPromise=require(_0x09f3('0x5'));var rp=require(_0x09f3('0x6'));var fs=require('fs');var path=require(_0x09f3('0x7'));var rimraf=require('rimraf');var config=require(_0x09f3('0x8'));var attributes=require(_0x09f3('0x9'));module[_0x09f3('0xa')]=function(_0x43c54a,_0x5afe1d){return _0x43c54a['define'](_0x09f3('0xb'),attributes,{'tableName':_0x09f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 63a3f80..b4c1031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7443=['redis','defaults','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetSmsQueue','SmsQueue','findAll','options','raw','limit','include','map','model','attributes','catch','ShowSmsQueue','find','where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7443,0xf4));var _0x3744=function(_0x380501,_0x3babe6){_0x380501=_0x380501-0x0;var _0x1950d1=_0x7443[_0x380501];return _0x1950d1;};'use strict';var _=require(_0x3744('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3744('0x1'));var fs=require('fs');var Redis=require(_0x3744('0x2'));var db=require(_0x3744('0x3'))['db'];var utils=require(_0x3744('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3744('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3744('0x6')][_0x3744('0x7')]({'port':0x232a});config[_0x3744('0x8')]=_[_0x3744('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3744('0xa'))['register'](socket);function respondWithRpcPromise(_0x368ed6,_0x2e516a,_0x27a281){return new BPromise(function(_0x551953,_0x46d47a){return client[_0x3744('0xb')](_0x368ed6,_0x27a281)[_0x3744('0xc')](function(_0x2dd4e1){logger[_0x3744('0xd')](_0x3744('0xe'),_0x2e516a,'request\x20sent');logger[_0x3744('0xf')](_0x3744('0x10'),_0x2e516a,_0x3744('0x11'),JSON[_0x3744('0x12')](_0x2dd4e1));if(_0x2dd4e1[_0x3744('0x13')]){if(_0x2dd4e1[_0x3744('0x13')][_0x3744('0x14')]===0x1f4){logger[_0x3744('0x13')](_0x3744('0xe'),_0x2e516a,_0x2dd4e1[_0x3744('0x13')]['message']);return _0x46d47a(_0x2dd4e1[_0x3744('0x13')]['message']);}logger[_0x3744('0x13')](_0x3744('0xe'),_0x2e516a,_0x2dd4e1[_0x3744('0x13')][_0x3744('0x15')]);return _0x551953(_0x2dd4e1[_0x3744('0x13')][_0x3744('0x15')]);}else{logger['info'](_0x3744('0xe'),_0x2e516a,_0x3744('0x11'));_0x551953(_0x2dd4e1['result'][_0x3744('0x15')]);}})['catch'](function(_0x599bb5){logger[_0x3744('0x13')](_0x3744('0xe'),_0x2e516a,_0x599bb5);_0x46d47a(_0x599bb5);});});}exports[_0x3744('0x16')]=function(_0x166838){var _0xfe5ca6=this;return new Promise(function(_0x3f0173,_0x42ee3f){return db[_0x3744('0x17')][_0x3744('0x18')]({'raw':_0x166838['options']?_0x166838[_0x3744('0x19')][_0x3744('0x1a')]===undefined?!![]:![]:!![],'where':_0x166838['options']?_0x166838['options']['where']||null:null,'attributes':_0x166838[_0x3744('0x19')]?_0x166838[_0x3744('0x19')]['attributes']||null:null,'limit':_0x166838[_0x3744('0x19')]?_0x166838[_0x3744('0x19')][_0x3744('0x1b')]||null:null,'include':_0x166838['options']?_0x166838[_0x3744('0x19')][_0x3744('0x1c')]?_[_0x3744('0x1d')](_0x166838[_0x3744('0x19')]['include'],function(_0x3144aa){return{'model':db[_0x3144aa[_0x3744('0x1e')]],'as':_0x3144aa['as'],'attributes':_0x3144aa[_0x3744('0x1f')],'include':_0x3144aa[_0x3744('0x1c')]?_['map'](_0x3144aa[_0x3744('0x1c')],function(_0x36f0db){return{'model':db[_0x36f0db[_0x3744('0x1e')]],'as':_0x36f0db['as'],'attributes':_0x36f0db['attributes'],'include':_0x36f0db['include']?_[_0x3744('0x1d')](_0x36f0db['include'],function(_0x246b2f){return{'model':db[_0x246b2f['model']],'as':_0x246b2f['as'],'attributes':_0x246b2f[_0x3744('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3744('0xc')](function(_0x1f96e0){logger[_0x3744('0xd')](_0x3744('0x16'),_0x166838);logger[_0x3744('0xf')](_0x3744('0x16'),_0x166838,JSON[_0x3744('0x12')](_0x1f96e0));_0x3f0173(_0x1f96e0);})[_0x3744('0x20')](function(_0x395552){logger[_0x3744('0x13')](_0x3744('0x16'),_0x395552[_0x3744('0x15')],_0x166838);_0x42ee3f(_0xfe5ca6[_0x3744('0x13')](0x1f4,_0x395552[_0x3744('0x15')]));});});};exports[_0x3744('0x21')]=function(_0x4febcf){var _0x4c0f13=this;return new Promise(function(_0x209d41,_0x5003c9){return db[_0x3744('0x17')][_0x3744('0x22')]({'raw':_0x4febcf[_0x3744('0x19')]?_0x4febcf[_0x3744('0x19')][_0x3744('0x1a')]===undefined?!![]:![]:!![],'where':_0x4febcf[_0x3744('0x19')]?_0x4febcf[_0x3744('0x19')][_0x3744('0x23')]||null:null,'attributes':_0x4febcf['options']?_0x4febcf['options'][_0x3744('0x1f')]||null:null,'include':_0x4febcf['options']?_0x4febcf[_0x3744('0x19')]['include']?_['map'](_0x4febcf[_0x3744('0x19')][_0x3744('0x1c')],function(_0x4445ce){return{'model':db[_0x4445ce['model']],'as':_0x4445ce['as'],'attributes':_0x4445ce[_0x3744('0x1f')],'include':_0x4445ce[_0x3744('0x1c')]?_[_0x3744('0x1d')](_0x4445ce['include'],function(_0x5d16ae){return{'model':db[_0x5d16ae[_0x3744('0x1e')]],'as':_0x5d16ae['as'],'attributes':_0x5d16ae[_0x3744('0x1f')],'include':_0x5d16ae['include']?_['map'](_0x5d16ae['include'],function(_0x4f2216){return{'model':db[_0x4f2216[_0x3744('0x1e')]],'as':_0x4f2216['as'],'attributes':_0x4f2216[_0x3744('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3744('0xc')](function(_0x368640){logger[_0x3744('0xd')]('ShowSmsQueue',_0x4febcf);logger[_0x3744('0xf')](_0x3744('0x21'),_0x4febcf,JSON[_0x3744('0x12')](_0x368640));_0x209d41(_0x368640);})[_0x3744('0x20')](function(_0x4d4777){logger['error'](_0x3744('0x21'),_0x4d4777[_0x3744('0x15')],_0x4febcf);_0x5003c9(_0x4c0f13['error'](0x1f4,_0x4d4777['message']));});});};
\ No newline at end of file
+var _0xae73=['localhost','socket.io-emitter','./smsQueue.socket','register','request','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','options','limit','include','map','attributes','model','ShowSmsQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis'];(function(_0x2d7453,_0x3ccc29){var _0x1090eb=function(_0x38c0d0){while(--_0x38c0d0){_0x2d7453['push'](_0x2d7453['shift']());}};_0x1090eb(++_0x3ccc29);}(_0xae73,0x142));var _0x3ae7=function(_0x5bc27a,_0x32e2d1){_0x5bc27a=_0x5bc27a-0x0;var _0x2c8a4d=_0xae73[_0x5bc27a];return _0x2c8a4d;};'use strict';var _=require(_0x3ae7('0x0'));var util=require(_0x3ae7('0x1'));var moment=require(_0x3ae7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ae7('0x3'));var db=require(_0x3ae7('0x4'))['db'];var utils=require(_0x3ae7('0x5'));var logger=require(_0x3ae7('0x6'))(_0x3ae7('0x7'));var config=require('../../config/environment');var jayson=require(_0x3ae7('0x8'));var client=jayson[_0x3ae7('0x9')]['http']({'port':0x232a});config[_0x3ae7('0xa')]=_['defaults'](config['redis'],{'host':_0x3ae7('0xb'),'port':0x18eb});var socket=require(_0x3ae7('0xc'))(new Redis(config[_0x3ae7('0xa')]));require(_0x3ae7('0xd'))[_0x3ae7('0xe')](socket);function respondWithRpcPromise(_0x487c5c,_0xef8390,_0x55e41e){return new BPromise(function(_0x381662,_0x25096c){return client[_0x3ae7('0xf')](_0x487c5c,_0x55e41e)[_0x3ae7('0x10')](function(_0xcf9563){logger['info']('SmsQueue,\x20%s,\x20%s',_0xef8390,'request\x20sent');logger[_0x3ae7('0x11')](_0x3ae7('0x12'),_0xef8390,_0x3ae7('0x13'),JSON[_0x3ae7('0x14')](_0xcf9563));if(_0xcf9563[_0x3ae7('0x15')]){if(_0xcf9563[_0x3ae7('0x15')][_0x3ae7('0x16')]===0x1f4){logger['error'](_0x3ae7('0x17'),_0xef8390,_0xcf9563[_0x3ae7('0x15')][_0x3ae7('0x18')]);return _0x25096c(_0xcf9563[_0x3ae7('0x15')][_0x3ae7('0x18')]);}logger[_0x3ae7('0x15')](_0x3ae7('0x17'),_0xef8390,_0xcf9563['error'][_0x3ae7('0x18')]);return _0x381662(_0xcf9563['error']['message']);}else{logger[_0x3ae7('0x19')](_0x3ae7('0x17'),_0xef8390,_0x3ae7('0x13'));_0x381662(_0xcf9563[_0x3ae7('0x1a')]['message']);}})[_0x3ae7('0x1b')](function(_0xf29d50){logger[_0x3ae7('0x15')](_0x3ae7('0x17'),_0xef8390,_0xf29d50);_0x25096c(_0xf29d50);});});}exports[_0x3ae7('0x1c')]=function(_0x30c8ab){var _0x3294b9=this;return new Promise(function(_0xe6caa,_0x2281e9){return db['SmsQueue']['findAll']({'raw':_0x30c8ab[_0x3ae7('0x1d')]?_0x30c8ab[_0x3ae7('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x30c8ab[_0x3ae7('0x1d')]?_0x30c8ab['options']['where']||null:null,'attributes':_0x30c8ab[_0x3ae7('0x1d')]?_0x30c8ab[_0x3ae7('0x1d')]['attributes']||null:null,'limit':_0x30c8ab[_0x3ae7('0x1d')]?_0x30c8ab[_0x3ae7('0x1d')][_0x3ae7('0x1e')]||null:null,'include':_0x30c8ab[_0x3ae7('0x1d')]?_0x30c8ab['options'][_0x3ae7('0x1f')]?_[_0x3ae7('0x20')](_0x30c8ab[_0x3ae7('0x1d')]['include'],function(_0x331cae){return{'model':db[_0x331cae['model']],'as':_0x331cae['as'],'attributes':_0x331cae[_0x3ae7('0x21')],'include':_0x331cae[_0x3ae7('0x1f')]?_[_0x3ae7('0x20')](_0x331cae[_0x3ae7('0x1f')],function(_0x1b4cb5){return{'model':db[_0x1b4cb5[_0x3ae7('0x22')]],'as':_0x1b4cb5['as'],'attributes':_0x1b4cb5['attributes'],'include':_0x1b4cb5[_0x3ae7('0x1f')]?_[_0x3ae7('0x20')](_0x1b4cb5['include'],function(_0x23feff){return{'model':db[_0x23feff[_0x3ae7('0x22')]],'as':_0x23feff['as'],'attributes':_0x23feff[_0x3ae7('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23efdb){logger[_0x3ae7('0x19')](_0x3ae7('0x1c'),_0x30c8ab);logger[_0x3ae7('0x11')]('GetSmsQueue',_0x30c8ab,JSON[_0x3ae7('0x14')](_0x23efdb));_0xe6caa(_0x23efdb);})['catch'](function(_0xbd8732){logger[_0x3ae7('0x15')](_0x3ae7('0x1c'),_0xbd8732[_0x3ae7('0x18')],_0x30c8ab);_0x2281e9(_0x3294b9['error'](0x1f4,_0xbd8732[_0x3ae7('0x18')]));});});};exports[_0x3ae7('0x23')]=function(_0x8352df){var _0xeebb49=this;return new Promise(function(_0x107457,_0x43d6ec){return db['SmsQueue'][_0x3ae7('0x24')]({'raw':_0x8352df[_0x3ae7('0x1d')]?_0x8352df['options']['raw']===undefined?!![]:![]:!![],'where':_0x8352df[_0x3ae7('0x1d')]?_0x8352df[_0x3ae7('0x1d')]['where']||null:null,'attributes':_0x8352df[_0x3ae7('0x1d')]?_0x8352df[_0x3ae7('0x1d')][_0x3ae7('0x21')]||null:null,'include':_0x8352df['options']?_0x8352df[_0x3ae7('0x1d')][_0x3ae7('0x1f')]?_[_0x3ae7('0x20')](_0x8352df['options'][_0x3ae7('0x1f')],function(_0x3eebc3){return{'model':db[_0x3eebc3[_0x3ae7('0x22')]],'as':_0x3eebc3['as'],'attributes':_0x3eebc3[_0x3ae7('0x21')],'include':_0x3eebc3['include']?_['map'](_0x3eebc3['include'],function(_0x345514){return{'model':db[_0x345514[_0x3ae7('0x22')]],'as':_0x345514['as'],'attributes':_0x345514[_0x3ae7('0x21')],'include':_0x345514[_0x3ae7('0x1f')]?_[_0x3ae7('0x20')](_0x345514['include'],function(_0x51753f){return{'model':db[_0x51753f['model']],'as':_0x51753f['as'],'attributes':_0x51753f[_0x3ae7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3ae7('0x10')](function(_0x3db2b3){logger[_0x3ae7('0x19')](_0x3ae7('0x23'),_0x8352df);logger['debug'](_0x3ae7('0x23'),_0x8352df,JSON['stringify'](_0x3db2b3));_0x107457(_0x3db2b3);})['catch'](function(_0x702a63){logger['error'](_0x3ae7('0x23'),_0x702a63[_0x3ae7('0x18')],_0x8352df);_0x43d6ec(_0xeebb49[_0x3ae7('0x15')](0x1f4,_0x702a63[_0x3ae7('0x18')]));});});};
\ No newline at end of file
index f277011..89dfdb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae83=['./smsQueue.events','save','remove','update','removeListener','register','smsQueue:'];(function(_0x55dff5,_0x538cb4){var _0x20c3ac=function(_0x458869){while(--_0x458869){_0x55dff5['push'](_0x55dff5['shift']());}};_0x20c3ac(++_0x538cb4);}(_0xae83,0xee));var _0x3ae8=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xae83[_0x4b055c];return _0x4b62bb;};'use strict';var SmsQueueEvents=require(_0x3ae8('0x0'));var events=[_0x3ae8('0x1'),_0x3ae8('0x2'),_0x3ae8('0x3')];function createListener(_0x49c3fe,_0x3929b8){return function(_0x5c7d70){_0x3929b8['emit'](_0x49c3fe,_0x5c7d70);};}function removeListener(_0x4d185a,_0x32264b){return function(){SmsQueueEvents[_0x3ae8('0x4')](_0x4d185a,_0x32264b);};}exports[_0x3ae8('0x5')]=function(_0x5da9da){for(var _0x4e6b48=0x0,_0x144576=events['length'];_0x4e6b48<_0x144576;_0x4e6b48++){var _0x74dff9=events[_0x4e6b48];var _0x191e18=createListener(_0x3ae8('0x6')+_0x74dff9,_0x5da9da);SmsQueueEvents['on'](_0x74dff9,_0x191e18);}};
\ No newline at end of file
+var _0xc932=['remove','update','register','length','smsQueue:','./smsQueue.events'];(function(_0x213aac,_0x30117f){var _0x20bc6f=function(_0x2b1baf){while(--_0x2b1baf){_0x213aac['push'](_0x213aac['shift']());}};_0x20bc6f(++_0x30117f);}(_0xc932,0x11f));var _0x2c93=function(_0x5e9689,_0x48e034){_0x5e9689=_0x5e9689-0x0;var _0x2fac94=_0xc932[_0x5e9689];return _0x2fac94;};'use strict';var SmsQueueEvents=require(_0x2c93('0x0'));var events=['save',_0x2c93('0x1'),_0x2c93('0x2')];function createListener(_0x5dcdae,_0x16c13a){return function(_0x1630be){_0x16c13a['emit'](_0x5dcdae,_0x1630be);};}function removeListener(_0x172803,_0x5d43b2){return function(){SmsQueueEvents['removeListener'](_0x172803,_0x5d43b2);};}exports[_0x2c93('0x3')]=function(_0x2b2582){for(var _0x4a5a76=0x0,_0x298c25=events[_0x2c93('0x4')];_0x4a5a76<_0x298c25;_0x4a5a76++){var _0x4f51d5=events[_0x4a5a76];var _0x2fe83e=createListener(_0x2c93('0x5')+_0x4f51d5,_0x2b2582);SmsQueueEvents['on'](_0x4f51d5,_0x2fe83e);}};
\ No newline at end of file
index 4d76957..828e42a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07d7=['delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x378789,_0x894ede){var _0x493aa7=function(_0x293ab8){while(--_0x293ab8){_0x378789['push'](_0x378789['shift']());}};_0x493aa7(++_0x894ede);}(_0x07d7,0x141));var _0x707d=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x07d7[_0x271060];return _0x40540b;};'use strict';var multer=require(_0x707d('0x0'));var util=require('util');var path=require(_0x707d('0x1'));var timeout=require('connect-timeout');var express=require(_0x707d('0x2'));var router=express[_0x707d('0x3')]();var fs_extra=require(_0x707d('0x4'));var auth=require(_0x707d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x707d('0x6'));var controller=require(_0x707d('0x7'));router[_0x707d('0x8')]('/',auth[_0x707d('0x9')](),controller[_0x707d('0xa')]);router[_0x707d('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x707d('0x8')](_0x707d('0xb'),auth[_0x707d('0x9')](),controller['show']);router[_0x707d('0xc')]('/',auth[_0x707d('0x9')](),controller[_0x707d('0xd')]);router[_0x707d('0xe')](_0x707d('0xb'),auth[_0x707d('0x9')](),controller['update']);router[_0x707d('0xf')](_0x707d('0xb'),auth[_0x707d('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb3a7=['show','create','put','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id'];(function(_0x1965d2,_0x110497){var _0x17381b=function(_0x17533a){while(--_0x17533a){_0x1965d2['push'](_0x1965d2['shift']());}};_0x17381b(++_0x110497);}(_0xb3a7,0x1c5));var _0x7b3a=function(_0x312334,_0x378772){_0x312334=_0x312334-0x0;var _0x9d926c=_0xb3a7[_0x312334];return _0x9d926c;};'use strict';var multer=require(_0x7b3a('0x0'));var util=require('util');var path=require(_0x7b3a('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b3a('0x2'));var router=express[_0x7b3a('0x3')]();var fs_extra=require(_0x7b3a('0x4'));var auth=require(_0x7b3a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x7b3a('0x6')]('/',auth[_0x7b3a('0x7')](),controller['index']);router[_0x7b3a('0x6')](_0x7b3a('0x8'),auth[_0x7b3a('0x7')](),controller[_0x7b3a('0x9')]);router[_0x7b3a('0x6')](_0x7b3a('0xa'),auth['isAuthenticated'](),controller[_0x7b3a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b3a('0xc')]);router[_0x7b3a('0xd')](_0x7b3a('0xa'),auth[_0x7b3a('0x7')](),controller['update']);router['delete'](_0x7b3a('0xa'),auth[_0x7b3a('0x7')](),controller[_0x7b3a('0xe')]);module[_0x7b3a('0xf')]=router;
\ No newline at end of file
index 9d2f5b4..a9aa191 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ea=['DATE','moment','exports','STRING'];(function(_0x53f609,_0xff72fa){var _0x2f4a08=function(_0xd11a3f){while(--_0xd11a3f){_0x53f609['push'](_0x53f609['shift']());}};_0x2f4a08(++_0xff72fa);}(_0x24ea,0x195));var _0xa24e=function(_0x2e8e7b,_0x5e4613){_0x2e8e7b=_0x2e8e7b-0x0;var _0x15fdab=_0x24ea[_0x2e8e7b];return _0x15fdab;};'use strict';var moment=require(_0xa24e('0x0'));var Sequelize=require('sequelize');module[_0xa24e('0x1')]={'uniqueid':{'type':Sequelize[_0xa24e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa24e('0x2')]},'joinAt':{'type':Sequelize[_0xa24e('0x3')]},'leaveAt':{'type':Sequelize[_0xa24e('0x3')]},'acceptAt':{'type':Sequelize[_0xa24e('0x3')]},'exitAt':{'type':Sequelize[_0xa24e('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf768=['moment','exports','STRING','DATE'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf768,0x1dc));var _0x8f76=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf768[_0x3947c9];return _0x2e7871;};'use strict';var moment=require(_0x8f76('0x0'));var Sequelize=require('sequelize');module[_0x8f76('0x1')]={'uniqueid':{'type':Sequelize[_0x8f76('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8f76('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8f76('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8f76('0x2')]}};
\ No newline at end of file
index c3f2094..112c06e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37de=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','length','create','catch','body','find','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x431c94,_0x535dc5){var _0x2074ce=function(_0x1d99b2){while(--_0x1d99b2){_0x431c94['push'](_0x431c94['shift']());}};_0x2074ce(++_0x535dc5);}(_0x37de,0x1b5));var _0xe37d=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x37de[_0x249e96];return _0x17444c;};'use strict';var emlformat=require(_0xe37d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe37d('0x1'));var rp=require('request-promise');var moment=require(_0xe37d('0x2'));var BPromise=require(_0xe37d('0x3'));var Mustache=require(_0xe37d('0x4'));var util=require(_0xe37d('0x5'));var path=require(_0xe37d('0x6'));var sox=require(_0xe37d('0x7'));var csv=require(_0xe37d('0x8'));var ejs=require(_0xe37d('0x9'));var fs=require('fs');var fs_extra=require(_0xe37d('0xa'));var _=require(_0xe37d('0xb'));var squel=require(_0xe37d('0xc'));var crypto=require(_0xe37d('0xd'));var jsforce=require(_0xe37d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe37d('0xf'));var Redis=require(_0xe37d('0x10'));var authService=require(_0xe37d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe37d('0x12'));var logger=require(_0xe37d('0x13'))('api');var utils=require(_0xe37d('0x14'));var config=require(_0xe37d('0x15'));var licenseUtil=require(_0xe37d('0x16'));var db=require(_0xe37d('0x17'))['db'];function respondWithStatusCode(_0x5bbee1,_0x221230){_0x221230=_0x221230||0xcc;return function(_0x327c19){if(_0x327c19){return _0x5bbee1[_0xe37d('0x18')](_0x221230);}return _0x5bbee1['status'](_0x221230)['end']();};}function respondWithResult(_0x2527aa,_0x30d2ef){_0x30d2ef=_0x30d2ef||0xc8;return function(_0x5852fd){if(_0x5852fd){return _0x2527aa[_0xe37d('0x19')](_0x30d2ef)['json'](_0x5852fd);}};}function respondWithFilteredResult(_0x28bff0,_0x2ab91e){return function(_0x278223){if(_0x278223){var _0x5ccb82=typeof _0x2ab91e[_0xe37d('0x1a')]===_0xe37d('0x1b')&&typeof _0x2ab91e['limit']===_0xe37d('0x1b');var _0x211e0f=_0x278223[_0xe37d('0x1c')];var _0x143da0=_0x5ccb82?0x0:_0x2ab91e['offset'];var _0x11236e=_0x5ccb82?_0x278223[_0xe37d('0x1c')]:_0x2ab91e[_0xe37d('0x1a')]+_0x2ab91e['limit'];var _0x1c6514;if(_0x11236e>=_0x211e0f){_0x11236e=_0x211e0f;_0x1c6514=0xc8;}else{_0x1c6514=0xce;}_0x28bff0[_0xe37d('0x19')](_0x1c6514);return _0x28bff0[_0xe37d('0x1d')](_0xe37d('0x1e'),_0x143da0+'-'+_0x11236e+'/'+_0x211e0f)[_0xe37d('0x1f')](_0x278223);}return null;};}function patchUpdates(_0x55bcc2){return function(_0x40dfe4){try{jsonpatch[_0xe37d('0x20')](_0x40dfe4,_0x55bcc2,!![]);}catch(_0x173bc5){return BPromise[_0xe37d('0x21')](_0x173bc5);}return _0x40dfe4[_0xe37d('0x22')]();};}function saveUpdates(_0x350c00,_0x4c5b33){return function(_0x3c22a9){if(_0x3c22a9){return _0x3c22a9[_0xe37d('0x23')](_0x350c00)[_0xe37d('0x24')](function(_0x422faf){return _0x422faf;});}return null;};}function removeEntity(_0x94b5f7,_0x3b1dee){return function(_0x1348b2){if(_0x1348b2){return _0x1348b2[_0xe37d('0x25')]()[_0xe37d('0x24')](function(){_0x94b5f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a0e0,_0x477a83){return function(_0x2ea036){if(!_0x2ea036){_0x24a0e0[_0xe37d('0x18')](0x194);}return _0x2ea036;};}function handleError(_0x494e23,_0x359f38){_0x359f38=_0x359f38||0x1f4;return function(_0x314d43){logger['error'](_0x314d43[_0xe37d('0x26')]);if(_0x314d43['name']){delete _0x314d43[_0xe37d('0x27')];}_0x494e23['status'](_0x359f38)[_0xe37d('0x28')](_0x314d43);};}exports[_0xe37d('0x29')]=function(_0x40b541,_0x1c823d){var _0x8b6c65={},_0x5b1d38={},_0x153056={'count':0x0,'rows':[]};var _0x9fb877=_[_0xe37d('0x2a')](db[_0xe37d('0x2b')][_0xe37d('0x2c')],function(_0x20255d){return{'name':_0x20255d[_0xe37d('0x2d')],'type':_0x20255d[_0xe37d('0x2e')][_0xe37d('0x2f')]};});_0x5b1d38[_0xe37d('0x30')]=_[_0xe37d('0x2a')](_0x9fb877,_0xe37d('0x27'));_0x5b1d38['query']=_[_0xe37d('0x31')](_0x40b541[_0xe37d('0x32')]);_0x5b1d38[_0xe37d('0x33')]=_[_0xe37d('0x34')](_0x5b1d38[_0xe37d('0x30')],_0x5b1d38[_0xe37d('0x32')]);_0x8b6c65[_0xe37d('0x35')]=_['intersection'](_0x5b1d38[_0xe37d('0x30')],qs[_0xe37d('0x36')](_0x40b541['query']['fields']));_0x8b6c65[_0xe37d('0x35')]=_0x8b6c65[_0xe37d('0x35')]['length']?_0x8b6c65[_0xe37d('0x35')]:_0x5b1d38['model'];if(!_0x40b541[_0xe37d('0x32')]['hasOwnProperty'](_0xe37d('0x37'))){_0x8b6c65[_0xe37d('0x38')]=qs[_0xe37d('0x38')](_0x40b541[_0xe37d('0x32')][_0xe37d('0x38')]);_0x8b6c65[_0xe37d('0x1a')]=qs[_0xe37d('0x1a')](_0x40b541[_0xe37d('0x32')][_0xe37d('0x1a')]);}_0x8b6c65[_0xe37d('0x39')]=qs[_0xe37d('0x3a')](_0x40b541[_0xe37d('0x32')]['sort']);_0x8b6c65[_0xe37d('0x3b')]=qs['filters'](_[_0xe37d('0x3c')](_0x40b541[_0xe37d('0x32')],_0x5b1d38[_0xe37d('0x33')]),_0x9fb877);if(_0x40b541['query'][_0xe37d('0x3d')]){_0x8b6c65[_0xe37d('0x3b')]=_[_0xe37d('0x3e')](_0x8b6c65[_0xe37d('0x3b')],{'$or':_['map'](_0x9fb877,function(_0x4ce430){if(_0x4ce430[_0xe37d('0x2e')]!==_0xe37d('0x3f')){var _0x499fd6={};_0x499fd6[_0x4ce430[_0xe37d('0x27')]]={'$like':'%'+_0x40b541[_0xe37d('0x32')][_0xe37d('0x3d')]+'%'};return _0x499fd6;}})});}_0x8b6c65=_[_0xe37d('0x3e')]({},_0x8b6c65,_0x40b541[_0xe37d('0x40')]);var _0x4044a0={'where':_0x8b6c65[_0xe37d('0x3b')]};return db[_0xe37d('0x2b')][_0xe37d('0x1c')](_0x4044a0)[_0xe37d('0x24')](function(_0x502821){_0x153056[_0xe37d('0x1c')]=_0x502821;if(_0x40b541[_0xe37d('0x32')][_0xe37d('0x41')]){_0x8b6c65[_0xe37d('0x42')]=[{'all':!![]}];}return db[_0xe37d('0x2b')][_0xe37d('0x43')](_0x8b6c65);})[_0xe37d('0x24')](function(_0xee69d8){_0x153056[_0xe37d('0x44')]=_0xee69d8;return _0x153056;})[_0xe37d('0x24')](respondWithFilteredResult(_0x1c823d,_0x8b6c65))['catch'](handleError(_0x1c823d,null));};exports['show']=function(_0x24e6dc,_0x5367cb){var _0x5ebcbc={'raw':!![],'where':{'id':_0x24e6dc['params']['id']}},_0x11cd69={};_0x11cd69['model']=_['keys'](db['SmsQueueReport'][_0xe37d('0x2c')]);_0x11cd69[_0xe37d('0x32')]=_[_0xe37d('0x31')](_0x24e6dc[_0xe37d('0x32')]);_0x11cd69[_0xe37d('0x33')]=_[_0xe37d('0x34')](_0x11cd69['model'],_0x11cd69[_0xe37d('0x32')]);_0x5ebcbc[_0xe37d('0x35')]=_[_0xe37d('0x34')](_0x11cd69[_0xe37d('0x30')],qs[_0xe37d('0x36')](_0x24e6dc[_0xe37d('0x32')][_0xe37d('0x36')]));_0x5ebcbc[_0xe37d('0x35')]=_0x5ebcbc[_0xe37d('0x35')][_0xe37d('0x45')]?_0x5ebcbc[_0xe37d('0x35')]:_0x11cd69[_0xe37d('0x30')];if(_0x24e6dc[_0xe37d('0x32')][_0xe37d('0x41')]){_0x5ebcbc[_0xe37d('0x42')]=[{'all':!![]}];}_0x5ebcbc=_[_0xe37d('0x3e')]({},_0x5ebcbc,_0x24e6dc[_0xe37d('0x40')]);return db[_0xe37d('0x2b')]['find'](_0x5ebcbc)[_0xe37d('0x24')](handleEntityNotFound(_0x5367cb,null))[_0xe37d('0x24')](respondWithResult(_0x5367cb,null))['catch'](handleError(_0x5367cb,null));};exports['create']=function(_0x348894,_0xb11aad){return db[_0xe37d('0x2b')][_0xe37d('0x46')](_0x348894['body'],{})[_0xe37d('0x24')](respondWithResult(_0xb11aad,0xc9))[_0xe37d('0x47')](handleError(_0xb11aad,null));};exports[_0xe37d('0x23')]=function(_0x5563b5,_0x4c9954){if(_0x5563b5[_0xe37d('0x48')]['id']){delete _0x5563b5[_0xe37d('0x48')]['id'];}return db[_0xe37d('0x2b')][_0xe37d('0x49')]({'where':{'id':_0x5563b5[_0xe37d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c9954,null))[_0xe37d('0x24')](saveUpdates(_0x5563b5[_0xe37d('0x48')],null))[_0xe37d('0x24')](respondWithResult(_0x4c9954,null))[_0xe37d('0x47')](handleError(_0x4c9954,null));};exports['destroy']=function(_0x15737b,_0x2c4dbd){return db['SmsQueueReport'][_0xe37d('0x49')]({'where':{'id':_0x15737b[_0xe37d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c4dbd,null))[_0xe37d('0x24')](removeEntity(_0x2c4dbd,null))['catch'](handleError(_0x2c4dbd,null));};exports['describe']=function(_0x22b20d,_0x370c8){return db['SmsQueueReport'][_0xe37d('0x4b')]()[_0xe37d('0x24')](respondWithResult(_0x370c8,null))[_0xe37d('0x47')](handleError(_0x370c8,null));};
\ No newline at end of file
+var _0x8513=['index','map','SmsQueueReport','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8513,0x6c));var _0x3851=function(_0x5a13cd,_0x4b1721){_0x5a13cd=_0x5a13cd-0x0;var _0x7c5d5f=_0x8513[_0x5a13cd];return _0x7c5d5f;};'use strict';var emlformat=require(_0x3851('0x0'));var rimraf=require(_0x3851('0x1'));var zipdir=require(_0x3851('0x2'));var jsonpatch=require(_0x3851('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3851('0x4'));var Mustache=require(_0x3851('0x5'));var util=require(_0x3851('0x6'));var path=require(_0x3851('0x7'));var sox=require(_0x3851('0x8'));var csv=require(_0x3851('0x9'));var ejs=require(_0x3851('0xa'));var fs=require('fs');var fs_extra=require(_0x3851('0xb'));var _=require('lodash');var squel=require(_0x3851('0xc'));var crypto=require(_0x3851('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3851('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3851('0xf'));var Papa=require(_0x3851('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3851('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3851('0x12'));var config=require(_0x3851('0x13'));var licenseUtil=require(_0x3851('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e2dd3,_0x39b9ed){_0x39b9ed=_0x39b9ed||0xcc;return function(_0x2c6089){if(_0x2c6089){return _0x5e2dd3[_0x3851('0x15')](_0x39b9ed);}return _0x5e2dd3[_0x3851('0x16')](_0x39b9ed)[_0x3851('0x17')]();};}function respondWithResult(_0x2291b5,_0x3da8c4){_0x3da8c4=_0x3da8c4||0xc8;return function(_0x41628f){if(_0x41628f){return _0x2291b5[_0x3851('0x16')](_0x3da8c4)['json'](_0x41628f);}};}function respondWithFilteredResult(_0x168228,_0x4b9932){return function(_0x41222b){if(_0x41222b){var _0x29659a=typeof _0x4b9932['offset']===_0x3851('0x18')&&typeof _0x4b9932[_0x3851('0x19')]===_0x3851('0x18');var _0x481840=_0x41222b[_0x3851('0x1a')];var _0x3839d3=_0x29659a?0x0:_0x4b9932[_0x3851('0x1b')];var _0x13443e=_0x29659a?_0x41222b[_0x3851('0x1a')]:_0x4b9932['offset']+_0x4b9932['limit'];var _0x20835f;if(_0x13443e>=_0x481840){_0x13443e=_0x481840;_0x20835f=0xc8;}else{_0x20835f=0xce;}_0x168228[_0x3851('0x16')](_0x20835f);return _0x168228['set'](_0x3851('0x1c'),_0x3839d3+'-'+_0x13443e+'/'+_0x481840)[_0x3851('0x1d')](_0x41222b);}return null;};}function patchUpdates(_0x135137){return function(_0x44495b){try{jsonpatch[_0x3851('0x1e')](_0x44495b,_0x135137,!![]);}catch(_0x3324a3){return BPromise[_0x3851('0x1f')](_0x3324a3);}return _0x44495b[_0x3851('0x20')]();};}function saveUpdates(_0x14b545,_0x25368f){return function(_0x228d93){if(_0x228d93){return _0x228d93[_0x3851('0x21')](_0x14b545)[_0x3851('0x22')](function(_0x3d8e28){return _0x3d8e28;});}return null;};}function removeEntity(_0x310603,_0x246bfe){return function(_0x472c5e){if(_0x472c5e){return _0x472c5e[_0x3851('0x23')]()[_0x3851('0x22')](function(){_0x310603[_0x3851('0x16')](0xcc)[_0x3851('0x17')]();});}};}function handleEntityNotFound(_0x501c6a,_0x49d11c){return function(_0x3f1d01){if(!_0x3f1d01){_0x501c6a[_0x3851('0x15')](0x194);}return _0x3f1d01;};}function handleError(_0x1f5d4e,_0x3e95b7){_0x3e95b7=_0x3e95b7||0x1f4;return function(_0x283471){logger[_0x3851('0x24')](_0x283471[_0x3851('0x25')]);if(_0x283471['name']){delete _0x283471[_0x3851('0x26')];}_0x1f5d4e[_0x3851('0x16')](_0x3e95b7)[_0x3851('0x27')](_0x283471);};}exports[_0x3851('0x28')]=function(_0x33e2ec,_0xd87ad9){var _0x588bd7={},_0x2f2377={},_0x1495c1={'count':0x0,'rows':[]};var _0xa7c091=_[_0x3851('0x29')](db[_0x3851('0x2a')]['rawAttributes'],function(_0x143201){return{'name':_0x143201['fieldName'],'type':_0x143201['type'][_0x3851('0x2b')]};});_0x2f2377[_0x3851('0x2c')]=_[_0x3851('0x29')](_0xa7c091,'name');_0x2f2377['query']=_['keys'](_0x33e2ec[_0x3851('0x2d')]);_0x2f2377['filters']=_[_0x3851('0x2e')](_0x2f2377[_0x3851('0x2c')],_0x2f2377[_0x3851('0x2d')]);_0x588bd7['attributes']=_[_0x3851('0x2e')](_0x2f2377[_0x3851('0x2c')],qs[_0x3851('0x2f')](_0x33e2ec['query'][_0x3851('0x2f')]));_0x588bd7['attributes']=_0x588bd7[_0x3851('0x30')]['length']?_0x588bd7[_0x3851('0x30')]:_0x2f2377[_0x3851('0x2c')];if(!_0x33e2ec[_0x3851('0x2d')][_0x3851('0x31')](_0x3851('0x32'))){_0x588bd7[_0x3851('0x19')]=qs[_0x3851('0x19')](_0x33e2ec[_0x3851('0x2d')]['limit']);_0x588bd7['offset']=qs[_0x3851('0x1b')](_0x33e2ec['query'][_0x3851('0x1b')]);}_0x588bd7[_0x3851('0x33')]=qs[_0x3851('0x34')](_0x33e2ec[_0x3851('0x2d')][_0x3851('0x34')]);_0x588bd7[_0x3851('0x35')]=qs[_0x3851('0x36')](_[_0x3851('0x37')](_0x33e2ec['query'],_0x2f2377[_0x3851('0x36')]),_0xa7c091);if(_0x33e2ec[_0x3851('0x2d')][_0x3851('0x38')]){_0x588bd7[_0x3851('0x35')]=_[_0x3851('0x39')](_0x588bd7[_0x3851('0x35')],{'$or':_[_0x3851('0x29')](_0xa7c091,function(_0x28358a){if(_0x28358a[_0x3851('0x3a')]!==_0x3851('0x3b')){var _0x20bcd1={};_0x20bcd1[_0x28358a[_0x3851('0x26')]]={'$like':'%'+_0x33e2ec[_0x3851('0x2d')][_0x3851('0x38')]+'%'};return _0x20bcd1;}})});}_0x588bd7=_['merge']({},_0x588bd7,_0x33e2ec[_0x3851('0x3c')]);var _0x306de9={'where':_0x588bd7[_0x3851('0x35')]};return db[_0x3851('0x2a')][_0x3851('0x1a')](_0x306de9)[_0x3851('0x22')](function(_0x4ce57e){_0x1495c1[_0x3851('0x1a')]=_0x4ce57e;if(_0x33e2ec[_0x3851('0x2d')][_0x3851('0x3d')]){_0x588bd7[_0x3851('0x3e')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x3851('0x3f')](_0x588bd7);})['then'](function(_0x363d92){_0x1495c1[_0x3851('0x40')]=_0x363d92;return _0x1495c1;})[_0x3851('0x22')](respondWithFilteredResult(_0xd87ad9,_0x588bd7))[_0x3851('0x41')](handleError(_0xd87ad9,null));};exports[_0x3851('0x42')]=function(_0x55cf9d,_0x4fea1c){var _0x2c52e9={'raw':!![],'where':{'id':_0x55cf9d['params']['id']}},_0x8989ff={};_0x8989ff[_0x3851('0x2c')]=_[_0x3851('0x43')](db[_0x3851('0x2a')]['rawAttributes']);_0x8989ff[_0x3851('0x2d')]=_[_0x3851('0x43')](_0x55cf9d[_0x3851('0x2d')]);_0x8989ff['filters']=_[_0x3851('0x2e')](_0x8989ff['model'],_0x8989ff['query']);_0x2c52e9[_0x3851('0x30')]=_[_0x3851('0x2e')](_0x8989ff[_0x3851('0x2c')],qs['fields'](_0x55cf9d[_0x3851('0x2d')][_0x3851('0x2f')]));_0x2c52e9[_0x3851('0x30')]=_0x2c52e9[_0x3851('0x30')][_0x3851('0x44')]?_0x2c52e9[_0x3851('0x30')]:_0x8989ff[_0x3851('0x2c')];if(_0x55cf9d[_0x3851('0x2d')][_0x3851('0x3d')]){_0x2c52e9[_0x3851('0x3e')]=[{'all':!![]}];}_0x2c52e9=_['merge']({},_0x2c52e9,_0x55cf9d[_0x3851('0x3c')]);return db[_0x3851('0x2a')]['find'](_0x2c52e9)[_0x3851('0x22')](handleEntityNotFound(_0x4fea1c,null))[_0x3851('0x22')](respondWithResult(_0x4fea1c,null))[_0x3851('0x41')](handleError(_0x4fea1c,null));};exports[_0x3851('0x45')]=function(_0x31db1d,_0x1ec763){return db[_0x3851('0x2a')][_0x3851('0x45')](_0x31db1d[_0x3851('0x46')],{})[_0x3851('0x22')](respondWithResult(_0x1ec763,0xc9))['catch'](handleError(_0x1ec763,null));};exports[_0x3851('0x21')]=function(_0x1da3bc,_0x30f033){if(_0x1da3bc['body']['id']){delete _0x1da3bc[_0x3851('0x46')]['id'];}return db['SmsQueueReport'][_0x3851('0x47')]({'where':{'id':_0x1da3bc[_0x3851('0x48')]['id']}})[_0x3851('0x22')](handleEntityNotFound(_0x30f033,null))[_0x3851('0x22')](saveUpdates(_0x1da3bc[_0x3851('0x46')],null))[_0x3851('0x22')](respondWithResult(_0x30f033,null))['catch'](handleError(_0x30f033,null));};exports[_0x3851('0x23')]=function(_0x5586f3,_0x13f380){return db[_0x3851('0x2a')][_0x3851('0x47')]({'where':{'id':_0x5586f3[_0x3851('0x48')]['id']}})[_0x3851('0x22')](handleEntityNotFound(_0x13f380,null))[_0x3851('0x22')](removeEntity(_0x13f380,null))[_0x3851('0x41')](handleError(_0x13f380,null));};exports[_0x3851('0x49')]=function(_0x551b59,_0x51520c){return db[_0x3851('0x2a')][_0x3851('0x49')]()[_0x3851('0x22')](respondWithResult(_0x51520c,null))['catch'](handleError(_0x51520c,null));};
\ No newline at end of file
index 3b303ac..e1512d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x1558ee,_0x40ed70){var _0x252dba=function(_0x2dbde5){while(--_0x2dbde5){_0x1558ee['push'](_0x1558ee['shift']());}};_0x252dba(++_0x40ed70);}(_0xe706,0xa3));var _0x6e70=function(_0x56260c,_0x3594bc){_0x56260c=_0x56260c-0x0;var _0x3293b9=_0xe706[_0x56260c];return _0x3293b9;};'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'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index c513e79..1d3850a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3fc=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','where','attributes','limit','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3fc,0x83));var _0xce3f=function(_0x3303fb,_0x1266dd){_0x3303fb=_0x3303fb-0x0;var _0x71a686=_0xe3fc[_0x3303fb];return _0x71a686;};'use strict';var _=require(_0xce3f('0x0'));var util=require(_0xce3f('0x1'));var moment=require(_0xce3f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce3f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce3f('0x4'));var logger=require(_0xce3f('0x5'))(_0xce3f('0x6'));var config=require(_0xce3f('0x7'));var jayson=require(_0xce3f('0x8'));var client=jayson[_0xce3f('0x9')][_0xce3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54fb0b,_0x15bc58,_0x177f4a){return new BPromise(function(_0x23d0b7,_0x4b4064){return client[_0xce3f('0xb')](_0x54fb0b,_0x177f4a)[_0xce3f('0xc')](function(_0x500fd9){logger[_0xce3f('0xd')](_0xce3f('0xe'),_0x15bc58,'request\x20sent');logger[_0xce3f('0xf')](_0xce3f('0x10'),_0x15bc58,_0xce3f('0x11'),JSON['stringify'](_0x500fd9));if(_0x500fd9[_0xce3f('0x12')]){if(_0x500fd9[_0xce3f('0x12')]['code']===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x15bc58,_0x500fd9[_0xce3f('0x12')][_0xce3f('0x13')]);return _0x4b4064(_0x500fd9[_0xce3f('0x12')][_0xce3f('0x13')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x15bc58,_0x500fd9[_0xce3f('0x12')][_0xce3f('0x13')]);return _0x23d0b7(_0x500fd9[_0xce3f('0x12')][_0xce3f('0x13')]);}else{logger[_0xce3f('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x15bc58,_0xce3f('0x11'));_0x23d0b7(_0x500fd9[_0xce3f('0x14')][_0xce3f('0x13')]);}})[_0xce3f('0x15')](function(_0x33a4a0){logger[_0xce3f('0x12')](_0xce3f('0xe'),_0x15bc58,_0x33a4a0);_0x4b4064(_0x33a4a0);});});}exports['CreateSmsQueueReport']=function(_0x35dd8e){var _0x5e5b5b=this;return new Promise(function(_0x30213f,_0x27ff61){return db[_0xce3f('0x16')][_0xce3f('0x17')](_0x35dd8e[_0xce3f('0x18')],{'raw':_0x35dd8e[_0xce3f('0x19')]?_0x35dd8e[_0xce3f('0x19')][_0xce3f('0x1a')]===undefined?!![]:![]:!![]})[_0xce3f('0xc')](function(_0x40c6fa){logger['info'](_0xce3f('0x1b'),_0x35dd8e);logger[_0xce3f('0xf')](_0xce3f('0x1b'),_0x35dd8e,JSON[_0xce3f('0x1c')](_0x40c6fa));_0x30213f(_0x40c6fa);})[_0xce3f('0x15')](function(_0x1b9de9){logger['error'](_0xce3f('0x1b'),_0x1b9de9[_0xce3f('0x13')],_0x35dd8e);_0x27ff61(_0x5e5b5b['error'](0x1f4,_0x1b9de9[_0xce3f('0x13')]));});});};exports[_0xce3f('0x1d')]=function(_0x28593c){var _0x906ca4=this;return new Promise(function(_0x4ec855,_0x2d05bc){return db['SmsQueueReport']['update'](_0x28593c[_0xce3f('0x18')],{'raw':_0x28593c[_0xce3f('0x19')]?_0x28593c[_0xce3f('0x19')][_0xce3f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28593c[_0xce3f('0x19')]?_0x28593c[_0xce3f('0x19')][_0xce3f('0x1e')]||null:null,'attributes':_0x28593c[_0xce3f('0x19')]?_0x28593c[_0xce3f('0x19')][_0xce3f('0x1f')]||null:null,'limit':_0x28593c[_0xce3f('0x19')]?_0x28593c[_0xce3f('0x19')][_0xce3f('0x20')]||null:null})[_0xce3f('0xc')](function(_0x5b097e){logger[_0xce3f('0xd')](_0xce3f('0x1d'),_0x28593c);logger['debug'](_0xce3f('0x1d'),_0x28593c,JSON[_0xce3f('0x1c')](_0x5b097e));_0x4ec855(_0x5b097e);})[_0xce3f('0x15')](function(_0x37bd11){logger['error']('UpdateSmsQueueReport',_0x37bd11[_0xce3f('0x13')],_0x28593c);_0x2d05bc(_0x906ca4[_0xce3f('0x12')](0x1f4,_0x37bd11[_0xce3f('0x13')]));});});};
\ No newline at end of file
+var _0x6ab4=['body','UpdateSmsQueueReport','options','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','catch','CreateSmsQueueReport','SmsQueueReport','create'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x6ab4,0x127));var _0x46ab=function(_0x313e77,_0x2c4581){_0x313e77=_0x313e77-0x0;var _0x400440=_0x6ab4[_0x313e77];return _0x400440;};'use strict';var _=require(_0x46ab('0x0'));var util=require('util');var moment=require(_0x46ab('0x1'));var BPromise=require(_0x46ab('0x2'));var rs=require(_0x46ab('0x3'));var fs=require('fs');var Redis=require(_0x46ab('0x4'));var db=require(_0x46ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x46ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x46ab('0x7'));var client=jayson[_0x46ab('0x8')][_0x46ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3370f6,_0x727c0e,_0xcb6c24){return new BPromise(function(_0xa3f5ac,_0x54d878){return client[_0x46ab('0xa')](_0x3370f6,_0xcb6c24)[_0x46ab('0xb')](function(_0x2dd285){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x727c0e,_0x46ab('0xc'));logger[_0x46ab('0xd')](_0x46ab('0xe'),_0x727c0e,_0x46ab('0xc'),JSON[_0x46ab('0xf')](_0x2dd285));if(_0x2dd285[_0x46ab('0x10')]){if(_0x2dd285['error'][_0x46ab('0x11')]===0x1f4){logger[_0x46ab('0x10')](_0x46ab('0x12'),_0x727c0e,_0x2dd285[_0x46ab('0x10')][_0x46ab('0x13')]);return _0x54d878(_0x2dd285[_0x46ab('0x10')]['message']);}logger['error'](_0x46ab('0x12'),_0x727c0e,_0x2dd285[_0x46ab('0x10')][_0x46ab('0x13')]);return _0xa3f5ac(_0x2dd285[_0x46ab('0x10')][_0x46ab('0x13')]);}else{logger[_0x46ab('0x14')](_0x46ab('0x12'),_0x727c0e,'request\x20sent');_0xa3f5ac(_0x2dd285['result'][_0x46ab('0x13')]);}})[_0x46ab('0x15')](function(_0x59282f){logger['error'](_0x46ab('0x12'),_0x727c0e,_0x59282f);_0x54d878(_0x59282f);});});}exports[_0x46ab('0x16')]=function(_0xe0ca66){var _0x568ee9=this;return new Promise(function(_0x2d24e2,_0x4d5bc9){return db[_0x46ab('0x17')][_0x46ab('0x18')](_0xe0ca66[_0x46ab('0x19')],{'raw':_0xe0ca66['options']?_0xe0ca66['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x240156){logger['info'](_0x46ab('0x16'),_0xe0ca66);logger[_0x46ab('0xd')]('CreateSmsQueueReport',_0xe0ca66,JSON['stringify'](_0x240156));_0x2d24e2(_0x240156);})['catch'](function(_0xe0c886){logger[_0x46ab('0x10')](_0x46ab('0x16'),_0xe0c886[_0x46ab('0x13')],_0xe0ca66);_0x4d5bc9(_0x568ee9[_0x46ab('0x10')](0x1f4,_0xe0c886['message']));});});};exports[_0x46ab('0x1a')]=function(_0x12f011){var _0x2a14ee=this;return new Promise(function(_0x38a620,_0x389411){return db[_0x46ab('0x17')]['update'](_0x12f011[_0x46ab('0x19')],{'raw':_0x12f011[_0x46ab('0x1b')]?_0x12f011['options'][_0x46ab('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12f011[_0x46ab('0x1b')]?_0x12f011[_0x46ab('0x1b')][_0x46ab('0x1d')]||null:null,'attributes':_0x12f011[_0x46ab('0x1b')]?_0x12f011[_0x46ab('0x1b')][_0x46ab('0x1e')]||null:null,'limit':_0x12f011[_0x46ab('0x1b')]?_0x12f011[_0x46ab('0x1b')][_0x46ab('0x1f')]||null:null})[_0x46ab('0xb')](function(_0x5d0fcd){logger[_0x46ab('0x14')](_0x46ab('0x1a'),_0x12f011);logger['debug'](_0x46ab('0x1a'),_0x12f011,JSON['stringify'](_0x5d0fcd));_0x38a620(_0x5d0fcd);})['catch'](function(_0xc12d20){logger[_0x46ab('0x10')](_0x46ab('0x1a'),_0xc12d20[_0x46ab('0x13')],_0x12f011);_0x389411(_0x2a14ee[_0x46ab('0x10')](0x1f4,_0xc12d20['message']));});});};
\ No newline at end of file
index 3d0cfb0..4ee3c63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7579=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x56a103,_0x3805c2){var _0x126bac=function(_0x184695){while(--_0x184695){_0x56a103['push'](_0x56a103['shift']());}};_0x126bac(++_0x3805c2);}(_0x7579,0x1e2));var _0x9757=function(_0x254289,_0x463f07){_0x254289=_0x254289-0x0;var _0x2d18a2=_0x7579[_0x254289];return _0x2d18a2;};'use strict';var multer=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var path=require(_0x9757('0x2'));var timeout=require(_0x9757('0x3'));var express=require(_0x9757('0x4'));var router=express[_0x9757('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9757('0x6'));var interaction=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var controller=require(_0x9757('0x9'));router['get']('/',auth[_0x9757('0xa')](),controller[_0x9757('0xb')]);router[_0x9757('0xc')]('/describe',auth[_0x9757('0xa')](),controller['describe']);router[_0x9757('0xc')](_0x9757('0xd'),auth[_0x9757('0xa')](),controller['show']);router[_0x9757('0xe')]('/',auth[_0x9757('0xa')](),controller[_0x9757('0xf')]);router[_0x9757('0x10')](_0x9757('0xd'),auth[_0x9757('0xa')](),controller[_0x9757('0x11')]);router[_0x9757('0x12')](_0x9757('0xd'),auth[_0x9757('0xa')](),controller[_0x9757('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x1670=['create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x337e06,_0x1693f0){var _0x34eee4=function(_0x2dc60c){while(--_0x2dc60c){_0x337e06['push'](_0x337e06['shift']());}};_0x34eee4(++_0x1693f0);}(_0x1670,0x9a));var _0x0167=function(_0x26458c,_0x27bcda){_0x26458c=_0x26458c-0x0;var _0x3bc991=_0x1670[_0x26458c];return _0x3bc991;};'use strict';var multer=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var path=require('path');var timeout=require(_0x0167('0x2'));var express=require('express');var router=express[_0x0167('0x3')]();var fs_extra=require(_0x0167('0x4'));var auth=require(_0x0167('0x5'));var interaction=require(_0x0167('0x6'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x0167('0x7')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0x9')]);router[_0x0167('0x7')](_0x0167('0xa'),auth[_0x0167('0x8')](),controller[_0x0167('0xb')]);router[_0x0167('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0167('0xc')]);router[_0x0167('0xd')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0xe')]);router[_0x0167('0xf')](_0x0167('0x10'),auth[_0x0167('0x8')](),controller[_0x0167('0x11')]);router[_0x0167('0x12')](_0x0167('0x10'),auth[_0x0167('0x8')](),controller[_0x0167('0x13')]);module[_0x0167('0x14')]=router;
\ No newline at end of file
index db51a9e..cad6a22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x28938e,_0x8af0b){_0x28938e=_0x28938e-0x0;var _0x4be10e=_0x9bde[_0x28938e];return _0x4be10e;};'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
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x266de8,_0x157d76){var _0x193e16=function(_0x24223){while(--_0x24223){_0x266de8['push'](_0x266de8['shift']());}};_0x193e16(++_0x157d76);}(_0xf4eb,0xec));var _0xbf4e=function(_0x182ab1,_0x13f9a6){_0x182ab1=_0x182ab1-0x0;var _0x52a4d5=_0xf4eb[_0x182ab1];return _0x52a4d5;};'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 d5e4bc4..5b972cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fff=['merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','SmsTransferReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','catch','params'];(function(_0x2812a5,_0x2d8bb5){var _0x5b1856=function(_0x29b29a){while(--_0x29b29a){_0x2812a5['push'](_0x2812a5['shift']());}};_0x5b1856(++_0x2d8bb5);}(_0x9fff,0x91));var _0xf9ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fff[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf9ff('0x0'));var rimraf=require(_0xf9ff('0x1'));var zipdir=require(_0xf9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9ff('0x3'));var moment=require('moment');var BPromise=require(_0xf9ff('0x4'));var Mustache=require(_0xf9ff('0x5'));var util=require('util');var path=require(_0xf9ff('0x6'));var sox=require(_0xf9ff('0x7'));var csv=require(_0xf9ff('0x8'));var ejs=require(_0xf9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xf9ff('0xa'));var _=require(_0xf9ff('0xb'));var squel=require(_0xf9ff('0xc'));var crypto=require('crypto');var jsforce=require(_0xf9ff('0xd'));var deskjs=require(_0xf9ff('0xe'));var toCsv=require(_0xf9ff('0x8'));var querystring=require(_0xf9ff('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9ff('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9ff('0x11'));var logger=require(_0xf9ff('0x12'))('api');var utils=require(_0xf9ff('0x13'));var config=require(_0xf9ff('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9ff('0x15'))['db'];function respondWithStatusCode(_0x56ccbf,_0x483203){_0x483203=_0x483203||0xcc;return function(_0x4d5d18){if(_0x4d5d18){return _0x56ccbf[_0xf9ff('0x16')](_0x483203);}return _0x56ccbf[_0xf9ff('0x17')](_0x483203)[_0xf9ff('0x18')]();};}function respondWithResult(_0x17a4c6,_0x16140b){_0x16140b=_0x16140b||0xc8;return function(_0x71f848){if(_0x71f848){return _0x17a4c6[_0xf9ff('0x17')](_0x16140b)[_0xf9ff('0x19')](_0x71f848);}};}function respondWithFilteredResult(_0x3bb339,_0x20e2e7){return function(_0x409181){if(_0x409181){var _0x5990ce=typeof _0x20e2e7['offset']===_0xf9ff('0x1a')&&typeof _0x20e2e7['limit']===_0xf9ff('0x1a');var _0x125ddc=_0x409181[_0xf9ff('0x1b')];var _0x194d1b=_0x5990ce?0x0:_0x20e2e7['offset'];var _0x4ba799=_0x5990ce?_0x409181[_0xf9ff('0x1b')]:_0x20e2e7[_0xf9ff('0x1c')]+_0x20e2e7[_0xf9ff('0x1d')];var _0x25878b;if(_0x4ba799>=_0x125ddc){_0x4ba799=_0x125ddc;_0x25878b=0xc8;}else{_0x25878b=0xce;}_0x3bb339[_0xf9ff('0x17')](_0x25878b);return _0x3bb339[_0xf9ff('0x1e')](_0xf9ff('0x1f'),_0x194d1b+'-'+_0x4ba799+'/'+_0x125ddc)[_0xf9ff('0x19')](_0x409181);}return null;};}function patchUpdates(_0x475018){return function(_0x2a245f){try{jsonpatch['apply'](_0x2a245f,_0x475018,!![]);}catch(_0x35e4d1){return BPromise[_0xf9ff('0x20')](_0x35e4d1);}return _0x2a245f[_0xf9ff('0x21')]();};}function saveUpdates(_0x3c3860,_0x37613b){return function(_0x55f22a){if(_0x55f22a){return _0x55f22a[_0xf9ff('0x22')](_0x3c3860)[_0xf9ff('0x23')](function(_0x2e453e){return _0x2e453e;});}return null;};}function removeEntity(_0x2073d2,_0x410cde){return function(_0x52476e){if(_0x52476e){return _0x52476e[_0xf9ff('0x24')]()[_0xf9ff('0x23')](function(){_0x2073d2['status'](0xcc)[_0xf9ff('0x18')]();});}};}function handleEntityNotFound(_0x48b6f6,_0x16f11d){return function(_0x5cf3f9){if(!_0x5cf3f9){_0x48b6f6['sendStatus'](0x194);}return _0x5cf3f9;};}function handleError(_0x48d840,_0x5ed0a1){_0x5ed0a1=_0x5ed0a1||0x1f4;return function(_0xb4f22e){logger[_0xf9ff('0x25')](_0xb4f22e['stack']);if(_0xb4f22e[_0xf9ff('0x26')]){delete _0xb4f22e[_0xf9ff('0x26')];}_0x48d840[_0xf9ff('0x17')](_0x5ed0a1)[_0xf9ff('0x27')](_0xb4f22e);};}exports['index']=function(_0xcfdd3b,_0x52e735){var _0x2beb5f={},_0x483250={},_0x15d194={'count':0x0,'rows':[]};var _0x26046c=_['map'](db[_0xf9ff('0x28')][_0xf9ff('0x29')],function(_0x1dd85b){return{'name':_0x1dd85b[_0xf9ff('0x2a')],'type':_0x1dd85b['type'][_0xf9ff('0x2b')]};});_0x483250['model']=_[_0xf9ff('0x2c')](_0x26046c,_0xf9ff('0x26'));_0x483250[_0xf9ff('0x2d')]=_[_0xf9ff('0x2e')](_0xcfdd3b[_0xf9ff('0x2d')]);_0x483250[_0xf9ff('0x2f')]=_[_0xf9ff('0x30')](_0x483250['model'],_0x483250[_0xf9ff('0x2d')]);_0x2beb5f[_0xf9ff('0x31')]=_[_0xf9ff('0x30')](_0x483250[_0xf9ff('0x32')],qs[_0xf9ff('0x33')](_0xcfdd3b[_0xf9ff('0x2d')][_0xf9ff('0x33')]));_0x2beb5f[_0xf9ff('0x31')]=_0x2beb5f[_0xf9ff('0x31')][_0xf9ff('0x34')]?_0x2beb5f[_0xf9ff('0x31')]:_0x483250[_0xf9ff('0x32')];if(!_0xcfdd3b[_0xf9ff('0x2d')][_0xf9ff('0x35')](_0xf9ff('0x36'))){_0x2beb5f[_0xf9ff('0x1d')]=qs[_0xf9ff('0x1d')](_0xcfdd3b[_0xf9ff('0x2d')][_0xf9ff('0x1d')]);_0x2beb5f[_0xf9ff('0x1c')]=qs[_0xf9ff('0x1c')](_0xcfdd3b[_0xf9ff('0x2d')][_0xf9ff('0x1c')]);}_0x2beb5f[_0xf9ff('0x37')]=qs[_0xf9ff('0x38')](_0xcfdd3b[_0xf9ff('0x2d')]['sort']);_0x2beb5f[_0xf9ff('0x39')]=qs[_0xf9ff('0x2f')](_['pick'](_0xcfdd3b[_0xf9ff('0x2d')],_0x483250[_0xf9ff('0x2f')]),_0x26046c);if(_0xcfdd3b[_0xf9ff('0x2d')][_0xf9ff('0x3a')]){_0x2beb5f[_0xf9ff('0x39')]=_['merge'](_0x2beb5f[_0xf9ff('0x39')],{'$or':_[_0xf9ff('0x2c')](_0x26046c,function(_0x5ceb3a){if(_0x5ceb3a['type']!==_0xf9ff('0x3b')){var _0x2207a8={};_0x2207a8[_0x5ceb3a[_0xf9ff('0x26')]]={'$like':'%'+_0xcfdd3b['query'][_0xf9ff('0x3a')]+'%'};return _0x2207a8;}})});}_0x2beb5f=_['merge']({},_0x2beb5f,_0xcfdd3b[_0xf9ff('0x3c')]);var _0x2de3c5={'where':_0x2beb5f['where']};return db[_0xf9ff('0x28')][_0xf9ff('0x1b')](_0x2de3c5)[_0xf9ff('0x23')](function(_0x14cb7a){_0x15d194['count']=_0x14cb7a;if(_0xcfdd3b[_0xf9ff('0x2d')][_0xf9ff('0x3d')]){_0x2beb5f[_0xf9ff('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x2beb5f);})[_0xf9ff('0x23')](function(_0x2d1986){_0x15d194['rows']=_0x2d1986;return _0x15d194;})[_0xf9ff('0x23')](respondWithFilteredResult(_0x52e735,_0x2beb5f))[_0xf9ff('0x3f')](handleError(_0x52e735,null));};exports['show']=function(_0x5e5a33,_0x3707cf){var _0x1a7070={'raw':!![],'where':{'id':_0x5e5a33[_0xf9ff('0x40')]['id']}},_0x413ec7={};_0x413ec7[_0xf9ff('0x32')]=_['keys'](db[_0xf9ff('0x28')][_0xf9ff('0x29')]);_0x413ec7[_0xf9ff('0x2d')]=_['keys'](_0x5e5a33['query']);_0x413ec7[_0xf9ff('0x2f')]=_['intersection'](_0x413ec7[_0xf9ff('0x32')],_0x413ec7[_0xf9ff('0x2d')]);_0x1a7070['attributes']=_[_0xf9ff('0x30')](_0x413ec7[_0xf9ff('0x32')],qs[_0xf9ff('0x33')](_0x5e5a33[_0xf9ff('0x2d')][_0xf9ff('0x33')]));_0x1a7070[_0xf9ff('0x31')]=_0x1a7070[_0xf9ff('0x31')][_0xf9ff('0x34')]?_0x1a7070[_0xf9ff('0x31')]:_0x413ec7[_0xf9ff('0x32')];if(_0x5e5a33[_0xf9ff('0x2d')][_0xf9ff('0x3d')]){_0x1a7070[_0xf9ff('0x3e')]=[{'all':!![]}];}_0x1a7070=_[_0xf9ff('0x41')]({},_0x1a7070,_0x5e5a33[_0xf9ff('0x3c')]);return db[_0xf9ff('0x28')][_0xf9ff('0x42')](_0x1a7070)['then'](handleEntityNotFound(_0x3707cf,null))[_0xf9ff('0x23')](respondWithResult(_0x3707cf,null))[_0xf9ff('0x3f')](handleError(_0x3707cf,null));};exports[_0xf9ff('0x43')]=function(_0x1ab52e,_0x18979d){return db['SmsTransferReport'][_0xf9ff('0x43')](_0x1ab52e['body'],{})[_0xf9ff('0x23')](respondWithResult(_0x18979d,0xc9))[_0xf9ff('0x3f')](handleError(_0x18979d,null));};exports['update']=function(_0x512b26,_0x2fb185){if(_0x512b26['body']['id']){delete _0x512b26[_0xf9ff('0x44')]['id'];}return db[_0xf9ff('0x28')][_0xf9ff('0x42')]({'where':{'id':_0x512b26[_0xf9ff('0x40')]['id']}})[_0xf9ff('0x23')](handleEntityNotFound(_0x2fb185,null))[_0xf9ff('0x23')](saveUpdates(_0x512b26[_0xf9ff('0x44')],null))[_0xf9ff('0x23')](respondWithResult(_0x2fb185,null))['catch'](handleError(_0x2fb185,null));};exports[_0xf9ff('0x24')]=function(_0x24ee50,_0x44490a){return db[_0xf9ff('0x28')]['find']({'where':{'id':_0x24ee50[_0xf9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x44490a,null))[_0xf9ff('0x23')](removeEntity(_0x44490a,null))['catch'](handleError(_0x44490a,null));};exports[_0xf9ff('0x45')]=function(_0x729beb,_0x2f42d5){return db[_0xf9ff('0x28')][_0xf9ff('0x45')]()[_0xf9ff('0x23')](respondWithResult(_0x2f42d5,null))[_0xf9ff('0x3f')](handleError(_0x2f42d5,null));};
\ No newline at end of file
+var _0x9da6=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','describe','rimraf','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','model','map','query','keys'];(function(_0x4dc810,_0x2cfc5a){var _0x205309=function(_0xab6376){while(--_0xab6376){_0x4dc810['push'](_0x4dc810['shift']());}};_0x205309(++_0x2cfc5a);}(_0x9da6,0xa6));var _0x69da=function(_0x5101f9,_0x5ae1a5){_0x5101f9=_0x5101f9-0x0;var _0x1e28f2=_0x9da6[_0x5101f9];return _0x1e28f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x69da('0x1'));var Mustache=require(_0x69da('0x2'));var util=require(_0x69da('0x3'));var path=require(_0x69da('0x4'));var sox=require('sox');var csv=require(_0x69da('0x5'));var ejs=require(_0x69da('0x6'));var fs=require('fs');var fs_extra=require(_0x69da('0x7'));var _=require(_0x69da('0x8'));var squel=require(_0x69da('0x9'));var crypto=require('crypto');var jsforce=require(_0x69da('0xa'));var deskjs=require(_0x69da('0xb'));var toCsv=require('to-csv');var querystring=require(_0x69da('0xc'));var Papa=require(_0x69da('0xd'));var Redis=require(_0x69da('0xe'));var authService=require(_0x69da('0xf'));var qs=require(_0x69da('0x10'));var as=require(_0x69da('0x11'));var hardwareService=require(_0x69da('0x12'));var logger=require('../../config/logger')(_0x69da('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69da('0x14'))['db'];function respondWithStatusCode(_0x54caca,_0x2447bb){_0x2447bb=_0x2447bb||0xcc;return function(_0x3d0003){if(_0x3d0003){return _0x54caca[_0x69da('0x15')](_0x2447bb);}return _0x54caca[_0x69da('0x16')](_0x2447bb)[_0x69da('0x17')]();};}function respondWithResult(_0x526959,_0x3dd616){_0x3dd616=_0x3dd616||0xc8;return function(_0x500390){if(_0x500390){return _0x526959['status'](_0x3dd616)['json'](_0x500390);}};}function respondWithFilteredResult(_0x27a880,_0x21953d){return function(_0x5043e7){if(_0x5043e7){var _0x5bc1ed=typeof _0x21953d[_0x69da('0x18')]===_0x69da('0x19')&&typeof _0x21953d[_0x69da('0x1a')]===_0x69da('0x19');var _0x27994e=_0x5043e7[_0x69da('0x1b')];var _0x41b527=_0x5bc1ed?0x0:_0x21953d[_0x69da('0x18')];var _0x4cf722=_0x5bc1ed?_0x5043e7[_0x69da('0x1b')]:_0x21953d['offset']+_0x21953d[_0x69da('0x1a')];var _0x11db9b;if(_0x4cf722>=_0x27994e){_0x4cf722=_0x27994e;_0x11db9b=0xc8;}else{_0x11db9b=0xce;}_0x27a880[_0x69da('0x16')](_0x11db9b);return _0x27a880[_0x69da('0x1c')](_0x69da('0x1d'),_0x41b527+'-'+_0x4cf722+'/'+_0x27994e)['json'](_0x5043e7);}return null;};}function patchUpdates(_0x986aa0){return function(_0x578079){try{jsonpatch['apply'](_0x578079,_0x986aa0,!![]);}catch(_0x2d4b21){return BPromise[_0x69da('0x1e')](_0x2d4b21);}return _0x578079['save']();};}function saveUpdates(_0xe27713,_0x3d4c23){return function(_0x1c74e0){if(_0x1c74e0){return _0x1c74e0[_0x69da('0x1f')](_0xe27713)[_0x69da('0x20')](function(_0x413dd1){return _0x413dd1;});}return null;};}function removeEntity(_0x242582,_0x3508a5){return function(_0x3ef7fb){if(_0x3ef7fb){return _0x3ef7fb[_0x69da('0x21')]()['then'](function(){_0x242582[_0x69da('0x16')](0xcc)[_0x69da('0x17')]();});}};}function handleEntityNotFound(_0x287c30,_0x2e473e){return function(_0x44223e){if(!_0x44223e){_0x287c30[_0x69da('0x15')](0x194);}return _0x44223e;};}function handleError(_0x46124d,_0x5a210e){_0x5a210e=_0x5a210e||0x1f4;return function(_0x26988c){logger[_0x69da('0x22')](_0x26988c[_0x69da('0x23')]);if(_0x26988c[_0x69da('0x24')]){delete _0x26988c[_0x69da('0x24')];}_0x46124d[_0x69da('0x16')](_0x5a210e)[_0x69da('0x25')](_0x26988c);};}exports[_0x69da('0x26')]=function(_0x2de29a,_0x4b6848){var _0x5a8d33={},_0x121e2e={},_0x4d18b2={'count':0x0,'rows':[]};var _0x3cd856=_['map'](db[_0x69da('0x27')][_0x69da('0x28')],function(_0x40ab1d){return{'name':_0x40ab1d[_0x69da('0x29')],'type':_0x40ab1d[_0x69da('0x2a')]['key']};});_0x121e2e[_0x69da('0x2b')]=_[_0x69da('0x2c')](_0x3cd856,'name');_0x121e2e[_0x69da('0x2d')]=_[_0x69da('0x2e')](_0x2de29a['query']);_0x121e2e[_0x69da('0x2f')]=_[_0x69da('0x30')](_0x121e2e['model'],_0x121e2e[_0x69da('0x2d')]);_0x5a8d33[_0x69da('0x31')]=_[_0x69da('0x30')](_0x121e2e[_0x69da('0x2b')],qs[_0x69da('0x32')](_0x2de29a[_0x69da('0x2d')]['fields']));_0x5a8d33['attributes']=_0x5a8d33[_0x69da('0x31')][_0x69da('0x33')]?_0x5a8d33[_0x69da('0x31')]:_0x121e2e['model'];if(!_0x2de29a[_0x69da('0x2d')][_0x69da('0x34')](_0x69da('0x35'))){_0x5a8d33['limit']=qs[_0x69da('0x1a')](_0x2de29a['query'][_0x69da('0x1a')]);_0x5a8d33['offset']=qs[_0x69da('0x18')](_0x2de29a[_0x69da('0x2d')][_0x69da('0x18')]);}_0x5a8d33['order']=qs[_0x69da('0x36')](_0x2de29a[_0x69da('0x2d')]['sort']);_0x5a8d33['where']=qs['filters'](_[_0x69da('0x37')](_0x2de29a[_0x69da('0x2d')],_0x121e2e[_0x69da('0x2f')]),_0x3cd856);if(_0x2de29a['query']['filter']){_0x5a8d33['where']=_['merge'](_0x5a8d33[_0x69da('0x38')],{'$or':_['map'](_0x3cd856,function(_0xac3791){if(_0xac3791[_0x69da('0x2a')]!==_0x69da('0x39')){var _0x1cee8e={};_0x1cee8e[_0xac3791['name']]={'$like':'%'+_0x2de29a[_0x69da('0x2d')][_0x69da('0x3a')]+'%'};return _0x1cee8e;}})});}_0x5a8d33=_[_0x69da('0x3b')]({},_0x5a8d33,_0x2de29a[_0x69da('0x3c')]);var _0x47b210={'where':_0x5a8d33[_0x69da('0x38')]};return db[_0x69da('0x27')][_0x69da('0x1b')](_0x47b210)[_0x69da('0x20')](function(_0x475caf){_0x4d18b2['count']=_0x475caf;if(_0x2de29a[_0x69da('0x2d')][_0x69da('0x3d')]){_0x5a8d33[_0x69da('0x3e')]=[{'all':!![]}];}return db[_0x69da('0x27')]['findAll'](_0x5a8d33);})[_0x69da('0x20')](function(_0x3596cb){_0x4d18b2[_0x69da('0x3f')]=_0x3596cb;return _0x4d18b2;})[_0x69da('0x20')](respondWithFilteredResult(_0x4b6848,_0x5a8d33))[_0x69da('0x40')](handleError(_0x4b6848,null));};exports[_0x69da('0x41')]=function(_0x416e38,_0x2f51f8){var _0x31cf4b={'raw':!![],'where':{'id':_0x416e38[_0x69da('0x42')]['id']}},_0x3ae84e={};_0x3ae84e[_0x69da('0x2b')]=_[_0x69da('0x2e')](db['SmsTransferReport'][_0x69da('0x28')]);_0x3ae84e[_0x69da('0x2d')]=_[_0x69da('0x2e')](_0x416e38[_0x69da('0x2d')]);_0x3ae84e[_0x69da('0x2f')]=_[_0x69da('0x30')](_0x3ae84e['model'],_0x3ae84e[_0x69da('0x2d')]);_0x31cf4b[_0x69da('0x31')]=_[_0x69da('0x30')](_0x3ae84e[_0x69da('0x2b')],qs['fields'](_0x416e38[_0x69da('0x2d')]['fields']));_0x31cf4b[_0x69da('0x31')]=_0x31cf4b[_0x69da('0x31')][_0x69da('0x33')]?_0x31cf4b[_0x69da('0x31')]:_0x3ae84e[_0x69da('0x2b')];if(_0x416e38['query'][_0x69da('0x3d')]){_0x31cf4b[_0x69da('0x3e')]=[{'all':!![]}];}_0x31cf4b=_['merge']({},_0x31cf4b,_0x416e38['options']);return db[_0x69da('0x27')]['find'](_0x31cf4b)[_0x69da('0x20')](handleEntityNotFound(_0x2f51f8,null))['then'](respondWithResult(_0x2f51f8,null))[_0x69da('0x40')](handleError(_0x2f51f8,null));};exports[_0x69da('0x43')]=function(_0x187c2a,_0x3ae1a2){return db[_0x69da('0x27')]['create'](_0x187c2a['body'],{})[_0x69da('0x20')](respondWithResult(_0x3ae1a2,0xc9))[_0x69da('0x40')](handleError(_0x3ae1a2,null));};exports['update']=function(_0xcde7cf,_0x532da7){if(_0xcde7cf['body']['id']){delete _0xcde7cf[_0x69da('0x44')]['id'];}return db[_0x69da('0x27')][_0x69da('0x45')]({'where':{'id':_0xcde7cf[_0x69da('0x42')]['id']}})[_0x69da('0x20')](handleEntityNotFound(_0x532da7,null))[_0x69da('0x20')](saveUpdates(_0xcde7cf[_0x69da('0x44')],null))[_0x69da('0x20')](respondWithResult(_0x532da7,null))[_0x69da('0x40')](handleError(_0x532da7,null));};exports['destroy']=function(_0x41b902,_0x2e2114){return db[_0x69da('0x27')]['find']({'where':{'id':_0x41b902[_0x69da('0x42')]['id']}})[_0x69da('0x20')](handleEntityNotFound(_0x2e2114,null))[_0x69da('0x20')](removeEntity(_0x2e2114,null))[_0x69da('0x40')](handleError(_0x2e2114,null));};exports['describe']=function(_0x2563a8,_0x3c11b7){return db['SmsTransferReport'][_0x69da('0x46')]()[_0x69da('0x20')](respondWithResult(_0x3c11b7,null))['catch'](handleError(_0x3c11b7,null));};
\ No newline at end of file
index 75aac67..ec0b3e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa991=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','../../config/logger'];(function(_0x4e3817,_0x6bcf14){var _0x159f8a=function(_0x2780e1){while(--_0x2780e1){_0x4e3817['push'](_0x4e3817['shift']());}};_0x159f8a(++_0x6bcf14);}(_0xa991,0x143));var _0x1a99=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xa991[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x1a99('0x0'));var util=require('util');var logger=require(_0x1a99('0x1'))(_0x1a99('0x2'));var moment=require(_0x1a99('0x3'));var BPromise=require(_0x1a99('0x4'));var rp=require(_0x1a99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a99('0x6'));var config=require(_0x1a99('0x7'));var attributes=require(_0x1a99('0x8'));module[_0x1a99('0x9')]=function(_0x22990b,_0xabf36a){return _0x22990b[_0x1a99('0xa')]('SmsTransferReport',attributes,{'tableName':_0x1a99('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1a99('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b6d=['path','rimraf','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','lodash','../../config/logger','moment','bluebird'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0x1b6d,0x1e6));var _0xd1b6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b6d[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd1b6('0x0'));var util=require('util');var logger=require(_0xd1b6('0x1'))('api');var moment=require(_0xd1b6('0x2'));var BPromise=require(_0xd1b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1b6('0x4'));var rimraf=require(_0xd1b6('0x5'));var config=require(_0xd1b6('0x6'));var attributes=require(_0xd1b6('0x7'));module['exports']=function(_0x206666,_0x4c053c){return _0x206666['define'](_0xd1b6('0x8'),attributes,{'tableName':_0xd1b6('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index e7e9754..242d8ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ce=['code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x37b9ce,_0x532657){var _0x3647cc=function(_0x102026){while(--_0x102026){_0x37b9ce['push'](_0x37b9ce['shift']());}};_0x3647cc(++_0x532657);}(_0x80ce,0xae));var _0xe80c=function(_0x44a86b,_0x1a16d6){_0x44a86b=_0x44a86b-0x0;var _0x31e122=_0x80ce[_0x44a86b];return _0x31e122;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe80c('0x0'));var rs=require(_0xe80c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe80c('0x2'))['db'];var utils=require(_0xe80c('0x3'));var logger=require(_0xe80c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe80c('0x5')][_0xe80c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x320a7e,_0x704aa3,_0x591a4a){return new BPromise(function(_0x4da07c,_0x1fdd3b){return client[_0xe80c('0x7')](_0x320a7e,_0x591a4a)['then'](function(_0x104665){logger[_0xe80c('0x8')](_0xe80c('0x9'),_0x704aa3,_0xe80c('0xa'));logger[_0xe80c('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x704aa3,'request\x20sent',JSON['stringify'](_0x104665));if(_0x104665[_0xe80c('0xc')]){if(_0x104665[_0xe80c('0xc')][_0xe80c('0xd')]===0x1f4){logger[_0xe80c('0xc')](_0xe80c('0x9'),_0x704aa3,_0x104665[_0xe80c('0xc')][_0xe80c('0xe')]);return _0x1fdd3b(_0x104665[_0xe80c('0xc')][_0xe80c('0xe')]);}logger[_0xe80c('0xc')](_0xe80c('0x9'),_0x704aa3,_0x104665[_0xe80c('0xc')][_0xe80c('0xe')]);return _0x4da07c(_0x104665['error'][_0xe80c('0xe')]);}else{logger['info'](_0xe80c('0x9'),_0x704aa3,_0xe80c('0xa'));_0x4da07c(_0x104665[_0xe80c('0xf')]['message']);}})[_0xe80c('0x10')](function(_0x35d108){logger['error'](_0xe80c('0x9'),_0x704aa3,_0x35d108);_0x1fdd3b(_0x35d108);});});}
\ No newline at end of file
+var _0x746f=['client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x746f,0x9c));var _0xf746=function(_0x437cc3,_0x16c346){_0x437cc3=_0x437cc3-0x0;var _0x278342=_0x746f[_0x437cc3];return _0x278342;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var moment=require(_0xf746('0x2'));var BPromise=require(_0xf746('0x3'));var rs=require(_0xf746('0x4'));var fs=require('fs');var Redis=require(_0xf746('0x5'));var db=require(_0xf746('0x6'))['db'];var utils=require(_0xf746('0x7'));var logger=require(_0xf746('0x8'))(_0xf746('0x9'));var config=require(_0xf746('0xa'));var jayson=require(_0xf746('0xb'));var client=jayson[_0xf746('0xc')][_0xf746('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2edb61,_0x3fc620,_0x301d4d){return new BPromise(function(_0x11cbaa,_0x37a0f5){return client[_0xf746('0xe')](_0x2edb61,_0x301d4d)[_0xf746('0xf')](function(_0x232864){logger[_0xf746('0x10')](_0xf746('0x11'),_0x3fc620,_0xf746('0x12'));logger['debug'](_0xf746('0x13'),_0x3fc620,_0xf746('0x12'),JSON[_0xf746('0x14')](_0x232864));if(_0x232864['error']){if(_0x232864[_0xf746('0x15')]['code']===0x1f4){logger[_0xf746('0x15')](_0xf746('0x11'),_0x3fc620,_0x232864[_0xf746('0x15')][_0xf746('0x16')]);return _0x37a0f5(_0x232864[_0xf746('0x15')][_0xf746('0x16')]);}logger['error'](_0xf746('0x11'),_0x3fc620,_0x232864[_0xf746('0x15')][_0xf746('0x16')]);return _0x11cbaa(_0x232864['error'][_0xf746('0x16')]);}else{logger[_0xf746('0x10')](_0xf746('0x11'),_0x3fc620,_0xf746('0x12'));_0x11cbaa(_0x232864[_0xf746('0x17')][_0xf746('0x16')]);}})['catch'](function(_0x313a59){logger['error'](_0xf746('0x11'),_0x3fc620,_0x313a59);_0x37a0f5(_0x313a59);});});}
\ No newline at end of file
index 60fc508..0e16a62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacee=['post','single','file','create','put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now'];(function(_0x40d40e,_0x23b1bb){var _0x1f4698=function(_0x25fbf0){while(--_0x25fbf0){_0x40d40e['push'](_0x40d40e['shift']());}};_0x1f4698(++_0x23b1bb);}(_0xacee,0x129));var _0xeace=function(_0x4710d4,_0x2aa7c){_0x4710d4=_0x4710d4-0x0;var _0x499d1c=_0xacee[_0x4710d4];return _0x499d1c;};'use strict';var multer=require('multer');var util=require(_0xeace('0x0'));var path=require(_0xeace('0x1'));var timeout=require(_0xeace('0x2'));var express=require(_0xeace('0x3'));var router=express[_0xeace('0x4')]();var fs_extra=require(_0xeace('0x5'));var auth=require(_0xeace('0x6'));var interaction=require(_0xeace('0x7'));var config=require(_0xeace('0x8'));var controller=require(_0xeace('0x9'));router[_0xeace('0xa')]('/',auth[_0xeace('0xb')](),controller[_0xeace('0xc')]);router[_0xeace('0xa')]('/:id',auth[_0xeace('0xb')](),controller[_0xeace('0xd')]);router[_0xeace('0xa')](_0xeace('0xe'),auth[_0xeace('0xb')](),controller[_0xeace('0xf')]);var upload=multer({'storage':multer[_0xeace('0x10')]({'destination':function(_0x449bac,_0x515fb2,_0x36f4c4){_0x36f4c4(null,path[_0xeace('0x11')](config[_0xeace('0x12')],_0xeace('0x13')));},'filename':function(_0x3beec3,_0x3c12ab,_0x23a8f){_0x3c12ab[_0xeace('0x14')]=_0x3c12ab[_0xeace('0x14')][_0xeace('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23a8f(null,util[_0xeace('0x16')](_0xeace('0x17'),path[_0xeace('0x18')](_0x3c12ab['originalname'],path[_0xeace('0x19')](_0x3c12ab['originalname'])),Date[_0xeace('0x1a')](),path[_0xeace('0x19')](_0x3c12ab[_0xeace('0x14')])));}})});router[_0xeace('0x1b')]('/',upload[_0xeace('0x1c')](_0xeace('0x1d')),controller[_0xeace('0x1e')]);router[_0xeace('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xeace('0x20')]);router[_0xeace('0x21')](_0xeace('0x22'),auth['isAuthenticated'](),controller[_0xeace('0x21')]);module[_0xeace('0x23')]=router;
\ No newline at end of file
+var _0x0e2a=['show','/:id/download','diskStorage','root','originalname','format','%s-%s%s','extname','now','post','file','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x2bc632,_0x3c52ea){var _0x26f231=function(_0x5ca3a0){while(--_0x5ca3a0){_0x2bc632['push'](_0x2bc632['shift']());}};_0x26f231(++_0x3c52ea);}(_0x0e2a,0xb7));var _0xa0e2=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0x0e2a[_0x21d36e];return _0x4cc307;};'use strict';var multer=require(_0xa0e2('0x0'));var util=require('util');var path=require(_0xa0e2('0x1'));var timeout=require(_0xa0e2('0x2'));var express=require(_0xa0e2('0x3'));var router=express[_0xa0e2('0x4')]();var fs_extra=require(_0xa0e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa0e2('0x6'));var config=require(_0xa0e2('0x7'));var controller=require(_0xa0e2('0x8'));router[_0xa0e2('0x9')]('/',auth[_0xa0e2('0xa')](),controller[_0xa0e2('0xb')]);router[_0xa0e2('0x9')](_0xa0e2('0xc'),auth[_0xa0e2('0xa')](),controller[_0xa0e2('0xd')]);router[_0xa0e2('0x9')](_0xa0e2('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xa0e2('0xf')]({'destination':function(_0x5de839,_0x3c1ca9,_0x4d5e6b){_0x4d5e6b(null,path['join'](config[_0xa0e2('0x10')],'server/files/sounds/original/'));},'filename':function(_0x280e94,_0x2e43e9,_0x51ce78){_0x2e43e9[_0xa0e2('0x11')]=_0x2e43e9[_0xa0e2('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x51ce78(null,util[_0xa0e2('0x12')](_0xa0e2('0x13'),path['basename'](_0x2e43e9['originalname'],path[_0xa0e2('0x14')](_0x2e43e9[_0xa0e2('0x11')])),Date[_0xa0e2('0x15')](),path[_0xa0e2('0x14')](_0x2e43e9['originalname'])));}})});router[_0xa0e2('0x16')]('/',upload['single'](_0xa0e2('0x17')),controller[_0xa0e2('0x18')]);router[_0xa0e2('0x19')](_0xa0e2('0xc'),auth[_0xa0e2('0xa')](),controller['update']);router[_0xa0e2('0x1a')]('/:id',auth[_0xa0e2('0xa')](),controller[_0xa0e2('0x1a')]);module[_0xa0e2('0x1b')]=router;
\ No newline at end of file
index c27a060..8982714 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8b8=['name','STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8b8,0x75));var _0x8a8b=function(_0x13c63a,_0x17fc69){_0x13c63a=_0x13c63a-0x0;var _0x20ac56=_0xa8b8[_0x13c63a];return _0x20ac56;};'use strict';var Sequelize=require(_0x8a8b('0x0'));module[_0x8a8b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8a8b('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8a8b('0x3')]},'display_name':{'type':Sequelize[_0x8a8b('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x8a8b('0x3')]},'original_format':{'type':Sequelize[_0x8a8b('0x3')]},'original_duration':{'type':Sequelize[_0x8a8b('0x4')]},'original_sampleCount':{'type':Sequelize[_0x8a8b('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x8a8b('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x8a8b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x8a8b('0x5')]},'converted_channelCount':{'type':Sequelize[_0x8a8b('0x6')]},'converted_bitRate':{'type':Sequelize[_0x8a8b('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x8a8b('0x6')]}};
\ No newline at end of file
+var _0x9705=['BIGINT','INTEGER','sequelize','STRING','FLOAT'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x9705,0x1dd));var _0x5970=function(_0x8973ee,_0x132469){_0x8973ee=_0x8973ee-0x0;var _0x555438=_0x9705[_0x8973ee];return _0x555438;};'use strict';var Sequelize=require(_0x5970('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x5970('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x5970('0x1')]},'original_format':{'type':Sequelize[_0x5970('0x1')]},'original_duration':{'type':Sequelize[_0x5970('0x2')]},'original_sampleCount':{'type':Sequelize[_0x5970('0x3')]},'original_channelCount':{'type':Sequelize[_0x5970('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x5970('0x4')]},'converted_format':{'type':Sequelize[_0x5970('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x5970('0x3')]},'converted_channelCount':{'type':Sequelize[_0x5970('0x4')]},'converted_bitRate':{'type':Sequelize[_0x5970('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 44d3da8..06e6231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b75=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','Sounds','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','keys','length','find','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','catch','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','start','description','delete','original_format'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x2b75,0x1ec));var _0x52b7=function(_0x11bc9e,_0x251d62){_0x11bc9e=_0x11bc9e-0x0;var _0x226e2b=_0x2b75[_0x11bc9e];return _0x226e2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52b7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x52b7('0x1'));var rp=require(_0x52b7('0x2'));var moment=require(_0x52b7('0x3'));var BPromise=require(_0x52b7('0x4'));var Mustache=require('mustache');var util=require(_0x52b7('0x5'));var path=require('path');var sox=require(_0x52b7('0x6'));var csv=require(_0x52b7('0x7'));var ejs=require(_0x52b7('0x8'));var fs=require('fs');var fs_extra=require(_0x52b7('0x9'));var _=require(_0x52b7('0xa'));var squel=require(_0x52b7('0xb'));var crypto=require('crypto');var jsforce=require(_0x52b7('0xc'));var deskjs=require(_0x52b7('0xd'));var toCsv=require(_0x52b7('0x7'));var querystring=require(_0x52b7('0xe'));var Papa=require(_0x52b7('0xf'));var Redis=require(_0x52b7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x52b7('0x11'));var as=require(_0x52b7('0x12'));var hardwareService=require(_0x52b7('0x13'));var logger=require(_0x52b7('0x14'))('api');var utils=require(_0x52b7('0x15'));var config=require(_0x52b7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x52b7('0x17'))['db'];function respondWithStatusCode(_0x3be467,_0x13bf44){_0x13bf44=_0x13bf44||0xcc;return function(_0x328c9f){if(_0x328c9f){return _0x3be467[_0x52b7('0x18')](_0x13bf44);}return _0x3be467[_0x52b7('0x19')](_0x13bf44)[_0x52b7('0x1a')]();};}function respondWithResult(_0x5d06f9,_0x177038){_0x177038=_0x177038||0xc8;return function(_0x51bae0){if(_0x51bae0){return _0x5d06f9[_0x52b7('0x19')](_0x177038)[_0x52b7('0x1b')](_0x51bae0);}};}function respondWithFilteredResult(_0x1a98e2,_0x262529){return function(_0x5f572f){if(_0x5f572f){var _0xf233f0=typeof _0x262529['offset']===_0x52b7('0x1c')&&typeof _0x262529[_0x52b7('0x1d')]===_0x52b7('0x1c');var _0x2b9a05=_0x5f572f['count'];var _0x97898d=_0xf233f0?0x0:_0x262529['offset'];var _0x547b96=_0xf233f0?_0x5f572f[_0x52b7('0x1e')]:_0x262529[_0x52b7('0x1f')]+_0x262529[_0x52b7('0x1d')];var _0xab3545;if(_0x547b96>=_0x2b9a05){_0x547b96=_0x2b9a05;_0xab3545=0xc8;}else{_0xab3545=0xce;}_0x1a98e2[_0x52b7('0x19')](_0xab3545);return _0x1a98e2[_0x52b7('0x20')](_0x52b7('0x21'),_0x97898d+'-'+_0x547b96+'/'+_0x2b9a05)[_0x52b7('0x1b')](_0x5f572f);}return null;};}function patchUpdates(_0x25f167){return function(_0x1eda9a){try{jsonpatch['apply'](_0x1eda9a,_0x25f167,!![]);}catch(_0x120043){return BPromise[_0x52b7('0x22')](_0x120043);}return _0x1eda9a['save']();};}function saveUpdates(_0x2b2ef5,_0x1de907){return function(_0x778733){if(_0x778733){return _0x778733[_0x52b7('0x23')](_0x2b2ef5)[_0x52b7('0x24')](function(_0x32e3d0){return _0x32e3d0;});}return null;};}function removeEntity(_0xc5ce52,_0x1fcad5){return function(_0x403834){if(_0x403834){return _0x403834[_0x52b7('0x25')]()[_0x52b7('0x24')](function(){var _0x21d944=_0x403834[_0x52b7('0x26')]({'plain':!![]});var _0x5aae6e=_0x52b7('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5aae6e,'resourceId':_0x21d944['id']}})[_0x52b7('0x24')](function(){return _0x403834;});})[_0x52b7('0x24')](function(){_0xc5ce52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aca4d,_0x53312c){return function(_0x280ed5){if(!_0x280ed5){_0x3aca4d[_0x52b7('0x18')](0x194);}return _0x280ed5;};}function handleError(_0x11ce9a,_0x51ce39){_0x51ce39=_0x51ce39||0x1f4;return function(_0x5c2534){logger[_0x52b7('0x28')](_0x5c2534[_0x52b7('0x29')]);if(_0x5c2534[_0x52b7('0x2a')]){delete _0x5c2534[_0x52b7('0x2a')];}_0x11ce9a[_0x52b7('0x19')](_0x51ce39)[_0x52b7('0x2b')](_0x5c2534);};}exports[_0x52b7('0x2c')]=function(_0x4bfbf8,_0x208b3e){var _0x3e0900={},_0x3533b1={},_0x3d6414={'count':0x0,'rows':[]};var _0x5947fa=_[_0x52b7('0x2d')](db[_0x52b7('0x2e')][_0x52b7('0x2f')],function(_0x5b0ca4){return{'name':_0x5b0ca4[_0x52b7('0x30')],'type':_0x5b0ca4[_0x52b7('0x31')][_0x52b7('0x32')]};});_0x3533b1[_0x52b7('0x33')]=_['map'](_0x5947fa,_0x52b7('0x2a'));_0x3533b1[_0x52b7('0x34')]=_['keys'](_0x4bfbf8[_0x52b7('0x34')]);_0x3533b1['filters']=_[_0x52b7('0x35')](_0x3533b1[_0x52b7('0x33')],_0x3533b1[_0x52b7('0x34')]);_0x3e0900[_0x52b7('0x36')]=_[_0x52b7('0x35')](_0x3533b1[_0x52b7('0x33')],qs[_0x52b7('0x37')](_0x4bfbf8[_0x52b7('0x34')][_0x52b7('0x37')]));_0x3e0900[_0x52b7('0x36')]=_0x3e0900[_0x52b7('0x36')]['length']?_0x3e0900['attributes']:_0x3533b1[_0x52b7('0x33')];if(!_0x4bfbf8[_0x52b7('0x34')]['hasOwnProperty'](_0x52b7('0x38'))){_0x3e0900['limit']=qs[_0x52b7('0x1d')](_0x4bfbf8[_0x52b7('0x34')][_0x52b7('0x1d')]);_0x3e0900['offset']=qs['offset'](_0x4bfbf8[_0x52b7('0x34')][_0x52b7('0x1f')]);}_0x3e0900[_0x52b7('0x39')]=qs['sort'](_0x4bfbf8['query']['sort']);_0x3e0900[_0x52b7('0x3a')]=qs[_0x52b7('0x3b')](_[_0x52b7('0x3c')](_0x4bfbf8[_0x52b7('0x34')],_0x3533b1[_0x52b7('0x3b')]),_0x5947fa);if(_0x4bfbf8['query'][_0x52b7('0x3d')]){_0x3e0900[_0x52b7('0x3a')]=_[_0x52b7('0x3e')](_0x3e0900['where'],{'$or':_[_0x52b7('0x2d')](_0x5947fa,function(_0xa42e51){if(_0xa42e51[_0x52b7('0x31')]!==_0x52b7('0x3f')){var _0x5f0636={};_0x5f0636[_0xa42e51[_0x52b7('0x2a')]]={'$like':'%'+_0x4bfbf8[_0x52b7('0x34')][_0x52b7('0x3d')]+'%'};return _0x5f0636;}})});}_0x3e0900=_[_0x52b7('0x3e')]({},_0x3e0900,_0x4bfbf8[_0x52b7('0x40')]);var _0xfb3af6={'where':_0x3e0900[_0x52b7('0x3a')]};return db[_0x52b7('0x2e')][_0x52b7('0x1e')](_0xfb3af6)[_0x52b7('0x24')](function(_0x1943dc){_0x3d6414['count']=_0x1943dc;if(_0x4bfbf8[_0x52b7('0x34')][_0x52b7('0x41')]){_0x3e0900[_0x52b7('0x42')]=[{'all':!![]}];}return db[_0x52b7('0x2e')]['findAll'](_0x3e0900);})[_0x52b7('0x24')](function(_0x3958f1){_0x3d6414[_0x52b7('0x43')]=_0x3958f1;return _0x3d6414;})['then'](respondWithFilteredResult(_0x208b3e,_0x3e0900))['catch'](handleError(_0x208b3e,null));};exports['show']=function(_0x55ce39,_0x57cf82){var _0x25f869={'raw':!![],'where':{'id':_0x55ce39[_0x52b7('0x44')]['id']}},_0x45d467={};_0x45d467[_0x52b7('0x33')]=_[_0x52b7('0x45')](db[_0x52b7('0x2e')]['rawAttributes']);_0x45d467[_0x52b7('0x34')]=_['keys'](_0x55ce39[_0x52b7('0x34')]);_0x45d467[_0x52b7('0x3b')]=_[_0x52b7('0x35')](_0x45d467[_0x52b7('0x33')],_0x45d467['query']);_0x25f869['attributes']=_[_0x52b7('0x35')](_0x45d467[_0x52b7('0x33')],qs['fields'](_0x55ce39[_0x52b7('0x34')][_0x52b7('0x37')]));_0x25f869['attributes']=_0x25f869['attributes'][_0x52b7('0x46')]?_0x25f869[_0x52b7('0x36')]:_0x45d467[_0x52b7('0x33')];if(_0x55ce39[_0x52b7('0x34')]['includeAll']){_0x25f869[_0x52b7('0x42')]=[{'all':!![]}];}_0x25f869=_['merge']({},_0x25f869,_0x55ce39['options']);return db[_0x52b7('0x2e')][_0x52b7('0x47')](_0x25f869)[_0x52b7('0x24')](handleEntityNotFound(_0x57cf82,null))['then'](respondWithResult(_0x57cf82,null))['catch'](handleError(_0x57cf82,null));};exports[_0x52b7('0x48')]=function(_0x3c9795,_0x2a2ef9,_0x17c8ac){return db[_0x52b7('0x2e')]['find']({'where':{'id':_0x3c9795[_0x52b7('0x44')]['id']},'attributes':['name',_0x52b7('0x49'),_0x52b7('0x4a')],'raw':!![]})[_0x52b7('0x24')](handleEntityNotFound(_0x2a2ef9,null))[_0x52b7('0x24')](function(_0x5bc7ef){if(_0x5bc7ef){if(!fs[_0x52b7('0x4b')](path[_0x52b7('0x4c')](config[_0x52b7('0x4d')],'server/files/sounds/converted',_0x5bc7ef['save_name']+'.'+_0x5bc7ef[_0x52b7('0x4a')]))){throw new db[(_0x52b7('0x4e'))][(_0x52b7('0x4f'))](_0x52b7('0x50'));}return _0x2a2ef9['download'](path[_0x52b7('0x4c')](config[_0x52b7('0x4d')],_0x52b7('0x51'),util[_0x52b7('0x52')]('%s.%s',_0x5bc7ef[_0x52b7('0x49')],_0x5bc7ef[_0x52b7('0x4a')])),util[_0x52b7('0x52')](_0x52b7('0x53'),_0x5bc7ef[_0x52b7('0x2a')],_0x5bc7ef[_0x52b7('0x4a')]));}return null;})[_0x52b7('0x54')](handleError(_0x2a2ef9,null));};exports[_0x52b7('0x55')]=function(_0x1d5721,_0x47655f,_0x392dc7){var _0x347e98={'name':path[_0x52b7('0x56')](_0x1d5721[_0x52b7('0x57')][_0x52b7('0x58')],path[_0x52b7('0x59')](_0x1d5721[_0x52b7('0x57')][_0x52b7('0x58')])),'save_name':path[_0x52b7('0x56')](_0x1d5721['file'][_0x52b7('0x5a')],path['extname'](_0x1d5721[_0x52b7('0x57')][_0x52b7('0x5a')])),'original_format':path['extname'](_0x1d5721[_0x52b7('0x57')][_0x52b7('0x58')])['substring'](0x1),'converted_format':_0x52b7('0x5b')};var _0x5f26fd=path['join'](config[_0x52b7('0x4d')],_0x52b7('0x5c'),_0x1d5721[_0x52b7('0x57')][_0x52b7('0x5a')]);var _0x5e9ce0=path[_0x52b7('0x4c')](config[_0x52b7('0x4d')],_0x52b7('0x51'),util[_0x52b7('0x52')](_0x52b7('0x53'),path[_0x52b7('0x56')](_0x1d5721[_0x52b7('0x57')][_0x52b7('0x5a')],path['extname'](_0x1d5721[_0x52b7('0x57')]['filename'])),_0x347e98[_0x52b7('0x4a')]));logger[_0x52b7('0x5d')](_0x52b7('0x5e'),_0x5f26fd);logger[_0x52b7('0x5d')](_0x52b7('0x5f'),_0x5e9ce0);try{fs[_0x52b7('0x60')](_0x5f26fd,parseInt(_0x52b7('0x61'),0x8));var _0x1a148a=sox['transcode'](_0x5f26fd,_0x5e9ce0,{'sampleRate':0x1f40,'format':_0x52b7('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1a148a['on']('error',function(_0x4fbeb1){fs[_0x52b7('0x62')](_0x5f26fd);_0x47655f[_0x52b7('0x19')](0x1f4)[_0x52b7('0x2b')](_0x4fbeb1);});_0x1a148a['on'](_0x52b7('0x63'),function(_0x5d4c12){_0x347e98[_0x52b7('0x64')]=isNaN(_0x5d4c12[_0x52b7('0x65')])?null:_0x5d4c12[_0x52b7('0x65')]*0x3e8;_0x347e98[_0x52b7('0x66')]=isNaN(_0x5d4c12[_0x52b7('0x67')])?null:_0x5d4c12[_0x52b7('0x67')];_0x347e98[_0x52b7('0x68')]=isNaN(_0x5d4c12[_0x52b7('0x69')])?null:_0x5d4c12['channelCount'];_0x347e98['original_bitRate']=isNaN(_0x5d4c12[_0x52b7('0x6a')])?null:_0x5d4c12[_0x52b7('0x6a')];_0x347e98[_0x52b7('0x6b')]=isNaN(_0x5d4c12[_0x52b7('0x6c')])?null:_0x5d4c12[_0x52b7('0x6c')];});_0x1a148a['on'](_0x52b7('0x6d'),function(_0x227fd1){_0x347e98[_0x52b7('0x6e')]=isNaN(_0x227fd1[_0x52b7('0x65')])?null:_0x227fd1[_0x52b7('0x65')]*0x3e8;_0x347e98[_0x52b7('0x6f')]=isNaN(_0x227fd1[_0x52b7('0x67')])?null:_0x227fd1[_0x52b7('0x67')];_0x347e98[_0x52b7('0x70')]=isNaN(_0x227fd1[_0x52b7('0x69')])?null:_0x227fd1['channelCount'];_0x347e98['converted_bitRate']=isNaN(_0x227fd1[_0x52b7('0x6a')])?null:_0x227fd1[_0x52b7('0x6a')];_0x347e98[_0x52b7('0x71')]=isNaN(_0x227fd1[_0x52b7('0x6c')])?null:_0x227fd1[_0x52b7('0x6c')];});_0x1a148a['on']('end',function(){fs[_0x52b7('0x60')](_0x5e9ce0,parseInt(_0x52b7('0x61'),0x8));return db['Sound'][_0x52b7('0x55')](_0x347e98)['then'](function(_0x5aea20){var _0x1ce816={'role':_0x1d5721[_0x52b7('0x72')][_0x52b7('0x73')],'userProfileId':_0x1d5721['body']['userProfileId']};if(!_0x1ce816)throw new Error(_0x52b7('0x74'));if(_0x1ce816[_0x52b7('0x73')]===_0x52b7('0x75')){var _0x484211=_0x5aea20[_0x52b7('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x52b7('0x47')]({'where':{'name':_0x52b7('0x27'),'userProfileId':_0x1ce816[_0x52b7('0x76')]},'raw':!![]})[_0x52b7('0x24')](function(_0xa31276){if(_0xa31276&&_0xa31276['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x484211['name'],'resourceId':_0x484211['id'],'type':_0xa31276[_0x52b7('0x2a')],'sectionId':_0xa31276['id']},{})[_0x52b7('0x24')](function(){return _0x5aea20;});}else{return _0x5aea20;}})[_0x52b7('0x54')](function(_0x35bda2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35bda2);throw _0x35bda2;});}return _0x5aea20;})['then'](respondWithResult(_0x47655f,null))['catch'](handleError(_0x47655f,null));});_0x1a148a[_0x52b7('0x77')]();}catch(_0x56e619){_0x47655f[_0x52b7('0x19')](0x1f4)[_0x52b7('0x2b')](_0x56e619);}};exports['update']=function(_0x1ffb8e,_0x171228,_0x4376d5){return db[_0x52b7('0x2e')]['find']({'where':{'id':_0x1ffb8e[_0x52b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x171228,null))['then'](saveUpdates(_[_0x52b7('0x3c')](_0x1ffb8e['body'],[_0x52b7('0x2a'),_0x52b7('0x78')]),null))['then'](respondWithResult(_0x171228,null))[_0x52b7('0x54')](handleError(_0x171228,null));};exports[_0x52b7('0x79')]=function(_0x55c6cb,_0x48c9bd,_0x4810d4){return db['Sound'][_0x52b7('0x47')]({'where':{'id':_0x55c6cb[_0x52b7('0x44')]['id']}})[_0x52b7('0x24')](function(_0x4e41b7){if(_0x4e41b7){return _0x4e41b7[_0x52b7('0x25')]();}})[_0x52b7('0x24')](function(_0x208f66){var _0x1af8f5=path['join'](config['root'],_0x52b7('0x5c'),util['format']('%s.%s',_0x208f66[_0x52b7('0x49')],_0x208f66[_0x52b7('0x7a')]));var _0x4f2acd=path['join'](config['root'],'server/files/sounds/converted',util[_0x52b7('0x52')]('%s.%s',_0x208f66[_0x52b7('0x49')],_0x208f66[_0x52b7('0x4a')]));fs[_0x52b7('0x62')](_0x1af8f5);fs[_0x52b7('0x62')](_0x4f2acd);return _0x208f66;})[_0x52b7('0x24')](function(_0x4f7952){if(_0x4f7952){return _0x48c9bd['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x48c9bd,null))['catch'](handleError(_0x48c9bd,null));};
\ No newline at end of file
+var _0xf21f=['save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','converted_format','create','basename','originalname','file','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Sounds','UserProfileResource','end','error','stack','name','send','index','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','Sound','includeAll','include','findAll','catch','params','rawAttributes','options','find','existsSync','join','root','server/files/sounds/converted'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0xf21f,0xa7));var _0xff21=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0xf21f[_0x486f1d];return _0x5a2c2d;};'use strict';var emlformat=require(_0xff21('0x0'));var rimraf=require(_0xff21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff21('0x2'));var rp=require(_0xff21('0x3'));var moment=require(_0xff21('0x4'));var BPromise=require(_0xff21('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xff21('0x6'));var sox=require('sox');var csv=require(_0xff21('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff21('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff21('0x9'));var jsforce=require(_0xff21('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xff21('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xff21('0xb'));var authService=require(_0xff21('0xc'));var qs=require(_0xff21('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff21('0xe'));var logger=require(_0xff21('0xf'))('api');var utils=require(_0xff21('0x10'));var config=require(_0xff21('0x11'));var licenseUtil=require(_0xff21('0x12'));var db=require(_0xff21('0x13'))['db'];function respondWithStatusCode(_0x5e2798,_0x52df47){_0x52df47=_0x52df47||0xcc;return function(_0x325bf0){if(_0x325bf0){return _0x5e2798[_0xff21('0x14')](_0x52df47);}return _0x5e2798[_0xff21('0x15')](_0x52df47)['end']();};}function respondWithResult(_0x547f02,_0x4c7e85){_0x4c7e85=_0x4c7e85||0xc8;return function(_0x3c39db){if(_0x3c39db){return _0x547f02[_0xff21('0x15')](_0x4c7e85)[_0xff21('0x16')](_0x3c39db);}};}function respondWithFilteredResult(_0x4b85b4,_0x660eda){return function(_0x24f7a2){if(_0x24f7a2){var _0x11525f=typeof _0x660eda[_0xff21('0x17')]==='undefined'&&typeof _0x660eda[_0xff21('0x18')]===_0xff21('0x19');var _0xd028b0=_0x24f7a2[_0xff21('0x1a')];var _0x35182e=_0x11525f?0x0:_0x660eda[_0xff21('0x17')];var _0x46e523=_0x11525f?_0x24f7a2[_0xff21('0x1a')]:_0x660eda[_0xff21('0x17')]+_0x660eda[_0xff21('0x18')];var _0x4b556a;if(_0x46e523>=_0xd028b0){_0x46e523=_0xd028b0;_0x4b556a=0xc8;}else{_0x4b556a=0xce;}_0x4b85b4[_0xff21('0x15')](_0x4b556a);return _0x4b85b4[_0xff21('0x1b')](_0xff21('0x1c'),_0x35182e+'-'+_0x46e523+'/'+_0xd028b0)['json'](_0x24f7a2);}return null;};}function patchUpdates(_0x1e4fd9){return function(_0x32ac16){try{jsonpatch[_0xff21('0x1d')](_0x32ac16,_0x1e4fd9,!![]);}catch(_0xd17b90){return BPromise[_0xff21('0x1e')](_0xd17b90);}return _0x32ac16[_0xff21('0x1f')]();};}function saveUpdates(_0xe2d7ef,_0x16cc8e){return function(_0x1131b3){if(_0x1131b3){return _0x1131b3[_0xff21('0x20')](_0xe2d7ef)[_0xff21('0x21')](function(_0x12e412){return _0x12e412;});}return null;};}function removeEntity(_0x14aa96,_0x36bb35){return function(_0x584dbf){if(_0x584dbf){return _0x584dbf['destroy']()[_0xff21('0x21')](function(){var _0x6f47a2=_0x584dbf[_0xff21('0x22')]({'plain':!![]});var _0x84ca2b=_0xff21('0x23');return db[_0xff21('0x24')]['destroy']({'where':{'type':_0x84ca2b,'resourceId':_0x6f47a2['id']}})[_0xff21('0x21')](function(){return _0x584dbf;});})[_0xff21('0x21')](function(){_0x14aa96[_0xff21('0x15')](0xcc)[_0xff21('0x25')]();});}};}function handleEntityNotFound(_0x2c72ac,_0x4aee7e){return function(_0x1c31ac){if(!_0x1c31ac){_0x2c72ac[_0xff21('0x14')](0x194);}return _0x1c31ac;};}function handleError(_0x37789a,_0x132b1b){_0x132b1b=_0x132b1b||0x1f4;return function(_0xdb8d47){logger[_0xff21('0x26')](_0xdb8d47[_0xff21('0x27')]);if(_0xdb8d47[_0xff21('0x28')]){delete _0xdb8d47[_0xff21('0x28')];}_0x37789a['status'](_0x132b1b)[_0xff21('0x29')](_0xdb8d47);};}exports[_0xff21('0x2a')]=function(_0x53450d,_0x1d9211){var _0x721d9a={},_0x359239={},_0x1f4275={'count':0x0,'rows':[]};var _0x55d6df=_['map'](db['Sound']['rawAttributes'],function(_0x8c14b1){return{'name':_0x8c14b1['fieldName'],'type':_0x8c14b1[_0xff21('0x2b')]['key']};});_0x359239[_0xff21('0x2c')]=_[_0xff21('0x2d')](_0x55d6df,_0xff21('0x28'));_0x359239[_0xff21('0x2e')]=_[_0xff21('0x2f')](_0x53450d[_0xff21('0x2e')]);_0x359239[_0xff21('0x30')]=_[_0xff21('0x31')](_0x359239['model'],_0x359239[_0xff21('0x2e')]);_0x721d9a[_0xff21('0x32')]=_[_0xff21('0x31')](_0x359239['model'],qs['fields'](_0x53450d[_0xff21('0x2e')][_0xff21('0x33')]));_0x721d9a['attributes']=_0x721d9a[_0xff21('0x32')][_0xff21('0x34')]?_0x721d9a[_0xff21('0x32')]:_0x359239[_0xff21('0x2c')];if(!_0x53450d['query'][_0xff21('0x35')](_0xff21('0x36'))){_0x721d9a[_0xff21('0x18')]=qs[_0xff21('0x18')](_0x53450d[_0xff21('0x2e')][_0xff21('0x18')]);_0x721d9a[_0xff21('0x17')]=qs[_0xff21('0x17')](_0x53450d[_0xff21('0x2e')][_0xff21('0x17')]);}_0x721d9a[_0xff21('0x37')]=qs[_0xff21('0x38')](_0x53450d[_0xff21('0x2e')]['sort']);_0x721d9a[_0xff21('0x39')]=qs[_0xff21('0x30')](_['pick'](_0x53450d['query'],_0x359239[_0xff21('0x30')]),_0x55d6df);if(_0x53450d[_0xff21('0x2e')]['filter']){_0x721d9a[_0xff21('0x39')]=_[_0xff21('0x3a')](_0x721d9a[_0xff21('0x39')],{'$or':_[_0xff21('0x2d')](_0x55d6df,function(_0x23021f){if(_0x23021f[_0xff21('0x2b')]!==_0xff21('0x3b')){var _0x2ba535={};_0x2ba535[_0x23021f['name']]={'$like':'%'+_0x53450d[_0xff21('0x2e')]['filter']+'%'};return _0x2ba535;}})});}_0x721d9a=_[_0xff21('0x3a')]({},_0x721d9a,_0x53450d['options']);var _0x51f50b={'where':_0x721d9a['where']};return db[_0xff21('0x3c')][_0xff21('0x1a')](_0x51f50b)[_0xff21('0x21')](function(_0x15143e){_0x1f4275[_0xff21('0x1a')]=_0x15143e;if(_0x53450d['query'][_0xff21('0x3d')]){_0x721d9a[_0xff21('0x3e')]=[{'all':!![]}];}return db[_0xff21('0x3c')][_0xff21('0x3f')](_0x721d9a);})[_0xff21('0x21')](function(_0x1f6792){_0x1f4275['rows']=_0x1f6792;return _0x1f4275;})[_0xff21('0x21')](respondWithFilteredResult(_0x1d9211,_0x721d9a))[_0xff21('0x40')](handleError(_0x1d9211,null));};exports['show']=function(_0x10ec6b,_0x35e7bf){var _0x4e9039={'raw':!![],'where':{'id':_0x10ec6b[_0xff21('0x41')]['id']}},_0x4ec238={};_0x4ec238[_0xff21('0x2c')]=_[_0xff21('0x2f')](db['Sound'][_0xff21('0x42')]);_0x4ec238[_0xff21('0x2e')]=_['keys'](_0x10ec6b[_0xff21('0x2e')]);_0x4ec238[_0xff21('0x30')]=_[_0xff21('0x31')](_0x4ec238[_0xff21('0x2c')],_0x4ec238[_0xff21('0x2e')]);_0x4e9039[_0xff21('0x32')]=_[_0xff21('0x31')](_0x4ec238[_0xff21('0x2c')],qs['fields'](_0x10ec6b[_0xff21('0x2e')][_0xff21('0x33')]));_0x4e9039[_0xff21('0x32')]=_0x4e9039[_0xff21('0x32')][_0xff21('0x34')]?_0x4e9039[_0xff21('0x32')]:_0x4ec238['model'];if(_0x10ec6b[_0xff21('0x2e')]['includeAll']){_0x4e9039[_0xff21('0x3e')]=[{'all':!![]}];}_0x4e9039=_['merge']({},_0x4e9039,_0x10ec6b[_0xff21('0x43')]);return db['Sound'][_0xff21('0x44')](_0x4e9039)[_0xff21('0x21')](handleEntityNotFound(_0x35e7bf,null))[_0xff21('0x21')](respondWithResult(_0x35e7bf,null))[_0xff21('0x40')](handleError(_0x35e7bf,null));};exports['download']=function(_0x3bec9f,_0x411aa3,_0x172cb0){return db[_0xff21('0x3c')][_0xff21('0x44')]({'where':{'id':_0x3bec9f[_0xff21('0x41')]['id']},'attributes':[_0xff21('0x28'),'save_name','converted_format'],'raw':!![]})[_0xff21('0x21')](handleEntityNotFound(_0x411aa3,null))[_0xff21('0x21')](function(_0x5a0696){if(_0x5a0696){if(!fs[_0xff21('0x45')](path[_0xff21('0x46')](config[_0xff21('0x47')],_0xff21('0x48'),_0x5a0696[_0xff21('0x49')]+'.'+_0x5a0696['converted_format']))){throw new db[(_0xff21('0x4a'))]['ValidationError'](_0xff21('0x4b'));}return _0x411aa3['download'](path[_0xff21('0x46')](config[_0xff21('0x47')],_0xff21('0x48'),util[_0xff21('0x4c')](_0xff21('0x4d'),_0x5a0696[_0xff21('0x49')],_0x5a0696[_0xff21('0x4e')])),util[_0xff21('0x4c')](_0xff21('0x4d'),_0x5a0696['name'],_0x5a0696[_0xff21('0x4e')]));}return null;})[_0xff21('0x40')](handleError(_0x411aa3,null));};exports[_0xff21('0x4f')]=function(_0x382204,_0xac21f2,_0x40f0fd){var _0x4a2966={'name':path[_0xff21('0x50')](_0x382204['file'][_0xff21('0x51')],path['extname'](_0x382204[_0xff21('0x52')][_0xff21('0x51')])),'save_name':path['basename'](_0x382204[_0xff21('0x52')][_0xff21('0x53')],path[_0xff21('0x54')](_0x382204[_0xff21('0x52')][_0xff21('0x53')])),'original_format':path[_0xff21('0x54')](_0x382204['file']['originalname'])[_0xff21('0x55')](0x1),'converted_format':_0xff21('0x56')};var _0x5d6a9d=path[_0xff21('0x46')](config[_0xff21('0x47')],_0xff21('0x57'),_0x382204[_0xff21('0x52')][_0xff21('0x53')]);var _0xd05016=path[_0xff21('0x46')](config[_0xff21('0x47')],_0xff21('0x48'),util['format'](_0xff21('0x4d'),path[_0xff21('0x50')](_0x382204[_0xff21('0x52')][_0xff21('0x53')],path['extname'](_0x382204[_0xff21('0x52')][_0xff21('0x53')])),_0x4a2966[_0xff21('0x4e')]));logger[_0xff21('0x58')](_0xff21('0x59'),_0x5d6a9d);logger['info'](_0xff21('0x5a'),_0xd05016);try{fs['chmodSync'](_0x5d6a9d,parseInt('0777',0x8));var _0x4dedde=sox[_0xff21('0x5b')](_0x5d6a9d,_0xd05016,{'sampleRate':0x1f40,'format':_0xff21('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4dedde['on'](_0xff21('0x26'),function(_0x4ffd70){fs[_0xff21('0x5c')](_0x5d6a9d);_0xac21f2['status'](0x1f4)[_0xff21('0x29')](_0x4ffd70);});_0x4dedde['on'](_0xff21('0x5d'),function(_0x1ae7d7){_0x4a2966[_0xff21('0x5e')]=isNaN(_0x1ae7d7[_0xff21('0x5f')])?null:_0x1ae7d7[_0xff21('0x5f')]*0x3e8;_0x4a2966[_0xff21('0x60')]=isNaN(_0x1ae7d7['sampleCount'])?null:_0x1ae7d7['sampleCount'];_0x4a2966['original_channelCount']=isNaN(_0x1ae7d7[_0xff21('0x61')])?null:_0x1ae7d7['channelCount'];_0x4a2966[_0xff21('0x62')]=isNaN(_0x1ae7d7[_0xff21('0x63')])?null:_0x1ae7d7[_0xff21('0x63')];_0x4a2966[_0xff21('0x64')]=isNaN(_0x1ae7d7[_0xff21('0x65')])?null:_0x1ae7d7[_0xff21('0x65')];});_0x4dedde['on'](_0xff21('0x66'),function(_0x1572af){_0x4a2966['converted_duration']=isNaN(_0x1572af[_0xff21('0x5f')])?null:_0x1572af['duration']*0x3e8;_0x4a2966[_0xff21('0x67')]=isNaN(_0x1572af[_0xff21('0x68')])?null:_0x1572af['sampleCount'];_0x4a2966[_0xff21('0x69')]=isNaN(_0x1572af[_0xff21('0x61')])?null:_0x1572af[_0xff21('0x61')];_0x4a2966[_0xff21('0x6a')]=isNaN(_0x1572af[_0xff21('0x63')])?null:_0x1572af['bitRate'];_0x4a2966[_0xff21('0x6b')]=isNaN(_0x1572af[_0xff21('0x65')])?null:_0x1572af['sampleRate'];});_0x4dedde['on'](_0xff21('0x25'),function(){fs[_0xff21('0x6c')](_0xd05016,parseInt(_0xff21('0x6d'),0x8));return db[_0xff21('0x3c')][_0xff21('0x4f')](_0x4a2966)[_0xff21('0x21')](function(_0x52caf0){var _0x58ab3f={'role':_0x382204['body']['role'],'userProfileId':_0x382204[_0xff21('0x6e')][_0xff21('0x6f')]};if(!_0x58ab3f)throw new Error(_0xff21('0x70'));if(_0x58ab3f[_0xff21('0x71')]===_0xff21('0x72')){var _0x1586d9=_0x52caf0[_0xff21('0x22')]({'plain':!![]});return db['UserProfileSection'][_0xff21('0x44')]({'where':{'name':_0xff21('0x23'),'userProfileId':_0x58ab3f[_0xff21('0x6f')]},'raw':!![]})['then'](function(_0x5b9967){if(_0x5b9967&&_0x5b9967['autoAssociation']===0x0){return db[_0xff21('0x24')]['create']({'name':_0x1586d9[_0xff21('0x28')],'resourceId':_0x1586d9['id'],'type':_0x5b9967[_0xff21('0x28')],'sectionId':_0x5b9967['id']},{})[_0xff21('0x21')](function(){return _0x52caf0;});}else{return _0x52caf0;}})['catch'](function(_0x26c182){logger[_0xff21('0x26')](_0xff21('0x73'),_0x26c182);throw _0x26c182;});}return _0x52caf0;})[_0xff21('0x21')](respondWithResult(_0xac21f2,null))[_0xff21('0x40')](handleError(_0xac21f2,null));});_0x4dedde[_0xff21('0x74')]();}catch(_0x2a746e){_0xac21f2[_0xff21('0x15')](0x1f4)[_0xff21('0x29')](_0x2a746e);}};exports[_0xff21('0x20')]=function(_0x2b226b,_0x46356c,_0x2bb02a){return db['Sound'][_0xff21('0x44')]({'where':{'id':_0x2b226b['params']['id']}})[_0xff21('0x21')](handleEntityNotFound(_0x46356c,null))[_0xff21('0x21')](saveUpdates(_[_0xff21('0x75')](_0x2b226b[_0xff21('0x6e')],[_0xff21('0x28'),_0xff21('0x76')]),null))[_0xff21('0x21')](respondWithResult(_0x46356c,null))['catch'](handleError(_0x46356c,null));};exports['delete']=function(_0x2dc825,_0x49fbca,_0x271cb3){return db[_0xff21('0x3c')][_0xff21('0x44')]({'where':{'id':_0x2dc825['params']['id']}})[_0xff21('0x21')](function(_0x5239aa){if(_0x5239aa){return _0x5239aa['destroy']();}})[_0xff21('0x21')](function(_0x3949d1){var _0x57ad90=path[_0xff21('0x46')](config[_0xff21('0x47')],_0xff21('0x57'),util[_0xff21('0x4c')](_0xff21('0x4d'),_0x3949d1[_0xff21('0x49')],_0x3949d1[_0xff21('0x77')]));var _0x23e23e=path[_0xff21('0x46')](config[_0xff21('0x47')],_0xff21('0x48'),util[_0xff21('0x4c')]('%s.%s',_0x3949d1[_0xff21('0x49')],_0x3949d1['converted_format']));fs[_0xff21('0x5c')](_0x57ad90);fs[_0xff21('0x5c')](_0x23e23e);return _0x3949d1;})[_0xff21('0x21')](function(_0x101dfd){if(_0x101dfd){return _0x49fbca[_0xff21('0x15')](0xcc)[_0xff21('0x25')]();}})[_0xff21('0x21')](handleEntityNotFound(_0x49fbca,null))[_0xff21('0x40')](handleError(_0x49fbca,null));};
\ No newline at end of file
index 7215068..16f42c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x777d=['api','moment','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util'];(function(_0xd6ab42,_0x4a76f8){var _0x445960=function(_0x16ca59){while(--_0x16ca59){_0xd6ab42['push'](_0xd6ab42['shift']());}};_0x445960(++_0x4a76f8);}(_0x777d,0xa3));var _0xd777=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x777d[_0x349148];return _0x2f2b0f;};'use strict';var _=require(_0xd777('0x0'));var util=require(_0xd777('0x1'));var logger=require('../../config/logger')(_0xd777('0x2'));var moment=require(_0xd777('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd777('0x4'));var config=require(_0xd777('0x5'));var attributes=require(_0xd777('0x6'));module[_0xd777('0x7')]=function(_0x52d754,_0x3a9812){return _0x52d754[_0xd777('0x8')](_0xd777('0x9'),attributes,{'tableName':_0xd777('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c6d=['bluebird','rimraf','../../config/environment','./sound.attributes','exports','define','lodash','api'];(function(_0x395866,_0x45b1f9){var _0x433d3b=function(_0x3111b3){while(--_0x3111b3){_0x395866['push'](_0x395866['shift']());}};_0x433d3b(++_0x45b1f9);}(_0x1c6d,0xbe));var _0xd1c6=function(_0x22e690,_0x5f570e){_0x22e690=_0x22e690-0x0;var _0x2b515f=_0x1c6d[_0x22e690];return _0x2b515f;};'use strict';var _=require(_0xd1c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd1c6('0x1'));var moment=require('moment');var BPromise=require(_0xd1c6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd1c6('0x3'));var config=require(_0xd1c6('0x4'));var attributes=require(_0xd1c6('0x5'));module[_0xd1c6('0x6')]=function(_0x496c27,_0x4e4300){return _0x496c27[_0xd1c6('0x7')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 72cdec6..8fbcdbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6004=['model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','where','map','include'];(function(_0x2dd7fc,_0x42c03c){var _0x1eac5d=function(_0x48fe12){while(--_0x48fe12){_0x2dd7fc['push'](_0x2dd7fc['shift']());}};_0x1eac5d(++_0x42c03c);}(_0x6004,0x6b));var _0x4600=function(_0x2ecf17,_0x45b8db){_0x2ecf17=_0x2ecf17-0x0;var _0xd0ffde=_0x6004[_0x2ecf17];return _0xd0ffde;};'use strict';var _=require(_0x4600('0x0'));var util=require(_0x4600('0x1'));var moment=require(_0x4600('0x2'));var BPromise=require(_0x4600('0x3'));var rs=require(_0x4600('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4600('0x5'))['db'];var utils=require(_0x4600('0x6'));var logger=require(_0x4600('0x7'))('rpc');var config=require(_0x4600('0x8'));var jayson=require(_0x4600('0x9'));var client=jayson[_0x4600('0xa')][_0x4600('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c670e,_0x110f3d,_0x44f1c0){return new BPromise(function(_0x177a6c,_0x2e0318){return client[_0x4600('0xc')](_0x1c670e,_0x44f1c0)[_0x4600('0xd')](function(_0x387e77){logger['info'](_0x4600('0xe'),_0x110f3d,_0x4600('0xf'));logger[_0x4600('0x10')](_0x4600('0x11'),_0x110f3d,_0x4600('0xf'),JSON[_0x4600('0x12')](_0x387e77));if(_0x387e77['error']){if(_0x387e77[_0x4600('0x13')][_0x4600('0x14')]===0x1f4){logger[_0x4600('0x13')]('Sound,\x20%s,\x20%s',_0x110f3d,_0x387e77['error'][_0x4600('0x15')]);return _0x2e0318(_0x387e77['error'][_0x4600('0x15')]);}logger[_0x4600('0x13')]('Sound,\x20%s,\x20%s',_0x110f3d,_0x387e77['error'][_0x4600('0x15')]);return _0x177a6c(_0x387e77[_0x4600('0x13')][_0x4600('0x15')]);}else{logger[_0x4600('0x16')](_0x4600('0xe'),_0x110f3d,'request\x20sent');_0x177a6c(_0x387e77[_0x4600('0x17')]['message']);}})[_0x4600('0x18')](function(_0x150df0){logger['error'](_0x4600('0xe'),_0x110f3d,_0x150df0);_0x2e0318(_0x150df0);});});}exports[_0x4600('0x19')]=function(_0x3b26a5){var _0x4b229d=this;return new Promise(function(_0x66f6c4,_0x2224c6){return db[_0x4600('0x1a')][_0x4600('0x1b')]({'raw':_0x3b26a5['options']?_0x3b26a5[_0x4600('0x1c')][_0x4600('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b26a5['options']?_0x3b26a5[_0x4600('0x1c')][_0x4600('0x1e')]||null:null,'attributes':_0x3b26a5[_0x4600('0x1c')]?_0x3b26a5[_0x4600('0x1c')]['attributes']||null:null,'include':_0x3b26a5['options']?_0x3b26a5['options']['include']?_[_0x4600('0x1f')](_0x3b26a5['options'][_0x4600('0x20')],function(_0x3dee3f){return{'model':db[_0x3dee3f[_0x4600('0x21')]],'as':_0x3dee3f['as'],'attributes':_0x3dee3f['attributes'],'include':_0x3dee3f[_0x4600('0x20')]?_['map'](_0x3dee3f['include'],function(_0x22b612){return{'model':db[_0x22b612[_0x4600('0x21')]],'as':_0x22b612['as'],'attributes':_0x22b612[_0x4600('0x22')],'include':_0x22b612[_0x4600('0x20')]?_[_0x4600('0x1f')](_0x22b612[_0x4600('0x20')],function(_0x4a8f5f){return{'model':db[_0x4a8f5f[_0x4600('0x21')]],'as':_0x4a8f5f['as'],'attributes':_0x4a8f5f[_0x4600('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4600('0xd')](function(_0x2ebb04){logger[_0x4600('0x16')]('ShowSound',_0x3b26a5);logger[_0x4600('0x10')](_0x4600('0x19'),_0x3b26a5,JSON['stringify'](_0x2ebb04));_0x66f6c4(_0x2ebb04);})[_0x4600('0x18')](function(_0x42ab67){logger[_0x4600('0x13')](_0x4600('0x19'),_0x42ab67['message'],_0x3b26a5);_0x2224c6(_0x4b229d[_0x4600('0x13')](0x1f4,_0x42ab67['message']));});});};
\ No newline at end of file
+var _0x0094=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ShowSound','Sound','find','options','raw','attributes','include','map','model','catch'];(function(_0x4e5126,_0x5b47f7){var _0x521aca=function(_0x38df48){while(--_0x38df48){_0x4e5126['push'](_0x4e5126['shift']());}};_0x521aca(++_0x5b47f7);}(_0x0094,0xcb));var _0x4009=function(_0x3e923e,_0x38e1a4){_0x3e923e=_0x3e923e-0x0;var _0x21d63a=_0x0094[_0x3e923e];return _0x21d63a;};'use strict';var _=require(_0x4009('0x0'));var util=require(_0x4009('0x1'));var moment=require(_0x4009('0x2'));var BPromise=require(_0x4009('0x3'));var rs=require(_0x4009('0x4'));var fs=require('fs');var Redis=require(_0x4009('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4009('0x6'))(_0x4009('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4009('0x8')][_0x4009('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539462,_0x4e6b43,_0x49f3bf){return new BPromise(function(_0x33a962,_0x1a6a53){return client['request'](_0x539462,_0x49f3bf)['then'](function(_0x20956c){logger[_0x4009('0xa')](_0x4009('0xb'),_0x4e6b43,'request\x20sent');logger[_0x4009('0xc')](_0x4009('0xd'),_0x4e6b43,_0x4009('0xe'),JSON[_0x4009('0xf')](_0x20956c));if(_0x20956c[_0x4009('0x10')]){if(_0x20956c['error'][_0x4009('0x11')]===0x1f4){logger[_0x4009('0x10')](_0x4009('0xb'),_0x4e6b43,_0x20956c['error']['message']);return _0x1a6a53(_0x20956c[_0x4009('0x10')][_0x4009('0x12')]);}logger[_0x4009('0x10')](_0x4009('0xb'),_0x4e6b43,_0x20956c[_0x4009('0x10')][_0x4009('0x12')]);return _0x33a962(_0x20956c[_0x4009('0x10')][_0x4009('0x12')]);}else{logger[_0x4009('0xa')](_0x4009('0xb'),_0x4e6b43,'request\x20sent');_0x33a962(_0x20956c['result']['message']);}})['catch'](function(_0x4bf2ac){logger[_0x4009('0x10')](_0x4009('0xb'),_0x4e6b43,_0x4bf2ac);_0x1a6a53(_0x4bf2ac);});});}exports[_0x4009('0x13')]=function(_0x9a36b9){var _0x3d196e=this;return new Promise(function(_0x202983,_0x2348a2){return db[_0x4009('0x14')][_0x4009('0x15')]({'raw':_0x9a36b9[_0x4009('0x16')]?_0x9a36b9[_0x4009('0x16')][_0x4009('0x17')]===undefined?!![]:![]:!![],'where':_0x9a36b9[_0x4009('0x16')]?_0x9a36b9[_0x4009('0x16')]['where']||null:null,'attributes':_0x9a36b9['options']?_0x9a36b9['options'][_0x4009('0x18')]||null:null,'include':_0x9a36b9[_0x4009('0x16')]?_0x9a36b9[_0x4009('0x16')][_0x4009('0x19')]?_[_0x4009('0x1a')](_0x9a36b9[_0x4009('0x16')][_0x4009('0x19')],function(_0xba1179){return{'model':db[_0xba1179[_0x4009('0x1b')]],'as':_0xba1179['as'],'attributes':_0xba1179['attributes'],'include':_0xba1179['include']?_[_0x4009('0x1a')](_0xba1179[_0x4009('0x19')],function(_0x48f41b){return{'model':db[_0x48f41b[_0x4009('0x1b')]],'as':_0x48f41b['as'],'attributes':_0x48f41b[_0x4009('0x18')],'include':_0x48f41b['include']?_[_0x4009('0x1a')](_0x48f41b['include'],function(_0x5bdca3){return{'model':db[_0x5bdca3['model']],'as':_0x5bdca3['as'],'attributes':_0x5bdca3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3033ff){logger[_0x4009('0xa')]('ShowSound',_0x9a36b9);logger[_0x4009('0xc')](_0x4009('0x13'),_0x9a36b9,JSON[_0x4009('0xf')](_0x3033ff));_0x202983(_0x3033ff);})[_0x4009('0x1c')](function(_0x167ee5){logger['error']('ShowSound',_0x167ee5[_0x4009('0x12')],_0x9a36b9);_0x2348a2(_0x3d196e[_0x4009('0x10')](0x1f4,_0x167ee5['message']));});});};
\ No newline at end of file
index 8ed5875..a3ffc7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x5b68e6,_0x4cac4c){var _0x35bd3f=function(_0x5ba383){while(--_0x5ba383){_0x5b68e6['push'](_0x5b68e6['shift']());}};_0x35bd3f(++_0x4cac4c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x3bac3d,_0x338f17){var _0x90fbe9=function(_0x498e04){while(--_0x498e04){_0x3bac3d['push'](_0x3bac3d['shift']());}};_0x90fbe9(++_0x338f17);}(_0xda2d,0x102));var _0xdda2=function(_0x4d8db4,_0x28bfdc){_0x4d8db4=_0x4d8db4-0x0;var _0x126285=_0xda2d[_0x4d8db4];return _0x126285;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
index f054034..1de2e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087f=['medium','out','STRING','TEXT','exports'];(function(_0x4cfc40,_0x4d4c93){var _0x2b932b=function(_0x2232a3){while(--_0x2232a3){_0x4cfc40['push'](_0x4cfc40['shift']());}};_0x2b932b(++_0x4d4c93);}(_0x087f,0x176));var _0xf087=function(_0x19eb3c,_0x7788c5){_0x19eb3c=_0x19eb3c-0x0;var _0x286e64=_0x087f[_0x19eb3c];return _0x286e64;};'use strict';var Sequelize=require('sequelize');module[_0xf087('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xf087('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf087('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0xf087('0x3')]},'providerResponse':{'type':Sequelize[_0xf087('0x4')]}};
\ No newline at end of file
+var _0x4ded=['out','sequelize','exports','medium','ENUM'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x4ded,0x88));var _0xd4de=function(_0x2d21cd,_0xbeb78c){_0x2d21cd=_0x2d21cd-0x0;var _0x3b1ebc=_0x4ded[_0x2d21cd];return _0x3b1ebc;};'use strict';var Sequelize=require(_0xd4de('0x0'));module[_0xd4de('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xd4de('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xd4de('0x3')]('in',_0xd4de('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 97457b1..7b30209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bf2=['json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1551af,_0x4bfdcc){var _0x200b89=function(_0x3022e6){while(--_0x3022e6){_0x1551af['push'](_0x1551af['shift']());}};_0x200b89(++_0x4bfdcc);}(_0x7bf2,0xc8));var _0x27bf=function(_0x47842f,_0x18c538){_0x47842f=_0x47842f-0x0;var _0x5ed0c6=_0x7bf2[_0x47842f];return _0x5ed0c6;};'use strict';var emlformat=require(_0x27bf('0x0'));var rimraf=require(_0x27bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27bf('0x2'));var rp=require(_0x27bf('0x3'));var moment=require(_0x27bf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27bf('0x5'));var util=require('util');var path=require(_0x27bf('0x6'));var sox=require(_0x27bf('0x7'));var csv=require(_0x27bf('0x8'));var ejs=require(_0x27bf('0x9'));var fs=require('fs');var fs_extra=require(_0x27bf('0xa'));var _=require(_0x27bf('0xb'));var squel=require(_0x27bf('0xc'));var crypto=require(_0x27bf('0xd'));var jsforce=require(_0x27bf('0xe'));var deskjs=require(_0x27bf('0xf'));var toCsv=require(_0x27bf('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x27bf('0x10'));var authService=require(_0x27bf('0x11'));var qs=require(_0x27bf('0x12'));var as=require(_0x27bf('0x13'));var hardwareService=require(_0x27bf('0x14'));var logger=require('../../config/logger')(_0x27bf('0x15'));var utils=require(_0x27bf('0x16'));var config=require(_0x27bf('0x17'));var licenseUtil=require(_0x27bf('0x18'));var db=require(_0x27bf('0x19'))['db'];function respondWithStatusCode(_0x2347eb,_0x4e205a){_0x4e205a=_0x4e205a||0xcc;return function(_0x118b81){if(_0x118b81){return _0x2347eb[_0x27bf('0x1a')](_0x4e205a);}return _0x2347eb[_0x27bf('0x1b')](_0x4e205a)['end']();};}function respondWithResult(_0x2fa636,_0x42ed48){_0x42ed48=_0x42ed48||0xc8;return function(_0x41908a){if(_0x41908a){return _0x2fa636[_0x27bf('0x1b')](_0x42ed48)[_0x27bf('0x1c')](_0x41908a);}};}function respondWithFilteredResult(_0x51e1c5,_0x40b380){return function(_0x4d0d43){if(_0x4d0d43){var _0xc92957=typeof _0x40b380[_0x27bf('0x1d')]===_0x27bf('0x1e')&&typeof _0x40b380[_0x27bf('0x1f')]===_0x27bf('0x1e');var _0xfff594=_0x4d0d43[_0x27bf('0x20')];var _0x3b8e5e=_0xc92957?0x0:_0x40b380[_0x27bf('0x1d')];var _0x9f9646=_0xc92957?_0x4d0d43[_0x27bf('0x20')]:_0x40b380[_0x27bf('0x1d')]+_0x40b380[_0x27bf('0x1f')];var _0x4316e3;if(_0x9f9646>=_0xfff594){_0x9f9646=_0xfff594;_0x4316e3=0xc8;}else{_0x4316e3=0xce;}_0x51e1c5['status'](_0x4316e3);return _0x51e1c5['set'](_0x27bf('0x21'),_0x3b8e5e+'-'+_0x9f9646+'/'+_0xfff594)[_0x27bf('0x1c')](_0x4d0d43);}return null;};}function patchUpdates(_0x23fbce){return function(_0x265bb0){try{jsonpatch['apply'](_0x265bb0,_0x23fbce,!![]);}catch(_0x336e7a){return BPromise[_0x27bf('0x22')](_0x336e7a);}return _0x265bb0[_0x27bf('0x23')]();};}function saveUpdates(_0x1ff83a,_0x265b7a){return function(_0x14e049){if(_0x14e049){return _0x14e049[_0x27bf('0x24')](_0x1ff83a)[_0x27bf('0x25')](function(_0x13749b){return _0x13749b;});}return null;};}function removeEntity(_0x377715,_0x127372){return function(_0x2c2a45){if(_0x2c2a45){return _0x2c2a45[_0x27bf('0x26')]()[_0x27bf('0x25')](function(){_0x377715[_0x27bf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ea54,_0x2b92b9){return function(_0x1ea48c){if(!_0x1ea48c){_0x28ea54[_0x27bf('0x1a')](0x194);}return _0x1ea48c;};}function handleError(_0x21b095,_0xcdce31){_0xcdce31=_0xcdce31||0x1f4;return function(_0x7cce92){logger[_0x27bf('0x27')](_0x7cce92['stack']);if(_0x7cce92[_0x27bf('0x28')]){delete _0x7cce92['name'];}_0x21b095[_0x27bf('0x1b')](_0xcdce31)[_0x27bf('0x29')](_0x7cce92);};}exports[_0x27bf('0x2a')]=function(_0x29d9b2,_0x2afda6){var _0x1d1142={},_0x418b4b={},_0x16b71e={'count':0x0,'rows':[]};var _0x457119=_[_0x27bf('0x2b')](db[_0x27bf('0x2c')][_0x27bf('0x2d')],function(_0x15dc37){return{'name':_0x15dc37['fieldName'],'type':_0x15dc37[_0x27bf('0x2e')][_0x27bf('0x2f')]};});_0x418b4b[_0x27bf('0x30')]=_['map'](_0x457119,_0x27bf('0x28'));_0x418b4b['query']=_[_0x27bf('0x31')](_0x29d9b2[_0x27bf('0x32')]);_0x418b4b['filters']=_[_0x27bf('0x33')](_0x418b4b[_0x27bf('0x30')],_0x418b4b['query']);_0x1d1142[_0x27bf('0x34')]=_['intersection'](_0x418b4b['model'],qs['fields'](_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x35')]));_0x1d1142[_0x27bf('0x34')]=_0x1d1142[_0x27bf('0x34')]['length']?_0x1d1142[_0x27bf('0x34')]:_0x418b4b['model'];if(!_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x36')](_0x27bf('0x37'))){_0x1d1142['limit']=qs[_0x27bf('0x1f')](_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x1f')]);_0x1d1142[_0x27bf('0x1d')]=qs[_0x27bf('0x1d')](_0x29d9b2['query'][_0x27bf('0x1d')]);}_0x1d1142[_0x27bf('0x38')]=qs[_0x27bf('0x39')](_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x39')]);_0x1d1142[_0x27bf('0x3a')]=qs[_0x27bf('0x3b')](_[_0x27bf('0x3c')](_0x29d9b2['query'],_0x418b4b[_0x27bf('0x3b')]),_0x457119);if(_0x29d9b2['query'][_0x27bf('0x3d')]){_0x1d1142['where']=_[_0x27bf('0x3e')](_0x1d1142[_0x27bf('0x3a')],{'$or':_[_0x27bf('0x2b')](_0x457119,function(_0x48c54a){if(_0x48c54a[_0x27bf('0x2e')]!==_0x27bf('0x3f')){var _0x435bdd={};_0x435bdd[_0x48c54a['name']]={'$like':'%'+_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x3d')]+'%'};return _0x435bdd;}})});}_0x1d1142=_[_0x27bf('0x3e')]({},_0x1d1142,_0x29d9b2['options']);var _0x18da2b={'where':_0x1d1142[_0x27bf('0x3a')]};return db[_0x27bf('0x2c')][_0x27bf('0x20')](_0x18da2b)[_0x27bf('0x25')](function(_0x87ebd0){_0x16b71e[_0x27bf('0x20')]=_0x87ebd0;if(_0x29d9b2['query'][_0x27bf('0x40')]){_0x1d1142[_0x27bf('0x41')]=[{'all':!![]}];}return db['SquareMessage'][_0x27bf('0x42')](_0x1d1142);})[_0x27bf('0x25')](function(_0x377e3d){_0x16b71e[_0x27bf('0x43')]=_0x377e3d;return _0x16b71e;})[_0x27bf('0x25')](respondWithFilteredResult(_0x2afda6,_0x1d1142))['catch'](handleError(_0x2afda6,null));};exports[_0x27bf('0x44')]=function(_0x255008,_0x2807eb){var _0x2b7f55={'raw':!![],'where':{'id':_0x255008[_0x27bf('0x45')]['id']}},_0x332366={};_0x332366[_0x27bf('0x30')]=_[_0x27bf('0x31')](db[_0x27bf('0x2c')][_0x27bf('0x2d')]);_0x332366[_0x27bf('0x32')]=_[_0x27bf('0x31')](_0x255008[_0x27bf('0x32')]);_0x332366[_0x27bf('0x3b')]=_[_0x27bf('0x33')](_0x332366[_0x27bf('0x30')],_0x332366[_0x27bf('0x32')]);_0x2b7f55['attributes']=_[_0x27bf('0x33')](_0x332366['model'],qs[_0x27bf('0x35')](_0x255008['query'][_0x27bf('0x35')]));_0x2b7f55[_0x27bf('0x34')]=_0x2b7f55['attributes'][_0x27bf('0x46')]?_0x2b7f55['attributes']:_0x332366[_0x27bf('0x30')];if(_0x255008[_0x27bf('0x32')][_0x27bf('0x40')]){_0x2b7f55['include']=[{'all':!![]}];}_0x2b7f55=_['merge']({},_0x2b7f55,_0x255008[_0x27bf('0x47')]);return db['SquareMessage']['find'](_0x2b7f55)[_0x27bf('0x25')](handleEntityNotFound(_0x2807eb,null))[_0x27bf('0x25')](respondWithResult(_0x2807eb,null))[_0x27bf('0x48')](handleError(_0x2807eb,null));};exports[_0x27bf('0x49')]=function(_0x391f70,_0x135c53){return db[_0x27bf('0x2c')][_0x27bf('0x49')](_0x391f70['body'],{})[_0x27bf('0x25')](respondWithResult(_0x135c53,0xc9))[_0x27bf('0x48')](handleError(_0x135c53,null));};exports[_0x27bf('0x24')]=function(_0x6177e2,_0x518417){if(_0x6177e2[_0x27bf('0x4a')]['id']){delete _0x6177e2[_0x27bf('0x4a')]['id'];}return db[_0x27bf('0x2c')][_0x27bf('0x4b')]({'where':{'id':_0x6177e2['params']['id']}})['then'](handleEntityNotFound(_0x518417,null))[_0x27bf('0x25')](saveUpdates(_0x6177e2[_0x27bf('0x4a')],null))['then'](respondWithResult(_0x518417,null))[_0x27bf('0x48')](handleError(_0x518417,null));};exports[_0x27bf('0x26')]=function(_0xf996fe,_0x2c50d9){return db[_0x27bf('0x2c')][_0x27bf('0x4b')]({'where':{'id':_0xf996fe[_0x27bf('0x45')]['id']}})[_0x27bf('0x25')](handleEntityNotFound(_0x2c50d9,null))['then'](removeEntity(_0x2c50d9,null))[_0x27bf('0x48')](handleError(_0x2c50d9,null));};
\ No newline at end of file
+var _0xddd1=['fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','merge','where','filter','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','SquareMessage','rawAttributes'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xddd1,0xab));var _0x1ddd=function(_0x131acb,_0x103002){_0x131acb=_0x131acb-0x0;var _0x4a927c=_0xddd1[_0x131acb];return _0x4a927c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ddd('0x0'));var zipdir=require(_0x1ddd('0x1'));var jsonpatch=require(_0x1ddd('0x2'));var rp=require(_0x1ddd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1ddd('0x4'));var util=require(_0x1ddd('0x5'));var path=require('path');var sox=require(_0x1ddd('0x6'));var csv=require(_0x1ddd('0x7'));var ejs=require(_0x1ddd('0x8'));var fs=require('fs');var fs_extra=require(_0x1ddd('0x9'));var _=require(_0x1ddd('0xa'));var squel=require(_0x1ddd('0xb'));var crypto=require(_0x1ddd('0xc'));var jsforce=require(_0x1ddd('0xd'));var deskjs=require(_0x1ddd('0xe'));var toCsv=require(_0x1ddd('0x7'));var querystring=require('querystring');var Papa=require(_0x1ddd('0xf'));var Redis=require('ioredis');var authService=require(_0x1ddd('0x10'));var qs=require(_0x1ddd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ddd('0x12'))('api');var utils=require(_0x1ddd('0x13'));var config=require(_0x1ddd('0x14'));var licenseUtil=require(_0x1ddd('0x15'));var db=require(_0x1ddd('0x16'))['db'];function respondWithStatusCode(_0x55639d,_0x48f366){_0x48f366=_0x48f366||0xcc;return function(_0x1f330d){if(_0x1f330d){return _0x55639d[_0x1ddd('0x17')](_0x48f366);}return _0x55639d[_0x1ddd('0x18')](_0x48f366)[_0x1ddd('0x19')]();};}function respondWithResult(_0xb2d515,_0x49b1f8){_0x49b1f8=_0x49b1f8||0xc8;return function(_0x4df1c0){if(_0x4df1c0){return _0xb2d515[_0x1ddd('0x18')](_0x49b1f8)['json'](_0x4df1c0);}};}function respondWithFilteredResult(_0x2b27b2,_0x2677de){return function(_0x58210d){if(_0x58210d){var _0x1cc392=typeof _0x2677de[_0x1ddd('0x1a')]==='undefined'&&typeof _0x2677de[_0x1ddd('0x1b')]===_0x1ddd('0x1c');var _0x325ff6=_0x58210d[_0x1ddd('0x1d')];var _0x3f3e2f=_0x1cc392?0x0:_0x2677de[_0x1ddd('0x1a')];var _0x18dd62=_0x1cc392?_0x58210d[_0x1ddd('0x1d')]:_0x2677de[_0x1ddd('0x1a')]+_0x2677de[_0x1ddd('0x1b')];var _0x16cdcf;if(_0x18dd62>=_0x325ff6){_0x18dd62=_0x325ff6;_0x16cdcf=0xc8;}else{_0x16cdcf=0xce;}_0x2b27b2['status'](_0x16cdcf);return _0x2b27b2[_0x1ddd('0x1e')](_0x1ddd('0x1f'),_0x3f3e2f+'-'+_0x18dd62+'/'+_0x325ff6)['json'](_0x58210d);}return null;};}function patchUpdates(_0x3a1387){return function(_0x15ed0d){try{jsonpatch[_0x1ddd('0x20')](_0x15ed0d,_0x3a1387,!![]);}catch(_0x21f018){return BPromise[_0x1ddd('0x21')](_0x21f018);}return _0x15ed0d['save']();};}function saveUpdates(_0x584d29,_0x2089ff){return function(_0x2078a7){if(_0x2078a7){return _0x2078a7['update'](_0x584d29)[_0x1ddd('0x22')](function(_0x35a315){return _0x35a315;});}return null;};}function removeEntity(_0x29f530,_0x3b90db){return function(_0x21bf38){if(_0x21bf38){return _0x21bf38[_0x1ddd('0x23')]()[_0x1ddd('0x22')](function(){_0x29f530[_0x1ddd('0x18')](0xcc)[_0x1ddd('0x19')]();});}};}function handleEntityNotFound(_0x29516e,_0x3a370b){return function(_0x3d3035){if(!_0x3d3035){_0x29516e['sendStatus'](0x194);}return _0x3d3035;};}function handleError(_0x4d2c86,_0xda2a9c){_0xda2a9c=_0xda2a9c||0x1f4;return function(_0x3b32a3){logger['error'](_0x3b32a3[_0x1ddd('0x24')]);if(_0x3b32a3[_0x1ddd('0x25')]){delete _0x3b32a3[_0x1ddd('0x25')];}_0x4d2c86[_0x1ddd('0x18')](_0xda2a9c)[_0x1ddd('0x26')](_0x3b32a3);};}exports['index']=function(_0x435623,_0x2b7a2a){var _0x4acadd={},_0x854dca={},_0x570d5a={'count':0x0,'rows':[]};var _0x1fd539=_[_0x1ddd('0x27')](db[_0x1ddd('0x28')][_0x1ddd('0x29')],function(_0x1b9ea5){return{'name':_0x1b9ea5[_0x1ddd('0x2a')],'type':_0x1b9ea5[_0x1ddd('0x2b')][_0x1ddd('0x2c')]};});_0x854dca[_0x1ddd('0x2d')]=_[_0x1ddd('0x27')](_0x1fd539,_0x1ddd('0x25'));_0x854dca['query']=_['keys'](_0x435623[_0x1ddd('0x2e')]);_0x854dca[_0x1ddd('0x2f')]=_['intersection'](_0x854dca[_0x1ddd('0x2d')],_0x854dca[_0x1ddd('0x2e')]);_0x4acadd[_0x1ddd('0x30')]=_[_0x1ddd('0x31')](_0x854dca[_0x1ddd('0x2d')],qs[_0x1ddd('0x32')](_0x435623[_0x1ddd('0x2e')][_0x1ddd('0x32')]));_0x4acadd['attributes']=_0x4acadd['attributes'][_0x1ddd('0x33')]?_0x4acadd[_0x1ddd('0x30')]:_0x854dca[_0x1ddd('0x2d')];if(!_0x435623['query'][_0x1ddd('0x34')]('nolimit')){_0x4acadd[_0x1ddd('0x1b')]=qs[_0x1ddd('0x1b')](_0x435623[_0x1ddd('0x2e')]['limit']);_0x4acadd[_0x1ddd('0x1a')]=qs['offset'](_0x435623[_0x1ddd('0x2e')][_0x1ddd('0x1a')]);}_0x4acadd[_0x1ddd('0x35')]=qs[_0x1ddd('0x36')](_0x435623['query'][_0x1ddd('0x36')]);_0x4acadd['where']=qs[_0x1ddd('0x2f')](_['pick'](_0x435623[_0x1ddd('0x2e')],_0x854dca[_0x1ddd('0x2f')]),_0x1fd539);if(_0x435623[_0x1ddd('0x2e')]['filter']){_0x4acadd['where']=_[_0x1ddd('0x37')](_0x4acadd[_0x1ddd('0x38')],{'$or':_[_0x1ddd('0x27')](_0x1fd539,function(_0x86c738){if(_0x86c738[_0x1ddd('0x2b')]!=='VIRTUAL'){var _0x5af80a={};_0x5af80a[_0x86c738[_0x1ddd('0x25')]]={'$like':'%'+_0x435623[_0x1ddd('0x2e')][_0x1ddd('0x39')]+'%'};return _0x5af80a;}})});}_0x4acadd=_[_0x1ddd('0x37')]({},_0x4acadd,_0x435623[_0x1ddd('0x3a')]);var _0x701c5c={'where':_0x4acadd[_0x1ddd('0x38')]};return db[_0x1ddd('0x28')][_0x1ddd('0x1d')](_0x701c5c)[_0x1ddd('0x22')](function(_0x15514c){_0x570d5a[_0x1ddd('0x1d')]=_0x15514c;if(_0x435623['query']['includeAll']){_0x4acadd['include']=[{'all':!![]}];}return db['SquareMessage'][_0x1ddd('0x3b')](_0x4acadd);})[_0x1ddd('0x22')](function(_0x4a4430){_0x570d5a[_0x1ddd('0x3c')]=_0x4a4430;return _0x570d5a;})[_0x1ddd('0x22')](respondWithFilteredResult(_0x2b7a2a,_0x4acadd))[_0x1ddd('0x3d')](handleError(_0x2b7a2a,null));};exports[_0x1ddd('0x3e')]=function(_0x2caa28,_0x56720d){var _0x4ccd5c={'raw':!![],'where':{'id':_0x2caa28[_0x1ddd('0x3f')]['id']}},_0x35ad07={};_0x35ad07[_0x1ddd('0x2d')]=_[_0x1ddd('0x40')](db[_0x1ddd('0x28')]['rawAttributes']);_0x35ad07[_0x1ddd('0x2e')]=_[_0x1ddd('0x40')](_0x2caa28[_0x1ddd('0x2e')]);_0x35ad07['filters']=_[_0x1ddd('0x31')](_0x35ad07['model'],_0x35ad07[_0x1ddd('0x2e')]);_0x4ccd5c[_0x1ddd('0x30')]=_[_0x1ddd('0x31')](_0x35ad07[_0x1ddd('0x2d')],qs['fields'](_0x2caa28[_0x1ddd('0x2e')][_0x1ddd('0x32')]));_0x4ccd5c[_0x1ddd('0x30')]=_0x4ccd5c[_0x1ddd('0x30')]['length']?_0x4ccd5c['attributes']:_0x35ad07[_0x1ddd('0x2d')];if(_0x2caa28[_0x1ddd('0x2e')][_0x1ddd('0x41')]){_0x4ccd5c[_0x1ddd('0x42')]=[{'all':!![]}];}_0x4ccd5c=_[_0x1ddd('0x37')]({},_0x4ccd5c,_0x2caa28[_0x1ddd('0x3a')]);return db[_0x1ddd('0x28')][_0x1ddd('0x43')](_0x4ccd5c)[_0x1ddd('0x22')](handleEntityNotFound(_0x56720d,null))[_0x1ddd('0x22')](respondWithResult(_0x56720d,null))['catch'](handleError(_0x56720d,null));};exports[_0x1ddd('0x44')]=function(_0x5e7ece,_0x2857fc){return db[_0x1ddd('0x28')]['create'](_0x5e7ece[_0x1ddd('0x45')],{})[_0x1ddd('0x22')](respondWithResult(_0x2857fc,0xc9))[_0x1ddd('0x3d')](handleError(_0x2857fc,null));};exports[_0x1ddd('0x46')]=function(_0x50aeea,_0x3e3733){if(_0x50aeea[_0x1ddd('0x45')]['id']){delete _0x50aeea['body']['id'];}return db[_0x1ddd('0x28')]['find']({'where':{'id':_0x50aeea[_0x1ddd('0x3f')]['id']}})[_0x1ddd('0x22')](handleEntityNotFound(_0x3e3733,null))[_0x1ddd('0x22')](saveUpdates(_0x50aeea[_0x1ddd('0x45')],null))[_0x1ddd('0x22')](respondWithResult(_0x3e3733,null))['catch'](handleError(_0x3e3733,null));};exports[_0x1ddd('0x23')]=function(_0xe932e7,_0x18a8bc){return db[_0x1ddd('0x28')][_0x1ddd('0x43')]({'where':{'id':_0xe932e7[_0x1ddd('0x3f')]['id']}})[_0x1ddd('0x22')](handleEntityNotFound(_0x18a8bc,null))['then'](removeEntity(_0x18a8bc,null))['catch'](handleError(_0x18a8bc,null));};
\ No newline at end of file
index 1e8b35a..7a124c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd2=['square_messages','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage'];(function(_0x442a8f,_0x44bce7){var _0x487c8f=function(_0x3b0f20){while(--_0x3b0f20){_0x442a8f['push'](_0x442a8f['shift']());}};_0x487c8f(++_0x44bce7);}(_0xbdd2,0x115));var _0x2bdd=function(_0x4bfc90,_0x533a88){_0x4bfc90=_0x4bfc90-0x0;var _0x58c3ec=_0xbdd2[_0x4bfc90];return _0x58c3ec;};'use strict';var _=require(_0x2bdd('0x0'));var util=require(_0x2bdd('0x1'));var logger=require(_0x2bdd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2bdd('0x3'));var rp=require(_0x2bdd('0x4'));var fs=require('fs');var path=require(_0x2bdd('0x5'));var rimraf=require(_0x2bdd('0x6'));var config=require(_0x2bdd('0x7'));var attributes=require('./squareMessage.attributes');module[_0x2bdd('0x8')]=function(_0x588100,_0x3dc792){return _0x588100[_0x2bdd('0x9')](_0x2bdd('0xa'),attributes,{'tableName':_0x2bdd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec70=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','request-promise'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xec70,0x16d));var _0x0ec7=function(_0x2acfc6,_0x317a0f){_0x2acfc6=_0x2acfc6-0x0;var _0x4b2f95=_0xec70[_0x2acfc6];return _0x4b2f95;};'use strict';var _=require(_0x0ec7('0x0'));var util=require(_0x0ec7('0x1'));var logger=require(_0x0ec7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ec7('0x3'));var fs=require('fs');var path=require(_0x0ec7('0x4'));var rimraf=require(_0x0ec7('0x5'));var config=require(_0x0ec7('0x6'));var attributes=require('./squareMessage.attributes');module[_0x0ec7('0x7')]=function(_0x275f33,_0x3b68de){return _0x275f33[_0x0ec7('0x8')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aaccdde..dc35206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08b1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','SquareMessage,\x20%s,\x20%s','result','catch','SquareMessage','create','body','options','CreateSquareMessage','stringify','lodash','util','moment'];(function(_0x1ebbd0,_0x15c131){var _0x2dc063=function(_0x1cda93){while(--_0x1cda93){_0x1ebbd0['push'](_0x1ebbd0['shift']());}};_0x2dc063(++_0x15c131);}(_0x08b1,0x1d1));var _0x108b=function(_0x15ccb6,_0xbc15c3){_0x15ccb6=_0x15ccb6-0x0;var _0x202dee=_0x08b1[_0x15ccb6];return _0x202dee;};'use strict';var _=require(_0x108b('0x0'));var util=require(_0x108b('0x1'));var moment=require(_0x108b('0x2'));var BPromise=require('bluebird');var rs=require(_0x108b('0x3'));var fs=require('fs');var Redis=require(_0x108b('0x4'));var db=require(_0x108b('0x5'))['db'];var utils=require(_0x108b('0x6'));var logger=require(_0x108b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x108b('0x8')][_0x108b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363916,_0x5cafad,_0x31758a){return new BPromise(function(_0x1d344e,_0xbe6fbc){return client['request'](_0x363916,_0x31758a)[_0x108b('0xa')](function(_0x1e9ded){logger[_0x108b('0xb')]('SquareMessage,\x20%s,\x20%s',_0x5cafad,_0x108b('0xc'));logger[_0x108b('0xd')](_0x108b('0xe'),_0x5cafad,'request\x20sent',JSON['stringify'](_0x1e9ded));if(_0x1e9ded[_0x108b('0xf')]){if(_0x1e9ded[_0x108b('0xf')]['code']===0x1f4){logger[_0x108b('0xf')]('SquareMessage,\x20%s,\x20%s',_0x5cafad,_0x1e9ded[_0x108b('0xf')][_0x108b('0x10')]);return _0xbe6fbc(_0x1e9ded['error'][_0x108b('0x10')]);}logger['error'](_0x108b('0x11'),_0x5cafad,_0x1e9ded[_0x108b('0xf')]['message']);return _0x1d344e(_0x1e9ded['error']['message']);}else{logger[_0x108b('0xb')]('SquareMessage,\x20%s,\x20%s',_0x5cafad,_0x108b('0xc'));_0x1d344e(_0x1e9ded[_0x108b('0x12')]['message']);}})[_0x108b('0x13')](function(_0x2594b9){logger['error'](_0x108b('0x11'),_0x5cafad,_0x2594b9);_0xbe6fbc(_0x2594b9);});});}exports['CreateSquareMessage']=function(_0x141fad){var _0x473b4e=this;return new Promise(function(_0x58938e,_0x58aee2){return db[_0x108b('0x14')][_0x108b('0x15')](_0x141fad[_0x108b('0x16')],{'raw':_0x141fad[_0x108b('0x17')]?_0x141fad[_0x108b('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x108b('0xa')](function(_0x7387ca){logger[_0x108b('0xb')]('CreateSquareMessage',_0x141fad);logger[_0x108b('0xd')](_0x108b('0x18'),_0x141fad,JSON[_0x108b('0x19')](_0x7387ca));_0x58938e(_0x7387ca);})[_0x108b('0x13')](function(_0x2fb27f){logger[_0x108b('0xf')]('CreateSquareMessage',_0x2fb27f[_0x108b('0x10')],_0x141fad);_0x58aee2(_0x473b4e[_0x108b('0xf')](0x1f4,_0x2fb27f[_0x108b('0x10')]));});});};
\ No newline at end of file
+var _0xe234=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','options','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','request','then'];(function(_0x9fcda5,_0x176845){var _0x2b61be=function(_0x45b279){while(--_0x45b279){_0x9fcda5['push'](_0x9fcda5['shift']());}};_0x2b61be(++_0x176845);}(_0xe234,0x10a));var _0x4e23=function(_0x3ffaaa,_0x6c61f3){_0x3ffaaa=_0x3ffaaa-0x0;var _0x23882a=_0xe234[_0x3ffaaa];return _0x23882a;};'use strict';var _=require('lodash');var util=require(_0x4e23('0x0'));var moment=require(_0x4e23('0x1'));var BPromise=require(_0x4e23('0x2'));var rs=require(_0x4e23('0x3'));var fs=require('fs');var Redis=require(_0x4e23('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e23('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4e23('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4e23('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x559a6f,_0x413073,_0x2b8ac3){return new BPromise(function(_0x43ab0,_0x45a1cd){return client[_0x4e23('0x8')](_0x559a6f,_0x2b8ac3)[_0x4e23('0x9')](function(_0x33f2e8){logger[_0x4e23('0xa')](_0x4e23('0xb'),_0x413073,_0x4e23('0xc'));logger[_0x4e23('0xd')](_0x4e23('0xe'),_0x413073,_0x4e23('0xc'),JSON[_0x4e23('0xf')](_0x33f2e8));if(_0x33f2e8['error']){if(_0x33f2e8['error']['code']===0x1f4){logger[_0x4e23('0x10')](_0x4e23('0xb'),_0x413073,_0x33f2e8[_0x4e23('0x10')][_0x4e23('0x11')]);return _0x45a1cd(_0x33f2e8[_0x4e23('0x10')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x413073,_0x33f2e8[_0x4e23('0x10')][_0x4e23('0x11')]);return _0x43ab0(_0x33f2e8[_0x4e23('0x10')][_0x4e23('0x11')]);}else{logger['info'](_0x4e23('0xb'),_0x413073,_0x4e23('0xc'));_0x43ab0(_0x33f2e8[_0x4e23('0x12')][_0x4e23('0x11')]);}})[_0x4e23('0x13')](function(_0x182be9){logger[_0x4e23('0x10')]('SquareMessage,\x20%s,\x20%s',_0x413073,_0x182be9);_0x45a1cd(_0x182be9);});});}exports[_0x4e23('0x14')]=function(_0x431111){var _0x45923d=this;return new Promise(function(_0x3557b3,_0x25764d){return db[_0x4e23('0x15')]['create'](_0x431111['body'],{'raw':_0x431111[_0x4e23('0x16')]?_0x431111['options']['raw']===undefined?!![]:![]:!![]})[_0x4e23('0x9')](function(_0x22273b){logger[_0x4e23('0xa')](_0x4e23('0x14'),_0x431111);logger[_0x4e23('0xd')](_0x4e23('0x14'),_0x431111,JSON[_0x4e23('0xf')](_0x22273b));_0x3557b3(_0x22273b);})['catch'](function(_0xe26179){logger['error'](_0x4e23('0x14'),_0xe26179[_0x4e23('0x11')],_0x431111);_0x25764d(_0x45923d[_0x4e23('0x10')](0x1f4,_0xe26179[_0x4e23('0x11')]));});});};
\ No newline at end of file
index 6a7abda..02e598a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1fc=['index','get','/:id','show','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./squareOdbc.controller','isAuthenticated'];(function(_0x392e1d,_0x125aed){var _0x486d9b=function(_0x2223a4){while(--_0x2223a4){_0x392e1d['push'](_0x392e1d['shift']());}};_0x486d9b(++_0x125aed);}(_0xd1fc,0x107));var _0xcd1f=function(_0x3ffadf,_0x47c3b1){_0x3ffadf=_0x3ffadf-0x0;var _0x46223d=_0xd1fc[_0x3ffadf];return _0x46223d;};'use strict';var multer=require(_0xcd1f('0x0'));var util=require(_0xcd1f('0x1'));var path=require(_0xcd1f('0x2'));var timeout=require(_0xcd1f('0x3'));var express=require(_0xcd1f('0x4'));var router=express[_0xcd1f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcd1f('0x6'));var config=require('../../config/environment');var controller=require(_0xcd1f('0x7'));router['get']('/',auth[_0xcd1f('0x8')](),controller[_0xcd1f('0x9')]);router[_0xcd1f('0xa')](_0xcd1f('0xb'),auth[_0xcd1f('0x8')](),controller[_0xcd1f('0xc')]);router[_0xcd1f('0xa')]('/:id/test',auth['isAuthenticated'](),timeout('15s'),controller['test']);router['post']('/',auth[_0xcd1f('0x8')](),controller['create']);router[_0xcd1f('0xd')](_0xcd1f('0xb'),auth[_0xcd1f('0x8')](),controller[_0xcd1f('0xe')]);router['delete'](_0xcd1f('0xb'),auth[_0xcd1f('0x8')](),controller['destroy']);module[_0xcd1f('0xf')]=router;
\ No newline at end of file
+var _0xc7ad=['index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated'];(function(_0xc7679b,_0x2511a2){var _0x4e8f0b=function(_0x166401){while(--_0x166401){_0xc7679b['push'](_0xc7679b['shift']());}};_0x4e8f0b(++_0x2511a2);}(_0xc7ad,0x8f));var _0xdc7a=function(_0x1da4af,_0x1585ea){_0x1da4af=_0x1da4af-0x0;var _0x139b93=_0xc7ad[_0x1da4af];return _0x139b93;};'use strict';var multer=require(_0xdc7a('0x0'));var util=require('util');var path=require(_0xdc7a('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc7a('0x2'));var router=express[_0xdc7a('0x3')]();var fs_extra=require(_0xdc7a('0x4'));var auth=require(_0xdc7a('0x5'));var interaction=require(_0xdc7a('0x6'));var config=require(_0xdc7a('0x7'));var controller=require(_0xdc7a('0x8'));router[_0xdc7a('0x9')]('/',auth[_0xdc7a('0xa')](),controller[_0xdc7a('0xb')]);router['get'](_0xdc7a('0xc'),auth[_0xdc7a('0xa')](),controller[_0xdc7a('0xd')]);router[_0xdc7a('0x9')](_0xdc7a('0xe'),auth['isAuthenticated'](),timeout(_0xdc7a('0xf')),controller[_0xdc7a('0x10')]);router[_0xdc7a('0x11')]('/',auth[_0xdc7a('0xa')](),controller[_0xdc7a('0x12')]);router[_0xdc7a('0x13')](_0xdc7a('0xc'),auth[_0xdc7a('0xa')](),controller[_0xdc7a('0x14')]);router[_0xdc7a('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 53dbe22..d62ec70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1237=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1237,0x189));var _0x7123=function(_0xe832b3,_0x54b569){_0xe832b3=_0xe832b3-0x0;var _0x374244=_0x1237[_0xe832b3];return _0x374244;};'use strict';var Sequelize=require(_0x7123('0x0'));module[_0x7123('0x1')]={'name':{'type':Sequelize[_0x7123('0x2')],'unique':_0x7123('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7123('0x2')]},'description':{'type':Sequelize[_0x7123('0x2')]}};
\ No newline at end of file
+var _0x14a9=['name','sequelize','exports','STRING'];(function(_0x1144c2,_0x2b9eef){var _0x53fd07=function(_0x57b833){while(--_0x57b833){_0x1144c2['push'](_0x1144c2['shift']());}};_0x53fd07(++_0x2b9eef);}(_0x14a9,0x1ed));var _0x914a=function(_0x1ff454,_0x12372d){_0x1ff454=_0x1ff454-0x0;var _0x5dcf92=_0x14a9[_0x1ff454];return _0x5dcf92;};'use strict';var Sequelize=require(_0x914a('0x0'));module[_0x914a('0x1')]={'name':{'type':Sequelize[_0x914a('0x2')],'unique':_0x914a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x914a('0x2')]},'description':{'type':Sequelize[_0x914a('0x2')]}};
\ No newline at end of file
index cf705b8..e0ad619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c25=['request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','model','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','SquareOdbc','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','params','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch'];(function(_0x920ae3,_0x4652ef){var _0x19ea79=function(_0x4ce49f){while(--_0x4ce49f){_0x920ae3['push'](_0x920ae3['shift']());}};_0x19ea79(++_0x4652ef);}(_0x0c25,0xa7));var _0x50c2=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0x0c25[_0x1757f2];return _0x5e7212;};'use strict';var emlformat=require(_0x50c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x50c2('0x1'));var jsonpatch=require(_0x50c2('0x2'));var rp=require(_0x50c2('0x3'));var moment=require(_0x50c2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50c2('0x5'));var util=require('util');var path=require(_0x50c2('0x6'));var sox=require(_0x50c2('0x7'));var csv=require(_0x50c2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x50c2('0x9'));var _=require(_0x50c2('0xa'));var squel=require(_0x50c2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50c2('0xc'));var Papa=require(_0x50c2('0xd'));var Redis=require(_0x50c2('0xe'));var authService=require(_0x50c2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x50c2('0x10'));var hardwareService=require(_0x50c2('0x11'));var logger=require(_0x50c2('0x12'))(_0x50c2('0x13'));var utils=require(_0x50c2('0x14'));var config=require(_0x50c2('0x15'));var licenseUtil=require(_0x50c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22274f,_0x5b4b2a){_0x5b4b2a=_0x5b4b2a||0xcc;return function(_0x171177){if(_0x171177){return _0x22274f['sendStatus'](_0x5b4b2a);}return _0x22274f[_0x50c2('0x17')](_0x5b4b2a)[_0x50c2('0x18')]();};}function respondWithResult(_0x338c6e,_0x1a0f22){_0x1a0f22=_0x1a0f22||0xc8;return function(_0x24910d){if(_0x24910d){return _0x338c6e[_0x50c2('0x17')](_0x1a0f22)[_0x50c2('0x19')](_0x24910d);}};}function respondWithFilteredResult(_0x589892,_0x51d7f7){return function(_0x250a44){if(_0x250a44){var _0x338bb6=typeof _0x51d7f7[_0x50c2('0x1a')]===_0x50c2('0x1b')&&typeof _0x51d7f7[_0x50c2('0x1c')]===_0x50c2('0x1b');var _0x16087e=_0x250a44['count'];var _0x48e534=_0x338bb6?0x0:_0x51d7f7[_0x50c2('0x1a')];var _0x5106b9=_0x338bb6?_0x250a44[_0x50c2('0x1d')]:_0x51d7f7[_0x50c2('0x1a')]+_0x51d7f7['limit'];var _0x327962;if(_0x5106b9>=_0x16087e){_0x5106b9=_0x16087e;_0x327962=0xc8;}else{_0x327962=0xce;}_0x589892[_0x50c2('0x17')](_0x327962);return _0x589892['set'](_0x50c2('0x1e'),_0x48e534+'-'+_0x5106b9+'/'+_0x16087e)[_0x50c2('0x19')](_0x250a44);}return null;};}function patchUpdates(_0x51e242){return function(_0x2749b3){try{jsonpatch[_0x50c2('0x1f')](_0x2749b3,_0x51e242,!![]);}catch(_0x325903){return BPromise[_0x50c2('0x20')](_0x325903);}return _0x2749b3[_0x50c2('0x21')]();};}function saveUpdates(_0x219f84,_0x536970){return function(_0x4f4519){if(_0x4f4519){return _0x4f4519[_0x50c2('0x22')](_0x219f84)[_0x50c2('0x23')](function(_0x975d7e){return _0x975d7e;});}return null;};}function removeEntity(_0x3a3dc4,_0x54f997){return function(_0x310f7d){if(_0x310f7d){return _0x310f7d[_0x50c2('0x24')]()['then'](function(){var _0x3d1c7a=_0x310f7d['get']({'plain':!![]});var _0x37c404=_0x50c2('0x25');return db[_0x50c2('0x26')][_0x50c2('0x24')]({'where':{'type':_0x37c404,'resourceId':_0x3d1c7a['id']}})[_0x50c2('0x23')](function(){return _0x310f7d;});})[_0x50c2('0x23')](function(){_0x3a3dc4[_0x50c2('0x17')](0xcc)[_0x50c2('0x18')]();});}};}function handleEntityNotFound(_0x2b04b4,_0x118c10){return function(_0x247eb5){if(!_0x247eb5){_0x2b04b4[_0x50c2('0x27')](0x194);}return _0x247eb5;};}function handleError(_0x4c05d5,_0x101682){_0x101682=_0x101682||0x1f4;return function(_0x4a7fec){logger['error'](_0x4a7fec[_0x50c2('0x28')]);if(_0x4a7fec[_0x50c2('0x29')]){delete _0x4a7fec['name'];}_0x4c05d5[_0x50c2('0x17')](_0x101682)[_0x50c2('0x2a')](_0x4a7fec);};}exports[_0x50c2('0x2b')]=function(_0x537a25,_0x514be5){var _0x3a387a={},_0x166271={},_0x386a4b={'count':0x0,'rows':[]};var _0x4ec957=_[_0x50c2('0x2c')](db['SquareOdbc'][_0x50c2('0x2d')],function(_0x1a9f6e){return{'name':_0x1a9f6e[_0x50c2('0x2e')],'type':_0x1a9f6e[_0x50c2('0x2f')]['key']};});_0x166271['model']=_[_0x50c2('0x2c')](_0x4ec957,_0x50c2('0x29'));_0x166271[_0x50c2('0x30')]=_['keys'](_0x537a25[_0x50c2('0x30')]);_0x166271['filters']=_['intersection'](_0x166271[_0x50c2('0x31')],_0x166271[_0x50c2('0x30')]);_0x3a387a['attributes']=_[_0x50c2('0x32')](_0x166271[_0x50c2('0x31')],qs['fields'](_0x537a25[_0x50c2('0x30')][_0x50c2('0x33')]));_0x3a387a['attributes']=_0x3a387a[_0x50c2('0x34')][_0x50c2('0x35')]?_0x3a387a['attributes']:_0x166271['model'];if(!_0x537a25[_0x50c2('0x30')]['hasOwnProperty'](_0x50c2('0x36'))){_0x3a387a[_0x50c2('0x1c')]=qs[_0x50c2('0x1c')](_0x537a25[_0x50c2('0x30')][_0x50c2('0x1c')]);_0x3a387a['offset']=qs[_0x50c2('0x1a')](_0x537a25[_0x50c2('0x30')][_0x50c2('0x1a')]);}_0x3a387a['order']=qs[_0x50c2('0x37')](_0x537a25[_0x50c2('0x30')]['sort']);_0x3a387a[_0x50c2('0x38')]=qs[_0x50c2('0x39')](_[_0x50c2('0x3a')](_0x537a25['query'],_0x166271[_0x50c2('0x39')]),_0x4ec957);if(_0x537a25[_0x50c2('0x30')][_0x50c2('0x3b')]){_0x3a387a[_0x50c2('0x38')]=_[_0x50c2('0x3c')](_0x3a387a['where'],{'$or':_[_0x50c2('0x2c')](_0x4ec957,function(_0x35696f){if(_0x35696f['type']!==_0x50c2('0x3d')){var _0x54a2d5={};_0x54a2d5[_0x35696f[_0x50c2('0x29')]]={'$like':'%'+_0x537a25[_0x50c2('0x30')][_0x50c2('0x3b')]+'%'};return _0x54a2d5;}})});}_0x3a387a=_[_0x50c2('0x3c')]({},_0x3a387a,_0x537a25[_0x50c2('0x3e')]);var _0xe8e4bb={'where':_0x3a387a['where']};return db['SquareOdbc']['count'](_0xe8e4bb)[_0x50c2('0x23')](function(_0x2f8243){_0x386a4b[_0x50c2('0x1d')]=_0x2f8243;if(_0x537a25[_0x50c2('0x30')][_0x50c2('0x3f')]){_0x3a387a[_0x50c2('0x40')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x3a387a);})[_0x50c2('0x23')](function(_0x120c43){_0x386a4b[_0x50c2('0x41')]=_0x120c43;return _0x386a4b;})[_0x50c2('0x23')](respondWithFilteredResult(_0x514be5,_0x3a387a))[_0x50c2('0x42')](handleError(_0x514be5,null));};exports[_0x50c2('0x43')]=function(_0x4d1c3f,_0x4bfffb){var _0x1dd0f0={'raw':!![],'where':{'id':_0x4d1c3f['params']['id']}},_0x11cd22={};_0x11cd22[_0x50c2('0x31')]=_[_0x50c2('0x44')](db[_0x50c2('0x45')][_0x50c2('0x2d')]);_0x11cd22['query']=_[_0x50c2('0x44')](_0x4d1c3f[_0x50c2('0x30')]);_0x11cd22['filters']=_['intersection'](_0x11cd22[_0x50c2('0x31')],_0x11cd22[_0x50c2('0x30')]);_0x1dd0f0['attributes']=_[_0x50c2('0x32')](_0x11cd22[_0x50c2('0x31')],qs[_0x50c2('0x33')](_0x4d1c3f[_0x50c2('0x30')][_0x50c2('0x33')]));_0x1dd0f0['attributes']=_0x1dd0f0['attributes'][_0x50c2('0x35')]?_0x1dd0f0[_0x50c2('0x34')]:_0x11cd22['model'];if(_0x4d1c3f[_0x50c2('0x30')][_0x50c2('0x3f')]){_0x1dd0f0[_0x50c2('0x40')]=[{'all':!![]}];}_0x1dd0f0=_[_0x50c2('0x3c')]({},_0x1dd0f0,_0x4d1c3f['options']);return db[_0x50c2('0x45')][_0x50c2('0x46')](_0x1dd0f0)[_0x50c2('0x23')](handleEntityNotFound(_0x4bfffb,null))[_0x50c2('0x23')](respondWithResult(_0x4bfffb,null))[_0x50c2('0x42')](handleError(_0x4bfffb,null));};exports[_0x50c2('0x47')]=function(_0x373da0,_0xdb948f){return db['SquareOdbc'][_0x50c2('0x47')](_0x373da0['body'],{})[_0x50c2('0x23')](function(_0x305da4){var _0xc1e829=_0x373da0['user']['get']({'plain':!![]});if(!_0xc1e829)throw new Error(_0x50c2('0x48'));if(_0xc1e829[_0x50c2('0x49')]===_0x50c2('0x4a')){var _0x1d29b2=_0x305da4['get']({'plain':!![]});var _0x1b4470='ODBC';return db[_0x50c2('0x4b')][_0x50c2('0x46')]({'where':{'name':_0x1b4470,'userProfileId':_0xc1e829[_0x50c2('0x4c')]},'raw':!![]})[_0x50c2('0x23')](function(_0x525227){if(_0x525227&&_0x525227[_0x50c2('0x4d')]===0x0){return db[_0x50c2('0x26')][_0x50c2('0x47')]({'name':_0x1d29b2['name'],'resourceId':_0x1d29b2['id'],'type':_0x525227[_0x50c2('0x29')],'sectionId':_0x525227['id']},{})['then'](function(){return _0x305da4;});}else{return _0x305da4;}})[_0x50c2('0x42')](function(_0x91719b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x91719b);throw _0x91719b;});}return _0x305da4;})['then'](respondWithResult(_0xdb948f,0xc9))[_0x50c2('0x42')](handleError(_0xdb948f,null));};exports[_0x50c2('0x22')]=function(_0xe56ecc,_0x520558){if(_0xe56ecc[_0x50c2('0x4e')]['id']){delete _0xe56ecc[_0x50c2('0x4e')]['id'];}return db[_0x50c2('0x45')][_0x50c2('0x46')]({'where':{'id':_0xe56ecc[_0x50c2('0x4f')]['id']}})[_0x50c2('0x23')](handleEntityNotFound(_0x520558,null))[_0x50c2('0x23')](saveUpdates(_0xe56ecc[_0x50c2('0x4e')],null))[_0x50c2('0x23')](respondWithResult(_0x520558,null))[_0x50c2('0x42')](handleError(_0x520558,null));};exports[_0x50c2('0x24')]=function(_0x47c98f,_0x406565){return db[_0x50c2('0x45')]['find']({'where':{'id':_0x47c98f[_0x50c2('0x4f')]['id']}})[_0x50c2('0x23')](handleEntityNotFound(_0x406565,null))['then'](removeEntity(_0x406565,null))[_0x50c2('0x42')](handleError(_0x406565,null));};exports[_0x50c2('0x50')]=function(_0x1fe6a1,_0x421ff2,_0x2e7d1b){var _0x18e822;return db[_0x50c2('0x45')]['find']({'where':{'id':_0x1fe6a1[_0x50c2('0x4f')]['id']},'attributes':['id',_0x50c2('0x51')]})[_0x50c2('0x23')](handleEntityNotFound(_0x421ff2,null))[_0x50c2('0x23')](function(_0x3e1044){if(_0x3e1044){var _0x48a876=require(_0x50c2('0x52'))();_0x48a876[_0x50c2('0x53')](_0x3e1044[_0x50c2('0x51')]);_0x48a876[_0x50c2('0x54')]();return _0x3e1044;}})['then'](respondWithResult(_0x421ff2,null))[_0x50c2('0x42')](handleError(_0x421ff2,null));};
\ No newline at end of file
+var _0x15af=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','ODBC','UserProfileResource','then','end','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','SquareOdbc','includeAll','include','findAll','rows','catch','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','test','dsn','odbc','openSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5d70c5,_0x39d322){var _0x411e86=function(_0xdb9362){while(--_0xdb9362){_0x5d70c5['push'](_0x5d70c5['shift']());}};_0x411e86(++_0x39d322);}(_0x15af,0x1f0));var _0xf15a=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x15af[_0x330723];return _0x60c546;};'use strict';var emlformat=require(_0xf15a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf15a('0x1'));var jsonpatch=require(_0xf15a('0x2'));var rp=require(_0xf15a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf15a('0x4'));var util=require(_0xf15a('0x5'));var path=require('path');var sox=require(_0xf15a('0x6'));var csv=require(_0xf15a('0x7'));var ejs=require(_0xf15a('0x8'));var fs=require('fs');var fs_extra=require(_0xf15a('0x9'));var _=require(_0xf15a('0xa'));var squel=require(_0xf15a('0xb'));var crypto=require(_0xf15a('0xc'));var jsforce=require(_0xf15a('0xd'));var deskjs=require(_0xf15a('0xe'));var toCsv=require(_0xf15a('0x7'));var querystring=require(_0xf15a('0xf'));var Papa=require(_0xf15a('0x10'));var Redis=require(_0xf15a('0x11'));var authService=require(_0xf15a('0x12'));var qs=require(_0xf15a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15a('0x14'));var logger=require(_0xf15a('0x15'))('api');var utils=require(_0xf15a('0x16'));var config=require(_0xf15a('0x17'));var licenseUtil=require(_0xf15a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1495c4,_0x36b4c2){_0x36b4c2=_0x36b4c2||0xcc;return function(_0x5033a8){if(_0x5033a8){return _0x1495c4[_0xf15a('0x19')](_0x36b4c2);}return _0x1495c4[_0xf15a('0x1a')](_0x36b4c2)['end']();};}function respondWithResult(_0x55a5c4,_0x5519f6){_0x5519f6=_0x5519f6||0xc8;return function(_0x1588d8){if(_0x1588d8){return _0x55a5c4[_0xf15a('0x1a')](_0x5519f6)[_0xf15a('0x1b')](_0x1588d8);}};}function respondWithFilteredResult(_0xcf8616,_0x23b0ee){return function(_0x2724f4){if(_0x2724f4){var _0x152760=typeof _0x23b0ee[_0xf15a('0x1c')]===_0xf15a('0x1d')&&typeof _0x23b0ee[_0xf15a('0x1e')]===_0xf15a('0x1d');var _0x1491ab=_0x2724f4[_0xf15a('0x1f')];var _0x104423=_0x152760?0x0:_0x23b0ee[_0xf15a('0x1c')];var _0x27b9d9=_0x152760?_0x2724f4[_0xf15a('0x1f')]:_0x23b0ee[_0xf15a('0x1c')]+_0x23b0ee[_0xf15a('0x1e')];var _0x4d5d78;if(_0x27b9d9>=_0x1491ab){_0x27b9d9=_0x1491ab;_0x4d5d78=0xc8;}else{_0x4d5d78=0xce;}_0xcf8616[_0xf15a('0x1a')](_0x4d5d78);return _0xcf8616[_0xf15a('0x20')](_0xf15a('0x21'),_0x104423+'-'+_0x27b9d9+'/'+_0x1491ab)[_0xf15a('0x1b')](_0x2724f4);}return null;};}function patchUpdates(_0x105e43){return function(_0x4067bf){try{jsonpatch['apply'](_0x4067bf,_0x105e43,!![]);}catch(_0x18a916){return BPromise['reject'](_0x18a916);}return _0x4067bf[_0xf15a('0x22')]();};}function saveUpdates(_0x2b9a8f,_0x51b4f7){return function(_0x420a8a){if(_0x420a8a){return _0x420a8a[_0xf15a('0x23')](_0x2b9a8f)['then'](function(_0x55907f){return _0x55907f;});}return null;};}function removeEntity(_0x32ad7b,_0x552d28){return function(_0x1647ed){if(_0x1647ed){return _0x1647ed[_0xf15a('0x24')]()['then'](function(){var _0x2a6bc2=_0x1647ed[_0xf15a('0x25')]({'plain':!![]});var _0x444a9c=_0xf15a('0x26');return db[_0xf15a('0x27')][_0xf15a('0x24')]({'where':{'type':_0x444a9c,'resourceId':_0x2a6bc2['id']}})['then'](function(){return _0x1647ed;});})[_0xf15a('0x28')](function(){_0x32ad7b['status'](0xcc)[_0xf15a('0x29')]();});}};}function handleEntityNotFound(_0x3a687e,_0x8ad213){return function(_0x131597){if(!_0x131597){_0x3a687e['sendStatus'](0x194);}return _0x131597;};}function handleError(_0x49d30e,_0x369dcd){_0x369dcd=_0x369dcd||0x1f4;return function(_0x347b80){logger['error'](_0x347b80['stack']);if(_0x347b80['name']){delete _0x347b80[_0xf15a('0x2a')];}_0x49d30e[_0xf15a('0x1a')](_0x369dcd)[_0xf15a('0x2b')](_0x347b80);};}exports[_0xf15a('0x2c')]=function(_0xd9d4f0,_0x36c7d8){var _0x449d88={},_0x3fc82b={},_0x3e54ee={'count':0x0,'rows':[]};var _0x15b313=_['map'](db['SquareOdbc'][_0xf15a('0x2d')],function(_0x5789e5){return{'name':_0x5789e5[_0xf15a('0x2e')],'type':_0x5789e5[_0xf15a('0x2f')]['key']};});_0x3fc82b[_0xf15a('0x30')]=_['map'](_0x15b313,_0xf15a('0x2a'));_0x3fc82b[_0xf15a('0x31')]=_[_0xf15a('0x32')](_0xd9d4f0[_0xf15a('0x31')]);_0x3fc82b[_0xf15a('0x33')]=_[_0xf15a('0x34')](_0x3fc82b[_0xf15a('0x30')],_0x3fc82b[_0xf15a('0x31')]);_0x449d88['attributes']=_['intersection'](_0x3fc82b[_0xf15a('0x30')],qs['fields'](_0xd9d4f0[_0xf15a('0x31')][_0xf15a('0x35')]));_0x449d88[_0xf15a('0x36')]=_0x449d88[_0xf15a('0x36')][_0xf15a('0x37')]?_0x449d88['attributes']:_0x3fc82b[_0xf15a('0x30')];if(!_0xd9d4f0[_0xf15a('0x31')][_0xf15a('0x38')](_0xf15a('0x39'))){_0x449d88['limit']=qs[_0xf15a('0x1e')](_0xd9d4f0[_0xf15a('0x31')][_0xf15a('0x1e')]);_0x449d88[_0xf15a('0x1c')]=qs[_0xf15a('0x1c')](_0xd9d4f0[_0xf15a('0x31')][_0xf15a('0x1c')]);}_0x449d88[_0xf15a('0x3a')]=qs[_0xf15a('0x3b')](_0xd9d4f0[_0xf15a('0x31')][_0xf15a('0x3b')]);_0x449d88[_0xf15a('0x3c')]=qs[_0xf15a('0x33')](_[_0xf15a('0x3d')](_0xd9d4f0[_0xf15a('0x31')],_0x3fc82b[_0xf15a('0x33')]),_0x15b313);if(_0xd9d4f0[_0xf15a('0x31')]['filter']){_0x449d88[_0xf15a('0x3c')]=_[_0xf15a('0x3e')](_0x449d88['where'],{'$or':_['map'](_0x15b313,function(_0x57ef33){if(_0x57ef33[_0xf15a('0x2f')]!=='VIRTUAL'){var _0x346c50={};_0x346c50[_0x57ef33['name']]={'$like':'%'+_0xd9d4f0['query'][_0xf15a('0x3f')]+'%'};return _0x346c50;}})});}_0x449d88=_[_0xf15a('0x3e')]({},_0x449d88,_0xd9d4f0[_0xf15a('0x40')]);var _0x3b7d2f={'where':_0x449d88[_0xf15a('0x3c')]};return db[_0xf15a('0x41')][_0xf15a('0x1f')](_0x3b7d2f)['then'](function(_0x21b274){_0x3e54ee['count']=_0x21b274;if(_0xd9d4f0[_0xf15a('0x31')][_0xf15a('0x42')]){_0x449d88[_0xf15a('0x43')]=[{'all':!![]}];}return db[_0xf15a('0x41')][_0xf15a('0x44')](_0x449d88);})[_0xf15a('0x28')](function(_0x4a67b8){_0x3e54ee[_0xf15a('0x45')]=_0x4a67b8;return _0x3e54ee;})[_0xf15a('0x28')](respondWithFilteredResult(_0x36c7d8,_0x449d88))[_0xf15a('0x46')](handleError(_0x36c7d8,null));};exports['show']=function(_0x1c8a05,_0x4ec118){var _0x4053c4={'raw':!![],'where':{'id':_0x1c8a05['params']['id']}},_0x22cb52={};_0x22cb52[_0xf15a('0x30')]=_[_0xf15a('0x32')](db[_0xf15a('0x41')][_0xf15a('0x2d')]);_0x22cb52[_0xf15a('0x31')]=_['keys'](_0x1c8a05[_0xf15a('0x31')]);_0x22cb52[_0xf15a('0x33')]=_[_0xf15a('0x34')](_0x22cb52[_0xf15a('0x30')],_0x22cb52[_0xf15a('0x31')]);_0x4053c4[_0xf15a('0x36')]=_[_0xf15a('0x34')](_0x22cb52['model'],qs[_0xf15a('0x35')](_0x1c8a05[_0xf15a('0x31')][_0xf15a('0x35')]));_0x4053c4[_0xf15a('0x36')]=_0x4053c4[_0xf15a('0x36')][_0xf15a('0x37')]?_0x4053c4[_0xf15a('0x36')]:_0x22cb52[_0xf15a('0x30')];if(_0x1c8a05[_0xf15a('0x31')][_0xf15a('0x42')]){_0x4053c4[_0xf15a('0x43')]=[{'all':!![]}];}_0x4053c4=_['merge']({},_0x4053c4,_0x1c8a05[_0xf15a('0x40')]);return db[_0xf15a('0x41')]['find'](_0x4053c4)[_0xf15a('0x28')](handleEntityNotFound(_0x4ec118,null))[_0xf15a('0x28')](respondWithResult(_0x4ec118,null))[_0xf15a('0x46')](handleError(_0x4ec118,null));};exports[_0xf15a('0x47')]=function(_0x121adc,_0x5d3a17){return db['SquareOdbc'][_0xf15a('0x47')](_0x121adc[_0xf15a('0x48')],{})[_0xf15a('0x28')](function(_0x4f85cb){var _0x28d788=_0x121adc[_0xf15a('0x49')]['get']({'plain':!![]});if(!_0x28d788)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28d788[_0xf15a('0x4a')]==='user'){var _0xc471f=_0x4f85cb[_0xf15a('0x25')]({'plain':!![]});var _0x296059=_0xf15a('0x26');return db[_0xf15a('0x4b')]['find']({'where':{'name':_0x296059,'userProfileId':_0x28d788['userProfileId']},'raw':!![]})[_0xf15a('0x28')](function(_0x399a93){if(_0x399a93&&_0x399a93[_0xf15a('0x4c')]===0x0){return db[_0xf15a('0x27')][_0xf15a('0x47')]({'name':_0xc471f['name'],'resourceId':_0xc471f['id'],'type':_0x399a93[_0xf15a('0x2a')],'sectionId':_0x399a93['id']},{})['then'](function(){return _0x4f85cb;});}else{return _0x4f85cb;}})['catch'](function(_0x4ad428){logger[_0xf15a('0x4d')](_0xf15a('0x4e'),_0x4ad428);throw _0x4ad428;});}return _0x4f85cb;})[_0xf15a('0x28')](respondWithResult(_0x5d3a17,0xc9))[_0xf15a('0x46')](handleError(_0x5d3a17,null));};exports[_0xf15a('0x23')]=function(_0x5f3671,_0x334627){if(_0x5f3671[_0xf15a('0x48')]['id']){delete _0x5f3671[_0xf15a('0x48')]['id'];}return db['SquareOdbc'][_0xf15a('0x4f')]({'where':{'id':_0x5f3671[_0xf15a('0x50')]['id']}})[_0xf15a('0x28')](handleEntityNotFound(_0x334627,null))['then'](saveUpdates(_0x5f3671[_0xf15a('0x48')],null))['then'](respondWithResult(_0x334627,null))[_0xf15a('0x46')](handleError(_0x334627,null));};exports[_0xf15a('0x24')]=function(_0x53a4f2,_0xa97059){return db[_0xf15a('0x41')][_0xf15a('0x4f')]({'where':{'id':_0x53a4f2[_0xf15a('0x50')]['id']}})['then'](handleEntityNotFound(_0xa97059,null))['then'](removeEntity(_0xa97059,null))[_0xf15a('0x46')](handleError(_0xa97059,null));};exports[_0xf15a('0x51')]=function(_0x3b9b04,_0x454461,_0xf6f95f){var _0xa91ba0;return db['SquareOdbc']['find']({'where':{'id':_0x3b9b04[_0xf15a('0x50')]['id']},'attributes':['id',_0xf15a('0x52')]})[_0xf15a('0x28')](handleEntityNotFound(_0x454461,null))[_0xf15a('0x28')](function(_0x4c061a){if(_0x4c061a){var _0x3984ff=require(_0xf15a('0x53'))();_0x3984ff[_0xf15a('0x54')](_0x4c061a[_0xf15a('0x52')]);_0x3984ff['closeSync']();return _0x4c061a;}})[_0xf15a('0x28')](respondWithResult(_0x454461,null))['catch'](handleError(_0x454461,null));};
\ No newline at end of file
index 4fe40b8..c312ebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b3b=['./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x9b3b,0x17e));var _0xb9b3=function(_0x4be774,_0x5b2d48){_0x4be774=_0x4be774-0x0;var _0x31d1c9=_0x9b3b[_0x4be774];return _0x31d1c9;};'use strict';var _=require(_0xb9b3('0x0'));var util=require(_0xb9b3('0x1'));var logger=require(_0xb9b3('0x2'))(_0xb9b3('0x3'));var moment=require(_0xb9b3('0x4'));var BPromise=require(_0xb9b3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9b3('0x6'));var rimraf=require(_0xb9b3('0x7'));var config=require('../../config/environment');var attributes=require(_0xb9b3('0x8'));module[_0xb9b3('0x9')]=function(_0x4f4eac,_0x53911e){return _0x4f4eac[_0xb9b3('0xa')](_0xb9b3('0xb'),attributes,{'tableName':_0xb9b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16f5=['define','SquareOdbc','square_odbc','lodash','moment','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x3be7d4,_0x2a412f){var _0x49acbc=function(_0x45102e){while(--_0x45102e){_0x3be7d4['push'](_0x3be7d4['shift']());}};_0x49acbc(++_0x2a412f);}(_0x16f5,0x1c6));var _0x516f=function(_0x19af4c,_0x203ab8){_0x19af4c=_0x19af4c-0x0;var _0x43bf02=_0x16f5[_0x19af4c];return _0x43bf02;};'use strict';var _=require(_0x516f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x516f('0x1'));var BPromise=require(_0x516f('0x2'));var rp=require(_0x516f('0x3'));var fs=require('fs');var path=require(_0x516f('0x4'));var rimraf=require('rimraf');var config=require(_0x516f('0x5'));var attributes=require(_0x516f('0x6'));module[_0x516f('0x7')]=function(_0x435733,_0x2cd711){return _0x435733[_0x516f('0x8')](_0x516f('0x9'),attributes,{'tableName':_0x516f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4248d35..1903bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf4f=['../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c0ef7,_0x188a0b){var _0x5b64ec=function(_0x2b82c6){while(--_0x2b82c6){_0x1c0ef7['push'](_0x1c0ef7['shift']());}};_0x5b64ec(++_0x188a0b);}(_0xcf4f,0xf3));var _0xfcf4=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xcf4f[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xfcf4('0x0'));var util=require(_0xfcf4('0x1'));var moment=require('moment');var BPromise=require(_0xfcf4('0x2'));var rs=require(_0xfcf4('0x3'));var fs=require('fs');var Redis=require(_0xfcf4('0x4'));var db=require(_0xfcf4('0x5'))['db'];var utils=require(_0xfcf4('0x6'));var logger=require(_0xfcf4('0x7'))(_0xfcf4('0x8'));var config=require(_0xfcf4('0x9'));var jayson=require(_0xfcf4('0xa'));var client=jayson[_0xfcf4('0xb')][_0xfcf4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x113ee4,_0x36320c,_0x4a78c6){return new BPromise(function(_0xac444e,_0x38782f){return client[_0xfcf4('0xd')](_0x113ee4,_0x4a78c6)[_0xfcf4('0xe')](function(_0x36c935){logger[_0xfcf4('0xf')](_0xfcf4('0x10'),_0x36320c,_0xfcf4('0x11'));logger[_0xfcf4('0x12')](_0xfcf4('0x13'),_0x36320c,_0xfcf4('0x11'),JSON['stringify'](_0x36c935));if(_0x36c935['error']){if(_0x36c935['error'][_0xfcf4('0x14')]===0x1f4){logger[_0xfcf4('0x15')](_0xfcf4('0x10'),_0x36320c,_0x36c935[_0xfcf4('0x15')][_0xfcf4('0x16')]);return _0x38782f(_0x36c935[_0xfcf4('0x15')][_0xfcf4('0x16')]);}logger[_0xfcf4('0x15')](_0xfcf4('0x10'),_0x36320c,_0x36c935[_0xfcf4('0x15')][_0xfcf4('0x16')]);return _0xac444e(_0x36c935['error'][_0xfcf4('0x16')]);}else{logger[_0xfcf4('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x36320c,_0xfcf4('0x11'));_0xac444e(_0x36c935[_0xfcf4('0x17')]['message']);}})[_0xfcf4('0x18')](function(_0x383656){logger['error'](_0xfcf4('0x10'),_0x36320c,_0x383656);_0x38782f(_0x383656);});});}exports[_0xfcf4('0x19')]=function(_0x1eb30d){var _0x54f914=this;return new Promise(function(_0x2552fa,_0x617e69){return db[_0xfcf4('0x1a')][_0xfcf4('0x1b')]({'raw':_0x1eb30d[_0xfcf4('0x1c')]?_0x1eb30d[_0xfcf4('0x1c')][_0xfcf4('0x1d')]===undefined?!![]:![]:!![],'where':_0x1eb30d[_0xfcf4('0x1c')]?_0x1eb30d[_0xfcf4('0x1c')][_0xfcf4('0x1e')]||null:null,'attributes':_0x1eb30d[_0xfcf4('0x1c')]?_0x1eb30d['options'][_0xfcf4('0x1f')]||null:null,'include':_0x1eb30d[_0xfcf4('0x1c')]?_0x1eb30d['options']['include']?_[_0xfcf4('0x20')](_0x1eb30d[_0xfcf4('0x1c')][_0xfcf4('0x21')],function(_0x11d7ec){return{'model':db[_0x11d7ec[_0xfcf4('0x22')]],'as':_0x11d7ec['as'],'attributes':_0x11d7ec[_0xfcf4('0x1f')],'include':_0x11d7ec[_0xfcf4('0x21')]?_[_0xfcf4('0x20')](_0x11d7ec[_0xfcf4('0x21')],function(_0x11c1af){return{'model':db[_0x11c1af['model']],'as':_0x11c1af['as'],'attributes':_0x11c1af[_0xfcf4('0x1f')],'include':_0x11c1af[_0xfcf4('0x21')]?_[_0xfcf4('0x20')](_0x11c1af[_0xfcf4('0x21')],function(_0x21ec85){return{'model':db[_0x21ec85[_0xfcf4('0x22')]],'as':_0x21ec85['as'],'attributes':_0x21ec85['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x179036){logger['info'](_0xfcf4('0x19'),_0x1eb30d);logger[_0xfcf4('0x12')](_0xfcf4('0x19'),_0x1eb30d,JSON[_0xfcf4('0x23')](_0x179036));_0x2552fa(_0x179036);})['catch'](function(_0x148d7b){logger[_0xfcf4('0x15')](_0xfcf4('0x19'),_0x148d7b[_0xfcf4('0x16')],_0x1eb30d);_0x617e69(_0x54f914[_0xfcf4('0x15')](0x1f4,_0x148d7b[_0xfcf4('0x16')]));});});};
\ No newline at end of file
+var _0x41ce=['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','catch','ShowSquareOdbc','find','options','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4dd909,_0x407b30){var _0x73872=function(_0x2eb115){while(--_0x2eb115){_0x4dd909['push'](_0x4dd909['shift']());}};_0x73872(++_0x407b30);}(_0x41ce,0x1c4));var _0xe41c=function(_0x5695b4,_0x44d771){_0x5695b4=_0x5695b4-0x0;var _0x2d7963=_0x41ce[_0x5695b4];return _0x2d7963;};'use strict';var _=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var moment=require(_0xe41c('0x2'));var BPromise=require(_0xe41c('0x3'));var rs=require(_0xe41c('0x4'));var fs=require('fs');var Redis=require(_0xe41c('0x5'));var db=require(_0xe41c('0x6'))['db'];var utils=require(_0xe41c('0x7'));var logger=require(_0xe41c('0x8'))('rpc');var config=require(_0xe41c('0x9'));var jayson=require(_0xe41c('0xa'));var client=jayson[_0xe41c('0xb')][_0xe41c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x292845,_0x4253bd,_0xeaeaf){return new BPromise(function(_0x2938d2,_0xe39aff){return client[_0xe41c('0xd')](_0x292845,_0xeaeaf)['then'](function(_0x471ac9){logger[_0xe41c('0xe')](_0xe41c('0xf'),_0x4253bd,_0xe41c('0x10'));logger[_0xe41c('0x11')](_0xe41c('0x12'),_0x4253bd,_0xe41c('0x10'),JSON[_0xe41c('0x13')](_0x471ac9));if(_0x471ac9[_0xe41c('0x14')]){if(_0x471ac9['error'][_0xe41c('0x15')]===0x1f4){logger['error'](_0xe41c('0xf'),_0x4253bd,_0x471ac9[_0xe41c('0x14')][_0xe41c('0x16')]);return _0xe39aff(_0x471ac9[_0xe41c('0x14')][_0xe41c('0x16')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4253bd,_0x471ac9[_0xe41c('0x14')][_0xe41c('0x16')]);return _0x2938d2(_0x471ac9[_0xe41c('0x14')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4253bd,_0xe41c('0x10'));_0x2938d2(_0x471ac9[_0xe41c('0x17')][_0xe41c('0x16')]);}})[_0xe41c('0x18')](function(_0x42e9ed){logger[_0xe41c('0x14')](_0xe41c('0xf'),_0x4253bd,_0x42e9ed);_0xe39aff(_0x42e9ed);});});}exports[_0xe41c('0x19')]=function(_0x36c0da){var _0x46dc6d=this;return new Promise(function(_0x16cfab,_0x1bb43f){return db['SquareOdbc'][_0xe41c('0x1a')]({'raw':_0x36c0da['options']?_0x36c0da[_0xe41c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x36c0da['options']?_0x36c0da['options']['where']||null:null,'attributes':_0x36c0da[_0xe41c('0x1b')]?_0x36c0da[_0xe41c('0x1b')][_0xe41c('0x1c')]||null:null,'include':_0x36c0da[_0xe41c('0x1b')]?_0x36c0da['options'][_0xe41c('0x1d')]?_[_0xe41c('0x1e')](_0x36c0da[_0xe41c('0x1b')][_0xe41c('0x1d')],function(_0x44dbfd){return{'model':db[_0x44dbfd[_0xe41c('0x1f')]],'as':_0x44dbfd['as'],'attributes':_0x44dbfd[_0xe41c('0x1c')],'include':_0x44dbfd[_0xe41c('0x1d')]?_[_0xe41c('0x1e')](_0x44dbfd[_0xe41c('0x1d')],function(_0x2c317e){return{'model':db[_0x2c317e['model']],'as':_0x2c317e['as'],'attributes':_0x2c317e['attributes'],'include':_0x2c317e['include']?_[_0xe41c('0x1e')](_0x2c317e[_0xe41c('0x1d')],function(_0x5c25d1){return{'model':db[_0x5c25d1[_0xe41c('0x1f')]],'as':_0x5c25d1['as'],'attributes':_0x5c25d1[_0xe41c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe41c('0x20')](function(_0x54f347){logger['info'](_0xe41c('0x19'),_0x36c0da);logger['debug'](_0xe41c('0x19'),_0x36c0da,JSON[_0xe41c('0x13')](_0x54f347));_0x16cfab(_0x54f347);})['catch'](function(_0x164d28){logger['error'](_0xe41c('0x19'),_0x164d28['message'],_0x36c0da);_0x1bb43f(_0x46dc6d['error'](0x1f4,_0x164d28[_0xe41c('0x16')]));});});};
\ No newline at end of file
index 4991c51..4000a17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b91=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','show','create','put','update','/:id','exports','multer','util','path','connect-timeout','express'];(function(_0x10316a,_0x125dc8){var _0x36ac2e=function(_0x140e35){while(--_0x140e35){_0x10316a['push'](_0x10316a['shift']());}};_0x36ac2e(++_0x125dc8);}(_0x9b91,0x1bd));var _0x19b9=function(_0xeadc11,_0x27e378){_0xeadc11=_0xeadc11-0x0;var _0x4257b6=_0x9b91[_0xeadc11];return _0x4257b6;};'use strict';var multer=require(_0x19b9('0x0'));var util=require(_0x19b9('0x1'));var path=require(_0x19b9('0x2'));var timeout=require(_0x19b9('0x3'));var express=require(_0x19b9('0x4'));var router=express[_0x19b9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x19b9('0x6'));var interaction=require(_0x19b9('0x7'));var config=require(_0x19b9('0x8'));var controller=require(_0x19b9('0x9'));router[_0x19b9('0xa')]('/',auth[_0x19b9('0xb')](),controller['index']);router[_0x19b9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x19b9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x19b9('0xd')]);router[_0x19b9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x19b9('0xf')]);router['delete'](_0x19b9('0x10'),auth[_0x19b9('0xb')](),controller['destroy']);module[_0x19b9('0x11')]=router;
\ No newline at end of file
+var _0x9f83=['./squareProject.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x285e21,_0x583d5c){var _0x38bb07=function(_0x326db3){while(--_0x326db3){_0x285e21['push'](_0x285e21['shift']());}};_0x38bb07(++_0x583d5c);}(_0x9f83,0x18b));var _0x39f8=function(_0x365248,_0x330b6a){_0x365248=_0x365248-0x0;var _0x296ad5=_0x9f83[_0x365248];return _0x296ad5;};'use strict';var multer=require('multer');var util=require(_0x39f8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x39f8('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x39f8('0x2'));var interaction=require(_0x39f8('0x3'));var config=require(_0x39f8('0x4'));var controller=require(_0x39f8('0x5'));router['get']('/',auth[_0x39f8('0x6')](),controller[_0x39f8('0x7')]);router[_0x39f8('0x8')](_0x39f8('0x9'),auth[_0x39f8('0x6')](),controller[_0x39f8('0xa')]);router[_0x39f8('0xb')]('/',auth[_0x39f8('0x6')](),controller[_0x39f8('0xc')]);router[_0x39f8('0xd')](_0x39f8('0x9'),auth[_0x39f8('0x6')](),controller['update']);router[_0x39f8('0xe')](_0x39f8('0x9'),auth[_0x39f8('0x6')](),controller[_0x39f8('0xf')]);module['exports']=router;
\ No newline at end of file
index b783d8d..5693386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c4=['sequelize','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','utf8','production','DATE'];(function(_0x2e6657,_0x19f20c){var _0x11d9f3=function(_0x45375c){while(--_0x45375c){_0x2e6657['push'](_0x2e6657['shift']());}};_0x11d9f3(++_0x19f20c);}(_0x31c4,0x113));var _0x431c=function(_0x1a415c,_0x4d96b6){_0x1a415c=_0x1a415c-0x0;var _0x5cfb1b=_0x31c4[_0x1a415c];return _0x5cfb1b;};'use strict';var Sequelize=require(_0x431c('0x0'));module['exports']={'name':{'type':Sequelize[_0x431c('0x1')],'unique':_0x431c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x431c('0x1')]},'notes':{'type':Sequelize[_0x431c('0x3')]},'preproduction':{'type':Sequelize[_0x431c('0x4')](_0x431c('0x5')),'get':function(){if(this[_0x431c('0x6')]('preproduction')){return this[_0x431c('0x6')](_0x431c('0x7'))['toString'](_0x431c('0x8'));}}},'production':{'type':Sequelize[_0x431c('0x4')](_0x431c('0x5')),'get':function(){if(this[_0x431c('0x6')]('production')){return this['getDataValue'](_0x431c('0x9'))['toString'](_0x431c('0x8'));}}},'savedAt':{'type':Sequelize[_0x431c('0xa')]},'publishedAt':{'type':Sequelize[_0x431c('0xa')]}};
\ No newline at end of file
+var _0x707d=['exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','utf8','production','toString','DATE','sequelize'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x707d,0x18b));var _0xd707=function(_0x535505,_0x2896b2){_0x535505=_0x535505-0x0;var _0x3f1d87=_0x707d[_0x535505];return _0x3f1d87;};'use strict';var Sequelize=require(_0xd707('0x0'));module[_0xd707('0x1')]={'name':{'type':Sequelize[_0xd707('0x2')],'unique':_0xd707('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd707('0x2')]},'notes':{'type':Sequelize[_0xd707('0x4')]},'preproduction':{'type':Sequelize[_0xd707('0x5')]('long'),'get':function(){if(this[_0xd707('0x6')](_0xd707('0x7'))){return this[_0xd707('0x6')](_0xd707('0x7'))['toString'](_0xd707('0x8'));}}},'production':{'type':Sequelize[_0xd707('0x5')]('long'),'get':function(){if(this[_0xd707('0x6')](_0xd707('0x9'))){return this[_0xd707('0x6')]('production')[_0xd707('0xa')](_0xd707('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd707('0xb')]}};
\ No newline at end of file
index 0ef4f21..07fc976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42d1=['./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','SquareProjects','UserProfileResource','publish','stringify','end','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','filter','merge','include','catch','show','params','includeAll','options','find','create','user','role','userProfileId','autoAssociation','error','body','agi','production','destroy','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x16ff2f,_0x298d81){var _0x4ca515=function(_0x5dc220){while(--_0x5dc220){_0x16ff2f['push'](_0x16ff2f['shift']());}};_0x4ca515(++_0x298d81);}(_0x42d1,0x109));var _0x142d=function(_0x68b56d,_0x32b305){_0x68b56d=_0x68b56d-0x0;var _0x2a7f94=_0x42d1[_0x68b56d];return _0x2a7f94;};'use strict';var _=require(_0x142d('0x0'));var Redis=require(_0x142d('0x1'));var qs=require(_0x142d('0x2'));var logger=require(_0x142d('0x3'))(_0x142d('0x4'));var config=require(_0x142d('0x5'));var db=require(_0x142d('0x6'))['db'];config[_0x142d('0x7')]=_[_0x142d('0x8')](config[_0x142d('0x7')],{'host':_0x142d('0x9'),'port':0x18eb});var socket=require(_0x142d('0xa'))(new Redis(config[_0x142d('0x7')]));require(_0x142d('0xb'))[_0x142d('0xc')](socket);function respondWithResult(_0x29e8b7,_0x5e5484){_0x5e5484=_0x5e5484||0xc8;return function(_0x916db8){if(_0x916db8){return _0x29e8b7[_0x142d('0xd')](_0x5e5484)[_0x142d('0xe')](_0x916db8);}};}function respondWithFilteredResult(_0x28c33b,_0xa1ce3c){return function(_0x1bb2ba){if(_0x1bb2ba){var _0x255630=typeof _0xa1ce3c[_0x142d('0xf')]===_0x142d('0x10')&&typeof _0xa1ce3c[_0x142d('0x11')]===_0x142d('0x10');var _0x2e27bf=_0x1bb2ba['count'];var _0x14ea27=_0x255630?0x0:_0xa1ce3c[_0x142d('0xf')];var _0x4cbec6=_0x255630?_0x1bb2ba[_0x142d('0x12')]:_0xa1ce3c['offset']+_0xa1ce3c[_0x142d('0x11')];var _0x60d2c3;if(_0x4cbec6>=_0x2e27bf){_0x4cbec6=_0x2e27bf;_0x60d2c3=0xc8;}else{_0x60d2c3=0xce;}_0x28c33b['status'](_0x60d2c3);return _0x28c33b[_0x142d('0x13')](_0x142d('0x14'),_0x14ea27+'-'+_0x4cbec6+'/'+_0x2e27bf)['json'](_0x1bb2ba);}return null;};}function saveUpdates(_0x509b9e){return function(_0x2c4cd8){if(_0x2c4cd8){return _0x2c4cd8[_0x142d('0x15')](_0x509b9e)[_0x142d('0x16')](function(_0x33b632){return _0x33b632;});}return null;};}function removeEntity(_0x53a32b){return function(_0x3790a2){if(_0x3790a2){return _0x3790a2['destroy']()[_0x142d('0x16')](function(){var _0x55cee4=_0x3790a2[_0x142d('0x17')]({'plain':!![]});var _0x39f3b3=_0x142d('0x18');return db[_0x142d('0x19')]['destroy']({'where':{'type':_0x39f3b3,'resourceId':_0x55cee4['id']}})[_0x142d('0x16')](function(){return _0x3790a2;});})['then'](function(){var _0x2fc775=new Redis(config['redis']);_0x2fc775[_0x142d('0x1a')]('agi',JSON[_0x142d('0x1b')]({'id':_0x3790a2['id'],'deleted':!![]}));})[_0x142d('0x16')](function(){_0x53a32b[_0x142d('0xd')](0xcc)[_0x142d('0x1c')]();});}};}function handleEntityNotFound(_0x544a4f){return function(_0x2b8c0d){if(!_0x2b8c0d){_0x544a4f['sendStatus'](0x194);}return _0x2b8c0d;};}function handleError(_0x4c2317,_0x4ded03){_0x4ded03=_0x4ded03||0x1f4;return function(_0x10f8b8){logger['error'](_0x10f8b8[_0x142d('0x1d')]);if(_0x10f8b8[_0x142d('0x1e')]){delete _0x10f8b8[_0x142d('0x1e')];}_0x4c2317[_0x142d('0xd')](_0x4ded03)['send'](_0x10f8b8);};}exports[_0x142d('0x1f')]=function(_0x127bdd,_0x24547e){var _0x231ebe={},_0x45b7f2={},_0x426ec8={'count':0x0,'rows':[]};var _0x143502=_[_0x142d('0x20')](db[_0x142d('0x21')][_0x142d('0x22')],function(_0x5cc569){return{'name':_0x5cc569[_0x142d('0x23')],'type':_0x5cc569[_0x142d('0x24')][_0x142d('0x25')]};});_0x45b7f2[_0x142d('0x26')]=_[_0x142d('0x20')](_0x143502,_0x142d('0x1e'));_0x45b7f2['query']=_[_0x142d('0x27')](_0x127bdd['query']);_0x45b7f2[_0x142d('0x28')]=_[_0x142d('0x29')](_0x45b7f2[_0x142d('0x26')],_0x45b7f2[_0x142d('0x2a')]);_0x231ebe['attributes']=_[_0x142d('0x29')](_0x45b7f2['model'],qs[_0x142d('0x2b')](_0x127bdd[_0x142d('0x2a')]['fields']));_0x231ebe[_0x142d('0x2c')]=_0x231ebe[_0x142d('0x2c')][_0x142d('0x2d')]?_0x231ebe[_0x142d('0x2c')]:_0x45b7f2[_0x142d('0x26')];if(!_0x127bdd['query']['hasOwnProperty'](_0x142d('0x2e'))){_0x231ebe['limit']=qs[_0x142d('0x11')](_0x127bdd['query'][_0x142d('0x11')]);_0x231ebe[_0x142d('0xf')]=qs[_0x142d('0xf')](_0x127bdd[_0x142d('0x2a')][_0x142d('0xf')]);}_0x231ebe[_0x142d('0x2f')]=qs[_0x142d('0x30')](_0x127bdd[_0x142d('0x2a')][_0x142d('0x30')]);_0x231ebe[_0x142d('0x31')]=qs['filters'](_['pick'](_0x127bdd[_0x142d('0x2a')],_0x45b7f2[_0x142d('0x28')]),_0x143502);if(_0x127bdd[_0x142d('0x2a')][_0x142d('0x32')]){_0x231ebe[_0x142d('0x31')]=_[_0x142d('0x33')](_0x231ebe[_0x142d('0x31')],{'$or':_['map'](_0x143502,function(_0x368e75){if(_0x368e75['type']!=='VIRTUAL'){var _0x536ec9={};_0x536ec9[_0x368e75[_0x142d('0x1e')]]={'$like':'%'+_0x127bdd[_0x142d('0x2a')][_0x142d('0x32')]+'%'};return _0x536ec9;}})});}_0x231ebe=_[_0x142d('0x33')]({},_0x231ebe,_0x127bdd['options']);var _0x2ef3e6={'where':_0x231ebe['where']};return db[_0x142d('0x21')][_0x142d('0x12')](_0x2ef3e6)['then'](function(_0x5158c6){_0x426ec8['count']=_0x5158c6;if(_0x127bdd[_0x142d('0x2a')]['includeAll']){_0x231ebe[_0x142d('0x34')]=[{'all':!![]}];}return db[_0x142d('0x21')]['findAll'](_0x231ebe);})['then'](function(_0x3a5d70){_0x426ec8['rows']=_0x3a5d70;return _0x426ec8;})['then'](respondWithFilteredResult(_0x24547e,_0x231ebe))[_0x142d('0x35')](handleError(_0x24547e,null));};exports[_0x142d('0x36')]=function(_0x2125c6,_0x501295){var _0x335bcc={'raw':![],'where':{'id':_0x2125c6[_0x142d('0x37')]['id']}},_0x1d3f1f={};_0x1d3f1f['model']=_[_0x142d('0x27')](db[_0x142d('0x21')][_0x142d('0x22')]);_0x1d3f1f['query']=_[_0x142d('0x27')](_0x2125c6[_0x142d('0x2a')]);_0x1d3f1f['filters']=_[_0x142d('0x29')](_0x1d3f1f[_0x142d('0x26')],_0x1d3f1f[_0x142d('0x2a')]);_0x335bcc[_0x142d('0x2c')]=_[_0x142d('0x29')](_0x1d3f1f[_0x142d('0x26')],qs['fields'](_0x2125c6[_0x142d('0x2a')][_0x142d('0x2b')]));_0x335bcc['attributes']=_0x335bcc[_0x142d('0x2c')][_0x142d('0x2d')]?_0x335bcc[_0x142d('0x2c')]:_0x1d3f1f[_0x142d('0x26')];if(_0x2125c6[_0x142d('0x2a')][_0x142d('0x38')]){_0x335bcc[_0x142d('0x34')]=[{'all':!![]}];}_0x335bcc=_[_0x142d('0x33')]({},_0x335bcc,_0x2125c6[_0x142d('0x39')]);return db[_0x142d('0x21')][_0x142d('0x3a')](_0x335bcc)[_0x142d('0x16')](handleEntityNotFound(_0x501295,null))[_0x142d('0x16')](respondWithResult(_0x501295,null))[_0x142d('0x35')](handleError(_0x501295,null));};exports[_0x142d('0x3b')]=function(_0xe32250,_0x167884){return db['SquareProject'][_0x142d('0x3b')](_0xe32250['body'],{})[_0x142d('0x16')](function(_0x1945ce){var _0x5d09c3=_0xe32250[_0x142d('0x3c')]['get']({'plain':!![]});if(!_0x5d09c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d09c3[_0x142d('0x3d')]==='user'){var _0x2d5a07=_0x1945ce[_0x142d('0x17')]({'plain':!![]});var _0x84fb04=_0x142d('0x18');return db['UserProfileSection'][_0x142d('0x3a')]({'where':{'name':_0x84fb04,'userProfileId':_0x5d09c3[_0x142d('0x3e')]},'raw':!![]})['then'](function(_0x2e8522){if(_0x2e8522&&_0x2e8522[_0x142d('0x3f')]===0x0){return db[_0x142d('0x19')][_0x142d('0x3b')]({'name':_0x2d5a07['name'],'resourceId':_0x2d5a07['id'],'type':_0x2e8522[_0x142d('0x1e')],'sectionId':_0x2e8522['id']},{})['then'](function(){return _0x1945ce;});}else{return _0x1945ce;}})['catch'](function(_0x24597d){logger[_0x142d('0x40')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24597d);throw _0x24597d;});}return _0x1945ce;})[_0x142d('0x16')](respondWithResult(_0x167884,0xc9))['catch'](handleError(_0x167884,null));};exports['update']=function(_0x401cf8,_0x1e2f54){if(_0x401cf8[_0x142d('0x41')]['id']){delete _0x401cf8[_0x142d('0x41')]['id'];}return db[_0x142d('0x21')][_0x142d('0x3a')]({'where':{'id':_0x401cf8[_0x142d('0x37')]['id']}})[_0x142d('0x16')](handleEntityNotFound(_0x1e2f54,null))[_0x142d('0x16')](saveUpdates(_0x401cf8['body'],null))[_0x142d('0x16')](function(_0x282025){if(!_0x282025)return;var _0x520d57=_0x282025['get']({'plain':!![]});return _0x520d57;})[_0x142d('0x16')](function(_0x46b1f3){var _0x2f3c1d=new Redis(config[_0x142d('0x7')]);_0x2f3c1d[_0x142d('0x1a')](_0x142d('0x42'),JSON['stringify'](_['pick'](_0x46b1f3,['id',_0x142d('0x1e'),_0x142d('0x43')])));return _0x46b1f3;})[_0x142d('0x16')](respondWithResult(_0x1e2f54,null))[_0x142d('0x35')](handleError(_0x1e2f54,null));};exports[_0x142d('0x44')]=function(_0x209f33,_0xa68299){return db[_0x142d('0x21')][_0x142d('0x3a')]({'where':{'id':_0x209f33[_0x142d('0x37')]['id']}})['then'](handleEntityNotFound(_0xa68299,null))[_0x142d('0x16')](removeEntity(_0xa68299,null))['catch'](handleError(_0xa68299,null));};
\ No newline at end of file
+var _0x8366=['where','VIRTUAL','merge','findAll','rows','params','includeAll','include','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','update','destroy','then','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter'];(function(_0x1a62bb,_0x157e87){var _0x4ade6f=function(_0x5662d6){while(--_0x5662d6){_0x1a62bb['push'](_0x1a62bb['shift']());}};_0x4ade6f(++_0x157e87);}(_0x8366,0x1ee));var _0x6836=function(_0x23a2d8,_0x26c82c){_0x23a2d8=_0x23a2d8-0x0;var _0x2f5e75=_0x8366[_0x23a2d8];return _0x2f5e75;};'use strict';var _=require(_0x6836('0x0'));var Redis=require(_0x6836('0x1'));var qs=require(_0x6836('0x2'));var logger=require('../../config/logger')(_0x6836('0x3'));var config=require(_0x6836('0x4'));var db=require(_0x6836('0x5'))['db'];config['redis']=_['defaults'](config[_0x6836('0x6')],{'host':_0x6836('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6836('0x6')]));require(_0x6836('0x8'))[_0x6836('0x9')](socket);function respondWithResult(_0x5ca212,_0x4b7ca9){_0x4b7ca9=_0x4b7ca9||0xc8;return function(_0x3dd6a1){if(_0x3dd6a1){return _0x5ca212[_0x6836('0xa')](_0x4b7ca9)[_0x6836('0xb')](_0x3dd6a1);}};}function respondWithFilteredResult(_0x4dbd81,_0x39e930){return function(_0x3f7b1d){if(_0x3f7b1d){var _0x25c12b=typeof _0x39e930[_0x6836('0xc')]===_0x6836('0xd')&&typeof _0x39e930[_0x6836('0xe')]===_0x6836('0xd');var _0x5a6b5a=_0x3f7b1d[_0x6836('0xf')];var _0x1a8531=_0x25c12b?0x0:_0x39e930[_0x6836('0xc')];var _0x27555d=_0x25c12b?_0x3f7b1d['count']:_0x39e930[_0x6836('0xc')]+_0x39e930[_0x6836('0xe')];var _0x4028ed;if(_0x27555d>=_0x5a6b5a){_0x27555d=_0x5a6b5a;_0x4028ed=0xc8;}else{_0x4028ed=0xce;}_0x4dbd81[_0x6836('0xa')](_0x4028ed);return _0x4dbd81[_0x6836('0x10')]('Content-Range',_0x1a8531+'-'+_0x27555d+'/'+_0x5a6b5a)[_0x6836('0xb')](_0x3f7b1d);}return null;};}function saveUpdates(_0x5bc674){return function(_0x1b7fbf){if(_0x1b7fbf){return _0x1b7fbf[_0x6836('0x11')](_0x5bc674)['then'](function(_0xdf85c1){return _0xdf85c1;});}return null;};}function removeEntity(_0x457e3f){return function(_0x543a50){if(_0x543a50){return _0x543a50[_0x6836('0x12')]()[_0x6836('0x13')](function(){var _0xed8cdc=_0x543a50[_0x6836('0x14')]({'plain':!![]});var _0x32d5c5=_0x6836('0x15');return db[_0x6836('0x16')]['destroy']({'where':{'type':_0x32d5c5,'resourceId':_0xed8cdc['id']}})[_0x6836('0x13')](function(){return _0x543a50;});})[_0x6836('0x13')](function(){var _0x192132=new Redis(config['redis']);_0x192132[_0x6836('0x17')](_0x6836('0x18'),JSON[_0x6836('0x19')]({'id':_0x543a50['id'],'deleted':!![]}));})[_0x6836('0x13')](function(){_0x457e3f[_0x6836('0xa')](0xcc)[_0x6836('0x1a')]();});}};}function handleEntityNotFound(_0x11b63f){return function(_0x37a97d){if(!_0x37a97d){_0x11b63f[_0x6836('0x1b')](0x194);}return _0x37a97d;};}function handleError(_0x5a9017,_0x2680f2){_0x2680f2=_0x2680f2||0x1f4;return function(_0x5a1af7){logger[_0x6836('0x1c')](_0x5a1af7[_0x6836('0x1d')]);if(_0x5a1af7[_0x6836('0x1e')]){delete _0x5a1af7[_0x6836('0x1e')];}_0x5a9017[_0x6836('0xa')](_0x2680f2)[_0x6836('0x1f')](_0x5a1af7);};}exports[_0x6836('0x20')]=function(_0x28c4d4,_0x3cf1bc){var _0x11d297={},_0x108017={},_0x448c3f={'count':0x0,'rows':[]};var _0x1d531b=_['map'](db[_0x6836('0x21')][_0x6836('0x22')],function(_0x28cded){return{'name':_0x28cded['fieldName'],'type':_0x28cded[_0x6836('0x23')][_0x6836('0x24')]};});_0x108017['model']=_[_0x6836('0x25')](_0x1d531b,_0x6836('0x1e'));_0x108017[_0x6836('0x26')]=_[_0x6836('0x27')](_0x28c4d4[_0x6836('0x26')]);_0x108017['filters']=_[_0x6836('0x28')](_0x108017[_0x6836('0x29')],_0x108017[_0x6836('0x26')]);_0x11d297['attributes']=_[_0x6836('0x28')](_0x108017[_0x6836('0x29')],qs[_0x6836('0x2a')](_0x28c4d4[_0x6836('0x26')][_0x6836('0x2a')]));_0x11d297[_0x6836('0x2b')]=_0x11d297[_0x6836('0x2b')]['length']?_0x11d297['attributes']:_0x108017[_0x6836('0x29')];if(!_0x28c4d4['query'][_0x6836('0x2c')](_0x6836('0x2d'))){_0x11d297['limit']=qs[_0x6836('0xe')](_0x28c4d4[_0x6836('0x26')][_0x6836('0xe')]);_0x11d297[_0x6836('0xc')]=qs[_0x6836('0xc')](_0x28c4d4['query'][_0x6836('0xc')]);}_0x11d297['order']=qs[_0x6836('0x2e')](_0x28c4d4['query']['sort']);_0x11d297['where']=qs[_0x6836('0x2f')](_[_0x6836('0x30')](_0x28c4d4['query'],_0x108017[_0x6836('0x2f')]),_0x1d531b);if(_0x28c4d4[_0x6836('0x26')][_0x6836('0x31')]){_0x11d297[_0x6836('0x32')]=_['merge'](_0x11d297[_0x6836('0x32')],{'$or':_[_0x6836('0x25')](_0x1d531b,function(_0x3e0dee){if(_0x3e0dee[_0x6836('0x23')]!==_0x6836('0x33')){var _0x49ca62={};_0x49ca62[_0x3e0dee[_0x6836('0x1e')]]={'$like':'%'+_0x28c4d4['query'][_0x6836('0x31')]+'%'};return _0x49ca62;}})});}_0x11d297=_[_0x6836('0x34')]({},_0x11d297,_0x28c4d4['options']);var _0x26ea51={'where':_0x11d297[_0x6836('0x32')]};return db[_0x6836('0x21')][_0x6836('0xf')](_0x26ea51)['then'](function(_0x40a7ed){_0x448c3f[_0x6836('0xf')]=_0x40a7ed;if(_0x28c4d4[_0x6836('0x26')]['includeAll']){_0x11d297['include']=[{'all':!![]}];}return db[_0x6836('0x21')][_0x6836('0x35')](_0x11d297);})[_0x6836('0x13')](function(_0x5d169e){_0x448c3f[_0x6836('0x36')]=_0x5d169e;return _0x448c3f;})[_0x6836('0x13')](respondWithFilteredResult(_0x3cf1bc,_0x11d297))['catch'](handleError(_0x3cf1bc,null));};exports['show']=function(_0x192158,_0x1cf796){var _0x2db4bd={'raw':![],'where':{'id':_0x192158[_0x6836('0x37')]['id']}},_0x194a86={};_0x194a86['model']=_['keys'](db[_0x6836('0x21')]['rawAttributes']);_0x194a86['query']=_[_0x6836('0x27')](_0x192158['query']);_0x194a86[_0x6836('0x2f')]=_[_0x6836('0x28')](_0x194a86[_0x6836('0x29')],_0x194a86[_0x6836('0x26')]);_0x2db4bd[_0x6836('0x2b')]=_[_0x6836('0x28')](_0x194a86[_0x6836('0x29')],qs[_0x6836('0x2a')](_0x192158[_0x6836('0x26')][_0x6836('0x2a')]));_0x2db4bd[_0x6836('0x2b')]=_0x2db4bd[_0x6836('0x2b')]['length']?_0x2db4bd[_0x6836('0x2b')]:_0x194a86[_0x6836('0x29')];if(_0x192158['query'][_0x6836('0x38')]){_0x2db4bd[_0x6836('0x39')]=[{'all':!![]}];}_0x2db4bd=_['merge']({},_0x2db4bd,_0x192158[_0x6836('0x3a')]);return db[_0x6836('0x21')][_0x6836('0x3b')](_0x2db4bd)[_0x6836('0x13')](handleEntityNotFound(_0x1cf796,null))[_0x6836('0x13')](respondWithResult(_0x1cf796,null))[_0x6836('0x3c')](handleError(_0x1cf796,null));};exports['create']=function(_0x538cda,_0x1018cf){return db[_0x6836('0x21')]['create'](_0x538cda[_0x6836('0x3d')],{})[_0x6836('0x13')](function(_0x3e0a1f){var _0x1a5e1a=_0x538cda[_0x6836('0x3e')][_0x6836('0x14')]({'plain':!![]});if(!_0x1a5e1a)throw new Error(_0x6836('0x3f'));if(_0x1a5e1a[_0x6836('0x40')]===_0x6836('0x3e')){var _0x358317=_0x3e0a1f[_0x6836('0x14')]({'plain':!![]});var _0x34ded9=_0x6836('0x15');return db[_0x6836('0x41')][_0x6836('0x3b')]({'where':{'name':_0x34ded9,'userProfileId':_0x1a5e1a[_0x6836('0x42')]},'raw':!![]})['then'](function(_0x2cfd8e){if(_0x2cfd8e&&_0x2cfd8e['autoAssociation']===0x0){return db[_0x6836('0x16')][_0x6836('0x43')]({'name':_0x358317[_0x6836('0x1e')],'resourceId':_0x358317['id'],'type':_0x2cfd8e[_0x6836('0x1e')],'sectionId':_0x2cfd8e['id']},{})['then'](function(){return _0x3e0a1f;});}else{return _0x3e0a1f;}})[_0x6836('0x3c')](function(_0x20d658){logger[_0x6836('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20d658);throw _0x20d658;});}return _0x3e0a1f;})['then'](respondWithResult(_0x1018cf,0xc9))['catch'](handleError(_0x1018cf,null));};exports[_0x6836('0x11')]=function(_0x1f53b8,_0x459493){if(_0x1f53b8[_0x6836('0x3d')]['id']){delete _0x1f53b8[_0x6836('0x3d')]['id'];}return db['SquareProject'][_0x6836('0x3b')]({'where':{'id':_0x1f53b8['params']['id']}})['then'](handleEntityNotFound(_0x459493,null))[_0x6836('0x13')](saveUpdates(_0x1f53b8[_0x6836('0x3d')],null))['then'](function(_0x57aabd){if(!_0x57aabd)return;var _0x5d3153=_0x57aabd['get']({'plain':!![]});return _0x5d3153;})['then'](function(_0x23dff1){var _0x5b481f=new Redis(config[_0x6836('0x6')]);_0x5b481f[_0x6836('0x17')](_0x6836('0x18'),JSON[_0x6836('0x19')](_[_0x6836('0x30')](_0x23dff1,['id',_0x6836('0x1e'),'production'])));return _0x23dff1;})[_0x6836('0x13')](respondWithResult(_0x459493,null))[_0x6836('0x3c')](handleError(_0x459493,null));};exports['destroy']=function(_0x4643f8,_0x4aef3c){return db[_0x6836('0x21')][_0x6836('0x3b')]({'where':{'id':_0x4643f8[_0x6836('0x37')]['id']}})[_0x6836('0x13')](handleEntityNotFound(_0x4aef3c,null))[_0x6836('0x13')](removeEntity(_0x4aef3c,null))['catch'](handleError(_0x4aef3c,null));};
\ No newline at end of file
index a0c6196..3ff78d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3950=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x141a00,_0x26c4af){var _0x4a7479=function(_0x3510ff){while(--_0x3510ff){_0x141a00['push'](_0x141a00['shift']());}};_0x4a7479(++_0x26c4af);}(_0x3950,0x10e));var _0x0395=function(_0x165ece,_0x1f0a42){_0x165ece=_0x165ece-0x0;var _0x545fe6=_0x3950[_0x165ece];return _0x545fe6;};'use strict';var EventEmitter=require(_0x0395('0x0'));var SquareProject=require(_0x0395('0x1'))['db'][_0x0395('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0395('0x3')](0x0);var events={'afterCreate':_0x0395('0x4'),'afterUpdate':_0x0395('0x5'),'afterDestroy':_0x0395('0x6')};function emitEvent(_0x4de4f5){return function(_0x49c7e7,_0x3fffc3,_0x3b5211){SquareProjectEvents[_0x0395('0x7')](_0x4de4f5+':'+_0x49c7e7['id'],_0x49c7e7);SquareProjectEvents[_0x0395('0x7')](_0x4de4f5,_0x49c7e7);_0x3b5211(null);};}for(var e in events){if(events[_0x0395('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
+var _0xf2ca=['events','SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3ad2b9,_0xae3153){var _0x4043bd=function(_0xc59184){while(--_0xc59184){_0x3ad2b9['push'](_0x3ad2b9['shift']());}};_0x4043bd(++_0xae3153);}(_0xf2ca,0x130));var _0xaf2c=function(_0xcba291,_0x10e9d5){_0xcba291=_0xcba291-0x0;var _0x162274=_0xf2ca[_0xcba291];return _0x162274;};'use strict';var EventEmitter=require(_0xaf2c('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xaf2c('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xaf2c('0x2')](0x0);var events={'afterCreate':_0xaf2c('0x3'),'afterUpdate':'update','afterDestroy':_0xaf2c('0x4')};function emitEvent(_0xa6a48c){return function(_0x4a8fd9,_0x5b874f,_0x23f115){SquareProjectEvents[_0xaf2c('0x5')](_0xa6a48c+':'+_0x4a8fd9['id'],_0x4a8fd9);SquareProjectEvents['emit'](_0xa6a48c,_0x4a8fd9);_0x23f115(null);};}for(var e in events){if(events[_0xaf2c('0x6')](e)){var event=events[e];SquareProject[_0xaf2c('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
index 0584c9a..f49d4ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e55=['changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects'];(function(_0x219ac8,_0x39e9cd){var _0x5094ed=function(_0x72f6e1){while(--_0x72f6e1){_0x219ac8['push'](_0x219ac8['shift']());}};_0x5094ed(++_0x39e9cd);}(_0x3e55,0x1ce));var _0x53e5=function(_0x592b01,_0x2d3274){_0x592b01=_0x592b01-0x0;var _0x5894fc=_0x3e55[_0x592b01];return _0x5894fc;};'use strict';var _=require(_0x53e5('0x0'));var util=require(_0x53e5('0x1'));var logger=require(_0x53e5('0x2'))(_0x53e5('0x3'));var moment=require(_0x53e5('0x4'));var BPromise=require(_0x53e5('0x5'));var rp=require(_0x53e5('0x6'));var fs=require('fs');var path=require(_0x53e5('0x7'));var rimraf=require('rimraf');var config=require(_0x53e5('0x8'));var attributes=require(_0x53e5('0x9'));module['exports']=function(_0x4a4517,_0x169879){return _0x4a4517[_0x53e5('0xa')](_0x53e5('0xb'),attributes,{'tableName':_0x53e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32300a,_0x147120,_0x238377){if(_0x32300a[_0x53e5('0xd')](_0x53e5('0xe'))){_0x32300a[_0x53e5('0xf')]=moment()['format'](_0x53e5('0x10'));}if(_0x32300a[_0x53e5('0xd')](_0x53e5('0x11'))){_0x32300a['publishedAt']=moment()[_0x53e5('0x12')](_0x53e5('0x10'));}_0x238377(null,_0x32300a);}}});};
\ No newline at end of file
+var _0x0894=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f410a,_0x358c81){var _0x35431e=function(_0x516354){while(--_0x516354){_0x3f410a['push'](_0x3f410a['shift']());}};_0x35431e(++_0x358c81);}(_0x0894,0xcb));var _0x4089=function(_0x42fe09,_0x37008a){_0x42fe09=_0x42fe09-0x0;var _0x2c6a8f=_0x0894[_0x42fe09];return _0x2c6a8f;};'use strict';var _=require(_0x4089('0x0'));var util=require(_0x4089('0x1'));var logger=require(_0x4089('0x2'))(_0x4089('0x3'));var moment=require(_0x4089('0x4'));var BPromise=require(_0x4089('0x5'));var rp=require(_0x4089('0x6'));var fs=require('fs');var path=require(_0x4089('0x7'));var rimraf=require(_0x4089('0x8'));var config=require(_0x4089('0x9'));var attributes=require(_0x4089('0xa'));module[_0x4089('0xb')]=function(_0x431f4e,_0x55aa0d){return _0x431f4e[_0x4089('0xc')]('SquareProject',attributes,{'tableName':_0x4089('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37bd79,_0x3bab69,_0x5970d9){if(_0x37bd79[_0x4089('0xe')]('preproduction')){_0x37bd79[_0x4089('0xf')]=moment()['format'](_0x4089('0x10'));}if(_0x37bd79[_0x4089('0xe')](_0x4089('0x11'))){_0x37bd79['publishedAt']=moment()[_0x4089('0x12')](_0x4089('0x10'));}_0x5970d9(null,_0x37bd79);}}});};
\ No newline at end of file
index 6b085ec..344a836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe688=['SquareProject','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','options','raw','where','limit','include','map','model','attributes','then','info','GetSquareProjects','debug','stringify','catch','error','message','ShowSquareProject'];(function(_0x2ca441,_0x323035){var _0x385cd0=function(_0x1b4c5f){while(--_0x1b4c5f){_0x2ca441['push'](_0x2ca441['shift']());}};_0x385cd0(++_0x323035);}(_0xe688,0xd9));var _0x8e68=function(_0x20dd94,_0x1c633c){_0x20dd94=_0x20dd94-0x0;var _0x2ff2ca=_0xe688[_0x20dd94];return _0x2ff2ca;};'use strict';var _=require('lodash');var Redis=require(_0x8e68('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0x8e68('0x1'))('rpc');var config=require(_0x8e68('0x2'));config[_0x8e68('0x3')]=_[_0x8e68('0x4')](config[_0x8e68('0x3')],{'host':_0x8e68('0x5'),'port':0x18eb});var socket=require(_0x8e68('0x6'))(new Redis(config['redis']));require(_0x8e68('0x7'))[_0x8e68('0x8')](socket);exports['GetSquareProjects']=function(_0x5a91b4){var _0x3e38af=this;return new Promise(function(_0x2a7f78,_0x426370){return db['SquareProject']['findAll']({'raw':_0x5a91b4[_0x8e68('0x9')]?_0x5a91b4['options'][_0x8e68('0xa')]===undefined?!![]:![]:!![],'where':_0x5a91b4[_0x8e68('0x9')]?_0x5a91b4[_0x8e68('0x9')][_0x8e68('0xb')]||null:null,'attributes':_0x5a91b4[_0x8e68('0x9')]?_0x5a91b4[_0x8e68('0x9')]['attributes']||null:null,'limit':_0x5a91b4[_0x8e68('0x9')]?_0x5a91b4[_0x8e68('0x9')][_0x8e68('0xc')]||null:null,'include':_0x5a91b4[_0x8e68('0x9')]?_0x5a91b4['options'][_0x8e68('0xd')]?_['map'](_0x5a91b4[_0x8e68('0x9')][_0x8e68('0xd')],function(_0x1dbfd3){return{'model':db[_0x1dbfd3['model']],'as':_0x1dbfd3['as'],'attributes':_0x1dbfd3['attributes'],'include':_0x1dbfd3[_0x8e68('0xd')]?_[_0x8e68('0xe')](_0x1dbfd3[_0x8e68('0xd')],function(_0x37a074){return{'model':db[_0x37a074[_0x8e68('0xf')]],'as':_0x37a074['as'],'attributes':_0x37a074[_0x8e68('0x10')],'include':_0x37a074[_0x8e68('0xd')]?_[_0x8e68('0xe')](_0x37a074[_0x8e68('0xd')],function(_0x4fa4ab){return{'model':db[_0x4fa4ab['model']],'as':_0x4fa4ab['as'],'attributes':_0x4fa4ab[_0x8e68('0x10')]};}):[]};}):[]};}):[]:[]})[_0x8e68('0x11')](function(_0x4d772c){logger[_0x8e68('0x12')](_0x8e68('0x13'),_0x5a91b4);logger[_0x8e68('0x14')]('GetSquareProjects',_0x5a91b4,JSON[_0x8e68('0x15')](_0x4d772c));_0x2a7f78(_0x4d772c);})[_0x8e68('0x16')](function(_0x3110f9){logger[_0x8e68('0x17')](_0x8e68('0x13'),_0x3110f9[_0x8e68('0x18')],_0x5a91b4);_0x426370(_0x3e38af[_0x8e68('0x17')](0x1f4,_0x3110f9['message']));});});};exports[_0x8e68('0x19')]=function(_0x16b9e5){var _0xa9ac4=this;return new Promise(function(_0x1a82c3,_0xd5e23c){return db[_0x8e68('0x1a')]['find']({'raw':_0x16b9e5[_0x8e68('0x9')]?_0x16b9e5[_0x8e68('0x9')][_0x8e68('0xa')]===undefined?!![]:![]:!![],'where':_0x16b9e5[_0x8e68('0x9')]?_0x16b9e5[_0x8e68('0x9')][_0x8e68('0xb')]||null:null,'attributes':_0x16b9e5['options']?_0x16b9e5['options'][_0x8e68('0x10')]||null:null,'include':_0x16b9e5[_0x8e68('0x9')]?_0x16b9e5[_0x8e68('0x9')][_0x8e68('0xd')]?_[_0x8e68('0xe')](_0x16b9e5[_0x8e68('0x9')][_0x8e68('0xd')],function(_0x4a7aeb){return{'model':db[_0x4a7aeb['model']],'as':_0x4a7aeb['as'],'attributes':_0x4a7aeb[_0x8e68('0x10')],'include':_0x4a7aeb[_0x8e68('0xd')]?_[_0x8e68('0xe')](_0x4a7aeb['include'],function(_0x385d32){return{'model':db[_0x385d32['model']],'as':_0x385d32['as'],'attributes':_0x385d32[_0x8e68('0x10')],'include':_0x385d32[_0x8e68('0xd')]?_[_0x8e68('0xe')](_0x385d32['include'],function(_0x4a1c5c){return{'model':db[_0x4a1c5c['model']],'as':_0x4a1c5c['as'],'attributes':_0x4a1c5c[_0x8e68('0x10')]};}):[]};}):[]};}):[]:[]})[_0x8e68('0x11')](function(_0x18e051){logger[_0x8e68('0x12')](_0x8e68('0x19'),_0x16b9e5);logger['debug'](_0x8e68('0x19'),_0x16b9e5,JSON['stringify'](_0x18e051));_0x1a82c3(_0x18e051);})[_0x8e68('0x16')](function(_0x17f7d9){logger[_0x8e68('0x17')](_0x8e68('0x19'),_0x17f7d9[_0x8e68('0x18')],_0x16b9e5);_0xd5e23c(_0xa9ac4['error'](0x1f4,_0x17f7d9[_0x8e68('0x18')]));});});};
\ No newline at end of file
+var _0xf138=['defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','options','where','limit','include','map','model','attributes','then','info','debug','stringify','message','error','find','raw','ShowSquareProject','catch','ioredis','../../mysqldb','rpc','../../config/environment','redis'];(function(_0xf7df9b,_0x50426f){var _0x4d327e=function(_0x3efd77){while(--_0x3efd77){_0xf7df9b['push'](_0xf7df9b['shift']());}};_0x4d327e(++_0x50426f);}(_0xf138,0x13a));var _0x8f13=function(_0x3c8c65,_0x58c772){_0x3c8c65=_0x3c8c65-0x0;var _0x165c60=_0xf138[_0x3c8c65];return _0x165c60;};'use strict';var _=require('lodash');var Redis=require(_0x8f13('0x0'));var db=require(_0x8f13('0x1'))['db'];var logger=require('../../config/logger')(_0x8f13('0x2'));var config=require(_0x8f13('0x3'));config[_0x8f13('0x4')]=_[_0x8f13('0x5')](config[_0x8f13('0x4')],{'host':_0x8f13('0x6'),'port':0x18eb});var socket=require(_0x8f13('0x7'))(new Redis(config[_0x8f13('0x4')]));require(_0x8f13('0x8'))[_0x8f13('0x9')](socket);exports[_0x8f13('0xa')]=function(_0x22e516){var _0x23cbed=this;return new Promise(function(_0x5ca2e2,_0x3bde36){return db['SquareProject'][_0x8f13('0xb')]({'raw':_0x22e516[_0x8f13('0xc')]?_0x22e516['options']['raw']===undefined?!![]:![]:!![],'where':_0x22e516[_0x8f13('0xc')]?_0x22e516[_0x8f13('0xc')][_0x8f13('0xd')]||null:null,'attributes':_0x22e516[_0x8f13('0xc')]?_0x22e516[_0x8f13('0xc')]['attributes']||null:null,'limit':_0x22e516[_0x8f13('0xc')]?_0x22e516[_0x8f13('0xc')][_0x8f13('0xe')]||null:null,'include':_0x22e516['options']?_0x22e516[_0x8f13('0xc')][_0x8f13('0xf')]?_[_0x8f13('0x10')](_0x22e516[_0x8f13('0xc')]['include'],function(_0x3342d3){return{'model':db[_0x3342d3[_0x8f13('0x11')]],'as':_0x3342d3['as'],'attributes':_0x3342d3[_0x8f13('0x12')],'include':_0x3342d3[_0x8f13('0xf')]?_['map'](_0x3342d3[_0x8f13('0xf')],function(_0x5b5d54){return{'model':db[_0x5b5d54[_0x8f13('0x11')]],'as':_0x5b5d54['as'],'attributes':_0x5b5d54[_0x8f13('0x12')],'include':_0x5b5d54[_0x8f13('0xf')]?_[_0x8f13('0x10')](_0x5b5d54[_0x8f13('0xf')],function(_0x54bd5f){return{'model':db[_0x54bd5f[_0x8f13('0x11')]],'as':_0x54bd5f['as'],'attributes':_0x54bd5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x8f13('0x13')](function(_0x271848){logger[_0x8f13('0x14')](_0x8f13('0xa'),_0x22e516);logger[_0x8f13('0x15')]('GetSquareProjects',_0x22e516,JSON[_0x8f13('0x16')](_0x271848));_0x5ca2e2(_0x271848);})['catch'](function(_0x23451e){logger['error'](_0x8f13('0xa'),_0x23451e[_0x8f13('0x17')],_0x22e516);_0x3bde36(_0x23cbed[_0x8f13('0x18')](0x1f4,_0x23451e[_0x8f13('0x17')]));});});};exports['ShowSquareProject']=function(_0x1eac4b){var _0x151502=this;return new Promise(function(_0x52f927,_0x59e664){return db['SquareProject'][_0x8f13('0x19')]({'raw':_0x1eac4b[_0x8f13('0xc')]?_0x1eac4b[_0x8f13('0xc')][_0x8f13('0x1a')]===undefined?!![]:![]:!![],'where':_0x1eac4b[_0x8f13('0xc')]?_0x1eac4b[_0x8f13('0xc')][_0x8f13('0xd')]||null:null,'attributes':_0x1eac4b['options']?_0x1eac4b[_0x8f13('0xc')][_0x8f13('0x12')]||null:null,'include':_0x1eac4b['options']?_0x1eac4b['options']['include']?_[_0x8f13('0x10')](_0x1eac4b[_0x8f13('0xc')]['include'],function(_0x4d6826){return{'model':db[_0x4d6826[_0x8f13('0x11')]],'as':_0x4d6826['as'],'attributes':_0x4d6826[_0x8f13('0x12')],'include':_0x4d6826['include']?_['map'](_0x4d6826[_0x8f13('0xf')],function(_0x5098b4){return{'model':db[_0x5098b4[_0x8f13('0x11')]],'as':_0x5098b4['as'],'attributes':_0x5098b4[_0x8f13('0x12')],'include':_0x5098b4['include']?_[_0x8f13('0x10')](_0x5098b4[_0x8f13('0xf')],function(_0x4da733){return{'model':db[_0x4da733[_0x8f13('0x11')]],'as':_0x4da733['as'],'attributes':_0x4da733[_0x8f13('0x12')]};}):[]};}):[]};}):[]:[]})[_0x8f13('0x13')](function(_0x1851e7){logger[_0x8f13('0x14')](_0x8f13('0x1b'),_0x1eac4b);logger['debug'](_0x8f13('0x1b'),_0x1eac4b,JSON['stringify'](_0x1851e7));_0x52f927(_0x1851e7);})[_0x8f13('0x1c')](function(_0x364da7){logger[_0x8f13('0x18')]('ShowSquareProject',_0x364da7[_0x8f13('0x17')],_0x1eac4b);_0x59e664(_0x151502[_0x8f13('0x18')](0x1f4,_0x364da7[_0x8f13('0x17')]));});});};
\ No newline at end of file
index 2e883df..cfd465c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93ef=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x397c56,_0x4428d5){var _0x210a70=function(_0xed22d1){while(--_0xed22d1){_0x397c56['push'](_0x397c56['shift']());}};_0x210a70(++_0x4428d5);}(_0x93ef,0x191));var _0xf93e=function(_0x1fd6d8,_0x330146){_0x1fd6d8=_0x1fd6d8-0x0;var _0x5933f2=_0x93ef[_0x1fd6d8];return _0x5933f2;};'use strict';var SquareProjectEvents=require(_0xf93e('0x0'));var events=[_0xf93e('0x1'),_0xf93e('0x2'),_0xf93e('0x3')];function createListener(_0x3240a4,_0x5c3ac3){return function(_0x597ca4){_0x5c3ac3[_0xf93e('0x4')](_0x3240a4,_0x597ca4);};}function removeListener(_0x49d645,_0x5846cb){return function(){SquareProjectEvents[_0xf93e('0x5')](_0x49d645,_0x5846cb);};}exports[_0xf93e('0x6')]=function(_0x542bad){for(var _0x36d797=0x0,_0x5f4deb=events[_0xf93e('0x7')];_0x36d797<_0x5f4deb;_0x36d797++){var _0x1d12de=events[_0x36d797];var _0x1732f3=createListener(_0xf93e('0x8')+_0x1d12de,_0x542bad);SquareProjectEvents['on'](_0x1d12de,_0x1732f3);}};
\ No newline at end of file
+var _0xbb90=['register','length','./squareProject.events','remove','update','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb90,0x1ad));var _0x0bb9=function(_0x18f994,_0x133236){_0x18f994=_0x18f994-0x0;var _0x285013=_0xbb90[_0x18f994];return _0x285013;};'use strict';var SquareProjectEvents=require(_0x0bb9('0x0'));var events=['save',_0x0bb9('0x1'),_0x0bb9('0x2')];function createListener(_0x2230d0,_0x4e63c6){return function(_0x1d0f67){_0x4e63c6[_0x0bb9('0x3')](_0x2230d0,_0x1d0f67);};}function removeListener(_0x2d4ebf,_0x595724){return function(){SquareProjectEvents[_0x0bb9('0x4')](_0x2d4ebf,_0x595724);};}exports[_0x0bb9('0x5')]=function(_0x42e8e5){for(var _0x3fef9f=0x0,_0x5ca666=events[_0x0bb9('0x6')];_0x3fef9f<_0x5ca666;_0x3fef9f++){var _0x14249b=events[_0x3fef9f];var _0xd04fc5=createListener('squareProject:'+_0x14249b,_0x42e8e5);SquareProjectEvents['on'](_0x14249b,_0xd04fc5);}};
\ No newline at end of file
index 11014c6..58f1db1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x4feaa8,_0x483a05){var _0x455b26=function(_0x3c1182){while(--_0x3c1182){_0x4feaa8['push'](_0x4feaa8['shift']());}};_0x455b26(++_0x483a05);}(_0x5fab,0x177));var _0xb5fa=function(_0x14d233,_0x4289f7){_0x14d233=_0x14d233-0x0;var _0x2d4c76=_0x5fab[_0x14d233];return _0x2d4c76;};'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
+var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x2cd637,_0x304558){var _0x5f4d0d=function(_0x5eff5d){while(--_0x5eff5d){_0x2cd637['push'](_0x2cd637['shift']());}};_0x5f4d0d(++_0x304558);}(_0xe14b,0x93));var _0xbe14=function(_0x2d9ad9,_0x17d1e6){_0x2d9ad9=_0x2d9ad9-0x0;var _0x21f167=_0xe14b[_0x2d9ad9];return _0x21f167;};'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['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router;
\ No newline at end of file
index 0bac9ac..e3c3dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x305e09,_0xb17eb9){var _0x3fb03b=function(_0x40926c){while(--_0x40926c){_0x305e09['push'](_0x305e09['shift']());}};_0x3fb03b(++_0xb17eb9);}(_0x425d,0x1e0));var _0xd425=function(_0x1c676d,_0x4a62ea){_0x1c676d=_0x1c676d-0x0;var _0x287e93=_0x425d[_0x1c676d];return _0x287e93;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}};
\ No newline at end of file
+var _0xda19=['getDataValue','exports','STRING','VIRTUAL'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xda19,0xd5));var _0x9da1=function(_0x3675e2,_0x591b10){_0x3675e2=_0x3675e2-0x0;var _0x359dab=_0xda19[_0x3675e2];return _0x359dab;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'uniqueid':{'type':Sequelize[_0x9da1('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9da1('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'dnid':{'type':Sequelize[_0x9da1('0x1')]},'projectName':{'type':Sequelize[_0x9da1('0x1')]},'saveName':{'type':Sequelize[_0x9da1('0x1')]},'filename':{'type':Sequelize[_0x9da1('0x1')]},'savePath':{'type':Sequelize[_0x9da1('0x1')]},'format':{'type':Sequelize[_0x9da1('0x2')],'get':function(){var _0x2c3cdd='';var _0x1c24e6=this[_0x9da1('0x3')]('savePath');if(_0x1c24e6){_0x2c3cdd=_0x1c24e6['substring'](_0x1c24e6['lastIndexOf']('.'));}return _0x2c3cdd;}}};
\ No newline at end of file
index fac30a9..ddc8814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92ea=['show','params','fields','include','catch','create','body','update','find','download','uniqueid','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','send','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','reject','then','destroy','end','error','stack','name','index','SquareRecording','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows'];(function(_0x18bfeb,_0xbb63d1){var _0x10b7b9=function(_0x354d0a){while(--_0x354d0a){_0x18bfeb['push'](_0x18bfeb['shift']());}};_0x10b7b9(++_0xbb63d1);}(_0x92ea,0x1a1));var _0xa92e=function(_0x43aaec,_0x5554e3){_0x43aaec=_0x43aaec-0x0;var _0x1c8447=_0x92ea[_0x43aaec];return _0x1c8447;};'use strict';var emlformat=require(_0xa92e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa92e('0x1'));var jsonpatch=require(_0xa92e('0x2'));var rp=require('request-promise');var moment=require(_0xa92e('0x3'));var BPromise=require(_0xa92e('0x4'));var Mustache=require(_0xa92e('0x5'));var util=require('util');var path=require(_0xa92e('0x6'));var sox=require(_0xa92e('0x7'));var csv=require(_0xa92e('0x8'));var ejs=require(_0xa92e('0x9'));var fs=require('fs');var fs_extra=require(_0xa92e('0xa'));var _=require(_0xa92e('0xb'));var squel=require(_0xa92e('0xc'));var crypto=require(_0xa92e('0xd'));var jsforce=require(_0xa92e('0xe'));var deskjs=require(_0xa92e('0xf'));var toCsv=require(_0xa92e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa92e('0x10'));var qs=require(_0xa92e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa92e('0x12'));var logger=require(_0xa92e('0x13'))('api');var utils=require(_0xa92e('0x14'));var config=require(_0xa92e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45990b,_0x3e26c4){_0x3e26c4=_0x3e26c4||0xcc;return function(_0x50e04e){if(_0x50e04e){return _0x45990b[_0xa92e('0x16')](_0x3e26c4);}return _0x45990b[_0xa92e('0x17')](_0x3e26c4)['end']();};}function respondWithResult(_0x18297f,_0x3a3779){_0x3a3779=_0x3a3779||0xc8;return function(_0x21ba36){if(_0x21ba36){return _0x18297f[_0xa92e('0x17')](_0x3a3779)[_0xa92e('0x18')](_0x21ba36);}};}function respondWithFilteredResult(_0x1d1775,_0x3f4633){return function(_0x39f7ad){if(_0x39f7ad){var _0x309c21=typeof _0x3f4633[_0xa92e('0x19')]===_0xa92e('0x1a')&&typeof _0x3f4633['limit']===_0xa92e('0x1a');var _0x20a0f4=_0x39f7ad[_0xa92e('0x1b')];var _0x333838=_0x309c21?0x0:_0x3f4633[_0xa92e('0x19')];var _0x54101c=_0x309c21?_0x39f7ad[_0xa92e('0x1b')]:_0x3f4633['offset']+_0x3f4633['limit'];var _0x575081;if(_0x54101c>=_0x20a0f4){_0x54101c=_0x20a0f4;_0x575081=0xc8;}else{_0x575081=0xce;}_0x1d1775[_0xa92e('0x17')](_0x575081);return _0x1d1775[_0xa92e('0x1c')]('Content-Range',_0x333838+'-'+_0x54101c+'/'+_0x20a0f4)['json'](_0x39f7ad);}return null;};}function patchUpdates(_0xfa24da){return function(_0x5c2e98){try{jsonpatch['apply'](_0x5c2e98,_0xfa24da,!![]);}catch(_0x32becd){return BPromise[_0xa92e('0x1d')](_0x32becd);}return _0x5c2e98['save']();};}function saveUpdates(_0x3fc0e5,_0x456be8){return function(_0x5090b2){if(_0x5090b2){return _0x5090b2['update'](_0x3fc0e5)[_0xa92e('0x1e')](function(_0x3de3c9){return _0x3de3c9;});}return null;};}function removeEntity(_0x10d042,_0x274b1e){return function(_0x488b89){if(_0x488b89){return _0x488b89[_0xa92e('0x1f')]()['then'](function(){_0x10d042[_0xa92e('0x17')](0xcc)[_0xa92e('0x20')]();});}};}function handleEntityNotFound(_0x55b7da,_0x1dbbd5){return function(_0x18a02c){if(!_0x18a02c){_0x55b7da[_0xa92e('0x16')](0x194);}return _0x18a02c;};}function handleError(_0x565a8f,_0x511d6a){_0x511d6a=_0x511d6a||0x1f4;return function(_0x53007c){logger[_0xa92e('0x21')](_0x53007c[_0xa92e('0x22')]);if(_0x53007c[_0xa92e('0x23')]){delete _0x53007c[_0xa92e('0x23')];}_0x565a8f['status'](_0x511d6a)['send'](_0x53007c);};}exports[_0xa92e('0x24')]=function(_0x1009a4,_0x40cc5c){var _0x527f43={},_0xefd22={},_0x590933={'count':0x0,'rows':[]};var _0x129c87=_['map'](db[_0xa92e('0x25')][_0xa92e('0x26')],function(_0x324653){return{'name':_0x324653['fieldName'],'type':_0x324653[_0xa92e('0x27')][_0xa92e('0x28')]};});_0xefd22['model']=_[_0xa92e('0x29')](_0x129c87,'name');_0xefd22[_0xa92e('0x2a')]=_[_0xa92e('0x2b')](_0x1009a4[_0xa92e('0x2a')]);_0xefd22[_0xa92e('0x2c')]=_[_0xa92e('0x2d')](_0xefd22[_0xa92e('0x2e')],_0xefd22[_0xa92e('0x2a')]);_0x527f43[_0xa92e('0x2f')]=_[_0xa92e('0x2d')](_0xefd22[_0xa92e('0x2e')],qs['fields'](_0x1009a4[_0xa92e('0x2a')]['fields']));_0x527f43['attributes']=_0x527f43[_0xa92e('0x2f')][_0xa92e('0x30')]?_0x527f43[_0xa92e('0x2f')]:_0xefd22[_0xa92e('0x2e')];if(!_0x1009a4[_0xa92e('0x2a')][_0xa92e('0x31')](_0xa92e('0x32'))){_0x527f43['limit']=qs[_0xa92e('0x33')](_0x1009a4[_0xa92e('0x2a')]['limit']);_0x527f43['offset']=qs[_0xa92e('0x19')](_0x1009a4['query']['offset']);}_0x527f43[_0xa92e('0x34')]=qs[_0xa92e('0x35')](_0x1009a4[_0xa92e('0x2a')][_0xa92e('0x35')]);_0x527f43[_0xa92e('0x36')]=qs[_0xa92e('0x2c')](_[_0xa92e('0x37')](_0x1009a4[_0xa92e('0x2a')],_0xefd22[_0xa92e('0x2c')]),_0x129c87);if(_0x1009a4[_0xa92e('0x2a')][_0xa92e('0x38')]){_0x527f43[_0xa92e('0x36')]=_['merge'](_0x527f43[_0xa92e('0x36')],{'$or':_[_0xa92e('0x29')](_0x129c87,function(_0x2d3fc3){if(_0x2d3fc3[_0xa92e('0x27')]!==_0xa92e('0x39')){var _0x431253={};_0x431253[_0x2d3fc3[_0xa92e('0x23')]]={'$like':'%'+_0x1009a4['query'][_0xa92e('0x38')]+'%'};return _0x431253;}})});}_0x527f43=_[_0xa92e('0x3a')]({},_0x527f43,_0x1009a4[_0xa92e('0x3b')]);var _0x2f96a0={'where':_0x527f43[_0xa92e('0x36')]};return db['SquareRecording']['count'](_0x2f96a0)[_0xa92e('0x1e')](function(_0x5a35f8){_0x590933[_0xa92e('0x1b')]=_0x5a35f8;if(_0x1009a4[_0xa92e('0x2a')][_0xa92e('0x3c')]){_0x527f43['include']=[{'all':!![]}];}return db[_0xa92e('0x25')][_0xa92e('0x3d')](_0x527f43);})['then'](function(_0x1bbdae){_0x590933[_0xa92e('0x3e')]=_0x1bbdae;return _0x590933;})[_0xa92e('0x1e')](respondWithFilteredResult(_0x40cc5c,_0x527f43))['catch'](handleError(_0x40cc5c,null));};exports[_0xa92e('0x3f')]=function(_0x5c4015,_0x1a6f01){var _0x21e3f8={'raw':!![],'where':{'id':_0x5c4015[_0xa92e('0x40')]['id']}},_0x3e4c90={};_0x3e4c90[_0xa92e('0x2e')]=_[_0xa92e('0x2b')](db['SquareRecording'][_0xa92e('0x26')]);_0x3e4c90[_0xa92e('0x2a')]=_[_0xa92e('0x2b')](_0x5c4015[_0xa92e('0x2a')]);_0x3e4c90[_0xa92e('0x2c')]=_[_0xa92e('0x2d')](_0x3e4c90['model'],_0x3e4c90['query']);_0x21e3f8[_0xa92e('0x2f')]=_[_0xa92e('0x2d')](_0x3e4c90[_0xa92e('0x2e')],qs[_0xa92e('0x41')](_0x5c4015['query'][_0xa92e('0x41')]));_0x21e3f8[_0xa92e('0x2f')]=_0x21e3f8[_0xa92e('0x2f')]['length']?_0x21e3f8[_0xa92e('0x2f')]:_0x3e4c90[_0xa92e('0x2e')];if(_0x5c4015[_0xa92e('0x2a')][_0xa92e('0x3c')]){_0x21e3f8[_0xa92e('0x42')]=[{'all':!![]}];}_0x21e3f8=_[_0xa92e('0x3a')]({},_0x21e3f8,_0x5c4015[_0xa92e('0x3b')]);return db[_0xa92e('0x25')]['find'](_0x21e3f8)['then'](handleEntityNotFound(_0x1a6f01,null))[_0xa92e('0x1e')](respondWithResult(_0x1a6f01,null))[_0xa92e('0x43')](handleError(_0x1a6f01,null));};exports[_0xa92e('0x44')]=function(_0x4ce151,_0x1edd42){return db[_0xa92e('0x25')][_0xa92e('0x44')](_0x4ce151[_0xa92e('0x45')],{})[_0xa92e('0x1e')](respondWithResult(_0x1edd42,0xc9))[_0xa92e('0x43')](handleError(_0x1edd42,null));};exports[_0xa92e('0x46')]=function(_0x4e85be,_0x2311d1){if(_0x4e85be[_0xa92e('0x45')]['id']){delete _0x4e85be['body']['id'];}return db[_0xa92e('0x25')][_0xa92e('0x47')]({'where':{'id':_0x4e85be[_0xa92e('0x40')]['id']}})[_0xa92e('0x1e')](handleEntityNotFound(_0x2311d1,null))[_0xa92e('0x1e')](saveUpdates(_0x4e85be['body'],null))[_0xa92e('0x1e')](respondWithResult(_0x2311d1,null))[_0xa92e('0x43')](handleError(_0x2311d1,null));};exports[_0xa92e('0x48')]=function(_0x4552f2,_0x48eda9,_0x2bfc69){var _0x372515=require('../../components/encryptor');var _0x951ff2=![];var _0x35b40d={};if(_0x4552f2[_0xa92e('0x2a')]['type']&&_0x4552f2['query'][_0xa92e('0x27')]===_0xa92e('0x49')){_0x35b40d[_0xa92e('0x49')]=_0x4552f2[_0xa92e('0x40')]['id'];}else{_0x35b40d['id']=_0x4552f2[_0xa92e('0x40')]['id'];}return db[_0xa92e('0x25')][_0xa92e('0x47')]({'where':_0x35b40d,'attributes':['id','savePath',_0xa92e('0x4a')],'raw':!![]})[_0xa92e('0x1e')](handleEntityNotFound(_0x48eda9,null))[_0xa92e('0x1e')](function(_0x4daaf2){if(_0x4daaf2){var _0x3c2c5b=_0x4daaf2['savePath'];var _0x38c4fc=util[_0xa92e('0x4b')](_0xa92e('0x4c'),_0x3c2c5b);if(fs[_0xa92e('0x4d')](_0x38c4fc)){_0x951ff2=!![];return _0x372515[_0xa92e('0x4e')](_0x38c4fc,_0x3c2c5b,config[_0xa92e('0x4f')][_0xa92e('0x50')])[_0xa92e('0x1e')](function(){return _0x4daaf2;});}return _0x4daaf2;}})['then'](function(_0x3ebd11){if(_0x3ebd11){var _0x34f9cd=_0x3ebd11[_0xa92e('0x51')];if(!fs['existsSync'](_0x34f9cd)){throw new db[(_0xa92e('0x52'))][(_0xa92e('0x53'))](_0xa92e('0x54'));}if(_0x3ebd11[_0xa92e('0x4a')]){return _0x48eda9[_0xa92e('0x48')](_0x34f9cd,_0x3ebd11[_0xa92e('0x4a')]+path['extname'](_0x34f9cd),function(){if(_0x951ff2){fs[_0xa92e('0x55')](_0x34f9cd);}});}else{return _0x48eda9[_0xa92e('0x48')](_0x34f9cd,function(_0x3cc123){if(_0x951ff2){fs[_0xa92e('0x55')](_0x34f9cd);}});}}})[_0xa92e('0x43')](function(_0x1b238f){if(_0x1b238f[_0xa92e('0x56')]===_0xa92e('0x54')){_0x48eda9[_0xa92e('0x17')](0x194)[_0xa92e('0x57')]('Not\x20found');}else{return handleError(_0x48eda9,null);}});};exports[_0xa92e('0x1f')]=function(_0x30c41d,_0x5ce651){return db[_0xa92e('0x25')][_0xa92e('0x47')]({'where':{'id':_0x30c41d[_0xa92e('0x40')]['id']}})[_0xa92e('0x1e')](function(_0x18efb2){if(_[_0xa92e('0x58')](_0x18efb2)){throw new ReferenceError(_0xa92e('0x59'));}return _0x18efb2;})[_0xa92e('0x1e')](function(_0x406548){var _0xa266fa=_0x406548[_0xa92e('0x51')];logger[_0xa92e('0x5a')](_0xa92e('0x5b'),_0xa266fa);if(!_['isNil'](_0x406548[_0xa92e('0x51')])&&fs['existsSync'](_0xa266fa)){logger['info']('File:\x20\x22'+_0xa266fa+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa92e('0x5c')](_0xa266fa);}_0xa266fa=_0xa266fa+_0xa92e('0x5d');if(!_[_0xa92e('0x58')](_0x406548[_0xa92e('0x51')])&&fs['existsSync'](_0xa266fa)){logger[_0xa92e('0x5a')](_0xa92e('0x5e')+_0xa266fa+_0xa92e('0x5f'));fs[_0xa92e('0x5c')](_0xa266fa);}return _0x406548;})['then'](function(_0x1257ea){if(!_0x1257ea)throw new InternalError();return _0x1257ea[_0xa92e('0x1f')]();})[_0xa92e('0x1e')](function(){_0x5ce651[_0xa92e('0x17')](0xcc)[_0xa92e('0x20')]();})['catch'](handleError(_0x5ce651,null));};
\ No newline at end of file
+var _0x9131=['fs-extra','lodash','squel','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','status','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','stack','name','index','SquareRecording','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','update','body','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','download','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2a972c,_0x130e2e){var _0x3f832f=function(_0x36e5a1){while(--_0x36e5a1){_0x2a972c['push'](_0x2a972c['shift']());}};_0x3f832f(++_0x130e2e);}(_0x9131,0x181));var _0x1913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9131[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1913('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1913('0x1'));var rp=require(_0x1913('0x2'));var moment=require(_0x1913('0x3'));var BPromise=require(_0x1913('0x4'));var Mustache=require(_0x1913('0x5'));var util=require(_0x1913('0x6'));var path=require(_0x1913('0x7'));var sox=require(_0x1913('0x8'));var csv=require(_0x1913('0x9'));var ejs=require(_0x1913('0xa'));var fs=require('fs');var fs_extra=require(_0x1913('0xb'));var _=require(_0x1913('0xc'));var squel=require(_0x1913('0xd'));var crypto=require('crypto');var jsforce=require(_0x1913('0xe'));var deskjs=require(_0x1913('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1913('0x10'));var authService=require(_0x1913('0x11'));var qs=require(_0x1913('0x12'));var as=require(_0x1913('0x13'));var hardwareService=require(_0x1913('0x14'));var logger=require('../../config/logger')(_0x1913('0x15'));var utils=require(_0x1913('0x16'));var config=require(_0x1913('0x17'));var licenseUtil=require(_0x1913('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bcdb2,_0x332349){_0x332349=_0x332349||0xcc;return function(_0x3f125f){if(_0x3f125f){return _0x5bcdb2[_0x1913('0x19')](_0x332349);}return _0x5bcdb2[_0x1913('0x1a')](_0x332349)['end']();};}function respondWithResult(_0x451cb6,_0x387667){_0x387667=_0x387667||0xc8;return function(_0x8b8669){if(_0x8b8669){return _0x451cb6['status'](_0x387667)['json'](_0x8b8669);}};}function respondWithFilteredResult(_0xfb86fc,_0x23ba06){return function(_0xae302d){if(_0xae302d){var _0x193c15=typeof _0x23ba06[_0x1913('0x1b')]===_0x1913('0x1c')&&typeof _0x23ba06[_0x1913('0x1d')]===_0x1913('0x1c');var _0x4269ed=_0xae302d[_0x1913('0x1e')];var _0x2dd6c4=_0x193c15?0x0:_0x23ba06[_0x1913('0x1b')];var _0x14cee7=_0x193c15?_0xae302d[_0x1913('0x1e')]:_0x23ba06[_0x1913('0x1b')]+_0x23ba06['limit'];var _0x14636c;if(_0x14cee7>=_0x4269ed){_0x14cee7=_0x4269ed;_0x14636c=0xc8;}else{_0x14636c=0xce;}_0xfb86fc['status'](_0x14636c);return _0xfb86fc['set']('Content-Range',_0x2dd6c4+'-'+_0x14cee7+'/'+_0x4269ed)['json'](_0xae302d);}return null;};}function patchUpdates(_0x5b65fb){return function(_0x184b64){try{jsonpatch[_0x1913('0x1f')](_0x184b64,_0x5b65fb,!![]);}catch(_0x2953cd){return BPromise[_0x1913('0x20')](_0x2953cd);}return _0x184b64[_0x1913('0x21')]();};}function saveUpdates(_0x523537,_0x111a0f){return function(_0x17c9d6){if(_0x17c9d6){return _0x17c9d6['update'](_0x523537)[_0x1913('0x22')](function(_0x330835){return _0x330835;});}return null;};}function removeEntity(_0x332bc4,_0x3ce84e){return function(_0x1c95c5){if(_0x1c95c5){return _0x1c95c5[_0x1913('0x23')]()[_0x1913('0x22')](function(){_0x332bc4[_0x1913('0x1a')](0xcc)[_0x1913('0x24')]();});}};}function handleEntityNotFound(_0x3afc32,_0x404950){return function(_0x23b279){if(!_0x23b279){_0x3afc32['sendStatus'](0x194);}return _0x23b279;};}function handleError(_0x2c93a8,_0x52af92){_0x52af92=_0x52af92||0x1f4;return function(_0x49d8c0){logger[_0x1913('0x25')](_0x49d8c0[_0x1913('0x26')]);if(_0x49d8c0[_0x1913('0x27')]){delete _0x49d8c0[_0x1913('0x27')];}_0x2c93a8[_0x1913('0x1a')](_0x52af92)['send'](_0x49d8c0);};}exports[_0x1913('0x28')]=function(_0x1aef87,_0x1458c7){var _0x227489={},_0x49d57f={},_0x8147bf={'count':0x0,'rows':[]};var _0x36e64e=_['map'](db[_0x1913('0x29')][_0x1913('0x2a')],function(_0x4fecb3){return{'name':_0x4fecb3[_0x1913('0x2b')],'type':_0x4fecb3[_0x1913('0x2c')]['key']};});_0x49d57f[_0x1913('0x2d')]=_[_0x1913('0x2e')](_0x36e64e,_0x1913('0x27'));_0x49d57f[_0x1913('0x2f')]=_['keys'](_0x1aef87[_0x1913('0x2f')]);_0x49d57f[_0x1913('0x30')]=_['intersection'](_0x49d57f[_0x1913('0x2d')],_0x49d57f[_0x1913('0x2f')]);_0x227489[_0x1913('0x31')]=_[_0x1913('0x32')](_0x49d57f['model'],qs[_0x1913('0x33')](_0x1aef87['query'][_0x1913('0x33')]));_0x227489[_0x1913('0x31')]=_0x227489[_0x1913('0x31')][_0x1913('0x34')]?_0x227489[_0x1913('0x31')]:_0x49d57f[_0x1913('0x2d')];if(!_0x1aef87[_0x1913('0x2f')][_0x1913('0x35')]('nolimit')){_0x227489[_0x1913('0x1d')]=qs['limit'](_0x1aef87['query'][_0x1913('0x1d')]);_0x227489[_0x1913('0x1b')]=qs['offset'](_0x1aef87[_0x1913('0x2f')][_0x1913('0x1b')]);}_0x227489[_0x1913('0x36')]=qs['sort'](_0x1aef87['query'][_0x1913('0x37')]);_0x227489[_0x1913('0x38')]=qs['filters'](_[_0x1913('0x39')](_0x1aef87[_0x1913('0x2f')],_0x49d57f['filters']),_0x36e64e);if(_0x1aef87[_0x1913('0x2f')][_0x1913('0x3a')]){_0x227489['where']=_['merge'](_0x227489[_0x1913('0x38')],{'$or':_[_0x1913('0x2e')](_0x36e64e,function(_0x381d0c){if(_0x381d0c[_0x1913('0x2c')]!==_0x1913('0x3b')){var _0x2bbed9={};_0x2bbed9[_0x381d0c[_0x1913('0x27')]]={'$like':'%'+_0x1aef87[_0x1913('0x2f')][_0x1913('0x3a')]+'%'};return _0x2bbed9;}})});}_0x227489=_['merge']({},_0x227489,_0x1aef87[_0x1913('0x3c')]);var _0x5489f4={'where':_0x227489['where']};return db[_0x1913('0x29')][_0x1913('0x1e')](_0x5489f4)['then'](function(_0x8bcd8){_0x8147bf['count']=_0x8bcd8;if(_0x1aef87[_0x1913('0x2f')][_0x1913('0x3d')]){_0x227489[_0x1913('0x3e')]=[{'all':!![]}];}return db[_0x1913('0x29')][_0x1913('0x3f')](_0x227489);})['then'](function(_0x43e2bc){_0x8147bf[_0x1913('0x40')]=_0x43e2bc;return _0x8147bf;})['then'](respondWithFilteredResult(_0x1458c7,_0x227489))[_0x1913('0x41')](handleError(_0x1458c7,null));};exports[_0x1913('0x42')]=function(_0x57bd68,_0x1f9683){var _0x2f08bd={'raw':!![],'where':{'id':_0x57bd68[_0x1913('0x43')]['id']}},_0x421b2f={};_0x421b2f[_0x1913('0x2d')]=_['keys'](db[_0x1913('0x29')][_0x1913('0x2a')]);_0x421b2f['query']=_[_0x1913('0x44')](_0x57bd68['query']);_0x421b2f[_0x1913('0x30')]=_['intersection'](_0x421b2f[_0x1913('0x2d')],_0x421b2f[_0x1913('0x2f')]);_0x2f08bd['attributes']=_[_0x1913('0x32')](_0x421b2f[_0x1913('0x2d')],qs[_0x1913('0x33')](_0x57bd68['query']['fields']));_0x2f08bd[_0x1913('0x31')]=_0x2f08bd['attributes'][_0x1913('0x34')]?_0x2f08bd[_0x1913('0x31')]:_0x421b2f['model'];if(_0x57bd68[_0x1913('0x2f')][_0x1913('0x3d')]){_0x2f08bd[_0x1913('0x3e')]=[{'all':!![]}];}_0x2f08bd=_[_0x1913('0x45')]({},_0x2f08bd,_0x57bd68[_0x1913('0x3c')]);return db[_0x1913('0x29')][_0x1913('0x46')](_0x2f08bd)[_0x1913('0x22')](handleEntityNotFound(_0x1f9683,null))[_0x1913('0x22')](respondWithResult(_0x1f9683,null))[_0x1913('0x41')](handleError(_0x1f9683,null));};exports['create']=function(_0x4b8f6e,_0x42d693){return db[_0x1913('0x29')][_0x1913('0x47')](_0x4b8f6e['body'],{})[_0x1913('0x22')](respondWithResult(_0x42d693,0xc9))['catch'](handleError(_0x42d693,null));};exports[_0x1913('0x48')]=function(_0x1b98ad,_0x3245e5){if(_0x1b98ad[_0x1913('0x49')]['id']){delete _0x1b98ad['body']['id'];}return db[_0x1913('0x29')]['find']({'where':{'id':_0x1b98ad[_0x1913('0x43')]['id']}})[_0x1913('0x22')](handleEntityNotFound(_0x3245e5,null))[_0x1913('0x22')](saveUpdates(_0x1b98ad[_0x1913('0x49')],null))[_0x1913('0x22')](respondWithResult(_0x3245e5,null))[_0x1913('0x41')](handleError(_0x3245e5,null));};exports['download']=function(_0x1eec23,_0x4aa2e9,_0x49eac1){var _0x37015b=require(_0x1913('0x4a'));var _0x415422=![];var _0x367ded={};if(_0x1eec23[_0x1913('0x2f')][_0x1913('0x2c')]&&_0x1eec23[_0x1913('0x2f')][_0x1913('0x2c')]===_0x1913('0x4b')){_0x367ded[_0x1913('0x4b')]=_0x1eec23[_0x1913('0x43')]['id'];}else{_0x367ded['id']=_0x1eec23[_0x1913('0x43')]['id'];}return db['SquareRecording'][_0x1913('0x46')]({'where':_0x367ded,'attributes':['id','savePath',_0x1913('0x4c')],'raw':!![]})[_0x1913('0x22')](handleEntityNotFound(_0x4aa2e9,null))[_0x1913('0x22')](function(_0x3a4cbe){if(_0x3a4cbe){var _0x1086cf=_0x3a4cbe[_0x1913('0x4d')];var _0x542b13=util[_0x1913('0x4e')](_0x1913('0x4f'),_0x1086cf);if(fs[_0x1913('0x50')](_0x542b13)){_0x415422=!![];return _0x37015b[_0x1913('0x51')](_0x542b13,_0x1086cf,config[_0x1913('0x52')][_0x1913('0x53')])[_0x1913('0x22')](function(){return _0x3a4cbe;});}return _0x3a4cbe;}})[_0x1913('0x22')](function(_0x2984be){if(_0x2984be){var _0x9de540=_0x2984be['savePath'];if(!fs[_0x1913('0x50')](_0x9de540)){throw new db['Sequelize'][(_0x1913('0x54'))]('SquareRecording\x20not\x20found');}if(_0x2984be[_0x1913('0x4c')]){return _0x4aa2e9[_0x1913('0x55')](_0x9de540,_0x2984be[_0x1913('0x4c')]+path[_0x1913('0x56')](_0x9de540),function(){if(_0x415422){fs[_0x1913('0x57')](_0x9de540);}});}else{return _0x4aa2e9[_0x1913('0x55')](_0x9de540,function(_0x3698d7){if(_0x415422){fs[_0x1913('0x57')](_0x9de540);}});}}})[_0x1913('0x41')](function(_0x3e5a19){if(_0x3e5a19[_0x1913('0x58')]===_0x1913('0x59')){_0x4aa2e9[_0x1913('0x1a')](0x194)[_0x1913('0x5a')](_0x1913('0x5b'));}else{return handleError(_0x4aa2e9,null);}});};exports[_0x1913('0x23')]=function(_0x27ef3e,_0x5ae5a1){return db['SquareRecording'][_0x1913('0x46')]({'where':{'id':_0x27ef3e[_0x1913('0x43')]['id']}})['then'](function(_0x29dbf4){if(_['isNil'](_0x29dbf4)){throw new ReferenceError(_0x1913('0x5c'));}return _0x29dbf4;})['then'](function(_0xe32eb1){var _0x185934=_0xe32eb1[_0x1913('0x4d')];logger[_0x1913('0x5d')](_0x1913('0x5e'),_0x185934);if(!_[_0x1913('0x5f')](_0xe32eb1[_0x1913('0x4d')])&&fs['existsSync'](_0x185934)){logger['info'](_0x1913('0x60')+_0x185934+_0x1913('0x61'));fs['unlinkSync'](_0x185934);}_0x185934=_0x185934+'.cypher';if(!_[_0x1913('0x5f')](_0xe32eb1[_0x1913('0x4d')])&&fs[_0x1913('0x50')](_0x185934)){logger['info'](_0x1913('0x60')+_0x185934+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1913('0x62')](_0x185934);}return _0xe32eb1;})[_0x1913('0x22')](function(_0x447b6f){if(!_0x447b6f)throw new InternalError();return _0x447b6f[_0x1913('0x23')]();})[_0x1913('0x22')](function(){_0x5ae5a1['status'](0xcc)['end']();})[_0x1913('0x41')](handleError(_0x5ae5a1,null));};
\ No newline at end of file
index 175c1c8..b4bf9e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11c1=['exports','define','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x4753c4,_0x4c25d9){var _0x4ae0f3=function(_0x3b961d){while(--_0x3b961d){_0x4753c4['push'](_0x4753c4['shift']());}};_0x4ae0f3(++_0x4c25d9);}(_0x11c1,0x1cb));var _0x111c=function(_0x5b5945,_0x3e969d){_0x5b5945=_0x5b5945-0x0;var _0x419468=_0x11c1[_0x5b5945];return _0x419468;};'use strict';var _=require(_0x111c('0x0'));var util=require('util');var logger=require(_0x111c('0x1'))(_0x111c('0x2'));var moment=require(_0x111c('0x3'));var BPromise=require(_0x111c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x111c('0x5'));var rimraf=require(_0x111c('0x6'));var config=require(_0x111c('0x7'));var attributes=require(_0x111c('0x8'));module[_0x111c('0x9')]=function(_0x190036,_0x487ac7){return _0x190036[_0x111c('0xa')](_0x111c('0xb'),attributes,{'tableName':_0x111c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5c1=['bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger'];(function(_0x1d69d2,_0x2ef689){var _0x10b3ba=function(_0x2651f8){while(--_0x2651f8){_0x1d69d2['push'](_0x1d69d2['shift']());}};_0x10b3ba(++_0x2ef689);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x80f09a,_0x1296b7){_0x80f09a=_0x80f09a-0x0;var _0x528e94=_0xa5c1[_0x80f09a];return _0x528e94;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var logger=require(_0x1a5c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1a5c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a5c('0x4'));var rimraf=require(_0x1a5c('0x5'));var config=require(_0x1a5c('0x6'));var attributes=require(_0x1a5c('0x7'));module[_0x1a5c('0x8')]=function(_0x3c3558,_0x4d7377){return _0x3c3558[_0x1a5c('0x9')]('SquareRecording',attributes,{'tableName':_0x1a5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8a347ce..90fc201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91c8=['info','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1fc318,_0x57f410){var _0x9fe831=function(_0x319ffb){while(--_0x319ffb){_0x1fc318['push'](_0x1fc318['shift']());}};_0x9fe831(++_0x57f410);}(_0x91c8,0x93));var _0x891c=function(_0xbe7a4f,_0xe04118){_0xbe7a4f=_0xbe7a4f-0x0;var _0x2fcf40=_0x91c8[_0xbe7a4f];return _0x2fcf40;};'use strict';var _=require(_0x891c('0x0'));var util=require('util');var moment=require(_0x891c('0x1'));var BPromise=require(_0x891c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x891c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x891c('0x4'));var logger=require(_0x891c('0x5'))(_0x891c('0x6'));var config=require(_0x891c('0x7'));var jayson=require(_0x891c('0x8'));var client=jayson[_0x891c('0x9')][_0x891c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13773b,_0x454aab,_0x45e28f){return new BPromise(function(_0x255dc5,_0x220ca3){return client[_0x891c('0xb')](_0x13773b,_0x45e28f)[_0x891c('0xc')](function(_0x44187c){logger['info'](_0x891c('0xd'),_0x454aab,_0x891c('0xe'));logger[_0x891c('0xf')](_0x891c('0x10'),_0x454aab,'request\x20sent',JSON[_0x891c('0x11')](_0x44187c));if(_0x44187c[_0x891c('0x12')]){if(_0x44187c[_0x891c('0x12')][_0x891c('0x13')]===0x1f4){logger[_0x891c('0x12')](_0x891c('0xd'),_0x454aab,_0x44187c[_0x891c('0x12')]['message']);return _0x220ca3(_0x44187c[_0x891c('0x12')][_0x891c('0x14')]);}logger[_0x891c('0x12')](_0x891c('0xd'),_0x454aab,_0x44187c[_0x891c('0x12')][_0x891c('0x14')]);return _0x255dc5(_0x44187c[_0x891c('0x12')][_0x891c('0x14')]);}else{logger[_0x891c('0x15')](_0x891c('0xd'),_0x454aab,_0x891c('0xe'));_0x255dc5(_0x44187c['result'][_0x891c('0x14')]);}})[_0x891c('0x16')](function(_0x5046fa){logger[_0x891c('0x12')](_0x891c('0xd'),_0x454aab,_0x5046fa);_0x220ca3(_0x5046fa);});});}exports[_0x891c('0x17')]=function(_0x4e4715){var _0x583eb0=this;return new Promise(function(_0xf22076,_0x197513){return db[_0x891c('0x18')][_0x891c('0x19')](_0x4e4715['body'],{'raw':_0x4e4715['options']?_0x4e4715[_0x891c('0x1a')][_0x891c('0x1b')]===undefined?!![]:![]:!![]})[_0x891c('0xc')](function(_0x1ba955){logger[_0x891c('0x15')](_0x891c('0x17'),_0x4e4715);logger[_0x891c('0xf')]('CreateSquareRecording',_0x4e4715,JSON[_0x891c('0x11')](_0x1ba955));_0xf22076(_0x1ba955);})[_0x891c('0x16')](function(_0x512a7d){logger[_0x891c('0x12')](_0x891c('0x17'),_0x512a7d['message'],_0x4e4715);_0x197513(_0x583eb0[_0x891c('0x12')](0x1f4,_0x512a7d[_0x891c('0x14')]));});});};
\ No newline at end of file
+var _0xc82e=['then','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x4c82a0,_0x2f290c){var _0x15b717=function(_0x4f9ddd){while(--_0x4f9ddd){_0x4c82a0['push'](_0x4c82a0['shift']());}};_0x15b717(++_0x2f290c);}(_0xc82e,0x86));var _0xec82=function(_0xd75dcc,_0x5b4094){_0xd75dcc=_0xd75dcc-0x0;var _0x3f96cb=_0xc82e[_0xd75dcc];return _0x3f96cb;};'use strict';var _=require(_0xec82('0x0'));var util=require(_0xec82('0x1'));var moment=require('moment');var BPromise=require(_0xec82('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec82('0x3'))['db'];var utils=require(_0xec82('0x4'));var logger=require('../../config/logger')(_0xec82('0x5'));var config=require(_0xec82('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec82('0x7')][_0xec82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56201e,_0x50f9c9,_0x24d720){return new BPromise(function(_0x2f145b,_0x13514b){return client[_0xec82('0x9')](_0x56201e,_0x24d720)[_0xec82('0xa')](function(_0x150dbb){logger[_0xec82('0xb')]('SquareRecording,\x20%s,\x20%s',_0x50f9c9,'request\x20sent');logger[_0xec82('0xc')](_0xec82('0xd'),_0x50f9c9,_0xec82('0xe'),JSON[_0xec82('0xf')](_0x150dbb));if(_0x150dbb[_0xec82('0x10')]){if(_0x150dbb['error']['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x50f9c9,_0x150dbb[_0xec82('0x10')]['message']);return _0x13514b(_0x150dbb[_0xec82('0x10')][_0xec82('0x11')]);}logger[_0xec82('0x10')]('SquareRecording,\x20%s,\x20%s',_0x50f9c9,_0x150dbb[_0xec82('0x10')]['message']);return _0x2f145b(_0x150dbb[_0xec82('0x10')][_0xec82('0x11')]);}else{logger[_0xec82('0xb')]('SquareRecording,\x20%s,\x20%s',_0x50f9c9,_0xec82('0xe'));_0x2f145b(_0x150dbb['result']['message']);}})[_0xec82('0x12')](function(_0x199cd6){logger[_0xec82('0x10')]('SquareRecording,\x20%s,\x20%s',_0x50f9c9,_0x199cd6);_0x13514b(_0x199cd6);});});}exports[_0xec82('0x13')]=function(_0x134241){var _0x279a51=this;return new Promise(function(_0x247722,_0x2dc074){return db[_0xec82('0x14')]['create'](_0x134241[_0xec82('0x15')],{'raw':_0x134241[_0xec82('0x16')]?_0x134241['options'][_0xec82('0x17')]===undefined?!![]:![]:!![]})[_0xec82('0xa')](function(_0xf2b41b){logger[_0xec82('0xb')](_0xec82('0x13'),_0x134241);logger[_0xec82('0xc')]('CreateSquareRecording',_0x134241,JSON['stringify'](_0xf2b41b));_0x247722(_0xf2b41b);})['catch'](function(_0x2e0f19){logger[_0xec82('0x10')](_0xec82('0x13'),_0x2e0f19[_0xec82('0x11')],_0x134241);_0x2dc074(_0x279a51[_0xec82('0x10')](0x1f4,_0x2e0f19[_0xec82('0x11')]));});});};
\ No newline at end of file
index e6d7ff9..8887e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x5c661d,_0xf54ab7){var _0x2fd67c=function(_0x49abf0){while(--_0x49abf0){_0x5c661d['push'](_0x5c661d['shift']());}};_0x2fd67c(++_0xf54ab7);}(_0xe706,0xa3));var _0x6e70=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xe706[_0x29dda1];return _0x21b0ef;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x2a221f,_0x5be675){var _0x1cb288=function(_0x4017b9){while(--_0x4017b9){_0x2a221f['push'](_0x2a221f['shift']());}};_0x1cb288(++_0x5be675);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 5478f51..4e218d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ae=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x17be35,_0x4a1f36){var _0xda8052=function(_0x58e65c){while(--_0x58e65c){_0x17be35['push'](_0x17be35['shift']());}};_0xda8052(++_0x4a1f36);}(_0x71ae,0x1e8));var _0xe71a=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x71ae[_0x9307ea];return _0x295554;};'use strict';var Sequelize=require(_0xe71a('0x0'));module[_0xe71a('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xe71a('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe71a('0x2')]},'language':{'type':Sequelize[_0xe71a('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe71a('0x2')]},'version':{'type':Sequelize[_0xe71a('0x2')]},'callerid':{'type':Sequelize[_0xe71a('0x2')]},'calleridname':{'type':Sequelize[_0xe71a('0x2')]},'callingpres':{'type':Sequelize[_0xe71a('0x2')]},'callingani2':{'type':Sequelize[_0xe71a('0x2')]},'callington':{'type':Sequelize[_0xe71a('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xe71a('0x2')]},'rdnis':{'type':Sequelize[_0xe71a('0x2')]},'context':{'type':Sequelize[_0xe71a('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe71a('0x2')]},'enhanced':{'type':Sequelize[_0xe71a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xe71a('0x2')]},'project_name':{'type':Sequelize[_0xe71a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe71a('0x3')]},'bot':{'type':Sequelize[_0xe71a('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb55d=['STRING','DATE','sequelize','exports'];(function(_0x513109,_0x464e1f){var _0x56f1d4=function(_0x2f6ec9){while(--_0x2f6ec9){_0x513109['push'](_0x513109['shift']());}};_0x56f1d4(++_0x464e1f);}(_0xb55d,0x15a));var _0xdb55=function(_0x222750,_0x4b6661){_0x222750=_0x222750-0x0;var _0x56e990=_0xb55d[_0x222750];return _0x56e990;};'use strict';var Sequelize=require(_0xdb55('0x0'));module[_0xdb55('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdb55('0x2')]},'language':{'type':Sequelize[_0xdb55('0x2')]},'type':{'type':Sequelize[_0xdb55('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xdb55('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xdb55('0x2')]},'callington':{'type':Sequelize[_0xdb55('0x2')]},'callingtns':{'type':Sequelize[_0xdb55('0x2')]},'dnid':{'type':Sequelize[_0xdb55('0x2')]},'rdnis':{'type':Sequelize[_0xdb55('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xdb55('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdb55('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xdb55('0x2')]},'joinAt':{'type':Sequelize[_0xdb55('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index ea04726..8342f9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x055e=['limit','set','apply','reject','save','update','then','destroy','name','send','index','map','SquareReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','params','includeAll','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x055e,0x1da));var _0xe055=function(_0x2d0550,_0x388c18){_0x2d0550=_0x2d0550-0x0;var _0x310cb3=_0x055e[_0x2d0550];return _0x310cb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe055('0x0'));var zipdir=require(_0xe055('0x1'));var jsonpatch=require(_0xe055('0x2'));var rp=require(_0xe055('0x3'));var moment=require(_0xe055('0x4'));var BPromise=require(_0xe055('0x5'));var Mustache=require(_0xe055('0x6'));var util=require(_0xe055('0x7'));var path=require(_0xe055('0x8'));var sox=require(_0xe055('0x9'));var csv=require('to-csv');var ejs=require(_0xe055('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe055('0xb'));var squel=require(_0xe055('0xc'));var crypto=require(_0xe055('0xd'));var jsforce=require(_0xe055('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe055('0xf'));var querystring=require('querystring');var Papa=require(_0xe055('0x10'));var Redis=require(_0xe055('0x11'));var authService=require(_0xe055('0x12'));var qs=require(_0xe055('0x13'));var as=require(_0xe055('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe055('0x15'))(_0xe055('0x16'));var utils=require(_0xe055('0x17'));var config=require(_0xe055('0x18'));var licenseUtil=require(_0xe055('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x473c5c,_0x35ecf4){_0x35ecf4=_0x35ecf4||0xcc;return function(_0x12c6f7){if(_0x12c6f7){return _0x473c5c['sendStatus'](_0x35ecf4);}return _0x473c5c['status'](_0x35ecf4)['end']();};}function respondWithResult(_0x163ef6,_0x34dd63){_0x34dd63=_0x34dd63||0xc8;return function(_0x391187){if(_0x391187){return _0x163ef6[_0xe055('0x1a')](_0x34dd63)[_0xe055('0x1b')](_0x391187);}};}function respondWithFilteredResult(_0x5928b6,_0x539c8b){return function(_0x30eeda){if(_0x30eeda){var _0x550d2d=typeof _0x539c8b[_0xe055('0x1c')]===_0xe055('0x1d')&&typeof _0x539c8b[_0xe055('0x1e')]===_0xe055('0x1d');var _0x529bd7=_0x30eeda['count'];var _0x5b4f3f=_0x550d2d?0x0:_0x539c8b[_0xe055('0x1c')];var _0x59db1c=_0x550d2d?_0x30eeda['count']:_0x539c8b[_0xe055('0x1c')]+_0x539c8b['limit'];var _0xd1406d;if(_0x59db1c>=_0x529bd7){_0x59db1c=_0x529bd7;_0xd1406d=0xc8;}else{_0xd1406d=0xce;}_0x5928b6[_0xe055('0x1a')](_0xd1406d);return _0x5928b6[_0xe055('0x1f')]('Content-Range',_0x5b4f3f+'-'+_0x59db1c+'/'+_0x529bd7)['json'](_0x30eeda);}return null;};}function patchUpdates(_0x2b6b6b){return function(_0x131a64){try{jsonpatch[_0xe055('0x20')](_0x131a64,_0x2b6b6b,!![]);}catch(_0x5b9e0a){return BPromise[_0xe055('0x21')](_0x5b9e0a);}return _0x131a64[_0xe055('0x22')]();};}function saveUpdates(_0x2d929d,_0x11b633){return function(_0x408451){if(_0x408451){return _0x408451[_0xe055('0x23')](_0x2d929d)[_0xe055('0x24')](function(_0x11d80e){return _0x11d80e;});}return null;};}function removeEntity(_0x4e2dae,_0x43ad3e){return function(_0x30c5dc){if(_0x30c5dc){return _0x30c5dc[_0xe055('0x25')]()[_0xe055('0x24')](function(){_0x4e2dae[_0xe055('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x113e85,_0x49fd86){return function(_0x4985ea){if(!_0x4985ea){_0x113e85['sendStatus'](0x194);}return _0x4985ea;};}function handleError(_0x1ad8d0,_0x137ddd){_0x137ddd=_0x137ddd||0x1f4;return function(_0x13e827){logger['error'](_0x13e827['stack']);if(_0x13e827['name']){delete _0x13e827[_0xe055('0x26')];}_0x1ad8d0['status'](_0x137ddd)[_0xe055('0x27')](_0x13e827);};}exports[_0xe055('0x28')]=function(_0x173feb,_0x3c74cc){var _0x100347={},_0x12eaee={},_0x2de7e5={'count':0x0,'rows':[]};var _0x3cfe1a=_[_0xe055('0x29')](db[_0xe055('0x2a')][_0xe055('0x2b')],function(_0x59de68){return{'name':_0x59de68['fieldName'],'type':_0x59de68[_0xe055('0x2c')]['key']};});_0x12eaee[_0xe055('0x2d')]=_['map'](_0x3cfe1a,_0xe055('0x26'));_0x12eaee['query']=_[_0xe055('0x2e')](_0x173feb[_0xe055('0x2f')]);_0x12eaee[_0xe055('0x30')]=_[_0xe055('0x31')](_0x12eaee[_0xe055('0x2d')],_0x12eaee['query']);_0x100347[_0xe055('0x32')]=_[_0xe055('0x31')](_0x12eaee['model'],qs['fields'](_0x173feb[_0xe055('0x2f')][_0xe055('0x33')]));_0x100347[_0xe055('0x32')]=_0x100347[_0xe055('0x32')][_0xe055('0x34')]?_0x100347['attributes']:_0x12eaee['model'];if(!_0x173feb[_0xe055('0x2f')]['hasOwnProperty']('nolimit')){_0x100347[_0xe055('0x1e')]=qs[_0xe055('0x1e')](_0x173feb[_0xe055('0x2f')][_0xe055('0x1e')]);_0x100347[_0xe055('0x1c')]=qs[_0xe055('0x1c')](_0x173feb['query'][_0xe055('0x1c')]);}_0x100347[_0xe055('0x35')]=qs[_0xe055('0x36')](_0x173feb[_0xe055('0x2f')][_0xe055('0x36')]);_0x100347[_0xe055('0x37')]=qs[_0xe055('0x30')](_[_0xe055('0x38')](_0x173feb[_0xe055('0x2f')],_0x12eaee[_0xe055('0x30')]),_0x3cfe1a);if(_0x173feb[_0xe055('0x2f')][_0xe055('0x39')]){_0x100347[_0xe055('0x37')]=_[_0xe055('0x3a')](_0x100347['where'],{'$or':_[_0xe055('0x29')](_0x3cfe1a,function(_0x51a91d){if(_0x51a91d[_0xe055('0x2c')]!==_0xe055('0x3b')){var _0x9f8f7c={};_0x9f8f7c[_0x51a91d['name']]={'$like':'%'+_0x173feb['query']['filter']+'%'};return _0x9f8f7c;}})});}_0x100347=_[_0xe055('0x3a')]({},_0x100347,_0x173feb[_0xe055('0x3c')]);var _0x1630e1={'where':_0x100347[_0xe055('0x37')]};return db[_0xe055('0x2a')][_0xe055('0x3d')](_0x1630e1)[_0xe055('0x24')](function(_0x308b80){_0x2de7e5['count']=_0x308b80;if(_0x173feb[_0xe055('0x2f')]['includeAll']){_0x100347[_0xe055('0x3e')]=[{'all':!![]}];}return db[_0xe055('0x2a')][_0xe055('0x3f')](_0x100347);})[_0xe055('0x24')](function(_0x360325){_0x2de7e5[_0xe055('0x40')]=_0x360325;return _0x2de7e5;})[_0xe055('0x24')](respondWithFilteredResult(_0x3c74cc,_0x100347))['catch'](handleError(_0x3c74cc,null));};exports['show']=function(_0x963320,_0x124a47){var _0x23b2fa={'raw':!![],'where':{'id':_0x963320[_0xe055('0x41')]['id']}},_0x380ef6={};_0x380ef6[_0xe055('0x2d')]=_['keys'](db[_0xe055('0x2a')][_0xe055('0x2b')]);_0x380ef6['query']=_[_0xe055('0x2e')](_0x963320[_0xe055('0x2f')]);_0x380ef6['filters']=_[_0xe055('0x31')](_0x380ef6[_0xe055('0x2d')],_0x380ef6[_0xe055('0x2f')]);_0x23b2fa[_0xe055('0x32')]=_[_0xe055('0x31')](_0x380ef6[_0xe055('0x2d')],qs[_0xe055('0x33')](_0x963320['query'][_0xe055('0x33')]));_0x23b2fa[_0xe055('0x32')]=_0x23b2fa[_0xe055('0x32')][_0xe055('0x34')]?_0x23b2fa[_0xe055('0x32')]:_0x380ef6['model'];if(_0x963320[_0xe055('0x2f')][_0xe055('0x42')]){_0x23b2fa['include']=[{'all':!![]}];}_0x23b2fa=_[_0xe055('0x3a')]({},_0x23b2fa,_0x963320['options']);return db[_0xe055('0x2a')][_0xe055('0x43')](_0x23b2fa)[_0xe055('0x24')](handleEntityNotFound(_0x124a47,null))['then'](respondWithResult(_0x124a47,null))[_0xe055('0x44')](handleError(_0x124a47,null));};exports[_0xe055('0x45')]=function(_0x1dfcf7,_0x5b312a){return db[_0xe055('0x2a')][_0xe055('0x45')](_0x1dfcf7[_0xe055('0x46')],{})[_0xe055('0x24')](respondWithResult(_0x5b312a,0xc9))[_0xe055('0x44')](handleError(_0x5b312a,null));};exports['update']=function(_0x543383,_0xb6e903){if(_0x543383[_0xe055('0x46')]['id']){delete _0x543383['body']['id'];}return db[_0xe055('0x2a')][_0xe055('0x43')]({'where':{'id':_0x543383[_0xe055('0x41')]['id']}})[_0xe055('0x24')](handleEntityNotFound(_0xb6e903,null))['then'](saveUpdates(_0x543383[_0xe055('0x46')],null))[_0xe055('0x24')](respondWithResult(_0xb6e903,null))[_0xe055('0x44')](handleError(_0xb6e903,null));};exports['destroy']=function(_0xcf22ea,_0x11f64b){return db[_0xe055('0x2a')]['find']({'where':{'id':_0xcf22ea[_0xe055('0x41')]['id']}})['then'](handleEntityNotFound(_0x11f64b,null))['then'](removeEntity(_0x11f64b,null))[_0xe055('0x44')](handleError(_0x11f64b,null));};exports[_0xe055('0x47')]=function(_0x14d63c,_0x5c9de7){return db[_0xe055('0x2a')]['describe']()[_0xe055('0x24')](respondWithResult(_0x5c9de7,null))[_0xe055('0x44')](handleError(_0x5c9de7,null));};
\ No newline at end of file
+var _0x6c06=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0x6c06,0x158));var _0x66c0=function(_0x145657,_0x2d39bc){_0x145657=_0x145657-0x0;var _0x4c4922=_0x6c06[_0x145657];return _0x4c4922;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66c0('0x0'));var jsonpatch=require(_0x66c0('0x1'));var rp=require(_0x66c0('0x2'));var moment=require('moment');var BPromise=require(_0x66c0('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x66c0('0x4'));var sox=require(_0x66c0('0x5'));var csv=require(_0x66c0('0x6'));var ejs=require(_0x66c0('0x7'));var fs=require('fs');var fs_extra=require(_0x66c0('0x8'));var _=require(_0x66c0('0x9'));var squel=require(_0x66c0('0xa'));var crypto=require(_0x66c0('0xb'));var jsforce=require(_0x66c0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x66c0('0x6'));var querystring=require(_0x66c0('0xd'));var Papa=require('papaparse');var Redis=require(_0x66c0('0xe'));var authService=require(_0x66c0('0xf'));var qs=require(_0x66c0('0x10'));var as=require(_0x66c0('0x11'));var hardwareService=require(_0x66c0('0x12'));var logger=require(_0x66c0('0x13'))(_0x66c0('0x14'));var utils=require(_0x66c0('0x15'));var config=require(_0x66c0('0x16'));var licenseUtil=require(_0x66c0('0x17'));var db=require(_0x66c0('0x18'))['db'];function respondWithStatusCode(_0x71c97b,_0xc54e87){_0xc54e87=_0xc54e87||0xcc;return function(_0x1de2d2){if(_0x1de2d2){return _0x71c97b[_0x66c0('0x19')](_0xc54e87);}return _0x71c97b[_0x66c0('0x1a')](_0xc54e87)[_0x66c0('0x1b')]();};}function respondWithResult(_0x5ccf40,_0x5a0090){_0x5a0090=_0x5a0090||0xc8;return function(_0x12e1ea){if(_0x12e1ea){return _0x5ccf40['status'](_0x5a0090)[_0x66c0('0x1c')](_0x12e1ea);}};}function respondWithFilteredResult(_0x5d31d3,_0x488d83){return function(_0x323c73){if(_0x323c73){var _0x216c11=typeof _0x488d83[_0x66c0('0x1d')]==='undefined'&&typeof _0x488d83[_0x66c0('0x1e')]===_0x66c0('0x1f');var _0x39245f=_0x323c73[_0x66c0('0x20')];var _0xc721e7=_0x216c11?0x0:_0x488d83['offset'];var _0x3deb00=_0x216c11?_0x323c73[_0x66c0('0x20')]:_0x488d83[_0x66c0('0x1d')]+_0x488d83['limit'];var _0x1799b8;if(_0x3deb00>=_0x39245f){_0x3deb00=_0x39245f;_0x1799b8=0xc8;}else{_0x1799b8=0xce;}_0x5d31d3[_0x66c0('0x1a')](_0x1799b8);return _0x5d31d3[_0x66c0('0x21')](_0x66c0('0x22'),_0xc721e7+'-'+_0x3deb00+'/'+_0x39245f)[_0x66c0('0x1c')](_0x323c73);}return null;};}function patchUpdates(_0x2c2d25){return function(_0x1448dd){try{jsonpatch[_0x66c0('0x23')](_0x1448dd,_0x2c2d25,!![]);}catch(_0x33d68d){return BPromise['reject'](_0x33d68d);}return _0x1448dd['save']();};}function saveUpdates(_0x41aa82,_0x3fe00c){return function(_0x3f6358){if(_0x3f6358){return _0x3f6358[_0x66c0('0x24')](_0x41aa82)[_0x66c0('0x25')](function(_0x26d10f){return _0x26d10f;});}return null;};}function removeEntity(_0x22467d,_0x4ac1d0){return function(_0xe04ef7){if(_0xe04ef7){return _0xe04ef7[_0x66c0('0x26')]()[_0x66c0('0x25')](function(){_0x22467d[_0x66c0('0x1a')](0xcc)[_0x66c0('0x1b')]();});}};}function handleEntityNotFound(_0x44d282,_0xf5e6cb){return function(_0x50d6d6){if(!_0x50d6d6){_0x44d282[_0x66c0('0x19')](0x194);}return _0x50d6d6;};}function handleError(_0x375ce1,_0x115406){_0x115406=_0x115406||0x1f4;return function(_0x4c88bc){logger[_0x66c0('0x27')](_0x4c88bc[_0x66c0('0x28')]);if(_0x4c88bc['name']){delete _0x4c88bc[_0x66c0('0x29')];}_0x375ce1[_0x66c0('0x1a')](_0x115406)[_0x66c0('0x2a')](_0x4c88bc);};}exports[_0x66c0('0x2b')]=function(_0x63303b,_0x2d8c47){var _0x292f43={},_0x18815d={},_0x4af524={'count':0x0,'rows':[]};var _0x3dade3=_[_0x66c0('0x2c')](db[_0x66c0('0x2d')][_0x66c0('0x2e')],function(_0x4bad27){return{'name':_0x4bad27['fieldName'],'type':_0x4bad27['type'][_0x66c0('0x2f')]};});_0x18815d[_0x66c0('0x30')]=_[_0x66c0('0x2c')](_0x3dade3,'name');_0x18815d[_0x66c0('0x31')]=_[_0x66c0('0x32')](_0x63303b[_0x66c0('0x31')]);_0x18815d[_0x66c0('0x33')]=_['intersection'](_0x18815d['model'],_0x18815d[_0x66c0('0x31')]);_0x292f43[_0x66c0('0x34')]=_[_0x66c0('0x35')](_0x18815d[_0x66c0('0x30')],qs['fields'](_0x63303b[_0x66c0('0x31')][_0x66c0('0x36')]));_0x292f43['attributes']=_0x292f43[_0x66c0('0x34')]['length']?_0x292f43['attributes']:_0x18815d['model'];if(!_0x63303b[_0x66c0('0x31')]['hasOwnProperty']('nolimit')){_0x292f43[_0x66c0('0x1e')]=qs['limit'](_0x63303b['query'][_0x66c0('0x1e')]);_0x292f43['offset']=qs[_0x66c0('0x1d')](_0x63303b['query'][_0x66c0('0x1d')]);}_0x292f43[_0x66c0('0x37')]=qs[_0x66c0('0x38')](_0x63303b[_0x66c0('0x31')]['sort']);_0x292f43['where']=qs[_0x66c0('0x33')](_['pick'](_0x63303b[_0x66c0('0x31')],_0x18815d['filters']),_0x3dade3);if(_0x63303b[_0x66c0('0x31')][_0x66c0('0x39')]){_0x292f43[_0x66c0('0x3a')]=_[_0x66c0('0x3b')](_0x292f43['where'],{'$or':_[_0x66c0('0x2c')](_0x3dade3,function(_0x14f7fb){if(_0x14f7fb[_0x66c0('0x3c')]!==_0x66c0('0x3d')){var _0x11603d={};_0x11603d[_0x14f7fb[_0x66c0('0x29')]]={'$like':'%'+_0x63303b['query'][_0x66c0('0x39')]+'%'};return _0x11603d;}})});}_0x292f43=_[_0x66c0('0x3b')]({},_0x292f43,_0x63303b[_0x66c0('0x3e')]);var _0x17fbde={'where':_0x292f43[_0x66c0('0x3a')]};return db[_0x66c0('0x2d')][_0x66c0('0x20')](_0x17fbde)[_0x66c0('0x25')](function(_0x280dcc){_0x4af524[_0x66c0('0x20')]=_0x280dcc;if(_0x63303b[_0x66c0('0x31')][_0x66c0('0x3f')]){_0x292f43[_0x66c0('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0x66c0('0x41')](_0x292f43);})['then'](function(_0x4fa56b){_0x4af524[_0x66c0('0x42')]=_0x4fa56b;return _0x4af524;})[_0x66c0('0x25')](respondWithFilteredResult(_0x2d8c47,_0x292f43))[_0x66c0('0x43')](handleError(_0x2d8c47,null));};exports[_0x66c0('0x44')]=function(_0x599a9e,_0x379b4a){var _0x5c7450={'raw':!![],'where':{'id':_0x599a9e[_0x66c0('0x45')]['id']}},_0x3e6495={};_0x3e6495['model']=_[_0x66c0('0x32')](db['SquareReport'][_0x66c0('0x2e')]);_0x3e6495[_0x66c0('0x31')]=_[_0x66c0('0x32')](_0x599a9e[_0x66c0('0x31')]);_0x3e6495[_0x66c0('0x33')]=_[_0x66c0('0x35')](_0x3e6495['model'],_0x3e6495['query']);_0x5c7450[_0x66c0('0x34')]=_[_0x66c0('0x35')](_0x3e6495['model'],qs[_0x66c0('0x36')](_0x599a9e[_0x66c0('0x31')][_0x66c0('0x36')]));_0x5c7450[_0x66c0('0x34')]=_0x5c7450[_0x66c0('0x34')]['length']?_0x5c7450[_0x66c0('0x34')]:_0x3e6495[_0x66c0('0x30')];if(_0x599a9e[_0x66c0('0x31')]['includeAll']){_0x5c7450['include']=[{'all':!![]}];}_0x5c7450=_['merge']({},_0x5c7450,_0x599a9e[_0x66c0('0x3e')]);return db['SquareReport']['find'](_0x5c7450)[_0x66c0('0x25')](handleEntityNotFound(_0x379b4a,null))['then'](respondWithResult(_0x379b4a,null))['catch'](handleError(_0x379b4a,null));};exports['create']=function(_0x5c2fe4,_0x5494b4){return db['SquareReport'][_0x66c0('0x46')](_0x5c2fe4[_0x66c0('0x47')],{})[_0x66c0('0x25')](respondWithResult(_0x5494b4,0xc9))['catch'](handleError(_0x5494b4,null));};exports['update']=function(_0x33edd3,_0xa353c4){if(_0x33edd3[_0x66c0('0x47')]['id']){delete _0x33edd3[_0x66c0('0x47')]['id'];}return db[_0x66c0('0x2d')][_0x66c0('0x48')]({'where':{'id':_0x33edd3[_0x66c0('0x45')]['id']}})[_0x66c0('0x25')](handleEntityNotFound(_0xa353c4,null))[_0x66c0('0x25')](saveUpdates(_0x33edd3[_0x66c0('0x47')],null))[_0x66c0('0x25')](respondWithResult(_0xa353c4,null))['catch'](handleError(_0xa353c4,null));};exports[_0x66c0('0x26')]=function(_0x1bb21f,_0xe2699a){return db[_0x66c0('0x2d')]['find']({'where':{'id':_0x1bb21f[_0x66c0('0x45')]['id']}})['then'](handleEntityNotFound(_0xe2699a,null))[_0x66c0('0x25')](removeEntity(_0xe2699a,null))[_0x66c0('0x43')](handleError(_0xe2699a,null));};exports[_0x66c0('0x49')]=function(_0x3e257c,_0x1de35e){return db[_0x66c0('0x2d')][_0x66c0('0x49')]()[_0x66c0('0x25')](respondWithResult(_0x1de35e,null))[_0x66c0('0x43')](handleError(_0x1de35e,null));};
\ No newline at end of file
index f2d7442..0a610af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93bd=['api','bluebird','path','rimraf','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x93bd,0xde));var _0xd93b=function(_0x59bd10,_0x170b80){_0x59bd10=_0x59bd10-0x0;var _0x5bda04=_0x93bd[_0x59bd10];return _0x5bda04;};'use strict';var _=require(_0xd93b('0x0'));var util=require(_0xd93b('0x1'));var logger=require(_0xd93b('0x2'))(_0xd93b('0x3'));var moment=require('moment');var BPromise=require(_0xd93b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd93b('0x5'));var rimraf=require(_0xd93b('0x6'));var config=require('../../config/environment');var attributes=require(_0xd93b('0x7'));module[_0xd93b('0x8')]=function(_0x58ca6c,_0x5852f8){return _0x58ca6c['define'](_0xd93b('0x9'),attributes,{'tableName':_0xd93b('0xa'),'paranoid':![],'indexes':[{'name':_0xd93b('0xb'),'fields':[_0xd93b('0xc'),_0xd93b('0xd')]},{'name':_0xd93b('0xe'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf73b=['moment','bluebird','path','rimraf','../../config/environment','exports','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','../../config/logger','api'];(function(_0x384df9,_0x24b622){var _0xe29c69=function(_0x42579c){while(--_0x42579c){_0x384df9['push'](_0x384df9['shift']());}};_0xe29c69(++_0x24b622);}(_0xf73b,0x7b));var _0xbf73=function(_0x46d2fe,_0x33b7e9){_0x46d2fe=_0x46d2fe-0x0;var _0x1b3951=_0xf73b[_0x46d2fe];return _0x1b3951;};'use strict';var _=require(_0xbf73('0x0'));var util=require('util');var logger=require(_0xbf73('0x1'))(_0xbf73('0x2'));var moment=require(_0xbf73('0x3'));var BPromise=require(_0xbf73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf73('0x5'));var rimraf=require(_0xbf73('0x6'));var config=require(_0xbf73('0x7'));var attributes=require('./squareReport.attributes');module[_0xbf73('0x8')]=function(_0x477817,_0x2d6ed3){return _0x477817['define'](_0xbf73('0x9'),attributes,{'tableName':_0xbf73('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xbf73('0xb'),_0xbf73('0xc')]},{'name':_0xbf73('0xd'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index ed00752..2f8ebf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3da=['debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','attributes','limit'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0xb3da,0xb0));var _0xab3d=function(_0x4f3467,_0x3c8ed9){_0x4f3467=_0x4f3467-0x0;var _0x5a9c8e=_0xb3da[_0x4f3467];return _0x5a9c8e;};'use strict';var _=require(_0xab3d('0x0'));var util=require(_0xab3d('0x1'));var moment=require(_0xab3d('0x2'));var BPromise=require('bluebird');var rs=require(_0xab3d('0x3'));var fs=require('fs');var Redis=require(_0xab3d('0x4'));var db=require(_0xab3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab3d('0x6'))(_0xab3d('0x7'));var config=require(_0xab3d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1219d3,_0x3d771a,_0x40d044){return new BPromise(function(_0x15d98b,_0x5ab721){return client['request'](_0x1219d3,_0x40d044)['then'](function(_0x239d6e){logger[_0xab3d('0xa')]('SquareReport,\x20%s,\x20%s',_0x3d771a,_0xab3d('0xb'));logger['debug'](_0xab3d('0xc'),_0x3d771a,_0xab3d('0xb'),JSON[_0xab3d('0xd')](_0x239d6e));if(_0x239d6e[_0xab3d('0xe')]){if(_0x239d6e[_0xab3d('0xe')][_0xab3d('0xf')]===0x1f4){logger['error'](_0xab3d('0x10'),_0x3d771a,_0x239d6e[_0xab3d('0xe')][_0xab3d('0x11')]);return _0x5ab721(_0x239d6e[_0xab3d('0xe')]['message']);}logger[_0xab3d('0xe')](_0xab3d('0x10'),_0x3d771a,_0x239d6e[_0xab3d('0xe')][_0xab3d('0x11')]);return _0x15d98b(_0x239d6e[_0xab3d('0xe')][_0xab3d('0x11')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x3d771a,_0xab3d('0xb'));_0x15d98b(_0x239d6e['result'][_0xab3d('0x11')]);}})['catch'](function(_0x127319){logger[_0xab3d('0xe')](_0xab3d('0x10'),_0x3d771a,_0x127319);_0x5ab721(_0x127319);});});}exports[_0xab3d('0x12')]=function(_0x48ded1){var _0x19f8b3=this;return new Promise(function(_0x338814,_0x29baa9){return db[_0xab3d('0x13')]['create'](_0x48ded1[_0xab3d('0x14')],{'raw':_0x48ded1[_0xab3d('0x15')]?_0x48ded1['options'][_0xab3d('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x4902aa){logger[_0xab3d('0xa')](_0xab3d('0x12'),_0x48ded1);logger['debug'](_0xab3d('0x12'),_0x48ded1,JSON[_0xab3d('0xd')](_0x4902aa));_0x338814(_0x4902aa);})['catch'](function(_0x1a2aab){logger[_0xab3d('0xe')](_0xab3d('0x12'),_0x1a2aab[_0xab3d('0x11')],_0x48ded1);_0x29baa9(_0x19f8b3[_0xab3d('0xe')](0x1f4,_0x1a2aab[_0xab3d('0x11')]));});});};exports[_0xab3d('0x17')]=function(_0x53d379){var _0x571c5c=this;return new Promise(function(_0x28575d,_0x2b9947){return db[_0xab3d('0x13')][_0xab3d('0x18')](_0x53d379[_0xab3d('0x14')],{'raw':_0x53d379[_0xab3d('0x15')]?_0x53d379[_0xab3d('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d379[_0xab3d('0x15')]?_0x53d379[_0xab3d('0x15')]['where']||null:null,'attributes':_0x53d379['options']?_0x53d379[_0xab3d('0x15')][_0xab3d('0x19')]||null:null,'limit':_0x53d379[_0xab3d('0x15')]?_0x53d379[_0xab3d('0x15')][_0xab3d('0x1a')]||null:null})['then'](function(_0x2e1e14){logger[_0xab3d('0xa')](_0xab3d('0x17'),_0x53d379);logger[_0xab3d('0x1b')](_0xab3d('0x17'),_0x53d379,JSON[_0xab3d('0xd')](_0x2e1e14));_0x28575d(_0x2e1e14);})[_0xab3d('0x1c')](function(_0x1646ce){logger[_0xab3d('0xe')](_0xab3d('0x17'),_0x1646ce[_0xab3d('0x11')],_0x53d379);_0x2b9947(_0x571c5c['error'](0x1f4,_0x1646ce['message']));});});};
\ No newline at end of file
+var _0x0047=['catch','CreateSquareReport','SquareReport','body','options','stringify','UpdateSquareReport','update','raw','where','attributes','limit','debug','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0047,0x81));var _0x7004=function(_0x501ca1,_0x6c6edc){_0x501ca1=_0x501ca1-0x0;var _0x2a99c4=_0x0047[_0x501ca1];return _0x2a99c4;};'use strict';var _=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var moment=require('moment');var BPromise=require(_0x7004('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7004('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7004('0x4'))('rpc');var config=require(_0x7004('0x5'));var jayson=require(_0x7004('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51ea00,_0x928fec,_0x9a2020){return new BPromise(function(_0x54199c,_0x626d95){return client['request'](_0x51ea00,_0x9a2020)[_0x7004('0x7')](function(_0x1a1cb4){logger[_0x7004('0x8')](_0x7004('0x9'),_0x928fec,_0x7004('0xa'));logger['debug'](_0x7004('0xb'),_0x928fec,_0x7004('0xa'),JSON['stringify'](_0x1a1cb4));if(_0x1a1cb4['error']){if(_0x1a1cb4['error'][_0x7004('0xc')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x928fec,_0x1a1cb4[_0x7004('0xd')][_0x7004('0xe')]);return _0x626d95(_0x1a1cb4['error'][_0x7004('0xe')]);}logger['error'](_0x7004('0x9'),_0x928fec,_0x1a1cb4[_0x7004('0xd')]['message']);return _0x54199c(_0x1a1cb4[_0x7004('0xd')][_0x7004('0xe')]);}else{logger[_0x7004('0x8')](_0x7004('0x9'),_0x928fec,'request\x20sent');_0x54199c(_0x1a1cb4[_0x7004('0xf')][_0x7004('0xe')]);}})[_0x7004('0x10')](function(_0x3e4a11){logger[_0x7004('0xd')](_0x7004('0x9'),_0x928fec,_0x3e4a11);_0x626d95(_0x3e4a11);});});}exports[_0x7004('0x11')]=function(_0x2ab53d){var _0x535ab2=this;return new Promise(function(_0x387e77,_0x523c15){return db[_0x7004('0x12')]['create'](_0x2ab53d[_0x7004('0x13')],{'raw':_0x2ab53d[_0x7004('0x14')]?_0x2ab53d[_0x7004('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x7004('0x7')](function(_0x2d6dfc){logger[_0x7004('0x8')](_0x7004('0x11'),_0x2ab53d);logger['debug'](_0x7004('0x11'),_0x2ab53d,JSON[_0x7004('0x15')](_0x2d6dfc));_0x387e77(_0x2d6dfc);})[_0x7004('0x10')](function(_0xfe5cff){logger[_0x7004('0xd')](_0x7004('0x11'),_0xfe5cff[_0x7004('0xe')],_0x2ab53d);_0x523c15(_0x535ab2[_0x7004('0xd')](0x1f4,_0xfe5cff[_0x7004('0xe')]));});});};exports[_0x7004('0x16')]=function(_0x569006){var _0x494992=this;return new Promise(function(_0x235704,_0x52f1c3){return db[_0x7004('0x12')][_0x7004('0x17')](_0x569006['body'],{'raw':_0x569006['options']?_0x569006[_0x7004('0x14')][_0x7004('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x569006[_0x7004('0x14')]?_0x569006[_0x7004('0x14')][_0x7004('0x19')]||null:null,'attributes':_0x569006['options']?_0x569006[_0x7004('0x14')][_0x7004('0x1a')]||null:null,'limit':_0x569006[_0x7004('0x14')]?_0x569006[_0x7004('0x14')][_0x7004('0x1b')]||null:null})[_0x7004('0x7')](function(_0x55c4d4){logger[_0x7004('0x8')]('UpdateSquareReport',_0x569006);logger[_0x7004('0x1c')](_0x7004('0x16'),_0x569006,JSON['stringify'](_0x55c4d4));_0x235704(_0x55c4d4);})[_0x7004('0x10')](function(_0x1e9099){logger[_0x7004('0xd')](_0x7004('0x16'),_0x1e9099[_0x7004('0xe')],_0x569006);_0x52f1c3(_0x494992[_0x7004('0xd')](0x1f4,_0x1e9099[_0x7004('0xe')]));});});};
\ No newline at end of file
index 8a79e19..25a87fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec2c=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x18f1ab,_0x131da2){var _0x2e1c51=function(_0x34b7a1){while(--_0x34b7a1){_0x18f1ab['push'](_0x18f1ab['shift']());}};_0x2e1c51(++_0x131da2);}(_0xec2c,0x14e));var _0xcec2=function(_0x50a3e1,_0x43d894){_0x50a3e1=_0x50a3e1-0x0;var _0x3f5a7f=_0xec2c[_0x50a3e1];return _0x3f5a7f;};'use strict';var multer=require(_0xcec2('0x0'));var util=require(_0xcec2('0x1'));var path=require(_0xcec2('0x2'));var timeout=require(_0xcec2('0x3'));var express=require(_0xcec2('0x4'));var router=express['Router']();var fs_extra=require(_0xcec2('0x5'));var auth=require(_0xcec2('0x6'));var interaction=require(_0xcec2('0x7'));var config=require(_0xcec2('0x8'));var controller=require(_0xcec2('0x9'));router[_0xcec2('0xa')]('/',auth[_0xcec2('0xb')](),controller[_0xcec2('0xc')]);router[_0xcec2('0xa')](_0xcec2('0xd'),auth[_0xcec2('0xb')](),controller[_0xcec2('0xe')]);router[_0xcec2('0xa')](_0xcec2('0xf'),auth[_0xcec2('0xb')](),controller[_0xcec2('0x10')]);router[_0xcec2('0x11')]('/',auth[_0xcec2('0xb')](),controller[_0xcec2('0x12')]);router[_0xcec2('0x13')](_0xcec2('0xf'),auth['isAuthenticated'](),controller[_0xcec2('0x14')]);router[_0xcec2('0x15')](_0xcec2('0xf'),auth[_0xcec2('0xb')](),controller['destroy']);module[_0xcec2('0x16')]=router;
\ No newline at end of file
+var _0xa9f8=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update'];(function(_0x13a219,_0x25acd3){var _0x50e371=function(_0x187aea){while(--_0x187aea){_0x13a219['push'](_0x13a219['shift']());}};_0x50e371(++_0x25acd3);}(_0xa9f8,0x6b));var _0x8a9f=function(_0xf9b39a,_0x153686){_0xf9b39a=_0xf9b39a-0x0;var _0x2507cb=_0xa9f8[_0xf9b39a];return _0x2507cb;};'use strict';var multer=require(_0x8a9f('0x0'));var util=require(_0x8a9f('0x1'));var path=require(_0x8a9f('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a9f('0x3'));var router=express['Router']();var fs_extra=require(_0x8a9f('0x4'));var auth=require(_0x8a9f('0x5'));var interaction=require(_0x8a9f('0x6'));var config=require(_0x8a9f('0x7'));var controller=require(_0x8a9f('0x8'));router[_0x8a9f('0x9')]('/',auth[_0x8a9f('0xa')](),controller[_0x8a9f('0xb')]);router[_0x8a9f('0x9')](_0x8a9f('0xc'),auth[_0x8a9f('0xa')](),controller['describe']);router[_0x8a9f('0x9')](_0x8a9f('0xd'),auth[_0x8a9f('0xa')](),controller[_0x8a9f('0xe')]);router[_0x8a9f('0xf')]('/',auth['isAuthenticated'](),controller[_0x8a9f('0x10')]);router[_0x8a9f('0x11')](_0x8a9f('0xd'),auth['isAuthenticated'](),controller[_0x8a9f('0x12')]);router[_0x8a9f('0x13')](_0x8a9f('0xd'),auth[_0x8a9f('0xa')](),controller[_0x8a9f('0x14')]);module['exports']=router;
\ No newline at end of file
index 186d18f..6ec587c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32fe=['exports','STRING','TEXT','sequelize'];(function(_0x2863be,_0x17a5a2){var _0xdec9=function(_0x1ee996){while(--_0x1ee996){_0x2863be['push'](_0x2863be['shift']());}};_0xdec9(++_0x17a5a2);}(_0x32fe,0x133));var _0xe32f=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x32fe[_0x11ca63];return _0x41f1f6;};'use strict';var Sequelize=require(_0xe32f('0x0'));module[_0xe32f('0x1')]={'uniqueid':{'type':Sequelize[_0xe32f('0x2')]},'node':{'type':Sequelize[_0xe32f('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xe32f('0x3')]},'project_name':{'type':Sequelize[_0xe32f('0x2')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0daa=['STRING','TEXT','sequelize'];(function(_0x314b4e,_0x13bbc9){var _0x41b54a=function(_0x1557da){while(--_0x1557da){_0x314b4e['push'](_0x314b4e['shift']());}};_0x41b54a(++_0x13bbc9);}(_0x0daa,0x134));var _0xa0da=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0daa[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa0da('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa0da('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xa0da('0x1')]},'data':{'type':Sequelize[_0xa0da('0x2')]},'project_name':{'type':Sequelize[_0xa0da('0x1')]},'callerid':{'type':Sequelize[_0xa0da('0x1')]}};
\ No newline at end of file
index 369c4fd..0bad9ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b88=['zip-dir','fast-json-patch','bluebird','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','rimraf'];(function(_0x95b3b2,_0x507c0c){var _0x1983ba=function(_0x65968e){while(--_0x65968e){_0x95b3b2['push'](_0x95b3b2['shift']());}};_0x1983ba(++_0x507c0c);}(_0x2b88,0x1a3));var _0x82b8=function(_0x1f7fb2,_0x116309){_0x1f7fb2=_0x1f7fb2-0x0;var _0x61fc27=_0x2b88[_0x1f7fb2];return _0x61fc27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82b8('0x0'));var zipdir=require(_0x82b8('0x1'));var jsonpatch=require(_0x82b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x82b8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x82b8('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82b8('0x5'));var squel=require(_0x82b8('0x6'));var crypto=require(_0x82b8('0x7'));var jsforce=require(_0x82b8('0x8'));var deskjs=require(_0x82b8('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x82b8('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x82b8('0xb'));var as=require(_0x82b8('0xc'));var hardwareService=require(_0x82b8('0xd'));var logger=require(_0x82b8('0xe'))(_0x82b8('0xf'));var utils=require(_0x82b8('0x10'));var config=require(_0x82b8('0x11'));var licenseUtil=require(_0x82b8('0x12'));var db=require(_0x82b8('0x13'))['db'];function respondWithStatusCode(_0x1120ad,_0x1d2d15){_0x1d2d15=_0x1d2d15||0xcc;return function(_0x3c65b2){if(_0x3c65b2){return _0x1120ad[_0x82b8('0x14')](_0x1d2d15);}return _0x1120ad[_0x82b8('0x15')](_0x1d2d15)[_0x82b8('0x16')]();};}function respondWithResult(_0x8a5de4,_0x2595f3){_0x2595f3=_0x2595f3||0xc8;return function(_0xdb6edd){if(_0xdb6edd){return _0x8a5de4[_0x82b8('0x15')](_0x2595f3)[_0x82b8('0x17')](_0xdb6edd);}};}function respondWithFilteredResult(_0x2a78c0,_0x5c3dee){return function(_0x5cbddd){if(_0x5cbddd){var _0x7e6e3b=typeof _0x5c3dee[_0x82b8('0x18')]==='undefined'&&typeof _0x5c3dee[_0x82b8('0x19')]===_0x82b8('0x1a');var _0x18f5ff=_0x5cbddd[_0x82b8('0x1b')];var _0x5da497=_0x7e6e3b?0x0:_0x5c3dee['offset'];var _0x40e700=_0x7e6e3b?_0x5cbddd['count']:_0x5c3dee['offset']+_0x5c3dee['limit'];var _0xdc3704;if(_0x40e700>=_0x18f5ff){_0x40e700=_0x18f5ff;_0xdc3704=0xc8;}else{_0xdc3704=0xce;}_0x2a78c0[_0x82b8('0x15')](_0xdc3704);return _0x2a78c0[_0x82b8('0x1c')]('Content-Range',_0x5da497+'-'+_0x40e700+'/'+_0x18f5ff)[_0x82b8('0x17')](_0x5cbddd);}return null;};}function patchUpdates(_0x5777a1){return function(_0x368b7e){try{jsonpatch[_0x82b8('0x1d')](_0x368b7e,_0x5777a1,!![]);}catch(_0x3b7588){return BPromise[_0x82b8('0x1e')](_0x3b7588);}return _0x368b7e[_0x82b8('0x1f')]();};}function saveUpdates(_0x1da134,_0x3d9893){return function(_0x4282bc){if(_0x4282bc){return _0x4282bc[_0x82b8('0x20')](_0x1da134)[_0x82b8('0x21')](function(_0x209fbb){return _0x209fbb;});}return null;};}function removeEntity(_0x2f15c8,_0x466856){return function(_0xbae8bf){if(_0xbae8bf){return _0xbae8bf[_0x82b8('0x22')]()[_0x82b8('0x21')](function(){_0x2f15c8[_0x82b8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5b8f,_0x3f70db){return function(_0x1fbb9e){if(!_0x1fbb9e){_0x1e5b8f[_0x82b8('0x14')](0x194);}return _0x1fbb9e;};}function handleError(_0x2aced2,_0x5b4258){_0x5b4258=_0x5b4258||0x1f4;return function(_0x3d48f6){logger['error'](_0x3d48f6['stack']);if(_0x3d48f6[_0x82b8('0x23')]){delete _0x3d48f6['name'];}_0x2aced2['status'](_0x5b4258)[_0x82b8('0x24')](_0x3d48f6);};}exports[_0x82b8('0x25')]=function(_0x54d161,_0x1ad8a9){var _0x47e72d={},_0x245e8e={},_0x32c271={'count':0x0,'rows':[]};var _0x591455=_[_0x82b8('0x26')](db[_0x82b8('0x27')][_0x82b8('0x28')],function(_0x508466){return{'name':_0x508466[_0x82b8('0x29')],'type':_0x508466['type'][_0x82b8('0x2a')]};});_0x245e8e['model']=_[_0x82b8('0x26')](_0x591455,_0x82b8('0x23'));_0x245e8e['query']=_[_0x82b8('0x2b')](_0x54d161[_0x82b8('0x2c')]);_0x245e8e['filters']=_[_0x82b8('0x2d')](_0x245e8e[_0x82b8('0x2e')],_0x245e8e[_0x82b8('0x2c')]);_0x47e72d[_0x82b8('0x2f')]=_[_0x82b8('0x2d')](_0x245e8e[_0x82b8('0x2e')],qs['fields'](_0x54d161[_0x82b8('0x2c')][_0x82b8('0x30')]));_0x47e72d[_0x82b8('0x2f')]=_0x47e72d[_0x82b8('0x2f')][_0x82b8('0x31')]?_0x47e72d[_0x82b8('0x2f')]:_0x245e8e[_0x82b8('0x2e')];if(!_0x54d161[_0x82b8('0x2c')][_0x82b8('0x32')](_0x82b8('0x33'))){_0x47e72d[_0x82b8('0x19')]=qs[_0x82b8('0x19')](_0x54d161[_0x82b8('0x2c')]['limit']);_0x47e72d[_0x82b8('0x18')]=qs[_0x82b8('0x18')](_0x54d161[_0x82b8('0x2c')][_0x82b8('0x18')]);}_0x47e72d[_0x82b8('0x34')]=qs[_0x82b8('0x35')](_0x54d161['query'][_0x82b8('0x35')]);_0x47e72d[_0x82b8('0x36')]=qs['filters'](_[_0x82b8('0x37')](_0x54d161[_0x82b8('0x2c')],_0x245e8e[_0x82b8('0x38')]),_0x591455);if(_0x54d161[_0x82b8('0x2c')][_0x82b8('0x39')]){_0x47e72d[_0x82b8('0x36')]=_[_0x82b8('0x3a')](_0x47e72d[_0x82b8('0x36')],{'$or':_[_0x82b8('0x26')](_0x591455,function(_0x93199a){if(_0x93199a['type']!=='VIRTUAL'){var _0x4f3d64={};_0x4f3d64[_0x93199a[_0x82b8('0x23')]]={'$like':'%'+_0x54d161['query'][_0x82b8('0x39')]+'%'};return _0x4f3d64;}})});}_0x47e72d=_['merge']({},_0x47e72d,_0x54d161[_0x82b8('0x3b')]);var _0x74e8c8={'where':_0x47e72d[_0x82b8('0x36')]};return db[_0x82b8('0x27')][_0x82b8('0x1b')](_0x74e8c8)[_0x82b8('0x21')](function(_0x2d8916){_0x32c271[_0x82b8('0x1b')]=_0x2d8916;if(_0x54d161['query'][_0x82b8('0x3c')]){_0x47e72d[_0x82b8('0x3d')]=[{'all':!![]}];}return db[_0x82b8('0x27')][_0x82b8('0x3e')](_0x47e72d);})[_0x82b8('0x21')](function(_0x142298){_0x32c271['rows']=_0x142298;return _0x32c271;})[_0x82b8('0x21')](respondWithFilteredResult(_0x1ad8a9,_0x47e72d))[_0x82b8('0x3f')](handleError(_0x1ad8a9,null));};exports[_0x82b8('0x40')]=function(_0x54f442,_0x2700c0){var _0x27feac={'raw':!![],'where':{'id':_0x54f442[_0x82b8('0x41')]['id']}},_0x51d8bb={};_0x51d8bb[_0x82b8('0x2e')]=_['keys'](db['SquareDetailsReport']['rawAttributes']);_0x51d8bb[_0x82b8('0x2c')]=_['keys'](_0x54f442[_0x82b8('0x2c')]);_0x51d8bb['filters']=_[_0x82b8('0x2d')](_0x51d8bb[_0x82b8('0x2e')],_0x51d8bb[_0x82b8('0x2c')]);_0x27feac['attributes']=_[_0x82b8('0x2d')](_0x51d8bb['model'],qs[_0x82b8('0x30')](_0x54f442['query'][_0x82b8('0x30')]));_0x27feac[_0x82b8('0x2f')]=_0x27feac['attributes'][_0x82b8('0x31')]?_0x27feac['attributes']:_0x51d8bb[_0x82b8('0x2e')];if(_0x54f442['query']['includeAll']){_0x27feac['include']=[{'all':!![]}];}_0x27feac=_[_0x82b8('0x3a')]({},_0x27feac,_0x54f442['options']);return db[_0x82b8('0x27')]['find'](_0x27feac)[_0x82b8('0x21')](handleEntityNotFound(_0x2700c0,null))[_0x82b8('0x21')](respondWithResult(_0x2700c0,null))[_0x82b8('0x3f')](handleError(_0x2700c0,null));};exports['create']=function(_0x14715e,_0x576ccb){return db['SquareDetailsReport'][_0x82b8('0x42')](_0x14715e[_0x82b8('0x43')],{})['then'](respondWithResult(_0x576ccb,0xc9))[_0x82b8('0x3f')](handleError(_0x576ccb,null));};exports[_0x82b8('0x20')]=function(_0x447f18,_0x42a0eb){if(_0x447f18[_0x82b8('0x43')]['id']){delete _0x447f18[_0x82b8('0x43')]['id'];}return db[_0x82b8('0x27')][_0x82b8('0x44')]({'where':{'id':_0x447f18[_0x82b8('0x41')]['id']}})[_0x82b8('0x21')](handleEntityNotFound(_0x42a0eb,null))['then'](saveUpdates(_0x447f18[_0x82b8('0x43')],null))[_0x82b8('0x21')](respondWithResult(_0x42a0eb,null))['catch'](handleError(_0x42a0eb,null));};exports[_0x82b8('0x22')]=function(_0x1123fc,_0x4fc964){return db[_0x82b8('0x27')][_0x82b8('0x44')]({'where':{'id':_0x1123fc[_0x82b8('0x41')]['id']}})[_0x82b8('0x21')](handleEntityNotFound(_0x4fc964,null))[_0x82b8('0x21')](removeEntity(_0x4fc964,null))[_0x82b8('0x3f')](handleError(_0x4fc964,null));};exports[_0x82b8('0x45')]=function(_0x9d7e29,_0x466349){return db[_0x82b8('0x27')]['describe']()[_0x82b8('0x21')](respondWithResult(_0x466349,null))[_0x82b8('0x3f')](handleError(_0x466349,null));};
\ No newline at end of file
+var _0x13d9=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1b8a6b,_0x27c68b){var _0x207256=function(_0xa27590){while(--_0xa27590){_0x1b8a6b['push'](_0x1b8a6b['shift']());}};_0x207256(++_0x27c68b);}(_0x13d9,0x162));var _0x913d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x913d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x913d('0x1'));var moment=require(_0x913d('0x2'));var BPromise=require(_0x913d('0x3'));var Mustache=require(_0x913d('0x4'));var util=require('util');var path=require(_0x913d('0x5'));var sox=require(_0x913d('0x6'));var csv=require(_0x913d('0x7'));var ejs=require(_0x913d('0x8'));var fs=require('fs');var fs_extra=require(_0x913d('0x9'));var _=require(_0x913d('0xa'));var squel=require(_0x913d('0xb'));var crypto=require(_0x913d('0xc'));var jsforce=require(_0x913d('0xd'));var deskjs=require(_0x913d('0xe'));var toCsv=require(_0x913d('0x7'));var querystring=require(_0x913d('0xf'));var Papa=require(_0x913d('0x10'));var Redis=require(_0x913d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x913d('0x12'));var as=require(_0x913d('0x13'));var hardwareService=require(_0x913d('0x14'));var logger=require(_0x913d('0x15'))(_0x913d('0x16'));var utils=require(_0x913d('0x17'));var config=require(_0x913d('0x18'));var licenseUtil=require(_0x913d('0x19'));var db=require(_0x913d('0x1a'))['db'];function respondWithStatusCode(_0x3591db,_0x5f120a){_0x5f120a=_0x5f120a||0xcc;return function(_0x429fa9){if(_0x429fa9){return _0x3591db['sendStatus'](_0x5f120a);}return _0x3591db[_0x913d('0x1b')](_0x5f120a)['end']();};}function respondWithResult(_0x11b97f,_0x3ee48a){_0x3ee48a=_0x3ee48a||0xc8;return function(_0x28ea8f){if(_0x28ea8f){return _0x11b97f[_0x913d('0x1b')](_0x3ee48a)[_0x913d('0x1c')](_0x28ea8f);}};}function respondWithFilteredResult(_0x46d97d,_0x11f779){return function(_0x3c7b9c){if(_0x3c7b9c){var _0x29a8d9=typeof _0x11f779[_0x913d('0x1d')]===_0x913d('0x1e')&&typeof _0x11f779['limit']===_0x913d('0x1e');var _0x8670fd=_0x3c7b9c[_0x913d('0x1f')];var _0xb2946d=_0x29a8d9?0x0:_0x11f779[_0x913d('0x1d')];var _0x342a32=_0x29a8d9?_0x3c7b9c['count']:_0x11f779[_0x913d('0x1d')]+_0x11f779[_0x913d('0x20')];var _0x822747;if(_0x342a32>=_0x8670fd){_0x342a32=_0x8670fd;_0x822747=0xc8;}else{_0x822747=0xce;}_0x46d97d[_0x913d('0x1b')](_0x822747);return _0x46d97d[_0x913d('0x21')](_0x913d('0x22'),_0xb2946d+'-'+_0x342a32+'/'+_0x8670fd)[_0x913d('0x1c')](_0x3c7b9c);}return null;};}function patchUpdates(_0x3d91c9){return function(_0x48eeb9){try{jsonpatch['apply'](_0x48eeb9,_0x3d91c9,!![]);}catch(_0xf1f2f3){return BPromise[_0x913d('0x23')](_0xf1f2f3);}return _0x48eeb9[_0x913d('0x24')]();};}function saveUpdates(_0x2865c7,_0x585f51){return function(_0xee9e81){if(_0xee9e81){return _0xee9e81[_0x913d('0x25')](_0x2865c7)[_0x913d('0x26')](function(_0x4cb1ff){return _0x4cb1ff;});}return null;};}function removeEntity(_0x28c159,_0x28a2a3){return function(_0x6b82b){if(_0x6b82b){return _0x6b82b[_0x913d('0x27')]()[_0x913d('0x26')](function(){_0x28c159['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x477f55,_0x189f47){return function(_0x111fb3){if(!_0x111fb3){_0x477f55[_0x913d('0x28')](0x194);}return _0x111fb3;};}function handleError(_0x5322dd,_0x315823){_0x315823=_0x315823||0x1f4;return function(_0x2e1c11){logger['error'](_0x2e1c11[_0x913d('0x29')]);if(_0x2e1c11['name']){delete _0x2e1c11[_0x913d('0x2a')];}_0x5322dd[_0x913d('0x1b')](_0x315823)[_0x913d('0x2b')](_0x2e1c11);};}exports[_0x913d('0x2c')]=function(_0x5d2daa,_0x23ab20){var _0x3cb89e={},_0x132f7b={},_0x165871={'count':0x0,'rows':[]};var _0x11ccf4=_[_0x913d('0x2d')](db[_0x913d('0x2e')]['rawAttributes'],function(_0x339e38){return{'name':_0x339e38[_0x913d('0x2f')],'type':_0x339e38[_0x913d('0x30')][_0x913d('0x31')]};});_0x132f7b[_0x913d('0x32')]=_[_0x913d('0x2d')](_0x11ccf4,_0x913d('0x2a'));_0x132f7b[_0x913d('0x33')]=_[_0x913d('0x34')](_0x5d2daa[_0x913d('0x33')]);_0x132f7b[_0x913d('0x35')]=_[_0x913d('0x36')](_0x132f7b['model'],_0x132f7b[_0x913d('0x33')]);_0x3cb89e[_0x913d('0x37')]=_[_0x913d('0x36')](_0x132f7b[_0x913d('0x32')],qs[_0x913d('0x38')](_0x5d2daa['query'][_0x913d('0x38')]));_0x3cb89e[_0x913d('0x37')]=_0x3cb89e[_0x913d('0x37')][_0x913d('0x39')]?_0x3cb89e['attributes']:_0x132f7b['model'];if(!_0x5d2daa[_0x913d('0x33')]['hasOwnProperty']('nolimit')){_0x3cb89e[_0x913d('0x20')]=qs[_0x913d('0x20')](_0x5d2daa[_0x913d('0x33')][_0x913d('0x20')]);_0x3cb89e['offset']=qs[_0x913d('0x1d')](_0x5d2daa[_0x913d('0x33')][_0x913d('0x1d')]);}_0x3cb89e['order']=qs['sort'](_0x5d2daa[_0x913d('0x33')][_0x913d('0x3a')]);_0x3cb89e['where']=qs[_0x913d('0x35')](_[_0x913d('0x3b')](_0x5d2daa[_0x913d('0x33')],_0x132f7b[_0x913d('0x35')]),_0x11ccf4);if(_0x5d2daa['query'][_0x913d('0x3c')]){_0x3cb89e[_0x913d('0x3d')]=_[_0x913d('0x3e')](_0x3cb89e[_0x913d('0x3d')],{'$or':_['map'](_0x11ccf4,function(_0x4b3c0c){if(_0x4b3c0c['type']!=='VIRTUAL'){var _0x4c379d={};_0x4c379d[_0x4b3c0c[_0x913d('0x2a')]]={'$like':'%'+_0x5d2daa[_0x913d('0x33')]['filter']+'%'};return _0x4c379d;}})});}_0x3cb89e=_[_0x913d('0x3e')]({},_0x3cb89e,_0x5d2daa[_0x913d('0x3f')]);var _0x9fb9e5={'where':_0x3cb89e[_0x913d('0x3d')]};return db[_0x913d('0x2e')]['count'](_0x9fb9e5)[_0x913d('0x26')](function(_0x36328d){_0x165871[_0x913d('0x1f')]=_0x36328d;if(_0x5d2daa['query'][_0x913d('0x40')]){_0x3cb89e[_0x913d('0x41')]=[{'all':!![]}];}return db[_0x913d('0x2e')][_0x913d('0x42')](_0x3cb89e);})['then'](function(_0x3a3c42){_0x165871[_0x913d('0x43')]=_0x3a3c42;return _0x165871;})[_0x913d('0x26')](respondWithFilteredResult(_0x23ab20,_0x3cb89e))[_0x913d('0x44')](handleError(_0x23ab20,null));};exports[_0x913d('0x45')]=function(_0x4352f1,_0x1ae146){var _0x592796={'raw':!![],'where':{'id':_0x4352f1[_0x913d('0x46')]['id']}},_0xbbc468={};_0xbbc468['model']=_[_0x913d('0x34')](db[_0x913d('0x2e')]['rawAttributes']);_0xbbc468[_0x913d('0x33')]=_[_0x913d('0x34')](_0x4352f1['query']);_0xbbc468[_0x913d('0x35')]=_['intersection'](_0xbbc468[_0x913d('0x32')],_0xbbc468[_0x913d('0x33')]);_0x592796['attributes']=_[_0x913d('0x36')](_0xbbc468[_0x913d('0x32')],qs['fields'](_0x4352f1['query'][_0x913d('0x38')]));_0x592796['attributes']=_0x592796['attributes'][_0x913d('0x39')]?_0x592796[_0x913d('0x37')]:_0xbbc468[_0x913d('0x32')];if(_0x4352f1['query']['includeAll']){_0x592796[_0x913d('0x41')]=[{'all':!![]}];}_0x592796=_[_0x913d('0x3e')]({},_0x592796,_0x4352f1['options']);return db[_0x913d('0x2e')]['find'](_0x592796)[_0x913d('0x26')](handleEntityNotFound(_0x1ae146,null))[_0x913d('0x26')](respondWithResult(_0x1ae146,null))['catch'](handleError(_0x1ae146,null));};exports[_0x913d('0x47')]=function(_0x5b4df9,_0x18779b){return db[_0x913d('0x2e')][_0x913d('0x47')](_0x5b4df9[_0x913d('0x48')],{})[_0x913d('0x26')](respondWithResult(_0x18779b,0xc9))[_0x913d('0x44')](handleError(_0x18779b,null));};exports['update']=function(_0x42332a,_0x2276ab){if(_0x42332a['body']['id']){delete _0x42332a['body']['id'];}return db[_0x913d('0x2e')][_0x913d('0x49')]({'where':{'id':_0x42332a[_0x913d('0x46')]['id']}})['then'](handleEntityNotFound(_0x2276ab,null))[_0x913d('0x26')](saveUpdates(_0x42332a['body'],null))[_0x913d('0x26')](respondWithResult(_0x2276ab,null))[_0x913d('0x44')](handleError(_0x2276ab,null));};exports[_0x913d('0x27')]=function(_0x34a786,_0x4d2596){return db[_0x913d('0x2e')][_0x913d('0x49')]({'where':{'id':_0x34a786['params']['id']}})[_0x913d('0x26')](handleEntityNotFound(_0x4d2596,null))[_0x913d('0x26')](removeEntity(_0x4d2596,null))[_0x913d('0x44')](handleError(_0x4d2596,null));};exports[_0x913d('0x4a')]=function(_0x3c6931,_0x100c50){return db[_0x913d('0x2e')][_0x913d('0x4a')]()['then'](respondWithResult(_0x100c50,null))[_0x913d('0x44')](handleError(_0x100c50,null));};
\ No newline at end of file
index 75872fb..12c4f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc556=['api','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util'];(function(_0x58f66b,_0x36449e){var _0x34bf87=function(_0x4700f1){while(--_0x4700f1){_0x58f66b['push'](_0x58f66b['shift']());}};_0x34bf87(++_0x36449e);}(_0xc556,0x9f));var _0x6c55=function(_0x396560,_0x2b7f75){_0x396560=_0x396560-0x0;var _0x8d6766=_0xc556[_0x396560];return _0x8d6766;};'use strict';var _=require('lodash');var util=require(_0x6c55('0x0'));var logger=require('../../config/logger')(_0x6c55('0x1'));var moment=require('moment');var BPromise=require(_0x6c55('0x2'));var rp=require(_0x6c55('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c55('0x4'));var config=require(_0x6c55('0x5'));var attributes=require(_0x6c55('0x6'));module[_0x6c55('0x7')]=function(_0x1cb597,_0x45f966){return _0x1cb597['define'](_0x6c55('0x8'),attributes,{'tableName':_0x6c55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdeed=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5c4088,_0x3f9b30){var _0x3dca0f=function(_0x5879ef){while(--_0x5879ef){_0x5c4088['push'](_0x5c4088['shift']());}};_0x3dca0f(++_0x3f9b30);}(_0xdeed,0x95));var _0xddee=function(_0x38d44c,_0x479077){_0x38d44c=_0x38d44c-0x0;var _0x370012=_0xdeed[_0x38d44c];return _0x370012;};'use strict';var _=require(_0xddee('0x0'));var util=require(_0xddee('0x1'));var logger=require(_0xddee('0x2'))('api');var moment=require(_0xddee('0x3'));var BPromise=require(_0xddee('0x4'));var rp=require(_0xddee('0x5'));var fs=require('fs');var path=require(_0xddee('0x6'));var rimraf=require(_0xddee('0x7'));var config=require(_0xddee('0x8'));var attributes=require(_0xddee('0x9'));module[_0xddee('0xa')]=function(_0x477d97,_0x73c93b){return _0x477d97[_0xddee('0xb')](_0xddee('0xc'),attributes,{'tableName':_0xddee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ebf449e..50096c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x056b=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x145295,_0x3f7bcd){var _0x4ffd76=function(_0x408269){while(--_0x408269){_0x145295['push'](_0x145295['shift']());}};_0x4ffd76(++_0x3f7bcd);}(_0x056b,0xb6));var _0xb056=function(_0x815c23,_0x577e3a){_0x815c23=_0x815c23-0x0;var _0x357aa1=_0x056b[_0x815c23];return _0x357aa1;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateSquareDetailsReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateSquareDetailsReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});};
\ No newline at end of file
+var _0x5a13=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch'];(function(_0x1aa798,_0x59802b){var _0x16f134=function(_0x54cd4a){while(--_0x54cd4a){_0x1aa798['push'](_0x1aa798['shift']());}};_0x16f134(++_0x59802b);}(_0x5a13,0x145));var _0x35a1=function(_0x517382,_0x534b94){_0x517382=_0x517382-0x0;var _0x396f12=_0x5a13[_0x517382];return _0x396f12;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}exports[_0x35a1('0x17')]=function(_0x1de373){var _0x5e4317=this;return new Promise(function(_0x3b17dc,_0xbeb751){return db[_0x35a1('0x18')][_0x35a1('0x19')](_0x1de373[_0x35a1('0x1a')],{'raw':_0x1de373[_0x35a1('0x1b')]?_0x1de373[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![]})[_0x35a1('0xd')](function(_0x5929e5){logger[_0x35a1('0x14')](_0x35a1('0x17'),_0x1de373);logger['debug'](_0x35a1('0x17'),_0x1de373,JSON[_0x35a1('0x10')](_0x5929e5));_0x3b17dc(_0x5929e5);})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x17'),_0xc13bad[_0x35a1('0x12')],_0x1de373);_0xbeb751(_0x5e4317[_0x35a1('0x13')](0x1f4,_0xc13bad['message']));});});};
\ No newline at end of file
index e2bcfdb..03699cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb477=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb477,0x17c));var _0x7b47=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb477[_0x1694f5];return _0x5b4321;};'use strict';var express=require(_0x7b47('0x0'));var router=express[_0x7b47('0x1')]();var auth=require(_0x7b47('0x2'));var controller=require(_0x7b47('0x3'));router[_0x7b47('0x4')]('/',auth[_0x7b47('0x5')](),controller[_0x7b47('0x6')]);router['get'](_0x7b47('0x7'),auth[_0x7b47('0x5')](),controller[_0x7b47('0x8')]);module[_0x7b47('0x9')]=router;
\ No newline at end of file
+var _0x45b3=['../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express'];(function(_0x7d8569,_0x2810c8){var _0x1b7291=function(_0x59fa3){while(--_0x59fa3){_0x7d8569['push'](_0x7d8569['shift']());}};_0x1b7291(++_0x2810c8);}(_0x45b3,0xef));var _0x345b=function(_0x3cf89d,_0x5c6c79){_0x3cf89d=_0x3cf89d-0x0;var _0x237ccf=_0x45b3[_0x3cf89d];return _0x237ccf;};'use strict';var express=require(_0x345b('0x0'));var router=express['Router']();var auth=require(_0x345b('0x1'));var controller=require(_0x345b('0x2'));router[_0x345b('0x3')]('/',auth[_0x345b('0x4')](),controller['index']);router['get'](_0x345b('0x5'),auth['isAuthenticated'](),controller[_0x345b('0x6')]);module[_0x345b('0x7')]=router;
\ No newline at end of file
index 75cc450..d433bc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf3=['length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','api','util','error','inspect','name','status','index','getAllData','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0x3bf3,0x19e));var _0x33bf=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0x3bf3[_0x1b92a6];return _0x24be5b;};'use strict';var info=require(_0x33bf('0x0'));var exec=require(_0x33bf('0x1'))['exec'];var logger=require('../../config/logger')(_0x33bf('0x2'));var util=require(_0x33bf('0x3'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x13645d,_0x8bd1e1,_0x4adbb8){_0x8bd1e1=_0x8bd1e1||0x1f4;return function(_0xfdbdcc){logger[_0x33bf('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4adbb8,_0x8bd1e1,util[_0x33bf('0x5')](_0xfdbdcc,{'showHidden':![],'depth':null}));delete _0xfdbdcc[_0x33bf('0x6')];_0x13645d[_0x33bf('0x7')](_0x8bd1e1)['send'](_0xfdbdcc);};}exports[_0x33bf('0x8')]=function(_0x28b0bb,_0x3d9ac4){return info[_0x33bf('0x9')]()['then'](function(_0x579a84){return _0x3d9ac4['status'](0xc8)[_0x33bf('0xa')](_0x579a84);})['catch'](function(_0x38d473){return _0x3d9ac4[_0x33bf('0x7')](0x1f4)[_0x33bf('0xa')](_0x38d473);});};exports[_0x33bf('0xb')]=function(_0xf5636,_0x246619){var _0x1ba255=[_0x33bf('0xc')];return new BPromise(function(_0x280cb4,_0x385891){return exec(util[_0x33bf('0xd')](_0x33bf('0xe'),_0xf5636[_0x33bf('0xf')]['pid']),function(_0x2c7ee3,_0x236ef4,_0x2fd2ef){if(_0x2c7ee3){return _0x385891(_0x2c7ee3);}return _0x280cb4(_0x236ef4);});})[_0x33bf('0x10')](function(_0x1d6233){var _0x36271b=![];var _0x417b74=_0x1d6233[_0x33bf('0x11')](/\n/);for(var _0x4f9614=0x0,_0x3a30ab=_0x1ba255[_0x33bf('0x12')];_0x4f9614<_0x3a30ab,_0x36271b===![];_0x4f9614+=0x1){if(_0x1d6233['indexOf'](_0x1ba255[_0x4f9614])>=0x0){_0x36271b=!![];}}if(!_0x36271b){throw new Error(util['format'](_0x33bf('0x13'),_0xf5636[_0x33bf('0xf')][_0x33bf('0x14')]));}process['kill'](_0xf5636[_0x33bf('0xf')][_0x33bf('0x14')],_0x33bf('0x15'));return _0x246619[_0x33bf('0x7')](0xc8)[_0x33bf('0xa')]({'message':util[_0x33bf('0xd')](_0x33bf('0x16'),_0xf5636[_0x33bf('0xf')]['pid'])});})[_0x33bf('0x17')](handleError(_0x246619,null,_0x33bf('0xb')));};
\ No newline at end of file
+var _0xb156=['api','util','bluebird','lodash','error','name','status','send','index','getAllData','then','json','catch','killProcess','format','params','pid','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger'];(function(_0x46feb0,_0x5b6687){var _0x1a6785=function(_0x31ff03){while(--_0x31ff03){_0x46feb0['push'](_0x46feb0['shift']());}};_0x1a6785(++_0x5b6687);}(_0xb156,0x142));var _0x6b15=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xb156[_0x59342a];return _0x17abc9;};'use strict';var info=require(_0x6b15('0x0'));var exec=require(_0x6b15('0x1'))['exec'];var logger=require(_0x6b15('0x2'))(_0x6b15('0x3'));var util=require(_0x6b15('0x4'));var BPromise=require(_0x6b15('0x5'));var _=require(_0x6b15('0x6'));function handleError(_0x57bcaf,_0x336840,_0x4079f1){_0x336840=_0x336840||0x1f4;return function(_0x5e63f4){logger[_0x6b15('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4079f1,_0x336840,util['inspect'](_0x5e63f4,{'showHidden':![],'depth':null}));delete _0x5e63f4[_0x6b15('0x8')];_0x57bcaf[_0x6b15('0x9')](_0x336840)[_0x6b15('0xa')](_0x5e63f4);};}exports[_0x6b15('0xb')]=function(_0x49a751,_0x1517bf){return info[_0x6b15('0xc')]()[_0x6b15('0xd')](function(_0x59cd8b){return _0x1517bf[_0x6b15('0x9')](0xc8)[_0x6b15('0xe')](_0x59cd8b);})[_0x6b15('0xf')](function(_0x2687c5){return _0x1517bf['status'](0x1f4)['json'](_0x2687c5);});};exports[_0x6b15('0x10')]=function(_0x491920,_0x106852){var _0x5a88b5=['components/import/cm'];return new BPromise(function(_0x23e628,_0x227011){return exec(util[_0x6b15('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x491920[_0x6b15('0x12')][_0x6b15('0x13')]),function(_0x4b48fe,_0x6d3a,_0x47053c){if(_0x4b48fe){return _0x227011(_0x4b48fe);}return _0x23e628(_0x6d3a);});})[_0x6b15('0xd')](function(_0x29a5d7){var _0x1aeb7c=![];var _0x2fa80e=_0x29a5d7['split'](/\n/);for(var _0x4ab273=0x0,_0xdbc7f4=_0x5a88b5[_0x6b15('0x14')];_0x4ab273<_0xdbc7f4,_0x1aeb7c===![];_0x4ab273+=0x1){if(_0x29a5d7[_0x6b15('0x15')](_0x5a88b5[_0x4ab273])>=0x0){_0x1aeb7c=!![];}}if(!_0x1aeb7c){throw new Error(util[_0x6b15('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x491920[_0x6b15('0x12')]['pid']));}process[_0x6b15('0x16')](_0x491920['params'][_0x6b15('0x13')],_0x6b15('0x17'));return _0x106852[_0x6b15('0x9')](0xc8)[_0x6b15('0xe')]({'message':util[_0x6b15('0x11')](_0x6b15('0x18'),_0x491920['params'][_0x6b15('0x13')])});})[_0x6b15('0xf')](handleError(_0x106852,null,_0x6b15('0x10')));};
\ No newline at end of file
index 41d28ab..1fb4eb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x333a=['../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x382275,_0x18b723){var _0x2ad906=function(_0x374a96){while(--_0x374a96){_0x382275['push'](_0x382275['shift']());}};_0x2ad906(++_0x18b723);}(_0x333a,0xe0));var _0xa333=function(_0x4ed40f,_0xea54d){_0x4ed40f=_0x4ed40f-0x0;var _0x345549=_0x333a[_0x4ed40f];return _0x345549;};'use strict';var multer=require(_0xa333('0x0'));var util=require(_0xa333('0x1'));var path=require('path');var timeout=require(_0xa333('0x2'));var express=require(_0xa333('0x3'));var router=express[_0xa333('0x4')]();var fs_extra=require(_0xa333('0x5'));var auth=require(_0xa333('0x6'));var interaction=require(_0xa333('0x7'));var config=require(_0xa333('0x8'));var controller=require(_0xa333('0x9'));router[_0xa333('0xa')]('/',auth[_0xa333('0xb')](),controller[_0xa333('0xc')]);router['get'](_0xa333('0xd'),auth[_0xa333('0xb')](),controller[_0xa333('0xe')]);router[_0xa333('0xf')]('/',auth[_0xa333('0xb')](),controller[_0xa333('0x10')]);router[_0xa333('0x11')](_0xa333('0xd'),auth[_0xa333('0xb')](),controller[_0xa333('0x12')]);router[_0xa333('0x13')](_0xa333('0xd'),auth[_0xa333('0xb')](),controller[_0xa333('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x865c=['put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x294925,_0x314390){var _0x537733=function(_0x28c2e0){while(--_0x28c2e0){_0x294925['push'](_0x294925['shift']());}};_0x537733(++_0x314390);}(_0x865c,0x158));var _0xc865=function(_0x1a663b,_0x17c2c1){_0x1a663b=_0x1a663b-0x0;var _0x108060=_0x865c[_0x1a663b];return _0x108060;};'use strict';var multer=require(_0xc865('0x0'));var util=require(_0xc865('0x1'));var path=require(_0xc865('0x2'));var timeout=require(_0xc865('0x3'));var express=require('express');var router=express[_0xc865('0x4')]();var fs_extra=require(_0xc865('0x5'));var auth=require(_0xc865('0x6'));var interaction=require(_0xc865('0x7'));var config=require(_0xc865('0x8'));var controller=require(_0xc865('0x9'));router[_0xc865('0xa')]('/',auth[_0xc865('0xb')](),controller[_0xc865('0xc')]);router[_0xc865('0xa')](_0xc865('0xd'),auth['isAuthenticated'](),controller[_0xc865('0xe')]);router[_0xc865('0xf')]('/',auth[_0xc865('0xb')](),controller['create']);router[_0xc865('0x10')]('/:id',auth[_0xc865('0xb')](),controller[_0xc865('0x11')]);router[_0xc865('0x12')](_0xc865('0xd'),auth[_0xc865('0xb')](),controller['destroy']);module[_0xc865('0x13')]=router;
\ No newline at end of file
index 13036f8..e38d149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7b5=['STRING','name','sequelize','exports'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0xa7b5,0x162));var _0x5a7b=function(_0x28558c,_0x38ef0f){_0x28558c=_0x28558c-0x0;var _0x377673=_0xa7b5[_0x28558c];return _0x377673;};'use strict';var Sequelize=require(_0x5a7b('0x0'));module[_0x5a7b('0x1')]={'name':{'type':Sequelize[_0x5a7b('0x2')],'unique':_0x5a7b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5a7b('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x5a7b('0x2')]}};
\ No newline at end of file
+var _0x1d21=['exports','STRING','name','#0091EA','sequelize'];(function(_0x1d6265,_0x5369f0){var _0x181161=function(_0x50c558){while(--_0x50c558){_0x1d6265['push'](_0x1d6265['shift']());}};_0x181161(++_0x5369f0);}(_0x1d21,0x158));var _0x11d2=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x1d21[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'name':{'type':Sequelize[_0x11d2('0x2')],'unique':_0x11d2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x11d2('0x4')},'description':{'type':Sequelize[_0x11d2('0x2')]}};
\ No newline at end of file
index 9b51d24..feadf9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb205=['fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','offset','limit','undefined','count','set','json','reject','update','destroy','then','get','UserProfileResource','end','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Tags','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir'];(function(_0x43818b,_0x15b8cf){var _0x2233e2=function(_0x71635){while(--_0x71635){_0x43818b['push'](_0x43818b['shift']());}};_0x2233e2(++_0x15b8cf);}(_0xb205,0xf0));var _0x5b20=function(_0x43f285,_0x233982){_0x43f285=_0x43f285-0x0;var _0x3c01e0=_0xb205[_0x43f285];return _0x3c01e0;};'use strict';var emlformat=require(_0x5b20('0x0'));var rimraf=require(_0x5b20('0x1'));var zipdir=require(_0x5b20('0x2'));var jsonpatch=require(_0x5b20('0x3'));var rp=require(_0x5b20('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b20('0x5'));var util=require('util');var path=require(_0x5b20('0x6'));var sox=require(_0x5b20('0x7'));var csv=require('to-csv');var ejs=require(_0x5b20('0x8'));var fs=require('fs');var fs_extra=require(_0x5b20('0x9'));var _=require(_0x5b20('0xa'));var squel=require('squel');var crypto=require(_0x5b20('0xb'));var jsforce=require(_0x5b20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b20('0xd'));var Papa=require(_0x5b20('0xe'));var Redis=require(_0x5b20('0xf'));var authService=require(_0x5b20('0x10'));var qs=require(_0x5b20('0x11'));var as=require(_0x5b20('0x12'));var hardwareService=require(_0x5b20('0x13'));var logger=require('../../config/logger')(_0x5b20('0x14'));var utils=require(_0x5b20('0x15'));var config=require(_0x5b20('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a13ac,_0x374632){_0x374632=_0x374632||0xcc;return function(_0xf721a0){if(_0xf721a0){return _0x2a13ac[_0x5b20('0x17')](_0x374632);}return _0x2a13ac[_0x5b20('0x18')](_0x374632)['end']();};}function respondWithResult(_0x42fbb0,_0x32c2df){_0x32c2df=_0x32c2df||0xc8;return function(_0x180185){if(_0x180185){return _0x42fbb0[_0x5b20('0x18')](_0x32c2df)['json'](_0x180185);}};}function respondWithFilteredResult(_0x5247f9,_0x25b9ab){return function(_0x47e80f){if(_0x47e80f){var _0x5ac9db=typeof _0x25b9ab[_0x5b20('0x19')]==='undefined'&&typeof _0x25b9ab[_0x5b20('0x1a')]===_0x5b20('0x1b');var _0x3b9e74=_0x47e80f['count'];var _0x44ac15=_0x5ac9db?0x0:_0x25b9ab[_0x5b20('0x19')];var _0x3e37ef=_0x5ac9db?_0x47e80f[_0x5b20('0x1c')]:_0x25b9ab['offset']+_0x25b9ab[_0x5b20('0x1a')];var _0x55ae4d;if(_0x3e37ef>=_0x3b9e74){_0x3e37ef=_0x3b9e74;_0x55ae4d=0xc8;}else{_0x55ae4d=0xce;}_0x5247f9[_0x5b20('0x18')](_0x55ae4d);return _0x5247f9[_0x5b20('0x1d')]('Content-Range',_0x44ac15+'-'+_0x3e37ef+'/'+_0x3b9e74)[_0x5b20('0x1e')](_0x47e80f);}return null;};}function patchUpdates(_0x54cdf3){return function(_0x3b7aea){try{jsonpatch['apply'](_0x3b7aea,_0x54cdf3,!![]);}catch(_0x28fd12){return BPromise[_0x5b20('0x1f')](_0x28fd12);}return _0x3b7aea['save']();};}function saveUpdates(_0x2d404f,_0x52e27f){return function(_0x4f291e){if(_0x4f291e){return _0x4f291e[_0x5b20('0x20')](_0x2d404f)['then'](function(_0x4b4076){return _0x4b4076;});}return null;};}function removeEntity(_0x37ab76,_0x18f555){return function(_0x9301c7){if(_0x9301c7){return _0x9301c7[_0x5b20('0x21')]()[_0x5b20('0x22')](function(){var _0xb0f07e=_0x9301c7[_0x5b20('0x23')]({'plain':!![]});var _0x3bcee0='Tags';return db[_0x5b20('0x24')][_0x5b20('0x21')]({'where':{'type':_0x3bcee0,'resourceId':_0xb0f07e['id']}})[_0x5b20('0x22')](function(){return _0x9301c7;});})[_0x5b20('0x22')](function(){_0x37ab76[_0x5b20('0x18')](0xcc)[_0x5b20('0x25')]();});}};}function handleEntityNotFound(_0x50d335,_0x16ff2d){return function(_0x49a15d){if(!_0x49a15d){_0x50d335[_0x5b20('0x17')](0x194);}return _0x49a15d;};}function handleError(_0x1b8965,_0x1d4c46){_0x1d4c46=_0x1d4c46||0x1f4;return function(_0x516f16){logger['error'](_0x516f16[_0x5b20('0x26')]);if(_0x516f16[_0x5b20('0x27')]){delete _0x516f16['name'];}_0x1b8965['status'](_0x1d4c46)[_0x5b20('0x28')](_0x516f16);};}exports['index']=function(_0x3aee17,_0x13d302){var _0x3f599c={},_0x344688={},_0x5549a3={'count':0x0,'rows':[]};var _0x349abc=_[_0x5b20('0x29')](db[_0x5b20('0x2a')][_0x5b20('0x2b')],function(_0x5ce609){return{'name':_0x5ce609[_0x5b20('0x2c')],'type':_0x5ce609[_0x5b20('0x2d')][_0x5b20('0x2e')]};});_0x344688[_0x5b20('0x2f')]=_[_0x5b20('0x29')](_0x349abc,_0x5b20('0x27'));_0x344688[_0x5b20('0x30')]=_[_0x5b20('0x31')](_0x3aee17[_0x5b20('0x30')]);_0x344688[_0x5b20('0x32')]=_[_0x5b20('0x33')](_0x344688[_0x5b20('0x2f')],_0x344688[_0x5b20('0x30')]);_0x3f599c[_0x5b20('0x34')]=_[_0x5b20('0x33')](_0x344688['model'],qs['fields'](_0x3aee17['query'][_0x5b20('0x35')]));_0x3f599c[_0x5b20('0x34')]=_0x3f599c[_0x5b20('0x34')][_0x5b20('0x36')]?_0x3f599c[_0x5b20('0x34')]:_0x344688['model'];if(!_0x3aee17[_0x5b20('0x30')][_0x5b20('0x37')](_0x5b20('0x38'))){_0x3f599c[_0x5b20('0x1a')]=qs[_0x5b20('0x1a')](_0x3aee17[_0x5b20('0x30')][_0x5b20('0x1a')]);_0x3f599c['offset']=qs['offset'](_0x3aee17['query'][_0x5b20('0x19')]);}_0x3f599c[_0x5b20('0x39')]=qs[_0x5b20('0x3a')](_0x3aee17[_0x5b20('0x30')][_0x5b20('0x3a')]);_0x3f599c[_0x5b20('0x3b')]=qs['filters'](_['pick'](_0x3aee17[_0x5b20('0x30')],_0x344688[_0x5b20('0x32')]),_0x349abc);if(_0x3aee17['query'][_0x5b20('0x3c')]){_0x3f599c[_0x5b20('0x3b')]=_[_0x5b20('0x3d')](_0x3f599c[_0x5b20('0x3b')],{'$or':_[_0x5b20('0x29')](_0x349abc,function(_0x1899e1){if(_0x1899e1[_0x5b20('0x2d')]!==_0x5b20('0x3e')){var _0xce0cec={};_0xce0cec[_0x1899e1[_0x5b20('0x27')]]={'$like':'%'+_0x3aee17[_0x5b20('0x30')][_0x5b20('0x3c')]+'%'};return _0xce0cec;}})});}_0x3f599c=_['merge']({},_0x3f599c,_0x3aee17[_0x5b20('0x3f')]);var _0x14a9a0={'where':_0x3f599c[_0x5b20('0x3b')]};return db[_0x5b20('0x2a')][_0x5b20('0x1c')](_0x14a9a0)[_0x5b20('0x22')](function(_0x452560){_0x5549a3[_0x5b20('0x1c')]=_0x452560;if(_0x3aee17[_0x5b20('0x30')][_0x5b20('0x40')]){_0x3f599c[_0x5b20('0x41')]=[{'all':!![]}];}return db[_0x5b20('0x2a')][_0x5b20('0x42')](_0x3f599c);})[_0x5b20('0x22')](function(_0x831edd){_0x5549a3[_0x5b20('0x43')]=_0x831edd;return _0x5549a3;})[_0x5b20('0x22')](respondWithFilteredResult(_0x13d302,_0x3f599c))[_0x5b20('0x44')](handleError(_0x13d302,null));};exports[_0x5b20('0x45')]=function(_0x106c62,_0x3c90e2){var _0xa30aba={'raw':!![],'where':{'id':_0x106c62[_0x5b20('0x46')]['id']}},_0x13326e={};_0x13326e[_0x5b20('0x2f')]=_[_0x5b20('0x31')](db[_0x5b20('0x2a')]['rawAttributes']);_0x13326e[_0x5b20('0x30')]=_[_0x5b20('0x31')](_0x106c62[_0x5b20('0x30')]);_0x13326e[_0x5b20('0x32')]=_[_0x5b20('0x33')](_0x13326e[_0x5b20('0x2f')],_0x13326e[_0x5b20('0x30')]);_0xa30aba['attributes']=_[_0x5b20('0x33')](_0x13326e[_0x5b20('0x2f')],qs[_0x5b20('0x35')](_0x106c62[_0x5b20('0x30')][_0x5b20('0x35')]));_0xa30aba[_0x5b20('0x34')]=_0xa30aba[_0x5b20('0x34')]['length']?_0xa30aba[_0x5b20('0x34')]:_0x13326e[_0x5b20('0x2f')];if(_0x106c62['query'][_0x5b20('0x40')]){_0xa30aba[_0x5b20('0x41')]=[{'all':!![]}];}_0xa30aba=_['merge']({},_0xa30aba,_0x106c62[_0x5b20('0x3f')]);return db[_0x5b20('0x2a')][_0x5b20('0x47')](_0xa30aba)[_0x5b20('0x22')](handleEntityNotFound(_0x3c90e2,null))[_0x5b20('0x22')](respondWithResult(_0x3c90e2,null))[_0x5b20('0x44')](handleError(_0x3c90e2,null));};exports[_0x5b20('0x48')]=function(_0x36c204,_0x58bd13){return db[_0x5b20('0x2a')][_0x5b20('0x48')](_0x36c204[_0x5b20('0x49')],{})[_0x5b20('0x22')](function(_0x27c4d1){var _0x380d76=_0x36c204['user'][_0x5b20('0x23')]({'plain':!![]});if(!_0x380d76)throw new Error(_0x5b20('0x4a'));if(_0x380d76['role']===_0x5b20('0x4b')){var _0x48d5f2=_0x27c4d1[_0x5b20('0x23')]({'plain':!![]});var _0x3c224d=_0x5b20('0x4c');return db[_0x5b20('0x4d')]['find']({'where':{'name':_0x3c224d,'userProfileId':_0x380d76[_0x5b20('0x4e')]},'raw':!![]})[_0x5b20('0x22')](function(_0x1bcead){if(_0x1bcead&&_0x1bcead[_0x5b20('0x4f')]===0x0){return db[_0x5b20('0x24')][_0x5b20('0x48')]({'name':_0x48d5f2[_0x5b20('0x27')],'resourceId':_0x48d5f2['id'],'type':_0x1bcead['name'],'sectionId':_0x1bcead['id']},{})['then'](function(){return _0x27c4d1;});}else{return _0x27c4d1;}})[_0x5b20('0x44')](function(_0x31d8b2){logger[_0x5b20('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31d8b2);throw _0x31d8b2;});}return _0x27c4d1;})[_0x5b20('0x22')](respondWithResult(_0x58bd13,0xc9))[_0x5b20('0x44')](handleError(_0x58bd13,null));};exports[_0x5b20('0x20')]=function(_0x5ab93d,_0x33ec01){if(_0x5ab93d[_0x5b20('0x49')]['id']){delete _0x5ab93d[_0x5b20('0x49')]['id'];}return db['Tag'][_0x5b20('0x47')]({'where':{'id':_0x5ab93d['params']['id']}})[_0x5b20('0x22')](handleEntityNotFound(_0x33ec01,null))[_0x5b20('0x22')](saveUpdates(_0x5ab93d[_0x5b20('0x49')],null))[_0x5b20('0x22')](respondWithResult(_0x33ec01,null))['catch'](handleError(_0x33ec01,null));};exports[_0x5b20('0x21')]=function(_0x5416ab,_0x15e8a1){return db['Tag']['find']({'where':{'id':_0x5416ab[_0x5b20('0x46')]['id']}})[_0x5b20('0x22')](handleEntityNotFound(_0x15e8a1,null))[_0x5b20('0x22')](removeEntity(_0x15e8a1,null))[_0x5b20('0x44')](handleError(_0x15e8a1,null));};
\ No newline at end of file
+var _0x04b8=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Tags','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x59677b,_0x34704c){var _0x246e3d=function(_0x35fb13){while(--_0x35fb13){_0x59677b['push'](_0x59677b['shift']());}};_0x246e3d(++_0x34704c);}(_0x04b8,0x159));var _0x804b=function(_0x18a63a,_0x259cec){_0x18a63a=_0x18a63a-0x0;var _0x2cca04=_0x04b8[_0x18a63a];return _0x2cca04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['Tag'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['Tag'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['Tag']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Tags';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));};
\ No newline at end of file
index c903a10..df75fbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfb=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define','Tag','lodash','util'];(function(_0x1c061b,_0x5d0a59){var _0x3fa86d=function(_0xea4a31){while(--_0xea4a31){_0x1c061b['push'](_0x1c061b['shift']());}};_0x3fa86d(++_0x5d0a59);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x2b591d,_0x51995f){_0x2b591d=_0x2b591d-0x0;var _0x110e8d=_0x3cfb[_0x2b591d];return _0x110e8d;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var logger=require(_0xb3cf('0x2'))(_0xb3cf('0x3'));var moment=require(_0xb3cf('0x4'));var BPromise=require(_0xb3cf('0x5'));var rp=require(_0xb3cf('0x6'));var fs=require('fs');var path=require(_0xb3cf('0x7'));var rimraf=require('rimraf');var config=require(_0xb3cf('0x8'));var attributes=require(_0xb3cf('0x9'));module[_0xb3cf('0xa')]=function(_0x59c604,_0x2e5c00){return _0x59c604[_0xb3cf('0xb')](_0xb3cf('0xc'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ab9=['./tag.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x22d2e5,_0x3e4d19){var _0x2611ba=function(_0x8f5b16){while(--_0x8f5b16){_0x22d2e5['push'](_0x22d2e5['shift']());}};_0x2611ba(++_0x3e4d19);}(_0x9ab9,0x71));var _0x99ab=function(_0x2968c0,_0x2b1d27){_0x2968c0=_0x2968c0-0x0;var _0x21c998=_0x9ab9[_0x2968c0];return _0x21c998;};'use strict';var _=require(_0x99ab('0x0'));var util=require(_0x99ab('0x1'));var logger=require(_0x99ab('0x2'))('api');var moment=require(_0x99ab('0x3'));var BPromise=require(_0x99ab('0x4'));var rp=require(_0x99ab('0x5'));var fs=require('fs');var path=require(_0x99ab('0x6'));var rimraf=require(_0x99ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x99ab('0x8'));module[_0x99ab('0x9')]=function(_0x18c147,_0xa0291a){return _0x18c147[_0x99ab('0xa')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aede017..73d47a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b19=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x4a048a,_0x5cd027){var _0x1bc1ba=function(_0x5ac1ea){while(--_0x5ac1ea){_0x4a048a['push'](_0x4a048a['shift']());}};_0x1bc1ba(++_0x5cd027);}(_0x4b19,0x195));var _0x94b1=function(_0x4da772,_0x33bb8e){_0x4da772=_0x4da772-0x0;var _0x24fd35=_0x4b19[_0x4da772];return _0x24fd35;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var moment=require(_0x94b1('0x1'));var BPromise=require(_0x94b1('0x2'));var rs=require(_0x94b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b1('0x4'))['db'];var utils=require(_0x94b1('0x5'));var logger=require(_0x94b1('0x6'))('rpc');var config=require(_0x94b1('0x7'));var jayson=require(_0x94b1('0x8'));var client=jayson['client'][_0x94b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110a52,_0x4ea1f9,_0x40c69c){return new BPromise(function(_0x201a02,_0xad0a85){return client['request'](_0x110a52,_0x40c69c)[_0x94b1('0xa')](function(_0x4f948b){logger['info'](_0x94b1('0xb'),_0x4ea1f9,_0x94b1('0xc'));logger[_0x94b1('0xd')](_0x94b1('0xe'),_0x4ea1f9,_0x94b1('0xc'),JSON[_0x94b1('0xf')](_0x4f948b));if(_0x4f948b['error']){if(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x11')]===0x1f4){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x4f948b['error']['message']);return _0xad0a85(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);}logger['error']('Tag,\x20%s,\x20%s',_0x4ea1f9,_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);return _0x201a02(_0x4f948b['error'][_0x94b1('0x12')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x4ea1f9,_0x94b1('0xc'));_0x201a02(_0x4f948b[_0x94b1('0x13')][_0x94b1('0x12')]);}})[_0x94b1('0x14')](function(_0x494138){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x494138);_0xad0a85(_0x494138);});});}
\ No newline at end of file
+var _0xe181=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xe181,0x68));var _0x1e18=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0xe181[_0x3e21f4];return _0x40fc49;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var moment=require(_0x1e18('0x1'));var BPromise=require(_0x1e18('0x2'));var rs=require(_0x1e18('0x3'));var fs=require('fs');var Redis=require(_0x1e18('0x4'));var db=require(_0x1e18('0x5'))['db'];var utils=require(_0x1e18('0x6'));var logger=require(_0x1e18('0x7'))('rpc');var config=require(_0x1e18('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x182c98,_0x46ba95,_0x25b786){return new BPromise(function(_0x9f9541,_0x398f77){return client['request'](_0x182c98,_0x25b786)[_0x1e18('0xa')](function(_0x40fda9){logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));logger[_0x1e18('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x46ba95,_0x1e18('0xd'),JSON[_0x1e18('0xf')](_0x40fda9));if(_0x40fda9[_0x1e18('0x10')]){if(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x11')]===0x1f4){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x40fda9[_0x1e18('0x10')]['message']);return _0x398f77(_0x40fda9[_0x1e18('0x10')]['message']);}logger[_0x1e18('0x10')]('Tag,\x20%s,\x20%s',_0x46ba95,_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);return _0x9f9541(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);}else{logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));_0x9f9541(_0x40fda9[_0x1e18('0x13')][_0x1e18('0x12')]);}})[_0x1e18('0x14')](function(_0x12ef98){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x12ef98);_0x398f77(_0x12ef98);});});}
\ No newline at end of file
index 7348adf..4ac80cc 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 235978e..6b75b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['name','exports','STRING'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
+var _0x757a=['exports','STRING'];(function(_0x2b2368,_0x36937c){var _0x32f65b=function(_0x4bffe7){while(--_0x4bffe7){_0x2b2368['push'](_0x2b2368['shift']());}};_0x32f65b(++_0x36937c);}(_0x757a,0xde));var _0xa757=function(_0x57389a,_0x292346){_0x57389a=_0x57389a-0x0;var _0x2b2e3b=_0x757a[_0x57389a];return _0x2b2e3b;};'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 f2a1de3..2ada2a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x016f=['squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','map','Team','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','filters','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','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','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','Teams','getQueues','findOne','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','channel','ids','removeQueues','isValidChannel','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','penalty','QueueId','defaults','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','interface','format','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','upsert','VoicePrefixId','spread','removeAgents','Openchannel','getAgents','hasOwnProperty','zip-dir','request-promise','mustache','util','ejs','lodash'];(function(_0x6ecec9,_0x17b3ae){var _0x211f13=function(_0x30ede1){while(--_0x30ede1){_0x6ecec9['push'](_0x6ecec9['shift']());}};_0x211f13(++_0x17b3ae);}(_0x016f,0x1bc));var _0xf016=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x016f[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf016('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf016('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf016('0x2'));var util=require(_0xf016('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf016('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf016('0x5'));var squel=require(_0xf016('0x6'));var crypto=require(_0xf016('0x7'));var jsforce=require(_0xf016('0x8'));var deskjs=require(_0xf016('0x9'));var toCsv=require(_0xf016('0xa'));var querystring=require('querystring');var Papa=require(_0xf016('0xb'));var Redis=require(_0xf016('0xc'));var authService=require(_0xf016('0xd'));var qs=require(_0xf016('0xe'));var as=require(_0xf016('0xf'));var hardwareService=require(_0xf016('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf016('0x11'));var config=require(_0xf016('0x12'));var licenseUtil=require(_0xf016('0x13'));var db=require(_0xf016('0x14'))['db'];config[_0xf016('0x15')]=_['defaults'](config[_0xf016('0x15')],{'host':_0xf016('0x16'),'port':0x18eb});var socket=require(_0xf016('0x17'))(new Redis(config[_0xf016('0x15')]));require(_0xf016('0x18'))[_0xf016('0x19')](socket);function respondWithStatusCode(_0x50e515,_0x30ea2d){_0x30ea2d=_0x30ea2d||0xcc;return function(_0x12a84f){if(_0x12a84f){return _0x50e515[_0xf016('0x1a')](_0x30ea2d);}return _0x50e515[_0xf016('0x1b')](_0x30ea2d)['end']();};}function respondWithResult(_0x515d6f,_0x12d269){_0x12d269=_0x12d269||0xc8;return function(_0x536897){if(_0x536897){return _0x515d6f['status'](_0x12d269)['json'](_0x536897);}};}function respondWithFilteredResult(_0x306f74,_0x5afa20){return function(_0x1ab35f){if(_0x1ab35f){var _0x9e1b44=typeof _0x5afa20[_0xf016('0x1c')]===_0xf016('0x1d')&&typeof _0x5afa20[_0xf016('0x1e')]===_0xf016('0x1d');var _0x7a0901=_0x1ab35f['count'];var _0x9e55f1=_0x9e1b44?0x0:_0x5afa20[_0xf016('0x1c')];var _0x947632=_0x9e1b44?_0x1ab35f[_0xf016('0x1f')]:_0x5afa20['offset']+_0x5afa20[_0xf016('0x1e')];var _0x3959c9;if(_0x947632>=_0x7a0901){_0x947632=_0x7a0901;_0x3959c9=0xc8;}else{_0x3959c9=0xce;}_0x306f74[_0xf016('0x1b')](_0x3959c9);return _0x306f74[_0xf016('0x20')](_0xf016('0x21'),_0x9e55f1+'-'+_0x947632+'/'+_0x7a0901)['json'](_0x1ab35f);}return null;};}function patchUpdates(_0x113d9f){return function(_0x39282a){try{jsonpatch[_0xf016('0x22')](_0x39282a,_0x113d9f,!![]);}catch(_0x1b3390){return BPromise[_0xf016('0x23')](_0x1b3390);}return _0x39282a['save']();};}function saveUpdates(_0x5ab61d,_0x40d7be){return function(_0x1fdb8c){if(_0x1fdb8c){return _0x1fdb8c[_0xf016('0x24')](_0x5ab61d)[_0xf016('0x25')](function(_0x235f7c){return _0x235f7c;});}return null;};}function handleEntityNotFound(_0x3d404b,_0xcc883){return function(_0x1d599d){if(!_0x1d599d){_0x3d404b[_0xf016('0x1a')](0x194);}return _0x1d599d;};}function handleError(_0x387848,_0x2a162c){_0x2a162c=_0x2a162c||0x1f4;return function(_0x12071d){logger[_0xf016('0x26')](_0x12071d['stack']);if(_0x12071d[_0xf016('0x27')]){delete _0x12071d[_0xf016('0x27')];}_0x387848[_0xf016('0x1b')](_0x2a162c)[_0xf016('0x28')](_0x12071d);};}exports['index']=function(_0x12532a,_0x1488cb){var _0x24270={},_0x3f8180={},_0x4e53a9={'count':0x0,'rows':[]};var _0x3c6722=_[_0xf016('0x29')](db[_0xf016('0x2a')][_0xf016('0x2b')],function(_0x3beb36){return{'name':_0x3beb36[_0xf016('0x2c')],'type':_0x3beb36[_0xf016('0x2d')][_0xf016('0x2e')]};});_0x3f8180['model']=_['map'](_0x3c6722,'name');_0x3f8180[_0xf016('0x2f')]=_['keys'](_0x12532a[_0xf016('0x2f')]);_0x3f8180['filters']=_[_0xf016('0x30')](_0x3f8180[_0xf016('0x31')],_0x3f8180[_0xf016('0x2f')]);_0x24270[_0xf016('0x32')]=_[_0xf016('0x30')](_0x3f8180['model'],qs[_0xf016('0x33')](_0x12532a['query'][_0xf016('0x33')]));_0x24270[_0xf016('0x32')]=_0x24270[_0xf016('0x32')][_0xf016('0x34')]?_0x24270[_0xf016('0x32')]:_0x3f8180[_0xf016('0x31')];if(!_0x12532a[_0xf016('0x2f')]['hasOwnProperty'](_0xf016('0x35'))){_0x24270[_0xf016('0x1e')]=qs['limit'](_0x12532a[_0xf016('0x2f')]['limit']);_0x24270[_0xf016('0x1c')]=qs[_0xf016('0x1c')](_0x12532a[_0xf016('0x2f')][_0xf016('0x1c')]);}_0x24270[_0xf016('0x36')]=qs['sort'](_0x12532a[_0xf016('0x2f')][_0xf016('0x37')]);_0x24270['where']=qs['filters'](_[_0xf016('0x38')](_0x12532a[_0xf016('0x2f')],_0x3f8180['filters']),_0x3c6722);if(_0x12532a[_0xf016('0x2f')][_0xf016('0x39')]){_0x24270['where']=_[_0xf016('0x3a')](_0x24270[_0xf016('0x3b')],{'$or':_[_0xf016('0x29')](_0x3c6722,function(_0x7fd24){if(_0x7fd24[_0xf016('0x2d')]!==_0xf016('0x3c')){var _0x4a8626={};_0x4a8626[_0x7fd24[_0xf016('0x27')]]={'$like':'%'+_0x12532a['query'][_0xf016('0x39')]+'%'};return _0x4a8626;}})});}_0x24270=_['merge']({},_0x24270,_0x12532a[_0xf016('0x3d')]);var _0x3a598b={'where':_0x24270[_0xf016('0x3b')]};return db[_0xf016('0x2a')][_0xf016('0x1f')](_0x3a598b)[_0xf016('0x25')](function(_0x4815d9){_0x4e53a9[_0xf016('0x1f')]=_0x4815d9;if(_0x12532a['query'][_0xf016('0x3e')]){_0x24270[_0xf016('0x3f')]=[{'all':!![]}];}return db['Team'][_0xf016('0x40')](_0x24270);})[_0xf016('0x25')](function(_0x18934){_0x4e53a9['rows']=_0x18934;return _0x4e53a9;})[_0xf016('0x25')](respondWithFilteredResult(_0x1488cb,_0x24270))[_0xf016('0x41')](handleError(_0x1488cb,null));};exports[_0xf016('0x42')]=function(_0x470ce2,_0x370734){var _0x4a325e={'raw':![],'where':{'id':_0x470ce2[_0xf016('0x43')]['id']}},_0xc404e1={};_0xc404e1['model']=_[_0xf016('0x44')](db[_0xf016('0x2a')][_0xf016('0x2b')]);_0xc404e1[_0xf016('0x2f')]=_['keys'](_0x470ce2['query']);_0xc404e1[_0xf016('0x45')]=_['intersection'](_0xc404e1[_0xf016('0x31')],_0xc404e1[_0xf016('0x2f')]);_0x4a325e['attributes']=_[_0xf016('0x30')](_0xc404e1[_0xf016('0x31')],qs[_0xf016('0x33')](_0x470ce2[_0xf016('0x2f')][_0xf016('0x33')]));_0x4a325e['attributes']=_0x4a325e[_0xf016('0x32')][_0xf016('0x34')]?_0x4a325e['attributes']:_0xc404e1[_0xf016('0x31')];if(_0x470ce2[_0xf016('0x2f')][_0xf016('0x3e')]){_0x4a325e[_0xf016('0x3f')]=[{'all':!![]}];}_0x4a325e=_[_0xf016('0x3a')]({},_0x4a325e,_0x470ce2['options']);return db['Team'][_0xf016('0x46')](_0x4a325e)[_0xf016('0x25')](handleEntityNotFound(_0x370734,null))[_0xf016('0x25')](respondWithResult(_0x370734,null))[_0xf016('0x41')](handleError(_0x370734,null));};exports[_0xf016('0x47')]=function(_0x3b637c,_0xb64abf){return db[_0xf016('0x2a')][_0xf016('0x47')](_0x3b637c[_0xf016('0x48')],{})[_0xf016('0x25')](function(_0x29f967){var _0x41c945=_0x3b637c[_0xf016('0x49')][_0xf016('0x4a')]({'plain':!![]});if(!_0x41c945)throw new Error(_0xf016('0x4b'));if(_0x41c945[_0xf016('0x4c')]===_0xf016('0x49')){var _0x42c414=_0x29f967[_0xf016('0x4a')]({'plain':!![]});var _0x24742b='Teams';return db['UserProfileSection']['find']({'where':{'name':_0x24742b,'userProfileId':_0x41c945['userProfileId']},'raw':!![]})[_0xf016('0x25')](function(_0x5a359e){if(_0x5a359e&&_0x5a359e[_0xf016('0x4d')]===0x0){return db[_0xf016('0x4e')][_0xf016('0x47')]({'name':_0x42c414[_0xf016('0x27')],'resourceId':_0x42c414['id'],'type':_0x5a359e[_0xf016('0x27')],'sectionId':_0x5a359e['id']},{})[_0xf016('0x25')](function(){return _0x29f967;});}else{return _0x29f967;}})[_0xf016('0x41')](function(_0x4ad027){logger[_0xf016('0x26')](_0xf016('0x4f'),_0x4ad027);throw _0x4ad027;});}return _0x29f967;})[_0xf016('0x25')](respondWithResult(_0xb64abf,0xc9))[_0xf016('0x41')](handleError(_0xb64abf,null));};exports[_0xf016('0x24')]=function(_0x4c63ba,_0x5c71a2){if(_0x4c63ba[_0xf016('0x48')]['id']){delete _0x4c63ba['body']['id'];}return db['Team'][_0xf016('0x46')]({'where':{'id':_0x4c63ba[_0xf016('0x43')]['id']}})[_0xf016('0x25')](handleEntityNotFound(_0x5c71a2,null))[_0xf016('0x25')](saveUpdates(_0x4c63ba[_0xf016('0x48')],null))[_0xf016('0x25')](respondWithResult(_0x5c71a2,null))[_0xf016('0x41')](handleError(_0x5c71a2,null));};exports[_0xf016('0x50')]=function(_0x3672b1,_0x2aa7b8){var _0x2831aa=_0x3672b1[_0xf016('0x43')]['id'];var _0x16396e=[];return db[_0xf016('0x51')][_0xf016('0x52')](function(_0x10fdb0){var _0x14f9d4=_0xf016('0x53')+_0x2831aa;return db[_0xf016('0x51')][_0xf016('0x2f')](_0x14f9d4,{'type':db[_0xf016('0x54')][_0xf016('0x55')][_0xf016('0x56')],'raw':!![],'transaction':_0x10fdb0})[_0xf016('0x25')](function(_0x27f951){_0x16396e=_[_0xf016('0x29')](_0x27f951,function(_0x56c557){return Number(_0x56c557[_0xf016('0x57')]);});})[_0xf016('0x25')](function(){var _0x3cf2bb=_0xf016('0x58')+_0x2831aa;return db['sequelize'][_0xf016('0x2f')](_0x3cf2bb,{'type':db[_0xf016('0x54')][_0xf016('0x55')][_0xf016('0x56')],'raw':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0x38c005){var _0x3ab539=_['map'](_0x38c005,function(_0x1183e3){return Number(_0x1183e3[_0xf016('0x59')]);});return db[_0xf016('0x5a')]['destroy']({'where':{'UserId':{'$in':_0x16396e},'VoiceQueueId':{'$in':_0x3ab539}},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){var _0x58d57a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2831aa;return db[_0xf016('0x51')][_0xf016('0x2f')](_0x58d57a,{'type':db[_0xf016('0x54')][_0xf016('0x55')][_0xf016('0x56')],'raw':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0x378c6e){var _0x2d64c9=_[_0xf016('0x29')](_0x378c6e,function(_0x1f5760){return Number(_0x1f5760[_0xf016('0x5b')]);});return db[_0xf016('0x5c')][_0xf016('0x50')]({'where':{'UserId':{'$in':_0x16396e},'MailQueueId':{'$in':_0x2d64c9}},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){var _0x176a6d=_0xf016('0x5d')+_0x2831aa;return db[_0xf016('0x51')][_0xf016('0x2f')](_0x176a6d,{'type':db[_0xf016('0x54')][_0xf016('0x55')]['SELECT'],'raw':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0xb76c37){var _0x2c4cff=_[_0xf016('0x29')](_0xb76c37,function(_0x525c05){return Number(_0x525c05[_0xf016('0x5e')]);});return db[_0xf016('0x5f')][_0xf016('0x50')]({'where':{'UserId':{'$in':_0x16396e},'SmsQueueId':{'$in':_0x2c4cff}},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){var _0x5412bc=_0xf016('0x60')+_0x2831aa;return db[_0xf016('0x51')][_0xf016('0x2f')](_0x5412bc,{'type':db[_0xf016('0x54')][_0xf016('0x55')]['SELECT'],'raw':!![],'transaction':_0x10fdb0});})['then'](function(_0x33b17c){var _0x550fd8=_[_0xf016('0x29')](_0x33b17c,function(_0x49351a){return Number(_0x49351a[_0xf016('0x61')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x16396e},'ChatQueueId':{'$in':_0x550fd8}},'transaction':_0x10fdb0});})['then'](function(){var _0x47e606=_0xf016('0x62')+_0x2831aa;return db[_0xf016('0x51')]['query'](_0x47e606,{'type':db['Sequelize'][_0xf016('0x55')][_0xf016('0x56')],'raw':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0x2c4820){var _0x418ac6=_[_0xf016('0x29')](_0x2c4820,function(_0x5cade8){return Number(_0x5cade8['FaxQueueId']);});return db[_0xf016('0x63')][_0xf016('0x50')]({'where':{'UserId':{'$in':_0x16396e},'FaxQueueId':{'$in':_0x418ac6}},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){var _0x4a4ec5=_0xf016('0x64')+_0x2831aa;return db[_0xf016('0x51')][_0xf016('0x2f')](_0x4a4ec5,{'type':db['Sequelize']['QueryTypes'][_0xf016('0x56')],'raw':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0x52ecfd){var _0x39ce08=_[_0xf016('0x29')](_0x52ecfd,function(_0x47a31f){return Number(_0x47a31f[_0xf016('0x65')]);});return db[_0xf016('0x66')][_0xf016('0x50')]({'where':{'UserId':{'$in':_0x16396e},'OpenchannelQueueId':{'$in':_0x39ce08}},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){var _0x3c6a21='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2831aa;return db[_0xf016('0x51')][_0xf016('0x2f')](_0x3c6a21,{'type':db[_0xf016('0x54')][_0xf016('0x55')][_0xf016('0x56')],'raw':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0x9ede79){var _0x2f59f0=_[_0xf016('0x29')](_0x9ede79,function(_0xc7c73e){return Number(_0xc7c73e[_0xf016('0x67')]);});return db[_0xf016('0x68')]['destroy']({'where':{'UserId':{'$in':_0x16396e},'WhatsappQueueId':{'$in':_0x2f59f0}},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){return db['TeamVoicePrefix'][_0xf016('0x46')]({'where':{'TeamId':_0x2831aa}});})['then'](function(_0x2624aa){if(_0x2624aa===null){return;}return db[_0xf016('0x69')][_0xf016('0x50')]({'where':{'UserId':{'$in':_0x16396e},'VoicePrefixId':_0x2624aa['VoicePrefixId']},'transaction':_0x10fdb0});})[_0xf016('0x25')](function(){return db[_0xf016('0x2a')][_0xf016('0x50')]({'where':{'id':_0x2831aa},'cascade':!![],'transaction':_0x10fdb0});})[_0xf016('0x25')](function(_0x129923){if(_0x129923===0x0){_0x2aa7b8[_0xf016('0x1a')](0x194);}else{return db[_0xf016('0x4e')][_0xf016('0x50')]({'where':{'type':_0xf016('0x6a'),'resourceId':_0x2831aa},'cascade':!![],'transaction':_0x10fdb0})[_0xf016('0x25')](function(){_0x2aa7b8[_0xf016('0x1b')](0xcc)['end']();});}})['catch'](function(_0xd1d3f2){_0x2aa7b8[_0xf016('0x1b')](0x1f4)[_0xf016('0x28')](_0xd1d3f2);});});};exports[_0xf016('0x6b')]=function(_0x1cabb5,_0x2be79b,_0x4651fd){return db['Team'][_0xf016('0x6c')]({'where':{'id':_0x1cabb5[_0xf016('0x43')]['id']}})[_0xf016('0x25')](handleEntityNotFound(_0x2be79b,null))[_0xf016('0x25')](function(_0x128f07){if(!_0x1cabb5['query']['channel']||!utils['isValidChannel'](_0x1cabb5[_0xf016('0x2f')]['channel'])){throw new db['Sequelize'][(_0xf016('0x6d'))](_0xf016('0x6e'));}var _0x5d59b1={};var _0x27d8ac={};_0x27d8ac[_0xf016('0x31')]=_[_0xf016('0x44')](db[_[_0xf016('0x6f')](_0x1cabb5[_0xf016('0x2f')]['channel'][_0xf016('0x70')]())+_0xf016('0x71')][_0xf016('0x2b')]);_0x27d8ac['query']=_[_0xf016('0x44')](_0x1cabb5['query']);_0x27d8ac['filters']=_[_0xf016('0x30')](_0x27d8ac[_0xf016('0x31')],_0x27d8ac['query']);_0x5d59b1[_0xf016('0x32')]=_[_0xf016('0x30')](_0x27d8ac[_0xf016('0x31')],qs['fields'](_0x1cabb5['query'][_0xf016('0x33')]));_0x5d59b1['attributes']=_0x5d59b1[_0xf016('0x32')][_0xf016('0x34')]?_0x5d59b1[_0xf016('0x32')]:_0x27d8ac[_0xf016('0x31')];_0x5d59b1[_0xf016('0x1e')]=qs['limit'](_0x1cabb5[_0xf016('0x2f')][_0xf016('0x1e')]);_0x5d59b1['offset']=qs['offset'](_0x1cabb5[_0xf016('0x2f')]['offset']);_0x5d59b1[_0xf016('0x36')]=qs[_0xf016('0x37')](_0x1cabb5[_0xf016('0x2f')][_0xf016('0x37')]);_0x5d59b1['where']=qs['filters'](_['pick'](_0x1cabb5[_0xf016('0x2f')],_0x27d8ac[_0xf016('0x45')]));_0x5d59b1=_[_0xf016('0x3a')]({},_0x5d59b1,_0x1cabb5[_0xf016('0x3d')]);return _0x128f07['get'+_['capitalize'](_0x1cabb5['query']['channel'][_0xf016('0x70')]())+_0xf016('0x72')](_0x5d59b1);})[_0xf016('0x25')](respondWithResult(_0x2be79b,null))[_0xf016('0x41')](handleError(_0x2be79b,null));};exports['addQueues']=function(_0x579f2a,_0x385dbf,_0x22cf7f){return db[_0xf016('0x2a')][_0xf016('0x6c')]({'where':{'id':_0x579f2a['params']['id']}})[_0xf016('0x25')](function(_0x384706){if(_0x384706){if(!_0x579f2a[_0xf016('0x48')][_0xf016('0x73')]||!utils['isValidChannel'](_0x579f2a[_0xf016('0x48')][_0xf016('0x73')])){throw new db[(_0xf016('0x54'))][(_0xf016('0x6d'))](_0xf016('0x6e'));}return _0x384706['add'+_['capitalize'](_0x579f2a['body']['channel'][_0xf016('0x70')]())+'Queues'](_0x579f2a[_0xf016('0x48')][_0xf016('0x74')]);}return null;})['then'](handleEntityNotFound(_0x385dbf,null))[_0xf016('0x25')](respondWithStatusCode(_0x385dbf,null))['catch'](handleError(_0x385dbf,null));};exports[_0xf016('0x75')]=function(_0x5b2ebd,_0x2c838f,_0x26878d){return db[_0xf016('0x2a')][_0xf016('0x6c')]({'where':{'id':_0x5b2ebd[_0xf016('0x43')]['id']}})[_0xf016('0x25')](function(_0x3b0194){if(_0x3b0194){if(!_0x5b2ebd[_0xf016('0x2f')][_0xf016('0x73')]||!utils[_0xf016('0x76')](_0x5b2ebd[_0xf016('0x2f')][_0xf016('0x73')])){throw new db[(_0xf016('0x54'))][(_0xf016('0x6d'))](_0xf016('0x6e'));}return _0x3b0194['remove'+_[_0xf016('0x6f')](_0x5b2ebd[_0xf016('0x2f')]['channel'][_0xf016('0x70')]())+_0xf016('0x72')](_0x5b2ebd[_0xf016('0x2f')][_0xf016('0x74')]);}return null;})[_0xf016('0x25')](handleEntityNotFound(_0x2c838f,null))[_0xf016('0x25')](respondWithStatusCode(_0x2c838f,null))['catch'](handleError(_0x2c838f,null));};exports[_0xf016('0x77')]=function(_0x5b9203,_0x4ce7af){var _0x4c7b8d=_[_0xf016('0x78')](_0x5b9203[_0xf016('0x48')][_0xf016('0x74')])?_0x5b9203['body'][_0xf016('0x74')]:[_0x5b9203['body'][_0xf016('0x74')]];var _0x250a68=_0x5b9203[_0xf016('0x43')]['id'];return db['Team'][_0xf016('0x46')]({'where':{'id':_0x250a68}})[_0xf016('0x25')](handleEntityNotFound(_0x4ce7af,null))[_0xf016('0x25')](function(_0x46011c){if(_0x46011c){var _0x3847c8=[_0xf016('0x79'),_0xf016('0x7a'),_0xf016('0x7b'),_0xf016('0x7c'),_0xf016('0x7d'),'Openchannel',_0xf016('0x7e')];return db[_0xf016('0x51')][_0xf016('0x52')](function(_0x3f6f5d){var _0x2ea40a=_[_0xf016('0x29')](_0x3847c8,function(_0x59eb5f){var _0x232d1f={'attributes':['id',_0xf016('0x27')]};if(_0x59eb5f===_0xf016('0x79')){_0x232d1f['through']={'attributes':[_0xf016('0x7f')]};}return _0x46011c[_0xf016('0x4a')+_0x59eb5f+_0xf016('0x72')](_0x232d1f)[_0xf016('0x25')](function(_0x14d9a2){var _0x5c9cd4=_['map'](_0x14d9a2,function(_0x4db937){var _0x17d9c2=_[_0xf016('0x29')](_0x4c7b8d,function(_0x362d17){var _0x5b8f1d={'where':{'UserId':_0x362d17,[_0x59eb5f+_0xf016('0x80')]:_0x4db937['id']},'transaction':_0x3f6f5d};if(_0x59eb5f===_0xf016('0x79')){_0x5b8f1d[_0xf016('0x81')]={'penalty':_0x4db937['TeamVoiceQueue'][_0xf016('0x7f')]};}return db[_0xf016('0x82')+_0x59eb5f+_0xf016('0x71')][_0xf016('0x83')](_0x5b8f1d)[_0xf016('0x25')](function(){socket[_0xf016('0x84')]('user'+_0x59eb5f+_0xf016('0x85'),{'UserId':_0x362d17,[_0x59eb5f+_0xf016('0x80')]:_0x4db937['id']});if(_0x59eb5f!==_0xf016('0x79')){return;}return db[_0xf016('0x82')][_0xf016('0x40')]({'where':{'id':_0x4c7b8d,'online':0x1},'attributes':['id',_0xf016('0x27'),_0xf016('0x86'),_0xf016('0x87'),'interface'],'raw':!![]})['then'](function(_0x44b123){var _0x207de0=_[_0xf016('0x29')](_0x44b123,function(_0x3009c1){return db[_0xf016('0x88')]['upsert']({'membername':_0x3009c1['name'],'UserId':_0x3009c1['id'],'queue_name':_0x4db937[_0xf016('0x27')],'VoiceQueueId':_0x4db937['id'],'interface':_['isNil'](_0x3009c1[_0xf016('0x89')])?util[_0xf016('0x8a')](_0xf016('0x8b'),_0x3009c1[_0xf016('0x27')]):_0x3009c1[_0xf016('0x89')],'paused':_0x3009c1[_0xf016('0x87')]||![],'penalty':_0x4db937[_0xf016('0x8c')][_0xf016('0x7f')]},{'transaction':_0x3f6f5d});});return Promise[_0xf016('0x8d')](_0x207de0);});});});return Promise[_0xf016('0x8d')](_0x17d9c2);});return Promise[_0xf016('0x8d')](_0x5c9cd4);})['then'](function(){return db[_0xf016('0x8e')][_0xf016('0x6c')]({'where':{'teamId':_0x250a68}})[_0xf016('0x25')](function(_0xfc3d94){if(_0xfc3d94){var _0x214c58=_['map'](_0x4c7b8d,function(_0x170401){db[_0xf016('0x69')][_0xf016('0x8f')]({'UserId':_0x170401,'VoicePrefixId':_0xfc3d94[_0xf016('0x90')]});});return Promise['all'](_0x214c58);}});});});return Promise[_0xf016('0x8d')](_0x2ea40a)[_0xf016('0x25')](function(){return _0x46011c['addAgents'](_0x4c7b8d,{'transaction':_0x3f6f5d})[_0xf016('0x91')](function(_0x198d80){return _0x198d80;});});});}})['then'](respondWithResult(_0x4ce7af,null))[_0xf016('0x41')](handleError(_0x4ce7af,null));};exports[_0xf016('0x92')]=function(_0x275890,_0x79a965){var _0x1659c5=_[_0xf016('0x78')](_0x275890[_0xf016('0x2f')][_0xf016('0x74')])?_0x275890['query']['ids']:[_0x275890[_0xf016('0x2f')][_0xf016('0x74')]];var _0x963c3c=_0x275890[_0xf016('0x43')]['id'];return db['Team'][_0xf016('0x46')]({'where':{'id':_0x963c3c}})['then'](handleEntityNotFound(_0x79a965,null))['then'](function(_0x4d6925){if(_0x4d6925){var _0x5e84b3=[_0xf016('0x79'),'Chat',_0xf016('0x7b'),_0xf016('0x7c'),_0xf016('0x7d'),_0xf016('0x93'),_0xf016('0x7e')];return db[_0xf016('0x51')]['transaction'](function(_0x28b9b2){var _0x192cf9=_[_0xf016('0x29')](_0x5e84b3,function(_0xecd3a){var _0x7ca179={'attributes':['id',_0xf016('0x27')]};return _0x4d6925[_0xf016('0x4a')+_0xecd3a+_0xf016('0x72')](_0x7ca179)[_0xf016('0x25')](function(_0x4d98e5){var _0x5d9c99=_['map'](_0x4d98e5,function(_0x419ab1){return _0x419ab1[_0xf016('0x92')](_0x1659c5,{'transaction':_0x28b9b2})[_0xf016('0x25')](function(){var _0x4a0e11=_[_0xf016('0x29')](_0x1659c5,function(_0x5eebfd){socket[_0xf016('0x84')](_0xf016('0x49')+_0xecd3a+'Queue:remove',{'UserId':Number(_0x5eebfd),[_0xecd3a+_0xf016('0x80')]:_0x419ab1['id']});if(_0xecd3a!=='Voice'){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x419ab1['id'],'UserId':_0x5eebfd},'transaction':_0x28b9b2});});return Promise[_0xf016('0x8d')](_0x4a0e11);});});return Promise[_0xf016('0x8d')](_0x5d9c99);});});return Promise[_0xf016('0x8d')](_0x192cf9)[_0xf016('0x25')](function(){return _0x4d6925[_0xf016('0x92')](_0x1659c5,{'transaction':_0x28b9b2});})[_0xf016('0x25')](function(){return db['TeamVoicePrefix'][_0xf016('0x6c')]({'where':{'teamId':_0x963c3c}})[_0xf016('0x25')](function(_0x399434){if(_0x399434){var _0x4e40e0=_[_0xf016('0x29')](_0x1659c5,function(_0x188b9e){db[_0xf016('0x69')]['destroy']({'where':{'UserId':_0x188b9e,'VoicePrefixId':_0x399434[_0xf016('0x90')]}});});return Promise[_0xf016('0x8d')](_0x4e40e0);}});});});}})[_0xf016('0x25')](respondWithStatusCode(_0x79a965,null))['catch'](handleError(_0x79a965,null));};exports[_0xf016('0x94')]=function(_0xdda869,_0x4e4f54,_0x19d805){var _0x4ea941={};var _0x488c5f={};var _0x53b085;var _0x2242a7;return db['Team'][_0xf016('0x6c')]({'where':{'id':_0xdda869[_0xf016('0x43')]['id']}})[_0xf016('0x25')](handleEntityNotFound(_0x4e4f54,null))[_0xf016('0x25')](function(_0x187789){if(_0x187789){_0x53b085=_0x187789;_0x488c5f[_0xf016('0x31')]=_[_0xf016('0x44')](db['User'][_0xf016('0x2b')]);_0x488c5f[_0xf016('0x2f')]=_[_0xf016('0x44')](_0xdda869[_0xf016('0x2f')]);_0x488c5f[_0xf016('0x45')]=_[_0xf016('0x30')](_0x488c5f[_0xf016('0x31')],_0x488c5f[_0xf016('0x2f')]);_0x4ea941[_0xf016('0x32')]=_['intersection'](_0x488c5f[_0xf016('0x31')],qs[_0xf016('0x33')](_0xdda869[_0xf016('0x2f')][_0xf016('0x33')]));_0x4ea941[_0xf016('0x32')]=_0x4ea941[_0xf016('0x32')][_0xf016('0x34')]?_0x4ea941[_0xf016('0x32')]:_0x488c5f[_0xf016('0x31')];_0x4ea941[_0xf016('0x36')]=qs[_0xf016('0x37')](_0xdda869[_0xf016('0x2f')][_0xf016('0x37')]);_0x4ea941[_0xf016('0x3b')]=qs[_0xf016('0x45')](_[_0xf016('0x38')](_0xdda869[_0xf016('0x2f')],_0x488c5f[_0xf016('0x45')]));if(_0xdda869[_0xf016('0x2f')]['filter']){_0x4ea941['where']=_[_0xf016('0x3a')](_0x4ea941[_0xf016('0x3b')],{'$or':_[_0xf016('0x29')](_0x4ea941[_0xf016('0x32')],function(_0x2ab375){var _0x23f112={};_0x23f112[_0x2ab375]={'$like':'%'+_0xdda869[_0xf016('0x2f')]['filter']+'%'};return _0x23f112;})});}_0x4ea941=_['merge']({},_0x4ea941,_0xdda869[_0xf016('0x3d')]);return _0x53b085['getAgents'](_0x4ea941);}})[_0xf016('0x25')](function(_0x49d1ce){if(_0x49d1ce){_0x2242a7=_0x49d1ce[_0xf016('0x34')];if(!_0xdda869[_0xf016('0x2f')][_0xf016('0x95')]('nolimit')){_0x4ea941['limit']=qs[_0xf016('0x1e')](_0xdda869['query']['limit']);_0x4ea941['offset']=qs[_0xf016('0x1c')](_0xdda869[_0xf016('0x2f')][_0xf016('0x1c')]);}return _0x53b085['getAgents'](_0x4ea941);}})[_0xf016('0x25')](function(_0x51f36f){if(_0x51f36f){return _0x51f36f?{'count':_0x2242a7,'rows':_0x51f36f}:null;}})['then'](respondWithResult(_0x4e4f54,null))['catch'](handleError(_0x4e4f54,null));};
\ No newline at end of file
+var _0x0143=['QueueId','TeamVoiceQueue','findOrCreate','emit','User','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','TeamVoicePrefix','upsert','spread','removeAgents','isArray','Fax','Queue:remove','UserVoicePrefix','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','Team','rawAttributes','fieldName','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','get','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','VoicePrefixId','send','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','transaction','through','penalty'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0143,0x14c));var _0x3014=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0143[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3014('0x1'));var rp=require(_0x3014('0x2'));var moment=require(_0x3014('0x3'));var BPromise=require(_0x3014('0x4'));var Mustache=require(_0x3014('0x5'));var util=require(_0x3014('0x6'));var path=require(_0x3014('0x7'));var sox=require(_0x3014('0x8'));var csv=require(_0x3014('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3014('0xa'));var _=require('lodash');var squel=require(_0x3014('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3014('0xc'));var toCsv=require(_0x3014('0x9'));var querystring=require('querystring');var Papa=require(_0x3014('0xd'));var Redis=require(_0x3014('0xe'));var authService=require(_0x3014('0xf'));var qs=require(_0x3014('0x10'));var as=require(_0x3014('0x11'));var hardwareService=require(_0x3014('0x12'));var logger=require('../../config/logger')(_0x3014('0x13'));var utils=require('../../config/utils');var config=require(_0x3014('0x14'));var licenseUtil=require(_0x3014('0x15'));var db=require('../../mysqldb')['db'];config[_0x3014('0x16')]=_[_0x3014('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3014('0x18'))(new Redis(config[_0x3014('0x16')]));require(_0x3014('0x19'))[_0x3014('0x1a')](socket);function respondWithStatusCode(_0x2a6bbf,_0x3fc470){_0x3fc470=_0x3fc470||0xcc;return function(_0xa32a4a){if(_0xa32a4a){return _0x2a6bbf[_0x3014('0x1b')](_0x3fc470);}return _0x2a6bbf[_0x3014('0x1c')](_0x3fc470)[_0x3014('0x1d')]();};}function respondWithResult(_0x302b23,_0x593fce){_0x593fce=_0x593fce||0xc8;return function(_0x2aec3b){if(_0x2aec3b){return _0x302b23[_0x3014('0x1c')](_0x593fce)[_0x3014('0x1e')](_0x2aec3b);}};}function respondWithFilteredResult(_0x3e0857,_0x3a10c0){return function(_0x51bb12){if(_0x51bb12){var _0x5a7ae1=typeof _0x3a10c0[_0x3014('0x1f')]==='undefined'&&typeof _0x3a10c0[_0x3014('0x20')]==='undefined';var _0x5aa944=_0x51bb12['count'];var _0x20e3df=_0x5a7ae1?0x0:_0x3a10c0[_0x3014('0x1f')];var _0x28d123=_0x5a7ae1?_0x51bb12['count']:_0x3a10c0['offset']+_0x3a10c0[_0x3014('0x20')];var _0x43eddf;if(_0x28d123>=_0x5aa944){_0x28d123=_0x5aa944;_0x43eddf=0xc8;}else{_0x43eddf=0xce;}_0x3e0857[_0x3014('0x1c')](_0x43eddf);return _0x3e0857[_0x3014('0x21')](_0x3014('0x22'),_0x20e3df+'-'+_0x28d123+'/'+_0x5aa944)[_0x3014('0x1e')](_0x51bb12);}return null;};}function patchUpdates(_0x3a762d){return function(_0x5679b4){try{jsonpatch[_0x3014('0x23')](_0x5679b4,_0x3a762d,!![]);}catch(_0x44dbf5){return BPromise[_0x3014('0x24')](_0x44dbf5);}return _0x5679b4[_0x3014('0x25')]();};}function saveUpdates(_0x296179,_0x30878f){return function(_0x3f504a){if(_0x3f504a){return _0x3f504a[_0x3014('0x26')](_0x296179)[_0x3014('0x27')](function(_0x9066c4){return _0x9066c4;});}return null;};}function handleEntityNotFound(_0x5bf53f,_0x3763d5){return function(_0x2d9bc2){if(!_0x2d9bc2){_0x5bf53f[_0x3014('0x1b')](0x194);}return _0x2d9bc2;};}function handleError(_0x2dd3e9,_0x5726ed){_0x5726ed=_0x5726ed||0x1f4;return function(_0x306a1b){logger[_0x3014('0x28')](_0x306a1b[_0x3014('0x29')]);if(_0x306a1b[_0x3014('0x2a')]){delete _0x306a1b['name'];}_0x2dd3e9[_0x3014('0x1c')](_0x5726ed)['send'](_0x306a1b);};}exports[_0x3014('0x2b')]=function(_0x30ff56,_0x1b9ce3){var _0x2708f2={},_0xec4e0b={},_0x134686={'count':0x0,'rows':[]};var _0x26113f=_['map'](db[_0x3014('0x2c')][_0x3014('0x2d')],function(_0x5133d9){return{'name':_0x5133d9[_0x3014('0x2e')],'type':_0x5133d9['type']['key']};});_0xec4e0b[_0x3014('0x2f')]=_['map'](_0x26113f,_0x3014('0x2a'));_0xec4e0b[_0x3014('0x30')]=_[_0x3014('0x31')](_0x30ff56[_0x3014('0x30')]);_0xec4e0b[_0x3014('0x32')]=_['intersection'](_0xec4e0b['model'],_0xec4e0b[_0x3014('0x30')]);_0x2708f2['attributes']=_['intersection'](_0xec4e0b[_0x3014('0x2f')],qs[_0x3014('0x33')](_0x30ff56[_0x3014('0x30')]['fields']));_0x2708f2[_0x3014('0x34')]=_0x2708f2[_0x3014('0x34')][_0x3014('0x35')]?_0x2708f2[_0x3014('0x34')]:_0xec4e0b['model'];if(!_0x30ff56['query'][_0x3014('0x36')](_0x3014('0x37'))){_0x2708f2[_0x3014('0x20')]=qs['limit'](_0x30ff56[_0x3014('0x30')][_0x3014('0x20')]);_0x2708f2[_0x3014('0x1f')]=qs['offset'](_0x30ff56[_0x3014('0x30')][_0x3014('0x1f')]);}_0x2708f2[_0x3014('0x38')]=qs[_0x3014('0x39')](_0x30ff56[_0x3014('0x30')]['sort']);_0x2708f2[_0x3014('0x3a')]=qs[_0x3014('0x32')](_[_0x3014('0x3b')](_0x30ff56[_0x3014('0x30')],_0xec4e0b['filters']),_0x26113f);if(_0x30ff56['query'][_0x3014('0x3c')]){_0x2708f2[_0x3014('0x3a')]=_[_0x3014('0x3d')](_0x2708f2['where'],{'$or':_[_0x3014('0x3e')](_0x26113f,function(_0x5d11a3){if(_0x5d11a3[_0x3014('0x3f')]!==_0x3014('0x40')){var _0x1f973d={};_0x1f973d[_0x5d11a3[_0x3014('0x2a')]]={'$like':'%'+_0x30ff56[_0x3014('0x30')][_0x3014('0x3c')]+'%'};return _0x1f973d;}})});}_0x2708f2=_[_0x3014('0x3d')]({},_0x2708f2,_0x30ff56[_0x3014('0x41')]);var _0x13d6b2={'where':_0x2708f2[_0x3014('0x3a')]};return db[_0x3014('0x2c')]['count'](_0x13d6b2)[_0x3014('0x27')](function(_0x462891){_0x134686[_0x3014('0x42')]=_0x462891;if(_0x30ff56[_0x3014('0x30')][_0x3014('0x43')]){_0x2708f2[_0x3014('0x44')]=[{'all':!![]}];}return db['Team'][_0x3014('0x45')](_0x2708f2);})[_0x3014('0x27')](function(_0x4fbf7f){_0x134686[_0x3014('0x46')]=_0x4fbf7f;return _0x134686;})[_0x3014('0x27')](respondWithFilteredResult(_0x1b9ce3,_0x2708f2))[_0x3014('0x47')](handleError(_0x1b9ce3,null));};exports[_0x3014('0x48')]=function(_0x314d3e,_0x3848e6){var _0x539568={'raw':![],'where':{'id':_0x314d3e[_0x3014('0x49')]['id']}},_0x15c777={};_0x15c777[_0x3014('0x2f')]=_[_0x3014('0x31')](db[_0x3014('0x2c')]['rawAttributes']);_0x15c777[_0x3014('0x30')]=_[_0x3014('0x31')](_0x314d3e[_0x3014('0x30')]);_0x15c777[_0x3014('0x32')]=_[_0x3014('0x4a')](_0x15c777['model'],_0x15c777['query']);_0x539568[_0x3014('0x34')]=_['intersection'](_0x15c777[_0x3014('0x2f')],qs[_0x3014('0x33')](_0x314d3e['query'][_0x3014('0x33')]));_0x539568['attributes']=_0x539568['attributes'][_0x3014('0x35')]?_0x539568['attributes']:_0x15c777[_0x3014('0x2f')];if(_0x314d3e[_0x3014('0x30')][_0x3014('0x43')]){_0x539568[_0x3014('0x44')]=[{'all':!![]}];}_0x539568=_[_0x3014('0x3d')]({},_0x539568,_0x314d3e['options']);return db[_0x3014('0x2c')][_0x3014('0x4b')](_0x539568)['then'](handleEntityNotFound(_0x3848e6,null))[_0x3014('0x27')](respondWithResult(_0x3848e6,null))[_0x3014('0x47')](handleError(_0x3848e6,null));};exports['create']=function(_0x2097e1,_0x3297fc){return db[_0x3014('0x2c')][_0x3014('0x4c')](_0x2097e1[_0x3014('0x4d')],{})[_0x3014('0x27')](function(_0x1b3bc3){var _0x34b5f2=_0x2097e1[_0x3014('0x4e')][_0x3014('0x4f')]({'plain':!![]});if(!_0x34b5f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34b5f2['role']==='user'){var _0x415a33=_0x1b3bc3['get']({'plain':!![]});var _0x447a2b=_0x3014('0x50');return db[_0x3014('0x51')]['find']({'where':{'name':_0x447a2b,'userProfileId':_0x34b5f2[_0x3014('0x52')]},'raw':!![]})['then'](function(_0x36018f){if(_0x36018f&&_0x36018f['autoAssociation']===0x0){return db[_0x3014('0x53')][_0x3014('0x4c')]({'name':_0x415a33[_0x3014('0x2a')],'resourceId':_0x415a33['id'],'type':_0x36018f[_0x3014('0x2a')],'sectionId':_0x36018f['id']},{})['then'](function(){return _0x1b3bc3;});}else{return _0x1b3bc3;}})[_0x3014('0x47')](function(_0xd18053){logger[_0x3014('0x28')](_0x3014('0x54'),_0xd18053);throw _0xd18053;});}return _0x1b3bc3;})[_0x3014('0x27')](respondWithResult(_0x3297fc,0xc9))[_0x3014('0x47')](handleError(_0x3297fc,null));};exports[_0x3014('0x26')]=function(_0x2afb97,_0x1a8b2b){if(_0x2afb97['body']['id']){delete _0x2afb97[_0x3014('0x4d')]['id'];}return db[_0x3014('0x2c')]['find']({'where':{'id':_0x2afb97[_0x3014('0x49')]['id']}})[_0x3014('0x27')](handleEntityNotFound(_0x1a8b2b,null))['then'](saveUpdates(_0x2afb97[_0x3014('0x4d')],null))[_0x3014('0x27')](respondWithResult(_0x1a8b2b,null))[_0x3014('0x47')](handleError(_0x1a8b2b,null));};exports['destroy']=function(_0x1570c8,_0xdb140a){var _0x4bb5e8=_0x1570c8['params']['id'];var _0x322476=[];return db[_0x3014('0x55')]['transaction'](function(_0x2c0a67){var _0x148aa1=_0x3014('0x56')+_0x4bb5e8;return db[_0x3014('0x55')]['query'](_0x148aa1,{'type':db[_0x3014('0x57')]['QueryTypes'][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67})['then'](function(_0x2b0e55){_0x322476=_[_0x3014('0x3e')](_0x2b0e55,function(_0x54c0c2){return Number(_0x54c0c2[_0x3014('0x59')]);});})[_0x3014('0x27')](function(){var _0x9a6089=_0x3014('0x5a')+_0x4bb5e8;return db[_0x3014('0x55')][_0x3014('0x30')](_0x9a6089,{'type':db['Sequelize'][_0x3014('0x5b')][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x5c4c91){var _0x228f1d=_['map'](_0x5c4c91,function(_0x2c10ab){return Number(_0x2c10ab['VoiceQueueId']);});return db[_0x3014('0x5c')][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'VoiceQueueId':{'$in':_0x228f1d}},'transaction':_0x2c0a67});})['then'](function(){var _0x16b358=_0x3014('0x5e')+_0x4bb5e8;return db[_0x3014('0x55')][_0x3014('0x30')](_0x16b358,{'type':db[_0x3014('0x57')][_0x3014('0x5b')][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x40b816){var _0xf36bab=_[_0x3014('0x3e')](_0x40b816,function(_0x447bfa){return Number(_0x447bfa[_0x3014('0x5f')]);});return db[_0x3014('0x60')][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'MailQueueId':{'$in':_0xf36bab}},'transaction':_0x2c0a67});})['then'](function(){var _0x2ba24b=_0x3014('0x61')+_0x4bb5e8;return db[_0x3014('0x55')]['query'](_0x2ba24b,{'type':db[_0x3014('0x57')][_0x3014('0x5b')][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67});})['then'](function(_0x12214f){var _0x582113=_['map'](_0x12214f,function(_0x4e02c3){return Number(_0x4e02c3['SmsQueueId']);});return db[_0x3014('0x62')][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'SmsQueueId':{'$in':_0x582113}},'transaction':_0x2c0a67});})[_0x3014('0x27')](function(){var _0x5726='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4bb5e8;return db[_0x3014('0x55')][_0x3014('0x30')](_0x5726,{'type':db[_0x3014('0x57')]['QueryTypes'][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x4f964f){var _0x5cf7dc=_[_0x3014('0x3e')](_0x4f964f,function(_0x5d4d39){return Number(_0x5d4d39['ChatQueueId']);});return db[_0x3014('0x63')][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'ChatQueueId':{'$in':_0x5cf7dc}},'transaction':_0x2c0a67});})[_0x3014('0x27')](function(){var _0xdc032c=_0x3014('0x64')+_0x4bb5e8;return db[_0x3014('0x55')][_0x3014('0x30')](_0xdc032c,{'type':db[_0x3014('0x57')][_0x3014('0x5b')][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x95aff7){var _0x136eaa=_[_0x3014('0x3e')](_0x95aff7,function(_0x5cb984){return Number(_0x5cb984[_0x3014('0x65')]);});return db[_0x3014('0x66')][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'FaxQueueId':{'$in':_0x136eaa}},'transaction':_0x2c0a67});})[_0x3014('0x27')](function(){var _0x4831c8=_0x3014('0x67')+_0x4bb5e8;return db[_0x3014('0x55')][_0x3014('0x30')](_0x4831c8,{'type':db['Sequelize']['QueryTypes'][_0x3014('0x58')],'raw':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x1adac7){var _0x1acda7=_['map'](_0x1adac7,function(_0x14ba72){return Number(_0x14ba72[_0x3014('0x68')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x322476},'OpenchannelQueueId':{'$in':_0x1acda7}},'transaction':_0x2c0a67});})[_0x3014('0x27')](function(){var _0x55fd66=_0x3014('0x69')+_0x4bb5e8;return db[_0x3014('0x55')]['query'](_0x55fd66,{'type':db[_0x3014('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x10e2f7){var _0x479e55=_[_0x3014('0x3e')](_0x10e2f7,function(_0x5ecd3d){return Number(_0x5ecd3d[_0x3014('0x6a')]);});return db['UserWhatsappQueue'][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'WhatsappQueueId':{'$in':_0x479e55}},'transaction':_0x2c0a67});})[_0x3014('0x27')](function(){return db['TeamVoicePrefix'][_0x3014('0x4b')]({'where':{'TeamId':_0x4bb5e8}});})[_0x3014('0x27')](function(_0x52de10){if(_0x52de10===null){return;}return db['UserVoicePrefix'][_0x3014('0x5d')]({'where':{'UserId':{'$in':_0x322476},'VoicePrefixId':_0x52de10[_0x3014('0x6b')]},'transaction':_0x2c0a67});})[_0x3014('0x27')](function(){return db[_0x3014('0x2c')]['destroy']({'where':{'id':_0x4bb5e8},'cascade':!![],'transaction':_0x2c0a67});})[_0x3014('0x27')](function(_0x5ada22){if(_0x5ada22===0x0){_0xdb140a['sendStatus'](0x194);}else{return db[_0x3014('0x53')][_0x3014('0x5d')]({'where':{'type':_0x3014('0x50'),'resourceId':_0x4bb5e8},'cascade':!![],'transaction':_0x2c0a67})[_0x3014('0x27')](function(){_0xdb140a[_0x3014('0x1c')](0xcc)[_0x3014('0x1d')]();});}})['catch'](function(_0x15aee5){_0xdb140a[_0x3014('0x1c')](0x1f4)[_0x3014('0x6c')](_0x15aee5);});});};exports[_0x3014('0x6d')]=function(_0xccbfbb,_0x5b1343,_0x306618){return db[_0x3014('0x2c')][_0x3014('0x6e')]({'where':{'id':_0xccbfbb[_0x3014('0x49')]['id']}})[_0x3014('0x27')](handleEntityNotFound(_0x5b1343,null))['then'](function(_0x1b34f8){if(!_0xccbfbb[_0x3014('0x30')][_0x3014('0x6f')]||!utils[_0x3014('0x70')](_0xccbfbb['query']['channel'])){throw new db[(_0x3014('0x57'))][(_0x3014('0x71'))](_0x3014('0x72'));}var _0x3d3610={};var _0x34b9e3={};_0x34b9e3['model']=_[_0x3014('0x31')](db[_[_0x3014('0x73')](_0xccbfbb['query'][_0x3014('0x6f')][_0x3014('0x74')]())+_0x3014('0x75')][_0x3014('0x2d')]);_0x34b9e3[_0x3014('0x30')]=_['keys'](_0xccbfbb[_0x3014('0x30')]);_0x34b9e3[_0x3014('0x32')]=_[_0x3014('0x4a')](_0x34b9e3['model'],_0x34b9e3[_0x3014('0x30')]);_0x3d3610[_0x3014('0x34')]=_['intersection'](_0x34b9e3[_0x3014('0x2f')],qs[_0x3014('0x33')](_0xccbfbb[_0x3014('0x30')]['fields']));_0x3d3610[_0x3014('0x34')]=_0x3d3610[_0x3014('0x34')][_0x3014('0x35')]?_0x3d3610[_0x3014('0x34')]:_0x34b9e3[_0x3014('0x2f')];_0x3d3610[_0x3014('0x20')]=qs[_0x3014('0x20')](_0xccbfbb[_0x3014('0x30')][_0x3014('0x20')]);_0x3d3610[_0x3014('0x1f')]=qs[_0x3014('0x1f')](_0xccbfbb[_0x3014('0x30')][_0x3014('0x1f')]);_0x3d3610[_0x3014('0x38')]=qs[_0x3014('0x39')](_0xccbfbb['query'][_0x3014('0x39')]);_0x3d3610['where']=qs[_0x3014('0x32')](_[_0x3014('0x3b')](_0xccbfbb[_0x3014('0x30')],_0x34b9e3[_0x3014('0x32')]));_0x3d3610=_[_0x3014('0x3d')]({},_0x3d3610,_0xccbfbb['options']);return _0x1b34f8['get'+_[_0x3014('0x73')](_0xccbfbb[_0x3014('0x30')][_0x3014('0x6f')]['toLowerCase']())+_0x3014('0x76')](_0x3d3610);})['then'](respondWithResult(_0x5b1343,null))[_0x3014('0x47')](handleError(_0x5b1343,null));};exports[_0x3014('0x77')]=function(_0x3348b0,_0x33d516,_0x5e0ff5){return db['Team'][_0x3014('0x6e')]({'where':{'id':_0x3348b0['params']['id']}})['then'](function(_0x4df9f2){if(_0x4df9f2){if(!_0x3348b0[_0x3014('0x4d')][_0x3014('0x6f')]||!utils[_0x3014('0x70')](_0x3348b0[_0x3014('0x4d')]['channel'])){throw new db[(_0x3014('0x57'))]['ValidationError']('Unknown\x20channel');}return _0x4df9f2[_0x3014('0x78')+_[_0x3014('0x73')](_0x3348b0['body'][_0x3014('0x6f')]['toLowerCase']())+_0x3014('0x76')](_0x3348b0[_0x3014('0x4d')][_0x3014('0x79')]);}return null;})['then'](handleEntityNotFound(_0x33d516,null))[_0x3014('0x27')](respondWithStatusCode(_0x33d516,null))[_0x3014('0x47')](handleError(_0x33d516,null));};exports['removeQueues']=function(_0x2f0e93,_0xed6bc4,_0x5a43aa){return db[_0x3014('0x2c')][_0x3014('0x6e')]({'where':{'id':_0x2f0e93[_0x3014('0x49')]['id']}})[_0x3014('0x27')](function(_0x1a7a11){if(_0x1a7a11){if(!_0x2f0e93['query'][_0x3014('0x6f')]||!utils[_0x3014('0x70')](_0x2f0e93['query'][_0x3014('0x6f')])){throw new db[(_0x3014('0x57'))]['ValidationError'](_0x3014('0x72'));}return _0x1a7a11[_0x3014('0x7a')+_[_0x3014('0x73')](_0x2f0e93['query'][_0x3014('0x6f')]['toLowerCase']())+_0x3014('0x76')](_0x2f0e93['query'][_0x3014('0x79')]);}return null;})['then'](handleEntityNotFound(_0xed6bc4,null))[_0x3014('0x27')](respondWithStatusCode(_0xed6bc4,null))['catch'](handleError(_0xed6bc4,null));};exports[_0x3014('0x7b')]=function(_0x362334,_0x2105c5){var _0x4dc408=_['isArray'](_0x362334[_0x3014('0x4d')][_0x3014('0x79')])?_0x362334[_0x3014('0x4d')]['ids']:[_0x362334[_0x3014('0x4d')][_0x3014('0x79')]];var _0x539d21=_0x362334[_0x3014('0x49')]['id'];return db['Team'][_0x3014('0x4b')]({'where':{'id':_0x539d21}})[_0x3014('0x27')](handleEntityNotFound(_0x2105c5,null))['then'](function(_0x2bd335){if(_0x2bd335){var _0x4b2467=[_0x3014('0x7c'),_0x3014('0x7d'),_0x3014('0x7e'),_0x3014('0x7f'),'Fax',_0x3014('0x80'),_0x3014('0x81')];return db[_0x3014('0x55')][_0x3014('0x82')](function(_0x1e7e1d){var _0x3e20aa=_[_0x3014('0x3e')](_0x4b2467,function(_0xbeaaef){var _0xa2a30b={'attributes':['id',_0x3014('0x2a')]};if(_0xbeaaef==='Voice'){_0xa2a30b[_0x3014('0x83')]={'attributes':[_0x3014('0x84')]};}return _0x2bd335[_0x3014('0x4f')+_0xbeaaef+_0x3014('0x76')](_0xa2a30b)[_0x3014('0x27')](function(_0x228370){var _0x2575d2=_[_0x3014('0x3e')](_0x228370,function(_0x354029){var _0x199896=_[_0x3014('0x3e')](_0x4dc408,function(_0x5d74e8){var _0x504333={'where':{'UserId':_0x5d74e8,[_0xbeaaef+_0x3014('0x85')]:_0x354029['id']},'transaction':_0x1e7e1d};if(_0xbeaaef==='Voice'){_0x504333[_0x3014('0x17')]={'penalty':_0x354029[_0x3014('0x86')][_0x3014('0x84')]};}return db['User'+_0xbeaaef+_0x3014('0x75')][_0x3014('0x87')](_0x504333)[_0x3014('0x27')](function(){socket[_0x3014('0x88')](_0x3014('0x4e')+_0xbeaaef+'Queue:save',{'UserId':_0x5d74e8,[_0xbeaaef+_0x3014('0x85')]:_0x354029['id']});if(_0xbeaaef!=='Voice'){return;}return db[_0x3014('0x89')][_0x3014('0x45')]({'where':{'id':_0x4dc408,'online':0x1},'attributes':['id',_0x3014('0x2a'),_0x3014('0x8a'),_0x3014('0x8b'),_0x3014('0x8c')],'raw':!![]})[_0x3014('0x27')](function(_0x1b7076){var _0x3fd7b4=_[_0x3014('0x3e')](_0x1b7076,function(_0x1a6fa9){return db[_0x3014('0x8d')]['upsert']({'membername':_0x1a6fa9[_0x3014('0x2a')],'UserId':_0x1a6fa9['id'],'queue_name':_0x354029['name'],'VoiceQueueId':_0x354029['id'],'interface':_[_0x3014('0x8e')](_0x1a6fa9['interface'])?util[_0x3014('0x8f')](_0x3014('0x90'),_0x1a6fa9[_0x3014('0x2a')]):_0x1a6fa9[_0x3014('0x8c')],'paused':_0x1a6fa9[_0x3014('0x8b')]||![],'penalty':_0x354029[_0x3014('0x86')][_0x3014('0x84')]},{'transaction':_0x1e7e1d});});return Promise[_0x3014('0x91')](_0x3fd7b4);});});});return Promise[_0x3014('0x91')](_0x199896);});return Promise['all'](_0x2575d2);})[_0x3014('0x27')](function(){return db[_0x3014('0x92')][_0x3014('0x6e')]({'where':{'teamId':_0x539d21}})[_0x3014('0x27')](function(_0x364cb){if(_0x364cb){var _0x121cfa=_[_0x3014('0x3e')](_0x4dc408,function(_0x118f4){db['UserVoicePrefix'][_0x3014('0x93')]({'UserId':_0x118f4,'VoicePrefixId':_0x364cb[_0x3014('0x6b')]});});return Promise[_0x3014('0x91')](_0x121cfa);}});});});return Promise[_0x3014('0x91')](_0x3e20aa)['then'](function(){return _0x2bd335[_0x3014('0x7b')](_0x4dc408,{'transaction':_0x1e7e1d})[_0x3014('0x94')](function(_0x10cf51){return _0x10cf51;});});});}})[_0x3014('0x27')](respondWithResult(_0x2105c5,null))[_0x3014('0x47')](handleError(_0x2105c5,null));};exports[_0x3014('0x95')]=function(_0x43e902,_0x6862ab){var _0x4028d9=_[_0x3014('0x96')](_0x43e902[_0x3014('0x30')][_0x3014('0x79')])?_0x43e902[_0x3014('0x30')][_0x3014('0x79')]:[_0x43e902[_0x3014('0x30')][_0x3014('0x79')]];var _0x31b964=_0x43e902['params']['id'];return db[_0x3014('0x2c')][_0x3014('0x4b')]({'where':{'id':_0x31b964}})[_0x3014('0x27')](handleEntityNotFound(_0x6862ab,null))['then'](function(_0x3541d9){if(_0x3541d9){var _0x3be133=['Voice','Chat','Mail',_0x3014('0x7f'),_0x3014('0x97'),_0x3014('0x80'),_0x3014('0x81')];return db[_0x3014('0x55')][_0x3014('0x82')](function(_0x11f6ab){var _0x38186a=_[_0x3014('0x3e')](_0x3be133,function(_0x209cb5){var _0x1b9dfb={'attributes':['id',_0x3014('0x2a')]};return _0x3541d9['get'+_0x209cb5+_0x3014('0x76')](_0x1b9dfb)[_0x3014('0x27')](function(_0x248750){var _0x5102bf=_[_0x3014('0x3e')](_0x248750,function(_0x4e95ae){return _0x4e95ae[_0x3014('0x95')](_0x4028d9,{'transaction':_0x11f6ab})[_0x3014('0x27')](function(){var _0xbcc0d0=_[_0x3014('0x3e')](_0x4028d9,function(_0x385d07){socket[_0x3014('0x88')](_0x3014('0x4e')+_0x209cb5+_0x3014('0x98'),{'UserId':Number(_0x385d07),[_0x209cb5+_0x3014('0x85')]:_0x4e95ae['id']});if(_0x209cb5!==_0x3014('0x7c')){return;}return db[_0x3014('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x4e95ae['id'],'UserId':_0x385d07},'transaction':_0x11f6ab});});return Promise[_0x3014('0x91')](_0xbcc0d0);});});return Promise[_0x3014('0x91')](_0x5102bf);});});return Promise[_0x3014('0x91')](_0x38186a)[_0x3014('0x27')](function(){return _0x3541d9['removeAgents'](_0x4028d9,{'transaction':_0x11f6ab});})['then'](function(){return db[_0x3014('0x92')][_0x3014('0x6e')]({'where':{'teamId':_0x31b964}})[_0x3014('0x27')](function(_0x4b7ad1){if(_0x4b7ad1){var _0x2bc736=_[_0x3014('0x3e')](_0x4028d9,function(_0x354d8f){db[_0x3014('0x99')][_0x3014('0x5d')]({'where':{'UserId':_0x354d8f,'VoicePrefixId':_0x4b7ad1[_0x3014('0x6b')]}});});return Promise[_0x3014('0x91')](_0x2bc736);}});});});}})[_0x3014('0x27')](respondWithStatusCode(_0x6862ab,null))[_0x3014('0x47')](handleError(_0x6862ab,null));};exports[_0x3014('0x9a')]=function(_0x1a1cc3,_0x1d04a6,_0x353810){var _0x5d55d0={};var _0x332c7f={};var _0x50ec82;var _0x2ea604;return db['Team']['findOne']({'where':{'id':_0x1a1cc3[_0x3014('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d04a6,null))[_0x3014('0x27')](function(_0x1f44be){if(_0x1f44be){_0x50ec82=_0x1f44be;_0x332c7f[_0x3014('0x2f')]=_[_0x3014('0x31')](db['User'][_0x3014('0x2d')]);_0x332c7f[_0x3014('0x30')]=_[_0x3014('0x31')](_0x1a1cc3[_0x3014('0x30')]);_0x332c7f['filters']=_[_0x3014('0x4a')](_0x332c7f[_0x3014('0x2f')],_0x332c7f[_0x3014('0x30')]);_0x5d55d0[_0x3014('0x34')]=_[_0x3014('0x4a')](_0x332c7f[_0x3014('0x2f')],qs[_0x3014('0x33')](_0x1a1cc3['query']['fields']));_0x5d55d0[_0x3014('0x34')]=_0x5d55d0[_0x3014('0x34')][_0x3014('0x35')]?_0x5d55d0[_0x3014('0x34')]:_0x332c7f[_0x3014('0x2f')];_0x5d55d0[_0x3014('0x38')]=qs[_0x3014('0x39')](_0x1a1cc3[_0x3014('0x30')][_0x3014('0x39')]);_0x5d55d0['where']=qs[_0x3014('0x32')](_['pick'](_0x1a1cc3[_0x3014('0x30')],_0x332c7f[_0x3014('0x32')]));if(_0x1a1cc3['query'][_0x3014('0x3c')]){_0x5d55d0['where']=_[_0x3014('0x3d')](_0x5d55d0[_0x3014('0x3a')],{'$or':_[_0x3014('0x3e')](_0x5d55d0[_0x3014('0x34')],function(_0x2985d3){var _0x4643da={};_0x4643da[_0x2985d3]={'$like':'%'+_0x1a1cc3[_0x3014('0x30')][_0x3014('0x3c')]+'%'};return _0x4643da;})});}_0x5d55d0=_[_0x3014('0x3d')]({},_0x5d55d0,_0x1a1cc3[_0x3014('0x41')]);return _0x50ec82[_0x3014('0x9a')](_0x5d55d0);}})[_0x3014('0x27')](function(_0x5f2297){if(_0x5f2297){_0x2ea604=_0x5f2297[_0x3014('0x35')];if(!_0x1a1cc3['query'][_0x3014('0x36')](_0x3014('0x37'))){_0x5d55d0['limit']=qs[_0x3014('0x20')](_0x1a1cc3['query'][_0x3014('0x20')]);_0x5d55d0[_0x3014('0x1f')]=qs['offset'](_0x1a1cc3[_0x3014('0x30')]['offset']);}return _0x50ec82[_0x3014('0x9a')](_0x5d55d0);}})[_0x3014('0x27')](function(_0x4f6830){if(_0x4f6830){return _0x4f6830?{'count':_0x2ea604,'rows':_0x4f6830}:null;}})[_0x3014('0x27')](respondWithResult(_0x1d04a6,null))[_0x3014('0x47')](handleError(_0x1d04a6,null));};
\ No newline at end of file
index ea1dc0c..ed844c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea9f=['remove','emit','hook','events','../../mysqldb','Team','save'];(function(_0x255be9,_0x3345d9){var _0x34fedf=function(_0x2e198c){while(--_0x2e198c){_0x255be9['push'](_0x255be9['shift']());}};_0x34fedf(++_0x3345d9);}(_0xea9f,0x9d));var _0xfea9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xea9f[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xfea9('0x0'));var Team=require(_0xfea9('0x1'))['db'][_0xfea9('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfea9('0x3'),'afterUpdate':'update','afterDestroy':_0xfea9('0x4')};function emitEvent(_0x3d044a){return function(_0x2ea128,_0x55885b,_0xf06584){TeamEvents[_0xfea9('0x5')](_0x3d044a+':'+_0x2ea128['id'],_0x2ea128);TeamEvents[_0xfea9('0x5')](_0x3d044a,_0x2ea128);_0xf06584(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xfea9('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0x7c57=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x182321,_0x1ef813){var _0x32ea66=function(_0xc6be78){while(--_0xc6be78){_0x182321['push'](_0x182321['shift']());}};_0x32ea66(++_0x1ef813);}(_0x7c57,0x108));var _0x77c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c57[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x77c5('0x0'));var Team=require(_0x77c5('0x1'))['db'][_0x77c5('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x77c5('0x3')](0x0);var events={'afterCreate':_0x77c5('0x4'),'afterUpdate':_0x77c5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a0484){return function(_0x3e493a,_0x2dc037,_0x5c791){TeamEvents[_0x77c5('0x6')](_0x4a0484+':'+_0x3e493a['id'],_0x3e493a);TeamEvents[_0x77c5('0x6')](_0x4a0484,_0x3e493a);_0x5c791(null);};}for(var e in events){if(events[_0x77c5('0x7')](e)){var event=events[e];Team[_0x77c5('0x8')](e,emitEvent(event));}}module[_0x77c5('0x9')]=TeamEvents;
\ No newline at end of file
index 21d219d..a46799f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89db=['map','setDataValue','channel','Team','teams','Chat','Fax','Mail','Openchannel','Voice','all','catch','lodash','./team.attributes','get','then'];(function(_0x534380,_0x4c3a1d){var _0x18f1c0=function(_0x1cdc97){while(--_0x1cdc97){_0x534380['push'](_0x534380['shift']());}};_0x18f1c0(++_0x4c3a1d);}(_0x89db,0x1cc));var _0xb89d=function(_0x252864,_0xa5f162){_0x252864=_0x252864-0x0;var _0x18bd7b=_0x89db[_0x252864];return _0x18bd7b;};'use strict';var _=require(_0xb89d('0x0'));var attributes=require(_0xb89d('0x1'));function getQueuesByChannel(_0x38f0dc,_0x45ee7a){var _0x559a42=_0xb89d('0x2')+_0x45ee7a+'Queues';return _0x38f0dc[_0x559a42]()[_0xb89d('0x3')](function(_0x881f09){return _[_0xb89d('0x4')](_0x881f09,function(_0x152088){_0x152088[_0xb89d('0x5')](_0xb89d('0x6'),_0x45ee7a);return _0x152088;});})['catch'](function(_0x20dfd2){throw _0x20dfd2;});}module['exports']=function(_0x21594c){return _0x21594c['define'](_0xb89d('0x7'),attributes,{'tableName':_0xb89d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x31ecc9=this;var _0x4ba411=[_0xb89d('0x9'),_0xb89d('0xa'),_0xb89d('0xb'),_0xb89d('0xc'),'Sms',_0xb89d('0xd'),'Whatsapp'];return Promise['resolve']()[_0xb89d('0x3')](function(){var _0x47a20c=_[_0xb89d('0x4')](_0x4ba411,function(_0x393732){return getQueuesByChannel(_0x31ecc9,_0x393732);});return Promise[_0xb89d('0xe')](_0x47a20c);})[_0xb89d('0xf')](function(_0x10acec){throw _0x10acec;});}}});};
\ No newline at end of file
+var _0xa00b=['Team','teams','Fax','Mail','Openchannel','Voice','Whatsapp','lodash','./team.attributes','get','then','map','setDataValue','catch','exports','define'];(function(_0x6f1031,_0x3c0a6f){var _0x4e1b8d=function(_0x159882){while(--_0x159882){_0x6f1031['push'](_0x6f1031['shift']());}};_0x4e1b8d(++_0x3c0a6f);}(_0xa00b,0x107));var _0xba00=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa00b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xba00('0x0'));var attributes=require(_0xba00('0x1'));function getQueuesByChannel(_0x2bbf06,_0x110bc0){var _0x16ae81=_0xba00('0x2')+_0x110bc0+'Queues';return _0x2bbf06[_0x16ae81]()[_0xba00('0x3')](function(_0x3a0359){return _[_0xba00('0x4')](_0x3a0359,function(_0x4ef117){_0x4ef117[_0xba00('0x5')]('channel',_0x110bc0);return _0x4ef117;});})[_0xba00('0x6')](function(_0x4237c9){throw _0x4237c9;});}module[_0xba00('0x7')]=function(_0x36bc9a){return _0x36bc9a[_0xba00('0x8')](_0xba00('0x9'),attributes,{'tableName':_0xba00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3e0967=this;var _0x2a1b54=['Chat',_0xba00('0xb'),_0xba00('0xc'),_0xba00('0xd'),'Sms',_0xba00('0xe'),_0xba00('0xf')];return Promise['resolve']()[_0xba00('0x3')](function(){var _0x1fcc41=_[_0xba00('0x4')](_0x2a1b54,function(_0x30f5fa){return getQueuesByChannel(_0x3e0967,_0x30f5fa);});return Promise['all'](_0x1fcc41);})['catch'](function(_0x5c8d4f){throw _0x5c8d4f;});}}});};
\ No newline at end of file
index ea73409..28934f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ffe=['redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x5b3cb5,_0x1a028){var _0x43bde1=function(_0x14c1c6){while(--_0x14c1c6){_0x5b3cb5['push'](_0x5b3cb5['shift']());}};_0x43bde1(++_0x1a028);}(_0x0ffe,0x1f2));var _0xe0ff=function(_0x4e1d7d,_0x5a7761){_0x4e1d7d=_0x4e1d7d-0x0;var _0x53f086=_0x0ffe[_0x4e1d7d];return _0x53f086;};'use strict';var _=require(_0xe0ff('0x0'));var util=require(_0xe0ff('0x1'));var moment=require(_0xe0ff('0x2'));var BPromise=require(_0xe0ff('0x3'));var rs=require(_0xe0ff('0x4'));var fs=require('fs');var Redis=require(_0xe0ff('0x5'));var db=require(_0xe0ff('0x6'))['db'];var utils=require(_0xe0ff('0x7'));var logger=require(_0xe0ff('0x8'))(_0xe0ff('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe0ff('0xa')][_0xe0ff('0xb')]({'port':0x232a});config[_0xe0ff('0xc')]=_[_0xe0ff('0xd')](config[_0xe0ff('0xc')],{'host':_0xe0ff('0xe'),'port':0x18eb});var socket=require(_0xe0ff('0xf'))(new Redis(config[_0xe0ff('0xc')]));require(_0xe0ff('0x10'))[_0xe0ff('0x11')](socket);function respondWithRpcPromise(_0x5094be,_0xccf10e,_0x133775){return new BPromise(function(_0xc8811c,_0x34e25b){return client[_0xe0ff('0x12')](_0x5094be,_0x133775)[_0xe0ff('0x13')](function(_0x51a018){logger[_0xe0ff('0x14')](_0xe0ff('0x15'),_0xccf10e,_0xe0ff('0x16'));logger[_0xe0ff('0x17')](_0xe0ff('0x18'),_0xccf10e,_0xe0ff('0x16'),JSON[_0xe0ff('0x19')](_0x51a018));if(_0x51a018['error']){if(_0x51a018[_0xe0ff('0x1a')][_0xe0ff('0x1b')]===0x1f4){logger[_0xe0ff('0x1a')](_0xe0ff('0x15'),_0xccf10e,_0x51a018['error'][_0xe0ff('0x1c')]);return _0x34e25b(_0x51a018[_0xe0ff('0x1a')]['message']);}logger['error']('Team,\x20%s,\x20%s',_0xccf10e,_0x51a018['error'][_0xe0ff('0x1c')]);return _0xc8811c(_0x51a018['error'][_0xe0ff('0x1c')]);}else{logger[_0xe0ff('0x14')]('Team,\x20%s,\x20%s',_0xccf10e,_0xe0ff('0x16'));_0xc8811c(_0x51a018[_0xe0ff('0x1d')][_0xe0ff('0x1c')]);}})['catch'](function(_0x73091c){logger[_0xe0ff('0x1a')](_0xe0ff('0x15'),_0xccf10e,_0x73091c);_0x34e25b(_0x73091c);});});}
\ No newline at end of file
+var _0xf8ba=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis'];(function(_0x78438c,_0x133ac3){var _0x6f6c58=function(_0x1d0512){while(--_0x1d0512){_0x78438c['push'](_0x78438c['shift']());}};_0x6f6c58(++_0x133ac3);}(_0xf8ba,0x1a5));var _0xaf8b=function(_0x3e4e90,_0x4c0a1e){_0x3e4e90=_0x3e4e90-0x0;var _0x38effb=_0xf8ba[_0x3e4e90];return _0x38effb;};'use strict';var _=require('lodash');var util=require(_0xaf8b('0x0'));var moment=require(_0xaf8b('0x1'));var BPromise=require(_0xaf8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf8b('0x4'));var logger=require(_0xaf8b('0x5'))(_0xaf8b('0x6'));var config=require(_0xaf8b('0x7'));var jayson=require(_0xaf8b('0x8'));var client=jayson['client'][_0xaf8b('0x9')]({'port':0x232a});config[_0xaf8b('0xa')]=_[_0xaf8b('0xb')](config[_0xaf8b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf8b('0xc'))(new Redis(config[_0xaf8b('0xa')]));require('./team.socket')[_0xaf8b('0xd')](socket);function respondWithRpcPromise(_0x1a1b4c,_0x2e177d,_0x8422eb){return new BPromise(function(_0x5e5c33,_0x4a6f0b){return client[_0xaf8b('0xe')](_0x1a1b4c,_0x8422eb)['then'](function(_0x23679a){logger[_0xaf8b('0xf')](_0xaf8b('0x10'),_0x2e177d,_0xaf8b('0x11'));logger[_0xaf8b('0x12')](_0xaf8b('0x13'),_0x2e177d,_0xaf8b('0x11'),JSON[_0xaf8b('0x14')](_0x23679a));if(_0x23679a[_0xaf8b('0x15')]){if(_0x23679a[_0xaf8b('0x15')][_0xaf8b('0x16')]===0x1f4){logger[_0xaf8b('0x15')](_0xaf8b('0x10'),_0x2e177d,_0x23679a['error'][_0xaf8b('0x17')]);return _0x4a6f0b(_0x23679a[_0xaf8b('0x15')][_0xaf8b('0x17')]);}logger[_0xaf8b('0x15')]('Team,\x20%s,\x20%s',_0x2e177d,_0x23679a[_0xaf8b('0x15')]['message']);return _0x5e5c33(_0x23679a['error'][_0xaf8b('0x17')]);}else{logger[_0xaf8b('0xf')](_0xaf8b('0x10'),_0x2e177d,_0xaf8b('0x11'));_0x5e5c33(_0x23679a['result']['message']);}})[_0xaf8b('0x18')](function(_0x367d5d){logger[_0xaf8b('0x15')](_0xaf8b('0x10'),_0x2e177d,_0x367d5d);_0x4a6f0b(_0x367d5d);});});}
\ No newline at end of file
index 0162459..ba078d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f97=['save','remove','emit','removeListener','register','length','team:'];(function(_0x15b35c,_0xac8e16){var _0x2f623c=function(_0x37f30a){while(--_0x37f30a){_0x15b35c['push'](_0x15b35c['shift']());}};_0x2f623c(++_0xac8e16);}(_0x7f97,0x157));var _0x77f9=function(_0x9963a5,_0xc2f232){_0x9963a5=_0x9963a5-0x0;var _0x424449=_0x7f97[_0x9963a5];return _0x424449;};'use strict';var TeamEvents=require('./team.events');var events=[_0x77f9('0x0'),_0x77f9('0x1'),'update'];function createListener(_0x167e3f,_0x6e05e5){return function(_0x5727cd){_0x6e05e5[_0x77f9('0x2')](_0x167e3f,_0x5727cd);};}function removeListener(_0x541d69,_0x5da58d){return function(){TeamEvents[_0x77f9('0x3')](_0x541d69,_0x5da58d);};}exports[_0x77f9('0x4')]=function(_0x4939c3){for(var _0x814f5a=0x0,_0x1a833a=events[_0x77f9('0x5')];_0x814f5a<_0x1a833a;_0x814f5a++){var _0x1be0b5=events[_0x814f5a];var _0x1d917a=createListener(_0x77f9('0x6')+_0x1be0b5,_0x4939c3);TeamEvents['on'](_0x1be0b5,_0x1d917a);}};
\ No newline at end of file
+var _0x9d88=['length','team:','./team.events','remove','update','emit','removeListener'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x9d88,0x1a6));var _0x89d8=function(_0x5b67f6,_0x40abbe){_0x5b67f6=_0x5b67f6-0x0;var _0x24f323=_0x9d88[_0x5b67f6];return _0x24f323;};'use strict';var TeamEvents=require(_0x89d8('0x0'));var events=['save',_0x89d8('0x1'),_0x89d8('0x2')];function createListener(_0x5e71a1,_0x44c30d){return function(_0x1671cd){_0x44c30d[_0x89d8('0x3')](_0x5e71a1,_0x1671cd);};}function removeListener(_0x195f10,_0x5e21fd){return function(){TeamEvents[_0x89d8('0x4')](_0x195f10,_0x5e21fd);};}exports['register']=function(_0xab35a0){for(var _0x2a080c=0x0,_0x5cf58b=events[_0x89d8('0x5')];_0x2a080c<_0x5cf58b;_0x2a080c++){var _0x2ff23d=events[_0x2a080c];var _0x2c19fa=createListener(_0x89d8('0x6')+_0x2ff23d,_0xab35a0);TeamEvents['on'](_0x2ff23d,_0x2c19fa);}};
\ No newline at end of file
index 3fb4987..89388a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a62=['exports','INTEGER'];(function(_0xf3c709,_0x24cdd3){var _0x402577=function(_0x40d8d9){while(--_0x40d8d9){_0xf3c709['push'](_0xf3c709['shift']());}};_0x402577(++_0x24cdd3);}(_0x9a62,0x1bc));var _0x29a6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9a62[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x29a6('0x0')]={'TeamId':{'type':Sequelize[_0x29a6('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9c2c=['sequelize','exports'];(function(_0x10d8be,_0x80acad){var _0x45c0b5=function(_0x21cf4e){while(--_0x21cf4e){_0x10d8be['push'](_0x10d8be['shift']());}};_0x45c0b5(++_0x80acad);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc9c2('0x0'));module[_0xc9c2('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index edc6fb2..c5e0970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd3a=['../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x18c1c5,_0x141a86){var _0x457642=function(_0x2af529){while(--_0x2af529){_0x18c1c5['push'](_0x18c1c5['shift']());}};_0x457642(++_0x141a86);}(_0xfd3a,0x179));var _0xafd3=function(_0x4a1ad3,_0x426866){_0x4a1ad3=_0x4a1ad3-0x0;var _0x4b95be=_0xfd3a[_0x4a1ad3];return _0x4b95be;};'use strict';var _=require(_0xafd3('0x0'));var util=require(_0xafd3('0x1'));var logger=require(_0xafd3('0x2'))(_0xafd3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xafd3('0x4'));var fs=require('fs');var path=require(_0xafd3('0x5'));var rimraf=require(_0xafd3('0x6'));var config=require(_0xafd3('0x7'));var attributes=require(_0xafd3('0x8'));module['exports']=function(_0x9db715,_0x1a72eb){return _0x9db715[_0xafd3('0x9')](_0xafd3('0xa'),attributes,{'tableName':_0xafd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf846=['TeamVoicePrefix','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xf846,0x85));var _0x6f84=function(_0x1f98b5,_0x1d4055){_0x1f98b5=_0x1f98b5-0x0;var _0x3b53fe=_0xf846[_0x1f98b5];return _0x3b53fe;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var logger=require(_0x6f84('0x2'))(_0x6f84('0x3'));var moment=require('moment');var BPromise=require(_0x6f84('0x4'));var rp=require(_0x6f84('0x5'));var fs=require('fs');var path=require(_0x6f84('0x6'));var rimraf=require(_0x6f84('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f84('0x8'));module[_0x6f84('0x9')]=function(_0x2963cd,_0x25e3c2){return _0x2963cd[_0x6f84('0xa')](_0x6f84('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77d65fb..1d1dfa8 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(_0x63d4f5,_0xa41f4){var _0x5b2992=function(_0x29c3e9){while(--_0x29c3e9){_0x63d4f5['push'](_0x63d4f5['shift']());}};_0x5b2992(++_0xa41f4);}(_0x70e0,0x17b));var _0x070e=function(_0x37c380,_0x580097){_0x37c380=_0x37c380-0x0;var _0x595552=_0x70e0[_0x37c380];return _0x595552;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1fd5ca,_0x3e1892){var _0x4c52d2=function(_0x2fa016){while(--_0x2fa016){_0x1fd5ca['push'](_0x1fd5ca['shift']());}};_0x4c52d2(++_0x3e1892);}(_0xe706,0xa3));var _0x6e70=function(_0x100dcb,_0x2cfcdf){_0x100dcb=_0x100dcb-0x0;var _0x690bf=_0xe706[_0x100dcb];return _0x690bf;};'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 7e4d422..1cd7f5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3329=['sequelize','exports'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x3329,0x84));var _0x9332=function(_0x4cac36,_0xa97cd9){_0x4cac36=_0x4cac36-0x0;var _0x4f012a=_0x3329[_0x4cac36];return _0x4f012a;};'use strict';var Sequelize=require(_0x9332('0x0'));module[_0x9332('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x29d1=['sequelize','INTEGER'];(function(_0x39e2f1,_0x53ed8f){var _0x5272c5=function(_0x1c6b52){while(--_0x1c6b52){_0x39e2f1['push'](_0x39e2f1['shift']());}};_0x5272c5(++_0x53ed8f);}(_0x29d1,0x1d6));var _0x129d=function(_0x5d1d9f,_0x1ef696){_0x5d1d9f=_0x5d1d9f-0x0;var _0x2faa8e=_0x29d1[_0x5d1d9f];return _0x2faa8e;};'use strict';var Sequelize=require(_0x129d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x129d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index d4d6468..67330f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1af3=['exports','define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1af3,0x1ca));var _0x31af=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0x1af3[_0x4f3c9b];return _0x84e58a;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var moment=require(_0x31af('0x4'));var BPromise=require(_0x31af('0x5'));var rp=require(_0x31af('0x6'));var fs=require('fs');var path=require(_0x31af('0x7'));var rimraf=require(_0x31af('0x8'));var config=require(_0x31af('0x9'));var attributes=require('./teamVoiceQueue.attributes');module[_0x31af('0xa')]=function(_0x416162,_0x1ac3f6){return _0x416162[_0x31af('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0x31af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe062=['moment','bluebird','rimraf','../../config/environment','team_has_voice_queues','lodash','util','api'];(function(_0xb8b059,_0x453193){var _0x35e263=function(_0x57f8b6){while(--_0x57f8b6){_0xb8b059['push'](_0xb8b059['shift']());}};_0x35e263(++_0x453193);}(_0xe062,0xd5));var _0x2e06=function(_0x1df8a7,_0x48bef8){_0x1df8a7=_0x1df8a7-0x0;var _0x35f7d2=_0xe062[_0x1df8a7];return _0x35f7d2;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var logger=require('../../config/logger')(_0x2e06('0x2'));var moment=require(_0x2e06('0x3'));var BPromise=require(_0x2e06('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e06('0x5'));var config=require(_0x2e06('0x6'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x912daf,_0x31d2a3){return _0x912daf['define']('TeamVoiceQueue',attributes,{'tableName':_0x2e06('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 42a7edc..33cd7f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7398=['message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7398,0x82));var _0x8739=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7398[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x8739('0x0'));var moment=require('moment');var BPromise=require(_0x8739('0x1'));var rs=require(_0x8739('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8739('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8739('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8739('0x5'));var client=jayson[_0x8739('0x6')][_0x8739('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a3988,_0x42aaae,_0x2b7892){return new BPromise(function(_0x181e6f,_0x1b6710){return client[_0x8739('0x8')](_0x4a3988,_0x2b7892)[_0x8739('0x9')](function(_0x138f66){logger['info'](_0x8739('0xa'),_0x42aaae,'request\x20sent');logger[_0x8739('0xb')](_0x8739('0xc'),_0x42aaae,_0x8739('0xd'),JSON[_0x8739('0xe')](_0x138f66));if(_0x138f66[_0x8739('0xf')]){if(_0x138f66[_0x8739('0xf')][_0x8739('0x10')]===0x1f4){logger[_0x8739('0xf')](_0x8739('0xa'),_0x42aaae,_0x138f66[_0x8739('0xf')][_0x8739('0x11')]);return _0x1b6710(_0x138f66['error'][_0x8739('0x11')]);}logger['error'](_0x8739('0xa'),_0x42aaae,_0x138f66['error'][_0x8739('0x11')]);return _0x181e6f(_0x138f66['error']['message']);}else{logger[_0x8739('0x12')](_0x8739('0xa'),_0x42aaae,_0x8739('0xd'));_0x181e6f(_0x138f66[_0x8739('0x13')][_0x8739('0x11')]);}})[_0x8739('0x14')](function(_0x5918b4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x42aaae,_0x5918b4);_0x1b6710(_0x5918b4);});});}
\ No newline at end of file
+var _0x569b=['client','request','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x135259,_0x37861c){var _0x389c7b=function(_0x11f7cf){while(--_0x11f7cf){_0x135259['push'](_0x135259['shift']());}};_0x389c7b(++_0x37861c);}(_0x569b,0x173));var _0xb569=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x569b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var moment=require('moment');var BPromise=require(_0xb569('0x2'));var rs=require(_0xb569('0x3'));var fs=require('fs');var Redis=require(_0xb569('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb569('0x5'));var logger=require(_0xb569('0x6'))('rpc');var config=require(_0xb569('0x7'));var jayson=require(_0xb569('0x8'));var client=jayson[_0xb569('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbee933,_0x36f3c1,_0x356854){return new BPromise(function(_0x1b8cb9,_0x56519d){return client[_0xb569('0xa')](_0xbee933,_0x356854)['then'](function(_0x180969){logger[_0xb569('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x36f3c1,'request\x20sent');logger[_0xb569('0xc')](_0xb569('0xd'),_0x36f3c1,_0xb569('0xe'),JSON['stringify'](_0x180969));if(_0x180969['error']){if(_0x180969['error'][_0xb569('0xf')]===0x1f4){logger[_0xb569('0x10')](_0xb569('0x11'),_0x36f3c1,_0x180969[_0xb569('0x10')][_0xb569('0x12')]);return _0x56519d(_0x180969[_0xb569('0x10')][_0xb569('0x12')]);}logger['error'](_0xb569('0x11'),_0x36f3c1,_0x180969[_0xb569('0x10')][_0xb569('0x12')]);return _0x1b8cb9(_0x180969[_0xb569('0x10')]['message']);}else{logger[_0xb569('0xb')](_0xb569('0x11'),_0x36f3c1,_0xb569('0xe'));_0x1b8cb9(_0x180969[_0xb569('0x13')]['message']);}})['catch'](function(_0x543aed){logger[_0xb569('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x36f3c1,_0x543aed);_0x56519d(_0x543aed);});});}
\ No newline at end of file
index c4d5139..ca3a79b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7366=['post','isAuthenticated','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','index','get','/:id','show'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0x7366,0x9d));var _0x6736=function(_0x509d2e,_0x307fde){_0x509d2e=_0x509d2e-0x0;var _0x292a85=_0x7366[_0x509d2e];return _0x292a85;};'use strict';var multer=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var path=require(_0x6736('0x2'));var timeout=require(_0x6736('0x3'));var express=require(_0x6736('0x4'));var router=express[_0x6736('0x5')]();var fs_extra=require(_0x6736('0x6'));var auth=require(_0x6736('0x7'));var interaction=require(_0x6736('0x8'));var config=require('../../config/environment');var controller=require(_0x6736('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6736('0xa')]);router[_0x6736('0xb')](_0x6736('0xc'),auth['isAuthenticated'](),controller[_0x6736('0xd')]);router[_0x6736('0xe')]('/',auth[_0x6736('0xf')](),controller['create']);router[_0x6736('0x10')](_0x6736('0xc'),auth[_0x6736('0xf')](),controller['update']);router[_0x6736('0x11')]('/:id',auth[_0x6736('0xf')](),controller[_0x6736('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd1f8=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','util'];(function(_0x4d3329,_0x53e55b){var _0x3abb35=function(_0x10e135){while(--_0x10e135){_0x4d3329['push'](_0x4d3329['shift']());}};_0x3abb35(++_0x53e55b);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0xd1f8[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require(_0x8d1f('0x0'));var util=require(_0x8d1f('0x1'));var path=require(_0x8d1f('0x2'));var timeout=require(_0x8d1f('0x3'));var express=require('express');var router=express[_0x8d1f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d1f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8d1f('0x6'));var controller=require('./template.controller');router[_0x8d1f('0x7')]('/',auth[_0x8d1f('0x8')](),controller['index']);router[_0x8d1f('0x7')](_0x8d1f('0x9'),auth[_0x8d1f('0x8')](),controller[_0x8d1f('0xa')]);router[_0x8d1f('0xb')]('/',auth['isAuthenticated'](),controller[_0x8d1f('0xc')]);router[_0x8d1f('0xd')]('/:id',auth[_0x8d1f('0x8')](),controller[_0x8d1f('0xe')]);router[_0x8d1f('0xf')](_0x8d1f('0x9'),auth[_0x8d1f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 3f1c939..b579a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x443c=['sequelize','exports','STRING','TEXT'];(function(_0x155839,_0x3f679d){var _0x51d322=function(_0xf96e28){while(--_0xf96e28){_0x155839['push'](_0x155839['shift']());}};_0x51d322(++_0x3f679d);}(_0x443c,0x148));var _0xc443=function(_0x3194e3,_0x125eb3){_0x3194e3=_0x3194e3-0x0;var _0x3e1f94=_0x443c[_0x3194e3];return _0x3e1f94;};'use strict';var Sequelize=require(_0xc443('0x0'));module[_0xc443('0x1')]={'name':{'type':Sequelize[_0xc443('0x2')]},'description':{'type':Sequelize[_0xc443('0x2')]},'html':{'type':Sequelize[_0xc443('0x3')]}};
\ No newline at end of file
+var _0x460f=['exports','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x460f,0x1ef));var _0xf460=function(_0x23120d,_0x4d7006){_0x23120d=_0x23120d-0x0;var _0x1cc4d5=_0x460f[_0x23120d];return _0x1cc4d5;};'use strict';var Sequelize=require(_0xf460('0x0'));module[_0xf460('0x1')]={'name':{'type':Sequelize[_0xf460('0x2')]},'description':{'type':Sequelize[_0xf460('0x2')]},'html':{'type':Sequelize[_0xf460('0x3')]}};
\ No newline at end of file
index 254fbdf..4d33351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a52=['include','findAll','rows','show','params','keys','length','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','Templates','UserProfileResource','sendStatus','error','stack','name','index','Template','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll'];(function(_0x4756a1,_0x3f8d1){var _0x177c4f=function(_0xddb5e2){while(--_0xddb5e2){_0x4756a1['push'](_0x4756a1['shift']());}};_0x177c4f(++_0x3f8d1);}(_0x0a52,0x1ab));var _0x20a5=function(_0x2552d0,_0xeaa34b){_0x2552d0=_0x2552d0-0x0;var _0x3b4d65=_0x0a52[_0x2552d0];return _0x3b4d65;};'use strict';var emlformat=require(_0x20a5('0x0'));var rimraf=require(_0x20a5('0x1'));var zipdir=require(_0x20a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20a5('0x3'));var moment=require('moment');var BPromise=require(_0x20a5('0x4'));var Mustache=require(_0x20a5('0x5'));var util=require(_0x20a5('0x6'));var path=require(_0x20a5('0x7'));var sox=require(_0x20a5('0x8'));var csv=require(_0x20a5('0x9'));var ejs=require(_0x20a5('0xa'));var fs=require('fs');var fs_extra=require(_0x20a5('0xb'));var _=require('lodash');var squel=require(_0x20a5('0xc'));var crypto=require(_0x20a5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x20a5('0xe'));var toCsv=require(_0x20a5('0x9'));var querystring=require(_0x20a5('0xf'));var Papa=require('papaparse');var Redis=require(_0x20a5('0x10'));var authService=require(_0x20a5('0x11'));var qs=require(_0x20a5('0x12'));var as=require(_0x20a5('0x13'));var hardwareService=require(_0x20a5('0x14'));var logger=require(_0x20a5('0x15'))(_0x20a5('0x16'));var utils=require('../../config/utils');var config=require(_0x20a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x20a5('0x18'))['db'];function respondWithStatusCode(_0x181a34,_0x5052fd){_0x5052fd=_0x5052fd||0xcc;return function(_0x2e8ca3){if(_0x2e8ca3){return _0x181a34['sendStatus'](_0x5052fd);}return _0x181a34[_0x20a5('0x19')](_0x5052fd)[_0x20a5('0x1a')]();};}function respondWithResult(_0x133b8c,_0x50b8d5){_0x50b8d5=_0x50b8d5||0xc8;return function(_0x3c2c92){if(_0x3c2c92){return _0x133b8c['status'](_0x50b8d5)[_0x20a5('0x1b')](_0x3c2c92);}};}function respondWithFilteredResult(_0x5e0589,_0x3676ec){return function(_0x4f5180){if(_0x4f5180){var _0x3c9018=typeof _0x3676ec['offset']===_0x20a5('0x1c')&&typeof _0x3676ec[_0x20a5('0x1d')]===_0x20a5('0x1c');var _0x53aa30=_0x4f5180['count'];var _0x5b3406=_0x3c9018?0x0:_0x3676ec['offset'];var _0x34cd06=_0x3c9018?_0x4f5180[_0x20a5('0x1e')]:_0x3676ec[_0x20a5('0x1f')]+_0x3676ec[_0x20a5('0x1d')];var _0x3c23a6;if(_0x34cd06>=_0x53aa30){_0x34cd06=_0x53aa30;_0x3c23a6=0xc8;}else{_0x3c23a6=0xce;}_0x5e0589[_0x20a5('0x19')](_0x3c23a6);return _0x5e0589[_0x20a5('0x20')](_0x20a5('0x21'),_0x5b3406+'-'+_0x34cd06+'/'+_0x53aa30)[_0x20a5('0x1b')](_0x4f5180);}return null;};}function patchUpdates(_0xb0bfe6){return function(_0x2f5d10){try{jsonpatch['apply'](_0x2f5d10,_0xb0bfe6,!![]);}catch(_0x24a672){return BPromise['reject'](_0x24a672);}return _0x2f5d10[_0x20a5('0x22')]();};}function saveUpdates(_0x55ed75,_0x83d0c){return function(_0x3c1a58){if(_0x3c1a58){return _0x3c1a58[_0x20a5('0x23')](_0x55ed75)['then'](function(_0x277921){return _0x277921;});}return null;};}function removeEntity(_0xc72eca,_0x476a87){return function(_0x5b64fb){if(_0x5b64fb){return _0x5b64fb[_0x20a5('0x24')]()[_0x20a5('0x25')](function(){var _0x24339f=_0x5b64fb['get']({'plain':!![]});var _0x328ba4=_0x20a5('0x26');return db[_0x20a5('0x27')][_0x20a5('0x24')]({'where':{'type':_0x328ba4,'resourceId':_0x24339f['id']}})['then'](function(){return _0x5b64fb;});})[_0x20a5('0x25')](function(){_0xc72eca[_0x20a5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db7e4,_0x415fe1){return function(_0x39d6e3){if(!_0x39d6e3){_0x4db7e4[_0x20a5('0x28')](0x194);}return _0x39d6e3;};}function handleError(_0x3f55cd,_0x4bf8aa){_0x4bf8aa=_0x4bf8aa||0x1f4;return function(_0x5e1ecc){logger[_0x20a5('0x29')](_0x5e1ecc[_0x20a5('0x2a')]);if(_0x5e1ecc[_0x20a5('0x2b')]){delete _0x5e1ecc['name'];}_0x3f55cd['status'](_0x4bf8aa)['send'](_0x5e1ecc);};}exports[_0x20a5('0x2c')]=function(_0x1bb3c6,_0x56a1ad){var _0x593702={},_0x33db46={},_0x3daf0f={'count':0x0,'rows':[]};var _0x40e66a=_['map'](db[_0x20a5('0x2d')][_0x20a5('0x2e')],function(_0x586801){return{'name':_0x586801[_0x20a5('0x2f')],'type':_0x586801[_0x20a5('0x30')][_0x20a5('0x31')]};});_0x33db46[_0x20a5('0x32')]=_[_0x20a5('0x33')](_0x40e66a,_0x20a5('0x2b'));_0x33db46[_0x20a5('0x34')]=_['keys'](_0x1bb3c6[_0x20a5('0x34')]);_0x33db46[_0x20a5('0x35')]=_['intersection'](_0x33db46[_0x20a5('0x32')],_0x33db46['query']);_0x593702[_0x20a5('0x36')]=_[_0x20a5('0x37')](_0x33db46[_0x20a5('0x32')],qs['fields'](_0x1bb3c6[_0x20a5('0x34')][_0x20a5('0x38')]));_0x593702[_0x20a5('0x36')]=_0x593702[_0x20a5('0x36')]['length']?_0x593702[_0x20a5('0x36')]:_0x33db46[_0x20a5('0x32')];if(!_0x1bb3c6[_0x20a5('0x34')][_0x20a5('0x39')](_0x20a5('0x3a'))){_0x593702[_0x20a5('0x1d')]=qs[_0x20a5('0x1d')](_0x1bb3c6[_0x20a5('0x34')][_0x20a5('0x1d')]);_0x593702[_0x20a5('0x1f')]=qs[_0x20a5('0x1f')](_0x1bb3c6[_0x20a5('0x34')][_0x20a5('0x1f')]);}_0x593702['order']=qs['sort'](_0x1bb3c6['query'][_0x20a5('0x3b')]);_0x593702[_0x20a5('0x3c')]=qs[_0x20a5('0x35')](_['pick'](_0x1bb3c6[_0x20a5('0x34')],_0x33db46[_0x20a5('0x35')]),_0x40e66a);if(_0x1bb3c6[_0x20a5('0x34')][_0x20a5('0x3d')]){_0x593702[_0x20a5('0x3c')]=_[_0x20a5('0x3e')](_0x593702[_0x20a5('0x3c')],{'$or':_[_0x20a5('0x33')](_0x40e66a,function(_0x975d4c){if(_0x975d4c[_0x20a5('0x30')]!=='VIRTUAL'){var _0x517e93={};_0x517e93[_0x975d4c[_0x20a5('0x2b')]]={'$like':'%'+_0x1bb3c6['query'][_0x20a5('0x3d')]+'%'};return _0x517e93;}})});}_0x593702=_[_0x20a5('0x3e')]({},_0x593702,_0x1bb3c6[_0x20a5('0x3f')]);var _0x36ed12={'where':_0x593702['where']};return db[_0x20a5('0x2d')][_0x20a5('0x1e')](_0x36ed12)[_0x20a5('0x25')](function(_0x101ee9){_0x3daf0f[_0x20a5('0x1e')]=_0x101ee9;if(_0x1bb3c6['query'][_0x20a5('0x40')]){_0x593702[_0x20a5('0x41')]=[{'all':!![]}];}return db['Template'][_0x20a5('0x42')](_0x593702);})['then'](function(_0x2a1852){_0x3daf0f[_0x20a5('0x43')]=_0x2a1852;return _0x3daf0f;})['then'](respondWithFilteredResult(_0x56a1ad,_0x593702))['catch'](handleError(_0x56a1ad,null));};exports[_0x20a5('0x44')]=function(_0xa560d2,_0x21c8ab){var _0x4672e9={'raw':!![],'where':{'id':_0xa560d2[_0x20a5('0x45')]['id']}},_0x1e0bd5={};_0x1e0bd5['model']=_[_0x20a5('0x46')](db['Template'][_0x20a5('0x2e')]);_0x1e0bd5[_0x20a5('0x34')]=_[_0x20a5('0x46')](_0xa560d2[_0x20a5('0x34')]);_0x1e0bd5[_0x20a5('0x35')]=_['intersection'](_0x1e0bd5[_0x20a5('0x32')],_0x1e0bd5[_0x20a5('0x34')]);_0x4672e9['attributes']=_[_0x20a5('0x37')](_0x1e0bd5[_0x20a5('0x32')],qs[_0x20a5('0x38')](_0xa560d2['query'][_0x20a5('0x38')]));_0x4672e9[_0x20a5('0x36')]=_0x4672e9[_0x20a5('0x36')][_0x20a5('0x47')]?_0x4672e9[_0x20a5('0x36')]:_0x1e0bd5[_0x20a5('0x32')];if(_0xa560d2[_0x20a5('0x34')][_0x20a5('0x40')]){_0x4672e9['include']=[{'all':!![]}];}_0x4672e9=_['merge']({},_0x4672e9,_0xa560d2[_0x20a5('0x3f')]);return db[_0x20a5('0x2d')][_0x20a5('0x48')](_0x4672e9)[_0x20a5('0x25')](handleEntityNotFound(_0x21c8ab,null))[_0x20a5('0x25')](respondWithResult(_0x21c8ab,null))[_0x20a5('0x49')](handleError(_0x21c8ab,null));};exports[_0x20a5('0x4a')]=function(_0x2afc13,_0x1e7a45){return db[_0x20a5('0x2d')][_0x20a5('0x4a')](_0x2afc13['body'],{})['then'](function(_0x1d2060){var _0x5d419c=_0x2afc13[_0x20a5('0x4b')][_0x20a5('0x4c')]({'plain':!![]});if(!_0x5d419c)throw new Error(_0x20a5('0x4d'));if(_0x5d419c[_0x20a5('0x4e')]===_0x20a5('0x4b')){var _0x19642b=_0x1d2060['get']({'plain':!![]});var _0x405b9b=_0x20a5('0x26');return db[_0x20a5('0x4f')][_0x20a5('0x48')]({'where':{'name':_0x405b9b,'userProfileId':_0x5d419c['userProfileId']},'raw':!![]})[_0x20a5('0x25')](function(_0x2e7a06){if(_0x2e7a06&&_0x2e7a06['autoAssociation']===0x0){return db['UserProfileResource'][_0x20a5('0x4a')]({'name':_0x19642b[_0x20a5('0x2b')],'resourceId':_0x19642b['id'],'type':_0x2e7a06[_0x20a5('0x2b')],'sectionId':_0x2e7a06['id']},{})['then'](function(){return _0x1d2060;});}else{return _0x1d2060;}})[_0x20a5('0x49')](function(_0x668db3){logger[_0x20a5('0x29')](_0x20a5('0x50'),_0x668db3);throw _0x668db3;});}return _0x1d2060;})['then'](respondWithResult(_0x1e7a45,0xc9))[_0x20a5('0x49')](handleError(_0x1e7a45,null));};exports[_0x20a5('0x23')]=function(_0xb9390e,_0x3ec9ff){if(_0xb9390e[_0x20a5('0x51')]['id']){delete _0xb9390e[_0x20a5('0x51')]['id'];}return db[_0x20a5('0x2d')][_0x20a5('0x48')]({'where':{'id':_0xb9390e[_0x20a5('0x45')]['id']}})[_0x20a5('0x25')](handleEntityNotFound(_0x3ec9ff,null))['then'](saveUpdates(_0xb9390e[_0x20a5('0x51')],null))[_0x20a5('0x25')](respondWithResult(_0x3ec9ff,null))[_0x20a5('0x49')](handleError(_0x3ec9ff,null));};exports[_0x20a5('0x24')]=function(_0x3c6c33,_0x1846cc){return db['Template'][_0x20a5('0x48')]({'where':{'id':_0x3c6c33['params']['id']}})[_0x20a5('0x25')](handleEntityNotFound(_0x1846cc,null))[_0x20a5('0x25')](removeEntity(_0x1846cc,null))[_0x20a5('0x49')](handleError(_0x1846cc,null));};
\ No newline at end of file
+var _0xaed0=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','catch','create','user','role','UserProfileSection','find','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv'];(function(_0x1c5ef4,_0x2f8a43){var _0x1480ce=function(_0x5619c3){while(--_0x5619c3){_0x1c5ef4['push'](_0x1c5ef4['shift']());}};_0x1480ce(++_0x2f8a43);}(_0xaed0,0xe9));var _0x0aed=function(_0x27b204,_0x250026){_0x27b204=_0x27b204-0x0;var _0x48a9ac=_0xaed0[_0x27b204];return _0x48a9ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0aed('0x0'));var zipdir=require(_0x0aed('0x1'));var jsonpatch=require(_0x0aed('0x2'));var rp=require(_0x0aed('0x3'));var moment=require('moment');var BPromise=require(_0x0aed('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0aed('0x5'));var csv=require(_0x0aed('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0aed('0x7'));var squel=require(_0x0aed('0x8'));var crypto=require(_0x0aed('0x9'));var jsforce=require(_0x0aed('0xa'));var deskjs=require(_0x0aed('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0aed('0xc'));var Papa=require(_0x0aed('0xd'));var Redis=require('ioredis');var authService=require(_0x0aed('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0aed('0xf'));var hardwareService=require(_0x0aed('0x10'));var logger=require('../../config/logger')(_0x0aed('0x11'));var utils=require(_0x0aed('0x12'));var config=require(_0x0aed('0x13'));var licenseUtil=require(_0x0aed('0x14'));var db=require(_0x0aed('0x15'))['db'];function respondWithStatusCode(_0xeb1807,_0x5c7216){_0x5c7216=_0x5c7216||0xcc;return function(_0x3b3565){if(_0x3b3565){return _0xeb1807[_0x0aed('0x16')](_0x5c7216);}return _0xeb1807[_0x0aed('0x17')](_0x5c7216)[_0x0aed('0x18')]();};}function respondWithResult(_0x305409,_0x43cd61){_0x43cd61=_0x43cd61||0xc8;return function(_0x218541){if(_0x218541){return _0x305409['status'](_0x43cd61)[_0x0aed('0x19')](_0x218541);}};}function respondWithFilteredResult(_0x47f0d3,_0x2a8aed){return function(_0x555836){if(_0x555836){var _0x518958=typeof _0x2a8aed[_0x0aed('0x1a')]===_0x0aed('0x1b')&&typeof _0x2a8aed['limit']===_0x0aed('0x1b');var _0x56e208=_0x555836[_0x0aed('0x1c')];var _0x330b2a=_0x518958?0x0:_0x2a8aed[_0x0aed('0x1a')];var _0x4af346=_0x518958?_0x555836[_0x0aed('0x1c')]:_0x2a8aed[_0x0aed('0x1a')]+_0x2a8aed['limit'];var _0x586916;if(_0x4af346>=_0x56e208){_0x4af346=_0x56e208;_0x586916=0xc8;}else{_0x586916=0xce;}_0x47f0d3[_0x0aed('0x17')](_0x586916);return _0x47f0d3[_0x0aed('0x1d')](_0x0aed('0x1e'),_0x330b2a+'-'+_0x4af346+'/'+_0x56e208)[_0x0aed('0x19')](_0x555836);}return null;};}function patchUpdates(_0x42867f){return function(_0x374346){try{jsonpatch[_0x0aed('0x1f')](_0x374346,_0x42867f,!![]);}catch(_0x287dd8){return BPromise[_0x0aed('0x20')](_0x287dd8);}return _0x374346[_0x0aed('0x21')]();};}function saveUpdates(_0x56fdf5,_0x10f8f4){return function(_0x1aa165){if(_0x1aa165){return _0x1aa165[_0x0aed('0x22')](_0x56fdf5)[_0x0aed('0x23')](function(_0x1b959a){return _0x1b959a;});}return null;};}function removeEntity(_0x29c356,_0x31e0f0){return function(_0x40f09b){if(_0x40f09b){return _0x40f09b[_0x0aed('0x24')]()[_0x0aed('0x23')](function(){var _0x2c0a64=_0x40f09b[_0x0aed('0x25')]({'plain':!![]});var _0x559037=_0x0aed('0x26');return db[_0x0aed('0x27')][_0x0aed('0x24')]({'where':{'type':_0x559037,'resourceId':_0x2c0a64['id']}})[_0x0aed('0x23')](function(){return _0x40f09b;});})[_0x0aed('0x23')](function(){_0x29c356[_0x0aed('0x17')](0xcc)[_0x0aed('0x18')]();});}};}function handleEntityNotFound(_0xef4cfd,_0x238710){return function(_0x407986){if(!_0x407986){_0xef4cfd[_0x0aed('0x16')](0x194);}return _0x407986;};}function handleError(_0x58ee3b,_0x46dbbc){_0x46dbbc=_0x46dbbc||0x1f4;return function(_0x5dda9c){logger[_0x0aed('0x28')](_0x5dda9c['stack']);if(_0x5dda9c[_0x0aed('0x29')]){delete _0x5dda9c[_0x0aed('0x29')];}_0x58ee3b['status'](_0x46dbbc)[_0x0aed('0x2a')](_0x5dda9c);};}exports[_0x0aed('0x2b')]=function(_0x4550f3,_0x12efd5){var _0x1c00ea={},_0x306881={},_0x35f13e={'count':0x0,'rows':[]};var _0x5cb1cc=_[_0x0aed('0x2c')](db[_0x0aed('0x2d')][_0x0aed('0x2e')],function(_0x1f92fb){return{'name':_0x1f92fb[_0x0aed('0x2f')],'type':_0x1f92fb[_0x0aed('0x30')][_0x0aed('0x31')]};});_0x306881[_0x0aed('0x32')]=_['map'](_0x5cb1cc,_0x0aed('0x29'));_0x306881[_0x0aed('0x33')]=_[_0x0aed('0x34')](_0x4550f3[_0x0aed('0x33')]);_0x306881['filters']=_[_0x0aed('0x35')](_0x306881[_0x0aed('0x32')],_0x306881['query']);_0x1c00ea[_0x0aed('0x36')]=_['intersection'](_0x306881[_0x0aed('0x32')],qs[_0x0aed('0x37')](_0x4550f3[_0x0aed('0x33')][_0x0aed('0x37')]));_0x1c00ea[_0x0aed('0x36')]=_0x1c00ea['attributes'][_0x0aed('0x38')]?_0x1c00ea[_0x0aed('0x36')]:_0x306881[_0x0aed('0x32')];if(!_0x4550f3[_0x0aed('0x33')]['hasOwnProperty'](_0x0aed('0x39'))){_0x1c00ea[_0x0aed('0x3a')]=qs['limit'](_0x4550f3[_0x0aed('0x33')][_0x0aed('0x3a')]);_0x1c00ea['offset']=qs['offset'](_0x4550f3['query'][_0x0aed('0x1a')]);}_0x1c00ea[_0x0aed('0x3b')]=qs[_0x0aed('0x3c')](_0x4550f3[_0x0aed('0x33')][_0x0aed('0x3c')]);_0x1c00ea[_0x0aed('0x3d')]=qs['filters'](_[_0x0aed('0x3e')](_0x4550f3[_0x0aed('0x33')],_0x306881[_0x0aed('0x3f')]),_0x5cb1cc);if(_0x4550f3[_0x0aed('0x33')][_0x0aed('0x40')]){_0x1c00ea[_0x0aed('0x3d')]=_[_0x0aed('0x41')](_0x1c00ea[_0x0aed('0x3d')],{'$or':_['map'](_0x5cb1cc,function(_0x14c429){if(_0x14c429[_0x0aed('0x30')]!==_0x0aed('0x42')){var _0x498190={};_0x498190[_0x14c429[_0x0aed('0x29')]]={'$like':'%'+_0x4550f3['query'][_0x0aed('0x40')]+'%'};return _0x498190;}})});}_0x1c00ea=_['merge']({},_0x1c00ea,_0x4550f3[_0x0aed('0x43')]);var _0x34baf5={'where':_0x1c00ea['where']};return db[_0x0aed('0x2d')][_0x0aed('0x1c')](_0x34baf5)[_0x0aed('0x23')](function(_0x358d90){_0x35f13e[_0x0aed('0x1c')]=_0x358d90;if(_0x4550f3['query']['includeAll']){_0x1c00ea[_0x0aed('0x44')]=[{'all':!![]}];}return db['Template']['findAll'](_0x1c00ea);})['then'](function(_0x36b6c4){_0x35f13e[_0x0aed('0x45')]=_0x36b6c4;return _0x35f13e;})[_0x0aed('0x23')](respondWithFilteredResult(_0x12efd5,_0x1c00ea))['catch'](handleError(_0x12efd5,null));};exports[_0x0aed('0x46')]=function(_0x448a20,_0x30f9a4){var _0x4bcd36={'raw':!![],'where':{'id':_0x448a20[_0x0aed('0x47')]['id']}},_0x3794bd={};_0x3794bd['model']=_['keys'](db['Template'][_0x0aed('0x2e')]);_0x3794bd[_0x0aed('0x33')]=_[_0x0aed('0x34')](_0x448a20[_0x0aed('0x33')]);_0x3794bd[_0x0aed('0x3f')]=_[_0x0aed('0x35')](_0x3794bd[_0x0aed('0x32')],_0x3794bd[_0x0aed('0x33')]);_0x4bcd36[_0x0aed('0x36')]=_['intersection'](_0x3794bd[_0x0aed('0x32')],qs['fields'](_0x448a20[_0x0aed('0x33')]['fields']));_0x4bcd36[_0x0aed('0x36')]=_0x4bcd36['attributes'][_0x0aed('0x38')]?_0x4bcd36[_0x0aed('0x36')]:_0x3794bd[_0x0aed('0x32')];if(_0x448a20[_0x0aed('0x33')][_0x0aed('0x48')]){_0x4bcd36[_0x0aed('0x44')]=[{'all':!![]}];}_0x4bcd36=_[_0x0aed('0x41')]({},_0x4bcd36,_0x448a20[_0x0aed('0x43')]);return db['Template']['find'](_0x4bcd36)[_0x0aed('0x23')](handleEntityNotFound(_0x30f9a4,null))['then'](respondWithResult(_0x30f9a4,null))[_0x0aed('0x49')](handleError(_0x30f9a4,null));};exports[_0x0aed('0x4a')]=function(_0x9c6beb,_0x1e0090){return db[_0x0aed('0x2d')][_0x0aed('0x4a')](_0x9c6beb['body'],{})['then'](function(_0x4d81ce){var _0x2b5920=_0x9c6beb[_0x0aed('0x4b')][_0x0aed('0x25')]({'plain':!![]});if(!_0x2b5920)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b5920[_0x0aed('0x4c')]===_0x0aed('0x4b')){var _0x233db6=_0x4d81ce['get']({'plain':!![]});var _0x230b60=_0x0aed('0x26');return db[_0x0aed('0x4d')][_0x0aed('0x4e')]({'where':{'name':_0x230b60,'userProfileId':_0x2b5920['userProfileId']},'raw':!![]})['then'](function(_0x4bf3bb){if(_0x4bf3bb&&_0x4bf3bb['autoAssociation']===0x0){return db[_0x0aed('0x27')][_0x0aed('0x4a')]({'name':_0x233db6[_0x0aed('0x29')],'resourceId':_0x233db6['id'],'type':_0x4bf3bb['name'],'sectionId':_0x4bf3bb['id']},{})[_0x0aed('0x23')](function(){return _0x4d81ce;});}else{return _0x4d81ce;}})[_0x0aed('0x49')](function(_0x285d8a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x285d8a);throw _0x285d8a;});}return _0x4d81ce;})[_0x0aed('0x23')](respondWithResult(_0x1e0090,0xc9))[_0x0aed('0x49')](handleError(_0x1e0090,null));};exports[_0x0aed('0x22')]=function(_0x77a4d9,_0x405efc){if(_0x77a4d9[_0x0aed('0x4f')]['id']){delete _0x77a4d9[_0x0aed('0x4f')]['id'];}return db[_0x0aed('0x2d')][_0x0aed('0x4e')]({'where':{'id':_0x77a4d9[_0x0aed('0x47')]['id']}})[_0x0aed('0x23')](handleEntityNotFound(_0x405efc,null))['then'](saveUpdates(_0x77a4d9[_0x0aed('0x4f')],null))[_0x0aed('0x23')](respondWithResult(_0x405efc,null))[_0x0aed('0x49')](handleError(_0x405efc,null));};exports[_0x0aed('0x24')]=function(_0x10b92f,_0xbad38a){return db[_0x0aed('0x2d')][_0x0aed('0x4e')]({'where':{'id':_0x10b92f[_0x0aed('0x47')]['id']}})[_0x0aed('0x23')](handleEntityNotFound(_0xbad38a,null))[_0x0aed('0x23')](removeEntity(_0xbad38a,null))[_0x0aed('0x49')](handleError(_0xbad38a,null));};
\ No newline at end of file
index 3adee5f..60cfea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30c3=['../../config/environment','./template.attributes','exports','tools_templates','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2fd946,_0x3d32b9){var _0x2f521e=function(_0x45e6b4){while(--_0x45e6b4){_0x2fd946['push'](_0x2fd946['shift']());}};_0x2f521e(++_0x3d32b9);}(_0x30c3,0x1bc));var _0x330c=function(_0x312130,_0x569442){_0x312130=_0x312130-0x0;var _0x52a146=_0x30c3[_0x312130];return _0x52a146;};'use strict';var _=require(_0x330c('0x0'));var util=require(_0x330c('0x1'));var logger=require(_0x330c('0x2'))(_0x330c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x330c('0x4'));var fs=require('fs');var path=require(_0x330c('0x5'));var rimraf=require(_0x330c('0x6'));var config=require(_0x330c('0x7'));var attributes=require(_0x330c('0x8'));module[_0x330c('0x9')]=function(_0x3fd124,_0x1e69c3){return _0x3fd124['define']('Template',attributes,{'tableName':_0x330c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebbb=['bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','api','moment'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xebbb,0x96));var _0xbebb=function(_0x13d02b,_0x4023a9){_0x13d02b=_0x13d02b-0x0;var _0x2759a7=_0xebbb[_0x13d02b];return _0x2759a7;};'use strict';var _=require(_0xbebb('0x0'));var util=require(_0xbebb('0x1'));var logger=require('../../config/logger')(_0xbebb('0x2'));var moment=require(_0xbebb('0x3'));var BPromise=require(_0xbebb('0x4'));var rp=require(_0xbebb('0x5'));var fs=require('fs');var path=require(_0xbebb('0x6'));var rimraf=require(_0xbebb('0x7'));var config=require(_0xbebb('0x8'));var attributes=require(_0xbebb('0x9'));module[_0xbebb('0xa')]=function(_0x155f2d,_0x55182c){return _0x155f2d[_0xbebb('0xb')](_0xbebb('0xc'),attributes,{'tableName':_0xbebb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a428bcf..0320778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36f9=['request\x20sent','stringify','error','code','message','catch','Template','findAll','options','raw','where','attributes','limit','map','include','model','GetTemplate','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x36f9,0x151));var _0x936f=function(_0x117289,_0x4eea98){_0x117289=_0x117289-0x0;var _0x12565f=_0x36f9[_0x117289];return _0x12565f;};'use strict';var _=require(_0x936f('0x0'));var util=require('util');var moment=require(_0x936f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x936f('0x2'));var db=require(_0x936f('0x3'))['db'];var utils=require(_0x936f('0x4'));var logger=require(_0x936f('0x5'))(_0x936f('0x6'));var config=require(_0x936f('0x7'));var jayson=require(_0x936f('0x8'));var client=jayson[_0x936f('0x9')][_0x936f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x361291,_0x3fa338,_0x5b3cf7){return new BPromise(function(_0xdaf708,_0x40695c){return client[_0x936f('0xb')](_0x361291,_0x5b3cf7)[_0x936f('0xc')](function(_0x18feb9){logger[_0x936f('0xd')](_0x936f('0xe'),_0x3fa338,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x3fa338,_0x936f('0xf'),JSON[_0x936f('0x10')](_0x18feb9));if(_0x18feb9[_0x936f('0x11')]){if(_0x18feb9[_0x936f('0x11')][_0x936f('0x12')]===0x1f4){logger[_0x936f('0x11')](_0x936f('0xe'),_0x3fa338,_0x18feb9[_0x936f('0x11')]['message']);return _0x40695c(_0x18feb9[_0x936f('0x11')][_0x936f('0x13')]);}logger[_0x936f('0x11')](_0x936f('0xe'),_0x3fa338,_0x18feb9[_0x936f('0x11')][_0x936f('0x13')]);return _0xdaf708(_0x18feb9['error'][_0x936f('0x13')]);}else{logger['info'](_0x936f('0xe'),_0x3fa338,_0x936f('0xf'));_0xdaf708(_0x18feb9['result'][_0x936f('0x13')]);}})[_0x936f('0x14')](function(_0x4dcb6d){logger['error'](_0x936f('0xe'),_0x3fa338,_0x4dcb6d);_0x40695c(_0x4dcb6d);});});}exports['GetTemplate']=function(_0x1363e3){var _0x4af315=this;return new Promise(function(_0x3867bc,_0x40f828){return db[_0x936f('0x15')][_0x936f('0x16')]({'raw':_0x1363e3[_0x936f('0x17')]?_0x1363e3[_0x936f('0x17')][_0x936f('0x18')]===undefined?!![]:![]:!![],'where':_0x1363e3[_0x936f('0x17')]?_0x1363e3[_0x936f('0x17')][_0x936f('0x19')]||null:null,'attributes':_0x1363e3['options']?_0x1363e3['options'][_0x936f('0x1a')]||null:null,'limit':_0x1363e3[_0x936f('0x17')]?_0x1363e3[_0x936f('0x17')][_0x936f('0x1b')]||null:null,'include':_0x1363e3[_0x936f('0x17')]?_0x1363e3[_0x936f('0x17')]['include']?_[_0x936f('0x1c')](_0x1363e3[_0x936f('0x17')][_0x936f('0x1d')],function(_0x19e692){return{'model':db[_0x19e692[_0x936f('0x1e')]],'as':_0x19e692['as'],'attributes':_0x19e692['attributes'],'include':_0x19e692['include']?_[_0x936f('0x1c')](_0x19e692[_0x936f('0x1d')],function(_0x32f008){return{'model':db[_0x32f008[_0x936f('0x1e')]],'as':_0x32f008['as'],'attributes':_0x32f008[_0x936f('0x1a')],'include':_0x32f008[_0x936f('0x1d')]?_[_0x936f('0x1c')](_0x32f008['include'],function(_0x5e00de){return{'model':db[_0x5e00de[_0x936f('0x1e')]],'as':_0x5e00de['as'],'attributes':_0x5e00de[_0x936f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x936f('0xc')](function(_0x4fd473){logger[_0x936f('0xd')]('GetTemplate',_0x1363e3);logger['debug'](_0x936f('0x1f'),_0x1363e3,JSON['stringify'](_0x4fd473));_0x3867bc(_0x4fd473);})['catch'](function(_0x345472){logger[_0x936f('0x11')](_0x936f('0x1f'),_0x345472['message'],_0x1363e3);_0x40f828(_0x4af315[_0x936f('0x11')](0x1f4,_0x345472[_0x936f('0x13')]));});});};
\ No newline at end of file
+var _0x1c52=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','message','Template,\x20%s,\x20%s','catch','Template','options','attributes','include','map','model','then','GetTemplate','debug','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x3b8d42,_0x117e61){var _0x1e80f9=function(_0x211544){while(--_0x211544){_0x3b8d42['push'](_0x3b8d42['shift']());}};_0x1e80f9(++_0x117e61);}(_0x1c52,0xa9));var _0x21c5=function(_0x5a5c78,_0x40c396){_0x5a5c78=_0x5a5c78-0x0;var _0x53568c=_0x1c52[_0x5a5c78];return _0x53568c;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require('moment');var BPromise=require(_0x21c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x21c5('0x3'));var db=require(_0x21c5('0x4'))['db'];var utils=require(_0x21c5('0x5'));var logger=require(_0x21c5('0x6'))(_0x21c5('0x7'));var config=require('../../config/environment');var jayson=require(_0x21c5('0x8'));var client=jayson[_0x21c5('0x9')][_0x21c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x315087,_0x4d9c06,_0x47c9d4){return new BPromise(function(_0x38fafd,_0x3a2ab4){return client[_0x21c5('0xb')](_0x315087,_0x47c9d4)['then'](function(_0x141a50){logger[_0x21c5('0xc')]('Template,\x20%s,\x20%s',_0x4d9c06,_0x21c5('0xd'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x4d9c06,'request\x20sent',JSON[_0x21c5('0xe')](_0x141a50));if(_0x141a50[_0x21c5('0xf')]){if(_0x141a50[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('Template,\x20%s,\x20%s',_0x4d9c06,_0x141a50[_0x21c5('0xf')][_0x21c5('0x11')]);return _0x3a2ab4(_0x141a50[_0x21c5('0xf')]['message']);}logger[_0x21c5('0xf')](_0x21c5('0x12'),_0x4d9c06,_0x141a50[_0x21c5('0xf')][_0x21c5('0x11')]);return _0x38fafd(_0x141a50['error'][_0x21c5('0x11')]);}else{logger[_0x21c5('0xc')](_0x21c5('0x12'),_0x4d9c06,_0x21c5('0xd'));_0x38fafd(_0x141a50['result'][_0x21c5('0x11')]);}})[_0x21c5('0x13')](function(_0x464156){logger[_0x21c5('0xf')](_0x21c5('0x12'),_0x4d9c06,_0x464156);_0x3a2ab4(_0x464156);});});}exports['GetTemplate']=function(_0x26040b){var _0x2826c3=this;return new Promise(function(_0x283fd7,_0x57a680){return db[_0x21c5('0x14')]['findAll']({'raw':_0x26040b[_0x21c5('0x15')]?_0x26040b['options']['raw']===undefined?!![]:![]:!![],'where':_0x26040b['options']?_0x26040b[_0x21c5('0x15')]['where']||null:null,'attributes':_0x26040b[_0x21c5('0x15')]?_0x26040b['options'][_0x21c5('0x16')]||null:null,'limit':_0x26040b[_0x21c5('0x15')]?_0x26040b['options']['limit']||null:null,'include':_0x26040b[_0x21c5('0x15')]?_0x26040b['options'][_0x21c5('0x17')]?_[_0x21c5('0x18')](_0x26040b['options'][_0x21c5('0x17')],function(_0x1e9e2e){return{'model':db[_0x1e9e2e[_0x21c5('0x19')]],'as':_0x1e9e2e['as'],'attributes':_0x1e9e2e['attributes'],'include':_0x1e9e2e['include']?_[_0x21c5('0x18')](_0x1e9e2e[_0x21c5('0x17')],function(_0x2fad52){return{'model':db[_0x2fad52['model']],'as':_0x2fad52['as'],'attributes':_0x2fad52[_0x21c5('0x16')],'include':_0x2fad52['include']?_[_0x21c5('0x18')](_0x2fad52['include'],function(_0x125ee0){return{'model':db[_0x125ee0[_0x21c5('0x19')]],'as':_0x125ee0['as'],'attributes':_0x125ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x21c5('0x1a')](function(_0x448386){logger[_0x21c5('0xc')](_0x21c5('0x1b'),_0x26040b);logger[_0x21c5('0x1c')](_0x21c5('0x1b'),_0x26040b,JSON['stringify'](_0x448386));_0x283fd7(_0x448386);})[_0x21c5('0x13')](function(_0x2585c8){logger[_0x21c5('0xf')](_0x21c5('0x1b'),_0x2585c8[_0x21c5('0x11')],_0x26040b);_0x57a680(_0x2826c3[_0x21c5('0xf')](0x1f4,_0x2585c8[_0x21c5('0x11')]));});});};
\ No newline at end of file
index 61bbb41..20b938b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x323d=['addAnyCondition','addAction','put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0x323d,0x12f));var _0xd323=function(_0x4b0211,_0x17f347){_0x4b0211=_0x4b0211-0x0;var _0x1906fc=_0x323d[_0x4b0211];return _0x1906fc;};'use strict';var multer=require('multer');var util=require(_0xd323('0x0'));var path=require(_0xd323('0x1'));var timeout=require(_0xd323('0x2'));var express=require(_0xd323('0x3'));var router=express[_0xd323('0x4')]();var fs_extra=require(_0xd323('0x5'));var auth=require(_0xd323('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd323('0x7'));router[_0xd323('0x8')]('/',auth[_0xd323('0x9')](),controller[_0xd323('0xa')]);router[_0xd323('0x8')](_0xd323('0xb'),auth[_0xd323('0x9')](),controller[_0xd323('0xc')]);router['get'](_0xd323('0xd'),auth['isAuthenticated'](),controller[_0xd323('0xe')]);router[_0xd323('0x8')](_0xd323('0xf'),auth[_0xd323('0x9')](),controller[_0xd323('0x10')]);router['get'](_0xd323('0x11'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd323('0x12')](_0xd323('0xd'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0xd323('0x12')]('/:id/any_conditions',auth[_0xd323('0x9')](),controller[_0xd323('0x13')]);router[_0xd323('0x12')](_0xd323('0x11'),auth['isAuthenticated'](),controller[_0xd323('0x14')]);router[_0xd323('0x15')](_0xd323('0xb'),auth[_0xd323('0x9')](),controller[_0xd323('0x16')]);router['delete'](_0xd323('0xb'),auth[_0xd323('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x59ae=['getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions'];(function(_0x9ad85,_0x579b3d){var _0x4a5342=function(_0x31b5d6){while(--_0x31b5d6){_0x9ad85['push'](_0x9ad85['shift']());}};_0x4a5342(++_0x579b3d);}(_0x59ae,0x11a));var _0xe59a=function(_0x233bae,_0x3adb75){_0x233bae=_0x233bae-0x0;var _0x5e7f7c=_0x59ae[_0x233bae];return _0x5e7f7c;};'use strict';var multer=require(_0xe59a('0x0'));var util=require('util');var path=require(_0xe59a('0x1'));var timeout=require(_0xe59a('0x2'));var express=require(_0xe59a('0x3'));var router=express[_0xe59a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe59a('0x5'));var interaction=require(_0xe59a('0x6'));var config=require(_0xe59a('0x7'));var controller=require('./trigger.controller');router[_0xe59a('0x8')]('/',auth[_0xe59a('0x9')](),controller['index']);router['get'](_0xe59a('0xa'),auth[_0xe59a('0x9')](),controller[_0xe59a('0xb')]);router['get'](_0xe59a('0xc'),auth['isAuthenticated'](),controller[_0xe59a('0xd')]);router[_0xe59a('0x8')](_0xe59a('0xe'),auth['isAuthenticated'](),controller[_0xe59a('0xf')]);router[_0xe59a('0x8')](_0xe59a('0x10'),auth['isAuthenticated'](),controller[_0xe59a('0x11')]);router[_0xe59a('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe59a('0x12')](_0xe59a('0xc'),auth[_0xe59a('0x9')](),controller[_0xe59a('0x13')]);router[_0xe59a('0x12')](_0xe59a('0xe'),auth[_0xe59a('0x9')](),controller[_0xe59a('0x14')]);router[_0xe59a('0x12')]('/:id/actions',auth[_0xe59a('0x9')](),controller[_0xe59a('0x15')]);router[_0xe59a('0x16')](_0xe59a('0xa'),auth[_0xe59a('0x9')](),controller[_0xe59a('0x17')]);router[_0xe59a('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xe59a('0x19')]);module[_0xe59a('0x1a')]=router;
\ No newline at end of file
index f53638b..2e7fb11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe613=['STRING','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe613,0x7d));var _0x3e61=function(_0x6544cf,_0xab4cde){_0x6544cf=_0x6544cf-0x0;var _0x16dc52=_0xe613[_0x6544cf];return _0x16dc52;};'use strict';var Sequelize=require('sequelize');module[_0x3e61('0x0')]={'name':{'type':Sequelize[_0x3e61('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3e61('0x1')]},'status':{'type':Sequelize[_0x3e61('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5a4a=['STRING','sequelize','exports'];(function(_0x52aa81,_0x1b22ed){var _0x4bbe70=function(_0x4322e0){while(--_0x4322e0){_0x52aa81['push'](_0x52aa81['shift']());}};_0x4bbe70(++_0x1b22ed);}(_0x5a4a,0x100));var _0xa5a4=function(_0x561580,_0xe513c6){_0x561580=_0x561580-0x0;var _0x189310=_0x5a4a[_0x561580];return _0x189310;};'use strict';var Sequelize=require(_0xa5a4('0x0'));module[_0xa5a4('0x1')]={'name':{'type':Sequelize[_0xa5a4('0x2')]},'channel':{'type':Sequelize[_0xa5a4('0x2')]},'description':{'type':Sequelize[_0xa5a4('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index c4a554d..8efcc1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dda=['ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','then','get','Triggers','destroy','end','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','options','includeAll','include','catch','params','keys','Trigger','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','length','filter','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4dda,0xa7));var _0xa4dd=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x4dda[_0x52980f];return _0x1f52a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4dd('0x0'));var zipdir=require(_0xa4dd('0x1'));var jsonpatch=require(_0xa4dd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa4dd('0x3'));var Mustache=require(_0xa4dd('0x4'));var util=require('util');var path=require(_0xa4dd('0x5'));var sox=require(_0xa4dd('0x6'));var csv=require('to-csv');var ejs=require(_0xa4dd('0x7'));var fs=require('fs');var fs_extra=require(_0xa4dd('0x8'));var _=require(_0xa4dd('0x9'));var squel=require(_0xa4dd('0xa'));var crypto=require(_0xa4dd('0xb'));var jsforce=require(_0xa4dd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa4dd('0xd'));var authService=require(_0xa4dd('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4dd('0xf'));var logger=require(_0xa4dd('0x10'))(_0xa4dd('0x11'));var utils=require(_0xa4dd('0x12'));var config=require(_0xa4dd('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4dd('0x14'))['db'];function respondWithStatusCode(_0xe89d79,_0x382dd3){_0x382dd3=_0x382dd3||0xcc;return function(_0x186923){if(_0x186923){return _0xe89d79[_0xa4dd('0x15')](_0x382dd3);}return _0xe89d79[_0xa4dd('0x16')](_0x382dd3)['end']();};}function respondWithResult(_0x1b4ee4,_0x565329){_0x565329=_0x565329||0xc8;return function(_0x3193d3){if(_0x3193d3){return _0x1b4ee4['status'](_0x565329)[_0xa4dd('0x17')](_0x3193d3);}};}function respondWithFilteredResult(_0x3aeecf,_0xd56d3c){return function(_0x145284){if(_0x145284){var _0x56fd66=typeof _0xd56d3c[_0xa4dd('0x18')]===_0xa4dd('0x19')&&typeof _0xd56d3c[_0xa4dd('0x1a')]==='undefined';var _0x387e55=_0x145284[_0xa4dd('0x1b')];var _0x491461=_0x56fd66?0x0:_0xd56d3c[_0xa4dd('0x18')];var _0x229779=_0x56fd66?_0x145284[_0xa4dd('0x1b')]:_0xd56d3c[_0xa4dd('0x18')]+_0xd56d3c[_0xa4dd('0x1a')];var _0x3c0dc3;if(_0x229779>=_0x387e55){_0x229779=_0x387e55;_0x3c0dc3=0xc8;}else{_0x3c0dc3=0xce;}_0x3aeecf['status'](_0x3c0dc3);return _0x3aeecf['set']('Content-Range',_0x491461+'-'+_0x229779+'/'+_0x387e55)['json'](_0x145284);}return null;};}function patchUpdates(_0x395429){return function(_0x3bc418){try{jsonpatch[_0xa4dd('0x1c')](_0x3bc418,_0x395429,!![]);}catch(_0x5cad3e){return BPromise[_0xa4dd('0x1d')](_0x5cad3e);}return _0x3bc418['save']();};}function saveUpdates(_0x43a976,_0x35c91e){return function(_0x47e688){if(_0x47e688){return _0x47e688['update'](_0x43a976)['then'](function(_0x388f39){return _0x388f39;});}return null;};}function removeEntity(_0x2f510c,_0x2596bf){return function(_0x47e46c){if(_0x47e46c){return _0x47e46c['destroy']()[_0xa4dd('0x1e')](function(){var _0x52d4d3=_0x47e46c[_0xa4dd('0x1f')]({'plain':!![]});var _0x20a42b=_0xa4dd('0x20');return db['UserProfileResource'][_0xa4dd('0x21')]({'where':{'type':_0x20a42b,'resourceId':_0x52d4d3['id']}})[_0xa4dd('0x1e')](function(){return _0x47e46c;});})[_0xa4dd('0x1e')](function(){_0x2f510c[_0xa4dd('0x16')](0xcc)[_0xa4dd('0x22')]();});}};}function handleEntityNotFound(_0x3e84ab,_0x23e23a){return function(_0x4350b3){if(!_0x4350b3){_0x3e84ab['sendStatus'](0x194);}return _0x4350b3;};}function handleError(_0x35d176,_0x2649df){_0x2649df=_0x2649df||0x1f4;return function(_0x154b71){logger['error'](_0x154b71['stack']);if(_0x154b71[_0xa4dd('0x23')]){delete _0x154b71[_0xa4dd('0x23')];}_0x35d176['status'](_0x2649df)[_0xa4dd('0x24')](_0x154b71);};}exports[_0xa4dd('0x25')]=function(_0x2d19de,_0x11abf9){var _0x1ca20c={},_0xb4631e={},_0x43c23f={'count':0x0,'rows':[]};var _0x234475=_[_0xa4dd('0x26')](db['Trigger'][_0xa4dd('0x27')],function(_0x14c347){return{'name':_0x14c347[_0xa4dd('0x28')],'type':_0x14c347[_0xa4dd('0x29')]['key']};});_0xb4631e[_0xa4dd('0x2a')]=_['map'](_0x234475,_0xa4dd('0x23'));_0xb4631e[_0xa4dd('0x2b')]=_['keys'](_0x2d19de['query']);_0xb4631e[_0xa4dd('0x2c')]=_[_0xa4dd('0x2d')](_0xb4631e[_0xa4dd('0x2a')],_0xb4631e['query']);_0x1ca20c['attributes']=_['intersection'](_0xb4631e['model'],qs[_0xa4dd('0x2e')](_0x2d19de[_0xa4dd('0x2b')]['fields']));_0x1ca20c[_0xa4dd('0x2f')]=_0x1ca20c['attributes']['length']?_0x1ca20c[_0xa4dd('0x2f')]:_0xb4631e[_0xa4dd('0x2a')];if(!_0x2d19de['query'][_0xa4dd('0x30')](_0xa4dd('0x31'))){_0x1ca20c['limit']=qs['limit'](_0x2d19de[_0xa4dd('0x2b')]['limit']);_0x1ca20c[_0xa4dd('0x18')]=qs[_0xa4dd('0x18')](_0x2d19de[_0xa4dd('0x2b')][_0xa4dd('0x18')]);}_0x1ca20c[_0xa4dd('0x32')]=qs[_0xa4dd('0x33')](_0x2d19de[_0xa4dd('0x2b')][_0xa4dd('0x33')]);_0x1ca20c['where']=qs[_0xa4dd('0x2c')](_[_0xa4dd('0x34')](_0x2d19de['query'],_0xb4631e['filters']),_0x234475);if(_0x2d19de[_0xa4dd('0x2b')]['filter']){_0x1ca20c['where']=_[_0xa4dd('0x35')](_0x1ca20c[_0xa4dd('0x36')],{'$or':_[_0xa4dd('0x26')](_0x234475,function(_0x30674c){if(_0x30674c[_0xa4dd('0x29')]!=='VIRTUAL'){var _0x57161a={};_0x57161a[_0x30674c[_0xa4dd('0x23')]]={'$like':'%'+_0x2d19de['query']['filter']+'%'};return _0x57161a;}})});}_0x1ca20c=_[_0xa4dd('0x35')]({},_0x1ca20c,_0x2d19de[_0xa4dd('0x37')]);var _0x404226={'where':_0x1ca20c[_0xa4dd('0x36')]};return db['Trigger'][_0xa4dd('0x1b')](_0x404226)[_0xa4dd('0x1e')](function(_0x1b3b27){_0x43c23f[_0xa4dd('0x1b')]=_0x1b3b27;if(_0x2d19de[_0xa4dd('0x2b')][_0xa4dd('0x38')]){_0x1ca20c[_0xa4dd('0x39')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x1ca20c);})['then'](function(_0x1bdb99){_0x43c23f['rows']=_0x1bdb99;return _0x43c23f;})[_0xa4dd('0x1e')](respondWithFilteredResult(_0x11abf9,_0x1ca20c))[_0xa4dd('0x3a')](handleError(_0x11abf9,null));};exports['show']=function(_0x48f5dc,_0x36b8f8){var _0x4551d2={'raw':![],'where':{'id':_0x48f5dc[_0xa4dd('0x3b')]['id']}},_0x4e1b2a={};_0x4e1b2a['model']=_[_0xa4dd('0x3c')](db[_0xa4dd('0x3d')][_0xa4dd('0x27')]);_0x4e1b2a[_0xa4dd('0x2b')]=_['keys'](_0x48f5dc[_0xa4dd('0x2b')]);_0x4e1b2a['filters']=_[_0xa4dd('0x2d')](_0x4e1b2a[_0xa4dd('0x2a')],_0x4e1b2a[_0xa4dd('0x2b')]);_0x4551d2[_0xa4dd('0x2f')]=_[_0xa4dd('0x2d')](_0x4e1b2a[_0xa4dd('0x2a')],qs['fields'](_0x48f5dc[_0xa4dd('0x2b')][_0xa4dd('0x2e')]));_0x4551d2[_0xa4dd('0x2f')]=_0x4551d2['attributes']['length']?_0x4551d2['attributes']:_0x4e1b2a['model'];if(_0x48f5dc['query'][_0xa4dd('0x38')]){_0x4551d2['include']=[{'all':!![]}];}_0x4551d2=_[_0xa4dd('0x35')]({},_0x4551d2,_0x48f5dc[_0xa4dd('0x37')]);return db[_0xa4dd('0x3d')][_0xa4dd('0x3e')](_0x4551d2)[_0xa4dd('0x1e')](handleEntityNotFound(_0x36b8f8,null))[_0xa4dd('0x1e')](respondWithResult(_0x36b8f8,null))[_0xa4dd('0x3a')](handleError(_0x36b8f8,null));};exports[_0xa4dd('0x3f')]=function(_0x4c2e7b,_0x586788){return db[_0xa4dd('0x3d')][_0xa4dd('0x3f')](_0x4c2e7b[_0xa4dd('0x40')],{})[_0xa4dd('0x1e')](function(_0xa21e0c){var _0x50a3cb=_0x4c2e7b[_0xa4dd('0x41')][_0xa4dd('0x1f')]({'plain':!![]});if(!_0x50a3cb)throw new Error(_0xa4dd('0x42'));if(_0x50a3cb[_0xa4dd('0x43')]===_0xa4dd('0x41')){var _0x333cb1=_0xa21e0c[_0xa4dd('0x1f')]({'plain':!![]});var _0x4ca27f='Triggers';return db[_0xa4dd('0x44')][_0xa4dd('0x3e')]({'where':{'name':_0x4ca27f,'userProfileId':_0x50a3cb[_0xa4dd('0x45')]},'raw':!![]})[_0xa4dd('0x1e')](function(_0x417a3c){if(_0x417a3c&&_0x417a3c[_0xa4dd('0x46')]===0x0){return db['UserProfileResource']['create']({'name':_0x333cb1[_0xa4dd('0x23')],'resourceId':_0x333cb1['id'],'type':_0x417a3c[_0xa4dd('0x23')],'sectionId':_0x417a3c['id']},{})[_0xa4dd('0x1e')](function(){return _0xa21e0c;});}else{return _0xa21e0c;}})[_0xa4dd('0x3a')](function(_0x148cb1){logger[_0xa4dd('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x148cb1);throw _0x148cb1;});}return _0xa21e0c;})['then'](respondWithResult(_0x586788,0xc9))[_0xa4dd('0x3a')](handleError(_0x586788,null));};exports[_0xa4dd('0x48')]=function(_0x4f325a,_0x1e9a37){if(_0x4f325a[_0xa4dd('0x40')]['id']){delete _0x4f325a[_0xa4dd('0x40')]['id'];}return db['Trigger'][_0xa4dd('0x3e')]({'where':{'id':_0x4f325a[_0xa4dd('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1e9a37,null))['then'](saveUpdates(_0x4f325a['body'],null))['then'](respondWithResult(_0x1e9a37,null))['catch'](handleError(_0x1e9a37,null));};exports[_0xa4dd('0x21')]=function(_0x37188d,_0x18096d){return db[_0xa4dd('0x3d')]['find']({'where':{'id':_0x37188d[_0xa4dd('0x3b')]['id']}})[_0xa4dd('0x1e')](handleEntityNotFound(_0x18096d,null))[_0xa4dd('0x1e')](removeEntity(_0x18096d,null))[_0xa4dd('0x3a')](handleError(_0x18096d,null));};exports[_0xa4dd('0x49')]=function(_0x2a9828,_0x3b882e,_0x176ff1){if(_0x2a9828['body']['id']){delete _0x2a9828[_0xa4dd('0x40')]['id'];}return db[_0xa4dd('0x3d')][_0xa4dd('0x3e')]({'where':{'id':_0x2a9828['params']['id']}})[_0xa4dd('0x1e')](handleEntityNotFound(_0x3b882e,null))[_0xa4dd('0x1e')](function(_0x2232c7){if(_0x2232c7){_0x2a9828[_0xa4dd('0x40')][_0xa4dd('0x4a')]=_0x2232c7['id'];return db[_0xa4dd('0x4b')]['create'](_0x2a9828[_0xa4dd('0x40')]);}})[_0xa4dd('0x1e')](respondWithResult(_0x3b882e,null))[_0xa4dd('0x3a')](handleError(_0x3b882e,null));};exports[_0xa4dd('0x4c')]=function(_0x4cc468,_0xa550c3,_0x1e756e){if(_0x4cc468[_0xa4dd('0x40')]['id']){delete _0x4cc468[_0xa4dd('0x40')]['id'];}return db[_0xa4dd('0x3d')]['find']({'where':{'id':_0x4cc468[_0xa4dd('0x3b')]['id']}})['then'](handleEntityNotFound(_0xa550c3,null))['then'](function(_0x3af60b){if(_0x3af60b){_0x4cc468['body'][_0xa4dd('0x4d')]=_0x3af60b['id'];return db['Condition']['create'](_0x4cc468[_0xa4dd('0x40')]);}})[_0xa4dd('0x1e')](respondWithResult(_0xa550c3,null))[_0xa4dd('0x3a')](handleError(_0xa550c3,null));};exports[_0xa4dd('0x4e')]=function(_0x29559f,_0x32e2dc,_0x170965){var _0x4056fe={};var _0x1af2c5={};var _0x5bce8e;var _0x9cfe16;return db[_0xa4dd('0x3d')][_0xa4dd('0x4f')]({'where':{'id':_0x29559f[_0xa4dd('0x3b')]['id']}})[_0xa4dd('0x1e')](handleEntityNotFound(_0x32e2dc,null))[_0xa4dd('0x1e')](function(_0x2a95cf){if(_0x2a95cf){_0x5bce8e=_0x2a95cf;_0x1af2c5[_0xa4dd('0x2a')]=_[_0xa4dd('0x3c')](db[_0xa4dd('0x4b')]['rawAttributes']);_0x1af2c5[_0xa4dd('0x2b')]=_[_0xa4dd('0x3c')](_0x29559f['query']);_0x1af2c5[_0xa4dd('0x2c')]=_[_0xa4dd('0x2d')](_0x1af2c5[_0xa4dd('0x2a')],_0x1af2c5[_0xa4dd('0x2b')]);_0x4056fe[_0xa4dd('0x2f')]=_[_0xa4dd('0x2d')](_0x1af2c5[_0xa4dd('0x2a')],qs[_0xa4dd('0x2e')](_0x29559f[_0xa4dd('0x2b')][_0xa4dd('0x2e')]));_0x4056fe['attributes']=_0x4056fe[_0xa4dd('0x2f')][_0xa4dd('0x50')]?_0x4056fe[_0xa4dd('0x2f')]:_0x1af2c5[_0xa4dd('0x2a')];_0x4056fe[_0xa4dd('0x32')]=qs[_0xa4dd('0x33')](_0x29559f[_0xa4dd('0x2b')]['sort']);_0x4056fe['where']=qs[_0xa4dd('0x2c')](_[_0xa4dd('0x34')](_0x29559f[_0xa4dd('0x2b')],_0x1af2c5[_0xa4dd('0x2c')]));if(_0x29559f[_0xa4dd('0x2b')][_0xa4dd('0x51')]){_0x4056fe['where']=_[_0xa4dd('0x35')](_0x4056fe[_0xa4dd('0x36')],{'$or':_[_0xa4dd('0x26')](_0x4056fe['attributes'],function(_0x31d9a3){var _0x2fe2cd={};_0x2fe2cd[_0x31d9a3]={'$like':'%'+_0x29559f[_0xa4dd('0x2b')][_0xa4dd('0x51')]+'%'};return _0x2fe2cd;})});}_0x4056fe=_[_0xa4dd('0x35')]({},_0x4056fe,_0x29559f[_0xa4dd('0x37')]);return _0x5bce8e[_0xa4dd('0x4e')](_0x4056fe);}})[_0xa4dd('0x1e')](function(_0x20bbf5){if(_0x20bbf5){_0x9cfe16=_0x20bbf5[_0xa4dd('0x50')];if(!_0x29559f['query']['hasOwnProperty'](_0xa4dd('0x31'))){_0x4056fe['limit']=qs['limit'](_0x29559f[_0xa4dd('0x2b')]['limit']);_0x4056fe[_0xa4dd('0x18')]=qs[_0xa4dd('0x18')](_0x29559f[_0xa4dd('0x2b')]['offset']);}return _0x5bce8e[_0xa4dd('0x4e')](_0x4056fe);}})[_0xa4dd('0x1e')](function(_0x21734f){if(_0x21734f){return _0x21734f?{'count':_0x9cfe16,'rows':_0x21734f}:null;}})['then'](respondWithResult(_0x32e2dc,null))[_0xa4dd('0x3a')](handleError(_0x32e2dc,null));};exports[_0xa4dd('0x52')]=function(_0x54f667,_0x2f8c68,_0x10deb4){var _0x1e2447={};var _0x5830b2={};var _0x5680be;var _0x2abbd9;return db[_0xa4dd('0x3d')][_0xa4dd('0x4f')]({'where':{'id':_0x54f667[_0xa4dd('0x3b')]['id']}})[_0xa4dd('0x1e')](handleEntityNotFound(_0x2f8c68,null))[_0xa4dd('0x1e')](function(_0x2f99cf){if(_0x2f99cf){_0x5680be=_0x2f99cf;_0x5830b2[_0xa4dd('0x2a')]=_[_0xa4dd('0x3c')](db[_0xa4dd('0x4b')][_0xa4dd('0x27')]);_0x5830b2[_0xa4dd('0x2b')]=_[_0xa4dd('0x3c')](_0x54f667[_0xa4dd('0x2b')]);_0x5830b2[_0xa4dd('0x2c')]=_[_0xa4dd('0x2d')](_0x5830b2[_0xa4dd('0x2a')],_0x5830b2[_0xa4dd('0x2b')]);_0x1e2447['attributes']=_[_0xa4dd('0x2d')](_0x5830b2[_0xa4dd('0x2a')],qs[_0xa4dd('0x2e')](_0x54f667['query']['fields']));_0x1e2447[_0xa4dd('0x2f')]=_0x1e2447[_0xa4dd('0x2f')][_0xa4dd('0x50')]?_0x1e2447[_0xa4dd('0x2f')]:_0x5830b2[_0xa4dd('0x2a')];_0x1e2447['order']=qs[_0xa4dd('0x33')](_0x54f667[_0xa4dd('0x2b')][_0xa4dd('0x33')]);_0x1e2447[_0xa4dd('0x36')]=qs[_0xa4dd('0x2c')](_[_0xa4dd('0x34')](_0x54f667[_0xa4dd('0x2b')],_0x5830b2[_0xa4dd('0x2c')]));if(_0x54f667['query'][_0xa4dd('0x51')]){_0x1e2447[_0xa4dd('0x36')]=_[_0xa4dd('0x35')](_0x1e2447[_0xa4dd('0x36')],{'$or':_[_0xa4dd('0x26')](_0x1e2447[_0xa4dd('0x2f')],function(_0x8df091){var _0x4a2bf7={};_0x4a2bf7[_0x8df091]={'$like':'%'+_0x54f667['query']['filter']+'%'};return _0x4a2bf7;})});}_0x1e2447=_[_0xa4dd('0x35')]({},_0x1e2447,_0x54f667[_0xa4dd('0x37')]);return _0x5680be[_0xa4dd('0x52')](_0x1e2447);}})[_0xa4dd('0x1e')](function(_0x2c0f57){if(_0x2c0f57){_0x2abbd9=_0x2c0f57[_0xa4dd('0x50')];if(!_0x54f667[_0xa4dd('0x2b')][_0xa4dd('0x30')](_0xa4dd('0x31'))){_0x1e2447[_0xa4dd('0x1a')]=qs[_0xa4dd('0x1a')](_0x54f667[_0xa4dd('0x2b')]['limit']);_0x1e2447[_0xa4dd('0x18')]=qs[_0xa4dd('0x18')](_0x54f667[_0xa4dd('0x2b')][_0xa4dd('0x18')]);}return _0x5680be[_0xa4dd('0x52')](_0x1e2447);}})['then'](function(_0x5b0e59){if(_0x5b0e59){return _0x5b0e59?{'count':_0x2abbd9,'rows':_0x5b0e59}:null;}})['then'](respondWithResult(_0x2f8c68,null))['catch'](handleError(_0x2f8c68,null));};exports[_0xa4dd('0x53')]=function(_0x2c8f50,_0x176426,_0x597506){if(_0x2c8f50[_0xa4dd('0x40')]['id']){delete _0x2c8f50[_0xa4dd('0x40')]['id'];}return db[_0xa4dd('0x3d')][_0xa4dd('0x3e')]({'where':{'id':_0x2c8f50[_0xa4dd('0x3b')]['id']}})[_0xa4dd('0x1e')](handleEntityNotFound(_0x176426,null))[_0xa4dd('0x1e')](function(_0xd653ea){if(_0xd653ea){_0x2c8f50[_0xa4dd('0x40')][_0xa4dd('0x54')]=_0xd653ea['id'];return db[_0xa4dd('0x55')][_0xa4dd('0x3f')](_0x2c8f50[_0xa4dd('0x40')]);}})[_0xa4dd('0x1e')](respondWithResult(_0x176426,null))[_0xa4dd('0x3a')](handleError(_0x176426,null));};exports[_0xa4dd('0x56')]=function(_0x89ef8,_0x137f6e,_0x945c6){var _0x5b0c6a={};var _0x4c13b1={};var _0x2544fa;var _0x5d3386;return db[_0xa4dd('0x3d')]['findOne']({'where':{'id':_0x89ef8[_0xa4dd('0x3b')]['id']}})[_0xa4dd('0x1e')](handleEntityNotFound(_0x137f6e,null))['then'](function(_0x3912bd){if(_0x3912bd){_0x2544fa=_0x3912bd;_0x4c13b1[_0xa4dd('0x2a')]=_['keys'](db['Action'][_0xa4dd('0x27')]);_0x4c13b1['query']=_[_0xa4dd('0x3c')](_0x89ef8[_0xa4dd('0x2b')]);_0x4c13b1[_0xa4dd('0x2c')]=_[_0xa4dd('0x2d')](_0x4c13b1[_0xa4dd('0x2a')],_0x4c13b1['query']);_0x5b0c6a[_0xa4dd('0x2f')]=_[_0xa4dd('0x2d')](_0x4c13b1['model'],qs[_0xa4dd('0x2e')](_0x89ef8[_0xa4dd('0x2b')]['fields']));_0x5b0c6a['attributes']=_0x5b0c6a['attributes'][_0xa4dd('0x50')]?_0x5b0c6a[_0xa4dd('0x2f')]:_0x4c13b1[_0xa4dd('0x2a')];_0x5b0c6a['order']=qs[_0xa4dd('0x33')](_0x89ef8[_0xa4dd('0x2b')][_0xa4dd('0x33')]);_0x5b0c6a[_0xa4dd('0x36')]=qs[_0xa4dd('0x2c')](_[_0xa4dd('0x34')](_0x89ef8[_0xa4dd('0x2b')],_0x4c13b1['filters']));if(_0x89ef8[_0xa4dd('0x2b')][_0xa4dd('0x51')]){_0x5b0c6a['where']=_[_0xa4dd('0x35')](_0x5b0c6a[_0xa4dd('0x36')],{'$or':_['map'](_0x5b0c6a[_0xa4dd('0x2f')],function(_0x3b8104){var _0x23d2b5={};_0x23d2b5[_0x3b8104]={'$like':'%'+_0x89ef8['query'][_0xa4dd('0x51')]+'%'};return _0x23d2b5;})});}_0x5b0c6a=_[_0xa4dd('0x35')]({},_0x5b0c6a,_0x89ef8[_0xa4dd('0x37')]);return _0x2544fa['getActions'](_0x5b0c6a);}})[_0xa4dd('0x1e')](function(_0x181d50){if(_0x181d50){_0x5d3386=_0x181d50[_0xa4dd('0x50')];if(!_0x89ef8[_0xa4dd('0x2b')][_0xa4dd('0x30')](_0xa4dd('0x31'))){_0x5b0c6a[_0xa4dd('0x1a')]=qs['limit'](_0x89ef8[_0xa4dd('0x2b')][_0xa4dd('0x1a')]);_0x5b0c6a[_0xa4dd('0x18')]=qs[_0xa4dd('0x18')](_0x89ef8[_0xa4dd('0x2b')][_0xa4dd('0x18')]);}return _0x2544fa[_0xa4dd('0x56')](_0x5b0c6a);}})['then'](function(_0x400a36){if(_0x400a36){return _0x400a36?{'count':_0x5d3386,'rows':_0x400a36}:null;}})['then'](respondWithResult(_0x137f6e,null))[_0xa4dd('0x3a')](handleError(_0x137f6e,null));};
\ No newline at end of file
+var _0x4fa7=['filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','Trigger','rows','show','params','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','TriggerAllId','Condition','TriggerAnyId','rawAttributes','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','map','type','key','query','keys'];(function(_0x5b3ec2,_0x570659){var _0x3e7391=function(_0x11a1f0){while(--_0x11a1f0){_0x5b3ec2['push'](_0x5b3ec2['shift']());}};_0x3e7391(++_0x570659);}(_0x4fa7,0x84));var _0x74fa=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x4fa7[_0x1ab180];return _0xfb2c2d;};'use strict';var emlformat=require(_0x74fa('0x0'));var rimraf=require(_0x74fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74fa('0x2'));var rp=require('request-promise');var moment=require(_0x74fa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74fa('0x4'));var util=require(_0x74fa('0x5'));var path=require(_0x74fa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74fa('0x7'));var fs=require('fs');var fs_extra=require(_0x74fa('0x8'));var _=require(_0x74fa('0x9'));var squel=require(_0x74fa('0xa'));var crypto=require(_0x74fa('0xb'));var jsforce=require(_0x74fa('0xc'));var deskjs=require(_0x74fa('0xd'));var toCsv=require(_0x74fa('0xe'));var querystring=require(_0x74fa('0xf'));var Papa=require(_0x74fa('0x10'));var Redis=require(_0x74fa('0x11'));var authService=require(_0x74fa('0x12'));var qs=require(_0x74fa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x74fa('0x14'));var utils=require(_0x74fa('0x15'));var config=require(_0x74fa('0x16'));var licenseUtil=require(_0x74fa('0x17'));var db=require(_0x74fa('0x18'))['db'];function respondWithStatusCode(_0x45689e,_0x163cbb){_0x163cbb=_0x163cbb||0xcc;return function(_0x183d99){if(_0x183d99){return _0x45689e[_0x74fa('0x19')](_0x163cbb);}return _0x45689e[_0x74fa('0x1a')](_0x163cbb)['end']();};}function respondWithResult(_0x1d64d7,_0x3aeaac){_0x3aeaac=_0x3aeaac||0xc8;return function(_0x5a204a){if(_0x5a204a){return _0x1d64d7[_0x74fa('0x1a')](_0x3aeaac)[_0x74fa('0x1b')](_0x5a204a);}};}function respondWithFilteredResult(_0x30f8ca,_0x42f0d7){return function(_0x3a513a){if(_0x3a513a){var _0x34595a=typeof _0x42f0d7[_0x74fa('0x1c')]===_0x74fa('0x1d')&&typeof _0x42f0d7[_0x74fa('0x1e')]==='undefined';var _0x11e291=_0x3a513a[_0x74fa('0x1f')];var _0x2ff97d=_0x34595a?0x0:_0x42f0d7[_0x74fa('0x1c')];var _0x5844ec=_0x34595a?_0x3a513a['count']:_0x42f0d7['offset']+_0x42f0d7[_0x74fa('0x1e')];var _0x278fdf;if(_0x5844ec>=_0x11e291){_0x5844ec=_0x11e291;_0x278fdf=0xc8;}else{_0x278fdf=0xce;}_0x30f8ca[_0x74fa('0x1a')](_0x278fdf);return _0x30f8ca['set']('Content-Range',_0x2ff97d+'-'+_0x5844ec+'/'+_0x11e291)[_0x74fa('0x1b')](_0x3a513a);}return null;};}function patchUpdates(_0x4d6497){return function(_0x4843f1){try{jsonpatch[_0x74fa('0x20')](_0x4843f1,_0x4d6497,!![]);}catch(_0x1fe502){return BPromise[_0x74fa('0x21')](_0x1fe502);}return _0x4843f1[_0x74fa('0x22')]();};}function saveUpdates(_0x48aa54,_0x2e06e4){return function(_0x2ba9b5){if(_0x2ba9b5){return _0x2ba9b5[_0x74fa('0x23')](_0x48aa54)[_0x74fa('0x24')](function(_0x139765){return _0x139765;});}return null;};}function removeEntity(_0x4a8756,_0x18da88){return function(_0x3927ea){if(_0x3927ea){return _0x3927ea[_0x74fa('0x25')]()[_0x74fa('0x24')](function(){var _0x686ea7=_0x3927ea[_0x74fa('0x26')]({'plain':!![]});var _0x42a65f=_0x74fa('0x27');return db[_0x74fa('0x28')][_0x74fa('0x25')]({'where':{'type':_0x42a65f,'resourceId':_0x686ea7['id']}})['then'](function(){return _0x3927ea;});})[_0x74fa('0x24')](function(){_0x4a8756[_0x74fa('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15dc61,_0x4eed49){return function(_0x5cec0f){if(!_0x5cec0f){_0x15dc61['sendStatus'](0x194);}return _0x5cec0f;};}function handleError(_0x447bb2,_0x3e1a65){_0x3e1a65=_0x3e1a65||0x1f4;return function(_0x40864b){logger[_0x74fa('0x29')](_0x40864b[_0x74fa('0x2a')]);if(_0x40864b[_0x74fa('0x2b')]){delete _0x40864b[_0x74fa('0x2b')];}_0x447bb2[_0x74fa('0x1a')](_0x3e1a65)[_0x74fa('0x2c')](_0x40864b);};}exports['index']=function(_0x534946,_0x4e0d74){var _0x59fc4b={},_0x1b6f03={},_0x554c84={'count':0x0,'rows':[]};var _0x292392=_[_0x74fa('0x2d')](db['Trigger']['rawAttributes'],function(_0x54da5d){return{'name':_0x54da5d['fieldName'],'type':_0x54da5d[_0x74fa('0x2e')][_0x74fa('0x2f')]};});_0x1b6f03['model']=_[_0x74fa('0x2d')](_0x292392,'name');_0x1b6f03[_0x74fa('0x30')]=_[_0x74fa('0x31')](_0x534946[_0x74fa('0x30')]);_0x1b6f03[_0x74fa('0x32')]=_['intersection'](_0x1b6f03[_0x74fa('0x33')],_0x1b6f03[_0x74fa('0x30')]);_0x59fc4b[_0x74fa('0x34')]=_[_0x74fa('0x35')](_0x1b6f03[_0x74fa('0x33')],qs['fields'](_0x534946['query'][_0x74fa('0x36')]));_0x59fc4b[_0x74fa('0x34')]=_0x59fc4b['attributes'][_0x74fa('0x37')]?_0x59fc4b[_0x74fa('0x34')]:_0x1b6f03['model'];if(!_0x534946[_0x74fa('0x30')][_0x74fa('0x38')](_0x74fa('0x39'))){_0x59fc4b[_0x74fa('0x1e')]=qs[_0x74fa('0x1e')](_0x534946[_0x74fa('0x30')]['limit']);_0x59fc4b[_0x74fa('0x1c')]=qs[_0x74fa('0x1c')](_0x534946[_0x74fa('0x30')]['offset']);}_0x59fc4b[_0x74fa('0x3a')]=qs[_0x74fa('0x3b')](_0x534946[_0x74fa('0x30')][_0x74fa('0x3b')]);_0x59fc4b[_0x74fa('0x3c')]=qs['filters'](_[_0x74fa('0x3d')](_0x534946['query'],_0x1b6f03['filters']),_0x292392);if(_0x534946[_0x74fa('0x30')][_0x74fa('0x3e')]){_0x59fc4b[_0x74fa('0x3c')]=_['merge'](_0x59fc4b[_0x74fa('0x3c')],{'$or':_[_0x74fa('0x2d')](_0x292392,function(_0x37424f){if(_0x37424f[_0x74fa('0x2e')]!==_0x74fa('0x3f')){var _0x5acd8b={};_0x5acd8b[_0x37424f[_0x74fa('0x2b')]]={'$like':'%'+_0x534946[_0x74fa('0x30')][_0x74fa('0x3e')]+'%'};return _0x5acd8b;}})});}_0x59fc4b=_[_0x74fa('0x40')]({},_0x59fc4b,_0x534946['options']);var _0x9e8073={'where':_0x59fc4b['where']};return db['Trigger'][_0x74fa('0x1f')](_0x9e8073)['then'](function(_0x5771ab){_0x554c84['count']=_0x5771ab;if(_0x534946['query'][_0x74fa('0x41')]){_0x59fc4b['include']=[{'all':!![]}];}return db[_0x74fa('0x42')]['findAll'](_0x59fc4b);})[_0x74fa('0x24')](function(_0x93ed71){_0x554c84[_0x74fa('0x43')]=_0x93ed71;return _0x554c84;})[_0x74fa('0x24')](respondWithFilteredResult(_0x4e0d74,_0x59fc4b))['catch'](handleError(_0x4e0d74,null));};exports[_0x74fa('0x44')]=function(_0x41e08c,_0x3e1ea1){var _0x1994c6={'raw':![],'where':{'id':_0x41e08c[_0x74fa('0x45')]['id']}},_0x9959b0={};_0x9959b0[_0x74fa('0x33')]=_[_0x74fa('0x31')](db['Trigger']['rawAttributes']);_0x9959b0['query']=_[_0x74fa('0x31')](_0x41e08c[_0x74fa('0x30')]);_0x9959b0['filters']=_['intersection'](_0x9959b0[_0x74fa('0x33')],_0x9959b0[_0x74fa('0x30')]);_0x1994c6[_0x74fa('0x34')]=_[_0x74fa('0x35')](_0x9959b0[_0x74fa('0x33')],qs['fields'](_0x41e08c[_0x74fa('0x30')][_0x74fa('0x36')]));_0x1994c6[_0x74fa('0x34')]=_0x1994c6[_0x74fa('0x34')][_0x74fa('0x37')]?_0x1994c6['attributes']:_0x9959b0['model'];if(_0x41e08c['query'][_0x74fa('0x41')]){_0x1994c6[_0x74fa('0x46')]=[{'all':!![]}];}_0x1994c6=_[_0x74fa('0x40')]({},_0x1994c6,_0x41e08c[_0x74fa('0x47')]);return db[_0x74fa('0x42')][_0x74fa('0x48')](_0x1994c6)[_0x74fa('0x24')](handleEntityNotFound(_0x3e1ea1,null))[_0x74fa('0x24')](respondWithResult(_0x3e1ea1,null))[_0x74fa('0x49')](handleError(_0x3e1ea1,null));};exports[_0x74fa('0x4a')]=function(_0x15ff2a,_0x555216){return db[_0x74fa('0x42')]['create'](_0x15ff2a[_0x74fa('0x4b')],{})[_0x74fa('0x24')](function(_0x925bad){var _0x919cab=_0x15ff2a[_0x74fa('0x4c')]['get']({'plain':!![]});if(!_0x919cab)throw new Error(_0x74fa('0x4d'));if(_0x919cab['role']==='user'){var _0x40bcf5=_0x925bad[_0x74fa('0x26')]({'plain':!![]});var _0x20f7d4=_0x74fa('0x27');return db[_0x74fa('0x4e')][_0x74fa('0x48')]({'where':{'name':_0x20f7d4,'userProfileId':_0x919cab[_0x74fa('0x4f')]},'raw':!![]})[_0x74fa('0x24')](function(_0x13176c){if(_0x13176c&&_0x13176c['autoAssociation']===0x0){return db[_0x74fa('0x28')][_0x74fa('0x4a')]({'name':_0x40bcf5[_0x74fa('0x2b')],'resourceId':_0x40bcf5['id'],'type':_0x13176c[_0x74fa('0x2b')],'sectionId':_0x13176c['id']},{})[_0x74fa('0x24')](function(){return _0x925bad;});}else{return _0x925bad;}})[_0x74fa('0x49')](function(_0x3bc948){logger[_0x74fa('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bc948);throw _0x3bc948;});}return _0x925bad;})[_0x74fa('0x24')](respondWithResult(_0x555216,0xc9))['catch'](handleError(_0x555216,null));};exports['update']=function(_0x4e8837,_0x53c334){if(_0x4e8837[_0x74fa('0x4b')]['id']){delete _0x4e8837[_0x74fa('0x4b')]['id'];}return db[_0x74fa('0x42')][_0x74fa('0x48')]({'where':{'id':_0x4e8837[_0x74fa('0x45')]['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x53c334,null))[_0x74fa('0x24')](saveUpdates(_0x4e8837['body'],null))['then'](respondWithResult(_0x53c334,null))[_0x74fa('0x49')](handleError(_0x53c334,null));};exports['destroy']=function(_0x81dd23,_0x4a87dd){return db['Trigger'][_0x74fa('0x48')]({'where':{'id':_0x81dd23['params']['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x4a87dd,null))[_0x74fa('0x24')](removeEntity(_0x4a87dd,null))[_0x74fa('0x49')](handleError(_0x4a87dd,null));};exports['addAllCondition']=function(_0x49d1c5,_0x46c11d,_0x3f7117){if(_0x49d1c5['body']['id']){delete _0x49d1c5[_0x74fa('0x4b')]['id'];}return db[_0x74fa('0x42')]['find']({'where':{'id':_0x49d1c5[_0x74fa('0x45')]['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x46c11d,null))[_0x74fa('0x24')](function(_0x428023){if(_0x428023){_0x49d1c5['body'][_0x74fa('0x50')]=_0x428023['id'];return db[_0x74fa('0x51')][_0x74fa('0x4a')](_0x49d1c5['body']);}})[_0x74fa('0x24')](respondWithResult(_0x46c11d,null))[_0x74fa('0x49')](handleError(_0x46c11d,null));};exports['addAnyCondition']=function(_0x560be6,_0x517247,_0x267325){if(_0x560be6[_0x74fa('0x4b')]['id']){delete _0x560be6[_0x74fa('0x4b')]['id'];}return db[_0x74fa('0x42')][_0x74fa('0x48')]({'where':{'id':_0x560be6[_0x74fa('0x45')]['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x517247,null))[_0x74fa('0x24')](function(_0x57b405){if(_0x57b405){_0x560be6['body'][_0x74fa('0x52')]=_0x57b405['id'];return db[_0x74fa('0x51')][_0x74fa('0x4a')](_0x560be6['body']);}})[_0x74fa('0x24')](respondWithResult(_0x517247,null))[_0x74fa('0x49')](handleError(_0x517247,null));};exports['getAllConditions']=function(_0x2e84f3,_0x529458,_0x48bc67){var _0x422523={};var _0x373413={};var _0x4659be;var _0x165231;return db['Trigger']['findOne']({'where':{'id':_0x2e84f3[_0x74fa('0x45')]['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x529458,null))[_0x74fa('0x24')](function(_0x5688a6){if(_0x5688a6){_0x4659be=_0x5688a6;_0x373413['model']=_[_0x74fa('0x31')](db[_0x74fa('0x51')][_0x74fa('0x53')]);_0x373413['query']=_[_0x74fa('0x31')](_0x2e84f3['query']);_0x373413[_0x74fa('0x32')]=_[_0x74fa('0x35')](_0x373413[_0x74fa('0x33')],_0x373413[_0x74fa('0x30')]);_0x422523[_0x74fa('0x34')]=_[_0x74fa('0x35')](_0x373413['model'],qs[_0x74fa('0x36')](_0x2e84f3[_0x74fa('0x30')][_0x74fa('0x36')]));_0x422523[_0x74fa('0x34')]=_0x422523[_0x74fa('0x34')][_0x74fa('0x37')]?_0x422523[_0x74fa('0x34')]:_0x373413[_0x74fa('0x33')];_0x422523[_0x74fa('0x3a')]=qs['sort'](_0x2e84f3[_0x74fa('0x30')][_0x74fa('0x3b')]);_0x422523['where']=qs['filters'](_['pick'](_0x2e84f3['query'],_0x373413[_0x74fa('0x32')]));if(_0x2e84f3['query']['filter']){_0x422523[_0x74fa('0x3c')]=_['merge'](_0x422523[_0x74fa('0x3c')],{'$or':_['map'](_0x422523[_0x74fa('0x34')],function(_0xe05ba4){var _0x573173={};_0x573173[_0xe05ba4]={'$like':'%'+_0x2e84f3['query']['filter']+'%'};return _0x573173;})});}_0x422523=_[_0x74fa('0x40')]({},_0x422523,_0x2e84f3['options']);return _0x4659be[_0x74fa('0x54')](_0x422523);}})['then'](function(_0x172f16){if(_0x172f16){_0x165231=_0x172f16[_0x74fa('0x37')];if(!_0x2e84f3[_0x74fa('0x30')][_0x74fa('0x38')](_0x74fa('0x39'))){_0x422523[_0x74fa('0x1e')]=qs[_0x74fa('0x1e')](_0x2e84f3[_0x74fa('0x30')][_0x74fa('0x1e')]);_0x422523[_0x74fa('0x1c')]=qs[_0x74fa('0x1c')](_0x2e84f3[_0x74fa('0x30')][_0x74fa('0x1c')]);}return _0x4659be[_0x74fa('0x54')](_0x422523);}})[_0x74fa('0x24')](function(_0x5e9f32){if(_0x5e9f32){return _0x5e9f32?{'count':_0x165231,'rows':_0x5e9f32}:null;}})[_0x74fa('0x24')](respondWithResult(_0x529458,null))[_0x74fa('0x49')](handleError(_0x529458,null));};exports[_0x74fa('0x55')]=function(_0x40544f,_0x4210ca,_0x3e3cfb){var _0x41254b={};var _0x40ddb9={};var _0x3d130d;var _0x16503a;return db[_0x74fa('0x42')][_0x74fa('0x56')]({'where':{'id':_0x40544f[_0x74fa('0x45')]['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x4210ca,null))['then'](function(_0x8cd457){if(_0x8cd457){_0x3d130d=_0x8cd457;_0x40ddb9['model']=_[_0x74fa('0x31')](db[_0x74fa('0x51')][_0x74fa('0x53')]);_0x40ddb9[_0x74fa('0x30')]=_['keys'](_0x40544f[_0x74fa('0x30')]);_0x40ddb9['filters']=_[_0x74fa('0x35')](_0x40ddb9[_0x74fa('0x33')],_0x40ddb9[_0x74fa('0x30')]);_0x41254b[_0x74fa('0x34')]=_[_0x74fa('0x35')](_0x40ddb9[_0x74fa('0x33')],qs[_0x74fa('0x36')](_0x40544f[_0x74fa('0x30')]['fields']));_0x41254b[_0x74fa('0x34')]=_0x41254b['attributes'][_0x74fa('0x37')]?_0x41254b[_0x74fa('0x34')]:_0x40ddb9[_0x74fa('0x33')];_0x41254b[_0x74fa('0x3a')]=qs[_0x74fa('0x3b')](_0x40544f['query']['sort']);_0x41254b[_0x74fa('0x3c')]=qs[_0x74fa('0x32')](_['pick'](_0x40544f['query'],_0x40ddb9[_0x74fa('0x32')]));if(_0x40544f[_0x74fa('0x30')][_0x74fa('0x3e')]){_0x41254b[_0x74fa('0x3c')]=_['merge'](_0x41254b['where'],{'$or':_[_0x74fa('0x2d')](_0x41254b['attributes'],function(_0x33d24b){var _0x3b73f9={};_0x3b73f9[_0x33d24b]={'$like':'%'+_0x40544f['query'][_0x74fa('0x3e')]+'%'};return _0x3b73f9;})});}_0x41254b=_[_0x74fa('0x40')]({},_0x41254b,_0x40544f[_0x74fa('0x47')]);return _0x3d130d[_0x74fa('0x55')](_0x41254b);}})[_0x74fa('0x24')](function(_0x391a5f){if(_0x391a5f){_0x16503a=_0x391a5f[_0x74fa('0x37')];if(!_0x40544f[_0x74fa('0x30')]['hasOwnProperty']('nolimit')){_0x41254b['limit']=qs[_0x74fa('0x1e')](_0x40544f[_0x74fa('0x30')][_0x74fa('0x1e')]);_0x41254b[_0x74fa('0x1c')]=qs[_0x74fa('0x1c')](_0x40544f[_0x74fa('0x30')]['offset']);}return _0x3d130d[_0x74fa('0x55')](_0x41254b);}})[_0x74fa('0x24')](function(_0x185191){if(_0x185191){return _0x185191?{'count':_0x16503a,'rows':_0x185191}:null;}})['then'](respondWithResult(_0x4210ca,null))['catch'](handleError(_0x4210ca,null));};exports[_0x74fa('0x57')]=function(_0x191756,_0x30b791,_0x432f31){if(_0x191756[_0x74fa('0x4b')]['id']){delete _0x191756[_0x74fa('0x4b')]['id'];}return db[_0x74fa('0x42')][_0x74fa('0x48')]({'where':{'id':_0x191756['params']['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x30b791,null))[_0x74fa('0x24')](function(_0x207339){if(_0x207339){_0x191756[_0x74fa('0x4b')][_0x74fa('0x58')]=_0x207339['id'];return db[_0x74fa('0x59')][_0x74fa('0x4a')](_0x191756[_0x74fa('0x4b')]);}})['then'](respondWithResult(_0x30b791,null))['catch'](handleError(_0x30b791,null));};exports[_0x74fa('0x5a')]=function(_0x5a57fb,_0x2d7f2e,_0x2a0316){var _0x27e305={};var _0x279106={};var _0x415d24;var _0x1a60f9;return db[_0x74fa('0x42')]['findOne']({'where':{'id':_0x5a57fb['params']['id']}})[_0x74fa('0x24')](handleEntityNotFound(_0x2d7f2e,null))[_0x74fa('0x24')](function(_0x43e816){if(_0x43e816){_0x415d24=_0x43e816;_0x279106[_0x74fa('0x33')]=_[_0x74fa('0x31')](db[_0x74fa('0x59')][_0x74fa('0x53')]);_0x279106['query']=_[_0x74fa('0x31')](_0x5a57fb['query']);_0x279106[_0x74fa('0x32')]=_[_0x74fa('0x35')](_0x279106[_0x74fa('0x33')],_0x279106['query']);_0x27e305[_0x74fa('0x34')]=_[_0x74fa('0x35')](_0x279106[_0x74fa('0x33')],qs[_0x74fa('0x36')](_0x5a57fb[_0x74fa('0x30')][_0x74fa('0x36')]));_0x27e305[_0x74fa('0x34')]=_0x27e305['attributes'][_0x74fa('0x37')]?_0x27e305['attributes']:_0x279106[_0x74fa('0x33')];_0x27e305[_0x74fa('0x3a')]=qs[_0x74fa('0x3b')](_0x5a57fb['query'][_0x74fa('0x3b')]);_0x27e305['where']=qs[_0x74fa('0x32')](_[_0x74fa('0x3d')](_0x5a57fb[_0x74fa('0x30')],_0x279106['filters']));if(_0x5a57fb[_0x74fa('0x30')][_0x74fa('0x3e')]){_0x27e305['where']=_[_0x74fa('0x40')](_0x27e305['where'],{'$or':_[_0x74fa('0x2d')](_0x27e305['attributes'],function(_0x38443f){var _0x433081={};_0x433081[_0x38443f]={'$like':'%'+_0x5a57fb[_0x74fa('0x30')][_0x74fa('0x3e')]+'%'};return _0x433081;})});}_0x27e305=_[_0x74fa('0x40')]({},_0x27e305,_0x5a57fb['options']);return _0x415d24[_0x74fa('0x5a')](_0x27e305);}})[_0x74fa('0x24')](function(_0x1cb4af){if(_0x1cb4af){_0x1a60f9=_0x1cb4af[_0x74fa('0x37')];if(!_0x5a57fb[_0x74fa('0x30')][_0x74fa('0x38')](_0x74fa('0x39'))){_0x27e305[_0x74fa('0x1e')]=qs[_0x74fa('0x1e')](_0x5a57fb[_0x74fa('0x30')][_0x74fa('0x1e')]);_0x27e305[_0x74fa('0x1c')]=qs[_0x74fa('0x1c')](_0x5a57fb[_0x74fa('0x30')]['offset']);}return _0x415d24['getActions'](_0x27e305);}})[_0x74fa('0x24')](function(_0x50180c){if(_0x50180c){return _0x50180c?{'count':_0x1a60f9,'rows':_0x50180c}:null;}})[_0x74fa('0x24')](respondWithResult(_0x2d7f2e,null))['catch'](handleError(_0x2d7f2e,null));};
\ No newline at end of file
index 57ce692..5cd6610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a52=['tools_triggers','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger'];(function(_0x42ef6e,_0x41db18){var _0x46d410=function(_0x39aa28){while(--_0x39aa28){_0x42ef6e['push'](_0x42ef6e['shift']());}};_0x46d410(++_0x41db18);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x25a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x25a5('0x1'));var BPromise=require(_0x25a5('0x2'));var rp=require(_0x25a5('0x3'));var fs=require('fs');var path=require(_0x25a5('0x4'));var rimraf=require(_0x25a5('0x5'));var config=require(_0x25a5('0x6'));var attributes=require(_0x25a5('0x7'));module[_0x25a5('0x8')]=function(_0x5db751,_0x2c210a){return _0x5db751['define'](_0x25a5('0x9'),attributes,{'tableName':_0x25a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x495e=['define','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x20bb45,_0x37fd70){var _0x5e71ec=function(_0xfa2948){while(--_0xfa2948){_0x20bb45['push'](_0x20bb45['shift']());}};_0x5e71ec(++_0x37fd70);}(_0x495e,0xfb));var _0xe495=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0x495e[_0x56608c];return _0x3c7fb0;};'use strict';var _=require(_0xe495('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe495('0x1'));var moment=require(_0xe495('0x2'));var BPromise=require(_0xe495('0x3'));var rp=require(_0xe495('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe495('0x5'));var config=require(_0xe495('0x6'));var attributes=require(_0xe495('0x7'));module[_0xe495('0x8')]=function(_0x130db3,_0x467a69){return _0x130db3[_0xe495('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a3b734..1519854 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x651e=['error','message','result','catch','GetTrigger','Trigger','options','raw','where','limit','include','model','attributes','map','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0x651e,0xf4));var _0xe651=function(_0x3a206c,_0x8d455e){_0x3a206c=_0x3a206c-0x0;var _0x4c2f22=_0x651e[_0x3a206c];return _0x4c2f22;};'use strict';var _=require(_0xe651('0x0'));var util=require(_0xe651('0x1'));var moment=require(_0xe651('0x2'));var BPromise=require(_0xe651('0x3'));var rs=require(_0xe651('0x4'));var fs=require('fs');var Redis=require(_0xe651('0x5'));var db=require(_0xe651('0x6'))['db'];var utils=require(_0xe651('0x7'));var logger=require(_0xe651('0x8'))(_0xe651('0x9'));var config=require(_0xe651('0xa'));var jayson=require(_0xe651('0xb'));var client=jayson[_0xe651('0xc')][_0xe651('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c0fa1,_0x439ac8,_0x3cd76a){return new BPromise(function(_0x232451,_0x20c51d){return client[_0xe651('0xe')](_0x3c0fa1,_0x3cd76a)[_0xe651('0xf')](function(_0x3a7afe){logger[_0xe651('0x10')](_0xe651('0x11'),_0x439ac8,'request\x20sent');logger[_0xe651('0x12')](_0xe651('0x13'),_0x439ac8,_0xe651('0x14'),JSON[_0xe651('0x15')](_0x3a7afe));if(_0x3a7afe['error']){if(_0x3a7afe[_0xe651('0x16')]['code']===0x1f4){logger[_0xe651('0x16')]('Trigger,\x20%s,\x20%s',_0x439ac8,_0x3a7afe[_0xe651('0x16')][_0xe651('0x17')]);return _0x20c51d(_0x3a7afe[_0xe651('0x16')][_0xe651('0x17')]);}logger[_0xe651('0x16')](_0xe651('0x11'),_0x439ac8,_0x3a7afe[_0xe651('0x16')][_0xe651('0x17')]);return _0x232451(_0x3a7afe[_0xe651('0x16')]['message']);}else{logger[_0xe651('0x10')]('Trigger,\x20%s,\x20%s',_0x439ac8,_0xe651('0x14'));_0x232451(_0x3a7afe[_0xe651('0x18')]['message']);}})[_0xe651('0x19')](function(_0x34ee98){logger['error'](_0xe651('0x11'),_0x439ac8,_0x34ee98);_0x20c51d(_0x34ee98);});});}exports[_0xe651('0x1a')]=function(_0x311efc){var _0xdee56f=this;return new Promise(function(_0x26fa34,_0x58140f){return db[_0xe651('0x1b')]['findAll']({'raw':_0x311efc[_0xe651('0x1c')]?_0x311efc[_0xe651('0x1c')][_0xe651('0x1d')]===undefined?!![]:![]:!![],'where':_0x311efc[_0xe651('0x1c')]?_0x311efc['options'][_0xe651('0x1e')]||null:null,'attributes':_0x311efc[_0xe651('0x1c')]?_0x311efc['options']['attributes']||null:null,'limit':_0x311efc[_0xe651('0x1c')]?_0x311efc[_0xe651('0x1c')][_0xe651('0x1f')]||null:null,'include':_0x311efc[_0xe651('0x1c')]?_0x311efc['options'][_0xe651('0x20')]?_['map'](_0x311efc[_0xe651('0x1c')][_0xe651('0x20')],function(_0x482a28){return{'model':db[_0x482a28[_0xe651('0x21')]],'as':_0x482a28['as'],'attributes':_0x482a28[_0xe651('0x22')],'include':_0x482a28[_0xe651('0x20')]?_[_0xe651('0x23')](_0x482a28[_0xe651('0x20')],function(_0x269411){return{'model':db[_0x269411[_0xe651('0x21')]],'as':_0x269411['as'],'attributes':_0x269411[_0xe651('0x22')],'include':_0x269411[_0xe651('0x20')]?_[_0xe651('0x23')](_0x269411[_0xe651('0x20')],function(_0x271881){return{'model':db[_0x271881[_0xe651('0x21')]],'as':_0x271881['as'],'attributes':_0x271881[_0xe651('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe651('0xf')](function(_0x5d31e7){logger[_0xe651('0x10')](_0xe651('0x1a'),_0x311efc);logger[_0xe651('0x12')]('GetTrigger',_0x311efc,JSON[_0xe651('0x15')](_0x5d31e7));_0x26fa34(_0x5d31e7);})[_0xe651('0x19')](function(_0xb194b6){logger['error'](_0xe651('0x1a'),_0xb194b6[_0xe651('0x17')],_0x311efc);_0x58140f(_0xdee56f[_0xe651('0x16')](0x1f4,_0xb194b6[_0xe651('0x17')]));});});};exports[_0xe651('0x24')]=function(_0x3f2f58){var _0x54a686=this;return new Promise(function(_0x15dc37,_0x594bf2){return db[_0xe651('0x1b')][_0xe651('0x25')]({'raw':_0x3f2f58['options']?_0x3f2f58[_0xe651('0x1c')][_0xe651('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f2f58[_0xe651('0x1c')]?_0x3f2f58[_0xe651('0x1c')][_0xe651('0x1e')]||null:null,'attributes':_0x3f2f58[_0xe651('0x1c')]?_0x3f2f58['options'][_0xe651('0x22')]||null:null,'include':_0x3f2f58[_0xe651('0x1c')]?_0x3f2f58[_0xe651('0x1c')][_0xe651('0x20')]?_[_0xe651('0x23')](_0x3f2f58[_0xe651('0x1c')]['include'],function(_0x22cede){return{'model':db[_0x22cede[_0xe651('0x21')]],'as':_0x22cede['as'],'attributes':_0x22cede[_0xe651('0x22')],'include':_0x22cede[_0xe651('0x20')]?_['map'](_0x22cede[_0xe651('0x20')],function(_0x2f569e){return{'model':db[_0x2f569e[_0xe651('0x21')]],'as':_0x2f569e['as'],'attributes':_0x2f569e[_0xe651('0x22')],'include':_0x2f569e[_0xe651('0x20')]?_[_0xe651('0x23')](_0x2f569e[_0xe651('0x20')],function(_0x3258c4){return{'model':db[_0x3258c4[_0xe651('0x21')]],'as':_0x3258c4['as'],'attributes':_0x3258c4[_0xe651('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39d518){logger[_0xe651('0x10')]('ShowTrigger',_0x3f2f58);logger[_0xe651('0x12')](_0xe651('0x24'),_0x3f2f58,JSON[_0xe651('0x15')](_0x39d518));_0x15dc37(_0x39d518);})[_0xe651('0x19')](function(_0x374c6d){logger[_0xe651('0x16')](_0xe651('0x24'),_0x374c6d['message'],_0x3f2f58);_0x594bf2(_0x54a686[_0xe651('0x16')](0x1f4,_0x374c6d[_0xe651('0x17')]));});});};
\ No newline at end of file
+var _0x4d2f=['where','attributes','limit','include','map','model','then','ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetTrigger','Trigger','options'];(function(_0x58cf3f,_0x3d53e1){var _0x3a0ad3=function(_0x2c007f){while(--_0x2c007f){_0x58cf3f['push'](_0x58cf3f['shift']());}};_0x3a0ad3(++_0x3d53e1);}(_0x4d2f,0x69));var _0xf4d2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4d2f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xf4d2('0x0'));var moment=require(_0xf4d2('0x1'));var BPromise=require(_0xf4d2('0x2'));var rs=require(_0xf4d2('0x3'));var fs=require('fs');var Redis=require(_0xf4d2('0x4'));var db=require(_0xf4d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4d2('0x6'))(_0xf4d2('0x7'));var config=require(_0xf4d2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf4d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262a6f,_0x4a7f6f,_0x57d6ec){return new BPromise(function(_0x1f0631,_0x3f3fa8){return client[_0xf4d2('0xa')](_0x262a6f,_0x57d6ec)['then'](function(_0x2800b5){logger[_0xf4d2('0xb')](_0xf4d2('0xc'),_0x4a7f6f,_0xf4d2('0xd'));logger[_0xf4d2('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4a7f6f,'request\x20sent',JSON[_0xf4d2('0xf')](_0x2800b5));if(_0x2800b5['error']){if(_0x2800b5[_0xf4d2('0x10')][_0xf4d2('0x11')]===0x1f4){logger[_0xf4d2('0x10')](_0xf4d2('0xc'),_0x4a7f6f,_0x2800b5[_0xf4d2('0x10')][_0xf4d2('0x12')]);return _0x3f3fa8(_0x2800b5[_0xf4d2('0x10')]['message']);}logger[_0xf4d2('0x10')](_0xf4d2('0xc'),_0x4a7f6f,_0x2800b5['error'][_0xf4d2('0x12')]);return _0x1f0631(_0x2800b5[_0xf4d2('0x10')][_0xf4d2('0x12')]);}else{logger[_0xf4d2('0xb')](_0xf4d2('0xc'),_0x4a7f6f,_0xf4d2('0xd'));_0x1f0631(_0x2800b5['result'][_0xf4d2('0x12')]);}})[_0xf4d2('0x13')](function(_0x401ae1){logger['error']('Trigger,\x20%s,\x20%s',_0x4a7f6f,_0x401ae1);_0x3f3fa8(_0x401ae1);});});}exports[_0xf4d2('0x14')]=function(_0x433c5f){var _0x158191=this;return new Promise(function(_0x4b7ece,_0x71d711){return db[_0xf4d2('0x15')]['findAll']({'raw':_0x433c5f['options']?_0x433c5f[_0xf4d2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x433c5f['options']?_0x433c5f['options'][_0xf4d2('0x17')]||null:null,'attributes':_0x433c5f[_0xf4d2('0x16')]?_0x433c5f[_0xf4d2('0x16')][_0xf4d2('0x18')]||null:null,'limit':_0x433c5f[_0xf4d2('0x16')]?_0x433c5f[_0xf4d2('0x16')][_0xf4d2('0x19')]||null:null,'include':_0x433c5f['options']?_0x433c5f[_0xf4d2('0x16')][_0xf4d2('0x1a')]?_[_0xf4d2('0x1b')](_0x433c5f[_0xf4d2('0x16')][_0xf4d2('0x1a')],function(_0x5ac775){return{'model':db[_0x5ac775['model']],'as':_0x5ac775['as'],'attributes':_0x5ac775['attributes'],'include':_0x5ac775[_0xf4d2('0x1a')]?_[_0xf4d2('0x1b')](_0x5ac775[_0xf4d2('0x1a')],function(_0xe216a0){return{'model':db[_0xe216a0[_0xf4d2('0x1c')]],'as':_0xe216a0['as'],'attributes':_0xe216a0[_0xf4d2('0x18')],'include':_0xe216a0[_0xf4d2('0x1a')]?_[_0xf4d2('0x1b')](_0xe216a0[_0xf4d2('0x1a')],function(_0x20a1d5){return{'model':db[_0x20a1d5[_0xf4d2('0x1c')]],'as':_0x20a1d5['as'],'attributes':_0x20a1d5[_0xf4d2('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf4d2('0x1d')](function(_0x4fe1de){logger['info'](_0xf4d2('0x14'),_0x433c5f);logger[_0xf4d2('0xe')](_0xf4d2('0x14'),_0x433c5f,JSON[_0xf4d2('0xf')](_0x4fe1de));_0x4b7ece(_0x4fe1de);})[_0xf4d2('0x13')](function(_0x1968c8){logger[_0xf4d2('0x10')]('GetTrigger',_0x1968c8[_0xf4d2('0x12')],_0x433c5f);_0x71d711(_0x158191[_0xf4d2('0x10')](0x1f4,_0x1968c8['message']));});});};exports[_0xf4d2('0x1e')]=function(_0x29f773){var _0x1ab76b=this;return new Promise(function(_0x464793,_0x41e609){return db['Trigger'][_0xf4d2('0x1f')]({'raw':_0x29f773[_0xf4d2('0x16')]?_0x29f773[_0xf4d2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x29f773[_0xf4d2('0x16')]?_0x29f773[_0xf4d2('0x16')][_0xf4d2('0x17')]||null:null,'attributes':_0x29f773['options']?_0x29f773[_0xf4d2('0x16')][_0xf4d2('0x18')]||null:null,'include':_0x29f773[_0xf4d2('0x16')]?_0x29f773[_0xf4d2('0x16')][_0xf4d2('0x1a')]?_[_0xf4d2('0x1b')](_0x29f773['options'][_0xf4d2('0x1a')],function(_0x29bd20){return{'model':db[_0x29bd20[_0xf4d2('0x1c')]],'as':_0x29bd20['as'],'attributes':_0x29bd20['attributes'],'include':_0x29bd20[_0xf4d2('0x1a')]?_[_0xf4d2('0x1b')](_0x29bd20[_0xf4d2('0x1a')],function(_0x3c2dd9){return{'model':db[_0x3c2dd9[_0xf4d2('0x1c')]],'as':_0x3c2dd9['as'],'attributes':_0x3c2dd9[_0xf4d2('0x18')],'include':_0x3c2dd9[_0xf4d2('0x1a')]?_[_0xf4d2('0x1b')](_0x3c2dd9[_0xf4d2('0x1a')],function(_0xb905bb){return{'model':db[_0xb905bb['model']],'as':_0xb905bb['as'],'attributes':_0xb905bb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf4d2('0x1d')](function(_0x4fafd9){logger['info'](_0xf4d2('0x1e'),_0x29f773);logger[_0xf4d2('0xe')]('ShowTrigger',_0x29f773,JSON[_0xf4d2('0xf')](_0x4fafd9));_0x464793(_0x4fafd9);})[_0xf4d2('0x13')](function(_0x2af4e3){logger[_0xf4d2('0x10')](_0xf4d2('0x1e'),_0x2af4e3[_0xf4d2('0x12')],_0x29f773);_0x41e609(_0x1ab76b[_0xf4d2('0x10')](0x1f4,_0x2af4e3[_0xf4d2('0x12')]));});});};
\ No newline at end of file
index e5881d0..77a6e5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd73d=['./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x12c0d9,_0xb03e47){var _0x41761c=function(_0x3dc331){while(--_0x3dc331){_0x12c0d9['push'](_0x12c0d9['shift']());}};_0x41761c(++_0xb03e47);}(_0xd73d,0x1ef));var _0xdd73=function(_0x496bb7,_0x32b9fa){_0x496bb7=_0x496bb7-0x0;var _0x589721=_0xd73d[_0x496bb7];return _0x589721;};'use strict';var multer=require(_0xdd73('0x0'));var util=require(_0xdd73('0x1'));var path=require(_0xdd73('0x2'));var timeout=require(_0xdd73('0x3'));var express=require(_0xdd73('0x4'));var router=express[_0xdd73('0x5')]();var fs_extra=require(_0xdd73('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdd73('0x7'));var config=require(_0xdd73('0x8'));var controller=require(_0xdd73('0x9'));router[_0xdd73('0xa')]('/',auth[_0xdd73('0xb')](),controller[_0xdd73('0xc')]);router['get'](_0xdd73('0xd'),auth[_0xdd73('0xb')](),controller['show']);router[_0xdd73('0xe')](_0xdd73('0xf'),auth['isAuthenticated'](),controller[_0xdd73('0x10')]);router['post']('/',auth[_0xdd73('0xb')](),controller['create']);router['put']('/:id',auth[_0xdd73('0xb')](),controller[_0xdd73('0x11')]);router[_0xdd73('0x12')](_0xdd73('0xd'),auth[_0xdd73('0xb')](),controller[_0xdd73('0x13')]);module[_0xdd73('0x14')]=router;
\ No newline at end of file
+var _0x97ea=['exports','path','connect-timeout','express','Router','fs-extra','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','put','update'];(function(_0x1e5294,_0x2286b5){var _0xb08a81=function(_0x3e5795){while(--_0x3e5795){_0x1e5294['push'](_0x1e5294['shift']());}};_0xb08a81(++_0x2286b5);}(_0x97ea,0xc1));var _0xa97e=function(_0x56be61,_0x51f50c){_0x56be61=_0x56be61-0x0;var _0x335de5=_0x97ea[_0x56be61];return _0x335de5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa97e('0x0'));var timeout=require(_0xa97e('0x1'));var express=require(_0xa97e('0x2'));var router=express[_0xa97e('0x3')]();var fs_extra=require(_0xa97e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa97e('0x5'));router[_0xa97e('0x6')]('/',auth[_0xa97e('0x7')](),controller[_0xa97e('0x8')]);router['get'](_0xa97e('0x9'),auth[_0xa97e('0x7')](),controller[_0xa97e('0xa')]);router['post'](_0xa97e('0xb'),auth[_0xa97e('0x7')](),controller[_0xa97e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa97e('0xd')]('/:id',auth[_0xa97e('0x7')](),controller[_0xa97e('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa97e('0xf')]=router;
\ No newline at end of file
index 4f05b0b..c73236e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa73a=['join','getDataValue','transport','split','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','dynamic','nonat','exports','STRING','name','ENUM','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xa73a,0x82));var _0xaa73=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0xa73a[_0x1f5887];return _0x21774b;};'use strict';var Sequelize=require('sequelize');module[_0xaa73('0x0')]={'name':{'type':Sequelize[_0xaa73('0x1')],'allowNull':![],'unique':_0xaa73('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x4'),'user','peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xaa73('0x1')],'allowNull':![],'defaultValue':_0xaa73('0x5')},'callingpres':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x6'),_0xaa73('0x7'),_0xaa73('0x8'),_0xaa73('0x9'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xaa73('0xa'),_0xaa73('0xb'))},'deny':{'type':Sequelize[_0xaa73('0x1')]},'permit':{'type':Sequelize[_0xaa73('0x1')]},'secret':{'type':Sequelize[_0xaa73('0x1')]},'md5secret':{'type':Sequelize[_0xaa73('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xaa73('0xc'),'set':function(_0x4b583b){this[_0xaa73('0xd')]('transport',_0x4b583b?_0x4b583b[_0xaa73('0xe')](','):null);},'get':function(){return this[_0xaa73('0xf')](_0xaa73('0x10'))?this[_0xaa73('0xf')](_0xaa73('0x10'))[_0xaa73('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x12'),_0xaa73('0x13'),_0xaa73('0x14'),_0xaa73('0x15'),_0xaa73('0x16')),'defaultValue':_0xaa73('0x12')},'directmedia':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no','nonat',_0xaa73('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xaa73('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xaa73('0x19'),'set':function(_0x5cc83b){this[_0xaa73('0xd')](_0xaa73('0x1a'),_0x5cc83b?_0x5cc83b['join'](','):null);},'get':function(){return this[_0xaa73('0xf')](_0xaa73('0x1a'))?this[_0xaa73('0xf')](_0xaa73('0x1a'))[_0xaa73('0x11')](','):null;},'comment':_0xaa73('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xaa73('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xaa73('0x1')]},'language':{'type':Sequelize[_0xaa73('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xaa73('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xaa73('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaa73('0x1c'),'set':function(_0x3ea2b4){this[_0xaa73('0xd')](_0xaa73('0x1d'),_0x3ea2b4?_0x3ea2b4[_0xaa73('0xe')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xaa73('0xf')](_0xaa73('0x1d'))?this[_0xaa73('0xf')]('allow')[_0xaa73('0x11')](';'):null;},'comment':_0xaa73('0x1e')},'autoframing':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'insecure':{'type':Sequelize[_0xaa73('0x1')],'defaultValue':_0xaa73('0x1f'),'set':function(_0x1ed112){this[_0xaa73('0xd')]('insecure',_0x1ed112?_0x1ed112['join'](','):null);},'get':function(){return this['getDataValue'](_0xaa73('0x20'))?this['getDataValue']('insecure')['split'](','):null;},'comment':_0xaa73('0x21')},'trustrpid':{'type':Sequelize[_0xaa73('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no',_0xaa73('0x22'))},'promiscredir':{'type':Sequelize[_0xaa73('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0xaa73('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0xaa73('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xaa73('0x24')},'amaflags':{'type':Sequelize[_0xaa73('0x1')]},'callcounter':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xaa73('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0xaa73('0x17'),'no',_0xaa73('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xaa73('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'mailbox':{'type':Sequelize[_0xaa73('0x1')]},'session_timers':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x26'),_0xaa73('0x27'),_0xaa73('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x29'),_0xaa73('0x2a')),'defaultValue':_0xaa73('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xaa73('0x1')]},'regexten':{'type':Sequelize[_0xaa73('0x1')]},'fromdomain':{'type':Sequelize[_0xaa73('0x1')]},'fromuser':{'type':Sequelize[_0xaa73('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no'),'defaultValue':_0xaa73('0x17')},'keepalive':{'type':Sequelize[_0xaa73('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xaa73('0x1')]},'defaultuser':{'type':Sequelize[_0xaa73('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xaa73('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xaa73('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xaa73('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xaa73('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xaa73('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xaa73('0x1')]},'maxforwards':{'type':Sequelize[_0xaa73('0x23')](0xb)},'encryption':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xaa73('0x17'),'no')},'force_avp':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'icesupport':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xaa73('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no','fingerprint',_0xaa73('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xaa73('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xaa73('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xaa73('0x1')]},'dtlscipher':{'type':Sequelize[_0xaa73('0x1')]},'dtlscafile':{'type':Sequelize[_0xaa73('0x1')]},'dtlscapath':{'type':Sequelize[_0xaa73('0x1')]},'dtlssetup':{'type':Sequelize[_0xaa73('0x3')]('active',_0xaa73('0x2c'),_0xaa73('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xaa73('0x1')]},'usereqphone':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xaa73('0x1')]},'recordofffeature':{'type':Sequelize[_0xaa73('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xaa73('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no')},'vmexten':{'type':Sequelize[_0xaa73('0x1')]},'mohinterpret':{'type':Sequelize[_0xaa73('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xaa73('0x1')]},'description':{'type':Sequelize[_0xaa73('0x1')]},'host':{'type':Sequelize[_0xaa73('0x1')],'defaultValue':_0xaa73('0x2e')},'canreinvite':{'type':Sequelize[_0xaa73('0x3')](_0xaa73('0x17'),'no',_0xaa73('0x2f'),_0xaa73('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xaa73('0x1')]},'otherFields':{'type':Sequelize[_0xaa73('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0x0b04=['shortinfo','inband','yes','outgoing','setDataValue','nat','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uas','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x4932f9,_0x3ae1fe){var _0x4d6bdf=function(_0x2bcd36){while(--_0x2bcd36){_0x4932f9['push'](_0x4932f9['shift']());}};_0x4d6bdf(++_0x3ae1fe);}(_0x0b04,0x1a3));var _0x40b0=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x0b04[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0x40b0('0x0'));module['exports']={'name':{'type':Sequelize[_0x40b0('0x1')],'allowNull':![],'unique':_0x40b0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x40b0('0x3'),_0x40b0('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x40b0('0x1')],'allowNull':![],'defaultValue':_0x40b0('0x5')},'callingpres':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x7'),'ALLOWED_PASSED_SCREEN',_0x40b0('0x8'),_0x40b0('0x9'),_0x40b0('0xa'),_0x40b0('0xb'),_0x40b0('0xc'),_0x40b0('0xd'))},'deny':{'type':Sequelize[_0x40b0('0x1')]},'permit':{'type':Sequelize[_0x40b0('0x1')]},'secret':{'type':Sequelize[_0x40b0('0x1')]},'md5secret':{'type':Sequelize[_0x40b0('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x40b0('0xe'),'set':function(_0x3c1f59){this['setDataValue'](_0x40b0('0xf'),_0x3c1f59?_0x3c1f59[_0x40b0('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x40b0('0xf'))?this[_0x40b0('0x11')](_0x40b0('0xf'))[_0x40b0('0x12')](','):null;},'comment':_0x40b0('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x40b0('0x14'),_0x40b0('0x15'),_0x40b0('0x16'),_0x40b0('0x17'),'auto'),'defaultValue':_0x40b0('0x14')},'directmedia':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no','nonat','update',_0x40b0('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x40b0('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x40b0('0x1')]},'directmediadeny':{'type':Sequelize[_0x40b0('0x1')]},'nat':{'type':Sequelize[_0x40b0('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x315880){this[_0x40b0('0x1a')](_0x40b0('0x1b'),_0x315880?_0x315880['join'](','):null);},'get':function(){return this[_0x40b0('0x11')](_0x40b0('0x1b'))?this[_0x40b0('0x11')](_0x40b0('0x1b'))[_0x40b0('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x40b0('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x40b0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x40b0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x40b0('0x1')],'defaultValue':_0x40b0('0x1c')},'allow':{'type':Sequelize[_0x40b0('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xa599){this[_0x40b0('0x1a')](_0x40b0('0x1d'),_0xa599?_0xa599[_0x40b0('0x10')](';'):_0x40b0('0x1e'));},'get':function(){return this[_0x40b0('0x11')](_0x40b0('0x1d'))?this[_0x40b0('0x11')](_0x40b0('0x1d'))['split'](';'):null;},'comment':_0x40b0('0x1f')},'autoframing':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'insecure':{'type':Sequelize[_0x40b0('0x1')],'defaultValue':_0x40b0('0x20'),'set':function(_0x22c88b){this[_0x40b0('0x1a')](_0x40b0('0x21'),_0x22c88b?_0x22c88b[_0x40b0('0x10')](','):null);},'get':function(){return this[_0x40b0('0x11')](_0x40b0('0x21'))?this[_0x40b0('0x11')](_0x40b0('0x21'))[_0x40b0('0x12')](','):null;},'comment':_0x40b0('0x22')},'trustrpid':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x40b0('0x23'))},'promiscredir':{'type':Sequelize['ENUM'](_0x40b0('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'accountcode':{'type':Sequelize[_0x40b0('0x24')](0xb)},'setvar':{'type':Sequelize[_0x40b0('0x1')]},'callerid':{'type':Sequelize[_0x40b0('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x40b0('0x1')]},'callcounter':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no'),'defaultValue':_0x40b0('0x18')},'busylevel':{'type':Sequelize[_0x40b0('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x40b0('0x6')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x40b0('0x1')]},'template':{'type':Sequelize[_0x40b0('0x1')]},'videosupport':{'type':Sequelize[_0x40b0('0x6')]('yes','no',_0x40b0('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x40b0('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'mailbox':{'type':Sequelize[_0x40b0('0x1')]},'session_timers':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x26'),_0x40b0('0x27'),_0x40b0('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x40b0('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'defaultValue':_0x40b0('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x40b0('0x1')]},'regexten':{'type':Sequelize[_0x40b0('0x1')]},'fromdomain':{'type':Sequelize[_0x40b0('0x1')]},'fromuser':{'type':Sequelize[_0x40b0('0x1')]},'port':{'type':Sequelize[_0x40b0('0x24')](0x5)},'qualify':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no'),'defaultValue':_0x40b0('0x18')},'keepalive':{'type':Sequelize[_0x40b0('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x40b0('0x1')]},'defaultuser':{'type':Sequelize[_0x40b0('0x1')]},'rtptimeout':{'type':Sequelize[_0x40b0('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x40b0('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x40b0('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x40b0('0x24')](0xb)},'timerb':{'type':Sequelize[_0x40b0('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x40b0('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x40b0('0x1')]},'contactdeny':{'type':Sequelize[_0x40b0('0x1')]},'contactacl':{'type':Sequelize[_0x40b0('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x40b0('0x1')]},'use_q850_reason':{'type':Sequelize[_0x40b0('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x40b0('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'icesupport':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x40b0('0x6')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no','fingerprint',_0x40b0('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x40b0('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x40b0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x40b0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x40b0('0x1')]},'dtlscapath':{'type':Sequelize[_0x40b0('0x1')]},'dtlssetup':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x2b'),_0x40b0('0x2c'),_0x40b0('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x40b0('0x1')]},'recordofffeature':{'type':Sequelize[_0x40b0('0x1')]},'call_limit':{'type':Sequelize[_0x40b0('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x40b0('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x40b0('0x1')]},'mohsuggest':{'type':Sequelize[_0x40b0('0x1')]},'parkinglot':{'type':Sequelize[_0x40b0('0x1')]},'description':{'type':Sequelize[_0x40b0('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x40b0('0x2e')},'canreinvite':{'type':Sequelize[_0x40b0('0x6')](_0x40b0('0x18'),'no','nonat','update',_0x40b0('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x40b0('0x1')]},'otherFields':{'type':Sequelize[_0x40b0('0x1')]},'active':{'type':Sequelize[_0x40b0('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x40b0('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index 3aa1a2e..e375c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x4f3ae5,_0x315091){var _0x30c3d2=function(_0x4d18ba){while(--_0x4d18ba){_0x4f3ae5['push'](_0x4f3ae5['shift']());}};_0x30c3d2(++_0x315091);}(_0x3e74,0x175));var _0x43e7=function(_0x3add03,_0x53d1e1){_0x3add03=_0x3add03-0x0;var _0x5e2160=_0x3e74[_0x3add03];return _0x5e2160;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));};
\ No newline at end of file
+var _0x8ef6=['userProfileId','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','options','Trunk','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','clone','omit','createdAt','updatedAt','create','body','get','role','UserProfileSection'];(function(_0x5692b4,_0x4f6c6a){var _0x315e47=function(_0x54f1da){while(--_0x54f1da){_0x5692b4['push'](_0x5692b4['shift']());}};_0x315e47(++_0x4f6c6a);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3840db,_0x4e91fe){_0x3840db=_0x3840db-0x0;var _0x40ec44=_0x8ef6[_0x3840db];return _0x40ec44;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];var jayson=require(_0x68ef('0x1b'));var client=jayson[_0x68ef('0x1c')][_0x68ef('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x288cc9,_0x508671,_0x3b48dd,_0xc50cce){return new BPromise(function(_0x2657c5,_0x47fbb5){var _0x22fe96=_0xc50cce||client;return _0x22fe96[_0x68ef('0x1e')](_0x288cc9,_0x3b48dd)[_0x68ef('0x1f')](function(_0x5005ba){logger[_0x68ef('0x20')](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));logger[_0x68ef('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x508671,_0x68ef('0x22'),JSON['stringify'](_0x5005ba));if(_0x5005ba['error']){if(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x25')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x508671,_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);return _0x47fbb5(_0x5005ba[_0x68ef('0x24')]['message']);}logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x5005ba[_0x68ef('0x24')]['message']);return _0x2657c5(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);}else{logger['info'](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));_0x2657c5(_0x5005ba[_0x68ef('0x27')]['message']);}})['catch'](function(_0x59bebc){logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x59bebc);_0x47fbb5(_0x59bebc);});});}function respondWithStatusCode(_0x312cc9,_0x2e6e39){_0x2e6e39=_0x2e6e39||0xcc;return function(_0x438b4c){if(_0x438b4c){return _0x312cc9[_0x68ef('0x28')](_0x2e6e39);}return _0x312cc9[_0x68ef('0x29')](_0x2e6e39)[_0x68ef('0x2a')]();};}function respondWithResult(_0x65fd09,_0x13280b){_0x13280b=_0x13280b||0xc8;return function(_0x5e4dbe){if(_0x5e4dbe){return _0x65fd09[_0x68ef('0x29')](_0x13280b)['json'](_0x5e4dbe);}};}function respondWithFilteredResult(_0x599243,_0x55d8b0){return function(_0x1a7ce1){if(_0x1a7ce1){var _0x268f32=typeof _0x55d8b0[_0x68ef('0x2b')]===_0x68ef('0x2c')&&typeof _0x55d8b0['limit']==='undefined';var _0x1cbe4f=_0x1a7ce1[_0x68ef('0x2d')];var _0x7bf96=_0x268f32?0x0:_0x55d8b0[_0x68ef('0x2b')];var _0x22ef25=_0x268f32?_0x1a7ce1[_0x68ef('0x2d')]:_0x55d8b0[_0x68ef('0x2b')]+_0x55d8b0[_0x68ef('0x2e')];var _0x5a6dfd;if(_0x22ef25>=_0x1cbe4f){_0x22ef25=_0x1cbe4f;_0x5a6dfd=0xc8;}else{_0x5a6dfd=0xce;}_0x599243[_0x68ef('0x29')](_0x5a6dfd);return _0x599243[_0x68ef('0x2f')](_0x68ef('0x30'),_0x7bf96+'-'+_0x22ef25+'/'+_0x1cbe4f)['json'](_0x1a7ce1);}return null;};}function patchUpdates(_0x370a8f){return function(_0x523120){try{jsonpatch[_0x68ef('0x31')](_0x523120,_0x370a8f,!![]);}catch(_0x17588a){return BPromise['reject'](_0x17588a);}return _0x523120['save']();};}function saveUpdates(_0x159395,_0x5fa72a){return function(_0x4b8fc8){if(_0x4b8fc8){return _0x4b8fc8[_0x68ef('0x32')](_0x159395)[_0x68ef('0x1f')](function(_0x2d67be){return _0x2d67be;});}return null;};}function removeEntity(_0x2d1e9f,_0x59e9fb){return function(_0x2c8bd0){if(_0x2c8bd0){return _0x2c8bd0[_0x68ef('0x33')]()['then'](function(){var _0x2f8de2=_0x2c8bd0['get']({'plain':!![]});var _0x14581d=_0x68ef('0x34');return db['UserProfileResource'][_0x68ef('0x33')]({'where':{'type':_0x14581d,'resourceId':_0x2f8de2['id']}})['then'](function(){return _0x2c8bd0;});})[_0x68ef('0x1f')](function(){_0x2d1e9f['status'](0xcc)[_0x68ef('0x2a')]();});}};}function handleEntityNotFound(_0x1444e0,_0x798276){return function(_0x569949){if(!_0x569949){_0x1444e0[_0x68ef('0x28')](0x194);}return _0x569949;};}function handleError(_0x485dc3,_0x476938){_0x476938=_0x476938||0x1f4;return function(_0x4c9506){logger[_0x68ef('0x24')](_0x4c9506[_0x68ef('0x35')]);if(_0x4c9506[_0x68ef('0x36')]){delete _0x4c9506[_0x68ef('0x36')];}_0x485dc3[_0x68ef('0x29')](_0x476938)[_0x68ef('0x37')](_0x4c9506);};}exports['index']=function(_0x294fba,_0x15a6ab){var _0x32074a={},_0x52a8b9={},_0x32eddd={'count':0x0,'rows':[]};var _0x3c5de6=_[_0x68ef('0x38')](db['Trunk']['rawAttributes'],function(_0x14f0fc){return{'name':_0x14f0fc[_0x68ef('0x39')],'type':_0x14f0fc[_0x68ef('0x3a')][_0x68ef('0x3b')]};});_0x52a8b9[_0x68ef('0x3c')]=_[_0x68ef('0x38')](_0x3c5de6,_0x68ef('0x36'));_0x52a8b9['query']=_[_0x68ef('0x3d')](_0x294fba[_0x68ef('0x3e')]);_0x52a8b9[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x52a8b9['model'],_0x52a8b9[_0x68ef('0x3e')]);_0x32074a[_0x68ef('0x41')]=_[_0x68ef('0x40')](_0x52a8b9[_0x68ef('0x3c')],qs[_0x68ef('0x42')](_0x294fba[_0x68ef('0x3e')]['fields']));_0x32074a[_0x68ef('0x41')]=_0x32074a[_0x68ef('0x41')][_0x68ef('0x43')]?_0x32074a[_0x68ef('0x41')]:_0x52a8b9[_0x68ef('0x3c')];if(!_0x294fba[_0x68ef('0x3e')][_0x68ef('0x44')](_0x68ef('0x45'))){_0x32074a[_0x68ef('0x2e')]=qs['limit'](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2e')]);_0x32074a[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2b')]);}_0x32074a[_0x68ef('0x46')]=qs['sort'](_0x294fba[_0x68ef('0x3e')]['sort']);_0x32074a[_0x68ef('0x47')]=qs[_0x68ef('0x3f')](_[_0x68ef('0x48')](_0x294fba[_0x68ef('0x3e')],_0x52a8b9['filters']),_0x3c5de6);if(_0x294fba[_0x68ef('0x3e')]['filter']){_0x32074a[_0x68ef('0x47')]=_['merge'](_0x32074a[_0x68ef('0x47')],{'$or':_[_0x68ef('0x38')](_0x3c5de6,function(_0x105e8c){if(_0x105e8c['type']!=='VIRTUAL'){var _0x4044d5={};_0x4044d5[_0x105e8c[_0x68ef('0x36')]]={'$like':'%'+_0x294fba['query']['filter']+'%'};return _0x4044d5;}})});}_0x32074a=_['merge']({},_0x32074a,_0x294fba[_0x68ef('0x49')]);var _0x15c753={'where':_0x32074a[_0x68ef('0x47')]};return db[_0x68ef('0x4a')][_0x68ef('0x2d')](_0x15c753)['then'](function(_0x55f385){_0x32eddd[_0x68ef('0x2d')]=_0x55f385;if(_0x294fba[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0x32074a[_0x68ef('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x68ef('0x4d')](_0x32074a);})[_0x68ef('0x1f')](function(_0x1c9b6f){_0x32eddd[_0x68ef('0x4e')]=_0x1c9b6f;return _0x32eddd;})['then'](respondWithFilteredResult(_0x15a6ab,_0x32074a))['catch'](handleError(_0x15a6ab,null));};exports[_0x68ef('0x4f')]=function(_0x3c3074,_0x566e7c){var _0xfc7a74={'raw':![],'where':{'id':_0x3c3074[_0x68ef('0x50')]['id']}},_0x12fff3={};_0x12fff3[_0x68ef('0x3c')]=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x12fff3[_0x68ef('0x3e')]=_[_0x68ef('0x3d')](_0x3c3074['query']);_0x12fff3[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x12fff3[_0x68ef('0x3c')],_0x12fff3['query']);_0xfc7a74[_0x68ef('0x41')]=_['intersection'](_0x12fff3['model'],qs[_0x68ef('0x42')](_0x3c3074['query'][_0x68ef('0x42')]));_0xfc7a74[_0x68ef('0x41')]=_0xfc7a74[_0x68ef('0x41')][_0x68ef('0x43')]?_0xfc7a74[_0x68ef('0x41')]:_0x12fff3[_0x68ef('0x3c')];if(_0x3c3074[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0xfc7a74[_0x68ef('0x4c')]=[{'all':!![]}];}_0xfc7a74=_[_0x68ef('0x52')]({},_0xfc7a74,_0x3c3074['options']);return db['Trunk'][_0x68ef('0x53')](_0xfc7a74)[_0x68ef('0x1f')](handleEntityNotFound(_0x566e7c,null))[_0x68ef('0x1f')](respondWithResult(_0x566e7c,null))[_0x68ef('0x54')](handleError(_0x566e7c,null));};exports[_0x68ef('0x55')]=function(_0x1d11d7,_0x15400c){var _0x300a64={'where':{'id':_0x1d11d7['params']['id']}},_0x40c784={};_0x40c784['model']=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x300a64['attributes']=_[_0x68ef('0x40')](_0x40c784[_0x68ef('0x3c')],qs['fields'](_0x1d11d7[_0x68ef('0x3e')]['fields']));_0x300a64[_0x68ef('0x41')]=_0x300a64[_0x68ef('0x41')][_0x68ef('0x43')]?_0x300a64[_0x68ef('0x41')]:_0x40c784[_0x68ef('0x3c')];if(_0x1d11d7[_0x68ef('0x3e')]['includeAll']){_0x300a64[_0x68ef('0x4c')]=[{'all':!![]}];}_0x300a64=_[_0x68ef('0x52')]({},_0x300a64,_0x1d11d7[_0x68ef('0x49')]);return db[_0x68ef('0x4a')][_0x68ef('0x53')](_0x300a64)[_0x68ef('0x1f')](handleEntityNotFound(_0x15400c,null))['then'](function(_0x9a978f){if(_0x9a978f){var _0x42d2a3=_0x9a978f['get']({'plain':!![]});_0x42d2a3=qs[_0x68ef('0x56')](_0x42d2a3,['id',_0x68ef('0x57'),_0x68ef('0x58')]);_0x1d11d7['body']=_[_0x68ef('0x56')](_0x1d11d7['body'],['id','createdAt',_0x68ef('0x58')]);return db['Trunk'][_0x68ef('0x59')](_['merge'](_0x42d2a3,_0x1d11d7[_0x68ef('0x5a')]),{'include':_0x1d11d7[_0x68ef('0x3e')][_0x68ef('0x4b')]?[{'all':!![]}]:undefined})[_0x68ef('0x1f')](function(_0x19ce17){var _0x19a9c4=_0x1d11d7['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x19a9c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a9c4[_0x68ef('0x5c')]==='user'){var _0x2f97c5=_0x19ce17[_0x68ef('0x5b')]({'plain':!![]});var _0x212ec4=_0x68ef('0x34');return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x212ec4,'userProfileId':_0x19a9c4[_0x68ef('0x5e')]},'raw':!![]})['then'](function(_0x3ea4e7){if(_0x3ea4e7&&_0x3ea4e7[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x2f97c5[_0x68ef('0x36')],'resourceId':_0x2f97c5['id'],'type':_0x3ea4e7['name'],'sectionId':_0x3ea4e7['id']},{})[_0x68ef('0x1f')](function(){return _0x19ce17;});}else{return _0x19ce17;}})['catch'](function(_0x1ed172){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ed172);throw _0x1ed172;});}return _0x19ce17;});}})[_0x68ef('0x1f')](respondWithResult(_0x15400c,0xc9))[_0x68ef('0x54')](handleError(_0x15400c,null));};exports[_0x68ef('0x59')]=function(_0x21b2ce,_0x51f905,_0x124b49){var _0x570e0c;return db[_0x68ef('0x4a')][_0x68ef('0x59')](_0x21b2ce[_0x68ef('0x5a')],{'raw':!![]})['then'](function(_0x541e35){_0x570e0c=_0x541e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});})[_0x68ef('0x1f')](function(_0x454c6f){var _0x5b41e1=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),'utf8');var _0x3f56a7=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0xed16d1=ejs['render'](_0x5b41e1,{'trunks':_0x454c6f||[]});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0xed16d1);if(_0x570e0c[_0x68ef('0x69')]){var _0x595e79=ejs[_0x68ef('0x6a')](_0x3f56a7,{'trunks':_0x454c6f||[]});fs['writeFileSync'](_0x68ef('0x6b'),_0x595e79);}})['then'](function(){return respondWithRpcPromise('Reload',_0x68ef('0x59'),{'module':_0x68ef('0x6c')});})[_0x68ef('0x1f')](function(){var _0x405971=_0x21b2ce['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x405971)throw new Error(_0x68ef('0x6d'));if(_0x405971[_0x68ef('0x5c')]==='user'){var _0x3e14a4=_0x570e0c[_0x68ef('0x5b')]({'plain':!![]});return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x68ef('0x34'),'userProfileId':_0x405971[_0x68ef('0x5e')]},'raw':!![]})[_0x68ef('0x1f')](function(_0xfe72dc){if(_0xfe72dc&&_0xfe72dc[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x3e14a4[_0x68ef('0x36')],'resourceId':_0x3e14a4['id'],'type':_0xfe72dc['name'],'sectionId':_0xfe72dc['id']},{})[_0x68ef('0x1f')](function(){return _0x570e0c;});}else{return _0x570e0c;}})[_0x68ef('0x54')](function(_0x5db443){logger['error'](_0x68ef('0x6e'),_0x5db443);throw _0x5db443;});}return _0x570e0c;})['then'](respondWithResult(_0x51f905,0xc9))[_0x68ef('0x54')](handleError(_0x51f905,null));};exports[_0x68ef('0x32')]=function(_0x5f1b12,_0x4e0874,_0x31a336){var _0x5c500c;return db[_0x68ef('0x4a')]['find']({'where':{'id':_0x5f1b12[_0x68ef('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e0874,null))[_0x68ef('0x1f')](saveUpdates(_0x5f1b12[_0x68ef('0x5a')],null))['then'](function(_0x3c5e35){if(_0x3c5e35){_0x5c500c=_0x3c5e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});}})[_0x68ef('0x1f')](function(_0x50c308){if(_0x50c308){var _0x2bebdc=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4de1d1=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x65')),'utf8');var _0x4b0fb4=ejs['render'](_0x2bebdc,{'trunks':_0x50c308||[]});fs['writeFileSync'](_0x68ef('0x68'),_0x4b0fb4);var _0x28ad22=ejs[_0x68ef('0x6a')](_0x4de1d1,{'trunks':_0x50c308||[]});fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x28ad22);return respondWithRpcPromise(_0x68ef('0x6f'),_0x68ef('0x32'),{'module':_0x68ef('0x6c')});}return null;})[_0x68ef('0x1f')](function(_0x3ae3e9){if(_0x3ae3e9){return _0x5c500c;}})[_0x68ef('0x1f')](respondWithResult(_0x4e0874,null))[_0x68ef('0x54')](handleError(_0x4e0874,null));};exports[_0x68ef('0x33')]=function(_0x4bd5c3,_0x2b20dc,_0x556dfc){var _0x791181;return db['Trunk']['find']({'where':{'id':_0x4bd5c3[_0x68ef('0x50')]['id']}})[_0x68ef('0x1f')](handleEntityNotFound(_0x2b20dc,null))[_0x68ef('0x1f')](removeEntity(_0x2b20dc,null))[_0x68ef('0x1f')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x68ef('0x1f')](function(_0x308997){var _0x1f1dfd=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4dc885=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0x346049=ejs['render'](_0x1f1dfd,{'trunks':_0x308997});var _0x2a72e8=ejs['render'](_0x4dc885,{'trunks':_0x308997});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0x346049);fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x2a72e8);return respondWithRpcPromise('Reload',_0x68ef('0x33'),{'module':'chan_sip.so'});})[_0x68ef('0x54')](handleError(_0x2b20dc,null));};
\ No newline at end of file
index 2343d98..954b35f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dc5=['path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8dc5,0x17b));var _0x58dc=function(_0x32bff9,_0x3f27d5){_0x32bff9=_0x32bff9-0x0;var _0xbab93=_0x8dc5[_0x32bff9];return _0xbab93;};'use strict';var _=require(_0x58dc('0x0'));var util=require('util');var logger=require(_0x58dc('0x1'))('api');var moment=require(_0x58dc('0x2'));var BPromise=require(_0x58dc('0x3'));var rp=require(_0x58dc('0x4'));var fs=require('fs');var path=require(_0x58dc('0x5'));var rimraf=require('rimraf');var config=require(_0x58dc('0x6'));var attributes=require(_0x58dc('0x7'));module[_0x58dc('0x8')]=function(_0x232dc8,_0x4c13ab){return _0x232dc8[_0x58dc('0x9')](_0x58dc('0xa'),attributes,{'tableName':_0x58dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15cb=['define','Trunk','../../config/logger','api','moment','bluebird','request-promise','rimraf','./trunk.attributes','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x15cb,0x160));var _0xb15c=function(_0x126ba3,_0x56a1f4){_0x126ba3=_0x126ba3-0x0;var _0x156cbc=_0x15cb[_0x126ba3];return _0x156cbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb15c('0x0'))(_0xb15c('0x1'));var moment=require(_0xb15c('0x2'));var BPromise=require(_0xb15c('0x3'));var rp=require(_0xb15c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb15c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb15c('0x6'));module[_0xb15c('0x7')]=function(_0x1a14aa,_0x30fdf5){return _0x1a14aa[_0xb15c('0x8')](_0xb15c('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5026f72..c1fb1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a53=['then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','model','map','catch','ShowTrunk','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','http','request'];(function(_0x344d26,_0x85649){var _0x53b837=function(_0xd8d880){while(--_0xd8d880){_0x344d26['push'](_0x344d26['shift']());}};_0x53b837(++_0x85649);}(_0x9a53,0x1e7));var _0x39a5=function(_0x4d9d0b,_0xef37a1){_0x4d9d0b=_0x4d9d0b-0x0;var _0x5e8e1f=_0x9a53[_0x4d9d0b];return _0x5e8e1f;};'use strict';var _=require(_0x39a5('0x0'));var util=require(_0x39a5('0x1'));var moment=require(_0x39a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39a5('0x3'))['db'];var utils=require(_0x39a5('0x4'));var logger=require(_0x39a5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x39a5('0x6')][_0x39a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f427e,_0x25aa5d,_0x2607ef){return new BPromise(function(_0x5a389c,_0x586d0a){return client[_0x39a5('0x8')](_0x5f427e,_0x2607ef)[_0x39a5('0x9')](function(_0x4e371c){logger[_0x39a5('0xa')](_0x39a5('0xb'),_0x25aa5d,_0x39a5('0xc'));logger[_0x39a5('0xd')](_0x39a5('0xe'),_0x25aa5d,_0x39a5('0xc'),JSON[_0x39a5('0xf')](_0x4e371c));if(_0x4e371c['error']){if(_0x4e371c[_0x39a5('0x10')][_0x39a5('0x11')]===0x1f4){logger[_0x39a5('0x10')](_0x39a5('0xb'),_0x25aa5d,_0x4e371c[_0x39a5('0x10')][_0x39a5('0x12')]);return _0x586d0a(_0x4e371c['error'][_0x39a5('0x12')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x25aa5d,_0x4e371c[_0x39a5('0x10')][_0x39a5('0x12')]);return _0x5a389c(_0x4e371c[_0x39a5('0x10')][_0x39a5('0x12')]);}else{logger[_0x39a5('0xa')](_0x39a5('0xb'),_0x25aa5d,'request\x20sent');_0x5a389c(_0x4e371c['result']['message']);}})['catch'](function(_0x1fdfce){logger[_0x39a5('0x10')](_0x39a5('0xb'),_0x25aa5d,_0x1fdfce);_0x586d0a(_0x1fdfce);});});}exports[_0x39a5('0x13')]=function(_0x2d91fe){var _0x51ca93=this;return new Promise(function(_0x44ab94,_0x39b0e4){return db[_0x39a5('0x14')][_0x39a5('0x15')]({'raw':_0x2d91fe[_0x39a5('0x16')]?_0x2d91fe[_0x39a5('0x16')][_0x39a5('0x17')]===undefined?!![]:![]:!![],'where':_0x2d91fe['options']?_0x2d91fe[_0x39a5('0x16')][_0x39a5('0x18')]||null:null,'attributes':_0x2d91fe[_0x39a5('0x16')]?_0x2d91fe['options'][_0x39a5('0x19')]||null:null,'limit':_0x2d91fe['options']?_0x2d91fe[_0x39a5('0x16')]['limit']||null:null,'include':_0x2d91fe[_0x39a5('0x16')]?_0x2d91fe['options']['include']?_['map'](_0x2d91fe[_0x39a5('0x16')][_0x39a5('0x1a')],function(_0x1c565b){return{'model':db[_0x1c565b[_0x39a5('0x1b')]],'as':_0x1c565b['as'],'attributes':_0x1c565b[_0x39a5('0x19')],'include':_0x1c565b['include']?_[_0x39a5('0x1c')](_0x1c565b[_0x39a5('0x1a')],function(_0x4eb37c){return{'model':db[_0x4eb37c['model']],'as':_0x4eb37c['as'],'attributes':_0x4eb37c[_0x39a5('0x19')],'include':_0x4eb37c['include']?_[_0x39a5('0x1c')](_0x4eb37c[_0x39a5('0x1a')],function(_0x457171){return{'model':db[_0x457171[_0x39a5('0x1b')]],'as':_0x457171['as'],'attributes':_0x457171[_0x39a5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x39a5('0x9')](function(_0x20142d){logger['info']('GetTrunk',_0x2d91fe);logger[_0x39a5('0xd')](_0x39a5('0x13'),_0x2d91fe,JSON[_0x39a5('0xf')](_0x20142d));_0x44ab94(_0x20142d);})[_0x39a5('0x1d')](function(_0x45da22){logger[_0x39a5('0x10')](_0x39a5('0x13'),_0x45da22[_0x39a5('0x12')],_0x2d91fe);_0x39b0e4(_0x51ca93[_0x39a5('0x10')](0x1f4,_0x45da22[_0x39a5('0x12')]));});});};exports['ShowTrunk']=function(_0x336b6e){var _0x17bc10=this;return new Promise(function(_0x2c1200,_0x88778e){return db[_0x39a5('0x14')]['find']({'raw':_0x336b6e[_0x39a5('0x16')]?_0x336b6e[_0x39a5('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x336b6e[_0x39a5('0x16')]?_0x336b6e[_0x39a5('0x16')][_0x39a5('0x18')]||null:null,'attributes':_0x336b6e[_0x39a5('0x16')]?_0x336b6e[_0x39a5('0x16')][_0x39a5('0x19')]||null:null,'include':_0x336b6e['options']?_0x336b6e[_0x39a5('0x16')][_0x39a5('0x1a')]?_[_0x39a5('0x1c')](_0x336b6e[_0x39a5('0x16')][_0x39a5('0x1a')],function(_0x1887e6){return{'model':db[_0x1887e6['model']],'as':_0x1887e6['as'],'attributes':_0x1887e6[_0x39a5('0x19')],'include':_0x1887e6[_0x39a5('0x1a')]?_[_0x39a5('0x1c')](_0x1887e6[_0x39a5('0x1a')],function(_0x54c41b){return{'model':db[_0x54c41b[_0x39a5('0x1b')]],'as':_0x54c41b['as'],'attributes':_0x54c41b[_0x39a5('0x19')],'include':_0x54c41b[_0x39a5('0x1a')]?_[_0x39a5('0x1c')](_0x54c41b[_0x39a5('0x1a')],function(_0x18759a){return{'model':db[_0x18759a[_0x39a5('0x1b')]],'as':_0x18759a['as'],'attributes':_0x18759a[_0x39a5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x39a5('0x9')](function(_0x114af1){logger[_0x39a5('0xa')](_0x39a5('0x1e'),_0x336b6e);logger[_0x39a5('0xd')](_0x39a5('0x1e'),_0x336b6e,JSON[_0x39a5('0xf')](_0x114af1));_0x2c1200(_0x114af1);})[_0x39a5('0x1d')](function(_0x393c52){logger['error'](_0x39a5('0x1e'),_0x393c52[_0x39a5('0x12')],_0x336b6e);_0x88778e(_0x17bc10[_0x39a5('0x10')](0x1f4,_0x393c52[_0x39a5('0x12')]));});});};
\ No newline at end of file
+var _0x471a=['include','map','model','ShowTrunk','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetTrunk','Trunk','options','where','attributes'];(function(_0xd5204c,_0x1e61a8){var _0xb8d395=function(_0x28ec73){while(--_0x28ec73){_0xd5204c['push'](_0xd5204c['shift']());}};_0xb8d395(++_0x1e61a8);}(_0x471a,0x6f));var _0xa471=function(_0x48f45e,_0x3fe13b){_0x48f45e=_0x48f45e-0x0;var _0x383ae9=_0x471a[_0x48f45e];return _0x383ae9;};'use strict';var _=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var moment=require('moment');var BPromise=require(_0xa471('0x2'));var rs=require(_0xa471('0x3'));var fs=require('fs');var Redis=require(_0xa471('0x4'));var db=require(_0xa471('0x5'))['db'];var utils=require(_0xa471('0x6'));var logger=require(_0xa471('0x7'))(_0xa471('0x8'));var config=require(_0xa471('0x9'));var jayson=require(_0xa471('0xa'));var client=jayson[_0xa471('0xb')][_0xa471('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32fd3c,_0x54ed17,_0x2be261){return new BPromise(function(_0x173f3e,_0x19cac8){return client[_0xa471('0xd')](_0x32fd3c,_0x2be261)[_0xa471('0xe')](function(_0x4c24c2){logger[_0xa471('0xf')](_0xa471('0x10'),_0x54ed17,_0xa471('0x11'));logger[_0xa471('0x12')]('Trunk,\x20%s,\x20%s,\x20%s',_0x54ed17,_0xa471('0x11'),JSON[_0xa471('0x13')](_0x4c24c2));if(_0x4c24c2[_0xa471('0x14')]){if(_0x4c24c2['error'][_0xa471('0x15')]===0x1f4){logger[_0xa471('0x14')](_0xa471('0x10'),_0x54ed17,_0x4c24c2['error'][_0xa471('0x16')]);return _0x19cac8(_0x4c24c2['error'][_0xa471('0x16')]);}logger['error'](_0xa471('0x10'),_0x54ed17,_0x4c24c2[_0xa471('0x14')][_0xa471('0x16')]);return _0x173f3e(_0x4c24c2['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x54ed17,_0xa471('0x11'));_0x173f3e(_0x4c24c2['result']['message']);}})[_0xa471('0x17')](function(_0x13ad3d){logger[_0xa471('0x14')]('Trunk,\x20%s,\x20%s',_0x54ed17,_0x13ad3d);_0x19cac8(_0x13ad3d);});});}exports[_0xa471('0x18')]=function(_0x1987a9){var _0x5d6968=this;return new Promise(function(_0x497944,_0xc271cd){return db[_0xa471('0x19')]['findAll']({'raw':_0x1987a9['options']?_0x1987a9[_0xa471('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1987a9[_0xa471('0x1a')]?_0x1987a9['options'][_0xa471('0x1b')]||null:null,'attributes':_0x1987a9[_0xa471('0x1a')]?_0x1987a9[_0xa471('0x1a')][_0xa471('0x1c')]||null:null,'limit':_0x1987a9[_0xa471('0x1a')]?_0x1987a9[_0xa471('0x1a')]['limit']||null:null,'include':_0x1987a9[_0xa471('0x1a')]?_0x1987a9[_0xa471('0x1a')][_0xa471('0x1d')]?_[_0xa471('0x1e')](_0x1987a9[_0xa471('0x1a')][_0xa471('0x1d')],function(_0x2ace05){return{'model':db[_0x2ace05['model']],'as':_0x2ace05['as'],'attributes':_0x2ace05[_0xa471('0x1c')],'include':_0x2ace05[_0xa471('0x1d')]?_[_0xa471('0x1e')](_0x2ace05[_0xa471('0x1d')],function(_0x2dbc26){return{'model':db[_0x2dbc26[_0xa471('0x1f')]],'as':_0x2dbc26['as'],'attributes':_0x2dbc26[_0xa471('0x1c')],'include':_0x2dbc26[_0xa471('0x1d')]?_['map'](_0x2dbc26[_0xa471('0x1d')],function(_0x165cc8){return{'model':db[_0x165cc8[_0xa471('0x1f')]],'as':_0x165cc8['as'],'attributes':_0x165cc8[_0xa471('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa471('0xe')](function(_0x57d1fd){logger[_0xa471('0xf')](_0xa471('0x18'),_0x1987a9);logger['debug'](_0xa471('0x18'),_0x1987a9,JSON[_0xa471('0x13')](_0x57d1fd));_0x497944(_0x57d1fd);})[_0xa471('0x17')](function(_0x37e836){logger[_0xa471('0x14')](_0xa471('0x18'),_0x37e836[_0xa471('0x16')],_0x1987a9);_0xc271cd(_0x5d6968[_0xa471('0x14')](0x1f4,_0x37e836[_0xa471('0x16')]));});});};exports[_0xa471('0x20')]=function(_0x292488){var _0x369031=this;return new Promise(function(_0x1c1a0c,_0xd3bc9f){return db[_0xa471('0x19')][_0xa471('0x21')]({'raw':_0x292488['options']?_0x292488[_0xa471('0x1a')][_0xa471('0x22')]===undefined?!![]:![]:!![],'where':_0x292488['options']?_0x292488['options'][_0xa471('0x1b')]||null:null,'attributes':_0x292488['options']?_0x292488[_0xa471('0x1a')][_0xa471('0x1c')]||null:null,'include':_0x292488[_0xa471('0x1a')]?_0x292488[_0xa471('0x1a')][_0xa471('0x1d')]?_[_0xa471('0x1e')](_0x292488[_0xa471('0x1a')]['include'],function(_0x2811d2){return{'model':db[_0x2811d2[_0xa471('0x1f')]],'as':_0x2811d2['as'],'attributes':_0x2811d2[_0xa471('0x1c')],'include':_0x2811d2[_0xa471('0x1d')]?_['map'](_0x2811d2[_0xa471('0x1d')],function(_0x193bb9){return{'model':db[_0x193bb9['model']],'as':_0x193bb9['as'],'attributes':_0x193bb9[_0xa471('0x1c')],'include':_0x193bb9['include']?_[_0xa471('0x1e')](_0x193bb9[_0xa471('0x1d')],function(_0x41db9e){return{'model':db[_0x41db9e[_0xa471('0x1f')]],'as':_0x41db9e['as'],'attributes':_0x41db9e[_0xa471('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa471('0xe')](function(_0x20b9ce){logger[_0xa471('0xf')]('ShowTrunk',_0x292488);logger[_0xa471('0x12')](_0xa471('0x20'),_0x292488,JSON[_0xa471('0x13')](_0x20b9ce));_0x1c1a0c(_0x20b9ce);})[_0xa471('0x17')](function(_0x1fdb67){logger[_0xa471('0x14')](_0xa471('0x20'),_0x1fdb67['message'],_0x292488);_0xd3bc9f(_0x369031[_0xa471('0x14')](0x1f4,_0x1fdb67[_0xa471('0x16')]));});});};
\ No newline at end of file
index d540a31..f6e36a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8cd=['put','/:id','isAuthenticated','update','exports','express','./user-setting.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb8cd,0x1a2));var _0xdb8c=function(_0x2322a8,_0x3cb189){_0x2322a8=_0x2322a8-0x0;var _0x5c980e=_0xb8cd[_0x2322a8];return _0x5c980e;};'use strict';var express=require(_0xdb8c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xdb8c('0x1'));router[_0xdb8c('0x2')](_0xdb8c('0x3'),auth[_0xdb8c('0x4')](),controller[_0xdb8c('0x5')]);module[_0xdb8c('0x6')]=router;
\ No newline at end of file
+var _0x304b=['isAuthenticated','update','exports','Router','../../components/auth/service','./user-setting.controller','put','/:id'];(function(_0x2a39b1,_0x330a9a){var _0x1e822f=function(_0x196554){while(--_0x196554){_0x2a39b1['push'](_0x2a39b1['shift']());}};_0x1e822f(++_0x330a9a);}(_0x304b,0xfb));var _0xb304=function(_0x56c0c6,_0x24d472){_0x56c0c6=_0x56c0c6-0x0;var _0x3a4cbd=_0x304b[_0x56c0c6];return _0x3a4cbd;};'use strict';var express=require('express');var router=express[_0xb304('0x0')]();var auth=require(_0xb304('0x1'));var controller=require(_0xb304('0x2'));router[_0xb304('0x3')](_0xb304('0x4'),auth[_0xb304('0x5')](),controller[_0xb304('0x6')]);module[_0xb304('0x7')]=router;
\ No newline at end of file
index 1f03cb7..00e840c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb0f=['DATE','INTEGER','UserId','sequelize','error','warning','exports','BOOLEAN','TEXT'];(function(_0x7a6aa0,_0xd5e009){var _0x43a658=function(_0x4f517a){while(--_0x4f517a){_0x7a6aa0['push'](_0x7a6aa0['shift']());}};_0x43a658(++_0xd5e009);}(_0xbb0f,0x12c));var _0xfbb0=function(_0x228f72,_0x48830e){_0x228f72=_0x228f72-0x0;var _0x23a8be=_0xbb0f[_0x228f72];return _0x23a8be;};'use strict';var Sequelize=require(_0xfbb0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xfbb0('0x1'),_0xfbb0('0x2'),'info','debug'];module[_0xfbb0('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xfbb0('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xfbb0('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xfbb0('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xfbb0('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xfbb0('0x7')],'unique':_0xfbb0('0x8')}};
\ No newline at end of file
+var _0xbefe=['exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','sequelize','error','warning','info','debug'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbefe,0x1be));var _0xebef=function(_0x46827d,_0x1c6b7a){_0x46827d=_0x46827d-0x0;var _0x38d03e=_0xbefe[_0x46827d];return _0x38d03e;};'use strict';var Sequelize=require(_0xebef('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xebef('0x1'),_0xebef('0x2'),_0xebef('0x3'),_0xebef('0x4')];module[_0xebef('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xebef('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xebef('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xebef('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xebef('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xebef('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xebef('0xa')],'unique':'UserId'}};
\ No newline at end of file
index 337f827..17d1612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb492=['redis','./user-setting.socket','register','localhost','status','json','then','sendStatus','error','stack','name','admin','Unauthorized','params','UserSetting','find','body','catch','ioredis','../../config/logger','api','../../config/environment'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0xb492,0x172));var _0x2b49=function(_0x33b9b4,_0x1ca376){_0x33b9b4=_0x33b9b4-0x0;var _0x2a258f=_0xb492[_0x33b9b4];return _0x2a258f;};'use strict';var _=require('lodash');var Redis=require(_0x2b49('0x0'));var logger=require(_0x2b49('0x1'))(_0x2b49('0x2'));var config=require(_0x2b49('0x3'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x2b49('0x4')]));require(_0x2b49('0x5'))[_0x2b49('0x6')](socket);config[_0x2b49('0x4')]=_['defaults'](config['redis'],{'host':_0x2b49('0x7'),'port':0x18eb});function respondWithResult(_0x363d21,_0x4b4d49){_0x4b4d49=_0x4b4d49||0xc8;return function(_0x2b745f){if(_0x2b745f){return _0x363d21[_0x2b49('0x8')](_0x4b4d49)[_0x2b49('0x9')](_0x2b745f);}};}function saveUpdates(_0xd43661){return function(_0x1e595f){if(_0x1e595f){return _0x1e595f['update'](_0xd43661)[_0x2b49('0xa')](function(_0x39b1b5){return _0x39b1b5;});}return null;};}function handleEntityNotFound(_0x4d9425){return function(_0x46813f){if(!_0x46813f){_0x4d9425[_0x2b49('0xb')](0x194);}return _0x46813f;};}function handleError(_0x448e41,_0x4f766e){_0x4f766e=_0x4f766e||0x1f4;return function(_0x34449c){logger[_0x2b49('0xc')](_0x34449c[_0x2b49('0xd')]);if(_0x34449c[_0x2b49('0xe')]){delete _0x34449c[_0x2b49('0xe')];}_0x448e41[_0x2b49('0x8')](_0x4f766e)['send'](_0x34449c);};}exports['update']=function(_0x157560,_0x28aae7){if(_0x157560['user']['role']!==_0x2b49('0xf'))throw new Error(_0x2b49('0x10'));if(isNaN(Number(_0x157560[_0x2b49('0x11')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x2b49('0x12')][_0x2b49('0x13')]({'where':{'id':_0x157560['params']['id']}})['then'](handleEntityNotFound(_0x28aae7,null))[_0x2b49('0xa')](saveUpdates(_0x157560[_0x2b49('0x14')],null))[_0x2b49('0xa')](respondWithResult(_0x28aae7,null))[_0x2b49('0x15')](handleError(_0x28aae7,null));};
\ No newline at end of file
+var _0xe77f=['../../config/environment','socket.io-emitter','redis','register','defaults','localhost','status','json','update','sendStatus','error','stack','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','catch','lodash','ioredis','api'];(function(_0x590024,_0x24facc){var _0x5e58a3=function(_0x462b53){while(--_0x462b53){_0x590024['push'](_0x590024['shift']());}};_0x5e58a3(++_0x24facc);}(_0xe77f,0xba));var _0xfe77=function(_0x22f08a,_0x3d4abc){_0x22f08a=_0x22f08a-0x0;var _0x388f71=_0xe77f[_0x22f08a];return _0x388f71;};'use strict';var _=require(_0xfe77('0x0'));var Redis=require(_0xfe77('0x1'));var logger=require('../../config/logger')(_0xfe77('0x2'));var config=require(_0xfe77('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0xfe77('0x4'))(new Redis(config[_0xfe77('0x5')]));require('./user-setting.socket')[_0xfe77('0x6')](socket);config[_0xfe77('0x5')]=_[_0xfe77('0x7')](config[_0xfe77('0x5')],{'host':_0xfe77('0x8'),'port':0x18eb});function respondWithResult(_0x51d137,_0x5ecf79){_0x5ecf79=_0x5ecf79||0xc8;return function(_0x1a65af){if(_0x1a65af){return _0x51d137[_0xfe77('0x9')](_0x5ecf79)[_0xfe77('0xa')](_0x1a65af);}};}function saveUpdates(_0x1a2809){return function(_0x394bc0){if(_0x394bc0){return _0x394bc0[_0xfe77('0xb')](_0x1a2809)['then'](function(_0x54015b){return _0x54015b;});}return null;};}function handleEntityNotFound(_0x42740a){return function(_0x1b2f58){if(!_0x1b2f58){_0x42740a[_0xfe77('0xc')](0x194);}return _0x1b2f58;};}function handleError(_0x36292e,_0x5d19a8){_0x5d19a8=_0x5d19a8||0x1f4;return function(_0xa95c2c){logger[_0xfe77('0xd')](_0xa95c2c[_0xfe77('0xe')]);if(_0xa95c2c[_0xfe77('0xf')]){delete _0xa95c2c['name'];}_0x36292e[_0xfe77('0x9')](_0x5d19a8)[_0xfe77('0x10')](_0xa95c2c);};}exports[_0xfe77('0xb')]=function(_0x5b2271,_0x2f4c5f){if(_0x5b2271[_0xfe77('0x11')]['role']!==_0xfe77('0x12'))throw new Error(_0xfe77('0x13'));if(isNaN(Number(_0x5b2271[_0xfe77('0x14')]['id'])))throw new Error(_0xfe77('0x15'));return db[_0xfe77('0x16')][_0xfe77('0x17')]({'where':{'id':_0x5b2271[_0xfe77('0x14')]['id']}})[_0xfe77('0x18')](handleEntityNotFound(_0x2f4c5f,null))[_0xfe77('0x18')](saveUpdates(_0x5b2271[_0xfe77('0x19')],null))[_0xfe77('0x18')](respondWithResult(_0x2f4c5f,null))[_0xfe77('0x1a')](handleError(_0x2f4c5f,null));};
\ No newline at end of file
index f48d30c..4982df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fb=['events','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0xdf5462,_0x66522a){var _0x12bcb0=function(_0x467132){while(--_0x467132){_0xdf5462['push'](_0xdf5462['shift']());}};_0x12bcb0(++_0x66522a);}(_0xa4fb,0xc4));var _0xba4f=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0xa4fb[_0x3ba422];return _0x20b5dd;};'use strict';var EventEmitter=require(_0xba4f('0x0'));var UserSetting=require(_0xba4f('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xba4f('0x2')](0x0);var events={'afterCreate':_0xba4f('0x3'),'afterUpdate':'update','afterDestroy':_0xba4f('0x4')};function emitEvent(_0x24cb98){return function(_0x2c996a,_0x59b382,_0x4926f4){UserSettingEvents[_0xba4f('0x5')](_0x24cb98+':'+_0x2c996a['id'],_0x2c996a);UserSettingEvents[_0xba4f('0x5')](_0x24cb98,_0x2c996a);_0x4926f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xba4f('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents;
\ No newline at end of file
+var _0x29f2=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x29f2,0x64));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x229f('0x0'));var UserSetting=require(_0x229f('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x229f('0x2')](0x0);var events={'afterCreate':_0x229f('0x3'),'afterUpdate':_0x229f('0x4'),'afterDestroy':_0x229f('0x5')};function emitEvent(_0x5bf940){return function(_0x1147ef,_0x406ad8,_0x5294ae){UserSettingEvents[_0x229f('0x6')](_0x5bf940+':'+_0x1147ef['id'],_0x1147ef);UserSettingEvents[_0x229f('0x6')](_0x5bf940,_0x1147ef);_0x5294ae(null);};}for(var e in events){if(events[_0x229f('0x7')](e)){var event=events[e];UserSetting[_0x229f('0x8')](e,emitEvent(event));}}module[_0x229f('0x9')]=UserSettingEvents;
\ No newline at end of file
index e7db486..8c9492c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc03=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings'];(function(_0x593c77,_0x48febf){var _0x3a679c=function(_0xb9ff52){while(--_0xb9ff52){_0x593c77['push'](_0x593c77['shift']());}};_0x3a679c(++_0x48febf);}(_0xfc03,0x16f));var _0x3fc0=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xfc03[_0x25e7cb];return _0x375d92;};'use strict';var attributes=require(_0x3fc0('0x0'));module['exports']=function(_0x5b3d80){return _0x5b3d80[_0x3fc0('0x1')]('UserSetting',attributes,{'tableName':_0x3fc0('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47eb14){if(!_0x47eb14[_0x3fc0('0x3')])_0x47eb14[_0x3fc0('0x4')]=null;else if(_0x47eb14[_0x3fc0('0x4')]===null)_0x47eb14[_0x3fc0('0x4')]=new Date();}}});};
\ No newline at end of file
+var _0xcf14=['clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings','clientSideLoggingEnabled'];(function(_0x3cff41,_0x6d45b6){var _0x16ab1f=function(_0x3c30cc){while(--_0x3c30cc){_0x3cff41['push'](_0x3cff41['shift']());}};_0x16ab1f(++_0x6d45b6);}(_0xcf14,0xa1));var _0x4cf1=function(_0x5dec37,_0x45c702){_0x5dec37=_0x5dec37-0x0;var _0x54ed79=_0xcf14[_0x5dec37];return _0x54ed79;};'use strict';var attributes=require(_0x4cf1('0x0'));module['exports']=function(_0x2a09ab){return _0x2a09ab[_0x4cf1('0x1')]('UserSetting',attributes,{'tableName':_0x4cf1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15f9b9){if(!_0x15f9b9[_0x4cf1('0x3')])_0x15f9b9[_0x4cf1('0x4')]=null;else if(_0x15f9b9['clientSideLoggingEnabledSince']===null)_0x15f9b9[_0x4cf1('0x4')]=new Date();}}});};
\ No newline at end of file
index beb5135..4274349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b04=['update','emit','UserId','register','./user-setting.events','save','remove'];(function(_0x165dad,_0x3cd9db){var _0x4250b2=function(_0xe780aa){while(--_0xe780aa){_0x165dad['push'](_0x165dad['shift']());}};_0x4250b2(++_0x3cd9db);}(_0x6b04,0x123));var _0x46b0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6b04[_0x501510];return _0x1e6ee5;};'use strict';var UserSettingEvents=require(_0x46b0('0x0'));var events=[_0x46b0('0x1'),_0x46b0('0x2'),_0x46b0('0x3')];function createListener(_0x4493a3,_0x4bc72f){return function(_0x2d6750){_0x4bc72f[_0x46b0('0x4')](_0x4493a3,_0x2d6750);if(_0x4493a3==='user-setting:update'){_0x4bc72f['emit']('user-setting:update:user-'+_0x2d6750[_0x46b0('0x5')],_0x2d6750);}};}exports[_0x46b0('0x6')]=function(_0x1375b7){for(var _0x13c3b0=0x0,_0x25087b=events['length'];_0x13c3b0<_0x25087b;_0x13c3b0++){var _0x57637d=events[_0x13c3b0];var _0x227c3d=createListener('user-setting:'+_0x57637d,_0x1375b7);UserSettingEvents['on'](_0x57637d,_0x227c3d);}};
\ No newline at end of file
+var _0x7764=['emit','user-setting:update:user-','register','./user-setting.events','save','remove','update','user-setting:update'];(function(_0x4971ca,_0x2ae39a){var _0x10c18e=function(_0x469242){while(--_0x469242){_0x4971ca['push'](_0x4971ca['shift']());}};_0x10c18e(++_0x2ae39a);}(_0x7764,0x1f3));var _0x4776=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7764[_0x40bffc];return _0x3007e9;};'use strict';var UserSettingEvents=require(_0x4776('0x0'));var events=[_0x4776('0x1'),_0x4776('0x2'),_0x4776('0x3')];function createListener(_0x130f4f,_0xeac492){return function(_0x4cbcc2){_0xeac492['emit'](_0x130f4f,_0x4cbcc2);if(_0x130f4f===_0x4776('0x4')){_0xeac492[_0x4776('0x5')](_0x4776('0x6')+_0x4cbcc2['UserId'],_0x4cbcc2);}};}exports[_0x4776('0x7')]=function(_0x3d8b92){for(var _0x53656b=0x0,_0x44268b=events['length'];_0x53656b<_0x44268b;_0x53656b++){var _0x5b874b=events[_0x53656b];var _0x45ecb2=createListener('user-setting:'+_0x5b874b,_0x3d8b92);UserSettingEvents['on'](_0x5b874b,_0x45ecb2);}};
\ No newline at end of file
index bbc96cf..778b56c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae7=['unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','/:id/password','removeQueues','delete','removeTeams','destroy','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/:id/contacts','create','post','/create_many','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','single','/:id/login','login','/:id/pause','pause'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xeae7,0xfb));var _0x7eae=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0xeae7[_0x1057a3];return _0x131cdb;};'use strict';var multer=require('multer');var util=require(_0x7eae('0x0'));var path=require('path');var timeout=require(_0x7eae('0x1'));var express=require('express');var router=express[_0x7eae('0x2')]();var fs_extra=require(_0x7eae('0x3'));var auth=require(_0x7eae('0x4'));var interaction=require(_0x7eae('0x5'));var config=require(_0x7eae('0x6'));var controller=require(_0x7eae('0x7'));router[_0x7eae('0x8')]('/',auth[_0x7eae('0x9')](),controller[_0x7eae('0xa')]);router[_0x7eae('0x8')](_0x7eae('0xb'),auth[_0x7eae('0x9')](),controller[_0x7eae('0xc')]);router[_0x7eae('0x8')](_0x7eae('0xd'),auth[_0x7eae('0x9')](),controller[_0x7eae('0xe')]);router['get'](_0x7eae('0xf'),auth['isAuthenticated'](),controller[_0x7eae('0x10')]);router[_0x7eae('0x8')](_0x7eae('0x11'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x12')]);router[_0x7eae('0x8')](_0x7eae('0x13'),controller[_0x7eae('0x14')]);router['get'](_0x7eae('0x15'),auth[_0x7eae('0x9')](),controller['getOpenTabs']);router[_0x7eae('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x7eae('0x16')]);router[_0x7eae('0x8')](_0x7eae('0x17'),auth['isAuthenticated'](),controller[_0x7eae('0x18')]);router['get'](_0x7eae('0x19'),auth['isAuthenticated'](),controller[_0x7eae('0x1a')]);router['get'](_0x7eae('0x1b'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x1c')]);router[_0x7eae('0x8')](_0x7eae('0x1d'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x1e')]);router[_0x7eae('0x8')]('/:id/screen_recordings',auth[_0x7eae('0x9')](),controller[_0x7eae('0x1f')]);router['get'](_0x7eae('0x20'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x21')]);router[_0x7eae('0x8')]('/:id/openchannel/interactions',auth[_0x7eae('0x9')](),controller[_0x7eae('0x22')]);router[_0x7eae('0x8')](_0x7eae('0x23'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x24')]);router[_0x7eae('0x8')](_0x7eae('0x25'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x26')]);router['get'](_0x7eae('0x27'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x28')]);router[_0x7eae('0x8')]('/:id/whatsapp/interactions',auth[_0x7eae('0x9')](),controller[_0x7eae('0x29')]);router[_0x7eae('0x8')](_0x7eae('0x2a'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x2b')]);router[_0x7eae('0x8')]('/:id/lists',auth[_0x7eae('0x9')](),controller['getLists']);router[_0x7eae('0x8')]('/:id/agents',auth[_0x7eae('0x9')](),controller[_0x7eae('0x2c')]);router[_0x7eae('0x8')]('/:id/prefixes',auth[_0x7eae('0x9')](),controller[_0x7eae('0x2d')]);router[_0x7eae('0x8')](_0x7eae('0x2e'),auth['isAuthenticated'](),controller[_0x7eae('0x2f')]);router[_0x7eae('0x8')](_0x7eae('0x30'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x31')]);router['get'](_0x7eae('0x32'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x33')]);router[_0x7eae('0x8')](_0x7eae('0x34'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x35')]);router[_0x7eae('0x8')](_0x7eae('0x36'),auth[_0x7eae('0x9')](),controller['getChatWebsites']);router[_0x7eae('0x8')](_0x7eae('0x37'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x38')]);router['get'](_0x7eae('0x39'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x3a')]);router[_0x7eae('0x8')](_0x7eae('0x3b'),auth['isAuthenticated'](),controller[_0x7eae('0x3c')]);router['post'](_0x7eae('0x3d'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0x7eae('0x9')](),controller[_0x7eae('0x3e')]);router[_0x7eae('0x3f')](_0x7eae('0x40'),auth['isAuthenticated'](),controller[_0x7eae('0x41')]);router[_0x7eae('0x3f')]('/:id/queues',auth[_0x7eae('0x9')](),controller[_0x7eae('0x42')]);var upload=multer({'storage':multer[_0x7eae('0x43')]({'destination':function(_0xe33f91,_0x336e92,_0x442976){_0x442976(null,path[_0x7eae('0x44')](config[_0x7eae('0x45')],'server/files/images/'));},'filename':function(_0x271241,_0x19a583,_0x49e400){_0x49e400(null,util[_0x7eae('0x46')](_0x7eae('0x47'),Date[_0x7eae('0x48')](),_0x19a583[_0x7eae('0x49')]));}})});router['post'](_0x7eae('0x13'),upload[_0x7eae('0x4a')]('file'),controller['addAvatar']);router[_0x7eae('0x3f')](_0x7eae('0x4b'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x4c')]);router['post']('/:id/logout',auth['isAuthenticated'](),controller['logout']);router[_0x7eae('0x3f')](_0x7eae('0x4d'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x4e')]);router[_0x7eae('0x3f')]('/:id/unpause',auth[_0x7eae('0x9')](),controller[_0x7eae('0x4f')]);router['post']('/:id/teams',auth[_0x7eae('0x9')](),controller['addTeams']);router[_0x7eae('0x3f')](_0x7eae('0x50'),auth['isAuthenticated'](),controller[_0x7eae('0x51')]);router[_0x7eae('0x3f')](_0x7eae('0x52'),auth[_0x7eae('0x9')](),controller['addMailInteractions']);router[_0x7eae('0x3f')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x7eae('0x53')]);router['post']('/:id/sms_interactions',auth[_0x7eae('0x9')](),controller[_0x7eae('0x54')]);router[_0x7eae('0x3f')](_0x7eae('0x55'),auth['isAuthenticated'](),controller[_0x7eae('0x56')]);router[_0x7eae('0x3f')]('/:id/whatsapp_interactions',auth[_0x7eae('0x9')](),controller[_0x7eae('0x57')]);router[_0x7eae('0x3f')](_0x7eae('0x2e'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x58')]);router[_0x7eae('0x3f')](_0x7eae('0x30'),auth['isAuthenticated'](),controller[_0x7eae('0x59')]);router[_0x7eae('0x3f')](_0x7eae('0x32'),auth[_0x7eae('0x9')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth[_0x7eae('0x9')](),controller[_0x7eae('0x5a')]);router[_0x7eae('0x3f')](_0x7eae('0x36'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x5b')]);router[_0x7eae('0x3f')](_0x7eae('0x37'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x5c')]);router[_0x7eae('0x3f')]('/:id/api_key',auth['isAuthenticated'](),controller['createApiKey']);router[_0x7eae('0x5d')](_0x7eae('0x11'),auth[_0x7eae('0x9')](),controller['update']);router[_0x7eae('0x5d')](_0x7eae('0x5e'),auth[_0x7eae('0x9')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x7eae('0x9')](),controller[_0x7eae('0x5f')]);router[_0x7eae('0x60')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7eae('0x61')]);router[_0x7eae('0x60')](_0x7eae('0x11'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x62')]);router[_0x7eae('0x60')](_0x7eae('0x50'),auth[_0x7eae('0x9')](),controller['removeChatInteractions']);router[_0x7eae('0x60')](_0x7eae('0x52'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x63')]);router[_0x7eae('0x60')](_0x7eae('0x64'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x65')]);router[_0x7eae('0x60')](_0x7eae('0x66'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x67')]);router[_0x7eae('0x60')](_0x7eae('0x55'),auth['isAuthenticated'](),controller[_0x7eae('0x68')]);router[_0x7eae('0x60')]('/:id/whatsapp_interactions',auth[_0x7eae('0x9')](),controller['removeWhatsappInteractions']);router[_0x7eae('0x60')](_0x7eae('0x2e'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x7eae('0x60')](_0x7eae('0x30'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x69')]);router[_0x7eae('0x60')](_0x7eae('0x32'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x7eae('0x60')](_0x7eae('0x36'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x6a')]);router[_0x7eae('0x60')](_0x7eae('0x37'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x6b')]);router[_0x7eae('0x60')](_0x7eae('0x3b'),auth[_0x7eae('0x9')](),controller[_0x7eae('0x6c')]);module[_0x7eae('0x6d')]=router;
\ No newline at end of file
+var _0xcc8d=['/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getChatWebsites','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','/:id/queues','addQueues','diskStorage','root','format','%s-%s','now','/:id/avatar','single','file','login','/:id/pause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0xcc8d[_0x9d14e3];return _0x19bf32;};'use strict';var multer=require('multer');var util=require(_0xdcc8('0x0'));var path=require(_0xdcc8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdcc8('0x2')]();var fs_extra=require(_0xdcc8('0x3'));var auth=require(_0xdcc8('0x4'));var interaction=require(_0xdcc8('0x5'));var config=require(_0xdcc8('0x6'));var controller=require(_0xdcc8('0x7'));router[_0xdcc8('0x8')]('/',auth['isAuthenticated'](),controller[_0xdcc8('0x9')]);router[_0xdcc8('0x8')](_0xdcc8('0xa'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0xc')]);router['get'](_0xdcc8('0xd'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0xe')]);router[_0xdcc8('0x8')](_0xdcc8('0xf'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x10')]);router[_0xdcc8('0x8')](_0xdcc8('0x11'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x12')]);router[_0xdcc8('0x8')]('/:id/avatar',controller[_0xdcc8('0x13')]);router[_0xdcc8('0x8')]('/:id/open_tabs',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x14')]);router[_0xdcc8('0x8')](_0xdcc8('0x15'),auth['isAuthenticated'](),controller[_0xdcc8('0x16')]);router[_0xdcc8('0x8')]('/:id/queues',auth[_0xdcc8('0xb')](),controller['getQueues']);router[_0xdcc8('0x8')](_0xdcc8('0x17'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x18')]);router[_0xdcc8('0x8')](_0xdcc8('0x19'),auth[_0xdcc8('0xb')](),controller['getGroups']);router['get']('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0xdcc8('0x8')]('/:id/screen_recordings',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x1a')]);router[_0xdcc8('0x8')](_0xdcc8('0x1b'),auth[_0xdcc8('0xb')](),controller['getChatInteractions']);router['get'](_0xdcc8('0x1c'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x1d')]);router[_0xdcc8('0x8')](_0xdcc8('0x1e'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x1f')]);router[_0xdcc8('0x8')](_0xdcc8('0x20'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x21')]);router['get']('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0xdcc8('0x8')](_0xdcc8('0x22'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x23')]);router[_0xdcc8('0x8')](_0xdcc8('0x24'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x25')]);router[_0xdcc8('0x8')](_0xdcc8('0x26'),auth['isAuthenticated'](),controller[_0xdcc8('0x27')]);router[_0xdcc8('0x8')](_0xdcc8('0x28'),auth['isAuthenticated'](),controller[_0xdcc8('0x29')]);router['get'](_0xdcc8('0x2a'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x2b')]);router[_0xdcc8('0x8')](_0xdcc8('0x2c'),auth['isAuthenticated'](),controller[_0xdcc8('0x2d')]);router[_0xdcc8('0x8')](_0xdcc8('0x2e'),auth[_0xdcc8('0xb')](),controller['getMailAccounts']);router['get'](_0xdcc8('0x2f'),auth[_0xdcc8('0xb')](),controller['getOpenchannelAccounts']);router[_0xdcc8('0x8')]('/:id/sms_accounts',auth[_0xdcc8('0xb')](),controller['getSmsAccounts']);router[_0xdcc8('0x8')]('/:id/chat_websites',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x30')]);router[_0xdcc8('0x8')]('/:id/whatsapp_accounts',auth[_0xdcc8('0xb')](),controller['getWhatsappAccounts']);router[_0xdcc8('0x8')](_0xdcc8('0x31'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get'](_0xdcc8('0x32'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x33')]);router[_0xdcc8('0x34')](_0xdcc8('0x15'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x35')]);router[_0xdcc8('0x34')]('/',auth['isAuthenticated'](),controller[_0xdcc8('0x36')]);router['post']('/create_many',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x37')]);router['post'](_0xdcc8('0x38'),auth['isAuthenticated'](),controller[_0xdcc8('0x39')]);var upload=multer({'storage':multer[_0xdcc8('0x3a')]({'destination':function(_0xf55251,_0x462518,_0x1e1f04){_0x1e1f04(null,path['join'](config[_0xdcc8('0x3b')],'server/files/images/'));},'filename':function(_0x324c7c,_0x4d34f3,_0x3f80ca){_0x3f80ca(null,util[_0xdcc8('0x3c')](_0xdcc8('0x3d'),Date[_0xdcc8('0x3e')](),_0x4d34f3['originalname']));}})});router[_0xdcc8('0x34')](_0xdcc8('0x3f'),upload[_0xdcc8('0x40')](_0xdcc8('0x41')),controller['addAvatar']);router[_0xdcc8('0x34')]('/:id/login',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x42')]);router[_0xdcc8('0x34')]('/:id/logout',auth[_0xdcc8('0xb')](),controller['logout']);router[_0xdcc8('0x34')](_0xdcc8('0x43'),auth[_0xdcc8('0xb')](),controller['pause']);router[_0xdcc8('0x34')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router[_0xdcc8('0x34')]('/:id/teams',auth[_0xdcc8('0xb')](),controller['addTeams']);router[_0xdcc8('0x34')](_0xdcc8('0x44'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x45')]);router[_0xdcc8('0x34')](_0xdcc8('0x46'),auth[_0xdcc8('0xb')](),controller['addMailInteractions']);router['post'](_0xdcc8('0x47'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x48')]);router['post'](_0xdcc8('0x49'),auth[_0xdcc8('0xb')](),controller['addSmsInteractions']);router['post'](_0xdcc8('0x4a'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x4b')]);router['post'](_0xdcc8('0x4c'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x4d')]);router[_0xdcc8('0x34')](_0xdcc8('0x2c'),auth['isAuthenticated'](),controller[_0xdcc8('0x4e')]);router[_0xdcc8('0x34')](_0xdcc8('0x2e'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x4f')]);router[_0xdcc8('0x34')](_0xdcc8('0x2f'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x50')]);router[_0xdcc8('0x34')](_0xdcc8('0x51'),auth[_0xdcc8('0xb')](),controller['addSmsAccounts']);router[_0xdcc8('0x34')](_0xdcc8('0x52'),auth['isAuthenticated'](),controller[_0xdcc8('0x53')]);router[_0xdcc8('0x34')](_0xdcc8('0x54'),auth[_0xdcc8('0xb')](),controller['addWhatsappAccounts']);router[_0xdcc8('0x34')](_0xdcc8('0x32'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x55')]);router[_0xdcc8('0x56')](_0xdcc8('0x11'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x57')]);router['put'](_0xdcc8('0x58'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x59')]);router[_0xdcc8('0x5a')]('/:id/queues',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x5b')]);router[_0xdcc8('0x5a')]('/:id/teams',auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x5c')]);router[_0xdcc8('0x5a')](_0xdcc8('0x11'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x5d')]);router[_0xdcc8('0x5a')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xdcc8('0x5e')]);router[_0xdcc8('0x5a')](_0xdcc8('0x46'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x5f')]);router['delete']('/:id/fax_interactions',auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xdcc8('0x5a')](_0xdcc8('0x49'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x60')]);router[_0xdcc8('0x5a')]('/:id/openchannel_interactions',auth[_0xdcc8('0xb')](),controller['removeOpenchannelInteractions']);router[_0xdcc8('0x5a')](_0xdcc8('0x4c'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x61')]);router[_0xdcc8('0x5a')](_0xdcc8('0x2c'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x62')]);router[_0xdcc8('0x5a')](_0xdcc8('0x2e'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xdcc8('0x5a')](_0xdcc8('0x2f'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x63')]);router[_0xdcc8('0x5a')](_0xdcc8('0x51'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x64')]);router[_0xdcc8('0x5a')](_0xdcc8('0x52'),auth[_0xdcc8('0xb')](),controller[_0xdcc8('0x65')]);router[_0xdcc8('0x5a')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xdcc8('0x66')]);router[_0xdcc8('0x5a')](_0xdcc8('0x32'),auth['isAuthenticated'](),controller[_0xdcc8('0x67')]);module[_0xdcc8('0x68')]=router;
\ No newline at end of file
index 3721647..415bfef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x32f569,_0x1494c0){var _0x20cb49=function(_0x47cfd6){while(--_0x47cfd6){_0x32f569['push'](_0x32f569['shift']());}};_0x20cb49(++_0x1494c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0xcb91[_0x5ae8f7];return _0x54c636;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index acefbb3..ec661ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4167=['List','Tags','color','tag','Unknown\x20channel','Queue','order','sort','Unknown\x20role','nolimit','pick','getVoiceQueuesRt','getGroups','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','remoteAddress','socket','connection','destroy','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','MemberReport','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','Team','getTeams','addTeams','getAssociatedQueues','addAgent','Voice','penalty','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','getDataValue','TeamVoicePrefix','getLists','CmList','getAgents','values','addChatInteractions','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','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$or','$gte','$lt','$lte','$ne','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contained','firstName','lastName','CmContact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','apiKeyNonce','apiKeyIat','whoami','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','flatten','lower','col','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','QueryTypes','ui.','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','path','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','socket.io-emitter','redis','./user.socket','defaults','localhost','http','request','then','User,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','undefined','limit','count','offset','set','json','update','role','agent','emit','userNotification:recalc:','get','admin','Users','Agents','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','end','sendStatus','stack','index','User','rawAttributes','type','key','password','getOptions','where','query','includeAll','include','userSetting','attributes','rows','openTabs','true','dataValues','push','sms','fax','mail','openchannel','show','params','keys','salt','filters','intersection','model','fields','length','UserSetting','merge','options','chat','whatsapp','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','min_internal','isNil','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)','sequelize','SELECT','from','VoiceMail','email','permissions','101','102','103','113','110','105','106','109','111','115','create','Unauthorized','user','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','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','all','findAll','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','addQueues','channel','online','interface','add','capitalize','toLowerCase','Queues','spread','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','remove','isArray','Queue:remove','userpic','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','WhatsappOpenTabs','WHATSAPP','concat','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty'];(function(_0x32a1e0,_0x360ac4){var _0x1e341b=function(_0x5db68a){while(--_0x5db68a){_0x32a1e0['push'](_0x32a1e0['shift']());}};_0x1e341b(++_0x360ac4);}(_0x4167,0xb9));var _0x7416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4167[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7416('0x0'));var util=require('util');var path=require(_0x7416('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7416('0x2'));var jayson=require('jayson/promise');var Redis=require(_0x7416('0x3'));var authService=require(_0x7416('0x4'));var contacts=require(_0x7416('0x5'));var qs=require(_0x7416('0x6'));var logger=require(_0x7416('0x7'))(_0x7416('0x8'));var utils=require(_0x7416('0x9'));var config=require(_0x7416('0xa'));var licenseUtil=require(_0x7416('0xb'));var APIBadRequestError=require(_0x7416('0xc'))[_0x7416('0xd')];var APINotFoundError=require('../../errors/api')[_0x7416('0xe')];var APIHandleError=require(_0x7416('0xc'))[_0x7416('0xf')];var db=require('../../mysqldb')['db'];var socket=require(_0x7416('0x10'))(new Redis(config[_0x7416('0x11')]));require(_0x7416('0x12'))['register'](socket);config[_0x7416('0x11')]=_[_0x7416('0x13')](config[_0x7416('0x11')],{'host':_0x7416('0x14'),'port':0x18eb});var amiClient=jayson['client'][_0x7416('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x558352,_0x36108f,_0x63664e,_0x22508a){return new Promise(function(_0x5d6045,_0x3e9947){var _0x8cd237=_0x22508a||amiClient;return _0x8cd237[_0x7416('0x16')](_0x558352,_0x63664e)[_0x7416('0x17')](function(_0x2ab6e2){logger['info'](_0x7416('0x18'),_0x36108f,_0x7416('0x19'));logger[_0x7416('0x1a')]('User,\x20%s,\x20%s,\x20%s',_0x36108f,_0x7416('0x19'),JSON['stringify'](_0x2ab6e2));if(_0x2ab6e2[_0x7416('0x1b')]){if(_0x2ab6e2[_0x7416('0x1b')]['code']===0x1f4){logger['error'](_0x7416('0x18'),_0x36108f,_0x2ab6e2['error']['message']);return _0x3e9947(_0x2ab6e2[_0x7416('0x1b')][_0x7416('0x1c')]);}logger[_0x7416('0x1b')](_0x7416('0x18'),_0x36108f,_0x2ab6e2[_0x7416('0x1b')][_0x7416('0x1c')]);return _0x5d6045(_0x2ab6e2[_0x7416('0x1b')]['message']);}else{logger['info'](_0x7416('0x18'),_0x36108f,'request\x20sent');_0x5d6045(_0x2ab6e2[_0x7416('0x1d')]['message']);}})[_0x7416('0x1e')](function(_0x1438a3){logger[_0x7416('0x1b')](_0x7416('0x18'),_0x36108f,_0x1438a3);_0x3e9947(_0x1438a3);});});}function respondWithStatusCode(_0x2ef332,_0x16238f){_0x16238f=_0x16238f||0xcc;return function(_0x4cdc4e){if(_0x4cdc4e){return _0x2ef332['sendStatus'](_0x16238f);}return _0x2ef332[_0x7416('0x1f')](_0x16238f)['end']();};}function respondWithResult(_0x222e54,_0x39c46d){_0x39c46d=_0x39c46d||0xc8;return function(_0x3470a1){if(_0x3470a1){return _0x222e54[_0x7416('0x1f')](_0x39c46d)['json'](_0x3470a1);}};}function respondWithFilteredResult(_0x420b33,_0x59a62d){return function(_0x57554d){if(_0x57554d){var _0x9df866=typeof _0x59a62d['offset']===_0x7416('0x20')&&typeof _0x59a62d[_0x7416('0x21')]==='undefined';var _0xd79a69=_0x57554d[_0x7416('0x22')];var _0x9d262=_0x9df866?0x0:_0x59a62d[_0x7416('0x23')];var _0x332de8=_0x9df866?_0x57554d[_0x7416('0x22')]:_0x59a62d['offset']+_0x59a62d['limit'];var _0x3c59fc;if(_0x332de8>=_0xd79a69){_0x332de8=_0xd79a69;_0x3c59fc=0xc8;}else{_0x3c59fc=0xce;}_0x420b33[_0x7416('0x1f')](_0x3c59fc);return _0x420b33[_0x7416('0x24')]('Content-Range',_0x9d262+'-'+_0x332de8+'/'+_0xd79a69)[_0x7416('0x25')](_0x57554d);}return null;};}function saveUpdates(_0x298915){return function(_0x3fe0bd){if(_0x3fe0bd){return _0x3fe0bd[_0x7416('0x26')](_0x298915)[_0x7416('0x17')](function(_0x2e5af8){if(_0x2e5af8[_0x7416('0x27')]===_0x7416('0x28')){socket[_0x7416('0x29')](_0x7416('0x2a')+_0x2e5af8['id'],_0x2e5af8);}return _0x2e5af8;});}return null;};}function removeEntity(_0x1f18ee){return function(_0x11e6ef){if(_0x11e6ef){return _0x11e6ef['destroy']()[_0x7416('0x17')](function(){var _0x60d26e=_0x11e6ef[_0x7416('0x2b')]({'plain':!![]});if(_0x60d26e['role']===_0x7416('0x2c'))return;var _0x2d8eca=[{'name':_0x7416('0x2d'),'value':'user','ignore':!![]},{'name':_0x7416('0x2e'),'value':_0x7416('0x28'),'ignore':![]},{'name':'Telephones','value':_0x7416('0x2f'),'ignore':![]}];var _0x37106e=_(_0x2d8eca)[_0x7416('0x30')](_0x7416('0x31'))[_0x7416('0x32')]('value')[_0x7416('0x33')]();if(_[_0x7416('0x34')](_0x37106e,_0x60d26e[_0x7416('0x27')])){return;}var _0x424c98=_[_0x7416('0x35')](_0x2d8eca,[_0x7416('0x33'),_0x60d26e[_0x7416('0x27')]])[_0x7416('0x36')];return db[_0x7416('0x37')]['destroy']({'where':{'type':_0x424c98,'resourceId':_0x60d26e['id']}})[_0x7416('0x17')](function(){return _0x11e6ef;});})[_0x7416('0x17')](function(){_0x1f18ee[_0x7416('0x1f')](0xcc)[_0x7416('0x38')]();});}};}function handleEntityNotFound(_0x280ceb){return function(_0x21fdbc){if(!_0x21fdbc){_0x280ceb[_0x7416('0x39')](0x194);}return _0x21fdbc;};}function handleError(_0x4aad58,_0x45584f){_0x45584f=_0x45584f||0x1f4;return function(_0x4ba551){logger[_0x7416('0x1b')](_0x4ba551[_0x7416('0x3a')]);if(_0x4ba551[_0x7416('0x36')]){delete _0x4ba551[_0x7416('0x36')];}_0x4aad58[_0x7416('0x1f')](_0x45584f)['send'](_0x4ba551);};}exports[_0x7416('0x3b')]=function(_0x1bedb5,_0x41ffae){var _0x2cc14={},_0x1d63e6={'count':0x0,'rows':[]};var _0x448634=_(db[_0x7416('0x3c')][_0x7416('0x3d')])[_0x7416('0x32')](function(_0x4a0b15){return{'name':_0x4a0b15['fieldName'],'type':_0x4a0b15[_0x7416('0x3e')][_0x7416('0x3f')]};})['filter'](function(_0xce1e7){return!_['includes']([_0x7416('0x40'),'salt'],_0xce1e7['name']);})[_0x7416('0x33')]();_0x2cc14=qs[_0x7416('0x41')](_0x448634,_0x1bedb5);var _0x320352={'where':_0x2cc14[_0x7416('0x42')]};return db[_0x7416('0x3c')][_0x7416('0x22')](_0x320352)[_0x7416('0x17')](function(_0x43423d){_0x1d63e6[_0x7416('0x22')]=_0x43423d;if(_0x1bedb5[_0x7416('0x43')][_0x7416('0x44')]){_0x2cc14[_0x7416('0x45')]=[{'all':!![]}];}if(_0x1bedb5['query'][_0x7416('0x46')]==='true'){_0x2cc14[_0x7416('0x45')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x7416('0x34')](_0x2cc14['attributes'],'id')){_0x2cc14[_0x7416('0x47')]['push']('id');}return db['User']['findAll'](_0x2cc14);})[_0x7416('0x17')](function(_0x3877c2){_0x1d63e6[_0x7416('0x48')]=_0x3877c2;if(_0x1bedb5[_0x7416('0x43')][_0x7416('0x49')]===_0x7416('0x4a')){var _0x55b964=[];for(var _0x52513c=0x0;_0x52513c<_0x1d63e6[_0x7416('0x48')]['length'];_0x52513c++){_0x55b964['push'](get_open_tabs('chat',_0x1d63e6[_0x7416('0x48')][_0x52513c][_0x7416('0x4b')]));_0x55b964[_0x7416('0x4c')](get_open_tabs(_0x7416('0x4d'),_0x1d63e6['rows'][_0x52513c][_0x7416('0x4b')]));_0x55b964[_0x7416('0x4c')](get_open_tabs(_0x7416('0x4e'),_0x1d63e6[_0x7416('0x48')][_0x52513c][_0x7416('0x4b')]));_0x55b964[_0x7416('0x4c')](get_open_tabs(_0x7416('0x4f'),_0x1d63e6['rows'][_0x52513c][_0x7416('0x4b')]));_0x55b964[_0x7416('0x4c')](get_open_tabs(_0x7416('0x50'),_0x1d63e6[_0x7416('0x48')][_0x52513c]['dataValues']));_0x55b964[_0x7416('0x4c')](get_open_tabs('whatsapp',_0x1d63e6[_0x7416('0x48')][_0x52513c]['dataValues']));}return Promise['all'](_0x55b964)[_0x7416('0x17')](function(){return _0x1d63e6;});}else{return _0x1d63e6;}})[_0x7416('0x17')](respondWithFilteredResult(_0x41ffae,_0x2cc14))[_0x7416('0x1e')](handleError(_0x41ffae,null));};exports[_0x7416('0x51')]=function(_0x3db39d,_0x50d1da){var _0x2250c8={'raw':![],'where':{'id':_0x3db39d[_0x7416('0x52')]['id']}},_0x35956a={};_0x35956a['model']=_['differenceBy'](_[_0x7416('0x53')](db['User'][_0x7416('0x3d')]),[_0x7416('0x40'),_0x7416('0x54')]);_0x35956a[_0x7416('0x43')]=_[_0x7416('0x53')](_0x3db39d[_0x7416('0x43')]);_0x35956a[_0x7416('0x55')]=_[_0x7416('0x56')](_0x35956a['model'],_0x35956a[_0x7416('0x43')]);_0x2250c8[_0x7416('0x47')]=_[_0x7416('0x56')](_0x35956a[_0x7416('0x57')],qs[_0x7416('0x58')](_0x3db39d[_0x7416('0x43')][_0x7416('0x58')]));_0x2250c8[_0x7416('0x47')]=_0x2250c8[_0x7416('0x47')][_0x7416('0x59')]?_0x2250c8[_0x7416('0x47')]:_0x35956a['model'];if(_0x3db39d[_0x7416('0x43')][_0x7416('0x44')]){_0x2250c8[_0x7416('0x45')]=[{'all':!![]}];}if(_0x3db39d['query'][_0x7416('0x46')]===_0x7416('0x4a')){_0x2250c8[_0x7416('0x45')]=[{'model':db[_0x7416('0x5a')],'as':_0x7416('0x46')}];}_0x2250c8=_[_0x7416('0x5b')]({},_0x2250c8,_0x3db39d[_0x7416('0x5c')]);if(!_['includes'](_0x2250c8['attributes'],'id')){_0x2250c8['attributes'][_0x7416('0x4c')]('id');}return db['User'][_0x7416('0x35')](_0x2250c8)[_0x7416('0x17')](handleEntityNotFound(_0x50d1da,null))[_0x7416('0x17')](function(_0x2f938b){var _0x2995f5=[];values=_0x2f938b;if(_0x3db39d[_0x7416('0x43')][_0x7416('0x49')]==='true'){_0x2995f5[_0x7416('0x4c')](get_open_tabs(_0x7416('0x5d'),_0x2f938b['dataValues']));_0x2995f5[_0x7416('0x4c')](get_open_tabs(_0x7416('0x4d'),_0x2f938b[_0x7416('0x4b')]));_0x2995f5['push'](get_open_tabs(_0x7416('0x50'),_0x2f938b['dataValues']));_0x2995f5[_0x7416('0x4c')](get_open_tabs(_0x7416('0x5e'),_0x2f938b['dataValues']));_0x2995f5['push'](get_open_tabs('fax',_0x2f938b[_0x7416('0x4b')]));_0x2995f5['push'](get_open_tabs('mail',_0x2f938b[_0x7416('0x4b')]));return Promise['all'](_0x2995f5);}else{return values;}})['then'](function(){return values;})[_0x7416('0x17')](respondWithResult(_0x50d1da,null))[_0x7416('0x1e')](handleError(_0x50d1da,null));};exports[_0x7416('0x26')]=function(_0x1fbebd,_0x30cced){if(_0x1fbebd[_0x7416('0x5f')]['id']){delete _0x1fbebd[_0x7416('0x5f')]['id'];}delete _0x1fbebd[_0x7416('0x5f')][_0x7416('0x27')];return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x1fbebd['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x30cced,null))['then'](saveUpdates(_0x1fbebd[_0x7416('0x5f')],null))[_0x7416('0x17')](respondWithResult(_0x30cced,null))['catch'](handleError(_0x30cced,null));};exports['describe']=function(_0x41561,_0x1fd1f3){return db['User'][_0x7416('0x60')]()[_0x7416('0x17')](respondWithResult(_0x1fd1f3,null))[_0x7416('0x1e')](handleError(_0x1fd1f3,null));};exports[_0x7416('0x61')]=function(_0x33c994,_0xe0d422){return db['User'][_0x7416('0x35')]({'where':{'id':_0x33c994[_0x7416('0x52')]['id']}})['then'](handleEntityNotFound(_0xe0d422,null))[_0x7416('0x17')](function(_0x1b884a){if(_0x1b884a){return _0x1b884a[_0x7416('0x61')](_0x33c994[_0x7416('0x5f')][_0x7416('0x62')],_[_0x7416('0x63')](_0x33c994[_0x7416('0x5f')],[_0x7416('0x62'),'id'])||{});}})['then'](respondWithResult(_0xe0d422,null))[_0x7416('0x1e')](handleError(_0xe0d422,null));};function validateUser(_0x2c76de){return new Promise(function(_0x1264a2,_0x44db57){if(_0x2c76de[_0x7416('0x64')])return _0x1264a2(_0x2c76de);return db['Setting'][_0x7416('0x65')](0x1)[_0x7416('0x17')](function(_0xb75a30){if(_0xb75a30[_0x7416('0x66')])authService[_0x7416('0x67')](_0x2c76de[_0x7416('0x40')]);db[_0x7416('0x3c')][_0x7416('0x68')](_0x7416('0x64'))[_0x7416('0x17')](function(_0x3dd326){if(_['isNil'](_0x3dd326)){_0x2c76de['internal']=_0xb75a30[_0x7416('0x69')]||0x1;return;}if(_[_0x7416('0x6a')](_0xb75a30['min_internal'])||_0xb75a30[_0x7416('0x69')]===_0x3dd326){_0x2c76de[_0x7416('0x64')]=_0x3dd326+0x1;return;}if(_0xb75a30[_0x7416('0x69')]>_0x3dd326){_0x2c76de['internal']=_0xb75a30[_0x7416('0x69')];return;}return db['sequelize']['query'](_0x7416('0x6b'),{'type':db[_0x7416('0x6c')]['QueryTypes'][_0x7416('0x6d')]})['then'](function(_0x327f21){if(_0x327f21&&_0x327f21[_0x7416('0x59')]){for(var _0x492102=0x0,_0x2c2491=_0x327f21[_0x7416('0x59')];_0x492102<_0x2c2491&&_['isNil'](_0x2c76de[_0x7416('0x64')]);_0x492102++){if(_0xb75a30['min_internal']<=_0x327f21[_0x492102][_0x7416('0x6e')]){_0x2c76de[_0x7416('0x64')]=_0x327f21[_0x492102][_0x7416('0x6e')];}else if(_0xb75a30[_0x7416('0x69')]>_0x327f21[_0x492102][_0x7416('0x6e')]&&_0xb75a30[_0x7416('0x69')]<=_0x327f21[_0x492102]['to']){_0x2c76de[_0x7416('0x64')]=_0xb75a30['min_internal'];}}}if(_[_0x7416('0x6a')](_0x2c76de[_0x7416('0x64')])){_0x2c76de[_0x7416('0x64')]=_0x3dd326+0x1;}return _0x1264a2(_0x2c76de);});});})['catch'](function(_0x23d1d4){_0x44db57(_0x23d1d4);});});}function updateUser(_0x55f8b7){return new Promise(function(_0x51ee20,_0x4a6aae){try{if(_0x55f8b7['voicemail']){_0x55f8b7['mailbox']=_0x55f8b7[_0x7416('0x64')];_0x55f8b7[_0x7416('0x6f')]={'mailbox':_0x55f8b7[_0x7416('0x64')],'password':_0x55f8b7[_0x7416('0x40')],'fullname':_0x55f8b7['fullname'],'email':_0x55f8b7[_0x7416('0x70')]};}if(_0x55f8b7[_0x7416('0x27')]===_0x7416('0x28')){if(!_0x55f8b7[_0x7416('0x71')])_0x55f8b7[_0x7416('0x71')]=[_0x7416('0x72'),_0x7416('0x73'),_0x7416('0x74'),_0x7416('0x75'),_0x7416('0x76'),'104',_0x7416('0x77'),_0x7416('0x78'),'107','108',_0x7416('0x79'),'100',_0x7416('0x7a'),'114',_0x7416('0x7b')];}_0x51ee20(_0x55f8b7);}catch(_0x1a6d7c){_0x4a6aae(_0x1a6d7c);}});}exports[_0x7416('0x7c')]=function(_0x4af6af,_0x20c046){if(_0x4af6af['user'][_0x7416('0x27')]===_0x7416('0x28'))throw new Error(_0x7416('0x7d'));if(_0x4af6af['body'][_0x7416('0x27')]===_0x7416('0x7e')&&_0x4af6af['user'][_0x7416('0x27')]!=='admin'){throw new Error(_0x7416('0x7f'));}if(_0x4af6af[_0x7416('0x5f')][_0x7416('0x27')]===_0x7416('0x2c')&&_0x4af6af[_0x7416('0x7e')][_0x7416('0x27')]!==_0x7416('0x2c')){throw new Error(_0x7416('0x80'));}return licenseUtil[_0x7416('0x81')]([_0x4af6af['body']])[_0x7416('0x17')](function(){return validateUser(_0x4af6af[_0x7416('0x5f')]);})[_0x7416('0x17')](function(_0x56da6f){return updateUser(_0x56da6f)[_0x7416('0x17')](function(_0x19b68d){if(_0x19b68d[_0x7416('0x27')]===_0x7416('0x2c')){_0x19b68d[_0x7416('0x82')]=_0x4af6af[_0x7416('0x7e')][_0x7416('0x82')];delete _0x19b68d[_0x7416('0x83')];}return _0x19b68d;});})[_0x7416('0x17')](function(_0x1a1ed8){return db[_0x7416('0x3c')]['create'](_0x1a1ed8,{'include':[{'model':db[_0x7416('0x6f')],'as':_0x7416('0x6f')}]});})[_0x7416('0x17')](function(_0xeca4b2){if(_0x4af6af['body'][_0x7416('0x27')]===_0x7416('0x7e'))return _0xeca4b2;if(_0x4af6af[_0x7416('0x7e')][_0x7416('0x27')]!==_0x7416('0x7e'))return _0xeca4b2;return db[_0x7416('0x84')][_0x7416('0x35')]({'where':{'name':_0xeca4b2['role']===_0x7416('0x28')?'Agents':_0x7416('0x85'),'userProfileId':_0x4af6af[_0x7416('0x7e')][_0x7416('0x83')]},'raw':!![]})[_0x7416('0x17')](function(_0x21c15f){if(!_0x21c15f||_0x21c15f[_0x7416('0x86')]!=0x0)return _0xeca4b2;return db[_0x7416('0x37')]['create']({'name':_0xeca4b2[_0x7416('0x36')],'resourceId':_0xeca4b2['id'],'type':_0x21c15f['name'],'sectionId':_0x21c15f['id']},{})['then'](function(){return _0xeca4b2;});})[_0x7416('0x1e')](function(_0x266777){logger['error'](_0x7416('0x87'),_0x266777);throw _0x266777;});})[_0x7416('0x17')](respondWithResult(_0x20c046,0xc9))[_0x7416('0x1e')](handleError(_0x20c046,null));};exports[_0x7416('0x88')]=function(_0x3bf7e0,_0xa93371){var _0x3df23d=_0x3bf7e0[_0x7416('0x5f')];var _0x44ce0a=[];if(_0x3bf7e0['user'][_0x7416('0x27')]===_0x7416('0x28'))throw new Error(_0x7416('0x7d'));if(_['some'](_0x3df23d,[_0x7416('0x27'),'user'])&&_0x3bf7e0['user'][_0x7416('0x27')]!==_0x7416('0x2c')){throw new Error(_0x7416('0x7f'));}if(_[_0x7416('0x89')](_0x3df23d,[_0x7416('0x27'),'admin'])&&_0x3bf7e0[_0x7416('0x7e')]['role']!==_0x7416('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x7416('0x81')](_0x3df23d)[_0x7416('0x17')](function(){return validateUser(_0x3df23d[0x0]);})[_0x7416('0x17')](function(){for(var _0x362ee9=0x1;_0x362ee9<_0x3df23d[_0x7416('0x59')];_0x362ee9++){var _0x19bb71=_0x3df23d[_0x362ee9-0x1][_0x7416('0x64')];if(!_0x3df23d[_0x362ee9][_0x7416('0x64')])_0x3df23d[_0x362ee9][_0x7416('0x64')]=_0x19bb71+0x1;_0x44ce0a['push'](validateUser(_0x3df23d[_0x362ee9]));}return Promise[_0x7416('0x8a')](_0x44ce0a);})[_0x7416('0x17')](function(){_0x44ce0a=[];for(var _0x1cec3a=0x0;_0x1cec3a<_0x3df23d['length'];_0x1cec3a++){_0x44ce0a['push'](updateUser(_0x3df23d[_0x1cec3a]));}return Promise['all'](_0x44ce0a);})[_0x7416('0x17')](function(){_0x44ce0a=_0x3df23d[_0x7416('0x32')](function(_0x384a59){return db[_0x7416('0x3c')][_0x7416('0x7c')](_0x384a59,{'include':[{'model':db[_0x7416('0x6f')],'as':_0x7416('0x6f')}]})[_0x7416('0x17')](function(_0x2d03c5){_0x384a59['id']=_0x2d03c5['id'];return _0x384a59;});});return Promise[_0x7416('0x8a')](_0x44ce0a);})[_0x7416('0x17')](function(_0x44ae99){if(_0x3bf7e0[_0x7416('0x5f')][_0x7416('0x27')]===_0x7416('0x7e'))return _0x44ae99;if(_0x3bf7e0[_0x7416('0x7e')][_0x7416('0x27')]!==_0x7416('0x7e'))return _0x44ae99;var _0x5dfa2a=_['some'](_0x44ae99,function(_0x132903){return _0x132903[_0x7416('0x27')]===_0x7416('0x28')||_0x132903['role']===_0x7416('0x2f');});if(!_0x5dfa2a)return _0x44ae99;return db[_0x7416('0x84')][_0x7416('0x8b')]({'where':{'name':{'$or':[_0x7416('0x2e'),'Telephones']},'userProfileId':_0x3bf7e0['user']['userProfileId']},'raw':!![]})[_0x7416('0x17')](function(_0x1ded5d){if(_[_0x7416('0x8c')](_0x1ded5d)||!_[_0x7416('0x89')](_0x1ded5d,[_0x7416('0x86'),0x0]))return _0x44ae99;_0x44ce0a=[];var _0x85b143=_(_0x1ded5d)[_0x7416('0x32')](function(_0x4d78d2){if(_0x4d78d2['autoAssociation']===0x1)return;return _0x4d78d2[_0x7416('0x36')]===_0x7416('0x2e')?_0x7416('0x28'):_0x7416('0x2f');})[_0x7416('0x8d')]()['value']();for(var _0x5ca5e2=0x0;_0x5ca5e2<_0x44ae99[_0x7416('0x59')];_0x5ca5e2++){if(!_[_0x7416('0x34')](_0x85b143,_0x44ae99[_0x5ca5e2][_0x7416('0x27')]))return;var _0x5297e4=_0x44ae99[_0x5ca5e2][_0x7416('0x27')]===_0x7416('0x28')?'Agents':_0x7416('0x85');_0x44ce0a[_0x7416('0x4c')](db['UserProfileResource'][_0x7416('0x7c')]({'name':_0x44ae99[_0x5ca5e2][_0x7416('0x36')],'resourceId':_0x44ae99[_0x5ca5e2]['id'],'type':_0x5297e4,'sectionId':_[_0x7416('0x35')](_0x1ded5d,[_0x7416('0x36'),_0x5297e4])['id']},{}));}return Promise[_0x7416('0x8a')](_0x44ce0a);});})[_0x7416('0x17')](respondWithResult(_0xa93371,0xc9))[_0x7416('0x1e')](handleError(_0xa93371,null));};exports['changePassword']=function(_0x39269f,_0x510f18){if(_0x39269f['body']['id']){delete _0x39269f[_0x7416('0x5f')]['id'];}return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x39269f['params']['id']}})['then'](function(_0x5028b3){if(!_0x5028b3)return null;if(_0x5028b3['id']===_0x39269f[_0x7416('0x7e')]['id']){if(!_0x39269f[_0x7416('0x5f')][_0x7416('0x8e')]||!_0x39269f[_0x7416('0x5f')][_0x7416('0x8f')]){throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))](_0x7416('0x92'));}if(!_0x5028b3['authenticate'](_0x39269f[_0x7416('0x5f')][_0x7416('0x8e')])){throw new db[(_0x7416('0x90'))]['ValidationError'](_0x7416('0x93'));}if(_0x39269f[_0x7416('0x5f')][_0x7416('0x8e')]===_0x39269f['body']['newPassword']){throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))](_0x7416('0x94'));}}else if(_0x39269f[_0x7416('0x7e')][_0x7416('0x27')]==='admin'){if(!_0x39269f[_0x7416('0x5f')][_0x7416('0x8f')]){throw new db[(_0x7416('0x90'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x39269f[_0x7416('0x7e')]['role']===_0x7416('0x7e')){if(!_0x39269f['body'][_0x7416('0x8f')]){throw new db['Sequelize']['ValidationError'](_0x7416('0x95'));}if(_0x5028b3[_0x7416('0x27')]!==_0x7416('0x28')){throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))](_0x7416('0x7d'));}}else{throw new db['Sequelize'][(_0x7416('0x91'))]('Unauthorized');}return _0x5028b3;})[_0x7416('0x17')](handleEntityNotFound(_0x510f18,null))['then'](function(_0x4e847a){return db[_0x7416('0x96')][_0x7416('0x97')]({'attributes':['id',_0x7416('0x66'),_0x7416('0x98'),_0x7416('0x99')]})['then'](function(_0xd707e6){if(_0xd707e6[_0x7416('0x66')])authService[_0x7416('0x67')](_0x39269f[_0x7416('0x5f')][_0x7416('0x8f')]);if(!_0xd707e6[_0x7416('0x98')]||!_0x4e847a[_0x7416('0x9a')])return _0x4e847a;authService['validatePasswordHistory'](_0x39269f['body'][_0x7416('0x8f')],_0x4e847a[_0x7416('0x9a')],_0xd707e6[_0x7416('0x99')]);return _0x4e847a;})[_0x7416('0x17')](saveUpdates({'password':_0x39269f['body'][_0x7416('0x8f')],'passwordResetAt':_0x39269f['user']['id']==_0x39269f[_0x7416('0x52')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x39269f[_0x7416('0x5f')][_0x7416('0x8f')],_0x4e847a[_0x7416('0x9a')])},null));})[_0x7416('0x17')](respondWithResult(_0x510f18,null))['catch'](handleError(_0x510f18,null));};exports[_0x7416('0x9b')]=function(_0x4138df,_0xe9c236){var _0xf067af=_0x4138df[_0x7416('0x5f')][_0x7416('0x9c')];return db[_0x7416('0x3c')]['find']({'where':{'id':_0x4138df[_0x7416('0x52')]['id']},'attributes':['id',_0x7416('0x36'),_0x7416('0x27'),_0x7416('0x9d'),'loginInPause','voicePause',_0x7416('0x9e')]})['then'](handleEntityNotFound(_0xe9c236,null))[_0x7416('0x17')](function(_0x52266a){if(_0x52266a){if(!utils['isValidChannel'](_0xf067af)){throw new db['Sequelize'][(_0x7416('0x91'))]('Unknown\x20channel');}return _0x52266a[_0x7416('0x9f')+_[_0x7416('0xa0')](_0xf067af[_0x7416('0xa1')]())+_0x7416('0xa2')](_0x4138df[_0x7416('0x5f')][_0x7416('0x62')],{'penalty':_0x4138df[_0x7416('0x5f')]['penalty']||0x0})[_0x7416('0xa3')](function(_0x26ccd2){for(var _0x13336e=0x0;_0x13336e<_0x4138df['body']['ids'][_0x7416('0x59')];_0x13336e+=0x1){var _0x3e587c={'UserId':Number(_0x4138df['params']['id'])};_0x3e587c[_['capitalize'](_0xf067af[_0x7416('0xa1')]())+_0x7416('0xa4')]=Number(_0x4138df['body'][_0x7416('0x62')][_0x13336e]);socket['emit'](_0x7416('0x7e')+_[_0x7416('0xa0')](_0xf067af[_0x7416('0xa1')]())+_0x7416('0xa5'),_0x3e587c);}return _0x26ccd2;})['then'](function(){if(_0xf067af===_0x7416('0xa6')){return db[_0x7416('0xa7')]['findAll']({'where':{'id':_0x4138df[_0x7416('0x5f')][_0x7416('0x62')]||[]},'raw':!![],'attributes':['id',_0x7416('0x36')]});}})['then'](function(_0x1cfd57){var _0x509841=_0x52266a['get']({'plain':!![]});var _0x32dfe9=[];if(_0xf067af===_0x7416('0xa6')&&_0x509841[_0x7416('0x27')]===_0x7416('0x28')&&_0x509841[_0x7416('0x9d')]){for(let _0x160309=0x0;_0x160309<_0x1cfd57[_0x7416('0x59')];_0x160309+=0x1){_0x32dfe9['push']({'membername':_0x509841['name'],'UserId':_0x509841['id'],'queue_name':_0x1cfd57[_0x160309][_0x7416('0x36')],'VoiceQueueId':_0x1cfd57[_0x160309]['id'],'interface':_[_0x7416('0x6a')](_0x509841[_0x7416('0x9e')])?util[_0x7416('0xa8')](_0x7416('0xa9'),_0x509841[_0x7416('0x36')]):_0x509841['interface'],'paused':_0x509841[_0x7416('0xaa')]||![],'penalty':_0x4138df[_0x7416('0x5f')]['penalty']||0x0});}return Promise[_0x7416('0x8a')](_0x32dfe9['map'](function(_0x4cdf21){return db[_0x7416('0xab')][_0x7416('0xac')](_0x4cdf21);}));}return _0x52266a;});}})[_0x7416('0x17')](respondWithStatusCode(_0xe9c236,null))['catch'](handleError(_0xe9c236,null));};exports[_0x7416('0xad')]=function(_0x19ccac,_0x2cf80a){var _0x3a1918,_0x140699;return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x19ccac[_0x7416('0x52')]['id']},'attributes':['id',_0x7416('0x36'),_0x7416('0x27')]})['then'](handleEntityNotFound(_0x2cf80a,null))[_0x7416('0x17')](function(_0x440c1e){if(_0x440c1e){_0x3a1918=_0x440c1e;if(!_0x19ccac[_0x7416('0x43')][_0x7416('0x9c')]||!utils[_0x7416('0xae')](_0x19ccac[_0x7416('0x43')]['channel'])){throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))]('Unknown\x20channel');}return _0x440c1e[_0x7416('0xaf')+_[_0x7416('0xa0')](_0x19ccac['query']['channel'][_0x7416('0xa1')]())+_0x7416('0xa2')](_0x19ccac[_0x7416('0x43')][_0x7416('0x62')]);}})['then'](function(_0x1c1276){if(_[_0x7416('0xb0')](_0x19ccac[_0x7416('0x43')]['ids'])){for(var _0x5d0189=0x0;_0x5d0189<_0x19ccac['query'][_0x7416('0x62')][_0x7416('0x59')];_0x5d0189+=0x1){_0x140699={'UserId':Number(_0x19ccac['params']['id'])};_0x140699[_[_0x7416('0xa0')](_0x19ccac[_0x7416('0x43')][_0x7416('0x9c')]['toLowerCase']())+_0x7416('0xa4')]=Number(_0x19ccac[_0x7416('0x43')]['ids'][_0x5d0189]);socket[_0x7416('0x29')](_0x7416('0x7e')+_[_0x7416('0xa0')](_0x19ccac[_0x7416('0x43')][_0x7416('0x9c')][_0x7416('0xa1')]())+_0x7416('0xb1'),_0x140699);}}else{_0x140699={'UserId':Number(_0x19ccac['params']['id'])};_0x140699[_[_0x7416('0xa0')](_0x19ccac[_0x7416('0x43')][_0x7416('0x9c')]['toLowerCase']())+_0x7416('0xa4')]=Number(_0x19ccac[_0x7416('0x43')]['ids']);socket[_0x7416('0x29')](_0x7416('0x7e')+_[_0x7416('0xa0')](_0x19ccac[_0x7416('0x43')]['channel'][_0x7416('0xa1')]())+_0x7416('0xb1'),_0x140699);}return _0x1c1276;})[_0x7416('0x17')](function(){if(_0x19ccac['query'][_0x7416('0x9c')]===_0x7416('0xa6')){return db[_0x7416('0xab')]['destroy']({'where':{'UserId':_0x19ccac[_0x7416('0x52')]['id'],'VoiceQueueId':_0x19ccac[_0x7416('0x43')]['ids']},'individualHooks':!![]})[_0x7416('0x17')](function(){return _0x3a1918;});}return _0x3a1918;})[_0x7416('0x17')](respondWithStatusCode(_0x2cf80a,null))[_0x7416('0x1e')](handleError(_0x2cf80a,null));};exports['addAvatar']=function(_0x479cd8,_0x894ca){_0x479cd8[_0x7416('0x5f')][_0x7416('0xb2')]=_0x479cd8['file'][_0x7416('0xb3')];return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x479cd8[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x894ca,null))[_0x7416('0x17')](saveUpdates(_0x479cd8[_0x7416('0x5f')],null))[_0x7416('0x17')](respondWithResult(_0x894ca,null))['catch'](handleError(_0x894ca,null));};exports[_0x7416('0xb4')]=function(_0x5c383c,_0x4ce505){var _0x7dc57e=path[_0x7416('0xb5')](config[_0x7416('0xb6')],_0x7416('0xb7'));return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x5c383c[_0x7416('0x52')]['id']},'attributes':['id',_0x7416('0xb2')],'raw':!![]})[_0x7416('0x17')](handleEntityNotFound(_0x4ce505,null))['then'](function(_0x257042){if(_0x257042){if(_[_0x7416('0x6a')](_0x257042[_0x7416('0xb2')])){return _0x4ce505[_0x7416('0xb8')](_0x7dc57e);}else{if(!fs[_0x7416('0xb9')](path[_0x7416('0xb5')](config['root'],_0x7416('0xba'),_0x257042['userpic']))){return _0x4ce505[_0x7416('0xb8')](_0x7dc57e);}return _0x4ce505['download'](path[_0x7416('0xb5')](config[_0x7416('0xb6')],_0x7416('0xba'),_0x257042[_0x7416('0xb2')]));}}})[_0x7416('0x1e')](handleError(_0x4ce505,null));};exports[_0x7416('0xbb')]=function(_0x23afb7,_0x172d70){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x23afb7[_0x7416('0x52')]['id']},'attributes':['id']})[_0x7416('0x17')](handleEntityNotFound(_0x172d70,null))['then'](function(_0x1534bf){var _0x405904=[];values=_0x1534bf[_0x7416('0x4b')];_0x405904['push'](get_open_tabs('chat',_0x1534bf[_0x7416('0x4b')]));_0x405904['push'](get_open_tabs('sms',_0x1534bf['dataValues']));_0x405904[_0x7416('0x4c')](get_open_tabs(_0x7416('0x50'),_0x1534bf[_0x7416('0x4b')]));_0x405904[_0x7416('0x4c')](get_open_tabs(_0x7416('0x5e'),_0x1534bf[_0x7416('0x4b')]));_0x405904['push'](get_open_tabs('fax',_0x1534bf[_0x7416('0x4b')]));_0x405904['push'](get_open_tabs(_0x7416('0x4f'),_0x1534bf[_0x7416('0x4b')]));return Promise['all'](_0x405904);})['then'](function(_0x428f2c){if(_0x428f2c){var _0x2795d5=_[_0x7416('0x32')](values[_0x7416('0xbc')],function(_0x49554f){return{'channel':_0x7416('0xbd'),'id':_0x49554f['id'],'createdAt':_0x49554f[_0x7416('0xbe')]};});var _0x338fc5=_[_0x7416('0x32')](values[_0x7416('0xbf')],function(_0x5336a7){return{'channel':_0x7416('0xc0'),'id':_0x5336a7['id'],'createdAt':_0x5336a7[_0x7416('0xbe')]};});var _0xe6ae5c=_[_0x7416('0x32')](values[_0x7416('0xc1')],function(_0x2c53f7){return{'channel':_0x7416('0xc2'),'id':_0x2c53f7['id'],'createdAt':_0x2c53f7[_0x7416('0xbe')]};});var _0x37e22a=_['map'](values[_0x7416('0xc3')],function(_0x2b6771){return{'channel':_0x7416('0xc4'),'id':_0x2b6771['id'],'createdAt':_0x2b6771[_0x7416('0xbe')]};});var _0x130da9=_[_0x7416('0x32')](values[_0x7416('0xc5')],function(_0x4ecf53){return{'channel':'SMS','id':_0x4ecf53['id'],'createdAt':_0x4ecf53['createdAt']};});var _0xc50890=_[_0x7416('0x32')](values[_0x7416('0xc6')],function(_0x43fcbb){return{'channel':_0x7416('0xc7'),'id':_0x43fcbb['id'],'createdAt':_0x43fcbb[_0x7416('0xbe')]};});var _0x4bd822=_[_0x7416('0xc8')](_0x2795d5,_0x338fc5,_0xe6ae5c,_0x37e22a,_0x130da9,_0xc50890);var _0xf0b127={'count':_0x4bd822[_0x7416('0x59')],'rows':_0x4bd822};return _0xf0b127;}else return null;})[_0x7416('0x17')](respondWithResult(_0x172d70,null))[_0x7416('0x1e')](handleError(_0x172d70,null));};exports['getContacts']=function(_0x5837ee,_0xbf5702){var _0x2659ce={};return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x5837ee['params']['id']}})[_0x7416('0x17')](function(_0x1d5e49){if(!_0x1d5e49){throw new APINotFoundError(util[_0x7416('0xa8')](_0x7416('0xc9'),_0x5837ee[_0x7416('0x52')]['id']));}return contacts['describe']();})[_0x7416('0x17')](function(_0x535fe0){_0x5837ee[_0x7416('0x43')][_0x7416('0x3c')]=_0x5837ee[_0x7416('0x52')]['id'];_0x2659ce=qs[_0x7416('0x41')](_0x535fe0,_0x5837ee);if(_0x5837ee['query'][_0x7416('0xca')](_0x7416('0x44'))){_0x2659ce[_0x7416('0x45')]=[{'model':db['CmList'],'as':_0x7416('0xcb'),'required':![]},{'model':db['Tag'],'as':_0x7416('0xcc'),'attributes':['id',_0x7416('0x36'),_0x7416('0xcd')],'where':_0x5837ee[_0x7416('0x43')][_0x7416('0xce')]?{'id':_0x5837ee[_0x7416('0x43')][_0x7416('0xce')]}:undefined,'required':_0x5837ee[_0x7416('0x43')]['tag']?!![]:![]}];}return contacts[_0x7416('0x8b')](_0x5837ee[_0x7416('0x43')],_0x5837ee[_0x7416('0x7e')],_0x2659ce,_0x535fe0);})[_0x7416('0x17')](respondWithFilteredResult(_0xbf5702,_0x2659ce))[_0x7416('0x1e')](APIHandleError(_0xbf5702));};exports['getQueues']=function(_0x1810d2,_0x58d123){var _0x41652c;var _0x3076d4={};var _0x54f70d;return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x1810d2[_0x7416('0x52')]['id']},'attributes':['id','name','role']})[_0x7416('0x17')](handleEntityNotFound(_0x58d123,null))[_0x7416('0x17')](function(_0x205e86){if(!utils[_0x7416('0xae')](_0x1810d2['query'][_0x7416('0x9c')])){throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))](_0x7416('0xcf'));}_0x41652c=_0x205e86;var _0x13307f={};_0x13307f[_0x7416('0x57')]=_[_0x7416('0x53')](db[_[_0x7416('0xa0')](_0x1810d2[_0x7416('0x43')][_0x7416('0x9c')])+_0x7416('0xd0')]['rawAttributes']);_0x13307f[_0x7416('0x43')]=_['keys'](_0x1810d2[_0x7416('0x43')]);_0x13307f[_0x7416('0x55')]=_[_0x7416('0x56')](_0x13307f[_0x7416('0x57')],_0x13307f['query']);_0x3076d4[_0x7416('0x47')]=_[_0x7416('0x56')](_0x13307f[_0x7416('0x57')],qs[_0x7416('0x58')](_0x1810d2[_0x7416('0x43')][_0x7416('0x58')]));_0x3076d4['attributes']=_0x3076d4[_0x7416('0x47')]['length']?_0x3076d4[_0x7416('0x47')]:_0x13307f['model'];_0x3076d4[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x1810d2['query']['sort']);_0x3076d4[_0x7416('0x42')]=qs[_0x7416('0x55')](_['pick'](_0x1810d2[_0x7416('0x43')],_0x13307f[_0x7416('0x55')]));if(_0x1810d2[_0x7416('0x43')]['filter']){_0x3076d4[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x3076d4[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x3076d4[_0x7416('0x47')],function(_0xea3593){var _0x326b2b={};_0x326b2b[_0xea3593]={'$like':'%'+_0x1810d2[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x326b2b;})});}_0x3076d4=_[_0x7416('0x5b')]({},_0x3076d4,_0x1810d2[_0x7416('0x5c')]);switch(_0x41652c[_0x7416('0x27')]){case'admin':return db[_[_0x7416('0xa0')](_0x1810d2[_0x7416('0x43')][_0x7416('0x9c')])+_0x7416('0xd0')][_0x7416('0x8b')](_0x3076d4);case'user':case _0x7416('0x28'):return _0x41652c[_0x7416('0x2b')+_[_0x7416('0xa0')](_0x1810d2[_0x7416('0x43')][_0x7416('0x9c')])+_0x7416('0xa2')](_0x3076d4);default:throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))](_0x7416('0xd3'));}})[_0x7416('0x17')](function(_0x1714fd){_0x54f70d=_0x1714fd[_0x7416('0x59')];if(!_0x1810d2['query'][_0x7416('0xca')](_0x7416('0xd4'))){_0x3076d4[_0x7416('0x21')]=qs['limit'](_0x1810d2[_0x7416('0x43')][_0x7416('0x21')]);_0x3076d4['offset']=qs[_0x7416('0x23')](_0x1810d2[_0x7416('0x43')][_0x7416('0x23')]);}switch(_0x41652c[_0x7416('0x27')]){case'admin':return db[_[_0x7416('0xa0')](_0x1810d2['query']['channel'])+_0x7416('0xd0')][_0x7416('0x8b')](_0x3076d4);case _0x7416('0x7e'):case _0x7416('0x28'):return _0x41652c[_0x7416('0x2b')+_[_0x7416('0xa0')](_0x1810d2[_0x7416('0x43')][_0x7416('0x9c')])+_0x7416('0xa2')](_0x3076d4);}})[_0x7416('0x17')](function(_0x2cc567){return{'count':_0x54f70d,'rows':_0x2cc567};})[_0x7416('0x17')](respondWithResult(_0x58d123,null))['catch'](handleError(_0x58d123,null));};exports['getVoiceQueuesRt']=function(_0x5c2684,_0x203b96){var _0x2254c2={};var _0x6b1ac0={};var _0x7c2e75;var _0x2ae802;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x5c2684['params']['id']}})['then'](handleEntityNotFound(_0x203b96,null))[_0x7416('0x17')](function(_0x407d50){if(_0x407d50){_0x7c2e75=_0x407d50;_0x6b1ac0['model']=_[_0x7416('0x53')](db[_0x7416('0xab')][_0x7416('0x3d')]);_0x6b1ac0[_0x7416('0x43')]=_[_0x7416('0x53')](_0x5c2684['query']);_0x6b1ac0[_0x7416('0x55')]=_['intersection'](_0x6b1ac0[_0x7416('0x57')],_0x6b1ac0[_0x7416('0x43')]);_0x2254c2[_0x7416('0x47')]=_['intersection'](_0x6b1ac0[_0x7416('0x57')],qs['fields'](_0x5c2684['query'][_0x7416('0x58')]));_0x2254c2[_0x7416('0x47')]=_0x2254c2[_0x7416('0x47')][_0x7416('0x59')]?_0x2254c2[_0x7416('0x47')]:_0x6b1ac0['model'];_0x2254c2['order']=qs[_0x7416('0xd2')](_0x5c2684[_0x7416('0x43')][_0x7416('0xd2')]);_0x2254c2['where']=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x5c2684[_0x7416('0x43')],_0x6b1ac0['filters']));if(_0x5c2684[_0x7416('0x43')][_0x7416('0x30')]){_0x2254c2[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x2254c2[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x2254c2['attributes'],function(_0x13163e){var _0x57a038={};_0x57a038[_0x13163e]={'$like':'%'+_0x5c2684['query']['filter']+'%'};return _0x57a038;})});}_0x2254c2=_['merge']({},_0x2254c2,_0x5c2684[_0x7416('0x5c')]);return _0x7c2e75[_0x7416('0xd6')](_0x2254c2);}})[_0x7416('0x17')](function(_0x599697){if(_0x599697){_0x2ae802=_0x599697[_0x7416('0x59')];if(!_0x5c2684['query'][_0x7416('0xca')](_0x7416('0xd4'))){_0x2254c2[_0x7416('0x21')]=qs['limit'](_0x5c2684[_0x7416('0x43')][_0x7416('0x21')]);_0x2254c2[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x5c2684[_0x7416('0x43')][_0x7416('0x23')]);}return _0x7c2e75[_0x7416('0xd6')](_0x2254c2);}})[_0x7416('0x17')](function(_0x11ddd1){if(_0x11ddd1){return _0x11ddd1?{'count':_0x2ae802,'rows':_0x11ddd1}:null;}})[_0x7416('0x17')](respondWithResult(_0x203b96,null))[_0x7416('0x1e')](handleError(_0x203b96,null));};exports[_0x7416('0xd7')]=function(_0x1c44c3,_0x55b75f){var _0x2e283a={};var _0x278f57={};var _0x4d7a77;var _0x5efa44;return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x1c44c3['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x55b75f,null))[_0x7416('0x17')](function(_0x4fb0b9){if(_0x4fb0b9){_0x4d7a77=_0x4fb0b9;_0x278f57['model']=_['keys'](db['ChatGroup'][_0x7416('0x3d')]);_0x278f57[_0x7416('0x43')]=_['keys'](_0x1c44c3[_0x7416('0x43')]);_0x278f57[_0x7416('0x55')]=_[_0x7416('0x56')](_0x278f57[_0x7416('0x57')],_0x278f57[_0x7416('0x43')]);_0x2e283a[_0x7416('0x47')]=_[_0x7416('0x56')](_0x278f57[_0x7416('0x57')],qs[_0x7416('0x58')](_0x1c44c3['query'][_0x7416('0x58')]));_0x2e283a['attributes']=_0x2e283a[_0x7416('0x47')][_0x7416('0x59')]?_0x2e283a['attributes']:_0x278f57[_0x7416('0x57')];_0x2e283a[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x1c44c3[_0x7416('0x43')]['sort']);_0x2e283a[_0x7416('0x42')]=qs[_0x7416('0x55')](_['pick'](_0x1c44c3[_0x7416('0x43')],_0x278f57[_0x7416('0x55')]));if(_0x1c44c3[_0x7416('0x43')][_0x7416('0x30')]){_0x2e283a[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x2e283a['where'],{'$or':_['map'](_0x2e283a[_0x7416('0x47')],function(_0x4240bb){var _0x44bdf9={};_0x44bdf9[_0x4240bb]={'$like':'%'+_0x1c44c3[_0x7416('0x43')]['filter']+'%'};return _0x44bdf9;})});}_0x2e283a=_[_0x7416('0x5b')]({},_0x2e283a,_0x1c44c3[_0x7416('0x5c')]);return _0x4d7a77['getGroups'](_0x2e283a);}})['then'](function(_0x4a5c9e){if(_0x4a5c9e){_0x5efa44=_0x4a5c9e[_0x7416('0x59')];if(!_0x1c44c3[_0x7416('0x43')][_0x7416('0xca')]('nolimit')){_0x2e283a[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x1c44c3[_0x7416('0x43')][_0x7416('0x21')]);_0x2e283a[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x1c44c3[_0x7416('0x43')][_0x7416('0x23')]);}return _0x4d7a77[_0x7416('0xd7')](_0x2e283a);}})[_0x7416('0x17')](function(_0x46a8c7){if(_0x46a8c7){return _0x46a8c7?{'count':_0x5efa44,'rows':_0x46a8c7}:null;}})[_0x7416('0x17')](respondWithResult(_0x55b75f,null))[_0x7416('0x1e')](handleError(_0x55b75f,null));};exports['getRecordings']=function(_0x3aaeb8,_0x13be9d){var _0x40f85d={'raw':!![],'where':{}};var _0x590bec={};var _0xfaa6df={'count':0x0,'rows':[]};return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x3aaeb8[_0x7416('0x52')]['id']}})['then'](handleEntityNotFound(_0x13be9d,null))[_0x7416('0x17')](function(_0x4f00c7){if(_0x4f00c7){_0x590bec['model']=_[_0x7416('0x53')](db['VoiceRecording']['rawAttributes']);_0x590bec[_0x7416('0x43')]=_[_0x7416('0x53')](_0x3aaeb8[_0x7416('0x43')]);_0x590bec['filters']=_[_0x7416('0x56')](_0x590bec[_0x7416('0x57')],_0x590bec['query']);_0x40f85d[_0x7416('0x47')]=_[_0x7416('0x56')](_0x590bec['model'],qs[_0x7416('0x58')](_0x3aaeb8[_0x7416('0x43')][_0x7416('0x58')]));_0x40f85d[_0x7416('0x47')]=_0x40f85d[_0x7416('0x47')][_0x7416('0x59')]?_0x40f85d[_0x7416('0x47')]:_0x590bec[_0x7416('0x57')];if(!_0x3aaeb8['query']['hasOwnProperty'](_0x7416('0xd4'))){_0x40f85d[_0x7416('0x21')]=qs['limit'](_0x3aaeb8['query']['limit']);_0x40f85d['offset']=qs[_0x7416('0x23')](_0x3aaeb8[_0x7416('0x43')][_0x7416('0x23')]);}_0x40f85d[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x3aaeb8[_0x7416('0x43')][_0x7416('0xd2')]);_0x40f85d[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x3aaeb8[_0x7416('0x43')],_0x590bec[_0x7416('0x55')]));_0x40f85d[_0x7416('0x42')][_0x7416('0xd8')]=_0x4f00c7['id'];if(_0x3aaeb8[_0x7416('0x43')][_0x7416('0x30')]){_0x40f85d['where']=_['merge'](_0x40f85d['where'],{'$or':_['map'](_0x40f85d[_0x7416('0x47')],function(_0x38339d){var _0x5d03c4={};_0x5d03c4[_0x38339d]={'$like':'%'+_0x3aaeb8[_0x7416('0x43')]['filter']+'%'};return _0x5d03c4;})});}_0x40f85d=_[_0x7416('0x5b')]({},_0x40f85d,_0x3aaeb8[_0x7416('0x5c')]);return db[_0x7416('0xd9')][_0x7416('0x22')]({'where':_0x40f85d['where']})[_0x7416('0x17')](function(_0x5dac7d){_0xfaa6df[_0x7416('0x22')]=_0x5dac7d;if(_0x3aaeb8[_0x7416('0x43')][_0x7416('0x44')]){_0x40f85d[_0x7416('0x45')]=[{'all':!![]}];}return db['VoiceRecording'][_0x7416('0x8b')](_0x40f85d);})[_0x7416('0x17')](function(_0x42236a){_0xfaa6df[_0x7416('0x48')]=_0x42236a;return _0xfaa6df;});}})[_0x7416('0x17')](respondWithFilteredResult(_0x13be9d,_0x40f85d))['catch'](handleError(_0x13be9d,null));};exports[_0x7416('0xda')]=function(_0x35ba84,_0x2afda0){var _0x524c8f={'raw':!![],'where':{}};var _0x271ebb={};var _0xd84e2a={'count':0x0,'rows':[]};return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x35ba84[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x2afda0,null))['then'](function(_0x496072){if(_0x496072){_0x271ebb[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0xdb')][_0x7416('0x3d')]);_0x271ebb['query']=_['keys'](_0x35ba84['query']);_0x271ebb['filters']=_[_0x7416('0x56')](_0x271ebb[_0x7416('0x57')],_0x271ebb[_0x7416('0x43')]);_0x524c8f[_0x7416('0x47')]=_[_0x7416('0x56')](_0x271ebb['model'],qs[_0x7416('0x58')](_0x35ba84[_0x7416('0x43')][_0x7416('0x58')]));_0x524c8f[_0x7416('0x47')]=_0x524c8f[_0x7416('0x47')][_0x7416('0x59')]?_0x524c8f['attributes']:_0x271ebb['model'];if(!_0x35ba84[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x524c8f[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x35ba84[_0x7416('0x43')][_0x7416('0x21')]);_0x524c8f[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x35ba84[_0x7416('0x43')][_0x7416('0x23')]);}_0x524c8f['order']=qs[_0x7416('0xd2')](_0x35ba84[_0x7416('0x43')][_0x7416('0xd2')]);_0x524c8f[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x35ba84[_0x7416('0x43')],_0x271ebb[_0x7416('0x55')]));_0x524c8f[_0x7416('0x42')][_0x7416('0xd8')]=_0x496072['id'];if(_0x35ba84[_0x7416('0x43')][_0x7416('0x30')]){_0x524c8f[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x524c8f[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x524c8f['attributes'],function(_0x8ac95f){var _0x41b7b4={};_0x41b7b4[_0x8ac95f]={'$like':'%'+_0x35ba84[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x41b7b4;})});}_0x524c8f=_[_0x7416('0x5b')]({},_0x524c8f,_0x35ba84['options']);return db[_0x7416('0xdb')][_0x7416('0x22')]({'where':_0x524c8f[_0x7416('0x42')]})[_0x7416('0x17')](function(_0x117d22){_0xd84e2a[_0x7416('0x22')]=_0x117d22;if(_0x35ba84['query'][_0x7416('0x44')]){_0x524c8f[_0x7416('0x45')]=[{'all':!![]}];}return db[_0x7416('0xdb')][_0x7416('0x8b')](_0x524c8f);})[_0x7416('0x17')](function(_0x885d){_0xd84e2a['rows']=_0x885d;return _0xd84e2a;});}})[_0x7416('0x17')](respondWithFilteredResult(_0x2afda0,_0x524c8f))[_0x7416('0x1e')](handleError(_0x2afda0,null));};exports['getChatInteractions']=function(_0x359c8e,_0x37c6db){var _0x4a40a6={};var _0x2031da={};var _0x129b6d;var _0x48ad38;return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x359c8e[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x37c6db,null))[_0x7416('0x17')](function(_0x414e37){if(_0x414e37){_0x129b6d=_0x414e37;_0x2031da['model']=_[_0x7416('0x53')](db['ChatInteraction'][_0x7416('0x3d')]);_0x2031da[_0x7416('0x43')]=_['keys'](_0x359c8e[_0x7416('0x43')]);_0x2031da[_0x7416('0x55')]=_['intersection'](_0x2031da[_0x7416('0x57')],_0x2031da[_0x7416('0x43')]);_0x4a40a6['attributes']=_['intersection'](_0x2031da['model'],qs[_0x7416('0x58')](_0x359c8e[_0x7416('0x43')][_0x7416('0x58')]));_0x4a40a6[_0x7416('0x47')]=_0x4a40a6[_0x7416('0x47')]['length']?_0x4a40a6[_0x7416('0x47')]:_0x2031da['model'];_0x4a40a6[_0x7416('0xd1')]=qs['sort'](_0x359c8e[_0x7416('0x43')][_0x7416('0xd2')]);_0x4a40a6[_0x7416('0x42')]=qs['filters'](_['pick'](_0x359c8e[_0x7416('0x43')],_0x2031da['filters']));if(_0x359c8e['query'][_0x7416('0x30')]){_0x4a40a6[_0x7416('0x42')]=_['merge'](_0x4a40a6[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x4a40a6[_0x7416('0x47')],function(_0x4a38f8){var _0x545e3b={};_0x545e3b[_0x4a38f8]={'$like':'%'+_0x359c8e[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x545e3b;})});}_0x4a40a6=_[_0x7416('0x5b')]({},_0x4a40a6,_0x359c8e['options']);return _0x129b6d[_0x7416('0xdc')](_0x4a40a6);}})[_0x7416('0x17')](function(_0xbdc5b0){if(_0xbdc5b0){_0x48ad38=_0xbdc5b0[_0x7416('0x59')];if(!_0x359c8e[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x4a40a6[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x359c8e[_0x7416('0x43')][_0x7416('0x21')]);_0x4a40a6[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x359c8e[_0x7416('0x43')]['offset']);}return _0x129b6d[_0x7416('0xdc')](_0x4a40a6);}})[_0x7416('0x17')](function(_0x2169da){if(_0x2169da){return _0x2169da?{'count':_0x48ad38,'rows':_0x2169da}:null;}})['then'](respondWithResult(_0x37c6db,null))[_0x7416('0x1e')](handleError(_0x37c6db,null));};exports[_0x7416('0xdd')]=function(_0x462b5c,_0x559479){var _0x11a731={};var _0x43531e={};var _0x37cb0c;var _0x2c52b7;return db['User'][_0x7416('0x97')]({'where':{'id':_0x462b5c['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x559479,null))[_0x7416('0x17')](function(_0xdd8292){if(_0xdd8292){_0x37cb0c=_0xdd8292;_0x43531e['model']=_[_0x7416('0x53')](db[_0x7416('0xde')][_0x7416('0x3d')]);_0x43531e[_0x7416('0x43')]=_[_0x7416('0x53')](_0x462b5c[_0x7416('0x43')]);_0x43531e[_0x7416('0x55')]=_[_0x7416('0x56')](_0x43531e['model'],_0x43531e[_0x7416('0x43')]);_0x11a731[_0x7416('0x47')]=_['intersection'](_0x43531e['model'],qs[_0x7416('0x58')](_0x462b5c['query']['fields']));_0x11a731['attributes']=_0x11a731[_0x7416('0x47')][_0x7416('0x59')]?_0x11a731[_0x7416('0x47')]:_0x43531e[_0x7416('0x57')];_0x11a731[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x462b5c['query']['sort']);_0x11a731[_0x7416('0x42')]=qs['filters'](_[_0x7416('0xd5')](_0x462b5c[_0x7416('0x43')],_0x43531e[_0x7416('0x55')]));if(_0x462b5c[_0x7416('0x43')][_0x7416('0x30')]){_0x11a731[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x11a731[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x11a731[_0x7416('0x47')],function(_0x24d3cf){var _0x37f9e4={};_0x37f9e4[_0x24d3cf]={'$like':'%'+_0x462b5c['query'][_0x7416('0x30')]+'%'};return _0x37f9e4;})});}_0x11a731=_[_0x7416('0x5b')]({},_0x11a731,_0x462b5c[_0x7416('0x5c')]);return _0x37cb0c['getOpenchannelInteractions'](_0x11a731);}})[_0x7416('0x17')](function(_0x4961cd){if(_0x4961cd){_0x2c52b7=_0x4961cd[_0x7416('0x59')];if(!_0x462b5c[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x11a731[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x462b5c[_0x7416('0x43')][_0x7416('0x21')]);_0x11a731[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x462b5c[_0x7416('0x43')][_0x7416('0x23')]);}return _0x37cb0c['getOpenchannelInteractions'](_0x11a731);}})[_0x7416('0x17')](function(_0x1c125f){if(_0x1c125f){return _0x1c125f?{'count':_0x2c52b7,'rows':_0x1c125f}:null;}})[_0x7416('0x17')](respondWithResult(_0x559479,null))[_0x7416('0x1e')](handleError(_0x559479,null));};exports['getMailInteractions']=function(_0x8452ce,_0x6c4f65){var _0x396805={'raw':!![],'where':{}};var _0x4d5306={};var _0x4f1f7c={'count':0x0,'rows':[]};return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x8452ce[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x6c4f65,null))[_0x7416('0x17')](function(_0x488b69){if(_0x488b69){_0x4d5306[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0xdf')][_0x7416('0x3d')]);_0x4d5306[_0x7416('0x43')]=_['keys'](_0x8452ce['query']);_0x4d5306[_0x7416('0x55')]=_[_0x7416('0x56')](_0x4d5306[_0x7416('0x57')],_0x4d5306[_0x7416('0x43')]);_0x396805[_0x7416('0x47')]=_[_0x7416('0x56')](_0x4d5306[_0x7416('0x57')],qs[_0x7416('0x58')](_0x8452ce['query'][_0x7416('0x58')]));_0x396805[_0x7416('0x47')]=_0x396805['attributes'][_0x7416('0x59')]?_0x396805[_0x7416('0x47')]:_0x4d5306[_0x7416('0x57')];if(!_0x8452ce[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x396805['limit']=qs['limit'](_0x8452ce['query']['limit']);_0x396805[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x8452ce[_0x7416('0x43')]['offset']);}_0x396805[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x8452ce[_0x7416('0x43')][_0x7416('0xd2')]);_0x396805[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x8452ce[_0x7416('0x43')],_0x4d5306['filters']));_0x396805['where'][_0x7416('0xd8')]=_0x488b69['id'];if(_0x8452ce[_0x7416('0x43')]['filter']){_0x396805[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x396805[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x396805[_0x7416('0x47')],function(_0x389e7f){var _0x2283bd={};_0x2283bd[_0x389e7f]={'$like':'%'+_0x8452ce['query'][_0x7416('0x30')]+'%'};return _0x2283bd;})});}_0x396805=_[_0x7416('0x5b')]({},_0x396805,_0x8452ce[_0x7416('0x5c')]);return db[_0x7416('0xdf')]['count']({'where':_0x396805[_0x7416('0x42')]})['then'](function(_0x52cc0e){_0x4f1f7c[_0x7416('0x22')]=_0x52cc0e;if(_0x8452ce[_0x7416('0x43')]['includeAll']){_0x396805['include']=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x396805);})[_0x7416('0x17')](function(_0x5ad970){_0x4f1f7c[_0x7416('0x48')]=_0x5ad970;return _0x4f1f7c;});}})[_0x7416('0x17')](respondWithFilteredResult(_0x6c4f65,_0x396805))['catch'](handleError(_0x6c4f65,null));};exports[_0x7416('0xe0')]=function(_0x5db66e,_0x879c38){var _0x37d454={};var _0x1cbad5={};var _0x45aa6a;var _0x347597;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x5db66e[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x879c38,null))['then'](function(_0x57f6cd){if(_0x57f6cd){_0x45aa6a=_0x57f6cd;_0x1cbad5[_0x7416('0x57')]=_['keys'](db['SmsInteraction'][_0x7416('0x3d')]);_0x1cbad5[_0x7416('0x43')]=_['keys'](_0x5db66e[_0x7416('0x43')]);_0x1cbad5[_0x7416('0x55')]=_[_0x7416('0x56')](_0x1cbad5['model'],_0x1cbad5[_0x7416('0x43')]);_0x37d454[_0x7416('0x47')]=_['intersection'](_0x1cbad5[_0x7416('0x57')],qs[_0x7416('0x58')](_0x5db66e[_0x7416('0x43')]['fields']));_0x37d454['attributes']=_0x37d454[_0x7416('0x47')][_0x7416('0x59')]?_0x37d454[_0x7416('0x47')]:_0x1cbad5[_0x7416('0x57')];_0x37d454[_0x7416('0xd1')]=qs['sort'](_0x5db66e[_0x7416('0x43')]['sort']);_0x37d454[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x5db66e[_0x7416('0x43')],_0x1cbad5[_0x7416('0x55')]));if(_0x5db66e[_0x7416('0x43')][_0x7416('0x30')]){_0x37d454['where']=_[_0x7416('0x5b')](_0x37d454['where'],{'$or':_[_0x7416('0x32')](_0x37d454['attributes'],function(_0x40cc73){var _0x485218={};_0x485218[_0x40cc73]={'$like':'%'+_0x5db66e[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x485218;})});}_0x37d454=_[_0x7416('0x5b')]({},_0x37d454,_0x5db66e[_0x7416('0x5c')]);return _0x45aa6a[_0x7416('0xe0')](_0x37d454);}})['then'](function(_0xce5fd2){if(_0xce5fd2){_0x347597=_0xce5fd2[_0x7416('0x59')];if(!_0x5db66e['query'][_0x7416('0xca')](_0x7416('0xd4'))){_0x37d454[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x5db66e[_0x7416('0x43')]['limit']);_0x37d454[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x5db66e['query'][_0x7416('0x23')]);}return _0x45aa6a['getSmsInteractions'](_0x37d454);}})['then'](function(_0x52dd8d){if(_0x52dd8d){return _0x52dd8d?{'count':_0x347597,'rows':_0x52dd8d}:null;}})[_0x7416('0x17')](respondWithResult(_0x879c38,null))[_0x7416('0x1e')](handleError(_0x879c38,null));};exports['getFaxInteractions']=function(_0x552500,_0x23a39f){var _0x442e01={};var _0x35b66b={};var _0x56cd40;var _0x530388;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x552500[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x23a39f,null))[_0x7416('0x17')](function(_0x27b9e6){if(_0x27b9e6){_0x56cd40=_0x27b9e6;_0x35b66b['model']=_[_0x7416('0x53')](db[_0x7416('0xe1')]['rawAttributes']);_0x35b66b['query']=_[_0x7416('0x53')](_0x552500[_0x7416('0x43')]);_0x35b66b[_0x7416('0x55')]=_[_0x7416('0x56')](_0x35b66b[_0x7416('0x57')],_0x35b66b[_0x7416('0x43')]);_0x442e01['attributes']=_[_0x7416('0x56')](_0x35b66b['model'],qs[_0x7416('0x58')](_0x552500['query'][_0x7416('0x58')]));_0x442e01[_0x7416('0x47')]=_0x442e01['attributes'][_0x7416('0x59')]?_0x442e01[_0x7416('0x47')]:_0x35b66b[_0x7416('0x57')];_0x442e01['order']=qs[_0x7416('0xd2')](_0x552500[_0x7416('0x43')][_0x7416('0xd2')]);_0x442e01['where']=qs[_0x7416('0x55')](_['pick'](_0x552500[_0x7416('0x43')],_0x35b66b[_0x7416('0x55')]));if(_0x552500[_0x7416('0x43')][_0x7416('0x30')]){_0x442e01[_0x7416('0x42')]=_['merge'](_0x442e01[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x442e01[_0x7416('0x47')],function(_0x51a303){var _0x45fa63={};_0x45fa63[_0x51a303]={'$like':'%'+_0x552500[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x45fa63;})});}_0x442e01=_['merge']({},_0x442e01,_0x552500['options']);return _0x56cd40[_0x7416('0xe2')](_0x442e01);}})['then'](function(_0x2612d3){if(_0x2612d3){_0x530388=_0x2612d3[_0x7416('0x59')];if(!_0x552500[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x442e01[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x552500[_0x7416('0x43')][_0x7416('0x21')]);_0x442e01['offset']=qs[_0x7416('0x23')](_0x552500[_0x7416('0x43')][_0x7416('0x23')]);}return _0x56cd40[_0x7416('0xe2')](_0x442e01);}})[_0x7416('0x17')](function(_0x30d60f){if(_0x30d60f){return _0x30d60f?{'count':_0x530388,'rows':_0x30d60f}:null;}})['then'](respondWithResult(_0x23a39f,null))[_0x7416('0x1e')](handleError(_0x23a39f,null));};exports['getWhatsappInteractions']=function(_0x32e611,_0x23d70e){var _0x5ecac4={};var _0x545b9f={};var _0x55dc2b;var _0x4d187c;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x32e611[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x23d70e,null))[_0x7416('0x17')](function(_0x401a3a){if(_0x401a3a){_0x55dc2b=_0x401a3a;_0x545b9f[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0xe3')][_0x7416('0x3d')]);_0x545b9f[_0x7416('0x43')]=_[_0x7416('0x53')](_0x32e611['query']);_0x545b9f[_0x7416('0x55')]=_['intersection'](_0x545b9f[_0x7416('0x57')],_0x545b9f[_0x7416('0x43')]);_0x5ecac4[_0x7416('0x47')]=_['intersection'](_0x545b9f[_0x7416('0x57')],qs[_0x7416('0x58')](_0x32e611[_0x7416('0x43')][_0x7416('0x58')]));_0x5ecac4[_0x7416('0x47')]=_0x5ecac4[_0x7416('0x47')]['length']?_0x5ecac4['attributes']:_0x545b9f[_0x7416('0x57')];_0x5ecac4[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x32e611[_0x7416('0x43')][_0x7416('0xd2')]);_0x5ecac4['where']=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x32e611['query'],_0x545b9f['filters']));if(_0x32e611[_0x7416('0x43')][_0x7416('0x30')]){_0x5ecac4[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x5ecac4[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x5ecac4[_0x7416('0x47')],function(_0x1912dc){var _0xba880a={};_0xba880a[_0x1912dc]={'$like':'%'+_0x32e611[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0xba880a;})});}_0x5ecac4=_[_0x7416('0x5b')]({},_0x5ecac4,_0x32e611[_0x7416('0x5c')]);return _0x55dc2b['getWhatsappInteractions'](_0x5ecac4);}})['then'](function(_0x1cec2a){if(_0x1cec2a){_0x4d187c=_0x1cec2a[_0x7416('0x59')];if(!_0x32e611[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x5ecac4['limit']=qs[_0x7416('0x21')](_0x32e611[_0x7416('0x43')][_0x7416('0x21')]);_0x5ecac4[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x32e611[_0x7416('0x43')][_0x7416('0x23')]);}return _0x55dc2b[_0x7416('0xe4')](_0x5ecac4);}})[_0x7416('0x17')](function(_0x333303){if(_0x333303){return _0x333303?{'count':_0x4d187c,'rows':_0x333303}:null;}})['then'](respondWithResult(_0x23d70e,null))[_0x7416('0x1e')](handleError(_0x23d70e,null));};exports[_0x7416('0xe5')]=function(_0x7941a5,_0x47b4c4,_0x4291c7){var _0x3d82b5;var _0x47aaea;var _0x5102e8;var _0x9ca035=!_[_0x7416('0x6a')](_0x7941a5['params']['id'])?_0x7941a5['params']['id']:!_[_0x7416('0x6a')](_0x7941a5[_0x7416('0x7e')]['id'])?_0x7941a5[_0x7416('0x7e')]['id']:null;return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x9ca035,'role':{'$or':[_0x7416('0x2c'),_0x7416('0x7e'),_0x7416('0x28')]}},'attributes':['id','name',_0x7416('0xe6'),_0x7416('0xe7'),'role',_0x7416('0x64'),'loginInPause']})['then'](function(_0x570a53){if(_0x570a53){if(_0x570a53[_0x7416('0x27')]===_0x7416('0x28')){_0x3d82b5=_0x570a53;if(_0x7941a5['body']['interface']){_0x5102e8=util['format'](_0x7416('0xe8'),_0x3d82b5[_0x7941a5[_0x7416('0x5f')][_0x7416('0x9e')]]);}else if(_0x7941a5['body'][_0x7416('0xe9')]){_0x5102e8=util[_0x7416('0xa8')](_0x7416('0xa9'),_0x7941a5['body']['intrf']);}else{_0x5102e8=util[_0x7416('0xa8')](_0x7416('0xa9'),_0x3d82b5[_0x7416('0x36')]);}socket['to'](util['format'](_0x7416('0xea'),_0x3d82b5['name']))[_0x7416('0x29')]('user:forcelogout',{'user':{'id':_0x3d82b5['id'],'name':_0x3d82b5['name']},'ip':_0x7941a5[_0x7416('0xeb')][_0x7416('0xec')]||_0x7941a5['connection'][_0x7416('0xed')]||_0x7941a5[_0x7416('0xee')][_0x7416('0xed')]||_0x7941a5[_0x7416('0xef')]['socket'][_0x7416('0xed')]});return db[_0x7416('0xab')][_0x7416('0xf0')]({'where':{'membername':_0x3d82b5['name']},'individualHooks':!![]});}}else{throw new db[(_0x7416('0x90'))][(_0x7416('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x7416('0x17')](function(){if(_0x3d82b5){return _0x3d82b5[_0x7416('0xf1')]({'raw':!![]});}})[_0x7416('0x17')](function(_0x4f635c){if(_0x3d82b5){if(_0x4f635c){_0x47aaea=_0x4f635c;if(_0x47aaea[_0x7416('0x59')]){var _0x1589d3=_0x47aaea[_0x7416('0x32')](function(_0x573bb4){var _0x4dd7ef={'membername':_0x3d82b5[_0x7416('0x36')],'UserId':_0x3d82b5['id'],'queue_name':_0x573bb4['name'],'VoiceQueueId':_0x573bb4['id'],'interface':_0x5102e8,'paused':_0x3d82b5[_0x7416('0xf2')]||![],'penalty':_0x573bb4[_0x7416('0xf3')]||0x0};return db[_0x7416('0xab')][_0x7416('0xac')](_0x4dd7ef);});return Promise[_0x7416('0x8a')](_0x1589d3);}}}})[_0x7416('0x17')](function(){if(_0x3d82b5){return db['MemberReport']['findAll']({'where':{'membername':_0x3d82b5['name'],'exitAt':null}});}})[_0x7416('0x17')](function(_0x3a6324){if(_0x3d82b5){var _0x1609dd=[];_0x3a6324['forEach'](function(_0x10c6eb){_0x1609dd['push'](_0x10c6eb['update']({'exitAt':moment()[_0x7416('0xa8')](_0x7416('0xf4'))}));});return Promise[_0x7416('0x8a')](_0x1609dd);}})[_0x7416('0x17')](function(){if(_0x3d82b5){var _0x5b9362=[];var _0x3847a0=[];var _0x358b1b=utils[_0x7416('0xf5')]();var _0x49c962={'membername':_0x3d82b5[_0x7416('0x36')],'interface':_0x5102e8,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3d82b5[_0x7416('0x27')],'internal':_0x3d82b5[_0x7416('0x64')]};_0x358b1b['forEach'](function(_0x4285f8){_0x5b9362['push'](_[_0x7416('0x5b')]({'channel':_0x4285f8,'type':'LOGIN','data1':_0x7941a5['body'][_0x7416('0xf6')],'data2':_0x5102e8},_0x49c962));if(_0x3d82b5[_0x7416('0xf2')]){_0x3847a0['push'](_[_0x7416('0x5b')]({'channel':_0x4285f8,'type':_0x7416('0xf7'),'data1':_0x7416('0xf8')},_0x49c962));}});return db[_0x7416('0xf9')][_0x7416('0x88')](_0x5b9362['concat'](_0x3847a0),{'individualHooks':!![]});}})['then'](function(){if(_0x3d82b5){return _0x3d82b5[_0x7416('0x26')]({'online':!![],'lastLoginAt':moment()[_0x7416('0xa8')](_0x7416('0xf4')),'voicePause':_0x3d82b5[_0x7416('0xf2')]||![],'mailPause':_0x3d82b5['loginInPause']||![],'chatPause':_0x3d82b5['loginInPause']||![],'faxPause':_0x3d82b5['loginInPause']||![],'smsPause':_0x3d82b5[_0x7416('0xf2')]||![],'openchannelPause':_0x3d82b5[_0x7416('0xf2')]||![],'whatsappPause':_0x3d82b5[_0x7416('0xf2')]||![],'pauseType':_0x3d82b5[_0x7416('0xf2')]?_0x7416('0xf8'):null,'interface':_0x5102e8,'lastPauseAt':moment()[_0x7416('0xa8')](_0x7416('0xf4'))});}})['then'](function(_0x51454c){if(_0x7941a5['isMiddleware']){return _0x4291c7();}else{return Promise[_0x7416('0xfa')](_0x51454c)[_0x7416('0x17')](respondWithResult(_0x47b4c4,null));}})[_0x7416('0x1e')](handleError(_0x47b4c4,null));};exports[_0x7416('0xfb')]=function(_0x611f21,_0x54d440){var _0x2d90fd;return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x611f21['params']['id'],'role':_0x7416('0x28')},'attributes':['id',_0x7416('0x36'),'role']})['then'](handleEntityNotFound(_0x54d440,null))['then'](function(_0x2ea69a){if(_0x2ea69a){_0x2d90fd=_0x2ea69a;return db[_0x7416('0xab')][_0x7416('0xf0')]({'where':{'membername':_0x2d90fd[_0x7416('0x36')]},'individualHooks':!![]});}})[_0x7416('0x17')](function(){return db['MemberReport'][_0x7416('0x8b')]({'where':{'membername':_0x2d90fd['name'],'exitAt':null}});})[_0x7416('0x17')](function(_0x182793){var _0x2c6327=[];_0x182793['forEach'](function(_0xca3d69){_0x2c6327['push'](_0xca3d69[_0x7416('0x26')]({'exitAt':moment()[_0x7416('0xa8')](_0x7416('0xf4'))}));});return Promise[_0x7416('0x8a')](_0x2c6327);})['then'](function(){return _0x2d90fd['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7416('0x17')](respondWithResult(_0x54d440,null))[_0x7416('0x1e')](handleError(_0x54d440,null));};exports[_0x7416('0xfc')]=function(_0x156659,_0x5cce7c){var _0x325d6d;return db[_0x7416('0xab')][_0x7416('0x26')]({'paused':0x1},{'where':{'UserId':_0x156659['params']['id']},'individualHooks':!![]})[_0x7416('0x17')](function(){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x156659[_0x7416('0x52')]['id'],'role':'agent'},'attributes':['id',_0x7416('0x36'),'role',_0x7416('0x64'),_0x7416('0x9e'),_0x7416('0x9d')]});})[_0x7416('0x17')](handleEntityNotFound(_0x5cce7c,null))[_0x7416('0x17')](function(_0x2b24e3){if(_0x2b24e3){_0x325d6d=_0x2b24e3;return respondWithRpcPromise(_0x7416('0xfd'),_0x7416('0xfc'),{'id':_0x325d6d['id'],'name':_0x325d6d[_0x7416('0x36')],'pause':!![]});}})[_0x7416('0x17')](function(){if(_0x325d6d){return db[_0x7416('0xf9')]['findAll']({'where':{'membername':_0x325d6d[_0x7416('0x36')],'type':_0x7416('0xf7'),'exitAt':null}});}})[_0x7416('0x17')](function(_0xacad1c){if(_0xacad1c[_0x7416('0x59')]){var _0x4be032=moment()[_0x7416('0xa8')](_0x7416('0xf4'));for(var _0x2d31ee=0x0,_0xdc2727=_0xacad1c[_0x7416('0x59')];_0x2d31ee<_0xdc2727;_0x2d31ee++){_0xacad1c[_0x2d31ee][_0x7416('0xfe')]({'exitAt':_0x4be032});}}})['then'](function(){var _0xda8cab=[];var _0x457c7a=utils[_0x7416('0xf5')]();_0x457c7a['forEach'](function(_0x5ce890){_0xda8cab[_0x7416('0x4c')]({'channel':_0x5ce890,'membername':_0x325d6d[_0x7416('0x36')],'interface':_[_0x7416('0x6a')](_0x325d6d[_0x7416('0x9e')])?util[_0x7416('0xa8')](_0x7416('0xa9'),_0x325d6d[_0x7416('0x36')]):_0x325d6d[_0x7416('0x9e')],'type':'PAUSE','enterAt':moment()[_0x7416('0xa8')](_0x7416('0xf4')),'data1':_0x156659['body']['type']||_0x7416('0xff'),'role':_0x325d6d[_0x7416('0x27')],'internal':_0x325d6d['internal']});});return db[_0x7416('0xf9')][_0x7416('0x88')](_0xda8cab,{'individualHooks':!![]});})['then'](function(){return _0x325d6d[_0x7416('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x156659[_0x7416('0x5f')][_0x7416('0x3e')]||_0x7416('0xff'),'lastPauseAt':moment()[_0x7416('0xa8')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7416('0x17')](respondWithResult(_0x5cce7c,null))['catch'](handleError(_0x5cce7c,null));};exports[_0x7416('0x100')]=function(_0x5ebba4,_0x19c7f2){if(_0x5ebba4[_0x7416('0x5f')]['channel']&&!utils[_0x7416('0xae')](_0x5ebba4[_0x7416('0x5f')][_0x7416('0x9c')])){throw new APIBadRequestError(util[_0x7416('0xa8')](_0x7416('0x101'),_0x5ebba4[_0x7416('0x5f')][_0x7416('0x9c')]));}return db['User'][_0x7416('0x35')]({'where':{'id':_0x5ebba4[_0x7416('0x52')]['id']},'attributes':['id',_0x7416('0x36'),_0x7416('0x27'),_0x7416('0x64'),_0x7416('0x9e'),'online','voicePause',_0x7416('0x102'),_0x7416('0x103'),_0x7416('0x104'),_0x7416('0x105'),'smsPause',_0x7416('0x106'),_0x7416('0x107'),'lastPauseAt']})[_0x7416('0x17')](function(_0x1c9aaf){if(!_0x1c9aaf){throw new APINotFoundError(util[_0x7416('0xa8')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5ebba4[_0x7416('0x52')]['id']));}return _0x1c9aaf[_0x7416('0x100')](_0x5ebba4[_0x7416('0x5f')][_0x7416('0x9c')]);})[_0x7416('0x17')](respondWithResult(_0x19c7f2,null))[_0x7416('0x1e')](APIHandleError(_0x19c7f2));};exports['getTeams']=function(_0x1ee63b,_0xd8dea1){var _0x2cdea0={};var _0x3d6a6e={};var _0x4c0b13;var _0x5f23a4;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x1ee63b[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0xd8dea1,null))[_0x7416('0x17')](function(_0xe1fe7c){if(_0xe1fe7c){_0x4c0b13=_0xe1fe7c;_0x3d6a6e[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0x108')][_0x7416('0x3d')]);_0x3d6a6e[_0x7416('0x43')]=_[_0x7416('0x53')](_0x1ee63b['query']);_0x3d6a6e[_0x7416('0x55')]=_['intersection'](_0x3d6a6e[_0x7416('0x57')],_0x3d6a6e['query']);_0x2cdea0[_0x7416('0x47')]=_[_0x7416('0x56')](_0x3d6a6e[_0x7416('0x57')],qs[_0x7416('0x58')](_0x1ee63b[_0x7416('0x43')][_0x7416('0x58')]));_0x2cdea0[_0x7416('0x47')]=_0x2cdea0[_0x7416('0x47')][_0x7416('0x59')]?_0x2cdea0[_0x7416('0x47')]:_0x3d6a6e[_0x7416('0x57')];_0x2cdea0['order']=qs[_0x7416('0xd2')](_0x1ee63b[_0x7416('0x43')]['sort']);_0x2cdea0[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x1ee63b[_0x7416('0x43')],_0x3d6a6e[_0x7416('0x55')]));if(_0x1ee63b[_0x7416('0x43')][_0x7416('0x30')]){_0x2cdea0[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x2cdea0['where'],{'$or':_[_0x7416('0x32')](_0x2cdea0[_0x7416('0x47')],function(_0x58cc5c){var _0x1a8d7c={};_0x1a8d7c[_0x58cc5c]={'$like':'%'+_0x1ee63b['query'][_0x7416('0x30')]+'%'};return _0x1a8d7c;})});}_0x2cdea0=_[_0x7416('0x5b')]({},_0x2cdea0,_0x1ee63b[_0x7416('0x5c')]);return _0x4c0b13[_0x7416('0x109')](_0x2cdea0);}})[_0x7416('0x17')](function(_0xa6c69a){if(_0xa6c69a){_0x5f23a4=_0xa6c69a[_0x7416('0x59')];if(!_0x1ee63b['query'][_0x7416('0xca')](_0x7416('0xd4'))){_0x2cdea0['limit']=qs[_0x7416('0x21')](_0x1ee63b[_0x7416('0x43')][_0x7416('0x21')]);_0x2cdea0[_0x7416('0x23')]=qs['offset'](_0x1ee63b[_0x7416('0x43')]['offset']);}return _0x4c0b13[_0x7416('0x109')](_0x2cdea0);}})[_0x7416('0x17')](function(_0x5bee68){if(_0x5bee68){return _0x5bee68?{'count':_0x5f23a4,'rows':_0x5bee68}:null;}})[_0x7416('0x17')](respondWithResult(_0xd8dea1,null))[_0x7416('0x1e')](handleError(_0xd8dea1,null));};exports[_0x7416('0x10a')]=function(_0x54b96f,_0x4ba102){var _0x2d1b19=_0x54b96f[_0x7416('0x52')]['id'];var _0x26c8b3=_0x54b96f[_0x7416('0x5f')]?_0x54b96f[_0x7416('0x5f')][_0x7416('0x62')]:null;var _0x272cd4=[];return Promise[_0x7416('0xfa')]()[_0x7416('0x17')](function(){if(!_0x26c8b3)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x2d1b19}});})[_0x7416('0x17')](function(_0x98d03){if(!_0x98d03)throw new APINotFoundError(util['format'](_0x7416('0xc9'),_0x54b96f[_0x7416('0x52')]['id']));return db[_0x7416('0x6c')]['transaction'](function(_0xca0291){return _0x98d03[_0x7416('0x10a')](_0x26c8b3,{'transaction':_0xca0291})[_0x7416('0x17')](function(){return db[_0x7416('0x108')][_0x7416('0x8b')]({'where':{'id':{'$in':_0x26c8b3}}});})[_0x7416('0x17')](function(_0x15a4be){var _0x354538=_[_0x7416('0x32')](_0x15a4be,function(_0x5bfb14){return _0x5bfb14[_0x7416('0x10b')]();});return Promise[_0x7416('0x8a')](_0x354538);})[_0x7416('0x17')](function(_0x1cff71){_0x272cd4=_['flattenDeep'](_0x1cff71);var _0x1f3a7e=_[_0x7416('0x32')](_0x272cd4,function(_0x5a0a13){return _0x5a0a13[_0x7416('0x10c')](_0x98d03['id'],{'transaction':_0xca0291});});return Promise[_0x7416('0x8a')](_0x1f3a7e);})[_0x7416('0x17')](function(){if(!_0x98d03[_0x7416('0x9d')])return;var _0x4c6028=_[_0x7416('0x30')](_0x272cd4,function(_0x354eb8){return _0x354eb8['getDataValue'](_0x7416('0x9c'))===_0x7416('0x10d');});var _0xcf2a7c=_[_0x7416('0x32')](_0x4c6028,function(_0x1ad8d6){return db['UserVoiceQueueRt'][_0x7416('0xac')]({'membername':_0x98d03[_0x7416('0x36')],'UserId':_0x98d03['id'],'queue_name':_0x1ad8d6[_0x7416('0x36')],'VoiceQueueId':_0x1ad8d6['id'],'interface':_[_0x7416('0x6a')](_0x98d03[_0x7416('0x9e')])?util[_0x7416('0xa8')]('SIP/%s',_0x98d03['name']):_0x98d03['interface'],'paused':_0x98d03[_0x7416('0xaa')]||![],'penalty':_0x98d03[_0x7416('0x10e')]},{'transaction':_0xca0291});});return Promise[_0x7416('0x8a')](_0xcf2a7c);})[_0x7416('0x17')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x26c8b3}}});})[_0x7416('0x17')](function(_0x3ad9b2){var _0x453e20=_['map'](_0x3ad9b2,function(_0x461307){return db[_0x7416('0x10f')][_0x7416('0x7c')]({'UserId':_0x98d03['id'],'VoicePrefixId':_0x461307[_0x7416('0x110')]},{'transaction':_0xca0291});});return Promise[_0x7416('0x8a')](_0x453e20);});});})[_0x7416('0x17')](function(){for(var _0x19c6c4=0x0;_0x19c6c4<_0x272cd4[_0x7416('0x59')];_0x19c6c4++){var _0x799c61=_0x272cd4[_0x19c6c4]['getDataValue'](_0x7416('0x9c'));var _0x92a2a6=_0x799c61+_0x7416('0xa4');socket[_0x7416('0x29')](_0x7416('0x7e')+_0x799c61+_0x7416('0xa5'),{'UserId':_0x2d1b19,['queueField']:_0x272cd4[_0x19c6c4]['id']});}})[_0x7416('0x17')](respondWithStatusCode(_0x4ba102,null))[_0x7416('0x1e')](APIHandleError(_0x4ba102));};exports[_0x7416('0x111')]=function(_0x25ac3a,_0x40d49c){var _0x3ec292=_0x25ac3a[_0x7416('0x52')]['id'];var _0xf9fae=null;if(_0x25ac3a['query']['ids']){_0xf9fae=_[_0x7416('0xb0')](_0x25ac3a['query'][_0x7416('0x62')])?_0x25ac3a[_0x7416('0x43')][_0x7416('0x62')]:[_0x25ac3a[_0x7416('0x43')][_0x7416('0x62')]];}var _0x2c2e71=[];return Promise[_0x7416('0xfa')]()[_0x7416('0x17')](function(){if(!_0xf9fae)throw new APIBadRequestError(_0x7416('0x112'));})[_0x7416('0x17')](function(){return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x3ec292}});})[_0x7416('0x17')](function(_0x55d1e5){if(!_0x55d1e5)throw new APINotFoundError(util[_0x7416('0xa8')](_0x7416('0xc9'),_0x25ac3a['params']['id']));return db[_0x7416('0x6c')][_0x7416('0x113')](function(_0x210ea5){return _0x55d1e5['removeTeams'](_0xf9fae,{'transaction':_0x210ea5})[_0x7416('0x17')](function(){return db[_0x7416('0x108')]['findAll']({'where':{'id':{'$in':_0xf9fae}}});})[_0x7416('0x17')](function(_0x11d7db){var _0x1fe2f2=_[_0x7416('0x32')](_0x11d7db,function(_0x1acdad){return _0x1acdad[_0x7416('0x10b')]();});return Promise[_0x7416('0x8a')](_0x1fe2f2);})['then'](function(_0x3b7de5){_0x2c2e71=_['flattenDeep'](_0x3b7de5);var _0xd0d99=_[_0x7416('0x32')](_0x2c2e71,function(_0x52e68f){return _0x52e68f[_0x7416('0x114')](_0x55d1e5['id'],{'transaction':_0x210ea5});});return Promise[_0x7416('0x8a')](_0xd0d99);})[_0x7416('0x17')](function(){if(!_0x55d1e5[_0x7416('0x9d')])return;var _0x3662e8=_['filter'](_0x2c2e71,function(_0x143ae4){return _0x143ae4[_0x7416('0x115')](_0x7416('0x9c'))===_0x7416('0x10d');});var _0x50e2b1=_[_0x7416('0x32')](_0x3662e8,function(_0x25e93d){return db[_0x7416('0xab')]['destroy']({'where':{'VoiceQueueId':_0x25e93d['id'],'UserId':_0x55d1e5['id']},'transaction':_0x210ea5});});return Promise[_0x7416('0x8a')](_0x50e2b1);})[_0x7416('0x17')](function(){return db[_0x7416('0x116')]['findAll']({'where':{'teamId':{'$in':_0xf9fae}}});})['then'](function(_0xf95384){var _0x2ccf16=_[_0x7416('0x32')](_0xf95384,function(_0x506bb1){return db[_0x7416('0x10f')]['destroy']({'where':{'UserId':_0x55d1e5['id'],'VoicePrefixId':_0x506bb1[_0x7416('0x110')]}},{'transaction':_0x210ea5});});return Promise[_0x7416('0x8a')](_0x2ccf16);});});})[_0x7416('0x17')](function(){for(var _0x59993c=0x0;_0x59993c<_0x2c2e71['length'];_0x59993c++){var _0x5f3d3e=_0x2c2e71[_0x59993c]['getDataValue'](_0x7416('0x9c'));var _0x282112=_0x5f3d3e+'QueueId';socket['emit'](_0x7416('0x7e')+_0x5f3d3e+_0x7416('0xb1'),{'UserId':_0x3ec292,['queueField']:_0x2c2e71[_0x59993c]['id']});}})[_0x7416('0x17')](respondWithStatusCode(_0x40d49c,null))[_0x7416('0x1e')](APIHandleError(_0x40d49c));};exports[_0x7416('0x117')]=function(_0x30f5e9,_0x3c76d0){var _0x7fd937={};var _0x3058ce={};var _0x391258;var _0xad7c87;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x30f5e9[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x3c76d0,null))[_0x7416('0x17')](function(_0x53a20d){if(_0x53a20d){_0x391258=_0x53a20d;_0x3058ce[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0x118')][_0x7416('0x3d')]);_0x3058ce[_0x7416('0x43')]=_[_0x7416('0x53')](_0x30f5e9[_0x7416('0x43')]);_0x3058ce[_0x7416('0x55')]=_[_0x7416('0x56')](_0x3058ce[_0x7416('0x57')],_0x3058ce[_0x7416('0x43')]);_0x7fd937[_0x7416('0x47')]=_[_0x7416('0x56')](_0x3058ce[_0x7416('0x57')],qs[_0x7416('0x58')](_0x30f5e9['query']['fields']));_0x7fd937[_0x7416('0x47')]=_0x7fd937[_0x7416('0x47')][_0x7416('0x59')]?_0x7fd937['attributes']:_0x3058ce['model'];_0x7fd937[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x30f5e9[_0x7416('0x43')]['sort']);_0x7fd937[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x30f5e9[_0x7416('0x43')],_0x3058ce['filters']));if(_0x30f5e9[_0x7416('0x43')]['filter']){_0x7fd937['where']=_[_0x7416('0x5b')](_0x7fd937['where'],{'$or':_['map'](_0x7fd937[_0x7416('0x47')],function(_0x37ac29){var _0x255e91={};_0x255e91[_0x37ac29]={'$like':'%'+_0x30f5e9[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x255e91;})});}_0x7fd937=_[_0x7416('0x5b')]({},_0x7fd937,_0x30f5e9[_0x7416('0x5c')]);return _0x391258[_0x7416('0x117')](_0x7fd937);}})[_0x7416('0x17')](function(_0x24f4b6){if(_0x24f4b6){_0xad7c87=_0x24f4b6[_0x7416('0x59')];if(!_0x30f5e9[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x7fd937[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x30f5e9[_0x7416('0x43')]['limit']);_0x7fd937[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x30f5e9[_0x7416('0x43')][_0x7416('0x23')]);}return _0x391258[_0x7416('0x117')](_0x7fd937);}})[_0x7416('0x17')](function(_0x1040ca){if(_0x1040ca){return _0x1040ca?{'count':_0xad7c87,'rows':_0x1040ca}:null;}})[_0x7416('0x17')](respondWithResult(_0x3c76d0,null))[_0x7416('0x1e')](handleError(_0x3c76d0,null));};exports[_0x7416('0x119')]=function(_0x386df5,_0x5731f5){var _0x4bdbd6={};var _0x58eefd={};var _0xc5ecb8;return db['User'][_0x7416('0x97')]({'where':{'id':_0x386df5[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x5731f5,null))['then'](function(_0x1ba112){if(_0x1ba112){_0xc5ecb8=_0x1ba112;_0x58eefd[_0x7416('0x57')]=_[_0x7416('0x53')](db['User'][_0x7416('0x3d')]);_0x58eefd['query']=_['keys'](_0x386df5[_0x7416('0x43')]);_0x58eefd[_0x7416('0x55')]=_[_0x7416('0x56')](_0x58eefd[_0x7416('0x57')],_0x58eefd[_0x7416('0x43')]);_0x4bdbd6['attributes']=_['intersection'](_0x58eefd[_0x7416('0x57')],qs[_0x7416('0x58')](_0x386df5['query'][_0x7416('0x58')]));_0x4bdbd6[_0x7416('0x47')]=_0x4bdbd6[_0x7416('0x47')][_0x7416('0x59')]?_0x4bdbd6[_0x7416('0x47')]:_0x58eefd[_0x7416('0x57')];_0x4bdbd6[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x386df5[_0x7416('0x43')][_0x7416('0xd2')]);_0x4bdbd6[_0x7416('0x42')]=qs[_0x7416('0x55')](_['pick'](_0x386df5['query'],_0x58eefd[_0x7416('0x55')]));if(_0x386df5[_0x7416('0x43')]['filter']){_0x4bdbd6[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x4bdbd6[_0x7416('0x42')],{'$or':_['map'](_0x4bdbd6[_0x7416('0x47')],function(_0x2db6a4){var _0x58d7a7={};_0x58d7a7[_0x2db6a4]={'$like':'%'+_0x386df5[_0x7416('0x43')]['filter']+'%'};return _0x58d7a7;})});}_0x4bdbd6['model']=db[_0x7416('0x3c')];_0x4bdbd6['as']='Agents';_0x4bdbd6=_[_0x7416('0x5b')]({},_0x4bdbd6,_0x386df5[_0x7416('0x5c')]);return _0xc5ecb8[_0x7416('0xf1')]({'include':[_0x4bdbd6]});}})[_0x7416('0x17')](function(_0x37eb7f){if(_0x37eb7f){var _0x284550={},_0xfe4679=[];for(var _0x555179=0x0;_0x555179<_0x37eb7f['length'];_0x555179+=0x1){for(var _0x1e73e3=0x0,_0x38a3bd;_0x1e73e3<_0x37eb7f[_0x555179][_0x7416('0x2e')][_0x7416('0x59')];_0x1e73e3+=0x1){_0x38a3bd=_0x37eb7f[_0x555179][_0x7416('0x2e')][_0x1e73e3][_0x7416('0x2b')]({'plain':!![]});_0x284550[_0x38a3bd['id']]=_0x38a3bd;}}_0x284550=_[_0x7416('0x11a')](_0x284550);for(var _0x14aa57=qs[_0x7416('0x23')](_0x386df5[_0x7416('0x43')][_0x7416('0x23')]);_0x14aa57<_0x284550['length']&&_0xfe4679[_0x7416('0x59')]<qs[_0x7416('0x21')](_0x386df5[_0x7416('0x43')][_0x7416('0x21')]);_0x14aa57+=0x1){if(_0x284550[_0x14aa57]){_0xfe4679['push'](_0x284550[_0x14aa57]);}}return{'count':_0x284550[_0x7416('0x59')],'rows':_0xfe4679};}})['then'](respondWithResult(_0x5731f5,null))[_0x7416('0x1e')](handleError(_0x5731f5,null));};exports[_0x7416('0xf0')]=function(_0x55c3ba,_0x3046aa){if(_0x55c3ba[_0x7416('0x7e')]['id']==_0x55c3ba['params']['id']){return _0x3046aa['status'](0x1f4)['send']({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db['User'][_0x7416('0x35')]({'where':{'id':_0x55c3ba[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x3046aa,null))[_0x7416('0x17')](removeEntity(_0x3046aa,null))[_0x7416('0x1e')](handleError(_0x3046aa,null));};exports[_0x7416('0x11b')]=function(_0x264f9b,_0x338e3f){return db['User'][_0x7416('0x35')]({'where':{'id':_0x264f9b[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x338e3f,null))[_0x7416('0x17')](function(_0x1eb6be){if(_0x1eb6be){return _0x1eb6be[_0x7416('0x11b')](_0x264f9b[_0x7416('0x5f')][_0x7416('0x62')],_[_0x7416('0x63')](_0x264f9b['body'],[_0x7416('0x62'),'id'])||{})[_0x7416('0xa3')](function(){for(var _0x3b875c=0x0;_0x3b875c<_0x264f9b['body'][_0x7416('0x62')][_0x7416('0x59')];_0x3b875c+=0x1){socket[_0x7416('0x29')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x264f9b[_0x7416('0x5f')][_0x7416('0x62')][_0x3b875c]),'UserId':Number(_0x264f9b[_0x7416('0x52')]['id'])});}return _0x264f9b[_0x7416('0x5f')][_0x7416('0x62')];});}})[_0x7416('0x17')](respondWithResult(_0x338e3f,null))['catch'](handleError(_0x338e3f,null));};exports[_0x7416('0x11c')]=function(_0x507c8e,_0x5b4e74){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x507c8e[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x5b4e74,null))[_0x7416('0x17')](function(_0x34fb6b){if(_0x34fb6b){return _0x34fb6b[_0x7416('0x11c')](_0x507c8e['query'][_0x7416('0x62')])['then'](function(){if(_[_0x7416('0xb0')](_0x507c8e[_0x7416('0x43')][_0x7416('0x62')])){for(var _0x575605=0x0;_0x575605<_0x507c8e['query'][_0x7416('0x62')]['length'];_0x575605+=0x1){socket['emit'](_0x7416('0x11d'),{'ChatInteractionId':Number(_0x507c8e[_0x7416('0x43')][_0x7416('0x62')][_0x575605]),'UserId':Number(_0x507c8e[_0x7416('0x52')]['id'])});}}else{socket[_0x7416('0x29')](_0x7416('0x11d'),{'ChatInteractionId':Number(_0x507c8e['query'][_0x7416('0x62')]),'UserId':Number(_0x507c8e['params']['id'])});}});}})[_0x7416('0x17')](respondWithStatusCode(_0x5b4e74,null))[_0x7416('0x1e')](handleError(_0x5b4e74,null));};exports['addMailInteractions']=function(_0x4da328,_0x128608){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x4da328['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x128608,null))[_0x7416('0x17')](function(_0x29dd16){if(_0x29dd16){return _0x29dd16[_0x7416('0x11e')](_0x4da328['body'][_0x7416('0x62')],_[_0x7416('0x63')](_0x4da328['body'],['ids','id'])||{})[_0x7416('0xa3')](function(){for(var _0x229955=0x0;_0x229955<_0x4da328['body'][_0x7416('0x62')]['length'];_0x229955+=0x1){socket['emit'](_0x7416('0x11f'),{'MailInteractionId':Number(_0x4da328['body']['ids'][_0x229955]),'UserId':Number(_0x4da328[_0x7416('0x52')]['id'])});}return _0x4da328['body'][_0x7416('0x62')];});}})[_0x7416('0x17')](respondWithResult(_0x128608,null))[_0x7416('0x1e')](handleError(_0x128608,null));};exports[_0x7416('0x120')]=function(_0x30f312,_0xab0b67){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x30f312[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0xab0b67,null))['then'](function(_0x3bb2f3){if(_0x3bb2f3){return _0x3bb2f3[_0x7416('0x120')](_0x30f312[_0x7416('0x43')][_0x7416('0x62')])[_0x7416('0x17')](function(){if(_[_0x7416('0xb0')](_0x30f312[_0x7416('0x43')][_0x7416('0x62')])){for(var _0x544f4b=0x0;_0x544f4b<_0x30f312[_0x7416('0x43')][_0x7416('0x62')]['length'];_0x544f4b+=0x1){socket[_0x7416('0x29')](_0x7416('0x121'),{'MailInteractionId':Number(_0x30f312[_0x7416('0x43')][_0x7416('0x62')][_0x544f4b]),'UserId':Number(_0x30f312['params']['id'])});}}else{socket['emit'](_0x7416('0x121'),{'MailInteractionId':Number(_0x30f312[_0x7416('0x43')][_0x7416('0x62')]),'UserId':Number(_0x30f312[_0x7416('0x52')]['id'])});}});}})[_0x7416('0x17')](respondWithStatusCode(_0xab0b67,null))[_0x7416('0x1e')](handleError(_0xab0b67,null));};exports[_0x7416('0x122')]=function(_0xa6ea2a,_0x169d60){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0xa6ea2a[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x169d60,null))[_0x7416('0x17')](function(_0x5732ee){if(_0x5732ee){return _0x5732ee['addFaxInteractions'](_0xa6ea2a[_0x7416('0x5f')]['ids'],_[_0x7416('0x63')](_0xa6ea2a[_0x7416('0x5f')],[_0x7416('0x62'),'id'])||{})[_0x7416('0xa3')](function(){for(var _0x1af5e2=0x0;_0x1af5e2<_0xa6ea2a[_0x7416('0x5f')][_0x7416('0x62')]['length'];_0x1af5e2+=0x1){socket[_0x7416('0x29')](_0x7416('0x123'),{'FaxInteractionId':Number(_0xa6ea2a['body'][_0x7416('0x62')][_0x1af5e2]),'UserId':Number(_0xa6ea2a[_0x7416('0x52')]['id'])});}return _0xa6ea2a[_0x7416('0x5f')][_0x7416('0x62')];});}})['then'](respondWithResult(_0x169d60,null))[_0x7416('0x1e')](handleError(_0x169d60,null));};exports[_0x7416('0x124')]=function(_0x438d5b,_0x504af5){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x438d5b[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x504af5,null))[_0x7416('0x17')](function(_0x188c11){if(_0x188c11){return _0x188c11['removeFaxInteractions'](_0x438d5b[_0x7416('0x43')][_0x7416('0x62')])[_0x7416('0x17')](function(){if(_[_0x7416('0xb0')](_0x438d5b[_0x7416('0x43')][_0x7416('0x62')])){for(var _0x20a49d=0x0;_0x20a49d<_0x438d5b[_0x7416('0x43')][_0x7416('0x62')][_0x7416('0x59')];_0x20a49d+=0x1){socket[_0x7416('0x29')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x438d5b[_0x7416('0x43')][_0x7416('0x62')][_0x20a49d]),'UserId':Number(_0x438d5b['params']['id'])});}}else{socket[_0x7416('0x29')](_0x7416('0x125'),{'FaxInteractionId':Number(_0x438d5b[_0x7416('0x43')][_0x7416('0x62')]),'UserId':Number(_0x438d5b[_0x7416('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x504af5,null))[_0x7416('0x1e')](handleError(_0x504af5,null));};exports[_0x7416('0x126')]=function(_0x156fde,_0x4b3a52){return db['User']['find']({'where':{'id':_0x156fde['params']['id']}})['then'](handleEntityNotFound(_0x4b3a52,null))['then'](function(_0x55bd99){if(_0x55bd99){return _0x55bd99[_0x7416('0x126')](_0x156fde['body'][_0x7416('0x62')],_[_0x7416('0x63')](_0x156fde['body'],['ids','id'])||{})['spread'](function(){for(var _0x5d6dd9=0x0;_0x5d6dd9<_0x156fde[_0x7416('0x5f')][_0x7416('0x62')][_0x7416('0x59')];_0x5d6dd9+=0x1){socket[_0x7416('0x29')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x156fde['body']['ids'][_0x5d6dd9]),'UserId':Number(_0x156fde[_0x7416('0x52')]['id'])});}return _0x156fde[_0x7416('0x5f')]['ids'];});}})[_0x7416('0x17')](respondWithResult(_0x4b3a52,null))[_0x7416('0x1e')](handleError(_0x4b3a52,null));};exports[_0x7416('0x127')]=function(_0x201447,_0x29f0ca){return db['User'][_0x7416('0x35')]({'where':{'id':_0x201447[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x29f0ca,null))[_0x7416('0x17')](function(_0x366a29){if(_0x366a29){return _0x366a29[_0x7416('0x127')](_0x201447[_0x7416('0x43')][_0x7416('0x62')])[_0x7416('0x17')](function(){if(_['isArray'](_0x201447[_0x7416('0x43')][_0x7416('0x62')])){for(var _0x324dc4=0x0;_0x324dc4<_0x201447[_0x7416('0x43')][_0x7416('0x62')][_0x7416('0x59')];_0x324dc4+=0x1){socket[_0x7416('0x29')](_0x7416('0x128'),{'SmsInteractionId':Number(_0x201447[_0x7416('0x43')][_0x7416('0x62')][_0x324dc4]),'UserId':Number(_0x201447['params']['id'])});}}else{socket[_0x7416('0x29')](_0x7416('0x128'),{'SmsInteractionId':Number(_0x201447[_0x7416('0x43')]['ids']),'UserId':Number(_0x201447[_0x7416('0x52')]['id'])});}});}})[_0x7416('0x17')](respondWithStatusCode(_0x29f0ca,null))['catch'](handleError(_0x29f0ca,null));};exports[_0x7416('0x129')]=function(_0x559f7b,_0x105179){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x559f7b[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x105179,null))['then'](function(_0x39f6c8){if(_0x39f6c8){return _0x39f6c8[_0x7416('0x129')](_0x559f7b[_0x7416('0x5f')]['ids'],_[_0x7416('0x63')](_0x559f7b[_0x7416('0x5f')],[_0x7416('0x62'),'id'])||{})[_0x7416('0xa3')](function(){for(var _0x44c735=0x0;_0x44c735<_0x559f7b[_0x7416('0x5f')][_0x7416('0x62')]['length'];_0x44c735+=0x1){socket[_0x7416('0x29')](_0x7416('0x12a'),{'OpenchannelInteractionId':Number(_0x559f7b[_0x7416('0x5f')][_0x7416('0x62')][_0x44c735]),'UserId':Number(_0x559f7b['params']['id'])});}return _0x559f7b[_0x7416('0x5f')][_0x7416('0x62')];});}})[_0x7416('0x17')](respondWithResult(_0x105179,null))[_0x7416('0x1e')](handleError(_0x105179,null));};exports[_0x7416('0x12b')]=function(_0x15538a,_0x545890){return db['User'][_0x7416('0x35')]({'where':{'id':_0x15538a['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x545890,null))[_0x7416('0x17')](function(_0x2410b3){if(_0x2410b3){return _0x2410b3['removeOpenchannelInteractions'](_0x15538a[_0x7416('0x43')][_0x7416('0x62')])[_0x7416('0x17')](function(){if(_[_0x7416('0xb0')](_0x15538a[_0x7416('0x43')][_0x7416('0x62')])){for(var _0x25f696=0x0;_0x25f696<_0x15538a['query'][_0x7416('0x62')][_0x7416('0x59')];_0x25f696+=0x1){socket[_0x7416('0x29')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x15538a[_0x7416('0x43')][_0x7416('0x62')][_0x25f696]),'UserId':Number(_0x15538a[_0x7416('0x52')]['id'])});}}else{socket[_0x7416('0x29')](_0x7416('0x12c'),{'OpenchannelInteractionId':Number(_0x15538a[_0x7416('0x43')][_0x7416('0x62')]),'UserId':Number(_0x15538a[_0x7416('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x545890,null))['catch'](handleError(_0x545890,null));};exports[_0x7416('0x12d')]=function(_0x133fc2,_0x4e2cf8){return db[_0x7416('0x3c')]['find']({'where':{'id':_0x133fc2[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x4e2cf8,null))[_0x7416('0x17')](function(_0x40fb09){if(_0x40fb09){return _0x40fb09[_0x7416('0x12d')](_0x133fc2[_0x7416('0x5f')][_0x7416('0x62')],_[_0x7416('0x63')](_0x133fc2[_0x7416('0x5f')],[_0x7416('0x62'),'id'])||{})['spread'](function(){for(var _0x3363ef=0x0;_0x3363ef<_0x133fc2[_0x7416('0x5f')]['ids'][_0x7416('0x59')];_0x3363ef+=0x1){socket[_0x7416('0x29')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x133fc2[_0x7416('0x5f')]['ids'][_0x3363ef]),'UserId':Number(_0x133fc2[_0x7416('0x52')]['id'])});}return _0x133fc2['body'][_0x7416('0x62')];});}})['then'](respondWithResult(_0x4e2cf8,null))['catch'](handleError(_0x4e2cf8,null));};exports[_0x7416('0x12e')]=function(_0x260861,_0x381713){return db['User']['find']({'where':{'id':_0x260861[_0x7416('0x52')]['id']}})['then'](handleEntityNotFound(_0x381713,null))[_0x7416('0x17')](function(_0x1f9ec2){if(_0x1f9ec2){return _0x1f9ec2[_0x7416('0x12e')](_0x260861[_0x7416('0x43')][_0x7416('0x62')]);}})['then'](respondWithStatusCode(_0x381713,null))['catch'](handleError(_0x381713,null));};exports[_0x7416('0x12f')]=function(_0x16ddd8,_0x3a5763){var _0x5a7f28={};var _0x6b9e4c={};var _0x5dfcf2;var _0x3d3eec;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x16ddd8[_0x7416('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a5763,null))[_0x7416('0x17')](function(_0xe2090d){if(_0xe2090d){_0x5dfcf2=_0xe2090d;_0x6b9e4c[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0x130')][_0x7416('0x3d')]);_0x6b9e4c[_0x7416('0x43')]=_[_0x7416('0x53')](_0x16ddd8['query']);_0x6b9e4c['filters']=_[_0x7416('0x56')](_0x6b9e4c[_0x7416('0x57')],_0x6b9e4c[_0x7416('0x43')]);_0x5a7f28['attributes']=_[_0x7416('0x56')](_0x6b9e4c[_0x7416('0x57')],qs[_0x7416('0x58')](_0x16ddd8[_0x7416('0x43')][_0x7416('0x58')]));_0x5a7f28[_0x7416('0x47')]=_0x5a7f28[_0x7416('0x47')]['length']?_0x5a7f28[_0x7416('0x47')]:_0x6b9e4c[_0x7416('0x57')];_0x5a7f28['order']=qs['sort'](_0x16ddd8['query']['sort']);_0x5a7f28[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x16ddd8[_0x7416('0x43')],_0x6b9e4c[_0x7416('0x55')]));if(_0x16ddd8[_0x7416('0x43')][_0x7416('0x30')]){_0x5a7f28['where']=_[_0x7416('0x5b')](_0x5a7f28[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x5a7f28[_0x7416('0x47')],function(_0x1624ae){var _0x25d1cf={};_0x25d1cf[_0x1624ae]={'$like':'%'+_0x16ddd8[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x25d1cf;})});}_0x5a7f28=_[_0x7416('0x5b')]({},_0x5a7f28,_0x16ddd8[_0x7416('0x5c')]);return _0x5dfcf2[_0x7416('0x12f')](_0x5a7f28);}})[_0x7416('0x17')](function(_0x911e31){if(_0x911e31){_0x3d3eec=_0x911e31[_0x7416('0x59')];if(!_0x16ddd8[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x5a7f28[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x16ddd8[_0x7416('0x43')]['limit']);_0x5a7f28[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x16ddd8[_0x7416('0x43')]['offset']);}return _0x5dfcf2['getVoicePrefixes'](_0x5a7f28);}})['then'](function(_0x2f6cc6){if(_0x2f6cc6){return _0x2f6cc6?{'count':_0x3d3eec,'rows':_0x2f6cc6}:null;}})[_0x7416('0x17')](respondWithResult(_0x3a5763,null))['catch'](handleError(_0x3a5763,null));};exports[_0x7416('0x131')]=function(_0x2b3d4f,_0x550251){var _0x5d3fab={};var _0x2e5f28={};var _0x5e2a08;var _0x2b5133;return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x2b3d4f[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x550251,null))[_0x7416('0x17')](function(_0x908c3b){if(_0x908c3b){_0x5e2a08=_0x908c3b;_0x2e5f28[_0x7416('0x57')]=_[_0x7416('0x53')](db['FaxAccount'][_0x7416('0x3d')]);_0x2e5f28[_0x7416('0x43')]=_['keys'](_0x2b3d4f[_0x7416('0x43')]);_0x2e5f28[_0x7416('0x55')]=_[_0x7416('0x56')](_0x2e5f28[_0x7416('0x57')],_0x2e5f28[_0x7416('0x43')]);_0x5d3fab[_0x7416('0x47')]=_['intersection'](_0x2e5f28[_0x7416('0x57')],qs[_0x7416('0x58')](_0x2b3d4f[_0x7416('0x43')][_0x7416('0x58')]));_0x5d3fab['attributes']=_0x5d3fab['attributes'][_0x7416('0x59')]?_0x5d3fab[_0x7416('0x47')]:_0x2e5f28['model'];_0x5d3fab[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x2b3d4f[_0x7416('0x43')][_0x7416('0xd2')]);_0x5d3fab[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x2b3d4f[_0x7416('0x43')],_0x2e5f28[_0x7416('0x55')]));if(_0x2b3d4f['query'][_0x7416('0x30')]){_0x5d3fab[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x5d3fab['where'],{'$or':_[_0x7416('0x32')](_0x5d3fab[_0x7416('0x47')],function(_0xdc4a4){var _0x5ad88c={};_0x5ad88c[_0xdc4a4]={'$like':'%'+_0x2b3d4f['query'][_0x7416('0x30')]+'%'};return _0x5ad88c;})});}_0x5d3fab=_[_0x7416('0x5b')]({},_0x5d3fab,_0x2b3d4f[_0x7416('0x5c')]);return _0x5e2a08[_0x7416('0x131')](_0x5d3fab);}})[_0x7416('0x17')](function(_0x18a87b){if(_0x18a87b){_0x2b5133=_0x18a87b[_0x7416('0x59')];if(!_0x2b3d4f[_0x7416('0x43')]['hasOwnProperty'](_0x7416('0xd4'))){_0x5d3fab[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x2b3d4f['query'][_0x7416('0x21')]);_0x5d3fab[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x2b3d4f[_0x7416('0x43')][_0x7416('0x23')]);}return _0x5e2a08[_0x7416('0x131')](_0x5d3fab);}})['then'](function(_0xead24b){if(_0xead24b){return _0xead24b?{'count':_0x2b5133,'rows':_0xead24b}:null;}})[_0x7416('0x17')](respondWithResult(_0x550251,null))[_0x7416('0x1e')](handleError(_0x550251,null));};exports[_0x7416('0x132')]=function(_0xf069a1,_0x132d16){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0xf069a1['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x132d16,null))[_0x7416('0x17')](function(_0x20e886){if(_0x20e886){return _0x20e886[_0x7416('0x132')](_0xf069a1[_0x7416('0x5f')]['ids'],_[_0x7416('0x63')](_0xf069a1[_0x7416('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x132d16,null))['catch'](handleError(_0x132d16,null));};exports[_0x7416('0x133')]=function(_0x331246,_0x581541){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x331246[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x581541,null))[_0x7416('0x17')](function(_0x2ca4c0){if(_0x2ca4c0){return _0x2ca4c0[_0x7416('0x133')](_0x331246[_0x7416('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x581541,null))['catch'](handleError(_0x581541,null));};exports[_0x7416('0x134')]=function(_0x126c4b,_0x56b2c2){var _0x290d1b={};var _0x3f465a={};var _0x5c5071;var _0xfae61c;return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x126c4b[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x56b2c2,null))[_0x7416('0x17')](function(_0xc2e889){if(_0xc2e889){_0x5c5071=_0xc2e889;_0x3f465a[_0x7416('0x57')]=_[_0x7416('0x53')](db['MailAccount'][_0x7416('0x3d')]);_0x3f465a[_0x7416('0x43')]=_[_0x7416('0x53')](_0x126c4b[_0x7416('0x43')]);_0x3f465a['filters']=_[_0x7416('0x56')](_0x3f465a[_0x7416('0x57')],_0x3f465a[_0x7416('0x43')]);_0x290d1b[_0x7416('0x47')]=_['intersection'](_0x3f465a[_0x7416('0x57')],qs[_0x7416('0x58')](_0x126c4b[_0x7416('0x43')]['fields']));_0x290d1b['attributes']=_0x290d1b[_0x7416('0x47')]['length']?_0x290d1b[_0x7416('0x47')]:_0x3f465a[_0x7416('0x57')];_0x290d1b[_0x7416('0xd1')]=qs['sort'](_0x126c4b[_0x7416('0x43')]['sort']);_0x290d1b[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x126c4b[_0x7416('0x43')],_0x3f465a[_0x7416('0x55')]));if(_0x126c4b['query'][_0x7416('0x30')]){_0x290d1b['where']=_[_0x7416('0x5b')](_0x290d1b[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x290d1b['attributes'],function(_0x2914c6){var _0x1b9fca={};_0x1b9fca[_0x2914c6]={'$like':'%'+_0x126c4b[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x1b9fca;})});}_0x290d1b=_['merge']({},_0x290d1b,_0x126c4b[_0x7416('0x5c')]);return _0x5c5071[_0x7416('0x134')](_0x290d1b);}})['then'](function(_0x320a9e){if(_0x320a9e){_0xfae61c=_0x320a9e[_0x7416('0x59')];if(!_0x126c4b[_0x7416('0x43')][_0x7416('0xca')]('nolimit')){_0x290d1b[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x126c4b[_0x7416('0x43')][_0x7416('0x21')]);_0x290d1b[_0x7416('0x23')]=qs['offset'](_0x126c4b[_0x7416('0x43')][_0x7416('0x23')]);}return _0x5c5071['getMailAccounts'](_0x290d1b);}})[_0x7416('0x17')](function(_0x2b9802){if(_0x2b9802){return _0x2b9802?{'count':_0xfae61c,'rows':_0x2b9802}:null;}})['then'](respondWithResult(_0x56b2c2,null))[_0x7416('0x1e')](handleError(_0x56b2c2,null));};exports[_0x7416('0x135')]=function(_0x11bcd7,_0x477066){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x11bcd7[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x477066,null))[_0x7416('0x17')](function(_0xcfe19f){if(_0xcfe19f){return _0xcfe19f['addMailAccounts'](_0x11bcd7[_0x7416('0x5f')][_0x7416('0x62')],_[_0x7416('0x63')](_0x11bcd7['body'],['ids','id'])||{});}})[_0x7416('0x17')](respondWithResult(_0x477066,null))[_0x7416('0x1e')](handleError(_0x477066,null));};exports[_0x7416('0x136')]=function(_0x5c2e05,_0x5a7c4d){return db['User']['find']({'where':{'id':_0x5c2e05[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x5a7c4d,null))['then'](function(_0x15a656){if(_0x15a656){return _0x15a656[_0x7416('0x136')](_0x5c2e05[_0x7416('0x43')][_0x7416('0x62')]);}})[_0x7416('0x17')](respondWithStatusCode(_0x5a7c4d,null))[_0x7416('0x1e')](handleError(_0x5a7c4d,null));};exports[_0x7416('0x137')]=function(_0x4a51c1,_0x16d3d8){var _0x2833a2={};var _0x4e68aa={};var _0x21b108;var _0x488da8;return db[_0x7416('0x3c')]['findOne']({'where':{'id':_0x4a51c1[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x16d3d8,null))[_0x7416('0x17')](function(_0x37015f){if(_0x37015f){_0x21b108=_0x37015f;_0x4e68aa[_0x7416('0x57')]=_[_0x7416('0x53')](db[_0x7416('0x138')][_0x7416('0x3d')]);_0x4e68aa['query']=_[_0x7416('0x53')](_0x4a51c1[_0x7416('0x43')]);_0x4e68aa[_0x7416('0x55')]=_[_0x7416('0x56')](_0x4e68aa[_0x7416('0x57')],_0x4e68aa[_0x7416('0x43')]);_0x2833a2[_0x7416('0x47')]=_[_0x7416('0x56')](_0x4e68aa['model'],qs['fields'](_0x4a51c1['query']['fields']));_0x2833a2[_0x7416('0x47')]=_0x2833a2['attributes'][_0x7416('0x59')]?_0x2833a2['attributes']:_0x4e68aa[_0x7416('0x57')];_0x2833a2['order']=qs['sort'](_0x4a51c1['query'][_0x7416('0xd2')]);_0x2833a2[_0x7416('0x42')]=qs['filters'](_['pick'](_0x4a51c1[_0x7416('0x43')],_0x4e68aa['filters']));if(_0x4a51c1[_0x7416('0x43')][_0x7416('0x30')]){_0x2833a2[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x2833a2['where'],{'$or':_[_0x7416('0x32')](_0x2833a2['attributes'],function(_0x3fdf35){var _0x18cd2e={};_0x18cd2e[_0x3fdf35]={'$like':'%'+_0x4a51c1['query']['filter']+'%'};return _0x18cd2e;})});}_0x2833a2=_[_0x7416('0x5b')]({},_0x2833a2,_0x4a51c1[_0x7416('0x5c')]);return _0x21b108[_0x7416('0x137')](_0x2833a2);}})[_0x7416('0x17')](function(_0x559e9a){if(_0x559e9a){_0x488da8=_0x559e9a['length'];if(!_0x4a51c1['query'][_0x7416('0xca')]('nolimit')){_0x2833a2[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x4a51c1[_0x7416('0x43')][_0x7416('0x21')]);_0x2833a2[_0x7416('0x23')]=qs['offset'](_0x4a51c1[_0x7416('0x43')][_0x7416('0x23')]);}return _0x21b108['getOpenchannelAccounts'](_0x2833a2);}})[_0x7416('0x17')](function(_0x53e5c8){if(_0x53e5c8){return _0x53e5c8?{'count':_0x488da8,'rows':_0x53e5c8}:null;}})['then'](respondWithResult(_0x16d3d8,null))[_0x7416('0x1e')](handleError(_0x16d3d8,null));};exports[_0x7416('0x139')]=function(_0xbb6778,_0x5e3ca5){return db[_0x7416('0x3c')]['find']({'where':{'id':_0xbb6778[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x5e3ca5,null))[_0x7416('0x17')](function(_0x245b98){if(_0x245b98){return _0x245b98['addOpenchannelAccounts'](_0xbb6778[_0x7416('0x5f')][_0x7416('0x62')],_[_0x7416('0x63')](_0xbb6778[_0x7416('0x5f')],['ids','id'])||{});}})[_0x7416('0x17')](respondWithResult(_0x5e3ca5,null))[_0x7416('0x1e')](handleError(_0x5e3ca5,null));};exports['removeOpenchannelAccounts']=function(_0x11c560,_0x48406a){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x11c560[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x48406a,null))[_0x7416('0x17')](function(_0x2f14ff){if(_0x2f14ff){return _0x2f14ff[_0x7416('0x13a')](_0x11c560['query'][_0x7416('0x62')]);}})['then'](respondWithStatusCode(_0x48406a,null))[_0x7416('0x1e')](handleError(_0x48406a,null));};exports['getSmsAccounts']=function(_0x44eec2,_0x393c0d){var _0x24d2d3={};var _0x1e4b6f={};var _0x3ef19c;var _0xbd265c;return db['User'][_0x7416('0x97')]({'where':{'id':_0x44eec2['params']['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x393c0d,null))[_0x7416('0x17')](function(_0x281db0){if(_0x281db0){_0x3ef19c=_0x281db0;_0x1e4b6f['model']=_[_0x7416('0x53')](db[_0x7416('0x13b')]['rawAttributes']);_0x1e4b6f[_0x7416('0x43')]=_[_0x7416('0x53')](_0x44eec2[_0x7416('0x43')]);_0x1e4b6f[_0x7416('0x55')]=_[_0x7416('0x56')](_0x1e4b6f[_0x7416('0x57')],_0x1e4b6f['query']);_0x24d2d3[_0x7416('0x47')]=_['intersection'](_0x1e4b6f['model'],qs[_0x7416('0x58')](_0x44eec2['query']['fields']));_0x24d2d3['attributes']=_0x24d2d3[_0x7416('0x47')][_0x7416('0x59')]?_0x24d2d3[_0x7416('0x47')]:_0x1e4b6f[_0x7416('0x57')];_0x24d2d3[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x44eec2['query'][_0x7416('0xd2')]);_0x24d2d3[_0x7416('0x42')]=qs['filters'](_['pick'](_0x44eec2['query'],_0x1e4b6f['filters']));if(_0x44eec2[_0x7416('0x43')][_0x7416('0x30')]){_0x24d2d3[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x24d2d3[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x24d2d3['attributes'],function(_0x4f8a8e){var _0x2776ea={};_0x2776ea[_0x4f8a8e]={'$like':'%'+_0x44eec2[_0x7416('0x43')]['filter']+'%'};return _0x2776ea;})});}_0x24d2d3=_['merge']({},_0x24d2d3,_0x44eec2[_0x7416('0x5c')]);return _0x3ef19c[_0x7416('0x13c')](_0x24d2d3);}})[_0x7416('0x17')](function(_0x4492f1){if(_0x4492f1){_0xbd265c=_0x4492f1['length'];if(!_0x44eec2[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x24d2d3[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x44eec2[_0x7416('0x43')]['limit']);_0x24d2d3['offset']=qs[_0x7416('0x23')](_0x44eec2[_0x7416('0x43')]['offset']);}return _0x3ef19c[_0x7416('0x13c')](_0x24d2d3);}})['then'](function(_0x2f2b87){if(_0x2f2b87){return _0x2f2b87?{'count':_0xbd265c,'rows':_0x2f2b87}:null;}})[_0x7416('0x17')](respondWithResult(_0x393c0d,null))['catch'](handleError(_0x393c0d,null));};exports[_0x7416('0x13d')]=function(_0x43e36d,_0x5ad34d){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x43e36d[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x5ad34d,null))[_0x7416('0x17')](function(_0x51d4d7){if(_0x51d4d7){return _0x51d4d7[_0x7416('0x13d')](_0x43e36d[_0x7416('0x5f')]['ids'],_['omit'](_0x43e36d[_0x7416('0x5f')],['ids','id'])||{});}})[_0x7416('0x17')](respondWithResult(_0x5ad34d,null))[_0x7416('0x1e')](handleError(_0x5ad34d,null));};exports['removeSmsAccounts']=function(_0x220616,_0x1baeb4){return db['User'][_0x7416('0x35')]({'where':{'id':_0x220616[_0x7416('0x52')]['id']}})['then'](handleEntityNotFound(_0x1baeb4,null))[_0x7416('0x17')](function(_0x55382e){if(_0x55382e){return _0x55382e[_0x7416('0x13e')](_0x220616[_0x7416('0x43')][_0x7416('0x62')]);}})['then'](respondWithStatusCode(_0x1baeb4,null))[_0x7416('0x1e')](handleError(_0x1baeb4,null));};exports[_0x7416('0x13f')]=function(_0x17e3ab,_0x4b7afe){var _0x3cc2e3={};var _0xbad931={};var _0x229266;var _0x3e3693;return db['User'][_0x7416('0x97')]({'where':{'id':_0x17e3ab[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x4b7afe,null))[_0x7416('0x17')](function(_0x24e8a8){if(_0x24e8a8){_0x229266=_0x24e8a8;_0xbad931[_0x7416('0x57')]=_['keys'](db['ChatWebsite'][_0x7416('0x3d')]);_0xbad931['query']=_[_0x7416('0x53')](_0x17e3ab['query']);_0xbad931[_0x7416('0x55')]=_['intersection'](_0xbad931[_0x7416('0x57')],_0xbad931[_0x7416('0x43')]);_0x3cc2e3[_0x7416('0x47')]=_[_0x7416('0x56')](_0xbad931[_0x7416('0x57')],qs[_0x7416('0x58')](_0x17e3ab[_0x7416('0x43')]['fields']));_0x3cc2e3[_0x7416('0x47')]=_0x3cc2e3[_0x7416('0x47')][_0x7416('0x59')]?_0x3cc2e3[_0x7416('0x47')]:_0xbad931['model'];_0x3cc2e3['order']=qs[_0x7416('0xd2')](_0x17e3ab['query'][_0x7416('0xd2')]);_0x3cc2e3[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x17e3ab[_0x7416('0x43')],_0xbad931[_0x7416('0x55')]));if(_0x17e3ab[_0x7416('0x43')][_0x7416('0x30')]){_0x3cc2e3[_0x7416('0x42')]=_[_0x7416('0x5b')](_0x3cc2e3[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x3cc2e3[_0x7416('0x47')],function(_0x16bc43){var _0x1ebce9={};_0x1ebce9[_0x16bc43]={'$like':'%'+_0x17e3ab[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x1ebce9;})});}_0x3cc2e3=_[_0x7416('0x5b')]({},_0x3cc2e3,_0x17e3ab[_0x7416('0x5c')]);return _0x229266[_0x7416('0x13f')](_0x3cc2e3);}})[_0x7416('0x17')](function(_0x24575d){if(_0x24575d){_0x3e3693=_0x24575d[_0x7416('0x59')];if(!_0x17e3ab[_0x7416('0x43')]['hasOwnProperty'](_0x7416('0xd4'))){_0x3cc2e3[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x17e3ab[_0x7416('0x43')][_0x7416('0x21')]);_0x3cc2e3[_0x7416('0x23')]=qs['offset'](_0x17e3ab[_0x7416('0x43')][_0x7416('0x23')]);}return _0x229266[_0x7416('0x13f')](_0x3cc2e3);}})[_0x7416('0x17')](function(_0x21d65c){if(_0x21d65c){return _0x21d65c?{'count':_0x3e3693,'rows':_0x21d65c}:null;}})[_0x7416('0x17')](respondWithResult(_0x4b7afe,null))[_0x7416('0x1e')](handleError(_0x4b7afe,null));};exports['addChatWebsites']=function(_0x4ebc51,_0x538f2e){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x4ebc51[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x538f2e,null))['then'](function(_0x5bcf7f){if(_0x5bcf7f){return _0x5bcf7f['addChatWebsites'](_0x4ebc51['body']['ids'],_['omit'](_0x4ebc51[_0x7416('0x5f')],[_0x7416('0x62'),'id'])||{});}})[_0x7416('0x17')](respondWithResult(_0x538f2e,null))['catch'](handleError(_0x538f2e,null));};exports[_0x7416('0x140')]=function(_0x3898a4,_0x1be038){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x3898a4[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x1be038,null))['then'](function(_0x20c535){if(_0x20c535){return _0x20c535['removeChatWebsites'](_0x3898a4[_0x7416('0x43')][_0x7416('0x62')]);}})[_0x7416('0x17')](respondWithStatusCode(_0x1be038,null))[_0x7416('0x1e')](handleError(_0x1be038,null));};exports[_0x7416('0x141')]=function(_0x11fa02,_0x1b9522){var _0x53507d={};var _0x27974c={};var _0x34755d;var _0x36a441;return db[_0x7416('0x3c')][_0x7416('0x97')]({'where':{'id':_0x11fa02[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x1b9522,null))[_0x7416('0x17')](function(_0x612137){if(_0x612137){_0x34755d=_0x612137;_0x27974c[_0x7416('0x57')]=_['keys'](db[_0x7416('0x142')][_0x7416('0x3d')]);_0x27974c[_0x7416('0x43')]=_[_0x7416('0x53')](_0x11fa02[_0x7416('0x43')]);_0x27974c['filters']=_[_0x7416('0x56')](_0x27974c[_0x7416('0x57')],_0x27974c[_0x7416('0x43')]);_0x53507d[_0x7416('0x47')]=_[_0x7416('0x56')](_0x27974c[_0x7416('0x57')],qs[_0x7416('0x58')](_0x11fa02[_0x7416('0x43')][_0x7416('0x58')]));_0x53507d[_0x7416('0x47')]=_0x53507d[_0x7416('0x47')][_0x7416('0x59')]?_0x53507d[_0x7416('0x47')]:_0x27974c['model'];_0x53507d[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x11fa02[_0x7416('0x43')][_0x7416('0xd2')]);_0x53507d[_0x7416('0x42')]=qs[_0x7416('0x55')](_[_0x7416('0xd5')](_0x11fa02[_0x7416('0x43')],_0x27974c['filters']));if(_0x11fa02[_0x7416('0x43')][_0x7416('0x30')]){_0x53507d[_0x7416('0x42')]=_['merge'](_0x53507d[_0x7416('0x42')],{'$or':_['map'](_0x53507d[_0x7416('0x47')],function(_0x172bf9){var _0x636026={};_0x636026[_0x172bf9]={'$like':'%'+_0x11fa02['query'][_0x7416('0x30')]+'%'};return _0x636026;})});}_0x53507d=_['merge']({},_0x53507d,_0x11fa02[_0x7416('0x5c')]);return _0x34755d[_0x7416('0x141')](_0x53507d);}})['then'](function(_0x5bcdff){if(_0x5bcdff){_0x36a441=_0x5bcdff[_0x7416('0x59')];if(!_0x11fa02[_0x7416('0x43')][_0x7416('0xca')](_0x7416('0xd4'))){_0x53507d[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x11fa02[_0x7416('0x43')][_0x7416('0x21')]);_0x53507d['offset']=qs[_0x7416('0x23')](_0x11fa02[_0x7416('0x43')]['offset']);}return _0x34755d[_0x7416('0x141')](_0x53507d);}})[_0x7416('0x17')](function(_0x408d48){if(_0x408d48){return _0x408d48?{'count':_0x36a441,'rows':_0x408d48}:null;}})['then'](respondWithResult(_0x1b9522,null))[_0x7416('0x1e')](handleError(_0x1b9522,null));};exports[_0x7416('0x143')]=function(_0x53a3d8,_0x1d93e1){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x53a3d8[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x1d93e1,null))['then'](function(_0x30f900){if(_0x30f900){return _0x30f900[_0x7416('0x143')](_0x53a3d8[_0x7416('0x5f')]['ids'],_[_0x7416('0x63')](_0x53a3d8[_0x7416('0x5f')],[_0x7416('0x62'),'id'])||{});}})[_0x7416('0x17')](respondWithResult(_0x1d93e1,null))[_0x7416('0x1e')](handleError(_0x1d93e1,null));};exports[_0x7416('0x144')]=function(_0x320b90,_0x4836c9){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x320b90[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x4836c9,null))[_0x7416('0x17')](function(_0x3256a4){if(_0x3256a4){return _0x3256a4[_0x7416('0x144')](_0x320b90['query']['ids']);}})[_0x7416('0x17')](respondWithStatusCode(_0x4836c9,null))[_0x7416('0x1e')](handleError(_0x4836c9,null));};exports[_0x7416('0x145')]=function(_0x48e5e7,_0x33a924){var _0x5ae366={},_0x4d3c29={},_0x417878={'count':0x0,'rows':[]};var _0x1594f5=db[_0x7416('0x146')]['rawAttributes'];_0x4d3c29[_0x7416('0x57')]=_['keys'](_0x1594f5);_0x4d3c29[_0x7416('0x43')]=_[_0x7416('0x53')](_0x48e5e7[_0x7416('0x43')]);_0x4d3c29[_0x7416('0x55')]=_[_0x7416('0x56')](_0x4d3c29[_0x7416('0x57')],_0x4d3c29[_0x7416('0x43')]);_0x4d3c29[_0x7416('0x55')]=_[_0x7416('0xc8')](_0x4d3c29[_0x7416('0x55')],['$and',_0x7416('0x147'),'$gt',_0x7416('0x148'),_0x7416('0x149'),_0x7416('0x14a'),_0x7416('0x14b'),'$eq','$not','$between',_0x7416('0x14c'),'$in',_0x7416('0x14d'),_0x7416('0x14e'),_0x7416('0x14f'),_0x7416('0x150'),_0x7416('0x151'),_0x7416('0x14e'),'$overlap','$contains',_0x7416('0x152'),'$any']);_0x5ae366[_0x7416('0x47')]=_['intersection'](_0x4d3c29[_0x7416('0x57')],qs[_0x7416('0x58')](_0x48e5e7[_0x7416('0x43')][_0x7416('0x58')]));_0x5ae366[_0x7416('0x47')]=_0x5ae366['attributes'][_0x7416('0x59')]?_0x5ae366['attributes']:_0x4d3c29[_0x7416('0x57')];if(!_0x48e5e7[_0x7416('0x43')]['hasOwnProperty'](_0x7416('0xd4'))){_0x5ae366[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x48e5e7['query'][_0x7416('0x21')]);_0x5ae366[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x48e5e7[_0x7416('0x43')][_0x7416('0x23')]);}_0x5ae366[_0x7416('0xd1')]=qs[_0x7416('0xd2')](_0x48e5e7[_0x7416('0x43')][_0x7416('0xd2')]);_0x5ae366[_0x7416('0x42')]=qs[_0x7416('0x55')](_['pick'](_0x48e5e7[_0x7416('0x43')],_0x4d3c29['filters']));if(_0x48e5e7[_0x7416('0x43')]['filter']){_0x5ae366['where']=_['merge'](_0x5ae366[_0x7416('0x42')],{'$or':_[_0x7416('0x32')](_0x5ae366['attributes'],function(_0x1f7733){var _0x112a47={};_0x112a47[_0x1f7733]={'$like':'%'+_0x48e5e7[_0x7416('0x43')][_0x7416('0x30')]+'%'};return _0x112a47;})});}_0x5ae366[_0x7416('0x42')]={'$and':[_0x5ae366[_0x7416('0x42')],{'$or':[{'UserId':_0x48e5e7[_0x7416('0x52')]['id']},{'OwnerId':_0x48e5e7[_0x7416('0x52')]['id']}]}]};_0x5ae366=_[_0x7416('0x5b')]({},_0x5ae366,_0x48e5e7[_0x7416('0x5c')]);var _0x3a9fb5={'where':_0x5ae366[_0x7416('0x42')]};return db[_0x7416('0x146')][_0x7416('0x22')](_0x3a9fb5)['then'](function(_0x32d3be){_0x417878[_0x7416('0x22')]=_0x32d3be;if(_0x48e5e7[_0x7416('0x43')][_0x7416('0x44')]){_0x5ae366[_0x7416('0x45')]=[{'attributes':['id',_0x7416('0x153'),_0x7416('0x154'),_0x7416('0xe6')],'model':db[_0x7416('0x155')],'as':'Contact'},{'attributes':['id',_0x7416('0x36'),_0x7416('0x156')],'model':db[_0x7416('0xa7')],'as':_0x7416('0xd0')}];}return db[_0x7416('0x146')][_0x7416('0x8b')](_0x5ae366);})[_0x7416('0x17')](function(_0x16da3d){_0x417878[_0x7416('0x48')]=_0x16da3d;return _0x417878;})[_0x7416('0x17')](respondWithFilteredResult(_0x33a924,_0x5ae366))[_0x7416('0x1e')](handleError(_0x33a924,null));};exports[_0x7416('0x157')]=function(_0x12d608,_0x19e209){if(!_[_0x7416('0x6a')](_0x12d608['user']['id'])&&(_0x12d608[_0x7416('0x7e')]['role']==_0x7416('0x2c')||_0x12d608['user'][_0x7416('0x27')]=='user')){return db['User']['findOne']({'where':{'id':_0x12d608[_0x7416('0x52')]['id']},'raw':!![]})['then'](function(_0x346601){return authService[_0x7416('0x158')](_0x346601);})[_0x7416('0x17')](function(_0x1e40e7){if(_0x1e40e7){return _0x19e209['status'](0xc8)[_0x7416('0x25')]({'api_key':_0x1e40e7['token']});}else{return _0x19e209[_0x7416('0x1f')](0xcc)[_0x7416('0x25')]({'message':_0x7416('0x159')});}})['catch'](handleError(_0x19e209,0x193));}else{return _0x19e209[_0x7416('0x1f')](0x191)['json']({'message':_0x7416('0x15a')});}};exports[_0x7416('0x15b')]=function(_0x54bdb2,_0x58498d){if(!_[_0x7416('0x6a')](_0x54bdb2[_0x7416('0x7e')]['id'])&&(_0x54bdb2['user'][_0x7416('0x27')]==_0x7416('0x2c')||_0x54bdb2['user'][_0x7416('0x27')]==_0x7416('0x7e'))){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x54bdb2['params']['id']}})[_0x7416('0x17')](function(_0x205f51){return authService['generateApiKey'](_0x205f51);})['then'](function(_0x54e1c7){return db[_0x7416('0x3c')][_0x7416('0x26')]({'apiKeyIat':_0x54e1c7[_0x7416('0x15c')],'apiKeyNonce':_0x54e1c7[_0x7416('0x15d')]},{'where':{'id':_0x54bdb2[_0x7416('0x52')]['id']}})[_0x7416('0x17')](function(){return _0x58498d[_0x7416('0x1f')](0xc8)[_0x7416('0x25')]({'api_key':_0x54e1c7[_0x7416('0x15e')]});});})['catch'](handleError(_0x58498d,0x193));}else{return _0x58498d['status'](0x191)['json']({'message':_0x7416('0x15a')});}};exports['removeApiKey']=function(_0x2daf8b,_0x157c83){if(!_['isNil'](_0x2daf8b[_0x7416('0x7e')]['id'])&&(_0x2daf8b[_0x7416('0x7e')][_0x7416('0x27')]==_0x7416('0x2c')||_0x2daf8b[_0x7416('0x7e')][_0x7416('0x27')]==_0x7416('0x7e'))){return db[_0x7416('0x3c')][_0x7416('0x35')]({'where':{'id':_0x2daf8b[_0x7416('0x52')]['id']}})[_0x7416('0x17')](handleEntityNotFound(_0x157c83,null))['then'](function(_0x4f3ff5){if(_0x4f3ff5&&_0x4f3ff5[_0x7416('0x15f')]&&_0x4f3ff5[_0x7416('0x160')])return _0x4f3ff5;else throw{'message':'API\x20key\x20not\x20available'};})[_0x7416('0x17')](function(){return db[_0x7416('0x3c')][_0x7416('0x26')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x2daf8b[_0x7416('0x52')]['id']}});})['then'](respondWithStatusCode(_0x157c83,0xc8))['catch'](handleError(_0x157c83,0x193));}else{return _0x157c83[_0x7416('0x1f')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x7416('0x161')]=function(_0x338aa8,_0x4c4b26){var _0xd606a4=_0x338aa8[_0x7416('0x7e')]['get']({'plain':!![]});if(!_0xd606a4){return _0x4c4b26[_0x7416('0x1f')](0x191)[_0x7416('0x162')](_0x7416('0x163'));}else{Promise[_0x7416('0xfa')]()[_0x7416('0x17')](function(){if(_0x338aa8[_0x7416('0x43')][_0x7416('0x46')]!=='true')return;return _0x338aa8[_0x7416('0x7e')]['getUserSetting']();})[_0x7416('0x17')](function(_0x261145){if(!_0x261145)return;return _0x261145[_0x7416('0x2b')]({'plain':!![]});})['then'](function(_0x11ca58){_0xd606a4[_0x7416('0x46')]=_0x11ca58;return _0x4c4b26[_0x7416('0x1f')](0xc8)[_0x7416('0x25')](_0xd606a4);});}};exports[_0x7416('0x164')]=function(_0x320664,_0xf9cf06){var _0x46dc47={'offset':0x0},_0x5a857d={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(!_0x320664['query'][_0x7416('0x30')]&&!_0x320664[_0x7416('0x43')][_0x7416('0x165')]&&!_0x320664[_0x7416('0x43')][_0x7416('0x166')])return[];return Promise[_0x7416('0xfa')]()[_0x7416('0x17')](function(){var _0x515ecb=[];if(!_['isEmpty'](_0x320664['query'][_0x7416('0x165')])){_0x515ecb[_0x7416('0x4c')](db[_0x7416('0x108')]['findAll']({'attributes':['id','name'],'where':{'id':_0x320664['query'][_0x7416('0x165')]}}));}if(!_[_0x7416('0x8c')](_0x320664['query'][_0x7416('0x166')])){_0x515ecb['push'](db[_0x7416('0xa7')][_0x7416('0x8b')]({'attributes':['id',_0x7416('0x36')],'type':_0x7416('0x167'),'where':{'id':_0x320664[_0x7416('0x43')]['queues']}}));}return Promise[_0x7416('0x8a')](_0x515ecb);})[_0x7416('0x17')](function(_0x1df9bb){var _0x4a5a32=_[_0x7416('0x168')](_0x1df9bb)[_0x7416('0x32')](function(_0x2579a8){return _0x2579a8[_0x7416('0x119')]({'attributes':['id',_0x7416('0x36'),_0x7416('0x64'),_0x7416('0x9d')],'raw':!![]});});return Promise['all'](_0x4a5a32);})[_0x7416('0x17')](function(_0x42640e){var _0x28e1bb=_[_0x7416('0x168')](_0x42640e);if(!_0x320664[_0x7416('0x43')][_0x7416('0x30')])return _0x28e1bb;if(_[_0x7416('0x8c')](_0x28e1bb)){return db['User']['findAll']({'attributes':['id',_0x7416('0x36'),'internal',_0x7416('0x9d')],'where':{'role':_0x7416('0x28'),'$or':[db[_0x7416('0x6c')]['where'](db['sequelize']['fn'](_0x7416('0x169'),db[_0x7416('0x6c')][_0x7416('0x16a')]('name')),{'$like':'%'+_0x320664[_0x7416('0x43')][_0x7416('0x30')][_0x7416('0xa1')]()+'%'}),{'internal':{'$like':'%'+_0x320664[_0x7416('0x43')][_0x7416('0x30')]+'%'}}]},'raw':!![]});}else{return _(_0x28e1bb)[_0x7416('0x168')]()[_0x7416('0x30')](function(_0xc538ad){return _0xc538ad[_0x7416('0x36')][_0x7416('0xa1')]()['includes'](_0x320664[_0x7416('0x43')][_0x7416('0x30')][_0x7416('0xa1')]())||_0xc538ad[_0x7416('0x64')]['toString']()[_0x7416('0x34')](_0x320664['query'][_0x7416('0x30')]);})[_0x7416('0x33')]();}})['then'](function(_0x5091ff){var _0x46da2d=_0x7416('0x36');var _0x56527a='asc';if(_0x320664[_0x7416('0x43')][_0x7416('0xd2')]){_0x56527a=_0x320664[_0x7416('0x43')]['sort'][0x0]==='-'?'desc':_0x7416('0x16b');_0x46da2d=_0x56527a===_0x7416('0x16b')?_0x320664[_0x7416('0x43')]['sort']:_0x320664['query'][_0x7416('0xd2')]['substring'](0x1);}return _(_0x5091ff)[_0x7416('0x16c')]('id')[_0x7416('0x16d')]([function(_0x225fab){return _0x46da2d===_0x7416('0x36')?_0x225fab[_0x46da2d][_0x7416('0xa1')]():_0x225fab[_0x46da2d];}],[_0x56527a])['map'](function(_0x3e6e7c){return _['pick'](_0x3e6e7c,['id',_0x7416('0x36'),_0x7416('0x64'),_0x7416('0x9d')]);})[_0x7416('0x33')]();})['then'](function(_0x3df09a){return amiClient[_0x7416('0x16')](_0x7416('0x2e'),_0x320664)[_0x7416('0x17')](function(_0x603c2){if(_0x603c2[_0x7416('0x1b')])throw new Error(_0x7416('0x16e'));var _0x354d19=_0x603c2['result'];var _0x4f4df9=jayson[_0x7416('0x16f')]['http']({'port':0x232c});return _0x4f4df9['request'](_0x7416('0x2e'),_0x320664)['then'](function(_0x2df22d){if(_0x2df22d[_0x7416('0x1b')])throw new Error(_0x7416('0x170'));var _0x2f906f=_0x2df22d[_0x7416('0x1d')];return _['merge']({},_0x2f906f,_0x354d19);});})[_0x7416('0x17')](function(_0x27077a){return _[_0x7416('0x32')](_0x3df09a,function(_0x200f3f){var _0x5d3248=_['find'](_0x27077a['rows'],['id',_0x200f3f['id']]);if(!_0x5d3248||!_0x200f3f[_0x7416('0x9d')]){_0x200f3f[_0x7416('0x1f')]=_0x7416('0x171');}else if(_0x5d3248[_0x7416('0xaa')]){_0x200f3f['status']=_0x7416('0xfc');}else{_0x200f3f[_0x7416('0x1f')]=_[_0x7416('0x34')]([_0x7416('0x172'),_0x7416('0x173'),_0x7416('0x174'),_0x7416('0x175'),null,undefined],_0x5d3248[_0x7416('0x176')])?_0x7416('0x9d'):_0x7416('0x177');}return _0x200f3f;});});});})[_0x7416('0x17')](function(_0x6d8151){if(!_0x320664[_0x7416('0x43')]['hasOwnProperty'](_0x7416('0xd4'))){_0x46dc47[_0x7416('0x21')]=qs[_0x7416('0x21')](_0x320664[_0x7416('0x43')]['limit']||0xa);_0x46dc47[_0x7416('0x23')]=qs[_0x7416('0x23')](_0x320664[_0x7416('0x43')][_0x7416('0x23')]);}_0x5a857d['count']=_0x6d8151['length'];_0x5a857d['rows']=_0x46dc47[_0x7416('0x21')]?_0x6d8151[_0x7416('0x178')](_0x46dc47[_0x7416('0x23')],_0x46dc47[_0x7416('0x23')]+_0x46dc47[_0x7416('0x21')]):_0x6d8151;return _0x5a857d;})[_0x7416('0x17')](respondWithFilteredResult(_0xf9cf06,_0x46dc47))[_0x7416('0x1e')](handleError(_0xf9cf06,null));};function get_open_tabs(_0x49abed,_0x35a309){var _0x3576a6=_0x49abed[_0x7416('0x179')](0x0)['toUpperCase']()+_0x49abed[_0x7416('0x178')](0x1);var _0x57da80={'type':db[_0x7416('0x90')][_0x7416('0x17a')][_0x7416('0x6d')],'raw':!![]};return new Promise(function(_0x372beb,_0x37ba9b){var _0x593939=squel['select']()['field'](_0x7416('0x17b')+_0x3576a6+_0x7416('0x17c'),'id')[_0x7416('0x17d')](_0x7416('0x17e'))['from'](_0x7416('0x17f')+_0x49abed+_0x7416('0x180'),'ui')[_0x7416('0x42')](_0x7416('0x181'),_0x35a309['id']);return db[_0x7416('0x6c')][_0x7416('0x43')](_0x593939[_0x7416('0x182')](),_0x57da80)['then'](function(_0x20ddce){_0x35a309[_0x3576a6+_0x7416('0x183')]=_0x20ddce;_0x372beb(_0x20ddce);})['catch'](function(_0x278a71){_0x37ba9b(_0x278a71);});});}
\ No newline at end of file
+var _0x00f4=['VoiceQueue','get','format','UserVoiceQueueRt','upsert','removeQueues','remove','Queue:remove','QueueId','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','hasOwnProperty','List','Tag','Tags','color','tag','Queue','order','sort','where','pick','merge','options','Unknown\x20role','getVoiceQueuesRt','nolimit','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','LOGININPAUSE','resolve','logout','pause','PAUSE','type','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','Team','getAssociatedQueues','flattenDeep','addAgent','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','UserVoicePrefix','getLists','CmList','getAgents','values','send','addChatInteractions','user_has_chat_interactions:save','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','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','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$or','$lt','$lte','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','lastName','phone','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','flatten','lower','toString','asc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','idle','unknown','unavailable','ringing','busy','slice','charAt','toUpperCase','field','ui.','ui.createdAt','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','squel','jayson/promise','ioredis','../../components/contacts','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','handleError','socket.io-emitter','redis','register','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','update','agent','emit','userNotification:recalc:','role','admin','Users','user','Agents','Telephones','filter','ignore','value','includes','name','UserProfileResource','destroy','stack','index','User','rawAttributes','fieldName','password','salt','getOptions','includeAll','include','query','userSetting','UserSetting','attributes','push','findAll','rows','openTabs','true','chat','dataValues','sms','fax','openchannel','whatsapp','catch','show','params','differenceBy','keys','filters','intersection','model','fields','length','find','mail','body','describe','addContacts','omit','Setting','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','104','106','107','108','109','100','111','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','map','telephone','isEmpty','autoAssociation','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','ids','capitalize','Queue:save','voice'];(function(_0x1fdd66,_0x1a89cd){var _0x4b2001=function(_0x11e32c){while(--_0x11e32c){_0x1fdd66['push'](_0x1fdd66['shift']());}};_0x4b2001(++_0x1a89cd);}(_0x00f4,0xe6));var _0x400f=function(_0x2ee154,_0x167992){_0x2ee154=_0x2ee154-0x0;var _0x2df327=_0x00f4[_0x2ee154];return _0x2df327;};'use strict';var moment=require(_0x400f('0x0'));var util=require(_0x400f('0x1'));var path=require(_0x400f('0x2'));var fs=require('fs');var _=require(_0x400f('0x3'));var squel=require(_0x400f('0x4'));var jayson=require(_0x400f('0x5'));var Redis=require(_0x400f('0x6'));var authService=require('../../components/auth/service');var contacts=require(_0x400f('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x400f('0x8'))(_0x400f('0x9'));var utils=require(_0x400f('0xa'));var config=require('../../config/environment');var licenseUtil=require(_0x400f('0xb'));var APIBadRequestError=require(_0x400f('0xc'))[_0x400f('0xd')];var APINotFoundError=require(_0x400f('0xc'))['APINotFoundError'];var APIHandleError=require(_0x400f('0xc'))[_0x400f('0xe')];var db=require('../../mysqldb')['db'];var socket=require(_0x400f('0xf'))(new Redis(config[_0x400f('0x10')]));require('./user.socket')[_0x400f('0x11')](socket);config[_0x400f('0x10')]=_['defaults'](config[_0x400f('0x10')],{'host':_0x400f('0x12'),'port':0x18eb});var amiClient=jayson[_0x400f('0x13')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x5955e7,_0x7517c,_0x184633,_0x5694fe){return new Promise(function(_0x2c7ad0,_0x11d900){var _0x3bd685=_0x5694fe||amiClient;return _0x3bd685[_0x400f('0x14')](_0x5955e7,_0x184633)[_0x400f('0x15')](function(_0x5eb657){logger[_0x400f('0x16')](_0x400f('0x17'),_0x7517c,_0x400f('0x18'));logger['debug'](_0x400f('0x19'),_0x7517c,_0x400f('0x18'),JSON[_0x400f('0x1a')](_0x5eb657));if(_0x5eb657[_0x400f('0x1b')]){if(_0x5eb657[_0x400f('0x1b')][_0x400f('0x1c')]===0x1f4){logger[_0x400f('0x1b')](_0x400f('0x17'),_0x7517c,_0x5eb657[_0x400f('0x1b')]['message']);return _0x11d900(_0x5eb657['error']['message']);}logger[_0x400f('0x1b')](_0x400f('0x17'),_0x7517c,_0x5eb657[_0x400f('0x1b')][_0x400f('0x1d')]);return _0x2c7ad0(_0x5eb657[_0x400f('0x1b')]['message']);}else{logger['info'](_0x400f('0x17'),_0x7517c,'request\x20sent');_0x2c7ad0(_0x5eb657[_0x400f('0x1e')]['message']);}})['catch'](function(_0x35ba1e){logger[_0x400f('0x1b')](_0x400f('0x17'),_0x7517c,_0x35ba1e);_0x11d900(_0x35ba1e);});});}function respondWithStatusCode(_0x384095,_0x1251a2){_0x1251a2=_0x1251a2||0xcc;return function(_0x53a77f){if(_0x53a77f){return _0x384095[_0x400f('0x1f')](_0x1251a2);}return _0x384095[_0x400f('0x20')](_0x1251a2)[_0x400f('0x21')]();};}function respondWithResult(_0x21891d,_0x286c4b){_0x286c4b=_0x286c4b||0xc8;return function(_0xdac0f5){if(_0xdac0f5){return _0x21891d['status'](_0x286c4b)[_0x400f('0x22')](_0xdac0f5);}};}function respondWithFilteredResult(_0x2301e0,_0x34c8d5){return function(_0x1ebba8){if(_0x1ebba8){var _0x4d5ae9=typeof _0x34c8d5['offset']==='undefined'&&typeof _0x34c8d5[_0x400f('0x23')]===_0x400f('0x24');var _0x226a7f=_0x1ebba8['count'];var _0x162a7e=_0x4d5ae9?0x0:_0x34c8d5[_0x400f('0x25')];var _0x59a2c3=_0x4d5ae9?_0x1ebba8[_0x400f('0x26')]:_0x34c8d5[_0x400f('0x25')]+_0x34c8d5[_0x400f('0x23')];var _0x1ed4e3;if(_0x59a2c3>=_0x226a7f){_0x59a2c3=_0x226a7f;_0x1ed4e3=0xc8;}else{_0x1ed4e3=0xce;}_0x2301e0[_0x400f('0x20')](_0x1ed4e3);return _0x2301e0[_0x400f('0x27')](_0x400f('0x28'),_0x162a7e+'-'+_0x59a2c3+'/'+_0x226a7f)[_0x400f('0x22')](_0x1ebba8);}return null;};}function saveUpdates(_0x4692cf){return function(_0x571e0c){if(_0x571e0c){return _0x571e0c[_0x400f('0x29')](_0x4692cf)[_0x400f('0x15')](function(_0x34a3bc){if(_0x34a3bc['role']===_0x400f('0x2a')){socket[_0x400f('0x2b')](_0x400f('0x2c')+_0x34a3bc['id'],_0x34a3bc);}return _0x34a3bc;});}return null;};}function removeEntity(_0x57ba94){return function(_0x45efbe){if(_0x45efbe){return _0x45efbe['destroy']()[_0x400f('0x15')](function(){var _0x3c96d5=_0x45efbe['get']({'plain':!![]});if(_0x3c96d5[_0x400f('0x2d')]===_0x400f('0x2e'))return;var _0x237e74=[{'name':_0x400f('0x2f'),'value':_0x400f('0x30'),'ignore':!![]},{'name':_0x400f('0x31'),'value':_0x400f('0x2a'),'ignore':![]},{'name':_0x400f('0x32'),'value':'telephone','ignore':![]}];var _0x2afa03=_(_0x237e74)[_0x400f('0x33')](_0x400f('0x34'))['map'](_0x400f('0x35'))['value']();if(_[_0x400f('0x36')](_0x2afa03,_0x3c96d5[_0x400f('0x2d')])){return;}var _0x3ef096=_['find'](_0x237e74,[_0x400f('0x35'),_0x3c96d5[_0x400f('0x2d')]])[_0x400f('0x37')];return db[_0x400f('0x38')][_0x400f('0x39')]({'where':{'type':_0x3ef096,'resourceId':_0x3c96d5['id']}})[_0x400f('0x15')](function(){return _0x45efbe;});})[_0x400f('0x15')](function(){_0x57ba94[_0x400f('0x20')](0xcc)[_0x400f('0x21')]();});}};}function handleEntityNotFound(_0x5d9c29){return function(_0xa5864f){if(!_0xa5864f){_0x5d9c29[_0x400f('0x1f')](0x194);}return _0xa5864f;};}function handleError(_0x58cdda,_0xe463d9){_0xe463d9=_0xe463d9||0x1f4;return function(_0x403721){logger[_0x400f('0x1b')](_0x403721[_0x400f('0x3a')]);if(_0x403721['name']){delete _0x403721[_0x400f('0x37')];}_0x58cdda['status'](_0xe463d9)['send'](_0x403721);};}exports[_0x400f('0x3b')]=function(_0x359970,_0x453d10){var _0x3ef1a4={},_0x5d5b53={'count':0x0,'rows':[]};var _0x221c56=_(db[_0x400f('0x3c')][_0x400f('0x3d')])['map'](function(_0x12c555){return{'name':_0x12c555[_0x400f('0x3e')],'type':_0x12c555['type']['key']};})[_0x400f('0x33')](function(_0x4a82db){return!_[_0x400f('0x36')]([_0x400f('0x3f'),_0x400f('0x40')],_0x4a82db['name']);})['value']();_0x3ef1a4=qs[_0x400f('0x41')](_0x221c56,_0x359970);var _0x3802ea={'where':_0x3ef1a4['where']};return db[_0x400f('0x3c')][_0x400f('0x26')](_0x3802ea)[_0x400f('0x15')](function(_0x1275db){_0x5d5b53[_0x400f('0x26')]=_0x1275db;if(_0x359970['query'][_0x400f('0x42')]){_0x3ef1a4[_0x400f('0x43')]=[{'all':!![]}];}if(_0x359970[_0x400f('0x44')][_0x400f('0x45')]==='true'){_0x3ef1a4[_0x400f('0x43')]=[{'model':db[_0x400f('0x46')],'as':_0x400f('0x45')}];}if(!_[_0x400f('0x36')](_0x3ef1a4[_0x400f('0x47')],'id')){_0x3ef1a4['attributes'][_0x400f('0x48')]('id');}return db[_0x400f('0x3c')][_0x400f('0x49')](_0x3ef1a4);})[_0x400f('0x15')](function(_0x1d7ea6){_0x5d5b53[_0x400f('0x4a')]=_0x1d7ea6;if(_0x359970[_0x400f('0x44')][_0x400f('0x4b')]===_0x400f('0x4c')){var _0x3db868=[];for(var _0x45332a=0x0;_0x45332a<_0x5d5b53['rows']['length'];_0x45332a++){_0x3db868['push'](get_open_tabs(_0x400f('0x4d'),_0x5d5b53[_0x400f('0x4a')][_0x45332a][_0x400f('0x4e')]));_0x3db868[_0x400f('0x48')](get_open_tabs(_0x400f('0x4f'),_0x5d5b53['rows'][_0x45332a]['dataValues']));_0x3db868[_0x400f('0x48')](get_open_tabs(_0x400f('0x50'),_0x5d5b53['rows'][_0x45332a]['dataValues']));_0x3db868[_0x400f('0x48')](get_open_tabs('mail',_0x5d5b53[_0x400f('0x4a')][_0x45332a][_0x400f('0x4e')]));_0x3db868[_0x400f('0x48')](get_open_tabs(_0x400f('0x51'),_0x5d5b53['rows'][_0x45332a][_0x400f('0x4e')]));_0x3db868['push'](get_open_tabs(_0x400f('0x52'),_0x5d5b53[_0x400f('0x4a')][_0x45332a][_0x400f('0x4e')]));}return Promise['all'](_0x3db868)['then'](function(){return _0x5d5b53;});}else{return _0x5d5b53;}})[_0x400f('0x15')](respondWithFilteredResult(_0x453d10,_0x3ef1a4))[_0x400f('0x53')](handleError(_0x453d10,null));};exports[_0x400f('0x54')]=function(_0xf36f08,_0x3e7509){var _0x283a51={'raw':![],'where':{'id':_0xf36f08[_0x400f('0x55')]['id']}},_0x803950={};_0x803950['model']=_[_0x400f('0x56')](_[_0x400f('0x57')](db[_0x400f('0x3c')][_0x400f('0x3d')]),[_0x400f('0x3f'),_0x400f('0x40')]);_0x803950[_0x400f('0x44')]=_['keys'](_0xf36f08['query']);_0x803950[_0x400f('0x58')]=_[_0x400f('0x59')](_0x803950[_0x400f('0x5a')],_0x803950['query']);_0x283a51[_0x400f('0x47')]=_[_0x400f('0x59')](_0x803950[_0x400f('0x5a')],qs['fields'](_0xf36f08[_0x400f('0x44')][_0x400f('0x5b')]));_0x283a51[_0x400f('0x47')]=_0x283a51['attributes'][_0x400f('0x5c')]?_0x283a51[_0x400f('0x47')]:_0x803950[_0x400f('0x5a')];if(_0xf36f08[_0x400f('0x44')][_0x400f('0x42')]){_0x283a51[_0x400f('0x43')]=[{'all':!![]}];}if(_0xf36f08['query'][_0x400f('0x45')]===_0x400f('0x4c')){_0x283a51['include']=[{'model':db[_0x400f('0x46')],'as':_0x400f('0x45')}];}_0x283a51=_['merge']({},_0x283a51,_0xf36f08['options']);if(!_['includes'](_0x283a51[_0x400f('0x47')],'id')){_0x283a51[_0x400f('0x47')][_0x400f('0x48')]('id');}return db['User'][_0x400f('0x5d')](_0x283a51)[_0x400f('0x15')](handleEntityNotFound(_0x3e7509,null))[_0x400f('0x15')](function(_0x5da9c0){var _0x1f01bf=[];values=_0x5da9c0;if(_0xf36f08[_0x400f('0x44')]['openTabs']===_0x400f('0x4c')){_0x1f01bf['push'](get_open_tabs(_0x400f('0x4d'),_0x5da9c0[_0x400f('0x4e')]));_0x1f01bf['push'](get_open_tabs(_0x400f('0x4f'),_0x5da9c0['dataValues']));_0x1f01bf[_0x400f('0x48')](get_open_tabs(_0x400f('0x51'),_0x5da9c0[_0x400f('0x4e')]));_0x1f01bf[_0x400f('0x48')](get_open_tabs('whatsapp',_0x5da9c0[_0x400f('0x4e')]));_0x1f01bf['push'](get_open_tabs(_0x400f('0x50'),_0x5da9c0[_0x400f('0x4e')]));_0x1f01bf[_0x400f('0x48')](get_open_tabs(_0x400f('0x5e'),_0x5da9c0[_0x400f('0x4e')]));return Promise['all'](_0x1f01bf);}else{return values;}})['then'](function(){return values;})[_0x400f('0x15')](respondWithResult(_0x3e7509,null))[_0x400f('0x53')](handleError(_0x3e7509,null));};exports[_0x400f('0x29')]=function(_0x5e53d3,_0x21ee1b){if(_0x5e53d3[_0x400f('0x5f')]['id']){delete _0x5e53d3[_0x400f('0x5f')]['id'];}delete _0x5e53d3[_0x400f('0x5f')][_0x400f('0x2d')];return db['User']['find']({'where':{'id':_0x5e53d3[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x21ee1b,null))[_0x400f('0x15')](saveUpdates(_0x5e53d3[_0x400f('0x5f')],null))[_0x400f('0x15')](respondWithResult(_0x21ee1b,null))[_0x400f('0x53')](handleError(_0x21ee1b,null));};exports[_0x400f('0x60')]=function(_0x12175,_0x209599){return db[_0x400f('0x3c')]['describe']()[_0x400f('0x15')](respondWithResult(_0x209599,null))[_0x400f('0x53')](handleError(_0x209599,null));};exports[_0x400f('0x61')]=function(_0x1943e7,_0x3133c5){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x1943e7[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x3133c5,null))[_0x400f('0x15')](function(_0x45d9ea){if(_0x45d9ea){return _0x45d9ea[_0x400f('0x61')](_0x1943e7[_0x400f('0x5f')]['ids'],_[_0x400f('0x62')](_0x1943e7[_0x400f('0x5f')],['ids','id'])||{});}})[_0x400f('0x15')](respondWithResult(_0x3133c5,null))['catch'](handleError(_0x3133c5,null));};function validateUser(_0x3530d3){return new Promise(function(_0x1642a8,_0x1a7a23){if(_0x3530d3['internal'])return _0x1642a8(_0x3530d3);return db[_0x400f('0x63')][_0x400f('0x64')](0x1)[_0x400f('0x15')](function(_0x35dff6){if(_0x35dff6[_0x400f('0x65')])authService[_0x400f('0x66')](_0x3530d3[_0x400f('0x3f')]);db[_0x400f('0x3c')][_0x400f('0x67')](_0x400f('0x68'))[_0x400f('0x15')](function(_0x509f5f){if(_[_0x400f('0x69')](_0x509f5f)){_0x3530d3[_0x400f('0x68')]=_0x35dff6[_0x400f('0x6a')]||0x1;return;}if(_[_0x400f('0x69')](_0x35dff6[_0x400f('0x6a')])||_0x35dff6[_0x400f('0x6a')]===_0x509f5f){_0x3530d3[_0x400f('0x68')]=_0x509f5f+0x1;return;}if(_0x35dff6[_0x400f('0x6a')]>_0x509f5f){_0x3530d3[_0x400f('0x68')]=_0x35dff6[_0x400f('0x6a')];return;}return db[_0x400f('0x6b')][_0x400f('0x44')](_0x400f('0x6c'),{'type':db['sequelize'][_0x400f('0x6d')][_0x400f('0x6e')]})[_0x400f('0x15')](function(_0x1d80bd){if(_0x1d80bd&&_0x1d80bd[_0x400f('0x5c')]){for(var _0x35ff84=0x0,_0x16a689=_0x1d80bd['length'];_0x35ff84<_0x16a689&&_['isNil'](_0x3530d3[_0x400f('0x68')]);_0x35ff84++){if(_0x35dff6[_0x400f('0x6a')]<=_0x1d80bd[_0x35ff84][_0x400f('0x6f')]){_0x3530d3[_0x400f('0x68')]=_0x1d80bd[_0x35ff84]['from'];}else if(_0x35dff6['min_internal']>_0x1d80bd[_0x35ff84][_0x400f('0x6f')]&&_0x35dff6[_0x400f('0x6a')]<=_0x1d80bd[_0x35ff84]['to']){_0x3530d3[_0x400f('0x68')]=_0x35dff6[_0x400f('0x6a')];}}}if(_[_0x400f('0x69')](_0x3530d3[_0x400f('0x68')])){_0x3530d3[_0x400f('0x68')]=_0x509f5f+0x1;}return _0x1642a8(_0x3530d3);});});})[_0x400f('0x53')](function(_0x3494e9){_0x1a7a23(_0x3494e9);});});}function updateUser(_0x21f1ac){return new Promise(function(_0x54766a,_0x107a47){try{if(_0x21f1ac['voicemail']){_0x21f1ac[_0x400f('0x70')]=_0x21f1ac[_0x400f('0x68')];_0x21f1ac[_0x400f('0x71')]={'mailbox':_0x21f1ac[_0x400f('0x68')],'password':_0x21f1ac[_0x400f('0x3f')],'fullname':_0x21f1ac[_0x400f('0x72')],'email':_0x21f1ac[_0x400f('0x73')]};}if(_0x21f1ac['role']===_0x400f('0x2a')){if(!_0x21f1ac[_0x400f('0x74')])_0x21f1ac[_0x400f('0x74')]=[_0x400f('0x75'),_0x400f('0x76'),_0x400f('0x77'),_0x400f('0x78'),'110',_0x400f('0x79'),'105',_0x400f('0x7a'),_0x400f('0x7b'),_0x400f('0x7c'),_0x400f('0x7d'),_0x400f('0x7e'),_0x400f('0x7f'),'114',_0x400f('0x80')];}_0x54766a(_0x21f1ac);}catch(_0x503c3e){_0x107a47(_0x503c3e);}});}exports[_0x400f('0x81')]=function(_0x43384c,_0x277f9f){if(_0x43384c[_0x400f('0x30')]['role']===_0x400f('0x2a'))throw new Error(_0x400f('0x82'));if(_0x43384c[_0x400f('0x5f')][_0x400f('0x2d')]===_0x400f('0x30')&&_0x43384c[_0x400f('0x30')][_0x400f('0x2d')]!==_0x400f('0x2e')){throw new Error(_0x400f('0x83'));}if(_0x43384c[_0x400f('0x5f')]['role']===_0x400f('0x2e')&&_0x43384c[_0x400f('0x30')][_0x400f('0x2d')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x400f('0x84')]([_0x43384c[_0x400f('0x5f')]])[_0x400f('0x15')](function(){return validateUser(_0x43384c[_0x400f('0x5f')]);})[_0x400f('0x15')](function(_0x2950aa){return updateUser(_0x2950aa)[_0x400f('0x15')](function(_0x14dd4b){if(_0x14dd4b[_0x400f('0x2d')]==='admin'){_0x14dd4b['settingsEnabled']=_0x43384c['user'][_0x400f('0x85')];delete _0x14dd4b[_0x400f('0x86')];}return _0x14dd4b;});})['then'](function(_0x533c6d){return db[_0x400f('0x3c')][_0x400f('0x81')](_0x533c6d,{'include':[{'model':db[_0x400f('0x71')],'as':_0x400f('0x71')}]});})['then'](function(_0x1f0cbf){if(_0x43384c[_0x400f('0x5f')][_0x400f('0x2d')]===_0x400f('0x30'))return _0x1f0cbf;if(_0x43384c['user']['role']!=='user')return _0x1f0cbf;return db[_0x400f('0x87')][_0x400f('0x5d')]({'where':{'name':_0x1f0cbf['role']===_0x400f('0x2a')?'Agents':_0x400f('0x32'),'userProfileId':_0x43384c[_0x400f('0x30')][_0x400f('0x86')]},'raw':!![]})[_0x400f('0x15')](function(_0x3767fa){if(!_0x3767fa||_0x3767fa['autoAssociation']!=0x0)return _0x1f0cbf;return db[_0x400f('0x38')][_0x400f('0x81')]({'name':_0x1f0cbf[_0x400f('0x37')],'resourceId':_0x1f0cbf['id'],'type':_0x3767fa[_0x400f('0x37')],'sectionId':_0x3767fa['id']},{})[_0x400f('0x15')](function(){return _0x1f0cbf;});})[_0x400f('0x53')](function(_0x3f2e31){logger[_0x400f('0x1b')](_0x400f('0x88'),_0x3f2e31);throw _0x3f2e31;});})['then'](respondWithResult(_0x277f9f,0xc9))[_0x400f('0x53')](handleError(_0x277f9f,null));};exports[_0x400f('0x89')]=function(_0x4ffaec,_0x288c2a){var _0x32cf33=_0x4ffaec['body'];var _0x68d119=[];if(_0x4ffaec[_0x400f('0x30')][_0x400f('0x2d')]===_0x400f('0x2a'))throw new Error('Unauthorized');if(_[_0x400f('0x8a')](_0x32cf33,['role','user'])&&_0x4ffaec[_0x400f('0x30')][_0x400f('0x2d')]!==_0x400f('0x2e')){throw new Error(_0x400f('0x83'));}if(_[_0x400f('0x8a')](_0x32cf33,[_0x400f('0x2d'),_0x400f('0x2e')])&&_0x4ffaec[_0x400f('0x30')]['role']!==_0x400f('0x2e')){throw new Error(_0x400f('0x8b'));}return licenseUtil[_0x400f('0x84')](_0x32cf33)[_0x400f('0x15')](function(){return validateUser(_0x32cf33[0x0]);})[_0x400f('0x15')](function(){for(var _0x4c2927=0x1;_0x4c2927<_0x32cf33[_0x400f('0x5c')];_0x4c2927++){var _0x425e84=_0x32cf33[_0x4c2927-0x1][_0x400f('0x68')];if(!_0x32cf33[_0x4c2927][_0x400f('0x68')])_0x32cf33[_0x4c2927][_0x400f('0x68')]=_0x425e84+0x1;_0x68d119[_0x400f('0x48')](validateUser(_0x32cf33[_0x4c2927]));}return Promise[_0x400f('0x8c')](_0x68d119);})[_0x400f('0x15')](function(){_0x68d119=[];for(var _0x1fa2b1=0x0;_0x1fa2b1<_0x32cf33[_0x400f('0x5c')];_0x1fa2b1++){_0x68d119[_0x400f('0x48')](updateUser(_0x32cf33[_0x1fa2b1]));}return Promise[_0x400f('0x8c')](_0x68d119);})[_0x400f('0x15')](function(){_0x68d119=_0x32cf33[_0x400f('0x8d')](function(_0xa56620){return db[_0x400f('0x3c')][_0x400f('0x81')](_0xa56620,{'include':[{'model':db[_0x400f('0x71')],'as':'VoiceMail'}]})['then'](function(_0x1dea67){_0xa56620['id']=_0x1dea67['id'];return _0xa56620;});});return Promise['all'](_0x68d119);})[_0x400f('0x15')](function(_0x26f8fe){if(_0x4ffaec['body'][_0x400f('0x2d')]===_0x400f('0x30'))return _0x26f8fe;if(_0x4ffaec[_0x400f('0x30')][_0x400f('0x2d')]!==_0x400f('0x30'))return _0x26f8fe;var _0x46560d=_['some'](_0x26f8fe,function(_0x4939f6){return _0x4939f6[_0x400f('0x2d')]==='agent'||_0x4939f6[_0x400f('0x2d')]===_0x400f('0x8e');});if(!_0x46560d)return _0x26f8fe;return db[_0x400f('0x87')][_0x400f('0x49')]({'where':{'name':{'$or':[_0x400f('0x31'),_0x400f('0x32')]},'userProfileId':_0x4ffaec['user']['userProfileId']},'raw':!![]})[_0x400f('0x15')](function(_0x4f083f){if(_[_0x400f('0x8f')](_0x4f083f)||!_[_0x400f('0x8a')](_0x4f083f,[_0x400f('0x90'),0x0]))return _0x26f8fe;_0x68d119=[];var _0x34e599=_(_0x4f083f)['map'](function(_0x41923e){if(_0x41923e[_0x400f('0x90')]===0x1)return;return _0x41923e[_0x400f('0x37')]===_0x400f('0x31')?'agent':'telephone';})['compact']()[_0x400f('0x35')]();for(var _0x533e61=0x0;_0x533e61<_0x26f8fe[_0x400f('0x5c')];_0x533e61++){if(!_['includes'](_0x34e599,_0x26f8fe[_0x533e61][_0x400f('0x2d')]))return;var _0x5b2183=_0x26f8fe[_0x533e61][_0x400f('0x2d')]===_0x400f('0x2a')?'Agents':'Telephones';_0x68d119['push'](db['UserProfileResource'][_0x400f('0x81')]({'name':_0x26f8fe[_0x533e61][_0x400f('0x37')],'resourceId':_0x26f8fe[_0x533e61]['id'],'type':_0x5b2183,'sectionId':_[_0x400f('0x5d')](_0x4f083f,[_0x400f('0x37'),_0x5b2183])['id']},{}));}return Promise['all'](_0x68d119);});})['then'](respondWithResult(_0x288c2a,0xc9))[_0x400f('0x53')](handleError(_0x288c2a,null));};exports['changePassword']=function(_0x304ba7,_0x1e586c){if(_0x304ba7['body']['id']){delete _0x304ba7[_0x400f('0x5f')]['id'];}return db['User']['find']({'where':{'id':_0x304ba7[_0x400f('0x55')]['id']}})[_0x400f('0x15')](function(_0x5b04ce){if(!_0x5b04ce)return null;if(_0x5b04ce['id']===_0x304ba7[_0x400f('0x30')]['id']){if(!_0x304ba7[_0x400f('0x5f')][_0x400f('0x91')]||!_0x304ba7['body'][_0x400f('0x92')]){throw new db['Sequelize'][(_0x400f('0x93'))](_0x400f('0x94'));}if(!_0x5b04ce['authenticate'](_0x304ba7[_0x400f('0x5f')][_0x400f('0x91')])){throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0x96'));}if(_0x304ba7[_0x400f('0x5f')]['oldPassword']===_0x304ba7[_0x400f('0x5f')][_0x400f('0x92')]){throw new db[(_0x400f('0x95'))]['ValidationError'](_0x400f('0x97'));}}else if(_0x304ba7[_0x400f('0x30')]['role']===_0x400f('0x2e')){if(!_0x304ba7[_0x400f('0x5f')]['newPassword']){throw new db[(_0x400f('0x95'))]['ValidationError'](_0x400f('0x98'));}}else if(_0x304ba7[_0x400f('0x30')][_0x400f('0x2d')]===_0x400f('0x30')){if(!_0x304ba7[_0x400f('0x5f')][_0x400f('0x92')]){throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x5b04ce[_0x400f('0x2d')]!==_0x400f('0x2a')){throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0x82'));}}else{throw new db[(_0x400f('0x95'))]['ValidationError'](_0x400f('0x82'));}return _0x5b04ce;})[_0x400f('0x15')](handleEntityNotFound(_0x1e586c,null))['then'](function(_0x457e01){return db[_0x400f('0x63')][_0x400f('0x99')]({'attributes':['id','securePassword',_0x400f('0x9a'),_0x400f('0x9b')]})[_0x400f('0x15')](function(_0x2fc7b8){if(_0x2fc7b8[_0x400f('0x65')])authService[_0x400f('0x66')](_0x304ba7[_0x400f('0x5f')][_0x400f('0x92')]);if(!_0x2fc7b8[_0x400f('0x9a')]||!_0x457e01[_0x400f('0x9c')])return _0x457e01;authService[_0x400f('0x9d')](_0x304ba7[_0x400f('0x5f')][_0x400f('0x92')],_0x457e01[_0x400f('0x9c')],_0x2fc7b8[_0x400f('0x9b')]);return _0x457e01;})['then'](saveUpdates({'password':_0x304ba7['body'][_0x400f('0x92')],'passwordResetAt':_0x304ba7[_0x400f('0x30')]['id']==_0x304ba7[_0x400f('0x55')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x304ba7['body'][_0x400f('0x92')],_0x457e01[_0x400f('0x9c')])},null));})[_0x400f('0x15')](respondWithResult(_0x1e586c,null))[_0x400f('0x53')](handleError(_0x1e586c,null));};exports['addQueues']=function(_0x19fc3a,_0x402e4d){var _0x1daf8b=_0x19fc3a[_0x400f('0x5f')][_0x400f('0x9e')];return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x19fc3a[_0x400f('0x55')]['id']},'attributes':['id',_0x400f('0x37'),_0x400f('0x2d'),_0x400f('0x9f'),_0x400f('0xa0'),_0x400f('0xa1'),_0x400f('0xa2')]})['then'](handleEntityNotFound(_0x402e4d,null))[_0x400f('0x15')](function(_0x1c8907){if(_0x1c8907){if(!utils[_0x400f('0xa3')](_0x1daf8b)){throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0xa4'));}return _0x1c8907[_0x400f('0xa5')+_['capitalize'](_0x1daf8b[_0x400f('0xa6')]())+_0x400f('0xa7')](_0x19fc3a[_0x400f('0x5f')]['ids'],{'penalty':_0x19fc3a[_0x400f('0x5f')][_0x400f('0xa8')]||0x0})[_0x400f('0xa9')](function(_0x4d4269){for(var _0x4d4ae9=0x0;_0x4d4ae9<_0x19fc3a[_0x400f('0x5f')][_0x400f('0xaa')][_0x400f('0x5c')];_0x4d4ae9+=0x1){var _0x1188ef={'UserId':Number(_0x19fc3a['params']['id'])};_0x1188ef[_['capitalize'](_0x1daf8b[_0x400f('0xa6')]())+'QueueId']=Number(_0x19fc3a[_0x400f('0x5f')][_0x400f('0xaa')][_0x4d4ae9]);socket[_0x400f('0x2b')](_0x400f('0x30')+_[_0x400f('0xab')](_0x1daf8b['toLowerCase']())+_0x400f('0xac'),_0x1188ef);}return _0x4d4269;})[_0x400f('0x15')](function(){if(_0x1daf8b===_0x400f('0xad')){return db[_0x400f('0xae')]['findAll']({'where':{'id':_0x19fc3a[_0x400f('0x5f')][_0x400f('0xaa')]||[]},'raw':!![],'attributes':['id',_0x400f('0x37')]});}})[_0x400f('0x15')](function(_0x98602){var _0x4fcff0=_0x1c8907[_0x400f('0xaf')]({'plain':!![]});var _0x2b21f1=[];if(_0x1daf8b==='voice'&&_0x4fcff0[_0x400f('0x2d')]===_0x400f('0x2a')&&_0x4fcff0[_0x400f('0x9f')]){for(let _0x149da6=0x0;_0x149da6<_0x98602[_0x400f('0x5c')];_0x149da6+=0x1){_0x2b21f1[_0x400f('0x48')]({'membername':_0x4fcff0[_0x400f('0x37')],'UserId':_0x4fcff0['id'],'queue_name':_0x98602[_0x149da6][_0x400f('0x37')],'VoiceQueueId':_0x98602[_0x149da6]['id'],'interface':_[_0x400f('0x69')](_0x4fcff0[_0x400f('0xa2')])?util[_0x400f('0xb0')]('SIP/%s',_0x4fcff0[_0x400f('0x37')]):_0x4fcff0[_0x400f('0xa2')],'paused':_0x4fcff0[_0x400f('0xa1')]||![],'penalty':_0x19fc3a[_0x400f('0x5f')][_0x400f('0xa8')]||0x0});}return Promise[_0x400f('0x8c')](_0x2b21f1['map'](function(_0x113a5a){return db[_0x400f('0xb1')][_0x400f('0xb2')](_0x113a5a);}));}return _0x1c8907;});}})['then'](respondWithStatusCode(_0x402e4d,null))[_0x400f('0x53')](handleError(_0x402e4d,null));};exports[_0x400f('0xb3')]=function(_0x22653d,_0x5c77c0){var _0x1613a1,_0x2065db;return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x22653d['params']['id']},'attributes':['id',_0x400f('0x37'),_0x400f('0x2d')]})[_0x400f('0x15')](handleEntityNotFound(_0x5c77c0,null))['then'](function(_0x3c8545){if(_0x3c8545){_0x1613a1=_0x3c8545;if(!_0x22653d[_0x400f('0x44')][_0x400f('0x9e')]||!utils[_0x400f('0xa3')](_0x22653d[_0x400f('0x44')][_0x400f('0x9e')])){throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0xa4'));}return _0x3c8545[_0x400f('0xb4')+_['capitalize'](_0x22653d[_0x400f('0x44')][_0x400f('0x9e')][_0x400f('0xa6')]())+_0x400f('0xa7')](_0x22653d[_0x400f('0x44')][_0x400f('0xaa')]);}})[_0x400f('0x15')](function(_0x2d3e1d){if(_['isArray'](_0x22653d[_0x400f('0x44')][_0x400f('0xaa')])){for(var _0x485434=0x0;_0x485434<_0x22653d[_0x400f('0x44')]['ids'][_0x400f('0x5c')];_0x485434+=0x1){_0x2065db={'UserId':Number(_0x22653d[_0x400f('0x55')]['id'])};_0x2065db[_['capitalize'](_0x22653d[_0x400f('0x44')][_0x400f('0x9e')]['toLowerCase']())+'QueueId']=Number(_0x22653d[_0x400f('0x44')][_0x400f('0xaa')][_0x485434]);socket[_0x400f('0x2b')](_0x400f('0x30')+_['capitalize'](_0x22653d[_0x400f('0x44')]['channel']['toLowerCase']())+_0x400f('0xb5'),_0x2065db);}}else{_0x2065db={'UserId':Number(_0x22653d['params']['id'])};_0x2065db[_['capitalize'](_0x22653d[_0x400f('0x44')][_0x400f('0x9e')][_0x400f('0xa6')]())+_0x400f('0xb6')]=Number(_0x22653d[_0x400f('0x44')][_0x400f('0xaa')]);socket['emit'](_0x400f('0x30')+_[_0x400f('0xab')](_0x22653d[_0x400f('0x44')][_0x400f('0x9e')][_0x400f('0xa6')]())+'Queue:remove',_0x2065db);}return _0x2d3e1d;})[_0x400f('0x15')](function(){if(_0x22653d[_0x400f('0x44')]['channel']==='voice'){return db['UserVoiceQueueRt'][_0x400f('0x39')]({'where':{'UserId':_0x22653d['params']['id'],'VoiceQueueId':_0x22653d[_0x400f('0x44')][_0x400f('0xaa')]},'individualHooks':!![]})['then'](function(){return _0x1613a1;});}return _0x1613a1;})['then'](respondWithStatusCode(_0x5c77c0,null))['catch'](handleError(_0x5c77c0,null));};exports[_0x400f('0xb7')]=function(_0x3da191,_0x5ce5fc){_0x3da191[_0x400f('0x5f')][_0x400f('0xb8')]=_0x3da191[_0x400f('0xb9')][_0x400f('0xba')];return db['User'][_0x400f('0x5d')]({'where':{'id':_0x3da191[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x5ce5fc,null))[_0x400f('0x15')](saveUpdates(_0x3da191[_0x400f('0x5f')],null))[_0x400f('0x15')](respondWithResult(_0x5ce5fc,null))['catch'](handleError(_0x5ce5fc,null));};exports[_0x400f('0xbb')]=function(_0x100ed3,_0x25c5e1){var _0x59c321=path[_0x400f('0xbc')](config[_0x400f('0xbd')],_0x400f('0xbe'));return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x100ed3[_0x400f('0x55')]['id']},'attributes':['id',_0x400f('0xb8')],'raw':!![]})[_0x400f('0x15')](handleEntityNotFound(_0x25c5e1,null))[_0x400f('0x15')](function(_0x2d796d){if(_0x2d796d){if(_['isNil'](_0x2d796d[_0x400f('0xb8')])){return _0x25c5e1[_0x400f('0xbf')](_0x59c321);}else{if(!fs[_0x400f('0xc0')](path[_0x400f('0xbc')](config[_0x400f('0xbd')],_0x400f('0xc1'),_0x2d796d['userpic']))){return _0x25c5e1[_0x400f('0xbf')](_0x59c321);}return _0x25c5e1[_0x400f('0xbf')](path['join'](config['root'],_0x400f('0xc1'),_0x2d796d[_0x400f('0xb8')]));}}})[_0x400f('0x53')](handleError(_0x25c5e1,null));};exports[_0x400f('0xc2')]=function(_0x12a128,_0x57b663){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x12a128[_0x400f('0x55')]['id']},'attributes':['id']})[_0x400f('0x15')](handleEntityNotFound(_0x57b663,null))[_0x400f('0x15')](function(_0x186fae){var _0x3eafb7=[];values=_0x186fae[_0x400f('0x4e')];_0x3eafb7[_0x400f('0x48')](get_open_tabs(_0x400f('0x4d'),_0x186fae[_0x400f('0x4e')]));_0x3eafb7['push'](get_open_tabs(_0x400f('0x4f'),_0x186fae[_0x400f('0x4e')]));_0x3eafb7['push'](get_open_tabs(_0x400f('0x51'),_0x186fae[_0x400f('0x4e')]));_0x3eafb7[_0x400f('0x48')](get_open_tabs(_0x400f('0x52'),_0x186fae[_0x400f('0x4e')]));_0x3eafb7['push'](get_open_tabs(_0x400f('0x50'),_0x186fae[_0x400f('0x4e')]));_0x3eafb7['push'](get_open_tabs(_0x400f('0x5e'),_0x186fae['dataValues']));return Promise[_0x400f('0x8c')](_0x3eafb7);})['then'](function(_0x6ba4b2){if(_0x6ba4b2){var _0x37aa8e=_[_0x400f('0x8d')](values[_0x400f('0xc3')],function(_0x4384d1){return{'channel':_0x400f('0xc4'),'id':_0x4384d1['id'],'createdAt':_0x4384d1[_0x400f('0xc5')]};});var _0x5b86e5=_['map'](values['FaxOpenTabs'],function(_0x699d26){return{'channel':_0x400f('0xc6'),'id':_0x699d26['id'],'createdAt':_0x699d26[_0x400f('0xc5')]};});var _0xc6f18=_['map'](values[_0x400f('0xc7')],function(_0x3ab024){return{'channel':_0x400f('0xc8'),'id':_0x3ab024['id'],'createdAt':_0x3ab024[_0x400f('0xc5')]};});var _0x58e6dc=_[_0x400f('0x8d')](values['MailOpenTabs'],function(_0x274137){return{'channel':'MAIL','id':_0x274137['id'],'createdAt':_0x274137[_0x400f('0xc5')]};});var _0x3e5bec=_[_0x400f('0x8d')](values[_0x400f('0xc9')],function(_0x15533f){return{'channel':_0x400f('0xca'),'id':_0x15533f['id'],'createdAt':_0x15533f[_0x400f('0xc5')]};});var _0x34c624=_[_0x400f('0x8d')](values[_0x400f('0xcb')],function(_0xb35809){return{'channel':_0x400f('0xcc'),'id':_0xb35809['id'],'createdAt':_0xb35809[_0x400f('0xc5')]};});var _0x3b559e=_[_0x400f('0xcd')](_0x37aa8e,_0x5b86e5,_0xc6f18,_0x58e6dc,_0x3e5bec,_0x34c624);var _0x43fe15={'count':_0x3b559e[_0x400f('0x5c')],'rows':_0x3b559e};return _0x43fe15;}else return null;})[_0x400f('0x15')](respondWithResult(_0x57b663,null))[_0x400f('0x53')](handleError(_0x57b663,null));};exports[_0x400f('0xce')]=function(_0x4ddff7,_0x2e367f){var _0xa491ea={};return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x4ddff7['params']['id']}})[_0x400f('0x15')](function(_0x5d86ec){if(!_0x5d86ec){throw new APINotFoundError(util[_0x400f('0xb0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4ddff7['params']['id']));}return contacts[_0x400f('0x60')]();})[_0x400f('0x15')](function(_0x2c28fa){_0x4ddff7['query'][_0x400f('0x3c')]=_0x4ddff7[_0x400f('0x55')]['id'];_0xa491ea=qs[_0x400f('0x41')](_0x2c28fa,_0x4ddff7);if(_0x4ddff7['query'][_0x400f('0xcf')](_0x400f('0x42'))){_0xa491ea[_0x400f('0x43')]=[{'model':db['CmList'],'as':_0x400f('0xd0'),'required':![]},{'model':db[_0x400f('0xd1')],'as':_0x400f('0xd2'),'attributes':['id',_0x400f('0x37'),_0x400f('0xd3')],'where':_0x4ddff7[_0x400f('0x44')][_0x400f('0xd4')]?{'id':_0x4ddff7[_0x400f('0x44')][_0x400f('0xd4')]}:undefined,'required':_0x4ddff7[_0x400f('0x44')][_0x400f('0xd4')]?!![]:![]}];}return contacts[_0x400f('0x49')](_0x4ddff7[_0x400f('0x44')],_0x4ddff7[_0x400f('0x30')],_0xa491ea,_0x2c28fa);})[_0x400f('0x15')](respondWithFilteredResult(_0x2e367f,_0xa491ea))[_0x400f('0x53')](APIHandleError(_0x2e367f));};exports['getQueues']=function(_0x500ff7,_0x3a3959){var _0x5189a2;var _0x15dfee={};var _0x4b1338;return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x500ff7[_0x400f('0x55')]['id']},'attributes':['id',_0x400f('0x37'),_0x400f('0x2d')]})['then'](handleEntityNotFound(_0x3a3959,null))[_0x400f('0x15')](function(_0x402466){if(!utils[_0x400f('0xa3')](_0x500ff7[_0x400f('0x44')]['channel'])){throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0xa4'));}_0x5189a2=_0x402466;var _0x3084dc={};_0x3084dc[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_[_0x400f('0xab')](_0x500ff7[_0x400f('0x44')][_0x400f('0x9e')])+_0x400f('0xd5')]['rawAttributes']);_0x3084dc[_0x400f('0x44')]=_['keys'](_0x500ff7[_0x400f('0x44')]);_0x3084dc[_0x400f('0x58')]=_[_0x400f('0x59')](_0x3084dc['model'],_0x3084dc[_0x400f('0x44')]);_0x15dfee[_0x400f('0x47')]=_[_0x400f('0x59')](_0x3084dc[_0x400f('0x5a')],qs['fields'](_0x500ff7[_0x400f('0x44')]['fields']));_0x15dfee['attributes']=_0x15dfee['attributes']['length']?_0x15dfee[_0x400f('0x47')]:_0x3084dc[_0x400f('0x5a')];_0x15dfee[_0x400f('0xd6')]=qs['sort'](_0x500ff7['query'][_0x400f('0xd7')]);_0x15dfee[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x500ff7[_0x400f('0x44')],_0x3084dc['filters']));if(_0x500ff7[_0x400f('0x44')]['filter']){_0x15dfee[_0x400f('0xd8')]=_['merge'](_0x15dfee[_0x400f('0xd8')],{'$or':_['map'](_0x15dfee[_0x400f('0x47')],function(_0x1521d7){var _0xcf8c80={};_0xcf8c80[_0x1521d7]={'$like':'%'+_0x500ff7[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0xcf8c80;})});}_0x15dfee=_[_0x400f('0xda')]({},_0x15dfee,_0x500ff7[_0x400f('0xdb')]);switch(_0x5189a2[_0x400f('0x2d')]){case _0x400f('0x2e'):return db[_['capitalize'](_0x500ff7[_0x400f('0x44')][_0x400f('0x9e')])+'Queue']['findAll'](_0x15dfee);case'user':case'agent':return _0x5189a2[_0x400f('0xaf')+_[_0x400f('0xab')](_0x500ff7[_0x400f('0x44')][_0x400f('0x9e')])+_0x400f('0xa7')](_0x15dfee);default:throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0xdc'));}})[_0x400f('0x15')](function(_0x6cfc57){_0x4b1338=_0x6cfc57[_0x400f('0x5c')];if(!_0x500ff7['query'][_0x400f('0xcf')]('nolimit')){_0x15dfee[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x500ff7[_0x400f('0x44')]['limit']);_0x15dfee[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x500ff7[_0x400f('0x44')][_0x400f('0x25')]);}switch(_0x5189a2['role']){case _0x400f('0x2e'):return db[_[_0x400f('0xab')](_0x500ff7[_0x400f('0x44')][_0x400f('0x9e')])+_0x400f('0xd5')][_0x400f('0x49')](_0x15dfee);case _0x400f('0x30'):case _0x400f('0x2a'):return _0x5189a2[_0x400f('0xaf')+_['capitalize'](_0x500ff7[_0x400f('0x44')]['channel'])+_0x400f('0xa7')](_0x15dfee);}})['then'](function(_0x4a259f){return{'count':_0x4b1338,'rows':_0x4a259f};})[_0x400f('0x15')](respondWithResult(_0x3a3959,null))[_0x400f('0x53')](handleError(_0x3a3959,null));};exports[_0x400f('0xdd')]=function(_0x3c07e1,_0x443406){var _0x3a2303={};var _0x3b8017={};var _0x21a63c;var _0x527fbd;return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x3c07e1[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x443406,null))[_0x400f('0x15')](function(_0x2f1533){if(_0x2f1533){_0x21a63c=_0x2f1533;_0x3b8017[_0x400f('0x5a')]=_['keys'](db['UserVoiceQueueRt'][_0x400f('0x3d')]);_0x3b8017[_0x400f('0x44')]=_[_0x400f('0x57')](_0x3c07e1['query']);_0x3b8017['filters']=_['intersection'](_0x3b8017[_0x400f('0x5a')],_0x3b8017[_0x400f('0x44')]);_0x3a2303[_0x400f('0x47')]=_['intersection'](_0x3b8017[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x3c07e1['query'][_0x400f('0x5b')]));_0x3a2303[_0x400f('0x47')]=_0x3a2303[_0x400f('0x47')][_0x400f('0x5c')]?_0x3a2303[_0x400f('0x47')]:_0x3b8017['model'];_0x3a2303[_0x400f('0xd6')]=qs['sort'](_0x3c07e1[_0x400f('0x44')][_0x400f('0xd7')]);_0x3a2303['where']=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x3c07e1[_0x400f('0x44')],_0x3b8017[_0x400f('0x58')]));if(_0x3c07e1[_0x400f('0x44')][_0x400f('0x33')]){_0x3a2303[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x3a2303[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x3a2303[_0x400f('0x47')],function(_0x1fa3a2){var _0x4f3b2c={};_0x4f3b2c[_0x1fa3a2]={'$like':'%'+_0x3c07e1[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x4f3b2c;})});}_0x3a2303=_[_0x400f('0xda')]({},_0x3a2303,_0x3c07e1[_0x400f('0xdb')]);return _0x21a63c[_0x400f('0xdd')](_0x3a2303);}})[_0x400f('0x15')](function(_0x35d1a9){if(_0x35d1a9){_0x527fbd=_0x35d1a9['length'];if(!_0x3c07e1[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x3a2303[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x3c07e1[_0x400f('0x44')]['limit']);_0x3a2303[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x3c07e1['query'][_0x400f('0x25')]);}return _0x21a63c[_0x400f('0xdd')](_0x3a2303);}})[_0x400f('0x15')](function(_0x3ba19e){if(_0x3ba19e){return _0x3ba19e?{'count':_0x527fbd,'rows':_0x3ba19e}:null;}})[_0x400f('0x15')](respondWithResult(_0x443406,null))[_0x400f('0x53')](handleError(_0x443406,null));};exports['getGroups']=function(_0x313d47,_0x4b7cab){var _0x27396e={};var _0x52c5f4={};var _0x42dc98;var _0x3f0c47;return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x313d47['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x4b7cab,null))[_0x400f('0x15')](function(_0xdf3d8f){if(_0xdf3d8f){_0x42dc98=_0xdf3d8f;_0x52c5f4[_0x400f('0x5a')]=_[_0x400f('0x57')](db['ChatGroup'][_0x400f('0x3d')]);_0x52c5f4[_0x400f('0x44')]=_[_0x400f('0x57')](_0x313d47[_0x400f('0x44')]);_0x52c5f4['filters']=_[_0x400f('0x59')](_0x52c5f4[_0x400f('0x5a')],_0x52c5f4[_0x400f('0x44')]);_0x27396e[_0x400f('0x47')]=_[_0x400f('0x59')](_0x52c5f4[_0x400f('0x5a')],qs['fields'](_0x313d47['query'][_0x400f('0x5b')]));_0x27396e[_0x400f('0x47')]=_0x27396e[_0x400f('0x47')]['length']?_0x27396e[_0x400f('0x47')]:_0x52c5f4[_0x400f('0x5a')];_0x27396e[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x313d47['query'][_0x400f('0xd7')]);_0x27396e[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x313d47[_0x400f('0x44')],_0x52c5f4['filters']));if(_0x313d47[_0x400f('0x44')]['filter']){_0x27396e[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x27396e[_0x400f('0xd8')],{'$or':_['map'](_0x27396e[_0x400f('0x47')],function(_0x19b618){var _0x1c9f93={};_0x1c9f93[_0x19b618]={'$like':'%'+_0x313d47[_0x400f('0x44')]['filter']+'%'};return _0x1c9f93;})});}_0x27396e=_[_0x400f('0xda')]({},_0x27396e,_0x313d47[_0x400f('0xdb')]);return _0x42dc98[_0x400f('0xdf')](_0x27396e);}})['then'](function(_0x32f331){if(_0x32f331){_0x3f0c47=_0x32f331[_0x400f('0x5c')];if(!_0x313d47[_0x400f('0x44')]['hasOwnProperty'](_0x400f('0xde'))){_0x27396e[_0x400f('0x23')]=qs['limit'](_0x313d47[_0x400f('0x44')][_0x400f('0x23')]);_0x27396e[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x313d47[_0x400f('0x44')][_0x400f('0x25')]);}return _0x42dc98[_0x400f('0xdf')](_0x27396e);}})[_0x400f('0x15')](function(_0x40c307){if(_0x40c307){return _0x40c307?{'count':_0x3f0c47,'rows':_0x40c307}:null;}})[_0x400f('0x15')](respondWithResult(_0x4b7cab,null))[_0x400f('0x53')](handleError(_0x4b7cab,null));};exports[_0x400f('0xe0')]=function(_0x333999,_0x52f80f){var _0x39caf6={'raw':!![],'where':{}};var _0x4a07dc={};var _0xb84ef4={'count':0x0,'rows':[]};return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x333999[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x52f80f,null))['then'](function(_0xaa2824){if(_0xaa2824){_0x4a07dc[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0xe1')][_0x400f('0x3d')]);_0x4a07dc[_0x400f('0x44')]=_[_0x400f('0x57')](_0x333999['query']);_0x4a07dc[_0x400f('0x58')]=_[_0x400f('0x59')](_0x4a07dc[_0x400f('0x5a')],_0x4a07dc[_0x400f('0x44')]);_0x39caf6[_0x400f('0x47')]=_[_0x400f('0x59')](_0x4a07dc['model'],qs[_0x400f('0x5b')](_0x333999[_0x400f('0x44')][_0x400f('0x5b')]));_0x39caf6['attributes']=_0x39caf6['attributes'][_0x400f('0x5c')]?_0x39caf6[_0x400f('0x47')]:_0x4a07dc[_0x400f('0x5a')];if(!_0x333999[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x39caf6[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x333999[_0x400f('0x44')][_0x400f('0x23')]);_0x39caf6['offset']=qs[_0x400f('0x25')](_0x333999['query'][_0x400f('0x25')]);}_0x39caf6[_0x400f('0xd6')]=qs['sort'](_0x333999[_0x400f('0x44')][_0x400f('0xd7')]);_0x39caf6['where']=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x333999[_0x400f('0x44')],_0x4a07dc[_0x400f('0x58')]));_0x39caf6[_0x400f('0xd8')][_0x400f('0xe2')]=_0xaa2824['id'];if(_0x333999[_0x400f('0x44')][_0x400f('0x33')]){_0x39caf6[_0x400f('0xd8')]=_['merge'](_0x39caf6['where'],{'$or':_[_0x400f('0x8d')](_0x39caf6[_0x400f('0x47')],function(_0x156cae){var _0x1fdce6={};_0x1fdce6[_0x156cae]={'$like':'%'+_0x333999[_0x400f('0x44')]['filter']+'%'};return _0x1fdce6;})});}_0x39caf6=_['merge']({},_0x39caf6,_0x333999[_0x400f('0xdb')]);return db[_0x400f('0xe1')][_0x400f('0x26')]({'where':_0x39caf6['where']})[_0x400f('0x15')](function(_0x2cf668){_0xb84ef4['count']=_0x2cf668;if(_0x333999[_0x400f('0x44')][_0x400f('0x42')]){_0x39caf6[_0x400f('0x43')]=[{'all':!![]}];}return db[_0x400f('0xe1')]['findAll'](_0x39caf6);})[_0x400f('0x15')](function(_0x4434ae){_0xb84ef4[_0x400f('0x4a')]=_0x4434ae;return _0xb84ef4;});}})[_0x400f('0x15')](respondWithFilteredResult(_0x52f80f,_0x39caf6))[_0x400f('0x53')](handleError(_0x52f80f,null));};exports[_0x400f('0xe3')]=function(_0x15322c,_0x476457){var _0x2dfcd5={'raw':!![],'where':{}};var _0x16ceb9={};var _0x373da3={'count':0x0,'rows':[]};return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x15322c[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x476457,null))[_0x400f('0x15')](function(_0x59cf31){if(_0x59cf31){_0x16ceb9[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0xe4')][_0x400f('0x3d')]);_0x16ceb9[_0x400f('0x44')]=_['keys'](_0x15322c[_0x400f('0x44')]);_0x16ceb9[_0x400f('0x58')]=_[_0x400f('0x59')](_0x16ceb9[_0x400f('0x5a')],_0x16ceb9[_0x400f('0x44')]);_0x2dfcd5[_0x400f('0x47')]=_['intersection'](_0x16ceb9[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x15322c[_0x400f('0x44')][_0x400f('0x5b')]));_0x2dfcd5[_0x400f('0x47')]=_0x2dfcd5[_0x400f('0x47')]['length']?_0x2dfcd5[_0x400f('0x47')]:_0x16ceb9['model'];if(!_0x15322c[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x2dfcd5[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x15322c[_0x400f('0x44')][_0x400f('0x23')]);_0x2dfcd5[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x15322c[_0x400f('0x44')][_0x400f('0x25')]);}_0x2dfcd5[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x15322c[_0x400f('0x44')][_0x400f('0xd7')]);_0x2dfcd5[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x15322c[_0x400f('0x44')],_0x16ceb9[_0x400f('0x58')]));_0x2dfcd5['where'][_0x400f('0xe2')]=_0x59cf31['id'];if(_0x15322c['query'][_0x400f('0x33')]){_0x2dfcd5['where']=_[_0x400f('0xda')](_0x2dfcd5['where'],{'$or':_[_0x400f('0x8d')](_0x2dfcd5[_0x400f('0x47')],function(_0x16aefc){var _0x4f4043={};_0x4f4043[_0x16aefc]={'$like':'%'+_0x15322c[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x4f4043;})});}_0x2dfcd5=_['merge']({},_0x2dfcd5,_0x15322c[_0x400f('0xdb')]);return db[_0x400f('0xe4')]['count']({'where':_0x2dfcd5[_0x400f('0xd8')]})[_0x400f('0x15')](function(_0x3c2bb5){_0x373da3[_0x400f('0x26')]=_0x3c2bb5;if(_0x15322c[_0x400f('0x44')][_0x400f('0x42')]){_0x2dfcd5[_0x400f('0x43')]=[{'all':!![]}];}return db[_0x400f('0xe4')][_0x400f('0x49')](_0x2dfcd5);})[_0x400f('0x15')](function(_0x478166){_0x373da3[_0x400f('0x4a')]=_0x478166;return _0x373da3;});}})[_0x400f('0x15')](respondWithFilteredResult(_0x476457,_0x2dfcd5))['catch'](handleError(_0x476457,null));};exports[_0x400f('0xe5')]=function(_0x4ea795,_0x474db2){var _0x3fae76={};var _0x470e77={};var _0x34d0c0;var _0x252e0f;return db['User'][_0x400f('0x99')]({'where':{'id':_0x4ea795['params']['id']}})['then'](handleEntityNotFound(_0x474db2,null))[_0x400f('0x15')](function(_0x479c1f){if(_0x479c1f){_0x34d0c0=_0x479c1f;_0x470e77[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0xe6')][_0x400f('0x3d')]);_0x470e77[_0x400f('0x44')]=_[_0x400f('0x57')](_0x4ea795[_0x400f('0x44')]);_0x470e77[_0x400f('0x58')]=_[_0x400f('0x59')](_0x470e77[_0x400f('0x5a')],_0x470e77[_0x400f('0x44')]);_0x3fae76[_0x400f('0x47')]=_[_0x400f('0x59')](_0x470e77[_0x400f('0x5a')],qs['fields'](_0x4ea795[_0x400f('0x44')][_0x400f('0x5b')]));_0x3fae76['attributes']=_0x3fae76['attributes'][_0x400f('0x5c')]?_0x3fae76['attributes']:_0x470e77[_0x400f('0x5a')];_0x3fae76[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x4ea795[_0x400f('0x44')][_0x400f('0xd7')]);_0x3fae76[_0x400f('0xd8')]=qs[_0x400f('0x58')](_['pick'](_0x4ea795[_0x400f('0x44')],_0x470e77[_0x400f('0x58')]));if(_0x4ea795[_0x400f('0x44')][_0x400f('0x33')]){_0x3fae76[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x3fae76[_0x400f('0xd8')],{'$or':_['map'](_0x3fae76['attributes'],function(_0x1368fc){var _0x14b539={};_0x14b539[_0x1368fc]={'$like':'%'+_0x4ea795[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x14b539;})});}_0x3fae76=_[_0x400f('0xda')]({},_0x3fae76,_0x4ea795[_0x400f('0xdb')]);return _0x34d0c0[_0x400f('0xe5')](_0x3fae76);}})[_0x400f('0x15')](function(_0x3236d1){if(_0x3236d1){_0x252e0f=_0x3236d1[_0x400f('0x5c')];if(!_0x4ea795[_0x400f('0x44')]['hasOwnProperty']('nolimit')){_0x3fae76['limit']=qs[_0x400f('0x23')](_0x4ea795['query']['limit']);_0x3fae76[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x4ea795[_0x400f('0x44')][_0x400f('0x25')]);}return _0x34d0c0['getChatInteractions'](_0x3fae76);}})[_0x400f('0x15')](function(_0x3877e9){if(_0x3877e9){return _0x3877e9?{'count':_0x252e0f,'rows':_0x3877e9}:null;}})[_0x400f('0x15')](respondWithResult(_0x474db2,null))[_0x400f('0x53')](handleError(_0x474db2,null));};exports[_0x400f('0xe7')]=function(_0x3c0e78,_0x1b77c2){var _0x521c34={};var _0x4eb4d9={};var _0x1f7181;var _0x2a43c0;return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x3c0e78[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1b77c2,null))['then'](function(_0x511f29){if(_0x511f29){_0x1f7181=_0x511f29;_0x4eb4d9['model']=_[_0x400f('0x57')](db[_0x400f('0xe8')][_0x400f('0x3d')]);_0x4eb4d9[_0x400f('0x44')]=_['keys'](_0x3c0e78[_0x400f('0x44')]);_0x4eb4d9[_0x400f('0x58')]=_[_0x400f('0x59')](_0x4eb4d9[_0x400f('0x5a')],_0x4eb4d9['query']);_0x521c34['attributes']=_[_0x400f('0x59')](_0x4eb4d9[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x3c0e78['query'][_0x400f('0x5b')]));_0x521c34[_0x400f('0x47')]=_0x521c34[_0x400f('0x47')][_0x400f('0x5c')]?_0x521c34['attributes']:_0x4eb4d9['model'];_0x521c34[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x3c0e78['query'][_0x400f('0xd7')]);_0x521c34[_0x400f('0xd8')]=qs[_0x400f('0x58')](_['pick'](_0x3c0e78['query'],_0x4eb4d9['filters']));if(_0x3c0e78[_0x400f('0x44')][_0x400f('0x33')]){_0x521c34[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x521c34['where'],{'$or':_['map'](_0x521c34['attributes'],function(_0x58f7b9){var _0x18fca9={};_0x18fca9[_0x58f7b9]={'$like':'%'+_0x3c0e78[_0x400f('0x44')]['filter']+'%'};return _0x18fca9;})});}_0x521c34=_[_0x400f('0xda')]({},_0x521c34,_0x3c0e78[_0x400f('0xdb')]);return _0x1f7181[_0x400f('0xe7')](_0x521c34);}})[_0x400f('0x15')](function(_0x2ccf77){if(_0x2ccf77){_0x2a43c0=_0x2ccf77[_0x400f('0x5c')];if(!_0x3c0e78[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x521c34['limit']=qs['limit'](_0x3c0e78[_0x400f('0x44')][_0x400f('0x23')]);_0x521c34[_0x400f('0x25')]=qs['offset'](_0x3c0e78[_0x400f('0x44')][_0x400f('0x25')]);}return _0x1f7181[_0x400f('0xe7')](_0x521c34);}})['then'](function(_0x4cf040){if(_0x4cf040){return _0x4cf040?{'count':_0x2a43c0,'rows':_0x4cf040}:null;}})[_0x400f('0x15')](respondWithResult(_0x1b77c2,null))[_0x400f('0x53')](handleError(_0x1b77c2,null));};exports[_0x400f('0xe9')]=function(_0xac7122,_0x4114ff){var _0xe59b5f={'raw':!![],'where':{}};var _0x4e21cd={};var _0x31a0b2={'count':0x0,'rows':[]};return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0xac7122[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x4114ff,null))['then'](function(_0x43bf14){if(_0x43bf14){_0x4e21cd[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0xea')]['rawAttributes']);_0x4e21cd[_0x400f('0x44')]=_[_0x400f('0x57')](_0xac7122[_0x400f('0x44')]);_0x4e21cd[_0x400f('0x58')]=_[_0x400f('0x59')](_0x4e21cd[_0x400f('0x5a')],_0x4e21cd['query']);_0xe59b5f[_0x400f('0x47')]=_[_0x400f('0x59')](_0x4e21cd[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0xac7122[_0x400f('0x44')][_0x400f('0x5b')]));_0xe59b5f[_0x400f('0x47')]=_0xe59b5f[_0x400f('0x47')][_0x400f('0x5c')]?_0xe59b5f[_0x400f('0x47')]:_0x4e21cd[_0x400f('0x5a')];if(!_0xac7122['query'][_0x400f('0xcf')](_0x400f('0xde'))){_0xe59b5f[_0x400f('0x23')]=qs[_0x400f('0x23')](_0xac7122[_0x400f('0x44')][_0x400f('0x23')]);_0xe59b5f[_0x400f('0x25')]=qs[_0x400f('0x25')](_0xac7122['query']['offset']);}_0xe59b5f[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0xac7122[_0x400f('0x44')][_0x400f('0xd7')]);_0xe59b5f[_0x400f('0xd8')]=qs['filters'](_[_0x400f('0xd9')](_0xac7122[_0x400f('0x44')],_0x4e21cd[_0x400f('0x58')]));_0xe59b5f[_0x400f('0xd8')][_0x400f('0xe2')]=_0x43bf14['id'];if(_0xac7122[_0x400f('0x44')][_0x400f('0x33')]){_0xe59b5f[_0x400f('0xd8')]=_[_0x400f('0xda')](_0xe59b5f[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0xe59b5f[_0x400f('0x47')],function(_0xbfc1a8){var _0x438454={};_0x438454[_0xbfc1a8]={'$like':'%'+_0xac7122[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x438454;})});}_0xe59b5f=_[_0x400f('0xda')]({},_0xe59b5f,_0xac7122[_0x400f('0xdb')]);return db['MailInteraction'][_0x400f('0x26')]({'where':_0xe59b5f[_0x400f('0xd8')]})[_0x400f('0x15')](function(_0x3297c6){_0x31a0b2[_0x400f('0x26')]=_0x3297c6;if(_0xac7122[_0x400f('0x44')]['includeAll']){_0xe59b5f[_0x400f('0x43')]=[{'all':!![]}];}return db[_0x400f('0xea')][_0x400f('0x49')](_0xe59b5f);})['then'](function(_0x8db3ef){_0x31a0b2['rows']=_0x8db3ef;return _0x31a0b2;});}})[_0x400f('0x15')](respondWithFilteredResult(_0x4114ff,_0xe59b5f))['catch'](handleError(_0x4114ff,null));};exports[_0x400f('0xeb')]=function(_0x33a914,_0x2d1ac3){var _0x8ab5ba={};var _0x4ffa92={};var _0x4f3a53;var _0x3231e5;return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x33a914['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x2d1ac3,null))[_0x400f('0x15')](function(_0x34b8b3){if(_0x34b8b3){_0x4f3a53=_0x34b8b3;_0x4ffa92[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0xec')][_0x400f('0x3d')]);_0x4ffa92[_0x400f('0x44')]=_[_0x400f('0x57')](_0x33a914[_0x400f('0x44')]);_0x4ffa92[_0x400f('0x58')]=_[_0x400f('0x59')](_0x4ffa92['model'],_0x4ffa92[_0x400f('0x44')]);_0x8ab5ba[_0x400f('0x47')]=_[_0x400f('0x59')](_0x4ffa92[_0x400f('0x5a')],qs['fields'](_0x33a914[_0x400f('0x44')][_0x400f('0x5b')]));_0x8ab5ba[_0x400f('0x47')]=_0x8ab5ba[_0x400f('0x47')][_0x400f('0x5c')]?_0x8ab5ba['attributes']:_0x4ffa92[_0x400f('0x5a')];_0x8ab5ba[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x33a914[_0x400f('0x44')][_0x400f('0xd7')]);_0x8ab5ba[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x33a914[_0x400f('0x44')],_0x4ffa92[_0x400f('0x58')]));if(_0x33a914[_0x400f('0x44')][_0x400f('0x33')]){_0x8ab5ba[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x8ab5ba[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x8ab5ba[_0x400f('0x47')],function(_0x5007fb){var _0x533136={};_0x533136[_0x5007fb]={'$like':'%'+_0x33a914[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x533136;})});}_0x8ab5ba=_[_0x400f('0xda')]({},_0x8ab5ba,_0x33a914[_0x400f('0xdb')]);return _0x4f3a53[_0x400f('0xeb')](_0x8ab5ba);}})[_0x400f('0x15')](function(_0x585c23){if(_0x585c23){_0x3231e5=_0x585c23[_0x400f('0x5c')];if(!_0x33a914[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x8ab5ba[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x33a914['query'][_0x400f('0x23')]);_0x8ab5ba[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x33a914['query'][_0x400f('0x25')]);}return _0x4f3a53[_0x400f('0xeb')](_0x8ab5ba);}})['then'](function(_0x5d6ba8){if(_0x5d6ba8){return _0x5d6ba8?{'count':_0x3231e5,'rows':_0x5d6ba8}:null;}})[_0x400f('0x15')](respondWithResult(_0x2d1ac3,null))[_0x400f('0x53')](handleError(_0x2d1ac3,null));};exports[_0x400f('0xed')]=function(_0x5794b2,_0x1e6b69){var _0x2984d3={};var _0x191dba={};var _0x437be6;var _0x461fd3;return db['User']['findOne']({'where':{'id':_0x5794b2[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1e6b69,null))[_0x400f('0x15')](function(_0x4ae86a){if(_0x4ae86a){_0x437be6=_0x4ae86a;_0x191dba['model']=_[_0x400f('0x57')](db[_0x400f('0xee')]['rawAttributes']);_0x191dba['query']=_['keys'](_0x5794b2[_0x400f('0x44')]);_0x191dba[_0x400f('0x58')]=_[_0x400f('0x59')](_0x191dba['model'],_0x191dba[_0x400f('0x44')]);_0x2984d3[_0x400f('0x47')]=_[_0x400f('0x59')](_0x191dba['model'],qs[_0x400f('0x5b')](_0x5794b2[_0x400f('0x44')][_0x400f('0x5b')]));_0x2984d3['attributes']=_0x2984d3['attributes']['length']?_0x2984d3[_0x400f('0x47')]:_0x191dba[_0x400f('0x5a')];_0x2984d3[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x5794b2[_0x400f('0x44')][_0x400f('0xd7')]);_0x2984d3[_0x400f('0xd8')]=qs['filters'](_[_0x400f('0xd9')](_0x5794b2[_0x400f('0x44')],_0x191dba[_0x400f('0x58')]));if(_0x5794b2[_0x400f('0x44')][_0x400f('0x33')]){_0x2984d3['where']=_[_0x400f('0xda')](_0x2984d3[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x2984d3[_0x400f('0x47')],function(_0x5c4cfc){var _0x5666f5={};_0x5666f5[_0x5c4cfc]={'$like':'%'+_0x5794b2[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x5666f5;})});}_0x2984d3=_[_0x400f('0xda')]({},_0x2984d3,_0x5794b2[_0x400f('0xdb')]);return _0x437be6[_0x400f('0xed')](_0x2984d3);}})[_0x400f('0x15')](function(_0x1ababc){if(_0x1ababc){_0x461fd3=_0x1ababc[_0x400f('0x5c')];if(!_0x5794b2[_0x400f('0x44')][_0x400f('0xcf')]('nolimit')){_0x2984d3['limit']=qs[_0x400f('0x23')](_0x5794b2[_0x400f('0x44')][_0x400f('0x23')]);_0x2984d3[_0x400f('0x25')]=qs['offset'](_0x5794b2[_0x400f('0x44')]['offset']);}return _0x437be6[_0x400f('0xed')](_0x2984d3);}})[_0x400f('0x15')](function(_0x1c1d75){if(_0x1c1d75){return _0x1c1d75?{'count':_0x461fd3,'rows':_0x1c1d75}:null;}})[_0x400f('0x15')](respondWithResult(_0x1e6b69,null))['catch'](handleError(_0x1e6b69,null));};exports[_0x400f('0xef')]=function(_0x5897ba,_0x334fbf){var _0x3ec8e0={};var _0x5e1660={};var _0x4aac5b;var _0x1c4400;return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x5897ba[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x334fbf,null))['then'](function(_0x4105fd){if(_0x4105fd){_0x4aac5b=_0x4105fd;_0x5e1660[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0xf0')][_0x400f('0x3d')]);_0x5e1660['query']=_['keys'](_0x5897ba[_0x400f('0x44')]);_0x5e1660[_0x400f('0x58')]=_[_0x400f('0x59')](_0x5e1660[_0x400f('0x5a')],_0x5e1660[_0x400f('0x44')]);_0x3ec8e0[_0x400f('0x47')]=_['intersection'](_0x5e1660['model'],qs['fields'](_0x5897ba[_0x400f('0x44')][_0x400f('0x5b')]));_0x3ec8e0['attributes']=_0x3ec8e0[_0x400f('0x47')]['length']?_0x3ec8e0[_0x400f('0x47')]:_0x5e1660[_0x400f('0x5a')];_0x3ec8e0[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x5897ba[_0x400f('0x44')][_0x400f('0xd7')]);_0x3ec8e0['where']=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x5897ba['query'],_0x5e1660[_0x400f('0x58')]));if(_0x5897ba[_0x400f('0x44')][_0x400f('0x33')]){_0x3ec8e0['where']=_[_0x400f('0xda')](_0x3ec8e0['where'],{'$or':_[_0x400f('0x8d')](_0x3ec8e0['attributes'],function(_0x4e4022){var _0x80fd85={};_0x80fd85[_0x4e4022]={'$like':'%'+_0x5897ba['query'][_0x400f('0x33')]+'%'};return _0x80fd85;})});}_0x3ec8e0=_[_0x400f('0xda')]({},_0x3ec8e0,_0x5897ba['options']);return _0x4aac5b[_0x400f('0xef')](_0x3ec8e0);}})[_0x400f('0x15')](function(_0x2df4e9){if(_0x2df4e9){_0x1c4400=_0x2df4e9[_0x400f('0x5c')];if(!_0x5897ba[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x3ec8e0['limit']=qs[_0x400f('0x23')](_0x5897ba[_0x400f('0x44')][_0x400f('0x23')]);_0x3ec8e0[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x5897ba['query'][_0x400f('0x25')]);}return _0x4aac5b[_0x400f('0xef')](_0x3ec8e0);}})[_0x400f('0x15')](function(_0x280b97){if(_0x280b97){return _0x280b97?{'count':_0x1c4400,'rows':_0x280b97}:null;}})[_0x400f('0x15')](respondWithResult(_0x334fbf,null))['catch'](handleError(_0x334fbf,null));};exports[_0x400f('0xf1')]=function(_0x366ed1,_0x2a32ad,_0x52b5e2){var _0x1c9e58;var _0x58261d;var _0x1f3535;var _0x4c5f30=!_['isNil'](_0x366ed1[_0x400f('0x55')]['id'])?_0x366ed1[_0x400f('0x55')]['id']:!_['isNil'](_0x366ed1[_0x400f('0x30')]['id'])?_0x366ed1[_0x400f('0x30')]['id']:null;return db['User'][_0x400f('0x5d')]({'where':{'id':_0x4c5f30,'role':{'$or':['admin','user',_0x400f('0x2a')]}},'attributes':['id',_0x400f('0x37'),'phone',_0x400f('0xf2'),'role',_0x400f('0x68'),_0x400f('0xa0')]})['then'](function(_0x4e2872){if(_0x4e2872){if(_0x4e2872[_0x400f('0x2d')]===_0x400f('0x2a')){_0x1c9e58=_0x4e2872;if(_0x366ed1['body']['interface']){_0x1f3535=util[_0x400f('0xb0')]('LOCAL/%s@from-sip/n',_0x1c9e58[_0x366ed1[_0x400f('0x5f')][_0x400f('0xa2')]]);}else if(_0x366ed1[_0x400f('0x5f')][_0x400f('0xf3')]){_0x1f3535=util['format'](_0x400f('0xf4'),_0x366ed1[_0x400f('0x5f')][_0x400f('0xf3')]);}else{_0x1f3535=util[_0x400f('0xb0')]('SIP/%s',_0x1c9e58[_0x400f('0x37')]);}socket['to'](util[_0x400f('0xb0')](_0x400f('0xf5'),_0x1c9e58[_0x400f('0x37')]))[_0x400f('0x2b')](_0x400f('0xf6'),{'user':{'id':_0x1c9e58['id'],'name':_0x1c9e58['name']},'ip':_0x366ed1[_0x400f('0xf7')][_0x400f('0xf8')]||_0x366ed1['connection']['remoteAddress']||_0x366ed1[_0x400f('0xf9')][_0x400f('0xfa')]||_0x366ed1[_0x400f('0xfb')]['socket'][_0x400f('0xfa')]});return db[_0x400f('0xb1')][_0x400f('0x39')]({'where':{'membername':_0x1c9e58[_0x400f('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x400f('0x95'))][(_0x400f('0x93'))](_0x400f('0xfc'));}})[_0x400f('0x15')](function(){if(_0x1c9e58){return _0x1c9e58[_0x400f('0xfd')]({'raw':!![]});}})['then'](function(_0x1f413c){if(_0x1c9e58){if(_0x1f413c){_0x58261d=_0x1f413c;if(_0x58261d[_0x400f('0x5c')]){var _0x54b11f=_0x58261d[_0x400f('0x8d')](function(_0x1086f6){var _0x21fd71={'membername':_0x1c9e58[_0x400f('0x37')],'UserId':_0x1c9e58['id'],'queue_name':_0x1086f6['name'],'VoiceQueueId':_0x1086f6['id'],'interface':_0x1f3535,'paused':_0x1c9e58[_0x400f('0xa0')]||![],'penalty':_0x1086f6[_0x400f('0xfe')]||0x0};return db[_0x400f('0xb1')][_0x400f('0xb2')](_0x21fd71);});return Promise['all'](_0x54b11f);}}}})[_0x400f('0x15')](function(){if(_0x1c9e58){return db[_0x400f('0xff')][_0x400f('0x49')]({'where':{'membername':_0x1c9e58[_0x400f('0x37')],'exitAt':null}});}})['then'](function(_0x3bb70d){if(_0x1c9e58){var _0x5456d2=[];_0x3bb70d[_0x400f('0x100')](function(_0x575e40){_0x5456d2[_0x400f('0x48')](_0x575e40['update']({'exitAt':moment()[_0x400f('0xb0')](_0x400f('0x101'))}));});return Promise[_0x400f('0x8c')](_0x5456d2);}})['then'](function(){if(_0x1c9e58){var _0x42b246=[];var _0x1b4e42=[];var _0x1ea87b=utils[_0x400f('0x102')]();var _0x2a3c14={'membername':_0x1c9e58[_0x400f('0x37')],'interface':_0x1f3535,'enterAt':moment()['format'](_0x400f('0x101')),'role':_0x1c9e58['role'],'internal':_0x1c9e58[_0x400f('0x68')]};_0x1ea87b['forEach'](function(_0x948f63){_0x42b246[_0x400f('0x48')](_[_0x400f('0xda')]({'channel':_0x948f63,'type':'LOGIN','data1':_0x366ed1['body'][_0x400f('0x103')],'data2':_0x1f3535},_0x2a3c14));if(_0x1c9e58[_0x400f('0xa0')]){_0x1b4e42[_0x400f('0x48')](_[_0x400f('0xda')]({'channel':_0x948f63,'type':'PAUSE','data1':_0x400f('0x104')},_0x2a3c14));}});return db[_0x400f('0xff')][_0x400f('0x89')](_0x42b246['concat'](_0x1b4e42),{'individualHooks':!![]});}})[_0x400f('0x15')](function(){if(_0x1c9e58){return _0x1c9e58[_0x400f('0x29')]({'online':!![],'lastLoginAt':moment()[_0x400f('0xb0')](_0x400f('0x101')),'voicePause':_0x1c9e58[_0x400f('0xa0')]||![],'mailPause':_0x1c9e58[_0x400f('0xa0')]||![],'chatPause':_0x1c9e58[_0x400f('0xa0')]||![],'faxPause':_0x1c9e58[_0x400f('0xa0')]||![],'smsPause':_0x1c9e58[_0x400f('0xa0')]||![],'openchannelPause':_0x1c9e58[_0x400f('0xa0')]||![],'whatsappPause':_0x1c9e58[_0x400f('0xa0')]||![],'pauseType':_0x1c9e58[_0x400f('0xa0')]?'LOGININPAUSE':null,'interface':_0x1f3535,'lastPauseAt':moment()[_0x400f('0xb0')](_0x400f('0x101'))});}})[_0x400f('0x15')](function(_0x2303f5){if(_0x366ed1['isMiddleware']){return _0x52b5e2();}else{return Promise[_0x400f('0x105')](_0x2303f5)[_0x400f('0x15')](respondWithResult(_0x2a32ad,null));}})[_0x400f('0x53')](handleError(_0x2a32ad,null));};exports[_0x400f('0x106')]=function(_0x2a9be2,_0x4afa08){var _0x1c707e;return db['User']['find']({'where':{'id':_0x2a9be2['params']['id'],'role':_0x400f('0x2a')},'attributes':['id',_0x400f('0x37'),'role']})[_0x400f('0x15')](handleEntityNotFound(_0x4afa08,null))[_0x400f('0x15')](function(_0x529bba){if(_0x529bba){_0x1c707e=_0x529bba;return db['UserVoiceQueueRt'][_0x400f('0x39')]({'where':{'membername':_0x1c707e['name']},'individualHooks':!![]});}})[_0x400f('0x15')](function(){return db['MemberReport'][_0x400f('0x49')]({'where':{'membername':_0x1c707e[_0x400f('0x37')],'exitAt':null}});})[_0x400f('0x15')](function(_0x49add7){var _0x17f3c6=[];_0x49add7[_0x400f('0x100')](function(_0x40472c){_0x17f3c6['push'](_0x40472c[_0x400f('0x29')]({'exitAt':moment()[_0x400f('0xb0')](_0x400f('0x101'))}));});return Promise['all'](_0x17f3c6);})[_0x400f('0x15')](function(){return _0x1c707e[_0x400f('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x400f('0x15')](respondWithResult(_0x4afa08,null))['catch'](handleError(_0x4afa08,null));};exports[_0x400f('0x107')]=function(_0x36ea2c,_0x28b6ba){var _0x28ccfb;return db[_0x400f('0xb1')][_0x400f('0x29')]({'paused':0x1},{'where':{'UserId':_0x36ea2c[_0x400f('0x55')]['id']},'individualHooks':!![]})[_0x400f('0x15')](function(){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x36ea2c[_0x400f('0x55')]['id'],'role':'agent'},'attributes':['id',_0x400f('0x37'),_0x400f('0x2d'),_0x400f('0x68'),_0x400f('0xa2'),'online']});})[_0x400f('0x15')](handleEntityNotFound(_0x28b6ba,null))[_0x400f('0x15')](function(_0x252d0f){if(_0x252d0f){_0x28ccfb=_0x252d0f;return respondWithRpcPromise('QueuePause',_0x400f('0x107'),{'id':_0x28ccfb['id'],'name':_0x28ccfb[_0x400f('0x37')],'pause':!![]});}})[_0x400f('0x15')](function(){if(_0x28ccfb){return db[_0x400f('0xff')][_0x400f('0x49')]({'where':{'membername':_0x28ccfb[_0x400f('0x37')],'type':_0x400f('0x108'),'exitAt':null}});}})[_0x400f('0x15')](function(_0x1063d1){if(_0x1063d1[_0x400f('0x5c')]){var _0x44d7b3=moment()[_0x400f('0xb0')](_0x400f('0x101'));for(var _0xce4efc=0x0,_0x607a4=_0x1063d1[_0x400f('0x5c')];_0xce4efc<_0x607a4;_0xce4efc++){_0x1063d1[_0xce4efc]['updateAttributes']({'exitAt':_0x44d7b3});}}})[_0x400f('0x15')](function(){var _0x5d573e=[];var _0x46c634=utils[_0x400f('0x102')]();_0x46c634[_0x400f('0x100')](function(_0x2b438e){_0x5d573e['push']({'channel':_0x2b438e,'membername':_0x28ccfb[_0x400f('0x37')],'interface':_['isNil'](_0x28ccfb[_0x400f('0xa2')])?util[_0x400f('0xb0')](_0x400f('0xf4'),_0x28ccfb[_0x400f('0x37')]):_0x28ccfb['interface'],'type':'PAUSE','enterAt':moment()[_0x400f('0xb0')](_0x400f('0x101')),'data1':_0x36ea2c['body'][_0x400f('0x109')]||_0x400f('0x10a'),'role':_0x28ccfb[_0x400f('0x2d')],'internal':_0x28ccfb['internal']});});return db['MemberReport'][_0x400f('0x89')](_0x5d573e,{'individualHooks':!![]});})['then'](function(){return _0x28ccfb[_0x400f('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x36ea2c['body'][_0x400f('0x109')]||_0x400f('0x10a'),'lastPauseAt':moment()[_0x400f('0xb0')](_0x400f('0x101'))});})[_0x400f('0x15')](respondWithResult(_0x28b6ba,null))[_0x400f('0x53')](handleError(_0x28b6ba,null));};exports[_0x400f('0x10b')]=function(_0x4da18f,_0x139c45){if(_0x4da18f[_0x400f('0x5f')][_0x400f('0x9e')]&&!utils[_0x400f('0xa3')](_0x4da18f['body'][_0x400f('0x9e')])){throw new APIBadRequestError(util[_0x400f('0xb0')](_0x400f('0x10c'),_0x4da18f[_0x400f('0x5f')][_0x400f('0x9e')]));}return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x4da18f[_0x400f('0x55')]['id']},'attributes':['id','name',_0x400f('0x2d'),'internal',_0x400f('0xa2'),_0x400f('0x9f'),_0x400f('0xa1'),_0x400f('0x10d'),_0x400f('0x10e'),_0x400f('0x10f'),'openchannelPause',_0x400f('0x110'),_0x400f('0x111'),_0x400f('0x112'),_0x400f('0x113')]})['then'](function(_0x3ecf22){if(!_0x3ecf22){throw new APINotFoundError(util[_0x400f('0xb0')](_0x400f('0x114'),_0x4da18f[_0x400f('0x55')]['id']));}return _0x3ecf22['unpause'](_0x4da18f[_0x400f('0x5f')]['channel']);})[_0x400f('0x15')](respondWithResult(_0x139c45,null))[_0x400f('0x53')](APIHandleError(_0x139c45));};exports[_0x400f('0x115')]=function(_0x473396,_0xe4ca3f){var _0x438ec8={};var _0xe8fc46={};var _0x492f6e;var _0x41ed99;return db['User'][_0x400f('0x99')]({'where':{'id':_0x473396[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0xe4ca3f,null))['then'](function(_0x3c67d){if(_0x3c67d){_0x492f6e=_0x3c67d;_0xe8fc46[_0x400f('0x5a')]=_['keys'](db['Team'][_0x400f('0x3d')]);_0xe8fc46[_0x400f('0x44')]=_['keys'](_0x473396[_0x400f('0x44')]);_0xe8fc46[_0x400f('0x58')]=_[_0x400f('0x59')](_0xe8fc46['model'],_0xe8fc46[_0x400f('0x44')]);_0x438ec8[_0x400f('0x47')]=_[_0x400f('0x59')](_0xe8fc46[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x473396[_0x400f('0x44')]['fields']));_0x438ec8['attributes']=_0x438ec8[_0x400f('0x47')][_0x400f('0x5c')]?_0x438ec8[_0x400f('0x47')]:_0xe8fc46['model'];_0x438ec8['order']=qs['sort'](_0x473396[_0x400f('0x44')]['sort']);_0x438ec8[_0x400f('0xd8')]=qs['filters'](_[_0x400f('0xd9')](_0x473396[_0x400f('0x44')],_0xe8fc46[_0x400f('0x58')]));if(_0x473396['query'][_0x400f('0x33')]){_0x438ec8[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x438ec8[_0x400f('0xd8')],{'$or':_['map'](_0x438ec8[_0x400f('0x47')],function(_0x4710f1){var _0x43c858={};_0x43c858[_0x4710f1]={'$like':'%'+_0x473396[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x43c858;})});}_0x438ec8=_[_0x400f('0xda')]({},_0x438ec8,_0x473396['options']);return _0x492f6e[_0x400f('0x115')](_0x438ec8);}})[_0x400f('0x15')](function(_0x35de03){if(_0x35de03){_0x41ed99=_0x35de03[_0x400f('0x5c')];if(!_0x473396[_0x400f('0x44')]['hasOwnProperty']('nolimit')){_0x438ec8['limit']=qs[_0x400f('0x23')](_0x473396[_0x400f('0x44')][_0x400f('0x23')]);_0x438ec8[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x473396[_0x400f('0x44')]['offset']);}return _0x492f6e[_0x400f('0x115')](_0x438ec8);}})[_0x400f('0x15')](function(_0x260869){if(_0x260869){return _0x260869?{'count':_0x41ed99,'rows':_0x260869}:null;}})[_0x400f('0x15')](respondWithResult(_0xe4ca3f,null))['catch'](handleError(_0xe4ca3f,null));};exports[_0x400f('0x116')]=function(_0xb9d4ec,_0x407d48){var _0x1d0a48=_0xb9d4ec[_0x400f('0x55')]['id'];var _0x5885fb=_0xb9d4ec[_0x400f('0x5f')]?_0xb9d4ec[_0x400f('0x5f')][_0x400f('0xaa')]:null;var _0x289b95=[];return Promise[_0x400f('0x105')]()[_0x400f('0x15')](function(){if(!_0x5885fb)throw new APIBadRequestError(_0x400f('0x117'));})['then'](function(){return db['User'][_0x400f('0x99')]({'where':{'id':_0x1d0a48}});})['then'](function(_0x229217){if(!_0x229217)throw new APINotFoundError(util[_0x400f('0xb0')](_0x400f('0x114'),_0xb9d4ec[_0x400f('0x55')]['id']));return db[_0x400f('0x6b')]['transaction'](function(_0x392d85){return _0x229217['addTeams'](_0x5885fb,{'transaction':_0x392d85})['then'](function(){return db[_0x400f('0x118')][_0x400f('0x49')]({'where':{'id':{'$in':_0x5885fb}}});})['then'](function(_0x538e75){var _0x5ea696=_[_0x400f('0x8d')](_0x538e75,function(_0xa6cf4d){return _0xa6cf4d[_0x400f('0x119')]();});return Promise['all'](_0x5ea696);})[_0x400f('0x15')](function(_0x12ed14){_0x289b95=_[_0x400f('0x11a')](_0x12ed14);var _0x4c9738=_[_0x400f('0x8d')](_0x289b95,function(_0x31381f){return _0x31381f[_0x400f('0x11b')](_0x229217['id'],{'transaction':_0x392d85});});return Promise[_0x400f('0x8c')](_0x4c9738);})[_0x400f('0x15')](function(){if(!_0x229217[_0x400f('0x9f')])return;var _0x3568c1=_[_0x400f('0x33')](_0x289b95,function(_0x2d4824){return _0x2d4824[_0x400f('0x11c')](_0x400f('0x9e'))==='Voice';});var _0x4f5909=_[_0x400f('0x8d')](_0x3568c1,function(_0x5f0367){return db['UserVoiceQueueRt'][_0x400f('0xb2')]({'membername':_0x229217[_0x400f('0x37')],'UserId':_0x229217['id'],'queue_name':_0x5f0367[_0x400f('0x37')],'VoiceQueueId':_0x5f0367['id'],'interface':_[_0x400f('0x69')](_0x229217[_0x400f('0xa2')])?util[_0x400f('0xb0')]('SIP/%s',_0x229217['name']):_0x229217['interface'],'paused':_0x229217[_0x400f('0xa1')]||![],'penalty':_0x229217[_0x400f('0xa8')]},{'transaction':_0x392d85});});return Promise[_0x400f('0x8c')](_0x4f5909);})[_0x400f('0x15')](function(){return db[_0x400f('0x11d')][_0x400f('0x49')]({'where':{'teamId':{'$in':_0x5885fb}}});})[_0x400f('0x15')](function(_0x4e1c0d){var _0x46d8de=_[_0x400f('0x8d')](_0x4e1c0d,function(_0x4e3e29){return db['UserVoicePrefix'][_0x400f('0x81')]({'UserId':_0x229217['id'],'VoicePrefixId':_0x4e3e29[_0x400f('0x11e')]},{'transaction':_0x392d85});});return Promise[_0x400f('0x8c')](_0x46d8de);});});})[_0x400f('0x15')](function(){for(var _0x4db60b=0x0;_0x4db60b<_0x289b95[_0x400f('0x5c')];_0x4db60b++){var _0x2f1473=_0x289b95[_0x4db60b][_0x400f('0x11c')](_0x400f('0x9e'));var _0x375693=_0x2f1473+_0x400f('0xb6');socket[_0x400f('0x2b')](_0x400f('0x30')+_0x2f1473+_0x400f('0xac'),{'UserId':_0x1d0a48,['queueField']:_0x289b95[_0x4db60b]['id']});}})[_0x400f('0x15')](respondWithStatusCode(_0x407d48,null))[_0x400f('0x53')](APIHandleError(_0x407d48));};exports[_0x400f('0x11f')]=function(_0x4e6da2,_0xe7bab3){var _0x3847dd=_0x4e6da2['params']['id'];var _0x19c2e3=null;if(_0x4e6da2[_0x400f('0x44')]['ids']){_0x19c2e3=_[_0x400f('0x120')](_0x4e6da2['query'][_0x400f('0xaa')])?_0x4e6da2[_0x400f('0x44')][_0x400f('0xaa')]:[_0x4e6da2[_0x400f('0x44')][_0x400f('0xaa')]];}var _0x3a04c2=[];return Promise['resolve']()[_0x400f('0x15')](function(){if(!_0x19c2e3)throw new APIBadRequestError(_0x400f('0x121'));})[_0x400f('0x15')](function(){return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x3847dd}});})[_0x400f('0x15')](function(_0x1d23c7){if(!_0x1d23c7)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x4e6da2[_0x400f('0x55')]['id']));return db[_0x400f('0x6b')][_0x400f('0x122')](function(_0xda181f){return _0x1d23c7[_0x400f('0x11f')](_0x19c2e3,{'transaction':_0xda181f})[_0x400f('0x15')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x19c2e3}}});})['then'](function(_0x5e0ac1){var _0x2ca9b3=_[_0x400f('0x8d')](_0x5e0ac1,function(_0x6d77fb){return _0x6d77fb['getAssociatedQueues']();});return Promise[_0x400f('0x8c')](_0x2ca9b3);})['then'](function(_0x25902d){_0x3a04c2=_[_0x400f('0x11a')](_0x25902d);var _0x44cdf1=_[_0x400f('0x8d')](_0x3a04c2,function(_0x22b7d3){return _0x22b7d3[_0x400f('0x123')](_0x1d23c7['id'],{'transaction':_0xda181f});});return Promise[_0x400f('0x8c')](_0x44cdf1);})[_0x400f('0x15')](function(){if(!_0x1d23c7[_0x400f('0x9f')])return;var _0xf46491=_[_0x400f('0x33')](_0x3a04c2,function(_0x3f96cb){return _0x3f96cb['getDataValue'](_0x400f('0x9e'))==='Voice';});var _0x111ac5=_['map'](_0xf46491,function(_0x166ee9){return db[_0x400f('0xb1')][_0x400f('0x39')]({'where':{'VoiceQueueId':_0x166ee9['id'],'UserId':_0x1d23c7['id']},'transaction':_0xda181f});});return Promise[_0x400f('0x8c')](_0x111ac5);})[_0x400f('0x15')](function(){return db[_0x400f('0x11d')][_0x400f('0x49')]({'where':{'teamId':{'$in':_0x19c2e3}}});})[_0x400f('0x15')](function(_0x415d6e){var _0xf89c0e=_[_0x400f('0x8d')](_0x415d6e,function(_0x24b17a){return db[_0x400f('0x124')][_0x400f('0x39')]({'where':{'UserId':_0x1d23c7['id'],'VoicePrefixId':_0x24b17a[_0x400f('0x11e')]}},{'transaction':_0xda181f});});return Promise[_0x400f('0x8c')](_0xf89c0e);});});})['then'](function(){for(var _0x37525c=0x0;_0x37525c<_0x3a04c2[_0x400f('0x5c')];_0x37525c++){var _0x46eed3=_0x3a04c2[_0x37525c]['getDataValue'](_0x400f('0x9e'));var _0x26018e=_0x46eed3+_0x400f('0xb6');socket[_0x400f('0x2b')](_0x400f('0x30')+_0x46eed3+'Queue:remove',{'UserId':_0x3847dd,['queueField']:_0x3a04c2[_0x37525c]['id']});}})[_0x400f('0x15')](respondWithStatusCode(_0xe7bab3,null))['catch'](APIHandleError(_0xe7bab3));};exports[_0x400f('0x125')]=function(_0x323ca0,_0x40adf9){var _0x1c27bf={};var _0x369139={};var _0xda323a;var _0x4d216b;return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x323ca0['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x40adf9,null))[_0x400f('0x15')](function(_0x24dd40){if(_0x24dd40){_0xda323a=_0x24dd40;_0x369139[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0x126')][_0x400f('0x3d')]);_0x369139[_0x400f('0x44')]=_[_0x400f('0x57')](_0x323ca0[_0x400f('0x44')]);_0x369139[_0x400f('0x58')]=_[_0x400f('0x59')](_0x369139[_0x400f('0x5a')],_0x369139[_0x400f('0x44')]);_0x1c27bf[_0x400f('0x47')]=_['intersection'](_0x369139[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x323ca0[_0x400f('0x44')][_0x400f('0x5b')]));_0x1c27bf[_0x400f('0x47')]=_0x1c27bf['attributes']['length']?_0x1c27bf[_0x400f('0x47')]:_0x369139['model'];_0x1c27bf[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x323ca0['query'][_0x400f('0xd7')]);_0x1c27bf['where']=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x323ca0[_0x400f('0x44')],_0x369139[_0x400f('0x58')]));if(_0x323ca0['query'][_0x400f('0x33')]){_0x1c27bf[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x1c27bf[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x1c27bf[_0x400f('0x47')],function(_0x3ad760){var _0x4c50e0={};_0x4c50e0[_0x3ad760]={'$like':'%'+_0x323ca0[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x4c50e0;})});}_0x1c27bf=_[_0x400f('0xda')]({},_0x1c27bf,_0x323ca0['options']);return _0xda323a[_0x400f('0x125')](_0x1c27bf);}})['then'](function(_0x33477a){if(_0x33477a){_0x4d216b=_0x33477a[_0x400f('0x5c')];if(!_0x323ca0['query'][_0x400f('0xcf')]('nolimit')){_0x1c27bf[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x323ca0[_0x400f('0x44')][_0x400f('0x23')]);_0x1c27bf['offset']=qs[_0x400f('0x25')](_0x323ca0[_0x400f('0x44')][_0x400f('0x25')]);}return _0xda323a[_0x400f('0x125')](_0x1c27bf);}})['then'](function(_0x28af77){if(_0x28af77){return _0x28af77?{'count':_0x4d216b,'rows':_0x28af77}:null;}})['then'](respondWithResult(_0x40adf9,null))[_0x400f('0x53')](handleError(_0x40adf9,null));};exports[_0x400f('0x127')]=function(_0x4fa855,_0x33708e){var _0x598a9f={};var _0x16b6f6={};var _0x14aae6;return db['User'][_0x400f('0x99')]({'where':{'id':_0x4fa855[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x33708e,null))[_0x400f('0x15')](function(_0x2b52bd){if(_0x2b52bd){_0x14aae6=_0x2b52bd;_0x16b6f6[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0x3c')][_0x400f('0x3d')]);_0x16b6f6[_0x400f('0x44')]=_[_0x400f('0x57')](_0x4fa855[_0x400f('0x44')]);_0x16b6f6[_0x400f('0x58')]=_[_0x400f('0x59')](_0x16b6f6[_0x400f('0x5a')],_0x16b6f6['query']);_0x598a9f[_0x400f('0x47')]=_[_0x400f('0x59')](_0x16b6f6[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x4fa855[_0x400f('0x44')][_0x400f('0x5b')]));_0x598a9f[_0x400f('0x47')]=_0x598a9f['attributes']['length']?_0x598a9f[_0x400f('0x47')]:_0x16b6f6[_0x400f('0x5a')];_0x598a9f['order']=qs[_0x400f('0xd7')](_0x4fa855[_0x400f('0x44')][_0x400f('0xd7')]);_0x598a9f[_0x400f('0xd8')]=qs[_0x400f('0x58')](_['pick'](_0x4fa855[_0x400f('0x44')],_0x16b6f6[_0x400f('0x58')]));if(_0x4fa855[_0x400f('0x44')]['filter']){_0x598a9f[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x598a9f[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x598a9f['attributes'],function(_0x971806){var _0x295397={};_0x295397[_0x971806]={'$like':'%'+_0x4fa855[_0x400f('0x44')]['filter']+'%'};return _0x295397;})});}_0x598a9f[_0x400f('0x5a')]=db[_0x400f('0x3c')];_0x598a9f['as']='Agents';_0x598a9f=_['merge']({},_0x598a9f,_0x4fa855['options']);return _0x14aae6[_0x400f('0xfd')]({'include':[_0x598a9f]});}})[_0x400f('0x15')](function(_0x468b90){if(_0x468b90){var _0x319f88={},_0x29c2d2=[];for(var _0xf92faa=0x0;_0xf92faa<_0x468b90['length'];_0xf92faa+=0x1){for(var _0x21ff2c=0x0,_0x38709d;_0x21ff2c<_0x468b90[_0xf92faa][_0x400f('0x31')]['length'];_0x21ff2c+=0x1){_0x38709d=_0x468b90[_0xf92faa][_0x400f('0x31')][_0x21ff2c][_0x400f('0xaf')]({'plain':!![]});_0x319f88[_0x38709d['id']]=_0x38709d;}}_0x319f88=_[_0x400f('0x128')](_0x319f88);for(var _0x144faf=qs[_0x400f('0x25')](_0x4fa855[_0x400f('0x44')][_0x400f('0x25')]);_0x144faf<_0x319f88[_0x400f('0x5c')]&&_0x29c2d2['length']<qs[_0x400f('0x23')](_0x4fa855[_0x400f('0x44')][_0x400f('0x23')]);_0x144faf+=0x1){if(_0x319f88[_0x144faf]){_0x29c2d2[_0x400f('0x48')](_0x319f88[_0x144faf]);}}return{'count':_0x319f88[_0x400f('0x5c')],'rows':_0x29c2d2};}})['then'](respondWithResult(_0x33708e,null))[_0x400f('0x53')](handleError(_0x33708e,null));};exports['destroy']=function(_0x116971,_0x1644b7){if(_0x116971[_0x400f('0x30')]['id']==_0x116971[_0x400f('0x55')]['id']){return _0x1644b7['status'](0x1f4)[_0x400f('0x129')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x116971[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1644b7,null))['then'](removeEntity(_0x1644b7,null))[_0x400f('0x53')](handleError(_0x1644b7,null));};exports[_0x400f('0x12a')]=function(_0x5ea2e8,_0xddc7aa){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x5ea2e8['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0xddc7aa,null))[_0x400f('0x15')](function(_0x1b57d7){if(_0x1b57d7){return _0x1b57d7[_0x400f('0x12a')](_0x5ea2e8[_0x400f('0x5f')][_0x400f('0xaa')],_[_0x400f('0x62')](_0x5ea2e8[_0x400f('0x5f')],['ids','id'])||{})['spread'](function(){for(var _0x36c33c=0x0;_0x36c33c<_0x5ea2e8['body'][_0x400f('0xaa')]['length'];_0x36c33c+=0x1){socket['emit'](_0x400f('0x12b'),{'ChatInteractionId':Number(_0x5ea2e8[_0x400f('0x5f')][_0x400f('0xaa')][_0x36c33c]),'UserId':Number(_0x5ea2e8[_0x400f('0x55')]['id'])});}return _0x5ea2e8[_0x400f('0x5f')]['ids'];});}})[_0x400f('0x15')](respondWithResult(_0xddc7aa,null))[_0x400f('0x53')](handleError(_0xddc7aa,null));};exports['removeChatInteractions']=function(_0x518ae8,_0xeba728){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x518ae8[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0xeba728,null))[_0x400f('0x15')](function(_0x527101){if(_0x527101){return _0x527101['removeChatInteractions'](_0x518ae8['query'][_0x400f('0xaa')])[_0x400f('0x15')](function(){if(_[_0x400f('0x120')](_0x518ae8[_0x400f('0x44')][_0x400f('0xaa')])){for(var _0x246f13=0x0;_0x246f13<_0x518ae8[_0x400f('0x44')][_0x400f('0xaa')][_0x400f('0x5c')];_0x246f13+=0x1){socket[_0x400f('0x2b')](_0x400f('0x12c'),{'ChatInteractionId':Number(_0x518ae8[_0x400f('0x44')][_0x400f('0xaa')][_0x246f13]),'UserId':Number(_0x518ae8[_0x400f('0x55')]['id'])});}}else{socket[_0x400f('0x2b')](_0x400f('0x12c'),{'ChatInteractionId':Number(_0x518ae8[_0x400f('0x44')][_0x400f('0xaa')]),'UserId':Number(_0x518ae8[_0x400f('0x55')]['id'])});}});}})[_0x400f('0x15')](respondWithStatusCode(_0xeba728,null))[_0x400f('0x53')](handleError(_0xeba728,null));};exports[_0x400f('0x12d')]=function(_0x17a50f,_0x1f426a){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x17a50f[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1f426a,null))[_0x400f('0x15')](function(_0x4f066a){if(_0x4f066a){return _0x4f066a[_0x400f('0x12d')](_0x17a50f[_0x400f('0x5f')]['ids'],_[_0x400f('0x62')](_0x17a50f[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{})[_0x400f('0xa9')](function(){for(var _0x3f7f22=0x0;_0x3f7f22<_0x17a50f[_0x400f('0x5f')][_0x400f('0xaa')]['length'];_0x3f7f22+=0x1){socket['emit'](_0x400f('0x12e'),{'MailInteractionId':Number(_0x17a50f[_0x400f('0x5f')]['ids'][_0x3f7f22]),'UserId':Number(_0x17a50f[_0x400f('0x55')]['id'])});}return _0x17a50f['body'][_0x400f('0xaa')];});}})['then'](respondWithResult(_0x1f426a,null))[_0x400f('0x53')](handleError(_0x1f426a,null));};exports['removeMailInteractions']=function(_0x5de5d9,_0x32c168){return db[_0x400f('0x3c')]['find']({'where':{'id':_0x5de5d9[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x32c168,null))[_0x400f('0x15')](function(_0x57c841){if(_0x57c841){return _0x57c841['removeMailInteractions'](_0x5de5d9[_0x400f('0x44')]['ids'])[_0x400f('0x15')](function(){if(_['isArray'](_0x5de5d9['query'][_0x400f('0xaa')])){for(var _0xd8fbf8=0x0;_0xd8fbf8<_0x5de5d9[_0x400f('0x44')][_0x400f('0xaa')][_0x400f('0x5c')];_0xd8fbf8+=0x1){socket[_0x400f('0x2b')](_0x400f('0x12f'),{'MailInteractionId':Number(_0x5de5d9[_0x400f('0x44')][_0x400f('0xaa')][_0xd8fbf8]),'UserId':Number(_0x5de5d9[_0x400f('0x55')]['id'])});}}else{socket['emit'](_0x400f('0x12f'),{'MailInteractionId':Number(_0x5de5d9[_0x400f('0x44')][_0x400f('0xaa')]),'UserId':Number(_0x5de5d9[_0x400f('0x55')]['id'])});}});}})[_0x400f('0x15')](respondWithStatusCode(_0x32c168,null))['catch'](handleError(_0x32c168,null));};exports['addFaxInteractions']=function(_0x1eec79,_0x46bac7){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x1eec79[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x46bac7,null))[_0x400f('0x15')](function(_0x121d84){if(_0x121d84){return _0x121d84[_0x400f('0x130')](_0x1eec79[_0x400f('0x5f')][_0x400f('0xaa')],_['omit'](_0x1eec79[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{})[_0x400f('0xa9')](function(){for(var _0x5837fe=0x0;_0x5837fe<_0x1eec79[_0x400f('0x5f')][_0x400f('0xaa')]['length'];_0x5837fe+=0x1){socket['emit'](_0x400f('0x131'),{'FaxInteractionId':Number(_0x1eec79['body'][_0x400f('0xaa')][_0x5837fe]),'UserId':Number(_0x1eec79['params']['id'])});}return _0x1eec79['body']['ids'];});}})[_0x400f('0x15')](respondWithResult(_0x46bac7,null))[_0x400f('0x53')](handleError(_0x46bac7,null));};exports[_0x400f('0x132')]=function(_0xda4d48,_0x4df35e){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0xda4d48[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x4df35e,null))[_0x400f('0x15')](function(_0x2c9217){if(_0x2c9217){return _0x2c9217[_0x400f('0x132')](_0xda4d48['query'][_0x400f('0xaa')])[_0x400f('0x15')](function(){if(_[_0x400f('0x120')](_0xda4d48[_0x400f('0x44')]['ids'])){for(var _0x384a6b=0x0;_0x384a6b<_0xda4d48[_0x400f('0x44')][_0x400f('0xaa')][_0x400f('0x5c')];_0x384a6b+=0x1){socket[_0x400f('0x2b')](_0x400f('0x133'),{'FaxInteractionId':Number(_0xda4d48[_0x400f('0x44')][_0x400f('0xaa')][_0x384a6b]),'UserId':Number(_0xda4d48[_0x400f('0x55')]['id'])});}}else{socket[_0x400f('0x2b')](_0x400f('0x133'),{'FaxInteractionId':Number(_0xda4d48[_0x400f('0x44')][_0x400f('0xaa')]),'UserId':Number(_0xda4d48[_0x400f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x4df35e,null))[_0x400f('0x53')](handleError(_0x4df35e,null));};exports[_0x400f('0x134')]=function(_0x4aba97,_0x2414e0){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x4aba97[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x2414e0,null))[_0x400f('0x15')](function(_0x3ba3ea){if(_0x3ba3ea){return _0x3ba3ea[_0x400f('0x134')](_0x4aba97['body'][_0x400f('0xaa')],_[_0x400f('0x62')](_0x4aba97[_0x400f('0x5f')],['ids','id'])||{})[_0x400f('0xa9')](function(){for(var _0x39916a=0x0;_0x39916a<_0x4aba97[_0x400f('0x5f')][_0x400f('0xaa')]['length'];_0x39916a+=0x1){socket[_0x400f('0x2b')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x4aba97[_0x400f('0x5f')]['ids'][_0x39916a]),'UserId':Number(_0x4aba97[_0x400f('0x55')]['id'])});}return _0x4aba97[_0x400f('0x5f')][_0x400f('0xaa')];});}})[_0x400f('0x15')](respondWithResult(_0x2414e0,null))[_0x400f('0x53')](handleError(_0x2414e0,null));};exports[_0x400f('0x135')]=function(_0x49fcf1,_0x3654a9){return db['User']['find']({'where':{'id':_0x49fcf1[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x3654a9,null))[_0x400f('0x15')](function(_0x164daf){if(_0x164daf){return _0x164daf[_0x400f('0x135')](_0x49fcf1[_0x400f('0x44')][_0x400f('0xaa')])[_0x400f('0x15')](function(){if(_[_0x400f('0x120')](_0x49fcf1[_0x400f('0x44')][_0x400f('0xaa')])){for(var _0x3d4ee8=0x0;_0x3d4ee8<_0x49fcf1[_0x400f('0x44')][_0x400f('0xaa')]['length'];_0x3d4ee8+=0x1){socket['emit'](_0x400f('0x136'),{'SmsInteractionId':Number(_0x49fcf1[_0x400f('0x44')][_0x400f('0xaa')][_0x3d4ee8]),'UserId':Number(_0x49fcf1[_0x400f('0x55')]['id'])});}}else{socket['emit'](_0x400f('0x136'),{'SmsInteractionId':Number(_0x49fcf1[_0x400f('0x44')][_0x400f('0xaa')]),'UserId':Number(_0x49fcf1[_0x400f('0x55')]['id'])});}});}})[_0x400f('0x15')](respondWithStatusCode(_0x3654a9,null))['catch'](handleError(_0x3654a9,null));};exports[_0x400f('0x137')]=function(_0x3e75ab,_0x1299f4){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x3e75ab[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1299f4,null))[_0x400f('0x15')](function(_0x149611){if(_0x149611){return _0x149611[_0x400f('0x137')](_0x3e75ab[_0x400f('0x5f')]['ids'],_['omit'](_0x3e75ab[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{})[_0x400f('0xa9')](function(){for(var _0x27c9be=0x0;_0x27c9be<_0x3e75ab[_0x400f('0x5f')][_0x400f('0xaa')]['length'];_0x27c9be+=0x1){socket[_0x400f('0x2b')](_0x400f('0x138'),{'OpenchannelInteractionId':Number(_0x3e75ab['body'][_0x400f('0xaa')][_0x27c9be]),'UserId':Number(_0x3e75ab['params']['id'])});}return _0x3e75ab[_0x400f('0x5f')][_0x400f('0xaa')];});}})[_0x400f('0x15')](respondWithResult(_0x1299f4,null))['catch'](handleError(_0x1299f4,null));};exports[_0x400f('0x139')]=function(_0x22ecd2,_0x10c862){return db[_0x400f('0x3c')]['find']({'where':{'id':_0x22ecd2['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x10c862,null))['then'](function(_0x441c42){if(_0x441c42){return _0x441c42[_0x400f('0x139')](_0x22ecd2[_0x400f('0x44')][_0x400f('0xaa')])[_0x400f('0x15')](function(){if(_[_0x400f('0x120')](_0x22ecd2[_0x400f('0x44')]['ids'])){for(var _0x4359d6=0x0;_0x4359d6<_0x22ecd2[_0x400f('0x44')][_0x400f('0xaa')]['length'];_0x4359d6+=0x1){socket[_0x400f('0x2b')](_0x400f('0x13a'),{'OpenchannelInteractionId':Number(_0x22ecd2['query']['ids'][_0x4359d6]),'UserId':Number(_0x22ecd2[_0x400f('0x55')]['id'])});}}else{socket['emit'](_0x400f('0x13a'),{'OpenchannelInteractionId':Number(_0x22ecd2[_0x400f('0x44')][_0x400f('0xaa')]),'UserId':Number(_0x22ecd2[_0x400f('0x55')]['id'])});}});}})[_0x400f('0x15')](respondWithStatusCode(_0x10c862,null))[_0x400f('0x53')](handleError(_0x10c862,null));};exports[_0x400f('0x13b')]=function(_0x4ad10f,_0x149a6f){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x4ad10f[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x149a6f,null))[_0x400f('0x15')](function(_0x4d5092){if(_0x4d5092){return _0x4d5092[_0x400f('0x13b')](_0x4ad10f['body'][_0x400f('0xaa')],_[_0x400f('0x62')](_0x4ad10f['body'],[_0x400f('0xaa'),'id'])||{})[_0x400f('0xa9')](function(){for(var _0xe3d6fb=0x0;_0xe3d6fb<_0x4ad10f[_0x400f('0x5f')][_0x400f('0xaa')]['length'];_0xe3d6fb+=0x1){socket[_0x400f('0x2b')](_0x400f('0x13c'),{'WhatsappInteractionId':Number(_0x4ad10f[_0x400f('0x5f')][_0x400f('0xaa')][_0xe3d6fb]),'UserId':Number(_0x4ad10f[_0x400f('0x55')]['id'])});}return _0x4ad10f[_0x400f('0x5f')][_0x400f('0xaa')];});}})[_0x400f('0x15')](respondWithResult(_0x149a6f,null))[_0x400f('0x53')](handleError(_0x149a6f,null));};exports[_0x400f('0x13d')]=function(_0x509bc8,_0x187a5b){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x509bc8[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x187a5b,null))[_0x400f('0x15')](function(_0x15040c){if(_0x15040c){return _0x15040c[_0x400f('0x13d')](_0x509bc8[_0x400f('0x44')][_0x400f('0xaa')]);}})[_0x400f('0x15')](respondWithStatusCode(_0x187a5b,null))['catch'](handleError(_0x187a5b,null));};exports[_0x400f('0x13e')]=function(_0xb25704,_0x47d52d){var _0x1a446e={};var _0x521a19={};var _0x467908;var _0x1a0d35;return db['User']['findOne']({'where':{'id':_0xb25704[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x47d52d,null))[_0x400f('0x15')](function(_0x281997){if(_0x281997){_0x467908=_0x281997;_0x521a19[_0x400f('0x5a')]=_[_0x400f('0x57')](db['VoicePrefix'][_0x400f('0x3d')]);_0x521a19['query']=_['keys'](_0xb25704['query']);_0x521a19[_0x400f('0x58')]=_[_0x400f('0x59')](_0x521a19[_0x400f('0x5a')],_0x521a19[_0x400f('0x44')]);_0x1a446e[_0x400f('0x47')]=_[_0x400f('0x59')](_0x521a19[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0xb25704[_0x400f('0x44')][_0x400f('0x5b')]));_0x1a446e[_0x400f('0x47')]=_0x1a446e[_0x400f('0x47')][_0x400f('0x5c')]?_0x1a446e[_0x400f('0x47')]:_0x521a19[_0x400f('0x5a')];_0x1a446e[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0xb25704[_0x400f('0x44')]['sort']);_0x1a446e[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0xb25704['query'],_0x521a19[_0x400f('0x58')]));if(_0xb25704[_0x400f('0x44')][_0x400f('0x33')]){_0x1a446e[_0x400f('0xd8')]=_['merge'](_0x1a446e['where'],{'$or':_[_0x400f('0x8d')](_0x1a446e[_0x400f('0x47')],function(_0x16e13a){var _0x43778f={};_0x43778f[_0x16e13a]={'$like':'%'+_0xb25704[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x43778f;})});}_0x1a446e=_[_0x400f('0xda')]({},_0x1a446e,_0xb25704[_0x400f('0xdb')]);return _0x467908['getVoicePrefixes'](_0x1a446e);}})['then'](function(_0x5d0dd9){if(_0x5d0dd9){_0x1a0d35=_0x5d0dd9[_0x400f('0x5c')];if(!_0xb25704[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x1a446e[_0x400f('0x23')]=qs[_0x400f('0x23')](_0xb25704[_0x400f('0x44')][_0x400f('0x23')]);_0x1a446e[_0x400f('0x25')]=qs[_0x400f('0x25')](_0xb25704[_0x400f('0x44')][_0x400f('0x25')]);}return _0x467908['getVoicePrefixes'](_0x1a446e);}})[_0x400f('0x15')](function(_0x59715b){if(_0x59715b){return _0x59715b?{'count':_0x1a0d35,'rows':_0x59715b}:null;}})[_0x400f('0x15')](respondWithResult(_0x47d52d,null))[_0x400f('0x53')](handleError(_0x47d52d,null));};exports[_0x400f('0x13f')]=function(_0x1df443,_0x3dd7af){var _0x3f8a71={};var _0x4eda69={};var _0x953d1f;var _0x309f95;return db['User']['findOne']({'where':{'id':_0x1df443['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x3dd7af,null))[_0x400f('0x15')](function(_0x4a21ba){if(_0x4a21ba){_0x953d1f=_0x4a21ba;_0x4eda69[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0x140')][_0x400f('0x3d')]);_0x4eda69[_0x400f('0x44')]=_[_0x400f('0x57')](_0x1df443[_0x400f('0x44')]);_0x4eda69[_0x400f('0x58')]=_[_0x400f('0x59')](_0x4eda69[_0x400f('0x5a')],_0x4eda69[_0x400f('0x44')]);_0x3f8a71['attributes']=_[_0x400f('0x59')](_0x4eda69[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0x1df443[_0x400f('0x44')][_0x400f('0x5b')]));_0x3f8a71[_0x400f('0x47')]=_0x3f8a71[_0x400f('0x47')][_0x400f('0x5c')]?_0x3f8a71['attributes']:_0x4eda69[_0x400f('0x5a')];_0x3f8a71[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x1df443[_0x400f('0x44')][_0x400f('0xd7')]);_0x3f8a71[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x1df443[_0x400f('0x44')],_0x4eda69[_0x400f('0x58')]));if(_0x1df443[_0x400f('0x44')]['filter']){_0x3f8a71[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x3f8a71[_0x400f('0xd8')],{'$or':_['map'](_0x3f8a71[_0x400f('0x47')],function(_0x2647bb){var _0x5814ff={};_0x5814ff[_0x2647bb]={'$like':'%'+_0x1df443[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x5814ff;})});}_0x3f8a71=_[_0x400f('0xda')]({},_0x3f8a71,_0x1df443[_0x400f('0xdb')]);return _0x953d1f[_0x400f('0x13f')](_0x3f8a71);}})[_0x400f('0x15')](function(_0x1abdb7){if(_0x1abdb7){_0x309f95=_0x1abdb7['length'];if(!_0x1df443[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x3f8a71['limit']=qs[_0x400f('0x23')](_0x1df443[_0x400f('0x44')][_0x400f('0x23')]);_0x3f8a71[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x1df443[_0x400f('0x44')]['offset']);}return _0x953d1f[_0x400f('0x13f')](_0x3f8a71);}})[_0x400f('0x15')](function(_0x4f4f63){if(_0x4f4f63){return _0x4f4f63?{'count':_0x309f95,'rows':_0x4f4f63}:null;}})['then'](respondWithResult(_0x3dd7af,null))[_0x400f('0x53')](handleError(_0x3dd7af,null));};exports[_0x400f('0x141')]=function(_0x4017bd,_0x2fdc86){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x4017bd[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x2fdc86,null))[_0x400f('0x15')](function(_0x11ce0b){if(_0x11ce0b){return _0x11ce0b['addFaxAccounts'](_0x4017bd[_0x400f('0x5f')][_0x400f('0xaa')],_[_0x400f('0x62')](_0x4017bd[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{});}})[_0x400f('0x15')](respondWithResult(_0x2fdc86,null))[_0x400f('0x53')](handleError(_0x2fdc86,null));};exports[_0x400f('0x142')]=function(_0x361c6e,_0x28bc09){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x361c6e['params']['id']}})['then'](handleEntityNotFound(_0x28bc09,null))[_0x400f('0x15')](function(_0x21418b){if(_0x21418b){return _0x21418b[_0x400f('0x142')](_0x361c6e[_0x400f('0x44')][_0x400f('0xaa')]);}})[_0x400f('0x15')](respondWithStatusCode(_0x28bc09,null))[_0x400f('0x53')](handleError(_0x28bc09,null));};exports[_0x400f('0x143')]=function(_0x17842f,_0x4c11d2){var _0x1ff868={};var _0x1d5b04={};var _0x3d8d8e;var _0x4c97c8;return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x17842f[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c11d2,null))[_0x400f('0x15')](function(_0x5d5976){if(_0x5d5976){_0x3d8d8e=_0x5d5976;_0x1d5b04[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0x144')][_0x400f('0x3d')]);_0x1d5b04['query']=_['keys'](_0x17842f[_0x400f('0x44')]);_0x1d5b04[_0x400f('0x58')]=_[_0x400f('0x59')](_0x1d5b04[_0x400f('0x5a')],_0x1d5b04[_0x400f('0x44')]);_0x1ff868['attributes']=_[_0x400f('0x59')](_0x1d5b04[_0x400f('0x5a')],qs['fields'](_0x17842f[_0x400f('0x44')]['fields']));_0x1ff868[_0x400f('0x47')]=_0x1ff868[_0x400f('0x47')][_0x400f('0x5c')]?_0x1ff868[_0x400f('0x47')]:_0x1d5b04['model'];_0x1ff868[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x17842f[_0x400f('0x44')][_0x400f('0xd7')]);_0x1ff868['where']=qs['filters'](_['pick'](_0x17842f['query'],_0x1d5b04[_0x400f('0x58')]));if(_0x17842f[_0x400f('0x44')]['filter']){_0x1ff868[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x1ff868['where'],{'$or':_[_0x400f('0x8d')](_0x1ff868[_0x400f('0x47')],function(_0x3b3665){var _0x3ca7f0={};_0x3ca7f0[_0x3b3665]={'$like':'%'+_0x17842f[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x3ca7f0;})});}_0x1ff868=_[_0x400f('0xda')]({},_0x1ff868,_0x17842f[_0x400f('0xdb')]);return _0x3d8d8e[_0x400f('0x143')](_0x1ff868);}})[_0x400f('0x15')](function(_0xe369bb){if(_0xe369bb){_0x4c97c8=_0xe369bb[_0x400f('0x5c')];if(!_0x17842f[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x1ff868['limit']=qs['limit'](_0x17842f[_0x400f('0x44')]['limit']);_0x1ff868[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x17842f[_0x400f('0x44')]['offset']);}return _0x3d8d8e[_0x400f('0x143')](_0x1ff868);}})['then'](function(_0x4a217f){if(_0x4a217f){return _0x4a217f?{'count':_0x4c97c8,'rows':_0x4a217f}:null;}})[_0x400f('0x15')](respondWithResult(_0x4c11d2,null))['catch'](handleError(_0x4c11d2,null));};exports['addMailAccounts']=function(_0x20a13d,_0xd2b6fc){return db['User'][_0x400f('0x5d')]({'where':{'id':_0x20a13d[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0xd2b6fc,null))[_0x400f('0x15')](function(_0x484f49){if(_0x484f49){return _0x484f49[_0x400f('0x145')](_0x20a13d[_0x400f('0x5f')][_0x400f('0xaa')],_['omit'](_0x20a13d[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{});}})[_0x400f('0x15')](respondWithResult(_0xd2b6fc,null))[_0x400f('0x53')](handleError(_0xd2b6fc,null));};exports[_0x400f('0x146')]=function(_0x5a63c9,_0x55182d){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x5a63c9[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x55182d,null))[_0x400f('0x15')](function(_0x14d3a0){if(_0x14d3a0){return _0x14d3a0[_0x400f('0x146')](_0x5a63c9[_0x400f('0x44')][_0x400f('0xaa')]);}})[_0x400f('0x15')](respondWithStatusCode(_0x55182d,null))['catch'](handleError(_0x55182d,null));};exports[_0x400f('0x147')]=function(_0xca1b86,_0x37fe02){var _0x4aa21d={};var _0x2ab638={};var _0x34238a;var _0x1784fe;return db['User'][_0x400f('0x99')]({'where':{'id':_0xca1b86[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x37fe02,null))['then'](function(_0x11eff1){if(_0x11eff1){_0x34238a=_0x11eff1;_0x2ab638[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0x148')]['rawAttributes']);_0x2ab638[_0x400f('0x44')]=_[_0x400f('0x57')](_0xca1b86['query']);_0x2ab638[_0x400f('0x58')]=_[_0x400f('0x59')](_0x2ab638[_0x400f('0x5a')],_0x2ab638[_0x400f('0x44')]);_0x4aa21d['attributes']=_['intersection'](_0x2ab638[_0x400f('0x5a')],qs[_0x400f('0x5b')](_0xca1b86[_0x400f('0x44')][_0x400f('0x5b')]));_0x4aa21d[_0x400f('0x47')]=_0x4aa21d[_0x400f('0x47')]['length']?_0x4aa21d[_0x400f('0x47')]:_0x2ab638[_0x400f('0x5a')];_0x4aa21d[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0xca1b86[_0x400f('0x44')]['sort']);_0x4aa21d[_0x400f('0xd8')]=qs['filters'](_[_0x400f('0xd9')](_0xca1b86[_0x400f('0x44')],_0x2ab638[_0x400f('0x58')]));if(_0xca1b86[_0x400f('0x44')]['filter']){_0x4aa21d[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x4aa21d['where'],{'$or':_[_0x400f('0x8d')](_0x4aa21d[_0x400f('0x47')],function(_0x3a64a6){var _0x21b5b8={};_0x21b5b8[_0x3a64a6]={'$like':'%'+_0xca1b86[_0x400f('0x44')]['filter']+'%'};return _0x21b5b8;})});}_0x4aa21d=_[_0x400f('0xda')]({},_0x4aa21d,_0xca1b86['options']);return _0x34238a[_0x400f('0x147')](_0x4aa21d);}})[_0x400f('0x15')](function(_0x44b61e){if(_0x44b61e){_0x1784fe=_0x44b61e[_0x400f('0x5c')];if(!_0xca1b86[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x4aa21d[_0x400f('0x23')]=qs[_0x400f('0x23')](_0xca1b86['query'][_0x400f('0x23')]);_0x4aa21d[_0x400f('0x25')]=qs[_0x400f('0x25')](_0xca1b86[_0x400f('0x44')][_0x400f('0x25')]);}return _0x34238a[_0x400f('0x147')](_0x4aa21d);}})['then'](function(_0x4c13df){if(_0x4c13df){return _0x4c13df?{'count':_0x1784fe,'rows':_0x4c13df}:null;}})[_0x400f('0x15')](respondWithResult(_0x37fe02,null))[_0x400f('0x53')](handleError(_0x37fe02,null));};exports[_0x400f('0x149')]=function(_0x3503ff,_0x3d8bee){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x3503ff[_0x400f('0x55')]['id']}})['then'](handleEntityNotFound(_0x3d8bee,null))[_0x400f('0x15')](function(_0x538325){if(_0x538325){return _0x538325[_0x400f('0x149')](_0x3503ff[_0x400f('0x5f')][_0x400f('0xaa')],_['omit'](_0x3503ff[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{});}})['then'](respondWithResult(_0x3d8bee,null))['catch'](handleError(_0x3d8bee,null));};exports[_0x400f('0x14a')]=function(_0x1d699e,_0x3b1072){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x1d699e[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x3b1072,null))[_0x400f('0x15')](function(_0x187ea1){if(_0x187ea1){return _0x187ea1[_0x400f('0x14a')](_0x1d699e[_0x400f('0x44')][_0x400f('0xaa')]);}})[_0x400f('0x15')](respondWithStatusCode(_0x3b1072,null))[_0x400f('0x53')](handleError(_0x3b1072,null));};exports[_0x400f('0x14b')]=function(_0x1b0992,_0x3d798d){var _0x4eb474={};var _0x4af530={};var _0x12fb81;var _0x5e6b91;return db[_0x400f('0x3c')]['findOne']({'where':{'id':_0x1b0992[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x3d798d,null))[_0x400f('0x15')](function(_0x241038){if(_0x241038){_0x12fb81=_0x241038;_0x4af530['model']=_[_0x400f('0x57')](db[_0x400f('0x14c')][_0x400f('0x3d')]);_0x4af530[_0x400f('0x44')]=_['keys'](_0x1b0992[_0x400f('0x44')]);_0x4af530[_0x400f('0x58')]=_[_0x400f('0x59')](_0x4af530[_0x400f('0x5a')],_0x4af530[_0x400f('0x44')]);_0x4eb474[_0x400f('0x47')]=_['intersection'](_0x4af530[_0x400f('0x5a')],qs['fields'](_0x1b0992[_0x400f('0x44')]['fields']));_0x4eb474[_0x400f('0x47')]=_0x4eb474['attributes']['length']?_0x4eb474[_0x400f('0x47')]:_0x4af530[_0x400f('0x5a')];_0x4eb474['order']=qs[_0x400f('0xd7')](_0x1b0992[_0x400f('0x44')][_0x400f('0xd7')]);_0x4eb474[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x1b0992[_0x400f('0x44')],_0x4af530[_0x400f('0x58')]));if(_0x1b0992[_0x400f('0x44')]['filter']){_0x4eb474[_0x400f('0xd8')]=_[_0x400f('0xda')](_0x4eb474[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x4eb474[_0x400f('0x47')],function(_0x16888c){var _0x597123={};_0x597123[_0x16888c]={'$like':'%'+_0x1b0992[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x597123;})});}_0x4eb474=_[_0x400f('0xda')]({},_0x4eb474,_0x1b0992['options']);return _0x12fb81['getSmsAccounts'](_0x4eb474);}})['then'](function(_0x2d9899){if(_0x2d9899){_0x5e6b91=_0x2d9899[_0x400f('0x5c')];if(!_0x1b0992[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x4eb474[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x1b0992[_0x400f('0x44')][_0x400f('0x23')]);_0x4eb474[_0x400f('0x25')]=qs['offset'](_0x1b0992[_0x400f('0x44')]['offset']);}return _0x12fb81[_0x400f('0x14b')](_0x4eb474);}})[_0x400f('0x15')](function(_0x3aca92){if(_0x3aca92){return _0x3aca92?{'count':_0x5e6b91,'rows':_0x3aca92}:null;}})[_0x400f('0x15')](respondWithResult(_0x3d798d,null))[_0x400f('0x53')](handleError(_0x3d798d,null));};exports[_0x400f('0x14d')]=function(_0x46f00d,_0x472fe5){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x46f00d['params']['id']}})['then'](handleEntityNotFound(_0x472fe5,null))['then'](function(_0x4e4d0b){if(_0x4e4d0b){return _0x4e4d0b['addSmsAccounts'](_0x46f00d[_0x400f('0x5f')]['ids'],_[_0x400f('0x62')](_0x46f00d['body'],['ids','id'])||{});}})[_0x400f('0x15')](respondWithResult(_0x472fe5,null))[_0x400f('0x53')](handleError(_0x472fe5,null));};exports[_0x400f('0x14e')]=function(_0xefb41c,_0xc31ce2){return db['User']['find']({'where':{'id':_0xefb41c[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0xc31ce2,null))['then'](function(_0x4b00fd){if(_0x4b00fd){return _0x4b00fd[_0x400f('0x14e')](_0xefb41c[_0x400f('0x44')][_0x400f('0xaa')]);}})[_0x400f('0x15')](respondWithStatusCode(_0xc31ce2,null))['catch'](handleError(_0xc31ce2,null));};exports[_0x400f('0x14f')]=function(_0x3d6fec,_0x1fdad1){var _0x58fb88={};var _0x3a48f5={};var _0x1c7814;var _0xa0798;return db['User']['findOne']({'where':{'id':_0x3d6fec[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1fdad1,null))['then'](function(_0x2e2d3b){if(_0x2e2d3b){_0x1c7814=_0x2e2d3b;_0x3a48f5[_0x400f('0x5a')]=_[_0x400f('0x57')](db[_0x400f('0x150')][_0x400f('0x3d')]);_0x3a48f5[_0x400f('0x44')]=_[_0x400f('0x57')](_0x3d6fec[_0x400f('0x44')]);_0x3a48f5[_0x400f('0x58')]=_[_0x400f('0x59')](_0x3a48f5[_0x400f('0x5a')],_0x3a48f5[_0x400f('0x44')]);_0x58fb88[_0x400f('0x47')]=_['intersection'](_0x3a48f5[_0x400f('0x5a')],qs['fields'](_0x3d6fec['query'][_0x400f('0x5b')]));_0x58fb88[_0x400f('0x47')]=_0x58fb88[_0x400f('0x47')]['length']?_0x58fb88[_0x400f('0x47')]:_0x3a48f5[_0x400f('0x5a')];_0x58fb88[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x3d6fec[_0x400f('0x44')][_0x400f('0xd7')]);_0x58fb88[_0x400f('0xd8')]=qs['filters'](_[_0x400f('0xd9')](_0x3d6fec[_0x400f('0x44')],_0x3a48f5[_0x400f('0x58')]));if(_0x3d6fec[_0x400f('0x44')]['filter']){_0x58fb88['where']=_['merge'](_0x58fb88[_0x400f('0xd8')],{'$or':_[_0x400f('0x8d')](_0x58fb88[_0x400f('0x47')],function(_0xc9d46b){var _0x4637a8={};_0x4637a8[_0xc9d46b]={'$like':'%'+_0x3d6fec[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x4637a8;})});}_0x58fb88=_[_0x400f('0xda')]({},_0x58fb88,_0x3d6fec[_0x400f('0xdb')]);return _0x1c7814[_0x400f('0x14f')](_0x58fb88);}})[_0x400f('0x15')](function(_0x9ea476){if(_0x9ea476){_0xa0798=_0x9ea476[_0x400f('0x5c')];if(!_0x3d6fec[_0x400f('0x44')]['hasOwnProperty']('nolimit')){_0x58fb88[_0x400f('0x23')]=qs['limit'](_0x3d6fec['query'][_0x400f('0x23')]);_0x58fb88[_0x400f('0x25')]=qs['offset'](_0x3d6fec[_0x400f('0x44')][_0x400f('0x25')]);}return _0x1c7814[_0x400f('0x14f')](_0x58fb88);}})[_0x400f('0x15')](function(_0x1859d7){if(_0x1859d7){return _0x1859d7?{'count':_0xa0798,'rows':_0x1859d7}:null;}})[_0x400f('0x15')](respondWithResult(_0x1fdad1,null))[_0x400f('0x53')](handleError(_0x1fdad1,null));};exports[_0x400f('0x151')]=function(_0x13d5d6,_0x53c71d){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x13d5d6['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x53c71d,null))[_0x400f('0x15')](function(_0xacfdbd){if(_0xacfdbd){return _0xacfdbd['addChatWebsites'](_0x13d5d6[_0x400f('0x5f')][_0x400f('0xaa')],_[_0x400f('0x62')](_0x13d5d6[_0x400f('0x5f')],[_0x400f('0xaa'),'id'])||{});}})['then'](respondWithResult(_0x53c71d,null))[_0x400f('0x53')](handleError(_0x53c71d,null));};exports[_0x400f('0x152')]=function(_0x4eaf5b,_0x4b1aef){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x4eaf5b[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x4b1aef,null))['then'](function(_0x21640d){if(_0x21640d){return _0x21640d[_0x400f('0x152')](_0x4eaf5b[_0x400f('0x44')]['ids']);}})[_0x400f('0x15')](respondWithStatusCode(_0x4b1aef,null))['catch'](handleError(_0x4b1aef,null));};exports[_0x400f('0x153')]=function(_0x214cc2,_0x2d1a2f){var _0x254a1f={};var _0x579994={};var _0x483f0d;var _0x8873b1;return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x214cc2['params']['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x2d1a2f,null))[_0x400f('0x15')](function(_0x2222a1){if(_0x2222a1){_0x483f0d=_0x2222a1;_0x579994[_0x400f('0x5a')]=_['keys'](db[_0x400f('0x154')][_0x400f('0x3d')]);_0x579994[_0x400f('0x44')]=_['keys'](_0x214cc2[_0x400f('0x44')]);_0x579994[_0x400f('0x58')]=_[_0x400f('0x59')](_0x579994[_0x400f('0x5a')],_0x579994[_0x400f('0x44')]);_0x254a1f[_0x400f('0x47')]=_[_0x400f('0x59')](_0x579994['model'],qs[_0x400f('0x5b')](_0x214cc2[_0x400f('0x44')][_0x400f('0x5b')]));_0x254a1f[_0x400f('0x47')]=_0x254a1f[_0x400f('0x47')]['length']?_0x254a1f[_0x400f('0x47')]:_0x579994[_0x400f('0x5a')];_0x254a1f[_0x400f('0xd6')]=qs['sort'](_0x214cc2['query'][_0x400f('0xd7')]);_0x254a1f[_0x400f('0xd8')]=qs[_0x400f('0x58')](_[_0x400f('0xd9')](_0x214cc2[_0x400f('0x44')],_0x579994[_0x400f('0x58')]));if(_0x214cc2[_0x400f('0x44')]['filter']){_0x254a1f['where']=_[_0x400f('0xda')](_0x254a1f['where'],{'$or':_[_0x400f('0x8d')](_0x254a1f[_0x400f('0x47')],function(_0x578834){var _0x47a2b0={};_0x47a2b0[_0x578834]={'$like':'%'+_0x214cc2[_0x400f('0x44')]['filter']+'%'};return _0x47a2b0;})});}_0x254a1f=_[_0x400f('0xda')]({},_0x254a1f,_0x214cc2[_0x400f('0xdb')]);return _0x483f0d[_0x400f('0x153')](_0x254a1f);}})['then'](function(_0x290bcb){if(_0x290bcb){_0x8873b1=_0x290bcb[_0x400f('0x5c')];if(!_0x214cc2[_0x400f('0x44')]['hasOwnProperty'](_0x400f('0xde'))){_0x254a1f[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x214cc2[_0x400f('0x44')][_0x400f('0x23')]);_0x254a1f['offset']=qs[_0x400f('0x25')](_0x214cc2[_0x400f('0x44')][_0x400f('0x25')]);}return _0x483f0d[_0x400f('0x153')](_0x254a1f);}})[_0x400f('0x15')](function(_0x1eee60){if(_0x1eee60){return _0x1eee60?{'count':_0x8873b1,'rows':_0x1eee60}:null;}})['then'](respondWithResult(_0x2d1a2f,null))['catch'](handleError(_0x2d1a2f,null));};exports[_0x400f('0x155')]=function(_0x3018f9,_0x1700e0){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x3018f9[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x1700e0,null))[_0x400f('0x15')](function(_0x19abce){if(_0x19abce){return _0x19abce[_0x400f('0x155')](_0x3018f9[_0x400f('0x5f')][_0x400f('0xaa')],_[_0x400f('0x62')](_0x3018f9['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1700e0,null))[_0x400f('0x53')](handleError(_0x1700e0,null));};exports[_0x400f('0x156')]=function(_0x27c2d4,_0x171d7e){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x27c2d4[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x171d7e,null))[_0x400f('0x15')](function(_0x4e8a49){if(_0x4e8a49){return _0x4e8a49[_0x400f('0x156')](_0x27c2d4[_0x400f('0x44')]['ids']);}})[_0x400f('0x15')](respondWithStatusCode(_0x171d7e,null))[_0x400f('0x53')](handleError(_0x171d7e,null));};exports[_0x400f('0x157')]=function(_0x27d5d0,_0x45ce3e){var _0x4c1800={},_0x13b4d3={},_0x56a52e={'count':0x0,'rows':[]};var _0x32fc1b=db[_0x400f('0x158')][_0x400f('0x3d')];_0x13b4d3[_0x400f('0x5a')]=_[_0x400f('0x57')](_0x32fc1b);_0x13b4d3[_0x400f('0x44')]=_[_0x400f('0x57')](_0x27d5d0['query']);_0x13b4d3[_0x400f('0x58')]=_['intersection'](_0x13b4d3[_0x400f('0x5a')],_0x13b4d3[_0x400f('0x44')]);_0x13b4d3[_0x400f('0x58')]=_[_0x400f('0xcd')](_0x13b4d3[_0x400f('0x58')],['$and',_0x400f('0x159'),'$gt','$gte',_0x400f('0x15a'),_0x400f('0x15b'),'$ne','$eq',_0x400f('0x15c'),_0x400f('0x15d'),_0x400f('0x15e'),'$in',_0x400f('0x15f'),_0x400f('0x160'),_0x400f('0x161'),_0x400f('0x162'),_0x400f('0x163'),_0x400f('0x160'),_0x400f('0x164'),_0x400f('0x165'),_0x400f('0x166'),'$any']);_0x4c1800[_0x400f('0x47')]=_[_0x400f('0x59')](_0x13b4d3['model'],qs[_0x400f('0x5b')](_0x27d5d0[_0x400f('0x44')][_0x400f('0x5b')]));_0x4c1800[_0x400f('0x47')]=_0x4c1800[_0x400f('0x47')][_0x400f('0x5c')]?_0x4c1800['attributes']:_0x13b4d3[_0x400f('0x5a')];if(!_0x27d5d0[_0x400f('0x44')]['hasOwnProperty'](_0x400f('0xde'))){_0x4c1800[_0x400f('0x23')]=qs[_0x400f('0x23')](_0x27d5d0['query'][_0x400f('0x23')]);_0x4c1800[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x27d5d0[_0x400f('0x44')][_0x400f('0x25')]);}_0x4c1800[_0x400f('0xd6')]=qs[_0x400f('0xd7')](_0x27d5d0[_0x400f('0x44')][_0x400f('0xd7')]);_0x4c1800['where']=qs[_0x400f('0x58')](_['pick'](_0x27d5d0['query'],_0x13b4d3['filters']));if(_0x27d5d0[_0x400f('0x44')]['filter']){_0x4c1800['where']=_[_0x400f('0xda')](_0x4c1800['where'],{'$or':_[_0x400f('0x8d')](_0x4c1800[_0x400f('0x47')],function(_0x47c1a1){var _0x58f41b={};_0x58f41b[_0x47c1a1]={'$like':'%'+_0x27d5d0[_0x400f('0x44')][_0x400f('0x33')]+'%'};return _0x58f41b;})});}_0x4c1800[_0x400f('0xd8')]={'$and':[_0x4c1800[_0x400f('0xd8')],{'$or':[{'UserId':_0x27d5d0['params']['id']},{'OwnerId':_0x27d5d0[_0x400f('0x55')]['id']}]}]};_0x4c1800=_[_0x400f('0xda')]({},_0x4c1800,_0x27d5d0[_0x400f('0xdb')]);var _0x122ea4={'where':_0x4c1800[_0x400f('0xd8')]};return db['CmHopper']['count'](_0x122ea4)[_0x400f('0x15')](function(_0x461025){_0x56a52e['count']=_0x461025;if(_0x27d5d0[_0x400f('0x44')][_0x400f('0x42')]){_0x4c1800[_0x400f('0x43')]=[{'attributes':['id','firstName',_0x400f('0x167'),_0x400f('0x168')],'model':db[_0x400f('0x169')],'as':_0x400f('0x16a')},{'attributes':['id','name',_0x400f('0x16b')],'model':db[_0x400f('0xae')],'as':_0x400f('0xd5')}];}return db['CmHopper'][_0x400f('0x49')](_0x4c1800);})[_0x400f('0x15')](function(_0x1d1554){_0x56a52e[_0x400f('0x4a')]=_0x1d1554;return _0x56a52e;})[_0x400f('0x15')](respondWithFilteredResult(_0x45ce3e,_0x4c1800))['catch'](handleError(_0x45ce3e,null));};exports[_0x400f('0x16c')]=function(_0x3010d9,_0x412b05){if(!_[_0x400f('0x69')](_0x3010d9[_0x400f('0x30')]['id'])&&(_0x3010d9['user'][_0x400f('0x2d')]==_0x400f('0x2e')||_0x3010d9['user'][_0x400f('0x2d')]==_0x400f('0x30'))){return db[_0x400f('0x3c')][_0x400f('0x99')]({'where':{'id':_0x3010d9['params']['id']},'raw':!![]})[_0x400f('0x15')](function(_0x38a511){return authService[_0x400f('0x16d')](_0x38a511);})[_0x400f('0x15')](function(_0x327059){if(_0x327059){return _0x412b05['status'](0xc8)['json']({'api_key':_0x327059[_0x400f('0x16e')]});}else{return _0x412b05[_0x400f('0x20')](0xcc)[_0x400f('0x22')]({'message':_0x400f('0x16f')});}})[_0x400f('0x53')](handleError(_0x412b05,0x193));}else{return _0x412b05[_0x400f('0x20')](0x191)[_0x400f('0x22')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x400f('0x170')]=function(_0x27e4a3,_0x31f793){if(!_[_0x400f('0x69')](_0x27e4a3[_0x400f('0x30')]['id'])&&(_0x27e4a3[_0x400f('0x30')][_0x400f('0x2d')]==_0x400f('0x2e')||_0x27e4a3[_0x400f('0x30')][_0x400f('0x2d')]==_0x400f('0x30'))){return db[_0x400f('0x3c')][_0x400f('0x5d')]({'where':{'id':_0x27e4a3[_0x400f('0x55')]['id']}})['then'](function(_0x39a1ec){return authService[_0x400f('0x171')](_0x39a1ec);})['then'](function(_0x247869){return db['User'][_0x400f('0x29')]({'apiKeyIat':_0x247869[_0x400f('0x172')],'apiKeyNonce':_0x247869[_0x400f('0x173')]},{'where':{'id':_0x27e4a3['params']['id']}})[_0x400f('0x15')](function(){return _0x31f793[_0x400f('0x20')](0xc8)[_0x400f('0x22')]({'api_key':_0x247869[_0x400f('0x16e')]});});})[_0x400f('0x53')](handleError(_0x31f793,0x193));}else{return _0x31f793[_0x400f('0x20')](0x191)[_0x400f('0x22')]({'message':_0x400f('0x174')});}};exports['removeApiKey']=function(_0x45a308,_0x4082a3){if(!_[_0x400f('0x69')](_0x45a308['user']['id'])&&(_0x45a308[_0x400f('0x30')][_0x400f('0x2d')]==_0x400f('0x2e')||_0x45a308[_0x400f('0x30')]['role']==_0x400f('0x30'))){return db[_0x400f('0x3c')]['find']({'where':{'id':_0x45a308[_0x400f('0x55')]['id']}})[_0x400f('0x15')](handleEntityNotFound(_0x4082a3,null))[_0x400f('0x15')](function(_0x89a5cc){if(_0x89a5cc&&_0x89a5cc[_0x400f('0x175')]&&_0x89a5cc[_0x400f('0x176')])return _0x89a5cc;else throw{'message':_0x400f('0x177')};})[_0x400f('0x15')](function(){return db[_0x400f('0x3c')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x45a308[_0x400f('0x55')]['id']}});})['then'](respondWithStatusCode(_0x4082a3,0xc8))['catch'](handleError(_0x4082a3,0x193));}else{return _0x4082a3['status'](0x191)['json']({'message':_0x400f('0x174')});}};exports[_0x400f('0x178')]=function(_0x597dcf,_0x5947d0){var _0x12dffb=_0x597dcf[_0x400f('0x30')][_0x400f('0xaf')]({'plain':!![]});if(!_0x12dffb){return _0x5947d0['status'](0x191)[_0x400f('0x129')](_0x400f('0x179'));}else{Promise[_0x400f('0x105')]()['then'](function(){if(_0x597dcf[_0x400f('0x44')][_0x400f('0x45')]!==_0x400f('0x4c'))return;return _0x597dcf[_0x400f('0x30')][_0x400f('0x17a')]();})['then'](function(_0x43d1e8){if(!_0x43d1e8)return;return _0x43d1e8[_0x400f('0xaf')]({'plain':!![]});})['then'](function(_0x4dff03){_0x12dffb[_0x400f('0x45')]=_0x4dff03;return _0x5947d0['status'](0xc8)['json'](_0x12dffb);});}};exports[_0x400f('0x17b')]=function(_0x3853c2,_0x4a22c1){var _0x11dc4c={'offset':0x0},_0x4024cf={'count':0x0,'rows':[]};Promise[_0x400f('0x105')]()[_0x400f('0x15')](function(){if(!_0x3853c2[_0x400f('0x44')][_0x400f('0x33')]&&!_0x3853c2[_0x400f('0x44')][_0x400f('0x17c')]&&!_0x3853c2[_0x400f('0x44')][_0x400f('0x17d')])return[];return Promise[_0x400f('0x105')]()[_0x400f('0x15')](function(){var _0x446461=[];if(!_[_0x400f('0x8f')](_0x3853c2[_0x400f('0x44')][_0x400f('0x17c')])){_0x446461[_0x400f('0x48')](db[_0x400f('0x118')][_0x400f('0x49')]({'attributes':['id',_0x400f('0x37')],'where':{'id':_0x3853c2[_0x400f('0x44')][_0x400f('0x17c')]}}));}if(!_[_0x400f('0x8f')](_0x3853c2[_0x400f('0x44')][_0x400f('0x17d')])){_0x446461['push'](db[_0x400f('0xae')][_0x400f('0x49')]({'attributes':['id',_0x400f('0x37')],'type':_0x400f('0x17e'),'where':{'id':_0x3853c2['query'][_0x400f('0x17d')]}}));}return Promise['all'](_0x446461);})[_0x400f('0x15')](function(_0x38569b){var _0x532c88=_['flatten'](_0x38569b)[_0x400f('0x8d')](function(_0x8326c3){return _0x8326c3[_0x400f('0x127')]({'attributes':['id',_0x400f('0x37'),_0x400f('0x68'),'online'],'raw':!![]});});return Promise['all'](_0x532c88);})[_0x400f('0x15')](function(_0x2d1854){var _0x1a671d=_[_0x400f('0x17f')](_0x2d1854);if(!_0x3853c2[_0x400f('0x44')][_0x400f('0x33')])return _0x1a671d;if(_[_0x400f('0x8f')](_0x1a671d)){return db[_0x400f('0x3c')][_0x400f('0x49')]({'attributes':['id',_0x400f('0x37'),_0x400f('0x68'),_0x400f('0x9f')],'where':{'role':_0x400f('0x2a'),'$or':[db[_0x400f('0x6b')][_0x400f('0xd8')](db[_0x400f('0x6b')]['fn'](_0x400f('0x180'),db[_0x400f('0x6b')]['col'](_0x400f('0x37'))),{'$like':'%'+_0x3853c2[_0x400f('0x44')][_0x400f('0x33')][_0x400f('0xa6')]()+'%'}),{'internal':{'$like':'%'+_0x3853c2[_0x400f('0x44')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x1a671d)[_0x400f('0x17f')]()[_0x400f('0x33')](function(_0x5631a9){return _0x5631a9[_0x400f('0x37')][_0x400f('0xa6')]()[_0x400f('0x36')](_0x3853c2[_0x400f('0x44')]['filter']['toLowerCase']())||_0x5631a9[_0x400f('0x68')][_0x400f('0x181')]()[_0x400f('0x36')](_0x3853c2['query'][_0x400f('0x33')]);})['value']();}})[_0x400f('0x15')](function(_0x734397){var _0x46cd96=_0x400f('0x37');var _0x318625=_0x400f('0x182');if(_0x3853c2[_0x400f('0x44')][_0x400f('0xd7')]){_0x318625=_0x3853c2[_0x400f('0x44')][_0x400f('0xd7')][0x0]==='-'?'desc':'asc';_0x46cd96=_0x318625===_0x400f('0x182')?_0x3853c2[_0x400f('0x44')][_0x400f('0xd7')]:_0x3853c2[_0x400f('0x44')][_0x400f('0xd7')][_0x400f('0x183')](0x1);}return _(_0x734397)['uniqBy']('id')[_0x400f('0x184')]([function(_0x2ad70e){return _0x46cd96===_0x400f('0x37')?_0x2ad70e[_0x46cd96]['toLowerCase']():_0x2ad70e[_0x46cd96];}],[_0x318625])['map'](function(_0x20655a){return _[_0x400f('0xd9')](_0x20655a,['id',_0x400f('0x37'),'internal','online']);})[_0x400f('0x35')]();})[_0x400f('0x15')](function(_0xaa28b2){return amiClient[_0x400f('0x14')]('Agents',_0x3853c2)[_0x400f('0x15')](function(_0x3aedc4){if(_0x3aedc4['error'])throw new Error(_0x400f('0x185'));var _0xe3b9d2=_0x3aedc4[_0x400f('0x1e')];var _0x8b299d=jayson['client'][_0x400f('0x186')]({'port':0x232c});return _0x8b299d[_0x400f('0x14')]('Agents',_0x3853c2)[_0x400f('0x15')](function(_0x58eac5){if(_0x58eac5['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x5b2ec6=_0x58eac5['result'];return _[_0x400f('0xda')]({},_0x5b2ec6,_0xe3b9d2);});})[_0x400f('0x15')](function(_0x2c35f2){return _['map'](_0xaa28b2,function(_0x29eea9){var _0x5b20c0=_['find'](_0x2c35f2[_0x400f('0x4a')],['id',_0x29eea9['id']]);if(!_0x5b20c0||!_0x29eea9[_0x400f('0x9f')]){_0x29eea9['status']='offline';}else if(_0x5b20c0[_0x400f('0xa1')]){_0x29eea9[_0x400f('0x20')]=_0x400f('0x107');}else{_0x29eea9['status']=_[_0x400f('0x36')]([_0x400f('0x187'),_0x400f('0x188'),_0x400f('0x189'),_0x400f('0x18a'),null,undefined],_0x5b20c0['voiceStatus'])?_0x400f('0x9f'):_0x400f('0x18b');}return _0x29eea9;});});});})[_0x400f('0x15')](function(_0x9311c){if(!_0x3853c2[_0x400f('0x44')][_0x400f('0xcf')](_0x400f('0xde'))){_0x11dc4c['limit']=qs[_0x400f('0x23')](_0x3853c2[_0x400f('0x44')][_0x400f('0x23')]||0xa);_0x11dc4c[_0x400f('0x25')]=qs[_0x400f('0x25')](_0x3853c2['query'][_0x400f('0x25')]);}_0x4024cf[_0x400f('0x26')]=_0x9311c[_0x400f('0x5c')];_0x4024cf[_0x400f('0x4a')]=_0x11dc4c['limit']?_0x9311c[_0x400f('0x18c')](_0x11dc4c[_0x400f('0x25')],_0x11dc4c['offset']+_0x11dc4c[_0x400f('0x23')]):_0x9311c;return _0x4024cf;})['then'](respondWithFilteredResult(_0x4a22c1,_0x11dc4c))['catch'](handleError(_0x4a22c1,null));};function get_open_tabs(_0x2f4935,_0x12be24){var _0x125831=_0x2f4935[_0x400f('0x18d')](0x0)[_0x400f('0x18e')]()+_0x2f4935[_0x400f('0x18c')](0x1);var _0xcf3add={'type':db[_0x400f('0x95')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x1399a3,_0x3ea2dc){var _0x27c6a8=squel['select']()[_0x400f('0x18f')](_0x400f('0x190')+_0x125831+'InteractionId','id')['field'](_0x400f('0x191'))[_0x400f('0x6f')]('user_has_'+_0x2f4935+'_interactions','ui')[_0x400f('0xd8')](_0x400f('0x192'),_0x12be24['id']);return db[_0x400f('0x6b')]['query'](_0x27c6a8[_0x400f('0x181')](),_0xcf3add)['then'](function(_0x34191e){_0x12be24[_0x125831+_0x400f('0x193')]=_0x34191e;_0x1399a3(_0x34191e);})[_0x400f('0x53')](function(_0x46c189){_0x3ea2dc(_0x46c189);});});}
\ No newline at end of file
index e246258..f7efb47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30cd=['User','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x48c5e6,_0x28b7b6){var _0x394b94=function(_0x257b5c){while(--_0x257b5c){_0x48c5e6['push'](_0x48c5e6['shift']());}};_0x394b94(++_0x28b7b6);}(_0x30cd,0xdf));var _0xd30c=function(_0x33c369,_0x1a3a98){_0x33c369=_0x33c369-0x0;var _0x3d46be=_0x30cd[_0x33c369];return _0x3d46be;};'use strict';var EventEmitter=require(_0xd30c('0x0'));var User=require(_0xd30c('0x1'))['db'][_0xd30c('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xd30c('0x3')](0x0);var events={'afterCreate':_0xd30c('0x4'),'afterUpdate':_0xd30c('0x5'),'afterDestroy':_0xd30c('0x6')};function emitEvent(_0x5bbe5b){return function(_0x36555c,_0x439bcc,_0x3e0fa0){UserEvents[_0xd30c('0x7')](_0x5bbe5b+':'+_0x36555c['id'],_0x36555c);UserEvents[_0xd30c('0x7')](_0x5bbe5b,_0x36555c);_0x3e0fa0(null);};}for(var e in events){if(events[_0xd30c('0x8')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
+var _0xd554=['../../mysqldb','User','setMaxListeners','save','remove','emit','hook','events'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xd554,0xcf));var _0x4d55=function(_0x36c541,_0x178c6e){_0x36c541=_0x36c541-0x0;var _0x4c05a1=_0xd554[_0x36c541];return _0x4c05a1;};'use strict';var EventEmitter=require(_0x4d55('0x0'));var User=require(_0x4d55('0x1'))['db'][_0x4d55('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x4d55('0x3')](0x0);var events={'afterCreate':_0x4d55('0x4'),'afterUpdate':'update','afterDestroy':_0x4d55('0x5')};function emitEvent(_0x281245){return function(_0x224876,_0x503cc4,_0x286133){UserEvents[_0x4d55('0x6')](_0x281245+':'+_0x224876['id'],_0x224876);UserEvents['emit'](_0x281245,_0x224876);_0x286133(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x4d55('0x7')](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
index 2d4cb7d..3ce2091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8832=['define','users','utf8','utf8_bin','userProfileId','undefined','UserProfile','privacyEnabled','updateMd5Password','updatePassword','resolve','changed','password','userSetting','createUserSetting','error','bulkCreate','destroy','VoiceExtension','encryptPassword','Missing\x20Callback','randomBytes','base64','salt','from','pbkdf2Sync','sha1','toString','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','client','http','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','voice','manual','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','message','UserVoiceQueueRt','update','findAll','findOne','PAUSE','channel','MemberReport','isArray','map','YYYY-MM-DD\x20HH:mm:ss','all','voicePause','mailPause','chatPause','smsPause','whatsappPause','openchannelPause','Pause','../../config/utils','getChannels','forEach','Status','setDataValue','bluebird','crypto','moment','lodash','jayson/promise','google','length','from-sip','system','format','%s%s','merge','chanspy','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','record','StopMixMonitor','wav','WAV','context','CDR(type)=internal','extensionMonitor','includes','Set','Dial','SIP/%s,,tTxX','Hangup','priority','then','internal','concat','catch','exports'];(function(_0x6c0b0a,_0x496391){var _0x5f456a=function(_0x5ae918){while(--_0x5ae918){_0x6c0b0a['push'](_0x6c0b0a['shift']());}};_0x5f456a(++_0x496391);}(_0x8832,0x1f4));var _0x2883=function(_0x352464,_0x20e26d){_0x352464=_0x352464-0x0;var _0x3d6574=_0x8832[_0x352464];return _0x3d6574;};'use strict';var BPromise=require(_0x2883('0x0'));var crypto=require(_0x2883('0x1'));var util=require('util');var md5=require('md5');var moment=require(_0x2883('0x2'));var _=require(_0x2883('0x3'));var jayson=require(_0x2883('0x4'));var attributes=require('./user.attributes');var authTypes=[_0x2883('0x5')];var validatePresenceOf=function(_0x5f5738){return _0x5f5738&&_0x5f5738[_0x2883('0x6')];};var getChanSpyApplications=function(_0x119754,_0x278026,_0x556903){var _0x44fef8={'context':_0x119754['context']||_0x2883('0x7'),'type':_0x2883('0x8'),'isApp':![],'UserId':_0x119754['id']};var _0x4f6237=[];for(var _0x519679=0x0,_0x34a8c5=0x1;_0x519679<_0x556903[_0x2883('0x6')];_0x519679++,_0x34a8c5=0x1){var _0x467978={'exten':util[_0x2883('0x9')](_0x2883('0xa'),_0x556903[_0x519679]['prefix'],_0x278026),'ChanSpyId':_0x556903[_0x519679]['id']};_0x4f6237['push'](_[_0x2883('0xb')]({'app':'Set','appdata':util['format']('CDR(type)=%s',_0x2883('0xc')),'priority':_0x34a8c5++},_0x44fef8,_0x467978));if(_0x556903[_0x519679]['record']){_0x4f6237[_0x2883('0xd')](_[_0x2883('0xb')]({'app':_0x2883('0xe'),'appdata':util[_0x2883('0x9')](_0x2883('0xf'),_0x556903[_0x519679][_0x2883('0x10')]),'priority':_0x34a8c5++},_0x44fef8,_0x467978));}if(_0x556903[_0x519679]['auth']){_0x4f6237['push'](_[_0x2883('0xb')]({'app':_0x2883('0x11'),'appdata':_0x556903[_0x519679]['password'],'priority':_0x34a8c5++},_0x44fef8,_0x467978));}_0x4f6237[_0x2883('0xd')](_[_0x2883('0xb')]({'app':_0x2883('0x12'),'appdata':util[_0x2883('0x9')](_0x2883('0x13'),_0x119754[_0x2883('0x14')],_0x556903[_0x519679][_0x2883('0x15')]?_0x556903[_0x519679][_0x2883('0x15')]['join'](''):''),'priority':_0x34a8c5++},_0x44fef8,_0x467978));if(_0x556903[_0x519679][_0x2883('0x16')]){_0x4f6237[_0x2883('0xd')](_[_0x2883('0xb')]({'app':_0x2883('0x17'),'priority':_0x34a8c5++},_0x44fef8,_0x467978));}}return _0x4f6237;};var getUserApplications=function(_0x65a4bc,_0x2632eb){var _0x3a4002=[_0x2883('0x18'),_0x2883('0x19'),'gsm'];var _0x477e40={'context':_0x65a4bc[_0x2883('0x1a')]||_0x2883('0x7'),'exten':_0x2632eb,'type':'system','isApp':![],'UserId':_0x65a4bc['id']};var _0x270237=[{'app':'Set','appdata':_0x2883('0x1b')}];if(_0x65a4bc[_0x2883('0x1c')]&&_[_0x2883('0x1d')](_0x3a4002,_0x65a4bc['extensionMonitor'])){_0x270237[_0x2883('0xd')]({'app':_0x2883('0x1e'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x270237[_0x2883('0xd')]({'app':'Set','appdata':util[_0x2883('0x9')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x65a4bc['extensionMonitor'])});_0x270237['push']({'app':_0x2883('0x1f'),'appdata':util['format']('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x65a4bc[_0x2883('0x14')])});}else{_0x270237['push']({'app':_0x2883('0x1f'),'appdata':util[_0x2883('0x9')](_0x2883('0x20'),_0x65a4bc[_0x2883('0x14')])});}_0x270237[_0x2883('0xd')]({'app':_0x2883('0x21')});for(var _0x53db6f=0x0;_0x53db6f<_0x270237[_0x2883('0x6')];_0x53db6f++){_0x270237[_0x53db6f][_0x2883('0x22')]=_0x53db6f+0x1;_0x270237[_0x53db6f]=_['defaults'](_0x270237[_0x53db6f],_0x477e40);}return _0x270237;};var getChanSpyPromise=function(_0x21cd3d,_0x1a2971){return new BPromise(function(_0x2934d6,_0x405c02){return _0x21cd3d['VoiceChanSpy']['findAll']()[_0x2883('0x23')](function(_0x4e091c){if(_0x4e091c){var _0x32ef20=getChanSpyApplications(_0x1a2971,_0x1a2971[_0x2883('0x24')],_0x4e091c);if(_0x1a2971[_0x2883('0x24')]!=_0x1a2971['name']){_0x32ef20=_0x32ef20[_0x2883('0x25')](getChanSpyApplications(_0x1a2971,_0x1a2971[_0x2883('0x14')],_0x4e091c));}return _0x2934d6(_0x32ef20);}return _0x2934d6([]);})[_0x2883('0x26')](function(_0x4cd054){_0x405c02(_0x4cd054);});});};module[_0x2883('0x27')]=function(_0x1018fe){var _0x215e0a=_0x1018fe['models'];return _0x1018fe[_0x2883('0x28')]('User',attributes,{'tableName':_0x2883('0x29'),'charset':_0x2883('0x2a'),'collate':_0x2883('0x2b'),'hooks':{'beforeCreate':function(_0xa403bd,_0x214d2e,_0x5a0647){var _0x411e45=typeof _0xa403bd[_0x2883('0x2c')]===_0x2883('0x2d')?BPromise['resolve'](null):_0x215e0a[_0x2883('0x2e')]['find']({'where':{'id':_0xa403bd[_0x2883('0x2c')]}});_0x411e45[_0x2883('0x23')](function(_0x3c897a){if(_0x3c897a){_0xa403bd[_0x2883('0x2f')]=_0x3c897a['privacyEnabled'];}})[_0x2883('0x23')](function(){_0xa403bd[_0x2883('0x30')]();_0xa403bd[_0x2883('0x31')](_0x5a0647);})[_0x2883('0x26')](function(_0x41da47){_0x5a0647(_0x41da47);});},'beforeUpdate':function(_0x5650e4,_0x1a8f99,_0x40876a){Promise[_0x2883('0x32')]()[_0x2883('0x23')](function(){if(_0x5650e4[_0x2883('0x33')](_0x2883('0x2c'))===![])return;return _0x215e0a[_0x2883('0x2e')]['find']({'where':{'id':_0x5650e4[_0x2883('0x2c')]}})[_0x2883('0x23')](function(_0x267673){if(_0x267673)_0x5650e4['privacyEnabled']=_0x267673[_0x2883('0x2f')];return;});})[_0x2883('0x23')](function(){if(_0x5650e4[_0x2883('0x33')](_0x2883('0x34'))){_0x5650e4[_0x2883('0x30')]();return _0x5650e4[_0x2883('0x31')](_0x40876a);}_0x40876a();})[_0x2883('0x26')](function(_0x9b62fb){_0x40876a(_0x9b62fb);});},'afterCreate':function(_0x47d543,_0x47b998,_0x2e58c6){var _0x425852=getUserApplications(_0x47d543,_0x47d543['internal']);if(_0x47d543[_0x2883('0x24')]!=_0x47d543['name']){_0x425852=_0x425852['concat'](getUserApplications(_0x47d543,_0x47d543[_0x2883('0x14')]));}return Promise[_0x2883('0x32')]()[_0x2883('0x23')](function(){if(!_0x47d543[_0x2883('0x35')]){return _0x47d543[_0x2883('0x36')]({'clientSideLoggingLevel':_0x2883('0x37'),'clientSideLoggingEnabled':![]});}})['then'](function(){return _0x215e0a['VoiceExtension'][_0x2883('0x38')](_0x425852);})[_0x2883('0x23')](function(){if(_0x47d543[_0x2883('0xc')]){return getChanSpyPromise(_0x215e0a,_0x47d543);}})[_0x2883('0x23')](function(_0x53c581){if(_0x53c581&&_0x53c581[_0x2883('0x6')]){return _0x215e0a['VoiceExtension']['bulkCreate'](_0x53c581);}})[_0x2883('0x23')](function(){_0x2e58c6();})[_0x2883('0x26')](function(_0x52ae39){_0x2e58c6(_0x52ae39);});},'afterUpdate':function(_0x12ec92,_0x165d85,_0x27c0bd){return BPromise[_0x2883('0x32')]()[_0x2883('0x23')](function(){if(_0x12ec92['changed'](_0x2883('0xc'))||_0x12ec92['changed'](_0x2883('0x1a'))){return _0x215e0a['VoiceExtension'][_0x2883('0x39')]({'where':{'UserId':_0x12ec92['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0x2883('0x23')](function(){if(_0x12ec92[_0x2883('0xc')]){return getChanSpyPromise(_0x215e0a,_0x12ec92)['then'](function(_0x4fd083){if(_0x4fd083&&_0x4fd083['length']){return _0x215e0a['VoiceExtension'][_0x2883('0x38')](_0x4fd083);}});}});}})[_0x2883('0x23')](function(){if(_0x12ec92['changed']('extensionMonitor')||_0x12ec92['changed'](_0x2883('0x1a'))){return _0x215e0a['VoiceExtension'][_0x2883('0x39')]({'where':{'UserId':_0x12ec92['id'],'type':'system','ChanSpyId':null}})[_0x2883('0x23')](function(){var _0x37f9be=getUserApplications(_0x12ec92,_0x12ec92[_0x2883('0x24')]);if(_0x12ec92[_0x2883('0x24')]!=_0x12ec92['name']){_0x37f9be=_0x37f9be['concat'](getUserApplications(_0x12ec92,_0x12ec92['name']));}return _0x215e0a[_0x2883('0x3a')][_0x2883('0x38')](_0x37f9be);});}})[_0x2883('0x23')](function(){_0x27c0bd();})['catch'](function(_0x33bf8a){_0x27c0bd(_0x33bf8a);});},'afterDestroy':function(_0x258e70){return _0x215e0a[_0x2883('0x3a')][_0x2883('0x39')]({'where':{'UserId':_0x258e70['id'],'type':_0x2883('0x8')}});}},'instanceMethods':{'authenticate':function(_0xc2a4af,_0x513105){if(!_0x513105){return this[_0x2883('0x34')]===this['encryptPassword'](_0xc2a4af);}var _0xc6a638=this;this[_0x2883('0x3b')](_0xc2a4af,function(_0x69208e,_0x38891d){if(_0x69208e){_0x513105(_0x69208e);}if(_0xc6a638[_0x2883('0x34')]===_0x38891d){_0x513105(null,!![]);}else{_0x513105(null,![]);}});},'makeSalt':function(_0x3bc0d5,_0x2b0917){var _0x283abe=0x10;if(typeof arguments[0x0]==='function'){_0x2b0917=arguments[0x0];_0x3bc0d5=_0x283abe;}else if(typeof arguments[0x1]==='function'){_0x2b0917=arguments[0x1];}else{throw new Error(_0x2883('0x3c'));}if(!_0x3bc0d5){_0x3bc0d5=_0x283abe;}return crypto[_0x2883('0x3d')](_0x3bc0d5,function(_0x51edbf,_0x4eec31){if(_0x51edbf){_0x2b0917(_0x51edbf);}return _0x2b0917(null,_0x4eec31['toString'](_0x2883('0x3e')));});},'encryptPassword':function(_0x51874b,_0x4d18e3){if(!_0x51874b||!this[_0x2883('0x3f')]){return _0x4d18e3?_0x4d18e3(null):null;}var _0x30708c=0x2710;var _0x4f7161=0x40;var _0x54da49=Buffer[_0x2883('0x40')](this['salt'],_0x2883('0x3e'));if(!_0x4d18e3){return crypto[_0x2883('0x41')](_0x51874b,_0x54da49,_0x30708c,_0x4f7161,_0x2883('0x42'))[_0x2883('0x43')]('base64');}return crypto['pbkdf2'](_0x51874b,_0x54da49,_0x30708c,_0x4f7161,_0x2883('0x42'),function(_0x5d88ed,_0x16b004){if(_0x5d88ed){_0x4d18e3(_0x5d88ed);}return _0x4d18e3(null,_0x16b004[_0x2883('0x43')](_0x2883('0x3e')));});},'updatePassword':function(_0x1609ff){if(!this[_0x2883('0x34')]){return _0x1609ff(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0x2883('0x44')](this[_0x2883('0x45')])===-0x1){_0x1609ff(new Error(_0x2883('0x46')));}var _0x21c200=this;this[_0x2883('0x47')](function(_0xed96b7,_0x42c19a){if(_0xed96b7){return _0x1609ff(_0xed96b7);}_0x21c200['salt']=_0x42c19a;_0x21c200['encryptPassword'](_0x21c200['password'],function(_0x38d009,_0x4ad148){if(_0x38d009){_0x1609ff(_0x38d009);}_0x21c200['password']=_0x4ad148;_0x1609ff(null);});});},'updateMd5Password':function(){this[_0x2883('0x48')]=md5(this[_0x2883('0x14')]+_0x2883('0x49')+this[_0x2883('0x34')]);return this[_0x2883('0x48')];},'getRealtimeData':function(){var _0x197d2={'id':this['id']};var _0x449283=jayson[_0x2883('0x4a')][_0x2883('0x4b')]({'port':0x232a});var _0xb53df8=jayson[_0x2883('0x4a')][_0x2883('0x4b')]({'port':0x232c});var _0x200855={};var _0x48b9dc={};return _0x449283[_0x2883('0x4c')](_0x2883('0x4d'),_0x197d2)[_0x2883('0x23')](function(_0x41c298){if(_0x41c298[_0x2883('0x37')]){throw new Error(_0x2883('0x4e'));}_0x200855=_0x41c298['result'];return _0xb53df8[_0x2883('0x4c')](_0x2883('0x4d'),_0x197d2);})[_0x2883('0x23')](function(_0x10f7a){if(_0x10f7a[_0x2883('0x37')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)');}_0x48b9dc=_0x10f7a[_0x2883('0x4f')];var _0x4e5fb4=_['merge']({},_0x200855,_0x48b9dc);return _0x4e5fb4;})[_0x2883('0x26')](function(_0x5411f7){throw _0x5411f7;});},'unpause':function(_0x1846af,_0x27d84e='manual'){var _0x2721f9=this;var _0x3dde56={};return Promise[_0x2883('0x32')]()[_0x2883('0x23')](function(){if(!_0x1846af||_0x1846af===_0x2883('0x50')&&_0x27d84e===_0x2883('0x51')){var _0x394966=jayson[_0x2883('0x4a')][_0x2883('0x4b')]({'port':0x232a});return _0x394966['request'](_0x2883('0x52'),{'id':_0x2721f9['id'],'name':_0x2721f9['name'],'pause':![]})[_0x2883('0x23')](function(_0x214c4c){if(_0x214c4c['error']){throw new Error(util[_0x2883('0x9')](_0x2883('0x53'),_0x2721f9['id'],_0x2721f9[_0x2883('0x14')]));}return _0x214c4c[_0x2883('0x4f')][_0x2883('0x54')];});}})[_0x2883('0x23')](function(){if(!_0x1846af||_0x1846af===_0x2883('0x50')){return _0x215e0a[_0x2883('0x55')][_0x2883('0x56')]({'paused':0x0},{'where':{'UserId':_0x2721f9['id']},'individualHooks':!![]});}})[_0x2883('0x23')](function(){var _0x260649=!_0x1846af?_0x2883('0x57'):_0x2883('0x58');var _0x4990b7={'membername':_0x2721f9[_0x2883('0x14')],'type':_0x2883('0x59'),'exitAt':null};if(_0x1846af){_0x4990b7[_0x2883('0x5a')]=_0x1846af;}return _0x215e0a[_0x2883('0x5b')][_0x260649]({'where':_0x4990b7});})[_0x2883('0x23')](function(_0x2e5658){if(_0x2e5658){var _0x52a5a8=Array[_0x2883('0x5c')](_0x2e5658)?_0x2e5658:[_0x2e5658];var _0x218919=_0x52a5a8[_0x2883('0x5d')](function(_0x303220){return _0x303220[_0x2883('0x56')]({'exitAt':moment()[_0x2883('0x9')](_0x2883('0x5e')),'data2':_0x27d84e});});return Promise[_0x2883('0x5f')](_0x218919);}})[_0x2883('0x23')](function(){if(!_0x1846af){_0x3dde56[_0x2883('0x60')]=![];_0x3dde56[_0x2883('0x61')]=![];_0x3dde56[_0x2883('0x62')]=![];_0x3dde56['faxPause']=![];_0x3dde56[_0x2883('0x63')]=![];_0x3dde56[_0x2883('0x64')]=![];_0x3dde56[_0x2883('0x65')]=![];}else{_0x3dde56[_0x1846af+_0x2883('0x66')]=![];}return _0x2721f9['getRealtimeData']();})[_0x2883('0x23')](function(_0x49e6cc){var _0x3a385d=require(_0x2883('0x67'));var _0x267725=_0x3a385d[_0x2883('0x68')]();_0x267725[_0x2883('0x69')](function(_0x1ee07c){var _0x57c56b=_0x1ee07c+_0x2883('0x6a');_0x2721f9[_0x2883('0x6b')]([_0x57c56b],_0x49e6cc[_0x57c56b]);});return _0x2721f9[_0x2883('0x56')](_0x3dde56);})[_0x2883('0x26')](function(_0x3eaf35){throw _0x3eaf35;});}}});};
\ No newline at end of file
+var _0xf53f=['md5secret','client','http','Agents','error','request','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)','voice','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','result','message','update','findOne','PAUSE','channel','MemberReport','isArray','map','YYYY-MM-DD\x20HH:mm:ss','all','voicePause','chatPause','faxPause','whatsappPause','openchannelPause','Pause','getRealtimeData','../../config/utils','forEach','setDataValue','bluebird','crypto','util','md5','moment','lodash','jayson/promise','./user.attributes','google','length','from-sip','system','format','%s%s','push','merge','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','options','join','record','StopMixMonitor','WAV','gsm','context','Set','CDR(type)=internal','includes','extensionMonitor','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','models','define','User','users','utf8_bin','userProfileId','undefined','resolve','find','privacyEnabled','updateMd5Password','updatePassword','changed','UserProfile','userSetting','createUserSetting','VoiceExtension','bulkCreate','destroy','encryptPassword','function','randomBytes','toString','base64','salt','from','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt'];(function(_0x1477de,_0x43889c){var _0x1a54a3=function(_0xf76de2){while(--_0xf76de2){_0x1477de['push'](_0x1477de['shift']());}};_0x1a54a3(++_0x43889c);}(_0xf53f,0x8d));var _0xff53=function(_0x4412a6,_0x3e74b7){_0x4412a6=_0x4412a6-0x0;var _0x5d6d08=_0xf53f[_0x4412a6];return _0x5d6d08;};'use strict';var BPromise=require(_0xff53('0x0'));var crypto=require(_0xff53('0x1'));var util=require(_0xff53('0x2'));var md5=require(_0xff53('0x3'));var moment=require(_0xff53('0x4'));var _=require(_0xff53('0x5'));var jayson=require(_0xff53('0x6'));var attributes=require(_0xff53('0x7'));var authTypes=[_0xff53('0x8')];var validatePresenceOf=function(_0x2077b9){return _0x2077b9&&_0x2077b9[_0xff53('0x9')];};var getChanSpyApplications=function(_0x495edc,_0x54d39c,_0x54e637){var _0x27b397={'context':_0x495edc['context']||_0xff53('0xa'),'type':_0xff53('0xb'),'isApp':![],'UserId':_0x495edc['id']};var _0x1bc4b3=[];for(var _0x5d149e=0x0,_0x51445a=0x1;_0x5d149e<_0x54e637[_0xff53('0x9')];_0x5d149e++,_0x51445a=0x1){var _0x538827={'exten':util[_0xff53('0xc')](_0xff53('0xd'),_0x54e637[_0x5d149e]['prefix'],_0x54d39c),'ChanSpyId':_0x54e637[_0x5d149e]['id']};_0x1bc4b3[_0xff53('0xe')](_[_0xff53('0xf')]({'app':'Set','appdata':util[_0xff53('0xc')](_0xff53('0x10'),_0xff53('0x11')),'priority':_0x51445a++},_0x27b397,_0x538827));if(_0x54e637[_0x5d149e]['record']){_0x1bc4b3[_0xff53('0xe')](_[_0xff53('0xf')]({'app':_0xff53('0x12'),'appdata':util['format'](_0xff53('0x13'),_0x54e637[_0x5d149e][_0xff53('0x14')]),'priority':_0x51445a++},_0x27b397,_0x538827));}if(_0x54e637[_0x5d149e]['auth']){_0x1bc4b3['push'](_['merge']({'app':'Authenticate','appdata':_0x54e637[_0x5d149e][_0xff53('0x15')],'priority':_0x51445a++},_0x27b397,_0x538827));}_0x1bc4b3[_0xff53('0xe')](_[_0xff53('0xf')]({'app':'ChanSpy','appdata':util[_0xff53('0xc')]('SIP/%s,%s',_0x495edc['name'],_0x54e637[_0x5d149e][_0xff53('0x16')]?_0x54e637[_0x5d149e][_0xff53('0x16')][_0xff53('0x17')](''):''),'priority':_0x51445a++},_0x27b397,_0x538827));if(_0x54e637[_0x5d149e][_0xff53('0x18')]){_0x1bc4b3[_0xff53('0xe')](_[_0xff53('0xf')]({'app':_0xff53('0x19'),'priority':_0x51445a++},_0x27b397,_0x538827));}}return _0x1bc4b3;};var getUserApplications=function(_0x5e9ba6,_0x4d2b1f){var _0x3b30dd=['wav',_0xff53('0x1a'),_0xff53('0x1b')];var _0x377132={'context':_0x5e9ba6[_0xff53('0x1c')]||_0xff53('0xa'),'exten':_0x4d2b1f,'type':_0xff53('0xb'),'isApp':![],'UserId':_0x5e9ba6['id']};var _0x37243f=[{'app':_0xff53('0x1d'),'appdata':_0xff53('0x1e')}];if(_0x5e9ba6['extensionMonitor']&&_[_0xff53('0x1f')](_0x3b30dd,_0x5e9ba6['extensionMonitor'])){_0x37243f['push']({'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x37243f[_0xff53('0xe')]({'app':_0xff53('0x1d'),'appdata':util['format']('_XCALLY_MIXMONITOR_FORMAT=%s',_0x5e9ba6[_0xff53('0x20')])});_0x37243f[_0xff53('0xe')]({'app':_0xff53('0x21'),'appdata':util[_0xff53('0xc')](_0xff53('0x22'),_0x5e9ba6[_0xff53('0x23')])});}else{_0x37243f['push']({'app':_0xff53('0x21'),'appdata':util['format'](_0xff53('0x24'),_0x5e9ba6[_0xff53('0x23')])});}_0x37243f[_0xff53('0xe')]({'app':_0xff53('0x25')});for(var _0x1b7a35=0x0;_0x1b7a35<_0x37243f[_0xff53('0x9')];_0x1b7a35++){_0x37243f[_0x1b7a35][_0xff53('0x26')]=_0x1b7a35+0x1;_0x37243f[_0x1b7a35]=_[_0xff53('0x27')](_0x37243f[_0x1b7a35],_0x377132);}return _0x37243f;};var getChanSpyPromise=function(_0x5cba62,_0xe9031f){return new BPromise(function(_0x579164,_0x4b202b){return _0x5cba62[_0xff53('0x28')][_0xff53('0x29')]()[_0xff53('0x2a')](function(_0x314d8e){if(_0x314d8e){var _0xb7a7a6=getChanSpyApplications(_0xe9031f,_0xe9031f['internal'],_0x314d8e);if(_0xe9031f[_0xff53('0x2b')]!=_0xe9031f['name']){_0xb7a7a6=_0xb7a7a6[_0xff53('0x2c')](getChanSpyApplications(_0xe9031f,_0xe9031f[_0xff53('0x23')],_0x314d8e));}return _0x579164(_0xb7a7a6);}return _0x579164([]);})[_0xff53('0x2d')](function(_0x527ab2){_0x4b202b(_0x527ab2);});});};module['exports']=function(_0x44170f){var _0x27d979=_0x44170f[_0xff53('0x2e')];return _0x44170f[_0xff53('0x2f')](_0xff53('0x30'),attributes,{'tableName':_0xff53('0x31'),'charset':'utf8','collate':_0xff53('0x32'),'hooks':{'beforeCreate':function(_0x560623,_0x1c67c6,_0x52a169){var _0x2a4d2e=typeof _0x560623[_0xff53('0x33')]===_0xff53('0x34')?BPromise[_0xff53('0x35')](null):_0x27d979['UserProfile'][_0xff53('0x36')]({'where':{'id':_0x560623[_0xff53('0x33')]}});_0x2a4d2e[_0xff53('0x2a')](function(_0xad08ab){if(_0xad08ab){_0x560623[_0xff53('0x37')]=_0xad08ab[_0xff53('0x37')];}})[_0xff53('0x2a')](function(){_0x560623[_0xff53('0x38')]();_0x560623[_0xff53('0x39')](_0x52a169);})[_0xff53('0x2d')](function(_0x1c9e86){_0x52a169(_0x1c9e86);});},'beforeUpdate':function(_0x16bfbe,_0x4ae108,_0x154c00){Promise[_0xff53('0x35')]()[_0xff53('0x2a')](function(){if(_0x16bfbe[_0xff53('0x3a')](_0xff53('0x33'))===![])return;return _0x27d979[_0xff53('0x3b')][_0xff53('0x36')]({'where':{'id':_0x16bfbe[_0xff53('0x33')]}})[_0xff53('0x2a')](function(_0x59847d){if(_0x59847d)_0x16bfbe['privacyEnabled']=_0x59847d[_0xff53('0x37')];return;});})[_0xff53('0x2a')](function(){if(_0x16bfbe[_0xff53('0x3a')]('password')){_0x16bfbe['updateMd5Password']();return _0x16bfbe[_0xff53('0x39')](_0x154c00);}_0x154c00();})[_0xff53('0x2d')](function(_0x535d29){_0x154c00(_0x535d29);});},'afterCreate':function(_0x39f6d0,_0x25e94b,_0x34607b){var _0x3be40b=getUserApplications(_0x39f6d0,_0x39f6d0['internal']);if(_0x39f6d0[_0xff53('0x2b')]!=_0x39f6d0['name']){_0x3be40b=_0x3be40b[_0xff53('0x2c')](getUserApplications(_0x39f6d0,_0x39f6d0[_0xff53('0x23')]));}return Promise[_0xff53('0x35')]()[_0xff53('0x2a')](function(){if(!_0x39f6d0[_0xff53('0x3c')]){return _0x39f6d0[_0xff53('0x3d')]({'clientSideLoggingLevel':'error','clientSideLoggingEnabled':![]});}})[_0xff53('0x2a')](function(){return _0x27d979['VoiceExtension']['bulkCreate'](_0x3be40b);})['then'](function(){if(_0x39f6d0['chanspy']){return getChanSpyPromise(_0x27d979,_0x39f6d0);}})[_0xff53('0x2a')](function(_0x220091){if(_0x220091&&_0x220091[_0xff53('0x9')]){return _0x27d979[_0xff53('0x3e')][_0xff53('0x3f')](_0x220091);}})['then'](function(){_0x34607b();})[_0xff53('0x2d')](function(_0x1c9814){_0x34607b(_0x1c9814);});},'afterUpdate':function(_0x57a84b,_0x52f278,_0xfb339f){return BPromise[_0xff53('0x35')]()[_0xff53('0x2a')](function(){if(_0x57a84b['changed'](_0xff53('0x11'))||_0x57a84b['changed'](_0xff53('0x1c'))){return _0x27d979[_0xff53('0x3e')]['destroy']({'where':{'UserId':_0x57a84b['id'],'type':'system','ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x57a84b[_0xff53('0x11')]){return getChanSpyPromise(_0x27d979,_0x57a84b)[_0xff53('0x2a')](function(_0x3fb3df){if(_0x3fb3df&&_0x3fb3df[_0xff53('0x9')]){return _0x27d979[_0xff53('0x3e')]['bulkCreate'](_0x3fb3df);}});}});}})[_0xff53('0x2a')](function(){if(_0x57a84b[_0xff53('0x3a')](_0xff53('0x20'))||_0x57a84b[_0xff53('0x3a')](_0xff53('0x1c'))){return _0x27d979[_0xff53('0x3e')]['destroy']({'where':{'UserId':_0x57a84b['id'],'type':_0xff53('0xb'),'ChanSpyId':null}})[_0xff53('0x2a')](function(){var _0x42e7b7=getUserApplications(_0x57a84b,_0x57a84b[_0xff53('0x2b')]);if(_0x57a84b[_0xff53('0x2b')]!=_0x57a84b[_0xff53('0x23')]){_0x42e7b7=_0x42e7b7[_0xff53('0x2c')](getUserApplications(_0x57a84b,_0x57a84b[_0xff53('0x23')]));}return _0x27d979[_0xff53('0x3e')][_0xff53('0x3f')](_0x42e7b7);});}})[_0xff53('0x2a')](function(){_0xfb339f();})['catch'](function(_0x5a56ea){_0xfb339f(_0x5a56ea);});},'afterDestroy':function(_0x29ac55){return _0x27d979['VoiceExtension'][_0xff53('0x40')]({'where':{'UserId':_0x29ac55['id'],'type':_0xff53('0xb')}});}},'instanceMethods':{'authenticate':function(_0x11666f,_0x49d2f9){if(!_0x49d2f9){return this[_0xff53('0x15')]===this['encryptPassword'](_0x11666f);}var _0x2ded5c=this;this[_0xff53('0x41')](_0x11666f,function(_0x1a0d1f,_0x242969){if(_0x1a0d1f){_0x49d2f9(_0x1a0d1f);}if(_0x2ded5c[_0xff53('0x15')]===_0x242969){_0x49d2f9(null,!![]);}else{_0x49d2f9(null,![]);}});},'makeSalt':function(_0x3e7ab3,_0xefbae8){var _0x55485a=0x10;if(typeof arguments[0x0]===_0xff53('0x42')){_0xefbae8=arguments[0x0];_0x3e7ab3=_0x55485a;}else if(typeof arguments[0x1]===_0xff53('0x42')){_0xefbae8=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x3e7ab3){_0x3e7ab3=_0x55485a;}return crypto[_0xff53('0x43')](_0x3e7ab3,function(_0x17281c,_0x4254a5){if(_0x17281c){_0xefbae8(_0x17281c);}return _0xefbae8(null,_0x4254a5[_0xff53('0x44')](_0xff53('0x45')));});},'encryptPassword':function(_0x19ea66,_0x2b87a0){if(!_0x19ea66||!this[_0xff53('0x46')]){return _0x2b87a0?_0x2b87a0(null):null;}var _0x3fcaf8=0x2710;var _0x53b77f=0x40;var _0x390077=Buffer[_0xff53('0x47')](this[_0xff53('0x46')],_0xff53('0x45'));if(!_0x2b87a0){return crypto[_0xff53('0x48')](_0x19ea66,_0x390077,_0x3fcaf8,_0x53b77f,_0xff53('0x49'))[_0xff53('0x44')](_0xff53('0x45'));}return crypto[_0xff53('0x4a')](_0x19ea66,_0x390077,_0x3fcaf8,_0x53b77f,_0xff53('0x49'),function(_0x190057,_0x148099){if(_0x190057){_0x2b87a0(_0x190057);}return _0x2b87a0(null,_0x148099[_0xff53('0x44')](_0xff53('0x45')));});},'updatePassword':function(_0x521e24){if(!this[_0xff53('0x15')]){return _0x521e24(null);}if(!validatePresenceOf(this[_0xff53('0x15')])&&authTypes[_0xff53('0x4b')](this[_0xff53('0x4c')])===-0x1){_0x521e24(new Error(_0xff53('0x4d')));}var _0x31d6a4=this;this[_0xff53('0x4e')](function(_0x4d3825,_0x3fcbd1){if(_0x4d3825){return _0x521e24(_0x4d3825);}_0x31d6a4[_0xff53('0x46')]=_0x3fcbd1;_0x31d6a4[_0xff53('0x41')](_0x31d6a4[_0xff53('0x15')],function(_0x62ebc1,_0xcf1894){if(_0x62ebc1){_0x521e24(_0x62ebc1);}_0x31d6a4[_0xff53('0x15')]=_0xcf1894;_0x521e24(null);});});},'updateMd5Password':function(){this[_0xff53('0x4f')]=md5(this['name']+':asterisk:'+this['password']);return this['md5secret'];},'getRealtimeData':function(){var _0x5ee9e1={'id':this['id']};var _0x3c3695=jayson[_0xff53('0x50')][_0xff53('0x51')]({'port':0x232a});var _0x21e3f5=jayson[_0xff53('0x50')][_0xff53('0x51')]({'port':0x232c});var _0x28704c={};var _0x2019b8={};return _0x3c3695['request'](_0xff53('0x52'),_0x5ee9e1)['then'](function(_0x46484b){if(_0x46484b[_0xff53('0x53')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)');}_0x28704c=_0x46484b['result'];return _0x21e3f5[_0xff53('0x54')](_0xff53('0x52'),_0x5ee9e1);})[_0xff53('0x2a')](function(_0x17b943){if(_0x17b943[_0xff53('0x53')]){throw new Error(_0xff53('0x55'));}_0x2019b8=_0x17b943['result'];var _0x29a55b=_[_0xff53('0xf')]({},_0x28704c,_0x2019b8);return _0x29a55b;})[_0xff53('0x2d')](function(_0x4ed1a7){throw _0x4ed1a7;});},'unpause':function(_0xdc1fd9,_0x5943c6='manual'){var _0x3d48e9=this;var _0x2f5f40={};return Promise[_0xff53('0x35')]()[_0xff53('0x2a')](function(){if(!_0xdc1fd9||_0xdc1fd9===_0xff53('0x56')&&_0x5943c6==='manual'){var _0x4747f7=jayson[_0xff53('0x50')][_0xff53('0x51')]({'port':0x232a});return _0x4747f7[_0xff53('0x54')](_0xff53('0x57'),{'id':_0x3d48e9['id'],'name':_0x3d48e9['name'],'pause':![]})[_0xff53('0x2a')](function(_0x3d895a){if(_0x3d895a['error']){throw new Error(util[_0xff53('0xc')](_0xff53('0x58'),_0x3d48e9['id'],_0x3d48e9['name']));}return _0x3d895a[_0xff53('0x59')][_0xff53('0x5a')];});}})[_0xff53('0x2a')](function(){if(!_0xdc1fd9||_0xdc1fd9==='voice'){return _0x27d979['UserVoiceQueueRt'][_0xff53('0x5b')]({'paused':0x0},{'where':{'UserId':_0x3d48e9['id']},'individualHooks':!![]});}})[_0xff53('0x2a')](function(){var _0x1e1b29=!_0xdc1fd9?_0xff53('0x29'):_0xff53('0x5c');var _0x52a023={'membername':_0x3d48e9[_0xff53('0x23')],'type':_0xff53('0x5d'),'exitAt':null};if(_0xdc1fd9){_0x52a023[_0xff53('0x5e')]=_0xdc1fd9;}return _0x27d979[_0xff53('0x5f')][_0x1e1b29]({'where':_0x52a023});})[_0xff53('0x2a')](function(_0x91b7c5){if(_0x91b7c5){var _0x1ae1bb=Array[_0xff53('0x60')](_0x91b7c5)?_0x91b7c5:[_0x91b7c5];var _0x55070e=_0x1ae1bb[_0xff53('0x61')](function(_0x3eff38){return _0x3eff38[_0xff53('0x5b')]({'exitAt':moment()[_0xff53('0xc')](_0xff53('0x62')),'data2':_0x5943c6});});return Promise[_0xff53('0x63')](_0x55070e);}})[_0xff53('0x2a')](function(){if(!_0xdc1fd9){_0x2f5f40[_0xff53('0x64')]=![];_0x2f5f40['mailPause']=![];_0x2f5f40[_0xff53('0x65')]=![];_0x2f5f40[_0xff53('0x66')]=![];_0x2f5f40['smsPause']=![];_0x2f5f40[_0xff53('0x67')]=![];_0x2f5f40[_0xff53('0x68')]=![];}else{_0x2f5f40[_0xdc1fd9+_0xff53('0x69')]=![];}return _0x3d48e9[_0xff53('0x6a')]();})[_0xff53('0x2a')](function(_0x2e3206){var _0x56af21=require(_0xff53('0x6b'));var _0x2c04e4=_0x56af21['getChannels']();_0x2c04e4[_0xff53('0x6c')](function(_0x63901e){var _0x3a6aea=_0x63901e+'Status';_0x3d48e9[_0xff53('0x6d')]([_0x3a6aea],_0x2e3206[_0x3a6aea]);});return _0x3d48e9[_0xff53('0x5b')](_0x2f5f40);})['catch'](function(_0x112e04){throw _0x112e04;});}}});};
\ No newline at end of file
index 5635c21..4d28d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8801=['User\x20with\x20id\x20%s\x20not\x20found','params','unpause','destroy','push','all','LoginUser','mobile','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','length','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','defaults','localhost','redis','./user.socket','register','GetUser','findAll','options','raw','attributes','limit','include','model','map','then','info','debug','stringify','error','message','ShowUser','User','find','where','catch','name','role','internal','interface','format','UserVoiceQueueRt','update','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','isNil','SIP/%s','PAUSE','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType'];(function(_0xa1377b,_0x413b81){var _0x46466b=function(_0x663dd4){while(--_0x663dd4){_0xa1377b['push'](_0xa1377b['shift']());}};_0x46466b(++_0x413b81);}(_0x8801,0xc0));var _0x1880=function(_0xc569e0,_0x288308){_0xc569e0=_0xc569e0-0x0;var _0x567ab4=_0x8801[_0xc569e0];return _0x567ab4;};'use strict';var _=require('lodash');var util=require(_0x1880('0x0'));var moment=require(_0x1880('0x1'));var BPromise=require(_0x1880('0x2'));var Redis=require(_0x1880('0x3'));var db=require(_0x1880('0x4'))['db'];var utils=require(_0x1880('0x5'));var logger=require('../../config/logger')(_0x1880('0x6'));var config=require(_0x1880('0x7'));config['redis']=_[_0x1880('0x8')](config['redis'],{'host':_0x1880('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1880('0xa')]));require(_0x1880('0xb'))[_0x1880('0xc')](socket);exports[_0x1880('0xd')]=function(_0x2d7067){var _0x7c603c=this;return new Promise(function(_0x5c0770,_0x3ee380){return db['User'][_0x1880('0xe')]({'raw':_0x2d7067['options']?_0x2d7067[_0x1880('0xf')][_0x1880('0x10')]===undefined?!![]:![]:!![],'where':_0x2d7067[_0x1880('0xf')]?_0x2d7067[_0x1880('0xf')]['where']||null:null,'attributes':_0x2d7067['options']?_0x2d7067[_0x1880('0xf')][_0x1880('0x11')]||null:null,'limit':_0x2d7067[_0x1880('0xf')]?_0x2d7067['options'][_0x1880('0x12')]||null:null,'include':_0x2d7067[_0x1880('0xf')]?_0x2d7067[_0x1880('0xf')][_0x1880('0x13')]?_['map'](_0x2d7067[_0x1880('0xf')][_0x1880('0x13')],function(_0x93425f){return{'model':db[_0x93425f[_0x1880('0x14')]],'as':_0x93425f['as'],'attributes':_0x93425f['attributes'],'include':_0x93425f['include']?_['map'](_0x93425f[_0x1880('0x13')],function(_0x2246bb){return{'model':db[_0x2246bb[_0x1880('0x14')]],'as':_0x2246bb['as'],'attributes':_0x2246bb[_0x1880('0x11')],'include':_0x2246bb[_0x1880('0x13')]?_[_0x1880('0x15')](_0x2246bb[_0x1880('0x13')],function(_0xd3bc68){return{'model':db[_0xd3bc68[_0x1880('0x14')]],'as':_0xd3bc68['as'],'attributes':_0xd3bc68[_0x1880('0x11')]};}):[]};}):[]};}):[]:[]})[_0x1880('0x16')](function(_0x305e3e){logger[_0x1880('0x17')](_0x1880('0xd'),_0x2d7067);logger[_0x1880('0x18')](_0x1880('0xd'),_0x2d7067,JSON[_0x1880('0x19')](_0x305e3e));_0x5c0770(_0x305e3e);})['catch'](function(_0x39beae){logger[_0x1880('0x1a')]('GetUser',_0x39beae[_0x1880('0x1b')],_0x2d7067);_0x3ee380(_0x7c603c[_0x1880('0x1a')](0x1f4,_0x39beae[_0x1880('0x1b')]));});});};exports[_0x1880('0x1c')]=function(_0x5a4783){var _0x3ebf00=this;return new Promise(function(_0x53b0e0,_0x57160a){return db[_0x1880('0x1d')][_0x1880('0x1e')]({'raw':_0x5a4783[_0x1880('0xf')]?_0x5a4783[_0x1880('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x5a4783['options']?_0x5a4783[_0x1880('0xf')][_0x1880('0x1f')]||null:null,'attributes':_0x5a4783[_0x1880('0xf')]?_0x5a4783[_0x1880('0xf')][_0x1880('0x11')]||null:null,'include':_0x5a4783[_0x1880('0xf')]?_0x5a4783[_0x1880('0xf')][_0x1880('0x13')]?_['map'](_0x5a4783['options'][_0x1880('0x13')],function(_0x296f22){return{'model':db[_0x296f22['model']],'as':_0x296f22['as'],'attributes':_0x296f22[_0x1880('0x11')],'include':_0x296f22[_0x1880('0x13')]?_['map'](_0x296f22[_0x1880('0x13')],function(_0x3aa787){return{'model':db[_0x3aa787[_0x1880('0x14')]],'as':_0x3aa787['as'],'attributes':_0x3aa787[_0x1880('0x11')],'include':_0x3aa787['include']?_[_0x1880('0x15')](_0x3aa787[_0x1880('0x13')],function(_0x4c70ef){return{'model':db[_0x4c70ef[_0x1880('0x14')]],'as':_0x4c70ef['as'],'attributes':_0x4c70ef[_0x1880('0x11')]};}):[]};}):[]};}):[]:[]})[_0x1880('0x16')](function(_0x3f43a7){logger[_0x1880('0x17')](_0x1880('0x1c'),_0x5a4783);logger[_0x1880('0x18')](_0x1880('0x1c'),_0x5a4783,JSON[_0x1880('0x19')](_0x3f43a7));_0x53b0e0(_0x3f43a7);})[_0x1880('0x20')](function(_0x1cabac){logger[_0x1880('0x1a')](_0x1880('0x1c'),_0x1cabac[_0x1880('0x1b')],_0x5a4783);_0x57160a(_0x3ebf00[_0x1880('0x1a')](0x1f4,_0x1cabac[_0x1880('0x1b')]));});});};exports['PauseUser']=function(_0x2e25e7){var _0x1597f5;return db[_0x1880('0x1d')]['find']({'where':_0x2e25e7[_0x1880('0xf')][_0x1880('0x1f')]||{},'attributes':['id',_0x1880('0x21'),_0x1880('0x22'),_0x1880('0x23'),_0x1880('0x24')]})[_0x1880('0x16')](function(_0x198210){if(!_0x198210){throw new Error(util[_0x1880('0x25')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2e25e7['params']['id']));}_0x1597f5=_0x198210;return db[_0x1880('0x26')][_0x1880('0x27')]({'paused':0x1},{'where':{'UserId':_0x1597f5['id']},'individualHooks':!![]});})['then'](function(){return db[_0x1880('0x28')][_0x1880('0xe')]({'where':{'membername':_0x1597f5[_0x1880('0x21')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x39c97f){if(_0x39c97f&&_0x39c97f['length']){var _0x3ee169=moment()[_0x1880('0x25')](_0x1880('0x29'));for(var _0x351651=0x0,_0x78360a=_0x39c97f['length'];_0x351651<_0x78360a;_0x351651++){_0x39c97f[_0x351651]['updateAttributes']({'exitAt':_0x3ee169});}}})[_0x1880('0x16')](function(){var _0x1c521d=[];var _0x49a66d=utils[_0x1880('0x2a')]();_0x49a66d[_0x1880('0x2b')](function(_0x114c1f){_0x1c521d['push']({'channel':_0x114c1f,'membername':_0x1597f5[_0x1880('0x21')],'interface':_[_0x1880('0x2c')](_0x1597f5[_0x1880('0x24')])?util[_0x1880('0x25')](_0x1880('0x2d'),_0x1597f5['name']):_0x1597f5[_0x1880('0x24')],'type':_0x1880('0x2e'),'enterAt':moment()[_0x1880('0x25')](_0x1880('0x29')),'data1':_0x2e25e7[_0x1880('0x2f')]['type']||_0x1880('0x30'),'role':_0x1597f5[_0x1880('0x22')],'internal':_0x1597f5[_0x1880('0x23')],'uniqueid':_0x2e25e7[_0x1880('0x2f')][_0x1880('0x31')]||null});});return db['MemberReport'][_0x1880('0x32')](_0x1c521d,{'individualHooks':!![]});})['then'](function(){return _0x1597f5[_0x1880('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2e25e7[_0x1880('0x2f')][_0x1880('0x33')]||_0x1880('0x30'),'lastPauseAt':moment()[_0x1880('0x25')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x352c1b){throw _0x352c1b;});};exports[_0x1880('0x34')]=function(_0x2ce118){return Promise[_0x1880('0x35')]()[_0x1880('0x16')](function(){if(_0x2ce118[_0x1880('0x2f')][_0x1880('0x36')]&&!utils['isValidChannel'](_0x2ce118[_0x1880('0x2f')][_0x1880('0x36')])){throw new Error(util[_0x1880('0x25')](_0x1880('0x37'),_0x2ce118[_0x1880('0x2f')][_0x1880('0x36')]));}return db[_0x1880('0x1d')][_0x1880('0x38')]({'where':_0x2ce118[_0x1880('0xf')][_0x1880('0x1f')]||{},'attributes':['id',_0x1880('0x21'),_0x1880('0x22'),_0x1880('0x23'),_0x1880('0x24'),_0x1880('0x39'),_0x1880('0x3a'),_0x1880('0x3b'),_0x1880('0x3c'),_0x1880('0x3d'),_0x1880('0x3e'),_0x1880('0x3f'),_0x1880('0x40'),_0x1880('0x41'),'lastPauseAt']});})[_0x1880('0x16')](function(_0x33b77e){if(!_0x33b77e){throw new Error(util[_0x1880('0x25')](_0x1880('0x42'),_0x2ce118[_0x1880('0x43')]['id']));}return _0x33b77e[_0x1880('0x44')](_0x2ce118[_0x1880('0x2f')][_0x1880('0x36')],'system');})['catch'](function(_0x3d56ba){throw _0x3d56ba;});};exports['LogoutUser']=function(_0x7a1013){var _0x182171=this;return new Promise(function(_0x2203ac,_0x2437a0){var _0x5c5841;return db[_0x1880('0x1d')][_0x1880('0x38')]({'where':_0x7a1013['options']['where']||{},'attributes':['id',_0x1880('0x21')]})[_0x1880('0x16')](function(_0x3055ad){if(_0x3055ad){_0x5c5841=_0x3055ad;return db[_0x1880('0x26')][_0x1880('0x45')]({'where':{'membername':_0x5c5841[_0x1880('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x5c5841){return db[_0x1880('0x28')][_0x1880('0xe')]({'where':{'membername':_0x5c5841[_0x1880('0x21')],'exitAt':null}});}})[_0x1880('0x16')](function(_0x452885){if(_0x5c5841){if(_0x452885&&_0x452885['length']){var _0x7d812e=[];_0x452885[_0x1880('0x2b')](function(_0xa27d63){_0x7d812e[_0x1880('0x46')](_0xa27d63['update']({'exitAt':moment()[_0x1880('0x25')](_0x1880('0x29'))}));});return BPromise[_0x1880('0x47')](_0x7d812e);}}})[_0x1880('0x16')](function(){if(_0x5c5841){return _0x5c5841[_0x1880('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x1880('0x16')](function(_0x2b1067){_0x2203ac(_0x2b1067);})[_0x1880('0x20')](function(_0x313e9b){_0x2437a0(_0x182171[_0x1880('0x1a')](0x1f4,_0x313e9b[_0x1880('0x1b')]));});});};exports[_0x1880('0x48')]=function(_0x4350ee){var _0xfde6fb=this;return new Promise(function(_0x2439cc,_0x12288c){var _0x398a8f;var _0x178c8e;var _0x127c08;var _0x499fcd;return db[_0x1880('0x1d')]['findOne']({'where':_0x4350ee[_0x1880('0xf')][_0x1880('0x1f')]||{},'attributes':['id',_0x1880('0x21'),'role',_0x1880('0x49'),'phone','internal','loginInPause',_0x1880('0x24')]})[_0x1880('0x16')](function(_0x446a23){if(_0x446a23){_0x398a8f=_0x446a23;_0x499fcd=_0x4350ee[_0x1880('0x2f')][_0x1880('0x24')]?_0x4350ee[_0x1880('0x2f')][_0x1880('0x24')]:util[_0x1880('0x25')]('SIP/%s',_0x398a8f[_0x1880('0x21')]);return db[_0x1880('0x1d')][_0x1880('0x4a')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x398a8f['id']}}});}})['then'](function(_0x458baf){if(_0x458baf){_0x127c08=_0x458baf;return require(_0x1880('0x4b'))['getLicense']();}})[_0x1880('0x16')](function(_0x299864){if(_0x299864&&_0x299864['agents']&&_0x127c08>=_0x299864[_0x1880('0x4c')]){throw new Error(_0x1880('0x4d'));}})['then'](function(){if(_0x398a8f){return db[_0x1880('0x26')][_0x1880('0x45')]({'where':{'membername':_0x398a8f[_0x1880('0x21')]},'individualHooks':!![]});}})[_0x1880('0x16')](function(){if(_0x398a8f){return _0x398a8f[_0x1880('0x4e')]({'raw':!![]});}})[_0x1880('0x16')](function(_0x35fdc2){if(_0x398a8f){if(_0x35fdc2){var _0x3a645f=[];_0x178c8e=_0x35fdc2;if(_0x178c8e[_0x1880('0x4f')]){for(var _0x219041=0x0;_0x219041<_0x178c8e[_0x1880('0x4f')];_0x219041++){_0x3a645f['push'](db['UserVoiceQueueRt'][_0x1880('0x50')]({'membername':_0x398a8f[_0x1880('0x21')],'UserId':_0x398a8f['id'],'queue_name':_0x178c8e[_0x219041][_0x1880('0x21')],'VoiceQueueId':_0x178c8e[_0x219041]['id'],'interface':_0x499fcd,'paused':_0x398a8f[_0x1880('0x51')]||![],'penalty':_0x178c8e[_0x219041][_0x1880('0x52')]||0x0}));}return BPromise[_0x1880('0x47')](_0x3a645f);}}}})[_0x1880('0x16')](function(){if(_0x398a8f){return db['MemberReport'][_0x1880('0xe')]({'where':{'membername':_0x398a8f[_0x1880('0x21')],'exitAt':null}});}})[_0x1880('0x16')](function(_0x5d4129){if(_0x398a8f){if(_0x5d4129&&_0x5d4129[_0x1880('0x4f')]){var _0x4c5ed8=[];_0x5d4129[_0x1880('0x2b')](function(_0x17a4e3){_0x4c5ed8['push'](_0x17a4e3[_0x1880('0x27')]({'exitAt':moment()[_0x1880('0x25')](_0x1880('0x29'))}));});return BPromise[_0x1880('0x47')](_0x4c5ed8);}}})[_0x1880('0x16')](function(){if(_0x398a8f){var _0x1479bf=[];var _0x133f8a=[];var _0x32ba02=utils[_0x1880('0x2a')]();var _0x1cc5f6={'membername':_0x398a8f[_0x1880('0x21')],'interface':_0x499fcd,'enterAt':moment()['format'](_0x1880('0x29')),'role':_0x398a8f['role'],'internal':_0x398a8f[_0x1880('0x23')]};_0x32ba02[_0x1880('0x2b')](function(_0x42802d){_0x1479bf[_0x1880('0x46')](_[_0x1880('0x53')]({'channel':_0x42802d,'type':_0x1880('0x54'),'data1':'callysquare','data2':_0x499fcd},_0x1cc5f6));if(_0x398a8f[_0x1880('0x51')]){_0x133f8a[_0x1880('0x46')](_[_0x1880('0x53')]({'channel':_0x42802d,'type':_0x1880('0x2e'),'data1':_0x1880('0x55')},_0x1cc5f6));}});return db[_0x1880('0x28')][_0x1880('0x32')](_0x1479bf['concat'](_0x133f8a),{'individualHooks':!![]});}})[_0x1880('0x16')](function(){if(_0x398a8f){return _0x398a8f[_0x1880('0x27')]({'online':!![],'lastLoginAt':moment()[_0x1880('0x25')](_0x1880('0x29')),'voicePause':_0x398a8f[_0x1880('0x51')]||![],'mailPause':_0x398a8f[_0x1880('0x51')]||![],'chatPause':_0x398a8f[_0x1880('0x51')]||![],'faxPause':_0x398a8f[_0x1880('0x51')]||![],'smsPause':_0x398a8f[_0x1880('0x51')]||![],'openchannelPause':_0x398a8f[_0x1880('0x51')]||![],'pauseType':_0x398a8f[_0x1880('0x51')]?_0x1880('0x55'):null,'lastPauseAt':moment()[_0x1880('0x25')](_0x1880('0x29')),'interface':_0x499fcd});}})[_0x1880('0x16')](function(_0x487f2f){_0x2439cc(_0x487f2f);})[_0x1880('0x20')](function(_0xf8adf6){_0x12288c(_0xfde6fb[_0x1880('0x1a')](0x1f4,_0xf8adf6[_0x1880('0x1b')]));});});};
\ No newline at end of file
+var _0x1574=['destroy','findAll','forEach','update','all','mobile','phone','loginInPause','count','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','LOGININPAUSE','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','localhost','redis','./user.socket','register','GetUser','options','where','attributes','limit','map','include','model','then','info','debug','stringify','catch','error','message','ShowUser','User','raw','PauseUser','find','name','interface','params','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','role','internal','uniqueid','bulkCreate','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','unpause','system','LogoutUser'];(function(_0x256ef8,_0x5af9ac){var _0x1a31b2=function(_0x184423){while(--_0x184423){_0x256ef8['push'](_0x256ef8['shift']());}};_0x1a31b2(++_0x5af9ac);}(_0x1574,0x16b));var _0x4157=function(_0x41b09d,_0x2f376d){_0x41b09d=_0x41b09d-0x0;var _0x7ec929=_0x1574[_0x41b09d];return _0x7ec929;};'use strict';var _=require('lodash');var util=require(_0x4157('0x0'));var moment=require('moment');var BPromise=require(_0x4157('0x1'));var Redis=require(_0x4157('0x2'));var db=require(_0x4157('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4157('0x4'))(_0x4157('0x5'));var config=require(_0x4157('0x6'));config['redis']=_[_0x4157('0x7')](config['redis'],{'host':_0x4157('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4157('0x9')]));require(_0x4157('0xa'))[_0x4157('0xb')](socket);exports[_0x4157('0xc')]=function(_0x1cff35){var _0x2a29ce=this;return new Promise(function(_0x25405e,_0x3bc5d4){return db['User']['findAll']({'raw':_0x1cff35[_0x4157('0xd')]?_0x1cff35['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cff35[_0x4157('0xd')]?_0x1cff35[_0x4157('0xd')][_0x4157('0xe')]||null:null,'attributes':_0x1cff35[_0x4157('0xd')]?_0x1cff35[_0x4157('0xd')][_0x4157('0xf')]||null:null,'limit':_0x1cff35['options']?_0x1cff35['options'][_0x4157('0x10')]||null:null,'include':_0x1cff35[_0x4157('0xd')]?_0x1cff35[_0x4157('0xd')]['include']?_[_0x4157('0x11')](_0x1cff35[_0x4157('0xd')]['include'],function(_0x58f6ef){return{'model':db[_0x58f6ef['model']],'as':_0x58f6ef['as'],'attributes':_0x58f6ef['attributes'],'include':_0x58f6ef['include']?_[_0x4157('0x11')](_0x58f6ef[_0x4157('0x12')],function(_0x48fcfc){return{'model':db[_0x48fcfc[_0x4157('0x13')]],'as':_0x48fcfc['as'],'attributes':_0x48fcfc[_0x4157('0xf')],'include':_0x48fcfc[_0x4157('0x12')]?_['map'](_0x48fcfc[_0x4157('0x12')],function(_0x1cbcf6){return{'model':db[_0x1cbcf6[_0x4157('0x13')]],'as':_0x1cbcf6['as'],'attributes':_0x1cbcf6[_0x4157('0xf')]};}):[]};}):[]};}):[]:[]})[_0x4157('0x14')](function(_0x5a0624){logger[_0x4157('0x15')](_0x4157('0xc'),_0x1cff35);logger[_0x4157('0x16')](_0x4157('0xc'),_0x1cff35,JSON[_0x4157('0x17')](_0x5a0624));_0x25405e(_0x5a0624);})[_0x4157('0x18')](function(_0x5e888c){logger[_0x4157('0x19')](_0x4157('0xc'),_0x5e888c[_0x4157('0x1a')],_0x1cff35);_0x3bc5d4(_0x2a29ce[_0x4157('0x19')](0x1f4,_0x5e888c[_0x4157('0x1a')]));});});};exports[_0x4157('0x1b')]=function(_0x2545ef){var _0x58eee3=this;return new Promise(function(_0xd010c2,_0x394526){return db[_0x4157('0x1c')]['find']({'raw':_0x2545ef[_0x4157('0xd')]?_0x2545ef[_0x4157('0xd')][_0x4157('0x1d')]===undefined?!![]:![]:!![],'where':_0x2545ef[_0x4157('0xd')]?_0x2545ef[_0x4157('0xd')][_0x4157('0xe')]||null:null,'attributes':_0x2545ef[_0x4157('0xd')]?_0x2545ef[_0x4157('0xd')][_0x4157('0xf')]||null:null,'include':_0x2545ef[_0x4157('0xd')]?_0x2545ef[_0x4157('0xd')][_0x4157('0x12')]?_[_0x4157('0x11')](_0x2545ef[_0x4157('0xd')]['include'],function(_0x3af1a7){return{'model':db[_0x3af1a7[_0x4157('0x13')]],'as':_0x3af1a7['as'],'attributes':_0x3af1a7[_0x4157('0xf')],'include':_0x3af1a7[_0x4157('0x12')]?_['map'](_0x3af1a7[_0x4157('0x12')],function(_0x1a751d){return{'model':db[_0x1a751d[_0x4157('0x13')]],'as':_0x1a751d['as'],'attributes':_0x1a751d['attributes'],'include':_0x1a751d[_0x4157('0x12')]?_['map'](_0x1a751d[_0x4157('0x12')],function(_0x3e2a20){return{'model':db[_0x3e2a20[_0x4157('0x13')]],'as':_0x3e2a20['as'],'attributes':_0x3e2a20[_0x4157('0xf')]};}):[]};}):[]};}):[]:[]})[_0x4157('0x14')](function(_0x538402){logger[_0x4157('0x15')](_0x4157('0x1b'),_0x2545ef);logger[_0x4157('0x16')](_0x4157('0x1b'),_0x2545ef,JSON[_0x4157('0x17')](_0x538402));_0xd010c2(_0x538402);})['catch'](function(_0x17c4fb){logger[_0x4157('0x19')](_0x4157('0x1b'),_0x17c4fb[_0x4157('0x1a')],_0x2545ef);_0x394526(_0x58eee3[_0x4157('0x19')](0x1f4,_0x17c4fb[_0x4157('0x1a')]));});});};exports[_0x4157('0x1e')]=function(_0x4ef1ae){var _0x4dc81e;return db[_0x4157('0x1c')][_0x4157('0x1f')]({'where':_0x4ef1ae[_0x4157('0xd')][_0x4157('0xe')]||{},'attributes':['id',_0x4157('0x20'),'role','internal',_0x4157('0x21')]})[_0x4157('0x14')](function(_0xc940f){if(!_0xc940f){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x4ef1ae[_0x4157('0x22')]['id']));}_0x4dc81e=_0xc940f;return db[_0x4157('0x23')]['update']({'paused':0x1},{'where':{'UserId':_0x4dc81e['id']},'individualHooks':!![]});})['then'](function(){return db[_0x4157('0x24')]['findAll']({'where':{'membername':_0x4dc81e[_0x4157('0x20')],'type':_0x4157('0x25'),'exitAt':null}});})[_0x4157('0x14')](function(_0x82d52f){if(_0x82d52f&&_0x82d52f[_0x4157('0x26')]){var _0x279825=moment()[_0x4157('0x27')](_0x4157('0x28'));for(var _0x27ada1=0x0,_0x39e52f=_0x82d52f['length'];_0x27ada1<_0x39e52f;_0x27ada1++){_0x82d52f[_0x27ada1][_0x4157('0x29')]({'exitAt':_0x279825});}}})['then'](function(){var _0x1a7c39=[];var _0x28d03d=utils[_0x4157('0x2a')]();_0x28d03d['forEach'](function(_0x492e57){_0x1a7c39[_0x4157('0x2b')]({'channel':_0x492e57,'membername':_0x4dc81e[_0x4157('0x20')],'interface':_[_0x4157('0x2c')](_0x4dc81e[_0x4157('0x21')])?util[_0x4157('0x27')](_0x4157('0x2d'),_0x4dc81e['name']):_0x4dc81e[_0x4157('0x21')],'type':_0x4157('0x25'),'enterAt':moment()[_0x4157('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4ef1ae[_0x4157('0x2e')][_0x4157('0x2f')]||_0x4157('0x30'),'role':_0x4dc81e[_0x4157('0x31')],'internal':_0x4dc81e[_0x4157('0x32')],'uniqueid':_0x4ef1ae[_0x4157('0x2e')][_0x4157('0x33')]||null});});return db[_0x4157('0x24')][_0x4157('0x34')](_0x1a7c39,{'individualHooks':!![]});})['then'](function(){return _0x4dc81e['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4ef1ae[_0x4157('0x2e')]['type']||_0x4157('0x30'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x21d1ea){throw _0x21d1ea;});};exports['UnpauseUser']=function(_0x969b0a){return Promise['resolve']()[_0x4157('0x14')](function(){if(_0x969b0a['body'][_0x4157('0x35')]&&!utils['isValidChannel'](_0x969b0a[_0x4157('0x2e')][_0x4157('0x35')])){throw new Error(util[_0x4157('0x27')](_0x4157('0x36'),_0x969b0a[_0x4157('0x2e')]['channel']));}return db[_0x4157('0x1c')]['findOne']({'where':_0x969b0a[_0x4157('0xd')][_0x4157('0xe')]||{},'attributes':['id','name',_0x4157('0x31'),'internal',_0x4157('0x21'),_0x4157('0x37'),_0x4157('0x38'),_0x4157('0x39'),'chatPause',_0x4157('0x3a'),_0x4157('0x3b'),_0x4157('0x3c'),_0x4157('0x3d'),_0x4157('0x3e'),'lastPauseAt']});})['then'](function(_0x4d7172){if(!_0x4d7172){throw new Error(util[_0x4157('0x27')](_0x4157('0x3f'),_0x969b0a['params']['id']));}return _0x4d7172[_0x4157('0x40')](_0x969b0a['body'][_0x4157('0x35')],_0x4157('0x41'));})[_0x4157('0x18')](function(_0x44a4ad){throw _0x44a4ad;});};exports[_0x4157('0x42')]=function(_0x568552){var _0x48ff9f=this;return new Promise(function(_0x14cc3e,_0x211783){var _0x4228a1;return db[_0x4157('0x1c')]['findOne']({'where':_0x568552[_0x4157('0xd')][_0x4157('0xe')]||{},'attributes':['id','name']})['then'](function(_0x145e50){if(_0x145e50){_0x4228a1=_0x145e50;return db[_0x4157('0x23')][_0x4157('0x43')]({'where':{'membername':_0x4228a1['name']},'individualHooks':!![]});}})[_0x4157('0x14')](function(){if(_0x4228a1){return db[_0x4157('0x24')][_0x4157('0x44')]({'where':{'membername':_0x4228a1[_0x4157('0x20')],'exitAt':null}});}})[_0x4157('0x14')](function(_0x3181ea){if(_0x4228a1){if(_0x3181ea&&_0x3181ea['length']){var _0x1a3f78=[];_0x3181ea[_0x4157('0x45')](function(_0x1557e8){_0x1a3f78[_0x4157('0x2b')](_0x1557e8[_0x4157('0x46')]({'exitAt':moment()[_0x4157('0x27')](_0x4157('0x28'))}));});return BPromise[_0x4157('0x47')](_0x1a3f78);}}})[_0x4157('0x14')](function(){if(_0x4228a1){return _0x4228a1[_0x4157('0x46')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4157('0x14')](function(_0x580e35){_0x14cc3e(_0x580e35);})[_0x4157('0x18')](function(_0x2e7ee3){_0x211783(_0x48ff9f[_0x4157('0x19')](0x1f4,_0x2e7ee3[_0x4157('0x1a')]));});});};exports['LoginUser']=function(_0xe68d6a){var _0x5a4192=this;return new Promise(function(_0x3138e4,_0xc4cd42){var _0x36c900;var _0x31ad8e;var _0x4b2b7a;var _0x4b7346;return db['User']['findOne']({'where':_0xe68d6a[_0x4157('0xd')]['where']||{},'attributes':['id',_0x4157('0x20'),_0x4157('0x31'),_0x4157('0x48'),_0x4157('0x49'),_0x4157('0x32'),_0x4157('0x4a'),_0x4157('0x21')]})['then'](function(_0x5b5016){if(_0x5b5016){_0x36c900=_0x5b5016;_0x4b7346=_0xe68d6a[_0x4157('0x2e')]['interface']?_0xe68d6a[_0x4157('0x2e')][_0x4157('0x21')]:util[_0x4157('0x27')](_0x4157('0x2d'),_0x36c900[_0x4157('0x20')]);return db['User'][_0x4157('0x4b')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x36c900['id']}}});}})[_0x4157('0x14')](function(_0x1cbc1e){if(_0x1cbc1e){_0x4b2b7a=_0x1cbc1e;return require('../../config/license/util')[_0x4157('0x4c')]();}})[_0x4157('0x14')](function(_0x3da183){if(_0x3da183&&_0x3da183[_0x4157('0x4d')]&&_0x4b2b7a>=_0x3da183[_0x4157('0x4d')]){throw new Error(_0x4157('0x4e'));}})[_0x4157('0x14')](function(){if(_0x36c900){return db['UserVoiceQueueRt'][_0x4157('0x43')]({'where':{'membername':_0x36c900['name']},'individualHooks':!![]});}})['then'](function(){if(_0x36c900){return _0x36c900['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x32912d){if(_0x36c900){if(_0x32912d){var _0x4a9510=[];_0x31ad8e=_0x32912d;if(_0x31ad8e[_0x4157('0x26')]){for(var _0x2cfc1c=0x0;_0x2cfc1c<_0x31ad8e['length'];_0x2cfc1c++){_0x4a9510[_0x4157('0x2b')](db['UserVoiceQueueRt'][_0x4157('0x4f')]({'membername':_0x36c900[_0x4157('0x20')],'UserId':_0x36c900['id'],'queue_name':_0x31ad8e[_0x2cfc1c][_0x4157('0x20')],'VoiceQueueId':_0x31ad8e[_0x2cfc1c]['id'],'interface':_0x4b7346,'paused':_0x36c900[_0x4157('0x4a')]||![],'penalty':_0x31ad8e[_0x2cfc1c][_0x4157('0x50')]||0x0}));}return BPromise[_0x4157('0x47')](_0x4a9510);}}}})[_0x4157('0x14')](function(){if(_0x36c900){return db[_0x4157('0x24')][_0x4157('0x44')]({'where':{'membername':_0x36c900[_0x4157('0x20')],'exitAt':null}});}})[_0x4157('0x14')](function(_0xb14dca){if(_0x36c900){if(_0xb14dca&&_0xb14dca[_0x4157('0x26')]){var _0x10aa25=[];_0xb14dca[_0x4157('0x45')](function(_0x30bf0f){_0x10aa25[_0x4157('0x2b')](_0x30bf0f[_0x4157('0x46')]({'exitAt':moment()['format'](_0x4157('0x28'))}));});return BPromise[_0x4157('0x47')](_0x10aa25);}}})[_0x4157('0x14')](function(){if(_0x36c900){var _0x3e3b7d=[];var _0x10c772=[];var _0x824792=utils['getChannels']();var _0x450224={'membername':_0x36c900[_0x4157('0x20')],'interface':_0x4b7346,'enterAt':moment()['format'](_0x4157('0x28')),'role':_0x36c900[_0x4157('0x31')],'internal':_0x36c900[_0x4157('0x32')]};_0x824792[_0x4157('0x45')](function(_0x39e8a4){_0x3e3b7d[_0x4157('0x2b')](_[_0x4157('0x51')]({'channel':_0x39e8a4,'type':_0x4157('0x52'),'data1':_0x4157('0x53'),'data2':_0x4b7346},_0x450224));if(_0x36c900[_0x4157('0x4a')]){_0x10c772['push'](_['merge']({'channel':_0x39e8a4,'type':_0x4157('0x25'),'data1':'LOGININPAUSE'},_0x450224));}});return db['MemberReport'][_0x4157('0x34')](_0x3e3b7d[_0x4157('0x54')](_0x10c772),{'individualHooks':!![]});}})['then'](function(){if(_0x36c900){return _0x36c900[_0x4157('0x46')]({'online':!![],'lastLoginAt':moment()['format'](_0x4157('0x28')),'voicePause':_0x36c900['loginInPause']||![],'mailPause':_0x36c900[_0x4157('0x4a')]||![],'chatPause':_0x36c900['loginInPause']||![],'faxPause':_0x36c900[_0x4157('0x4a')]||![],'smsPause':_0x36c900[_0x4157('0x4a')]||![],'openchannelPause':_0x36c900[_0x4157('0x4a')]||![],'pauseType':_0x36c900[_0x4157('0x4a')]?_0x4157('0x55'):null,'lastPauseAt':moment()['format'](_0x4157('0x28')),'interface':_0x4b7346});}})[_0x4157('0x14')](function(_0x1f17b4){_0x3138e4(_0x1f17b4);})[_0x4157('0x18')](function(_0x299768){_0xc4cd42(_0x5a4192[_0x4157('0x19')](0x1f4,_0x299768[_0x4157('0x1a')]));});});};
\ No newline at end of file
index 48cfb33..afc429d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96c6=['length','./user.events','save','removeListener','register'];(function(_0x11334d,_0xf72ade){var _0x1f1345=function(_0x477e95){while(--_0x477e95){_0x11334d['push'](_0x11334d['shift']());}};_0x1f1345(++_0xf72ade);}(_0x96c6,0x128));var _0x696c=function(_0x5beed0,_0x3a7f95){_0x5beed0=_0x5beed0-0x0;var _0x446488=_0x96c6[_0x5beed0];return _0x446488;};'use strict';var UserEvents=require(_0x696c('0x0'));var events=[_0x696c('0x1'),'remove','update'];function createListener(_0x5966b0,_0x2bb850){return function(_0xe3faa9){_0x2bb850['emit'](_0x5966b0,_0xe3faa9);};}function removeListener(_0x1390be,_0xd940ee){return function(){UserEvents[_0x696c('0x2')](_0x1390be,_0xd940ee);};}exports[_0x696c('0x3')]=function(_0x436e9f){for(var _0x2860b0=0x0,_0x3d7e9c=events[_0x696c('0x4')];_0x2860b0<_0x3d7e9c;_0x2860b0++){var _0x2685b7=events[_0x2860b0];var _0x2e8f4d=createListener('user:'+_0x2685b7,_0x436e9f);UserEvents['on'](_0x2685b7,_0x2e8f4d);}};
\ No newline at end of file
+var _0x0e96=['user:','save','remove','update','emit','register','length'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x0e96,0xb7));var _0x60e9=function(_0x5df6e3,_0x49e03e){_0x5df6e3=_0x5df6e3-0x0;var _0x3332fd=_0x0e96[_0x5df6e3];return _0x3332fd;};'use strict';var UserEvents=require('./user.events');var events=[_0x60e9('0x0'),_0x60e9('0x1'),_0x60e9('0x2')];function createListener(_0x1ffedf,_0x2adf43){return function(_0x2816a4){_0x2adf43[_0x60e9('0x3')](_0x1ffedf,_0x2816a4);};}function removeListener(_0x5944dd,_0x959388){return function(){UserEvents['removeListener'](_0x5944dd,_0x959388);};}exports[_0x60e9('0x4')]=function(_0x25d3ea){for(var _0x44b834=0x0,_0xbbdf6=events[_0x60e9('0x5')];_0x44b834<_0xbbdf6;_0x44b834++){var _0x5d74cd=events[_0x44b834];var _0x1a146f=createListener(_0x60e9('0x6')+_0x5d74cd,_0x25d3ea);UserEvents['on'](_0x5d74cd,_0x1a146f);}};
\ No newline at end of file
index 40cbcab..e5aa2fb 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(_0x17ad5d,_0x5579c0){var _0x83d088=function(_0x448243){while(--_0x448243){_0x17ad5d['push'](_0x17ad5d['shift']());}};_0x83d088(++_0x5579c0);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3c6d35,_0x40d855){var _0x16510e=function(_0x347d16){while(--_0x347d16){_0x3c6d35['push'](_0x3c6d35['shift']());}};_0x16510e(++_0x40d855);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index ad82775..4a8f7f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09ef=['exports','INTEGER'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x09ef,0xea));var _0xf09e=function(_0x1ce4e1,_0x1a2731){_0x1ce4e1=_0x1ce4e1-0x0;var _0x4a64d3=_0x09ef[_0x1ce4e1];return _0x4a64d3;};'use strict';var Sequelize=require('sequelize');module[_0xf09e('0x0')]={'penalty':{'type':Sequelize[_0xf09e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5c75=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c75,0xca));var _0x55c7=function(_0x9f6c76,_0x32c8ca){_0x9f6c76=_0x9f6c76-0x0;var _0x8ebf7c=_0x5c75[_0x9f6c76];return _0x8ebf7c;};'use strict';var Sequelize=require(_0x55c7('0x0'));module[_0x55c7('0x1')]={'penalty':{'type':Sequelize[_0x55c7('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a534d4f..0c4651e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52bb=['moment','bluebird','request-promise','path','../../config/environment','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api'];(function(_0x1d326a,_0x89b53){var _0x5804d5=function(_0x19376c){while(--_0x19376c){_0x1d326a['push'](_0x1d326a['shift']());}};_0x5804d5(++_0x89b53);}(_0x52bb,0x158));var _0xb52b=function(_0xb67823,_0x7a5311){_0xb67823=_0xb67823-0x0;var _0x4573c3=_0x52bb[_0xb67823];return _0x4573c3;};'use strict';var _=require(_0xb52b('0x0'));var util=require(_0xb52b('0x1'));var logger=require(_0xb52b('0x2'))(_0xb52b('0x3'));var moment=require(_0xb52b('0x4'));var BPromise=require(_0xb52b('0x5'));var rp=require(_0xb52b('0x6'));var fs=require('fs');var path=require(_0xb52b('0x7'));var rimraf=require('rimraf');var config=require(_0xb52b('0x8'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x37d720,_0x3132e0){return _0x37d720[_0xb52b('0x9')](_0xb52b('0xa'),attributes,{'tableName':_0xb52b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x283a=['rimraf','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c4888,_0x5a24b5){var _0xd7fb8b=function(_0x4341d7){while(--_0x4341d7){_0x4c4888['push'](_0x4c4888['shift']());}};_0xd7fb8b(++_0x5a24b5);}(_0x283a,0xec));var _0xa283=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0x283a[_0x41582d];return _0x59c504;};'use strict';var _=require('lodash');var util=require(_0xa283('0x0'));var logger=require(_0xa283('0x1'))(_0xa283('0x2'));var moment=require(_0xa283('0x3'));var BPromise=require(_0xa283('0x4'));var rp=require(_0xa283('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa283('0x6'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0xa283('0x7')]=function(_0x5999cc,_0x3d419a){return _0x5999cc[_0xa283('0x8')](_0xa283('0x9'),attributes,{'tableName':_0xa283('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d16e37..44412ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdfb=['message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb29cca,_0x368c7e){var _0x5b5ef0=function(_0x2d2b0e){while(--_0x2d2b0e){_0xb29cca['push'](_0xb29cca['shift']());}};_0x5b5ef0(++_0x368c7e);}(_0xcdfb,0x82));var _0xbcdf=function(_0x5f46d6,_0x1d3074){_0x5f46d6=_0x5f46d6-0x0;var _0x958e96=_0xcdfb[_0x5f46d6];return _0x958e96;};'use strict';var _=require('lodash');var util=require(_0xbcdf('0x0'));var moment=require(_0xbcdf('0x1'));var BPromise=require('bluebird');var rs=require(_0xbcdf('0x2'));var fs=require('fs');var Redis=require(_0xbcdf('0x3'));var db=require(_0xbcdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcdf('0x5'))(_0xbcdf('0x6'));var config=require('../../config/environment');var jayson=require(_0xbcdf('0x7'));var client=jayson[_0xbcdf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18636f,_0x5e2988,_0x2ed3f4){return new BPromise(function(_0x592da3,_0x1f138f){return client[_0xbcdf('0x9')](_0x18636f,_0x2ed3f4)[_0xbcdf('0xa')](function(_0x5ad5e5){logger['info'](_0xbcdf('0xb'),_0x5e2988,_0xbcdf('0xc'));logger[_0xbcdf('0xd')](_0xbcdf('0xe'),_0x5e2988,_0xbcdf('0xc'),JSON[_0xbcdf('0xf')](_0x5ad5e5));if(_0x5ad5e5['error']){if(_0x5ad5e5[_0xbcdf('0x10')]['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5e2988,_0x5ad5e5[_0xbcdf('0x10')][_0xbcdf('0x11')]);return _0x1f138f(_0x5ad5e5[_0xbcdf('0x10')]['message']);}logger[_0xbcdf('0x10')](_0xbcdf('0xb'),_0x5e2988,_0x5ad5e5[_0xbcdf('0x10')]['message']);return _0x592da3(_0x5ad5e5[_0xbcdf('0x10')]['message']);}else{logger[_0xbcdf('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x5e2988,_0xbcdf('0xc'));_0x592da3(_0x5ad5e5[_0xbcdf('0x13')][_0xbcdf('0x11')]);}})[_0xbcdf('0x14')](function(_0x311b99){logger[_0xbcdf('0x10')](_0xbcdf('0xb'),_0x5e2988,_0x311b99);_0x1f138f(_0x311b99);});});}
\ No newline at end of file
+var _0xf547=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x2023bd,_0xc09229){var _0x179caf=function(_0x2e6e48){while(--_0x2e6e48){_0x2023bd['push'](_0x2023bd['shift']());}};_0x179caf(++_0xc09229);}(_0xf547,0x103));var _0x7f54=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xf547[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x7f54('0x0'));var util=require(_0x7f54('0x1'));var moment=require(_0x7f54('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f54('0x3'));var fs=require('fs');var Redis=require(_0x7f54('0x4'));var db=require(_0x7f54('0x5'))['db'];var utils=require(_0x7f54('0x6'));var logger=require(_0x7f54('0x7'))(_0x7f54('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f54('0x9'));var client=jayson['client'][_0x7f54('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x484c02,_0x48fc52,_0x2812f4){return new BPromise(function(_0x358144,_0x25d1c2){return client[_0x7f54('0xb')](_0x484c02,_0x2812f4)[_0x7f54('0xc')](function(_0x1f69f9){logger[_0x7f54('0xd')](_0x7f54('0xe'),_0x48fc52,_0x7f54('0xf'));logger[_0x7f54('0x10')](_0x7f54('0x11'),_0x48fc52,'request\x20sent',JSON[_0x7f54('0x12')](_0x1f69f9));if(_0x1f69f9[_0x7f54('0x13')]){if(_0x1f69f9[_0x7f54('0x13')]['code']===0x1f4){logger[_0x7f54('0x13')](_0x7f54('0xe'),_0x48fc52,_0x1f69f9['error'][_0x7f54('0x14')]);return _0x25d1c2(_0x1f69f9[_0x7f54('0x13')][_0x7f54('0x14')]);}logger[_0x7f54('0x13')](_0x7f54('0xe'),_0x48fc52,_0x1f69f9[_0x7f54('0x13')]['message']);return _0x358144(_0x1f69f9[_0x7f54('0x13')][_0x7f54('0x14')]);}else{logger[_0x7f54('0xd')](_0x7f54('0xe'),_0x48fc52,_0x7f54('0xf'));_0x358144(_0x1f69f9[_0x7f54('0x15')][_0x7f54('0x14')]);}})['catch'](function(_0x1ffdaf){logger[_0x7f54('0x13')](_0x7f54('0xe'),_0x48fc52,_0x1ffdaf);_0x25d1c2(_0x1ffdaf);});});}
\ No newline at end of file
index 356ba76..47f2685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5953ab,_0x12bec6){var _0x17cd12=function(_0x3d87c7){while(--_0x3d87c7){_0x5953ab['push'](_0x5953ab['shift']());}};_0x17cd12(++_0x12bec6);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ac6d6,_0x1bd750){_0x2ac6d6=_0x2ac6d6-0x0;var _0x1ed527=_0xedd9[_0x2ac6d6];return _0x1ed527;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x55bd12,_0x4dbbb9){var _0x5990f4=function(_0xa59be5){while(--_0xa59be5){_0x55bd12['push'](_0x55bd12['shift']());}};_0x5990f4(++_0x4dbbb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 2d79c91..accf08e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x709d=['INTEGER','STRING','sequelize','exports'];(function(_0x1ae219,_0x52fbc7){var _0x282f01=function(_0x1c44ad){while(--_0x1c44ad){_0x1ae219['push'](_0x1ae219['shift']());}};_0x282f01(++_0x52fbc7);}(_0x709d,0xea));var _0xd709=function(_0xf11d94,_0x1e3b44){_0xf11d94=_0xf11d94-0x0;var _0x150f07=_0x709d[_0xf11d94];return _0x150f07;};'use strict';var Sequelize=require(_0xd709('0x0'));module[_0xd709('0x1')]={'penalty':{'type':Sequelize[_0xd709('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd709('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd709('0x3')]}};
\ No newline at end of file
+var _0x30e2=['INTEGER','STRING','sequelize','exports'];(function(_0x163faa,_0xe1b8b6){var _0x4bbe0f=function(_0x9d854c){while(--_0x9d854c){_0x163faa['push'](_0x163faa['shift']());}};_0x4bbe0f(++_0xe1b8b6);}(_0x30e2,0x6e));var _0x230e=function(_0x5592ac,_0x53136c){_0x5592ac=_0x5592ac-0x0;var _0x456dd2=_0x30e2[_0x5592ac];return _0x456dd2;};'use strict';var Sequelize=require(_0x230e('0x0'));module[_0x230e('0x1')]={'penalty':{'type':Sequelize[_0x230e('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x230e('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x230e('0x3')]}};
\ No newline at end of file
index 5706124..2bac613 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc44=['define','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0xa0216b,_0x941488){var _0xcb483=function(_0x5717e3){while(--_0x5717e3){_0xa0216b['push'](_0xa0216b['shift']());}};_0xcb483(++_0x941488);}(_0xcc44,0xb2));var _0x4cc4=function(_0x4bbffb,_0x107d37){_0x4bbffb=_0x4bbffb-0x0;var _0x4e6dbd=_0xcc44[_0x4bbffb];return _0x4e6dbd;};'use strict';var _=require('lodash');var util=require(_0x4cc4('0x0'));var logger=require(_0x4cc4('0x1'))(_0x4cc4('0x2'));var moment=require(_0x4cc4('0x3'));var BPromise=require(_0x4cc4('0x4'));var rp=require(_0x4cc4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cc4('0x6'));var config=require(_0x4cc4('0x7'));var attributes=require(_0x4cc4('0x8'));module['exports']=function(_0x37c2e7,_0x435f2c){return _0x37c2e7[_0x4cc4('0x9')]('UserFaxQueue',attributes,{'tableName':_0x4cc4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5997=['../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x57a989,_0x17adf5){var _0x49d6b0=function(_0x5f13df){while(--_0x5f13df){_0x57a989['push'](_0x57a989['shift']());}};_0x49d6b0(++_0x17adf5);}(_0x5997,0xfb));var _0x7599=function(_0x7a05ab,_0x146a69){_0x7a05ab=_0x7a05ab-0x0;var _0x1c7230=_0x5997[_0x7a05ab];return _0x1c7230;};'use strict';var _=require(_0x7599('0x0'));var util=require(_0x7599('0x1'));var logger=require(_0x7599('0x2'))(_0x7599('0x3'));var moment=require(_0x7599('0x4'));var BPromise=require(_0x7599('0x5'));var rp=require(_0x7599('0x6'));var fs=require('fs');var path=require(_0x7599('0x7'));var rimraf=require(_0x7599('0x8'));var config=require(_0x7599('0x9'));var attributes=require(_0x7599('0xa'));module['exports']=function(_0x348e7a,_0x2e7699){return _0x348e7a['define'](_0x7599('0xb'),attributes,{'tableName':_0x7599('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b5ca7d..1bcacaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ca=['../../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','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3a9b98,_0x2f6b0c){var _0x64feec=function(_0x24b94e){while(--_0x24b94e){_0x3a9b98['push'](_0x3a9b98['shift']());}};_0x64feec(++_0x2f6b0c);}(_0x45ca,0x72));var _0xa45c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x45ca[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xa45c('0x0'));var util=require(_0xa45c('0x1'));var moment=require('moment');var BPromise=require(_0xa45c('0x2'));var rs=require(_0xa45c('0x3'));var fs=require('fs');var Redis=require(_0xa45c('0x4'));var db=require(_0xa45c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa45c('0x6'))(_0xa45c('0x7'));var config=require(_0xa45c('0x8'));var jayson=require(_0xa45c('0x9'));var client=jayson[_0xa45c('0xa')][_0xa45c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x451c96,_0x17d2e5,_0x5988d0){return new BPromise(function(_0x352db3,_0x38444e){return client[_0xa45c('0xc')](_0x451c96,_0x5988d0)['then'](function(_0x340940){logger[_0xa45c('0xd')](_0xa45c('0xe'),_0x17d2e5,_0xa45c('0xf'));logger['debug'](_0xa45c('0x10'),_0x17d2e5,_0xa45c('0xf'),JSON['stringify'](_0x340940));if(_0x340940['error']){if(_0x340940[_0xa45c('0x11')]['code']===0x1f4){logger[_0xa45c('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x17d2e5,_0x340940[_0xa45c('0x11')][_0xa45c('0x12')]);return _0x38444e(_0x340940[_0xa45c('0x11')][_0xa45c('0x12')]);}logger['error'](_0xa45c('0xe'),_0x17d2e5,_0x340940['error'][_0xa45c('0x12')]);return _0x352db3(_0x340940[_0xa45c('0x11')][_0xa45c('0x12')]);}else{logger[_0xa45c('0xd')](_0xa45c('0xe'),_0x17d2e5,_0xa45c('0xf'));_0x352db3(_0x340940['result'][_0xa45c('0x12')]);}})[_0xa45c('0x13')](function(_0x21df9e){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x17d2e5,_0x21df9e);_0x38444e(_0x21df9e);});});}
\ No newline at end of file
+var _0xd2ba=['../../config/logger','rpc','../../config/environment','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x14045f,_0x4e831c){var _0x3b9680=function(_0x2058e9){while(--_0x2058e9){_0x14045f['push'](_0x14045f['shift']());}};_0x3b9680(++_0x4e831c);}(_0xd2ba,0x6d));var _0xad2b=function(_0x19c860,_0x568e76){_0x19c860=_0x19c860-0x0;var _0x25aa01=_0xd2ba[_0x19c860];return _0x25aa01;};'use strict';var _=require(_0xad2b('0x0'));var util=require(_0xad2b('0x1'));var moment=require(_0xad2b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad2b('0x3'));var db=require(_0xad2b('0x4'))['db'];var utils=require(_0xad2b('0x5'));var logger=require(_0xad2b('0x6'))(_0xad2b('0x7'));var config=require(_0xad2b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xad2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e5c3a,_0x2a0c8c,_0x4ba4ca){return new BPromise(function(_0x568325,_0x313a5d){return client[_0xad2b('0xa')](_0x2e5c3a,_0x4ba4ca)[_0xad2b('0xb')](function(_0x570bb6){logger[_0xad2b('0xc')](_0xad2b('0xd'),_0x2a0c8c,'request\x20sent');logger[_0xad2b('0xe')](_0xad2b('0xf'),_0x2a0c8c,_0xad2b('0x10'),JSON[_0xad2b('0x11')](_0x570bb6));if(_0x570bb6[_0xad2b('0x12')]){if(_0x570bb6[_0xad2b('0x12')][_0xad2b('0x13')]===0x1f4){logger[_0xad2b('0x12')](_0xad2b('0xd'),_0x2a0c8c,_0x570bb6['error']['message']);return _0x313a5d(_0x570bb6[_0xad2b('0x12')]['message']);}logger['error'](_0xad2b('0xd'),_0x2a0c8c,_0x570bb6[_0xad2b('0x12')][_0xad2b('0x14')]);return _0x568325(_0x570bb6[_0xad2b('0x12')]['message']);}else{logger[_0xad2b('0xc')](_0xad2b('0xd'),_0x2a0c8c,'request\x20sent');_0x568325(_0x570bb6[_0xad2b('0x15')]['message']);}})[_0xad2b('0x16')](function(_0x51cdcf){logger[_0xad2b('0x12')](_0xad2b('0xd'),_0x2a0c8c,_0x51cdcf);_0x313a5d(_0x51cdcf);});});}
\ No newline at end of file
index 09eccee..5ef2c00 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(_0x5ccf18,_0x5d96d3){var _0xc33d73=function(_0x3b8360){while(--_0x3b8360){_0x5ccf18['push'](_0x5ccf18['shift']());}};_0xc33d73(++_0x5d96d3);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5bffd7,_0x1ac4f4){var _0x48e5dd=function(_0xdc6b8a){while(--_0xdc6b8a){_0x5bffd7['push'](_0x5bffd7['shift']());}};_0x48e5dd(++_0x1ac4f4);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 f25c995..071ad3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe806=['sequelize','exports','INTEGER'];(function(_0x3eb620,_0x37511b){var _0x4b89ab=function(_0x51e3f4){while(--_0x51e3f4){_0x3eb620['push'](_0x3eb620['shift']());}};_0x4b89ab(++_0x37511b);}(_0xe806,0x15c));var _0x6e80=function(_0x2480f4,_0x487369){_0x2480f4=_0x2480f4-0x0;var _0x5cc45b=_0xe806[_0x2480f4];return _0x5cc45b;};'use strict';var Sequelize=require(_0x6e80('0x0'));module[_0x6e80('0x1')]={'penalty':{'type':Sequelize[_0x6e80('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6355=['INTEGER','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6355,0x16c));var _0x5635=function(_0x378de1,_0xbb7cd3){_0x378de1=_0x378de1-0x0;var _0x513fe2=_0x6355[_0x378de1];return _0x513fe2;};'use strict';var Sequelize=require(_0x5635('0x0'));module[_0x5635('0x1')]={'penalty':{'type':Sequelize[_0x5635('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index bfafb09..ec883f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf212=['rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf212,0x1a5));var _0x2f21=function(_0x4cc93a,_0x41a443){_0x4cc93a=_0x4cc93a-0x0;var _0x5ecf0d=_0xf212[_0x4cc93a];return _0x5ecf0d;};'use strict';var _=require(_0x2f21('0x0'));var util=require(_0x2f21('0x1'));var logger=require(_0x2f21('0x2'))(_0x2f21('0x3'));var moment=require(_0x2f21('0x4'));var BPromise=require(_0x2f21('0x5'));var rp=require(_0x2f21('0x6'));var fs=require('fs');var path=require(_0x2f21('0x7'));var rimraf=require(_0x2f21('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f21('0x9'));module[_0x2f21('0xa')]=function(_0x432aa3,_0x193be8){return _0x432aa3['define'](_0x2f21('0xb'),attributes,{'tableName':_0x2f21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x17e0=['moment','path','rimraf','define','user_has_mail_queues','util','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x17e0,0x1c5));var _0x017e=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x17e0[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var util=require(_0x017e('0x0'));var logger=require(_0x017e('0x1'))('api');var moment=require(_0x017e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x017e('0x3'));var rimraf=require(_0x017e('0x4'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x279461,_0x4b8253){return _0x279461[_0x017e('0x5')]('UserMailQueue',attributes,{'tableName':_0x017e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24dfdce..2abd6e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xe5123d,_0x20ad5a){var _0x49fe7c=function(_0x4858d7){while(--_0x4858d7){_0xe5123d['push'](_0xe5123d['shift']());}};_0x49fe7c(++_0x20ad5a);}(_0x8ef6,0xf2));var _0x68ef=function(_0xd7018d,_0x5a140a){_0xd7018d=_0xd7018d-0x0;var _0x224c05=_0x8ef6[_0xd7018d];return _0x224c05;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\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(_0x1d1066,_0x17523b){var _0xe56482=function(_0x5ccd0b){while(--_0x5ccd0b){_0x1d1066['push'](_0x1d1066['shift']());}};_0xe56482(++_0x17523b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1aec02,_0x3a7f22){_0x1aec02=_0x1aec02-0x0;var _0x10a837=_0x7fbe[_0x1aec02];return _0x10a837;};'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 fae977b..6cf85f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3281=['path','express','fs-extra','../../components/auth/service','isAuthenticated','sendUserNotification','exports','multer','util'];(function(_0x29eca4,_0x166383){var _0x2bb348=function(_0x5e8f47){while(--_0x5e8f47){_0x29eca4['push'](_0x29eca4['shift']());}};_0x2bb348(++_0x166383);}(_0x3281,0x11e));var _0x1328=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3281[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x1328('0x0'));var util=require(_0x1328('0x1'));var path=require(_0x1328('0x2'));var timeout=require('connect-timeout');var express=require(_0x1328('0x3'));var router=express['Router']();var fs_extra=require(_0x1328('0x4'));var auth=require(_0x1328('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userNotification.controller');router['post']('/',auth[_0x1328('0x6')](),controller[_0x1328('0x7')]);module[_0x1328('0x8')]=router;
\ No newline at end of file
+var _0xe539=['Router','fs-extra','../../components/auth/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','express'];(function(_0x3bc951,_0x59e47a){var _0x57bdeb=function(_0x3e50c8){while(--_0x3e50c8){_0x3bc951['push'](_0x3bc951['shift']());}};_0x57bdeb(++_0x59e47a);}(_0xe539,0x19e));var _0x9e53=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0xe539[_0x38841c];return _0x500610;};'use strict';var multer=require(_0x9e53('0x0'));var util=require(_0x9e53('0x1'));var path=require(_0x9e53('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e53('0x3'));var router=express[_0x9e53('0x4')]();var fs_extra=require(_0x9e53('0x5'));var auth=require(_0x9e53('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e53('0x7'));router[_0x9e53('0x8')]('/',auth[_0x9e53('0x9')](),controller[_0x9e53('0xa')]);module['exports']=router;
\ No newline at end of file
index 23edd37..631660d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd366=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x37000d,_0x467855){var _0x349f9a=function(_0x3102e8){while(--_0x3102e8){_0x37000d['push'](_0x37000d['shift']());}};_0x349f9a(++_0x467855);}(_0xd366,0x127));var _0x6d36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd366[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x6d36('0x0'));module['exports']={'body':{'type':Sequelize[_0x6d36('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x6d36('0x1')]},'recipientsDescription':{'type':Sequelize[_0x6d36('0x2')]},'beep':{'type':Sequelize[_0x6d36('0x3')]}};
\ No newline at end of file
+var _0xdb18=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0xdb18,0x187));var _0x8db1=function(_0x5a0405,_0x1df434){_0x5a0405=_0x5a0405-0x0;var _0x4efa4c=_0xdb18[_0x5a0405];return _0x4efa4c;};'use strict';var Sequelize=require(_0x8db1('0x0'));module[_0x8db1('0x1')]={'body':{'type':Sequelize[_0x8db1('0x2')]},'senderName':{'type':Sequelize[_0x8db1('0x3')]},'recipientsId':{'type':Sequelize[_0x8db1('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x8db1('0x4')]}};
\ No newline at end of file
index d9b9a41..4e08251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4903=['body','TemplateId','Sequelize','ValidationError','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','voicequeue','whatsappqueue','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sequelize','UserNotification','forEach','recipient','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','User','union','ids','includes','replace','queue','Queue','push','flatten','getAgents','eml-format','rimraf','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','sendUserNotification','text'];(function(_0x58f457,_0x36f807){var _0x5be62c=function(_0x391634){while(--_0x391634){_0x58f457['push'](_0x58f457['shift']());}};_0x5be62c(++_0x36f807);}(_0x4903,0x143));var _0x3490=function(_0x308511,_0x1cf94f){_0x308511=_0x308511-0x0;var _0x43dd7d=_0x4903[_0x308511];return _0x43dd7d;};'use strict';var emlformat=require(_0x3490('0x0'));var rimraf=require(_0x3490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3490('0x2'));var moment=require(_0x3490('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3490('0x4'));var sox=require('sox');var csv=require(_0x3490('0x5'));var ejs=require(_0x3490('0x6'));var fs=require('fs');var fs_extra=require(_0x3490('0x7'));var _=require(_0x3490('0x8'));var squel=require(_0x3490('0x9'));var crypto=require(_0x3490('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3490('0xb'));var toCsv=require(_0x3490('0x5'));var querystring=require(_0x3490('0xc'));var Papa=require(_0x3490('0xd'));var Redis=require(_0x3490('0xe'));var authService=require(_0x3490('0xf'));var qs=require(_0x3490('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3490('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3490('0x12'));var config=require(_0x3490('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3490('0x14'))['db'];config[_0x3490('0x15')]=_[_0x3490('0x16')](config[_0x3490('0x15')],{'host':_0x3490('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3490('0x15')]));require('./userNotification.socket')[_0x3490('0x18')](socket);function respondWithStatusCode(_0x51f52a,_0x40ec45){_0x40ec45=_0x40ec45||0xcc;return function(_0x40c31d){if(_0x40c31d){return _0x51f52a[_0x3490('0x19')](_0x40ec45);}return _0x51f52a['status'](_0x40ec45)[_0x3490('0x1a')]();};}function respondWithResult(_0x2bd26f,_0x535a63){_0x535a63=_0x535a63||0xc8;return function(_0x3c3385){if(_0x3c3385){return _0x2bd26f[_0x3490('0x1b')](_0x535a63)[_0x3490('0x1c')](_0x3c3385);}};}function respondWithFilteredResult(_0x102837,_0x40c24f){return function(_0x29c393){if(_0x29c393){var _0x2f620d=typeof _0x40c24f['offset']===_0x3490('0x1d')&&typeof _0x40c24f['limit']===_0x3490('0x1d');var _0x4e35d9=_0x29c393[_0x3490('0x1e')];var _0x4eed60=_0x2f620d?0x0:_0x40c24f['offset'];var _0x1acb89=_0x2f620d?_0x29c393[_0x3490('0x1e')]:_0x40c24f[_0x3490('0x1f')]+_0x40c24f[_0x3490('0x20')];var _0x16929f;if(_0x1acb89>=_0x4e35d9){_0x1acb89=_0x4e35d9;_0x16929f=0xc8;}else{_0x16929f=0xce;}_0x102837[_0x3490('0x1b')](_0x16929f);return _0x102837[_0x3490('0x21')](_0x3490('0x22'),_0x4eed60+'-'+_0x1acb89+'/'+_0x4e35d9)['json'](_0x29c393);}return null;};}function patchUpdates(_0x417121){return function(_0x59863a){try{jsonpatch[_0x3490('0x23')](_0x59863a,_0x417121,!![]);}catch(_0x4f3380){return BPromise[_0x3490('0x24')](_0x4f3380);}return _0x59863a[_0x3490('0x25')]();};}function saveUpdates(_0x27a997,_0x182399){return function(_0x315d1f){if(_0x315d1f){return _0x315d1f['update'](_0x27a997)[_0x3490('0x26')](function(_0x55d53e){return _0x55d53e;});}return null;};}function removeEntity(_0x16f429,_0x5543b7){return function(_0x54bab1){if(_0x54bab1){return _0x54bab1[_0x3490('0x27')]()['then'](function(){_0x16f429['status'](0xcc)[_0x3490('0x1a')]();});}};}function handleEntityNotFound(_0x358044,_0x463dc1){return function(_0x620b56){if(!_0x620b56){_0x358044[_0x3490('0x19')](0x194);}return _0x620b56;};}function handleError(_0x33baf5,_0x56f6bf){_0x56f6bf=_0x56f6bf||0x1f4;return function(_0x1f3abc){logger[_0x3490('0x28')](_0x1f3abc[_0x3490('0x29')]);if(_0x1f3abc['name']){delete _0x1f3abc['name'];}_0x33baf5['status'](_0x56f6bf)[_0x3490('0x2a')](_0x1f3abc);};}exports[_0x3490('0x2b')]=function(_0x11d99e,_0x3e3f5c,_0x48dd72){if(!_0x11d99e['body']['hasOwnProperty'](_0x3490('0x2c'))&&!_0x11d99e[_0x3490('0x2d')]['hasOwnProperty'](_0x3490('0x2e'))){throw new db[(_0x3490('0x2f'))][(_0x3490('0x30'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x11d99e['body'][_0x3490('0x31')](_0x3490('0x2e'))&&!_0x11d99e['body'][_0x3490('0x31')](_0x3490('0x32'))){throw new db[(_0x3490('0x2f'))][(_0x3490('0x30'))](_0x3490('0x33'));}if(!_0x11d99e['body']['hasOwnProperty'](_0x3490('0x34'))){throw new db[(_0x3490('0x2f'))][(_0x3490('0x30'))](_0x3490('0x35'));}else{try{var _0x2a2613=JSON[_0x3490('0x36')](_0x11d99e['body'][_0x3490('0x34')]);}catch(_0x59603b){logger['error'](_0x59603b);throw new db['Sequelize'][(_0x3490('0x30'))](_0x3490('0x37'));}var _0x337d67=['chatqueue',_0x3490('0x38'),'mailqueue','openchannelqueue','smsqueue',_0x3490('0x39'),_0x3490('0x3a'),'team','user'];if(_[_0x3490('0x3b')](_0x2a2613,function(_0x189eed){return!_['includes'](_0x337d67,_0x189eed[_0x3490('0x3c')][_0x3490('0x3d')]());})){throw new db[(_0x3490('0x2f'))][(_0x3490('0x30'))](_0x3490('0x3e'));}}}var _0x2ff622={};_0x2ff622[_0x3490('0x3f')]=_0x11d99e[_0x3490('0x2d')][_0x3490('0x31')](_0x3490('0x3f'))?_0x11d99e[_0x3490('0x2d')][_0x3490('0x3f')]:_0x11d99e[_0x3490('0x40')][_0x3490('0x41')];_0x2ff622[_0x3490('0x42')]=_[_0x3490('0x43')](_0x11d99e[_0x3490('0x2d')][_0x3490('0x42')])?null:_0x11d99e[_0x3490('0x2d')][_0x3490('0x42')];_0x2ff622['beep']=_0x11d99e['body'][_0x3490('0x44')]||![];_0x2ff622[_0x3490('0x45')]=_0x11d99e[_0x3490('0x40')]['id'];return getContent(_0x11d99e[_0x3490('0x2d')])[_0x3490('0x26')](function(_0x725a2f){_0x2ff622['body']=_0x725a2f;return getRecipients(_0x2a2613);})[_0x3490('0x26')](function(_0x5d9167){_0x2ff622[_0x3490('0x46')]=_['sortBy'](_0x5d9167)['join'](',');return db[_0x3490('0x47')]['transaction'](function(_0x12fa73){return db[_0x3490('0x48')]['create'](_0x2ff622,{'raw':!![],'transaction':_0x12fa73})[_0x3490('0x26')](function(_0x340663){var _0x101eab={'sender':_0x2ff622[_0x3490('0x3f')],'description':_0x2ff622[_0x3490('0x42')],'content':_0x2ff622[_0x3490('0x2d')],'beep':_0x2ff622[_0x3490('0x44')]};_0x5d9167[_0x3490('0x49')](function(_0x39d51f){_0x101eab[_0x3490('0x4a')]=_0x39d51f;socket['emit'](_0x3490('0x4b'),_0x101eab);});return _0x340663;});});})[_0x3490('0x26')](respondWithResult(_0x3e3f5c,0xc9))['catch'](handleError(_0x3e3f5c,null));};function getContent(_0x1ef14c){return new BPromise(function(_0x4d9b31,_0x51bfd6){if(_0x1ef14c[_0x3490('0x2c')]){_0x4d9b31(_0x1ef14c[_0x3490('0x2c')]);return;}return db[_0x3490('0x4c')][_0x3490('0x4d')]({'attributes':[_0x3490('0x4e')],'where':{'id':_0x1ef14c[_0x3490('0x2e')]},'raw':!![]})[_0x3490('0x26')](function(_0x5569cb){if(!_0x5569cb)throw new db[(_0x3490('0x2f'))][(_0x3490('0x30'))](_0x3490('0x4f'));var _0x1bfecf=Mustache[_0x3490('0x50')](_0x5569cb[_0x3490('0x4e')],_0x1ef14c[_0x3490('0x32')]);_0x4d9b31(_0x1bfecf);})[_0x3490('0x51')](function(_0x23128a){_0x51bfd6(_0x23128a);});});}function getRecipients(_0x17a898){return new BPromise(function(_0x3ed2b7,_0x362eab){var _0xd91878=[];var _0x40a6be=[];_0x17a898[_0x3490('0x49')](function(_0xac8952){var _0x589645=_['startCase'](_0xac8952[_0x3490('0x3c')]['toLowerCase']());if(_0x589645===_0x3490('0x52')){_0xd91878=_[_0x3490('0x53')](_0xd91878,_0xac8952[_0x3490('0x54')]);}else{if(_[_0x3490('0x55')](_0x589645,'queue'))_0x589645=_0x589645[_0x3490('0x56')](_0x3490('0x57'),_0x3490('0x58'));_0xac8952[_0x3490('0x54')]['forEach'](function(_0x14e5f2){_0x40a6be[_0x3490('0x59')](getAgents(_0x589645,_0x14e5f2));});}});return BPromise['all'](_0x40a6be)[_0x3490('0x26')](function(_0x51fdc2){_0xd91878=_[_0x3490('0x53')](_0xd91878,_[_0x3490('0x5a')](_0x51fdc2));_0x3ed2b7(_0xd91878);})[_0x3490('0x51')](function(_0x3f46e1){_0x362eab(_0x3f46e1);});});}function getAgents(_0x2eee56,_0x24691d){return new BPromise(function(_0x2d3864,_0x13ddf6){return db[_0x2eee56][_0x3490('0x4d')]({'where':{'id':_0x24691d}})['then'](function(_0x129e99){return _0x129e99[_0x3490('0x5b')]({'attributes':['id'],'raw':!![]})[_0x3490('0x26')](function(_0x78afcb){var _0x48a85f=_['map'](_0x78afcb,'id');_0x2d3864(_0x48a85f);});})[_0x3490('0x51')](function(_0x364122){_0x13ddf6(_0x364122);});});}
\ No newline at end of file
+var _0x1bef=['json','reject','save','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','join','sequelize','transaction','create','forEach','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','queue','replace','ids','all','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','offset','undefined','count','set'];(function(_0x525370,_0x5abe18){var _0x4a1ae9=function(_0x257f97){while(--_0x257f97){_0x525370['push'](_0x525370['shift']());}};_0x4a1ae9(++_0x5abe18);}(_0x1bef,0x90));var _0xf1be=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1bef[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xf1be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1be('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1be('0x2'));var moment=require(_0xf1be('0x3'));var BPromise=require(_0xf1be('0x4'));var Mustache=require('mustache');var util=require(_0xf1be('0x5'));var path=require('path');var sox=require(_0xf1be('0x6'));var csv=require(_0xf1be('0x7'));var ejs=require(_0xf1be('0x8'));var fs=require('fs');var fs_extra=require(_0xf1be('0x9'));var _=require(_0xf1be('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf1be('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf1be('0x7'));var querystring=require(_0xf1be('0xc'));var Papa=require('papaparse');var Redis=require(_0xf1be('0xd'));var authService=require(_0xf1be('0xe'));var qs=require(_0xf1be('0xf'));var as=require(_0xf1be('0x10'));var hardwareService=require(_0xf1be('0x11'));var logger=require(_0xf1be('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf1be('0x13')]=_[_0xf1be('0x14')](config['redis'],{'host':_0xf1be('0x15'),'port':0x18eb});var socket=require(_0xf1be('0x16'))(new Redis(config[_0xf1be('0x13')]));require(_0xf1be('0x17'))['register'](socket);function respondWithStatusCode(_0x18f7d3,_0x2fd296){_0x2fd296=_0x2fd296||0xcc;return function(_0x14509e){if(_0x14509e){return _0x18f7d3[_0xf1be('0x18')](_0x2fd296);}return _0x18f7d3['status'](_0x2fd296)['end']();};}function respondWithResult(_0x33b956,_0x413cf3){_0x413cf3=_0x413cf3||0xc8;return function(_0x4d9679){if(_0x4d9679){return _0x33b956[_0xf1be('0x19')](_0x413cf3)['json'](_0x4d9679);}};}function respondWithFilteredResult(_0x58a16d,_0x2f5a52){return function(_0x44cba9){if(_0x44cba9){var _0x4e0d88=typeof _0x2f5a52[_0xf1be('0x1a')]==='undefined'&&typeof _0x2f5a52['limit']===_0xf1be('0x1b');var _0x2a7200=_0x44cba9[_0xf1be('0x1c')];var _0x218eb1=_0x4e0d88?0x0:_0x2f5a52['offset'];var _0x40cd2e=_0x4e0d88?_0x44cba9[_0xf1be('0x1c')]:_0x2f5a52[_0xf1be('0x1a')]+_0x2f5a52['limit'];var _0x1acea0;if(_0x40cd2e>=_0x2a7200){_0x40cd2e=_0x2a7200;_0x1acea0=0xc8;}else{_0x1acea0=0xce;}_0x58a16d['status'](_0x1acea0);return _0x58a16d[_0xf1be('0x1d')]('Content-Range',_0x218eb1+'-'+_0x40cd2e+'/'+_0x2a7200)[_0xf1be('0x1e')](_0x44cba9);}return null;};}function patchUpdates(_0x1c4074){return function(_0x56a5c3){try{jsonpatch['apply'](_0x56a5c3,_0x1c4074,!![]);}catch(_0x54d835){return BPromise[_0xf1be('0x1f')](_0x54d835);}return _0x56a5c3[_0xf1be('0x20')]();};}function saveUpdates(_0x10c1eb,_0x1629d5){return function(_0x14752e){if(_0x14752e){return _0x14752e[_0xf1be('0x21')](_0x10c1eb)[_0xf1be('0x22')](function(_0x2dab35){return _0x2dab35;});}return null;};}function removeEntity(_0x476bf5,_0x16c785){return function(_0x38d235){if(_0x38d235){return _0x38d235[_0xf1be('0x23')]()['then'](function(){_0x476bf5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe113,_0x7258e){return function(_0x41fd63){if(!_0x41fd63){_0x2fe113[_0xf1be('0x18')](0x194);}return _0x41fd63;};}function handleError(_0xb7d9ed,_0x46c6c5){_0x46c6c5=_0x46c6c5||0x1f4;return function(_0x44ecd5){logger[_0xf1be('0x24')](_0x44ecd5['stack']);if(_0x44ecd5[_0xf1be('0x25')]){delete _0x44ecd5[_0xf1be('0x25')];}_0xb7d9ed[_0xf1be('0x19')](_0x46c6c5)[_0xf1be('0x26')](_0x44ecd5);};}exports[_0xf1be('0x27')]=function(_0x220156,_0x93a4c7,_0xd7e644){if(!_0x220156[_0xf1be('0x28')][_0xf1be('0x29')](_0xf1be('0x2a'))&&!_0x220156[_0xf1be('0x28')]['hasOwnProperty'](_0xf1be('0x2b'))){throw new db[(_0xf1be('0x2c'))][(_0xf1be('0x2d'))](_0xf1be('0x2e'));}else{if(_0x220156['body'][_0xf1be('0x29')]('TemplateId')&&!_0x220156['body']['hasOwnProperty']('view')){throw new db[(_0xf1be('0x2c'))][(_0xf1be('0x2d'))](_0xf1be('0x2f'));}if(!_0x220156[_0xf1be('0x28')][_0xf1be('0x29')](_0xf1be('0x30'))){throw new db['Sequelize']['ValidationError'](_0xf1be('0x31'));}else{try{var _0x4d1685=JSON['parse'](_0x220156[_0xf1be('0x28')][_0xf1be('0x30')]);}catch(_0x2a099e){logger[_0xf1be('0x24')](_0x2a099e);throw new db[(_0xf1be('0x2c'))][(_0xf1be('0x2d'))](_0xf1be('0x32'));}var _0xe00568=['chatqueue','faxqueue',_0xf1be('0x33'),_0xf1be('0x34'),_0xf1be('0x35'),_0xf1be('0x36'),_0xf1be('0x37'),_0xf1be('0x38'),_0xf1be('0x39')];if(_['some'](_0x4d1685,function(_0x4b4f50){return!_[_0xf1be('0x3a')](_0xe00568,_0x4b4f50[_0xf1be('0x3b')][_0xf1be('0x3c')]());})){throw new db['Sequelize'][(_0xf1be('0x2d'))](_0xf1be('0x3d'));}}}var _0x41421d={};_0x41421d[_0xf1be('0x3e')]=_0x220156[_0xf1be('0x28')][_0xf1be('0x29')](_0xf1be('0x3e'))?_0x220156[_0xf1be('0x28')][_0xf1be('0x3e')]:_0x220156[_0xf1be('0x39')][_0xf1be('0x3f')];_0x41421d[_0xf1be('0x40')]=_['isEmpty'](_0x220156[_0xf1be('0x28')][_0xf1be('0x40')])?null:_0x220156[_0xf1be('0x28')]['recipientsDescription'];_0x41421d[_0xf1be('0x41')]=_0x220156['body'][_0xf1be('0x41')]||![];_0x41421d[_0xf1be('0x42')]=_0x220156[_0xf1be('0x39')]['id'];return getContent(_0x220156['body'])[_0xf1be('0x22')](function(_0x1686e6){_0x41421d[_0xf1be('0x28')]=_0x1686e6;return getRecipients(_0x4d1685);})['then'](function(_0x4b2fa2){_0x41421d[_0xf1be('0x43')]=_['sortBy'](_0x4b2fa2)[_0xf1be('0x44')](',');return db[_0xf1be('0x45')][_0xf1be('0x46')](function(_0x1ccbe3){return db['UserNotification'][_0xf1be('0x47')](_0x41421d,{'raw':!![],'transaction':_0x1ccbe3})['then'](function(_0x3e5fbd){var _0x1bc892={'sender':_0x41421d[_0xf1be('0x3e')],'description':_0x41421d[_0xf1be('0x40')],'content':_0x41421d[_0xf1be('0x28')],'beep':_0x41421d[_0xf1be('0x41')]};_0x4b2fa2[_0xf1be('0x48')](function(_0x599d13){_0x1bc892['recipient']=_0x599d13;socket['emit'](_0xf1be('0x49'),_0x1bc892);});return _0x3e5fbd;});});})[_0xf1be('0x22')](respondWithResult(_0x93a4c7,0xc9))['catch'](handleError(_0x93a4c7,null));};function getContent(_0x10ebca){return new BPromise(function(_0x513d2b,_0x3505e1){if(_0x10ebca['text']){_0x513d2b(_0x10ebca['text']);return;}return db[_0xf1be('0x4a')][_0xf1be('0x4b')]({'attributes':[_0xf1be('0x4c')],'where':{'id':_0x10ebca[_0xf1be('0x2b')]},'raw':!![]})['then'](function(_0x29b427){if(!_0x29b427)throw new db[(_0xf1be('0x2c'))]['ValidationError'](_0xf1be('0x4d'));var _0x5338ea=Mustache[_0xf1be('0x4e')](_0x29b427[_0xf1be('0x4c')],_0x10ebca['view']);_0x513d2b(_0x5338ea);})[_0xf1be('0x4f')](function(_0x4d002e){_0x3505e1(_0x4d002e);});});}function getRecipients(_0x4b21be){return new BPromise(function(_0x32ef5c,_0x599d19){var _0x5ce091=[];var _0x4d74d7=[];_0x4b21be['forEach'](function(_0xb20085){var _0xd65f3a=_[_0xf1be('0x50')](_0xb20085['model'][_0xf1be('0x3c')]());if(_0xd65f3a===_0xf1be('0x51')){_0x5ce091=_[_0xf1be('0x52')](_0x5ce091,_0xb20085['ids']);}else{if(_[_0xf1be('0x3a')](_0xd65f3a,_0xf1be('0x53')))_0xd65f3a=_0xd65f3a[_0xf1be('0x54')]('queue','Queue');_0xb20085[_0xf1be('0x55')][_0xf1be('0x48')](function(_0x555723){_0x4d74d7['push'](getAgents(_0xd65f3a,_0x555723));});}});return BPromise[_0xf1be('0x56')](_0x4d74d7)[_0xf1be('0x22')](function(_0x47942a){_0x5ce091=_['union'](_0x5ce091,_['flatten'](_0x47942a));_0x32ef5c(_0x5ce091);})[_0xf1be('0x4f')](function(_0x50f25a){_0x599d19(_0x50f25a);});});}function getAgents(_0x434c2c,_0xe8ff92){return new BPromise(function(_0xd817d7,_0x481956){return db[_0x434c2c]['findOne']({'where':{'id':_0xe8ff92}})[_0xf1be('0x22')](function(_0x554b70){return _0x554b70['getAgents']({'attributes':['id'],'raw':!![]})[_0xf1be('0x22')](function(_0x16a56c){var _0x49f86a=_['map'](_0x16a56c,'id');_0xd817d7(_0x49f86a);});})['catch'](function(_0x187f4c){_0x481956(_0x187f4c);});});}
\ No newline at end of file
index 96a87b1..e1b8474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4ea=['UserNotification','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x278980,_0x5ddd67){var _0x17e44c=function(_0x142b7f){while(--_0x142b7f){_0x278980['push'](_0x278980['shift']());}};_0x17e44c(++_0x5ddd67);}(_0xa4ea,0xd7));var _0xaa4e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa4ea[_0x4c7fb5];return _0x2e10ac;};'use strict';var EventEmitter=require(_0xaa4e('0x0'));var UserNotification=require(_0xaa4e('0x1'))['db'][_0xaa4e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa4e('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd3ef35){return function(_0x11d4ee,_0x354bde,_0x176c5b){UserNotificationEvents[_0xaa4e('0x4')](_0xd3ef35+':'+_0x11d4ee['id'],_0x11d4ee);UserNotificationEvents[_0xaa4e('0x4')](_0xd3ef35,_0x11d4ee);_0x176c5b(null);};}for(var e in events){if(events[_0xaa4e('0x5')](e)){var event=events[e];UserNotification[_0xaa4e('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x1af1=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1e177f,_0x1088e8){var _0x47ee40=function(_0x5b350b){while(--_0x5b350b){_0x1e177f['push'](_0x1e177f['shift']());}};_0x47ee40(++_0x1088e8);}(_0x1af1,0x140));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x11af('0x0'));var UserNotification=require(_0x11af('0x1'))['db'][_0x11af('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x11af('0x3')](0x0);var events={'afterCreate':_0x11af('0x4'),'afterUpdate':_0x11af('0x5'),'afterDestroy':_0x11af('0x6')};function emitEvent(_0x128a51){return function(_0x1de93d,_0x3c856d,_0x15ecd8){UserNotificationEvents['emit'](_0x128a51+':'+_0x1de93d['id'],_0x1de93d);UserNotificationEvents[_0x11af('0x7')](_0x128a51,_0x1de93d);_0x15ecd8(null);};}for(var e in events){if(events[_0x11af('0x8')](e)){var event=events[e];UserNotification[_0x11af('0x9')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
index 231bd2c..b5ac2f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf529=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5bd4aa,_0x3f2de3){var _0x57c7f6=function(_0x571cdb){while(--_0x571cdb){_0x5bd4aa['push'](_0x5bd4aa['shift']());}};_0x57c7f6(++_0x3f2de3);}(_0xf529,0x158));var _0x9f52=function(_0x2c5a37,_0x476ed7){_0x2c5a37=_0x2c5a37-0x0;var _0x57875f=_0xf529[_0x2c5a37];return _0x57875f;};'use strict';var _=require(_0x9f52('0x0'));var util=require(_0x9f52('0x1'));var logger=require(_0x9f52('0x2'))(_0x9f52('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f52('0x4'));var fs=require('fs');var path=require(_0x9f52('0x5'));var rimraf=require(_0x9f52('0x6'));var config=require(_0x9f52('0x7'));var attributes=require(_0x9f52('0x8'));module[_0x9f52('0x9')]=function(_0x41ef9c,_0x2a9bb3){return _0x41ef9c[_0x9f52('0xa')](_0x9f52('0xb'),attributes,{'tableName':_0x9f52('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f52('0xd'),'collate':_0x9f52('0xe')});};
\ No newline at end of file
+var _0xd873=['userNotifications','utf8mb4','lodash','util','api','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xd873,0xe6));var _0x3d87=function(_0x4a4109,_0x363b84){_0x4a4109=_0x4a4109-0x0;var _0x2be084=_0xd873[_0x4a4109];return _0x2be084;};'use strict';var _=require(_0x3d87('0x0'));var util=require(_0x3d87('0x1'));var logger=require('../../config/logger')(_0x3d87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d87('0x3'));var rimraf=require(_0x3d87('0x4'));var config=require(_0x3d87('0x5'));var attributes=require(_0x3d87('0x6'));module[_0x3d87('0x7')]=function(_0x5e7ed8,_0x568e36){return _0x5e7ed8[_0x3d87('0x8')](_0x3d87('0x9'),attributes,{'tableName':_0x3d87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d87('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 901e3cf..351c729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa213=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa213,0x69));var _0x3a21=function(_0x5fc42c,_0x42ff9a){_0x5fc42c=_0x5fc42c-0x0;var _0x3b791a=_0xa213[_0x5fc42c];return _0x3b791a;};'use strict';var _=require(_0x3a21('0x0'));var util=require(_0x3a21('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a21('0x2'));var fs=require('fs');var Redis=require(_0x3a21('0x3'));var db=require(_0x3a21('0x4'))['db'];var utils=require(_0x3a21('0x5'));var logger=require(_0x3a21('0x6'))(_0x3a21('0x7'));var config=require(_0x3a21('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a21('0x9')]['http']({'port':0x232a});config[_0x3a21('0xa')]=_[_0x3a21('0xb')](config[_0x3a21('0xa')],{'host':_0x3a21('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a21('0xa')]));require(_0x3a21('0xd'))['register'](socket);function respondWithRpcPromise(_0x2ee8a6,_0x1ac0c6,_0x4b4165){return new BPromise(function(_0x4c0c9b,_0x19c3cf){return client[_0x3a21('0xe')](_0x2ee8a6,_0x4b4165)[_0x3a21('0xf')](function(_0x539774){logger[_0x3a21('0x10')](_0x3a21('0x11'),_0x1ac0c6,'request\x20sent');logger[_0x3a21('0x12')](_0x3a21('0x13'),_0x1ac0c6,_0x3a21('0x14'),JSON[_0x3a21('0x15')](_0x539774));if(_0x539774['error']){if(_0x539774[_0x3a21('0x16')][_0x3a21('0x17')]===0x1f4){logger[_0x3a21('0x16')](_0x3a21('0x11'),_0x1ac0c6,_0x539774[_0x3a21('0x16')][_0x3a21('0x18')]);return _0x19c3cf(_0x539774[_0x3a21('0x16')]['message']);}logger[_0x3a21('0x16')](_0x3a21('0x11'),_0x1ac0c6,_0x539774[_0x3a21('0x16')]['message']);return _0x4c0c9b(_0x539774[_0x3a21('0x16')]['message']);}else{logger[_0x3a21('0x10')]('UserNotification,\x20%s,\x20%s',_0x1ac0c6,_0x3a21('0x14'));_0x4c0c9b(_0x539774[_0x3a21('0x19')][_0x3a21('0x18')]);}})[_0x3a21('0x1a')](function(_0x1a0235){logger[_0x3a21('0x16')](_0x3a21('0x11'),_0x1ac0c6,_0x1a0235);_0x19c3cf(_0x1a0235);});});}
\ No newline at end of file
+var _0x03a8=['then','info','debug','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x38b4d2,_0xd89036){var _0x49411a=function(_0x1c2a1e){while(--_0x1c2a1e){_0x38b4d2['push'](_0x38b4d2['shift']());}};_0x49411a(++_0xd89036);}(_0x03a8,0x90));var _0x803a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03a8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x803a('0x0'));var moment=require(_0x803a('0x1'));var BPromise=require(_0x803a('0x2'));var rs=require(_0x803a('0x3'));var fs=require('fs');var Redis=require(_0x803a('0x4'));var db=require(_0x803a('0x5'))['db'];var utils=require(_0x803a('0x6'));var logger=require('../../config/logger')(_0x803a('0x7'));var config=require(_0x803a('0x8'));var jayson=require(_0x803a('0x9'));var client=jayson[_0x803a('0xa')][_0x803a('0xb')]({'port':0x232a});config[_0x803a('0xc')]=_[_0x803a('0xd')](config[_0x803a('0xc')],{'host':_0x803a('0xe'),'port':0x18eb});var socket=require(_0x803a('0xf'))(new Redis(config[_0x803a('0xc')]));require('./userNotification.socket')[_0x803a('0x10')](socket);function respondWithRpcPromise(_0x191a7f,_0x292c4c,_0x4c5266){return new BPromise(function(_0x4edeb0,_0x587780){return client[_0x803a('0x11')](_0x191a7f,_0x4c5266)[_0x803a('0x12')](function(_0x3ca38a){logger[_0x803a('0x13')]('UserNotification,\x20%s,\x20%s',_0x292c4c,'request\x20sent');logger[_0x803a('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x292c4c,_0x803a('0x15'),JSON[_0x803a('0x16')](_0x3ca38a));if(_0x3ca38a[_0x803a('0x17')]){if(_0x3ca38a[_0x803a('0x17')][_0x803a('0x18')]===0x1f4){logger['error'](_0x803a('0x19'),_0x292c4c,_0x3ca38a[_0x803a('0x17')]['message']);return _0x587780(_0x3ca38a['error']['message']);}logger[_0x803a('0x17')](_0x803a('0x19'),_0x292c4c,_0x3ca38a[_0x803a('0x17')]['message']);return _0x4edeb0(_0x3ca38a[_0x803a('0x17')]['message']);}else{logger[_0x803a('0x13')](_0x803a('0x19'),_0x292c4c,_0x803a('0x15'));_0x4edeb0(_0x3ca38a[_0x803a('0x1a')]['message']);}})['catch'](function(_0x196462){logger[_0x803a('0x17')](_0x803a('0x19'),_0x292c4c,_0x196462);_0x587780(_0x196462);});});}
\ No newline at end of file
index be9bcbe..7620851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bcb=['update','emit','removeListener','register','length','userNotification:','save','remove'];(function(_0xc2be36,_0x5a47fc){var _0x4c177d=function(_0x164ff){while(--_0x164ff){_0xc2be36['push'](_0xc2be36['shift']());}};_0x4c177d(++_0x5a47fc);}(_0x2bcb,0x176));var _0xb2bc=function(_0x13a184,_0xa4806){_0x13a184=_0x13a184-0x0;var _0x4796ea=_0x2bcb[_0x13a184];return _0x4796ea;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xb2bc('0x0'),_0xb2bc('0x1'),_0xb2bc('0x2')];function createListener(_0x628199,_0x769d65){return function(_0x1095d0){_0x769d65[_0xb2bc('0x3')](_0x628199,_0x1095d0);};}function removeListener(_0x3712cf,_0x5d65ab){return function(){UserNotificationEvents[_0xb2bc('0x4')](_0x3712cf,_0x5d65ab);};}exports[_0xb2bc('0x5')]=function(_0x34e2f1){for(var _0x18aeed=0x0,_0x1be64c=events[_0xb2bc('0x6')];_0x18aeed<_0x1be64c;_0x18aeed++){var _0x25d8a3=events[_0x18aeed];var _0x58f460=createListener(_0xb2bc('0x7')+_0x25d8a3,_0x34e2f1);UserNotificationEvents['on'](_0x25d8a3,_0x58f460);}};
\ No newline at end of file
+var _0xb2d2=['update','emit','length','userNotification:','save','remove'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xb2d2,0x7c));var _0x2b2d=function(_0x1cd781,_0x2c5631){_0x1cd781=_0x1cd781-0x0;var _0x440bb2=_0xb2d2[_0x1cd781];return _0x440bb2;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x2b2d('0x0'),_0x2b2d('0x1'),_0x2b2d('0x2')];function createListener(_0x2c4801,_0x3739a0){return function(_0xccb6aa){_0x3739a0[_0x2b2d('0x3')](_0x2c4801,_0xccb6aa);};}function removeListener(_0x538c25,_0x3f0524){return function(){UserNotificationEvents['removeListener'](_0x538c25,_0x3f0524);};}exports['register']=function(_0x5049fc){for(var _0x30f32e=0x0,_0x15eaa0=events[_0x2b2d('0x4')];_0x30f32e<_0x15eaa0;_0x30f32e++){var _0x1d13d4=events[_0x30f32e];var _0x1a4753=createListener(_0x2b2d('0x5')+_0x1d13d4,_0x5049fc);UserNotificationEvents['on'](_0x1d13d4,_0x1a4753);}};
\ No newline at end of file
index 63408dc..dd80789 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(_0x2e0a3f,_0x50afb7){var _0x22b575=function(_0x52055e){while(--_0x52055e){_0x2e0a3f['push'](_0x2e0a3f['shift']());}};_0x22b575(++_0x50afb7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xcb91[_0x3e2fcf];return _0x497db7;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1de7b0,_0x43fb84){var _0x18f8e0=function(_0x1e808c){while(--_0x1e808c){_0x1de7b0['push'](_0x1de7b0['shift']());}};_0x18f8e0(++_0x43fb84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 84ce458..5fe6317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c7=['INTEGER','sequelize','exports'];(function(_0x2f2a0d,_0x5d1976){var _0x823f5e=function(_0x5c42d5){while(--_0x5c42d5){_0x2f2a0d['push'](_0x2f2a0d['shift']());}};_0x823f5e(++_0x5d1976);}(_0xb4c7,0x19c));var _0x7b4c=function(_0x1ca7f7,_0x304764){_0x1ca7f7=_0x1ca7f7-0x0;var _0x35d325=_0xb4c7[_0x1ca7f7];return _0x35d325;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'penalty':{'type':Sequelize[_0x7b4c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1ff7=['INTEGER','sequelize','exports'];(function(_0x5887a0,_0x5aae49){var _0xe504dc=function(_0x1b278f){while(--_0x1b278f){_0x5887a0['push'](_0x5887a0['shift']());}};_0xe504dc(++_0x5aae49);}(_0x1ff7,0x181));var _0x71ff=function(_0x5bc8ea,_0x3d2db4){_0x5bc8ea=_0x5bc8ea-0x0;var _0x1118dc=_0x1ff7[_0x5bc8ea];return _0x1118dc;};'use strict';var Sequelize=require(_0x71ff('0x0'));module[_0x71ff('0x1')]={'penalty':{'type':Sequelize[_0x71ff('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 54ad57b..abb08a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c82=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c82,0x1ab));var _0x27c8=function(_0x269e5a,_0x1cbe9f){_0x269e5a=_0x269e5a-0x0;var _0x32ed5a=_0x7c82[_0x269e5a];return _0x32ed5a;};'use strict';var _=require(_0x27c8('0x0'));var util=require(_0x27c8('0x1'));var logger=require('../../config/logger')(_0x27c8('0x2'));var moment=require(_0x27c8('0x3'));var BPromise=require(_0x27c8('0x4'));var rp=require(_0x27c8('0x5'));var fs=require('fs');var path=require(_0x27c8('0x6'));var rimraf=require(_0x27c8('0x7'));var config=require(_0x27c8('0x8'));var attributes=require(_0x27c8('0x9'));module[_0x27c8('0xa')]=function(_0x212962,_0x4dd6a4){return _0x212962[_0x27c8('0xb')](_0x27c8('0xc'),attributes,{'tableName':_0x27c8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf89=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5c016a,_0x4e0fb7){var _0x3feef1=function(_0x403f6d){while(--_0x403f6d){_0x5c016a['push'](_0x5c016a['shift']());}};_0x3feef1(++_0x4e0fb7);}(_0xbf89,0x17e));var _0x9bf8=function(_0x33a573,_0x5e88b2){_0x33a573=_0x33a573-0x0;var _0xa8c4c0=_0xbf89[_0x33a573];return _0xa8c4c0;};'use strict';var _=require(_0x9bf8('0x0'));var util=require(_0x9bf8('0x1'));var logger=require(_0x9bf8('0x2'))(_0x9bf8('0x3'));var moment=require(_0x9bf8('0x4'));var BPromise=require(_0x9bf8('0x5'));var rp=require(_0x9bf8('0x6'));var fs=require('fs');var path=require(_0x9bf8('0x7'));var rimraf=require('rimraf');var config=require(_0x9bf8('0x8'));var attributes=require(_0x9bf8('0x9'));module[_0x9bf8('0xa')]=function(_0x50d2fa,_0x109e62){return _0x50d2fa[_0x9bf8('0xb')](_0x9bf8('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4aaf848..199cf8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cba=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0x9cba,0x18c));var _0xa9cb=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9cba[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xa9cb('0x0'));var util=require(_0xa9cb('0x1'));var moment=require(_0xa9cb('0x2'));var BPromise=require(_0xa9cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9cb('0x4'));var db=require(_0xa9cb('0x5'))['db'];var utils=require(_0xa9cb('0x6'));var logger=require('../../config/logger')(_0xa9cb('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9cb('0x8'));var client=jayson[_0xa9cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17b1b1,_0x537b49,_0x258dac){return new BPromise(function(_0x2b5130,_0x4edf5a){return client['request'](_0x17b1b1,_0x258dac)[_0xa9cb('0xa')](function(_0x18470f){logger['info'](_0xa9cb('0xb'),_0x537b49,_0xa9cb('0xc'));logger[_0xa9cb('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x537b49,'request\x20sent',JSON[_0xa9cb('0xe')](_0x18470f));if(_0x18470f[_0xa9cb('0xf')]){if(_0x18470f['error']['code']===0x1f4){logger[_0xa9cb('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x537b49,_0x18470f[_0xa9cb('0xf')][_0xa9cb('0x10')]);return _0x4edf5a(_0x18470f[_0xa9cb('0xf')][_0xa9cb('0x10')]);}logger['error'](_0xa9cb('0xb'),_0x537b49,_0x18470f[_0xa9cb('0xf')][_0xa9cb('0x10')]);return _0x2b5130(_0x18470f['error']['message']);}else{logger[_0xa9cb('0x11')](_0xa9cb('0xb'),_0x537b49,_0xa9cb('0xc'));_0x2b5130(_0x18470f[_0xa9cb('0x12')][_0xa9cb('0x10')]);}})[_0xa9cb('0x13')](function(_0x4be5bf){logger[_0xa9cb('0xf')](_0xa9cb('0xb'),_0x537b49,_0x4be5bf);_0x4edf5a(_0x4be5bf);});});}
\ No newline at end of file
+var _0xe1aa=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x294032,_0x4ed889){var _0x5e9616=function(_0x4a5648){while(--_0x4a5648){_0x294032['push'](_0x294032['shift']());}};_0x5e9616(++_0x4ed889);}(_0xe1aa,0x65));var _0xae1a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe1aa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xae1a('0x0'));var util=require(_0xae1a('0x1'));var moment=require(_0xae1a('0x2'));var BPromise=require(_0xae1a('0x3'));var rs=require(_0xae1a('0x4'));var fs=require('fs');var Redis=require(_0xae1a('0x5'));var db=require(_0xae1a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae1a('0x7'))(_0xae1a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae1a('0x9')][_0xae1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c8db8,_0x33982e,_0x260bef){return new BPromise(function(_0x36971d,_0xdca006){return client[_0xae1a('0xb')](_0x5c8db8,_0x260bef)['then'](function(_0xc13c70){logger[_0xae1a('0xc')](_0xae1a('0xd'),_0x33982e,_0xae1a('0xe'));logger[_0xae1a('0xf')](_0xae1a('0x10'),_0x33982e,'request\x20sent',JSON[_0xae1a('0x11')](_0xc13c70));if(_0xc13c70['error']){if(_0xc13c70[_0xae1a('0x12')][_0xae1a('0x13')]===0x1f4){logger[_0xae1a('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33982e,_0xc13c70[_0xae1a('0x12')][_0xae1a('0x14')]);return _0xdca006(_0xc13c70['error']['message']);}logger[_0xae1a('0x12')](_0xae1a('0xd'),_0x33982e,_0xc13c70[_0xae1a('0x12')]['message']);return _0x36971d(_0xc13c70[_0xae1a('0x12')][_0xae1a('0x14')]);}else{logger[_0xae1a('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33982e,'request\x20sent');_0x36971d(_0xc13c70['result'][_0xae1a('0x14')]);}})['catch'](function(_0x1efa94){logger[_0xae1a('0x12')](_0xae1a('0xd'),_0x33982e,_0x1efa94);_0xdca006(_0x1efa94);});});}
\ No newline at end of file
index ba564bf..a1da703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d88=['../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','post','/:id/clone','/:id/resources','addResources','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x42f773,_0x35b097){var _0x5b23aa=function(_0x2c2cd8){while(--_0x2c2cd8){_0x42f773['push'](_0x42f773['shift']());}};_0x5b23aa(++_0x35b097);}(_0x2d88,0xec));var _0x82d8=function(_0x2f2a55,_0x3b4f13){_0x2f2a55=_0x2f2a55-0x0;var _0x44b415=_0x2d88[_0x2f2a55];return _0x44b415;};'use strict';var multer=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var path=require(_0x82d8('0x2'));var timeout=require(_0x82d8('0x3'));var express=require(_0x82d8('0x4'));var router=express[_0x82d8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x82d8('0x6'));var interaction=require(_0x82d8('0x7'));var config=require(_0x82d8('0x8'));var controller=require(_0x82d8('0x9'));router[_0x82d8('0xa')]('/',auth[_0x82d8('0xb')](),controller[_0x82d8('0xc')]);router[_0x82d8('0xa')](_0x82d8('0xd'),auth[_0x82d8('0xb')](),controller[_0x82d8('0xe')]);router[_0x82d8('0xa')](_0x82d8('0xf'),auth[_0x82d8('0xb')](),controller[_0x82d8('0x10')]);router[_0x82d8('0xa')](_0x82d8('0x11'),auth[_0x82d8('0xb')](),controller[_0x82d8('0x12')]);router[_0x82d8('0xa')]('/:id/resources',auth[_0x82d8('0xb')](),controller['getResources']);router[_0x82d8('0x13')]('/',auth[_0x82d8('0xb')](),controller['create']);router['post'](_0x82d8('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0x82d8('0x13')](_0x82d8('0x11'),auth[_0x82d8('0xb')](),controller['addSections']);router[_0x82d8('0x13')](_0x82d8('0x15'),auth[_0x82d8('0xb')](),controller[_0x82d8('0x16')]);router['put'](_0x82d8('0xf'),auth[_0x82d8('0xb')](),controller['update']);router[_0x82d8('0x17')](_0x82d8('0xf'),auth[_0x82d8('0xb')](),controller['destroy']);router[_0x82d8('0x17')](_0x82d8('0x11'),auth[_0x82d8('0xb')](),controller[_0x82d8('0x18')]);router[_0x82d8('0x17')](_0x82d8('0x15'),auth[_0x82d8('0xb')](),controller[_0x82d8('0x19')]);module[_0x82d8('0x1a')]=router;
\ No newline at end of file
+var _0x8454=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','/describe','describe','show','isAuthenticated','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports'];(function(_0x2be4f3,_0x540070){var _0x5bf9c4=function(_0x436199){while(--_0x436199){_0x2be4f3['push'](_0x2be4f3['shift']());}};_0x5bf9c4(++_0x540070);}(_0x8454,0x1a4));var _0x4845=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8454[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x4845('0x0'));var util=require(_0x4845('0x1'));var path=require(_0x4845('0x2'));var timeout=require(_0x4845('0x3'));var express=require(_0x4845('0x4'));var router=express[_0x4845('0x5')]();var fs_extra=require(_0x4845('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4845('0x7'));var config=require(_0x4845('0x8'));var controller=require(_0x4845('0x9'));router[_0x4845('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4845('0xa')](_0x4845('0xb'),auth['isAuthenticated'](),controller[_0x4845('0xc')]);router[_0x4845('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4845('0xd')]);router['get']('/:id/sections',auth[_0x4845('0xe')](),controller['getSections']);router[_0x4845('0xa')](_0x4845('0xf'),auth[_0x4845('0xe')](),controller[_0x4845('0x10')]);router[_0x4845('0x11')]('/',auth[_0x4845('0xe')](),controller[_0x4845('0x12')]);router[_0x4845('0x11')](_0x4845('0x13'),auth['isAuthenticated'](),controller[_0x4845('0x14')]);router[_0x4845('0x11')]('/:id/sections',auth[_0x4845('0xe')](),controller[_0x4845('0x15')]);router[_0x4845('0x11')](_0x4845('0xf'),auth['isAuthenticated'](),controller[_0x4845('0x16')]);router[_0x4845('0x17')]('/:id',auth[_0x4845('0xe')](),controller[_0x4845('0x18')]);router[_0x4845('0x19')]('/:id',auth[_0x4845('0xe')](),controller[_0x4845('0x1a')]);router[_0x4845('0x19')]('/:id/sections',auth[_0x4845('0xe')](),controller[_0x4845('0x1b')]);router[_0x4845('0x19')]('/:id/resources',auth['isAuthenticated'](),controller[_0x4845('0x1c')]);module[_0x4845('0x1d')]=router;
\ No newline at end of file
index 9759c5e..f71b49f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f8c=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0f8c,0x12e));var _0xc0f8=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0f8c[_0x9dfc10];return _0x4f938a;};'use strict';var Sequelize=require(_0xc0f8('0x0'));module[_0xc0f8('0x1')]={'name':{'type':Sequelize[_0xc0f8('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xc0f8('0x2')],'set':function(_0x39c460){this[_0xc0f8('0x3')](_0xc0f8('0x4'),_0x39c460?_0x39c460[_0xc0f8('0x5')](''):[]);},'get':function(){return this[_0xc0f8('0x6')]('crudPermissions')?this[_0xc0f8('0x6')]('crudPermissions')[_0xc0f8('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc0f8('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc0f8('0x8')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8b7f=['BOOLEAN','sequelize','STRING','name','crudPermissions','split'];(function(_0x4057bd,_0x201752){var _0x3cb508=function(_0x3890af){while(--_0x3890af){_0x4057bd['push'](_0x4057bd['shift']());}};_0x3cb508(++_0x201752);}(_0x8b7f,0x1bd));var _0xf8b7=function(_0x3a9ade,_0x5d4cea){_0x3a9ade=_0x3a9ade-0x0;var _0x10a87f=_0x8b7f[_0x3a9ade];return _0x10a87f;};'use strict';var Sequelize=require(_0xf8b7('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8b7('0x1')],'allowNull':![],'unique':_0xf8b7('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x224106){this['setDataValue'](_0xf8b7('0x3'),_0x224106?_0x224106['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue']('crudPermissions')[_0xf8b7('0x4')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf8b7('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf8b7('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf8b7('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf8b7('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf8b7('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf8b7('0x5')],'defaultValue':!![]}};
\ No newline at end of file
index 8a10a82..8188a1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46b6=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','findAll','rows','catch','show','params','rawAttributes','includeAll','find','clone','get','omit','createdAt','updatedAt','body','create','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','removeSections','getSections','enabled','includes','subsections','concat','push','Dashboard','forEach','resourceId','Plugin','transaction','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','undefined','limit','count','offset','set','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfile','key','model','keys','query','filters'];(function(_0x3b8fd2,_0x144c2b){var _0x327780=function(_0x483aca){while(--_0x483aca){_0x3b8fd2['push'](_0x3b8fd2['shift']());}};_0x327780(++_0x144c2b);}(_0x46b6,0x1eb));var _0x646b=function(_0x13a147,_0x4d57dc){_0x13a147=_0x13a147-0x0;var _0x116313=_0x46b6[_0x13a147];return _0x116313;};'use strict';var emlformat=require(_0x646b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x646b('0x1'));var jsonpatch=require(_0x646b('0x2'));var rp=require(_0x646b('0x3'));var moment=require(_0x646b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x646b('0x5'));var util=require('util');var path=require(_0x646b('0x6'));var sox=require(_0x646b('0x7'));var csv=require(_0x646b('0x8'));var ejs=require(_0x646b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x646b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x646b('0xb'));var deskjs=require(_0x646b('0xc'));var toCsv=require(_0x646b('0x8'));var querystring=require(_0x646b('0xd'));var Papa=require(_0x646b('0xe'));var Redis=require(_0x646b('0xf'));var authService=require(_0x646b('0x10'));var qs=require(_0x646b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x646b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x646b('0x13'));var licenseUtil=require(_0x646b('0x14'));var db=require(_0x646b('0x15'))['db'];config['redis']=_['defaults'](config[_0x646b('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x646b('0x17'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x392ffd,_0x4caaba){_0x4caaba=_0x4caaba||0xcc;return function(_0xcaefe8){if(_0xcaefe8){return _0x392ffd[_0x646b('0x18')](_0x4caaba);}return _0x392ffd[_0x646b('0x19')](_0x4caaba)[_0x646b('0x1a')]();};}function respondWithResult(_0x5458e5,_0x5db62a){_0x5db62a=_0x5db62a||0xc8;return function(_0x99b4f0){if(_0x99b4f0){return _0x5458e5[_0x646b('0x19')](_0x5db62a)['json'](_0x99b4f0);}};}function respondWithFilteredResult(_0x5c1561,_0x43b35e){return function(_0x2ec678){if(_0x2ec678){var _0x60fbbc=typeof _0x43b35e['offset']===_0x646b('0x1b')&&typeof _0x43b35e[_0x646b('0x1c')]===_0x646b('0x1b');var _0x3a01d2=_0x2ec678[_0x646b('0x1d')];var _0x4c0b3f=_0x60fbbc?0x0:_0x43b35e[_0x646b('0x1e')];var _0xcae7ec=_0x60fbbc?_0x2ec678[_0x646b('0x1d')]:_0x43b35e[_0x646b('0x1e')]+_0x43b35e[_0x646b('0x1c')];var _0x2d0d7f;if(_0xcae7ec>=_0x3a01d2){_0xcae7ec=_0x3a01d2;_0x2d0d7f=0xc8;}else{_0x2d0d7f=0xce;}_0x5c1561[_0x646b('0x19')](_0x2d0d7f);return _0x5c1561[_0x646b('0x1f')]('Content-Range',_0x4c0b3f+'-'+_0xcae7ec+'/'+_0x3a01d2)['json'](_0x2ec678);}return null;};}function patchUpdates(_0x3c4db3){return function(_0x3af9f4){try{jsonpatch['apply'](_0x3af9f4,_0x3c4db3,!![]);}catch(_0x15dddb){return BPromise[_0x646b('0x20')](_0x15dddb);}return _0x3af9f4[_0x646b('0x21')]();};}function saveUpdates(_0x528177,_0x5e95e2){return function(_0x3bc547){if(_0x3bc547){return _0x3bc547[_0x646b('0x22')](_0x528177)['then'](function(_0x504726){return _0x504726;});}return null;};}function removeEntity(_0x506876,_0x4dd81b){return function(_0x102622){if(_0x102622){return _0x102622[_0x646b('0x23')]()[_0x646b('0x24')](function(){_0x506876[_0x646b('0x19')](0xcc)[_0x646b('0x1a')]();});}};}function handleEntityNotFound(_0x2e9139,_0x4f6d03){return function(_0x26bccd){if(!_0x26bccd){_0x2e9139['sendStatus'](0x194);}return _0x26bccd;};}function handleError(_0x77b121,_0x4def36){_0x4def36=_0x4def36||0x1f4;return function(_0x220316){logger[_0x646b('0x25')](_0x220316[_0x646b('0x26')]);if(_0x220316['name']){delete _0x220316[_0x646b('0x27')];}_0x77b121[_0x646b('0x19')](_0x4def36)[_0x646b('0x28')](_0x220316);};}exports[_0x646b('0x29')]=function(_0x3272a4,_0x6e8efb){var _0xd528c5={},_0xb060ec={},_0x3b73b5={'count':0x0,'rows':[]};var _0x3f6dba=_[_0x646b('0x2a')](db[_0x646b('0x2b')]['rawAttributes'],function(_0x18e50a){return{'name':_0x18e50a['fieldName'],'type':_0x18e50a['type'][_0x646b('0x2c')]};});_0xb060ec[_0x646b('0x2d')]=_[_0x646b('0x2a')](_0x3f6dba,_0x646b('0x27'));_0xb060ec['query']=_[_0x646b('0x2e')](_0x3272a4[_0x646b('0x2f')]);_0xb060ec[_0x646b('0x30')]=_[_0x646b('0x31')](_0xb060ec[_0x646b('0x2d')],_0xb060ec[_0x646b('0x2f')]);_0xd528c5[_0x646b('0x32')]=_[_0x646b('0x31')](_0xb060ec[_0x646b('0x2d')],qs[_0x646b('0x33')](_0x3272a4['query'][_0x646b('0x33')]));_0xd528c5[_0x646b('0x32')]=_0xd528c5['attributes'][_0x646b('0x34')]?_0xd528c5['attributes']:_0xb060ec[_0x646b('0x2d')];if(!_0x3272a4[_0x646b('0x2f')][_0x646b('0x35')](_0x646b('0x36'))){_0xd528c5[_0x646b('0x1c')]=qs[_0x646b('0x1c')](_0x3272a4[_0x646b('0x2f')][_0x646b('0x1c')]);_0xd528c5['offset']=qs['offset'](_0x3272a4[_0x646b('0x2f')][_0x646b('0x1e')]);}_0xd528c5[_0x646b('0x37')]=qs[_0x646b('0x38')](_0x3272a4[_0x646b('0x2f')]['sort']);_0xd528c5[_0x646b('0x39')]=qs[_0x646b('0x30')](_[_0x646b('0x3a')](_0x3272a4[_0x646b('0x2f')],_0xb060ec[_0x646b('0x30')]),_0x3f6dba);if(_0x3272a4[_0x646b('0x2f')]['filter']){_0xd528c5[_0x646b('0x39')]=_[_0x646b('0x3b')](_0xd528c5[_0x646b('0x39')],{'$or':_['map'](_0x3f6dba,function(_0x47aa27){if(_0x47aa27[_0x646b('0x3c')]!==_0x646b('0x3d')){var _0x49e886={};_0x49e886[_0x47aa27[_0x646b('0x27')]]={'$like':'%'+_0x3272a4[_0x646b('0x2f')][_0x646b('0x3e')]+'%'};return _0x49e886;}})});}_0xd528c5=_[_0x646b('0x3b')]({},_0xd528c5,_0x3272a4[_0x646b('0x3f')]);var _0x247248={'where':_0xd528c5[_0x646b('0x39')]};return db['UserProfile'][_0x646b('0x1d')](_0x247248)[_0x646b('0x24')](function(_0x250638){_0x3b73b5[_0x646b('0x1d')]=_0x250638;if(_0x3272a4[_0x646b('0x2f')]['includeAll']){_0xd528c5['include']=[{'all':!![]}];}return db[_0x646b('0x2b')][_0x646b('0x40')](_0xd528c5);})[_0x646b('0x24')](function(_0x541387){_0x3b73b5[_0x646b('0x41')]=_0x541387;return _0x3b73b5;})[_0x646b('0x24')](respondWithFilteredResult(_0x6e8efb,_0xd528c5))[_0x646b('0x42')](handleError(_0x6e8efb,null));};exports[_0x646b('0x43')]=function(_0x182b38,_0x3fe176){var _0x19b9ca={'raw':![],'where':{'id':_0x182b38[_0x646b('0x44')]['id']}},_0x2017e0={};_0x2017e0['model']=_['keys'](db['UserProfile'][_0x646b('0x45')]);_0x2017e0[_0x646b('0x2f')]=_['keys'](_0x182b38['query']);_0x2017e0[_0x646b('0x30')]=_['intersection'](_0x2017e0['model'],_0x2017e0[_0x646b('0x2f')]);_0x19b9ca[_0x646b('0x32')]=_[_0x646b('0x31')](_0x2017e0[_0x646b('0x2d')],qs['fields'](_0x182b38['query'][_0x646b('0x33')]));_0x19b9ca['attributes']=_0x19b9ca[_0x646b('0x32')][_0x646b('0x34')]?_0x19b9ca['attributes']:_0x2017e0[_0x646b('0x2d')];if(_0x182b38[_0x646b('0x2f')][_0x646b('0x46')]){_0x19b9ca['include']=[{'all':!![]}];}_0x19b9ca=_[_0x646b('0x3b')]({},_0x19b9ca,_0x182b38['options']);return db['UserProfile'][_0x646b('0x47')](_0x19b9ca)['then'](handleEntityNotFound(_0x3fe176,null))[_0x646b('0x24')](respondWithResult(_0x3fe176,null))[_0x646b('0x42')](handleError(_0x3fe176,null));};exports['create']=function(_0x553ea3,_0x262446){return db[_0x646b('0x2b')]['create'](_0x553ea3['body'],{})[_0x646b('0x24')](respondWithResult(_0x262446,0xc9))[_0x646b('0x42')](handleError(_0x262446,null));};exports[_0x646b('0x48')]=function(_0xe75544,_0x55ff1b){var _0x3f0de9={'where':{'id':_0xe75544[_0x646b('0x44')]['id']}},_0x3ebcdc={};_0x3ebcdc[_0x646b('0x2d')]=_[_0x646b('0x2e')](db[_0x646b('0x2b')]['rawAttributes']);_0x3f0de9[_0x646b('0x32')]=_[_0x646b('0x31')](_0x3ebcdc['model'],qs['fields'](_0xe75544['query'][_0x646b('0x33')]));_0x3f0de9[_0x646b('0x32')]=_0x3f0de9[_0x646b('0x32')]['length']?_0x3f0de9[_0x646b('0x32')]:_0x3ebcdc[_0x646b('0x2d')];if(_0xe75544[_0x646b('0x2f')][_0x646b('0x46')]){_0x3f0de9['include']=[{'all':!![]}];}_0x3f0de9=_[_0x646b('0x3b')]({},_0x3f0de9,_0xe75544['options']);return db[_0x646b('0x2b')][_0x646b('0x47')](_0x3f0de9)[_0x646b('0x24')](handleEntityNotFound(_0x55ff1b,null))['then'](function(_0xe01947){if(_0xe01947){var _0xb965c7=_0xe01947[_0x646b('0x49')]({'plain':!![]});_0xb965c7=qs[_0x646b('0x4a')](_0xb965c7,['id',_0x646b('0x4b'),_0x646b('0x4c'),'crudPermissions']);_0xe75544[_0x646b('0x4d')]=_[_0x646b('0x4a')](_0xe75544[_0x646b('0x4d')],['id',_0x646b('0x4b'),_0x646b('0x4c')]);return db['sequelize']['transaction'](function(_0x285f90){return db[_0x646b('0x2b')][_0x646b('0x4e')](_['merge'](_0xb965c7,_0xe75544[_0x646b('0x4d')]),{'include':_0xe75544[_0x646b('0x2f')][_0x646b('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x285f90})[_0x646b('0x24')](function(_0x165fa4){var _0x2f9b56=_0x165fa4['get']({'plain':!![]});return db[_0x646b('0x4f')]['findAll']({'where':{'userProfileId':_0xe75544['params']['id']},'raw':!![]})[_0x646b('0x24')](function(_0x325a29){if(_0x325a29){return BPromise[_0x646b('0x50')](_0x325a29,function(_0x368443){return new BPromise(function(_0x24c894,_0xd53b2b){if(_0x368443[_0x646b('0x51')]===null||_0x368443[_0x646b('0x51')]===0x1)_0x24c894(null);return db[_0x646b('0x52')]['findAll']({'where':{'sectionId':_0x368443['id']},'raw':!![]})[_0x646b('0x24')](function(_0x193d35){var _0x1e4ffc=_['map'](_0x193d35,function(_0x5b16cb){return qs[_0x646b('0x4a')](_0x5b16cb,['id',_0x646b('0x4b'),_0x646b('0x4c'),_0x646b('0x53')]);});_0x24c894(_0x1e4ffc);})[_0x646b('0x42')](function(_0x1c5fdc){_0xd53b2b(_0x1c5fdc);});})[_0x646b('0x24')](function(_0x1d4c9d){var _0x409918=qs[_0x646b('0x4a')](_0x368443,['id',_0x646b('0x4b'),_0x646b('0x4c')]);_0x409918[_0x646b('0x54')]=_0x2f9b56['id'];if(_0x1d4c9d)_0x409918[_0x646b('0x55')]=_0x1d4c9d;return _0x409918;})['then'](function(_0x39b160){return db['UserProfileSection'][_0x646b('0x4e')](_0x39b160,{'include':[{'model':db['UserProfileResource'],'as':_0x646b('0x55')}],'raw':!![],'transaction':_0x285f90});});})['then'](function(){return _0x2f9b56;});}});});});}})[_0x646b('0x24')](respondWithResult(_0x55ff1b,0xc9))[_0x646b('0x42')](handleError(_0x55ff1b,null));};exports[_0x646b('0x22')]=function(_0x58077a,_0x44100a){if(_0x58077a['body']['id']){delete _0x58077a[_0x646b('0x4d')]['id'];}return db[_0x646b('0x2b')][_0x646b('0x47')]({'where':{'id':_0x58077a[_0x646b('0x44')]['id']}})['then'](handleEntityNotFound(_0x44100a,null))[_0x646b('0x24')](saveUpdates(_0x58077a[_0x646b('0x4d')],null))[_0x646b('0x24')](respondWithResult(_0x44100a,null))['catch'](handleError(_0x44100a,null));};exports[_0x646b('0x23')]=function(_0xbdd999,_0x112361){return db[_0x646b('0x2b')][_0x646b('0x47')]({'where':{'id':_0xbdd999['params']['id']}})[_0x646b('0x24')](handleEntityNotFound(_0x112361,null))['then'](removeEntity(_0x112361,null))[_0x646b('0x42')](handleError(_0x112361,null));};exports['describe']=function(_0x235ceb,_0x160c92){return db[_0x646b('0x2b')][_0x646b('0x56')]()[_0x646b('0x24')](respondWithResult(_0x160c92,null))[_0x646b('0x42')](handleError(_0x160c92,null));};exports[_0x646b('0x57')]=function(_0x2d6442,_0x8c94fa){var _0x4b0902=_0x2d6442[_0x646b('0x4d')];return db[_0x646b('0x2b')]['find']({'where':{'id':_0x2d6442[_0x646b('0x44')]['id']}})[_0x646b('0x24')](handleEntityNotFound(_0x8c94fa,null))[_0x646b('0x24')](function(_0xb03ae8){if(_0xb03ae8){return db[_0x646b('0x58')]['transaction'](function(_0x2f193d){return db['UserProfileSection'][_0x646b('0x23')]({'where':{'userProfileId':_0x2d6442[_0x646b('0x44')]['id'],'sectionId':_[_0x646b('0x2a')](_0x4b0902,function(_0x516758){return _0x516758[_0x646b('0x53')];})},'transaction':_0x2f193d})[_0x646b('0x24')](function(){var _0x592a7b=_['map'](_0x4b0902,function(_0x53aaff){_0x53aaff['userProfileId']=_0x2d6442[_0x646b('0x44')]['id'];return _0x53aaff;});var _0x449ea9=[];return BPromise[_0x646b('0x50')](_0x592a7b,function(_0x1dce05){return db[_0x646b('0x4f')][_0x646b('0x4e')](_0x1dce05,{'include':[{'model':db[_0x646b('0x52')],'as':_0x646b('0x55')}],'raw':!![],'transaction':_0x2f193d})['then'](function(_0x2d16ab){_0x449ea9['push'](_0x2d16ab[_0x646b('0x49')]({'plain':!![]}));});})[_0x646b('0x24')](function(){return _0x449ea9;});});});}})[_0x646b('0x24')](function(_0x3deb58){return _0x3deb58;})['then'](respondWithResult(_0x8c94fa,null))[_0x646b('0x42')](handleError(_0x8c94fa,null));};exports[_0x646b('0x59')]=function(_0x216824,_0x28f718){var _0x3c7c97;return db[_0x646b('0x2b')][_0x646b('0x47')]({'where':{'id':_0x216824[_0x646b('0x44')]['id']},'attributes':['id',_0x646b('0x27')]})[_0x646b('0x24')](handleEntityNotFound(_0x28f718,null))[_0x646b('0x24')](function(_0x522d87){if(_0x522d87){_0x3c7c97=_0x522d87;return db[_0x646b('0x4f')]['destroy']({'where':{'userProfileId':_0x216824[_0x646b('0x44')]['id'],'sectionId':_0x216824['query']['ids']}});}})[_0x646b('0x24')](function(){return _0x3c7c97;})[_0x646b('0x24')](respondWithStatusCode(_0x28f718,null))[_0x646b('0x42')](handleError(_0x28f718,null));};exports[_0x646b('0x5a')]=function(_0x2f5624,_0x26760b){var _0x5f22a6=[];var _0x1ccba3=[];return db[_0x646b('0x4f')]['findAll']({'where':{'userProfileId':_0x2f5624[_0x646b('0x44')]['id']},'raw':!![]})['then'](function(_0x3868d4){_0x5f22a6=_[_0x646b('0x3e')](_0x3868d4,function(_0x2bc349){return _0x2bc349[_0x646b('0x5b')]===0x1||_[_0x646b('0x5c')]([0x3eb,0x709],_0x2bc349[_0x646b('0x53')]);});if(!_['isEmpty'](_0x5f22a6)){return _[_0x646b('0x2a')](_0x5f22a6,function(_0x4f070b){return _0x4f070b[_0x646b('0x53')];});}else{return;}})[_0x646b('0x24')](function(_0x3be160){if(_0x3be160)_0x1ccba3=_0x3be160;if(_[_0x646b('0x5c')](_0x1ccba3,0x64)){var _0x47ec34=_['find'](_0x5f22a6,{'sectionId':0x64});return hasDefaultDashboard(_0x47ec34)[_0x646b('0x24')](function(_0x23bc26){return _[_0x646b('0x2a')](_0x5f22a6,function(_0x383a7b){if(_0x383a7b[_0x646b('0x53')]===0x64){_0x383a7b[_0x646b('0x5d')]=_0x23bc26;}return _0x383a7b;});});}else{return;}})[_0x646b('0x24')](function(_0x4bf663){if(_0x4bf663)_0x5f22a6=_0x4bf663;if(_[_0x646b('0x5c')](_0x1ccba3,0x3eb)){var _0xa7aea3=_[_0x646b('0x47')](_0x5f22a6,{'sectionId':0x3eb});return getCustomDashboards(_0xa7aea3)[_0x646b('0x24')](function(_0x40cedf){return _[_0x646b('0x2a')](_0x5f22a6,function(_0x59be8c){if(_0xa7aea3['enabled']){if(_0x59be8c[_0x646b('0x53')]===0x3eb){_0x59be8c[_0x646b('0x5d')]=_0x40cedf;}}else{if(_0x59be8c['sectionId']===0x64){if(!_0x59be8c[_0x646b('0x5d')]){_0x59be8c['subsections']=[];}_0x59be8c[_0x646b('0x5d')]=_0x59be8c[_0x646b('0x5d')][_0x646b('0x5e')](_0x40cedf);}}return _0x59be8c;});});}else{return;}})[_0x646b('0x24')](function(_0x31cab4){if(_0x31cab4)_0x5f22a6=_0x31cab4;if(_[_0x646b('0x5c')](_0x1ccba3,0x709)){var _0x1e9b3c=_[_0x646b('0x47')](_0x5f22a6,{'sectionId':0x709});return getPlugins(_0x1e9b3c)[_0x646b('0x24')](function(_0x3fda89){if(_0x1e9b3c[_0x646b('0x5b')]){return _['map'](_0x5f22a6,function(_0x26c04e){if(_0x26c04e[_0x646b('0x53')]===0x709){_0x26c04e['subsections']=_0x3fda89;}return _0x26c04e;});}else{var _0x339d89={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3fda89};var _0x2a1897=_[_0x646b('0x2a')](_0x5f22a6);_0x2a1897[_0x646b('0x5f')](_0x339d89);return _0x2a1897;}});}else{return;}})[_0x646b('0x24')](function(_0x46fef0){if(_0x46fef0)_0x5f22a6=_0x46fef0;return _[_0x646b('0x3e')](_0x5f22a6,[_0x646b('0x5b'),0x1]);})['then'](respondWithResult(_0x26760b,null))[_0x646b('0x42')](handleError(_0x26760b,null));};function hasDefaultDashboard(_0x39249f){var _0x107862=[0x65];return new BPromise(function(_0x5f5793,_0x5a222e){try{if(_0x39249f[_0x646b('0x51')]){_0x5f5793(_0x107862);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x39249f['id']},'raw':!![]})[_0x646b('0x24')](function(_0x46fa08){_0x46fa08?_0x5f5793(_0x107862):_0x5f5793();});}}catch(_0x43fc1a){_0x5a222e(_0x43fc1a);}});}function getCustomDashboards(_0x19a30a){var _0x5594ad=[];return new BPromise(function(_0x30ca9a,_0x39a8cd){try{if(_0x19a30a[_0x646b('0x51')]){return db[_0x646b('0x60')][_0x646b('0x40')]({'raw':!![]})[_0x646b('0x24')](function(_0x5489b1){_0x5489b1[_0x646b('0x61')](function(_0x1198cf){_0x5594ad['push'](_0x1198cf['id']+0x1869f);});_0x30ca9a(_0x5594ad);});}else{return db[_0x646b('0x52')][_0x646b('0x40')]({'where':{'sectionId':_0x19a30a['id']},'raw':!![]})[_0x646b('0x24')](function(_0x178281){_0x178281[_0x646b('0x61')](function(_0x38768a){_0x5594ad[_0x646b('0x5f')](_0x38768a[_0x646b('0x62')]+0x1869f);});_0x30ca9a(_0x5594ad);});}}catch(_0x2e7fe4){_0x39a8cd(_0x2e7fe4);}});}function getPlugins(_0xb2abc0){var _0x56444a=[];return new BPromise(function(_0x4c1897,_0x3d19a3){try{if(_0xb2abc0[_0x646b('0x51')]){return db[_0x646b('0x63')]['findAll']({'raw':!![]})[_0x646b('0x24')](function(_0x5ad4c3){_0x5ad4c3[_0x646b('0x61')](function(_0x4b313e){_0x56444a[_0x646b('0x5f')](_0x4b313e['id']+0x15b38);});_0x4c1897(_0x56444a);});}else{return db['UserProfileResource'][_0x646b('0x40')]({'where':{'sectionId':_0xb2abc0['id']},'raw':!![]})['then'](function(_0x327c16){_0x327c16[_0x646b('0x61')](function(_0x53edb1){_0x56444a[_0x646b('0x5f')](_0x53edb1['resourceId']+0x15b38);});_0x4c1897(_0x56444a);});}}catch(_0x6562b1){_0x3d19a3(_0x6562b1);}});}exports['addResources']=function(_0x31b7c4,_0x10aae9){return db[_0x646b('0x2b')][_0x646b('0x47')]({'where':{'id':_0x31b7c4[_0x646b('0x44')]['id']}})[_0x646b('0x24')](handleEntityNotFound(_0x10aae9,null))[_0x646b('0x24')](function(_0x28bd23){if(_0x28bd23){return db[_0x646b('0x58')][_0x646b('0x64')](function(_0x22984f){return db[_0x646b('0x4f')]['findAll']({'where':{'userProfileId':_0x31b7c4[_0x646b('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x646b('0x24')](function(_0x13c381){if(_0x13c381){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x31b7c4[_0x646b('0x44')]['id'],'id':_['map'](_0x13c381,function(_0x3ace70){return _0x3ace70['id'];})},'transaction':_0x22984f});}})[_0x646b('0x24')](function(_0x5c421a){var _0x10c085=_['map'](_0x31b7c4[_0x646b('0x4d')],function(_0x101299){_0x101299['userProfileId']=_0x31b7c4[_0x646b('0x44')]['id'];return _0x101299;});return db[_0x646b('0x4f')][_0x646b('0x65')](_0x10c085,{'raw':!![],'transaction':_0x22984f});})[_0x646b('0x24')](function(_0x4db871){var _0x56d09b=_[_0x646b('0x3e')](_[_0x646b('0x2a')](_0x4db871,function(_0x33e841){return _0x33e841[_0x646b('0x49')]({'plain':!![]});}),{'includeAll':![]});if(_0x56d09b){return db[_0x646b('0x4f')]['findAll']({'where':{'userProfileId':_0x31b7c4[_0x646b('0x44')]['id'],'sectionId':_[_0x646b('0x2a')](_0x56d09b,function(_0x5715bf){return _0x5715bf[_0x646b('0x53')];})},'attributes':['id',_0x646b('0x53')],'raw':!![]})[_0x646b('0x24')](function(_0x307c2f){var _0x22820b=_[_0x646b('0x2a')](_0x31b7c4[_0x646b('0x4d')],function(_0x223685){_0x223685['userProfileId']=_0x31b7c4[_0x646b('0x44')]['id'];return _0x223685;});return db['UserProfileResource'][_0x646b('0x65')](_0x22820b,{'raw':!![],'transaction':_0x22984f});});}})[_0x646b('0x42')](handleError(_0x10aae9,null));});}})[_0x646b('0x24')](function(_0x41ebf3){var _0xa42cab=_[_0x646b('0x2a')](_0x41ebf3,function(_0x306764){return _0x306764['get']({'plain':!![]});});})[_0x646b('0x24')](respondWithResult(_0x10aae9,null))['catch'](handleError(_0x10aae9,null));};exports[_0x646b('0x66')]=function(_0x54af14,_0x19a783,_0x22ee43){return db[_0x646b('0x2b')][_0x646b('0x47')]({'where':{'id':_0x54af14[_0x646b('0x44')]['id']}})['then'](handleEntityNotFound(_0x19a783,null))[_0x646b('0x24')](function(_0x34c591){if(_0x34c591){return _0x34c591[_0x646b('0x66')](_0x54af14[_0x646b('0x2f')][_0x646b('0x67')]);}})['then'](respondWithStatusCode(_0x19a783,null))[_0x646b('0x42')](handleError(_0x19a783,null));};exports[_0x646b('0x68')]=function(_0x3152c8,_0x42be43){var _0xa020a1={};if(!_0x3152c8['query'][_0x646b('0x69')])throw new Error(_0x646b('0x6a'));if(!_0x3152c8[_0x646b('0x2f')]['hasOwnProperty']('nolimit')){_0xa020a1[_0x646b('0x1c')]=qs[_0x646b('0x1c')](_0x3152c8[_0x646b('0x2f')][_0x646b('0x1c')]);_0xa020a1[_0x646b('0x1e')]=qs['offset'](_0x3152c8[_0x646b('0x2f')][_0x646b('0x1e')]);}return db[_0x646b('0x2b')]['find']({'where':{'id':_0x3152c8[_0x646b('0x44')]['id']}})[_0x646b('0x24')](function(_0x5cc60c){if(!_0x5cc60c)throw new Error(_0x646b('0x6b')+_0x3152c8[_0x646b('0x44')]['id']);return db[_0x646b('0x2b')]['getResources'](_0x3152c8);})[_0x646b('0x24')](respondWithFilteredResult(_0x42be43,_0xa020a1))[_0x646b('0x42')](handleError(_0x42be43,null));};
\ No newline at end of file
+var _0x2e27=['forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','send','map','UserProfile','rawAttributes','fieldName','key','model','name','query','intersection','attributes','fields','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','then','catch','show','keys','length','options','find','body','clone','params','omit','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','createdAt','userProfileId','Resources','create','destroy','describe','addSections','sectionId','push','get','removeSections','getSections','enabled','isEmpty','includes','subsections','concat','findOne','Dashboard'];(function(_0x37e890,_0x38dfa4){var _0x299034=function(_0x261887){while(--_0x261887){_0x37e890['push'](_0x37e890['shift']());}};_0x299034(++_0x38dfa4);}(_0x2e27,0x82));var _0x72e2=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x2e27[_0x81dcac];return _0xc7803b;};'use strict';var emlformat=require(_0x72e2('0x0'));var rimraf=require(_0x72e2('0x1'));var zipdir=require(_0x72e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72e2('0x3'));var moment=require(_0x72e2('0x4'));var BPromise=require(_0x72e2('0x5'));var Mustache=require(_0x72e2('0x6'));var util=require('util');var path=require(_0x72e2('0x7'));var sox=require(_0x72e2('0x8'));var csv=require(_0x72e2('0x9'));var ejs=require(_0x72e2('0xa'));var fs=require('fs');var fs_extra=require(_0x72e2('0xb'));var _=require(_0x72e2('0xc'));var squel=require(_0x72e2('0xd'));var crypto=require('crypto');var jsforce=require(_0x72e2('0xe'));var deskjs=require(_0x72e2('0xf'));var toCsv=require(_0x72e2('0x9'));var querystring=require(_0x72e2('0x10'));var Papa=require('papaparse');var Redis=require(_0x72e2('0x11'));var authService=require(_0x72e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x72e2('0x13'));var hardwareService=require(_0x72e2('0x14'));var logger=require(_0x72e2('0x15'))(_0x72e2('0x16'));var utils=require(_0x72e2('0x17'));var config=require(_0x72e2('0x18'));var licenseUtil=require(_0x72e2('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x72e2('0x1a'),'port':0x18eb});var socket=require(_0x72e2('0x1b'))(new Redis(config[_0x72e2('0x1c')]));require('./userProfile.socket')[_0x72e2('0x1d')](socket);function respondWithStatusCode(_0x81d0ef,_0x36c660){_0x36c660=_0x36c660||0xcc;return function(_0x9ad057){if(_0x9ad057){return _0x81d0ef['sendStatus'](_0x36c660);}return _0x81d0ef[_0x72e2('0x1e')](_0x36c660)[_0x72e2('0x1f')]();};}function respondWithResult(_0x3caca1,_0xb37418){_0xb37418=_0xb37418||0xc8;return function(_0x5cf953){if(_0x5cf953){return _0x3caca1[_0x72e2('0x1e')](_0xb37418)[_0x72e2('0x20')](_0x5cf953);}};}function respondWithFilteredResult(_0x556c47,_0x4dbe5d){return function(_0x32976e){if(_0x32976e){var _0x2b337e=typeof _0x4dbe5d[_0x72e2('0x21')]===_0x72e2('0x22')&&typeof _0x4dbe5d[_0x72e2('0x23')]===_0x72e2('0x22');var _0x16f6e8=_0x32976e['count'];var _0x12d642=_0x2b337e?0x0:_0x4dbe5d[_0x72e2('0x21')];var _0x1c88a4=_0x2b337e?_0x32976e[_0x72e2('0x24')]:_0x4dbe5d[_0x72e2('0x21')]+_0x4dbe5d[_0x72e2('0x23')];var _0x586952;if(_0x1c88a4>=_0x16f6e8){_0x1c88a4=_0x16f6e8;_0x586952=0xc8;}else{_0x586952=0xce;}_0x556c47[_0x72e2('0x1e')](_0x586952);return _0x556c47[_0x72e2('0x25')](_0x72e2('0x26'),_0x12d642+'-'+_0x1c88a4+'/'+_0x16f6e8)[_0x72e2('0x20')](_0x32976e);}return null;};}function patchUpdates(_0x39b05e){return function(_0x41358d){try{jsonpatch[_0x72e2('0x27')](_0x41358d,_0x39b05e,!![]);}catch(_0x23b6a3){return BPromise[_0x72e2('0x28')](_0x23b6a3);}return _0x41358d[_0x72e2('0x29')]();};}function saveUpdates(_0x4a1aa8,_0x27d4af){return function(_0x210101){if(_0x210101){return _0x210101[_0x72e2('0x2a')](_0x4a1aa8)['then'](function(_0x481eaa){return _0x481eaa;});}return null;};}function removeEntity(_0x378c4e,_0x1cfc33){return function(_0x2f951e){if(_0x2f951e){return _0x2f951e['destroy']()['then'](function(){_0x378c4e[_0x72e2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x906d2,_0x21ef35){return function(_0x12b24c){if(!_0x12b24c){_0x906d2[_0x72e2('0x2b')](0x194);}return _0x12b24c;};}function handleError(_0x598ba1,_0x430273){_0x430273=_0x430273||0x1f4;return function(_0x597614){logger[_0x72e2('0x2c')](_0x597614[_0x72e2('0x2d')]);if(_0x597614['name']){delete _0x597614['name'];}_0x598ba1[_0x72e2('0x1e')](_0x430273)[_0x72e2('0x2e')](_0x597614);};}exports['index']=function(_0x31bb3,_0x1543a0){var _0x27addd={},_0x30ca87={},_0x260dae={'count':0x0,'rows':[]};var _0x51ec65=_[_0x72e2('0x2f')](db[_0x72e2('0x30')][_0x72e2('0x31')],function(_0x356519){return{'name':_0x356519[_0x72e2('0x32')],'type':_0x356519['type'][_0x72e2('0x33')]};});_0x30ca87[_0x72e2('0x34')]=_['map'](_0x51ec65,_0x72e2('0x35'));_0x30ca87[_0x72e2('0x36')]=_['keys'](_0x31bb3[_0x72e2('0x36')]);_0x30ca87['filters']=_[_0x72e2('0x37')](_0x30ca87[_0x72e2('0x34')],_0x30ca87['query']);_0x27addd[_0x72e2('0x38')]=_[_0x72e2('0x37')](_0x30ca87[_0x72e2('0x34')],qs[_0x72e2('0x39')](_0x31bb3['query'][_0x72e2('0x39')]));_0x27addd['attributes']=_0x27addd[_0x72e2('0x38')]['length']?_0x27addd[_0x72e2('0x38')]:_0x30ca87[_0x72e2('0x34')];if(!_0x31bb3[_0x72e2('0x36')]['hasOwnProperty'](_0x72e2('0x3a'))){_0x27addd['limit']=qs[_0x72e2('0x23')](_0x31bb3[_0x72e2('0x36')][_0x72e2('0x23')]);_0x27addd[_0x72e2('0x21')]=qs['offset'](_0x31bb3['query'][_0x72e2('0x21')]);}_0x27addd['order']=qs[_0x72e2('0x3b')](_0x31bb3[_0x72e2('0x36')]['sort']);_0x27addd[_0x72e2('0x3c')]=qs[_0x72e2('0x3d')](_['pick'](_0x31bb3[_0x72e2('0x36')],_0x30ca87[_0x72e2('0x3d')]),_0x51ec65);if(_0x31bb3[_0x72e2('0x36')][_0x72e2('0x3e')]){_0x27addd[_0x72e2('0x3c')]=_[_0x72e2('0x3f')](_0x27addd['where'],{'$or':_[_0x72e2('0x2f')](_0x51ec65,function(_0x37a2c6){if(_0x37a2c6['type']!==_0x72e2('0x40')){var _0x115ce2={};_0x115ce2[_0x37a2c6[_0x72e2('0x35')]]={'$like':'%'+_0x31bb3[_0x72e2('0x36')]['filter']+'%'};return _0x115ce2;}})});}_0x27addd=_[_0x72e2('0x3f')]({},_0x27addd,_0x31bb3['options']);var _0x1bf3e3={'where':_0x27addd[_0x72e2('0x3c')]};return db[_0x72e2('0x30')][_0x72e2('0x24')](_0x1bf3e3)['then'](function(_0xfe3369){_0x260dae['count']=_0xfe3369;if(_0x31bb3[_0x72e2('0x36')][_0x72e2('0x41')]){_0x27addd[_0x72e2('0x42')]=[{'all':!![]}];}return db[_0x72e2('0x30')][_0x72e2('0x43')](_0x27addd);})[_0x72e2('0x44')](function(_0x36f377){_0x260dae['rows']=_0x36f377;return _0x260dae;})[_0x72e2('0x44')](respondWithFilteredResult(_0x1543a0,_0x27addd))[_0x72e2('0x45')](handleError(_0x1543a0,null));};exports[_0x72e2('0x46')]=function(_0x2eaffb,_0x254082){var _0x1ee117={'raw':![],'where':{'id':_0x2eaffb['params']['id']}},_0x5f3e4a={};_0x5f3e4a[_0x72e2('0x34')]=_['keys'](db['UserProfile']['rawAttributes']);_0x5f3e4a[_0x72e2('0x36')]=_[_0x72e2('0x47')](_0x2eaffb[_0x72e2('0x36')]);_0x5f3e4a['filters']=_[_0x72e2('0x37')](_0x5f3e4a['model'],_0x5f3e4a[_0x72e2('0x36')]);_0x1ee117['attributes']=_['intersection'](_0x5f3e4a[_0x72e2('0x34')],qs[_0x72e2('0x39')](_0x2eaffb['query'][_0x72e2('0x39')]));_0x1ee117[_0x72e2('0x38')]=_0x1ee117[_0x72e2('0x38')][_0x72e2('0x48')]?_0x1ee117[_0x72e2('0x38')]:_0x5f3e4a[_0x72e2('0x34')];if(_0x2eaffb[_0x72e2('0x36')][_0x72e2('0x41')]){_0x1ee117['include']=[{'all':!![]}];}_0x1ee117=_['merge']({},_0x1ee117,_0x2eaffb[_0x72e2('0x49')]);return db[_0x72e2('0x30')][_0x72e2('0x4a')](_0x1ee117)['then'](handleEntityNotFound(_0x254082,null))[_0x72e2('0x44')](respondWithResult(_0x254082,null))['catch'](handleError(_0x254082,null));};exports['create']=function(_0x1569e6,_0x3d605f){return db[_0x72e2('0x30')]['create'](_0x1569e6[_0x72e2('0x4b')],{})[_0x72e2('0x44')](respondWithResult(_0x3d605f,0xc9))[_0x72e2('0x45')](handleError(_0x3d605f,null));};exports[_0x72e2('0x4c')]=function(_0x336897,_0x3f3465){var _0x2a8c19={'where':{'id':_0x336897[_0x72e2('0x4d')]['id']}},_0x43f915={};_0x43f915[_0x72e2('0x34')]=_[_0x72e2('0x47')](db[_0x72e2('0x30')][_0x72e2('0x31')]);_0x2a8c19[_0x72e2('0x38')]=_[_0x72e2('0x37')](_0x43f915[_0x72e2('0x34')],qs['fields'](_0x336897['query'][_0x72e2('0x39')]));_0x2a8c19['attributes']=_0x2a8c19[_0x72e2('0x38')][_0x72e2('0x48')]?_0x2a8c19[_0x72e2('0x38')]:_0x43f915[_0x72e2('0x34')];if(_0x336897['query'][_0x72e2('0x41')]){_0x2a8c19[_0x72e2('0x42')]=[{'all':!![]}];}_0x2a8c19=_[_0x72e2('0x3f')]({},_0x2a8c19,_0x336897['options']);return db[_0x72e2('0x30')][_0x72e2('0x4a')](_0x2a8c19)[_0x72e2('0x44')](handleEntityNotFound(_0x3f3465,null))[_0x72e2('0x44')](function(_0x45dd27){if(_0x45dd27){var _0x2d34fd=_0x45dd27['get']({'plain':!![]});_0x2d34fd=qs[_0x72e2('0x4e')](_0x2d34fd,['id','createdAt',_0x72e2('0x4f'),_0x72e2('0x50')]);_0x336897[_0x72e2('0x4b')]=_[_0x72e2('0x4e')](_0x336897[_0x72e2('0x4b')],['id','createdAt','updatedAt']);return db[_0x72e2('0x51')][_0x72e2('0x52')](function(_0x2a1a75){return db[_0x72e2('0x30')]['create'](_[_0x72e2('0x3f')](_0x2d34fd,_0x336897[_0x72e2('0x4b')]),{'include':_0x336897[_0x72e2('0x36')][_0x72e2('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x2a1a75})[_0x72e2('0x44')](function(_0x529d20){var _0x1def99=_0x529d20['get']({'plain':!![]});return db[_0x72e2('0x53')][_0x72e2('0x43')]({'where':{'userProfileId':_0x336897[_0x72e2('0x4d')]['id']},'raw':!![]})[_0x72e2('0x44')](function(_0x1dbe73){if(_0x1dbe73){return BPromise[_0x72e2('0x54')](_0x1dbe73,function(_0x36ac90){return new BPromise(function(_0x32357d,_0x40c352){if(_0x36ac90['autoAssociation']===null||_0x36ac90[_0x72e2('0x55')]===0x1)_0x32357d(null);return db[_0x72e2('0x56')][_0x72e2('0x43')]({'where':{'sectionId':_0x36ac90['id']},'raw':!![]})['then'](function(_0x50d64d){var _0x23fbba=_[_0x72e2('0x2f')](_0x50d64d,function(_0x5da61d){return qs['omit'](_0x5da61d,['id','createdAt','updatedAt','sectionId']);});_0x32357d(_0x23fbba);})['catch'](function(_0x1f2834){_0x40c352(_0x1f2834);});})['then'](function(_0x2bc8e4){var _0x370e86=qs[_0x72e2('0x4e')](_0x36ac90,['id',_0x72e2('0x57'),_0x72e2('0x4f')]);_0x370e86[_0x72e2('0x58')]=_0x1def99['id'];if(_0x2bc8e4)_0x370e86[_0x72e2('0x59')]=_0x2bc8e4;return _0x370e86;})[_0x72e2('0x44')](function(_0x4f58d4){return db['UserProfileSection'][_0x72e2('0x5a')](_0x4f58d4,{'include':[{'model':db[_0x72e2('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x2a1a75});});})[_0x72e2('0x44')](function(){return _0x1def99;});}});});});}})[_0x72e2('0x44')](respondWithResult(_0x3f3465,0xc9))[_0x72e2('0x45')](handleError(_0x3f3465,null));};exports[_0x72e2('0x2a')]=function(_0x145bb3,_0x57b784){if(_0x145bb3[_0x72e2('0x4b')]['id']){delete _0x145bb3[_0x72e2('0x4b')]['id'];}return db[_0x72e2('0x30')][_0x72e2('0x4a')]({'where':{'id':_0x145bb3[_0x72e2('0x4d')]['id']}})[_0x72e2('0x44')](handleEntityNotFound(_0x57b784,null))[_0x72e2('0x44')](saveUpdates(_0x145bb3[_0x72e2('0x4b')],null))[_0x72e2('0x44')](respondWithResult(_0x57b784,null))[_0x72e2('0x45')](handleError(_0x57b784,null));};exports[_0x72e2('0x5b')]=function(_0x3d96cc,_0x12d8a9){return db[_0x72e2('0x30')][_0x72e2('0x4a')]({'where':{'id':_0x3d96cc[_0x72e2('0x4d')]['id']}})[_0x72e2('0x44')](handleEntityNotFound(_0x12d8a9,null))[_0x72e2('0x44')](removeEntity(_0x12d8a9,null))['catch'](handleError(_0x12d8a9,null));};exports[_0x72e2('0x5c')]=function(_0x189ed9,_0x5c3373){return db[_0x72e2('0x30')][_0x72e2('0x5c')]()[_0x72e2('0x44')](respondWithResult(_0x5c3373,null))[_0x72e2('0x45')](handleError(_0x5c3373,null));};exports[_0x72e2('0x5d')]=function(_0x1b8100,_0x1a4512){var _0x3b2387=_0x1b8100[_0x72e2('0x4b')];return db[_0x72e2('0x30')][_0x72e2('0x4a')]({'where':{'id':_0x1b8100[_0x72e2('0x4d')]['id']}})[_0x72e2('0x44')](handleEntityNotFound(_0x1a4512,null))[_0x72e2('0x44')](function(_0x4c8de5){if(_0x4c8de5){return db[_0x72e2('0x51')][_0x72e2('0x52')](function(_0x1f51e2){return db[_0x72e2('0x53')][_0x72e2('0x5b')]({'where':{'userProfileId':_0x1b8100[_0x72e2('0x4d')]['id'],'sectionId':_[_0x72e2('0x2f')](_0x3b2387,function(_0x55f5ac){return _0x55f5ac[_0x72e2('0x5e')];})},'transaction':_0x1f51e2})['then'](function(){var _0x40063c=_['map'](_0x3b2387,function(_0x5e7b8f){_0x5e7b8f[_0x72e2('0x58')]=_0x1b8100[_0x72e2('0x4d')]['id'];return _0x5e7b8f;});var _0x2fbfdf=[];return BPromise[_0x72e2('0x54')](_0x40063c,function(_0x3fad3e){return db['UserProfileSection'][_0x72e2('0x5a')](_0x3fad3e,{'include':[{'model':db[_0x72e2('0x56')],'as':_0x72e2('0x59')}],'raw':!![],'transaction':_0x1f51e2})[_0x72e2('0x44')](function(_0x142c07){_0x2fbfdf[_0x72e2('0x5f')](_0x142c07[_0x72e2('0x60')]({'plain':!![]}));});})[_0x72e2('0x44')](function(){return _0x2fbfdf;});});});}})[_0x72e2('0x44')](function(_0x401317){return _0x401317;})[_0x72e2('0x44')](respondWithResult(_0x1a4512,null))[_0x72e2('0x45')](handleError(_0x1a4512,null));};exports[_0x72e2('0x61')]=function(_0x3be895,_0x3fe862){var _0x354b2c;return db[_0x72e2('0x30')][_0x72e2('0x4a')]({'where':{'id':_0x3be895[_0x72e2('0x4d')]['id']},'attributes':['id',_0x72e2('0x35')]})['then'](handleEntityNotFound(_0x3fe862,null))[_0x72e2('0x44')](function(_0x25a5ed){if(_0x25a5ed){_0x354b2c=_0x25a5ed;return db[_0x72e2('0x53')][_0x72e2('0x5b')]({'where':{'userProfileId':_0x3be895[_0x72e2('0x4d')]['id'],'sectionId':_0x3be895[_0x72e2('0x36')]['ids']}});}})[_0x72e2('0x44')](function(){return _0x354b2c;})['then'](respondWithStatusCode(_0x3fe862,null))[_0x72e2('0x45')](handleError(_0x3fe862,null));};exports[_0x72e2('0x62')]=function(_0x59ede7,_0x24ab58){var _0x5aafd0=[];var _0x33b2c2=[];return db[_0x72e2('0x53')][_0x72e2('0x43')]({'where':{'userProfileId':_0x59ede7[_0x72e2('0x4d')]['id']},'raw':!![]})[_0x72e2('0x44')](function(_0x4496b5){_0x5aafd0=_[_0x72e2('0x3e')](_0x4496b5,function(_0x221d1b){return _0x221d1b[_0x72e2('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x221d1b[_0x72e2('0x5e')]);});if(!_[_0x72e2('0x64')](_0x5aafd0)){return _[_0x72e2('0x2f')](_0x5aafd0,function(_0x142e82){return _0x142e82[_0x72e2('0x5e')];});}else{return;}})['then'](function(_0x5467d4){if(_0x5467d4)_0x33b2c2=_0x5467d4;if(_[_0x72e2('0x65')](_0x33b2c2,0x64)){var _0x2d6e3e=_['find'](_0x5aafd0,{'sectionId':0x64});return hasDefaultDashboard(_0x2d6e3e)['then'](function(_0x3abe96){return _[_0x72e2('0x2f')](_0x5aafd0,function(_0x1db541){if(_0x1db541['sectionId']===0x64){_0x1db541[_0x72e2('0x66')]=_0x3abe96;}return _0x1db541;});});}else{return;}})[_0x72e2('0x44')](function(_0x98750){if(_0x98750)_0x5aafd0=_0x98750;if(_[_0x72e2('0x65')](_0x33b2c2,0x3eb)){var _0x8b05fa=_[_0x72e2('0x4a')](_0x5aafd0,{'sectionId':0x3eb});return getCustomDashboards(_0x8b05fa)['then'](function(_0xbe2347){return _['map'](_0x5aafd0,function(_0x8d8390){if(_0x8b05fa[_0x72e2('0x63')]){if(_0x8d8390[_0x72e2('0x5e')]===0x3eb){_0x8d8390[_0x72e2('0x66')]=_0xbe2347;}}else{if(_0x8d8390[_0x72e2('0x5e')]===0x64){if(!_0x8d8390['subsections']){_0x8d8390['subsections']=[];}_0x8d8390[_0x72e2('0x66')]=_0x8d8390[_0x72e2('0x66')][_0x72e2('0x67')](_0xbe2347);}}return _0x8d8390;});});}else{return;}})[_0x72e2('0x44')](function(_0x91008b){if(_0x91008b)_0x5aafd0=_0x91008b;if(_[_0x72e2('0x65')](_0x33b2c2,0x709)){var _0xcab64e=_[_0x72e2('0x4a')](_0x5aafd0,{'sectionId':0x709});return getPlugins(_0xcab64e)[_0x72e2('0x44')](function(_0x532e45){if(_0xcab64e[_0x72e2('0x63')]){return _[_0x72e2('0x2f')](_0x5aafd0,function(_0x3d3e5e){if(_0x3d3e5e[_0x72e2('0x5e')]===0x709){_0x3d3e5e['subsections']=_0x532e45;}return _0x3d3e5e;});}else{var _0x4df5af={'sectionId':0x76c,'enabled':0x1,'subsections':_0x532e45};var _0x5b346a=_[_0x72e2('0x2f')](_0x5aafd0);_0x5b346a[_0x72e2('0x5f')](_0x4df5af);return _0x5b346a;}});}else{return;}})['then'](function(_0x3d00b6){if(_0x3d00b6)_0x5aafd0=_0x3d00b6;return _['filter'](_0x5aafd0,[_0x72e2('0x63'),0x1]);})['then'](respondWithResult(_0x24ab58,null))[_0x72e2('0x45')](handleError(_0x24ab58,null));};function hasDefaultDashboard(_0x68ed32){var _0x10a44e=[0x65];return new BPromise(function(_0x284026,_0x151cad){try{if(_0x68ed32['autoAssociation']){_0x284026(_0x10a44e);}else{return db[_0x72e2('0x56')][_0x72e2('0x68')]({'where':{'sectionId':_0x68ed32['id']},'raw':!![]})['then'](function(_0x137583){_0x137583?_0x284026(_0x10a44e):_0x284026();});}}catch(_0x54e3f4){_0x151cad(_0x54e3f4);}});}function getCustomDashboards(_0x363fa4){var _0x4c0ce1=[];return new BPromise(function(_0x2d0428,_0x30553b){try{if(_0x363fa4[_0x72e2('0x55')]){return db[_0x72e2('0x69')][_0x72e2('0x43')]({'raw':!![]})['then'](function(_0x5c65d6){_0x5c65d6[_0x72e2('0x6a')](function(_0x3fc58b){_0x4c0ce1[_0x72e2('0x5f')](_0x3fc58b['id']+0x1869f);});_0x2d0428(_0x4c0ce1);});}else{return db['UserProfileResource'][_0x72e2('0x43')]({'where':{'sectionId':_0x363fa4['id']},'raw':!![]})[_0x72e2('0x44')](function(_0xad906a){_0xad906a[_0x72e2('0x6a')](function(_0x3bf1a1){_0x4c0ce1[_0x72e2('0x5f')](_0x3bf1a1[_0x72e2('0x6b')]+0x1869f);});_0x2d0428(_0x4c0ce1);});}}catch(_0x3bb64b){_0x30553b(_0x3bb64b);}});}function getPlugins(_0x3fee83){var _0x2b26be=[];return new BPromise(function(_0x3ba410,_0x43fdb2){try{if(_0x3fee83[_0x72e2('0x55')]){return db[_0x72e2('0x6c')]['findAll']({'raw':!![]})[_0x72e2('0x44')](function(_0x2cbfa0){_0x2cbfa0[_0x72e2('0x6a')](function(_0x1ce23f){_0x2b26be[_0x72e2('0x5f')](_0x1ce23f['id']+0x15b38);});_0x3ba410(_0x2b26be);});}else{return db[_0x72e2('0x56')]['findAll']({'where':{'sectionId':_0x3fee83['id']},'raw':!![]})[_0x72e2('0x44')](function(_0x4034c2){_0x4034c2[_0x72e2('0x6a')](function(_0x3a7319){_0x2b26be[_0x72e2('0x5f')](_0x3a7319[_0x72e2('0x6b')]+0x15b38);});_0x3ba410(_0x2b26be);});}}catch(_0x2b9c11){_0x43fdb2(_0x2b9c11);}});}exports[_0x72e2('0x6d')]=function(_0x2ac2c0,_0x1f4ff1){return db[_0x72e2('0x30')][_0x72e2('0x4a')]({'where':{'id':_0x2ac2c0[_0x72e2('0x4d')]['id']}})[_0x72e2('0x44')](handleEntityNotFound(_0x1f4ff1,null))[_0x72e2('0x44')](function(_0x253f14){if(_0x253f14){return db[_0x72e2('0x51')][_0x72e2('0x52')](function(_0x55a206){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2ac2c0[_0x72e2('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4a2f7a){if(_0x4a2f7a){return db[_0x72e2('0x53')][_0x72e2('0x5b')]({'where':{'userProfileId':_0x2ac2c0['params']['id'],'id':_[_0x72e2('0x2f')](_0x4a2f7a,function(_0x227b91){return _0x227b91['id'];})},'transaction':_0x55a206});}})[_0x72e2('0x44')](function(_0x57d9fb){var _0x4bf3bc=_[_0x72e2('0x2f')](_0x2ac2c0['body'],function(_0xe3de87){_0xe3de87['userProfileId']=_0x2ac2c0[_0x72e2('0x4d')]['id'];return _0xe3de87;});return db[_0x72e2('0x53')][_0x72e2('0x6e')](_0x4bf3bc,{'raw':!![],'transaction':_0x55a206});})[_0x72e2('0x44')](function(_0x2232de){var _0x483daf=_[_0x72e2('0x3e')](_[_0x72e2('0x2f')](_0x2232de,function(_0x1fff7a){return _0x1fff7a[_0x72e2('0x60')]({'plain':!![]});}),{'includeAll':![]});if(_0x483daf){return db[_0x72e2('0x53')][_0x72e2('0x43')]({'where':{'userProfileId':_0x2ac2c0[_0x72e2('0x4d')]['id'],'sectionId':_[_0x72e2('0x2f')](_0x483daf,function(_0x320ebd){return _0x320ebd[_0x72e2('0x5e')];})},'attributes':['id',_0x72e2('0x5e')],'raw':!![]})[_0x72e2('0x44')](function(_0x2be095){var _0x132481=_['map'](_0x2ac2c0[_0x72e2('0x4b')],function(_0x2f3dfb){_0x2f3dfb['userProfileId']=_0x2ac2c0[_0x72e2('0x4d')]['id'];return _0x2f3dfb;});return db['UserProfileResource'][_0x72e2('0x6e')](_0x132481,{'raw':!![],'transaction':_0x55a206});});}})[_0x72e2('0x45')](handleError(_0x1f4ff1,null));});}})[_0x72e2('0x44')](function(_0x34d05b){var _0x3015e7=_[_0x72e2('0x2f')](_0x34d05b,function(_0x38fa40){return _0x38fa40[_0x72e2('0x60')]({'plain':!![]});});})[_0x72e2('0x44')](respondWithResult(_0x1f4ff1,null))[_0x72e2('0x45')](handleError(_0x1f4ff1,null));};exports[_0x72e2('0x6f')]=function(_0xff8c69,_0x5e7e39,_0xa09924){return db['UserProfile'][_0x72e2('0x4a')]({'where':{'id':_0xff8c69[_0x72e2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e7e39,null))[_0x72e2('0x44')](function(_0x4110f5){if(_0x4110f5){return _0x4110f5['removeResources'](_0xff8c69[_0x72e2('0x36')][_0x72e2('0x70')]);}})[_0x72e2('0x44')](respondWithStatusCode(_0x5e7e39,null))[_0x72e2('0x45')](handleError(_0x5e7e39,null));};exports[_0x72e2('0x71')]=function(_0x541565,_0x4183a4){var _0x3810c3={};if(!_0x541565[_0x72e2('0x36')][_0x72e2('0x72')])throw new Error(_0x72e2('0x73'));if(!_0x541565[_0x72e2('0x36')][_0x72e2('0x74')](_0x72e2('0x3a'))){_0x3810c3[_0x72e2('0x23')]=qs[_0x72e2('0x23')](_0x541565[_0x72e2('0x36')][_0x72e2('0x23')]);_0x3810c3[_0x72e2('0x21')]=qs['offset'](_0x541565[_0x72e2('0x36')][_0x72e2('0x21')]);}return db[_0x72e2('0x30')]['find']({'where':{'id':_0x541565[_0x72e2('0x4d')]['id']}})[_0x72e2('0x44')](function(_0x373176){if(!_0x373176)throw new Error(_0x72e2('0x75')+_0x541565[_0x72e2('0x4d')]['id']);return db[_0x72e2('0x30')][_0x72e2('0x71')](_0x541565);})[_0x72e2('0x44')](respondWithFilteredResult(_0x4183a4,_0x3810c3))[_0x72e2('0x45')](handleError(_0x4183a4,null));};
\ No newline at end of file
index d1a0b4b..6621e48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d0b=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x122215,_0x1781ff){var _0x5636d2=function(_0x1e6475){while(--_0x1e6475){_0x122215['push'](_0x122215['shift']());}};_0x5636d2(++_0x1781ff);}(_0x2d0b,0x102));var _0xb2d0=function(_0x48bcd4,_0xf518df){_0x48bcd4=_0x48bcd4-0x0;var _0x1d7895=_0x2d0b[_0x48bcd4];return _0x1d7895;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xb2d0('0x0'))['db'][_0xb2d0('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb2d0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2d0('0x3'),'afterDestroy':_0xb2d0('0x4')};function emitEvent(_0x5baccf){return function(_0x43206c,_0x59c298,_0x134f40){UserProfileEvents['emit'](_0x5baccf+':'+_0x43206c['id'],_0x43206c);UserProfileEvents[_0xb2d0('0x5')](_0x5baccf,_0x43206c);_0x134f40(null);};}for(var e in events){if(events[_0xb2d0('0x6')](e)){var event=events[e];UserProfile[_0xb2d0('0x7')](e,emitEvent(event));}}module[_0xb2d0('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x3e24=['../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4646ff,_0x452e90){var _0x1e228e=function(_0x408475){while(--_0x408475){_0x4646ff['push'](_0x4646ff['shift']());}};_0x1e228e(++_0x452e90);}(_0x3e24,0x167));var _0x43e2=function(_0x195b7b,_0x547852){_0x195b7b=_0x195b7b-0x0;var _0x1c84de=_0x3e24[_0x195b7b];return _0x1c84de;};'use strict';var EventEmitter=require(_0x43e2('0x0'));var UserProfile=require(_0x43e2('0x1'))['db'][_0x43e2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x43e2('0x3')](0x0);var events={'afterCreate':_0x43e2('0x4'),'afterUpdate':'update','afterDestroy':_0x43e2('0x5')};function emitEvent(_0x1ff04b){return function(_0x5d2806,_0x1dd127,_0x18629c){UserProfileEvents[_0x43e2('0x6')](_0x1ff04b+':'+_0x5d2806['id'],_0x5d2806);UserProfileEvents[_0x43e2('0x6')](_0x1ff04b,_0x5d2806);_0x18629c(null);};}for(var e in events){if(events[_0x43e2('0x7')](e)){var event=events[e];UserProfile[_0x43e2('0x8')](e,emitEvent(event));}}module[_0x43e2('0x9')]=UserProfileEvents;
\ No newline at end of file
index 1f9e701..43551d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b6b=['isEmpty','length','find','params','all','push','model','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','merge','type','key','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','value','findAll','then','associatedResources','map','field','name','resolve','UserProfileResource','resourceId','catch','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','Agents','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','VoiceQueues','users','agents','Users','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Pause','scheduler','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','variables','Variable','Plugin','AnalyticExtractedReport','metrics','charAt','slice','SELECT','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27'];(function(_0x1ccd5a,_0x592a64){var _0x6f5d23=function(_0x29b23b){while(--_0x29b23b){_0x1ccd5a['push'](_0x1ccd5a['shift']());}};_0x6f5d23(++_0x592a64);}(_0x5b6b,0x19d));var _0xb5b6=function(_0x12a307,_0x5b5ed0){_0x12a307=_0x12a307-0x0;var _0x59ed57=_0x5b6b[_0x12a307];return _0x59ed57;};'use strict';var _=require('lodash');var attributes=require(_0xb5b6('0x0'));var qs=require(_0xb5b6('0x1'));var squel=require('squel');module[_0xb5b6('0x2')]=function(_0x3384a8){var _0x17156a=_0x3384a8[_0xb5b6('0x3')];function _0x5ede2b(_0x520d4f,_0x3c0aa2){return new Promise(function(_0x4a4b8e,_0x1d7a23){if(!_0x3c0aa2)return _0x4a4b8e(null);var _0x34b787=_0x3c0aa2[_0xb5b6('0x4')]?{[_0x3c0aa2['filter']['field']]:_0x3c0aa2[_0xb5b6('0x4')][_0xb5b6('0x5')]}:undefined;return _0x17156a[_0x520d4f][_0xb5b6('0x6')]({'where':_0x34b787,'raw':!![]})[_0xb5b6('0x7')](function(_0x4555fa){_0x3c0aa2[_0xb5b6('0x8')]=_[_0xb5b6('0x9')](_0x4555fa,'id');_0x4a4b8e(_0x3c0aa2);})['catch'](function(_0x1dc42c){_0x1d7a23(_0x1dc42c);});});}function _0x571e26(_0x212beb,_0x2dc3bf){return new Promise(function(_0x455e4d,_0x79bb26){var _0x554377=_0x212beb['filter']?{[_0x212beb['filter'][_0xb5b6('0xa')]]:_0x212beb['filter']['value']}:undefined;return _0x17156a[_0x212beb['model']][_0xb5b6('0x6')]({'where':_0x554377,'raw':!![]})[_0xb5b6('0x7')](function(_0x212a43){_0x2dc3bf[_0xb5b6('0x8')]=_[_0xb5b6('0x9')](_0x212a43,function(_0x53ff30){return _0x53ff30[_0xb5b6('0xb')];});_0x455e4d(_0x2dc3bf);})['catch'](function(_0x478f37){_0x79bb26(_0x478f37);});});}function _0xd8a1ff(_0x345577,_0x26ca26,_0x268eb0){if(!_0x26ca26)return Promise[_0xb5b6('0xc')](null);return new Promise(function(_0x141a7e,_0xd36628){return _0x17156a[_0xb5b6('0xd')][_0xb5b6('0x6')]({'where':{'sectionId':_0x26ca26['id']},'raw':!![]})[_0xb5b6('0x7')](function(_0x5d4541){if(_0x345577[_0xb5b6('0xa')]&&_0x345577[_0xb5b6('0xa')]!=='id'){_0x26ca26[_0xb5b6('0x8')]=_[_0xb5b6('0x9')](_0x5d4541,function(_0x4b574b){return _0x4b574b[_0x345577[_0xb5b6('0xa')]];});}else{if(_0x268eb0==='AnalyticExtractedReport'){_0x26ca26[_0xb5b6('0x8')]=_[_0xb5b6('0x9')](_0x5d4541,function(_0x329063){return{'id':_0x329063[_0xb5b6('0xe')],'type':_0x329063['type']};});}else{_0x26ca26[_0xb5b6('0x8')]=_['map'](_0x5d4541,function(_0x4bdf94){return _0x4bdf94[_0xb5b6('0xe')];});}}_0x141a7e(_0x26ca26);})[_0xb5b6('0xf')](function(_0x53bcd7){_0xd36628(_0x53bcd7);});});}function _0x286f86(_0x2394b2,_0x14a519){var _0x859428={'parentSections':[]};switch(_0x2394b2['toLowerCase']()){case _0xb5b6('0x10'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x12');break;case'odbc':_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x13');break;case _0xb5b6('0x14'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x15');_0x859428[_0xb5b6('0x16')]=[{'name':_0xb5b6('0x17'),'field':_0xb5b6('0xb'),'foreignKey':_0xb5b6('0x18')}];break;case _0xb5b6('0x19'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x1a');break;case _0xb5b6('0x1b'):_0x859428['childModel']=_0xb5b6('0x1c');_0x859428[_0xb5b6('0x16')]=[{'name':_0xb5b6('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0xb5b6('0x1e'):_0x859428[_0xb5b6('0x11')]='CmList';break;case _0xb5b6('0x1f'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x20');break;case _0xb5b6('0x21'):_0x859428['childModel']=_0xb5b6('0x22');break;case _0xb5b6('0x23'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x24');break;case _0xb5b6('0x25'):_0x859428['childModel']='ChatWebsite';break;case _0xb5b6('0x26'):_0x859428['childModel']='FaxQueue';break;case _0xb5b6('0x27'):_0x859428['childModel']=_0xb5b6('0x28');break;case _0xb5b6('0x29'):case _0xb5b6('0x2a'):case _0xb5b6('0x2b'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x2c');break;case _0xb5b6('0x2d'):_0x859428['childModel']='VoiceContext';break;case'voicemails':_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x2e');break;case'voicerecordings':_0x859428[_0xb5b6('0x11')]='VoiceRecording';_0x859428[_0xb5b6('0x16')]=[{'name':_0xb5b6('0x2f'),'field':'name','foreignKey':_0xb5b6('0x30'),'model':_0xb5b6('0x31'),'filter':{'field':_0xb5b6('0x32'),'value':[_0xb5b6('0x33')]}},{'name':_0xb5b6('0x34'),'field':_0xb5b6('0xb'),'foreignKey':_0xb5b6('0x30'),'model':_0xb5b6('0x31'),'filter':{'field':'role','value':[_0xb5b6('0x35')]}},{'name':'VoiceQueues','field':_0xb5b6('0xb'),'foreignKey':_0xb5b6('0x36'),'model':_0xb5b6('0x37'),'filter':{'field':'type','value':[_0xb5b6('0x38')]}},{'name':_0xb5b6('0x39'),'field':_0xb5b6('0xb'),'foreignKey':_0xb5b6('0x36'),'model':_0xb5b6('0x37'),'filter':{'field':'type','value':[_0xb5b6('0x3a')]}}];break;case'musiconholds':_0x859428[_0xb5b6('0x11')]='VoiceMusicOnHold';break;case _0xb5b6('0x3b'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x3c');break;case _0xb5b6('0x3d'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x3e');break;case _0xb5b6('0x3f'):_0x859428['childModel']=_0xb5b6('0x40');break;case'mailqueues':_0x859428['childModel']='MailQueue';break;case'mailaccounts':_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x41');break;case _0xb5b6('0x42'):_0x859428[_0xb5b6('0x11')]='MailSubstatus';break;case _0xb5b6('0x43'):_0x859428['childModel']='OpenchannelQueue';break;case _0xb5b6('0x44'):_0x859428['childModel']=_0xb5b6('0x45');break;case'smsqueues':_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x46');break;case _0xb5b6('0x47'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x48');break;case _0xb5b6('0x49'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x4a');break;case _0xb5b6('0x4b'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x4c');break;case _0xb5b6('0x4d'):_0x859428[_0xb5b6('0x11')]='Team';break;case _0xb5b6('0x4e'):case _0xb5b6('0x4f'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x37');if(_0x14a519){_0x859428[_0xb5b6('0x16')]=[{'name':_0xb5b6('0x50')},{'name':'QueueCampaigns'}];}break;case _0xb5b6('0x51'):case _0xb5b6('0x52'):case'telephones':_0x859428[_0xb5b6('0x11')]='User';if(_0x14a519){_0x859428[_0xb5b6('0x16')]=[{'name':_0xb5b6('0x53'),'filter':{'field':'role','value':[_0xb5b6('0x54'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0xb5b6('0x34')}];}break;case _0xb5b6('0x55'):_0x859428[_0xb5b6('0x11')]='ZendeskAccount';break;case _0xb5b6('0x56'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x57');break;case _0xb5b6('0x58'):_0x859428['childModel']='FreshdeskAccount';break;case _0xb5b6('0x59'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x5a');break;case _0xb5b6('0x5b'):_0x859428['childModel']=_0xb5b6('0x5c');break;case'zohoaccounts':_0x859428[_0xb5b6('0x11')]='ZohoAccount';break;case _0xb5b6('0x5d'):_0x859428['childModel']=_0xb5b6('0x31');break;case _0xb5b6('0x5e'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x5f');break;case _0xb5b6('0x60'):_0x859428[_0xb5b6('0x11')]='Disposition';break;case _0xb5b6('0x61'):_0x859428['childModel']=_0xb5b6('0x62');break;case _0xb5b6('0x63'):_0x859428[_0xb5b6('0x11')]='Interval';break;case'pauses':_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x64');break;case _0xb5b6('0x65'):_0x859428[_0xb5b6('0x11')]='Schedule';break;case _0xb5b6('0x66'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x67');break;case _0xb5b6('0x68'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x69');break;case'templates':_0x859428['childModel']=_0xb5b6('0x6a');break;case _0xb5b6('0x6b'):_0x859428[_0xb5b6('0x11')]=_0xb5b6('0x6c');break;case _0xb5b6('0x6d'):_0x859428[_0xb5b6('0x11')]='Trunk';break;case _0xb5b6('0x6e'):_0x859428['childModel']=_0xb5b6('0x6f');break;case'plugins':_0x859428['childModel']=_0xb5b6('0x70');break;case'extractedreports':_0x859428['childModel']=_0xb5b6('0x71');_0x859428[_0xb5b6('0x16')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xb5b6('0x72'):_0x859428[_0xb5b6('0x11')]='AnalyticMetric';break;}return _0x859428;}function _0x574f37(_0x51097f,_0xa625b3){var _0x999c80=_0x51097f[_0xb5b6('0x73')](0x0)['toUpperCase']()+_0x51097f[_0xb5b6('0x74')](0x1);var _0x33c021={'type':_0x17156a['Sequelize']['QueryTypes'][_0xb5b6('0x75')],'raw':!![]};return new Promise(function(_0xf6656c,_0x21b3b2){var _0x3c3358=squel['select']()[_0xb5b6('0xa')]('ui.'+_0x999c80+_0xb5b6('0x76'),'id')[_0xb5b6('0xa')](_0xb5b6('0x77'))[_0xb5b6('0x78')](_0xb5b6('0x79')+_0x51097f+'_interactions','ui')[_0xb5b6('0x7a')](_0xb5b6('0x7b'),_0xa625b3['id']);return _0x17156a['sequelize'][_0xb5b6('0x7c')](_0x3c3358[_0xb5b6('0x7d')](),_0x33c021)['then'](function(_0x4acdd7){_0xa625b3[_0x999c80+_0xb5b6('0x7e')]=_0x4acdd7;_0xf6656c(_0x4acdd7);})[_0xb5b6('0xf')](function(_0x5f3cb1){_0x21b3b2(_0x5f3cb1);});});}return _0x3384a8[_0xb5b6('0x7f')]('UserProfile',attributes,{'tableName':_0xb5b6('0x80'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x6dedae){var _0x21ac69={'raw':_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x81')],'where':{}};var _0x2ab2a8={};var _0xd54394={'count':0x0,'rows':[]};var _0x311f1f=_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x82')];var _0x5280a4=_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x83')]||![];var _0x1cd928=_0x286f86(_0x311f1f,_0x5280a4);if(!_0x1cd928[_0xb5b6('0x11')])throw new Error(_0xb5b6('0x84')+_0x311f1f+'\x27');var _0x4336d3=[{'name':_0x311f1f}];if(!_[_0xb5b6('0x85')](_0x1cd928[_0xb5b6('0x16')]))_0x4336d3=_0x1cd928[_0xb5b6('0x16')];var _0x1a7d7d=[];for(var _0x4111d3=0x0;_0x4111d3<_0x4336d3[_0xb5b6('0x86')];_0x4111d3++){_0x1a7d7d['push'](_0x17156a['UserProfileSection'][_0xb5b6('0x87')]({'where':{'userProfileId':_0x6dedae[_0xb5b6('0x88')]['id'],'name':_0x4336d3[_0x4111d3][_0xb5b6('0xb')]},'raw':!![]}));}return Promise[_0xb5b6('0x89')](_0x1a7d7d)[_0xb5b6('0x7')](function(_0x38bba4){var _0x4e971a=_['filter'](_0x38bba4,function(_0x144ca5){return _0x144ca5?_0x144ca5:undefined;});var _0x58bdbb=_[_0xb5b6('0x4')](_0x4336d3,['ignore',!![]]);var _0x2dae0c=_[_0xb5b6('0x85')](_0x4e971a)&&_[_0xb5b6('0x85')](_0x58bdbb)?null:_['union'](_0x58bdbb,_0x4e971a);if(!_0x2dae0c)return null;var _0xdaf53b=[];for(var _0x119580=0x0;_0x119580<_0x2dae0c['length'];_0x119580++){var _0x2af613=_[_0xb5b6('0x87')](_0x4336d3,function(_0x2f52ef){return _0x2dae0c[_0x119580]?_0x2f52ef[_0xb5b6('0xb')]===_0x2dae0c[_0x119580]['name']:null;});if(_0x2af613){if(_0x2dae0c[_0x119580]['ignore']){_0xdaf53b[_0xb5b6('0x8a')](_0x5ede2b(_0x1cd928[_0xb5b6('0x11')],_0x2dae0c[_0x119580]));}else{if(!_0x2dae0c[_0x119580]['autoAssociation']){_0xdaf53b[_0xb5b6('0x8a')](_0xd8a1ff(_0x2af613,_0x2dae0c[_0x119580],_0x1cd928[_0xb5b6('0x11')]));}else{if(_0x2af613[_0xb5b6('0x8b')]){_0xdaf53b['push'](_0x571e26(_0x2af613,_0x2dae0c[_0x119580]));}}}}}return Promise[_0xb5b6('0x89')](_0xdaf53b);})[_0xb5b6('0x7')](function(_0x2056a6){var _0x10f655=_0x2056a6;var _0x138dfe=null;if(_0x10f655){_0x138dfe=_0x10f655[_0xb5b6('0x86')]===0x1?_0x10f655[0x0]:null;}if(!_0x138dfe&&!_0x10f655)return _0xd54394;var _0x44fc9f=_0x17156a[_0x1cd928[_0xb5b6('0x11')]][_0xb5b6('0x8c')];_0x2ab2a8[_0xb5b6('0x8b')]=_[_0xb5b6('0x8d')](_0x44fc9f);_0x2ab2a8['query']=_['keys'](_0x6dedae[_0xb5b6('0x7c')]);_0x2ab2a8['filters']=_[_0xb5b6('0x8e')](_0x2ab2a8[_0xb5b6('0x8b')],_0x2ab2a8[_0xb5b6('0x7c')]);_0x21ac69[_0xb5b6('0x8f')]=_[_0xb5b6('0x8e')](_0x2ab2a8[_0xb5b6('0x8b')],qs[_0xb5b6('0x90')](_0x6dedae['query'][_0xb5b6('0x90')]));_0x21ac69['attributes']=_0x21ac69[_0xb5b6('0x8f')][_0xb5b6('0x86')]?_0x21ac69[_0xb5b6('0x8f')]:_0x2ab2a8[_0xb5b6('0x8b')];if(!_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x91')](_0xb5b6('0x92'))){_0x21ac69[_0xb5b6('0x93')]=qs['limit'](_0x6dedae['query']['limit']);_0x21ac69[_0xb5b6('0x94')]=qs[_0xb5b6('0x94')](_0x6dedae['query'][_0xb5b6('0x94')]);}_0x21ac69[_0xb5b6('0x95')]=qs[_0xb5b6('0x96')](_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x96')]);_0x21ac69[_0xb5b6('0x7a')]=qs[_0xb5b6('0x97')](_['pick'](_0x6dedae[_0xb5b6('0x7c')],_0x2ab2a8['filters']));if(_0x6dedae['query'][_0xb5b6('0x4')]){_0x21ac69[_0xb5b6('0x7a')]=_[_0xb5b6('0x98')](_0x21ac69[_0xb5b6('0x7a')],{'$or':_[_0xb5b6('0x9')](_0x44fc9f,function(_0x24bb14){if(_0x24bb14[_0xb5b6('0x99')][_0xb5b6('0x9a')]!=='VIRTUAL'){var _0x5211a7={};_0x5211a7[_0x24bb14[_0xb5b6('0xa')]]={'$like':'%'+_0x6dedae['query']['filter']+'%'};return _0x5211a7;}})});}var _0x513615=[];var _0x43a8ef=null;var _0x212db5={};if(_0x138dfe){_0x43a8ef=_['find'](_0x4336d3,[_0xb5b6('0xb'),_0x138dfe['name']]);if(_0x43a8ef[_0xb5b6('0xa')]){_0x212db5={};if(_0x1cd928[_0xb5b6('0x11')]===_0xb5b6('0x71')){_0x212db5[_0x43a8ef[_0xb5b6('0x9b')]]=_[_0xb5b6('0x9')](_0x138dfe[_0xb5b6('0x8')],'id');}else{_0x212db5[_0x43a8ef[_0xb5b6('0x9b')]]=_0x138dfe[_0xb5b6('0x8')];}_0x513615[_0xb5b6('0x8a')](_0x212db5);}else{_0x21ac69[_0xb5b6('0x7a')]['id']=_0x138dfe['associatedResources'];}}else{for(var _0x3f103b=0x0;_0x3f103b<_0x10f655[_0xb5b6('0x86')];_0x3f103b++){_0x43a8ef=_[_0xb5b6('0x87')](_0x4336d3,[_0xb5b6('0xb'),_0x10f655[_0x3f103b][_0xb5b6('0xb')]]);if(_0x43a8ef[_0xb5b6('0xa')]){_0x212db5={};_0x212db5[_0x43a8ef['foreignKey']]=_0x10f655[_0x3f103b][_0xb5b6('0x8')];_0x513615[_0xb5b6('0x8a')](_0x212db5);}else{if(!_0x21ac69['where']['id'])_0x21ac69[_0xb5b6('0x7a')]['id']=[];_0x10f655[_0x3f103b][_0xb5b6('0x8')][_0xb5b6('0x9c')](function(_0x2cd11a){_0x21ac69[_0xb5b6('0x7a')]['id']['push'](_0x2cd11a);});}}}if(!_[_0xb5b6('0x85')](_0x513615)){_0x21ac69[_0xb5b6('0x7a')]=_[_0xb5b6('0x98')](_0x21ac69['where'],{'$and':{'$or':_0x513615}});}_0x21ac69=_['merge']({},_0x21ac69,_0x6dedae[_0xb5b6('0x9d')]);if(_0x138dfe&&!_0x138dfe[_0xb5b6('0x9e')]&&_0x1cd928[_0xb5b6('0x11')]===_0xb5b6('0x71')){if(_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x9f')]){_0x21ac69[_0xb5b6('0xa0')]=[{'all':!![]}];}return _0x17156a[_0x1cd928['childModel']][_0xb5b6('0x6')](_0x21ac69)['then'](function(_0x2c10fc){var _0x4707b2=[];_0x2c10fc['forEach'](function(_0x403a7e){var _0x756bde;switch(_0x403a7e[_0xb5b6('0xa1')]){case _0xb5b6('0xa2'):_0x756bde=_['find'](_0x138dfe[_0xb5b6('0x8')],function(_0x1b132f){return _0x1b132f['id']===_0x403a7e[_0xb5b6('0xa3')]&&_0x1b132f[_0xb5b6('0x99')]===_0xb5b6('0xa4');});break;case _0xb5b6('0xa5'):_0x756bde=_[_0xb5b6('0x87')](_0x138dfe[_0xb5b6('0x8')],function(_0x3595c){return _0x3595c['id']===_0x403a7e[_0xb5b6('0xa3')]&&_0x3595c[_0xb5b6('0x99')]==='CustomReports';});break;}if(_0x756bde)_0x4707b2[_0xb5b6('0x8a')](_0x403a7e);});_0xd54394[_0xb5b6('0xa6')]=_0x4707b2[_0xb5b6('0x86')];_0xd54394[_0xb5b6('0xa7')]=_0x4707b2;return _0xd54394;});}else{if(!_[_0xb5b6('0x85')](_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xa8')])){_0x21ac69['where']['id']=_0x21ac69[_0xb5b6('0x7a')]['id']?_[_0xb5b6('0x8e')](_0x21ac69[_0xb5b6('0x7a')]['id'],_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xa8')]):_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xa8')];if(_0x6dedae[_0xb5b6('0x7c')]['customSorting']){_0x21ac69['order']=_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xa9')];}}if(_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xaa')]){_0x21ac69[_0xb5b6('0x7a')]=_[_0xb5b6('0x98')](_0x21ac69['where'],{'$and':_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xaa')]});}return _0x17156a[_0x1cd928[_0xb5b6('0x11')]]['count']({'where':_0x21ac69[_0xb5b6('0x7a')]})[_0xb5b6('0x7')](function(_0x48b8bd){_0xd54394[_0xb5b6('0xa6')]=_0x48b8bd;if(_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0x9f')]){if(_0x1cd928[_0xb5b6('0x11')]===_0xb5b6('0x1c')){_0x21ac69[_0xb5b6('0xa0')]=[{'model':_0x17156a['Tag'],'as':_0xb5b6('0xab'),'attributes':['id',_0xb5b6('0xb'),_0xb5b6('0xac')],'required':_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xad')]?!![]:![]},{'model':_0x17156a['Tag'],'as':_0xb5b6('0xae'),'attributes':['id',_0xb5b6('0xb'),_0xb5b6('0xac')],'through':_0x6dedae['query'][_0xb5b6('0xad')]?{'attributes':[],'where':{'TagId':_0x6dedae[_0xb5b6('0x7c')][_0xb5b6('0xad')]||undefined}}:{},'required':_0x6dedae['query'][_0xb5b6('0xad')]?!![]:![]}];}else{_0x21ac69[_0xb5b6('0xa0')]=[{'all':!![]}];}}return _0x17156a[_0x1cd928[_0xb5b6('0x11')]][_0xb5b6('0x6')](_0x21ac69);})[_0xb5b6('0x7')](function(_0xdc4fe5){_0xd54394[_0xb5b6('0xa7')]=_0xdc4fe5;if(_0x311f1f===_0xb5b6('0x2f')&&_0x6dedae['query'][_0xb5b6('0xaf')]==='true'){var _0x1d0dd4=[];for(var _0x3b5daa=0x0;_0x3b5daa<_0xd54394[_0xb5b6('0xa7')][_0xb5b6('0x86')];_0x3b5daa++){_0x1d0dd4['push'](_0x574f37(_0xb5b6('0xb0'),_0xd54394[_0xb5b6('0xa7')][_0x3b5daa][_0xb5b6('0xb1')]));_0x1d0dd4[_0xb5b6('0x8a')](_0x574f37(_0xb5b6('0xb2'),_0xd54394[_0xb5b6('0xa7')][_0x3b5daa]['dataValues']));_0x1d0dd4['push'](_0x574f37(_0xb5b6('0xb3'),_0xd54394[_0xb5b6('0xa7')][_0x3b5daa][_0xb5b6('0xb1')]));_0x1d0dd4[_0xb5b6('0x8a')](_0x574f37('mail',_0xd54394[_0xb5b6('0xa7')][_0x3b5daa][_0xb5b6('0xb1')]));_0x1d0dd4[_0xb5b6('0x8a')](_0x574f37(_0xb5b6('0xb4'),_0xd54394[_0xb5b6('0xa7')][_0x3b5daa][_0xb5b6('0xb1')]));_0x1d0dd4[_0xb5b6('0x8a')](_0x574f37(_0xb5b6('0xb5'),_0xd54394[_0xb5b6('0xa7')][_0x3b5daa][_0xb5b6('0xb1')]));}return Promise[_0xb5b6('0x89')](_0x1d0dd4)['then'](function(){return _0xd54394;});}return _0xd54394;});}});}}});};
\ No newline at end of file
+var _0xc547=['_interactions','where','sequelize','query','toString','OpenTabs','UserProfile','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','all','ignore','union','find','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','options','include','reportType','default','reportId','type','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tags','tag','color','openTabs','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','resolve','AnalyticExtractedReport','resourceId','toLowerCase','odbc','childModel','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','CmContact','parentSections','Lists','ListId','CmList','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','agent','Telephones','queue','VoiceQueue','inbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','VoiceQueues','QueueCampaigns','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','cannedanswers','Disposition','Dashboard','intervals','Interval','Pause','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','toUpperCase','slice','select','ui.','InteractionId','ui.createdAt','from','user_has_'];(function(_0x139174,_0x2be67b){var _0x2d6cf5=function(_0x4f3892){while(--_0x4f3892){_0x139174['push'](_0x139174['shift']());}};_0x2d6cf5(++_0x2be67b);}(_0xc547,0xf7));var _0x7c54=function(_0x170fb4,_0xcf5fea){_0x170fb4=_0x170fb4-0x0;var _0x212afe=_0xc547[_0x170fb4];return _0x212afe;};'use strict';var _=require(_0x7c54('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x7c54('0x1'));var squel=require(_0x7c54('0x2'));module[_0x7c54('0x3')]=function(_0x4d851e){var _0x356e45=_0x4d851e[_0x7c54('0x4')];function _0x2bc75e(_0x2b3195,_0x58d7b1){return new Promise(function(_0x2337c0,_0x37e430){if(!_0x58d7b1)return _0x2337c0(null);var _0x247005=_0x58d7b1[_0x7c54('0x5')]?{[_0x58d7b1[_0x7c54('0x5')][_0x7c54('0x6')]]:_0x58d7b1[_0x7c54('0x5')][_0x7c54('0x7')]}:undefined;return _0x356e45[_0x2b3195][_0x7c54('0x8')]({'where':_0x247005,'raw':!![]})['then'](function(_0x36eb3a){_0x58d7b1[_0x7c54('0x9')]=_[_0x7c54('0xa')](_0x36eb3a,'id');_0x2337c0(_0x58d7b1);})[_0x7c54('0xb')](function(_0x4d9c48){_0x37e430(_0x4d9c48);});});}function _0x4a91d2(_0x2cf834,_0x17b1a8){return new Promise(function(_0x2eb17f,_0x8fed36){var _0x1a1873=_0x2cf834['filter']?{[_0x2cf834[_0x7c54('0x5')][_0x7c54('0x6')]]:_0x2cf834[_0x7c54('0x5')][_0x7c54('0x7')]}:undefined;return _0x356e45[_0x2cf834[_0x7c54('0xc')]][_0x7c54('0x8')]({'where':_0x1a1873,'raw':!![]})[_0x7c54('0xd')](function(_0x336af6){_0x17b1a8[_0x7c54('0x9')]=_[_0x7c54('0xa')](_0x336af6,function(_0x100bd0){return _0x100bd0[_0x7c54('0xe')];});_0x2eb17f(_0x17b1a8);})[_0x7c54('0xb')](function(_0x1e9126){_0x8fed36(_0x1e9126);});});}function _0x51c3ca(_0x558388,_0x269930,_0x1ced19){if(!_0x269930)return Promise[_0x7c54('0xf')](null);return new Promise(function(_0x592329,_0x2b2a85){return _0x356e45['UserProfileResource']['findAll']({'where':{'sectionId':_0x269930['id']},'raw':!![]})['then'](function(_0x21630a){if(_0x558388[_0x7c54('0x6')]&&_0x558388[_0x7c54('0x6')]!=='id'){_0x269930[_0x7c54('0x9')]=_[_0x7c54('0xa')](_0x21630a,function(_0x361467){return _0x361467[_0x558388['field']];});}else{if(_0x1ced19===_0x7c54('0x10')){_0x269930[_0x7c54('0x9')]=_['map'](_0x21630a,function(_0x488dde){return{'id':_0x488dde[_0x7c54('0x11')],'type':_0x488dde['type']};});}else{_0x269930['associatedResources']=_[_0x7c54('0xa')](_0x21630a,function(_0x77347a){return _0x77347a[_0x7c54('0x11')];});}}_0x592329(_0x269930);})['catch'](function(_0x2389c8){_0x2b2a85(_0x2389c8);});});}function _0x28ea6c(_0x2eb4be,_0x126751){var _0x388a09={'parentSections':[]};switch(_0x2eb4be[_0x7c54('0x12')]()){case'squareprojects':_0x388a09['childModel']='SquareProject';break;case _0x7c54('0x13'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x15');break;case'squarerecordings':_0x388a09['childModel']=_0x7c54('0x16');_0x388a09['parentSections']=[{'name':_0x7c54('0x17'),'field':_0x7c54('0xe'),'foreignKey':_0x7c54('0x18')}];break;case _0x7c54('0x19'):_0x388a09['childModel']='JscriptyProject';break;case'contacts':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x1a');_0x388a09[_0x7c54('0x1b')]=[{'name':_0x7c54('0x1c'),'field':'id','foreignKey':_0x7c54('0x1d')}];break;case'lists':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x1e');break;case _0x7c54('0x1f'):_0x388a09[_0x7c54('0x14')]='CmCompany';break;case _0x7c54('0x20'):_0x388a09['childModel']='CmCustomField';break;case _0x7c54('0x21'):_0x388a09['childModel']=_0x7c54('0x22');break;case _0x7c54('0x23'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x24');break;case _0x7c54('0x25'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x26');break;case'faxaccounts':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x27');break;case _0x7c54('0x28'):case _0x7c54('0x29'):case _0x7c54('0x2a'):_0x388a09[_0x7c54('0x14')]='VoiceExtension';break;case _0x7c54('0x2b'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x2c');break;case _0x7c54('0x2d'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x2e');break;case _0x7c54('0x2f'):_0x388a09['childModel']='VoiceRecording';_0x388a09[_0x7c54('0x1b')]=[{'name':_0x7c54('0x30'),'field':_0x7c54('0xe'),'foreignKey':_0x7c54('0x31'),'model':_0x7c54('0x32'),'filter':{'field':_0x7c54('0x33'),'value':[_0x7c54('0x34')]}},{'name':_0x7c54('0x35'),'field':_0x7c54('0xe'),'foreignKey':_0x7c54('0x31'),'model':'User','filter':{'field':_0x7c54('0x33'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x7c54('0xe'),'foreignKey':_0x7c54('0x36'),'model':_0x7c54('0x37'),'filter':{'field':'type','value':[_0x7c54('0x38')]}},{'name':'QueueCampaigns','field':_0x7c54('0xe'),'foreignKey':_0x7c54('0x36'),'model':_0x7c54('0x37'),'filter':{'field':'type','value':['outbound']}}];break;case _0x7c54('0x39'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x3a');break;case _0x7c54('0x3b'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x3c');break;case _0x7c54('0x3d'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x3e');break;case _0x7c54('0x3f'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x40');break;case _0x7c54('0x41'):_0x388a09['childModel']=_0x7c54('0x42');break;case'mailaccounts':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x43');break;case _0x7c54('0x44'):_0x388a09[_0x7c54('0x14')]='MailSubstatus';break;case _0x7c54('0x45'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x46');break;case _0x7c54('0x47'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x48');break;case _0x7c54('0x49'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x4a');break;case _0x7c54('0x4b'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x4c');break;case _0x7c54('0x4d'):_0x388a09[_0x7c54('0x14')]='WhatsappQueue';break;case _0x7c54('0x4e'):_0x388a09['childModel']=_0x7c54('0x4f');break;case'teams':_0x388a09['childModel']=_0x7c54('0x50');break;case _0x7c54('0x51'):case _0x7c54('0x52'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x37');if(_0x126751){_0x388a09[_0x7c54('0x1b')]=[{'name':_0x7c54('0x53')},{'name':_0x7c54('0x54')}];}break;case'users':case _0x7c54('0x55'):case _0x7c54('0x56'):_0x388a09[_0x7c54('0x14')]='User';if(_0x126751){_0x388a09[_0x7c54('0x1b')]=[{'name':_0x7c54('0x57'),'filter':{'field':_0x7c54('0x33'),'value':[_0x7c54('0x58'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x7c54('0x35')}];}break;case _0x7c54('0x59'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x5a');break;case _0x7c54('0x5b'):_0x388a09[_0x7c54('0x14')]='SalesforceAccount';break;case _0x7c54('0x5c'):_0x388a09[_0x7c54('0x14')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x388a09['childModel']=_0x7c54('0x5d');break;case _0x7c54('0x5e'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x5f');break;case'zohoaccounts':_0x388a09[_0x7c54('0x14')]='ZohoAccount';break;case'vtigeraccounts':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x32');break;case _0x7c54('0x60'):_0x388a09[_0x7c54('0x14')]='CannedAnswer';break;case'dispositions':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x61');break;case'customdashboards':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x62');break;case _0x7c54('0x63'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x64');break;case'pauses':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x65');break;case'scheduler':_0x388a09['childModel']='Schedule';break;case _0x7c54('0x66'):_0x388a09['childModel']=_0x7c54('0x67');break;case _0x7c54('0x68'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x69');break;case _0x7c54('0x6a'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x6b');break;case _0x7c54('0x6c'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x6d');break;case'trunks':_0x388a09[_0x7c54('0x14')]=_0x7c54('0x6e');break;case _0x7c54('0x6f'):_0x388a09['childModel']=_0x7c54('0x70');break;case _0x7c54('0x71'):_0x388a09['childModel']=_0x7c54('0x72');break;case _0x7c54('0x73'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x10');_0x388a09[_0x7c54('0x1b')]=[{'name':_0x7c54('0x74'),'field':'id','foreignKey':'reportId'}];break;case _0x7c54('0x75'):_0x388a09[_0x7c54('0x14')]=_0x7c54('0x76');break;}return _0x388a09;}function _0x37b166(_0x34ffb7,_0x40e27a){var _0x54c038=_0x34ffb7['charAt'](0x0)[_0x7c54('0x77')]()+_0x34ffb7[_0x7c54('0x78')](0x1);var _0x2f78b4={'type':_0x356e45['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x171b3e,_0x4c7565){var _0x2eb557=squel[_0x7c54('0x79')]()[_0x7c54('0x6')](_0x7c54('0x7a')+_0x54c038+_0x7c54('0x7b'),'id')[_0x7c54('0x6')](_0x7c54('0x7c'))[_0x7c54('0x7d')](_0x7c54('0x7e')+_0x34ffb7+_0x7c54('0x7f'),'ui')[_0x7c54('0x80')]('ui.UserId\x20=\x20?',_0x40e27a['id']);return _0x356e45[_0x7c54('0x81')][_0x7c54('0x82')](_0x2eb557[_0x7c54('0x83')](),_0x2f78b4)[_0x7c54('0xd')](function(_0x1a22c7){_0x40e27a[_0x54c038+_0x7c54('0x84')]=_0x1a22c7;_0x171b3e(_0x1a22c7);})[_0x7c54('0xb')](function(_0x3a5883){_0x4c7565(_0x3a5883);});});}return _0x4d851e['define'](_0x7c54('0x85'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b5b92){var _0x52bb66={'raw':_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x86')],'where':{}};var _0x585ab2={};var _0xa46492={'count':0x0,'rows':[]};var _0x54468b=_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x87')];var _0x1e88fe=_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x88')]||![];var _0x9896b3=_0x28ea6c(_0x54468b,_0x1e88fe);if(!_0x9896b3[_0x7c54('0x14')])throw new Error(_0x7c54('0x89')+_0x54468b+'\x27');var _0x12ea93=[{'name':_0x54468b}];if(!_[_0x7c54('0x8a')](_0x9896b3[_0x7c54('0x1b')]))_0x12ea93=_0x9896b3[_0x7c54('0x1b')];var _0x5be9ae=[];for(var _0x5875be=0x0;_0x5875be<_0x12ea93[_0x7c54('0x8b')];_0x5875be++){_0x5be9ae[_0x7c54('0x8c')](_0x356e45['UserProfileSection']['find']({'where':{'userProfileId':_0x3b5b92['params']['id'],'name':_0x12ea93[_0x5875be][_0x7c54('0xe')]},'raw':!![]}));}return Promise[_0x7c54('0x8d')](_0x5be9ae)[_0x7c54('0xd')](function(_0x3b82be){var _0x135476=_['filter'](_0x3b82be,function(_0x5b7498){return _0x5b7498?_0x5b7498:undefined;});var _0x54f3f2=_['filter'](_0x12ea93,[_0x7c54('0x8e'),!![]]);var _0x5d4466=_[_0x7c54('0x8a')](_0x135476)&&_[_0x7c54('0x8a')](_0x54f3f2)?null:_[_0x7c54('0x8f')](_0x54f3f2,_0x135476);if(!_0x5d4466)return null;var _0x37f39b=[];for(var _0x9e3211=0x0;_0x9e3211<_0x5d4466['length'];_0x9e3211++){var _0x52d515=_[_0x7c54('0x90')](_0x12ea93,function(_0x12e297){return _0x5d4466[_0x9e3211]?_0x12e297[_0x7c54('0xe')]===_0x5d4466[_0x9e3211][_0x7c54('0xe')]:null;});if(_0x52d515){if(_0x5d4466[_0x9e3211]['ignore']){_0x37f39b[_0x7c54('0x8c')](_0x2bc75e(_0x9896b3[_0x7c54('0x14')],_0x5d4466[_0x9e3211]));}else{if(!_0x5d4466[_0x9e3211][_0x7c54('0x91')]){_0x37f39b[_0x7c54('0x8c')](_0x51c3ca(_0x52d515,_0x5d4466[_0x9e3211],_0x9896b3[_0x7c54('0x14')]));}else{if(_0x52d515['model']){_0x37f39b[_0x7c54('0x8c')](_0x4a91d2(_0x52d515,_0x5d4466[_0x9e3211]));}}}}}return Promise[_0x7c54('0x8d')](_0x37f39b);})[_0x7c54('0xd')](function(_0x4a56a7){var _0x562e6b=_0x4a56a7;var _0x21c259=null;if(_0x562e6b){_0x21c259=_0x562e6b['length']===0x1?_0x562e6b[0x0]:null;}if(!_0x21c259&&!_0x562e6b)return _0xa46492;var _0xb60d03=_0x356e45[_0x9896b3[_0x7c54('0x14')]]['rawAttributes'];_0x585ab2[_0x7c54('0xc')]=_[_0x7c54('0x92')](_0xb60d03);_0x585ab2[_0x7c54('0x82')]=_['keys'](_0x3b5b92['query']);_0x585ab2[_0x7c54('0x93')]=_[_0x7c54('0x94')](_0x585ab2[_0x7c54('0xc')],_0x585ab2['query']);_0x52bb66[_0x7c54('0x95')]=_[_0x7c54('0x94')](_0x585ab2[_0x7c54('0xc')],qs[_0x7c54('0x96')](_0x3b5b92['query'][_0x7c54('0x96')]));_0x52bb66[_0x7c54('0x95')]=_0x52bb66[_0x7c54('0x95')][_0x7c54('0x8b')]?_0x52bb66[_0x7c54('0x95')]:_0x585ab2[_0x7c54('0xc')];if(!_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x97')](_0x7c54('0x98'))){_0x52bb66['limit']=qs[_0x7c54('0x99')](_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x99')]);_0x52bb66[_0x7c54('0x9a')]=qs[_0x7c54('0x9a')](_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x9a')]);}_0x52bb66[_0x7c54('0x9b')]=qs[_0x7c54('0x9c')](_0x3b5b92[_0x7c54('0x82')][_0x7c54('0x9c')]);_0x52bb66[_0x7c54('0x80')]=qs[_0x7c54('0x93')](_[_0x7c54('0x9d')](_0x3b5b92['query'],_0x585ab2[_0x7c54('0x93')]));if(_0x3b5b92[_0x7c54('0x82')]['filter']){_0x52bb66[_0x7c54('0x80')]=_[_0x7c54('0x9e')](_0x52bb66[_0x7c54('0x80')],{'$or':_[_0x7c54('0xa')](_0xb60d03,function(_0x2c5836){if(_0x2c5836['type']['key']!==_0x7c54('0x9f')){var _0x4ccbc0={};_0x4ccbc0[_0x2c5836['field']]={'$like':'%'+_0x3b5b92['query'][_0x7c54('0x5')]+'%'};return _0x4ccbc0;}})});}var _0x4dc3dc=[];var _0x31d029=null;var _0x59877a={};if(_0x21c259){_0x31d029=_[_0x7c54('0x90')](_0x12ea93,['name',_0x21c259[_0x7c54('0xe')]]);if(_0x31d029[_0x7c54('0x6')]){_0x59877a={};if(_0x9896b3[_0x7c54('0x14')]===_0x7c54('0x10')){_0x59877a[_0x31d029[_0x7c54('0xa0')]]=_[_0x7c54('0xa')](_0x21c259[_0x7c54('0x9')],'id');}else{_0x59877a[_0x31d029[_0x7c54('0xa0')]]=_0x21c259[_0x7c54('0x9')];}_0x4dc3dc['push'](_0x59877a);}else{_0x52bb66[_0x7c54('0x80')]['id']=_0x21c259['associatedResources'];}}else{for(var _0x50d489=0x0;_0x50d489<_0x562e6b['length'];_0x50d489++){_0x31d029=_['find'](_0x12ea93,['name',_0x562e6b[_0x50d489][_0x7c54('0xe')]]);if(_0x31d029[_0x7c54('0x6')]){_0x59877a={};_0x59877a[_0x31d029[_0x7c54('0xa0')]]=_0x562e6b[_0x50d489]['associatedResources'];_0x4dc3dc[_0x7c54('0x8c')](_0x59877a);}else{if(!_0x52bb66[_0x7c54('0x80')]['id'])_0x52bb66[_0x7c54('0x80')]['id']=[];_0x562e6b[_0x50d489]['associatedResources'][_0x7c54('0xa1')](function(_0x1b7e33){_0x52bb66[_0x7c54('0x80')]['id']['push'](_0x1b7e33);});}}}if(!_['isEmpty'](_0x4dc3dc)){_0x52bb66[_0x7c54('0x80')]=_[_0x7c54('0x9e')](_0x52bb66[_0x7c54('0x80')],{'$and':{'$or':_0x4dc3dc}});}_0x52bb66=_[_0x7c54('0x9e')]({},_0x52bb66,_0x3b5b92[_0x7c54('0xa2')]);if(_0x21c259&&!_0x21c259[_0x7c54('0x91')]&&_0x9896b3[_0x7c54('0x14')]===_0x7c54('0x10')){if(_0x3b5b92[_0x7c54('0x82')]['includeAll']){_0x52bb66[_0x7c54('0xa3')]=[{'all':!![]}];}return _0x356e45[_0x9896b3[_0x7c54('0x14')]][_0x7c54('0x8')](_0x52bb66)[_0x7c54('0xd')](function(_0x5432d7){var _0xe943c4=[];_0x5432d7[_0x7c54('0xa1')](function(_0x549c53){var _0x519929;switch(_0x549c53[_0x7c54('0xa4')]){case _0x7c54('0xa5'):_0x519929=_[_0x7c54('0x90')](_0x21c259[_0x7c54('0x9')],function(_0x40dd64){return _0x40dd64['id']===_0x549c53[_0x7c54('0xa6')]&&_0x40dd64[_0x7c54('0xa7')]===_0x7c54('0xa8');});break;case'custom':_0x519929=_[_0x7c54('0x90')](_0x21c259[_0x7c54('0x9')],function(_0x2fca09){return _0x2fca09['id']===_0x549c53[_0x7c54('0xa6')]&&_0x2fca09[_0x7c54('0xa7')]===_0x7c54('0xa9');});break;}if(_0x519929)_0xe943c4['push'](_0x549c53);});_0xa46492[_0x7c54('0xaa')]=_0xe943c4['length'];_0xa46492[_0x7c54('0xab')]=_0xe943c4;return _0xa46492;});}else{if(!_['isEmpty'](_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xac')])){_0x52bb66[_0x7c54('0x80')]['id']=_0x52bb66[_0x7c54('0x80')]['id']?_[_0x7c54('0x94')](_0x52bb66[_0x7c54('0x80')]['id'],_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xac')]):_0x3b5b92['query']['ids'];if(_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xad')]){_0x52bb66[_0x7c54('0x9b')]=_0x3b5b92['query'][_0x7c54('0xad')];}}if(_0x3b5b92['query'][_0x7c54('0xae')]){_0x52bb66[_0x7c54('0x80')]=_['merge'](_0x52bb66[_0x7c54('0x80')],{'$and':_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xae')]});}return _0x356e45[_0x9896b3['childModel']][_0x7c54('0xaa')]({'where':_0x52bb66[_0x7c54('0x80')]})[_0x7c54('0xd')](function(_0x572772){_0xa46492[_0x7c54('0xaa')]=_0x572772;if(_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xaf')]){if(_0x9896b3['childModel']==='CmContact'){_0x52bb66[_0x7c54('0xa3')]=[{'model':_0x356e45[_0x7c54('0x69')],'as':_0x7c54('0xb0'),'attributes':['id','name','color'],'required':_0x3b5b92['query'][_0x7c54('0xb1')]?!![]:![]},{'model':_0x356e45[_0x7c54('0x69')],'as':'ThroughTags','attributes':['id','name',_0x7c54('0xb2')],'through':_0x3b5b92['query'][_0x7c54('0xb1')]?{'attributes':[],'where':{'TagId':_0x3b5b92[_0x7c54('0x82')]['tag']||undefined}}:{},'required':_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xb1')]?!![]:![]}];}else{_0x52bb66[_0x7c54('0xa3')]=[{'all':!![]}];}}return _0x356e45[_0x9896b3[_0x7c54('0x14')]][_0x7c54('0x8')](_0x52bb66);})[_0x7c54('0xd')](function(_0x5d1fb2){_0xa46492[_0x7c54('0xab')]=_0x5d1fb2;if(_0x54468b===_0x7c54('0x30')&&_0x3b5b92[_0x7c54('0x82')][_0x7c54('0xb3')]===_0x7c54('0xb4')){var _0x1c198f=[];for(var _0x71fb7e=0x0;_0x71fb7e<_0xa46492[_0x7c54('0xab')][_0x7c54('0x8b')];_0x71fb7e++){_0x1c198f[_0x7c54('0x8c')](_0x37b166(_0x7c54('0xb5'),_0xa46492[_0x7c54('0xab')][_0x71fb7e][_0x7c54('0xb6')]));_0x1c198f['push'](_0x37b166(_0x7c54('0xb7'),_0xa46492[_0x7c54('0xab')][_0x71fb7e][_0x7c54('0xb6')]));_0x1c198f[_0x7c54('0x8c')](_0x37b166(_0x7c54('0xb8'),_0xa46492['rows'][_0x71fb7e][_0x7c54('0xb6')]));_0x1c198f[_0x7c54('0x8c')](_0x37b166('mail',_0xa46492[_0x7c54('0xab')][_0x71fb7e][_0x7c54('0xb6')]));_0x1c198f['push'](_0x37b166(_0x7c54('0xb9'),_0xa46492['rows'][_0x71fb7e][_0x7c54('0xb6')]));_0x1c198f[_0x7c54('0x8c')](_0x37b166(_0x7c54('0xba'),_0xa46492['rows'][_0x71fb7e][_0x7c54('0xb6')]));}return Promise[_0x7c54('0x8d')](_0x1c198f)['then'](function(){return _0xa46492;});}return _0xa46492;});}});}}});};
\ No newline at end of file
index de5701d..a25fdcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65cb=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x38d435,_0x1fab27){var _0x287fb4=function(_0x2e91c1){while(--_0x2e91c1){_0x38d435['push'](_0x38d435['shift']());}};_0x287fb4(++_0x1fab27);}(_0x65cb,0xa4));var _0xb65c=function(_0x4cb5a1,_0x307597){_0x4cb5a1=_0x4cb5a1-0x0;var _0x4b9742=_0x65cb[_0x4cb5a1];return _0x4b9742;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var moment=require(_0xb65c('0x1'));var BPromise=require(_0xb65c('0x2'));var rs=require(_0xb65c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))(_0xb65c('0x7'));var config=require(_0xb65c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb65c('0x9')][_0xb65c('0xa')]({'port':0x232a});config[_0xb65c('0xb')]=_[_0xb65c('0xc')](config[_0xb65c('0xb')],{'host':_0xb65c('0xd'),'port':0x18eb});var socket=require(_0xb65c('0xe'))(new Redis(config[_0xb65c('0xb')]));require('./userProfile.socket')[_0xb65c('0xf')](socket);function respondWithRpcPromise(_0x2d9bb1,_0x19e32e,_0xd9b29a){return new BPromise(function(_0x5dec0c,_0x131587){return client['request'](_0x2d9bb1,_0xd9b29a)[_0xb65c('0x10')](function(_0x1697b1){logger[_0xb65c('0x11')](_0xb65c('0x12'),_0x19e32e,_0xb65c('0x13'));logger[_0xb65c('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x19e32e,_0xb65c('0x13'),JSON[_0xb65c('0x15')](_0x1697b1));if(_0x1697b1[_0xb65c('0x16')]){if(_0x1697b1[_0xb65c('0x16')][_0xb65c('0x17')]===0x1f4){logger[_0xb65c('0x16')](_0xb65c('0x12'),_0x19e32e,_0x1697b1['error'][_0xb65c('0x18')]);return _0x131587(_0x1697b1[_0xb65c('0x16')]['message']);}logger[_0xb65c('0x16')]('UserProfile,\x20%s,\x20%s',_0x19e32e,_0x1697b1[_0xb65c('0x16')][_0xb65c('0x18')]);return _0x5dec0c(_0x1697b1[_0xb65c('0x16')][_0xb65c('0x18')]);}else{logger[_0xb65c('0x11')](_0xb65c('0x12'),_0x19e32e,_0xb65c('0x13'));_0x5dec0c(_0x1697b1[_0xb65c('0x19')][_0xb65c('0x18')]);}})[_0xb65c('0x1a')](function(_0x3fa3bc){logger[_0xb65c('0x16')](_0xb65c('0x12'),_0x19e32e,_0x3fa3bc);_0x131587(_0x3fa3bc);});});}
\ No newline at end of file
+var _0xa809=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','util'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xa809,0x1f3));var _0x9a80=function(_0x255adf,_0x1b31bb){_0x255adf=_0x255adf-0x0;var _0x142ff8=_0xa809[_0x255adf];return _0x142ff8;};'use strict';var _=require('lodash');var util=require(_0x9a80('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a80('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a80('0x2'))(_0x9a80('0x3'));var config=require(_0x9a80('0x4'));var jayson=require(_0x9a80('0x5'));var client=jayson['client'][_0x9a80('0x6')]({'port':0x232a});config['redis']=_[_0x9a80('0x7')](config[_0x9a80('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a80('0x9'))(new Redis(config[_0x9a80('0x8')]));require(_0x9a80('0xa'))[_0x9a80('0xb')](socket);function respondWithRpcPromise(_0x596b93,_0x3d5aba,_0x1e0017){return new BPromise(function(_0x396fc5,_0x3277f6){return client[_0x9a80('0xc')](_0x596b93,_0x1e0017)[_0x9a80('0xd')](function(_0x1504ae){logger[_0x9a80('0xe')]('UserProfile,\x20%s,\x20%s',_0x3d5aba,_0x9a80('0xf'));logger[_0x9a80('0x10')](_0x9a80('0x11'),_0x3d5aba,_0x9a80('0xf'),JSON[_0x9a80('0x12')](_0x1504ae));if(_0x1504ae[_0x9a80('0x13')]){if(_0x1504ae[_0x9a80('0x13')][_0x9a80('0x14')]===0x1f4){logger['error'](_0x9a80('0x15'),_0x3d5aba,_0x1504ae['error'][_0x9a80('0x16')]);return _0x3277f6(_0x1504ae[_0x9a80('0x13')][_0x9a80('0x16')]);}logger['error'](_0x9a80('0x15'),_0x3d5aba,_0x1504ae[_0x9a80('0x13')][_0x9a80('0x16')]);return _0x396fc5(_0x1504ae[_0x9a80('0x13')][_0x9a80('0x16')]);}else{logger['info'](_0x9a80('0x15'),_0x3d5aba,'request\x20sent');_0x396fc5(_0x1504ae[_0x9a80('0x17')][_0x9a80('0x16')]);}})[_0x9a80('0x18')](function(_0x3c2ae0){logger['error']('UserProfile,\x20%s,\x20%s',_0x3d5aba,_0x3c2ae0);_0x3277f6(_0x3c2ae0);});});}
\ No newline at end of file
index 386ed23..4f911d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf17b=['register','length','userProfile:','./userProfile.events','remove','removeListener'];(function(_0x337d7e,_0x2ad44d){var _0x4c2e6e=function(_0x16a33a){while(--_0x16a33a){_0x337d7e['push'](_0x337d7e['shift']());}};_0x4c2e6e(++_0x2ad44d);}(_0xf17b,0x75));var _0xbf17=function(_0x101a01,_0x18bd83){_0x101a01=_0x101a01-0x0;var _0x538e92=_0xf17b[_0x101a01];return _0x538e92;};'use strict';var UserProfileEvents=require(_0xbf17('0x0'));var events=['save',_0xbf17('0x1'),'update'];function createListener(_0x4cd21b,_0x20be7a){return function(_0x53d0a5){_0x20be7a['emit'](_0x4cd21b,_0x53d0a5);};}function removeListener(_0x171aef,_0x27c85a){return function(){UserProfileEvents[_0xbf17('0x2')](_0x171aef,_0x27c85a);};}exports[_0xbf17('0x3')]=function(_0x5de419){for(var _0xa75af8=0x0,_0x5b1d93=events[_0xbf17('0x4')];_0xa75af8<_0x5b1d93;_0xa75af8++){var _0x58f9d4=events[_0xa75af8];var _0xbb9e6b=createListener(_0xbf17('0x5')+_0x58f9d4,_0x5de419);UserProfileEvents['on'](_0x58f9d4,_0xbb9e6b);}};
\ No newline at end of file
+var _0x90ca=['userProfile:','./userProfile.events','save','update','register'];(function(_0x24a4dd,_0xb58e96){var _0x5e75c4=function(_0x167f42){while(--_0x167f42){_0x24a4dd['push'](_0x24a4dd['shift']());}};_0x5e75c4(++_0xb58e96);}(_0x90ca,0x178));var _0xa90c=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x90ca[_0x2a6809];return _0x11c371;};'use strict';var UserProfileEvents=require(_0xa90c('0x0'));var events=[_0xa90c('0x1'),'remove',_0xa90c('0x2')];function createListener(_0x18307b,_0x44d65f){return function(_0x503821){_0x44d65f['emit'](_0x18307b,_0x503821);};}function removeListener(_0x83a9f0,_0x2293f2){return function(){UserProfileEvents['removeListener'](_0x83a9f0,_0x2293f2);};}exports[_0xa90c('0x3')]=function(_0x27ff29){for(var _0x451e7d=0x0,_0x359b65=events['length'];_0x451e7d<_0x359b65;_0x451e7d++){var _0x1c4b09=events[_0x451e7d];var _0x2743d9=createListener(_0xa90c('0x4')+_0x1c4b09,_0x27ff29);UserProfileEvents['on'](_0x1c4b09,_0x2743d9);}};
\ No newline at end of file
index e1de98e..4e48b71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf815=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','create'];(function(_0x56e945,_0x3353e4){var _0x2e124e=function(_0x19800){while(--_0x19800){_0x56e945['push'](_0x56e945['shift']());}};_0x2e124e(++_0x3353e4);}(_0xf815,0x75));var _0x5f81=function(_0x3d54a4,_0x5c3261){_0x3d54a4=_0x3d54a4-0x0;var _0x44befb=_0xf815[_0x3d54a4];return _0x44befb;};'use strict';var multer=require(_0x5f81('0x0'));var util=require(_0x5f81('0x1'));var path=require(_0x5f81('0x2'));var timeout=require(_0x5f81('0x3'));var express=require(_0x5f81('0x4'));var router=express[_0x5f81('0x5')]();var fs_extra=require(_0x5f81('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5f81('0x7'));var config=require(_0x5f81('0x8'));var controller=require('./userProfileResource.controller');router[_0x5f81('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f81('0xa')]);router[_0x5f81('0x9')](_0x5f81('0xb'),auth[_0x5f81('0xc')](),controller[_0x5f81('0xd')]);router[_0x5f81('0x9')](_0x5f81('0xe'),auth[_0x5f81('0xc')](),controller['show']);router['post']('/',auth[_0x5f81('0xc')](),controller[_0x5f81('0xf')]);router['put'](_0x5f81('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5f81('0x10')](_0x5f81('0xe'),auth[_0x5f81('0xc')](),controller[_0x5f81('0x11')]);module[_0x5f81('0x12')]=router;
\ No newline at end of file
+var _0xf3e7=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','show','post','create','update','/:id','destroy','multer','util','connect-timeout','express','Router'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf3e7,0x151));var _0x7f3e=function(_0x149ad5,_0x12b417){_0x149ad5=_0x149ad5-0x0;var _0x2566b7=_0xf3e7[_0x149ad5];return _0x2566b7;};'use strict';var multer=require(_0x7f3e('0x0'));var util=require(_0x7f3e('0x1'));var path=require('path');var timeout=require(_0x7f3e('0x2'));var express=require(_0x7f3e('0x3'));var router=express[_0x7f3e('0x4')]();var fs_extra=require(_0x7f3e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7f3e('0x6'));var config=require(_0x7f3e('0x7'));var controller=require(_0x7f3e('0x8'));router[_0x7f3e('0x9')]('/',auth[_0x7f3e('0xa')](),controller[_0x7f3e('0xb')]);router[_0x7f3e('0x9')]('/describe',auth[_0x7f3e('0xa')](),controller['describe']);router[_0x7f3e('0x9')]('/:id',auth[_0x7f3e('0xa')](),controller[_0x7f3e('0xc')]);router[_0x7f3e('0xd')]('/',auth[_0x7f3e('0xa')](),controller[_0x7f3e('0xe')]);router['put']('/:id',auth[_0x7f3e('0xa')](),controller[_0x7f3e('0xf')]);router['delete'](_0x7f3e('0x10'),auth[_0x7f3e('0xa')](),controller[_0x7f3e('0x11')]);module['exports']=router;
\ No newline at end of file
index 5896049..03d2f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd043=['INTEGER','STRING'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xd043,0x199));var _0x3d04=function(_0x2354f1,_0xabfc06){_0x2354f1=_0x2354f1-0x0;var _0x2274ca=_0xd043[_0x2354f1];return _0x2274ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3d04('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3d04('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3d04('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xd45b=['exports','INTEGER','sequelize'];(function(_0x14790f,_0x432b5f){var _0x5acc1f=function(_0x8a1f09){while(--_0x8a1f09){_0x14790f['push'](_0x14790f['shift']());}};_0x5acc1f(++_0x432b5f);}(_0xd45b,0x1b2));var _0xbd45=function(_0x266204,_0x2e1bc2){_0x266204=_0x266204-0x0;var _0x5bc61f=_0xd45b[_0x266204];return _0x5bc61f;};'use strict';var Sequelize=require(_0xbd45('0x0'));module[_0xbd45('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xbd45('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 1a07f49..1e46e2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x30c294,_0x1bf878){var _0x377b38=function(_0x3a2704){while(--_0x3a2704){_0x30c294['push'](_0x30c294['shift']());}};_0x377b38(++_0x1bf878);}(_0x57ca,0x108));var _0xa57c=function(_0xf38d2f,_0x14a6ce){_0xf38d2f=_0xf38d2f-0x0;var _0x57d86a=_0x57ca[_0xf38d2f];return _0x57d86a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));};
\ No newline at end of file
+var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x896e,0x1e9));var _0xe896=function(_0x381263,_0x419a66){_0x381263=_0x381263-0x0;var _0x42405d=_0x896e[_0x381263];return _0x42405d;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));};
\ No newline at end of file
index 00c5a9c..107a034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x232f=['compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources'];(function(_0x51821c,_0x2e39c5){var _0x20bde8=function(_0x2d307a){while(--_0x2d307a){_0x51821c['push'](_0x51821c['shift']());}};_0x20bde8(++_0x2e39c5);}(_0x232f,0xb7));var _0xf232=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x232f[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0xf232('0x0'));var util=require(_0xf232('0x1'));var logger=require(_0xf232('0x2'))('api');var moment=require(_0xf232('0x3'));var BPromise=require(_0xf232('0x4'));var rp=require(_0xf232('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf232('0x6'));var config=require(_0xf232('0x7'));var attributes=require(_0xf232('0x8'));module['exports']=function(_0x2202c3,_0x12d877){return _0x2202c3[_0xf232('0x9')](_0xf232('0xa'),attributes,{'tableName':_0xf232('0xb'),'paranoid':![],'indexes':[{'name':_0xf232('0xc'),'fields':[_0xf232('0xd'),_0xf232('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8b4=['../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2eb7e3,_0x4b86f1){var _0x20b724=function(_0xa5df34){while(--_0xa5df34){_0x2eb7e3['push'](_0x2eb7e3['shift']());}};_0x20b724(++_0x4b86f1);}(_0xf8b4,0xf0));var _0x4f8b=function(_0x10b9a7,_0x4e5179){_0x10b9a7=_0x10b9a7-0x0;var _0x538e50=_0xf8b4[_0x10b9a7];return _0x538e50;};'use strict';var _=require(_0x4f8b('0x0'));var util=require(_0x4f8b('0x1'));var logger=require(_0x4f8b('0x2'))(_0x4f8b('0x3'));var moment=require('moment');var BPromise=require(_0x4f8b('0x4'));var rp=require(_0x4f8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f8b('0x6'));var config=require(_0x4f8b('0x7'));var attributes=require(_0x4f8b('0x8'));module[_0x4f8b('0x9')]=function(_0x171e41,_0x1df301){return _0x171e41[_0x4f8b('0xa')]('UserProfileResource',attributes,{'tableName':_0x4f8b('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x4f8b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index eb0897d..cbcad41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af4=['request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x3f8759,_0x3fe6fb){var _0x2d33ca=function(_0x39b5c9){while(--_0x39b5c9){_0x3f8759['push'](_0x3f8759['shift']());}};_0x2d33ca(++_0x3fe6fb);}(_0x5af4,0x110));var _0x45af=function(_0x436f8c,_0x53c10d){_0x436f8c=_0x436f8c-0x0;var _0x1fa376=_0x5af4[_0x436f8c];return _0x1fa376;};'use strict';var _=require(_0x45af('0x0'));var util=require(_0x45af('0x1'));var moment=require('moment');var BPromise=require(_0x45af('0x2'));var rs=require(_0x45af('0x3'));var fs=require('fs');var Redis=require(_0x45af('0x4'));var db=require(_0x45af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x45af('0x6'))('rpc');var config=require(_0x45af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x45af('0x8')][_0x45af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x98e5ff,_0x256fe8,_0x318fc1){return new BPromise(function(_0x27fc63,_0x447d09){return client[_0x45af('0xa')](_0x98e5ff,_0x318fc1)[_0x45af('0xb')](function(_0x235032){logger['info'](_0x45af('0xc'),_0x256fe8,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x256fe8,_0x45af('0xd'),JSON[_0x45af('0xe')](_0x235032));if(_0x235032[_0x45af('0xf')]){if(_0x235032[_0x45af('0xf')]['code']===0x1f4){logger['error'](_0x45af('0xc'),_0x256fe8,_0x235032[_0x45af('0xf')]['message']);return _0x447d09(_0x235032[_0x45af('0xf')]['message']);}logger['error'](_0x45af('0xc'),_0x256fe8,_0x235032[_0x45af('0xf')][_0x45af('0x10')]);return _0x27fc63(_0x235032[_0x45af('0xf')][_0x45af('0x10')]);}else{logger['info'](_0x45af('0xc'),_0x256fe8,_0x45af('0xd'));_0x27fc63(_0x235032[_0x45af('0x11')][_0x45af('0x10')]);}})[_0x45af('0x12')](function(_0x3e66d6){logger[_0x45af('0xf')](_0x45af('0xc'),_0x256fe8,_0x3e66d6);_0x447d09(_0x3e66d6);});});}
\ No newline at end of file
+var _0xd251=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x595db7,_0x141fa8){var _0x150c39=function(_0x195ec8){while(--_0x195ec8){_0x595db7['push'](_0x595db7['shift']());}};_0x150c39(++_0x141fa8);}(_0xd251,0x1be));var _0x1d25=function(_0x1a1a1b,_0x1640ba){_0x1a1a1b=_0x1a1a1b-0x0;var _0x105882=_0xd251[_0x1a1a1b];return _0x105882;};'use strict';var _=require(_0x1d25('0x0'));var util=require(_0x1d25('0x1'));var moment=require(_0x1d25('0x2'));var BPromise=require(_0x1d25('0x3'));var rs=require(_0x1d25('0x4'));var fs=require('fs');var Redis=require(_0x1d25('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d25('0x6'));var logger=require(_0x1d25('0x7'))(_0x1d25('0x8'));var config=require(_0x1d25('0x9'));var jayson=require(_0x1d25('0xa'));var client=jayson[_0x1d25('0xb')][_0x1d25('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59e109,_0x1c088d,_0x291c84){return new BPromise(function(_0x445394,_0xf0f1f0){return client[_0x1d25('0xd')](_0x59e109,_0x291c84)[_0x1d25('0xe')](function(_0xbf9315){logger['info'](_0x1d25('0xf'),_0x1c088d,_0x1d25('0x10'));logger[_0x1d25('0x11')](_0x1d25('0x12'),_0x1c088d,_0x1d25('0x10'),JSON['stringify'](_0xbf9315));if(_0xbf9315[_0x1d25('0x13')]){if(_0xbf9315['error'][_0x1d25('0x14')]===0x1f4){logger[_0x1d25('0x13')](_0x1d25('0xf'),_0x1c088d,_0xbf9315['error'][_0x1d25('0x15')]);return _0xf0f1f0(_0xbf9315['error'][_0x1d25('0x15')]);}logger[_0x1d25('0x13')](_0x1d25('0xf'),_0x1c088d,_0xbf9315['error'][_0x1d25('0x15')]);return _0x445394(_0xbf9315[_0x1d25('0x13')]['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1c088d,_0x1d25('0x10'));_0x445394(_0xbf9315['result'][_0x1d25('0x15')]);}})[_0x1d25('0x16')](function(_0x56a113){logger[_0x1d25('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1c088d,_0x56a113);_0xf0f1f0(_0x56a113);});});}
\ No newline at end of file
index aa66666..0dfe05a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac8b=['describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xac8b,0xbb));var _0xbac8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xac8b[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xbac8('0x0'));var util=require(_0xbac8('0x1'));var path=require(_0xbac8('0x2'));var timeout=require(_0xbac8('0x3'));var express=require(_0xbac8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbac8('0x5'));var interaction=require(_0xbac8('0x6'));var config=require(_0xbac8('0x7'));var controller=require(_0xbac8('0x8'));router[_0xbac8('0x9')]('/',auth[_0xbac8('0xa')](),controller[_0xbac8('0xb')]);router[_0xbac8('0x9')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller[_0xbac8('0xd')]);router[_0xbac8('0x9')](_0xbac8('0xe'),auth[_0xbac8('0xa')](),controller['show']);router[_0xbac8('0xf')]('/',auth[_0xbac8('0xa')](),controller[_0xbac8('0x10')]);router[_0xbac8('0x11')](_0xbac8('0xe'),auth['isAuthenticated'](),controller[_0xbac8('0x12')]);router['delete'](_0xbac8('0xe'),auth[_0xbac8('0xa')](),controller['destroy']);module[_0xbac8('0x13')]=router;
\ No newline at end of file
+var _0xd598=['/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x37fbbc,_0xb7338a){var _0x48e4fe=function(_0x14a128){while(--_0x14a128){_0x37fbbc['push'](_0x37fbbc['shift']());}};_0x48e4fe(++_0xb7338a);}(_0xd598,0xab));var _0x8d59=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd598[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8d59('0x0'));var util=require(_0x8d59('0x1'));var path=require('path');var timeout=require(_0x8d59('0x2'));var express=require('express');var router=express[_0x8d59('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8d59('0x4'));var config=require(_0x8d59('0x5'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x8d59('0x6')](),controller[_0x8d59('0x7')]);router[_0x8d59('0x8')](_0x8d59('0x9'),auth[_0x8d59('0x6')](),controller[_0x8d59('0xa')]);router[_0x8d59('0x8')](_0x8d59('0xb'),auth['isAuthenticated'](),controller[_0x8d59('0xc')]);router['post']('/',auth[_0x8d59('0x6')](),controller[_0x8d59('0xd')]);router['put'](_0x8d59('0xb'),auth['isAuthenticated'](),controller[_0x8d59('0xe')]);router[_0x8d59('0xf')](_0x8d59('0xb'),auth[_0x8d59('0x6')](),controller[_0x8d59('0x10')]);module[_0x8d59('0x11')]=router;
\ No newline at end of file
index 3d9fdca..b39b57a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373d=['STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','sequelize'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x373d,0x1e2));var _0xd373=function(_0x465147,_0x240ccd){_0x465147=_0x465147-0x0;var _0x5449b5=_0x373d[_0x465147];return _0x5449b5;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd373('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd373('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd373('0x1')],'set':function(_0x547fca){this[_0xd373('0x4')]('crudPermissions',_0x547fca?_0x547fca['join'](''):[]);},'get':function(){return this[_0xd373('0x5')](_0xd373('0x6'))?this[_0xd373('0x5')](_0xd373('0x6'))['split'](''):[];}}};
\ No newline at end of file
+var _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x120d0a,_0x1245bd){var _0x210150=function(_0x562077){while(--_0x562077){_0x120d0a['push'](_0x120d0a['shift']());}};_0x210150(++_0x1245bd);}(_0x6cb4,0xff));var _0x46cb=function(_0x4e7edf,_0x8c0414){_0x4e7edf=_0x4e7edf-0x0;var _0x44666c=_0x6cb4[_0x4e7edf];return _0x44666c;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}};
\ No newline at end of file
index e97cdd1..cab5aaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99cf=['update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x3e5e03,_0x2fac27){var _0x45279e=function(_0xb0f1c8){while(--_0xb0f1c8){_0x3e5e03['push'](_0x3e5e03['shift']());}};_0x45279e(++_0x2fac27);}(_0x99cf,0xef));var _0xf99c=function(_0x76bb8f,_0x2c2820){_0x76bb8f=_0x76bb8f-0x0;var _0x35bc5d=_0x99cf[_0x76bb8f];return _0x35bc5d;};'use strict';var emlformat=require(_0xf99c('0x0'));var rimraf=require(_0xf99c('0x1'));var zipdir=require(_0xf99c('0x2'));var jsonpatch=require(_0xf99c('0x3'));var rp=require(_0xf99c('0x4'));var moment=require(_0xf99c('0x5'));var BPromise=require(_0xf99c('0x6'));var Mustache=require(_0xf99c('0x7'));var util=require(_0xf99c('0x8'));var path=require(_0xf99c('0x9'));var sox=require('sox');var csv=require(_0xf99c('0xa'));var ejs=require(_0xf99c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf99c('0xc'));var squel=require(_0xf99c('0xd'));var crypto=require(_0xf99c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf99c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf99c('0x10'));var Papa=require(_0xf99c('0x11'));var Redis=require(_0xf99c('0x12'));var authService=require(_0xf99c('0x13'));var qs=require(_0xf99c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf99c('0x15'));var logger=require(_0xf99c('0x16'))(_0xf99c('0x17'));var utils=require(_0xf99c('0x18'));var config=require(_0xf99c('0x19'));var licenseUtil=require(_0xf99c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x168d39,_0x1da611){_0x1da611=_0x1da611||0xcc;return function(_0x1285ae){if(_0x1285ae){return _0x168d39[_0xf99c('0x1b')](_0x1da611);}return _0x168d39[_0xf99c('0x1c')](_0x1da611)[_0xf99c('0x1d')]();};}function respondWithResult(_0x3c0717,_0x15e2d1){_0x15e2d1=_0x15e2d1||0xc8;return function(_0x30f64f){if(_0x30f64f){return _0x3c0717[_0xf99c('0x1c')](_0x15e2d1)['json'](_0x30f64f);}};}function respondWithFilteredResult(_0x19c4cb,_0xc44c2b){return function(_0x1b8482){if(_0x1b8482){var _0x499edb=typeof _0xc44c2b[_0xf99c('0x1e')]===_0xf99c('0x1f')&&typeof _0xc44c2b[_0xf99c('0x20')]==='undefined';var _0x12789b=_0x1b8482['count'];var _0x4cba11=_0x499edb?0x0:_0xc44c2b['offset'];var _0x421855=_0x499edb?_0x1b8482[_0xf99c('0x21')]:_0xc44c2b[_0xf99c('0x1e')]+_0xc44c2b[_0xf99c('0x20')];var _0x243ee1;if(_0x421855>=_0x12789b){_0x421855=_0x12789b;_0x243ee1=0xc8;}else{_0x243ee1=0xce;}_0x19c4cb['status'](_0x243ee1);return _0x19c4cb[_0xf99c('0x22')](_0xf99c('0x23'),_0x4cba11+'-'+_0x421855+'/'+_0x12789b)['json'](_0x1b8482);}return null;};}function patchUpdates(_0x285948){return function(_0x2e8caa){try{jsonpatch[_0xf99c('0x24')](_0x2e8caa,_0x285948,!![]);}catch(_0x26fe22){return BPromise[_0xf99c('0x25')](_0x26fe22);}return _0x2e8caa['save']();};}function saveUpdates(_0x522c90,_0x4e35a3){return function(_0x487f2d){if(_0x487f2d){return _0x487f2d['update'](_0x522c90)[_0xf99c('0x26')](function(_0x14587a){return _0x14587a;});}return null;};}function removeEntity(_0x19a3c3,_0x4c464c){return function(_0x37ecba){if(_0x37ecba){return _0x37ecba[_0xf99c('0x27')]()[_0xf99c('0x26')](function(){_0x19a3c3[_0xf99c('0x1c')](0xcc)[_0xf99c('0x1d')]();});}};}function handleEntityNotFound(_0x213fde,_0x523e81){return function(_0x5f3166){if(!_0x5f3166){_0x213fde[_0xf99c('0x1b')](0x194);}return _0x5f3166;};}function handleError(_0x9968aa,_0x57860c){_0x57860c=_0x57860c||0x1f4;return function(_0x1160c6){logger['error'](_0x1160c6[_0xf99c('0x28')]);if(_0x1160c6[_0xf99c('0x29')]){delete _0x1160c6['name'];}_0x9968aa[_0xf99c('0x1c')](_0x57860c)[_0xf99c('0x2a')](_0x1160c6);};}exports[_0xf99c('0x2b')]=function(_0x4b8ce2,_0x58cc07){var _0xc3ea47={},_0x55cfc8={},_0x47e4f7={'count':0x0,'rows':[]};var _0x3eb4bf=_[_0xf99c('0x2c')](db['UserProfileSection'][_0xf99c('0x2d')],function(_0x34a5ef){return{'name':_0x34a5ef[_0xf99c('0x2e')],'type':_0x34a5ef['type'][_0xf99c('0x2f')]};});_0x55cfc8[_0xf99c('0x30')]=_['map'](_0x3eb4bf,_0xf99c('0x29'));_0x55cfc8[_0xf99c('0x31')]=_[_0xf99c('0x32')](_0x4b8ce2[_0xf99c('0x31')]);_0x55cfc8[_0xf99c('0x33')]=_[_0xf99c('0x34')](_0x55cfc8[_0xf99c('0x30')],_0x55cfc8[_0xf99c('0x31')]);_0xc3ea47[_0xf99c('0x35')]=_[_0xf99c('0x34')](_0x55cfc8[_0xf99c('0x30')],qs[_0xf99c('0x36')](_0x4b8ce2[_0xf99c('0x31')][_0xf99c('0x36')]));_0xc3ea47[_0xf99c('0x35')]=_0xc3ea47[_0xf99c('0x35')][_0xf99c('0x37')]?_0xc3ea47[_0xf99c('0x35')]:_0x55cfc8[_0xf99c('0x30')];if(!_0x4b8ce2['query'][_0xf99c('0x38')]('nolimit')){_0xc3ea47[_0xf99c('0x20')]=qs[_0xf99c('0x20')](_0x4b8ce2['query']['limit']);_0xc3ea47[_0xf99c('0x1e')]=qs[_0xf99c('0x1e')](_0x4b8ce2[_0xf99c('0x31')]['offset']);}_0xc3ea47[_0xf99c('0x39')]=qs[_0xf99c('0x3a')](_0x4b8ce2[_0xf99c('0x31')][_0xf99c('0x3a')]);_0xc3ea47['where']=qs[_0xf99c('0x33')](_[_0xf99c('0x3b')](_0x4b8ce2[_0xf99c('0x31')],_0x55cfc8[_0xf99c('0x33')]),_0x3eb4bf);if(_0x4b8ce2[_0xf99c('0x31')][_0xf99c('0x3c')]){_0xc3ea47[_0xf99c('0x3d')]=_[_0xf99c('0x3e')](_0xc3ea47[_0xf99c('0x3d')],{'$or':_[_0xf99c('0x2c')](_0x3eb4bf,function(_0x490c81){if(_0x490c81[_0xf99c('0x3f')]!==_0xf99c('0x40')){var _0x280eb3={};_0x280eb3[_0x490c81[_0xf99c('0x29')]]={'$like':'%'+_0x4b8ce2[_0xf99c('0x31')][_0xf99c('0x3c')]+'%'};return _0x280eb3;}})});}_0xc3ea47=_[_0xf99c('0x3e')]({},_0xc3ea47,_0x4b8ce2[_0xf99c('0x41')]);var _0x5701b8={'where':_0xc3ea47['where']};return db[_0xf99c('0x42')][_0xf99c('0x21')](_0x5701b8)['then'](function(_0x277b0e){_0x47e4f7[_0xf99c('0x21')]=_0x277b0e;if(_0x4b8ce2[_0xf99c('0x31')][_0xf99c('0x43')]){_0xc3ea47[_0xf99c('0x44')]=[{'all':!![]}];}return db[_0xf99c('0x42')][_0xf99c('0x45')](_0xc3ea47);})[_0xf99c('0x26')](function(_0x354678){_0x47e4f7[_0xf99c('0x46')]=_0x354678;return _0x47e4f7;})['then'](respondWithFilteredResult(_0x58cc07,_0xc3ea47))[_0xf99c('0x47')](handleError(_0x58cc07,null));};exports[_0xf99c('0x48')]=function(_0x4eb586,_0x1dacbf){var _0x47bf85={'raw':![],'where':{'id':_0x4eb586[_0xf99c('0x49')]['id']}},_0x15b4fa={};_0x15b4fa[_0xf99c('0x30')]=_[_0xf99c('0x32')](db['UserProfileSection'][_0xf99c('0x2d')]);_0x15b4fa[_0xf99c('0x31')]=_[_0xf99c('0x32')](_0x4eb586[_0xf99c('0x31')]);_0x15b4fa[_0xf99c('0x33')]=_[_0xf99c('0x34')](_0x15b4fa[_0xf99c('0x30')],_0x15b4fa['query']);_0x47bf85[_0xf99c('0x35')]=_['intersection'](_0x15b4fa[_0xf99c('0x30')],qs[_0xf99c('0x36')](_0x4eb586[_0xf99c('0x31')][_0xf99c('0x36')]));_0x47bf85[_0xf99c('0x35')]=_0x47bf85[_0xf99c('0x35')][_0xf99c('0x37')]?_0x47bf85['attributes']:_0x15b4fa[_0xf99c('0x30')];if(_0x4eb586[_0xf99c('0x31')]['includeAll']){_0x47bf85[_0xf99c('0x44')]=[{'all':!![]}];}_0x47bf85=_['merge']({},_0x47bf85,_0x4eb586[_0xf99c('0x41')]);return db[_0xf99c('0x42')][_0xf99c('0x4a')](_0x47bf85)[_0xf99c('0x26')](handleEntityNotFound(_0x1dacbf,null))[_0xf99c('0x26')](respondWithResult(_0x1dacbf,null))[_0xf99c('0x47')](handleError(_0x1dacbf,null));};exports[_0xf99c('0x4b')]=function(_0xec652c,_0x1bd77a){return db[_0xf99c('0x42')]['create'](_0xec652c[_0xf99c('0x4c')],{})[_0xf99c('0x26')](respondWithResult(_0x1bd77a,0xc9))['catch'](handleError(_0x1bd77a,null));};exports[_0xf99c('0x4d')]=function(_0x129f78,_0x122027){if(_0x129f78[_0xf99c('0x4c')]['id']){delete _0x129f78[_0xf99c('0x4c')]['id'];}return db['UserProfileSection'][_0xf99c('0x4a')]({'where':{'id':_0x129f78[_0xf99c('0x49')]['id']}})[_0xf99c('0x26')](handleEntityNotFound(_0x122027,null))[_0xf99c('0x26')](saveUpdates(_0x129f78['body'],null))[_0xf99c('0x26')](respondWithResult(_0x122027,null))['catch'](handleError(_0x122027,null));};exports[_0xf99c('0x27')]=function(_0x1dbc37,_0x58d925){return db[_0xf99c('0x42')][_0xf99c('0x4a')]({'where':{'id':_0x1dbc37[_0xf99c('0x49')]['id']}})[_0xf99c('0x26')](handleEntityNotFound(_0x58d925,null))[_0xf99c('0x26')](removeEntity(_0x58d925,null))['catch'](handleError(_0x58d925,null));};exports[_0xf99c('0x4e')]=function(_0x16027f,_0x229606){return db[_0xf99c('0x42')]['describe']()['then'](respondWithResult(_0x229606,null))['catch'](handleError(_0x229606,null));};
\ No newline at end of file
+var _0x069b=['map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','UserProfileSection','findAll','rows','catch','show','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index'];(function(_0x353be6,_0x2c6ce8){var _0xbcf3a8=function(_0x16a9d1){while(--_0x16a9d1){_0x353be6['push'](_0x353be6['shift']());}};_0xbcf3a8(++_0x2c6ce8);}(_0x069b,0x6c));var _0xb069=function(_0x906e60,_0x8c9eb){_0x906e60=_0x906e60-0x0;var _0x4f9b82=_0x069b[_0x906e60];return _0x4f9b82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb069('0x0'));var zipdir=require(_0xb069('0x1'));var jsonpatch=require(_0xb069('0x2'));var rp=require(_0xb069('0x3'));var moment=require('moment');var BPromise=require(_0xb069('0x4'));var Mustache=require(_0xb069('0x5'));var util=require('util');var path=require(_0xb069('0x6'));var sox=require(_0xb069('0x7'));var csv=require(_0xb069('0x8'));var ejs=require(_0xb069('0x9'));var fs=require('fs');var fs_extra=require(_0xb069('0xa'));var _=require('lodash');var squel=require(_0xb069('0xb'));var crypto=require(_0xb069('0xc'));var jsforce=require(_0xb069('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb069('0x8'));var querystring=require(_0xb069('0xe'));var Papa=require(_0xb069('0xf'));var Redis=require(_0xb069('0x10'));var authService=require(_0xb069('0x11'));var qs=require(_0xb069('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb069('0x13'));var logger=require(_0xb069('0x14'))(_0xb069('0x15'));var utils=require('../../config/utils');var config=require(_0xb069('0x16'));var licenseUtil=require(_0xb069('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28b7a1,_0x2f73a8){_0x2f73a8=_0x2f73a8||0xcc;return function(_0x1a0f1b){if(_0x1a0f1b){return _0x28b7a1[_0xb069('0x18')](_0x2f73a8);}return _0x28b7a1[_0xb069('0x19')](_0x2f73a8)[_0xb069('0x1a')]();};}function respondWithResult(_0x383873,_0x3ffeca){_0x3ffeca=_0x3ffeca||0xc8;return function(_0x2cc5a7){if(_0x2cc5a7){return _0x383873[_0xb069('0x19')](_0x3ffeca)[_0xb069('0x1b')](_0x2cc5a7);}};}function respondWithFilteredResult(_0x3827eb,_0x350eec){return function(_0x392561){if(_0x392561){var _0x1e360b=typeof _0x350eec['offset']===_0xb069('0x1c')&&typeof _0x350eec[_0xb069('0x1d')]===_0xb069('0x1c');var _0x595692=_0x392561[_0xb069('0x1e')];var _0x2acd49=_0x1e360b?0x0:_0x350eec[_0xb069('0x1f')];var _0x1e6b0f=_0x1e360b?_0x392561[_0xb069('0x1e')]:_0x350eec['offset']+_0x350eec[_0xb069('0x1d')];var _0xc8969e;if(_0x1e6b0f>=_0x595692){_0x1e6b0f=_0x595692;_0xc8969e=0xc8;}else{_0xc8969e=0xce;}_0x3827eb['status'](_0xc8969e);return _0x3827eb[_0xb069('0x20')](_0xb069('0x21'),_0x2acd49+'-'+_0x1e6b0f+'/'+_0x595692)[_0xb069('0x1b')](_0x392561);}return null;};}function patchUpdates(_0x46083e){return function(_0xfeccb0){try{jsonpatch[_0xb069('0x22')](_0xfeccb0,_0x46083e,!![]);}catch(_0x308de7){return BPromise[_0xb069('0x23')](_0x308de7);}return _0xfeccb0[_0xb069('0x24')]();};}function saveUpdates(_0x19bebe,_0x4ed8ad){return function(_0x2f4644){if(_0x2f4644){return _0x2f4644[_0xb069('0x25')](_0x19bebe)['then'](function(_0x7b805c){return _0x7b805c;});}return null;};}function removeEntity(_0x4c54fd,_0x231e59){return function(_0x27e648){if(_0x27e648){return _0x27e648[_0xb069('0x26')]()[_0xb069('0x27')](function(){_0x4c54fd[_0xb069('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0dd4,_0x1e8b4c){return function(_0x58a44a){if(!_0x58a44a){_0x5d0dd4['sendStatus'](0x194);}return _0x58a44a;};}function handleError(_0x5190ec,_0x1775ac){_0x1775ac=_0x1775ac||0x1f4;return function(_0x467b1f){logger[_0xb069('0x28')](_0x467b1f['stack']);if(_0x467b1f[_0xb069('0x29')]){delete _0x467b1f['name'];}_0x5190ec['status'](_0x1775ac)[_0xb069('0x2a')](_0x467b1f);};}exports[_0xb069('0x2b')]=function(_0x42075e,_0x456b08){var _0x3d108f={},_0x51e9d4={},_0x385a13={'count':0x0,'rows':[]};var _0x1a31e9=_[_0xb069('0x2c')](db['UserProfileSection'][_0xb069('0x2d')],function(_0x2fcd46){return{'name':_0x2fcd46['fieldName'],'type':_0x2fcd46[_0xb069('0x2e')][_0xb069('0x2f')]};});_0x51e9d4[_0xb069('0x30')]=_[_0xb069('0x2c')](_0x1a31e9,'name');_0x51e9d4['query']=_[_0xb069('0x31')](_0x42075e[_0xb069('0x32')]);_0x51e9d4[_0xb069('0x33')]=_[_0xb069('0x34')](_0x51e9d4[_0xb069('0x30')],_0x51e9d4[_0xb069('0x32')]);_0x3d108f[_0xb069('0x35')]=_[_0xb069('0x34')](_0x51e9d4['model'],qs[_0xb069('0x36')](_0x42075e[_0xb069('0x32')][_0xb069('0x36')]));_0x3d108f[_0xb069('0x35')]=_0x3d108f[_0xb069('0x35')][_0xb069('0x37')]?_0x3d108f['attributes']:_0x51e9d4[_0xb069('0x30')];if(!_0x42075e[_0xb069('0x32')][_0xb069('0x38')]('nolimit')){_0x3d108f['limit']=qs[_0xb069('0x1d')](_0x42075e[_0xb069('0x32')][_0xb069('0x1d')]);_0x3d108f['offset']=qs[_0xb069('0x1f')](_0x42075e['query'][_0xb069('0x1f')]);}_0x3d108f['order']=qs[_0xb069('0x39')](_0x42075e[_0xb069('0x32')]['sort']);_0x3d108f[_0xb069('0x3a')]=qs[_0xb069('0x33')](_[_0xb069('0x3b')](_0x42075e[_0xb069('0x32')],_0x51e9d4[_0xb069('0x33')]),_0x1a31e9);if(_0x42075e[_0xb069('0x32')][_0xb069('0x3c')]){_0x3d108f['where']=_[_0xb069('0x3d')](_0x3d108f[_0xb069('0x3a')],{'$or':_['map'](_0x1a31e9,function(_0x1199c1){if(_0x1199c1[_0xb069('0x2e')]!==_0xb069('0x3e')){var _0x4cd0a9={};_0x4cd0a9[_0x1199c1[_0xb069('0x29')]]={'$like':'%'+_0x42075e['query']['filter']+'%'};return _0x4cd0a9;}})});}_0x3d108f=_[_0xb069('0x3d')]({},_0x3d108f,_0x42075e[_0xb069('0x3f')]);var _0x3ebfb6={'where':_0x3d108f[_0xb069('0x3a')]};return db['UserProfileSection'][_0xb069('0x1e')](_0x3ebfb6)['then'](function(_0x59a13a){_0x385a13[_0xb069('0x1e')]=_0x59a13a;if(_0x42075e[_0xb069('0x32')][_0xb069('0x40')]){_0x3d108f[_0xb069('0x41')]=[{'all':!![]}];}return db[_0xb069('0x42')][_0xb069('0x43')](_0x3d108f);})['then'](function(_0x4dffca){_0x385a13[_0xb069('0x44')]=_0x4dffca;return _0x385a13;})[_0xb069('0x27')](respondWithFilteredResult(_0x456b08,_0x3d108f))[_0xb069('0x45')](handleError(_0x456b08,null));};exports[_0xb069('0x46')]=function(_0x33fa40,_0x3937d5){var _0x2bf4bf={'raw':![],'where':{'id':_0x33fa40['params']['id']}},_0x4d44ea={};_0x4d44ea[_0xb069('0x30')]=_[_0xb069('0x31')](db['UserProfileSection'][_0xb069('0x2d')]);_0x4d44ea['query']=_[_0xb069('0x31')](_0x33fa40[_0xb069('0x32')]);_0x4d44ea[_0xb069('0x33')]=_[_0xb069('0x34')](_0x4d44ea[_0xb069('0x30')],_0x4d44ea[_0xb069('0x32')]);_0x2bf4bf['attributes']=_[_0xb069('0x34')](_0x4d44ea['model'],qs[_0xb069('0x36')](_0x33fa40[_0xb069('0x32')]['fields']));_0x2bf4bf[_0xb069('0x35')]=_0x2bf4bf[_0xb069('0x35')][_0xb069('0x37')]?_0x2bf4bf[_0xb069('0x35')]:_0x4d44ea['model'];if(_0x33fa40[_0xb069('0x32')][_0xb069('0x40')]){_0x2bf4bf[_0xb069('0x41')]=[{'all':!![]}];}_0x2bf4bf=_[_0xb069('0x3d')]({},_0x2bf4bf,_0x33fa40[_0xb069('0x3f')]);return db['UserProfileSection'][_0xb069('0x47')](_0x2bf4bf)['then'](handleEntityNotFound(_0x3937d5,null))['then'](respondWithResult(_0x3937d5,null))[_0xb069('0x45')](handleError(_0x3937d5,null));};exports[_0xb069('0x48')]=function(_0x5aef02,_0x53b4e2){return db['UserProfileSection'][_0xb069('0x48')](_0x5aef02['body'],{})[_0xb069('0x27')](respondWithResult(_0x53b4e2,0xc9))[_0xb069('0x45')](handleError(_0x53b4e2,null));};exports['update']=function(_0x1619be,_0x523888){if(_0x1619be[_0xb069('0x49')]['id']){delete _0x1619be[_0xb069('0x49')]['id'];}return db[_0xb069('0x42')]['find']({'where':{'id':_0x1619be['params']['id']}})[_0xb069('0x27')](handleEntityNotFound(_0x523888,null))[_0xb069('0x27')](saveUpdates(_0x1619be[_0xb069('0x49')],null))[_0xb069('0x27')](respondWithResult(_0x523888,null))[_0xb069('0x45')](handleError(_0x523888,null));};exports[_0xb069('0x26')]=function(_0x1fd4f0,_0x220040){return db['UserProfileSection'][_0xb069('0x47')]({'where':{'id':_0x1fd4f0[_0xb069('0x4a')]['id']}})[_0xb069('0x27')](handleEntityNotFound(_0x220040,null))[_0xb069('0x27')](removeEntity(_0x220040,null))[_0xb069('0x45')](handleError(_0x220040,null));};exports[_0xb069('0x4b')]=function(_0x305294,_0xdd6ad6){return db['UserProfileSection']['describe']()[_0xb069('0x27')](respondWithResult(_0xdd6ad6,null))[_0xb069('0x45')](handleError(_0xdd6ad6,null));};
\ No newline at end of file
index 03eedb6..dfe8988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bac=['compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define'];(function(_0x30a6fb,_0x5038d7){var _0x2feb32=function(_0x124f94){while(--_0x124f94){_0x30a6fb['push'](_0x30a6fb['shift']());}};_0x2feb32(++_0x5038d7);}(_0x4bac,0xb9));var _0xc4ba=function(_0x511494,_0x24912c){_0x511494=_0x511494-0x0;var _0x4dea3b=_0x4bac[_0x511494];return _0x4dea3b;};'use strict';var _=require(_0xc4ba('0x0'));var util=require('util');var logger=require(_0xc4ba('0x1'))(_0xc4ba('0x2'));var moment=require('moment');var BPromise=require(_0xc4ba('0x3'));var rp=require(_0xc4ba('0x4'));var fs=require('fs');var path=require(_0xc4ba('0x5'));var rimraf=require(_0xc4ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xc4ba('0x7'));module[_0xc4ba('0x8')]=function(_0x102239,_0x3279ca){return _0x102239[_0xc4ba('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xc4ba('0xa'),'fields':[_0xc4ba('0xb'),_0xc4ba('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x038f=['compositeIndex','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./userProfileSection.attributes','exports','define','user_profile_has_sections'];(function(_0x2dd55c,_0x71d38c){var _0x4dfdd6=function(_0x5291da){while(--_0x5291da){_0x2dd55c['push'](_0x2dd55c['shift']());}};_0x4dfdd6(++_0x71d38c);}(_0x038f,0x106));var _0xf038=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x038f[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xf038('0x0'));var util=require(_0xf038('0x1'));var logger=require(_0xf038('0x2'))('api');var moment=require(_0xf038('0x3'));var BPromise=require(_0xf038('0x4'));var rp=require(_0xf038('0x5'));var fs=require('fs');var path=require(_0xf038('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf038('0x7'));module[_0xf038('0x8')]=function(_0x15077c,_0x2b84c5){return _0x15077c[_0xf038('0x9')]('UserProfileSection',attributes,{'tableName':_0xf038('0xa'),'paranoid':![],'indexes':[{'name':_0xf038('0xb'),'fields':['sectionId',_0xf038('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a736a4a..e625a83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d4=['request\x20sent','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x2d3030,_0x2daea2){var _0x247c7e=function(_0x59b550){while(--_0x59b550){_0x2d3030['push'](_0x2d3030['shift']());}};_0x247c7e(++_0x2daea2);}(_0x16d4,0x183));var _0x416d=function(_0x4eb52d,_0x14cfd3){_0x4eb52d=_0x4eb52d-0x0;var _0x1de5b8=_0x16d4[_0x4eb52d];return _0x1de5b8;};'use strict';var _=require(_0x416d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x416d('0x1'));var rs=require(_0x416d('0x2'));var fs=require('fs');var Redis=require(_0x416d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x416d('0x4'))('rpc');var config=require(_0x416d('0x5'));var jayson=require(_0x416d('0x6'));var client=jayson[_0x416d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14486c,_0x4284ab,_0x4aa345){return new BPromise(function(_0x5caa04,_0x59ff12){return client[_0x416d('0x8')](_0x14486c,_0x4aa345)[_0x416d('0x9')](function(_0x4d04a3){logger[_0x416d('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x4284ab,'request\x20sent');logger['debug'](_0x416d('0xb'),_0x4284ab,_0x416d('0xc'),JSON[_0x416d('0xd')](_0x4d04a3));if(_0x4d04a3[_0x416d('0xe')]){if(_0x4d04a3[_0x416d('0xe')][_0x416d('0xf')]===0x1f4){logger[_0x416d('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x4284ab,_0x4d04a3['error'][_0x416d('0x10')]);return _0x59ff12(_0x4d04a3['error'][_0x416d('0x10')]);}logger[_0x416d('0xe')](_0x416d('0x11'),_0x4284ab,_0x4d04a3[_0x416d('0xe')][_0x416d('0x10')]);return _0x5caa04(_0x4d04a3[_0x416d('0xe')][_0x416d('0x10')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4284ab,_0x416d('0xc'));_0x5caa04(_0x4d04a3[_0x416d('0x12')]['message']);}})['catch'](function(_0x41c2ea){logger[_0x416d('0xe')](_0x416d('0x11'),_0x4284ab,_0x41c2ea);_0x59ff12(_0x41c2ea);});});}
\ No newline at end of file
+var _0xc3a8=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s'];(function(_0x3162d9,_0x4501a3){var _0x559d08=function(_0x2d052e){while(--_0x2d052e){_0x3162d9['push'](_0x3162d9['shift']());}};_0x559d08(++_0x4501a3);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xc3a8[_0x57f8c0];return _0x117f08;};'use strict';var _=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var moment=require(_0x8c3a('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c3a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c3a('0x4'))['db'];var utils=require(_0x8c3a('0x5'));var logger=require(_0x8c3a('0x6'))(_0x8c3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c3a('0x8'));var client=jayson[_0x8c3a('0x9')][_0x8c3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x170999,_0x2fae6f,_0x37047e){return new BPromise(function(_0x58a9b0,_0x174e6c){return client[_0x8c3a('0xb')](_0x170999,_0x37047e)[_0x8c3a('0xc')](function(_0x1593a7){logger[_0x8c3a('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x2fae6f,_0x8c3a('0xe'));logger[_0x8c3a('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2fae6f,_0x8c3a('0xe'),JSON[_0x8c3a('0x10')](_0x1593a7));if(_0x1593a7[_0x8c3a('0x11')]){if(_0x1593a7[_0x8c3a('0x11')][_0x8c3a('0x12')]===0x1f4){logger[_0x8c3a('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2fae6f,_0x1593a7[_0x8c3a('0x11')]['message']);return _0x174e6c(_0x1593a7['error'][_0x8c3a('0x13')]);}logger[_0x8c3a('0x11')](_0x8c3a('0x14'),_0x2fae6f,_0x1593a7[_0x8c3a('0x11')][_0x8c3a('0x13')]);return _0x58a9b0(_0x1593a7[_0x8c3a('0x11')][_0x8c3a('0x13')]);}else{logger[_0x8c3a('0xd')](_0x8c3a('0x14'),_0x2fae6f,'request\x20sent');_0x58a9b0(_0x1593a7[_0x8c3a('0x15')][_0x8c3a('0x13')]);}})[_0x8c3a('0x16')](function(_0x1ee355){logger[_0x8c3a('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2fae6f,_0x1ee355);_0x174e6c(_0x1ee355);});});}
\ No newline at end of file
index 87f633d..d0545e5 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(_0xd897b2,_0x22667b){var _0x3a574c=function(_0x25d8f6){while(--_0x25d8f6){_0xd897b2['push'](_0xd897b2['shift']());}};_0x3a574c(++_0x22667b);}(_0xe706,0xa3));var _0x6e70=function(_0x7cacf9,_0x6dac99){_0x7cacf9=_0x7cacf9-0x0;var _0xde6456=_0xe706[_0x7cacf9];return _0xde6456;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x45564a,_0x160043){var _0x1184c7=function(_0x529f16){while(--_0x529f16){_0x45564a['push'](_0x45564a['shift']());}};_0x1184c7(++_0x160043);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 17bf01d..80723c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d90=['INTEGER','sequelize','exports'];(function(_0x5a0b7d,_0x5cb238){var _0x68fb18=function(_0x3ce995){while(--_0x3ce995){_0x5a0b7d['push'](_0x5a0b7d['shift']());}};_0x68fb18(++_0x5cb238);}(_0x3d90,0x169));var _0x03d9=function(_0x5b32c6,_0x1e2fc6){_0x5b32c6=_0x5b32c6-0x0;var _0x2aa82a=_0x3d90[_0x5b32c6];return _0x2aa82a;};'use strict';var Sequelize=require(_0x03d9('0x0'));module[_0x03d9('0x1')]={'penalty':{'type':Sequelize[_0x03d9('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3691=['exports','INTEGER'];(function(_0x38c63a,_0x4cc960){var _0x43b50d=function(_0x2d4359){while(--_0x2d4359){_0x38c63a['push'](_0x38c63a['shift']());}};_0x43b50d(++_0x4cc960);}(_0x3691,0x98));var _0x1369=function(_0x27d4f3,_0x1b6954){_0x27d4f3=_0x27d4f3-0x0;var _0x6c7485=_0x3691[_0x27d4f3];return _0x6c7485;};'use strict';var Sequelize=require('sequelize');module[_0x1369('0x0')]={'penalty':{'type':Sequelize[_0x1369('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 070e797..82ec8ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf970=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2f02bb,_0x4dc6a0){var _0x471a5c=function(_0x5daab7){while(--_0x5daab7){_0x2f02bb['push'](_0x2f02bb['shift']());}};_0x471a5c(++_0x4dc6a0);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require('util');var logger=require(_0x0f97('0x1'))(_0x0f97('0x2'));var moment=require(_0x0f97('0x3'));var BPromise=require(_0x0f97('0x4'));var rp=require(_0x0f97('0x5'));var fs=require('fs');var path=require(_0x0f97('0x6'));var rimraf=require(_0x0f97('0x7'));var config=require('../../config/environment');var attributes=require(_0x0f97('0x8'));module[_0x0f97('0x9')]=function(_0x290200,_0xac501){return _0x290200[_0x0f97('0xa')](_0x0f97('0xb'),attributes,{'tableName':_0x0f97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef17=['./userSmsQueue.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0xef17,0x136));var _0x7ef1=function(_0x103315,_0x52d5c3){_0x103315=_0x103315-0x0;var _0x3d83a0=_0xef17[_0x103315];return _0x3d83a0;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require(_0x7ef1('0x5'));var rp=require(_0x7ef1('0x6'));var fs=require('fs');var path=require(_0x7ef1('0x7'));var rimraf=require(_0x7ef1('0x8'));var config=require('../../config/environment');var attributes=require(_0x7ef1('0x9'));module['exports']=function(_0x138ed1,_0x498596){return _0x138ed1[_0x7ef1('0xa')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 73f7da8..6a9873d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7832=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x59d149,_0x1658f6){var _0x5dc8c6=function(_0x470dc7){while(--_0x470dc7){_0x59d149['push'](_0x59d149['shift']());}};_0x5dc8c6(++_0x1658f6);}(_0x7832,0x11d));var _0x2783=function(_0x210fd7,_0x4c0c29){_0x210fd7=_0x210fd7-0x0;var _0xd2c532=_0x7832[_0x210fd7];return _0xd2c532;};'use strict';var _=require(_0x2783('0x0'));var util=require(_0x2783('0x1'));var moment=require('moment');var BPromise=require(_0x2783('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2783('0x3'));var db=require(_0x2783('0x4'))['db'];var utils=require(_0x2783('0x5'));var logger=require(_0x2783('0x6'))(_0x2783('0x7'));var config=require(_0x2783('0x8'));var jayson=require(_0x2783('0x9'));var client=jayson[_0x2783('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x668fc9,_0x4d4b1f,_0x3ade3d){return new BPromise(function(_0x5efda2,_0x420b57){return client[_0x2783('0xb')](_0x668fc9,_0x3ade3d)['then'](function(_0x50c15b){logger[_0x2783('0xc')](_0x2783('0xd'),_0x4d4b1f,_0x2783('0xe'));logger[_0x2783('0xf')](_0x2783('0x10'),_0x4d4b1f,_0x2783('0xe'),JSON[_0x2783('0x11')](_0x50c15b));if(_0x50c15b[_0x2783('0x12')]){if(_0x50c15b[_0x2783('0x12')][_0x2783('0x13')]===0x1f4){logger[_0x2783('0x12')](_0x2783('0xd'),_0x4d4b1f,_0x50c15b[_0x2783('0x12')][_0x2783('0x14')]);return _0x420b57(_0x50c15b[_0x2783('0x12')][_0x2783('0x14')]);}logger[_0x2783('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x4d4b1f,_0x50c15b[_0x2783('0x12')][_0x2783('0x14')]);return _0x5efda2(_0x50c15b['error'][_0x2783('0x14')]);}else{logger[_0x2783('0xc')](_0x2783('0xd'),_0x4d4b1f,_0x2783('0xe'));_0x5efda2(_0x50c15b[_0x2783('0x15')]['message']);}})['catch'](function(_0x5ac9ef){logger[_0x2783('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x4d4b1f,_0x5ac9ef);_0x420b57(_0x5ac9ef);});});}
\ No newline at end of file
+var _0xd4bd=['code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x4baa68,_0x47c725){var _0x36e4de=function(_0x1bc441){while(--_0x1bc441){_0x4baa68['push'](_0x4baa68['shift']());}};_0x36e4de(++_0x47c725);}(_0xd4bd,0x193));var _0xdd4b=function(_0xa9023e,_0x167e1d){_0xa9023e=_0xa9023e-0x0;var _0x36c6d5=_0xd4bd[_0xa9023e];return _0x36c6d5;};'use strict';var _=require(_0xdd4b('0x0'));var util=require('util');var moment=require(_0xdd4b('0x1'));var BPromise=require(_0xdd4b('0x2'));var rs=require(_0xdd4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd4b('0x4'))['db'];var utils=require(_0xdd4b('0x5'));var logger=require('../../config/logger')(_0xdd4b('0x6'));var config=require(_0xdd4b('0x7'));var jayson=require(_0xdd4b('0x8'));var client=jayson[_0xdd4b('0x9')][_0xdd4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bd70c,_0x16ae9b,_0x5cc0cc){return new BPromise(function(_0x4205ff,_0x5e4714){return client[_0xdd4b('0xb')](_0x1bd70c,_0x5cc0cc)[_0xdd4b('0xc')](function(_0x5a2fd1){logger[_0xdd4b('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x16ae9b,_0xdd4b('0xe'));logger[_0xdd4b('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x16ae9b,'request\x20sent',JSON['stringify'](_0x5a2fd1));if(_0x5a2fd1[_0xdd4b('0x10')]){if(_0x5a2fd1[_0xdd4b('0x10')][_0xdd4b('0x11')]===0x1f4){logger['error'](_0xdd4b('0x12'),_0x16ae9b,_0x5a2fd1['error']['message']);return _0x5e4714(_0x5a2fd1['error'][_0xdd4b('0x13')]);}logger[_0xdd4b('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x16ae9b,_0x5a2fd1[_0xdd4b('0x10')][_0xdd4b('0x13')]);return _0x4205ff(_0x5a2fd1[_0xdd4b('0x10')]['message']);}else{logger[_0xdd4b('0xd')](_0xdd4b('0x12'),_0x16ae9b,_0xdd4b('0xe'));_0x4205ff(_0x5a2fd1['result']['message']);}})[_0xdd4b('0x14')](function(_0x1d2407){logger[_0xdd4b('0x10')](_0xdd4b('0x12'),_0x16ae9b,_0x1d2407);_0x5e4714(_0x1d2407);});});}
\ No newline at end of file
index 9cb6e5a..6382a04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x975d=['sequelize','exports','INTEGER'];(function(_0x415b51,_0x1a29ee){var _0x1dd82c=function(_0x25afee){while(--_0x25afee){_0x415b51['push'](_0x415b51['shift']());}};_0x1dd82c(++_0x1a29ee);}(_0x975d,0x177));var _0xd975=function(_0x5a8157,_0xf3edd9){_0x5a8157=_0x5a8157-0x0;var _0x9583cb=_0x975d[_0x5a8157];return _0x9583cb;};'use strict';var Sequelize=require(_0xd975('0x0'));module[_0xd975('0x1')]={'UserId':{'type':Sequelize[_0xd975('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd975('0x2')]}};
\ No newline at end of file
+var _0xa6c9=['INTEGER','exports'];(function(_0x29cb61,_0x494484){var _0x21d3e0=function(_0x3e0ac4){while(--_0x3e0ac4){_0x29cb61['push'](_0x29cb61['shift']());}};_0x21d3e0(++_0x494484);}(_0xa6c9,0x1e1));var _0x9a6c=function(_0x15b664,_0x577f84){_0x15b664=_0x15b664-0x0;var _0x58da81=_0xa6c9[_0x15b664];return _0x58da81;};'use strict';var Sequelize=require('sequelize');module[_0x9a6c('0x0')]={'UserId':{'type':Sequelize[_0x9a6c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x9a6c('0x1')]}};
\ No newline at end of file
index 3f2cf59..e18ff84 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(_0x36b21a,_0x243a9d){var _0x3cb37e=function(_0x1c655f){while(--_0x1c655f){_0x36b21a['push'](_0x36b21a['shift']());}};_0x3cb37e(++_0x243a9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x172c12,_0x229811){var _0xc55fb4=function(_0x765625){while(--_0x765625){_0x172c12['push'](_0x172c12['shift']());}};_0xc55fb4(++_0x229811);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 4acd7ce..ca4d6b0 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(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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(_0x2f2dba,_0x451d2e){var _0x27e85e=function(_0x512386){while(--_0x512386){_0x2f2dba['push'](_0x2f2dba['shift']());}};_0x27e85e(++_0x451d2e);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'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 7770447..70ef795 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff3c=['exports','sequelize'];(function(_0x151beb,_0x50cdf9){var _0x96f6bd=function(_0xd73dd7){while(--_0xd73dd7){_0x151beb['push'](_0x151beb['shift']());}};_0x96f6bd(++_0x50cdf9);}(_0xff3c,0x179));var _0xcff3=function(_0x3de92a,_0x2c7307){_0x3de92a=_0x3de92a-0x0;var _0x576839=_0xff3c[_0x3de92a];return _0x576839;};'use strict';var Sequelize=require(_0xcff3('0x0'));module[_0xcff3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5c83=['INTEGER','sequelize','exports'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x5c83,0xb2));var _0x35c8=function(_0x9ffdd8,_0x414bbd){_0x9ffdd8=_0x9ffdd8-0x0;var _0x222710=_0x5c83[_0x9ffdd8];return _0x222710;};'use strict';var Sequelize=require(_0x35c8('0x0'));module[_0x35c8('0x1')]={'penalty':{'type':Sequelize[_0x35c8('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 0a7a0b1..a041f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef2f=['lodash','util','../../config/logger','api','moment','path','rimraf','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0x4ca463,_0x31413f){var _0x37fa90=function(_0x18f6ca){while(--_0x18f6ca){_0x4ca463['push'](_0x4ca463['shift']());}};_0x37fa90(++_0x31413f);}(_0xef2f,0x129));var _0xfef2=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xef2f[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xfef2('0x0'));var util=require(_0xfef2('0x1'));var logger=require(_0xfef2('0x2'))(_0xfef2('0x3'));var moment=require(_0xfef2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfef2('0x5'));var rimraf=require(_0xfef2('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef2('0x7'));module[_0xfef2('0x8')]=function(_0x5757ab,_0xc49bee){return _0x5757ab[_0xfef2('0x9')]('UserVoiceQueue',attributes,{'tableName':_0xfef2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x19b8=['moment','bluebird','request-promise','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x3790a6,_0x276d65){var _0xe6a81b=function(_0x3025a3){while(--_0x3025a3){_0x3790a6['push'](_0x3790a6['shift']());}};_0xe6a81b(++_0x276d65);}(_0x19b8,0xb7));var _0x819b=function(_0x41e9af,_0x32f8aa){_0x41e9af=_0x41e9af-0x0;var _0x1a08f9=_0x19b8[_0x41e9af];return _0x1a08f9;};'use strict';var _=require(_0x819b('0x0'));var util=require(_0x819b('0x1'));var logger=require(_0x819b('0x2'))(_0x819b('0x3'));var moment=require(_0x819b('0x4'));var BPromise=require(_0x819b('0x5'));var rp=require(_0x819b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x819b('0x7'));module[_0x819b('0x8')]=function(_0x57c185,_0x1a71b3){return _0x57c185[_0x819b('0x9')](_0x819b('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index efeac02..136ae53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2245=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','bluebird'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x2245,0xda));var _0x5224=function(_0x196533,_0x2d9aab){_0x196533=_0x196533-0x0;var _0x208ccc=_0x2245[_0x196533];return _0x208ccc;};'use strict';var _=require('lodash');var util=require(_0x5224('0x0'));var moment=require('moment');var BPromise=require(_0x5224('0x1'));var rs=require(_0x5224('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5224('0x3'));var logger=require(_0x5224('0x4'))(_0x5224('0x5'));var config=require(_0x5224('0x6'));var jayson=require(_0x5224('0x7'));var client=jayson[_0x5224('0x8')][_0x5224('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ce655,_0x159e89,_0x49f91d){return new BPromise(function(_0x36298b,_0x4b620e){return client['request'](_0x1ce655,_0x49f91d)[_0x5224('0xa')](function(_0x4bd2b8){logger[_0x5224('0xb')](_0x5224('0xc'),_0x159e89,'request\x20sent');logger['debug'](_0x5224('0xd'),_0x159e89,_0x5224('0xe'),JSON[_0x5224('0xf')](_0x4bd2b8));if(_0x4bd2b8[_0x5224('0x10')]){if(_0x4bd2b8[_0x5224('0x10')][_0x5224('0x11')]===0x1f4){logger['error'](_0x5224('0xc'),_0x159e89,_0x4bd2b8[_0x5224('0x10')][_0x5224('0x12')]);return _0x4b620e(_0x4bd2b8[_0x5224('0x10')]['message']);}logger[_0x5224('0x10')](_0x5224('0xc'),_0x159e89,_0x4bd2b8[_0x5224('0x10')][_0x5224('0x12')]);return _0x36298b(_0x4bd2b8[_0x5224('0x10')][_0x5224('0x12')]);}else{logger[_0x5224('0xb')](_0x5224('0xc'),_0x159e89,_0x5224('0xe'));_0x36298b(_0x4bd2b8['result'][_0x5224('0x12')]);}})[_0x5224('0x13')](function(_0x42f6a7){logger[_0x5224('0x10')](_0x5224('0xc'),_0x159e89,_0x42f6a7);_0x4b620e(_0x42f6a7);});});}
\ No newline at end of file
+var _0x8e1c=['http','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x459b25,_0x53c79d){var _0x5cfd50=function(_0x22d099){while(--_0x22d099){_0x459b25['push'](_0x459b25['shift']());}};_0x5cfd50(++_0x53c79d);}(_0x8e1c,0x146));var _0xc8e1=function(_0x5d37c2,_0x36efb8){_0x5d37c2=_0x5d37c2-0x0;var _0x19a9be=_0x8e1c[_0x5d37c2];return _0x19a9be;};'use strict';var _=require(_0xc8e1('0x0'));var util=require(_0xc8e1('0x1'));var moment=require(_0xc8e1('0x2'));var BPromise=require(_0xc8e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8e1('0x4'));var db=require(_0xc8e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8e1('0x6'))(_0xc8e1('0x7'));var config=require(_0xc8e1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc8e1('0x9')][_0xc8e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a1a7,_0x5c7891,_0x1c17e3){return new BPromise(function(_0x86241d,_0x10d03e){return client[_0xc8e1('0xb')](_0x50a1a7,_0x1c17e3)[_0xc8e1('0xc')](function(_0xfce75c){logger[_0xc8e1('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x5c7891,'request\x20sent');logger[_0xc8e1('0xe')](_0xc8e1('0xf'),_0x5c7891,'request\x20sent',JSON[_0xc8e1('0x10')](_0xfce75c));if(_0xfce75c['error']){if(_0xfce75c[_0xc8e1('0x11')][_0xc8e1('0x12')]===0x1f4){logger[_0xc8e1('0x11')](_0xc8e1('0x13'),_0x5c7891,_0xfce75c[_0xc8e1('0x11')][_0xc8e1('0x14')]);return _0x10d03e(_0xfce75c[_0xc8e1('0x11')][_0xc8e1('0x14')]);}logger[_0xc8e1('0x11')](_0xc8e1('0x13'),_0x5c7891,_0xfce75c[_0xc8e1('0x11')]['message']);return _0x86241d(_0xfce75c['error'][_0xc8e1('0x14')]);}else{logger[_0xc8e1('0xd')](_0xc8e1('0x13'),_0x5c7891,_0xc8e1('0x15'));_0x86241d(_0xfce75c[_0xc8e1('0x16')][_0xc8e1('0x14')]);}})[_0xc8e1('0x17')](function(_0x2471e9){logger[_0xc8e1('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x5c7891,_0x2471e9);_0x10d03e(_0x2471e9);});});}
\ No newline at end of file
index fdc06aa..d798924 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(_0x2f5317,_0x2b6448){var _0x5dd8c1=function(_0x446def){while(--_0x446def){_0x2f5317['push'](_0x2f5317['shift']());}};_0x5dd8c1(++_0x2b6448);}(_0x70e0,0x17b));var _0x070e=function(_0x2dac29,_0x56a94d){_0x2dac29=_0x2dac29-0x0;var _0x3699c8=_0x70e0[_0x2dac29];return _0x3699c8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f0c05,_0x5b66e4){var _0x2f2150=function(_0x121c32){while(--_0x121c32){_0x2f0c05['push'](_0x2f0c05['shift']());}};_0x2f2150(++_0x5b66e4);}(_0xe706,0xa3));var _0x6e70=function(_0x188741,_0x243906){_0x188741=_0x188741-0x0;var _0x5e9290=_0xe706[_0x188741];return _0x5e9290;};'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 edfc142..93ab812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a8=['Required\x20by\x20Asterisk','sequelize','INTEGER','STRING','queue_interface'];(function(_0x1c1783,_0x1928f9){var _0x35dbaf=function(_0x2dc281){while(--_0x2dc281){_0x1c1783['push'](_0x1c1783['shift']());}};_0x35dbaf(++_0x1928f9);}(_0x95a8,0x1dc));var _0x895a=function(_0x3454ba,_0x5dd876){_0x3454ba=_0x3454ba-0x0;var _0x16bf4f=_0x95a8[_0x3454ba];return _0x16bf4f;};'use strict';var Sequelize=require(_0x895a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x895a('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x895a('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x895a('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x895a('0x2')],'allowNull':![],'unique':_0x895a('0x3'),'comment':_0x895a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x895a('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x895a('0x2')],'allowNull':![],'unique':_0x895a('0x3'),'comment':_0x895a('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x895a('0x4')},'paused':{'type':Sequelize[_0x895a('0x1')](0xb),'defaultValue':0x0,'comment':_0x895a('0x4')}};
\ No newline at end of file
+var _0x5e63=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5e63,0x17a));var _0x35e6=function(_0x4f9368,_0x545aad){_0x4f9368=_0x4f9368-0x0;var _0x1ae968=_0x5e63[_0x4f9368];return _0x1ae968;};'use strict';var Sequelize=require(_0x35e6('0x0'));module[_0x35e6('0x1')]={'uniqueid':{'type':Sequelize[_0x35e6('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x35e6('0x3')},'membername':{'type':Sequelize[_0x35e6('0x4')],'allowNull':![],'comment':_0x35e6('0x3')},'UserId':{'type':Sequelize[_0x35e6('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x35e6('0x4')],'allowNull':![],'unique':_0x35e6('0x5'),'comment':_0x35e6('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35e6('0x5'),'comment':_0x35e6('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x35e6('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x35e6('0x3')}};
\ No newline at end of file
index b9c1f4b..e811f9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d81=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','save','update'];(function(_0x44d809,_0x1f76fb){var _0x5361b9=function(_0x3e2a7f){while(--_0x3e2a7f){_0x44d809['push'](_0x44d809['shift']());}};_0x5361b9(++_0x1f76fb);}(_0x9d81,0x199));var _0x19d8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9d81[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x19d8('0x0'));var UserVoiceQueueRt=require(_0x19d8('0x1'))['db'][_0x19d8('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x19d8('0x3'),'afterUpdate':_0x19d8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e7c75){return function(_0x1cc739,_0x5c7345,_0x2445ab){UserVoiceQueueRtEvents['emit'](_0x3e7c75+':'+_0x1cc739['id'],_0x1cc739);UserVoiceQueueRtEvents[_0x19d8('0x5')](_0x3e7c75,_0x1cc739);_0x2445ab(null);};}for(var e in events){if(events[_0x19d8('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x19d8('0x7')](e,emitEvent(event));}}module[_0x19d8('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xada7=['update','remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x1d7824,_0x425258){var _0x550a32=function(_0x579528){while(--_0x579528){_0x1d7824['push'](_0x1d7824['shift']());}};_0x550a32(++_0x425258);}(_0xada7,0x159));var _0x7ada=function(_0x5d44e8,_0xfe139a){_0x5d44e8=_0x5d44e8-0x0;var _0xd06ec6=_0xada7[_0x5d44e8];return _0xd06ec6;};'use strict';var EventEmitter=require(_0x7ada('0x0'));var UserVoiceQueueRt=require(_0x7ada('0x1'))['db'][_0x7ada('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7ada('0x3')](0x0);var events={'afterCreate':_0x7ada('0x4'),'afterUpdate':_0x7ada('0x5'),'afterDestroy':_0x7ada('0x6')};function emitEvent(_0xc9c580){return function(_0x351d12,_0xfa64be,_0x5e53c4){UserVoiceQueueRtEvents['emit'](_0xc9c580+':'+_0x351d12['id'],_0x351d12);UserVoiceQueueRtEvents[_0x7ada('0x7')](_0xc9c580,_0x351d12);_0x5e53c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x7ada('0x8')](e,emitEvent(event));}}module[_0x7ada('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 8846ac3..ee93711 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b43=['../../config/environment','./userVoiceQueueRt.attributes','user_has_voice_queues_rt','lodash','moment','request-promise','rimraf'];(function(_0x2899c0,_0x11ca2e){var _0x2ed75b=function(_0x33f123){while(--_0x33f123){_0x2899c0['push'](_0x2899c0['shift']());}};_0x2ed75b(++_0x11ca2e);}(_0x9b43,0x8f));var _0x39b4=function(_0x42a415,_0x36ab38){_0x42a415=_0x42a415-0x0;var _0x26e634=_0x9b43[_0x42a415];return _0x26e634;};'use strict';var _=require(_0x39b4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x39b4('0x1'));var BPromise=require('bluebird');var rp=require(_0x39b4('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39b4('0x3'));var config=require(_0x39b4('0x4'));var attributes=require(_0x39b4('0x5'));module['exports']=function(_0x3e0f5f,_0x31a81e){return _0x3e0f5f['define']('UserVoiceQueueRt',attributes,{'tableName':_0x39b4('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfbf=['bluebird','request-promise','rimraf','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','util','api','moment'];(function(_0x5d3803,_0x4d7836){var _0x5142d5=function(_0x21acd3){while(--_0x21acd3){_0x5d3803['push'](_0x5d3803['shift']());}};_0x5142d5(++_0x4d7836);}(_0xdfbf,0xb1));var _0xfdfb=function(_0xc8591a,_0x2715a1){_0xc8591a=_0xc8591a-0x0;var _0x4f9aad=_0xdfbf[_0xc8591a];return _0x4f9aad;};'use strict';var _=require('lodash');var util=require(_0xfdfb('0x0'));var logger=require('../../config/logger')(_0xfdfb('0x1'));var moment=require(_0xfdfb('0x2'));var BPromise=require(_0xfdfb('0x3'));var rp=require(_0xfdfb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdfb('0x5'));var config=require('../../config/environment');var attributes=require(_0xfdfb('0x6'));module[_0xfdfb('0x7')]=function(_0x1a12f5,_0xa1953){return _0x1a12f5[_0xfdfb('0x8')]('UserVoiceQueueRt',attributes,{'tableName':_0xfdfb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5fc12fc..c80a9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7df4=['GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','outboundQueuePauses','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x59a213,_0x455b66){var _0x5c0ba3=function(_0x4d42e5){while(--_0x4d42e5){_0x59a213['push'](_0x59a213['shift']());}};_0x5c0ba3(++_0x455b66);}(_0x7df4,0xf5));var _0x47df=function(_0x3e6bb9,_0x2e2998){_0x3e6bb9=_0x3e6bb9-0x0;var _0x439a4d=_0x7df4[_0x3e6bb9];return _0x439a4d;};'use strict';var _=require('lodash');var util=require(_0x47df('0x0'));var moment=require(_0x47df('0x1'));var BPromise=require(_0x47df('0x2'));var rs=require(_0x47df('0x3'));var fs=require('fs');var Redis=require(_0x47df('0x4'));var db=require(_0x47df('0x5'))['db'];var utils=require(_0x47df('0x6'));var logger=require(_0x47df('0x7'))(_0x47df('0x8'));var config=require(_0x47df('0x9'));var jayson=require(_0x47df('0xa'));var client=jayson[_0x47df('0xb')]['http']({'port':0x232a});config[_0x47df('0xc')]=_[_0x47df('0xd')](config[_0x47df('0xc')],{'host':_0x47df('0xe'),'port':0x18eb});var socket=require(_0x47df('0xf'))(new Redis(config[_0x47df('0xc')]));require(_0x47df('0x10'))[_0x47df('0x11')](socket);function respondWithRpcPromise(_0x6876f8,_0x27ef46,_0x2c7b00){return new BPromise(function(_0x6053e7,_0x3cfea1){return client[_0x47df('0x12')](_0x6876f8,_0x2c7b00)['then'](function(_0x1a507b){logger[_0x47df('0x13')](_0x47df('0x14'),_0x27ef46,'request\x20sent');logger['debug'](_0x47df('0x15'),_0x27ef46,'request\x20sent',JSON[_0x47df('0x16')](_0x1a507b));if(_0x1a507b[_0x47df('0x17')]){if(_0x1a507b[_0x47df('0x17')]['code']===0x1f4){logger[_0x47df('0x17')](_0x47df('0x14'),_0x27ef46,_0x1a507b[_0x47df('0x17')][_0x47df('0x18')]);return _0x3cfea1(_0x1a507b[_0x47df('0x17')][_0x47df('0x18')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x27ef46,_0x1a507b[_0x47df('0x17')][_0x47df('0x18')]);return _0x6053e7(_0x1a507b[_0x47df('0x17')][_0x47df('0x18')]);}else{logger[_0x47df('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x27ef46,_0x47df('0x19'));_0x6053e7(_0x1a507b[_0x47df('0x1a')][_0x47df('0x18')]);}})[_0x47df('0x1b')](function(_0x1278fb){logger['error'](_0x47df('0x14'),_0x27ef46,_0x1278fb);_0x3cfea1(_0x1278fb);});});}exports[_0x47df('0x1c')]=function(_0x469876){var _0x3b5619=this;return new Promise(function(_0x37ad81,_0x24fb6b){return db['UserVoiceQueueRt'][_0x47df('0x1d')]({'raw':_0x469876[_0x47df('0x1e')]?_0x469876['options'][_0x47df('0x1f')]===undefined?!![]:![]:!![],'where':_0x469876['options']?_0x469876[_0x47df('0x1e')][_0x47df('0x20')]||null:null,'attributes':[[db['sequelize']['fn'](_0x47df('0x21'),db[_0x47df('0x22')]['fn']('IF',db[_0x47df('0x22')][_0x47df('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0x47df('0x24')]]})[_0x47df('0x25')](function(_0x4774e6){logger[_0x47df('0x13')](_0x47df('0x1c'),_0x469876);logger[_0x47df('0x26')](_0x47df('0x1c'),_0x469876,JSON[_0x47df('0x16')](_0x4774e6));_0x37ad81(_0x4774e6);})['catch'](function(_0x35bb4e){logger[_0x47df('0x17')](_0x47df('0x1c'),_0x35bb4e[_0x47df('0x18')],_0x469876);_0x24fb6b(_0x3b5619[_0x47df('0x17')](0x1f4,_0x35bb4e[_0x47df('0x18')]));});});};
\ No newline at end of file
+var _0x2b3b=['UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','literal','outboundQueuePauses','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x2b3b,0x163));var _0xb2b3=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x2b3b[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0xb2b3('0x0'));var util=require(_0xb2b3('0x1'));var moment=require(_0xb2b3('0x2'));var BPromise=require(_0xb2b3('0x3'));var rs=require(_0xb2b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2b3('0x5'))['db'];var utils=require(_0xb2b3('0x6'));var logger=require(_0xb2b3('0x7'))(_0xb2b3('0x8'));var config=require(_0xb2b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb2b3('0xa')][_0xb2b3('0xb')]({'port':0x232a});config[_0xb2b3('0xc')]=_[_0xb2b3('0xd')](config[_0xb2b3('0xc')],{'host':_0xb2b3('0xe'),'port':0x18eb});var socket=require(_0xb2b3('0xf'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xb2b3('0x10')](socket);function respondWithRpcPromise(_0x3c57e3,_0x51f9c7,_0x104895){return new BPromise(function(_0xd1a7c5,_0x28c947){return client[_0xb2b3('0x11')](_0x3c57e3,_0x104895)[_0xb2b3('0x12')](function(_0x2b38bb){logger[_0xb2b3('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x51f9c7,_0xb2b3('0x14'));logger[_0xb2b3('0x15')](_0xb2b3('0x16'),_0x51f9c7,_0xb2b3('0x14'),JSON['stringify'](_0x2b38bb));if(_0x2b38bb[_0xb2b3('0x17')]){if(_0x2b38bb[_0xb2b3('0x17')][_0xb2b3('0x18')]===0x1f4){logger['error'](_0xb2b3('0x19'),_0x51f9c7,_0x2b38bb[_0xb2b3('0x17')][_0xb2b3('0x1a')]);return _0x28c947(_0x2b38bb[_0xb2b3('0x17')][_0xb2b3('0x1a')]);}logger[_0xb2b3('0x17')](_0xb2b3('0x19'),_0x51f9c7,_0x2b38bb[_0xb2b3('0x17')][_0xb2b3('0x1a')]);return _0xd1a7c5(_0x2b38bb['error']['message']);}else{logger[_0xb2b3('0x13')](_0xb2b3('0x19'),_0x51f9c7,_0xb2b3('0x14'));_0xd1a7c5(_0x2b38bb[_0xb2b3('0x1b')][_0xb2b3('0x1a')]);}})[_0xb2b3('0x1c')](function(_0x1a7585){logger[_0xb2b3('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x51f9c7,_0x1a7585);_0x28c947(_0x1a7585);});});}exports[_0xb2b3('0x1d')]=function(_0x33a167){var _0x4c4b6f=this;return new Promise(function(_0x49873f,_0x188f9f){return db['UserVoiceQueueRt'][_0xb2b3('0x1e')]({'raw':_0x33a167[_0xb2b3('0x1f')]?_0x33a167['options'][_0xb2b3('0x20')]===undefined?!![]:![]:!![],'where':_0x33a167[_0xb2b3('0x1f')]?_0x33a167[_0xb2b3('0x1f')][_0xb2b3('0x21')]||null:null,'attributes':[[db[_0xb2b3('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb2b3('0x22')][_0xb2b3('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0xb2b3('0x24')]]})['then'](function(_0x69f4fd){logger[_0xb2b3('0x13')](_0xb2b3('0x1d'),_0x33a167);logger['debug'](_0xb2b3('0x1d'),_0x33a167,JSON[_0xb2b3('0x25')](_0x69f4fd));_0x49873f(_0x69f4fd);})[_0xb2b3('0x1c')](function(_0x1c0a3b){logger[_0xb2b3('0x17')](_0xb2b3('0x1d'),_0x1c0a3b['message'],_0x33a167);_0x188f9f(_0x4c4b6f[_0xb2b3('0x17')](0x1f4,_0x1c0a3b[_0xb2b3('0x1a')]));});});};
\ No newline at end of file
index 2a0265e..04d2dec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b8e=['remove','update','register','length','./userVoiceQueueRt.events'];(function(_0x531188,_0xc8a886){var _0x2537c5=function(_0x230bb8){while(--_0x230bb8){_0x531188['push'](_0x531188['shift']());}};_0x2537c5(++_0xc8a886);}(_0x9b8e,0x158));var _0xe9b8=function(_0x544ffa,_0x2c592d){_0x544ffa=_0x544ffa-0x0;var _0x2bf249=_0x9b8e[_0x544ffa];return _0x2bf249;};'use strict';var UserVoiceQueueRtEvents=require(_0xe9b8('0x0'));var events=['save',_0xe9b8('0x1'),_0xe9b8('0x2')];function createListener(_0x58c557,_0x523ddc){return function(_0x2ba463){_0x523ddc['emit'](_0x58c557,_0x2ba463);};}function removeListener(_0x1fb7b1,_0x175526){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1fb7b1,_0x175526);};}exports[_0xe9b8('0x3')]=function(_0x3d24e3){for(var _0x3f6b50=0x0,_0x260234=events[_0xe9b8('0x4')];_0x3f6b50<_0x260234;_0x3f6b50++){var _0x3b67fe=events[_0x3f6b50];var _0x4fe774=createListener('userVoiceQueueRt:'+_0x3b67fe,_0x3d24e3);UserVoiceQueueRtEvents['on'](_0x3b67fe,_0x4fe774);}};
\ No newline at end of file
+var _0xae30=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit','removeListener','register'];(function(_0x504dee,_0x3cefd3){var _0x3fb6c0=function(_0x188524){while(--_0x188524){_0x504dee['push'](_0x504dee['shift']());}};_0x3fb6c0(++_0x3cefd3);}(_0xae30,0x10a));var _0x0ae3=function(_0x438988,_0x2a86cf){_0x438988=_0x438988-0x0;var _0x1ce59f=_0xae30[_0x438988];return _0x1ce59f;};'use strict';var UserVoiceQueueRtEvents=require(_0x0ae3('0x0'));var events=[_0x0ae3('0x1'),_0x0ae3('0x2'),'update'];function createListener(_0x565144,_0x1352ef){return function(_0x405dd0){_0x1352ef[_0x0ae3('0x3')](_0x565144,_0x405dd0);};}function removeListener(_0x51f481,_0x23a7a1){return function(){UserVoiceQueueRtEvents[_0x0ae3('0x4')](_0x51f481,_0x23a7a1);};}exports[_0x0ae3('0x5')]=function(_0x7ce33e){for(var _0x2b8c53=0x0,_0xda3853=events[_0x0ae3('0x6')];_0x2b8c53<_0xda3853;_0x2b8c53++){var _0x15b7e2=events[_0x2b8c53];var _0x32ea6e=createListener(_0x0ae3('0x7')+_0x15b7e2,_0x7ce33e);UserVoiceQueueRtEvents['on'](_0x15b7e2,_0x32ea6e);}};
\ No newline at end of file
index fcccfff..5ce631a 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(_0x542a9b,_0x351513){var _0x4d5032=function(_0x538ed2){while(--_0x538ed2){_0x542a9b['push'](_0x542a9b['shift']());}};_0x4d5032(++_0x351513);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x11b1e4,_0x216742){var _0xec9a70=function(_0x392caa){while(--_0x392caa){_0x11b1e4['push'](_0x11b1e4['shift']());}};_0xec9a70(++_0x216742);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xcb91[_0x272638];return _0x19d027;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index f401502..fcb8e68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb510=['exports','INTEGER','sequelize'];(function(_0x13d2a5,_0x5016a4){var _0x437a87=function(_0x54854d){while(--_0x54854d){_0x13d2a5['push'](_0x13d2a5['shift']());}};_0x437a87(++_0x5016a4);}(_0xb510,0x173));var _0x0b51=function(_0x45f83a,_0x559a25){_0x45f83a=_0x45f83a-0x0;var _0x15a403=_0xb510[_0x45f83a];return _0x15a403;};'use strict';var Sequelize=require(_0x0b51('0x0'));module[_0x0b51('0x1')]={'penalty':{'type':Sequelize[_0x0b51('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xef39=['exports','INTEGER'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xef39,0x92));var _0x9ef3=function(_0x4e3171,_0x20414c){_0x4e3171=_0x4e3171-0x0;var _0x59e754=_0xef39[_0x4e3171];return _0x59e754;};'use strict';var Sequelize=require('sequelize');module[_0x9ef3('0x0')]={'penalty':{'type':Sequelize[_0x9ef3('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 5a14878..dc0cf37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f9=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','bluebird','path','rimraf','./userWhatsappQueue.attributes','exports'];(function(_0x41bf49,_0x5956e5){var _0x29b3c3=function(_0x56a65e){while(--_0x56a65e){_0x41bf49['push'](_0x41bf49['shift']());}};_0x29b3c3(++_0x5956e5);}(_0x44f9,0x107));var _0x944f=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x44f9[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x944f('0x0'));var util=require(_0x944f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x944f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x944f('0x3'));var rimraf=require(_0x944f('0x4'));var config=require('../../config/environment');var attributes=require(_0x944f('0x5'));module[_0x944f('0x6')]=function(_0x555b9f,_0x3c0194){return _0x555b9f[_0x944f('0x7')](_0x944f('0x8'),attributes,{'tableName':_0x944f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9a4=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xd9a4,0x14a));var _0x4d9a=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xd9a4[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x4d9a('0x0'));var util=require(_0x4d9a('0x1'));var logger=require(_0x4d9a('0x2'))(_0x4d9a('0x3'));var moment=require('moment');var BPromise=require(_0x4d9a('0x4'));var rp=require(_0x4d9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d9a('0x6'));var config=require(_0x4d9a('0x7'));var attributes=require(_0x4d9a('0x8'));module[_0x4d9a('0x9')]=function(_0x245d9a,_0x167968){return _0x245d9a['define'](_0x4d9a('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 121ce29..dfdb066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x253c=['lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x30dc4f,_0x1085ff){var _0x3cf19c=function(_0x589a15){while(--_0x589a15){_0x30dc4f['push'](_0x30dc4f['shift']());}};_0x3cf19c(++_0x1085ff);}(_0x253c,0x134));var _0xc253=function(_0x5b7695,_0x139b46){_0x5b7695=_0x5b7695-0x0;var _0xae72fb=_0x253c[_0x5b7695];return _0xae72fb;};'use strict';var _=require(_0xc253('0x0'));var util=require(_0xc253('0x1'));var moment=require(_0xc253('0x2'));var BPromise=require('bluebird');var rs=require(_0xc253('0x3'));var fs=require('fs');var Redis=require(_0xc253('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc253('0x5'));var logger=require('../../config/logger')(_0xc253('0x6'));var config=require(_0xc253('0x7'));var jayson=require(_0xc253('0x8'));var client=jayson[_0xc253('0x9')][_0xc253('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x297316,_0x18bd0c,_0x13984d){return new BPromise(function(_0x498338,_0x350fac){return client['request'](_0x297316,_0x13984d)[_0xc253('0xb')](function(_0x1e97ef){logger[_0xc253('0xc')](_0xc253('0xd'),_0x18bd0c,'request\x20sent');logger['debug'](_0xc253('0xe'),_0x18bd0c,_0xc253('0xf'),JSON[_0xc253('0x10')](_0x1e97ef));if(_0x1e97ef[_0xc253('0x11')]){if(_0x1e97ef[_0xc253('0x11')][_0xc253('0x12')]===0x1f4){logger['error'](_0xc253('0xd'),_0x18bd0c,_0x1e97ef[_0xc253('0x11')][_0xc253('0x13')]);return _0x350fac(_0x1e97ef[_0xc253('0x11')][_0xc253('0x13')]);}logger[_0xc253('0x11')](_0xc253('0xd'),_0x18bd0c,_0x1e97ef[_0xc253('0x11')][_0xc253('0x13')]);return _0x498338(_0x1e97ef[_0xc253('0x11')][_0xc253('0x13')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x18bd0c,'request\x20sent');_0x498338(_0x1e97ef[_0xc253('0x14')][_0xc253('0x13')]);}})[_0xc253('0x15')](function(_0x4494d8){logger[_0xc253('0x11')](_0xc253('0xd'),_0x18bd0c,_0x4494d8);_0x350fac(_0x4494d8);});});}
\ No newline at end of file
+var _0x0170=['../../config/environment','jayson/promise','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x0170,0x99));var _0x0017=function(_0x1920b2,_0x1b755d){_0x1920b2=_0x1920b2-0x0;var _0x3db4ec=_0x0170[_0x1920b2];return _0x3db4ec;};'use strict';var _=require(_0x0017('0x0'));var util=require(_0x0017('0x1'));var moment=require('moment');var BPromise=require(_0x0017('0x2'));var rs=require(_0x0017('0x3'));var fs=require('fs');var Redis=require(_0x0017('0x4'));var db=require(_0x0017('0x5'))['db'];var utils=require(_0x0017('0x6'));var logger=require('../../config/logger')(_0x0017('0x7'));var config=require(_0x0017('0x8'));var jayson=require(_0x0017('0x9'));var client=jayson[_0x0017('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c92d,_0x21556e,_0x1ded29){return new BPromise(function(_0x1a9850,_0x5b0592){return client[_0x0017('0xb')](_0x30c92d,_0x1ded29)[_0x0017('0xc')](function(_0x397772){logger['info'](_0x0017('0xd'),_0x21556e,_0x0017('0xe'));logger[_0x0017('0xf')](_0x0017('0x10'),_0x21556e,'request\x20sent',JSON[_0x0017('0x11')](_0x397772));if(_0x397772['error']){if(_0x397772[_0x0017('0x12')][_0x0017('0x13')]===0x1f4){logger[_0x0017('0x12')](_0x0017('0xd'),_0x21556e,_0x397772['error']['message']);return _0x5b0592(_0x397772[_0x0017('0x12')][_0x0017('0x14')]);}logger[_0x0017('0x12')](_0x0017('0xd'),_0x21556e,_0x397772['error']['message']);return _0x1a9850(_0x397772['error'][_0x0017('0x14')]);}else{logger['info'](_0x0017('0xd'),_0x21556e,_0x0017('0xe'));_0x1a9850(_0x397772[_0x0017('0x15')]['message']);}})[_0x0017('0x16')](function(_0x332699){logger['error'](_0x0017('0xd'),_0x21556e,_0x332699);_0x5b0592(_0x332699);});});}
\ No newline at end of file
index f8e80bd..7f28c31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c0=['../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0xc08ffe,_0x26f43f){var _0x52c452=function(_0x571984){while(--_0x571984){_0xc08ffe['push'](_0xc08ffe['shift']());}};_0x52c452(++_0x26f43f);}(_0x13c0,0x79));var _0x013c=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0x13c0[_0x27d10a];return _0x63302e;};'use strict';var multer=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var path=require(_0x013c('0x2'));var timeout=require(_0x013c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x013c('0x4'));var interaction=require(_0x013c('0x5'));var config=require(_0x013c('0x6'));var controller=require(_0x013c('0x7'));router[_0x013c('0x8')]('/',auth[_0x013c('0x9')](),controller[_0x013c('0xa')]);router[_0x013c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x013c('0xb')]('/',auth[_0x013c('0x9')](),controller['create']);router[_0x013c('0xc')](_0x013c('0xd'),auth[_0x013c('0x9')](),controller[_0x013c('0xe')]);router[_0x013c('0xf')](_0x013c('0xd'),auth[_0x013c('0x9')](),controller[_0x013c('0x10')]);module[_0x013c('0x11')]=router;
\ No newline at end of file
+var _0x447b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x447b,0xe4));var _0xb447=function(_0x4c05b1,_0x1c7660){_0x4c05b1=_0x4c05b1-0x0;var _0x206ae9=_0x447b[_0x4c05b1];return _0x206ae9;};'use strict';var multer=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var path=require('path');var timeout=require(_0xb447('0x2'));var express=require(_0xb447('0x3'));var router=express[_0xb447('0x4')]();var fs_extra=require(_0xb447('0x5'));var auth=require(_0xb447('0x6'));var interaction=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var controller=require(_0xb447('0x9'));router[_0xb447('0xa')]('/',auth[_0xb447('0xb')](),controller['index']);router['get'](_0xb447('0xc'),auth['isAuthenticated'](),controller[_0xb447('0xd')]);router[_0xb447('0xe')]('/',auth[_0xb447('0xb')](),controller[_0xb447('0xf')]);router[_0xb447('0x10')]('/:id',auth[_0xb447('0xb')](),controller[_0xb447('0x11')]);router[_0xb447('0x12')](_0xb447('0xc'),auth['isAuthenticated'](),controller[_0xb447('0x13')]);module[_0xb447('0x14')]=router;
\ No newline at end of file
index aeb52df..2bde4e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x302c=['sequelize','exports','STRING','name'];(function(_0x2341ab,_0x326a6c){var _0x54533e=function(_0x413273){while(--_0x413273){_0x2341ab['push'](_0x2341ab['shift']());}};_0x54533e(++_0x326a6c);}(_0x302c,0x15c));var _0xc302=function(_0x27acb9,_0x5dc539){_0x27acb9=_0x27acb9-0x0;var _0x3c3fbe=_0x302c[_0x27acb9];return _0x3c3fbe;};'use strict';var Sequelize=require(_0xc302('0x0'));module[_0xc302('0x1')]={'name':{'type':Sequelize[_0xc302('0x2')],'unique':_0xc302('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc302('0x2')]}};
\ No newline at end of file
+var _0xc57c=['sequelize','STRING','name'];(function(_0x4897b5,_0x3d2e27){var _0x3adafe=function(_0x242665){while(--_0x242665){_0x4897b5['push'](_0x4897b5['shift']());}};_0x3adafe(++_0x3d2e27);}(_0xc57c,0x9f));var _0xcc57=function(_0x267318,_0x4f6d69){_0x267318=_0x267318-0x0;var _0xa9be13=_0xc57c[_0x267318];return _0xa9be13;};'use strict';var Sequelize=require(_0xcc57('0x0'));module['exports']={'name':{'type':Sequelize[_0xcc57('0x1')],'unique':_0xcc57('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcc57('0x1')]}};
\ No newline at end of file
index 75ec9e4..e4401d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x742f=['request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','get','Variables','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','include','Variable','catch','show','params','includeAll','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','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x742f,0xef));var _0xf742=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x742f[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require(_0xf742('0x0'));var rimraf=require(_0xf742('0x1'));var zipdir=require(_0xf742('0x2'));var jsonpatch=require(_0xf742('0x3'));var rp=require(_0xf742('0x4'));var moment=require(_0xf742('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf742('0x6'));var util=require(_0xf742('0x7'));var path=require('path');var sox=require(_0xf742('0x8'));var csv=require(_0xf742('0x9'));var ejs=require(_0xf742('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf742('0xb'));var squel=require(_0xf742('0xc'));var crypto=require('crypto');var jsforce=require(_0xf742('0xd'));var deskjs=require(_0xf742('0xe'));var toCsv=require(_0xf742('0x9'));var querystring=require(_0xf742('0xf'));var Papa=require(_0xf742('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf742('0x11'));var as=require(_0xf742('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf742('0x13'))(_0xf742('0x14'));var utils=require('../../config/utils');var config=require(_0xf742('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf742('0x16'))['db'];function respondWithStatusCode(_0x42a5e8,_0x4a005f){_0x4a005f=_0x4a005f||0xcc;return function(_0x1eb739){if(_0x1eb739){return _0x42a5e8[_0xf742('0x17')](_0x4a005f);}return _0x42a5e8[_0xf742('0x18')](_0x4a005f)['end']();};}function respondWithResult(_0x19c41a,_0x4283d3){_0x4283d3=_0x4283d3||0xc8;return function(_0x33d7e2){if(_0x33d7e2){return _0x19c41a['status'](_0x4283d3)[_0xf742('0x19')](_0x33d7e2);}};}function respondWithFilteredResult(_0x4a0e9e,_0x6f555d){return function(_0x3ca6e3){if(_0x3ca6e3){var _0x2b2a5b=typeof _0x6f555d[_0xf742('0x1a')]===_0xf742('0x1b')&&typeof _0x6f555d['limit']===_0xf742('0x1b');var _0x476c40=_0x3ca6e3['count'];var _0x5e18a7=_0x2b2a5b?0x0:_0x6f555d[_0xf742('0x1a')];var _0x23b714=_0x2b2a5b?_0x3ca6e3[_0xf742('0x1c')]:_0x6f555d[_0xf742('0x1a')]+_0x6f555d[_0xf742('0x1d')];var _0x4ba13e;if(_0x23b714>=_0x476c40){_0x23b714=_0x476c40;_0x4ba13e=0xc8;}else{_0x4ba13e=0xce;}_0x4a0e9e['status'](_0x4ba13e);return _0x4a0e9e[_0xf742('0x1e')](_0xf742('0x1f'),_0x5e18a7+'-'+_0x23b714+'/'+_0x476c40)[_0xf742('0x19')](_0x3ca6e3);}return null;};}function patchUpdates(_0x147e8d){return function(_0x1a02d4){try{jsonpatch['apply'](_0x1a02d4,_0x147e8d,!![]);}catch(_0x4eaedb){return BPromise[_0xf742('0x20')](_0x4eaedb);}return _0x1a02d4['save']();};}function saveUpdates(_0x3fb405,_0x4392ce){return function(_0x115550){if(_0x115550){return _0x115550[_0xf742('0x21')](_0x3fb405)['then'](function(_0x2e690f){return _0x2e690f;});}return null;};}function removeEntity(_0x5adefe,_0x3b2aef){return function(_0x1d9f40){if(_0x1d9f40){return _0x1d9f40[_0xf742('0x22')]()[_0xf742('0x23')](function(){var _0x252893=_0x1d9f40[_0xf742('0x24')]({'plain':!![]});var _0x53f782=_0xf742('0x25');return db[_0xf742('0x26')][_0xf742('0x22')]({'where':{'type':_0x53f782,'resourceId':_0x252893['id']}})['then'](function(){return _0x1d9f40;});})[_0xf742('0x23')](function(){_0x5adefe[_0xf742('0x18')](0xcc)[_0xf742('0x27')]();});}};}function handleEntityNotFound(_0x52ebf6,_0x38b791){return function(_0x2f7e23){if(!_0x2f7e23){_0x52ebf6[_0xf742('0x17')](0x194);}return _0x2f7e23;};}function handleError(_0x466419,_0x16953f){_0x16953f=_0x16953f||0x1f4;return function(_0x3f4cfd){logger[_0xf742('0x28')](_0x3f4cfd[_0xf742('0x29')]);if(_0x3f4cfd[_0xf742('0x2a')]){delete _0x3f4cfd[_0xf742('0x2a')];}_0x466419[_0xf742('0x18')](_0x16953f)[_0xf742('0x2b')](_0x3f4cfd);};}exports['index']=function(_0x239122,_0x479ccf){var _0x513ef9={},_0x1a2641={},_0xd910f8={'count':0x0,'rows':[]};var _0x4cdf92=_[_0xf742('0x2c')](db['Variable'][_0xf742('0x2d')],function(_0x3e0da3){return{'name':_0x3e0da3[_0xf742('0x2e')],'type':_0x3e0da3[_0xf742('0x2f')][_0xf742('0x30')]};});_0x1a2641[_0xf742('0x31')]=_['map'](_0x4cdf92,_0xf742('0x2a'));_0x1a2641[_0xf742('0x32')]=_[_0xf742('0x33')](_0x239122['query']);_0x1a2641[_0xf742('0x34')]=_['intersection'](_0x1a2641[_0xf742('0x31')],_0x1a2641[_0xf742('0x32')]);_0x513ef9['attributes']=_[_0xf742('0x35')](_0x1a2641[_0xf742('0x31')],qs[_0xf742('0x36')](_0x239122[_0xf742('0x32')][_0xf742('0x36')]));_0x513ef9[_0xf742('0x37')]=_0x513ef9['attributes'][_0xf742('0x38')]?_0x513ef9[_0xf742('0x37')]:_0x1a2641[_0xf742('0x31')];if(!_0x239122[_0xf742('0x32')][_0xf742('0x39')](_0xf742('0x3a'))){_0x513ef9[_0xf742('0x1d')]=qs[_0xf742('0x1d')](_0x239122['query'][_0xf742('0x1d')]);_0x513ef9[_0xf742('0x1a')]=qs[_0xf742('0x1a')](_0x239122[_0xf742('0x32')]['offset']);}_0x513ef9[_0xf742('0x3b')]=qs[_0xf742('0x3c')](_0x239122[_0xf742('0x32')][_0xf742('0x3c')]);_0x513ef9[_0xf742('0x3d')]=qs['filters'](_['pick'](_0x239122['query'],_0x1a2641[_0xf742('0x34')]),_0x4cdf92);if(_0x239122[_0xf742('0x32')]['filter']){_0x513ef9[_0xf742('0x3d')]=_[_0xf742('0x3e')](_0x513ef9['where'],{'$or':_[_0xf742('0x2c')](_0x4cdf92,function(_0x52f096){if(_0x52f096[_0xf742('0x2f')]!=='VIRTUAL'){var _0xa8a8e0={};_0xa8a8e0[_0x52f096['name']]={'$like':'%'+_0x239122[_0xf742('0x32')][_0xf742('0x3f')]+'%'};return _0xa8a8e0;}})});}_0x513ef9=_[_0xf742('0x3e')]({},_0x513ef9,_0x239122['options']);var _0x3a662a={'where':_0x513ef9[_0xf742('0x3d')]};return db['Variable'][_0xf742('0x1c')](_0x3a662a)[_0xf742('0x23')](function(_0x10e294){_0xd910f8[_0xf742('0x1c')]=_0x10e294;if(_0x239122[_0xf742('0x32')]['includeAll']){_0x513ef9[_0xf742('0x40')]=[{'all':!![]}];}return db[_0xf742('0x41')]['findAll'](_0x513ef9);})[_0xf742('0x23')](function(_0x429edc){_0xd910f8['rows']=_0x429edc;return _0xd910f8;})['then'](respondWithFilteredResult(_0x479ccf,_0x513ef9))[_0xf742('0x42')](handleError(_0x479ccf,null));};exports[_0xf742('0x43')]=function(_0x3e712d,_0x391a32){var _0xc4beab={'raw':!![],'where':{'id':_0x3e712d[_0xf742('0x44')]['id']}},_0x14ee4c={};_0x14ee4c[_0xf742('0x31')]=_[_0xf742('0x33')](db[_0xf742('0x41')][_0xf742('0x2d')]);_0x14ee4c[_0xf742('0x32')]=_[_0xf742('0x33')](_0x3e712d[_0xf742('0x32')]);_0x14ee4c[_0xf742('0x34')]=_[_0xf742('0x35')](_0x14ee4c['model'],_0x14ee4c[_0xf742('0x32')]);_0xc4beab[_0xf742('0x37')]=_['intersection'](_0x14ee4c['model'],qs[_0xf742('0x36')](_0x3e712d[_0xf742('0x32')][_0xf742('0x36')]));_0xc4beab[_0xf742('0x37')]=_0xc4beab[_0xf742('0x37')][_0xf742('0x38')]?_0xc4beab['attributes']:_0x14ee4c[_0xf742('0x31')];if(_0x3e712d[_0xf742('0x32')][_0xf742('0x45')]){_0xc4beab[_0xf742('0x40')]=[{'all':!![]}];}_0xc4beab=_[_0xf742('0x3e')]({},_0xc4beab,_0x3e712d[_0xf742('0x46')]);return db['Variable'][_0xf742('0x47')](_0xc4beab)[_0xf742('0x23')](handleEntityNotFound(_0x391a32,null))[_0xf742('0x23')](respondWithResult(_0x391a32,null))[_0xf742('0x42')](handleError(_0x391a32,null));};exports['create']=function(_0x3acb5b,_0x4b5749){return db[_0xf742('0x41')][_0xf742('0x48')](_0x3acb5b[_0xf742('0x49')],{})[_0xf742('0x23')](function(_0x332b3b){var _0x29bcaa=_0x3acb5b['user'][_0xf742('0x24')]({'plain':!![]});if(!_0x29bcaa)throw new Error(_0xf742('0x4a'));if(_0x29bcaa[_0xf742('0x4b')]===_0xf742('0x4c')){var _0x2ca738=_0x332b3b[_0xf742('0x24')]({'plain':!![]});var _0x5eaaaf=_0xf742('0x25');return db[_0xf742('0x4d')][_0xf742('0x47')]({'where':{'name':_0x5eaaaf,'userProfileId':_0x29bcaa[_0xf742('0x4e')]},'raw':!![]})['then'](function(_0x53dd2f){if(_0x53dd2f&&_0x53dd2f[_0xf742('0x4f')]===0x0){return db[_0xf742('0x26')][_0xf742('0x48')]({'name':_0x2ca738['name'],'resourceId':_0x2ca738['id'],'type':_0x53dd2f[_0xf742('0x2a')],'sectionId':_0x53dd2f['id']},{})[_0xf742('0x23')](function(){return _0x332b3b;});}else{return _0x332b3b;}})[_0xf742('0x42')](function(_0x58c23f){logger[_0xf742('0x28')](_0xf742('0x50'),_0x58c23f);throw _0x58c23f;});}return _0x332b3b;})[_0xf742('0x23')](respondWithResult(_0x4b5749,0xc9))[_0xf742('0x42')](handleError(_0x4b5749,null));};exports[_0xf742('0x21')]=function(_0x5acab2,_0x1a8eac){if(_0x5acab2[_0xf742('0x49')]['id']){delete _0x5acab2[_0xf742('0x49')]['id'];}return db['Variable']['find']({'where':{'id':_0x5acab2['params']['id']}})[_0xf742('0x23')](handleEntityNotFound(_0x1a8eac,null))[_0xf742('0x23')](saveUpdates(_0x5acab2[_0xf742('0x49')],null))[_0xf742('0x23')](respondWithResult(_0x1a8eac,null))['catch'](handleError(_0x1a8eac,null));};exports[_0xf742('0x22')]=function(_0x2d5042,_0x258272){return db[_0xf742('0x41')][_0xf742('0x47')]({'where':{'id':_0x2d5042[_0xf742('0x44')]['id']}})[_0xf742('0x23')](handleEntityNotFound(_0x258272,null))[_0xf742('0x23')](removeEntity(_0x258272,null))[_0xf742('0x42')](handleError(_0x258272,null));};
\ No newline at end of file
+var _0x28a1=['get','UserProfileResource','stack','name','send','index','map','Variable','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x218909,_0x27d23c){var _0xa018df=function(_0x21715b){while(--_0x21715b){_0x218909['push'](_0x218909['shift']());}};_0xa018df(++_0x27d23c);}(_0x28a1,0x1c4));var _0x128a=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x28a1[_0x20cf8a];return _0x54e165;};'use strict';var emlformat=require(_0x128a('0x0'));var rimraf=require(_0x128a('0x1'));var zipdir=require(_0x128a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x128a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x128a('0x4'));var util=require(_0x128a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x128a('0x6'));var ejs=require(_0x128a('0x7'));var fs=require('fs');var fs_extra=require(_0x128a('0x8'));var _=require(_0x128a('0x9'));var squel=require(_0x128a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x128a('0xb'));var toCsv=require(_0x128a('0x6'));var querystring=require(_0x128a('0xc'));var Papa=require(_0x128a('0xd'));var Redis=require(_0x128a('0xe'));var authService=require(_0x128a('0xf'));var qs=require(_0x128a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x128a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x128a('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x128a('0x13'))['db'];function respondWithStatusCode(_0x17043f,_0x3b5618){_0x3b5618=_0x3b5618||0xcc;return function(_0x2ebae8){if(_0x2ebae8){return _0x17043f[_0x128a('0x14')](_0x3b5618);}return _0x17043f[_0x128a('0x15')](_0x3b5618)[_0x128a('0x16')]();};}function respondWithResult(_0x7d6de6,_0x426e64){_0x426e64=_0x426e64||0xc8;return function(_0x243f2c){if(_0x243f2c){return _0x7d6de6[_0x128a('0x15')](_0x426e64)[_0x128a('0x17')](_0x243f2c);}};}function respondWithFilteredResult(_0x309813,_0x553012){return function(_0x49b14b){if(_0x49b14b){var _0x3b92e3=typeof _0x553012['offset']===_0x128a('0x18')&&typeof _0x553012[_0x128a('0x19')]===_0x128a('0x18');var _0x14d09d=_0x49b14b['count'];var _0x416a1b=_0x3b92e3?0x0:_0x553012[_0x128a('0x1a')];var _0x2ea339=_0x3b92e3?_0x49b14b['count']:_0x553012[_0x128a('0x1a')]+_0x553012['limit'];var _0x71277b;if(_0x2ea339>=_0x14d09d){_0x2ea339=_0x14d09d;_0x71277b=0xc8;}else{_0x71277b=0xce;}_0x309813[_0x128a('0x15')](_0x71277b);return _0x309813[_0x128a('0x1b')](_0x128a('0x1c'),_0x416a1b+'-'+_0x2ea339+'/'+_0x14d09d)[_0x128a('0x17')](_0x49b14b);}return null;};}function patchUpdates(_0x2fdc0d){return function(_0x265b7d){try{jsonpatch[_0x128a('0x1d')](_0x265b7d,_0x2fdc0d,!![]);}catch(_0x14f39b){return BPromise[_0x128a('0x1e')](_0x14f39b);}return _0x265b7d['save']();};}function saveUpdates(_0x226f72,_0xe175a9){return function(_0x559b41){if(_0x559b41){return _0x559b41[_0x128a('0x1f')](_0x226f72)[_0x128a('0x20')](function(_0x372aff){return _0x372aff;});}return null;};}function removeEntity(_0x155584,_0x53b663){return function(_0x3c8d11){if(_0x3c8d11){return _0x3c8d11[_0x128a('0x21')]()[_0x128a('0x20')](function(){var _0x43ff69=_0x3c8d11[_0x128a('0x22')]({'plain':!![]});var _0x1d84cd='Variables';return db[_0x128a('0x23')]['destroy']({'where':{'type':_0x1d84cd,'resourceId':_0x43ff69['id']}})[_0x128a('0x20')](function(){return _0x3c8d11;});})[_0x128a('0x20')](function(){_0x155584[_0x128a('0x15')](0xcc)[_0x128a('0x16')]();});}};}function handleEntityNotFound(_0x36a8c3,_0x3caa20){return function(_0x1b9969){if(!_0x1b9969){_0x36a8c3['sendStatus'](0x194);}return _0x1b9969;};}function handleError(_0x639c47,_0x15b3cf){_0x15b3cf=_0x15b3cf||0x1f4;return function(_0x3dcc77){logger['error'](_0x3dcc77[_0x128a('0x24')]);if(_0x3dcc77[_0x128a('0x25')]){delete _0x3dcc77[_0x128a('0x25')];}_0x639c47[_0x128a('0x15')](_0x15b3cf)[_0x128a('0x26')](_0x3dcc77);};}exports[_0x128a('0x27')]=function(_0x59b5eb,_0x1c1b5d){var _0x37f624={},_0x177716={},_0x67a056={'count':0x0,'rows':[]};var _0xb1a1b2=_[_0x128a('0x28')](db[_0x128a('0x29')]['rawAttributes'],function(_0x4304e1){return{'name':_0x4304e1[_0x128a('0x2a')],'type':_0x4304e1[_0x128a('0x2b')][_0x128a('0x2c')]};});_0x177716[_0x128a('0x2d')]=_[_0x128a('0x28')](_0xb1a1b2,_0x128a('0x25'));_0x177716['query']=_[_0x128a('0x2e')](_0x59b5eb[_0x128a('0x2f')]);_0x177716[_0x128a('0x30')]=_[_0x128a('0x31')](_0x177716[_0x128a('0x2d')],_0x177716[_0x128a('0x2f')]);_0x37f624['attributes']=_['intersection'](_0x177716[_0x128a('0x2d')],qs[_0x128a('0x32')](_0x59b5eb[_0x128a('0x2f')][_0x128a('0x32')]));_0x37f624['attributes']=_0x37f624[_0x128a('0x33')][_0x128a('0x34')]?_0x37f624[_0x128a('0x33')]:_0x177716[_0x128a('0x2d')];if(!_0x59b5eb['query'][_0x128a('0x35')](_0x128a('0x36'))){_0x37f624['limit']=qs[_0x128a('0x19')](_0x59b5eb[_0x128a('0x2f')][_0x128a('0x19')]);_0x37f624[_0x128a('0x1a')]=qs[_0x128a('0x1a')](_0x59b5eb['query'][_0x128a('0x1a')]);}_0x37f624['order']=qs[_0x128a('0x37')](_0x59b5eb['query'][_0x128a('0x37')]);_0x37f624[_0x128a('0x38')]=qs[_0x128a('0x30')](_['pick'](_0x59b5eb[_0x128a('0x2f')],_0x177716[_0x128a('0x30')]),_0xb1a1b2);if(_0x59b5eb['query']['filter']){_0x37f624[_0x128a('0x38')]=_[_0x128a('0x39')](_0x37f624[_0x128a('0x38')],{'$or':_[_0x128a('0x28')](_0xb1a1b2,function(_0x51d906){if(_0x51d906[_0x128a('0x2b')]!==_0x128a('0x3a')){var _0x5bf33d={};_0x5bf33d[_0x51d906[_0x128a('0x25')]]={'$like':'%'+_0x59b5eb['query'][_0x128a('0x3b')]+'%'};return _0x5bf33d;}})});}_0x37f624=_[_0x128a('0x39')]({},_0x37f624,_0x59b5eb[_0x128a('0x3c')]);var _0x268856={'where':_0x37f624['where']};return db[_0x128a('0x29')][_0x128a('0x3d')](_0x268856)[_0x128a('0x20')](function(_0x7d8688){_0x67a056[_0x128a('0x3d')]=_0x7d8688;if(_0x59b5eb['query'][_0x128a('0x3e')]){_0x37f624[_0x128a('0x3f')]=[{'all':!![]}];}return db[_0x128a('0x29')][_0x128a('0x40')](_0x37f624);})[_0x128a('0x20')](function(_0x2c6250){_0x67a056[_0x128a('0x41')]=_0x2c6250;return _0x67a056;})['then'](respondWithFilteredResult(_0x1c1b5d,_0x37f624))['catch'](handleError(_0x1c1b5d,null));};exports[_0x128a('0x42')]=function(_0x221226,_0x3914c8){var _0x3814b3={'raw':!![],'where':{'id':_0x221226[_0x128a('0x43')]['id']}},_0x14567e={};_0x14567e['model']=_[_0x128a('0x2e')](db[_0x128a('0x29')][_0x128a('0x44')]);_0x14567e[_0x128a('0x2f')]=_[_0x128a('0x2e')](_0x221226[_0x128a('0x2f')]);_0x14567e['filters']=_[_0x128a('0x31')](_0x14567e['model'],_0x14567e[_0x128a('0x2f')]);_0x3814b3[_0x128a('0x33')]=_[_0x128a('0x31')](_0x14567e[_0x128a('0x2d')],qs['fields'](_0x221226[_0x128a('0x2f')][_0x128a('0x32')]));_0x3814b3[_0x128a('0x33')]=_0x3814b3[_0x128a('0x33')][_0x128a('0x34')]?_0x3814b3['attributes']:_0x14567e[_0x128a('0x2d')];if(_0x221226[_0x128a('0x2f')][_0x128a('0x3e')]){_0x3814b3['include']=[{'all':!![]}];}_0x3814b3=_['merge']({},_0x3814b3,_0x221226['options']);return db[_0x128a('0x29')][_0x128a('0x45')](_0x3814b3)[_0x128a('0x20')](handleEntityNotFound(_0x3914c8,null))['then'](respondWithResult(_0x3914c8,null))[_0x128a('0x46')](handleError(_0x3914c8,null));};exports[_0x128a('0x47')]=function(_0x4d9b1a,_0xfccabf){return db[_0x128a('0x29')]['create'](_0x4d9b1a[_0x128a('0x48')],{})['then'](function(_0x4dcb86){var _0xf156c5=_0x4d9b1a[_0x128a('0x49')][_0x128a('0x22')]({'plain':!![]});if(!_0xf156c5)throw new Error(_0x128a('0x4a'));if(_0xf156c5[_0x128a('0x4b')]===_0x128a('0x49')){var _0x233d48=_0x4dcb86[_0x128a('0x22')]({'plain':!![]});var _0x37255f=_0x128a('0x4c');return db[_0x128a('0x4d')][_0x128a('0x45')]({'where':{'name':_0x37255f,'userProfileId':_0xf156c5[_0x128a('0x4e')]},'raw':!![]})[_0x128a('0x20')](function(_0x480475){if(_0x480475&&_0x480475['autoAssociation']===0x0){return db[_0x128a('0x23')][_0x128a('0x47')]({'name':_0x233d48[_0x128a('0x25')],'resourceId':_0x233d48['id'],'type':_0x480475[_0x128a('0x25')],'sectionId':_0x480475['id']},{})['then'](function(){return _0x4dcb86;});}else{return _0x4dcb86;}})['catch'](function(_0x35cc9f){logger[_0x128a('0x4f')](_0x128a('0x50'),_0x35cc9f);throw _0x35cc9f;});}return _0x4dcb86;})['then'](respondWithResult(_0xfccabf,0xc9))['catch'](handleError(_0xfccabf,null));};exports['update']=function(_0x439b38,_0x2cd8f0){if(_0x439b38[_0x128a('0x48')]['id']){delete _0x439b38['body']['id'];}return db[_0x128a('0x29')][_0x128a('0x45')]({'where':{'id':_0x439b38[_0x128a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cd8f0,null))[_0x128a('0x20')](saveUpdates(_0x439b38[_0x128a('0x48')],null))[_0x128a('0x20')](respondWithResult(_0x2cd8f0,null))[_0x128a('0x46')](handleError(_0x2cd8f0,null));};exports['destroy']=function(_0x2a6369,_0x4bf082){return db[_0x128a('0x29')][_0x128a('0x45')]({'where':{'id':_0x2a6369[_0x128a('0x43')]['id']}})['then'](handleEntityNotFound(_0x4bf082,null))[_0x128a('0x20')](removeEntity(_0x4bf082,null))[_0x128a('0x46')](handleError(_0x4bf082,null));};
\ No newline at end of file
index 26c3f00..f5aee2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f56=['./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5f56,0x67));var _0x65f5=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x5f56[_0x4521e3];return _0x46a272;};'use strict';var _=require(_0x65f5('0x0'));var util=require(_0x65f5('0x1'));var logger=require(_0x65f5('0x2'))(_0x65f5('0x3'));var moment=require('moment');var BPromise=require(_0x65f5('0x4'));var rp=require(_0x65f5('0x5'));var fs=require('fs');var path=require(_0x65f5('0x6'));var rimraf=require(_0x65f5('0x7'));var config=require(_0x65f5('0x8'));var attributes=require(_0x65f5('0x9'));module[_0x65f5('0xa')]=function(_0x23e5e6,_0x3e7db3){return _0x23e5e6[_0x65f5('0xb')](_0x65f5('0xc'),attributes,{'tableName':_0x65f5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64ce=['api','moment','bluebird','path','rimraf','./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger'];(function(_0x4c9784,_0x52409c){var _0x300df9=function(_0x58ac2c){while(--_0x58ac2c){_0x4c9784['push'](_0x4c9784['shift']());}};_0x300df9(++_0x52409c);}(_0x64ce,0x1a1));var _0xe64c=function(_0x7fd4c2,_0x3b6aa8){_0x7fd4c2=_0x7fd4c2-0x0;var _0x44389a=_0x64ce[_0x7fd4c2];return _0x44389a;};'use strict';var _=require(_0xe64c('0x0'));var util=require(_0xe64c('0x1'));var logger=require(_0xe64c('0x2'))(_0xe64c('0x3'));var moment=require(_0xe64c('0x4'));var BPromise=require(_0xe64c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe64c('0x6'));var rimraf=require(_0xe64c('0x7'));var config=require('../../config/environment');var attributes=require(_0xe64c('0x8'));module[_0xe64c('0x9')]=function(_0x12bd77,_0x4ce206){return _0x12bd77['define'](_0xe64c('0xa'),attributes,{'tableName':_0xe64c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3545bb6..489ed60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x118986,_0x2ea044){var _0x25c9e6=function(_0x13b4d4){while(--_0x13b4d4){_0x118986['push'](_0x118986['shift']());}};_0x25c9e6(++_0x2ea044);}(_0x8ef6,0xf2));var _0x68ef=function(_0x50834c,_0x2a2095){_0x50834c=_0x50834c-0x0;var _0x128747=_0x8ef6[_0x50834c];return _0x128747;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});};
\ No newline at end of file
+var _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x95b42f,_0xb4ea7c){var _0x12df65=function(_0x1d27c9){while(--_0x1d27c9){_0x95b42f['push'](_0x95b42f['shift']());}};_0x12df65(++_0xb4ea7c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x4b84[_0x40b493];return _0x548365;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});};
\ No newline at end of file
index 3224f5f..f77573a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fab=['/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','express','Router','./version.controller','get'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x0fab,0x1e8));var _0xb0fa=function(_0x39ae9b,_0x46b323){_0x39ae9b=_0x39ae9b-0x0;var _0x5e106e=_0x0fab[_0x39ae9b];return _0x5e106e;};'use strict';var express=require(_0xb0fa('0x0'));var router=express[_0xb0fa('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xb0fa('0x2'));router[_0xb0fa('0x3')]('/',controller['index']);router['get'](_0xb0fa('0x4'),auth[_0xb0fa('0x5')](),auth[_0xb0fa('0x6')](),controller[_0xb0fa('0x7')]);router[_0xb0fa('0x3')]('/reset',auth[_0xb0fa('0x5')](),auth[_0xb0fa('0x6')](),controller[_0xb0fa('0x8')]);router['get'](_0xb0fa('0x9'),auth[_0xb0fa('0x5')](),auth[_0xb0fa('0x6')](),controller[_0xb0fa('0xa')]);router[_0xb0fa('0x3')](_0xb0fa('0xb'),auth[_0xb0fa('0x5')](),controller['restart']);router[_0xb0fa('0x3')]('/migrations',controller['migrations']);module['exports']=router;
\ No newline at end of file
+var _0xa265=['canUpdate','fetch','isAuthenticated','reset','/pull','pull','/restart','/migrations','express','Router','get','index','/fetch'];(function(_0x395ad7,_0x11577a){var _0x3ee145=function(_0x52c2ab){while(--_0x52c2ab){_0x395ad7['push'](_0x395ad7['shift']());}};_0x3ee145(++_0x11577a);}(_0xa265,0x18e));var _0x5a26=function(_0x336b13,_0x25db68){_0x336b13=_0x336b13-0x0;var _0x233906=_0xa265[_0x336b13];return _0x233906;};'use strict';var express=require(_0x5a26('0x0'));var router=express[_0x5a26('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x5a26('0x2')]('/',controller[_0x5a26('0x3')]);router[_0x5a26('0x2')](_0x5a26('0x4'),auth['isAuthenticated'](),auth[_0x5a26('0x5')](),controller[_0x5a26('0x6')]);router[_0x5a26('0x2')]('/reset',auth[_0x5a26('0x7')](),auth[_0x5a26('0x5')](),controller[_0x5a26('0x8')]);router[_0x5a26('0x2')](_0x5a26('0x9'),auth[_0x5a26('0x7')](),auth[_0x5a26('0x5')](),controller[_0x5a26('0xa')]);router['get'](_0x5a26('0xb'),auth[_0x5a26('0x7')](),controller['restart']);router[_0x5a26('0x2')](_0x5a26('0xc'),controller['migrations']);module['exports']=router;
\ No newline at end of file
index fb1b170..d4b41b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b51=['git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','server','migrations','length','replace','.js','push','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.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','query','latest','exports','2.0.0','status','json','fetch','origin','error','git\x20fetch'];(function(_0x31de35,_0x5d4499){var _0x3a8a45=function(_0x56573c){while(--_0x56573c){_0x31de35['push'](_0x31de35['shift']());}};_0x3a8a45(++_0x5d4499);}(_0x8b51,0x1aa));var _0x18b5=function(_0x27991c,_0x2afac7){_0x27991c=_0x27991c-0x0;var _0x7370e0=_0x8b51[_0x27991c];return _0x7370e0;};'use strict';var Umzug=require('umzug');var path=require(_0x18b5('0x0'));var fs=require('fs');var _=require(_0x18b5('0x1'));var pkginfo=require(_0x18b5('0x2'))(module,_0x18b5('0x3'));var compareVersions=require(_0x18b5('0x4'));var exec=require('child_process')[_0x18b5('0x5')];var db=require(_0x18b5('0x6'))['db'];var config=require(_0x18b5('0x7'));var pm2=require(_0x18b5('0x8'));var logger=require('../../config/logger')(_0x18b5('0x9'));var git=require(_0x18b5('0xa'))(config[_0x18b5('0xb')]);exports['index']=function(_0x109676,_0x2c7c81){var _0x421cf0={'current':module['exports']['version'],'phonebar':0x2};if(_0x109676[_0x18b5('0xc')]&&_0x109676['query'][_0x18b5('0xd')]){return git['fetch']()['tags'](function(_0x4e9c11,_0x343166){_0x421cf0[_0x18b5('0xd')]=(_0x4e9c11?module[_0x18b5('0xe')][_0x18b5('0x3')]:_0x343166[_0x18b5('0xd')])||_0x18b5('0xf');return _0x2c7c81[_0x18b5('0x10')](0xc8)['json'](_0x421cf0);});}else{return _0x2c7c81[_0x18b5('0x10')](0xc8)[_0x18b5('0x11')](_0x421cf0);}};exports[_0x18b5('0x12')]=function(_0x3f7f83,_0x3fa468){return git[_0x18b5('0x12')]([_0x18b5('0x13'),'master'],function(_0x9b0b8){if(_0x9b0b8){logger[_0x18b5('0x14')](_0x9b0b8);return _0x3fa468[_0x18b5('0x10')](0x1f4)[_0x18b5('0x11')](_0x9b0b8);}logger['info'](_0x18b5('0x15'));return _0x3fa468[_0x18b5('0x10')](0xc8)[_0x18b5('0x11')]({'output':_0x18b5('0x16')});});};exports[_0x18b5('0x17')]=function(_0x650d80,_0x19b065){return git[_0x18b5('0x17')]([_0x18b5('0x18'),_0x18b5('0x19')],function(_0x687825){if(_0x687825){logger[_0x18b5('0x14')](_0x687825);return _0x19b065[_0x18b5('0x10')](0x1f4)['json'](_0x687825);}logger['info'](_0x18b5('0x1a'));return _0x19b065[_0x18b5('0x10')](0xc8)[_0x18b5('0x11')]({'output':_0x18b5('0x1b')});});};exports[_0x18b5('0x1c')]=function(_0x3380a7,_0x528a91){exec(_0x18b5('0x1d'),function(_0x5b7e12,_0x2eed67,_0x54c62f){logger[_0x18b5('0x1e')](_0x2eed67);logger[_0x18b5('0x1e')](_0x54c62f);if(_0x5b7e12){logger[_0x18b5('0x14')](_0x5b7e12);return _0x528a91[_0x18b5('0x10')](0x1f4)[_0x18b5('0x11')](_0x5b7e12);}return _0x528a91[_0x18b5('0x10')](0xc8)[_0x18b5('0x11')]({'output':_0x2eed67});});};exports[_0x18b5('0x1f')]=function(_0x176ae9,_0x443b59){return pm2[_0x18b5('0x1f')](_0x18b5('0x20'))[_0x18b5('0x21')](function(_0x4cf0a1){logger[_0x18b5('0x1e')](_0x18b5('0x22'),_0x4cf0a1);return _0x443b59['status'](0xc8)['json']({'output':_0x18b5('0x23')});})[_0x18b5('0x24')](function(_0x2da874){logger[_0x18b5('0x14')](_0x2da874);return _0x443b59['status'](0x1f4)[_0x18b5('0x11')](_0x2da874);});};exports['migrations']=function(_0x622dcd,_0x341d78){var _0x4268a6=fs[_0x18b5('0x25')](path['join'](config[_0x18b5('0xb')],_0x18b5('0x26'),_0x18b5('0x27')));var _0x8424f4=[];for(var _0x435c74=0x0;_0x435c74<_0x4268a6[_0x18b5('0x28')];_0x435c74++){var _0x43a453=_0x4268a6[_0x435c74][_0x18b5('0x29')](_0x18b5('0x2a'),'');if(compareVersions(module[_0x18b5('0xe')]['version'],_0x43a453)===-0x1){_0x8424f4[_0x18b5('0x2b')](_0x43a453);}}if(_0x8424f4['length']){var _0x3808b7=_0x8424f4[_0x18b5('0x2c')](compareVersions);var _0x4f3468=new Umzug({'storage':_0x18b5('0x2d'),'storageOptions':{'model':db[_0x18b5('0x2e')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x18b5('0x2d')][_0x18b5('0x2f')](),db['sequelize'][_0x18b5('0x30')],function(){throw new Error(_0x18b5('0x31'));}],'path':path[_0x18b5('0x32')](config[_0x18b5('0xb')],'server',_0x18b5('0x27')),'pattern':/\.js$/}});_0x4f3468['up']({'migrations':_[_0x18b5('0x33')](_0x3808b7,function(_0x3f1e39){return _0x3f1e39+_0x18b5('0x2a');})})[_0x18b5('0x21')](function(){return _0x341d78[_0x18b5('0x10')](0xc8)[_0x18b5('0x11')]({'output':_0x18b5('0x34')+module[_0x18b5('0xe')][_0x18b5('0x3')]+'\x20to\x20'+_[_0x18b5('0x35')](_0x3808b7),'migrations':_[_0x18b5('0x32')](_0x3808b7)});})[_0x18b5('0x24')](function(_0xd22f44){if(_0xd22f44 instanceof db[_0x18b5('0x2d')][_0x18b5('0x36')]){return _0x341d78[_0x18b5('0x10')](0xc8)[_0x18b5('0x11')]({'output':_0x18b5('0x37')});}else{return _0x341d78[_0x18b5('0x10')](0x1f4)[_0x18b5('0x11')](_0xd22f44);}});}else{return _0x341d78['status'](0xc8)[_0x18b5('0x11')]({'output':_0x18b5('0x37')});}};
\ No newline at end of file
+var _0xe3e1=['error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','.js','push','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.','root','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/pm2','update','simple-git','index','exports','version','query','latest','fetch','tags','2.0.0','status','origin','master','info','git\x20fetch','json','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD'];(function(_0x42ffc5,_0x4f4f0d){var _0x477cbc=function(_0x363d64){while(--_0x363d64){_0x42ffc5['push'](_0x42ffc5['shift']());}};_0x477cbc(++_0x4f4f0d);}(_0xe3e1,0xfd));var _0x1e3e=function(_0x33592d,_0x13e7ea){_0x33592d=_0x33592d-0x0;var _0x477cb3=_0xe3e1[_0x33592d];return _0x477cb3;};'use strict';var Umzug=require('umzug');var path=require(_0x1e3e('0x0'));var fs=require('fs');var _=require(_0x1e3e('0x1'));var pkginfo=require(_0x1e3e('0x2'))(module,'version');var compareVersions=require(_0x1e3e('0x3'));var exec=require(_0x1e3e('0x4'))['exec'];var db=require(_0x1e3e('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0x1e3e('0x6'));var logger=require('../../config/logger')(_0x1e3e('0x7'));var git=require(_0x1e3e('0x8'))(config['root']);exports[_0x1e3e('0x9')]=function(_0x900059,_0x41668e){var _0x1d740c={'current':module[_0x1e3e('0xa')][_0x1e3e('0xb')],'phonebar':0x2};if(_0x900059[_0x1e3e('0xc')]&&_0x900059[_0x1e3e('0xc')][_0x1e3e('0xd')]){return git[_0x1e3e('0xe')]()[_0x1e3e('0xf')](function(_0xaec9f,_0x52b5f6){_0x1d740c['latest']=(_0xaec9f?module[_0x1e3e('0xa')][_0x1e3e('0xb')]:_0x52b5f6[_0x1e3e('0xd')])||_0x1e3e('0x10');return _0x41668e[_0x1e3e('0x11')](0xc8)['json'](_0x1d740c);});}else{return _0x41668e[_0x1e3e('0x11')](0xc8)['json'](_0x1d740c);}};exports[_0x1e3e('0xe')]=function(_0x2733ff,_0x36b42d){return git[_0x1e3e('0xe')]([_0x1e3e('0x12'),_0x1e3e('0x13')],function(_0x160f7b){if(_0x160f7b){logger['error'](_0x160f7b);return _0x36b42d['status'](0x1f4)['json'](_0x160f7b);}logger[_0x1e3e('0x14')](_0x1e3e('0x15'));return _0x36b42d[_0x1e3e('0x11')](0xc8)[_0x1e3e('0x16')]({'output':_0x1e3e('0x17')});});};exports[_0x1e3e('0x18')]=function(_0x4103b9,_0x1722fe){return git['reset']([_0x1e3e('0x19'),_0x1e3e('0x1a')],function(_0x1ca51e){if(_0x1ca51e){logger[_0x1e3e('0x1b')](_0x1ca51e);return _0x1722fe[_0x1e3e('0x11')](0x1f4)[_0x1e3e('0x16')](_0x1ca51e);}logger[_0x1e3e('0x14')](_0x1e3e('0x1c'));return _0x1722fe[_0x1e3e('0x11')](0xc8)['json']({'output':_0x1e3e('0x1d')});});};exports['pull']=function(_0x57a76c,_0x3e9103){exec(_0x1e3e('0x1e'),function(_0x3c8588,_0x93cb1f,_0x352994){logger[_0x1e3e('0x14')](_0x93cb1f);logger['info'](_0x352994);if(_0x3c8588){logger[_0x1e3e('0x1b')](_0x3c8588);return _0x3e9103[_0x1e3e('0x11')](0x1f4)['json'](_0x3c8588);}return _0x3e9103[_0x1e3e('0x11')](0xc8)['json']({'output':_0x93cb1f});});};exports[_0x1e3e('0x1f')]=function(_0xef0025,_0x1431f8){return pm2[_0x1e3e('0x1f')](_0x1e3e('0x20'))[_0x1e3e('0x21')](function(_0x321dfd){logger[_0x1e3e('0x14')](_0x1e3e('0x22'),_0x321dfd);return _0x1431f8[_0x1e3e('0x11')](0xc8)[_0x1e3e('0x16')]({'output':_0x1e3e('0x23')});})[_0x1e3e('0x24')](function(_0xb340f9){logger[_0x1e3e('0x1b')](_0xb340f9);return _0x1431f8[_0x1e3e('0x11')](0x1f4)[_0x1e3e('0x16')](_0xb340f9);});};exports['migrations']=function(_0xd9518e,_0x430d4c){var _0x32585e=fs[_0x1e3e('0x25')](path[_0x1e3e('0x26')](config['root'],_0x1e3e('0x27'),_0x1e3e('0x28')));var _0x4f0c2a=[];for(var _0x356c8a=0x0;_0x356c8a<_0x32585e[_0x1e3e('0x29')];_0x356c8a++){var _0x23a240=_0x32585e[_0x356c8a][_0x1e3e('0x2a')](_0x1e3e('0x2b'),'');if(compareVersions(module[_0x1e3e('0xa')][_0x1e3e('0xb')],_0x23a240)===-0x1){_0x4f0c2a[_0x1e3e('0x2c')](_0x23a240);}}if(_0x4f0c2a[_0x1e3e('0x29')]){var _0x420fdb=_0x4f0c2a[_0x1e3e('0x2d')](compareVersions);var _0x2d5647=new Umzug({'storage':_0x1e3e('0x2e'),'storageOptions':{'model':db[_0x1e3e('0x2f')],'modelName':'Migration','columnName':_0x1e3e('0xb')},'migrations':{'params':[db[_0x1e3e('0x2e')][_0x1e3e('0x30')](),db[_0x1e3e('0x2e')][_0x1e3e('0x31')],function(){throw new Error(_0x1e3e('0x32'));}],'path':path['join'](config[_0x1e3e('0x33')],_0x1e3e('0x27'),'migrations'),'pattern':/\.js$/}});_0x2d5647['up']({'migrations':_[_0x1e3e('0x34')](_0x420fdb,function(_0x3171be){return _0x3171be+_0x1e3e('0x2b');})})['then'](function(){return _0x430d4c[_0x1e3e('0x11')](0xc8)[_0x1e3e('0x16')]({'output':_0x1e3e('0x35')+module[_0x1e3e('0xa')][_0x1e3e('0xb')]+_0x1e3e('0x36')+_['last'](_0x420fdb),'migrations':_[_0x1e3e('0x26')](_0x420fdb)});})[_0x1e3e('0x24')](function(_0x55cb84){if(_0x55cb84 instanceof db['sequelize']['UniqueConstraintError']){return _0x430d4c[_0x1e3e('0x11')](0xc8)[_0x1e3e('0x16')]({'output':_0x1e3e('0x37')});}else{return _0x430d4c[_0x1e3e('0x11')](0x1f4)[_0x1e3e('0x16')](_0x55cb84);}});}else{return _0x430d4c[_0x1e3e('0x11')](0xc8)[_0x1e3e('0x16')]({'output':_0x1e3e('0x37')});}};
\ No newline at end of file
index fb764fd..0aef032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a85=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x2baff2,_0x283cfb){var _0x198b4e=function(_0x56aaad){while(--_0x56aaad){_0x2baff2['push'](_0x2baff2['shift']());}};_0x198b4e(++_0x283cfb);}(_0x5a85,0x6c));var _0x55a8=function(_0x525627,_0x27a74f){_0x525627=_0x525627-0x0;var _0x3af6f7=_0x5a85[_0x525627];return _0x3af6f7;};'use strict';var multer=require(_0x55a8('0x0'));var util=require(_0x55a8('0x1'));var path=require(_0x55a8('0x2'));var timeout=require(_0x55a8('0x3'));var express=require(_0x55a8('0x4'));var router=express[_0x55a8('0x5')]();var fs_extra=require(_0x55a8('0x6'));var auth=require(_0x55a8('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x55a8('0x8'));var controller=require(_0x55a8('0x9'));router[_0x55a8('0xa')]('/',auth[_0x55a8('0xb')](),controller[_0x55a8('0xc')]);router[_0x55a8('0xa')]('/describe',auth[_0x55a8('0xb')](),controller[_0x55a8('0xd')]);router[_0x55a8('0xa')](_0x55a8('0xe'),auth[_0x55a8('0xb')](),controller[_0x55a8('0xf')]);router[_0x55a8('0x10')]('/',auth[_0x55a8('0xb')](),controller[_0x55a8('0x11')]);router[_0x55a8('0x12')](_0x55a8('0xe'),auth[_0x55a8('0xb')](),controller[_0x55a8('0x13')]);router['delete'](_0x55a8('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x55a8('0x14')]=router;
\ No newline at end of file
+var _0xea9f=['../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','exports','path','connect-timeout','express'];(function(_0x160974,_0x2fdb6b){var _0x238d5c=function(_0x308275){while(--_0x308275){_0x160974['push'](_0x160974['shift']());}};_0x238d5c(++_0x2fdb6b);}(_0xea9f,0x10d));var _0xfea9=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xea9f[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfea9('0x0'));var timeout=require(_0xfea9('0x1'));var express=require(_0xfea9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfea9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfea9('0x4'));var controller=require(_0xfea9('0x5'));router[_0xfea9('0x6')]('/',auth[_0xfea9('0x7')](),controller[_0xfea9('0x8')]);router[_0xfea9('0x6')]('/describe',auth[_0xfea9('0x7')](),controller[_0xfea9('0x9')]);router['get'](_0xfea9('0xa'),auth[_0xfea9('0x7')](),controller[_0xfea9('0xb')]);router[_0xfea9('0xc')]('/',auth['isAuthenticated'](),controller[_0xfea9('0xd')]);router[_0xfea9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfea9('0xf')]);router['delete']('/:id',auth[_0xfea9('0x7')](),controller['destroy']);module[_0xfea9('0x10')]=router;
\ No newline at end of file
index 7fc5d01..da6e1b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x1302b0,_0x1f7f9f){var _0x421ca8=function(_0x25d670){while(--_0x25d670){_0x1302b0['push'](_0x1302b0['shift']());}};_0x421ca8(++_0x1f7f9f);}(_0x5204,0xdf));var _0x4520=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0x5204[_0x460666];return _0x555cbf;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4520('0x2')]},'calleridnum':{'type':Sequelize[_0x4520('0x2')]},'calleridname':{'type':Sequelize[_0x4520('0x2')]},'queue':{'type':Sequelize[_0x4520('0x2')]},'interface':{'type':Sequelize[_0x4520('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x4520('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x4520('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4520('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4520('0x3')]},'holdtime':{'type':Sequelize[_0x4520('0x4')]},'agentcomplete':{'type':Sequelize[_0x4520('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4520('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4520('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4520('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4520('0x2')]},'lastevent':{'type':Sequelize[_0x4520('0x2')]},'channel':{'type':Sequelize[_0x4520('0x2')]},'channelstate':{'type':Sequelize[_0x4520('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4520('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4520('0x2')]},'connectedlinename':{'type':Sequelize[_0x4520('0x2')]},'language':{'type':Sequelize[_0x4520('0x2')]},'accountcode':{'type':Sequelize[_0x4520('0x2')]},'context':{'type':Sequelize[_0x4520('0x2')]},'exten':{'type':Sequelize[_0x4520('0x2')]},'priority':{'type':Sequelize[_0x4520('0x2')]},'destchannel':{'type':Sequelize[_0x4520('0x2')]},'destchannelstate':{'type':Sequelize[_0x4520('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4520('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4520('0x2')]},'destcalleridname':{'type':Sequelize[_0x4520('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4520('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4520('0x2')]},'destlanguage':{'type':Sequelize[_0x4520('0x2')]},'destaccountcode':{'type':Sequelize[_0x4520('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x4520('0x2')]},'destpriority':{'type':Sequelize[_0x4520('0x2')]},'destuniqueid':{'type':Sequelize[_0x4520('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4520('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x4520('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4520('0x2')],'comment':_0x4520('0x6')},'transferexten':{'type':Sequelize[_0x4520('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4520('0x2')]},'agententerreason':{'type':Sequelize[_0x4520('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x988c=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x437b14,_0xcf17d4){var _0x1ad24e=function(_0x44b236){while(--_0x44b236){_0x437b14['push'](_0x437b14['shift']());}};_0x1ad24e(++_0xcf17d4);}(_0x988c,0x19e));var _0xc988=function(_0x225c12,_0xf0c93){_0x225c12=_0x225c12-0x0;var _0x56a582=_0x988c[_0x225c12];return _0x56a582;};'use strict';var Sequelize=require(_0xc988('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc988('0x1')]},'calleridname':{'type':Sequelize[_0xc988('0x1')]},'queue':{'type':Sequelize[_0xc988('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xc988('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xc988('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xc988('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc988('0x3')]},'agentcomplete':{'type':Sequelize[_0xc988('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc988('0x3')]},'agentacw':{'type':Sequelize[_0xc988('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc988('0x3')]},'reason':{'type':Sequelize[_0xc988('0x1')]},'lastevent':{'type':Sequelize[_0xc988('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xc988('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc988('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc988('0x1')]},'connectedlinename':{'type':Sequelize[_0xc988('0x1')]},'language':{'type':Sequelize[_0xc988('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc988('0x1')]},'exten':{'type':Sequelize[_0xc988('0x1')]},'priority':{'type':Sequelize[_0xc988('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc988('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc988('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xc988('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xc988('0x1')]},'destlanguage':{'type':Sequelize[_0xc988('0x1')]},'destaccountcode':{'type':Sequelize[_0xc988('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc988('0x1')]},'destpriority':{'type':Sequelize[_0xc988('0x1')]},'destuniqueid':{'type':Sequelize[_0xc988('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc988('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xc988('0x1')]},'transfer':{'type':Sequelize[_0xc988('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc988('0x1')],'comment':_0xc988('0x5')},'transferexten':{'type':Sequelize[_0xc988('0x1')]},'transferuniqueid':{'type':Sequelize[_0xc988('0x1')]},'agententerreason':{'type':Sequelize[_0xc988('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 814a5f8..6e29350 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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 8820a20..33503d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc23a=['util','../../config/logger','api','bluebird','rimraf','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid'];(function(_0x1bd670,_0xc7c22c){var _0xf434a8=function(_0x11c44e){while(--_0x11c44e){_0x1bd670['push'](_0x1bd670['shift']());}};_0xf434a8(++_0xc7c22c);}(_0xc23a,0xd2));var _0xac23=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0xc23a[_0x2718c7];return _0x59d89c;};'use strict';var _=require('lodash');var util=require(_0xac23('0x0'));var logger=require(_0xac23('0x1'))(_0xac23('0x2'));var moment=require('moment');var BPromise=require(_0xac23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xac23('0x4'));var config=require('../../config/environment');var attributes=require(_0xac23('0x5'));module[_0xac23('0x6')]=function(_0xc71a6d,_0x4c1482){return _0xc71a6d['define'](_0xac23('0x7'),attributes,{'tableName':_0xac23('0x8'),'paranoid':![],'indexes':[{'fields':[_0xac23('0x9'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c46=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','api','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8c46,0x171));var _0x68c4=function(_0x2eb0ba,_0x174584){_0x2eb0ba=_0x2eb0ba-0x0;var _0x109c0d=_0x8c46[_0x2eb0ba];return _0x109c0d;};'use strict';var _=require(_0x68c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x68c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68c4('0x2'));var fs=require('fs');var path=require(_0x68c4('0x3'));var rimraf=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var attributes=require(_0x68c4('0x6'));module[_0x68c4('0x7')]=function(_0x40ce21,_0x1516cf){return _0x40ce21[_0x68c4('0x8')](_0x68c4('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x68c4('0xa'),_0x68c4('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 5fef468..9c2938b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b93=['where','attributes','limit','lodash','util','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateVoiceAgentReport','body','options','raw','debug','catch','UpdateVoiceAgentReport','update'];(function(_0x54f50a,_0x1998af){var _0x24b748=function(_0x2029eb){while(--_0x2029eb){_0x54f50a['push'](_0x54f50a['shift']());}};_0x24b748(++_0x1998af);}(_0x9b93,0xab));var _0x39b9=function(_0x43fda2,_0x1c5662){_0x43fda2=_0x43fda2-0x0;var _0xa492a2=_0x9b93[_0x43fda2];return _0xa492a2;};'use strict';var _=require(_0x39b9('0x0'));var util=require(_0x39b9('0x1'));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(_0x39b9('0x2'));var logger=require(_0x39b9('0x3'))('rpc');var config=require(_0x39b9('0x4'));var jayson=require(_0x39b9('0x5'));var client=jayson[_0x39b9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f8e69,_0x2427c2,_0x10fb41){return new BPromise(function(_0x11a3e7,_0x36f7e9){return client[_0x39b9('0x7')](_0x4f8e69,_0x10fb41)[_0x39b9('0x8')](function(_0x1640a8){logger[_0x39b9('0x9')](_0x39b9('0xa'),_0x2427c2,_0x39b9('0xb'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x2427c2,_0x39b9('0xb'),JSON[_0x39b9('0xc')](_0x1640a8));if(_0x1640a8['error']){if(_0x1640a8['error'][_0x39b9('0xd')]===0x1f4){logger[_0x39b9('0xe')](_0x39b9('0xa'),_0x2427c2,_0x1640a8[_0x39b9('0xe')][_0x39b9('0xf')]);return _0x36f7e9(_0x1640a8['error'][_0x39b9('0xf')]);}logger['error'](_0x39b9('0xa'),_0x2427c2,_0x1640a8[_0x39b9('0xe')][_0x39b9('0xf')]);return _0x11a3e7(_0x1640a8[_0x39b9('0xe')][_0x39b9('0xf')]);}else{logger[_0x39b9('0x9')](_0x39b9('0xa'),_0x2427c2,'request\x20sent');_0x11a3e7(_0x1640a8[_0x39b9('0x10')][_0x39b9('0xf')]);}})['catch'](function(_0x3ddf6a){logger[_0x39b9('0xe')](_0x39b9('0xa'),_0x2427c2,_0x3ddf6a);_0x36f7e9(_0x3ddf6a);});});}exports[_0x39b9('0x11')]=function(_0x21de12){var _0x10a94b=this;return new Promise(function(_0x1128de,_0x2fc169){return db['VoiceAgentReport']['create'](_0x21de12[_0x39b9('0x12')],{'raw':_0x21de12[_0x39b9('0x13')]?_0x21de12['options'][_0x39b9('0x14')]===undefined?!![]:![]:!![]})[_0x39b9('0x8')](function(_0x28319c){logger[_0x39b9('0x9')](_0x39b9('0x11'),_0x21de12);logger[_0x39b9('0x15')](_0x39b9('0x11'),_0x21de12,JSON[_0x39b9('0xc')](_0x28319c));_0x1128de(_0x28319c);})[_0x39b9('0x16')](function(_0x1663a9){logger[_0x39b9('0xe')](_0x39b9('0x11'),_0x1663a9[_0x39b9('0xf')],_0x21de12);_0x2fc169(_0x10a94b[_0x39b9('0xe')](0x1f4,_0x1663a9[_0x39b9('0xf')]));});});};exports[_0x39b9('0x17')]=function(_0x1a1bb0){var _0x306fb4=this;return new Promise(function(_0x1dc39f,_0x4c2e20){return db['VoiceAgentReport'][_0x39b9('0x18')](_0x1a1bb0['body'],{'raw':_0x1a1bb0[_0x39b9('0x13')]?_0x1a1bb0[_0x39b9('0x13')][_0x39b9('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1bb0['options']?_0x1a1bb0[_0x39b9('0x13')][_0x39b9('0x19')]||null:null,'attributes':_0x1a1bb0['options']?_0x1a1bb0['options'][_0x39b9('0x1a')]||null:null,'limit':_0x1a1bb0[_0x39b9('0x13')]?_0x1a1bb0['options'][_0x39b9('0x1b')]||null:null})[_0x39b9('0x8')](function(_0x375f59){logger['info'](_0x39b9('0x17'),_0x1a1bb0);logger[_0x39b9('0x15')](_0x39b9('0x17'),_0x1a1bb0,JSON[_0x39b9('0xc')](_0x375f59));_0x1dc39f(_0x375f59);})['catch'](function(_0x21d978){logger['error'](_0x39b9('0x17'),_0x21d978[_0x39b9('0xf')],_0x1a1bb0);_0x4c2e20(_0x306fb4[_0x39b9('0xe')](0x1f4,_0x21d978[_0x39b9('0xf')]));});});};
\ No newline at end of file
+var _0xff2b=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','options','debug','UpdateVoiceAgentReport','body','raw','attributes','limit','util'];(function(_0x56b92c,_0x1e083d){var _0x3bdf3e=function(_0x526257){while(--_0x526257){_0x56b92c['push'](_0x56b92c['shift']());}};_0x3bdf3e(++_0x1e083d);}(_0xff2b,0x185));var _0xbff2=function(_0x544d59,_0x5af04b){_0x544d59=_0x544d59-0x0;var _0x45bf00=_0xff2b[_0x544d59];return _0x45bf00;};'use strict';var _=require('lodash');var util=require(_0xbff2('0x0'));var moment=require(_0xbff2('0x1'));var BPromise=require(_0xbff2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbff2('0x3'));var db=require(_0xbff2('0x4'))['db'];var utils=require(_0xbff2('0x5'));var logger=require(_0xbff2('0x6'))(_0xbff2('0x7'));var config=require(_0xbff2('0x8'));var jayson=require(_0xbff2('0x9'));var client=jayson[_0xbff2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d03b5,_0x3ac0fd,_0x1f22d5){return new BPromise(function(_0x316109,_0x12443f){return client['request'](_0x1d03b5,_0x1f22d5)[_0xbff2('0xb')](function(_0x30aeb9){logger[_0xbff2('0xc')](_0xbff2('0xd'),_0x3ac0fd,_0xbff2('0xe'));logger['debug'](_0xbff2('0xf'),_0x3ac0fd,_0xbff2('0xe'),JSON[_0xbff2('0x10')](_0x30aeb9));if(_0x30aeb9['error']){if(_0x30aeb9[_0xbff2('0x11')]['code']===0x1f4){logger[_0xbff2('0x11')](_0xbff2('0xd'),_0x3ac0fd,_0x30aeb9[_0xbff2('0x11')]['message']);return _0x12443f(_0x30aeb9['error'][_0xbff2('0x12')]);}logger[_0xbff2('0x11')](_0xbff2('0xd'),_0x3ac0fd,_0x30aeb9['error'][_0xbff2('0x12')]);return _0x316109(_0x30aeb9[_0xbff2('0x11')]['message']);}else{logger[_0xbff2('0xc')](_0xbff2('0xd'),_0x3ac0fd,_0xbff2('0xe'));_0x316109(_0x30aeb9[_0xbff2('0x13')]['message']);}})[_0xbff2('0x14')](function(_0x15aa70){logger[_0xbff2('0x11')](_0xbff2('0xd'),_0x3ac0fd,_0x15aa70);_0x12443f(_0x15aa70);});});}exports[_0xbff2('0x15')]=function(_0x264b26){var _0x3663f9=this;return new Promise(function(_0x36bdcf,_0x3d88e8){return db[_0xbff2('0x16')]['create'](_0x264b26['body'],{'raw':_0x264b26[_0xbff2('0x17')]?_0x264b26[_0xbff2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbff2('0xb')](function(_0x25015c){logger[_0xbff2('0xc')](_0xbff2('0x15'),_0x264b26);logger[_0xbff2('0x18')](_0xbff2('0x15'),_0x264b26,JSON[_0xbff2('0x10')](_0x25015c));_0x36bdcf(_0x25015c);})[_0xbff2('0x14')](function(_0x2a4caa){logger[_0xbff2('0x11')](_0xbff2('0x15'),_0x2a4caa['message'],_0x264b26);_0x3d88e8(_0x3663f9[_0xbff2('0x11')](0x1f4,_0x2a4caa[_0xbff2('0x12')]));});});};exports[_0xbff2('0x19')]=function(_0x552eb8){var _0x4aa7d4=this;return new Promise(function(_0x5c38e9,_0x40f6a6){return db[_0xbff2('0x16')]['update'](_0x552eb8[_0xbff2('0x1a')],{'raw':_0x552eb8['options']?_0x552eb8[_0xbff2('0x17')][_0xbff2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x552eb8[_0xbff2('0x17')]?_0x552eb8[_0xbff2('0x17')]['where']||null:null,'attributes':_0x552eb8['options']?_0x552eb8[_0xbff2('0x17')][_0xbff2('0x1c')]||null:null,'limit':_0x552eb8[_0xbff2('0x17')]?_0x552eb8[_0xbff2('0x17')][_0xbff2('0x1d')]||null:null})[_0xbff2('0xb')](function(_0x19d096){logger[_0xbff2('0xc')](_0xbff2('0x19'),_0x552eb8);logger[_0xbff2('0x18')](_0xbff2('0x19'),_0x552eb8,JSON[_0xbff2('0x10')](_0x19d096));_0x5c38e9(_0x19d096);})[_0xbff2('0x14')](function(_0x3bc903){logger['error'](_0xbff2('0x19'),_0x3bc903[_0xbff2('0x12')],_0x552eb8);_0x40f6a6(_0x4aa7d4[_0xbff2('0x11')](0x1f4,_0x3bc903[_0xbff2('0x12')]));});});};
\ No newline at end of file
index 9cf2bfb..9bdb6b6 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','./voiceCallReport.controller','get','isAuthenticated','index','/describe'];(function(_0x39bb3f,_0x1b3b72){var _0x241caf=function(_0x1a82f7){while(--_0x1a82f7){_0x39bb3f['push'](_0x39bb3f['shift']());}};_0x241caf(++_0x1b3b72);}(_0x1b20,0x66));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'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 _0x6737=['isAuthenticated','index','get','show','create','put','update','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x92922,_0x114d1f){var _0x419fde=function(_0x40cfd7){while(--_0x40cfd7){_0x92922['push'](_0x92922['shift']());}};_0x419fde(++_0x114d1f);}(_0x6737,0xe2));var _0x7673=function(_0x2071b7,_0x489ea4){_0x2071b7=_0x2071b7-0x0;var _0x4c7f77=_0x6737[_0x2071b7];return _0x4c7f77;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7673('0xa')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0xb')]);router['post']('/',auth[_0x7673('0x8')](),controller[_0x7673('0xc')]);router[_0x7673('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0xe')]);router['delete'](_0x7673('0xf'),auth[_0x7673('0x8')](),controller[_0x7673('0x10')]);module[_0x7673('0x11')]=router;
\ No newline at end of file
index ecf15fe..51863a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1648=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','TEXT'];(function(_0x1da250,_0x5acb20){var _0x2ec21b=function(_0x247c43){while(--_0x247c43){_0x1da250['push'](_0x1da250['shift']());}};_0x2ec21b(++_0x5acb20);}(_0x1648,0xa7));var _0x8164=function(_0x3c4708,_0x5c67d3){_0x3c4708=_0x3c4708-0x0;var _0x1b0699=_0x1648[_0x3c4708];return _0x1b0699;};'use strict';var Sequelize=require(_0x8164('0x0'));module[_0x8164('0x1')]={'uniqueid':{'type':Sequelize[_0x8164('0x2')]},'type':{'type':Sequelize[_0x8164('0x3')](_0x8164('0x4'),_0x8164('0x5'),'outbound',_0x8164('0x6'),_0x8164('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8164('0x2')]},'source':{'type':Sequelize[_0x8164('0x2')]},'destination':{'type':Sequelize[_0x8164('0x2')]},'destinationcontext':{'type':Sequelize[_0x8164('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8164('0x2')]},'destinationchannel':{'type':Sequelize[_0x8164('0x2')]},'lastapplication':{'type':Sequelize[_0x8164('0x2')]},'lastdata':{'type':Sequelize[_0x8164('0x8')]},'starttime':{'type':Sequelize[_0x8164('0x9')]},'systemanswertime':{'type':Sequelize[_0x8164('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8164('0x9')]},'duration':{'type':Sequelize[_0x8164('0xa')]},'billableseconds':{'type':Sequelize[_0x8164('0xa')]},'mohtime':{'type':Sequelize[_0x8164('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8164('0x2')]},'amaflags':{'type':Sequelize[_0x8164('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x8164('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x8164('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x8164('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x8164('0xa')]},'sipcallid':{'type':Sequelize[_0x8164('0x2')]}};
\ No newline at end of file
+var _0x7ae6=['outbound-fax','STRING','TEXT','DATE','INTEGER','exports','ENUM','inbound','internal','outbound','inbound-fax'];(function(_0x1fb15e,_0x5a93fb){var _0x437718=function(_0x2ea3b){while(--_0x2ea3b){_0x1fb15e['push'](_0x1fb15e['shift']());}};_0x437718(++_0x5a93fb);}(_0x7ae6,0x94));var _0x67ae=function(_0x31bda8,_0x13e359){_0x31bda8=_0x31bda8-0x0;var _0x1d50a0=_0x7ae6[_0x31bda8];return _0x1d50a0;};'use strict';var Sequelize=require('sequelize');module[_0x67ae('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x67ae('0x1')](_0x67ae('0x2'),_0x67ae('0x3'),_0x67ae('0x4'),_0x67ae('0x5'),_0x67ae('0x6'),'dialer')},'tag':{'type':Sequelize[_0x67ae('0x7')]},'accountcode':{'type':Sequelize[_0x67ae('0x7')]},'source':{'type':Sequelize[_0x67ae('0x7')]},'destination':{'type':Sequelize[_0x67ae('0x7')]},'destinationcontext':{'type':Sequelize[_0x67ae('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x67ae('0x7')]},'destinationchannel':{'type':Sequelize[_0x67ae('0x7')]},'lastapplication':{'type':Sequelize[_0x67ae('0x7')]},'lastdata':{'type':Sequelize[_0x67ae('0x8')]},'starttime':{'type':Sequelize[_0x67ae('0x9')]},'systemanswertime':{'type':Sequelize[_0x67ae('0x9')]},'answertime':{'type':Sequelize[_0x67ae('0x9')]},'endtime':{'type':Sequelize[_0x67ae('0x9')]},'duration':{'type':Sequelize[_0x67ae('0xa')]},'billableseconds':{'type':Sequelize[_0x67ae('0xa')]},'mohtime':{'type':Sequelize[_0x67ae('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x67ae('0x7')]},'amaflags':{'type':Sequelize[_0x67ae('0x7')]},'userfield':{'type':Sequelize[_0x67ae('0x7')]},'userDisposition':{'type':Sequelize[_0x67ae('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x67ae('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x67ae('0x7')]},'note':{'type':Sequelize[_0x67ae('0x7')]},'prefix':{'type':Sequelize[_0x67ae('0x7')]},'routeid':{'type':Sequelize[_0x67ae('0xa')]},'sipcallid':{'type':Sequelize[_0x67ae('0x7')]}};
\ No newline at end of file
index c86a11d..bbb5e40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37810c,_0x480382){_0x37810c=_0x37810c-0x0;var _0x44c4ef=_0x5f2f[_0x37810c];return _0x44c4ef;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));};
\ No newline at end of file
+var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x4576aa,_0x46c8a8){var _0x1ec6ba=function(_0x356675){while(--_0x356675){_0x4576aa['push'](_0x4576aa['shift']());}};_0x1ec6ba(++_0x46c8a8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0x0b0e[_0x2f8a7c];return _0x257e01;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));};
\ No newline at end of file
index 8cfa6f6..25e913a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1622=['report_call','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1622,0x115));var _0x2162=function(_0x5db129,_0x151303){_0x5db129=_0x5db129-0x0;var _0x5ec143=_0x1622[_0x5db129];return _0x5ec143;};'use strict';var _=require(_0x2162('0x0'));var util=require(_0x2162('0x1'));var logger=require(_0x2162('0x2'))(_0x2162('0x3'));var moment=require(_0x2162('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2162('0x5'));var rimraf=require(_0x2162('0x6'));var config=require(_0x2162('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x4f5311,_0x494833){return _0x4f5311[_0x2162('0x8')]('VoiceCallReport',attributes,{'tableName':_0x2162('0x9'),'paranoid':![],'indexes':[{'fields':[_0x2162('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x100a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','lodash','../../config/logger','api'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x100a,0x97));var _0xa100=function(_0x23cfaf,_0x40f9ad){_0x23cfaf=_0x23cfaf-0x0;var _0x1586ea=_0x100a[_0x23cfaf];return _0x1586ea;};'use strict';var _=require(_0xa100('0x0'));var util=require('util');var logger=require(_0xa100('0x1'))(_0xa100('0x2'));var moment=require(_0xa100('0x3'));var BPromise=require(_0xa100('0x4'));var rp=require(_0xa100('0x5'));var fs=require('fs');var path=require(_0xa100('0x6'));var rimraf=require(_0xa100('0x7'));var config=require(_0xa100('0x8'));var attributes=require(_0xa100('0x9'));module['exports']=function(_0x45ef6a,_0x538c32){return _0x45ef6a[_0xa100('0xa')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index f86e24e..da6148b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab29=['then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','map','include','model','create','body','raw','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab29,0x6a));var _0x9ab2=function(_0xff8083,_0x5870d5){_0xff8083=_0xff8083-0x0;var _0x556b9a=_0xab29[_0xff8083];return _0x556b9a;};'use strict';var _=require(_0x9ab2('0x0'));var util=require('util');var moment=require(_0x9ab2('0x1'));var BPromise=require(_0x9ab2('0x2'));var rs=require(_0x9ab2('0x3'));var fs=require('fs');var Redis=require(_0x9ab2('0x4'));var db=require(_0x9ab2('0x5'))['db'];var utils=require(_0x9ab2('0x6'));var logger=require(_0x9ab2('0x7'))('rpc');var config=require(_0x9ab2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ab2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7195cb,_0x47f49a,_0xf53cd9){return new BPromise(function(_0x4704b7,_0x35113d){return client[_0x9ab2('0xa')](_0x7195cb,_0xf53cd9)[_0x9ab2('0xb')](function(_0x165848){logger['info'](_0x9ab2('0xc'),_0x47f49a,_0x9ab2('0xd'));logger[_0x9ab2('0xe')](_0x9ab2('0xf'),_0x47f49a,_0x9ab2('0xd'),JSON[_0x9ab2('0x10')](_0x165848));if(_0x165848[_0x9ab2('0x11')]){if(_0x165848['error'][_0x9ab2('0x12')]===0x1f4){logger['error'](_0x9ab2('0xc'),_0x47f49a,_0x165848[_0x9ab2('0x11')][_0x9ab2('0x13')]);return _0x35113d(_0x165848[_0x9ab2('0x11')][_0x9ab2('0x13')]);}logger[_0x9ab2('0x11')](_0x9ab2('0xc'),_0x47f49a,_0x165848['error'][_0x9ab2('0x13')]);return _0x4704b7(_0x165848['error'][_0x9ab2('0x13')]);}else{logger[_0x9ab2('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x47f49a,_0x9ab2('0xd'));_0x4704b7(_0x165848[_0x9ab2('0x15')][_0x9ab2('0x13')]);}})[_0x9ab2('0x16')](function(_0x18414d){logger[_0x9ab2('0x11')](_0x9ab2('0xc'),_0x47f49a,_0x18414d);_0x35113d(_0x18414d);});});}exports[_0x9ab2('0x17')]=function(_0x47f138){var _0x454395=this;return new Promise(function(_0x55a2a8,_0x555e19){return db[_0x9ab2('0x18')][_0x9ab2('0x19')]({'raw':_0x47f138[_0x9ab2('0x1a')]?_0x47f138[_0x9ab2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x47f138[_0x9ab2('0x1a')]?_0x47f138[_0x9ab2('0x1a')][_0x9ab2('0x1b')]||null:null,'attributes':_0x47f138[_0x9ab2('0x1a')]?_0x47f138[_0x9ab2('0x1a')][_0x9ab2('0x1c')]||null:null,'limit':_0x47f138[_0x9ab2('0x1a')]?_0x47f138[_0x9ab2('0x1a')][_0x9ab2('0x1d')]||null:null,'include':_0x47f138[_0x9ab2('0x1a')]?_0x47f138[_0x9ab2('0x1a')]['include']?_[_0x9ab2('0x1e')](_0x47f138[_0x9ab2('0x1a')][_0x9ab2('0x1f')],function(_0x24530c){return{'model':db[_0x24530c[_0x9ab2('0x20')]],'as':_0x24530c['as'],'attributes':_0x24530c[_0x9ab2('0x1c')],'include':_0x24530c[_0x9ab2('0x1f')]?_['map'](_0x24530c[_0x9ab2('0x1f')],function(_0x4b6f5e){return{'model':db[_0x4b6f5e['model']],'as':_0x4b6f5e['as'],'attributes':_0x4b6f5e[_0x9ab2('0x1c')],'include':_0x4b6f5e[_0x9ab2('0x1f')]?_[_0x9ab2('0x1e')](_0x4b6f5e['include'],function(_0x8dc6d2){return{'model':db[_0x8dc6d2['model']],'as':_0x8dc6d2['as'],'attributes':_0x8dc6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ab2('0xb')](function(_0x15098a){logger[_0x9ab2('0x14')](_0x9ab2('0x17'),_0x47f138);logger[_0x9ab2('0xe')]('GetVoiceCallReport',_0x47f138,JSON[_0x9ab2('0x10')](_0x15098a));_0x55a2a8(_0x15098a);})[_0x9ab2('0x16')](function(_0x38fdb1){logger[_0x9ab2('0x11')](_0x9ab2('0x17'),_0x38fdb1[_0x9ab2('0x13')],_0x47f138);_0x555e19(_0x454395[_0x9ab2('0x11')](0x1f4,_0x38fdb1['message']));});});};exports['CreateVoiceCallReport']=function(_0x7627cc){var _0x5b6fce=this;return new Promise(function(_0x36e3cf,_0x13bf2a){return db[_0x9ab2('0x18')][_0x9ab2('0x21')](_0x7627cc[_0x9ab2('0x22')],{'raw':_0x7627cc[_0x9ab2('0x1a')]?_0x7627cc[_0x9ab2('0x1a')][_0x9ab2('0x23')]===undefined?!![]:![]:!![]})[_0x9ab2('0xb')](function(_0x425dd5){logger[_0x9ab2('0x14')]('CreateVoiceCallReport',_0x7627cc);logger[_0x9ab2('0xe')](_0x9ab2('0x24'),_0x7627cc,JSON[_0x9ab2('0x10')](_0x425dd5));_0x36e3cf(_0x425dd5);})[_0x9ab2('0x16')](function(_0x5d9c24){logger[_0x9ab2('0x11')](_0x9ab2('0x24'),_0x5d9c24['message'],_0x7627cc);_0x13bf2a(_0x5b6fce['error'](0x1f4,_0x5d9c24['message']));});});};exports[_0x9ab2('0x25')]=function(_0x6d1e33){var _0x3c7a08=this;return new Promise(function(_0x614664,_0x7c4a62){return db['VoiceCallReport'][_0x9ab2('0x26')](_0x6d1e33[_0x9ab2('0x22')],{'raw':_0x6d1e33[_0x9ab2('0x1a')]?_0x6d1e33[_0x9ab2('0x1a')][_0x9ab2('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6d1e33[_0x9ab2('0x1a')]?_0x6d1e33[_0x9ab2('0x1a')][_0x9ab2('0x1b')]||null:null,'attributes':_0x6d1e33[_0x9ab2('0x1a')]?_0x6d1e33[_0x9ab2('0x1a')][_0x9ab2('0x1c')]||null:null,'limit':_0x6d1e33['options']?_0x6d1e33[_0x9ab2('0x1a')][_0x9ab2('0x1d')]||null:null})[_0x9ab2('0xb')](function(_0x3eac83){logger[_0x9ab2('0x14')](_0x9ab2('0x25'),_0x6d1e33);logger[_0x9ab2('0xe')]('UpdateVoiceCallReport',_0x6d1e33,JSON[_0x9ab2('0x10')](_0x3eac83));_0x614664(_0x3eac83);})['catch'](function(_0x220abc){logger[_0x9ab2('0x11')](_0x9ab2('0x25'),_0x220abc[_0x9ab2('0x13')],_0x6d1e33);_0x7c4a62(_0x3c7a08[_0x9ab2('0x11')](0x1f4,_0x220abc[_0x9ab2('0x13')]));});});};
\ No newline at end of file
+var _0xd1d2=['jayson/promise','request','then','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','map','include','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','body','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x45b531,_0x65b5b8){var _0x95e6a=function(_0x5b8ad7){while(--_0x5b8ad7){_0x45b531['push'](_0x45b531['shift']());}};_0x95e6a(++_0x65b5b8);}(_0xd1d2,0xf9));var _0x2d1d=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xd1d2[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d1d('0x0'));var BPromise=require(_0x2d1d('0x1'));var rs=require(_0x2d1d('0x2'));var fs=require('fs');var Redis=require(_0x2d1d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d1d('0x4'));var logger=require(_0x2d1d('0x5'))(_0x2d1d('0x6'));var config=require('../../config/environment');var jayson=require(_0x2d1d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5acf26,_0x4d7376,_0x4da8e2){return new BPromise(function(_0x34ad68,_0x1c3aaa){return client[_0x2d1d('0x8')](_0x5acf26,_0x4da8e2)[_0x2d1d('0x9')](function(_0x44c6c2){logger['info'](_0x2d1d('0xa'),_0x4d7376,'request\x20sent');logger[_0x2d1d('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4d7376,_0x2d1d('0xc'),JSON[_0x2d1d('0xd')](_0x44c6c2));if(_0x44c6c2[_0x2d1d('0xe')]){if(_0x44c6c2[_0x2d1d('0xe')]['code']===0x1f4){logger[_0x2d1d('0xe')](_0x2d1d('0xa'),_0x4d7376,_0x44c6c2['error'][_0x2d1d('0xf')]);return _0x1c3aaa(_0x44c6c2[_0x2d1d('0xe')][_0x2d1d('0xf')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4d7376,_0x44c6c2[_0x2d1d('0xe')][_0x2d1d('0xf')]);return _0x34ad68(_0x44c6c2[_0x2d1d('0xe')][_0x2d1d('0xf')]);}else{logger[_0x2d1d('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x4d7376,_0x2d1d('0xc'));_0x34ad68(_0x44c6c2['result'][_0x2d1d('0xf')]);}})[_0x2d1d('0x11')](function(_0x453f8c){logger['error'](_0x2d1d('0xa'),_0x4d7376,_0x453f8c);_0x1c3aaa(_0x453f8c);});});}exports[_0x2d1d('0x12')]=function(_0x204377){var _0x52ac13=this;return new Promise(function(_0x8dff5,_0x3a7c82){return db[_0x2d1d('0x13')][_0x2d1d('0x14')]({'raw':_0x204377['options']?_0x204377[_0x2d1d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x204377[_0x2d1d('0x15')]?_0x204377[_0x2d1d('0x15')][_0x2d1d('0x16')]||null:null,'attributes':_0x204377[_0x2d1d('0x15')]?_0x204377[_0x2d1d('0x15')][_0x2d1d('0x17')]||null:null,'limit':_0x204377['options']?_0x204377[_0x2d1d('0x15')][_0x2d1d('0x18')]||null:null,'include':_0x204377['options']?_0x204377['options']['include']?_[_0x2d1d('0x19')](_0x204377[_0x2d1d('0x15')][_0x2d1d('0x1a')],function(_0x45ef88){return{'model':db[_0x45ef88['model']],'as':_0x45ef88['as'],'attributes':_0x45ef88[_0x2d1d('0x17')],'include':_0x45ef88[_0x2d1d('0x1a')]?_['map'](_0x45ef88[_0x2d1d('0x1a')],function(_0x6afe4f){return{'model':db[_0x6afe4f['model']],'as':_0x6afe4f['as'],'attributes':_0x6afe4f[_0x2d1d('0x17')],'include':_0x6afe4f[_0x2d1d('0x1a')]?_[_0x2d1d('0x19')](_0x6afe4f[_0x2d1d('0x1a')],function(_0x39c8b6){return{'model':db[_0x39c8b6['model']],'as':_0x39c8b6['as'],'attributes':_0x39c8b6['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d1d('0x9')](function(_0x2c41e7){logger[_0x2d1d('0x10')](_0x2d1d('0x12'),_0x204377);logger[_0x2d1d('0xb')](_0x2d1d('0x12'),_0x204377,JSON[_0x2d1d('0xd')](_0x2c41e7));_0x8dff5(_0x2c41e7);})[_0x2d1d('0x11')](function(_0x1b9b5f){logger[_0x2d1d('0xe')]('GetVoiceCallReport',_0x1b9b5f[_0x2d1d('0xf')],_0x204377);_0x3a7c82(_0x52ac13[_0x2d1d('0xe')](0x1f4,_0x1b9b5f[_0x2d1d('0xf')]));});});};exports[_0x2d1d('0x1b')]=function(_0x33e100){var _0x466440=this;return new Promise(function(_0x1df9c5,_0x516512){return db['VoiceCallReport'][_0x2d1d('0x1c')](_0x33e100['body'],{'raw':_0x33e100['options']?_0x33e100['options'][_0x2d1d('0x1d')]===undefined?!![]:![]:!![]})[_0x2d1d('0x9')](function(_0x422895){logger[_0x2d1d('0x10')](_0x2d1d('0x1b'),_0x33e100);logger[_0x2d1d('0xb')](_0x2d1d('0x1b'),_0x33e100,JSON['stringify'](_0x422895));_0x1df9c5(_0x422895);})[_0x2d1d('0x11')](function(_0x4a7d98){logger[_0x2d1d('0xe')](_0x2d1d('0x1b'),_0x4a7d98[_0x2d1d('0xf')],_0x33e100);_0x516512(_0x466440[_0x2d1d('0xe')](0x1f4,_0x4a7d98[_0x2d1d('0xf')]));});});};exports[_0x2d1d('0x1e')]=function(_0x512e94){var _0x12fe8a=this;return new Promise(function(_0xbf6070,_0x281c9b){return db[_0x2d1d('0x13')]['update'](_0x512e94[_0x2d1d('0x1f')],{'raw':_0x512e94['options']?_0x512e94['options'][_0x2d1d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x512e94[_0x2d1d('0x15')]?_0x512e94[_0x2d1d('0x15')][_0x2d1d('0x16')]||null:null,'attributes':_0x512e94[_0x2d1d('0x15')]?_0x512e94[_0x2d1d('0x15')][_0x2d1d('0x17')]||null:null,'limit':_0x512e94[_0x2d1d('0x15')]?_0x512e94[_0x2d1d('0x15')][_0x2d1d('0x18')]||null:null})[_0x2d1d('0x9')](function(_0x2655f6){logger[_0x2d1d('0x10')](_0x2d1d('0x1e'),_0x512e94);logger[_0x2d1d('0xb')](_0x2d1d('0x1e'),_0x512e94,JSON['stringify'](_0x2655f6));_0xbf6070(_0x2655f6);})[_0x2d1d('0x11')](function(_0x172cc8){logger[_0x2d1d('0xe')](_0x2d1d('0x1e'),_0x172cc8[_0x2d1d('0xf')],_0x512e94);_0x281c9b(_0x12fe8a['error'](0x1f4,_0x172cc8[_0x2d1d('0xf')]));});});};
\ No newline at end of file
index fb54e31..48750ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08bd=['create','update','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5b0f23,_0xb795e){var _0x4df725=function(_0x5e4f95){while(--_0x5e4f95){_0x5b0f23['push'](_0x5b0f23['shift']());}};_0x4df725(++_0xb795e);}(_0x08bd,0x1f3));var _0xd08b=function(_0x4c8a2d,_0x2e7176){_0x4c8a2d=_0x4c8a2d-0x0;var _0x28cfd7=_0x08bd[_0x4c8a2d];return _0x28cfd7;};'use strict';var multer=require(_0xd08b('0x0'));var util=require('util');var path=require(_0xd08b('0x1'));var timeout=require(_0xd08b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd08b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd08b('0x4'));var config=require(_0xd08b('0x5'));var controller=require(_0xd08b('0x6'));router[_0xd08b('0x7')]('/',auth[_0xd08b('0x8')](),controller[_0xd08b('0x9')]);router[_0xd08b('0x7')](_0xd08b('0xa'),auth[_0xd08b('0x8')](),controller[_0xd08b('0xb')]);router[_0xd08b('0xc')]('/',auth['isAuthenticated'](),controller[_0xd08b('0xd')]);router['put'](_0xd08b('0xa'),auth[_0xd08b('0x8')](),controller[_0xd08b('0xe')]);router['delete'](_0xd08b('0xa'),auth[_0xd08b('0x8')](),controller['destroy']);module[_0xd08b('0xf')]=router;
\ No newline at end of file
+var _0x685b=['put','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x107ff6,_0x29c3c2){var _0xd8014b=function(_0x4338ac){while(--_0x4338ac){_0x107ff6['push'](_0x107ff6['shift']());}};_0xd8014b(++_0x29c3c2);}(_0x685b,0x13e));var _0xb685=function(_0x28089e,_0x530f8a){_0x28089e=_0x28089e-0x0;var _0x46a73c=_0x685b[_0x28089e];return _0x46a73c;};'use strict';var multer=require(_0xb685('0x0'));var util=require('util');var path=require(_0xb685('0x1'));var timeout=require('connect-timeout');var express=require(_0xb685('0x2'));var router=express[_0xb685('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb685('0x4'));var config=require(_0xb685('0x5'));var controller=require('./voiceChanSpy.controller');router[_0xb685('0x6')]('/',auth[_0xb685('0x7')](),controller[_0xb685('0x8')]);router['get'](_0xb685('0x9'),auth[_0xb685('0x7')](),controller[_0xb685('0xa')]);router[_0xb685('0xb')]('/',auth[_0xb685('0x7')](),controller['create']);router[_0xb685('0xc')](_0xb685('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb685('0x9'),auth[_0xb685('0x7')](),controller[_0xb685('0xd')]);module[_0xb685('0xe')]=router;
\ No newline at end of file
index 2eaa0b1..8be2736 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1ee=['STRING','setDataValue','options','join','getDataValue','BOOLEAN','sequelize'];(function(_0x200395,_0x4ebccb){var _0x25bf74=function(_0x5a03bd){while(--_0x5a03bd){_0x200395['push'](_0x200395['shift']());}};_0x25bf74(++_0x4ebccb);}(_0xf1ee,0x6f));var _0xef1e=function(_0x8e1559,_0x37a9f5){_0x8e1559=_0x8e1559-0x0;var _0x20d429=_0xf1ee[_0x8e1559];return _0x20d429;};'use strict';var Sequelize=require(_0xef1e('0x0'));module['exports']={'name':{'type':Sequelize[_0xef1e('0x1')]},'prefix':{'type':Sequelize[_0xef1e('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xef1e('0x1')],'set':function(_0x82a594){this[_0xef1e('0x2')](_0xef1e('0x3'),_0x82a594?_0x82a594[_0xef1e('0x4')](''):[]);},'get':function(){return this[_0xef1e('0x5')](_0xef1e('0x3'))?this[_0xef1e('0x5')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xef1e('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xef1e('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xef1e('0x1')]}};
\ No newline at end of file
+var _0x4b1b=['split','BOOLEAN','exports','STRING','name','options','join','getDataValue'];(function(_0xeaea7d,_0x3056ba){var _0x5d39a1=function(_0x12dcdd){while(--_0x12dcdd){_0xeaea7d['push'](_0xeaea7d['shift']());}};_0x5d39a1(++_0x3056ba);}(_0x4b1b,0x1a2));var _0xb4b1=function(_0x365798,_0x405a65){_0x365798=_0x365798-0x0;var _0x450b46=_0x4b1b[_0x365798];return _0x450b46;};'use strict';var Sequelize=require('sequelize');module[_0xb4b1('0x0')]={'name':{'type':Sequelize[_0xb4b1('0x1')]},'prefix':{'type':Sequelize[_0xb4b1('0x1')],'unique':_0xb4b1('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xb4b1('0x1')],'set':function(_0x3d429b){this['setDataValue'](_0xb4b1('0x3'),_0x3d429b?_0x3d429b[_0xb4b1('0x4')](''):[]);},'get':function(){return this[_0xb4b1('0x5')]('options')?this[_0xb4b1('0x5')]('options')[_0xb4b1('0x6')](''):[];}},'auth':{'type':Sequelize[_0xb4b1('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xb4b1('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb4b1('0x1')]},'description':{'type':Sequelize[_0xb4b1('0x1')]}};
\ No newline at end of file
index f38824e..e57614f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67da=['json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','include','findAll','catch','params','intersection','length','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x32430c,_0x2d4225){var _0x148c09=function(_0x3406e2){while(--_0x3406e2){_0x32430c['push'](_0x32430c['shift']());}};_0x148c09(++_0x2d4225);}(_0x67da,0x192));var _0xa67d=function(_0x4417fc,_0xea1914){_0x4417fc=_0x4417fc-0x0;var _0x486565=_0x67da[_0x4417fc];return _0x486565;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){var _0x5ed92a=_0x559009[_0xa67d('0x27')]({'plain':!![]});var _0x3dd0b9=_0xa67d('0x28');return db[_0xa67d('0x29')][_0xa67d('0x26')]({'where':{'type':_0x3dd0b9,'resourceId':_0x5ed92a['id']}})[_0xa67d('0x25')](function(){return _0x559009;});})['then'](function(){_0x46bbc8[_0xa67d('0x1b')](0xcc)[_0xa67d('0x2a')]();});}};}function handleEntityNotFound(_0x4e730e,_0x2ac61a){return function(_0x83b547){if(!_0x83b547){_0x4e730e[_0xa67d('0x2b')](0x194);}return _0x83b547;};}function handleError(_0x1e7f28,_0x40f829){_0x40f829=_0x40f829||0x1f4;return function(_0x8793cf){logger[_0xa67d('0x2c')](_0x8793cf[_0xa67d('0x2d')]);if(_0x8793cf[_0xa67d('0x2e')]){delete _0x8793cf[_0xa67d('0x2e')];}_0x1e7f28[_0xa67d('0x1b')](_0x40f829)[_0xa67d('0x2f')](_0x8793cf);};}exports[_0xa67d('0x30')]=function(_0x393269,_0x5e4f04){var _0x2998af={},_0x20c751={},_0x1fc18f={'count':0x0,'rows':[]};var _0x2703f5=_[_0xa67d('0x31')](db['VoiceChanSpy'][_0xa67d('0x32')],function(_0xc2b129){return{'name':_0xc2b129[_0xa67d('0x33')],'type':_0xc2b129[_0xa67d('0x34')][_0xa67d('0x35')]};});_0x20c751[_0xa67d('0x36')]=_[_0xa67d('0x31')](_0x2703f5,_0xa67d('0x2e'));_0x20c751[_0xa67d('0x37')]=_[_0xa67d('0x38')](_0x393269['query']);_0x20c751[_0xa67d('0x39')]=_['intersection'](_0x20c751[_0xa67d('0x36')],_0x20c751[_0xa67d('0x37')]);_0x2998af[_0xa67d('0x3a')]=_['intersection'](_0x20c751[_0xa67d('0x36')],qs[_0xa67d('0x3b')](_0x393269[_0xa67d('0x37')][_0xa67d('0x3b')]));_0x2998af[_0xa67d('0x3a')]=_0x2998af[_0xa67d('0x3a')]['length']?_0x2998af[_0xa67d('0x3a')]:_0x20c751[_0xa67d('0x36')];if(!_0x393269['query']['hasOwnProperty']('nolimit')){_0x2998af[_0xa67d('0x20')]=qs['limit'](_0x393269[_0xa67d('0x37')][_0xa67d('0x20')]);_0x2998af[_0xa67d('0x1f')]=qs[_0xa67d('0x1f')](_0x393269[_0xa67d('0x37')][_0xa67d('0x1f')]);}_0x2998af[_0xa67d('0x3c')]=qs[_0xa67d('0x3d')](_0x393269[_0xa67d('0x37')][_0xa67d('0x3d')]);_0x2998af[_0xa67d('0x3e')]=qs[_0xa67d('0x39')](_[_0xa67d('0x3f')](_0x393269['query'],_0x20c751['filters']),_0x2703f5);if(_0x393269['query'][_0xa67d('0x40')]){_0x2998af['where']=_[_0xa67d('0x41')](_0x2998af[_0xa67d('0x3e')],{'$or':_[_0xa67d('0x31')](_0x2703f5,function(_0x3777ae){if(_0x3777ae['type']!==_0xa67d('0x42')){var _0x46669f={};_0x46669f[_0x3777ae[_0xa67d('0x2e')]]={'$like':'%'+_0x393269[_0xa67d('0x37')][_0xa67d('0x40')]+'%'};return _0x46669f;}})});}_0x2998af=_[_0xa67d('0x41')]({},_0x2998af,_0x393269[_0xa67d('0x43')]);var _0x5b51dc={'where':_0x2998af['where']};return db[_0xa67d('0x44')][_0xa67d('0x1e')](_0x5b51dc)[_0xa67d('0x25')](function(_0x15b9b8){_0x1fc18f[_0xa67d('0x1e')]=_0x15b9b8;if(_0x393269[_0xa67d('0x37')]['includeAll']){_0x2998af[_0xa67d('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xa67d('0x46')](_0x2998af);})[_0xa67d('0x25')](function(_0x2f698c){_0x1fc18f['rows']=_0x2f698c;return _0x1fc18f;})[_0xa67d('0x25')](respondWithFilteredResult(_0x5e4f04,_0x2998af))[_0xa67d('0x47')](handleError(_0x5e4f04,null));};exports['show']=function(_0x5765a8,_0xcd7852){var _0x5f0af2={'raw':![],'where':{'id':_0x5765a8[_0xa67d('0x48')]['id']}},_0x23f1e1={};_0x23f1e1[_0xa67d('0x36')]=_['keys'](db[_0xa67d('0x44')]['rawAttributes']);_0x23f1e1[_0xa67d('0x37')]=_[_0xa67d('0x38')](_0x5765a8['query']);_0x23f1e1[_0xa67d('0x39')]=_[_0xa67d('0x49')](_0x23f1e1[_0xa67d('0x36')],_0x23f1e1[_0xa67d('0x37')]);_0x5f0af2[_0xa67d('0x3a')]=_[_0xa67d('0x49')](_0x23f1e1[_0xa67d('0x36')],qs[_0xa67d('0x3b')](_0x5765a8['query'][_0xa67d('0x3b')]));_0x5f0af2[_0xa67d('0x3a')]=_0x5f0af2[_0xa67d('0x3a')][_0xa67d('0x4a')]?_0x5f0af2[_0xa67d('0x3a')]:_0x23f1e1['model'];if(_0x5765a8['query'][_0xa67d('0x4b')]){_0x5f0af2[_0xa67d('0x45')]=[{'all':!![]}];}_0x5f0af2=_[_0xa67d('0x41')]({},_0x5f0af2,_0x5765a8[_0xa67d('0x43')]);return db[_0xa67d('0x44')]['find'](_0x5f0af2)[_0xa67d('0x25')](handleEntityNotFound(_0xcd7852,null))['then'](respondWithResult(_0xcd7852,null))[_0xa67d('0x47')](handleError(_0xcd7852,null));};exports[_0xa67d('0x4c')]=function(_0x1c451f,_0x1dba18){return db[_0xa67d('0x44')]['create'](_0x1c451f[_0xa67d('0x4d')],{})[_0xa67d('0x25')](function(_0x348ebd){var _0x5833c2=_0x1c451f[_0xa67d('0x4e')][_0xa67d('0x27')]({'plain':!![]});if(!_0x5833c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5833c2[_0xa67d('0x4f')]===_0xa67d('0x4e')){var _0x51c887=_0x348ebd['get']({'plain':!![]});var _0x21581d=_0xa67d('0x28');return db[_0xa67d('0x50')][_0xa67d('0x51')]({'where':{'name':_0x21581d,'userProfileId':_0x5833c2[_0xa67d('0x52')]},'raw':!![]})[_0xa67d('0x25')](function(_0x355ae2){if(_0x355ae2&&_0x355ae2[_0xa67d('0x53')]===0x0){return db[_0xa67d('0x29')]['create']({'name':_0x51c887[_0xa67d('0x2e')],'resourceId':_0x51c887['id'],'type':_0x355ae2[_0xa67d('0x2e')],'sectionId':_0x355ae2['id']},{})['then'](function(){return _0x348ebd;});}else{return _0x348ebd;}})[_0xa67d('0x47')](function(_0x18f99d){logger['error'](_0xa67d('0x54'),_0x18f99d);throw _0x18f99d;});}return _0x348ebd;})['then'](respondWithResult(_0x1dba18,0xc9))[_0xa67d('0x47')](handleError(_0x1dba18,null));};exports[_0xa67d('0x55')]=function(_0x503413,_0x1de1fb){if(_0x503413[_0xa67d('0x4d')]['id']){delete _0x503413[_0xa67d('0x4d')]['id'];}return db[_0xa67d('0x44')][_0xa67d('0x51')]({'where':{'id':_0x503413[_0xa67d('0x48')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x1de1fb,null))[_0xa67d('0x25')](saveUpdates(_0x503413['body'],null))[_0xa67d('0x25')](respondWithResult(_0x1de1fb,null))[_0xa67d('0x47')](handleError(_0x1de1fb,null));};exports[_0xa67d('0x26')]=function(_0x42fb68,_0x539307){return db[_0xa67d('0x44')][_0xa67d('0x51')]({'where':{'id':_0x42fb68[_0xa67d('0x48')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x539307,null))[_0xa67d('0x25')](removeEntity(_0x539307,null))[_0xa67d('0x47')](handleError(_0x539307,null));};
\ No newline at end of file
+var _0x8ec7=['options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','include','catch','params','length'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x49f8c2,_0x5166b7){_0x49f8c2=_0x49f8c2-0x0;var _0x3e63ec=_0x8ec7[_0x49f8c2];return _0x3e63ec;};'use strict';var emlformat=require(_0x78ec('0x0'));var rimraf=require(_0x78ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78ec('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x78ec('0x3'));var Mustache=require(_0x78ec('0x4'));var util=require('util');var path=require(_0x78ec('0x5'));var sox=require(_0x78ec('0x6'));var csv=require(_0x78ec('0x7'));var ejs=require(_0x78ec('0x8'));var fs=require('fs');var fs_extra=require(_0x78ec('0x9'));var _=require('lodash');var squel=require(_0x78ec('0xa'));var crypto=require('crypto');var jsforce=require(_0x78ec('0xb'));var deskjs=require(_0x78ec('0xc'));var toCsv=require(_0x78ec('0x7'));var querystring=require('querystring');var Papa=require(_0x78ec('0xd'));var Redis=require(_0x78ec('0xe'));var authService=require(_0x78ec('0xf'));var qs=require(_0x78ec('0x10'));var as=require(_0x78ec('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78ec('0x12'));var utils=require(_0x78ec('0x13'));var config=require(_0x78ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x78ec('0x15'))['db'];function respondWithStatusCode(_0x171d6d,_0x2cf703){_0x2cf703=_0x2cf703||0xcc;return function(_0x7313ab){if(_0x7313ab){return _0x171d6d[_0x78ec('0x16')](_0x2cf703);}return _0x171d6d[_0x78ec('0x17')](_0x2cf703)[_0x78ec('0x18')]();};}function respondWithResult(_0x380afc,_0x34a35c){_0x34a35c=_0x34a35c||0xc8;return function(_0x36b7ca){if(_0x36b7ca){return _0x380afc[_0x78ec('0x17')](_0x34a35c)['json'](_0x36b7ca);}};}function respondWithFilteredResult(_0x1997ca,_0x275f7e){return function(_0x3c179b){if(_0x3c179b){var _0x3855a4=typeof _0x275f7e[_0x78ec('0x19')]==='undefined'&&typeof _0x275f7e['limit']==='undefined';var _0x548373=_0x3c179b[_0x78ec('0x1a')];var _0x3c46c1=_0x3855a4?0x0:_0x275f7e[_0x78ec('0x19')];var _0xd1ffc6=_0x3855a4?_0x3c179b[_0x78ec('0x1a')]:_0x275f7e[_0x78ec('0x19')]+_0x275f7e[_0x78ec('0x1b')];var _0x396a6d;if(_0xd1ffc6>=_0x548373){_0xd1ffc6=_0x548373;_0x396a6d=0xc8;}else{_0x396a6d=0xce;}_0x1997ca[_0x78ec('0x17')](_0x396a6d);return _0x1997ca['set'](_0x78ec('0x1c'),_0x3c46c1+'-'+_0xd1ffc6+'/'+_0x548373)[_0x78ec('0x1d')](_0x3c179b);}return null;};}function patchUpdates(_0xa25947){return function(_0x5b39ae){try{jsonpatch[_0x78ec('0x1e')](_0x5b39ae,_0xa25947,!![]);}catch(_0x49a31a){return BPromise[_0x78ec('0x1f')](_0x49a31a);}return _0x5b39ae[_0x78ec('0x20')]();};}function saveUpdates(_0x491f04,_0x1f86ff){return function(_0x5e9084){if(_0x5e9084){return _0x5e9084[_0x78ec('0x21')](_0x491f04)[_0x78ec('0x22')](function(_0x2f20f7){return _0x2f20f7;});}return null;};}function removeEntity(_0x381957,_0x16b6a2){return function(_0x5c2180){if(_0x5c2180){return _0x5c2180[_0x78ec('0x23')]()[_0x78ec('0x22')](function(){var _0x1e1086=_0x5c2180[_0x78ec('0x24')]({'plain':!![]});var _0x3a4676=_0x78ec('0x25');return db[_0x78ec('0x26')][_0x78ec('0x23')]({'where':{'type':_0x3a4676,'resourceId':_0x1e1086['id']}})['then'](function(){return _0x5c2180;});})['then'](function(){_0x381957[_0x78ec('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcfd6a3,_0x1f30c2){return function(_0x5d46ec){if(!_0x5d46ec){_0xcfd6a3[_0x78ec('0x16')](0x194);}return _0x5d46ec;};}function handleError(_0x44c596,_0x1b211f){_0x1b211f=_0x1b211f||0x1f4;return function(_0x5b9e35){logger['error'](_0x5b9e35[_0x78ec('0x27')]);if(_0x5b9e35['name']){delete _0x5b9e35[_0x78ec('0x28')];}_0x44c596[_0x78ec('0x17')](_0x1b211f)[_0x78ec('0x29')](_0x5b9e35);};}exports[_0x78ec('0x2a')]=function(_0x16de6d,_0x13b1f3){var _0x3bff87={},_0x36104f={},_0x225a6d={'count':0x0,'rows':[]};var _0x2b2cf5=_['map'](db[_0x78ec('0x2b')][_0x78ec('0x2c')],function(_0x287752){return{'name':_0x287752[_0x78ec('0x2d')],'type':_0x287752[_0x78ec('0x2e')][_0x78ec('0x2f')]};});_0x36104f[_0x78ec('0x30')]=_['map'](_0x2b2cf5,_0x78ec('0x28'));_0x36104f['query']=_[_0x78ec('0x31')](_0x16de6d[_0x78ec('0x32')]);_0x36104f['filters']=_[_0x78ec('0x33')](_0x36104f[_0x78ec('0x30')],_0x36104f[_0x78ec('0x32')]);_0x3bff87['attributes']=_[_0x78ec('0x33')](_0x36104f[_0x78ec('0x30')],qs[_0x78ec('0x34')](_0x16de6d[_0x78ec('0x32')][_0x78ec('0x34')]));_0x3bff87[_0x78ec('0x35')]=_0x3bff87[_0x78ec('0x35')]['length']?_0x3bff87['attributes']:_0x36104f[_0x78ec('0x30')];if(!_0x16de6d['query'][_0x78ec('0x36')](_0x78ec('0x37'))){_0x3bff87['limit']=qs[_0x78ec('0x1b')](_0x16de6d['query']['limit']);_0x3bff87[_0x78ec('0x19')]=qs[_0x78ec('0x19')](_0x16de6d[_0x78ec('0x32')]['offset']);}_0x3bff87[_0x78ec('0x38')]=qs['sort'](_0x16de6d['query'][_0x78ec('0x39')]);_0x3bff87[_0x78ec('0x3a')]=qs[_0x78ec('0x3b')](_[_0x78ec('0x3c')](_0x16de6d[_0x78ec('0x32')],_0x36104f[_0x78ec('0x3b')]),_0x2b2cf5);if(_0x16de6d[_0x78ec('0x32')][_0x78ec('0x3d')]){_0x3bff87[_0x78ec('0x3a')]=_[_0x78ec('0x3e')](_0x3bff87[_0x78ec('0x3a')],{'$or':_[_0x78ec('0x3f')](_0x2b2cf5,function(_0xf1e275){if(_0xf1e275['type']!==_0x78ec('0x40')){var _0xd84302={};_0xd84302[_0xf1e275[_0x78ec('0x28')]]={'$like':'%'+_0x16de6d[_0x78ec('0x32')][_0x78ec('0x3d')]+'%'};return _0xd84302;}})});}_0x3bff87=_[_0x78ec('0x3e')]({},_0x3bff87,_0x16de6d['options']);var _0x2c8794={'where':_0x3bff87[_0x78ec('0x3a')]};return db[_0x78ec('0x2b')][_0x78ec('0x1a')](_0x2c8794)[_0x78ec('0x22')](function(_0x168c90){_0x225a6d['count']=_0x168c90;if(_0x16de6d[_0x78ec('0x32')][_0x78ec('0x41')]){_0x3bff87[_0x78ec('0x42')]=[{'all':!![]}];}return db[_0x78ec('0x2b')]['findAll'](_0x3bff87);})['then'](function(_0x2e87ae){_0x225a6d['rows']=_0x2e87ae;return _0x225a6d;})[_0x78ec('0x22')](respondWithFilteredResult(_0x13b1f3,_0x3bff87))[_0x78ec('0x43')](handleError(_0x13b1f3,null));};exports['show']=function(_0x3ba5f9,_0x3a979a){var _0xc2d56f={'raw':![],'where':{'id':_0x3ba5f9[_0x78ec('0x44')]['id']}},_0x3609d4={};_0x3609d4[_0x78ec('0x30')]=_[_0x78ec('0x31')](db['VoiceChanSpy'][_0x78ec('0x2c')]);_0x3609d4[_0x78ec('0x32')]=_[_0x78ec('0x31')](_0x3ba5f9[_0x78ec('0x32')]);_0x3609d4[_0x78ec('0x3b')]=_[_0x78ec('0x33')](_0x3609d4[_0x78ec('0x30')],_0x3609d4[_0x78ec('0x32')]);_0xc2d56f['attributes']=_[_0x78ec('0x33')](_0x3609d4[_0x78ec('0x30')],qs['fields'](_0x3ba5f9['query']['fields']));_0xc2d56f['attributes']=_0xc2d56f[_0x78ec('0x35')][_0x78ec('0x45')]?_0xc2d56f[_0x78ec('0x35')]:_0x3609d4[_0x78ec('0x30')];if(_0x3ba5f9[_0x78ec('0x32')]['includeAll']){_0xc2d56f[_0x78ec('0x42')]=[{'all':!![]}];}_0xc2d56f=_[_0x78ec('0x3e')]({},_0xc2d56f,_0x3ba5f9[_0x78ec('0x46')]);return db[_0x78ec('0x2b')][_0x78ec('0x47')](_0xc2d56f)[_0x78ec('0x22')](handleEntityNotFound(_0x3a979a,null))[_0x78ec('0x22')](respondWithResult(_0x3a979a,null))[_0x78ec('0x43')](handleError(_0x3a979a,null));};exports[_0x78ec('0x48')]=function(_0x2800e6,_0x3d0abf){return db[_0x78ec('0x2b')][_0x78ec('0x48')](_0x2800e6[_0x78ec('0x49')],{})[_0x78ec('0x22')](function(_0x3e2ee0){var _0x28f279=_0x2800e6[_0x78ec('0x4a')][_0x78ec('0x24')]({'plain':!![]});if(!_0x28f279)throw new Error(_0x78ec('0x4b'));if(_0x28f279[_0x78ec('0x4c')]===_0x78ec('0x4a')){var _0x17c5ab=_0x3e2ee0[_0x78ec('0x24')]({'plain':!![]});var _0x3ddf38='ChanSpies';return db[_0x78ec('0x4d')]['find']({'where':{'name':_0x3ddf38,'userProfileId':_0x28f279[_0x78ec('0x4e')]},'raw':!![]})[_0x78ec('0x22')](function(_0x4aae9b){if(_0x4aae9b&&_0x4aae9b[_0x78ec('0x4f')]===0x0){return db['UserProfileResource'][_0x78ec('0x48')]({'name':_0x17c5ab[_0x78ec('0x28')],'resourceId':_0x17c5ab['id'],'type':_0x4aae9b[_0x78ec('0x28')],'sectionId':_0x4aae9b['id']},{})[_0x78ec('0x22')](function(){return _0x3e2ee0;});}else{return _0x3e2ee0;}})[_0x78ec('0x43')](function(_0x52684e){logger[_0x78ec('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52684e);throw _0x52684e;});}return _0x3e2ee0;})['then'](respondWithResult(_0x3d0abf,0xc9))[_0x78ec('0x43')](handleError(_0x3d0abf,null));};exports[_0x78ec('0x21')]=function(_0x26cc6a,_0x5c32f5){if(_0x26cc6a[_0x78ec('0x49')]['id']){delete _0x26cc6a[_0x78ec('0x49')]['id'];}return db[_0x78ec('0x2b')][_0x78ec('0x47')]({'where':{'id':_0x26cc6a[_0x78ec('0x44')]['id']}})[_0x78ec('0x22')](handleEntityNotFound(_0x5c32f5,null))[_0x78ec('0x22')](saveUpdates(_0x26cc6a['body'],null))['then'](respondWithResult(_0x5c32f5,null))[_0x78ec('0x43')](handleError(_0x5c32f5,null));};exports[_0x78ec('0x23')]=function(_0x4de0ba,_0x31740a){return db[_0x78ec('0x2b')][_0x78ec('0x47')]({'where':{'id':_0x4de0ba[_0x78ec('0x44')]['id']}})[_0x78ec('0x22')](handleEntityNotFound(_0x31740a,null))[_0x78ec('0x22')](removeEntity(_0x31740a,null))['catch'](handleError(_0x31740a,null));};
\ No newline at end of file
index 46227a2..881cc8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c28=['VoiceChanSpy','voice_chanspy','VoiceExtension','lodash','bluebird','context','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define'];(function(_0x26a3f2,_0x4ebeee){var _0xd84a76=function(_0x477261){while(--_0x477261){_0x26a3f2['push'](_0x26a3f2['shift']());}};_0xd84a76(++_0x4ebeee);}(_0x2c28,0x1ca));var _0x82c2=function(_0x4544ac,_0x17f4e6){_0x4544ac=_0x4544ac-0x0;var _0x1be1f4=_0x2c28[_0x4544ac];return _0x1be1f4;};'use strict';var _=require(_0x82c2('0x0'));var util=require('util');var BPromise=require(_0x82c2('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x16207a,_0x27a845,_0x4e950d){var _0x280784=0x1;var _0x55a2c1=[];var _0x3939b2={'context':_0x27a845[_0x82c2('0x2')]||'from-sip','exten':util[_0x82c2('0x3')]('%s%s',_0x16207a[_0x82c2('0x4')],_0x4e950d),'type':_0x82c2('0x5'),'isApp':![],'ChanSpyId':_0x16207a['id'],'UserId':_0x27a845['id']};_0x55a2c1['push'](_[_0x82c2('0x6')]({'app':_0x82c2('0x7'),'appdata':util[_0x82c2('0x3')](_0x82c2('0x8'),_0x82c2('0x9')),'priority':_0x280784++},_0x3939b2));if(_0x16207a[_0x82c2('0xa')]){_0x55a2c1[_0x82c2('0xb')](_['merge']({'app':_0x82c2('0xc'),'appdata':util[_0x82c2('0x3')](_0x82c2('0xd'),_0x16207a[_0x82c2('0xe')]),'priority':_0x280784++},_0x3939b2));}if(_0x16207a[_0x82c2('0xf')]){_0x55a2c1[_0x82c2('0xb')](_[_0x82c2('0x6')]({'app':_0x82c2('0x10'),'appdata':_0x16207a['password'],'priority':_0x280784++},_0x3939b2));}_0x55a2c1[_0x82c2('0xb')](_[_0x82c2('0x6')]({'app':'ChanSpy','appdata':util[_0x82c2('0x3')](_0x82c2('0x11'),_0x27a845[_0x82c2('0x12')],_0x16207a[_0x82c2('0x13')]?_0x16207a[_0x82c2('0x13')]['join'](''):''),'priority':_0x280784++},_0x3939b2));if(_0x16207a[_0x82c2('0xa')]){_0x55a2c1['push'](_[_0x82c2('0x6')]({'app':_0x82c2('0x14'),'priority':_0x280784++},_0x3939b2));}return _0x55a2c1;};var getChanSpyApplications=function(_0x286b37,_0x43ec2b){var _0x1697a5=[];for(var _0x3f0390=0x0,_0xf9e021=0x1;_0x3f0390<_0x43ec2b[_0x82c2('0x15')];_0x3f0390++,_0xf9e021=0x1){_0x1697a5=_0x1697a5[_0x82c2('0x16')](getUserApplications(_0x286b37,_0x43ec2b[_0x3f0390],_0x43ec2b[_0x3f0390][_0x82c2('0x17')]));if(_0x43ec2b[_0x3f0390][_0x82c2('0x17')]!=_0x43ec2b[_0x3f0390][_0x82c2('0x12')]){_0x1697a5=_0x1697a5[_0x82c2('0x16')](getUserApplications(_0x286b37,_0x43ec2b[_0x3f0390],_0x43ec2b[_0x3f0390]['name']));}}return _0x1697a5;};var getChanSpyPromise=function(_0x40e5b8,_0x53ba06){return new BPromise(function(_0x2dff1f,_0x39fd34){return _0x40e5b8[_0x82c2('0x18')][_0x82c2('0x19')]({'attributes':['id','name',_0x82c2('0x17')],'where':{'role':_0x82c2('0x1a'),'chanspy':!![]},'raw':!![]})[_0x82c2('0x1b')](function(_0x423ddb){if(_0x423ddb){return _0x2dff1f(getChanSpyApplications(_0x53ba06,_0x423ddb));}return _0x2dff1f([]);})[_0x82c2('0x1c')](function(_0x1d9117){_0x39fd34(_0x1d9117);});});};module[_0x82c2('0x1d')]=function(_0x5933c2,_0x32d3b3){var _0x517ce4=_0x5933c2[_0x82c2('0x1e')];return _0x5933c2[_0x82c2('0x1f')](_0x82c2('0x20'),attributes,{'tableName':_0x82c2('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e1909,_0x394742,_0x125e40){return getChanSpyPromise(_0x517ce4,_0x2e1909)[_0x82c2('0x1b')](function(_0x38a920){if(_0x38a920&&_0x38a920[_0x82c2('0x15')]){return _0x517ce4['VoiceExtension']['bulkCreate'](_0x38a920);}})[_0x82c2('0x1b')](function(){_0x125e40();})[_0x82c2('0x1c')](function(_0x2e6c49){_0x125e40(_0x2e6c49);});},'afterUpdate':function(_0x8dbe4,_0x404f6a,_0x556e0c){return _0x517ce4[_0x82c2('0x22')]['destroy']({'where':{'ChanSpyId':_0x8dbe4['id']}})[_0x82c2('0x1b')](function(){return getChanSpyPromise(_0x517ce4,_0x8dbe4);})['then'](function(_0x12dffa){if(_0x12dffa&&_0x12dffa[_0x82c2('0x15')]){return _0x517ce4['VoiceExtension']['bulkCreate'](_0x12dffa);}})[_0x82c2('0x1b')](function(){_0x556e0c();})['catch'](function(_0x3fd307){_0x556e0c(_0x3fd307);});},'afterDestroy':function(_0x3bf2ad,_0x38365b,_0x408457){return _0x517ce4[_0x82c2('0x22')]['destroy']({'where':{'ChanSpyId':_0x3bf2ad['id']}})[_0x82c2('0x1b')](function(){_0x408457();})['catch'](function(_0x432a8c){_0x408457(_0x432a8c);});}}});};
\ No newline at end of file
+var _0x33a7=['findAll','agent','then','exports','models','define','VoiceChanSpy','catch','destroy','length','VoiceExtension','lodash','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','merge','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User'];(function(_0x45dae1,_0x2c0777){var _0x3112df=function(_0x37ed8c){while(--_0x37ed8c){_0x45dae1['push'](_0x45dae1['shift']());}};_0x3112df(++_0x2c0777);}(_0x33a7,0x74));var _0x733a=function(_0xefdc1c,_0x10f40b){_0xefdc1c=_0xefdc1c-0x0;var _0x48581c=_0x33a7[_0xefdc1c];return _0x48581c;};'use strict';var _=require(_0x733a('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x733a('0x1'));var getUserApplications=function(_0x5813a9,_0xc067c8,_0x40c96d){var _0x577432=0x1;var _0x1d83fb=[];var _0x3d8ee8={'context':_0xc067c8[_0x733a('0x2')]||'from-sip','exten':util[_0x733a('0x3')](_0x733a('0x4'),_0x5813a9[_0x733a('0x5')],_0x40c96d),'type':_0x733a('0x6'),'isApp':![],'ChanSpyId':_0x5813a9['id'],'UserId':_0xc067c8['id']};_0x1d83fb['push'](_[_0x733a('0x7')]({'app':'Set','appdata':util[_0x733a('0x3')]('CDR(type)=%s',_0x733a('0x8')),'priority':_0x577432++},_0x3d8ee8));if(_0x5813a9[_0x733a('0x9')]){_0x1d83fb[_0x733a('0xa')](_[_0x733a('0x7')]({'app':_0x733a('0xb'),'appdata':util[_0x733a('0x3')](_0x733a('0xc'),_0x5813a9[_0x733a('0xd')]),'priority':_0x577432++},_0x3d8ee8));}if(_0x5813a9['auth']){_0x1d83fb[_0x733a('0xa')](_[_0x733a('0x7')]({'app':_0x733a('0xe'),'appdata':_0x5813a9[_0x733a('0xf')],'priority':_0x577432++},_0x3d8ee8));}_0x1d83fb['push'](_[_0x733a('0x7')]({'app':'ChanSpy','appdata':util[_0x733a('0x3')](_0x733a('0x10'),_0xc067c8['name'],_0x5813a9[_0x733a('0x11')]?_0x5813a9[_0x733a('0x11')][_0x733a('0x12')](''):''),'priority':_0x577432++},_0x3d8ee8));if(_0x5813a9[_0x733a('0x9')]){_0x1d83fb[_0x733a('0xa')](_['merge']({'app':_0x733a('0x13'),'priority':_0x577432++},_0x3d8ee8));}return _0x1d83fb;};var getChanSpyApplications=function(_0xbfc807,_0x7daefa){var _0x21a72a=[];for(var _0x16a5a5=0x0,_0x5bc2a5=0x1;_0x16a5a5<_0x7daefa['length'];_0x16a5a5++,_0x5bc2a5=0x1){_0x21a72a=_0x21a72a[_0x733a('0x14')](getUserApplications(_0xbfc807,_0x7daefa[_0x16a5a5],_0x7daefa[_0x16a5a5]['internal']));if(_0x7daefa[_0x16a5a5][_0x733a('0x15')]!=_0x7daefa[_0x16a5a5][_0x733a('0x16')]){_0x21a72a=_0x21a72a['concat'](getUserApplications(_0xbfc807,_0x7daefa[_0x16a5a5],_0x7daefa[_0x16a5a5][_0x733a('0x16')]));}}return _0x21a72a;};var getChanSpyPromise=function(_0x1b5973,_0xe5e38c){return new BPromise(function(_0x173265,_0x38a6f2){return _0x1b5973[_0x733a('0x17')][_0x733a('0x18')]({'attributes':['id',_0x733a('0x16'),_0x733a('0x15')],'where':{'role':_0x733a('0x19'),'chanspy':!![]},'raw':!![]})[_0x733a('0x1a')](function(_0x164dd7){if(_0x164dd7){return _0x173265(getChanSpyApplications(_0xe5e38c,_0x164dd7));}return _0x173265([]);})['catch'](function(_0x1bd95d){_0x38a6f2(_0x1bd95d);});});};module[_0x733a('0x1b')]=function(_0x4533f3,_0x45cd72){var _0x5c1e13=_0x4533f3[_0x733a('0x1c')];return _0x4533f3[_0x733a('0x1d')](_0x733a('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1db844,_0x3c0ae1,_0x275a6a){return getChanSpyPromise(_0x5c1e13,_0x1db844)[_0x733a('0x1a')](function(_0x261bd3){if(_0x261bd3&&_0x261bd3['length']){return _0x5c1e13['VoiceExtension']['bulkCreate'](_0x261bd3);}})[_0x733a('0x1a')](function(){_0x275a6a();})[_0x733a('0x1f')](function(_0x240f9d){_0x275a6a(_0x240f9d);});},'afterUpdate':function(_0x58fc2d,_0x165d01,_0x185de1){return _0x5c1e13['VoiceExtension'][_0x733a('0x20')]({'where':{'ChanSpyId':_0x58fc2d['id']}})[_0x733a('0x1a')](function(){return getChanSpyPromise(_0x5c1e13,_0x58fc2d);})[_0x733a('0x1a')](function(_0x4f4d6f){if(_0x4f4d6f&&_0x4f4d6f[_0x733a('0x21')]){return _0x5c1e13[_0x733a('0x22')]['bulkCreate'](_0x4f4d6f);}})[_0x733a('0x1a')](function(){_0x185de1();})[_0x733a('0x1f')](function(_0x5ccd65){_0x185de1(_0x5ccd65);});},'afterDestroy':function(_0x97fc9c,_0x586502,_0x457103){return _0x5c1e13['VoiceExtension'][_0x733a('0x20')]({'where':{'ChanSpyId':_0x97fc9c['id']}})[_0x733a('0x1a')](function(){_0x457103();})[_0x733a('0x1f')](function(_0x524cbc){_0x457103(_0x524cbc);});}}});};
\ No newline at end of file
index d018118..d3f1485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b73=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b73,0x1d5));var _0x31b7=function(_0x2f944a,_0x59d3ed){_0x2f944a=_0x2f944a-0x0;var _0x2d28ce=_0x1b73[_0x2f944a];return _0x2d28ce;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});}
\ No newline at end of file
+var _0x3e5c=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x581ae0,_0x591346){var _0xc8fe4d=function(_0x5c4c9c){while(--_0x5c4c9c){_0x581ae0['push'](_0x581ae0['shift']());}};_0xc8fe4d(++_0x591346);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x33b0fa,_0x3625a2){_0x33b0fa=_0x33b0fa-0x0;var _0x3bd631=_0x3e5c[_0x33b0fa];return _0x3bd631;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var moment=require(_0xc3e5('0x2'));var BPromise=require(_0xc3e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3e5('0x4'));var db=require(_0xc3e5('0x5'))['db'];var utils=require(_0xc3e5('0x6'));var logger=require(_0xc3e5('0x7'))(_0xc3e5('0x8'));var config=require(_0xc3e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3e5('0xa')][_0xc3e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6089,_0xcbbec0,_0x2d580e){return new BPromise(function(_0x4864a2,_0x196f3a){return client[_0xc3e5('0xc')](_0x2d6089,_0x2d580e)[_0xc3e5('0xd')](function(_0x19813b){logger[_0xc3e5('0xe')](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));logger['debug'](_0xc3e5('0x11'),_0xcbbec0,_0xc3e5('0x10'),JSON[_0xc3e5('0x12')](_0x19813b));if(_0x19813b[_0xc3e5('0x13')]){if(_0x19813b['error'][_0xc3e5('0x14')]===0x1f4){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);return _0x196f3a(_0x19813b[_0xc3e5('0x13')]['message']);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0xcbbec0,_0x19813b[_0xc3e5('0x13')]['message']);return _0x4864a2(_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);}else{logger['info'](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));_0x4864a2(_0x19813b[_0xc3e5('0x16')][_0xc3e5('0x15')]);}})[_0xc3e5('0x17')](function(_0x47cfd8){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x47cfd8);_0x196f3a(_0x47cfd8);});});}
\ No newline at end of file
index fdb7b72..9b0172c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe278=['util','connect-timeout','express','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0xe278,0x95));var _0x8e27=function(_0x39140a,_0x389944){_0x39140a=_0x39140a-0x0;var _0x3e0287=_0xe278[_0x39140a];return _0x3e0287;};'use strict';var multer=require(_0x8e27('0x0'));var util=require(_0x8e27('0x1'));var path=require('path');var timeout=require(_0x8e27('0x2'));var express=require(_0x8e27('0x3'));var router=express['Router']();var fs_extra=require(_0x8e27('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e27('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x8e27('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8e27('0x6')](_0x8e27('0x7'),auth[_0x8e27('0x8')](),controller['show']);router[_0x8e27('0x9')]('/',auth[_0x8e27('0x8')](),controller[_0x8e27('0xa')]);router['put'](_0x8e27('0x7'),auth['isAuthenticated'](),controller[_0x8e27('0xb')]);router[_0x8e27('0xc')]('/:id',auth[_0x8e27('0x8')](),controller[_0x8e27('0xd')]);module[_0x8e27('0xe')]=router;
\ No newline at end of file
+var _0x6759=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x1dbfd4,_0x303d58){var _0x150021=function(_0x43ac17){while(--_0x43ac17){_0x1dbfd4['push'](_0x1dbfd4['shift']());}};_0x150021(++_0x303d58);}(_0x6759,0x6d));var _0x9675=function(_0x386408,_0x584c61){_0x386408=_0x386408-0x0;var _0xedb599=_0x6759[_0x386408];return _0xedb599;};'use strict';var multer=require(_0x9675('0x0'));var util=require(_0x9675('0x1'));var path=require(_0x9675('0x2'));var timeout=require(_0x9675('0x3'));var express=require(_0x9675('0x4'));var router=express[_0x9675('0x5')]();var fs_extra=require(_0x9675('0x6'));var auth=require(_0x9675('0x7'));var interaction=require(_0x9675('0x8'));var config=require(_0x9675('0x9'));var controller=require(_0x9675('0xa'));router[_0x9675('0xb')]('/',auth[_0x9675('0xc')](),controller[_0x9675('0xd')]);router[_0x9675('0xb')](_0x9675('0xe'),auth[_0x9675('0xc')](),controller[_0x9675('0xf')]);router['post']('/',auth[_0x9675('0xc')](),controller[_0x9675('0x10')]);router[_0x9675('0x11')](_0x9675('0xe'),auth[_0x9675('0xc')](),controller[_0x9675('0x12')]);router[_0x9675('0x13')](_0x9675('0xe'),auth[_0x9675('0xc')](),controller['destroy']);module[_0x9675('0x14')]=router;
\ No newline at end of file
index 71239ab..778edfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8367=['STRING','BOOLEAN','sequelize','exports'];(function(_0x179313,_0x54c18e){var _0x59429e=function(_0xf1db1e){while(--_0xf1db1e){_0x179313['push'](_0x179313['shift']());}};_0x59429e(++_0x54c18e);}(_0x8367,0xa2));var _0x7836=function(_0x1caf3f,_0x1b4800){_0x1caf3f=_0x1caf3f-0x0;var _0x1905f0=_0x8367[_0x1caf3f];return _0x1905f0;};'use strict';var Sequelize=require(_0x7836('0x0'));module[_0x7836('0x1')]={'name':{'type':Sequelize[_0x7836('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x7836('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7836('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf7d7=['name','sequelize','exports','STRING'];(function(_0x56ea29,_0x1f50b0){var _0x441aaa=function(_0x264399){while(--_0x264399){_0x56ea29['push'](_0x56ea29['shift']());}};_0x441aaa(++_0x1f50b0);}(_0xf7d7,0x69));var _0x7f7d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf7d7[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x7f7d('0x0'));module[_0x7f7d('0x1')]={'name':{'type':Sequelize[_0x7f7d('0x2')],'unique':_0x7f7d('0x3')},'description':{'type':Sequelize[_0x7f7d('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index b834fe6..bba2959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52aa=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','client','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','VoiceContext','rawAttributes','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','rows','catch','show','intersection','includeAll','create','body','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','server/files/templates/context.ejs','render','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x52aa,0x187));var _0xa52a=function(_0xbaec71,_0x266e77){_0xbaec71=_0xbaec71-0x0;var _0x51a7f9=_0x52aa[_0xbaec71];return _0x51a7f9;};'use strict';var emlformat=require(_0xa52a('0x0'));var rimraf=require(_0xa52a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa52a('0x2'));var rp=require(_0xa52a('0x3'));var moment=require(_0xa52a('0x4'));var BPromise=require(_0xa52a('0x5'));var Mustache=require('mustache');var util=require(_0xa52a('0x6'));var path=require(_0xa52a('0x7'));var sox=require(_0xa52a('0x8'));var csv=require(_0xa52a('0x9'));var ejs=require(_0xa52a('0xa'));var fs=require('fs');var fs_extra=require(_0xa52a('0xb'));var _=require(_0xa52a('0xc'));var squel=require('squel');var crypto=require(_0xa52a('0xd'));var jsforce=require(_0xa52a('0xe'));var deskjs=require(_0xa52a('0xf'));var toCsv=require(_0xa52a('0x9'));var querystring=require(_0xa52a('0x10'));var Papa=require('papaparse');var Redis=require(_0xa52a('0x11'));var authService=require(_0xa52a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa52a('0x13'));var hardwareService=require(_0xa52a('0x14'));var logger=require('../../config/logger')(_0xa52a('0x15'));var utils=require(_0xa52a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa52a('0x17')][_0xa52a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x32199f,_0x425658,_0x4127e4,_0xc53403){return new BPromise(function(_0x55bbdf,_0x22fd9c){var _0x1f3cfe=_0xc53403||client;return _0x1f3cfe[_0xa52a('0x19')](_0x32199f,_0x4127e4)['then'](function(_0x49e105){logger['info'](_0xa52a('0x1a'),_0x425658,_0xa52a('0x1b'));logger[_0xa52a('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x425658,_0xa52a('0x1b'),JSON[_0xa52a('0x1d')](_0x49e105));if(_0x49e105[_0xa52a('0x1e')]){if(_0x49e105[_0xa52a('0x1e')][_0xa52a('0x1f')]===0x1f4){logger[_0xa52a('0x1e')](_0xa52a('0x1a'),_0x425658,_0x49e105[_0xa52a('0x1e')]['message']);return _0x22fd9c(_0x49e105['error'][_0xa52a('0x20')]);}logger['error'](_0xa52a('0x1a'),_0x425658,_0x49e105[_0xa52a('0x1e')]['message']);return _0x55bbdf(_0x49e105['error'][_0xa52a('0x20')]);}else{logger[_0xa52a('0x21')](_0xa52a('0x1a'),_0x425658,_0xa52a('0x1b'));_0x55bbdf(_0x49e105[_0xa52a('0x22')]['message']);}})['catch'](function(_0x33c9fc){logger[_0xa52a('0x1e')](_0xa52a('0x1a'),_0x425658,_0x33c9fc);_0x22fd9c(_0x33c9fc);});});}function respondWithStatusCode(_0xbcc071,_0x39731d){_0x39731d=_0x39731d||0xcc;return function(_0x359d9c){if(_0x359d9c){return _0xbcc071[_0xa52a('0x23')](_0x39731d);}return _0xbcc071[_0xa52a('0x24')](_0x39731d)['end']();};}function respondWithResult(_0x525f1d,_0x4b194e){_0x4b194e=_0x4b194e||0xc8;return function(_0x463dc2){if(_0x463dc2){return _0x525f1d[_0xa52a('0x24')](_0x4b194e)[_0xa52a('0x25')](_0x463dc2);}};}function respondWithFilteredResult(_0x35ea5e,_0xb2168a){return function(_0x2d0059){if(_0x2d0059){var _0x2e04d0=typeof _0xb2168a[_0xa52a('0x26')]===_0xa52a('0x27')&&typeof _0xb2168a[_0xa52a('0x28')]===_0xa52a('0x27');var _0x2de356=_0x2d0059[_0xa52a('0x29')];var _0x40ed48=_0x2e04d0?0x0:_0xb2168a[_0xa52a('0x26')];var _0xee3fc8=_0x2e04d0?_0x2d0059[_0xa52a('0x29')]:_0xb2168a['offset']+_0xb2168a[_0xa52a('0x28')];var _0x5ba4ae;if(_0xee3fc8>=_0x2de356){_0xee3fc8=_0x2de356;_0x5ba4ae=0xc8;}else{_0x5ba4ae=0xce;}_0x35ea5e[_0xa52a('0x24')](_0x5ba4ae);return _0x35ea5e[_0xa52a('0x2a')](_0xa52a('0x2b'),_0x40ed48+'-'+_0xee3fc8+'/'+_0x2de356)[_0xa52a('0x25')](_0x2d0059);}return null;};}function patchUpdates(_0x3ce658){return function(_0x38a2ea){try{jsonpatch[_0xa52a('0x2c')](_0x38a2ea,_0x3ce658,!![]);}catch(_0x1dbd06){return BPromise['reject'](_0x1dbd06);}return _0x38a2ea['save']();};}function saveUpdates(_0xfa571b,_0x4b7ac0){return function(_0x303394){if(_0x303394){return _0x303394[_0xa52a('0x2d')](_0xfa571b)[_0xa52a('0x2e')](function(_0xe0114f){return _0xe0114f;});}return null;};}function removeEntity(_0x20423f,_0x5cb9a6){return function(_0xc0008e){if(_0xc0008e){return _0xc0008e[_0xa52a('0x2f')]()[_0xa52a('0x2e')](function(){var _0x5f9ff1=_0xc0008e[_0xa52a('0x30')]({'plain':!![]});var _0x43f854='Contexts';return db[_0xa52a('0x31')][_0xa52a('0x2f')]({'where':{'type':_0x43f854,'resourceId':_0x5f9ff1['id']}})['then'](function(){return _0xc0008e;});})[_0xa52a('0x2e')](function(){_0x20423f['status'](0xcc)[_0xa52a('0x32')]();});}};}function handleEntityNotFound(_0x5f27f7,_0x30e1b9){return function(_0x1d3bf7){if(!_0x1d3bf7){_0x5f27f7[_0xa52a('0x23')](0x194);}return _0x1d3bf7;};}function handleError(_0x556edd,_0x41741b){_0x41741b=_0x41741b||0x1f4;return function(_0x1cda8e){logger[_0xa52a('0x1e')](_0x1cda8e[_0xa52a('0x33')]);if(_0x1cda8e[_0xa52a('0x34')]){delete _0x1cda8e[_0xa52a('0x34')];}_0x556edd[_0xa52a('0x24')](_0x41741b)[_0xa52a('0x35')](_0x1cda8e);};}exports[_0xa52a('0x36')]=function(_0x47a7e4,_0xd767b0){var _0x183502={},_0x4064d3={},_0x520428={'count':0x0,'rows':[]};var _0x2f68ab=_[_0xa52a('0x37')](db[_0xa52a('0x38')][_0xa52a('0x39')],function(_0x1690e7){return{'name':_0x1690e7['fieldName'],'type':_0x1690e7['type'][_0xa52a('0x3a')]};});_0x4064d3['model']=_['map'](_0x2f68ab,_0xa52a('0x34'));_0x4064d3['query']=_[_0xa52a('0x3b')](_0x47a7e4[_0xa52a('0x3c')]);_0x4064d3[_0xa52a('0x3d')]=_['intersection'](_0x4064d3[_0xa52a('0x3e')],_0x4064d3[_0xa52a('0x3c')]);_0x183502[_0xa52a('0x3f')]=_['intersection'](_0x4064d3[_0xa52a('0x3e')],qs[_0xa52a('0x40')](_0x47a7e4[_0xa52a('0x3c')][_0xa52a('0x40')]));_0x183502['attributes']=_0x183502['attributes'][_0xa52a('0x41')]?_0x183502[_0xa52a('0x3f')]:_0x4064d3['model'];if(!_0x47a7e4[_0xa52a('0x3c')][_0xa52a('0x42')](_0xa52a('0x43'))){_0x183502[_0xa52a('0x28')]=qs[_0xa52a('0x28')](_0x47a7e4[_0xa52a('0x3c')][_0xa52a('0x28')]);_0x183502[_0xa52a('0x26')]=qs['offset'](_0x47a7e4[_0xa52a('0x3c')]['offset']);}_0x183502[_0xa52a('0x44')]=qs[_0xa52a('0x45')](_0x47a7e4[_0xa52a('0x3c')][_0xa52a('0x45')]);_0x183502['where']=qs['filters'](_['pick'](_0x47a7e4[_0xa52a('0x3c')],_0x4064d3[_0xa52a('0x3d')]),_0x2f68ab);if(_0x47a7e4['query']['filter']){_0x183502[_0xa52a('0x46')]=_[_0xa52a('0x47')](_0x183502[_0xa52a('0x46')],{'$or':_[_0xa52a('0x37')](_0x2f68ab,function(_0x3b6caf){if(_0x3b6caf['type']!=='VIRTUAL'){var _0x38b390={};_0x38b390[_0x3b6caf[_0xa52a('0x34')]]={'$like':'%'+_0x47a7e4[_0xa52a('0x3c')][_0xa52a('0x48')]+'%'};return _0x38b390;}})});}_0x183502=_[_0xa52a('0x47')]({},_0x183502,_0x47a7e4[_0xa52a('0x49')]);var _0x6cc8fe={'where':_0x183502[_0xa52a('0x46')]};return db[_0xa52a('0x38')]['count'](_0x6cc8fe)['then'](function(_0x18ab22){_0x520428[_0xa52a('0x29')]=_0x18ab22;if(_0x47a7e4[_0xa52a('0x3c')]['includeAll']){_0x183502[_0xa52a('0x4a')]=[{'all':!![]}];}return db['VoiceContext'][_0xa52a('0x4b')](_0x183502);})[_0xa52a('0x2e')](function(_0xde77d7){_0x520428[_0xa52a('0x4c')]=_0xde77d7;return _0x520428;})[_0xa52a('0x2e')](respondWithFilteredResult(_0xd767b0,_0x183502))[_0xa52a('0x4d')](handleError(_0xd767b0,null));};exports[_0xa52a('0x4e')]=function(_0x765dcc,_0x5cf0be){var _0x3c6614={'raw':![],'where':{'id':_0x765dcc['params']['id']}},_0x3ab2bf={};_0x3ab2bf[_0xa52a('0x3e')]=_[_0xa52a('0x3b')](db[_0xa52a('0x38')][_0xa52a('0x39')]);_0x3ab2bf['query']=_[_0xa52a('0x3b')](_0x765dcc[_0xa52a('0x3c')]);_0x3ab2bf[_0xa52a('0x3d')]=_[_0xa52a('0x4f')](_0x3ab2bf['model'],_0x3ab2bf[_0xa52a('0x3c')]);_0x3c6614['attributes']=_[_0xa52a('0x4f')](_0x3ab2bf[_0xa52a('0x3e')],qs[_0xa52a('0x40')](_0x765dcc[_0xa52a('0x3c')][_0xa52a('0x40')]));_0x3c6614[_0xa52a('0x3f')]=_0x3c6614[_0xa52a('0x3f')][_0xa52a('0x41')]?_0x3c6614[_0xa52a('0x3f')]:_0x3ab2bf[_0xa52a('0x3e')];if(_0x765dcc['query'][_0xa52a('0x50')]){_0x3c6614[_0xa52a('0x4a')]=[{'all':!![]}];}_0x3c6614=_[_0xa52a('0x47')]({},_0x3c6614,_0x765dcc[_0xa52a('0x49')]);return db['VoiceContext']['find'](_0x3c6614)['then'](handleEntityNotFound(_0x5cf0be,null))[_0xa52a('0x2e')](respondWithResult(_0x5cf0be,null))[_0xa52a('0x4d')](handleError(_0x5cf0be,null));};exports[_0xa52a('0x51')]=function(_0x5439ad,_0x13f88b,_0x1b2a21){var _0x487f92;return db[_0xa52a('0x38')]['create'](_0x5439ad[_0xa52a('0x52')],{'raw':!![]})[_0xa52a('0x2e')](function(_0x452509){_0x487f92=_0x452509;return db[_0xa52a('0x38')][_0xa52a('0x4b')]({'raw':!![]});})[_0xa52a('0x2e')](function(_0xda3c2c){var _0x11bc97=fs[_0xa52a('0x53')](path[_0xa52a('0x54')](config[_0xa52a('0x55')],'server/files/templates/context.ejs'),_0xa52a('0x56'));var _0x2eb023=ejs['render'](_0x11bc97,{'contexts':_0xda3c2c||[]});fs[_0xa52a('0x57')](_0xa52a('0x58'),_0x2eb023);})[_0xa52a('0x2e')](function(){return respondWithRpcPromise(_0xa52a('0x59'),_0xa52a('0x51'),{'module':_0xa52a('0x5a')});})[_0xa52a('0x2e')](function(){var _0x449b42=_0x5439ad['user'][_0xa52a('0x30')]({'plain':!![]});if(!_0x449b42)throw new Error(_0xa52a('0x5b'));if(_0x449b42['role']===_0xa52a('0x5c')){var _0x1edd41=_0x487f92['get']({'plain':!![]});return db[_0xa52a('0x5d')][_0xa52a('0x5e')]({'where':{'name':'Contexts','userProfileId':_0x449b42[_0xa52a('0x5f')]},'raw':!![]})['then'](function(_0xe09f26){if(_0xe09f26&&_0xe09f26['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1edd41[_0xa52a('0x34')],'resourceId':_0x1edd41['id'],'type':_0xe09f26['name'],'sectionId':_0xe09f26['id']},{})[_0xa52a('0x2e')](function(){return _0x487f92;});}else{return _0x487f92;}})[_0xa52a('0x4d')](function(_0x27d66d){logger['error'](_0xa52a('0x60'),_0x27d66d);throw _0x27d66d;});}return _0x487f92;})['then'](respondWithResult(_0x13f88b,0xc9))[_0xa52a('0x4d')](handleError(_0x13f88b,null));};exports[_0xa52a('0x2d')]=function(_0x456250,_0xa03b4d,_0x27ddbe){var _0x3fad6d;return db[_0xa52a('0x38')][_0xa52a('0x5e')]({'where':{'id':_0x456250[_0xa52a('0x61')]['id']}})[_0xa52a('0x2e')](handleEntityNotFound(_0xa03b4d,null))['then'](saveUpdates(_0x456250['body'],null))['then'](function(_0x3614f3){if(_0x3614f3){_0x3fad6d=_0x3614f3;return db[_0xa52a('0x38')]['findAll']({'raw':!![]});}})['then'](function(_0x2f176e){var _0x3e3304=fs[_0xa52a('0x53')](path[_0xa52a('0x54')](config[_0xa52a('0x55')],_0xa52a('0x62')),_0xa52a('0x56'));var _0x408602=ejs['render'](_0x3e3304,{'contexts':_0x2f176e||[]});fs[_0xa52a('0x57')](_0xa52a('0x58'),_0x408602);})[_0xa52a('0x2e')](function(){return respondWithRpcPromise(_0xa52a('0x59'),'update',{'module':_0xa52a('0x5a')});})[_0xa52a('0x2e')](function(){return _0x3fad6d;})[_0xa52a('0x2e')](respondWithResult(_0xa03b4d,null))[_0xa52a('0x4d')](handleError(_0xa03b4d,null));};exports[_0xa52a('0x2f')]=function(_0x9ba8aa,_0x2dab67,_0x223432){var _0xb47452;return db['VoiceContext'][_0xa52a('0x5e')]({'where':{'id':_0x9ba8aa[_0xa52a('0x61')]['id']}})[_0xa52a('0x2e')](handleEntityNotFound(_0x2dab67,null))['then'](removeEntity(_0x2dab67,null))['then'](function(){return db[_0xa52a('0x38')][_0xa52a('0x4b')]({'raw':!![]});})[_0xa52a('0x2e')](function(_0x3893cb){var _0x32a0e8=fs['readFileSync'](path['join'](config[_0xa52a('0x55')],_0xa52a('0x62')),_0xa52a('0x56'));var _0xf6ccf7=ejs[_0xa52a('0x63')](_0x32a0e8,{'contexts':_0x3893cb});fs[_0xa52a('0x57')](_0xa52a('0x58'),_0xf6ccf7);return respondWithRpcPromise(_0xa52a('0x59'),_0xa52a('0x2f'),{'module':_0xa52a('0x5a')});})[_0xa52a('0x4d')](handleError(_0x2dab67,null));};
\ No newline at end of file
+var _0x8151=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceContext','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','keys','rawAttributes','includeAll','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x51cce7,_0x236cee){var _0x5e9321=function(_0x46d0e2){while(--_0x46d0e2){_0x51cce7['push'](_0x51cce7['shift']());}};_0x5e9321(++_0x236cee);}(_0x8151,0xb2));var _0x1815=function(_0x14608c,_0x426670){_0x14608c=_0x14608c-0x0;var _0x1a0746=_0x8151[_0x14608c];return _0x1a0746;};'use strict';var emlformat=require(_0x1815('0x0'));var rimraf=require(_0x1815('0x1'));var zipdir=require(_0x1815('0x2'));var jsonpatch=require(_0x1815('0x3'));var rp=require(_0x1815('0x4'));var moment=require(_0x1815('0x5'));var BPromise=require(_0x1815('0x6'));var Mustache=require(_0x1815('0x7'));var util=require(_0x1815('0x8'));var path=require(_0x1815('0x9'));var sox=require(_0x1815('0xa'));var csv=require('to-csv');var ejs=require(_0x1815('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1815('0xc'));var squel=require('squel');var crypto=require(_0x1815('0xd'));var jsforce=require(_0x1815('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1815('0xf'));var querystring=require(_0x1815('0x10'));var Papa=require('papaparse');var Redis=require(_0x1815('0x11'));var authService=require(_0x1815('0x12'));var qs=require(_0x1815('0x13'));var as=require(_0x1815('0x14'));var hardwareService=require(_0x1815('0x15'));var logger=require(_0x1815('0x16'))(_0x1815('0x17'));var utils=require(_0x1815('0x18'));var config=require(_0x1815('0x19'));var licenseUtil=require(_0x1815('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1815('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2335,_0x30e8d6,_0x3ec894,_0x2a5a0f){return new BPromise(function(_0x39eb08,_0x4fc3a2){var _0x403dd0=_0x2a5a0f||client;return _0x403dd0[_0x1815('0x1c')](_0x2a2335,_0x3ec894)[_0x1815('0x1d')](function(_0x44d74e){logger[_0x1815('0x1e')](_0x1815('0x1f'),_0x30e8d6,_0x1815('0x20'));logger[_0x1815('0x21')](_0x1815('0x22'),_0x30e8d6,_0x1815('0x20'),JSON['stringify'](_0x44d74e));if(_0x44d74e[_0x1815('0x23')]){if(_0x44d74e[_0x1815('0x23')][_0x1815('0x24')]===0x1f4){logger['error'](_0x1815('0x1f'),_0x30e8d6,_0x44d74e['error'][_0x1815('0x25')]);return _0x4fc3a2(_0x44d74e[_0x1815('0x23')][_0x1815('0x25')]);}logger[_0x1815('0x23')](_0x1815('0x1f'),_0x30e8d6,_0x44d74e[_0x1815('0x23')][_0x1815('0x25')]);return _0x39eb08(_0x44d74e['error'][_0x1815('0x25')]);}else{logger['info'](_0x1815('0x1f'),_0x30e8d6,_0x1815('0x20'));_0x39eb08(_0x44d74e[_0x1815('0x26')][_0x1815('0x25')]);}})[_0x1815('0x27')](function(_0x3f1ac3){logger['error']('VoiceContext,\x20%s,\x20%s',_0x30e8d6,_0x3f1ac3);_0x4fc3a2(_0x3f1ac3);});});}function respondWithStatusCode(_0x12804c,_0x71d4ce){_0x71d4ce=_0x71d4ce||0xcc;return function(_0x3dc708){if(_0x3dc708){return _0x12804c['sendStatus'](_0x71d4ce);}return _0x12804c['status'](_0x71d4ce)[_0x1815('0x28')]();};}function respondWithResult(_0x4b22b1,_0x4549bc){_0x4549bc=_0x4549bc||0xc8;return function(_0x982d98){if(_0x982d98){return _0x4b22b1[_0x1815('0x29')](_0x4549bc)[_0x1815('0x2a')](_0x982d98);}};}function respondWithFilteredResult(_0x5754f1,_0x3cc549){return function(_0x4b68f6){if(_0x4b68f6){var _0x18612a=typeof _0x3cc549[_0x1815('0x2b')]===_0x1815('0x2c')&&typeof _0x3cc549[_0x1815('0x2d')]===_0x1815('0x2c');var _0x4b2920=_0x4b68f6['count'];var _0x4f21b8=_0x18612a?0x0:_0x3cc549['offset'];var _0x25f0d6=_0x18612a?_0x4b68f6[_0x1815('0x2e')]:_0x3cc549[_0x1815('0x2b')]+_0x3cc549[_0x1815('0x2d')];var _0x5dba01;if(_0x25f0d6>=_0x4b2920){_0x25f0d6=_0x4b2920;_0x5dba01=0xc8;}else{_0x5dba01=0xce;}_0x5754f1[_0x1815('0x29')](_0x5dba01);return _0x5754f1[_0x1815('0x2f')](_0x1815('0x30'),_0x4f21b8+'-'+_0x25f0d6+'/'+_0x4b2920)[_0x1815('0x2a')](_0x4b68f6);}return null;};}function patchUpdates(_0x18b27d){return function(_0x100b43){try{jsonpatch[_0x1815('0x31')](_0x100b43,_0x18b27d,!![]);}catch(_0x5dbf76){return BPromise['reject'](_0x5dbf76);}return _0x100b43['save']();};}function saveUpdates(_0x261675,_0x2dbfe3){return function(_0x24c353){if(_0x24c353){return _0x24c353[_0x1815('0x32')](_0x261675)[_0x1815('0x1d')](function(_0x1bc7ad){return _0x1bc7ad;});}return null;};}function removeEntity(_0x9843f9,_0x367414){return function(_0x29c372){if(_0x29c372){return _0x29c372[_0x1815('0x33')]()['then'](function(){var _0x5c845e=_0x29c372[_0x1815('0x34')]({'plain':!![]});var _0x48c986=_0x1815('0x35');return db[_0x1815('0x36')][_0x1815('0x33')]({'where':{'type':_0x48c986,'resourceId':_0x5c845e['id']}})[_0x1815('0x1d')](function(){return _0x29c372;});})[_0x1815('0x1d')](function(){_0x9843f9[_0x1815('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ef051,_0x2189ba){return function(_0x3fafe1){if(!_0x3fafe1){_0x5ef051[_0x1815('0x37')](0x194);}return _0x3fafe1;};}function handleError(_0x36f2a4,_0x4b63cd){_0x4b63cd=_0x4b63cd||0x1f4;return function(_0x55c1f7){logger[_0x1815('0x23')](_0x55c1f7[_0x1815('0x38')]);if(_0x55c1f7[_0x1815('0x39')]){delete _0x55c1f7[_0x1815('0x39')];}_0x36f2a4[_0x1815('0x29')](_0x4b63cd)[_0x1815('0x3a')](_0x55c1f7);};}exports[_0x1815('0x3b')]=function(_0x4ebc9b,_0x2c2cc2){var _0x2dfa97={},_0x7a7e93={},_0x295004={'count':0x0,'rows':[]};var _0x1c398e=_[_0x1815('0x3c')](db[_0x1815('0x3d')]['rawAttributes'],function(_0x35d71b){return{'name':_0x35d71b[_0x1815('0x3e')],'type':_0x35d71b[_0x1815('0x3f')]['key']};});_0x7a7e93['model']=_[_0x1815('0x3c')](_0x1c398e,_0x1815('0x39'));_0x7a7e93[_0x1815('0x40')]=_['keys'](_0x4ebc9b[_0x1815('0x40')]);_0x7a7e93[_0x1815('0x41')]=_[_0x1815('0x42')](_0x7a7e93[_0x1815('0x43')],_0x7a7e93['query']);_0x2dfa97['attributes']=_[_0x1815('0x42')](_0x7a7e93[_0x1815('0x43')],qs['fields'](_0x4ebc9b[_0x1815('0x40')][_0x1815('0x44')]));_0x2dfa97[_0x1815('0x45')]=_0x2dfa97['attributes'][_0x1815('0x46')]?_0x2dfa97[_0x1815('0x45')]:_0x7a7e93[_0x1815('0x43')];if(!_0x4ebc9b[_0x1815('0x40')][_0x1815('0x47')](_0x1815('0x48'))){_0x2dfa97['limit']=qs[_0x1815('0x2d')](_0x4ebc9b[_0x1815('0x40')][_0x1815('0x2d')]);_0x2dfa97[_0x1815('0x2b')]=qs['offset'](_0x4ebc9b[_0x1815('0x40')][_0x1815('0x2b')]);}_0x2dfa97[_0x1815('0x49')]=qs[_0x1815('0x4a')](_0x4ebc9b[_0x1815('0x40')][_0x1815('0x4a')]);_0x2dfa97[_0x1815('0x4b')]=qs['filters'](_[_0x1815('0x4c')](_0x4ebc9b[_0x1815('0x40')],_0x7a7e93[_0x1815('0x41')]),_0x1c398e);if(_0x4ebc9b[_0x1815('0x40')][_0x1815('0x4d')]){_0x2dfa97[_0x1815('0x4b')]=_[_0x1815('0x4e')](_0x2dfa97[_0x1815('0x4b')],{'$or':_['map'](_0x1c398e,function(_0x2b74c6){if(_0x2b74c6[_0x1815('0x3f')]!==_0x1815('0x4f')){var _0x353b76={};_0x353b76[_0x2b74c6['name']]={'$like':'%'+_0x4ebc9b[_0x1815('0x40')][_0x1815('0x4d')]+'%'};return _0x353b76;}})});}_0x2dfa97=_[_0x1815('0x4e')]({},_0x2dfa97,_0x4ebc9b[_0x1815('0x50')]);var _0x47766d={'where':_0x2dfa97[_0x1815('0x4b')]};return db[_0x1815('0x3d')][_0x1815('0x2e')](_0x47766d)[_0x1815('0x1d')](function(_0x126322){_0x295004[_0x1815('0x2e')]=_0x126322;if(_0x4ebc9b[_0x1815('0x40')]['includeAll']){_0x2dfa97[_0x1815('0x51')]=[{'all':!![]}];}return db[_0x1815('0x3d')][_0x1815('0x52')](_0x2dfa97);})[_0x1815('0x1d')](function(_0x154181){_0x295004['rows']=_0x154181;return _0x295004;})[_0x1815('0x1d')](respondWithFilteredResult(_0x2c2cc2,_0x2dfa97))['catch'](handleError(_0x2c2cc2,null));};exports[_0x1815('0x53')]=function(_0x3ceba3,_0x38df76){var _0x34a451={'raw':![],'where':{'id':_0x3ceba3[_0x1815('0x54')]['id']}},_0x11499b={};_0x11499b['model']=_[_0x1815('0x55')](db['VoiceContext'][_0x1815('0x56')]);_0x11499b[_0x1815('0x40')]=_[_0x1815('0x55')](_0x3ceba3['query']);_0x11499b[_0x1815('0x41')]=_[_0x1815('0x42')](_0x11499b['model'],_0x11499b[_0x1815('0x40')]);_0x34a451[_0x1815('0x45')]=_['intersection'](_0x11499b[_0x1815('0x43')],qs[_0x1815('0x44')](_0x3ceba3[_0x1815('0x40')][_0x1815('0x44')]));_0x34a451['attributes']=_0x34a451[_0x1815('0x45')][_0x1815('0x46')]?_0x34a451[_0x1815('0x45')]:_0x11499b[_0x1815('0x43')];if(_0x3ceba3[_0x1815('0x40')][_0x1815('0x57')]){_0x34a451[_0x1815('0x51')]=[{'all':!![]}];}_0x34a451=_[_0x1815('0x4e')]({},_0x34a451,_0x3ceba3[_0x1815('0x50')]);return db[_0x1815('0x3d')][_0x1815('0x58')](_0x34a451)[_0x1815('0x1d')](handleEntityNotFound(_0x38df76,null))['then'](respondWithResult(_0x38df76,null))['catch'](handleError(_0x38df76,null));};exports[_0x1815('0x59')]=function(_0x3c0971,_0x2fc68d,_0x6b3d28){var _0x9ad6ef;return db['VoiceContext']['create'](_0x3c0971[_0x1815('0x5a')],{'raw':!![]})['then'](function(_0xdc9024){_0x9ad6ef=_0xdc9024;return db[_0x1815('0x3d')][_0x1815('0x52')]({'raw':!![]});})['then'](function(_0x1b48b7){var _0x525df4=fs[_0x1815('0x5b')](path[_0x1815('0x5c')](config[_0x1815('0x5d')],_0x1815('0x5e')),_0x1815('0x5f'));var _0x1398d5=ejs[_0x1815('0x60')](_0x525df4,{'contexts':_0x1b48b7||[]});fs[_0x1815('0x61')](_0x1815('0x62'),_0x1398d5);})[_0x1815('0x1d')](function(){return respondWithRpcPromise(_0x1815('0x63'),_0x1815('0x59'),{'module':_0x1815('0x64')});})[_0x1815('0x1d')](function(){var _0x206b60=_0x3c0971[_0x1815('0x65')][_0x1815('0x34')]({'plain':!![]});if(!_0x206b60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x206b60['role']==='user'){var _0x2898c0=_0x9ad6ef[_0x1815('0x34')]({'plain':!![]});return db[_0x1815('0x66')]['find']({'where':{'name':_0x1815('0x35'),'userProfileId':_0x206b60[_0x1815('0x67')]},'raw':!![]})[_0x1815('0x1d')](function(_0x522866){if(_0x522866&&_0x522866['autoAssociation']===0x0){return db[_0x1815('0x36')][_0x1815('0x59')]({'name':_0x2898c0[_0x1815('0x39')],'resourceId':_0x2898c0['id'],'type':_0x522866[_0x1815('0x39')],'sectionId':_0x522866['id']},{})[_0x1815('0x1d')](function(){return _0x9ad6ef;});}else{return _0x9ad6ef;}})[_0x1815('0x27')](function(_0x444400){logger[_0x1815('0x23')](_0x1815('0x68'),_0x444400);throw _0x444400;});}return _0x9ad6ef;})['then'](respondWithResult(_0x2fc68d,0xc9))[_0x1815('0x27')](handleError(_0x2fc68d,null));};exports[_0x1815('0x32')]=function(_0x41ecde,_0x128263,_0x3fce6a){var _0x5b3ac6;return db['VoiceContext'][_0x1815('0x58')]({'where':{'id':_0x41ecde[_0x1815('0x54')]['id']}})[_0x1815('0x1d')](handleEntityNotFound(_0x128263,null))[_0x1815('0x1d')](saveUpdates(_0x41ecde[_0x1815('0x5a')],null))[_0x1815('0x1d')](function(_0x407800){if(_0x407800){_0x5b3ac6=_0x407800;return db[_0x1815('0x3d')]['findAll']({'raw':!![]});}})['then'](function(_0x570a49){var _0x28ce1b=fs[_0x1815('0x5b')](path['join'](config[_0x1815('0x5d')],_0x1815('0x5e')),_0x1815('0x5f'));var _0x3f2f90=ejs[_0x1815('0x60')](_0x28ce1b,{'contexts':_0x570a49||[]});fs[_0x1815('0x61')](_0x1815('0x62'),_0x3f2f90);})[_0x1815('0x1d')](function(){return respondWithRpcPromise(_0x1815('0x63'),'update',{'module':_0x1815('0x64')});})[_0x1815('0x1d')](function(){return _0x5b3ac6;})['then'](respondWithResult(_0x128263,null))[_0x1815('0x27')](handleError(_0x128263,null));};exports[_0x1815('0x33')]=function(_0x55b342,_0x5931f7,_0x32ff1c){var _0x2075d0;return db['VoiceContext'][_0x1815('0x58')]({'where':{'id':_0x55b342[_0x1815('0x54')]['id']}})[_0x1815('0x1d')](handleEntityNotFound(_0x5931f7,null))['then'](removeEntity(_0x5931f7,null))[_0x1815('0x1d')](function(){return db[_0x1815('0x3d')][_0x1815('0x52')]({'raw':!![]});})[_0x1815('0x1d')](function(_0x85a9fa){var _0x566fff=fs['readFileSync'](path[_0x1815('0x5c')](config[_0x1815('0x5d')],_0x1815('0x5e')),'utf8');var _0x397686=ejs['render'](_0x566fff,{'contexts':_0x85a9fa});fs['writeFileSync'](_0x1815('0x62'),_0x397686);return respondWithRpcPromise(_0x1815('0x63'),_0x1815('0x33'),{'module':_0x1815('0x64')});})['catch'](handleError(_0x5931f7,null));};
\ No newline at end of file
index 368650c..2c4a245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccc8=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x54dc52,_0x38bedc){var _0x57da26=function(_0x2fd72c){while(--_0x2fd72c){_0x54dc52['push'](_0x54dc52['shift']());}};_0x57da26(++_0x38bedc);}(_0xccc8,0x66));var _0x8ccc=function(_0x4880fd,_0x2cc70d){_0x4880fd=_0x4880fd-0x0;var _0x4a4b50=_0xccc8[_0x4880fd];return _0x4a4b50;};'use strict';var _=require(_0x8ccc('0x0'));var util=require('util');var logger=require(_0x8ccc('0x1'))(_0x8ccc('0x2'));var moment=require(_0x8ccc('0x3'));var BPromise=require(_0x8ccc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ccc('0x5'));var rimraf=require('rimraf');var config=require(_0x8ccc('0x6'));var attributes=require(_0x8ccc('0x7'));module[_0x8ccc('0x8')]=function(_0x305340,_0x4f8de5){return _0x305340[_0x8ccc('0x9')](_0x8ccc('0xa'),attributes,{'tableName':_0x8ccc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f05=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','lodash','util'];(function(_0x411dc3,_0x47a8e4){var _0x5b870b=function(_0x5d4bef){while(--_0x5d4bef){_0x411dc3['push'](_0x411dc3['shift']());}};_0x5b870b(++_0x47a8e4);}(_0x1f05,0x98));var _0x51f0=function(_0x15e592,_0x1332cc){_0x15e592=_0x15e592-0x0;var _0x16dba1=_0x1f05[_0x15e592];return _0x16dba1;};'use strict';var _=require(_0x51f0('0x0'));var util=require(_0x51f0('0x1'));var logger=require(_0x51f0('0x2'))(_0x51f0('0x3'));var moment=require('moment');var BPromise=require(_0x51f0('0x4'));var rp=require(_0x51f0('0x5'));var fs=require('fs');var path=require(_0x51f0('0x6'));var rimraf=require(_0x51f0('0x7'));var config=require(_0x51f0('0x8'));var attributes=require(_0x51f0('0x9'));module[_0x51f0('0xa')]=function(_0x4976d7,_0x55608d){return _0x4976d7['define']('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4d2972..1e49f6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6f1=['../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x5a008b,_0x4f485f){var _0x161903=function(_0x3b1ba7){while(--_0x3b1ba7){_0x5a008b['push'](_0x5a008b['shift']());}};_0x161903(++_0x4f485f);}(_0xe6f1,0x19c));var _0x1e6f=function(_0x157c81,_0x2c0224){_0x157c81=_0x157c81-0x0;var _0x1bfb12=_0xe6f1[_0x157c81];return _0x1bfb12;};'use strict';var _=require(_0x1e6f('0x0'));var util=require('util');var moment=require(_0x1e6f('0x1'));var BPromise=require('bluebird');var rs=require(_0x1e6f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e6f('0x4'))(_0x1e6f('0x5'));var config=require(_0x1e6f('0x6'));var jayson=require(_0x1e6f('0x7'));var client=jayson[_0x1e6f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x507404,_0x5348f3,_0x5d9178){return new BPromise(function(_0x719e20,_0x4136f0){return client['request'](_0x507404,_0x5d9178)[_0x1e6f('0x9')](function(_0x1a8c69){logger[_0x1e6f('0xa')](_0x1e6f('0xb'),_0x5348f3,'request\x20sent');logger[_0x1e6f('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5348f3,_0x1e6f('0xd'),JSON[_0x1e6f('0xe')](_0x1a8c69));if(_0x1a8c69[_0x1e6f('0xf')]){if(_0x1a8c69[_0x1e6f('0xf')]['code']===0x1f4){logger[_0x1e6f('0xf')]('VoiceContext,\x20%s,\x20%s',_0x5348f3,_0x1a8c69[_0x1e6f('0xf')][_0x1e6f('0x10')]);return _0x4136f0(_0x1a8c69[_0x1e6f('0xf')][_0x1e6f('0x10')]);}logger[_0x1e6f('0xf')]('VoiceContext,\x20%s,\x20%s',_0x5348f3,_0x1a8c69[_0x1e6f('0xf')][_0x1e6f('0x10')]);return _0x719e20(_0x1a8c69[_0x1e6f('0xf')][_0x1e6f('0x10')]);}else{logger[_0x1e6f('0xa')](_0x1e6f('0xb'),_0x5348f3,_0x1e6f('0xd'));_0x719e20(_0x1a8c69[_0x1e6f('0x11')][_0x1e6f('0x10')]);}})[_0x1e6f('0x12')](function(_0x52671f){logger[_0x1e6f('0xf')](_0x1e6f('0xb'),_0x5348f3,_0x52671f);_0x4136f0(_0x52671f);});});}
\ No newline at end of file
+var _0x4628=['jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x4628,0xd3));var _0x8462=function(_0x2c39c3,_0x3d9848){_0x2c39c3=_0x2c39c3-0x0;var _0x74f703=_0x4628[_0x2c39c3];return _0x74f703;};'use strict';var _=require(_0x8462('0x0'));var util=require(_0x8462('0x1'));var moment=require('moment');var BPromise=require(_0x8462('0x2'));var rs=require(_0x8462('0x3'));var fs=require('fs');var Redis=require(_0x8462('0x4'));var db=require(_0x8462('0x5'))['db'];var utils=require(_0x8462('0x6'));var logger=require('../../config/logger')(_0x8462('0x7'));var config=require(_0x8462('0x8'));var jayson=require(_0x8462('0x9'));var client=jayson[_0x8462('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dad7,_0x4b92a7,_0x162bea){return new BPromise(function(_0x4b987a,_0x314c4c){return client[_0x8462('0xb')](_0x12dad7,_0x162bea)['then'](function(_0x58ec31){logger[_0x8462('0xc')](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));logger[_0x8462('0xf')](_0x8462('0x10'),_0x4b92a7,_0x8462('0xe'),JSON['stringify'](_0x58ec31));if(_0x58ec31[_0x8462('0x11')]){if(_0x58ec31[_0x8462('0x11')]['code']===0x1f4){logger[_0x8462('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4b92a7,_0x58ec31['error']['message']);return _0x314c4c(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}logger[_0x8462('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4b92a7,_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);return _0x4b987a(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}else{logger['info'](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));_0x4b987a(_0x58ec31['result'][_0x8462('0x12')]);}})[_0x8462('0x13')](function(_0xabd292){logger[_0x8462('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4b92a7,_0xabd292);_0x314c4c(_0xabd292);});});}
\ No newline at end of file
index 2e1e5a6..33daf4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c28=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get'];(function(_0x527f99,_0x1e44a3){var _0x562378=function(_0x3fd924){while(--_0x3fd924){_0x527f99['push'](_0x527f99['shift']());}};_0x562378(++_0x1e44a3);}(_0x8c28,0x198));var _0x88c2=function(_0x44331b,_0x390e14){_0x44331b=_0x44331b-0x0;var _0x4047e3=_0x8c28[_0x44331b];return _0x4047e3;};'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('express');var router=express[_0x88c2('0x3')]();var fs_extra=require(_0x88c2('0x4'));var auth=require(_0x88c2('0x5'));var interaction=require(_0x88c2('0x6'));var config=require(_0x88c2('0x7'));var controller=require(_0x88c2('0x8'));router['get']('/',auth[_0x88c2('0x9')](),controller[_0x88c2('0xa')]);router[_0x88c2('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x88c2('0xb')]('/:id',auth[_0x88c2('0x9')](),controller[_0x88c2('0xc')]);router[_0x88c2('0xd')]('/',auth[_0x88c2('0x9')](),controller[_0x88c2('0xe')]);router[_0x88c2('0xf')](_0x88c2('0x10'),auth['isAuthenticated'](),controller[_0x88c2('0x11')]);router[_0x88c2('0x12')](_0x88c2('0x10'),auth[_0x88c2('0x9')](),controller[_0x88c2('0x13')]);module[_0x88c2('0x14')]=router;
\ No newline at end of file
+var _0x8149=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','post','put','delete','/:id','multer','util','connect-timeout','express'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x8149,0xe6));var _0x9814=function(_0x31f652,_0x2eec54){_0x31f652=_0x31f652-0x0;var _0x449bd2=_0x8149[_0x31f652];return _0x449bd2;};'use strict';var multer=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var path=require('path');var timeout=require(_0x9814('0x2'));var express=require(_0x9814('0x3'));var router=express[_0x9814('0x4')]();var fs_extra=require(_0x9814('0x5'));var auth=require(_0x9814('0x6'));var interaction=require(_0x9814('0x7'));var config=require(_0x9814('0x8'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x9814('0x9')](),controller[_0x9814('0xa')]);router[_0x9814('0xb')](_0x9814('0xc'),auth[_0x9814('0x9')](),controller[_0x9814('0xd')]);router['get']('/:id',auth[_0x9814('0x9')](),controller['show']);router[_0x9814('0xe')]('/',auth[_0x9814('0x9')](),controller['create']);router[_0x9814('0xf')]('/:id',auth[_0x9814('0x9')](),controller['update']);router[_0x9814('0x10')](_0x9814('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 7a40c20..b748930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x3d57f5,_0x58043f){var _0x1b6ef3=function(_0x1747e6){while(--_0x1747e6){_0x3d57f5['push'](_0x3d57f5['shift']());}};_0x1b6ef3(++_0x58043f);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5ad04c,_0x5ae6ff){_0x5ad04c=_0x5ad04c-0x0;var _0xaa839d=_0xe5b3[_0x5ad04c];return _0xaa839d;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x5a565b,_0x5911e3){var _0x463fbd=function(_0x100453){while(--_0x100453){_0x5a565b['push'](_0x5a565b['shift']());}};_0x463fbd(++_0x5911e3);}(_0x98a8,0x12c));var _0x898a=function(_0x3dcce2,_0x3faa9e){_0x3dcce2=_0x3dcce2-0x0;var _0x950147=_0x98a8[_0x3dcce2];return _0x950147;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}};
\ No newline at end of file
index 9da4535..d0a2a3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc128=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','catch','show','params','keys','includeAll','include','create','body','find','destroy','describe'];(function(_0x5b2b63,_0xb6e795){var _0x17a348=function(_0x2a4933){while(--_0x2a4933){_0x5b2b63['push'](_0x5b2b63['shift']());}};_0x17a348(++_0xb6e795);}(_0xc128,0x17c));var _0x8c12=function(_0x3e91d,_0x163de9){_0x3e91d=_0x3e91d-0x0;var _0x2c768b=_0xc128[_0x3e91d];return _0x2c768b;};'use strict';var emlformat=require(_0x8c12('0x0'));var rimraf=require(_0x8c12('0x1'));var zipdir=require(_0x8c12('0x2'));var jsonpatch=require(_0x8c12('0x3'));var rp=require(_0x8c12('0x4'));var moment=require('moment');var BPromise=require(_0x8c12('0x5'));var Mustache=require(_0x8c12('0x6'));var util=require(_0x8c12('0x7'));var path=require('path');var sox=require(_0x8c12('0x8'));var csv=require('to-csv');var ejs=require(_0x8c12('0x9'));var fs=require('fs');var fs_extra=require(_0x8c12('0xa'));var _=require(_0x8c12('0xb'));var squel=require(_0x8c12('0xc'));var crypto=require(_0x8c12('0xd'));var jsforce=require(_0x8c12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8c12('0xf'));var querystring=require(_0x8c12('0x10'));var Papa=require(_0x8c12('0x11'));var Redis=require(_0x8c12('0x12'));var authService=require(_0x8c12('0x13'));var qs=require(_0x8c12('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c12('0x15'));var logger=require(_0x8c12('0x16'))(_0x8c12('0x17'));var utils=require(_0x8c12('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8c12('0x19'))['db'];function respondWithStatusCode(_0x1af61d,_0x380ed3){_0x380ed3=_0x380ed3||0xcc;return function(_0x3cd47a){if(_0x3cd47a){return _0x1af61d[_0x8c12('0x1a')](_0x380ed3);}return _0x1af61d[_0x8c12('0x1b')](_0x380ed3)['end']();};}function respondWithResult(_0xfb5420,_0x4144aa){_0x4144aa=_0x4144aa||0xc8;return function(_0x58caab){if(_0x58caab){return _0xfb5420['status'](_0x4144aa)['json'](_0x58caab);}};}function respondWithFilteredResult(_0x22e391,_0x1d7c7d){return function(_0x560b75){if(_0x560b75){var _0x4e4909=typeof _0x1d7c7d[_0x8c12('0x1c')]===_0x8c12('0x1d')&&typeof _0x1d7c7d[_0x8c12('0x1e')]===_0x8c12('0x1d');var _0x5e98b0=_0x560b75[_0x8c12('0x1f')];var _0x3f0507=_0x4e4909?0x0:_0x1d7c7d['offset'];var _0x5eebdb=_0x4e4909?_0x560b75[_0x8c12('0x1f')]:_0x1d7c7d[_0x8c12('0x1c')]+_0x1d7c7d[_0x8c12('0x1e')];var _0x5804d2;if(_0x5eebdb>=_0x5e98b0){_0x5eebdb=_0x5e98b0;_0x5804d2=0xc8;}else{_0x5804d2=0xce;}_0x22e391['status'](_0x5804d2);return _0x22e391[_0x8c12('0x20')](_0x8c12('0x21'),_0x3f0507+'-'+_0x5eebdb+'/'+_0x5e98b0)[_0x8c12('0x22')](_0x560b75);}return null;};}function patchUpdates(_0x438967){return function(_0x37880d){try{jsonpatch[_0x8c12('0x23')](_0x37880d,_0x438967,!![]);}catch(_0x259c9a){return BPromise[_0x8c12('0x24')](_0x259c9a);}return _0x37880d[_0x8c12('0x25')]();};}function saveUpdates(_0x36b779,_0x5aa2ba){return function(_0x5e8627){if(_0x5e8627){return _0x5e8627[_0x8c12('0x26')](_0x36b779)[_0x8c12('0x27')](function(_0x25538d){return _0x25538d;});}return null;};}function removeEntity(_0x1ca0a2,_0x2bd001){return function(_0x1efa2c){if(_0x1efa2c){return _0x1efa2c['destroy']()['then'](function(){_0x1ca0a2[_0x8c12('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5072,_0x12ad08){return function(_0x7bd566){if(!_0x7bd566){_0x1e5072['sendStatus'](0x194);}return _0x7bd566;};}function handleError(_0x21352c,_0x420e56){_0x420e56=_0x420e56||0x1f4;return function(_0x18cf9d){logger['error'](_0x18cf9d[_0x8c12('0x28')]);if(_0x18cf9d[_0x8c12('0x29')]){delete _0x18cf9d[_0x8c12('0x29')];}_0x21352c[_0x8c12('0x1b')](_0x420e56)[_0x8c12('0x2a')](_0x18cf9d);};}exports['index']=function(_0x2d8d1b,_0x89903f){var _0x3d04b9={},_0x1a00be={},_0x15d00d={'count':0x0,'rows':[]};var _0x5b0a21=_[_0x8c12('0x2b')](db[_0x8c12('0x2c')][_0x8c12('0x2d')],function(_0x40fe9e){return{'name':_0x40fe9e[_0x8c12('0x2e')],'type':_0x40fe9e['type'][_0x8c12('0x2f')]};});_0x1a00be[_0x8c12('0x30')]=_[_0x8c12('0x2b')](_0x5b0a21,_0x8c12('0x29'));_0x1a00be[_0x8c12('0x31')]=_['keys'](_0x2d8d1b[_0x8c12('0x31')]);_0x1a00be[_0x8c12('0x32')]=_[_0x8c12('0x33')](_0x1a00be['model'],_0x1a00be[_0x8c12('0x31')]);_0x3d04b9[_0x8c12('0x34')]=_[_0x8c12('0x33')](_0x1a00be[_0x8c12('0x30')],qs[_0x8c12('0x35')](_0x2d8d1b[_0x8c12('0x31')][_0x8c12('0x35')]));_0x3d04b9['attributes']=_0x3d04b9[_0x8c12('0x34')][_0x8c12('0x36')]?_0x3d04b9[_0x8c12('0x34')]:_0x1a00be[_0x8c12('0x30')];if(!_0x2d8d1b['query'][_0x8c12('0x37')](_0x8c12('0x38'))){_0x3d04b9[_0x8c12('0x1e')]=qs['limit'](_0x2d8d1b[_0x8c12('0x31')][_0x8c12('0x1e')]);_0x3d04b9[_0x8c12('0x1c')]=qs[_0x8c12('0x1c')](_0x2d8d1b['query']['offset']);}_0x3d04b9[_0x8c12('0x39')]=qs[_0x8c12('0x3a')](_0x2d8d1b['query'][_0x8c12('0x3a')]);_0x3d04b9[_0x8c12('0x3b')]=qs[_0x8c12('0x32')](_[_0x8c12('0x3c')](_0x2d8d1b[_0x8c12('0x31')],_0x1a00be[_0x8c12('0x32')]),_0x5b0a21);if(_0x2d8d1b[_0x8c12('0x31')][_0x8c12('0x3d')]){_0x3d04b9[_0x8c12('0x3b')]=_[_0x8c12('0x3e')](_0x3d04b9['where'],{'$or':_['map'](_0x5b0a21,function(_0x30ee8e){if(_0x30ee8e[_0x8c12('0x3f')]!=='VIRTUAL'){var _0x2821f6={};_0x2821f6[_0x30ee8e[_0x8c12('0x29')]]={'$like':'%'+_0x2d8d1b[_0x8c12('0x31')]['filter']+'%'};return _0x2821f6;}})});}_0x3d04b9=_[_0x8c12('0x3e')]({},_0x3d04b9,_0x2d8d1b[_0x8c12('0x40')]);var _0x449637={'where':_0x3d04b9[_0x8c12('0x3b')]};return db[_0x8c12('0x2c')][_0x8c12('0x1f')](_0x449637)['then'](function(_0x190db6){_0x15d00d[_0x8c12('0x1f')]=_0x190db6;if(_0x2d8d1b['query']['includeAll']){_0x3d04b9['include']=[{'all':!![]}];}return db[_0x8c12('0x2c')]['findAll'](_0x3d04b9);})[_0x8c12('0x27')](function(_0x3c4cd9){_0x15d00d['rows']=_0x3c4cd9;return _0x15d00d;})[_0x8c12('0x27')](respondWithFilteredResult(_0x89903f,_0x3d04b9))[_0x8c12('0x41')](handleError(_0x89903f,null));};exports[_0x8c12('0x42')]=function(_0x101234,_0x163e71){var _0x1748f3={'raw':!![],'where':{'id':_0x101234[_0x8c12('0x43')]['id']}},_0x5d56b8={};_0x5d56b8[_0x8c12('0x30')]=_[_0x8c12('0x44')](db[_0x8c12('0x2c')]['rawAttributes']);_0x5d56b8[_0x8c12('0x31')]=_[_0x8c12('0x44')](_0x101234[_0x8c12('0x31')]);_0x5d56b8[_0x8c12('0x32')]=_[_0x8c12('0x33')](_0x5d56b8[_0x8c12('0x30')],_0x5d56b8[_0x8c12('0x31')]);_0x1748f3[_0x8c12('0x34')]=_[_0x8c12('0x33')](_0x5d56b8[_0x8c12('0x30')],qs[_0x8c12('0x35')](_0x101234['query']['fields']));_0x1748f3['attributes']=_0x1748f3[_0x8c12('0x34')]['length']?_0x1748f3[_0x8c12('0x34')]:_0x5d56b8[_0x8c12('0x30')];if(_0x101234[_0x8c12('0x31')][_0x8c12('0x45')]){_0x1748f3[_0x8c12('0x46')]=[{'all':!![]}];}_0x1748f3=_[_0x8c12('0x3e')]({},_0x1748f3,_0x101234[_0x8c12('0x40')]);return db[_0x8c12('0x2c')]['find'](_0x1748f3)[_0x8c12('0x27')](handleEntityNotFound(_0x163e71,null))[_0x8c12('0x27')](respondWithResult(_0x163e71,null))[_0x8c12('0x41')](handleError(_0x163e71,null));};exports[_0x8c12('0x47')]=function(_0x5349e1,_0x144f9b){return db['VoiceDialReport'][_0x8c12('0x47')](_0x5349e1[_0x8c12('0x48')],{})[_0x8c12('0x27')](respondWithResult(_0x144f9b,0xc9))[_0x8c12('0x41')](handleError(_0x144f9b,null));};exports[_0x8c12('0x26')]=function(_0x11663a,_0x23a540){if(_0x11663a[_0x8c12('0x48')]['id']){delete _0x11663a[_0x8c12('0x48')]['id'];}return db[_0x8c12('0x2c')][_0x8c12('0x49')]({'where':{'id':_0x11663a[_0x8c12('0x43')]['id']}})[_0x8c12('0x27')](handleEntityNotFound(_0x23a540,null))['then'](saveUpdates(_0x11663a['body'],null))[_0x8c12('0x27')](respondWithResult(_0x23a540,null))[_0x8c12('0x41')](handleError(_0x23a540,null));};exports[_0x8c12('0x4a')]=function(_0x491a2d,_0x5dd9eb){return db['VoiceDialReport'][_0x8c12('0x49')]({'where':{'id':_0x491a2d[_0x8c12('0x43')]['id']}})['then'](handleEntityNotFound(_0x5dd9eb,null))['then'](removeEntity(_0x5dd9eb,null))['catch'](handleError(_0x5dd9eb,null));};exports['describe']=function(_0x1ae199,_0x4a7e4b){return db['VoiceDialReport'][_0x8c12('0x4b')]()['then'](respondWithResult(_0x4a7e4b,null))['catch'](handleError(_0x4a7e4b,null));};
\ No newline at end of file
+var _0xb595=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','findAll','rows','show','params','rawAttributes','keys','include','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xb595,0x168));var _0x5b59=function(_0x10172d,_0x1b4ae8){_0x10172d=_0x10172d-0x0;var _0x5da4b2=_0xb595[_0x10172d];return _0x5da4b2;};'use strict';var emlformat=require(_0x5b59('0x0'));var rimraf=require(_0x5b59('0x1'));var zipdir=require(_0x5b59('0x2'));var jsonpatch=require(_0x5b59('0x3'));var rp=require(_0x5b59('0x4'));var moment=require('moment');var BPromise=require(_0x5b59('0x5'));var Mustache=require('mustache');var util=require(_0x5b59('0x6'));var path=require('path');var sox=require(_0x5b59('0x7'));var csv=require(_0x5b59('0x8'));var ejs=require(_0x5b59('0x9'));var fs=require('fs');var fs_extra=require(_0x5b59('0xa'));var _=require(_0x5b59('0xb'));var squel=require(_0x5b59('0xc'));var crypto=require('crypto');var jsforce=require(_0x5b59('0xd'));var deskjs=require(_0x5b59('0xe'));var toCsv=require(_0x5b59('0x8'));var querystring=require(_0x5b59('0xf'));var Papa=require(_0x5b59('0x10'));var Redis=require('ioredis');var authService=require(_0x5b59('0x11'));var qs=require(_0x5b59('0x12'));var as=require(_0x5b59('0x13'));var hardwareService=require(_0x5b59('0x14'));var logger=require(_0x5b59('0x15'))(_0x5b59('0x16'));var utils=require(_0x5b59('0x17'));var config=require(_0x5b59('0x18'));var licenseUtil=require(_0x5b59('0x19'));var db=require(_0x5b59('0x1a'))['db'];function respondWithStatusCode(_0x3a6db5,_0x51a080){_0x51a080=_0x51a080||0xcc;return function(_0xb2c7ea){if(_0xb2c7ea){return _0x3a6db5[_0x5b59('0x1b')](_0x51a080);}return _0x3a6db5[_0x5b59('0x1c')](_0x51a080)[_0x5b59('0x1d')]();};}function respondWithResult(_0x598507,_0x569c53){_0x569c53=_0x569c53||0xc8;return function(_0xec398b){if(_0xec398b){return _0x598507['status'](_0x569c53)['json'](_0xec398b);}};}function respondWithFilteredResult(_0x17575b,_0x25934e){return function(_0x4888ba){if(_0x4888ba){var _0x14b5ab=typeof _0x25934e[_0x5b59('0x1e')]==='undefined'&&typeof _0x25934e[_0x5b59('0x1f')]==='undefined';var _0x541529=_0x4888ba[_0x5b59('0x20')];var _0x24d01f=_0x14b5ab?0x0:_0x25934e[_0x5b59('0x1e')];var _0x47e02a=_0x14b5ab?_0x4888ba[_0x5b59('0x20')]:_0x25934e[_0x5b59('0x1e')]+_0x25934e['limit'];var _0x66c3ef;if(_0x47e02a>=_0x541529){_0x47e02a=_0x541529;_0x66c3ef=0xc8;}else{_0x66c3ef=0xce;}_0x17575b[_0x5b59('0x1c')](_0x66c3ef);return _0x17575b[_0x5b59('0x21')](_0x5b59('0x22'),_0x24d01f+'-'+_0x47e02a+'/'+_0x541529)['json'](_0x4888ba);}return null;};}function patchUpdates(_0x9ac4b2){return function(_0x18acbb){try{jsonpatch[_0x5b59('0x23')](_0x18acbb,_0x9ac4b2,!![]);}catch(_0x9edc0b){return BPromise[_0x5b59('0x24')](_0x9edc0b);}return _0x18acbb[_0x5b59('0x25')]();};}function saveUpdates(_0x5b41d2,_0x4a3352){return function(_0x23c062){if(_0x23c062){return _0x23c062[_0x5b59('0x26')](_0x5b41d2)[_0x5b59('0x27')](function(_0x2ac98d){return _0x2ac98d;});}return null;};}function removeEntity(_0x980eaf,_0xfbf9ce){return function(_0x315648){if(_0x315648){return _0x315648[_0x5b59('0x28')]()[_0x5b59('0x27')](function(){_0x980eaf[_0x5b59('0x1c')](0xcc)[_0x5b59('0x1d')]();});}};}function handleEntityNotFound(_0x5da825,_0x355bd0){return function(_0x6353f9){if(!_0x6353f9){_0x5da825['sendStatus'](0x194);}return _0x6353f9;};}function handleError(_0xc67c99,_0x4b5418){_0x4b5418=_0x4b5418||0x1f4;return function(_0x11ecf4){logger[_0x5b59('0x29')](_0x11ecf4['stack']);if(_0x11ecf4[_0x5b59('0x2a')]){delete _0x11ecf4[_0x5b59('0x2a')];}_0xc67c99['status'](_0x4b5418)['send'](_0x11ecf4);};}exports[_0x5b59('0x2b')]=function(_0x143573,_0x18d82f){var _0x1a73e6={},_0x2802ef={},_0x84a9b2={'count':0x0,'rows':[]};var _0x49a2e6=_[_0x5b59('0x2c')](db['VoiceDialReport']['rawAttributes'],function(_0x342b53){return{'name':_0x342b53[_0x5b59('0x2d')],'type':_0x342b53[_0x5b59('0x2e')][_0x5b59('0x2f')]};});_0x2802ef['model']=_[_0x5b59('0x2c')](_0x49a2e6,_0x5b59('0x2a'));_0x2802ef[_0x5b59('0x30')]=_['keys'](_0x143573[_0x5b59('0x30')]);_0x2802ef[_0x5b59('0x31')]=_[_0x5b59('0x32')](_0x2802ef['model'],_0x2802ef['query']);_0x1a73e6['attributes']=_['intersection'](_0x2802ef[_0x5b59('0x33')],qs[_0x5b59('0x34')](_0x143573['query']['fields']));_0x1a73e6[_0x5b59('0x35')]=_0x1a73e6[_0x5b59('0x35')][_0x5b59('0x36')]?_0x1a73e6[_0x5b59('0x35')]:_0x2802ef[_0x5b59('0x33')];if(!_0x143573[_0x5b59('0x30')]['hasOwnProperty'](_0x5b59('0x37'))){_0x1a73e6[_0x5b59('0x1f')]=qs['limit'](_0x143573[_0x5b59('0x30')]['limit']);_0x1a73e6[_0x5b59('0x1e')]=qs['offset'](_0x143573['query'][_0x5b59('0x1e')]);}_0x1a73e6[_0x5b59('0x38')]=qs['sort'](_0x143573[_0x5b59('0x30')]['sort']);_0x1a73e6[_0x5b59('0x39')]=qs[_0x5b59('0x31')](_[_0x5b59('0x3a')](_0x143573[_0x5b59('0x30')],_0x2802ef['filters']),_0x49a2e6);if(_0x143573[_0x5b59('0x30')][_0x5b59('0x3b')]){_0x1a73e6[_0x5b59('0x39')]=_[_0x5b59('0x3c')](_0x1a73e6[_0x5b59('0x39')],{'$or':_[_0x5b59('0x2c')](_0x49a2e6,function(_0x5155d9){if(_0x5155d9[_0x5b59('0x2e')]!==_0x5b59('0x3d')){var _0x3d2046={};_0x3d2046[_0x5155d9['name']]={'$like':'%'+_0x143573[_0x5b59('0x30')][_0x5b59('0x3b')]+'%'};return _0x3d2046;}})});}_0x1a73e6=_[_0x5b59('0x3c')]({},_0x1a73e6,_0x143573['options']);var _0x370a45={'where':_0x1a73e6[_0x5b59('0x39')]};return db[_0x5b59('0x3e')][_0x5b59('0x20')](_0x370a45)[_0x5b59('0x27')](function(_0x5abdd1){_0x84a9b2['count']=_0x5abdd1;if(_0x143573[_0x5b59('0x30')][_0x5b59('0x3f')]){_0x1a73e6['include']=[{'all':!![]}];}return db[_0x5b59('0x3e')][_0x5b59('0x40')](_0x1a73e6);})['then'](function(_0x5ce364){_0x84a9b2[_0x5b59('0x41')]=_0x5ce364;return _0x84a9b2;})[_0x5b59('0x27')](respondWithFilteredResult(_0x18d82f,_0x1a73e6))['catch'](handleError(_0x18d82f,null));};exports[_0x5b59('0x42')]=function(_0x2bc724,_0x2e2a7d){var _0x5e0ef3={'raw':!![],'where':{'id':_0x2bc724[_0x5b59('0x43')]['id']}},_0x34a5c2={};_0x34a5c2[_0x5b59('0x33')]=_['keys'](db['VoiceDialReport'][_0x5b59('0x44')]);_0x34a5c2['query']=_[_0x5b59('0x45')](_0x2bc724[_0x5b59('0x30')]);_0x34a5c2['filters']=_[_0x5b59('0x32')](_0x34a5c2[_0x5b59('0x33')],_0x34a5c2[_0x5b59('0x30')]);_0x5e0ef3[_0x5b59('0x35')]=_['intersection'](_0x34a5c2[_0x5b59('0x33')],qs[_0x5b59('0x34')](_0x2bc724[_0x5b59('0x30')][_0x5b59('0x34')]));_0x5e0ef3[_0x5b59('0x35')]=_0x5e0ef3['attributes'][_0x5b59('0x36')]?_0x5e0ef3[_0x5b59('0x35')]:_0x34a5c2[_0x5b59('0x33')];if(_0x2bc724[_0x5b59('0x30')][_0x5b59('0x3f')]){_0x5e0ef3[_0x5b59('0x46')]=[{'all':!![]}];}_0x5e0ef3=_[_0x5b59('0x3c')]({},_0x5e0ef3,_0x2bc724['options']);return db[_0x5b59('0x3e')]['find'](_0x5e0ef3)[_0x5b59('0x27')](handleEntityNotFound(_0x2e2a7d,null))[_0x5b59('0x27')](respondWithResult(_0x2e2a7d,null))[_0x5b59('0x47')](handleError(_0x2e2a7d,null));};exports[_0x5b59('0x48')]=function(_0x31c8c7,_0x22d1e1){return db[_0x5b59('0x3e')]['create'](_0x31c8c7[_0x5b59('0x49')],{})['then'](respondWithResult(_0x22d1e1,0xc9))['catch'](handleError(_0x22d1e1,null));};exports[_0x5b59('0x26')]=function(_0xd52200,_0x72748f){if(_0xd52200[_0x5b59('0x49')]['id']){delete _0xd52200[_0x5b59('0x49')]['id'];}return db[_0x5b59('0x3e')][_0x5b59('0x4a')]({'where':{'id':_0xd52200[_0x5b59('0x43')]['id']}})[_0x5b59('0x27')](handleEntityNotFound(_0x72748f,null))[_0x5b59('0x27')](saveUpdates(_0xd52200[_0x5b59('0x49')],null))['then'](respondWithResult(_0x72748f,null))[_0x5b59('0x47')](handleError(_0x72748f,null));};exports['destroy']=function(_0x248149,_0x374f01){return db[_0x5b59('0x3e')]['find']({'where':{'id':_0x248149[_0x5b59('0x43')]['id']}})['then'](handleEntityNotFound(_0x374f01,null))[_0x5b59('0x27')](removeEntity(_0x374f01,null))['catch'](handleError(_0x374f01,null));};exports['describe']=function(_0x5eff74,_0x2f4203){return db[_0x5b59('0x3e')][_0x5b59('0x4b')]()[_0x5b59('0x27')](respondWithResult(_0x2f4203,null))['catch'](handleError(_0x2f4203,null));};
\ No newline at end of file
index 764bed2..9829088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94ce=['api','moment','request-promise','path','rimraf','exports','define','VoiceDialReport','lodash','util'];(function(_0x538aa9,_0x4c27ed){var _0x4b99fe=function(_0x767ed){while(--_0x767ed){_0x538aa9['push'](_0x538aa9['shift']());}};_0x4b99fe(++_0x4c27ed);}(_0x94ce,0x6c));var _0xe94c=function(_0x10319c,_0x511e1d){_0x10319c=_0x10319c-0x0;var _0x4a808b=_0x94ce[_0x10319c];return _0x4a808b;};'use strict';var _=require(_0xe94c('0x0'));var util=require(_0xe94c('0x1'));var logger=require('../../config/logger')(_0xe94c('0x2'));var moment=require(_0xe94c('0x3'));var BPromise=require('bluebird');var rp=require(_0xe94c('0x4'));var fs=require('fs');var path=require(_0xe94c('0x5'));var rimraf=require(_0xe94c('0x6'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xe94c('0x7')]=function(_0x5a0c6e,_0x5d0bd9){return _0x5a0c6e[_0xe94c('0x8')](_0xe94c('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6439=['report_dial','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes'];(function(_0x106bfe,_0x22ff14){var _0x1c2267=function(_0xc06167){while(--_0xc06167){_0x106bfe['push'](_0x106bfe['shift']());}};_0x1c2267(++_0x22ff14);}(_0x6439,0x1ce));var _0x9643=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x6439[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x9643('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9643('0x1'));var moment=require(_0x9643('0x2'));var BPromise=require(_0x9643('0x3'));var rp=require(_0x9643('0x4'));var fs=require('fs');var path=require(_0x9643('0x5'));var rimraf=require(_0x9643('0x6'));var config=require('../../config/environment');var attributes=require(_0x9643('0x7'));module['exports']=function(_0x3c2a4b,_0x3c8c49){return _0x3c2a4b['define']('VoiceDialReport',attributes,{'tableName':_0x9643('0x8'),'paranoid':![],'indexes':[{'fields':[_0x9643('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 36d3700..39d7e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1507=['randomstring','ioredis','../../mysqldb','../../config/utils','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','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','body','attributes','limit','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1507,0xf7));var _0x7150=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0x1507[_0x30a528];return _0x3e029c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7150('0x0'));var rs=require(_0x7150('0x1'));var fs=require('fs');var Redis=require(_0x7150('0x2'));var db=require(_0x7150('0x3'))['db'];var utils=require(_0x7150('0x4'));var logger=require('../../config/logger')(_0x7150('0x5'));var config=require(_0x7150('0x6'));var jayson=require(_0x7150('0x7'));var client=jayson[_0x7150('0x8')][_0x7150('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17805b,_0x5a5a1d,_0x1f7473){return new BPromise(function(_0x4bf9c2,_0x228d50){return client[_0x7150('0xa')](_0x17805b,_0x1f7473)[_0x7150('0xb')](function(_0x8eb1be){logger[_0x7150('0xc')](_0x7150('0xd'),_0x5a5a1d,_0x7150('0xe'));logger[_0x7150('0xf')](_0x7150('0x10'),_0x5a5a1d,'request\x20sent',JSON['stringify'](_0x8eb1be));if(_0x8eb1be[_0x7150('0x11')]){if(_0x8eb1be[_0x7150('0x11')][_0x7150('0x12')]===0x1f4){logger[_0x7150('0x11')](_0x7150('0xd'),_0x5a5a1d,_0x8eb1be[_0x7150('0x11')]['message']);return _0x228d50(_0x8eb1be[_0x7150('0x11')][_0x7150('0x13')]);}logger[_0x7150('0x11')](_0x7150('0xd'),_0x5a5a1d,_0x8eb1be['error'][_0x7150('0x13')]);return _0x4bf9c2(_0x8eb1be['error']['message']);}else{logger[_0x7150('0xc')](_0x7150('0xd'),_0x5a5a1d,_0x7150('0xe'));_0x4bf9c2(_0x8eb1be[_0x7150('0x14')][_0x7150('0x13')]);}})[_0x7150('0x15')](function(_0x5e660a){logger[_0x7150('0x11')](_0x7150('0xd'),_0x5a5a1d,_0x5e660a);_0x228d50(_0x5e660a);});});}exports[_0x7150('0x16')]=function(_0x13d514){var _0x5cb81d=this;return new Promise(function(_0x518d11,_0x30ab8f){return db[_0x7150('0x17')][_0x7150('0x18')](_0x13d514['body'],{'raw':_0x13d514[_0x7150('0x19')]?_0x13d514[_0x7150('0x19')][_0x7150('0x1a')]===undefined?!![]:![]:!![]})[_0x7150('0xb')](function(_0x5e2aca){logger[_0x7150('0xc')](_0x7150('0x16'),_0x13d514);logger[_0x7150('0xf')](_0x7150('0x16'),_0x13d514,JSON['stringify'](_0x5e2aca));_0x518d11(_0x5e2aca);})['catch'](function(_0x4d7a22){logger[_0x7150('0x11')](_0x7150('0x16'),_0x4d7a22[_0x7150('0x13')],_0x13d514);_0x30ab8f(_0x5cb81d[_0x7150('0x11')](0x1f4,_0x4d7a22[_0x7150('0x13')]));});});};exports[_0x7150('0x1b')]=function(_0x32c7d0){var _0x2a4980=this;return new Promise(function(_0x18b871,_0x1999fa){return db[_0x7150('0x17')]['update'](_0x32c7d0[_0x7150('0x1c')],{'raw':_0x32c7d0['options']?_0x32c7d0[_0x7150('0x19')][_0x7150('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32c7d0[_0x7150('0x19')]?_0x32c7d0[_0x7150('0x19')]['where']||null:null,'attributes':_0x32c7d0['options']?_0x32c7d0[_0x7150('0x19')][_0x7150('0x1d')]||null:null,'limit':_0x32c7d0[_0x7150('0x19')]?_0x32c7d0[_0x7150('0x19')][_0x7150('0x1e')]||null:null})[_0x7150('0xb')](function(_0x1f93f7){logger[_0x7150('0xc')](_0x7150('0x1b'),_0x32c7d0);logger[_0x7150('0xf')](_0x7150('0x1b'),_0x32c7d0,JSON['stringify'](_0x1f93f7));_0x18b871(_0x1f93f7);})[_0x7150('0x15')](function(_0x21c336){logger[_0x7150('0x11')](_0x7150('0x1b'),_0x21c336[_0x7150('0x13')],_0x32c7d0);_0x1999fa(_0x2a4980[_0x7150('0x11')](0x1f4,_0x21c336[_0x7150('0x13')]));});});};
\ No newline at end of file
+var _0x9ca0=['UpdateVoiceDialReport','update','body','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceDialReport','create','options','raw','CreateVoiceDialReport','catch'];(function(_0x46fd10,_0x509185){var _0xc5283b=function(_0xbdabf7){while(--_0xbdabf7){_0x46fd10['push'](_0x46fd10['shift']());}};_0xc5283b(++_0x509185);}(_0x9ca0,0x14f));var _0x09ca=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x9ca0[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x09ca('0x0'));var util=require(_0x09ca('0x1'));var moment=require(_0x09ca('0x2'));var BPromise=require(_0x09ca('0x3'));var rs=require(_0x09ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09ca('0x5'))['db'];var utils=require(_0x09ca('0x6'));var logger=require('../../config/logger')(_0x09ca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x09ca('0x8')][_0x09ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x402d68,_0x5e2e92,_0x151e70){return new BPromise(function(_0x414ff1,_0x1014ca){return client[_0x09ca('0xa')](_0x402d68,_0x151e70)[_0x09ca('0xb')](function(_0x21cc29){logger['info'](_0x09ca('0xc'),_0x5e2e92,'request\x20sent');logger[_0x09ca('0xd')](_0x09ca('0xe'),_0x5e2e92,_0x09ca('0xf'),JSON[_0x09ca('0x10')](_0x21cc29));if(_0x21cc29[_0x09ca('0x11')]){if(_0x21cc29[_0x09ca('0x11')][_0x09ca('0x12')]===0x1f4){logger[_0x09ca('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5e2e92,_0x21cc29['error']['message']);return _0x1014ca(_0x21cc29[_0x09ca('0x11')][_0x09ca('0x13')]);}logger[_0x09ca('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5e2e92,_0x21cc29[_0x09ca('0x11')][_0x09ca('0x13')]);return _0x414ff1(_0x21cc29[_0x09ca('0x11')][_0x09ca('0x13')]);}else{logger[_0x09ca('0x14')](_0x09ca('0xc'),_0x5e2e92,_0x09ca('0xf'));_0x414ff1(_0x21cc29[_0x09ca('0x15')][_0x09ca('0x13')]);}})['catch'](function(_0x1f5ec7){logger[_0x09ca('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5e2e92,_0x1f5ec7);_0x1014ca(_0x1f5ec7);});});}exports['CreateVoiceDialReport']=function(_0x3842bf){var _0x5ccc13=this;return new Promise(function(_0x4ed70c,_0x430eb3){return db[_0x09ca('0x16')][_0x09ca('0x17')](_0x3842bf['body'],{'raw':_0x3842bf['options']?_0x3842bf[_0x09ca('0x18')][_0x09ca('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2de2f8){logger['info']('CreateVoiceDialReport',_0x3842bf);logger['debug'](_0x09ca('0x1a'),_0x3842bf,JSON[_0x09ca('0x10')](_0x2de2f8));_0x4ed70c(_0x2de2f8);})[_0x09ca('0x1b')](function(_0x552116){logger[_0x09ca('0x11')](_0x09ca('0x1a'),_0x552116[_0x09ca('0x13')],_0x3842bf);_0x430eb3(_0x5ccc13[_0x09ca('0x11')](0x1f4,_0x552116[_0x09ca('0x13')]));});});};exports[_0x09ca('0x1c')]=function(_0xc07b77){var _0x5d0627=this;return new Promise(function(_0x272d44,_0x2b3dcf){return db[_0x09ca('0x16')][_0x09ca('0x1d')](_0xc07b77[_0x09ca('0x1e')],{'raw':_0xc07b77[_0x09ca('0x18')]?_0xc07b77[_0x09ca('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc07b77[_0x09ca('0x18')]?_0xc07b77[_0x09ca('0x18')][_0x09ca('0x1f')]||null:null,'attributes':_0xc07b77[_0x09ca('0x18')]?_0xc07b77[_0x09ca('0x18')][_0x09ca('0x20')]||null:null,'limit':_0xc07b77['options']?_0xc07b77['options']['limit']||null:null})['then'](function(_0x2abe57){logger[_0x09ca('0x14')](_0x09ca('0x1c'),_0xc07b77);logger[_0x09ca('0xd')](_0x09ca('0x1c'),_0xc07b77,JSON[_0x09ca('0x10')](_0x2abe57));_0x272d44(_0x2abe57);})['catch'](function(_0x32b7c2){logger[_0x09ca('0x11')](_0x09ca('0x1c'),_0x32b7c2[_0x09ca('0x13')],_0xc07b77);_0x2b3dcf(_0x5d0627['error'](0x1f4,_0x32b7c2[_0x09ca('0x13')]));});});};
\ No newline at end of file
index b474b86..862c4f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x849c=['destroy','exports','multer','util','path','connect-timeout','get','isAuthenticated','index','show','post','/:id/applications','/:id','update','delete'];(function(_0x140202,_0x4245c7){var _0x3037c2=function(_0x525d19){while(--_0x525d19){_0x140202['push'](_0x140202['shift']());}};_0x3037c2(++_0x4245c7);}(_0x849c,0xb6));var _0xc849=function(_0x8d6714,_0x2acc4d){_0x8d6714=_0x8d6714-0x0;var _0x3fa638=_0x849c[_0x8d6714];return _0x3fa638;};'use strict';var multer=require(_0xc849('0x0'));var util=require(_0xc849('0x1'));var path=require(_0xc849('0x2'));var timeout=require(_0xc849('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xc849('0x4')]('/',auth[_0xc849('0x5')](),controller[_0xc849('0x6')]);router[_0xc849('0x4')]('/:id',auth[_0xc849('0x5')](),controller[_0xc849('0x7')]);router[_0xc849('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc849('0x8')](_0xc849('0x9'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0xc849('0xa'),auth[_0xc849('0x5')](),controller[_0xc849('0xb')]);router[_0xc849('0xc')](_0xc849('0xa'),auth[_0xc849('0x5')](),controller[_0xc849('0xd')]);module[_0xc849('0xe')]=router;
\ No newline at end of file
+var _0x8789=['index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated'];(function(_0x574b15,_0x5a3cd0){var _0xacd456=function(_0x24a04d){while(--_0x24a04d){_0x574b15['push'](_0x574b15['shift']());}};_0xacd456(++_0x5a3cd0);}(_0x8789,0x15c));var _0x9878=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8789[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x9878('0x0'));var util=require(_0x9878('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9878('0x2'));var router=express[_0x9878('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9878('0x4'));var interaction=require(_0x9878('0x5'));var config=require('../../config/environment');var controller=require(_0x9878('0x6'));router[_0x9878('0x7')]('/',auth[_0x9878('0x8')](),controller[_0x9878('0x9')]);router['get'](_0x9878('0xa'),auth[_0x9878('0x8')](),controller[_0x9878('0xb')]);router[_0x9878('0xc')]('/',auth['isAuthenticated'](),controller[_0x9878('0xd')]);router[_0x9878('0xc')](_0x9878('0xe'),auth['isAuthenticated'](),controller[_0x9878('0xf')]);router[_0x9878('0x10')](_0x9878('0xa'),auth[_0x9878('0x8')](),controller[_0x9878('0x11')]);router[_0x9878('0x12')](_0x9878('0xa'),auth[_0x9878('0x8')](),controller[_0x9878('0x13')]);module[_0x9878('0x14')]=router;
\ No newline at end of file
index d485fa1..755af8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ad2=['exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','wav','getDataValue','exten','sequelize'];(function(_0x50e32f,_0x10d483){var _0x10a4ea=function(_0x5cb010){while(--_0x5cb010){_0x50e32f['push'](_0x50e32f['shift']());}};_0x10a4ea(++_0x10d483);}(_0x4ad2,0x7d));var _0x24ad=function(_0x2cc44d,_0x422104){_0x2cc44d=_0x2cc44d-0x0;var _0x34786c=_0x4ad2[_0x2cc44d];return _0x34786c;};'use strict';var Sequelize=require(_0x24ad('0x0'));module[_0x24ad('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x24ad('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x24ad('0x3')],'allowNull':![],'unique':_0x24ad('0x2')},'priority':{'type':Sequelize[_0x24ad('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x24ad('0x2')},'tag':{'type':Sequelize[_0x24ad('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x24ad('0x3')],'allowNull':![],'defaultValue':_0x24ad('0x4')},'appdata':{'type':Sequelize[_0x24ad('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x24ad('0x5')](_0x24ad('0x6'),_0x24ad('0x7'),_0x24ad('0x8'),_0x24ad('0x9'),_0x24ad('0xa'),_0x24ad('0xb'),_0x24ad('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x24ad('0x3')]},'interval':{'type':Sequelize[_0x24ad('0x3')],'allowNull':![],'defaultValue':_0x24ad('0xd')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x24ad('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x24ad('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x24ad('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x24ad('0x3')],'defaultValue':_0x24ad('0xf')},'answer':{'type':Sequelize[_0x24ad('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x47715e){return this[_0x24ad('0x10')](_0x24ad('0x11'));}},'alias':{'type':Sequelize[_0x24ad('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0x92c5=['internal','inbound-fax','outbound-fax','system','*,*,*,*','BOOLEAN','INTEGER','wav','getDataValue','exten','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x92c5,0x191));var _0x592c=function(_0x36e006,_0x326712){_0x36e006=_0x36e006-0x0;var _0x19b83c=_0x92c5[_0x36e006];return _0x19b83c;};'use strict';var Sequelize=require('sequelize');module[_0x592c('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x592c('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x592c('0x2')],'allowNull':![],'unique':_0x592c('0x1')},'priority':{'type':Sequelize[_0x592c('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x592c('0x1')},'tag':{'type':Sequelize[_0x592c('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x592c('0x2')],'allowNull':![],'defaultValue':_0x592c('0x3')},'appdata':{'type':Sequelize[_0x592c('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x592c('0x4')](_0x592c('0x5'),_0x592c('0x6'),_0x592c('0x7'),_0x592c('0x8'),_0x592c('0x9'),_0x592c('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x592c('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x592c('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x592c('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x592c('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x592c('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x592c('0xd')]},'recordingFormat':{'type':Sequelize[_0x592c('0x2')],'defaultValue':_0x592c('0xe')},'answer':{'type':Sequelize[_0x592c('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5057d8){return this[_0x592c('0xf')](_0x592c('0x10'));}},'alias':{'type':Sequelize[_0x592c('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 392e50b..e30ea0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd44d=['isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','./voiceExtension.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','then','get','InboundRoutes','inbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','index','VoiceExtension','fieldName','filters','intersection','model','query','attributes','fields','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','create','body','outbound','startsWith','exten','concat','user','role','OutboundRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','context','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd44d,0x1c3));var _0xdd44=function(_0x2deb4d,_0x1db651){_0x2deb4d=_0x2deb4d-0x0;var _0x5f4869=_0xd44d[_0x2deb4d];return _0x5f4869;};'use strict';var _=require('lodash');var Redis=require(_0xdd44('0x0'));var qs=require(_0xdd44('0x1'));var logger=require(_0xdd44('0x2'))(_0xdd44('0x3'));var config=require(_0xdd44('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdd44('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdd44('0x6'))[_0xdd44('0x7')](socket);function respondWithStatusCode(_0x1754e9,_0xd251bc){_0xd251bc=_0xd251bc||0xcc;return function(_0x3854f9){if(_0x3854f9){return _0x1754e9['sendStatus'](_0xd251bc);}return _0x1754e9[_0xdd44('0x8')](_0xd251bc)['end']();};}function respondWithResult(_0x250434,_0x5b78bd){_0x5b78bd=_0x5b78bd||0xc8;return function(_0xd2dbf7){if(_0xd2dbf7){return _0x250434[_0xdd44('0x8')](_0x5b78bd)[_0xdd44('0x9')](_0xd2dbf7);}};}function respondWithFilteredResult(_0x3053f4,_0x50f767){return function(_0xba7967){if(_0xba7967){var _0x2991ef=typeof _0x50f767[_0xdd44('0xa')]==='undefined'&&typeof _0x50f767[_0xdd44('0xb')]===_0xdd44('0xc');var _0x50ebae=_0xba7967[_0xdd44('0xd')];var _0x29818f=_0x2991ef?0x0:_0x50f767[_0xdd44('0xa')];var _0x354e59=_0x2991ef?_0xba7967[_0xdd44('0xd')]:_0x50f767['offset']+_0x50f767[_0xdd44('0xb')];var _0x1f6f28;if(_0x354e59>=_0x50ebae){_0x354e59=_0x50ebae;_0x1f6f28=0xc8;}else{_0x1f6f28=0xce;}_0x3053f4['status'](_0x1f6f28);return _0x3053f4[_0xdd44('0xe')](_0xdd44('0xf'),_0x29818f+'-'+_0x354e59+'/'+_0x50ebae)[_0xdd44('0x9')](_0xba7967);}return null;};}function removeEntity(_0x447925){return function(_0x38f460){if(_0x38f460){return _0x38f460['destroy']()[_0xdd44('0x10')](function(){var _0x3f111b=_0x38f460[_0xdd44('0x11')]({'plain':!![]});var _0x374f50=[{'name':_0xdd44('0x12'),'value':_0xdd44('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xdd44('0x14'),'value':_0xdd44('0x15'),'ignore':![]}];var _0x473aba=_(_0x374f50)[_0xdd44('0x16')]('ignore')[_0xdd44('0x17')](_0xdd44('0x18'))[_0xdd44('0x18')]();if(_[_0xdd44('0x19')](_0x473aba,_0x3f111b[_0xdd44('0x1a')])){return;}var _0x33a232=_[_0xdd44('0x1b')](_0x374f50,['value',_0x3f111b[_0xdd44('0x1a')]])[_0xdd44('0x1c')];return db[_0xdd44('0x1d')][_0xdd44('0x1e')]({'where':{'type':_0x33a232,'resourceId':_0x3f111b['id']}})[_0xdd44('0x10')](function(){return _0x38f460;});})[_0xdd44('0x10')](function(){_0x447925[_0xdd44('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f22b1){return function(_0x329aa3){if(!_0x329aa3){_0x1f22b1[_0xdd44('0x1f')](0x194);}return _0x329aa3;};}function handleError(_0x23a4ee,_0x463f7a){_0x463f7a=_0x463f7a||0x1f4;return function(_0x2062b7){logger[_0xdd44('0x20')](_0x2062b7[_0xdd44('0x21')]);if(_0x2062b7[_0xdd44('0x1c')]){delete _0x2062b7[_0xdd44('0x1c')];}_0x23a4ee['status'](_0x463f7a)[_0xdd44('0x22')](_0x2062b7);};}exports[_0xdd44('0x23')]=function(_0x5e627b,_0x3e0780){var _0x124556={},_0x35fb19={},_0x5f80fe={'count':0x0,'rows':[]};var _0x85e30b=_[_0xdd44('0x17')](db[_0xdd44('0x24')]['rawAttributes'],function(_0x4d7e60){return{'name':_0x4d7e60[_0xdd44('0x25')],'type':_0x4d7e60[_0xdd44('0x1a')]['key']};});_0x35fb19['model']=_[_0xdd44('0x17')](_0x85e30b,_0xdd44('0x1c'));_0x35fb19['query']=_['keys'](_0x5e627b['query']);_0x35fb19[_0xdd44('0x26')]=_[_0xdd44('0x27')](_0x35fb19[_0xdd44('0x28')],_0x35fb19[_0xdd44('0x29')]);_0x124556[_0xdd44('0x2a')]=_['intersection'](_0x35fb19['model'],qs[_0xdd44('0x2b')](_0x5e627b[_0xdd44('0x29')][_0xdd44('0x2b')]));_0x124556[_0xdd44('0x2a')]=_0x124556['attributes']['length']?_0x124556[_0xdd44('0x2a')]:_0x35fb19[_0xdd44('0x28')];if(!_0x5e627b[_0xdd44('0x29')]['hasOwnProperty']('nolimit')){_0x124556[_0xdd44('0xb')]=qs[_0xdd44('0xb')](_0x5e627b[_0xdd44('0x29')]['limit']);_0x124556[_0xdd44('0xa')]=qs['offset'](_0x5e627b[_0xdd44('0x29')][_0xdd44('0xa')]);}_0x124556[_0xdd44('0x2c')]=qs[_0xdd44('0x2d')](_0x5e627b['query'][_0xdd44('0x2d')]);_0x124556['where']=qs['filters'](_[_0xdd44('0x2e')](_0x5e627b[_0xdd44('0x29')],_0x35fb19[_0xdd44('0x26')]),_0x85e30b);if(_0x5e627b[_0xdd44('0x29')]['filter']){_0x124556[_0xdd44('0x2f')]=_[_0xdd44('0x30')](_0x124556[_0xdd44('0x2f')],{'$or':_[_0xdd44('0x17')](_0x85e30b,function(_0x595253){if(_0x595253['type']!=='VIRTUAL'){var _0x370cd1={};_0x370cd1[_0x595253[_0xdd44('0x1c')]]={'$like':'%'+_0x5e627b[_0xdd44('0x29')]['filter']+'%'};return _0x370cd1;}})});}_0x124556=_[_0xdd44('0x30')]({},_0x124556,_0x5e627b[_0xdd44('0x31')]);var _0xa2661d={'where':_0x124556[_0xdd44('0x2f')]};return db['VoiceExtension']['count'](_0xa2661d)['then'](function(_0x263aaf){_0x5f80fe[_0xdd44('0xd')]=_0x263aaf;if(_0x5e627b[_0xdd44('0x29')][_0xdd44('0x32')]){_0x124556[_0xdd44('0x33')]=[{'all':!![]}];}return db[_0xdd44('0x24')][_0xdd44('0x34')](_0x124556);})[_0xdd44('0x10')](function(_0x5366f8){_0x5f80fe[_0xdd44('0x35')]=_0x5366f8;return _0x5f80fe;})[_0xdd44('0x10')](respondWithFilteredResult(_0x3e0780,_0x124556))[_0xdd44('0x36')](handleError(_0x3e0780,null));};exports['show']=function(_0x26a144,_0x1cf9d9){var _0x46d7b1={'raw':![],'where':{'id':_0x26a144[_0xdd44('0x37')]['id']}},_0x40f190={};_0x40f190['model']=_['keys'](db['VoiceExtension'][_0xdd44('0x38')]);_0x40f190['query']=_['keys'](_0x26a144[_0xdd44('0x29')]);_0x40f190[_0xdd44('0x26')]=_[_0xdd44('0x27')](_0x40f190[_0xdd44('0x28')],_0x40f190[_0xdd44('0x29')]);_0x46d7b1[_0xdd44('0x2a')]=_['intersection'](_0x40f190['model'],qs[_0xdd44('0x2b')](_0x26a144[_0xdd44('0x29')][_0xdd44('0x2b')]));_0x46d7b1[_0xdd44('0x2a')]=_0x46d7b1[_0xdd44('0x2a')][_0xdd44('0x39')]?_0x46d7b1['attributes']:_0x40f190['model'];if(_0x26a144[_0xdd44('0x29')][_0xdd44('0x32')]){_0x46d7b1[_0xdd44('0x33')]=[{'all':!![]}];}_0x46d7b1=_[_0xdd44('0x30')]({},_0x46d7b1,_0x26a144[_0xdd44('0x31')]);return db[_0xdd44('0x24')][_0xdd44('0x1b')](_0x46d7b1)[_0xdd44('0x10')](handleEntityNotFound(_0x1cf9d9,null))[_0xdd44('0x10')](respondWithResult(_0x1cf9d9,null))['catch'](handleError(_0x1cf9d9,null));};exports[_0xdd44('0x1e')]=function(_0x1834d0,_0x327d29){return db[_0xdd44('0x24')]['find']({'where':{'id':_0x1834d0['params']['id']}})['then'](handleEntityNotFound(_0x327d29,null))[_0xdd44('0x10')](removeEntity(_0x327d29,null))[_0xdd44('0x36')](handleError(_0x327d29,null));};exports[_0xdd44('0x3a')]=function(_0x1766b8,_0x1efe37){if(_0x1766b8[_0xdd44('0x3b')][_0xdd44('0x1a')]===_0xdd44('0x3c')&&!_[_0xdd44('0x3d')](_0x1766b8['body'][_0xdd44('0x3e')],'_')){_0x1766b8[_0xdd44('0x3b')][_0xdd44('0x3e')]='_'[_0xdd44('0x3f')](_0x1766b8[_0xdd44('0x3b')][_0xdd44('0x3e')]);}return db[_0xdd44('0x24')][_0xdd44('0x3a')](_0x1766b8['body'],{'raw':![]})[_0xdd44('0x10')](function(_0x1dd319){var _0x26a31d=_0x1766b8[_0xdd44('0x40')][_0xdd44('0x11')]({'plain':!![]});if(!_0x26a31d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26a31d[_0xdd44('0x41')]===_0xdd44('0x40')){var _0x359f1b=_0x1dd319[_0xdd44('0x11')]({'plain':!![]});var _0x18a9a8=[{'name':_0xdd44('0x12'),'value':'inbound'},{'name':_0xdd44('0x42'),'value':_0xdd44('0x3c')},{'name':_0xdd44('0x14'),'value':'internal'}];var _0x2ef483=_['find'](_0x18a9a8,['value',_0x359f1b['type']])['name'];return db[_0xdd44('0x43')]['find']({'where':{'name':_0x2ef483,'userProfileId':_0x26a31d['userProfileId']},'raw':!![]})['then'](function(_0x29b053){if(_0x29b053&&_0x29b053[_0xdd44('0x44')]===0x0){return db['UserProfileResource'][_0xdd44('0x3a')]({'name':_0x359f1b[_0xdd44('0x1c')],'resourceId':_0x359f1b['id'],'type':_0x29b053[_0xdd44('0x1c')],'sectionId':_0x29b053['id']},{})[_0xdd44('0x10')](function(){return _0x1dd319;});}else{return _0x1dd319;}})['catch'](function(_0x4936e4){logger['error'](_0xdd44('0x45'),_0x4936e4);throw _0x4936e4;});}return _0x1dd319;})['then'](respondWithResult(_0x1efe37,0xc9))[_0xdd44('0x36')](handleError(_0x1efe37,null));};exports['update']=function(_0x5d3f28,_0x52071f){if(_0x5d3f28[_0xdd44('0x3b')]['id']){delete _0x5d3f28['body']['id'];}return db[_0xdd44('0x24')][_0xdd44('0x1b')]({'where':{'id':_0x5d3f28['params']['id']}})[_0xdd44('0x10')](handleEntityNotFound(_0x52071f,null))[_0xdd44('0x10')](function(_0x1cc416){if(_0x1cc416){return db[_0xdd44('0x24')][_0xdd44('0x46')](_[_0xdd44('0x2e')](_0x5d3f28[_0xdd44('0x3b')],[_0xdd44('0x3e'),'context',_0xdd44('0x47'),_0xdd44('0x48'),'cutdigits',_0xdd44('0x49'),_0xdd44('0x4a')]),{'where':{'context':_0x1cc416[_0xdd44('0x4b')],'exten':_0x1cc416[_0xdd44('0x3e')]},'individualHooks':!![]})[_0xdd44('0x10')](function(_0x2f007d){return _0x2f007d;});}return null;})['then'](respondWithStatusCode(_0x52071f,null))[_0xdd44('0x36')](handleError(_0x52071f,null));};exports[_0xdd44('0x4c')]=function(_0x9aa4c7,_0x3d4b78){var _0x318cd6=_0x9aa4c7[_0xdd44('0x37')]['id'];var _0x544409=_0x9aa4c7[_0xdd44('0x3b')];var _0x405780=0xc8;var _0x46bddb=null;return db['sequelize'][_0xdd44('0x4d')]({'isolationLevel':db[_0xdd44('0x4e')][_0xdd44('0x4f')][_0xdd44('0x50')]['READ_COMMITTED']},function(_0x1688cc){return db[_0xdd44('0x24')][_0xdd44('0x51')]({'where':{'id':_0x318cd6},'transaction':_0x1688cc})[_0xdd44('0x10')](function(_0x3fb004){if(_0x3fb004){return db[_0xdd44('0x24')][_0xdd44('0x1e')]({'where':{'VoiceExtensionId':_0x318cd6},'transaction':_0x1688cc})[_0xdd44('0x10')](function(){var _0x4b65a4=_['map'](_0x544409,function(_0x5cf16e){_0x5cf16e[_0xdd44('0x52')]=_0x318cd6;_0x5cf16e[_0xdd44('0x53')]=!![];return _0x5cf16e;});return _0x3fb004[_0xdd44('0x54')](_0x4b65a4);})[_0xdd44('0x10')](function(_0x55e13c){return db[_0xdd44('0x24')][_0xdd44('0x55')](_0x55e13c,{'transaction':_0x1688cc});});}else{_0x405780=0x194;_0x46bddb=[];}});})[_0xdd44('0x10')](function(){if(_0x405780!==0x194){return db[_0xdd44('0x24')][_0xdd44('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x318cd6},'order':_0xdd44('0x57')})[_0xdd44('0x10')](function(_0x5acd30){_0x46bddb=_0x5acd30;});}})[_0xdd44('0x36')](function(_0x468da0){_0x405780=0x1f4;logger[_0xdd44('0x20')](_0x468da0[_0xdd44('0x21')]);if(_0x468da0[_0xdd44('0x1c')]){delete _0x468da0['name'];}_0x46bddb=_0x468da0;})[_0xdd44('0x58')](function(){if(_0x46bddb===null){_0x3d4b78[_0xdd44('0x1f')](_0x405780);}else{if(_0x405780===0x1f4){_0x3d4b78[_0xdd44('0x8')](_0x405780)['send'](_0x46bddb);}else{_0x3d4b78[_0xdd44('0x8')](_0x405780)['json'](_0x46bddb);}}});};
\ No newline at end of file
+var _0x29af=['options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','keys','create','body','startsWith','exten','concat','user','internal','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','localhost','./voiceExtension.socket','register','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','map','value','type','find','name','stack','send','index','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x3b342c,_0x4f2561){var _0x345546=function(_0x638b00){while(--_0x638b00){_0x3b342c['push'](_0x3b342c['shift']());}};_0x345546(++_0x4f2561);}(_0x29af,0x134));var _0xf29a=function(_0x5704e1,_0x47b4e0){_0x5704e1=_0x5704e1-0x0;var _0x2f3a97=_0x29af[_0x5704e1];return _0x2f3a97;};'use strict';var _=require(_0xf29a('0x0'));var Redis=require(_0xf29a('0x1'));var qs=require(_0xf29a('0x2'));var logger=require('../../config/logger')(_0xf29a('0x3'));var config=require(_0xf29a('0x4'));var db=require('../../mysqldb')['db'];config[_0xf29a('0x5')]=_['defaults'](config[_0xf29a('0x5')],{'host':_0xf29a('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf29a('0x7'))[_0xf29a('0x8')](socket);function respondWithStatusCode(_0x47749d,_0x33a308){_0x33a308=_0x33a308||0xcc;return function(_0x347d76){if(_0x347d76){return _0x47749d[_0xf29a('0x9')](_0x33a308);}return _0x47749d['status'](_0x33a308)[_0xf29a('0xa')]();};}function respondWithResult(_0x145dbb,_0xe6bdec){_0xe6bdec=_0xe6bdec||0xc8;return function(_0x5dcb4c){if(_0x5dcb4c){return _0x145dbb['status'](_0xe6bdec)[_0xf29a('0xb')](_0x5dcb4c);}};}function respondWithFilteredResult(_0x673ec4,_0x47303a){return function(_0x2138bf){if(_0x2138bf){var _0x263600=typeof _0x47303a[_0xf29a('0xc')]===_0xf29a('0xd')&&typeof _0x47303a['limit']===_0xf29a('0xd');var _0x19aa54=_0x2138bf[_0xf29a('0xe')];var _0x43875e=_0x263600?0x0:_0x47303a[_0xf29a('0xc')];var _0x2610ca=_0x263600?_0x2138bf[_0xf29a('0xe')]:_0x47303a['offset']+_0x47303a['limit'];var _0x53e962;if(_0x2610ca>=_0x19aa54){_0x2610ca=_0x19aa54;_0x53e962=0xc8;}else{_0x53e962=0xce;}_0x673ec4[_0xf29a('0xf')](_0x53e962);return _0x673ec4[_0xf29a('0x10')](_0xf29a('0x11'),_0x43875e+'-'+_0x2610ca+'/'+_0x19aa54)[_0xf29a('0xb')](_0x2138bf);}return null;};}function removeEntity(_0x17faf4){return function(_0x5a351f){if(_0x5a351f){return _0x5a351f[_0xf29a('0x12')]()[_0xf29a('0x13')](function(){var _0x297764=_0x5a351f[_0xf29a('0x14')]({'plain':!![]});var _0x14d1dc=[{'name':_0xf29a('0x15'),'value':_0xf29a('0x16'),'ignore':![]},{'name':_0xf29a('0x17'),'value':_0xf29a('0x18'),'ignore':![]},{'name':_0xf29a('0x19'),'value':'internal','ignore':![]}];var _0x474e1f=_(_0x14d1dc)[_0xf29a('0x1a')]('ignore')[_0xf29a('0x1b')](_0xf29a('0x1c'))[_0xf29a('0x1c')]();if(_['includes'](_0x474e1f,_0x297764[_0xf29a('0x1d')])){return;}var _0x560b73=_[_0xf29a('0x1e')](_0x14d1dc,[_0xf29a('0x1c'),_0x297764[_0xf29a('0x1d')]])[_0xf29a('0x1f')];return db['UserProfileResource'][_0xf29a('0x12')]({'where':{'type':_0x560b73,'resourceId':_0x297764['id']}})[_0xf29a('0x13')](function(){return _0x5a351f;});})[_0xf29a('0x13')](function(){_0x17faf4[_0xf29a('0xf')](0xcc)[_0xf29a('0xa')]();});}};}function handleEntityNotFound(_0x162538){return function(_0x2e03e7){if(!_0x2e03e7){_0x162538['sendStatus'](0x194);}return _0x2e03e7;};}function handleError(_0x582212,_0x5443c8){_0x5443c8=_0x5443c8||0x1f4;return function(_0x262a5f){logger['error'](_0x262a5f[_0xf29a('0x20')]);if(_0x262a5f[_0xf29a('0x1f')]){delete _0x262a5f[_0xf29a('0x1f')];}_0x582212['status'](_0x5443c8)[_0xf29a('0x21')](_0x262a5f);};}exports[_0xf29a('0x22')]=function(_0x401318,_0xc2f545){var _0x11d1a6={},_0x3f1bcc={},_0x4bb823={'count':0x0,'rows':[]};var _0x4216af=_[_0xf29a('0x1b')](db['VoiceExtension']['rawAttributes'],function(_0x4fdd1b){return{'name':_0x4fdd1b[_0xf29a('0x23')],'type':_0x4fdd1b[_0xf29a('0x1d')][_0xf29a('0x24')]};});_0x3f1bcc[_0xf29a('0x25')]=_[_0xf29a('0x1b')](_0x4216af,_0xf29a('0x1f'));_0x3f1bcc[_0xf29a('0x26')]=_['keys'](_0x401318[_0xf29a('0x26')]);_0x3f1bcc[_0xf29a('0x27')]=_[_0xf29a('0x28')](_0x3f1bcc[_0xf29a('0x25')],_0x3f1bcc[_0xf29a('0x26')]);_0x11d1a6[_0xf29a('0x29')]=_[_0xf29a('0x28')](_0x3f1bcc['model'],qs[_0xf29a('0x2a')](_0x401318['query'][_0xf29a('0x2a')]));_0x11d1a6[_0xf29a('0x29')]=_0x11d1a6[_0xf29a('0x29')][_0xf29a('0x2b')]?_0x11d1a6[_0xf29a('0x29')]:_0x3f1bcc['model'];if(!_0x401318[_0xf29a('0x26')]['hasOwnProperty'](_0xf29a('0x2c'))){_0x11d1a6[_0xf29a('0x2d')]=qs['limit'](_0x401318[_0xf29a('0x26')][_0xf29a('0x2d')]);_0x11d1a6['offset']=qs[_0xf29a('0xc')](_0x401318[_0xf29a('0x26')][_0xf29a('0xc')]);}_0x11d1a6[_0xf29a('0x2e')]=qs[_0xf29a('0x2f')](_0x401318[_0xf29a('0x26')]['sort']);_0x11d1a6[_0xf29a('0x30')]=qs[_0xf29a('0x27')](_[_0xf29a('0x31')](_0x401318['query'],_0x3f1bcc[_0xf29a('0x27')]),_0x4216af);if(_0x401318[_0xf29a('0x26')][_0xf29a('0x1a')]){_0x11d1a6[_0xf29a('0x30')]=_[_0xf29a('0x32')](_0x11d1a6[_0xf29a('0x30')],{'$or':_[_0xf29a('0x1b')](_0x4216af,function(_0x3bcba9){if(_0x3bcba9[_0xf29a('0x1d')]!==_0xf29a('0x33')){var _0x243291={};_0x243291[_0x3bcba9[_0xf29a('0x1f')]]={'$like':'%'+_0x401318['query']['filter']+'%'};return _0x243291;}})});}_0x11d1a6=_[_0xf29a('0x32')]({},_0x11d1a6,_0x401318[_0xf29a('0x34')]);var _0x27243d={'where':_0x11d1a6['where']};return db[_0xf29a('0x35')][_0xf29a('0xe')](_0x27243d)[_0xf29a('0x13')](function(_0x2801ca){_0x4bb823[_0xf29a('0xe')]=_0x2801ca;if(_0x401318[_0xf29a('0x26')][_0xf29a('0x36')]){_0x11d1a6[_0xf29a('0x37')]=[{'all':!![]}];}return db[_0xf29a('0x35')][_0xf29a('0x38')](_0x11d1a6);})[_0xf29a('0x13')](function(_0x4aab6a){_0x4bb823[_0xf29a('0x39')]=_0x4aab6a;return _0x4bb823;})['then'](respondWithFilteredResult(_0xc2f545,_0x11d1a6))[_0xf29a('0x3a')](handleError(_0xc2f545,null));};exports[_0xf29a('0x3b')]=function(_0x597d00,_0x492d41){var _0x5cf180={'raw':![],'where':{'id':_0x597d00[_0xf29a('0x3c')]['id']}},_0x36f0f3={};_0x36f0f3[_0xf29a('0x25')]=_[_0xf29a('0x3d')](db[_0xf29a('0x35')]['rawAttributes']);_0x36f0f3[_0xf29a('0x26')]=_[_0xf29a('0x3d')](_0x597d00[_0xf29a('0x26')]);_0x36f0f3[_0xf29a('0x27')]=_['intersection'](_0x36f0f3[_0xf29a('0x25')],_0x36f0f3[_0xf29a('0x26')]);_0x5cf180[_0xf29a('0x29')]=_[_0xf29a('0x28')](_0x36f0f3[_0xf29a('0x25')],qs[_0xf29a('0x2a')](_0x597d00[_0xf29a('0x26')][_0xf29a('0x2a')]));_0x5cf180[_0xf29a('0x29')]=_0x5cf180[_0xf29a('0x29')][_0xf29a('0x2b')]?_0x5cf180[_0xf29a('0x29')]:_0x36f0f3[_0xf29a('0x25')];if(_0x597d00[_0xf29a('0x26')][_0xf29a('0x36')]){_0x5cf180[_0xf29a('0x37')]=[{'all':!![]}];}_0x5cf180=_[_0xf29a('0x32')]({},_0x5cf180,_0x597d00[_0xf29a('0x34')]);return db[_0xf29a('0x35')][_0xf29a('0x1e')](_0x5cf180)['then'](handleEntityNotFound(_0x492d41,null))['then'](respondWithResult(_0x492d41,null))[_0xf29a('0x3a')](handleError(_0x492d41,null));};exports[_0xf29a('0x12')]=function(_0x42fd99,_0x25f905){return db[_0xf29a('0x35')][_0xf29a('0x1e')]({'where':{'id':_0x42fd99[_0xf29a('0x3c')]['id']}})[_0xf29a('0x13')](handleEntityNotFound(_0x25f905,null))[_0xf29a('0x13')](removeEntity(_0x25f905,null))[_0xf29a('0x3a')](handleError(_0x25f905,null));};exports[_0xf29a('0x3e')]=function(_0x45975b,_0x3a76d1){if(_0x45975b[_0xf29a('0x3f')][_0xf29a('0x1d')]===_0xf29a('0x18')&&!_[_0xf29a('0x40')](_0x45975b[_0xf29a('0x3f')][_0xf29a('0x41')],'_')){_0x45975b[_0xf29a('0x3f')][_0xf29a('0x41')]='_'[_0xf29a('0x42')](_0x45975b['body'][_0xf29a('0x41')]);}return db[_0xf29a('0x35')][_0xf29a('0x3e')](_0x45975b[_0xf29a('0x3f')],{'raw':![]})[_0xf29a('0x13')](function(_0x56e16c){var _0x348e3f=_0x45975b[_0xf29a('0x43')][_0xf29a('0x14')]({'plain':!![]});if(!_0x348e3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x348e3f['role']==='user'){var _0x4d1187=_0x56e16c[_0xf29a('0x14')]({'plain':!![]});var _0x4de4a3=[{'name':'InboundRoutes','value':_0xf29a('0x16')},{'name':_0xf29a('0x17'),'value':'outbound'},{'name':_0xf29a('0x19'),'value':_0xf29a('0x44')}];var _0x48d7f3=_['find'](_0x4de4a3,['value',_0x4d1187[_0xf29a('0x1d')]])[_0xf29a('0x1f')];return db[_0xf29a('0x45')][_0xf29a('0x1e')]({'where':{'name':_0x48d7f3,'userProfileId':_0x348e3f[_0xf29a('0x46')]},'raw':!![]})[_0xf29a('0x13')](function(_0x49713e){if(_0x49713e&&_0x49713e[_0xf29a('0x47')]===0x0){return db[_0xf29a('0x48')][_0xf29a('0x3e')]({'name':_0x4d1187[_0xf29a('0x1f')],'resourceId':_0x4d1187['id'],'type':_0x49713e[_0xf29a('0x1f')],'sectionId':_0x49713e['id']},{})[_0xf29a('0x13')](function(){return _0x56e16c;});}else{return _0x56e16c;}})[_0xf29a('0x3a')](function(_0x2cfa9a){logger[_0xf29a('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cfa9a);throw _0x2cfa9a;});}return _0x56e16c;})['then'](respondWithResult(_0x3a76d1,0xc9))[_0xf29a('0x3a')](handleError(_0x3a76d1,null));};exports[_0xf29a('0x4a')]=function(_0x839ab5,_0xeeeb25){if(_0x839ab5['body']['id']){delete _0x839ab5['body']['id'];}return db['VoiceExtension'][_0xf29a('0x1e')]({'where':{'id':_0x839ab5[_0xf29a('0x3c')]['id']}})[_0xf29a('0x13')](handleEntityNotFound(_0xeeeb25,null))[_0xf29a('0x13')](function(_0x4fc885){if(_0x4fc885){return db[_0xf29a('0x35')][_0xf29a('0x4a')](_[_0xf29a('0x31')](_0x839ab5[_0xf29a('0x3f')],['exten',_0xf29a('0x4b'),'description',_0xf29a('0x4c'),_0xf29a('0x4d'),_0xf29a('0x4e'),_0xf29a('0x4f')]),{'where':{'context':_0x4fc885[_0xf29a('0x4b')],'exten':_0x4fc885[_0xf29a('0x41')]},'individualHooks':!![]})[_0xf29a('0x13')](function(_0x151fcc){return _0x151fcc;});}return null;})['then'](respondWithStatusCode(_0xeeeb25,null))[_0xf29a('0x3a')](handleError(_0xeeeb25,null));};exports[_0xf29a('0x50')]=function(_0x43c886,_0xc91a3){var _0x197fa8=_0x43c886[_0xf29a('0x3c')]['id'];var _0x11c971=_0x43c886['body'];var _0x2c1afc=0xc8;var _0x9eeb6a=null;return db[_0xf29a('0x51')]['transaction']({'isolationLevel':db[_0xf29a('0x51')][_0xf29a('0x52')][_0xf29a('0x53')][_0xf29a('0x54')]},function(_0x10ff77){return db[_0xf29a('0x35')][_0xf29a('0x55')]({'where':{'id':_0x197fa8},'transaction':_0x10ff77})[_0xf29a('0x13')](function(_0x210843){if(_0x210843){return db['VoiceExtension'][_0xf29a('0x12')]({'where':{'VoiceExtensionId':_0x197fa8},'transaction':_0x10ff77})[_0xf29a('0x13')](function(){var _0x6a7b1c=_[_0xf29a('0x1b')](_0x11c971,function(_0x375c44){_0x375c44[_0xf29a('0x56')]=_0x197fa8;_0x375c44[_0xf29a('0x57')]=!![];return _0x375c44;});return _0x210843['createRouting'](_0x6a7b1c);})[_0xf29a('0x13')](function(_0x1e6d31){return db[_0xf29a('0x35')][_0xf29a('0x58')](_0x1e6d31,{'transaction':_0x10ff77});});}else{_0x2c1afc=0x194;_0x9eeb6a=[];}});})[_0xf29a('0x13')](function(){if(_0x2c1afc!==0x194){return db[_0xf29a('0x35')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x197fa8},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x5670de){_0x9eeb6a=_0x5670de;});}})[_0xf29a('0x3a')](function(_0x20ec95){_0x2c1afc=0x1f4;logger[_0xf29a('0x49')](_0x20ec95[_0xf29a('0x20')]);if(_0x20ec95['name']){delete _0x20ec95['name'];}_0x9eeb6a=_0x20ec95;})[_0xf29a('0x59')](function(){if(_0x9eeb6a===null){_0xc91a3[_0xf29a('0x9')](_0x2c1afc);}else{if(_0x2c1afc===0x1f4){_0xc91a3[_0xf29a('0xf')](_0x2c1afc)[_0xf29a('0x21')](_0x9eeb6a);}else{_0xc91a3[_0xf29a('0xf')](_0x2c1afc)[_0xf29a('0xb')](_0x9eeb6a);}}});};
\ No newline at end of file
index 706d4db..bc594a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db2=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x13b3d9,_0x228bb7){var _0x3c93cd=function(_0x378b2d){while(--_0x378b2d){_0x13b3d9['push'](_0x13b3d9['shift']());}};_0x3c93cd(++_0x228bb7);}(_0x6db2,0x1e0));var _0x26db=function(_0x57ff3d,_0x551fbd){_0x57ff3d=_0x57ff3d-0x0;var _0xf4ab01=_0x6db2[_0x57ff3d];return _0xf4ab01;};'use strict';var EventEmitter=require(_0x26db('0x0'));var VoiceExtension=require(_0x26db('0x1'))['db'][_0x26db('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x26db('0x3')](0x0);var events={'afterCreate':_0x26db('0x4'),'afterUpdate':_0x26db('0x5'),'afterDestroy':_0x26db('0x6')};function emitEvent(_0x4ce91a){return function(_0x32c2b8,_0x15c289,_0x41b0fb){VoiceExtensionEvents[_0x26db('0x7')](_0x4ce91a+':'+_0x32c2b8['id'],_0x32c2b8);VoiceExtensionEvents[_0x26db('0x7')](_0x4ce91a,_0x32c2b8);_0x41b0fb(null);};}for(var e in events){if(events[_0x26db('0x8')](e)){var event=events[e];VoiceExtension[_0x26db('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
+var _0x046f=['VoiceExtension','save','update','emit','exports'];(function(_0x1e5335,_0x1ae142){var _0x322907=function(_0x2bab2b){while(--_0x2bab2b){_0x1e5335['push'](_0x1e5335['shift']());}};_0x322907(++_0x1ae142);}(_0x046f,0x19f));var _0xf046=function(_0x1d3838,_0x5df7f1){_0x1d3838=_0x1d3838-0x0;var _0x3481c6=_0x046f[_0x1d3838];return _0x3481c6;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xf046('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf046('0x1'),'afterUpdate':_0xf046('0x2'),'afterDestroy':'remove'};function emitEvent(_0x54a62b){return function(_0xaaa780,_0x3fcdea,_0x9d7102){VoiceExtensionEvents[_0xf046('0x3')](_0x54a62b+':'+_0xaaa780['id'],_0xaaa780);VoiceExtensionEvents['emit'](_0x54a62b,_0xaaa780);_0x9d7102(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xf046('0x4')]=VoiceExtensionEvents;
\ No newline at end of file
index deab75b..f7108f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72d2=['answer','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','push','inbound','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','No\x20alias\x20set','CDR(destination)=','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','timeout','options','length','name','trunk','split','phone','param','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x72d2,0xb9));var _0x272d=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0x72d2[_0x2b85d5];return _0xe8c96f;};'use strict';var _=require(_0x272d('0x0'));var attributes=require(_0x272d('0x1'));module[_0x272d('0x2')]=function(_0x2b4d4e){var _0x44f502=_0x2b4d4e[_0x272d('0x3')];function _0x22e815(_0x1c5ff0){var _0x22275f=0x2;var _0x1df0ce=[{'type':_0x1c5ff0[_0x272d('0x4')],'app':_0x272d('0x5'),'appdata':_0x272d('0x6')+_0x1c5ff0[_0x272d('0x4')],'context':_0x1c5ff0[_0x272d('0x7')],'exten':_0x1c5ff0[_0x272d('0x8')],'priority':_0x22275f++,'VoiceExtensionId':_0x1c5ff0['id']},{'type':_0x1c5ff0[_0x272d('0x4')],'app':_0x1c5ff0[_0x272d('0x9')]?_0x272d('0x5'):_0x272d('0xa'),'appdata':_0x1c5ff0[_0x272d('0x9')]?'CDR(routeAlias)='+_0x1c5ff0[_0x272d('0x9')]:'No\x20alias\x20set','context':_0x1c5ff0['context'],'exten':_0x1c5ff0[_0x272d('0x8')],'priority':_0x22275f++,'VoiceExtensionId':_0x1c5ff0['id']}];if(_0x1c5ff0['type']==='inbound'){_0x1df0ce[_0x272d('0xb')]({'type':_0x272d('0xc'),'app':'Set','appdata':_0x272d('0xd')+_0x1c5ff0['id'],'context':_0x1c5ff0[_0x272d('0x7')],'exten':_0x1c5ff0[_0x272d('0x8')],'priority':_0x22275f++,'VoiceExtensionId':_0x1c5ff0['id']});}_0x1df0ce[_0x272d('0xb')]({'type':_0x1c5ff0[_0x272d('0x4')],'app':_0x272d('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1c5ff0['context'],'exten':_0x1c5ff0[_0x272d('0x8')],'priority':_0x22275f++,'VoiceExtensionId':_0x1c5ff0['id']},{'type':_0x1c5ff0[_0x272d('0x4')],'app':_0x272d('0x5'),'appdata':_0x272d('0xe'),'context':_0x1c5ff0[_0x272d('0x7')],'exten':_0x1c5ff0[_0x272d('0x8')],'priority':_0x22275f++,'VoiceExtensionId':_0x1c5ff0['id']},{'type':_0x1c5ff0[_0x272d('0x4')],'app':_0x272d('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1c5ff0[_0x272d('0x7')],'exten':_0x1c5ff0[_0x272d('0x8')],'priority':_0x22275f++,'VoiceExtensionId':_0x1c5ff0['id']});return _0x1df0ce;}function _0x35f01f(_0x222a27){var _0xf2a0a6=0x2;var _0x1f9aac=[{'type':_0x272d('0xf'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':_0x222a27[_0x272d('0x9')]?_0x272d('0x5'):_0x272d('0xa'),'appdata':_0x222a27[_0x272d('0x9')]?'CDR(routeAlias)='+_0x222a27[_0x272d('0x9')]:_0x272d('0x10'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':'Set','appdata':_0x272d('0x11')+(_0x222a27['cutdigits']?_0x272d('0x12')+_0x222a27['cutdigits']+'}':'${EXTEN}'),'context':_0x222a27['context'],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':_0x272d('0x5'),'appdata':_0x272d('0xd')+_0x222a27['id'],'context':_0x222a27['context'],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':'ExecIf','appdata':_0x272d('0x13')+(_0xf2a0a6+0x2)+'):Goto('+(_0xf2a0a6+0x1)+')','context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':_0x272d('0x5'),'appdata':_0x222a27[_0x272d('0x14')]?_0x272d('0x15')+_0x222a27[_0x272d('0x14')]+'}':_0x272d('0x16'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':'outbound','app':_0x272d('0x5'),'appdata':_0x272d('0x17'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':_0x272d('0x5'),'appdata':_0x272d('0xe'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':_0x272d('0x5'),'appdata':_0x272d('0x18'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27['exten'],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':'outbound','app':_0x272d('0x5'),'appdata':_0x272d('0x19')+_0x222a27['id'],'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']}];if(_0x222a27[_0x272d('0x1a')]('recordingFormat')&&_0x222a27['recordingFormat']!==_0x272d('0x1b')){_0x1f9aac[_0x272d('0xb')]({'type':'outbound','app':'Set','appdata':_0x272d('0x1c'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']},{'type':_0x272d('0xf'),'app':'Set','appdata':_0x272d('0x1d')+_0x222a27[_0x272d('0x1e')]||_0x272d('0x1f'),'context':_0x222a27[_0x272d('0x7')],'exten':_0x222a27[_0x272d('0x8')],'priority':_0xf2a0a6++,'VoiceExtensionId':_0x222a27['id']});}return _0x1f9aac;}function _0x504b65(_0x3a0c97,_0x544e88){var _0x175298=[{'name':'trunk','param':0x0},{'name':_0x272d('0x20'),'param':0x1},{'name':_0x272d('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x153d05={};var _0x5a7ce4=_0x544e88['split'](',');var _0x16a52a=[];for(var _0x50a050=0x0;_0x50a050<_0x175298[_0x272d('0x22')];_0x50a050++){switch(_0x175298[_0x50a050][_0x272d('0x23')]){case _0x272d('0x24'):_0x153d05[_0x272d('0x24')]=_0x5a7ce4[_0x175298[_0x50a050]['param']][_0x272d('0x25')]('/')[0x1];_0x153d05[_0x272d('0x26')]=_0x5a7ce4[_0x175298[_0x50a050][_0x272d('0x27')]][_0x272d('0x25')]('/')[0x2];_0x153d05['prefix']=_0x153d05[_0x272d('0x26')]?_0x153d05['phone']['split']('$')[0x0]:undefined;_0x153d05['phone']=_0x3a0c97[_0x272d('0x14')]?(_0x153d05[_0x272d('0x28')]||'')+_0x272d('0x12')+_0x3a0c97[_0x272d('0x14')]+'}':(_0x153d05[_0x272d('0x28')]||'')+'${EXTEN}';_0x16a52a[_0x175298[_0x50a050][_0x272d('0x27')]]=[_0x272d('0x29'),_0x153d05[_0x272d('0x24')],_0x153d05[_0x272d('0x26')]][_0x272d('0x2a')]('/');break;case _0x272d('0x21'):_0x153d05[_0x272d('0x21')]=_0x5a7ce4[_0x175298[_0x50a050][_0x272d('0x27')]];if(_0x3a0c97[_0x272d('0x1e')]!=='none'){if(_0x153d05[_0x272d('0x21')][_0x272d('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x153d05[_0x272d('0x21')]+=_0x272d('0x2c');}}else{_0x153d05[_0x272d('0x21')]=_0x153d05[_0x272d('0x21')][_0x272d('0x2d')]('U(xcally-mixmonitor-context)','');}_0x16a52a[_0x175298[_0x50a050][_0x272d('0x27')]]=_0x153d05[_0x272d('0x21')];break;default:_0x16a52a[_0x175298[_0x50a050]['param']]=_0x5a7ce4[_0x175298[_0x50a050]['param']];}}return _0x16a52a['join'](',');}function _0x2f4e3c(_0x3327d8,_0x7a5691,_0x45dd99){return new Promise(function(_0xffe8dd,_0x2e4bd0){var _0x4ea47a=[];if(_[_0x272d('0x2e')](_0x7a5691))return _0xffe8dd(_0x4ea47a);_0x44f502[_0x272d('0x2f')][_0x272d('0x30')]({'attributes':['id',_0x272d('0x31'),_0x272d('0x32')],'raw':!![]})[_0x272d('0x33')](function(_0x155982){for(var _0x18ea52=0x0,_0x35270f=0x0;_0x18ea52<_0x7a5691[_0x272d('0x22')];_0x18ea52++,_0x35270f=0x0){var _0x4fb5d1=_0x7a5691[_0x18ea52];var _0x866c4b=[];var _0x3fe60a=[];delete _0x4fb5d1['id'];if(_0x4fb5d1['interval']!==_0x272d('0x34')){_0x4fb5d1['intervals']=[_0x4fb5d1[_0x272d('0x31')]];}else{_0x4fb5d1[_0x272d('0x35')]=_0x4fb5d1[_0x272d('0x32')]?_[_0x272d('0x36')](_[_0x272d('0x37')](_0x155982,{'IntervalId':_0x4fb5d1['IntervalId']}),'interval'):[];}_0x4fb5d1[_0x272d('0x7')]=_0x3327d8[_0x272d('0x7')];_0x4fb5d1['exten']=_0x3327d8['exten'];if(_0x4fb5d1['type'])_0x4fb5d1[_0x272d('0x4')]=_0x4fb5d1[_0x272d('0x4')][_0x272d('0x38')]();if(_0x3327d8[_0x272d('0x4')]===_0x272d('0xf')){if(_0x4fb5d1[_0x272d('0x1a')](_0x272d('0x39'))&&_0x4fb5d1['tag']&&_0x4fb5d1['tag']!=='--'){_0x866c4b[_0x272d('0xb')]({'type':_0x4fb5d1['type']['toLowerCase'](),'app':_0x272d('0x5'),'appdata':_0x272d('0x3a')+_0x4fb5d1[_0x272d('0x39')],'context':_0x3327d8['context'],'exten':_0x3327d8[_0x272d('0x8')],'priority':_0x4fb5d1['intervals']['length']+_0x45dd99+_0x35270f++,'VoiceExtensionId':_0x3327d8['id']});}_0x866c4b['push']({'type':_0x4fb5d1['type']['toLowerCase'](),'app':_0x272d('0x3b'),'appdata':_0x272d('0x3c')+(_0x4fb5d1[_0x272d('0x3d')]?_0x272d('0x3e')+_0x4fb5d1[_0x272d('0x3d')]+')':_0x272d('0x3f')),'context':_0x3327d8[_0x272d('0x7')],'exten':_0x3327d8[_0x272d('0x8')],'priority':_0x4fb5d1[_0x272d('0x35')][_0x272d('0x22')]+_0x45dd99+_0x35270f++,'VoiceExtensionId':_0x3327d8['id']});}else{if(_0x4fb5d1[_0x272d('0x1a')](_0x272d('0x40'))){if(['queue','playback'][_0x272d('0x41')](_0x4fb5d1[_0x272d('0x42')]['toLowerCase']())&&_0x4fb5d1[_0x272d('0x43')]!=='custom'){if(_0x4fb5d1[_0x272d('0x40')]){_0x866c4b[_0x272d('0xb')]({'type':_0x4fb5d1[_0x272d('0x4')][_0x272d('0x38')](),'app':_0x272d('0x3b'),'appdata':_0x272d('0x44'),'context':_0x3327d8['context'],'exten':_0x3327d8[_0x272d('0x8')],'priority':_0x4fb5d1['intervals']['length']+_0x45dd99+_0x35270f++,'VoiceExtensionId':_0x3327d8['id']});_0x866c4b[_0x272d('0xb')]({'type':_0x4fb5d1['type'][_0x272d('0x38')](),'app':_0x272d('0x5'),'appdata':_0x272d('0x45'),'context':_0x3327d8[_0x272d('0x7')],'exten':_0x3327d8[_0x272d('0x8')],'priority':_0x4fb5d1['intervals'][_0x272d('0x22')]+_0x45dd99+_0x35270f++,'VoiceExtensionId':_0x3327d8['id']});}else{_0x866c4b[_0x272d('0xb')]({'type':_0x4fb5d1[_0x272d('0x4')][_0x272d('0x38')](),'app':_0x272d('0x3b'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3327d8[_0x272d('0x7')],'exten':_0x3327d8[_0x272d('0x8')],'priority':_0x4fb5d1[_0x272d('0x35')][_0x272d('0x22')]+_0x45dd99+_0x35270f++,'VoiceExtensionId':_0x3327d8['id']});_0x866c4b[_0x272d('0xb')]({'type':_0x4fb5d1[_0x272d('0x4')][_0x272d('0x38')](),'app':'Set','appdata':_0x272d('0x46'),'context':_0x3327d8['context'],'exten':_0x3327d8[_0x272d('0x8')],'priority':_0x4fb5d1['intervals'][_0x272d('0x22')]+_0x45dd99+_0x35270f++,'VoiceExtensionId':_0x3327d8['id']});}}}}for(var _0x2a8df9=0x0;_0x2a8df9<_0x4fb5d1[_0x272d('0x35')][_0x272d('0x22')];_0x2a8df9++){var _0x281fde=_0x45dd99+_0x4fb5d1[_0x272d('0x35')][_0x272d('0x22')];var _0x222a9b=_0x2a8df9===_0x4fb5d1[_0x272d('0x35')][_0x272d('0x22')]-0x1?_0x45dd99+_0x866c4b[_0x272d('0x22')]+_0x3fe60a[_0x272d('0x22')]+0x2:_0x45dd99+_0x2a8df9+0x1;_0x866c4b[_0x272d('0x47')](_0x2a8df9,0x0,{'type':_0x3327d8[_0x272d('0x4')],'app':_0x272d('0x48'),'appdata':_0x4fb5d1[_0x272d('0x35')][_0x2a8df9]+'?'+_0x3327d8[_0x272d('0x7')]+_0x272d('0x49')+_0x281fde+':'+_0x3327d8[_0x272d('0x7')]+_0x272d('0x49')+_0x222a9b,'exten':_0x3327d8[_0x272d('0x8')],'context':_0x3327d8[_0x272d('0x7')],'priority':_0x45dd99+_0x2a8df9,'VoiceExtensionId':_0x3327d8['id']});}if(_0x4fb5d1[_0x272d('0x43')]===_0x272d('0x4a'))_0x4fb5d1[_0x272d('0x4b')]=_0x504b65(_0x3327d8,_0x4fb5d1[_0x272d('0x4b')]);_0x4fb5d1[_0x272d('0x4c')]=_0x866c4b[_0x272d('0x22')]?_['last'](_0x866c4b)[_0x272d('0x4c')]+0x1:_0x45dd99;_0x4ea47a=_[_0x272d('0x4d')](_0x4ea47a,_0x866c4b,[_0x4fb5d1],_0x3fe60a);_0x45dd99=_[_0x272d('0x4e')](_0x4ea47a)[_0x272d('0x4c')]+0x1;}return _0xffe8dd(_0x4ea47a);})[_0x272d('0x4f')](function(_0x25eac5){_0x2e4bd0(_0x25eac5);});});}return _0x2b4d4e[_0x272d('0x50')](_0x272d('0x51'),attributes,{'tableName':_0x272d('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x40192f){var _0x44b330=this['get']({'plain':!![]});var _0x1be8f1=_0x44b330[_0x272d('0x4')]===_0x272d('0xf')?_0x35f01f(_0x44b330):_0x22e815(_0x44b330);return _0x2f4e3c(_0x44b330,_0x40192f,_[_0x272d('0x4e')](_0x1be8f1)['priority']+0x1)['then'](function(_0x313f2a){var _0x555a4f=_[_0x272d('0x4d')](_0x1be8f1,_0x313f2a);_0x555a4f[_0x272d('0xb')]({'type':_0x44b330[_0x272d('0x4')],'app':'Hangup','exten':_0x44b330[_0x272d('0x8')],'context':_0x44b330[_0x272d('0x7')],'priority':_[_0x272d('0x4e')](_0x555a4f)[_0x272d('0x4c')]+0x1,'VoiceExtensionId':_0x44b330['id']});return _0x555a4f;});}}});};
\ No newline at end of file
+var _0x3a0f=['catch','define','VoiceExtension','get','Hangup','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','length','name','param','split','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','join','isEmpty','Interval','findAll','interval','then','intervals','IntervalId','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat'];(function(_0x41ff59,_0x526cd3){var _0x4a52a1=function(_0x199c9a){while(--_0x199c9a){_0x41ff59['push'](_0x41ff59['shift']());}};_0x4a52a1(++_0x526cd3);}(_0x3a0f,0x145));var _0xf3a0=function(_0x411bd0,_0x50c1ab){_0x411bd0=_0x411bd0-0x0;var _0x3814a8=_0x3a0f[_0x411bd0];return _0x3814a8;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0xf3a0('0x0')]=function(_0x52e528){var _0x48624e=_0x52e528[_0xf3a0('0x1')];function _0x406407(_0x154115){var _0x31a1b4=0x2;var _0x3d0886=[{'type':_0x154115[_0xf3a0('0x2')],'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0x4')+_0x154115['type'],'context':_0x154115[_0xf3a0('0x5')],'exten':_0x154115[_0xf3a0('0x6')],'priority':_0x31a1b4++,'VoiceExtensionId':_0x154115['id']},{'type':_0x154115[_0xf3a0('0x2')],'app':_0x154115[_0xf3a0('0x7')]?'Set':_0xf3a0('0x8'),'appdata':_0x154115[_0xf3a0('0x7')]?_0xf3a0('0x9')+_0x154115[_0xf3a0('0x7')]:_0xf3a0('0xa'),'context':_0x154115[_0xf3a0('0x5')],'exten':_0x154115[_0xf3a0('0x6')],'priority':_0x31a1b4++,'VoiceExtensionId':_0x154115['id']}];if(_0x154115[_0xf3a0('0x2')]==='inbound'){_0x3d0886[_0xf3a0('0xb')]({'type':_0xf3a0('0xc'),'app':_0xf3a0('0x3'),'appdata':'CDR(routeid)='+_0x154115['id'],'context':_0x154115[_0xf3a0('0x5')],'exten':_0x154115[_0xf3a0('0x6')],'priority':_0x31a1b4++,'VoiceExtensionId':_0x154115['id']});}_0x3d0886[_0xf3a0('0xb')]({'type':_0x154115['type'],'app':'Set','appdata':_0xf3a0('0xd'),'context':_0x154115[_0xf3a0('0x5')],'exten':_0x154115[_0xf3a0('0x6')],'priority':_0x31a1b4++,'VoiceExtensionId':_0x154115['id']},{'type':_0x154115[_0xf3a0('0x2')],'app':'Set','appdata':_0xf3a0('0xe'),'context':_0x154115[_0xf3a0('0x5')],'exten':_0x154115[_0xf3a0('0x6')],'priority':_0x31a1b4++,'VoiceExtensionId':_0x154115['id']},{'type':_0x154115[_0xf3a0('0x2')],'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0xf'),'context':_0x154115[_0xf3a0('0x5')],'exten':_0x154115[_0xf3a0('0x6')],'priority':_0x31a1b4++,'VoiceExtensionId':_0x154115['id']});return _0x3d0886;}function _0x59061a(_0x486969){var _0x1be8b9=0x2;var _0x358916=[{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0x11'),'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969['exten'],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':'outbound','app':_0x486969[_0xf3a0('0x7')]?_0xf3a0('0x3'):_0xf3a0('0x8'),'appdata':_0x486969[_0xf3a0('0x7')]?_0xf3a0('0x9')+_0x486969['alias']:'No\x20alias\x20set','context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969['exten'],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0x12')+(_0x486969[_0xf3a0('0x13')]?_0xf3a0('0x14')+_0x486969[_0xf3a0('0x13')]+'}':_0xf3a0('0x15')),'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0x16')+_0x486969['id'],'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':'ExecIf','appdata':_0xf3a0('0x17')+(_0x1be8b9+0x2)+_0xf3a0('0x18')+(_0x1be8b9+0x1)+')','context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0x486969[_0xf3a0('0x13')]?_0xf3a0('0x19')+_0x486969['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x486969['context'],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0xd'),'context':_0x486969['context'],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0xe'),'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':'outbound','app':_0xf3a0('0x3'),'appdata':_0xf3a0('0xf'),'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':'outboundrouteid='+_0x486969['id'],'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']}];if(_0x486969[_0xf3a0('0x1a')](_0xf3a0('0x1b'))&&_0x486969[_0xf3a0('0x1b')]!==_0xf3a0('0x1c')){_0x358916[_0xf3a0('0xb')]({'type':'outbound','app':'Set','appdata':_0xf3a0('0x1d'),'context':_0x486969[_0xf3a0('0x5')],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']},{'type':_0xf3a0('0x10'),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0x1e')+_0x486969[_0xf3a0('0x1b')]||_0xf3a0('0x1f'),'context':_0x486969['context'],'exten':_0x486969[_0xf3a0('0x6')],'priority':_0x1be8b9++,'VoiceExtensionId':_0x486969['id']});}return _0x358916;}function _0x4547c5(_0x2e0467,_0x5e3479){var _0x352f51=[{'name':_0xf3a0('0x20'),'param':0x0},{'name':_0xf3a0('0x21'),'param':0x1},{'name':_0xf3a0('0x22'),'param':0x2},{'name':'url','param':0x3}];var _0x2354ba={};var _0x3f27f8=_0x5e3479['split'](',');var _0x5cf5ae=[];for(var _0x467004=0x0;_0x467004<_0x352f51[_0xf3a0('0x23')];_0x467004++){switch(_0x352f51[_0x467004][_0xf3a0('0x24')]){case _0xf3a0('0x20'):_0x2354ba['trunk']=_0x3f27f8[_0x352f51[_0x467004][_0xf3a0('0x25')]][_0xf3a0('0x26')]('/')[0x1];_0x2354ba['phone']=_0x3f27f8[_0x352f51[_0x467004][_0xf3a0('0x25')]][_0xf3a0('0x26')]('/')[0x2];_0x2354ba[_0xf3a0('0x27')]=_0x2354ba[_0xf3a0('0x28')]?_0x2354ba[_0xf3a0('0x28')][_0xf3a0('0x26')]('$')[0x0]:undefined;_0x2354ba[_0xf3a0('0x28')]=_0x2e0467[_0xf3a0('0x13')]?(_0x2354ba['prefix']||'')+_0xf3a0('0x14')+_0x2e0467[_0xf3a0('0x13')]+'}':(_0x2354ba[_0xf3a0('0x27')]||'')+_0xf3a0('0x15');_0x5cf5ae[_0x352f51[_0x467004][_0xf3a0('0x25')]]=[_0xf3a0('0x29'),_0x2354ba[_0xf3a0('0x20')],_0x2354ba['phone']]['join']('/');break;case _0xf3a0('0x22'):_0x2354ba[_0xf3a0('0x22')]=_0x3f27f8[_0x352f51[_0x467004][_0xf3a0('0x25')]];if(_0x2e0467['recordingFormat']!==_0xf3a0('0x1c')){if(_0x2354ba['options'][_0xf3a0('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0x2354ba[_0xf3a0('0x22')]+=_0xf3a0('0x2b');}}else{_0x2354ba[_0xf3a0('0x22')]=_0x2354ba[_0xf3a0('0x22')]['replace']('U(xcally-mixmonitor-context)','');}_0x5cf5ae[_0x352f51[_0x467004][_0xf3a0('0x25')]]=_0x2354ba[_0xf3a0('0x22')];break;default:_0x5cf5ae[_0x352f51[_0x467004][_0xf3a0('0x25')]]=_0x3f27f8[_0x352f51[_0x467004][_0xf3a0('0x25')]];}}return _0x5cf5ae[_0xf3a0('0x2c')](',');}function _0xb92bad(_0x31a9ca,_0x4bd345,_0x14a449){return new Promise(function(_0xb7b43d,_0x4435ec){var _0x104139=[];if(_[_0xf3a0('0x2d')](_0x4bd345))return _0xb7b43d(_0x104139);_0x48624e[_0xf3a0('0x2e')][_0xf3a0('0x2f')]({'attributes':['id',_0xf3a0('0x30'),'IntervalId'],'raw':!![]})[_0xf3a0('0x31')](function(_0x4835f8){for(var _0x466e5d=0x0,_0x1c2e94=0x0;_0x466e5d<_0x4bd345[_0xf3a0('0x23')];_0x466e5d++,_0x1c2e94=0x0){var _0x41d2b4=_0x4bd345[_0x466e5d];var _0x5d36d8=[];var _0x6c3bc7=[];delete _0x41d2b4['id'];if(_0x41d2b4[_0xf3a0('0x30')]!=='*,*,*,*'){_0x41d2b4[_0xf3a0('0x32')]=[_0x41d2b4[_0xf3a0('0x30')]];}else{_0x41d2b4['intervals']=_0x41d2b4[_0xf3a0('0x33')]?_['map'](_[_0xf3a0('0x34')](_0x4835f8,{'IntervalId':_0x41d2b4[_0xf3a0('0x33')]}),_0xf3a0('0x30')):[];}_0x41d2b4['context']=_0x31a9ca[_0xf3a0('0x5')];_0x41d2b4[_0xf3a0('0x6')]=_0x31a9ca[_0xf3a0('0x6')];if(_0x41d2b4[_0xf3a0('0x2')])_0x41d2b4[_0xf3a0('0x2')]=_0x41d2b4[_0xf3a0('0x2')][_0xf3a0('0x35')]();if(_0x31a9ca['type']==='outbound'){if(_0x41d2b4[_0xf3a0('0x1a')](_0xf3a0('0x36'))&&_0x41d2b4[_0xf3a0('0x36')]&&_0x41d2b4[_0xf3a0('0x36')]!=='--'){_0x5d36d8[_0xf3a0('0xb')]({'type':_0x41d2b4['type']['toLowerCase'](),'app':_0xf3a0('0x3'),'appdata':_0xf3a0('0x37')+_0x41d2b4['tag'],'context':_0x31a9ca[_0xf3a0('0x5')],'exten':_0x31a9ca[_0xf3a0('0x6')],'priority':_0x41d2b4['intervals']['length']+_0x14a449+_0x1c2e94++,'VoiceExtensionId':_0x31a9ca['id']});}_0x5d36d8[_0xf3a0('0xb')]({'type':_0x41d2b4[_0xf3a0('0x2')][_0xf3a0('0x35')](),'app':_0xf3a0('0x38'),'appdata':_0xf3a0('0x39')+(_0x41d2b4[_0xf3a0('0x3a')]?_0xf3a0('0x3b')+_0x41d2b4[_0xf3a0('0x3a')]+')':_0xf3a0('0x3c')),'context':_0x31a9ca[_0xf3a0('0x5')],'exten':_0x31a9ca[_0xf3a0('0x6')],'priority':_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')]+_0x14a449+_0x1c2e94++,'VoiceExtensionId':_0x31a9ca['id']});}else{if(_0x41d2b4[_0xf3a0('0x1a')](_0xf3a0('0x3d'))){if([_0xf3a0('0x3e'),_0xf3a0('0x3f')][_0xf3a0('0x40')](_0x41d2b4[_0xf3a0('0x41')][_0xf3a0('0x35')]())&&_0x41d2b4['appType']!==_0xf3a0('0x42')){if(_0x41d2b4['answer']){_0x5d36d8[_0xf3a0('0xb')]({'type':_0x41d2b4['type'][_0xf3a0('0x35')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x31a9ca[_0xf3a0('0x5')],'exten':_0x31a9ca[_0xf3a0('0x6')],'priority':_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')]+_0x14a449+_0x1c2e94++,'VoiceExtensionId':_0x31a9ca['id']});_0x5d36d8[_0xf3a0('0xb')]({'type':_0x41d2b4[_0xf3a0('0x2')][_0xf3a0('0x35')](),'app':_0xf3a0('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x31a9ca['context'],'exten':_0x31a9ca[_0xf3a0('0x6')],'priority':_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')]+_0x14a449+_0x1c2e94++,'VoiceExtensionId':_0x31a9ca['id']});}else{_0x5d36d8['push']({'type':_0x41d2b4[_0xf3a0('0x2')][_0xf3a0('0x35')](),'app':_0xf3a0('0x38'),'appdata':_0xf3a0('0x43'),'context':_0x31a9ca[_0xf3a0('0x5')],'exten':_0x31a9ca[_0xf3a0('0x6')],'priority':_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')]+_0x14a449+_0x1c2e94++,'VoiceExtensionId':_0x31a9ca['id']});_0x5d36d8[_0xf3a0('0xb')]({'type':_0x41d2b4[_0xf3a0('0x2')][_0xf3a0('0x35')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x31a9ca[_0xf3a0('0x5')],'exten':_0x31a9ca[_0xf3a0('0x6')],'priority':_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')]+_0x14a449+_0x1c2e94++,'VoiceExtensionId':_0x31a9ca['id']});}}}}for(var _0x2dffb6=0x0;_0x2dffb6<_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')];_0x2dffb6++){var _0xd6d70b=_0x14a449+_0x41d2b4[_0xf3a0('0x32')][_0xf3a0('0x23')];var _0x2676b4=_0x2dffb6===_0x41d2b4['intervals'][_0xf3a0('0x23')]-0x1?_0x14a449+_0x5d36d8['length']+_0x6c3bc7[_0xf3a0('0x23')]+0x2:_0x14a449+_0x2dffb6+0x1;_0x5d36d8['splice'](_0x2dffb6,0x0,{'type':_0x31a9ca[_0xf3a0('0x2')],'app':'GotoIfTime','appdata':_0x41d2b4[_0xf3a0('0x32')][_0x2dffb6]+'?'+_0x31a9ca[_0xf3a0('0x5')]+_0xf3a0('0x44')+_0xd6d70b+':'+_0x31a9ca[_0xf3a0('0x5')]+',${EXTEN},'+_0x2676b4,'exten':_0x31a9ca[_0xf3a0('0x6')],'context':_0x31a9ca['context'],'priority':_0x14a449+_0x2dffb6,'VoiceExtensionId':_0x31a9ca['id']});}if(_0x41d2b4[_0xf3a0('0x45')]===_0xf3a0('0x46'))_0x41d2b4['appdata']=_0x4547c5(_0x31a9ca,_0x41d2b4[_0xf3a0('0x47')]);_0x41d2b4[_0xf3a0('0x48')]=_0x5d36d8[_0xf3a0('0x23')]?_[_0xf3a0('0x49')](_0x5d36d8)[_0xf3a0('0x48')]+0x1:_0x14a449;_0x104139=_[_0xf3a0('0x4a')](_0x104139,_0x5d36d8,[_0x41d2b4],_0x6c3bc7);_0x14a449=_[_0xf3a0('0x49')](_0x104139)['priority']+0x1;}return _0xb7b43d(_0x104139);})[_0xf3a0('0x4b')](function(_0x2f29e9){_0x4435ec(_0x2f29e9);});});}return _0x52e528[_0xf3a0('0x4c')](_0xf3a0('0x4d'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5941e1){var _0x126ba6=this[_0xf3a0('0x4e')]({'plain':!![]});var _0xd74bb8=_0x126ba6['type']===_0xf3a0('0x10')?_0x59061a(_0x126ba6):_0x406407(_0x126ba6);return _0xb92bad(_0x126ba6,_0x5941e1,_[_0xf3a0('0x49')](_0xd74bb8)[_0xf3a0('0x48')]+0x1)['then'](function(_0x4a99b3){var _0x3a3dff=_[_0xf3a0('0x4a')](_0xd74bb8,_0x4a99b3);_0x3a3dff[_0xf3a0('0xb')]({'type':_0x126ba6[_0xf3a0('0x2')],'app':_0xf3a0('0x4f'),'exten':_0x126ba6[_0xf3a0('0x6')],'context':_0x126ba6[_0xf3a0('0x5')],'priority':_[_0xf3a0('0x49')](_0x3a3dff)[_0xf3a0('0x48')]+0x1,'VoiceExtensionId':_0x126ba6['id']});return _0x3a3dff;});}}});};
\ No newline at end of file
index 375f65f..e463ac0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c8=['debug','stringify','VoiceExtension,\x20%s,\x20%s','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2c8,0x99));var _0x8a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8a2c('0x0'));var util=require(_0x8a2c('0x1'));var moment=require(_0x8a2c('0x2'));var BPromise=require(_0x8a2c('0x3'));var rs=require(_0x8a2c('0x4'));var fs=require('fs');var Redis=require(_0x8a2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a2c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8a2c('0x7'));var client=jayson[_0x8a2c('0x8')][_0x8a2c('0x9')]({'port':0x232a});config[_0x8a2c('0xa')]=_['defaults'](config[_0x8a2c('0xa')],{'host':_0x8a2c('0xb'),'port':0x18eb});var socket=require(_0x8a2c('0xc'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x3caec4,_0x29071b,_0x4e31b5){return new BPromise(function(_0x1da83c,_0xfbf95b){return client[_0x8a2c('0xd')](_0x3caec4,_0x4e31b5)[_0x8a2c('0xe')](function(_0x1fc918){logger[_0x8a2c('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x29071b,_0x8a2c('0x10'));logger[_0x8a2c('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x29071b,_0x8a2c('0x10'),JSON[_0x8a2c('0x12')](_0x1fc918));if(_0x1fc918['error']){if(_0x1fc918['error']['code']===0x1f4){logger['error'](_0x8a2c('0x13'),_0x29071b,_0x1fc918[_0x8a2c('0x14')][_0x8a2c('0x15')]);return _0xfbf95b(_0x1fc918['error']['message']);}logger[_0x8a2c('0x14')](_0x8a2c('0x13'),_0x29071b,_0x1fc918[_0x8a2c('0x14')][_0x8a2c('0x15')]);return _0x1da83c(_0x1fc918[_0x8a2c('0x14')][_0x8a2c('0x15')]);}else{logger[_0x8a2c('0xf')](_0x8a2c('0x13'),_0x29071b,'request\x20sent');_0x1da83c(_0x1fc918['result'][_0x8a2c('0x15')]);}})[_0x8a2c('0x16')](function(_0x4057f7){logger[_0x8a2c('0x14')](_0x8a2c('0x13'),_0x29071b,_0x4057f7);_0xfbf95b(_0x4057f7);});});}exports[_0x8a2c('0x17')]=function(_0x2fac98){var _0x557b5f=this;return new Promise(function(_0x3d094d,_0x4a8d1e){return db[_0x8a2c('0x18')][_0x8a2c('0x19')]({'raw':_0x2fac98[_0x8a2c('0x1a')]?_0x2fac98[_0x8a2c('0x1a')][_0x8a2c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2fac98[_0x8a2c('0x1a')]?_0x2fac98[_0x8a2c('0x1a')][_0x8a2c('0x1c')]||null:null,'attributes':_0x2fac98[_0x8a2c('0x1a')]?_0x2fac98[_0x8a2c('0x1a')]['attributes']||null:null,'limit':_0x2fac98[_0x8a2c('0x1a')]?_0x2fac98['options'][_0x8a2c('0x1d')]||null:null,'include':_0x2fac98[_0x8a2c('0x1a')]?_0x2fac98[_0x8a2c('0x1a')][_0x8a2c('0x1e')]?_[_0x8a2c('0x1f')](_0x2fac98[_0x8a2c('0x1a')]['include'],function(_0x4be02e){return{'model':db[_0x4be02e[_0x8a2c('0x20')]],'as':_0x4be02e['as'],'attributes':_0x4be02e[_0x8a2c('0x21')],'include':_0x4be02e[_0x8a2c('0x1e')]?_[_0x8a2c('0x1f')](_0x4be02e['include'],function(_0x3334b8){return{'model':db[_0x3334b8[_0x8a2c('0x20')]],'as':_0x3334b8['as'],'attributes':_0x3334b8[_0x8a2c('0x21')],'include':_0x3334b8[_0x8a2c('0x1e')]?_[_0x8a2c('0x1f')](_0x3334b8[_0x8a2c('0x1e')],function(_0x57c59e){return{'model':db[_0x57c59e[_0x8a2c('0x20')]],'as':_0x57c59e['as'],'attributes':_0x57c59e[_0x8a2c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8a2c('0xe')](function(_0x4ee754){logger[_0x8a2c('0xf')]('GetVoiceExtension',_0x2fac98);logger[_0x8a2c('0x11')]('GetVoiceExtension',_0x2fac98,JSON['stringify'](_0x4ee754));_0x3d094d(_0x4ee754);})[_0x8a2c('0x16')](function(_0x2be286){logger['error'](_0x8a2c('0x17'),_0x2be286[_0x8a2c('0x15')],_0x2fac98);_0x4a8d1e(_0x557b5f[_0x8a2c('0x14')](0x1f4,_0x2be286['message']));});});};
\ No newline at end of file
+var _0x1a61=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','include','model','attributes','map','lodash','moment','randomstring','ioredis'];(function(_0x5c8fd3,_0x1a09f7){var _0x55cc24=function(_0x89f34b){while(--_0x89f34b){_0x5c8fd3['push'](_0x5c8fd3['shift']());}};_0x55cc24(++_0x1a09f7);}(_0x1a61,0x1e6));var _0x11a6=function(_0x54a907,_0xeaaa2f){_0x54a907=_0x54a907-0x0;var _0x1d89de=_0x1a61[_0x54a907];return _0x1d89de;};'use strict';var _=require(_0x11a6('0x0'));var util=require('util');var moment=require(_0x11a6('0x1'));var BPromise=require('bluebird');var rs=require(_0x11a6('0x2'));var fs=require('fs');var Redis=require(_0x11a6('0x3'));var db=require(_0x11a6('0x4'))['db'];var utils=require(_0x11a6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x11a6('0x6'));var jayson=require(_0x11a6('0x7'));var client=jayson['client'][_0x11a6('0x8')]({'port':0x232a});config[_0x11a6('0x9')]=_[_0x11a6('0xa')](config[_0x11a6('0x9')],{'host':_0x11a6('0xb'),'port':0x18eb});var socket=require(_0x11a6('0xc'))(new Redis(config[_0x11a6('0x9')]));require(_0x11a6('0xd'))[_0x11a6('0xe')](socket);function respondWithRpcPromise(_0x4bb1d0,_0x59f611,_0x522315){return new BPromise(function(_0xf7f73d,_0x3cf410){return client['request'](_0x4bb1d0,_0x522315)[_0x11a6('0xf')](function(_0x91835f){logger[_0x11a6('0x10')](_0x11a6('0x11'),_0x59f611,_0x11a6('0x12'));logger[_0x11a6('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x59f611,'request\x20sent',JSON[_0x11a6('0x14')](_0x91835f));if(_0x91835f[_0x11a6('0x15')]){if(_0x91835f['error'][_0x11a6('0x16')]===0x1f4){logger[_0x11a6('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x59f611,_0x91835f[_0x11a6('0x15')][_0x11a6('0x17')]);return _0x3cf410(_0x91835f['error'][_0x11a6('0x17')]);}logger[_0x11a6('0x15')](_0x11a6('0x11'),_0x59f611,_0x91835f[_0x11a6('0x15')]['message']);return _0xf7f73d(_0x91835f[_0x11a6('0x15')][_0x11a6('0x17')]);}else{logger[_0x11a6('0x10')](_0x11a6('0x11'),_0x59f611,_0x11a6('0x12'));_0xf7f73d(_0x91835f[_0x11a6('0x18')][_0x11a6('0x17')]);}})[_0x11a6('0x19')](function(_0x312cc6){logger[_0x11a6('0x15')](_0x11a6('0x11'),_0x59f611,_0x312cc6);_0x3cf410(_0x312cc6);});});}exports[_0x11a6('0x1a')]=function(_0x25a4c5){var _0x1e8b38=this;return new Promise(function(_0x595d3c,_0x485a4f){return db[_0x11a6('0x1b')][_0x11a6('0x1c')]({'raw':_0x25a4c5[_0x11a6('0x1d')]?_0x25a4c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x25a4c5[_0x11a6('0x1d')]?_0x25a4c5['options'][_0x11a6('0x1e')]||null:null,'attributes':_0x25a4c5['options']?_0x25a4c5['options']['attributes']||null:null,'limit':_0x25a4c5['options']?_0x25a4c5[_0x11a6('0x1d')]['limit']||null:null,'include':_0x25a4c5[_0x11a6('0x1d')]?_0x25a4c5[_0x11a6('0x1d')]['include']?_['map'](_0x25a4c5[_0x11a6('0x1d')][_0x11a6('0x1f')],function(_0x34e230){return{'model':db[_0x34e230[_0x11a6('0x20')]],'as':_0x34e230['as'],'attributes':_0x34e230[_0x11a6('0x21')],'include':_0x34e230[_0x11a6('0x1f')]?_[_0x11a6('0x22')](_0x34e230[_0x11a6('0x1f')],function(_0x111e74){return{'model':db[_0x111e74[_0x11a6('0x20')]],'as':_0x111e74['as'],'attributes':_0x111e74[_0x11a6('0x21')],'include':_0x111e74[_0x11a6('0x1f')]?_[_0x11a6('0x22')](_0x111e74[_0x11a6('0x1f')],function(_0x304ad8){return{'model':db[_0x304ad8[_0x11a6('0x20')]],'as':_0x304ad8['as'],'attributes':_0x304ad8[_0x11a6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x11a6('0xf')](function(_0x44c92d){logger[_0x11a6('0x10')](_0x11a6('0x1a'),_0x25a4c5);logger[_0x11a6('0x13')](_0x11a6('0x1a'),_0x25a4c5,JSON[_0x11a6('0x14')](_0x44c92d));_0x595d3c(_0x44c92d);})[_0x11a6('0x19')](function(_0x56f74d){logger[_0x11a6('0x15')]('GetVoiceExtension',_0x56f74d[_0x11a6('0x17')],_0x25a4c5);_0x485a4f(_0x1e8b38[_0x11a6('0x15')](0x1f4,_0x56f74d[_0x11a6('0x17')]));});});};
\ No newline at end of file
index a479069..3f0da7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0xa02af,_0x28b026){var _0x52cac0=function(_0xeb2fc0){while(--_0xeb2fc0){_0xa02af['push'](_0xa02af['shift']());}};_0x52cac0(++_0x28b026);}(_0x7a54,0x106));var _0x47a5=function(_0x55d470,_0x2302e1){_0x55d470=_0x55d470-0x0;var _0x35e2b2=_0x7a54[_0x55d470];return _0x35e2b2;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x3df537,_0x2bfd0f){var _0x57c3f1=function(_0x57d47d){while(--_0x57d47d){_0x3df537['push'](_0x3df537['shift']());}};_0x57c3f1(++_0x2bfd0f);}(_0xf494,0x1c6));var _0x4f49=function(_0x1a2a43,_0x59bd00){_0x1a2a43=_0x1a2a43-0x0;var _0x3ec17d=_0xf494[_0x1a2a43];return _0x3ec17d;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}};
\ No newline at end of file
index 9f22981..5443090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3ed996,_0x37e598){var _0x112151=function(_0x33ced4){while(--_0x33ced4){_0x3ed996['push'](_0x3ed996['shift']());}};_0x112151(++_0x37e598);}(_0x687b,0x14a));var _0xb687=function(_0x2e1ef0,_0x15c4fb){_0x2e1ef0=_0x2e1ef0-0x0;var _0x1146b2=_0x687b[_0x2e1ef0];return _0x1146b2;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id/messages',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x11')](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x12')]);router['delete'](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);module[_0xb687('0x14')]=router;
\ No newline at end of file
+var _0x4819=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','/:id','show','get','/:id/messages','getMessages','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3c803f,_0x84ed6b){var _0xac34da=function(_0x573731){while(--_0x573731){_0x3c803f['push'](_0x3c803f['shift']());}};_0xac34da(++_0x84ed6b);}(_0x4819,0xcd));var _0x9481=function(_0x17a0a0,_0x1befaa){_0x17a0a0=_0x17a0a0-0x0;var _0x4da752=_0x4819[_0x17a0a0];return _0x4da752;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['post']('/',auth[_0x9481('0xa')](),controller['create']);router[_0x9481('0x10')](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0x11')]);router[_0x9481('0x12')](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0x13')]);module[_0x9481('0x14')]=router;
\ No newline at end of file
index c05486d..bfc718b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x224e=['STRING','from-voicemail','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','exports'];(function(_0x4b4c5a,_0x2036e0){var _0x2b30bc=function(_0x126322){while(--_0x126322){_0x4b4c5a['push'](_0x4b4c5a['shift']());}};_0x2b30bc(++_0x2036e0);}(_0x224e,0x10f));var _0xe224=function(_0x5d3e5d,_0x427929){_0x5d3e5d=_0x5d3e5d-0x0;var _0x2c37d8=_0x224e[_0x5d3e5d];return _0x2c37d8;};'use strict';var Sequelize=require('sequelize');module[_0xe224('0x0')]={'customer_id':{'type':Sequelize[_0xe224('0x1')]},'context':{'type':Sequelize[_0xe224('0x1')],'defaultValue':_0xe224('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xe224('0x1')]},'fullname':{'type':Sequelize[_0xe224('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3ccd8e){this[_0xe224('0x3')](_0xe224('0x4'),typeof _0x3ccd8e===_0xe224('0x5')&&_0x3ccd8e[_0xe224('0x6')]()?_0x3ccd8e[_0xe224('0x6')]():null);}},'pager':{'type':Sequelize[_0xe224('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xe224('0x7')]('yes','no'),'defaultValue':_0xe224('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe224('0x7')]('yes','no'),'defaultValue':_0xe224('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe224('0x1')]},'callback':{'type':Sequelize[_0xe224('0x1')]},'review':{'type':Sequelize[_0xe224('0x7')](_0xe224('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe224('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe224('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe224('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe224('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe224('0x7')](_0xe224('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe224('0x7')](_0xe224('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe224('0x7')](_0xe224('0x8'),'no'),'defaultValue':_0xe224('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xe224('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe224('0x7')](_0xe224('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe224('0x7')](_0xe224('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xe224('0xa')},'emailsubject':{'type':Sequelize[_0xe224('0x1')]},'emailbody':{'type':Sequelize[_0xe224('0x1')]},'maxsecs':{'type':Sequelize[_0xe224('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe224('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe224('0xc')](_0xe224('0xd'))+_0xe224('0xe')+this['getDataValue'](_0xe224('0xf'));}}};
\ No newline at end of file
+var _0xa958=['STRING','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','from-voicemail'];(function(_0x186697,_0x2997e2){var _0x2c0a69=function(_0x23c1f0){while(--_0x23c1f0){_0x186697['push'](_0x186697['shift']());}};_0x2c0a69(++_0x2997e2);}(_0xa958,0xee));var _0x8a95=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xa958[_0x279d37];return _0x530173;};'use strict';var Sequelize=require(_0x8a95('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x8a95('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x8a95('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8a95('0x3')},'password':{'type':Sequelize[_0x8a95('0x2')]},'fullname':{'type':Sequelize[_0x8a95('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x50bc5f){this[_0x8a95('0x4')]('email',typeof _0x50bc5f===_0x8a95('0x5')&&_0x50bc5f[_0x8a95('0x6')]()?_0x50bc5f['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x8a95('0x7')},'attach':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':_0x8a95('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8a95('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x8a95('0x2')]},'callback':{'type':Sequelize[_0x8a95('0x2')]},'review':{'type':Sequelize['ENUM'](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8a95('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':_0x8a95('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8a95('0x8')](_0x8a95('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x8a95('0x9'),'no'),'defaultValue':_0x8a95('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x8a95('0x2')]},'emailbody':{'type':Sequelize[_0x8a95('0x2')]},'maxsecs':{'type':Sequelize[_0x8a95('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8a95('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8a95('0xc')],'get':function(){return this[_0x8a95('0xd')](_0x8a95('0xe'))+'\x20-\x20'+this[_0x8a95('0xd')](_0x8a95('0xf'));}}};
\ No newline at end of file
index 3011b32..4df757a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','VoiceMailMessage','nolimit','mailbox','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','end','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys'];(function(_0x15cc29,_0x298986){var _0x316574=function(_0x1ce2ee){while(--_0x1ce2ee){_0x15cc29['push'](_0x15cc29['shift']());}};_0x316574(++_0x298986);}(_0x34b7,0x196));var _0x734b=function(_0x3d0366,_0x50211a){_0x3d0366=_0x3d0366-0x0;var _0x5ce75e=_0x34b7[_0x3d0366];return _0x5ce75e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){var _0x104fff=_0x46d432[_0x734b('0x26')]({'plain':!![]});var _0x3abbe6=_0x734b('0x27');return db[_0x734b('0x28')][_0x734b('0x25')]({'where':{'type':_0x3abbe6,'resourceId':_0x104fff['id']}})['then'](function(){return _0x46d432;});})['then'](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x29')]();});}};}function handleEntityNotFound(_0x47a0a9,_0x32ea00){return function(_0x2dd51a){if(!_0x2dd51a){_0x47a0a9[_0x734b('0x18')](0x194);}return _0x2dd51a;};}function handleError(_0x41b501,_0x43edea){_0x43edea=_0x43edea||0x1f4;return function(_0x1b8295){logger[_0x734b('0x2a')](_0x1b8295['stack']);if(_0x1b8295[_0x734b('0x2b')]){delete _0x1b8295[_0x734b('0x2b')];}_0x41b501[_0x734b('0x19')](_0x43edea)[_0x734b('0x2c')](_0x1b8295);};}exports[_0x734b('0x2d')]=function(_0x427c36,_0x1fed72){var _0x21ed3c={},_0x371ead={},_0x3065b0={'count':0x0,'rows':[]};var _0x5dcabf=_[_0x734b('0x2e')](db[_0x734b('0x2f')]['rawAttributes'],function(_0xbbe037){return{'name':_0xbbe037[_0x734b('0x30')],'type':_0xbbe037[_0x734b('0x31')][_0x734b('0x32')]};});_0x371ead[_0x734b('0x33')]=_[_0x734b('0x2e')](_0x5dcabf,_0x734b('0x2b'));_0x371ead[_0x734b('0x34')]=_[_0x734b('0x35')](_0x427c36[_0x734b('0x34')]);_0x371ead[_0x734b('0x36')]=_[_0x734b('0x37')](_0x371ead[_0x734b('0x33')],_0x371ead[_0x734b('0x34')]);_0x21ed3c[_0x734b('0x38')]=_['intersection'](_0x371ead[_0x734b('0x33')],qs['fields'](_0x427c36[_0x734b('0x34')][_0x734b('0x39')]));_0x21ed3c[_0x734b('0x38')]=_0x21ed3c[_0x734b('0x38')][_0x734b('0x3a')]?_0x21ed3c[_0x734b('0x38')]:_0x371ead['model'];if(!_0x427c36['query'][_0x734b('0x3b')]('nolimit')){_0x21ed3c[_0x734b('0x1e')]=qs['limit'](_0x427c36[_0x734b('0x34')]['limit']);_0x21ed3c[_0x734b('0x1b')]=qs['offset'](_0x427c36[_0x734b('0x34')][_0x734b('0x1b')]);}_0x21ed3c[_0x734b('0x3c')]=qs[_0x734b('0x3d')](_0x427c36[_0x734b('0x34')][_0x734b('0x3d')]);_0x21ed3c[_0x734b('0x3e')]=qs['filters'](_[_0x734b('0x3f')](_0x427c36[_0x734b('0x34')],_0x371ead['filters']),_0x5dcabf);if(_0x427c36[_0x734b('0x34')][_0x734b('0x40')]){_0x21ed3c[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x21ed3c['where'],{'$or':_[_0x734b('0x2e')](_0x5dcabf,function(_0x352d28){if(_0x352d28['type']!==_0x734b('0x42')){var _0x1e1689={};_0x1e1689[_0x352d28['name']]={'$like':'%'+_0x427c36[_0x734b('0x34')][_0x734b('0x40')]+'%'};return _0x1e1689;}})});}_0x21ed3c=_[_0x734b('0x41')]({},_0x21ed3c,_0x427c36[_0x734b('0x43')]);var _0x56eb35={'where':_0x21ed3c['where']};return db[_0x734b('0x2f')]['count'](_0x56eb35)['then'](function(_0x121a00){_0x3065b0['count']=_0x121a00;if(_0x427c36[_0x734b('0x34')]['includeAll']){_0x21ed3c[_0x734b('0x44')]=[{'all':!![]}];}return db[_0x734b('0x2f')][_0x734b('0x45')](_0x21ed3c);})['then'](function(_0x5cf3a0){_0x3065b0[_0x734b('0x46')]=_0x5cf3a0;return _0x3065b0;})['then'](respondWithFilteredResult(_0x1fed72,_0x21ed3c))['catch'](handleError(_0x1fed72,null));};exports[_0x734b('0x47')]=function(_0x159db9,_0x58f78a){var _0x2e789e={'raw':!![],'where':{'id':_0x159db9[_0x734b('0x48')]['id']}},_0x513f07={};_0x513f07[_0x734b('0x33')]=_[_0x734b('0x35')](db['VoiceMail'][_0x734b('0x49')]);_0x513f07[_0x734b('0x34')]=_[_0x734b('0x35')](_0x159db9[_0x734b('0x34')]);_0x513f07['filters']=_['intersection'](_0x513f07['model'],_0x513f07[_0x734b('0x34')]);_0x2e789e['attributes']=_['intersection'](_0x513f07[_0x734b('0x33')],qs['fields'](_0x159db9[_0x734b('0x34')][_0x734b('0x39')]));_0x2e789e[_0x734b('0x38')]=_0x2e789e[_0x734b('0x38')]['length']?_0x2e789e[_0x734b('0x38')]:_0x513f07['model'];if(_0x159db9[_0x734b('0x34')][_0x734b('0x4a')]){_0x2e789e[_0x734b('0x44')]=[{'all':!![]}];}_0x2e789e=_['merge']({},_0x2e789e,_0x159db9[_0x734b('0x43')]);return db['VoiceMail'][_0x734b('0x4b')](_0x2e789e)[_0x734b('0x24')](handleEntityNotFound(_0x58f78a,null))['then'](respondWithResult(_0x58f78a,null))[_0x734b('0x4c')](handleError(_0x58f78a,null));};exports[_0x734b('0x4d')]=function(_0x145ced,_0x38125a){return db[_0x734b('0x2f')]['create'](_0x145ced[_0x734b('0x4e')],{})['then'](function(_0x171575){var _0x5de7b7=_0x145ced[_0x734b('0x4f')][_0x734b('0x26')]({'plain':!![]});if(!_0x5de7b7)throw new Error(_0x734b('0x50'));if(_0x5de7b7[_0x734b('0x51')]===_0x734b('0x4f')){var _0x4b70f2=_0x171575['get']({'plain':!![]});var _0x484156=_0x734b('0x27');return db[_0x734b('0x52')]['find']({'where':{'name':_0x484156,'userProfileId':_0x5de7b7[_0x734b('0x53')]},'raw':!![]})[_0x734b('0x24')](function(_0x588ceb){if(_0x588ceb&&_0x588ceb[_0x734b('0x54')]===0x0){return db[_0x734b('0x28')][_0x734b('0x4d')]({'name':_0x4b70f2['name'],'resourceId':_0x4b70f2['id'],'type':_0x588ceb[_0x734b('0x2b')],'sectionId':_0x588ceb['id']},{})[_0x734b('0x24')](function(){return _0x171575;});}else{return _0x171575;}})[_0x734b('0x4c')](function(_0xe605be){logger['error'](_0x734b('0x55'),_0xe605be);throw _0xe605be;});}return _0x171575;})[_0x734b('0x24')](respondWithResult(_0x38125a,0xc9))[_0x734b('0x4c')](handleError(_0x38125a,null));};exports[_0x734b('0x56')]=function(_0x4b65bf,_0x27f0ff){if(_0x4b65bf['body']['id']){delete _0x4b65bf[_0x734b('0x4e')]['id'];}return db[_0x734b('0x2f')][_0x734b('0x4b')]({'where':{'id':_0x4b65bf[_0x734b('0x48')]['id']}})['then'](handleEntityNotFound(_0x27f0ff,null))[_0x734b('0x24')](saveUpdates(_0x4b65bf[_0x734b('0x4e')],null))['then'](respondWithResult(_0x27f0ff,null))['catch'](handleError(_0x27f0ff,null));};exports[_0x734b('0x25')]=function(_0x577735,_0x16b461){return db[_0x734b('0x2f')][_0x734b('0x4b')]({'where':{'id':_0x577735['params']['id']}})[_0x734b('0x24')](handleEntityNotFound(_0x16b461,null))['then'](removeEntity(_0x16b461,null))[_0x734b('0x4c')](handleError(_0x16b461,null));};exports[_0x734b('0x57')]=function(_0x3c3359,_0x10660d,_0x49a43b){return db[_0x734b('0x2f')]['findOne']({'where':{'id':_0x3c3359[_0x734b('0x48')]['id']}})[_0x734b('0x24')](handleEntityNotFound(_0x10660d,null))[_0x734b('0x24')](function(_0x59b7d8){var _0x18e187;var _0x55c699={},_0x2c81a1={};_0x2c81a1[_0x734b('0x33')]=_[_0x734b('0x35')](db[_0x734b('0x58')]['rawAttributes']);_0x2c81a1[_0x734b('0x34')]=_['keys'](_0x3c3359[_0x734b('0x34')]);_0x2c81a1[_0x734b('0x36')]=_[_0x734b('0x37')](_0x2c81a1['model'],_0x2c81a1[_0x734b('0x34')]);_0x55c699[_0x734b('0x38')]=_[_0x734b('0x37')](_0x2c81a1[_0x734b('0x33')],qs[_0x734b('0x39')](_0x3c3359[_0x734b('0x34')][_0x734b('0x39')]));_0x55c699['attributes']=_0x55c699[_0x734b('0x38')][_0x734b('0x3a')]?_0x55c699[_0x734b('0x38')]:_0x2c81a1['model'];if(!_0x3c3359['query'][_0x734b('0x3b')](_0x734b('0x59'))){_0x55c699[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x3c3359['query']['limit']);_0x55c699['offset']=qs[_0x734b('0x1b')](_0x3c3359[_0x734b('0x34')][_0x734b('0x1b')]);}_0x55c699[_0x734b('0x3c')]=qs[_0x734b('0x3d')](_0x3c3359[_0x734b('0x34')][_0x734b('0x3d')]);_0x55c699[_0x734b('0x3e')]=qs[_0x734b('0x36')](_[_0x734b('0x3f')](_0x3c3359[_0x734b('0x34')],_0x2c81a1[_0x734b('0x36')]));if(_0x3c3359[_0x734b('0x34')][_0x734b('0x40')]){_0x55c699[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x55c699[_0x734b('0x3e')],{'$or':_[_0x734b('0x2e')](_0x55c699[_0x734b('0x38')],function(_0x39d4e7){var _0x379a33={};_0x379a33[_0x39d4e7]={'$like':'%'+_0x3c3359['query'][_0x734b('0x40')]+'%'};return _0x379a33;})});}_0x55c699[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x55c699[_0x734b('0x3e')],{'mailboxuser':_0x59b7d8[_0x734b('0x5a')]});_0x55c699=_['merge']({},_0x55c699,_0x3c3359[_0x734b('0x43')]);return db[_0x734b('0x58')][_0x734b('0x5b')](_0x55c699)[_0x734b('0x24')](respondWithFilteredResult(_0x10660d,_0x55c699));})[_0x734b('0x4c')](handleError(_0x10660d,null));};
\ No newline at end of file
+var _0x5423=['offset','undefined','count','limit','set','Content-Range','reject','destroy','get','Voicemails','UserProfileResource','then','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','model','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','intersection','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','update','params','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x1daf98,_0x1b7631){var _0xe3c11c=function(_0x38ad09){while(--_0x38ad09){_0x1daf98['push'](_0x1daf98['shift']());}};_0xe3c11c(++_0x1b7631);}(_0x5423,0xe3));var _0x3542=function(_0x1ccd3c,_0x4b1c23){_0x1ccd3c=_0x1ccd3c-0x0;var _0x1db07e=_0x5423[_0x1ccd3c];return _0x1db07e;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){var _0x160caa=_0x5d05b2[_0x3542('0x24')]({'plain':!![]});var _0x1e0723=_0x3542('0x25');return db[_0x3542('0x26')][_0x3542('0x23')]({'where':{'type':_0x1e0723,'resourceId':_0x160caa['id']}})[_0x3542('0x27')](function(){return _0x5d05b2;});})[_0x3542('0x27')](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0xfdfe62,_0x4462c4){return function(_0x220021){if(!_0x220021){_0xfdfe62[_0x3542('0x18')](0x194);}return _0x220021;};}function handleError(_0x1cab35,_0x39050a){_0x39050a=_0x39050a||0x1f4;return function(_0x303412){logger[_0x3542('0x28')](_0x303412[_0x3542('0x29')]);if(_0x303412['name']){delete _0x303412[_0x3542('0x2a')];}_0x1cab35[_0x3542('0x19')](_0x39050a)[_0x3542('0x2b')](_0x303412);};}exports['index']=function(_0x402c97,_0xc6f23b){var _0x2e883a={},_0x30b5e8={},_0x5c882f={'count':0x0,'rows':[]};var _0x5a274b=_[_0x3542('0x2c')](db[_0x3542('0x2d')][_0x3542('0x2e')],function(_0x44e8f7){return{'name':_0x44e8f7[_0x3542('0x2f')],'type':_0x44e8f7[_0x3542('0x30')][_0x3542('0x31')]};});_0x30b5e8['model']=_['map'](_0x5a274b,_0x3542('0x2a'));_0x30b5e8['query']=_['keys'](_0x402c97[_0x3542('0x32')]);_0x30b5e8['filters']=_['intersection'](_0x30b5e8[_0x3542('0x33')],_0x30b5e8[_0x3542('0x32')]);_0x2e883a[_0x3542('0x34')]=_['intersection'](_0x30b5e8[_0x3542('0x33')],qs['fields'](_0x402c97[_0x3542('0x32')][_0x3542('0x35')]));_0x2e883a['attributes']=_0x2e883a[_0x3542('0x34')]['length']?_0x2e883a[_0x3542('0x34')]:_0x30b5e8[_0x3542('0x33')];if(!_0x402c97[_0x3542('0x32')]['hasOwnProperty'](_0x3542('0x36'))){_0x2e883a['limit']=qs[_0x3542('0x1f')](_0x402c97[_0x3542('0x32')][_0x3542('0x1f')]);_0x2e883a[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x402c97[_0x3542('0x32')][_0x3542('0x1c')]);}_0x2e883a[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x402c97[_0x3542('0x32')][_0x3542('0x38')]);_0x2e883a[_0x3542('0x39')]=qs[_0x3542('0x3a')](_['pick'](_0x402c97[_0x3542('0x32')],_0x30b5e8['filters']),_0x5a274b);if(_0x402c97['query'][_0x3542('0x3b')]){_0x2e883a[_0x3542('0x39')]=_[_0x3542('0x3c')](_0x2e883a[_0x3542('0x39')],{'$or':_[_0x3542('0x2c')](_0x5a274b,function(_0x21aec3){if(_0x21aec3[_0x3542('0x30')]!==_0x3542('0x3d')){var _0x53eac6={};_0x53eac6[_0x21aec3[_0x3542('0x2a')]]={'$like':'%'+_0x402c97['query'][_0x3542('0x3b')]+'%'};return _0x53eac6;}})});}_0x2e883a=_[_0x3542('0x3c')]({},_0x2e883a,_0x402c97['options']);var _0x371aba={'where':_0x2e883a[_0x3542('0x39')]};return db['VoiceMail'][_0x3542('0x1e')](_0x371aba)[_0x3542('0x27')](function(_0x5e1b29){_0x5c882f[_0x3542('0x1e')]=_0x5e1b29;if(_0x402c97[_0x3542('0x32')][_0x3542('0x3e')]){_0x2e883a[_0x3542('0x3f')]=[{'all':!![]}];}return db[_0x3542('0x2d')][_0x3542('0x40')](_0x2e883a);})[_0x3542('0x27')](function(_0x4bf45a){_0x5c882f['rows']=_0x4bf45a;return _0x5c882f;})[_0x3542('0x27')](respondWithFilteredResult(_0xc6f23b,_0x2e883a))[_0x3542('0x41')](handleError(_0xc6f23b,null));};exports[_0x3542('0x42')]=function(_0xdeebd3,_0x170749){var _0x53a024={'raw':!![],'where':{'id':_0xdeebd3['params']['id']}},_0x3e6a49={};_0x3e6a49[_0x3542('0x33')]=_[_0x3542('0x43')](db[_0x3542('0x2d')]['rawAttributes']);_0x3e6a49[_0x3542('0x32')]=_[_0x3542('0x43')](_0xdeebd3['query']);_0x3e6a49[_0x3542('0x3a')]=_[_0x3542('0x44')](_0x3e6a49[_0x3542('0x33')],_0x3e6a49[_0x3542('0x32')]);_0x53a024[_0x3542('0x34')]=_[_0x3542('0x44')](_0x3e6a49[_0x3542('0x33')],qs[_0x3542('0x35')](_0xdeebd3['query']['fields']));_0x53a024['attributes']=_0x53a024[_0x3542('0x34')][_0x3542('0x45')]?_0x53a024[_0x3542('0x34')]:_0x3e6a49[_0x3542('0x33')];if(_0xdeebd3[_0x3542('0x32')][_0x3542('0x3e')]){_0x53a024[_0x3542('0x3f')]=[{'all':!![]}];}_0x53a024=_['merge']({},_0x53a024,_0xdeebd3[_0x3542('0x46')]);return db[_0x3542('0x2d')][_0x3542('0x47')](_0x53a024)[_0x3542('0x27')](handleEntityNotFound(_0x170749,null))['then'](respondWithResult(_0x170749,null))[_0x3542('0x41')](handleError(_0x170749,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){return db[_0x3542('0x2d')][_0x3542('0x48')](_0x55b43a[_0x3542('0x49')],{})[_0x3542('0x27')](function(_0x244f3a){var _0x1a2ecf=_0x55b43a[_0x3542('0x4a')]['get']({'plain':!![]});if(!_0x1a2ecf)throw new Error(_0x3542('0x4b'));if(_0x1a2ecf[_0x3542('0x4c')]===_0x3542('0x4a')){var _0x392c6e=_0x244f3a[_0x3542('0x24')]({'plain':!![]});var _0x28be34=_0x3542('0x25');return db[_0x3542('0x4d')][_0x3542('0x47')]({'where':{'name':_0x28be34,'userProfileId':_0x1a2ecf['userProfileId']},'raw':!![]})['then'](function(_0x15af28){if(_0x15af28&&_0x15af28['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x392c6e[_0x3542('0x2a')],'resourceId':_0x392c6e['id'],'type':_0x15af28[_0x3542('0x2a')],'sectionId':_0x15af28['id']},{})[_0x3542('0x27')](function(){return _0x244f3a;});}else{return _0x244f3a;}})['catch'](function(_0x2db495){logger[_0x3542('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db495);throw _0x2db495;});}return _0x244f3a;})[_0x3542('0x27')](respondWithResult(_0x528f8c,0xc9))[_0x3542('0x41')](handleError(_0x528f8c,null));};exports[_0x3542('0x4e')]=function(_0x196c59,_0x179249){if(_0x196c59['body']['id']){delete _0x196c59[_0x3542('0x49')]['id'];}return db[_0x3542('0x2d')][_0x3542('0x47')]({'where':{'id':_0x196c59[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x179249,null))['then'](saveUpdates(_0x196c59['body'],null))[_0x3542('0x27')](respondWithResult(_0x179249,null))[_0x3542('0x41')](handleError(_0x179249,null));};exports[_0x3542('0x23')]=function(_0x5de994,_0x1dfac3){return db[_0x3542('0x2d')][_0x3542('0x47')]({'where':{'id':_0x5de994[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x1dfac3,null))['then'](removeEntity(_0x1dfac3,null))['catch'](handleError(_0x1dfac3,null));};exports[_0x3542('0x50')]=function(_0x4cd6fd,_0x1fd8c8,_0x3610b7){return db['VoiceMail'][_0x3542('0x51')]({'where':{'id':_0x4cd6fd[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x1fd8c8,null))[_0x3542('0x27')](function(_0x60b9c0){var _0x52a75b;var _0x4cb73f={},_0x271dd0={};_0x271dd0['model']=_[_0x3542('0x43')](db[_0x3542('0x52')][_0x3542('0x2e')]);_0x271dd0['query']=_[_0x3542('0x43')](_0x4cd6fd[_0x3542('0x32')]);_0x271dd0[_0x3542('0x3a')]=_[_0x3542('0x44')](_0x271dd0[_0x3542('0x33')],_0x271dd0[_0x3542('0x32')]);_0x4cb73f['attributes']=_[_0x3542('0x44')](_0x271dd0[_0x3542('0x33')],qs[_0x3542('0x35')](_0x4cd6fd[_0x3542('0x32')][_0x3542('0x35')]));_0x4cb73f[_0x3542('0x34')]=_0x4cb73f['attributes'][_0x3542('0x45')]?_0x4cb73f[_0x3542('0x34')]:_0x271dd0[_0x3542('0x33')];if(!_0x4cd6fd[_0x3542('0x32')]['hasOwnProperty'](_0x3542('0x36'))){_0x4cb73f[_0x3542('0x1f')]=qs['limit'](_0x4cd6fd['query'][_0x3542('0x1f')]);_0x4cb73f['offset']=qs[_0x3542('0x1c')](_0x4cd6fd['query']['offset']);}_0x4cb73f[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x4cd6fd[_0x3542('0x32')][_0x3542('0x38')]);_0x4cb73f[_0x3542('0x39')]=qs[_0x3542('0x3a')](_[_0x3542('0x53')](_0x4cd6fd['query'],_0x271dd0[_0x3542('0x3a')]));if(_0x4cd6fd[_0x3542('0x32')][_0x3542('0x3b')]){_0x4cb73f[_0x3542('0x39')]=_[_0x3542('0x3c')](_0x4cb73f['where'],{'$or':_[_0x3542('0x2c')](_0x4cb73f[_0x3542('0x34')],function(_0x2c5546){var _0x361c42={};_0x361c42[_0x2c5546]={'$like':'%'+_0x4cd6fd[_0x3542('0x32')][_0x3542('0x3b')]+'%'};return _0x361c42;})});}_0x4cb73f[_0x3542('0x39')]=_['merge'](_0x4cb73f[_0x3542('0x39')],{'mailboxuser':_0x60b9c0['mailbox']});_0x4cb73f=_[_0x3542('0x3c')]({},_0x4cb73f,_0x4cd6fd[_0x3542('0x46')]);return db[_0x3542('0x52')][_0x3542('0x54')](_0x4cb73f)['then'](respondWithFilteredResult(_0x1fd8c8,_0x4cb73f));})['catch'](handleError(_0x1fd8c8,null));};
\ No newline at end of file
index c4aa5d1..88979a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ad=['voice_voicemail','mailbox','context','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail'];(function(_0x25dea3,_0x2dfb02){var _0x2a700b=function(_0x30f7fc){while(--_0x30f7fc){_0x25dea3['push'](_0x25dea3['shift']());}};_0x2a700b(++_0x2dfb02);}(_0xb6ad,0x111));var _0xdb6a=function(_0x5beea3,_0x42e91f){_0x5beea3=_0x5beea3-0x0;var _0x340e79=_0xb6ad[_0x5beea3];return _0x340e79;};'use strict';var _=require('lodash');var util=require(_0xdb6a('0x0'));var logger=require(_0xdb6a('0x1'))(_0xdb6a('0x2'));var moment=require('moment');var BPromise=require(_0xdb6a('0x3'));var rp=require(_0xdb6a('0x4'));var fs=require('fs');var path=require(_0xdb6a('0x5'));var rimraf=require(_0xdb6a('0x6'));var config=require(_0xdb6a('0x7'));var attributes=require(_0xdb6a('0x8'));module[_0xdb6a('0x9')]=function(_0x2b25b6,_0x43626a){return _0x2b25b6[_0xdb6a('0xa')](_0xdb6a('0xb'),attributes,{'tableName':_0xdb6a('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xdb6a('0xd'),_0xdb6a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4235=['moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox','context','../../config/logger'];(function(_0x347856,_0x5b5888){var _0x25dba0=function(_0x57c345){while(--_0x57c345){_0x347856['push'](_0x347856['shift']());}};_0x25dba0(++_0x5b5888);}(_0x4235,0x18b));var _0x5423=function(_0x2d0ef5,_0x5621a4){_0x2d0ef5=_0x2d0ef5-0x0;var _0x550979=_0x4235[_0x2d0ef5];return _0x550979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5423('0x0'))('api');var moment=require(_0x5423('0x1'));var BPromise=require(_0x5423('0x2'));var rp=require(_0x5423('0x3'));var fs=require('fs');var path=require(_0x5423('0x4'));var rimraf=require('rimraf');var config=require(_0x5423('0x5'));var attributes=require(_0x5423('0x6'));module[_0x5423('0x7')]=function(_0x262a90,_0x1fc892){return _0x262a90['define'](_0x5423('0x8'),attributes,{'tableName':_0x5423('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x5423('0xa'),_0x5423('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index afb5c9d..dd3ecd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4605=['error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x402ac2,_0x1a1c78){var _0x44db94=function(_0x26a31c){while(--_0x26a31c){_0x402ac2['push'](_0x402ac2['shift']());}};_0x44db94(++_0x1a1c78);}(_0x4605,0xae));var _0x5460=function(_0x5b95af,_0x1b27a5){_0x5b95af=_0x5b95af-0x0;var _0x57da28=_0x4605[_0x5b95af];return _0x57da28;};'use strict';var _=require(_0x5460('0x0'));var util=require('util');var moment=require(_0x5460('0x1'));var BPromise=require(_0x5460('0x2'));var rs=require(_0x5460('0x3'));var fs=require('fs');var Redis=require(_0x5460('0x4'));var db=require(_0x5460('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5460('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5460('0x7')][_0x5460('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54865d,_0x283eb0,_0x473af3){return new BPromise(function(_0x1c8961,_0x2372c8){return client[_0x5460('0x9')](_0x54865d,_0x473af3)['then'](function(_0xac3a2a){logger[_0x5460('0xa')](_0x5460('0xb'),_0x283eb0,_0x5460('0xc'));logger[_0x5460('0xd')](_0x5460('0xe'),_0x283eb0,_0x5460('0xc'),JSON[_0x5460('0xf')](_0xac3a2a));if(_0xac3a2a[_0x5460('0x10')]){if(_0xac3a2a[_0x5460('0x10')]['code']===0x1f4){logger['error'](_0x5460('0xb'),_0x283eb0,_0xac3a2a[_0x5460('0x10')]['message']);return _0x2372c8(_0xac3a2a[_0x5460('0x10')]['message']);}logger[_0x5460('0x10')]('VoiceMail,\x20%s,\x20%s',_0x283eb0,_0xac3a2a[_0x5460('0x10')][_0x5460('0x11')]);return _0x1c8961(_0xac3a2a[_0x5460('0x10')]['message']);}else{logger[_0x5460('0xa')](_0x5460('0xb'),_0x283eb0,_0x5460('0xc'));_0x1c8961(_0xac3a2a[_0x5460('0x12')][_0x5460('0x11')]);}})['catch'](function(_0x12ac31){logger[_0x5460('0x10')](_0x5460('0xb'),_0x283eb0,_0x12ac31);_0x2372c8(_0x12ac31);});});}
\ No newline at end of file
+var _0x504b=['message','request\x20sent','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','stringify','error','code','VoiceMail,\x20%s,\x20%s'];(function(_0x1277bc,_0xc99665){var _0x1a3367=function(_0x53cf34){while(--_0x53cf34){_0x1277bc['push'](_0x1277bc['shift']());}};_0x1a3367(++_0xc99665);}(_0x504b,0x1d1));var _0xb504=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x504b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb504('0x0'));var util=require(_0xb504('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb504('0x2'));var fs=require('fs');var Redis=require(_0xb504('0x3'));var db=require(_0xb504('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb504('0x5'))(_0xb504('0x6'));var config=require(_0xb504('0x7'));var jayson=require(_0xb504('0x8'));var client=jayson[_0xb504('0x9')][_0xb504('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45905f,_0x1325a7,_0x43e9c0){return new BPromise(function(_0x3c9bcb,_0x2e20f4){return client[_0xb504('0xb')](_0x45905f,_0x43e9c0)[_0xb504('0xc')](function(_0x490a11){logger[_0xb504('0xd')]('VoiceMail,\x20%s,\x20%s',_0x1325a7,'request\x20sent');logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1325a7,'request\x20sent',JSON[_0xb504('0xe')](_0x490a11));if(_0x490a11['error']){if(_0x490a11[_0xb504('0xf')][_0xb504('0x10')]===0x1f4){logger[_0xb504('0xf')](_0xb504('0x11'),_0x1325a7,_0x490a11[_0xb504('0xf')][_0xb504('0x12')]);return _0x2e20f4(_0x490a11['error']['message']);}logger[_0xb504('0xf')](_0xb504('0x11'),_0x1325a7,_0x490a11[_0xb504('0xf')][_0xb504('0x12')]);return _0x3c9bcb(_0x490a11[_0xb504('0xf')][_0xb504('0x12')]);}else{logger[_0xb504('0xd')](_0xb504('0x11'),_0x1325a7,_0xb504('0x13'));_0x3c9bcb(_0x490a11[_0xb504('0x14')][_0xb504('0x12')]);}})['catch'](function(_0x52d4e0){logger[_0xb504('0xf')]('VoiceMail,\x20%s,\x20%s',_0x1325a7,_0x52d4e0);_0x2e20f4(_0x52d4e0);});});}
\ No newline at end of file
index 7fed1cd..e54ba9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48c9=['get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48c9,0x1c5));var _0x948c=function(_0x1a014b,_0x48acae){_0x1a014b=_0x1a014b-0x0;var _0x462258=_0x48c9[_0x1a014b];return _0x462258;};'use strict';var multer=require(_0x948c('0x0'));var util=require(_0x948c('0x1'));var path=require('path');var timeout=require(_0x948c('0x2'));var express=require(_0x948c('0x3'));var router=express[_0x948c('0x4')]();var fs_extra=require(_0x948c('0x5'));var auth=require(_0x948c('0x6'));var interaction=require(_0x948c('0x7'));var config=require('../../config/environment');var controller=require(_0x948c('0x8'));router[_0x948c('0x9')]('/',auth[_0x948c('0xa')](),controller[_0x948c('0xb')]);router['get'](_0x948c('0xc'),auth[_0x948c('0xa')](),controller['show']);router[_0x948c('0x9')](_0x948c('0xd'),auth[_0x948c('0xa')](),controller[_0x948c('0xe')]);router[_0x948c('0xf')]('/',auth['isAuthenticated'](),controller[_0x948c('0x10')]);router[_0x948c('0x11')](_0x948c('0xc'),auth[_0x948c('0xa')](),controller[_0x948c('0x12')]);router[_0x948c('0x13')]('/:id',auth[_0x948c('0xa')](),controller[_0x948c('0x14')]);module[_0x948c('0x15')]=router;
\ No newline at end of file
+var _0xc251=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','download','post','put','update'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0xc251,0x1b6));var _0x1c25=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xc251[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0x1c25('0x0'));var util=require('util');var path=require(_0x1c25('0x1'));var timeout=require(_0x1c25('0x2'));var express=require(_0x1c25('0x3'));var router=express[_0x1c25('0x4')]();var fs_extra=require(_0x1c25('0x5'));var auth=require(_0x1c25('0x6'));var interaction=require(_0x1c25('0x7'));var config=require(_0x1c25('0x8'));var controller=require(_0x1c25('0x9'));router[_0x1c25('0xa')]('/',auth[_0x1c25('0xb')](),controller['index']);router[_0x1c25('0xa')](_0x1c25('0xc'),auth[_0x1c25('0xb')](),controller[_0x1c25('0xd')]);router[_0x1c25('0xa')]('/:id/download',auth[_0x1c25('0xb')](),controller[_0x1c25('0xe')]);router[_0x1c25('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1c25('0x10')](_0x1c25('0xc'),auth['isAuthenticated'](),controller[_0x1c25('0x11')]);router['delete'](_0x1c25('0xc'),auth['isAuthenticated'](),controller[_0x1c25('0x12')]);module['exports']=router;
\ No newline at end of file
index a84d0a4..340f183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ab0=['getDataValue','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','VIRTUAL'];(function(_0x34fdcb,_0x3ffbb1){var _0x37a1b9=function(_0x172252){while(--_0x172252){_0x34fdcb['push'](_0x34fdcb['shift']());}};_0x37a1b9(++_0x3ffbb1);}(_0x5ab0,0x13a));var _0x05ab=function(_0x36fc83,_0x49ad90){_0x36fc83=_0x36fc83-0x0;var _0x31b62e=_0x5ab0[_0x36fc83];return _0x31b62e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x05ab('0x0')],'get':function(_0x470fe8){return this[_0x05ab('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x05ab('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x05ab('0x2')],'defaultValue':''},'stamp':{'type':_0x05ab('0x4'),'defaultValue':Sequelize[_0x05ab('0x5')](_0x05ab('0x6'))}};
\ No newline at end of file
+var _0x1680=['long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x1680,0x7a));var _0x0168=function(_0x22889a,_0x4b75f7){_0x22889a=_0x22889a-0x0;var _0x763d34=_0x1680[_0x22889a];return _0x763d34;};'use strict';var Sequelize=require(_0x0168('0x0'));module[_0x0168('0x1')]={'name':{'type':Sequelize[_0x0168('0x2')],'get':function(_0x123d29){return this[_0x0168('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x0168('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x0168('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x0168('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x0168('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 2b779f9..da7f894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1df=['index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','map','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','recording','msg_id','Sequelize','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x455b87,_0x43e301){var _0x3a958b=function(_0x32036a){while(--_0x32036a){_0x455b87['push'](_0x455b87['shift']());}};_0x3a958b(++_0x43e301);}(_0xa1df,0x7f));var _0xfa1d=function(_0x3ad608,_0x4b3d0e){_0x3ad608=_0x3ad608-0x0;var _0x3149ff=_0xa1df[_0x3ad608];return _0x3149ff;};'use strict';var emlformat=require(_0xfa1d('0x0'));var rimraf=require(_0xfa1d('0x1'));var zipdir=require(_0xfa1d('0x2'));var jsonpatch=require(_0xfa1d('0x3'));var rp=require(_0xfa1d('0x4'));var moment=require(_0xfa1d('0x5'));var BPromise=require(_0xfa1d('0x6'));var Mustache=require(_0xfa1d('0x7'));var util=require(_0xfa1d('0x8'));var path=require(_0xfa1d('0x9'));var sox=require('sox');var csv=require(_0xfa1d('0xa'));var ejs=require(_0xfa1d('0xb'));var fs=require('fs');var fs_extra=require(_0xfa1d('0xc'));var _=require('lodash');var squel=require(_0xfa1d('0xd'));var crypto=require(_0xfa1d('0xe'));var jsforce=require(_0xfa1d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfa1d('0xa'));var querystring=require('querystring');var Papa=require(_0xfa1d('0x10'));var Redis=require(_0xfa1d('0x11'));var authService=require(_0xfa1d('0x12'));var qs=require(_0xfa1d('0x13'));var as=require(_0xfa1d('0x14'));var hardwareService=require(_0xfa1d('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xfa1d('0x16'));var licenseUtil=require(_0xfa1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b2d5,_0x38e53a){_0x38e53a=_0x38e53a||0xcc;return function(_0x387078){if(_0x387078){return _0x49b2d5['sendStatus'](_0x38e53a);}return _0x49b2d5[_0xfa1d('0x18')](_0x38e53a)['end']();};}function respondWithResult(_0x1f5d1c,_0x4e6e3e){_0x4e6e3e=_0x4e6e3e||0xc8;return function(_0xea22a6){if(_0xea22a6){return _0x1f5d1c[_0xfa1d('0x18')](_0x4e6e3e)[_0xfa1d('0x19')](_0xea22a6);}};}function respondWithFilteredResult(_0x3ed3e2,_0x170364){return function(_0x37208e){if(_0x37208e){var _0x9ddcbc=typeof _0x170364[_0xfa1d('0x1a')]==='undefined'&&typeof _0x170364['limit']===_0xfa1d('0x1b');var _0x30ccf1=_0x37208e['count'];var _0x293008=_0x9ddcbc?0x0:_0x170364[_0xfa1d('0x1a')];var _0x34da5d=_0x9ddcbc?_0x37208e['count']:_0x170364[_0xfa1d('0x1a')]+_0x170364[_0xfa1d('0x1c')];var _0x44c25d;if(_0x34da5d>=_0x30ccf1){_0x34da5d=_0x30ccf1;_0x44c25d=0xc8;}else{_0x44c25d=0xce;}_0x3ed3e2['status'](_0x44c25d);return _0x3ed3e2[_0xfa1d('0x1d')](_0xfa1d('0x1e'),_0x293008+'-'+_0x34da5d+'/'+_0x30ccf1)[_0xfa1d('0x19')](_0x37208e);}return null;};}function patchUpdates(_0xfa19fd){return function(_0x403d89){try{jsonpatch[_0xfa1d('0x1f')](_0x403d89,_0xfa19fd,!![]);}catch(_0x74f711){return BPromise[_0xfa1d('0x20')](_0x74f711);}return _0x403d89[_0xfa1d('0x21')]();};}function saveUpdates(_0x2dc031,_0x589c99){return function(_0x5ea4c9){if(_0x5ea4c9){return _0x5ea4c9[_0xfa1d('0x22')](_0x2dc031)[_0xfa1d('0x23')](function(_0x13c4d1){return _0x13c4d1;});}return null;};}function removeEntity(_0x374251,_0x34622e){return function(_0x10c794){if(_0x10c794){return _0x10c794[_0xfa1d('0x24')]()['then'](function(){_0x374251[_0xfa1d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4637ea,_0x2bc68e){return function(_0x30a598){if(!_0x30a598){_0x4637ea[_0xfa1d('0x25')](0x194);}return _0x30a598;};}function handleError(_0x485080,_0x47e521){_0x47e521=_0x47e521||0x1f4;return function(_0x340314){logger[_0xfa1d('0x26')](_0x340314[_0xfa1d('0x27')]);if(_0x340314['name']){delete _0x340314[_0xfa1d('0x28')];}_0x485080[_0xfa1d('0x18')](_0x47e521)['send'](_0x340314);};}exports[_0xfa1d('0x29')]=function(_0x54e573,_0x32908e){var _0x3eec1b={},_0x29f01e={},_0x38e1d0={'count':0x0,'rows':[]};var _0x57c438=_['map'](db[_0xfa1d('0x2a')][_0xfa1d('0x2b')],function(_0x33cc61){return{'name':_0x33cc61[_0xfa1d('0x2c')],'type':_0x33cc61[_0xfa1d('0x2d')][_0xfa1d('0x2e')]};});_0x29f01e[_0xfa1d('0x2f')]=_[_0xfa1d('0x30')](_['map'](_0x57c438,_0xfa1d('0x28')),['name']);_0x29f01e['query']=_[_0xfa1d('0x31')](_0x54e573[_0xfa1d('0x32')]);_0x29f01e[_0xfa1d('0x33')]=_['intersection'](_0x29f01e[_0xfa1d('0x2f')],_0x29f01e[_0xfa1d('0x32')]);_0x3eec1b['attributes']=_[_0xfa1d('0x34')](_0x29f01e['model'],qs[_0xfa1d('0x35')](_0x54e573[_0xfa1d('0x32')]['fields']));_0x3eec1b[_0xfa1d('0x36')]=_0x3eec1b[_0xfa1d('0x36')][_0xfa1d('0x37')]?_0x3eec1b[_0xfa1d('0x36')]:_0x29f01e['model'];if(!_0x54e573[_0xfa1d('0x32')]['hasOwnProperty']('nolimit')){_0x3eec1b[_0xfa1d('0x1c')]=qs[_0xfa1d('0x1c')](_0x54e573['query'][_0xfa1d('0x1c')]);_0x3eec1b[_0xfa1d('0x1a')]=qs[_0xfa1d('0x1a')](_0x54e573[_0xfa1d('0x32')][_0xfa1d('0x1a')]);}_0x3eec1b[_0xfa1d('0x38')]=qs[_0xfa1d('0x39')](_0x54e573[_0xfa1d('0x32')]['sort']);_0x3eec1b[_0xfa1d('0x3a')]=qs[_0xfa1d('0x33')](_[_0xfa1d('0x3b')](_0x54e573['query'],_0x29f01e[_0xfa1d('0x33')]),_0x57c438);if(_0x54e573[_0xfa1d('0x32')]['filter']){_0x3eec1b[_0xfa1d('0x3a')]=_[_0xfa1d('0x3c')](_0x3eec1b['where'],{'$or':_[_0xfa1d('0x3d')](_0x57c438,function(_0x36352d){if(_0x36352d[_0xfa1d('0x2d')]!==_0xfa1d('0x3e')){var _0x230826={};_0x230826[_0x36352d[_0xfa1d('0x28')]]={'$like':'%'+_0x54e573[_0xfa1d('0x32')][_0xfa1d('0x3f')]+'%'};return _0x230826;}})});}_0x3eec1b=_[_0xfa1d('0x3c')]({},_0x3eec1b,_0x54e573[_0xfa1d('0x40')]);var _0x75f98e={'where':_0x3eec1b['where']};return db[_0xfa1d('0x2a')][_0xfa1d('0x41')](_0x75f98e)[_0xfa1d('0x23')](function(_0x25f2a2){_0x38e1d0['count']=_0x25f2a2;if(_0x54e573[_0xfa1d('0x32')][_0xfa1d('0x42')]){_0x3eec1b[_0xfa1d('0x43')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xfa1d('0x44')](_0x3eec1b);})[_0xfa1d('0x23')](function(_0x5cfebd){_0x38e1d0[_0xfa1d('0x45')]=_0x5cfebd;return _0x38e1d0;})[_0xfa1d('0x23')](respondWithFilteredResult(_0x32908e,_0x3eec1b))[_0xfa1d('0x46')](handleError(_0x32908e,null));};exports[_0xfa1d('0x47')]=function(_0x1ca613,_0x6590b2){var _0x1b65f8={'raw':!![],'where':{'id':_0x1ca613[_0xfa1d('0x48')]['id']}},_0x40dc9f={};_0x40dc9f[_0xfa1d('0x2f')]=_['keys'](db[_0xfa1d('0x2a')][_0xfa1d('0x2b')]);_0x40dc9f[_0xfa1d('0x32')]=_[_0xfa1d('0x31')](_0x1ca613['query']);_0x40dc9f[_0xfa1d('0x33')]=_['intersection'](_0x40dc9f[_0xfa1d('0x2f')],_0x40dc9f[_0xfa1d('0x32')]);_0x1b65f8[_0xfa1d('0x36')]=_[_0xfa1d('0x34')](_0x40dc9f['model'],qs[_0xfa1d('0x35')](_0x1ca613['query'][_0xfa1d('0x35')]));_0x1b65f8[_0xfa1d('0x36')]=_0x1b65f8[_0xfa1d('0x36')][_0xfa1d('0x37')]?_0x1b65f8[_0xfa1d('0x36')]:_0x40dc9f[_0xfa1d('0x2f')];if(_0x1ca613[_0xfa1d('0x32')][_0xfa1d('0x42')]){_0x1b65f8[_0xfa1d('0x43')]=[{'all':!![]}];}_0x1b65f8=_[_0xfa1d('0x3c')]({},_0x1b65f8,_0x1ca613[_0xfa1d('0x40')]);return db[_0xfa1d('0x2a')][_0xfa1d('0x49')](_0x1b65f8)[_0xfa1d('0x23')](handleEntityNotFound(_0x6590b2,null))[_0xfa1d('0x23')](respondWithResult(_0x6590b2,null))[_0xfa1d('0x46')](handleError(_0x6590b2,null));};exports[_0xfa1d('0x4a')]=function(_0x456aba,_0xe0a03a){return db[_0xfa1d('0x2a')][_0xfa1d('0x4a')](_0x456aba[_0xfa1d('0x4b')],{})[_0xfa1d('0x23')](respondWithResult(_0xe0a03a,0xc9))[_0xfa1d('0x46')](handleError(_0xe0a03a,null));};exports[_0xfa1d('0x22')]=function(_0x25ed81,_0x3c47f8){if(_0x25ed81[_0xfa1d('0x4b')]['id']){delete _0x25ed81[_0xfa1d('0x4b')]['id'];}return db[_0xfa1d('0x2a')][_0xfa1d('0x49')]({'where':{'id':_0x25ed81[_0xfa1d('0x48')]['id']}})[_0xfa1d('0x23')](handleEntityNotFound(_0x3c47f8,null))['then'](saveUpdates(_0x25ed81[_0xfa1d('0x4b')],null))[_0xfa1d('0x23')](respondWithResult(_0x3c47f8,null))['catch'](handleError(_0x3c47f8,null));};exports[_0xfa1d('0x24')]=function(_0x243135,_0x1b4873){return db[_0xfa1d('0x2a')][_0xfa1d('0x49')]({'where':{'id':_0x243135[_0xfa1d('0x48')]['id']}})[_0xfa1d('0x23')](handleEntityNotFound(_0x1b4873,null))[_0xfa1d('0x23')](removeEntity(_0x1b4873,null))[_0xfa1d('0x46')](handleError(_0x1b4873,null));};exports[_0xfa1d('0x4c')]=function(_0x570f66,_0x50a870,_0x408978){return db[_0xfa1d('0x2a')][_0xfa1d('0x49')]({'where':{'id':_0x570f66['params']['id']},'attributes':['id',_0xfa1d('0x4d'),_0xfa1d('0x4e')]})[_0xfa1d('0x23')](handleEntityNotFound(_0x50a870,null))[_0xfa1d('0x23')](function(_0x4fac7f){if(_0x4fac7f){if(!_0x4fac7f[_0xfa1d('0x4d')]){throw new db[(_0xfa1d('0x4f'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x2525f7={'Content-Type':_0xfa1d('0x50'),'Content-Disposition':'attachment'};if(_0x4fac7f['msg_id']){_0x2525f7[_0xfa1d('0x51')]=_0xfa1d('0x52')+_0x4fac7f[_0xfa1d('0x4e')]+_0xfa1d('0x53');}_0x50a870[_0xfa1d('0x1d')](_0x2525f7);return _0x50a870['send'](new Buffer(_0x4fac7f[_0xfa1d('0x4d')]));}})[_0xfa1d('0x46')](handleError(_0x50a870,null));};
\ No newline at end of file
+var _0x4860=['options','includeAll','include','findAll','rows','catch','show','length','create','body','params','find','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','.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','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','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','type','VIRTUAL','merge'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0x4860,0x6d));var _0x0486=function(_0x1bf7ac,_0x4f2019){_0x1bf7ac=_0x1bf7ac-0x0;var _0x2b1cec=_0x4860[_0x1bf7ac];return _0x2b1cec;};'use strict';var emlformat=require(_0x0486('0x0'));var rimraf=require(_0x0486('0x1'));var zipdir=require(_0x0486('0x2'));var jsonpatch=require(_0x0486('0x3'));var rp=require(_0x0486('0x4'));var moment=require(_0x0486('0x5'));var BPromise=require(_0x0486('0x6'));var Mustache=require(_0x0486('0x7'));var util=require(_0x0486('0x8'));var path=require(_0x0486('0x9'));var sox=require(_0x0486('0xa'));var csv=require(_0x0486('0xb'));var ejs=require(_0x0486('0xc'));var fs=require('fs');var fs_extra=require(_0x0486('0xd'));var _=require(_0x0486('0xe'));var squel=require(_0x0486('0xf'));var crypto=require(_0x0486('0x10'));var jsforce=require(_0x0486('0x11'));var deskjs=require(_0x0486('0x12'));var toCsv=require(_0x0486('0xb'));var querystring=require('querystring');var Papa=require(_0x0486('0x13'));var Redis=require(_0x0486('0x14'));var authService=require(_0x0486('0x15'));var qs=require(_0x0486('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0486('0x17'));var logger=require(_0x0486('0x18'))(_0x0486('0x19'));var utils=require(_0x0486('0x1a'));var config=require(_0x0486('0x1b'));var licenseUtil=require(_0x0486('0x1c'));var db=require(_0x0486('0x1d'))['db'];function respondWithStatusCode(_0x223bf0,_0x459a9e){_0x459a9e=_0x459a9e||0xcc;return function(_0x555618){if(_0x555618){return _0x223bf0[_0x0486('0x1e')](_0x459a9e);}return _0x223bf0[_0x0486('0x1f')](_0x459a9e)[_0x0486('0x20')]();};}function respondWithResult(_0x3e03a7,_0x5263ea){_0x5263ea=_0x5263ea||0xc8;return function(_0x2ce89f){if(_0x2ce89f){return _0x3e03a7[_0x0486('0x1f')](_0x5263ea)['json'](_0x2ce89f);}};}function respondWithFilteredResult(_0x1a776c,_0x2ef28b){return function(_0x46bc5f){if(_0x46bc5f){var _0x3d989f=typeof _0x2ef28b[_0x0486('0x21')]===_0x0486('0x22')&&typeof _0x2ef28b[_0x0486('0x23')]===_0x0486('0x22');var _0x32be0f=_0x46bc5f['count'];var _0x1a4c95=_0x3d989f?0x0:_0x2ef28b[_0x0486('0x21')];var _0x421bcd=_0x3d989f?_0x46bc5f[_0x0486('0x24')]:_0x2ef28b[_0x0486('0x21')]+_0x2ef28b['limit'];var _0x58cea6;if(_0x421bcd>=_0x32be0f){_0x421bcd=_0x32be0f;_0x58cea6=0xc8;}else{_0x58cea6=0xce;}_0x1a776c[_0x0486('0x1f')](_0x58cea6);return _0x1a776c[_0x0486('0x25')](_0x0486('0x26'),_0x1a4c95+'-'+_0x421bcd+'/'+_0x32be0f)[_0x0486('0x27')](_0x46bc5f);}return null;};}function patchUpdates(_0x3bd7bf){return function(_0x41a411){try{jsonpatch[_0x0486('0x28')](_0x41a411,_0x3bd7bf,!![]);}catch(_0x367c6f){return BPromise[_0x0486('0x29')](_0x367c6f);}return _0x41a411[_0x0486('0x2a')]();};}function saveUpdates(_0xf41d5d,_0xe01e5f){return function(_0x1f82ec){if(_0x1f82ec){return _0x1f82ec[_0x0486('0x2b')](_0xf41d5d)['then'](function(_0x40585){return _0x40585;});}return null;};}function removeEntity(_0x776ccb,_0x2d25d5){return function(_0x642447){if(_0x642447){return _0x642447[_0x0486('0x2c')]()[_0x0486('0x2d')](function(){_0x776ccb[_0x0486('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22fdb9,_0x28dec8){return function(_0x1f524a){if(!_0x1f524a){_0x22fdb9[_0x0486('0x1e')](0x194);}return _0x1f524a;};}function handleError(_0x5de881,_0x5402fb){_0x5402fb=_0x5402fb||0x1f4;return function(_0x544f5e){logger[_0x0486('0x2e')](_0x544f5e[_0x0486('0x2f')]);if(_0x544f5e['name']){delete _0x544f5e[_0x0486('0x30')];}_0x5de881[_0x0486('0x1f')](_0x5402fb)[_0x0486('0x31')](_0x544f5e);};}exports[_0x0486('0x32')]=function(_0x2674b9,_0x13dd74){var _0x294f84={},_0x3505ac={},_0x27f237={'count':0x0,'rows':[]};var _0x463d0d=_[_0x0486('0x33')](db[_0x0486('0x34')][_0x0486('0x35')],function(_0xd52643){return{'name':_0xd52643['fieldName'],'type':_0xd52643['type'][_0x0486('0x36')]};});_0x3505ac[_0x0486('0x37')]=_['differenceBy'](_[_0x0486('0x33')](_0x463d0d,_0x0486('0x30')),[_0x0486('0x30')]);_0x3505ac[_0x0486('0x38')]=_[_0x0486('0x39')](_0x2674b9[_0x0486('0x38')]);_0x3505ac[_0x0486('0x3a')]=_[_0x0486('0x3b')](_0x3505ac[_0x0486('0x37')],_0x3505ac[_0x0486('0x38')]);_0x294f84[_0x0486('0x3c')]=_['intersection'](_0x3505ac[_0x0486('0x37')],qs[_0x0486('0x3d')](_0x2674b9['query']['fields']));_0x294f84[_0x0486('0x3c')]=_0x294f84[_0x0486('0x3c')]['length']?_0x294f84['attributes']:_0x3505ac['model'];if(!_0x2674b9['query'][_0x0486('0x3e')]('nolimit')){_0x294f84[_0x0486('0x23')]=qs[_0x0486('0x23')](_0x2674b9[_0x0486('0x38')]['limit']);_0x294f84[_0x0486('0x21')]=qs[_0x0486('0x21')](_0x2674b9[_0x0486('0x38')][_0x0486('0x21')]);}_0x294f84['order']=qs[_0x0486('0x3f')](_0x2674b9[_0x0486('0x38')][_0x0486('0x3f')]);_0x294f84['where']=qs[_0x0486('0x3a')](_['pick'](_0x2674b9[_0x0486('0x38')],_0x3505ac['filters']),_0x463d0d);if(_0x2674b9[_0x0486('0x38')][_0x0486('0x40')]){_0x294f84[_0x0486('0x41')]=_['merge'](_0x294f84[_0x0486('0x41')],{'$or':_[_0x0486('0x33')](_0x463d0d,function(_0x350697){if(_0x350697[_0x0486('0x42')]!==_0x0486('0x43')){var _0x53529b={};_0x53529b[_0x350697[_0x0486('0x30')]]={'$like':'%'+_0x2674b9[_0x0486('0x38')][_0x0486('0x40')]+'%'};return _0x53529b;}})});}_0x294f84=_[_0x0486('0x44')]({},_0x294f84,_0x2674b9[_0x0486('0x45')]);var _0x4da8ed={'where':_0x294f84['where']};return db[_0x0486('0x34')]['count'](_0x4da8ed)[_0x0486('0x2d')](function(_0x33ddde){_0x27f237[_0x0486('0x24')]=_0x33ddde;if(_0x2674b9[_0x0486('0x38')][_0x0486('0x46')]){_0x294f84[_0x0486('0x47')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x0486('0x48')](_0x294f84);})[_0x0486('0x2d')](function(_0x5dbb78){_0x27f237[_0x0486('0x49')]=_0x5dbb78;return _0x27f237;})[_0x0486('0x2d')](respondWithFilteredResult(_0x13dd74,_0x294f84))[_0x0486('0x4a')](handleError(_0x13dd74,null));};exports[_0x0486('0x4b')]=function(_0x3d5dcb,_0x5c3909){var _0x2a0756={'raw':!![],'where':{'id':_0x3d5dcb['params']['id']}},_0x30998f={};_0x30998f['model']=_[_0x0486('0x39')](db[_0x0486('0x34')][_0x0486('0x35')]);_0x30998f[_0x0486('0x38')]=_[_0x0486('0x39')](_0x3d5dcb['query']);_0x30998f[_0x0486('0x3a')]=_['intersection'](_0x30998f[_0x0486('0x37')],_0x30998f[_0x0486('0x38')]);_0x2a0756[_0x0486('0x3c')]=_[_0x0486('0x3b')](_0x30998f[_0x0486('0x37')],qs['fields'](_0x3d5dcb['query'][_0x0486('0x3d')]));_0x2a0756['attributes']=_0x2a0756['attributes'][_0x0486('0x4c')]?_0x2a0756['attributes']:_0x30998f[_0x0486('0x37')];if(_0x3d5dcb[_0x0486('0x38')][_0x0486('0x46')]){_0x2a0756[_0x0486('0x47')]=[{'all':!![]}];}_0x2a0756=_[_0x0486('0x44')]({},_0x2a0756,_0x3d5dcb['options']);return db[_0x0486('0x34')]['find'](_0x2a0756)['then'](handleEntityNotFound(_0x5c3909,null))[_0x0486('0x2d')](respondWithResult(_0x5c3909,null))[_0x0486('0x4a')](handleError(_0x5c3909,null));};exports[_0x0486('0x4d')]=function(_0x1d391c,_0x1f5c7a){return db['VoiceMailMessage'][_0x0486('0x4d')](_0x1d391c[_0x0486('0x4e')],{})[_0x0486('0x2d')](respondWithResult(_0x1f5c7a,0xc9))[_0x0486('0x4a')](handleError(_0x1f5c7a,null));};exports[_0x0486('0x2b')]=function(_0x187324,_0xed33cf){if(_0x187324[_0x0486('0x4e')]['id']){delete _0x187324[_0x0486('0x4e')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x187324[_0x0486('0x4f')]['id']}})[_0x0486('0x2d')](handleEntityNotFound(_0xed33cf,null))[_0x0486('0x2d')](saveUpdates(_0x187324['body'],null))['then'](respondWithResult(_0xed33cf,null))[_0x0486('0x4a')](handleError(_0xed33cf,null));};exports[_0x0486('0x2c')]=function(_0x5ceb95,_0x25ec46){return db['VoiceMailMessage'][_0x0486('0x50')]({'where':{'id':_0x5ceb95[_0x0486('0x4f')]['id']}})[_0x0486('0x2d')](handleEntityNotFound(_0x25ec46,null))['then'](removeEntity(_0x25ec46,null))[_0x0486('0x4a')](handleError(_0x25ec46,null));};exports['download']=function(_0x49912a,_0xeb446f,_0x1e6abd){return db[_0x0486('0x34')][_0x0486('0x50')]({'where':{'id':_0x49912a['params']['id']},'attributes':['id',_0x0486('0x51'),'msg_id']})[_0x0486('0x2d')](handleEntityNotFound(_0xeb446f,null))[_0x0486('0x2d')](function(_0x5e0a53){if(_0x5e0a53){if(!_0x5e0a53[_0x0486('0x51')]){throw new db[(_0x0486('0x52'))][(_0x0486('0x53'))](_0x0486('0x54'));}var _0x443b86={'Content-Type':_0x0486('0x55'),'Content-Disposition':'attachment'};if(_0x5e0a53[_0x0486('0x56')]){_0x443b86[_0x0486('0x57')]='attachment;\x20filename=\x22'+_0x5e0a53[_0x0486('0x56')]+_0x0486('0x58');}_0xeb446f[_0x0486('0x25')](_0x443b86);return _0xeb446f[_0x0486('0x31')](new Buffer(_0x5e0a53[_0x0486('0x51')]));}})[_0x0486('0x4a')](handleError(_0xeb446f,null));};
\ No newline at end of file
index d0737a5..b5aaefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x130d=['rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','moment','bluebird','path'];(function(_0x14ee3c,_0x2d4da5){var _0x34026f=function(_0x11dea1){while(--_0x11dea1){_0x14ee3c['push'](_0x14ee3c['shift']());}};_0x34026f(++_0x2d4da5);}(_0x130d,0x188));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd130('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd130('0x1'));var BPromise=require(_0xd130('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd130('0x3'));var rimraf=require(_0xd130('0x4'));var config=require(_0xd130('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0xd130('0x6')]=function(_0x302154,_0x320a7e){return _0x302154[_0xd130('0x7')](_0xd130('0x8'),attributes,{'tableName':_0xd130('0x9'),'paranoid':![],'indexes':[{'name':_0xd130('0xa'),'fields':[_0xd130('0xa')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xc6e2=['./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc6e2,0xa1));var _0x2c6e=function(_0x2594b7,_0x2a2161){_0x2594b7=_0x2594b7-0x0;var _0x31477e=_0xc6e2[_0x2594b7];return _0x31477e;};'use strict';var _=require(_0x2c6e('0x0'));var util=require(_0x2c6e('0x1'));var logger=require(_0x2c6e('0x2'))(_0x2c6e('0x3'));var moment=require(_0x2c6e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c6e('0x5'));var config=require(_0x2c6e('0x6'));var attributes=require(_0x2c6e('0x7'));module[_0x2c6e('0x8')]=function(_0x1008aa,_0x2259c0){return _0x1008aa[_0x2c6e('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x2c6e('0xa'),'paranoid':![],'indexes':[{'name':_0x2c6e('0xb'),'fields':[_0x2c6e('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index eb6bed1..1a21b0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec5d=['../../config/environment','jayson/promise','client','request','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x42c031,_0x5685c7){var _0x1d115b=function(_0xc2c665){while(--_0xc2c665){_0x42c031['push'](_0x42c031['shift']());}};_0x1d115b(++_0x5685c7);}(_0xec5d,0x1b0));var _0xdec5=function(_0x41067a,_0x4eeaf5){_0x41067a=_0x41067a-0x0;var _0xb17537=_0xec5d[_0x41067a];return _0xb17537;};'use strict';var _=require(_0xdec5('0x0'));var util=require(_0xdec5('0x1'));var moment=require(_0xdec5('0x2'));var BPromise=require(_0xdec5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdec5('0x4'));var db=require(_0xdec5('0x5'))['db'];var utils=require(_0xdec5('0x6'));var logger=require(_0xdec5('0x7'))(_0xdec5('0x8'));var config=require(_0xdec5('0x9'));var jayson=require(_0xdec5('0xa'));var client=jayson[_0xdec5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f71d,_0x147c41,_0x62d6d1){return new BPromise(function(_0x21924f,_0x2a22f0){return client[_0xdec5('0xc')](_0x54f71d,_0x62d6d1)['then'](function(_0x2a370f){logger['info'](_0xdec5('0xd'),_0x147c41,'request\x20sent');logger[_0xdec5('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x147c41,_0xdec5('0xf'),JSON[_0xdec5('0x10')](_0x2a370f));if(_0x2a370f[_0xdec5('0x11')]){if(_0x2a370f[_0xdec5('0x11')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x147c41,_0x2a370f['error'][_0xdec5('0x12')]);return _0x2a22f0(_0x2a370f[_0xdec5('0x11')][_0xdec5('0x12')]);}logger[_0xdec5('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x147c41,_0x2a370f[_0xdec5('0x11')]['message']);return _0x21924f(_0x2a370f['error'][_0xdec5('0x12')]);}else{logger['info'](_0xdec5('0xd'),_0x147c41,'request\x20sent');_0x21924f(_0x2a370f[_0xdec5('0x13')][_0xdec5('0x12')]);}})[_0xdec5('0x14')](function(_0x584241){logger[_0xdec5('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x147c41,_0x584241);_0x2a22f0(_0x584241);});});}
\ No newline at end of file
+var _0x0893=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x0893,0x17c));var _0x3089=function(_0x37a536,_0x317c76){_0x37a536=_0x37a536-0x0;var _0x3d69bb=_0x0893[_0x37a536];return _0x3d69bb;};'use strict';var _=require(_0x3089('0x0'));var util=require(_0x3089('0x1'));var moment=require(_0x3089('0x2'));var BPromise=require(_0x3089('0x3'));var rs=require(_0x3089('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3089('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3089('0x6'));var config=require('../../config/environment');var jayson=require(_0x3089('0x7'));var client=jayson[_0x3089('0x8')][_0x3089('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x285a85,_0x2dd1ac,_0x123336){return new BPromise(function(_0xb32853,_0x49050d){return client['request'](_0x285a85,_0x123336)['then'](function(_0x15c7c7){logger[_0x3089('0xa')](_0x3089('0xb'),_0x2dd1ac,_0x3089('0xc'));logger[_0x3089('0xd')](_0x3089('0xe'),_0x2dd1ac,'request\x20sent',JSON[_0x3089('0xf')](_0x15c7c7));if(_0x15c7c7[_0x3089('0x10')]){if(_0x15c7c7[_0x3089('0x10')][_0x3089('0x11')]===0x1f4){logger[_0x3089('0x10')](_0x3089('0xb'),_0x2dd1ac,_0x15c7c7['error']['message']);return _0x49050d(_0x15c7c7[_0x3089('0x10')]['message']);}logger[_0x3089('0x10')](_0x3089('0xb'),_0x2dd1ac,_0x15c7c7[_0x3089('0x10')][_0x3089('0x12')]);return _0xb32853(_0x15c7c7['error'][_0x3089('0x12')]);}else{logger[_0x3089('0xa')](_0x3089('0xb'),_0x2dd1ac,_0x3089('0xc'));_0xb32853(_0x15c7c7[_0x3089('0x13')][_0x3089('0x12')]);}})[_0x3089('0x14')](function(_0x181e82){logger[_0x3089('0x10')](_0x3089('0xb'),_0x2dd1ac,_0x181e82);_0x49050d(_0x181e82);});});}
\ No newline at end of file
index c9c5d39..09aa089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaf5=['connect-timeout','fs-extra','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','/:id','show','get','/:id/sounds','getSounds','post','create','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','path'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0xdaf5,0x1a0));var _0x5daf=function(_0x3cc29f,_0x353898){_0x3cc29f=_0x3cc29f-0x0;var _0x5609de=_0xdaf5[_0x3cc29f];return _0x5609de;};'use strict';var multer=require('multer');var util=require(_0x5daf('0x0'));var path=require(_0x5daf('0x1'));var timeout=require(_0x5daf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5daf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5daf('0x4'));var controller=require(_0x5daf('0x5'));router['get']('/',auth[_0x5daf('0x6')](),controller[_0x5daf('0x7')]);router['get'](_0x5daf('0x8'),auth[_0x5daf('0x6')](),controller[_0x5daf('0x9')]);router[_0x5daf('0xa')](_0x5daf('0xb'),auth[_0x5daf('0x6')](),controller[_0x5daf('0xc')]);router[_0x5daf('0xd')]('/',auth[_0x5daf('0x6')](),controller[_0x5daf('0xe')]);router[_0x5daf('0xd')](_0x5daf('0xb'),auth[_0x5daf('0x6')](),controller['addSound']);router[_0x5daf('0xf')]('/:id',auth[_0x5daf('0x6')](),controller[_0x5daf('0x10')]);router[_0x5daf('0x11')](_0x5daf('0x8'),auth['isAuthenticated'](),controller[_0x5daf('0x12')]);router[_0x5daf('0x11')](_0x5daf('0x13'),auth[_0x5daf('0x6')](),controller[_0x5daf('0x14')]);module[_0x5daf('0x15')]=router;
\ No newline at end of file
+var _0x0c2e=['isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0x0c2e,0x1ea));var _0xe0c2=function(_0x4b476b,_0x124b04){_0x4b476b=_0x4b476b-0x0;var _0x7d2507=_0x0c2e[_0x4b476b];return _0x7d2507;};'use strict';var multer=require(_0xe0c2('0x0'));var util=require(_0xe0c2('0x1'));var path=require(_0xe0c2('0x2'));var timeout=require(_0xe0c2('0x3'));var express=require(_0xe0c2('0x4'));var router=express[_0xe0c2('0x5')]();var fs_extra=require(_0xe0c2('0x6'));var auth=require(_0xe0c2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe0c2('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0xe0c2('0x9')]('/',auth[_0xe0c2('0xa')](),controller[_0xe0c2('0xb')]);router[_0xe0c2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0c2('0xc')]);router[_0xe0c2('0x9')](_0xe0c2('0xd'),auth[_0xe0c2('0xa')](),controller[_0xe0c2('0xe')]);router[_0xe0c2('0xf')]('/',auth[_0xe0c2('0xa')](),controller[_0xe0c2('0x10')]);router[_0xe0c2('0xf')](_0xe0c2('0xd'),auth[_0xe0c2('0xa')](),controller[_0xe0c2('0x11')]);router[_0xe0c2('0x12')](_0xe0c2('0x13'),auth['isAuthenticated'](),controller[_0xe0c2('0x14')]);router[_0xe0c2('0x15')](_0xe0c2('0x13'),auth[_0xe0c2('0xa')](),controller['destroy']);router[_0xe0c2('0x15')](_0xe0c2('0x16'),auth['isAuthenticated'](),controller[_0xe0c2('0x17')]);module[_0xe0c2('0x18')]=router;
\ No newline at end of file
index eb7beb7..bf8350c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77aa=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0x77aa,0x121));var _0xa77a=function(_0x198050,_0x47876e){_0x198050=_0x198050-0x0;var _0x4a7b81=_0x77aa[_0x198050];return _0x4a7b81;};'use strict';var Sequelize=require(_0xa77a('0x0'));module[_0xa77a('0x1')]={'name':{'type':Sequelize[_0xa77a('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xa77a('0x3')](_0xa77a('0x4'),_0xa77a('0x5'),_0xa77a('0x6'),_0xa77a('0x7'),_0xa77a('0x8'),_0xa77a('0x9')),'allowNull':!![],'defaultValue':_0xa77a('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa77a('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa77a('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa77a('0x2')],'allowNull':!![],'defaultValue':_0xa77a('0xa')},'format':{'type':Sequelize[_0xa77a('0x2')],'allowNull':!![]},'stamp':{'type':_0xa77a('0xb')},'defaultEntry':{'type':Sequelize[_0xa77a('0xc')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf6d8=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','mp3nb'];(function(_0x3e9b2b,_0x37948a){var _0x39db4d=function(_0x7cb707){while(--_0x7cb707){_0x3e9b2b['push'](_0x3e9b2b['shift']());}};_0x39db4d(++_0x37948a);}(_0xf6d8,0x170));var _0x8f6d=function(_0x18a562,_0x3cdf19){_0x18a562=_0x18a562-0x0;var _0x1232dc=_0xf6d8[_0x18a562];return _0x1232dc;};'use strict';var Sequelize=require(_0x8f6d('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f6d('0x1')],'allowNull':![],'unique':_0x8f6d('0x2')},'mode':{'type':Sequelize[_0x8f6d('0x3')](_0x8f6d('0x4'),'files',_0x8f6d('0x5'),'quietmp3nb',_0x8f6d('0x6'),_0x8f6d('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x8f6d('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x8f6d('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8f6d('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8f6d('0x8')},'format':{'type':Sequelize[_0x8f6d('0x1')],'allowNull':!![]},'stamp':{'type':_0x8f6d('0x9')},'defaultEntry':{'type':Sequelize[_0x8f6d('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index 57510d5..0dd4415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3adc=['sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','body','find','sequelize','transaction','mode','files','directory','join','root','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','readdirSync','unlinkSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','server/files/moh','format','ValidationError','removeSound','id2','getSounds','pick','eml-format','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x4181ab,_0x41883b){var _0x2fc079=function(_0x135781){while(--_0x135781){_0x4181ab['push'](_0x4181ab['shift']());}};_0x2fc079(++_0x41883b);}(_0x3adc,0xa2));var _0xc3ad=function(_0x314c55,_0x2b721c){_0x314c55=_0x314c55-0x0;var _0x342bce=_0x3adc[_0x314c55];return _0x342bce;};'use strict';var emlformat=require(_0xc3ad('0x0'));var rimraf=require(_0xc3ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc3ad('0x2'));var rp=require(_0xc3ad('0x3'));var moment=require(_0xc3ad('0x4'));var BPromise=require(_0xc3ad('0x5'));var Mustache=require(_0xc3ad('0x6'));var util=require(_0xc3ad('0x7'));var path=require(_0xc3ad('0x8'));var sox=require(_0xc3ad('0x9'));var csv=require(_0xc3ad('0xa'));var ejs=require(_0xc3ad('0xb'));var fs=require('fs');var fs_extra=require(_0xc3ad('0xc'));var _=require(_0xc3ad('0xd'));var squel=require(_0xc3ad('0xe'));var crypto=require('crypto');var jsforce=require(_0xc3ad('0xf'));var deskjs=require(_0xc3ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc3ad('0x11'));var Papa=require(_0xc3ad('0x12'));var Redis=require('ioredis');var authService=require(_0xc3ad('0x13'));var qs=require(_0xc3ad('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3ad('0x15'));var logger=require(_0xc3ad('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3ad('0x17'))['db'];function respondWithStatusCode(_0x259e6e,_0xcac295){_0xcac295=_0xcac295||0xcc;return function(_0x3a00b0){if(_0x3a00b0){return _0x259e6e[_0xc3ad('0x18')](_0xcac295);}return _0x259e6e[_0xc3ad('0x19')](_0xcac295)[_0xc3ad('0x1a')]();};}function respondWithResult(_0x41e45e,_0x2a956e){_0x2a956e=_0x2a956e||0xc8;return function(_0x12d1ae){if(_0x12d1ae){return _0x41e45e[_0xc3ad('0x19')](_0x2a956e)[_0xc3ad('0x1b')](_0x12d1ae);}};}function respondWithFilteredResult(_0x29c110,_0x32c708){return function(_0x2fd6a7){if(_0x2fd6a7){var _0x44be8e=typeof _0x32c708['offset']===_0xc3ad('0x1c')&&typeof _0x32c708[_0xc3ad('0x1d')]===_0xc3ad('0x1c');var _0x51bbf2=_0x2fd6a7[_0xc3ad('0x1e')];var _0x500169=_0x44be8e?0x0:_0x32c708[_0xc3ad('0x1f')];var _0xc73beb=_0x44be8e?_0x2fd6a7[_0xc3ad('0x1e')]:_0x32c708['offset']+_0x32c708[_0xc3ad('0x1d')];var _0x3f78c8;if(_0xc73beb>=_0x51bbf2){_0xc73beb=_0x51bbf2;_0x3f78c8=0xc8;}else{_0x3f78c8=0xce;}_0x29c110[_0xc3ad('0x19')](_0x3f78c8);return _0x29c110[_0xc3ad('0x20')](_0xc3ad('0x21'),_0x500169+'-'+_0xc73beb+'/'+_0x51bbf2)[_0xc3ad('0x1b')](_0x2fd6a7);}return null;};}function patchUpdates(_0xb06c4f){return function(_0x35d5ab){try{jsonpatch[_0xc3ad('0x22')](_0x35d5ab,_0xb06c4f,!![]);}catch(_0x5653cb){return BPromise[_0xc3ad('0x23')](_0x5653cb);}return _0x35d5ab[_0xc3ad('0x24')]();};}function saveUpdates(_0x15f425,_0xbfe8e3){return function(_0x4511a8){if(_0x4511a8){return _0x4511a8[_0xc3ad('0x25')](_0x15f425)[_0xc3ad('0x26')](function(_0x367c77){return _0x367c77;});}return null;};}function removeEntity(_0x1867c9,_0x3e6285){return function(_0x48e4ba){if(_0x48e4ba){return _0x48e4ba[_0xc3ad('0x27')]()[_0xc3ad('0x26')](function(){var _0x338049=_0x48e4ba[_0xc3ad('0x28')]({'plain':!![]});var _0x3e191c=_0xc3ad('0x29');return db[_0xc3ad('0x2a')][_0xc3ad('0x27')]({'where':{'type':_0x3e191c,'resourceId':_0x338049['id']}})[_0xc3ad('0x26')](function(){return _0x48e4ba;});})[_0xc3ad('0x26')](function(){_0x1867c9['status'](0xcc)[_0xc3ad('0x1a')]();});}};}function handleEntityNotFound(_0x34e231,_0x11f219){return function(_0x538754){if(!_0x538754){_0x34e231[_0xc3ad('0x18')](0x194);}return _0x538754;};}function handleError(_0x75ede9,_0x29e7d2){_0x29e7d2=_0x29e7d2||0x1f4;return function(_0x406fe5){logger[_0xc3ad('0x2b')](_0x406fe5[_0xc3ad('0x2c')]);if(_0x406fe5['name']){delete _0x406fe5[_0xc3ad('0x2d')];}_0x75ede9[_0xc3ad('0x19')](_0x29e7d2)[_0xc3ad('0x2e')](_0x406fe5);};}exports['index']=function(_0x1a1d03,_0x466ecf){var _0x191e07={},_0x240aa0={},_0x317536={'count':0x0,'rows':[]};var _0x1eae2a=_[_0xc3ad('0x2f')](db[_0xc3ad('0x30')][_0xc3ad('0x31')],function(_0x136705){return{'name':_0x136705['fieldName'],'type':_0x136705[_0xc3ad('0x32')]['key']};});_0x240aa0['model']=_[_0xc3ad('0x2f')](_0x1eae2a,_0xc3ad('0x2d'));_0x240aa0['query']=_[_0xc3ad('0x33')](_0x1a1d03[_0xc3ad('0x34')]);_0x240aa0[_0xc3ad('0x35')]=_['intersection'](_0x240aa0[_0xc3ad('0x36')],_0x240aa0[_0xc3ad('0x34')]);_0x191e07['attributes']=_[_0xc3ad('0x37')](_0x240aa0[_0xc3ad('0x36')],qs[_0xc3ad('0x38')](_0x1a1d03[_0xc3ad('0x34')][_0xc3ad('0x38')]));_0x191e07[_0xc3ad('0x39')]=_0x191e07[_0xc3ad('0x39')][_0xc3ad('0x3a')]?_0x191e07[_0xc3ad('0x39')]:_0x240aa0[_0xc3ad('0x36')];if(!_0x1a1d03['query'][_0xc3ad('0x3b')](_0xc3ad('0x3c'))){_0x191e07[_0xc3ad('0x1d')]=qs[_0xc3ad('0x1d')](_0x1a1d03[_0xc3ad('0x34')][_0xc3ad('0x1d')]);_0x191e07['offset']=qs[_0xc3ad('0x1f')](_0x1a1d03['query']['offset']);}_0x191e07[_0xc3ad('0x3d')]=qs[_0xc3ad('0x3e')](_0x1a1d03[_0xc3ad('0x34')][_0xc3ad('0x3e')]);delete _0x1a1d03[_0xc3ad('0x34')]['sort'];_0x191e07[_0xc3ad('0x3f')]=qs[_0xc3ad('0x35')](_['pick'](_0x1a1d03[_0xc3ad('0x34')],_0x240aa0[_0xc3ad('0x35')]),_0x1eae2a);if(_0x1a1d03['query']['filter']){_0x191e07[_0xc3ad('0x3f')]=_['merge'](_0x191e07['where'],{'$or':_[_0xc3ad('0x2f')](_0x1eae2a,function(_0x4bce59){if(_0x4bce59[_0xc3ad('0x32')]!==_0xc3ad('0x40')){var _0x217a6b={};_0x217a6b[_0x4bce59[_0xc3ad('0x2d')]]={'$like':'%'+_0x1a1d03[_0xc3ad('0x34')][_0xc3ad('0x41')]+'%'};return _0x217a6b;}})});}_0x191e07=_[_0xc3ad('0x42')]({},_0x191e07,_0x1a1d03[_0xc3ad('0x43')]);var _0x2e49f8={'where':_0x191e07[_0xc3ad('0x3f')]};return db[_0xc3ad('0x30')][_0xc3ad('0x1e')](_0x2e49f8)[_0xc3ad('0x26')](function(_0x29202b){_0x317536[_0xc3ad('0x1e')]=_0x29202b;if(_0x1a1d03[_0xc3ad('0x34')][_0xc3ad('0x44')]){_0x191e07[_0xc3ad('0x45')]=[{'all':!![]}];}return db[_0xc3ad('0x30')]['findAll'](_0x191e07);})['then'](function(_0x1ab20d){_0x317536[_0xc3ad('0x46')]=_0x1ab20d;return _0x317536;})[_0xc3ad('0x26')](respondWithFilteredResult(_0x466ecf,_0x191e07))[_0xc3ad('0x47')](handleError(_0x466ecf,null));};exports[_0xc3ad('0x48')]=function(_0x14f97f,_0x28382c){var _0x5ae60c={'raw':![],'where':{'id':_0x14f97f[_0xc3ad('0x49')]['id']}},_0x399e2a={};_0x399e2a['model']=_[_0xc3ad('0x33')](db['VoiceMusicOnHold'][_0xc3ad('0x31')]);_0x399e2a[_0xc3ad('0x34')]=_[_0xc3ad('0x33')](_0x14f97f[_0xc3ad('0x34')]);_0x399e2a[_0xc3ad('0x35')]=_[_0xc3ad('0x37')](_0x399e2a[_0xc3ad('0x36')],_0x399e2a['query']);_0x5ae60c[_0xc3ad('0x39')]=_[_0xc3ad('0x37')](_0x399e2a[_0xc3ad('0x36')],qs[_0xc3ad('0x38')](_0x14f97f[_0xc3ad('0x34')][_0xc3ad('0x38')]));_0x5ae60c[_0xc3ad('0x39')]=_0x5ae60c['attributes'][_0xc3ad('0x3a')]?_0x5ae60c['attributes']:_0x399e2a['model'];if(_0x14f97f['query']['includeAll']){_0x5ae60c['include']=[{'all':!![]}];}_0x5ae60c=_['merge']({},_0x5ae60c,_0x14f97f[_0xc3ad('0x43')]);return db['VoiceMusicOnHold']['find'](_0x5ae60c)['then'](handleEntityNotFound(_0x28382c,null))[_0xc3ad('0x26')](respondWithResult(_0x28382c,null))[_0xc3ad('0x47')](handleError(_0x28382c,null));};exports['update']=function(_0x571fb0,_0x5d00cc){if(_0x571fb0[_0xc3ad('0x4a')]['id']){delete _0x571fb0['body']['id'];}return db[_0xc3ad('0x30')][_0xc3ad('0x4b')]({'where':{'id':_0x571fb0[_0xc3ad('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d00cc,null))[_0xc3ad('0x26')](saveUpdates(_0x571fb0[_0xc3ad('0x4a')],null))[_0xc3ad('0x26')](respondWithResult(_0x5d00cc,null))[_0xc3ad('0x47')](handleError(_0x5d00cc,null));};exports['create']=function(_0x471fba,_0x31fb22,_0x5d1432){return db[_0xc3ad('0x4c')][_0xc3ad('0x4d')](function(_0x594344){if(_0x471fba[_0xc3ad('0x4a')][_0xc3ad('0x4e')]===_0xc3ad('0x4f')){_0x471fba[_0xc3ad('0x4a')][_0xc3ad('0x50')]=path[_0xc3ad('0x51')](config[_0xc3ad('0x52')],'server/files/moh',_0x471fba[_0xc3ad('0x4a')][_0xc3ad('0x2d')]);}return db[_0xc3ad('0x30')][_0xc3ad('0x53')](_0x471fba[_0xc3ad('0x4a')],{'transaction':_0x594344})['then'](function(_0xd3fc3a){if(_0x471fba[_0xc3ad('0x4a')][_0xc3ad('0x4e')]===_0xc3ad('0x4f')){fs[_0xc3ad('0x54')](_0xd3fc3a[_0xc3ad('0x50')],parseInt(_0xc3ad('0x55'),0x8));}var _0x1fdc32=_0x471fba[_0xc3ad('0x56')][_0xc3ad('0x28')]({'plain':!![]});if(!_0x1fdc32)throw new Error(_0xc3ad('0x57'));if(_0x1fdc32[_0xc3ad('0x58')]===_0xc3ad('0x56')){var _0x397f4c=_0xd3fc3a[_0xc3ad('0x28')]({'plain':!![]});return db[_0xc3ad('0x59')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x1fdc32['userProfileId']},'raw':!![]})[_0xc3ad('0x26')](function(_0xebcfd5){if(_0xebcfd5&&_0xebcfd5[_0xc3ad('0x5a')]===0x0){return db[_0xc3ad('0x2a')]['create']({'name':_0x397f4c[_0xc3ad('0x2d')],'resourceId':_0x397f4c['id'],'type':_0xebcfd5[_0xc3ad('0x2d')],'sectionId':_0xebcfd5['id']},{})[_0xc3ad('0x26')](function(){return _0xd3fc3a;});}else{return _0xd3fc3a;}})['catch'](function(_0xf4f34f){logger[_0xc3ad('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf4f34f);});}return _0xd3fc3a;});})[_0xc3ad('0x26')](respondWithResult(_0x31fb22,0xc9))['catch'](handleError(_0x31fb22,null));};exports[_0xc3ad('0x27')]=function(_0x2f634a,_0x174eb8,_0x244cd4){var _0x4b7cab;return db['VoiceMusicOnHold'][_0xc3ad('0x4b')]({'where':{'id':_0x2f634a[_0xc3ad('0x49')]['id']}})[_0xc3ad('0x26')](function(_0x5b1244){if(_0x5b1244){return db[_0xc3ad('0x4c')][_0xc3ad('0x4d')](function(_0x5a820d){return _0x5b1244[_0xc3ad('0x27')]({'transaction':_0x5a820d,'raw':!![]})[_0xc3ad('0x26')](function(_0x1b23db){if(_0x1b23db[_0xc3ad('0x50')]){fs[_0xc3ad('0x5b')](_0x1b23db[_0xc3ad('0x50')])['forEach'](function(_0x6f50ac){fs[_0xc3ad('0x5c')](path[_0xc3ad('0x51')](_0x1b23db['directory'],_0x6f50ac));});fs['rmdirSync'](_0x1b23db[_0xc3ad('0x50')]);}return _0x1b23db;});})[_0xc3ad('0x47')](function(_0x4ee547){throw new db[(_0xc3ad('0x5d'))]['ValidationError'](_0x4ee547[_0xc3ad('0x5e')]);});}})['then'](handleEntityNotFound(_0x174eb8,null))[_0xc3ad('0x26')](removeEntity(_0x174eb8,null))[_0xc3ad('0x47')](handleError(_0x174eb8,null));};exports[_0xc3ad('0x5f')]=function(_0x563e79,_0x50f0f1,_0x1950ed){return db[_0xc3ad('0x4c')][_0xc3ad('0x4d')](function(_0x57cecf){var _0x1662a1;return db[_0xc3ad('0x30')][_0xc3ad('0x4b')]({'where':{'id':_0x563e79['params']['id']}})['then'](function(_0x1a1ec4){if(_0x1a1ec4){_0x1662a1=_0x1a1ec4;return _0x1a1ec4[_0xc3ad('0x5f')](_0x563e79[_0xc3ad('0x4a')]['id'],{'transaction':_0x57cecf});}})[_0xc3ad('0x26')](function(_0x4bda58){if(_0x4bda58){return db[_0xc3ad('0x60')][_0xc3ad('0x61')]({'where':{'id':_0x563e79['body']['id']},'attributes':['id','name',_0xc3ad('0x62'),_0xc3ad('0x63'),_0xc3ad('0x64')],'raw':!![]});}})[_0xc3ad('0x26')](function(_0x1170fe){if(_0x1170fe){var _0x1a2abe=path[_0xc3ad('0x51')](config[_0xc3ad('0x52')],_0xc3ad('0x65'),util['format'](_0xc3ad('0x66'),path[_0xc3ad('0x67')](_0x1170fe[_0xc3ad('0x62')],path[_0xc3ad('0x68')](_0x1170fe[_0xc3ad('0x62')])),_0x1170fe[_0xc3ad('0x63')]));var _0x2fa250=path[_0xc3ad('0x51')](config[_0xc3ad('0x52')],_0xc3ad('0x69'),_0x1662a1[_0xc3ad('0x2d')],util[_0xc3ad('0x6a')]('%s.%s',_0x1170fe[_0xc3ad('0x2d')],_0x1170fe[_0xc3ad('0x63')]));fs['symlinkSync'](_0x1a2abe,_0x2fa250);return _0x1170fe;}})['catch'](function(_0x543499){throw new db[(_0xc3ad('0x5d'))][(_0xc3ad('0x6b'))](_0x543499['message']);});})[_0xc3ad('0x26')](handleEntityNotFound(_0x50f0f1,null))[_0xc3ad('0x26')](respondWithResult(_0x50f0f1,0xc9))['catch'](handleError(_0x50f0f1,null));};exports[_0xc3ad('0x6c')]=function(_0x3edcd3,_0x248ebb,_0x1436d4){return db[_0xc3ad('0x4c')]['transaction'](function(_0x30a432){var _0x42e927;return db[_0xc3ad('0x30')][_0xc3ad('0x61')]({'where':{'id':_0x3edcd3[_0xc3ad('0x49')]['id']}})[_0xc3ad('0x26')](handleEntityNotFound(_0x248ebb,null))['then'](function(_0x144549){if(_0x144549){_0x42e927=_0x144549;return _0x144549[_0xc3ad('0x6c')](_0x3edcd3['params'][_0xc3ad('0x6d')]);}})[_0xc3ad('0x26')](function(_0x42ee51){if(_0x42ee51){return db['Sound'][_0xc3ad('0x61')]({'where':{'id':_0x3edcd3[_0xc3ad('0x49')][_0xc3ad('0x6d')]},'attributes':['id',_0xc3ad('0x2d'),_0xc3ad('0x62'),_0xc3ad('0x63'),_0xc3ad('0x64')],'raw':!![]});}})[_0xc3ad('0x26')](function(_0x4128af){if(_0x4128af){fs['unlinkSync'](path[_0xc3ad('0x51')](_0x42e927[_0xc3ad('0x50')],util[_0xc3ad('0x6a')]('%s.%s',_0x4128af['name'],_0x4128af[_0xc3ad('0x63')])));return _0x4128af;}})[_0xc3ad('0x47')](function(_0x1af2cd){throw new db['Sequelize'][(_0xc3ad('0x6b'))](_0x1af2cd['message']);});})[_0xc3ad('0x26')](handleEntityNotFound(_0x248ebb,null))[_0xc3ad('0x26')](respondWithStatusCode(_0x248ebb,0xcc))[_0xc3ad('0x47')](handleError(_0x248ebb,null));};exports[_0xc3ad('0x6e')]=function(_0x4cb6e4,_0x329497,_0x1a770f){var _0x4fbee1={};var _0x419bfa={};var _0x4ce40e;var _0x5d8874;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x4cb6e4[_0xc3ad('0x49')]['id']}})[_0xc3ad('0x26')](handleEntityNotFound(_0x329497,null))[_0xc3ad('0x26')](function(_0x2ae1be){if(_0x2ae1be){_0x4ce40e=_0x2ae1be;_0x419bfa['model']=_[_0xc3ad('0x33')](db[_0xc3ad('0x60')]['rawAttributes']);_0x419bfa[_0xc3ad('0x34')]=_[_0xc3ad('0x33')](_0x4cb6e4[_0xc3ad('0x34')]);_0x419bfa[_0xc3ad('0x35')]=_[_0xc3ad('0x37')](_0x419bfa[_0xc3ad('0x36')],_0x419bfa['query']);_0x4fbee1[_0xc3ad('0x39')]=_[_0xc3ad('0x37')](_0x419bfa[_0xc3ad('0x36')],qs[_0xc3ad('0x38')](_0x4cb6e4['query'][_0xc3ad('0x38')]));_0x4fbee1[_0xc3ad('0x39')]=_0x4fbee1['attributes'][_0xc3ad('0x3a')]?_0x4fbee1[_0xc3ad('0x39')]:_0x419bfa[_0xc3ad('0x36')];_0x4fbee1[_0xc3ad('0x3d')]=qs[_0xc3ad('0x3e')](_0x4cb6e4[_0xc3ad('0x34')][_0xc3ad('0x3e')]);_0x4fbee1[_0xc3ad('0x3f')]=qs['filters'](_[_0xc3ad('0x6f')](_0x4cb6e4[_0xc3ad('0x34')],_0x419bfa[_0xc3ad('0x35')]));if(_0x4cb6e4[_0xc3ad('0x34')]['filter']){_0x4fbee1[_0xc3ad('0x3f')]=_[_0xc3ad('0x42')](_0x4fbee1[_0xc3ad('0x3f')],{'$or':_[_0xc3ad('0x2f')](_0x4fbee1['attributes'],function(_0x3e15f0){var _0x3b6ac4={};_0x3b6ac4[_0x3e15f0]={'$like':'%'+_0x4cb6e4['query'][_0xc3ad('0x41')]+'%'};return _0x3b6ac4;})});}_0x4fbee1=_[_0xc3ad('0x42')]({},_0x4fbee1,_0x4cb6e4['options']);return _0x4ce40e[_0xc3ad('0x6e')](_0x4fbee1);}})[_0xc3ad('0x26')](function(_0x5f0934){if(_0x5f0934){_0x5d8874=_0x5f0934[_0xc3ad('0x3a')];if(!_0x4cb6e4['query'][_0xc3ad('0x3b')](_0xc3ad('0x3c'))){_0x4fbee1[_0xc3ad('0x1d')]=qs['limit'](_0x4cb6e4['query'][_0xc3ad('0x1d')]);_0x4fbee1[_0xc3ad('0x1f')]=qs[_0xc3ad('0x1f')](_0x4cb6e4['query'][_0xc3ad('0x1f')]);}return _0x4ce40e[_0xc3ad('0x6e')](_0x4fbee1);}})[_0xc3ad('0x26')](function(_0x487700){if(_0x487700){return _0x487700?{'count':_0x5d8874,'rows':_0x487700}:null;}})[_0xc3ad('0x26')](respondWithResult(_0x329497,null))[_0xc3ad('0x47')](handleError(_0x329497,null));};
\ No newline at end of file
+var _0xa3f5=['Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','basename','join','format','ValidationError','removeSound','id2','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','body','find','create','sequelize','mode','directory','server/files/moh','files','mkdirSync','0777','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound'];(function(_0x5a89a2,_0x121c88){var _0x4a6c15=function(_0x47ffc8){while(--_0x47ffc8){_0x5a89a2['push'](_0x5a89a2['shift']());}};_0x4a6c15(++_0x121c88);}(_0xa3f5,0x83));var _0x5a3f=function(_0x1d5ea8,_0x207732){_0x1d5ea8=_0x1d5ea8-0x0;var _0x42a9d6=_0xa3f5[_0x1d5ea8];return _0x42a9d6;};'use strict';var emlformat=require(_0x5a3f('0x0'));var rimraf=require(_0x5a3f('0x1'));var zipdir=require(_0x5a3f('0x2'));var jsonpatch=require(_0x5a3f('0x3'));var rp=require(_0x5a3f('0x4'));var moment=require(_0x5a3f('0x5'));var BPromise=require(_0x5a3f('0x6'));var Mustache=require(_0x5a3f('0x7'));var util=require(_0x5a3f('0x8'));var path=require('path');var sox=require(_0x5a3f('0x9'));var csv=require(_0x5a3f('0xa'));var ejs=require(_0x5a3f('0xb'));var fs=require('fs');var fs_extra=require(_0x5a3f('0xc'));var _=require(_0x5a3f('0xd'));var squel=require(_0x5a3f('0xe'));var crypto=require(_0x5a3f('0xf'));var jsforce=require(_0x5a3f('0x10'));var deskjs=require(_0x5a3f('0x11'));var toCsv=require(_0x5a3f('0xa'));var querystring=require(_0x5a3f('0x12'));var Papa=require(_0x5a3f('0x13'));var Redis=require('ioredis');var authService=require(_0x5a3f('0x14'));var qs=require(_0x5a3f('0x15'));var as=require(_0x5a3f('0x16'));var hardwareService=require(_0x5a3f('0x17'));var logger=require(_0x5a3f('0x18'))(_0x5a3f('0x19'));var utils=require(_0x5a3f('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x5a3f('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x498030,_0x4fbfea){_0x4fbfea=_0x4fbfea||0xcc;return function(_0x40a8d0){if(_0x40a8d0){return _0x498030['sendStatus'](_0x4fbfea);}return _0x498030[_0x5a3f('0x1c')](_0x4fbfea)[_0x5a3f('0x1d')]();};}function respondWithResult(_0x3d220d,_0x153710){_0x153710=_0x153710||0xc8;return function(_0x2bf9eb){if(_0x2bf9eb){return _0x3d220d['status'](_0x153710)[_0x5a3f('0x1e')](_0x2bf9eb);}};}function respondWithFilteredResult(_0x1af7b4,_0x2ff6f0){return function(_0x4171e7){if(_0x4171e7){var _0x1f5c3d=typeof _0x2ff6f0[_0x5a3f('0x1f')]===_0x5a3f('0x20')&&typeof _0x2ff6f0[_0x5a3f('0x21')]===_0x5a3f('0x20');var _0x155b5b=_0x4171e7[_0x5a3f('0x22')];var _0x3dc598=_0x1f5c3d?0x0:_0x2ff6f0[_0x5a3f('0x1f')];var _0x490643=_0x1f5c3d?_0x4171e7['count']:_0x2ff6f0[_0x5a3f('0x1f')]+_0x2ff6f0[_0x5a3f('0x21')];var _0x261423;if(_0x490643>=_0x155b5b){_0x490643=_0x155b5b;_0x261423=0xc8;}else{_0x261423=0xce;}_0x1af7b4[_0x5a3f('0x1c')](_0x261423);return _0x1af7b4['set'](_0x5a3f('0x23'),_0x3dc598+'-'+_0x490643+'/'+_0x155b5b)['json'](_0x4171e7);}return null;};}function patchUpdates(_0x1cec48){return function(_0x520636){try{jsonpatch[_0x5a3f('0x24')](_0x520636,_0x1cec48,!![]);}catch(_0x3298fe){return BPromise[_0x5a3f('0x25')](_0x3298fe);}return _0x520636[_0x5a3f('0x26')]();};}function saveUpdates(_0x4401c3,_0x51fd67){return function(_0x18f1b8){if(_0x18f1b8){return _0x18f1b8[_0x5a3f('0x27')](_0x4401c3)[_0x5a3f('0x28')](function(_0x379350){return _0x379350;});}return null;};}function removeEntity(_0x128f04,_0xe115a0){return function(_0x3a3740){if(_0x3a3740){return _0x3a3740[_0x5a3f('0x29')]()[_0x5a3f('0x28')](function(){var _0x370050=_0x3a3740[_0x5a3f('0x2a')]({'plain':!![]});var _0x46fd2a=_0x5a3f('0x2b');return db[_0x5a3f('0x2c')][_0x5a3f('0x29')]({'where':{'type':_0x46fd2a,'resourceId':_0x370050['id']}})['then'](function(){return _0x3a3740;});})[_0x5a3f('0x28')](function(){_0x128f04[_0x5a3f('0x1c')](0xcc)[_0x5a3f('0x1d')]();});}};}function handleEntityNotFound(_0x413cec,_0x27b112){return function(_0x227188){if(!_0x227188){_0x413cec[_0x5a3f('0x2d')](0x194);}return _0x227188;};}function handleError(_0x1c5e5c,_0x2679a2){_0x2679a2=_0x2679a2||0x1f4;return function(_0x29e384){logger[_0x5a3f('0x2e')](_0x29e384[_0x5a3f('0x2f')]);if(_0x29e384[_0x5a3f('0x30')]){delete _0x29e384['name'];}_0x1c5e5c[_0x5a3f('0x1c')](_0x2679a2)[_0x5a3f('0x31')](_0x29e384);};}exports[_0x5a3f('0x32')]=function(_0x4fa0f8,_0x5245e8){var _0x2da653={},_0xab95f5={},_0x42bf3b={'count':0x0,'rows':[]};var _0x336807=_[_0x5a3f('0x33')](db[_0x5a3f('0x34')][_0x5a3f('0x35')],function(_0x2eee58){return{'name':_0x2eee58[_0x5a3f('0x36')],'type':_0x2eee58['type'][_0x5a3f('0x37')]};});_0xab95f5[_0x5a3f('0x38')]=_[_0x5a3f('0x33')](_0x336807,_0x5a3f('0x30'));_0xab95f5[_0x5a3f('0x39')]=_['keys'](_0x4fa0f8[_0x5a3f('0x39')]);_0xab95f5[_0x5a3f('0x3a')]=_[_0x5a3f('0x3b')](_0xab95f5[_0x5a3f('0x38')],_0xab95f5[_0x5a3f('0x39')]);_0x2da653[_0x5a3f('0x3c')]=_['intersection'](_0xab95f5[_0x5a3f('0x38')],qs[_0x5a3f('0x3d')](_0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x3d')]));_0x2da653['attributes']=_0x2da653[_0x5a3f('0x3c')][_0x5a3f('0x3e')]?_0x2da653[_0x5a3f('0x3c')]:_0xab95f5['model'];if(!_0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x3f')]('nolimit')){_0x2da653['limit']=qs[_0x5a3f('0x21')](_0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x21')]);_0x2da653[_0x5a3f('0x1f')]=qs['offset'](_0x4fa0f8['query'][_0x5a3f('0x1f')]);}_0x2da653[_0x5a3f('0x40')]=qs['sort'](_0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x41')]);delete _0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x41')];_0x2da653[_0x5a3f('0x42')]=qs[_0x5a3f('0x3a')](_[_0x5a3f('0x43')](_0x4fa0f8['query'],_0xab95f5[_0x5a3f('0x3a')]),_0x336807);if(_0x4fa0f8['query'][_0x5a3f('0x44')]){_0x2da653[_0x5a3f('0x42')]=_[_0x5a3f('0x45')](_0x2da653['where'],{'$or':_[_0x5a3f('0x33')](_0x336807,function(_0x503223){if(_0x503223[_0x5a3f('0x46')]!==_0x5a3f('0x47')){var _0x5b2fe6={};_0x5b2fe6[_0x503223['name']]={'$like':'%'+_0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x44')]+'%'};return _0x5b2fe6;}})});}_0x2da653=_[_0x5a3f('0x45')]({},_0x2da653,_0x4fa0f8[_0x5a3f('0x48')]);var _0x413cb1={'where':_0x2da653[_0x5a3f('0x42')]};return db[_0x5a3f('0x34')][_0x5a3f('0x22')](_0x413cb1)[_0x5a3f('0x28')](function(_0x30da23){_0x42bf3b[_0x5a3f('0x22')]=_0x30da23;if(_0x4fa0f8[_0x5a3f('0x39')][_0x5a3f('0x49')]){_0x2da653[_0x5a3f('0x4a')]=[{'all':!![]}];}return db[_0x5a3f('0x34')][_0x5a3f('0x4b')](_0x2da653);})[_0x5a3f('0x28')](function(_0x53f03e){_0x42bf3b[_0x5a3f('0x4c')]=_0x53f03e;return _0x42bf3b;})[_0x5a3f('0x28')](respondWithFilteredResult(_0x5245e8,_0x2da653))[_0x5a3f('0x4d')](handleError(_0x5245e8,null));};exports['show']=function(_0x733533,_0x1d697a){var _0x253049={'raw':![],'where':{'id':_0x733533[_0x5a3f('0x4e')]['id']}},_0xa87b17={};_0xa87b17[_0x5a3f('0x38')]=_[_0x5a3f('0x4f')](db['VoiceMusicOnHold']['rawAttributes']);_0xa87b17[_0x5a3f('0x39')]=_[_0x5a3f('0x4f')](_0x733533[_0x5a3f('0x39')]);_0xa87b17[_0x5a3f('0x3a')]=_['intersection'](_0xa87b17['model'],_0xa87b17[_0x5a3f('0x39')]);_0x253049[_0x5a3f('0x3c')]=_[_0x5a3f('0x3b')](_0xa87b17['model'],qs[_0x5a3f('0x3d')](_0x733533['query'][_0x5a3f('0x3d')]));_0x253049['attributes']=_0x253049[_0x5a3f('0x3c')][_0x5a3f('0x3e')]?_0x253049[_0x5a3f('0x3c')]:_0xa87b17[_0x5a3f('0x38')];if(_0x733533[_0x5a3f('0x39')][_0x5a3f('0x49')]){_0x253049['include']=[{'all':!![]}];}_0x253049=_[_0x5a3f('0x45')]({},_0x253049,_0x733533[_0x5a3f('0x48')]);return db['VoiceMusicOnHold']['find'](_0x253049)['then'](handleEntityNotFound(_0x1d697a,null))[_0x5a3f('0x28')](respondWithResult(_0x1d697a,null))['catch'](handleError(_0x1d697a,null));};exports[_0x5a3f('0x27')]=function(_0x371d67,_0x34b708){if(_0x371d67[_0x5a3f('0x50')]['id']){delete _0x371d67[_0x5a3f('0x50')]['id'];}return db[_0x5a3f('0x34')][_0x5a3f('0x51')]({'where':{'id':_0x371d67[_0x5a3f('0x4e')]['id']}})[_0x5a3f('0x28')](handleEntityNotFound(_0x34b708,null))[_0x5a3f('0x28')](saveUpdates(_0x371d67['body'],null))[_0x5a3f('0x28')](respondWithResult(_0x34b708,null))[_0x5a3f('0x4d')](handleError(_0x34b708,null));};exports[_0x5a3f('0x52')]=function(_0x22621a,_0x346fe6,_0x245724){return db[_0x5a3f('0x53')]['transaction'](function(_0x54b941){if(_0x22621a['body'][_0x5a3f('0x54')]==='files'){_0x22621a[_0x5a3f('0x50')][_0x5a3f('0x55')]=path['join'](config['root'],_0x5a3f('0x56'),_0x22621a[_0x5a3f('0x50')][_0x5a3f('0x30')]);}return db['VoiceMusicOnHold'][_0x5a3f('0x52')](_0x22621a[_0x5a3f('0x50')],{'transaction':_0x54b941})[_0x5a3f('0x28')](function(_0x42575a){if(_0x22621a[_0x5a3f('0x50')][_0x5a3f('0x54')]===_0x5a3f('0x57')){fs[_0x5a3f('0x58')](_0x42575a[_0x5a3f('0x55')],parseInt(_0x5a3f('0x59'),0x8));}var _0x12fbb3=_0x22621a[_0x5a3f('0x5a')]['get']({'plain':!![]});if(!_0x12fbb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12fbb3[_0x5a3f('0x5b')]===_0x5a3f('0x5a')){var _0x59a48a=_0x42575a[_0x5a3f('0x2a')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5a3f('0x2b'),'userProfileId':_0x12fbb3['userProfileId']},'raw':!![]})[_0x5a3f('0x28')](function(_0x1ed4a7){if(_0x1ed4a7&&_0x1ed4a7['autoAssociation']===0x0){return db[_0x5a3f('0x2c')][_0x5a3f('0x52')]({'name':_0x59a48a['name'],'resourceId':_0x59a48a['id'],'type':_0x1ed4a7[_0x5a3f('0x30')],'sectionId':_0x1ed4a7['id']},{})['then'](function(){return _0x42575a;});}else{return _0x42575a;}})[_0x5a3f('0x4d')](function(_0x228e1e){logger['error'](_0x5a3f('0x5c'),_0x228e1e);});}return _0x42575a;});})['then'](respondWithResult(_0x346fe6,0xc9))[_0x5a3f('0x4d')](handleError(_0x346fe6,null));};exports['destroy']=function(_0x364c21,_0x132c01,_0x3758b4){var _0x59dee1;return db[_0x5a3f('0x34')][_0x5a3f('0x51')]({'where':{'id':_0x364c21[_0x5a3f('0x4e')]['id']}})['then'](function(_0x3182e2){if(_0x3182e2){return db[_0x5a3f('0x53')][_0x5a3f('0x5d')](function(_0xb79594){return _0x3182e2[_0x5a3f('0x29')]({'transaction':_0xb79594,'raw':!![]})['then'](function(_0x464c7c){if(_0x464c7c[_0x5a3f('0x55')]){fs[_0x5a3f('0x5e')](_0x464c7c['directory'])[_0x5a3f('0x5f')](function(_0x23d0ec){fs[_0x5a3f('0x60')](path['join'](_0x464c7c[_0x5a3f('0x55')],_0x23d0ec));});fs[_0x5a3f('0x61')](_0x464c7c[_0x5a3f('0x55')]);}return _0x464c7c;});})['catch'](function(_0x5f1db4){throw new db[(_0x5a3f('0x62'))]['ValidationError'](_0x5f1db4[_0x5a3f('0x63')]);});}})[_0x5a3f('0x28')](handleEntityNotFound(_0x132c01,null))[_0x5a3f('0x28')](removeEntity(_0x132c01,null))['catch'](handleError(_0x132c01,null));};exports[_0x5a3f('0x64')]=function(_0xd12299,_0x2910c1,_0x3b1447){return db[_0x5a3f('0x53')]['transaction'](function(_0x2ddd33){var _0x54ab2d;return db[_0x5a3f('0x34')][_0x5a3f('0x51')]({'where':{'id':_0xd12299[_0x5a3f('0x4e')]['id']}})['then'](function(_0x4a6993){if(_0x4a6993){_0x54ab2d=_0x4a6993;return _0x4a6993[_0x5a3f('0x64')](_0xd12299[_0x5a3f('0x50')]['id'],{'transaction':_0x2ddd33});}})[_0x5a3f('0x28')](function(_0x3b9b91){if(_0x3b9b91){return db[_0x5a3f('0x65')][_0x5a3f('0x66')]({'where':{'id':_0xd12299[_0x5a3f('0x50')]['id']},'attributes':['id',_0x5a3f('0x30'),_0x5a3f('0x67'),_0x5a3f('0x68'),_0x5a3f('0x69')],'raw':!![]});}})[_0x5a3f('0x28')](function(_0x34ee63){if(_0x34ee63){var _0x4b2c65=path['join'](config[_0x5a3f('0x6a')],_0x5a3f('0x6b'),util['format']('%s.%s',path[_0x5a3f('0x6c')](_0x34ee63[_0x5a3f('0x67')],path['extname'](_0x34ee63['save_name'])),_0x34ee63['converted_format']));var _0x444a48=path[_0x5a3f('0x6d')](config['root'],'server/files/moh',_0x54ab2d['name'],util[_0x5a3f('0x6e')]('%s.%s',_0x34ee63[_0x5a3f('0x30')],_0x34ee63[_0x5a3f('0x68')]));fs['symlinkSync'](_0x4b2c65,_0x444a48);return _0x34ee63;}})['catch'](function(_0x11a6a4){throw new db[(_0x5a3f('0x62'))][(_0x5a3f('0x6f'))](_0x11a6a4[_0x5a3f('0x63')]);});})[_0x5a3f('0x28')](handleEntityNotFound(_0x2910c1,null))[_0x5a3f('0x28')](respondWithResult(_0x2910c1,0xc9))['catch'](handleError(_0x2910c1,null));};exports[_0x5a3f('0x70')]=function(_0x4de7ee,_0x171911,_0x17cc65){return db[_0x5a3f('0x53')][_0x5a3f('0x5d')](function(_0x544b72){var _0xf820fb;return db[_0x5a3f('0x34')][_0x5a3f('0x66')]({'where':{'id':_0x4de7ee['params']['id']}})[_0x5a3f('0x28')](handleEntityNotFound(_0x171911,null))[_0x5a3f('0x28')](function(_0x1543f4){if(_0x1543f4){_0xf820fb=_0x1543f4;return _0x1543f4[_0x5a3f('0x70')](_0x4de7ee[_0x5a3f('0x4e')][_0x5a3f('0x71')]);}})[_0x5a3f('0x28')](function(_0x30ae0f){if(_0x30ae0f){return db[_0x5a3f('0x65')][_0x5a3f('0x66')]({'where':{'id':_0x4de7ee['params'][_0x5a3f('0x71')]},'attributes':['id',_0x5a3f('0x30'),_0x5a3f('0x67'),'converted_format','createdAt'],'raw':!![]});}})[_0x5a3f('0x28')](function(_0x1b0c6b){if(_0x1b0c6b){fs[_0x5a3f('0x60')](path['join'](_0xf820fb[_0x5a3f('0x55')],util[_0x5a3f('0x6e')]('%s.%s',_0x1b0c6b['name'],_0x1b0c6b[_0x5a3f('0x68')])));return _0x1b0c6b;}})[_0x5a3f('0x4d')](function(_0x2869e4){throw new db['Sequelize'][(_0x5a3f('0x6f'))](_0x2869e4[_0x5a3f('0x63')]);});})['then'](handleEntityNotFound(_0x171911,null))['then'](respondWithStatusCode(_0x171911,0xcc))[_0x5a3f('0x4d')](handleError(_0x171911,null));};exports[_0x5a3f('0x72')]=function(_0x4348c3,_0x384aa7,_0x37e928){var _0x32f75b={};var _0x14170c={};var _0x10e293;var _0x4ade6d;return db[_0x5a3f('0x34')][_0x5a3f('0x66')]({'where':{'id':_0x4348c3[_0x5a3f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x384aa7,null))['then'](function(_0x254ec7){if(_0x254ec7){_0x10e293=_0x254ec7;_0x14170c[_0x5a3f('0x38')]=_[_0x5a3f('0x4f')](db[_0x5a3f('0x65')][_0x5a3f('0x35')]);_0x14170c[_0x5a3f('0x39')]=_['keys'](_0x4348c3['query']);_0x14170c[_0x5a3f('0x3a')]=_[_0x5a3f('0x3b')](_0x14170c[_0x5a3f('0x38')],_0x14170c['query']);_0x32f75b[_0x5a3f('0x3c')]=_[_0x5a3f('0x3b')](_0x14170c[_0x5a3f('0x38')],qs[_0x5a3f('0x3d')](_0x4348c3[_0x5a3f('0x39')][_0x5a3f('0x3d')]));_0x32f75b[_0x5a3f('0x3c')]=_0x32f75b[_0x5a3f('0x3c')][_0x5a3f('0x3e')]?_0x32f75b[_0x5a3f('0x3c')]:_0x14170c[_0x5a3f('0x38')];_0x32f75b['order']=qs[_0x5a3f('0x41')](_0x4348c3[_0x5a3f('0x39')][_0x5a3f('0x41')]);_0x32f75b['where']=qs['filters'](_['pick'](_0x4348c3['query'],_0x14170c[_0x5a3f('0x3a')]));if(_0x4348c3[_0x5a3f('0x39')][_0x5a3f('0x44')]){_0x32f75b[_0x5a3f('0x42')]=_['merge'](_0x32f75b['where'],{'$or':_[_0x5a3f('0x33')](_0x32f75b[_0x5a3f('0x3c')],function(_0x5171f4){var _0x557b04={};_0x557b04[_0x5171f4]={'$like':'%'+_0x4348c3['query'][_0x5a3f('0x44')]+'%'};return _0x557b04;})});}_0x32f75b=_['merge']({},_0x32f75b,_0x4348c3[_0x5a3f('0x48')]);return _0x10e293[_0x5a3f('0x72')](_0x32f75b);}})[_0x5a3f('0x28')](function(_0x12209d){if(_0x12209d){_0x4ade6d=_0x12209d['length'];if(!_0x4348c3[_0x5a3f('0x39')][_0x5a3f('0x3f')](_0x5a3f('0x73'))){_0x32f75b[_0x5a3f('0x21')]=qs['limit'](_0x4348c3[_0x5a3f('0x39')][_0x5a3f('0x21')]);_0x32f75b['offset']=qs[_0x5a3f('0x1f')](_0x4348c3[_0x5a3f('0x39')][_0x5a3f('0x1f')]);}return _0x10e293[_0x5a3f('0x72')](_0x32f75b);}})[_0x5a3f('0x28')](function(_0x4f389a){if(_0x4f389a){return _0x4f389a?{'count':_0x4ade6d,'rows':_0x4f389a}:null;}})['then'](respondWithResult(_0x384aa7,null))['catch'](handleError(_0x384aa7,null));};
\ No newline at end of file
index 3d94b9a..453d151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d0d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold'];(function(_0x1572e5,_0x316aec){var _0xa2f293=function(_0x2bd05d){while(--_0x2bd05d){_0x1572e5['push'](_0x1572e5['shift']());}};_0xa2f293(++_0x316aec);}(_0x9d0d,0x118));var _0xd9d0=function(_0xb6d413,_0x29051b){_0xb6d413=_0xb6d413-0x0;var _0x1382ef=_0x9d0d[_0xb6d413];return _0x1382ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd9d0('0x0'));var moment=require(_0xd9d0('0x1'));var BPromise=require(_0xd9d0('0x2'));var rp=require(_0xd9d0('0x3'));var fs=require('fs');var path=require(_0xd9d0('0x4'));var rimraf=require(_0xd9d0('0x5'));var config=require(_0xd9d0('0x6'));var attributes=require(_0xd9d0('0x7'));module[_0xd9d0('0x8')]=function(_0x14ce74,_0x5ee391){return _0x14ce74['define'](_0xd9d0('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a5f=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x330878,_0x3e5ec3){var _0x3a09f7=function(_0x451887){while(--_0x451887){_0x330878['push'](_0x330878['shift']());}};_0x3a09f7(++_0x3e5ec3);}(_0x5a5f,0x18a));var _0xf5a5=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0x5a5f[_0xf7c208];return _0x16992d;};'use strict';var _=require(_0xf5a5('0x0'));var util=require(_0xf5a5('0x1'));var logger=require(_0xf5a5('0x2'))(_0xf5a5('0x3'));var moment=require(_0xf5a5('0x4'));var BPromise=require(_0xf5a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a5('0x6'));var config=require(_0xf5a5('0x7'));var attributes=require(_0xf5a5('0x8'));module['exports']=function(_0x1a6d23,_0x2aacd9){return _0x1a6d23['define'](_0xf5a5('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c6d3b72..b6ff847 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x3b85a9,_0x4bef32){var _0x2dc38e=function(_0x12585f){while(--_0x12585f){_0x3b85a9['push'](_0x3b85a9['shift']());}};_0x2dc38e(++_0x4bef32);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xcb91[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
+var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x18bd1a,_0x51592e){var _0x4b850d=function(_0x526dd4){while(--_0x526dd4){_0x18bd1a['push'](_0x18bd1a['shift']());}};_0x4b850d(++_0x51592e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
index 42a9173..4d3a686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8375=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','util','path'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x8375,0x132));var _0x5837=function(_0x8764da,_0x27a51a){_0x8764da=_0x8764da-0x0;var _0x265af1=_0x8375[_0x8764da];return _0x265af1;};'use strict';var multer=require('multer');var util=require(_0x5837('0x0'));var path=require(_0x5837('0x1'));var timeout=require(_0x5837('0x2'));var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var controller=require('./voicePrefix.controller');router[_0x5837('0x8')]('/',auth[_0x5837('0x9')](),controller[_0x5837('0xa')]);router[_0x5837('0x8')]('/describe',auth[_0x5837('0x9')](),controller[_0x5837('0xb')]);router[_0x5837('0x8')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller[_0x5837('0xd')]);router[_0x5837('0x8')](_0x5837('0xe'),auth[_0x5837('0x9')](),controller['getAgents']);router[_0x5837('0x8')](_0x5837('0xf'),auth['isAuthenticated'](),controller[_0x5837('0x10')]);router[_0x5837('0x11')]('/',auth['isAuthenticated'](),controller[_0x5837('0x12')]);router['post'](_0x5837('0xe'),auth[_0x5837('0x9')](),controller[_0x5837('0x13')]);router[_0x5837('0x11')]('/:id/teams',auth[_0x5837('0x9')](),controller[_0x5837('0x14')]);router[_0x5837('0x15')]('/:id',auth[_0x5837('0x9')](),controller[_0x5837('0x16')]);router[_0x5837('0x17')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller[_0x5837('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x5837('0x19')]);router[_0x5837('0x17')](_0x5837('0xf'),auth[_0x5837('0x9')](),controller[_0x5837('0x1a')]);module[_0x5837('0x1b')]=router;
\ No newline at end of file
+var _0xbcba=['post','create','addAgents','addTeams','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/:id/users','/:id/teams','getTeams'];(function(_0x28a169,_0x4c52ca){var _0x12ff20=function(_0x5e7fa8){while(--_0x5e7fa8){_0x28a169['push'](_0x28a169['shift']());}};_0x12ff20(++_0x4c52ca);}(_0xbcba,0x6d));var _0xabcb=function(_0x437075,_0x41db9c){_0x437075=_0x437075-0x0;var _0x321067=_0xbcba[_0x437075];return _0x321067;};'use strict';var multer=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var path=require('path');var timeout=require(_0xabcb('0x2'));var express=require(_0xabcb('0x3'));var router=express[_0xabcb('0x4')]();var fs_extra=require(_0xabcb('0x5'));var auth=require(_0xabcb('0x6'));var interaction=require(_0xabcb('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xabcb('0x8')]('/',auth[_0xabcb('0x9')](),controller['index']);router['get'](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller['describe']);router['get'](_0xabcb('0xb'),auth['isAuthenticated'](),controller[_0xabcb('0xc')]);router[_0xabcb('0x8')](_0xabcb('0xd'),auth[_0xabcb('0x9')](),controller['getAgents']);router[_0xabcb('0x8')](_0xabcb('0xe'),auth[_0xabcb('0x9')](),controller[_0xabcb('0xf')]);router[_0xabcb('0x10')]('/',auth[_0xabcb('0x9')](),controller[_0xabcb('0x11')]);router[_0xabcb('0x10')]('/:id/users',auth[_0xabcb('0x9')](),controller[_0xabcb('0x12')]);router[_0xabcb('0x10')](_0xabcb('0xe'),auth[_0xabcb('0x9')](),controller[_0xabcb('0x13')]);router['put'](_0xabcb('0xb'),auth[_0xabcb('0x9')](),controller[_0xabcb('0x14')]);router[_0xabcb('0x15')](_0xabcb('0xb'),auth[_0xabcb('0x9')](),controller[_0xabcb('0x16')]);router[_0xabcb('0x15')](_0xabcb('0xd'),auth[_0xabcb('0x9')](),controller['removeAgents']);router[_0xabcb('0x15')](_0xabcb('0xe'),auth[_0xabcb('0x9')](),controller[_0xabcb('0x17')]);module[_0xabcb('0x18')]=router;
\ No newline at end of file
index 7188673..e9438df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafa0=['INTEGER','exports','STRING','name','system-','getDataValue'];(function(_0x5bad8f,_0x3a51ef){var _0x2f643a=function(_0x23e4ed){while(--_0x23e4ed){_0x5bad8f['push'](_0x5bad8f['shift']());}};_0x2f643a(++_0x3a51ef);}(_0xafa0,0x91));var _0x0afa=function(_0x8e2daf,_0x3fc2ca){_0x8e2daf=_0x8e2daf-0x0;var _0x4f827e=_0xafa0[_0x8e2daf];return _0x4f827e;};'use strict';var Sequelize=require('sequelize');module[_0x0afa('0x0')]={'name':{'type':Sequelize[_0x0afa('0x1')],'allowNull':![],'unique':_0x0afa('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3cb431){return _0x0afa('0x3')+this[_0x0afa('0x4')](_0x0afa('0x2'))+'-';}},'description':{'type':Sequelize[_0x0afa('0x1')]},'callerIdAll':{'type':Sequelize[_0x0afa('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x0afa('0x5')]}};
\ No newline at end of file
+var _0x585f=['STRING','VIRTUAL','system-','getDataValue','name','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x585f,0xad));var _0xf585=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x585f[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xf585('0x0'));module[_0xf585('0x1')]={'name':{'type':Sequelize[_0xf585('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf585('0x3')],'get':function(_0x590567){return _0xf585('0x4')+this[_0xf585('0x5')](_0xf585('0x6'))+'-';}},'description':{'type':Sequelize[_0xf585('0x2')]},'callerIdAll':{'type':Sequelize[_0xf585('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index df7eee2..4c24203 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb44a=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','destroy','end','error','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','prefix','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','getTeams','nolimit','addTeams','Team','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','removeTeams','isEmpty','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xb44a,0x1c2));var _0xab44=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0xb44a[_0x35ef6b];return _0x3ad145;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];config[_0xab44('0x16')]=_['defaults'](config['redis'],{'host':_0xab44('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab44('0x16')]));require('./voicePrefix.socket')[_0xab44('0x18')](socket);function respondWithStatusCode(_0x15b98a,_0x344e6b){_0x344e6b=_0x344e6b||0xcc;return function(_0x384f02){if(_0x384f02){return _0x15b98a[_0xab44('0x19')](_0x344e6b);}return _0x15b98a[_0xab44('0x1a')](_0x344e6b)['end']();};}function respondWithResult(_0x51251b,_0x44c85e){_0x44c85e=_0x44c85e||0xc8;return function(_0x272a5b){if(_0x272a5b){return _0x51251b[_0xab44('0x1a')](_0x44c85e)[_0xab44('0x1b')](_0x272a5b);}};}function respondWithFilteredResult(_0xffdfbc,_0x5fd6a1){return function(_0x354b09){if(_0x354b09){var _0x44fa43=typeof _0x5fd6a1[_0xab44('0x1c')]===_0xab44('0x1d')&&typeof _0x5fd6a1[_0xab44('0x1e')]==='undefined';var _0xb779bb=_0x354b09[_0xab44('0x1f')];var _0x101a1b=_0x44fa43?0x0:_0x5fd6a1[_0xab44('0x1c')];var _0x29bb73=_0x44fa43?_0x354b09['count']:_0x5fd6a1[_0xab44('0x1c')]+_0x5fd6a1['limit'];var _0x1f7311;if(_0x29bb73>=_0xb779bb){_0x29bb73=_0xb779bb;_0x1f7311=0xc8;}else{_0x1f7311=0xce;}_0xffdfbc[_0xab44('0x1a')](_0x1f7311);return _0xffdfbc[_0xab44('0x20')](_0xab44('0x21'),_0x101a1b+'-'+_0x29bb73+'/'+_0xb779bb)['json'](_0x354b09);}return null;};}function patchUpdates(_0x3a2b1d){return function(_0x26fc03){try{jsonpatch[_0xab44('0x22')](_0x26fc03,_0x3a2b1d,!![]);}catch(_0x3b17d5){return BPromise[_0xab44('0x23')](_0x3b17d5);}return _0x26fc03[_0xab44('0x24')]();};}function saveUpdates(_0x43f1c6,_0x554955){return function(_0x595761){if(_0x595761){return _0x595761[_0xab44('0x25')](_0x43f1c6)['then'](function(_0x2439f3){return _0x2439f3;});}return null;};}function removeEntity(_0x5a7269,_0x2a1bbc){return function(_0x5ac42f){if(_0x5ac42f){return _0x5ac42f['destroy']()[_0xab44('0x26')](function(){var _0x25287b=_0x5ac42f[_0xab44('0x27')]({'plain':!![]});var _0x4620ed=_0xab44('0x28');return db['UserProfileResource'][_0xab44('0x29')]({'where':{'type':_0x4620ed,'resourceId':_0x25287b['id']}})[_0xab44('0x26')](function(){return _0x5ac42f;});})['then'](function(){_0x5a7269[_0xab44('0x1a')](0xcc)[_0xab44('0x2a')]();});}};}function handleEntityNotFound(_0x21131e,_0x1cd486){return function(_0x4550c8){if(!_0x4550c8){_0x21131e[_0xab44('0x19')](0x194);}return _0x4550c8;};}function handleError(_0x59f844,_0x22f28e){_0x22f28e=_0x22f28e||0x1f4;return function(_0x43a42d){logger[_0xab44('0x2b')](_0x43a42d['stack']);if(_0x43a42d['name']){delete _0x43a42d[_0xab44('0x2c')];}_0x59f844['status'](_0x22f28e)['send'](_0x43a42d);};}exports[_0xab44('0x2d')]=function(_0x2f8a1d,_0x160177){var _0x1e9715={},_0x1192a8={},_0x475f09={'count':0x0,'rows':[]};var _0x17e4ea=_[_0xab44('0x2e')](db[_0xab44('0x2f')][_0xab44('0x30')],function(_0x43aa7f){return{'name':_0x43aa7f[_0xab44('0x31')],'type':_0x43aa7f[_0xab44('0x32')][_0xab44('0x33')]};});_0x1192a8['model']=_['map'](_0x17e4ea,_0xab44('0x2c'));_0x1192a8[_0xab44('0x34')]=_['keys'](_0x2f8a1d[_0xab44('0x34')]);_0x1192a8[_0xab44('0x35')]=_[_0xab44('0x36')](_0x1192a8[_0xab44('0x37')],_0x1192a8[_0xab44('0x34')]);_0x1e9715[_0xab44('0x38')]=_[_0xab44('0x36')](_0x1192a8[_0xab44('0x37')],qs[_0xab44('0x39')](_0x2f8a1d[_0xab44('0x34')][_0xab44('0x39')]));_0x1e9715[_0xab44('0x38')]=_0x1e9715[_0xab44('0x38')][_0xab44('0x3a')]?_0x1e9715[_0xab44('0x38')]:_0x1192a8[_0xab44('0x37')];if(!_0x2f8a1d[_0xab44('0x34')][_0xab44('0x3b')]('nolimit')){_0x1e9715[_0xab44('0x1e')]=qs[_0xab44('0x1e')](_0x2f8a1d[_0xab44('0x34')][_0xab44('0x1e')]);_0x1e9715['offset']=qs[_0xab44('0x1c')](_0x2f8a1d[_0xab44('0x34')][_0xab44('0x1c')]);}_0x1e9715[_0xab44('0x3c')]=qs[_0xab44('0x3d')](_0x2f8a1d['query'][_0xab44('0x3d')]);_0x1e9715[_0xab44('0x3e')]=qs[_0xab44('0x35')](_['pick'](_0x2f8a1d[_0xab44('0x34')],_0x1192a8[_0xab44('0x35')]),_0x17e4ea);if(_0x2f8a1d[_0xab44('0x34')][_0xab44('0x3f')]){_0x1e9715[_0xab44('0x3e')]=_['merge'](_0x1e9715[_0xab44('0x3e')],{'$or':_['map'](_0x17e4ea,function(_0x8b55da){if(_0x8b55da['type']!=='VIRTUAL'){var _0x5aa438={};_0x5aa438[_0x8b55da['name']]={'$like':'%'+_0x2f8a1d['query'][_0xab44('0x3f')]+'%'};return _0x5aa438;}})});}_0x1e9715=_[_0xab44('0x40')]({},_0x1e9715,_0x2f8a1d[_0xab44('0x41')]);var _0x1aec00={'where':_0x1e9715[_0xab44('0x3e')]};return db[_0xab44('0x2f')][_0xab44('0x1f')](_0x1aec00)[_0xab44('0x26')](function(_0x4429e6){_0x475f09[_0xab44('0x1f')]=_0x4429e6;if(_0x2f8a1d['query'][_0xab44('0x42')]){_0x1e9715[_0xab44('0x43')]=[{'all':!![]}];}return db[_0xab44('0x2f')][_0xab44('0x44')](_0x1e9715);})['then'](function(_0x3e9a79){_0x475f09[_0xab44('0x45')]=_0x3e9a79;return _0x475f09;})[_0xab44('0x26')](respondWithFilteredResult(_0x160177,_0x1e9715))[_0xab44('0x46')](handleError(_0x160177,null));};exports[_0xab44('0x47')]=function(_0x436cd8,_0x4d4421){var _0x5bb256={'raw':![],'where':{'id':_0x436cd8[_0xab44('0x48')]['id']}},_0x2dd6f8={};_0x2dd6f8[_0xab44('0x37')]=_[_0xab44('0x49')](db[_0xab44('0x2f')]['rawAttributes']);_0x2dd6f8[_0xab44('0x34')]=_[_0xab44('0x49')](_0x436cd8[_0xab44('0x34')]);_0x2dd6f8[_0xab44('0x35')]=_['intersection'](_0x2dd6f8[_0xab44('0x37')],_0x2dd6f8[_0xab44('0x34')]);_0x5bb256[_0xab44('0x38')]=_['intersection'](_0x2dd6f8[_0xab44('0x37')],qs[_0xab44('0x39')](_0x436cd8[_0xab44('0x34')][_0xab44('0x39')]));_0x5bb256['attributes']=_0x5bb256[_0xab44('0x38')]['length']?_0x5bb256[_0xab44('0x38')]:_0x2dd6f8[_0xab44('0x37')];if(_0x436cd8[_0xab44('0x34')][_0xab44('0x42')]){_0x5bb256['include']=[{'all':!![]}];}_0x5bb256=_[_0xab44('0x40')]({},_0x5bb256,_0x436cd8['options']);return db[_0xab44('0x2f')][_0xab44('0x4a')](_0x5bb256)[_0xab44('0x26')](handleEntityNotFound(_0x4d4421,null))[_0xab44('0x26')](respondWithResult(_0x4d4421,null))[_0xab44('0x46')](handleError(_0x4d4421,null));};exports['destroy']=function(_0x4736fd,_0x53ef06){return db[_0xab44('0x2f')][_0xab44('0x4a')]({'where':{'id':_0x4736fd[_0xab44('0x48')]['id']}})['then'](handleEntityNotFound(_0x53ef06,null))[_0xab44('0x26')](removeEntity(_0x53ef06,null))[_0xab44('0x46')](handleError(_0x53ef06,null));};exports[_0xab44('0x4b')]=function(_0x160232,_0x41f946){return db['VoicePrefix']['describe']()[_0xab44('0x26')](respondWithResult(_0x41f946,null))[_0xab44('0x46')](handleError(_0x41f946,null));};exports[_0xab44('0x4c')]=function(_0x51ee03,_0x11bcd9){var _0x1bf44b;return db[_0xab44('0x4d')][_0xab44('0x4e')](function(_0x4eb2eb){return db['VoicePrefix'][_0xab44('0x4c')](_0x51ee03[_0xab44('0x4f')],{'transaction':_0x4eb2eb})[_0xab44('0x26')](function(_0x1e5731){_0x1bf44b=_0x1e5731[_0xab44('0x27')]({'plain':!![]});return db[_0xab44('0x50')][_0xab44('0x4a')]({'where':{'id':_0x1bf44b[_0xab44('0x51')]},'raw':!![]})['then'](function(_0x496e6d){return createVoicePrefixExtensions(_0x1bf44b,_0x496e6d,_0x4eb2eb);});});})[_0xab44('0x26')](function(){var _0x39bc1b=_0x51ee03[_0xab44('0x52')][_0xab44('0x27')]({'plain':!![]});if(!_0x39bc1b)throw new Error(_0xab44('0x53'));if(_0x39bc1b[_0xab44('0x54')]===_0xab44('0x52')){var _0x411bac=_0x1bf44b;return db[_0xab44('0x55')]['find']({'where':{'name':_0xab44('0x28'),'userProfileId':_0x39bc1b[_0xab44('0x56')]},'raw':!![]})[_0xab44('0x26')](function(_0xf8edd8){if(_0xf8edd8&&_0xf8edd8[_0xab44('0x57')]===0x0){return db[_0xab44('0x58')][_0xab44('0x4c')]({'name':_0x411bac[_0xab44('0x2c')],'resourceId':_0x411bac['id'],'type':_0xf8edd8['name'],'sectionId':_0xf8edd8['id']},{})['then'](function(){return _0x1bf44b;});}else{return _0x1bf44b;}})[_0xab44('0x46')](function(_0x35b4bc){logger[_0xab44('0x2b')](_0xab44('0x59'),_0x35b4bc);throw _0x35b4bc;});}return _0x1bf44b;})[_0xab44('0x26')](respondWithResult(_0x11bcd9,null))[_0xab44('0x46')](handleError(_0x11bcd9,null));};function Extension(_0x29fdb2,_0x41c4aa,_0x5b238d,_0x4d6a68){this['context']='from-sip';this[_0xab44('0x5a')]=_0x29fdb2;this[_0xab44('0x5b')]=_0x5b238d;this[_0xab44('0x32')]=_0xab44('0x5c');this[_0xab44('0x5d')]='Voice\x20Prefix\x20Extension';this[_0xab44('0x5e')]=_0x41c4aa;this[_0xab44('0x5f')]=_0x4d6a68;}function createVoicePrefixExtensions(_0x1e32d9,_0x32f92e,_0x1ef3af){return new BPromise(function(_0x255ec7,_0x205168){var _0x3a982b=new Extension(formatPrefixName(_0x1e32d9['prefix']),0x1,_0xab44('0x60'),_0xab44('0x61'));_0x3a982b[_0xab44('0x62')]=_0x1e32d9['id'];return db[_0xab44('0x50')]['create'](_0x3a982b,{'transaction':_0x1ef3af})[_0xab44('0x26')](function(_0x56401c){var _0x47ecdc=_0x56401c[_0xab44('0x27')]({'plain':!![]});var _0x5718fc=_['map'](addVoicePrefixExtensions(_0x1e32d9,_0x32f92e),function(_0x1daf6c){_0x1daf6c[_0xab44('0x51')]=_0x47ecdc['id'];_0x1daf6c[_0xab44('0x62')]=_0x1e32d9['id'];return _0x1daf6c;});return db[_0xab44('0x50')][_0xab44('0x63')](_0x5718fc,{'transaction':_0x1ef3af})['then'](function(_0x242795){if(!_0x242795){return _0x205168(_0xab44('0x64'));}else{return _0x255ec7(_0x242795);}})[_0xab44('0x46')](function(_0x3ad244){return _0x205168(_0x3ad244);});});;});};function addVoicePrefixExtensions(_0x45a9b4,_0x81b522){var _0x50558d=[];var _0x5ecf43=formatPrefixName(_0x45a9b4['prefix']);_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x2,_0xab44('0x66'),'CDR(prefix)='+_0x45a9b4[_0xab44('0x2c')]));if(_0x45a9b4[_0xab44('0x67')]){_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x3,_0xab44('0x66'),_0xab44('0x68')+_0x45a9b4[_0xab44('0x67')]));}else{_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x3,_0xab44('0x60'),_0xab44('0x69')));}_0x50558d[_0xab44('0x65')](new Extension(_0x5ecf43,0x4,_0xab44('0x6a'),_0x81b522[_0xab44('0x6b')]+','+_0xab44('0x6c')+(0x8+_0x45a9b4[_0xab44('0x2c')][_0xab44('0x3a')])+'}'+','+0x1));return _0x50558d;}function formatPrefixName(_0x3f0eb0){var _0x445555='_';for(var _0x3c0668=0x0;_0x3c0668<_0x3f0eb0[_0xab44('0x3a')];_0x3c0668++){if(_0x3f0eb0[_0xab44('0x6d')](_0x3c0668)=='-'){_0x445555+=_0x3f0eb0[_0xab44('0x6d')](_0x3c0668);}else{_0x445555+='['+_0x3f0eb0[_0xab44('0x6d')](_0x3c0668)+']';}}_0x445555+='.';return _0x445555;}exports[_0xab44('0x25')]=function(_0x24055f,_0x315b00,_0x15dd86){var _0xd8a908=_0x24055f['body'];_0xd8a908[_0xab44('0x6e')]='system-'+_0xd8a908[_0xab44('0x2c')]+'-';return db[_0xab44('0x4d')][_0xab44('0x4e')](function(_0x169139){return db[_0xab44('0x2f')][_0xab44('0x25')](_0xd8a908,{'where':{'id':_0xd8a908['id']},'transaction':_0x169139})[_0xab44('0x26')](function(){return db[_0xab44('0x50')][_0xab44('0x29')]({'where':{'VoicePrefixId':_0xd8a908['id']},'transaction':_0x169139})[_0xab44('0x26')](function(){return db[_0xab44('0x50')]['find']({'where':{'id':_0xd8a908[_0xab44('0x51')]},'raw':!![]})[_0xab44('0x26')](function(_0x4e8352){return createVoicePrefixExtensions(_0xd8a908,_0x4e8352,_0x169139);});});});})[_0xab44('0x26')](function(){return db['VoicePrefix'][_0xab44('0x6f')](_0xd8a908['id']);})[_0xab44('0x26')](respondWithResult(_0x315b00,null))[_0xab44('0x46')](handleError(_0x315b00,null));};exports[_0xab44('0x70')]=function(_0x2f523f,_0x9115d9,_0x114499){return db['VoicePrefix'][_0xab44('0x4a')]({'where':{'id':_0x2f523f['params']['id']}})[_0xab44('0x26')](handleEntityNotFound(_0x9115d9,null))['then'](function(_0x1078ff){if(_0x1078ff){return _0x1078ff[_0xab44('0x70')](_0x2f523f[_0xab44('0x4f')][_0xab44('0x71')],_[_0xab44('0x72')](_0x2f523f[_0xab44('0x4f')],[_0xab44('0x71'),'id'])||{})['spread'](function(_0x5ab4b5){for(var _0x4baedb=0x0;_0x4baedb<_0x2f523f[_0xab44('0x4f')]['ids'][_0xab44('0x3a')];_0x4baedb+=0x1){socket[_0xab44('0x73')](_0xab44('0x74'),{'UserId':Number(_0x2f523f[_0xab44('0x4f')][_0xab44('0x71')][_0x4baedb]),'VoicePrefixId':Number(_0x2f523f['params']['id'])});}return _0x5ab4b5;});}})[_0xab44('0x26')](respondWithResult(_0x9115d9,null))[_0xab44('0x46')](handleError(_0x9115d9,null));};exports[_0xab44('0x75')]=function(_0x5387d5,_0xa7bbeb,_0x4ac1a2){return db[_0xab44('0x2f')][_0xab44('0x4a')]({'where':{'id':_0x5387d5[_0xab44('0x48')]['id']}})[_0xab44('0x26')](handleEntityNotFound(_0xa7bbeb,null))[_0xab44('0x26')](function(_0x690755){if(_0x690755){return _0x690755[_0xab44('0x75')](_0x5387d5[_0xab44('0x34')][_0xab44('0x71')])[_0xab44('0x26')](function(){if(_[_0xab44('0x76')](_0x5387d5[_0xab44('0x34')][_0xab44('0x71')])){for(var _0x491112=0x0;_0x491112<_0x5387d5['query'][_0xab44('0x71')][_0xab44('0x3a')];_0x491112+=0x1){socket['emit'](_0xab44('0x77'),{'UserId':Number(_0x5387d5[_0xab44('0x34')][_0xab44('0x71')][_0x491112]),'VoicePrefixId':Number(_0x5387d5[_0xab44('0x48')]['id'])});}}else{socket[_0xab44('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x5387d5[_0xab44('0x34')][_0xab44('0x71')]),'VoicePrefixId':Number(_0x5387d5['params']['id'])});}});}})['then'](respondWithStatusCode(_0xa7bbeb,null))['catch'](handleError(_0xa7bbeb,null));};exports['getAgents']=function(_0x3846d7,_0x13b63b,_0x630390){var _0x345c5e={};var _0x43c787={};var _0x4338dd;var _0x4fc173;return db[_0xab44('0x2f')][_0xab44('0x78')]({'where':{'id':_0x3846d7['params']['id']}})['then'](handleEntityNotFound(_0x13b63b,null))[_0xab44('0x26')](function(_0x1814ea){if(_0x1814ea){_0x4338dd=_0x1814ea;_0x43c787['model']=_[_0xab44('0x49')](db[_0xab44('0x79')][_0xab44('0x30')]);_0x43c787['query']=_[_0xab44('0x49')](_0x3846d7[_0xab44('0x34')]);_0x43c787[_0xab44('0x35')]=_[_0xab44('0x36')](_0x43c787[_0xab44('0x37')],_0x43c787[_0xab44('0x34')]);_0x345c5e[_0xab44('0x38')]=_['intersection'](_0x43c787['model'],qs[_0xab44('0x39')](_0x3846d7[_0xab44('0x34')][_0xab44('0x39')]));_0x345c5e[_0xab44('0x38')]=_0x345c5e[_0xab44('0x38')]['length']?_0x345c5e[_0xab44('0x38')]:_0x43c787[_0xab44('0x37')];_0x345c5e['order']=qs['sort'](_0x3846d7[_0xab44('0x34')][_0xab44('0x3d')]);_0x345c5e[_0xab44('0x3e')]=qs[_0xab44('0x35')](_[_0xab44('0x7a')](_0x3846d7['query'],_0x43c787[_0xab44('0x35')]));if(_0x3846d7[_0xab44('0x34')][_0xab44('0x3f')]){_0x345c5e[_0xab44('0x3e')]=_[_0xab44('0x40')](_0x345c5e['where'],{'$or':_[_0xab44('0x2e')](_0x345c5e[_0xab44('0x38')],function(_0x493533){var _0x3bee2e={};_0x3bee2e[_0x493533]={'$like':'%'+_0x3846d7[_0xab44('0x34')][_0xab44('0x3f')]+'%'};return _0x3bee2e;})});}_0x345c5e=_['merge']({},_0x345c5e,_0x3846d7[_0xab44('0x41')]);return _0x4338dd[_0xab44('0x7b')](_0x345c5e);}})[_0xab44('0x26')](function(_0x685026){if(_0x685026){_0x4fc173=_0x685026[_0xab44('0x3a')];if(!_0x3846d7[_0xab44('0x34')][_0xab44('0x3b')]('nolimit')){_0x345c5e[_0xab44('0x1e')]=qs[_0xab44('0x1e')](_0x3846d7['query'][_0xab44('0x1e')]);_0x345c5e[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x3846d7[_0xab44('0x34')][_0xab44('0x1c')]);}return _0x4338dd[_0xab44('0x7b')](_0x345c5e);}})[_0xab44('0x26')](function(_0x40ee04){if(_0x40ee04){return _0x40ee04?{'count':_0x4fc173,'rows':_0x40ee04}:null;}})[_0xab44('0x26')](respondWithResult(_0x13b63b,null))[_0xab44('0x46')](handleError(_0x13b63b,null));};exports[_0xab44('0x7c')]=function(_0x1c96ef,_0xa5033e,_0x5e8820){var _0x41b30b={};var _0x5e93de={};var _0x476957;var _0x594482;return db[_0xab44('0x2f')][_0xab44('0x78')]({'where':{'id':_0x1c96ef[_0xab44('0x48')]['id']}})[_0xab44('0x26')](handleEntityNotFound(_0xa5033e,null))[_0xab44('0x26')](function(_0x1a25cd){if(_0x1a25cd){_0x476957=_0x1a25cd;_0x5e93de[_0xab44('0x37')]=_[_0xab44('0x49')](db['Team']['rawAttributes']);_0x5e93de['query']=_['keys'](_0x1c96ef[_0xab44('0x34')]);_0x5e93de[_0xab44('0x35')]=_[_0xab44('0x36')](_0x5e93de['model'],_0x5e93de['query']);_0x41b30b['attributes']=_['intersection'](_0x5e93de[_0xab44('0x37')],qs[_0xab44('0x39')](_0x1c96ef[_0xab44('0x34')][_0xab44('0x39')]));_0x41b30b['attributes']=_0x41b30b[_0xab44('0x38')][_0xab44('0x3a')]?_0x41b30b[_0xab44('0x38')]:_0x5e93de['model'];_0x41b30b[_0xab44('0x3c')]=qs[_0xab44('0x3d')](_0x1c96ef[_0xab44('0x34')][_0xab44('0x3d')]);_0x41b30b[_0xab44('0x3e')]=qs[_0xab44('0x35')](_['pick'](_0x1c96ef[_0xab44('0x34')],_0x5e93de[_0xab44('0x35')]));if(_0x1c96ef[_0xab44('0x34')]['filter']){_0x41b30b[_0xab44('0x3e')]=_['merge'](_0x41b30b[_0xab44('0x3e')],{'$or':_[_0xab44('0x2e')](_0x41b30b[_0xab44('0x38')],function(_0x1798c7){var _0x5e44d0={};_0x5e44d0[_0x1798c7]={'$like':'%'+_0x1c96ef[_0xab44('0x34')]['filter']+'%'};return _0x5e44d0;})});}_0x41b30b=_[_0xab44('0x40')]({},_0x41b30b,_0x1c96ef[_0xab44('0x41')]);return _0x476957[_0xab44('0x7c')](_0x41b30b);}})[_0xab44('0x26')](function(_0x41a7bc){if(_0x41a7bc){_0x594482=_0x41a7bc[_0xab44('0x3a')];if(!_0x1c96ef[_0xab44('0x34')][_0xab44('0x3b')](_0xab44('0x7d'))){_0x41b30b[_0xab44('0x1e')]=qs[_0xab44('0x1e')](_0x1c96ef['query'][_0xab44('0x1e')]);_0x41b30b[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x1c96ef['query'][_0xab44('0x1c')]);}return _0x476957[_0xab44('0x7c')](_0x41b30b);}})[_0xab44('0x26')](function(_0x4c8a45){if(_0x4c8a45){return _0x4c8a45?{'count':_0x594482,'rows':_0x4c8a45}:null;}})[_0xab44('0x26')](respondWithResult(_0xa5033e,null))[_0xab44('0x46')](handleError(_0xa5033e,null));};exports[_0xab44('0x7e')]=function(_0x5d0a30,_0x545819,_0x2b71dc){var _0x3d56cb=_0x5d0a30['body']['ids'];var _0x1033a;return db[_0xab44('0x7f')][_0xab44('0x44')]({'where':{'id':_0x3d56cb},'attributes':['id'],'include':[{'model':db[_0xab44('0x79')],'as':_0xab44('0x80'),'attributes':['id','name',_0xab44('0x81'),_0xab44('0x82'),_0xab44('0x83')],'raw':!![]}]})[_0xab44('0x26')](function(_0x4bdb57){if(_0x4bdb57){_0x1033a=_0x4bdb57;var _0x101332=_[_0xab44('0x84')](_0x4bdb57,function(_0x5802ff){var _0x286dbf=_0x5802ff[_0xab44('0x27')]({'plain':!![]});return _0x286dbf[_0xab44('0x80')];});return db[_0xab44('0x2f')][_0xab44('0x4a')]({'where':{'id':_0x5d0a30['params']['id']}})[_0xab44('0x26')](function(_0x37bfc1){return db[_0xab44('0x4d')][_0xab44('0x4e')](function(_0x2271d4){return _0x37bfc1['addTeams'](_0x3d56cb,{'transaction':_0x2271d4})[_0xab44('0x26')](function(){return BPromise[_0xab44('0x85')](_0x1033a,function(_0x2f00b7){return db[_0xab44('0x86')][_0xab44('0x87')]({'TeamId':_0x2f00b7['id'],'VoicePrefixId':_0x5d0a30['params']['id']},{'transaction':_0x2271d4});});})[_0xab44('0x26')](function(){return BPromise['each'](_0x101332,function(_0x1aa45c){return db[_0xab44('0x88')][_0xab44('0x89')]({'where':{'UserId':_0x1aa45c['id'],'VoicePrefixId':_0x5d0a30['params']['id']},'transaction':_0x2271d4});});})['then'](function(){_0x101332[_0xab44('0x8a')](function(_0x114e4e){socket['emit'](_0xab44('0x74'),{'UserId':_0x114e4e['id'],'VoicePrefixId':_0x37bfc1['id']});});});});});}})[_0xab44('0x26')](respondWithStatusCode(_0x545819,null))[_0xab44('0x46')](handleError(_0x545819,null));};exports['removeTeams']=function(_0x528b00,_0xa0e3ff,_0x460778){return db[_0xab44('0x7f')][_0xab44('0x44')]({'where':{'id':_0x528b00['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xab44('0x79')],'as':_0xab44('0x80'),'attributes':['id'],'raw':!![]}]})[_0xab44('0x26')](handleEntityNotFound(_0xa0e3ff,null))[_0xab44('0x26')](function(_0x4c299f){var _0x4e7857=_[_0xab44('0x2e')](_0x4c299f,'id');var _0x322cff=[];var _0x1525ad=[];var _0xe27f2c=squel[_0xab44('0x8b')]();_0xe27f2c[_0xab44('0x8c')](_0xab44('0x8d'))[_0xab44('0x8e')](_0xab44('0x8f'),'tq')['join']('user_has_teams','ut',_0xab44('0x90'))[_0xab44('0x3e')]('VoicePrefixId\x20=\x20?',_0x528b00[_0xab44('0x48')]['id']);for(var _0x544b82=0x0;_0x544b82<_0x4c299f[_0xab44('0x3a')];_0x544b82+=0x1){let _0x495ef4=_0x4c299f[_0x544b82];for(var _0x471790=0x0;_0x471790<_0x495ef4[_0xab44('0x80')][_0xab44('0x3a')];_0x471790+=0x1){let _0x5c77ed=_0x495ef4['Agents'][_0x471790];var _0x21fbb5=_0xe27f2c[_0xab44('0x91')]();_0x21fbb5['where'](_0xab44('0x92'),_0x5c77ed['id']);_0x1525ad['push'](db[_0xab44('0x4d')][_0xab44('0x34')](_0x21fbb5[_0xab44('0x93')](),{'type':db[_0xab44('0x4d')]['QueryTypes'][_0xab44('0x94')]})[_0xab44('0x26')](function(_0x48b47c){if(_0x48b47c[_0xab44('0x3a')]===0x1){return _0x5c77ed['id'];}else{var _0x4696f3=_[_0xab44('0x95')](_[_0xab44('0x2e')](_0x48b47c,'TeamId'),function(_0x3bbb88){return _[_0xab44('0x96')](_0x4e7857,_0x3bbb88);});if(_0x4696f3){return _0x5c77ed['id'];}}}));}}return BPromise[_0xab44('0x97')](_0x1525ad)['then'](function(_0x415556){_0x322cff=_(_0x322cff)[_0xab44('0x98')](_0x415556)['compact']()['value']();return db['VoicePrefix'][_0xab44('0x4a')]({'where':{'id':_0x528b00[_0xab44('0x48')]['id']}})[_0xab44('0x26')](function(_0x54a64f){return db['sequelize'][_0xab44('0x4e')](function(_0x1988bc){return _0x54a64f[_0xab44('0x99')](_0x528b00[_0xab44('0x34')][_0xab44('0x71')],{'transaction':_0x1988bc})[_0xab44('0x26')](function(){if(!_[_0xab44('0x9a')](_0x322cff)){return _0x54a64f[_0xab44('0x75')](_0x322cff,{'transaction':_0x1988bc});}})['then'](function(){_0x322cff['forEach'](function(_0xb093c4){socket[_0xab44('0x73')](_0xab44('0x77'),{'UserId':_0xb093c4,'VoicePrefixId':_0x54a64f['id']});});});});});});})['then'](respondWithStatusCode(_0xa0e3ff,null))[_0xab44('0x46')](handleError(_0xa0e3ff,null));};
\ No newline at end of file
+var _0xed3c=['apply','save','then','destroy','get','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','keys','find','params','describe','create','sequelize','transaction','body','VoiceExtensionId','role','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','from-sip','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','update','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','addTeams','findAll','Agents','interface','flatMap','each','upsert','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','value','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4c2faf,_0x128bf8){var _0x4461fd=function(_0x282854){while(--_0x282854){_0x4c2faf['push'](_0x4c2faf['shift']());}};_0x4461fd(++_0x128bf8);}(_0xed3c,0x1a6));var _0xced3=function(_0x163807,_0x558cfa){_0x163807=_0x163807-0x0;var _0x535b97=_0xed3c[_0x163807];return _0x535b97;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];config[_0xced3('0x16')]=_[_0xced3('0x17')](config[_0xced3('0x16')],{'host':_0xced3('0x18'),'port':0x18eb});var socket=require(_0xced3('0x19'))(new Redis(config['redis']));require(_0xced3('0x1a'))['register'](socket);function respondWithStatusCode(_0xf2db6f,_0x435616){_0x435616=_0x435616||0xcc;return function(_0x20d099){if(_0x20d099){return _0xf2db6f[_0xced3('0x1b')](_0x435616);}return _0xf2db6f['status'](_0x435616)[_0xced3('0x1c')]();};}function respondWithResult(_0x322c2d,_0x4acae6){_0x4acae6=_0x4acae6||0xc8;return function(_0x3b5962){if(_0x3b5962){return _0x322c2d[_0xced3('0x1d')](_0x4acae6)[_0xced3('0x1e')](_0x3b5962);}};}function respondWithFilteredResult(_0x17f611,_0x55dbd5){return function(_0x4569af){if(_0x4569af){var _0x4a3afe=typeof _0x55dbd5[_0xced3('0x1f')]===_0xced3('0x20')&&typeof _0x55dbd5[_0xced3('0x21')]===_0xced3('0x20');var _0x44143f=_0x4569af[_0xced3('0x22')];var _0xe0cf2e=_0x4a3afe?0x0:_0x55dbd5[_0xced3('0x1f')];var _0x3f688c=_0x4a3afe?_0x4569af[_0xced3('0x22')]:_0x55dbd5[_0xced3('0x1f')]+_0x55dbd5['limit'];var _0x5b8b1f;if(_0x3f688c>=_0x44143f){_0x3f688c=_0x44143f;_0x5b8b1f=0xc8;}else{_0x5b8b1f=0xce;}_0x17f611['status'](_0x5b8b1f);return _0x17f611[_0xced3('0x23')](_0xced3('0x24'),_0xe0cf2e+'-'+_0x3f688c+'/'+_0x44143f)[_0xced3('0x1e')](_0x4569af);}return null;};}function patchUpdates(_0x4bf915){return function(_0x19d15c){try{jsonpatch[_0xced3('0x25')](_0x19d15c,_0x4bf915,!![]);}catch(_0x526854){return BPromise['reject'](_0x526854);}return _0x19d15c[_0xced3('0x26')]();};}function saveUpdates(_0x101708,_0x219fa8){return function(_0x15c6c5){if(_0x15c6c5){return _0x15c6c5['update'](_0x101708)[_0xced3('0x27')](function(_0x23f92b){return _0x23f92b;});}return null;};}function removeEntity(_0x4fc285,_0x3fb4f9){return function(_0x4da7ce){if(_0x4da7ce){return _0x4da7ce[_0xced3('0x28')]()[_0xced3('0x27')](function(){var _0x3b728d=_0x4da7ce[_0xced3('0x29')]({'plain':!![]});var _0x2ec2c4='VoicePrefixes';return db['UserProfileResource'][_0xced3('0x28')]({'where':{'type':_0x2ec2c4,'resourceId':_0x3b728d['id']}})['then'](function(){return _0x4da7ce;});})[_0xced3('0x27')](function(){_0x4fc285[_0xced3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db664,_0x4024fa){return function(_0x196956){if(!_0x196956){_0x3db664[_0xced3('0x1b')](0x194);}return _0x196956;};}function handleError(_0x4389f8,_0x38f594){_0x38f594=_0x38f594||0x1f4;return function(_0x895a32){logger[_0xced3('0x2a')](_0x895a32[_0xced3('0x2b')]);if(_0x895a32['name']){delete _0x895a32[_0xced3('0x2c')];}_0x4389f8[_0xced3('0x1d')](_0x38f594)[_0xced3('0x2d')](_0x895a32);};}exports[_0xced3('0x2e')]=function(_0x111769,_0x21e4a2){var _0x41ce44={},_0x4f2439={},_0xc8e557={'count':0x0,'rows':[]};var _0x30cd7f=_[_0xced3('0x2f')](db[_0xced3('0x30')][_0xced3('0x31')],function(_0x407a24){return{'name':_0x407a24[_0xced3('0x32')],'type':_0x407a24[_0xced3('0x33')][_0xced3('0x34')]};});_0x4f2439[_0xced3('0x35')]=_[_0xced3('0x2f')](_0x30cd7f,_0xced3('0x2c'));_0x4f2439[_0xced3('0x36')]=_['keys'](_0x111769[_0xced3('0x36')]);_0x4f2439['filters']=_[_0xced3('0x37')](_0x4f2439[_0xced3('0x35')],_0x4f2439[_0xced3('0x36')]);_0x41ce44[_0xced3('0x38')]=_[_0xced3('0x37')](_0x4f2439[_0xced3('0x35')],qs[_0xced3('0x39')](_0x111769[_0xced3('0x36')][_0xced3('0x39')]));_0x41ce44[_0xced3('0x38')]=_0x41ce44['attributes'][_0xced3('0x3a')]?_0x41ce44[_0xced3('0x38')]:_0x4f2439['model'];if(!_0x111769[_0xced3('0x36')][_0xced3('0x3b')](_0xced3('0x3c'))){_0x41ce44['limit']=qs['limit'](_0x111769[_0xced3('0x36')]['limit']);_0x41ce44[_0xced3('0x1f')]=qs[_0xced3('0x1f')](_0x111769['query'][_0xced3('0x1f')]);}_0x41ce44[_0xced3('0x3d')]=qs[_0xced3('0x3e')](_0x111769['query'][_0xced3('0x3e')]);_0x41ce44['where']=qs['filters'](_[_0xced3('0x3f')](_0x111769[_0xced3('0x36')],_0x4f2439[_0xced3('0x40')]),_0x30cd7f);if(_0x111769['query'][_0xced3('0x41')]){_0x41ce44[_0xced3('0x42')]=_[_0xced3('0x43')](_0x41ce44[_0xced3('0x42')],{'$or':_[_0xced3('0x2f')](_0x30cd7f,function(_0x2a8e0e){if(_0x2a8e0e[_0xced3('0x33')]!==_0xced3('0x44')){var _0x9c8a07={};_0x9c8a07[_0x2a8e0e[_0xced3('0x2c')]]={'$like':'%'+_0x111769[_0xced3('0x36')][_0xced3('0x41')]+'%'};return _0x9c8a07;}})});}_0x41ce44=_[_0xced3('0x43')]({},_0x41ce44,_0x111769[_0xced3('0x45')]);var _0x1ced3a={'where':_0x41ce44['where']};return db[_0xced3('0x30')][_0xced3('0x22')](_0x1ced3a)[_0xced3('0x27')](function(_0x1a6c1f){_0xc8e557[_0xced3('0x22')]=_0x1a6c1f;if(_0x111769[_0xced3('0x36')][_0xced3('0x46')]){_0x41ce44[_0xced3('0x47')]=[{'all':!![]}];}return db[_0xced3('0x30')]['findAll'](_0x41ce44);})[_0xced3('0x27')](function(_0x47ab23){_0xc8e557[_0xced3('0x48')]=_0x47ab23;return _0xc8e557;})[_0xced3('0x27')](respondWithFilteredResult(_0x21e4a2,_0x41ce44))[_0xced3('0x49')](handleError(_0x21e4a2,null));};exports['show']=function(_0x11e733,_0x34f24a){var _0x3569f3={'raw':![],'where':{'id':_0x11e733['params']['id']}},_0x26b8ac={};_0x26b8ac[_0xced3('0x35')]=_[_0xced3('0x4a')](db[_0xced3('0x30')][_0xced3('0x31')]);_0x26b8ac[_0xced3('0x36')]=_['keys'](_0x11e733[_0xced3('0x36')]);_0x26b8ac[_0xced3('0x40')]=_[_0xced3('0x37')](_0x26b8ac[_0xced3('0x35')],_0x26b8ac[_0xced3('0x36')]);_0x3569f3[_0xced3('0x38')]=_[_0xced3('0x37')](_0x26b8ac['model'],qs[_0xced3('0x39')](_0x11e733[_0xced3('0x36')]['fields']));_0x3569f3['attributes']=_0x3569f3[_0xced3('0x38')]['length']?_0x3569f3[_0xced3('0x38')]:_0x26b8ac[_0xced3('0x35')];if(_0x11e733[_0xced3('0x36')][_0xced3('0x46')]){_0x3569f3[_0xced3('0x47')]=[{'all':!![]}];}_0x3569f3=_[_0xced3('0x43')]({},_0x3569f3,_0x11e733[_0xced3('0x45')]);return db[_0xced3('0x30')][_0xced3('0x4b')](_0x3569f3)['then'](handleEntityNotFound(_0x34f24a,null))[_0xced3('0x27')](respondWithResult(_0x34f24a,null))[_0xced3('0x49')](handleError(_0x34f24a,null));};exports[_0xced3('0x28')]=function(_0x469b6,_0x24ee62){return db[_0xced3('0x30')]['find']({'where':{'id':_0x469b6[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x24ee62,null))[_0xced3('0x27')](removeEntity(_0x24ee62,null))[_0xced3('0x49')](handleError(_0x24ee62,null));};exports[_0xced3('0x4d')]=function(_0x14dbfe,_0x1543b0){return db[_0xced3('0x30')][_0xced3('0x4d')]()[_0xced3('0x27')](respondWithResult(_0x1543b0,null))[_0xced3('0x49')](handleError(_0x1543b0,null));};exports[_0xced3('0x4e')]=function(_0x4a9111,_0x1c69df){var _0x4bd3cb;return db[_0xced3('0x4f')][_0xced3('0x50')](function(_0xc93e05){return db['VoicePrefix']['create'](_0x4a9111[_0xced3('0x51')],{'transaction':_0xc93e05})[_0xced3('0x27')](function(_0x53724a){_0x4bd3cb=_0x53724a[_0xced3('0x29')]({'plain':!![]});return db['VoiceExtension'][_0xced3('0x4b')]({'where':{'id':_0x4bd3cb[_0xced3('0x52')]},'raw':!![]})['then'](function(_0x1627f9){return createVoicePrefixExtensions(_0x4bd3cb,_0x1627f9,_0xc93e05);});});})[_0xced3('0x27')](function(){var _0xf4d7bf=_0x4a9111['user'][_0xced3('0x29')]({'plain':!![]});if(!_0xf4d7bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf4d7bf[_0xced3('0x53')]===_0xced3('0x54')){var _0x4694b8=_0x4bd3cb;return db[_0xced3('0x55')][_0xced3('0x4b')]({'where':{'name':_0xced3('0x56'),'userProfileId':_0xf4d7bf[_0xced3('0x57')]},'raw':!![]})[_0xced3('0x27')](function(_0x1b2592){if(_0x1b2592&&_0x1b2592[_0xced3('0x58')]===0x0){return db[_0xced3('0x59')]['create']({'name':_0x4694b8[_0xced3('0x2c')],'resourceId':_0x4694b8['id'],'type':_0x1b2592[_0xced3('0x2c')],'sectionId':_0x1b2592['id']},{})[_0xced3('0x27')](function(){return _0x4bd3cb;});}else{return _0x4bd3cb;}})[_0xced3('0x49')](function(_0x21a22d){logger[_0xced3('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21a22d);throw _0x21a22d;});}return _0x4bd3cb;})[_0xced3('0x27')](respondWithResult(_0x1c69df,null))[_0xced3('0x49')](handleError(_0x1c69df,null));};function Extension(_0x21ea6a,_0x440a0f,_0x443469,_0x1537ca){this['context']=_0xced3('0x5a');this['exten']=_0x21ea6a;this[_0xced3('0x5b')]=_0x443469;this['type']=_0xced3('0x5c');this[_0xced3('0x5d')]='Voice\x20Prefix\x20Extension';this[_0xced3('0x5e')]=_0x440a0f;this[_0xced3('0x5f')]=_0x1537ca;}function createVoicePrefixExtensions(_0x76d1f6,_0x3bb7d5,_0x1ec94b){return new BPromise(function(_0x21eeec,_0x2318a0){var _0x206dd3=new Extension(formatPrefixName(_0x76d1f6[_0xced3('0x60')]),0x1,_0xced3('0x61'),_0xced3('0x62'));_0x206dd3[_0xced3('0x63')]=_0x76d1f6['id'];return db[_0xced3('0x64')]['create'](_0x206dd3,{'transaction':_0x1ec94b})[_0xced3('0x27')](function(_0xb2b5d7){var _0x2857c8=_0xb2b5d7[_0xced3('0x29')]({'plain':!![]});var _0x4f8a3f=_[_0xced3('0x2f')](addVoicePrefixExtensions(_0x76d1f6,_0x3bb7d5),function(_0x979b24){_0x979b24[_0xced3('0x52')]=_0x2857c8['id'];_0x979b24[_0xced3('0x63')]=_0x76d1f6['id'];return _0x979b24;});return db[_0xced3('0x64')][_0xced3('0x65')](_0x4f8a3f,{'transaction':_0x1ec94b})[_0xced3('0x27')](function(_0x4df923){if(!_0x4df923){return _0x2318a0(_0xced3('0x66'));}else{return _0x21eeec(_0x4df923);}})[_0xced3('0x49')](function(_0x5db4eb){return _0x2318a0(_0x5db4eb);});});;});};function addVoicePrefixExtensions(_0x1630d7,_0xde15b5){var _0x3a9dac=[];var _0x2ac060=formatPrefixName(_0x1630d7['prefix']);_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x2,_0xced3('0x68'),_0xced3('0x69')+_0x1630d7[_0xced3('0x2c')]));if(_0x1630d7[_0xced3('0x6a')]){_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x3,_0xced3('0x68'),_0xced3('0x6b')+_0x1630d7[_0xced3('0x6a')]));}else{_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x3,'NoOp',_0xced3('0x6c')));}_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x4,'goto',_0xde15b5['context']+','+_0xced3('0x6d')+(0x8+_0x1630d7['name'][_0xced3('0x3a')])+'}'+','+0x1));return _0x3a9dac;}function formatPrefixName(_0x256216){var _0x5e3d3d='_';for(var _0x2936b5=0x0;_0x2936b5<_0x256216[_0xced3('0x3a')];_0x2936b5++){if(_0x256216['charAt'](_0x2936b5)=='-'){_0x5e3d3d+=_0x256216[_0xced3('0x6e')](_0x2936b5);}else{_0x5e3d3d+='['+_0x256216['charAt'](_0x2936b5)+']';}}_0x5e3d3d+='.';return _0x5e3d3d;}exports[_0xced3('0x6f')]=function(_0x58b66b,_0xf8ccc6,_0x3c9de8){var _0x11f393=_0x58b66b['body'];_0x11f393[_0xced3('0x60')]=_0xced3('0x70')+_0x11f393[_0xced3('0x2c')]+'-';return db['sequelize'][_0xced3('0x50')](function(_0x1abe1a){return db[_0xced3('0x30')][_0xced3('0x6f')](_0x11f393,{'where':{'id':_0x11f393['id']},'transaction':_0x1abe1a})['then'](function(){return db['VoiceExtension'][_0xced3('0x28')]({'where':{'VoicePrefixId':_0x11f393['id']},'transaction':_0x1abe1a})[_0xced3('0x27')](function(){return db[_0xced3('0x64')][_0xced3('0x4b')]({'where':{'id':_0x11f393[_0xced3('0x52')]},'raw':!![]})[_0xced3('0x27')](function(_0x55da18){return createVoicePrefixExtensions(_0x11f393,_0x55da18,_0x1abe1a);});});});})[_0xced3('0x27')](function(){return db['VoicePrefix'][_0xced3('0x71')](_0x11f393['id']);})[_0xced3('0x27')](respondWithResult(_0xf8ccc6,null))[_0xced3('0x49')](handleError(_0xf8ccc6,null));};exports[_0xced3('0x72')]=function(_0x569055,_0x24d0ad,_0x22e74d){return db['VoicePrefix']['find']({'where':{'id':_0x569055[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x24d0ad,null))[_0xced3('0x27')](function(_0x138e25){if(_0x138e25){return _0x138e25[_0xced3('0x72')](_0x569055['body'][_0xced3('0x73')],_[_0xced3('0x74')](_0x569055[_0xced3('0x51')],[_0xced3('0x73'),'id'])||{})['spread'](function(_0x13020d){for(var _0x1777eb=0x0;_0x1777eb<_0x569055[_0xced3('0x51')][_0xced3('0x73')][_0xced3('0x3a')];_0x1777eb+=0x1){socket[_0xced3('0x75')](_0xced3('0x76'),{'UserId':Number(_0x569055[_0xced3('0x51')][_0xced3('0x73')][_0x1777eb]),'VoicePrefixId':Number(_0x569055[_0xced3('0x4c')]['id'])});}return _0x13020d;});}})['then'](respondWithResult(_0x24d0ad,null))[_0xced3('0x49')](handleError(_0x24d0ad,null));};exports[_0xced3('0x77')]=function(_0x498ea9,_0x284cf2,_0xeef6f4){return db[_0xced3('0x30')][_0xced3('0x4b')]({'where':{'id':_0x498ea9[_0xced3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x284cf2,null))[_0xced3('0x27')](function(_0x3e561e){if(_0x3e561e){return _0x3e561e['removeAgents'](_0x498ea9[_0xced3('0x36')][_0xced3('0x73')])[_0xced3('0x27')](function(){if(_[_0xced3('0x78')](_0x498ea9[_0xced3('0x36')][_0xced3('0x73')])){for(var _0x5c68e1=0x0;_0x5c68e1<_0x498ea9[_0xced3('0x36')][_0xced3('0x73')][_0xced3('0x3a')];_0x5c68e1+=0x1){socket[_0xced3('0x75')](_0xced3('0x79'),{'UserId':Number(_0x498ea9[_0xced3('0x36')]['ids'][_0x5c68e1]),'VoicePrefixId':Number(_0x498ea9['params']['id'])});}}else{socket[_0xced3('0x75')](_0xced3('0x79'),{'UserId':Number(_0x498ea9[_0xced3('0x36')][_0xced3('0x73')]),'VoicePrefixId':Number(_0x498ea9[_0xced3('0x4c')]['id'])});}});}})[_0xced3('0x27')](respondWithStatusCode(_0x284cf2,null))[_0xced3('0x49')](handleError(_0x284cf2,null));};exports['getAgents']=function(_0x3d64ec,_0x290ca3,_0x51979a){var _0x5de22d={};var _0x12de12={};var _0x29f8b5;var _0x3b07ac;return db[_0xced3('0x30')][_0xced3('0x7a')]({'where':{'id':_0x3d64ec['params']['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x290ca3,null))['then'](function(_0x34edbf){if(_0x34edbf){_0x29f8b5=_0x34edbf;_0x12de12[_0xced3('0x35')]=_[_0xced3('0x4a')](db[_0xced3('0x7b')][_0xced3('0x31')]);_0x12de12['query']=_[_0xced3('0x4a')](_0x3d64ec[_0xced3('0x36')]);_0x12de12[_0xced3('0x40')]=_[_0xced3('0x37')](_0x12de12['model'],_0x12de12['query']);_0x5de22d[_0xced3('0x38')]=_[_0xced3('0x37')](_0x12de12[_0xced3('0x35')],qs[_0xced3('0x39')](_0x3d64ec[_0xced3('0x36')][_0xced3('0x39')]));_0x5de22d[_0xced3('0x38')]=_0x5de22d[_0xced3('0x38')]['length']?_0x5de22d['attributes']:_0x12de12[_0xced3('0x35')];_0x5de22d[_0xced3('0x3d')]=qs[_0xced3('0x3e')](_0x3d64ec[_0xced3('0x36')][_0xced3('0x3e')]);_0x5de22d[_0xced3('0x42')]=qs[_0xced3('0x40')](_[_0xced3('0x3f')](_0x3d64ec[_0xced3('0x36')],_0x12de12[_0xced3('0x40')]));if(_0x3d64ec[_0xced3('0x36')]['filter']){_0x5de22d[_0xced3('0x42')]=_['merge'](_0x5de22d[_0xced3('0x42')],{'$or':_[_0xced3('0x2f')](_0x5de22d[_0xced3('0x38')],function(_0x3ad616){var _0x1df2d1={};_0x1df2d1[_0x3ad616]={'$like':'%'+_0x3d64ec[_0xced3('0x36')][_0xced3('0x41')]+'%'};return _0x1df2d1;})});}_0x5de22d=_[_0xced3('0x43')]({},_0x5de22d,_0x3d64ec[_0xced3('0x45')]);return _0x29f8b5[_0xced3('0x7c')](_0x5de22d);}})[_0xced3('0x27')](function(_0x3869f3){if(_0x3869f3){_0x3b07ac=_0x3869f3[_0xced3('0x3a')];if(!_0x3d64ec[_0xced3('0x36')][_0xced3('0x3b')](_0xced3('0x3c'))){_0x5de22d[_0xced3('0x21')]=qs['limit'](_0x3d64ec['query']['limit']);_0x5de22d[_0xced3('0x1f')]=qs[_0xced3('0x1f')](_0x3d64ec[_0xced3('0x36')][_0xced3('0x1f')]);}return _0x29f8b5[_0xced3('0x7c')](_0x5de22d);}})[_0xced3('0x27')](function(_0x587891){if(_0x587891){return _0x587891?{'count':_0x3b07ac,'rows':_0x587891}:null;}})[_0xced3('0x27')](respondWithResult(_0x290ca3,null))[_0xced3('0x49')](handleError(_0x290ca3,null));};exports['getTeams']=function(_0x5e6a80,_0x451c1a,_0x3284da){var _0x34ebbd={};var _0x4412cc={};var _0x3e5f7f;var _0x3b3a5c;return db['VoicePrefix'][_0xced3('0x7a')]({'where':{'id':_0x5e6a80['params']['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x451c1a,null))[_0xced3('0x27')](function(_0x44a80b){if(_0x44a80b){_0x3e5f7f=_0x44a80b;_0x4412cc['model']=_['keys'](db['Team'][_0xced3('0x31')]);_0x4412cc[_0xced3('0x36')]=_['keys'](_0x5e6a80[_0xced3('0x36')]);_0x4412cc[_0xced3('0x40')]=_['intersection'](_0x4412cc[_0xced3('0x35')],_0x4412cc[_0xced3('0x36')]);_0x34ebbd[_0xced3('0x38')]=_[_0xced3('0x37')](_0x4412cc[_0xced3('0x35')],qs[_0xced3('0x39')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x39')]));_0x34ebbd['attributes']=_0x34ebbd[_0xced3('0x38')][_0xced3('0x3a')]?_0x34ebbd[_0xced3('0x38')]:_0x4412cc[_0xced3('0x35')];_0x34ebbd[_0xced3('0x3d')]=qs[_0xced3('0x3e')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x3e')]);_0x34ebbd[_0xced3('0x42')]=qs[_0xced3('0x40')](_[_0xced3('0x3f')](_0x5e6a80[_0xced3('0x36')],_0x4412cc[_0xced3('0x40')]));if(_0x5e6a80[_0xced3('0x36')][_0xced3('0x41')]){_0x34ebbd['where']=_[_0xced3('0x43')](_0x34ebbd[_0xced3('0x42')],{'$or':_[_0xced3('0x2f')](_0x34ebbd[_0xced3('0x38')],function(_0x2c59f5){var _0x5874b5={};_0x5874b5[_0x2c59f5]={'$like':'%'+_0x5e6a80['query'][_0xced3('0x41')]+'%'};return _0x5874b5;})});}_0x34ebbd=_[_0xced3('0x43')]({},_0x34ebbd,_0x5e6a80[_0xced3('0x45')]);return _0x3e5f7f[_0xced3('0x7d')](_0x34ebbd);}})[_0xced3('0x27')](function(_0x26920d){if(_0x26920d){_0x3b3a5c=_0x26920d[_0xced3('0x3a')];if(!_0x5e6a80['query']['hasOwnProperty'](_0xced3('0x3c'))){_0x34ebbd['limit']=qs[_0xced3('0x21')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x21')]);_0x34ebbd[_0xced3('0x1f')]=qs[_0xced3('0x1f')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x1f')]);}return _0x3e5f7f[_0xced3('0x7d')](_0x34ebbd);}})[_0xced3('0x27')](function(_0x2b688c){if(_0x2b688c){return _0x2b688c?{'count':_0x3b3a5c,'rows':_0x2b688c}:null;}})[_0xced3('0x27')](respondWithResult(_0x451c1a,null))[_0xced3('0x49')](handleError(_0x451c1a,null));};exports[_0xced3('0x7e')]=function(_0xbd91ef,_0x561aca,_0x4b2f62){var _0x361c6f=_0xbd91ef['body'][_0xced3('0x73')];var _0x4f0fcb;return db['Team'][_0xced3('0x7f')]({'where':{'id':_0x361c6f},'attributes':['id'],'include':[{'model':db[_0xced3('0x7b')],'as':_0xced3('0x80'),'attributes':['id',_0xced3('0x2c'),'online','voicePause',_0xced3('0x81')],'raw':!![]}]})[_0xced3('0x27')](function(_0x2f2f77){if(_0x2f2f77){_0x4f0fcb=_0x2f2f77;var _0x5448d5=_[_0xced3('0x82')](_0x2f2f77,function(_0x50cc83){var _0x4b6afc=_0x50cc83[_0xced3('0x29')]({'plain':!![]});return _0x4b6afc[_0xced3('0x80')];});return db[_0xced3('0x30')][_0xced3('0x4b')]({'where':{'id':_0xbd91ef[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](function(_0x420c12){return db[_0xced3('0x4f')]['transaction'](function(_0x566191){return _0x420c12[_0xced3('0x7e')](_0x361c6f,{'transaction':_0x566191})['then'](function(){return BPromise[_0xced3('0x83')](_0x4f0fcb,function(_0x239dda){return db['TeamVoicePrefix'][_0xced3('0x84')]({'TeamId':_0x239dda['id'],'VoicePrefixId':_0xbd91ef[_0xced3('0x4c')]['id']},{'transaction':_0x566191});});})[_0xced3('0x27')](function(){return BPromise[_0xced3('0x83')](_0x5448d5,function(_0x7fb3c7){return db[_0xced3('0x85')]['findOrCreate']({'where':{'UserId':_0x7fb3c7['id'],'VoicePrefixId':_0xbd91ef[_0xced3('0x4c')]['id']},'transaction':_0x566191});});})[_0xced3('0x27')](function(){_0x5448d5[_0xced3('0x86')](function(_0x3d88fc){socket[_0xced3('0x75')](_0xced3('0x76'),{'UserId':_0x3d88fc['id'],'VoicePrefixId':_0x420c12['id']});});});});});}})['then'](respondWithStatusCode(_0x561aca,null))['catch'](handleError(_0x561aca,null));};exports['removeTeams']=function(_0x4074b9,_0x2e2303,_0x26af34){return db[_0xced3('0x87')][_0xced3('0x7f')]({'where':{'id':_0x4074b9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xced3('0x7b')],'as':_0xced3('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e2303,null))['then'](function(_0xdec3b0){var _0x38a06b=_[_0xced3('0x2f')](_0xdec3b0,'id');var _0xbeffe6=[];var _0x2211ed=[];var _0x22ab59=squel[_0xced3('0x88')]();_0x22ab59[_0xced3('0x89')](_0xced3('0x8a'))[_0xced3('0x8b')]('team_has_voice_prefixes','tq')[_0xced3('0x8c')](_0xced3('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xced3('0x42')](_0xced3('0x8e'),_0x4074b9[_0xced3('0x4c')]['id']);for(var _0x268c72=0x0;_0x268c72<_0xdec3b0[_0xced3('0x3a')];_0x268c72+=0x1){let _0x26daab=_0xdec3b0[_0x268c72];for(var _0x1ab60d=0x0;_0x1ab60d<_0x26daab[_0xced3('0x80')]['length'];_0x1ab60d+=0x1){let _0x5dd10b=_0x26daab[_0xced3('0x80')][_0x1ab60d];var _0x173a37=_0x22ab59['clone']();_0x173a37[_0xced3('0x42')](_0xced3('0x8f'),_0x5dd10b['id']);_0x2211ed[_0xced3('0x67')](db[_0xced3('0x4f')][_0xced3('0x36')](_0x173a37[_0xced3('0x90')](),{'type':db['sequelize'][_0xced3('0x91')]['SELECT']})['then'](function(_0x2ed48f){if(_0x2ed48f[_0xced3('0x3a')]===0x1){return _0x5dd10b['id'];}else{var _0x21f013=_[_0xced3('0x92')](_['map'](_0x2ed48f,_0xced3('0x93')),function(_0x1082c0){return _['includes'](_0x38a06b,_0x1082c0);});if(_0x21f013){return _0x5dd10b['id'];}}}));}}return BPromise['all'](_0x2211ed)['then'](function(_0x3e8ed7){_0xbeffe6=_(_0xbeffe6)[_0xced3('0x94')](_0x3e8ed7)[_0xced3('0x95')]()[_0xced3('0x96')]();return db[_0xced3('0x30')][_0xced3('0x4b')]({'where':{'id':_0x4074b9[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](function(_0x235faa){return db[_0xced3('0x4f')]['transaction'](function(_0x5e9fba){return _0x235faa[_0xced3('0x97')](_0x4074b9[_0xced3('0x36')]['ids'],{'transaction':_0x5e9fba})['then'](function(){if(!_[_0xced3('0x98')](_0xbeffe6)){return _0x235faa[_0xced3('0x77')](_0xbeffe6,{'transaction':_0x5e9fba});}})[_0xced3('0x27')](function(){_0xbeffe6['forEach'](function(_0x473c70){socket['emit'](_0xced3('0x79'),{'UserId':_0x473c70,'VoicePrefixId':_0x235faa['id']});});});});});});})['then'](respondWithStatusCode(_0x2e2303,null))[_0xced3('0x49')](handleError(_0x2e2303,null));};
\ No newline at end of file
index eb90956..9b7e80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc6a=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfc6a,0x1d1));var _0xafc6=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xfc6a[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require(_0xafc6('0x0'));var VoicePrefix=require(_0xafc6('0x1'))['db'][_0xafc6('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xafc6('0x3'),'afterUpdate':_0xafc6('0x4'),'afterDestroy':_0xafc6('0x5')};function emitEvent(_0xaba389){return function(_0x561d49,_0x301e95,_0x1900da){VoicePrefixEvents[_0xafc6('0x6')](_0xaba389+':'+_0x561d49['id'],_0x561d49);VoicePrefixEvents['emit'](_0xaba389,_0x561d49);_0x1900da(null);};}for(var e in events){if(events[_0xafc6('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xafc6('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x9b7f=['../../mysqldb','VoicePrefix','setMaxListeners','hook','events'];(function(_0x13520f,_0x40dee5){var _0x5ecd93=function(_0x509d52){while(--_0x509d52){_0x13520f['push'](_0x13520f['shift']());}};_0x5ecd93(++_0x40dee5);}(_0x9b7f,0x18f));var _0xf9b7=function(_0x4cdc78,_0x5e168b){_0x4cdc78=_0x4cdc78-0x0;var _0x1cbfd0=_0x9b7f[_0x4cdc78];return _0x1cbfd0;};'use strict';var EventEmitter=require(_0xf9b7('0x0'));var VoicePrefix=require(_0xf9b7('0x1'))['db'][_0xf9b7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf9b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2eb628){return function(_0x5b5fca,_0x343f8a,_0x54c6d7){VoicePrefixEvents['emit'](_0x2eb628+':'+_0x5b5fca['id'],_0x5b5fca);VoicePrefixEvents['emit'](_0x2eb628,_0x5b5fca);_0x54c6d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xf9b7('0x4')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index 6ea27ed..3364b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2be=['define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x38303a,_0x188fa6){var _0x59d093=function(_0x5384ec){while(--_0x5384ec){_0x38303a['push'](_0x38303a['shift']());}};_0x59d093(++_0x188fa6);}(_0xd2be,0x121));var _0xed2b=function(_0x27c033,_0x3ff7cd){_0x27c033=_0x27c033-0x0;var _0x257792=_0xd2be[_0x27c033];return _0x257792;};'use strict';var _=require('lodash');var util=require(_0xed2b('0x0'));var logger=require(_0xed2b('0x1'))(_0xed2b('0x2'));var moment=require(_0xed2b('0x3'));var BPromise=require(_0xed2b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed2b('0x5'));var rimraf=require(_0xed2b('0x6'));var config=require(_0xed2b('0x7'));var attributes=require(_0xed2b('0x8'));module[_0xed2b('0x9')]=function(_0x543639,_0x3cb508){return _0x543639[_0xed2b('0xa')](_0xed2b('0xb'),attributes,{'tableName':_0xed2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x745d=['./voicePrefix.attributes','exports','voice_prefixes','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4cb9f8,_0x11181c){var _0x52d248=function(_0x559620){while(--_0x559620){_0x4cb9f8['push'](_0x4cb9f8['shift']());}};_0x52d248(++_0x11181c);}(_0x745d,0xa3));var _0xd745=function(_0x3d05b3,_0x23600c){_0x3d05b3=_0x3d05b3-0x0;var _0x179cd8=_0x745d[_0x3d05b3];return _0x179cd8;};'use strict';var _=require('lodash');var util=require(_0xd745('0x0'));var logger=require('../../config/logger')(_0xd745('0x1'));var moment=require(_0xd745('0x2'));var BPromise=require(_0xd745('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd745('0x4'));var rimraf=require(_0xd745('0x5'));var config=require(_0xd745('0x6'));var attributes=require(_0xd745('0x7'));module[_0xd745('0x8')]=function(_0x14d7ff,_0x47e1bb){return _0x14d7ff['define']('VoicePrefix',attributes,{'tableName':_0xd745('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a233cd..c0dd652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb923=['./voicePrefix.socket','register','request','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x3adea3,_0x11b4f2){var _0x140130=function(_0x58a053){while(--_0x58a053){_0x3adea3['push'](_0x3adea3['shift']());}};_0x140130(++_0x11b4f2);}(_0xb923,0xa2));var _0x3b92=function(_0x5976ed,_0x882b44){_0x5976ed=_0x5976ed-0x0;var _0x1a8f3b=_0xb923[_0x5976ed];return _0x1a8f3b;};'use strict';var _=require(_0x3b92('0x0'));var util=require(_0x3b92('0x1'));var moment=require(_0x3b92('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b92('0x3'));var fs=require('fs');var Redis=require(_0x3b92('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b92('0x5'));var config=require(_0x3b92('0x6'));var jayson=require(_0x3b92('0x7'));var client=jayson[_0x3b92('0x8')][_0x3b92('0x9')]({'port':0x232a});config[_0x3b92('0xa')]=_[_0x3b92('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3b92('0xc'))(new Redis(config['redis']));require(_0x3b92('0xd'))[_0x3b92('0xe')](socket);function respondWithRpcPromise(_0x4e2f86,_0x401978,_0x2d495e){return new BPromise(function(_0x215039,_0x14efdd){return client[_0x3b92('0xf')](_0x4e2f86,_0x2d495e)['then'](function(_0xd82192){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x401978,_0x3b92('0x10'));logger[_0x3b92('0x11')](_0x3b92('0x12'),_0x401978,_0x3b92('0x10'),JSON['stringify'](_0xd82192));if(_0xd82192['error']){if(_0xd82192[_0x3b92('0x13')]['code']===0x1f4){logger['error'](_0x3b92('0x14'),_0x401978,_0xd82192[_0x3b92('0x13')][_0x3b92('0x15')]);return _0x14efdd(_0xd82192[_0x3b92('0x13')][_0x3b92('0x15')]);}logger['error'](_0x3b92('0x14'),_0x401978,_0xd82192[_0x3b92('0x13')]['message']);return _0x215039(_0xd82192['error'][_0x3b92('0x15')]);}else{logger[_0x3b92('0x16')](_0x3b92('0x14'),_0x401978,_0x3b92('0x10'));_0x215039(_0xd82192[_0x3b92('0x17')][_0x3b92('0x15')]);}})[_0x3b92('0x18')](function(_0x2666a8){logger[_0x3b92('0x13')](_0x3b92('0x14'),_0x401978,_0x2666a8);_0x14efdd(_0x2666a8);});});}
\ No newline at end of file
+var _0x8277=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x1f58ec,_0x21ac5f){var _0x3e8be4=function(_0x45619d){while(--_0x45619d){_0x1f58ec['push'](_0x1f58ec['shift']());}};_0x3e8be4(++_0x21ac5f);}(_0x8277,0xcf));var _0x7827=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x8277[_0x2e0443];return _0x52d450;};'use strict';var _=require('lodash');var util=require(_0x7827('0x0'));var moment=require(_0x7827('0x1'));var BPromise=require('bluebird');var rs=require(_0x7827('0x2'));var fs=require('fs');var Redis=require(_0x7827('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7827('0x4'));var logger=require(_0x7827('0x5'))('rpc');var config=require(_0x7827('0x6'));var jayson=require(_0x7827('0x7'));var client=jayson[_0x7827('0x8')]['http']({'port':0x232a});config[_0x7827('0x9')]=_[_0x7827('0xa')](config[_0x7827('0x9')],{'host':_0x7827('0xb'),'port':0x18eb});var socket=require(_0x7827('0xc'))(new Redis(config[_0x7827('0x9')]));require(_0x7827('0xd'))[_0x7827('0xe')](socket);function respondWithRpcPromise(_0xfd2a88,_0x2392d8,_0x2abc26){return new BPromise(function(_0x4472b2,_0x21f5d5){return client[_0x7827('0xf')](_0xfd2a88,_0x2abc26)['then'](function(_0x457717){logger[_0x7827('0x10')](_0x7827('0x11'),_0x2392d8,_0x7827('0x12'));logger['debug'](_0x7827('0x13'),_0x2392d8,_0x7827('0x12'),JSON[_0x7827('0x14')](_0x457717));if(_0x457717[_0x7827('0x15')]){if(_0x457717[_0x7827('0x15')][_0x7827('0x16')]===0x1f4){logger[_0x7827('0x15')](_0x7827('0x11'),_0x2392d8,_0x457717[_0x7827('0x15')][_0x7827('0x17')]);return _0x21f5d5(_0x457717[_0x7827('0x15')][_0x7827('0x17')]);}logger[_0x7827('0x15')](_0x7827('0x11'),_0x2392d8,_0x457717[_0x7827('0x15')]['message']);return _0x4472b2(_0x457717[_0x7827('0x15')][_0x7827('0x17')]);}else{logger[_0x7827('0x10')](_0x7827('0x11'),_0x2392d8,_0x7827('0x12'));_0x4472b2(_0x457717[_0x7827('0x18')][_0x7827('0x17')]);}})[_0x7827('0x19')](function(_0x4f6500){logger[_0x7827('0x15')](_0x7827('0x11'),_0x2392d8,_0x4f6500);_0x21f5d5(_0x4f6500);});});}
\ No newline at end of file
index 2840774..a913283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e0=['emit','removeListener','register','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x5d949e,_0x555707){var _0x445c1e=function(_0x160f2a){while(--_0x160f2a){_0x5d949e['push'](_0x5d949e['shift']());}};_0x445c1e(++_0x555707);}(_0x55e0,0xdc));var _0x055e=function(_0x390bbe,_0x514843){_0x390bbe=_0x390bbe-0x0;var _0x5aaed0=_0x55e0[_0x390bbe];return _0x5aaed0;};'use strict';var VoicePrefixEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){VoicePrefixEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);VoicePrefixEvents['on'](_0x8e7824,_0x3c4cf);}};
\ No newline at end of file
+var _0xe3ee=['register','length','voicePrefix:','remove','update'];(function(_0x5d6a92,_0x3d2de2){var _0x23ea87=function(_0x405389){while(--_0x405389){_0x5d6a92['push'](_0x5d6a92['shift']());}};_0x23ea87(++_0x3d2de2);}(_0xe3ee,0x116));var _0xee3e=function(_0x263f4f,_0x51efcc){_0x263f4f=_0x263f4f-0x0;var _0x5121b3=_0xe3ee[_0x263f4f];return _0x5121b3;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0xee3e('0x0'),_0xee3e('0x1')];function createListener(_0x5927b6,_0x52bcf2){return function(_0x45bf25){_0x52bcf2['emit'](_0x5927b6,_0x45bf25);};}function removeListener(_0x4c48ed,_0x12b41d){return function(){VoicePrefixEvents['removeListener'](_0x4c48ed,_0x12b41d);};}exports[_0xee3e('0x2')]=function(_0x352eca){for(var _0x3907a7=0x0,_0xd893ca=events[_0xee3e('0x3')];_0x3907a7<_0xd893ca;_0x3907a7++){var _0x39a770=events[_0x3907a7];var _0x43ab67=createListener(_0xee3e('0x4')+_0x39a770,_0x352eca);VoicePrefixEvents['on'](_0x39a770,_0x43ab67);}};
\ No newline at end of file
index 7db1cc5..124ee66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0xb10b,0x12a));var _0xbb10=function(_0x211f68,_0x47a58a){_0x211f68=_0x211f68-0x0;var _0x13604e=_0xb10b[_0x211f68];return _0x13604e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
+var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x4ac31f,_0x3bf843){var _0x1f1926=function(_0x362de5){while(--_0x362de5){_0x4ac31f['push'](_0x4ac31f['shift']());}};_0x1f1926(++_0x3bf843);}(_0xb10b,0x12a));var _0xbb10=function(_0xa92559,_0x1d2e45){_0xa92559=_0xa92559-0x0;var _0x502df8=_0xb10b[_0xa92559];return _0x502df8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
index 20cdfd0..9ec7c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0756=['getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory'];(function(_0x18518a,_0x172314){var _0x32d2f7=function(_0x3fe6f9){while(--_0x3fe6f9){_0x18518a['push'](_0x18518a['shift']());}};_0x32d2f7(++_0x172314);}(_0x0756,0x9d));var _0x6075=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0756[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x6075('0x0'));module['exports']={'name':{'type':Sequelize[_0x6075('0x1')],'allowNull':![],'unique':_0x6075('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x4'),_0x6075('0x5')),'allowNull':![],'defaultValue':_0x6075('0x4')},'musiconhold':{'type':Sequelize[_0x6075('0x1')],'defaultValue':_0x6075('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x6075('0x3')]('rr',_0x6075('0x7'),_0x6075('0x8'),_0x6075('0x9'),_0x6075('0xa'),'rrmemory',_0x6075('0xb'),_0x6075('0xc'),_0x6075('0xd')),'allowNull':![],'defaultValue':_0x6075('0x7'),'set':function(_0x1c9d58){this[_0x6075('0xe')](_0x6075('0xf'),_0x1c9d58?_0x1c9d58:_0x6075('0x10'));},'get':function(){var _0x146d02=this[_0x6075('0x11')](_0x6075('0x12'));var _0x2896b2=this[_0x6075('0x11')](_0x6075('0x13'));var _0x30a4e2=this['getDataValue']('strategy');if(_0x146d02==='outbound'){if(_0x2896b2===_0x6075('0x14')){return null;}if(_0x2896b2===_0x6075('0x15')&&!['rrmemory',_0x6075('0x16')][_0x6075('0x17')](_0x30a4e2)){this[_0x6075('0xe')]('strategy',_0x6075('0x10'));}}return _0x30a4e2;}},'servicelevel':{'type':Sequelize[_0x6075('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6075('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6075('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no',_0x6075('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x6075('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x6075('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x6075('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x6075('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6075('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x6075('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x6075('0x19'),'no'),'defaultValue':_0x6075('0x19')},'announce_holdtime':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no',_0x6075('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x6075('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6075('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x6075('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6075('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x6075('0x1')]},'queue_quantity2':{'type':Sequelize[_0x6075('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x6075('0x1')]},'queue_less_than':{'type':Sequelize[_0x6075('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x3781cb){this[_0x6075('0xe')](_0x6075('0x1c'),_0x3781cb?_0x3781cb[_0x6075('0x1d')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this['getDataValue'](_0x6075('0x1c'))[_0x6075('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x6075('0x1')],'defaultValue':_0x6075('0x19'),'set':function(_0x26d4a8){this[_0x6075('0xe')](_0x6075('0x1f'),_0x26d4a8?_0x26d4a8[_0x6075('0x1d')](','):undefined);},'get':function(){return this[_0x6075('0x11')](_0x6075('0x1f'))?this['getDataValue'](_0x6075('0x1f'))[_0x6075('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6075('0x1')],'defaultValue':'no','set':function(_0x139eb4){this[_0x6075('0xe')](_0x6075('0x20'),_0x139eb4?_0x139eb4['join'](','):undefined);},'get':function(){return this[_0x6075('0x11')]('leavewhenempty')?this[_0x6075('0x11')](_0x6075('0x20'))[_0x6075('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x6075('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x6075('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6075('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3e3bbb){this['setDataValue'](_0x6075('0x21'),_0x3e3bbb);if(_0x3e3bbb){if(this[_0x6075('0x11')](_0x6075('0x22'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x6075('0x23')],'defaultValue':0x0,'comment':_0x6075('0x24')},'dialMethod':{'type':Sequelize[_0x6075('0x3')]('preview',_0x6075('0x25'),_0x6075('0x26'),_0x6075('0x27'),_0x6075('0x15')),'defaultValue':_0x6075('0x25'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x6075('0x18')](0x4)[_0x6075('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6075('0x29')},'dialLimitQueue':{'type':Sequelize[_0x6075('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6075('0x2a')},'dialPowerLevel':{'type':Sequelize[_0x6075('0x2b')](0x2)[_0x6075('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x2c'),'dropRate'),'defaultValue':_0x6075('0x2d'),'comment':_0x6075('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6075('0x2b')](0x2)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6075('0x2f')},'dialPredictiveInterval':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x6075('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6075('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x30')},'dialQueueOptions':{'type':Sequelize[_0x6075('0x1')],'defaultValue':_0x6075('0x31'),'comment':_0x6075('0x32')},'dialQueueTimeout':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x33')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x6075('0x34')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x35')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6075('0x18')](0x5)[_0x6075('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x36')},'dialBusyMaxRetry':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x37')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x38')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6075('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x39')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6075('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6075('0x3a')},'dialTimezone':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6075('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x6075('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6075('0x3')](_0x6075('0x3b'),_0x6075('0x3c'),_0x6075('0x3d')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x6075('0x23')],'defaultValue':0x0,'comment':_0x6075('0x3e')},'dialAMDInitialSilence':{'type':Sequelize[_0x6075('0x18')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6075('0x3f')},'dialAMDGreeting':{'type':Sequelize[_0x6075('0x18')](0x9)[_0x6075('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6075('0x18')](0x9)[_0x6075('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6075('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6075('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6075('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0x6075('0x18')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6075('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6075('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6075('0x44')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6075('0x18')](0x5)[_0x6075('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6075('0x45')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6075('0x46')},'dialRecallMeTimeout':{'type':Sequelize[_0x6075('0x18')](0x5)[_0x6075('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6075('0x47')},'dialRecallInQueue':{'type':Sequelize[_0x6075('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x6075('0x48'),'ASC'),'defaultValue':_0x6075('0x48')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x6075('0x34')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x6075('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6075('0x49')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6075('0x4a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6075('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x6075('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6075('0x18')](0x5)[_0x6075('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x4f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x50')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6075('0x18')](0x5)[_0x6075('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x51')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6075('0x52')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6075('0x53')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6075('0x18')],'allowNull':!![],'comment':_0x6075('0x54')},'mandatoryDisposition':{'type':Sequelize[_0x6075('0x23')],'defaultValue':![],'comment':_0x6075('0x55'),'set':function(_0x2a81eb){if(!_0x2a81eb)this[_0x6075('0xe')]('mandatoryDispositionPauseId',null);this[_0x6075('0xe')](_0x6075('0x56'),_0x2a81eb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x6075('0x23')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x6075('0x18')](0x3)[_0x6075('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x6075('0x23')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0461=['07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','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)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','exports','STRING','name','inbound','outbound','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','roundrobin','includes','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','booked','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1cd65a,_0x29fa8f){var _0xf93849=function(_0x29fbe1){while(--_0x29fbe1){_0x1cd65a['push'](_0x1cd65a['shift']());}};_0xf93849(++_0x29fa8f);}(_0x0461,0x72));var _0x1046=function(_0xb4641a,_0x229cb3){_0xb4641a=_0xb4641a-0x0;var _0xf36925=_0x0461[_0xb4641a];return _0xf36925;};'use strict';var Sequelize=require(_0x1046('0x0'));module[_0x1046('0x1')]={'name':{'type':Sequelize[_0x1046('0x2')],'allowNull':![],'unique':_0x1046('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x1046('0x4'),_0x1046('0x5')),'allowNull':![],'defaultValue':_0x1046('0x4')},'musiconhold':{'type':Sequelize[_0x1046('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x1046('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1046('0x6')]('rr',_0x1046('0x7'),_0x1046('0x8'),_0x1046('0x9'),_0x1046('0xa'),_0x1046('0xb'),_0x1046('0xc'),'wrandom',_0x1046('0xd')),'allowNull':![],'defaultValue':_0x1046('0x7'),'set':function(_0x307a71){this[_0x1046('0xe')](_0x1046('0xf'),_0x307a71?_0x307a71:_0x1046('0xb'));},'get':function(){var _0x3d4444=this[_0x1046('0x10')](_0x1046('0x11'));var _0x5c136a=this[_0x1046('0x10')](_0x1046('0x12'));var _0x3e7d2b=this['getDataValue'](_0x1046('0xf'));if(_0x3d4444===_0x1046('0x5')){if(_0x5c136a==='preview'){return null;}if(_0x5c136a==='booked'&&!['rrmemory',_0x1046('0x13')][_0x1046('0x14')](_0x3e7d2b)){this[_0x1046('0xe')](_0x1046('0xf'),_0x1046('0xb'));}}return _0x3e7d2b;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1046('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1046('0x15')](0xb)},'timeout':{'type':Sequelize[_0x1046('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1046('0x2')]},'weight':{'type':Sequelize[_0x1046('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1046('0x6')]('yes','no'),'defaultValue':_0x1046('0x16')},'autopause':{'type':Sequelize['ENUM'](_0x1046('0x16'),'no',_0x1046('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1046('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x1046('0x6')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1046('0x6')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1046('0x6')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1046('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1046('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1046('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1046('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1046('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':_0x1046('0x16')},'announce_holdtime':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no',_0x1046('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1046('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1046('0x6')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x1046('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1046('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1046('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1046('0x2')]},'queue_youarenext':{'type':Sequelize[_0x1046('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1046('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1046('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1046('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1046('0x2')]},'queue_quantity1':{'type':Sequelize[_0x1046('0x2')]},'queue_quantity2':{'type':Sequelize[_0x1046('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x1046('0x2')]},'queue_less_than':{'type':Sequelize[_0x1046('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x18cd50){this[_0x1046('0xe')](_0x1046('0x19'),_0x18cd50?_0x18cd50[_0x1046('0x1a')](','):[]);},'get':function(){return this[_0x1046('0x10')]('periodic_announce')?this['getDataValue'](_0x1046('0x19'))[_0x1046('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x1046('0x16'),'set':function(_0x31ea37){this['setDataValue'](_0x1046('0x1c'),_0x31ea37?_0x31ea37[_0x1046('0x1a')](','):undefined);},'get':function(){return this[_0x1046('0x10')](_0x1046('0x1c'))?this['getDataValue']('joinempty')[_0x1046('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1046('0x2')],'defaultValue':'no','set':function(_0x2f45f2){this[_0x1046('0xe')]('leavewhenempty',_0x2f45f2?_0x2f45f2[_0x1046('0x1a')](','):undefined);},'get':function(){return this[_0x1046('0x10')]('leavewhenempty')?this[_0x1046('0x10')](_0x1046('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x1046('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1046('0x2')]},'description':{'type':Sequelize[_0x1046('0x2')]},'acw':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':0x0,'set':function(_0x31f4f0){this['setDataValue'](_0x1046('0x1f'),_0x31f4f0);if(_0x31f4f0){if(this['getDataValue'](_0x1046('0x20'))<0x2){this[_0x1046('0xe')](_0x1046('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1046('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':0x0,'comment':_0x1046('0x21')},'dialMethod':{'type':Sequelize[_0x1046('0x6')](_0x1046('0x22'),_0x1046('0x23'),_0x1046('0x24'),_0x1046('0x25'),_0x1046('0x26')),'defaultValue':_0x1046('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x1046('0x15')](0x4)[_0x1046('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1046('0x28')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1046('0x29')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x1046('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1046('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x1046('0x6')]('agentBusyFactor',_0x1046('0x2b')),'defaultValue':_0x1046('0x2b'),'comment':_0x1046('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1046('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1046('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1046('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1046('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1046('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x1046('0x2')],'defaultValue':_0x1046('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x1046('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x30')},'dialQueueProject':{'type':Sequelize[_0x1046('0x2')],'comment':_0x1046('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1046('0x15')](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1046('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'comment':_0x1046('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1046('0x15')](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1046('0x38')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1046('0x39'),_0x1046('0x3a'),_0x1046('0x3b')),'defaultValue':_0x1046('0x39')},'dialAMDActive':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1046('0x3c')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1046('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1046('0x15')](0x9)[_0x1046('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1046('0x15')](0x9)[_0x1046('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1046('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x1046('0x15')](0x9)[_0x1046('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1046('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1046('0x15')](0x9)[_0x1046('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1046('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1046('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1046('0x15')](0x5)[_0x1046('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1046('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1046('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1046('0x43')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1046('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':0x0,'comment':_0x1046('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1046('0x6')]('DESC',_0x1046('0x46')),'defaultValue':_0x1046('0x47')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x1046('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1046('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1046('0x48')},'dialCutDigit':{'type':Sequelize[_0x1046('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1046('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x1046('0x15')](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1046('0x50')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1046('0x15')](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x51')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1046('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1046('0x15')](0x5)[_0x1046('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1046('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1046('0x15')],'allowNull':!![],'comment':_0x1046('0x53')},'mandatoryDisposition':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x511085){if(!_0x511085)this['setDataValue'](_0x1046('0x54'),null);this[_0x1046('0xe')]('mandatoryDisposition',_0x511085);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1046('0x15')](0x3)[_0x1046('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x1046('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1046('0x1e')],'defaultValue':![]}};
\ No newline at end of file
index c1bae40..1109705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b94=['rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','body','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','rows','CmHopperHistory','include','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','format','emit','userVoiceQueue:save','User','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','ids','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','ListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','CmHopperId','OrderBy','h.id','ci.OrderBy+1','h.ContactId=ci.CmContactId','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','includes','value','type','end','error','stack','name','send','index','VoiceQueue','fieldName','key','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','show','params'];(function(_0x278422,_0x5c002a){var _0x53ad26=function(_0x2b9f0e){while(--_0x2b9f0e){_0x278422['push'](_0x278422['shift']());}};_0x53ad26(++_0x5c002a);}(_0x1b94,0x1f2));var _0x41b9=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x1b94[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require(_0x41b9('0x0'));var rimraf=require(_0x41b9('0x1'));var zipdir=require(_0x41b9('0x2'));var jsonpatch=require(_0x41b9('0x3'));var rp=require(_0x41b9('0x4'));var moment=require('moment');var BPromise=require(_0x41b9('0x5'));var Mustache=require(_0x41b9('0x6'));var util=require(_0x41b9('0x7'));var path=require('path');var sox=require(_0x41b9('0x8'));var csv=require(_0x41b9('0x9'));var ejs=require(_0x41b9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41b9('0xb'));var squel=require(_0x41b9('0xc'));var crypto=require(_0x41b9('0xd'));var jsforce=require(_0x41b9('0xe'));var deskjs=require(_0x41b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x41b9('0x10'));var Papa=require(_0x41b9('0x11'));var Redis=require('ioredis');var authService=require(_0x41b9('0x12'));var qs=require(_0x41b9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41b9('0x14'));var logger=require(_0x41b9('0x15'))('api');var utils=require(_0x41b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x41b9('0x17'));var db=require('../../mysqldb')['db'];config[_0x41b9('0x18')]=_[_0x41b9('0x19')](config[_0x41b9('0x18')],{'host':_0x41b9('0x1a'),'port':0x18eb});var socket=require(_0x41b9('0x1b'))(new Redis(config['redis']));require(_0x41b9('0x1c'))[_0x41b9('0x1d')](socket);function respondWithStatusCode(_0x5187a8,_0x44ee18){_0x44ee18=_0x44ee18||0xcc;return function(_0x134902){if(_0x134902){return _0x5187a8[_0x41b9('0x1e')](_0x44ee18);}return _0x5187a8[_0x41b9('0x1f')](_0x44ee18)['end']();};}function respondWithResult(_0x5849aa,_0x4a6357){_0x4a6357=_0x4a6357||0xc8;return function(_0x2d7bf0){if(_0x2d7bf0){return _0x5849aa[_0x41b9('0x1f')](_0x4a6357)['json'](_0x2d7bf0);}};}function respondWithFilteredResult(_0x56bd5e,_0x2414c8){return function(_0xfb3b46){if(_0xfb3b46){var _0x17b811=typeof _0x2414c8[_0x41b9('0x20')]===_0x41b9('0x21')&&typeof _0x2414c8[_0x41b9('0x22')]==='undefined';var _0x10bfdf=_0xfb3b46[_0x41b9('0x23')];var _0x5bc794=_0x17b811?0x0:_0x2414c8[_0x41b9('0x20')];var _0x2f6b69=_0x17b811?_0xfb3b46[_0x41b9('0x23')]:_0x2414c8[_0x41b9('0x20')]+_0x2414c8[_0x41b9('0x22')];var _0x1893ca;if(_0x2f6b69>=_0x10bfdf){_0x2f6b69=_0x10bfdf;_0x1893ca=0xc8;}else{_0x1893ca=0xce;}_0x56bd5e['status'](_0x1893ca);return _0x56bd5e[_0x41b9('0x24')]('Content-Range',_0x5bc794+'-'+_0x2f6b69+'/'+_0x10bfdf)[_0x41b9('0x25')](_0xfb3b46);}return null;};}function patchUpdates(_0x14dc16){return function(_0x27b024){try{jsonpatch[_0x41b9('0x26')](_0x27b024,_0x14dc16,!![]);}catch(_0x2fe95){return BPromise['reject'](_0x2fe95);}return _0x27b024[_0x41b9('0x27')]();};}function saveUpdates(_0x50e26b,_0x5553ca){return function(_0x59f751){if(_0x59f751){return _0x59f751[_0x41b9('0x28')](_0x50e26b)[_0x41b9('0x29')](function(_0xfc833b){return _0xfc833b;});}return null;};}function removeEntity(_0x2228d8,_0x136b46){return function(_0x465280){if(_0x465280){return _0x465280[_0x41b9('0x2a')]()[_0x41b9('0x29')](function(){var _0x18ea59=_0x465280['get']({'plain':!![]});var _0x516845=[{'name':_0x41b9('0x2b'),'value':_0x41b9('0x2c'),'ignore':![]},{'name':_0x41b9('0x2d'),'value':_0x41b9('0x2e'),'ignore':![]}];var _0x3dffb2=_(_0x516845)[_0x41b9('0x2f')](_0x41b9('0x30'))[_0x41b9('0x31')]('value')['value']();if(_[_0x41b9('0x32')](_0x3dffb2,_0x18ea59['type'])){return;}var _0x6de6c5=_['find'](_0x516845,[_0x41b9('0x33'),_0x18ea59[_0x41b9('0x34')]])['name'];return db['UserProfileResource'][_0x41b9('0x2a')]({'where':{'type':_0x6de6c5,'resourceId':_0x18ea59['id']}})[_0x41b9('0x29')](function(){return _0x465280;});})['then'](function(){_0x2228d8[_0x41b9('0x1f')](0xcc)[_0x41b9('0x35')]();});}};}function handleEntityNotFound(_0x487477,_0x62770){return function(_0x4d9732){if(!_0x4d9732){_0x487477['sendStatus'](0x194);}return _0x4d9732;};}function handleError(_0x279cec,_0x56f738){_0x56f738=_0x56f738||0x1f4;return function(_0xaeeefd){logger[_0x41b9('0x36')](_0xaeeefd[_0x41b9('0x37')]);if(_0xaeeefd['name']){delete _0xaeeefd[_0x41b9('0x38')];}_0x279cec[_0x41b9('0x1f')](_0x56f738)[_0x41b9('0x39')](_0xaeeefd);};}exports[_0x41b9('0x3a')]=function(_0x699060,_0x2d7414){var _0x411e26={},_0x395c1e={},_0x341ebf={'count':0x0,'rows':[]};var _0x1434b8=_[_0x41b9('0x31')](db[_0x41b9('0x3b')]['rawAttributes'],function(_0x433b95){return{'name':_0x433b95[_0x41b9('0x3c')],'type':_0x433b95[_0x41b9('0x34')][_0x41b9('0x3d')]};});_0x395c1e['model']=_[_0x41b9('0x31')](_0x1434b8,'name');_0x395c1e['query']=_[_0x41b9('0x3e')](_0x699060['query']);_0x395c1e[_0x41b9('0x3f')]=_['intersection'](_0x395c1e[_0x41b9('0x40')],_0x395c1e[_0x41b9('0x41')]);_0x411e26[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x395c1e[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x699060['query']['fields']));_0x411e26[_0x41b9('0x42')]=_0x411e26[_0x41b9('0x42')]['length']?_0x411e26[_0x41b9('0x42')]:_0x395c1e[_0x41b9('0x40')];if(!_0x699060[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x411e26[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x699060[_0x41b9('0x41')][_0x41b9('0x22')]);_0x411e26[_0x41b9('0x20')]=qs['offset'](_0x699060['query'][_0x41b9('0x20')]);}_0x411e26[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x699060[_0x41b9('0x41')]['sort']);_0x411e26['where']=qs['filters'](_[_0x41b9('0x49')](_0x699060[_0x41b9('0x41')],_0x395c1e[_0x41b9('0x3f')]),_0x1434b8);if(_0x699060['query']['filter']){_0x411e26['where']=_[_0x41b9('0x4a')](_0x411e26[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x1434b8,function(_0x4a221c){if(_0x4a221c[_0x41b9('0x34')]!==_0x41b9('0x4c')){var _0x2b78c5={};_0x2b78c5[_0x4a221c['name']]={'$like':'%'+_0x699060['query'][_0x41b9('0x2f')]+'%'};return _0x2b78c5;}})});}_0x411e26=_[_0x41b9('0x4a')]({},_0x411e26,_0x699060[_0x41b9('0x4d')]);var _0x5560d0={'where':_0x411e26[_0x41b9('0x4b')]};return db[_0x41b9('0x3b')][_0x41b9('0x23')](_0x5560d0)['then'](function(_0x120b34){_0x341ebf[_0x41b9('0x23')]=_0x120b34;if(_0x699060[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x411e26['include']=[{'all':!![]}];}return db[_0x41b9('0x3b')]['findAll'](_0x411e26);})[_0x41b9('0x29')](function(_0x10f1dd){_0x341ebf['rows']=_0x10f1dd;return _0x341ebf;})[_0x41b9('0x29')](respondWithFilteredResult(_0x2d7414,_0x411e26))['catch'](handleError(_0x2d7414,null));};exports[_0x41b9('0x4f')]=function(_0x567c2d,_0x5427f7){var _0x411eeb={'raw':![],'where':{'id':_0x567c2d[_0x41b9('0x50')]['id']}},_0x557c94={};_0x557c94['model']=_[_0x41b9('0x3e')](db[_0x41b9('0x3b')][_0x41b9('0x51')]);_0x557c94[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x567c2d[_0x41b9('0x41')]);_0x557c94[_0x41b9('0x3f')]=_['intersection'](_0x557c94[_0x41b9('0x40')],_0x557c94[_0x41b9('0x41')]);_0x411eeb[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x557c94[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x567c2d[_0x41b9('0x41')][_0x41b9('0x44')]));_0x411eeb[_0x41b9('0x42')]=_0x411eeb['attributes']['length']?_0x411eeb['attributes']:_0x557c94[_0x41b9('0x40')];if(_0x567c2d[_0x41b9('0x41')]['includeAll']){_0x411eeb['include']=[{'all':!![]}];}_0x411eeb=_[_0x41b9('0x4a')]({},_0x411eeb,_0x567c2d[_0x41b9('0x4d')]);return db[_0x41b9('0x3b')][_0x41b9('0x52')](_0x411eeb)[_0x41b9('0x29')](handleEntityNotFound(_0x5427f7,null))[_0x41b9('0x29')](respondWithResult(_0x5427f7,null))[_0x41b9('0x53')](handleError(_0x5427f7,null));};exports['create']=function(_0x430073,_0x1361c2){return db[_0x41b9('0x3b')][_0x41b9('0x54')](_0x430073['body'],{})['then'](function(_0x16cfd8){var _0x38904e=_0x430073[_0x41b9('0x55')]['get']({'plain':!![]});if(!_0x38904e)throw new Error(_0x41b9('0x56'));if(_0x38904e[_0x41b9('0x57')]===_0x41b9('0x55')){var _0x2da43d=_0x16cfd8[_0x41b9('0x58')]({'plain':!![]});var _0x254e90=[{'name':'VoiceQueues','value':_0x41b9('0x2c')},{'name':_0x41b9('0x2d'),'value':_0x41b9('0x2e')}];var _0x1f0ee3=_[_0x41b9('0x52')](_0x254e90,[_0x41b9('0x33'),_0x2da43d['type']])['name'];return db[_0x41b9('0x59')]['find']({'where':{'name':_0x1f0ee3,'userProfileId':_0x38904e[_0x41b9('0x5a')]},'raw':!![]})[_0x41b9('0x29')](function(_0x49aedd){if(_0x49aedd&&_0x49aedd[_0x41b9('0x5b')]===0x0){return db[_0x41b9('0x5c')][_0x41b9('0x54')]({'name':_0x2da43d['name'],'resourceId':_0x2da43d['id'],'type':_0x49aedd['name'],'sectionId':_0x49aedd['id']},{})['then'](function(){return _0x16cfd8;});}else{return _0x16cfd8;}})[_0x41b9('0x53')](function(_0x578a4f){logger[_0x41b9('0x36')](_0x41b9('0x5d'),_0x578a4f);throw _0x578a4f;});}return _0x16cfd8;})['then'](respondWithResult(_0x1361c2,0xc9))['catch'](handleError(_0x1361c2,null));};exports[_0x41b9('0x5e')]=function(_0x20699b,_0x45a58e){var _0x5600da={'where':{'id':_0x20699b[_0x41b9('0x50')]['id']}},_0x704416={};_0x704416[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['VoiceQueue'][_0x41b9('0x51')]);_0x5600da[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x704416['model'],qs[_0x41b9('0x44')](_0x20699b[_0x41b9('0x41')][_0x41b9('0x44')]));_0x5600da[_0x41b9('0x42')]=_0x5600da[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x5600da[_0x41b9('0x42')]:_0x704416[_0x41b9('0x40')];if(_0x20699b[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x5600da['include']=[{'all':!![]}];}_0x5600da=_[_0x41b9('0x4a')]({},_0x5600da,_0x20699b['options']);return db[_0x41b9('0x3b')][_0x41b9('0x52')](_0x5600da)[_0x41b9('0x29')](handleEntityNotFound(_0x45a58e,null))[_0x41b9('0x29')](function(_0x3f0055){if(_0x3f0055){var _0x22922c=_0x3f0055[_0x41b9('0x58')]({'plain':!![]});_0x22922c=qs[_0x41b9('0x60')](_0x22922c,['id',_0x41b9('0x61'),_0x41b9('0x62')]);_0x20699b[_0x41b9('0x63')]=_[_0x41b9('0x60')](_0x20699b[_0x41b9('0x63')],['id','createdAt',_0x41b9('0x62')]);return db[_0x41b9('0x3b')][_0x41b9('0x54')](_[_0x41b9('0x4a')](_0x22922c,_0x20699b[_0x41b9('0x63')]),{'include':_0x20699b['query'][_0x41b9('0x4e')]?[{'all':!![]}]:undefined})[_0x41b9('0x29')](function(_0x583506){var _0x29b60b=_0x20699b[_0x41b9('0x55')][_0x41b9('0x58')]({'plain':!![]});if(!_0x29b60b)throw new Error(_0x41b9('0x56'));if(_0x29b60b[_0x41b9('0x57')]===_0x41b9('0x55')){var _0x28c18b=_0x583506['get']({'plain':!![]});var _0x1a7034=[{'name':_0x41b9('0x2b'),'value':_0x41b9('0x2c')},{'name':_0x41b9('0x2d'),'value':_0x41b9('0x2e')}];var _0x1273ad=_[_0x41b9('0x52')](_0x1a7034,['value',_0x28c18b[_0x41b9('0x34')]])['name'];return db[_0x41b9('0x59')][_0x41b9('0x52')]({'where':{'name':_0x1273ad,'userProfileId':_0x29b60b[_0x41b9('0x5a')]},'raw':!![]})[_0x41b9('0x29')](function(_0x51604c){if(_0x51604c&&_0x51604c[_0x41b9('0x5b')]===0x0){return db[_0x41b9('0x5c')]['create']({'name':_0x28c18b[_0x41b9('0x38')],'resourceId':_0x28c18b['id'],'type':_0x51604c[_0x41b9('0x38')],'sectionId':_0x51604c['id']},{})[_0x41b9('0x29')](function(){return _0x583506;});}else{return _0x583506;}})['catch'](function(_0x17a7dd){logger[_0x41b9('0x36')](_0x41b9('0x5d'),_0x17a7dd);throw _0x17a7dd;});}return _0x583506;});}})[_0x41b9('0x29')](respondWithResult(_0x45a58e,0xc9))[_0x41b9('0x53')](handleError(_0x45a58e,null));};exports[_0x41b9('0x28')]=function(_0xe5099e,_0x477ba6){if(_0xe5099e[_0x41b9('0x63')]['id']){delete _0xe5099e['body']['id'];}return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0xe5099e[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x477ba6,null))[_0x41b9('0x29')](saveUpdates(_0xe5099e[_0x41b9('0x63')],null))['then'](respondWithResult(_0x477ba6,null))['catch'](handleError(_0x477ba6,null));};exports[_0x41b9('0x2a')]=function(_0x21f807,_0x577d55){return db[_0x41b9('0x3b')]['find']({'where':{'id':_0x21f807[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x577d55,null))[_0x41b9('0x29')](removeEntity(_0x577d55,null))[_0x41b9('0x53')](handleError(_0x577d55,null));};exports[_0x41b9('0x64')]=function(_0x5c2ec4,_0x3c4506,_0x7cb52d){var _0xc9a5e={'raw':![],'where':{}};var _0x4e81aa={};var _0x8839c2={'count':0x0,'rows':[]};return db[_0x41b9('0x3b')][_0x41b9('0x65')]({'where':{'id':_0x5c2ec4[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x3c4506,null))[_0x41b9('0x29')](function(_0x542e2c){if(_0x542e2c){_0x4e81aa[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db[_0x41b9('0x66')][_0x41b9('0x51')]);_0x4e81aa[_0x41b9('0x41')]=_['keys'](_0x5c2ec4['query']);_0x4e81aa[_0x41b9('0x3f')]=_['intersection'](_0x4e81aa['model'],_0x4e81aa[_0x41b9('0x41')]);_0xc9a5e['attributes']=_[_0x41b9('0x43')](_0x4e81aa[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x44')]));_0xc9a5e[_0x41b9('0x42')]=_0xc9a5e[_0x41b9('0x42')][_0x41b9('0x5f')]?_0xc9a5e[_0x41b9('0x42')]:_0x4e81aa[_0x41b9('0x40')];if(!_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0xc9a5e[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x5c2ec4[_0x41b9('0x41')]['limit']);_0xc9a5e[_0x41b9('0x20')]=qs['offset'](_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x20')]);}_0xc9a5e[_0x41b9('0x47')]=qs['sort'](_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x48')]);_0xc9a5e[_0x41b9('0x4b')]=qs['filters'](_[_0x41b9('0x49')](_0x5c2ec4[_0x41b9('0x41')],_0x4e81aa[_0x41b9('0x3f')]));_0xc9a5e[_0x41b9('0x4b')][_0x41b9('0x67')]=_0x542e2c['id'];if(_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x2f')]){_0xc9a5e[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0xc9a5e['where'],{'$or':_['map'](_0xc9a5e[_0x41b9('0x42')],function(_0x5f1bc2){var _0x25d07d={};_0x25d07d[_0x5f1bc2]={'$like':'%'+_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x25d07d;})});}_0xc9a5e=_[_0x41b9('0x4a')]({},_0xc9a5e,_0x5c2ec4[_0x41b9('0x4d')]);return db[_0x41b9('0x66')]['count']({'where':_0xc9a5e[_0x41b9('0x4b')]})[_0x41b9('0x29')](function(_0x442045){_0x8839c2[_0x41b9('0x23')]=_0x442045;if(_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x4e')]){_0xc9a5e['include']=[{'all':!![]}];}return db[_0x41b9('0x66')][_0x41b9('0x68')](_0xc9a5e);})[_0x41b9('0x29')](function(_0xd553cf){_0x8839c2[_0x41b9('0x69')]=_0xd553cf;return _0x8839c2;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x3c4506,_0xc9a5e))['catch'](handleError(_0x3c4506,null));};exports['getHopperHistories']=function(_0x5a4d7f,_0x58e5df,_0x143dca){var _0x198bb2={'raw':!![],'where':{}};var _0x7cd7fe={};var _0x5183b5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x5a4d7f[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x58e5df,null))['then'](function(_0x55d3dd){if(_0x55d3dd){_0x7cd7fe[_0x41b9('0x40')]=_['keys'](db[_0x41b9('0x6a')]['rawAttributes']);_0x7cd7fe[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x5a4d7f[_0x41b9('0x41')]);_0x7cd7fe[_0x41b9('0x3f')]=_['intersection'](_0x7cd7fe['model'],_0x7cd7fe[_0x41b9('0x41')]);_0x198bb2[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x7cd7fe['model'],qs[_0x41b9('0x44')](_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x44')]));_0x198bb2[_0x41b9('0x42')]=_0x198bb2['attributes'][_0x41b9('0x5f')]?_0x198bb2[_0x41b9('0x42')]:_0x7cd7fe[_0x41b9('0x40')];if(!_0x5a4d7f[_0x41b9('0x41')]['hasOwnProperty'](_0x41b9('0x46'))){_0x198bb2['limit']=qs[_0x41b9('0x22')](_0x5a4d7f['query'][_0x41b9('0x22')]);_0x198bb2[_0x41b9('0x20')]=qs['offset'](_0x5a4d7f[_0x41b9('0x41')]['offset']);}_0x198bb2[_0x41b9('0x47')]=qs['sort'](_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x48')]);_0x198bb2[_0x41b9('0x4b')]=qs['filters'](_['pick'](_0x5a4d7f[_0x41b9('0x41')],_0x7cd7fe[_0x41b9('0x3f')]));_0x198bb2[_0x41b9('0x4b')]['VoiceQueueId']=_0x55d3dd['id'];if(_0x5a4d7f['query'][_0x41b9('0x2f')]){_0x198bb2[_0x41b9('0x4b')]=_['merge'](_0x198bb2[_0x41b9('0x4b')],{'$or':_['map'](_0x198bb2['attributes'],function(_0x379e5f){var _0xc2849c={};_0xc2849c[_0x379e5f]={'$like':'%'+_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0xc2849c;})});}_0x198bb2=_['merge']({},_0x198bb2,_0x5a4d7f[_0x41b9('0x4d')]);return db[_0x41b9('0x6a')]['count']({'where':_0x198bb2[_0x41b9('0x4b')]})['then'](function(_0x471dda){_0x5183b5[_0x41b9('0x23')]=_0x471dda;if(_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x198bb2[_0x41b9('0x6b')]=[{'all':!![]}];}return db[_0x41b9('0x6a')][_0x41b9('0x68')](_0x198bb2);})[_0x41b9('0x29')](function(_0x1a1829){_0x5183b5[_0x41b9('0x69')]=_0x1a1829;return _0x5183b5;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x58e5df,_0x198bb2))[_0x41b9('0x53')](handleError(_0x58e5df,null));};exports[_0x41b9('0x6c')]=function(_0x2e5845,_0x3cdfa2,_0x380366){var _0x188795={'raw':!![],'where':{}};var _0x36ab37={};var _0x3f474c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x2e5845['params']['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x3cdfa2,null))[_0x41b9('0x29')](function(_0x127042){if(_0x127042){_0x36ab37[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['CmHopperFinal'][_0x41b9('0x51')]);_0x36ab37['query']=_['keys'](_0x2e5845['query']);_0x36ab37[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x36ab37['model'],_0x36ab37['query']);_0x188795[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x36ab37['model'],qs['fields'](_0x2e5845[_0x41b9('0x41')][_0x41b9('0x44')]));_0x188795[_0x41b9('0x42')]=_0x188795[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x188795[_0x41b9('0x42')]:_0x36ab37[_0x41b9('0x40')];if(!_0x2e5845[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x188795[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x2e5845[_0x41b9('0x41')]['limit']);_0x188795[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x2e5845[_0x41b9('0x41')]['offset']);}_0x188795[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x2e5845[_0x41b9('0x41')][_0x41b9('0x48')]);_0x188795['where']=qs[_0x41b9('0x3f')](_[_0x41b9('0x49')](_0x2e5845[_0x41b9('0x41')],_0x36ab37[_0x41b9('0x3f')]));_0x188795[_0x41b9('0x4b')][_0x41b9('0x67')]=_0x127042['id'];if(_0x2e5845['query']['filter']){_0x188795[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x188795[_0x41b9('0x4b')],{'$or':_['map'](_0x188795['attributes'],function(_0x2ac50e){var _0x1ac165={};_0x1ac165[_0x2ac50e]={'$like':'%'+_0x2e5845[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x1ac165;})});}_0x188795=_[_0x41b9('0x4a')]({},_0x188795,_0x2e5845['options']);return db['CmHopperFinal'][_0x41b9('0x23')]({'where':_0x188795[_0x41b9('0x4b')]})[_0x41b9('0x29')](function(_0x570af3){_0x3f474c['count']=_0x570af3;if(_0x2e5845[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x188795[_0x41b9('0x6b')]=[{'all':!![]}];}return db[_0x41b9('0x6d')][_0x41b9('0x68')](_0x188795);})['then'](function(_0x4f3484){_0x3f474c[_0x41b9('0x69')]=_0x4f3484;return _0x3f474c;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x3cdfa2,_0x188795))['catch'](handleError(_0x3cdfa2,null));};exports[_0x41b9('0x6e')]=function(_0x58e6a5,_0x5b8ddf,_0x52b18e){var _0xbd7508={'raw':!![],'where':{}};var _0x32975f={};var _0x283689={'count':0x0,'rows':[]};return db[_0x41b9('0x3b')]['findOne']({'where':{'id':_0x58e6a5[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x5b8ddf,null))[_0x41b9('0x29')](function(_0x1e2762){if(_0x1e2762){_0x32975f['model']=_[_0x41b9('0x3e')](db[_0x41b9('0x6f')][_0x41b9('0x51')]);_0x32975f[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x58e6a5[_0x41b9('0x41')]);_0x32975f[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x32975f['model'],_0x32975f[_0x41b9('0x41')]);_0xbd7508[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x32975f[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x58e6a5[_0x41b9('0x41')]['fields']));_0xbd7508[_0x41b9('0x42')]=_0xbd7508[_0x41b9('0x42')][_0x41b9('0x5f')]?_0xbd7508['attributes']:_0x32975f[_0x41b9('0x40')];if(!_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0xbd7508['limit']=qs['limit'](_0x58e6a5[_0x41b9('0x41')]['limit']);_0xbd7508[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x58e6a5[_0x41b9('0x41')]['offset']);}_0xbd7508[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x58e6a5[_0x41b9('0x41')]['sort']);_0xbd7508[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_['pick'](_0x58e6a5[_0x41b9('0x41')],_0x32975f[_0x41b9('0x3f')]));_0xbd7508[_0x41b9('0x4b')][_0x41b9('0x67')]=_0x1e2762['id'];if(_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x2f')]){_0xbd7508[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0xbd7508['where'],{'$or':_['map'](_0xbd7508[_0x41b9('0x42')],function(_0xdbfb22){var _0xbaceda={};_0xbaceda[_0xdbfb22]={'$like':'%'+_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0xbaceda;})});}_0xbd7508=_[_0x41b9('0x4a')]({},_0xbd7508,_0x58e6a5[_0x41b9('0x4d')]);return db[_0x41b9('0x6f')]['count']({'where':_0xbd7508[_0x41b9('0x4b')]})[_0x41b9('0x29')](function(_0x8553dc){_0x283689[_0x41b9('0x23')]=_0x8553dc;if(_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x4e')]){_0xbd7508[_0x41b9('0x6b')]=[{'all':!![]}];}return db[_0x41b9('0x6f')][_0x41b9('0x68')](_0xbd7508);})['then'](function(_0x1ae84c){_0x283689['rows']=_0x1ae84c;return _0x283689;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x5b8ddf,_0xbd7508))[_0x41b9('0x53')](handleError(_0x5b8ddf,null));};exports[_0x41b9('0x70')]=function(_0x7bc7eb,_0x278a0a,_0x2105c1){var _0x4a93c7={};var _0x5a3f8c={};var _0x4d3948;var _0x23786e;return db[_0x41b9('0x3b')]['findOne']({'where':{'id':_0x7bc7eb[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x278a0a,null))[_0x41b9('0x29')](function(_0x491b33){if(_0x491b33){_0x4d3948=_0x491b33;_0x5a3f8c['model']=_[_0x41b9('0x3e')](db[_0x41b9('0x71')]['rawAttributes']);_0x5a3f8c[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x7bc7eb[_0x41b9('0x41')]);_0x5a3f8c[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x5a3f8c[_0x41b9('0x40')],_0x5a3f8c['query']);_0x4a93c7[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x5a3f8c['model'],qs['fields'](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x44')]));_0x4a93c7['attributes']=_0x4a93c7[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x4a93c7['attributes']:_0x5a3f8c['model'];_0x4a93c7[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x48')]);_0x4a93c7[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_[_0x41b9('0x49')](_0x7bc7eb[_0x41b9('0x41')],_0x5a3f8c[_0x41b9('0x3f')]));if(_0x7bc7eb['query'][_0x41b9('0x2f')]){_0x4a93c7[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x4a93c7[_0x41b9('0x4b')],{'$or':_['map'](_0x4a93c7['attributes'],function(_0x3c2391){var _0x3242d0={};_0x3242d0[_0x3c2391]={'$like':'%'+_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x3242d0;})});}_0x4a93c7=_[_0x41b9('0x4a')]({},_0x4a93c7,_0x7bc7eb[_0x41b9('0x4d')]);return _0x4d3948[_0x41b9('0x70')](_0x4a93c7);}})[_0x41b9('0x29')](function(_0x2c9bd2){if(_0x2c9bd2){_0x23786e=_0x2c9bd2[_0x41b9('0x5f')];if(!_0x7bc7eb[_0x41b9('0x41')]['hasOwnProperty'](_0x41b9('0x46'))){_0x4a93c7[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x22')]);_0x4a93c7['offset']=qs[_0x41b9('0x20')](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x4d3948[_0x41b9('0x70')](_0x4a93c7);}})[_0x41b9('0x29')](function(_0x2bd18f){if(_0x2bd18f){return _0x2bd18f?{'count':_0x23786e,'rows':_0x2bd18f}:null;}})[_0x41b9('0x29')](respondWithResult(_0x278a0a,null))['catch'](handleError(_0x278a0a,null));};exports[_0x41b9('0x72')]=function(_0x2888fd,_0x55bc82,_0x48c58c){var _0x5ef377=_0x2888fd[_0x41b9('0x63')][_0x41b9('0x73')];var _0x1f2393=_[_0x41b9('0x31')](_0x5ef377,'id');return db['Team'][_0x41b9('0x68')]({'where':{'id':_0x1f2393},'attributes':['id'],'include':[{'model':db['User'],'as':_0x41b9('0x74'),'attributes':['id',_0x41b9('0x38'),_0x41b9('0x75'),_0x41b9('0x76'),_0x41b9('0x77')],'raw':!![]}]})[_0x41b9('0x29')](function(_0x15755c){if(_0x15755c){var _0x21d4fe=_[_0x41b9('0x78')](_0x15755c,function(_0x2468d8){var _0x37e12c=_0x2468d8[_0x41b9('0x58')]({'plain':!![]});_0x37e12c['Agents'][_0x41b9('0x79')](function(_0x51b53e){_0x51b53e[_0x41b9('0x7a')]=_[_0x41b9('0x52')](_0x5ef377,{'id':_0x37e12c['id']})['penalty'];});return _0x37e12c[_0x41b9('0x74')];});return db['VoiceQueue']['find']({'where':{'id':_0x2888fd['params']['id']}})[_0x41b9('0x29')](function(_0x4df1aa){return db['sequelize'][_0x41b9('0x7b')](function(_0x116145){return _0x4df1aa['addTeams'](_0x1f2393,{'transaction':_0x116145})[_0x41b9('0x29')](function(){return BPromise[_0x41b9('0x7c')](_0x5ef377,function(_0x53df18){return db[_0x41b9('0x7d')][_0x41b9('0x7e')]({'TeamId':_0x53df18['id'],'VoiceQueueId':_0x2888fd['params']['id'],'penalty':_0x53df18[_0x41b9('0x7a')]},{'transaction':_0x116145});});})[_0x41b9('0x29')](function(){return BPromise[_0x41b9('0x7c')](_0x21d4fe,function(_0x18d59a){return db[_0x41b9('0x7f')][_0x41b9('0x80')]({'where':{'UserId':_0x18d59a['id'],'VoiceQueueId':_0x2888fd[_0x41b9('0x50')]['id']},'defaults':{'penalty':_0x18d59a[_0x41b9('0x7a')]},'transaction':_0x116145});});})[_0x41b9('0x29')](function(){return BPromise[_0x41b9('0x7c')](_['filter'](_0x21d4fe,{'online':!![]}),function(_0x536da4){return db['UserVoiceQueueRt'][_0x41b9('0x7e')]({'membername':_0x536da4[_0x41b9('0x38')],'UserId':_0x536da4['id'],'queue_name':_0x4df1aa['name'],'VoiceQueueId':_0x4df1aa['id'],'interface':_[_0x41b9('0x81')](_0x536da4[_0x41b9('0x77')])?util[_0x41b9('0x82')]('SIP/%s',_0x536da4[_0x41b9('0x38')]):_0x536da4['interface'],'paused':_0x536da4[_0x41b9('0x76')]||![],'penalty':_0x536da4[_0x41b9('0x7a')]},{'transaction':_0x116145});});})[_0x41b9('0x29')](function(){_0x21d4fe[_0x41b9('0x79')](function(_0x53f967){socket[_0x41b9('0x83')](_0x41b9('0x84'),{'UserId':_0x53f967['id'],'VoiceQueueId':_0x4df1aa['id']});});});});});}})[_0x41b9('0x29')](respondWithStatusCode(_0x55bc82,null))[_0x41b9('0x53')](handleError(_0x55bc82,null));};exports['removeTeams']=function(_0x60bfe3,_0x49fbe4,_0x16824d){return db[_0x41b9('0x71')][_0x41b9('0x68')]({'where':{'id':_0x60bfe3[_0x41b9('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x41b9('0x85')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x41b9('0x29')](handleEntityNotFound(_0x49fbe4,null))[_0x41b9('0x29')](function(_0x309795){var _0x39499f=_[_0x41b9('0x31')](_0x309795,'id');var _0x1e1da5=[];var _0x5c9bd6=[];var _0x4d1e41=squel['select']();_0x4d1e41['field'](_0x41b9('0x86'))[_0x41b9('0x87')]('team_has_voice_queues','tq')[_0x41b9('0x88')](_0x41b9('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x41b9('0x8a'),_0x60bfe3['params']['id']);for(var _0xbad31d=0x0;_0xbad31d<_0x309795['length'];_0xbad31d+=0x1){let _0x172804=_0x309795[_0xbad31d];for(var _0x28c085=0x0;_0x28c085<_0x172804[_0x41b9('0x74')][_0x41b9('0x5f')];_0x28c085+=0x1){let _0x200c8e=_0x172804['Agents'][_0x28c085];var _0x1bd53c=_0x4d1e41[_0x41b9('0x5e')]();_0x1bd53c['where'](_0x41b9('0x8b'),_0x200c8e['id']);_0x5c9bd6[_0x41b9('0x8c')](db[_0x41b9('0x8d')][_0x41b9('0x41')](_0x1bd53c[_0x41b9('0x8e')](),{'type':db[_0x41b9('0x8d')][_0x41b9('0x8f')]['SELECT']})[_0x41b9('0x29')](function(_0xf64bbe){if(_0xf64bbe['length']===0x1){return _0x200c8e['id'];}else{var _0xe213bc=_[_0x41b9('0x90')](_[_0x41b9('0x31')](_0xf64bbe,_0x41b9('0x91')),function(_0x5d654b){return _[_0x41b9('0x32')](_0x39499f,_0x5d654b);});if(_0xe213bc){return _0x200c8e['id'];}}}));}}return BPromise[_0x41b9('0x92')](_0x5c9bd6)[_0x41b9('0x29')](function(_0x313e4d){_0x1e1da5=_(_0x1e1da5)[_0x41b9('0x93')](_0x313e4d)[_0x41b9('0x94')]()[_0x41b9('0x33')]();return db[_0x41b9('0x3b')]['find']({'where':{'id':_0x60bfe3[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](function(_0x3d7018){return db[_0x41b9('0x8d')][_0x41b9('0x7b')](function(_0xf1e43){return _0x3d7018['removeTeams'](_0x60bfe3[_0x41b9('0x41')][_0x41b9('0x95')],{'transaction':_0xf1e43})[_0x41b9('0x29')](function(){if(!_[_0x41b9('0x96')](_0x1e1da5)){return _0x3d7018[_0x41b9('0x97')](_0x1e1da5,{'transaction':_0xf1e43})[_0x41b9('0x29')](function(){return db[_0x41b9('0x98')][_0x41b9('0x2a')]({'where':{'VoiceQueueId':_0x60bfe3[_0x41b9('0x50')]['id'],'UserId':_0x1e1da5},'transaction':_0xf1e43});});}})[_0x41b9('0x29')](function(){_0x1e1da5[_0x41b9('0x79')](function(_0x2df6ea){socket[_0x41b9('0x83')](_0x41b9('0x99'),{'UserId':_0x2df6ea,'VoiceQueueId':_0x3d7018['id']});});});});});});})[_0x41b9('0x29')](respondWithStatusCode(_0x49fbe4,null))['catch'](handleError(_0x49fbe4,null));};exports[_0x41b9('0x9a')]=function(_0x383fde,_0x1674cc,_0x30380e){var _0xb79a4b,_0x39046d;return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x383fde[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x1674cc,null))[_0x41b9('0x29')](function(_0x2d1a91){if(_0x2d1a91){_0x39046d=_0x2d1a91;return _0x2d1a91[_0x41b9('0x9a')](_0x383fde[_0x41b9('0x63')][_0x41b9('0x95')],_['omit'](_0x383fde['body'],[_0x41b9('0x95'),'id'])||{})[_0x41b9('0x9b')](function(_0x18cf01){for(var _0xdc51f7=0x0;_0xdc51f7<_0x383fde[_0x41b9('0x63')][_0x41b9('0x95')][_0x41b9('0x5f')];_0xdc51f7+=0x1){socket['emit'](_0x41b9('0x84'),{'UserId':Number(_0x383fde[_0x41b9('0x63')]['ids'][_0xdc51f7]),'VoiceQueueId':Number(_0x383fde[_0x41b9('0x50')]['id'])});}return _0x18cf01;});}})[_0x41b9('0x29')](function(_0xd1174b){_0xb79a4b=_0xd1174b||[];if(_0x39046d){return db[_0x41b9('0x85')]['findAll']({'where':{'id':_0x383fde[_0x41b9('0x63')][_0x41b9('0x95')]},'attributes':['id',_0x41b9('0x38'),_0x41b9('0x75'),_0x41b9('0x76'),_0x41b9('0x77')],'raw':!![]});}})[_0x41b9('0x29')](function(_0xa9df0c){if(!_[_0x41b9('0x96')](_0xa9df0c)){var _0x28fdbe=[];for(var _0x117a4d=0x0;_0x117a4d<_0xa9df0c[_0x41b9('0x5f')];_0x117a4d++){if(_0xa9df0c[_0x117a4d][_0x41b9('0x75')]){_0x28fdbe[_0x41b9('0x8c')](db[_0x41b9('0x98')][_0x41b9('0x7e')]({'membername':_0xa9df0c[_0x117a4d][_0x41b9('0x38')],'UserId':_0xa9df0c[_0x117a4d]['id'],'queue_name':_0x39046d[_0x41b9('0x38')],'VoiceQueueId':_0x39046d['id'],'interface':_[_0x41b9('0x81')](_0xa9df0c[_0x117a4d][_0x41b9('0x77')])?util[_0x41b9('0x82')](_0x41b9('0x9c'),_0xa9df0c[_0x117a4d]['name']):_0xa9df0c[_0x117a4d][_0x41b9('0x77')],'paused':_0xa9df0c[_0x117a4d]['voicePause']||![],'penalty':_0x383fde[_0x41b9('0x63')][_0x41b9('0x7a')]||0x0}));}}return BPromise[_0x41b9('0x92')](_0x28fdbe);}})[_0x41b9('0x29')](function(){return _0xb79a4b;})[_0x41b9('0x29')](respondWithResult(_0x1674cc,null))[_0x41b9('0x53')](handleError(_0x1674cc,null));};exports[_0x41b9('0x97')]=function(_0x47f681,_0x13fe30,_0x26aac5){return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x47f681[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x13fe30,null))['then'](function(_0x339023){if(_0x339023){return _0x339023['removeAgents'](_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')])[_0x41b9('0x29')](function(){if(_[_0x41b9('0x9d')](_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')])){for(var _0x1d38dc=0x0;_0x1d38dc<_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')][_0x41b9('0x5f')];_0x1d38dc+=0x1){socket[_0x41b9('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x47f681[_0x41b9('0x41')]['ids'][_0x1d38dc]),'VoiceQueueId':Number(_0x47f681['params']['id'])});}}else{socket[_0x41b9('0x83')](_0x41b9('0x99'),{'UserId':Number(_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')]),'VoiceQueueId':Number(_0x47f681[_0x41b9('0x50')]['id'])});}});}})[_0x41b9('0x29')](function(_0x476b9f){return db[_0x41b9('0x98')]['destroy']({'where':{'VoiceQueueId':_0x47f681[_0x41b9('0x50')]['id'],'UserId':_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')]}})['then'](function(){return _0x476b9f;});})[_0x41b9('0x29')](respondWithStatusCode(_0x13fe30,null))[_0x41b9('0x53')](handleError(_0x13fe30,null));};exports[_0x41b9('0x9e')]=function(_0x41d217,_0x18e17a,_0x3a8a7b){var _0x1a1d16={};var _0x2248a4={};var _0x4d95af;var _0x1b4310;return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x41d217[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x18e17a,null))['then'](function(_0x40cea9){if(_0x40cea9){_0x4d95af=_0x40cea9;_0x2248a4[_0x41b9('0x40')]=_['keys'](db[_0x41b9('0x85')]['rawAttributes']);_0x2248a4[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x41d217['query']);_0x2248a4[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x2248a4[_0x41b9('0x40')],_0x2248a4[_0x41b9('0x41')]);_0x1a1d16[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x2248a4[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x41d217[_0x41b9('0x41')][_0x41b9('0x44')]));_0x1a1d16[_0x41b9('0x42')]=_0x1a1d16[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x1a1d16['attributes']:_0x2248a4[_0x41b9('0x40')];_0x1a1d16[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x41d217[_0x41b9('0x41')]['sort']);_0x1a1d16[_0x41b9('0x4b')]=qs['filters'](_[_0x41b9('0x49')](_0x41d217['query'],_0x2248a4[_0x41b9('0x3f')]));if(_0x41d217[_0x41b9('0x41')][_0x41b9('0x2f')]){_0x1a1d16[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x1a1d16[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x1a1d16['attributes'],function(_0x4c1eb9){var _0x593639={};_0x593639[_0x4c1eb9]={'$like':'%'+_0x41d217['query'][_0x41b9('0x2f')]+'%'};return _0x593639;})});}_0x1a1d16=_['merge']({},_0x1a1d16,_0x41d217['options']);return _0x4d95af[_0x41b9('0x9e')](_0x1a1d16);}})[_0x41b9('0x29')](function(_0x3c72c5){if(_0x3c72c5){_0x1b4310=_0x3c72c5[_0x41b9('0x5f')];if(!_0x41d217[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x1a1d16['limit']=qs['limit'](_0x41d217[_0x41b9('0x41')][_0x41b9('0x22')]);_0x1a1d16[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x41d217[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x4d95af[_0x41b9('0x9e')](_0x1a1d16);}})[_0x41b9('0x29')](function(_0x2e9936){if(_0x2e9936){return _0x2e9936?{'count':_0x1b4310,'rows':_0x2e9936}:null;}})['then'](respondWithResult(_0x18e17a,null))[_0x41b9('0x53')](handleError(_0x18e17a,null));};exports[_0x41b9('0x9f')]=function(_0x541656,_0x3899ae,_0x3a1f70){var _0x59b546={};var _0x25dc5a={};var _0x1ffb0d;var _0x57f799;return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x541656[_0x41b9('0x50')]['id']}})['then'](handleEntityNotFound(_0x3899ae,null))[_0x41b9('0x29')](function(_0x372234){if(_0x372234){_0x1ffb0d=_0x372234;_0x25dc5a[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['UserVoiceQueueRt'][_0x41b9('0x51')]);_0x25dc5a[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x541656[_0x41b9('0x41')]);_0x25dc5a['filters']=_['intersection'](_0x25dc5a[_0x41b9('0x40')],_0x25dc5a[_0x41b9('0x41')]);_0x59b546[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x25dc5a[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x541656[_0x41b9('0x41')][_0x41b9('0x44')]));_0x59b546['attributes']=_0x59b546[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x59b546[_0x41b9('0x42')]:_0x25dc5a[_0x41b9('0x40')];_0x59b546[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x541656[_0x41b9('0x41')][_0x41b9('0x48')]);_0x59b546[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_['pick'](_0x541656[_0x41b9('0x41')],_0x25dc5a[_0x41b9('0x3f')]));if(_0x541656[_0x41b9('0x41')][_0x41b9('0x2f')]){_0x59b546[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x59b546[_0x41b9('0x4b')],{'$or':_['map'](_0x59b546[_0x41b9('0x42')],function(_0x442e59){var _0x1643c3={};_0x1643c3[_0x442e59]={'$like':'%'+_0x541656[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x1643c3;})});}_0x59b546=_['merge']({},_0x59b546,_0x541656[_0x41b9('0x4d')]);return _0x1ffb0d['getMembers'](_0x59b546);}})[_0x41b9('0x29')](function(_0x14bd97){if(_0x14bd97){_0x57f799=_0x14bd97[_0x41b9('0x5f')];if(!_0x541656['query'][_0x41b9('0x45')](_0x41b9('0x46'))){_0x59b546[_0x41b9('0x22')]=qs['limit'](_0x541656[_0x41b9('0x41')][_0x41b9('0x22')]);_0x59b546['offset']=qs[_0x41b9('0x20')](_0x541656['query'][_0x41b9('0x20')]);}return _0x1ffb0d[_0x41b9('0x9f')](_0x59b546);}})['then'](function(_0x7b4eaa){return _0x7b4eaa?{'count':_0x57f799,'rows':_0x7b4eaa}:null;})[_0x41b9('0x29')](respondWithResult(_0x3899ae,null))['catch'](handleError(_0x3899ae,null));};exports[_0x41b9('0xa0')]=function(_0x5d362f,_0x29748e,_0xa6ca29){var _0x2829c4={};var _0x44d126={};var _0x349b19;var _0x356c66;return db[_0x41b9('0x3b')][_0x41b9('0x65')]({'where':{'id':_0x5d362f[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x29748e,null))[_0x41b9('0x29')](function(_0x11064f){if(_0x11064f){_0x349b19=_0x11064f;_0x44d126[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db[_0x41b9('0xa1')]['rawAttributes']);_0x44d126['query']=_[_0x41b9('0x3e')](_0x5d362f[_0x41b9('0x41')]);_0x44d126[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x44d126['model'],_0x44d126[_0x41b9('0x41')]);_0x2829c4[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x44d126[_0x41b9('0x40')],qs['fields'](_0x5d362f['query']['fields']));_0x2829c4[_0x41b9('0x42')]=_0x2829c4[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x2829c4[_0x41b9('0x42')]:_0x44d126[_0x41b9('0x40')];_0x2829c4['order']=qs[_0x41b9('0x48')](_0x5d362f[_0x41b9('0x41')][_0x41b9('0x48')]);_0x2829c4['where']=qs['filters'](_[_0x41b9('0x49')](_0x5d362f[_0x41b9('0x41')],_0x44d126[_0x41b9('0x3f')]));if(_0x5d362f['query'][_0x41b9('0x2f')]){_0x2829c4['where']=_[_0x41b9('0x4a')](_0x2829c4[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x2829c4['attributes'],function(_0x30e635){var _0x291bed={};_0x291bed[_0x30e635]={'$like':'%'+_0x5d362f[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x291bed;})});}_0x2829c4=_[_0x41b9('0x4a')]({},_0x2829c4,_0x5d362f['options']);return _0x349b19[_0x41b9('0xa0')](_0x2829c4);}})[_0x41b9('0x29')](function(_0x30c1ae){if(_0x30c1ae){_0x356c66=_0x30c1ae[_0x41b9('0x5f')];if(!_0x5d362f[_0x41b9('0x41')]['hasOwnProperty'](_0x41b9('0x46'))){_0x2829c4[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x5d362f[_0x41b9('0x41')][_0x41b9('0x22')]);_0x2829c4['offset']=qs[_0x41b9('0x20')](_0x5d362f[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x349b19[_0x41b9('0xa0')](_0x2829c4);}})[_0x41b9('0x29')](function(_0x2f3df4){if(_0x2f3df4){return _0x2f3df4?{'count':_0x356c66,'rows':_0x2f3df4}:null;}})[_0x41b9('0x29')](respondWithResult(_0x29748e,null))[_0x41b9('0x53')](handleError(_0x29748e,null));};exports[_0x41b9('0xa2')]=function(_0x250abe,_0x3e165d,_0x33934f){var _0x28281e=moment()[_0x41b9('0x82')]('YYYY-MM-DD\x20HH:mm:ss');var _0x266df7,_0xb145ca;return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x250abe['params']['id']}})['then'](handleEntityNotFound(_0x3e165d,null))[_0x41b9('0x29')](function(_0x2aec29){if(_0x2aec29){_0xb145ca=_0x2aec29;return _0x2aec29[_0x41b9('0xa2')](_0x250abe[_0x41b9('0x63')][_0x41b9('0x95')],_[_0x41b9('0x60')](_0x250abe[_0x41b9('0x63')],[_0x41b9('0x95'),'id'])||{});}return null;})[_0x41b9('0x9b')](function(_0x5de044){var _0x80bc6c;_0x266df7=_0x5de044||[];var _0x1fc1bd=[];if(_0x5de044){for(var _0x5c9a05=0x0;_0x5c9a05<_0x5de044['length'];_0x5c9a05+=0x1){var _0x3f04ce=_0x5de044[_0x5c9a05][_0x41b9('0x58')]({'plain':!![]});_0xb145ca['dialCheckDuplicateType']=_0x250abe[_0x41b9('0x63')][_0x41b9('0xa3')]?_0x250abe[_0x41b9('0x63')]['dialCheckDuplicateType']:_0xb145ca[_0x41b9('0xa3')];switch(_0xb145ca['dialCheckDuplicateType']){case _0x41b9('0xa4'):_0x80bc6c=squel['insert']()[_0x41b9('0xa5')](_0x41b9('0xa6'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xa9'),_0x41b9('0xaa'),'ListId','VoiceQueueId',_0x41b9('0x61'),_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')]('phone',_0x41b9('0xa8'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0xa9'))[_0x41b9('0xac')]('id','ContactId')[_0x41b9('0xac')](_0x3f04ce[_0x41b9('0xad')]['toString'](),_0x41b9('0xae'))[_0x41b9('0xac')](_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27','createdAt')['field']('\x27'+_0x28281e+'\x27',_0x41b9('0x62'))[_0x41b9('0x87')]('cm_contacts')[_0x41b9('0x4b')]('deletedAt\x20IS\x20NULL')[_0x41b9('0x4b')](_0x41b9('0xaf'),_0x3f04ce['CmListId'][_0x41b9('0x8e')]())[_0x41b9('0x4b')](_0x41b9('0xb0'))[_0x41b9('0x4b')](_0x41b9('0xb1'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0x41b9('0x87')]('cm_hopper_final')[_0x41b9('0x4b')](_0x41b9('0x8a'),_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')]()))['where'](_0x41b9('0xb1'),squel[_0x41b9('0xab')]()[_0x41b9('0xac')]('COALESCE(phone,\x27\x27)')[_0x41b9('0x87')](_0x41b9('0xa6'))[_0x41b9('0x4b')](_0x41b9('0x8a'),_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')]())))[_0x41b9('0x8e')]();break;case _0x41b9('0xb2'):_0x80bc6c=squel[_0x41b9('0xb3')]()['into'](_0x41b9('0xa6'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xa9'),_0x41b9('0xaa'),_0x41b9('0xae'),'VoiceQueueId',_0x41b9('0x61'),_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')]('phone',_0x41b9('0xa8'))['field']('\x27'+_0x28281e+'\x27',_0x41b9('0xa9'))[_0x41b9('0xac')]('id',_0x41b9('0xaa'))[_0x41b9('0xac')](_0x3f04ce[_0x41b9('0xad')][_0x41b9('0x8e')](),'ListId')[_0x41b9('0xac')](_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0x61'))['field']('\x27'+_0x28281e+'\x27','updatedAt')[_0x41b9('0x87')](_0x41b9('0xb4'))[_0x41b9('0x4b')](_0x41b9('0xb5'))[_0x41b9('0x4b')]('ListId\x20=\x20?',_0x3f04ce[_0x41b9('0xad')]['toString']())[_0x41b9('0x4b')](_0x41b9('0xb0'))[_0x41b9('0x4b')](_0x41b9('0xb1'),squel['select']()[_0x41b9('0xac')](_0x41b9('0xb6'))[_0x41b9('0x87')]('cm_hopper')[_0x41b9('0x4b')](_0x41b9('0x8a'),_0x250abe['params']['id']['toString']())))[_0x41b9('0x8e')]();break;default:_0x80bc6c=squel[_0x41b9('0xb3')]()['into'](_0x41b9('0xa6'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xa9'),_0x41b9('0xaa'),_0x41b9('0xae'),_0x41b9('0x67'),'createdAt',_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')](_0x41b9('0xa8'),_0x41b9('0xa8'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0xa9'))[_0x41b9('0xac')]('id','ContactId')['field'](_0x3f04ce[_0x41b9('0xad')][_0x41b9('0x8e')](),_0x41b9('0xae'))['field'](_0x250abe['params']['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27','createdAt')[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27','updatedAt')[_0x41b9('0x87')](_0x41b9('0xb4'))['where']('deletedAt\x20IS\x20NULL')[_0x41b9('0x4b')](_0x41b9('0xaf'),_0x3f04ce[_0x41b9('0xad')][_0x41b9('0x8e')]())['where'](_0x41b9('0xb0')))[_0x41b9('0x8e')]();}_0x1fc1bd[_0x41b9('0x8c')](db['sequelize']['query'](_0x80bc6c));}return BPromise['all'](_0x1fc1bd);}})['then'](function(){var _0x99684f=[];var _0xd0795a=squel[_0x41b9('0xb3')]()['into']('cm_hopper_additional_phones')[_0x41b9('0xa7')]([_0x41b9('0xb7'),_0x41b9('0xa8'),_0x41b9('0xb8'),'createdAt',_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')](_0x41b9('0xb9'))[_0x41b9('0xac')]('ci.item')[_0x41b9('0xac')](_0x41b9('0xba'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0x61'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0x62'))[_0x41b9('0x87')]('cm_contact_has_items','ci')[_0x41b9('0x88')]('cm_hopper','h',_0x41b9('0xbb'))['where']('h.scheduledat=?',_0x28281e)[_0x41b9('0x4b')]('ci.ItemClass=?','PHONE'))[_0x41b9('0x8e')]();_0x99684f['push'](db[_0x41b9('0x8d')][_0x41b9('0x41')](_0xd0795a));return BPromise[_0x41b9('0x92')](_0x99684f);})[_0x41b9('0x29')](function(){return _0x266df7;})[_0x41b9('0x29')](respondWithResult(_0x3e165d,null))[_0x41b9('0x53')](handleError(_0x3e165d,null));};exports['removeLists']=function(_0x7e6f37,_0x507096,_0x95157e){return db['VoiceQueue'][_0x41b9('0x52')]({'where':{'id':_0x7e6f37[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x507096,null))[_0x41b9('0x29')](function(_0xf25ea){if(_0xf25ea){return _0xf25ea['removeLists'](_0x7e6f37[_0x41b9('0x41')][_0x41b9('0x95')]);}})[_0x41b9('0x29')](function(_0x127993){if(_0x127993){return db[_0x41b9('0x66')][_0x41b9('0x2a')]({'where':{'ListId':_0x7e6f37[_0x41b9('0x41')]['ids'],'VoiceQueueId':_0x7e6f37['params']['id']}})[_0x41b9('0x29')](function(){return _0x127993;});}})[_0x41b9('0x29')](respondWithStatusCode(_0x507096,null))['catch'](handleError(_0x507096,null));};exports[_0x41b9('0xbc')]=function(_0x4fe4b1,_0x18f131,_0x2edad4){var _0x310186={};var _0x3722b7={};var _0x2a24df;var _0x1dde4b;return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x4fe4b1[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x18f131,null))[_0x41b9('0x29')](function(_0x586c94){if(_0x586c94){_0x2a24df=_0x586c94;_0x3722b7[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['CmList'][_0x41b9('0x51')]);_0x3722b7[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x4fe4b1[_0x41b9('0x41')]);_0x3722b7[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x3722b7[_0x41b9('0x40')],_0x3722b7[_0x41b9('0x41')]);_0x310186[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x3722b7['model'],qs[_0x41b9('0x44')](_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x44')]));_0x310186['attributes']=_0x310186[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x310186['attributes']:_0x3722b7[_0x41b9('0x40')];_0x310186[_0x41b9('0x47')]=qs['sort'](_0x4fe4b1['query'][_0x41b9('0x48')]);_0x310186[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_[_0x41b9('0x49')](_0x4fe4b1[_0x41b9('0x41')],_0x3722b7[_0x41b9('0x3f')]));if(_0x4fe4b1['query']['filter']){_0x310186['where']=_[_0x41b9('0x4a')](_0x310186[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x310186[_0x41b9('0x42')],function(_0x24298c){var _0x4e9a3b={};_0x4e9a3b[_0x24298c]={'$like':'%'+_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x4e9a3b;})});}_0x310186=_[_0x41b9('0x4a')]({},_0x310186,_0x4fe4b1[_0x41b9('0x4d')]);return _0x2a24df['getBlackLists'](_0x310186);}})[_0x41b9('0x29')](function(_0x2da450){if(_0x2da450){_0x1dde4b=_0x2da450[_0x41b9('0x5f')];if(!_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x310186[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x22')]);_0x310186[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x2a24df['getBlackLists'](_0x310186);}})[_0x41b9('0x29')](function(_0x37485a){if(_0x37485a){return _0x37485a?{'count':_0x1dde4b,'rows':_0x37485a}:null;}})[_0x41b9('0x29')](respondWithResult(_0x18f131,null))['catch'](handleError(_0x18f131,null));};exports[_0x41b9('0xbd')]=function(_0x3f71ea,_0x268d8b,_0x1fcd1f){var _0x104fe6,_0x378a8f;return db['VoiceQueue'][_0x41b9('0x52')]({'where':{'id':_0x3f71ea['params']['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x268d8b,null))[_0x41b9('0x29')](function(_0x57c802){if(_0x57c802){_0x378a8f=_0x57c802;return _0x57c802[_0x41b9('0xbd')](_0x3f71ea[_0x41b9('0x63')][_0x41b9('0x95')],_[_0x41b9('0x60')](_0x3f71ea[_0x41b9('0x63')],[_0x41b9('0x95'),'id'])||{});}return null;})[_0x41b9('0x9b')](function(_0x5e6d24){var _0x471650;_0x104fe6=_0x5e6d24||[];var _0x3dcb39=[];if(_0x5e6d24){for(var _0x48fd30=0x0;_0x48fd30<_0x5e6d24['length'];_0x48fd30+=0x1){var _0x4961c4=_0x5e6d24[_0x48fd30][_0x41b9('0x58')]({'plain':!![]});_0x471650=squel['insert']()[_0x41b9('0xa5')](_0x41b9('0xbe'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xaa'),_0x41b9('0xae'),_0x41b9('0x67'),_0x41b9('0x61'),_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')](_0x41b9('0xa8'),_0x41b9('0xa8'))[_0x41b9('0xac')]('id',_0x41b9('0xaa'))[_0x41b9('0xac')](_0x4961c4[_0x41b9('0xad')][_0x41b9('0x8e')](),'ListId')[_0x41b9('0xac')](_0x3f71ea[_0x41b9('0x50')]['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))['field']('NOW()',_0x41b9('0x61'))['field'](_0x41b9('0xbf'),_0x41b9('0x62'))['from'](_0x41b9('0xb4'))[_0x41b9('0x4b')](_0x41b9('0xb5'))[_0x41b9('0x4b')]('ListId\x20=\x20?',_0x4961c4['CmListId'][_0x41b9('0x8e')]())[_0x41b9('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0x41b9('0x8e')]();_0x3dcb39[_0x41b9('0x8c')](db[_0x41b9('0x8d')][_0x41b9('0x41')](_0x471650));}return BPromise['all'](_0x3dcb39);}})[_0x41b9('0x29')](function(){return _0x104fe6;})[_0x41b9('0x29')](respondWithResult(_0x268d8b,null))[_0x41b9('0x53')](handleError(_0x268d8b,null));};exports[_0x41b9('0xc0')]=function(_0x2c864b,_0x178f41,_0x29c981){return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x2c864b[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x178f41,null))[_0x41b9('0x29')](function(_0x3839c5){if(_0x3839c5){return _0x3839c5[_0x41b9('0xc0')](_0x2c864b[_0x41b9('0x41')][_0x41b9('0x95')]);}})[_0x41b9('0x29')](function(_0x25a9ec){if(_0x25a9ec){return db[_0x41b9('0x6f')]['destroy']({'where':{'ListId':_0x2c864b[_0x41b9('0x41')]['ids'],'VoiceQueueId':_0x2c864b[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](function(){return _0x25a9ec;});}})[_0x41b9('0x29')](respondWithStatusCode(_0x178f41,null))[_0x41b9('0x53')](handleError(_0x178f41,null));};
\ No newline at end of file
+var _0xb145=['defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','find','name','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','UserProfileResource','getHoppers','findOne','nolimit','VoiceQueueId','CmHopper','CmHopperHistory','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','insert','scheduledAt','ListId','phone','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','fromQuery','ContactId','deletedAt\x20IS\x20NULL','all','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x4c7988,_0x32a0bc){var _0x426ca2=function(_0x189847){while(--_0x189847){_0x4c7988['push'](_0x4c7988['shift']());}};_0x426ca2(++_0x32a0bc);}(_0xb145,0xa3));var _0x5b14=function(_0x197535,_0x4f2dab){_0x197535=_0x197535-0x0;var _0x4345e5=_0xb145[_0x197535];return _0x4345e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];config[_0x5b14('0x19')]=_[_0x5b14('0x1a')](config[_0x5b14('0x19')],{'host':_0x5b14('0x1b'),'port':0x18eb});var socket=require(_0x5b14('0x1c'))(new Redis(config['redis']));require(_0x5b14('0x1d'))[_0x5b14('0x1e')](socket);function respondWithStatusCode(_0x35fb8b,_0x1dfa26){_0x1dfa26=_0x1dfa26||0xcc;return function(_0xba7e13){if(_0xba7e13){return _0x35fb8b[_0x5b14('0x1f')](_0x1dfa26);}return _0x35fb8b[_0x5b14('0x20')](_0x1dfa26)[_0x5b14('0x21')]();};}function respondWithResult(_0x183b0a,_0x287bb7){_0x287bb7=_0x287bb7||0xc8;return function(_0x221344){if(_0x221344){return _0x183b0a[_0x5b14('0x20')](_0x287bb7)['json'](_0x221344);}};}function respondWithFilteredResult(_0x24cfd0,_0x50866a){return function(_0x48d395){if(_0x48d395){var _0x58bf3c=typeof _0x50866a[_0x5b14('0x22')]===_0x5b14('0x23')&&typeof _0x50866a[_0x5b14('0x24')]===_0x5b14('0x23');var _0x3786f7=_0x48d395[_0x5b14('0x25')];var _0x19e6f8=_0x58bf3c?0x0:_0x50866a['offset'];var _0x525176=_0x58bf3c?_0x48d395['count']:_0x50866a[_0x5b14('0x22')]+_0x50866a[_0x5b14('0x24')];var _0x9a9495;if(_0x525176>=_0x3786f7){_0x525176=_0x3786f7;_0x9a9495=0xc8;}else{_0x9a9495=0xce;}_0x24cfd0[_0x5b14('0x20')](_0x9a9495);return _0x24cfd0['set'](_0x5b14('0x26'),_0x19e6f8+'-'+_0x525176+'/'+_0x3786f7)[_0x5b14('0x27')](_0x48d395);}return null;};}function patchUpdates(_0x4857c7){return function(_0x2d7b38){try{jsonpatch[_0x5b14('0x28')](_0x2d7b38,_0x4857c7,!![]);}catch(_0x50951f){return BPromise[_0x5b14('0x29')](_0x50951f);}return _0x2d7b38['save']();};}function saveUpdates(_0x59282c,_0x5e0780){return function(_0x4def4b){if(_0x4def4b){return _0x4def4b[_0x5b14('0x2a')](_0x59282c)[_0x5b14('0x2b')](function(_0x153a25){return _0x153a25;});}return null;};}function removeEntity(_0x5da505,_0x46f86a){return function(_0x3bf8e5){if(_0x3bf8e5){return _0x3bf8e5[_0x5b14('0x2c')]()[_0x5b14('0x2b')](function(){var _0xe6851b=_0x3bf8e5[_0x5b14('0x2d')]({'plain':!![]});var _0x422d22=[{'name':_0x5b14('0x2e'),'value':_0x5b14('0x2f'),'ignore':![]},{'name':_0x5b14('0x30'),'value':_0x5b14('0x31'),'ignore':![]}];var _0x1ab33f=_(_0x422d22)[_0x5b14('0x32')](_0x5b14('0x33'))['map'](_0x5b14('0x34'))[_0x5b14('0x34')]();if(_['includes'](_0x1ab33f,_0xe6851b['type'])){return;}var _0x2786f7=_[_0x5b14('0x35')](_0x422d22,['value',_0xe6851b['type']])[_0x5b14('0x36')];return db['UserProfileResource'][_0x5b14('0x2c')]({'where':{'type':_0x2786f7,'resourceId':_0xe6851b['id']}})[_0x5b14('0x2b')](function(){return _0x3bf8e5;});})['then'](function(){_0x5da505['status'](0xcc)[_0x5b14('0x21')]();});}};}function handleEntityNotFound(_0x3bf143,_0x185bdf){return function(_0x53f785){if(!_0x53f785){_0x3bf143[_0x5b14('0x1f')](0x194);}return _0x53f785;};}function handleError(_0x5a5393,_0x364658){_0x364658=_0x364658||0x1f4;return function(_0x291c92){logger[_0x5b14('0x37')](_0x291c92[_0x5b14('0x38')]);if(_0x291c92['name']){delete _0x291c92[_0x5b14('0x36')];}_0x5a5393[_0x5b14('0x20')](_0x364658)[_0x5b14('0x39')](_0x291c92);};}exports[_0x5b14('0x3a')]=function(_0x5a3a43,_0x32be08){var _0x3a11a2={},_0x17bd9f={},_0x5604d5={'count':0x0,'rows':[]};var _0x2fe74d=_['map'](db[_0x5b14('0x3b')][_0x5b14('0x3c')],function(_0x49b0c9){return{'name':_0x49b0c9[_0x5b14('0x3d')],'type':_0x49b0c9[_0x5b14('0x3e')]['key']};});_0x17bd9f[_0x5b14('0x3f')]=_['map'](_0x2fe74d,_0x5b14('0x36'));_0x17bd9f[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x5a3a43[_0x5b14('0x40')]);_0x17bd9f['filters']=_[_0x5b14('0x42')](_0x17bd9f[_0x5b14('0x3f')],_0x17bd9f[_0x5b14('0x40')]);_0x3a11a2[_0x5b14('0x43')]=_[_0x5b14('0x42')](_0x17bd9f[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x5a3a43[_0x5b14('0x40')][_0x5b14('0x44')]));_0x3a11a2[_0x5b14('0x43')]=_0x3a11a2[_0x5b14('0x43')][_0x5b14('0x45')]?_0x3a11a2[_0x5b14('0x43')]:_0x17bd9f[_0x5b14('0x3f')];if(!_0x5a3a43[_0x5b14('0x40')][_0x5b14('0x46')]('nolimit')){_0x3a11a2[_0x5b14('0x24')]=qs['limit'](_0x5a3a43[_0x5b14('0x40')][_0x5b14('0x24')]);_0x3a11a2['offset']=qs['offset'](_0x5a3a43['query'][_0x5b14('0x22')]);}_0x3a11a2[_0x5b14('0x47')]=qs['sort'](_0x5a3a43[_0x5b14('0x40')][_0x5b14('0x48')]);_0x3a11a2[_0x5b14('0x49')]=qs[_0x5b14('0x4a')](_[_0x5b14('0x4b')](_0x5a3a43['query'],_0x17bd9f[_0x5b14('0x4a')]),_0x2fe74d);if(_0x5a3a43[_0x5b14('0x40')]['filter']){_0x3a11a2[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x3a11a2[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x2fe74d,function(_0x4b266f){if(_0x4b266f[_0x5b14('0x3e')]!==_0x5b14('0x4e')){var _0x277a01={};_0x277a01[_0x4b266f[_0x5b14('0x36')]]={'$like':'%'+_0x5a3a43['query'][_0x5b14('0x32')]+'%'};return _0x277a01;}})});}_0x3a11a2=_[_0x5b14('0x4c')]({},_0x3a11a2,_0x5a3a43[_0x5b14('0x4f')]);var _0x1da448={'where':_0x3a11a2['where']};return db['VoiceQueue'][_0x5b14('0x25')](_0x1da448)[_0x5b14('0x2b')](function(_0x5ebbbe){_0x5604d5[_0x5b14('0x25')]=_0x5ebbbe;if(_0x5a3a43['query'][_0x5b14('0x50')]){_0x3a11a2[_0x5b14('0x51')]=[{'all':!![]}];}return db[_0x5b14('0x3b')][_0x5b14('0x52')](_0x3a11a2);})[_0x5b14('0x2b')](function(_0x557ff4){_0x5604d5[_0x5b14('0x53')]=_0x557ff4;return _0x5604d5;})[_0x5b14('0x2b')](respondWithFilteredResult(_0x32be08,_0x3a11a2))[_0x5b14('0x54')](handleError(_0x32be08,null));};exports[_0x5b14('0x55')]=function(_0x46e8ba,_0x5d8ad7){var _0x591eae={'raw':![],'where':{'id':_0x46e8ba['params']['id']}},_0x370f19={};_0x370f19['model']=_['keys'](db[_0x5b14('0x3b')][_0x5b14('0x3c')]);_0x370f19[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x46e8ba[_0x5b14('0x40')]);_0x370f19[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x370f19['model'],_0x370f19['query']);_0x591eae['attributes']=_['intersection'](_0x370f19['model'],qs[_0x5b14('0x44')](_0x46e8ba[_0x5b14('0x40')][_0x5b14('0x44')]));_0x591eae[_0x5b14('0x43')]=_0x591eae[_0x5b14('0x43')]['length']?_0x591eae['attributes']:_0x370f19[_0x5b14('0x3f')];if(_0x46e8ba[_0x5b14('0x40')]['includeAll']){_0x591eae[_0x5b14('0x51')]=[{'all':!![]}];}_0x591eae=_[_0x5b14('0x4c')]({},_0x591eae,_0x46e8ba['options']);return db['VoiceQueue'][_0x5b14('0x35')](_0x591eae)[_0x5b14('0x2b')](handleEntityNotFound(_0x5d8ad7,null))[_0x5b14('0x2b')](respondWithResult(_0x5d8ad7,null))['catch'](handleError(_0x5d8ad7,null));};exports[_0x5b14('0x56')]=function(_0x181738,_0x2acc27){return db[_0x5b14('0x3b')][_0x5b14('0x56')](_0x181738[_0x5b14('0x57')],{})[_0x5b14('0x2b')](function(_0x5d7b65){var _0x286518=_0x181738['user'][_0x5b14('0x2d')]({'plain':!![]});if(!_0x286518)throw new Error(_0x5b14('0x58'));if(_0x286518[_0x5b14('0x59')]===_0x5b14('0x5a')){var _0x3206fb=_0x5d7b65[_0x5b14('0x2d')]({'plain':!![]});var _0x2752b4=[{'name':_0x5b14('0x2e'),'value':_0x5b14('0x2f')},{'name':_0x5b14('0x30'),'value':_0x5b14('0x31')}];var _0x4180af=_['find'](_0x2752b4,['value',_0x3206fb['type']])[_0x5b14('0x36')];return db[_0x5b14('0x5b')][_0x5b14('0x35')]({'where':{'name':_0x4180af,'userProfileId':_0x286518[_0x5b14('0x5c')]},'raw':!![]})[_0x5b14('0x2b')](function(_0xfc4996){if(_0xfc4996&&_0xfc4996[_0x5b14('0x5d')]===0x0){return db['UserProfileResource'][_0x5b14('0x56')]({'name':_0x3206fb[_0x5b14('0x36')],'resourceId':_0x3206fb['id'],'type':_0xfc4996['name'],'sectionId':_0xfc4996['id']},{})['then'](function(){return _0x5d7b65;});}else{return _0x5d7b65;}})[_0x5b14('0x54')](function(_0x45def1){logger[_0x5b14('0x37')](_0x5b14('0x5e'),_0x45def1);throw _0x45def1;});}return _0x5d7b65;})[_0x5b14('0x2b')](respondWithResult(_0x2acc27,0xc9))[_0x5b14('0x54')](handleError(_0x2acc27,null));};exports['clone']=function(_0x2629ad,_0x48ffb3){var _0x426c27={'where':{'id':_0x2629ad[_0x5b14('0x5f')]['id']}},_0x5dce79={};_0x5dce79[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db['VoiceQueue'][_0x5b14('0x3c')]);_0x426c27['attributes']=_[_0x5b14('0x42')](_0x5dce79[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x2629ad['query'][_0x5b14('0x44')]));_0x426c27[_0x5b14('0x43')]=_0x426c27[_0x5b14('0x43')][_0x5b14('0x45')]?_0x426c27['attributes']:_0x5dce79[_0x5b14('0x3f')];if(_0x2629ad['query'][_0x5b14('0x50')]){_0x426c27[_0x5b14('0x51')]=[{'all':!![]}];}_0x426c27=_['merge']({},_0x426c27,_0x2629ad['options']);return db[_0x5b14('0x3b')][_0x5b14('0x35')](_0x426c27)[_0x5b14('0x2b')](handleEntityNotFound(_0x48ffb3,null))['then'](function(_0x474999){if(_0x474999){var _0x3f1c7b=_0x474999['get']({'plain':!![]});_0x3f1c7b=qs[_0x5b14('0x60')](_0x3f1c7b,['id',_0x5b14('0x61'),_0x5b14('0x62')]);_0x2629ad[_0x5b14('0x57')]=_[_0x5b14('0x60')](_0x2629ad['body'],['id',_0x5b14('0x61'),_0x5b14('0x62')]);return db['VoiceQueue']['create'](_[_0x5b14('0x4c')](_0x3f1c7b,_0x2629ad[_0x5b14('0x57')]),{'include':_0x2629ad['query']['includeAll']?[{'all':!![]}]:undefined})[_0x5b14('0x2b')](function(_0x3824e6){var _0x327b7e=_0x2629ad['user'][_0x5b14('0x2d')]({'plain':!![]});if(!_0x327b7e)throw new Error(_0x5b14('0x58'));if(_0x327b7e[_0x5b14('0x59')]==='user'){var _0x453e4b=_0x3824e6[_0x5b14('0x2d')]({'plain':!![]});var _0x289ff4=[{'name':'VoiceQueues','value':_0x5b14('0x2f')},{'name':_0x5b14('0x30'),'value':_0x5b14('0x31')}];var _0x2ca6dd=_[_0x5b14('0x35')](_0x289ff4,[_0x5b14('0x34'),_0x453e4b[_0x5b14('0x3e')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x2ca6dd,'userProfileId':_0x327b7e['userProfileId']},'raw':!![]})[_0x5b14('0x2b')](function(_0x1f0867){if(_0x1f0867&&_0x1f0867[_0x5b14('0x5d')]===0x0){return db[_0x5b14('0x63')][_0x5b14('0x56')]({'name':_0x453e4b['name'],'resourceId':_0x453e4b['id'],'type':_0x1f0867['name'],'sectionId':_0x1f0867['id']},{})[_0x5b14('0x2b')](function(){return _0x3824e6;});}else{return _0x3824e6;}})[_0x5b14('0x54')](function(_0x344944){logger[_0x5b14('0x37')](_0x5b14('0x5e'),_0x344944);throw _0x344944;});}return _0x3824e6;});}})['then'](respondWithResult(_0x48ffb3,0xc9))['catch'](handleError(_0x48ffb3,null));};exports[_0x5b14('0x2a')]=function(_0x1b76a0,_0x160a4f){if(_0x1b76a0[_0x5b14('0x57')]['id']){delete _0x1b76a0[_0x5b14('0x57')]['id'];}return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x1b76a0[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x160a4f,null))['then'](saveUpdates(_0x1b76a0[_0x5b14('0x57')],null))['then'](respondWithResult(_0x160a4f,null))[_0x5b14('0x54')](handleError(_0x160a4f,null));};exports[_0x5b14('0x2c')]=function(_0x1b1020,_0x1831b9){return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x1b1020[_0x5b14('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1831b9,null))['then'](removeEntity(_0x1831b9,null))[_0x5b14('0x54')](handleError(_0x1831b9,null));};exports[_0x5b14('0x64')]=function(_0x264bcb,_0x44339f,_0x154b07){var _0x54bbeb={'raw':![],'where':{}};var _0x1310a5={};var _0x167060={'count':0x0,'rows':[]};return db[_0x5b14('0x3b')][_0x5b14('0x65')]({'where':{'id':_0x264bcb[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x44339f,null))[_0x5b14('0x2b')](function(_0x12f46a){if(_0x12f46a){_0x1310a5[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db['CmHopper']['rawAttributes']);_0x1310a5[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x264bcb['query']);_0x1310a5[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x1310a5[_0x5b14('0x3f')],_0x1310a5[_0x5b14('0x40')]);_0x54bbeb['attributes']=_[_0x5b14('0x42')](_0x1310a5[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x264bcb[_0x5b14('0x40')][_0x5b14('0x44')]));_0x54bbeb[_0x5b14('0x43')]=_0x54bbeb[_0x5b14('0x43')]['length']?_0x54bbeb['attributes']:_0x1310a5['model'];if(!_0x264bcb[_0x5b14('0x40')][_0x5b14('0x46')](_0x5b14('0x66'))){_0x54bbeb[_0x5b14('0x24')]=qs[_0x5b14('0x24')](_0x264bcb[_0x5b14('0x40')][_0x5b14('0x24')]);_0x54bbeb[_0x5b14('0x22')]=qs[_0x5b14('0x22')](_0x264bcb[_0x5b14('0x40')][_0x5b14('0x22')]);}_0x54bbeb['order']=qs[_0x5b14('0x48')](_0x264bcb[_0x5b14('0x40')][_0x5b14('0x48')]);_0x54bbeb[_0x5b14('0x49')]=qs['filters'](_[_0x5b14('0x4b')](_0x264bcb[_0x5b14('0x40')],_0x1310a5[_0x5b14('0x4a')]));_0x54bbeb[_0x5b14('0x49')][_0x5b14('0x67')]=_0x12f46a['id'];if(_0x264bcb[_0x5b14('0x40')][_0x5b14('0x32')]){_0x54bbeb[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x54bbeb[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x54bbeb[_0x5b14('0x43')],function(_0xe047e0){var _0x261d24={};_0x261d24[_0xe047e0]={'$like':'%'+_0x264bcb[_0x5b14('0x40')]['filter']+'%'};return _0x261d24;})});}_0x54bbeb=_[_0x5b14('0x4c')]({},_0x54bbeb,_0x264bcb[_0x5b14('0x4f')]);return db[_0x5b14('0x68')][_0x5b14('0x25')]({'where':_0x54bbeb[_0x5b14('0x49')]})['then'](function(_0x50ca14){_0x167060[_0x5b14('0x25')]=_0x50ca14;if(_0x264bcb['query'][_0x5b14('0x50')]){_0x54bbeb[_0x5b14('0x51')]=[{'all':!![]}];}return db[_0x5b14('0x68')][_0x5b14('0x52')](_0x54bbeb);})[_0x5b14('0x2b')](function(_0x1eebf1){_0x167060['rows']=_0x1eebf1;return _0x167060;});}})[_0x5b14('0x2b')](respondWithFilteredResult(_0x44339f,_0x54bbeb))['catch'](handleError(_0x44339f,null));};exports['getHopperHistories']=function(_0x361c69,_0x3c79bb,_0x110968){var _0x5ef4aa={'raw':!![],'where':{}};var _0x5b8e11={};var _0x5c9aa0={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5b14('0x65')]({'where':{'id':_0x361c69[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x3c79bb,null))['then'](function(_0x5761cf){if(_0x5761cf){_0x5b8e11[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db['CmHopperHistory'][_0x5b14('0x3c')]);_0x5b8e11[_0x5b14('0x40')]=_['keys'](_0x361c69['query']);_0x5b8e11['filters']=_['intersection'](_0x5b8e11[_0x5b14('0x3f')],_0x5b8e11['query']);_0x5ef4aa[_0x5b14('0x43')]=_[_0x5b14('0x42')](_0x5b8e11['model'],qs[_0x5b14('0x44')](_0x361c69['query'][_0x5b14('0x44')]));_0x5ef4aa['attributes']=_0x5ef4aa[_0x5b14('0x43')][_0x5b14('0x45')]?_0x5ef4aa['attributes']:_0x5b8e11[_0x5b14('0x3f')];if(!_0x361c69[_0x5b14('0x40')][_0x5b14('0x46')](_0x5b14('0x66'))){_0x5ef4aa['limit']=qs[_0x5b14('0x24')](_0x361c69[_0x5b14('0x40')]['limit']);_0x5ef4aa[_0x5b14('0x22')]=qs[_0x5b14('0x22')](_0x361c69[_0x5b14('0x40')]['offset']);}_0x5ef4aa[_0x5b14('0x47')]=qs[_0x5b14('0x48')](_0x361c69[_0x5b14('0x40')]['sort']);_0x5ef4aa[_0x5b14('0x49')]=qs['filters'](_[_0x5b14('0x4b')](_0x361c69['query'],_0x5b8e11[_0x5b14('0x4a')]));_0x5ef4aa[_0x5b14('0x49')]['VoiceQueueId']=_0x5761cf['id'];if(_0x361c69[_0x5b14('0x40')]['filter']){_0x5ef4aa[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x5ef4aa[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x5ef4aa[_0x5b14('0x43')],function(_0x55c0e2){var _0x56a634={};_0x56a634[_0x55c0e2]={'$like':'%'+_0x361c69[_0x5b14('0x40')]['filter']+'%'};return _0x56a634;})});}_0x5ef4aa=_[_0x5b14('0x4c')]({},_0x5ef4aa,_0x361c69[_0x5b14('0x4f')]);return db[_0x5b14('0x69')][_0x5b14('0x25')]({'where':_0x5ef4aa['where']})[_0x5b14('0x2b')](function(_0x95d906){_0x5c9aa0[_0x5b14('0x25')]=_0x95d906;if(_0x361c69[_0x5b14('0x40')][_0x5b14('0x50')]){_0x5ef4aa[_0x5b14('0x51')]=[{'all':!![]}];}return db[_0x5b14('0x69')][_0x5b14('0x52')](_0x5ef4aa);})[_0x5b14('0x2b')](function(_0x61a051){_0x5c9aa0['rows']=_0x61a051;return _0x5c9aa0;});}})['then'](respondWithFilteredResult(_0x3c79bb,_0x5ef4aa))['catch'](handleError(_0x3c79bb,null));};exports['getHopperFinals']=function(_0x5ca3b1,_0x43c239,_0x215260){var _0x41465a={'raw':!![],'where':{}};var _0x13b2d1={};var _0x57021a={'count':0x0,'rows':[]};return db[_0x5b14('0x3b')][_0x5b14('0x65')]({'where':{'id':_0x5ca3b1[_0x5b14('0x5f')]['id']}})['then'](handleEntityNotFound(_0x43c239,null))['then'](function(_0x564a0b){if(_0x564a0b){_0x13b2d1[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db['CmHopperFinal']['rawAttributes']);_0x13b2d1[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x5ca3b1[_0x5b14('0x40')]);_0x13b2d1[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x13b2d1[_0x5b14('0x3f')],_0x13b2d1['query']);_0x41465a[_0x5b14('0x43')]=_[_0x5b14('0x42')](_0x13b2d1[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x5ca3b1[_0x5b14('0x40')][_0x5b14('0x44')]));_0x41465a['attributes']=_0x41465a['attributes'][_0x5b14('0x45')]?_0x41465a['attributes']:_0x13b2d1[_0x5b14('0x3f')];if(!_0x5ca3b1[_0x5b14('0x40')]['hasOwnProperty'](_0x5b14('0x66'))){_0x41465a[_0x5b14('0x24')]=qs['limit'](_0x5ca3b1['query'][_0x5b14('0x24')]);_0x41465a[_0x5b14('0x22')]=qs['offset'](_0x5ca3b1[_0x5b14('0x40')][_0x5b14('0x22')]);}_0x41465a[_0x5b14('0x47')]=qs[_0x5b14('0x48')](_0x5ca3b1[_0x5b14('0x40')][_0x5b14('0x48')]);_0x41465a['where']=qs['filters'](_['pick'](_0x5ca3b1[_0x5b14('0x40')],_0x13b2d1[_0x5b14('0x4a')]));_0x41465a[_0x5b14('0x49')]['VoiceQueueId']=_0x564a0b['id'];if(_0x5ca3b1[_0x5b14('0x40')][_0x5b14('0x32')]){_0x41465a[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x41465a[_0x5b14('0x49')],{'$or':_['map'](_0x41465a[_0x5b14('0x43')],function(_0x4bf1ab){var _0x4bfdd8={};_0x4bfdd8[_0x4bf1ab]={'$like':'%'+_0x5ca3b1['query'][_0x5b14('0x32')]+'%'};return _0x4bfdd8;})});}_0x41465a=_['merge']({},_0x41465a,_0x5ca3b1[_0x5b14('0x4f')]);return db[_0x5b14('0x6a')]['count']({'where':_0x41465a['where']})[_0x5b14('0x2b')](function(_0xbaef00){_0x57021a[_0x5b14('0x25')]=_0xbaef00;if(_0x5ca3b1[_0x5b14('0x40')]['includeAll']){_0x41465a[_0x5b14('0x51')]=[{'all':!![]}];}return db[_0x5b14('0x6a')][_0x5b14('0x52')](_0x41465a);})[_0x5b14('0x2b')](function(_0x56cd09){_0x57021a[_0x5b14('0x53')]=_0x56cd09;return _0x57021a;});}})[_0x5b14('0x2b')](respondWithFilteredResult(_0x43c239,_0x41465a))[_0x5b14('0x54')](handleError(_0x43c239,null));};exports['getHopperBlacks']=function(_0x51e388,_0x5cfa65,_0x58f364){var _0x389097={'raw':!![],'where':{}};var _0x1d913b={};var _0x4c9513={'count':0x0,'rows':[]};return db[_0x5b14('0x3b')][_0x5b14('0x65')]({'where':{'id':_0x51e388[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x5cfa65,null))[_0x5b14('0x2b')](function(_0x397de7){if(_0x397de7){_0x1d913b[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db[_0x5b14('0x6b')][_0x5b14('0x3c')]);_0x1d913b['query']=_['keys'](_0x51e388[_0x5b14('0x40')]);_0x1d913b['filters']=_['intersection'](_0x1d913b[_0x5b14('0x3f')],_0x1d913b['query']);_0x389097[_0x5b14('0x43')]=_[_0x5b14('0x42')](_0x1d913b[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x51e388[_0x5b14('0x40')][_0x5b14('0x44')]));_0x389097[_0x5b14('0x43')]=_0x389097['attributes'][_0x5b14('0x45')]?_0x389097[_0x5b14('0x43')]:_0x1d913b['model'];if(!_0x51e388[_0x5b14('0x40')][_0x5b14('0x46')](_0x5b14('0x66'))){_0x389097['limit']=qs['limit'](_0x51e388[_0x5b14('0x40')][_0x5b14('0x24')]);_0x389097['offset']=qs[_0x5b14('0x22')](_0x51e388[_0x5b14('0x40')][_0x5b14('0x22')]);}_0x389097['order']=qs[_0x5b14('0x48')](_0x51e388[_0x5b14('0x40')]['sort']);_0x389097[_0x5b14('0x49')]=qs[_0x5b14('0x4a')](_['pick'](_0x51e388['query'],_0x1d913b[_0x5b14('0x4a')]));_0x389097[_0x5b14('0x49')][_0x5b14('0x67')]=_0x397de7['id'];if(_0x51e388[_0x5b14('0x40')]['filter']){_0x389097[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x389097[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x389097['attributes'],function(_0x3ed421){var _0x1a5f39={};_0x1a5f39[_0x3ed421]={'$like':'%'+_0x51e388[_0x5b14('0x40')][_0x5b14('0x32')]+'%'};return _0x1a5f39;})});}_0x389097=_[_0x5b14('0x4c')]({},_0x389097,_0x51e388[_0x5b14('0x4f')]);return db[_0x5b14('0x6b')][_0x5b14('0x25')]({'where':_0x389097['where']})[_0x5b14('0x2b')](function(_0x4ba031){_0x4c9513['count']=_0x4ba031;if(_0x51e388[_0x5b14('0x40')][_0x5b14('0x50')]){_0x389097[_0x5b14('0x51')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5b14('0x52')](_0x389097);})['then'](function(_0x5e4ef3){_0x4c9513[_0x5b14('0x53')]=_0x5e4ef3;return _0x4c9513;});}})[_0x5b14('0x2b')](respondWithFilteredResult(_0x5cfa65,_0x389097))[_0x5b14('0x54')](handleError(_0x5cfa65,null));};exports['getTeams']=function(_0x4182de,_0x34784f,_0x214ccd){var _0x456d3c={};var _0x41358f={};var _0x4eed4e;var _0x71080;return db[_0x5b14('0x3b')]['findOne']({'where':{'id':_0x4182de['params']['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x34784f,null))[_0x5b14('0x2b')](function(_0x5acace){if(_0x5acace){_0x4eed4e=_0x5acace;_0x41358f[_0x5b14('0x3f')]=_['keys'](db[_0x5b14('0x6c')]['rawAttributes']);_0x41358f[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x4182de[_0x5b14('0x40')]);_0x41358f[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x41358f['model'],_0x41358f[_0x5b14('0x40')]);_0x456d3c[_0x5b14('0x43')]=_[_0x5b14('0x42')](_0x41358f['model'],qs[_0x5b14('0x44')](_0x4182de[_0x5b14('0x40')][_0x5b14('0x44')]));_0x456d3c[_0x5b14('0x43')]=_0x456d3c['attributes'][_0x5b14('0x45')]?_0x456d3c[_0x5b14('0x43')]:_0x41358f[_0x5b14('0x3f')];_0x456d3c[_0x5b14('0x47')]=qs['sort'](_0x4182de[_0x5b14('0x40')][_0x5b14('0x48')]);_0x456d3c['where']=qs[_0x5b14('0x4a')](_[_0x5b14('0x4b')](_0x4182de[_0x5b14('0x40')],_0x41358f[_0x5b14('0x4a')]));if(_0x4182de[_0x5b14('0x40')][_0x5b14('0x32')]){_0x456d3c[_0x5b14('0x49')]=_['merge'](_0x456d3c[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x456d3c['attributes'],function(_0x4a68ae){var _0x6e7a20={};_0x6e7a20[_0x4a68ae]={'$like':'%'+_0x4182de['query'][_0x5b14('0x32')]+'%'};return _0x6e7a20;})});}_0x456d3c=_['merge']({},_0x456d3c,_0x4182de['options']);return _0x4eed4e[_0x5b14('0x6d')](_0x456d3c);}})[_0x5b14('0x2b')](function(_0x46a88c){if(_0x46a88c){_0x71080=_0x46a88c[_0x5b14('0x45')];if(!_0x4182de[_0x5b14('0x40')]['hasOwnProperty']('nolimit')){_0x456d3c['limit']=qs[_0x5b14('0x24')](_0x4182de[_0x5b14('0x40')][_0x5b14('0x24')]);_0x456d3c['offset']=qs[_0x5b14('0x22')](_0x4182de['query'][_0x5b14('0x22')]);}return _0x4eed4e[_0x5b14('0x6d')](_0x456d3c);}})['then'](function(_0x330b9a){if(_0x330b9a){return _0x330b9a?{'count':_0x71080,'rows':_0x330b9a}:null;}})['then'](respondWithResult(_0x34784f,null))[_0x5b14('0x54')](handleError(_0x34784f,null));};exports[_0x5b14('0x6e')]=function(_0x3662ed,_0x72ac45,_0x2015b6){var _0x576638=_0x3662ed[_0x5b14('0x57')]['teams'];var _0x33694b=_[_0x5b14('0x4d')](_0x576638,'id');return db[_0x5b14('0x6c')]['findAll']({'where':{'id':_0x33694b},'attributes':['id'],'include':[{'model':db[_0x5b14('0x6f')],'as':_0x5b14('0x70'),'attributes':['id',_0x5b14('0x36'),_0x5b14('0x71'),_0x5b14('0x72'),_0x5b14('0x73')],'raw':!![]}]})[_0x5b14('0x2b')](function(_0x14ef47){if(_0x14ef47){var _0x224a23=_['flatMap'](_0x14ef47,function(_0x1ed1da){var _0x5d2629=_0x1ed1da[_0x5b14('0x2d')]({'plain':!![]});_0x5d2629[_0x5b14('0x70')][_0x5b14('0x74')](function(_0x5d0f23){_0x5d0f23['penalty']=_[_0x5b14('0x35')](_0x576638,{'id':_0x5d2629['id']})[_0x5b14('0x75')];});return _0x5d2629[_0x5b14('0x70')];});return db['VoiceQueue'][_0x5b14('0x35')]({'where':{'id':_0x3662ed[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](function(_0x21365e){return db[_0x5b14('0x76')][_0x5b14('0x77')](function(_0x33f9e2){return _0x21365e[_0x5b14('0x6e')](_0x33694b,{'transaction':_0x33f9e2})[_0x5b14('0x2b')](function(){return BPromise[_0x5b14('0x78')](_0x576638,function(_0x4a0b21){return db['TeamVoiceQueue'][_0x5b14('0x79')]({'TeamId':_0x4a0b21['id'],'VoiceQueueId':_0x3662ed[_0x5b14('0x5f')]['id'],'penalty':_0x4a0b21[_0x5b14('0x75')]},{'transaction':_0x33f9e2});});})[_0x5b14('0x2b')](function(){return BPromise[_0x5b14('0x78')](_0x224a23,function(_0x9fc383){return db[_0x5b14('0x7a')]['findOrCreate']({'where':{'UserId':_0x9fc383['id'],'VoiceQueueId':_0x3662ed[_0x5b14('0x5f')]['id']},'defaults':{'penalty':_0x9fc383[_0x5b14('0x75')]},'transaction':_0x33f9e2});});})[_0x5b14('0x2b')](function(){return BPromise[_0x5b14('0x78')](_['filter'](_0x224a23,{'online':!![]}),function(_0x334d3a){return db[_0x5b14('0x7b')]['upsert']({'membername':_0x334d3a[_0x5b14('0x36')],'UserId':_0x334d3a['id'],'queue_name':_0x21365e[_0x5b14('0x36')],'VoiceQueueId':_0x21365e['id'],'interface':_[_0x5b14('0x7c')](_0x334d3a[_0x5b14('0x73')])?util[_0x5b14('0x7d')](_0x5b14('0x7e'),_0x334d3a[_0x5b14('0x36')]):_0x334d3a[_0x5b14('0x73')],'paused':_0x334d3a['voicePause']||![],'penalty':_0x334d3a[_0x5b14('0x75')]},{'transaction':_0x33f9e2});});})[_0x5b14('0x2b')](function(){_0x224a23[_0x5b14('0x74')](function(_0x5050e3){socket[_0x5b14('0x7f')](_0x5b14('0x80'),{'UserId':_0x5050e3['id'],'VoiceQueueId':_0x21365e['id']});});});});});}})[_0x5b14('0x2b')](respondWithStatusCode(_0x72ac45,null))['catch'](handleError(_0x72ac45,null));};exports[_0x5b14('0x81')]=function(_0x2aac41,_0x442d9f,_0x29cc6d){return db[_0x5b14('0x6c')][_0x5b14('0x52')]({'where':{'id':_0x2aac41[_0x5b14('0x40')][_0x5b14('0x82')]},'attributes':['id'],'include':[{'model':db[_0x5b14('0x6f')],'as':_0x5b14('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x442d9f,null))[_0x5b14('0x2b')](function(_0x4111a9){var _0x2bf4e4=_[_0x5b14('0x4d')](_0x4111a9,'id');var _0x2050ec=[];var _0x274f37=[];var _0x2a1a2f=squel[_0x5b14('0x83')]();_0x2a1a2f[_0x5b14('0x84')](_0x5b14('0x85'))[_0x5b14('0x86')](_0x5b14('0x87'),'tq')[_0x5b14('0x88')](_0x5b14('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5b14('0x49')](_0x5b14('0x8a'),_0x2aac41[_0x5b14('0x5f')]['id']);for(var _0x27db43=0x0;_0x27db43<_0x4111a9['length'];_0x27db43+=0x1){let _0x295b2d=_0x4111a9[_0x27db43];for(var _0xc08f24=0x0;_0xc08f24<_0x295b2d[_0x5b14('0x70')][_0x5b14('0x45')];_0xc08f24+=0x1){let _0x5eaa25=_0x295b2d[_0x5b14('0x70')][_0xc08f24];var _0x216ed1=_0x2a1a2f['clone']();_0x216ed1[_0x5b14('0x49')](_0x5b14('0x8b'),_0x5eaa25['id']);_0x274f37[_0x5b14('0x8c')](db['sequelize']['query'](_0x216ed1[_0x5b14('0x8d')](),{'type':db['sequelize']['QueryTypes'][_0x5b14('0x8e')]})[_0x5b14('0x2b')](function(_0x5cafe3){if(_0x5cafe3[_0x5b14('0x45')]===0x1){return _0x5eaa25['id'];}else{var _0x5a985f=_['every'](_['map'](_0x5cafe3,_0x5b14('0x8f')),function(_0x2ac1a3){return _[_0x5b14('0x90')](_0x2bf4e4,_0x2ac1a3);});if(_0x5a985f){return _0x5eaa25['id'];}}}));}}return BPromise['all'](_0x274f37)[_0x5b14('0x2b')](function(_0x41859){_0x2050ec=_(_0x2050ec)[_0x5b14('0x91')](_0x41859)[_0x5b14('0x92')]()[_0x5b14('0x34')]();return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x2aac41[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](function(_0x57cfed){return db[_0x5b14('0x76')][_0x5b14('0x77')](function(_0x392011){return _0x57cfed['removeTeams'](_0x2aac41[_0x5b14('0x40')]['ids'],{'transaction':_0x392011})['then'](function(){if(!_[_0x5b14('0x93')](_0x2050ec)){return _0x57cfed[_0x5b14('0x94')](_0x2050ec,{'transaction':_0x392011})[_0x5b14('0x2b')](function(){return db[_0x5b14('0x7b')][_0x5b14('0x2c')]({'where':{'VoiceQueueId':_0x2aac41[_0x5b14('0x5f')]['id'],'UserId':_0x2050ec},'transaction':_0x392011});});}})[_0x5b14('0x2b')](function(){_0x2050ec[_0x5b14('0x74')](function(_0x2acece){socket[_0x5b14('0x7f')](_0x5b14('0x95'),{'UserId':_0x2acece,'VoiceQueueId':_0x57cfed['id']});});});});});});})['then'](respondWithStatusCode(_0x442d9f,null))['catch'](handleError(_0x442d9f,null));};exports[_0x5b14('0x96')]=function(_0x41595f,_0xb28d69,_0x1a5aee){var _0x392188,_0x5123f0;return db['VoiceQueue'][_0x5b14('0x35')]({'where':{'id':_0x41595f[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0xb28d69,null))[_0x5b14('0x2b')](function(_0x29392b){if(_0x29392b){_0x5123f0=_0x29392b;return _0x29392b[_0x5b14('0x96')](_0x41595f[_0x5b14('0x57')][_0x5b14('0x82')],_[_0x5b14('0x60')](_0x41595f[_0x5b14('0x57')],['ids','id'])||{})['spread'](function(_0x3bf7d5){for(var _0x5677b2=0x0;_0x5677b2<_0x41595f[_0x5b14('0x57')]['ids']['length'];_0x5677b2+=0x1){socket[_0x5b14('0x7f')](_0x5b14('0x80'),{'UserId':Number(_0x41595f[_0x5b14('0x57')][_0x5b14('0x82')][_0x5677b2]),'VoiceQueueId':Number(_0x41595f['params']['id'])});}return _0x3bf7d5;});}})[_0x5b14('0x2b')](function(_0x4460c2){_0x392188=_0x4460c2||[];if(_0x5123f0){return db[_0x5b14('0x6f')][_0x5b14('0x52')]({'where':{'id':_0x41595f['body'][_0x5b14('0x82')]},'attributes':['id',_0x5b14('0x36'),_0x5b14('0x71'),_0x5b14('0x72'),'interface'],'raw':!![]});}})[_0x5b14('0x2b')](function(_0x247d4e){if(!_[_0x5b14('0x93')](_0x247d4e)){var _0x2a8a3e=[];for(var _0x2b6dd4=0x0;_0x2b6dd4<_0x247d4e[_0x5b14('0x45')];_0x2b6dd4++){if(_0x247d4e[_0x2b6dd4][_0x5b14('0x71')]){_0x2a8a3e[_0x5b14('0x8c')](db['UserVoiceQueueRt'][_0x5b14('0x79')]({'membername':_0x247d4e[_0x2b6dd4][_0x5b14('0x36')],'UserId':_0x247d4e[_0x2b6dd4]['id'],'queue_name':_0x5123f0[_0x5b14('0x36')],'VoiceQueueId':_0x5123f0['id'],'interface':_['isNil'](_0x247d4e[_0x2b6dd4][_0x5b14('0x73')])?util['format'](_0x5b14('0x7e'),_0x247d4e[_0x2b6dd4][_0x5b14('0x36')]):_0x247d4e[_0x2b6dd4][_0x5b14('0x73')],'paused':_0x247d4e[_0x2b6dd4]['voicePause']||![],'penalty':_0x41595f['body'][_0x5b14('0x75')]||0x0}));}}return BPromise['all'](_0x2a8a3e);}})[_0x5b14('0x2b')](function(){return _0x392188;})[_0x5b14('0x2b')](respondWithResult(_0xb28d69,null))[_0x5b14('0x54')](handleError(_0xb28d69,null));};exports[_0x5b14('0x94')]=function(_0x5500d1,_0x3b9ea4,_0x541b51){return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x5500d1[_0x5b14('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3b9ea4,null))['then'](function(_0x22c216){if(_0x22c216){return _0x22c216['removeAgents'](_0x5500d1[_0x5b14('0x40')]['ids'])[_0x5b14('0x2b')](function(){if(_[_0x5b14('0x97')](_0x5500d1[_0x5b14('0x40')][_0x5b14('0x82')])){for(var _0x3c888c=0x0;_0x3c888c<_0x5500d1[_0x5b14('0x40')][_0x5b14('0x82')][_0x5b14('0x45')];_0x3c888c+=0x1){socket[_0x5b14('0x7f')](_0x5b14('0x95'),{'UserId':Number(_0x5500d1[_0x5b14('0x40')][_0x5b14('0x82')][_0x3c888c]),'VoiceQueueId':Number(_0x5500d1[_0x5b14('0x5f')]['id'])});}}else{socket[_0x5b14('0x7f')](_0x5b14('0x95'),{'UserId':Number(_0x5500d1[_0x5b14('0x40')]['ids']),'VoiceQueueId':Number(_0x5500d1[_0x5b14('0x5f')]['id'])});}});}})[_0x5b14('0x2b')](function(_0x3db359){return db[_0x5b14('0x7b')][_0x5b14('0x2c')]({'where':{'VoiceQueueId':_0x5500d1[_0x5b14('0x5f')]['id'],'UserId':_0x5500d1[_0x5b14('0x40')][_0x5b14('0x82')]}})[_0x5b14('0x2b')](function(){return _0x3db359;});})['then'](respondWithStatusCode(_0x3b9ea4,null))[_0x5b14('0x54')](handleError(_0x3b9ea4,null));};exports[_0x5b14('0x98')]=function(_0x48976a,_0x31b47e,_0x26e038){var _0x2fca40={};var _0x103066={};var _0x4bba30;var _0x2ff9b4;return db[_0x5b14('0x3b')]['findOne']({'where':{'id':_0x48976a[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x31b47e,null))[_0x5b14('0x2b')](function(_0x99083f){if(_0x99083f){_0x4bba30=_0x99083f;_0x103066[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db[_0x5b14('0x6f')]['rawAttributes']);_0x103066[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x48976a[_0x5b14('0x40')]);_0x103066[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x103066[_0x5b14('0x3f')],_0x103066[_0x5b14('0x40')]);_0x2fca40[_0x5b14('0x43')]=_[_0x5b14('0x42')](_0x103066['model'],qs[_0x5b14('0x44')](_0x48976a[_0x5b14('0x40')]['fields']));_0x2fca40[_0x5b14('0x43')]=_0x2fca40[_0x5b14('0x43')][_0x5b14('0x45')]?_0x2fca40[_0x5b14('0x43')]:_0x103066[_0x5b14('0x3f')];_0x2fca40[_0x5b14('0x47')]=qs[_0x5b14('0x48')](_0x48976a[_0x5b14('0x40')][_0x5b14('0x48')]);_0x2fca40['where']=qs[_0x5b14('0x4a')](_[_0x5b14('0x4b')](_0x48976a['query'],_0x103066[_0x5b14('0x4a')]));if(_0x48976a[_0x5b14('0x40')][_0x5b14('0x32')]){_0x2fca40[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x2fca40[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x2fca40[_0x5b14('0x43')],function(_0xd7a445){var _0x46cded={};_0x46cded[_0xd7a445]={'$like':'%'+_0x48976a[_0x5b14('0x40')][_0x5b14('0x32')]+'%'};return _0x46cded;})});}_0x2fca40=_[_0x5b14('0x4c')]({},_0x2fca40,_0x48976a[_0x5b14('0x4f')]);return _0x4bba30[_0x5b14('0x98')](_0x2fca40);}})[_0x5b14('0x2b')](function(_0x29a7cf){if(_0x29a7cf){_0x2ff9b4=_0x29a7cf[_0x5b14('0x45')];if(!_0x48976a['query'][_0x5b14('0x46')](_0x5b14('0x66'))){_0x2fca40[_0x5b14('0x24')]=qs[_0x5b14('0x24')](_0x48976a[_0x5b14('0x40')]['limit']);_0x2fca40[_0x5b14('0x22')]=qs[_0x5b14('0x22')](_0x48976a[_0x5b14('0x40')][_0x5b14('0x22')]);}return _0x4bba30['getAgents'](_0x2fca40);}})['then'](function(_0x495b77){if(_0x495b77){return _0x495b77?{'count':_0x2ff9b4,'rows':_0x495b77}:null;}})[_0x5b14('0x2b')](respondWithResult(_0x31b47e,null))[_0x5b14('0x54')](handleError(_0x31b47e,null));};exports[_0x5b14('0x99')]=function(_0x5da2d4,_0x2b891f,_0xa6adc6){var _0x403e53={};var _0x19b67f={};var _0x23ca04;var _0x1255fc;return db[_0x5b14('0x3b')]['findOne']({'where':{'id':_0x5da2d4[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x2b891f,null))[_0x5b14('0x2b')](function(_0x3967c3){if(_0x3967c3){_0x23ca04=_0x3967c3;_0x19b67f[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db[_0x5b14('0x7b')][_0x5b14('0x3c')]);_0x19b67f['query']=_['keys'](_0x5da2d4['query']);_0x19b67f[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x19b67f['model'],_0x19b67f[_0x5b14('0x40')]);_0x403e53[_0x5b14('0x43')]=_['intersection'](_0x19b67f[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x5da2d4[_0x5b14('0x40')][_0x5b14('0x44')]));_0x403e53[_0x5b14('0x43')]=_0x403e53[_0x5b14('0x43')][_0x5b14('0x45')]?_0x403e53[_0x5b14('0x43')]:_0x19b67f['model'];_0x403e53[_0x5b14('0x47')]=qs['sort'](_0x5da2d4[_0x5b14('0x40')][_0x5b14('0x48')]);_0x403e53['where']=qs[_0x5b14('0x4a')](_[_0x5b14('0x4b')](_0x5da2d4[_0x5b14('0x40')],_0x19b67f[_0x5b14('0x4a')]));if(_0x5da2d4[_0x5b14('0x40')][_0x5b14('0x32')]){_0x403e53['where']=_[_0x5b14('0x4c')](_0x403e53[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x403e53[_0x5b14('0x43')],function(_0xd4af12){var _0x426d63={};_0x426d63[_0xd4af12]={'$like':'%'+_0x5da2d4[_0x5b14('0x40')]['filter']+'%'};return _0x426d63;})});}_0x403e53=_['merge']({},_0x403e53,_0x5da2d4[_0x5b14('0x4f')]);return _0x23ca04['getMembers'](_0x403e53);}})['then'](function(_0x4f900b){if(_0x4f900b){_0x1255fc=_0x4f900b[_0x5b14('0x45')];if(!_0x5da2d4[_0x5b14('0x40')]['hasOwnProperty'](_0x5b14('0x66'))){_0x403e53['limit']=qs[_0x5b14('0x24')](_0x5da2d4[_0x5b14('0x40')][_0x5b14('0x24')]);_0x403e53[_0x5b14('0x22')]=qs['offset'](_0x5da2d4[_0x5b14('0x40')][_0x5b14('0x22')]);}return _0x23ca04[_0x5b14('0x99')](_0x403e53);}})[_0x5b14('0x2b')](function(_0x319e69){return _0x319e69?{'count':_0x1255fc,'rows':_0x319e69}:null;})[_0x5b14('0x2b')](respondWithResult(_0x2b891f,null))['catch'](handleError(_0x2b891f,null));};exports[_0x5b14('0x9a')]=function(_0x3cc5c9,_0x1a97cd,_0x3c3a38){var _0x2ba380={};var _0x153e13={};var _0xe91d22;var _0x4c1d06;return db[_0x5b14('0x3b')]['findOne']({'where':{'id':_0x3cc5c9['params']['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x1a97cd,null))[_0x5b14('0x2b')](function(_0x1aca30){if(_0x1aca30){_0xe91d22=_0x1aca30;_0x153e13[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db[_0x5b14('0x9b')]['rawAttributes']);_0x153e13[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x3cc5c9[_0x5b14('0x40')]);_0x153e13[_0x5b14('0x4a')]=_[_0x5b14('0x42')](_0x153e13['model'],_0x153e13[_0x5b14('0x40')]);_0x2ba380['attributes']=_[_0x5b14('0x42')](_0x153e13[_0x5b14('0x3f')],qs[_0x5b14('0x44')](_0x3cc5c9['query'][_0x5b14('0x44')]));_0x2ba380[_0x5b14('0x43')]=_0x2ba380[_0x5b14('0x43')][_0x5b14('0x45')]?_0x2ba380[_0x5b14('0x43')]:_0x153e13[_0x5b14('0x3f')];_0x2ba380[_0x5b14('0x47')]=qs[_0x5b14('0x48')](_0x3cc5c9[_0x5b14('0x40')]['sort']);_0x2ba380[_0x5b14('0x49')]=qs[_0x5b14('0x4a')](_[_0x5b14('0x4b')](_0x3cc5c9[_0x5b14('0x40')],_0x153e13[_0x5b14('0x4a')]));if(_0x3cc5c9[_0x5b14('0x40')][_0x5b14('0x32')]){_0x2ba380[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x2ba380[_0x5b14('0x49')],{'$or':_[_0x5b14('0x4d')](_0x2ba380[_0x5b14('0x43')],function(_0x2d71f9){var _0x5a922c={};_0x5a922c[_0x2d71f9]={'$like':'%'+_0x3cc5c9[_0x5b14('0x40')][_0x5b14('0x32')]+'%'};return _0x5a922c;})});}_0x2ba380=_[_0x5b14('0x4c')]({},_0x2ba380,_0x3cc5c9[_0x5b14('0x4f')]);return _0xe91d22[_0x5b14('0x9a')](_0x2ba380);}})[_0x5b14('0x2b')](function(_0x2bde64){if(_0x2bde64){_0x4c1d06=_0x2bde64['length'];if(!_0x3cc5c9[_0x5b14('0x40')]['hasOwnProperty'](_0x5b14('0x66'))){_0x2ba380[_0x5b14('0x24')]=qs[_0x5b14('0x24')](_0x3cc5c9[_0x5b14('0x40')][_0x5b14('0x24')]);_0x2ba380['offset']=qs[_0x5b14('0x22')](_0x3cc5c9[_0x5b14('0x40')]['offset']);}return _0xe91d22[_0x5b14('0x9a')](_0x2ba380);}})[_0x5b14('0x2b')](function(_0x57d4cc){if(_0x57d4cc){return _0x57d4cc?{'count':_0x4c1d06,'rows':_0x57d4cc}:null;}})[_0x5b14('0x2b')](respondWithResult(_0x1a97cd,null))[_0x5b14('0x54')](handleError(_0x1a97cd,null));};exports[_0x5b14('0x9c')]=function(_0x2d53a0,_0x5e1a59,_0x1c0285){var _0x17e499=moment()[_0x5b14('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x229f7c,_0x1bbec3;return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x2d53a0[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x5e1a59,null))[_0x5b14('0x2b')](function(_0x3377f0){if(_0x3377f0){_0x1bbec3=_0x3377f0;return _0x3377f0['addLists'](_0x2d53a0['body'][_0x5b14('0x82')],_['omit'](_0x2d53a0[_0x5b14('0x57')],[_0x5b14('0x82'),'id'])||{});}return null;})[_0x5b14('0x9d')](function(_0x6dd6e){var _0x14506e;_0x229f7c=_0x6dd6e||[];var _0x5c4f75=[];if(_0x6dd6e){for(var _0x2ea76a=0x0;_0x2ea76a<_0x6dd6e[_0x5b14('0x45')];_0x2ea76a+=0x1){var _0x33c3d5=_0x6dd6e[_0x2ea76a][_0x5b14('0x2d')]({'plain':!![]});_0x1bbec3[_0x5b14('0x9e')]=_0x2d53a0[_0x5b14('0x57')][_0x5b14('0x9e')]?_0x2d53a0[_0x5b14('0x57')]['dialCheckDuplicateType']:_0x1bbec3['dialCheckDuplicateType'];switch(_0x1bbec3[_0x5b14('0x9e')]){case'always':_0x14506e=squel[_0x5b14('0x9f')]()['into']('cm_hopper')['fromQuery'](['phone',_0x5b14('0xa0'),'ContactId',_0x5b14('0xa1'),_0x5b14('0x67'),'createdAt',_0x5b14('0x62')],squel[_0x5b14('0x83')]()['field']('phone',_0x5b14('0xa2'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0xa0'))[_0x5b14('0x84')]('id','ContactId')[_0x5b14('0x84')](_0x33c3d5[_0x5b14('0xa3')][_0x5b14('0x8d')](),_0x5b14('0xa1'))[_0x5b14('0x84')](_0x2d53a0[_0x5b14('0x5f')]['id'][_0x5b14('0x8d')](),_0x5b14('0x67'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x61'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x62'))[_0x5b14('0x86')](_0x5b14('0xa4'))[_0x5b14('0x49')]('deletedAt\x20IS\x20NULL')[_0x5b14('0x49')](_0x5b14('0xa5'),_0x33c3d5[_0x5b14('0xa3')][_0x5b14('0x8d')]())[_0x5b14('0x49')](_0x5b14('0xa6'))['where'](_0x5b14('0xa7'),squel['select']()[_0x5b14('0x84')]('COALESCE(calleridnum,\x27\x27)')[_0x5b14('0x86')](_0x5b14('0xa8'))[_0x5b14('0x49')](_0x5b14('0x8a'),_0x2d53a0[_0x5b14('0x5f')]['id'][_0x5b14('0x8d')]()))[_0x5b14('0x49')](_0x5b14('0xa7'),squel[_0x5b14('0x83')]()[_0x5b14('0x84')](_0x5b14('0xa9'))[_0x5b14('0x86')](_0x5b14('0xaa'))[_0x5b14('0x49')](_0x5b14('0x8a'),_0x2d53a0[_0x5b14('0x5f')]['id'][_0x5b14('0x8d')]())))[_0x5b14('0x8d')]();break;case _0x5b14('0xab'):_0x14506e=squel[_0x5b14('0x9f')]()[_0x5b14('0xac')]('cm_hopper')[_0x5b14('0xad')]([_0x5b14('0xa2'),_0x5b14('0xa0'),_0x5b14('0xae'),_0x5b14('0xa1'),_0x5b14('0x67'),_0x5b14('0x61'),'updatedAt'],squel[_0x5b14('0x83')]()[_0x5b14('0x84')](_0x5b14('0xa2'),_0x5b14('0xa2'))['field']('\x27'+_0x17e499+'\x27',_0x5b14('0xa0'))[_0x5b14('0x84')]('id','ContactId')[_0x5b14('0x84')](_0x33c3d5[_0x5b14('0xa3')][_0x5b14('0x8d')](),_0x5b14('0xa1'))['field'](_0x2d53a0[_0x5b14('0x5f')]['id'][_0x5b14('0x8d')](),_0x5b14('0x67'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27','createdAt')[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x62'))[_0x5b14('0x86')]('cm_contacts')['where'](_0x5b14('0xaf'))['where'](_0x5b14('0xa5'),_0x33c3d5['CmListId'][_0x5b14('0x8d')]())[_0x5b14('0x49')](_0x5b14('0xa6'))[_0x5b14('0x49')](_0x5b14('0xa7'),squel[_0x5b14('0x83')]()[_0x5b14('0x84')](_0x5b14('0xa9'))[_0x5b14('0x86')](_0x5b14('0xaa'))[_0x5b14('0x49')]('VoiceQueueId\x20=\x20?',_0x2d53a0[_0x5b14('0x5f')]['id'][_0x5b14('0x8d')]())))[_0x5b14('0x8d')]();break;default:_0x14506e=squel[_0x5b14('0x9f')]()[_0x5b14('0xac')](_0x5b14('0xaa'))['fromQuery']([_0x5b14('0xa2'),_0x5b14('0xa0'),_0x5b14('0xae'),_0x5b14('0xa1'),'VoiceQueueId',_0x5b14('0x61'),_0x5b14('0x62')],squel['select']()[_0x5b14('0x84')](_0x5b14('0xa2'),'phone')[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0xa0'))[_0x5b14('0x84')]('id',_0x5b14('0xae'))[_0x5b14('0x84')](_0x33c3d5['CmListId'][_0x5b14('0x8d')](),_0x5b14('0xa1'))['field'](_0x2d53a0[_0x5b14('0x5f')]['id'][_0x5b14('0x8d')](),_0x5b14('0x67'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x61'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x62'))['from']('cm_contacts')[_0x5b14('0x49')]('deletedAt\x20IS\x20NULL')[_0x5b14('0x49')](_0x5b14('0xa5'),_0x33c3d5[_0x5b14('0xa3')][_0x5b14('0x8d')]())['where'](_0x5b14('0xa6')))[_0x5b14('0x8d')]();}_0x5c4f75['push'](db[_0x5b14('0x76')]['query'](_0x14506e));}return BPromise[_0x5b14('0xb0')](_0x5c4f75);}})[_0x5b14('0x2b')](function(){var _0x3c999e=[];var _0x420503=squel[_0x5b14('0x9f')]()[_0x5b14('0xac')](_0x5b14('0xb1'))[_0x5b14('0xad')]([_0x5b14('0xb2'),_0x5b14('0xa2'),_0x5b14('0xb3'),'createdAt',_0x5b14('0x62')],squel[_0x5b14('0x83')]()[_0x5b14('0x84')]('h.id')[_0x5b14('0x84')](_0x5b14('0xb4'))[_0x5b14('0x84')](_0x5b14('0xb5'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x61'))[_0x5b14('0x84')]('\x27'+_0x17e499+'\x27',_0x5b14('0x62'))[_0x5b14('0x86')]('cm_contact_has_items','ci')[_0x5b14('0x88')]('cm_hopper','h',_0x5b14('0xb6'))[_0x5b14('0x49')](_0x5b14('0xb7'),_0x17e499)[_0x5b14('0x49')]('ci.ItemClass=?','PHONE'))[_0x5b14('0x8d')]();_0x3c999e[_0x5b14('0x8c')](db[_0x5b14('0x76')][_0x5b14('0x40')](_0x420503));return BPromise['all'](_0x3c999e);})[_0x5b14('0x2b')](function(){return _0x229f7c;})[_0x5b14('0x2b')](respondWithResult(_0x5e1a59,null))['catch'](handleError(_0x5e1a59,null));};exports[_0x5b14('0xb8')]=function(_0x524bd8,_0x3b994c,_0x3e47b6){return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x524bd8['params']['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x3b994c,null))['then'](function(_0x2444c3){if(_0x2444c3){return _0x2444c3[_0x5b14('0xb8')](_0x524bd8[_0x5b14('0x40')][_0x5b14('0x82')]);}})['then'](function(_0x2bccd8){if(_0x2bccd8){return db['CmHopper']['destroy']({'where':{'ListId':_0x524bd8[_0x5b14('0x40')][_0x5b14('0x82')],'VoiceQueueId':_0x524bd8[_0x5b14('0x5f')]['id']}})['then'](function(){return _0x2bccd8;});}})['then'](respondWithStatusCode(_0x3b994c,null))[_0x5b14('0x54')](handleError(_0x3b994c,null));};exports['getBlackLists']=function(_0x3dba10,_0x2cef4c,_0x2d5734){var _0x25e299={};var _0x2ce603={};var _0x27bef0;var _0x239483;return db[_0x5b14('0x3b')][_0x5b14('0x65')]({'where':{'id':_0x3dba10[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x2cef4c,null))['then'](function(_0x13b5ea){if(_0x13b5ea){_0x27bef0=_0x13b5ea;_0x2ce603[_0x5b14('0x3f')]=_[_0x5b14('0x41')](db['CmList'][_0x5b14('0x3c')]);_0x2ce603[_0x5b14('0x40')]=_[_0x5b14('0x41')](_0x3dba10[_0x5b14('0x40')]);_0x2ce603['filters']=_['intersection'](_0x2ce603[_0x5b14('0x3f')],_0x2ce603[_0x5b14('0x40')]);_0x25e299[_0x5b14('0x43')]=_['intersection'](_0x2ce603[_0x5b14('0x3f')],qs['fields'](_0x3dba10['query'][_0x5b14('0x44')]));_0x25e299[_0x5b14('0x43')]=_0x25e299[_0x5b14('0x43')][_0x5b14('0x45')]?_0x25e299[_0x5b14('0x43')]:_0x2ce603['model'];_0x25e299['order']=qs['sort'](_0x3dba10[_0x5b14('0x40')][_0x5b14('0x48')]);_0x25e299[_0x5b14('0x49')]=qs['filters'](_['pick'](_0x3dba10['query'],_0x2ce603['filters']));if(_0x3dba10[_0x5b14('0x40')][_0x5b14('0x32')]){_0x25e299[_0x5b14('0x49')]=_[_0x5b14('0x4c')](_0x25e299['where'],{'$or':_[_0x5b14('0x4d')](_0x25e299[_0x5b14('0x43')],function(_0x4d50b4){var _0xc3e48c={};_0xc3e48c[_0x4d50b4]={'$like':'%'+_0x3dba10[_0x5b14('0x40')][_0x5b14('0x32')]+'%'};return _0xc3e48c;})});}_0x25e299=_['merge']({},_0x25e299,_0x3dba10[_0x5b14('0x4f')]);return _0x27bef0['getBlackLists'](_0x25e299);}})[_0x5b14('0x2b')](function(_0x3745d3){if(_0x3745d3){_0x239483=_0x3745d3[_0x5b14('0x45')];if(!_0x3dba10['query'][_0x5b14('0x46')]('nolimit')){_0x25e299[_0x5b14('0x24')]=qs[_0x5b14('0x24')](_0x3dba10['query']['limit']);_0x25e299['offset']=qs['offset'](_0x3dba10[_0x5b14('0x40')]['offset']);}return _0x27bef0[_0x5b14('0xb9')](_0x25e299);}})[_0x5b14('0x2b')](function(_0x559423){if(_0x559423){return _0x559423?{'count':_0x239483,'rows':_0x559423}:null;}})[_0x5b14('0x2b')](respondWithResult(_0x2cef4c,null))[_0x5b14('0x54')](handleError(_0x2cef4c,null));};exports['addBlackLists']=function(_0x431305,_0x535fea,_0x566dbc){var _0x3954bd,_0x5e0a50;return db[_0x5b14('0x3b')]['find']({'where':{'id':_0x431305[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x535fea,null))[_0x5b14('0x2b')](function(_0x1be98d){if(_0x1be98d){_0x5e0a50=_0x1be98d;return _0x1be98d['addBlackLists'](_0x431305[_0x5b14('0x57')][_0x5b14('0x82')],_[_0x5b14('0x60')](_0x431305[_0x5b14('0x57')],[_0x5b14('0x82'),'id'])||{});}return null;})[_0x5b14('0x9d')](function(_0x127dfa){var _0x196f9a;_0x3954bd=_0x127dfa||[];var _0x503119=[];if(_0x127dfa){for(var _0x4958fb=0x0;_0x4958fb<_0x127dfa[_0x5b14('0x45')];_0x4958fb+=0x1){var _0x57e961=_0x127dfa[_0x4958fb][_0x5b14('0x2d')]({'plain':!![]});_0x196f9a=squel['insert']()[_0x5b14('0xac')](_0x5b14('0xba'))[_0x5b14('0xad')]([_0x5b14('0xa2'),_0x5b14('0xae'),_0x5b14('0xa1'),'VoiceQueueId',_0x5b14('0x61'),_0x5b14('0x62')],squel['select']()[_0x5b14('0x84')](_0x5b14('0xa2'),_0x5b14('0xa2'))[_0x5b14('0x84')]('id',_0x5b14('0xae'))[_0x5b14('0x84')](_0x57e961[_0x5b14('0xa3')][_0x5b14('0x8d')](),_0x5b14('0xa1'))[_0x5b14('0x84')](_0x431305['params']['id']['toString'](),_0x5b14('0x67'))['field'](_0x5b14('0xbb'),_0x5b14('0x61'))['field']('NOW()',_0x5b14('0x62'))[_0x5b14('0x86')](_0x5b14('0xa4'))[_0x5b14('0x49')]('deletedAt\x20IS\x20NULL')[_0x5b14('0x49')](_0x5b14('0xa5'),_0x57e961['CmListId']['toString']())[_0x5b14('0x49')](_0x5b14('0xa6')))[_0x5b14('0x8d')]();_0x503119[_0x5b14('0x8c')](db[_0x5b14('0x76')][_0x5b14('0x40')](_0x196f9a));}return BPromise[_0x5b14('0xb0')](_0x503119);}})[_0x5b14('0x2b')](function(){return _0x3954bd;})[_0x5b14('0x2b')](respondWithResult(_0x535fea,null))[_0x5b14('0x54')](handleError(_0x535fea,null));};exports['removeBlackLists']=function(_0x3036cd,_0x40cc48,_0x234d53){return db[_0x5b14('0x3b')][_0x5b14('0x35')]({'where':{'id':_0x3036cd['params']['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x40cc48,null))[_0x5b14('0x2b')](function(_0x208341){if(_0x208341){return _0x208341[_0x5b14('0xbc')](_0x3036cd[_0x5b14('0x40')][_0x5b14('0x82')]);}})['then'](function(_0x45aa07){if(_0x45aa07){return db[_0x5b14('0x6b')][_0x5b14('0x2c')]({'where':{'ListId':_0x3036cd['query'][_0x5b14('0x82')],'VoiceQueueId':_0x3036cd[_0x5b14('0x5f')]['id']}})[_0x5b14('0x2b')](function(){return _0x45aa07;});}})[_0x5b14('0x2b')](respondWithStatusCode(_0x40cc48,null))[_0x5b14('0x54')](handleError(_0x40cc48,null));};
\ No newline at end of file
index 88cd922..053f73f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1347=['save','update','remove','emit','hook','events','VoiceQueue','setMaxListeners'];(function(_0x53317c,_0x5dee5e){var _0x2900b9=function(_0x570b24){while(--_0x570b24){_0x53317c['push'](_0x53317c['shift']());}};_0x2900b9(++_0x5dee5e);}(_0x1347,0x1c5));var _0x7134=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x1347[_0x202c61];return _0x540691;};'use strict';var EventEmitter=require(_0x7134('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x7134('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7134('0x2')](0x0);var events={'afterCreate':_0x7134('0x3'),'afterUpdate':_0x7134('0x4'),'afterDestroy':_0x7134('0x5')};function emitEvent(_0x20eaf7){return function(_0x26b2f8,_0x2d21ab,_0x38b5e3){VoiceQueueEvents[_0x7134('0x6')](_0x20eaf7+':'+_0x26b2f8['id'],_0x26b2f8);VoiceQueueEvents[_0x7134('0x6')](_0x20eaf7,_0x26b2f8);_0x38b5e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x7134('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0x64d9=['../../mysqldb','VoiceQueue','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x64d9,0x15f));var _0x964d=function(_0x607c04,_0x40d577){_0x607c04=_0x607c04-0x0;var _0xf409c8=_0x64d9[_0x607c04];return _0xf409c8;};'use strict';var EventEmitter=require(_0x964d('0x0'));var VoiceQueue=require(_0x964d('0x1'))['db'][_0x964d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x964d('0x3')};function emitEvent(_0x5450b9){return function(_0x3f366a,_0x4dcb03,_0x5a04a9){VoiceQueueEvents[_0x964d('0x4')](_0x5450b9+':'+_0x3f366a['id'],_0x3f366a);VoiceQueueEvents[_0x964d('0x4')](_0x5450b9,_0x3f366a);_0x5a04a9(null);};}for(var e in events){if(events[_0x964d('0x5')](e)){var event=events[e];VoiceQueue[_0x964d('0x6')](e,emitEvent(event));}}module[_0x964d('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 8e08a8f..03385d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x34583f,_0x8f536f){var _0x292a98=function(_0x4cfdc3){while(--_0x4cfdc3){_0x34583f['push'](_0x34583f['shift']());}};_0x292a98(++_0x8f536f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xacf124,_0x10ab52){var _0x471c60=function(_0xaaa4d){while(--_0xaaa4d){_0xacf124['push'](_0xacf124['shift']());}};_0x471c60(++_0x10ab52);}(_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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c249389..652d2b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x875a=['debug','ShowVoiceQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1200e9,_0x5ad571){var _0x4d4fff=function(_0xe9f7ab){while(--_0xe9f7ab){_0x1200e9['push'](_0x1200e9['shift']());}};_0x4d4fff(++_0x5ad571);}(_0x875a,0x7b));var _0xa875=function(_0x4438b9,_0x3981e4){_0x4438b9=_0x4438b9-0x0;var _0x1ccbd6=_0x875a[_0x4438b9];return _0x1ccbd6;};'use strict';var _=require(_0xa875('0x0'));var util=require(_0xa875('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa875('0x2'));var fs=require('fs');var Redis=require(_0xa875('0x3'));var db=require(_0xa875('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa875('0x5'))('rpc');var config=require(_0xa875('0x6'));var jayson=require(_0xa875('0x7'));var client=jayson[_0xa875('0x8')][_0xa875('0x9')]({'port':0x232a});config['redis']=_[_0xa875('0xa')](config['redis'],{'host':_0xa875('0xb'),'port':0x18eb});var socket=require(_0xa875('0xc'))(new Redis(config[_0xa875('0xd')]));require(_0xa875('0xe'))[_0xa875('0xf')](socket);function respondWithRpcPromise(_0x41fe5e,_0x365d39,_0x4ac2ab){return new BPromise(function(_0x4235b7,_0x15a3ab){return client[_0xa875('0x10')](_0x41fe5e,_0x4ac2ab)[_0xa875('0x11')](function(_0x5d1da6){logger[_0xa875('0x12')](_0xa875('0x13'),_0x365d39,'request\x20sent');logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x365d39,_0xa875('0x14'),JSON[_0xa875('0x15')](_0x5d1da6));if(_0x5d1da6[_0xa875('0x16')]){if(_0x5d1da6[_0xa875('0x16')][_0xa875('0x17')]===0x1f4){logger[_0xa875('0x16')](_0xa875('0x13'),_0x365d39,_0x5d1da6[_0xa875('0x16')][_0xa875('0x18')]);return _0x15a3ab(_0x5d1da6[_0xa875('0x16')]['message']);}logger[_0xa875('0x16')](_0xa875('0x13'),_0x365d39,_0x5d1da6[_0xa875('0x16')][_0xa875('0x18')]);return _0x4235b7(_0x5d1da6[_0xa875('0x16')][_0xa875('0x18')]);}else{logger[_0xa875('0x12')](_0xa875('0x13'),_0x365d39,'request\x20sent');_0x4235b7(_0x5d1da6['result'][_0xa875('0x18')]);}})[_0xa875('0x19')](function(_0x3aedb3){logger[_0xa875('0x16')](_0xa875('0x13'),_0x365d39,_0x3aedb3);_0x15a3ab(_0x3aedb3);});});}exports[_0xa875('0x1a')]=function(_0x387385){var _0x114604=this;return new Promise(function(_0x23f4c0,_0x274a10){return db[_0xa875('0x1b')][_0xa875('0x1c')]({'raw':_0x387385['options']?_0x387385[_0xa875('0x1d')][_0xa875('0x1e')]===undefined?!![]:![]:!![],'where':_0x387385['options']?_0x387385[_0xa875('0x1d')][_0xa875('0x1f')]||null:null,'attributes':_0x387385[_0xa875('0x1d')]?_0x387385[_0xa875('0x1d')][_0xa875('0x20')]||null:null,'limit':_0x387385['options']?_0x387385[_0xa875('0x1d')][_0xa875('0x21')]||null:null,'include':_0x387385[_0xa875('0x1d')]?_0x387385['options'][_0xa875('0x22')]?_[_0xa875('0x23')](_0x387385[_0xa875('0x1d')]['include'],function(_0x5abd93){return{'model':db[_0x5abd93[_0xa875('0x24')]],'as':_0x5abd93['as'],'attributes':_0x5abd93['attributes'],'include':_0x5abd93[_0xa875('0x22')]?_[_0xa875('0x23')](_0x5abd93[_0xa875('0x22')],function(_0x38ae3a){return{'model':db[_0x38ae3a[_0xa875('0x24')]],'as':_0x38ae3a['as'],'attributes':_0x38ae3a[_0xa875('0x20')],'include':_0x38ae3a[_0xa875('0x22')]?_[_0xa875('0x23')](_0x38ae3a[_0xa875('0x22')],function(_0x44035f){return{'model':db[_0x44035f[_0xa875('0x24')]],'as':_0x44035f['as'],'attributes':_0x44035f[_0xa875('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa875('0x11')](function(_0x53f8f1){logger[_0xa875('0x12')](_0xa875('0x1a'),_0x387385);logger[_0xa875('0x25')](_0xa875('0x1a'),_0x387385,JSON[_0xa875('0x15')](_0x53f8f1));_0x23f4c0(_0x53f8f1);})[_0xa875('0x19')](function(_0x2e08df){logger['error']('GetVoiceQueue',_0x2e08df[_0xa875('0x18')],_0x387385);_0x274a10(_0x114604[_0xa875('0x16')](0x1f4,_0x2e08df[_0xa875('0x18')]));});});};exports[_0xa875('0x26')]=function(_0x5248f3){var _0x3770dc=this;return new Promise(function(_0xaf18c,_0x3ba7c0){return db[_0xa875('0x1b')][_0xa875('0x27')]({'raw':_0x5248f3[_0xa875('0x1d')]?_0x5248f3[_0xa875('0x1d')][_0xa875('0x1e')]===undefined?!![]:![]:!![],'where':_0x5248f3[_0xa875('0x1d')]?_0x5248f3[_0xa875('0x1d')][_0xa875('0x1f')]||null:null,'attributes':_0x5248f3[_0xa875('0x1d')]?_0x5248f3[_0xa875('0x1d')][_0xa875('0x20')]||null:null,'include':_0x5248f3[_0xa875('0x1d')]?_0x5248f3[_0xa875('0x1d')][_0xa875('0x22')]?_[_0xa875('0x23')](_0x5248f3[_0xa875('0x1d')][_0xa875('0x22')],function(_0x4d6761){return{'model':db[_0x4d6761[_0xa875('0x24')]],'as':_0x4d6761['as'],'attributes':_0x4d6761[_0xa875('0x20')],'include':_0x4d6761[_0xa875('0x22')]?_['map'](_0x4d6761[_0xa875('0x22')],function(_0x388757){return{'model':db[_0x388757[_0xa875('0x24')]],'as':_0x388757['as'],'attributes':_0x388757[_0xa875('0x20')],'include':_0x388757['include']?_['map'](_0x388757[_0xa875('0x22')],function(_0xe10adb){return{'model':db[_0xe10adb[_0xa875('0x24')]],'as':_0xe10adb['as'],'attributes':_0xe10adb[_0xa875('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa875('0x11')](function(_0x5a0a71){logger['info'](_0xa875('0x26'),_0x5248f3);logger['debug'](_0xa875('0x26'),_0x5248f3,JSON[_0xa875('0x15')](_0x5a0a71));_0xaf18c(_0x5a0a71);})[_0xa875('0x19')](function(_0x53212e){logger[_0xa875('0x16')](_0xa875('0x26'),_0x53212e[_0xa875('0x18')],_0x5248f3);_0x3ba7c0(_0x3770dc[_0xa875('0x16')](0x1f4,_0x53212e['message']));});});};
\ No newline at end of file
+var _0x5bd6=['attributes','debug','ShowVoiceQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','model'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x5bd6,0xee));var _0x65bd=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x5bd6[_0xf9a6cf];return _0x59e2bc;};'use strict';var _=require('lodash');var util=require(_0x65bd('0x0'));var moment=require(_0x65bd('0x1'));var BPromise=require('bluebird');var rs=require(_0x65bd('0x2'));var fs=require('fs');var Redis=require(_0x65bd('0x3'));var db=require(_0x65bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65bd('0x5'))(_0x65bd('0x6'));var config=require(_0x65bd('0x7'));var jayson=require(_0x65bd('0x8'));var client=jayson[_0x65bd('0x9')][_0x65bd('0xa')]({'port':0x232a});config[_0x65bd('0xb')]=_['defaults'](config[_0x65bd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x65bd('0xc'))(new Redis(config['redis']));require(_0x65bd('0xd'))[_0x65bd('0xe')](socket);function respondWithRpcPromise(_0x36ceca,_0x396f7d,_0x30ccd1){return new BPromise(function(_0x160b64,_0x3e57cd){return client['request'](_0x36ceca,_0x30ccd1)[_0x65bd('0xf')](function(_0x55628e){logger[_0x65bd('0x10')](_0x65bd('0x11'),_0x396f7d,_0x65bd('0x12'));logger['debug'](_0x65bd('0x13'),_0x396f7d,'request\x20sent',JSON[_0x65bd('0x14')](_0x55628e));if(_0x55628e['error']){if(_0x55628e[_0x65bd('0x15')]['code']===0x1f4){logger[_0x65bd('0x15')](_0x65bd('0x11'),_0x396f7d,_0x55628e[_0x65bd('0x15')][_0x65bd('0x16')]);return _0x3e57cd(_0x55628e['error']['message']);}logger[_0x65bd('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x396f7d,_0x55628e[_0x65bd('0x15')][_0x65bd('0x16')]);return _0x160b64(_0x55628e[_0x65bd('0x15')]['message']);}else{logger[_0x65bd('0x10')](_0x65bd('0x11'),_0x396f7d,'request\x20sent');_0x160b64(_0x55628e[_0x65bd('0x17')][_0x65bd('0x16')]);}})[_0x65bd('0x18')](function(_0x10912a){logger[_0x65bd('0x15')](_0x65bd('0x11'),_0x396f7d,_0x10912a);_0x3e57cd(_0x10912a);});});}exports[_0x65bd('0x19')]=function(_0x32ce83){var _0x575232=this;return new Promise(function(_0x407b67,_0x9ae135){return db[_0x65bd('0x1a')][_0x65bd('0x1b')]({'raw':_0x32ce83[_0x65bd('0x1c')]?_0x32ce83[_0x65bd('0x1c')][_0x65bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x32ce83[_0x65bd('0x1c')]?_0x32ce83[_0x65bd('0x1c')][_0x65bd('0x1e')]||null:null,'attributes':_0x32ce83[_0x65bd('0x1c')]?_0x32ce83[_0x65bd('0x1c')]['attributes']||null:null,'limit':_0x32ce83[_0x65bd('0x1c')]?_0x32ce83[_0x65bd('0x1c')][_0x65bd('0x1f')]||null:null,'include':_0x32ce83['options']?_0x32ce83[_0x65bd('0x1c')][_0x65bd('0x20')]?_[_0x65bd('0x21')](_0x32ce83[_0x65bd('0x1c')][_0x65bd('0x20')],function(_0x340916){return{'model':db[_0x340916[_0x65bd('0x22')]],'as':_0x340916['as'],'attributes':_0x340916[_0x65bd('0x23')],'include':_0x340916[_0x65bd('0x20')]?_[_0x65bd('0x21')](_0x340916[_0x65bd('0x20')],function(_0x3feb85){return{'model':db[_0x3feb85[_0x65bd('0x22')]],'as':_0x3feb85['as'],'attributes':_0x3feb85[_0x65bd('0x23')],'include':_0x3feb85[_0x65bd('0x20')]?_[_0x65bd('0x21')](_0x3feb85[_0x65bd('0x20')],function(_0x417215){return{'model':db[_0x417215[_0x65bd('0x22')]],'as':_0x417215['as'],'attributes':_0x417215['attributes']};}):[]};}):[]};}):[]:[]})[_0x65bd('0xf')](function(_0x2ec39e){logger[_0x65bd('0x10')](_0x65bd('0x19'),_0x32ce83);logger[_0x65bd('0x24')](_0x65bd('0x19'),_0x32ce83,JSON['stringify'](_0x2ec39e));_0x407b67(_0x2ec39e);})[_0x65bd('0x18')](function(_0x279f37){logger['error'](_0x65bd('0x19'),_0x279f37[_0x65bd('0x16')],_0x32ce83);_0x9ae135(_0x575232[_0x65bd('0x15')](0x1f4,_0x279f37['message']));});});};exports[_0x65bd('0x25')]=function(_0x5cf309){var _0x4b8992=this;return new Promise(function(_0x4c417b,_0x55d986){return db['VoiceQueue'][_0x65bd('0x26')]({'raw':_0x5cf309[_0x65bd('0x1c')]?_0x5cf309['options'][_0x65bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cf309['options']?_0x5cf309['options'][_0x65bd('0x1e')]||null:null,'attributes':_0x5cf309['options']?_0x5cf309[_0x65bd('0x1c')][_0x65bd('0x23')]||null:null,'include':_0x5cf309['options']?_0x5cf309[_0x65bd('0x1c')][_0x65bd('0x20')]?_['map'](_0x5cf309[_0x65bd('0x1c')][_0x65bd('0x20')],function(_0x1d2717){return{'model':db[_0x1d2717['model']],'as':_0x1d2717['as'],'attributes':_0x1d2717[_0x65bd('0x23')],'include':_0x1d2717[_0x65bd('0x20')]?_[_0x65bd('0x21')](_0x1d2717[_0x65bd('0x20')],function(_0x163c58){return{'model':db[_0x163c58['model']],'as':_0x163c58['as'],'attributes':_0x163c58[_0x65bd('0x23')],'include':_0x163c58[_0x65bd('0x20')]?_[_0x65bd('0x21')](_0x163c58[_0x65bd('0x20')],function(_0x5d4921){return{'model':db[_0x5d4921[_0x65bd('0x22')]],'as':_0x5d4921['as'],'attributes':_0x5d4921[_0x65bd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x65bd('0xf')](function(_0x363c91){logger[_0x65bd('0x10')]('ShowVoiceQueue',_0x5cf309);logger[_0x65bd('0x24')](_0x65bd('0x25'),_0x5cf309,JSON[_0x65bd('0x14')](_0x363c91));_0x4c417b(_0x363c91);})[_0x65bd('0x18')](function(_0xe8bbdc){logger[_0x65bd('0x15')](_0x65bd('0x25'),_0xe8bbdc['message'],_0x5cf309);_0x55d986(_0x4b8992['error'](0x1f4,_0xe8bbdc[_0x65bd('0x16')]));});});};
\ No newline at end of file
index a7def81..a5e6112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca1d=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update'];(function(_0x1e09a8,_0x2b2573){var _0x35d08f=function(_0xdce7e8){while(--_0xdce7e8){_0x1e09a8['push'](_0x1e09a8['shift']());}};_0x35d08f(++_0x2b2573);}(_0xca1d,0x1e6));var _0xdca1=function(_0x491cb5,_0x2eabfb){_0x491cb5=_0x491cb5-0x0;var _0x269531=_0xca1d[_0x491cb5];return _0x269531;};'use strict';var VoiceQueueEvents=require(_0xdca1('0x0'));var events=[_0xdca1('0x1'),_0xdca1('0x2'),_0xdca1('0x3')];function createListener(_0x110a12,_0x41f79d){return function(_0x3b9f8f){_0x41f79d['emit'](_0x110a12,_0x3b9f8f);};}function removeListener(_0x2328fb,_0x34e036){return function(){VoiceQueueEvents['removeListener'](_0x2328fb,_0x34e036);};}exports[_0xdca1('0x4')]=function(_0x257083){for(var _0x1a0cec=0x0,_0x4de495=events[_0xdca1('0x5')];_0x1a0cec<_0x4de495;_0x1a0cec++){var _0x124ced=events[_0x1a0cec];var _0x43f029=createListener(_0xdca1('0x6')+_0x124ced,_0x257083);VoiceQueueEvents['on'](_0x124ced,_0x43f029);}};
\ No newline at end of file
+var _0x1634=['register','length','./voiceQueue.events','remove','update','emit','removeListener'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x1634,0x6b));var _0x4163=function(_0x28a0ef,_0x4478fc){_0x28a0ef=_0x28a0ef-0x0;var _0x51b48d=_0x1634[_0x28a0ef];return _0x51b48d;};'use strict';var VoiceQueueEvents=require(_0x4163('0x0'));var events=['save',_0x4163('0x1'),_0x4163('0x2')];function createListener(_0x4d0399,_0x5dc637){return function(_0x3fe8ba){_0x5dc637[_0x4163('0x3')](_0x4d0399,_0x3fe8ba);};}function removeListener(_0x139539,_0x3f268f){return function(){VoiceQueueEvents[_0x4163('0x4')](_0x139539,_0x3f268f);};}exports[_0x4163('0x5')]=function(_0x717e1e){for(var _0x5eab44=0x0,_0x5e6cc2=events[_0x4163('0x6')];_0x5eab44<_0x5e6cc2;_0x5eab44++){var _0x2b3735=events[_0x5eab44];var _0x436b7f=createListener('voiceQueue:'+_0x2b3735,_0x717e1e);VoiceQueueEvents['on'](_0x2b3735,_0x436b7f);}};
\ No newline at end of file
index c698a7a..c3109ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25cd=['get','isAuthenticated','index','describe','getVoiceQueuesReport','show','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25cd,0x97));var _0xd25c=function(_0x290c31,_0x534b8a){_0x290c31=_0x290c31-0x0;var _0x2eb0ac=_0x25cd[_0x290c31];return _0x2eb0ac;};'use strict';var multer=require(_0xd25c('0x0'));var util=require(_0xd25c('0x1'));var path=require('path');var timeout=require(_0xd25c('0x2'));var express=require(_0xd25c('0x3'));var router=express[_0xd25c('0x4')]();var fs_extra=require(_0xd25c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd25c('0x6'));var config=require(_0xd25c('0x7'));var controller=require(_0xd25c('0x8'));router[_0xd25c('0x9')]('/',auth[_0xd25c('0xa')](),controller[_0xd25c('0xb')]);router[_0xd25c('0x9')]('/describe',auth[_0xd25c('0xa')](),controller[_0xd25c('0xc')]);router[_0xd25c('0x9')]('/index',auth[_0xd25c('0xa')](),controller[_0xd25c('0xd')]);router[_0xd25c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd25c('0xe')]);router[_0xd25c('0xf')]('/',auth[_0xd25c('0xa')](),controller['create']);router[_0xd25c('0x10')]('/:id',auth[_0xd25c('0xa')](),controller[_0xd25c('0x11')]);router[_0xd25c('0x12')]('/:id',auth[_0xd25c('0xa')](),controller['destroy']);module[_0xd25c('0x13')]=router;
\ No newline at end of file
+var _0x0389=['/:id','create','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport'];(function(_0x1863be,_0x3fb18f){var _0x5835e1=function(_0xaa0e92){while(--_0xaa0e92){_0x1863be['push'](_0x1863be['shift']());}};_0x5835e1(++_0x3fb18f);}(_0x0389,0xc2));var _0x9038=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x0389[_0x186d17];return _0x5d4b89;};'use strict';var multer=require(_0x9038('0x0'));var util=require(_0x9038('0x1'));var path=require(_0x9038('0x2'));var timeout=require(_0x9038('0x3'));var express=require(_0x9038('0x4'));var router=express['Router']();var fs_extra=require(_0x9038('0x5'));var auth=require(_0x9038('0x6'));var interaction=require(_0x9038('0x7'));var config=require('../../config/environment');var controller=require(_0x9038('0x8'));router[_0x9038('0x9')]('/',auth['isAuthenticated'](),controller[_0x9038('0xa')]);router[_0x9038('0x9')](_0x9038('0xb'),auth[_0x9038('0xc')](),controller[_0x9038('0xd')]);router[_0x9038('0x9')](_0x9038('0xe'),auth['isAuthenticated'](),controller[_0x9038('0xf')]);router['get'](_0x9038('0x10'),auth[_0x9038('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9038('0x11')]);router[_0x9038('0x12')](_0x9038('0x10'),auth[_0x9038('0xc')](),controller['update']);router[_0x9038('0x13')](_0x9038('0x10'),auth[_0x9038('0xc')](),controller[_0x9038('0x14')]);module['exports']=router;
\ No newline at end of file
index 410ec11..0c7bcc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd263=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','INTEGER'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0xd263,0x183));var _0x3d26=function(_0x438034,_0x44c44e){_0x438034=_0x438034-0x0;var _0x3cab51=_0xd263[_0x438034];return _0x3cab51;};'use strict';var Sequelize=require(_0x3d26('0x0'));var moment=require(_0x3d26('0x1'));module['exports']={'type':{'type':Sequelize[_0x3d26('0x2')]},'uniqueid':{'type':Sequelize[_0x3d26('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3d26('0x2')]},'queue':{'type':Sequelize[_0x3d26('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x3d26('0x3')],'set':function(_0x3e9b8c){var _0x40ef76=moment(_0x3e9b8c);var _0x28bbe0=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x3d26('0x4'));var _0x1b66f7=_0x40ef76[_0x3d26('0x5')](_0x28bbe0,_0x3d26('0x6'));this[_0x3d26('0x7')]('queuecallerleaveAt',_0x3e9b8c);this[_0x3d26('0x7')]('holdtime',_0x1b66f7||null);}},'position':{'type':Sequelize[_0x3d26('0x8')]},'count':{'type':Sequelize[_0x3d26('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x3d26('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3d26('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3d26('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3d26('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3d26('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3d26('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3d26('0x8')]},'channel':{'type':Sequelize[_0x3d26('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3d26('0x2')]},'connectedlinename':{'type':Sequelize[_0x3d26('0x2')]},'accountcode':{'type':Sequelize[_0x3d26('0x2')]},'context':{'type':Sequelize[_0x3d26('0x2')]},'exten':{'type':Sequelize[_0x3d26('0x2')]},'priority':{'type':Sequelize[_0x3d26('0x2')]},'holdtime':{'type':Sequelize[_0x3d26('0x8')]},'mohtime':{'type':Sequelize[_0x3d26('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3d26('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3d26('0xa')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3d26('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x3d26('0x8')],'defaultValue':0x0},'note':{'type':Sequelize[_0x3d26('0x2')]}};
\ No newline at end of file
+var _0xbf8b=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xbf8b,0x8e));var _0xbbf8=function(_0x2ffaea,_0x20835e){_0x2ffaea=_0x2ffaea-0x0;var _0x2d512a=_0xbf8b[_0x2ffaea];return _0x2d512a;};'use strict';var Sequelize=require(_0xbbf8('0x0'));var moment=require('moment');module[_0xbbf8('0x1')]={'type':{'type':Sequelize[_0xbbf8('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbbf8('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbbf8('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xbbf8('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xbbf8('0x3')],'set':function(_0x5d377d){var _0x2a080e=moment(_0x5d377d);var _0x40caae=moment(this[_0xbbf8('0x4')](_0xbbf8('0x5')))[_0xbbf8('0x6')](_0xbbf8('0x7'));var _0x19212b=_0x2a080e[_0xbbf8('0x8')](_0x40caae,'seconds');this[_0xbbf8('0x9')]('queuecallerleaveAt',_0x5d377d);this[_0xbbf8('0x9')]('holdtime',_0x19212b||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xbbf8('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xbbf8('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xbbf8('0x3')]},'queuecallerexit':{'type':Sequelize[_0xbbf8('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbbf8('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xbbf8('0x2')],'comment':_0xbbf8('0xb')},'originalposition':{'type':Sequelize[_0xbbf8('0xc')]},'channel':{'type':Sequelize[_0xbbf8('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbbf8('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbbf8('0x2')]},'context':{'type':Sequelize[_0xbbf8('0x2')]},'exten':{'type':Sequelize[_0xbbf8('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xbbf8('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbbf8('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xbbf8('0x2')]},'transfer':{'type':Sequelize[_0xbbf8('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xbbf8('0xd')},'transferexten':{'type':Sequelize[_0xbbf8('0x2')]},'transferuniqueid':{'type':Sequelize[_0xbbf8('0x2')]},'disposition':{'type':Sequelize[_0xbbf8('0x2')]},'secondDisposition':{'type':Sequelize[_0xbbf8('0x2')]},'thirdDisposition':{'type':Sequelize[_0xbbf8('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xbbf8('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xbbf8('0x2')]}};
\ No newline at end of file
index 64bebe9..8448813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da7=['name','send','index','map','VoiceQueueReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','update','body','describe','getVoiceQueuesReport','filters','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','end','error','stack'];(function(_0x4dc4f5,_0x4af7a1){var _0x552672=function(_0x475a55){while(--_0x475a55){_0x4dc4f5['push'](_0x4dc4f5['shift']());}};_0x552672(++_0x4af7a1);}(_0x5da7,0xd3));var _0x75da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5da7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x75da('0x0'));var rimraf=require(_0x75da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75da('0x2'));var moment=require(_0x75da('0x3'));var BPromise=require(_0x75da('0x4'));var Mustache=require(_0x75da('0x5'));var util=require(_0x75da('0x6'));var path=require(_0x75da('0x7'));var sox=require(_0x75da('0x8'));var csv=require(_0x75da('0x9'));var ejs=require(_0x75da('0xa'));var fs=require('fs');var fs_extra=require(_0x75da('0xb'));var _=require(_0x75da('0xc'));var squel=require(_0x75da('0xd'));var crypto=require(_0x75da('0xe'));var jsforce=require(_0x75da('0xf'));var deskjs=require(_0x75da('0x10'));var toCsv=require(_0x75da('0x9'));var querystring=require('querystring');var Papa=require(_0x75da('0x11'));var Redis=require(_0x75da('0x12'));var authService=require(_0x75da('0x13'));var qs=require(_0x75da('0x14'));var as=require(_0x75da('0x15'));var hardwareService=require(_0x75da('0x16'));var logger=require(_0x75da('0x17'))(_0x75da('0x18'));var utils=require(_0x75da('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x75da('0x1a'));var db=require(_0x75da('0x1b'))['db'];config[_0x75da('0x1c')]=_[_0x75da('0x1d')](config[_0x75da('0x1c')],{'host':_0x75da('0x1e'),'port':0x18eb});var socket=require(_0x75da('0x1f'))(new Redis(config['redis']));require(_0x75da('0x20'))[_0x75da('0x21')](socket);function respondWithStatusCode(_0xdbd70d,_0x4bf6d6){_0x4bf6d6=_0x4bf6d6||0xcc;return function(_0x18a2b6){if(_0x18a2b6){return _0xdbd70d[_0x75da('0x22')](_0x4bf6d6);}return _0xdbd70d[_0x75da('0x23')](_0x4bf6d6)['end']();};}function respondWithResult(_0x3cb951,_0x10ed64){_0x10ed64=_0x10ed64||0xc8;return function(_0x401226){if(_0x401226){return _0x3cb951[_0x75da('0x23')](_0x10ed64)[_0x75da('0x24')](_0x401226);}};}function respondWithFilteredResult(_0x29d0b7,_0x3ae174){return function(_0x5177e1){if(_0x5177e1){var _0x57634d=typeof _0x3ae174[_0x75da('0x25')]===_0x75da('0x26')&&typeof _0x3ae174['limit']===_0x75da('0x26');var _0xc10710=_0x5177e1[_0x75da('0x27')];var _0x35651b=_0x57634d?0x0:_0x3ae174[_0x75da('0x25')];var _0x223285=_0x57634d?_0x5177e1[_0x75da('0x27')]:_0x3ae174[_0x75da('0x25')]+_0x3ae174[_0x75da('0x28')];var _0xd3eeb9;if(_0x223285>=_0xc10710){_0x223285=_0xc10710;_0xd3eeb9=0xc8;}else{_0xd3eeb9=0xce;}_0x29d0b7[_0x75da('0x23')](_0xd3eeb9);return _0x29d0b7[_0x75da('0x29')](_0x75da('0x2a'),_0x35651b+'-'+_0x223285+'/'+_0xc10710)[_0x75da('0x24')](_0x5177e1);}return null;};}function patchUpdates(_0x37b51b){return function(_0x1eec63){try{jsonpatch[_0x75da('0x2b')](_0x1eec63,_0x37b51b,!![]);}catch(_0x56ca30){return BPromise[_0x75da('0x2c')](_0x56ca30);}return _0x1eec63['save']();};}function saveUpdates(_0x48041a,_0x4dfa3c){return function(_0x346660){if(_0x346660){return _0x346660['update'](_0x48041a)['then'](function(_0x41fda2){return _0x41fda2;});}return null;};}function removeEntity(_0x546b10,_0x20f32b){return function(_0x120d75){if(_0x120d75){return _0x120d75[_0x75da('0x2d')]()[_0x75da('0x2e')](function(){_0x546b10[_0x75da('0x23')](0xcc)[_0x75da('0x2f')]();});}};}function handleEntityNotFound(_0x3e4ad7,_0x45b984){return function(_0x52f540){if(!_0x52f540){_0x3e4ad7[_0x75da('0x22')](0x194);}return _0x52f540;};}function handleError(_0x1a07f4,_0x3e304e){_0x3e304e=_0x3e304e||0x1f4;return function(_0x28b098){logger[_0x75da('0x30')](_0x28b098[_0x75da('0x31')]);if(_0x28b098[_0x75da('0x32')]){delete _0x28b098['name'];}_0x1a07f4[_0x75da('0x23')](_0x3e304e)[_0x75da('0x33')](_0x28b098);};}exports[_0x75da('0x34')]=function(_0x20deeb,_0x32b38e){var _0x431b4f={},_0x1f17a8={},_0x461c29={'count':0x0,'rows':[]};var _0x5108b0=_[_0x75da('0x35')](db[_0x75da('0x36')]['rawAttributes'],function(_0x87df09){return{'name':_0x87df09[_0x75da('0x37')],'type':_0x87df09['type'][_0x75da('0x38')]};});_0x1f17a8[_0x75da('0x39')]=_[_0x75da('0x35')](_0x5108b0,'name');_0x1f17a8[_0x75da('0x3a')]=_[_0x75da('0x3b')](_0x20deeb['query']);_0x1f17a8['filters']=_[_0x75da('0x3c')](_0x1f17a8['model'],_0x1f17a8[_0x75da('0x3a')]);_0x431b4f[_0x75da('0x3d')]=_[_0x75da('0x3c')](_0x1f17a8[_0x75da('0x39')],qs['fields'](_0x20deeb[_0x75da('0x3a')][_0x75da('0x3e')]));_0x431b4f[_0x75da('0x3d')]=_0x431b4f[_0x75da('0x3d')][_0x75da('0x3f')]?_0x431b4f[_0x75da('0x3d')]:_0x1f17a8['model'];if(!_0x20deeb[_0x75da('0x3a')][_0x75da('0x40')](_0x75da('0x41'))){_0x431b4f[_0x75da('0x28')]=qs[_0x75da('0x28')](_0x20deeb[_0x75da('0x3a')][_0x75da('0x28')]);_0x431b4f[_0x75da('0x25')]=qs[_0x75da('0x25')](_0x20deeb[_0x75da('0x3a')][_0x75da('0x25')]);}_0x431b4f[_0x75da('0x42')]=qs[_0x75da('0x43')](_0x20deeb[_0x75da('0x3a')][_0x75da('0x43')]);_0x431b4f[_0x75da('0x44')]=qs['filters'](_[_0x75da('0x45')](_0x20deeb['query'],_0x1f17a8['filters']),_0x5108b0);if(_0x20deeb[_0x75da('0x3a')][_0x75da('0x46')]){_0x431b4f[_0x75da('0x44')]=_[_0x75da('0x47')](_0x431b4f[_0x75da('0x44')],{'$or':_[_0x75da('0x35')](_0x5108b0,function(_0xb62f17){if(_0xb62f17[_0x75da('0x48')]!=='VIRTUAL'){var _0x5a618e={};_0x5a618e[_0xb62f17[_0x75da('0x32')]]={'$like':'%'+_0x20deeb[_0x75da('0x3a')]['filter']+'%'};return _0x5a618e;}})});}_0x431b4f=_[_0x75da('0x47')]({},_0x431b4f,_0x20deeb[_0x75da('0x49')]);var _0x196423={'where':_0x431b4f[_0x75da('0x44')]};return db[_0x75da('0x36')][_0x75da('0x27')](_0x196423)[_0x75da('0x2e')](function(_0x203ae9){_0x461c29['count']=_0x203ae9;if(_0x20deeb['query'][_0x75da('0x4a')]){_0x431b4f[_0x75da('0x4b')]=[{'all':!![]}];}return db[_0x75da('0x36')][_0x75da('0x4c')](_0x431b4f);})[_0x75da('0x2e')](function(_0x17b8ef){_0x461c29[_0x75da('0x4d')]=_0x17b8ef;return _0x461c29;})[_0x75da('0x2e')](respondWithFilteredResult(_0x32b38e,_0x431b4f))[_0x75da('0x4e')](handleError(_0x32b38e,null));};exports['show']=function(_0xc92290,_0x196a38){var _0x5d7085={'raw':![],'where':{'id':_0xc92290[_0x75da('0x4f')]['id']}},_0x1c7511={};_0x1c7511[_0x75da('0x39')]=_[_0x75da('0x3b')](db[_0x75da('0x36')][_0x75da('0x50')]);_0x1c7511[_0x75da('0x3a')]=_[_0x75da('0x3b')](_0xc92290['query']);_0x1c7511['filters']=_[_0x75da('0x3c')](_0x1c7511[_0x75da('0x39')],_0x1c7511[_0x75da('0x3a')]);_0x5d7085[_0x75da('0x3d')]=_[_0x75da('0x3c')](_0x1c7511[_0x75da('0x39')],qs['fields'](_0xc92290['query'][_0x75da('0x3e')]));_0x5d7085[_0x75da('0x3d')]=_0x5d7085[_0x75da('0x3d')][_0x75da('0x3f')]?_0x5d7085[_0x75da('0x3d')]:_0x1c7511[_0x75da('0x39')];if(_0xc92290[_0x75da('0x3a')][_0x75da('0x4a')]){_0x5d7085['include']=[{'all':!![]}];}_0x5d7085=_[_0x75da('0x47')]({},_0x5d7085,_0xc92290[_0x75da('0x49')]);return db[_0x75da('0x36')][_0x75da('0x51')](_0x5d7085)[_0x75da('0x2e')](handleEntityNotFound(_0x196a38,null))[_0x75da('0x2e')](respondWithResult(_0x196a38,null))[_0x75da('0x4e')](handleError(_0x196a38,null));};exports['create']=function(_0x94828e,_0x6355){return db[_0x75da('0x36')]['create'](_0x94828e['body'],{})[_0x75da('0x2e')](respondWithResult(_0x6355,0xc9))[_0x75da('0x4e')](handleError(_0x6355,null));};exports[_0x75da('0x52')]=function(_0x1288ae,_0x167cb8){if(_0x1288ae[_0x75da('0x53')]['id']){delete _0x1288ae[_0x75da('0x53')]['id'];}return db[_0x75da('0x36')][_0x75da('0x51')]({'where':{'id':_0x1288ae[_0x75da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x167cb8,null))[_0x75da('0x2e')](saveUpdates(_0x1288ae[_0x75da('0x53')],null))['then'](respondWithResult(_0x167cb8,null))[_0x75da('0x4e')](handleError(_0x167cb8,null));};exports[_0x75da('0x2d')]=function(_0xb6b3c2,_0x43bc12){return db[_0x75da('0x36')]['find']({'where':{'id':_0xb6b3c2[_0x75da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x43bc12,null))[_0x75da('0x2e')](removeEntity(_0x43bc12,null))[_0x75da('0x4e')](handleError(_0x43bc12,null));};exports[_0x75da('0x54')]=function(_0x3c1e24,_0x355483){return db['VoiceQueueReport']['describe']()['then'](respondWithResult(_0x355483,null))['catch'](handleError(_0x355483,null));};exports[_0x75da('0x55')]=function(_0x7e9836,_0x288401){var _0x59a37e={},_0x4690f4={},_0x22566f={'count':0x0,'rows':[]};_0x4690f4[_0x75da('0x39')]=_[_0x75da('0x3b')](db[_0x75da('0x36')]['rawAttributes']);_0x4690f4['query']=_['keys'](_0x7e9836[_0x75da('0x3a')]);_0x4690f4[_0x75da('0x56')]=_[_0x75da('0x3c')](_0x4690f4[_0x75da('0x39')],_0x4690f4[_0x75da('0x3a')]);_0x59a37e[_0x75da('0x3d')]=_[_0x75da('0x3c')](_0x4690f4[_0x75da('0x39')],qs[_0x75da('0x3e')](_0x7e9836['query'][_0x75da('0x3e')]));_0x59a37e[_0x75da('0x3d')]=_0x59a37e['attributes'][_0x75da('0x3f')]?_0x59a37e[_0x75da('0x3d')]:_0x4690f4[_0x75da('0x39')];if(!_0x7e9836[_0x75da('0x3a')][_0x75da('0x40')](_0x75da('0x41'))){_0x59a37e[_0x75da('0x28')]=qs[_0x75da('0x28')](_0x7e9836[_0x75da('0x3a')][_0x75da('0x28')]);_0x59a37e[_0x75da('0x25')]=qs[_0x75da('0x25')](_0x7e9836[_0x75da('0x3a')][_0x75da('0x25')]);}_0x59a37e[_0x75da('0x42')]=qs[_0x75da('0x43')](_0x7e9836[_0x75da('0x3a')][_0x75da('0x43')]);_0x59a37e[_0x75da('0x44')]=qs[_0x75da('0x56')](_[_0x75da('0x45')](_0x7e9836[_0x75da('0x3a')],_0x4690f4['filters']));if(_0x7e9836[_0x75da('0x3a')][_0x75da('0x46')]){_0x59a37e['where']=_['merge'](_0x59a37e[_0x75da('0x44')],{'$or':_['map'](_0x59a37e[_0x75da('0x3d')],function(_0x30da83){var _0x210af5={};_0x210af5[_0x30da83]={'$like':'%'+_0x7e9836[_0x75da('0x3a')][_0x75da('0x46')]+'%'};return _0x210af5;})});}_0x59a37e=_['merge']({},_0x59a37e,_0x7e9836[_0x75da('0x49')]);var _0x5bb5a4={'where':_0x59a37e['where']};return db['VoiceQueueReport']['count'](_0x5bb5a4)['then'](function(_0x152165){_0x22566f['count']=_0x152165;if(_0x7e9836['query'][_0x75da('0x4a')]){_0x59a37e[_0x75da('0x4b')]=[{'all':!![]}];}return db[_0x75da('0x36')][_0x75da('0x4c')](_0x59a37e);})[_0x75da('0x2e')](function(_0x57dbe8){_0x22566f[_0x75da('0x4d')]=_0x57dbe8;return _0x22566f;})[_0x75da('0x2e')](respondWithFilteredResult(_0x288401,_0x59a37e,_0x75da('0x55')))[_0x75da('0x4e')](handleError(_0x288401,null,_0x75da('0x55')));};
\ No newline at end of file
+var _0x522a=['map','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','catch','show','params','rawAttributes','fields','merge','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./voiceQueueReport.socket','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','reject','save','update','then','error','stack','name','index'];(function(_0x16eed5,_0x6fad14){var _0x3c51f1=function(_0x94dcd7){while(--_0x94dcd7){_0x16eed5['push'](_0x16eed5['shift']());}};_0x3c51f1(++_0x6fad14);}(_0x522a,0x11b));var _0xa522=function(_0x4e3b9c,_0x4d76a3){_0x4e3b9c=_0x4e3b9c-0x0;var _0x358b13=_0x522a[_0x4e3b9c];return _0x358b13;};'use strict';var emlformat=require(_0xa522('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa522('0x1'));var jsonpatch=require(_0xa522('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa522('0x3'));var Mustache=require(_0xa522('0x4'));var util=require(_0xa522('0x5'));var path=require(_0xa522('0x6'));var sox=require(_0xa522('0x7'));var csv=require(_0xa522('0x8'));var ejs=require(_0xa522('0x9'));var fs=require('fs');var fs_extra=require(_0xa522('0xa'));var _=require(_0xa522('0xb'));var squel=require('squel');var crypto=require(_0xa522('0xc'));var jsforce=require(_0xa522('0xd'));var deskjs=require(_0xa522('0xe'));var toCsv=require(_0xa522('0x8'));var querystring=require(_0xa522('0xf'));var Papa=require(_0xa522('0x10'));var Redis=require(_0xa522('0x11'));var authService=require(_0xa522('0x12'));var qs=require(_0xa522('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa522('0x14'));var logger=require(_0xa522('0x15'))(_0xa522('0x16'));var utils=require(_0xa522('0x17'));var config=require(_0xa522('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa522('0x19')]=_['defaults'](config[_0xa522('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa522('0x1a'))(new Redis(config[_0xa522('0x19')]));require(_0xa522('0x1b'))['register'](socket);function respondWithStatusCode(_0x421feb,_0x2f24d2){_0x2f24d2=_0x2f24d2||0xcc;return function(_0x3b52ab){if(_0x3b52ab){return _0x421feb[_0xa522('0x1c')](_0x2f24d2);}return _0x421feb['status'](_0x2f24d2)[_0xa522('0x1d')]();};}function respondWithResult(_0x218a47,_0x38971e){_0x38971e=_0x38971e||0xc8;return function(_0x3f9f62){if(_0x3f9f62){return _0x218a47[_0xa522('0x1e')](_0x38971e)['json'](_0x3f9f62);}};}function respondWithFilteredResult(_0x4f83ac,_0x173513){return function(_0x1397c8){if(_0x1397c8){var _0x5b5024=typeof _0x173513[_0xa522('0x1f')]===_0xa522('0x20')&&typeof _0x173513['limit']===_0xa522('0x20');var _0x24b9e9=_0x1397c8['count'];var _0xf0fb4e=_0x5b5024?0x0:_0x173513[_0xa522('0x1f')];var _0x4f8f97=_0x5b5024?_0x1397c8[_0xa522('0x21')]:_0x173513[_0xa522('0x1f')]+_0x173513['limit'];var _0x1b796b;if(_0x4f8f97>=_0x24b9e9){_0x4f8f97=_0x24b9e9;_0x1b796b=0xc8;}else{_0x1b796b=0xce;}_0x4f83ac[_0xa522('0x1e')](_0x1b796b);return _0x4f83ac[_0xa522('0x22')](_0xa522('0x23'),_0xf0fb4e+'-'+_0x4f8f97+'/'+_0x24b9e9)[_0xa522('0x24')](_0x1397c8);}return null;};}function patchUpdates(_0x579471){return function(_0x2ea206){try{jsonpatch['apply'](_0x2ea206,_0x579471,!![]);}catch(_0x5650cf){return BPromise[_0xa522('0x25')](_0x5650cf);}return _0x2ea206[_0xa522('0x26')]();};}function saveUpdates(_0x10a6d9,_0x224ac6){return function(_0x163d3d){if(_0x163d3d){return _0x163d3d[_0xa522('0x27')](_0x10a6d9)[_0xa522('0x28')](function(_0x547b51){return _0x547b51;});}return null;};}function removeEntity(_0x4d788b,_0x2c97e0){return function(_0x3cc688){if(_0x3cc688){return _0x3cc688['destroy']()['then'](function(){_0x4d788b[_0xa522('0x1e')](0xcc)[_0xa522('0x1d')]();});}};}function handleEntityNotFound(_0x56a2c0,_0x1ac686){return function(_0x490aca){if(!_0x490aca){_0x56a2c0[_0xa522('0x1c')](0x194);}return _0x490aca;};}function handleError(_0x24adc1,_0x419d53){_0x419d53=_0x419d53||0x1f4;return function(_0x341639){logger[_0xa522('0x29')](_0x341639[_0xa522('0x2a')]);if(_0x341639['name']){delete _0x341639[_0xa522('0x2b')];}_0x24adc1[_0xa522('0x1e')](_0x419d53)['send'](_0x341639);};}exports[_0xa522('0x2c')]=function(_0x3afa1f,_0x266c33){var _0x5945f7={},_0x44a5be={},_0x44bbaa={'count':0x0,'rows':[]};var _0x39aba1=_[_0xa522('0x2d')](db['VoiceQueueReport']['rawAttributes'],function(_0x2fa7b3){return{'name':_0x2fa7b3[_0xa522('0x2e')],'type':_0x2fa7b3['type'][_0xa522('0x2f')]};});_0x44a5be[_0xa522('0x30')]=_['map'](_0x39aba1,_0xa522('0x2b'));_0x44a5be['query']=_[_0xa522('0x31')](_0x3afa1f[_0xa522('0x32')]);_0x44a5be[_0xa522('0x33')]=_[_0xa522('0x34')](_0x44a5be[_0xa522('0x30')],_0x44a5be[_0xa522('0x32')]);_0x5945f7[_0xa522('0x35')]=_[_0xa522('0x34')](_0x44a5be['model'],qs['fields'](_0x3afa1f[_0xa522('0x32')]['fields']));_0x5945f7[_0xa522('0x35')]=_0x5945f7['attributes'][_0xa522('0x36')]?_0x5945f7['attributes']:_0x44a5be[_0xa522('0x30')];if(!_0x3afa1f['query'][_0xa522('0x37')]('nolimit')){_0x5945f7['limit']=qs[_0xa522('0x38')](_0x3afa1f[_0xa522('0x32')][_0xa522('0x38')]);_0x5945f7[_0xa522('0x1f')]=qs[_0xa522('0x1f')](_0x3afa1f[_0xa522('0x32')]['offset']);}_0x5945f7[_0xa522('0x39')]=qs[_0xa522('0x3a')](_0x3afa1f[_0xa522('0x32')][_0xa522('0x3a')]);_0x5945f7[_0xa522('0x3b')]=qs[_0xa522('0x33')](_['pick'](_0x3afa1f[_0xa522('0x32')],_0x44a5be['filters']),_0x39aba1);if(_0x3afa1f[_0xa522('0x32')][_0xa522('0x3c')]){_0x5945f7['where']=_['merge'](_0x5945f7[_0xa522('0x3b')],{'$or':_[_0xa522('0x2d')](_0x39aba1,function(_0x5146a3){if(_0x5146a3[_0xa522('0x3d')]!==_0xa522('0x3e')){var _0x566924={};_0x566924[_0x5146a3[_0xa522('0x2b')]]={'$like':'%'+_0x3afa1f[_0xa522('0x32')][_0xa522('0x3c')]+'%'};return _0x566924;}})});}_0x5945f7=_['merge']({},_0x5945f7,_0x3afa1f[_0xa522('0x3f')]);var _0x1b5023={'where':_0x5945f7['where']};return db['VoiceQueueReport'][_0xa522('0x21')](_0x1b5023)[_0xa522('0x28')](function(_0x33110d){_0x44bbaa[_0xa522('0x21')]=_0x33110d;if(_0x3afa1f[_0xa522('0x32')][_0xa522('0x40')]){_0x5945f7[_0xa522('0x41')]=[{'all':!![]}];}return db[_0xa522('0x42')][_0xa522('0x43')](_0x5945f7);})['then'](function(_0x5ce74b){_0x44bbaa[_0xa522('0x44')]=_0x5ce74b;return _0x44bbaa;})[_0xa522('0x28')](respondWithFilteredResult(_0x266c33,_0x5945f7))[_0xa522('0x45')](handleError(_0x266c33,null));};exports[_0xa522('0x46')]=function(_0x1979b3,_0x290e4a){var _0x3709cc={'raw':![],'where':{'id':_0x1979b3[_0xa522('0x47')]['id']}},_0x2f58b3={};_0x2f58b3['model']=_[_0xa522('0x31')](db[_0xa522('0x42')][_0xa522('0x48')]);_0x2f58b3['query']=_[_0xa522('0x31')](_0x1979b3[_0xa522('0x32')]);_0x2f58b3[_0xa522('0x33')]=_[_0xa522('0x34')](_0x2f58b3[_0xa522('0x30')],_0x2f58b3[_0xa522('0x32')]);_0x3709cc[_0xa522('0x35')]=_['intersection'](_0x2f58b3['model'],qs['fields'](_0x1979b3['query'][_0xa522('0x49')]));_0x3709cc[_0xa522('0x35')]=_0x3709cc['attributes']['length']?_0x3709cc[_0xa522('0x35')]:_0x2f58b3[_0xa522('0x30')];if(_0x1979b3[_0xa522('0x32')][_0xa522('0x40')]){_0x3709cc[_0xa522('0x41')]=[{'all':!![]}];}_0x3709cc=_[_0xa522('0x4a')]({},_0x3709cc,_0x1979b3[_0xa522('0x3f')]);return db['VoiceQueueReport'][_0xa522('0x4b')](_0x3709cc)[_0xa522('0x28')](handleEntityNotFound(_0x290e4a,null))[_0xa522('0x28')](respondWithResult(_0x290e4a,null))['catch'](handleError(_0x290e4a,null));};exports[_0xa522('0x4c')]=function(_0x110608,_0x4f62e7){return db[_0xa522('0x42')][_0xa522('0x4c')](_0x110608['body'],{})[_0xa522('0x28')](respondWithResult(_0x4f62e7,0xc9))[_0xa522('0x45')](handleError(_0x4f62e7,null));};exports[_0xa522('0x27')]=function(_0x1b0965,_0x56a93d){if(_0x1b0965[_0xa522('0x4d')]['id']){delete _0x1b0965[_0xa522('0x4d')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x1b0965['params']['id']}})[_0xa522('0x28')](handleEntityNotFound(_0x56a93d,null))[_0xa522('0x28')](saveUpdates(_0x1b0965['body'],null))[_0xa522('0x28')](respondWithResult(_0x56a93d,null))[_0xa522('0x45')](handleError(_0x56a93d,null));};exports[_0xa522('0x4e')]=function(_0x4499e8,_0x194e20){return db[_0xa522('0x42')][_0xa522('0x4b')]({'where':{'id':_0x4499e8[_0xa522('0x47')]['id']}})[_0xa522('0x28')](handleEntityNotFound(_0x194e20,null))['then'](removeEntity(_0x194e20,null))['catch'](handleError(_0x194e20,null));};exports[_0xa522('0x4f')]=function(_0x578bf0,_0x264f9a){return db['VoiceQueueReport']['describe']()[_0xa522('0x28')](respondWithResult(_0x264f9a,null))[_0xa522('0x45')](handleError(_0x264f9a,null));};exports[_0xa522('0x50')]=function(_0x5c6f6a,_0x535d62){var _0x5f2645={},_0x4ede63={},_0x3ecbf2={'count':0x0,'rows':[]};_0x4ede63[_0xa522('0x30')]=_[_0xa522('0x31')](db[_0xa522('0x42')][_0xa522('0x48')]);_0x4ede63['query']=_[_0xa522('0x31')](_0x5c6f6a[_0xa522('0x32')]);_0x4ede63[_0xa522('0x33')]=_[_0xa522('0x34')](_0x4ede63[_0xa522('0x30')],_0x4ede63['query']);_0x5f2645['attributes']=_[_0xa522('0x34')](_0x4ede63[_0xa522('0x30')],qs['fields'](_0x5c6f6a[_0xa522('0x32')]['fields']));_0x5f2645['attributes']=_0x5f2645['attributes'][_0xa522('0x36')]?_0x5f2645['attributes']:_0x4ede63[_0xa522('0x30')];if(!_0x5c6f6a[_0xa522('0x32')][_0xa522('0x37')](_0xa522('0x51'))){_0x5f2645[_0xa522('0x38')]=qs[_0xa522('0x38')](_0x5c6f6a[_0xa522('0x32')][_0xa522('0x38')]);_0x5f2645['offset']=qs[_0xa522('0x1f')](_0x5c6f6a[_0xa522('0x32')][_0xa522('0x1f')]);}_0x5f2645['order']=qs['sort'](_0x5c6f6a['query'][_0xa522('0x3a')]);_0x5f2645[_0xa522('0x3b')]=qs[_0xa522('0x33')](_['pick'](_0x5c6f6a[_0xa522('0x32')],_0x4ede63[_0xa522('0x33')]));if(_0x5c6f6a[_0xa522('0x32')][_0xa522('0x3c')]){_0x5f2645[_0xa522('0x3b')]=_[_0xa522('0x4a')](_0x5f2645['where'],{'$or':_['map'](_0x5f2645[_0xa522('0x35')],function(_0x164381){var _0x32e2c2={};_0x32e2c2[_0x164381]={'$like':'%'+_0x5c6f6a[_0xa522('0x32')][_0xa522('0x3c')]+'%'};return _0x32e2c2;})});}_0x5f2645=_['merge']({},_0x5f2645,_0x5c6f6a[_0xa522('0x3f')]);var _0x231b01={'where':_0x5f2645[_0xa522('0x3b')]};return db[_0xa522('0x42')]['count'](_0x231b01)[_0xa522('0x28')](function(_0x3fc43b){_0x3ecbf2[_0xa522('0x21')]=_0x3fc43b;if(_0x5c6f6a[_0xa522('0x32')]['includeAll']){_0x5f2645['include']=[{'all':!![]}];}return db[_0xa522('0x42')][_0xa522('0x43')](_0x5f2645);})[_0xa522('0x28')](function(_0x58303d){_0x3ecbf2[_0xa522('0x44')]=_0x58303d;return _0x3ecbf2;})['then'](respondWithFilteredResult(_0x535d62,_0x5f2645,_0xa522('0x50')))[_0xa522('0x45')](handleError(_0x535d62,null,_0xa522('0x50')));};
\ No newline at end of file
index 4e1e25d..20ef562 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b68=['hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x468da9,_0x143ac3){var _0x3e35ce=function(_0x10d0b0){while(--_0x10d0b0){_0x468da9['push'](_0x468da9['shift']());}};_0x3e35ce(++_0x143ac3);}(_0x3b68,0xad));var _0x83b6=function(_0x27c022,_0x57ff07){_0x27c022=_0x27c022-0x0;var _0x135604=_0x3b68[_0x27c022];return _0x135604;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x83b6('0x0'))['db'][_0x83b6('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x83b6('0x2')](0x0);var events={'afterCreate':_0x83b6('0x3'),'afterUpdate':'update','afterDestroy':_0x83b6('0x4')};function emitEvent(_0x182e62){return function(_0xc9e25c,_0x2d2935,_0x7c2fbf){VoiceQueueReportEvents[_0x83b6('0x5')](_0x182e62+':'+_0xc9e25c['id'],_0xc9e25c);VoiceQueueReportEvents['emit'](_0x182e62,_0xc9e25c);_0x7c2fbf(null);};}for(var e in events){if(events[_0x83b6('0x6')](e)){var event=events[e];VoiceQueueReport[_0x83b6('0x7')](e,emitEvent(event));}}module[_0x83b6('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x0ddf=['exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','hook'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x0ddf,0x187));var _0xf0dd=function(_0x53564b,_0x572357){_0x53564b=_0x53564b-0x0;var _0x64398a=_0x0ddf[_0x53564b];return _0x64398a;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xf0dd('0x0'))['db'][_0xf0dd('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf0dd('0x2')](0x0);var events={'afterCreate':_0xf0dd('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56bc8d){return function(_0x26caad,_0x2d23e6,_0x3c1f54){VoiceQueueReportEvents['emit'](_0x56bc8d+':'+_0x26caad['id'],_0x26caad);VoiceQueueReportEvents['emit'](_0x56bc8d,_0x26caad);_0x3c1f54(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xf0dd('0x4')](e,emitEvent(event));}}module[_0xf0dd('0x5')]=VoiceQueueReportEvents;
\ No newline at end of file
index b961d7e..ed2ae63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a32=['VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0a32,0x170));var _0x20a3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0a32[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x20a3('0x0'));var util=require(_0x20a3('0x1'));var logger=require('../../config/logger')(_0x20a3('0x2'));var moment=require(_0x20a3('0x3'));var BPromise=require(_0x20a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20a3('0x5'));var config=require(_0x20a3('0x6'));var attributes=require(_0x20a3('0x7'));module[_0x20a3('0x8')]=function(_0x59ceed,_0x32e2af){return _0x59ceed['define'](_0x20a3('0x9'),attributes,{'tableName':_0x20a3('0xa'),'paranoid':![],'indexes':[{'fields':[_0x20a3('0xb')]},{'fields':[_0x20a3('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xba00=['moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','api'];(function(_0xe052be,_0x393642){var _0x11ba22=function(_0x151a94){while(--_0x151a94){_0xe052be['push'](_0xe052be['shift']());}};_0x11ba22(++_0x393642);}(_0xba00,0x1af));var _0x0ba0=function(_0xb30a92,_0x4c9fd1){_0xb30a92=_0xb30a92-0x0;var _0xbda664=_0xba00[_0xb30a92];return _0xbda664;};'use strict';var _=require(_0x0ba0('0x0'));var util=require(_0x0ba0('0x1'));var logger=require(_0x0ba0('0x2'))(_0x0ba0('0x3'));var moment=require(_0x0ba0('0x4'));var BPromise=require(_0x0ba0('0x5'));var rp=require(_0x0ba0('0x6'));var fs=require('fs');var path=require(_0x0ba0('0x7'));var rimraf=require('rimraf');var config=require(_0x0ba0('0x8'));var attributes=require(_0x0ba0('0x9'));module[_0x0ba0('0xa')]=function(_0x5f50ba,_0x2ce5c0){return _0x5f50ba[_0x0ba0('0xb')](_0x0ba0('0xc'),attributes,{'tableName':_0x0ba0('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x0ba0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index e96342d..4c5cefc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ff2=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','then','info','debug','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','limit','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x42654a,_0xc7c5d1){var _0x4f024d=function(_0x1b0380){while(--_0x1b0380){_0x42654a['push'](_0x42654a['shift']());}};_0x4f024d(++_0xc7c5d1);}(_0x9ff2,0xdb));var _0x29ff=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9ff2[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x29ff('0x0'));var moment=require(_0x29ff('0x1'));var BPromise=require('bluebird');var rs=require(_0x29ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29ff('0x3'));var logger=require(_0x29ff('0x4'))('rpc');var config=require(_0x29ff('0x5'));var jayson=require(_0x29ff('0x6'));var client=jayson['client'][_0x29ff('0x7')]({'port':0x232a});config[_0x29ff('0x8')]=_[_0x29ff('0x9')](config['redis'],{'host':_0x29ff('0xa'),'port':0x18eb});var socket=require(_0x29ff('0xb'))(new Redis(config[_0x29ff('0x8')]));require(_0x29ff('0xc'))['register'](socket);function respondWithRpcPromise(_0x53986b,_0x5b237b,_0x46be3f){return new BPromise(function(_0x4c7ebf,_0x4188b2){return client[_0x29ff('0xd')](_0x53986b,_0x46be3f)['then'](function(_0x44073e){logger['info'](_0x29ff('0xe'),_0x5b237b,'request\x20sent');logger['debug'](_0x29ff('0xf'),_0x5b237b,_0x29ff('0x10'),JSON[_0x29ff('0x11')](_0x44073e));if(_0x44073e['error']){if(_0x44073e[_0x29ff('0x12')]['code']===0x1f4){logger['error'](_0x29ff('0xe'),_0x5b237b,_0x44073e[_0x29ff('0x12')][_0x29ff('0x13')]);return _0x4188b2(_0x44073e[_0x29ff('0x12')][_0x29ff('0x13')]);}logger['error'](_0x29ff('0xe'),_0x5b237b,_0x44073e[_0x29ff('0x12')][_0x29ff('0x13')]);return _0x4c7ebf(_0x44073e[_0x29ff('0x12')][_0x29ff('0x13')]);}else{logger['info'](_0x29ff('0xe'),_0x5b237b,'request\x20sent');_0x4c7ebf(_0x44073e['result'][_0x29ff('0x13')]);}})[_0x29ff('0x14')](function(_0x59ac82){logger[_0x29ff('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5b237b,_0x59ac82);_0x4188b2(_0x59ac82);});});}exports[_0x29ff('0x15')]=function(_0x461d66){var _0xdb02a7=this;return new Promise(function(_0x3bb8b0,_0x507bb7){return db['VoiceQueueReport'][_0x29ff('0x16')]({'raw':_0x461d66['options']?_0x461d66[_0x29ff('0x17')][_0x29ff('0x18')]===undefined?!![]:![]:!![],'where':_0x461d66[_0x29ff('0x17')]?_0x461d66['options'][_0x29ff('0x19')]||null:null,'attributes':_0x461d66[_0x29ff('0x17')]?_0x461d66[_0x29ff('0x17')][_0x29ff('0x1a')]||null:null,'limit':_0x461d66['options']?_0x461d66[_0x29ff('0x17')]['limit']||null:null,'include':_0x461d66['options']?_0x461d66['options'][_0x29ff('0x1b')]?_[_0x29ff('0x1c')](_0x461d66[_0x29ff('0x17')][_0x29ff('0x1b')],function(_0x3ba332){return{'model':db[_0x3ba332[_0x29ff('0x1d')]],'as':_0x3ba332['as'],'attributes':_0x3ba332['attributes'],'include':_0x3ba332[_0x29ff('0x1b')]?_['map'](_0x3ba332[_0x29ff('0x1b')],function(_0x2569c7){return{'model':db[_0x2569c7[_0x29ff('0x1d')]],'as':_0x2569c7['as'],'attributes':_0x2569c7[_0x29ff('0x1a')],'include':_0x2569c7[_0x29ff('0x1b')]?_['map'](_0x2569c7[_0x29ff('0x1b')],function(_0x117cad){return{'model':db[_0x117cad[_0x29ff('0x1d')]],'as':_0x117cad['as'],'attributes':_0x117cad['attributes']};}):[]};}):[]};}):[]:[]})[_0x29ff('0x1e')](function(_0x31e82c){logger[_0x29ff('0x1f')](_0x29ff('0x15'),_0x461d66);logger[_0x29ff('0x20')](_0x29ff('0x15'),_0x461d66,JSON[_0x29ff('0x11')](_0x31e82c));_0x3bb8b0(_0x31e82c);})[_0x29ff('0x14')](function(_0x3d5b61){logger[_0x29ff('0x12')](_0x29ff('0x15'),_0x3d5b61['message'],_0x461d66);_0x507bb7(_0xdb02a7[_0x29ff('0x12')](0x1f4,_0x3d5b61[_0x29ff('0x13')]));});});};exports[_0x29ff('0x21')]=function(_0x4d0960){var _0x8c5f67=this;return new Promise(function(_0x437738,_0x62790d){return db[_0x29ff('0x22')][_0x29ff('0x23')](_0x4d0960['body'],{'raw':_0x4d0960[_0x29ff('0x17')]?_0x4d0960[_0x29ff('0x17')][_0x29ff('0x18')]===undefined?!![]:![]:!![]})[_0x29ff('0x1e')](function(_0x1a4eb2){logger['info'](_0x29ff('0x21'),_0x4d0960);logger[_0x29ff('0x20')]('CreateVoiceQueueReport',_0x4d0960,JSON[_0x29ff('0x11')](_0x1a4eb2));_0x437738(_0x1a4eb2);})[_0x29ff('0x14')](function(_0x5863f0){logger['error'](_0x29ff('0x21'),_0x5863f0[_0x29ff('0x13')],_0x4d0960);_0x62790d(_0x8c5f67[_0x29ff('0x12')](0x1f4,_0x5863f0['message']));});});};exports[_0x29ff('0x24')]=function(_0x4f1023){var _0x13e40d=this;return new Promise(function(_0x5a2b1f,_0x289d6b){return db[_0x29ff('0x22')][_0x29ff('0x25')](_0x4f1023['body'],{'raw':_0x4f1023[_0x29ff('0x17')]?_0x4f1023['options'][_0x29ff('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1023['options']?_0x4f1023['options'][_0x29ff('0x19')]||null:null,'attributes':_0x4f1023[_0x29ff('0x17')]?_0x4f1023[_0x29ff('0x17')][_0x29ff('0x1a')]||null:null,'limit':_0x4f1023['options']?_0x4f1023[_0x29ff('0x17')][_0x29ff('0x26')]||null:null})[_0x29ff('0x1e')](function(_0x51b0ce){logger[_0x29ff('0x1f')](_0x29ff('0x24'),_0x4f1023);logger[_0x29ff('0x20')](_0x29ff('0x24'),_0x4f1023,JSON['stringify'](_0x51b0ce));_0x5a2b1f(_0x51b0ce);})[_0x29ff('0x14')](function(_0x295517){logger['error'](_0x29ff('0x24'),_0x295517[_0x29ff('0x13')],_0x4f1023);_0x289d6b(_0x13e40d[_0x29ff('0x12')](0x1f4,_0x295517[_0x29ff('0x13')]));});});};
\ No newline at end of file
+var _0x8e52=['register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','catch','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8e52,0x129));var _0x28e5=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x8e52[_0x26a906];return _0x495575;};'use strict';var _=require(_0x28e5('0x0'));var util=require(_0x28e5('0x1'));var moment=require(_0x28e5('0x2'));var BPromise=require(_0x28e5('0x3'));var rs=require(_0x28e5('0x4'));var fs=require('fs');var Redis=require(_0x28e5('0x5'));var db=require(_0x28e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28e5('0x7'))(_0x28e5('0x8'));var config=require(_0x28e5('0x9'));var jayson=require(_0x28e5('0xa'));var client=jayson[_0x28e5('0xb')][_0x28e5('0xc')]({'port':0x232a});config[_0x28e5('0xd')]=_[_0x28e5('0xe')](config[_0x28e5('0xd')],{'host':_0x28e5('0xf'),'port':0x18eb});var socket=require(_0x28e5('0x10'))(new Redis(config[_0x28e5('0xd')]));require(_0x28e5('0x11'))[_0x28e5('0x12')](socket);function respondWithRpcPromise(_0x1c3f1c,_0x563c1d,_0x29f6f4){return new BPromise(function(_0x23ae0c,_0x4e3e8a){return client[_0x28e5('0x13')](_0x1c3f1c,_0x29f6f4)[_0x28e5('0x14')](function(_0x4fbfb0){logger[_0x28e5('0x15')](_0x28e5('0x16'),_0x563c1d,'request\x20sent');logger[_0x28e5('0x17')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x563c1d,_0x28e5('0x18'),JSON['stringify'](_0x4fbfb0));if(_0x4fbfb0[_0x28e5('0x19')]){if(_0x4fbfb0[_0x28e5('0x19')][_0x28e5('0x1a')]===0x1f4){logger['error'](_0x28e5('0x16'),_0x563c1d,_0x4fbfb0['error']['message']);return _0x4e3e8a(_0x4fbfb0[_0x28e5('0x19')][_0x28e5('0x1b')]);}logger[_0x28e5('0x19')](_0x28e5('0x16'),_0x563c1d,_0x4fbfb0[_0x28e5('0x19')][_0x28e5('0x1b')]);return _0x23ae0c(_0x4fbfb0['error'][_0x28e5('0x1b')]);}else{logger[_0x28e5('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x563c1d,_0x28e5('0x18'));_0x23ae0c(_0x4fbfb0[_0x28e5('0x1c')][_0x28e5('0x1b')]);}})['catch'](function(_0x452a8f){logger[_0x28e5('0x19')](_0x28e5('0x16'),_0x563c1d,_0x452a8f);_0x4e3e8a(_0x452a8f);});});}exports[_0x28e5('0x1d')]=function(_0x4004b0){var _0x56bf80=this;return new Promise(function(_0x32a1e2,_0x16acf7){return db['VoiceQueueReport'][_0x28e5('0x1e')]({'raw':_0x4004b0[_0x28e5('0x1f')]?_0x4004b0[_0x28e5('0x1f')][_0x28e5('0x20')]===undefined?!![]:![]:!![],'where':_0x4004b0[_0x28e5('0x1f')]?_0x4004b0[_0x28e5('0x1f')][_0x28e5('0x21')]||null:null,'attributes':_0x4004b0[_0x28e5('0x1f')]?_0x4004b0['options'][_0x28e5('0x22')]||null:null,'limit':_0x4004b0['options']?_0x4004b0[_0x28e5('0x1f')][_0x28e5('0x23')]||null:null,'include':_0x4004b0[_0x28e5('0x1f')]?_0x4004b0['options'][_0x28e5('0x24')]?_[_0x28e5('0x25')](_0x4004b0[_0x28e5('0x1f')][_0x28e5('0x24')],function(_0x5b41f6){return{'model':db[_0x5b41f6[_0x28e5('0x26')]],'as':_0x5b41f6['as'],'attributes':_0x5b41f6[_0x28e5('0x22')],'include':_0x5b41f6[_0x28e5('0x24')]?_['map'](_0x5b41f6['include'],function(_0x52115e){return{'model':db[_0x52115e['model']],'as':_0x52115e['as'],'attributes':_0x52115e[_0x28e5('0x22')],'include':_0x52115e['include']?_[_0x28e5('0x25')](_0x52115e[_0x28e5('0x24')],function(_0x3220f6){return{'model':db[_0x3220f6['model']],'as':_0x3220f6['as'],'attributes':_0x3220f6['attributes']};}):[]};}):[]};}):[]:[]})[_0x28e5('0x14')](function(_0x2497a9){logger['info'](_0x28e5('0x1d'),_0x4004b0);logger[_0x28e5('0x17')]('GetVoiceQueueReport',_0x4004b0,JSON[_0x28e5('0x27')](_0x2497a9));_0x32a1e2(_0x2497a9);})['catch'](function(_0x5f4f62){logger[_0x28e5('0x19')]('GetVoiceQueueReport',_0x5f4f62['message'],_0x4004b0);_0x16acf7(_0x56bf80[_0x28e5('0x19')](0x1f4,_0x5f4f62[_0x28e5('0x1b')]));});});};exports[_0x28e5('0x28')]=function(_0x3485f5){var _0x27a656=this;return new Promise(function(_0x1abf56,_0x4a106a){return db[_0x28e5('0x29')][_0x28e5('0x2a')](_0x3485f5['body'],{'raw':_0x3485f5[_0x28e5('0x1f')]?_0x3485f5[_0x28e5('0x1f')][_0x28e5('0x20')]===undefined?!![]:![]:!![]})[_0x28e5('0x14')](function(_0x5af99f){logger[_0x28e5('0x15')](_0x28e5('0x28'),_0x3485f5);logger['debug'](_0x28e5('0x28'),_0x3485f5,JSON[_0x28e5('0x27')](_0x5af99f));_0x1abf56(_0x5af99f);})[_0x28e5('0x2b')](function(_0x52374f){logger['error'](_0x28e5('0x28'),_0x52374f[_0x28e5('0x1b')],_0x3485f5);_0x4a106a(_0x27a656[_0x28e5('0x19')](0x1f4,_0x52374f[_0x28e5('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x31e4fa){var _0x35f652=this;return new Promise(function(_0x8009cc,_0x1c4e39){return db['VoiceQueueReport']['update'](_0x31e4fa['body'],{'raw':_0x31e4fa['options']?_0x31e4fa[_0x28e5('0x1f')][_0x28e5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31e4fa[_0x28e5('0x1f')]?_0x31e4fa[_0x28e5('0x1f')][_0x28e5('0x21')]||null:null,'attributes':_0x31e4fa[_0x28e5('0x1f')]?_0x31e4fa[_0x28e5('0x1f')][_0x28e5('0x22')]||null:null,'limit':_0x31e4fa['options']?_0x31e4fa[_0x28e5('0x1f')]['limit']||null:null})[_0x28e5('0x14')](function(_0x1ec11d){logger['info']('UpdateVoiceQueueReport',_0x31e4fa);logger[_0x28e5('0x17')](_0x28e5('0x2c'),_0x31e4fa,JSON[_0x28e5('0x27')](_0x1ec11d));_0x8009cc(_0x1ec11d);})[_0x28e5('0x2b')](function(_0x16f148){logger['error']('UpdateVoiceQueueReport',_0x16f148[_0x28e5('0x1b')],_0x31e4fa);_0x1c4e39(_0x35f652[_0x28e5('0x19')](0x1f4,_0x16f148[_0x28e5('0x1b')]));});});};
\ No newline at end of file
index b8df55c..be80771 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5bf=['remove','update','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0xbb3cd0,_0x2e4390){var _0x182543=function(_0x158761){while(--_0x158761){_0xbb3cd0['push'](_0xbb3cd0['shift']());}};_0x182543(++_0x2e4390);}(_0xd5bf,0x66));var _0xfd5b=function(_0xd429cd,_0x33a418){_0xd429cd=_0xd429cd-0x0;var _0x136598=_0xd5bf[_0xd429cd];return _0x136598;};'use strict';var VoiceQueueReportEvents=require(_0xfd5b('0x0'));var events=[_0xfd5b('0x1'),_0xfd5b('0x2'),_0xfd5b('0x3')];function createListener(_0x467dc9,_0x2991d0){return function(_0x1a99a5){_0x2991d0['emit'](_0x467dc9,_0x1a99a5);};}function removeListener(_0x5cab79,_0x2ba290){return function(){VoiceQueueReportEvents[_0xfd5b('0x4')](_0x5cab79,_0x2ba290);};}exports[_0xfd5b('0x5')]=function(_0x50351f){for(var _0x5f079a=0x0,_0x2c61da=events[_0xfd5b('0x6')];_0x5f079a<_0x2c61da;_0x5f079a++){var _0x42b565=events[_0x5f079a];var _0x485158=createListener(_0xfd5b('0x7')+_0x42b565,_0x50351f);VoiceQueueReportEvents['on'](_0x42b565,_0x485158);}};
\ No newline at end of file
+var _0xa915=['length','voiceQueueReport:','save','remove','update','emit','register'];(function(_0x1c8da4,_0x114540){var _0x3062e8=function(_0x416ad1){while(--_0x416ad1){_0x1c8da4['push'](_0x1c8da4['shift']());}};_0x3062e8(++_0x114540);}(_0xa915,0x1d7));var _0x5a91=function(_0x2578e3,_0x16a192){_0x2578e3=_0x2578e3-0x0;var _0x53a19c=_0xa915[_0x2578e3];return _0x53a19c;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x5a91('0x0'),_0x5a91('0x1'),_0x5a91('0x2')];function createListener(_0x57e822,_0x5153ad){return function(_0x1adb8d){_0x5153ad[_0x5a91('0x3')](_0x57e822,_0x1adb8d);};}function removeListener(_0x50caed,_0x401165){return function(){VoiceQueueReportEvents['removeListener'](_0x50caed,_0x401165);};}exports[_0x5a91('0x4')]=function(_0x1db91b){for(var _0x3f1e25=0x0,_0x1bd28c=events[_0x5a91('0x5')];_0x3f1e25<_0x1bd28c;_0x3f1e25++){var _0x1da3cb=events[_0x3f1e25];var _0xedcee7=createListener(_0x5a91('0x6')+_0x1da3cb,_0x1db91b);VoiceQueueReportEvents['on'](_0x1da3cb,_0xedcee7);}};
\ No newline at end of file
index 5f7a330..31500ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfb=['create','put','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdbfb,0x16b));var _0xbdbf=function(_0x42de21,_0x4b022d){_0x42de21=_0x42de21-0x0;var _0x7903c0=_0xdbfb[_0x42de21];return _0x7903c0;};'use strict';var multer=require(_0xbdbf('0x0'));var util=require(_0xbdbf('0x1'));var path=require('path');var timeout=require(_0xbdbf('0x2'));var express=require(_0xbdbf('0x3'));var router=express['Router']();var fs_extra=require(_0xbdbf('0x4'));var auth=require(_0xbdbf('0x5'));var interaction=require(_0xbdbf('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xbdbf('0x7')]('/',auth[_0xbdbf('0x8')](),controller[_0xbdbf('0x9')]);router[_0xbdbf('0x7')](_0xbdbf('0xa'),auth[_0xbdbf('0x8')](),controller[_0xbdbf('0xb')]);router['post']('/',auth[_0xbdbf('0x8')](),controller[_0xbdbf('0xc')]);router[_0xbdbf('0xd')](_0xbdbf('0xa'),auth[_0xbdbf('0x8')](),controller['update']);router['delete'](_0xbdbf('0xa'),auth['isAuthenticated'](),controller[_0xbdbf('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x1df5=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x48043a,_0x2b99c1){var _0x7d92d2=function(_0xe18174){while(--_0xe18174){_0x48043a['push'](_0x48043a['shift']());}};_0x7d92d2(++_0x2b99c1);}(_0x1df5,0xfd));var _0x51df=function(_0x2f52f7,_0x52a0a3){_0x2f52f7=_0x2f52f7-0x0;var _0x30fbd1=_0x1df5[_0x2f52f7];return _0x30fbd1;};'use strict';var multer=require(_0x51df('0x0'));var util=require(_0x51df('0x1'));var path=require(_0x51df('0x2'));var timeout=require(_0x51df('0x3'));var express=require(_0x51df('0x4'));var router=express['Router']();var fs_extra=require(_0x51df('0x5'));var auth=require(_0x51df('0x6'));var interaction=require(_0x51df('0x7'));var config=require(_0x51df('0x8'));var controller=require(_0x51df('0x9'));router[_0x51df('0xa')]('/',auth[_0x51df('0xb')](),controller[_0x51df('0xc')]);router['get'](_0x51df('0xd'),auth['isAuthenticated'](),controller[_0x51df('0xe')]);router[_0x51df('0xf')]('/',auth[_0x51df('0xb')](),controller[_0x51df('0x10')]);router[_0x51df('0x11')](_0x51df('0xd'),auth[_0x51df('0xb')](),controller[_0x51df('0x12')]);router['delete'](_0x51df('0xd'),auth[_0x51df('0xb')](),controller[_0x51df('0x13')]);module[_0x51df('0x14')]=router;
\ No newline at end of file
index 10751e2..6081c47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6867=['sequelize','moment','STRING','DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x6867,0xa0));var _0x7686=function(_0x200056,_0x28b33f){_0x200056=_0x200056-0x0;var _0x1614f1=_0x6867[_0x200056];return _0x1614f1;};'use strict';var Sequelize=require(_0x7686('0x0'));var moment=require(_0x7686('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7686('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7686('0x3')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x7686('0x4'))}};
\ No newline at end of file
+var _0xe9b7=['literal','sequelize','moment','exports','STRING','DATE'];(function(_0x54446b,_0x33f9f4){var _0x2b5d13=function(_0x20e1f2){while(--_0x20e1f2){_0x54446b['push'](_0x54446b['shift']());}};_0x2b5d13(++_0x33f9f4);}(_0xe9b7,0x175));var _0x7e9b=function(_0x2e476a,_0x1c655d){_0x2e476a=_0x2e476a-0x0;var _0x188142=_0xe9b7[_0x2e476a];return _0x188142;};'use strict';var Sequelize=require(_0x7e9b('0x0'));var moment=require(_0x7e9b('0x1'));module[_0x7e9b('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7e9b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7e9b('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x7e9b('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index ea6f482..9477579 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x124d=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','offset'];(function(_0x45d84c,_0x5a7d95){var _0x4b9ace=function(_0xe8c245){while(--_0xe8c245){_0x45d84c['push'](_0x45d84c['shift']());}};_0x4b9ace(++_0x5a7d95);}(_0x124d,0x129));var _0xd124=function(_0x1833e2,_0x556dbd){_0x1833e2=_0x1833e2-0x0;var _0x4bd545=_0x124d[_0x1833e2];return _0x4bd545;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd124('0x0'));var zipdir=require(_0xd124('0x1'));var jsonpatch=require(_0xd124('0x2'));var rp=require(_0xd124('0x3'));var moment=require(_0xd124('0x4'));var BPromise=require(_0xd124('0x5'));var Mustache=require('mustache');var util=require(_0xd124('0x6'));var path=require(_0xd124('0x7'));var sox=require(_0xd124('0x8'));var csv=require(_0xd124('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd124('0xa'));var _=require(_0xd124('0xb'));var squel=require(_0xd124('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd124('0xd'));var toCsv=require(_0xd124('0x9'));var querystring=require('querystring');var Papa=require(_0xd124('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd124('0xf'));var as=require(_0xd124('0x10'));var hardwareService=require(_0xd124('0x11'));var logger=require(_0xd124('0x12'))(_0xd124('0x13'));var utils=require(_0xd124('0x14'));var config=require(_0xd124('0x15'));var licenseUtil=require(_0xd124('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a236d,_0x122fae){_0x122fae=_0x122fae||0xcc;return function(_0x55b1e6){if(_0x55b1e6){return _0x5a236d[_0xd124('0x17')](_0x122fae);}return _0x5a236d[_0xd124('0x18')](_0x122fae)['end']();};}function respondWithResult(_0x4d95a4,_0x7cc41c){_0x7cc41c=_0x7cc41c||0xc8;return function(_0x299c31){if(_0x299c31){return _0x4d95a4[_0xd124('0x18')](_0x7cc41c)[_0xd124('0x19')](_0x299c31);}};}function respondWithFilteredResult(_0x1f6348,_0x43234e){return function(_0x49d241){if(_0x49d241){var _0x1c5043=typeof _0x43234e['offset']===_0xd124('0x1a')&&typeof _0x43234e[_0xd124('0x1b')]===_0xd124('0x1a');var _0x282c88=_0x49d241[_0xd124('0x1c')];var _0x2ec145=_0x1c5043?0x0:_0x43234e['offset'];var _0x2ff264=_0x1c5043?_0x49d241[_0xd124('0x1c')]:_0x43234e['offset']+_0x43234e['limit'];var _0x34119d;if(_0x2ff264>=_0x282c88){_0x2ff264=_0x282c88;_0x34119d=0xc8;}else{_0x34119d=0xce;}_0x1f6348[_0xd124('0x18')](_0x34119d);return _0x1f6348[_0xd124('0x1d')](_0xd124('0x1e'),_0x2ec145+'-'+_0x2ff264+'/'+_0x282c88)[_0xd124('0x19')](_0x49d241);}return null;};}function patchUpdates(_0x58f03a){return function(_0x2ffa74){try{jsonpatch[_0xd124('0x1f')](_0x2ffa74,_0x58f03a,!![]);}catch(_0x2f4733){return BPromise['reject'](_0x2f4733);}return _0x2ffa74['save']();};}function saveUpdates(_0xdd0181,_0x5e51c2){return function(_0x2d036a){if(_0x2d036a){return _0x2d036a[_0xd124('0x20')](_0xdd0181)[_0xd124('0x21')](function(_0x3426bc){return _0x3426bc;});}return null;};}function removeEntity(_0x3a410f,_0x2c3e5a){return function(_0xfb9352){if(_0xfb9352){return _0xfb9352['destroy']()[_0xd124('0x21')](function(){_0x3a410f[_0xd124('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd97683,_0x418982){return function(_0x1dd0e1){if(!_0x1dd0e1){_0xd97683['sendStatus'](0x194);}return _0x1dd0e1;};}function handleError(_0x348419,_0xe20a31){_0xe20a31=_0xe20a31||0x1f4;return function(_0xa233ac){logger[_0xd124('0x22')](_0xa233ac[_0xd124('0x23')]);if(_0xa233ac[_0xd124('0x24')]){delete _0xa233ac[_0xd124('0x24')];}_0x348419['status'](_0xe20a31)[_0xd124('0x25')](_0xa233ac);};}exports[_0xd124('0x26')]=function(_0x4035ca,_0x309bbf){var _0x1d02f3={},_0x572a53={},_0x956c49={'count':0x0,'rows':[]};var _0x240cbd=_[_0xd124('0x27')](db[_0xd124('0x28')]['rawAttributes'],function(_0x464350){return{'name':_0x464350[_0xd124('0x29')],'type':_0x464350[_0xd124('0x2a')][_0xd124('0x2b')]};});_0x572a53[_0xd124('0x2c')]=_[_0xd124('0x27')](_0x240cbd,_0xd124('0x24'));_0x572a53[_0xd124('0x2d')]=_['keys'](_0x4035ca['query']);_0x572a53[_0xd124('0x2e')]=_[_0xd124('0x2f')](_0x572a53[_0xd124('0x2c')],_0x572a53[_0xd124('0x2d')]);_0x1d02f3[_0xd124('0x30')]=_[_0xd124('0x2f')](_0x572a53['model'],qs[_0xd124('0x31')](_0x4035ca[_0xd124('0x2d')]['fields']));_0x1d02f3[_0xd124('0x30')]=_0x1d02f3[_0xd124('0x30')][_0xd124('0x32')]?_0x1d02f3[_0xd124('0x30')]:_0x572a53[_0xd124('0x2c')];if(!_0x4035ca[_0xd124('0x2d')]['hasOwnProperty'](_0xd124('0x33'))){_0x1d02f3[_0xd124('0x1b')]=qs[_0xd124('0x1b')](_0x4035ca[_0xd124('0x2d')][_0xd124('0x1b')]);_0x1d02f3[_0xd124('0x34')]=qs[_0xd124('0x34')](_0x4035ca[_0xd124('0x2d')][_0xd124('0x34')]);}_0x1d02f3['order']=qs['sort'](_0x4035ca[_0xd124('0x2d')]['sort']);_0x1d02f3[_0xd124('0x35')]=qs[_0xd124('0x2e')](_['pick'](_0x4035ca[_0xd124('0x2d')],_0x572a53[_0xd124('0x2e')]),_0x240cbd);if(_0x4035ca[_0xd124('0x2d')]['filter']){_0x1d02f3[_0xd124('0x35')]=_[_0xd124('0x36')](_0x1d02f3[_0xd124('0x35')],{'$or':_['map'](_0x240cbd,function(_0x2203a1){if(_0x2203a1[_0xd124('0x2a')]!==_0xd124('0x37')){var _0x216c0b={};_0x216c0b[_0x2203a1[_0xd124('0x24')]]={'$like':'%'+_0x4035ca['query'][_0xd124('0x38')]+'%'};return _0x216c0b;}})});}_0x1d02f3=_[_0xd124('0x36')]({},_0x1d02f3,_0x4035ca[_0xd124('0x39')]);var _0x2ac4e8={'where':_0x1d02f3[_0xd124('0x35')]};return db[_0xd124('0x28')][_0xd124('0x1c')](_0x2ac4e8)[_0xd124('0x21')](function(_0x5c3747){_0x956c49[_0xd124('0x1c')]=_0x5c3747;if(_0x4035ca[_0xd124('0x2d')][_0xd124('0x3a')]){_0x1d02f3[_0xd124('0x3b')]=[{'all':!![]}];}return db[_0xd124('0x28')][_0xd124('0x3c')](_0x1d02f3);})[_0xd124('0x21')](function(_0x4e0778){_0x956c49[_0xd124('0x3d')]=_0x4e0778;return _0x956c49;})[_0xd124('0x21')](respondWithFilteredResult(_0x309bbf,_0x1d02f3))[_0xd124('0x3e')](handleError(_0x309bbf,null));};exports[_0xd124('0x3f')]=function(_0xf62772,_0x126e9f){var _0x51a213={'raw':!![],'where':{'id':_0xf62772['params']['id']}},_0x403e01={};_0x403e01['model']=_[_0xd124('0x40')](db[_0xd124('0x28')]['rawAttributes']);_0x403e01['query']=_[_0xd124('0x40')](_0xf62772['query']);_0x403e01[_0xd124('0x2e')]=_[_0xd124('0x2f')](_0x403e01[_0xd124('0x2c')],_0x403e01[_0xd124('0x2d')]);_0x51a213[_0xd124('0x30')]=_[_0xd124('0x2f')](_0x403e01['model'],qs[_0xd124('0x31')](_0xf62772[_0xd124('0x2d')][_0xd124('0x31')]));_0x51a213[_0xd124('0x30')]=_0x51a213[_0xd124('0x30')][_0xd124('0x32')]?_0x51a213[_0xd124('0x30')]:_0x403e01[_0xd124('0x2c')];if(_0xf62772[_0xd124('0x2d')]['includeAll']){_0x51a213['include']=[{'all':!![]}];}_0x51a213=_['merge']({},_0x51a213,_0xf62772['options']);return db['VoiceQueuesLog'][_0xd124('0x41')](_0x51a213)[_0xd124('0x21')](handleEntityNotFound(_0x126e9f,null))[_0xd124('0x21')](respondWithResult(_0x126e9f,null))[_0xd124('0x3e')](handleError(_0x126e9f,null));};exports[_0xd124('0x42')]=function(_0x49e69f,_0xbfc645){return db[_0xd124('0x28')][_0xd124('0x42')](_0x49e69f['body'],{})[_0xd124('0x21')](respondWithResult(_0xbfc645,0xc9))[_0xd124('0x3e')](handleError(_0xbfc645,null));};exports[_0xd124('0x20')]=function(_0x153f66,_0x300a26){if(_0x153f66[_0xd124('0x43')]['id']){delete _0x153f66[_0xd124('0x43')]['id'];}return db[_0xd124('0x28')][_0xd124('0x41')]({'where':{'id':_0x153f66['params']['id']}})['then'](handleEntityNotFound(_0x300a26,null))['then'](saveUpdates(_0x153f66[_0xd124('0x43')],null))[_0xd124('0x21')](respondWithResult(_0x300a26,null))[_0xd124('0x3e')](handleError(_0x300a26,null));};exports[_0xd124('0x44')]=function(_0x3b9c46,_0x48fa70){return db[_0xd124('0x28')][_0xd124('0x41')]({'where':{'id':_0x3b9c46[_0xd124('0x45')]['id']}})[_0xd124('0x21')](handleEntityNotFound(_0x48fa70,null))[_0xd124('0x21')](removeEntity(_0x48fa70,null))['catch'](handleError(_0x48fa70,null));};
\ No newline at end of file
+var _0x9d24=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','find'];(function(_0x2afb17,_0xb56d2f){var _0x12c7a1=function(_0x59e103){while(--_0x59e103){_0x2afb17['push'](_0x2afb17['shift']());}};_0x12c7a1(++_0xb56d2f);}(_0x9d24,0x1be));var _0x49d2=function(_0x41f146,_0x570246){_0x41f146=_0x41f146-0x0;var _0xe28f8=_0x9d24[_0x41f146];return _0xe28f8;};'use strict';var emlformat=require(_0x49d2('0x0'));var rimraf=require(_0x49d2('0x1'));var zipdir=require(_0x49d2('0x2'));var jsonpatch=require(_0x49d2('0x3'));var rp=require(_0x49d2('0x4'));var moment=require(_0x49d2('0x5'));var BPromise=require(_0x49d2('0x6'));var Mustache=require(_0x49d2('0x7'));var util=require(_0x49d2('0x8'));var path=require(_0x49d2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49d2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x49d2('0xb'));var querystring=require(_0x49d2('0xc'));var Papa=require(_0x49d2('0xd'));var Redis=require(_0x49d2('0xe'));var authService=require(_0x49d2('0xf'));var qs=require(_0x49d2('0x10'));var as=require(_0x49d2('0x11'));var hardwareService=require(_0x49d2('0x12'));var logger=require('../../config/logger')(_0x49d2('0x13'));var utils=require(_0x49d2('0x14'));var config=require(_0x49d2('0x15'));var licenseUtil=require(_0x49d2('0x16'));var db=require(_0x49d2('0x17'))['db'];function respondWithStatusCode(_0x598ead,_0x1d6a74){_0x1d6a74=_0x1d6a74||0xcc;return function(_0x1225ec){if(_0x1225ec){return _0x598ead[_0x49d2('0x18')](_0x1d6a74);}return _0x598ead[_0x49d2('0x19')](_0x1d6a74)[_0x49d2('0x1a')]();};}function respondWithResult(_0x1b86cb,_0x7cdf75){_0x7cdf75=_0x7cdf75||0xc8;return function(_0xc6ce4c){if(_0xc6ce4c){return _0x1b86cb[_0x49d2('0x19')](_0x7cdf75)['json'](_0xc6ce4c);}};}function respondWithFilteredResult(_0x53276c,_0x526f17){return function(_0x156ca2){if(_0x156ca2){var _0x396bf1=typeof _0x526f17[_0x49d2('0x1b')]===_0x49d2('0x1c')&&typeof _0x526f17[_0x49d2('0x1d')]===_0x49d2('0x1c');var _0xdb37eb=_0x156ca2[_0x49d2('0x1e')];var _0x23a746=_0x396bf1?0x0:_0x526f17['offset'];var _0x29b8c7=_0x396bf1?_0x156ca2[_0x49d2('0x1e')]:_0x526f17[_0x49d2('0x1b')]+_0x526f17[_0x49d2('0x1d')];var _0x1389fd;if(_0x29b8c7>=_0xdb37eb){_0x29b8c7=_0xdb37eb;_0x1389fd=0xc8;}else{_0x1389fd=0xce;}_0x53276c[_0x49d2('0x19')](_0x1389fd);return _0x53276c['set']('Content-Range',_0x23a746+'-'+_0x29b8c7+'/'+_0xdb37eb)[_0x49d2('0x1f')](_0x156ca2);}return null;};}function patchUpdates(_0x12cd14){return function(_0x164078){try{jsonpatch[_0x49d2('0x20')](_0x164078,_0x12cd14,!![]);}catch(_0x4f1254){return BPromise[_0x49d2('0x21')](_0x4f1254);}return _0x164078[_0x49d2('0x22')]();};}function saveUpdates(_0x239497,_0x46d43d){return function(_0x2a5691){if(_0x2a5691){return _0x2a5691[_0x49d2('0x23')](_0x239497)[_0x49d2('0x24')](function(_0x284650){return _0x284650;});}return null;};}function removeEntity(_0x25fffa,_0x513e74){return function(_0x51b54b){if(_0x51b54b){return _0x51b54b[_0x49d2('0x25')]()[_0x49d2('0x24')](function(){_0x25fffa[_0x49d2('0x19')](0xcc)[_0x49d2('0x1a')]();});}};}function handleEntityNotFound(_0x2611d1,_0x2ac35a){return function(_0x5b61e9){if(!_0x5b61e9){_0x2611d1[_0x49d2('0x18')](0x194);}return _0x5b61e9;};}function handleError(_0x2d14e5,_0x1af14e){_0x1af14e=_0x1af14e||0x1f4;return function(_0x50eaf2){logger[_0x49d2('0x26')](_0x50eaf2[_0x49d2('0x27')]);if(_0x50eaf2[_0x49d2('0x28')]){delete _0x50eaf2[_0x49d2('0x28')];}_0x2d14e5[_0x49d2('0x19')](_0x1af14e)['send'](_0x50eaf2);};}exports[_0x49d2('0x29')]=function(_0x363962,_0x16fbb1){var _0x2637e0={},_0x5af878={},_0x29fdab={'count':0x0,'rows':[]};var _0x49a39a=_[_0x49d2('0x2a')](db[_0x49d2('0x2b')]['rawAttributes'],function(_0x4a4171){return{'name':_0x4a4171[_0x49d2('0x2c')],'type':_0x4a4171[_0x49d2('0x2d')][_0x49d2('0x2e')]};});_0x5af878[_0x49d2('0x2f')]=_[_0x49d2('0x2a')](_0x49a39a,_0x49d2('0x28'));_0x5af878[_0x49d2('0x30')]=_[_0x49d2('0x31')](_0x363962['query']);_0x5af878['filters']=_['intersection'](_0x5af878[_0x49d2('0x2f')],_0x5af878[_0x49d2('0x30')]);_0x2637e0[_0x49d2('0x32')]=_[_0x49d2('0x33')](_0x5af878[_0x49d2('0x2f')],qs['fields'](_0x363962[_0x49d2('0x30')]['fields']));_0x2637e0[_0x49d2('0x32')]=_0x2637e0['attributes'][_0x49d2('0x34')]?_0x2637e0[_0x49d2('0x32')]:_0x5af878['model'];if(!_0x363962[_0x49d2('0x30')][_0x49d2('0x35')](_0x49d2('0x36'))){_0x2637e0[_0x49d2('0x1d')]=qs[_0x49d2('0x1d')](_0x363962[_0x49d2('0x30')][_0x49d2('0x1d')]);_0x2637e0[_0x49d2('0x1b')]=qs['offset'](_0x363962[_0x49d2('0x30')][_0x49d2('0x1b')]);}_0x2637e0['order']=qs[_0x49d2('0x37')](_0x363962[_0x49d2('0x30')]['sort']);_0x2637e0[_0x49d2('0x38')]=qs['filters'](_[_0x49d2('0x39')](_0x363962[_0x49d2('0x30')],_0x5af878[_0x49d2('0x3a')]),_0x49a39a);if(_0x363962['query'][_0x49d2('0x3b')]){_0x2637e0['where']=_['merge'](_0x2637e0[_0x49d2('0x38')],{'$or':_['map'](_0x49a39a,function(_0x10d4c4){if(_0x10d4c4[_0x49d2('0x2d')]!==_0x49d2('0x3c')){var _0x575194={};_0x575194[_0x10d4c4['name']]={'$like':'%'+_0x363962[_0x49d2('0x30')][_0x49d2('0x3b')]+'%'};return _0x575194;}})});}_0x2637e0=_['merge']({},_0x2637e0,_0x363962[_0x49d2('0x3d')]);var _0x118cb6={'where':_0x2637e0[_0x49d2('0x38')]};return db['VoiceQueuesLog'][_0x49d2('0x1e')](_0x118cb6)[_0x49d2('0x24')](function(_0x59e4ab){_0x29fdab[_0x49d2('0x1e')]=_0x59e4ab;if(_0x363962[_0x49d2('0x30')]['includeAll']){_0x2637e0[_0x49d2('0x3e')]=[{'all':!![]}];}return db[_0x49d2('0x2b')][_0x49d2('0x3f')](_0x2637e0);})[_0x49d2('0x24')](function(_0x2e2142){_0x29fdab[_0x49d2('0x40')]=_0x2e2142;return _0x29fdab;})[_0x49d2('0x24')](respondWithFilteredResult(_0x16fbb1,_0x2637e0))[_0x49d2('0x41')](handleError(_0x16fbb1,null));};exports[_0x49d2('0x42')]=function(_0xd3a8f4,_0x49418f){var _0x119b8f={'raw':!![],'where':{'id':_0xd3a8f4[_0x49d2('0x43')]['id']}},_0x4d5f1e={};_0x4d5f1e['model']=_[_0x49d2('0x31')](db['VoiceQueuesLog'][_0x49d2('0x44')]);_0x4d5f1e[_0x49d2('0x30')]=_[_0x49d2('0x31')](_0xd3a8f4['query']);_0x4d5f1e[_0x49d2('0x3a')]=_[_0x49d2('0x33')](_0x4d5f1e[_0x49d2('0x2f')],_0x4d5f1e[_0x49d2('0x30')]);_0x119b8f[_0x49d2('0x32')]=_[_0x49d2('0x33')](_0x4d5f1e[_0x49d2('0x2f')],qs[_0x49d2('0x45')](_0xd3a8f4[_0x49d2('0x30')][_0x49d2('0x45')]));_0x119b8f['attributes']=_0x119b8f[_0x49d2('0x32')][_0x49d2('0x34')]?_0x119b8f[_0x49d2('0x32')]:_0x4d5f1e[_0x49d2('0x2f')];if(_0xd3a8f4[_0x49d2('0x30')]['includeAll']){_0x119b8f['include']=[{'all':!![]}];}_0x119b8f=_[_0x49d2('0x46')]({},_0x119b8f,_0xd3a8f4[_0x49d2('0x3d')]);return db['VoiceQueuesLog'][_0x49d2('0x47')](_0x119b8f)[_0x49d2('0x24')](handleEntityNotFound(_0x49418f,null))[_0x49d2('0x24')](respondWithResult(_0x49418f,null))[_0x49d2('0x41')](handleError(_0x49418f,null));};exports[_0x49d2('0x48')]=function(_0x3e152a,_0x4a162c){return db['VoiceQueuesLog'][_0x49d2('0x48')](_0x3e152a[_0x49d2('0x49')],{})[_0x49d2('0x24')](respondWithResult(_0x4a162c,0xc9))[_0x49d2('0x41')](handleError(_0x4a162c,null));};exports[_0x49d2('0x23')]=function(_0x4f1a57,_0x769a77){if(_0x4f1a57[_0x49d2('0x49')]['id']){delete _0x4f1a57[_0x49d2('0x49')]['id'];}return db[_0x49d2('0x2b')][_0x49d2('0x47')]({'where':{'id':_0x4f1a57[_0x49d2('0x43')]['id']}})['then'](handleEntityNotFound(_0x769a77,null))[_0x49d2('0x24')](saveUpdates(_0x4f1a57[_0x49d2('0x49')],null))['then'](respondWithResult(_0x769a77,null))[_0x49d2('0x41')](handleError(_0x769a77,null));};exports[_0x49d2('0x25')]=function(_0x673f3b,_0xb126d7){return db[_0x49d2('0x2b')][_0x49d2('0x47')]({'where':{'id':_0x673f3b[_0x49d2('0x43')]['id']}})[_0x49d2('0x24')](handleEntityNotFound(_0xb126d7,null))['then'](removeEntity(_0xb126d7,null))[_0x49d2('0x41')](handleError(_0xb126d7,null));};
\ No newline at end of file
index 49051c9..5a654b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafcc=['exports','event_dtm','event','dtm','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x34d04d,_0xadbc51){var _0x4900b4=function(_0x461cdc){while(--_0x461cdc){_0x34d04d['push'](_0x34d04d['shift']());}};_0x4900b4(++_0xadbc51);}(_0xafcc,0x154));var _0xcafc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafcc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcafc('0x0'));var util=require('util');var logger=require(_0xcafc('0x1'))(_0xcafc('0x2'));var moment=require(_0xcafc('0x3'));var BPromise=require('bluebird');var rp=require(_0xcafc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcafc('0x5'));var config=require(_0xcafc('0x6'));var attributes=require(_0xcafc('0x7'));module[_0xcafc('0x8')]=function(_0x48d41f,_0x5754e4){return _0x48d41f['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xcafc('0x9'),'fields':[_0xcafc('0xa'),_0xcafc('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x0096=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./voiceQueuesLog.attributes','exports','event_dtm','event'];(function(_0x570496,_0x26a150){var _0x1d4204=function(_0x4176cd){while(--_0x4176cd){_0x570496['push'](_0x570496['shift']());}};_0x1d4204(++_0x26a150);}(_0x0096,0xd1));var _0x6009=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x0096[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x6009('0x0'));var util=require(_0x6009('0x1'));var logger=require(_0x6009('0x2'))(_0x6009('0x3'));var moment=require('moment');var BPromise=require(_0x6009('0x4'));var rp=require(_0x6009('0x5'));var fs=require('fs');var path=require(_0x6009('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6009('0x7'));module[_0x6009('0x8')]=function(_0x7c9a07,_0x1e653f){return _0x7c9a07['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x6009('0x9'),'fields':[_0x6009('0xa'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
index 53c8e7b..56e29f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af7=['message','info','result','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','error','code','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x526a46,_0x119cc9){var _0x299cab=function(_0x49722b){while(--_0x49722b){_0x526a46['push'](_0x526a46['shift']());}};_0x299cab(++_0x119cc9);}(_0x5af7,0x9c));var _0x75af=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x5af7[_0x9e0cb3];return _0x5926b7;};'use strict';var _=require(_0x75af('0x0'));var util=require('util');var moment=require(_0x75af('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75af('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x75af('0x3'));var logger=require(_0x75af('0x4'))(_0x75af('0x5'));var config=require('../../config/environment');var jayson=require(_0x75af('0x6'));var client=jayson[_0x75af('0x7')][_0x75af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x218abc,_0xbb268b,_0x374b87){return new BPromise(function(_0x2b0c9d,_0x239700){return client['request'](_0x218abc,_0x374b87)[_0x75af('0x9')](function(_0x58bf3e){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0xbb268b,_0x75af('0xa'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xbb268b,'request\x20sent',JSON['stringify'](_0x58bf3e));if(_0x58bf3e[_0x75af('0xb')]){if(_0x58bf3e['error'][_0x75af('0xc')]===0x1f4){logger[_0x75af('0xb')](_0x75af('0xd'),_0xbb268b,_0x58bf3e[_0x75af('0xb')][_0x75af('0xe')]);return _0x239700(_0x58bf3e['error'][_0x75af('0xe')]);}logger[_0x75af('0xb')](_0x75af('0xd'),_0xbb268b,_0x58bf3e['error'][_0x75af('0xe')]);return _0x2b0c9d(_0x58bf3e[_0x75af('0xb')][_0x75af('0xe')]);}else{logger[_0x75af('0xf')](_0x75af('0xd'),_0xbb268b,'request\x20sent');_0x2b0c9d(_0x58bf3e[_0x75af('0x10')][_0x75af('0xe')]);}})['catch'](function(_0x10ec92){logger[_0x75af('0xb')](_0x75af('0xd'),_0xbb268b,_0x10ec92);_0x239700(_0x10ec92);});});}
\ No newline at end of file
+var _0x0be7=['stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x182ed6,_0x2e966a){var _0x51cb3e=function(_0x4c643e){while(--_0x4c643e){_0x182ed6['push'](_0x182ed6['shift']());}};_0x51cb3e(++_0x2e966a);}(_0x0be7,0xc4));var _0x70be=function(_0x16029e,_0x5671e1){_0x16029e=_0x16029e-0x0;var _0x3c3c9d=_0x0be7[_0x16029e];return _0x3c3c9d;};'use strict';var _=require('lodash');var util=require(_0x70be('0x0'));var moment=require('moment');var BPromise=require(_0x70be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70be('0x2'));var db=require(_0x70be('0x3'))['db'];var utils=require(_0x70be('0x4'));var logger=require(_0x70be('0x5'))(_0x70be('0x6'));var config=require(_0x70be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x70be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8b00,_0x5a8b51,_0x352f03){return new BPromise(function(_0x23373d,_0x11aa1a){return client[_0x70be('0x9')](_0xe8b00,_0x352f03)[_0x70be('0xa')](function(_0x5940c2){logger['info'](_0x70be('0xb'),_0x5a8b51,_0x70be('0xc'));logger[_0x70be('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5a8b51,_0x70be('0xc'),JSON[_0x70be('0xe')](_0x5940c2));if(_0x5940c2[_0x70be('0xf')]){if(_0x5940c2['error'][_0x70be('0x10')]===0x1f4){logger[_0x70be('0xf')](_0x70be('0xb'),_0x5a8b51,_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);return _0x11aa1a(_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);}logger[_0x70be('0xf')](_0x70be('0xb'),_0x5a8b51,_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);return _0x23373d(_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);}else{logger[_0x70be('0x12')](_0x70be('0xb'),_0x5a8b51,'request\x20sent');_0x23373d(_0x5940c2[_0x70be('0x13')][_0x70be('0x11')]);}})[_0x70be('0x14')](function(_0x56e261){logger['error'](_0x70be('0xb'),_0x5a8b51,_0x56e261);_0x11aa1a(_0x56e261);});});}
\ No newline at end of file
index 3a8a5c3..91998f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd39=['connect-timeout','express','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','post','create','put','update','delete','exports','multer','util','path'];(function(_0xe93090,_0x42589a){var _0x41d36e=function(_0x548594){while(--_0x548594){_0xe93090['push'](_0xe93090['shift']());}};_0x41d36e(++_0x42589a);}(_0xfd39,0xe3));var _0x9fd3=function(_0x52d1b0,_0x240cb1){_0x52d1b0=_0x52d1b0-0x0;var _0x66f8da=_0xfd39[_0x52d1b0];return _0x66f8da;};'use strict';var multer=require(_0x9fd3('0x0'));var util=require(_0x9fd3('0x1'));var path=require(_0x9fd3('0x2'));var timeout=require(_0x9fd3('0x3'));var express=require(_0x9fd3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9fd3('0x5'));var controller=require(_0x9fd3('0x6'));router[_0x9fd3('0x7')]('/',auth[_0x9fd3('0x8')](),controller[_0x9fd3('0x9')]);router[_0x9fd3('0x7')](_0x9fd3('0xa'),auth[_0x9fd3('0x8')](),controller['describe']);router[_0x9fd3('0x7')](_0x9fd3('0xb'),auth['isAuthenticated'](),controller[_0x9fd3('0xc')]);router[_0x9fd3('0x7')](_0x9fd3('0xd'),auth[_0x9fd3('0x8')](),controller[_0x9fd3('0xe')]);router[_0x9fd3('0x7')](_0x9fd3('0xf'),controller['downloads']);router[_0x9fd3('0x7')](_0x9fd3('0x10'),auth[_0x9fd3('0x8')](),controller['downloadTranscribe']);router[_0x9fd3('0x11')]('/',auth[_0x9fd3('0x8')](),controller[_0x9fd3('0x12')]);router[_0x9fd3('0x11')](_0x9fd3('0x10'),auth[_0x9fd3('0x8')](),controller['runTranscribe']);router[_0x9fd3('0x13')](_0x9fd3('0xb'),auth[_0x9fd3('0x8')](),controller[_0x9fd3('0x14')]);router[_0x9fd3('0x15')](_0x9fd3('0xb'),auth[_0x9fd3('0x8')](),controller['destroy']);module[_0x9fd3('0x16')]=router;
\ No newline at end of file
+var _0x2160=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','/:id','update','delete','destroy','util','path','Router'];(function(_0x22d178,_0x4a3880){var _0xe3d17c=function(_0x1e67c1){while(--_0x1e67c1){_0x22d178['push'](_0x22d178['shift']());}};_0xe3d17c(++_0x4a3880);}(_0x2160,0x15c));var _0x0216=function(_0x372726,_0x1c43ff){_0x372726=_0x372726-0x0;var _0x5e7cb7=_0x2160[_0x372726];return _0x5e7cb7;};'use strict';var multer=require('multer');var util=require(_0x0216('0x0'));var path=require(_0x0216('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0216('0x2')]();var fs_extra=require(_0x0216('0x3'));var auth=require(_0x0216('0x4'));var interaction=require(_0x0216('0x5'));var config=require(_0x0216('0x6'));var controller=require(_0x0216('0x7'));router[_0x0216('0x8')]('/',auth[_0x0216('0x9')](),controller[_0x0216('0xa')]);router['get'](_0x0216('0xb'),auth[_0x0216('0x9')](),controller[_0x0216('0xc')]);router[_0x0216('0x8')]('/:id',auth[_0x0216('0x9')](),controller[_0x0216('0xd')]);router['get'](_0x0216('0xe'),auth[_0x0216('0x9')](),controller[_0x0216('0xf')]);router[_0x0216('0x8')](_0x0216('0x10'),controller[_0x0216('0x11')]);router[_0x0216('0x8')](_0x0216('0x12'),auth[_0x0216('0x9')](),controller['downloadTranscribe']);router[_0x0216('0x13')]('/',auth[_0x0216('0x9')](),controller[_0x0216('0x14')]);router[_0x0216('0x13')](_0x0216('0x12'),auth[_0x0216('0x9')](),controller[_0x0216('0x15')]);router[_0x0216('0x16')](_0x0216('0x17'),auth[_0x0216('0x9')](),controller[_0x0216('0x18')]);router[_0x0216('0x19')](_0x0216('0x17'),auth['isAuthenticated'](),controller[_0x0216('0x1a')]);module['exports']=router;
\ No newline at end of file
index ecee9b4..80d1cdc 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(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 87b79a8..2088f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf29f=['decryptFile','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','token','$and','push','secrets','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','Setting','findOne','transcribe','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','then','sendStatus','name','index','map','VoiceRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','includeAll','include','params','rawAttributes','find','catch','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher'];(function(_0x3de5af,_0x13a9a0){var _0x33800c=function(_0x5cf89a){while(--_0x5cf89a){_0x3de5af['push'](_0x3de5af['shift']());}};_0x33800c(++_0x13a9a0);}(_0xf29f,0xe4));var _0xff29=function(_0x198bc8,_0x19de1a){_0x198bc8=_0x198bc8-0x0;var _0x13fa30=_0xf29f[_0x198bc8];return _0x13fa30;};'use strict';var emlformat=require(_0xff29('0x0'));var rimraf=require(_0xff29('0x1'));var zipdir=require(_0xff29('0x2'));var jsonpatch=require(_0xff29('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff29('0x4'));var Mustache=require(_0xff29('0x5'));var util=require(_0xff29('0x6'));var path=require(_0xff29('0x7'));var sox=require(_0xff29('0x8'));var csv=require('to-csv');var ejs=require(_0xff29('0x9'));var fs=require('fs');var fs_extra=require(_0xff29('0xa'));var _=require(_0xff29('0xb'));var squel=require('squel');var crypto=require(_0xff29('0xc'));var jsforce=require(_0xff29('0xd'));var deskjs=require(_0xff29('0xe'));var toCsv=require(_0xff29('0xf'));var querystring=require(_0xff29('0x10'));var Papa=require(_0xff29('0x11'));var AWS=require(_0xff29('0x12'));var uuidv4=require(_0xff29('0x13'));var Redis=require(_0xff29('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xff29('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff29('0x16'));var logger=require(_0xff29('0x17'))('api');var utils=require(_0xff29('0x18'));var config=require(_0xff29('0x19'));var licenseUtil=require(_0xff29('0x1a'));var db=require(_0xff29('0x1b'))['db'];function respondWithStatusCode(_0x5bff85,_0x365539){_0x365539=_0x365539||0xcc;return function(_0x5b1147){if(_0x5b1147){return _0x5bff85['sendStatus'](_0x365539);}return _0x5bff85[_0xff29('0x1c')](_0x365539)[_0xff29('0x1d')]();};}function respondWithResult(_0x2397b9,_0x47e089){_0x47e089=_0x47e089||0xc8;return function(_0x25af9f){if(_0x25af9f){return _0x2397b9[_0xff29('0x1c')](_0x47e089)[_0xff29('0x1e')](_0x25af9f);}};}function respondWithFilteredResult(_0x29958b,_0x44168f){return function(_0x14f651){if(_0x14f651){var _0x3eaf0a=typeof _0x44168f['offset']==='undefined'&&typeof _0x44168f[_0xff29('0x1f')]===_0xff29('0x20');var _0x555c86=_0x14f651[_0xff29('0x21')];var _0x3634cd=_0x3eaf0a?0x0:_0x44168f['offset'];var _0x370f37=_0x3eaf0a?_0x14f651[_0xff29('0x21')]:_0x44168f[_0xff29('0x22')]+_0x44168f[_0xff29('0x1f')];var _0x180cd1;if(_0x370f37>=_0x555c86){_0x370f37=_0x555c86;_0x180cd1=0xc8;}else{_0x180cd1=0xce;}_0x29958b[_0xff29('0x1c')](_0x180cd1);return _0x29958b[_0xff29('0x23')](_0xff29('0x24'),_0x3634cd+'-'+_0x370f37+'/'+_0x555c86)[_0xff29('0x1e')](_0x14f651);}return null;};}function patchUpdates(_0x4e7feb){return function(_0x43acb0){try{jsonpatch['apply'](_0x43acb0,_0x4e7feb,!![]);}catch(_0x5e605b){return BPromise[_0xff29('0x25')](_0x5e605b);}return _0x43acb0[_0xff29('0x26')]();};}function saveUpdates(_0x35281a,_0x3fb378){return function(_0x320f35){if(_0x320f35){return _0x320f35['update'](_0x35281a)['then'](function(_0x1767c3){return _0x1767c3;});}return null;};}function removeEntity(_0x206572,_0x1a91f5){return function(_0x4fb4c7){if(_0x4fb4c7){return _0x4fb4c7[_0xff29('0x27')]()[_0xff29('0x28')](function(){_0x206572[_0xff29('0x1c')](0xcc)[_0xff29('0x1d')]();});}};}function handleEntityNotFound(_0x24de98,_0x36d4a6){return function(_0x5b9a99){if(!_0x5b9a99){_0x24de98[_0xff29('0x29')](0x194);}return _0x5b9a99;};}function handleError(_0x394e36,_0x17714f){_0x17714f=_0x17714f||0x1f4;return function(_0x1c6baa){logger['error'](_0x1c6baa['stack']);if(_0x1c6baa[_0xff29('0x2a')]){delete _0x1c6baa[_0xff29('0x2a')];}_0x394e36['status'](_0x17714f)['send'](_0x1c6baa);};}exports[_0xff29('0x2b')]=function(_0x261012,_0x432298){var _0xb2bcb4={},_0x1c4af3={},_0x10a3e6={'count':0x0,'rows':[]};var _0x222577=_[_0xff29('0x2c')](db[_0xff29('0x2d')]['rawAttributes'],function(_0x180dd9){return{'name':_0x180dd9['fieldName'],'type':_0x180dd9[_0xff29('0x2e')][_0xff29('0x2f')]};});_0x1c4af3[_0xff29('0x30')]=_[_0xff29('0x31')](_[_0xff29('0x2c')](_0x222577,_0xff29('0x2a')),[_0xff29('0x32')]);_0x1c4af3[_0xff29('0x33')]=_[_0xff29('0x34')](_0x261012[_0xff29('0x33')]);_0x1c4af3[_0xff29('0x35')]=_[_0xff29('0x36')](_0x1c4af3[_0xff29('0x30')],_0x1c4af3[_0xff29('0x33')]);_0xb2bcb4['attributes']=_[_0xff29('0x36')](_0x1c4af3[_0xff29('0x30')],qs[_0xff29('0x37')](_0x261012[_0xff29('0x33')][_0xff29('0x37')]));_0xb2bcb4[_0xff29('0x38')]=_0xb2bcb4['attributes'][_0xff29('0x39')]?_0xb2bcb4[_0xff29('0x38')]:_0x1c4af3[_0xff29('0x30')];if(!_0x261012[_0xff29('0x33')][_0xff29('0x3a')](_0xff29('0x3b'))){_0xb2bcb4['limit']=qs[_0xff29('0x1f')](_0x261012[_0xff29('0x33')]['limit']);_0xb2bcb4[_0xff29('0x22')]=qs[_0xff29('0x22')](_0x261012[_0xff29('0x33')]['offset']);}_0xb2bcb4['order']=qs[_0xff29('0x3c')](_0x261012[_0xff29('0x33')][_0xff29('0x3c')]);_0xb2bcb4['where']=qs['filters'](_['pick'](_0x261012[_0xff29('0x33')],_0x1c4af3[_0xff29('0x35')]),_0x222577);if(_0x261012[_0xff29('0x33')][_0xff29('0x3d')]){_0xb2bcb4[_0xff29('0x3e')]=_['merge'](_0xb2bcb4[_0xff29('0x3e')],{'$or':_[_0xff29('0x2c')](_0x222577,function(_0x962a36){if(_0x962a36[_0xff29('0x2e')]!==_0xff29('0x3f')){var _0x2add99={};_0x2add99[_0x962a36[_0xff29('0x2a')]]={'$like':'%'+_0x261012[_0xff29('0x33')][_0xff29('0x3d')]+'%'};return _0x2add99;}})});}_0xb2bcb4=_['merge']({},_0xb2bcb4,_0x261012[_0xff29('0x40')]);var _0xa0059c={'where':_0xb2bcb4[_0xff29('0x3e')]};return db[_0xff29('0x2d')][_0xff29('0x21')](_0xa0059c)[_0xff29('0x28')](function(_0x28e2eb){_0x10a3e6[_0xff29('0x21')]=_0x28e2eb;if(_0x261012[_0xff29('0x33')][_0xff29('0x41')]){_0xb2bcb4[_0xff29('0x42')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0xb2bcb4);})[_0xff29('0x28')](function(_0x11bf27){_0x10a3e6['rows']=_0x11bf27;return _0x10a3e6;})[_0xff29('0x28')](respondWithFilteredResult(_0x432298,_0xb2bcb4))['catch'](handleError(_0x432298,null));};exports['show']=function(_0x3d033c,_0x3d13d6){var _0x5c3b9b={'raw':![],'where':{'id':_0x3d033c[_0xff29('0x43')]['id']}},_0x130f5b={};_0x130f5b[_0xff29('0x30')]=_['keys'](db['VoiceRecording'][_0xff29('0x44')]);_0x130f5b[_0xff29('0x33')]=_['keys'](_0x3d033c[_0xff29('0x33')]);_0x130f5b[_0xff29('0x35')]=_[_0xff29('0x36')](_0x130f5b[_0xff29('0x30')],_0x130f5b['query']);_0x5c3b9b[_0xff29('0x38')]=_[_0xff29('0x36')](_0x130f5b['model'],qs[_0xff29('0x37')](_0x3d033c[_0xff29('0x33')]['fields']));_0x5c3b9b['attributes']=_0x5c3b9b[_0xff29('0x38')][_0xff29('0x39')]?_0x5c3b9b['attributes']:_0x130f5b[_0xff29('0x30')];if(_0x3d033c['query'][_0xff29('0x41')]){_0x5c3b9b[_0xff29('0x42')]=[{'all':!![]}];}_0x5c3b9b=_['merge']({},_0x5c3b9b,_0x3d033c[_0xff29('0x40')]);return db['VoiceRecording'][_0xff29('0x45')](_0x5c3b9b)[_0xff29('0x28')](handleEntityNotFound(_0x3d13d6,null))['then'](respondWithResult(_0x3d13d6,null))[_0xff29('0x46')](handleError(_0x3d13d6,null));};exports[_0xff29('0x47')]=function(_0x4778cd,_0x254da5){return db[_0xff29('0x2d')][_0xff29('0x47')](_0x4778cd[_0xff29('0x48')],{})[_0xff29('0x28')](respondWithResult(_0x254da5,0xc9))['catch'](handleError(_0x254da5,null));};exports['update']=function(_0x200c8d,_0xb83458){if(_0x200c8d['body']['id']){delete _0x200c8d[_0xff29('0x48')]['id'];}return db[_0xff29('0x2d')]['find']({'where':{'id':_0x200c8d['params']['id']}})[_0xff29('0x28')](handleEntityNotFound(_0xb83458,null))[_0xff29('0x28')](saveUpdates(_0x200c8d[_0xff29('0x48')],null))['then'](respondWithResult(_0xb83458,null))[_0xff29('0x46')](handleError(_0xb83458,null));};exports[_0xff29('0x49')]=function(_0x61c638,_0x9da767){return db['VoiceRecording'][_0xff29('0x49')]()[_0xff29('0x28')](respondWithResult(_0x9da767,null))[_0xff29('0x46')](handleError(_0x9da767,null));};exports['download']=function(_0x418c65,_0x46a198,_0x40a92d){var _0x5c39ac=require(_0xff29('0x4a'));var _0x55b2eb=![];var _0x46d49f={};if(_0x418c65[_0xff29('0x33')][_0xff29('0x2e')]&&_0x418c65[_0xff29('0x33')][_0xff29('0x2e')]===_0xff29('0x4b')){_0x46d49f[_0xff29('0x4b')]=_0x418c65[_0xff29('0x43')]['id'];}else{_0x46d49f['id']=_0x418c65['params']['id'];}return db[_0xff29('0x2d')][_0xff29('0x45')]({'where':_0x46d49f,'attributes':['id',_0xff29('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x46a198,null))[_0xff29('0x28')](function(_0x5b5b60){if(_0x5b5b60){var _0x278cfe=_0x5b5b60[_0xff29('0x4c')];var _0x4d553a=util[_0xff29('0x32')](_0xff29('0x4d'),_0x278cfe);if(fs['existsSync'](_0x4d553a)){_0x55b2eb=!![];return _0x5c39ac[_0xff29('0x4e')](_0x4d553a,_0x278cfe,config['secrets'][_0xff29('0x4f')])[_0xff29('0x28')](function(){return _0x5b5b60;});}return _0x5b5b60;}})[_0xff29('0x28')](function(_0x5c79cb){if(_0x5c79cb){var _0x514df0=_0x5c79cb['value'];if(!fs[_0xff29('0x50')](_0x514df0)){throw new db[(_0xff29('0x51'))][(_0xff29('0x52'))](_0xff29('0x53'));}if(_0x5c79cb[_0xff29('0x54')]){return _0x46a198[_0xff29('0x55')](_0x514df0,_0x5c79cb[_0xff29('0x54')]+path[_0xff29('0x56')](_0x514df0),function(){if(_0x55b2eb){fs[_0xff29('0x57')](_0x514df0);}});}else{return _0x46a198[_0xff29('0x55')](_0x514df0,function(_0x578d65){if(_0x55b2eb){fs[_0xff29('0x57')](_0x514df0);}});}}})['catch'](function(_0x29151f){if(_0x29151f[_0xff29('0x58')]===_0xff29('0x53')){_0x46a198[_0xff29('0x1c')](0x194)[_0xff29('0x59')](_0xff29('0x5a'));}else{return handleError(_0x46a198,null);}});};exports[_0xff29('0x5b')]=function(_0x8c8a62,_0x3af261,_0x3f4c9f){var _0x51eb7d=require(_0xff29('0x4a'));var _0x196c91=![];var _0x3af5c4={'$and':[db[_0xff29('0x5c')][_0xff29('0x3e')](db[_0xff29('0x5c')]['fn'](_0xff29('0x5d'),db[_0xff29('0x5c')]['col'](_0xff29('0x4b'))),_0x8c8a62[_0xff29('0x33')][_0xff29('0x5e')])]};if(_0x8c8a62['query'][_0xff29('0x2e')]&&_0x8c8a62[_0xff29('0x33')]['type']==='uniqueid'){_0x3af5c4[_0xff29('0x5f')][_0xff29('0x60')]({'uniqueid':_0x8c8a62[_0xff29('0x43')]['id']});}else{_0x3af5c4[_0xff29('0x5f')][_0xff29('0x60')]({'id':_0x8c8a62[_0xff29('0x43')]['id']});}return db[_0xff29('0x2d')][_0xff29('0x45')]({'where':_0x3af5c4,'attributes':['id',_0xff29('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x3af261,null))['then'](function(_0x17e111){if(_0x17e111){var _0x28049d=util[_0xff29('0x32')](_0xff29('0x4d'),_0x17e111[_0xff29('0x4c')]);if(fs[_0xff29('0x50')](_0x28049d)){_0x196c91=!![];return _0x51eb7d[_0xff29('0x4e')](_0x28049d,_0x17e111[_0xff29('0x4c')],config[_0xff29('0x61')][_0xff29('0x4f')])[_0xff29('0x28')](function(){return _0x17e111;});}return _0x17e111;}})[_0xff29('0x28')](function(_0x2c7076){if(_0x2c7076){if(!fs['existsSync'](_0x2c7076[_0xff29('0x4c')])){throw new db[(_0xff29('0x51'))][(_0xff29('0x52'))](_0xff29('0x53'));}if(_0x2c7076['filename']){return _0x3af261[_0xff29('0x55')](_0x2c7076[_0xff29('0x4c')],_0x2c7076[_0xff29('0x54')]+path[_0xff29('0x56')](_0x2c7076[_0xff29('0x4c')]),function(){if(_0x196c91){fs[_0xff29('0x57')](_0x2c7076[_0xff29('0x4c')]);}});}else{return _0x3af261[_0xff29('0x55')](_0x2c7076[_0xff29('0x4c')],function(_0x2d910c){if(_0x196c91){fs[_0xff29('0x57')](_0x2c7076[_0xff29('0x4c')]);}});}}})[_0xff29('0x46')](handleError(_0x3af261,null));};exports['destroy']=function(_0x428cdb,_0x166358){return db[_0xff29('0x2d')][_0xff29('0x45')]({'where':{'id':_0x428cdb[_0xff29('0x43')]['id']}})[_0xff29('0x28')](function(_0xb3cbf){if(_['isNil'](_0xb3cbf)){throw new ReferenceError(_0xff29('0x62'));}return _0xb3cbf;})[_0xff29('0x28')](function(_0x2c624a){var _0x287cfb=_0x2c624a[_0xff29('0x4c')];logger[_0xff29('0x63')](_0xff29('0x64'),_0x287cfb);if(!_[_0xff29('0x65')](_0x2c624a[_0xff29('0x4c')])&&fs[_0xff29('0x50')](_0x287cfb)){logger['info'](_0xff29('0x66')+_0x287cfb+_0xff29('0x67'));fs[_0xff29('0x68')](_0x287cfb);}_0x287cfb=_0x287cfb+_0xff29('0x69');if(!_[_0xff29('0x65')](_0x2c624a[_0xff29('0x4c')])&&fs[_0xff29('0x50')](_0x287cfb)){logger['info'](_0xff29('0x66')+_0x287cfb+_0xff29('0x67'));fs[_0xff29('0x68')](_0x287cfb);}return _0x2c624a;})[_0xff29('0x28')](function(_0x46c179){if(!_0x46c179)throw new InternalError();return _0x46c179[_0xff29('0x27')]();})['then'](function(){_0x166358['status'](0xcc)[_0xff29('0x1d')]();})[_0xff29('0x46')](handleError(_0x166358,null));};function getBucketslist(_0x3e591a,_0x30614b,_0x5e690a){return new Promise(function(_0x29120b,_0xb6bef0){var _0x1c1376=new AWS['S3']({'accessKeyId':_0x30614b,'secretAccessKey':_0x3e591a,'region':_0x5e690a});_0x1c1376[_0xff29('0x6a')]({},function(_0x5382e9,_0x46a57d){if(_0x5382e9){return _0xb6bef0(_0x5382e9);}else{return _0x29120b(_0x46a57d);}});});}function createBucket(_0x193d11,_0x83bc8d,_0x20fb4f,_0x171660){return new Promise(function(_0x4ce03e,_0x57ed9c){var _0x3dc735=new AWS['S3']({'accessKeyId':_0x83bc8d,'secretAccessKey':_0x193d11,'region':_0x20fb4f});_0x3dc735[_0xff29('0x6b')]({'Bucket':_0x171660},function(_0x34c257,_0x595160){if(_0x34c257){return _0x57ed9c(_0x34c257);}else{return _0x4ce03e(_0x595160);}});});}function uploadFile(_0x43bb98,_0x35f787,_0x12dd0d,_0x4abc9c,_0x41a084,_0x4ad122){return new Promise(function(_0x40d5b7,_0x320047){var _0x4139ed=new AWS['S3']({'accessKeyId':_0x35f787,'secretAccessKey':_0x43bb98,'region':_0x12dd0d});_0x4139ed[_0xff29('0x6c')]({'Bucket':_0x4abc9c,'Key':_0x41a084,'Body':_0x4ad122},function(_0x43e160,_0x55d4cf){if(_0x43e160){return _0x320047(_0x43e160);}else{return _0x40d5b7(_0x55d4cf);}});});}function startTranscribe(_0x13d4a0,_0x79431d,_0x4b77f5,_0x59f1fd,_0x781375,_0x3d966e){return new Promise(function(_0x1ee07f,_0x58a6f5){var _0x2862df=new AWS[(_0xff29('0x6d'))]({'accessKeyId':_0x79431d,'secretAccessKey':_0x13d4a0,'region':_0x4b77f5});_0x2862df['startTranscriptionJob']({'TranscriptionJobName':_0x59f1fd,'LanguageCode':_0x781375,'Media':{'MediaFileUri':_0x3d966e}},function(_0x103b23,_0x20e54e){if(_0x103b23){return _0x58a6f5(_0x103b23);}else{return _0x1ee07f(_0x20e54e);}});});}function transcribe(_0x45cf42,_0x24a262,_0x551ea6,_0x437c41,_0x520c2d,_0x332573,_0x359da4){return new Promise(function(_0x4db57c,_0x137f29){var _0x277c5d={};logger[_0xff29('0x63')](util[_0xff29('0x32')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x45cf42,_0x520c2d));return uploadFile(_0x24a262,_0x551ea6,_0x437c41,_0x520c2d,path['basename'](_0x332573),fs[_0xff29('0x6e')](_0x332573))[_0xff29('0x28')](function(_0x2769ac){logger[_0xff29('0x63')](util[_0xff29('0x32')](_0xff29('0x6f'),_0x45cf42,_0x520c2d,_0x2769ac['Location']));_0x277c5d[_0xff29('0x70')]=_0x2769ac[_0xff29('0x71')];_0x277c5d[_0xff29('0x72')]=_0x2769ac[_0xff29('0x73')];logger[_0xff29('0x63')](util[_0xff29('0x32')](_0xff29('0x74'),_0x45cf42));return startTranscribe(_0x24a262,_0x551ea6,_0x437c41,uuidv4(),_0x359da4,_0x2769ac[_0xff29('0x73')]);})[_0xff29('0x28')](function(_0x198978){logger[_0xff29('0x63')](util[_0xff29('0x32')](_0xff29('0x75'),_0x45cf42,_0x198978['TranscriptionJob'][_0xff29('0x76')]));_0x277c5d[_0xff29('0x77')]=_0x198978[_0xff29('0x78')]['TranscriptionJobName'];_0x277c5d[_0xff29('0x79')]=_0x198978['TranscriptionJob']['TranscriptionJobStatus'];return _0x4db57c(_0x277c5d);})['catch'](function(_0x35f48d){return _0x137f29(_0x35f48d);});});}exports[_0xff29('0x7a')]=function(_0x4a9862,_0x20532a,_0x1dd29f){var _0x1237f6;var _0x5d6053;var _0x5a3e7b;var _0x5a5336=require(_0xff29('0x4a'));return db[_0xff29('0x2d')]['findOne']({'where':{'id':_0x4a9862[_0xff29('0x43')]['id']}})[_0xff29('0x28')](function(_0x501bdc){if(_0x501bdc){var _0x4e804e=util[_0xff29('0x32')](_0xff29('0x4d'),_0x501bdc[_0xff29('0x4c')]);if(fs[_0xff29('0x50')](_0x4e804e)){cypher=!![];return _0x5a5336['decryptFile'](_0x4e804e,_0x501bdc[_0xff29('0x4c')],config[_0xff29('0x61')]['recording'])[_0xff29('0x28')](function(){return _0x501bdc;});}return _0x501bdc;}})['then'](function(_0x4d261e){if(!_0x4d261e){throw new db[(_0xff29('0x51'))][(_0xff29('0x52'))]('Voice\x20Recording\x20not\x20found');}_0x5d6053=_0x4d261e;return db[_0xff29('0x7b')][_0xff29('0x7c')]({'where':{'id':0x1}});})[_0xff29('0x28')](handleEntityNotFound(_0x20532a,null))['then'](function(_0x44255e){if(_0x44255e){_0x1237f6=_0x44255e;if(!_0x1237f6[_0xff29('0x7d')]||!_0x1237f6['transcribeAccountId']||!_0x1237f6['transcribeRegion']||!_0x1237f6[_0xff29('0x7e')]||!_0x1237f6[_0xff29('0x70')]){throw new db[(_0xff29('0x51'))][(_0xff29('0x52'))](_0xff29('0x7f'));}if(_0x4a9862[_0xff29('0x48')][_0xff29('0x80')]&&(!_0x1237f6[_0xff29('0x81')]||!_0x1237f6[_0xff29('0x82')]||!_0x1237f6[_0xff29('0x83')]||!_0x1237f6[_0xff29('0x7e')]||!_0x1237f6[_0xff29('0x70')])){throw new db['Sequelize'][(_0xff29('0x52'))](_0xff29('0x84'));}return db[_0xff29('0x85')][_0xff29('0x7c')]({'where':{'id':_0x1237f6[_0xff29('0x86')]}});}})[_0xff29('0x28')](function(_0x420420){if(!_0x420420){throw new db[(_0xff29('0x51'))][(_0xff29('0x52'))](_0xff29('0x87'));}if(!_0x420420[_0xff29('0x88')]||!_0x420420[_0xff29('0x89')]){throw new db[(_0xff29('0x51'))]['ValidationError'](_0xff29('0x8a'));}_0x5a3e7b=_0x420420;return getBucketslist(_0x5a3e7b['data1'],_0x5a3e7b[_0xff29('0x89')],_0x1237f6[_0xff29('0x8b')]);})['then'](function(_0x5118a6){if(_0x5118a6&&_0x5118a6[_0xff29('0x8c')]){var _0x877bfa=_['find'](_0x5118a6['Buckets'],function(_0x599640){return _0x599640[_0xff29('0x8d')]===_0x1237f6['bucket'];});if(!_0x877bfa){logger['info'](util[_0xff29('0x32')](_0xff29('0x8e'),_0x4a9862[_0xff29('0x43')]['id'],_0x1237f6[_0xff29('0x70')]));return createBucket(_0x5a3e7b[_0xff29('0x88')],_0x5a3e7b['data2'],_0x1237f6['transcribeRegion'],_0x1237f6['bucket']);}logger[_0xff29('0x63')](util[_0xff29('0x32')](_0xff29('0x8f'),_0x4a9862['params']['id'],_0x1237f6['bucket']));return;}})[_0xff29('0x28')](function(_0x2a5871){if(_0x5d6053[_0xff29('0x79')]==='NEW'){return transcribe(_0x4a9862[_0xff29('0x43')]['id'],_0x5a3e7b[_0xff29('0x88')],_0x5a3e7b[_0xff29('0x89')],_0x1237f6['transcribeRegion'],_0x1237f6[_0xff29('0x70')],_0x5d6053[_0xff29('0x4c')],_0x1237f6[_0xff29('0x7e')]);}else{logger[_0xff29('0x63')](util[_0xff29('0x32')](_0xff29('0x90'),_0x4a9862[_0xff29('0x43')]['id']));return{'transcribeStatus':_0xff29('0x91')};}})[_0xff29('0x28')](function(_0x4f5df3){if(_0x4f5df3){_0x4f5df3[_0xff29('0x92')]=_0x4a9862[_0xff29('0x48')][_0xff29('0x80')];return _0x5d6053['updateAttributes'](_0x4f5df3);}})[_0xff29('0x28')](respondWithResult(_0x20532a,null))[_0xff29('0x46')](handleError(_0x20532a,null));};function writeFile(_0x5f4722,_0x390071){return new Promise(function(_0x185856,_0x53991c){fs[_0xff29('0x93')](_0x390071,_0x5f4722,function(_0x166f7c,_0x15e04d){if(_0x166f7c){return _0x53991c(_0x166f7c);}else{return _0x185856(_0x15e04d);}});});}exports['downloadTranscribe']=function(_0x25e62d,_0x54e7f8,_0x232ea8){return db[_0xff29('0x2d')]['findOne']({'where':{'id':_0x25e62d[_0xff29('0x43')]['id']}})[_0xff29('0x28')](handleEntityNotFound(_0x54e7f8))[_0xff29('0x28')](function(_0x5084b5){if(_0x5084b5&&_0x5084b5[_0xff29('0x94')]){var _0x591fe7=_0x5084b5[_0xff29('0x94')];var _0x887a99=config[_0xff29('0x95')]+_0xff29('0x96')+_0x5084b5['id']+_0xff29('0x97');if(fs[_0xff29('0x50')](_0x887a99)){return _0x887a99;}return writeFile(_0x591fe7,_0x887a99)[_0xff29('0x28')](function(){return _0x887a99;});}else{throw new db[(_0xff29('0x51'))][(_0xff29('0x52'))](_0xff29('0x98'));}})[_0xff29('0x28')](function(_0x3b9345){return _0x54e7f8['download'](_0x3b9345);})['catch'](handleError(_0x54e7f8));};
\ No newline at end of file
+var _0x4925=['save','update','destroy','then','error','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','includeAll','include','findAll','catch','params','filters','length','options','create','body','describe','download','uniqueid','find','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','findOne','secrets','Voice\x20Recording\x20not\x20found','transcribeAccountId','language','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','Name','bucket','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','uuid/v4','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','set','Content-Range','apply','reject'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4925,0x106));var _0x5492=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x4925[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0x5492('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5492('0x1'));var rp=require(_0x5492('0x2'));var moment=require(_0x5492('0x3'));var BPromise=require(_0x5492('0x4'));var Mustache=require('mustache');var util=require(_0x5492('0x5'));var path=require(_0x5492('0x6'));var sox=require(_0x5492('0x7'));var csv=require(_0x5492('0x8'));var ejs=require(_0x5492('0x9'));var fs=require('fs');var fs_extra=require(_0x5492('0xa'));var _=require('lodash');var squel=require(_0x5492('0xb'));var crypto=require(_0x5492('0xc'));var jsforce=require(_0x5492('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5492('0x8'));var querystring=require(_0x5492('0xe'));var Papa=require(_0x5492('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x5492('0x10'));var Redis=require(_0x5492('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5492('0x12'));var hardwareService=require(_0x5492('0x13'));var logger=require(_0x5492('0x14'))(_0x5492('0x15'));var utils=require(_0x5492('0x16'));var config=require(_0x5492('0x17'));var licenseUtil=require(_0x5492('0x18'));var db=require(_0x5492('0x19'))['db'];function respondWithStatusCode(_0xf85b3,_0x2401e0){_0x2401e0=_0x2401e0||0xcc;return function(_0x51a455){if(_0x51a455){return _0xf85b3[_0x5492('0x1a')](_0x2401e0);}return _0xf85b3[_0x5492('0x1b')](_0x2401e0)[_0x5492('0x1c')]();};}function respondWithResult(_0x112550,_0x4d2756){_0x4d2756=_0x4d2756||0xc8;return function(_0x883966){if(_0x883966){return _0x112550[_0x5492('0x1b')](_0x4d2756)[_0x5492('0x1d')](_0x883966);}};}function respondWithFilteredResult(_0x58f911,_0x1313b0){return function(_0x3cb93e){if(_0x3cb93e){var _0x20e493=typeof _0x1313b0[_0x5492('0x1e')]===_0x5492('0x1f')&&typeof _0x1313b0[_0x5492('0x20')]==='undefined';var _0x445576=_0x3cb93e[_0x5492('0x21')];var _0x318f91=_0x20e493?0x0:_0x1313b0[_0x5492('0x1e')];var _0x417f93=_0x20e493?_0x3cb93e['count']:_0x1313b0[_0x5492('0x1e')]+_0x1313b0[_0x5492('0x20')];var _0x1cf7db;if(_0x417f93>=_0x445576){_0x417f93=_0x445576;_0x1cf7db=0xc8;}else{_0x1cf7db=0xce;}_0x58f911[_0x5492('0x1b')](_0x1cf7db);return _0x58f911[_0x5492('0x22')](_0x5492('0x23'),_0x318f91+'-'+_0x417f93+'/'+_0x445576)[_0x5492('0x1d')](_0x3cb93e);}return null;};}function patchUpdates(_0x1fb93c){return function(_0x537b17){try{jsonpatch[_0x5492('0x24')](_0x537b17,_0x1fb93c,!![]);}catch(_0x405b90){return BPromise[_0x5492('0x25')](_0x405b90);}return _0x537b17[_0x5492('0x26')]();};}function saveUpdates(_0x5e724e,_0x29bb50){return function(_0x4a2295){if(_0x4a2295){return _0x4a2295[_0x5492('0x27')](_0x5e724e)['then'](function(_0xd008e3){return _0xd008e3;});}return null;};}function removeEntity(_0x191dd0,_0x113393){return function(_0x2c70ce){if(_0x2c70ce){return _0x2c70ce[_0x5492('0x28')]()[_0x5492('0x29')](function(){_0x191dd0[_0x5492('0x1b')](0xcc)[_0x5492('0x1c')]();});}};}function handleEntityNotFound(_0x293b8a,_0x32e1f2){return function(_0x57a6c3){if(!_0x57a6c3){_0x293b8a[_0x5492('0x1a')](0x194);}return _0x57a6c3;};}function handleError(_0x5ad9e8,_0x4d3a1f){_0x4d3a1f=_0x4d3a1f||0x1f4;return function(_0x2b738e){logger[_0x5492('0x2a')](_0x2b738e['stack']);if(_0x2b738e[_0x5492('0x2b')]){delete _0x2b738e[_0x5492('0x2b')];}_0x5ad9e8[_0x5492('0x1b')](_0x4d3a1f)[_0x5492('0x2c')](_0x2b738e);};}exports['index']=function(_0x3f1f82,_0x36edc3){var _0x1c9173={},_0x4a78d3={},_0x48f2d7={'count':0x0,'rows':[]};var _0x1ab77b=_[_0x5492('0x2d')](db[_0x5492('0x2e')][_0x5492('0x2f')],function(_0x12834c){return{'name':_0x12834c[_0x5492('0x30')],'type':_0x12834c[_0x5492('0x31')][_0x5492('0x32')]};});_0x4a78d3[_0x5492('0x33')]=_[_0x5492('0x34')](_[_0x5492('0x2d')](_0x1ab77b,_0x5492('0x2b')),[_0x5492('0x35')]);_0x4a78d3[_0x5492('0x36')]=_[_0x5492('0x37')](_0x3f1f82[_0x5492('0x36')]);_0x4a78d3['filters']=_['intersection'](_0x4a78d3[_0x5492('0x33')],_0x4a78d3[_0x5492('0x36')]);_0x1c9173[_0x5492('0x38')]=_[_0x5492('0x39')](_0x4a78d3['model'],qs[_0x5492('0x3a')](_0x3f1f82[_0x5492('0x36')]['fields']));_0x1c9173['attributes']=_0x1c9173[_0x5492('0x38')]['length']?_0x1c9173[_0x5492('0x38')]:_0x4a78d3[_0x5492('0x33')];if(!_0x3f1f82['query'][_0x5492('0x3b')](_0x5492('0x3c'))){_0x1c9173[_0x5492('0x20')]=qs[_0x5492('0x20')](_0x3f1f82[_0x5492('0x36')][_0x5492('0x20')]);_0x1c9173['offset']=qs[_0x5492('0x1e')](_0x3f1f82[_0x5492('0x36')][_0x5492('0x1e')]);}_0x1c9173['order']=qs[_0x5492('0x3d')](_0x3f1f82[_0x5492('0x36')]['sort']);_0x1c9173['where']=qs['filters'](_[_0x5492('0x3e')](_0x3f1f82[_0x5492('0x36')],_0x4a78d3['filters']),_0x1ab77b);if(_0x3f1f82[_0x5492('0x36')][_0x5492('0x3f')]){_0x1c9173[_0x5492('0x40')]=_['merge'](_0x1c9173['where'],{'$or':_[_0x5492('0x2d')](_0x1ab77b,function(_0x5405f9){if(_0x5405f9[_0x5492('0x31')]!=='VIRTUAL'){var _0x248c54={};_0x248c54[_0x5405f9[_0x5492('0x2b')]]={'$like':'%'+_0x3f1f82[_0x5492('0x36')][_0x5492('0x3f')]+'%'};return _0x248c54;}})});}_0x1c9173=_['merge']({},_0x1c9173,_0x3f1f82['options']);var _0x5e908b={'where':_0x1c9173[_0x5492('0x40')]};return db[_0x5492('0x2e')][_0x5492('0x21')](_0x5e908b)['then'](function(_0x2e98d1){_0x48f2d7[_0x5492('0x21')]=_0x2e98d1;if(_0x3f1f82[_0x5492('0x36')][_0x5492('0x41')]){_0x1c9173[_0x5492('0x42')]=[{'all':!![]}];}return db[_0x5492('0x2e')][_0x5492('0x43')](_0x1c9173);})['then'](function(_0x3f52e2){_0x48f2d7['rows']=_0x3f52e2;return _0x48f2d7;})['then'](respondWithFilteredResult(_0x36edc3,_0x1c9173))[_0x5492('0x44')](handleError(_0x36edc3,null));};exports['show']=function(_0x3c55b4,_0x488d6c){var _0x57a0be={'raw':![],'where':{'id':_0x3c55b4[_0x5492('0x45')]['id']}},_0x438c42={};_0x438c42['model']=_['keys'](db[_0x5492('0x2e')]['rawAttributes']);_0x438c42[_0x5492('0x36')]=_['keys'](_0x3c55b4[_0x5492('0x36')]);_0x438c42[_0x5492('0x46')]=_[_0x5492('0x39')](_0x438c42['model'],_0x438c42['query']);_0x57a0be[_0x5492('0x38')]=_[_0x5492('0x39')](_0x438c42['model'],qs[_0x5492('0x3a')](_0x3c55b4['query']['fields']));_0x57a0be[_0x5492('0x38')]=_0x57a0be['attributes'][_0x5492('0x47')]?_0x57a0be[_0x5492('0x38')]:_0x438c42[_0x5492('0x33')];if(_0x3c55b4[_0x5492('0x36')][_0x5492('0x41')]){_0x57a0be[_0x5492('0x42')]=[{'all':!![]}];}_0x57a0be=_['merge']({},_0x57a0be,_0x3c55b4[_0x5492('0x48')]);return db[_0x5492('0x2e')]['find'](_0x57a0be)['then'](handleEntityNotFound(_0x488d6c,null))[_0x5492('0x29')](respondWithResult(_0x488d6c,null))[_0x5492('0x44')](handleError(_0x488d6c,null));};exports[_0x5492('0x49')]=function(_0xa6d303,_0x3d7507){return db[_0x5492('0x2e')][_0x5492('0x49')](_0xa6d303[_0x5492('0x4a')],{})[_0x5492('0x29')](respondWithResult(_0x3d7507,0xc9))[_0x5492('0x44')](handleError(_0x3d7507,null));};exports[_0x5492('0x27')]=function(_0x1a5e24,_0x133ca9){if(_0x1a5e24[_0x5492('0x4a')]['id']){delete _0x1a5e24['body']['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x1a5e24[_0x5492('0x45')]['id']}})[_0x5492('0x29')](handleEntityNotFound(_0x133ca9,null))['then'](saveUpdates(_0x1a5e24[_0x5492('0x4a')],null))[_0x5492('0x29')](respondWithResult(_0x133ca9,null))[_0x5492('0x44')](handleError(_0x133ca9,null));};exports[_0x5492('0x4b')]=function(_0x435b0b,_0x330b4e){return db[_0x5492('0x2e')][_0x5492('0x4b')]()[_0x5492('0x29')](respondWithResult(_0x330b4e,null))[_0x5492('0x44')](handleError(_0x330b4e,null));};exports[_0x5492('0x4c')]=function(_0x3c1ddd,_0x4bcdcc,_0x2b670f){var _0x21d854=require('../../components/encryptor');var _0x2402cb=![];var _0x388e66={};if(_0x3c1ddd[_0x5492('0x36')][_0x5492('0x31')]&&_0x3c1ddd[_0x5492('0x36')]['type']===_0x5492('0x4d')){_0x388e66[_0x5492('0x4d')]=_0x3c1ddd['params']['id'];}else{_0x388e66['id']=_0x3c1ddd['params']['id'];}return db[_0x5492('0x2e')][_0x5492('0x4e')]({'where':_0x388e66,'attributes':['id',_0x5492('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x4bcdcc,null))[_0x5492('0x29')](function(_0x3109dc){if(_0x3109dc){var _0x3941c6=_0x3109dc[_0x5492('0x4f')];var _0x31e776=util[_0x5492('0x35')](_0x5492('0x50'),_0x3941c6);if(fs[_0x5492('0x51')](_0x31e776)){_0x2402cb=!![];return _0x21d854[_0x5492('0x52')](_0x31e776,_0x3941c6,config['secrets'][_0x5492('0x53')])[_0x5492('0x29')](function(){return _0x3109dc;});}return _0x3109dc;}})[_0x5492('0x29')](function(_0x50b68a){if(_0x50b68a){var _0x30bd40=_0x50b68a['value'];if(!fs['existsSync'](_0x30bd40)){throw new db[(_0x5492('0x54'))][(_0x5492('0x55'))](_0x5492('0x56'));}if(_0x50b68a[_0x5492('0x57')]){return _0x4bcdcc[_0x5492('0x4c')](_0x30bd40,_0x50b68a[_0x5492('0x57')]+path['extname'](_0x30bd40),function(){if(_0x2402cb){fs[_0x5492('0x58')](_0x30bd40);}});}else{return _0x4bcdcc[_0x5492('0x4c')](_0x30bd40,function(_0x2b0f19){if(_0x2402cb){fs['unlink'](_0x30bd40);}});}}})[_0x5492('0x44')](function(_0x331129){if(_0x331129[_0x5492('0x59')]==='VoiceRecording\x20not\x20found'){_0x4bcdcc[_0x5492('0x1b')](0x194)[_0x5492('0x2c')](_0x5492('0x5a'));}else{return handleError(_0x4bcdcc,null);}});};exports[_0x5492('0x5b')]=function(_0x3246d2,_0x4f27cf,_0x10f67d){var _0x142634=require(_0x5492('0x5c'));var _0x2bd50=![];var _0x4f2f77={'$and':[db[_0x5492('0x5d')][_0x5492('0x40')](db[_0x5492('0x5d')]['fn'](_0x5492('0x5e'),db[_0x5492('0x5d')][_0x5492('0x5f')](_0x5492('0x4d'))),_0x3246d2[_0x5492('0x36')]['token'])]};if(_0x3246d2[_0x5492('0x36')][_0x5492('0x31')]&&_0x3246d2[_0x5492('0x36')]['type']===_0x5492('0x4d')){_0x4f2f77[_0x5492('0x60')][_0x5492('0x61')]({'uniqueid':_0x3246d2['params']['id']});}else{_0x4f2f77[_0x5492('0x60')]['push']({'id':_0x3246d2['params']['id']});}return db[_0x5492('0x2e')][_0x5492('0x4e')]({'where':_0x4f2f77,'attributes':['id',_0x5492('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x4f27cf,null))['then'](function(_0x1a188a){if(_0x1a188a){var _0xe70da8=util[_0x5492('0x35')]('%s.cypher',_0x1a188a['value']);if(fs[_0x5492('0x51')](_0xe70da8)){_0x2bd50=!![];return _0x142634['decryptFile'](_0xe70da8,_0x1a188a['value'],config['secrets'][_0x5492('0x53')])['then'](function(){return _0x1a188a;});}return _0x1a188a;}})[_0x5492('0x29')](function(_0x579387){if(_0x579387){if(!fs[_0x5492('0x51')](_0x579387[_0x5492('0x4f')])){throw new db[(_0x5492('0x54'))]['ValidationError'](_0x5492('0x56'));}if(_0x579387[_0x5492('0x57')]){return _0x4f27cf['download'](_0x579387[_0x5492('0x4f')],_0x579387[_0x5492('0x57')]+path['extname'](_0x579387[_0x5492('0x4f')]),function(){if(_0x2bd50){fs[_0x5492('0x58')](_0x579387[_0x5492('0x4f')]);}});}else{return _0x4f27cf[_0x5492('0x4c')](_0x579387[_0x5492('0x4f')],function(_0x11989c){if(_0x2bd50){fs[_0x5492('0x58')](_0x579387[_0x5492('0x4f')]);}});}}})['catch'](handleError(_0x4f27cf,null));};exports[_0x5492('0x28')]=function(_0x29db74,_0x501cf4){return db[_0x5492('0x2e')][_0x5492('0x4e')]({'where':{'id':_0x29db74['params']['id']}})[_0x5492('0x29')](function(_0x96fd31){if(_[_0x5492('0x62')](_0x96fd31)){throw new ReferenceError(_0x5492('0x63'));}return _0x96fd31;})['then'](function(_0x5468e1){var _0x19fbad=_0x5468e1[_0x5492('0x4f')];logger[_0x5492('0x64')](_0x5492('0x65'),_0x19fbad);if(!_[_0x5492('0x62')](_0x5468e1[_0x5492('0x4f')])&&fs[_0x5492('0x51')](_0x19fbad)){logger[_0x5492('0x64')](_0x5492('0x66')+_0x19fbad+_0x5492('0x67'));fs[_0x5492('0x68')](_0x19fbad);}_0x19fbad=_0x19fbad+_0x5492('0x69');if(!_[_0x5492('0x62')](_0x5468e1[_0x5492('0x4f')])&&fs[_0x5492('0x51')](_0x19fbad)){logger['info']('File:\x20\x22'+_0x19fbad+_0x5492('0x67'));fs[_0x5492('0x68')](_0x19fbad);}return _0x5468e1;})[_0x5492('0x29')](function(_0x37192f){if(!_0x37192f)throw new InternalError();return _0x37192f['destroy']();})[_0x5492('0x29')](function(){_0x501cf4['status'](0xcc)[_0x5492('0x1c')]();})['catch'](handleError(_0x501cf4,null));};function getBucketslist(_0x15783a,_0x12c040,_0x56c926){return new Promise(function(_0x5e4682,_0x25f951){var _0x22e06b=new AWS['S3']({'accessKeyId':_0x12c040,'secretAccessKey':_0x15783a,'region':_0x56c926});_0x22e06b[_0x5492('0x6a')]({},function(_0x1f81d6,_0x175b00){if(_0x1f81d6){return _0x25f951(_0x1f81d6);}else{return _0x5e4682(_0x175b00);}});});}function createBucket(_0x35a1cf,_0x40fa83,_0x5065e0,_0x5be092){return new Promise(function(_0xe27159,_0x3e878f){var _0x5b1e9f=new AWS['S3']({'accessKeyId':_0x40fa83,'secretAccessKey':_0x35a1cf,'region':_0x5065e0});_0x5b1e9f[_0x5492('0x6b')]({'Bucket':_0x5be092},function(_0x14d2b5,_0x173533){if(_0x14d2b5){return _0x3e878f(_0x14d2b5);}else{return _0xe27159(_0x173533);}});});}function uploadFile(_0x4f0f50,_0x1a264d,_0x332d73,_0x168d62,_0xfc49ce,_0xca8189){return new Promise(function(_0x19c6a0,_0x58b859){var _0x4d2d05=new AWS['S3']({'accessKeyId':_0x1a264d,'secretAccessKey':_0x4f0f50,'region':_0x332d73});_0x4d2d05[_0x5492('0x6c')]({'Bucket':_0x168d62,'Key':_0xfc49ce,'Body':_0xca8189},function(_0x2159db,_0x58218f){if(_0x2159db){return _0x58b859(_0x2159db);}else{return _0x19c6a0(_0x58218f);}});});}function startTranscribe(_0xfef021,_0x329e45,_0x336d9e,_0x246f14,_0x5c8be4,_0x373323){return new Promise(function(_0x502f74,_0x466ee9){var _0x4ca343=new AWS['TranscribeService']({'accessKeyId':_0x329e45,'secretAccessKey':_0xfef021,'region':_0x336d9e});_0x4ca343[_0x5492('0x6d')]({'TranscriptionJobName':_0x246f14,'LanguageCode':_0x5c8be4,'Media':{'MediaFileUri':_0x373323}},function(_0x297b66,_0x57204a){if(_0x297b66){return _0x466ee9(_0x297b66);}else{return _0x502f74(_0x57204a);}});});}function transcribe(_0x2c9d51,_0x38d5b2,_0x4b0a0d,_0x42d634,_0x171ed3,_0x10c7ba,_0x2590b6){return new Promise(function(_0x42fd20,_0x1f14e9){var _0x11824f={};logger[_0x5492('0x64')](util['format'](_0x5492('0x6e'),_0x2c9d51,_0x171ed3));return uploadFile(_0x38d5b2,_0x4b0a0d,_0x42d634,_0x171ed3,path['basename'](_0x10c7ba),fs[_0x5492('0x6f')](_0x10c7ba))['then'](function(_0x5d3209){logger['info'](util[_0x5492('0x35')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x2c9d51,_0x171ed3,_0x5d3209['Location']));_0x11824f['bucket']=_0x5d3209['Bucket'];_0x11824f[_0x5492('0x70')]=_0x5d3209[_0x5492('0x71')];logger['info'](util[_0x5492('0x35')](_0x5492('0x72'),_0x2c9d51));return startTranscribe(_0x38d5b2,_0x4b0a0d,_0x42d634,uuidv4(),_0x2590b6,_0x5d3209[_0x5492('0x71')]);})['then'](function(_0x20d089){logger['info'](util[_0x5492('0x35')](_0x5492('0x73'),_0x2c9d51,_0x20d089[_0x5492('0x74')][_0x5492('0x75')]));_0x11824f[_0x5492('0x76')]=_0x20d089[_0x5492('0x74')][_0x5492('0x75')];_0x11824f[_0x5492('0x77')]=_0x20d089['TranscriptionJob']['TranscriptionJobStatus'];return _0x42fd20(_0x11824f);})[_0x5492('0x44')](function(_0x59e274){return _0x1f14e9(_0x59e274);});});}exports['runTranscribe']=function(_0x399c06,_0x111fa0,_0x3a45be){var _0x2eff96;var _0x46ca07;var _0x34d384;var _0x382bdc=require(_0x5492('0x5c'));return db[_0x5492('0x2e')][_0x5492('0x78')]({'where':{'id':_0x399c06[_0x5492('0x45')]['id']}})[_0x5492('0x29')](function(_0x1d2ecb){if(_0x1d2ecb){var _0x4efd8e=util[_0x5492('0x35')](_0x5492('0x50'),_0x1d2ecb[_0x5492('0x4f')]);if(fs[_0x5492('0x51')](_0x4efd8e)){cypher=!![];return _0x382bdc['decryptFile'](_0x4efd8e,_0x1d2ecb[_0x5492('0x4f')],config[_0x5492('0x79')][_0x5492('0x53')])[_0x5492('0x29')](function(){return _0x1d2ecb;});}return _0x1d2ecb;}})[_0x5492('0x29')](function(_0x67db9e){if(!_0x67db9e){throw new db[(_0x5492('0x54'))][(_0x5492('0x55'))](_0x5492('0x7a'));}_0x46ca07=_0x67db9e;return db['Setting'][_0x5492('0x78')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x111fa0,null))['then'](function(_0x1be814){if(_0x1be814){_0x2eff96=_0x1be814;if(!_0x2eff96['transcribe']||!_0x2eff96[_0x5492('0x7b')]||!_0x2eff96['transcribeRegion']||!_0x2eff96[_0x5492('0x7c')]||!_0x2eff96['bucket']){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x399c06[_0x5492('0x4a')][_0x5492('0x7d')]&&(!_0x2eff96[_0x5492('0x7e')]||!_0x2eff96['sentimentAccountId']||!_0x2eff96[_0x5492('0x7f')]||!_0x2eff96['language']||!_0x2eff96['bucket'])){throw new db['Sequelize'][(_0x5492('0x55'))](_0x5492('0x80'));}return db[_0x5492('0x81')][_0x5492('0x78')]({'where':{'id':_0x2eff96[_0x5492('0x7b')]}});}})[_0x5492('0x29')](function(_0xb50cc7){if(!_0xb50cc7){throw new db['Sequelize'][(_0x5492('0x55'))](_0x5492('0x82'));}if(!_0xb50cc7[_0x5492('0x83')]||!_0xb50cc7[_0x5492('0x84')]){throw new db[(_0x5492('0x54'))][(_0x5492('0x55'))]('Cloud\x20Provider\x20not\x20configured');}_0x34d384=_0xb50cc7;return getBucketslist(_0x34d384[_0x5492('0x83')],_0x34d384['data2'],_0x2eff96[_0x5492('0x85')]);})[_0x5492('0x29')](function(_0x56986a){if(_0x56986a&&_0x56986a[_0x5492('0x86')]){var _0x56475e=_[_0x5492('0x4e')](_0x56986a['Buckets'],function(_0x2ee6ea){return _0x2ee6ea[_0x5492('0x87')]===_0x2eff96[_0x5492('0x88')];});if(!_0x56475e){logger['info'](util[_0x5492('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x399c06[_0x5492('0x45')]['id'],_0x2eff96[_0x5492('0x88')]));return createBucket(_0x34d384[_0x5492('0x83')],_0x34d384['data2'],_0x2eff96[_0x5492('0x85')],_0x2eff96['bucket']);}logger[_0x5492('0x64')](util[_0x5492('0x35')](_0x5492('0x89'),_0x399c06[_0x5492('0x45')]['id'],_0x2eff96[_0x5492('0x88')]));return;}})[_0x5492('0x29')](function(_0x27e51a){if(_0x46ca07[_0x5492('0x77')]===_0x5492('0x8a')){return transcribe(_0x399c06[_0x5492('0x45')]['id'],_0x34d384[_0x5492('0x83')],_0x34d384[_0x5492('0x84')],_0x2eff96[_0x5492('0x85')],_0x2eff96[_0x5492('0x88')],_0x46ca07['value'],_0x2eff96[_0x5492('0x7c')]);}else{logger[_0x5492('0x64')](util['format'](_0x5492('0x8b'),_0x399c06[_0x5492('0x45')]['id']));return{'transcribeStatus':_0x5492('0x8c')};}})[_0x5492('0x29')](function(_0x1c7794){if(_0x1c7794){_0x1c7794[_0x5492('0x8d')]=_0x399c06['body']['runSentiment'];return _0x46ca07[_0x5492('0x8e')](_0x1c7794);}})[_0x5492('0x29')](respondWithResult(_0x111fa0,null))[_0x5492('0x44')](handleError(_0x111fa0,null));};function writeFile(_0xbdf511,_0x6e619e){return new Promise(function(_0x2036a6,_0x286acf){fs[_0x5492('0x8f')](_0x6e619e,_0xbdf511,function(_0x1aa5b1,_0x19041c){if(_0x1aa5b1){return _0x286acf(_0x1aa5b1);}else{return _0x2036a6(_0x19041c);}});});}exports[_0x5492('0x90')]=function(_0x1f00db,_0x43593f,_0x2a49c6){return db['VoiceRecording'][_0x5492('0x78')]({'where':{'id':_0x1f00db[_0x5492('0x45')]['id']}})['then'](handleEntityNotFound(_0x43593f))[_0x5492('0x29')](function(_0x43217f){if(_0x43217f&&_0x43217f[_0x5492('0x91')]){var _0xc51457=_0x43217f[_0x5492('0x91')];var _0x5dfea0=config[_0x5492('0x92')]+_0x5492('0x93')+_0x43217f['id']+_0x5492('0x94');if(fs['existsSync'](_0x5dfea0)){return _0x5dfea0;}return writeFile(_0xc51457,_0x5dfea0)['then'](function(){return _0x5dfea0;});}else{throw new db[(_0x5492('0x54'))][(_0x5492('0x55'))](_0x5492('0x95'));}})[_0x5492('0x29')](function(_0x3898d7){return _0x43593f[_0x5492('0x4c')](_0x3898d7);})[_0x5492('0x44')](handleError(_0x43593f));};
\ No newline at end of file
index 28e9000..7aca317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa37e=['VoiceRecording','uniqueid','transcribeStatus','define'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0xa37e,0x97));var _0xea37=function(_0x1d8eee,_0x1fa7db){_0x1d8eee=_0x1d8eee-0x0;var _0x44182e=_0xa37e[_0x1d8eee];return _0x44182e;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x474450,_0x42f098){return _0x474450[_0xea37('0x0')](_0xea37('0x1'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xea37('0x2'),'fields':['uniqueid']},{'name':_0xea37('0x3'),'fields':[_0xea37('0x3')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ba7=['./voiceRecording.attributes','define','VoiceRecording','uniqueid','transcribeStatus'];(function(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0x0ba7,0x16d));var _0x70ba=function(_0x49fad9,_0x1d48d8){_0x49fad9=_0x49fad9-0x0;var _0x3929e7=_0x0ba7[_0x49fad9];return _0x3929e7;};'use strict';var attributes=require(_0x70ba('0x0'));module['exports']=function(_0x469795,_0x15094e){return _0x469795[_0x70ba('0x1')](_0x70ba('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x70ba('0x3'),'fields':[_0x70ba('0x3')]},{'name':_0x70ba('0x4'),'fields':[_0x70ba('0x4')]}],'timestamps':!![]});};
\ No newline at end of file
index 5864e12..7986749 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e24=['client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x47a377,_0x40c6e1){var _0x3df18b=function(_0x199215){while(--_0x199215){_0x47a377['push'](_0x47a377['shift']());}};_0x3df18b(++_0x40c6e1);}(_0x3e24,0x167));var _0x43e2=function(_0x14ebc1,_0x50e244){_0x14ebc1=_0x14ebc1-0x0;var _0x25b70f=_0x3e24[_0x14ebc1];return _0x25b70f;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});}exports[_0x43e2('0x15')]=function(_0x1b7cde){var _0x3ea010=this;return new Promise(function(_0x15ecb5,_0x3236b9){return db[_0x43e2('0x16')]['update'](_0x1b7cde[_0x43e2('0x17')],{'raw':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde['options'][_0x43e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1a')]||null:null,'attributes':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1b')]||null:null,'limit':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1c')]||null:null})[_0x43e2('0xc')](function(_0x52e361){logger[_0x43e2('0x13')](_0x43e2('0x15'),_0x1b7cde);logger[_0x43e2('0x1d')](_0x43e2('0x15'),_0x1b7cde,JSON['stringify'](_0x52e361));_0x15ecb5(_0x52e361);})[_0x43e2('0x14')](function(_0xc717d8){logger[_0x43e2('0x10')](_0x43e2('0x15'),_0xc717d8[_0x43e2('0x12')],_0x1b7cde);_0x3236b9(_0x3ea010[_0x43e2('0x10')](0x1f4,_0xc717d8[_0x43e2('0x12')]));});});};exports[_0x43e2('0x1e')]=function(_0xd29b7b){var _0x1ec68e=this;return new Promise(function(_0x1ea844,_0x1de7e1){var _0x52ed49=require(_0x43e2('0x1f'));var _0x2f2bd8;return db['Setting'][_0x43e2('0x20')]({'attributes':['id',_0x43e2('0x21')],'where':{'id':0x1},'raw':!![]})[_0x43e2('0xc')](function(_0x404483){_0x2f2bd8=_0x404483;return db[_0x43e2('0x16')]['create'](_0xd29b7b[_0x43e2('0x17')]);})[_0x43e2('0xc')](function(_0x1779f9){if(_0x2f2bd8[_0x43e2('0x21')]&&fs[_0x43e2('0x22')](_0x1779f9[_0x43e2('0x23')])){var _0x53f797=util['format'](_0x43e2('0x24'),_0x1779f9[_0x43e2('0x23')]);return _0x52ed49[_0x43e2('0x25')](_0x1779f9[_0x43e2('0x23')],_0x53f797,config[_0x43e2('0x26')]['recording'])[_0x43e2('0xc')](function(){fs[_0x43e2('0x27')](_0x1779f9[_0x43e2('0x23')]);logger[_0x43e2('0x13')](_0x43e2('0x28'));return _0x1779f9;});}return _0x1779f9;})[_0x43e2('0xc')](function(_0x2fcdd4){logger['info']('CreateVoiceRecording',_0xd29b7b);logger[_0x43e2('0x1d')](_0x43e2('0x1e'),_0xd29b7b,JSON['stringify'](_0x2fcdd4));_0x1ea844(_0x2fcdd4);})[_0x43e2('0x14')](function(_0x34effb){logger['error'](_0x43e2('0x1e'),_0x34effb['message'],_0xd29b7b);_0x1de7e1(_0x1ec68e['error'](0x1f4,_0x34effb['message']));});});};
\ No newline at end of file
+var _0x7708=['code','message','UpdateVoiceRecording','VoiceRecording','update','body','options','where','limit','then','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','../../config/logger','rpc','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x33019e,_0xb8a362){var _0x2758c6=function(_0x541c3c){while(--_0x541c3c){_0x33019e['push'](_0x33019e['shift']());}};_0x2758c6(++_0xb8a362);}(_0x7708,0x188));var _0x8770=function(_0x4d79bc,_0x32c905){_0x4d79bc=_0x4d79bc-0x0;var _0x4b4760=_0x7708[_0x4d79bc];return _0x4b4760;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var moment=require('moment');var BPromise=require(_0x8770('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(_0x8770('0x3'))(_0x8770('0x4'));var config=require('../../config/environment');var jayson=require(_0x8770('0x5'));var client=jayson['client'][_0x8770('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x42d305,_0x2b0295,_0x20e293){return new BPromise(function(_0x212b12,_0x3e1113){return client[_0x8770('0x7')](_0x42d305,_0x20e293)['then'](function(_0x396322){logger[_0x8770('0x8')](_0x8770('0x9'),_0x2b0295,'request\x20sent');logger[_0x8770('0xa')](_0x8770('0xb'),_0x2b0295,_0x8770('0xc'),JSON[_0x8770('0xd')](_0x396322));if(_0x396322['error']){if(_0x396322[_0x8770('0xe')][_0x8770('0xf')]===0x1f4){logger[_0x8770('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x2b0295,_0x396322[_0x8770('0xe')][_0x8770('0x10')]);return _0x3e1113(_0x396322[_0x8770('0xe')][_0x8770('0x10')]);}logger[_0x8770('0xe')](_0x8770('0x9'),_0x2b0295,_0x396322[_0x8770('0xe')][_0x8770('0x10')]);return _0x212b12(_0x396322['error'][_0x8770('0x10')]);}else{logger[_0x8770('0x8')]('VoiceRecording,\x20%s,\x20%s',_0x2b0295,_0x8770('0xc'));_0x212b12(_0x396322['result'][_0x8770('0x10')]);}})['catch'](function(_0x5b4716){logger['error'](_0x8770('0x9'),_0x2b0295,_0x5b4716);_0x3e1113(_0x5b4716);});});}exports[_0x8770('0x11')]=function(_0x17b634){var _0xe0d611=this;return new Promise(function(_0x4b0691,_0x550be9){return db[_0x8770('0x12')][_0x8770('0x13')](_0x17b634[_0x8770('0x14')],{'raw':_0x17b634[_0x8770('0x15')]?_0x17b634[_0x8770('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b634[_0x8770('0x15')]?_0x17b634[_0x8770('0x15')][_0x8770('0x16')]||null:null,'attributes':_0x17b634[_0x8770('0x15')]?_0x17b634['options']['attributes']||null:null,'limit':_0x17b634[_0x8770('0x15')]?_0x17b634[_0x8770('0x15')][_0x8770('0x17')]||null:null})[_0x8770('0x18')](function(_0x2760b2){logger[_0x8770('0x8')]('UpdateVoiceRecording',_0x17b634);logger[_0x8770('0xa')](_0x8770('0x11'),_0x17b634,JSON[_0x8770('0xd')](_0x2760b2));_0x4b0691(_0x2760b2);})[_0x8770('0x19')](function(_0x51cdb5){logger[_0x8770('0xe')]('UpdateVoiceRecording',_0x51cdb5[_0x8770('0x10')],_0x17b634);_0x550be9(_0xe0d611[_0x8770('0xe')](0x1f4,_0x51cdb5[_0x8770('0x10')]));});});};exports[_0x8770('0x1a')]=function(_0x1538b2){var _0x2cd084=this;return new Promise(function(_0x293f53,_0x367564){var _0xb3f4aa=require(_0x8770('0x1b'));var _0x5f4973;return db[_0x8770('0x1c')][_0x8770('0x1d')]({'attributes':['id',_0x8770('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x8770('0x18')](function(_0x246128){_0x5f4973=_0x246128;return db[_0x8770('0x12')]['create'](_0x1538b2['body']);})[_0x8770('0x18')](function(_0x11de6e){if(_0x5f4973[_0x8770('0x1e')]&&fs[_0x8770('0x1f')](_0x11de6e[_0x8770('0x20')])){var _0x4bc072=util['format'](_0x8770('0x21'),_0x11de6e[_0x8770('0x20')]);return _0xb3f4aa[_0x8770('0x22')](_0x11de6e[_0x8770('0x20')],_0x4bc072,config['secrets'][_0x8770('0x23')])['then'](function(){fs['unlink'](_0x11de6e[_0x8770('0x20')]);logger['info'](_0x8770('0x24'));return _0x11de6e;});}return _0x11de6e;})[_0x8770('0x18')](function(_0x1f3af6){logger[_0x8770('0x8')](_0x8770('0x1a'),_0x1538b2);logger[_0x8770('0xa')](_0x8770('0x1a'),_0x1538b2,JSON[_0x8770('0xd')](_0x1f3af6));_0x293f53(_0x1f3af6);})[_0x8770('0x19')](function(_0x53197e){logger[_0x8770('0xe')](_0x8770('0x1a'),_0x53197e[_0x8770('0x10')],_0x1538b2);_0x367564(_0x2cd084['error'](0x1f4,_0x53197e['message']));});});};
\ No newline at end of file
index 891a0bc..fd7d80f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8519=['../../config/environment','./voiceTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1278ed,_0x5c7231){var _0x185e80=function(_0xd8983b){while(--_0xd8983b){_0x1278ed['push'](_0x1278ed['shift']());}};_0x185e80(++_0x5c7231);}(_0x8519,0x104));var _0x9851=function(_0x48a8d9,_0x4a8681){_0x48a8d9=_0x48a8d9-0x0;var _0x1b8e56=_0x8519[_0x48a8d9];return _0x1b8e56;};'use strict';var multer=require(_0x9851('0x0'));var util=require(_0x9851('0x1'));var path=require('path');var timeout=require(_0x9851('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9851('0x3'));var auth=require(_0x9851('0x4'));var interaction=require(_0x9851('0x5'));var config=require(_0x9851('0x6'));var controller=require(_0x9851('0x7'));router[_0x9851('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9851('0x9'),auth['isAuthenticated'](),controller[_0x9851('0xa')]);router[_0x9851('0x8')](_0x9851('0xb'),auth[_0x9851('0xc')](),controller[_0x9851('0xd')]);router['post']('/',auth[_0x9851('0xc')](),controller[_0x9851('0xe')]);router[_0x9851('0xf')](_0x9851('0xb'),auth[_0x9851('0xc')](),controller[_0x9851('0x10')]);router[_0x9851('0x11')]('/:id',auth[_0x9851('0xc')](),controller['destroy']);module[_0x9851('0x12')]=router;
\ No newline at end of file
+var _0x0e46=['index','/describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x1a8f77,_0x47de45){var _0x256669=function(_0x54f4c7){while(--_0x54f4c7){_0x1a8f77['push'](_0x1a8f77['shift']());}};_0x256669(++_0x47de45);}(_0x0e46,0x17a));var _0x60e4=function(_0x1aa0e7,_0x498fbd){_0x1aa0e7=_0x1aa0e7-0x0;var _0x55f771=_0x0e46[_0x1aa0e7];return _0x55f771;};'use strict';var multer=require(_0x60e4('0x0'));var util=require(_0x60e4('0x1'));var path=require(_0x60e4('0x2'));var timeout=require(_0x60e4('0x3'));var express=require(_0x60e4('0x4'));var router=express[_0x60e4('0x5')]();var fs_extra=require(_0x60e4('0x6'));var auth=require(_0x60e4('0x7'));var interaction=require(_0x60e4('0x8'));var config=require(_0x60e4('0x9'));var controller=require(_0x60e4('0xa'));router[_0x60e4('0xb')]('/',auth[_0x60e4('0xc')](),controller[_0x60e4('0xd')]);router[_0x60e4('0xb')](_0x60e4('0xe'),auth[_0x60e4('0xc')](),controller['describe']);router[_0x60e4('0xb')]('/:id',auth[_0x60e4('0xc')](),controller[_0x60e4('0xf')]);router[_0x60e4('0x10')]('/',auth[_0x60e4('0xc')](),controller[_0x60e4('0x11')]);router[_0x60e4('0x12')](_0x60e4('0x13'),auth[_0x60e4('0xc')](),controller[_0x60e4('0x14')]);router['delete'](_0x60e4('0x13'),auth[_0x60e4('0xc')](),controller[_0x60e4('0x15')]);module[_0x60e4('0x16')]=router;
\ No newline at end of file
index 12ee907..46c1c4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe006=['STRING','Yes','sequelize','moment','exports','ENUM','blind'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe006,0x19f));var _0x6e00=function(_0x5ec365,_0x49930c){_0x5ec365=_0x5ec365-0x0;var _0xab187d=_0xe006[_0x5ec365];return _0xab187d;};'use strict';var Sequelize=require(_0x6e00('0x0'));var moment=require(_0x6e00('0x1'));module[_0x6e00('0x2')]={'type':{'type':Sequelize[_0x6e00('0x3')](_0x6e00('0x4'),'attended')},'result':{'type':Sequelize[_0x6e00('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x6e00('0x5')]},'transferercalleridname':{'type':Sequelize[_0x6e00('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x6e00('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x6e00('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x6e00('0x5')]},'transfereechannel':{'type':Sequelize[_0x6e00('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x6e00('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x6e00('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6e00('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6e00('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x6e00('0x5')]},'transfereecontext':{'type':Sequelize[_0x6e00('0x5')]},'transfereeexten':{'type':Sequelize[_0x6e00('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x6e00('0x5')]},'isexternal':{'type':Sequelize[_0x6e00('0x3')](_0x6e00('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc83c=['exports','ENUM','blind','attended','STRING','Yes','moment'];(function(_0x3303a9,_0x59a0ff){var _0xc0b45e=function(_0x202299){while(--_0x202299){_0x3303a9['push'](_0x3303a9['shift']());}};_0xc0b45e(++_0x59a0ff);}(_0xc83c,0x13a));var _0xcc83=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0xc83c[_0x5e238b];return _0x389bea;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcc83('0x0'));module[_0xcc83('0x1')]={'type':{'type':Sequelize[_0xcc83('0x2')](_0xcc83('0x3'),_0xcc83('0x4'))},'result':{'type':Sequelize[_0xcc83('0x5')]},'transfererchannel':{'type':Sequelize[_0xcc83('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xcc83('0x5')]},'transferercalleridname':{'type':Sequelize[_0xcc83('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xcc83('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xcc83('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xcc83('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xcc83('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xcc83('0x5')]},'transfereechannel':{'type':Sequelize[_0xcc83('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xcc83('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xcc83('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xcc83('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xcc83('0x5')]},'transfereeexten':{'type':Sequelize[_0xcc83('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xcc83('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xcc83('0x6'),'No')},'context':{'type':Sequelize[_0xcc83('0x5')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b895a0f..c6c83f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x316b=['includeAll','findAll','catch','show','params','include','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x407a3e,_0x15acb0){var _0x129fe3=function(_0x124c2f){while(--_0x124c2f){_0x407a3e['push'](_0x407a3e['shift']());}};_0x129fe3(++_0x15acb0);}(_0x316b,0x1df));var _0xb316=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x316b[_0x149a9b];return _0x2c2bf6;};'use strict';var emlformat=require(_0xb316('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb316('0x1'));var jsonpatch=require(_0xb316('0x2'));var rp=require('request-promise');var moment=require(_0xb316('0x3'));var BPromise=require(_0xb316('0x4'));var Mustache=require(_0xb316('0x5'));var util=require(_0xb316('0x6'));var path=require(_0xb316('0x7'));var sox=require(_0xb316('0x8'));var csv=require('to-csv');var ejs=require(_0xb316('0x9'));var fs=require('fs');var fs_extra=require(_0xb316('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb316('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb316('0xc'));var toCsv=require(_0xb316('0xd'));var querystring=require(_0xb316('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb316('0xf'));var qs=require(_0xb316('0x10'));var as=require(_0xb316('0x11'));var hardwareService=require(_0xb316('0x12'));var logger=require(_0xb316('0x13'))(_0xb316('0x14'));var utils=require(_0xb316('0x15'));var config=require(_0xb316('0x16'));var licenseUtil=require(_0xb316('0x17'));var db=require(_0xb316('0x18'))['db'];function respondWithStatusCode(_0x217da0,_0x19050f){_0x19050f=_0x19050f||0xcc;return function(_0x2c68f2){if(_0x2c68f2){return _0x217da0[_0xb316('0x19')](_0x19050f);}return _0x217da0[_0xb316('0x1a')](_0x19050f)[_0xb316('0x1b')]();};}function respondWithResult(_0x3dec8c,_0x34f76f){_0x34f76f=_0x34f76f||0xc8;return function(_0x38a559){if(_0x38a559){return _0x3dec8c[_0xb316('0x1a')](_0x34f76f)[_0xb316('0x1c')](_0x38a559);}};}function respondWithFilteredResult(_0x16883b,_0x5b0895){return function(_0x107a48){if(_0x107a48){var _0xf73b8c=typeof _0x5b0895[_0xb316('0x1d')]===_0xb316('0x1e')&&typeof _0x5b0895[_0xb316('0x1f')]===_0xb316('0x1e');var _0x392f66=_0x107a48[_0xb316('0x20')];var _0x5b32cf=_0xf73b8c?0x0:_0x5b0895[_0xb316('0x1d')];var _0x97899a=_0xf73b8c?_0x107a48['count']:_0x5b0895[_0xb316('0x1d')]+_0x5b0895[_0xb316('0x1f')];var _0x47357e;if(_0x97899a>=_0x392f66){_0x97899a=_0x392f66;_0x47357e=0xc8;}else{_0x47357e=0xce;}_0x16883b[_0xb316('0x1a')](_0x47357e);return _0x16883b[_0xb316('0x21')](_0xb316('0x22'),_0x5b32cf+'-'+_0x97899a+'/'+_0x392f66)['json'](_0x107a48);}return null;};}function patchUpdates(_0x516d05){return function(_0x3ceea9){try{jsonpatch[_0xb316('0x23')](_0x3ceea9,_0x516d05,!![]);}catch(_0xaa9204){return BPromise[_0xb316('0x24')](_0xaa9204);}return _0x3ceea9[_0xb316('0x25')]();};}function saveUpdates(_0x2eb649,_0x2aacc5){return function(_0x49a4a1){if(_0x49a4a1){return _0x49a4a1['update'](_0x2eb649)[_0xb316('0x26')](function(_0x3283bc){return _0x3283bc;});}return null;};}function removeEntity(_0x57a3fd,_0x43c7e2){return function(_0x1d86af){if(_0x1d86af){return _0x1d86af[_0xb316('0x27')]()[_0xb316('0x26')](function(){_0x57a3fd['status'](0xcc)[_0xb316('0x1b')]();});}};}function handleEntityNotFound(_0x3d05b5,_0xb129d3){return function(_0x1b6a0a){if(!_0x1b6a0a){_0x3d05b5[_0xb316('0x19')](0x194);}return _0x1b6a0a;};}function handleError(_0x5196f3,_0x5f2e9e){_0x5f2e9e=_0x5f2e9e||0x1f4;return function(_0x2b1ec7){logger[_0xb316('0x28')](_0x2b1ec7[_0xb316('0x29')]);if(_0x2b1ec7[_0xb316('0x2a')]){delete _0x2b1ec7[_0xb316('0x2a')];}_0x5196f3['status'](_0x5f2e9e)[_0xb316('0x2b')](_0x2b1ec7);};}exports[_0xb316('0x2c')]=function(_0x7eee4d,_0x1413f3){var _0x59bf51={},_0x4b1b04={},_0x3c61ee={'count':0x0,'rows':[]};var _0x29d76f=_['map'](db[_0xb316('0x2d')][_0xb316('0x2e')],function(_0x337abf){return{'name':_0x337abf[_0xb316('0x2f')],'type':_0x337abf[_0xb316('0x30')][_0xb316('0x31')]};});_0x4b1b04[_0xb316('0x32')]=_[_0xb316('0x33')](_0x29d76f,'name');_0x4b1b04[_0xb316('0x34')]=_[_0xb316('0x35')](_0x7eee4d['query']);_0x4b1b04[_0xb316('0x36')]=_[_0xb316('0x37')](_0x4b1b04[_0xb316('0x32')],_0x4b1b04[_0xb316('0x34')]);_0x59bf51[_0xb316('0x38')]=_[_0xb316('0x37')](_0x4b1b04[_0xb316('0x32')],qs[_0xb316('0x39')](_0x7eee4d[_0xb316('0x34')][_0xb316('0x39')]));_0x59bf51[_0xb316('0x38')]=_0x59bf51[_0xb316('0x38')][_0xb316('0x3a')]?_0x59bf51[_0xb316('0x38')]:_0x4b1b04['model'];if(!_0x7eee4d[_0xb316('0x34')][_0xb316('0x3b')]('nolimit')){_0x59bf51['limit']=qs[_0xb316('0x1f')](_0x7eee4d['query'][_0xb316('0x1f')]);_0x59bf51[_0xb316('0x1d')]=qs['offset'](_0x7eee4d[_0xb316('0x34')][_0xb316('0x1d')]);}_0x59bf51['order']=qs[_0xb316('0x3c')](_0x7eee4d[_0xb316('0x34')]['sort']);_0x59bf51[_0xb316('0x3d')]=qs[_0xb316('0x36')](_[_0xb316('0x3e')](_0x7eee4d[_0xb316('0x34')],_0x4b1b04['filters']),_0x29d76f);if(_0x7eee4d[_0xb316('0x34')][_0xb316('0x3f')]){_0x59bf51[_0xb316('0x3d')]=_[_0xb316('0x40')](_0x59bf51[_0xb316('0x3d')],{'$or':_['map'](_0x29d76f,function(_0x55cbd6){if(_0x55cbd6['type']!==_0xb316('0x41')){var _0x1139a0={};_0x1139a0[_0x55cbd6[_0xb316('0x2a')]]={'$like':'%'+_0x7eee4d[_0xb316('0x34')]['filter']+'%'};return _0x1139a0;}})});}_0x59bf51=_[_0xb316('0x40')]({},_0x59bf51,_0x7eee4d[_0xb316('0x42')]);var _0x4e1836={'where':_0x59bf51[_0xb316('0x3d')]};return db[_0xb316('0x2d')][_0xb316('0x20')](_0x4e1836)[_0xb316('0x26')](function(_0x32d613){_0x3c61ee[_0xb316('0x20')]=_0x32d613;if(_0x7eee4d['query'][_0xb316('0x43')]){_0x59bf51['include']=[{'all':!![]}];}return db[_0xb316('0x2d')][_0xb316('0x44')](_0x59bf51);})['then'](function(_0x585642){_0x3c61ee['rows']=_0x585642;return _0x3c61ee;})['then'](respondWithFilteredResult(_0x1413f3,_0x59bf51))[_0xb316('0x45')](handleError(_0x1413f3,null));};exports[_0xb316('0x46')]=function(_0x5f4855,_0x270ca8){var _0x686377={'raw':!![],'where':{'id':_0x5f4855[_0xb316('0x47')]['id']}},_0x2c5ac9={};_0x2c5ac9[_0xb316('0x32')]=_['keys'](db[_0xb316('0x2d')][_0xb316('0x2e')]);_0x2c5ac9[_0xb316('0x34')]=_[_0xb316('0x35')](_0x5f4855[_0xb316('0x34')]);_0x2c5ac9[_0xb316('0x36')]=_['intersection'](_0x2c5ac9['model'],_0x2c5ac9[_0xb316('0x34')]);_0x686377[_0xb316('0x38')]=_[_0xb316('0x37')](_0x2c5ac9[_0xb316('0x32')],qs[_0xb316('0x39')](_0x5f4855[_0xb316('0x34')][_0xb316('0x39')]));_0x686377[_0xb316('0x38')]=_0x686377[_0xb316('0x38')][_0xb316('0x3a')]?_0x686377[_0xb316('0x38')]:_0x2c5ac9[_0xb316('0x32')];if(_0x5f4855[_0xb316('0x34')][_0xb316('0x43')]){_0x686377[_0xb316('0x48')]=[{'all':!![]}];}_0x686377=_[_0xb316('0x40')]({},_0x686377,_0x5f4855[_0xb316('0x42')]);return db[_0xb316('0x2d')]['find'](_0x686377)['then'](handleEntityNotFound(_0x270ca8,null))[_0xb316('0x26')](respondWithResult(_0x270ca8,null))[_0xb316('0x45')](handleError(_0x270ca8,null));};exports[_0xb316('0x49')]=function(_0xedd84a,_0x447bec){return db[_0xb316('0x2d')][_0xb316('0x49')](_0xedd84a[_0xb316('0x4a')],{})[_0xb316('0x26')](respondWithResult(_0x447bec,0xc9))[_0xb316('0x45')](handleError(_0x447bec,null));};exports[_0xb316('0x4b')]=function(_0x3645fd,_0x29714c){if(_0x3645fd[_0xb316('0x4a')]['id']){delete _0x3645fd[_0xb316('0x4a')]['id'];}return db[_0xb316('0x2d')][_0xb316('0x4c')]({'where':{'id':_0x3645fd[_0xb316('0x47')]['id']}})[_0xb316('0x26')](handleEntityNotFound(_0x29714c,null))[_0xb316('0x26')](saveUpdates(_0x3645fd[_0xb316('0x4a')],null))['then'](respondWithResult(_0x29714c,null))[_0xb316('0x45')](handleError(_0x29714c,null));};exports[_0xb316('0x27')]=function(_0x24c631,_0x5c7274){return db[_0xb316('0x2d')][_0xb316('0x4c')]({'where':{'id':_0x24c631[_0xb316('0x47')]['id']}})[_0xb316('0x26')](handleEntityNotFound(_0x5c7274,null))[_0xb316('0x26')](removeEntity(_0x5c7274,null))[_0xb316('0x45')](handleError(_0x5c7274,null));};exports[_0xb316('0x4d')]=function(_0x1e9f92,_0x3cbdf3){return db['VoiceTransferReport'][_0xb316('0x4d')]()[_0xb316('0x26')](respondWithResult(_0x3cbdf3,null))['catch'](handleError(_0x3cbdf3,null));};
\ No newline at end of file
+var _0x3711=['where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3711,0x178));var _0x1371=function(_0x51eb8e,_0x4850c7){_0x51eb8e=_0x51eb8e-0x0;var _0x3788c4=_0x3711[_0x51eb8e];return _0x3788c4;};'use strict';var emlformat=require(_0x1371('0x0'));var rimraf=require(_0x1371('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1371('0x2'));var rp=require(_0x1371('0x3'));var moment=require(_0x1371('0x4'));var BPromise=require(_0x1371('0x5'));var Mustache=require('mustache');var util=require(_0x1371('0x6'));var path=require(_0x1371('0x7'));var sox=require(_0x1371('0x8'));var csv=require('to-csv');var ejs=require(_0x1371('0x9'));var fs=require('fs');var fs_extra=require(_0x1371('0xa'));var _=require(_0x1371('0xb'));var squel=require(_0x1371('0xc'));var crypto=require(_0x1371('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1371('0xe'));var toCsv=require(_0x1371('0xf'));var querystring=require(_0x1371('0x10'));var Papa=require(_0x1371('0x11'));var Redis=require('ioredis');var authService=require(_0x1371('0x12'));var qs=require(_0x1371('0x13'));var as=require(_0x1371('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1371('0x15'))(_0x1371('0x16'));var utils=require(_0x1371('0x17'));var config=require(_0x1371('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3c7ee,_0x138ccf){_0x138ccf=_0x138ccf||0xcc;return function(_0x5d5aa9){if(_0x5d5aa9){return _0xb3c7ee[_0x1371('0x19')](_0x138ccf);}return _0xb3c7ee[_0x1371('0x1a')](_0x138ccf)[_0x1371('0x1b')]();};}function respondWithResult(_0x33aaa2,_0xfee8fa){_0xfee8fa=_0xfee8fa||0xc8;return function(_0x231b5e){if(_0x231b5e){return _0x33aaa2['status'](_0xfee8fa)[_0x1371('0x1c')](_0x231b5e);}};}function respondWithFilteredResult(_0x1ad68a,_0x27ba1e){return function(_0x826a0e){if(_0x826a0e){var _0x5743c1=typeof _0x27ba1e[_0x1371('0x1d')]===_0x1371('0x1e')&&typeof _0x27ba1e[_0x1371('0x1f')]==='undefined';var _0x4e77c5=_0x826a0e[_0x1371('0x20')];var _0x2898f3=_0x5743c1?0x0:_0x27ba1e[_0x1371('0x1d')];var _0x200ebb=_0x5743c1?_0x826a0e[_0x1371('0x20')]:_0x27ba1e['offset']+_0x27ba1e[_0x1371('0x1f')];var _0x3d7b5e;if(_0x200ebb>=_0x4e77c5){_0x200ebb=_0x4e77c5;_0x3d7b5e=0xc8;}else{_0x3d7b5e=0xce;}_0x1ad68a[_0x1371('0x1a')](_0x3d7b5e);return _0x1ad68a[_0x1371('0x21')]('Content-Range',_0x2898f3+'-'+_0x200ebb+'/'+_0x4e77c5)[_0x1371('0x1c')](_0x826a0e);}return null;};}function patchUpdates(_0x5ad5b9){return function(_0x1ce016){try{jsonpatch['apply'](_0x1ce016,_0x5ad5b9,!![]);}catch(_0x4e5651){return BPromise['reject'](_0x4e5651);}return _0x1ce016[_0x1371('0x22')]();};}function saveUpdates(_0xb4391e,_0x42f4e7){return function(_0x284fdc){if(_0x284fdc){return _0x284fdc['update'](_0xb4391e)[_0x1371('0x23')](function(_0x2f0a32){return _0x2f0a32;});}return null;};}function removeEntity(_0x997902,_0x5785b7){return function(_0x4cc5ab){if(_0x4cc5ab){return _0x4cc5ab[_0x1371('0x24')]()[_0x1371('0x23')](function(){_0x997902['status'](0xcc)[_0x1371('0x1b')]();});}};}function handleEntityNotFound(_0x14170d,_0x34e701){return function(_0x3956d2){if(!_0x3956d2){_0x14170d[_0x1371('0x19')](0x194);}return _0x3956d2;};}function handleError(_0x1f9d5b,_0x46c180){_0x46c180=_0x46c180||0x1f4;return function(_0x13201c){logger[_0x1371('0x25')](_0x13201c[_0x1371('0x26')]);if(_0x13201c['name']){delete _0x13201c[_0x1371('0x27')];}_0x1f9d5b[_0x1371('0x1a')](_0x46c180)['send'](_0x13201c);};}exports[_0x1371('0x28')]=function(_0x4fe8f1,_0x5e3719){var _0x15f8fc={},_0x48919f={},_0x15c8c9={'count':0x0,'rows':[]};var _0x12a2c6=_[_0x1371('0x29')](db[_0x1371('0x2a')][_0x1371('0x2b')],function(_0x58419c){return{'name':_0x58419c['fieldName'],'type':_0x58419c['type'][_0x1371('0x2c')]};});_0x48919f[_0x1371('0x2d')]=_['map'](_0x12a2c6,_0x1371('0x27'));_0x48919f[_0x1371('0x2e')]=_[_0x1371('0x2f')](_0x4fe8f1[_0x1371('0x2e')]);_0x48919f[_0x1371('0x30')]=_[_0x1371('0x31')](_0x48919f[_0x1371('0x2d')],_0x48919f[_0x1371('0x2e')]);_0x15f8fc['attributes']=_[_0x1371('0x31')](_0x48919f[_0x1371('0x2d')],qs[_0x1371('0x32')](_0x4fe8f1[_0x1371('0x2e')][_0x1371('0x32')]));_0x15f8fc[_0x1371('0x33')]=_0x15f8fc[_0x1371('0x33')][_0x1371('0x34')]?_0x15f8fc[_0x1371('0x33')]:_0x48919f[_0x1371('0x2d')];if(!_0x4fe8f1['query'][_0x1371('0x35')](_0x1371('0x36'))){_0x15f8fc[_0x1371('0x1f')]=qs[_0x1371('0x1f')](_0x4fe8f1[_0x1371('0x2e')][_0x1371('0x1f')]);_0x15f8fc['offset']=qs['offset'](_0x4fe8f1[_0x1371('0x2e')]['offset']);}_0x15f8fc['order']=qs[_0x1371('0x37')](_0x4fe8f1[_0x1371('0x2e')][_0x1371('0x37')]);_0x15f8fc[_0x1371('0x38')]=qs[_0x1371('0x30')](_['pick'](_0x4fe8f1['query'],_0x48919f[_0x1371('0x30')]),_0x12a2c6);if(_0x4fe8f1[_0x1371('0x2e')][_0x1371('0x39')]){_0x15f8fc[_0x1371('0x38')]=_[_0x1371('0x3a')](_0x15f8fc[_0x1371('0x38')],{'$or':_[_0x1371('0x29')](_0x12a2c6,function(_0x3a993c){if(_0x3a993c[_0x1371('0x3b')]!==_0x1371('0x3c')){var _0x1363de={};_0x1363de[_0x3a993c[_0x1371('0x27')]]={'$like':'%'+_0x4fe8f1['query'][_0x1371('0x39')]+'%'};return _0x1363de;}})});}_0x15f8fc=_[_0x1371('0x3a')]({},_0x15f8fc,_0x4fe8f1[_0x1371('0x3d')]);var _0x2993bf={'where':_0x15f8fc['where']};return db['VoiceTransferReport'][_0x1371('0x20')](_0x2993bf)[_0x1371('0x23')](function(_0x32cd57){_0x15c8c9['count']=_0x32cd57;if(_0x4fe8f1[_0x1371('0x2e')][_0x1371('0x3e')]){_0x15f8fc[_0x1371('0x3f')]=[{'all':!![]}];}return db[_0x1371('0x2a')][_0x1371('0x40')](_0x15f8fc);})[_0x1371('0x23')](function(_0xe6942d){_0x15c8c9['rows']=_0xe6942d;return _0x15c8c9;})[_0x1371('0x23')](respondWithFilteredResult(_0x5e3719,_0x15f8fc))[_0x1371('0x41')](handleError(_0x5e3719,null));};exports['show']=function(_0x3bbb4b,_0x3abc3e){var _0x1ea6f6={'raw':!![],'where':{'id':_0x3bbb4b['params']['id']}},_0x1f3052={};_0x1f3052[_0x1371('0x2d')]=_[_0x1371('0x2f')](db['VoiceTransferReport'][_0x1371('0x2b')]);_0x1f3052['query']=_['keys'](_0x3bbb4b['query']);_0x1f3052['filters']=_[_0x1371('0x31')](_0x1f3052[_0x1371('0x2d')],_0x1f3052[_0x1371('0x2e')]);_0x1ea6f6[_0x1371('0x33')]=_[_0x1371('0x31')](_0x1f3052['model'],qs[_0x1371('0x32')](_0x3bbb4b[_0x1371('0x2e')]['fields']));_0x1ea6f6[_0x1371('0x33')]=_0x1ea6f6[_0x1371('0x33')][_0x1371('0x34')]?_0x1ea6f6[_0x1371('0x33')]:_0x1f3052[_0x1371('0x2d')];if(_0x3bbb4b['query']['includeAll']){_0x1ea6f6[_0x1371('0x3f')]=[{'all':!![]}];}_0x1ea6f6=_[_0x1371('0x3a')]({},_0x1ea6f6,_0x3bbb4b[_0x1371('0x3d')]);return db['VoiceTransferReport'][_0x1371('0x42')](_0x1ea6f6)[_0x1371('0x23')](handleEntityNotFound(_0x3abc3e,null))[_0x1371('0x23')](respondWithResult(_0x3abc3e,null))[_0x1371('0x41')](handleError(_0x3abc3e,null));};exports['create']=function(_0x57592e,_0x568976){return db['VoiceTransferReport'][_0x1371('0x43')](_0x57592e[_0x1371('0x44')],{})['then'](respondWithResult(_0x568976,0xc9))[_0x1371('0x41')](handleError(_0x568976,null));};exports[_0x1371('0x45')]=function(_0x22b195,_0x492f4b){if(_0x22b195['body']['id']){delete _0x22b195[_0x1371('0x44')]['id'];}return db[_0x1371('0x2a')]['find']({'where':{'id':_0x22b195[_0x1371('0x46')]['id']}})[_0x1371('0x23')](handleEntityNotFound(_0x492f4b,null))[_0x1371('0x23')](saveUpdates(_0x22b195['body'],null))[_0x1371('0x23')](respondWithResult(_0x492f4b,null))['catch'](handleError(_0x492f4b,null));};exports[_0x1371('0x24')]=function(_0x2fc465,_0x38a8ad){return db[_0x1371('0x2a')][_0x1371('0x42')]({'where':{'id':_0x2fc465[_0x1371('0x46')]['id']}})[_0x1371('0x23')](handleEntityNotFound(_0x38a8ad,null))['then'](removeEntity(_0x38a8ad,null))['catch'](handleError(_0x38a8ad,null));};exports[_0x1371('0x47')]=function(_0x2ea082,_0x110565){return db[_0x1371('0x2a')][_0x1371('0x47')]()[_0x1371('0x23')](respondWithResult(_0x110565,null))[_0x1371('0x41')](handleError(_0x110565,null));};
\ No newline at end of file
index e13d2fe..b55a17c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126e=['define','VoiceTransferReport','report_call_transfer','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x203a8c,_0xc7c77c){var _0x2cd130=function(_0x265d9f){while(--_0x265d9f){_0x203a8c['push'](_0x203a8c['shift']());}};_0x2cd130(++_0xc7c77c);}(_0x126e,0x78));var _0xe126=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x126e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var logger=require('../../config/logger')(_0xe126('0x1'));var moment=require(_0xe126('0x2'));var BPromise=require(_0xe126('0x3'));var rp=require(_0xe126('0x4'));var fs=require('fs');var path=require(_0xe126('0x5'));var rimraf=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var attributes=require(_0xe126('0x8'));module[_0xe126('0x9')]=function(_0x5c73bf,_0xe22b4b){return _0x5c73bf[_0xe126('0xa')](_0xe126('0xb'),attributes,{'tableName':_0xe126('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cdf=['bluebird','path','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','../../config/logger','api','moment'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0x7cdf,0x1d5));var _0xf7cd=function(_0x50fa45,_0x3f655e){_0x50fa45=_0x50fa45-0x0;var _0x42c93b=_0x7cdf[_0x50fa45];return _0x42c93b;};'use strict';var _=require(_0xf7cd('0x0'));var util=require('util');var logger=require(_0xf7cd('0x1'))(_0xf7cd('0x2'));var moment=require(_0xf7cd('0x3'));var BPromise=require(_0xf7cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7cd('0x5'));var rimraf=require(_0xf7cd('0x6'));var config=require('../../config/environment');var attributes=require(_0xf7cd('0x7'));module[_0xf7cd('0x8')]=function(_0x23a46e,_0x3ced21){return _0x23a46e[_0xf7cd('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xf7cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 018fa47..91fb473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc006=['VoiceTransferReport','options','raw','then','CreateVoiceTransferReport','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0xc006,0x1e5));var _0x6c00=function(_0x5e5c64,_0x19b9fb){_0x5e5c64=_0x5e5c64-0x0;var _0x1bf287=_0xc006[_0x5e5c64];return _0x1bf287;};'use strict';var _=require(_0x6c00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c00('0x1'));var rs=require(_0x6c00('0x2'));var fs=require('fs');var Redis=require(_0x6c00('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c00('0x4'));var logger=require('../../config/logger')(_0x6c00('0x5'));var config=require(_0x6c00('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c00('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d448f,_0x2fd016,_0xc36438){return new BPromise(function(_0x2f1ba3,_0x23f534){return client['request'](_0x5d448f,_0xc36438)['then'](function(_0x668be9){logger[_0x6c00('0x8')](_0x6c00('0x9'),_0x2fd016,'request\x20sent');logger[_0x6c00('0xa')](_0x6c00('0xb'),_0x2fd016,_0x6c00('0xc'),JSON[_0x6c00('0xd')](_0x668be9));if(_0x668be9[_0x6c00('0xe')]){if(_0x668be9[_0x6c00('0xe')][_0x6c00('0xf')]===0x1f4){logger[_0x6c00('0xe')](_0x6c00('0x9'),_0x2fd016,_0x668be9[_0x6c00('0xe')][_0x6c00('0x10')]);return _0x23f534(_0x668be9['error'][_0x6c00('0x10')]);}logger[_0x6c00('0xe')](_0x6c00('0x9'),_0x2fd016,_0x668be9['error'][_0x6c00('0x10')]);return _0x2f1ba3(_0x668be9[_0x6c00('0xe')][_0x6c00('0x10')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2fd016,'request\x20sent');_0x2f1ba3(_0x668be9[_0x6c00('0x11')][_0x6c00('0x10')]);}})[_0x6c00('0x12')](function(_0xe91803){logger[_0x6c00('0xe')](_0x6c00('0x9'),_0x2fd016,_0xe91803);_0x23f534(_0xe91803);});});}exports['CreateVoiceTransferReport']=function(_0x2e0f5e){var _0x2932a7=this;return new Promise(function(_0x549050,_0x1eb93c){return db[_0x6c00('0x13')]['create'](_0x2e0f5e['body'],{'raw':_0x2e0f5e[_0x6c00('0x14')]?_0x2e0f5e['options'][_0x6c00('0x15')]===undefined?!![]:![]:!![]})[_0x6c00('0x16')](function(_0x52b8ae){logger['info'](_0x6c00('0x17'),_0x2e0f5e);logger[_0x6c00('0xa')](_0x6c00('0x17'),_0x2e0f5e,JSON['stringify'](_0x52b8ae));_0x549050(_0x52b8ae);})[_0x6c00('0x12')](function(_0x386366){logger[_0x6c00('0xe')]('CreateVoiceTransferReport',_0x386366['message'],_0x2e0f5e);_0x1eb93c(_0x2932a7['error'](0x1f4,_0x386366[_0x6c00('0x10')]));});});};
\ No newline at end of file
+var _0x10b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','util','bluebird','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x10b5,0xb9));var _0x510b=function(_0x5e88f9,_0x2670e7){_0x5e88f9=_0x5e88f9-0x0;var _0x18cb28=_0x10b5[_0x5e88f9];return _0x18cb28;};'use strict';var _=require('lodash');var util=require(_0x510b('0x0'));var moment=require('moment');var BPromise=require(_0x510b('0x1'));var rs=require(_0x510b('0x2'));var fs=require('fs');var Redis=require(_0x510b('0x3'));var db=require(_0x510b('0x4'))['db'];var utils=require(_0x510b('0x5'));var logger=require(_0x510b('0x6'))(_0x510b('0x7'));var config=require(_0x510b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x510b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x403e25,_0x323f81,_0x19368a){return new BPromise(function(_0x33aca7,_0x14e6f0){return client[_0x510b('0xa')](_0x403e25,_0x19368a)[_0x510b('0xb')](function(_0x2041d8){logger[_0x510b('0xc')](_0x510b('0xd'),_0x323f81,'request\x20sent');logger[_0x510b('0xe')](_0x510b('0xf'),_0x323f81,'request\x20sent',JSON[_0x510b('0x10')](_0x2041d8));if(_0x2041d8['error']){if(_0x2041d8['error'][_0x510b('0x11')]===0x1f4){logger[_0x510b('0x12')](_0x510b('0xd'),_0x323f81,_0x2041d8[_0x510b('0x12')][_0x510b('0x13')]);return _0x14e6f0(_0x2041d8[_0x510b('0x12')][_0x510b('0x13')]);}logger[_0x510b('0x12')](_0x510b('0xd'),_0x323f81,_0x2041d8['error'][_0x510b('0x13')]);return _0x33aca7(_0x2041d8['error'][_0x510b('0x13')]);}else{logger[_0x510b('0xc')](_0x510b('0xd'),_0x323f81,_0x510b('0x14'));_0x33aca7(_0x2041d8[_0x510b('0x15')][_0x510b('0x13')]);}})[_0x510b('0x16')](function(_0x3bbd57){logger[_0x510b('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x323f81,_0x3bbd57);_0x14e6f0(_0x3bbd57);});});}exports[_0x510b('0x17')]=function(_0x547ef0){var _0x1d9983=this;return new Promise(function(_0x51ac8e,_0x7154b8){return db[_0x510b('0x18')]['create'](_0x547ef0['body'],{'raw':_0x547ef0[_0x510b('0x19')]?_0x547ef0[_0x510b('0x19')][_0x510b('0x1a')]===undefined?!![]:![]:!![]})[_0x510b('0xb')](function(_0x25c9fe){logger[_0x510b('0xc')]('CreateVoiceTransferReport',_0x547ef0);logger[_0x510b('0xe')]('CreateVoiceTransferReport',_0x547ef0,JSON[_0x510b('0x10')](_0x25c9fe));_0x51ac8e(_0x25c9fe);})[_0x510b('0x16')](function(_0x246ea4){logger[_0x510b('0x12')](_0x510b('0x17'),_0x246ea4[_0x510b('0x13')],_0x547ef0);_0x7154b8(_0x1d9983[_0x510b('0x12')](0x1f4,_0x246ea4[_0x510b('0x13')]));});});};
\ No newline at end of file
index fa7f9ad..da97e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x70e0,0x17b));var _0x070e=function(_0x5e18aa,_0xa0a74){_0x5e18aa=_0x5e18aa-0x0;var _0x45b5d3=_0x70e0[_0x5e18aa];return _0x45b5d3;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x70e0,0x17b));var _0x070e=function(_0xa7dbf6,_0x3169d4){_0xa7dbf6=_0xa7dbf6-0x0;var _0x51880d=_0x70e0[_0xa7dbf6];return _0x51880d;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router;
\ No newline at end of file
index 61b6d4e..36c3400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['originate','body','userId','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','json','originate\x20executed!','hangup','validate','format','user:%s','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','calls','calls\x20fired:','VoiceChannels','conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','bluebird','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','stack','name','status','send','NotFound','then','error','code','message','result','catch','User','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!'];(function(_0x3c1312,_0x45bfdb){var _0x5b4831=function(_0x53706f){while(--_0x53706f){_0x3c1312['push'](_0x3c1312['shift']());}};_0x5b4831(++_0x45bfdb);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2b399b,_0x2d4c0f){_0x2b399b=_0x2b399b-0x0;var _0x213e73=_0xf4eb[_0x2b399b];return _0x213e73;};'use strict';var path=require(_0xbf4e('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xbf4e('0x1'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0xbf4e('0x2')]({'port':0x232a});var logger=require(_0xbf4e('0x3'))(_0xbf4e('0x4'));var Redis=require(_0xbf4e('0x5'));config[_0xbf4e('0x6')]=_[_0xbf4e('0x7')](config[_0xbf4e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbf4e('0x8'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],_0xbf4e('0xa')]},'callNumber':{'type':_0xbf4e('0xb'),'required':[!![],_0xbf4e('0xc')]},'callerId':{'type':_0xbf4e('0xb')},'callbackUrl':{'type':_0xbf4e('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf4e('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbf4e('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0xbf4e('0xd')]}});var holdValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],_0xbf4e('0xa')]},'sessionId':{'type':_0xbf4e('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],_0xbf4e('0xa')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbf4e('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':_0xbf4e('0x9'),'required':[!![],_0xbf4e('0xa')]}});function emit(_0x542909,_0x14110b,_0x2c292c){logger[_0xbf4e('0xe')](_0x542909,_0x14110b,JSON[_0xbf4e('0xf')](_0x2c292c));io['to'](_0x542909)['emit'](_0x14110b,_0x2c292c);}function handleError(_0x247322){return function(_0x577c27){console['log']('handleError:',_0x577c27,_0x577c27 instanceof RangeError);logger['error'](_0x577c27[_0xbf4e('0x10')]);if(_0x577c27 instanceof RangeError){if(_0x577c27[_0xbf4e('0x11')]){delete _0x577c27[_0xbf4e('0x11')];}_0x247322['status'](0x194)['send'](_0x577c27);}else{if(_0x577c27[_0xbf4e('0x11')]){delete _0x577c27[_0xbf4e('0x11')];}_0x247322[_0xbf4e('0x12')](0x1f4)[_0xbf4e('0x13')](_0x577c27);}};}function checkError(){return function(_0x344727){if(!_0x344727){throw new RangeError(_0xbf4e('0x14'));}return _0x344727;};}function respondWithRpcPromise(_0x415963,_0x3d642a){return new BPromise(function(_0xd09e12,_0x376832){var _0x30539b=amiClient;return _0x30539b['request'](_0x415963,_0x3d642a)[_0xbf4e('0x15')](function(_0x2e7673){if(_0x2e7673['error']){if(_0x2e7673[_0xbf4e('0x16')][_0xbf4e('0x17')]===0x1f4){return _0x376832(_0x2e7673[_0xbf4e('0x16')][_0xbf4e('0x18')]);}return _0xd09e12(_0x2e7673[_0xbf4e('0x16')]['message']);}else{_0xd09e12(_0x2e7673[_0xbf4e('0x19')]);}})[_0xbf4e('0x1a')](function(_0x3d6863){_0x376832(_0x3d6863);});});}function getAgent(_0x5766d4){return db[_0xbf4e('0x1b')]['findOne']({'where':{'id':_0x5766d4,'role':'agent'}})[_0xbf4e('0x15')](checkError());}function getAgentCheckSession(_0x5a0a9b,_0x38c923){return new BPromise(function(_0x315df3,_0x4021a9){var _0x41f918=respondWithRpcPromise('VoiceChannels');var _0x2d4686=getAgent(_0x5a0a9b);Promise[_0xbf4e('0x1c')]([_0x41f918,_0x2d4686])[_0xbf4e('0x15')](function(_0x4cd4a1){var _0x681c3b=_0x4cd4a1[0x0];var _0x590c85=_0x4cd4a1[0x1];var _0x1dfa81=_[_0xbf4e('0x1d')](_0x681c3b[_0xbf4e('0x1e')],function(_0x498dbd){return _0x498dbd[_0xbf4e('0x1f')]==_0x590c85['id']&&_0x498dbd[_0xbf4e('0x20')]==_0x38c923;});if(_0x1dfa81[_0xbf4e('0x21')]==0x1){_0x315df3(_0x590c85);}else{_0x4021a9(new RangeError(_0xbf4e('0x22')+_0x38c923+_0xbf4e('0x23')));}});});}exports[_0xbf4e('0x24')]=function(_0x5a7c71,_0x35c82d){logger[_0xbf4e('0xe')]('originate\x20fired:',_0x5a7c71[_0xbf4e('0x25')]);var _0x26a375=originateValidation['validate'](_0x5a7c71[_0xbf4e('0x25')]);if(_0x26a375['length']>0x0){return _0x35c82d[_0xbf4e('0x12')](0x190)['json'](_0x26a375);}var _0x2f49d8=_0x5a7c71[_0xbf4e('0x25')][_0xbf4e('0x26')];var _0x5b3b28=_0x5a7c71[_0xbf4e('0x25')][_0xbf4e('0x27')];var _0x70c54f=_0x5a7c71[_0xbf4e('0x25')][_0xbf4e('0x28')];var _0x477873=_0x5a7c71['body'][_0xbf4e('0x29')];return getAgent(_0x2f49d8)[_0xbf4e('0x15')](function(_0x25b837){logger[_0xbf4e('0xe')](_0xbf4e('0x2a'),_0x25b837['name']);emit(util['format']('user:%s',_0x25b837['name']),_0xbf4e('0x2b'),{'callNumber':_0x5b3b28,'callerId':_0x70c54f,'callbackUrl':_0x477873});return _0x35c82d[_0xbf4e('0x12')](0xc8)[_0xbf4e('0x2c')]({'error':![],'message':_0xbf4e('0x2d')});})[_0xbf4e('0x1a')](handleError(_0x35c82d));};exports[_0xbf4e('0x2e')]=function(_0x355b42,_0x467b74){logger[_0xbf4e('0xe')]('hangup\x20fired:',_0x355b42['body']);var _0x303fd8=hangupValidation[_0xbf4e('0x2f')](_0x355b42[_0xbf4e('0x25')]);if(_0x303fd8['length']>0x0){return _0x467b74[_0xbf4e('0x12')](0x190)['json'](_0x303fd8);}var _0x370d90=_0x355b42[_0xbf4e('0x25')][_0xbf4e('0x26')];var _0xb30f90=_0x355b42['body'][_0xbf4e('0x20')];return getAgent(_0x370d90)[_0xbf4e('0x15')](function(_0x3aa308){logger[_0xbf4e('0xe')]('entityFound:',_0x3aa308[_0xbf4e('0x11')]);emit(util[_0xbf4e('0x30')](_0xbf4e('0x31'),_0x3aa308[_0xbf4e('0x11')]),_0xbf4e('0x32'),{'sessionId':_0xb30f90});return _0x467b74[_0xbf4e('0x12')](0xc8)[_0xbf4e('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0xbf4e('0x1a')](handleError(_0x467b74));};exports[_0xbf4e('0x33')]=function(_0x518400,_0x47d6f2){logger[_0xbf4e('0xe')](_0xbf4e('0x34'),_0x518400['body']);var _0x5bfc4d=answerValidation[_0xbf4e('0x2f')](_0x518400[_0xbf4e('0x25')]);if(_0x5bfc4d[_0xbf4e('0x21')]>0x0){return _0x47d6f2[_0xbf4e('0x12')](0x190)[_0xbf4e('0x2c')](_0x5bfc4d);}var _0x3ad0a4=_0x518400['body'][_0xbf4e('0x26')];var _0x7bd91=_0x518400['body']['sessionId'];return getAgent(_0x3ad0a4)['then'](function(_0x53d7dd){logger[_0xbf4e('0xe')]('entityFound:',_0x53d7dd[_0xbf4e('0x11')]);emit(util[_0xbf4e('0x30')]('user:%s',_0x53d7dd['name']),_0xbf4e('0x35'),{'sessionId':_0x7bd91});return _0x47d6f2[_0xbf4e('0x12')](0xc8)[_0xbf4e('0x2c')]({'error':![],'message':_0xbf4e('0x36')});})[_0xbf4e('0x1a')](handleError(_0x47d6f2));};exports['hold']=function(_0x2b20d3,_0x3e8ade){logger[_0xbf4e('0xe')](_0xbf4e('0x37'),_0x2b20d3[_0xbf4e('0x25')]);var _0x1bc421=holdValidation[_0xbf4e('0x2f')](_0x2b20d3[_0xbf4e('0x25')]);if(_0x1bc421['length']>0x0){return _0x3e8ade[_0xbf4e('0x12')](0x190)[_0xbf4e('0x2c')](_0x1bc421);}var _0x1833c1=_0x2b20d3[_0xbf4e('0x25')][_0xbf4e('0x26')];var _0x1198e8=_0x2b20d3[_0xbf4e('0x25')][_0xbf4e('0x20')];return getAgent(_0x1833c1)[_0xbf4e('0x15')](function(_0x3447ab){logger[_0xbf4e('0xe')](_0xbf4e('0x2a'),_0x3447ab[_0xbf4e('0x11')]);emit(util[_0xbf4e('0x30')](_0xbf4e('0x31'),_0x3447ab[_0xbf4e('0x11')]),_0xbf4e('0x38'),{'sessionId':_0x1198e8});return _0x3e8ade['status'](0xc8)[_0xbf4e('0x2c')]({'error':![],'message':_0xbf4e('0x39')});})[_0xbf4e('0x1a')](handleError(_0x3e8ade));};exports['unhold']=function(_0x33ab9a,_0x5ed838){logger['info'](_0xbf4e('0x3a'),_0x33ab9a[_0xbf4e('0x25')]);var _0x4d32b3=unholdValidation[_0xbf4e('0x2f')](_0x33ab9a[_0xbf4e('0x25')]);if(_0x4d32b3[_0xbf4e('0x21')]>0x0){return _0x5ed838[_0xbf4e('0x12')](0x190)[_0xbf4e('0x2c')](_0x4d32b3);}var _0x2ac2c8=_0x33ab9a[_0xbf4e('0x25')][_0xbf4e('0x26')];var _0x3cd61b=_0x33ab9a[_0xbf4e('0x25')][_0xbf4e('0x20')];return getAgent(_0x2ac2c8)['then'](function(_0x5d6324){logger[_0xbf4e('0xe')](_0xbf4e('0x2a'),_0x5d6324[_0xbf4e('0x11')]);emit(util['format'](_0xbf4e('0x31'),_0x5d6324[_0xbf4e('0x11')]),'webbar:unhold',{'sessionId':_0x3cd61b});return _0x5ed838['status'](0xc8)[_0xbf4e('0x2c')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x5ed838));};exports[_0xbf4e('0x3b')]=function(_0x3dd51a,_0x73ca86){logger[_0xbf4e('0xe')](_0xbf4e('0x3c'),_0x73ca86['body']);var _0x242a75=callsValidation['validate'](_0x3dd51a[_0xbf4e('0x25')]);if(_0x242a75['length']>0x0){return _0x73ca86[_0xbf4e('0x12')](0x190)['json'](_0x242a75);}var _0xab6991=_0x3dd51a[_0xbf4e('0x25')][_0xbf4e('0x26')];var _0x16592f=respondWithRpcPromise(_0xbf4e('0x3d'));var _0x52dfc4=getAgent(_0xab6991);return Promise['all']([_0x16592f,_0x52dfc4])['then'](function(_0x52ea6e){var _0x419a69=_0x52ea6e[0x0];var _0x453411=_0x52ea6e[0x1];var _0x5cfc26=_[_0xbf4e('0x1d')](_0x419a69[_0xbf4e('0x1e')],function(_0x458fea){return _0x458fea[_0xbf4e('0x1f')]==_0x453411['id'];});return _0x73ca86[_0xbf4e('0x12')](0xc8)[_0xbf4e('0x2c')]({'count':_0x5cfc26[_0xbf4e('0x21')],'rows':_0x5cfc26});})['catch'](handleError(_0x73ca86));};exports[_0xbf4e('0x3e')]=function(_0x137df1,_0x42e117){logger['info']('conference\x20fired:',_0x137df1[_0xbf4e('0x25')]);var _0x301d66=conferenceValidation[_0xbf4e('0x2f')](_0x137df1['body']);if(_0x301d66[_0xbf4e('0x21')]>0x0){return _0x42e117[_0xbf4e('0x12')](0x190)[_0xbf4e('0x2c')](_0x301d66);}var _0x4039a4=_0x137df1[_0xbf4e('0x25')][_0xbf4e('0x26')];return getAgent(_0x4039a4)[_0xbf4e('0x15')](function(_0x3ee848){logger[_0xbf4e('0xe')](_0xbf4e('0x2a'),_0x3ee848[_0xbf4e('0x11')]);emit(util[_0xbf4e('0x30')]('user:%s',_0x3ee848[_0xbf4e('0x11')]),'webbar:conference');return _0x42e117[_0xbf4e('0x12')](0xc8)[_0xbf4e('0x2c')]({'error':![],'message':_0xbf4e('0x3f')});})[_0xbf4e('0x1a')](handleError(_0x42e117));};exports[_0xbf4e('0x40')]=function(_0x2846ef,_0x13b0a6){logger[_0xbf4e('0xe')]('transfer\x20fired:',_0x2846ef[_0xbf4e('0x25')]);var _0x325d09=transferValidation[_0xbf4e('0x2f')](_0x2846ef[_0xbf4e('0x25')]);if(_0x325d09[_0xbf4e('0x21')]>0x0){return _0x13b0a6['status'](0x190)[_0xbf4e('0x2c')](_0x325d09);}var _0x753f25=_0x2846ef[_0xbf4e('0x25')][_0xbf4e('0x26')];var _0x12f19f=_0x2846ef[_0xbf4e('0x25')]['sessionId'];var _0x2246a2=_0x2846ef['body'][_0xbf4e('0x41')];return getAgent(_0x753f25)[_0xbf4e('0x15')](function(_0x9335f7){logger[_0xbf4e('0xe')]('entityFound:',_0x9335f7[_0xbf4e('0x11')]);emit(util['format']('user:%s',_0x9335f7[_0xbf4e('0x11')]),_0xbf4e('0x42'),{'sessionId':_0x12f19f,'transferNumber':_0x2246a2});return _0x13b0a6[_0xbf4e('0x12')](0xc8)['json']({'error':![],'message':_0xbf4e('0x43')});})[_0xbf4e('0x1a')](handleError(_0x13b0a6));};
\ No newline at end of file
+var _0xe205=['hold\x20fired:','hold\x20executed!','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','hangup','hangup\x20fired:','userId','format','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold'];(function(_0x56e7ce,_0x29bc6b){var _0x2bbff6=function(_0x15990d){while(--_0x15990d){_0x56e7ce['push'](_0x56e7ce['shift']());}};_0x2bbff6(++_0x29bc6b);}(_0xe205,0xa7));var _0x5e20=function(_0x4349df,_0x48b5fc){_0x4349df=_0x4349df-0x0;var _0x3685e2=_0xe205[_0x4349df];return _0x3685e2;};'use strict';var path=require(_0x5e20('0x0'));var fs=require('fs');var _=require(_0x5e20('0x1'));var db=require(_0x5e20('0x2'))['db'];var config=require(_0x5e20('0x3'));var util=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var jayson=require(_0x5e20('0x6'));var amiClient=jayson[_0x5e20('0x7')][_0x5e20('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0x5e20('0x9'));var Redis=require(_0x5e20('0xa'));config[_0x5e20('0xb')]=_[_0x5e20('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5e20('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'callNumber':{'type':'string','required':[!![],_0x5e20('0x10')]},'callerId':{'type':_0x5e20('0x11')},'callbackUrl':{'type':_0x5e20('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':[!![],_0x5e20('0x12')]},'transferNumber':{'type':_0x5e20('0x11'),'required':[!![],_0x5e20('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});function emit(_0x542b3c,_0xeaeb77,_0x9a59ce){logger[_0x5e20('0x14')](_0x542b3c,_0xeaeb77,JSON[_0x5e20('0x15')](_0x9a59ce));io['to'](_0x542b3c)[_0x5e20('0x16')](_0xeaeb77,_0x9a59ce);}function handleError(_0x3b353f){return function(_0x1cc706){console[_0x5e20('0x17')]('handleError:',_0x1cc706,_0x1cc706 instanceof RangeError);logger[_0x5e20('0x18')](_0x1cc706[_0x5e20('0x19')]);if(_0x1cc706 instanceof RangeError){if(_0x1cc706['name']){delete _0x1cc706[_0x5e20('0x1a')];}_0x3b353f[_0x5e20('0x1b')](0x194)[_0x5e20('0x1c')](_0x1cc706);}else{if(_0x1cc706[_0x5e20('0x1a')]){delete _0x1cc706['name'];}_0x3b353f[_0x5e20('0x1b')](0x1f4)['send'](_0x1cc706);}};}function checkError(){return function(_0x4a3587){if(!_0x4a3587){throw new RangeError('NotFound');}return _0x4a3587;};}function respondWithRpcPromise(_0x5d0d1a,_0xe562ba){return new BPromise(function(_0x5cca90,_0x3d89e4){var _0x29b111=amiClient;return _0x29b111[_0x5e20('0x1d')](_0x5d0d1a,_0xe562ba)[_0x5e20('0x1e')](function(_0x3ef7fa){if(_0x3ef7fa[_0x5e20('0x18')]){if(_0x3ef7fa['error'][_0x5e20('0x1f')]===0x1f4){return _0x3d89e4(_0x3ef7fa['error']['message']);}return _0x5cca90(_0x3ef7fa[_0x5e20('0x18')][_0x5e20('0x20')]);}else{_0x5cca90(_0x3ef7fa[_0x5e20('0x21')]);}})[_0x5e20('0x22')](function(_0xbf7a24){_0x3d89e4(_0xbf7a24);});});}function getAgent(_0x200774){return db[_0x5e20('0x23')]['findOne']({'where':{'id':_0x200774,'role':_0x5e20('0x24')}})[_0x5e20('0x1e')](checkError());}function getAgentCheckSession(_0x238758,_0x3032ef){return new BPromise(function(_0x4c799d,_0x3a0f06){var _0x2c5d80=respondWithRpcPromise(_0x5e20('0x25'));var _0x222e7a=getAgent(_0x238758);Promise[_0x5e20('0x26')]([_0x2c5d80,_0x222e7a])[_0x5e20('0x1e')](function(_0x5ec45b){var _0xbc2b0e=_0x5ec45b[0x0];var _0x34a3d6=_0x5ec45b[0x1];var _0x543c29=_[_0x5e20('0x27')](_0xbc2b0e[_0x5e20('0x28')],function(_0x335f1e){return _0x335f1e[_0x5e20('0x29')]==_0x34a3d6['id']&&_0x335f1e[_0x5e20('0x2a')]==_0x3032ef;});if(_0x543c29[_0x5e20('0x2b')]==0x1){_0x4c799d(_0x34a3d6);}else{_0x3a0f06(new RangeError('sessionId\x20'+_0x3032ef+_0x5e20('0x2c')));}});});}exports[_0x5e20('0x2d')]=function(_0x330341,_0x5f2f1d){logger[_0x5e20('0x14')](_0x5e20('0x2e'),_0x330341[_0x5e20('0x2f')]);var _0x1ed59d=originateValidation[_0x5e20('0x30')](_0x330341[_0x5e20('0x2f')]);if(_0x1ed59d[_0x5e20('0x2b')]>0x0){return _0x5f2f1d['status'](0x190)[_0x5e20('0x31')](_0x1ed59d);}var _0x1a9fff=_0x330341[_0x5e20('0x2f')]['userId'];var _0x9469cd=_0x330341[_0x5e20('0x2f')][_0x5e20('0x32')];var _0x2e367e=_0x330341[_0x5e20('0x2f')][_0x5e20('0x33')];var _0x1114ae=_0x330341[_0x5e20('0x2f')][_0x5e20('0x34')];return getAgent(_0x1a9fff)[_0x5e20('0x1e')](function(_0x36e825){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x36e825[_0x5e20('0x1a')]);emit(util['format'](_0x5e20('0x36'),_0x36e825['name']),'webbar:originate',{'callNumber':_0x9469cd,'callerId':_0x2e367e,'callbackUrl':_0x1114ae});return _0x5f2f1d[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':'originate\x20executed!'});})[_0x5e20('0x22')](handleError(_0x5f2f1d));};exports[_0x5e20('0x37')]=function(_0x4f34c0,_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x38'),_0x4f34c0[_0x5e20('0x2f')]);var _0x15ce1d=hangupValidation[_0x5e20('0x30')](_0x4f34c0[_0x5e20('0x2f')]);if(_0x15ce1d[_0x5e20('0x2b')]>0x0){return _0x3f3908[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x15ce1d);}var _0x473b69=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x1cb3f0=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x473b69)[_0x5e20('0x1e')](function(_0x17feb4){logger['info'](_0x5e20('0x35'),_0x17feb4[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x17feb4[_0x5e20('0x1a')]),'webbar:hangup',{'sessionId':_0x1cb3f0});return _0x3f3908[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x3b')});})[_0x5e20('0x22')](handleError(_0x3f3908));};exports[_0x5e20('0x3c')]=function(_0x30d3ef,_0x5c7ae8){logger[_0x5e20('0x14')](_0x5e20('0x3d'),_0x30d3ef[_0x5e20('0x2f')]);var _0x5a21f0=answerValidation[_0x5e20('0x30')](_0x30d3ef[_0x5e20('0x2f')]);if(_0x5a21f0[_0x5e20('0x2b')]>0x0){return _0x5c7ae8[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5a21f0);}var _0x336d61=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x5c9504=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x336d61)[_0x5e20('0x1e')](function(_0x503cb6){logger[_0x5e20('0x14')]('entityFound:',_0x503cb6[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x503cb6[_0x5e20('0x1a')]),_0x5e20('0x3e'),{'sessionId':_0x5c9504});return _0x5c7ae8['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x5c7ae8));};exports[_0x5e20('0x3f')]=function(_0x28f155,_0x9d9d62){logger[_0x5e20('0x14')](_0x5e20('0x40'),_0x28f155[_0x5e20('0x2f')]);var _0x57c794=holdValidation['validate'](_0x28f155['body']);if(_0x57c794[_0x5e20('0x2b')]>0x0){return _0x9d9d62[_0x5e20('0x1b')](0x190)['json'](_0x57c794);}var _0x22b84e=_0x28f155[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x3bd5b8=_0x28f155[_0x5e20('0x2f')]['sessionId'];return getAgent(_0x22b84e)[_0x5e20('0x1e')](function(_0x245b52){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x245b52[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x245b52[_0x5e20('0x1a')]),'webbar:hold',{'sessionId':_0x3bd5b8});return _0x9d9d62['status'](0xc8)['json']({'error':![],'message':_0x5e20('0x41')});})[_0x5e20('0x22')](handleError(_0x9d9d62));};exports['unhold']=function(_0x4392ca,_0x4bfea7){logger[_0x5e20('0x14')]('unhold\x20fired:',_0x4392ca[_0x5e20('0x2f')]);var _0x59372c=unholdValidation[_0x5e20('0x30')](_0x4392ca[_0x5e20('0x2f')]);if(_0x59372c[_0x5e20('0x2b')]>0x0){return _0x4bfea7[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59372c);}var _0x200094=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x19c128=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x200094)[_0x5e20('0x1e')](function(_0x278b0e){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x278b0e[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x278b0e['name']),'webbar:unhold',{'sessionId':_0x19c128});return _0x4bfea7[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x42')});})[_0x5e20('0x22')](handleError(_0x4bfea7));};exports[_0x5e20('0x43')]=function(_0x596971,_0x457552){logger[_0x5e20('0x14')](_0x5e20('0x44'),_0x457552['body']);var _0x5d2aa2=callsValidation['validate'](_0x596971[_0x5e20('0x2f')]);if(_0x5d2aa2[_0x5e20('0x2b')]>0x0){return _0x457552[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5d2aa2);}var _0xbacc1f=_0x596971[_0x5e20('0x2f')]['userId'];var _0x393724=respondWithRpcPromise('VoiceChannels');var _0x2913e7=getAgent(_0xbacc1f);return Promise['all']([_0x393724,_0x2913e7])[_0x5e20('0x1e')](function(_0x2eff14){var _0x141743=_0x2eff14[0x0];var _0x5f025b=_0x2eff14[0x1];var _0x1f6a32=_[_0x5e20('0x27')](_0x141743[_0x5e20('0x28')],function(_0x4309b8){return _0x4309b8[_0x5e20('0x29')]==_0x5f025b['id'];});return _0x457552[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'count':_0x1f6a32['length'],'rows':_0x1f6a32});})[_0x5e20('0x22')](handleError(_0x457552));};exports[_0x5e20('0x45')]=function(_0x1a03e4,_0x2f9089){logger['info'](_0x5e20('0x46'),_0x1a03e4[_0x5e20('0x2f')]);var _0x23f07d=conferenceValidation[_0x5e20('0x30')](_0x1a03e4['body']);if(_0x23f07d[_0x5e20('0x2b')]>0x0){return _0x2f9089[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x23f07d);}var _0x53ddd4=_0x1a03e4['body']['userId'];return getAgent(_0x53ddd4)[_0x5e20('0x1e')](function(_0x1eb84c){logger['info'](_0x5e20('0x35'),_0x1eb84c[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')]('user:%s',_0x1eb84c[_0x5e20('0x1a')]),_0x5e20('0x47'));return _0x2f9089['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x48')});})['catch'](handleError(_0x2f9089));};exports[_0x5e20('0x49')]=function(_0x9993ae,_0x1e531d){logger[_0x5e20('0x14')]('transfer\x20fired:',_0x9993ae[_0x5e20('0x2f')]);var _0x59bff7=transferValidation['validate'](_0x9993ae[_0x5e20('0x2f')]);if(_0x59bff7[_0x5e20('0x2b')]>0x0){return _0x1e531d[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59bff7);}var _0x54cd1=_0x9993ae[_0x5e20('0x2f')]['userId'];var _0x4bccbe=_0x9993ae[_0x5e20('0x2f')][_0x5e20('0x2a')];var _0x17f248=_0x9993ae['body'][_0x5e20('0x4a')];return getAgent(_0x54cd1)[_0x5e20('0x1e')](function(_0x52f8ef){logger[_0x5e20('0x14')]('entityFound:',_0x52f8ef['name']);emit(util[_0x5e20('0x3a')]('user:%s',_0x52f8ef[_0x5e20('0x1a')]),_0x5e20('0x4b'),{'sessionId':_0x4bccbe,'transferNumber':_0x17f248});return _0x1e531d[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x4c')});})[_0x5e20('0x22')](handleError(_0x1e531d));};
\ No newline at end of file
index 3c9936d..23a747a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x47c5,0x165));var _0x547c=function(_0x11e2f0,_0x150828){_0x11e2f0=_0x11e2f0-0x0;var _0x1d9680=_0x47c5[_0x11e2f0];return _0x1d9680;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x1f69bc,_0xaffd71){var _0x1ac3c5=function(_0x3cd005){while(--_0x3cd005){_0x1f69bc['push'](_0x1f69bc['shift']());}};_0x1ac3c5(++_0xaffd71);}(_0x7880,0x1f4));var _0x0788=function(_0x300860,_0x509371){_0x300860=_0x300860-0x0;var _0x2094ad=_0x7880[_0x300860];return _0x2094ad;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router;
\ No newline at end of file
index d94c885..e1415fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7bf=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x40f310,_0x33f8ba){var _0x414b2d=function(_0x23aa85){while(--_0x23aa85){_0x40f310['push'](_0x40f310['shift']());}};_0x414b2d(++_0x33f8ba);}(_0xd7bf,0x89));var _0xfd7b=function(_0x2aedc9,_0x1c6fb3){_0x2aedc9=_0x2aedc9-0x0;var _0x58da7f=_0xd7bf[_0x2aedc9];return _0x58da7f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfd7b('0x0'));module[_0xfd7b('0x1')]={'name':{'type':Sequelize[_0xfd7b('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xfd7b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xfd7b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xfd7b('0x2')],'defaultValue':function(){return rs[_0xfd7b('0x3')]();}},'phone':{'type':Sequelize[_0xfd7b('0x2')]},'type':{'type':Sequelize[_0xfd7b('0x4')](_0xfd7b('0x5'),_0xfd7b('0x6'))},'accountSid':{'type':Sequelize[_0xfd7b('0x2')]},'baseUrl':{'type':Sequelize[_0xfd7b('0x2')]},'authToken':{'type':Sequelize[_0xfd7b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xfd7b('0x7')],'defaultValue':function(){return _0xfd7b('0x8');}},'notificationSound':{'type':Sequelize[_0xfd7b('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xfd7b('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd7b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfd7b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfd7b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfd7b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfd7b('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfd7b('0xb'),'set':function(_0x522a1d){if(!_0x522a1d){this[_0xfd7b('0xc')](_0xfd7b('0xd'),null);}this[_0xfd7b('0xc')](_0xfd7b('0xe'),_0x522a1d);}},'description':{'type':Sequelize[_0xfd7b('0x2')]}};
\ No newline at end of file
+var _0xf27d=['mandatoryDisposition','randomstring','STRING','name','generate','ENUM','twilio','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x43c691,_0x378ea9){var _0x59fee7=function(_0x2cce55){while(--_0x2cce55){_0x43c691['push'](_0x43c691['shift']());}};_0x59fee7(++_0x378ea9);}(_0xf27d,0x121));var _0xdf27=function(_0x5f3030,_0xfdbd1b){_0x5f3030=_0x5f3030-0x0;var _0x27f659=_0xf27d[_0x5f3030];return _0x27f659;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdf27('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf27('0x1')],'unique':_0xdf27('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xdf27('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xdf27('0x1')],'defaultValue':function(){return rs[_0xdf27('0x3')]();}},'phone':{'type':Sequelize[_0xdf27('0x1')]},'type':{'type':Sequelize[_0xdf27('0x4')](_0xdf27('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0xdf27('0x1')]},'baseUrl':{'type':Sequelize[_0xdf27('0x1')]},'authToken':{'type':Sequelize[_0xdf27('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xdf27('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdf27('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdf27('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdf27('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdf27('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf27('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xdf27('0x8')],'defaultValue':![],'comment':_0xdf27('0x9'),'set':function(_0x411221){if(!_0x411221){this[_0xdf27('0xa')]('mandatoryDispositionPauseId',null);}this[_0xdf27('0xa')](_0xdf27('0xb'),_0x411221);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 258b929..ed28a22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcf0=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','name','filter','options','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','findOne','nolimit','order','WhatsappAccountId','Disposition','includeAll','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','twilio','replace','Body','messageId','MessageSid','notifications','from','message_id','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','ListId','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','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','redis','defaults','localhost','register','jayson/promise','http','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','get','UserProfileResource','then','end','send','Pause','mandatoryDispositionPause','map','WhatsappAccount'];(function(_0x545cf9,_0x1dbfd0){var _0x2c0254=function(_0x23b057){while(--_0x23b057){_0x545cf9['push'](_0x545cf9['shift']());}};_0x2c0254(++_0x1dbfd0);}(_0xbcf0,0x84));var _0x0bcf=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xbcf0[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bcf('0x0'));var zipdir=require(_0x0bcf('0x1'));var jsonpatch=require(_0x0bcf('0x2'));var rp=require(_0x0bcf('0x3'));var moment=require(_0x0bcf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0bcf('0x5'));var util=require(_0x0bcf('0x6'));var path=require(_0x0bcf('0x7'));var sox=require('sox');var csv=require(_0x0bcf('0x8'));var ejs=require(_0x0bcf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0bcf('0xa'));var crypto=require(_0x0bcf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0bcf('0xc'));var toCsv=require(_0x0bcf('0x8'));var querystring=require(_0x0bcf('0xd'));var Papa=require(_0x0bcf('0xe'));var Redis=require(_0x0bcf('0xf'));var authService=require(_0x0bcf('0x10'));var qs=require(_0x0bcf('0x11'));var as=require(_0x0bcf('0x12'));var hardwareService=require(_0x0bcf('0x13'));var logger=require(_0x0bcf('0x14'))(_0x0bcf('0x15'));var utils=require(_0x0bcf('0x16'));var config=require(_0x0bcf('0x17'));var licenseUtil=require(_0x0bcf('0x18'));var db=require('../../mysqldb')['db'];config[_0x0bcf('0x19')]=_[_0x0bcf('0x1a')](config[_0x0bcf('0x19')],{'host':_0x0bcf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bcf('0x19')]));require('./whatsappAccount.socket')[_0x0bcf('0x1c')](socket);var jayson=require(_0x0bcf('0x1d'));var client=jayson['client'][_0x0bcf('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x40ebfd,_0x3a2069,_0xbb50c8,_0x3f2d0d){return new BPromise(function(_0xb51801,_0x544a12){var _0x322c2a=_0x3f2d0d||client;return _0x322c2a['request'](_0x40ebfd,_0xbb50c8)['then'](function(_0x26d517){logger[_0x0bcf('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x3a2069,_0x0bcf('0x20'));logger[_0x0bcf('0x21')](_0x0bcf('0x22'),_0x3a2069,_0x0bcf('0x20'),JSON[_0x0bcf('0x23')](_0x26d517));if(_0x26d517[_0x0bcf('0x24')]){if(_0x26d517[_0x0bcf('0x24')][_0x0bcf('0x25')]===0x1f4){logger[_0x0bcf('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x3a2069,_0x26d517[_0x0bcf('0x24')]['message']);return _0x544a12(_0x26d517[_0x0bcf('0x24')][_0x0bcf('0x26')]);}logger['error'](_0x0bcf('0x27'),_0x3a2069,_0x26d517[_0x0bcf('0x24')]['message']);return _0xb51801(_0x26d517['error']['message']);}else{logger['info'](_0x0bcf('0x27'),_0x3a2069,_0x0bcf('0x20'));_0xb51801(_0x26d517[_0x0bcf('0x28')][_0x0bcf('0x26')]);}})[_0x0bcf('0x29')](function(_0x54c63a){logger[_0x0bcf('0x24')](_0x0bcf('0x27'),_0x3a2069,_0x54c63a);_0x544a12(_0x54c63a);});});}function respondWithStatusCode(_0x58f39e,_0x286536){_0x286536=_0x286536||0xcc;return function(_0x9fe26e){if(_0x9fe26e){return _0x58f39e[_0x0bcf('0x2a')](_0x286536);}return _0x58f39e[_0x0bcf('0x2b')](_0x286536)['end']();};}function respondWithResult(_0x3204dd,_0x4521d6){_0x4521d6=_0x4521d6||0xc8;return function(_0x1c359f){if(_0x1c359f){return _0x3204dd[_0x0bcf('0x2b')](_0x4521d6)['json'](_0x1c359f);}};}function respondWithFilteredResult(_0x23adb1,_0x404b71){return function(_0x38b2ef){if(_0x38b2ef){var _0x3ed156=typeof _0x404b71[_0x0bcf('0x2c')]==='undefined'&&typeof _0x404b71['limit']===_0x0bcf('0x2d');var _0x27a071=_0x38b2ef[_0x0bcf('0x2e')];var _0x35639f=_0x3ed156?0x0:_0x404b71[_0x0bcf('0x2c')];var _0x1bf544=_0x3ed156?_0x38b2ef[_0x0bcf('0x2e')]:_0x404b71['offset']+_0x404b71[_0x0bcf('0x2f')];var _0x3eee5b;if(_0x1bf544>=_0x27a071){_0x1bf544=_0x27a071;_0x3eee5b=0xc8;}else{_0x3eee5b=0xce;}_0x23adb1[_0x0bcf('0x2b')](_0x3eee5b);return _0x23adb1[_0x0bcf('0x30')]('Content-Range',_0x35639f+'-'+_0x1bf544+'/'+_0x27a071)[_0x0bcf('0x31')](_0x38b2ef);}return null;};}function patchUpdates(_0x1d9598){return function(_0x28ba2c){try{jsonpatch[_0x0bcf('0x32')](_0x28ba2c,_0x1d9598,!![]);}catch(_0x473c1b){return BPromise[_0x0bcf('0x33')](_0x473c1b);}return _0x28ba2c[_0x0bcf('0x34')]();};}function saveUpdates(_0x1fd91d,_0x3f94dd){return function(_0x1b8263){if(_0x1b8263){return _0x1b8263['update'](_0x1fd91d)['then'](function(_0x4b2277){return _0x4b2277;});}return null;};}function removeEntity(_0x5bbc2c,_0x18a60e){return function(_0x1babee){if(_0x1babee){return _0x1babee['destroy']()['then'](function(){var _0x14c06b=_0x1babee[_0x0bcf('0x35')]({'plain':!![]});var _0x325b1b='WhatsappAccounts';return db[_0x0bcf('0x36')]['destroy']({'where':{'type':_0x325b1b,'resourceId':_0x14c06b['id']}})['then'](function(){return _0x1babee;});})[_0x0bcf('0x37')](function(){_0x5bbc2c[_0x0bcf('0x2b')](0xcc)[_0x0bcf('0x38')]();});}};}function handleEntityNotFound(_0x428fd6,_0x11c34e){return function(_0x2793f6){if(!_0x2793f6){_0x428fd6[_0x0bcf('0x2a')](0x194);}return _0x2793f6;};}function handleError(_0x3a8a2f,_0x101c19){_0x101c19=_0x101c19||0x1f4;return function(_0x5f088d){logger[_0x0bcf('0x24')](_0x5f088d['stack']);if(_0x5f088d['name']){delete _0x5f088d['name'];}_0x3a8a2f[_0x0bcf('0x2b')](_0x101c19)[_0x0bcf('0x39')](_0x5f088d);};}exports['index']=function(_0x29344e,_0x5d9129){var _0x5e29d4={'include':[{'model':db[_0x0bcf('0x3a')],'as':_0x0bcf('0x3b')}]},_0x295777={},_0x1ac8b8={'count':0x0,'rows':[]};var _0x35c79b=_[_0x0bcf('0x3c')](db[_0x0bcf('0x3d')][_0x0bcf('0x3e')],function(_0xa46cd1){return{'name':_0xa46cd1[_0x0bcf('0x3f')],'type':_0xa46cd1[_0x0bcf('0x40')][_0x0bcf('0x41')]};});_0x295777[_0x0bcf('0x42')]=_[_0x0bcf('0x3c')](_0x35c79b,'name');_0x295777['query']=_[_0x0bcf('0x43')](_0x29344e[_0x0bcf('0x44')]);_0x295777['filters']=_[_0x0bcf('0x45')](_0x295777[_0x0bcf('0x42')],_0x295777[_0x0bcf('0x44')]);_0x5e29d4[_0x0bcf('0x46')]=_['intersection'](_0x295777['model'],qs['fields'](_0x29344e['query'][_0x0bcf('0x47')]));_0x5e29d4[_0x0bcf('0x46')]=_0x5e29d4[_0x0bcf('0x46')][_0x0bcf('0x48')]?_0x5e29d4['attributes']:_0x295777[_0x0bcf('0x42')];if(!_0x29344e[_0x0bcf('0x44')][_0x0bcf('0x49')]('nolimit')){_0x5e29d4[_0x0bcf('0x2f')]=qs[_0x0bcf('0x2f')](_0x29344e[_0x0bcf('0x44')][_0x0bcf('0x2f')]);_0x5e29d4[_0x0bcf('0x2c')]=qs[_0x0bcf('0x2c')](_0x29344e[_0x0bcf('0x44')][_0x0bcf('0x2c')]);}_0x5e29d4['order']=qs[_0x0bcf('0x4a')](_0x29344e['query'][_0x0bcf('0x4a')]);_0x5e29d4[_0x0bcf('0x4b')]=qs[_0x0bcf('0x4c')](_[_0x0bcf('0x4d')](_0x29344e[_0x0bcf('0x44')],_0x295777[_0x0bcf('0x4c')]),_0x35c79b);if(_0x29344e[_0x0bcf('0x44')]['filter']){_0x5e29d4[_0x0bcf('0x4b')]=_[_0x0bcf('0x4e')](_0x5e29d4[_0x0bcf('0x4b')],{'$or':_[_0x0bcf('0x3c')](_0x35c79b,function(_0x2401bd){if(_0x2401bd[_0x0bcf('0x40')]!=='VIRTUAL'){var _0x31b0fe={};_0x31b0fe[_0x2401bd[_0x0bcf('0x4f')]]={'$like':'%'+_0x29344e[_0x0bcf('0x44')][_0x0bcf('0x50')]+'%'};return _0x31b0fe;}})});}_0x5e29d4=_['merge']({},_0x5e29d4,_0x29344e[_0x0bcf('0x51')]);var _0x4205af={'where':_0x5e29d4[_0x0bcf('0x4b')]};return db[_0x0bcf('0x3d')][_0x0bcf('0x2e')](_0x4205af)['then'](function(_0x20e4fa){_0x1ac8b8[_0x0bcf('0x2e')]=_0x20e4fa;if(_0x29344e[_0x0bcf('0x44')]['includeAll']){_0x5e29d4[_0x0bcf('0x52')]=[{'all':!![]}];}return db[_0x0bcf('0x3d')]['findAll'](_0x5e29d4);})[_0x0bcf('0x37')](function(_0x1ce3f9){_0x1ac8b8[_0x0bcf('0x53')]=_0x1ce3f9;return _0x1ac8b8;})['then'](respondWithFilteredResult(_0x5d9129,_0x5e29d4))['catch'](handleError(_0x5d9129,null));};exports[_0x0bcf('0x54')]=function(_0x3cae48,_0x221774){var _0x31c114={'raw':![],'where':{'id':_0x3cae48[_0x0bcf('0x55')]['id']},'include':[{'model':db[_0x0bcf('0x3a')],'as':_0x0bcf('0x3b')}]},_0x33c42f={};_0x33c42f[_0x0bcf('0x42')]=_['keys'](db['WhatsappAccount'][_0x0bcf('0x3e')]);_0x33c42f['query']=_[_0x0bcf('0x43')](_0x3cae48[_0x0bcf('0x44')]);_0x33c42f['filters']=_[_0x0bcf('0x45')](_0x33c42f['model'],_0x33c42f['query']);_0x31c114[_0x0bcf('0x46')]=_[_0x0bcf('0x45')](_0x33c42f['model'],qs['fields'](_0x3cae48[_0x0bcf('0x44')]['fields']));_0x31c114['attributes']=_0x31c114[_0x0bcf('0x46')][_0x0bcf('0x48')]?_0x31c114[_0x0bcf('0x46')]:_0x33c42f[_0x0bcf('0x42')];if(_0x3cae48[_0x0bcf('0x44')]['includeAll']){_0x31c114['include']=[{'all':!![]}];}_0x31c114=_['merge']({},_0x31c114,_0x3cae48[_0x0bcf('0x51')]);return db[_0x0bcf('0x3d')][_0x0bcf('0x56')](_0x31c114)[_0x0bcf('0x37')](handleEntityNotFound(_0x221774,null))['then'](respondWithResult(_0x221774,null))[_0x0bcf('0x29')](handleError(_0x221774,null));};exports[_0x0bcf('0x57')]=function(_0x4d9c87,_0x522ed5){return db[_0x0bcf('0x3d')][_0x0bcf('0x57')](_0x4d9c87[_0x0bcf('0x58')],{})[_0x0bcf('0x37')](function(_0x2a0d71){var _0x3baea2=_0x4d9c87[_0x0bcf('0x59')]['get']({'plain':!![]});if(!_0x3baea2)throw new Error(_0x0bcf('0x5a'));if(_0x3baea2[_0x0bcf('0x5b')]===_0x0bcf('0x59')){var _0x1de609=_0x2a0d71[_0x0bcf('0x35')]({'plain':!![]});var _0x1d854a=_0x0bcf('0x5c');return db[_0x0bcf('0x5d')][_0x0bcf('0x56')]({'where':{'name':_0x1d854a,'userProfileId':_0x3baea2[_0x0bcf('0x5e')]},'raw':!![]})[_0x0bcf('0x37')](function(_0x434d4e){if(_0x434d4e&&_0x434d4e['autoAssociation']===0x0){return db[_0x0bcf('0x36')][_0x0bcf('0x57')]({'name':_0x1de609[_0x0bcf('0x4f')],'resourceId':_0x1de609['id'],'type':_0x434d4e['name'],'sectionId':_0x434d4e['id']},{})[_0x0bcf('0x37')](function(){return _0x2a0d71;});}else{return _0x2a0d71;}})['catch'](function(_0x2e1e1f){logger[_0x0bcf('0x24')](_0x0bcf('0x5f'),_0x2e1e1f);throw _0x2e1e1f;});}return _0x2a0d71;})[_0x0bcf('0x37')](respondWithResult(_0x522ed5,0xc9))[_0x0bcf('0x29')](handleError(_0x522ed5,null));};exports[_0x0bcf('0x60')]=function(_0x59d0c8,_0x3387ba){if(_0x59d0c8['body']['id']){delete _0x59d0c8[_0x0bcf('0x58')]['id'];}return db['WhatsappAccount'][_0x0bcf('0x56')]({'where':{'id':_0x59d0c8[_0x0bcf('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x0bcf('0x3b')}]})['then'](handleEntityNotFound(_0x3387ba,null))[_0x0bcf('0x37')](saveUpdates(_0x59d0c8['body'],null))['then'](respondWithResult(_0x3387ba,null))[_0x0bcf('0x29')](handleError(_0x3387ba,null));};exports[_0x0bcf('0x61')]=function(_0x1a45f0,_0x91e8ea){return db[_0x0bcf('0x3d')]['find']({'where':{'id':_0x1a45f0[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x91e8ea,null))[_0x0bcf('0x37')](removeEntity(_0x91e8ea,null))[_0x0bcf('0x29')](handleError(_0x91e8ea,null));};exports[_0x0bcf('0x62')]=function(_0x3a6a61,_0x116bf6){return db[_0x0bcf('0x3d')][_0x0bcf('0x62')]()[_0x0bcf('0x37')](respondWithResult(_0x116bf6,null))[_0x0bcf('0x29')](handleError(_0x116bf6,null));};exports[_0x0bcf('0x63')]=function(_0x6009e6,_0x3fd51f,_0x5438b7){if(_0x6009e6[_0x0bcf('0x58')]['id']){delete _0x6009e6[_0x0bcf('0x58')]['id'];}return db['WhatsappAccount'][_0x0bcf('0x56')]({'where':{'id':_0x6009e6[_0x0bcf('0x55')]['id']}})['then'](handleEntityNotFound(_0x3fd51f,null))['then'](function(_0x1acc49){if(_0x1acc49){_0x6009e6['body']['WhatsappAccountId']=_0x1acc49['id'];return db['Disposition']['create'](_0x6009e6[_0x0bcf('0x58')]);}})['then'](respondWithResult(_0x3fd51f,null))[_0x0bcf('0x29')](handleError(_0x3fd51f,null));};exports['getDispositions']=function(_0x2b4f94,_0x187c93,_0xac1852){var _0x5b72a8={'raw':![],'where':{}};var _0x1e3de5={};var _0x124ce3={'count':0x0,'rows':[]};return db[_0x0bcf('0x3d')][_0x0bcf('0x64')]({'where':{'id':_0x2b4f94[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x187c93,null))['then'](function(_0x40d553){if(_0x40d553){_0x1e3de5[_0x0bcf('0x42')]=_['keys'](db['Disposition']['rawAttributes']);_0x1e3de5['query']=_[_0x0bcf('0x43')](_0x2b4f94['query']);_0x1e3de5[_0x0bcf('0x4c')]=_[_0x0bcf('0x45')](_0x1e3de5[_0x0bcf('0x42')],_0x1e3de5[_0x0bcf('0x44')]);_0x5b72a8[_0x0bcf('0x46')]=_[_0x0bcf('0x45')](_0x1e3de5['model'],qs[_0x0bcf('0x47')](_0x2b4f94[_0x0bcf('0x44')]['fields']));_0x5b72a8[_0x0bcf('0x46')]=_0x5b72a8['attributes'][_0x0bcf('0x48')]?_0x5b72a8[_0x0bcf('0x46')]:_0x1e3de5[_0x0bcf('0x42')];if(!_0x2b4f94[_0x0bcf('0x44')][_0x0bcf('0x49')](_0x0bcf('0x65'))){_0x5b72a8['limit']=qs[_0x0bcf('0x2f')](_0x2b4f94[_0x0bcf('0x44')][_0x0bcf('0x2f')]);_0x5b72a8['offset']=qs[_0x0bcf('0x2c')](_0x2b4f94['query'][_0x0bcf('0x2c')]);}_0x5b72a8[_0x0bcf('0x66')]=qs[_0x0bcf('0x4a')](_0x2b4f94[_0x0bcf('0x44')][_0x0bcf('0x4a')]);_0x5b72a8[_0x0bcf('0x4b')]=qs[_0x0bcf('0x4c')](_['pick'](_0x2b4f94[_0x0bcf('0x44')],_0x1e3de5[_0x0bcf('0x4c')]));_0x5b72a8[_0x0bcf('0x4b')][_0x0bcf('0x67')]=_0x40d553['id'];if(_0x2b4f94[_0x0bcf('0x44')][_0x0bcf('0x50')]){_0x5b72a8['where']=_[_0x0bcf('0x4e')](_0x5b72a8[_0x0bcf('0x4b')],{'$or':_['map'](_0x5b72a8[_0x0bcf('0x46')],function(_0x2c8a44){var _0x229e71={};_0x229e71[_0x2c8a44]={'$like':'%'+_0x2b4f94['query'][_0x0bcf('0x50')]+'%'};return _0x229e71;})});}_0x5b72a8=_[_0x0bcf('0x4e')]({},_0x5b72a8,_0x2b4f94[_0x0bcf('0x51')]);return db[_0x0bcf('0x68')][_0x0bcf('0x2e')]({'where':_0x5b72a8['where']})[_0x0bcf('0x37')](function(_0x5d2237){_0x124ce3[_0x0bcf('0x2e')]=_0x5d2237;if(_0x2b4f94[_0x0bcf('0x44')][_0x0bcf('0x69')]){_0x5b72a8['include']=[{'all':!![]}];}return db[_0x0bcf('0x68')][_0x0bcf('0x6a')](_0x5b72a8);})[_0x0bcf('0x37')](function(_0x3bee7c){_0x124ce3[_0x0bcf('0x53')]=_0x3bee7c;return _0x124ce3;});}})[_0x0bcf('0x37')](respondWithFilteredResult(_0x187c93,_0x5b72a8))[_0x0bcf('0x29')](handleError(_0x187c93,null));};exports[_0x0bcf('0x6b')]=function(_0x5eb247,_0x4008a8,_0x301dc1){return db[_0x0bcf('0x3d')]['find']({'where':{'id':_0x5eb247[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x4008a8,null))[_0x0bcf('0x37')](function(_0x336b66){if(_0x336b66){return _0x336b66[_0x0bcf('0x6b')](_0x5eb247['query'][_0x0bcf('0x6c')]);}})[_0x0bcf('0x37')](respondWithStatusCode(_0x4008a8,null))['catch'](handleError(_0x4008a8,null));};exports[_0x0bcf('0x6d')]=function(_0x51622e,_0x4dad80,_0x2a4448){if(_0x51622e[_0x0bcf('0x58')]['id']){delete _0x51622e[_0x0bcf('0x58')]['id'];}return db[_0x0bcf('0x3d')][_0x0bcf('0x56')]({'where':{'id':_0x51622e[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x4dad80,null))[_0x0bcf('0x37')](function(_0x20b360){if(_0x20b360){_0x51622e[_0x0bcf('0x58')][_0x0bcf('0x67')]=_0x20b360['id'];return db[_0x0bcf('0x6e')][_0x0bcf('0x57')](_0x51622e[_0x0bcf('0x58')]);}})[_0x0bcf('0x37')](respondWithResult(_0x4dad80,null))[_0x0bcf('0x29')](handleError(_0x4dad80,null));};exports[_0x0bcf('0x6f')]=function(_0x379f13,_0x2fefab,_0x5b6155){var _0x19240b={'raw':![],'where':{}};var _0x46d3e8={};var _0x338b65={'count':0x0,'rows':[]};return db[_0x0bcf('0x3d')]['findOne']({'where':{'id':_0x379f13[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x2fefab,null))['then'](function(_0x349b5e){if(_0x349b5e){_0x46d3e8[_0x0bcf('0x42')]=_[_0x0bcf('0x43')](db[_0x0bcf('0x6e')]['rawAttributes']);_0x46d3e8[_0x0bcf('0x44')]=_[_0x0bcf('0x43')](_0x379f13[_0x0bcf('0x44')]);_0x46d3e8[_0x0bcf('0x4c')]=_[_0x0bcf('0x45')](_0x46d3e8[_0x0bcf('0x42')],_0x46d3e8['query']);_0x19240b[_0x0bcf('0x46')]=_[_0x0bcf('0x45')](_0x46d3e8['model'],qs[_0x0bcf('0x47')](_0x379f13[_0x0bcf('0x44')][_0x0bcf('0x47')]));_0x19240b['attributes']=_0x19240b['attributes'][_0x0bcf('0x48')]?_0x19240b[_0x0bcf('0x46')]:_0x46d3e8[_0x0bcf('0x42')];if(!_0x379f13['query'][_0x0bcf('0x49')](_0x0bcf('0x65'))){_0x19240b[_0x0bcf('0x2f')]=qs[_0x0bcf('0x2f')](_0x379f13['query'][_0x0bcf('0x2f')]);_0x19240b[_0x0bcf('0x2c')]=qs[_0x0bcf('0x2c')](_0x379f13[_0x0bcf('0x44')][_0x0bcf('0x2c')]);}_0x19240b[_0x0bcf('0x66')]=qs[_0x0bcf('0x4a')](_0x379f13[_0x0bcf('0x44')][_0x0bcf('0x4a')]);_0x19240b['where']=qs[_0x0bcf('0x4c')](_['pick'](_0x379f13['query'],_0x46d3e8[_0x0bcf('0x4c')]));_0x19240b['where']['WhatsappAccountId']=_0x349b5e['id'];if(_0x379f13[_0x0bcf('0x44')][_0x0bcf('0x50')]){_0x19240b[_0x0bcf('0x4b')]=_[_0x0bcf('0x4e')](_0x19240b[_0x0bcf('0x4b')],{'$or':_[_0x0bcf('0x3c')](_0x19240b[_0x0bcf('0x46')],function(_0xa5fa72){var _0x53b876={};_0x53b876[_0xa5fa72]={'$like':'%'+_0x379f13[_0x0bcf('0x44')][_0x0bcf('0x50')]+'%'};return _0x53b876;})});}_0x19240b=_[_0x0bcf('0x4e')]({},_0x19240b,_0x379f13[_0x0bcf('0x51')]);return db[_0x0bcf('0x6e')][_0x0bcf('0x2e')]({'where':_0x19240b[_0x0bcf('0x4b')]})[_0x0bcf('0x37')](function(_0x2f5f04){_0x338b65[_0x0bcf('0x2e')]=_0x2f5f04;if(_0x379f13[_0x0bcf('0x44')][_0x0bcf('0x69')]){_0x19240b['include']=[{'all':!![]}];}return db[_0x0bcf('0x6e')][_0x0bcf('0x6a')](_0x19240b);})[_0x0bcf('0x37')](function(_0x32da3c){_0x338b65[_0x0bcf('0x53')]=_0x32da3c;return _0x338b65;});}})[_0x0bcf('0x37')](respondWithFilteredResult(_0x2fefab,_0x19240b))[_0x0bcf('0x29')](handleError(_0x2fefab,null));};exports[_0x0bcf('0x70')]=function(_0x561869,_0x5544c9,_0x25d172){return db[_0x0bcf('0x3d')][_0x0bcf('0x56')]({'where':{'id':_0x561869[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x5544c9,null))[_0x0bcf('0x37')](function(_0x286206){if(_0x286206){return _0x286206['removeAnswers'](_0x561869['query'][_0x0bcf('0x6c')]);}})['then'](respondWithStatusCode(_0x5544c9,null))[_0x0bcf('0x29')](handleError(_0x5544c9,null));};exports[_0x0bcf('0x71')]=function(_0x5e6fdc,_0x78cbee,_0x16527b){return db[_0x0bcf('0x3d')][_0x0bcf('0x56')]({'where':{'id':_0x5e6fdc[_0x0bcf('0x55')]['id']}})['then'](handleEntityNotFound(_0x78cbee,null))[_0x0bcf('0x37')](function(_0x1c35f5){if(_0x1c35f5){return _0x1c35f5['addAgents'](_0x5e6fdc[_0x0bcf('0x58')][_0x0bcf('0x6c')],_[_0x0bcf('0x72')](_0x5e6fdc[_0x0bcf('0x58')],[_0x0bcf('0x6c'),'id'])||{})[_0x0bcf('0x73')](function(_0x2918cd){for(var _0x282c0c=0x0;_0x282c0c<_0x5e6fdc[_0x0bcf('0x58')][_0x0bcf('0x6c')][_0x0bcf('0x48')];_0x282c0c+=0x1){socket[_0x0bcf('0x74')]('userWhatsappAccount:save',{'UserId':Number(_0x5e6fdc[_0x0bcf('0x58')][_0x0bcf('0x6c')][_0x282c0c]),'WhatsappAccountId':Number(_0x5e6fdc[_0x0bcf('0x55')]['id'])});}return _0x2918cd;});}})[_0x0bcf('0x37')](respondWithResult(_0x78cbee,null))[_0x0bcf('0x29')](handleError(_0x78cbee,null));};exports[_0x0bcf('0x75')]=function(_0x5b0829,_0x38d45d,_0x2cd774){return db[_0x0bcf('0x3d')][_0x0bcf('0x56')]({'where':{'id':_0x5b0829['params']['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x38d45d,null))[_0x0bcf('0x37')](function(_0x1ef8b9){if(_0x1ef8b9){return _0x1ef8b9[_0x0bcf('0x75')](_0x5b0829[_0x0bcf('0x44')]['ids'])[_0x0bcf('0x37')](function(){if(_['isArray'](_0x5b0829[_0x0bcf('0x44')][_0x0bcf('0x6c')])){for(var _0x43d7b4=0x0;_0x43d7b4<_0x5b0829[_0x0bcf('0x44')]['ids'][_0x0bcf('0x48')];_0x43d7b4+=0x1){socket['emit'](_0x0bcf('0x76'),{'UserId':Number(_0x5b0829[_0x0bcf('0x44')][_0x0bcf('0x6c')][_0x43d7b4]),'WhatsappAccountId':Number(_0x5b0829[_0x0bcf('0x55')]['id'])});}}else{socket['emit'](_0x0bcf('0x76'),{'UserId':Number(_0x5b0829[_0x0bcf('0x44')][_0x0bcf('0x6c')]),'WhatsappAccountId':Number(_0x5b0829[_0x0bcf('0x55')]['id'])});}});}})[_0x0bcf('0x37')](respondWithStatusCode(_0x38d45d,null))[_0x0bcf('0x29')](handleError(_0x38d45d,null));};exports[_0x0bcf('0x77')]=function(_0x2959f2,_0x4a56a2,_0x349243){var _0x40905d={};var _0x4f6732={};var _0xb23e3;var _0x3940fd;return db[_0x0bcf('0x3d')][_0x0bcf('0x64')]({'where':{'id':_0x2959f2[_0x0bcf('0x55')]['id']}})[_0x0bcf('0x37')](handleEntityNotFound(_0x4a56a2,null))['then'](function(_0x15a5db){if(_0x15a5db){_0xb23e3=_0x15a5db;_0x4f6732[_0x0bcf('0x42')]=_[_0x0bcf('0x43')](db[_0x0bcf('0x78')]['rawAttributes']);_0x4f6732[_0x0bcf('0x44')]=_[_0x0bcf('0x43')](_0x2959f2[_0x0bcf('0x44')]);_0x4f6732[_0x0bcf('0x4c')]=_[_0x0bcf('0x45')](_0x4f6732[_0x0bcf('0x42')],_0x4f6732[_0x0bcf('0x44')]);_0x40905d[_0x0bcf('0x46')]=_[_0x0bcf('0x45')](_0x4f6732['model'],qs[_0x0bcf('0x47')](_0x2959f2[_0x0bcf('0x44')][_0x0bcf('0x47')]));_0x40905d[_0x0bcf('0x46')]=_0x40905d[_0x0bcf('0x46')]['length']?_0x40905d[_0x0bcf('0x46')]:_0x4f6732[_0x0bcf('0x42')];_0x40905d[_0x0bcf('0x66')]=qs[_0x0bcf('0x4a')](_0x2959f2[_0x0bcf('0x44')][_0x0bcf('0x4a')]);_0x40905d['where']=qs[_0x0bcf('0x4c')](_[_0x0bcf('0x4d')](_0x2959f2['query'],_0x4f6732[_0x0bcf('0x4c')]));if(_0x2959f2[_0x0bcf('0x44')][_0x0bcf('0x50')]){_0x40905d['where']=_[_0x0bcf('0x4e')](_0x40905d['where'],{'$or':_[_0x0bcf('0x3c')](_0x40905d[_0x0bcf('0x46')],function(_0x3c731f){var _0x459f15={};_0x459f15[_0x3c731f]={'$like':'%'+_0x2959f2[_0x0bcf('0x44')][_0x0bcf('0x50')]+'%'};return _0x459f15;})});}_0x40905d=_[_0x0bcf('0x4e')]({},_0x40905d,_0x2959f2[_0x0bcf('0x51')]);return _0xb23e3[_0x0bcf('0x77')](_0x40905d);}})['then'](function(_0x18987c){if(_0x18987c){_0x3940fd=_0x18987c['length'];if(!_0x2959f2[_0x0bcf('0x44')][_0x0bcf('0x49')]('nolimit')){_0x40905d[_0x0bcf('0x2f')]=qs[_0x0bcf('0x2f')](_0x2959f2['query'][_0x0bcf('0x2f')]);_0x40905d[_0x0bcf('0x2c')]=qs[_0x0bcf('0x2c')](_0x2959f2[_0x0bcf('0x44')][_0x0bcf('0x2c')]);}return _0xb23e3['getAgents'](_0x40905d);}})['then'](function(_0x44f674){if(_0x44f674){return _0x44f674?{'count':_0x3940fd,'rows':_0x44f674}:null;}})['then'](respondWithResult(_0x4a56a2,null))['catch'](handleError(_0x4a56a2,null));};exports[_0x0bcf('0x79')]=function(_0x39bbc4,_0x3e10cd){var _0x2b7ace=_0x39bbc4['params']['id'];var _0x552f1c=_0x39bbc4[_0x0bcf('0x58')];var _0x2033c3=0xc8;var _0x156015=null;return db[_0x0bcf('0x7a')][_0x0bcf('0x7b')]({'isolationLevel':db[_0x0bcf('0x7a')]['Transaction']['ISOLATION_LEVELS'][_0x0bcf('0x7c')]},function(_0x3d5a28){return db[_0x0bcf('0x3d')][_0x0bcf('0x64')]({'where':{'id':_0x2b7ace},'transaction':_0x3d5a28})[_0x0bcf('0x37')](function(_0x179e9f){if(_0x179e9f){return db[_0x0bcf('0x7d')][_0x0bcf('0x61')]({'where':{'WhatsappAccountId':_0x2b7ace},'transaction':_0x3d5a28})[_0x0bcf('0x37')](function(){var _0xd3f708=_[_0x0bcf('0x3c')](_0x552f1c,function(_0x38c810){_0x38c810['WhatsappAccountId']=_0x2b7ace;return _0x38c810;});return db[_0x0bcf('0x7d')][_0x0bcf('0x7e')](_0xd3f708,{'transaction':_0x3d5a28});});}else{_0x2033c3=0x194;_0x156015=[];}});})[_0x0bcf('0x37')](function(){if(_0x2033c3!==0x194){return db[_0x0bcf('0x7d')][_0x0bcf('0x7f')]({'where':{'WhatsappAccountId':_0x2b7ace},'order':_0x0bcf('0x80')})['then'](function(_0x124b75){_0x156015=_0x124b75;});}})[_0x0bcf('0x29')](function(_0x536264){_0x2033c3=0x1f4;logger[_0x0bcf('0x24')](_0x536264[_0x0bcf('0x81')]);if(_0x536264[_0x0bcf('0x4f')]){delete _0x536264['name'];}_0x156015=_0x536264;})[_0x0bcf('0x82')](function(){if(_0x156015===null){_0x3e10cd[_0x0bcf('0x2a')](_0x2033c3);}else{if(_0x2033c3===0x1f4){_0x3e10cd[_0x0bcf('0x2b')](_0x2033c3)[_0x0bcf('0x39')](_0x156015);}else{_0x3e10cd[_0x0bcf('0x2b')](_0x2033c3)[_0x0bcf('0x31')](_0x156015);}}});};exports[_0x0bcf('0x83')]=function(_0x4afe42,_0x90c72,_0x112407){var _0x4da6c5={};var _0x283a7c={};var _0x142a1a;var _0xc167b2;return db[_0x0bcf('0x3d')][_0x0bcf('0x64')]({'where':{'id':_0x4afe42[_0x0bcf('0x55')]['id']}})['then'](handleEntityNotFound(_0x90c72,null))[_0x0bcf('0x37')](function(_0x7b4717){if(_0x7b4717){_0x142a1a=_0x7b4717;_0x283a7c[_0x0bcf('0x42')]=_[_0x0bcf('0x43')](db['WhatsappApplication']['rawAttributes']);_0x283a7c[_0x0bcf('0x44')]=_['keys'](_0x4afe42[_0x0bcf('0x44')]);_0x283a7c['filters']=_[_0x0bcf('0x45')](_0x283a7c[_0x0bcf('0x42')],_0x283a7c[_0x0bcf('0x44')]);_0x4da6c5[_0x0bcf('0x46')]=_[_0x0bcf('0x45')](_0x283a7c[_0x0bcf('0x42')],qs[_0x0bcf('0x47')](_0x4afe42[_0x0bcf('0x44')][_0x0bcf('0x47')]));_0x4da6c5[_0x0bcf('0x46')]=_0x4da6c5[_0x0bcf('0x46')][_0x0bcf('0x48')]?_0x4da6c5[_0x0bcf('0x46')]:_0x283a7c['model'];_0x4da6c5[_0x0bcf('0x66')]=qs[_0x0bcf('0x4a')](_0x4afe42[_0x0bcf('0x44')][_0x0bcf('0x4a')]);_0x4da6c5[_0x0bcf('0x4b')]=qs['filters'](_['pick'](_0x4afe42[_0x0bcf('0x44')],_0x283a7c['filters']));if(_0x4afe42['query'][_0x0bcf('0x50')]){_0x4da6c5['where']=_[_0x0bcf('0x4e')](_0x4da6c5[_0x0bcf('0x4b')],{'$or':_['map'](_0x4da6c5[_0x0bcf('0x46')],function(_0x52ef10){var _0x577de7={};_0x577de7[_0x52ef10]={'$like':'%'+_0x4afe42[_0x0bcf('0x44')][_0x0bcf('0x50')]+'%'};return _0x577de7;})});}_0x4da6c5=_[_0x0bcf('0x4e')]({},_0x4da6c5,_0x4afe42[_0x0bcf('0x51')]);return _0x142a1a[_0x0bcf('0x83')](_0x4da6c5);}})[_0x0bcf('0x37')](function(_0x37e054){if(_0x37e054){_0xc167b2=_0x37e054[_0x0bcf('0x48')];if(!_0x4afe42[_0x0bcf('0x44')][_0x0bcf('0x49')]('nolimit')){_0x4da6c5[_0x0bcf('0x2f')]=qs[_0x0bcf('0x2f')](_0x4afe42['query'][_0x0bcf('0x2f')]);_0x4da6c5[_0x0bcf('0x2c')]=qs[_0x0bcf('0x2c')](_0x4afe42[_0x0bcf('0x44')][_0x0bcf('0x2c')]);}return _0x142a1a[_0x0bcf('0x83')](_0x4da6c5);}})['then'](function(_0x10aceb){if(_0x10aceb){return _0x10aceb?{'count':_0xc167b2,'rows':_0x10aceb}:null;}})[_0x0bcf('0x37')](respondWithResult(_0x90c72,null))[_0x0bcf('0x29')](handleError(_0x90c72,null));};exports[_0x0bcf('0x84')]=function(_0x160793,_0x428eff,_0x16b478){var _0x152f6f={'channel':_0x0bcf('0x85')};var _0x50bb27=[];var _0x58a21c=[];var _0x265be0={};return db['WhatsappAccount'][_0x0bcf('0x56')]({'where':{'id':_0x160793[_0x0bcf('0x55')]['id']},'include':[{'model':db[_0x0bcf('0x7d')],'as':_0x0bcf('0x86')}]})[_0x0bcf('0x37')](handleEntityNotFound(_0x428eff,null))['then'](function(_0x49b24d){_0x152f6f[_0x0bcf('0x87')]=_0x49b24d;if(_0x152f6f[_0x0bcf('0x87')]&&_0x152f6f['account'][_0x0bcf('0x40')]===_0x0bcf('0x88')&&_0x160793[_0x0bcf('0x58')][_0x0bcf('0x89')]){if(_0x160793[_0x0bcf('0x58')][_0x0bcf('0x89')][_0x0bcf('0x48')]===0x0)return;if(_0x160793[_0x0bcf('0x58')][_0x0bcf('0x89')][0x0][_0x0bcf('0x8a')]!=='read')return;return db[_0x0bcf('0x8b')]['update']({'read':!![],'readAt':_0x160793[_0x0bcf('0x58')][_0x0bcf('0x89')][0x0][_0x0bcf('0x8c')]},{'where':{'messageId':_0x160793[_0x0bcf('0x58')][_0x0bcf('0x89')][0x0]['message_id']},'individualHooks':!![]})[_0x0bcf('0x37')](function(_0x4bbeae){return _0x428eff[_0x0bcf('0x2b')](0xc8)[_0x0bcf('0x31')](_0x4bbeae);});}_0x152f6f[_0x0bcf('0x8d')]=_['orderBy'](_0x49b24d[_0x0bcf('0x86')],[_0x0bcf('0x80')],[_0x0bcf('0x8e')]);if(_0x152f6f[_0x0bcf('0x87')]['Applications']){delete _0x152f6f[_0x0bcf('0x87')][_0x0bcf('0x86')];}return db[_0x0bcf('0x8f')][_0x0bcf('0x62')]()[_0x0bcf('0x37')](function(_0x65a958){if(!_0x65a958){throw new db[(_0x0bcf('0x90'))][(_0x0bcf('0x91'))](_0x0bcf('0x92'));}_0x50bb27=_[_0x0bcf('0x93')](_[_0x0bcf('0x43')](_0x65a958),[_0x0bcf('0x94'),_0x0bcf('0x95')]);_0x58a21c=_[_0x0bcf('0x93')](_[_0x0bcf('0x43')](_0x65a958),['createdAt',_0x0bcf('0x95'),'CompanyId','ListId']);_0x152f6f['body']={'mapKey':_0x0bcf('0x96')};if(_0x152f6f['account']&&_0x152f6f[_0x0bcf('0x87')][_0x0bcf('0x40')]===_0x0bcf('0x97')){_0x152f6f[_0x0bcf('0x58')]['from']=_0x160793[_0x0bcf('0x58')]['From'][_0x0bcf('0x98')]('whatsapp:','');_0x152f6f['body'][_0x0bcf('0x58')]=_0x160793[_0x0bcf('0x58')][_0x0bcf('0x99')];_0x152f6f['body'][_0x0bcf('0x9a')]=_0x160793['body'][_0x0bcf('0x9b')];}if(_0x152f6f[_0x0bcf('0x87')]&&_0x152f6f[_0x0bcf('0x87')][_0x0bcf('0x40')]==='sinch'){_0x152f6f[_0x0bcf('0x58')]['from']=_0x160793[_0x0bcf('0x58')][_0x0bcf('0x9c')][0x0][_0x0bcf('0x9d')];_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x58')]=_0x160793[_0x0bcf('0x58')]['notifications'][0x0][_0x0bcf('0x26')][_0x0bcf('0x58')];_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x9a')]=_0x160793[_0x0bcf('0x58')][_0x0bcf('0x9c')][0x0][_0x0bcf('0x9e')];}if(_0x152f6f[_0x0bcf('0x58')]['id']){delete _0x152f6f[_0x0bcf('0x58')]['id'];}if(_['isNil'](_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x9d')])){throw new db[(_0x0bcf('0x90'))]['ValidationError'](_0x0bcf('0x9f'));}if(_[_0x0bcf('0xa0')](_0x152f6f[_0x0bcf('0x58')]['body'])||_0x152f6f['body'][_0x0bcf('0x58')]===''){throw new db['Sequelize'][(_0x0bcf('0x91'))](_0x0bcf('0xa1'));}if(_['isNil'](_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0xa2')])){throw new db[(_0x0bcf('0x90'))][(_0x0bcf('0x91'))](_0x0bcf('0xa3')+_0x58a21c);}if(!_[_0x0bcf('0xa4')](_0x58a21c,_0x152f6f['body'][_0x0bcf('0xa2')])){throw new db['Sequelize'][(_0x0bcf('0x91'))](_0x0bcf('0xa5')+_0x58a21c);}_0x265be0[_0x152f6f[_0x0bcf('0x58')]['mapKey']]=_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x9d')];return db[_0x0bcf('0xa6')][_0x0bcf('0x56')]({'where':{'id':_0x152f6f['account'][_0x0bcf('0xa7')]},'include':[{'model':db['CmContact'],'as':_0x0bcf('0xa8'),'where':_0x265be0,'limit':0x1,'order':[[_0x0bcf('0x95'),_0x0bcf('0xa9')]]}]});})[_0x0bcf('0x37')](handleEntityNotFound(_0x428eff,null))['then'](function(_0x4a8cff){if(_0x4a8cff){_0x152f6f[_0x0bcf('0xaa')]=_['omit'](_0x4a8cff,[_0x0bcf('0xa8')]);if(_0x4a8cff[_0x0bcf('0xa8')][_0x0bcf('0x48')]){return _0x4a8cff[_0x0bcf('0xa8')][0x0];}var _0x183952=_[_0x0bcf('0x1a')](_0x152f6f[_0x0bcf('0x58')],{'firstName':_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x9d')],'ListId':_0x4a8cff['id']});_0x183952[_0x152f6f['body']['mapKey']]=_0x152f6f[_0x0bcf('0x58')]['from'];return db['CmContact'][_0x0bcf('0x57')](_0x183952,{'fields':_0x50bb27,'raw':!![]});}})[_0x0bcf('0x37')](handleEntityNotFound(_0x428eff,null))['then'](function(_0xb213e6){if(_0xb213e6){_0x152f6f[_0x0bcf('0xab')]=_0xb213e6;var _0x18f67c={'ContactId':_0xb213e6['id'],'phone':_0x152f6f[_0x0bcf('0x58')]['from'],'WhatsappAccountId':_0x160793['params']['id']};var _0x4fd532={'ContactId':_0xb213e6['id'],'WhatsappAccountId':_0x160793[_0x0bcf('0x55')]['id'],'closed':![]};return db[_0x0bcf('0xac')][_0x0bcf('0x56')]({'where':_0x4fd532})[_0x0bcf('0x37')](function(_0x57e6ab){if(_0x57e6ab){return[_0x57e6ab,![]];}return db[_0x0bcf('0xac')][_0x0bcf('0x57')](_0x18f67c)[_0x0bcf('0x37')](function(_0x27f597){return[_0x27f597,!![]];});});}})[_0x0bcf('0x73')](function(_0x2cccb6,_0x2e8a3f){_0x152f6f['interaction']=_0x2cccb6[_0x0bcf('0x35')]({'plain':!![]});_0x152f6f[_0x0bcf('0xad')][_0x0bcf('0xae')]=![];if(_0x2e8a3f){if(_0x152f6f[_0x0bcf('0x87')]['autoclose']){_0x152f6f[_0x0bcf('0x8d')][_0x0bcf('0xaf')]({'id':0x0,'priority':_0x152f6f[_0x0bcf('0x8d')][_0x0bcf('0x48')]+0x1,'app':'close','appdata':_0x0bcf('0xb0'),'interval':_0x0bcf('0xb1')});}_0x152f6f[_0x0bcf('0xad')][_0x0bcf('0xae')]=!![];}return db['WhatsappMessage'][_0x0bcf('0x57')]({'phone':_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x9d')],'messageId':_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x9a')],'body':_0x152f6f[_0x0bcf('0x58')][_0x0bcf('0x58')],'WhatsappAccountId':_0x160793['params']['id'],'WhatsappInteractionId':_0x2cccb6['id'],'direction':'in','ContactId':_0x2cccb6[_0x0bcf('0xb2')],'AttachmentId':_0x152f6f['body']['AttachmentId']});})[_0x0bcf('0x37')](function(_0x592a26){_0x152f6f[_0x0bcf('0x26')]=_0x592a26;if(_0x152f6f[_0x0bcf('0xad')][_0x0bcf('0xb3')]){return db['User'][_0x0bcf('0x56')]({'attributes':['id',_0x0bcf('0x4f')],'where':{'id':_0x152f6f[_0x0bcf('0xad')][_0x0bcf('0xb3')]}})[_0x0bcf('0x37')](function(_0x32700e){if(_0x32700e){_0x152f6f[_0x0bcf('0x8d')][_0x0bcf('0xb4')]({'id':0x0,'priority':0x0,'app':_0x0bcf('0xb5'),'appdata':_0x32700e[_0x0bcf('0x4f')]+','+(_0x152f6f['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0bcf('0xb1')});}return respondWithRpcPromise(_0x0bcf('0xb6'),_0x0bcf('0xb7'),_0x152f6f);});}return respondWithRpcPromise(_0x0bcf('0xb6'),_0x0bcf('0xb7'),_0x152f6f);})[_0x0bcf('0x37')](function(_0x2e23ae){if(_0x2e23ae){var _0xa9b777=0xc8;var _0x177c2c=_0x0bcf('0xb8');logger['info'](_0x0bcf('0x22'),_0x177c2c,_0xa9b777,_0x0bcf('0xb9'));logger['debug'](_0x0bcf('0xba'),_0x177c2c,_0xa9b777,_0x0bcf('0xb9'),JSON['stringify'](_0x2e23ae));if(_0x152f6f[_0x0bcf('0x87')][_0x0bcf('0x40')]===_0x0bcf('0x97')){return _0x428eff[_0x0bcf('0x2b')](_0xa9b777)[_0x0bcf('0x30')](_0x0bcf('0xbb'),_0x0bcf('0xbc'))[_0x0bcf('0x39')](_0x0bcf('0xbd'));}else{return _0x428eff[_0x0bcf('0x2b')](_0xa9b777)['json'](_0x2e23ae);}}});})[_0x0bcf('0x29')](handleError(_0x428eff,null));};exports[_0x0bcf('0x39')]=function(_0xe6b97,_0x4450b2,_0x4c70cc){var _0x2da725,_0x1146a4,_0x16bc94;if(_[_0x0bcf('0xa0')](_0xe6b97[_0x0bcf('0x58')][_0x0bcf('0x58')])||_0xe6b97[_0x0bcf('0x58')][_0x0bcf('0x58')]===''){throw new db[(_0x0bcf('0x90'))][(_0x0bcf('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0bcf('0xa0')](_0xe6b97[_0x0bcf('0x58')]['to'])){throw new db[(_0x0bcf('0x90'))][(_0x0bcf('0x91'))](_0x0bcf('0xbe'));}_0x2da725=_0xe6b97[_0x0bcf('0x58')]['to'];return db[_0x0bcf('0x3d')]['find']({'where':{'id':_0xe6b97[_0x0bcf('0x55')]['id']},'include':[{'model':db[_0x0bcf('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x2da725},'limit':0x1,'order':[['updatedAt',_0x0bcf('0xa9')]]}]}]})[_0x0bcf('0x37')](handleEntityNotFound(_0x4450b2,null))[_0x0bcf('0x37')](function(_0x35e00a){if(_0x35e00a&&_0x35e00a[_0x0bcf('0xbf')]){_0x1146a4=_0x35e00a[_0x0bcf('0x35')]({'plain':!![]});if(_0x1146a4[_0x0bcf('0xbf')]&&_0x1146a4[_0x0bcf('0xbf')][_0x0bcf('0xa8')]['length']){return _0x1146a4[_0x0bcf('0xbf')][_0x0bcf('0xa8')][0x0];}return db[_0x0bcf('0x8f')][_0x0bcf('0x57')](_['defaults'](_0xe6b97[_0x0bcf('0x58')],{'firstName':_0x2da725,'mobile':_0x2da725,'phone':_0x2da725,'ListId':_0x1146a4[_0x0bcf('0xa7')]}));}})[_0x0bcf('0x37')](handleEntityNotFound(_0x4450b2,null))['then'](function(_0x1c4e38){if(_0x1c4e38){_0x16bc94=_0x1c4e38;return db[_0x0bcf('0xac')][_0x0bcf('0x56')]({'where':{'ContactId':_0x16bc94['id'],'closed':![],'WhatsappAccountId':_0x1146a4['id']}})[_0x0bcf('0x37')](function(_0x4541d8){if(_0x4541d8){return[_0x4541d8,![]];}return db[_0x0bcf('0xac')][_0x0bcf('0x57')]({'UserId':_0xe6b97[_0x0bcf('0x59')]['id'],'ContactId':_0x16bc94['id'],'WhatsappAccountId':_0x1146a4['id'],'phone':_0x2da725,'firstMsgDirection':'out','Messages':[_[_0x0bcf('0x4e')](_0xe6b97[_0x0bcf('0x58')],{'read':![],'body':_0xe6b97[_0x0bcf('0x58')][_0x0bcf('0x58')],'phone':_0x2da725,'WhatsappAccountId':_0x1146a4['id'],'UserId':_0xe6b97['user']['id'],'ContactId':_0x16bc94['id']})]},{'include':[{'model':db[_0x0bcf('0x8b')],'as':_0x0bcf('0xc0')}]})[_0x0bcf('0x37')](function(_0x46a02e){return[_0x46a02e,!![]];});});}})['spread'](function(_0x2ed3fa,_0x2af43d){if(_0x2af43d){return _0x2ed3fa;}return db[_0x0bcf('0x8b')]['create'](_[_0x0bcf('0x4e')](_0xe6b97['body'],{'read':![],'body':_0xe6b97['body'][_0x0bcf('0x58')],'phone':_0x2da725,'WhatsappAccountId':_0x1146a4['id'],'WhatsappInteractionId':_0x2ed3fa['id'],'UserId':_0xe6b97[_0x0bcf('0x59')]['id'],'ContactId':_0x16bc94['id']}))[_0x0bcf('0x37')](function(_0x5396c8){_0x2ed3fa[_0x0bcf('0xc1')]['Messages']=[];_0x2ed3fa[_0x0bcf('0xc1')][_0x0bcf('0xc0')][_0x0bcf('0xaf')](_0x5396c8[_0x0bcf('0xc1')]);return _0x2ed3fa;});})[_0x0bcf('0x37')](respondWithResult(_0x4450b2,null))[_0x0bcf('0x29')](handleError(_0x4450b2,null));};
\ No newline at end of file
+var _0x005e=['WhatsappAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','include','findAll','rows','catch','show','params','Pause','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','findOne','Disposition','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','ids','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','Applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','message_id','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','WhatsappInteraction','interaction','created','autoclose','ContactId','AttachmentId','User','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','info','entity\x20found','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','CmList','List','out','Messages','dataValues','push','eml-format','rimraf','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0x005e,0x8e));var _0xe005=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x005e[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0xe005('0x0'));var rimraf=require(_0xe005('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe005('0x2'));var Mustache=require('mustache');var util=require(_0xe005('0x3'));var path=require(_0xe005('0x4'));var sox=require(_0xe005('0x5'));var csv=require(_0xe005('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe005('0x7'));var _=require(_0xe005('0x8'));var squel=require(_0xe005('0x9'));var crypto=require(_0xe005('0xa'));var jsforce=require(_0xe005('0xb'));var deskjs=require(_0xe005('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe005('0xd'));var Redis=require(_0xe005('0xe'));var authService=require(_0xe005('0xf'));var qs=require(_0xe005('0x10'));var as=require(_0xe005('0x11'));var hardwareService=require(_0xe005('0x12'));var logger=require(_0xe005('0x13'))(_0xe005('0x14'));var utils=require(_0xe005('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe005('0x16'));var db=require(_0xe005('0x17'))['db'];config[_0xe005('0x18')]=_[_0xe005('0x19')](config[_0xe005('0x18')],{'host':_0xe005('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe005('0x1b'))[_0xe005('0x1c')](socket);var jayson=require(_0xe005('0x1d'));var client=jayson[_0xe005('0x1e')][_0xe005('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x45bb13,_0x470e8d,_0x2bb828,_0x1824fe){return new BPromise(function(_0x468234,_0x1e5dae){var _0xe96068=_0x1824fe||client;return _0xe96068[_0xe005('0x20')](_0x45bb13,_0x2bb828)[_0xe005('0x21')](function(_0x1d4e6a){logger['info'](_0xe005('0x22'),_0x470e8d,_0xe005('0x23'));logger[_0xe005('0x24')](_0xe005('0x25'),_0x470e8d,_0xe005('0x23'),JSON[_0xe005('0x26')](_0x1d4e6a));if(_0x1d4e6a[_0xe005('0x27')]){if(_0x1d4e6a['error']['code']===0x1f4){logger[_0xe005('0x27')](_0xe005('0x22'),_0x470e8d,_0x1d4e6a[_0xe005('0x27')][_0xe005('0x28')]);return _0x1e5dae(_0x1d4e6a[_0xe005('0x27')][_0xe005('0x28')]);}logger[_0xe005('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x470e8d,_0x1d4e6a[_0xe005('0x27')][_0xe005('0x28')]);return _0x468234(_0x1d4e6a[_0xe005('0x27')][_0xe005('0x28')]);}else{logger['info'](_0xe005('0x22'),_0x470e8d,'request\x20sent');_0x468234(_0x1d4e6a[_0xe005('0x29')][_0xe005('0x28')]);}})['catch'](function(_0x54dd9a){logger[_0xe005('0x27')](_0xe005('0x22'),_0x470e8d,_0x54dd9a);_0x1e5dae(_0x54dd9a);});});}function respondWithStatusCode(_0x4123d1,_0x258cee){_0x258cee=_0x258cee||0xcc;return function(_0x13458c){if(_0x13458c){return _0x4123d1[_0xe005('0x2a')](_0x258cee);}return _0x4123d1[_0xe005('0x2b')](_0x258cee)['end']();};}function respondWithResult(_0x2ee803,_0x254aa1){_0x254aa1=_0x254aa1||0xc8;return function(_0x2d664e){if(_0x2d664e){return _0x2ee803[_0xe005('0x2b')](_0x254aa1)[_0xe005('0x2c')](_0x2d664e);}};}function respondWithFilteredResult(_0x232bea,_0x5700c4){return function(_0x23a73d){if(_0x23a73d){var _0x5435a8=typeof _0x5700c4[_0xe005('0x2d')]===_0xe005('0x2e')&&typeof _0x5700c4[_0xe005('0x2f')]===_0xe005('0x2e');var _0x21eb7e=_0x23a73d[_0xe005('0x30')];var _0x3e88e4=_0x5435a8?0x0:_0x5700c4[_0xe005('0x2d')];var _0x1426ab=_0x5435a8?_0x23a73d[_0xe005('0x30')]:_0x5700c4[_0xe005('0x2d')]+_0x5700c4['limit'];var _0x45d22f;if(_0x1426ab>=_0x21eb7e){_0x1426ab=_0x21eb7e;_0x45d22f=0xc8;}else{_0x45d22f=0xce;}_0x232bea['status'](_0x45d22f);return _0x232bea[_0xe005('0x31')](_0xe005('0x32'),_0x3e88e4+'-'+_0x1426ab+'/'+_0x21eb7e)[_0xe005('0x2c')](_0x23a73d);}return null;};}function patchUpdates(_0x343a5b){return function(_0x2c290a){try{jsonpatch[_0xe005('0x33')](_0x2c290a,_0x343a5b,!![]);}catch(_0x3105c1){return BPromise['reject'](_0x3105c1);}return _0x2c290a['save']();};}function saveUpdates(_0xdab1b1,_0x3a6f3b){return function(_0x205122){if(_0x205122){return _0x205122[_0xe005('0x34')](_0xdab1b1)[_0xe005('0x21')](function(_0x3b5059){return _0x3b5059;});}return null;};}function removeEntity(_0x326522,_0x25f014){return function(_0x4b6759){if(_0x4b6759){return _0x4b6759[_0xe005('0x35')]()['then'](function(){var _0x2534c4=_0x4b6759[_0xe005('0x36')]({'plain':!![]});var _0xff3e42=_0xe005('0x37');return db[_0xe005('0x38')][_0xe005('0x35')]({'where':{'type':_0xff3e42,'resourceId':_0x2534c4['id']}})[_0xe005('0x21')](function(){return _0x4b6759;});})[_0xe005('0x21')](function(){_0x326522[_0xe005('0x2b')](0xcc)[_0xe005('0x39')]();});}};}function handleEntityNotFound(_0x455b92,_0x2ba2cb){return function(_0x5e87fb){if(!_0x5e87fb){_0x455b92[_0xe005('0x2a')](0x194);}return _0x5e87fb;};}function handleError(_0x443aae,_0x48a6c2){_0x48a6c2=_0x48a6c2||0x1f4;return function(_0x1c756d){logger[_0xe005('0x27')](_0x1c756d[_0xe005('0x3a')]);if(_0x1c756d[_0xe005('0x3b')]){delete _0x1c756d[_0xe005('0x3b')];}_0x443aae[_0xe005('0x2b')](_0x48a6c2)[_0xe005('0x3c')](_0x1c756d);};}exports[_0xe005('0x3d')]=function(_0x2df743,_0x3b2c12){var _0x1be674={'include':[{'model':db['Pause'],'as':_0xe005('0x3e')}]},_0x598a02={},_0x3f1644={'count':0x0,'rows':[]};var _0x32dcec=_[_0xe005('0x3f')](db[_0xe005('0x40')][_0xe005('0x41')],function(_0x20f733){return{'name':_0x20f733[_0xe005('0x42')],'type':_0x20f733['type']['key']};});_0x598a02[_0xe005('0x43')]=_[_0xe005('0x3f')](_0x32dcec,_0xe005('0x3b'));_0x598a02[_0xe005('0x44')]=_[_0xe005('0x45')](_0x2df743[_0xe005('0x44')]);_0x598a02['filters']=_[_0xe005('0x46')](_0x598a02[_0xe005('0x43')],_0x598a02['query']);_0x1be674[_0xe005('0x47')]=_[_0xe005('0x46')](_0x598a02[_0xe005('0x43')],qs[_0xe005('0x48')](_0x2df743[_0xe005('0x44')][_0xe005('0x48')]));_0x1be674[_0xe005('0x47')]=_0x1be674[_0xe005('0x47')]['length']?_0x1be674['attributes']:_0x598a02[_0xe005('0x43')];if(!_0x2df743[_0xe005('0x44')][_0xe005('0x49')](_0xe005('0x4a'))){_0x1be674[_0xe005('0x2f')]=qs[_0xe005('0x2f')](_0x2df743[_0xe005('0x44')]['limit']);_0x1be674[_0xe005('0x2d')]=qs[_0xe005('0x2d')](_0x2df743[_0xe005('0x44')][_0xe005('0x2d')]);}_0x1be674[_0xe005('0x4b')]=qs[_0xe005('0x4c')](_0x2df743[_0xe005('0x44')][_0xe005('0x4c')]);_0x1be674[_0xe005('0x4d')]=qs['filters'](_[_0xe005('0x4e')](_0x2df743[_0xe005('0x44')],_0x598a02[_0xe005('0x4f')]),_0x32dcec);if(_0x2df743[_0xe005('0x44')][_0xe005('0x50')]){_0x1be674[_0xe005('0x4d')]=_['merge'](_0x1be674[_0xe005('0x4d')],{'$or':_[_0xe005('0x3f')](_0x32dcec,function(_0x493aab){if(_0x493aab[_0xe005('0x51')]!==_0xe005('0x52')){var _0x219966={};_0x219966[_0x493aab[_0xe005('0x3b')]]={'$like':'%'+_0x2df743['query'][_0xe005('0x50')]+'%'};return _0x219966;}})});}_0x1be674=_['merge']({},_0x1be674,_0x2df743[_0xe005('0x53')]);var _0x54af3c={'where':_0x1be674[_0xe005('0x4d')]};return db[_0xe005('0x40')][_0xe005('0x30')](_0x54af3c)[_0xe005('0x21')](function(_0x32dc59){_0x3f1644[_0xe005('0x30')]=_0x32dc59;if(_0x2df743['query']['includeAll']){_0x1be674[_0xe005('0x54')]=[{'all':!![]}];}return db[_0xe005('0x40')][_0xe005('0x55')](_0x1be674);})[_0xe005('0x21')](function(_0x2d72ce){_0x3f1644[_0xe005('0x56')]=_0x2d72ce;return _0x3f1644;})[_0xe005('0x21')](respondWithFilteredResult(_0x3b2c12,_0x1be674))[_0xe005('0x57')](handleError(_0x3b2c12,null));};exports[_0xe005('0x58')]=function(_0x4f480b,_0x4110d9){var _0x29eb63={'raw':![],'where':{'id':_0x4f480b[_0xe005('0x59')]['id']},'include':[{'model':db[_0xe005('0x5a')],'as':_0xe005('0x3e')}]},_0x3151d7={};_0x3151d7[_0xe005('0x43')]=_[_0xe005('0x45')](db['WhatsappAccount'][_0xe005('0x41')]);_0x3151d7[_0xe005('0x44')]=_[_0xe005('0x45')](_0x4f480b[_0xe005('0x44')]);_0x3151d7[_0xe005('0x4f')]=_['intersection'](_0x3151d7[_0xe005('0x43')],_0x3151d7[_0xe005('0x44')]);_0x29eb63[_0xe005('0x47')]=_['intersection'](_0x3151d7[_0xe005('0x43')],qs['fields'](_0x4f480b['query'][_0xe005('0x48')]));_0x29eb63['attributes']=_0x29eb63[_0xe005('0x47')][_0xe005('0x5b')]?_0x29eb63[_0xe005('0x47')]:_0x3151d7['model'];if(_0x4f480b['query']['includeAll']){_0x29eb63['include']=[{'all':!![]}];}_0x29eb63=_[_0xe005('0x5c')]({},_0x29eb63,_0x4f480b[_0xe005('0x53')]);return db['WhatsappAccount'][_0xe005('0x5d')](_0x29eb63)[_0xe005('0x21')](handleEntityNotFound(_0x4110d9,null))[_0xe005('0x21')](respondWithResult(_0x4110d9,null))[_0xe005('0x57')](handleError(_0x4110d9,null));};exports[_0xe005('0x5e')]=function(_0x78aa04,_0x4b5fab){return db['WhatsappAccount'][_0xe005('0x5e')](_0x78aa04[_0xe005('0x5f')],{})[_0xe005('0x21')](function(_0x431ba5){var _0x3d34fb=_0x78aa04[_0xe005('0x60')][_0xe005('0x36')]({'plain':!![]});if(!_0x3d34fb)throw new Error(_0xe005('0x61'));if(_0x3d34fb[_0xe005('0x62')]==='user'){var _0x3fc782=_0x431ba5[_0xe005('0x36')]({'plain':!![]});var _0x41d3ae='WhatsappAccounts';return db[_0xe005('0x63')][_0xe005('0x5d')]({'where':{'name':_0x41d3ae,'userProfileId':_0x3d34fb[_0xe005('0x64')]},'raw':!![]})[_0xe005('0x21')](function(_0x342506){if(_0x342506&&_0x342506[_0xe005('0x65')]===0x0){return db[_0xe005('0x38')]['create']({'name':_0x3fc782[_0xe005('0x3b')],'resourceId':_0x3fc782['id'],'type':_0x342506[_0xe005('0x3b')],'sectionId':_0x342506['id']},{})['then'](function(){return _0x431ba5;});}else{return _0x431ba5;}})[_0xe005('0x57')](function(_0x3ed014){logger[_0xe005('0x27')](_0xe005('0x66'),_0x3ed014);throw _0x3ed014;});}return _0x431ba5;})[_0xe005('0x21')](respondWithResult(_0x4b5fab,0xc9))['catch'](handleError(_0x4b5fab,null));};exports[_0xe005('0x34')]=function(_0x1df472,_0x10ba5e){if(_0x1df472[_0xe005('0x5f')]['id']){delete _0x1df472['body']['id'];}return db[_0xe005('0x40')][_0xe005('0x5d')]({'where':{'id':_0x1df472[_0xe005('0x59')]['id']},'include':[{'model':db[_0xe005('0x5a')],'as':_0xe005('0x3e')}]})[_0xe005('0x21')](handleEntityNotFound(_0x10ba5e,null))[_0xe005('0x21')](saveUpdates(_0x1df472['body'],null))[_0xe005('0x21')](respondWithResult(_0x10ba5e,null))[_0xe005('0x57')](handleError(_0x10ba5e,null));};exports[_0xe005('0x35')]=function(_0x102a24,_0x21329b){return db[_0xe005('0x40')][_0xe005('0x5d')]({'where':{'id':_0x102a24[_0xe005('0x59')]['id']}})['then'](handleEntityNotFound(_0x21329b,null))['then'](removeEntity(_0x21329b,null))[_0xe005('0x57')](handleError(_0x21329b,null));};exports['describe']=function(_0x19e69e,_0x25068b){return db[_0xe005('0x40')][_0xe005('0x67')]()[_0xe005('0x21')](respondWithResult(_0x25068b,null))[_0xe005('0x57')](handleError(_0x25068b,null));};exports[_0xe005('0x68')]=function(_0x175917,_0xb753bc,_0x232695){if(_0x175917['body']['id']){delete _0x175917[_0xe005('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x175917[_0xe005('0x59')]['id']}})['then'](handleEntityNotFound(_0xb753bc,null))[_0xe005('0x21')](function(_0xd6964c){if(_0xd6964c){_0x175917['body'][_0xe005('0x69')]=_0xd6964c['id'];return db['Disposition'][_0xe005('0x5e')](_0x175917[_0xe005('0x5f')]);}})['then'](respondWithResult(_0xb753bc,null))['catch'](handleError(_0xb753bc,null));};exports['getDispositions']=function(_0x83a762,_0x210327,_0x3ebb95){var _0x1bc4d9={'raw':![],'where':{}};var _0x376301={};var _0x5e4082={'count':0x0,'rows':[]};return db[_0xe005('0x40')][_0xe005('0x6a')]({'where':{'id':_0x83a762[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0x210327,null))[_0xe005('0x21')](function(_0x2a5e4e){if(_0x2a5e4e){_0x376301['model']=_[_0xe005('0x45')](db[_0xe005('0x6b')][_0xe005('0x41')]);_0x376301['query']=_['keys'](_0x83a762['query']);_0x376301['filters']=_[_0xe005('0x46')](_0x376301[_0xe005('0x43')],_0x376301[_0xe005('0x44')]);_0x1bc4d9[_0xe005('0x47')]=_[_0xe005('0x46')](_0x376301['model'],qs[_0xe005('0x48')](_0x83a762['query']['fields']));_0x1bc4d9[_0xe005('0x47')]=_0x1bc4d9[_0xe005('0x47')]['length']?_0x1bc4d9[_0xe005('0x47')]:_0x376301['model'];if(!_0x83a762['query']['hasOwnProperty'](_0xe005('0x4a'))){_0x1bc4d9[_0xe005('0x2f')]=qs[_0xe005('0x2f')](_0x83a762[_0xe005('0x44')][_0xe005('0x2f')]);_0x1bc4d9[_0xe005('0x2d')]=qs['offset'](_0x83a762[_0xe005('0x44')][_0xe005('0x2d')]);}_0x1bc4d9['order']=qs[_0xe005('0x4c')](_0x83a762['query'][_0xe005('0x4c')]);_0x1bc4d9[_0xe005('0x4d')]=qs['filters'](_[_0xe005('0x4e')](_0x83a762[_0xe005('0x44')],_0x376301[_0xe005('0x4f')]));_0x1bc4d9[_0xe005('0x4d')]['WhatsappAccountId']=_0x2a5e4e['id'];if(_0x83a762['query'][_0xe005('0x50')]){_0x1bc4d9[_0xe005('0x4d')]=_[_0xe005('0x5c')](_0x1bc4d9['where'],{'$or':_['map'](_0x1bc4d9[_0xe005('0x47')],function(_0x3f93cc){var _0x2f1dc3={};_0x2f1dc3[_0x3f93cc]={'$like':'%'+_0x83a762[_0xe005('0x44')][_0xe005('0x50')]+'%'};return _0x2f1dc3;})});}_0x1bc4d9=_[_0xe005('0x5c')]({},_0x1bc4d9,_0x83a762[_0xe005('0x53')]);return db[_0xe005('0x6b')][_0xe005('0x30')]({'where':_0x1bc4d9[_0xe005('0x4d')]})['then'](function(_0x31da79){_0x5e4082['count']=_0x31da79;if(_0x83a762[_0xe005('0x44')][_0xe005('0x6c')]){_0x1bc4d9['include']=[{'all':!![]}];}return db[_0xe005('0x6b')][_0xe005('0x55')](_0x1bc4d9);})['then'](function(_0xf55feb){_0x5e4082['rows']=_0xf55feb;return _0x5e4082;});}})[_0xe005('0x21')](respondWithFilteredResult(_0x210327,_0x1bc4d9))[_0xe005('0x57')](handleError(_0x210327,null));};exports['removeDispositions']=function(_0x4160db,_0xa37381,_0x37ebd2){return db['WhatsappAccount'][_0xe005('0x5d')]({'where':{'id':_0x4160db[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0xa37381,null))[_0xe005('0x21')](function(_0x344dbb){if(_0x344dbb){return _0x344dbb[_0xe005('0x6d')](_0x4160db[_0xe005('0x44')]['ids']);}})['then'](respondWithStatusCode(_0xa37381,null))[_0xe005('0x57')](handleError(_0xa37381,null));};exports[_0xe005('0x6e')]=function(_0x29e3e1,_0x35fc81,_0x31f5ba){if(_0x29e3e1[_0xe005('0x5f')]['id']){delete _0x29e3e1['body']['id'];}return db['WhatsappAccount'][_0xe005('0x5d')]({'where':{'id':_0x29e3e1[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0x35fc81,null))[_0xe005('0x21')](function(_0x4ed733){if(_0x4ed733){_0x29e3e1['body'][_0xe005('0x69')]=_0x4ed733['id'];return db[_0xe005('0x6f')][_0xe005('0x5e')](_0x29e3e1['body']);}})[_0xe005('0x21')](respondWithResult(_0x35fc81,null))[_0xe005('0x57')](handleError(_0x35fc81,null));};exports[_0xe005('0x70')]=function(_0x529eca,_0x1365ee,_0x35916b){var _0x1e9527={'raw':![],'where':{}};var _0x10b9eb={};var _0x31faf4={'count':0x0,'rows':[]};return db[_0xe005('0x40')][_0xe005('0x6a')]({'where':{'id':_0x529eca[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0x1365ee,null))['then'](function(_0x50ff7c){if(_0x50ff7c){_0x10b9eb[_0xe005('0x43')]=_[_0xe005('0x45')](db[_0xe005('0x6f')]['rawAttributes']);_0x10b9eb[_0xe005('0x44')]=_['keys'](_0x529eca[_0xe005('0x44')]);_0x10b9eb['filters']=_['intersection'](_0x10b9eb[_0xe005('0x43')],_0x10b9eb[_0xe005('0x44')]);_0x1e9527[_0xe005('0x47')]=_[_0xe005('0x46')](_0x10b9eb[_0xe005('0x43')],qs['fields'](_0x529eca[_0xe005('0x44')][_0xe005('0x48')]));_0x1e9527['attributes']=_0x1e9527['attributes'][_0xe005('0x5b')]?_0x1e9527[_0xe005('0x47')]:_0x10b9eb[_0xe005('0x43')];if(!_0x529eca[_0xe005('0x44')][_0xe005('0x49')]('nolimit')){_0x1e9527['limit']=qs[_0xe005('0x2f')](_0x529eca['query'][_0xe005('0x2f')]);_0x1e9527[_0xe005('0x2d')]=qs[_0xe005('0x2d')](_0x529eca[_0xe005('0x44')][_0xe005('0x2d')]);}_0x1e9527[_0xe005('0x4b')]=qs['sort'](_0x529eca[_0xe005('0x44')][_0xe005('0x4c')]);_0x1e9527['where']=qs['filters'](_[_0xe005('0x4e')](_0x529eca['query'],_0x10b9eb[_0xe005('0x4f')]));_0x1e9527[_0xe005('0x4d')][_0xe005('0x69')]=_0x50ff7c['id'];if(_0x529eca[_0xe005('0x44')][_0xe005('0x50')]){_0x1e9527[_0xe005('0x4d')]=_['merge'](_0x1e9527['where'],{'$or':_[_0xe005('0x3f')](_0x1e9527['attributes'],function(_0x5efcdd){var _0xe0eb8f={};_0xe0eb8f[_0x5efcdd]={'$like':'%'+_0x529eca[_0xe005('0x44')][_0xe005('0x50')]+'%'};return _0xe0eb8f;})});}_0x1e9527=_[_0xe005('0x5c')]({},_0x1e9527,_0x529eca[_0xe005('0x53')]);return db[_0xe005('0x6f')][_0xe005('0x30')]({'where':_0x1e9527['where']})[_0xe005('0x21')](function(_0x439199){_0x31faf4[_0xe005('0x30')]=_0x439199;if(_0x529eca[_0xe005('0x44')][_0xe005('0x6c')]){_0x1e9527['include']=[{'all':!![]}];}return db[_0xe005('0x6f')][_0xe005('0x55')](_0x1e9527);})[_0xe005('0x21')](function(_0x58e000){_0x31faf4[_0xe005('0x56')]=_0x58e000;return _0x31faf4;});}})[_0xe005('0x21')](respondWithFilteredResult(_0x1365ee,_0x1e9527))['catch'](handleError(_0x1365ee,null));};exports[_0xe005('0x71')]=function(_0x2035d7,_0x197e26,_0x2260ce){return db[_0xe005('0x40')][_0xe005('0x5d')]({'where':{'id':_0x2035d7[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0x197e26,null))[_0xe005('0x21')](function(_0x381041){if(_0x381041){return _0x381041[_0xe005('0x71')](_0x2035d7[_0xe005('0x44')]['ids']);}})[_0xe005('0x21')](respondWithStatusCode(_0x197e26,null))[_0xe005('0x57')](handleError(_0x197e26,null));};exports[_0xe005('0x72')]=function(_0x43e1d,_0x203f0e,_0x37db1d){return db[_0xe005('0x40')][_0xe005('0x5d')]({'where':{'id':_0x43e1d[_0xe005('0x59')]['id']}})['then'](handleEntityNotFound(_0x203f0e,null))[_0xe005('0x21')](function(_0x17bc14){if(_0x17bc14){return _0x17bc14[_0xe005('0x72')](_0x43e1d[_0xe005('0x5f')][_0xe005('0x73')],_[_0xe005('0x74')](_0x43e1d[_0xe005('0x5f')],[_0xe005('0x73'),'id'])||{})[_0xe005('0x75')](function(_0x43dda5){for(var _0x3fa5cb=0x0;_0x3fa5cb<_0x43e1d[_0xe005('0x5f')][_0xe005('0x73')][_0xe005('0x5b')];_0x3fa5cb+=0x1){socket[_0xe005('0x76')](_0xe005('0x77'),{'UserId':Number(_0x43e1d['body'][_0xe005('0x73')][_0x3fa5cb]),'WhatsappAccountId':Number(_0x43e1d[_0xe005('0x59')]['id'])});}return _0x43dda5;});}})[_0xe005('0x21')](respondWithResult(_0x203f0e,null))[_0xe005('0x57')](handleError(_0x203f0e,null));};exports[_0xe005('0x78')]=function(_0x134ad0,_0x3445d0,_0x14045d){return db[_0xe005('0x40')][_0xe005('0x5d')]({'where':{'id':_0x134ad0['params']['id']}})['then'](handleEntityNotFound(_0x3445d0,null))[_0xe005('0x21')](function(_0x3e6322){if(_0x3e6322){return _0x3e6322[_0xe005('0x78')](_0x134ad0['query'][_0xe005('0x73')])['then'](function(){if(_[_0xe005('0x79')](_0x134ad0[_0xe005('0x44')][_0xe005('0x73')])){for(var _0x106d5f=0x0;_0x106d5f<_0x134ad0[_0xe005('0x44')][_0xe005('0x73')][_0xe005('0x5b')];_0x106d5f+=0x1){socket[_0xe005('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x134ad0[_0xe005('0x44')]['ids'][_0x106d5f]),'WhatsappAccountId':Number(_0x134ad0[_0xe005('0x59')]['id'])});}}else{socket[_0xe005('0x76')](_0xe005('0x7a'),{'UserId':Number(_0x134ad0[_0xe005('0x44')][_0xe005('0x73')]),'WhatsappAccountId':Number(_0x134ad0[_0xe005('0x59')]['id'])});}});}})[_0xe005('0x21')](respondWithStatusCode(_0x3445d0,null))[_0xe005('0x57')](handleError(_0x3445d0,null));};exports[_0xe005('0x7b')]=function(_0x36dd50,_0x232d2d,_0x3d806f){var _0x5d61d3={};var _0x3a7bf5={};var _0x3f8898;var _0x332595;return db['WhatsappAccount']['findOne']({'where':{'id':_0x36dd50[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0x232d2d,null))['then'](function(_0x1663e8){if(_0x1663e8){_0x3f8898=_0x1663e8;_0x3a7bf5[_0xe005('0x43')]=_['keys'](db['User'][_0xe005('0x41')]);_0x3a7bf5[_0xe005('0x44')]=_[_0xe005('0x45')](_0x36dd50[_0xe005('0x44')]);_0x3a7bf5['filters']=_['intersection'](_0x3a7bf5[_0xe005('0x43')],_0x3a7bf5[_0xe005('0x44')]);_0x5d61d3['attributes']=_[_0xe005('0x46')](_0x3a7bf5[_0xe005('0x43')],qs[_0xe005('0x48')](_0x36dd50[_0xe005('0x44')][_0xe005('0x48')]));_0x5d61d3[_0xe005('0x47')]=_0x5d61d3[_0xe005('0x47')][_0xe005('0x5b')]?_0x5d61d3[_0xe005('0x47')]:_0x3a7bf5[_0xe005('0x43')];_0x5d61d3[_0xe005('0x4b')]=qs[_0xe005('0x4c')](_0x36dd50[_0xe005('0x44')][_0xe005('0x4c')]);_0x5d61d3[_0xe005('0x4d')]=qs[_0xe005('0x4f')](_[_0xe005('0x4e')](_0x36dd50[_0xe005('0x44')],_0x3a7bf5[_0xe005('0x4f')]));if(_0x36dd50[_0xe005('0x44')][_0xe005('0x50')]){_0x5d61d3[_0xe005('0x4d')]=_['merge'](_0x5d61d3['where'],{'$or':_[_0xe005('0x3f')](_0x5d61d3[_0xe005('0x47')],function(_0x1ae369){var _0x466568={};_0x466568[_0x1ae369]={'$like':'%'+_0x36dd50[_0xe005('0x44')][_0xe005('0x50')]+'%'};return _0x466568;})});}_0x5d61d3=_['merge']({},_0x5d61d3,_0x36dd50[_0xe005('0x53')]);return _0x3f8898[_0xe005('0x7b')](_0x5d61d3);}})[_0xe005('0x21')](function(_0x2d4332){if(_0x2d4332){_0x332595=_0x2d4332[_0xe005('0x5b')];if(!_0x36dd50['query'][_0xe005('0x49')]('nolimit')){_0x5d61d3[_0xe005('0x2f')]=qs['limit'](_0x36dd50['query']['limit']);_0x5d61d3['offset']=qs[_0xe005('0x2d')](_0x36dd50[_0xe005('0x44')]['offset']);}return _0x3f8898['getAgents'](_0x5d61d3);}})[_0xe005('0x21')](function(_0x5afa9c){if(_0x5afa9c){return _0x5afa9c?{'count':_0x332595,'rows':_0x5afa9c}:null;}})[_0xe005('0x21')](respondWithResult(_0x232d2d,null))[_0xe005('0x57')](handleError(_0x232d2d,null));};exports[_0xe005('0x7c')]=function(_0x54bf99,_0x48fe79){var _0x28e77d=_0x54bf99[_0xe005('0x59')]['id'];var _0x42087d=_0x54bf99[_0xe005('0x5f')];var _0x43108c=0xc8;var _0x23db17=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0xe005('0x7d')][_0xe005('0x7e')]},function(_0x21ddac){return db[_0xe005('0x40')][_0xe005('0x6a')]({'where':{'id':_0x28e77d},'transaction':_0x21ddac})[_0xe005('0x21')](function(_0x224df8){if(_0x224df8){return db['WhatsappApplication'][_0xe005('0x35')]({'where':{'WhatsappAccountId':_0x28e77d},'transaction':_0x21ddac})['then'](function(){var _0x116a39=_[_0xe005('0x3f')](_0x42087d,function(_0x3d8aa1){_0x3d8aa1[_0xe005('0x69')]=_0x28e77d;return _0x3d8aa1;});return db[_0xe005('0x7f')]['bulkCreate'](_0x116a39,{'transaction':_0x21ddac});});}else{_0x43108c=0x194;_0x23db17=[];}});})['then'](function(){if(_0x43108c!==0x194){return db[_0xe005('0x7f')][_0xe005('0x80')]({'where':{'WhatsappAccountId':_0x28e77d},'order':_0xe005('0x81')})[_0xe005('0x21')](function(_0x9331e6){_0x23db17=_0x9331e6;});}})['catch'](function(_0x255d9e){_0x43108c=0x1f4;logger[_0xe005('0x27')](_0x255d9e[_0xe005('0x3a')]);if(_0x255d9e['name']){delete _0x255d9e[_0xe005('0x3b')];}_0x23db17=_0x255d9e;})[_0xe005('0x82')](function(){if(_0x23db17===null){_0x48fe79[_0xe005('0x2a')](_0x43108c);}else{if(_0x43108c===0x1f4){_0x48fe79['status'](_0x43108c)[_0xe005('0x3c')](_0x23db17);}else{_0x48fe79['status'](_0x43108c)[_0xe005('0x2c')](_0x23db17);}}});};exports['getApplications']=function(_0x273fca,_0x7ca4c2,_0xbb7805){var _0x45ddb8={};var _0x36f9b9={};var _0x2a9822;var _0x4873ff;return db[_0xe005('0x40')]['findOne']({'where':{'id':_0x273fca[_0xe005('0x59')]['id']}})[_0xe005('0x21')](handleEntityNotFound(_0x7ca4c2,null))['then'](function(_0x489fe9){if(_0x489fe9){_0x2a9822=_0x489fe9;_0x36f9b9[_0xe005('0x43')]=_[_0xe005('0x45')](db[_0xe005('0x7f')][_0xe005('0x41')]);_0x36f9b9['query']=_[_0xe005('0x45')](_0x273fca[_0xe005('0x44')]);_0x36f9b9[_0xe005('0x4f')]=_[_0xe005('0x46')](_0x36f9b9[_0xe005('0x43')],_0x36f9b9['query']);_0x45ddb8[_0xe005('0x47')]=_['intersection'](_0x36f9b9[_0xe005('0x43')],qs[_0xe005('0x48')](_0x273fca[_0xe005('0x44')][_0xe005('0x48')]));_0x45ddb8['attributes']=_0x45ddb8[_0xe005('0x47')][_0xe005('0x5b')]?_0x45ddb8['attributes']:_0x36f9b9[_0xe005('0x43')];_0x45ddb8[_0xe005('0x4b')]=qs[_0xe005('0x4c')](_0x273fca[_0xe005('0x44')][_0xe005('0x4c')]);_0x45ddb8[_0xe005('0x4d')]=qs['filters'](_[_0xe005('0x4e')](_0x273fca[_0xe005('0x44')],_0x36f9b9[_0xe005('0x4f')]));if(_0x273fca['query']['filter']){_0x45ddb8[_0xe005('0x4d')]=_[_0xe005('0x5c')](_0x45ddb8[_0xe005('0x4d')],{'$or':_[_0xe005('0x3f')](_0x45ddb8[_0xe005('0x47')],function(_0x584124){var _0x4522bf={};_0x4522bf[_0x584124]={'$like':'%'+_0x273fca[_0xe005('0x44')]['filter']+'%'};return _0x4522bf;})});}_0x45ddb8=_['merge']({},_0x45ddb8,_0x273fca[_0xe005('0x53')]);return _0x2a9822[_0xe005('0x83')](_0x45ddb8);}})[_0xe005('0x21')](function(_0x3c30e2){if(_0x3c30e2){_0x4873ff=_0x3c30e2[_0xe005('0x5b')];if(!_0x273fca[_0xe005('0x44')][_0xe005('0x49')]('nolimit')){_0x45ddb8[_0xe005('0x2f')]=qs[_0xe005('0x2f')](_0x273fca[_0xe005('0x44')][_0xe005('0x2f')]);_0x45ddb8[_0xe005('0x2d')]=qs[_0xe005('0x2d')](_0x273fca[_0xe005('0x44')][_0xe005('0x2d')]);}return _0x2a9822[_0xe005('0x83')](_0x45ddb8);}})[_0xe005('0x21')](function(_0x160555){if(_0x160555){return _0x160555?{'count':_0x4873ff,'rows':_0x160555}:null;}})[_0xe005('0x21')](respondWithResult(_0x7ca4c2,null))[_0xe005('0x57')](handleError(_0x7ca4c2,null));};exports['notify']=function(_0x3f3b71,_0x5b8176,_0x28242f){var _0x16086d={'channel':'whatsapp'};var _0x5258d3=[];var _0x4d0030=[];var _0x57d74d={};return db[_0xe005('0x40')][_0xe005('0x5d')]({'where':{'id':_0x3f3b71[_0xe005('0x59')]['id']},'include':[{'model':db[_0xe005('0x7f')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x5b8176,null))['then'](function(_0x1e58a6){_0x16086d[_0xe005('0x84')]=_0x1e58a6;if(_0x16086d['account']&&_0x16086d[_0xe005('0x84')][_0xe005('0x51')]===_0xe005('0x85')&&_0x3f3b71[_0xe005('0x5f')]['statuses']){if(_0x3f3b71['body'][_0xe005('0x86')][_0xe005('0x5b')]===0x0)return;if(_0x3f3b71[_0xe005('0x5f')][_0xe005('0x86')][0x0][_0xe005('0x87')]!==_0xe005('0x88'))return;return db[_0xe005('0x89')]['update']({'read':!![],'readAt':_0x3f3b71['body'][_0xe005('0x86')][0x0][_0xe005('0x8a')]},{'where':{'messageId':_0x3f3b71[_0xe005('0x5f')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0xe005('0x21')](function(_0x207be6){return _0x5b8176['status'](0xc8)['json'](_0x207be6);});}_0x16086d[_0xe005('0x8b')]=_[_0xe005('0x8c')](_0x1e58a6['Applications'],['priority'],[_0xe005('0x8d')]);if(_0x16086d[_0xe005('0x84')][_0xe005('0x8e')]){delete _0x16086d['account'][_0xe005('0x8e')];}return db[_0xe005('0x8f')]['describe']()['then'](function(_0x3e37d7){if(!_0x3e37d7){throw new db['Sequelize'][(_0xe005('0x90'))](_0xe005('0x91'));}_0x5258d3=_[_0xe005('0x92')](_[_0xe005('0x45')](_0x3e37d7),[_0xe005('0x93'),_0xe005('0x94')]);_0x4d0030=_[_0xe005('0x92')](_[_0xe005('0x45')](_0x3e37d7),['createdAt',_0xe005('0x94'),_0xe005('0x95'),_0xe005('0x96')]);_0x16086d[_0xe005('0x5f')]={'mapKey':_0xe005('0x97')};if(_0x16086d[_0xe005('0x84')]&&_0x16086d[_0xe005('0x84')][_0xe005('0x51')]==='twilio'){_0x16086d[_0xe005('0x5f')][_0xe005('0x98')]=_0x3f3b71[_0xe005('0x5f')][_0xe005('0x99')][_0xe005('0x9a')](_0xe005('0x9b'),'');_0x16086d[_0xe005('0x5f')][_0xe005('0x5f')]=_0x3f3b71[_0xe005('0x5f')][_0xe005('0x9c')];_0x16086d[_0xe005('0x5f')][_0xe005('0x9d')]=_0x3f3b71[_0xe005('0x5f')][_0xe005('0x9e')];}if(_0x16086d[_0xe005('0x84')]&&_0x16086d['account'][_0xe005('0x51')]===_0xe005('0x85')){_0x16086d[_0xe005('0x5f')]['from']=_0x3f3b71[_0xe005('0x5f')][_0xe005('0x9f')][0x0]['from'];_0x16086d[_0xe005('0x5f')][_0xe005('0x5f')]=_0x3f3b71[_0xe005('0x5f')][_0xe005('0x9f')][0x0]['message']['body'];_0x16086d[_0xe005('0x5f')][_0xe005('0x9d')]=_0x3f3b71[_0xe005('0x5f')]['notifications'][0x0][_0xe005('0xa0')];}if(_0x16086d['body']['id']){delete _0x16086d[_0xe005('0x5f')]['id'];}if(_[_0xe005('0xa1')](_0x16086d[_0xe005('0x5f')]['from'])){throw new db[(_0xe005('0xa2'))][(_0xe005('0x90'))](_0xe005('0xa3'));}if(_['isNil'](_0x16086d[_0xe005('0x5f')][_0xe005('0x5f')])||_0x16086d[_0xe005('0x5f')][_0xe005('0x5f')]===''){throw new db[(_0xe005('0xa2'))][(_0xe005('0x90'))](_0xe005('0xa4'));}if(_['isNil'](_0x16086d['body'][_0xe005('0xa5')])){throw new db[(_0xe005('0xa2'))][(_0xe005('0x90'))](_0xe005('0xa6')+_0x4d0030);}if(!_[_0xe005('0xa7')](_0x4d0030,_0x16086d[_0xe005('0x5f')][_0xe005('0xa5')])){throw new db[(_0xe005('0xa2'))][(_0xe005('0x90'))](_0xe005('0xa8')+_0x4d0030);}_0x57d74d[_0x16086d[_0xe005('0x5f')]['mapKey']]=_0x16086d['body'][_0xe005('0x98')];return db['CmList'][_0xe005('0x5d')]({'where':{'id':_0x16086d[_0xe005('0x84')][_0xe005('0x96')]},'include':[{'model':db[_0xe005('0x8f')],'as':_0xe005('0xa9'),'where':_0x57d74d,'limit':0x1,'order':[['updatedAt',_0xe005('0xaa')]]}]});})[_0xe005('0x21')](handleEntityNotFound(_0x5b8176,null))[_0xe005('0x21')](function(_0x3ab071){if(_0x3ab071){_0x16086d['list']=_[_0xe005('0x74')](_0x3ab071,[_0xe005('0xa9')]);if(_0x3ab071['Contacts'][_0xe005('0x5b')]){return _0x3ab071['Contacts'][0x0];}var _0x586a83=_[_0xe005('0x19')](_0x16086d['body'],{'firstName':_0x16086d['body']['from'],'ListId':_0x3ab071['id']});_0x586a83[_0x16086d[_0xe005('0x5f')][_0xe005('0xa5')]]=_0x16086d[_0xe005('0x5f')][_0xe005('0x98')];return db[_0xe005('0x8f')]['create'](_0x586a83,{'fields':_0x5258d3,'raw':!![]});}})[_0xe005('0x21')](handleEntityNotFound(_0x5b8176,null))['then'](function(_0x520ab3){if(_0x520ab3){_0x16086d['contact']=_0x520ab3;var _0x2f7d9b={'ContactId':_0x520ab3['id'],'phone':_0x16086d[_0xe005('0x5f')][_0xe005('0x98')],'WhatsappAccountId':_0x3f3b71[_0xe005('0x59')]['id']};var _0xd09cf5={'ContactId':_0x520ab3['id'],'WhatsappAccountId':_0x3f3b71['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0xe005('0x5d')]({'where':_0xd09cf5})[_0xe005('0x21')](function(_0x442c15){if(_0x442c15){return[_0x442c15,![]];}return db[_0xe005('0xab')][_0xe005('0x5e')](_0x2f7d9b)[_0xe005('0x21')](function(_0x5d36e9){return[_0x5d36e9,!![]];});});}})[_0xe005('0x75')](function(_0x47c558,_0x47f064){_0x16086d[_0xe005('0xac')]=_0x47c558[_0xe005('0x36')]({'plain':!![]});_0x16086d[_0xe005('0xac')][_0xe005('0xad')]=![];if(_0x47f064){if(_0x16086d[_0xe005('0x84')][_0xe005('0xae')]){_0x16086d[_0xe005('0x8b')]['push']({'id':0x0,'priority':_0x16086d[_0xe005('0x8b')][_0xe005('0x5b')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x16086d[_0xe005('0xac')]['created']=!![];}return db[_0xe005('0x89')][_0xe005('0x5e')]({'phone':_0x16086d['body'][_0xe005('0x98')],'messageId':_0x16086d[_0xe005('0x5f')][_0xe005('0x9d')],'body':_0x16086d[_0xe005('0x5f')]['body'],'WhatsappAccountId':_0x3f3b71[_0xe005('0x59')]['id'],'WhatsappInteractionId':_0x47c558['id'],'direction':'in','ContactId':_0x47c558[_0xe005('0xaf')],'AttachmentId':_0x16086d[_0xe005('0x5f')][_0xe005('0xb0')]});})[_0xe005('0x21')](function(_0x4455f1){_0x16086d[_0xe005('0x28')]=_0x4455f1;if(_0x16086d[_0xe005('0xac')]['UserId']){return db[_0xe005('0xb1')][_0xe005('0x5d')]({'attributes':['id',_0xe005('0x3b')],'where':{'id':_0x16086d[_0xe005('0xac')][_0xe005('0xb2')]}})[_0xe005('0x21')](function(_0x26f2f1){if(_0x26f2f1){_0x16086d[_0xe005('0x8b')][_0xe005('0xb3')]({'id':0x0,'priority':0x0,'app':_0xe005('0xb4'),'appdata':_0x26f2f1[_0xe005('0x3b')]+','+(_0x16086d[_0xe005('0x84')]['waitForTheAssignedAgent']||0xa),'interval':_0xe005('0xb5')});}return respondWithRpcPromise(_0xe005('0xb6'),_0xe005('0xb7'),_0x16086d);});}return respondWithRpcPromise(_0xe005('0xb6'),_0xe005('0xb7'),_0x16086d);})['then'](function(_0x1fa3e5){if(_0x1fa3e5){var _0x155089=0xc8;var _0x1050a1=_0xe005('0xb8');logger[_0xe005('0xb9')](_0xe005('0x25'),_0x1050a1,_0x155089,_0xe005('0xba'));logger[_0xe005('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1050a1,_0x155089,_0xe005('0xba'),JSON[_0xe005('0x26')](_0x1fa3e5));if(_0x16086d[_0xe005('0x84')][_0xe005('0x51')]===_0xe005('0xbb')){return _0x5b8176[_0xe005('0x2b')](_0x155089)[_0xe005('0x31')](_0xe005('0xbc'),_0xe005('0xbd'))[_0xe005('0x3c')](_0xe005('0xbe'));}else{return _0x5b8176[_0xe005('0x2b')](_0x155089)[_0xe005('0x2c')](_0x1fa3e5);}}});})[_0xe005('0x57')](handleError(_0x5b8176,null));};exports['send']=function(_0x4e1e1a,_0x296450,_0x519bd0){var _0x58334e,_0x41b964,_0x51d444;if(_[_0xe005('0xa1')](_0x4e1e1a[_0xe005('0x5f')]['body'])||_0x4e1e1a[_0xe005('0x5f')]['body']===''){throw new db['Sequelize'][(_0xe005('0x90'))](_0xe005('0xa4'));}if(_[_0xe005('0xa1')](_0x4e1e1a[_0xe005('0x5f')]['to'])){throw new db['Sequelize'][(_0xe005('0x90'))]('to\x20is\x20mandatory');}_0x58334e=_0x4e1e1a[_0xe005('0x5f')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x4e1e1a[_0xe005('0x59')]['id']},'include':[{'model':db[_0xe005('0xbf')],'as':_0xe005('0xc0'),'include':[{'model':db[_0xe005('0x8f')],'as':_0xe005('0xa9'),'where':{'mobile':_0x58334e},'limit':0x1,'order':[[_0xe005('0x94'),_0xe005('0xaa')]]}]}]})[_0xe005('0x21')](handleEntityNotFound(_0x296450,null))[_0xe005('0x21')](function(_0xec6a8){if(_0xec6a8&&_0xec6a8[_0xe005('0xc0')]){_0x41b964=_0xec6a8[_0xe005('0x36')]({'plain':!![]});if(_0x41b964[_0xe005('0xc0')]&&_0x41b964[_0xe005('0xc0')][_0xe005('0xa9')]['length']){return _0x41b964[_0xe005('0xc0')][_0xe005('0xa9')][0x0];}return db[_0xe005('0x8f')]['create'](_[_0xe005('0x19')](_0x4e1e1a[_0xe005('0x5f')],{'firstName':_0x58334e,'mobile':_0x58334e,'phone':_0x58334e,'ListId':_0x41b964[_0xe005('0x96')]}));}})[_0xe005('0x21')](handleEntityNotFound(_0x296450,null))['then'](function(_0x3c9afa){if(_0x3c9afa){_0x51d444=_0x3c9afa;return db[_0xe005('0xab')][_0xe005('0x5d')]({'where':{'ContactId':_0x51d444['id'],'closed':![],'WhatsappAccountId':_0x41b964['id']}})['then'](function(_0x3bb494){if(_0x3bb494){return[_0x3bb494,![]];}return db[_0xe005('0xab')][_0xe005('0x5e')]({'UserId':_0x4e1e1a[_0xe005('0x60')]['id'],'ContactId':_0x51d444['id'],'WhatsappAccountId':_0x41b964['id'],'phone':_0x58334e,'firstMsgDirection':_0xe005('0xc1'),'Messages':[_[_0xe005('0x5c')](_0x4e1e1a[_0xe005('0x5f')],{'read':![],'body':_0x4e1e1a[_0xe005('0x5f')][_0xe005('0x5f')],'phone':_0x58334e,'WhatsappAccountId':_0x41b964['id'],'UserId':_0x4e1e1a[_0xe005('0x60')]['id'],'ContactId':_0x51d444['id']})]},{'include':[{'model':db[_0xe005('0x89')],'as':_0xe005('0xc2')}]})[_0xe005('0x21')](function(_0x1aef2f){return[_0x1aef2f,!![]];});});}})[_0xe005('0x75')](function(_0x1269dd,_0x24ecbb){if(_0x24ecbb){return _0x1269dd;}return db[_0xe005('0x89')][_0xe005('0x5e')](_[_0xe005('0x5c')](_0x4e1e1a[_0xe005('0x5f')],{'read':![],'body':_0x4e1e1a[_0xe005('0x5f')]['body'],'phone':_0x58334e,'WhatsappAccountId':_0x41b964['id'],'WhatsappInteractionId':_0x1269dd['id'],'UserId':_0x4e1e1a['user']['id'],'ContactId':_0x51d444['id']}))[_0xe005('0x21')](function(_0x49eb47){_0x1269dd[_0xe005('0xc3')][_0xe005('0xc2')]=[];_0x1269dd['dataValues'][_0xe005('0xc2')][_0xe005('0xc4')](_0x49eb47[_0xe005('0xc3')]);return _0x1269dd;});})[_0xe005('0x21')](respondWithResult(_0x296450,null))[_0xe005('0x57')](handleError(_0x296450,null));};
\ No newline at end of file
index c0c87b5..2ca05ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc90=['hook','exports','../../mysqldb','WhatsappAccount','save','remove','emit','hasOwnProperty'];(function(_0x2baf40,_0x5ebef2){var _0x2bb2cb=function(_0x1a3fc1){while(--_0x1a3fc1){_0x2baf40['push'](_0x2baf40['shift']());}};_0x2bb2cb(++_0x5ebef2);}(_0xdc90,0x15a));var _0x0dc9=function(_0x386b44,_0x33bdf5){_0x386b44=_0x386b44-0x0;var _0x306bc9=_0xdc90[_0x386b44];return _0x306bc9;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x0dc9('0x0'))['db'][_0x0dc9('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0dc9('0x2'),'afterUpdate':'update','afterDestroy':_0x0dc9('0x3')};function emitEvent(_0x3c7d87){return function(_0x336eec,_0x42b796,_0x598498){WhatsappAccountEvents['emit'](_0x3c7d87+':'+_0x336eec['id'],_0x336eec);WhatsappAccountEvents[_0x0dc9('0x4')](_0x3c7d87,_0x336eec);_0x598498(null);};}for(var e in events){if(events[_0x0dc9('0x5')](e)){var event=events[e];WhatsappAccount[_0x0dc9('0x6')](e,emitEvent(event));}}module[_0x0dc9('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xa6cb=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x460096,_0x255d37){var _0x24fc3c=function(_0x21c535){while(--_0x21c535){_0x460096['push'](_0x460096['shift']());}};_0x24fc3c(++_0x255d37);}(_0xa6cb,0xf4));var _0xba6c=function(_0x4369fe,_0x24e101){_0x4369fe=_0x4369fe-0x0;var _0x299fc3=_0xa6cb[_0x4369fe];return _0x299fc3;};'use strict';var EventEmitter=require(_0xba6c('0x0'));var WhatsappAccount=require(_0xba6c('0x1'))['db'][_0xba6c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xba6c('0x3')](0x0);var events={'afterCreate':_0xba6c('0x4'),'afterUpdate':_0xba6c('0x5'),'afterDestroy':_0xba6c('0x6')};function emitEvent(_0x33c0d5){return function(_0x4417ed,_0x125da8,_0x6c6d00){WhatsappAccountEvents[_0xba6c('0x7')](_0x33c0d5+':'+_0x4417ed['id'],_0x4417ed);WhatsappAccountEvents[_0xba6c('0x7')](_0x33c0d5,_0x4417ed);_0x6c6d00(null);};}for(var e in events){if(events[_0xba6c('0x8')](e)){var event=events[e];WhatsappAccount[_0xba6c('0x9')](e,emitEvent(event));}}module[_0xba6c('0xa')]=WhatsappAccountEvents;
\ No newline at end of file
index d3e4251..1070fff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x969d=['api','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger'];(function(_0x1e1d39,_0x57c20f){var _0x56beb5=function(_0x2540ca){while(--_0x2540ca){_0x1e1d39['push'](_0x1e1d39['shift']());}};_0x56beb5(++_0x57c20f);}(_0x969d,0xa6));var _0xd969=function(_0x498197,_0x46db06){_0x498197=_0x498197-0x0;var _0x1a5baa=_0x969d[_0x498197];return _0x1a5baa;};'use strict';var _=require(_0xd969('0x0'));var util=require(_0xd969('0x1'));var logger=require(_0xd969('0x2'))(_0xd969('0x3'));var moment=require('moment');var BPromise=require(_0xd969('0x4'));var rp=require(_0xd969('0x5'));var fs=require('fs');var path=require(_0xd969('0x6'));var rimraf=require('rimraf');var config=require(_0xd969('0x7'));var attributes=require(_0xd969('0x8'));module[_0xd969('0x9')]=function(_0x5af5e2,_0x1029d8){return _0x5af5e2[_0xd969('0xa')](_0xd969('0xb'),attributes,{'tableName':_0xd969('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64d0=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x8ee599,_0x526490){var _0x2e34c1=function(_0x4d294c){while(--_0x4d294c){_0x8ee599['push'](_0x8ee599['shift']());}};_0x2e34c1(++_0x526490);}(_0x64d0,0x19b));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x064d('0x0'));var util=require(_0x064d('0x1'));var logger=require(_0x064d('0x2'))(_0x064d('0x3'));var moment=require('moment');var BPromise=require(_0x064d('0x4'));var rp=require(_0x064d('0x5'));var fs=require('fs');var path=require(_0x064d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x064d('0x7')]=function(_0x19322d,_0x5c51dc){return _0x19322d[_0x064d('0x8')](_0x064d('0x9'),attributes,{'tableName':_0x064d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d1e7fd..bfeb04b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x345c=['result','catch','WhatsappAccount','find','options','attributes','include','model','ShowWhatsappAccount','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x253db8,_0x33405f){var _0x4fdd40=function(_0x3a8f9d){while(--_0x3a8f9d){_0x253db8['push'](_0x253db8['shift']());}};_0x4fdd40(++_0x33405f);}(_0x345c,0x1e9));var _0xc345=function(_0x2f2111,_0x10c5e7){_0x2f2111=_0x2f2111-0x0;var _0x27863b=_0x345c[_0x2f2111];return _0x27863b;};'use strict';var _=require('lodash');var util=require(_0xc345('0x0'));var moment=require(_0xc345('0x1'));var BPromise=require(_0xc345('0x2'));var rs=require(_0xc345('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc345('0x4'))(_0xc345('0x5'));var config=require(_0xc345('0x6'));var jayson=require(_0xc345('0x7'));var client=jayson[_0xc345('0x8')][_0xc345('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc345('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc345('0xb'))(new Redis(config['redis']));require(_0xc345('0xc'))['register'](socket);function respondWithRpcPromise(_0x7e4a30,_0x35d92e,_0x48c2f5){return new BPromise(function(_0x269a07,_0x1ee385){return client[_0xc345('0xd')](_0x7e4a30,_0x48c2f5)[_0xc345('0xe')](function(_0x261905){logger['info'](_0xc345('0xf'),_0x35d92e,_0xc345('0x10'));logger[_0xc345('0x11')](_0xc345('0x12'),_0x35d92e,_0xc345('0x10'),JSON[_0xc345('0x13')](_0x261905));if(_0x261905[_0xc345('0x14')]){if(_0x261905[_0xc345('0x14')]['code']===0x1f4){logger[_0xc345('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x35d92e,_0x261905[_0xc345('0x14')][_0xc345('0x15')]);return _0x1ee385(_0x261905['error']['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x35d92e,_0x261905[_0xc345('0x14')][_0xc345('0x15')]);return _0x269a07(_0x261905['error']['message']);}else{logger[_0xc345('0x16')](_0xc345('0xf'),_0x35d92e,'request\x20sent');_0x269a07(_0x261905[_0xc345('0x17')][_0xc345('0x15')]);}})[_0xc345('0x18')](function(_0x3de075){logger[_0xc345('0x14')](_0xc345('0xf'),_0x35d92e,_0x3de075);_0x1ee385(_0x3de075);});});}exports['ShowWhatsappAccount']=function(_0x26ab77){var _0x347434=this;return new Promise(function(_0x41b161,_0xb8365a){return db[_0xc345('0x19')][_0xc345('0x1a')]({'raw':_0x26ab77['options']?_0x26ab77[_0xc345('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x26ab77[_0xc345('0x1b')]?_0x26ab77[_0xc345('0x1b')]['where']||null:null,'attributes':_0x26ab77[_0xc345('0x1b')]?_0x26ab77[_0xc345('0x1b')][_0xc345('0x1c')]||null:null,'include':_0x26ab77[_0xc345('0x1b')]?_0x26ab77['options']['include']?_['map'](_0x26ab77[_0xc345('0x1b')][_0xc345('0x1d')],function(_0x56a55c){return{'model':db[_0x56a55c['model']],'as':_0x56a55c['as'],'attributes':_0x56a55c['attributes'],'include':_0x56a55c[_0xc345('0x1d')]?_['map'](_0x56a55c[_0xc345('0x1d')],function(_0xe6c669){return{'model':db[_0xe6c669[_0xc345('0x1e')]],'as':_0xe6c669['as'],'attributes':_0xe6c669['attributes'],'include':_0xe6c669[_0xc345('0x1d')]?_['map'](_0xe6c669['include'],function(_0x3fca09){return{'model':db[_0x3fca09[_0xc345('0x1e')]],'as':_0x3fca09['as'],'attributes':_0x3fca09[_0xc345('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc345('0xe')](function(_0x48df4e){logger['info'](_0xc345('0x1f'),_0x26ab77);logger['debug'](_0xc345('0x1f'),_0x26ab77,JSON[_0xc345('0x13')](_0x48df4e));_0x41b161(_0x48df4e);})[_0xc345('0x18')](function(_0x1bf30f){logger[_0xc345('0x14')]('ShowWhatsappAccount',_0x1bf30f[_0xc345('0x15')],_0x26ab77);_0xb8365a(_0x347434[_0xc345('0x14')](0x1f4,_0x1bf30f[_0xc345('0x15')]));});});};
\ No newline at end of file
+var _0xa5b3=['http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xa5b3,0x1bd));var _0x3a5b=function(_0x2df47c,_0x551baa){_0x2df47c=_0x2df47c-0x0;var _0x3f9ad9=_0xa5b3[_0x2df47c];return _0x3f9ad9;};'use strict';var _=require(_0x3a5b('0x0'));var util=require('util');var moment=require(_0x3a5b('0x1'));var BPromise=require(_0x3a5b('0x2'));var rs=require(_0x3a5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a5b('0x4'))['db'];var utils=require(_0x3a5b('0x5'));var logger=require(_0x3a5b('0x6'))(_0x3a5b('0x7'));var config=require(_0x3a5b('0x8'));var jayson=require(_0x3a5b('0x9'));var client=jayson[_0x3a5b('0xa')][_0x3a5b('0xb')]({'port':0x232a});config[_0x3a5b('0xc')]=_['defaults'](config['redis'],{'host':_0x3a5b('0xd'),'port':0x18eb});var socket=require(_0x3a5b('0xe'))(new Redis(config[_0x3a5b('0xc')]));require(_0x3a5b('0xf'))[_0x3a5b('0x10')](socket);function respondWithRpcPromise(_0x30cf73,_0x16b92a,_0x5ce682){return new BPromise(function(_0x2c8a36,_0x3b9055){return client[_0x3a5b('0x11')](_0x30cf73,_0x5ce682)[_0x3a5b('0x12')](function(_0x50f16d){logger[_0x3a5b('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x16b92a,_0x3a5b('0x14'));logger[_0x3a5b('0x15')](_0x3a5b('0x16'),_0x16b92a,_0x3a5b('0x14'),JSON[_0x3a5b('0x17')](_0x50f16d));if(_0x50f16d[_0x3a5b('0x18')]){if(_0x50f16d[_0x3a5b('0x18')]['code']===0x1f4){logger[_0x3a5b('0x18')](_0x3a5b('0x19'),_0x16b92a,_0x50f16d[_0x3a5b('0x18')][_0x3a5b('0x1a')]);return _0x3b9055(_0x50f16d[_0x3a5b('0x18')][_0x3a5b('0x1a')]);}logger[_0x3a5b('0x18')](_0x3a5b('0x19'),_0x16b92a,_0x50f16d[_0x3a5b('0x18')][_0x3a5b('0x1a')]);return _0x2c8a36(_0x50f16d[_0x3a5b('0x18')][_0x3a5b('0x1a')]);}else{logger[_0x3a5b('0x13')](_0x3a5b('0x19'),_0x16b92a,'request\x20sent');_0x2c8a36(_0x50f16d[_0x3a5b('0x1b')][_0x3a5b('0x1a')]);}})[_0x3a5b('0x1c')](function(_0x22c034){logger[_0x3a5b('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x16b92a,_0x22c034);_0x3b9055(_0x22c034);});});}exports[_0x3a5b('0x1d')]=function(_0x4b42c0){var _0xb6b491=this;return new Promise(function(_0x2293e1,_0x1d7954){return db[_0x3a5b('0x1e')][_0x3a5b('0x1f')]({'raw':_0x4b42c0['options']?_0x4b42c0[_0x3a5b('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4b42c0[_0x3a5b('0x20')]?_0x4b42c0[_0x3a5b('0x20')][_0x3a5b('0x21')]||null:null,'attributes':_0x4b42c0[_0x3a5b('0x20')]?_0x4b42c0['options'][_0x3a5b('0x22')]||null:null,'include':_0x4b42c0[_0x3a5b('0x20')]?_0x4b42c0['options'][_0x3a5b('0x23')]?_['map'](_0x4b42c0['options']['include'],function(_0xa5e3c8){return{'model':db[_0xa5e3c8[_0x3a5b('0x24')]],'as':_0xa5e3c8['as'],'attributes':_0xa5e3c8['attributes'],'include':_0xa5e3c8[_0x3a5b('0x23')]?_['map'](_0xa5e3c8[_0x3a5b('0x23')],function(_0x382b2b){return{'model':db[_0x382b2b['model']],'as':_0x382b2b['as'],'attributes':_0x382b2b['attributes'],'include':_0x382b2b[_0x3a5b('0x23')]?_[_0x3a5b('0x25')](_0x382b2b[_0x3a5b('0x23')],function(_0x3f19d5){return{'model':db[_0x3f19d5[_0x3a5b('0x24')]],'as':_0x3f19d5['as'],'attributes':_0x3f19d5[_0x3a5b('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50e2e4){logger[_0x3a5b('0x13')](_0x3a5b('0x1d'),_0x4b42c0);logger['debug']('ShowWhatsappAccount',_0x4b42c0,JSON['stringify'](_0x50e2e4));_0x2293e1(_0x50e2e4);})[_0x3a5b('0x1c')](function(_0x3f7b88){logger[_0x3a5b('0x18')](_0x3a5b('0x1d'),_0x3f7b88[_0x3a5b('0x1a')],_0x4b42c0);_0x1d7954(_0xb6b491[_0x3a5b('0x18')](0x1f4,_0x3f7b88[_0x3a5b('0x1a')]));});});};
\ No newline at end of file
index cebc623..b579b3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa07a=['save','update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x34b5e1,_0x287fa4){var _0x3cc728=function(_0x3ec8a0){while(--_0x3ec8a0){_0x34b5e1['push'](_0x34b5e1['shift']());}};_0x3cc728(++_0x287fa4);}(_0xa07a,0x7d));var _0xaa07=function(_0x547d30,_0x493da3){_0x547d30=_0x547d30-0x0;var _0x2e72d0=_0xa07a[_0x547d30];return _0x2e72d0;};'use strict';var WhatsappAccountEvents=require(_0xaa07('0x0'));var events=[_0xaa07('0x1'),'remove',_0xaa07('0x2')];function createListener(_0x5d9667,_0x3da90){return function(_0x4ca7a9){_0x3da90['emit'](_0x5d9667,_0x4ca7a9);};}function removeListener(_0x367dac,_0x5847dc){return function(){WhatsappAccountEvents[_0xaa07('0x3')](_0x367dac,_0x5847dc);};}exports[_0xaa07('0x4')]=function(_0x4beb6d){for(var _0x2b318d=0x0,_0x1542cb=events[_0xaa07('0x5')];_0x2b318d<_0x1542cb;_0x2b318d++){var _0x12ff08=events[_0x2b318d];var _0x1ea545=createListener(_0xaa07('0x6')+_0x12ff08,_0x4beb6d);WhatsappAccountEvents['on'](_0x12ff08,_0x1ea545);}};
\ No newline at end of file
+var _0x8553=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','register'];(function(_0xf95489,_0x2ccb64){var _0x580789=function(_0xd15925){while(--_0xd15925){_0xf95489['push'](_0xf95489['shift']());}};_0x580789(++_0x2ccb64);}(_0x8553,0x86));var _0x3855=function(_0x27faa7,_0x28a3e4){_0x27faa7=_0x27faa7-0x0;var _0x540d9b=_0x8553[_0x27faa7];return _0x540d9b;};'use strict';var WhatsappAccountEvents=require(_0x3855('0x0'));var events=[_0x3855('0x1'),_0x3855('0x2'),_0x3855('0x3')];function createListener(_0x166809,_0x49431e){return function(_0x3887db){_0x49431e[_0x3855('0x4')](_0x166809,_0x3887db);};}function removeListener(_0x331456,_0x200b88){return function(){WhatsappAccountEvents['removeListener'](_0x331456,_0x200b88);};}exports[_0x3855('0x5')]=function(_0xf0e657){for(var _0x1901ba=0x0,_0x36cc80=events['length'];_0x1901ba<_0x36cc80;_0x1901ba++){var _0x22b70e=events[_0x1901ba];var _0x282a62=createListener(_0x3855('0x6')+_0x22b70e,_0xf0e657);WhatsappAccountEvents['on'](_0x22b70e,_0x282a62);}};
\ No newline at end of file
index 766dbdc..25df8a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c0=['/:id','post','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','isAuthenticated','index','get'];(function(_0x2631ca,_0x44cd63){var _0x35a019=function(_0x25f933){while(--_0x25f933){_0x2631ca['push'](_0x2631ca['shift']());}};_0x35a019(++_0x44cd63);}(_0xb8c0,0x1e4));var _0x0b8c=function(_0x555cfc,_0x18ef13){_0x555cfc=_0x555cfc-0x0;var _0x1448dc=_0xb8c0[_0x555cfc];return _0x1448dc;};'use strict';var multer=require(_0x0b8c('0x0'));var util=require(_0x0b8c('0x1'));var path=require(_0x0b8c('0x2'));var timeout=require(_0x0b8c('0x3'));var express=require(_0x0b8c('0x4'));var router=express[_0x0b8c('0x5')]();var fs_extra=require(_0x0b8c('0x6'));var auth=require(_0x0b8c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0b8c('0x8'));router['get']('/',auth[_0x0b8c('0x9')](),controller[_0x0b8c('0xa')]);router[_0x0b8c('0xb')](_0x0b8c('0xc'),auth[_0x0b8c('0x9')](),controller['show']);router[_0x0b8c('0xd')]('/',auth[_0x0b8c('0x9')](),controller['create']);router['put'](_0x0b8c('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0b8c('0xc'),auth[_0x0b8c('0x9')](),controller[_0x0b8c('0xe')]);module[_0x0b8c('0xf')]=router;
\ No newline at end of file
+var _0x761b=['update','destroy','multer','Router','fs-extra','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x5ecf75,_0x2fc37d){var _0x850076=function(_0x18542e){while(--_0x18542e){_0x5ecf75['push'](_0x5ecf75['shift']());}};_0x850076(++_0x2fc37d);}(_0x761b,0x11f));var _0xb761=function(_0x867b4a,_0x1441ca){_0x867b4a=_0x867b4a-0x0;var _0x1260f4=_0x761b[_0x867b4a];return _0x1260f4;};'use strict';var multer=require(_0xb761('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb761('0x1')]();var fs_extra=require(_0xb761('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb761('0x3'));var config=require('../../config/environment');var controller=require(_0xb761('0x4'));router[_0xb761('0x5')]('/',auth[_0xb761('0x6')](),controller[_0xb761('0x7')]);router[_0xb761('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xb761('0x8')]);router[_0xb761('0x9')]('/',auth[_0xb761('0x6')](),controller[_0xb761('0xa')]);router[_0xb761('0xb')](_0xb761('0xc'),auth[_0xb761('0x6')](),controller[_0xb761('0xd')]);router['delete'](_0xb761('0xc'),auth[_0xb761('0x6')](),controller[_0xb761('0xe')]);module['exports']=router;
\ No newline at end of file
index c9af824..6a5a7bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a38=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x45d427,_0x5c9268){var _0x35660a=function(_0x133832){while(--_0x133832){_0x45d427['push'](_0x45d427['shift']());}};_0x35660a(++_0x5c9268);}(_0x6a38,0xc7));var _0x86a3=function(_0x1db67b,_0x4ac6e4){_0x1db67b=_0x1db67b-0x0;var _0x429b07=_0x6a38[_0x1db67b];return _0x429b07;};'use strict';var Sequelize=require(_0x86a3('0x0'));module['exports']={'priority':{'type':Sequelize[_0x86a3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x86a3('0x2')],'allowNull':![],'defaultValue':_0x86a3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x86a3('0x2')],'defaultValue':_0x86a3('0x4')}};
\ No newline at end of file
+var _0x3287=['STRING','exports','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3287,0x18d));var _0x7328=function(_0x1054e6,_0x557d34){_0x1054e6=_0x1054e6-0x0;var _0xdfd859=_0x3287[_0x1054e6];return _0xdfd859;};'use strict';var Sequelize=require('sequelize');module[_0x7328('0x0')]={'priority':{'type':Sequelize[_0x7328('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7328('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 9f24fc9..763fe1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbbc=['fieldName','type','key','model','query','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','filters','includeAll','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','rawAttributes'];(function(_0x295bda,_0x21efee){var _0x121606=function(_0x735c0e){while(--_0x735c0e){_0x295bda['push'](_0x295bda['shift']());}};_0x121606(++_0x21efee);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5656f7,_0x2721f9){_0x5656f7=_0x5656f7-0x0;var _0x349d60=_0xbbbc[_0x5656f7];return _0x349d60;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x4ffa80,_0x48dfc4){return function(_0x575d56){if(!_0x575d56){_0x4ffa80[_0xcbbb('0x18')](0x194);}return _0x575d56;};}function handleError(_0x548440,_0x59c422){_0x59c422=_0x59c422||0x1f4;return function(_0x5499a1){logger[_0xcbbb('0x27')](_0x5499a1['stack']);if(_0x5499a1['name']){delete _0x5499a1[_0xcbbb('0x28')];}_0x548440[_0xcbbb('0x19')](_0x59c422)[_0xcbbb('0x29')](_0x5499a1);};}exports[_0xcbbb('0x2a')]=function(_0x372024,_0x39ba8b){var _0x3d4c0d={},_0x1c986d={},_0x2a023f={'count':0x0,'rows':[]};var _0x26c05e=_[_0xcbbb('0x2b')](db[_0xcbbb('0x2c')][_0xcbbb('0x2d')],function(_0x1ce741){return{'name':_0x1ce741[_0xcbbb('0x2e')],'type':_0x1ce741[_0xcbbb('0x2f')][_0xcbbb('0x30')]};});_0x1c986d[_0xcbbb('0x31')]=_['map'](_0x26c05e,_0xcbbb('0x28'));_0x1c986d[_0xcbbb('0x32')]=_['keys'](_0x372024[_0xcbbb('0x32')]);_0x1c986d['filters']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],_0x1c986d[_0xcbbb('0x32')]);_0x3d4c0d['attributes']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x3d4c0d[_0xcbbb('0x35')]=_0x3d4c0d[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x3d4c0d[_0xcbbb('0x35')]:_0x1c986d[_0xcbbb('0x31')];if(!_0x372024['query']['hasOwnProperty']('nolimit')){_0x3d4c0d['limit']=qs[_0xcbbb('0x1f')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1f')]);_0x3d4c0d[_0xcbbb('0x1c')]=qs[_0xcbbb('0x1c')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1c')]);}_0x3d4c0d[_0xcbbb('0x37')]=qs[_0xcbbb('0x38')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x38')]);_0x3d4c0d[_0xcbbb('0x39')]=qs['filters'](_['pick'](_0x372024[_0xcbbb('0x32')],_0x1c986d['filters']),_0x26c05e);if(_0x372024['query']['filter']){_0x3d4c0d[_0xcbbb('0x39')]=_[_0xcbbb('0x3a')](_0x3d4c0d[_0xcbbb('0x39')],{'$or':_[_0xcbbb('0x2b')](_0x26c05e,function(_0x38e59d){if(_0x38e59d[_0xcbbb('0x2f')]!==_0xcbbb('0x3b')){var _0x14c1a2={};_0x14c1a2[_0x38e59d[_0xcbbb('0x28')]]={'$like':'%'+_0x372024[_0xcbbb('0x32')][_0xcbbb('0x3c')]+'%'};return _0x14c1a2;}})});}_0x3d4c0d=_['merge']({},_0x3d4c0d,_0x372024[_0xcbbb('0x3d')]);var _0x55d349={'where':_0x3d4c0d[_0xcbbb('0x39')]};return db[_0xcbbb('0x2c')][_0xcbbb('0x1e')](_0x55d349)[_0xcbbb('0x25')](function(_0x433065){_0x2a023f[_0xcbbb('0x1e')]=_0x433065;if(_0x372024['query']['includeAll']){_0x3d4c0d['include']=[{'all':!![]}];}return db[_0xcbbb('0x2c')][_0xcbbb('0x3e')](_0x3d4c0d);})[_0xcbbb('0x25')](function(_0x162979){_0x2a023f[_0xcbbb('0x3f')]=_0x162979;return _0x2a023f;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x39ba8b,_0x3d4c0d))[_0xcbbb('0x40')](handleError(_0x39ba8b,null));};exports['show']=function(_0x1a7799,_0x22076a){var _0x5550d2={'raw':!![],'where':{'id':_0x1a7799[_0xcbbb('0x41')]['id']}},_0x15b3bc={};_0x15b3bc[_0xcbbb('0x31')]=_[_0xcbbb('0x42')](db[_0xcbbb('0x2c')]['rawAttributes']);_0x15b3bc[_0xcbbb('0x32')]=_['keys'](_0x1a7799['query']);_0x15b3bc[_0xcbbb('0x43')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],_0x15b3bc[_0xcbbb('0x32')]);_0x5550d2[_0xcbbb('0x35')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x5550d2[_0xcbbb('0x35')]=_0x5550d2[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x5550d2[_0xcbbb('0x35')]:_0x15b3bc['model'];if(_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x44')]){_0x5550d2[_0xcbbb('0x45')]=[{'all':!![]}];}_0x5550d2=_[_0xcbbb('0x3a')]({},_0x5550d2,_0x1a7799['options']);return db['WhatsappApplication']['find'](_0x5550d2)[_0xcbbb('0x25')](handleEntityNotFound(_0x22076a,null))[_0xcbbb('0x25')](respondWithResult(_0x22076a,null))[_0xcbbb('0x40')](handleError(_0x22076a,null));};exports[_0xcbbb('0x46')]=function(_0x146f37,_0x1ef25b){return db[_0xcbbb('0x2c')]['create'](_0x146f37[_0xcbbb('0x47')],{})[_0xcbbb('0x25')](respondWithResult(_0x1ef25b,0xc9))[_0xcbbb('0x40')](handleError(_0x1ef25b,null));};exports[_0xcbbb('0x24')]=function(_0x478c22,_0x3378cd){if(_0x478c22[_0xcbbb('0x47')]['id']){delete _0x478c22[_0xcbbb('0x47')]['id'];}return db[_0xcbbb('0x2c')]['find']({'where':{'id':_0x478c22['params']['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3378cd,null))[_0xcbbb('0x25')](saveUpdates(_0x478c22[_0xcbbb('0x47')],null))['then'](respondWithResult(_0x3378cd,null))['catch'](handleError(_0x3378cd,null));};exports['destroy']=function(_0x189a40,_0x3070d9){return db['WhatsappApplication'][_0xcbbb('0x48')]({'where':{'id':_0x189a40[_0xcbbb('0x41')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3070d9,null))[_0xcbbb('0x25')](removeEntity(_0x3070d9,null))['catch'](handleError(_0x3070d9,null));};
\ No newline at end of file
+var _0xd117=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','WhatsappApplication','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length'];(function(_0x51d210,_0x4bc969){var _0x2f2c42=function(_0x2c7fb8){while(--_0x2c7fb8){_0x51d210['push'](_0x51d210['shift']());}};_0x2f2c42(++_0x4bc969);}(_0xd117,0x182));var _0x7d11=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0xd117[_0x221b8c];return _0x3fab9f;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['WhatsappApplication'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};
\ No newline at end of file
index 4ef176c..1857561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e3=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x197915,_0x30a823){var _0x3d238d=function(_0x1f722e){while(--_0x1f722e){_0x197915['push'](_0x197915['shift']());}};_0x3d238d(++_0x30a823);}(_0x28e3,0x106));var _0x328e=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x28e3[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var logger=require(_0x328e('0x2'))(_0x328e('0x3'));var moment=require('moment');var BPromise=require(_0x328e('0x4'));var rp=require(_0x328e('0x5'));var fs=require('fs');var path=require(_0x328e('0x6'));var rimraf=require(_0x328e('0x7'));var config=require(_0x328e('0x8'));var attributes=require(_0x328e('0x9'));module[_0x328e('0xa')]=function(_0x439182,_0x5e5bcf){return _0x439182['define']('WhatsappApplication',attributes,{'tableName':_0x328e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x328e('0xc'),'collate':_0x328e('0xd')});};
\ No newline at end of file
+var _0xa566=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','whatsapp_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x7be9eb,_0xb2944e){var _0x279801=function(_0x39438c){while(--_0x39438c){_0x7be9eb['push'](_0x7be9eb['shift']());}};_0x279801(++_0xb2944e);}(_0xa566,0x1c1));var _0x6a56=function(_0x334684,_0x34cfa8){_0x334684=_0x334684-0x0;var _0x461673=_0xa566[_0x334684];return _0x461673;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var logger=require(_0x6a56('0x2'))('api');var moment=require(_0x6a56('0x3'));var BPromise=require(_0x6a56('0x4'));var rp=require(_0x6a56('0x5'));var fs=require('fs');var path=require(_0x6a56('0x6'));var rimraf=require('rimraf');var config=require(_0x6a56('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x4c58b0,_0x47ecb8){return _0x4c58b0[_0x6a56('0x8')]('WhatsappApplication',attributes,{'tableName':_0x6a56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6a56('0xa')});};
\ No newline at end of file
index ddb3fa9..b71928f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x34750e,_0x3c3d3b){var _0x36760a=function(_0x40064c){while(--_0x40064c){_0x34750e['push'](_0x34750e['shift']());}};_0x36760a(++_0x3c3d3b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x4b84[_0x2defb5];return _0x229c53;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}
\ No newline at end of file
+var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2555fd,_0x35f271){var _0x264af5=function(_0x5fde8b){while(--_0x5fde8b){_0x2555fd['push'](_0x2555fd['shift']());}};_0x264af5(++_0x35f271);}(_0x70e0,0x17b));var _0x070e=function(_0x59f9f9,_0x54194a){_0x59f9f9=_0x59f9f9-0x0;var _0x81cf69=_0x70e0[_0x59f9f9];return _0x81cf69;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\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 a48a5c6..29efbeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8506=['addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp'];(function(_0x1b1cbf,_0x1fc200){var _0x372b04=function(_0x4be4d3){while(--_0x4be4d3){_0x1b1cbf['push'](_0x1b1cbf['shift']());}};_0x372b04(++_0x1fc200);}(_0x8506,0xe8));var _0x6850=function(_0x129610,_0x129131){_0x129610=_0x129610-0x0;var _0x2e1acd=_0x8506[_0x129610];return _0x2e1acd;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6850('0x3'));var interaction=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x6850('0x6')]('/',auth[_0x6850('0x7')](),controller[_0x6850('0x8')]);router[_0x6850('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6850('0x6')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller['show']);router['get'](_0x6850('0xa'),auth[_0x6850('0x7')](),controller[_0x6850('0xb')]);router[_0x6850('0x6')](_0x6850('0xc'),auth['isAuthenticated'](),controller[_0x6850('0xd')]);router[_0x6850('0xe')]('/',auth[_0x6850('0x7')](),controller[_0x6850('0xf')]);router[_0x6850('0xe')](_0x6850('0xa'),auth['isAuthenticated'](),controller[_0x6850('0x10')]);router[_0x6850('0xe')](_0x6850('0x11'),auth[_0x6850('0x7')](),interaction[_0x6850('0x12')](_0x6850('0x13'),'whatsappinteraction:addtags'),controller[_0x6850('0x14')]);router['put'](_0x6850('0x9'),auth[_0x6850('0x7')](),interaction[_0x6850('0x12')](_0x6850('0x13'),_0x6850('0x15')),controller[_0x6850('0x16')]);router[_0x6850('0x17')](_0x6850('0x9'),auth[_0x6850('0x7')](),interaction[_0x6850('0x12')](_0x6850('0x13'),_0x6850('0x18')),controller[_0x6850('0x19')]);router[_0x6850('0x17')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6850('0x1a')]);module[_0x6850('0x1b')]=router;
\ No newline at end of file
+var _0x8d0a=['whatsappinteraction:addtags','put','tracked','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','whatsapp'];(function(_0x5a87fb,_0x2c2d6d){var _0x5c1ac5=function(_0x23183c){while(--_0x23183c){_0x5a87fb['push'](_0x5a87fb['shift']());}};_0x5c1ac5(++_0x2c2d6d);}(_0x8d0a,0x65));var _0xa8d0=function(_0x2d96e7,_0x352984){_0x2d96e7=_0x2d96e7-0x0;var _0x15d083=_0x8d0a[_0x2d96e7];return _0x15d083;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['describe']);router['get'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller['show']);router['get']('/:id/messages',auth[_0xa8d0('0xa')](),controller['getMessages']);router[_0xa8d0('0xc')](_0xa8d0('0xf'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')]('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x12')]);router[_0xa8d0('0x11')](_0xa8d0('0x13'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x14')]);router['post'](_0xa8d0('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xa8d0('0x16'),_0xa8d0('0x17')),controller['addTags']);router[_0xa8d0('0x18')](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),interaction[_0xa8d0('0x19')](_0xa8d0('0x16'),_0xa8d0('0x1a')),controller['update']);router[_0xa8d0('0x1b')](_0xa8d0('0xe'),auth['isAuthenticated'](),interaction[_0xa8d0('0x19')](_0xa8d0('0x16'),'whatsappinteraction:destroy'),controller[_0xa8d0('0x1c')]);router[_0xa8d0('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa8d0('0x1d')]);module[_0xa8d0('0x1e')]=router;
\ No newline at end of file
index 98edb6b..20e6f26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31af=['exports','STRING','DATE','out','ENUM','sequelize','moment'];(function(_0x365f2c,_0x606a61){var _0x4b49bc=function(_0x4156d0){while(--_0x4156d0){_0x365f2c['push'](_0x365f2c['shift']());}};_0x4b49bc(++_0x606a61);}(_0x31af,0xde));var _0xf31a=function(_0x1095c2,_0x2c0d3b){_0x1095c2=_0x1095c2-0x0;var _0x1733d6=_0x31af[_0x1095c2];return _0x1733d6;};'use strict';var Sequelize=require(_0xf31a('0x0'));var moment=require(_0xf31a('0x1'));module[_0xf31a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf31a('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf31a('0x3')]},'note':{'type':Sequelize[_0xf31a('0x3')]},'phone':{'type':Sequelize[_0xf31a('0x3')]},'read1stAt':{'type':Sequelize[_0xf31a('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf31a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf31a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf31a('0x6')]('in',_0xf31a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xab86=['exports','STRING','DATE','ENUM','out','BOOLEAN','sequelize','moment'];(function(_0x592ef3,_0x4da198){var _0x277182=function(_0x227af7){while(--_0x227af7){_0x592ef3['push'](_0x592ef3['shift']());}};_0x277182(++_0x4da198);}(_0xab86,0x13e));var _0x6ab8=function(_0x5ee8f9,_0x5e8985){_0x5ee8f9=_0x5ee8f9-0x0;var _0x535be5=_0xab86[_0x5ee8f9];return _0x535be5;};'use strict';var Sequelize=require(_0x6ab8('0x0'));var moment=require(_0x6ab8('0x1'));module[_0x6ab8('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6ab8('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6ab8('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x6ab8('0x3')]},'read1stAt':{'type':Sequelize[_0x6ab8('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6ab8('0x5')]('in',_0x6ab8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6ab8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6ab8('0x5')]('in',_0x6ab8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6ab8('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 1fb0828..5e9975b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5fc=['limit','count','set','Content-Range','then','stack','name','index','map','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','query','user','catch','show','model','keys','intersection','fields','attributes','length','include','create','body','update','find','params','destroy','describe','addMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','order','sort','where','WhatsappInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','WhatsappMessage','includeAll','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','Account','get','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','System','Contact','read','value','renderFile','views','downloadInteraction.ejs','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','sendStatus','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','register','status','end','json','offset'];(function(_0x2577e7,_0x2a4097){var _0x2fcd88=function(_0x13b00d){while(--_0x13b00d){_0x2577e7['push'](_0x2577e7['shift']());}};_0x2fcd88(++_0x2a4097);}(_0xb5fc,0x1e9));var _0xcb5f=function(_0x6125fc,_0x288220){_0x6125fc=_0x6125fc-0x0;var _0x214e62=_0xb5fc[_0x6125fc];return _0x214e62;};'use strict';var rimraf=require(_0xcb5f('0x0'));var zipdir=require('zip-dir');var moment=require(_0xcb5f('0x1'));var BPromise=require('bluebird');var util=require(_0xcb5f('0x2'));var path=require(_0xcb5f('0x3'));var ejs=require(_0xcb5f('0x4'));var fs=require('fs');var _=require(_0xcb5f('0x5'));var Redis=require(_0xcb5f('0x6'));var interaction=require(_0xcb5f('0x7'));var qs=require(_0xcb5f('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xcb5f('0x9'))(_0xcb5f('0xa'));var config=require('../../config/environment');var db=require(_0xcb5f('0xb'))['db'];config[_0xcb5f('0xc')]=_[_0xcb5f('0xd')](config[_0xcb5f('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xcb5f('0xe')](socket);function respondWithStatusCode(_0x2014df,_0x4990d0){_0x4990d0=_0x4990d0||0xcc;return function(_0x4f0b02){if(_0x4f0b02){return _0x2014df['sendStatus'](_0x4990d0);}return _0x2014df[_0xcb5f('0xf')](_0x4990d0)[_0xcb5f('0x10')]();};}function respondWithResult(_0x9eb078,_0x5c3ff1){_0x5c3ff1=_0x5c3ff1||0xc8;return function(_0x53d5d8){if(_0x53d5d8){return _0x9eb078[_0xcb5f('0xf')](_0x5c3ff1)[_0xcb5f('0x11')](_0x53d5d8);}};}function respondWithFilteredResult(_0x16e27a,_0x4fc2ba){return function(_0x3a050c){if(_0x3a050c){var _0x4df085=typeof _0x4fc2ba[_0xcb5f('0x12')]==='undefined'&&typeof _0x4fc2ba[_0xcb5f('0x13')]==='undefined';var _0x43642c=_0x3a050c['count'];var _0x3b359b=_0x4df085?0x0:_0x4fc2ba['offset'];var _0x38c94d=_0x4df085?_0x3a050c[_0xcb5f('0x14')]:_0x4fc2ba[_0xcb5f('0x12')]+_0x4fc2ba[_0xcb5f('0x13')];var _0x22ec72;if(_0x38c94d>=_0x43642c){_0x38c94d=_0x43642c;_0x22ec72=0xc8;}else{_0x22ec72=0xce;}_0x16e27a[_0xcb5f('0xf')](_0x22ec72);return _0x16e27a[_0xcb5f('0x15')](_0xcb5f('0x16'),_0x3b359b+'-'+_0x38c94d+'/'+_0x43642c)[_0xcb5f('0x11')](_0x3a050c);}return null;};}function saveUpdates(_0x467a6b){return function(_0x24386b){if(_0x24386b){return _0x24386b['update'](_0x467a6b)[_0xcb5f('0x17')](function(_0x1f9ea3){return _0x1f9ea3;});}return null;};}function removeEntity(_0x4419a1){return function(_0x367b89){if(_0x367b89){return _0x367b89['destroy']()['then'](function(){_0x4419a1[_0xcb5f('0xf')](0xcc)[_0xcb5f('0x10')]();});}};}function handleEntityNotFound(_0x4b9a45){return function(_0x37a9b1){if(!_0x37a9b1){_0x4b9a45['sendStatus'](0x194);}return _0x37a9b1;};}function handleError(_0x39c675,_0x2972fd){_0x2972fd=_0x2972fd||0x1f4;return function(_0x2824d1){logger['error'](_0x2824d1[_0xcb5f('0x18')]);if(_0x2824d1['name']){delete _0x2824d1[_0xcb5f('0x19')];}_0x39c675['status'](_0x2972fd)['send'](_0x2824d1);};}exports[_0xcb5f('0x1a')]=function(_0x571c9,_0x8a5c9a){var _0x45c457={};var _0x2243ec=_[_0xcb5f('0x1b')](db[_0xcb5f('0x1c')][_0xcb5f('0x1d')],function(_0xb0b5dd){return{'name':_0xb0b5dd[_0xcb5f('0x1e')],'type':_0xb0b5dd['type'][_0xcb5f('0x1f')]};});_0x45c457=qs[_0xcb5f('0x20')](_0x2243ec,_0x571c9);return interaction[_0xcb5f('0x21')]('whatsapp',_0x571c9[_0xcb5f('0x22')],_0x571c9[_0xcb5f('0x23')],_0x45c457,_0x2243ec)[_0xcb5f('0x17')](respondWithFilteredResult(_0x8a5c9a,_0x45c457))[_0xcb5f('0x24')](handleError(_0x8a5c9a,null));};exports[_0xcb5f('0x25')]=function(_0x457709,_0x258cf2){var _0x33b00c={'raw':![],'where':{'id':_0x457709['params']['id']}},_0x5bfe8b={};_0x5bfe8b[_0xcb5f('0x26')]=_[_0xcb5f('0x27')](db[_0xcb5f('0x1c')]['rawAttributes']);_0x5bfe8b['query']=_[_0xcb5f('0x27')](_0x457709[_0xcb5f('0x22')]);_0x5bfe8b['filters']=_[_0xcb5f('0x28')](_0x5bfe8b[_0xcb5f('0x26')],_0x5bfe8b[_0xcb5f('0x22')]);_0x33b00c['attributes']=_[_0xcb5f('0x28')](_0x5bfe8b['model'],qs[_0xcb5f('0x29')](_0x457709[_0xcb5f('0x22')][_0xcb5f('0x29')]));_0x33b00c['attributes']=_0x33b00c[_0xcb5f('0x2a')][_0xcb5f('0x2b')]?_0x33b00c[_0xcb5f('0x2a')]:_0x5bfe8b[_0xcb5f('0x26')];if(_0x457709[_0xcb5f('0x22')]['includeAll']){_0x33b00c[_0xcb5f('0x2c')]=[{'all':!![]}];}_0x33b00c=_['merge']({},_0x33b00c,_0x457709['options']);return db[_0xcb5f('0x1c')]['find'](_0x33b00c)[_0xcb5f('0x17')](handleEntityNotFound(_0x258cf2,null))[_0xcb5f('0x17')](respondWithResult(_0x258cf2,null))[_0xcb5f('0x24')](handleError(_0x258cf2,null));};exports[_0xcb5f('0x2d')]=function(_0x17ac08,_0x21f61a){return db['WhatsappInteraction'][_0xcb5f('0x2d')](_0x17ac08[_0xcb5f('0x2e')],{})['then'](respondWithResult(_0x21f61a,0xc9))[_0xcb5f('0x24')](handleError(_0x21f61a,null));};exports[_0xcb5f('0x2f')]=function(_0x2e9a56,_0xf39172){if(_0x2e9a56[_0xcb5f('0x2e')]['id']){delete _0x2e9a56[_0xcb5f('0x2e')]['id'];}return db['WhatsappInteraction'][_0xcb5f('0x30')]({'where':{'id':_0x2e9a56[_0xcb5f('0x31')]['id']}})[_0xcb5f('0x17')](handleEntityNotFound(_0xf39172,null))['then'](saveUpdates(_0x2e9a56[_0xcb5f('0x2e')],null))[_0xcb5f('0x17')](respondWithResult(_0xf39172,null))[_0xcb5f('0x24')](handleError(_0xf39172,null));};exports[_0xcb5f('0x32')]=function(_0x4add3e,_0x16c017){return db[_0xcb5f('0x1c')][_0xcb5f('0x30')]({'where':{'id':_0x4add3e[_0xcb5f('0x31')]['id']}})['then'](handleEntityNotFound(_0x16c017,null))[_0xcb5f('0x17')](removeEntity(_0x16c017,null))['catch'](handleError(_0x16c017,null));};exports[_0xcb5f('0x33')]=function(_0x1919b0,_0x76dc87){return db[_0xcb5f('0x1c')]['describe']()[_0xcb5f('0x17')](respondWithResult(_0x76dc87,null))['catch'](handleError(_0x76dc87,null));};exports['addMessage']=function(_0x3b2c3a,_0x6a0686){return db['WhatsappMessage'][_0xcb5f('0x30')]({'where':{'id':_0x3b2c3a[_0xcb5f('0x31')]['id']}})[_0xcb5f('0x17')](handleEntityNotFound(_0x6a0686,null))[_0xcb5f('0x17')](function(_0xd423b7){if(_0xd423b7){return _0xd423b7[_0xcb5f('0x34')](_0x3b2c3a[_0xcb5f('0x2e')][_0xcb5f('0x35')],_[_0xcb5f('0x36')](_0x3b2c3a[_0xcb5f('0x2e')],[_0xcb5f('0x35'),'id'])||{});}})[_0xcb5f('0x17')](respondWithResult(_0x6a0686,null))[_0xcb5f('0x24')](handleError(_0x6a0686,null));};exports[_0xcb5f('0x37')]=function(_0x3ce69e,_0x1d647d){var _0x14da9b={'raw':![],'where':{}};var _0x3e3870={};var _0x3c728b={'count':0x0,'rows':[]};return db[_0xcb5f('0x1c')][_0xcb5f('0x38')]({'where':{'id':_0x3ce69e[_0xcb5f('0x31')]['id']}})[_0xcb5f('0x17')](handleEntityNotFound(_0x1d647d,null))[_0xcb5f('0x17')](function(_0x30ab62){if(_0x30ab62){_0x3e3870[_0xcb5f('0x26')]=_[_0xcb5f('0x27')](db['WhatsappMessage'][_0xcb5f('0x1d')]);_0x3e3870['query']=_[_0xcb5f('0x27')](_0x3ce69e[_0xcb5f('0x22')]);_0x3e3870[_0xcb5f('0x39')]=_['intersection'](_0x3e3870[_0xcb5f('0x26')],_0x3e3870[_0xcb5f('0x22')]);_0x14da9b['attributes']=_[_0xcb5f('0x28')](_0x3e3870[_0xcb5f('0x26')],qs['fields'](_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x29')]));_0x14da9b[_0xcb5f('0x2a')]=_0x14da9b[_0xcb5f('0x2a')][_0xcb5f('0x2b')]?_0x14da9b[_0xcb5f('0x2a')]:_0x3e3870[_0xcb5f('0x26')];if(!_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x3a')]('nolimit')){_0x14da9b[_0xcb5f('0x13')]=qs[_0xcb5f('0x13')](_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x13')]);_0x14da9b['offset']=qs['offset'](_0x3ce69e[_0xcb5f('0x22')]['offset']);}_0x14da9b[_0xcb5f('0x3b')]=qs['sort'](_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x3c')]);_0x14da9b[_0xcb5f('0x3d')]=qs[_0xcb5f('0x39')](_['pick'](_0x3ce69e[_0xcb5f('0x22')],_0x3e3870['filters']));_0x14da9b[_0xcb5f('0x3d')][_0xcb5f('0x3e')]=_0x30ab62['id'];if(_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x3f')]){_0x14da9b[_0xcb5f('0x3d')]=_[_0xcb5f('0x40')](_0x14da9b[_0xcb5f('0x3d')],{'$or':_['map'](_0x14da9b['attributes'],function(_0x2c8e8c){var _0x3d8282={};_0x3d8282[_0x2c8e8c]={'$like':'%'+_0x3ce69e['query']['filter']+'%'};return _0x3d8282;})});}if(_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x41')]){var _0x419211=_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x41')]['split'](',');var _0x2aac22={};_0x2aac22[_0x419211[0x0]]={'$gte':moment(_0x419211[0x1])[_0xcb5f('0x42')](_0xcb5f('0x43'))};_0x14da9b[_0xcb5f('0x3d')]=_[_0xcb5f('0x40')](_0x14da9b['where'],_0x2aac22);}_0x14da9b=_[_0xcb5f('0x40')]({},_0x14da9b,_0x3ce69e[_0xcb5f('0x44')]);return db[_0xcb5f('0x45')][_0xcb5f('0x14')]({'where':_0x14da9b['where']})[_0xcb5f('0x17')](function(_0x2746cf){_0x3c728b[_0xcb5f('0x14')]=_0x2746cf;if(_0x3ce69e[_0xcb5f('0x22')][_0xcb5f('0x46')]){_0x14da9b[_0xcb5f('0x2c')]=[{'all':!![]}];}return db[_0xcb5f('0x45')][_0xcb5f('0x21')](_0x14da9b);})['then'](function(_0x694f3d){_0x3c728b[_0xcb5f('0x47')]=_0x694f3d;return _0x3c728b;});}})[_0xcb5f('0x17')](respondWithFilteredResult(_0x1d647d,_0x14da9b))[_0xcb5f('0x24')](handleError(_0x1d647d,null));};exports[_0xcb5f('0x48')]=function(_0xa790d2,_0x58b220){return db['WhatsappInteraction']['find']({'where':{'id':_0xa790d2[_0xcb5f('0x31')]['id']}})['then'](handleEntityNotFound(_0x58b220,null))[_0xcb5f('0x17')](function(_0x1d1039){if(_0x1d1039){return _0x1d1039[_0xcb5f('0x49')](_0xa790d2[_0xcb5f('0x2e')]['ids'],_[_0xcb5f('0x36')](_0xa790d2[_0xcb5f('0x2e')],['ids','id'])||{})[_0xcb5f('0x4a')](function(){return db[_0xcb5f('0x4b')][_0xcb5f('0x21')]({'attributes':['id','name',_0xcb5f('0x4c')],'where':{'id':_0xa790d2['body'][_0xcb5f('0x35')]}});})['then'](function(_0x413e6f){socket[_0xcb5f('0x4d')](_0xcb5f('0x4e'),{'id':Number(_0xa790d2[_0xcb5f('0x31')]['id']),'tags':_0x413e6f||[]});return{'id':Number(_0xa790d2[_0xcb5f('0x31')]['id']),'tags':_0x413e6f||[]};});}})['then'](respondWithResult(_0x58b220,null))['catch'](handleError(_0x58b220,null));};exports[_0xcb5f('0x4f')]=function(_0x933cf9,_0x1e9a98){return db['WhatsappInteraction']['find']({'where':{'id':_0x933cf9['params']['id']}})[_0xcb5f('0x17')](handleEntityNotFound(_0x1e9a98,null))['then'](function(_0x48fa1b){if(_0x48fa1b){return _0x48fa1b[_0xcb5f('0x4f')](_0x933cf9['query'][_0xcb5f('0x35')]);}})['then'](respondWithStatusCode(_0x1e9a98,null))[_0xcb5f('0x24')](handleError(_0x1e9a98,null));};exports[_0xcb5f('0x50')]=function(_0x293bc7,_0x1642c0){var _0x4c1791=moment()[_0xcb5f('0x51')]()[_0xcb5f('0x52')]();var _0x3666fd=path[_0xcb5f('0x53')](config[_0xcb5f('0x54')],_0xcb5f('0x55'),_0xcb5f('0x56'),_0xcb5f('0x57'));var _0x1c3cf6=path['join'](config[_0xcb5f('0x54')],_0xcb5f('0x55'),'files',_0xcb5f('0x58'));var _0x2c454=path['join'](_0x3666fd,_0x4c1791);var _0x451034=util[_0xcb5f('0x42')](_0xcb5f('0x59'),_0x293bc7[_0xcb5f('0x31')]['id'],_0x4c1791);var _0x504fd3=path[_0xcb5f('0x53')](_0x3666fd,_0x451034);var _0x2b63ae=[];_0x2b63ae['push']({'model':db[_0xcb5f('0x5a')],'as':_0xcb5f('0x5a'),'attributes':['id',_0xcb5f('0x5b')],'raw':!![]});_0x2b63ae[_0xcb5f('0x5c')]({'model':db[_0xcb5f('0x5d')],'as':'Contact','attributes':['id',_0xcb5f('0x5e'),_0xcb5f('0x5f')],'raw':!![]});if(_0x293bc7[_0xcb5f('0x22')][_0xcb5f('0x58')]){_0x2b63ae[_0xcb5f('0x5c')]({'model':db['Attachment'],'as':_0xcb5f('0x60'),'raw':!![]});}var _0x46ee15=[{'model':db['WhatsappMessage'],'as':_0xcb5f('0x61'),'attributes':['id',_0xcb5f('0x2e'),_0xcb5f('0x62'),_0xcb5f('0x63'),_0xcb5f('0x64'),'read'],'include':_0x2b63ae}];_0x46ee15[_0xcb5f('0x5c')]({'model':db['WhatsappAccount'],'as':_0xcb5f('0x65'),'attributes':['id',_0xcb5f('0x19')]});_0x46ee15[_0xcb5f('0x5c')]({'model':db[_0xcb5f('0x5a')],'as':'Owner','attributes':['id','fullname']});return db[_0xcb5f('0x1c')][_0xcb5f('0x30')]({'where':{'id':_0x293bc7['params']['id']},'include':_0x46ee15})[_0xcb5f('0x17')](handleEntityNotFound(_0x1642c0,null))[_0xcb5f('0x17')](function(_0x272a5b){if(_0x272a5b){var _0x44b86f=_0x272a5b[_0xcb5f('0x66')]({'plain':!![]});fs['mkdirSync'](_0x2c454);var _0x3fece2={'channel':'Whatsapp','account':_0x44b86f[_0xcb5f('0x65')][_0xcb5f('0x19')],'agent':_0x44b86f[_0xcb5f('0x67')]?_0x44b86f[_0xcb5f('0x67')][_0xcb5f('0x5b')]:_0xcb5f('0x68'),'createdAt':moment(_0x44b86f[_0xcb5f('0x62')])['format'](_0xcb5f('0x43'))[_0xcb5f('0x52')](),'closedAt':_0x44b86f[_0xcb5f('0x69')]?moment(_0x44b86f[_0xcb5f('0x6a')])['format'](_0xcb5f('0x43'))[_0xcb5f('0x52')]():'','disposition':_0x44b86f[_0xcb5f('0x6b')],'messages':_(_0x44b86f[_0xcb5f('0x61')])[_0xcb5f('0x3f')]({'secret':![]})['map'](function(_0x3e0d8b){if(_0x3e0d8b[_0xcb5f('0x60')]){var _0x1b93dd=path[_0xcb5f('0x53')](_0x1c3cf6,_0x3e0d8b[_0xcb5f('0x60')][_0xcb5f('0x6c')]);if(fs[_0xcb5f('0x6d')](_0x1b93dd)){fs['createReadStream'](_0x1b93dd)[_0xcb5f('0x6e')](fs[_0xcb5f('0x6f')](path[_0xcb5f('0x53')](_0x2c454,_0x3e0d8b[_0xcb5f('0x60')][_0xcb5f('0x6c')])));}}return{'date':moment(_0x3e0d8b[_0xcb5f('0x62')])[_0xcb5f('0x42')](_0xcb5f('0x43'))['toString'](),'sender':_0x3e0d8b[_0xcb5f('0x63')]===_0xcb5f('0x70')?_0x3e0d8b[_0xcb5f('0x5a')]?_0x3e0d8b['User'][_0xcb5f('0x5b')]:_0xcb5f('0x71'):_0x3e0d8b[_0xcb5f('0x72')][_0xcb5f('0x5e')]+(_0x3e0d8b[_0xcb5f('0x72')][_0xcb5f('0x5f')]?'\x20'+_0x3e0d8b['Contact'][_0xcb5f('0x5f')]:''),'body':_0x3e0d8b[_0xcb5f('0x60')]?_0x3e0d8b['Attachment'][_0xcb5f('0x6c')]:_0x3e0d8b[_0xcb5f('0x2e')],'direction':_0x3e0d8b[_0xcb5f('0x63')]===_0xcb5f('0x70')?'A':'C','secret':_0x3e0d8b['secret'],'read':_0x3e0d8b[_0xcb5f('0x73')],'attachment':_0x3e0d8b[_0xcb5f('0x60')]};})[_0xcb5f('0x74')]()};return ejs[_0xcb5f('0x75')](path[_0xcb5f('0x53')](config['root'],_0xcb5f('0x55'),_0xcb5f('0x76'),_0xcb5f('0x77')),{'interaction':_0x3fece2})['then'](function(_0x2f69b9){var _0x3d941c=path['join'](_0x2c454,'transcript-'+_0x44b86f['id']+'-'+_0x4c1791+_0xcb5f('0x78'));var _0x4c5ed5={'path':_0x3d941c,'channel':_0xcb5f('0x79'),'interactionId':_0x44b86f['id']};return pdf[_0xcb5f('0x7a')](_0x2f69b9,_0x4c5ed5);})['then'](function(){return new BPromise(function(_0x17b7f1,_0x34e268){zipdir(_0x2c454,{'saveTo':_0x504fd3},function(_0x578d12,_0x211792){if(_0x578d12)return _0x34e268(_0x578d12);return _0x17b7f1(_0x211792);});})['then'](function(){return new BPromise(function(_0x29209e,_0x5bb7c9){rimraf(_0x2c454,function(_0x205b45){if(_0x205b45)_0x5bb7c9(_0x205b45);return _0x29209e();});});})['then'](function(){return _0x1642c0[_0xcb5f('0x50')](_0x504fd3,_0x451034,function(_0x32bd56){if(_0x32bd56){console[_0xcb5f('0x7b')](_0xcb5f('0x7c'),_0x32bd56);}else{fs[_0xcb5f('0x7d')](_0x504fd3);}});});});}else{return _0x1642c0[_0xcb5f('0x7e')](0xc8);}})['catch'](handleError(_0x1642c0,null));};
\ No newline at end of file
+var _0x1d28=['update','then','destroy','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','options','find','create','body','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','toString','join','server','files','tmp','attachments','push','User','fullname','CmContact','firstName','lastName','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closedAt','disposition','Attachment','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','basename','root','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x4d1202,_0x368bde){var _0x378415=function(_0x1f67b5){while(--_0x1f67b5){_0x4d1202['push'](_0x4d1202['shift']());}};_0x378415(++_0x368bde);}(_0x1d28,0x164));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x81d2('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x81d2('0x1'));var util=require(_0x81d2('0x2'));var path=require(_0x81d2('0x3'));var ejs=require(_0x81d2('0x4'));var fs=require('fs');var _=require(_0x81d2('0x5'));var Redis=require(_0x81d2('0x6'));var interaction=require(_0x81d2('0x7'));var qs=require(_0x81d2('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x81d2('0x9'))(_0x81d2('0xa'));var config=require(_0x81d2('0xb'));var db=require(_0x81d2('0xc'))['db'];config[_0x81d2('0xd')]=_[_0x81d2('0xe')](config['redis'],{'host':_0x81d2('0xf'),'port':0x18eb});var socket=require(_0x81d2('0x10'))(new Redis(config[_0x81d2('0xd')]));require(_0x81d2('0x11'))[_0x81d2('0x12')](socket);function respondWithStatusCode(_0x3ff846,_0x3ee37a){_0x3ee37a=_0x3ee37a||0xcc;return function(_0x1dfc41){if(_0x1dfc41){return _0x3ff846[_0x81d2('0x13')](_0x3ee37a);}return _0x3ff846[_0x81d2('0x14')](_0x3ee37a)[_0x81d2('0x15')]();};}function respondWithResult(_0x440443,_0x4521c8){_0x4521c8=_0x4521c8||0xc8;return function(_0x55452f){if(_0x55452f){return _0x440443['status'](_0x4521c8)[_0x81d2('0x16')](_0x55452f);}};}function respondWithFilteredResult(_0x2b2116,_0x578ced){return function(_0x2b41a7){if(_0x2b41a7){var _0x446e4d=typeof _0x578ced[_0x81d2('0x17')]==='undefined'&&typeof _0x578ced[_0x81d2('0x18')]===_0x81d2('0x19');var _0x1b4c19=_0x2b41a7[_0x81d2('0x1a')];var _0x49c4ba=_0x446e4d?0x0:_0x578ced[_0x81d2('0x17')];var _0x57b507=_0x446e4d?_0x2b41a7[_0x81d2('0x1a')]:_0x578ced[_0x81d2('0x17')]+_0x578ced[_0x81d2('0x18')];var _0x56f3da;if(_0x57b507>=_0x1b4c19){_0x57b507=_0x1b4c19;_0x56f3da=0xc8;}else{_0x56f3da=0xce;}_0x2b2116['status'](_0x56f3da);return _0x2b2116['set'](_0x81d2('0x1b'),_0x49c4ba+'-'+_0x57b507+'/'+_0x1b4c19)[_0x81d2('0x16')](_0x2b41a7);}return null;};}function saveUpdates(_0x376ae2){return function(_0x4ed502){if(_0x4ed502){return _0x4ed502[_0x81d2('0x1c')](_0x376ae2)[_0x81d2('0x1d')](function(_0x6c829c){return _0x6c829c;});}return null;};}function removeEntity(_0x5ebfd5){return function(_0x4a0816){if(_0x4a0816){return _0x4a0816[_0x81d2('0x1e')]()[_0x81d2('0x1d')](function(){_0x5ebfd5[_0x81d2('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271853){return function(_0x3f4ac8){if(!_0x3f4ac8){_0x271853[_0x81d2('0x13')](0x194);}return _0x3f4ac8;};}function handleError(_0x54395f,_0x3b58ae){_0x3b58ae=_0x3b58ae||0x1f4;return function(_0x573b36){logger[_0x81d2('0x1f')](_0x573b36[_0x81d2('0x20')]);if(_0x573b36[_0x81d2('0x21')]){delete _0x573b36['name'];}_0x54395f[_0x81d2('0x14')](_0x3b58ae)[_0x81d2('0x22')](_0x573b36);};}exports['index']=function(_0x144077,_0x3be692){var _0x2f2686={};var _0x34c0ef=_[_0x81d2('0x23')](db[_0x81d2('0x24')][_0x81d2('0x25')],function(_0x415e31){return{'name':_0x415e31[_0x81d2('0x26')],'type':_0x415e31[_0x81d2('0x27')][_0x81d2('0x28')]};});_0x2f2686=qs[_0x81d2('0x29')](_0x34c0ef,_0x144077);return interaction[_0x81d2('0x2a')](_0x81d2('0x2b'),_0x144077[_0x81d2('0x2c')],_0x144077[_0x81d2('0x2d')],_0x2f2686,_0x34c0ef)[_0x81d2('0x1d')](respondWithFilteredResult(_0x3be692,_0x2f2686))[_0x81d2('0x2e')](handleError(_0x3be692,null));};exports[_0x81d2('0x2f')]=function(_0x822fc6,_0x2a187a){var _0x391865={'raw':![],'where':{'id':_0x822fc6[_0x81d2('0x30')]['id']}},_0x47967c={};_0x47967c[_0x81d2('0x31')]=_[_0x81d2('0x32')](db[_0x81d2('0x24')]['rawAttributes']);_0x47967c['query']=_[_0x81d2('0x32')](_0x822fc6['query']);_0x47967c[_0x81d2('0x33')]=_['intersection'](_0x47967c[_0x81d2('0x31')],_0x47967c[_0x81d2('0x2c')]);_0x391865['attributes']=_[_0x81d2('0x34')](_0x47967c[_0x81d2('0x31')],qs['fields'](_0x822fc6[_0x81d2('0x2c')][_0x81d2('0x35')]));_0x391865[_0x81d2('0x36')]=_0x391865[_0x81d2('0x36')]['length']?_0x391865[_0x81d2('0x36')]:_0x47967c[_0x81d2('0x31')];if(_0x822fc6[_0x81d2('0x2c')][_0x81d2('0x37')]){_0x391865[_0x81d2('0x38')]=[{'all':!![]}];}_0x391865=_['merge']({},_0x391865,_0x822fc6[_0x81d2('0x39')]);return db[_0x81d2('0x24')][_0x81d2('0x3a')](_0x391865)[_0x81d2('0x1d')](handleEntityNotFound(_0x2a187a,null))['then'](respondWithResult(_0x2a187a,null))[_0x81d2('0x2e')](handleError(_0x2a187a,null));};exports['create']=function(_0x531bc3,_0x50e180){return db['WhatsappInteraction'][_0x81d2('0x3b')](_0x531bc3['body'],{})[_0x81d2('0x1d')](respondWithResult(_0x50e180,0xc9))[_0x81d2('0x2e')](handleError(_0x50e180,null));};exports[_0x81d2('0x1c')]=function(_0x383265,_0x5b7d83){if(_0x383265[_0x81d2('0x3c')]['id']){delete _0x383265[_0x81d2('0x3c')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x383265['params']['id']}})[_0x81d2('0x1d')](handleEntityNotFound(_0x5b7d83,null))[_0x81d2('0x1d')](saveUpdates(_0x383265[_0x81d2('0x3c')],null))[_0x81d2('0x1d')](respondWithResult(_0x5b7d83,null))[_0x81d2('0x2e')](handleError(_0x5b7d83,null));};exports[_0x81d2('0x1e')]=function(_0x48ae20,_0x8194a2){return db[_0x81d2('0x24')][_0x81d2('0x3a')]({'where':{'id':_0x48ae20['params']['id']}})['then'](handleEntityNotFound(_0x8194a2,null))[_0x81d2('0x1d')](removeEntity(_0x8194a2,null))[_0x81d2('0x2e')](handleError(_0x8194a2,null));};exports[_0x81d2('0x3d')]=function(_0x194235,_0x86c4d){return db[_0x81d2('0x24')]['describe']()[_0x81d2('0x1d')](respondWithResult(_0x86c4d,null))[_0x81d2('0x2e')](handleError(_0x86c4d,null));};exports[_0x81d2('0x3e')]=function(_0x5c58f2,_0x4cec84){return db[_0x81d2('0x3f')][_0x81d2('0x3a')]({'where':{'id':_0x5c58f2[_0x81d2('0x30')]['id']}})[_0x81d2('0x1d')](handleEntityNotFound(_0x4cec84,null))[_0x81d2('0x1d')](function(_0x5bc60c){if(_0x5bc60c){return _0x5bc60c[_0x81d2('0x3e')](_0x5c58f2[_0x81d2('0x3c')]['ids'],_[_0x81d2('0x40')](_0x5c58f2[_0x81d2('0x3c')],[_0x81d2('0x41'),'id'])||{});}})[_0x81d2('0x1d')](respondWithResult(_0x4cec84,null))[_0x81d2('0x2e')](handleError(_0x4cec84,null));};exports[_0x81d2('0x42')]=function(_0x2cc909,_0x360f2e){var _0x398da7={'raw':![],'where':{}};var _0x1c9781={};var _0x5bb195={'count':0x0,'rows':[]};return db[_0x81d2('0x24')][_0x81d2('0x43')]({'where':{'id':_0x2cc909[_0x81d2('0x30')]['id']}})[_0x81d2('0x1d')](handleEntityNotFound(_0x360f2e,null))['then'](function(_0x46d7f1){if(_0x46d7f1){_0x1c9781[_0x81d2('0x31')]=_[_0x81d2('0x32')](db[_0x81d2('0x3f')][_0x81d2('0x25')]);_0x1c9781[_0x81d2('0x2c')]=_[_0x81d2('0x32')](_0x2cc909[_0x81d2('0x2c')]);_0x1c9781[_0x81d2('0x33')]=_['intersection'](_0x1c9781[_0x81d2('0x31')],_0x1c9781[_0x81d2('0x2c')]);_0x398da7[_0x81d2('0x36')]=_['intersection'](_0x1c9781['model'],qs[_0x81d2('0x35')](_0x2cc909['query'][_0x81d2('0x35')]));_0x398da7[_0x81d2('0x36')]=_0x398da7[_0x81d2('0x36')][_0x81d2('0x44')]?_0x398da7[_0x81d2('0x36')]:_0x1c9781['model'];if(!_0x2cc909[_0x81d2('0x2c')][_0x81d2('0x45')](_0x81d2('0x46'))){_0x398da7['limit']=qs[_0x81d2('0x18')](_0x2cc909[_0x81d2('0x2c')][_0x81d2('0x18')]);_0x398da7['offset']=qs['offset'](_0x2cc909[_0x81d2('0x2c')]['offset']);}_0x398da7[_0x81d2('0x47')]=qs['sort'](_0x2cc909[_0x81d2('0x2c')][_0x81d2('0x48')]);_0x398da7[_0x81d2('0x49')]=qs[_0x81d2('0x33')](_['pick'](_0x2cc909[_0x81d2('0x2c')],_0x1c9781[_0x81d2('0x33')]));_0x398da7[_0x81d2('0x49')]['WhatsappInteractionId']=_0x46d7f1['id'];if(_0x2cc909['query']['filter']){_0x398da7[_0x81d2('0x49')]=_[_0x81d2('0x4a')](_0x398da7[_0x81d2('0x49')],{'$or':_[_0x81d2('0x23')](_0x398da7['attributes'],function(_0x46a72c){var _0x30aef7={};_0x30aef7[_0x46a72c]={'$like':'%'+_0x2cc909['query'][_0x81d2('0x4b')]+'%'};return _0x30aef7;})});}if(_0x2cc909[_0x81d2('0x2c')][_0x81d2('0x4c')]){var _0x4bb302=_0x2cc909[_0x81d2('0x2c')][_0x81d2('0x4c')][_0x81d2('0x4d')](',');var _0x176b0f={};_0x176b0f[_0x4bb302[0x0]]={'$gte':moment(_0x4bb302[0x1])[_0x81d2('0x4e')](_0x81d2('0x4f'))};_0x398da7[_0x81d2('0x49')]=_[_0x81d2('0x4a')](_0x398da7[_0x81d2('0x49')],_0x176b0f);}_0x398da7=_[_0x81d2('0x4a')]({},_0x398da7,_0x2cc909[_0x81d2('0x39')]);return db['WhatsappMessage']['count']({'where':_0x398da7['where']})[_0x81d2('0x1d')](function(_0x12410a){_0x5bb195[_0x81d2('0x1a')]=_0x12410a;if(_0x2cc909['query'][_0x81d2('0x37')]){_0x398da7[_0x81d2('0x38')]=[{'all':!![]}];}return db[_0x81d2('0x3f')][_0x81d2('0x2a')](_0x398da7);})[_0x81d2('0x1d')](function(_0x348604){_0x5bb195[_0x81d2('0x50')]=_0x348604;return _0x5bb195;});}})[_0x81d2('0x1d')](respondWithFilteredResult(_0x360f2e,_0x398da7))[_0x81d2('0x2e')](handleError(_0x360f2e,null));};exports[_0x81d2('0x51')]=function(_0x312bd1,_0x4e774f){return db['WhatsappInteraction'][_0x81d2('0x3a')]({'where':{'id':_0x312bd1[_0x81d2('0x30')]['id']}})[_0x81d2('0x1d')](handleEntityNotFound(_0x4e774f,null))[_0x81d2('0x1d')](function(_0x559ee1){if(_0x559ee1){return _0x559ee1[_0x81d2('0x52')](_0x312bd1['body']['ids'],_[_0x81d2('0x40')](_0x312bd1[_0x81d2('0x3c')],[_0x81d2('0x41'),'id'])||{})[_0x81d2('0x53')](function(){return db[_0x81d2('0x54')]['findAll']({'attributes':['id',_0x81d2('0x21'),_0x81d2('0x55')],'where':{'id':_0x312bd1[_0x81d2('0x3c')][_0x81d2('0x41')]}});})[_0x81d2('0x1d')](function(_0x118a4e){socket['emit'](_0x81d2('0x56'),{'id':Number(_0x312bd1[_0x81d2('0x30')]['id']),'tags':_0x118a4e||[]});return{'id':Number(_0x312bd1[_0x81d2('0x30')]['id']),'tags':_0x118a4e||[]};});}})[_0x81d2('0x1d')](respondWithResult(_0x4e774f,null))[_0x81d2('0x2e')](handleError(_0x4e774f,null));};exports[_0x81d2('0x57')]=function(_0x58265d,_0xaa070){return db[_0x81d2('0x24')]['find']({'where':{'id':_0x58265d[_0x81d2('0x30')]['id']}})[_0x81d2('0x1d')](handleEntityNotFound(_0xaa070,null))['then'](function(_0x257a7b){if(_0x257a7b){return _0x257a7b[_0x81d2('0x57')](_0x58265d[_0x81d2('0x2c')][_0x81d2('0x41')]);}})[_0x81d2('0x1d')](respondWithStatusCode(_0xaa070,null))[_0x81d2('0x2e')](handleError(_0xaa070,null));};exports[_0x81d2('0x58')]=function(_0x384784,_0x1074b4){var _0x1e0c07=moment()['unix']()[_0x81d2('0x59')]();var _0x561aa0=path[_0x81d2('0x5a')](config['root'],_0x81d2('0x5b'),_0x81d2('0x5c'),_0x81d2('0x5d'));var _0x399e4a=path[_0x81d2('0x5a')](config['root'],'server','files',_0x81d2('0x5e'));var _0x621be8=path[_0x81d2('0x5a')](_0x561aa0,_0x1e0c07);var _0x1ffe79=util[_0x81d2('0x4e')]('transcript-%d-%s.zip',_0x384784[_0x81d2('0x30')]['id'],_0x1e0c07);var _0x5723af=path['join'](_0x561aa0,_0x1ffe79);var _0x46426f=[];_0x46426f[_0x81d2('0x5f')]({'model':db[_0x81d2('0x60')],'as':_0x81d2('0x60'),'attributes':['id',_0x81d2('0x61')],'raw':!![]});_0x46426f[_0x81d2('0x5f')]({'model':db[_0x81d2('0x62')],'as':'Contact','attributes':['id',_0x81d2('0x63'),_0x81d2('0x64')],'raw':!![]});if(_0x384784['query'][_0x81d2('0x5e')]){_0x46426f[_0x81d2('0x5f')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3375b9=[{'model':db[_0x81d2('0x3f')],'as':_0x81d2('0x65'),'attributes':['id','body',_0x81d2('0x66'),_0x81d2('0x67'),'secret',_0x81d2('0x68')],'include':_0x46426f}];_0x3375b9[_0x81d2('0x5f')]({'model':db[_0x81d2('0x69')],'as':_0x81d2('0x6a'),'attributes':['id',_0x81d2('0x21')]});_0x3375b9[_0x81d2('0x5f')]({'model':db[_0x81d2('0x60')],'as':_0x81d2('0x6b'),'attributes':['id','fullname']});return db[_0x81d2('0x24')][_0x81d2('0x3a')]({'where':{'id':_0x384784['params']['id']},'include':_0x3375b9})['then'](handleEntityNotFound(_0x1074b4,null))['then'](function(_0x56d4fb){if(_0x56d4fb){var _0x8610e1=_0x56d4fb['get']({'plain':!![]});fs[_0x81d2('0x6c')](_0x621be8);var _0x1b67fc={'channel':_0x81d2('0x6d'),'account':_0x8610e1[_0x81d2('0x6a')][_0x81d2('0x21')],'agent':_0x8610e1['Owner']?_0x8610e1[_0x81d2('0x6b')]['fullname']:_0x81d2('0x6e'),'createdAt':moment(_0x8610e1[_0x81d2('0x66')])['format'](_0x81d2('0x4f'))[_0x81d2('0x59')](),'closedAt':_0x8610e1['closed']?moment(_0x8610e1[_0x81d2('0x6f')])['format'](_0x81d2('0x4f'))['toString']():'','disposition':_0x8610e1[_0x81d2('0x70')],'messages':_(_0x8610e1[_0x81d2('0x65')])[_0x81d2('0x4b')]({'secret':![]})[_0x81d2('0x23')](function(_0x4abf97){if(_0x4abf97[_0x81d2('0x71')]){var _0xd71d27=path['join'](_0x399e4a,_0x4abf97[_0x81d2('0x71')]['basename']);if(fs[_0x81d2('0x72')](_0xd71d27)){fs[_0x81d2('0x73')](_0xd71d27)[_0x81d2('0x74')](fs[_0x81d2('0x75')](path[_0x81d2('0x5a')](_0x621be8,_0x4abf97[_0x81d2('0x71')]['basename'])));}}return{'date':moment(_0x4abf97[_0x81d2('0x66')])[_0x81d2('0x4e')](_0x81d2('0x4f'))['toString'](),'sender':_0x4abf97[_0x81d2('0x67')]===_0x81d2('0x76')?_0x4abf97[_0x81d2('0x60')]?_0x4abf97[_0x81d2('0x60')][_0x81d2('0x61')]:_0x81d2('0x77'):_0x4abf97[_0x81d2('0x78')][_0x81d2('0x63')]+(_0x4abf97[_0x81d2('0x78')]['lastName']?'\x20'+_0x4abf97[_0x81d2('0x78')][_0x81d2('0x64')]:''),'body':_0x4abf97['Attachment']?_0x4abf97[_0x81d2('0x71')][_0x81d2('0x79')]:_0x4abf97[_0x81d2('0x3c')],'direction':_0x4abf97[_0x81d2('0x67')]===_0x81d2('0x76')?'A':'C','secret':_0x4abf97['secret'],'read':_0x4abf97['read'],'attachment':_0x4abf97[_0x81d2('0x71')]};})['value']()};return ejs['renderFile'](path[_0x81d2('0x5a')](config[_0x81d2('0x7a')],_0x81d2('0x5b'),'views',_0x81d2('0x7b')),{'interaction':_0x1b67fc})[_0x81d2('0x1d')](function(_0xcc6eda){var _0x9ceb51=path[_0x81d2('0x5a')](_0x621be8,'transcript-'+_0x8610e1['id']+'-'+_0x1e0c07+_0x81d2('0x7c'));var _0x4df98f={'path':_0x9ceb51,'channel':_0x81d2('0x6d'),'interactionId':_0x8610e1['id']};return pdf[_0x81d2('0x7d')](_0xcc6eda,_0x4df98f);})[_0x81d2('0x1d')](function(){return new BPromise(function(_0xc9a68a,_0xeb468){zipdir(_0x621be8,{'saveTo':_0x5723af},function(_0x34ce38,_0x3a3b6c){if(_0x34ce38)return _0xeb468(_0x34ce38);return _0xc9a68a(_0x3a3b6c);});})[_0x81d2('0x1d')](function(){return new BPromise(function(_0xfea347,_0x293838){rimraf(_0x621be8,function(_0x2d6d3f){if(_0x2d6d3f)_0x293838(_0x2d6d3f);return _0xfea347();});});})[_0x81d2('0x1d')](function(){return _0x1074b4[_0x81d2('0x58')](_0x5723af,_0x1ffe79,function(_0x475fdb){if(_0x475fdb){console['log'](_0x81d2('0x7e'),_0x475fdb);}else{fs[_0x81d2('0x7f')](_0x5723af);}});});});}else{return _0x1074b4[_0x81d2('0x13')](0xc8);}})[_0x81d2('0x2e')](handleError(_0x1074b4,null));};
\ No newline at end of file
index 103cf6e..f911015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4f=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','setDataValue','Users','findAll','then'];(function(_0x440abd,_0x20475a){var _0x2778cd=function(_0x4fd1ef){while(--_0x4fd1ef){_0x440abd['push'](_0x440abd['shift']());}};_0x2778cd(++_0x20475a);}(_0xee4f,0xad));var _0xfee4=function(_0x22e101,_0x412840){_0x22e101=_0x22e101-0x0;var _0xa51f61=_0xee4f[_0x22e101];return _0xa51f61;};'use strict';var EventEmitter=require(_0xfee4('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xfee4('0x1'))['db'][_0xfee4('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfee4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfee4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27874a){return function(_0x505b55,_0x4da9b6,_0x1c39b1){_0x505b55['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2fb1b3){_0x505b55[_0xfee4('0x5')](_0xfee4('0x6'),_0x2fb1b3['map'](function(_0x52fc6e){return{'id':_0x52fc6e['id']};}));return WhatsappMessage[_0xfee4('0x7')]({'where':{'WhatsappInteractionId':_0x505b55['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfee4('0x8')](function(_0xa77876){_0x505b55['setDataValue']('unreadMessages',_0xa77876[_0xfee4('0x9')]);WhatsappInteractionEvents[_0xfee4('0xa')](_0x27874a+':'+_0x505b55['id'],_0x505b55);WhatsappInteractionEvents[_0xfee4('0xa')](_0x27874a,_0x505b55);_0x1c39b1(null);})['catch'](_0x1c39b1(null));};}for(var e in events){if(events[_0xfee4('0xb')](e)){var event=events[e];WhatsappInteraction[_0xfee4('0xc')](e,emitEvent(event));}}module[_0xfee4('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xb248=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','map'];(function(_0x27751c,_0x3d69ea){var _0x12ed13=function(_0x1cd0c4){while(--_0x1cd0c4){_0x27751c['push'](_0x27751c['shift']());}};_0x12ed13(++_0x3d69ea);}(_0xb248,0xc6));var _0x8b24=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb248[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0x8b24('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x8b24('0x1')];var WhatsappMessage=require(_0x8b24('0x2'))['db'][_0x8b24('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8b24('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b24('0x5'),'afterDestroy':_0x8b24('0x6')};function emitEvent(_0x5d4103){return function(_0x253441,_0x2b605d,_0x4cc3c4){_0x253441[_0x8b24('0x7')]({'attributes':['id'],'raw':!![]})[_0x8b24('0x8')](function(_0x588ca8){_0x253441[_0x8b24('0x9')]('Users',_0x588ca8[_0x8b24('0xa')](function(_0x299fa2){return{'id':_0x299fa2['id']};}));return WhatsappMessage[_0x8b24('0xb')]({'where':{'WhatsappInteractionId':_0x253441['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x403adc){_0x253441[_0x8b24('0x9')](_0x8b24('0xc'),_0x403adc[_0x8b24('0xd')]);WhatsappInteractionEvents[_0x8b24('0xe')](_0x5d4103+':'+_0x253441['id'],_0x253441);WhatsappInteractionEvents[_0x8b24('0xe')](_0x5d4103,_0x253441);_0x4cc3c4(null);})[_0x8b24('0xf')](_0x4cc3c4(null));};}for(var e in events){if(events[_0x8b24('0x10')](e)){var event=events[e];WhatsappInteraction[_0x8b24('0x11')](e,emitEvent(event));}}module[_0x8b24('0x12')]=WhatsappInteractionEvents;
\ No newline at end of file
index bcc9093..b9d95af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32de=['api','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0x5c8a09,_0x32f87f){var _0x3e3e9c=function(_0xdada9b){while(--_0xdada9b){_0x5c8a09['push'](_0x5c8a09['shift']());}};_0x3e3e9c(++_0x32f87f);}(_0x32de,0x7d));var _0xe32d=function(_0xdbf8f2,_0x409a32){_0xdbf8f2=_0xdbf8f2-0x0;var _0x4ed5d2=_0x32de[_0xdbf8f2];return _0x4ed5d2;};'use strict';var _=require(_0xe32d('0x0'));var util=require(_0xe32d('0x1'));var logger=require(_0xe32d('0x2'))(_0xe32d('0x3'));var moment=require('moment');var BPromise=require(_0xe32d('0x4'));var rp=require(_0xe32d('0x5'));var fs=require('fs');var path=require(_0xe32d('0x6'));var rimraf=require(_0xe32d('0x7'));var config=require('../../config/environment');var attributes=require(_0xe32d('0x8'));module[_0xe32d('0x9')]=function(_0x15d8e3,_0x4f468c){return _0x15d8e3[_0xe32d('0xa')]('WhatsappInteraction',attributes,{'tableName':_0xe32d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x195df1,_0x1d27e6,_0x2da7ca){if(_0x195df1[_0xe32d('0xc')](_0xe32d('0xd'))){_0x195df1[_0xe32d('0xe')]=moment()[_0xe32d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2da7ca(null,_0x195df1);}}});};
\ No newline at end of file
+var _0x00c4=['rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path'];(function(_0x6f116f,_0x48c8bd){var _0x120342=function(_0xa8e20a){while(--_0xa8e20a){_0x6f116f['push'](_0x6f116f['shift']());}};_0x120342(++_0x48c8bd);}(_0x00c4,0x15a));var _0x400c=function(_0x1695d2,_0x357e1a){_0x1695d2=_0x1695d2-0x0;var _0x3cec68=_0x00c4[_0x1695d2];return _0x3cec68;};'use strict';var _=require(_0x400c('0x0'));var util=require(_0x400c('0x1'));var logger=require(_0x400c('0x2'))(_0x400c('0x3'));var moment=require(_0x400c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x400c('0x5'));var rimraf=require(_0x400c('0x6'));var config=require(_0x400c('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x400c('0x8')]=function(_0x1f2d17,_0x1a5145){return _0x1f2d17[_0x400c('0x9')](_0x400c('0xa'),attributes,{'tableName':_0x400c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52d12b,_0x3c0a30,_0x297e9d){if(_0x52d12b[_0x400c('0xc')]('closed')){_0x52d12b[_0x400c('0xd')]=moment()[_0x400c('0xe')](_0x400c('0xf'));}_0x297e9d(null,_0x52d12b);}}});};
\ No newline at end of file
index 2179064..8903602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2067=['find','addTags','body','ids','omit','spread','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappInteraction.socket','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','raw','options','where','attributes','limit','AddTagsToWhatsappInteraction'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x2067,0x85));var _0x7206=function(_0x50b2ff,_0x46ca56){_0x50b2ff=_0x50b2ff-0x0;var _0x143efc=_0x2067[_0x50b2ff];return _0x143efc;};'use strict';var _=require(_0x7206('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7206('0x1'));var fs=require('fs');var Redis=require(_0x7206('0x2'));var db=require(_0x7206('0x3'))['db'];var utils=require(_0x7206('0x4'));var logger=require(_0x7206('0x5'))(_0x7206('0x6'));var config=require(_0x7206('0x7'));var jayson=require(_0x7206('0x8'));var client=jayson[_0x7206('0x9')]['http']({'port':0x232a});config[_0x7206('0xa')]=_[_0x7206('0xb')](config['redis'],{'host':_0x7206('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7206('0xa')]));require(_0x7206('0xd'))['register'](socket);function respondWithRpcPromise(_0x53c761,_0x7b5635,_0x488beb){return new BPromise(function(_0x15cd26,_0x5ea5a8){return client['request'](_0x53c761,_0x488beb)[_0x7206('0xe')](function(_0x9346cf){logger[_0x7206('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x7b5635,_0x7206('0x10'));logger[_0x7206('0x11')](_0x7206('0x12'),_0x7b5635,_0x7206('0x10'),JSON[_0x7206('0x13')](_0x9346cf));if(_0x9346cf[_0x7206('0x14')]){if(_0x9346cf[_0x7206('0x14')][_0x7206('0x15')]===0x1f4){logger[_0x7206('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x7b5635,_0x9346cf[_0x7206('0x14')][_0x7206('0x16')]);return _0x5ea5a8(_0x9346cf[_0x7206('0x14')][_0x7206('0x16')]);}logger[_0x7206('0x14')](_0x7206('0x17'),_0x7b5635,_0x9346cf[_0x7206('0x14')][_0x7206('0x16')]);return _0x15cd26(_0x9346cf[_0x7206('0x14')]['message']);}else{logger['info'](_0x7206('0x17'),_0x7b5635,_0x7206('0x10'));_0x15cd26(_0x9346cf[_0x7206('0x18')]['message']);}})[_0x7206('0x19')](function(_0x57cf4e){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x7b5635,_0x57cf4e);_0x5ea5a8(_0x57cf4e);});});}exports[_0x7206('0x1a')]=function(_0x488616){var _0x5d2c49=this;return new Promise(function(_0x37ab24,_0x44878a){return db[_0x7206('0x1b')][_0x7206('0x1c')](_0x488616['body'],{'raw':_0x488616['options']?_0x488616['options'][_0x7206('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x488616[_0x7206('0x1e')]?_0x488616[_0x7206('0x1e')][_0x7206('0x1f')]||null:null,'attributes':_0x488616[_0x7206('0x1e')]?_0x488616[_0x7206('0x1e')][_0x7206('0x20')]||null:null,'limit':_0x488616[_0x7206('0x1e')]?_0x488616[_0x7206('0x1e')][_0x7206('0x21')]||null:null})[_0x7206('0xe')](function(_0x4c39fb){logger[_0x7206('0xf')]('UpdateWhatsappInteraction',_0x488616);logger['debug'](_0x7206('0x1a'),_0x488616,JSON[_0x7206('0x13')](_0x4c39fb));_0x37ab24(_0x4c39fb);})[_0x7206('0x19')](function(_0x19ebb9){logger[_0x7206('0x14')](_0x7206('0x1a'),_0x19ebb9[_0x7206('0x16')],_0x488616);_0x44878a(_0x5d2c49[_0x7206('0x14')](0x1f4,_0x19ebb9['message']));});});};exports[_0x7206('0x22')]=function(_0x25a811){return new Promise(function(_0x3d1d13,_0x2ba339){return db[_0x7206('0x1b')][_0x7206('0x23')]({'where':_0x25a811['options']?_0x25a811[_0x7206('0x1e')]['where']||null:null})[_0x7206('0xe')](function(_0x1fef83){if(_0x1fef83){return _0x1fef83[_0x7206('0x24')](_0x25a811[_0x7206('0x25')][_0x7206('0x26')],_[_0x7206('0x27')](_0x25a811['body'],[_0x7206('0x26'),'id'])||{});}})[_0x7206('0x28')](function(_0x4c1973){logger[_0x7206('0xf')](_0x7206('0x29'),_0x25a811);logger[_0x7206('0x11')](_0x7206('0x29'),_0x25a811,JSON[_0x7206('0x13')](_0x4c1973));_0x3d1d13(_0x4c1973);})[_0x7206('0x19')](function(_0x12ffb5){logger[_0x7206('0x14')](_0x7206('0x29'),_0x12ffb5['message'],_0x25a811);_0x2ba339(_this['error'](0x1f4,_0x12ffb5[_0x7206('0x16')]));});});};
\ No newline at end of file
+var _0x095f=['request\x20sent','debug','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','update','body','options','attributes','AddTagsToWhatsappInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./whatsappInteraction.socket','register','then','info'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x095f,0x191));var _0xf095=function(_0x21d13a,_0x31685b){_0x21d13a=_0x21d13a-0x0;var _0x2c1ffc=_0x095f[_0x21d13a];return _0x2c1ffc;};'use strict';var _=require(_0xf095('0x0'));var util=require(_0xf095('0x1'));var moment=require('moment');var BPromise=require(_0xf095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf095('0x3'));var db=require(_0xf095('0x4'))['db'];var utils=require(_0xf095('0x5'));var logger=require(_0xf095('0x6'))(_0xf095('0x7'));var config=require(_0xf095('0x8'));var jayson=require(_0xf095('0x9'));var client=jayson[_0xf095('0xa')]['http']({'port':0x232a});config[_0xf095('0xb')]=_['defaults'](config[_0xf095('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf095('0xc'))(new Redis(config[_0xf095('0xb')]));require(_0xf095('0xd'))[_0xf095('0xe')](socket);function respondWithRpcPromise(_0x516793,_0x5c739f,_0x16e2b5){return new BPromise(function(_0x4e444d,_0xcff9da){return client['request'](_0x516793,_0x16e2b5)[_0xf095('0xf')](function(_0x126c35){logger[_0xf095('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x5c739f,_0xf095('0x11'));logger[_0xf095('0x12')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5c739f,_0xf095('0x11'),JSON[_0xf095('0x13')](_0x126c35));if(_0x126c35[_0xf095('0x14')]){if(_0x126c35[_0xf095('0x14')][_0xf095('0x15')]===0x1f4){logger[_0xf095('0x14')](_0xf095('0x16'),_0x5c739f,_0x126c35[_0xf095('0x14')][_0xf095('0x17')]);return _0xcff9da(_0x126c35[_0xf095('0x14')][_0xf095('0x17')]);}logger['error'](_0xf095('0x16'),_0x5c739f,_0x126c35[_0xf095('0x14')][_0xf095('0x17')]);return _0x4e444d(_0x126c35[_0xf095('0x14')][_0xf095('0x17')]);}else{logger[_0xf095('0x10')](_0xf095('0x16'),_0x5c739f,_0xf095('0x11'));_0x4e444d(_0x126c35[_0xf095('0x18')]['message']);}})[_0xf095('0x19')](function(_0x5acdc1){logger[_0xf095('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x5c739f,_0x5acdc1);_0xcff9da(_0x5acdc1);});});}exports[_0xf095('0x1a')]=function(_0x14fc2f){var _0x4a38a4=this;return new Promise(function(_0x3ee8e4,_0x43ae5a){return db['WhatsappInteraction'][_0xf095('0x1b')](_0x14fc2f[_0xf095('0x1c')],{'raw':_0x14fc2f[_0xf095('0x1d')]?_0x14fc2f[_0xf095('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14fc2f[_0xf095('0x1d')]?_0x14fc2f[_0xf095('0x1d')]['where']||null:null,'attributes':_0x14fc2f['options']?_0x14fc2f[_0xf095('0x1d')][_0xf095('0x1e')]||null:null,'limit':_0x14fc2f[_0xf095('0x1d')]?_0x14fc2f[_0xf095('0x1d')]['limit']||null:null})[_0xf095('0xf')](function(_0x26fc6a){logger[_0xf095('0x10')](_0xf095('0x1a'),_0x14fc2f);logger[_0xf095('0x12')](_0xf095('0x1a'),_0x14fc2f,JSON[_0xf095('0x13')](_0x26fc6a));_0x3ee8e4(_0x26fc6a);})[_0xf095('0x19')](function(_0x322d17){logger[_0xf095('0x14')](_0xf095('0x1a'),_0x322d17[_0xf095('0x17')],_0x14fc2f);_0x43ae5a(_0x4a38a4[_0xf095('0x14')](0x1f4,_0x322d17[_0xf095('0x17')]));});});};exports[_0xf095('0x1f')]=function(_0x49a6e1){return new Promise(function(_0x574eb5,_0x114839){return db['WhatsappInteraction'][_0xf095('0x20')]({'where':_0x49a6e1[_0xf095('0x1d')]?_0x49a6e1[_0xf095('0x1d')][_0xf095('0x21')]||null:null})[_0xf095('0xf')](function(_0x343c97){if(_0x343c97){return _0x343c97[_0xf095('0x22')](_0x49a6e1[_0xf095('0x1c')][_0xf095('0x23')],_[_0xf095('0x24')](_0x49a6e1['body'],[_0xf095('0x23'),'id'])||{});}})['spread'](function(_0x4806c6){logger[_0xf095('0x10')](_0xf095('0x25'),_0x49a6e1);logger[_0xf095('0x12')](_0xf095('0x25'),_0x49a6e1,JSON[_0xf095('0x13')](_0x4806c6));_0x574eb5(_0x4806c6);})[_0xf095('0x19')](function(_0x37caa8){logger['error'](_0xf095('0x25'),_0x37caa8['message'],_0x49a6e1);_0x114839(_this[_0xf095('0x14')](0x1f4,_0x37caa8['message']));});});};
\ No newline at end of file
index 5615858..fa1441b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2adc=['./whatsappInteraction.events','save','remove','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x2adc,0x15f));var _0xc2ad=function(_0x4b5e31,_0x528f96){_0x4b5e31=_0x4b5e31-0x0;var _0x28b9cd=_0x2adc[_0x4b5e31];return _0x28b9cd;};'use strict';var WhatsappInteractionEvents=require(_0xc2ad('0x0'));var events=[_0xc2ad('0x1'),_0xc2ad('0x2'),_0xc2ad('0x3')];function createListener(_0x547fb8,_0x306996){return function(_0x3ed70a){_0x306996[_0xc2ad('0x4')](_0x547fb8,_0x3ed70a);};}function removeListener(_0x43702f,_0x5a8510){return function(){WhatsappInteractionEvents[_0xc2ad('0x5')](_0x43702f,_0x5a8510);};}exports[_0xc2ad('0x6')]=function(_0x31aa8a){for(var _0x501676=0x0,_0x5692b1=events[_0xc2ad('0x7')];_0x501676<_0x5692b1;_0x501676++){var _0x5e6cc3=events[_0x501676];var _0x59fae4=createListener(_0xc2ad('0x8')+_0x5e6cc3,_0x31aa8a);WhatsappInteractionEvents['on'](_0x5e6cc3,_0x59fae4);}};
\ No newline at end of file
+var _0x3480=['emit','removeListener','register','length','./whatsappInteraction.events','save','remove','update'];(function(_0x17a8c8,_0x464d1b){var _0x39ffe0=function(_0x482a75){while(--_0x482a75){_0x17a8c8['push'](_0x17a8c8['shift']());}};_0x39ffe0(++_0x464d1b);}(_0x3480,0x164));var _0x0348=function(_0x4e479a,_0x347957){_0x4e479a=_0x4e479a-0x0;var _0x3d8b1e=_0x3480[_0x4e479a];return _0x3d8b1e;};'use strict';var WhatsappInteractionEvents=require(_0x0348('0x0'));var events=[_0x0348('0x1'),_0x0348('0x2'),_0x0348('0x3')];function createListener(_0x440c1a,_0x31bef4){return function(_0x4f8e14){_0x31bef4[_0x0348('0x4')](_0x440c1a,_0x4f8e14);};}function removeListener(_0xf1e6a6,_0x466075){return function(){WhatsappInteractionEvents[_0x0348('0x5')](_0xf1e6a6,_0x466075);};}exports[_0x0348('0x6')]=function(_0x1dfed6){for(var _0xe8f59d=0x0,_0x254128=events[_0x0348('0x7')];_0xe8f59d<_0x254128;_0xe8f59d++){var _0x4f90e8=events[_0xe8f59d];var _0x54187d=createListener('whatsappInteraction:'+_0x4f90e8,_0x1dfed6);WhatsappInteractionEvents['on'](_0x4f90e8,_0x54187d);}};
\ No newline at end of file
index 0ba2a85..a9ee8dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8e9=['/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0xd8e9,0x96));var _0x9d8e=function(_0x4e0aed,_0x44f87c){_0x4e0aed=_0x4e0aed-0x0;var _0xaf418c=_0xd8e9[_0x4e0aed];return _0xaf418c;};'use strict';var multer=require(_0x9d8e('0x0'));var util=require(_0x9d8e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9d8e('0x2'));var router=express[_0x9d8e('0x3')]();var fs_extra=require(_0x9d8e('0x4'));var auth=require(_0x9d8e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9d8e('0x6'));var controller=require('./whatsappMessage.controller');router[_0x9d8e('0x7')]('/',auth[_0x9d8e('0x8')](),controller[_0x9d8e('0x9')]);router[_0x9d8e('0x7')](_0x9d8e('0xa'),auth['isAuthenticated'](),controller[_0x9d8e('0xb')]);router[_0x9d8e('0x7')](_0x9d8e('0xc'),auth[_0x9d8e('0x8')](),controller[_0x9d8e('0xd')]);router[_0x9d8e('0xe')]('/',auth[_0x9d8e('0x8')](),interaction[_0x9d8e('0xf')](_0x9d8e('0x10'),_0x9d8e('0x11')),controller[_0x9d8e('0x12')]);router[_0x9d8e('0xe')](_0x9d8e('0x13'),controller[_0x9d8e('0x14')]);router[_0x9d8e('0x15')](_0x9d8e('0xc'),auth[_0x9d8e('0x8')](),controller[_0x9d8e('0x16')]);router['put'](_0x9d8e('0x17'),auth[_0x9d8e('0x8')](),controller['accept']);router[_0x9d8e('0x15')](_0x9d8e('0x18'),auth[_0x9d8e('0x8')](),controller[_0x9d8e('0x19')]);router[_0x9d8e('0x1a')](_0x9d8e('0xc'),auth['isAuthenticated'](),controller[_0x9d8e('0x1b')]);module[_0x9d8e('0x1c')]=router;
\ No newline at end of file
+var _0x767b=['/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','tracked','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','accept'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x767b,0x1e2));var _0xb767=function(_0xe88157,_0x965589){_0xe88157=_0xe88157-0x0;var _0xa9cf33=_0x767b[_0xe88157];return _0xa9cf33;};'use strict';var multer=require(_0xb767('0x0'));var util=require(_0xb767('0x1'));var path=require(_0xb767('0x2'));var timeout=require(_0xb767('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb767('0x4'));var auth=require(_0xb767('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb767('0x6'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xb767('0x7')](),controller[_0xb767('0x8')]);router[_0xb767('0x9')](_0xb767('0xa'),auth['isAuthenticated'](),controller[_0xb767('0xb')]);router['get']('/:id',auth[_0xb767('0x7')](),controller[_0xb767('0xc')]);router[_0xb767('0xd')]('/',auth[_0xb767('0x7')](),interaction[_0xb767('0xe')]('whatsapp',_0xb767('0xf')),controller[_0xb767('0x10')]);router[_0xb767('0xd')](_0xb767('0x11'),controller['status']);router[_0xb767('0x12')]('/:id',auth[_0xb767('0x7')](),controller[_0xb767('0x13')]);router['put'](_0xb767('0x14'),auth[_0xb767('0x7')](),controller[_0xb767('0x15')]);router[_0xb767('0x12')](_0xb767('0x16'),auth[_0xb767('0x7')](),controller[_0xb767('0x17')]);router[_0xb767('0x18')](_0xb767('0x19'),auth['isAuthenticated'](),controller[_0xb767('0x1a')]);module[_0xb767('0x1b')]=router;
\ No newline at end of file
index 5d31e0a..e6f8d23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6089=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2ce59e,_0x26e8be){var _0x42f0f2=function(_0x375361){while(--_0x375361){_0x2ce59e['push'](_0x2ce59e['shift']());}};_0x42f0f2(++_0x26e8be);}(_0x6089,0x100));var _0x9608=function(_0x56bfd7,_0xe9464){_0x56bfd7=_0x56bfd7-0x0;var _0x63198c=_0x6089[_0x56bfd7];return _0x63198c;};'use strict';var Sequelize=require(_0x9608('0x0'));module[_0x9608('0x1')]={'body':{'type':Sequelize[_0x9608('0x2')](_0x9608('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9608('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9608('0x5')]('in',_0x9608('0x6')),'defaultValue':_0x9608('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9608('0x7')]},'readAt':{'type':Sequelize[_0x9608('0x8')]},'secret':{'type':Sequelize[_0x9608('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9608('0x2')]}};
\ No newline at end of file
+var _0xeb00=['STRING','DATE','TEXT','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x57eab2,_0x1788cc){var _0x4f7289=function(_0x475c06){while(--_0x475c06){_0x57eab2['push'](_0x57eab2['shift']());}};_0x4f7289(++_0x1788cc);}(_0xeb00,0x1bb));var _0x0eb0=function(_0x112056,_0x2ef8c3){_0x112056=_0x112056-0x0;var _0x3dc78a=_0xeb00[_0x112056];return _0x3dc78a;};'use strict';var Sequelize=require(_0x0eb0('0x0'));module[_0x0eb0('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0eb0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0eb0('0x3')]('in',_0x0eb0('0x4')),'defaultValue':_0x0eb0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0eb0('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0eb0('0x6')]},'secret':{'type':Sequelize[_0x0eb0('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0eb0('0x5')]},'providerResponse':{'type':Sequelize[_0x0eb0('0x7')]}};
\ No newline at end of file
index a069806..0f0e0d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfed=['mustache','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','destroy','end','stack','send','map','fieldName','model','name','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','WhatsappMessage','includeAll','findAll','show','params','rawAttributes','include','options','create','body','find','describe','whatsapp-interactions','accept','whatsapp','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','update','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','interface','event','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','inspect','rimraf','fast-json-patch','moment','bluebird'];(function(_0x4b8968,_0x5c9b44){var _0x3a0ab7=function(_0x4dade2){while(--_0x4dade2){_0x4b8968['push'](_0x4b8968['shift']());}};_0x3a0ab7(++_0x5c9b44);}(_0xbfed,0x197));var _0xdbfe=function(_0x111692,_0x19f8a9){_0x111692=_0x111692-0x0;var _0x11836f=_0xbfed[_0x111692];return _0x11836f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbfe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbfe('0x1'));var rp=require('request-promise');var moment=require(_0xdbfe('0x2'));var BPromise=require(_0xdbfe('0x3'));var Mustache=require(_0xdbfe('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdbfe('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbfe('0x6'));var squel=require(_0xdbfe('0x7'));var crypto=require('crypto');var jsforce=require(_0xdbfe('0x8'));var deskjs=require(_0xdbfe('0x9'));var toCsv=require(_0xdbfe('0x5'));var querystring=require('querystring');var Papa=require(_0xdbfe('0xa'));var Redis=require(_0xdbfe('0xb'));var authService=require(_0xdbfe('0xc'));var qs=require(_0xdbfe('0xd'));var as=require(_0xdbfe('0xe'));var hardwareService=require(_0xdbfe('0xf'));var logger=require(_0xdbfe('0x10'))(_0xdbfe('0x11'));var utils=require(_0xdbfe('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xdbfe('0x13'));var db=require(_0xdbfe('0x14'))['db'];config[_0xdbfe('0x15')]=_[_0xdbfe('0x16')](config['redis'],{'host':_0xdbfe('0x17'),'port':0x18eb});var socket=require(_0xdbfe('0x18'))(new Redis(config['redis']));require(_0xdbfe('0x19'))[_0xdbfe('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdbfe('0x1b')][_0xdbfe('0x1c')]({'port':0x232c});var client9002=jayson[_0xdbfe('0x1b')][_0xdbfe('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5586ac,_0x5a81d0,_0xa5c809,_0x41363a){return new BPromise(function(_0x5e8c6a,_0x8f0b30){var _0x2731bc=_0x41363a||client;return _0x2731bc[_0xdbfe('0x1d')](_0x5586ac,_0xa5c809)[_0xdbfe('0x1e')](function(_0x4831da){logger[_0xdbfe('0x1f')](_0xdbfe('0x20'),_0x5a81d0,_0xdbfe('0x21'));logger['debug'](_0xdbfe('0x22'),_0x5a81d0,_0xdbfe('0x21'),JSON[_0xdbfe('0x23')](_0x4831da));if(_0x4831da['error']){if(_0x4831da['error'][_0xdbfe('0x24')]===0x1f4){logger[_0xdbfe('0x25')](_0xdbfe('0x20'),_0x5a81d0,_0x4831da['error']['message']);return _0x8f0b30(_0x4831da[_0xdbfe('0x25')][_0xdbfe('0x26')]);}logger[_0xdbfe('0x25')](_0xdbfe('0x20'),_0x5a81d0,_0x4831da[_0xdbfe('0x25')][_0xdbfe('0x26')]);return _0x5e8c6a(_0x4831da[_0xdbfe('0x25')][_0xdbfe('0x26')]);}else{logger[_0xdbfe('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x5a81d0,_0xdbfe('0x21'));_0x5e8c6a(_0x4831da[_0xdbfe('0x27')][_0xdbfe('0x26')]);}})[_0xdbfe('0x28')](function(_0x27d664){logger[_0xdbfe('0x25')](_0xdbfe('0x20'),_0x5a81d0,_0x27d664);_0x8f0b30(_0x27d664);});});}function respondWithStatusCode(_0x4334b6,_0xd42018){_0xd42018=_0xd42018||0xcc;return function(_0x13a0a8){if(_0x13a0a8){return _0x4334b6[_0xdbfe('0x29')](_0xd42018);}return _0x4334b6[_0xdbfe('0x2a')](_0xd42018)['end']();};}function respondWithResult(_0x4d1558,_0x47906c){_0x47906c=_0x47906c||0xc8;return function(_0x1a7574){if(_0x1a7574){return _0x4d1558[_0xdbfe('0x2a')](_0x47906c)[_0xdbfe('0x2b')](_0x1a7574);}};}function respondWithFilteredResult(_0x32d04,_0x2c4c5f){return function(_0x13692a){if(_0x13692a){var _0x453d4e=typeof _0x2c4c5f[_0xdbfe('0x2c')]==='undefined'&&typeof _0x2c4c5f[_0xdbfe('0x2d')]===_0xdbfe('0x2e');var _0x5a57f2=_0x13692a[_0xdbfe('0x2f')];var _0x8a743f=_0x453d4e?0x0:_0x2c4c5f[_0xdbfe('0x2c')];var _0x329036=_0x453d4e?_0x13692a['count']:_0x2c4c5f[_0xdbfe('0x2c')]+_0x2c4c5f['limit'];var _0x1376d1;if(_0x329036>=_0x5a57f2){_0x329036=_0x5a57f2;_0x1376d1=0xc8;}else{_0x1376d1=0xce;}_0x32d04[_0xdbfe('0x2a')](_0x1376d1);return _0x32d04['set']('Content-Range',_0x8a743f+'-'+_0x329036+'/'+_0x5a57f2)['json'](_0x13692a);}return null;};}function patchUpdates(_0x2267c5){return function(_0x2ead04){try{jsonpatch[_0xdbfe('0x30')](_0x2ead04,_0x2267c5,!![]);}catch(_0x1cca83){return BPromise[_0xdbfe('0x31')](_0x1cca83);}return _0x2ead04[_0xdbfe('0x32')]();};}function saveUpdates(_0x598ae7,_0x5bee84){return function(_0x5e6000){if(_0x5e6000){return _0x5e6000['update'](_0x598ae7)['then'](function(_0x400477){return _0x400477;});}return null;};}function removeEntity(_0x4659b0,_0x121b3f){return function(_0x5c3611){if(_0x5c3611){return _0x5c3611[_0xdbfe('0x33')]()['then'](function(){_0x4659b0[_0xdbfe('0x2a')](0xcc)[_0xdbfe('0x34')]();});}};}function handleEntityNotFound(_0x28f0c1,_0x3ac031){return function(_0x42a206){if(!_0x42a206){_0x28f0c1[_0xdbfe('0x29')](0x194);}return _0x42a206;};}function handleError(_0x11380d,_0x102979){_0x102979=_0x102979||0x1f4;return function(_0x4d0fab){logger[_0xdbfe('0x25')](_0x4d0fab[_0xdbfe('0x35')]);if(_0x4d0fab['name']){delete _0x4d0fab['name'];}_0x11380d[_0xdbfe('0x2a')](_0x102979)[_0xdbfe('0x36')](_0x4d0fab);};}exports['index']=function(_0x105407,_0x58148a){var _0x1b504c={},_0x4c8e84={},_0x45c54a={'count':0x0,'rows':[]};var _0x84c44e=_[_0xdbfe('0x37')](db['WhatsappMessage']['rawAttributes'],function(_0x30a6b6){return{'name':_0x30a6b6[_0xdbfe('0x38')],'type':_0x30a6b6['type']['key']};});_0x4c8e84[_0xdbfe('0x39')]=_[_0xdbfe('0x37')](_0x84c44e,_0xdbfe('0x3a'));_0x4c8e84[_0xdbfe('0x3b')]=_[_0xdbfe('0x3c')](_0x105407['query']);_0x4c8e84['filters']=_['intersection'](_0x4c8e84['model'],_0x4c8e84['query']);_0x1b504c[_0xdbfe('0x3d')]=_[_0xdbfe('0x3e')](_0x4c8e84[_0xdbfe('0x39')],qs[_0xdbfe('0x3f')](_0x105407[_0xdbfe('0x3b')]['fields']));_0x1b504c['attributes']=_0x1b504c['attributes'][_0xdbfe('0x40')]?_0x1b504c['attributes']:_0x4c8e84[_0xdbfe('0x39')];if(!_0x105407[_0xdbfe('0x3b')]['hasOwnProperty'](_0xdbfe('0x41'))){_0x1b504c[_0xdbfe('0x2d')]=qs[_0xdbfe('0x2d')](_0x105407[_0xdbfe('0x3b')]['limit']);_0x1b504c[_0xdbfe('0x2c')]=qs['offset'](_0x105407[_0xdbfe('0x3b')][_0xdbfe('0x2c')]);}_0x1b504c[_0xdbfe('0x42')]=qs[_0xdbfe('0x43')](_0x105407['query'][_0xdbfe('0x43')]);_0x1b504c[_0xdbfe('0x44')]=qs[_0xdbfe('0x45')](_[_0xdbfe('0x46')](_0x105407['query'],_0x4c8e84[_0xdbfe('0x45')]),_0x84c44e);if(_0x105407[_0xdbfe('0x3b')][_0xdbfe('0x47')]){_0x1b504c['where']=_[_0xdbfe('0x48')](_0x1b504c['where'],{'$or':_['map'](_0x84c44e,function(_0x2518bf){if(_0x2518bf[_0xdbfe('0x49')]!==_0xdbfe('0x4a')){var _0x4d97c2={};_0x4d97c2[_0x2518bf[_0xdbfe('0x3a')]]={'$like':'%'+_0x105407[_0xdbfe('0x3b')][_0xdbfe('0x47')]+'%'};return _0x4d97c2;}})});}_0x1b504c=_[_0xdbfe('0x48')]({},_0x1b504c,_0x105407['options']);var _0x41fa9b={'where':_0x1b504c[_0xdbfe('0x44')]};return db[_0xdbfe('0x4b')][_0xdbfe('0x2f')](_0x41fa9b)[_0xdbfe('0x1e')](function(_0x56dc14){_0x45c54a[_0xdbfe('0x2f')]=_0x56dc14;if(_0x105407[_0xdbfe('0x3b')][_0xdbfe('0x4c')]){_0x1b504c['include']=[{'all':!![]}];}return db[_0xdbfe('0x4b')][_0xdbfe('0x4d')](_0x1b504c);})['then'](function(_0x467a2c){_0x45c54a['rows']=_0x467a2c;return _0x45c54a;})['then'](respondWithFilteredResult(_0x58148a,_0x1b504c))[_0xdbfe('0x28')](handleError(_0x58148a,null));};exports[_0xdbfe('0x4e')]=function(_0x590ed8,_0x4efba4){var _0x330a6b={'raw':!![],'where':{'id':_0x590ed8[_0xdbfe('0x4f')]['id']}},_0x1bef46={};_0x1bef46[_0xdbfe('0x39')]=_[_0xdbfe('0x3c')](db[_0xdbfe('0x4b')][_0xdbfe('0x50')]);_0x1bef46[_0xdbfe('0x3b')]=_['keys'](_0x590ed8['query']);_0x1bef46[_0xdbfe('0x45')]=_[_0xdbfe('0x3e')](_0x1bef46[_0xdbfe('0x39')],_0x1bef46[_0xdbfe('0x3b')]);_0x330a6b['attributes']=_[_0xdbfe('0x3e')](_0x1bef46['model'],qs[_0xdbfe('0x3f')](_0x590ed8['query'][_0xdbfe('0x3f')]));_0x330a6b[_0xdbfe('0x3d')]=_0x330a6b['attributes'][_0xdbfe('0x40')]?_0x330a6b[_0xdbfe('0x3d')]:_0x1bef46['model'];if(_0x590ed8[_0xdbfe('0x3b')]['includeAll']){_0x330a6b[_0xdbfe('0x51')]=[{'all':!![]}];}_0x330a6b=_[_0xdbfe('0x48')]({},_0x330a6b,_0x590ed8[_0xdbfe('0x52')]);return db[_0xdbfe('0x4b')]['find'](_0x330a6b)[_0xdbfe('0x1e')](handleEntityNotFound(_0x4efba4,null))[_0xdbfe('0x1e')](respondWithResult(_0x4efba4,null))[_0xdbfe('0x28')](handleError(_0x4efba4,null));};exports[_0xdbfe('0x53')]=function(_0x2d88d1,_0x491235){return db['WhatsappMessage'][_0xdbfe('0x53')](_0x2d88d1[_0xdbfe('0x54')],{})[_0xdbfe('0x1e')](respondWithResult(_0x491235,0xc9))[_0xdbfe('0x28')](handleError(_0x491235,null));};exports['update']=function(_0x5090,_0x51d5c1){if(_0x5090['body']['id']){delete _0x5090[_0xdbfe('0x54')]['id'];}return db[_0xdbfe('0x4b')][_0xdbfe('0x55')]({'where':{'id':_0x5090['params']['id']}})[_0xdbfe('0x1e')](handleEntityNotFound(_0x51d5c1,null))[_0xdbfe('0x1e')](saveUpdates(_0x5090[_0xdbfe('0x54')],null))[_0xdbfe('0x1e')](respondWithResult(_0x51d5c1,null))[_0xdbfe('0x28')](handleError(_0x51d5c1,null));};exports['destroy']=function(_0x44c2db,_0x54ff35){return db[_0xdbfe('0x4b')][_0xdbfe('0x55')]({'where':{'id':_0x44c2db[_0xdbfe('0x4f')]['id']}})['then'](handleEntityNotFound(_0x54ff35,null))[_0xdbfe('0x1e')](removeEntity(_0x54ff35,null))[_0xdbfe('0x28')](handleError(_0x54ff35,null));};exports[_0xdbfe('0x56')]=function(_0x43ba41,_0x439889){return db[_0xdbfe('0x4b')][_0xdbfe('0x56')]()[_0xdbfe('0x1e')](respondWithResult(_0x439889,null))[_0xdbfe('0x28')](handleError(_0x439889,null));};var interaction_log=require('../../config/logger')(_0xdbfe('0x57'));exports[_0xdbfe('0x58')]=function(_0x4ccd4d,_0x594a0f,_0x4b1f54){var _0x5d0fe3={'agent':{},'channel':_0xdbfe('0x59')};if(_0x4ccd4d[_0xdbfe('0x54')]['id']){delete _0x4ccd4d[_0xdbfe('0x54')]['id'];}_0x4ccd4d[_0xdbfe('0x54')]['read']=!![];_0x4ccd4d[_0xdbfe('0x54')]['readAt']=moment()['format'](_0xdbfe('0x5a'));_0x4ccd4d[_0xdbfe('0x54')]['UserId']=_0x4ccd4d[_0xdbfe('0x54')][_0xdbfe('0x5b')]||_0x4ccd4d['user']['id'];_0x5d0fe3[_0xdbfe('0x5c')]['id']=_0x4ccd4d[_0xdbfe('0x54')][_0xdbfe('0x5b')];return db['WhatsappMessage'][_0xdbfe('0x55')]({'where':{'id':_0x4ccd4d[_0xdbfe('0x4f')]['id'],'UserId':null}})[_0xdbfe('0x1e')](handleEntityNotFound(_0x594a0f,null))[_0xdbfe('0x1e')](saveUpdates(_0x4ccd4d[_0xdbfe('0x54')],null))[_0xdbfe('0x1e')](function(_0x304f02){if(_0x304f02){_0x5d0fe3[_0xdbfe('0x26')]=_0x304f02[_0xdbfe('0x5d')]({'plain':!![]});return db[_0xdbfe('0x5e')][_0xdbfe('0x55')]({'where':{'id':_0x304f02[_0xdbfe('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x594a0f,null))[_0xdbfe('0x1e')](function(_0x5c50db){if(_0x5c50db){return _0x5c50db[_0xdbfe('0x60')]({'UserId':_0x4ccd4d[_0xdbfe('0x54')][_0xdbfe('0x5b')],'read1stAt':_[_0xdbfe('0x61')](_0x5c50db[_0xdbfe('0x62')])?moment()[_0xdbfe('0x63')](_0xdbfe('0x5a')):undefined});}return null;})[_0xdbfe('0x1e')](function(_0x56d743){if(_0x56d743){_0x5d0fe3[_0xdbfe('0x64')]=_0x56d743[_0xdbfe('0x5d')]({'plain':!![]});interaction_log[_0xdbfe('0x1f')](_0xdbfe('0x65'),_0x4ccd4d[_0xdbfe('0x66')]['id'],_0x4ccd4d[_0xdbfe('0x66')][_0xdbfe('0x3a')],_0x4ccd4d['user'][_0xdbfe('0x67')],_0x5d0fe3[_0xdbfe('0x64')]['id'],_0x4ccd4d[_0xdbfe('0x54')]?JSON[_0xdbfe('0x23')](_0x4ccd4d[_0xdbfe('0x54')]):'null');return respondWithRpcPromise(_0xdbfe('0x68'),_0xdbfe('0x69'),_0x5d0fe3);}return null;})[_0xdbfe('0x1e')](function(_0x199b28){var _0x2b305='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x199b28[_0xdbfe('0x26')][_0xdbfe('0x6a')];return db[_0xdbfe('0x6b')][_0xdbfe('0x3b')](_0x2b305,{'type':db[_0xdbfe('0x6c')][_0xdbfe('0x6d')][_0xdbfe('0x6e')],'raw':!![]})[_0xdbfe('0x1e')](function(_0x29516e){return _0x29516e;});})[_0xdbfe('0x1e')](function(_0x3ba4c3){if(_0x3ba4c3){_0x5d0fe3['message']['contact']=_0x3ba4c3[0x0];if(!_0x4ccd4d[_0xdbfe('0x54')][_0xdbfe('0x5b')])return;return db[_0xdbfe('0x6f')][_0xdbfe('0x55')]({'where':{'id':_0x4ccd4d['body'][_0xdbfe('0x5b')],'role':_0xdbfe('0x5c')},'attributes':['id','name',_0xdbfe('0x70'),_0xdbfe('0x71'),_0xdbfe('0x72')],'raw':!![]});}return null;})['then'](function(_0x682198){if(!_0x682198)return null;_0x5d0fe3[_0xdbfe('0x26')]['agent']=_0x682198;return _0x5d0fe3;})['then'](function(_0x3539ca){if(_0x3539ca){if(_0x4ccd4d[_0xdbfe('0x54')][_0xdbfe('0x73')]){_0x5d0fe3['message']['interface']=util['format'](_0xdbfe('0x74'),_0x4ccd4d[_0xdbfe('0x66')]['name']);_0x5d0fe3[_0xdbfe('0x26')][_0xdbfe('0x75')]=_0x5d0fe3['channel'];_0x5d0fe3['message'][_0xdbfe('0x76')]=_0x5d0fe3[_0xdbfe('0x75')];_0x5d0fe3['message']['event']=_0xdbfe('0x58');return respondWithRpcPromise(_0xdbfe('0x77'),_0xdbfe('0x77'),{'event':_0xdbfe('0x78'),'message':_0x5d0fe3[_0xdbfe('0x26')]},client9002)[_0xdbfe('0x1e')](function(){return _0x5d0fe3;});}return _0x5d0fe3;}return null;})[_0xdbfe('0x1e')](respondWithResult(_0x594a0f,null))[_0xdbfe('0x28')](handleError(_0x594a0f,null));};var interaction_log=require(_0xdbfe('0x10'))(_0xdbfe('0x57'));exports[_0xdbfe('0x31')]=function(_0x1b6643,_0x442abb,_0x5509a6){var _0xca75bb={'agent':{},'channel':_0xdbfe('0x59')};if(_0x1b6643[_0xdbfe('0x54')]['id']){delete _0x1b6643['body']['id'];}_0x1b6643['body'][_0xdbfe('0x5b')]=_0x1b6643[_0xdbfe('0x54')][_0xdbfe('0x5b')]||_0x1b6643[_0xdbfe('0x66')]['id'];_0xca75bb[_0xdbfe('0x5c')]['id']=_0x1b6643[_0xdbfe('0x54')][_0xdbfe('0x5b')];return db[_0xdbfe('0x4b')][_0xdbfe('0x55')]({'where':{'id':_0x1b6643[_0xdbfe('0x4f')]['id'],'UserId':null}})[_0xdbfe('0x1e')](handleEntityNotFound(_0x442abb,null))['then'](function(_0x35f7f4){if(_0x35f7f4){_0xca75bb[_0xdbfe('0x26')]=_0x35f7f4[_0xdbfe('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0xdbfe('0x55')]({'where':{'id':_0x35f7f4['WhatsappInteractionId']}});}return null;})[_0xdbfe('0x1e')](handleEntityNotFound(_0x442abb,null))[_0xdbfe('0x1e')](function(_0x16ffe2){if(_0x16ffe2){_0xca75bb[_0xdbfe('0x64')]=_0x16ffe2[_0xdbfe('0x5d')]({'plain':!![]});interaction_log['info'](_0xdbfe('0x79'),_0x1b6643[_0xdbfe('0x66')]['id'],_0x1b6643[_0xdbfe('0x66')][_0xdbfe('0x3a')],_0x1b6643[_0xdbfe('0x66')][_0xdbfe('0x67')],_0xca75bb[_0xdbfe('0x64')]['id'],_0x1b6643['body']?JSON['stringify'](_0x1b6643[_0xdbfe('0x54')]):_0xdbfe('0x7a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xca75bb);}return null;})['then'](function(_0x1bc19d){var _0x1ce3c0=_0xdbfe('0x7b')+_0x1bc19d[_0xdbfe('0x26')][_0xdbfe('0x6a')];return db['sequelize'][_0xdbfe('0x3b')](_0x1ce3c0,{'type':db[_0xdbfe('0x6c')][_0xdbfe('0x6d')][_0xdbfe('0x6e')],'raw':!![]})[_0xdbfe('0x1e')](function(_0x3fff02){return _0x3fff02;});})['then'](function(_0x474633){if(_0x474633){_0xca75bb[_0xdbfe('0x26')][_0xdbfe('0x7c')]=_0x474633[0x0];if(!_0x1b6643[_0xdbfe('0x54')][_0xdbfe('0x5b')])return;return db[_0xdbfe('0x6f')][_0xdbfe('0x55')]({'where':{'id':_0x1b6643[_0xdbfe('0x54')][_0xdbfe('0x5b')],'role':_0xdbfe('0x5c')},'attributes':['id',_0xdbfe('0x3a'),'fullname',_0xdbfe('0x71'),_0xdbfe('0x72')],'raw':!![]});}return null;})['then'](function(_0x45cf8d){if(!_0x45cf8d)return null;_0xca75bb[_0xdbfe('0x26')][_0xdbfe('0x5c')]=_0x45cf8d;return _0xca75bb;})[_0xdbfe('0x1e')](function(_0x19b7d1){if(_0x19b7d1){_0x19b7d1['message'][_0xdbfe('0x7d')]=util[_0xdbfe('0x63')](_0xdbfe('0x74'),_0x1b6643[_0xdbfe('0x66')]['name']);_0x19b7d1['message'][_0xdbfe('0x75')]=_0xca75bb[_0xdbfe('0x75')];_0x19b7d1['message'][_0xdbfe('0x76')]=_0xca75bb['channel'];_0x19b7d1[_0xdbfe('0x26')][_0xdbfe('0x7e')]=_0xdbfe('0x31');respondWithRpcPromise(_0xdbfe('0x77'),_0xdbfe('0x77'),{'event':_0xdbfe('0x7f'),'message':_0x19b7d1[_0xdbfe('0x26')]},client9002);return _0xca75bb;}return null;})[_0xdbfe('0x1e')](respondWithResult(_0x442abb,null))['catch'](handleError(_0x442abb,null));};exports[_0xdbfe('0x2a')]=function(_0x83e684,_0x101ae2,_0x3e00f9){if(_0x83e684['body']['id']){delete _0x83e684[_0xdbfe('0x54')]['id'];}var _0x1155a9;return db[_0xdbfe('0x4b')][_0xdbfe('0x55')]({'where':{'id':_0x83e684[_0xdbfe('0x4f')]['id']}})[_0xdbfe('0x1e')](handleEntityNotFound(_0x101ae2,null))[_0xdbfe('0x1e')](function(_0x3314a7){if(_0x3314a7){_0x1155a9=_0x3314a7;return db[_0xdbfe('0x80')][_0xdbfe('0x55')]({'where':{'id':_0x3314a7['WhatsappAccountId']}});}})[_0xdbfe('0x1e')](handleEntityNotFound(_0x101ae2,null))[_0xdbfe('0x1e')](function(_0x1692be){if(_0x1692be){logger[_0xdbfe('0x81')](_0xdbfe('0x82'),_0xdbfe('0x2a'),_0xdbfe('0x83'),_0x1692be[_0xdbfe('0x49')],util['inspect'](_0x83e684['body'],{'showHidden':![],'depth':null}));switch(_0x1692be[_0xdbfe('0x49')]){case _0xdbfe('0x84'):if(_0x83e684[_0xdbfe('0x54')][_0xdbfe('0x85')]&&_0x83e684[_0xdbfe('0x54')][_0xdbfe('0x85')]===_0x1155a9['messageId']&&_0x83e684[_0xdbfe('0x54')]['MessageStatus']&&_0x83e684[_0xdbfe('0x54')][_0xdbfe('0x86')]===_0xdbfe('0x87')){return _0x1155a9[_0xdbfe('0x60')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xdbfe('0x2a'),'twilio',util[_0xdbfe('0x88')](_0x83e684[_0xdbfe('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x1155a9;}})[_0xdbfe('0x1e')](respondWithResult(_0x101ae2,null))[_0xdbfe('0x28')](handleError(_0x101ae2,null));};
\ No newline at end of file
+var _0xc35f=['code','message','request\x20sent','result','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','show','params','includeAll','find','catch','create','body','describe','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','channel','rejectmessage','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28a58f,_0x584c6f){var _0x40a7f0=function(_0x39618c){while(--_0x39618c){_0x28a58f['push'](_0x28a58f['shift']());}};_0x40a7f0(++_0x584c6f);}(_0xc35f,0x17e));var _0xfc35=function(_0x1ac734,_0x1ac135){_0x1ac734=_0x1ac734-0x0;var _0x16ea45=_0xc35f[_0x1ac734];return _0x16ea45;};'use strict';var emlformat=require(_0xfc35('0x0'));var rimraf=require(_0xfc35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc35('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc35('0x3'));var Mustache=require(_0xfc35('0x4'));var util=require('util');var path=require(_0xfc35('0x5'));var sox=require(_0xfc35('0x6'));var csv=require(_0xfc35('0x7'));var ejs=require(_0xfc35('0x8'));var fs=require('fs');var fs_extra=require(_0xfc35('0x9'));var _=require(_0xfc35('0xa'));var squel=require(_0xfc35('0xb'));var crypto=require(_0xfc35('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfc35('0x7'));var querystring=require(_0xfc35('0xd'));var Papa=require(_0xfc35('0xe'));var Redis=require(_0xfc35('0xf'));var authService=require(_0xfc35('0x10'));var qs=require(_0xfc35('0x11'));var as=require(_0xfc35('0x12'));var hardwareService=require(_0xfc35('0x13'));var logger=require(_0xfc35('0x14'))(_0xfc35('0x15'));var utils=require(_0xfc35('0x16'));var config=require(_0xfc35('0x17'));var licenseUtil=require(_0xfc35('0x18'));var db=require(_0xfc35('0x19'))['db'];config['redis']=_[_0xfc35('0x1a')](config['redis'],{'host':_0xfc35('0x1b'),'port':0x18eb});var socket=require(_0xfc35('0x1c'))(new Redis(config['redis']));require(_0xfc35('0x1d'))[_0xfc35('0x1e')](socket);var jayson=require(_0xfc35('0x1f'));var client=jayson[_0xfc35('0x20')][_0xfc35('0x21')]({'port':0x232c});var client9002=jayson[_0xfc35('0x20')][_0xfc35('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xa9ea30,_0x5516b9,_0x56c2d5,_0x5b59d5){return new BPromise(function(_0x15deed,_0x5f3520){var _0x49cbdb=_0x5b59d5||client;return _0x49cbdb[_0xfc35('0x22')](_0xa9ea30,_0x56c2d5)[_0xfc35('0x23')](function(_0x25328c){logger[_0xfc35('0x24')](_0xfc35('0x25'),_0x5516b9,'request\x20sent');logger['debug'](_0xfc35('0x26'),_0x5516b9,'request\x20sent',JSON[_0xfc35('0x27')](_0x25328c));if(_0x25328c[_0xfc35('0x28')]){if(_0x25328c[_0xfc35('0x28')][_0xfc35('0x29')]===0x1f4){logger['error'](_0xfc35('0x25'),_0x5516b9,_0x25328c[_0xfc35('0x28')][_0xfc35('0x2a')]);return _0x5f3520(_0x25328c[_0xfc35('0x28')][_0xfc35('0x2a')]);}logger[_0xfc35('0x28')](_0xfc35('0x25'),_0x5516b9,_0x25328c[_0xfc35('0x28')][_0xfc35('0x2a')]);return _0x15deed(_0x25328c[_0xfc35('0x28')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5516b9,_0xfc35('0x2b'));_0x15deed(_0x25328c[_0xfc35('0x2c')][_0xfc35('0x2a')]);}})['catch'](function(_0x18f968){logger[_0xfc35('0x28')](_0xfc35('0x25'),_0x5516b9,_0x18f968);_0x5f3520(_0x18f968);});});}function respondWithStatusCode(_0x1cc8d1,_0x3f43a2){_0x3f43a2=_0x3f43a2||0xcc;return function(_0x44b9d4){if(_0x44b9d4){return _0x1cc8d1[_0xfc35('0x2d')](_0x3f43a2);}return _0x1cc8d1['status'](_0x3f43a2)[_0xfc35('0x2e')]();};}function respondWithResult(_0x584be0,_0x1b29d8){_0x1b29d8=_0x1b29d8||0xc8;return function(_0xe38e5e){if(_0xe38e5e){return _0x584be0['status'](_0x1b29d8)[_0xfc35('0x2f')](_0xe38e5e);}};}function respondWithFilteredResult(_0x16138b,_0x4e4615){return function(_0x4e545a){if(_0x4e545a){var _0x1be60e=typeof _0x4e4615[_0xfc35('0x30')]===_0xfc35('0x31')&&typeof _0x4e4615[_0xfc35('0x32')]===_0xfc35('0x31');var _0x7b6233=_0x4e545a[_0xfc35('0x33')];var _0x4a5802=_0x1be60e?0x0:_0x4e4615['offset'];var _0x4566ac=_0x1be60e?_0x4e545a[_0xfc35('0x33')]:_0x4e4615['offset']+_0x4e4615[_0xfc35('0x32')];var _0x50378d;if(_0x4566ac>=_0x7b6233){_0x4566ac=_0x7b6233;_0x50378d=0xc8;}else{_0x50378d=0xce;}_0x16138b[_0xfc35('0x34')](_0x50378d);return _0x16138b['set'](_0xfc35('0x35'),_0x4a5802+'-'+_0x4566ac+'/'+_0x7b6233)['json'](_0x4e545a);}return null;};}function patchUpdates(_0x2fee0b){return function(_0x57c08a){try{jsonpatch[_0xfc35('0x36')](_0x57c08a,_0x2fee0b,!![]);}catch(_0x27a57b){return BPromise[_0xfc35('0x37')](_0x27a57b);}return _0x57c08a[_0xfc35('0x38')]();};}function saveUpdates(_0x25643b,_0x4ac7f6){return function(_0x55ae9b){if(_0x55ae9b){return _0x55ae9b[_0xfc35('0x39')](_0x25643b)[_0xfc35('0x23')](function(_0xe3e779){return _0xe3e779;});}return null;};}function removeEntity(_0xeaa8d,_0x51643b){return function(_0x1b25d7){if(_0x1b25d7){return _0x1b25d7[_0xfc35('0x3a')]()['then'](function(){_0xeaa8d[_0xfc35('0x34')](0xcc)[_0xfc35('0x2e')]();});}};}function handleEntityNotFound(_0x3bfaee,_0x3af325){return function(_0x24557c){if(!_0x24557c){_0x3bfaee[_0xfc35('0x2d')](0x194);}return _0x24557c;};}function handleError(_0x36bfa5,_0x4e4c1f){_0x4e4c1f=_0x4e4c1f||0x1f4;return function(_0x437c59){logger['error'](_0x437c59[_0xfc35('0x3b')]);if(_0x437c59[_0xfc35('0x3c')]){delete _0x437c59[_0xfc35('0x3c')];}_0x36bfa5['status'](_0x4e4c1f)['send'](_0x437c59);};}exports[_0xfc35('0x3d')]=function(_0x53d28e,_0x4f3c85){var _0x4769e7={},_0x50e274={},_0x4858b1={'count':0x0,'rows':[]};var _0xcceda6=_[_0xfc35('0x3e')](db[_0xfc35('0x3f')][_0xfc35('0x40')],function(_0x4a673c){return{'name':_0x4a673c[_0xfc35('0x41')],'type':_0x4a673c['type']['key']};});_0x50e274[_0xfc35('0x42')]=_[_0xfc35('0x3e')](_0xcceda6,_0xfc35('0x3c'));_0x50e274['query']=_[_0xfc35('0x43')](_0x53d28e[_0xfc35('0x44')]);_0x50e274[_0xfc35('0x45')]=_[_0xfc35('0x46')](_0x50e274['model'],_0x50e274[_0xfc35('0x44')]);_0x4769e7[_0xfc35('0x47')]=_['intersection'](_0x50e274[_0xfc35('0x42')],qs['fields'](_0x53d28e[_0xfc35('0x44')][_0xfc35('0x48')]));_0x4769e7[_0xfc35('0x47')]=_0x4769e7[_0xfc35('0x47')][_0xfc35('0x49')]?_0x4769e7['attributes']:_0x50e274[_0xfc35('0x42')];if(!_0x53d28e['query'][_0xfc35('0x4a')](_0xfc35('0x4b'))){_0x4769e7['limit']=qs[_0xfc35('0x32')](_0x53d28e[_0xfc35('0x44')]['limit']);_0x4769e7[_0xfc35('0x30')]=qs[_0xfc35('0x30')](_0x53d28e[_0xfc35('0x44')][_0xfc35('0x30')]);}_0x4769e7[_0xfc35('0x4c')]=qs[_0xfc35('0x4d')](_0x53d28e[_0xfc35('0x44')][_0xfc35('0x4d')]);_0x4769e7[_0xfc35('0x4e')]=qs[_0xfc35('0x45')](_[_0xfc35('0x4f')](_0x53d28e[_0xfc35('0x44')],_0x50e274['filters']),_0xcceda6);if(_0x53d28e['query']['filter']){_0x4769e7[_0xfc35('0x4e')]=_[_0xfc35('0x50')](_0x4769e7['where'],{'$or':_[_0xfc35('0x3e')](_0xcceda6,function(_0x266310){if(_0x266310['type']!=='VIRTUAL'){var _0x4a055d={};_0x4a055d[_0x266310[_0xfc35('0x3c')]]={'$like':'%'+_0x53d28e[_0xfc35('0x44')][_0xfc35('0x51')]+'%'};return _0x4a055d;}})});}_0x4769e7=_[_0xfc35('0x50')]({},_0x4769e7,_0x53d28e[_0xfc35('0x52')]);var _0x52bb9f={'where':_0x4769e7[_0xfc35('0x4e')]};return db[_0xfc35('0x3f')]['count'](_0x52bb9f)[_0xfc35('0x23')](function(_0x3b0bcf){_0x4858b1[_0xfc35('0x33')]=_0x3b0bcf;if(_0x53d28e[_0xfc35('0x44')]['includeAll']){_0x4769e7[_0xfc35('0x53')]=[{'all':!![]}];}return db[_0xfc35('0x3f')][_0xfc35('0x54')](_0x4769e7);})[_0xfc35('0x23')](function(_0x1f273b){_0x4858b1['rows']=_0x1f273b;return _0x4858b1;})['then'](respondWithFilteredResult(_0x4f3c85,_0x4769e7))['catch'](handleError(_0x4f3c85,null));};exports[_0xfc35('0x55')]=function(_0x261654,_0xb476b8){var _0x4b0cdd={'raw':!![],'where':{'id':_0x261654[_0xfc35('0x56')]['id']}},_0x3b432e={};_0x3b432e[_0xfc35('0x42')]=_[_0xfc35('0x43')](db[_0xfc35('0x3f')][_0xfc35('0x40')]);_0x3b432e[_0xfc35('0x44')]=_[_0xfc35('0x43')](_0x261654[_0xfc35('0x44')]);_0x3b432e['filters']=_[_0xfc35('0x46')](_0x3b432e['model'],_0x3b432e['query']);_0x4b0cdd[_0xfc35('0x47')]=_[_0xfc35('0x46')](_0x3b432e['model'],qs[_0xfc35('0x48')](_0x261654['query'][_0xfc35('0x48')]));_0x4b0cdd[_0xfc35('0x47')]=_0x4b0cdd[_0xfc35('0x47')][_0xfc35('0x49')]?_0x4b0cdd['attributes']:_0x3b432e[_0xfc35('0x42')];if(_0x261654[_0xfc35('0x44')][_0xfc35('0x57')]){_0x4b0cdd[_0xfc35('0x53')]=[{'all':!![]}];}_0x4b0cdd=_[_0xfc35('0x50')]({},_0x4b0cdd,_0x261654['options']);return db[_0xfc35('0x3f')][_0xfc35('0x58')](_0x4b0cdd)['then'](handleEntityNotFound(_0xb476b8,null))[_0xfc35('0x23')](respondWithResult(_0xb476b8,null))[_0xfc35('0x59')](handleError(_0xb476b8,null));};exports[_0xfc35('0x5a')]=function(_0x49d466,_0x47ed30){return db[_0xfc35('0x3f')][_0xfc35('0x5a')](_0x49d466[_0xfc35('0x5b')],{})['then'](respondWithResult(_0x47ed30,0xc9))[_0xfc35('0x59')](handleError(_0x47ed30,null));};exports[_0xfc35('0x39')]=function(_0x3571f4,_0x1cc230){if(_0x3571f4[_0xfc35('0x5b')]['id']){delete _0x3571f4[_0xfc35('0x5b')]['id'];}return db['WhatsappMessage'][_0xfc35('0x58')]({'where':{'id':_0x3571f4[_0xfc35('0x56')]['id']}})['then'](handleEntityNotFound(_0x1cc230,null))[_0xfc35('0x23')](saveUpdates(_0x3571f4[_0xfc35('0x5b')],null))[_0xfc35('0x23')](respondWithResult(_0x1cc230,null))[_0xfc35('0x59')](handleError(_0x1cc230,null));};exports[_0xfc35('0x3a')]=function(_0x38b0d4,_0x9c62ea){return db[_0xfc35('0x3f')][_0xfc35('0x58')]({'where':{'id':_0x38b0d4['params']['id']}})['then'](handleEntityNotFound(_0x9c62ea,null))[_0xfc35('0x23')](removeEntity(_0x9c62ea,null))['catch'](handleError(_0x9c62ea,null));};exports[_0xfc35('0x5c')]=function(_0x127e8a,_0x3c0173){return db['WhatsappMessage']['describe']()['then'](respondWithResult(_0x3c0173,null))['catch'](handleError(_0x3c0173,null));};var interaction_log=require(_0xfc35('0x14'))('whatsapp-interactions');exports[_0xfc35('0x5d')]=function(_0xd34d1,_0x16076e,_0xd1fe62){var _0xbcff1c={'agent':{},'channel':_0xfc35('0x5e')};if(_0xd34d1[_0xfc35('0x5b')]['id']){delete _0xd34d1[_0xfc35('0x5b')]['id'];}_0xd34d1[_0xfc35('0x5b')]['read']=!![];_0xd34d1[_0xfc35('0x5b')][_0xfc35('0x5f')]=moment()[_0xfc35('0x60')](_0xfc35('0x61'));_0xd34d1[_0xfc35('0x5b')][_0xfc35('0x62')]=_0xd34d1[_0xfc35('0x5b')][_0xfc35('0x62')]||_0xd34d1[_0xfc35('0x63')]['id'];_0xbcff1c['agent']['id']=_0xd34d1[_0xfc35('0x5b')][_0xfc35('0x62')];return db[_0xfc35('0x3f')][_0xfc35('0x58')]({'where':{'id':_0xd34d1['params']['id'],'UserId':null}})[_0xfc35('0x23')](handleEntityNotFound(_0x16076e,null))['then'](saveUpdates(_0xd34d1[_0xfc35('0x5b')],null))[_0xfc35('0x23')](function(_0x4eaff8){if(_0x4eaff8){_0xbcff1c[_0xfc35('0x2a')]=_0x4eaff8[_0xfc35('0x64')]({'plain':!![]});return db[_0xfc35('0x65')]['find']({'where':{'id':_0x4eaff8[_0xfc35('0x66')]}});}return null;})[_0xfc35('0x23')](handleEntityNotFound(_0x16076e,null))[_0xfc35('0x23')](function(_0x3024a){if(_0x3024a){return _0x3024a[_0xfc35('0x39')]({'UserId':_0xd34d1['body'][_0xfc35('0x62')],'read1stAt':_[_0xfc35('0x67')](_0x3024a['read1stAt'])?moment()['format'](_0xfc35('0x61')):undefined});}return null;})['then'](function(_0x39a9c9){if(_0x39a9c9){_0xbcff1c[_0xfc35('0x68')]=_0x39a9c9['get']({'plain':!![]});interaction_log[_0xfc35('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd34d1['user']['id'],_0xd34d1[_0xfc35('0x63')]['name'],_0xd34d1[_0xfc35('0x63')][_0xfc35('0x69')],_0xbcff1c[_0xfc35('0x68')]['id'],_0xd34d1[_0xfc35('0x5b')]?JSON['stringify'](_0xd34d1['body']):_0xfc35('0x6a'));return respondWithRpcPromise(_0xfc35('0x6b'),'acceptMessage',_0xbcff1c);}return null;})[_0xfc35('0x23')](function(_0x5f54b6){var _0x2c769a=_0xfc35('0x6c')+_0x5f54b6['message'][_0xfc35('0x6d')];return db[_0xfc35('0x6e')][_0xfc35('0x44')](_0x2c769a,{'type':db['Sequelize'][_0xfc35('0x6f')][_0xfc35('0x70')],'raw':!![]})[_0xfc35('0x23')](function(_0x116f10){return _0x116f10;});})[_0xfc35('0x23')](function(_0x44161b){if(_0x44161b){_0xbcff1c[_0xfc35('0x2a')]['contact']=_0x44161b[0x0];if(!_0xd34d1[_0xfc35('0x5b')][_0xfc35('0x62')])return;return db[_0xfc35('0x71')][_0xfc35('0x58')]({'where':{'id':_0xd34d1[_0xfc35('0x5b')]['UserId'],'role':_0xfc35('0x72')},'attributes':['id','name',_0xfc35('0x73'),_0xfc35('0x74'),_0xfc35('0x75')],'raw':!![]});}return null;})[_0xfc35('0x23')](function(_0x3e575b){if(!_0x3e575b)return null;_0xbcff1c[_0xfc35('0x2a')]['agent']=_0x3e575b;return _0xbcff1c;})[_0xfc35('0x23')](function(_0x4265e6){if(_0x4265e6){if(_0xd34d1[_0xfc35('0x5b')][_0xfc35('0x76')]){_0xbcff1c[_0xfc35('0x2a')][_0xfc35('0x77')]=util[_0xfc35('0x60')](_0xfc35('0x78'),_0xd34d1[_0xfc35('0x63')][_0xfc35('0x3c')]);_0xbcff1c[_0xfc35('0x2a')]['channel']=_0xbcff1c['channel'];_0xbcff1c['message']['motionChannel']=_0xbcff1c['channel'];_0xbcff1c['message'][_0xfc35('0x79')]='accept';return respondWithRpcPromise(_0xfc35('0x7a'),_0xfc35('0x7a'),{'event':_0xfc35('0x7b'),'message':_0xbcff1c[_0xfc35('0x2a')]},client9002)[_0xfc35('0x23')](function(){return _0xbcff1c;});}return _0xbcff1c;}return null;})['then'](respondWithResult(_0x16076e,null))[_0xfc35('0x59')](handleError(_0x16076e,null));};var interaction_log=require(_0xfc35('0x14'))(_0xfc35('0x7c'));exports[_0xfc35('0x37')]=function(_0x217c5a,_0x4948fe,_0x30af6d){var _0x40017f={'agent':{},'channel':'whatsapp'};if(_0x217c5a[_0xfc35('0x5b')]['id']){delete _0x217c5a[_0xfc35('0x5b')]['id'];}_0x217c5a[_0xfc35('0x5b')][_0xfc35('0x62')]=_0x217c5a[_0xfc35('0x5b')][_0xfc35('0x62')]||_0x217c5a[_0xfc35('0x63')]['id'];_0x40017f[_0xfc35('0x72')]['id']=_0x217c5a['body'][_0xfc35('0x62')];return db[_0xfc35('0x3f')]['find']({'where':{'id':_0x217c5a[_0xfc35('0x56')]['id'],'UserId':null}})[_0xfc35('0x23')](handleEntityNotFound(_0x4948fe,null))['then'](function(_0x21a069){if(_0x21a069){_0x40017f['message']=_0x21a069[_0xfc35('0x64')]({'plain':!![]});return db[_0xfc35('0x65')][_0xfc35('0x58')]({'where':{'id':_0x21a069[_0xfc35('0x66')]}});}return null;})[_0xfc35('0x23')](handleEntityNotFound(_0x4948fe,null))[_0xfc35('0x23')](function(_0x18b5f9){if(_0x18b5f9){_0x40017f['interaction']=_0x18b5f9['get']({'plain':!![]});interaction_log[_0xfc35('0x24')](_0xfc35('0x7d'),_0x217c5a['user']['id'],_0x217c5a['user']['name'],_0x217c5a[_0xfc35('0x63')][_0xfc35('0x69')],_0x40017f[_0xfc35('0x68')]['id'],_0x217c5a['body']?JSON[_0xfc35('0x27')](_0x217c5a[_0xfc35('0x5b')]):_0xfc35('0x6a'));return respondWithRpcPromise(_0xfc35('0x7e'),'rejectMessage',_0x40017f);}return null;})[_0xfc35('0x23')](function(_0x85a15f){var _0x4070f1=_0xfc35('0x6c')+_0x85a15f['message'][_0xfc35('0x6d')];return db[_0xfc35('0x6e')][_0xfc35('0x44')](_0x4070f1,{'type':db[_0xfc35('0x7f')][_0xfc35('0x6f')][_0xfc35('0x70')],'raw':!![]})[_0xfc35('0x23')](function(_0x2812fd){return _0x2812fd;});})['then'](function(_0x4ab16b){if(_0x4ab16b){_0x40017f[_0xfc35('0x2a')]['contact']=_0x4ab16b[0x0];if(!_0x217c5a[_0xfc35('0x5b')][_0xfc35('0x62')])return;return db[_0xfc35('0x71')][_0xfc35('0x58')]({'where':{'id':_0x217c5a[_0xfc35('0x5b')][_0xfc35('0x62')],'role':'agent'},'attributes':['id',_0xfc35('0x3c'),'fullname',_0xfc35('0x74'),_0xfc35('0x75')],'raw':!![]});}return null;})[_0xfc35('0x23')](function(_0x944a92){if(!_0x944a92)return null;_0x40017f[_0xfc35('0x2a')][_0xfc35('0x72')]=_0x944a92;return _0x40017f;})[_0xfc35('0x23')](function(_0x2a4d7c){if(_0x2a4d7c){_0x2a4d7c[_0xfc35('0x2a')]['interface']=util[_0xfc35('0x60')](_0xfc35('0x78'),_0x217c5a['user'][_0xfc35('0x3c')]);_0x2a4d7c[_0xfc35('0x2a')][_0xfc35('0x80')]=_0x40017f['channel'];_0x2a4d7c[_0xfc35('0x2a')]['motionChannel']=_0x40017f[_0xfc35('0x80')];_0x2a4d7c[_0xfc35('0x2a')][_0xfc35('0x79')]=_0xfc35('0x37');respondWithRpcPromise(_0xfc35('0x7a'),'EventManager',{'event':_0xfc35('0x81'),'message':_0x2a4d7c[_0xfc35('0x2a')]},client9002);return _0x40017f;}return null;})[_0xfc35('0x23')](respondWithResult(_0x4948fe,null))[_0xfc35('0x59')](handleError(_0x4948fe,null));};exports[_0xfc35('0x34')]=function(_0x594689,_0x4d5f5f,_0x3adf66){if(_0x594689[_0xfc35('0x5b')]['id']){delete _0x594689[_0xfc35('0x5b')]['id'];}var _0x2bf138;return db[_0xfc35('0x3f')][_0xfc35('0x58')]({'where':{'id':_0x594689[_0xfc35('0x56')]['id']}})[_0xfc35('0x23')](handleEntityNotFound(_0x4d5f5f,null))[_0xfc35('0x23')](function(_0x383613){if(_0x383613){_0x2bf138=_0x383613;return db['WhatsappAccount']['find']({'where':{'id':_0x383613[_0xfc35('0x82')]}});}})[_0xfc35('0x23')](handleEntityNotFound(_0x4d5f5f,null))[_0xfc35('0x23')](function(_0x272742){if(_0x272742){logger[_0xfc35('0x83')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xfc35('0x34'),_0xfc35('0x84'),_0x272742[_0xfc35('0x85')],util['inspect'](_0x594689[_0xfc35('0x5b')],{'showHidden':![],'depth':null}));switch(_0x272742['type']){case _0xfc35('0x86'):if(_0x594689['body'][_0xfc35('0x87')]&&_0x594689[_0xfc35('0x5b')][_0xfc35('0x87')]===_0x2bf138[_0xfc35('0x88')]&&_0x594689[_0xfc35('0x5b')]['MessageStatus']&&_0x594689[_0xfc35('0x5b')][_0xfc35('0x89')]===_0xfc35('0x8a')){return _0x2bf138[_0xfc35('0x39')]({'read':!![]});}else{logger[_0xfc35('0x28')](_0xfc35('0x8b'),'status',_0xfc35('0x86'),util[_0xfc35('0x8c')](_0x594689[_0xfc35('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2bf138;}})[_0xfc35('0x23')](respondWithResult(_0x4d5f5f,null))[_0xfc35('0x59')](handleError(_0x4d5f5f,null));};
\ No newline at end of file
index 5f755d5..8fa33a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fce=['remove','emit','hook','exports','events','../../mysqldb','WhatsappMessage','save'];(function(_0xf4786b,_0x5d8621){var _0x25f48d=function(_0x56d16d){while(--_0x56d16d){_0xf4786b['push'](_0xf4786b['shift']());}};_0x25f48d(++_0x5d8621);}(_0x7fce,0xdc));var _0xe7fc=function(_0x4910c8,_0x4cf175){_0x4910c8=_0x4910c8-0x0;var _0x404441=_0x7fce[_0x4910c8];return _0x404441;};'use strict';var EventEmitter=require(_0xe7fc('0x0'));var WhatsappMessage=require(_0xe7fc('0x1'))['db'][_0xe7fc('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7fc('0x3'),'afterUpdate':'update','afterDestroy':_0xe7fc('0x4')};function emitEvent(_0x51b19d){return function(_0x11cdec,_0x337972,_0x5810de){WhatsappMessageEvents['emit'](_0x51b19d+':'+_0x11cdec['id'],_0x11cdec);WhatsappMessageEvents[_0xe7fc('0x5')](_0x51b19d,_0x11cdec);_0x5810de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xe7fc('0x6')](e,emitEvent(event));}}module[_0xe7fc('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x3070=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x4e525e,_0x19ea3f){var _0x324f37=function(_0x3cef87){while(--_0x3cef87){_0x4e525e['push'](_0x4e525e['shift']());}};_0x324f37(++_0x19ea3f);}(_0x3070,0x75));var _0x0307=function(_0x135d36,_0x3c653d){_0x135d36=_0x135d36-0x0;var _0xf9072=_0x3070[_0x135d36];return _0xf9072;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0307('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0307('0x1')](0x0);var events={'afterCreate':_0x0307('0x2'),'afterUpdate':_0x0307('0x3'),'afterDestroy':_0x0307('0x4')};function emitEvent(_0x3dd3a5){return function(_0xb7229f,_0x5b39b8,_0x5e4edd){WhatsappMessageEvents[_0x0307('0x5')](_0x3dd3a5+':'+_0xb7229f['id'],_0xb7229f);WhatsappMessageEvents[_0x0307('0x5')](_0x3dd3a5,_0xb7229f);_0x5e4edd(null);};}for(var e in events){if(events[_0x0307('0x6')](e)){var event=events[e];WhatsappMessage[_0x0307('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index 7c7a71e..dc756be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe002=['POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','phone','accountSid','authToken','messages','whatsapp:','/api/whatsapp/messages/','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/messages/'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0xe002,0x15f));var _0x2e00=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0xe002[_0x838813];return _0x2bd32d;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var rp=require(_0x2e00('0x6'));var fetch=require(_0x2e00('0x7'));var fs=require('fs');var path=require(_0x2e00('0x8'));var rimraf=require(_0x2e00('0x9'));var config=require(_0x2e00('0xa'));var attributes=require(_0x2e00('0xb'));module['exports']=function(_0x50555c,_0x3180d4){return _0x50555c[_0x2e00('0xc')]('WhatsappMessage',attributes,{'tableName':_0x2e00('0xd'),'paranoid':![],'indexes':[{'name':_0x2e00('0xe'),'fields':[_0x2e00('0xe')]},{'name':'fti_whatsapp_messages','fields':[_0x2e00('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12836a,_0x39573d,_0x380e00){var _0x27b0e4=_0x50555c[_0x2e00('0x10')];var _0x1a6c5c=_0x12836a[_0x2e00('0x11')]({'plain':!![]});if(_0x1a6c5c['direction'][_0x2e00('0x12')]()==='in'||_0x1a6c5c[_0x2e00('0x13')]['toLowerCase']()===_0x2e00('0x14')&&!_0x1a6c5c[_0x2e00('0x15')]&&!_[_0x2e00('0x16')](_0x1a6c5c[_0x2e00('0x17')])){_0x27b0e4[_0x2e00('0x18')][_0x2e00('0x19')]({'where':{'id':_0x1a6c5c[_0x2e00('0x1a')]}})[_0x2e00('0x1b')](function(_0x116685){if(_0x116685){_0x116685[_0x2e00('0x1c')]({'lastMsgAt':_0x1a6c5c[_0x2e00('0x1d')],'lastMsgDirection':_0x1a6c5c[_0x2e00('0x13')]['toLowerCase']()});}})[_0x2e00('0x1e')](function(_0x548b57){console[_0x2e00('0x1f')](_0x548b57);});}if(_0x1a6c5c[_0x2e00('0x13')]===_0x2e00('0x14')&&!_0x1a6c5c[_0x2e00('0x15')]){var _0x22474c;_0x27b0e4[_0x2e00('0x20')]['find']({'where':{'id':_0x1a6c5c[_0x2e00('0x21')]},'raw':!![]})['then'](function(_0x42b410){_0x22474c=_0x42b410;if(_0x22474c&&_0x22474c[_0x2e00('0x22')]){switch(_0x22474c['type']){case _0x2e00('0x23'):var _0x12a82c=require(_0x2e00('0x23'));if(_0x22474c['accountSid']&&_0x22474c['authToken']&&_0x22474c[_0x2e00('0x24')]){var _0x5d73a8=new _0x12a82c(_0x22474c[_0x2e00('0x25')],_0x22474c[_0x2e00('0x26')]);_0x5d73a8[_0x2e00('0x27')]['create']({'body':_0x1a6c5c[_0x2e00('0xf')],'to':_0x2e00('0x28')+_0x1a6c5c[_0x2e00('0x24')],'from':_0x2e00('0x28')+_0x22474c[_0x2e00('0x24')],'statusCallback':_0x22474c['remote']+_0x2e00('0x29')+_0x1a6c5c['id']+'/status?token='+_0x22474c['token']})['then'](function(_0x59b3dc){if(_0x59b3dc[_0x2e00('0x2a')]){return _0x12836a[_0x2e00('0x1c')]({'messageId':_0x59b3dc[_0x2e00('0x2a')]});}})['catch'](function(_0x168454){logger['error'](_0x2e00('0x2b'),'afterCreate',_0x2e00('0x23'),util[_0x2e00('0x2c')](_0x168454,{'showHidden':![],'depth':null}));});}else{logger[_0x2e00('0x1f')](_0x2e00('0x2b'),_0x2e00('0x2d'),_0x2e00('0x23'),_0x2e00('0x2e'));}break;case'sinch':var _0x38e9c2=_0x22474c[_0x2e00('0x25')];var _0x3135cf=_0x22474c[_0x2e00('0x26')];var _0x5bd7dc=_0x22474c['baseUrl']+'/whatsapp/v1/'+_0x38e9c2+_0x2e00('0x2f');var _0x13a008={'to':[_0x1a6c5c[_0x2e00('0x24')]],'message':{'type':'text','text':_0x1a6c5c['body']}};var _0x444bb5={'method':_0x2e00('0x30'),'uri':_0x5bd7dc,'headers':{'Authorization':_0x2e00('0x31')+_0x3135cf,'Content-Type':_0x2e00('0x32')},'body':_0x13a008,'json':!![]};rp(_0x444bb5)[_0x2e00('0x1b')](function(_0x51d3e3){if(_0x51d3e3[_0x2e00('0x33')][0x0]['message_id']){return _0x12836a['update']({'messageId':_0x51d3e3['statuses'][0x0][_0x2e00('0x34')]});}})[_0x2e00('0x1e')](function(_0x2d4e7a){logger[_0x2e00('0x35')](_0x2e00('0x36'),_0x2d4e7a);});break;}}})['finally'](function(){_0x380e00();});}else{_0x380e00();}}},'charset':_0x2e00('0x37'),'collate':_0x2e00('0x38')});};
\ No newline at end of file
+var _0x406f=['../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','WhatsappInteraction','findOne','update','createdAt','catch','error','WhatsappAccountId','type','twilio','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','authToken','baseUrl','/whatsapp/v1/','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','node-fetch','path','rimraf'];(function(_0x3bdc6a,_0x1a30ed){var _0x3ec553=function(_0x702e65){while(--_0x702e65){_0x3bdc6a['push'](_0x3bdc6a['shift']());}};_0x3ec553(++_0x1a30ed);}(_0x406f,0xe8));var _0xf406=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x406f[_0x172747];return _0x509692;};'use strict';var _=require(_0xf406('0x0'));var util=require('util');var logger=require(_0xf406('0x1'))('api');var moment=require(_0xf406('0x2'));var BPromise=require(_0xf406('0x3'));var rp=require(_0xf406('0x4'));var fetch=require(_0xf406('0x5'));var fs=require('fs');var path=require(_0xf406('0x6'));var rimraf=require(_0xf406('0x7'));var config=require(_0xf406('0x8'));var attributes=require(_0xf406('0x9'));module[_0xf406('0xa')]=function(_0x235134,_0x51237b){return _0x235134[_0xf406('0xb')](_0xf406('0xc'),attributes,{'tableName':_0xf406('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf406('0xe')]},{'name':_0xf406('0xf'),'fields':['body'],'type':_0xf406('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f4847,_0x20d061,_0x3ccc9f){var _0xd9771a=_0x235134[_0xf406('0x11')];var _0xb7ebbb=_0x4f4847[_0xf406('0x12')]({'plain':!![]});if(_0xb7ebbb[_0xf406('0x13')][_0xf406('0x14')]()==='in'||_0xb7ebbb[_0xf406('0x13')][_0xf406('0x14')]()==='out'&&!_0xb7ebbb[_0xf406('0x15')]&&!_[_0xf406('0x16')](_0xb7ebbb['UserId'])){_0xd9771a[_0xf406('0x17')][_0xf406('0x18')]({'where':{'id':_0xb7ebbb['WhatsappInteractionId']}})['then'](function(_0x5cf451){if(_0x5cf451){_0x5cf451[_0xf406('0x19')]({'lastMsgAt':_0xb7ebbb[_0xf406('0x1a')],'lastMsgDirection':_0xb7ebbb[_0xf406('0x13')][_0xf406('0x14')]()});}})[_0xf406('0x1b')](function(_0x375677){console[_0xf406('0x1c')](_0x375677);});}if(_0xb7ebbb[_0xf406('0x13')]==='out'&&!_0xb7ebbb[_0xf406('0x15')]){var _0x550d44;_0xd9771a['WhatsappAccount']['find']({'where':{'id':_0xb7ebbb[_0xf406('0x1d')]},'raw':!![]})['then'](function(_0xeb0c20){_0x550d44=_0xeb0c20;if(_0x550d44&&_0x550d44['type']){switch(_0x550d44[_0xf406('0x1e')]){case'twilio':var _0x24f2d5=require(_0xf406('0x1f'));if(_0x550d44['accountSid']&&_0x550d44['authToken']&&_0x550d44[_0xf406('0x20')]){var _0x273db4=new _0x24f2d5(_0x550d44['accountSid'],_0x550d44['authToken']);_0x273db4[_0xf406('0x21')][_0xf406('0x22')]({'body':_0xb7ebbb[_0xf406('0x23')],'to':_0xf406('0x24')+_0xb7ebbb[_0xf406('0x20')],'from':_0xf406('0x24')+_0x550d44['phone'],'statusCallback':_0x550d44[_0xf406('0x25')]+_0xf406('0x26')+_0xb7ebbb['id']+_0xf406('0x27')+_0x550d44[_0xf406('0x28')]})[_0xf406('0x29')](function(_0x154d53){if(_0x154d53['sid']){return _0x4f4847[_0xf406('0x19')]({'messageId':_0x154d53['sid']});}})['catch'](function(_0x2a1bf1){logger[_0xf406('0x1c')](_0xf406('0x2a'),_0xf406('0x2b'),_0xf406('0x1f'),util[_0xf406('0x2c')](_0x2a1bf1,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf406('0x1f'),_0xf406('0x2d'));}break;case _0xf406('0x2e'):var _0x3c3456=_0x550d44[_0xf406('0x2f')];var _0x1e2e45=_0x550d44[_0xf406('0x30')];var _0x2ad014=_0x550d44[_0xf406('0x31')]+_0xf406('0x32')+_0x3c3456+'/messages/';var _0x253110={'to':[_0xb7ebbb[_0xf406('0x20')]],'message':{'type':_0xf406('0x33'),'text':_0xb7ebbb[_0xf406('0x23')]}};var _0x37b7f6={'method':_0xf406('0x34'),'uri':_0x2ad014,'headers':{'Authorization':'Bearer\x20'+_0x1e2e45,'Content-Type':_0xf406('0x35')},'body':_0x253110,'json':!![]};rp(_0x37b7f6)[_0xf406('0x29')](function(_0x4d3805){if(_0x4d3805[_0xf406('0x36')][0x0][_0xf406('0x37')]){return _0x4f4847[_0xf406('0x19')]({'messageId':_0x4d3805['statuses'][0x0][_0xf406('0x37')]});}})[_0xf406('0x1b')](function(_0x16f14e){logger[_0xf406('0x38')](_0xf406('0x39'),_0x16f14e);});break;}}})['finally'](function(){_0x3ccc9f();});}else{_0x3ccc9f();}}},'charset':_0xf406('0x3a'),'collate':_0xf406('0x3b')});};
\ No newline at end of file
index f4f2552..1cd6509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab0=['info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./whatsappMessage.socket','register','request','then'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x4ab0,0x127));var _0x04ab=function(_0x48457f,_0x27e3a9){_0x48457f=_0x48457f-0x0;var _0x2b8cbb=_0x4ab0[_0x48457f];return _0x2b8cbb;};'use strict';var _=require(_0x04ab('0x0'));var util=require(_0x04ab('0x1'));var moment=require(_0x04ab('0x2'));var BPromise=require(_0x04ab('0x3'));var rs=require(_0x04ab('0x4'));var fs=require('fs');var Redis=require(_0x04ab('0x5'));var db=require(_0x04ab('0x6'))['db'];var utils=require(_0x04ab('0x7'));var logger=require(_0x04ab('0x8'))(_0x04ab('0x9'));var config=require(_0x04ab('0xa'));var jayson=require(_0x04ab('0xb'));var client=jayson['client'][_0x04ab('0xc')]({'port':0x232a});config['redis']=_[_0x04ab('0xd')](config[_0x04ab('0xe')],{'host':_0x04ab('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04ab('0xe')]));require(_0x04ab('0x10'))[_0x04ab('0x11')](socket);function respondWithRpcPromise(_0x40aa3e,_0x57263f,_0xa84db3){return new BPromise(function(_0x23c2e9,_0xe009b6){return client[_0x04ab('0x12')](_0x40aa3e,_0xa84db3)[_0x04ab('0x13')](function(_0x4df948){logger[_0x04ab('0x14')](_0x04ab('0x15'),_0x57263f,'request\x20sent');logger[_0x04ab('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x57263f,_0x04ab('0x17'),JSON[_0x04ab('0x18')](_0x4df948));if(_0x4df948[_0x04ab('0x19')]){if(_0x4df948[_0x04ab('0x19')][_0x04ab('0x1a')]===0x1f4){logger[_0x04ab('0x19')](_0x04ab('0x15'),_0x57263f,_0x4df948[_0x04ab('0x19')][_0x04ab('0x1b')]);return _0xe009b6(_0x4df948[_0x04ab('0x19')][_0x04ab('0x1b')]);}logger[_0x04ab('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x57263f,_0x4df948[_0x04ab('0x19')][_0x04ab('0x1b')]);return _0x23c2e9(_0x4df948['error']['message']);}else{logger['info'](_0x04ab('0x15'),_0x57263f,'request\x20sent');_0x23c2e9(_0x4df948[_0x04ab('0x1c')][_0x04ab('0x1b')]);}})[_0x04ab('0x1d')](function(_0x460293){logger[_0x04ab('0x19')](_0x04ab('0x15'),_0x57263f,_0x460293);_0xe009b6(_0x460293);});});}exports[_0x04ab('0x1e')]=function(_0x41d0aa){var _0xd745d1=this;return new Promise(function(_0x169cca,_0x66905d){return db[_0x04ab('0x1f')]['create'](_0x41d0aa[_0x04ab('0x20')],{'raw':_0x41d0aa[_0x04ab('0x21')]?_0x41d0aa[_0x04ab('0x21')][_0x04ab('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x22b6d5){logger[_0x04ab('0x14')](_0x04ab('0x1e'),_0x41d0aa);logger['debug'](_0x04ab('0x1e'),_0x41d0aa,JSON['stringify'](_0x22b6d5));_0x169cca(_0x22b6d5);})[_0x04ab('0x1d')](function(_0x52ed69){logger['error']('CreateWhatsappMessage',_0x52ed69[_0x04ab('0x1b')],_0x41d0aa);_0x66905d(_0xd745d1[_0x04ab('0x19')](0x1f4,_0x52ed69[_0x04ab('0x1b')]));});});};
\ No newline at end of file
+var _0x8ef5=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x10e557,_0x39d43a){var _0x3fbc61=function(_0x33e66e){while(--_0x33e66e){_0x10e557['push'](_0x10e557['shift']());}};_0x3fbc61(++_0x39d43a);}(_0x8ef5,0x100));var _0x58ef=function(_0x1631b3,_0x4afc82){_0x1631b3=_0x1631b3-0x0;var _0x1d91c3=_0x8ef5[_0x1631b3];return _0x1d91c3;};'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(_0x58ef('0x5'));var db=require(_0x58ef('0x6'))['db'];var utils=require(_0x58ef('0x7'));var logger=require(_0x58ef('0x8'))(_0x58ef('0x9'));var config=require(_0x58ef('0xa'));var jayson=require(_0x58ef('0xb'));var client=jayson['client'][_0x58ef('0xc')]({'port':0x232a});config[_0x58ef('0xd')]=_[_0x58ef('0xe')](config['redis'],{'host':_0x58ef('0xf'),'port':0x18eb});var socket=require(_0x58ef('0x10'))(new Redis(config[_0x58ef('0xd')]));require(_0x58ef('0x11'))[_0x58ef('0x12')](socket);function respondWithRpcPromise(_0x18c5b6,_0x146ca6,_0x4c0671){return new BPromise(function(_0x24e69d,_0x22cef6){return client[_0x58ef('0x13')](_0x18c5b6,_0x4c0671)[_0x58ef('0x14')](function(_0xdde6a8){logger[_0x58ef('0x15')](_0x58ef('0x16'),_0x146ca6,_0x58ef('0x17'));logger['debug'](_0x58ef('0x18'),_0x146ca6,_0x58ef('0x17'),JSON[_0x58ef('0x19')](_0xdde6a8));if(_0xdde6a8[_0x58ef('0x1a')]){if(_0xdde6a8['error'][_0x58ef('0x1b')]===0x1f4){logger[_0x58ef('0x1a')](_0x58ef('0x16'),_0x146ca6,_0xdde6a8[_0x58ef('0x1a')][_0x58ef('0x1c')]);return _0x22cef6(_0xdde6a8[_0x58ef('0x1a')][_0x58ef('0x1c')]);}logger[_0x58ef('0x1a')](_0x58ef('0x16'),_0x146ca6,_0xdde6a8[_0x58ef('0x1a')][_0x58ef('0x1c')]);return _0x24e69d(_0xdde6a8[_0x58ef('0x1a')][_0x58ef('0x1c')]);}else{logger[_0x58ef('0x15')](_0x58ef('0x16'),_0x146ca6,'request\x20sent');_0x24e69d(_0xdde6a8[_0x58ef('0x1d')]['message']);}})[_0x58ef('0x1e')](function(_0x163766){logger[_0x58ef('0x1a')](_0x58ef('0x16'),_0x146ca6,_0x163766);_0x22cef6(_0x163766);});});}exports[_0x58ef('0x1f')]=function(_0x5c5165){var _0x25460c=this;return new Promise(function(_0x167fda,_0xa0bb09){return db[_0x58ef('0x20')][_0x58ef('0x21')](_0x5c5165[_0x58ef('0x22')],{'raw':_0x5c5165[_0x58ef('0x23')]?_0x5c5165['options'][_0x58ef('0x24')]===undefined?!![]:![]:!![]})[_0x58ef('0x14')](function(_0xf21321){logger[_0x58ef('0x15')](_0x58ef('0x1f'),_0x5c5165);logger[_0x58ef('0x25')](_0x58ef('0x1f'),_0x5c5165,JSON[_0x58ef('0x19')](_0xf21321));_0x167fda(_0xf21321);})[_0x58ef('0x1e')](function(_0x4d2288){logger[_0x58ef('0x1a')](_0x58ef('0x1f'),_0x4d2288[_0x58ef('0x1c')],_0x5c5165);_0xa0bb09(_0x25460c['error'](0x1f4,_0x4d2288[_0x58ef('0x1c')]));});});};
\ No newline at end of file
index bcfcd0a..c1d4024 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39ca=['save','remove','update','emit','removeListener','length','./whatsappMessage.events'];(function(_0x2583b9,_0x3546bc){var _0x5a9a00=function(_0x13f5da){while(--_0x13f5da){_0x2583b9['push'](_0x2583b9['shift']());}};_0x5a9a00(++_0x3546bc);}(_0x39ca,0x1aa));var _0xa39c=function(_0x2e8802,_0x59ad8c){_0x2e8802=_0x2e8802-0x0;var _0x4617aa=_0x39ca[_0x2e8802];return _0x4617aa;};'use strict';var WhatsappMessageEvents=require(_0xa39c('0x0'));var events=[_0xa39c('0x1'),_0xa39c('0x2'),_0xa39c('0x3')];function createListener(_0x2ec6b3,_0xe0c17e){return function(_0x375e88){_0xe0c17e[_0xa39c('0x4')](_0x2ec6b3,_0x375e88);};}function removeListener(_0x415ec5,_0x1f4dbc){return function(){WhatsappMessageEvents[_0xa39c('0x5')](_0x415ec5,_0x1f4dbc);};}exports['register']=function(_0x3f2812){for(var _0x1330c7=0x0,_0x4240fe=events[_0xa39c('0x6')];_0x1330c7<_0x4240fe;_0x1330c7++){var _0x420953=events[_0x1330c7];var _0x5700b2=createListener('whatsappMessage:'+_0x420953,_0x3f2812);WhatsappMessageEvents['on'](_0x420953,_0x5700b2);}};
\ No newline at end of file
+var _0x159c=['./whatsappMessage.events','remove','update','emit','register','length','whatsappMessage:'];(function(_0x41ac07,_0x3b7b7a){var _0x523e12=function(_0x383fc1){while(--_0x383fc1){_0x41ac07['push'](_0x41ac07['shift']());}};_0x523e12(++_0x3b7b7a);}(_0x159c,0xb6));var _0xc159=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x159c[_0x14add3];return _0x4a174f;};'use strict';var WhatsappMessageEvents=require(_0xc159('0x0'));var events=['save',_0xc159('0x1'),_0xc159('0x2')];function createListener(_0x52b598,_0x2e65c3){return function(_0x50d5ec){_0x2e65c3[_0xc159('0x3')](_0x52b598,_0x50d5ec);};}function removeListener(_0x258421,_0x5084d0){return function(){WhatsappMessageEvents['removeListener'](_0x258421,_0x5084d0);};}exports[_0xc159('0x4')]=function(_0xc4674f){for(var _0x2e5494=0x0,_0x2fe5f0=events[_0xc159('0x5')];_0x2e5494<_0x2fe5f0;_0x2e5494++){var _0xf1ebfb=events[_0x2e5494];var _0x3036ed=createListener(_0xc159('0x6')+_0xf1ebfb,_0xc4674f);WhatsappMessageEvents['on'](_0xf1ebfb,_0x3036ed);}};
\ No newline at end of file
index 24bd0fe..eb87363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe904=['put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents'];(function(_0x5f2f0d,_0x1d8c8b){var _0xb00125=function(_0x3ada9e){while(--_0x3ada9e){_0x5f2f0d['push'](_0x5f2f0d['shift']());}};_0xb00125(++_0x1d8c8b);}(_0xe904,0x170));var _0x4e90=function(_0x2f57d3,_0x42128e){_0x2f57d3=_0x2f57d3-0x0;var _0x2c2982=_0xe904[_0x2f57d3];return _0x2c2982;};'use strict';var multer=require('multer');var util=require(_0x4e90('0x0'));var path=require(_0x4e90('0x1'));var timeout=require(_0x4e90('0x2'));var express=require(_0x4e90('0x3'));var router=express[_0x4e90('0x4')]();var fs_extra=require(_0x4e90('0x5'));var auth=require(_0x4e90('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4e90('0x7'));var controller=require(_0x4e90('0x8'));router[_0x4e90('0x9')]('/',auth[_0x4e90('0xa')](),controller[_0x4e90('0xb')]);router[_0x4e90('0x9')](_0x4e90('0xc'),auth[_0x4e90('0xa')](),controller[_0x4e90('0xd')]);router[_0x4e90('0x9')](_0x4e90('0xe'),auth['isAuthenticated'](),controller[_0x4e90('0xf')]);router[_0x4e90('0x9')](_0x4e90('0x10'),auth[_0x4e90('0xa')](),controller[_0x4e90('0x11')]);router[_0x4e90('0x9')](_0x4e90('0x12'),auth[_0x4e90('0xa')](),controller[_0x4e90('0x13')]);router[_0x4e90('0x9')](_0x4e90('0x14'),auth[_0x4e90('0xa')](),controller[_0x4e90('0x15')]);router[_0x4e90('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4e90('0x16')]('/:id/teams',auth[_0x4e90('0xa')](),controller['addTeams']);router[_0x4e90('0x16')](_0x4e90('0x14'),auth['isAuthenticated'](),controller[_0x4e90('0x17')]);router[_0x4e90('0x18')](_0x4e90('0xe'),auth[_0x4e90('0xa')](),controller[_0x4e90('0x19')]);router[_0x4e90('0x1a')](_0x4e90('0xe'),auth[_0x4e90('0xa')](),controller[_0x4e90('0x1b')]);router[_0x4e90('0x1a')]('/:id/teams',auth[_0x4e90('0xa')](),controller['removeTeams']);router[_0x4e90('0x1a')](_0x4e90('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x321d=['/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update','delete','removeAgents','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','/describe','/:id','show','get','getTeams'];(function(_0x52abbe,_0x381148){var _0x49a2b6=function(_0x59842b){while(--_0x59842b){_0x52abbe['push'](_0x52abbe['shift']());}};_0x49a2b6(++_0x381148);}(_0x321d,0x12b));var _0xd321=function(_0x106774,_0x1709dd){_0x106774=_0x106774-0x0;var _0x34736e=_0x321d[_0x106774];return _0x34736e;};'use strict';var multer=require('multer');var util=require(_0xd321('0x0'));var path=require(_0xd321('0x1'));var timeout=require('connect-timeout');var express=require(_0xd321('0x2'));var router=express[_0xd321('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd321('0x4'));var config=require(_0xd321('0x5'));var controller=require(_0xd321('0x6'));router['get']('/',auth[_0xd321('0x7')](),controller['index']);router['get'](_0xd321('0x8'),auth[_0xd321('0x7')](),controller['describe']);router['get'](_0xd321('0x9'),auth[_0xd321('0x7')](),controller[_0xd321('0xa')]);router[_0xd321('0xb')]('/:id/members',auth[_0xd321('0x7')](),controller['getMembers']);router[_0xd321('0xb')]('/:id/teams',auth[_0xd321('0x7')](),controller[_0xd321('0xc')]);router['get'](_0xd321('0xd'),auth['isAuthenticated'](),controller[_0xd321('0xe')]);router[_0xd321('0xf')]('/',auth[_0xd321('0x7')](),controller[_0xd321('0x10')]);router['post'](_0xd321('0x11'),auth[_0xd321('0x7')](),controller[_0xd321('0x12')]);router[_0xd321('0xf')](_0xd321('0xd'),auth[_0xd321('0x7')](),controller['addAgents']);router[_0xd321('0x13')]('/:id',auth[_0xd321('0x7')](),controller[_0xd321('0x14')]);router[_0xd321('0x15')](_0xd321('0x9'),auth[_0xd321('0x7')](),controller['destroy']);router['delete'](_0xd321('0x11'),auth[_0xd321('0x7')](),controller['removeTeams']);router[_0xd321('0x15')]('/:id/users',auth[_0xd321('0x7')](),controller[_0xd321('0x16')]);module[_0xd321('0x17')]=router;
\ No newline at end of file
index 11d9a5e..5ab3e79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f73=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0x0f73,0x146));var _0x30f7=function(_0x11824a,_0x260ee1){_0x11824a=_0x11824a-0x0;var _0x4e9df1=_0x0f73[_0x11824a];return _0x4e9df1;};'use strict';var Sequelize=require(_0x30f7('0x0'));module[_0x30f7('0x1')]={'name':{'type':Sequelize[_0x30f7('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x30f7('0x3')](_0x30f7('0x4'),_0x30f7('0x5'),_0x30f7('0x6'))},'description':{'type':Sequelize[_0x30f7('0x2')]}};
\ No newline at end of file
+var _0x0434=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x519e09,_0xe842da){var _0x38d4d9=function(_0x36e48a){while(--_0x36e48a){_0x519e09['push'](_0x519e09['shift']());}};_0x38d4d9(++_0xe842da);}(_0x0434,0x1ad));var _0x4043=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x0434[_0x4b4f24];return _0x1c13d4;};'use strict';var Sequelize=require(_0x4043('0x0'));module[_0x4043('0x1')]={'name':{'type':Sequelize[_0x4043('0x2')],'unique':_0x4043('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4043('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4043('0x5'),_0x4043('0x6'))},'description':{'type':Sequelize[_0x4043('0x2')]}};
\ No newline at end of file
index ed3d571..e0cfc3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa149=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','order','UserWhatsappQueue','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','ids','findAll','User','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','userWhatsappQueue:remove','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x325df9,_0x438f69){var _0x58d11c=function(_0x485709){while(--_0x485709){_0x325df9['push'](_0x325df9['shift']());}};_0x58d11c(++_0x438f69);}(_0xa149,0x103));var _0x9a14=function(_0x56781f,_0x40dac3){_0x56781f=_0x56781f-0x0;var _0x4018a7=_0xa149[_0x56781f];return _0x4018a7;};'use strict';var emlformat=require(_0x9a14('0x0'));var rimraf=require(_0x9a14('0x1'));var zipdir=require(_0x9a14('0x2'));var jsonpatch=require(_0x9a14('0x3'));var rp=require('request-promise');var moment=require(_0x9a14('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9a14('0x5'));var csv=require(_0x9a14('0x6'));var ejs=require(_0x9a14('0x7'));var fs=require('fs');var fs_extra=require(_0x9a14('0x8'));var _=require(_0x9a14('0x9'));var squel=require(_0x9a14('0xa'));var crypto=require(_0x9a14('0xb'));var jsforce=require(_0x9a14('0xc'));var deskjs=require(_0x9a14('0xd'));var toCsv=require(_0x9a14('0x6'));var querystring=require('querystring');var Papa=require(_0x9a14('0xe'));var Redis=require(_0x9a14('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a14('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a14('0x11'))(_0x9a14('0x12'));var utils=require('../../config/utils');var config=require(_0x9a14('0x13'));var licenseUtil=require(_0x9a14('0x14'));var db=require(_0x9a14('0x15'))['db'];config[_0x9a14('0x16')]=_[_0x9a14('0x17')](config[_0x9a14('0x16')],{'host':_0x9a14('0x18'),'port':0x18eb});var socket=require(_0x9a14('0x19'))(new Redis(config[_0x9a14('0x16')]));require('./whatsappQueue.socket')[_0x9a14('0x1a')](socket);function respondWithStatusCode(_0x470c62,_0xae836c){_0xae836c=_0xae836c||0xcc;return function(_0x34325f){if(_0x34325f){return _0x470c62[_0x9a14('0x1b')](_0xae836c);}return _0x470c62[_0x9a14('0x1c')](_0xae836c)['end']();};}function respondWithResult(_0x2f9f3e,_0x2a6b84){_0x2a6b84=_0x2a6b84||0xc8;return function(_0x42bcc3){if(_0x42bcc3){return _0x2f9f3e[_0x9a14('0x1c')](_0x2a6b84)['json'](_0x42bcc3);}};}function respondWithFilteredResult(_0x281d4b,_0x558193){return function(_0x5b0bd8){if(_0x5b0bd8){var _0x11f598=typeof _0x558193[_0x9a14('0x1d')]===_0x9a14('0x1e')&&typeof _0x558193[_0x9a14('0x1f')]===_0x9a14('0x1e');var _0x584105=_0x5b0bd8[_0x9a14('0x20')];var _0x2c45ce=_0x11f598?0x0:_0x558193[_0x9a14('0x1d')];var _0x1f218d=_0x11f598?_0x5b0bd8[_0x9a14('0x20')]:_0x558193[_0x9a14('0x1d')]+_0x558193[_0x9a14('0x1f')];var _0x2cdf2b;if(_0x1f218d>=_0x584105){_0x1f218d=_0x584105;_0x2cdf2b=0xc8;}else{_0x2cdf2b=0xce;}_0x281d4b['status'](_0x2cdf2b);return _0x281d4b['set'](_0x9a14('0x21'),_0x2c45ce+'-'+_0x1f218d+'/'+_0x584105)[_0x9a14('0x22')](_0x5b0bd8);}return null;};}function patchUpdates(_0x54c4d3){return function(_0x3d451b){try{jsonpatch['apply'](_0x3d451b,_0x54c4d3,!![]);}catch(_0xda737c){return BPromise['reject'](_0xda737c);}return _0x3d451b[_0x9a14('0x23')]();};}function saveUpdates(_0x2752b3,_0x103099){return function(_0x493885){if(_0x493885){return _0x493885[_0x9a14('0x24')](_0x2752b3)[_0x9a14('0x25')](function(_0x1d45d7){return _0x1d45d7;});}return null;};}function removeEntity(_0x514094,_0x3eccb0){return function(_0x45f6d2){if(_0x45f6d2){return _0x45f6d2[_0x9a14('0x26')]()[_0x9a14('0x25')](function(){var _0x478073=_0x45f6d2[_0x9a14('0x27')]({'plain':!![]});var _0x58040c=_0x9a14('0x28');return db[_0x9a14('0x29')][_0x9a14('0x26')]({'where':{'type':_0x58040c,'resourceId':_0x478073['id']}})[_0x9a14('0x25')](function(){return _0x45f6d2;});})['then'](function(){_0x514094[_0x9a14('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585939,_0x422eef){return function(_0x29b9d5){if(!_0x29b9d5){_0x585939[_0x9a14('0x1b')](0x194);}return _0x29b9d5;};}function handleError(_0x5a4afa,_0x575a4c){_0x575a4c=_0x575a4c||0x1f4;return function(_0x544550){logger[_0x9a14('0x2a')](_0x544550[_0x9a14('0x2b')]);if(_0x544550['name']){delete _0x544550[_0x9a14('0x2c')];}_0x5a4afa[_0x9a14('0x1c')](_0x575a4c)[_0x9a14('0x2d')](_0x544550);};}exports[_0x9a14('0x2e')]=function(_0x6d032b,_0x67c635){var _0x3d9096={},_0x339e97={},_0x2cce97={'count':0x0,'rows':[]};var _0x38c419=_[_0x9a14('0x2f')](db[_0x9a14('0x30')][_0x9a14('0x31')],function(_0x53abd3){return{'name':_0x53abd3[_0x9a14('0x32')],'type':_0x53abd3[_0x9a14('0x33')]['key']};});_0x339e97[_0x9a14('0x34')]=_[_0x9a14('0x2f')](_0x38c419,_0x9a14('0x2c'));_0x339e97[_0x9a14('0x35')]=_[_0x9a14('0x36')](_0x6d032b[_0x9a14('0x35')]);_0x339e97[_0x9a14('0x37')]=_['intersection'](_0x339e97[_0x9a14('0x34')],_0x339e97[_0x9a14('0x35')]);_0x3d9096[_0x9a14('0x38')]=_[_0x9a14('0x39')](_0x339e97[_0x9a14('0x34')],qs[_0x9a14('0x3a')](_0x6d032b['query'][_0x9a14('0x3a')]));_0x3d9096[_0x9a14('0x38')]=_0x3d9096['attributes'][_0x9a14('0x3b')]?_0x3d9096[_0x9a14('0x38')]:_0x339e97[_0x9a14('0x34')];if(!_0x6d032b[_0x9a14('0x35')][_0x9a14('0x3c')](_0x9a14('0x3d'))){_0x3d9096[_0x9a14('0x1f')]=qs[_0x9a14('0x1f')](_0x6d032b['query'][_0x9a14('0x1f')]);_0x3d9096[_0x9a14('0x1d')]=qs[_0x9a14('0x1d')](_0x6d032b[_0x9a14('0x35')][_0x9a14('0x1d')]);}_0x3d9096['order']=qs[_0x9a14('0x3e')](_0x6d032b[_0x9a14('0x35')][_0x9a14('0x3e')]);_0x3d9096[_0x9a14('0x3f')]=qs[_0x9a14('0x37')](_[_0x9a14('0x40')](_0x6d032b[_0x9a14('0x35')],_0x339e97['filters']),_0x38c419);if(_0x6d032b[_0x9a14('0x35')][_0x9a14('0x41')]){_0x3d9096['where']=_[_0x9a14('0x42')](_0x3d9096['where'],{'$or':_[_0x9a14('0x2f')](_0x38c419,function(_0x2bb832){if(_0x2bb832[_0x9a14('0x33')]!==_0x9a14('0x43')){var _0x4838e8={};_0x4838e8[_0x2bb832[_0x9a14('0x2c')]]={'$like':'%'+_0x6d032b[_0x9a14('0x35')][_0x9a14('0x41')]+'%'};return _0x4838e8;}})});}_0x3d9096=_['merge']({},_0x3d9096,_0x6d032b[_0x9a14('0x44')]);var _0x44d8f7={'where':_0x3d9096['where']};return db[_0x9a14('0x30')]['count'](_0x44d8f7)[_0x9a14('0x25')](function(_0x13d0d3){_0x2cce97[_0x9a14('0x20')]=_0x13d0d3;if(_0x6d032b['query'][_0x9a14('0x45')]){_0x3d9096[_0x9a14('0x46')]=[{'all':!![]}];}return db[_0x9a14('0x30')]['findAll'](_0x3d9096);})[_0x9a14('0x25')](function(_0x470246){_0x2cce97['rows']=_0x470246;return _0x2cce97;})[_0x9a14('0x25')](respondWithFilteredResult(_0x67c635,_0x3d9096))[_0x9a14('0x47')](handleError(_0x67c635,null));};exports[_0x9a14('0x48')]=function(_0x190c9a,_0x2f584b){var _0x5dc273={'raw':!![],'where':{'id':_0x190c9a['params']['id']}},_0x27469f={};_0x27469f[_0x9a14('0x34')]=_[_0x9a14('0x36')](db[_0x9a14('0x30')][_0x9a14('0x31')]);_0x27469f[_0x9a14('0x35')]=_[_0x9a14('0x36')](_0x190c9a[_0x9a14('0x35')]);_0x27469f[_0x9a14('0x37')]=_[_0x9a14('0x39')](_0x27469f[_0x9a14('0x34')],_0x27469f[_0x9a14('0x35')]);_0x5dc273[_0x9a14('0x38')]=_[_0x9a14('0x39')](_0x27469f[_0x9a14('0x34')],qs['fields'](_0x190c9a['query'][_0x9a14('0x3a')]));_0x5dc273['attributes']=_0x5dc273[_0x9a14('0x38')][_0x9a14('0x3b')]?_0x5dc273['attributes']:_0x27469f[_0x9a14('0x34')];if(_0x190c9a[_0x9a14('0x35')][_0x9a14('0x45')]){_0x5dc273['include']=[{'all':!![]}];}_0x5dc273=_[_0x9a14('0x42')]({},_0x5dc273,_0x190c9a[_0x9a14('0x44')]);return db[_0x9a14('0x30')][_0x9a14('0x49')](_0x5dc273)[_0x9a14('0x25')](handleEntityNotFound(_0x2f584b,null))[_0x9a14('0x25')](respondWithResult(_0x2f584b,null))[_0x9a14('0x47')](handleError(_0x2f584b,null));};exports['create']=function(_0x4a9015,_0x3d9039){return db['WhatsappQueue'][_0x9a14('0x4a')](_0x4a9015[_0x9a14('0x4b')],{})[_0x9a14('0x25')](function(_0xd7d862){var _0x320d42=_0x4a9015[_0x9a14('0x4c')][_0x9a14('0x27')]({'plain':!![]});if(!_0x320d42)throw new Error(_0x9a14('0x4d'));if(_0x320d42[_0x9a14('0x4e')]===_0x9a14('0x4c')){var _0x23d429=_0xd7d862[_0x9a14('0x27')]({'plain':!![]});var _0x50a30c=_0x9a14('0x28');return db['UserProfileSection'][_0x9a14('0x49')]({'where':{'name':_0x50a30c,'userProfileId':_0x320d42['userProfileId']},'raw':!![]})[_0x9a14('0x25')](function(_0x5552ca){if(_0x5552ca&&_0x5552ca[_0x9a14('0x4f')]===0x0){return db['UserProfileResource'][_0x9a14('0x4a')]({'name':_0x23d429['name'],'resourceId':_0x23d429['id'],'type':_0x5552ca[_0x9a14('0x2c')],'sectionId':_0x5552ca['id']},{})['then'](function(){return _0xd7d862;});}else{return _0xd7d862;}})[_0x9a14('0x47')](function(_0x18b344){logger[_0x9a14('0x2a')](_0x9a14('0x50'),_0x18b344);throw _0x18b344;});}return _0xd7d862;})['then'](respondWithResult(_0x3d9039,0xc9))[_0x9a14('0x47')](handleError(_0x3d9039,null));};exports[_0x9a14('0x24')]=function(_0x3cca3a,_0x158003){if(_0x3cca3a[_0x9a14('0x4b')]['id']){delete _0x3cca3a[_0x9a14('0x4b')]['id'];}return db[_0x9a14('0x30')][_0x9a14('0x49')]({'where':{'id':_0x3cca3a[_0x9a14('0x51')]['id']}})[_0x9a14('0x25')](handleEntityNotFound(_0x158003,null))[_0x9a14('0x25')](saveUpdates(_0x3cca3a[_0x9a14('0x4b')],null))['then'](respondWithResult(_0x158003,null))[_0x9a14('0x47')](handleError(_0x158003,null));};exports[_0x9a14('0x26')]=function(_0x5456e6,_0x4a49a5){return db[_0x9a14('0x30')][_0x9a14('0x49')]({'where':{'id':_0x5456e6[_0x9a14('0x51')]['id']}})[_0x9a14('0x25')](handleEntityNotFound(_0x4a49a5,null))['then'](removeEntity(_0x4a49a5,null))['catch'](handleError(_0x4a49a5,null));};exports[_0x9a14('0x52')]=function(_0x543fc6,_0x848141){return db[_0x9a14('0x30')][_0x9a14('0x52')]()[_0x9a14('0x25')](respondWithResult(_0x848141,null))[_0x9a14('0x47')](handleError(_0x848141,null));};exports[_0x9a14('0x53')]=function(_0x4cd660,_0x3a5cb7,_0x3e8419){var _0x271479={'raw':!![],'where':{}},_0x431944={},_0x586255;return db[_0x9a14('0x30')][_0x9a14('0x54')]({'where':{'id':_0x4cd660[_0x9a14('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a5cb7,null))['then'](function(_0x35a4e3){if(_0x35a4e3){_0x586255=_0x35a4e3[_0x9a14('0x27')]({'plain':!![]});_0x431944[_0x9a14('0x34')]=_[_0x9a14('0x36')](db['UserWhatsappQueue'][_0x9a14('0x31')]);_0x431944[_0x9a14('0x35')]=_[_0x9a14('0x36')](_0x4cd660[_0x9a14('0x35')]);_0x431944[_0x9a14('0x37')]=_[_0x9a14('0x39')](_0x431944[_0x9a14('0x34')],_0x431944[_0x9a14('0x35')]);_0x271479[_0x9a14('0x38')]=_[_0x9a14('0x39')](_0x431944[_0x9a14('0x34')],qs[_0x9a14('0x3a')](_0x4cd660[_0x9a14('0x35')][_0x9a14('0x3a')]));_0x271479[_0x9a14('0x38')]=_0x271479[_0x9a14('0x38')][_0x9a14('0x3b')]?_0x271479['attributes']:_0x431944['model'];if(!_0x4cd660[_0x9a14('0x35')][_0x9a14('0x3c')](_0x9a14('0x3d'))){_0x271479[_0x9a14('0x1f')]=qs[_0x9a14('0x1f')](_0x4cd660[_0x9a14('0x35')]['limit']);_0x271479['offset']=qs[_0x9a14('0x1d')](_0x4cd660['query'][_0x9a14('0x1d')]);}_0x271479[_0x9a14('0x55')]=qs['sort'](_0x4cd660[_0x9a14('0x35')]['sort']);_0x271479[_0x9a14('0x3f')]=qs['filters'](_['pick'](_0x4cd660['query'],_0x431944[_0x9a14('0x37')]));_0x271479[_0x9a14('0x3f')]['WhatsappQueueId']=_0x35a4e3['id'];if(_0x4cd660[_0x9a14('0x35')]['filter']){_0x271479['where']=_[_0x9a14('0x42')](_0x271479[_0x9a14('0x3f')],{'$or':_['map'](_0x271479[_0x9a14('0x38')],function(_0x140818){var _0x19e60a={};_0x19e60a[_0x140818]={'$like':'%'+_0x4cd660[_0x9a14('0x35')][_0x9a14('0x41')]+'%'};return _0x19e60a;})});}_0x271479=_['merge']({},_0x271479,_0x4cd660[_0x9a14('0x44')]);return db[_0x9a14('0x56')]['findAll'](_0x271479);}})[_0x9a14('0x25')](function(_0x31bf5f){if(_0x31bf5f){return db['User']['findAndCountAll']({'where':{'id':_[_0x9a14('0x2f')](_0x31bf5f,_0x9a14('0x57')),'role':_0x9a14('0x58')},'attributes':['id',_0x9a14('0x2c'),_0x9a14('0x59'),_0x9a14('0x5a'),_0x9a14('0x5b')]});}})['then'](function(_0x11db39){if(_0x11db39){return{'count':_0x11db39[_0x9a14('0x20')],'rows':_[_0x9a14('0x2f')](_0x11db39[_0x9a14('0x5c')],function(_0x22322b){return{'membername':_0x22322b[_0x9a14('0x2c')],'UserId':_0x22322b['id'],'queue_name':_0x586255[_0x9a14('0x2c')],'WhatsappQueueId':_0x586255['id'],'interface':util[_0x9a14('0x5d')]('%s/%s',_0x9a14('0x5e'),_0x22322b[_0x9a14('0x2c')]),'penalty':0x0,'paused':_0x22322b[_0x9a14('0x59')],'createdAt':_0x22322b[_0x9a14('0x5b')],'updatedAt':_0x22322b[_0x9a14('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a5cb7,_0x271479))['catch'](handleError(_0x3a5cb7,null));};exports[_0x9a14('0x5f')]=function(_0x312f61,_0x5c11c5,_0x1511ac){var _0x37c234={};var _0x3b3488={};var _0x20f7cc;var _0x2f4552;return db['WhatsappQueue']['findOne']({'where':{'id':_0x312f61[_0x9a14('0x51')]['id']}})['then'](handleEntityNotFound(_0x5c11c5,null))['then'](function(_0x251d01){if(_0x251d01){_0x20f7cc=_0x251d01;_0x3b3488['model']=_['keys'](db[_0x9a14('0x60')][_0x9a14('0x31')]);_0x3b3488[_0x9a14('0x35')]=_[_0x9a14('0x36')](_0x312f61['query']);_0x3b3488[_0x9a14('0x37')]=_['intersection'](_0x3b3488[_0x9a14('0x34')],_0x3b3488['query']);_0x37c234[_0x9a14('0x38')]=_['intersection'](_0x3b3488[_0x9a14('0x34')],qs[_0x9a14('0x3a')](_0x312f61[_0x9a14('0x35')]['fields']));_0x37c234[_0x9a14('0x38')]=_0x37c234[_0x9a14('0x38')][_0x9a14('0x3b')]?_0x37c234[_0x9a14('0x38')]:_0x3b3488['model'];_0x37c234['order']=qs[_0x9a14('0x3e')](_0x312f61[_0x9a14('0x35')][_0x9a14('0x3e')]);_0x37c234[_0x9a14('0x3f')]=qs['filters'](_[_0x9a14('0x40')](_0x312f61[_0x9a14('0x35')],_0x3b3488[_0x9a14('0x37')]));if(_0x312f61[_0x9a14('0x35')][_0x9a14('0x41')]){_0x37c234[_0x9a14('0x3f')]=_['merge'](_0x37c234[_0x9a14('0x3f')],{'$or':_[_0x9a14('0x2f')](_0x37c234[_0x9a14('0x38')],function(_0x47477e){var _0xbd5218={};_0xbd5218[_0x47477e]={'$like':'%'+_0x312f61['query'][_0x9a14('0x41')]+'%'};return _0xbd5218;})});}_0x37c234=_[_0x9a14('0x42')]({},_0x37c234,_0x312f61[_0x9a14('0x44')]);return _0x20f7cc[_0x9a14('0x5f')](_0x37c234);}})['then'](function(_0x364773){if(_0x364773){_0x2f4552=_0x364773[_0x9a14('0x3b')];if(!_0x312f61[_0x9a14('0x35')][_0x9a14('0x3c')](_0x9a14('0x3d'))){_0x37c234['limit']=qs[_0x9a14('0x1f')](_0x312f61['query']['limit']);_0x37c234[_0x9a14('0x1d')]=qs[_0x9a14('0x1d')](_0x312f61[_0x9a14('0x35')][_0x9a14('0x1d')]);}return _0x20f7cc['getTeams'](_0x37c234);}})[_0x9a14('0x25')](function(_0x43b480){if(_0x43b480){return _0x43b480?{'count':_0x2f4552,'rows':_0x43b480}:null;}})['then'](respondWithResult(_0x5c11c5,null))[_0x9a14('0x47')](handleError(_0x5c11c5,null));};exports[_0x9a14('0x61')]=function(_0x177751,_0x245301,_0x4d06bb){var _0x4666b6=_0x177751[_0x9a14('0x4b')][_0x9a14('0x62')];return db[_0x9a14('0x60')][_0x9a14('0x63')]({'where':{'id':_0x4666b6},'attributes':['id'],'include':[{'model':db[_0x9a14('0x64')],'as':'Agents','attributes':['id',_0x9a14('0x2c'),_0x9a14('0x65'),_0x9a14('0x66'),_0x9a14('0x67')],'raw':!![]}]})[_0x9a14('0x25')](function(_0x14b94c){if(_0x14b94c){var _0x1b8199=_[_0x9a14('0x68')](_0x14b94c,function(_0x51a7f0){var _0x32170b=_0x51a7f0[_0x9a14('0x27')]({'plain':!![]});return _0x32170b[_0x9a14('0x69')];});return db['WhatsappQueue'][_0x9a14('0x49')]({'where':{'id':_0x177751[_0x9a14('0x51')]['id']}})[_0x9a14('0x25')](function(_0x31cab1){return db['sequelize'][_0x9a14('0x6a')](function(_0x416533){return _0x31cab1[_0x9a14('0x61')](_0x4666b6,{'transaction':_0x416533})[_0x9a14('0x25')](function(){return BPromise[_0x9a14('0x6b')](_0x1b8199,function(_0x13d165){return db[_0x9a14('0x56')][_0x9a14('0x6c')]({'where':{'UserId':_0x13d165['id'],'WhatsappQueueId':_0x177751[_0x9a14('0x51')]['id']},'transaction':_0x416533});});})['then'](function(){_0x1b8199[_0x9a14('0x6d')](function(_0x3c95c3){socket[_0x9a14('0x6e')](_0x9a14('0x6f'),{'UserId':_0x3c95c3['id'],'WhatsappQueueId':_0x31cab1['id']});});});});});}})[_0x9a14('0x25')](respondWithStatusCode(_0x245301,null))['catch'](handleError(_0x245301,null));};exports[_0x9a14('0x70')]=function(_0x454f9c,_0x172966,_0x1a9bf1){return db[_0x9a14('0x60')][_0x9a14('0x63')]({'where':{'id':_0x454f9c[_0x9a14('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9a14('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9a14('0x25')](handleEntityNotFound(_0x172966,null))[_0x9a14('0x25')](function(_0x35b652){var _0x42104e=_[_0x9a14('0x2f')](_0x35b652,'id');var _0x464ae4=[];var _0x22c6eb=[];var _0x493b89=squel[_0x9a14('0x71')]();_0x493b89[_0x9a14('0x72')](_0x9a14('0x73'))[_0x9a14('0x74')](_0x9a14('0x75'),'tq')['join'](_0x9a14('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9a14('0x3f')]('WhatsappQueueId\x20=\x20?',_0x454f9c[_0x9a14('0x51')]['id']);for(var _0x4a8535=0x0;_0x4a8535<_0x35b652[_0x9a14('0x3b')];_0x4a8535+=0x1){let _0x37c1af=_0x35b652[_0x4a8535];for(var _0x16c7c7=0x0;_0x16c7c7<_0x37c1af[_0x9a14('0x69')]['length'];_0x16c7c7+=0x1){let _0x4dfd64=_0x37c1af[_0x9a14('0x69')][_0x16c7c7];var _0x44dd2e=_0x493b89[_0x9a14('0x77')]();_0x44dd2e[_0x9a14('0x3f')](_0x9a14('0x78'),_0x4dfd64['id']);_0x22c6eb[_0x9a14('0x79')](db['sequelize'][_0x9a14('0x35')](_0x44dd2e[_0x9a14('0x7a')](),{'type':db[_0x9a14('0x7b')][_0x9a14('0x7c')][_0x9a14('0x7d')]})[_0x9a14('0x25')](function(_0x468923){if(_0x468923[_0x9a14('0x3b')]===0x1){return _0x4dfd64['id'];}else{var _0xffb122=_[_0x9a14('0x7e')](_[_0x9a14('0x2f')](_0x468923,_0x9a14('0x7f')),function(_0x55f3fa){return _['includes'](_0x42104e,_0x55f3fa);});if(_0xffb122){return _0x4dfd64['id'];}}}));}}return BPromise[_0x9a14('0x80')](_0x22c6eb)[_0x9a14('0x25')](function(_0x15d4b3){_0x464ae4=_(_0x464ae4)[_0x9a14('0x81')](_0x15d4b3)[_0x9a14('0x82')]()['value']();return db[_0x9a14('0x30')][_0x9a14('0x49')]({'where':{'id':_0x454f9c[_0x9a14('0x51')]['id']}})['then'](function(_0x42b791){return db['sequelize'][_0x9a14('0x6a')](function(_0x354b44){return _0x42b791[_0x9a14('0x70')](_0x454f9c['query']['ids'],{'transaction':_0x354b44})['then'](function(){if(!_[_0x9a14('0x83')](_0x464ae4)){return _0x42b791['removeAgents'](_0x464ae4,{'transaction':_0x354b44});}})['then'](function(){_0x464ae4[_0x9a14('0x6d')](function(_0x3f3b5e){socket['emit'](_0x9a14('0x84'),{'UserId':_0x3f3b5e,'WhatsappQueueId':_0x42b791['id']});});});});});});})[_0x9a14('0x25')](respondWithStatusCode(_0x172966,null))[_0x9a14('0x47')](handleError(_0x172966,null));};exports['addAgents']=function(_0x2320c5,_0xa2f48a,_0x4c44bc){return db['WhatsappQueue'][_0x9a14('0x49')]({'where':{'id':_0x2320c5[_0x9a14('0x51')]['id']}})[_0x9a14('0x25')](handleEntityNotFound(_0xa2f48a,null))[_0x9a14('0x25')](function(_0x25dc35){if(_0x25dc35){return _0x25dc35['addAgents'](_0x2320c5[_0x9a14('0x4b')][_0x9a14('0x62')],_[_0x9a14('0x85')](_0x2320c5[_0x9a14('0x4b')],[_0x9a14('0x62'),'id'])||{})[_0x9a14('0x86')](function(_0x21f28d){for(var _0x3f1dff=0x0;_0x3f1dff<_0x2320c5['body'][_0x9a14('0x62')][_0x9a14('0x3b')];_0x3f1dff+=0x1){socket[_0x9a14('0x6e')]('userWhatsappQueue:save',{'UserId':Number(_0x2320c5['body'][_0x9a14('0x62')][_0x3f1dff]),'WhatsappQueueId':Number(_0x2320c5[_0x9a14('0x51')]['id'])});}return _0x21f28d;});}})['then'](respondWithResult(_0xa2f48a,null))[_0x9a14('0x47')](handleError(_0xa2f48a,null));};exports[_0x9a14('0x87')]=function(_0x5865fd,_0x2bf224,_0x4f5a54){return db[_0x9a14('0x30')][_0x9a14('0x49')]({'where':{'id':_0x5865fd[_0x9a14('0x51')]['id']}})[_0x9a14('0x25')](handleEntityNotFound(_0x2bf224,null))[_0x9a14('0x25')](function(_0x538de0){if(_0x538de0){return _0x538de0[_0x9a14('0x87')](_0x5865fd[_0x9a14('0x35')][_0x9a14('0x62')])[_0x9a14('0x25')](function(){if(_[_0x9a14('0x88')](_0x5865fd[_0x9a14('0x35')]['ids'])){for(var _0x1c45b9=0x0;_0x1c45b9<_0x5865fd['query']['ids'][_0x9a14('0x3b')];_0x1c45b9+=0x1){socket[_0x9a14('0x6e')](_0x9a14('0x84'),{'UserId':Number(_0x5865fd['query']['ids'][_0x1c45b9]),'WhatsappQueueId':Number(_0x5865fd[_0x9a14('0x51')]['id'])});}}else{socket[_0x9a14('0x6e')](_0x9a14('0x84'),{'UserId':Number(_0x5865fd[_0x9a14('0x35')][_0x9a14('0x62')]),'WhatsappQueueId':Number(_0x5865fd['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2bf224,null))['catch'](handleError(_0x2bf224,null));};exports['getAgents']=function(_0x44afed,_0x5b3ffc,_0x3110f5){var _0x4847e2={};var _0x42e288={};var _0x1942d0;var _0x108614;return db[_0x9a14('0x30')]['findOne']({'where':{'id':_0x44afed[_0x9a14('0x51')]['id']}})[_0x9a14('0x25')](handleEntityNotFound(_0x5b3ffc,null))[_0x9a14('0x25')](function(_0x4444b6){if(_0x4444b6){_0x1942d0=_0x4444b6;_0x42e288[_0x9a14('0x34')]=_[_0x9a14('0x36')](db['User'][_0x9a14('0x31')]);_0x42e288[_0x9a14('0x35')]=_[_0x9a14('0x36')](_0x44afed[_0x9a14('0x35')]);_0x42e288[_0x9a14('0x37')]=_['intersection'](_0x42e288[_0x9a14('0x34')],_0x42e288[_0x9a14('0x35')]);_0x4847e2[_0x9a14('0x38')]=_[_0x9a14('0x39')](_0x42e288[_0x9a14('0x34')],qs[_0x9a14('0x3a')](_0x44afed['query'][_0x9a14('0x3a')]));_0x4847e2['attributes']=_0x4847e2[_0x9a14('0x38')]['length']?_0x4847e2[_0x9a14('0x38')]:_0x42e288[_0x9a14('0x34')];_0x4847e2[_0x9a14('0x55')]=qs[_0x9a14('0x3e')](_0x44afed[_0x9a14('0x35')][_0x9a14('0x3e')]);_0x4847e2[_0x9a14('0x3f')]=qs[_0x9a14('0x37')](_[_0x9a14('0x40')](_0x44afed[_0x9a14('0x35')],_0x42e288[_0x9a14('0x37')]));if(_0x44afed[_0x9a14('0x35')][_0x9a14('0x41')]){_0x4847e2[_0x9a14('0x3f')]=_[_0x9a14('0x42')](_0x4847e2[_0x9a14('0x3f')],{'$or':_['map'](_0x4847e2[_0x9a14('0x38')],function(_0x303b0b){var _0xd646c9={};_0xd646c9[_0x303b0b]={'$like':'%'+_0x44afed['query'][_0x9a14('0x41')]+'%'};return _0xd646c9;})});}_0x4847e2=_['merge']({},_0x4847e2,_0x44afed[_0x9a14('0x44')]);return _0x1942d0[_0x9a14('0x89')](_0x4847e2);}})[_0x9a14('0x25')](function(_0x44eee2){if(_0x44eee2){_0x108614=_0x44eee2['length'];if(!_0x44afed['query'][_0x9a14('0x3c')](_0x9a14('0x3d'))){_0x4847e2[_0x9a14('0x1f')]=qs[_0x9a14('0x1f')](_0x44afed[_0x9a14('0x35')][_0x9a14('0x1f')]);_0x4847e2[_0x9a14('0x1d')]=qs[_0x9a14('0x1d')](_0x44afed['query'][_0x9a14('0x1d')]);}return _0x1942d0[_0x9a14('0x89')](_0x4847e2);}})[_0x9a14('0x25')](function(_0x36fa5b){if(_0x36fa5b){return _0x36fa5b?{'count':_0x108614,'rows':_0x36fa5b}:null;}})[_0x9a14('0x25')](respondWithResult(_0x5b3ffc,null))[_0x9a14('0x47')](handleError(_0x5b3ffc,null));};
\ No newline at end of file
+var _0xc0d4=['select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','union','compact','isEmpty','addAgents','ids','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','redis','defaults','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','WhatsappQueue','includeAll','include','findAll','rows','catch','show','params','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','order','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','hasOwnProperty','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams'];(function(_0x392866,_0x47f277){var _0x2b3fc6=function(_0x5574dd){while(--_0x5574dd){_0x392866['push'](_0x392866['shift']());}};_0x2b3fc6(++_0x47f277);}(_0xc0d4,0x133));var _0x4c0d=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xc0d4[_0x29632e];return _0x426e04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c0d('0x0'));var zipdir=require(_0x4c0d('0x1'));var jsonpatch=require(_0x4c0d('0x2'));var rp=require(_0x4c0d('0x3'));var moment=require('moment');var BPromise=require(_0x4c0d('0x4'));var Mustache=require(_0x4c0d('0x5'));var util=require(_0x4c0d('0x6'));var path=require(_0x4c0d('0x7'));var sox=require(_0x4c0d('0x8'));var csv=require(_0x4c0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c0d('0xa'));var _=require(_0x4c0d('0xb'));var squel=require(_0x4c0d('0xc'));var crypto=require(_0x4c0d('0xd'));var jsforce=require(_0x4c0d('0xe'));var deskjs=require(_0x4c0d('0xf'));var toCsv=require(_0x4c0d('0x9'));var querystring=require(_0x4c0d('0x10'));var Papa=require(_0x4c0d('0x11'));var Redis=require('ioredis');var authService=require(_0x4c0d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4c0d('0x13'));var hardwareService=require(_0x4c0d('0x14'));var logger=require(_0x4c0d('0x15'))('api');var utils=require(_0x4c0d('0x16'));var config=require(_0x4c0d('0x17'));var licenseUtil=require(_0x4c0d('0x18'));var db=require(_0x4c0d('0x19'))['db'];config[_0x4c0d('0x1a')]=_[_0x4c0d('0x1b')](config[_0x4c0d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c0d('0x1a')]));require(_0x4c0d('0x1c'))[_0x4c0d('0x1d')](socket);function respondWithStatusCode(_0x58bb9b,_0x426162){_0x426162=_0x426162||0xcc;return function(_0x2e1aa8){if(_0x2e1aa8){return _0x58bb9b[_0x4c0d('0x1e')](_0x426162);}return _0x58bb9b[_0x4c0d('0x1f')](_0x426162)[_0x4c0d('0x20')]();};}function respondWithResult(_0x35eb0f,_0x3c5999){_0x3c5999=_0x3c5999||0xc8;return function(_0x430635){if(_0x430635){return _0x35eb0f['status'](_0x3c5999)[_0x4c0d('0x21')](_0x430635);}};}function respondWithFilteredResult(_0x39a32f,_0xa340b0){return function(_0x471813){if(_0x471813){var _0x4b0384=typeof _0xa340b0[_0x4c0d('0x22')]===_0x4c0d('0x23')&&typeof _0xa340b0[_0x4c0d('0x24')]===_0x4c0d('0x23');var _0x3e81b0=_0x471813[_0x4c0d('0x25')];var _0x10a2cc=_0x4b0384?0x0:_0xa340b0[_0x4c0d('0x22')];var _0x420c25=_0x4b0384?_0x471813[_0x4c0d('0x25')]:_0xa340b0[_0x4c0d('0x22')]+_0xa340b0[_0x4c0d('0x24')];var _0x2ea570;if(_0x420c25>=_0x3e81b0){_0x420c25=_0x3e81b0;_0x2ea570=0xc8;}else{_0x2ea570=0xce;}_0x39a32f[_0x4c0d('0x1f')](_0x2ea570);return _0x39a32f[_0x4c0d('0x26')](_0x4c0d('0x27'),_0x10a2cc+'-'+_0x420c25+'/'+_0x3e81b0)[_0x4c0d('0x21')](_0x471813);}return null;};}function patchUpdates(_0x5cf6c5){return function(_0xe4199d){try{jsonpatch[_0x4c0d('0x28')](_0xe4199d,_0x5cf6c5,!![]);}catch(_0x4f7dd9){return BPromise[_0x4c0d('0x29')](_0x4f7dd9);}return _0xe4199d[_0x4c0d('0x2a')]();};}function saveUpdates(_0x4581ca,_0x4733c4){return function(_0x55423a){if(_0x55423a){return _0x55423a['update'](_0x4581ca)[_0x4c0d('0x2b')](function(_0x3dfd66){return _0x3dfd66;});}return null;};}function removeEntity(_0x368c24,_0x46155e){return function(_0x9c230b){if(_0x9c230b){return _0x9c230b[_0x4c0d('0x2c')]()[_0x4c0d('0x2b')](function(){var _0x2fc208=_0x9c230b['get']({'plain':!![]});var _0x5a0306='WhatsappQueues';return db[_0x4c0d('0x2d')][_0x4c0d('0x2c')]({'where':{'type':_0x5a0306,'resourceId':_0x2fc208['id']}})[_0x4c0d('0x2b')](function(){return _0x9c230b;});})[_0x4c0d('0x2b')](function(){_0x368c24[_0x4c0d('0x1f')](0xcc)[_0x4c0d('0x20')]();});}};}function handleEntityNotFound(_0x477e21,_0x56f300){return function(_0x24275c){if(!_0x24275c){_0x477e21[_0x4c0d('0x1e')](0x194);}return _0x24275c;};}function handleError(_0x3664c0,_0x153dac){_0x153dac=_0x153dac||0x1f4;return function(_0x4800d2){logger[_0x4c0d('0x2e')](_0x4800d2[_0x4c0d('0x2f')]);if(_0x4800d2[_0x4c0d('0x30')]){delete _0x4800d2[_0x4c0d('0x30')];}_0x3664c0[_0x4c0d('0x1f')](_0x153dac)['send'](_0x4800d2);};}exports[_0x4c0d('0x31')]=function(_0x4269e9,_0x4e9143){var _0x332bbf={},_0x3a15b5={},_0x3f8f2a={'count':0x0,'rows':[]};var _0x49026a=_['map'](db['WhatsappQueue'][_0x4c0d('0x32')],function(_0x2e0577){return{'name':_0x2e0577[_0x4c0d('0x33')],'type':_0x2e0577[_0x4c0d('0x34')][_0x4c0d('0x35')]};});_0x3a15b5[_0x4c0d('0x36')]=_['map'](_0x49026a,_0x4c0d('0x30'));_0x3a15b5[_0x4c0d('0x37')]=_[_0x4c0d('0x38')](_0x4269e9[_0x4c0d('0x37')]);_0x3a15b5['filters']=_[_0x4c0d('0x39')](_0x3a15b5[_0x4c0d('0x36')],_0x3a15b5[_0x4c0d('0x37')]);_0x332bbf[_0x4c0d('0x3a')]=_[_0x4c0d('0x39')](_0x3a15b5[_0x4c0d('0x36')],qs[_0x4c0d('0x3b')](_0x4269e9[_0x4c0d('0x37')][_0x4c0d('0x3b')]));_0x332bbf['attributes']=_0x332bbf[_0x4c0d('0x3a')][_0x4c0d('0x3c')]?_0x332bbf[_0x4c0d('0x3a')]:_0x3a15b5[_0x4c0d('0x36')];if(!_0x4269e9[_0x4c0d('0x37')]['hasOwnProperty'](_0x4c0d('0x3d'))){_0x332bbf[_0x4c0d('0x24')]=qs[_0x4c0d('0x24')](_0x4269e9[_0x4c0d('0x37')][_0x4c0d('0x24')]);_0x332bbf[_0x4c0d('0x22')]=qs[_0x4c0d('0x22')](_0x4269e9['query'][_0x4c0d('0x22')]);}_0x332bbf['order']=qs[_0x4c0d('0x3e')](_0x4269e9[_0x4c0d('0x37')][_0x4c0d('0x3e')]);_0x332bbf['where']=qs[_0x4c0d('0x3f')](_[_0x4c0d('0x40')](_0x4269e9[_0x4c0d('0x37')],_0x3a15b5['filters']),_0x49026a);if(_0x4269e9[_0x4c0d('0x37')][_0x4c0d('0x41')]){_0x332bbf[_0x4c0d('0x42')]=_[_0x4c0d('0x43')](_0x332bbf[_0x4c0d('0x42')],{'$or':_[_0x4c0d('0x44')](_0x49026a,function(_0x43c4f4){if(_0x43c4f4[_0x4c0d('0x34')]!==_0x4c0d('0x45')){var _0x122424={};_0x122424[_0x43c4f4['name']]={'$like':'%'+_0x4269e9['query'][_0x4c0d('0x41')]+'%'};return _0x122424;}})});}_0x332bbf=_['merge']({},_0x332bbf,_0x4269e9[_0x4c0d('0x46')]);var _0x21cabb={'where':_0x332bbf[_0x4c0d('0x42')]};return db[_0x4c0d('0x47')][_0x4c0d('0x25')](_0x21cabb)[_0x4c0d('0x2b')](function(_0xc78554){_0x3f8f2a[_0x4c0d('0x25')]=_0xc78554;if(_0x4269e9['query'][_0x4c0d('0x48')]){_0x332bbf[_0x4c0d('0x49')]=[{'all':!![]}];}return db[_0x4c0d('0x47')][_0x4c0d('0x4a')](_0x332bbf);})[_0x4c0d('0x2b')](function(_0x398366){_0x3f8f2a[_0x4c0d('0x4b')]=_0x398366;return _0x3f8f2a;})[_0x4c0d('0x2b')](respondWithFilteredResult(_0x4e9143,_0x332bbf))[_0x4c0d('0x4c')](handleError(_0x4e9143,null));};exports[_0x4c0d('0x4d')]=function(_0x89343c,_0x41033c){var _0x4dba74={'raw':!![],'where':{'id':_0x89343c[_0x4c0d('0x4e')]['id']}},_0x438a67={};_0x438a67[_0x4c0d('0x36')]=_[_0x4c0d('0x38')](db[_0x4c0d('0x47')][_0x4c0d('0x32')]);_0x438a67[_0x4c0d('0x37')]=_['keys'](_0x89343c[_0x4c0d('0x37')]);_0x438a67[_0x4c0d('0x3f')]=_['intersection'](_0x438a67['model'],_0x438a67[_0x4c0d('0x37')]);_0x4dba74[_0x4c0d('0x3a')]=_[_0x4c0d('0x39')](_0x438a67[_0x4c0d('0x36')],qs[_0x4c0d('0x3b')](_0x89343c[_0x4c0d('0x37')]['fields']));_0x4dba74[_0x4c0d('0x3a')]=_0x4dba74['attributes']['length']?_0x4dba74[_0x4c0d('0x3a')]:_0x438a67['model'];if(_0x89343c[_0x4c0d('0x37')]['includeAll']){_0x4dba74['include']=[{'all':!![]}];}_0x4dba74=_[_0x4c0d('0x43')]({},_0x4dba74,_0x89343c[_0x4c0d('0x46')]);return db['WhatsappQueue'][_0x4c0d('0x4f')](_0x4dba74)[_0x4c0d('0x2b')](handleEntityNotFound(_0x41033c,null))[_0x4c0d('0x2b')](respondWithResult(_0x41033c,null))['catch'](handleError(_0x41033c,null));};exports['create']=function(_0x27ca5a,_0x516df3){return db[_0x4c0d('0x47')]['create'](_0x27ca5a[_0x4c0d('0x50')],{})[_0x4c0d('0x2b')](function(_0x2e4eb1){var _0x419e0a=_0x27ca5a['user'][_0x4c0d('0x51')]({'plain':!![]});if(!_0x419e0a)throw new Error(_0x4c0d('0x52'));if(_0x419e0a[_0x4c0d('0x53')]===_0x4c0d('0x54')){var _0x31571b=_0x2e4eb1[_0x4c0d('0x51')]({'plain':!![]});var _0x540c4f='WhatsappQueues';return db[_0x4c0d('0x55')][_0x4c0d('0x4f')]({'where':{'name':_0x540c4f,'userProfileId':_0x419e0a[_0x4c0d('0x56')]},'raw':!![]})['then'](function(_0x29b8d0){if(_0x29b8d0&&_0x29b8d0[_0x4c0d('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x31571b['name'],'resourceId':_0x31571b['id'],'type':_0x29b8d0[_0x4c0d('0x30')],'sectionId':_0x29b8d0['id']},{})['then'](function(){return _0x2e4eb1;});}else{return _0x2e4eb1;}})[_0x4c0d('0x4c')](function(_0x374ec9){logger['error'](_0x4c0d('0x58'),_0x374ec9);throw _0x374ec9;});}return _0x2e4eb1;})['then'](respondWithResult(_0x516df3,0xc9))[_0x4c0d('0x4c')](handleError(_0x516df3,null));};exports['update']=function(_0x7a66c6,_0x16e0e6){if(_0x7a66c6['body']['id']){delete _0x7a66c6[_0x4c0d('0x50')]['id'];}return db[_0x4c0d('0x47')][_0x4c0d('0x4f')]({'where':{'id':_0x7a66c6[_0x4c0d('0x4e')]['id']}})[_0x4c0d('0x2b')](handleEntityNotFound(_0x16e0e6,null))[_0x4c0d('0x2b')](saveUpdates(_0x7a66c6['body'],null))[_0x4c0d('0x2b')](respondWithResult(_0x16e0e6,null))[_0x4c0d('0x4c')](handleError(_0x16e0e6,null));};exports['destroy']=function(_0x5af4f1,_0xd89aea){return db[_0x4c0d('0x47')][_0x4c0d('0x4f')]({'where':{'id':_0x5af4f1['params']['id']}})['then'](handleEntityNotFound(_0xd89aea,null))[_0x4c0d('0x2b')](removeEntity(_0xd89aea,null))[_0x4c0d('0x4c')](handleError(_0xd89aea,null));};exports[_0x4c0d('0x59')]=function(_0x240c94,_0x3aa8a6){return db['WhatsappQueue'][_0x4c0d('0x59')]()[_0x4c0d('0x2b')](respondWithResult(_0x3aa8a6,null))[_0x4c0d('0x4c')](handleError(_0x3aa8a6,null));};exports[_0x4c0d('0x5a')]=function(_0x391e63,_0x36dcf4,_0x32c354){var _0x551f31={'raw':!![],'where':{}},_0x3f091={},_0x4cef5c;return db[_0x4c0d('0x47')]['findOne']({'where':{'id':_0x391e63[_0x4c0d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36dcf4,null))[_0x4c0d('0x2b')](function(_0x35a7eb){if(_0x35a7eb){_0x4cef5c=_0x35a7eb[_0x4c0d('0x51')]({'plain':!![]});_0x3f091['model']=_['keys'](db['UserWhatsappQueue'][_0x4c0d('0x32')]);_0x3f091[_0x4c0d('0x37')]=_['keys'](_0x391e63['query']);_0x3f091['filters']=_[_0x4c0d('0x39')](_0x3f091[_0x4c0d('0x36')],_0x3f091['query']);_0x551f31[_0x4c0d('0x3a')]=_[_0x4c0d('0x39')](_0x3f091[_0x4c0d('0x36')],qs['fields'](_0x391e63[_0x4c0d('0x37')][_0x4c0d('0x3b')]));_0x551f31[_0x4c0d('0x3a')]=_0x551f31[_0x4c0d('0x3a')]['length']?_0x551f31[_0x4c0d('0x3a')]:_0x3f091[_0x4c0d('0x36')];if(!_0x391e63['query']['hasOwnProperty']('nolimit')){_0x551f31[_0x4c0d('0x24')]=qs[_0x4c0d('0x24')](_0x391e63[_0x4c0d('0x37')][_0x4c0d('0x24')]);_0x551f31[_0x4c0d('0x22')]=qs[_0x4c0d('0x22')](_0x391e63[_0x4c0d('0x37')][_0x4c0d('0x22')]);}_0x551f31[_0x4c0d('0x5b')]=qs[_0x4c0d('0x3e')](_0x391e63['query'][_0x4c0d('0x3e')]);_0x551f31[_0x4c0d('0x42')]=qs[_0x4c0d('0x3f')](_[_0x4c0d('0x40')](_0x391e63[_0x4c0d('0x37')],_0x3f091[_0x4c0d('0x3f')]));_0x551f31[_0x4c0d('0x42')][_0x4c0d('0x5c')]=_0x35a7eb['id'];if(_0x391e63[_0x4c0d('0x37')][_0x4c0d('0x41')]){_0x551f31[_0x4c0d('0x42')]=_[_0x4c0d('0x43')](_0x551f31[_0x4c0d('0x42')],{'$or':_[_0x4c0d('0x44')](_0x551f31[_0x4c0d('0x3a')],function(_0x506b46){var _0x314637={};_0x314637[_0x506b46]={'$like':'%'+_0x391e63['query'][_0x4c0d('0x41')]+'%'};return _0x314637;})});}_0x551f31=_[_0x4c0d('0x43')]({},_0x551f31,_0x391e63[_0x4c0d('0x46')]);return db['UserWhatsappQueue'][_0x4c0d('0x4a')](_0x551f31);}})['then'](function(_0x439401){if(_0x439401){return db[_0x4c0d('0x5d')][_0x4c0d('0x5e')]({'where':{'id':_[_0x4c0d('0x44')](_0x439401,_0x4c0d('0x5f')),'role':'agent'},'attributes':['id','name',_0x4c0d('0x60'),_0x4c0d('0x61'),_0x4c0d('0x62')]});}})['then'](function(_0xa9bb71){if(_0xa9bb71){return{'count':_0xa9bb71[_0x4c0d('0x25')],'rows':_[_0x4c0d('0x44')](_0xa9bb71['rows'],function(_0x3a8e2f){return{'membername':_0x3a8e2f['name'],'UserId':_0x3a8e2f['id'],'queue_name':_0x4cef5c[_0x4c0d('0x30')],'WhatsappQueueId':_0x4cef5c['id'],'interface':util[_0x4c0d('0x63')](_0x4c0d('0x64'),'SIP',_0x3a8e2f['name']),'penalty':0x0,'paused':_0x3a8e2f[_0x4c0d('0x60')],'createdAt':_0x3a8e2f[_0x4c0d('0x62')],'updatedAt':_0x3a8e2f[_0x4c0d('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36dcf4,_0x551f31))[_0x4c0d('0x4c')](handleError(_0x36dcf4,null));};exports[_0x4c0d('0x65')]=function(_0x48939f,_0x1ddd4d,_0x9454f0){var _0x465fc0={};var _0x1585e0={};var _0x379245;var _0x27d37b;return db['WhatsappQueue'][_0x4c0d('0x66')]({'where':{'id':_0x48939f['params']['id']}})['then'](handleEntityNotFound(_0x1ddd4d,null))[_0x4c0d('0x2b')](function(_0x16c4ee){if(_0x16c4ee){_0x379245=_0x16c4ee;_0x1585e0[_0x4c0d('0x36')]=_[_0x4c0d('0x38')](db[_0x4c0d('0x67')]['rawAttributes']);_0x1585e0[_0x4c0d('0x37')]=_[_0x4c0d('0x38')](_0x48939f[_0x4c0d('0x37')]);_0x1585e0[_0x4c0d('0x3f')]=_['intersection'](_0x1585e0[_0x4c0d('0x36')],_0x1585e0[_0x4c0d('0x37')]);_0x465fc0[_0x4c0d('0x3a')]=_[_0x4c0d('0x39')](_0x1585e0[_0x4c0d('0x36')],qs[_0x4c0d('0x3b')](_0x48939f[_0x4c0d('0x37')]['fields']));_0x465fc0[_0x4c0d('0x3a')]=_0x465fc0[_0x4c0d('0x3a')][_0x4c0d('0x3c')]?_0x465fc0['attributes']:_0x1585e0['model'];_0x465fc0[_0x4c0d('0x5b')]=qs['sort'](_0x48939f[_0x4c0d('0x37')]['sort']);_0x465fc0[_0x4c0d('0x42')]=qs[_0x4c0d('0x3f')](_[_0x4c0d('0x40')](_0x48939f[_0x4c0d('0x37')],_0x1585e0[_0x4c0d('0x3f')]));if(_0x48939f[_0x4c0d('0x37')][_0x4c0d('0x41')]){_0x465fc0[_0x4c0d('0x42')]=_[_0x4c0d('0x43')](_0x465fc0['where'],{'$or':_[_0x4c0d('0x44')](_0x465fc0[_0x4c0d('0x3a')],function(_0xc11be){var _0x517e6c={};_0x517e6c[_0xc11be]={'$like':'%'+_0x48939f[_0x4c0d('0x37')][_0x4c0d('0x41')]+'%'};return _0x517e6c;})});}_0x465fc0=_[_0x4c0d('0x43')]({},_0x465fc0,_0x48939f[_0x4c0d('0x46')]);return _0x379245['getTeams'](_0x465fc0);}})['then'](function(_0x474c01){if(_0x474c01){_0x27d37b=_0x474c01[_0x4c0d('0x3c')];if(!_0x48939f['query'][_0x4c0d('0x68')]('nolimit')){_0x465fc0[_0x4c0d('0x24')]=qs[_0x4c0d('0x24')](_0x48939f[_0x4c0d('0x37')][_0x4c0d('0x24')]);_0x465fc0[_0x4c0d('0x22')]=qs['offset'](_0x48939f['query'][_0x4c0d('0x22')]);}return _0x379245[_0x4c0d('0x65')](_0x465fc0);}})[_0x4c0d('0x2b')](function(_0x3145eb){if(_0x3145eb){return _0x3145eb?{'count':_0x27d37b,'rows':_0x3145eb}:null;}})[_0x4c0d('0x2b')](respondWithResult(_0x1ddd4d,null))[_0x4c0d('0x4c')](handleError(_0x1ddd4d,null));};exports[_0x4c0d('0x69')]=function(_0x1a16a8,_0x350c09,_0x32dfd0){var _0x249269=_0x1a16a8[_0x4c0d('0x50')]['ids'];return db[_0x4c0d('0x67')]['findAll']({'where':{'id':_0x249269},'attributes':['id'],'include':[{'model':db[_0x4c0d('0x5d')],'as':_0x4c0d('0x6a'),'attributes':['id','name',_0x4c0d('0x6b'),_0x4c0d('0x6c'),_0x4c0d('0x6d')],'raw':!![]}]})[_0x4c0d('0x2b')](function(_0x3ce75c){if(_0x3ce75c){var _0x20f7f8=_['flatMap'](_0x3ce75c,function(_0x224518){var _0x14667f=_0x224518[_0x4c0d('0x51')]({'plain':!![]});return _0x14667f[_0x4c0d('0x6a')];});return db[_0x4c0d('0x47')]['find']({'where':{'id':_0x1a16a8[_0x4c0d('0x4e')]['id']}})['then'](function(_0x27cdf3){return db[_0x4c0d('0x6e')][_0x4c0d('0x6f')](function(_0x4a8cc6){return _0x27cdf3[_0x4c0d('0x69')](_0x249269,{'transaction':_0x4a8cc6})['then'](function(){return BPromise[_0x4c0d('0x70')](_0x20f7f8,function(_0x4438da){return db[_0x4c0d('0x71')][_0x4c0d('0x72')]({'where':{'UserId':_0x4438da['id'],'WhatsappQueueId':_0x1a16a8['params']['id']},'transaction':_0x4a8cc6});});})[_0x4c0d('0x2b')](function(){_0x20f7f8[_0x4c0d('0x73')](function(_0x47635a){socket[_0x4c0d('0x74')](_0x4c0d('0x75'),{'UserId':_0x47635a['id'],'WhatsappQueueId':_0x27cdf3['id']});});});});});}})['then'](respondWithStatusCode(_0x350c09,null))[_0x4c0d('0x4c')](handleError(_0x350c09,null));};exports[_0x4c0d('0x76')]=function(_0x24f2f8,_0x26b8b2,_0x40691b){return db[_0x4c0d('0x67')][_0x4c0d('0x4a')]({'where':{'id':_0x24f2f8[_0x4c0d('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4c0d('0x5d')],'as':_0x4c0d('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x4c0d('0x2b')](handleEntityNotFound(_0x26b8b2,null))[_0x4c0d('0x2b')](function(_0x3f85f3){var _0x5746b7=_[_0x4c0d('0x44')](_0x3f85f3,'id');var _0x5b1ef1=[];var _0x4e465e=[];var _0x5b2a44=squel[_0x4c0d('0x77')]();_0x5b2a44['field'](_0x4c0d('0x78'))[_0x4c0d('0x79')]('team_has_whatsapp_queues','tq')['join'](_0x4c0d('0x7a'),'ut',_0x4c0d('0x7b'))[_0x4c0d('0x42')](_0x4c0d('0x7c'),_0x24f2f8[_0x4c0d('0x4e')]['id']);for(var _0xdb6c1b=0x0;_0xdb6c1b<_0x3f85f3[_0x4c0d('0x3c')];_0xdb6c1b+=0x1){let _0x39ee98=_0x3f85f3[_0xdb6c1b];for(var _0x63e510=0x0;_0x63e510<_0x39ee98[_0x4c0d('0x6a')][_0x4c0d('0x3c')];_0x63e510+=0x1){let _0x5bf589=_0x39ee98[_0x4c0d('0x6a')][_0x63e510];var _0x5a3f03=_0x5b2a44[_0x4c0d('0x7d')]();_0x5a3f03[_0x4c0d('0x42')]('ut.UserId\x20=\x20?',_0x5bf589['id']);_0x4e465e[_0x4c0d('0x7e')](db[_0x4c0d('0x6e')][_0x4c0d('0x37')](_0x5a3f03[_0x4c0d('0x7f')](),{'type':db[_0x4c0d('0x6e')][_0x4c0d('0x80')][_0x4c0d('0x81')]})[_0x4c0d('0x2b')](function(_0xe46f1c){if(_0xe46f1c[_0x4c0d('0x3c')]===0x1){return _0x5bf589['id'];}else{var _0x3e66ac=_[_0x4c0d('0x82')](_[_0x4c0d('0x44')](_0xe46f1c,'TeamId'),function(_0x33bbd6){return _[_0x4c0d('0x83')](_0x5746b7,_0x33bbd6);});if(_0x3e66ac){return _0x5bf589['id'];}}}));}}return BPromise['all'](_0x4e465e)[_0x4c0d('0x2b')](function(_0x90a7f0){_0x5b1ef1=_(_0x5b1ef1)[_0x4c0d('0x84')](_0x90a7f0)[_0x4c0d('0x85')]()['value']();return db[_0x4c0d('0x47')][_0x4c0d('0x4f')]({'where':{'id':_0x24f2f8[_0x4c0d('0x4e')]['id']}})[_0x4c0d('0x2b')](function(_0x4acd92){return db[_0x4c0d('0x6e')]['transaction'](function(_0x24f66c){return _0x4acd92[_0x4c0d('0x76')](_0x24f2f8['query']['ids'],{'transaction':_0x24f66c})[_0x4c0d('0x2b')](function(){if(!_[_0x4c0d('0x86')](_0x5b1ef1)){return _0x4acd92['removeAgents'](_0x5b1ef1,{'transaction':_0x24f66c});}})['then'](function(){_0x5b1ef1[_0x4c0d('0x73')](function(_0x107834){socket[_0x4c0d('0x74')]('userWhatsappQueue:remove',{'UserId':_0x107834,'WhatsappQueueId':_0x4acd92['id']});});});});});});})['then'](respondWithStatusCode(_0x26b8b2,null))[_0x4c0d('0x4c')](handleError(_0x26b8b2,null));};exports[_0x4c0d('0x87')]=function(_0x37d74a,_0x1253e0,_0x387c84){return db['WhatsappQueue']['find']({'where':{'id':_0x37d74a['params']['id']}})[_0x4c0d('0x2b')](handleEntityNotFound(_0x1253e0,null))[_0x4c0d('0x2b')](function(_0x42b7e6){if(_0x42b7e6){return _0x42b7e6[_0x4c0d('0x87')](_0x37d74a[_0x4c0d('0x50')][_0x4c0d('0x88')],_['omit'](_0x37d74a[_0x4c0d('0x50')],['ids','id'])||{})[_0x4c0d('0x89')](function(_0x266bfe){for(var _0x533b92=0x0;_0x533b92<_0x37d74a[_0x4c0d('0x50')]['ids']['length'];_0x533b92+=0x1){socket[_0x4c0d('0x74')]('userWhatsappQueue:save',{'UserId':Number(_0x37d74a[_0x4c0d('0x50')][_0x4c0d('0x88')][_0x533b92]),'WhatsappQueueId':Number(_0x37d74a[_0x4c0d('0x4e')]['id'])});}return _0x266bfe;});}})[_0x4c0d('0x2b')](respondWithResult(_0x1253e0,null))[_0x4c0d('0x4c')](handleError(_0x1253e0,null));};exports[_0x4c0d('0x8a')]=function(_0x4a7547,_0x1538cc,_0x4c55df){return db[_0x4c0d('0x47')][_0x4c0d('0x4f')]({'where':{'id':_0x4a7547[_0x4c0d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1538cc,null))['then'](function(_0x43b973){if(_0x43b973){return _0x43b973[_0x4c0d('0x8a')](_0x4a7547[_0x4c0d('0x37')][_0x4c0d('0x88')])[_0x4c0d('0x2b')](function(){if(_[_0x4c0d('0x8b')](_0x4a7547[_0x4c0d('0x37')][_0x4c0d('0x88')])){for(var _0x5c9958=0x0;_0x5c9958<_0x4a7547['query'][_0x4c0d('0x88')]['length'];_0x5c9958+=0x1){socket[_0x4c0d('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x4a7547['query'][_0x4c0d('0x88')][_0x5c9958]),'WhatsappQueueId':Number(_0x4a7547[_0x4c0d('0x4e')]['id'])});}}else{socket[_0x4c0d('0x74')](_0x4c0d('0x8c'),{'UserId':Number(_0x4a7547[_0x4c0d('0x37')][_0x4c0d('0x88')]),'WhatsappQueueId':Number(_0x4a7547[_0x4c0d('0x4e')]['id'])});}});}})[_0x4c0d('0x2b')](respondWithStatusCode(_0x1538cc,null))[_0x4c0d('0x4c')](handleError(_0x1538cc,null));};exports['getAgents']=function(_0xb43afc,_0x1447b3,_0x2958f6){var _0x6996a2={};var _0xf2bd69={};var _0x49529a;var _0x5bee97;return db[_0x4c0d('0x47')]['findOne']({'where':{'id':_0xb43afc['params']['id']}})[_0x4c0d('0x2b')](handleEntityNotFound(_0x1447b3,null))[_0x4c0d('0x2b')](function(_0x5de2e4){if(_0x5de2e4){_0x49529a=_0x5de2e4;_0xf2bd69['model']=_[_0x4c0d('0x38')](db[_0x4c0d('0x5d')][_0x4c0d('0x32')]);_0xf2bd69['query']=_[_0x4c0d('0x38')](_0xb43afc[_0x4c0d('0x37')]);_0xf2bd69[_0x4c0d('0x3f')]=_[_0x4c0d('0x39')](_0xf2bd69[_0x4c0d('0x36')],_0xf2bd69[_0x4c0d('0x37')]);_0x6996a2[_0x4c0d('0x3a')]=_['intersection'](_0xf2bd69['model'],qs[_0x4c0d('0x3b')](_0xb43afc['query'][_0x4c0d('0x3b')]));_0x6996a2['attributes']=_0x6996a2[_0x4c0d('0x3a')]['length']?_0x6996a2[_0x4c0d('0x3a')]:_0xf2bd69[_0x4c0d('0x36')];_0x6996a2['order']=qs[_0x4c0d('0x3e')](_0xb43afc[_0x4c0d('0x37')]['sort']);_0x6996a2[_0x4c0d('0x42')]=qs[_0x4c0d('0x3f')](_[_0x4c0d('0x40')](_0xb43afc[_0x4c0d('0x37')],_0xf2bd69['filters']));if(_0xb43afc[_0x4c0d('0x37')]['filter']){_0x6996a2[_0x4c0d('0x42')]=_[_0x4c0d('0x43')](_0x6996a2[_0x4c0d('0x42')],{'$or':_[_0x4c0d('0x44')](_0x6996a2[_0x4c0d('0x3a')],function(_0x4b746f){var _0xcc2037={};_0xcc2037[_0x4b746f]={'$like':'%'+_0xb43afc['query'][_0x4c0d('0x41')]+'%'};return _0xcc2037;})});}_0x6996a2=_[_0x4c0d('0x43')]({},_0x6996a2,_0xb43afc[_0x4c0d('0x46')]);return _0x49529a['getAgents'](_0x6996a2);}})[_0x4c0d('0x2b')](function(_0x9924a2){if(_0x9924a2){_0x5bee97=_0x9924a2[_0x4c0d('0x3c')];if(!_0xb43afc[_0x4c0d('0x37')][_0x4c0d('0x68')]('nolimit')){_0x6996a2[_0x4c0d('0x24')]=qs[_0x4c0d('0x24')](_0xb43afc[_0x4c0d('0x37')][_0x4c0d('0x24')]);_0x6996a2[_0x4c0d('0x22')]=qs[_0x4c0d('0x22')](_0xb43afc[_0x4c0d('0x37')]['offset']);}return _0x49529a[_0x4c0d('0x8d')](_0x6996a2);}})['then'](function(_0x32dcf2){if(_0x32dcf2){return _0x32dcf2?{'count':_0x5bee97,'rows':_0x32dcf2}:null;}})[_0x4c0d('0x2b')](respondWithResult(_0x1447b3,null))[_0x4c0d('0x4c')](handleError(_0x1447b3,null));};
\ No newline at end of file
index 5f446f4..ae7e88d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3a4=['exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3a4,0x76));var _0x4e3a=function(_0x3d78bb,_0x3dada9){_0x3d78bb=_0x3d78bb-0x0;var _0x576062=_0xe3a4[_0x3d78bb];return _0x576062;};'use strict';var EventEmitter=require(_0x4e3a('0x0'));var WhatsappQueue=require(_0x4e3a('0x1'))['db'][_0x4e3a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4e3a('0x3')](0x0);var events={'afterCreate':_0x4e3a('0x4'),'afterUpdate':'update','afterDestroy':_0x4e3a('0x5')};function emitEvent(_0x110621){return function(_0x1da7f0,_0xaeeaf1,_0x461110){WhatsappQueueEvents[_0x4e3a('0x6')](_0x110621+':'+_0x1da7f0['id'],_0x1da7f0);WhatsappQueueEvents[_0x4e3a('0x6')](_0x110621,_0x1da7f0);_0x461110(null);};}for(var e in events){if(events[_0x4e3a('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x4e3a('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x9e1f=['remove','hook','exports','../../mysqldb','WhatsappQueue','save','update'];(function(_0x58bb31,_0x251bed){var _0xb718b9=function(_0x40feef){while(--_0x40feef){_0x58bb31['push'](_0x58bb31['shift']());}};_0xb718b9(++_0x251bed);}(_0x9e1f,0x15a));var _0xf9e1=function(_0x41fbeb,_0x5f0237){_0x41fbeb=_0x41fbeb-0x0;var _0x3ca1d1=_0x9e1f[_0x41fbeb];return _0x3ca1d1;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xf9e1('0x0'))['db'][_0xf9e1('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf9e1('0x2'),'afterUpdate':_0xf9e1('0x3'),'afterDestroy':_0xf9e1('0x4')};function emitEvent(_0x3ac3bb){return function(_0x5e8389,_0x2a7fb5,_0xdc40f9){WhatsappQueueEvents['emit'](_0x3ac3bb+':'+_0x5e8389['id'],_0x5e8389);WhatsappQueueEvents['emit'](_0x3ac3bb,_0x5e8389);_0xdc40f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xf9e1('0x5')](e,emitEvent(event));}}module[_0xf9e1('0x6')]=WhatsappQueueEvents;
\ No newline at end of file
index 9726ca6..b64e363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x746f=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x746f,0x6c));var _0xf746=function(_0x50d9c4,_0x5c0055){_0x50d9c4=_0x50d9c4-0x0;var _0x40c332=_0x746f[_0x50d9c4];return _0x40c332;};'use strict';var _=require(_0xf746('0x0'));var util=require(_0xf746('0x1'));var logger=require(_0xf746('0x2'))(_0xf746('0x3'));var moment=require('moment');var BPromise=require(_0xf746('0x4'));var rp=require(_0xf746('0x5'));var fs=require('fs');var path=require(_0xf746('0x6'));var rimraf=require(_0xf746('0x7'));var config=require(_0xf746('0x8'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x1d1d9e,_0x15aa2f){return _0x1d1d9e[_0xf746('0x9')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f81=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues'];(function(_0x42e169,_0x403f3d){var _0xe1d6c7=function(_0x1727dd){while(--_0x1727dd){_0x42e169['push'](_0x42e169['shift']());}};_0xe1d6c7(++_0x403f3d);}(_0x0f81,0x1b8));var _0x10f8=function(_0x1e2aae,_0x2349e3){_0x1e2aae=_0x1e2aae-0x0;var _0x4d8a43=_0x0f81[_0x1e2aae];return _0x4d8a43;};'use strict';var _=require('lodash');var util=require(_0x10f8('0x0'));var logger=require(_0x10f8('0x1'))('api');var moment=require(_0x10f8('0x2'));var BPromise=require(_0x10f8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10f8('0x4'));var rimraf=require(_0x10f8('0x5'));var config=require(_0x10f8('0x6'));var attributes=require(_0x10f8('0x7'));module['exports']=function(_0x4bfe3f,_0xfa74a9){return _0x4bfe3f[_0x10f8('0x8')](_0x10f8('0x9'),attributes,{'tableName':_0x10f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d18352b..a52d8f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad50=['raw','ShowWhatsappQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','find'];(function(_0x3ef00,_0x2ebe19){var _0x44cbc2=function(_0xb8a4c2){while(--_0xb8a4c2){_0x3ef00['push'](_0x3ef00['shift']());}};_0x44cbc2(++_0x2ebe19);}(_0xad50,0x104));var _0x0ad5=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0xad50[_0xb7a459];return _0x104ab5;};'use strict';var _=require(_0x0ad5('0x0'));var util=require('util');var moment=require(_0x0ad5('0x1'));var BPromise=require(_0x0ad5('0x2'));var rs=require(_0x0ad5('0x3'));var fs=require('fs');var Redis=require(_0x0ad5('0x4'));var db=require(_0x0ad5('0x5'))['db'];var utils=require(_0x0ad5('0x6'));var logger=require(_0x0ad5('0x7'))(_0x0ad5('0x8'));var config=require(_0x0ad5('0x9'));var jayson=require(_0x0ad5('0xa'));var client=jayson[_0x0ad5('0xb')][_0x0ad5('0xc')]({'port':0x232a});config[_0x0ad5('0xd')]=_[_0x0ad5('0xe')](config[_0x0ad5('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ad5('0xf'))(new Redis(config[_0x0ad5('0xd')]));require('./whatsappQueue.socket')[_0x0ad5('0x10')](socket);function respondWithRpcPromise(_0x1f281f,_0x3677b9,_0x1a6984){return new BPromise(function(_0x4a25df,_0x10aba5){return client[_0x0ad5('0x11')](_0x1f281f,_0x1a6984)[_0x0ad5('0x12')](function(_0x2ecb22){logger['info'](_0x0ad5('0x13'),_0x3677b9,_0x0ad5('0x14'));logger[_0x0ad5('0x15')](_0x0ad5('0x16'),_0x3677b9,_0x0ad5('0x14'),JSON[_0x0ad5('0x17')](_0x2ecb22));if(_0x2ecb22[_0x0ad5('0x18')]){if(_0x2ecb22[_0x0ad5('0x18')][_0x0ad5('0x19')]===0x1f4){logger[_0x0ad5('0x18')](_0x0ad5('0x13'),_0x3677b9,_0x2ecb22[_0x0ad5('0x18')][_0x0ad5('0x1a')]);return _0x10aba5(_0x2ecb22[_0x0ad5('0x18')][_0x0ad5('0x1a')]);}logger[_0x0ad5('0x18')](_0x0ad5('0x13'),_0x3677b9,_0x2ecb22[_0x0ad5('0x18')][_0x0ad5('0x1a')]);return _0x4a25df(_0x2ecb22[_0x0ad5('0x18')][_0x0ad5('0x1a')]);}else{logger[_0x0ad5('0x1b')](_0x0ad5('0x13'),_0x3677b9,_0x0ad5('0x14'));_0x4a25df(_0x2ecb22[_0x0ad5('0x1c')][_0x0ad5('0x1a')]);}})[_0x0ad5('0x1d')](function(_0x406dde){logger[_0x0ad5('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x3677b9,_0x406dde);_0x10aba5(_0x406dde);});});}exports[_0x0ad5('0x1e')]=function(_0x344ced){var _0x376177=this;return new Promise(function(_0x48e9dc,_0x3ea570){return db[_0x0ad5('0x1f')][_0x0ad5('0x20')]({'raw':_0x344ced[_0x0ad5('0x21')]?_0x344ced['options']['raw']===undefined?!![]:![]:!![],'where':_0x344ced[_0x0ad5('0x21')]?_0x344ced[_0x0ad5('0x21')][_0x0ad5('0x22')]||null:null,'attributes':_0x344ced['options']?_0x344ced[_0x0ad5('0x21')][_0x0ad5('0x23')]||null:null,'limit':_0x344ced['options']?_0x344ced[_0x0ad5('0x21')][_0x0ad5('0x24')]||null:null,'include':_0x344ced[_0x0ad5('0x21')]?_0x344ced[_0x0ad5('0x21')][_0x0ad5('0x25')]?_[_0x0ad5('0x26')](_0x344ced[_0x0ad5('0x21')]['include'],function(_0x5598c1){return{'model':db[_0x5598c1[_0x0ad5('0x27')]],'as':_0x5598c1['as'],'attributes':_0x5598c1[_0x0ad5('0x23')],'include':_0x5598c1[_0x0ad5('0x25')]?_['map'](_0x5598c1[_0x0ad5('0x25')],function(_0x1242a5){return{'model':db[_0x1242a5['model']],'as':_0x1242a5['as'],'attributes':_0x1242a5[_0x0ad5('0x23')],'include':_0x1242a5[_0x0ad5('0x25')]?_['map'](_0x1242a5['include'],function(_0x2fcb71){return{'model':db[_0x2fcb71['model']],'as':_0x2fcb71['as'],'attributes':_0x2fcb71[_0x0ad5('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0ad5('0x12')](function(_0x23ea23){logger[_0x0ad5('0x1b')](_0x0ad5('0x1e'),_0x344ced);logger['debug'](_0x0ad5('0x1e'),_0x344ced,JSON[_0x0ad5('0x17')](_0x23ea23));_0x48e9dc(_0x23ea23);})[_0x0ad5('0x1d')](function(_0x4a791a){logger[_0x0ad5('0x18')]('GetWhatsappQueue',_0x4a791a[_0x0ad5('0x1a')],_0x344ced);_0x3ea570(_0x376177[_0x0ad5('0x18')](0x1f4,_0x4a791a[_0x0ad5('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x128294){var _0x28f016=this;return new Promise(function(_0x291ac8,_0xd06850){return db[_0x0ad5('0x1f')][_0x0ad5('0x28')]({'raw':_0x128294[_0x0ad5('0x21')]?_0x128294[_0x0ad5('0x21')][_0x0ad5('0x29')]===undefined?!![]:![]:!![],'where':_0x128294[_0x0ad5('0x21')]?_0x128294[_0x0ad5('0x21')][_0x0ad5('0x22')]||null:null,'attributes':_0x128294[_0x0ad5('0x21')]?_0x128294[_0x0ad5('0x21')][_0x0ad5('0x23')]||null:null,'include':_0x128294[_0x0ad5('0x21')]?_0x128294['options'][_0x0ad5('0x25')]?_['map'](_0x128294[_0x0ad5('0x21')][_0x0ad5('0x25')],function(_0x1efc89){return{'model':db[_0x1efc89[_0x0ad5('0x27')]],'as':_0x1efc89['as'],'attributes':_0x1efc89[_0x0ad5('0x23')],'include':_0x1efc89['include']?_[_0x0ad5('0x26')](_0x1efc89[_0x0ad5('0x25')],function(_0x4c503c){return{'model':db[_0x4c503c[_0x0ad5('0x27')]],'as':_0x4c503c['as'],'attributes':_0x4c503c[_0x0ad5('0x23')],'include':_0x4c503c[_0x0ad5('0x25')]?_[_0x0ad5('0x26')](_0x4c503c[_0x0ad5('0x25')],function(_0x3869d6){return{'model':db[_0x3869d6[_0x0ad5('0x27')]],'as':_0x3869d6['as'],'attributes':_0x3869d6[_0x0ad5('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b7bd6){logger[_0x0ad5('0x1b')](_0x0ad5('0x2a'),_0x128294);logger[_0x0ad5('0x15')](_0x0ad5('0x2a'),_0x128294,JSON['stringify'](_0x4b7bd6));_0x291ac8(_0x4b7bd6);})[_0x0ad5('0x1d')](function(_0x5d2d6f){logger[_0x0ad5('0x18')](_0x0ad5('0x2a'),_0x5d2d6f['message'],_0x128294);_0xd06850(_0x28f016[_0x0ad5('0x18')](0x1f4,_0x5d2d6f[_0x0ad5('0x1a')]));});});};
\ No newline at end of file
+var _0xb7cf=['limit','include','model','map','debug','catch','find','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes'];(function(_0xa64b72,_0x53a944){var _0xee0415=function(_0x32a096){while(--_0x32a096){_0xa64b72['push'](_0xa64b72['shift']());}};_0xee0415(++_0x53a944);}(_0xb7cf,0x1ac));var _0xfb7c=function(_0x15035b,_0x3eba0a){_0x15035b=_0x15035b-0x0;var _0x2cc7b1=_0xb7cf[_0x15035b];return _0x2cc7b1;};'use strict';var _=require(_0xfb7c('0x0'));var util=require(_0xfb7c('0x1'));var moment=require(_0xfb7c('0x2'));var BPromise=require(_0xfb7c('0x3'));var rs=require(_0xfb7c('0x4'));var fs=require('fs');var Redis=require(_0xfb7c('0x5'));var db=require(_0xfb7c('0x6'))['db'];var utils=require(_0xfb7c('0x7'));var logger=require(_0xfb7c('0x8'))('rpc');var config=require(_0xfb7c('0x9'));var jayson=require(_0xfb7c('0xa'));var client=jayson[_0xfb7c('0xb')][_0xfb7c('0xc')]({'port':0x232a});config[_0xfb7c('0xd')]=_[_0xfb7c('0xe')](config[_0xfb7c('0xd')],{'host':_0xfb7c('0xf'),'port':0x18eb});var socket=require(_0xfb7c('0x10'))(new Redis(config[_0xfb7c('0xd')]));require('./whatsappQueue.socket')[_0xfb7c('0x11')](socket);function respondWithRpcPromise(_0x4432af,_0x495607,_0x2628c9){return new BPromise(function(_0x4fae30,_0x53bea5){return client['request'](_0x4432af,_0x2628c9)[_0xfb7c('0x12')](function(_0x124948){logger[_0xfb7c('0x13')](_0xfb7c('0x14'),_0x495607,_0xfb7c('0x15'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x495607,_0xfb7c('0x15'),JSON[_0xfb7c('0x16')](_0x124948));if(_0x124948['error']){if(_0x124948[_0xfb7c('0x17')][_0xfb7c('0x18')]===0x1f4){logger[_0xfb7c('0x17')](_0xfb7c('0x14'),_0x495607,_0x124948[_0xfb7c('0x17')][_0xfb7c('0x19')]);return _0x53bea5(_0x124948[_0xfb7c('0x17')][_0xfb7c('0x19')]);}logger[_0xfb7c('0x17')](_0xfb7c('0x14'),_0x495607,_0x124948[_0xfb7c('0x17')][_0xfb7c('0x19')]);return _0x4fae30(_0x124948['error']['message']);}else{logger['info'](_0xfb7c('0x14'),_0x495607,_0xfb7c('0x15'));_0x4fae30(_0x124948[_0xfb7c('0x1a')]['message']);}})['catch'](function(_0x3c451b){logger[_0xfb7c('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x495607,_0x3c451b);_0x53bea5(_0x3c451b);});});}exports[_0xfb7c('0x1b')]=function(_0x2b3a88){var _0x1b092e=this;return new Promise(function(_0x1d0fa3,_0xc71f95){return db[_0xfb7c('0x1c')][_0xfb7c('0x1d')]({'raw':_0x2b3a88[_0xfb7c('0x1e')]?_0x2b3a88[_0xfb7c('0x1e')][_0xfb7c('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b3a88['options']?_0x2b3a88[_0xfb7c('0x1e')][_0xfb7c('0x20')]||null:null,'attributes':_0x2b3a88[_0xfb7c('0x1e')]?_0x2b3a88[_0xfb7c('0x1e')][_0xfb7c('0x21')]||null:null,'limit':_0x2b3a88[_0xfb7c('0x1e')]?_0x2b3a88[_0xfb7c('0x1e')][_0xfb7c('0x22')]||null:null,'include':_0x2b3a88['options']?_0x2b3a88['options'][_0xfb7c('0x23')]?_['map'](_0x2b3a88[_0xfb7c('0x1e')]['include'],function(_0x370415){return{'model':db[_0x370415[_0xfb7c('0x24')]],'as':_0x370415['as'],'attributes':_0x370415[_0xfb7c('0x21')],'include':_0x370415[_0xfb7c('0x23')]?_[_0xfb7c('0x25')](_0x370415['include'],function(_0x27e59d){return{'model':db[_0x27e59d['model']],'as':_0x27e59d['as'],'attributes':_0x27e59d[_0xfb7c('0x21')],'include':_0x27e59d[_0xfb7c('0x23')]?_[_0xfb7c('0x25')](_0x27e59d[_0xfb7c('0x23')],function(_0x2d525f){return{'model':db[_0x2d525f[_0xfb7c('0x24')]],'as':_0x2d525f['as'],'attributes':_0x2d525f[_0xfb7c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfb7c('0x12')](function(_0x513291){logger[_0xfb7c('0x13')](_0xfb7c('0x1b'),_0x2b3a88);logger[_0xfb7c('0x26')](_0xfb7c('0x1b'),_0x2b3a88,JSON[_0xfb7c('0x16')](_0x513291));_0x1d0fa3(_0x513291);})[_0xfb7c('0x27')](function(_0x1186ef){logger[_0xfb7c('0x17')](_0xfb7c('0x1b'),_0x1186ef['message'],_0x2b3a88);_0xc71f95(_0x1b092e[_0xfb7c('0x17')](0x1f4,_0x1186ef['message']));});});};exports['ShowWhatsappQueue']=function(_0x472a68){var _0x4a5fb8=this;return new Promise(function(_0x3ea15c,_0x6cdd79){return db[_0xfb7c('0x1c')][_0xfb7c('0x28')]({'raw':_0x472a68[_0xfb7c('0x1e')]?_0x472a68[_0xfb7c('0x1e')][_0xfb7c('0x1f')]===undefined?!![]:![]:!![],'where':_0x472a68[_0xfb7c('0x1e')]?_0x472a68['options'][_0xfb7c('0x20')]||null:null,'attributes':_0x472a68['options']?_0x472a68['options'][_0xfb7c('0x21')]||null:null,'include':_0x472a68[_0xfb7c('0x1e')]?_0x472a68[_0xfb7c('0x1e')]['include']?_[_0xfb7c('0x25')](_0x472a68[_0xfb7c('0x1e')]['include'],function(_0x56000d){return{'model':db[_0x56000d[_0xfb7c('0x24')]],'as':_0x56000d['as'],'attributes':_0x56000d[_0xfb7c('0x21')],'include':_0x56000d['include']?_[_0xfb7c('0x25')](_0x56000d[_0xfb7c('0x23')],function(_0xf55637){return{'model':db[_0xf55637[_0xfb7c('0x24')]],'as':_0xf55637['as'],'attributes':_0xf55637[_0xfb7c('0x21')],'include':_0xf55637['include']?_['map'](_0xf55637[_0xfb7c('0x23')],function(_0x199dc3){return{'model':db[_0x199dc3[_0xfb7c('0x24')]],'as':_0x199dc3['as'],'attributes':_0x199dc3[_0xfb7c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfb7c('0x12')](function(_0x2ee1cf){logger['info'](_0xfb7c('0x29'),_0x472a68);logger['debug'](_0xfb7c('0x29'),_0x472a68,JSON[_0xfb7c('0x16')](_0x2ee1cf));_0x3ea15c(_0x2ee1cf);})[_0xfb7c('0x27')](function(_0x4348be){logger['error'](_0xfb7c('0x29'),_0x4348be[_0xfb7c('0x19')],_0x472a68);_0x6cdd79(_0x4a5fb8[_0xfb7c('0x17')](0x1f4,_0x4348be[_0xfb7c('0x19')]));});});};
\ No newline at end of file
index 2404b4d..ef3cd85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf492=['save','remove','update','emit','register','whatsappQueue:','./whatsappQueue.events'];(function(_0x339aae,_0x384085){var _0x3e4dd1=function(_0xfff31f){while(--_0xfff31f){_0x339aae['push'](_0x339aae['shift']());}};_0x3e4dd1(++_0x384085);}(_0xf492,0x1db));var _0x2f49=function(_0x220edc,_0x56ea9d){_0x220edc=_0x220edc-0x0;var _0x5ca7b6=_0xf492[_0x220edc];return _0x5ca7b6;};'use strict';var WhatsappQueueEvents=require(_0x2f49('0x0'));var events=[_0x2f49('0x1'),_0x2f49('0x2'),_0x2f49('0x3')];function createListener(_0x44028d,_0xe5792e){return function(_0x289a91){_0xe5792e[_0x2f49('0x4')](_0x44028d,_0x289a91);};}function removeListener(_0x36182d,_0x5f53f3){return function(){WhatsappQueueEvents['removeListener'](_0x36182d,_0x5f53f3);};}exports[_0x2f49('0x5')]=function(_0x5554a4){for(var _0x3782c3=0x0,_0x29c08f=events['length'];_0x3782c3<_0x29c08f;_0x3782c3++){var _0x2e2347=events[_0x3782c3];var _0x5e6258=createListener(_0x2f49('0x6')+_0x2e2347,_0x5554a4);WhatsappQueueEvents['on'](_0x2e2347,_0x5e6258);}};
\ No newline at end of file
+var _0xb6a3=['remove','update','emit','register','length','./whatsappQueue.events','save'];(function(_0x2a84d6,_0x538497){var _0x55c2ea=function(_0x3f5d46){while(--_0x3f5d46){_0x2a84d6['push'](_0x2a84d6['shift']());}};_0x55c2ea(++_0x538497);}(_0xb6a3,0x163));var _0x3b6a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb6a3[_0x2be8c2];return _0x97f531;};'use strict';var WhatsappQueueEvents=require(_0x3b6a('0x0'));var events=[_0x3b6a('0x1'),_0x3b6a('0x2'),_0x3b6a('0x3')];function createListener(_0x2a8dab,_0xa192ef){return function(_0x27d126){_0xa192ef[_0x3b6a('0x4')](_0x2a8dab,_0x27d126);};}function removeListener(_0x3eb024,_0x32700b){return function(){WhatsappQueueEvents['removeListener'](_0x3eb024,_0x32700b);};}exports[_0x3b6a('0x5')]=function(_0x1824e2){for(var _0x5ed8ea=0x0,_0x5a73e1=events[_0x3b6a('0x6')];_0x5ed8ea<_0x5a73e1;_0x5ed8ea++){var _0x38c369=events[_0x5ed8ea];var _0x1c7bdd=createListener('whatsappQueue:'+_0x38c369,_0x1824e2);WhatsappQueueEvents['on'](_0x38c369,_0x1c7bdd);}};
\ No newline at end of file
index a690471..e4b404b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09de=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path'];(function(_0x6f81e9,_0x1c18e1){var _0x42bcad=function(_0x25482a){while(--_0x25482a){_0x6f81e9['push'](_0x6f81e9['shift']());}};_0x42bcad(++_0x1c18e1);}(_0x09de,0x139));var _0xe09d=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0x09de[_0x495e9f];return _0xb249d2;};'use strict';var multer=require('multer');var util=require(_0xe09d('0x0'));var path=require(_0xe09d('0x1'));var timeout=require(_0xe09d('0x2'));var express=require(_0xe09d('0x3'));var router=express['Router']();var fs_extra=require(_0xe09d('0x4'));var auth=require(_0xe09d('0x5'));var interaction=require(_0xe09d('0x6'));var config=require(_0xe09d('0x7'));var controller=require(_0xe09d('0x8'));router[_0xe09d('0x9')]('/',auth['isAuthenticated'](),controller[_0xe09d('0xa')]);router[_0xe09d('0x9')](_0xe09d('0xb'),auth[_0xe09d('0xc')](),controller[_0xe09d('0xd')]);router[_0xe09d('0x9')](_0xe09d('0xe'),auth[_0xe09d('0xc')](),controller['show']);router[_0xe09d('0xf')]('/',auth[_0xe09d('0xc')](),controller[_0xe09d('0x10')]);router[_0xe09d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe09d('0x12')]);router['delete'](_0xe09d('0xe'),auth['isAuthenticated'](),controller[_0xe09d('0x13')]);module[_0xe09d('0x14')]=router;
\ No newline at end of file
+var _0xb3e6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x435b2f,_0x4c44da){var _0x181648=function(_0x3d753e){while(--_0x3d753e){_0x435b2f['push'](_0x435b2f['shift']());}};_0x181648(++_0x4c44da);}(_0xb3e6,0x13f));var _0x6b3e=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xb3e6[_0xf26c2e];return _0x46ecb4;};'use strict';var multer=require(_0x6b3e('0x0'));var util=require('util');var path=require(_0x6b3e('0x1'));var timeout=require(_0x6b3e('0x2'));var express=require(_0x6b3e('0x3'));var router=express[_0x6b3e('0x4')]();var fs_extra=require(_0x6b3e('0x5'));var auth=require(_0x6b3e('0x6'));var interaction=require(_0x6b3e('0x7'));var config=require(_0x6b3e('0x8'));var controller=require(_0x6b3e('0x9'));router['get']('/',auth[_0x6b3e('0xa')](),controller[_0x6b3e('0xb')]);router[_0x6b3e('0xc')](_0x6b3e('0xd'),auth[_0x6b3e('0xa')](),controller['describe']);router['get'](_0x6b3e('0xe'),auth[_0x6b3e('0xa')](),controller[_0x6b3e('0xf')]);router[_0x6b3e('0x10')]('/',auth[_0x6b3e('0xa')](),controller[_0x6b3e('0x11')]);router[_0x6b3e('0x12')](_0x6b3e('0xe'),auth[_0x6b3e('0xa')](),controller[_0x6b3e('0x13')]);router[_0x6b3e('0x14')](_0x6b3e('0xe'),auth[_0x6b3e('0xa')](),controller[_0x6b3e('0x15')]);module[_0x6b3e('0x16')]=router;
\ No newline at end of file
index aba54f2..6f3704d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x13bf16,_0x14b1aa){var _0x14a472=function(_0x2d13bc){while(--_0x2d13bc){_0x13bf16['push'](_0x13bf16['shift']());}};_0x14a472(++_0x14b1aa);}(_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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x26c062,_0x24d4a8){var _0x1ac5fb=function(_0x5a8c84){while(--_0x5a8c84){_0x26c062['push'](_0x26c062['shift']());}};_0x1ac5fb(++_0x24d4a8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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
index 6043ac8..92924af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x57d628,_0xda6747){var _0x2f8486=function(_0x5f2cba){while(--_0x5f2cba){_0x57d628['push'](_0x57d628['shift']());}};_0x2f8486(++_0xda6747);}(_0x02ce,0x1ac));var _0xe02c=function(_0x2baecb,_0x4804df){_0x2baecb=_0x2baecb-0x0;var _0x1faa10=_0x02ce[_0x2baecb];return _0x1faa10;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));};
\ No newline at end of file
+var _0x878f=['intersection','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','WhatsappQueueReport','rows','params','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes'];(function(_0x4ef5c1,_0x2b3ec5){var _0x15b5f9=function(_0x143b31){while(--_0x143b31){_0x4ef5c1['push'](_0x4ef5c1['shift']());}};_0x15b5f9(++_0x2b3ec5);}(_0x878f,0x173));var _0xf878=function(_0x145d02,_0x269ddb){_0x145d02=_0x145d02-0x0;var _0x2601cc=_0x878f[_0x145d02];return _0x2601cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x339c9c,_0x596fb5){_0x596fb5=_0x596fb5||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x339c9c[_0xf878('0x15')](_0x596fb5);}return _0x339c9c[_0xf878('0x16')](_0x596fb5)['end']();};}function respondWithResult(_0xe2c2de,_0x3902f7){_0x3902f7=_0x3902f7||0xc8;return function(_0x119e9e){if(_0x119e9e){return _0xe2c2de['status'](_0x3902f7)['json'](_0x119e9e);}};}function respondWithFilteredResult(_0x4c0948,_0x35ff2d){return function(_0x31d888){if(_0x31d888){var _0x6dbeca=typeof _0x35ff2d[_0xf878('0x17')]===_0xf878('0x18')&&typeof _0x35ff2d[_0xf878('0x19')]===_0xf878('0x18');var _0x3c5dee=_0x31d888[_0xf878('0x1a')];var _0x3b2e1b=_0x6dbeca?0x0:_0x35ff2d['offset'];var _0x2b2b54=_0x6dbeca?_0x31d888[_0xf878('0x1a')]:_0x35ff2d[_0xf878('0x17')]+_0x35ff2d[_0xf878('0x19')];var _0x3714f6;if(_0x2b2b54>=_0x3c5dee){_0x2b2b54=_0x3c5dee;_0x3714f6=0xc8;}else{_0x3714f6=0xce;}_0x4c0948[_0xf878('0x16')](_0x3714f6);return _0x4c0948[_0xf878('0x1b')]('Content-Range',_0x3b2e1b+'-'+_0x2b2b54+'/'+_0x3c5dee)[_0xf878('0x1c')](_0x31d888);}return null;};}function patchUpdates(_0x140866){return function(_0x250f85){try{jsonpatch['apply'](_0x250f85,_0x140866,!![]);}catch(_0x432e5d){return BPromise[_0xf878('0x1d')](_0x432e5d);}return _0x250f85[_0xf878('0x1e')]();};}function saveUpdates(_0x392822,_0x22d884){return function(_0x442450){if(_0x442450){return _0x442450[_0xf878('0x1f')](_0x392822)[_0xf878('0x20')](function(_0x212436){return _0x212436;});}return null;};}function removeEntity(_0x1a6506,_0x45e61f){return function(_0x566995){if(_0x566995){return _0x566995[_0xf878('0x21')]()['then'](function(){_0x1a6506[_0xf878('0x16')](0xcc)[_0xf878('0x22')]();});}};}function handleEntityNotFound(_0x35b3b4,_0x280036){return function(_0x20449e){if(!_0x20449e){_0x35b3b4['sendStatus'](0x194);}return _0x20449e;};}function handleError(_0x58c713,_0x59ba7b){_0x59ba7b=_0x59ba7b||0x1f4;return function(_0x242926){logger[_0xf878('0x23')](_0x242926[_0xf878('0x24')]);if(_0x242926['name']){delete _0x242926[_0xf878('0x25')];}_0x58c713[_0xf878('0x16')](_0x59ba7b)[_0xf878('0x26')](_0x242926);};}exports[_0xf878('0x27')]=function(_0x41dd55,_0x5aff46){var _0x502322={},_0x9a127d={},_0x5d9c97={'count':0x0,'rows':[]};var _0x4a0286=_[_0xf878('0x28')](db['WhatsappQueueReport'][_0xf878('0x29')],function(_0x51afaf){return{'name':_0x51afaf[_0xf878('0x2a')],'type':_0x51afaf['type'][_0xf878('0x2b')]};});_0x9a127d['model']=_[_0xf878('0x28')](_0x4a0286,_0xf878('0x25'));_0x9a127d[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x41dd55[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2e')]=_['intersection'](_0x9a127d[_0xf878('0x2f')],_0x9a127d[_0xf878('0x2c')]);_0x502322[_0xf878('0x30')]=_[_0xf878('0x31')](_0x9a127d[_0xf878('0x2f')],qs['fields'](_0x41dd55[_0xf878('0x2c')][_0xf878('0x32')]));_0x502322['attributes']=_0x502322[_0xf878('0x30')][_0xf878('0x33')]?_0x502322[_0xf878('0x30')]:_0x9a127d[_0xf878('0x2f')];if(!_0x41dd55[_0xf878('0x2c')]['hasOwnProperty'](_0xf878('0x34'))){_0x502322[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x41dd55[_0xf878('0x2c')]['limit']);_0x502322[_0xf878('0x17')]=qs['offset'](_0x41dd55['query'][_0xf878('0x17')]);}_0x502322[_0xf878('0x35')]=qs[_0xf878('0x36')](_0x41dd55[_0xf878('0x2c')][_0xf878('0x36')]);_0x502322['where']=qs[_0xf878('0x2e')](_['pick'](_0x41dd55[_0xf878('0x2c')],_0x9a127d[_0xf878('0x2e')]),_0x4a0286);if(_0x41dd55['query'][_0xf878('0x37')]){_0x502322[_0xf878('0x38')]=_['merge'](_0x502322[_0xf878('0x38')],{'$or':_[_0xf878('0x28')](_0x4a0286,function(_0x5b4098){if(_0x5b4098[_0xf878('0x39')]!==_0xf878('0x3a')){var _0x34731d={};_0x34731d[_0x5b4098[_0xf878('0x25')]]={'$like':'%'+_0x41dd55[_0xf878('0x2c')][_0xf878('0x37')]+'%'};return _0x34731d;}})});}_0x502322=_[_0xf878('0x3b')]({},_0x502322,_0x41dd55['options']);var _0x1179fb={'where':_0x502322[_0xf878('0x38')]};return db['WhatsappQueueReport'][_0xf878('0x1a')](_0x1179fb)['then'](function(_0x489964){_0x5d9c97[_0xf878('0x1a')]=_0x489964;if(_0x41dd55[_0xf878('0x2c')][_0xf878('0x3c')]){_0x502322[_0xf878('0x3d')]=[{'all':!![]}];}return db[_0xf878('0x3e')]['findAll'](_0x502322);})[_0xf878('0x20')](function(_0x4c4ae4){_0x5d9c97[_0xf878('0x3f')]=_0x4c4ae4;return _0x5d9c97;})[_0xf878('0x20')](respondWithFilteredResult(_0x5aff46,_0x502322))['catch'](handleError(_0x5aff46,null));};exports['show']=function(_0x180594,_0x2a66c1){var _0x13fcd3={'raw':!![],'where':{'id':_0x180594[_0xf878('0x40')]['id']}},_0x2f6ee5={};_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2d')](db[_0xf878('0x3e')][_0xf878('0x29')]);_0x2f6ee5['query']=_[_0xf878('0x2d')](_0x180594[_0xf878('0x2c')]);_0x2f6ee5[_0xf878('0x2e')]=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],_0x2f6ee5[_0xf878('0x2c')]);_0x13fcd3['attributes']=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],qs[_0xf878('0x32')](_0x180594[_0xf878('0x2c')][_0xf878('0x32')]));_0x13fcd3['attributes']=_0x13fcd3[_0xf878('0x30')][_0xf878('0x33')]?_0x13fcd3[_0xf878('0x30')]:_0x2f6ee5[_0xf878('0x2f')];if(_0x180594['query'][_0xf878('0x3c')]){_0x13fcd3[_0xf878('0x3d')]=[{'all':!![]}];}_0x13fcd3=_[_0xf878('0x3b')]({},_0x13fcd3,_0x180594['options']);return db['WhatsappQueueReport'][_0xf878('0x41')](_0x13fcd3)['then'](handleEntityNotFound(_0x2a66c1,null))['then'](respondWithResult(_0x2a66c1,null))['catch'](handleError(_0x2a66c1,null));};exports[_0xf878('0x42')]=function(_0x49e719,_0x156fdb){return db[_0xf878('0x3e')][_0xf878('0x42')](_0x49e719[_0xf878('0x43')],{})[_0xf878('0x20')](respondWithResult(_0x156fdb,0xc9))[_0xf878('0x44')](handleError(_0x156fdb,null));};exports[_0xf878('0x1f')]=function(_0x526c89,_0xb0bf4c){if(_0x526c89[_0xf878('0x43')]['id']){delete _0x526c89[_0xf878('0x43')]['id'];}return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x526c89['params']['id']}})['then'](handleEntityNotFound(_0xb0bf4c,null))[_0xf878('0x20')](saveUpdates(_0x526c89[_0xf878('0x43')],null))['then'](respondWithResult(_0xb0bf4c,null))[_0xf878('0x44')](handleError(_0xb0bf4c,null));};exports['destroy']=function(_0x1ce6b9,_0x31adde){return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x1ce6b9['params']['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x31adde,null))[_0xf878('0x20')](removeEntity(_0x31adde,null))[_0xf878('0x44')](handleError(_0x31adde,null));};exports['describe']=function(_0xce30a5,_0x30df05){return db[_0xf878('0x3e')][_0xf878('0x45')]()['then'](respondWithResult(_0x30df05,null))[_0xf878('0x44')](handleError(_0x30df05,null));};
\ No newline at end of file
index 19c7eb2..bd201ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1657=['uniqueid','lodash','api','moment','bluebird','path','rimraf','./whatsappQueueReport.attributes','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1657,0x1cc));var _0x7165=function(_0x76d572,_0x27143c){_0x76d572=_0x76d572-0x0;var _0x48d85f=_0x1657[_0x76d572];return _0x48d85f;};'use strict';var _=require(_0x7165('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7165('0x1'));var moment=require(_0x7165('0x2'));var BPromise=require(_0x7165('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7165('0x4'));var rimraf=require(_0x7165('0x5'));var config=require('../../config/environment');var attributes=require(_0x7165('0x6'));module['exports']=function(_0x52b871,_0x2e82e5){return _0x52b871[_0x7165('0x7')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7165('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbeea=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash'];(function(_0x5f0026,_0x27c828){var _0x58e72e=function(_0x481b4c){while(--_0x481b4c){_0x5f0026['push'](_0x5f0026['shift']());}};_0x58e72e(++_0x27c828);}(_0xbeea,0x1c6));var _0xabee=function(_0x17dac0,_0x182df7){_0x17dac0=_0x17dac0-0x0;var _0x497770=_0xbeea[_0x17dac0];return _0x497770;};'use strict';var _=require(_0xabee('0x0'));var util=require(_0xabee('0x1'));var logger=require(_0xabee('0x2'))(_0xabee('0x3'));var moment=require('moment');var BPromise=require(_0xabee('0x4'));var rp=require(_0xabee('0x5'));var fs=require('fs');var path=require(_0xabee('0x6'));var rimraf=require(_0xabee('0x7'));var config=require('../../config/environment');var attributes=require(_0xabee('0x8'));module[_0xabee('0x9')]=function(_0x288b61,_0x5cbda9){return _0x288b61[_0xabee('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0xabee('0xb'),'paranoid':![],'indexes':[{'name':_0xabee('0xc'),'fields':[_0xabee('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 5a0a14e..12f4f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e94=['error','message','request\x20sent','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','debug','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37fcda,_0x2f5aa1){var _0xf5ed91=function(_0x3c3241){while(--_0x3c3241){_0x37fcda['push'](_0x37fcda['shift']());}};_0xf5ed91(++_0x2f5aa1);}(_0x3e94,0x19c));var _0x43e9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3e94[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require(_0x43e9('0x2'));var BPromise=require(_0x43e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require(_0x43e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require(_0x43e9('0x8'));var jayson=require(_0x43e9('0x9'));var client=jayson[_0x43e9('0xa')][_0x43e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55b701,_0x373f70,_0x358488){return new BPromise(function(_0xf9d278,_0x37c48a){return client['request'](_0x55b701,_0x358488)[_0x43e9('0xc')](function(_0x261e71){logger[_0x43e9('0xd')](_0x43e9('0xe'),_0x373f70,'request\x20sent');logger['debug'](_0x43e9('0xf'),_0x373f70,'request\x20sent',JSON[_0x43e9('0x10')](_0x261e71));if(_0x261e71[_0x43e9('0x11')]){if(_0x261e71['error']['code']===0x1f4){logger[_0x43e9('0x11')](_0x43e9('0xe'),_0x373f70,_0x261e71[_0x43e9('0x11')][_0x43e9('0x12')]);return _0x37c48a(_0x261e71['error'][_0x43e9('0x12')]);}logger[_0x43e9('0x11')](_0x43e9('0xe'),_0x373f70,_0x261e71[_0x43e9('0x11')][_0x43e9('0x12')]);return _0xf9d278(_0x261e71[_0x43e9('0x11')][_0x43e9('0x12')]);}else{logger[_0x43e9('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x373f70,_0x43e9('0x13'));_0xf9d278(_0x261e71[_0x43e9('0x14')]['message']);}})[_0x43e9('0x15')](function(_0x3bf3df){logger['error'](_0x43e9('0xe'),_0x373f70,_0x3bf3df);_0x37c48a(_0x3bf3df);});});}exports[_0x43e9('0x16')]=function(_0x107039){var _0x2ee79d=this;return new Promise(function(_0x4b06c6,_0x27e3af){return db[_0x43e9('0x17')][_0x43e9('0x18')](_0x107039[_0x43e9('0x19')],{'raw':_0x107039['options']?_0x107039[_0x43e9('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4fbd2e){logger['info'](_0x43e9('0x16'),_0x107039);logger[_0x43e9('0x1b')](_0x43e9('0x16'),_0x107039,JSON[_0x43e9('0x10')](_0x4fbd2e));_0x4b06c6(_0x4fbd2e);})[_0x43e9('0x15')](function(_0x1bed6b){logger['error'](_0x43e9('0x16'),_0x1bed6b['message'],_0x107039);_0x27e3af(_0x2ee79d['error'](0x1f4,_0x1bed6b[_0x43e9('0x12')]));});});};exports[_0x43e9('0x1c')]=function(_0x2e3592){var _0x5a679a=this;return new Promise(function(_0x3bff88,_0x278d64){return db['WhatsappQueueReport'][_0x43e9('0x1d')](_0x2e3592[_0x43e9('0x19')],{'raw':_0x2e3592[_0x43e9('0x1a')]?_0x2e3592['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e3592['options']?_0x2e3592[_0x43e9('0x1a')][_0x43e9('0x1e')]||null:null,'attributes':_0x2e3592[_0x43e9('0x1a')]?_0x2e3592[_0x43e9('0x1a')][_0x43e9('0x1f')]||null:null,'limit':_0x2e3592[_0x43e9('0x1a')]?_0x2e3592[_0x43e9('0x1a')][_0x43e9('0x20')]||null:null})['then'](function(_0x4e9431){logger['info'](_0x43e9('0x1c'),_0x2e3592);logger[_0x43e9('0x1b')](_0x43e9('0x1c'),_0x2e3592,JSON[_0x43e9('0x10')](_0x4e9431));_0x3bff88(_0x4e9431);})['catch'](function(_0x5d97fc){logger['error'](_0x43e9('0x1c'),_0x5d97fc['message'],_0x2e3592);_0x278d64(_0x5a679a['error'](0x1f4,_0x5d97fc[_0x43e9('0x12')]));});});};
\ No newline at end of file
+var _0xd25d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','limit','lodash'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd25d,0x19f));var _0xdd25=function(_0x2a5e04,_0x46f84c){_0x2a5e04=_0x2a5e04-0x0;var _0x4445e8=_0xd25d[_0x2a5e04];return _0x4445e8;};'use strict';var _=require(_0xdd25('0x0'));var util=require(_0xdd25('0x1'));var moment=require(_0xdd25('0x2'));var BPromise=require(_0xdd25('0x3'));var rs=require(_0xdd25('0x4'));var fs=require('fs');var Redis=require(_0xdd25('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd25('0x6'));var logger=require(_0xdd25('0x7'))(_0xdd25('0x8'));var config=require(_0xdd25('0x9'));var jayson=require(_0xdd25('0xa'));var client=jayson['client'][_0xdd25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b749e,_0x5ecaae,_0x1a3c58){return new BPromise(function(_0x5ebae8,_0xcbb38c){return client[_0xdd25('0xc')](_0x1b749e,_0x1a3c58)[_0xdd25('0xd')](function(_0xe52b6f){logger[_0xdd25('0xe')](_0xdd25('0xf'),_0x5ecaae,_0xdd25('0x10'));logger[_0xdd25('0x11')](_0xdd25('0x12'),_0x5ecaae,_0xdd25('0x10'),JSON[_0xdd25('0x13')](_0xe52b6f));if(_0xe52b6f[_0xdd25('0x14')]){if(_0xe52b6f[_0xdd25('0x14')][_0xdd25('0x15')]===0x1f4){logger[_0xdd25('0x14')](_0xdd25('0xf'),_0x5ecaae,_0xe52b6f[_0xdd25('0x14')][_0xdd25('0x16')]);return _0xcbb38c(_0xe52b6f[_0xdd25('0x14')]['message']);}logger[_0xdd25('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5ecaae,_0xe52b6f[_0xdd25('0x14')][_0xdd25('0x16')]);return _0x5ebae8(_0xe52b6f[_0xdd25('0x14')][_0xdd25('0x16')]);}else{logger[_0xdd25('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5ecaae,_0xdd25('0x10'));_0x5ebae8(_0xe52b6f['result'][_0xdd25('0x16')]);}})[_0xdd25('0x17')](function(_0x33253b){logger[_0xdd25('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5ecaae,_0x33253b);_0xcbb38c(_0x33253b);});});}exports[_0xdd25('0x18')]=function(_0x4b4d8f){var _0xad0e67=this;return new Promise(function(_0x50f9e9,_0x1e3da5){return db['WhatsappQueueReport'][_0xdd25('0x19')](_0x4b4d8f[_0xdd25('0x1a')],{'raw':_0x4b4d8f['options']?_0x4b4d8f[_0xdd25('0x1b')][_0xdd25('0x1c')]===undefined?!![]:![]:!![]})[_0xdd25('0xd')](function(_0x190a45){logger[_0xdd25('0xe')](_0xdd25('0x18'),_0x4b4d8f);logger['debug'](_0xdd25('0x18'),_0x4b4d8f,JSON[_0xdd25('0x13')](_0x190a45));_0x50f9e9(_0x190a45);})[_0xdd25('0x17')](function(_0x5642b6){logger[_0xdd25('0x14')](_0xdd25('0x18'),_0x5642b6[_0xdd25('0x16')],_0x4b4d8f);_0x1e3da5(_0xad0e67['error'](0x1f4,_0x5642b6[_0xdd25('0x16')]));});});};exports[_0xdd25('0x1d')]=function(_0x354bcf){var _0x3c88e1=this;return new Promise(function(_0xb62447,_0x31e9fe){return db['WhatsappQueueReport']['update'](_0x354bcf[_0xdd25('0x1a')],{'raw':_0x354bcf['options']?_0x354bcf[_0xdd25('0x1b')][_0xdd25('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x354bcf[_0xdd25('0x1b')]?_0x354bcf[_0xdd25('0x1b')][_0xdd25('0x1e')]||null:null,'attributes':_0x354bcf[_0xdd25('0x1b')]?_0x354bcf[_0xdd25('0x1b')]['attributes']||null:null,'limit':_0x354bcf[_0xdd25('0x1b')]?_0x354bcf[_0xdd25('0x1b')][_0xdd25('0x1f')]||null:null})[_0xdd25('0xd')](function(_0x3be342){logger[_0xdd25('0xe')](_0xdd25('0x1d'),_0x354bcf);logger[_0xdd25('0x11')](_0xdd25('0x1d'),_0x354bcf,JSON[_0xdd25('0x13')](_0x3be342));_0xb62447(_0x3be342);})[_0xdd25('0x17')](function(_0x4b2947){logger[_0xdd25('0x14')](_0xdd25('0x1d'),_0x4b2947['message'],_0x354bcf);_0x31e9fe(_0x3c88e1[_0xdd25('0x14')](0x1f4,_0x4b2947[_0xdd25('0x16')]));});});};
\ No newline at end of file
index 933d517..0d7f0ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x860d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','show','post','put','update','delete','/:id','exports','multer','util','connect-timeout'];(function(_0x348bb1,_0x5d1dbc){var _0x2e8dcd=function(_0xc97c8c){while(--_0xc97c8c){_0x348bb1['push'](_0x348bb1['shift']());}};_0x2e8dcd(++_0x5d1dbc);}(_0x860d,0x1c5));var _0xd860=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x860d[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0xd860('0x0'));var util=require(_0xd860('0x1'));var path=require('path');var timeout=require(_0xd860('0x2'));var express=require('express');var router=express[_0xd860('0x3')]();var fs_extra=require(_0xd860('0x4'));var auth=require(_0xd860('0x5'));var interaction=require(_0xd860('0x6'));var config=require(_0xd860('0x7'));var controller=require(_0xd860('0x8'));router[_0xd860('0x9')]('/',auth[_0xd860('0xa')](),controller['index']);router[_0xd860('0x9')]('/describe',auth[_0xd860('0xa')](),controller[_0xd860('0xb')]);router['get']('/:id',auth[_0xd860('0xa')](),controller[_0xd860('0xc')]);router[_0xd860('0xd')]('/',auth[_0xd860('0xa')](),controller['create']);router[_0xd860('0xe')]('/:id',auth[_0xd860('0xa')](),controller[_0xd860('0xf')]);router[_0xd860('0x10')](_0xd860('0x11'),auth[_0xd860('0xa')](),controller['destroy']);module[_0xd860('0x12')]=router;
\ No newline at end of file
+var _0x57f6=['describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x22ef24,_0x3538e5){var _0x20c3a5=function(_0x498877){while(--_0x498877){_0x22ef24['push'](_0x22ef24['shift']());}};_0x20c3a5(++_0x3538e5);}(_0x57f6,0x1eb));var _0x657f=function(_0x3bf3f1,_0x5b8238){_0x3bf3f1=_0x3bf3f1-0x0;var _0x5a0c0c=_0x57f6[_0x3bf3f1];return _0x5a0c0c;};'use strict';var multer=require(_0x657f('0x0'));var util=require(_0x657f('0x1'));var path=require(_0x657f('0x2'));var timeout=require(_0x657f('0x3'));var express=require(_0x657f('0x4'));var router=express[_0x657f('0x5')]();var fs_extra=require(_0x657f('0x6'));var auth=require(_0x657f('0x7'));var interaction=require(_0x657f('0x8'));var config=require(_0x657f('0x9'));var controller=require(_0x657f('0xa'));router['get']('/',auth[_0x657f('0xb')](),controller[_0x657f('0xc')]);router[_0x657f('0xd')](_0x657f('0xe'),auth[_0x657f('0xb')](),controller[_0x657f('0xf')]);router[_0x657f('0xd')](_0x657f('0x10'),auth[_0x657f('0xb')](),controller[_0x657f('0x11')]);router[_0x657f('0x12')]('/',auth[_0x657f('0xb')](),controller[_0x657f('0x13')]);router[_0x657f('0x14')](_0x657f('0x10'),auth[_0x657f('0xb')](),controller['update']);router[_0x657f('0x15')](_0x657f('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x657f('0x16')]=router;
\ No newline at end of file
index f9b737d..bbb758c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5df=['STRING','ENUM','queue','DATE'];(function(_0x11ec88,_0x4eb8d3){var _0x3ab94f=function(_0x48c626){while(--_0x48c626){_0x11ec88['push'](_0x11ec88['shift']());}};_0x3ab94f(++_0x4eb8d3);}(_0xc5df,0x80));var _0xfc5d=function(_0xdb4242,_0x53077d){_0xdb4242=_0xdb4242-0x0;var _0x2676ab=_0xc5df[_0xdb4242];return _0x2676ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xfc5d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xfc5d('0x1')]('account','agent',_0xfc5d('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfc5d('0x3')]}};
\ No newline at end of file
+var _0xae87=['account','agent','DATE'];(function(_0x30d4c3,_0x4435e9){var _0x494c8e=function(_0x3699ad){while(--_0x3699ad){_0x30d4c3['push'](_0x30d4c3['shift']());}};_0x494c8e(++_0x4435e9);}(_0xae87,0x1ce));var _0x7ae8=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xae87[_0x36bfe3];return _0x9b0436;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7ae8('0x0'),_0x7ae8('0x1'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7ae8('0x2')]}};
\ No newline at end of file
index 85f7632..a29a5af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x268c=['rows','catch','show','params','keys','length','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','limit','undefined','count','offset','Content-Range','apply','update','then','sendStatus','error','stack','name','index','WhatsappTransferReport','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','include','findAll'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0x268c,0x1e0));var _0xc268=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x268c[_0x9d639c];return _0x1671de;};'use strict';var emlformat=require(_0xc268('0x0'));var rimraf=require(_0xc268('0x1'));var zipdir=require(_0xc268('0x2'));var jsonpatch=require(_0xc268('0x3'));var rp=require(_0xc268('0x4'));var moment=require(_0xc268('0x5'));var BPromise=require(_0xc268('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc268('0x7'));var sox=require(_0xc268('0x8'));var csv=require(_0xc268('0x9'));var ejs=require(_0xc268('0xa'));var fs=require('fs');var fs_extra=require(_0xc268('0xb'));var _=require('lodash');var squel=require(_0xc268('0xc'));var crypto=require(_0xc268('0xd'));var jsforce=require(_0xc268('0xe'));var deskjs=require(_0xc268('0xf'));var toCsv=require(_0xc268('0x9'));var querystring=require(_0xc268('0x10'));var Papa=require(_0xc268('0x11'));var Redis=require(_0xc268('0x12'));var authService=require(_0xc268('0x13'));var qs=require(_0xc268('0x14'));var as=require(_0xc268('0x15'));var hardwareService=require(_0xc268('0x16'));var logger=require(_0xc268('0x17'))(_0xc268('0x18'));var utils=require(_0xc268('0x19'));var config=require(_0xc268('0x1a'));var licenseUtil=require(_0xc268('0x1b'));var db=require(_0xc268('0x1c'))['db'];function respondWithStatusCode(_0x4a9741,_0x251350){_0x251350=_0x251350||0xcc;return function(_0x23f6e4){if(_0x23f6e4){return _0x4a9741['sendStatus'](_0x251350);}return _0x4a9741['status'](_0x251350)[_0xc268('0x1d')]();};}function respondWithResult(_0x5d24de,_0x5e4877){_0x5e4877=_0x5e4877||0xc8;return function(_0x57e976){if(_0x57e976){return _0x5d24de[_0xc268('0x1e')](_0x5e4877)['json'](_0x57e976);}};}function respondWithFilteredResult(_0x26f245,_0xfd64fd){return function(_0x3b62c6){if(_0x3b62c6){var _0x13554e=typeof _0xfd64fd['offset']==='undefined'&&typeof _0xfd64fd[_0xc268('0x1f')]===_0xc268('0x20');var _0x4cb244=_0x3b62c6['count'];var _0x35d968=_0x13554e?0x0:_0xfd64fd['offset'];var _0x211e2c=_0x13554e?_0x3b62c6[_0xc268('0x21')]:_0xfd64fd[_0xc268('0x22')]+_0xfd64fd[_0xc268('0x1f')];var _0x15322b;if(_0x211e2c>=_0x4cb244){_0x211e2c=_0x4cb244;_0x15322b=0xc8;}else{_0x15322b=0xce;}_0x26f245['status'](_0x15322b);return _0x26f245['set'](_0xc268('0x23'),_0x35d968+'-'+_0x211e2c+'/'+_0x4cb244)['json'](_0x3b62c6);}return null;};}function patchUpdates(_0x4669c3){return function(_0x104678){try{jsonpatch[_0xc268('0x24')](_0x104678,_0x4669c3,!![]);}catch(_0x37ff95){return BPromise['reject'](_0x37ff95);}return _0x104678['save']();};}function saveUpdates(_0x3c315b,_0x1b409b){return function(_0x5d76a1){if(_0x5d76a1){return _0x5d76a1[_0xc268('0x25')](_0x3c315b)[_0xc268('0x26')](function(_0x375959){return _0x375959;});}return null;};}function removeEntity(_0x42583d,_0x4a2f93){return function(_0xdca84a){if(_0xdca84a){return _0xdca84a['destroy']()[_0xc268('0x26')](function(){_0x42583d[_0xc268('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ce6ba,_0x2634e4){return function(_0x5e9032){if(!_0x5e9032){_0x3ce6ba[_0xc268('0x27')](0x194);}return _0x5e9032;};}function handleError(_0x2dcbc1,_0x24d288){_0x24d288=_0x24d288||0x1f4;return function(_0x33deeb){logger[_0xc268('0x28')](_0x33deeb[_0xc268('0x29')]);if(_0x33deeb[_0xc268('0x2a')]){delete _0x33deeb[_0xc268('0x2a')];}_0x2dcbc1[_0xc268('0x1e')](_0x24d288)['send'](_0x33deeb);};}exports[_0xc268('0x2b')]=function(_0x298db8,_0x3a5504){var _0x1a3ebd={},_0x200d65={},_0xe796b={'count':0x0,'rows':[]};var _0x36258d=_['map'](db[_0xc268('0x2c')][_0xc268('0x2d')],function(_0x3aabc1){return{'name':_0x3aabc1[_0xc268('0x2e')],'type':_0x3aabc1[_0xc268('0x2f')]['key']};});_0x200d65[_0xc268('0x30')]=_[_0xc268('0x31')](_0x36258d,_0xc268('0x2a'));_0x200d65['query']=_['keys'](_0x298db8[_0xc268('0x32')]);_0x200d65['filters']=_[_0xc268('0x33')](_0x200d65[_0xc268('0x30')],_0x200d65['query']);_0x1a3ebd[_0xc268('0x34')]=_[_0xc268('0x33')](_0x200d65[_0xc268('0x30')],qs['fields'](_0x298db8[_0xc268('0x32')][_0xc268('0x35')]));_0x1a3ebd[_0xc268('0x34')]=_0x1a3ebd[_0xc268('0x34')]['length']?_0x1a3ebd[_0xc268('0x34')]:_0x200d65[_0xc268('0x30')];if(!_0x298db8[_0xc268('0x32')][_0xc268('0x36')](_0xc268('0x37'))){_0x1a3ebd[_0xc268('0x1f')]=qs[_0xc268('0x1f')](_0x298db8['query'][_0xc268('0x1f')]);_0x1a3ebd['offset']=qs[_0xc268('0x22')](_0x298db8[_0xc268('0x32')][_0xc268('0x22')]);}_0x1a3ebd[_0xc268('0x38')]=qs['sort'](_0x298db8[_0xc268('0x32')][_0xc268('0x39')]);_0x1a3ebd[_0xc268('0x3a')]=qs[_0xc268('0x3b')](_[_0xc268('0x3c')](_0x298db8[_0xc268('0x32')],_0x200d65[_0xc268('0x3b')]),_0x36258d);if(_0x298db8[_0xc268('0x32')]['filter']){_0x1a3ebd['where']=_['merge'](_0x1a3ebd['where'],{'$or':_[_0xc268('0x31')](_0x36258d,function(_0x469ca7){if(_0x469ca7[_0xc268('0x2f')]!==_0xc268('0x3d')){var _0x48ca26={};_0x48ca26[_0x469ca7['name']]={'$like':'%'+_0x298db8[_0xc268('0x32')][_0xc268('0x3e')]+'%'};return _0x48ca26;}})});}_0x1a3ebd=_[_0xc268('0x3f')]({},_0x1a3ebd,_0x298db8['options']);var _0x4d1069={'where':_0x1a3ebd[_0xc268('0x3a')]};return db[_0xc268('0x2c')][_0xc268('0x21')](_0x4d1069)['then'](function(_0x56f847){_0xe796b['count']=_0x56f847;if(_0x298db8['query']['includeAll']){_0x1a3ebd[_0xc268('0x40')]=[{'all':!![]}];}return db[_0xc268('0x2c')][_0xc268('0x41')](_0x1a3ebd);})[_0xc268('0x26')](function(_0xefddd7){_0xe796b[_0xc268('0x42')]=_0xefddd7;return _0xe796b;})[_0xc268('0x26')](respondWithFilteredResult(_0x3a5504,_0x1a3ebd))[_0xc268('0x43')](handleError(_0x3a5504,null));};exports[_0xc268('0x44')]=function(_0x118bd8,_0x3f027a){var _0xf6d46f={'raw':!![],'where':{'id':_0x118bd8[_0xc268('0x45')]['id']}},_0x12670a={};_0x12670a[_0xc268('0x30')]=_[_0xc268('0x46')](db[_0xc268('0x2c')][_0xc268('0x2d')]);_0x12670a[_0xc268('0x32')]=_['keys'](_0x118bd8[_0xc268('0x32')]);_0x12670a[_0xc268('0x3b')]=_['intersection'](_0x12670a[_0xc268('0x30')],_0x12670a[_0xc268('0x32')]);_0xf6d46f[_0xc268('0x34')]=_['intersection'](_0x12670a[_0xc268('0x30')],qs[_0xc268('0x35')](_0x118bd8[_0xc268('0x32')][_0xc268('0x35')]));_0xf6d46f[_0xc268('0x34')]=_0xf6d46f[_0xc268('0x34')][_0xc268('0x47')]?_0xf6d46f[_0xc268('0x34')]:_0x12670a[_0xc268('0x30')];if(_0x118bd8[_0xc268('0x32')][_0xc268('0x48')]){_0xf6d46f[_0xc268('0x40')]=[{'all':!![]}];}_0xf6d46f=_[_0xc268('0x3f')]({},_0xf6d46f,_0x118bd8[_0xc268('0x49')]);return db[_0xc268('0x2c')][_0xc268('0x4a')](_0xf6d46f)['then'](handleEntityNotFound(_0x3f027a,null))['then'](respondWithResult(_0x3f027a,null))[_0xc268('0x43')](handleError(_0x3f027a,null));};exports[_0xc268('0x4b')]=function(_0x4247d3,_0xd0e35c){return db['WhatsappTransferReport']['create'](_0x4247d3[_0xc268('0x4c')],{})[_0xc268('0x26')](respondWithResult(_0xd0e35c,0xc9))[_0xc268('0x43')](handleError(_0xd0e35c,null));};exports['update']=function(_0x309512,_0x3e9013){if(_0x309512[_0xc268('0x4c')]['id']){delete _0x309512['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x309512[_0xc268('0x45')]['id']}})[_0xc268('0x26')](handleEntityNotFound(_0x3e9013,null))[_0xc268('0x26')](saveUpdates(_0x309512[_0xc268('0x4c')],null))[_0xc268('0x26')](respondWithResult(_0x3e9013,null))[_0xc268('0x43')](handleError(_0x3e9013,null));};exports['destroy']=function(_0x3ebb7b,_0x101f8d){return db[_0xc268('0x2c')]['find']({'where':{'id':_0x3ebb7b[_0xc268('0x45')]['id']}})[_0xc268('0x26')](handleEntityNotFound(_0x101f8d,null))['then'](removeEntity(_0x101f8d,null))[_0xc268('0x43')](handleError(_0x101f8d,null));};exports[_0xc268('0x4d')]=function(_0x49940a,_0x2b3f51){return db['WhatsappTransferReport'][_0xc268('0x4d')]()[_0xc268('0x26')](respondWithResult(_0x2b3f51,null))[_0xc268('0x43')](handleError(_0x2b3f51,null));};
\ No newline at end of file
+var _0xb827=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','WhatsappTransferReport','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','reject','update','destroy','then','error','stack','name','index','rawAttributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xb827,0x135));var _0x7b82=function(_0x4a9b3d,_0x227d02){_0x4a9b3d=_0x4a9b3d-0x0;var _0x3479ef=_0xb827[_0x4a9b3d];return _0x3479ef;};'use strict';var emlformat=require(_0x7b82('0x0'));var rimraf=require(_0x7b82('0x1'));var zipdir=require(_0x7b82('0x2'));var jsonpatch=require(_0x7b82('0x3'));var rp=require('request-promise');var moment=require(_0x7b82('0x4'));var BPromise=require(_0x7b82('0x5'));var Mustache=require(_0x7b82('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7b82('0x7'));var csv=require(_0x7b82('0x8'));var ejs=require(_0x7b82('0x9'));var fs=require('fs');var fs_extra=require(_0x7b82('0xa'));var _=require(_0x7b82('0xb'));var squel=require(_0x7b82('0xc'));var crypto=require('crypto');var jsforce=require(_0x7b82('0xd'));var deskjs=require(_0x7b82('0xe'));var toCsv=require(_0x7b82('0x8'));var querystring=require(_0x7b82('0xf'));var Papa=require(_0x7b82('0x10'));var Redis=require(_0x7b82('0x11'));var authService=require(_0x7b82('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b82('0x13'));var logger=require(_0x7b82('0x14'))('api');var utils=require(_0x7b82('0x15'));var config=require(_0x7b82('0x16'));var licenseUtil=require(_0x7b82('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xded7a,_0x4a539d){_0x4a539d=_0x4a539d||0xcc;return function(_0x30924a){if(_0x30924a){return _0xded7a[_0x7b82('0x18')](_0x4a539d);}return _0xded7a[_0x7b82('0x19')](_0x4a539d)[_0x7b82('0x1a')]();};}function respondWithResult(_0x2b56d7,_0x4846f2){_0x4846f2=_0x4846f2||0xc8;return function(_0x5ed383){if(_0x5ed383){return _0x2b56d7[_0x7b82('0x19')](_0x4846f2)[_0x7b82('0x1b')](_0x5ed383);}};}function respondWithFilteredResult(_0x3a0261,_0x457418){return function(_0x2c9f58){if(_0x2c9f58){var _0x16cd9f=typeof _0x457418['offset']==='undefined'&&typeof _0x457418[_0x7b82('0x1c')]==='undefined';var _0x1e1544=_0x2c9f58[_0x7b82('0x1d')];var _0x26dea5=_0x16cd9f?0x0:_0x457418[_0x7b82('0x1e')];var _0x40377f=_0x16cd9f?_0x2c9f58['count']:_0x457418[_0x7b82('0x1e')]+_0x457418[_0x7b82('0x1c')];var _0x45f25d;if(_0x40377f>=_0x1e1544){_0x40377f=_0x1e1544;_0x45f25d=0xc8;}else{_0x45f25d=0xce;}_0x3a0261[_0x7b82('0x19')](_0x45f25d);return _0x3a0261[_0x7b82('0x1f')]('Content-Range',_0x26dea5+'-'+_0x40377f+'/'+_0x1e1544)['json'](_0x2c9f58);}return null;};}function patchUpdates(_0x550571){return function(_0x563256){try{jsonpatch['apply'](_0x563256,_0x550571,!![]);}catch(_0xaf2f3c){return BPromise[_0x7b82('0x20')](_0xaf2f3c);}return _0x563256['save']();};}function saveUpdates(_0x788939,_0x1a36a3){return function(_0x15481c){if(_0x15481c){return _0x15481c[_0x7b82('0x21')](_0x788939)['then'](function(_0x2652fd){return _0x2652fd;});}return null;};}function removeEntity(_0x284a8b,_0x4f02d8){return function(_0x383ac7){if(_0x383ac7){return _0x383ac7[_0x7b82('0x22')]()[_0x7b82('0x23')](function(){_0x284a8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4772cb,_0xe456ac){return function(_0x5394d3){if(!_0x5394d3){_0x4772cb['sendStatus'](0x194);}return _0x5394d3;};}function handleError(_0x5479f2,_0x23fb55){_0x23fb55=_0x23fb55||0x1f4;return function(_0x6809cd){logger[_0x7b82('0x24')](_0x6809cd[_0x7b82('0x25')]);if(_0x6809cd[_0x7b82('0x26')]){delete _0x6809cd[_0x7b82('0x26')];}_0x5479f2[_0x7b82('0x19')](_0x23fb55)['send'](_0x6809cd);};}exports[_0x7b82('0x27')]=function(_0x495cad,_0x68d812){var _0x2c50d7={},_0x2d4b7e={},_0xdf4e11={'count':0x0,'rows':[]};var _0xfb7bec=_['map'](db['WhatsappTransferReport'][_0x7b82('0x28')],function(_0xae2fc5){return{'name':_0xae2fc5[_0x7b82('0x29')],'type':_0xae2fc5[_0x7b82('0x2a')]['key']};});_0x2d4b7e[_0x7b82('0x2b')]=_['map'](_0xfb7bec,_0x7b82('0x26'));_0x2d4b7e[_0x7b82('0x2c')]=_[_0x7b82('0x2d')](_0x495cad[_0x7b82('0x2c')]);_0x2d4b7e[_0x7b82('0x2e')]=_[_0x7b82('0x2f')](_0x2d4b7e[_0x7b82('0x2b')],_0x2d4b7e[_0x7b82('0x2c')]);_0x2c50d7['attributes']=_['intersection'](_0x2d4b7e['model'],qs[_0x7b82('0x30')](_0x495cad[_0x7b82('0x2c')][_0x7b82('0x30')]));_0x2c50d7[_0x7b82('0x31')]=_0x2c50d7['attributes']['length']?_0x2c50d7[_0x7b82('0x31')]:_0x2d4b7e[_0x7b82('0x2b')];if(!_0x495cad[_0x7b82('0x2c')]['hasOwnProperty'](_0x7b82('0x32'))){_0x2c50d7[_0x7b82('0x1c')]=qs[_0x7b82('0x1c')](_0x495cad['query']['limit']);_0x2c50d7[_0x7b82('0x1e')]=qs[_0x7b82('0x1e')](_0x495cad['query'][_0x7b82('0x1e')]);}_0x2c50d7['order']=qs[_0x7b82('0x33')](_0x495cad[_0x7b82('0x2c')][_0x7b82('0x33')]);_0x2c50d7[_0x7b82('0x34')]=qs['filters'](_[_0x7b82('0x35')](_0x495cad[_0x7b82('0x2c')],_0x2d4b7e[_0x7b82('0x2e')]),_0xfb7bec);if(_0x495cad[_0x7b82('0x2c')][_0x7b82('0x36')]){_0x2c50d7['where']=_['merge'](_0x2c50d7[_0x7b82('0x34')],{'$or':_[_0x7b82('0x37')](_0xfb7bec,function(_0x112c53){if(_0x112c53[_0x7b82('0x2a')]!==_0x7b82('0x38')){var _0x245c72={};_0x245c72[_0x112c53['name']]={'$like':'%'+_0x495cad[_0x7b82('0x2c')][_0x7b82('0x36')]+'%'};return _0x245c72;}})});}_0x2c50d7=_[_0x7b82('0x39')]({},_0x2c50d7,_0x495cad[_0x7b82('0x3a')]);var _0x4e595f={'where':_0x2c50d7['where']};return db[_0x7b82('0x3b')][_0x7b82('0x1d')](_0x4e595f)[_0x7b82('0x23')](function(_0x1765f5){_0xdf4e11[_0x7b82('0x1d')]=_0x1765f5;if(_0x495cad[_0x7b82('0x2c')][_0x7b82('0x3c')]){_0x2c50d7[_0x7b82('0x3d')]=[{'all':!![]}];}return db[_0x7b82('0x3b')]['findAll'](_0x2c50d7);})['then'](function(_0x41c069){_0xdf4e11[_0x7b82('0x3e')]=_0x41c069;return _0xdf4e11;})[_0x7b82('0x23')](respondWithFilteredResult(_0x68d812,_0x2c50d7))[_0x7b82('0x3f')](handleError(_0x68d812,null));};exports[_0x7b82('0x40')]=function(_0x54d6d8,_0x39917c){var _0x21f5f3={'raw':!![],'where':{'id':_0x54d6d8['params']['id']}},_0xd0dcaa={};_0xd0dcaa['model']=_['keys'](db['WhatsappTransferReport'][_0x7b82('0x28')]);_0xd0dcaa[_0x7b82('0x2c')]=_[_0x7b82('0x2d')](_0x54d6d8['query']);_0xd0dcaa[_0x7b82('0x2e')]=_['intersection'](_0xd0dcaa['model'],_0xd0dcaa[_0x7b82('0x2c')]);_0x21f5f3[_0x7b82('0x31')]=_[_0x7b82('0x2f')](_0xd0dcaa[_0x7b82('0x2b')],qs['fields'](_0x54d6d8[_0x7b82('0x2c')][_0x7b82('0x30')]));_0x21f5f3[_0x7b82('0x31')]=_0x21f5f3[_0x7b82('0x31')]['length']?_0x21f5f3[_0x7b82('0x31')]:_0xd0dcaa[_0x7b82('0x2b')];if(_0x54d6d8[_0x7b82('0x2c')][_0x7b82('0x3c')]){_0x21f5f3[_0x7b82('0x3d')]=[{'all':!![]}];}_0x21f5f3=_[_0x7b82('0x39')]({},_0x21f5f3,_0x54d6d8[_0x7b82('0x3a')]);return db[_0x7b82('0x3b')][_0x7b82('0x41')](_0x21f5f3)['then'](handleEntityNotFound(_0x39917c,null))[_0x7b82('0x23')](respondWithResult(_0x39917c,null))[_0x7b82('0x3f')](handleError(_0x39917c,null));};exports[_0x7b82('0x42')]=function(_0x7ac1b7,_0x5cdeae){return db[_0x7b82('0x3b')][_0x7b82('0x42')](_0x7ac1b7[_0x7b82('0x43')],{})[_0x7b82('0x23')](respondWithResult(_0x5cdeae,0xc9))[_0x7b82('0x3f')](handleError(_0x5cdeae,null));};exports[_0x7b82('0x21')]=function(_0x3135ea,_0x217c09){if(_0x3135ea[_0x7b82('0x43')]['id']){delete _0x3135ea[_0x7b82('0x43')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x3135ea[_0x7b82('0x44')]['id']}})[_0x7b82('0x23')](handleEntityNotFound(_0x217c09,null))[_0x7b82('0x23')](saveUpdates(_0x3135ea[_0x7b82('0x43')],null))[_0x7b82('0x23')](respondWithResult(_0x217c09,null))[_0x7b82('0x3f')](handleError(_0x217c09,null));};exports[_0x7b82('0x22')]=function(_0x8126c1,_0xd48647){return db[_0x7b82('0x3b')][_0x7b82('0x41')]({'where':{'id':_0x8126c1['params']['id']}})[_0x7b82('0x23')](handleEntityNotFound(_0xd48647,null))['then'](removeEntity(_0xd48647,null))[_0x7b82('0x3f')](handleError(_0xd48647,null));};exports[_0x7b82('0x45')]=function(_0xb507df,_0x734334){return db[_0x7b82('0x3b')][_0x7b82('0x45')]()[_0x7b82('0x23')](respondWithResult(_0x734334,null))['catch'](handleError(_0x734334,null));};
\ No newline at end of file
index 3d6f2df..6d0adff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb1=['util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash'];(function(_0x4e7367,_0x5c11fa){var _0x292860=function(_0x571c21){while(--_0x571c21){_0x4e7367['push'](_0x4e7367['shift']());}};_0x292860(++_0x5c11fa);}(_0x9bb1,0x137));var _0x19bb=function(_0x9fae8d,_0x2cc9ba){_0x9fae8d=_0x9fae8d-0x0;var _0x18d66c=_0x9bb1[_0x9fae8d];return _0x18d66c;};'use strict';var _=require(_0x19bb('0x0'));var util=require(_0x19bb('0x1'));var logger=require(_0x19bb('0x2'))(_0x19bb('0x3'));var moment=require(_0x19bb('0x4'));var BPromise=require(_0x19bb('0x5'));var rp=require(_0x19bb('0x6'));var fs=require('fs');var path=require(_0x19bb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x19bb('0x8'));module[_0x19bb('0x9')]=function(_0x2b50e0,_0x33a481){return _0x2b50e0[_0x19bb('0xa')](_0x19bb('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x19bb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b8d=['request-promise','path','rimraf','./whatsappTransferReport.attributes','WhatsappTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x25fe20,_0x5c4098){var _0x5684d0=function(_0x221f80){while(--_0x221f80){_0x25fe20['push'](_0x25fe20['shift']());}};_0x5684d0(++_0x5c4098);}(_0x9b8d,0x17c));var _0xd9b8=function(_0x49c54c,_0x54a647){_0x49c54c=_0x49c54c-0x0;var _0x446225=_0x9b8d[_0x49c54c];return _0x446225;};'use strict';var _=require(_0xd9b8('0x0'));var util=require('util');var logger=require(_0xd9b8('0x1'))(_0xd9b8('0x2'));var moment=require(_0xd9b8('0x3'));var BPromise=require(_0xd9b8('0x4'));var rp=require(_0xd9b8('0x5'));var fs=require('fs');var path=require(_0xd9b8('0x6'));var rimraf=require(_0xd9b8('0x7'));var config=require('../../config/environment');var attributes=require(_0xd9b8('0x8'));module['exports']=function(_0x508b25,_0x4632cc){return _0x508b25['define'](_0xd9b8('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xd9b8('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c8adbd4..15e8823 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f33=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x4f33,0xd4));var _0x34f3=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x4f33[_0x4defd6];return _0x4c9276;};'use strict';var _=require(_0x34f3('0x0'));var util=require(_0x34f3('0x1'));var moment=require(_0x34f3('0x2'));var BPromise=require(_0x34f3('0x3'));var rs=require(_0x34f3('0x4'));var fs=require('fs');var Redis=require(_0x34f3('0x5'));var db=require(_0x34f3('0x6'))['db'];var utils=require(_0x34f3('0x7'));var logger=require(_0x34f3('0x8'))('rpc');var config=require(_0x34f3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x34f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c7c2d,_0x3e21e5,_0x377aac){return new BPromise(function(_0x5f1c49,_0x2b22eb){return client[_0x34f3('0xb')](_0x1c7c2d,_0x377aac)['then'](function(_0x3616b8){logger['info'](_0x34f3('0xc'),_0x3e21e5,_0x34f3('0xd'));logger[_0x34f3('0xe')](_0x34f3('0xf'),_0x3e21e5,_0x34f3('0xd'),JSON[_0x34f3('0x10')](_0x3616b8));if(_0x3616b8['error']){if(_0x3616b8[_0x34f3('0x11')][_0x34f3('0x12')]===0x1f4){logger['error'](_0x34f3('0xc'),_0x3e21e5,_0x3616b8['error']['message']);return _0x2b22eb(_0x3616b8[_0x34f3('0x11')][_0x34f3('0x13')]);}logger[_0x34f3('0x11')](_0x34f3('0xc'),_0x3e21e5,_0x3616b8[_0x34f3('0x11')][_0x34f3('0x13')]);return _0x5f1c49(_0x3616b8[_0x34f3('0x11')][_0x34f3('0x13')]);}else{logger[_0x34f3('0x14')](_0x34f3('0xc'),_0x3e21e5,_0x34f3('0xd'));_0x5f1c49(_0x3616b8[_0x34f3('0x15')][_0x34f3('0x13')]);}})[_0x34f3('0x16')](function(_0x82ceda){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3e21e5,_0x82ceda);_0x2b22eb(_0x82ceda);});});}
\ No newline at end of file
+var _0xeaa8=['http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5ecd67,_0x2cbaf8){var _0x3ca757=function(_0x3afa60){while(--_0x3afa60){_0x5ecd67['push'](_0x5ecd67['shift']());}};_0x3ca757(++_0x2cbaf8);}(_0xeaa8,0x199));var _0x8eaa=function(_0x23e97f,_0x46a20b){_0x23e97f=_0x23e97f-0x0;var _0x1bd1d7=_0xeaa8[_0x23e97f];return _0x1bd1d7;};'use strict';var _=require(_0x8eaa('0x0'));var util=require(_0x8eaa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8eaa('0x2'));var fs=require('fs');var Redis=require(_0x8eaa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eaa('0x4'));var logger=require(_0x8eaa('0x5'))(_0x8eaa('0x6'));var config=require('../../config/environment');var jayson=require(_0x8eaa('0x7'));var client=jayson[_0x8eaa('0x8')][_0x8eaa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e064e,_0x150e8b,_0x5b4dc0){return new BPromise(function(_0x3f0b64,_0x456aae){return client[_0x8eaa('0xa')](_0x3e064e,_0x5b4dc0)[_0x8eaa('0xb')](function(_0x490f46){logger[_0x8eaa('0xc')](_0x8eaa('0xd'),_0x150e8b,_0x8eaa('0xe'));logger[_0x8eaa('0xf')](_0x8eaa('0x10'),_0x150e8b,_0x8eaa('0xe'),JSON[_0x8eaa('0x11')](_0x490f46));if(_0x490f46[_0x8eaa('0x12')]){if(_0x490f46['error'][_0x8eaa('0x13')]===0x1f4){logger[_0x8eaa('0x12')](_0x8eaa('0xd'),_0x150e8b,_0x490f46[_0x8eaa('0x12')][_0x8eaa('0x14')]);return _0x456aae(_0x490f46[_0x8eaa('0x12')]['message']);}logger[_0x8eaa('0x12')](_0x8eaa('0xd'),_0x150e8b,_0x490f46['error'][_0x8eaa('0x14')]);return _0x3f0b64(_0x490f46[_0x8eaa('0x12')][_0x8eaa('0x14')]);}else{logger['info'](_0x8eaa('0xd'),_0x150e8b,_0x8eaa('0xe'));_0x3f0b64(_0x490f46['result'][_0x8eaa('0x14')]);}})[_0x8eaa('0x15')](function(_0x1f0065){logger[_0x8eaa('0x12')](_0x8eaa('0xd'),_0x150e8b,_0x1f0065);_0x456aae(_0x1f0065);});});}
\ No newline at end of file
index 09565ba..d8ab55f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bb=['exitCode','number','length','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','log','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter'];(function(_0x47a508,_0x4159e4){var _0x267c76=function(_0x57e678){while(--_0x57e678){_0x47a508['push'](_0x47a508['shift']());}};_0x267c76(++_0x4159e4);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x7b67bd,_0x2b5b96){_0x7b67bd=_0x7b67bd-0x0;var _0x48545c=_0xd2bb[_0x7b67bd];return _0x48545c;};'use strict';var _=require('lodash');var db=require(_0xbd2b('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xbd2b('0x1'));var rpc=require(_0xbd2b('0x2'));var config=require(_0xbd2b('0x3'));var logger=require(_0xbd2b('0x4'))(_0xbd2b('0x5'));var pm2=require(_0xbd2b('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xbd2b('0x7'));var chat=require(_0xbd2b('0x8'));var whatsapp=require(_0xbd2b('0x9'));var transcribe=require(_0xbd2b('0xa'));var provider=require(_0xbd2b('0xb'));function main(){return db[_0xbd2b('0xc')][_0xbd2b('0xd')]()[_0xbd2b('0xe')](function(){if(config[_0xbd2b('0xf')]){return seedDb[_0xbd2b('0x10')]();}})['then'](function(){return checkLicense[_0xbd2b('0x10')]();})['then'](function(){return rpc[_0xbd2b('0x11')]();})[_0xbd2b('0xe')](function(_0x4e9572){logger[_0xbd2b('0x12')](_0x4e9572);return chat[_0xbd2b('0x13')]();})[_0xbd2b('0xe')](function(){return whatsapp[_0xbd2b('0x13')]();})[_0xbd2b('0xe')](function(){return schedule[_0xbd2b('0x13')]();})[_0xbd2b('0xe')](function(){return transcribe[_0xbd2b('0x13')]();})['then'](function(){return provider[_0xbd2b('0x13')]();})[_0xbd2b('0xe')](function(_0x44d283){logger[_0xbd2b('0x12')](_0x44d283);return pm2[_0xbd2b('0x13')](pm2Config);})['then'](function(_0x1ccc21){var _0x6c2877=_0x1ccc21[_0xbd2b('0x14')](function(_0x1018dc){return typeof _0x1018dc[_0xbd2b('0x15')]===_0xbd2b('0x16')&&_0x1018dc[_0xbd2b('0x15')]>=0x0;});if(_0x6c2877[_0xbd2b('0x17')]>0x0){throw new Error(_0x6c2877[_0xbd2b('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xbd2b('0x18')](_0x6c2877,function(_0x268025){return'\x22'+_0x268025[_0xbd2b('0x19')][_0xbd2b('0x1a')]+'\x22';}));}logger[_0xbd2b('0x12')](_0xbd2b('0x1b'),_[_0xbd2b('0x18')](_[_0xbd2b('0x14')](_0x1ccc21,{'status':_0xbd2b('0x1c')}),_0xbd2b('0x1a'))['join']());logger[_0xbd2b('0x12')](_0xbd2b('0x1d'),_[_0xbd2b('0x18')](_[_0xbd2b('0x14')](_0x1ccc21,function(_0xc1ce31){return _0xc1ce31[_0xbd2b('0x1e')]!==_0xbd2b('0x1c');}),'name')['join']()||'None');console[_0xbd2b('0x1f')]('App\x20Ready!');})[_0xbd2b('0x20')](function(_0x3efc8a){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3efc8a);logger[_0xbd2b('0x21')](_0xbd2b('0x22'),_0x3efc8a);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xaa19=['sequelize','then','default','listen','info','start','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','status','join','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./config/environment','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider'];(function(_0x2a5dc1,_0xc58ca4){var _0x244d63=function(_0x2836c5){while(--_0x2836c5){_0x2a5dc1['push'](_0x2a5dc1['shift']());}};_0x244d63(++_0xc58ca4);}(_0xaa19,0x79));var _0x9aa1=function(_0x4276cc,_0x5417df){_0x4276cc=_0x4276cc-0x0;var _0x39bedd=_0xaa19[_0x4276cc];return _0x39bedd;};'use strict';var _=require(_0x9aa1('0x0'));var db=require(_0x9aa1('0x1'))['db'];var seedDb=require(_0x9aa1('0x2'));var checkLicense=require(_0x9aa1('0x3'));var rpc=require('./rpc');var config=require(_0x9aa1('0x4'));var logger=require('./config/logger')(_0x9aa1('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x9aa1('0x6'));var schedule=require(_0x9aa1('0x7'));var chat=require(_0x9aa1('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x9aa1('0x9'));var provider=require(_0x9aa1('0xa'));function main(){return db[_0x9aa1('0xb')]['sync']()[_0x9aa1('0xc')](function(){if(config['seedDB']){return seedDb['default']();}})[_0x9aa1('0xc')](function(){return checkLicense[_0x9aa1('0xd')]();})[_0x9aa1('0xc')](function(){return rpc[_0x9aa1('0xe')]();})['then'](function(_0x5e76cc){logger[_0x9aa1('0xf')](_0x5e76cc);return chat['start']();})[_0x9aa1('0xc')](function(){return whatsapp['start']();})['then'](function(){return schedule['start']();})[_0x9aa1('0xc')](function(){return transcribe[_0x9aa1('0x10')]();})['then'](function(){return provider[_0x9aa1('0x10')]();})[_0x9aa1('0xc')](function(_0x2d5d74){logger['info'](_0x2d5d74);return pm2['start'](pm2Config);})[_0x9aa1('0xc')](function(_0x483611){var _0x69f459=_0x483611['filter'](function(_0x1abab9){return typeof _0x1abab9[_0x9aa1('0x11')]===_0x9aa1('0x12')&&_0x1abab9[_0x9aa1('0x11')]>=0x0;});if(_0x69f459['length']>0x0){throw new Error(_0x69f459['length']+_0x9aa1('0x13')+_[_0x9aa1('0x14')](_0x69f459,function(_0x30b187){return'\x22'+_0x30b187[_0x9aa1('0x15')][_0x9aa1('0x16')]+'\x22';}));}logger[_0x9aa1('0xf')](_0x9aa1('0x17'),_[_0x9aa1('0x14')](_[_0x9aa1('0x18')](_0x483611,{'status':_0x9aa1('0x19')}),_0x9aa1('0x16'))['join']());logger['info']('Offline\x20apps:',_[_0x9aa1('0x14')](_[_0x9aa1('0x18')](_0x483611,function(_0x4bd4d7){return _0x4bd4d7[_0x9aa1('0x1a')]!==_0x9aa1('0x19');}),_0x9aa1('0x16'))[_0x9aa1('0x1b')]()||'None');console['log']('App\x20Ready!');})[_0x9aa1('0x1c')](function(_0x4f22b9){console[_0x9aa1('0x1d')](_0x9aa1('0x1e'),_0x4f22b9);logger[_0x9aa1('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x4f22b9);process[_0x9aa1('0x20')](0x1);});}main();
\ No newline at end of file
index 0f2baa7..762aa59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','user','ChatInteraction','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','canUpdate','use','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x17847a,_0x1e38e0){var _0x589d21=function(_0x3babfe){while(--_0x3babfe){_0x17847a['push'](_0x17847a['shift']());}};_0x589d21(++_0x1e38e0);}(_0x34e8,0x12c));var _0x834e=function(_0x87abf1,_0x4c2629){_0x87abf1=_0x87abf1-0x0;var _0xd8c0ff=_0x34e8[_0x87abf1];return _0xd8c0ff;};'use strict';var db=require(_0x834e('0x0'))['db'];var config=require(_0x834e('0x1'));var hardwareConf=require(_0x834e('0x2'));var licenseUtil=require(_0x834e('0x3'));var encryptor=require('../encryptor');var _=require(_0x834e('0x4'));var jwt=require(_0x834e('0x5'));var expressJwt=require(_0x834e('0x6'));var compose=require(_0x834e('0x7'));var basicAuth=require(_0x834e('0x8'));var crypto=require(_0x834e('0x9'));var BPromise=require(_0x834e('0xa'));var util=require('util');var moment=require(_0x834e('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x834e('0xc')]});var userAttributes=['id',_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10'),_0x834e('0x11'),_0x834e('0x12'),_0x834e('0x13'),_0x834e('0x14'),_0x834e('0x15'),_0x834e('0x16'),_0x834e('0x17'),_0x834e('0x18'),_0x834e('0x19'),_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'lastLoginAt',_0x834e('0x1d'),_0x834e('0x1e'),'allowmessenger',_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),'phoneBarDnd',_0x834e('0x23'),_0x834e('0x24'),'phoneBarEnableSettings',_0x834e('0x25'),'phoneBarPrefixRequired',_0x834e('0x26'),_0x834e('0x27'),'hotdesk',_0x834e('0x28'),_0x834e('0x29'),_0x834e('0x2a'),'settingsEnabled',_0x834e('0x2b'),_0x834e('0x2c'),_0x834e('0x2d'),_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30'),_0x834e('0x31'),'chatAutoanswerDelay',_0x834e('0x32'),_0x834e('0x33'),_0x834e('0x34'),_0x834e('0x35'),'openchannelAutoanswer',_0x834e('0x36'),_0x834e('0x37'),'faxAutoanswerDelay',_0x834e('0x38'),_0x834e('0x39')];exports[_0x834e('0x3a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x231619,_0x34563b,_0x589dde){if(_0x231619[_0x834e('0x3b')]){_0x589dde();}else{return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x231619[_0x834e('0x3d')]['id']},'attributes':['id',_0x834e('0x3e'),_0x834e('0x3f')],'raw':!![]})['then'](function(_0x24fcf7){if(_0x24fcf7&&_0x24fcf7[_0x834e('0x3e')]){return _0x34563b['status'](_0x24fcf7['disposition']===_0x834e('0x40')?0x195:0x193)['json']({'message':_0x24fcf7[_0x834e('0x3f')]===_0x834e('0x40')?_0x834e('0x41'):_0x834e('0x42')});}else{_0x589dde();}})[_0x834e('0x43')](function(_0x130cc5){_0x589dde(_0x130cc5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x510780){return compose()['use'](function(_0x58c1d7,_0x2c7a8d,_0x567cea){var _0x106d6a;if(_0x58c1d7['headers'][_0x834e('0x44')]){if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],_0x834e('0x47'))){var _0x390119=basicAuth(_0x58c1d7);db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'name':_0x390119[_0x834e('0xf')]}})['then'](function(_0xef9ec2){if(!_0xef9ec2||!_0xef9ec2['authenticate'](_0x390119[_0x834e('0x4a')])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x4d')});}_0x58c1d7[_0x834e('0x3b')]={'id':_0xef9ec2['id']};_0x567cea();})[_0x834e('0x43')](function(_0x4696a1){_0x567cea(_0x4696a1);});}else if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],'Bearer')){validateJwt(_0x58c1d7,_0x2c7a8d,_0x567cea);}else{if(_0x510780){_0x567cea();}else{return _0x2c7a8d[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}}}else if(_0x58c1d7[_0x834e('0x4f')]['apikey']){try{var _0x3f88ad={'audience':hardwareConf[_0x834e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x58c1d7['query']['apikey'],_0x3f88ad)[_0x834e('0x51')](function(_0x41bf4d){return db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x41bf4d[_0x834e('0x52')]}})[_0x834e('0x51')](function(_0x4c2ef6){_0x106d6a=_0x4c2ef6;return db[_0x834e('0x53')]['findOne']({'where':{'id':0x1},'attributes':[_0x834e('0x54'),_0x834e('0x55')],'raw':!![]});})['then'](function(_0x18ac3b){if(!_0x106d6a||!_[_0x834e('0x56')](_0x106d6a['apiKeyNonce'],_0x41bf4d['nonce'])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x57')});}if(_0x106d6a[_0x834e('0x58')]){return _0x2c7a8d[_0x834e('0x4b')](0x191)['json']({'message':_0x834e('0x59')});}if(_0x106d6a['blocked']){if(_0x18ac3b['blockDuration']>0x0){if(moment(_0x106d6a[_0x834e('0x5a')])['add'](_0x18ac3b[_0x834e('0x55')],_0x834e('0x5b'))>moment()){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}else{return _0x2c7a8d['status'](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}_0x58c1d7[_0x834e('0x3b')]={'id':_0x106d6a['id']};_0x567cea();});})['catch'](function(){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1e3e71){_0x567cea(_0x1e3e71);}}else if(_0x510780){_0x567cea();}else{return _0x2c7a8d['status'](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}})['use'](function(_0x4a6942,_0x22ea21,_0x16969b){if(_0x4a6942[_0x834e('0x3b')]){db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x4a6942[_0x834e('0x3b')]['id']},'attributes':userAttributes})[_0x834e('0x51')](function(_0x4a3381){if(!_0x4a3381){return _0x22ea21[_0x834e('0x4b')](0x194)['json']({'message':_0x834e('0x5c')});}_0x4a6942['user']=_0x4a3381;_0x16969b();})[_0x834e('0x43')](function(_0x5a5807){_0x16969b(_0x5a5807);});}else if(_0x510780){_0x16969b();}else{return _0x22ea21[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x834e('0x5d')]=function canUpdate(){return compose()[_0x834e('0x5e')](function(_0xa880cb,_0xd55cc3,_0x252ea0){return licenseUtil[_0x834e('0x5f')]()[_0x834e('0x51')](function(_0x3ccd8e){if(_0x3ccd8e[_0x834e('0x60')]){_0x252ea0();}else{return _0xd55cc3[_0x834e('0x4b')](0x193)['json']({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0x47a8a9){_0x252ea0(_0x47a8a9);});});};exports[_0x834e('0x62')]=function isWebrtcLicence(){return compose()[_0x834e('0x5e')](function(_0x25b035,_0x2112d5,_0x19b5ef){return licenseUtil[_0x834e('0x5f')]()['then'](function(_0x59c855){if(_0x59c855[_0x834e('0x63')]){_0x19b5ef();}else{return _0x2112d5[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0xd1d83b){_0x19b5ef(_0xd1d83b);});});};exports[_0x834e('0x64')]=function(_0x43f599,_0x1419eb,_0x390c45){_0x43f599[_0x834e('0x64')]=!![];return _0x390c45();};exports[_0x834e('0x65')]=function signToken(_0x1a28f6){return signJwt(_0x1a28f6);};exports[_0x834e('0x66')]=function(_0x2aa072,_0x1a3855){if(!_0x2aa072[_0x834e('0x3b')]){return _0x1a3855[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':_0x834e('0x67')});}var _0x4cfacd={'payload':{'id':_0x2aa072[_0x834e('0x3b')]['id'],'role':_0x2aa072[_0x834e('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cfacd)[_0x834e('0x51')](function(_0x3b0988){_0x1a3855['cookie'](_0x834e('0x68'),_0x3b0988);_0x1a3855[_0x834e('0x69')](_0x834e('0x6a'));})[_0x834e('0x43')](function(_0x4288e4){return _0x1a3855[_0x834e('0x4b')](0x1f4)[_0x834e('0x6b')](_0x4288e4);});};exports['retrieveApiKey']=function(_0x1ad7fe){if(_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6d')])||_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6e')])){return null;}else{return createJwt(_0x1ad7fe);}};exports[_0x834e('0x6f')]=function(_0x344b51){_0x344b51[_0x834e('0x6d')]=generateNonce();_0x344b51['apiKeyIat']=generateIssuedAt();return createJwt(_0x344b51);};exports[_0x834e('0x70')]=function(_0x4dc104,_0x2f4bde){var _0x53a9ee=_0x4dc104[_0x834e('0x4f')]['apikey'];if(_0x53a9ee){var _0x527eef={'nonce':_0x2f4bde[_0x834e('0x6d')],'iat':_0x2f4bde[_0x834e('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a9ee,_0x527eef)[_0x834e('0x51')](function(){return generateApiKey(_0x2f4bde);});}else{throw{'message':_0x834e('0x71')};}};exports[_0x834e('0x72')]=function(_0x387365){var _0x21c417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21c417[_0x834e('0x73')](_0x387365))throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))]('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[_0x834e('0x76')]=function(_0x3c70bf,_0x5d5ac2,_0x281342){var _0x4e2b22=encryptor[_0x834e('0x77')](_0x5d5ac2)[_0x834e('0x78')](',');for(var _0x5160c4=0x0;_0x5160c4<_0x281342;_0x5160c4++){if(!_0x4e2b22[_0x5160c4])break;if(_0x3c70bf[_0x834e('0x79')]()===_0x4e2b22[_0x5160c4][_0x834e('0x79')]()){var _0x2de29a=util[_0x834e('0x7a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x281342);if(_0x281342===0x1){_0x2de29a=_0x834e('0x7b');}throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))](_0x2de29a);}}return;};exports['updatePasswordsHistory']=function(_0x246b8e,_0x1fcae9){var _0x3a7683=_0x1fcae9?encryptor[_0x834e('0x77')](_0x1fcae9)[_0x834e('0x78')](','):[];if(_0x3a7683[_0x834e('0x7c')]===0x5){_0x3a7683[_0x834e('0x7d')](-0x1,0x1);}_0x3a7683[_0x834e('0x7e')](_0x246b8e);return encryptor[_0x834e('0x7f')](_0x3a7683[_0x834e('0x80')](','));};function signJwt(_0x1e4310){var _0x1dfa95=BPromise[_0x834e('0x81')](jwt[_0x834e('0x82')],{'context':jwt});var _0x460a7a=_0x1e4310[_0x834e('0x83')]||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x193a15,_0x3e3467){_0x1dfa95(_0x1e4310[_0x834e('0x85')],_0x460a7a,_0x1e4310[_0x834e('0x86')])['then'](function(_0x2145cf){_0x193a15(_0x2145cf);})[_0x834e('0x43')](function(_0x45bcc2){_0x3e3467(_0x45bcc2);});});}function verifyJwt(_0x36cc14,_0x4ca099,_0x30faa8){var _0x5a9c70=BPromise['promisify'](jwt[_0x834e('0x87')],{'context':jwt});var _0x2b1ec7=_0x30faa8||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x216105,_0x3821ad){_0x5a9c70(_0x36cc14,_0x2b1ec7,_0x4ca099)[_0x834e('0x51')](function(_0xe5c8f6){_0x216105(_0xe5c8f6);})['catch'](function(_0xdef8c4){_0x3821ad(_0xdef8c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x834e('0x88')](_0x834e('0x89'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x834e('0x88')]();}function createJwt(_0x82f2a7){var _0x363cc2={'payload':{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')]},'options':{'algorithm':'HS512','subject':_0x82f2a7['id'][_0x834e('0x88')](),'issuer':hardwareConf[_0x834e('0x50')](),'audience':hardwareConf[_0x834e('0x50')]()}};return signJwt(_0x363cc2)[_0x834e('0x51')](function(_0x3181af){return{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')],'token':_0x3181af};});}
\ No newline at end of file
+var _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x44d094,_0x841d7e){var _0x39d413=function(_0x23cbf7){while(--_0x23cbf7){_0x44d094['push'](_0x44d094['shift']());}};_0x39d413(++_0x841d7e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4e029f,_0x177074){_0x4e029f=_0x4e029f-0x0;var _0x135b7e=_0xf3cd[_0x4e029f];return _0x135b7e;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});}
\ No newline at end of file
index 8f86d1a..5df682f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbbd=['length','fieldType','map','keys','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','where','default','fields','filter','clause','tags','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','catch','describe','CmContact','startsWith','cf_','CmCustomField','findOne','slice','all'];(function(_0x376641,_0xc7a5ff){var _0x11303a=function(_0x21d960){while(--_0x21d960){_0x376641['push'](_0x376641['shift']());}};_0x11303a(++_0xc7a5ff);}(_0xdbbd,0xa9));var _0xddbb=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xdbbd[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xddbb('0x0'));var sqlUtils=require(_0xddbb('0x1'));var db=require(_0xddbb('0x2'))['db'];exports[_0xddbb('0x3')]=function(_0x199028,_0x41ba1f,_0x55754b,_0x27132a){var _0x43681e={'count':0x0,'rows':[]};var _0x5b412c=sqlUtils[_0xddbb('0x4')](_0x41ba1f,_0x199028);if(_0x5b412c){return Promise[_0xddbb('0x5')](_0x43681e);}var _0x2cedd7=sqlUtils[_0xddbb('0x6')]();var _0x43eb6b={};var _0x43b3d2=![];var _0x574e2a=![];return Promise[_0xddbb('0x5')]()[_0xddbb('0x7')](function(){if(_0x199028['search']){return sqlUtils[_0xddbb('0x8')](_0x199028[_0xddbb('0x9')],_0x27132a);}else{return sqlUtils[_0xddbb('0xa')](_0x199028,_0x27132a);}})[_0xddbb('0x7')](function(_0x13688a){_0x2cedd7[_0xddbb('0xb')](_0x13688a[_0xddbb('0xc')]);_0x2cedd7['where'](_0x13688a[_0xddbb('0xd')]);_0x2cedd7[_0xddbb('0xb')](_0x13688a[_0xddbb('0xe')]);_0x2cedd7[_0xddbb('0xb')](_0x13688a['user'][_0xddbb('0xf')]);_0x43eb6b=_0x13688a[_0xddbb('0x10')];_0x574e2a=_0x13688a[_0xddbb('0x11')][_0xddbb('0x12')];return sqlUtils[_0xddbb('0x13')](_0x41ba1f,_0x199028,_0x574e2a);})[_0xddbb('0x7')](function(_0x416cfc){_0x2cedd7[_0xddbb('0xb')](_0x416cfc);var _0x43347d=_0x199028[_0xddbb('0x9')]?_0x43eb6b[_0xddbb('0x14')]:_0x199028[_0xddbb('0x15')];_0x43b3d2=_0x43347d?!![]:![];return sqlUtils[_0xddbb('0x16')](_0x2cedd7,_0x43347d);})[_0xddbb('0x7')](function(_0x59837b){_0x43681e[_0xddbb('0x17')]=_0x59837b;if(_0x43681e[_0xddbb('0x17')]===0x0){return;}if(_0x199028[_0xddbb('0x18')]){_0x574e2a=!![];}return sqlUtils[_0xddbb('0x19')](_0x2cedd7,_0x199028[_0xddbb('0xd')],_0x55754b,_0x43b3d2,_0x43eb6b[_0xddbb('0xf')],_0x574e2a);})[_0xddbb('0x7')](function(_0x1e90ad){if(!_0x1e90ad){return[];}return sqlUtils[_0xddbb('0x1a')](_0x1e90ad,_0x199028,_0x55754b);})['then'](function(_0x483c30){_0x43681e['rows']=_0x483c30;return _0x43681e;})[_0xddbb('0x1b')](function(_0x3ffab4){throw _0x3ffab4;});};exports[_0xddbb('0x1c')]=function(){var _0x544ca2={};var _0x4ed650=[];return db[_0xddbb('0x1d')][_0xddbb('0x1c')]()[_0xddbb('0x7')](function(_0x2734c7){_0x544ca2=_0x2734c7;var _0x1b0c20=Object['keys'](_0x544ca2)['filter'](function(_0x3cc1a4){return _[_0xddbb('0x1e')](_0x3cc1a4,_0xddbb('0x1f'))?_0x3cc1a4:undefined;});var _0x5beb0f=_0x1b0c20['map'](function(_0x114c3f){return db[_0xddbb('0x20')][_0xddbb('0x21')]({'where':{'id':_0x114c3f[_0xddbb('0x22')](0x3)},'raw':!![]});});return Promise[_0xddbb('0x23')](_0x5beb0f);})[_0xddbb('0x7')](function(_0x20b72a){for(var _0x2ecbb6=0x0;_0x2ecbb6<_0x20b72a[_0xddbb('0x24')];_0x2ecbb6++){if(_0x20b72a[_0x2ecbb6]){var _0x1a2989=_0xddbb('0x1f')+_0x20b72a[_0x2ecbb6]['id'];_0x544ca2[_0x1a2989][_0xddbb('0x25')]=_0x20b72a[_0x2ecbb6]['type'];}}_0x4ed650=_[_0xddbb('0x26')](Object[_0xddbb('0x27')](_0x544ca2),function(_0x299c6e){return{'name':_0x299c6e,'type':_0x544ca2[_0x299c6e][_0xddbb('0x28')]};});return _0x4ed650;})[_0xddbb('0x1b')](function(_0x544d83){throw _0x544d83;});};
\ No newline at end of file
+var _0x4111=['getContactsSubquery','parseAdvancedSearchFilter','search','parseQueryParameters','then','where','default','user','clause','tags','skip','checkListsRestrictions','tag','countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','catch','CmContact','describe','keys','filter','startsWith','cf_','map','CmCustomField','slice','all','length','fieldType','type','lodash','findAll','skipContactsQuery'];(function(_0x2d551d,_0x3c05d6){var _0x285b51=function(_0x5df841){while(--_0x5df841){_0x2d551d['push'](_0x2d551d['shift']());}};_0x285b51(++_0x3c05d6);}(_0x4111,0x1ad));var _0x1411=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1411('0x0'));var sqlUtils=require('./sql-utils');var db=require('../../mysqldb')['db'];exports[_0x1411('0x1')]=function(_0x1cbdc6,_0x4a6329,_0x1a34cb,_0xf12831){var _0xc64f22={'count':0x0,'rows':[]};var _0x59d350=sqlUtils[_0x1411('0x2')](_0x4a6329,_0x1cbdc6);if(_0x59d350){return Promise['resolve'](_0xc64f22);}var _0x2c9686=sqlUtils[_0x1411('0x3')]();var _0x1e9893={};var _0x3b12c0=![];var _0x22c8e1=![];return Promise['resolve']()['then'](function(){if(_0x1cbdc6['search']){return sqlUtils[_0x1411('0x4')](_0x1cbdc6[_0x1411('0x5')],_0xf12831);}else{return sqlUtils[_0x1411('0x6')](_0x1cbdc6,_0xf12831);}})[_0x1411('0x7')](function(_0xb2b0e0){_0x2c9686[_0x1411('0x8')](_0xb2b0e0[_0x1411('0x9')]);_0x2c9686['where'](_0xb2b0e0['fields']);_0x2c9686[_0x1411('0x8')](_0xb2b0e0['filter']);_0x2c9686['where'](_0xb2b0e0[_0x1411('0xa')][_0x1411('0xb')]);_0x1e9893=_0xb2b0e0[_0x1411('0xc')];_0x22c8e1=_0xb2b0e0[_0x1411('0xa')][_0x1411('0xd')];return sqlUtils[_0x1411('0xe')](_0x4a6329,_0x1cbdc6,_0x22c8e1);})[_0x1411('0x7')](function(_0x2c0fe2){_0x2c9686['where'](_0x2c0fe2);var _0x554d83=_0x1cbdc6[_0x1411('0x5')]?_0x1e9893['ids']:_0x1cbdc6[_0x1411('0xf')];_0x3b12c0=_0x554d83?!![]:![];return sqlUtils[_0x1411('0x10')](_0x2c9686,_0x554d83);})[_0x1411('0x7')](function(_0x84b000){_0xc64f22[_0x1411('0x11')]=_0x84b000;if(_0xc64f22[_0x1411('0x11')]===0x0){return;}if(_0x1cbdc6[_0x1411('0x12')]){_0x22c8e1=!![];}return sqlUtils[_0x1411('0x13')](_0x2c9686,_0x1cbdc6[_0x1411('0x14')],_0x1a34cb,_0x3b12c0,_0x1e9893[_0x1411('0xb')],_0x22c8e1);})[_0x1411('0x7')](function(_0x1702d6){if(!_0x1702d6){return[];}return sqlUtils[_0x1411('0x15')](_0x1702d6,_0x1cbdc6,_0x1a34cb);})['then'](function(_0x47b21f){_0xc64f22['rows']=_0x47b21f;return _0xc64f22;})[_0x1411('0x16')](function(_0x4d33b3){throw _0x4d33b3;});};exports['describe']=function(){var _0xfaf036={};var _0x520a74=[];return db[_0x1411('0x17')][_0x1411('0x18')]()[_0x1411('0x7')](function(_0x57a853){_0xfaf036=_0x57a853;var _0x41855b=Object[_0x1411('0x19')](_0xfaf036)[_0x1411('0x1a')](function(_0x4ed3a7){return _[_0x1411('0x1b')](_0x4ed3a7,_0x1411('0x1c'))?_0x4ed3a7:undefined;});var _0x534126=_0x41855b[_0x1411('0x1d')](function(_0x33c881){return db[_0x1411('0x1e')]['findOne']({'where':{'id':_0x33c881[_0x1411('0x1f')](0x3)},'raw':!![]});});return Promise[_0x1411('0x20')](_0x534126);})[_0x1411('0x7')](function(_0x46519){for(var _0x3b9b41=0x0;_0x3b9b41<_0x46519[_0x1411('0x21')];_0x3b9b41++){if(_0x46519[_0x3b9b41]){var _0x10f09d=_0x1411('0x1c')+_0x46519[_0x3b9b41]['id'];_0xfaf036[_0x10f09d][_0x1411('0x22')]=_0x46519[_0x3b9b41][_0x1411('0x23')];}}_0x520a74=_[_0x1411('0x1d')](Object[_0x1411('0x19')](_0xfaf036),function(_0x6d22c3){return{'name':_0x6d22c3,'type':_0xfaf036[_0x6d22c3][_0x1411('0x23')]};});return _0x520a74;})['catch'](function(_0x40d7eb){throw _0x40d7eb;});};
\ No newline at end of file
index f119221..41069bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb8=['User','user','clause','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','filter','role','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','DESC','Tag','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','query','exports','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','agent','search','autocomplete','true','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','ListId','CompanyId','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','text','value','start','map','tags','and','ids'];(function(_0x5da9e1,_0xc580f8){var _0x21a139=function(_0x35b0cd){while(--_0x35b0cd){_0x5da9e1['push'](_0x5da9e1['shift']());}};_0x21a139(++_0xc580f8);}(_0x1cb8,0x9b));var _0x81cb=function(_0x1ca247,_0xf65696){_0x1ca247=_0x1ca247-0x0;var _0x69a4d8=_0x1cb8[_0x1ca247];return _0x69a4d8;};'use strict';var _=require('lodash');var squel=require(_0x81cb('0x0'));var as=require(_0x81cb('0x1'));var qs=require(_0x81cb('0x2'));var utils=require('../interaction/utils');var db=require(_0x81cb('0x3'))['db'];function skipContactsQuery(_0x55f327,_0xd01fd3){var _0x551066=![];if(_0x55f327['role']===_0x81cb('0x4')&&!_0xd01fd3[_0x81cb('0x5')]&&!_0xd01fd3['ListId']&&_0xd01fd3[_0x81cb('0x6')]!==_0x81cb('0x7')){_0x551066=!![];}return _0x551066;}function getContactsSubquery(){return squel['select']()[_0x81cb('0x8')](_0x81cb('0x9'),'c')['where'](_0x81cb('0xa'));}function applyJoinClauses(_0x38f51f,_0x5e5d7c){var _0xcd3a4f=_0x5e5d7c?'c':_0x81cb('0xb');_0x38f51f[_0x81cb('0xc')](_0x81cb('0xd'),'uc',_0x81cb('0xe')+_0xcd3a4f+_0x81cb('0xf'))['left_join'](_0x81cb('0x10'),'ct',_0x81cb('0x11')+_0xcd3a4f+_0x81cb('0xf'))[_0x81cb('0xc')](_0x81cb('0x12'),'t',_0x81cb('0x13'));return _0x38f51f;}function addFieldsToQuery(_0x163341,_0x3c26a6,_0x544332,_0x30adbf,_0x40e591){var _0x43fe05=_0x40e591?'c':_0x81cb('0xb');if(!_0x3c26a6){_0x3c26a6=['id','firstName',_0x81cb('0x14'),_0x81cb('0x15'),_0x81cb('0x16'),_0x81cb('0x17'),_0x81cb('0x18'),_0x81cb('0x19'),_0x81cb('0x1a'),'createdAt',_0x81cb('0x1b'),_0x81cb('0x1c'),_0x81cb('0x1d')];}else if(!_0x3c26a6[_0x81cb('0x1e')]('id')){_0x3c26a6[_0x81cb('0x1f')]('id');}var _0x1e26e4=_0x544332&&_0x40e591||!_0x544332&&!_0x40e591;if(_0x30adbf){_0x1e26e4=_0x30adbf&&_0x40e591||!_0x30adbf&&!_0x40e591;}_0x3c26a6[_0x81cb('0x20')](function(_0xfa3d36){if(_0xfa3d36===_0x81cb('0x1d')){if(_0x1e26e4){_0x163341[_0x81cb('0x21')](_0x81cb('0x22'),_0xfa3d36);}else if(_0x544332||_0x30adbf){_0x163341[_0x81cb('0x21')](_0x43fe05+'.'+_0xfa3d36);}}else{_0x163341[_0x81cb('0x21')](_0x43fe05+'.'+_0xfa3d36);}});return _0x163341;}function getSqlClauses(){var _0x583fbc={'default':squel[_0x81cb('0x23')](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0x81cb('0x23')](),'ids':null},'user':{'clause':squel[_0x81cb('0x23')](),'skip':![]}};return _0x583fbc;}function parseTagParameter(_0x214d26){var _0x1f7085=squel[_0x81cb('0x23')]();if(_0x214d26){var _0xeffc22=utils[_0x81cb('0x24')](_0x214d26);_0xeffc22[_0x81cb('0x20')](function(_0x39fe06){_0x1f7085['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x39fe06+',%');});}return _0x1f7085;}function parseSearchFilter(_0x162f19){var _0x46866b=squel[_0x81cb('0x23')]();if(_0x162f19){var _0x26520f=_0x162f19[_0x81cb('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x26520f[_0x81cb('0x26')]('\x20')[_0x81cb('0x27')]>0x1){_0x46866b['or'](_0x81cb('0x28'),qs['getFullTextValue'](_0x26520f,!![]),null);}else{if(qs[_0x81cb('0x29')](_0x26520f)){_0x46866b['or'](_0x81cb('0x2a'),_0x26520f+'%');_0x46866b['or'](_0x81cb('0x2b'),_0x26520f+'%');_0x46866b['or']('c.mobile\x20LIKE\x20?',_0x26520f+'%');_0x46866b['or'](_0x81cb('0x2c'),_0x26520f+'%');}else if(qs['isEmail'](_0x26520f)){_0x46866b['or'](_0x81cb('0x2d'),_0x26520f+'%');}else{_0x46866b['or'](_0x81cb('0x2e'),'%'+_0x26520f+'%');_0x46866b['or'](_0x81cb('0x2f'),'%'+_0x26520f+'%');_0x46866b['or'](_0x81cb('0x2d'),'%'+_0x26520f+'%');}}}return _0x46866b;}function parseAdvancedSearchFilter(_0x3bf511,_0x453ce2){var _0x4cd997=getSqlClauses();var _0x5317de=as[_0x81cb('0x30')](_0x3bf511);var _0x1a3db7=_0x5317de[_0x81cb('0x31')];for(var _0x553bcd=0x0;_0x553bcd<_0x5317de[_0x81cb('0x32')][_0x81cb('0x27')];_0x553bcd++){var _0x2b12b5=_0x5317de[_0x81cb('0x32')][_0x553bcd];var _0x4ed3bc='c';var _0xcf8739=_[_0x81cb('0x33')](_0x453ce2,[_0x81cb('0x34'),_0x2b12b5['field']]);if(_0xcf8739){if(_0x2b12b5[_0x81cb('0x21')]===_0x81cb('0x35')||_0xcf8739[_0x81cb('0x36')]===_0x81cb('0x37')){_0x2b12b5[_0x81cb('0x38')]='DATE';}var _0x587633=as[_0x81cb('0x39')](_0x4ed3bc,_0xcf8739['type'],_0x2b12b5);_0x4cd997['default'][_0x1a3db7](_0x587633[_0x81cb('0x3a')],_0x587633[_0x81cb('0x3b')][_0x81cb('0x3c')],_0x587633['value']['end']);}else{if(_0x2b12b5[_0x81cb('0x21')]==='Tag'){var _0x48faae=_0x2b12b5[_0x81cb('0x3b')][_0x81cb('0x26')](',')[_0x81cb('0x3d')](function(_0x18e08e){return Number(_0x18e08e);});var _0x25e923=parseTagParameter(_0x48faae);_0x4cd997[_0x81cb('0x3e')]['clause'][_0x81cb('0x3f')](_0x25e923);_0x4cd997[_0x81cb('0x3e')][_0x81cb('0x40')]=_0x48faae;}else if(_0x2b12b5[_0x81cb('0x21')]===_0x81cb('0x41')){_0x4cd997[_0x81cb('0x42')][_0x81cb('0x43')][_0x81cb('0x3f')](_0x81cb('0x44'),_0x2b12b5[_0x81cb('0x3b')]);_0x4cd997['user'][_0x81cb('0x45')]=!![];}}}return _0x4cd997;}function parseModelFields(_0x1e181e,_0x24c6ce){var _0x5e26ab=squel[_0x81cb('0x23')]();var _0xd57514=_(_0x1e181e)[_0x81cb('0x46')]()[_0x81cb('0x3d')](function(_0x37317a){return _[_0x81cb('0x47')](_0x24c6ce,[_0x81cb('0x34'),_0x37317a])?_0x37317a:undefined;})[_0x81cb('0x48')]()[_0x81cb('0x3b')]();if(_0x1e181e[_0x81cb('0x49')]){_0xd57514[_0x81cb('0x1f')](_0x81cb('0x49'));}if(_0x1e181e[_0x81cb('0x41')]){_0xd57514[_0x81cb('0x1f')]('User');}if(_0xd57514[_0x81cb('0x27')]>0x0){_0xd57514[_0x81cb('0x20')](function(_0x64a544){if(_0x64a544===_0x81cb('0x19')){_0x5e26ab['and'](_0x81cb('0x4a'),[][_0x81cb('0x4b')](_0x1e181e[_0x64a544]));}else if(_0x64a544===_0x81cb('0x49')){var _0x2df290='%'+_0x1e181e[_0x64a544]+'%';_0x5e26ab[_0x81cb('0x3f')](_0x81cb('0x4c'),_0x2df290);}else if(_0x64a544==='User'){_0x5e26ab['and'](_0x81cb('0x44'),_0x1e181e[_0x64a544]);}else{_0x5e26ab[_0x81cb('0x3f')]('c.'+_0x64a544+'\x20=\x20?',_0x1e181e[_0x64a544]);}});}return _0x5e26ab;}function parseQueryParameters(_0x15900d,_0x4c38d1){var _0xfa1ed4=getSqlClauses();return Promise[_0x81cb('0x4d')]()[_0x81cb('0x4e')](function(){return parseModelFields(_0x15900d,_0x4c38d1);})[_0x81cb('0x4e')](function(_0x1d1528){_0xfa1ed4[_0x81cb('0x4f')][_0x81cb('0x3f')](_0x1d1528);return parseTagParameter(_0x15900d['tag']);})[_0x81cb('0x4e')](function(_0x191024){_0xfa1ed4[_0x81cb('0x3e')]['clause'][_0x81cb('0x3f')](_0x191024);return parseSearchFilter(_0x15900d['filter']);})[_0x81cb('0x4e')](function(_0x5373de){_0xfa1ed4[_0x81cb('0x50')]=_0x5373de;return _0xfa1ed4;});}function checkListsRestrictions(_0x2e16d9,_0x3aa235,_0x16d8b6){var _0x162583=squel[_0x81cb('0x23')]();return Promise['resolve']()['then'](function(){if(_0x3aa235[_0x81cb('0x5')]&&_0x2e16d9[_0x81cb('0x51')]===_0x81cb('0x4')&&!_0x16d8b6){return _0x2e16d9[_0x81cb('0x52')]({'attributes':['id'],'raw':!![]});}})[_0x81cb('0x4e')](function(_0x2463c0){if(_0x2463c0){if(_0x2463c0[_0x81cb('0x27')]===0x0){_0x162583['and'](_0x81cb('0x53'));}else{_0x162583[_0x81cb('0x3f')]('c.ListId\x20IN\x20?',_['map'](_0x2463c0,'id'));}}})[_0x81cb('0x4e')](function(){return _0x162583;});}function buildContactsQuery(_0x34f048,_0x5dc2f9,_0x56892e,_0x531b99,_0x41e8c6,_0xfc2305){if(_0x5dc2f9){_0x5dc2f9=_0x56892e[_0x81cb('0x54')];}_0x34f048=addFieldsToQuery(_0x34f048,_0x5dc2f9,_0x531b99,_0xfc2305,!![]);var _0xccd740=squel['select']();_0xccd740=addFieldsToQuery(_0xccd740,_0x5dc2f9,_0x531b99,_0xfc2305,![]);if(_0x531b99||_0xfc2305){_0x34f048=applyJoinClauses(_0x34f048,!![]);_0x34f048[_0x81cb('0x55')](_0x81cb('0x56'));if(_0x56892e[_0x81cb('0x57')]){_0xccd740[_0x81cb('0x57')](_0x56892e[_0x81cb('0x57')]);}if(_0x56892e[_0x81cb('0x58')]){_0xccd740[_0x81cb('0x58')](_0x56892e[_0x81cb('0x58')]);}}else{_0xccd740=applyJoinClauses(_0xccd740,![]);_0xccd740['group'](_0x81cb('0x59'));if(_0x56892e[_0x81cb('0x57')]){_0x34f048['limit'](_0x56892e[_0x81cb('0x57')]);}if(_0x56892e[_0x81cb('0x58')]){_0x34f048['offset'](_0x56892e['offset']);}}_0xccd740['having'](_0x41e8c6);if(_0x56892e[_0x81cb('0x5a')]){_0x56892e[_0x81cb('0x5a')][_0x81cb('0x20')](function(_0x316d25){_0x34f048['order']('c.'+_0x316d25[0x0],_0x316d25[0x1]===_0x81cb('0x5b')?![]:!![]);_0xccd740[_0x81cb('0x5a')]('subqry.'+_0x316d25[0x0],_0x316d25[0x1]===_0x81cb('0x5b')?![]:!![]);});}_0xccd740[_0x81cb('0x8')](_0x34f048,_0x81cb('0xb'));return _0xccd740;}function getFilteredContacts(_0x29b13c){var _0x5c9eb9=[];return db[_0x81cb('0x5c')][_0x81cb('0x5d')]({'attributes':['id','name',_0x81cb('0x5e')],'raw':!![]})[_0x81cb('0x4e')](function(_0x5c3b3a){_0x5c9eb9=_[_0x81cb('0x5f')](_0x5c3b3a,'id');var _0x262412={'type':db[_0x81cb('0x60')][_0x81cb('0x61')][_0x81cb('0x62')],'model':db[_0x81cb('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x81cb('0x64')]['query'](_0x29b13c[_0x81cb('0x65')](),_0x262412);})['then'](function(_0x19b314){_0x19b314[_0x81cb('0x20')](function(_0xc89bd2){if(_0xc89bd2[_0x81cb('0x1d')]){_0xc89bd2[_0x81cb('0x66')]=[];_0xc89bd2[_0x81cb('0x1d')]['split'](',')['forEach'](function(_0x17b601){_0xc89bd2[_0x81cb('0x66')][_0x81cb('0x1f')](_0x5c9eb9[_0x17b601]);});}delete _0xc89bd2['TagIds'];});return _0x19b314;});}function countFilteredContacts(_0x41a1d7,_0x1679b6){var _0x52e039=_0x41a1d7[_0x81cb('0x67')]();_0x52e039[_0x81cb('0x21')](_0x81cb('0x68'));_0x52e039=applyJoinClauses(_0x52e039,!![]);_0x41a1d7['group']('c.id');var _0x19857b=utils[_0x81cb('0x24')](_0x1679b6);if(!_[_0x81cb('0x69')](_0x19857b)){_0x52e039[_0x81cb('0x6a')](_0x81cb('0x6b'),_0x19857b);}var _0x3fcbee={'type':db[_0x81cb('0x60')][_0x81cb('0x61')]['SELECT'],'raw':!![]};return db[_0x81cb('0x64')][_0x81cb('0x6c')](_0x52e039['toString'](),_0x3fcbee)['then'](function(_0x366b84){return _0x366b84[0x0]['COUNT(*)'];});}module[_0x81cb('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
+var _0x7122=['../parsers/qs','../../mysqldb','agent','search','ListId','autocomplete','select','from','cm_contacts','where','subqry','uc.CmContactId\x20=\x20','.id','left_join','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','fax','email','CompanyId','createdAt','updatedAt','includes','push','forEach','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','find','name','fieldType','datetime','castTo','buildExpression','type','default','text','value','start','end','Tag','tags','clause','ids','User','user','and','uc.UserId\x20=\x20?','skip','keys','map','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','c.ListId\x20IS\x20NULL','attributes','group','c.id','offset','limit','order','DESC','subqry.','findAll','color','keyBy','Sequelize','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','QueryTypes','SELECT','exports','lodash','squel','../parsers/advancedSearch'];(function(_0x7d139f,_0x59d7d6){var _0x91d4ed=function(_0x577d89){while(--_0x577d89){_0x7d139f['push'](_0x7d139f['shift']());}};_0x91d4ed(++_0x59d7d6);}(_0x7122,0x13b));var _0x2712=function(_0x49249c,_0x46f2f6){_0x49249c=_0x49249c-0x0;var _0x3bc582=_0x7122[_0x49249c];return _0x3bc582;};'use strict';var _=require(_0x2712('0x0'));var squel=require(_0x2712('0x1'));var as=require(_0x2712('0x2'));var qs=require(_0x2712('0x3'));var utils=require('../interaction/utils');var db=require(_0x2712('0x4'))['db'];function skipContactsQuery(_0x406391,_0x30b292){var _0xcb6e65=![];if(_0x406391['role']===_0x2712('0x5')&&!_0x30b292[_0x2712('0x6')]&&!_0x30b292[_0x2712('0x7')]&&_0x30b292[_0x2712('0x8')]!=='true'){_0xcb6e65=!![];}return _0xcb6e65;}function getContactsSubquery(){return squel[_0x2712('0x9')]()[_0x2712('0xa')](_0x2712('0xb'),'c')[_0x2712('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x543106,_0x4383a7){var _0x550365=_0x4383a7?'c':_0x2712('0xd');_0x543106['left_join']('cm_user_has_contacts','uc',_0x2712('0xe')+_0x550365+_0x2712('0xf'))[_0x2712('0x10')]('cm_contact_has_tags','ct',_0x2712('0x11')+_0x550365+_0x2712('0xf'))[_0x2712('0x10')]('tools_tags','t',_0x2712('0x12'));return _0x543106;}function addFieldsToQuery(_0x43cb9d,_0x135162,_0x4dc76a,_0x383703,_0x1062a6){var _0x392220=_0x1062a6?'c':_0x2712('0xd');if(!_0x135162){_0x135162=['id',_0x2712('0x13'),_0x2712('0x14'),'phone','mobile',_0x2712('0x15'),_0x2712('0x16'),_0x2712('0x7'),_0x2712('0x17'),_0x2712('0x18'),_0x2712('0x19'),'deletedAt','TagIds'];}else if(!_0x135162[_0x2712('0x1a')]('id')){_0x135162[_0x2712('0x1b')]('id');}var _0x5d0d25=_0x4dc76a&&_0x1062a6||!_0x4dc76a&&!_0x1062a6;if(_0x383703){_0x5d0d25=_0x383703&&_0x1062a6||!_0x383703&&!_0x1062a6;}_0x135162[_0x2712('0x1c')](function(_0x591fcc){if(_0x591fcc===_0x2712('0x1d')){if(_0x5d0d25){_0x43cb9d['field'](_0x2712('0x1e'),_0x591fcc);}else if(_0x4dc76a||_0x383703){_0x43cb9d['field'](_0x392220+'.'+_0x591fcc);}}else{_0x43cb9d[_0x2712('0x1f')](_0x392220+'.'+_0x591fcc);}});return _0x43cb9d;}function getSqlClauses(){var _0x38a3dd={'default':squel[_0x2712('0x20')](),'fields':squel[_0x2712('0x20')](),'filter':squel[_0x2712('0x20')](),'tags':{'clause':squel[_0x2712('0x20')](),'ids':null},'user':{'clause':squel[_0x2712('0x20')](),'skip':![]}};return _0x38a3dd;}function parseTagParameter(_0x11df8b){var _0xcb4230=squel[_0x2712('0x20')]();if(_0x11df8b){var _0x5ca180=utils[_0x2712('0x21')](_0x11df8b);_0x5ca180[_0x2712('0x1c')](function(_0x4bd660){_0xcb4230['or'](_0x2712('0x22'),'%,'+_0x4bd660+',%');});}return _0xcb4230;}function parseSearchFilter(_0x6f17af){var _0x5e87bc=squel[_0x2712('0x20')]();if(_0x6f17af){var _0x1ce9a7=_0x6f17af[_0x2712('0x23')]('\x5c','\x5c\x5c')[_0x2712('0x23')](/'/g,'\x27\x27');if(_0x1ce9a7[_0x2712('0x24')]('\x20')[_0x2712('0x25')]>0x1){_0x5e87bc['or'](_0x2712('0x26'),qs[_0x2712('0x27')](_0x1ce9a7,!![]),null);}else{if(qs[_0x2712('0x28')](_0x1ce9a7)){_0x5e87bc['or'](_0x2712('0x29'),_0x1ce9a7+'%');_0x5e87bc['or'](_0x2712('0x2a'),_0x1ce9a7+'%');_0x5e87bc['or'](_0x2712('0x2b'),_0x1ce9a7+'%');_0x5e87bc['or'](_0x2712('0x2c'),_0x1ce9a7+'%');}else if(qs[_0x2712('0x2d')](_0x1ce9a7)){_0x5e87bc['or'](_0x2712('0x2e'),_0x1ce9a7+'%');}else{_0x5e87bc['or']('c.firstName\x20LIKE\x20?','%'+_0x1ce9a7+'%');_0x5e87bc['or']('c.lastName\x20LIKE\x20?','%'+_0x1ce9a7+'%');_0x5e87bc['or'](_0x2712('0x2e'),'%'+_0x1ce9a7+'%');}}}return _0x5e87bc;}function parseAdvancedSearchFilter(_0x149ae7,_0x128011){var _0x269c5d=getSqlClauses();var _0x20d8c8=as[_0x2712('0x2f')](_0x149ae7);var _0x24e22a=_0x20d8c8['sqlOperator'];for(var _0x2b4af9=0x0;_0x2b4af9<_0x20d8c8[_0x2712('0x30')][_0x2712('0x25')];_0x2b4af9++){var _0x340159=_0x20d8c8[_0x2712('0x30')][_0x2b4af9];var _0x592752='c';var _0xef1272=_[_0x2712('0x31')](_0x128011,[_0x2712('0x32'),_0x340159[_0x2712('0x1f')]]);if(_0xef1272){if(_0x340159['field']==='dateOfBirth'||_0xef1272[_0x2712('0x33')]===_0x2712('0x34')){_0x340159[_0x2712('0x35')]='DATE';}var _0x165f80=as[_0x2712('0x36')](_0x592752,_0xef1272[_0x2712('0x37')],_0x340159);_0x269c5d[_0x2712('0x38')][_0x24e22a](_0x165f80[_0x2712('0x39')],_0x165f80[_0x2712('0x3a')][_0x2712('0x3b')],_0x165f80[_0x2712('0x3a')][_0x2712('0x3c')]);}else{if(_0x340159[_0x2712('0x1f')]===_0x2712('0x3d')){var _0x5cad64=_0x340159['value'][_0x2712('0x24')](',')['map'](function(_0xc69618){return Number(_0xc69618);});var _0x5e8249=parseTagParameter(_0x5cad64);_0x269c5d[_0x2712('0x3e')][_0x2712('0x3f')]['and'](_0x5e8249);_0x269c5d[_0x2712('0x3e')][_0x2712('0x40')]=_0x5cad64;}else if(_0x340159['field']===_0x2712('0x41')){_0x269c5d[_0x2712('0x42')]['clause'][_0x2712('0x43')](_0x2712('0x44'),_0x340159[_0x2712('0x3a')]);_0x269c5d[_0x2712('0x42')][_0x2712('0x45')]=!![];}}}return _0x269c5d;}function parseModelFields(_0x1c2af2,_0x458028){var _0x2f5907=squel[_0x2712('0x20')]();var _0x53dea6=_(_0x1c2af2)[_0x2712('0x46')]()[_0x2712('0x47')](function(_0x4afea9){return _['some'](_0x458028,['name',_0x4afea9])?_0x4afea9:undefined;})[_0x2712('0x48')]()[_0x2712('0x3a')]();if(_0x1c2af2[_0x2712('0x49')]){_0x53dea6[_0x2712('0x1b')](_0x2712('0x49'));}if(_0x1c2af2[_0x2712('0x41')]){_0x53dea6['push'](_0x2712('0x41'));}if(_0x53dea6[_0x2712('0x25')]>0x0){_0x53dea6[_0x2712('0x1c')](function(_0x2dc621){if(_0x2dc621==='ListId'){_0x2f5907[_0x2712('0x43')](_0x2712('0x4a'),[][_0x2712('0x4b')](_0x1c2af2[_0x2dc621]));}else if(_0x2dc621===_0x2712('0x49')){var _0x1dc006='%'+_0x1c2af2[_0x2dc621]+'%';_0x2f5907[_0x2712('0x43')](_0x2712('0x4c'),_0x1dc006);}else if(_0x2dc621==='User'){_0x2f5907['and']('uc.UserId\x20=\x20?',_0x1c2af2[_0x2dc621]);}else{_0x2f5907[_0x2712('0x43')]('c.'+_0x2dc621+_0x2712('0x4d'),_0x1c2af2[_0x2dc621]);}});}return _0x2f5907;}function parseQueryParameters(_0x3437a4,_0x5b2d05){var _0x47fbab=getSqlClauses();return Promise[_0x2712('0x4e')]()[_0x2712('0x4f')](function(){return parseModelFields(_0x3437a4,_0x5b2d05);})[_0x2712('0x4f')](function(_0x6243e){_0x47fbab['fields'][_0x2712('0x43')](_0x6243e);return parseTagParameter(_0x3437a4[_0x2712('0x50')]);})[_0x2712('0x4f')](function(_0x3fc916){_0x47fbab[_0x2712('0x3e')][_0x2712('0x3f')][_0x2712('0x43')](_0x3fc916);return parseSearchFilter(_0x3437a4['filter']);})['then'](function(_0x1f2fc4){_0x47fbab[_0x2712('0x51')]=_0x1f2fc4;return _0x47fbab;});}function checkListsRestrictions(_0x2b3ab6,_0x1c40fa,_0x4893f5){var _0x522790=squel['expr']();return Promise[_0x2712('0x4e')]()[_0x2712('0x4f')](function(){if(_0x1c40fa[_0x2712('0x6')]&&_0x2b3ab6['role']===_0x2712('0x5')&&!_0x4893f5){return _0x2b3ab6['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x5ec64c){if(_0x5ec64c){if(_0x5ec64c[_0x2712('0x25')]===0x0){_0x522790[_0x2712('0x43')](_0x2712('0x52'));}else{_0x522790[_0x2712('0x43')]('c.ListId\x20IN\x20?',_[_0x2712('0x47')](_0x5ec64c,'id'));}}})[_0x2712('0x4f')](function(){return _0x522790;});}function buildContactsQuery(_0x52aec6,_0x5e5d5c,_0x49f0d8,_0x556be4,_0x8e5f7,_0x519567){if(_0x5e5d5c){_0x5e5d5c=_0x49f0d8[_0x2712('0x53')];}_0x52aec6=addFieldsToQuery(_0x52aec6,_0x5e5d5c,_0x556be4,_0x519567,!![]);var _0xa3ac1b=squel[_0x2712('0x9')]();_0xa3ac1b=addFieldsToQuery(_0xa3ac1b,_0x5e5d5c,_0x556be4,_0x519567,![]);if(_0x556be4||_0x519567){_0x52aec6=applyJoinClauses(_0x52aec6,!![]);_0x52aec6[_0x2712('0x54')](_0x2712('0x55'));if(_0x49f0d8['limit']){_0xa3ac1b['limit'](_0x49f0d8['limit']);}if(_0x49f0d8[_0x2712('0x56')]){_0xa3ac1b['offset'](_0x49f0d8['offset']);}}else{_0xa3ac1b=applyJoinClauses(_0xa3ac1b,![]);_0xa3ac1b['group']('subqry.id');if(_0x49f0d8[_0x2712('0x57')]){_0x52aec6['limit'](_0x49f0d8[_0x2712('0x57')]);}if(_0x49f0d8[_0x2712('0x56')]){_0x52aec6[_0x2712('0x56')](_0x49f0d8[_0x2712('0x56')]);}}_0xa3ac1b['having'](_0x8e5f7);if(_0x49f0d8[_0x2712('0x58')]){_0x49f0d8['order'][_0x2712('0x1c')](function(_0x2e9a4a){_0x52aec6[_0x2712('0x58')]('c.'+_0x2e9a4a[0x0],_0x2e9a4a[0x1]===_0x2712('0x59')?![]:!![]);_0xa3ac1b[_0x2712('0x58')](_0x2712('0x5a')+_0x2e9a4a[0x0],_0x2e9a4a[0x1]==='DESC'?![]:!![]);});}_0xa3ac1b['from'](_0x52aec6,'subqry');return _0xa3ac1b;}function getFilteredContacts(_0x546bb2){var _0x4f5aa1=[];return db['Tag'][_0x2712('0x5b')]({'attributes':['id',_0x2712('0x32'),_0x2712('0x5c')],'raw':!![]})[_0x2712('0x4f')](function(_0x5a3496){_0x4f5aa1=_[_0x2712('0x5d')](_0x5a3496,'id');var _0x1bc764={'type':db[_0x2712('0x5e')]['QueryTypes']['SELECT'],'model':db[_0x2712('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x2712('0x60')][_0x2712('0x61')](_0x546bb2[_0x2712('0x62')](),_0x1bc764);})[_0x2712('0x4f')](function(_0x2d0efa){_0x2d0efa[_0x2712('0x1c')](function(_0x521a9a){if(_0x521a9a[_0x2712('0x1d')]){_0x521a9a[_0x2712('0x63')]=[];_0x521a9a[_0x2712('0x1d')][_0x2712('0x24')](',')['forEach'](function(_0x4d0b1a){_0x521a9a[_0x2712('0x63')][_0x2712('0x1b')](_0x4f5aa1[_0x4d0b1a]);});}delete _0x521a9a['TagIds'];});return _0x2d0efa;});}function countFilteredContacts(_0x146f42,_0x5b3376){var _0x49d955=_0x146f42[_0x2712('0x64')]();_0x49d955['field'](_0x2712('0x65'));_0x49d955=applyJoinClauses(_0x49d955,!![]);_0x146f42[_0x2712('0x54')](_0x2712('0x55'));var _0x4b8fdd=utils[_0x2712('0x21')](_0x5b3376);if(!_[_0x2712('0x66')](_0x4b8fdd)){_0x49d955['where']('t.id\x20IN\x20?',_0x4b8fdd);}var _0x3d1dce={'type':db[_0x2712('0x5e')][_0x2712('0x67')][_0x2712('0x68')],'raw':!![]};return db[_0x2712('0x60')]['query'](_0x49d955['toString'](),_0x3d1dce)[_0x2712('0x4f')](function(_0x174fbe){return _0x174fbe[0x0][_0x2712('0x65')];});}module[_0x2712('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
index 8b74a0a..bfebed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4625=['filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','write','end','final','binary','unlink','decryptFile','createDecipher','update','close','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x4625,0x10b));var _0x5462=function(_0x31ba88,_0x1d0eab){_0x31ba88=_0x31ba88-0x0;var _0x196cc9=_0x4625[_0x31ba88];return _0x196cc9;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x5462('0x0'));var _=require(_0x5462('0x1'));var config=require('../../config/environment');var logger=require(_0x5462('0x2'))(_0x5462('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5462('0x4')][_0x5462('0x5')],'algorithm':_0x5462('0x6')};const fileOptions={'algorithm':_0x5462('0x7')};if(config[_0x5462('0x8')]&&config[_0x5462('0x8')][_0x5462('0x9')]){var isSupported=isAlgorithmSupported(config[_0x5462('0x8')][_0x5462('0x9')]);if(isSupported){fileOptions[_0x5462('0x9')]=config['encrypt'][_0x5462('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5462('0xa')](',\x20');logger['error'](config[_0x5462('0x8')][_0x5462('0x9')],_0x5462('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5d8434){return AES_SUPPORTED_RX[_0x5462('0xc')](_0x5d8434);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x5462('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x490232){return getSupportedCiphers()[_0x5462('0xe')](_0x490232)>-0x1;}function combineOptions(_0x44fa58){var _0x4501f2={};for(var _0x56b225 in fileOptions){if(fileOptions[_0x5462('0xf')](_0x56b225)){_0x4501f2[_0x56b225]=fileOptions[_0x56b225];}}if(_0x44fa58){for(var _0xd8cdb8 in _0x44fa58){if(_0x44fa58[_0x5462('0xf')](_0xd8cdb8)){_0x4501f2[_0xd8cdb8]=_0x44fa58[_0xd8cdb8];}}}return _0x4501f2;}exports[_0x5462('0x10')]=function(_0x125bac,_0x309e06,_0x1e2254,_0x4cd618){return new BPromise(function(_0x4836b1,_0x160c70){_0x4cd618=combineOptions(_0x4cd618);var _0xa8443f=new Buffer(_0x1e2254);var _0x43c1a2=fs[_0x5462('0x11')](_0x125bac);var _0x375600=fs[_0x5462('0x12')](_0x309e06);var _0x36334e=crypto[_0x5462('0x13')](_0x4cd618[_0x5462('0x9')],_0xa8443f);_0x43c1a2['on'](_0x5462('0x14'),function(_0x48c90e){var _0x3834fc=new Buffer(_0x36334e['update'](_0x48c90e),'binary');_0x375600[_0x5462('0x15')](_0x3834fc);});_0x43c1a2['on'](_0x5462('0x16'),function(){try{var _0x38e32a=new Buffer(_0x36334e[_0x5462('0x17')](_0x5462('0x18')),_0x5462('0x18'));_0x375600[_0x5462('0x15')](_0x38e32a);_0x375600[_0x5462('0x16')]();_0x375600['on']('close',function(){return _0x4836b1(_0x309e06);});}catch(_0x3cff91){fs[_0x5462('0x19')](_0x309e06);return _0x160c70(_0x3cff91);}});});};exports[_0x5462('0x1a')]=function(_0x1ea88d,_0x53c76b,_0x3efcdd,_0x1d24af){return new BPromise(function(_0x300d03,_0x1bc1b2){_0x1d24af=combineOptions(_0x1d24af);var _0xb7e621=new Buffer(_0x3efcdd);var _0x18035d=fs['createReadStream'](_0x1ea88d);var _0x4a111a=fs['createWriteStream'](_0x53c76b);var _0x1d6c6f=crypto[_0x5462('0x1b')](_0x1d24af[_0x5462('0x9')],_0xb7e621);_0x18035d['on'](_0x5462('0x14'),function(_0x495324){var _0x358607=new Buffer(_0x1d6c6f[_0x5462('0x1c')](_0x495324),_0x5462('0x18'));_0x4a111a[_0x5462('0x15')](_0x358607);});_0x18035d['on'](_0x5462('0x16'),function(){try{var _0x19152c=new Buffer(_0x1d6c6f['final'](_0x5462('0x18')),_0x5462('0x18'));_0x4a111a[_0x5462('0x15')](_0x19152c);_0x4a111a[_0x5462('0x16')]();_0x4a111a['on'](_0x5462('0x1d'),function(){return _0x300d03(_0x53c76b);});}catch(_0x3552d5){fs[_0x5462('0x19')](_0x53c76b);return _0x1bc1b2(_0x3552d5);}});});};exports[_0x5462('0x1e')]=function(_0x13c153,_0x304597,_0x502514){var _0x1ae27a=_0x502514||stringOptions[_0x5462('0x9')];var _0x3bca7c=_0x304597||stringOptions[_0x5462('0x1f')];var _0x40f18f=crypto[_0x5462('0x13')](_0x1ae27a,_0x3bca7c);var _0x5c42f9=_0x40f18f[_0x5462('0x1c')](_0x13c153,_0x5462('0x20'),'base64');_0x5c42f9+=_0x40f18f[_0x5462('0x17')](_0x5462('0x21'));return _0x5c42f9;};exports[_0x5462('0x22')]=function(_0x60fcff,_0x2a16f3,_0x4d2b56){var _0x3d9a52=_0x4d2b56||stringOptions[_0x5462('0x9')];var _0x5b0d2b=_0x2a16f3||stringOptions[_0x5462('0x1f')];var _0x4e2b62=crypto['createDecipher'](_0x3d9a52,_0x5b0d2b);var _0x5abd46=_0x4e2b62['update'](_0x60fcff,_0x5462('0x21'),_0x5462('0x20'));_0x5abd46+=_0x4e2b62[_0x5462('0x17')](_0x5462('0x20'));return _0x5abd46;};
\ No newline at end of file
+var _0x0e35=['write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','update','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','encrypt','algorithm','error','test','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','binary'];(function(_0x410130,_0x203598){var _0x5b2c66=function(_0xddb769){while(--_0xddb769){_0x410130['push'](_0x410130['shift']());}};_0x5b2c66(++_0x203598);}(_0x0e35,0x157));var _0x50e3=function(_0x3e730c,_0x1c8c84){_0x3e730c=_0x3e730c-0x0;var _0x5dccdf=_0x0e35[_0x3e730c];return _0x5dccdf;};'use strict';var crypto=require(_0x50e3('0x0'));var fs=require('fs');var BPromise=require(_0x50e3('0x1'));var _=require(_0x50e3('0x2'));var config=require(_0x50e3('0x3'));var logger=require(_0x50e3('0x4'))(_0x50e3('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x50e3('0x6')],'algorithm':_0x50e3('0x7')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x50e3('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x50e3('0x8')][_0x50e3('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x50e3('0x8')][_0x50e3('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x50e3('0xa')](config[_0x50e3('0x8')][_0x50e3('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x1bfde7){return AES_SUPPORTED_RX[_0x50e3('0xb')](_0x1bfde7);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x50e3('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x495ab0){return getSupportedCiphers()[_0x50e3('0xd')](_0x495ab0)>-0x1;}function combineOptions(_0x46c4f6){var _0x27038f={};for(var _0x1638cd in fileOptions){if(fileOptions[_0x50e3('0xe')](_0x1638cd)){_0x27038f[_0x1638cd]=fileOptions[_0x1638cd];}}if(_0x46c4f6){for(var _0x3c454e in _0x46c4f6){if(_0x46c4f6['hasOwnProperty'](_0x3c454e)){_0x27038f[_0x3c454e]=_0x46c4f6[_0x3c454e];}}}return _0x27038f;}exports['encryptFile']=function(_0x2c2a47,_0x2724e2,_0x1dc129,_0x23ef4e){return new BPromise(function(_0x28020f,_0x2e9410){_0x23ef4e=combineOptions(_0x23ef4e);var _0x5b5b89=new Buffer(_0x1dc129);var _0x54ad59=fs[_0x50e3('0xf')](_0x2c2a47);var _0x4f1817=fs[_0x50e3('0x10')](_0x2724e2);var _0x200a38=crypto[_0x50e3('0x11')](_0x23ef4e[_0x50e3('0x9')],_0x5b5b89);_0x54ad59['on'](_0x50e3('0x12'),function(_0x3cda13){var _0x54f7d5=new Buffer(_0x200a38['update'](_0x3cda13),_0x50e3('0x13'));_0x4f1817[_0x50e3('0x14')](_0x54f7d5);});_0x54ad59['on'](_0x50e3('0x15'),function(){try{var _0x5317b3=new Buffer(_0x200a38[_0x50e3('0x16')](_0x50e3('0x13')),'binary');_0x4f1817['write'](_0x5317b3);_0x4f1817[_0x50e3('0x15')]();_0x4f1817['on'](_0x50e3('0x17'),function(){return _0x28020f(_0x2724e2);});}catch(_0x35a284){fs[_0x50e3('0x18')](_0x2724e2);return _0x2e9410(_0x35a284);}});});};exports[_0x50e3('0x19')]=function(_0x2a126f,_0x2481dd,_0x46d195,_0x3735e6){return new BPromise(function(_0x55e06a,_0x462ff2){_0x3735e6=combineOptions(_0x3735e6);var _0x2f1b2f=new Buffer(_0x46d195);var _0x1bfbcd=fs[_0x50e3('0xf')](_0x2a126f);var _0xf6aa65=fs['createWriteStream'](_0x2481dd);var _0x468745=crypto[_0x50e3('0x1a')](_0x3735e6[_0x50e3('0x9')],_0x2f1b2f);_0x1bfbcd['on'](_0x50e3('0x12'),function(_0x2b6e50){var _0x284e2b=new Buffer(_0x468745['update'](_0x2b6e50),'binary');_0xf6aa65[_0x50e3('0x14')](_0x284e2b);});_0x1bfbcd['on'](_0x50e3('0x15'),function(){try{var _0x5bc336=new Buffer(_0x468745[_0x50e3('0x16')]('binary'),_0x50e3('0x13'));_0xf6aa65[_0x50e3('0x14')](_0x5bc336);_0xf6aa65[_0x50e3('0x15')]();_0xf6aa65['on'](_0x50e3('0x17'),function(){return _0x55e06a(_0x2481dd);});}catch(_0x5aa5be){fs[_0x50e3('0x18')](_0x2481dd);return _0x462ff2(_0x5aa5be);}});});};exports[_0x50e3('0x1b')]=function(_0x2e89c3,_0x1d43b3,_0x4ccd04){var _0xb4ce28=_0x4ccd04||stringOptions[_0x50e3('0x9')];var _0x308ffc=_0x1d43b3||stringOptions[_0x50e3('0x1c')];var _0x5efc34=crypto[_0x50e3('0x11')](_0xb4ce28,_0x308ffc);var _0x2ef566=_0x5efc34[_0x50e3('0x1d')](_0x2e89c3,_0x50e3('0x1e'),_0x50e3('0x1f'));_0x2ef566+=_0x5efc34[_0x50e3('0x16')](_0x50e3('0x1f'));return _0x2ef566;};exports[_0x50e3('0x20')]=function(_0xe1faa6,_0x2b7925,_0x1003d0){var _0x7c028=_0x1003d0||stringOptions[_0x50e3('0x9')];var _0x351811=_0x2b7925||stringOptions['secret'];var _0x1ff049=crypto[_0x50e3('0x1a')](_0x7c028,_0x351811);var _0x37da5a=_0x1ff049[_0x50e3('0x1d')](_0xe1faa6,_0x50e3('0x1f'),_0x50e3('0x1e'));_0x37da5a+=_0x1ff049['final'](_0x50e3('0x1e'));return _0x37da5a;};
\ No newline at end of file
index 437c18f..90edfc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ced=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','%s.%s'];(function(_0xc87452,_0x3551e5){var _0x4eee65=function(_0xfa35ff){while(--_0xfa35ff){_0xc87452['push'](_0xc87452['shift']());}};_0x4eee65(++_0x3551e5);}(_0x8ced,0xd6));var _0xd8ce=function(_0x493c7a,_0x30ea93){_0x493c7a=_0x493c7a-0x0;var _0x1ad499=_0x8ced[_0x493c7a];return _0x1ad499;};'use strict';var util=require(_0xd8ce('0x0'));var path=require(_0xd8ce('0x1'));var _=require(_0xd8ce('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xd8ce('0x3'));var zipdir=require(_0xd8ce('0x4'));var rimraf=require(_0xd8ce('0x5'));var db=require(_0xd8ce('0x6'))['db'];var dbH=require(_0xd8ce('0x6'))['dbH'];var logger=require(_0xd8ce('0x7'))(_0xd8ce('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd8ce('0x9')][0x3];var PATH=process[_0xd8ce('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x48be6d,_0xda96ed){var _0x5ce93b={'status':_0x48be6d};var _0x4d4a4b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xda96ed){_0x5ce93b[_0xd8ce('0xa')]=_0xda96ed;}return db[_0xd8ce('0xb')]['update'](_0x5ce93b,_0x4d4a4b);}function main(){var _0x35b468=0x1388;var _0x372ed4;logger[_0xd8ce('0xc')](util[_0xd8ce('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd8ce('0xe')));return db[_0xd8ce('0xf')][_0xd8ce('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd8ce('0x11'),'splitSizeCsv']})[_0xd8ce('0x12')](function(_0x2bdcce){if(_0x2bdcce){_0x372ed4=_0x2bdcce;_0x35b468=_0x372ed4[_0xd8ce('0x13')]||0x1388;}})[_0xd8ce('0x12')](function(){return dbH[_0xd8ce('0x14')][_0xd8ce('0x15')](util['format'](_0xd8ce('0x16'),QUERY),{'type':dbH[_0xd8ce('0x14')][_0xd8ce('0x17')]['SELECT']});})['then'](function(_0x5eb48c){if(!_0x5eb48c[0x0]['num']){return analyticExtractedReport(_0xd8ce('0x18'));}var _0x50999d=[];var _0x598eba=0x0;if(_0x372ed4['split']){if(_0x5eb48c&&_0x5eb48c[_0xd8ce('0x19')]){var _0x4cacc8=_[_0xd8ce('0x1a')](_0x5eb48c[0x0][_0xd8ce('0x1b')]/_0x35b468);var _0x582191=Number[_0xd8ce('0x1c')](_0x5eb48c[0x0][_0xd8ce('0x1b')]/_0x35b468)?_0x5eb48c[0x0][_0xd8ce('0x1b')]%_0x35b468:0x0;_0x4cacc8[_0xd8ce('0x1d')](function(_0x44a113){if(_0x44a113>0x0){_0x598eba+=_0x35b468;}_0x50999d[_0xd8ce('0x1e')](dbH[_0xd8ce('0x14')][_0xd8ce('0x15')](util['format'](_0xd8ce('0x1f'),QUERY,_0x35b468,_0x598eba),{'type':dbH['sequelize'][_0xd8ce('0x17')]['SELECT']}));});if(_0x582191>0x0){_0x598eba+=_0x35b468;_0x50999d[_0xd8ce('0x1e')](dbH[_0xd8ce('0x14')][_0xd8ce('0x15')](util['format'](_0xd8ce('0x1f'),QUERY,_0x582191,_0x598eba),{'type':dbH[_0xd8ce('0x14')][_0xd8ce('0x17')][_0xd8ce('0x20')]}));}}}else{_0x50999d[_0xd8ce('0x1e')](dbH['sequelize'][_0xd8ce('0x15')](QUERY,{'type':dbH[_0xd8ce('0x14')][_0xd8ce('0x17')][_0xd8ce('0x20')]}));}var _0x8c37db=path[_0xd8ce('0x21')](PATH);var _0x37e97c=path['basename'](PATH,_0xd8ce('0x22'));var _0xde2243=_0x372ed4[_0xd8ce('0x11')]&&_0x50999d[_0xd8ce('0x19')]>0x1;var _0x41235a=[];if(!fs[_0xd8ce('0x23')](path[_0xd8ce('0x24')](_0x8c37db,_0x37e97c))&&_0xde2243){fs[_0xd8ce('0x25')](path['join'](_0x8c37db,_0x37e97c));}return BPromise[_0xd8ce('0x26')](_0x50999d,function(_0x17abe9){_0x41235a[_0xd8ce('0x1e')](_0x17abe9);})[_0xd8ce('0x12')](function(){for(var _0x48cab8=0x0;_0x48cab8<_0x41235a[_0xd8ce('0x19')];_0x48cab8+=0x1){var _0x482697;var _0xa10c0b=_0x41235a[_0x48cab8];if(_0xde2243){_0x482697=path[_0xd8ce('0x24')](_0x8c37db,_0x37e97c,util['format'](_0xd8ce('0x27'),_0x37e97c,_0x48cab8,_0xd8ce('0x28')));}else{_0x482697=path[_0xd8ce('0x24')](_0x8c37db,util[_0xd8ce('0xd')]('%s.%s',_0x37e97c,'csv'));}fs[_0xd8ce('0x29')](_0x482697,csv(_0xa10c0b));}})[_0xd8ce('0x12')](function(){if(_0xde2243){return new Promise(function(_0x2d96c2){zipdir(path['join'](_0x8c37db,_0x37e97c),{'saveTo':path[_0xd8ce('0x24')](_0x8c37db,util['format']('%s.%s',_0x37e97c,_0xd8ce('0x2a')))},function(_0x46c056,_0x12c5c5){rimraf(path[_0xd8ce('0x24')](_0x8c37db,_0x37e97c),function(){});_0x2d96c2(_0xd8ce('0x2b'));});});}})[_0xd8ce('0x12')](function(){logger[_0xd8ce('0xc')](util['format'](_0xd8ce('0x2c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0xde2243?util['format'](_0xd8ce('0x2d'),_0x37e97c,_0xde2243?_0xd8ce('0x2a'):_0xd8ce('0x28')):null);});})[_0xd8ce('0x2e')](function(_0x3f5fa0){logger['info'](util['format'](_0xd8ce('0x2f'),EXTRACTED_REPORT_ID,_0xd8ce('0xe')),util[_0xd8ce('0x30')](_0x3f5fa0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd8ce('0x31'));})[_0xd8ce('0x32')](function(){process[_0xd8ce('0x33')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xef31=['update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','split','range','num','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','push','QueryTypes','length','existsSync','mkdirSync','each','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport'];(function(_0x590114,_0x2ca735){var _0x149e50=function(_0x3275fc){while(--_0x3275fc){_0x590114['push'](_0x590114['shift']());}};_0x149e50(++_0x2ca735);}(_0xef31,0x124));var _0x1ef3=function(_0x48e55f,_0x40f53d){_0x48e55f=_0x48e55f-0x0;var _0x5b69d7=_0xef31[_0x48e55f];return _0x5b69d7;};'use strict';var util=require(_0x1ef3('0x0'));var path=require(_0x1ef3('0x1'));var _=require(_0x1ef3('0x2'));var csv=require(_0x1ef3('0x3'));var fs=require('fs');var BPromise=require(_0x1ef3('0x4'));var zipdir=require(_0x1ef3('0x5'));var rimraf=require(_0x1ef3('0x6'));var db=require(_0x1ef3('0x7'))['db'];var dbH=require('../../mysqldb')[_0x1ef3('0x8')];var logger=require(_0x1ef3('0x9'))(_0x1ef3('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x1ef3('0xb')][0x2]);var QUERY=process[_0x1ef3('0xb')][0x3];var PATH=process[_0x1ef3('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x318b82,_0x12c815){var _0x3e42a0={'status':_0x318b82};var _0x2858b5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12c815){_0x3e42a0[_0x1ef3('0xc')]=_0x12c815;}return db[_0x1ef3('0xd')][_0x1ef3('0xe')](_0x3e42a0,_0x2858b5);}function main(){var _0x3adc52=0x1388;var _0x4fd9b7;logger['info'](util['format'](_0x1ef3('0xf'),EXTRACTED_REPORT_ID,_0x1ef3('0x10')));return db[_0x1ef3('0x11')][_0x1ef3('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1ef3('0x13')]})[_0x1ef3('0x14')](function(_0xb7d557){if(_0xb7d557){_0x4fd9b7=_0xb7d557;_0x3adc52=_0x4fd9b7['splitSizeCsv']||0x1388;}})[_0x1ef3('0x14')](function(){return dbH['sequelize'][_0x1ef3('0x15')](util[_0x1ef3('0x16')](_0x1ef3('0x17'),QUERY),{'type':dbH[_0x1ef3('0x18')]['QueryTypes'][_0x1ef3('0x19')]});})[_0x1ef3('0x14')](function(_0x3651e4){if(!_0x3651e4[0x0]['num']){return analyticExtractedReport('Empty');}var _0x45182c=[];var _0x35c2df=0x0;if(_0x4fd9b7[_0x1ef3('0x1a')]){if(_0x3651e4&&_0x3651e4['length']){var _0x3dc87f=_[_0x1ef3('0x1b')](_0x3651e4[0x0][_0x1ef3('0x1c')]/_0x3adc52);var _0x3f6146=Number[_0x1ef3('0x1d')](_0x3651e4[0x0][_0x1ef3('0x1c')]/_0x3adc52)?_0x3651e4[0x0][_0x1ef3('0x1c')]%_0x3adc52:0x0;_0x3dc87f['forEach'](function(_0x5970d6){if(_0x5970d6>0x0){_0x35c2df+=_0x3adc52;}_0x45182c['push'](dbH['sequelize'][_0x1ef3('0x15')](util[_0x1ef3('0x16')](_0x1ef3('0x1e'),QUERY,_0x3adc52,_0x35c2df),{'type':dbH[_0x1ef3('0x18')]['QueryTypes'][_0x1ef3('0x19')]}));});if(_0x3f6146>0x0){_0x35c2df+=_0x3adc52;_0x45182c[_0x1ef3('0x1f')](dbH[_0x1ef3('0x18')][_0x1ef3('0x15')](util[_0x1ef3('0x16')](_0x1ef3('0x1e'),QUERY,_0x3f6146,_0x35c2df),{'type':dbH['sequelize'][_0x1ef3('0x20')][_0x1ef3('0x19')]}));}}}else{_0x45182c[_0x1ef3('0x1f')](dbH[_0x1ef3('0x18')]['query'](QUERY,{'type':dbH['sequelize'][_0x1ef3('0x20')][_0x1ef3('0x19')]}));}var _0x2325d0=path['dirname'](PATH);var _0x582ccc=path['basename'](PATH,'.csv');var _0x214d46=_0x4fd9b7[_0x1ef3('0x1a')]&&_0x45182c[_0x1ef3('0x21')]>0x1;var _0x553792=[];if(!fs[_0x1ef3('0x22')](path['join'](_0x2325d0,_0x582ccc))&&_0x214d46){fs[_0x1ef3('0x23')](path['join'](_0x2325d0,_0x582ccc));}return BPromise[_0x1ef3('0x24')](_0x45182c,function(_0x4f622e){_0x553792['push'](_0x4f622e);})[_0x1ef3('0x14')](function(){for(var _0x56486f=0x0;_0x56486f<_0x553792[_0x1ef3('0x21')];_0x56486f+=0x1){var _0x25644f;var _0x2a7d66=_0x553792[_0x56486f];if(_0x214d46){_0x25644f=path[_0x1ef3('0x25')](_0x2325d0,_0x582ccc,util[_0x1ef3('0x16')](_0x1ef3('0x26'),_0x582ccc,_0x56486f,_0x1ef3('0x27')));}else{_0x25644f=path[_0x1ef3('0x25')](_0x2325d0,util[_0x1ef3('0x16')](_0x1ef3('0x28'),_0x582ccc,'csv'));}fs[_0x1ef3('0x29')](_0x25644f,csv(_0x2a7d66));}})['then'](function(){if(_0x214d46){return new Promise(function(_0x56163d){zipdir(path['join'](_0x2325d0,_0x582ccc),{'saveTo':path[_0x1ef3('0x25')](_0x2325d0,util[_0x1ef3('0x16')](_0x1ef3('0x28'),_0x582ccc,_0x1ef3('0x2a')))},function(_0x12c5d8,_0x22e8ae){rimraf(path[_0x1ef3('0x25')](_0x2325d0,_0x582ccc),function(){});_0x56163d(_0x1ef3('0x2b'));});});}})['then'](function(){logger['info'](util['format'](_0x1ef3('0x2c'),EXTRACTED_REPORT_ID,_0x1ef3('0x10')));return analyticExtractedReport(_0x1ef3('0x2d'),_0x214d46?util[_0x1ef3('0x16')](_0x1ef3('0x28'),_0x582ccc,_0x214d46?_0x1ef3('0x2a'):'csv'):null);});})[_0x1ef3('0x2e')](function(_0x40557a){logger[_0x1ef3('0x2f')](util[_0x1ef3('0x16')](_0x1ef3('0x30'),EXTRACTED_REPORT_ID,'CSV'),util[_0x1ef3('0x31')](_0x40557a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1ef3('0x32')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index b8c87cb..981bda6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8a4=['createPdfKitDocument','path','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','value','fill','length','push','body','concat','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','pageBreak','before','margin','toString','footer','Arial','right','find','split','splitSizePdf','then','range','num','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','%s.%s','pdf','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','finally','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML'];(function(_0x4b5259,_0x44d6bb){var _0x1bdc28=function(_0x347ce2){while(--_0x347ce2){_0x4b5259['push'](_0x4b5259['shift']());}};_0x1bdc28(++_0x44d6bb);}(_0xf8a4,0x166));var _0x4f8a=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xf8a4[_0x489b87];return _0x1823b6;};'use strict';var _=require(_0x4f8a('0x0'));var fs=require('fs');var util=require(_0x4f8a('0x1'));var path=require('path');var moment=require(_0x4f8a('0x2'));var htmlToPdfmake=require(_0x4f8a('0x3'));var PdfPrinter=require(_0x4f8a('0x4'));var zipdir=require(_0x4f8a('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x4f8a('0x6'))['JSDOM'];var window=new JSDOM('')[_0x4f8a('0x7')];var BPromise=require(_0x4f8a('0x8'));var db=require(_0x4f8a('0x9'))['db'];var dbH=require(_0x4f8a('0x9'))[_0x4f8a('0xa')];var logger=require(_0x4f8a('0xb'))(_0x4f8a('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x4f8a('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x4f8a('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x4f8a('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3af5a2,_0x382fe8){var _0x5db60d={'status':_0x3af5a2};var _0x58644b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x382fe8){_0x5db60d[_0x4f8a('0xf')]=_0x382fe8;}return db['AnalyticExtractedReport'][_0x4f8a('0x10')](_0x5db60d,_0x58644b);}function getHeaders(_0x113dd8){return _[_0x4f8a('0x11')](_0x113dd8,function(_0x4315a6){return{'text':_0x4315a6,'style':_0x4f8a('0x12')};});}function getRows(_0x407f2b,_0x22ea8a){return _[_0x4f8a('0x11')](_0x22ea8a,function(_0xad2bd0){return _(_0xad2bd0)[_0x4f8a('0x13')](_0x407f2b)[_0x4f8a('0x11')](function(_0x3f2988){return _0x3f2988?_['toString'](_0x3f2988):'';})[_0x4f8a('0x14')]();});}function createTable(_0x448389,_0x336f94){var _0x46985d={'widths':_[_0x4f8a('0x15')](Array(_0x448389[_0x4f8a('0x16')]),0x91),'heights':function(_0x5d0829){return _0x5d0829===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x19e143=getHeaders(_0x448389);_0x46985d['body'][_0x4f8a('0x17')](_0x19e143);var _0x2a28fd=getRows(_0x448389,_0x336f94);_0x46985d['body']=_0x46985d[_0x4f8a('0x18')][_0x4f8a('0x19')](_0x2a28fd);return _0x46985d;}function createTables(_0x3a6f7f){var _0x5109d1=[];var _0x5f66a4=_[_0x4f8a('0x1a')](Object[_0x4f8a('0x1b')](_0x3a6f7f[0x0]),0x5);_0x5f66a4['forEach'](function(_0x4a0ec6){_0x5109d1[_0x4f8a('0x17')](createTable(_0x4a0ec6,_0x3a6f7f));});return _0x5109d1;}function getPDFDocDefinition(_0x25c5e6){var _0x4ea158=util['format'](_0x4f8a('0x1c'),NAME,EXTRACTED_REPORT[_0x4f8a('0x1d')],moment(EXTRACTED_REPORT[_0x4f8a('0x1e')])[_0x4f8a('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0x4f8a('0x20')])[_0x4f8a('0x1f')](FORMAT));var _0x33abf0=[];for(var _0x30c3ec=0x0;_0x30c3ec<_0x25c5e6[_0x4f8a('0x16')];_0x30c3ec++){var _0x492019=[];if(_0x30c3ec===0x0){_0x492019['push']({'text':_0x4ea158,'style':_0x4f8a('0x21')});}var _0x53811c={'table':_0x25c5e6[_0x30c3ec]};if(_0x30c3ec>0x0){_0x53811c[_0x4f8a('0x22')]=_0x4f8a('0x23');_0x53811c[_0x4f8a('0x24')]=[0x0,0x46,0x0,0x0];}_0x492019[_0x4f8a('0x17')](_0x53811c);_0x33abf0[_0x4f8a('0x17')](_0x492019);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x33abf0,'footer':function(_0x2c3e08,_0x3b9e90){return{'text':_0x2c3e08[_0x4f8a('0x25')]()+'\x20/\x20'+_0x3b9e90,'style':_0x4f8a('0x26')};},'defaultStyle':{'font':_0x4f8a('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x4f8a('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5aa2e2){var _0xd1e99d=0x1388;var _0x1953de;if(!_0x5aa2e2[0x0]['num']){return analyticExtractedReport('Empty');}return db['Setting'][_0x4f8a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4f8a('0x2a'),_0x4f8a('0x2b')]})[_0x4f8a('0x2c')](function(_0x331d5b){if(_0x331d5b){_0x1953de=_0x331d5b;_0xd1e99d=_0x1953de[_0x4f8a('0x2b')]||0x3e8;}})[_0x4f8a('0x2c')](function(){var _0xcd4395=[];var _0x390041=0x0;if(_0x1953de[_0x4f8a('0x2a')]){if(_0x5aa2e2&&_0x5aa2e2['length']){var _0x306b03=_[_0x4f8a('0x2d')](_0x5aa2e2[0x0][_0x4f8a('0x2e')]/_0xd1e99d);var _0x2ffaa2=Number[_0x4f8a('0x2f')](_0x5aa2e2[0x0][_0x4f8a('0x2e')]/_0xd1e99d)?_0x5aa2e2[0x0][_0x4f8a('0x2e')]%_0xd1e99d:0x0;_0x306b03['forEach'](function(_0xf1b0ef){if(_0xf1b0ef>0x0){_0x390041+=_0xd1e99d;}_0xcd4395[_0x4f8a('0x17')](dbH['sequelize'][_0x4f8a('0x30')](util[_0x4f8a('0x1f')](_0x4f8a('0x31'),QUERY,_0xd1e99d,_0x390041),{'type':dbH[_0x4f8a('0x32')][_0x4f8a('0x33')][_0x4f8a('0x34')]}));});if(_0x2ffaa2>0x0){_0x390041+=_0xd1e99d;_0xcd4395[_0x4f8a('0x17')](dbH[_0x4f8a('0x32')]['query'](util[_0x4f8a('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2ffaa2,_0x390041),{'type':dbH['sequelize'][_0x4f8a('0x33')][_0x4f8a('0x34')]}));}}}else{_0xcd4395[_0x4f8a('0x17')](dbH['sequelize'][_0x4f8a('0x30')](QUERY,{'type':dbH['sequelize'][_0x4f8a('0x33')]['SELECT']}));}var _0x3182c5=path[_0x4f8a('0x35')](PATH);var _0x5dce65=path[_0x4f8a('0x36')](PATH,_0x4f8a('0x37'));var _0xcc1312=_0x1953de[_0x4f8a('0x2a')]&&_0xcd4395[_0x4f8a('0x16')]>0x1;var _0xee8346=[];if(!fs[_0x4f8a('0x38')](path[_0x4f8a('0x39')](_0x3182c5,_0x5dce65))&&_0xcc1312){fs[_0x4f8a('0x3a')](path[_0x4f8a('0x39')](_0x3182c5,_0x5dce65));}return BPromise[_0x4f8a('0x3b')](_0xcd4395,function(_0x582b1f){_0xee8346[_0x4f8a('0x17')](_0x582b1f);})['then'](function(){var _0x185dd5=[];for(var _0x3818f8=0x0;_0x3818f8<_0xee8346['length'];_0x3818f8+=0x1){var _0x21d45b=_0xee8346[_0x3818f8];var _0x2247ed=createTables(_['flatten'](_0x21d45b));var _0xbe6071;var _0x58a792=getPDFDocDefinition(_0x2247ed);var _0x3af6d2=getPDFPrinter();var _0x17aa8b=_0x3af6d2['createPdfKitDocument'](_0x58a792);if(_0xcc1312){_0xbe6071=path[_0x4f8a('0x39')](_0x3182c5,_0x5dce65,util[_0x4f8a('0x1f')]('%s%d.%s',_0x5dce65,_0x3818f8,'pdf'));}else{_0xbe6071=path[_0x4f8a('0x39')](_0x3182c5,util[_0x4f8a('0x1f')](_0x4f8a('0x3c'),_0x5dce65,_0x4f8a('0x3d')));}_0x185dd5[_0x4f8a('0x17')](writePDFDocument(_0x17aa8b,_0xbe6071));}return Promise['all'](_0x185dd5);})['then'](function(){if(_0xcc1312){return new Promise(function(_0x30885f){zipdir(path[_0x4f8a('0x39')](_0x3182c5,_0x5dce65),{'saveTo':path[_0x4f8a('0x39')](_0x3182c5,util[_0x4f8a('0x1f')]('%s.%s',_0x5dce65,'zip'))},function(){rimraf(path[_0x4f8a('0x39')](_0x3182c5,_0x5dce65),function(){});_0x30885f(_0x4f8a('0x3e'));});});}})[_0x4f8a('0x2c')](function(){if(!_0xcc1312)return;rimraf(path[_0x4f8a('0x39')](_0x3182c5,_0x5dce65),function(){});})[_0x4f8a('0x2c')](function(){logger[_0x4f8a('0x3f')](util['format'](_0x4f8a('0x40'),EXTRACTED_REPORT_ID,_0x4f8a('0x41')));return analyticExtractedReport(_0x4f8a('0x42'),_0xcc1312?util['format'](_0x4f8a('0x3c'),_0x5dce65,_0xcc1312?_0x4f8a('0x43'):_0x4f8a('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x4f8a('0x1f')](_0x4f8a('0x44'),EXTRACTED_REPORT_ID,_0x4f8a('0x41')));return db['AnalyticExtractedReport'][_0x4f8a('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4f8a('0x2c')](function(_0x291b9e){EXTRACTED_REPORT=_0x291b9e;return dbH[_0x4f8a('0x32')][_0x4f8a('0x30')](util[_0x4f8a('0x1f')](_0x4f8a('0x46'),QUERY),{'type':dbH[_0x4f8a('0x32')][_0x4f8a('0x33')]['SELECT']});})['then'](extractReport)[_0x4f8a('0x47')](function(_0x5858c0){logger[_0x4f8a('0x3f')](util[_0x4f8a('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x5858c0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4f8a('0x48')](function(){process[_0x4f8a('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x57be58=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x4f8a('0x4a'),'bolditalics':__dirname+_0x4f8a('0x4b')}});return _0x57be58;}function getPDFDocDefinitionFromHTML(_0x3eb5f7,_0x23abaa){var _0x21cdb8=util[_0x4f8a('0x1f')]('%s\x20#%d',_0x23abaa[_0x4f8a('0x4c')],_0x23abaa[_0x4f8a('0x4d')]);var _0x53a996=moment()[_0x4f8a('0x1f')](_0x4f8a('0x4e'))[_0x4f8a('0x25')]();var _0xd1f6ee=htmlToPdfmake(_0x3eb5f7,{'window':window,'tableAutoSize':!![]});return{'content':[_0xd1f6ee],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x4f8a('0x4f')}},'header':function(){return[{'text':_0x4f8a('0x50'),'style':_0x4f8a('0x21')}];},'footer':function(_0x740321,_0x1a8a56){return[{'text':util[_0x4f8a('0x1f')](_0x4f8a('0x51'),_0x21cdb8,_0x740321,_0x1a8a56,_0x53a996),'style':_0x4f8a('0x26')}];}};}function writePDFDocument(_0x2c5f22,_0x5577d1){return new Promise(function(_0x1cc632,_0x40b51c){var _0x525b40=_0x2c5f22[_0x4f8a('0x52')](fs['createWriteStream'](_0x5577d1));_0x525b40['on'](_0x4f8a('0x53'),function(){_0x1cc632(_0x4f8a('0x53'));});_0x525b40['on'](_0x4f8a('0x54'),function(_0x137ec6){_0x40b51c(_0x137ec6);});_0x2c5f22[_0x4f8a('0x55')]();});}exports[_0x4f8a('0x56')]=function(_0x213abf,_0x1487f5){var _0x52f446=getPDFPrinter();var _0x3cf734=getPDFDocDefinitionFromHTML(_0x213abf,_0x1487f5);var _0x527043=_0x52f446[_0x4f8a('0x57')](_0x3cf734);return writePDFDocument(_0x527043,_0x1487f5[_0x4f8a('0x58')])['catch'](function(_0x46380a){throw _0x46380a;});};
\ No newline at end of file
+var _0xac5c=['Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','push','keys','forEach','format','name','endDate','header','pageBreak','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','then','range','num','isInteger','sequelize','query','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF'];(function(_0x48280c,_0x2eb836){var _0x17127e=function(_0x2a7e64){while(--_0x2a7e64){_0x48280c['push'](_0x48280c['shift']());}};_0x17127e(++_0x2eb836);}(_0xac5c,0x1d7));var _0xcac5=function(_0x4e0cd3,_0x5833a3){_0x4e0cd3=_0x4e0cd3-0x0;var _0x59f8c5=_0xac5c[_0x4e0cd3];return _0x59f8c5;};'use strict';var _=require(_0xcac5('0x0'));var fs=require('fs');var util=require(_0xcac5('0x1'));var path=require(_0xcac5('0x2'));var moment=require(_0xcac5('0x3'));var htmlToPdfmake=require(_0xcac5('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xcac5('0x5'));var JSDOM=require(_0xcac5('0x6'))['JSDOM'];var window=new JSDOM('')[_0xcac5('0x7')];var BPromise=require(_0xcac5('0x8'));var db=require(_0xcac5('0x9'))['db'];var dbH=require(_0xcac5('0x9'))[_0xcac5('0xa')];var logger=require(_0xcac5('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xcac5('0xc')][0x3];var PATH=process[_0xcac5('0xc')][0x4];var NAME=process[_0xcac5('0xc')][0x5];var FORMAT=_0xcac5('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c0af3,_0x8e4823){var _0xefad77={'status':_0x4c0af3};var _0x1f3508={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8e4823){_0xefad77[_0xcac5('0xe')]=_0x8e4823;}return db[_0xcac5('0xf')][_0xcac5('0x10')](_0xefad77,_0x1f3508);}function getHeaders(_0x54e3f4){return _[_0xcac5('0x11')](_0x54e3f4,function(_0xfe4d11){return{'text':_0xfe4d11,'style':_0xcac5('0x12')};});}function getRows(_0x46ddab,_0x3eb69b){return _[_0xcac5('0x11')](_0x3eb69b,function(_0x54164a){return _(_0x54164a)[_0xcac5('0x13')](_0x46ddab)[_0xcac5('0x11')](function(_0x4d0a12){return _0x4d0a12?_['toString'](_0x4d0a12):'';})[_0xcac5('0x14')]();});}function createTable(_0x451fb4,_0x304387){var _0x269104={'widths':_[_0xcac5('0x15')](Array(_0x451fb4[_0xcac5('0x16')]),0x91),'heights':function(_0x458e4c){return _0x458e4c===0x0?_0xcac5('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3e91cd=getHeaders(_0x451fb4);_0x269104[_0xcac5('0x18')][_0xcac5('0x19')](_0x3e91cd);var _0x1be063=getRows(_0x451fb4,_0x304387);_0x269104[_0xcac5('0x18')]=_0x269104[_0xcac5('0x18')]['concat'](_0x1be063);return _0x269104;}function createTables(_0x34c417){var _0x295b53=[];var _0x2cb842=_['chunk'](Object[_0xcac5('0x1a')](_0x34c417[0x0]),0x5);_0x2cb842[_0xcac5('0x1b')](function(_0x5b6b9f){_0x295b53[_0xcac5('0x19')](createTable(_0x5b6b9f,_0x34c417));});return _0x295b53;}function getPDFDocDefinition(_0x45ed7b){var _0x42b75a=util[_0xcac5('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xcac5('0x1d')],moment(EXTRACTED_REPORT['startDate'])[_0xcac5('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xcac5('0x1e')])[_0xcac5('0x1c')](FORMAT));var _0x1dfc9a=[];for(var _0x1db384=0x0;_0x1db384<_0x45ed7b[_0xcac5('0x16')];_0x1db384++){var _0x23e80c=[];if(_0x1db384===0x0){_0x23e80c[_0xcac5('0x19')]({'text':_0x42b75a,'style':_0xcac5('0x1f')});}var _0x4c4dd9={'table':_0x45ed7b[_0x1db384]};if(_0x1db384>0x0){_0x4c4dd9[_0xcac5('0x20')]='before';_0x4c4dd9[_0xcac5('0x21')]=[0x0,0x46,0x0,0x0];}_0x23e80c['push'](_0x4c4dd9);_0x1dfc9a[_0xcac5('0x19')](_0x23e80c);}return{'pageSize':'A4','pageOrientation':_0xcac5('0x22'),'content':_0x1dfc9a,'footer':function(_0x44477f,_0x50482f){return{'text':_0x44477f[_0xcac5('0x23')]()+_0xcac5('0x24')+_0x50482f,'style':_0xcac5('0x25')};},'defaultStyle':{'font':_0xcac5('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcac5('0x27')},'footer':{'alignment':_0xcac5('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x12a6fe){var _0x2e8d27=0x1388;var _0x23ad55;if(!_0x12a6fe[0x0]['num']){return analyticExtractedReport(_0xcac5('0x29'));}return db[_0xcac5('0x2a')][_0xcac5('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcac5('0x2c'),'splitSizePdf']})[_0xcac5('0x2d')](function(_0x1821f3){if(_0x1821f3){_0x23ad55=_0x1821f3;_0x2e8d27=_0x23ad55['splitSizePdf']||0x3e8;}})[_0xcac5('0x2d')](function(){var _0x182eaf=[];var _0x408607=0x0;if(_0x23ad55[_0xcac5('0x2c')]){if(_0x12a6fe&&_0x12a6fe[_0xcac5('0x16')]){var _0x423c01=_[_0xcac5('0x2e')](_0x12a6fe[0x0][_0xcac5('0x2f')]/_0x2e8d27);var _0x56b528=Number[_0xcac5('0x30')](_0x12a6fe[0x0][_0xcac5('0x2f')]/_0x2e8d27)?_0x12a6fe[0x0][_0xcac5('0x2f')]%_0x2e8d27:0x0;_0x423c01['forEach'](function(_0x437420){if(_0x437420>0x0){_0x408607+=_0x2e8d27;}_0x182eaf['push'](dbH[_0xcac5('0x31')][_0xcac5('0x32')](util[_0xcac5('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2e8d27,_0x408607),{'type':dbH[_0xcac5('0x31')][_0xcac5('0x33')]['SELECT']}));});if(_0x56b528>0x0){_0x408607+=_0x2e8d27;_0x182eaf[_0xcac5('0x19')](dbH[_0xcac5('0x31')][_0xcac5('0x32')](util['format'](_0xcac5('0x34'),QUERY,_0x56b528,_0x408607),{'type':dbH[_0xcac5('0x31')][_0xcac5('0x33')][_0xcac5('0x35')]}));}}}else{_0x182eaf[_0xcac5('0x19')](dbH[_0xcac5('0x31')][_0xcac5('0x32')](QUERY,{'type':dbH[_0xcac5('0x31')][_0xcac5('0x33')]['SELECT']}));}var _0x5836fb=path['dirname'](PATH);var _0x4e9346=path['basename'](PATH,_0xcac5('0x36'));var _0x599228=_0x23ad55[_0xcac5('0x2c')]&&_0x182eaf[_0xcac5('0x16')]>0x1;var _0x3c54b2=[];if(!fs[_0xcac5('0x37')](path[_0xcac5('0x38')](_0x5836fb,_0x4e9346))&&_0x599228){fs[_0xcac5('0x39')](path[_0xcac5('0x38')](_0x5836fb,_0x4e9346));}return BPromise[_0xcac5('0x3a')](_0x182eaf,function(_0x34509f){_0x3c54b2['push'](_0x34509f);})['then'](function(){var _0x350c6d=[];for(var _0x4d9a15=0x0;_0x4d9a15<_0x3c54b2[_0xcac5('0x16')];_0x4d9a15+=0x1){var _0x26d242=_0x3c54b2[_0x4d9a15];var _0x10d927=createTables(_['flatten'](_0x26d242));var _0x9e3084;var _0x5b513f=getPDFDocDefinition(_0x10d927);var _0x6e0a9d=getPDFPrinter();var _0x27d414=_0x6e0a9d[_0xcac5('0x3b')](_0x5b513f);if(_0x599228){_0x9e3084=path[_0xcac5('0x38')](_0x5836fb,_0x4e9346,util[_0xcac5('0x1c')](_0xcac5('0x3c'),_0x4e9346,_0x4d9a15,_0xcac5('0x3d')));}else{_0x9e3084=path['join'](_0x5836fb,util['format']('%s.%s',_0x4e9346,_0xcac5('0x3d')));}_0x350c6d[_0xcac5('0x19')](writePDFDocument(_0x27d414,_0x9e3084));}return Promise[_0xcac5('0x3e')](_0x350c6d);})['then'](function(){if(_0x599228){return new Promise(function(_0x42f051){zipdir(path[_0xcac5('0x38')](_0x5836fb,_0x4e9346),{'saveTo':path[_0xcac5('0x38')](_0x5836fb,util['format'](_0xcac5('0x3f'),_0x4e9346,_0xcac5('0x40')))},function(){rimraf(path['join'](_0x5836fb,_0x4e9346),function(){});_0x42f051(_0xcac5('0x41'));});});}})[_0xcac5('0x2d')](function(){if(!_0x599228)return;rimraf(path[_0xcac5('0x38')](_0x5836fb,_0x4e9346),function(){});})[_0xcac5('0x2d')](function(){logger[_0xcac5('0x42')](util[_0xcac5('0x1c')](_0xcac5('0x43'),EXTRACTED_REPORT_ID,_0xcac5('0x44')));return analyticExtractedReport(_0xcac5('0x45'),_0x599228?util['format'](_0xcac5('0x3f'),_0x4e9346,_0x599228?_0xcac5('0x40'):_0xcac5('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcac5('0x42')](util[_0xcac5('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0xcac5('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xcac5('0x2d')](function(_0x21ff43){EXTRACTED_REPORT=_0x21ff43;return dbH[_0xcac5('0x31')]['query'](util[_0xcac5('0x1c')](_0xcac5('0x47'),QUERY),{'type':dbH[_0xcac5('0x31')][_0xcac5('0x33')][_0xcac5('0x35')]});})[_0xcac5('0x2d')](extractReport)['catch'](function(_0x56002c){logger[_0xcac5('0x42')](util['format'](_0xcac5('0x48'),EXTRACTED_REPORT_ID,_0xcac5('0x44')),util[_0xcac5('0x49')](_0x56002c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcac5('0x4a'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4fd890=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xcac5('0x4b'),'italics':__dirname+_0xcac5('0x4c'),'bolditalics':__dirname+_0xcac5('0x4d')}});return _0x4fd890;}function getPDFDocDefinitionFromHTML(_0x49f125,_0x562ff0){var _0x4e9c03=util[_0xcac5('0x1c')](_0xcac5('0x4e'),_0x562ff0[_0xcac5('0x4f')],_0x562ff0[_0xcac5('0x50')]);var _0x5b7205=moment()['format'](_0xcac5('0x51'))[_0xcac5('0x23')]();var _0x5ae901=htmlToPdfmake(_0x49f125,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ae901],'defaultStyle':{'font':_0xcac5('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcac5('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xcac5('0x1f')}];},'footer':function(_0x14c78d,_0x516fc2){return[{'text':util['format'](_0xcac5('0x53'),_0x4e9c03,_0x14c78d,_0x516fc2,_0x5b7205),'style':'footer'}];}};}function writePDFDocument(_0x412025,_0x18cd98){return new Promise(function(_0x469a82,_0x2bec89){var _0x4ec293=_0x412025[_0xcac5('0x54')](fs[_0xcac5('0x55')](_0x18cd98));_0x4ec293['on']('finish',function(){_0x469a82(_0xcac5('0x56'));});_0x4ec293['on'](_0xcac5('0x57'),function(_0xda9cf8){_0x2bec89(_0xda9cf8);});_0x412025['end']();});}exports[_0xcac5('0x58')]=function(_0xfe41d3,_0x47c1c2){var _0x4cf4bd=getPDFPrinter();var _0x12edcd=getPDFDocDefinitionFromHTML(_0xfe41d3,_0x47c1c2);var _0x3c5061=_0x4cf4bd[_0xcac5('0x3b')](_0x12edcd);return writePDFDocument(_0x3c5061,_0x47c1c2['path'])[_0xcac5('0x59')](function(_0x44b3ca){throw _0x44b3ca;});};
\ No newline at end of file
index 7740bc0..3493619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf496=['sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','zip\x20finished','info','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','finally','exit','util','path','lodash','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','then','splitSizeXlsx','format'];(function(_0x2b75ae,_0x37181a){var _0x56dd4a=function(_0x5a933f){while(--_0x5a933f){_0x2b75ae['push'](_0x2b75ae['shift']());}};_0x56dd4a(++_0x37181a);}(_0xf496,0x114));var _0x6f49=function(_0xd3a26c,_0x502c28){_0xd3a26c=_0xd3a26c-0x0;var _0x3a2af6=_0xf496[_0xd3a26c];return _0x3a2af6;};'use strict';var util=require(_0x6f49('0x0'));var path=require(_0x6f49('0x1'));var _=require(_0x6f49('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x6f49('0x3'));var rimraf=require('rimraf');var db=require(_0x6f49('0x4'))['db'];var dbH=require(_0x6f49('0x4'))[_0x6f49('0x5')];var logger=require(_0x6f49('0x6'))(_0x6f49('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6f49('0x8')][0x2]);var QUERY=process[_0x6f49('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x17ed29,_0x34619f){var _0x90f85f={'status':_0x17ed29};var _0x19c214={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34619f){_0x90f85f[_0x6f49('0x9')]=_0x34619f;}return db['AnalyticExtractedReport'][_0x6f49('0xa')](_0x90f85f,_0x19c214);}function main(){var _0x598896=0x1388;var _0x1d9c8b;logger['info'](util['format'](_0x6f49('0xb'),EXTRACTED_REPORT_ID,_0x6f49('0xc')));return db[_0x6f49('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6f49('0xe'),'splitSizeXlsx']})[_0x6f49('0xf')](function(_0x815267){if(_0x815267){_0x1d9c8b=_0x815267;_0x598896=_0x1d9c8b[_0x6f49('0x10')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x6f49('0x11')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6f49('0x12')][_0x6f49('0x13')][_0x6f49('0x14')]});})[_0x6f49('0xf')](function(_0x186a71){if(!_0x186a71[0x0][_0x6f49('0x15')]){return analyticExtractedReport(_0x6f49('0x16'));}var _0x2e3dc8=[];var _0xb93905=0x0;if(_0x1d9c8b[_0x6f49('0xe')]){if(_0x186a71&&_0x186a71[_0x6f49('0x17')]){var _0x4e3b13=_[_0x6f49('0x18')](_0x186a71[0x0][_0x6f49('0x15')]/_0x598896);var _0x2e0df6=Number[_0x6f49('0x19')](_0x186a71[0x0][_0x6f49('0x15')]/_0x598896)?_0x186a71[0x0][_0x6f49('0x15')]%_0x598896:0x0;_0x4e3b13[_0x6f49('0x1a')](function(_0x3a7c5c){if(_0x3a7c5c>0x0){_0xb93905+=_0x598896;}_0x2e3dc8[_0x6f49('0x1b')](dbH[_0x6f49('0x12')][_0x6f49('0x1c')](util[_0x6f49('0x11')](_0x6f49('0x1d'),QUERY,_0x598896,_0xb93905),{'type':dbH['sequelize'][_0x6f49('0x13')][_0x6f49('0x14')]}));});if(_0x2e0df6>0x0){_0xb93905+=_0x598896;_0x2e3dc8[_0x6f49('0x1b')](dbH['sequelize'][_0x6f49('0x1c')](util[_0x6f49('0x11')](_0x6f49('0x1d'),QUERY,_0x2e0df6,_0xb93905),{'type':dbH[_0x6f49('0x12')]['QueryTypes']['SELECT']}));}}}else{_0x2e3dc8[_0x6f49('0x1b')](dbH[_0x6f49('0x12')][_0x6f49('0x1c')](QUERY,{'type':dbH['sequelize'][_0x6f49('0x13')][_0x6f49('0x14')]}));}var _0x581da4=path[_0x6f49('0x1e')](PATH);var _0xfdbd33=path['basename'](PATH,_0x6f49('0x1f'));var _0x36c937=_0x1d9c8b[_0x6f49('0xe')]&&_0x2e3dc8[_0x6f49('0x17')]>0x1;var _0x4d7dd6=[];if(!fs[_0x6f49('0x20')](path[_0x6f49('0x21')](_0x581da4,_0xfdbd33))&&_0x36c937){fs[_0x6f49('0x22')](path[_0x6f49('0x21')](_0x581da4,_0xfdbd33));}return BPromise[_0x6f49('0x23')](_0x2e3dc8,function(_0x2593cb){_0x4d7dd6[_0x6f49('0x1b')](_0x2593cb);})[_0x6f49('0xf')](function(){for(var _0x4c97a1=0x0;_0x4c97a1<_0x4d7dd6[_0x6f49('0x17')];_0x4c97a1+=0x1){var _0x94903d;var _0x160c7b=_0x4d7dd6[_0x4c97a1];if(_0x36c937){_0x94903d=path[_0x6f49('0x21')](_0x581da4,_0xfdbd33,util[_0x6f49('0x11')]('%s%d.%s',_0xfdbd33,_0x4c97a1,_0x6f49('0x24')));}else{_0x94903d=path['join'](_0x581da4,util['format'](_0x6f49('0x25'),_0xfdbd33,_0x6f49('0x24')));}fs['writeFileSync'](_0x94903d,json2xls(_0x160c7b),_0x6f49('0x26'));}})[_0x6f49('0xf')](function(){if(_0x36c937){return new Promise(function(_0x2990fd){zipdir(path[_0x6f49('0x21')](_0x581da4,_0xfdbd33),{'saveTo':path[_0x6f49('0x21')](_0x581da4,util[_0x6f49('0x11')](_0x6f49('0x25'),_0xfdbd33,'zip'))},function(_0x547044,_0x19f067){rimraf(path[_0x6f49('0x21')](_0x581da4,_0xfdbd33),function(){});_0x2990fd(_0x6f49('0x27'));});});}})[_0x6f49('0xf')](function(){logger[_0x6f49('0x28')](util[_0x6f49('0x11')](_0x6f49('0x29'),EXTRACTED_REPORT_ID,_0x6f49('0xc')));return analyticExtractedReport(_0x6f49('0x2a'),_0x36c937?util[_0x6f49('0x11')](_0x6f49('0x25'),_0xfdbd33,_0x36c937?_0x6f49('0x2b'):'xlsx'):null);});})[_0x6f49('0x2c')](function(_0x122cc0){logger[_0x6f49('0x28')](util[_0x6f49('0x11')](_0x6f49('0x2d'),EXTRACTED_REPORT_ID,_0x6f49('0xc')),util[_0x6f49('0x2e')](_0x122cc0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x6f49('0x2f')](function(){process[_0x6f49('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x84a0=['info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','split','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','length','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip'];(function(_0xbcabbb,_0x4b48de){var _0x1eb372=function(_0x3d7c5d){while(--_0x3d7c5d){_0xbcabbb['push'](_0xbcabbb['shift']());}};_0x1eb372(++_0x4b48de);}(_0x84a0,0x66));var _0x084a=function(_0x51dc5a,_0x3bcee3){_0x51dc5a=_0x51dc5a-0x0;var _0x3f50b8=_0x84a0[_0x51dc5a];return _0x3f50b8;};'use strict';var util=require(_0x084a('0x0'));var path=require(_0x084a('0x1'));var _=require(_0x084a('0x2'));var fs=require('fs');var json2xls=require(_0x084a('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x084a('0x4'));var rimraf=require(_0x084a('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x084a('0x6')];var logger=require(_0x084a('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x084a('0x8')][0x2]);var QUERY=process[_0x084a('0x8')][0x3];var PATH=process[_0x084a('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x373d2,_0x2b30bc){var _0x58d419={'status':_0x373d2};var _0x1051a9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b30bc){_0x58d419[_0x084a('0x9')]=_0x2b30bc;}return db[_0x084a('0xa')][_0x084a('0xb')](_0x58d419,_0x1051a9);}function main(){var _0x142127=0x1388;var _0x4c1e29;logger['info'](util[_0x084a('0xc')](_0x084a('0xd'),EXTRACTED_REPORT_ID,_0x084a('0xe')));return db[_0x084a('0xf')][_0x084a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x084a('0x11')](function(_0x3ca72f){if(_0x3ca72f){_0x4c1e29=_0x3ca72f;_0x142127=_0x4c1e29[_0x084a('0x12')]||0x1388;}})[_0x084a('0x11')](function(){return dbH[_0x084a('0x13')][_0x084a('0x14')](util[_0x084a('0xc')](_0x084a('0x15'),QUERY),{'type':dbH['sequelize'][_0x084a('0x16')]['SELECT']});})[_0x084a('0x11')](function(_0x3ccaca){if(!_0x3ccaca[0x0][_0x084a('0x17')]){return analyticExtractedReport(_0x084a('0x18'));}var _0xd20527=[];var _0x4cbd16=0x0;if(_0x4c1e29[_0x084a('0x19')]){if(_0x3ccaca&&_0x3ccaca['length']){var _0x6799af=_[_0x084a('0x1a')](_0x3ccaca[0x0]['num']/_0x142127);var _0xf2c333=Number[_0x084a('0x1b')](_0x3ccaca[0x0][_0x084a('0x17')]/_0x142127)?_0x3ccaca[0x0][_0x084a('0x17')]%_0x142127:0x0;_0x6799af[_0x084a('0x1c')](function(_0x145636){if(_0x145636>0x0){_0x4cbd16+=_0x142127;}_0xd20527[_0x084a('0x1d')](dbH[_0x084a('0x13')][_0x084a('0x14')](util[_0x084a('0xc')](_0x084a('0x1e'),QUERY,_0x142127,_0x4cbd16),{'type':dbH[_0x084a('0x13')][_0x084a('0x16')][_0x084a('0x1f')]}));});if(_0xf2c333>0x0){_0x4cbd16+=_0x142127;_0xd20527[_0x084a('0x1d')](dbH['sequelize'][_0x084a('0x14')](util[_0x084a('0xc')](_0x084a('0x1e'),QUERY,_0xf2c333,_0x4cbd16),{'type':dbH[_0x084a('0x13')][_0x084a('0x16')]['SELECT']}));}}}else{_0xd20527[_0x084a('0x1d')](dbH[_0x084a('0x13')][_0x084a('0x14')](QUERY,{'type':dbH[_0x084a('0x13')][_0x084a('0x16')][_0x084a('0x1f')]}));}var _0x5be167=path[_0x084a('0x20')](PATH);var _0x2af138=path[_0x084a('0x21')](PATH,'.xlsx');var _0x8806d5=_0x4c1e29[_0x084a('0x19')]&&_0xd20527[_0x084a('0x22')]>0x1;var _0x4c5658=[];if(!fs['existsSync'](path['join'](_0x5be167,_0x2af138))&&_0x8806d5){fs['mkdirSync'](path[_0x084a('0x23')](_0x5be167,_0x2af138));}return BPromise['each'](_0xd20527,function(_0x5bea78){_0x4c5658['push'](_0x5bea78);})[_0x084a('0x11')](function(){for(var _0x4651e6=0x0;_0x4651e6<_0x4c5658[_0x084a('0x22')];_0x4651e6+=0x1){var _0x2c4149;var _0x3be7a6=_0x4c5658[_0x4651e6];if(_0x8806d5){_0x2c4149=path[_0x084a('0x23')](_0x5be167,_0x2af138,util[_0x084a('0xc')](_0x084a('0x24'),_0x2af138,_0x4651e6,'xlsx'));}else{_0x2c4149=path[_0x084a('0x23')](_0x5be167,util[_0x084a('0xc')]('%s.%s',_0x2af138,_0x084a('0x25')));}fs[_0x084a('0x26')](_0x2c4149,json2xls(_0x3be7a6),_0x084a('0x27'));}})[_0x084a('0x11')](function(){if(_0x8806d5){return new Promise(function(_0x448ae9){zipdir(path[_0x084a('0x23')](_0x5be167,_0x2af138),{'saveTo':path[_0x084a('0x23')](_0x5be167,util[_0x084a('0xc')](_0x084a('0x28'),_0x2af138,_0x084a('0x29')))},function(_0x42af5f,_0x31bb9e){rimraf(path[_0x084a('0x23')](_0x5be167,_0x2af138),function(){});_0x448ae9('zip\x20finished');});});}})['then'](function(){logger[_0x084a('0x2a')](util[_0x084a('0xc')](_0x084a('0x2b'),EXTRACTED_REPORT_ID,_0x084a('0xe')));return analyticExtractedReport(_0x084a('0x2c'),_0x8806d5?util['format'](_0x084a('0x28'),_0x2af138,_0x8806d5?_0x084a('0x29'):_0x084a('0x25')):null);});})['catch'](function(_0x109593){logger[_0x084a('0x2a')](util[_0x084a('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x109593,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x084a('0x2d'));})[_0x084a('0x2e')](function(){process[_0x084a('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index 20e42f5..d0f20ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3366=['concat','Hangup','destroy','bulkCreate','sortBy','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','priority','find','extensions','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','map','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x3366,0xd8));var _0x6336=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0x3366[_0x2b6600];return _0x912ee2;};'use strict';var _=require(_0x6336('0x0'));var util=require(_0x6336('0x1'));function rewrite(_0xf1ad2c,_0x5d5ce4){var _0x3d8568=this;return _0xf1ad2c[_0x6336('0x2')][_0x6336('0x3')][_0x6336('0x4')]({'raw':!![]})[_0x6336('0x5')](function(_0x4b0433){_0x3d8568[_0x6336('0x6')]=_0x4b0433;return _0xf1ad2c['models'][_0x6336('0x7')]['findAll']({'where':{'IntervalId':_0x5d5ce4[_0x6336('0x8')]},'raw':!![]});})['then'](function(_0x5d8f59){return _0xf1ad2c[_0x6336('0x2')][_0x6336('0x7')][_0x6336('0x4')]({'where':{'exten':{'$in':_[_0x6336('0x9')](_['map'](_0x5d8f59,_0x6336('0xa')))}},'order':[{'raw':_0x6336('0xb')}],'raw':!![]});})[_0x6336('0x5')](function(_0x566d4c){var _0x13853d=_['filter'](_0x566d4c,{'priority':'1'});var _0x2dcc45=_[_0x6336('0xc')](_0x566d4c,{'isApp':0x1});var _0x39001e=_['groupBy'](_0x2dcc45,_0x6336('0xa'));var _0x3aea17=[_0x6336('0xd'),'playback'];var _0x22b693=[];var _0x32c950=[];for(var _0x5dc34f in _0x39001e){if(_0x39001e[_0x6336('0xe')](_0x5dc34f)){_0x3d8568[_0x6336('0xf')]=0x2;_0x3d8568['extensions']=[];_0x3d8568['extension']=_[_0x6336('0x10')](_0x13853d,{'exten':_0x39001e[_0x5dc34f][0x0]['exten']});_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':'Set','appdata':util[_0x6336('0x14')](_0x6336('0x15'),_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')]),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});if(_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')]===_0x6336('0x18')){_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x1a')+_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')],'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568['priority']++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});}else if(_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')]===_0x6336('0x1b')){if(_0x3d8568[_0x6336('0x1c')]){_0x3d8568[_0x6336('0x11')]['push']({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x1d')+(_0x3d8568[_0x6336('0x1c')][_0x6336('0x1e')]?'${EXTEN:'+_0x3d8568[_0x6336('0x1c')]['cutdigits']+'}':'${EXTEN}'),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});}_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x1a')+_0x39001e[_0x5dc34f][0x0]['VoiceExtensionId'],'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});var _0x44ea18=_0x3d8568[_0x6336('0xf')]++;_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x44ea18+0x2)+_0x6336('0x1f')+(_0x44ea18+0x1)+')','context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x44ea18,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0]['VoiceExtensionId']});if(_0x3d8568['extension']){_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0]['type'],'app':'Set','appdata':_0x3d8568['extension'][_0x6336('0x1e')]?_0x6336('0x20')+_0x3d8568[_0x6336('0x1c')]['cutdigits']+'}':_0x6336('0x21'),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});}_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x22')+_0x39001e[_0x5dc34f][0x0]['VoiceExtensionId'],'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0]['VoiceExtensionId']});if(_0x3d8568[_0x6336('0x1c')]&&_0x3d8568[_0x6336('0x1c')]['hasOwnProperty']('recordingFormat')&&_0x3d8568['extension']['recordingFormat']!==_0x6336('0x23')){_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':'Set','appdata':_0x6336('0x24'),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0]['VoiceExtensionId']});_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x25')+_0x3d8568['extension'][_0x6336('0x26')]||_0x6336('0x27'),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568[_0x6336('0xf')]++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});}}_0x3d8568['extensions'][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':'Set','appdata':_0x6336('0x28'),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0]['exten'],'priority':_0x3d8568['priority']++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});_0x3d8568[_0x6336('0x11')]['push']({'type':_0x39001e[_0x5dc34f][0x0][_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x29'),'context':_0x39001e[_0x5dc34f][0x0]['context'],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568['priority']++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});_0x3d8568[_0x6336('0x11')][_0x6336('0x12')]({'type':_0x39001e[_0x5dc34f][0x0]['type'],'app':_0x6336('0x19'),'appdata':_0x6336('0x2a'),'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'priority':_0x3d8568['priority']++,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});for(var _0x31ee01=0x0,_0x4d7c88=0x0;_0x31ee01<_0x39001e[_0x5dc34f][_0x6336('0x2b')];_0x31ee01+=0x1,_0x4d7c88=0x0){var _0x1b77f0=_0x39001e[_0x5dc34f][_0x31ee01];if(_0x1b77f0[_0x6336('0x13')]){_0x1b77f0[_0x6336('0x13')]=_0x1b77f0[_0x6336('0x13')][_0x6336('0x2c')]();}var _0x1cbc96=[];var _0x53712b=[];delete _0x1b77f0['id'];delete _0x1b77f0[_0x6336('0x2d')];delete _0x1b77f0[_0x6336('0x2e')];var _0x5e979e=_0x1b77f0['interval']!==_0x6336('0x2f')?[_0x1b77f0[_0x6336('0x30')]]:_0x1b77f0[_0x6336('0x8')]?_[_0x6336('0x31')](_[_0x6336('0xc')](_0x3d8568[_0x6336('0x6')],{'IntervalId':_0x1b77f0[_0x6336('0x8')]}),_0x6336('0x30')):[];if(_0x1b77f0[_0x6336('0xe')](_0x6336('0x32'))){if(_0x1b77f0[_0x6336('0x32')]&&_0x1b77f0['tag']!=='--'){_0x1cbc96[_0x6336('0x12')]({'type':_0x1b77f0[_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x33')+_0x1b77f0[_0x6336('0x32')],'context':_0x1b77f0['context'],'exten':_0x1b77f0[_0x6336('0xa')],'priority':_0x5e979e[_0x6336('0x2b')]+_0x3d8568['priority']+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0[_0x6336('0x17')]});}}if(_0x1b77f0[_0x6336('0x13')]===_0x6336('0x1b')&&_0x1b77f0[_0x6336('0xe')](_0x6336('0x34'))){if(_0x1b77f0[_0x6336('0x34')]){_0x1cbc96[_0x6336('0x12')]({'type':_0x1b77f0[_0x6336('0x13')],'app':_0x6336('0x35'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1b77f0['callerID']+')','context':_0x1b77f0[_0x6336('0x16')],'exten':_0x1b77f0[_0x6336('0xa')],'priority':_0x5e979e[_0x6336('0x2b')]+_0x3d8568[_0x6336('0xf')]+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0[_0x6336('0x17')]});}else{_0x1cbc96['push']({'type':_0x1b77f0['type'],'app':_0x6336('0x35'),'appdata':_0x6336('0x36'),'context':_0x1b77f0[_0x6336('0x16')],'exten':_0x1b77f0['exten'],'priority':_0x5e979e[_0x6336('0x2b')]+_0x3d8568[_0x6336('0xf')]+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0['VoiceExtensionId']});}}if(_0x1b77f0[_0x6336('0xe')](_0x6336('0x37'))){if(_0x3aea17[_0x6336('0x38')](_0x1b77f0['app'][_0x6336('0x2c')]())>=0x0&&_0x1b77f0['appType']!=='custom'){if(_0x1b77f0[_0x6336('0x37')]){_0x1cbc96['push']({'type':_0x1b77f0[_0x6336('0x13')],'app':_0x6336('0x35'),'appdata':_0x6336('0x39'),'context':_0x1b77f0[_0x6336('0x16')],'exten':_0x1b77f0[_0x6336('0xa')],'priority':_0x5e979e[_0x6336('0x2b')]+_0x3d8568[_0x6336('0xf')]+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0['VoiceExtensionId']});_0x1cbc96[_0x6336('0x12')]({'type':_0x1b77f0['type'],'app':_0x6336('0x19'),'appdata':_0x6336('0x3a'),'context':_0x1b77f0[_0x6336('0x16')],'exten':_0x1b77f0['exten'],'priority':_0x5e979e['length']+_0x3d8568[_0x6336('0xf')]+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0[_0x6336('0x17')]});}else{_0x1cbc96[_0x6336('0x12')]({'type':_0x1b77f0[_0x6336('0x13')],'app':_0x6336('0x35'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1b77f0[_0x6336('0x16')],'exten':_0x1b77f0['exten'],'priority':_0x5e979e[_0x6336('0x2b')]+_0x3d8568[_0x6336('0xf')]+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0[_0x6336('0x17')]});_0x1cbc96[_0x6336('0x12')]({'type':_0x1b77f0[_0x6336('0x13')],'app':_0x6336('0x19'),'appdata':_0x6336('0x3b'),'context':_0x1b77f0['context'],'exten':_0x1b77f0[_0x6336('0xa')],'priority':_0x5e979e['length']+_0x3d8568[_0x6336('0xf')]+_0x4d7c88++,'VoiceExtensionId':_0x1b77f0[_0x6336('0x17')]});}}}for(var _0x236853=0x0;_0x236853<_0x5e979e[_0x6336('0x2b')];_0x236853+=0x1){var _0x2ceb0b=_0x3d8568[_0x6336('0xf')]+_0x5e979e[_0x6336('0x2b')];var _0x51eb59=_0x236853===_0x5e979e['length']-0x1?_0x3d8568['priority']+_0x1cbc96['length']+_0x53712b[_0x6336('0x2b')]+0x2:_0x3d8568[_0x6336('0xf')]+_0x236853+0x1;_0x1cbc96[_0x6336('0x3c')](_0x236853,0x0,{'type':_0x1b77f0[_0x6336('0x13')],'app':_0x6336('0x3d'),'appdata':_0x5e979e[_0x236853]+'?'+_0x1b77f0[_0x6336('0x16')]+',${EXTEN},'+_0x2ceb0b+':'+_0x1b77f0[_0x6336('0x16')]+_0x6336('0x3e')+_0x51eb59,'exten':_0x1b77f0[_0x6336('0xa')],'context':_0x1b77f0['context'],'priority':_0x3d8568[_0x6336('0xf')]+_0x236853,'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0]['VoiceExtensionId']});}_0x1b77f0[_0x6336('0xf')]=_0x1cbc96[_0x6336('0x2b')]?_[_0x6336('0x3f')](_0x1cbc96)[_0x6336('0xf')]+0x1:_0x3d8568[_0x6336('0xf')];_0x3d8568['priority']=(_0x53712b[_0x6336('0x2b')]?_[_0x6336('0x3f')](_0x53712b)[_0x6336('0xf')]:_0x1b77f0[_0x6336('0xf')])+0x1;_0x3d8568['extensions']=_[_0x6336('0x40')](_0x3d8568['extensions'],_0x1cbc96,[_0x1b77f0],_0x53712b);}_0x3d8568[_0x6336('0x11')]['push']({'type':_0x39001e[_0x5dc34f][0x0]['type'],'app':_0x6336('0x41'),'exten':_0x39001e[_0x5dc34f][0x0][_0x6336('0xa')],'context':_0x39001e[_0x5dc34f][0x0][_0x6336('0x16')],'priority':_0x3d8568[_0x6336('0xf')],'VoiceExtensionId':_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]});_0x22b693[_0x6336('0x12')](_0x39001e[_0x5dc34f][0x0][_0x6336('0x17')]);_0x32c950=_[_0x6336('0x40')](_0x32c950,_0x3d8568['extensions']);}}return _0xf1ad2c['transaction'](function(_0x50fd7b){return _0xf1ad2c[_0x6336('0x2')]['VoiceExtension'][_0x6336('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x22b693}},'transaction':_0x50fd7b})[_0x6336('0x5')](function(_0x519fa5){return _0xf1ad2c[_0x6336('0x2')]['VoiceExtension'][_0x6336('0x43')](_[_0x6336('0x44')](_0x32c950,_0x6336('0xf')),{'transaction':_0x50fd7b});});});})['catch'](function(_0x586ba4){console[_0x6336('0x45')](_0x586ba4);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0x55b9=['toLowerCase','createdAt','interval','*,*,*,*','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','answer','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extension','find','extensions','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','outbound','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','recordingFormat','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x2c43e3,_0x2ddb44){var _0x3d51ef=function(_0x4c2a7b){while(--_0x4c2a7b){_0x2c43e3['push'](_0x2c43e3['shift']());}};_0x3d51ef(++_0x2ddb44);}(_0x55b9,0x154));var _0x955b=function(_0x109d67,_0xa5fa8){_0x109d67=_0x109d67-0x0;var _0x3ca124=_0x55b9[_0x109d67];return _0x3ca124;};'use strict';var _=require(_0x955b('0x0'));var util=require(_0x955b('0x1'));function rewrite(_0x2a781d,_0x381285){var _0xa9181f=this;return _0x2a781d[_0x955b('0x2')][_0x955b('0x3')][_0x955b('0x4')]({'raw':!![]})[_0x955b('0x5')](function(_0x537d43){_0xa9181f[_0x955b('0x6')]=_0x537d43;return _0x2a781d['models']['VoiceExtension'][_0x955b('0x4')]({'where':{'IntervalId':_0x381285['IntervalId']},'raw':!![]});})['then'](function(_0xe72173){return _0x2a781d[_0x955b('0x2')][_0x955b('0x7')][_0x955b('0x4')]({'where':{'exten':{'$in':_[_0x955b('0x8')](_[_0x955b('0x9')](_0xe72173,_0x955b('0xa')))}},'order':[{'raw':_0x955b('0xb')}],'raw':!![]});})[_0x955b('0x5')](function(_0x5cc135){var _0x37461b=_[_0x955b('0xc')](_0x5cc135,{'priority':'1'});var _0x351dc6=_['filter'](_0x5cc135,{'isApp':0x1});var _0x215605=_[_0x955b('0xd')](_0x351dc6,_0x955b('0xa'));var _0x488136=[_0x955b('0xe'),'playback'];var _0x1ef5a7=[];var _0x27fd8c=[];for(var _0x4de10f in _0x215605){if(_0x215605[_0x955b('0xf')](_0x4de10f)){_0xa9181f[_0x955b('0x10')]=0x2;_0xa9181f['extensions']=[];_0xa9181f[_0x955b('0x11')]=_[_0x955b('0x12')](_0x37461b,{'exten':_0x215605[_0x4de10f][0x0]['exten']});_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0][_0x955b('0x15')],'app':'Set','appdata':util[_0x955b('0x16')](_0x955b('0x17'),_0x215605[_0x4de10f][0x0][_0x955b('0x15')]),'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f['priority']++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});if(_0x215605[_0x4de10f][0x0][_0x955b('0x15')]===_0x955b('0x1a')){_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0]['type'],'app':_0x955b('0x1b'),'appdata':'CDR(routeid)='+_0x215605[_0x4de10f][0x0][_0x955b('0x19')],'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f['priority']++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0]['VoiceExtensionId']});}else if(_0x215605[_0x4de10f][0x0][_0x955b('0x15')]===_0x955b('0x1c')){if(_0xa9181f[_0x955b('0x11')]){_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0][_0x955b('0x15')],'app':_0x955b('0x1b'),'appdata':'CDR(destination)='+(_0xa9181f[_0x955b('0x11')][_0x955b('0x1d')]?'${EXTEN:'+_0xa9181f[_0x955b('0x11')]['cutdigits']+'}':_0x955b('0x1e')),'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f[_0x955b('0x10')]++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0]['VoiceExtensionId']});}_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0]['type'],'app':_0x955b('0x1b'),'appdata':_0x955b('0x1f')+_0x215605[_0x4de10f][0x0][_0x955b('0x19')],'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f[_0x955b('0x10')]++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});var _0x1d44bb=_0xa9181f['priority']++;_0xa9181f['extensions']['push']({'type':_0x215605[_0x4de10f][0x0]['type'],'app':_0x955b('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1d44bb+0x2)+_0x955b('0x21')+(_0x1d44bb+0x1)+')','context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0x1d44bb,'VoiceExtensionId':_0x215605[_0x4de10f][0x0]['VoiceExtensionId']});if(_0xa9181f['extension']){_0xa9181f['extensions'][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0][_0x955b('0x15')],'app':_0x955b('0x1b'),'appdata':_0xa9181f['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xa9181f[_0x955b('0x11')][_0x955b('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f[_0x955b('0x10')]++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0]['VoiceExtensionId']});}_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0][_0x955b('0x15')],'app':'Set','appdata':'outboundrouteid='+_0x215605[_0x4de10f][0x0][_0x955b('0x19')],'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f['priority']++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});if(_0xa9181f[_0x955b('0x11')]&&_0xa9181f['extension'][_0x955b('0xf')](_0x955b('0x22'))&&_0xa9181f['extension']['recordingFormat']!=='none'){_0xa9181f['extensions'][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0]['type'],'app':_0x955b('0x1b'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f['priority']++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});_0xa9181f[_0x955b('0x13')]['push']({'type':_0x215605[_0x4de10f][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xa9181f[_0x955b('0x11')][_0x955b('0x22')]||'wav','context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f[_0x955b('0x10')]++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});}}_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0]['type'],'app':_0x955b('0x1b'),'appdata':_0x955b('0x23'),'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0]['exten'],'priority':_0xa9181f[_0x955b('0x10')]++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0]['VoiceExtensionId']});_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0]['type'],'app':'Set','appdata':_0x955b('0x24'),'context':_0x215605[_0x4de10f][0x0]['context'],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f['priority']++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});_0xa9181f[_0x955b('0x13')][_0x955b('0x14')]({'type':_0x215605[_0x4de10f][0x0]['type'],'app':_0x955b('0x1b'),'appdata':_0x955b('0x25'),'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'exten':_0x215605[_0x4de10f][0x0][_0x955b('0xa')],'priority':_0xa9181f[_0x955b('0x10')]++,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});for(var _0x1cff49=0x0,_0x334756=0x0;_0x1cff49<_0x215605[_0x4de10f]['length'];_0x1cff49+=0x1,_0x334756=0x0){var _0x532364=_0x215605[_0x4de10f][_0x1cff49];if(_0x532364[_0x955b('0x15')]){_0x532364[_0x955b('0x15')]=_0x532364[_0x955b('0x15')][_0x955b('0x26')]();}var _0x159be5=[];var _0xfeb0fc=[];delete _0x532364['id'];delete _0x532364[_0x955b('0x27')];delete _0x532364['updatedAt'];var _0x3242d3=_0x532364[_0x955b('0x28')]!==_0x955b('0x29')?[_0x532364[_0x955b('0x28')]]:_0x532364[_0x955b('0x2a')]?_['map'](_[_0x955b('0xc')](_0xa9181f['intervals'],{'IntervalId':_0x532364[_0x955b('0x2a')]}),_0x955b('0x28')):[];if(_0x532364[_0x955b('0xf')](_0x955b('0x2b'))){if(_0x532364['tag']&&_0x532364[_0x955b('0x2b')]!=='--'){_0x159be5[_0x955b('0x14')]({'type':_0x532364[_0x955b('0x15')],'app':_0x955b('0x1b'),'appdata':'CDR(tag)='+_0x532364[_0x955b('0x2b')],'context':_0x532364[_0x955b('0x18')],'exten':_0x532364[_0x955b('0xa')],'priority':_0x3242d3['length']+_0xa9181f[_0x955b('0x10')]+_0x334756++,'VoiceExtensionId':_0x532364[_0x955b('0x19')]});}}if(_0x532364[_0x955b('0x15')]===_0x955b('0x1c')&&_0x532364[_0x955b('0xf')]('callerID')){if(_0x532364[_0x955b('0x2c')]){_0x159be5[_0x955b('0x14')]({'type':_0x532364[_0x955b('0x15')],'app':_0x955b('0x20'),'appdata':_0x955b('0x2d')+_0x532364['callerID']+')','context':_0x532364[_0x955b('0x18')],'exten':_0x532364['exten'],'priority':_0x3242d3['length']+_0xa9181f[_0x955b('0x10')]+_0x334756++,'VoiceExtensionId':_0x532364[_0x955b('0x19')]});}else{_0x159be5[_0x955b('0x14')]({'type':_0x532364[_0x955b('0x15')],'app':_0x955b('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x532364['context'],'exten':_0x532364['exten'],'priority':_0x3242d3[_0x955b('0x2e')]+_0xa9181f[_0x955b('0x10')]+_0x334756++,'VoiceExtensionId':_0x532364[_0x955b('0x19')]});}}if(_0x532364['hasOwnProperty'](_0x955b('0x2f'))){if(_0x488136[_0x955b('0x30')](_0x532364['app'][_0x955b('0x26')]())>=0x0&&_0x532364[_0x955b('0x31')]!==_0x955b('0x32')){if(_0x532364[_0x955b('0x2f')]){_0x159be5[_0x955b('0x14')]({'type':_0x532364[_0x955b('0x15')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x532364[_0x955b('0x18')],'exten':_0x532364['exten'],'priority':_0x3242d3[_0x955b('0x2e')]+_0xa9181f[_0x955b('0x10')]+_0x334756++,'VoiceExtensionId':_0x532364[_0x955b('0x19')]});_0x159be5[_0x955b('0x14')]({'type':_0x532364['type'],'app':'Set','appdata':_0x955b('0x33'),'context':_0x532364[_0x955b('0x18')],'exten':_0x532364[_0x955b('0xa')],'priority':_0x3242d3[_0x955b('0x2e')]+_0xa9181f[_0x955b('0x10')]+_0x334756++,'VoiceExtensionId':_0x532364['VoiceExtensionId']});}else{_0x159be5[_0x955b('0x14')]({'type':_0x532364[_0x955b('0x15')],'app':_0x955b('0x20'),'appdata':_0x955b('0x34'),'context':_0x532364[_0x955b('0x18')],'exten':_0x532364[_0x955b('0xa')],'priority':_0x3242d3[_0x955b('0x2e')]+_0xa9181f['priority']+_0x334756++,'VoiceExtensionId':_0x532364[_0x955b('0x19')]});_0x159be5[_0x955b('0x14')]({'type':_0x532364[_0x955b('0x15')],'app':'Set','appdata':_0x955b('0x35'),'context':_0x532364[_0x955b('0x18')],'exten':_0x532364[_0x955b('0xa')],'priority':_0x3242d3['length']+_0xa9181f[_0x955b('0x10')]+_0x334756++,'VoiceExtensionId':_0x532364[_0x955b('0x19')]});}}}for(var _0x4b36cf=0x0;_0x4b36cf<_0x3242d3['length'];_0x4b36cf+=0x1){var _0x299ac0=_0xa9181f[_0x955b('0x10')]+_0x3242d3['length'];var _0x5cec4c=_0x4b36cf===_0x3242d3['length']-0x1?_0xa9181f['priority']+_0x159be5[_0x955b('0x2e')]+_0xfeb0fc[_0x955b('0x2e')]+0x2:_0xa9181f[_0x955b('0x10')]+_0x4b36cf+0x1;_0x159be5['splice'](_0x4b36cf,0x0,{'type':_0x532364['type'],'app':_0x955b('0x36'),'appdata':_0x3242d3[_0x4b36cf]+'?'+_0x532364['context']+_0x955b('0x37')+_0x299ac0+':'+_0x532364[_0x955b('0x18')]+_0x955b('0x37')+_0x5cec4c,'exten':_0x532364[_0x955b('0xa')],'context':_0x532364[_0x955b('0x18')],'priority':_0xa9181f[_0x955b('0x10')]+_0x4b36cf,'VoiceExtensionId':_0x215605[_0x4de10f][0x0][_0x955b('0x19')]});}_0x532364['priority']=_0x159be5[_0x955b('0x2e')]?_[_0x955b('0x38')](_0x159be5)[_0x955b('0x10')]+0x1:_0xa9181f[_0x955b('0x10')];_0xa9181f['priority']=(_0xfeb0fc[_0x955b('0x2e')]?_[_0x955b('0x38')](_0xfeb0fc)['priority']:_0x532364['priority'])+0x1;_0xa9181f[_0x955b('0x13')]=_[_0x955b('0x39')](_0xa9181f[_0x955b('0x13')],_0x159be5,[_0x532364],_0xfeb0fc);}_0xa9181f[_0x955b('0x13')]['push']({'type':_0x215605[_0x4de10f][0x0][_0x955b('0x15')],'app':'Hangup','exten':_0x215605[_0x4de10f][0x0]['exten'],'context':_0x215605[_0x4de10f][0x0][_0x955b('0x18')],'priority':_0xa9181f[_0x955b('0x10')],'VoiceExtensionId':_0x215605[_0x4de10f][0x0]['VoiceExtensionId']});_0x1ef5a7[_0x955b('0x14')](_0x215605[_0x4de10f][0x0][_0x955b('0x19')]);_0x27fd8c=_[_0x955b('0x39')](_0x27fd8c,_0xa9181f[_0x955b('0x13')]);}}return _0x2a781d['transaction'](function(_0x3a09de){return _0x2a781d[_0x955b('0x2')][_0x955b('0x7')][_0x955b('0x3a')]({'where':{'VoiceExtensionId':{'$in':_0x1ef5a7}},'transaction':_0x3a09de})['then'](function(_0x364880){return _0x2a781d[_0x955b('0x2')][_0x955b('0x7')]['bulkCreate'](_[_0x955b('0x3b')](_0x27fd8c,_0x955b('0x10')),{'transaction':_0x3a09de});});});})[_0x955b('0x3c')](function(_0x440811){console[_0x955b('0x3d')](_0x440811);});}exports[_0x955b('0x3e')]=rewrite;
\ No newline at end of file
index 80a806f..9c08bd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ee=['CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','errors','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','field','NOW()','ContactId','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','str','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','CmList','Lists','always','catch','onlyIfOpen','sequelize','query','VoiceQueueId','all','findAll','outbound','BlackLists','get','CampaignId','Error\x20processing\x20rows\x20block:','finally','emit','resume','contact:csv_','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xc4ee,0xda));var _0xec4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4ee[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xec4e('0x0'));var util=require(_0xec4e('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xec4e('0x2'));var Papa=require(_0xec4e('0x3'));var Redis=require(_0xec4e('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xec4e('0x5'));var logger=require('../../../config/logger')('api');config[_0xec4e('0x6')]=_['defaults'](config['redis'],{'host':_0xec4e('0x7'),'port':0x18eb});var socket=require(_0xec4e('0x8'))(new Redis(config[_0xec4e('0x6')]));require(_0xec4e('0x9'))[_0xec4e('0xa')](socket);try{if(!process[_0xec4e('0xb')][0x2]||process[_0xec4e('0xb')][0x2]===_0xec4e('0xc')||process[_0xec4e('0xb')][0x2]==='null'){throw new Error(_0xec4e('0xd'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xec4e('0xb')][0x3]===_0xec4e('0xc')||process[_0xec4e('0xb')][0x3]===_0xec4e('0xe')||!process[_0xec4e('0xb')][0x4]||process[_0xec4e('0xb')][0x4]===_0xec4e('0xc')||process[_0xec4e('0xb')][0x4]===_0xec4e('0xe')){throw new Error(_0xec4e('0xf'));}var FIELDS=_[_0xec4e('0x10')](process[_0xec4e('0xb')][0x3][_0xec4e('0x11')](','),process[_0xec4e('0xb')][0x4][_0xec4e('0x11')](','));if(!process[_0xec4e('0xb')][0x5]||process[_0xec4e('0xb')][0x5]==='undefined'||process[_0xec4e('0xb')][0x5]===_0xec4e('0xe')){throw new Error(_0xec4e('0x12'));}var LISTID=process[_0xec4e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0xec4e('0xc')&&process['argv'][0x6]!==_0xec4e('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0xec4e('0xb')][0x7]&&process[_0xec4e('0xb')][0x7]!==_0xec4e('0xc')&&process['argv'][0x7]!==_0xec4e('0xe')?process['argv'][0x7]:null;if(!process[_0xec4e('0xb')][0x8]||process[_0xec4e('0xb')][0x8]===_0xec4e('0xc')||process['argv'][0x8]===_0xec4e('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x436fdb){logger['error'](_0x436fdb);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(_0x59af38,_0x51ef42,_0xc2c093,_0x2152dc){var _0x27c758={'message':_0x51ef42};_0x27c758[_0x59af38]=!![];if(_0xc2c093){_0x27c758[_0xec4e('0x13')]=_0xc2c093;}if(_0x2152dc){_0x27c758[_0xec4e('0x14')]=_0x2152dc;}return _0x27c758;}function isEmail(_0x496b24){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))*$/[_0xec4e('0x15')](_0x496b24);}function checkRow(_0x251806,_0x4df3aa,_0x475d75){return new BPromise(function(_0x460447,_0x30624a){if(_[_0xec4e('0x16')](_0x251806)){return _0x30624a(handleCheckRowError(_0xec4e('0x17'),_0xec4e('0x18'),null,_0x475d75));}if(_0x251806['errors']&&_0x251806['errors'][_0xec4e('0x19')]){var _0x40b454=_['map'](_0x251806[_0xec4e('0x1a')],'message')['join'](';');return _0x30624a(handleCheckRowError(_0xec4e('0x17'),_0x40b454,null,_0x475d75));}var _0x123fc8={};for(var _0x363058 in FIELDS){if(FIELDS[_0xec4e('0x1b')](_0x363058)&&FIELDS[_0x363058]){_0x123fc8[_0x363058]=_0x251806[_0xec4e('0x1c')][0x0][FIELDS[_0x363058]]||_0x251806[_0xec4e('0x1c')][0x0]['\ufeff'+FIELDS[_0x363058]];}}if(!_0x123fc8[_0xec4e('0x1d')]){return _0x30624a(handleCheckRowError(_0xec4e('0x17'),_0xec4e('0x1e'),null,_0x475d75));}if(!_0x123fc8[_0xec4e('0x1f')]){return _0x30624a(handleCheckRowError('error',_0xec4e('0x20'),null,_0x475d75));}if(_0x123fc8['birthDate']){var _0x283efd=moment(_0x123fc8[_0xec4e('0x21')],_0xec4e('0x22'));if(!_0x283efd[_0xec4e('0x23')]()){return _0x30624a(handleCheckRowError(_0xec4e('0x17'),_0xec4e('0x24'),null,_0x475d75));}}if(_0x123fc8[_0xec4e('0x25')]){if(!isEmail(_0x123fc8[_0xec4e('0x25')])){return _0x30624a(handleCheckRowError(_0xec4e('0x17'),_0xec4e('0x26'),null,_0x475d75));}}_0x123fc8[_0xec4e('0x27')]=LISTID;_0x123fc8[_0xec4e('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xec4e('0x19')]&&_0x4df3aa){var _0x252b6a={};for(var _0x2a88c3=0x0,_0x3ca88c=DUPLICATES['length'];_0x2a88c3<_0x3ca88c;_0x2a88c3+=0x1){_0x252b6a[DUPLICATES[_0x2a88c3]]=_0x123fc8[DUPLICATES[_0x2a88c3]];}var _0x386b18=_[_0xec4e('0x29')](_0x4df3aa,_0x252b6a);if(_0x386b18){return _0x30624a(handleCheckRowError('duplicate',_0xec4e('0x2a'),_0x386b18,_0x475d75));}}return db['CmContact'][_0xec4e('0x2b')](_0x123fc8,{'raw':!![],'hooks':![],'fields':_[_0xec4e('0x2c')](_0x123fc8)})[_0xec4e('0x2d')](function(_0x461488){if(DUPLICATES&&DUPLICATES[_0xec4e('0x19')]&&_0x4df3aa){_0x4df3aa[_0xec4e('0x2e')](_['pick'](_0x123fc8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x461488['id'];return _0x460447();})['catch'](function(_0x268296){return _0x30624a(handleCheckRowError('error',_0xec4e('0x2f')+(_0x268296[_0xec4e('0x30')]||JSON[_0xec4e('0x31')](_0x268296)),null,_0x475d75));});});}function checkHopper(){function _0x4fef9c(){return function(_0x55e778){logger[_0xec4e('0x17')](_0xec4e('0x32'),'checkHopper',util[_0xec4e('0x33')](_0x55e778,{'showHidden':![],'depth':null}));};}var _0x46250d=function(_0x8451d1,_0x56cd5e){var _0x1ab44f=squel[_0xec4e('0x34')]()[_0xec4e('0x35')](_0xec4e('0x36'))[_0xec4e('0x37')]([_0xec4e('0x1f'),_0xec4e('0x38'),'ContactId',_0xec4e('0x27'),_0x56cd5e,_0xec4e('0x39'),_0xec4e('0x3a')],squel['select']()[_0xec4e('0x3b')](_0xec4e('0x1f'),_0xec4e('0x1f'))['field'](_0xec4e('0x3c'),_0xec4e('0x38'))['field']('id',_0xec4e('0x3d'))[_0xec4e('0x3b')](LISTID['toString'](),_0xec4e('0x27'))[_0xec4e('0x3b')](_0x8451d1['id']['toString'](),_0x56cd5e)[_0xec4e('0x3b')](_0xec4e('0x3c'),_0xec4e('0x39'))['field'](_0xec4e('0x3c'),_0xec4e('0x3a'))[_0xec4e('0x3e')](_0xec4e('0x3f'))[_0xec4e('0x40')](_0xec4e('0x41'))[_0xec4e('0x40')](_0xec4e('0x42'),LISTID[_0xec4e('0x43')]())[_0xec4e('0x40')](_0xec4e('0x44'))['where'](_0xec4e('0x45'),squel[_0xec4e('0x46')]()['field'](_0xec4e('0x1f'))[_0xec4e('0x3e')](_0xec4e('0x36'))[_0xec4e('0x40')](_0x56cd5e+_0xec4e('0x47'),_0x8451d1['id'][_0xec4e('0x43')]())))[_0xec4e('0x43')]();return _0x1ab44f;};var _0xa56b13=function(_0x1ed235,_0x4c9259){var _0x58599a=squel[_0xec4e('0x34')]()[_0xec4e('0x35')](_0xec4e('0x36'))[_0xec4e('0x37')]([_0xec4e('0x1f'),'scheduledAt',_0xec4e('0x3d'),_0xec4e('0x27'),_0x4c9259,_0xec4e('0x39'),_0xec4e('0x3a')],squel[_0xec4e('0x46')]()['field'](_0xec4e('0x1f'),_0xec4e('0x1f'))[_0xec4e('0x3b')](_0xec4e('0x3c'),_0xec4e('0x38'))['field']('id',_0xec4e('0x3d'))[_0xec4e('0x3b')](LISTID['toString'](),_0xec4e('0x27'))['field'](_0x1ed235['id'][_0xec4e('0x43')](),_0x4c9259)['field'](_0xec4e('0x3c'),_0xec4e('0x39'))['field']('NOW()',_0xec4e('0x3a'))[_0xec4e('0x3e')](_0xec4e('0x3f'))[_0xec4e('0x40')](_0xec4e('0x41'))['where'](_0xec4e('0x42'),LISTID[_0xec4e('0x43')]())[_0xec4e('0x40')]('id\x20IN\x20?',squel[_0xec4e('0x48')](hopperContacts))[_0xec4e('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0xec4e('0x40')](_0xec4e('0x45'),squel[_0xec4e('0x46')]()[_0xec4e('0x3b')]('calleridnum')[_0xec4e('0x3e')](_0xec4e('0x49'))['where'](_0x4c9259+_0xec4e('0x47'),_0x1ed235['id'][_0xec4e('0x43')]()))[_0xec4e('0x40')](_0xec4e('0x45'),squel[_0xec4e('0x46')]()['field'](_0xec4e('0x1f'))[_0xec4e('0x3e')](_0xec4e('0x36'))['where'](_0x4c9259+_0xec4e('0x47'),_0x1ed235['id'][_0xec4e('0x43')]())))[_0xec4e('0x43')]();return _0x58599a;};function _0x45c4bb(_0x26895b,_0x29862a){var _0x101563=squel[_0xec4e('0x34')]()['into'](_0xec4e('0x36'))[_0xec4e('0x37')]([_0xec4e('0x1f'),'scheduledAt',_0xec4e('0x3d'),'ListId',_0x29862a,_0xec4e('0x39'),_0xec4e('0x3a')],squel['select']()[_0xec4e('0x3b')](_0xec4e('0x1f'),'phone')['field'](_0xec4e('0x3c'),'scheduledAt')[_0xec4e('0x3b')]('id',_0xec4e('0x3d'))[_0xec4e('0x3b')](LISTID[_0xec4e('0x43')](),'ListId')['field'](_0x26895b['id'][_0xec4e('0x43')](),_0x29862a)[_0xec4e('0x3b')](_0xec4e('0x3c'),_0xec4e('0x39'))[_0xec4e('0x3b')](_0xec4e('0x3c'),_0xec4e('0x3a'))[_0xec4e('0x3e')](_0xec4e('0x3f'))[_0xec4e('0x40')](_0xec4e('0x41'))[_0xec4e('0x40')](_0xec4e('0x42'),LISTID[_0xec4e('0x43')]())['where'](_0xec4e('0x4a'),squel[_0xec4e('0x48')](hopperContacts))[_0xec4e('0x40')](_0xec4e('0x44')))[_0xec4e('0x43')]();return _0x101563;}function _0x2bcb27(_0x1b99f4,_0x54ff97){var _0x119aef=squel[_0xec4e('0x34')]()[_0xec4e('0x35')](_0xec4e('0x4b'))[_0xec4e('0x37')](['phone','ContactId','ListId',_0x54ff97,_0xec4e('0x39'),'updatedAt'],squel[_0xec4e('0x46')]()[_0xec4e('0x3b')](_0xec4e('0x1f'),_0xec4e('0x1f'))[_0xec4e('0x3b')]('id',_0xec4e('0x3d'))['field'](LISTID[_0xec4e('0x43')](),_0xec4e('0x27'))[_0xec4e('0x3b')](_0x1b99f4['id'][_0xec4e('0x43')](),_0x54ff97)['field'](_0xec4e('0x3c'),_0xec4e('0x39'))['field'](_0xec4e('0x3c'),_0xec4e('0x3a'))[_0xec4e('0x3e')](_0xec4e('0x3f'))[_0xec4e('0x40')](_0xec4e('0x41'))[_0xec4e('0x40')](_0xec4e('0x42'),LISTID[_0xec4e('0x43')]())[_0xec4e('0x40')](_0xec4e('0x4a'),squel[_0xec4e('0x48')](hopperContacts))[_0xec4e('0x40')](_0xec4e('0x44')))[_0xec4e('0x43')]();return _0x119aef;}return db[_0xec4e('0x4c')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xec4e('0x4d')],'include':[{'model':db[_0xec4e('0x4e')],'as':_0xec4e('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x42050b){var _0xf22c4b=[];if(_0x42050b){var _0x2e7878;for(var _0x44bb85=0x0,_0x45c11d;_0x44bb85<_0x42050b['length'];_0x44bb85+=0x1){_0x45c11d=_0x42050b[_0x44bb85]['get']({'plain':!![]});switch(_0x45c11d[_0xec4e('0x4d')]){case _0xec4e('0x50'):_0xf22c4b[_0xec4e('0x2e')](db['sequelize']['query'](_0xa56b13(_0x45c11d,'VoiceQueueId'))[_0xec4e('0x2d')](function(){})[_0xec4e('0x51')](_0x4fef9c()));break;case _0xec4e('0x52'):_0xf22c4b[_0xec4e('0x2e')](db[_0xec4e('0x53')][_0xec4e('0x54')](_0x46250d(_0x45c11d,'VoiceQueueId'))[_0xec4e('0x2d')](function(){})['catch'](_0x4fef9c()));break;default:_0xf22c4b[_0xec4e('0x2e')](db['sequelize']['query'](_0x45c4bb(_0x45c11d,_0xec4e('0x55')))[_0xec4e('0x2d')](function(){})[_0xec4e('0x51')](_0x4fef9c()));}}}return _0xf22c4b;})[_0xec4e('0x56')]()['then'](function(){return db[_0xec4e('0x4c')][_0xec4e('0x57')]({'where':{'type':_0xec4e('0x58')},'attributes':['id'],'include':[{'model':db[_0xec4e('0x4e')],'as':_0xec4e('0x59'),'where':{'id':LISTID}}]})[_0xec4e('0x2d')](function(_0xf8849e){var _0x619b50=[];if(_0xf8849e){var _0x3877c8;for(var _0x1939e0=0x0,_0x2278e2;_0x1939e0<_0xf8849e[_0xec4e('0x19')];_0x1939e0+=0x1){_0x2278e2=_0xf8849e[_0x1939e0][_0xec4e('0x5a')]({'plain':!![]});_0x619b50[_0xec4e('0x2e')](db['sequelize'][_0xec4e('0x54')](_0x2bcb27(_0x2278e2,_0xec4e('0x55')))['then'](function(){})['catch'](_0x4fef9c()));}}return _0x619b50;})[_0xec4e('0x56')]();})[_0xec4e('0x2d')](function(){return db['Campaign'][_0xec4e('0x57')]({'attributes':['id',_0xec4e('0x4d')],'include':[{'model':db[_0xec4e('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xec4e('0x2d')](function(_0x3c04ff){var _0x41c43d=[];if(_0x3c04ff){for(var _0x117856=0x0,_0x954c0b;_0x117856<_0x3c04ff[_0xec4e('0x19')];_0x117856+=0x1){_0x954c0b=_0x3c04ff[_0x117856][_0xec4e('0x5a')]({'plain':!![]});switch(_0x954c0b['dialCheckDuplicateType']){case _0xec4e('0x50'):_0x41c43d[_0xec4e('0x2e')](db[_0xec4e('0x53')][_0xec4e('0x54')](_0xa56b13(_0x954c0b,_0xec4e('0x5b')))[_0xec4e('0x2d')](function(){})['catch'](_0x4fef9c()));break;case _0xec4e('0x52'):_0x41c43d['push'](db[_0xec4e('0x53')][_0xec4e('0x54')](_0x46250d(_0x954c0b,_0xec4e('0x5b')))['then'](function(){})['catch'](_0x4fef9c()));break;default:_0x41c43d[_0xec4e('0x2e')](db[_0xec4e('0x53')][_0xec4e('0x54')](_0x45c4bb(_0x954c0b,_0xec4e('0x5b')))[_0xec4e('0x2d')](function(){})[_0xec4e('0x51')](_0x4fef9c()));}}}return _0x41c43d;})[_0xec4e('0x56')]();})['then'](function(){return db['Campaign'][_0xec4e('0x57')]({'attributes':['id'],'include':[{'model':db[_0xec4e('0x4e')],'as':_0xec4e('0x59'),'where':{'id':LISTID}}]})[_0xec4e('0x2d')](function(_0x1fdcc4){var _0x46012d=[];if(_0x1fdcc4){for(var _0xd6550b=0x0,_0x580405;_0xd6550b<_0x1fdcc4[_0xec4e('0x19')];_0xd6550b+=0x1){_0x580405=_0x1fdcc4[_0xd6550b][_0xec4e('0x5a')]({'plain':!![]});_0x46012d['push'](db['sequelize'][_0xec4e('0x54')](_0x2bcb27(_0x580405,_0xec4e('0x5b')))['then'](function(){})[_0xec4e('0x51')](_0x4fef9c()));}}return _0x46012d;})[_0xec4e('0x56')]();})[_0xec4e('0x51')](function(_0xfbd144){logger[_0xec4e('0x17')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0xfbd144[_0xec4e('0x30')]);});}var processPromises=function(_0x95dfce){return BPromise[_0xec4e('0x56')](promises)['then'](function(_0x43c169){})[_0xec4e('0x51')](function(_0x43264a){logger[_0xec4e('0x17')](_0xec4e('0x5c'),JSON['stringify'](_0x43264a));})[_0xec4e('0x5d')](function(){socket[_0xec4e('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x95dfce){return _0x95dfce[_0xec4e('0x5f')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xec4e('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xec4e('0x2d')](function(){socket[_0xec4e('0x5e')](_0xec4e('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xec4e('0x61')](FILEPATH);}catch(_0x199b0f){logger[_0xec4e('0x17')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x199b0f));}finally{process[_0xec4e('0x62')](0x0);}});};process['on']('SIGINT',function(){logger[_0xec4e('0x63')](_0xec4e('0x64'));endCsv();});function main(){return BPromise[_0xec4e('0x65')]()[_0xec4e('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xec4e('0x2d')](function(_0x1e4916){var _0x3ea6bd=fs[_0xec4e('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xec4e('0x67')](_0x3ea6bd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x423bf6,_0x4894cd){total+=0x1;var _0x425583=total;promises['push'](checkRow(_0x423bf6,_0x1e4916,_0x425583)['then'](function(){success+=0x1;})[_0xec4e('0x51')](function(_0x1f8a60){if(_0x1f8a60[_0xec4e('0x17')]){errors+=0x1;delete _0x1f8a60[_0xec4e('0x17')];}else if(_0x1f8a60[_0xec4e('0x68')]){duplicates+=0x1;delete _0x1f8a60[_0xec4e('0x68')];}rows[_0xec4e('0x2e')](_0x1f8a60);}));if(total%0xc8===0x0){_0x4894cd[_0xec4e('0x69')]();return processPromises(_0x4894cd);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x41068f,_0x50eaac){logger[_0xec4e('0x63')](_0xec4e('0x6a'),JSON['stringify'](_0x41068f));endCsv();}});})[_0xec4e('0x51')](function(_0x383bef){logger[_0xec4e('0x17')](_0xec4e('0x6b'),JSON[_0xec4e('0x31')](_0x383bef));});}main();
\ No newline at end of file
+var _0x85e7=['Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ListId','updatedAt','select','field','ContactId','toString','NOW()','createdAt','from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','insert','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','CmList','get','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','Duplicate\x20Contact','keys','then','catch'];(function(_0x29179f,_0x36a76d){var _0x22239e=function(_0x5515c7){while(--_0x5515c7){_0x29179f['push'](_0x29179f['shift']());}};_0x22239e(++_0x36a76d);}(_0x85e7,0x1e2));var _0x785e=function(_0x40a768,_0x29d68a){_0x40a768=_0x40a768-0x0;var _0x5573a4=_0x85e7[_0x40a768];return _0x5573a4;};'use strict';var BPromise=require('bluebird');var util=require(_0x785e('0x0'));var _=require(_0x785e('0x1'));var fs=require('fs');var squel=require(_0x785e('0x2'));var Papa=require(_0x785e('0x3'));var Redis=require('ioredis');var db=require(_0x785e('0x4'))['db'];var config=require(_0x785e('0x5'));var logger=require(_0x785e('0x6'))(_0x785e('0x7'));config[_0x785e('0x8')]=_[_0x785e('0x9')](config[_0x785e('0x8')],{'host':_0x785e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x785e('0x8')]));require(_0x785e('0xb'))['register'](socket);try{if(!process[_0x785e('0xc')][0x2]||process['argv'][0x2]===_0x785e('0xd')||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x785e('0xc')][0x3]===_0x785e('0xd')||process['argv'][0x3]==='null'||!process[_0x785e('0xc')][0x4]||process[_0x785e('0xc')][0x4]===_0x785e('0xd')||process[_0x785e('0xc')][0x4]===_0x785e('0xe')){throw new Error(_0x785e('0xf'));}var FIELDS=_[_0x785e('0x10')](process[_0x785e('0xc')][0x3][_0x785e('0x11')](','),process['argv'][0x4]['split'](','));if(!process[_0x785e('0xc')][0x5]||process[_0x785e('0xc')][0x5]===_0x785e('0xd')||process[_0x785e('0xc')][0x5]===_0x785e('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x785e('0xc')][0x5];var COMPANYID=process[_0x785e('0xc')][0x6]&&process[_0x785e('0xc')][0x6]!=='undefined'&&process[_0x785e('0xc')][0x6]!==_0x785e('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x785e('0xc')][0x7]&&process[_0x785e('0xc')][0x7]!==_0x785e('0xd')&&process['argv'][0x7]!==_0x785e('0xe')?process['argv'][0x7]:null;if(!process[_0x785e('0xc')][0x8]||process['argv'][0x8]===_0x785e('0xd')||process[_0x785e('0xc')][0x8]===_0x785e('0xe')){throw new Error(_0x785e('0x12'));}var SOCKET_TIMESTAMP=process[_0x785e('0xc')][0x8];}catch(_0x1cb211){logger['error'](_0x1cb211);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(_0x576f,_0x12f09d,_0x2964d6,_0x13e255){var _0x4b4300={'message':_0x12f09d};_0x4b4300[_0x576f]=!![];if(_0x2964d6){_0x4b4300[_0x785e('0x13')]=_0x2964d6;}if(_0x13e255){_0x4b4300[_0x785e('0x14')]=_0x13e255;}return _0x4b4300;}function isEmail(_0x4114f2){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))*$/[_0x785e('0x15')](_0x4114f2);}function checkRow(_0x3ac4e5,_0x1fd172,_0x6deff4){return new BPromise(function(_0x5d7e32,_0x1a55c5){if(_[_0x785e('0x16')](_0x3ac4e5)){return _0x1a55c5(handleCheckRowError(_0x785e('0x17'),_0x785e('0x18'),null,_0x6deff4));}if(_0x3ac4e5[_0x785e('0x19')]&&_0x3ac4e5['errors'][_0x785e('0x1a')]){var _0x147e5c=_['map'](_0x3ac4e5['errors'],'message')[_0x785e('0x1b')](';');return _0x1a55c5(handleCheckRowError('error',_0x147e5c,null,_0x6deff4));}var _0x3e06a4={};for(var _0x9b56a7 in FIELDS){if(FIELDS['hasOwnProperty'](_0x9b56a7)&&FIELDS[_0x9b56a7]){_0x3e06a4[_0x9b56a7]=_0x3ac4e5['data'][0x0][FIELDS[_0x9b56a7]]||_0x3ac4e5['data'][0x0]['\ufeff'+FIELDS[_0x9b56a7]];}}if(!_0x3e06a4[_0x785e('0x1c')]){return _0x1a55c5(handleCheckRowError('error',_0x785e('0x1d'),null,_0x6deff4));}if(!_0x3e06a4[_0x785e('0x1e')]){return _0x1a55c5(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x6deff4));}if(_0x3e06a4[_0x785e('0x1f')]){var _0xeb66c5=moment(_0x3e06a4['birthDate'],_0x785e('0x20'));if(!_0xeb66c5[_0x785e('0x21')]()){return _0x1a55c5(handleCheckRowError(_0x785e('0x17'),_0x785e('0x22'),null,_0x6deff4));}}if(_0x3e06a4['email']){if(!isEmail(_0x3e06a4[_0x785e('0x23')])){return _0x1a55c5(handleCheckRowError('error',_0x785e('0x24'),null,_0x6deff4));}}_0x3e06a4['ListId']=LISTID;_0x3e06a4[_0x785e('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x785e('0x1a')]&&_0x1fd172){var _0xed62b3={};for(var _0x4e1360=0x0,_0x80f018=DUPLICATES[_0x785e('0x1a')];_0x4e1360<_0x80f018;_0x4e1360+=0x1){_0xed62b3[DUPLICATES[_0x4e1360]]=_0x3e06a4[DUPLICATES[_0x4e1360]];}var _0x9ed4d8=_[_0x785e('0x26')](_0x1fd172,_0xed62b3);if(_0x9ed4d8){return _0x1a55c5(handleCheckRowError('duplicate',_0x785e('0x27'),_0x9ed4d8,_0x6deff4));}}return db['CmContact']['create'](_0x3e06a4,{'raw':!![],'hooks':![],'fields':_[_0x785e('0x28')](_0x3e06a4)})[_0x785e('0x29')](function(_0x737d44){if(DUPLICATES&&DUPLICATES[_0x785e('0x1a')]&&_0x1fd172){_0x1fd172['push'](_['pick'](_0x3e06a4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x737d44['id'];return _0x5d7e32();})[_0x785e('0x2a')](function(_0x5ea538){return _0x1a55c5(handleCheckRowError('error',_0x785e('0x2b')+(_0x5ea538[_0x785e('0x2c')]||JSON[_0x785e('0x2d')](_0x5ea538)),null,_0x6deff4));});});}function checkHopper(){function _0x23b5e0(){return function(_0x184da9){logger[_0x785e('0x17')](_0x785e('0x2e'),_0x785e('0x2f'),util[_0x785e('0x30')](_0x184da9,{'showHidden':![],'depth':null}));};}var _0x4c856f=function(_0x12f8fe,_0x19e4a2){var _0x1dab7e=squel['insert']()[_0x785e('0x31')](_0x785e('0x32'))[_0x785e('0x33')]([_0x785e('0x1e'),_0x785e('0x34'),'ContactId',_0x785e('0x35'),_0x19e4a2,'createdAt',_0x785e('0x36')],squel[_0x785e('0x37')]()[_0x785e('0x38')]('phone','phone')[_0x785e('0x38')]('NOW()',_0x785e('0x34'))[_0x785e('0x38')]('id',_0x785e('0x39'))[_0x785e('0x38')](LISTID[_0x785e('0x3a')](),_0x785e('0x35'))[_0x785e('0x38')](_0x12f8fe['id'][_0x785e('0x3a')](),_0x19e4a2)['field'](_0x785e('0x3b'),_0x785e('0x3c'))[_0x785e('0x38')]('NOW()',_0x785e('0x36'))[_0x785e('0x3d')]('cm_contacts')[_0x785e('0x3e')](_0x785e('0x3f'))[_0x785e('0x3e')]('ListId\x20=\x20?',LISTID[_0x785e('0x3a')]())[_0x785e('0x3e')](_0x785e('0x40'))[_0x785e('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x785e('0x38')](_0x785e('0x1e'))[_0x785e('0x3d')](_0x785e('0x32'))['where'](_0x19e4a2+_0x785e('0x41'),_0x12f8fe['id'][_0x785e('0x3a')]())))[_0x785e('0x3a')]();return _0x1dab7e;};var _0x4e9bd0=function(_0x554b75,_0x3e7072){var _0x4a0952=squel[_0x785e('0x42')]()[_0x785e('0x31')](_0x785e('0x32'))['fromQuery']([_0x785e('0x1e'),_0x785e('0x34'),'ContactId',_0x785e('0x35'),_0x3e7072,_0x785e('0x3c'),_0x785e('0x36')],squel[_0x785e('0x37')]()[_0x785e('0x38')](_0x785e('0x1e'),_0x785e('0x1e'))['field'](_0x785e('0x3b'),_0x785e('0x34'))[_0x785e('0x38')]('id',_0x785e('0x39'))[_0x785e('0x38')](LISTID[_0x785e('0x3a')](),_0x785e('0x35'))[_0x785e('0x38')](_0x554b75['id'][_0x785e('0x3a')](),_0x3e7072)[_0x785e('0x38')](_0x785e('0x3b'),'createdAt')[_0x785e('0x38')](_0x785e('0x3b'),'updatedAt')[_0x785e('0x3d')](_0x785e('0x43'))[_0x785e('0x3e')]('deletedAt\x20IS\x20NULL')[_0x785e('0x3e')](_0x785e('0x44'),LISTID[_0x785e('0x3a')]())[_0x785e('0x3e')](_0x785e('0x45'),squel[_0x785e('0x46')](hopperContacts))[_0x785e('0x3e')](_0x785e('0x40'))[_0x785e('0x3e')](_0x785e('0x47'),squel[_0x785e('0x37')]()['field']('calleridnum')[_0x785e('0x3d')](_0x785e('0x48'))[_0x785e('0x3e')](_0x3e7072+_0x785e('0x41'),_0x554b75['id'][_0x785e('0x3a')]()))[_0x785e('0x3e')](_0x785e('0x47'),squel[_0x785e('0x37')]()[_0x785e('0x38')](_0x785e('0x1e'))[_0x785e('0x3d')](_0x785e('0x32'))['where'](_0x3e7072+'\x20=\x20?',_0x554b75['id']['toString']())))[_0x785e('0x3a')]();return _0x4a0952;};function _0x314447(_0x263c2d,_0x12f9b5){var _0x4af125=squel[_0x785e('0x42')]()[_0x785e('0x31')]('cm_hopper')['fromQuery']([_0x785e('0x1e'),_0x785e('0x34'),_0x785e('0x39'),'ListId',_0x12f9b5,_0x785e('0x3c'),_0x785e('0x36')],squel['select']()['field']('phone',_0x785e('0x1e'))['field'](_0x785e('0x3b'),_0x785e('0x34'))[_0x785e('0x38')]('id',_0x785e('0x39'))[_0x785e('0x38')](LISTID[_0x785e('0x3a')](),_0x785e('0x35'))[_0x785e('0x38')](_0x263c2d['id'][_0x785e('0x3a')](),_0x12f9b5)[_0x785e('0x38')](_0x785e('0x3b'),'createdAt')[_0x785e('0x38')](_0x785e('0x3b'),_0x785e('0x36'))['from'](_0x785e('0x43'))[_0x785e('0x3e')](_0x785e('0x3f'))[_0x785e('0x3e')](_0x785e('0x44'),LISTID['toString']())[_0x785e('0x3e')](_0x785e('0x45'),squel[_0x785e('0x46')](hopperContacts))['where'](_0x785e('0x40')))[_0x785e('0x3a')]();return _0x4af125;}function _0x185418(_0x546359,_0xe3f11d){var _0x169fc9=squel['insert']()['into'](_0x785e('0x49'))[_0x785e('0x33')]([_0x785e('0x1e'),'ContactId',_0x785e('0x35'),_0xe3f11d,'createdAt','updatedAt'],squel[_0x785e('0x37')]()['field'](_0x785e('0x1e'),'phone')[_0x785e('0x38')]('id','ContactId')[_0x785e('0x38')](LISTID[_0x785e('0x3a')](),_0x785e('0x35'))['field'](_0x546359['id'][_0x785e('0x3a')](),_0xe3f11d)[_0x785e('0x38')](_0x785e('0x3b'),_0x785e('0x3c'))[_0x785e('0x38')](_0x785e('0x3b'),_0x785e('0x36'))[_0x785e('0x3d')]('cm_contacts')['where'](_0x785e('0x3f'))[_0x785e('0x3e')](_0x785e('0x44'),LISTID[_0x785e('0x3a')]())['where'](_0x785e('0x45'),squel['str'](hopperContacts))[_0x785e('0x3e')](_0x785e('0x40')))['toString']();return _0x169fc9;}return db[_0x785e('0x4a')][_0x785e('0x4b')]({'where':{'type':_0x785e('0x4c')},'attributes':['id',_0x785e('0x4d')],'include':[{'model':db['CmList'],'as':_0x785e('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x457ce6){var _0x44d18a=[];if(_0x457ce6){var _0x45e718;for(var _0x20f215=0x0,_0x28bf57;_0x20f215<_0x457ce6['length'];_0x20f215+=0x1){_0x28bf57=_0x457ce6[_0x20f215]['get']({'plain':!![]});switch(_0x28bf57[_0x785e('0x4d')]){case _0x785e('0x4f'):_0x44d18a[_0x785e('0x50')](db[_0x785e('0x51')][_0x785e('0x52')](_0x4e9bd0(_0x28bf57,_0x785e('0x53')))['then'](function(){})[_0x785e('0x2a')](_0x23b5e0()));break;case _0x785e('0x54'):_0x44d18a[_0x785e('0x50')](db['sequelize'][_0x785e('0x52')](_0x4c856f(_0x28bf57,_0x785e('0x53')))[_0x785e('0x29')](function(){})['catch'](_0x23b5e0()));break;default:_0x44d18a[_0x785e('0x50')](db['sequelize'][_0x785e('0x52')](_0x314447(_0x28bf57,_0x785e('0x53')))['then'](function(){})['catch'](_0x23b5e0()));}}}return _0x44d18a;})['all']()[_0x785e('0x29')](function(){return db[_0x785e('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x785e('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x785e('0x29')](function(_0x44c787){var _0x135a97=[];if(_0x44c787){var _0x11d858;for(var _0x4f6a50=0x0,_0xaa0234;_0x4f6a50<_0x44c787[_0x785e('0x1a')];_0x4f6a50+=0x1){_0xaa0234=_0x44c787[_0x4f6a50][_0x785e('0x56')]({'plain':!![]});_0x135a97[_0x785e('0x50')](db[_0x785e('0x51')][_0x785e('0x52')](_0x185418(_0xaa0234,_0x785e('0x53')))[_0x785e('0x29')](function(){})[_0x785e('0x2a')](_0x23b5e0()));}}return _0x135a97;})[_0x785e('0x57')]();})[_0x785e('0x29')](function(){return db[_0x785e('0x58')][_0x785e('0x4b')]({'attributes':['id',_0x785e('0x4d')],'include':[{'model':db['CmList'],'as':_0x785e('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x3f8914){var _0x1048d9=[];if(_0x3f8914){for(var _0x3ea122=0x0,_0x25bff3;_0x3ea122<_0x3f8914[_0x785e('0x1a')];_0x3ea122+=0x1){_0x25bff3=_0x3f8914[_0x3ea122][_0x785e('0x56')]({'plain':!![]});switch(_0x25bff3[_0x785e('0x4d')]){case _0x785e('0x4f'):_0x1048d9[_0x785e('0x50')](db[_0x785e('0x51')]['query'](_0x4e9bd0(_0x25bff3,'CampaignId'))[_0x785e('0x29')](function(){})[_0x785e('0x2a')](_0x23b5e0()));break;case _0x785e('0x54'):_0x1048d9[_0x785e('0x50')](db[_0x785e('0x51')][_0x785e('0x52')](_0x4c856f(_0x25bff3,_0x785e('0x59')))[_0x785e('0x29')](function(){})[_0x785e('0x2a')](_0x23b5e0()));break;default:_0x1048d9[_0x785e('0x50')](db[_0x785e('0x51')][_0x785e('0x52')](_0x314447(_0x25bff3,'CampaignId'))[_0x785e('0x29')](function(){})['catch'](_0x23b5e0()));}}}return _0x1048d9;})[_0x785e('0x57')]();})[_0x785e('0x29')](function(){return db[_0x785e('0x58')][_0x785e('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x785e('0x55')],'as':_0x785e('0x5a'),'where':{'id':LISTID}}]})[_0x785e('0x29')](function(_0x438472){var _0xe0907d=[];if(_0x438472){for(var _0x3ff113=0x0,_0x5ea39c;_0x3ff113<_0x438472['length'];_0x3ff113+=0x1){_0x5ea39c=_0x438472[_0x3ff113][_0x785e('0x56')]({'plain':!![]});_0xe0907d[_0x785e('0x50')](db[_0x785e('0x51')][_0x785e('0x52')](_0x185418(_0x5ea39c,_0x785e('0x59')))['then'](function(){})[_0x785e('0x2a')](_0x23b5e0()));}}return _0xe0907d;})[_0x785e('0x57')]();})['catch'](function(_0xae5a6a){logger[_0x785e('0x17')](_0x785e('0x5b'),_0x785e('0x5c'),_0xae5a6a['message']);});}var processPromises=function(_0x4b0495){return BPromise['all'](promises)[_0x785e('0x29')](function(_0x49bb52){})[_0x785e('0x2a')](function(_0x149ec9){logger[_0x785e('0x17')]('Error\x20processing\x20rows\x20block:',JSON[_0x785e('0x2d')](_0x149ec9));})[_0x785e('0x5d')](function(){socket[_0x785e('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b0495){return _0x4b0495[_0x785e('0x5f')]();}});};var endCsv=function(){return BPromise[_0x785e('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x785e('0x29')](function(){socket[_0x785e('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x51ea88){logger[_0x785e('0x17')](_0x785e('0x61'),JSON[_0x785e('0x2d')](_0x51ea88));}finally{process[_0x785e('0x62')](0x0);}});};process['on'](_0x785e('0x63'),function(){logger[_0x785e('0x64')](_0x785e('0x65'));endCsv();});function main(){return BPromise[_0x785e('0x60')]()[_0x785e('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x785e('0x11')](',');return db['CmContact'][_0x785e('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x785e('0x29')](function(_0x2a5ffc){var _0xc9ba1a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0xc9ba1a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x15ab90,_0x5a7adb){total+=0x1;var _0x4e8593=total;promises[_0x785e('0x50')](checkRow(_0x15ab90,_0x2a5ffc,_0x4e8593)[_0x785e('0x29')](function(){success+=0x1;})[_0x785e('0x2a')](function(_0x582fb6){if(_0x582fb6[_0x785e('0x17')]){errors+=0x1;delete _0x582fb6['error'];}else if(_0x582fb6['duplicate']){duplicates+=0x1;delete _0x582fb6['duplicate'];}rows[_0x785e('0x50')](_0x582fb6);}));if(total%0xc8===0x0){_0x5a7adb['pause']();return processPromises(_0x5a7adb);}},'complete':function(){return processPromises()[_0x785e('0x29')](function(){logger[_0x785e('0x64')](_0x785e('0x66'));endCsv();});},'error':function(_0x589895,_0xc2b77b){logger[_0x785e('0x64')](_0x785e('0x67'),JSON[_0x785e('0x2d')](_0x589895));endCsv();}});})[_0x785e('0x2a')](function(_0x1f8d4e){logger[_0x785e('0x17')](_0x785e('0x68'),JSON[_0x785e('0x2d')](_0x1f8d4e));});}main();
\ No newline at end of file
index c981060..b7f637a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf93c=['cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','message','exit','errors','info','sequelize','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','header','name','_description','writeFileSync','parse','createReadStream','data','rows','find','trim','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','replace','itemTypeId','description','appendFileSync','emit','Abort\x20parser','abort','SystemError','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','duplicates','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','campaigns','DROP\x20TABLE\x20','finish','affectedRows','contact:import:','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','all','split','length','isNil','filter','push','CmContactHasItem','findOne','update','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','insert','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','recallme','select','fields','from','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','into','cm_hopper_black','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','priority','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items'];(function(_0x4d2491,_0x315ba2){var _0xa23121=function(_0x697c4a){while(--_0x697c4a){_0x4d2491['push'](_0x4d2491['shift']());}};_0xa23121(++_0x315ba2);}(_0xf93c,0x1e2));var _0xcf93=function(_0x1c42cb,_0x282913){_0x1c42cb=_0x1c42cb-0x0;var _0x440b02=_0xf93c[_0x1c42cb];return _0x440b02;};'use strict';var fs=require('fs');var path=require(_0xcf93('0x0'));var _=require('lodash');var Papa=require(_0xcf93('0x1'));var util=require(_0xcf93('0x2'));var BPromise=require(_0xcf93('0x3'));var moment=require(_0xcf93('0x4'));var squel=require(_0xcf93('0x5'));var Redis=require('ioredis');var db=require(_0xcf93('0x6'))['db'];var config=require(_0xcf93('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0xcf93('0x8'))(_0xcf93('0x9'));config[_0xcf93('0xa')]=_[_0xcf93('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcf93('0xc'))(new Redis(config[_0xcf93('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xcf93('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x127fb3){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))*$/[_0xcf93('0xe')](_0x127fb3);}function selectNotIn(_0x2893de,_0x2a9d18,_0xbc8e8a,_0xffda6b,_0x40647d){return squel['select']()[_0xcf93('0xf')](_0xcf93('0x10'))['from'](_0xffda6b)[_0xcf93('0x11')](_0x2a9d18,null,_0x2a9d18+_0xcf93('0x12')+_0xffda6b+'.'+_0xbc8e8a)[_0xcf93('0x13')](_0xffda6b+'.'+_0xbc8e8a+'\x20=\x20'+_0x2893de+'.'+_0xbc8e8a)[_0xcf93('0x13')](_0x2a9d18+_0xcf93('0x14')+_0x40647d[_0xcf93('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3a82cb,_0x1ece40){promisesAdditionalPhones=[];return db[_0xcf93('0x15')][_0xcf93('0x16')]({'raw':!![],'attributes':['id',_0xcf93('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xcf93('0x18')](function(_0x235cc4){if(_0x235cc4!==null){var _0x131967=[];for(var _0x3188ab=0x0;_0x3188ab<_0x235cc4['length'];_0x3188ab++){var _0x4a9244=_0x235cc4[_0x3188ab];_0x131967['push'](insertAdditionalPhones(_0x4a9244));}}Promise[_0xcf93('0x19')](_0x131967)[_0xcf93('0x18')](function(){_0x3a82cb({'val':0x1});});});});}function insertAdditionalPhones(_0x1203ac){return new Promise(function(_0x377bac,_0x4f735e){var _0x89867c=_0x1203ac[_0xcf93('0x17')];var _0x4b6504=_0x89867c[_0xcf93('0x1a')](';');var _0x38f3ad=[];orderBy=0x0;for(var _0xff6fa3=0x0;_0xff6fa3<_0x4b6504[_0xcf93('0x1b')];_0xff6fa3++){_0x38f3ad['push'](splitAdditionalPhone(_0x1203ac['id'],_0x4b6504[_0xff6fa3]));}Promise['all'](_0x38f3ad)[_0xcf93('0x18')](function(){_0x377bac({'val':_0x4b6504['length']});});});}function splitAdditionalPhone(_0x298d0e,_0x1ddd93){return new Promise(function(_0x62c04d,_0x16d6ae){var _0x5e9f4b=_0x1ddd93['split'](':');var _0x1ea0d1=_0x5e9f4b[0x0];var _0x5272ba=_0x5e9f4b[0x1];if(!_[_0xcf93('0x1c')](_0x5272ba)){var _0x11b660=_0x5272ba['split']('|');var _0x500f51=[];for(var _0x1c2f1e=0x0;_0x1c2f1e<_0x11b660[_0xcf93('0x1b')];_0x1c2f1e++){if(_0x11b660[_0x1c2f1e]!==''){var _0x44b784=_[_0xcf93('0x1d')](promisesAdditionalPhones,{'contactId':_0x298d0e,'phone':_0x11b660[_0x1c2f1e]});if(_0x44b784[_0xcf93('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xcf93('0x1e')]({'contactId':_0x298d0e,'contactTypeId':_0x1ea0d1,'phone':_0x11b660[_0x1c2f1e],'orderBy':orderBy});}}}_0x62c04d({'ok':0x1});}else _0x62c04d({'res':0x0});});}function createAdditionalPhone(_0x3aba1a,_0x2fb2c4,_0x4bec07,_0x22366b){var _0x1cd448='';var _0x41914a='';var _0x50dcd6=_0x4bec07[_0xcf93('0x1a')]('§');_0x1cd448=_0x50dcd6[0x0];if(_0x50dcd6['length']==0x2)_0x41914a=_0x50dcd6[0x1];return new Promise(function(_0x33af92,_0x4210d3){return db[_0xcf93('0x1f')][_0xcf93('0x20')]({'where':{'CmContactId':_0x3aba1a,'item':_0x1cd448}})['then'](function(_0x3f3e61){if(_0x3f3e61){return db[_0xcf93('0x1f')][_0xcf93('0x21')]({'ItemTypeId':_0x2fb2c4,'description':_0x41914a,'OrderBy':_0x22366b},{'where':{'CmContactId':_0x3aba1a,'item':_0x1cd448}})['then'](function(_0x271295){_0x33af92({'res':'updated'});});}else{return db['CmContactHasItem'][_0xcf93('0x22')]({'CmContactId':_0x3aba1a,'item':_0x1cd448,'description':_0x41914a,'ItemTypeId':_0x2fb2c4,'OrderBy':_0x22366b,'ItemClass':_0xcf93('0x23')})['then'](function(_0x5b4a16){_0x33af92({'res':_0xcf93('0x24')});});}});});}function insertCmHopper(_0x2bc093,_0x246742,_0x72151d,_0x491d7d,_0x21eb06){var _0x404887=[_0xcf93('0x25'),_0xcf93('0x26'),_0xcf93('0x27'),_0xcf93('0x28'),_0x246742+'.'+_0x491d7d,_0xcf93('0x29'),_0xcf93('0x2a'),_0xcf93('0x2b'),_0xcf93('0x2c'),'\x22'+_0x21eb06+'\x22'];return squel[_0xcf93('0x2d')]()['into'](_0xcf93('0x2e'))[_0xcf93('0x2f')](['phone','scheduledat',_0xcf93('0x30'),_0xcf93('0x31'),_0x491d7d,_0xcf93('0x32'),_0xcf93('0x33'),'priority',_0xcf93('0x34'),_0xcf93('0x35')],squel[_0xcf93('0x36')]()[_0xcf93('0x37')](_0x404887)[_0xcf93('0x38')](_0x246742)[_0xcf93('0x11')]('cm_contacts',null,_0xcf93('0x39')+_0x246742+'.CmListId')[_0xcf93('0x11')](_0x72151d,null,_0x72151d+'.id\x20=\x20'+_0x246742+'.'+_0x491d7d)[_0xcf93('0x13')](_0x246742+_0xcf93('0x3a'),_0x2bc093)[_0xcf93('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcf93('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x246742,_0x72151d,_0x491d7d,_0xcf93('0x2e'),[_0xcf93('0x3b'),_0xcf93('0x3c')]))[_0xcf93('0x13')](_0xcf93('0x3d'),selectNotIn(_0x246742,_0x72151d,_0x491d7d,_0xcf93('0x2e'),[_0xcf93('0x3b')])))[_0xcf93('0x3e')]();}function insertCmHopperBlack(_0x1c8902,_0x5c2836,_0x5b0833,_0x33fab9){var _0x265ed0=['cm_contacts.phone','cm_contacts.id',_0xcf93('0x28'),_0x5c2836+'.'+_0x33fab9,_0xcf93('0x29'),_0xcf93('0x2a')];return squel[_0xcf93('0x2d')]()[_0xcf93('0x3f')](_0xcf93('0x40'))[_0xcf93('0x2f')]([_0xcf93('0x10'),'ContactId',_0xcf93('0x31'),_0x33fab9,'createdAt',_0xcf93('0x33')],squel[_0xcf93('0x36')]()[_0xcf93('0x37')](_0x265ed0)['from'](_0x5c2836)['join'](_0xcf93('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x5c2836+_0xcf93('0x42'))[_0xcf93('0x11')](_0x5b0833,null,_0x5b0833+_0xcf93('0x12')+_0x5c2836+'.'+_0x33fab9)[_0xcf93('0x13')](_0x5c2836+'.CmListId\x20=\x20?',_0x1c8902)[_0xcf93('0x13')](_0xcf93('0x43'),NOW)[_0xcf93('0x13')](_0xcf93('0x3d'),squel[_0xcf93('0x36')]()[_0xcf93('0xf')](_0xcf93('0x10'))[_0xcf93('0x38')](_0xcf93('0x40'))[_0xcf93('0x13')](_0xcf93('0x44'),_0x1c8902)[_0xcf93('0x13')](_0x33fab9+_0xcf93('0x45')+_0x5c2836+'.'+_0x33fab9)))[_0xcf93('0x3e')]();}function insertTzCmHopper(_0x5c7f81,_0x1cc90c,_0x35bfe8,_0x450a38,_0x2b7116,_0x28c2ec){var _0x3c7272=[_0xcf93('0x25'),_0xcf93('0x46')+_0x28c2ec+_0xcf93('0x47'),_0xcf93('0x27'),_0xcf93('0x28'),_0x1cc90c+'.'+_0x450a38,_0xcf93('0x29'),_0xcf93('0x2a'),_0xcf93('0x2b'),_0xcf93('0x2c'),'\x22'+_0x2b7116+'\x22'];var _0x4db136=squel['insert']()[_0xcf93('0x3f')](_0xcf93('0x2e'))['fromQuery']([_0xcf93('0x10'),'scheduledat',_0xcf93('0x30'),_0xcf93('0x31'),_0x450a38,'createdAt',_0xcf93('0x33'),_0xcf93('0x48'),_0xcf93('0x34'),'recallme'],squel['select']()['fields'](_0x3c7272)[_0xcf93('0x38')](_0x1cc90c)[_0xcf93('0x11')](_0xcf93('0x41'),null,'cm_contacts.ListId\x20=\x20'+_0x1cc90c+_0xcf93('0x42'))[_0xcf93('0x11')](_0x35bfe8,null,_0x35bfe8+_0xcf93('0x12')+_0x1cc90c+'.'+_0x450a38)[_0xcf93('0x11')](_0x28c2ec,null,_0x28c2ec+_0xcf93('0x12')+_0x1cc90c+'.'+_0x450a38)[_0xcf93('0x13')](_0x1cc90c+_0xcf93('0x3a'),_0x5c7f81)[_0xcf93('0x13')](_0xcf93('0x43'),NOW)[_0xcf93('0x13')](_0xcf93('0x3d'),selectNotIn(_0x1cc90c,_0x35bfe8,_0x450a38,_0xcf93('0x2e'),['\x22always\x22',_0xcf93('0x3c')]))[_0xcf93('0x13')](_0xcf93('0x3d'),selectNotIn(_0x1cc90c,_0x35bfe8,_0x450a38,'cm_hopper',[_0xcf93('0x3b')])))[_0xcf93('0x3e')]();return _0x4db136;}function insertTzCmHopperBlack(_0x4191b1,_0x207fb5,_0x13ff19,_0x5188a3){var _0x2753ec=['cm_contacts.phone','cm_contacts.id',_0xcf93('0x28'),_0x207fb5+'.'+_0x5188a3,_0xcf93('0x29'),_0xcf93('0x2a')];return squel['insert']()[_0xcf93('0x3f')](_0xcf93('0x40'))[_0xcf93('0x2f')]([_0xcf93('0x10'),'ContactId',_0xcf93('0x31'),_0x5188a3,_0xcf93('0x32'),'updatedAt'],squel[_0xcf93('0x36')]()[_0xcf93('0x37')](_0x2753ec)[_0xcf93('0x38')](_0x207fb5)[_0xcf93('0x11')](_0xcf93('0x41'),null,_0xcf93('0x39')+_0x207fb5+_0xcf93('0x42'))[_0xcf93('0x11')](_0x13ff19,null,_0x13ff19+_0xcf93('0x12')+_0x207fb5+'.'+_0x5188a3)[_0xcf93('0x13')](_0x207fb5+'.CmListId\x20=\x20?',_0x4191b1)[_0xcf93('0x13')](_0xcf93('0x43'),NOW)[_0xcf93('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xcf93('0xf')](_0xcf93('0x10'))['from'](_0xcf93('0x40'))[_0xcf93('0x13')](_0xcf93('0x44'),_0x4191b1)[_0xcf93('0x13')](_0x5188a3+_0xcf93('0x45')+_0x207fb5+'.'+_0x5188a3)))[_0xcf93('0x3e')]();}function insertCmHopperAdditionalPhones(_0xe64191){var _0x37193a=[_0xcf93('0x49'),_0xcf93('0x4a'),_0xcf93('0x4b'),_0xcf93('0x4c'),_0xcf93('0x4d')];return squel['insert']()['into'](_0xcf93('0x4e'))[_0xcf93('0x2f')]([_0xcf93('0x4f'),_0xcf93('0x10'),_0xcf93('0x50'),'createdAt','updatedAt'],squel[_0xcf93('0x36')]()[_0xcf93('0x37')](_0x37193a)[_0xcf93('0x38')](_0xcf93('0x2e'))['join'](_0xcf93('0x41'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xcf93('0x11')](_0xcf93('0x51'),null,_0xcf93('0x52'))['where'](_0xcf93('0x53'),_0xe64191)[_0xcf93('0x13')](_0xcf93('0x43'),NOW))[_0xcf93('0x3e')]();}function insertCmContact(_0x52e17c,_0x4debfe,_0x2d0ca5,_0x154ade){var _0x3b7e8c=_[_0xcf93('0x54')](_[_0xcf93('0x55')](_0x154ade),['ListId',_0xcf93('0x56'),_0xcf93('0x32'),_0xcf93('0x33'),_0xcf93('0x57')]);return squel['insert']()['into'](_0xcf93('0x41'))[_0xcf93('0x2f')](_0x3b7e8c,squel[_0xcf93('0x36')]()[_0xcf93('0x37')](_0x3b7e8c)['from'](_0x4debfe)[_0xcf93('0x13')]('('+_0x2d0ca5['join'](',')+_0xcf93('0x58'),squel[_0xcf93('0x36')]()['fields'](_0x2d0ca5)[_0xcf93('0x38')](_0xcf93('0x41'))['where'](_0xcf93('0x44'),_0x52e17c)[_0xcf93('0x13')](_0xcf93('0x59')))[_0xcf93('0x13')](_0xcf93('0x5a'),squel[_0xcf93('0x36')]()[_0xcf93('0xf')](_0xcf93('0x5b'),'min_id')[_0xcf93('0x38')](_0x4debfe)[_0xcf93('0x5c')](_0x2d0ca5[_0xcf93('0x11')](','))))[_0xcf93('0x3e')]();}function handleStop(){logger['info'](_0xcf93('0x5d'));stopped=!![];}function handleUncaughtException(_0x3a429a){logger[_0xcf93('0x5e')](_0x3a429a[_0xcf93('0x5f')]);process[_0xcf93('0x60')](0x1);}function handleError(_0x5e0fad,_0x258d54){stats[_0xcf93('0x61')][_0xcf93('0x1e')]({'name':_0x258d54['code'],'message':_0x258d54['message'],'row':_0x5e0fad});}function handleQuery(_0x538f3e){logger[_0xcf93('0x62')](_0x538f3e);return db[_0xcf93('0x63')]['query'](_0x538f3e)['spread'](function(_0x193e36){results[_0xcf93('0x1e')](_0x193e36);})[_0xcf93('0x64')](function(_0x2c9dba){logger['error'](_0x2c9dba[_0xcf93('0x5f')]);});}function updateTzCampaigns(_0x32cc3a){return new Promise(function(_0x26bd1d,_0x3c9799){var _0x55d615=squel[_0xcf93('0x36')]()['fields']([_0xcf93('0x65'),_0xcf93('0x66')])[_0xcf93('0x38')]('campaigns')[_0xcf93('0x11')](_0xcf93('0x67'),null,_0xcf93('0x68'))['where']('campaigns_has_cm_lists.CmListId='+_0x32cc3a);db[_0xcf93('0x63')][_0xcf93('0x69')](_0x55d615[_0xcf93('0x3e')]())[_0xcf93('0x6a')](function(_0x13edc0){var _0x2e7cde=[];for(var _0x109e1d=0x0;_0x109e1d<_0x13edc0['length'];_0x109e1d++){_0x2e7cde[_0xcf93('0x1e')](getTimezoneData(_0x13edc0[_0x109e1d],tmp_campaigns));}BPromise['all'](_0x2e7cde)[_0xcf93('0x18')](function(){_0x26bd1d({'val':0x1});});})[_0xcf93('0x64')](function(_0x1caff8){logger[_0xcf93('0x5e')](_0x1caff8[_0xcf93('0x5f')]);_0x26bd1d({'val':0x0});});});}function updateTzVoiceQueues(_0x10b2a6){return new Promise(function(_0x1a6d1e,_0x6d06c0){var _0xb4d425=squel[_0xcf93('0x36')]()[_0xcf93('0x37')]([_0xcf93('0x6b'),_0xcf93('0x6c')])[_0xcf93('0x38')](_0xcf93('0x6d'))[_0xcf93('0x11')](_0xcf93('0x6e'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xcf93('0x13')](_0xcf93('0x6f')+_0x10b2a6);db['sequelize'][_0xcf93('0x69')](_0xb4d425[_0xcf93('0x3e')]())[_0xcf93('0x6a')](function(_0x316c41){var _0x3590e7=[];for(var _0x2a9f7b=0x0;_0x2a9f7b<_0x316c41['length'];_0x2a9f7b++){_0x3590e7[_0xcf93('0x1e')](getTimezoneData(_0x316c41[_0x2a9f7b],tmp_voice_queues));}BPromise[_0xcf93('0x19')](_0x3590e7)[_0xcf93('0x18')](function(){_0x1a6d1e({'val':0x1});});})[_0xcf93('0x64')](function(_0x4bdfab){logger['error'](_0x4bdfab[_0xcf93('0x5f')]);_0x1a6d1e({'val':0x0});});});}function getTimezoneData(_0x4af894,_0x4eda4e){return new Promise(function(_0x5438f4,_0xdccbd3){var _0x5ad005=shared[_0xcf93('0x70')];var _0x4bdd9c=_0x5ad005[_0x4af894[_0xcf93('0x71')]];if(_['isNil'](_0x4bdd9c)){_0x5438f4({'ret':0x1});}else{var _0x3aef64=_0x4bdd9c[_0xcf93('0x72')];var _0x24f474=squel['insert']()['into'](_0x4eda4e)[_0xcf93('0x73')]('id',_0x4af894['id'])[_0xcf93('0x73')](_0xcf93('0x74'),_0x3aef64)[_0xcf93('0x73')](_0xcf93('0x71'),_0x4af894['dialTimezone'])[_0xcf93('0x3e')]();return db['sequelize']['query'](_0x24f474)[_0xcf93('0x6a')](function(_0x38fd0b){_0x5438f4({'ret':0x1});})[_0xcf93('0x64')](function(_0x4df1be){logger['error'](_0x4df1be[_0xcf93('0x5f')]);_0xdccbd3({'ret':0x1});});}});}function handleTZQuery(_0x314dab){logger['info'](_0x314dab);return db[_0xcf93('0x63')][_0xcf93('0x69')](_0x314dab)[_0xcf93('0x6a')](function(_0x386fe5){})['catch'](function(_0x2617a3){logger[_0xcf93('0x5e')](_0x2617a3[_0xcf93('0x5f')]);});}function main(_0x348708,_0x4d71c8,_0x25a586,_0x19aae9){logger[_0xcf93('0x62')]('main',_0x348708,JSON[_0xcf93('0x75')](_0x4d71c8));process[_0xcf93('0x76')](_0xcf93('0x77'));var _0x22e89d=_0x4d71c8[_0xcf93('0x78')];var _0x33a369=_[_0xcf93('0x79')](_0x22e89d);var _0x1f596f=_0x4d71c8[_0xcf93('0x7a')];var _0x2c4e51=path[_0xcf93('0x11')](config[_0xcf93('0x7b')],_0xcf93('0x7c'),_0x1f596f+_0xcf93('0x7d'));hasTZ=_[_0xcf93('0x55')](_0x22e89d)['includes'](_0xcf93('0x71'));var _0x2b49a2=_[_0xcf93('0x55')](_0x22e89d)[_0xcf93('0x11')]();logger[_0xcf93('0x62')](_0xcf93('0x7e'),_0x2b49a2);db['ContactItemType'][_0xcf93('0x16')]({'raw':!![],'attributes':['id',_0xcf93('0x7f')]})['then'](function(_0x47b705){for(var _0x2f833a=0x0;_0x2f833a<_0x47b705['length'];_0x2f833a++){if(_0x47b705[_0x2f833a][_0xcf93('0x7f')]in _0x22e89d){contactItemTypes['push'](_0x47b705[_0x2f833a]);delete _0x33a369[_0x47b705[_0x2f833a][_0xcf93('0x7f')]];hasAdditionalPhones=!![];}for(var _0x47cee3 in _0x22e89d){if(_0x47b705[_0x2f833a][_0xcf93('0x7f')]+_0xcf93('0x80')===_0x47cee3){phoneDescriptions[_0xcf93('0x1e')]({'itemTypeId':_0x47b705[_0x2f833a]['id'],'description':_0x47cee3});delete _0x33a369[_0x47cee3];}}}if(hasAdditionalPhones)_0x33a369[_0xcf93('0x17')]='';var _0x3ef1ef=_['keys'](_0x33a369)[_0xcf93('0x11')]();logger[_0xcf93('0x62')]('header',_0x3ef1ef);fs[_0xcf93('0x81')](_0x2c4e51,_0x3ef1ef+'\x0a');Papa[_0xcf93('0x82')](fs[_0xcf93('0x83')](_0x348708),{'header':!![],'skipEmptyLines':!![],'step':function(_0x32999d,_0x316a6f){try{for(var _0x2f7e52=0x0,_0x485037=[];_0x2f7e52<_0x32999d[_0xcf93('0x84')][_0xcf93('0x1b')];_0x2f7e52++){stats[_0xcf93('0x85')]+=0x1;if(_0x32999d[_0xcf93('0x61')][_0x2f7e52]){handleError(_0x32999d[_0xcf93('0x84')][_0x2f7e52],_0x32999d[_0xcf93('0x61')][_0x2f7e52]);}else{var _0xea26ec=[];var _0x3c5c5e=[];var _0xca7a90={};for(var _0x3af600 in _0x22e89d){let _0x2352bd=contactItemTypes[_0xcf93('0x86')](_0x451f40=>_0x451f40['name']===_0x3af600);let _0x5be724=contactItemTypes[_0xcf93('0x86')](_0x4e3a38=>_0x4e3a38[_0xcf93('0x7f')]+_0xcf93('0x80')===_0x3af600);if(_[_0xcf93('0x1c')](_0x2352bd)&&_[_0xcf93('0x1c')](_0x5be724)){if(_0x22e89d['hasOwnProperty'](_0x3af600)){if(_0x32999d['data'][_0x2f7e52][_0x22e89d[_0x3af600]]){var _0x14435b=_[_0xcf93('0x87')](_0x32999d[_0xcf93('0x84')][_0x2f7e52][_0x22e89d[_0x3af600]]['replace'](/"/g,'\x27'));switch(_0x3af600){case _0xcf93('0x88'):var _0x5cfa7d=moment(_0x14435b,_0xcf93('0xd'),!![]);if(_0x5cfa7d[_0xcf93('0x89')]()){_0x485037[_0xcf93('0x1e')]('\x22'+_0x14435b+'\x22');}else{_0xea26ec['push'](_0xcf93('0x8a'));}break;case'priority':var _0x45a5dd=parseInt(_0x14435b);_0x14435b=_['isNaN'](_0x45a5dd)||_0x45a5dd<0x0||_0x45a5dd>0x4?_0x19aae9?0x3:0x2:_0x45a5dd;_0x485037[_0xcf93('0x1e')]('\x22'+_0x14435b+'\x22');break;case _0xcf93('0x34'):var _0x4e01fc=parseInt(_0x14435b);if(_['isNumber'](_0x4e01fc)&&_[_0xcf93('0x8b')](_0x25a586,_0x4e01fc)){_0x485037['push']('\x22'+_0x4e01fc+'\x22');}else{_0xea26ec['push'](_0xcf93('0x8c'));}break;case _0xcf93('0x8d'):if(isEmail(_0x14435b)){_0x485037[_0xcf93('0x1e')]('\x22'+_0x14435b+'\x22');}else{_0xea26ec[_0xcf93('0x1e')](_0xcf93('0x8e'));}break;case'dateOfBirth':var _0x3d4507=moment(_0x14435b,_0xcf93('0x8f'),!![]);if(_0x3d4507[_0xcf93('0x89')]()){_0x485037[_0xcf93('0x1e')]('\x22'+_0x14435b+'\x22');}else{_0xea26ec[_0xcf93('0x1e')](_0xcf93('0x90'));}break;case'dialTimezone':var _0x470909=shared['timezones'];var _0x327292=_0x470909[_0x14435b];if(!_[_0xcf93('0x1c')](_0x327292)){var _0x3db21b=_0x327292[_0xcf93('0x72')];_0x485037[_0xcf93('0x1e')]('\x22'+_0x14435b+'\x22');_0x485037[_0xcf93('0x1e')]('\x22'+_0x3db21b+'\x22');}break;default:_0x485037['push']('\x22'+_0x14435b+'\x22');}}else{switch(_0x3af600){case _0xcf93('0x91'):case _0xcf93('0x10'):_0xea26ec['push'](_0x3af600+_0xcf93('0x92'));break;default:_0x485037[_0xcf93('0x1e')]('\x22\x22');}}}}else{var _0xab2776='';if(!_['isNil'](_0x2352bd)){if(!_0xca7a90[_0xcf93('0x93')](_0x2352bd['id'])){if(!_[_0xcf93('0x1c')](_0x32999d[_0xcf93('0x84')][_0x2f7e52][_0x22e89d[_0x3af600]])){var _0x14435b=_['trim'](_0x32999d[_0xcf93('0x84')][_0x2f7e52][_0x22e89d[_0x3af600]][_0xcf93('0x94')](/"/g,'\x27'));var _0x1407d9=phoneDescriptions[_0xcf93('0x86')](_0x112c47=>_0x112c47[_0xcf93('0x95')]===_0x2352bd['id']);if(!_[_0xcf93('0x1c')](_0x1407d9)){var _0x7a0955=_[_0xcf93('0x87')](_0x32999d[_0xcf93('0x84')][_0x2f7e52][_0x22e89d[_0x1407d9[_0xcf93('0x96')]]][_0xcf93('0x94')](/"/g,'\x27'));if(!_[_0xcf93('0x1c')](_0x7a0955))_0x14435b=_0x14435b+'§'+_0x7a0955;}if(_0xab2776=='')_0xab2776=_0x14435b;else _0xab2776+='|'+_0x14435b;}_0x3c5c5e[_0xcf93('0x1e')](_0x2352bd['id']+':'+_0xab2776);_0xca7a90[_0x2352bd['id']]=0x1;}}}}if(hasAdditionalPhones){_0x485037[_0xcf93('0x1e')]('\x22'+_0x3c5c5e['join'](';')+'\x22');}if(_0xea26ec[_0xcf93('0x1b')]){handleError(_0x32999d['data'][_0x2f7e52],{'code':'SystemRow','message':_0xea26ec[_0xcf93('0x11')]()});}else{fs[_0xcf93('0x97')](_0x2c4e51,_0x485037[_0xcf93('0x11')]()+'\x0a');}_0x485037=[];}if(!(stats[_0xcf93('0x85')]%0xc8)){socket[_0xcf93('0x98')]('contact:import:'+_0x1f596f,stats);stats[_0xcf93('0x61')]=[];}}if(stopped){logger[_0xcf93('0x62')](_0xcf93('0x99'));_0x316a6f[_0xcf93('0x9a')]();}}catch(_0x3af768){handleError(_0x32999d[_0xcf93('0x84')][_0x2f7e52],{'code':_0xcf93('0x9b'),'message':_0x3af768[_0xcf93('0x5f')]});logger[_0xcf93('0x5e')]('step',_0x3af768[_0xcf93('0x5f')]);}},'complete':function(){try{var _0x43cbf0=[];var _0x2513c1=[];var _0x578595=_0xcf93('0x41');if(_0x4d71c8['duplicates']&&_0x4d71c8['duplicates']['length']){_0x578595=_0xcf93('0x9c')+_0x1f596f;_0x43cbf0[_0xcf93('0x1e')](_0xcf93('0x9d')+_0x578595+_0xcf93('0x9e'));}tmp_campaigns=_0xcf93('0x9f')+_0x1f596f;tmp_voice_queues='voice_queues_'+_0x1f596f;_0x2513c1[_0xcf93('0x1e')](_0xcf93('0x9d')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2513c1[_0xcf93('0x1e')](_0xcf93('0x9d')+tmp_voice_queues+_0xcf93('0xa0'));BPromise[_0xcf93('0xa1')](_0x2513c1,handleTZQuery)['then'](function(_0x43496a){updateTzCampaigns(_0x4d71c8[_0xcf93('0x31')])[_0xcf93('0x18')](function(_0x5ebde7){updateTzVoiceQueues(_0x4d71c8[_0xcf93('0x31')])[_0xcf93('0x18')](function(_0x5dcfcb){if(hasTZ)_0x3ef1ef=_0x3ef1ef[_0xcf93('0x94')](_0xcf93('0x71'),_0xcf93('0xa2'));var _0xd2ca1e=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2c4e51,_0x578595,_0x3ef1ef,_0x4d71c8[_0xcf93('0x31')],_0x4d71c8[_0xcf93('0x56')]||null,NOW,NOW);if(_[_0xcf93('0x1c')](_0x22e89d['scheduledat'])){_0xd2ca1e+=_0xcf93('0xa3');}_0x43cbf0[_0xcf93('0x1e')](_0xd2ca1e);if(_0x4d71c8[_0xcf93('0xa4')]&&_0x4d71c8[_0xcf93('0xa4')]['length']){_0x43cbf0[_0xcf93('0x1e')](insertCmContact(_0x4d71c8['ListId'],_0x578595,_0x4d71c8[_0xcf93('0xa4')],_0x22e89d));_0x43cbf0[_0xcf93('0x1e')]('DROP\x20TABLE\x20'+_0x578595+';');}BPromise[_0xcf93('0xa1')](_0x43cbf0,handleQuery)[_0xcf93('0x18')](function(_0xe76e6f){BPromise[_0xcf93('0x19')]([handleAdditionalPhones()])['then'](function(){_0x43cbf0=[];for(var _0x2c2c6b=0x0;_0x2c2c6b<promisesAdditionalPhones['length'];_0x2c2c6b++){if(promisesAdditionalPhones[_0x2c2c6b][_0xcf93('0x10')]!='§'){_0x43cbf0['push'](createAdditionalPhone(promisesAdditionalPhones[_0x2c2c6b][_0xcf93('0xa5')],promisesAdditionalPhones[_0x2c2c6b][_0xcf93('0xa6')],promisesAdditionalPhones[_0x2c2c6b][_0xcf93('0x10')],promisesAdditionalPhones[_0x2c2c6b][_0xcf93('0xa7')]));}}BPromise[_0xcf93('0x19')](_0x43cbf0)[_0xcf93('0x18')](function(){_0x43cbf0=[];if(hasTZ){_0x43cbf0['push'](insertTzCmHopper(_0x4d71c8[_0xcf93('0x31')],_0xcf93('0x6e'),_0xcf93('0x6d'),_0xcf93('0xa8'),_0x19aae9,tmp_voice_queues));_0x43cbf0[_0xcf93('0x1e')](insertTzCmHopperBlack(_0x4d71c8['ListId'],_0xcf93('0xa9'),_0xcf93('0x6d'),'VoiceQueueId'));_0x43cbf0['push'](insertTzCmHopper(_0x4d71c8['ListId'],_0xcf93('0x67'),'campaigns',_0xcf93('0xaa'),_0x19aae9,tmp_campaigns));_0x43cbf0[_0xcf93('0x1e')](insertTzCmHopperBlack(_0x4d71c8['ListId'],_0xcf93('0xab'),'campaigns',_0xcf93('0xaa')));_0x43cbf0[_0xcf93('0x1e')](insertCmHopperAdditionalPhones(_0x4d71c8[_0xcf93('0x31')]));}else{_0x43cbf0[_0xcf93('0x1e')](insertCmHopper(_0x4d71c8[_0xcf93('0x31')],_0xcf93('0x6e'),'voice_queues',_0xcf93('0xa8'),_0x19aae9));_0x43cbf0[_0xcf93('0x1e')](insertCmHopperBlack(_0x4d71c8['ListId'],'voice_queues_has_cm_blacklists',_0xcf93('0x6d'),_0xcf93('0xa8')));_0x43cbf0[_0xcf93('0x1e')](insertCmHopper(_0x4d71c8[_0xcf93('0x31')],_0xcf93('0x67'),_0xcf93('0xac'),_0xcf93('0xaa'),_0x19aae9));_0x43cbf0[_0xcf93('0x1e')](insertCmHopperBlack(_0x4d71c8['ListId'],_0xcf93('0xab'),_0xcf93('0xac'),_0xcf93('0xaa')));_0x43cbf0[_0xcf93('0x1e')](insertCmHopperAdditionalPhones(_0x4d71c8[_0xcf93('0x31')]));}_0x43cbf0[_0xcf93('0x1e')](_0xcf93('0xad')+tmp_campaigns+';');_0x43cbf0[_0xcf93('0x1e')](_0xcf93('0xad')+tmp_voice_queues+';');BPromise[_0xcf93('0xa1')](_0x43cbf0,handleQuery)[_0xcf93('0x18')](function(_0x2ba6e0){stats[_0xcf93('0xae')]=!![];stats[_0xcf93('0xaf')]=_0x4d71c8[_0xcf93('0xa4')]&&_0x4d71c8[_0xcf93('0xa4')][_0xcf93('0x1b')]?results[0x2][_0xcf93('0xaf')]:results[0x0][_0xcf93('0xaf')];socket[_0xcf93('0x98')](_0xcf93('0xb0')+_0x1f596f,stats);fs[_0xcf93('0xb1')](_0x348708);fs[_0xcf93('0xb1')](_0x2c4e51);process[_0xcf93('0x60')](0x0);})[_0xcf93('0x64')](function(_0x5b58e5){logger['error'](_0x5b58e5[_0xcf93('0x5f')]);process[_0xcf93('0x60')](0x1);});});});})[_0xcf93('0x64')](function(_0x48d386){logger[_0xcf93('0x5e')](_0x48d386[_0xcf93('0x5f')]);process[_0xcf93('0x60')](0x1);});});});});}catch(_0x25eaa8){logger[_0xcf93('0x5e')]('complete',_0x25eaa8['message']);process[_0xcf93('0x60')](0x1);}},'error':function(_0x469629,_0x2ebee0,_0xc8040b,_0x1a1ac7){throw new Error(_0x1a1ac7);}});});}function validate(){if(process[_0xcf93('0xb2')]&&process[_0xcf93('0xb2')][_0xcf93('0x1b')]<0x4){throw new Error(_0xcf93('0xb3'));}var _0x2886fa=path['join'](config['root'],_0xcf93('0x7c'),process[_0xcf93('0xb2')][0x2]);if(!fs[_0xcf93('0xb4')](_0x2886fa)){throw new Error(_0xcf93('0xb5'));}var _0x48d752={};try{_0x48d752=JSON[_0xcf93('0x82')](process['argv'][0x3]);if(!_0x48d752['binding']){throw new Error(_0xcf93('0xb6'));}if(!_0x48d752[_0xcf93('0x78')][_0xcf93('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x48d752[_0xcf93('0x78')][_0xcf93('0x91')]){throw new Error(_0xcf93('0xb7'));}var _0x161a01=0x0;if(_0x48d752[_0xcf93('0x78')]['UserId']){_0x161a01=0x1;}if(!_0x48d752['ListId']){throw new Error(_0xcf93('0xb8'));}}catch(_0x26aca8){throw new Error(_0xcf93('0xb9'));}var _0x384e0c=[];try{_0x384e0c=_[_0xcf93('0xba')](JSON[_0xcf93('0x82')](process[_0xcf93('0xb2')][0x4]),'id');}catch(_0x2fb54a){logger[_0xcf93('0x62')](_0xcf93('0xbb'));}main(_0x2886fa,_0x48d752,_0x384e0c,_0x161a01);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x3853=['OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','code','sequelize','query','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','spread','main','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','includes','ContactItemType','name','_description','AdditionalPhones','header','writeFileSync','parse','createReadStream','data','rows','errors','find','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','hasOwnProperty','replace','SystemRow','appendFileSync','contact:import:','abort','SystemError','step','duplicates','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','CREATE\x20TABLE\x20','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','binding','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','squel','ioredis','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','from','join','.id\x20=\x20','CmContact','findAll','then','length','push','all','isNil','filter','split','CmContactHasItem','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','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','createdAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','where','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','updatedAt','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x3853,0x12f));var _0x3385=function(_0xabbd65,_0x546d99){_0xabbd65=_0xabbd65-0x0;var _0x1d005a=_0x3853[_0xabbd65];return _0x1d005a;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x3385('0x0'));var Papa=require('papaparse');var util=require(_0x3385('0x1'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x3385('0x2'));var Redis=require(_0x3385('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x3385('0x4'));var shared=require(_0x3385('0x5'));var logger=require('../../../config/logger')(_0x3385('0x6'));config[_0x3385('0x7')]=_[_0x3385('0x8')](config[_0x3385('0x7')],{'host':_0x3385('0x9'),'port':0x18eb});var socket=require(_0x3385('0xa'))(new Redis(config[_0x3385('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('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()[_0x3385('0xb')](_0x3385('0xc'));function isEmail(_0x288375){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))*$/[_0x3385('0xd')](_0x288375);}function selectNotIn(_0x15364b,_0x107186,_0x24e79a,_0x53bc15,_0x3dc4dc){return squel['select']()[_0x3385('0xe')]('phone')[_0x3385('0xf')](_0x53bc15)[_0x3385('0x10')](_0x107186,null,_0x107186+_0x3385('0x11')+_0x53bc15+'.'+_0x24e79a)['where'](_0x53bc15+'.'+_0x24e79a+'\x20=\x20'+_0x15364b+'.'+_0x24e79a)['where'](_0x107186+'.dialCheckDuplicateType\x20IN\x20('+_0x3dc4dc[_0x3385('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x11af6c,_0x3819aa){promisesAdditionalPhones=[];return db[_0x3385('0x12')][_0x3385('0x13')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x3385('0x14')](function(_0x5446c1){if(_0x5446c1!==null){var _0x3fd061=[];for(var _0x1b09a7=0x0;_0x1b09a7<_0x5446c1[_0x3385('0x15')];_0x1b09a7++){var _0x1e6dd4=_0x5446c1[_0x1b09a7];_0x3fd061[_0x3385('0x16')](insertAdditionalPhones(_0x1e6dd4));}}Promise[_0x3385('0x17')](_0x3fd061)[_0x3385('0x14')](function(){_0x11af6c({'val':0x1});});});});}function insertAdditionalPhones(_0x14b2f3){return new Promise(function(_0xdf069b,_0x392ebb){var _0x24e7fb=_0x14b2f3['AdditionalPhones'];var _0x3dc8fc=_0x24e7fb['split'](';');var _0x4c5113=[];orderBy=0x0;for(var _0x2c840e=0x0;_0x2c840e<_0x3dc8fc['length'];_0x2c840e++){_0x4c5113[_0x3385('0x16')](splitAdditionalPhone(_0x14b2f3['id'],_0x3dc8fc[_0x2c840e]));}Promise[_0x3385('0x17')](_0x4c5113)[_0x3385('0x14')](function(){_0xdf069b({'val':_0x3dc8fc[_0x3385('0x15')]});});});}function splitAdditionalPhone(_0x1bd5bf,_0x5d4d93){return new Promise(function(_0x4c7a5a,_0x2f7d38){var _0x11a91b=_0x5d4d93['split'](':');var _0x35471f=_0x11a91b[0x0];var _0x4c4dff=_0x11a91b[0x1];if(!_[_0x3385('0x18')](_0x4c4dff)){var _0xc01fd1=_0x4c4dff['split']('|');var _0x25e19b=[];for(var _0x1e5171=0x0;_0x1e5171<_0xc01fd1[_0x3385('0x15')];_0x1e5171++){if(_0xc01fd1[_0x1e5171]!==''){var _0x3f9a69=_[_0x3385('0x19')](promisesAdditionalPhones,{'contactId':_0x1bd5bf,'phone':_0xc01fd1[_0x1e5171]});if(_0x3f9a69[_0x3385('0x15')]==0x0){orderBy++;promisesAdditionalPhones[_0x3385('0x16')]({'contactId':_0x1bd5bf,'contactTypeId':_0x35471f,'phone':_0xc01fd1[_0x1e5171],'orderBy':orderBy});}}}_0x4c7a5a({'ok':0x1});}else _0x4c7a5a({'res':0x0});});}function createAdditionalPhone(_0x302c23,_0x18f536,_0xc41c16,_0x5e36fc){var _0x59eadb='';var _0x1dab59='';var _0x57100f=_0xc41c16[_0x3385('0x1a')]('§');_0x59eadb=_0x57100f[0x0];if(_0x57100f[_0x3385('0x15')]==0x2)_0x1dab59=_0x57100f[0x1];return new Promise(function(_0x5ced64,_0xe4d046){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x302c23,'item':_0x59eadb}})[_0x3385('0x14')](function(_0x4aa7e4){if(_0x4aa7e4){return db[_0x3385('0x1b')][_0x3385('0x1c')]({'ItemTypeId':_0x18f536,'description':_0x1dab59,'OrderBy':_0x5e36fc},{'where':{'CmContactId':_0x302c23,'item':_0x59eadb}})[_0x3385('0x14')](function(_0x43d529){_0x5ced64({'res':_0x3385('0x1d')});});}else{return db[_0x3385('0x1b')][_0x3385('0x1e')]({'CmContactId':_0x302c23,'item':_0x59eadb,'description':_0x1dab59,'ItemTypeId':_0x18f536,'OrderBy':_0x5e36fc,'ItemClass':_0x3385('0x1f')})['then'](function(_0x401f19){_0x5ced64({'res':_0x3385('0x20')});});}});});}function insertCmHopper(_0x21e481,_0x2d2ad1,_0x57f510,_0x35f898,_0x54b1ea){var _0x3480dc=[_0x3385('0x21'),_0x3385('0x22'),_0x3385('0x23'),_0x3385('0x24'),_0x2d2ad1+'.'+_0x35f898,_0x3385('0x25'),_0x3385('0x26'),_0x3385('0x27'),'cm_contacts.UserId','\x22'+_0x54b1ea+'\x22'];return squel[_0x3385('0x28')]()[_0x3385('0x29')](_0x3385('0x2a'))[_0x3385('0x2b')]([_0x3385('0x2c'),_0x3385('0x2d'),_0x3385('0x2e'),'ListId',_0x35f898,_0x3385('0x2f'),'updatedAt',_0x3385('0x30'),_0x3385('0x31'),_0x3385('0x32')],squel[_0x3385('0x33')]()[_0x3385('0x34')](_0x3480dc)['from'](_0x2d2ad1)[_0x3385('0x10')](_0x3385('0x35'),null,_0x3385('0x36')+_0x2d2ad1+_0x3385('0x37'))[_0x3385('0x10')](_0x57f510,null,_0x57f510+'.id\x20=\x20'+_0x2d2ad1+'.'+_0x35f898)['where'](_0x2d2ad1+_0x3385('0x38'),_0x21e481)[_0x3385('0x39')](_0x3385('0x3a'),NOW)[_0x3385('0x39')](_0x3385('0x3b'),selectNotIn(_0x2d2ad1,_0x57f510,_0x35f898,_0x3385('0x2a'),[_0x3385('0x3c'),'\x22onlyIfOpen\x22']))[_0x3385('0x39')](_0x3385('0x3b'),selectNotIn(_0x2d2ad1,_0x57f510,_0x35f898,_0x3385('0x2a'),[_0x3385('0x3c')])))['toString']();}function insertCmHopperBlack(_0x2c854a,_0x2f6b09,_0x47549f,_0x3b8512){var _0x14b05d=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x2f6b09+'.'+_0x3b8512,_0x3385('0x25'),_0x3385('0x26')];return squel[_0x3385('0x28')]()['into'](_0x3385('0x3d'))[_0x3385('0x2b')](['phone','ContactId',_0x3385('0x3e'),_0x3b8512,_0x3385('0x2f'),'updatedAt'],squel[_0x3385('0x33')]()[_0x3385('0x34')](_0x14b05d)[_0x3385('0xf')](_0x2f6b09)[_0x3385('0x10')]('cm_contacts',null,_0x3385('0x36')+_0x2f6b09+_0x3385('0x37'))[_0x3385('0x10')](_0x47549f,null,_0x47549f+_0x3385('0x11')+_0x2f6b09+'.'+_0x3b8512)[_0x3385('0x39')](_0x2f6b09+_0x3385('0x38'),_0x2c854a)[_0x3385('0x39')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3385('0x3b'),squel['select']()['field']('phone')['from'](_0x3385('0x3d'))['where'](_0x3385('0x3f'),_0x2c854a)[_0x3385('0x39')](_0x3b8512+_0x3385('0x40')+_0x2f6b09+'.'+_0x3b8512)))[_0x3385('0x41')]();}function insertTzCmHopper(_0x592085,_0xc7d408,_0x47def9,_0x220f99,_0xf3573c,_0x41bbf8){var _0x568c58=[_0x3385('0x21'),_0x3385('0x42')+_0x41bbf8+_0x3385('0x43'),_0x3385('0x23'),'cm_contacts.ListId',_0xc7d408+'.'+_0x220f99,_0x3385('0x25'),'cm_contacts.updatedAt','cm_contacts.priority',_0x3385('0x44'),'\x22'+_0xf3573c+'\x22'];var _0x2fe5a9=squel[_0x3385('0x28')]()['into']('cm_hopper')['fromQuery']([_0x3385('0x2c'),_0x3385('0x2d'),'ContactId',_0x3385('0x3e'),_0x220f99,_0x3385('0x2f'),_0x3385('0x45'),_0x3385('0x30'),_0x3385('0x31'),_0x3385('0x32')],squel[_0x3385('0x33')]()[_0x3385('0x34')](_0x568c58)[_0x3385('0xf')](_0xc7d408)[_0x3385('0x10')](_0x3385('0x35'),null,_0x3385('0x36')+_0xc7d408+_0x3385('0x37'))[_0x3385('0x10')](_0x47def9,null,_0x47def9+_0x3385('0x11')+_0xc7d408+'.'+_0x220f99)[_0x3385('0x10')](_0x41bbf8,null,_0x41bbf8+_0x3385('0x11')+_0xc7d408+'.'+_0x220f99)['where'](_0xc7d408+_0x3385('0x38'),_0x592085)[_0x3385('0x39')](_0x3385('0x3a'),NOW)[_0x3385('0x39')](_0x3385('0x3b'),selectNotIn(_0xc7d408,_0x47def9,_0x220f99,_0x3385('0x2a'),[_0x3385('0x3c'),_0x3385('0x46')]))[_0x3385('0x39')](_0x3385('0x3b'),selectNotIn(_0xc7d408,_0x47def9,_0x220f99,_0x3385('0x2a'),[_0x3385('0x3c')])))[_0x3385('0x41')]();return _0x2fe5a9;}function insertTzCmHopperBlack(_0x37e0a3,_0x5a149d,_0x3de53e,_0x11804a){var _0x55515b=[_0x3385('0x21'),'cm_contacts.id',_0x3385('0x24'),_0x5a149d+'.'+_0x11804a,'cm_contacts.createdAt',_0x3385('0x26')];return squel['insert']()[_0x3385('0x29')](_0x3385('0x3d'))['fromQuery']([_0x3385('0x2c'),'ContactId','ListId',_0x11804a,'createdAt',_0x3385('0x45')],squel['select']()[_0x3385('0x34')](_0x55515b)[_0x3385('0xf')](_0x5a149d)[_0x3385('0x10')](_0x3385('0x35'),null,_0x3385('0x36')+_0x5a149d+_0x3385('0x37'))[_0x3385('0x10')](_0x3de53e,null,_0x3de53e+'.id\x20=\x20'+_0x5a149d+'.'+_0x11804a)[_0x3385('0x39')](_0x5a149d+_0x3385('0x38'),_0x37e0a3)['where'](_0x3385('0x3a'),NOW)[_0x3385('0x39')](_0x3385('0x3b'),squel[_0x3385('0x33')]()['field'](_0x3385('0x2c'))[_0x3385('0xf')](_0x3385('0x3d'))[_0x3385('0x39')](_0x3385('0x3f'),_0x37e0a3)[_0x3385('0x39')](_0x11804a+_0x3385('0x40')+_0x5a149d+'.'+_0x11804a)))[_0x3385('0x41')]();}function insertCmHopperAdditionalPhones(_0x586401){var _0x197646=[_0x3385('0x47'),_0x3385('0x48'),_0x3385('0x49'),_0x3385('0x4a'),_0x3385('0x4b')];return squel[_0x3385('0x28')]()[_0x3385('0x29')]('cm_hopper_additional_phones')['fromQuery']([_0x3385('0x4c'),_0x3385('0x2c'),_0x3385('0x4d'),_0x3385('0x2f'),_0x3385('0x45')],squel['select']()[_0x3385('0x34')](_0x197646)[_0x3385('0xf')]('cm_hopper')[_0x3385('0x10')](_0x3385('0x35'),null,_0x3385('0x4e'))[_0x3385('0x10')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x3385('0x39')](_0x3385('0x4f'),_0x586401)[_0x3385('0x39')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x3385('0x41')]();}function insertCmContact(_0x2a2da7,_0x2af33f,_0x58f3aa,_0x16c628){var _0x52752a=_[_0x3385('0x50')](_[_0x3385('0x51')](_0x16c628),[_0x3385('0x3e'),'CompanyId',_0x3385('0x2f'),_0x3385('0x45'),_0x3385('0x52')]);return squel[_0x3385('0x28')]()[_0x3385('0x29')](_0x3385('0x35'))['fromQuery'](_0x52752a,squel[_0x3385('0x33')]()[_0x3385('0x34')](_0x52752a)[_0x3385('0xf')](_0x2af33f)['where']('('+_0x58f3aa[_0x3385('0x10')](',')+_0x3385('0x53'),squel['select']()[_0x3385('0x34')](_0x58f3aa)[_0x3385('0xf')](_0x3385('0x35'))[_0x3385('0x39')](_0x3385('0x3f'),_0x2a2da7)[_0x3385('0x39')]('deletedAt\x20IS\x20NULL'))['where']('id\x20IN\x20?',squel[_0x3385('0x33')]()[_0x3385('0xe')](_0x3385('0x54'),_0x3385('0x55'))[_0x3385('0xf')](_0x2af33f)[_0x3385('0x56')](_0x58f3aa[_0x3385('0x10')](','))))[_0x3385('0x41')]();}function handleStop(){logger[_0x3385('0x57')](_0x3385('0x58'));stopped=!![];}function handleUncaughtException(_0x344b66){logger['error'](_0x344b66[_0x3385('0x59')]);process[_0x3385('0x5a')](0x1);}function handleError(_0x45eed2,_0x4eeedd){stats['errors']['push']({'name':_0x4eeedd[_0x3385('0x5b')],'message':_0x4eeedd[_0x3385('0x59')],'row':_0x45eed2});}function handleQuery(_0x1a0fd0){logger[_0x3385('0x57')](_0x1a0fd0);return db[_0x3385('0x5c')][_0x3385('0x5d')](_0x1a0fd0)['spread'](function(_0xc8f51f){results[_0x3385('0x16')](_0xc8f51f);})[_0x3385('0x5e')](function(_0x54526f){logger[_0x3385('0x5f')](_0x54526f[_0x3385('0x59')]);});}function updateTzCampaigns(_0x2f959a){return new Promise(function(_0x70a131,_0x53d225){var _0x1828e3=squel['select']()[_0x3385('0x34')]([_0x3385('0x60'),_0x3385('0x61')])[_0x3385('0xf')](_0x3385('0x62'))[_0x3385('0x10')](_0x3385('0x63'),null,_0x3385('0x64'))[_0x3385('0x39')](_0x3385('0x65')+_0x2f959a);db[_0x3385('0x5c')][_0x3385('0x5d')](_0x1828e3['toString']())['spread'](function(_0x4f037a){var _0x162737=[];for(var _0x3ffc17=0x0;_0x3ffc17<_0x4f037a[_0x3385('0x15')];_0x3ffc17++){_0x162737[_0x3385('0x16')](getTimezoneData(_0x4f037a[_0x3ffc17],tmp_campaigns));}BPromise['all'](_0x162737)[_0x3385('0x14')](function(){_0x70a131({'val':0x1});});})[_0x3385('0x5e')](function(_0x1d409c){logger[_0x3385('0x5f')](_0x1d409c['message']);_0x70a131({'val':0x0});});});}function updateTzVoiceQueues(_0x5e0ea8){return new Promise(function(_0x24a3f0,_0x56f73c){var _0x26d56c=squel[_0x3385('0x33')]()[_0x3385('0x34')]([_0x3385('0x66'),_0x3385('0x67')])['from'](_0x3385('0x68'))['join'](_0x3385('0x69'),null,_0x3385('0x6a'))['where'](_0x3385('0x6b')+_0x5e0ea8);db[_0x3385('0x5c')][_0x3385('0x5d')](_0x26d56c['toString']())['spread'](function(_0x9665e3){var _0x2a5403=[];for(var _0x582001=0x0;_0x582001<_0x9665e3[_0x3385('0x15')];_0x582001++){_0x2a5403['push'](getTimezoneData(_0x9665e3[_0x582001],tmp_voice_queues));}BPromise[_0x3385('0x17')](_0x2a5403)['then'](function(){_0x24a3f0({'val':0x1});});})['catch'](function(_0x30eac9){logger[_0x3385('0x5f')](_0x30eac9[_0x3385('0x59')]);_0x24a3f0({'val':0x0});});});}function getTimezoneData(_0x2908c8,_0x378e3d){return new Promise(function(_0x2114ae,_0x1b234c){var _0x19221d=shared['timezones'];var _0xe12e0c=_0x19221d[_0x2908c8[_0x3385('0x6c')]];if(_[_0x3385('0x18')](_0xe12e0c)){_0x2114ae({'ret':0x1});}else{var _0x1a5f53=_0xe12e0c[_0x3385('0x6d')];var _0x4f1ab2=squel[_0x3385('0x28')]()['into'](_0x378e3d)[_0x3385('0x6e')]('id',_0x2908c8['id'])[_0x3385('0x6e')](_0x3385('0x6f'),_0x1a5f53)[_0x3385('0x6e')](_0x3385('0x6c'),_0x2908c8[_0x3385('0x6c')])[_0x3385('0x41')]();return db[_0x3385('0x5c')]['query'](_0x4f1ab2)[_0x3385('0x70')](function(_0x1f85b6){_0x2114ae({'ret':0x1});})['catch'](function(_0x2a75ed){logger[_0x3385('0x5f')](_0x2a75ed[_0x3385('0x59')]);_0x1b234c({'ret':0x1});});}});}function handleTZQuery(_0x159ce4){logger[_0x3385('0x57')](_0x159ce4);return db['sequelize']['query'](_0x159ce4)['spread'](function(_0x11072c){})[_0x3385('0x5e')](function(_0x5a6f42){logger[_0x3385('0x5f')](_0x5a6f42['message']);});}function main(_0x50d8a1,_0x239518,_0x388dbc,_0x530f3d){logger[_0x3385('0x57')](_0x3385('0x71'),_0x50d8a1,JSON['stringify'](_0x239518));process[_0x3385('0x72')](_0x3385('0x73'));var _0x4a578c=_0x239518['binding'];var _0x33a308=_[_0x3385('0x74')](_0x4a578c);var _0x2277db=_0x239518[_0x3385('0x75')];var _0x5cb016=path[_0x3385('0x10')](config[_0x3385('0x76')],_0x3385('0x77'),_0x2277db+_0x3385('0x78'));hasTZ=_[_0x3385('0x51')](_0x4a578c)[_0x3385('0x79')]('dialTimezone');var _0x2bc779=_[_0x3385('0x51')](_0x4a578c)[_0x3385('0x10')]();logger[_0x3385('0x57')]('header',_0x2bc779);db[_0x3385('0x7a')][_0x3385('0x13')]({'raw':!![],'attributes':['id',_0x3385('0x7b')]})[_0x3385('0x14')](function(_0x5c7cc8){for(var _0x35b84e=0x0;_0x35b84e<_0x5c7cc8[_0x3385('0x15')];_0x35b84e++){if(_0x5c7cc8[_0x35b84e][_0x3385('0x7b')]in _0x4a578c){contactItemTypes[_0x3385('0x16')](_0x5c7cc8[_0x35b84e]);delete _0x33a308[_0x5c7cc8[_0x35b84e][_0x3385('0x7b')]];hasAdditionalPhones=!![];}for(var _0x2d506e in _0x4a578c){if(_0x5c7cc8[_0x35b84e][_0x3385('0x7b')]+_0x3385('0x7c')===_0x2d506e){phoneDescriptions[_0x3385('0x16')]({'itemTypeId':_0x5c7cc8[_0x35b84e]['id'],'description':_0x2d506e});delete _0x33a308[_0x2d506e];}}}if(hasAdditionalPhones)_0x33a308[_0x3385('0x7d')]='';var _0x2fe909=_[_0x3385('0x51')](_0x33a308)[_0x3385('0x10')]();logger['info'](_0x3385('0x7e'),_0x2fe909);fs[_0x3385('0x7f')](_0x5cb016,_0x2fe909+'\x0a');Papa[_0x3385('0x80')](fs[_0x3385('0x81')](_0x50d8a1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x105991,_0x2f9626){try{for(var _0x393704=0x0,_0x4599ff=[];_0x393704<_0x105991[_0x3385('0x82')][_0x3385('0x15')];_0x393704++){stats[_0x3385('0x83')]+=0x1;if(_0x105991[_0x3385('0x84')][_0x393704]){handleError(_0x105991[_0x3385('0x82')][_0x393704],_0x105991['errors'][_0x393704]);}else{var _0xdc5323=[];var _0x1bf86c=[];var _0x3ba797={};for(var _0x11c598 in _0x4a578c){let _0x248e5b=contactItemTypes[_0x3385('0x85')](_0x57a119=>_0x57a119[_0x3385('0x7b')]===_0x11c598);let _0x6f5004=contactItemTypes[_0x3385('0x85')](_0x5a8cad=>_0x5a8cad[_0x3385('0x7b')]+_0x3385('0x7c')===_0x11c598);if(_[_0x3385('0x18')](_0x248e5b)&&_[_0x3385('0x18')](_0x6f5004)){if(_0x4a578c['hasOwnProperty'](_0x11c598)){if(_0x105991[_0x3385('0x82')][_0x393704][_0x4a578c[_0x11c598]]){var _0x2be09f=_[_0x3385('0x86')](_0x105991['data'][_0x393704][_0x4a578c[_0x11c598]]['replace'](/"/g,'\x27'));switch(_0x11c598){case'scheduledat':var _0x5e8008=moment(_0x2be09f,_0x3385('0xc'),!![]);if(_0x5e8008[_0x3385('0x87')]()){_0x4599ff[_0x3385('0x16')]('\x22'+_0x2be09f+'\x22');}else{_0xdc5323[_0x3385('0x16')](_0x3385('0x88'));}break;case _0x3385('0x30'):var _0x155e45=parseInt(_0x2be09f);_0x2be09f=_[_0x3385('0x89')](_0x155e45)||_0x155e45<0x0||_0x155e45>0x4?_0x530f3d?0x3:0x2:_0x155e45;_0x4599ff['push']('\x22'+_0x2be09f+'\x22');break;case'UserId':var _0x2f5b17=parseInt(_0x2be09f);if(_[_0x3385('0x8a')](_0x2f5b17)&&_[_0x3385('0x79')](_0x388dbc,_0x2f5b17)){_0x4599ff[_0x3385('0x16')]('\x22'+_0x2f5b17+'\x22');}else{_0xdc5323[_0x3385('0x16')](_0x3385('0x8b'));}break;case _0x3385('0x8c'):if(isEmail(_0x2be09f)){_0x4599ff[_0x3385('0x16')]('\x22'+_0x2be09f+'\x22');}else{_0xdc5323[_0x3385('0x16')](_0x3385('0x8d'));}break;case _0x3385('0x8e'):var _0x35501d=moment(_0x2be09f,_0x3385('0x8f'),!![]);if(_0x35501d['isValid']()){_0x4599ff[_0x3385('0x16')]('\x22'+_0x2be09f+'\x22');}else{_0xdc5323[_0x3385('0x16')](_0x3385('0x90'));}break;case _0x3385('0x6c'):var _0x3bf15a=shared[_0x3385('0x91')];var _0x274ca5=_0x3bf15a[_0x2be09f];if(!_['isNil'](_0x274ca5)){var _0x3a958c=_0x274ca5[_0x3385('0x6d')];_0x4599ff[_0x3385('0x16')]('\x22'+_0x2be09f+'\x22');_0x4599ff[_0x3385('0x16')]('\x22'+_0x3a958c+'\x22');}break;default:_0x4599ff[_0x3385('0x16')]('\x22'+_0x2be09f+'\x22');}}else{switch(_0x11c598){case _0x3385('0x92'):case'phone':_0xdc5323['push'](_0x11c598+_0x3385('0x93'));break;default:_0x4599ff[_0x3385('0x16')]('\x22\x22');}}}}else{var _0x5ab463='';if(!_[_0x3385('0x18')](_0x248e5b)){if(!_0x3ba797[_0x3385('0x94')](_0x248e5b['id'])){if(!_[_0x3385('0x18')](_0x105991[_0x3385('0x82')][_0x393704][_0x4a578c[_0x11c598]])){var _0x2be09f=_[_0x3385('0x86')](_0x105991[_0x3385('0x82')][_0x393704][_0x4a578c[_0x11c598]]['replace'](/"/g,'\x27'));var _0x93ca=phoneDescriptions[_0x3385('0x85')](_0x21a361=>_0x21a361['itemTypeId']===_0x248e5b['id']);if(!_[_0x3385('0x18')](_0x93ca)){var _0x45e3d5=_['trim'](_0x105991[_0x3385('0x82')][_0x393704][_0x4a578c[_0x93ca['description']]][_0x3385('0x95')](/"/g,'\x27'));if(!_[_0x3385('0x18')](_0x45e3d5))_0x2be09f=_0x2be09f+'§'+_0x45e3d5;}if(_0x5ab463=='')_0x5ab463=_0x2be09f;else _0x5ab463+='|'+_0x2be09f;}_0x1bf86c['push'](_0x248e5b['id']+':'+_0x5ab463);_0x3ba797[_0x248e5b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4599ff[_0x3385('0x16')]('\x22'+_0x1bf86c[_0x3385('0x10')](';')+'\x22');}if(_0xdc5323[_0x3385('0x15')]){handleError(_0x105991[_0x3385('0x82')][_0x393704],{'code':_0x3385('0x96'),'message':_0xdc5323[_0x3385('0x10')]()});}else{fs[_0x3385('0x97')](_0x5cb016,_0x4599ff['join']()+'\x0a');}_0x4599ff=[];}if(!(stats[_0x3385('0x83')]%0xc8)){socket['emit'](_0x3385('0x98')+_0x2277db,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x2f9626[_0x3385('0x99')]();}}catch(_0x537458){handleError(_0x105991[_0x3385('0x82')][_0x393704],{'code':_0x3385('0x9a'),'message':_0x537458[_0x3385('0x59')]});logger[_0x3385('0x5f')](_0x3385('0x9b'),_0x537458[_0x3385('0x59')]);}},'complete':function(){try{var _0x113d2d=[];var _0x41180c=[];var _0x361b4f=_0x3385('0x35');if(_0x239518[_0x3385('0x9c')]&&_0x239518[_0x3385('0x9c')][_0x3385('0x15')]){_0x361b4f='cm_contacts_'+_0x2277db;_0x113d2d[_0x3385('0x16')]('CREATE\x20TABLE\x20'+_0x361b4f+_0x3385('0x9d'));}tmp_campaigns=_0x3385('0x9e')+_0x2277db;tmp_voice_queues='voice_queues_'+_0x2277db;_0x41180c[_0x3385('0x16')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x3385('0x9f'));_0x41180c[_0x3385('0x16')](_0x3385('0xa0')+tmp_voice_queues+_0x3385('0x9f'));BPromise[_0x3385('0xa1')](_0x41180c,handleTZQuery)[_0x3385('0x14')](function(_0x5a1a3d){updateTzCampaigns(_0x239518[_0x3385('0x3e')])[_0x3385('0x14')](function(_0x7c389){updateTzVoiceQueues(_0x239518[_0x3385('0x3e')])[_0x3385('0x14')](function(_0xc229b9){if(hasTZ)_0x2fe909=_0x2fe909[_0x3385('0x95')](_0x3385('0x6c'),_0x3385('0xa2'));var _0x51458f=util[_0x3385('0xb')](_0x3385('0xa3'),_0x5cb016,_0x361b4f,_0x2fe909,_0x239518['ListId'],_0x239518[_0x3385('0xa4')]||null,NOW,NOW);if(_[_0x3385('0x18')](_0x4a578c[_0x3385('0x2d')])){_0x51458f+=_0x3385('0xa5');}_0x113d2d[_0x3385('0x16')](_0x51458f);if(_0x239518[_0x3385('0x9c')]&&_0x239518[_0x3385('0x9c')][_0x3385('0x15')]){_0x113d2d[_0x3385('0x16')](insertCmContact(_0x239518[_0x3385('0x3e')],_0x361b4f,_0x239518['duplicates'],_0x4a578c));_0x113d2d['push'](_0x3385('0xa6')+_0x361b4f+';');}BPromise[_0x3385('0xa1')](_0x113d2d,handleQuery)[_0x3385('0x14')](function(_0x233791){BPromise[_0x3385('0x17')]([handleAdditionalPhones()])[_0x3385('0x14')](function(){_0x113d2d=[];for(var _0x5d5789=0x0;_0x5d5789<promisesAdditionalPhones['length'];_0x5d5789++){if(promisesAdditionalPhones[_0x5d5789][_0x3385('0x2c')]!='§'){_0x113d2d['push'](createAdditionalPhone(promisesAdditionalPhones[_0x5d5789][_0x3385('0xa7')],promisesAdditionalPhones[_0x5d5789][_0x3385('0xa8')],promisesAdditionalPhones[_0x5d5789]['phone'],promisesAdditionalPhones[_0x5d5789]['orderBy']));}}BPromise['all'](_0x113d2d)[_0x3385('0x14')](function(){_0x113d2d=[];if(hasTZ){_0x113d2d[_0x3385('0x16')](insertTzCmHopper(_0x239518[_0x3385('0x3e')],'voice_queues_has_cm_lists',_0x3385('0x68'),'VoiceQueueId',_0x530f3d,tmp_voice_queues));_0x113d2d[_0x3385('0x16')](insertTzCmHopperBlack(_0x239518['ListId'],_0x3385('0xa9'),_0x3385('0x68'),_0x3385('0xaa')));_0x113d2d[_0x3385('0x16')](insertTzCmHopper(_0x239518[_0x3385('0x3e')],_0x3385('0x63'),'campaigns',_0x3385('0xab'),_0x530f3d,tmp_campaigns));_0x113d2d[_0x3385('0x16')](insertTzCmHopperBlack(_0x239518[_0x3385('0x3e')],_0x3385('0xac'),_0x3385('0x62'),_0x3385('0xab')));_0x113d2d['push'](insertCmHopperAdditionalPhones(_0x239518['ListId']));}else{_0x113d2d[_0x3385('0x16')](insertCmHopper(_0x239518['ListId'],'voice_queues_has_cm_lists',_0x3385('0x68'),_0x3385('0xaa'),_0x530f3d));_0x113d2d['push'](insertCmHopperBlack(_0x239518['ListId'],_0x3385('0xa9'),'voice_queues',_0x3385('0xaa')));_0x113d2d['push'](insertCmHopper(_0x239518['ListId'],_0x3385('0x63'),_0x3385('0x62'),_0x3385('0xab'),_0x530f3d));_0x113d2d[_0x3385('0x16')](insertCmHopperBlack(_0x239518[_0x3385('0x3e')],_0x3385('0xac'),_0x3385('0x62'),_0x3385('0xab')));_0x113d2d['push'](insertCmHopperAdditionalPhones(_0x239518['ListId']));}_0x113d2d['push'](_0x3385('0xa6')+tmp_campaigns+';');_0x113d2d['push'](_0x3385('0xa6')+tmp_voice_queues+';');BPromise[_0x3385('0xa1')](_0x113d2d,handleQuery)[_0x3385('0x14')](function(_0x2ea444){stats[_0x3385('0xad')]=!![];stats[_0x3385('0xae')]=_0x239518[_0x3385('0x9c')]&&_0x239518[_0x3385('0x9c')][_0x3385('0x15')]?results[0x2][_0x3385('0xae')]:results[0x0]['affectedRows'];socket['emit'](_0x3385('0x98')+_0x2277db,stats);fs[_0x3385('0xaf')](_0x50d8a1);fs['unlink'](_0x5cb016);process[_0x3385('0x5a')](0x0);})[_0x3385('0x5e')](function(_0x3c7a05){logger['error'](_0x3c7a05[_0x3385('0x59')]);process[_0x3385('0x5a')](0x1);});});});})[_0x3385('0x5e')](function(_0x1083bc){logger[_0x3385('0x5f')](_0x1083bc[_0x3385('0x59')]);process[_0x3385('0x5a')](0x1);});});});});}catch(_0x2b6c31){logger[_0x3385('0x5f')](_0x3385('0xb0'),_0x2b6c31[_0x3385('0x59')]);process[_0x3385('0x5a')](0x1);}},'error':function(_0xff4193,_0x756e9d,_0x13430c,_0x573995){throw new Error(_0x573995);}});});}function validate(){if(process[_0x3385('0xb1')]&&process['argv'][_0x3385('0x15')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x38305d=path[_0x3385('0x10')](config['root'],_0x3385('0x77'),process[_0x3385('0xb1')][0x2]);if(!fs[_0x3385('0xb2')](_0x38305d)){throw new Error(_0x3385('0xb3'));}var _0x2be1ee={};try{_0x2be1ee=JSON[_0x3385('0x80')](process['argv'][0x3]);if(!_0x2be1ee['binding']){throw new Error(_0x3385('0xb4'));}if(!_0x2be1ee['binding']['phone']){throw new Error(_0x3385('0xb5'));}if(!_0x2be1ee[_0x3385('0xb6')][_0x3385('0x92')]){throw new Error(_0x3385('0xb7'));}var _0x26b87b=0x0;if(_0x2be1ee[_0x3385('0xb6')][_0x3385('0x31')]){_0x26b87b=0x1;}if(!_0x2be1ee[_0x3385('0x3e')]){throw new Error(_0x3385('0xb8'));}}catch(_0x62a394){throw new Error(_0x3385('0xb9'));}var _0x4c2173=[];try{_0x4c2173=_[_0x3385('0xba')](JSON[_0x3385('0x80')](process['argv'][0x4]),'id');}catch(_0x1dda8f){logger['info'](_0x3385('0xbb'));}main(_0x38305d,_0x2be1ee,_0x4c2173,_0x26b87b);}validate();process['on'](_0x3385('0xbc'),handleStop);process['on'](_0x3385('0xbd'),handleUncaughtException);
\ No newline at end of file
index f459c8e..c3248a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14b7=['SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','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','scheduledat',',\x20scheduledAt\x20=\x20NOW()','each','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','all','then','catch','error','message','AdditionalPhones','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','into','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','writeFileSync','parse','createReadStream','data','find','_description','hasOwnProperty','trim','replace','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x14b7,0x144));var _0x714b=function(_0x2d00d4,_0x3e7d3d){_0x2d00d4=_0x2d00d4-0x0;var _0x45f2b6=_0x14b7[_0x2d00d4];return _0x45f2b6;};'use strict';var fs=require('fs');var path=require(_0x714b('0x0'));var _=require(_0x714b('0x1'));var Papa=require(_0x714b('0x2'));var util=require(_0x714b('0x3'));var BPromise=require('bluebird');var moment=require(_0x714b('0x4'));var squel=require(_0x714b('0x5'));var Redis=require(_0x714b('0x6'));var db=require(_0x714b('0x7'))['db'];var config=require(_0x714b('0x8'));var logger=require('../../../config/logger')('import');config[_0x714b('0x9')]=_[_0x714b('0xa')](config[_0x714b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x714b('0xb'))(new Redis(config[_0x714b('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x714b('0xc')](_0x714b('0xd'));var tempTableName=_0x714b('0xe')+moment()['format'](_0x714b('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x376867){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))*$/[_0x714b('0x10')](_0x376867);}function selectNotIn(_0x526019,_0x2b2df8,_0x591bea,_0x4f0d0d,_0x4679e7){return squel[_0x714b('0x11')]()['field'](_0x714b('0x12'))[_0x714b('0x13')](_0x4f0d0d)[_0x714b('0x14')](_0x2b2df8,null,_0x2b2df8+_0x714b('0x15')+_0x4f0d0d+'.'+_0x591bea)['where'](_0x4f0d0d+'.'+_0x591bea+_0x714b('0x16')+_0x526019+'.'+_0x591bea)['where'](_0x2b2df8+_0x714b('0x17')+_0x4679e7[_0x714b('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5b2770,_0x3c7d6c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x714b('0x18')][_0x714b('0x19')](_0x714b('0x1a')+tempTableName)[_0x714b('0x1b')](function(_0x3e430d){if(_0x3e430d!==null){var _0x51a5c3=[];for(var _0x44bc7d=0x0;_0x44bc7d<_0x3e430d[_0x714b('0x1c')];_0x44bc7d++){var _0x5643a1=_0x3e430d[_0x44bc7d];if(!_[_0x714b('0x1d')](_0x5643a1['phone'])){if(!_[_0x714b('0x1d')](_0x5643a1['AdditionalPhones']))_0x51a5c3[_0x714b('0x1e')](insertAdditionalPhones(_0x5643a1));promisesContact[_0x714b('0x1e')]({'contact':_0x5643a1});}}}Promise[_0x714b('0x1f')](_0x51a5c3)[_0x714b('0x20')](function(){_0x5b2770({'val':0x1});});})[_0x714b('0x21')](function(_0x2d93e0){logger[_0x714b('0x22')](_0x2d93e0[_0x714b('0x23')]);});});}function insertAdditionalPhones(_0x4764c2){return new Promise(function(_0x42d74a,_0x1b263b){var _0x1f9722=_0x4764c2[_0x714b('0x24')];if(_[_0x714b('0x1d')](_0x1f9722))_0x1b263b({'val':0x0});else{var _0x352de9=_0x1f9722['split'](';');var _0x1f599b=[];orderBy=0x0;for(var _0x81de31=0x0;_0x81de31<_0x352de9[_0x714b('0x1c')];_0x81de31++){_0x1f599b[_0x714b('0x1e')](splitAdditionalPhone(_0x4764c2['id'],_0x352de9[_0x81de31]));}Promise['all'](_0x1f599b)['then'](function(){_0x42d74a({'val':_0x352de9[_0x714b('0x1c')]});});}});}function splitAdditionalPhone(_0x172db0,_0x2aa96e){return new Promise(function(_0x8d9480,_0x2fb265){var _0x20f23c=_0x2aa96e[_0x714b('0x25')](':');var _0x5bdf8a=_0x20f23c[0x0];var _0x2045c1=_0x20f23c[0x1];if(_0x2045c1!==''){var _0x1bd130=_0x2045c1[_0x714b('0x25')]('|');var _0x5ac0b0=[];for(var _0x552a16=0x0;_0x552a16<_0x1bd130['length'];_0x552a16++){if(_0x1bd130[_0x552a16]!==''){var _0x296d6c=_[_0x714b('0x26')](promisesAdditionalPhones,{'contactId':_0x172db0,'phone':_0x1bd130[_0x552a16]});if(_0x296d6c['length']==0x0){orderBy++;promisesAdditionalPhones[_0x714b('0x1e')]({'contactId':_0x172db0,'contactTypeId':_0x5bdf8a,'phone':_0x1bd130[_0x552a16],'orderBy':orderBy});}}}_0x8d9480({'ok':0x1});}else _0x8d9480({'res':0x0});});}function createAdditionalPhone(_0x1def48,_0x3e6584,_0x318072,_0x3c62ca){var _0x31f4a7='';var _0x122a02='';var _0x35ffac=_0x318072[_0x714b('0x25')]('§');_0x31f4a7=_0x35ffac[0x0];if(_0x35ffac['length']==0x2)_0x122a02=_0x35ffac[0x1];return new Promise(function(_0x5b4c80,_0x1645ef){return db[_0x714b('0x27')][_0x714b('0x28')]({'where':{'CmContactId':_0x1def48,'item':_0x31f4a7}})[_0x714b('0x20')](function(_0x564ea9){if(_0x564ea9){return db[_0x714b('0x27')][_0x714b('0x29')]({'ItemTypeId':_0x3e6584,'description':_0x122a02,'OrderBy':_0x3c62ca},{'where':{'CmContactId':_0x1def48,'item':_0x31f4a7}})['then'](function(_0x2c2af0){_0x5b4c80({'res':_0x714b('0x2a')});});}else{return db[_0x714b('0x27')][_0x714b('0x2b')]({'CmContactId':_0x1def48,'item':_0x31f4a7,'ItemTypeId':_0x3e6584,'description':_0x122a02,'OrderBy':_0x3c62ca,'ItemClass':_0x714b('0x2c')})[_0x714b('0x20')](function(_0x4cf5f6){_0x5b4c80({'res':_0x714b('0x2d')});});}});});}function updateContact(_0x80d4c3){return new Promise(function(_0x11fadb,_0x3645af){var _0x883446=_0x80d4c3['id'];delete _0x80d4c3['id'];return db['CmContact'][_0x714b('0x29')](_0x80d4c3,{'where':{'id':_0x883446}})[_0x714b('0x20')](function(_0x45649a){updatedRows+=0x1;return db[_0x714b('0x2e')][_0x714b('0x29')]({'phone':_0x80d4c3[_0x714b('0x12')]},{'where':{'ContactId':_0x883446}})[_0x714b('0x20')](function(_0x3c73af){_0x11fadb({'ret':'OK'});});});});}function insertCmHopper(_0x17e9fe,_0x177467,_0x1e288c,_0x108124,_0x171e23){var _0x537061=[_0x714b('0x2f'),'cm_contacts.scheduledat',_0x714b('0x30'),_0x714b('0x31'),_0x177467+'.'+_0x108124,'cm_contacts.createdAt',_0x714b('0x32'),'cm_contacts.priority',_0x714b('0x33'),'\x22'+_0x171e23+'\x22'];return squel[_0x714b('0x34')]()['into'](_0x714b('0x35'))[_0x714b('0x36')]([_0x714b('0x12'),'scheduledat',_0x714b('0x37'),_0x714b('0x38'),_0x108124,_0x714b('0x39'),_0x714b('0x3a'),'priority',_0x714b('0x3b'),_0x714b('0x3c')],squel['select']()[_0x714b('0x3d')](_0x537061)[_0x714b('0x13')](_0x177467)[_0x714b('0x14')](_0x714b('0x3e'),null,_0x714b('0x3f')+_0x177467+_0x714b('0x40'))['join'](_0x1e288c,null,_0x1e288c+'.id\x20=\x20'+_0x177467+'.'+_0x108124)[_0x714b('0x41')](_0x177467+_0x714b('0x42'),_0x17e9fe)[_0x714b('0x41')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x177467,_0x1e288c,_0x108124,_0x714b('0x35'),[_0x714b('0x43'),_0x714b('0x44')]))[_0x714b('0x41')](_0x714b('0x45'),selectNotIn(_0x177467,_0x1e288c,_0x108124,_0x714b('0x35'),[_0x714b('0x43')])))[_0x714b('0x46')]();}function insertCmHopperBlack(_0x368cac,_0x508380,_0x355951,_0x3a7f95){var _0x29e5e4=[_0x714b('0x2f'),_0x714b('0x30'),_0x714b('0x31'),_0x508380+'.'+_0x3a7f95,_0x714b('0x47'),_0x714b('0x32')];return squel[_0x714b('0x34')]()[_0x714b('0x48')](_0x714b('0x49'))[_0x714b('0x36')]([_0x714b('0x12'),_0x714b('0x37'),_0x714b('0x38'),_0x3a7f95,_0x714b('0x39'),_0x714b('0x3a')],squel[_0x714b('0x11')]()[_0x714b('0x3d')](_0x29e5e4)[_0x714b('0x13')](_0x508380)['join'](_0x714b('0x3e'),null,_0x714b('0x3f')+_0x508380+'.CmListId')[_0x714b('0x14')](_0x355951,null,_0x355951+_0x714b('0x15')+_0x508380+'.'+_0x3a7f95)[_0x714b('0x41')](_0x508380+_0x714b('0x42'),_0x368cac)['where'](_0x714b('0x4a'),NOW)['where'](_0x714b('0x45'),squel['select']()[_0x714b('0x4b')](_0x714b('0x12'))[_0x714b('0x13')](_0x714b('0x49'))[_0x714b('0x41')](_0x714b('0x4c'),_0x368cac)[_0x714b('0x41')](_0x3a7f95+'\x20=\x20?',_0x508380+'.'+_0x3a7f95)))[_0x714b('0x46')]();}function insertCmHopperAdditionalPhones(_0xa08b62){var _0x408bb1=[_0x714b('0x4d'),_0x714b('0x4e'),'cm_contact_has_items.OrderBy',_0x714b('0x4f'),_0x714b('0x50')];return squel['insert']()[_0x714b('0x48')](_0x714b('0x51'))[_0x714b('0x36')](['CmHopperId',_0x714b('0x12'),_0x714b('0x52'),_0x714b('0x39'),_0x714b('0x3a')],squel['select']()[_0x714b('0x3d')](_0x408bb1)[_0x714b('0x13')](_0x714b('0x35'))[_0x714b('0x14')](_0x714b('0x3e'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x714b('0x41')](_0x714b('0x53'),_0xa08b62)[_0x714b('0x41')](_0x714b('0x4a'),NOW))[_0x714b('0x46')]();}function insertCmContact(_0x4f6f79,_0x59d78a,_0x7387da,_0x404d30){var _0x2752ab=_['concat'](_[_0x714b('0x54')](_0x404d30),[_0x714b('0x38'),_0x714b('0x55'),_0x714b('0x39'),_0x714b('0x3a')]);return squel[_0x714b('0x34')]()['into'](_0x714b('0x3e'))[_0x714b('0x36')](_0x2752ab,squel[_0x714b('0x11')]()['fields'](_0x2752ab)[_0x714b('0x13')](_0x59d78a)['where']('('+_0x7387da[_0x714b('0x14')](',')+_0x714b('0x56'),squel[_0x714b('0x11')]()[_0x714b('0x3d')](_0x7387da)['from'](_0x714b('0x3e'))[_0x714b('0x41')](_0x714b('0x4c'),_0x4f6f79))['where']('id\x20IN\x20?',squel['select']()[_0x714b('0x4b')](_0x714b('0x57'),_0x714b('0x58'))[_0x714b('0x13')](_0x59d78a)[_0x714b('0x59')](_0x7387da['join'](','))))[_0x714b('0x46')]();}function handleStop(){logger[_0x714b('0x5a')](_0x714b('0x5b'));stopped=!![];}function handleUncaughtException(_0x268c7d){logger[_0x714b('0x22')](_0x268c7d['message']);process[_0x714b('0x5c')](0x1);}function handleError(_0x65975c,_0x2c5f4b){stats[_0x714b('0x5d')]['push']({'name':_0x2c5f4b['code'],'message':_0x2c5f4b['message'],'row':_0x65975c});}function handleQuery(_0x4d18ef){logger[_0x714b('0x5a')](_0x4d18ef);return db[_0x714b('0x18')][_0x714b('0x19')](_0x4d18ef)[_0x714b('0x1b')](function(_0x53acbb){results[_0x714b('0x1e')](_0x53acbb);})[_0x714b('0x21')](function(_0x5b1aa3){logger[_0x714b('0x22')](_0x5b1aa3[_0x714b('0x23')]);});}function main(_0x428f07,_0x2cd209,_0xe4450e,_0x17ffec){logger['info']('main',_0x428f07,JSON[_0x714b('0x5e')](_0x2cd209));process[_0x714b('0x5f')](_0x714b('0x60'));var _0x3cbb74=_0x2cd209[_0x714b('0x61')];var _0x439af6=_[_0x714b('0x62')](_0x3cbb74);var _0xb907be=_0x2cd209[_0x714b('0x63')];var _0x4a8857=path['join'](config[_0x714b('0x64')],_0x714b('0x65'),_0xb907be+_0x714b('0x66'));logger['info'](_0x714b('0x67'),_0x2cd209);db['ContactItemType'][_0x714b('0x68')]({'raw':!![],'attributes':['id','name']})[_0x714b('0x20')](function(_0x3fb716){for(var _0xe2221c=0x0;_0xe2221c<_0x3fb716['length'];_0xe2221c++){if(_0x3fb716[_0xe2221c][_0x714b('0x69')]in _0x3cbb74){contactItemTypes[_0x714b('0x1e')](_0x3fb716[_0xe2221c]);delete _0x439af6[_0x3fb716[_0xe2221c][_0x714b('0x69')]];hasAdditionalPhones=!![];}for(var _0x3973d1 in _0x3cbb74){if(_0x3fb716[_0xe2221c]['name']+'_description'===_0x3973d1){phoneDescriptions['push']({'itemTypeId':_0x3fb716[_0xe2221c]['id'],'description':_0x3973d1});delete _0x439af6[_0x3973d1];}}}if(hasAdditionalPhones)_0x439af6[_0x714b('0x24')]='';var _0x500078=_[_0x714b('0x54')](_0x439af6)[_0x714b('0x14')]();logger[_0x714b('0x5a')]('header',_0x500078);fs[_0x714b('0x6a')](_0x4a8857,_0x500078+'\x0a');Papa[_0x714b('0x6b')](fs[_0x714b('0x6c')](_0x428f07),{'header':!![],'skipEmptyLines':!![],'step':function(_0x31bc0d,_0x5883a8){try{for(var _0x286a9e=0x0,_0x2934b6=[];_0x286a9e<_0x31bc0d[_0x714b('0x6d')][_0x714b('0x1c')];_0x286a9e++){stats['rows']+=0x1;if(_0x31bc0d[_0x714b('0x5d')][_0x286a9e]){handleError(_0x31bc0d['data'][_0x286a9e],_0x31bc0d['errors'][_0x286a9e]);}else{var _0x4fc8f3=[];var _0xac2305=[];var _0x556957={};for(var _0x2bd89f in _0x3cbb74){let _0xb41aec=contactItemTypes['find'](_0x7567e2=>_0x7567e2['name']===_0x2bd89f);let _0x5b8948=contactItemTypes[_0x714b('0x6e')](_0x542cae=>_0x542cae[_0x714b('0x69')]+_0x714b('0x6f')===_0x2bd89f);if(_['isNil'](_0xb41aec)&&_[_0x714b('0x1d')](_0x5b8948)){if(_0x3cbb74[_0x714b('0x70')](_0x2bd89f)){if(_0x31bc0d['data'][_0x286a9e][_0x3cbb74[_0x2bd89f]]){var _0x3ab789=_[_0x714b('0x71')](_0x31bc0d[_0x714b('0x6d')][_0x286a9e][_0x3cbb74[_0x2bd89f]][_0x714b('0x72')](/"/g,'\x27'));switch(_0x2bd89f){case'scheduledat':var _0x243bfc=moment(_0x3ab789,_0x714b('0xd'),!![]);if(_0x243bfc['isValid']()){_0x2934b6[_0x714b('0x1e')]('\x22'+_0x3ab789+'\x22');}else{_0x4fc8f3['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x26cc9c=parseInt(_0x3ab789);_0x3ab789=_[_0x714b('0x73')](_0x26cc9c)||_0x26cc9c<0x0||_0x26cc9c>0x4?_0x17ffec?0x3:0x2:_0x26cc9c;_0x2934b6[_0x714b('0x1e')]('\x22'+_0x3ab789+'\x22');break;case _0x714b('0x3b'):var _0x2f69af=parseInt(_0x3ab789);if(_[_0x714b('0x74')](_0x2f69af)&&_['includes'](_0xe4450e,_0x2f69af)){_0x2934b6[_0x714b('0x1e')]('\x22'+_0x2f69af+'\x22');}else{_0x4fc8f3[_0x714b('0x1e')](_0x714b('0x75'));}break;case _0x714b('0x76'):if(isEmail(_0x3ab789)){_0x2934b6['push']('\x22'+_0x3ab789+'\x22');}else{_0x4fc8f3[_0x714b('0x1e')](_0x714b('0x77'));}break;case _0x714b('0x78'):var _0x6ae3e3=moment(_0x3ab789,'YYYY-MM-DD',!![]);if(_0x6ae3e3[_0x714b('0x79')]()){_0x2934b6['push']('\x22'+_0x3ab789+'\x22');}else{_0x4fc8f3[_0x714b('0x1e')](_0x714b('0x7a'));}break;default:_0x2934b6[_0x714b('0x1e')]('\x22'+_0x3ab789+'\x22');}}else{switch(_0x2bd89f){case _0x714b('0x7b'):case'phone':_0x4fc8f3['push'](_0x2bd89f+_0x714b('0x7c'));break;default:_0x2934b6[_0x714b('0x1e')]('\x22\x22');}}}}else{var _0x3a0763='';if(!_[_0x714b('0x1d')](_0xb41aec)){if(!_0x556957[_0x714b('0x70')](_0xb41aec['id'])){for(var _0x2dfeed=0x0;_0x2dfeed<_0x3cbb74[_0x2bd89f][_0x714b('0x1c')];_0x2dfeed++){var _0x3ab789=_[_0x714b('0x71')](_0x31bc0d[_0x714b('0x6d')][_0x286a9e][_0x3cbb74[_0x2bd89f][_0x2dfeed]][_0x714b('0x72')](/"/g,'\x27'));var _0x33e765=phoneDescriptions[_0x714b('0x6e')](_0x496a7c=>_0x496a7c['itemTypeId']===_0xb41aec['id']);if(!_['isNil'](_0x33e765)){var _0x295b53=_[_0x714b('0x71')](_0x31bc0d['data'][_0x286a9e][_0x3cbb74[_0x33e765[_0x714b('0x7d')]][0x0]][_0x714b('0x72')](/"/g,'\x27'));if(!_['isNil'](_0x295b53))_0x3ab789=_0x3ab789+'§'+_0x295b53;}if(_0x3a0763=='')_0x3a0763=_0x3ab789;else _0x3a0763+='|'+_0x3ab789;}_0xac2305['push'](_0xb41aec['id']+':'+_0x3a0763);_0x556957[_0xb41aec['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2934b6[_0x714b('0x1e')]('\x22'+_0xac2305['join'](';')+'\x22');}if(_0x4fc8f3['length']){handleError(_0x31bc0d['data'][_0x286a9e],{'code':_0x714b('0x7e'),'message':_0x4fc8f3['join']()});}else{fs[_0x714b('0x7f')](_0x4a8857,_0x2934b6['join']()+'\x0a');}_0x2934b6=[];}if(!(stats['rows']%0xc8)){socket[_0x714b('0x80')](_0x714b('0x81')+_0xb907be,stats);stats[_0x714b('0x5d')]=[];}}if(stopped){logger['info'](_0x714b('0x82'));_0x5883a8['abort']();}}catch(_0x8de91){handleError(_0x31bc0d[_0x714b('0x6d')][_0x286a9e],{'code':_0x714b('0x83'),'message':_0x8de91[_0x714b('0x23')]});logger[_0x714b('0x22')](_0x714b('0x84'),_0x8de91[_0x714b('0x23')]);}},'complete':function(){try{var _0x4dbb8f=[];var _0x3b8f53=tempTableName;_0x4dbb8f[_0x714b('0x1e')]('CREATE\x20TABLE\x20'+_0x3b8f53+'\x20LIKE\x20cm_contacts;');logger[_0x714b('0x5a')]('CIS\x20len',contactItemTypes[_0x714b('0x1c')]);var _0x4f4b2a=util[_0x714b('0xc')](_0x714b('0x85'),_0x4a8857,_0x3b8f53,_0x500078,_0x2cd209[_0x714b('0x38')],_0x2cd209['CompanyId']||null,NOW,NOW);if(_[_0x714b('0x1d')](_0x3cbb74[_0x714b('0x86')])){_0x4f4b2a+=_0x714b('0x87');}_0x4dbb8f[_0x714b('0x1e')](_0x4f4b2a);BPromise[_0x714b('0x88')](_0x4dbb8f,handleQuery)[_0x714b('0x20')](function(_0x2a37bb){BPromise[_0x714b('0x1f')]([handleAdditionalPhones()])[_0x714b('0x20')](function(){_0x4dbb8f=[];for(var _0x152204=0x0;_0x152204<promisesContact['length'];_0x152204++){_0x4dbb8f[_0x714b('0x1e')](updateContact(promisesContact[_0x152204]['contact']));}BPromise[_0x714b('0x1f')](_0x4dbb8f)[_0x714b('0x20')](function(){_0x4dbb8f=[];for(var _0x3f8601=0x0;_0x3f8601<promisesAdditionalPhones[_0x714b('0x1c')];_0x3f8601++){_0x4dbb8f[_0x714b('0x1e')](createAdditionalPhone(promisesAdditionalPhones[_0x3f8601]['contactId'],promisesAdditionalPhones[_0x3f8601]['contactTypeId'],promisesAdditionalPhones[_0x3f8601][_0x714b('0x12')],promisesAdditionalPhones[_0x3f8601][_0x714b('0x89')]));}BPromise['all'](_0x4dbb8f)[_0x714b('0x20')](function(){_0x4dbb8f=[];_0x4dbb8f[_0x714b('0x1e')](insertCmHopperAdditionalPhones(_0x2cd209['ListId']));_0x4dbb8f[_0x714b('0x1e')](_0x714b('0x8a')+_0x3b8f53+';');BPromise[_0x714b('0x88')](_0x4dbb8f,handleQuery)['then'](function(_0xa9b8b1){stats[_0x714b('0x8b')]=!![];stats[_0x714b('0x8c')]=updatedRows;socket[_0x714b('0x80')](_0x714b('0x81')+_0xb907be,stats);fs[_0x714b('0x8d')](_0x428f07);fs['unlink'](_0x4a8857);process[_0x714b('0x5c')](0x0);})[_0x714b('0x21')](function(_0x2663d4){logger[_0x714b('0x22')](_0x2663d4['message']);process[_0x714b('0x5c')](0x1);});});});});})[_0x714b('0x21')](function(_0x5796e1){logger['error'](_0x5796e1[_0x714b('0x23')]);process[_0x714b('0x5c')](0x1);});}catch(_0x15e0cd){logger[_0x714b('0x22')]('complete',_0x15e0cd[_0x714b('0x23')]);process[_0x714b('0x5c')](0x1);}},'error':function(_0x46eb9b,_0x427814,_0x109646,_0x5a1bad){throw new Error(_0x5a1bad);}});});}function validate(){if(process['argv']&&process[_0x714b('0x8e')]['length']<0x4){throw new Error(_0x714b('0x8f'));}var _0x1d9896=path[_0x714b('0x14')](config[_0x714b('0x64')],_0x714b('0x65'),process['argv'][0x2]);if(!fs[_0x714b('0x90')](_0x1d9896)){throw new Error(_0x714b('0x91'));}var _0x3bbad7={};try{_0x3bbad7=JSON[_0x714b('0x6b')](process['argv'][0x3]);if(!_0x3bbad7[_0x714b('0x61')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0xf46fa6=0x0;if(_0x3bbad7[_0x714b('0x61')]['UserId']){_0xf46fa6=0x1;}if(!_0x3bbad7['ListId']){throw new Error(_0x714b('0x92'));}}catch(_0x32aae6){throw new Error('body\x20id\x20mandatory');}var _0x7bae1b=[];try{_0x7bae1b=_['map'](JSON[_0x714b('0x6b')](process[_0x714b('0x8e')][0x4]),'id');}catch(_0x189910){logger[_0x714b('0x5a')](_0x714b('0x93'));}main(_0x1d9896,_0x3bbad7,_0x7bae1b,_0xf46fa6);}validate();process['on'](_0x714b('0x94'),handleStop);process['on'](_0x714b('0x95'),handleUncaughtException);
\ No newline at end of file
+var _0xeb43=['existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','ioredis','../../../mysqldb','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','where','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','into','cm_hopper_black','createdAt','updatedAt','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','code','main','stringify','start','binding','clone','root','server/files/tmp','ContactItemType','name','_description','header','writeFileSync','createReadStream','rows','errors','find','hasOwnProperty','replace','isValid','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','itemTypeId','data','description','SystemRow','emit','Abort\x20parser','abort','SystemError','step','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()','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb43,0x149));var _0x3eb4=function(_0x240362,_0x156794){_0x240362=_0x240362-0x0;var _0x26de18=_0xeb43[_0x240362];return _0x26de18;};'use strict';var fs=require('fs');var path=require(_0x3eb4('0x0'));var _=require(_0x3eb4('0x1'));var Papa=require(_0x3eb4('0x2'));var util=require('util');var BPromise=require(_0x3eb4('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x3eb4('0x4'));var db=require(_0x3eb4('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x3eb4('0x6'));config[_0x3eb4('0x7')]=_['defaults'](config[_0x3eb4('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3eb4('0x8'))(new Redis(config['redis']));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()[_0x3eb4('0x9')](_0x3eb4('0xa'));var tempTableName=_0x3eb4('0xb')+moment()[_0x3eb4('0x9')](_0x3eb4('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5cb468){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))*$/[_0x3eb4('0xd')](_0x5cb468);}function selectNotIn(_0x4bdf6e,_0x25fedc,_0x1ead72,_0x1dcccc,_0x35cb9b){return squel['select']()[_0x3eb4('0xe')](_0x3eb4('0xf'))[_0x3eb4('0x10')](_0x1dcccc)[_0x3eb4('0x11')](_0x25fedc,null,_0x25fedc+_0x3eb4('0x12')+_0x1dcccc+'.'+_0x1ead72)[_0x3eb4('0x13')](_0x1dcccc+'.'+_0x1ead72+'\x20=\x20'+_0x4bdf6e+'.'+_0x1ead72)[_0x3eb4('0x13')](_0x25fedc+'.dialCheckDuplicateType\x20IN\x20('+_0x35cb9b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x45342a,_0x54e9c3){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3eb4('0x14')][_0x3eb4('0x15')](_0x3eb4('0x16')+tempTableName)[_0x3eb4('0x17')](function(_0xc5b9c2){if(_0xc5b9c2!==null){var _0x458fc7=[];for(var _0x20ca34=0x0;_0x20ca34<_0xc5b9c2[_0x3eb4('0x18')];_0x20ca34++){var _0x150325=_0xc5b9c2[_0x20ca34];if(!_[_0x3eb4('0x19')](_0x150325['phone'])){if(!_[_0x3eb4('0x19')](_0x150325[_0x3eb4('0x1a')]))_0x458fc7[_0x3eb4('0x1b')](insertAdditionalPhones(_0x150325));promisesContact[_0x3eb4('0x1b')]({'contact':_0x150325});}}}Promise[_0x3eb4('0x1c')](_0x458fc7)[_0x3eb4('0x1d')](function(){_0x45342a({'val':0x1});});})[_0x3eb4('0x1e')](function(_0x2d9b2c){logger[_0x3eb4('0x1f')](_0x2d9b2c[_0x3eb4('0x20')]);});});}function insertAdditionalPhones(_0x5bb3bc){return new Promise(function(_0x55fe47,_0x276934){var _0x18675f=_0x5bb3bc[_0x3eb4('0x1a')];if(_[_0x3eb4('0x19')](_0x18675f))_0x276934({'val':0x0});else{var _0x438a7d=_0x18675f['split'](';');var _0x35c4ec=[];orderBy=0x0;for(var _0x5eb01d=0x0;_0x5eb01d<_0x438a7d[_0x3eb4('0x18')];_0x5eb01d++){_0x35c4ec['push'](splitAdditionalPhone(_0x5bb3bc['id'],_0x438a7d[_0x5eb01d]));}Promise[_0x3eb4('0x1c')](_0x35c4ec)[_0x3eb4('0x1d')](function(){_0x55fe47({'val':_0x438a7d[_0x3eb4('0x18')]});});}});}function splitAdditionalPhone(_0x1c2f04,_0x93a567){return new Promise(function(_0x54f5e7,_0x1b4c97){var _0x23568c=_0x93a567['split'](':');var _0x1f07d1=_0x23568c[0x0];var _0x28c235=_0x23568c[0x1];if(_0x28c235!==''){var _0x3eae18=_0x28c235[_0x3eb4('0x21')]('|');var _0x57401a=[];for(var _0x21bd1b=0x0;_0x21bd1b<_0x3eae18[_0x3eb4('0x18')];_0x21bd1b++){if(_0x3eae18[_0x21bd1b]!==''){var _0x96d1e=_['filter'](promisesAdditionalPhones,{'contactId':_0x1c2f04,'phone':_0x3eae18[_0x21bd1b]});if(_0x96d1e[_0x3eb4('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x3eb4('0x1b')]({'contactId':_0x1c2f04,'contactTypeId':_0x1f07d1,'phone':_0x3eae18[_0x21bd1b],'orderBy':orderBy});}}}_0x54f5e7({'ok':0x1});}else _0x54f5e7({'res':0x0});});}function createAdditionalPhone(_0x281a5a,_0x3fd1a7,_0x51ef72,_0x558d6d){var _0x3fd753='';var _0x5ce230='';var _0x225933=_0x51ef72['split']('§');_0x3fd753=_0x225933[0x0];if(_0x225933['length']==0x2)_0x5ce230=_0x225933[0x1];return new Promise(function(_0x3f1539,_0x5975e4){return db[_0x3eb4('0x22')][_0x3eb4('0x23')]({'where':{'CmContactId':_0x281a5a,'item':_0x3fd753}})[_0x3eb4('0x1d')](function(_0xb55d7e){if(_0xb55d7e){return db[_0x3eb4('0x22')][_0x3eb4('0x24')]({'ItemTypeId':_0x3fd1a7,'description':_0x5ce230,'OrderBy':_0x558d6d},{'where':{'CmContactId':_0x281a5a,'item':_0x3fd753}})['then'](function(_0x5e2611){_0x3f1539({'res':_0x3eb4('0x25')});});}else{return db[_0x3eb4('0x22')][_0x3eb4('0x26')]({'CmContactId':_0x281a5a,'item':_0x3fd753,'ItemTypeId':_0x3fd1a7,'description':_0x5ce230,'OrderBy':_0x558d6d,'ItemClass':_0x3eb4('0x27')})[_0x3eb4('0x1d')](function(_0x4c6378){_0x3f1539({'res':_0x3eb4('0x28')});});}});});}function updateContact(_0x42b01a){return new Promise(function(_0x2bef74,_0x2c5fcd){var _0x30ac1f=_0x42b01a['id'];delete _0x42b01a['id'];return db['CmContact']['update'](_0x42b01a,{'where':{'id':_0x30ac1f}})[_0x3eb4('0x1d')](function(_0x1d30af){updatedRows+=0x1;return db[_0x3eb4('0x29')][_0x3eb4('0x24')]({'phone':_0x42b01a[_0x3eb4('0xf')]},{'where':{'ContactId':_0x30ac1f}})[_0x3eb4('0x1d')](function(_0x470884){_0x2bef74({'ret':'OK'});});});});}function insertCmHopper(_0x5607a5,_0xad065,_0x4dba0b,_0x22605a,_0x49b046){var _0x5fc6c=[_0x3eb4('0x2a'),_0x3eb4('0x2b'),'cm_contacts.id','cm_contacts.ListId',_0xad065+'.'+_0x22605a,_0x3eb4('0x2c'),_0x3eb4('0x2d'),_0x3eb4('0x2e'),_0x3eb4('0x2f'),'\x22'+_0x49b046+'\x22'];return squel[_0x3eb4('0x30')]()['into'](_0x3eb4('0x31'))[_0x3eb4('0x32')](['phone',_0x3eb4('0x33'),_0x3eb4('0x34'),_0x3eb4('0x35'),_0x22605a,'createdAt','updatedAt',_0x3eb4('0x36'),'UserId',_0x3eb4('0x37')],squel[_0x3eb4('0x38')]()[_0x3eb4('0x39')](_0x5fc6c)[_0x3eb4('0x10')](_0xad065)['join'](_0x3eb4('0x3a'),null,_0x3eb4('0x3b')+_0xad065+_0x3eb4('0x3c'))['join'](_0x4dba0b,null,_0x4dba0b+_0x3eb4('0x12')+_0xad065+'.'+_0x22605a)[_0x3eb4('0x13')](_0xad065+_0x3eb4('0x3d'),_0x5607a5)[_0x3eb4('0x13')](_0x3eb4('0x3e'),NOW)[_0x3eb4('0x13')](_0x3eb4('0x3f'),selectNotIn(_0xad065,_0x4dba0b,_0x22605a,_0x3eb4('0x31'),[_0x3eb4('0x40'),_0x3eb4('0x41')]))[_0x3eb4('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xad065,_0x4dba0b,_0x22605a,'cm_hopper',[_0x3eb4('0x40')])))[_0x3eb4('0x42')]();}function insertCmHopperBlack(_0x32a6da,_0x3ed25a,_0x33855e,_0x14d5be){var _0x2057ad=[_0x3eb4('0x2a'),'cm_contacts.id',_0x3eb4('0x43'),_0x3ed25a+'.'+_0x14d5be,'cm_contacts.createdAt',_0x3eb4('0x2d')];return squel[_0x3eb4('0x30')]()[_0x3eb4('0x44')](_0x3eb4('0x45'))[_0x3eb4('0x32')]([_0x3eb4('0xf'),_0x3eb4('0x34'),_0x3eb4('0x35'),_0x14d5be,_0x3eb4('0x46'),_0x3eb4('0x47')],squel['select']()[_0x3eb4('0x39')](_0x2057ad)[_0x3eb4('0x10')](_0x3ed25a)[_0x3eb4('0x11')]('cm_contacts',null,_0x3eb4('0x3b')+_0x3ed25a+'.CmListId')[_0x3eb4('0x11')](_0x33855e,null,_0x33855e+'.id\x20=\x20'+_0x3ed25a+'.'+_0x14d5be)[_0x3eb4('0x13')](_0x3ed25a+_0x3eb4('0x3d'),_0x32a6da)[_0x3eb4('0x13')](_0x3eb4('0x3e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x3eb4('0x38')]()[_0x3eb4('0xe')](_0x3eb4('0xf'))[_0x3eb4('0x10')](_0x3eb4('0x45'))[_0x3eb4('0x13')](_0x3eb4('0x48'),_0x32a6da)[_0x3eb4('0x13')](_0x14d5be+_0x3eb4('0x49'),_0x3ed25a+'.'+_0x14d5be)))[_0x3eb4('0x42')]();}function insertCmHopperAdditionalPhones(_0x4f1fee){var _0x9b5f26=[_0x3eb4('0x4a'),_0x3eb4('0x4b'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x3eb4('0x4c')];return squel['insert']()[_0x3eb4('0x44')](_0x3eb4('0x4d'))[_0x3eb4('0x32')]([_0x3eb4('0x4e'),_0x3eb4('0xf'),_0x3eb4('0x4f'),_0x3eb4('0x46'),_0x3eb4('0x47')],squel[_0x3eb4('0x38')]()[_0x3eb4('0x39')](_0x9b5f26)[_0x3eb4('0x10')](_0x3eb4('0x31'))[_0x3eb4('0x11')]('cm_contacts',null,_0x3eb4('0x50'))[_0x3eb4('0x11')]('cm_contact_has_items',null,_0x3eb4('0x51'))['where'](_0x3eb4('0x52'),_0x4f1fee)[_0x3eb4('0x13')](_0x3eb4('0x3e'),NOW))[_0x3eb4('0x42')]();}function insertCmContact(_0x134d2e,_0x411eb0,_0x6e3d23,_0x2079f){var _0x52c79a=_['concat'](_[_0x3eb4('0x53')](_0x2079f),[_0x3eb4('0x35'),'CompanyId',_0x3eb4('0x46'),_0x3eb4('0x47')]);return squel['insert']()[_0x3eb4('0x44')]('cm_contacts')[_0x3eb4('0x32')](_0x52c79a,squel[_0x3eb4('0x38')]()['fields'](_0x52c79a)[_0x3eb4('0x10')](_0x411eb0)['where']('('+_0x6e3d23[_0x3eb4('0x11')](',')+_0x3eb4('0x54'),squel[_0x3eb4('0x38')]()[_0x3eb4('0x39')](_0x6e3d23)['from']('cm_contacts')[_0x3eb4('0x13')](_0x3eb4('0x48'),_0x134d2e))['where'](_0x3eb4('0x55'),squel[_0x3eb4('0x38')]()[_0x3eb4('0xe')](_0x3eb4('0x56'),_0x3eb4('0x57'))[_0x3eb4('0x10')](_0x411eb0)['group'](_0x6e3d23['join'](','))))[_0x3eb4('0x42')]();}function handleStop(){logger[_0x3eb4('0x58')](_0x3eb4('0x59'));stopped=!![];}function handleUncaughtException(_0x1b72b9){logger[_0x3eb4('0x1f')](_0x1b72b9[_0x3eb4('0x20')]);process[_0x3eb4('0x5a')](0x1);}function handleError(_0x564bd5,_0x12c922){stats['errors'][_0x3eb4('0x1b')]({'name':_0x12c922[_0x3eb4('0x5b')],'message':_0x12c922[_0x3eb4('0x20')],'row':_0x564bd5});}function handleQuery(_0x462025){logger[_0x3eb4('0x58')](_0x462025);return db[_0x3eb4('0x14')][_0x3eb4('0x15')](_0x462025)['spread'](function(_0x565e18){results[_0x3eb4('0x1b')](_0x565e18);})[_0x3eb4('0x1e')](function(_0x5477de){logger[_0x3eb4('0x1f')](_0x5477de[_0x3eb4('0x20')]);});}function main(_0x1ca2a2,_0x3e4959,_0x156304,_0x27d609){logger[_0x3eb4('0x58')](_0x3eb4('0x5c'),_0x1ca2a2,JSON[_0x3eb4('0x5d')](_0x3e4959));process['send'](_0x3eb4('0x5e'));var _0x360240=_0x3e4959[_0x3eb4('0x5f')];var _0x5d6fd2=_[_0x3eb4('0x60')](_0x360240);var _0x4010fc=_0x3e4959['socket_timestamp'];var _0x439bf7=path['join'](config[_0x3eb4('0x61')],_0x3eb4('0x62'),_0x4010fc+'.csv');logger[_0x3eb4('0x58')]('body',_0x3e4959);db[_0x3eb4('0x63')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x3eb4('0x1d')](function(_0x2986bd){for(var _0x477873=0x0;_0x477873<_0x2986bd[_0x3eb4('0x18')];_0x477873++){if(_0x2986bd[_0x477873][_0x3eb4('0x64')]in _0x360240){contactItemTypes[_0x3eb4('0x1b')](_0x2986bd[_0x477873]);delete _0x5d6fd2[_0x2986bd[_0x477873][_0x3eb4('0x64')]];hasAdditionalPhones=!![];}for(var _0x13ea32 in _0x360240){if(_0x2986bd[_0x477873][_0x3eb4('0x64')]+_0x3eb4('0x65')===_0x13ea32){phoneDescriptions[_0x3eb4('0x1b')]({'itemTypeId':_0x2986bd[_0x477873]['id'],'description':_0x13ea32});delete _0x5d6fd2[_0x13ea32];}}}if(hasAdditionalPhones)_0x5d6fd2[_0x3eb4('0x1a')]='';var _0x1125cf=_['keys'](_0x5d6fd2)['join']();logger[_0x3eb4('0x58')](_0x3eb4('0x66'),_0x1125cf);fs[_0x3eb4('0x67')](_0x439bf7,_0x1125cf+'\x0a');Papa['parse'](fs[_0x3eb4('0x68')](_0x1ca2a2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x229261,_0xe77724){try{for(var _0x32b1b8=0x0,_0x2fcfc2=[];_0x32b1b8<_0x229261['data'][_0x3eb4('0x18')];_0x32b1b8++){stats[_0x3eb4('0x69')]+=0x1;if(_0x229261[_0x3eb4('0x6a')][_0x32b1b8]){handleError(_0x229261['data'][_0x32b1b8],_0x229261[_0x3eb4('0x6a')][_0x32b1b8]);}else{var _0x140a4a=[];var _0x83c9f1=[];var _0x1df7da={};for(var _0x3602f7 in _0x360240){let _0xfedfa0=contactItemTypes[_0x3eb4('0x6b')](_0x2ba987=>_0x2ba987['name']===_0x3602f7);let _0x4cbd27=contactItemTypes['find'](_0x440178=>_0x440178['name']+_0x3eb4('0x65')===_0x3602f7);if(_[_0x3eb4('0x19')](_0xfedfa0)&&_[_0x3eb4('0x19')](_0x4cbd27)){if(_0x360240[_0x3eb4('0x6c')](_0x3602f7)){if(_0x229261['data'][_0x32b1b8][_0x360240[_0x3602f7]]){var _0x262165=_['trim'](_0x229261['data'][_0x32b1b8][_0x360240[_0x3602f7]][_0x3eb4('0x6d')](/"/g,'\x27'));switch(_0x3602f7){case _0x3eb4('0x33'):var _0x24c1a2=moment(_0x262165,_0x3eb4('0xa'),!![]);if(_0x24c1a2[_0x3eb4('0x6e')]()){_0x2fcfc2['push']('\x22'+_0x262165+'\x22');}else{_0x140a4a[_0x3eb4('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3eb4('0x36'):var _0x3fc7e8=parseInt(_0x262165);_0x262165=_[_0x3eb4('0x6f')](_0x3fc7e8)||_0x3fc7e8<0x0||_0x3fc7e8>0x4?_0x27d609?0x3:0x2:_0x3fc7e8;_0x2fcfc2[_0x3eb4('0x1b')]('\x22'+_0x262165+'\x22');break;case _0x3eb4('0x70'):var _0x6e37fd=parseInt(_0x262165);if(_[_0x3eb4('0x71')](_0x6e37fd)&&_[_0x3eb4('0x72')](_0x156304,_0x6e37fd)){_0x2fcfc2['push']('\x22'+_0x6e37fd+'\x22');}else{_0x140a4a[_0x3eb4('0x1b')](_0x3eb4('0x73'));}break;case _0x3eb4('0x74'):if(isEmail(_0x262165)){_0x2fcfc2[_0x3eb4('0x1b')]('\x22'+_0x262165+'\x22');}else{_0x140a4a[_0x3eb4('0x1b')]('email\x20wrong\x20format');}break;case _0x3eb4('0x75'):var _0x4eb975=moment(_0x262165,_0x3eb4('0x76'),!![]);if(_0x4eb975[_0x3eb4('0x6e')]()){_0x2fcfc2[_0x3eb4('0x1b')]('\x22'+_0x262165+'\x22');}else{_0x140a4a[_0x3eb4('0x1b')](_0x3eb4('0x77'));}break;default:_0x2fcfc2[_0x3eb4('0x1b')]('\x22'+_0x262165+'\x22');}}else{switch(_0x3602f7){case _0x3eb4('0x78'):case _0x3eb4('0xf'):_0x140a4a['push'](_0x3602f7+_0x3eb4('0x79'));break;default:_0x2fcfc2[_0x3eb4('0x1b')]('\x22\x22');}}}}else{var _0x113a2d='';if(!_[_0x3eb4('0x19')](_0xfedfa0)){if(!_0x1df7da['hasOwnProperty'](_0xfedfa0['id'])){for(var _0x32788c=0x0;_0x32788c<_0x360240[_0x3602f7]['length'];_0x32788c++){var _0x262165=_[_0x3eb4('0x7a')](_0x229261['data'][_0x32b1b8][_0x360240[_0x3602f7][_0x32788c]][_0x3eb4('0x6d')](/"/g,'\x27'));var _0x780df0=phoneDescriptions[_0x3eb4('0x6b')](_0x1700c8=>_0x1700c8[_0x3eb4('0x7b')]===_0xfedfa0['id']);if(!_[_0x3eb4('0x19')](_0x780df0)){var _0x27818a=_[_0x3eb4('0x7a')](_0x229261[_0x3eb4('0x7c')][_0x32b1b8][_0x360240[_0x780df0[_0x3eb4('0x7d')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x3eb4('0x19')](_0x27818a))_0x262165=_0x262165+'§'+_0x27818a;}if(_0x113a2d=='')_0x113a2d=_0x262165;else _0x113a2d+='|'+_0x262165;}_0x83c9f1[_0x3eb4('0x1b')](_0xfedfa0['id']+':'+_0x113a2d);_0x1df7da[_0xfedfa0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2fcfc2[_0x3eb4('0x1b')]('\x22'+_0x83c9f1[_0x3eb4('0x11')](';')+'\x22');}if(_0x140a4a[_0x3eb4('0x18')]){handleError(_0x229261['data'][_0x32b1b8],{'code':_0x3eb4('0x7e'),'message':_0x140a4a[_0x3eb4('0x11')]()});}else{fs['appendFileSync'](_0x439bf7,_0x2fcfc2['join']()+'\x0a');}_0x2fcfc2=[];}if(!(stats[_0x3eb4('0x69')]%0xc8)){socket[_0x3eb4('0x7f')]('contact:import:'+_0x4010fc,stats);stats[_0x3eb4('0x6a')]=[];}}if(stopped){logger[_0x3eb4('0x58')](_0x3eb4('0x80'));_0xe77724[_0x3eb4('0x81')]();}}catch(_0x183b7c){handleError(_0x229261[_0x3eb4('0x7c')][_0x32b1b8],{'code':_0x3eb4('0x82'),'message':_0x183b7c[_0x3eb4('0x20')]});logger['error'](_0x3eb4('0x83'),_0x183b7c['message']);}},'complete':function(){try{var _0x5a3fb2=[];var _0x5a9328=tempTableName;_0x5a3fb2[_0x3eb4('0x1b')](_0x3eb4('0x84')+_0x5a9328+_0x3eb4('0x85'));logger[_0x3eb4('0x58')](_0x3eb4('0x86'),contactItemTypes[_0x3eb4('0x18')]);var _0x169cc5=util[_0x3eb4('0x9')](_0x3eb4('0x87'),_0x439bf7,_0x5a9328,_0x1125cf,_0x3e4959[_0x3eb4('0x35')],_0x3e4959[_0x3eb4('0x88')]||null,NOW,NOW);if(_[_0x3eb4('0x19')](_0x360240[_0x3eb4('0x33')])){_0x169cc5+=_0x3eb4('0x89');}_0x5a3fb2[_0x3eb4('0x1b')](_0x169cc5);BPromise['each'](_0x5a3fb2,handleQuery)[_0x3eb4('0x1d')](function(_0x23aacd){BPromise[_0x3eb4('0x1c')]([handleAdditionalPhones()])[_0x3eb4('0x1d')](function(){_0x5a3fb2=[];for(var _0xc0acb4=0x0;_0xc0acb4<promisesContact[_0x3eb4('0x18')];_0xc0acb4++){_0x5a3fb2[_0x3eb4('0x1b')](updateContact(promisesContact[_0xc0acb4][_0x3eb4('0x8a')]));}BPromise[_0x3eb4('0x1c')](_0x5a3fb2)[_0x3eb4('0x1d')](function(){_0x5a3fb2=[];for(var _0x349821=0x0;_0x349821<promisesAdditionalPhones['length'];_0x349821++){_0x5a3fb2[_0x3eb4('0x1b')](createAdditionalPhone(promisesAdditionalPhones[_0x349821][_0x3eb4('0x8b')],promisesAdditionalPhones[_0x349821][_0x3eb4('0x8c')],promisesAdditionalPhones[_0x349821][_0x3eb4('0xf')],promisesAdditionalPhones[_0x349821][_0x3eb4('0x8d')]));}BPromise[_0x3eb4('0x1c')](_0x5a3fb2)[_0x3eb4('0x1d')](function(){_0x5a3fb2=[];_0x5a3fb2[_0x3eb4('0x1b')](insertCmHopperAdditionalPhones(_0x3e4959['ListId']));_0x5a3fb2[_0x3eb4('0x1b')](_0x3eb4('0x8e')+_0x5a9328+';');BPromise[_0x3eb4('0x8f')](_0x5a3fb2,handleQuery)['then'](function(_0x10abf8){stats[_0x3eb4('0x90')]=!![];stats[_0x3eb4('0x91')]=updatedRows;socket[_0x3eb4('0x7f')](_0x3eb4('0x92')+_0x4010fc,stats);fs[_0x3eb4('0x93')](_0x1ca2a2);fs[_0x3eb4('0x93')](_0x439bf7);process[_0x3eb4('0x5a')](0x0);})[_0x3eb4('0x1e')](function(_0x276f3c){logger[_0x3eb4('0x1f')](_0x276f3c[_0x3eb4('0x20')]);process['exit'](0x1);});});});});})['catch'](function(_0x983a61){logger[_0x3eb4('0x1f')](_0x983a61[_0x3eb4('0x20')]);process['exit'](0x1);});}catch(_0x4d2d90){logger[_0x3eb4('0x1f')](_0x3eb4('0x94'),_0x4d2d90[_0x3eb4('0x20')]);process[_0x3eb4('0x5a')](0x1);}},'error':function(_0x3806d2,_0x485a76,_0x2800e2,_0x5282ad){throw new Error(_0x5282ad);}});});}function validate(){if(process[_0x3eb4('0x95')]&&process['argv'][_0x3eb4('0x18')]<0x4){throw new Error(_0x3eb4('0x96'));}var _0x491f45=path[_0x3eb4('0x11')](config[_0x3eb4('0x61')],'server/files/tmp',process[_0x3eb4('0x95')][0x2]);if(!fs[_0x3eb4('0x97')](_0x491f45)){throw new Error(_0x3eb4('0x98'));}var _0x70b610={};try{_0x70b610=JSON[_0x3eb4('0x99')](process[_0x3eb4('0x95')][0x3]);if(!_0x70b610['binding']){throw new Error(_0x3eb4('0x9a'));}var _0x13d6c0=0x0;if(_0x70b610[_0x3eb4('0x5f')][_0x3eb4('0x70')]){_0x13d6c0=0x1;}if(!_0x70b610[_0x3eb4('0x35')]){throw new Error(_0x3eb4('0x9b'));}}catch(_0x2886d5){throw new Error(_0x3eb4('0x9c'));}var _0x4f317c=[];try{_0x4f317c=_[_0x3eb4('0x9d')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x3c6f55){logger['info'](_0x3eb4('0x9e'));}main(_0x491f45,_0x70b610,_0x4f317c,_0x13d6c0);}validate();process['on']('SIGINT',handleStop);process['on'](_0x3eb4('0x9f'),handleUncaughtException);
\ No newline at end of file
index 7577215..114d9d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c90=['destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','outbound','Called\x20Number','Member\x20Name','membername','uniqueid','Date','starttime','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','calleridnum','string','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','queue','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number'];(function(_0x23b572,_0x2b5f90){var _0x2b2ccd=function(_0x3ff0db){while(--_0x3ff0db){_0x23b572['push'](_0x23b572['shift']());}};_0x2b2ccd(++_0x2b5f90);}(_0x4c90,0x11e));var _0x04c9=function(_0x4785c0,_0x4b935b){_0x4785c0=_0x4785c0-0x0;var _0xfd78bd=_0x4c90[_0x4785c0];return _0xfd78bd;};'use strict';exports['getSubjects']=function(_0x499180,_0x200f6b){var _0x2fd078=[{'type':'string','content':_0x04c9('0x0'),'variableName':null}];switch(_0x499180['toLowerCase']()){case _0x04c9('0x1'):switch(_0x200f6b[_0x04c9('0x2')]()){case _0x04c9('0x3'):_0x2fd078[_0x04c9('0x4')]({'type':_0x04c9('0x5'),'content':'','variableName':'queue'});_0x2fd078['push']({'type':_0x04c9('0x5'),'content':'','variableName':_0x04c9('0x6')});break;case'outbound':_0x2fd078[_0x04c9('0x4')]({'type':_0x04c9('0x7'),'content':_0x04c9('0x8'),'variableName':null});_0x2fd078[_0x04c9('0x4')]({'type':_0x04c9('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x2fd078;};exports[_0x04c9('0x9')]=function(_0x325cd5,_0xe379e1){var _0x362a28=[];switch(_0x325cd5[_0x04c9('0x2')]()){case _0x04c9('0x1'):switch(_0xe379e1['toLowerCase']()){case _0x04c9('0x3'):_0x362a28=[{'type':_0x04c9('0x7'),'content':_0x04c9('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x04c9('0xb'),'content':'','key':'Caller\x20Number','keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x6')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0xc'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0x04c9('0xd'),'keyType':_0x04c9('0x5'),'variableName':_0x04c9('0xe')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0xf'),'keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x10')},{'type':_0x04c9('0xb'),'content':'','key':'UniqueId','keyType':_0x04c9('0x5'),'variableName':'uniqueid'},{'type':_0x04c9('0xb'),'content':'','key':'Date','keyType':'variable','variableName':_0x04c9('0x11')},{'type':_0x04c9('0x7'),'content':_0x04c9('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x13'),'keyType':'variable','variableName':_0x04c9('0x14')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x15'),'keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x16')},{'type':'string','content':_0x04c9('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x18'),'keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x11')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x19'),'keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x1a')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x1b'),'keyType':'variable','variableName':_0x04c9('0x1c')},{'type':_0x04c9('0xb'),'content':'','key':'Hold\x20Time','keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x1d')},{'type':_0x04c9('0xb'),'content':'','key':'Talk\x20Time','keyType':_0x04c9('0x5'),'variableName':_0x04c9('0x1e')}];break;case _0x04c9('0x1f'):_0x362a28=[{'type':'string','content':_0x04c9('0xa'),'variableName':null},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x20'),'keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x16')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x21'),'keyType':'variable','keyContent':'','variableName':_0x04c9('0x22')},{'type':_0x04c9('0xb'),'content':'','key':'UniqueId','keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x23')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x24'),'keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x25')},{'type':'string','content':_0x04c9('0x17')},{'type':_0x04c9('0xb'),'content':'','key':'Answer\x20Time','keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x26')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x27'),'keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x28')},{'type':_0x04c9('0xb'),'content':'','key':_0x04c9('0x29'),'keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x2a')},{'type':_0x04c9('0xb'),'content':'','key':'Billable\x20Time','keyType':_0x04c9('0x5'),'keyContent':'','variableName':_0x04c9('0x2b')}];break;}}return _0x362a28;};
\ No newline at end of file
+var _0x1c57=['Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','variable','queue','push','Outbound\x20Call','destcalleridnum','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x1c57,0x1ab));var _0x71c5=function(_0x2ff386,_0x4daef3){_0x2ff386=_0x2ff386-0x0;var _0x1c7ec1=_0x1c57[_0x2ff386];return _0x1c7ec1;};'use strict';exports[_0x71c5('0x0')]=function(_0x345c81,_0x3a018d){var _0x5a5825=[{'type':_0x71c5('0x1'),'content':_0x71c5('0x2'),'variableName':null}];switch(_0x345c81[_0x71c5('0x3')]()){case'voice':switch(_0x3a018d[_0x71c5('0x3')]()){case _0x71c5('0x4'):_0x5a5825['push']({'type':_0x71c5('0x5'),'content':'','variableName':_0x71c5('0x6')});_0x5a5825[_0x71c5('0x7')]({'type':'variable','content':'','variableName':'calleridnum'});break;case'outbound':_0x5a5825[_0x71c5('0x7')]({'type':_0x71c5('0x1'),'content':_0x71c5('0x8'),'variableName':null});_0x5a5825[_0x71c5('0x7')]({'type':'variable','content':'','variableName':_0x71c5('0x9')});break;}}return _0x5a5825;};exports['getDescriptions']=function(_0x1f28a5,_0x1c08c7){var _0x50f2bf=[];switch(_0x1f28a5[_0x71c5('0x3')]()){case _0x71c5('0xa'):switch(_0x1c08c7[_0x71c5('0x3')]()){case _0x71c5('0x4'):_0x50f2bf=[{'type':'string','content':_0x71c5('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0xd'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0xe'),'keyType':_0x71c5('0x5'),'variableName':_0x71c5('0xf')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x10'),'keyType':_0x71c5('0x5'),'variableName':'destexten'},{'type':_0x71c5('0xc'),'content':'','key':'Queue','keyType':_0x71c5('0x5'),'variableName':_0x71c5('0x6')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x11'),'keyType':'variable','variableName':_0x71c5('0x12')},{'type':'keyValue','content':'','key':_0x71c5('0x13'),'keyType':_0x71c5('0x5'),'variableName':'agentcalledAt'},{'type':_0x71c5('0x1'),'content':_0x71c5('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x15'),'keyType':_0x71c5('0x5'),'variableName':_0x71c5('0x16')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x17'),'keyType':'variable','variableName':_0x71c5('0x9')},{'type':'string','content':_0x71c5('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x71c5('0x19'),'keyType':_0x71c5('0x5'),'variableName':_0x71c5('0x1a')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x71c5('0x5'),'variableName':_0x71c5('0x1b')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x1c'),'keyType':_0x71c5('0x5'),'variableName':_0x71c5('0x1d')},{'type':_0x71c5('0xc'),'content':'','key':'Hold\x20Time','keyType':_0x71c5('0x5'),'variableName':_0x71c5('0x1e')},{'type':'keyValue','content':'','key':_0x71c5('0x1f'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x50f2bf=[{'type':'string','content':_0x71c5('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0x71c5('0x20'),'keyType':'variable','keyContent':'','variableName':_0x71c5('0x9')},{'type':'keyValue','content':'','key':_0x71c5('0x21'),'keyType':_0x71c5('0x5'),'keyContent':'','variableName':_0x71c5('0x22')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x11'),'keyType':_0x71c5('0x5'),'keyContent':'','variableName':_0x71c5('0x12')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x13'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x71c5('0x1'),'content':_0x71c5('0x18')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x23'),'keyType':_0x71c5('0x5'),'keyContent':'','variableName':_0x71c5('0x24')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x25'),'keyType':_0x71c5('0x5'),'keyContent':'','variableName':_0x71c5('0x26')},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x27'),'keyType':_0x71c5('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x71c5('0xc'),'content':'','key':_0x71c5('0x28'),'keyType':'variable','keyContent':'','variableName':_0x71c5('0x29')}];break;}}return _0x50f2bf;};
\ No newline at end of file
index f75c0ac..eaee54d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bba=['closed','getClosedOrderClause','DESC','rows','catch','tracked','clone','omit','html','phone','fax','mobile','lodash','./sql-utils','./utils','findAll','getInteractionsQuery','resolve','search','parseQueryParameters','where','body','contact','default','fields','user','read','tags','checkAccountsRestrictions','then','i.id','tag','countFilteredInteractions','count','having','clause','order','forEach'];(function(_0xd05b29,_0x34ac25){var _0x56db68=function(_0x1ab937){while(--_0x1ab937){_0xd05b29['push'](_0xd05b29['shift']());}};_0x56db68(++_0x34ac25);}(_0x3bba,0x116));var _0xa3bb=function(_0x15fdfc,_0x1b522e){_0x15fdfc=_0x15fdfc-0x0;var _0x542d9f=_0x3bba[_0x15fdfc];return _0x542d9f;};'use strict';var _=require(_0xa3bb('0x0'));var sqlUtils=require(_0xa3bb('0x1'));var utils=require(_0xa3bb('0x2'));exports[_0xa3bb('0x3')]=function(_0x5562ec,_0x22051a,_0x586af3,_0x133048,_0x396c4b){var _0xaf2440={'count':0x0,'rows':[]};var _0x31d445=sqlUtils['skipInteractionsQuery'](_0x5562ec,_0x586af3,_0x22051a);if(_0x31d445){return Promise['resolve'](_0xaf2440);}var _0x130333=sqlUtils[_0xa3bb('0x4')](_0x5562ec);var _0x3c2824={};return Promise[_0xa3bb('0x5')]()['then'](function(){if(_0x22051a['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x22051a[_0xa3bb('0x6')],_0x396c4b);}else{return sqlUtils[_0xa3bb('0x7')](_0x5562ec,_0x22051a,_0x396c4b);}})['then'](function(_0x3bd85f){_0x130333[_0xa3bb('0x8')](_0x3bd85f[_0xa3bb('0x9')]);_0x130333[_0xa3bb('0x8')](_0x3bd85f[_0xa3bb('0xa')]);_0x130333[_0xa3bb('0x8')](_0x3bd85f[_0xa3bb('0xb')]);_0x130333[_0xa3bb('0x8')](_0x3bd85f[_0xa3bb('0xc')]);_0x130333[_0xa3bb('0x8')](_0x3bd85f['filter']);_0x130333['where'](_0x3bd85f[_0xa3bb('0xd')]);_0x130333['having'](_0x3bd85f[_0xa3bb('0xe')]);_0x3c2824=_0x3bd85f[_0xa3bb('0xf')];return sqlUtils[_0xa3bb('0x10')](_0x5562ec,_0x586af3,_0x22051a);})[_0xa3bb('0x11')](function(_0x2b6487){_0x130333['where'](_0x2b6487);_0x130333['group'](_0xa3bb('0x12'));var _0x5b596b=_0x22051a[_0xa3bb('0x6')]?_0x3c2824['ids']:_0x22051a[_0xa3bb('0x13')];return sqlUtils[_0xa3bb('0x14')](_0x130333,_0x5b596b);})[_0xa3bb('0x11')](function(_0x24ec7a){_0xaf2440['count']=_0x24ec7a['length'];if(_0xaf2440[_0xa3bb('0x15')]===0x0){return[];}_0x130333[_0xa3bb('0x16')](_0x3c2824[_0xa3bb('0x17')]);if(_0x133048['order']){_0x133048[_0xa3bb('0x18')][_0xa3bb('0x19')](function(_0x4ee72a){var _0x3fc196=_0x4ee72a[0x0]==='contactName'?_0x4ee72a[0x0]:'i.'+_0x4ee72a[0x0];_0x130333['order'](_0x3fc196,_0x4ee72a[0x1]==='DESC'?![]:!![]);if(_0x4ee72a[0x0]===_0xa3bb('0x1a')){var _0x585f24=sqlUtils[_0xa3bb('0x1b')](_0x5562ec,_0x22051a);_0x130333[_0xa3bb('0x18')](_0x585f24,_0x4ee72a[0x1]===_0xa3bb('0x1c')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x5562ec,_0x130333,_0x22051a,_0x133048);})[_0xa3bb('0x11')](function(_0xa2e572){_0xaf2440[_0xa3bb('0x1d')]=_0xa2e572;return _0xaf2440;})[_0xa3bb('0x1e')](function(_0x5819ae){throw _0x5819ae;});};exports[_0xa3bb('0x1f')]=function(_0x332e1a,_0x197065){return function(_0x1782b6,_0x4c48ee,_0x1decda){var _0x29ef41=_0x1782b6[_0xa3bb('0xd')];var _0x55adc2={};var _0x29c1b9=_0x1782b6['query'];if(_0x55adc2){_0x55adc2=_[_0xa3bb('0x20')](_0x1782b6[_0xa3bb('0x9')]);_0x55adc2=_[_0xa3bb('0x21')](_0x55adc2,['body',_0xa3bb('0x22'),_0xa3bb('0x23'),_0xa3bb('0x24'),_0xa3bb('0x25')]);}utils['updateUser'](_0x29ef41,_0x55adc2,_0x29c1b9,_0x332e1a,_0x197065);_0x1decda(null);};};
\ No newline at end of file
+var _0xbb55=['findAll','resolve','getInteractionsQuery','then','search','parseQueryParameters','body','where','default','user','tags','i.id','ids','tag','countFilteredInteractions','count','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','catch','tracked','query','clone','omit','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils'];(function(_0x12e645,_0x2f9a87){var _0x9b4d38=function(_0x1ecc66){while(--_0x1ecc66){_0x12e645['push'](_0x12e645['shift']());}};_0x9b4d38(++_0x2f9a87);}(_0xbb55,0x165));var _0x5bb5=function(_0x12ad94,_0x169aa2){_0x12ad94=_0x12ad94-0x0;var _0x3f3815=_0xbb55[_0x12ad94];return _0x3f3815;};'use strict';var _=require(_0x5bb5('0x0'));var sqlUtils=require(_0x5bb5('0x1'));var utils=require(_0x5bb5('0x2'));exports[_0x5bb5('0x3')]=function(_0x431eb9,_0x268cfa,_0x44d6cb,_0x4e4e23,_0x100655){var _0x50f19b={'count':0x0,'rows':[]};var _0x1d66ab=sqlUtils['skipInteractionsQuery'](_0x431eb9,_0x44d6cb,_0x268cfa);if(_0x1d66ab){return Promise[_0x5bb5('0x4')](_0x50f19b);}var _0x1f1f2f=sqlUtils[_0x5bb5('0x5')](_0x431eb9);var _0x521cd3={};return Promise[_0x5bb5('0x4')]()[_0x5bb5('0x6')](function(){if(_0x268cfa['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x268cfa[_0x5bb5('0x7')],_0x100655);}else{return sqlUtils[_0x5bb5('0x8')](_0x431eb9,_0x268cfa,_0x100655);}})[_0x5bb5('0x6')](function(_0x1f4074){_0x1f1f2f['where'](_0x1f4074[_0x5bb5('0x9')]);_0x1f1f2f[_0x5bb5('0xa')](_0x1f4074['contact']);_0x1f1f2f[_0x5bb5('0xa')](_0x1f4074[_0x5bb5('0xb')]);_0x1f1f2f[_0x5bb5('0xa')](_0x1f4074['fields']);_0x1f1f2f[_0x5bb5('0xa')](_0x1f4074['filter']);_0x1f1f2f[_0x5bb5('0xa')](_0x1f4074[_0x5bb5('0xc')]);_0x1f1f2f['having'](_0x1f4074['read']);_0x521cd3=_0x1f4074[_0x5bb5('0xd')];return sqlUtils['checkAccountsRestrictions'](_0x431eb9,_0x44d6cb,_0x268cfa);})[_0x5bb5('0x6')](function(_0x426708){_0x1f1f2f['where'](_0x426708);_0x1f1f2f['group'](_0x5bb5('0xe'));var _0x5179fb=_0x268cfa[_0x5bb5('0x7')]?_0x521cd3[_0x5bb5('0xf')]:_0x268cfa[_0x5bb5('0x10')];return sqlUtils[_0x5bb5('0x11')](_0x1f1f2f,_0x5179fb);})['then'](function(_0x47f826){_0x50f19b['count']=_0x47f826['length'];if(_0x50f19b[_0x5bb5('0x12')]===0x0){return[];}_0x1f1f2f['having'](_0x521cd3[_0x5bb5('0x13')]);if(_0x4e4e23['order']){_0x4e4e23[_0x5bb5('0x14')][_0x5bb5('0x15')](function(_0x13fa54){var _0x4f37f5=_0x13fa54[0x0]===_0x5bb5('0x16')?_0x13fa54[0x0]:'i.'+_0x13fa54[0x0];_0x1f1f2f['order'](_0x4f37f5,_0x13fa54[0x1]===_0x5bb5('0x17')?![]:!![]);if(_0x13fa54[0x0]===_0x5bb5('0x18')){var _0x2a56f9=sqlUtils[_0x5bb5('0x19')](_0x431eb9,_0x268cfa);_0x1f1f2f[_0x5bb5('0x14')](_0x2a56f9,_0x13fa54[0x1]===_0x5bb5('0x17')?![]:!![]);}});}return sqlUtils[_0x5bb5('0x1a')](_0x431eb9,_0x1f1f2f,_0x268cfa,_0x4e4e23);})[_0x5bb5('0x6')](function(_0x22fa8d){_0x50f19b['rows']=_0x22fa8d;return _0x50f19b;})[_0x5bb5('0x1b')](function(_0xbba6b4){throw _0xbba6b4;});};exports[_0x5bb5('0x1c')]=function(_0x477a96,_0x58453e){return function(_0x1cf911,_0x15522f,_0x38a5c3){var _0x5b8cc5=_0x1cf911['user'];var _0x3f9c7a={};var _0x1762a3=_0x1cf911[_0x5bb5('0x1d')];if(_0x3f9c7a){_0x3f9c7a=_[_0x5bb5('0x1e')](_0x1cf911[_0x5bb5('0x9')]);_0x3f9c7a=_[_0x5bb5('0x1f')](_0x3f9c7a,[_0x5bb5('0x9'),'html',_0x5bb5('0x20'),_0x5bb5('0x21'),_0x5bb5('0x22')]);}utils[_0x5bb5('0x23')](_0x5b8cc5,_0x3f9c7a,_0x1762a3,_0x477a96,_0x58453e);_0x38a5c3(null);};};
\ No newline at end of file
index 593180a..4886555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbb5=['i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','offset','toString','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','Sequelize','SELECT','exports','lodash','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','agent','search','field','name','color','from','tools_tags','getInteractionFK','_interactions','select','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','messages','me.','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','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)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','find','buildExpression','type','default','value','start','end','unreadMessages','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','then','read','tag','filter','get','capitalize','chat','Websites','Accounts','resolve','role','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','QueryTypes','sequelize','query','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.createdAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xbbb5,0x17c));var _0x5bbb=function(_0x479114,_0x4cef07){_0x479114=_0x479114-0x0;var _0x377b78=_0xbbb5[_0x479114];return _0x377b78;};'use strict';var _=require(_0x5bbb('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0x5bbb('0x1'));var updateInteraction=require(_0x5bbb('0x2'))['updateInteraction'];var utils=require(_0x5bbb('0x3'));var db=require(_0x5bbb('0x4'))['db'];function skipInteractionsQuery(_0x307693,_0x4f1cdb,_0x1042e2){var _0x4db81b=![];var _0x8bcf71=utils[_0x5bbb('0x5')](_0x307693);if(_0x4f1cdb['role']===_0x5bbb('0x6')&&!_0x1042e2[_0x5bbb('0x7')]&&!_0x1042e2[_0x8bcf71]){_0x4db81b=!![];}return _0x4db81b;}function getTagsQuery(){return squel['select']()['field']('id')[_0x5bbb('0x8')](_0x5bbb('0x9'))[_0x5bbb('0x8')](_0x5bbb('0xa'))[_0x5bbb('0xb')](_0x5bbb('0xc'));}function getUsersQuery(_0x47eebe,_0x16355f){var _0x58e468=utils[_0x5bbb('0xd')](_0x47eebe);var _0xc3b4c1='user_has_'+_0x47eebe+_0x5bbb('0xe');var _0x124d41=squel[_0x5bbb('0xf')]()['field'](_0x5bbb('0x10'))[_0x5bbb('0x8')](_0x5bbb('0x11'))['field'](_0x5bbb('0x12')+_0x58e468)[_0x5bbb('0xb')](_0xc3b4c1,'ui')[_0x5bbb('0x13')](_0x5bbb('0x14'),'u',_0x5bbb('0x15'));if(_0x16355f[_0x5bbb('0x16')]>0x0){_0x124d41[_0x5bbb('0x17')](_0x5bbb('0x12')+_0x58e468+_0x5bbb('0x18'),_[_0x5bbb('0x19')](_0x16355f,'id'));}return _0x124d41;}function getInteractionsQuery(_0x1b4b33){var _0x5b9efb=utils[_0x5bbb('0x1a')](_0x1b4b33);var _0x75a9ac=utils[_0x5bbb('0x5')](_0x1b4b33);var _0x12019d=utils[_0x5bbb('0xd')](_0x1b4b33);return squel['select']()['from'](_0x5b9efb[_0x5bbb('0x1b')],'i')[_0x5bbb('0x13')](_0x5bbb('0x1c'),'c',_0x5bbb('0x1d'))[_0x5bbb('0x13')](_0x5bbb('0x14'),'o',_0x5bbb('0x1e'))[_0x5bbb('0x13')](_0x5b9efb[_0x5bbb('0x1f')],'a','a.id\x20=\x20i.'+_0x75a9ac)[_0x5bbb('0x13')](_0x5b9efb[_0x5bbb('0x20')],'me',_0x5bbb('0x21')+_0x12019d+'\x20=\x20i.id')[_0x5bbb('0x13')](_0x5b9efb[_0x5bbb('0x22')],'it',_0x5bbb('0x23')+_0x12019d+_0x5bbb('0x24'))[_0x5bbb('0x13')](_0x5bbb('0xc'),'t',_0x5bbb('0x25'));}function getSqlClauses(){var _0xa287cd={'body':squel[_0x5bbb('0x26')](),'contact':squel[_0x5bbb('0x26')](),'default':squel[_0x5bbb('0x26')](),'fields':squel[_0x5bbb('0x26')](),'filter':squel[_0x5bbb('0x26')](),'read':squel[_0x5bbb('0x26')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x5bbb('0x26')]()};return _0xa287cd;}function parseTagParameter(_0x296a14){var _0x3b7ad8=squel[_0x5bbb('0x26')]();if(_0x296a14){var _0x17990d=utils['getSelectedTags'](_0x296a14);_0x17990d[_0x5bbb('0x27')](function(_0x3d3453){_0x3b7ad8['or'](_0x5bbb('0x28'),'%,'+_0x3d3453+',%');});}return _0x3b7ad8;}function parseReadParameter(_0x276eb4){var _0x112609='';if(_0x276eb4){_0x112609=_0x5bbb('0x29');if(_0x276eb4==='1'){_0x112609=_0x112609[_0x5bbb('0x2a')](_0x5bbb('0x2b'),'=');}else{_0x112609=_0x112609[_0x5bbb('0x2a')](_0x5bbb('0x2b'),'>');}}return _0x112609;}function parseSearchFilter(_0x14388e,_0x56f973){var _0xb2676=squel['expr']();if(_0x56f973){var _0x16a5ef=_0x56f973[_0x5bbb('0x2a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x16a5ef)){_0xb2676['or'](_0x5bbb('0x2c'),_0x16a5ef+'%');if([_0x5bbb('0x2d'),_0x5bbb('0x2e')][_0x5bbb('0x2f')](_0x14388e)){_0xb2676['or'](_0x5bbb('0x30'),_0x16a5ef+'%');}else if(_0x14388e===_0x5bbb('0x31')){_0xb2676['or'](_0x5bbb('0x32'),_0x16a5ef+'%');}else if(_0x14388e===_0x5bbb('0x33')){_0xb2676['or'](_0x5bbb('0x34'),_0x16a5ef+'%');}}else if(_0x14388e===_0x5bbb('0x35')&&qs[_0x5bbb('0x36')](_0x16a5ef)){_0xb2676['or'](_0x5bbb('0x37'),_0x16a5ef+'%');}else{if(_0x14388e==='mail'){_0xb2676['or'](_0x5bbb('0x38'),qs[_0x5bbb('0x39')](_0x16a5ef,!![]))['or'](_0x5bbb('0x3a'),qs[_0x5bbb('0x39')](_0x16a5ef));}else if(_0x14388e!==_0x5bbb('0x31')){_0xb2676['or'](_0x5bbb('0x3b'),qs['getFullTextValue'](_0x16a5ef));}_0xb2676['or'](_0x5bbb('0x3c'),qs[_0x5bbb('0x39')](_0x16a5ef,!![]),null);}}return _0xb2676;}function parseAdvancedSearchFilter(_0x46d776,_0x56f5ed){var _0x47ff3e=getSqlClauses();var _0x386a16=as[_0x5bbb('0x3d')](_0x46d776);var _0x491ab0=_0x386a16['sqlOperator'];for(var _0x20f0b6=0x0;_0x20f0b6<_0x386a16[_0x5bbb('0x3e')][_0x5bbb('0x16')];_0x20f0b6++){var _0x482fe7=_0x386a16['conditions'][_0x20f0b6];var _0x5eeeeb='i';var _0x2ca23c=_[_0x5bbb('0x3f')](_0x56f5ed,['name',_0x482fe7['field']]);if(_0x2ca23c){var _0xc432bd=as[_0x5bbb('0x40')](_0x5eeeeb,_0x2ca23c[_0x5bbb('0x41')],_0x482fe7);_0x47ff3e[_0x5bbb('0x42')][_0x491ab0](_0xc432bd['text'],_0xc432bd[_0x5bbb('0x43')][_0x5bbb('0x44')],_0xc432bd[_0x5bbb('0x43')][_0x5bbb('0x45')]);}else{switch(_0x482fe7['field']){case _0x5bbb('0x46'):var _0x57cc53=parseReadParameter(_0x482fe7[_0x5bbb('0x43')]);_0x47ff3e['read'][_0x5bbb('0x47')](_0x57cc53);break;case _0x5bbb('0x48'):if(_0x482fe7[_0x5bbb('0x49')]===_0x5bbb('0x4a')){if(_0x482fe7[_0x5bbb('0x43')][_0x5bbb('0x4b')]('\x20')[_0x5bbb('0x16')]>0x1){_0x47ff3e[_0x5bbb('0x4c')][_0x491ab0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5bbb('0x39')](_0x482fe7['value'],!![]),null);}else{var _0x4beee7='%'+_0x482fe7[_0x5bbb('0x43')]+'%';_0x47ff3e[_0x5bbb('0x4c')][_0x491ab0](_0x5bbb('0x4d'),_0x4beee7,_0x4beee7,_0x4beee7);}}else{_0x2ca23c=_['find'](_0x56f5ed,[_0x5bbb('0x9'),_0x5bbb('0x4e')]);_0x482fe7[_0x5bbb('0x8')]=_0x5bbb('0x4e');_0xc432bd=as[_0x5bbb('0x40')](_0x5eeeeb,_0x2ca23c[_0x5bbb('0x41')],_0x482fe7);_0x47ff3e[_0x5bbb('0x4c')][_0x491ab0](_0xc432bd[_0x5bbb('0x4f')],_0xc432bd[_0x5bbb('0x43')]['start'],_0xc432bd[_0x5bbb('0x43')]['end']);}break;case _0x5bbb('0x50'):var _0x3bf5c2=_0x482fe7[_0x5bbb('0x43')]['split'](',')[_0x5bbb('0x19')](function(_0xb67d10){return Number(_0xb67d10);});var _0x159474=parseTagParameter(_0x3bf5c2);_0x47ff3e[_0x5bbb('0x51')][_0x5bbb('0x52')][_0x5bbb('0x47')](_0x159474);_0x47ff3e[_0x5bbb('0x51')][_0x5bbb('0x53')]=_0x3bf5c2;break;case _0x5bbb('0x54'):if(_0x482fe7[_0x5bbb('0x49')]===_0x5bbb('0x4a')){_0x47ff3e[_0x5bbb('0x55')][_0x491ab0](_0x5bbb('0x56'),'%'+_0x482fe7[_0x5bbb('0x43')]+'%',null);}else{_0x2ca23c=_[_0x5bbb('0x3f')](_0x56f5ed,[_0x5bbb('0x9'),_0x5bbb('0x57')]);_0x482fe7[_0x5bbb('0x8')]=_0x5bbb('0x57');_0xc432bd=as['buildExpression'](_0x5eeeeb,_0x2ca23c['type'],_0x482fe7);_0x47ff3e[_0x5bbb('0x55')][_0x491ab0](_0xc432bd['text'],_0xc432bd['value'][_0x5bbb('0x44')],_0xc432bd[_0x5bbb('0x43')][_0x5bbb('0x45')]);}break;case _0x5bbb('0x58'):case _0x5bbb('0x59'):_0xc432bd=as[_0x5bbb('0x40')]('me',null,_0x482fe7);_0x47ff3e[_0x5bbb('0x58')][_0x491ab0](_0xc432bd[_0x5bbb('0x4f')],_0xc432bd[_0x5bbb('0x43')][_0x5bbb('0x44')],_0xc432bd[_0x5bbb('0x43')][_0x5bbb('0x45')]);break;}}}return _0x47ff3e;}function parseModelFields(_0x2d7d28,_0x47cbaa,_0x2a58b2){var _0x5a470f=utils[_0x5bbb('0x5')](_0x2d7d28);var _0xbaefff=squel[_0x5bbb('0x26')]();var _0x523db0=_(_0x47cbaa)[_0x5bbb('0x5a')]()['map'](function(_0x801515){return _['some'](_0x2a58b2,[_0x5bbb('0x9'),_0x801515])?_0x801515:undefined;})['compact']()[_0x5bbb('0x43')]();if(_0x523db0[_0x5bbb('0x16')]>0x0){_0x523db0[_0x5bbb('0x27')](function(_0x172917){if(_0x172917===_0x5a470f){_0xbaefff[_0x5bbb('0x47')]('i.'+_0x5a470f+_0x5bbb('0x18'),[][_0x5bbb('0x5b')](_0x47cbaa[_0x172917]));}else if(_0x172917===_0x5bbb('0x5c')){var _0x4e3047=JSON[_0x5bbb('0x5d')](_0x47cbaa[_0x172917])[_0x5bbb('0x5e')];var _0x3a166f=JSON[_0x5bbb('0x5d')](_0x47cbaa[_0x172917])[_0x5bbb('0x5f')];_0xbaefff[_0x5bbb('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4e3047,_0x3a166f);}else{if(_0x47cbaa[_0x172917]==='null'){_0xbaefff[_0x5bbb('0x47')]('i.'+_0x172917+_0x5bbb('0x60'));}else{_0xbaefff[_0x5bbb('0x47')]('i.'+_0x172917+'\x20=\x20?',_0x47cbaa[_0x172917]);}}});}return _0xbaefff;}function parseQueryParameters(_0x4d4d9c,_0x5e3a44,_0x10bb2b){var _0xf10292=getSqlClauses();return Promise['resolve']()[_0x5bbb('0x61')](function(){return parseModelFields(_0x4d4d9c,_0x5e3a44,_0x10bb2b);})['then'](function(_0x234a9a){_0xf10292['fields'][_0x5bbb('0x47')](_0x234a9a);return parseReadParameter(_0x5e3a44[_0x5bbb('0x62')]);})[_0x5bbb('0x61')](function(_0x2b1c6f){_0xf10292[_0x5bbb('0x62')][_0x5bbb('0x47')](_0x2b1c6f);return parseTagParameter(_0x5e3a44[_0x5bbb('0x63')]);})[_0x5bbb('0x61')](function(_0x22c83c){_0xf10292[_0x5bbb('0x51')]['clause'][_0x5bbb('0x47')](_0x22c83c);return parseSearchFilter(_0x4d4d9c,_0x5e3a44[_0x5bbb('0x64')]);})[_0x5bbb('0x61')](function(_0x174f56){_0xf10292['filter']=_0x174f56;return _0xf10292;});}function checkAccountsRestrictions(_0x1e0ba2,_0x5dffe0,_0x5f5c28){var _0x327639=utils['getAccountFK'](_0x1e0ba2);var _0x41227d=_0x5bbb('0x65')+_[_0x5bbb('0x66')](_0x1e0ba2)+(_0x1e0ba2===_0x5bbb('0x67')?_0x5bbb('0x68'):_0x5bbb('0x69'));var _0x44b005=squel[_0x5bbb('0x26')]();return Promise[_0x5bbb('0x6a')]()[_0x5bbb('0x61')](function(){if(_0x5f5c28[_0x5bbb('0x7')]&&_0x5dffe0[_0x5bbb('0x6b')]===_0x5bbb('0x6')){return _0x5dffe0[_0x41227d]({'attributes':['id'],'raw':!![]});}})[_0x5bbb('0x61')](function(_0x5953f0){if(_0x5953f0){if(_0x5953f0[_0x5bbb('0x16')]===0x0){_0x44b005[_0x5bbb('0x47')]('i.'+_0x327639+'\x20IS\x20NULL');}else{_0x44b005[_0x5bbb('0x47')]('i.'+_0x327639+_0x5bbb('0x18'),_[_0x5bbb('0x19')](_0x5953f0,'id'));}}else if(!_0x5f5c28[_0x327639]){_0x44b005[_0x5bbb('0x47')]('i.'+_0x327639+_0x5bbb('0x6c'));}})[_0x5bbb('0x61')](function(){return _0x44b005;});}function getClosedOrderClause(_0x2a2372,_0xf5622){var _0x4e579d='';var _0x1c817f=[_0x5bbb('0x6d'),_0x5bbb('0x6e'),_0x5bbb('0x6f')];if(_0x2a2372===_0x5bbb('0x35')){_0x1c817f[_0x5bbb('0x70')]('i.substatus');}if(_0xf5622['closed']==='0'&&_0x2a2372===_0x5bbb('0x35')){_0x4e579d=_0x5bbb('0x71');}else{if(_0xf5622[_0x5bbb('0x72')]==='1'){_0x1c817f[_0x5bbb('0x73')]();}_0x4e579d=_0x5bbb('0x74')+_0x1c817f[_0x5bbb('0x75')](',\x20')+')';}return _0x4e579d;}function getFilteredInteractions(_0x191ba9,_0x44c9b8,_0x1af3d4,_0x30d8f6){var _0x1a7bf1=utils[_0x5bbb('0xd')](_0x191ba9);var _0x2e3bfc=_[_0x5bbb('0x66')](_0x191ba9)+_0x5bbb('0x76');var _0x3703d2=[];var _0x53e8a2=getTagsQuery();var _0x24de26={'type':db['Sequelize'][_0x5bbb('0x77')]['SELECT'],'raw':!![]};var _0x148938=[];var _0x131c34=[];return db[_0x5bbb('0x78')][_0x5bbb('0x79')](_0x53e8a2['toString'](),_0x24de26)[_0x5bbb('0x61')](function(_0x5c109a){_0x3703d2=_[_0x5bbb('0x7a')](_0x5c109a,'id');_0x24de26=_[_0x5bbb('0x7b')](_0x24de26,{'model':db[_0x2e3bfc],'mapToModel':!![],'nest':!![]});if(_0x1af3d4['fields']){_0x30d8f6['attributes'][_0x5bbb('0x27')](function(_0x18f442){_0x44c9b8[_0x5bbb('0x8')]('i.'+_0x18f442);});}else{_0x44c9b8['field'](_0x5bbb('0x7c'),_0x5bbb('0x46'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x7d'),_0x5bbb('0x7e'));_0x44c9b8['field'](_0x5bbb('0x7f'),_0x5bbb('0x80'));if(_0x191ba9==='mail'){_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x81'),_0x5bbb('0x82'));_0x44c9b8[_0x5bbb('0x8')]('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',_0x5bbb('0x83'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x84'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x85'));_0x44c9b8[_0x5bbb('0x8')]('i.updatedAt');_0x44c9b8[_0x5bbb('0x8')]('i.closed');_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x86'));_0x44c9b8[_0x5bbb('0x8')]('i.attach');_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x87'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x88'));_0x44c9b8['field'](_0x5bbb('0x89'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x6f'));_0x44c9b8[_0x5bbb('0x8')]('i.secondDisposition');_0x44c9b8[_0x5bbb('0x8')]('i.thirdDisposition');_0x44c9b8[_0x5bbb('0x8')]('i.substatus');_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x8a'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x8b'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x8c'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x8d'));}else if(_0x191ba9===_0x5bbb('0x33')){_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x8e'),_0x5bbb('0x83'));}else{_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x8f'),_0x5bbb('0x83'));}if(_0x191ba9!=='mail'){_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x90'));}_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x91'),_0x5bbb('0x92'));_0x44c9b8[_0x5bbb('0x8')]('c.lastName','Contact.lastName');_0x44c9b8[_0x5bbb('0x8')]('c.email',_0x5bbb('0x93'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x94'),_0x5bbb('0x95'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x96'),_0x5bbb('0x97'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x98'),_0x5bbb('0x99'));_0x44c9b8['field'](_0x5bbb('0x9a'),_0x5bbb('0x9b'));_0x44c9b8['field']('o.internal',_0x5bbb('0x9c'));_0x44c9b8[_0x5bbb('0x8')](_0x5bbb('0x9d'),_0x5bbb('0x9e'));}if(_0x30d8f6['limit']){_0x44c9b8['limit'](_0x30d8f6['limit']);}if(_0x30d8f6[_0x5bbb('0x9f')]){_0x44c9b8[_0x5bbb('0x9f')](_0x30d8f6['offset']);}return db['sequelize'][_0x5bbb('0x79')](_0x44c9b8['toString'](),_0x24de26);})[_0x5bbb('0x61')](function(_0x319fcc){_0x148938=_0x319fcc;var _0x78c24e=getUsersQuery(_0x191ba9,_0x148938);return db[_0x5bbb('0x78')][_0x5bbb('0x79')](_0x78c24e[_0x5bbb('0xa0')](),_0x24de26);})['then'](function(_0x1412b2){_0x131c34=_['groupBy'](_0x1412b2,_0x1a7bf1);if(_0x191ba9==='mail'){return db[_0x5bbb('0xa1')][_0x5bbb('0xa2')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x5bbb('0x61')](function(_0x4250b1){var _0x471655=_0x4250b1?_0x4250b1[_0x5bbb('0xa3')]:undefined;var _0x565373=_0x148938[_0x5bbb('0x19')](function(_0x52c490){return updateInteraction(_0x52c490,_0x3703d2,_0x131c34,_0x471655);});return Promise[_0x5bbb('0xa4')](_0x565373);});}function countFilteredInteractions(_0x14e2f1,_0x1b72a2){var _0x88a1f7=_0x14e2f1[_0x5bbb('0xa5')]();_0x88a1f7['field'](_0x5bbb('0xa6'));_0x88a1f7[_0x5bbb('0x8')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5bbb('0x46'));var _0x4ed551=utils[_0x5bbb('0xa7')](_0x1b72a2);if(!_[_0x5bbb('0xa8')](_0x4ed551)){_0x88a1f7[_0x5bbb('0x17')](_0x5bbb('0xa9'),_0x4ed551);}var _0x52c875={'type':db[_0x5bbb('0xaa')][_0x5bbb('0x77')][_0x5bbb('0xab')],'raw':!![]};return db['sequelize']['query'](_0x88a1f7['toString'](),_0x52c875);}module[_0x5bbb('0xac')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
+var _0x044c=['left_join','u.id\x20=\x20ui.UserId','where','map','getInteractionFK','interactions','cm_contacts','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','it.','expr','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax','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.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','length','conditions','buildExpression','type','default','text','value','unreadMessages','Contact','operator','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','split','tags','clause','ids','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','user','start','body','plainBody','end','keys','some','compact','forEach','and','concat','createdAt','parse','$gte','\x20IS\x20NULL','resolve','then','fields','read','tag','filter','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','i.substatus','closed','shift','join','capitalize','Interaction','QueryTypes','SELECT','sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','getSelectedTags','isEmpty','t.id\x20IN\x20?','Sequelize','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','user_has_','u.id','ui.'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x044c,0x8b));var _0xc044=function(_0x57c316,_0x832bad){_0x57c316=_0x57c316-0x0;var _0x384c77=_0x044c[_0x57c316];return _0x384c77;};'use strict';var _=require(_0xc044('0x0'));var squel=require(_0xc044('0x1'));var as=require(_0xc044('0x2'));var qs=require(_0xc044('0x3'));var updateInteraction=require('./update-interaction')[_0xc044('0x4')];var utils=require(_0xc044('0x5'));var db=require(_0xc044('0x6'))['db'];function skipInteractionsQuery(_0x49fb82,_0x2b563d,_0x338c2e){var _0x25033d=![];var _0x9f1bb3=utils[_0xc044('0x7')](_0x49fb82);if(_0x2b563d[_0xc044('0x8')]===_0xc044('0x9')&&!_0x338c2e[_0xc044('0xa')]&&!_0x338c2e[_0x9f1bb3]){_0x25033d=!![];}return _0x25033d;}function getTagsQuery(){return squel[_0xc044('0xb')]()[_0xc044('0xc')]('id')[_0xc044('0xc')](_0xc044('0xd'))['field'](_0xc044('0xe'))[_0xc044('0xf')](_0xc044('0x10'));}function getUsersQuery(_0x116d87,_0x55498f){var _0x451930=utils['getInteractionFK'](_0x116d87);var _0xacf2f3=_0xc044('0x11')+_0x116d87+'_interactions';var _0x465b62=squel['select']()['field'](_0xc044('0x12'))[_0xc044('0xc')]('u.fullname')['field'](_0xc044('0x13')+_0x451930)[_0xc044('0xf')](_0xacf2f3,'ui')[_0xc044('0x14')]('users','u',_0xc044('0x15'));if(_0x55498f['length']>0x0){_0x465b62[_0xc044('0x16')]('ui.'+_0x451930+'\x20IN\x20?',_[_0xc044('0x17')](_0x55498f,'id'));}return _0x465b62;}function getInteractionsQuery(_0x2dca41){var _0x14f6e1=utils['getInteractionsTables'](_0x2dca41);var _0x21f80e=utils['getAccountFK'](_0x2dca41);var _0x2fc765=utils[_0xc044('0x18')](_0x2dca41);return squel[_0xc044('0xb')]()['from'](_0x14f6e1[_0xc044('0x19')],'i')[_0xc044('0x14')](_0xc044('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xc044('0x14')](_0xc044('0x1b'),'o',_0xc044('0x1c'))['left_join'](_0x14f6e1[_0xc044('0x1d')],'a',_0xc044('0x1e')+_0x21f80e)[_0xc044('0x14')](_0x14f6e1[_0xc044('0x1f')],'me','me.'+_0x2fc765+_0xc044('0x20'))[_0xc044('0x14')](_0x14f6e1['interactionsTags'],'it',_0xc044('0x21')+_0x2fc765+_0xc044('0x20'))[_0xc044('0x14')](_0xc044('0x10'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x27d161={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0xc044('0x22')](),'fields':squel[_0xc044('0x22')](),'filter':squel[_0xc044('0x22')](),'read':squel[_0xc044('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xc044('0x22')]()};return _0x27d161;}function parseTagParameter(_0x2ff23c){var _0x2696a5=squel[_0xc044('0x22')]();if(_0x2ff23c){var _0x2df632=utils['getSelectedTags'](_0x2ff23c);_0x2df632['forEach'](function(_0x136b09){_0x2696a5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x136b09+',%');});}return _0x2696a5;}function parseReadParameter(_0x361c19){var _0x32478b='';if(_0x361c19){_0x32478b='unreadMessages\x20{OPERATOR}\x200';if(_0x361c19==='1'){_0x32478b=_0x32478b[_0xc044('0x23')](_0xc044('0x24'),'=');}else{_0x32478b=_0x32478b[_0xc044('0x23')](_0xc044('0x24'),'>');}}return _0x32478b;}function parseSearchFilter(_0x516de0,_0x4de5eb){var _0x7d69e1=squel[_0xc044('0x22')]();if(_0x4de5eb){var _0x575829=_0x4de5eb['replace']('\x5c','\x5c\x5c')[_0xc044('0x23')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x575829)){_0x7d69e1['or'](_0xc044('0x25'),_0x575829+'%');if([_0xc044('0x26'),'whatsapp'][_0xc044('0x27')](_0x516de0)){_0x7d69e1['or'](_0xc044('0x28'),_0x575829+'%');}else if(_0x516de0===_0xc044('0x29')){_0x7d69e1['or']('i.fax\x20LIKE\x20?',_0x575829+'%');}else if(_0x516de0===_0xc044('0x2a')){_0x7d69e1['or'](_0xc044('0x2b'),_0x575829+'%');}}else if(_0x516de0===_0xc044('0x2c')&&qs[_0xc044('0x2d')](_0x575829)){_0x7d69e1['or'](_0xc044('0x2e'),_0x575829+'%');}else{if(_0x516de0==='mail'){_0x7d69e1['or'](_0xc044('0x2f'),qs[_0xc044('0x30')](_0x575829,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc044('0x30')](_0x575829));}else if(_0x516de0!==_0xc044('0x29')){_0x7d69e1['or'](_0xc044('0x31'),qs['getFullTextValue'](_0x575829));}_0x7d69e1['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc044('0x30')](_0x575829,!![]),null);}}return _0x7d69e1;}function parseAdvancedSearchFilter(_0x562c0f,_0x4326a4){var _0x2c2da2=getSqlClauses();var _0x4d7134=as[_0xc044('0x32')](_0x562c0f);var _0x52eaf6=_0x4d7134[_0xc044('0x33')];for(var _0x1d1f28=0x0;_0x1d1f28<_0x4d7134['conditions'][_0xc044('0x34')];_0x1d1f28++){var _0x520b0b=_0x4d7134[_0xc044('0x35')][_0x1d1f28];var _0x509b2f='i';var _0x436912=_['find'](_0x4326a4,[_0xc044('0xd'),_0x520b0b[_0xc044('0xc')]]);if(_0x436912){var _0x4d072a=as[_0xc044('0x36')](_0x509b2f,_0x436912[_0xc044('0x37')],_0x520b0b);_0x2c2da2[_0xc044('0x38')][_0x52eaf6](_0x4d072a[_0xc044('0x39')],_0x4d072a['value']['start'],_0x4d072a[_0xc044('0x3a')]['end']);}else{switch(_0x520b0b[_0xc044('0xc')]){case _0xc044('0x3b'):var _0x255671=parseReadParameter(_0x520b0b[_0xc044('0x3a')]);_0x2c2da2['read']['and'](_0x255671);break;case _0xc044('0x3c'):if(_0x520b0b[_0xc044('0x3d')]===_0xc044('0x3e')){if(_0x520b0b[_0xc044('0x3a')]['split']('\x20')[_0xc044('0x34')]>0x1){_0x2c2da2[_0xc044('0x3f')][_0x52eaf6](_0xc044('0x40'),qs[_0xc044('0x30')](_0x520b0b[_0xc044('0x3a')],!![]),null);}else{var _0xdc0f7f='%'+_0x520b0b[_0xc044('0x3a')]+'%';_0x2c2da2['contact'][_0x52eaf6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xdc0f7f,_0xdc0f7f,_0xdc0f7f);}}else{_0x436912=_['find'](_0x4326a4,[_0xc044('0xd'),'ContactId']);_0x520b0b[_0xc044('0xc')]=_0xc044('0x41');_0x4d072a=as['buildExpression'](_0x509b2f,_0x436912['type'],_0x520b0b);_0x2c2da2['contact'][_0x52eaf6](_0x4d072a[_0xc044('0x39')],_0x4d072a[_0xc044('0x3a')]['start'],_0x4d072a[_0xc044('0x3a')]['end']);}break;case'Tag':var _0x304f18=_0x520b0b[_0xc044('0x3a')][_0xc044('0x42')](',')[_0xc044('0x17')](function(_0x435ded){return Number(_0x435ded);});var _0x173076=parseTagParameter(_0x304f18);_0x2c2da2[_0xc044('0x43')][_0xc044('0x44')]['and'](_0x173076);_0x2c2da2[_0xc044('0x43')][_0xc044('0x45')]=_0x304f18;break;case'User':if(_0x520b0b[_0xc044('0x3d')]===_0xc044('0x3e')){_0x2c2da2['user'][_0x52eaf6](_0xc044('0x46'),'%'+_0x520b0b[_0xc044('0x3a')]+'%',null);}else{_0x436912=_[_0xc044('0x47')](_0x4326a4,[_0xc044('0xd'),'UserId']);_0x520b0b['field']=_0xc044('0x48');_0x4d072a=as[_0xc044('0x36')](_0x509b2f,_0x436912[_0xc044('0x37')],_0x520b0b);_0x2c2da2[_0xc044('0x49')][_0x52eaf6](_0x4d072a[_0xc044('0x39')],_0x4d072a[_0xc044('0x3a')][_0xc044('0x4a')],_0x4d072a[_0xc044('0x3a')]['end']);}break;case _0xc044('0x4b'):case _0xc044('0x4c'):_0x4d072a=as[_0xc044('0x36')]('me',null,_0x520b0b);_0x2c2da2[_0xc044('0x4b')][_0x52eaf6](_0x4d072a['text'],_0x4d072a[_0xc044('0x3a')][_0xc044('0x4a')],_0x4d072a[_0xc044('0x3a')][_0xc044('0x4d')]);break;}}}return _0x2c2da2;}function parseModelFields(_0x3d2450,_0x32e71c,_0x3a172c){var _0x5010a9=utils[_0xc044('0x7')](_0x3d2450);var _0x1208b5=squel[_0xc044('0x22')]();var _0x2bd808=_(_0x32e71c)[_0xc044('0x4e')]()[_0xc044('0x17')](function(_0x28ba90){return _[_0xc044('0x4f')](_0x3a172c,[_0xc044('0xd'),_0x28ba90])?_0x28ba90:undefined;})[_0xc044('0x50')]()['value']();if(_0x2bd808[_0xc044('0x34')]>0x0){_0x2bd808[_0xc044('0x51')](function(_0x50332c){if(_0x50332c===_0x5010a9){_0x1208b5[_0xc044('0x52')]('i.'+_0x5010a9+'\x20IN\x20?',[][_0xc044('0x53')](_0x32e71c[_0x50332c]));}else if(_0x50332c===_0xc044('0x54')){var _0x356157=JSON[_0xc044('0x55')](_0x32e71c[_0x50332c])[_0xc044('0x56')];var _0x2e9cf5=JSON[_0xc044('0x55')](_0x32e71c[_0x50332c])['$lte'];_0x1208b5[_0xc044('0x52')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x356157,_0x2e9cf5);}else{if(_0x32e71c[_0x50332c]==='null'){_0x1208b5[_0xc044('0x52')]('i.'+_0x50332c+_0xc044('0x57'));}else{_0x1208b5[_0xc044('0x52')]('i.'+_0x50332c+'\x20=\x20?',_0x32e71c[_0x50332c]);}}});}return _0x1208b5;}function parseQueryParameters(_0x56ca28,_0x3472bc,_0x1f6eaf){var _0x2befca=getSqlClauses();return Promise[_0xc044('0x58')]()[_0xc044('0x59')](function(){return parseModelFields(_0x56ca28,_0x3472bc,_0x1f6eaf);})['then'](function(_0x5dde9e){_0x2befca[_0xc044('0x5a')][_0xc044('0x52')](_0x5dde9e);return parseReadParameter(_0x3472bc[_0xc044('0x5b')]);})[_0xc044('0x59')](function(_0x837ca8){_0x2befca[_0xc044('0x5b')][_0xc044('0x52')](_0x837ca8);return parseTagParameter(_0x3472bc[_0xc044('0x5c')]);})[_0xc044('0x59')](function(_0x25a2da){_0x2befca[_0xc044('0x43')][_0xc044('0x44')]['and'](_0x25a2da);return parseSearchFilter(_0x56ca28,_0x3472bc['filter']);})[_0xc044('0x59')](function(_0x580984){_0x2befca[_0xc044('0x5d')]=_0x580984;return _0x2befca;});}function checkAccountsRestrictions(_0x3596c2,_0x58d12d,_0x5816b4){var _0x2c511f=utils[_0xc044('0x7')](_0x3596c2);var _0x536373='get'+_['capitalize'](_0x3596c2)+(_0x3596c2===_0xc044('0x5e')?_0xc044('0x5f'):_0xc044('0x60'));var _0x3067ae=squel[_0xc044('0x22')]();return Promise[_0xc044('0x58')]()[_0xc044('0x59')](function(){if(_0x5816b4[_0xc044('0xa')]&&_0x58d12d[_0xc044('0x8')]==='agent'){return _0x58d12d[_0x536373]({'attributes':['id'],'raw':!![]});}})[_0xc044('0x59')](function(_0x2f49f8){if(_0x2f49f8){if(_0x2f49f8[_0xc044('0x34')]===0x0){_0x3067ae[_0xc044('0x52')]('i.'+_0x2c511f+_0xc044('0x57'));}else{_0x3067ae['and']('i.'+_0x2c511f+'\x20IN\x20?',_[_0xc044('0x17')](_0x2f49f8,'id'));}}else if(!_0x5816b4[_0x2c511f]){_0x3067ae[_0xc044('0x52')]('i.'+_0x2c511f+_0xc044('0x61'));}})[_0xc044('0x59')](function(){return _0x3067ae;});}function getClosedOrderClause(_0xc32421,_0x4d14da){var _0xbc7d='';var _0x42c2b9=['i.thirdDisposition',_0xc044('0x62'),_0xc044('0x63')];if(_0xc32421==='mail'){_0x42c2b9['unshift'](_0xc044('0x64'));}if(_0x4d14da[_0xc044('0x65')]==='0'&&_0xc32421===_0xc044('0x2c')){_0xbc7d=_0xc044('0x64');}else{if(_0x4d14da['closed']==='1'){_0x42c2b9[_0xc044('0x66')]();}_0xbc7d='CONCAT_WS(\x27\x27,\x20'+_0x42c2b9[_0xc044('0x67')](',\x20')+')';}return _0xbc7d;}function getFilteredInteractions(_0x48b355,_0x1d4d5a,_0xa1a71b,_0x285024){var _0x794876=utils[_0xc044('0x18')](_0x48b355);var _0x1f0767=_[_0xc044('0x68')](_0x48b355)+_0xc044('0x69');var _0x81051c=[];var _0x31109c=getTagsQuery();var _0x450dee={'type':db['Sequelize'][_0xc044('0x6a')][_0xc044('0x6b')],'raw':!![]};var _0x2bedb1=[];var _0x3f199b=[];return db[_0xc044('0x6c')][_0xc044('0x6d')](_0x31109c[_0xc044('0x6e')](),_0x450dee)[_0xc044('0x59')](function(_0x157936){_0x81051c=_['keyBy'](_0x157936,'id');_0x450dee=_[_0xc044('0x6f')](_0x450dee,{'model':db[_0x1f0767],'mapToModel':!![],'nest':!![]});if(_0xa1a71b[_0xc044('0x5a')]){_0x285024[_0xc044('0x70')][_0xc044('0x51')](function(_0x2a2dcf){_0x1d4d5a['field']('i.'+_0x2a2dcf);});}else{_0x1d4d5a['field'](_0xc044('0x71'),_0xc044('0x3b'));_0x1d4d5a['field']('a.key',_0xc044('0x72'));_0x1d4d5a[_0xc044('0xc')]('a.mandatoryDisposition',_0xc044('0x73'));if(_0x48b355==='mail'){_0x1d4d5a[_0xc044('0xc')](_0xc044('0x74'),_0xc044('0x75'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x76'),_0xc044('0x77'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x78'));_0x1d4d5a['field']('i.createdAt');_0x1d4d5a[_0xc044('0xc')](_0xc044('0x79'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x7a'));_0x1d4d5a[_0xc044('0xc')]('i.closedAt');_0x1d4d5a[_0xc044('0xc')]('i.attach');_0x1d4d5a[_0xc044('0xc')](_0xc044('0x7b'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x7c'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x7d'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x63'));_0x1d4d5a['field'](_0xc044('0x62'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x7e'));_0x1d4d5a['field'](_0xc044('0x64'));_0x1d4d5a['field'](_0xc044('0x7f'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x80'));_0x1d4d5a['field'](_0xc044('0x81'));_0x1d4d5a['field'](_0xc044('0x82'));}else if(_0x48b355===_0xc044('0x2a')){_0x1d4d5a[_0xc044('0xc')](_0xc044('0x83'),'contactName');}else{_0x1d4d5a[_0xc044('0xc')](_0xc044('0x84'),_0xc044('0x77'));}if(_0x48b355!=='mail'){_0x1d4d5a[_0xc044('0xc')]('i.*');}_0x1d4d5a[_0xc044('0xc')](_0xc044('0x85'),_0xc044('0x86'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x87'),_0xc044('0x88'));_0x1d4d5a[_0xc044('0xc')]('c.email',_0xc044('0x89'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x8a'),'Contact.phone');_0x1d4d5a[_0xc044('0xc')](_0xc044('0x8b'),_0xc044('0x8c'));_0x1d4d5a[_0xc044('0xc')]('c.fax',_0xc044('0x8d'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x8e'),_0xc044('0x8f'));_0x1d4d5a[_0xc044('0xc')]('o.internal',_0xc044('0x90'));_0x1d4d5a[_0xc044('0xc')](_0xc044('0x91'),_0xc044('0x92'));}if(_0x285024['limit']){_0x1d4d5a['limit'](_0x285024[_0xc044('0x93')]);}if(_0x285024[_0xc044('0x94')]){_0x1d4d5a[_0xc044('0x94')](_0x285024[_0xc044('0x94')]);}return db[_0xc044('0x6c')][_0xc044('0x6d')](_0x1d4d5a[_0xc044('0x6e')](),_0x450dee);})['then'](function(_0x5c5861){_0x2bedb1=_0x5c5861;var _0x1a1c6a=getUsersQuery(_0x48b355,_0x2bedb1);return db['sequelize']['query'](_0x1a1c6a[_0xc044('0x6e')](),_0x450dee);})[_0xc044('0x59')](function(_0x1bd850){_0x3f199b=_[_0xc044('0x95')](_0x1bd850,_0x794876);if(_0x48b355===_0xc044('0x2c')){return db['Setting'][_0xc044('0x96')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0xc044('0x59')](function(_0x217830){var _0x5b32a2=_0x217830?_0x217830[_0xc044('0x97')]:undefined;var _0x92358d=_0x2bedb1[_0xc044('0x17')](function(_0xa73dbd){return updateInteraction(_0xa73dbd,_0x81051c,_0x3f199b,_0x5b32a2);});return Promise[_0xc044('0x98')](_0x92358d);});}function countFilteredInteractions(_0x579bdf,_0x3088ab){var _0x2b40ba=_0x579bdf[_0xc044('0x99')]();_0x2b40ba[_0xc044('0xc')]('COUNT(*)');_0x2b40ba[_0xc044('0xc')](_0xc044('0x71'),_0xc044('0x3b'));var _0x379e02=utils[_0xc044('0x9a')](_0x3088ab);if(!_[_0xc044('0x9b')](_0x379e02)){_0x2b40ba[_0xc044('0x16')](_0xc044('0x9c'),_0x379e02);}var _0x4553d3={'type':db[_0xc044('0x9d')][_0xc044('0x6a')][_0xc044('0x6b')],'raw':!![]};return db[_0xc044('0x6c')]['query'](_0x2b40ba[_0xc044('0x6e')](),_0x4553d3);}module[_0xc044('0x9e')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
index b4a3853..c9db533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x990d=['abandoned','total','disposition','UserId','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','Tags','TagIds','then','lodash','../../mysqldb','split','forEach','push','waiting','talking','unmanaged'];(function(_0x363972,_0x4f5f07){var _0x48cc42=function(_0x1eaa2e){while(--_0x1eaa2e){_0x363972['push'](_0x363972['shift']());}};_0x48cc42(++_0x4f5f07);}(_0x990d,0xde));var _0xd990=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x990d[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0xd990('0x0'));var db=require(_0xd990('0x1'))['db'];function getInteractionUsers(_0x187f2c,_0x5e376a){return new Promise(function(_0x35739b,_0x2471f6){try{var _0x5e32a8=[];if(_0x5e376a[_0x187f2c]){_0x5e32a8=_0x5e376a[_0x187f2c]['map'](function(_0x222849){return{'id':_0x222849['id'],'fullname':_0x222849['fullname']};});}return _0x35739b(_0x5e32a8);}catch(_0x2c6873){_0x2471f6(_0x2c6873);}});}function getInteractionTags(_0x551e04,_0x56d490){var _0x5afb88=[];if(_0x551e04){_0x551e04[_0xd990('0x2')](',')[_0xd990('0x3')](function(_0x13e48c){_0x5afb88[_0xd990('0x4')](_0x56d490[_0x13e48c]);});}return _0x5afb88;}function updateWaitingCounter(_0x2ebee9){if(_0x2ebee9[_0xd990('0x5')]){_0x2ebee9[_0xd990('0x5')]-=0x1;}}function updateInteractionCounters(_0x367098){_0x367098[_0xd990('0x5')]=0x0;_0x367098[_0xd990('0x6')]=0x0;_0x367098['answered']=0x0;_0x367098[_0xd990('0x7')]=0x0;_0x367098[_0xd990('0x8')]=0x0;_0x367098[_0xd990('0x9')]=0x0;if(_0x367098['closed']){if(_0x367098[_0xd990('0xa')]===_0xd990('0x8')){_0x367098[_0xd990('0x8')]+=0x1;updateWaitingCounter(_0x367098);}if(_0x367098[_0xd990('0xb')]){_0x367098['answered']+=0x1;if(_0x367098[_0xd990('0x6')]){_0x367098[_0xd990('0x6')]-=0x1;}}else{if(_0x367098[_0xd990('0xa')]){_0x367098['unmanaged']+=0x1;updateWaitingCounter(_0x367098);}}}else{if(!_0x367098['UserId']){_0x367098[_0xd990('0x5')]+=0x1;}if(_0x367098[_0xd990('0xb')]){_0x367098[_0xd990('0x6')]+=0x1;updateWaitingCounter(_0x367098);}}_0x367098[_0xd990('0x9')]+=0x1;return _0x367098;}function getLastMessageText(_0x202792){return db[_0xd990('0xc')][_0xd990('0xd')]({'where':{'$and':[{'MailInteractionId':_0x202792['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd990('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xd990('0xf'),'raw':!![]})['then'](function(_0x395850){if(_0x395850&&_0x395850[_0xd990('0x10')]){_0x202792[_0xd990('0x11')]=_[_0xd990('0x12')](_0x395850[_0xd990('0x10')]);}return _0x202792;})[_0xd990('0x13')](function(_0x2e147b){throw _0x2e147b;});}exports['updateInteraction']=function(_0x2c31d5,_0x307cb6,_0x2741ef,_0x462e7b){return new Promise(function(_0x336b09,_0x2899c4){return getInteractionUsers(_0x2c31d5['id'],_0x2741ef)['then'](function(_0x595db6){_0x2c31d5['Users']=_0x595db6;return getInteractionTags(_0x2c31d5['TagIds'],_0x307cb6);})['then'](function(_0x1175c0){_0x2c31d5[_0xd990('0x14')]=_0x1175c0;delete _0x2c31d5[_0xd990('0x15')];return updateInteractionCounters(_0x2c31d5);})['then'](function(_0x2bebaa){if(_0x462e7b){return getLastMessageText(_0x2bebaa);}else{return _0x2bebaa;}})[_0xd990('0x16')](function(_0x100170){_0x336b09(_0x100170);})[_0xd990('0x13')](function(_0x3356f7){_0x2899c4(_0x3356f7);});});};
\ No newline at end of file
+var _0xbe97=['total','closed','disposition','UserId','MailMessage','findOne','out','plainBody','then','catch','updateInteraction','TagIds','Tags','fullname','forEach','waiting','talking','answered','abandoned'];(function(_0x375215,_0x34530e){var _0x5a31da=function(_0x1ece2d){while(--_0x1ece2d){_0x375215['push'](_0x375215['shift']());}};_0x5a31da(++_0x34530e);}(_0xbe97,0xb8));var _0x7be9=function(_0x531a2e,_0x28ec94){_0x531a2e=_0x531a2e-0x0;var _0x516b8a=_0xbe97[_0x531a2e];return _0x516b8a;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x4a4070,_0x10f99d){return new Promise(function(_0x2b813c,_0xb0ccc9){try{var _0x49a076=[];if(_0x10f99d[_0x4a4070]){_0x49a076=_0x10f99d[_0x4a4070]['map'](function(_0x46a340){return{'id':_0x46a340['id'],'fullname':_0x46a340[_0x7be9('0x0')]};});}return _0x2b813c(_0x49a076);}catch(_0x27275f){_0xb0ccc9(_0x27275f);}});}function getInteractionTags(_0x874ea,_0x5bcac1){var _0x30d12b=[];if(_0x874ea){_0x874ea['split'](',')[_0x7be9('0x1')](function(_0x465d4f){_0x30d12b['push'](_0x5bcac1[_0x465d4f]);});}return _0x30d12b;}function updateWaitingCounter(_0x47cff8){if(_0x47cff8[_0x7be9('0x2')]){_0x47cff8['waiting']-=0x1;}}function updateInteractionCounters(_0xd9365){_0xd9365[_0x7be9('0x2')]=0x0;_0xd9365[_0x7be9('0x3')]=0x0;_0xd9365[_0x7be9('0x4')]=0x0;_0xd9365['unmanaged']=0x0;_0xd9365[_0x7be9('0x5')]=0x0;_0xd9365[_0x7be9('0x6')]=0x0;if(_0xd9365[_0x7be9('0x7')]){if(_0xd9365[_0x7be9('0x8')]==='abandoned'){_0xd9365[_0x7be9('0x5')]+=0x1;updateWaitingCounter(_0xd9365);}if(_0xd9365[_0x7be9('0x9')]){_0xd9365['answered']+=0x1;if(_0xd9365[_0x7be9('0x3')]){_0xd9365[_0x7be9('0x3')]-=0x1;}}else{if(_0xd9365[_0x7be9('0x8')]){_0xd9365['unmanaged']+=0x1;updateWaitingCounter(_0xd9365);}}}else{if(!_0xd9365[_0x7be9('0x9')]){_0xd9365[_0x7be9('0x2')]+=0x1;}if(_0xd9365[_0x7be9('0x9')]){_0xd9365['talking']+=0x1;updateWaitingCounter(_0xd9365);}}_0xd9365[_0x7be9('0x6')]+=0x1;return _0xd9365;}function getLastMessageText(_0x532e9e){return db[_0x7be9('0xa')][_0x7be9('0xb')]({'where':{'$and':[{'MailInteractionId':_0x532e9e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7be9('0xc')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7be9('0xd')],'order':'-id','raw':!![]})[_0x7be9('0xe')](function(_0x16b5ef){if(_0x16b5ef&&_0x16b5ef[_0x7be9('0xd')]){_0x532e9e['lastMsgText']=_['trimStart'](_0x16b5ef['plainBody']);}return _0x532e9e;})[_0x7be9('0xf')](function(_0x23d7c0){throw _0x23d7c0;});}exports[_0x7be9('0x10')]=function(_0x45da29,_0x2501b1,_0x466fd5,_0x16565f){return new Promise(function(_0x41767c,_0x74221a){return getInteractionUsers(_0x45da29['id'],_0x466fd5)[_0x7be9('0xe')](function(_0x2a2c36){_0x45da29['Users']=_0x2a2c36;return getInteractionTags(_0x45da29[_0x7be9('0x11')],_0x2501b1);})[_0x7be9('0xe')](function(_0x366db3){_0x45da29[_0x7be9('0x12')]=_0x366db3;delete _0x45da29[_0x7be9('0x11')];return updateInteractionCounters(_0x45da29);})[_0x7be9('0xe')](function(_0x3ed1bd){if(_0x16565f){return getLastMessageText(_0x3ed1bd);}else{return _0x3ed1bd;}})[_0x7be9('0xe')](function(_0x35a8e5){_0x41767c(_0x35a8e5);})[_0x7be9('0xf')](function(_0x54203f){_0x74221a(_0x54203f);});});};
\ No newline at end of file
index 304c91f..c500677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfa0=['openchannel-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','update','then','info','error','exports','lodash','../../mysqldb','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbfa0,0x81));var _0x0bfa=function(_0x5a9ec4,_0x50313f){_0x5a9ec4=_0x5a9ec4-0x0;var _0x46c3fd=_0xbfa0[_0x5a9ec4];return _0x46c3fd;};'use strict';var _=require(_0x0bfa('0x0'));var db=require(_0x0bfa('0x1'))['db'];var loggers={'openchannel':require(_0x0bfa('0x2'))(_0x0bfa('0x3')),'mail':require(_0x0bfa('0x2'))('mail-interactions'),'fax':require(_0x0bfa('0x2'))(_0x0bfa('0x4')),'sms':require(_0x0bfa('0x2'))(_0x0bfa('0x5')),'chat':require(_0x0bfa('0x2'))('chat-interactions'),'whatsapp':require(_0x0bfa('0x2'))(_0x0bfa('0x6'))};function getAccountFK(_0x19617c){return _[_0x0bfa('0x7')](_0x19617c)+(_0x19617c===_0x0bfa('0x8')?_0x0bfa('0x9'):_0x0bfa('0xa'))+'Id';}function getInteractionFK(_0x5157be){return _['capitalize'](_0x5157be)+_0x0bfa('0xb');}function getInteractionId(_0x51e8a4,_0x2713da,_0x22529e){if(_0x51e8a4&&_0x51e8a4[_[_0x0bfa('0xc')](_0x22529e)+_0x0bfa('0xb')]){return _0x51e8a4[_[_0x0bfa('0xc')](_0x22529e)+_0x0bfa('0xb')];}else if(_0x51e8a4&&_0x51e8a4['id']){return _0x51e8a4['id'];}else if(_0x2713da&&_0x2713da['id']){return _0x2713da['id'];}else{return _0x0bfa('0xd');}}function getInteractionsTables(_0x10faf9){return{'accounts':_0x10faf9+'_'+(_0x10faf9==='chat'?'websites':_0x0bfa('0xe')),'interactions':_0x10faf9+_0x0bfa('0xf'),'interactionsTags':_0x10faf9+_0x0bfa('0x10'),'messages':_0x10faf9+_0x0bfa('0x11'),'userInteractions':_0x0bfa('0x12')+_0x10faf9+_0x0bfa('0xf')};}function getSelectedTags(_0x215767){var _0x443e90=[];if(_0x215767){_0x443e90=Array[_0x0bfa('0x13')](_0x215767)?_0x215767:[_0x215767];}return _0x443e90;}function log(_0x4b5458,_0x22d874,_0x3d4d5a,_0x463918,_0x1381d3,_0x521a0e){loggers[_0x1381d3[_0x0bfa('0x14')]()][_0x4b5458](_0x0bfa('0x15'),_0x521a0e[_0x0bfa('0x16')](),_0x22d874?_0x22d874['id']:null,_0x22d874?_0x22d874[_0x0bfa('0x17')]:null,_0x22d874?_0x22d874['role']:null,getInteractionId(_0x3d4d5a,_0x463918,_0x1381d3),_0x3d4d5a?JSON[_0x0bfa('0x18')](_0x3d4d5a):_0x0bfa('0x19'));}function updateUser(_0x302b6e,_0x5dc470,_0x47b136,_0x5a23c6,_0x5f50fe){db[_[_0x0bfa('0xc')](_0x5a23c6)+_0x0bfa('0x1a')][_0x0bfa('0x1b')]({'where':{'id':getInteractionId(_0x5dc470,_0x47b136,_0x5a23c6)}})['then'](function(_0x3c0565){if(_0x3c0565){return _0x3c0565[_0x0bfa('0x1c')]({'UserId':_0x302b6e?_0x302b6e['id']:null});}})[_0x0bfa('0x1d')](function(_0x15a385){if(_0x15a385){log(_0x0bfa('0x1e'),_0x302b6e,_0x5dc470,_0x47b136,_0x5a23c6,_0x5f50fe);}})['catch'](function(){log(_0x0bfa('0x1f'),_0x302b6e,_0x5dc470,_0x47b136,_0x5a23c6,_0x5f50fe);});}module[_0x0bfa('0x20')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
+var _0x83b4=['openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','Website','Account','InteractionId','upperFirst','chat','websites','_interactions','user_has_','isArray','toUpperCase','name','stringify','null','Interaction','then','update','info','catch','error','exports','../../mysqldb','../../config/logger'];(function(_0x30557f,_0x12cdc2){var _0x19d66f=function(_0x24258d){while(--_0x24258d){_0x30557f['push'](_0x30557f['shift']());}};_0x19d66f(++_0x12cdc2);}(_0x83b4,0x15d));var _0x483b=function(_0x1bad6d,_0x44b45f){_0x1bad6d=_0x1bad6d-0x0;var _0x27dfdd=_0x83b4[_0x1bad6d];return _0x27dfdd;};'use strict';var _=require('lodash');var db=require(_0x483b('0x0'))['db'];var loggers={'openchannel':require(_0x483b('0x1'))(_0x483b('0x2')),'mail':require(_0x483b('0x1'))('mail-interactions'),'fax':require(_0x483b('0x1'))(_0x483b('0x3')),'sms':require(_0x483b('0x1'))(_0x483b('0x4')),'chat':require(_0x483b('0x1'))(_0x483b('0x5')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x3fdf4b){return _[_0x483b('0x6')](_0x3fdf4b)+(_0x3fdf4b==='chat'?_0x483b('0x7'):_0x483b('0x8'))+'Id';}function getInteractionFK(_0x4c54c2){return _['capitalize'](_0x4c54c2)+_0x483b('0x9');}function getInteractionId(_0x2dfbac,_0x202bd9,_0x26935b){if(_0x2dfbac&&_0x2dfbac[_[_0x483b('0xa')](_0x26935b)+_0x483b('0x9')]){return _0x2dfbac[_['upperFirst'](_0x26935b)+'InteractionId'];}else if(_0x2dfbac&&_0x2dfbac['id']){return _0x2dfbac['id'];}else if(_0x202bd9&&_0x202bd9['id']){return _0x202bd9['id'];}else{return'unknown';}}function getInteractionsTables(_0x33b29f){return{'accounts':_0x33b29f+'_'+(_0x33b29f===_0x483b('0xb')?_0x483b('0xc'):'accounts'),'interactions':_0x33b29f+_0x483b('0xd'),'interactionsTags':_0x33b29f+'_interaction_has_tags','messages':_0x33b29f+'_messages','userInteractions':_0x483b('0xe')+_0x33b29f+_0x483b('0xd')};}function getSelectedTags(_0x4af266){var _0x5d4afa=[];if(_0x4af266){_0x5d4afa=Array[_0x483b('0xf')](_0x4af266)?_0x4af266:[_0x4af266];}return _0x5d4afa;}function log(_0x29027e,_0x51ba24,_0x43d71a,_0x20e5a9,_0x117e88,_0x1e2809){loggers[_0x117e88['toLowerCase']()][_0x29027e]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1e2809[_0x483b('0x10')](),_0x51ba24?_0x51ba24['id']:null,_0x51ba24?_0x51ba24[_0x483b('0x11')]:null,_0x51ba24?_0x51ba24['role']:null,getInteractionId(_0x43d71a,_0x20e5a9,_0x117e88),_0x43d71a?JSON[_0x483b('0x12')](_0x43d71a):_0x483b('0x13'));}function updateUser(_0x13cbf4,_0x540361,_0x9cca18,_0x171942,_0x1b9853){db[_[_0x483b('0xa')](_0x171942)+_0x483b('0x14')]['findOne']({'where':{'id':getInteractionId(_0x540361,_0x9cca18,_0x171942)}})[_0x483b('0x15')](function(_0x5501a8){if(_0x5501a8){return _0x5501a8[_0x483b('0x16')]({'UserId':_0x13cbf4?_0x13cbf4['id']:null});}})[_0x483b('0x15')](function(_0x301393){if(_0x301393){log(_0x483b('0x17'),_0x13cbf4,_0x540361,_0x9cca18,_0x171942,_0x1b9853);}})[_0x483b('0x18')](function(){log(_0x483b('0x19'),_0x13cbf4,_0x540361,_0x9cca18,_0x171942,_0x1b9853);});}module[_0x483b('0x1a')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
index de6d526..0c51be4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c39=['aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','use','findOne','then','count','status','catch','users','isUserLimit','util','../../config/environment','data1','license','split','createDecipher'];(function(_0x2fff95,_0x240856){var _0x1150c2=function(_0x23e63c){while(--_0x23e63c){_0x2fff95['push'](_0x2fff95['shift']());}};_0x1150c2(++_0x240856);}(_0x5c39,0x144));var _0x95c3=function(_0x47e0f2,_0x547d50){_0x47e0f2=_0x47e0f2-0x0;var _0x3ddf56=_0x5c39[_0x47e0f2];return _0x3ddf56;};'use strict';var crypto=require('crypto');var util=require(_0x95c3('0x0'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x95c3('0x1'));function getValueFromLicense(_0x10a403,_0x3eced4){if(_0x10a403&&_0x3eced4){if(_0x3eced4[_0x95c3('0x2')]&&_0x3eced4[_0x95c3('0x3')]){var _0x45d27e=_0x3eced4[_0x95c3('0x2')];var _0x38f46f=_0x3eced4[_0x95c3('0x3')];var _0x21b7cb=_0x45d27e[_0x95c3('0x4')]('-')[0x4];var _0x4aa152=_0x45d27e[_0x95c3('0x4')]('-')[0x0];var _0x118df4=crypto[_0x95c3('0x5')](_0x95c3('0x6'),util[_0x95c3('0x7')]('%s:%s:%s',_0x21b7cb,_0x45d27e,_0x4aa152));var _0x43be1f=_0x118df4[_0x95c3('0x8')](_0x38f46f,_0x95c3('0x9'),_0x95c3('0xa'));_0x43be1f+=_0x118df4[_0x95c3('0xb')](_0x95c3('0xa'));var _0x26a546=JSON[_0x95c3('0xc')](_0x43be1f);return _0x26a546[_0x95c3('0xd')](_0x10a403)?_0x26a546[_0x10a403]:null;}}return null;}function isLimit(_0x2ea4d1,_0x256bae,_0x2d76cc,_0x2ea76c){var _0x4096df=_0x256bae;return compose()[_0x95c3('0xe')](function(_0x2590c9,_0x32ed23,_0x5dba02){return db['License'][_0x95c3('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3ea232){var _0xc17a49=getValueFromLicense(_0x2ea4d1,_0x3ea232);return _0xc17a49?_0xc17a49:_0x4096df;})[_0x95c3('0x10')](function(_0x368cd3){_0x4096df=_0x368cd3;return _0x2d76cc[_0x95c3('0x11')](_0x2ea76c);})['then'](function(_0x1d53bc){if(_0x1d53bc>=_0x4096df){return _0x32ed23[_0x95c3('0x12')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2ea4d1)});}_0x5dba02();})[_0x95c3('0x13')](function(_0x3cd62c){_0x5dba02(_0x3cd62c);});});}function isUserLimit(){return isLimit(_0x95c3('0x14'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x95c3('0x15')]=isUserLimit;
\ No newline at end of file
+var _0x0b8b=['then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','findOne'];(function(_0x46969b,_0x2aff25){var _0xa05c7=function(_0xc3e08c){while(--_0xc3e08c){_0x46969b['push'](_0x46969b['shift']());}};_0xa05c7(++_0x2aff25);}(_0x0b8b,0x19f));var _0xb0b8=function(_0x21e6f1,_0x4d5eb5){_0x21e6f1=_0x21e6f1-0x0;var _0x44a394=_0x0b8b[_0x21e6f1];return _0x44a394;};'use strict';var crypto=require(_0xb0b8('0x0'));var util=require(_0xb0b8('0x1'));var compose=require(_0xb0b8('0x2'));var db=require(_0xb0b8('0x3'))['db'];var config=require(_0xb0b8('0x4'));function getValueFromLicense(_0x1b79c2,_0x3e844d){if(_0x1b79c2&&_0x3e844d){if(_0x3e844d[_0xb0b8('0x5')]&&_0x3e844d[_0xb0b8('0x6')]){var _0x26f8f7=_0x3e844d[_0xb0b8('0x5')];var _0x580b42=_0x3e844d[_0xb0b8('0x6')];var _0x17202c=_0x26f8f7[_0xb0b8('0x7')]('-')[0x4];var _0x45af8b=_0x26f8f7[_0xb0b8('0x7')]('-')[0x0];var _0x3f9ad0=crypto[_0xb0b8('0x8')](_0xb0b8('0x9'),util[_0xb0b8('0xa')](_0xb0b8('0xb'),_0x17202c,_0x26f8f7,_0x45af8b));var _0x253586=_0x3f9ad0[_0xb0b8('0xc')](_0x580b42,_0xb0b8('0xd'),_0xb0b8('0xe'));_0x253586+=_0x3f9ad0[_0xb0b8('0xf')](_0xb0b8('0xe'));var _0x48fb16=JSON[_0xb0b8('0x10')](_0x253586);return _0x48fb16[_0xb0b8('0x11')](_0x1b79c2)?_0x48fb16[_0x1b79c2]:null;}}return null;}function isLimit(_0x5d79af,_0x5f4cf6,_0x2cfa14,_0x389b6c){var _0x414919=_0x5f4cf6;return compose()['use'](function(_0xabdb1d,_0x298f91,_0x2d24c6){return db[_0xb0b8('0x12')][_0xb0b8('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xb0b8('0x14')](function(_0x14a7d6){var _0x36ccc3=getValueFromLicense(_0x5d79af,_0x14a7d6);return _0x36ccc3?_0x36ccc3:_0x414919;})['then'](function(_0x3fa4c0){_0x414919=_0x3fa4c0;return _0x2cfa14[_0xb0b8('0x15')](_0x389b6c);})[_0xb0b8('0x14')](function(_0x3c6ee9){if(_0x3c6ee9>=_0x414919){return _0x298f91[_0xb0b8('0x16')](0x193)[_0xb0b8('0x17')]({'message':util[_0xb0b8('0xa')](_0xb0b8('0x18'),_0x5d79af)});}_0x2d24c6();})[_0xb0b8('0x19')](function(_0x296b6d){_0x2d24c6(_0x296b6d);});});}function isUserLimit(){return isLimit(_0xb0b8('0x1a'),0x1,db[_0xb0b8('0x1b')],{'where':{'$or':[{'role':'admin'},{'role':_0xb0b8('0x1c')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 16167d9..3f48cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d2=['LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','and','replace','[$and]','[$or]','split','length','forEach','match','filter','indexOf','push','buildExpression','operator','$eq','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','$substring','$startsWith','$endsWith'];(function(_0x295f60,_0x3d5b1d){var _0x4a7f85=function(_0x196bd7){while(--_0x196bd7){_0x295f60['push'](_0x295f60['shift']());}};_0x4a7f85(++_0x3d5b1d);}(_0x55d2,0x198));var _0x255d=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0x55d2[_0x5db657];return _0x2d6e70;};'use strict';var _=require(_0x255d('0x0'));var moment=require(_0x255d('0x1'));exports[_0x255d('0x2')]=function(_0x10976d){var _0x47ab4d={'conditions':[]};_0x47ab4d[_0x255d('0x3')]=_['startsWith'](_0x10976d,'[$or]')?'or':_0x255d('0x4');var _0x1526cc=_0x10976d[_0x255d('0x5')](_0x255d('0x6'),'')[_0x255d('0x5')](_0x255d('0x7'),'')[_0x255d('0x8')]('||');for(var _0x4a6648=0x0;_0x4a6648<_0x1526cc[_0x255d('0x9')];_0x4a6648++){var _0x2729dd=_0x1526cc[_0x4a6648][_0x255d('0x8')](':=');var _0x3deb38=_0x2729dd[0x0];var _0x4a910a=_0x2729dd['slice'](0x1);_0x4a910a[_0x255d('0xa')](function(_0xd9b46d){var _0x1666ac=_0xd9b46d['split']('[')['shift']();var _0x27187d=_0xd9b46d[_0x255d('0xb')](/\[(.*?)\]/g);_0x27187d[_0x255d('0xa')](function(_0x37b71c){var _0x42395e=_0x37b71c[_0x255d('0x8')]('[')[_0x255d('0xc')](function(_0xd7f112){return _0xd7f112[_0x255d('0xd')](']')>-0x1;})['map'](function(_0x367f53){return _0x367f53[_0x255d('0x8')](']')[0x0];})[0x0];_0x47ab4d['conditions'][_0x255d('0xe')]({'field':_0x3deb38,'operator':_0x1666ac,'value':_0x42395e});});});}return _0x47ab4d;};exports[_0x255d('0xf')]=function(_0x51fa45,_0x2d1a0d,_0x2295ab){var _0x131a94={};if(_0x2d1a0d==='DATE'){if(_0x2295ab[_0x255d('0x10')]===_0x255d('0x11')){_0x2295ab[_0x255d('0x10')]='$between';_0x2295ab[_0x255d('0x12')]+=','+_0x2295ab[_0x255d('0x12')];}else if(_[_0x255d('0x13')]([_0x255d('0x14'),_0x255d('0x15')],_0x2295ab['operator'])){_0x2295ab['value']=moment(_0x2295ab[_0x255d('0x12')])['add'](0x1,_0x255d('0x16'))[_0x255d('0x17')](_0x255d('0x18'));}}if(_0x2295ab[_0x255d('0x19')]){_0x2d1a0d=_0x2295ab[_0x255d('0x19')];_0x131a94['text']=_0x255d('0x1a')+_0x51fa45+'.'+_0x2295ab[_0x255d('0x1b')]+_0x255d('0x1c')+_0x2295ab[_0x255d('0x19')]+')\x20'+parseOperator(_0x2295ab[_0x255d('0x10')]);}else{_0x131a94['text']=_0x51fa45+'.'+_0x2295ab[_0x255d('0x1b')]+'\x20'+parseOperator(_0x2295ab[_0x255d('0x10')]);}if(_[_0x255d('0x13')]([_0x255d('0x1d'),_0x255d('0x1e')],_0x2295ab[_0x255d('0x10')]))_0x131a94[_0x255d('0x1f')]='('+_0x131a94[_0x255d('0x1f')]+_0x255d('0x20')+_0x51fa45+'.'+_0x2295ab[_0x255d('0x1b')]+_0x255d('0x21');_0x131a94[_0x255d('0x12')]=parseValue(_0x2d1a0d,_0x2295ab[_0x255d('0x10')],_0x2295ab[_0x255d('0x12')]);return _0x131a94;};function parseOperator(_0x46f6e7){var _0xf61847;switch(_0x46f6e7){case _0x255d('0x22'):_0xf61847=_0x255d('0x23');break;case _0x255d('0x1e'):_0xf61847='NOT\x20IN\x20?';break;case'$eq':_0xf61847=_0x255d('0x24');break;case _0x255d('0x1d'):_0xf61847='<>\x20?';break;case _0x255d('0x25'):case _0x255d('0x26'):case _0x255d('0x27'):_0xf61847=_0x255d('0x28');break;case _0x255d('0x29'):_0xf61847=_0x255d('0x2a');break;case _0x255d('0x14'):_0xf61847=_0x255d('0x2b');break;case _0x255d('0x15'):_0xf61847=_0x255d('0x2c');break;case'$gte':_0xf61847=_0x255d('0x2d');break;case _0x255d('0x2e'):_0xf61847=_0x255d('0x2f');break;}return _0xf61847;}function parseValue(_0x2e0309,_0x2083d1,_0x1ef9b7){var _0x182078={'start':undefined,'end':undefined};switch(_0x2083d1){case _0x255d('0x22'):case _0x255d('0x1e'):_0x182078[_0x255d('0x30')]=_0x1ef9b7[_0x255d('0x8')](',');break;case'$substring':_0x182078[_0x255d('0x30')]='%'+_0x1ef9b7+'%';break;case _0x255d('0x26'):_0x182078[_0x255d('0x30')]=_0x1ef9b7+'%';break;case _0x255d('0x27'):_0x182078[_0x255d('0x30')]='%'+_0x1ef9b7;break;case _0x255d('0x2e'):var _0x106394=_0x1ef9b7[_0x255d('0x8')](',');var _0x1ef9b7=_0x106394['shift']();var _0x4e2b61=_0x106394[_0x255d('0x31')]();if(_0x2e0309===_0x255d('0x32')){_0x1ef9b7=moment(_0x1ef9b7)['utcOffset'](0x0,!![])[_0x255d('0x17')]();_0x4e2b61=moment(_0x4e2b61)[_0x255d('0x33')](0x0,!![])[_0x255d('0x34')](0x17,_0x255d('0x35'))[_0x255d('0x34')](0x3b,_0x255d('0x36'))[_0x255d('0x34')](0x3b,_0x255d('0x37'))['format']();}_0x182078={'start':_0x1ef9b7,'end':_0x4e2b61};break;default:_0x182078['start']=_0x1ef9b7;break;}return _0x182078;}
\ No newline at end of file
+var _0x8d43=['\x20OR\x20','$in','IN\x20?','$notIn','NOT\x20IN\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','hours','minutes','seconds','lodash','moment','startsWith','[$or]','and','replace','[$and]','split','shift','forEach','filter','indexOf','conditions','buildExpression','DATE','operator','$between','value','$lte','add','days','format','YYYY-MM-DD','castTo','CAST(','field','text','includes'];(function(_0x5da897,_0x534461){var _0x1c6024=function(_0xcac13a){while(--_0xcac13a){_0x5da897['push'](_0x5da897['shift']());}};_0x1c6024(++_0x534461);}(_0x8d43,0xb0));var _0x38d4=function(_0x53a7fb,_0x819c05){_0x53a7fb=_0x53a7fb-0x0;var _0x372d13=_0x8d43[_0x53a7fb];return _0x372d13;};'use strict';var _=require(_0x38d4('0x0'));var moment=require(_0x38d4('0x1'));exports['parseSearch']=function(_0xc66c42){var _0x129aba={'conditions':[]};_0x129aba['sqlOperator']=_[_0x38d4('0x2')](_0xc66c42,_0x38d4('0x3'))?'or':_0x38d4('0x4');var _0x47849a=_0xc66c42[_0x38d4('0x5')](_0x38d4('0x6'),'')[_0x38d4('0x5')]('[$or]','')[_0x38d4('0x7')]('||');for(var _0x148ee2=0x0;_0x148ee2<_0x47849a['length'];_0x148ee2++){var _0x518f8d=_0x47849a[_0x148ee2][_0x38d4('0x7')](':=');var _0x5e06be=_0x518f8d[0x0];var _0x31da84=_0x518f8d['slice'](0x1);_0x31da84['forEach'](function(_0x496317){var _0x3ce623=_0x496317[_0x38d4('0x7')]('[')[_0x38d4('0x8')]();var _0x430d43=_0x496317['match'](/\[(.*?)\]/g);_0x430d43[_0x38d4('0x9')](function(_0x29c0b1){var _0x2b466d=_0x29c0b1[_0x38d4('0x7')]('[')[_0x38d4('0xa')](function(_0x38bce0){return _0x38bce0[_0x38d4('0xb')](']')>-0x1;})['map'](function(_0x193131){return _0x193131['split'](']')[0x0];})[0x0];_0x129aba[_0x38d4('0xc')]['push']({'field':_0x5e06be,'operator':_0x3ce623,'value':_0x2b466d});});});}return _0x129aba;};exports[_0x38d4('0xd')]=function(_0x3d92ac,_0x59ce22,_0x2a5c37){var _0x33dab6={};if(_0x59ce22===_0x38d4('0xe')){if(_0x2a5c37['operator']==='$eq'){_0x2a5c37[_0x38d4('0xf')]=_0x38d4('0x10');_0x2a5c37[_0x38d4('0x11')]+=','+_0x2a5c37[_0x38d4('0x11')];}else if(_['includes'](['$gt',_0x38d4('0x12')],_0x2a5c37['operator'])){_0x2a5c37[_0x38d4('0x11')]=moment(_0x2a5c37['value'])[_0x38d4('0x13')](0x1,_0x38d4('0x14'))[_0x38d4('0x15')](_0x38d4('0x16'));}}if(_0x2a5c37[_0x38d4('0x17')]){_0x59ce22=_0x2a5c37[_0x38d4('0x17')];_0x33dab6['text']=_0x38d4('0x18')+_0x3d92ac+'.'+_0x2a5c37[_0x38d4('0x19')]+'\x20AS\x20'+_0x2a5c37[_0x38d4('0x17')]+')\x20'+parseOperator(_0x2a5c37[_0x38d4('0xf')]);}else{_0x33dab6[_0x38d4('0x1a')]=_0x3d92ac+'.'+_0x2a5c37[_0x38d4('0x19')]+'\x20'+parseOperator(_0x2a5c37['operator']);}if(_[_0x38d4('0x1b')](['$ne','$notIn'],_0x2a5c37[_0x38d4('0xf')]))_0x33dab6[_0x38d4('0x1a')]='('+_0x33dab6[_0x38d4('0x1a')]+_0x38d4('0x1c')+_0x3d92ac+'.'+_0x2a5c37[_0x38d4('0x19')]+'\x20IS\x20NULL)';_0x33dab6[_0x38d4('0x11')]=parseValue(_0x59ce22,_0x2a5c37[_0x38d4('0xf')],_0x2a5c37[_0x38d4('0x11')]);return _0x33dab6;};function parseOperator(_0xcb02ae){var _0x5c3e9a;switch(_0xcb02ae){case _0x38d4('0x1d'):_0x5c3e9a=_0x38d4('0x1e');break;case _0x38d4('0x1f'):_0x5c3e9a=_0x38d4('0x20');break;case'$eq':_0x5c3e9a='=\x20?';break;case'$ne':_0x5c3e9a=_0x38d4('0x21');break;case'$substring':case _0x38d4('0x22'):case _0x38d4('0x23'):_0x5c3e9a=_0x38d4('0x24');break;case _0x38d4('0x25'):_0x5c3e9a=_0x38d4('0x26');break;case'$gt':_0x5c3e9a=_0x38d4('0x27');break;case _0x38d4('0x12'):_0x5c3e9a=_0x38d4('0x28');break;case _0x38d4('0x29'):_0x5c3e9a=_0x38d4('0x2a');break;case _0x38d4('0x10'):_0x5c3e9a=_0x38d4('0x2b');break;}return _0x5c3e9a;}function parseValue(_0x1633e9,_0x3b0372,_0x1e14ad){var _0x5996a2={'start':undefined,'end':undefined};switch(_0x3b0372){case _0x38d4('0x1d'):case _0x38d4('0x1f'):_0x5996a2[_0x38d4('0x2c')]=_0x1e14ad[_0x38d4('0x7')](',');break;case _0x38d4('0x2d'):_0x5996a2[_0x38d4('0x2c')]='%'+_0x1e14ad+'%';break;case _0x38d4('0x22'):_0x5996a2[_0x38d4('0x2c')]=_0x1e14ad+'%';break;case _0x38d4('0x23'):_0x5996a2[_0x38d4('0x2c')]='%'+_0x1e14ad;break;case _0x38d4('0x10'):var _0x3394d6=_0x1e14ad[_0x38d4('0x7')](',');var _0x1e14ad=_0x3394d6[_0x38d4('0x8')]();var _0x1d999f=_0x3394d6[_0x38d4('0x2e')]();if(_0x1633e9==='DATE'){_0x1e14ad=moment(_0x1e14ad)[_0x38d4('0x2f')](0x0,!![])[_0x38d4('0x15')]();_0x1d999f=moment(_0x1d999f)[_0x38d4('0x2f')](0x0,!![])[_0x38d4('0x13')](0x17,_0x38d4('0x30'))[_0x38d4('0x13')](0x3b,_0x38d4('0x31'))[_0x38d4('0x13')](0x3b,_0x38d4('0x32'))[_0x38d4('0x15')]();}_0x5996a2={'start':_0x1e14ad,'end':_0x1d999f};break;default:_0x5996a2[_0x38d4('0x2c')]=_0x1e14ad;break;}return _0x5996a2;}
\ No newline at end of file
index 835938e..1ff3f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bc=['match','push','replace','getOptions','query','$id','model','name','intersection','attributes','offset','order','sort','pick','filter','object','columns','value','where','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','fields','filters','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','limit','split','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','omit','isEmpty','length','isString','isArray','unset','hasOwnProperty','isNumeric','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2bc,0x10f));var _0xcd2b=function(_0x584c85,_0x5c9c9a){_0x584c85=_0x584c85-0x0;var _0x603397=_0xd2bc[_0x584c85];return _0x603397;};'use strict';var _=require('lodash');var sequelize=require(_0xcd2b('0x0'));var moment=require(_0xcd2b('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x39ba24){var _0x12fabd=['ne'];try{var _0x1631f9=JSON[_0xcd2b('0x2')](_0x39ba24);var _0x4065d7=Object['keys'](_0x1631f9)[0x0];return _0x12fabd['includes'](_0x4065d7);}catch(_0xa0d926){return![];}}function getOperatorValue(_0x74c799){var _0x381669=JSON['parse'](_0x74c799);var _0x2a053c=Object[_0xcd2b('0x3')](_0x381669)[0x0];var _0xa0c7b2=_0x381669[_0x2a053c];return{['$'+_0x2a053c]:_0xa0c7b2};}exports[_0xcd2b('0x4')]=function(_0x24571a){var _0x589f93=null;if(_0x24571a){_0x589f93=_0x24571a['split'](',');}return _0x589f93;};exports[_0xcd2b('0x5')]=function(_0x4afbe3,_0x5ddc90){var _0x5d405c={};if(!_['isEmpty'](_0x4afbe3)){_[_0xcd2b('0x6')](_0x4afbe3,function(_0x51ea8e,_0xa2e2f9){try{if(_0x5ddc90){var _0x520c62=_[_0xcd2b('0x7')](_0x5ddc90,{'name':_0xa2e2f9})||{};if(hasSequelizeOperator(_0x51ea8e)){_0x5d405c[_0xa2e2f9]=getOperatorValue(_0x51ea8e);}else if(_0x520c62[_0xcd2b('0x8')]===_0xcd2b('0x9')&&_[_0xcd2b('0xa')](_0x51ea8e)){var _0x185eb4=JSON[_0xcd2b('0x2')](_0x51ea8e);var _0x4c6d97={'$gte':moment(moment(_0x185eb4[_0xcd2b('0xb')])[_0xcd2b('0xc')](_0xcd2b('0xd')))[_0xcd2b('0xe')]()[_0xcd2b('0xc')](),'$lte':moment(moment(_0x185eb4[_0xcd2b('0xf')])[_0xcd2b('0xc')]('YYYY-MM-DD'))[_0xcd2b('0xe')]()['subtract'](0x1,'s')[_0xcd2b('0xc')]()};_0x5d405c[_0xa2e2f9]=_0x4c6d97;}else if(_0x520c62['name']==='uniqueid'){_0x5d405c[_0xa2e2f9]=_0x51ea8e;}else{_0x5d405c[_0xa2e2f9]=_['isArray'](_0x51ea8e)?_0x51ea8e:JSON[_0xcd2b('0x2')](_0x51ea8e);}}else{_0x5d405c[_0xa2e2f9]=_['isArray'](_0x51ea8e)?_0x51ea8e:JSON[_0xcd2b('0x2')](_0x51ea8e);}}catch(_0xbc2003){_0x5d405c[_0xa2e2f9]=_0x51ea8e['split'](',');}});}return _0x5d405c;};exports[_0xcd2b('0x10')]=function(_0x4ddfb3){_0x4ddfb3=parseInt(_0x4ddfb3,0xa);if(!_0x4ddfb3||_0x4ddfb3<0x0){_0x4ddfb3=LIMIT_VALUE;}return _0x4ddfb3;};exports['offset']=function(_0x2d7334){_0x2d7334=parseInt(_0x2d7334,0xa);if(!_0x2d7334||_0x2d7334<0x0){_0x2d7334=0x0;}return _0x2d7334;};exports['sort']=function(_0xc998d1){var _0x876483,_0x31ae22=null;if(_0xc998d1){_0x876483=_0xc998d1[_0xcd2b('0x11')](',');_0x31ae22=_[_0xcd2b('0x12')](_0x876483,function(_0x480cf7){if(_0x480cf7[_0xcd2b('0x13')]('-')===0x0){return[_0x480cf7==='priority'?sequelize[_0xcd2b('0x14')](sequelize[_0xcd2b('0x15')](_0xcd2b('0x16')),_0xcd2b('0x17')):_0x480cf7[_0xcd2b('0x18')](0x1),_0xcd2b('0x19')];}else{return[_0x480cf7==='priority'?sequelize[_0xcd2b('0x14')](sequelize['col'](_0xcd2b('0x16')),_0xcd2b('0x17')):_0x480cf7,_0xcd2b('0x1a')];}});}return _0x31ae22;};exports[_0xcd2b('0x1b')]=function(_0x1a455b,_0x39dba4){if(_[_0xcd2b('0x1c')](_0x1a455b)){return _0x1a455b;}if(_['isArray'](_0x1a455b)){for(var _0x1bc9e3=0x0;_0x1bc9e3<_0x1a455b[_0xcd2b('0x1d')];_0x1bc9e3+=0x1){_0x1a455b[_0x1bc9e3]=this[_0xcd2b('0x1b')](_0x1a455b[_0x1bc9e3],_0x39dba4);}return _0x1a455b;}if(!_['isObject'](_0x1a455b)){return _0x1a455b;}if(_[_0xcd2b('0x1e')](_0x39dba4)){_0x39dba4=[_0x39dba4];}if(!_[_0xcd2b('0x1f')](_0x39dba4)){return _0x1a455b;}for(var _0x3ea2f2=0x0;_0x3ea2f2<_0x39dba4[_0xcd2b('0x1d')];_0x3ea2f2+=0x1){_[_0xcd2b('0x20')](_0x1a455b,_0x39dba4[_0x3ea2f2]);}for(var _0x3abb4a in _0x1a455b){if(_0x1a455b[_0xcd2b('0x21')](_0x3abb4a)){_0x1a455b[_0x3abb4a]=this[_0xcd2b('0x1b')](_0x1a455b[_0x3abb4a],_0x39dba4);}}return _0x1a455b;};exports[_0xcd2b('0x22')]=function(_0x379c92){return _0x379c92['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xcd2b('0x23')]=function(_0x5de4e4){return _0x5de4e4['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xcd2b('0x24')]=function(_0x58deec,_0x25c730){var _0x3b20b5=[];var _0x527b9f=/[ `!@#$%^&*()_\-?~]/;var _0x50f0b5=_0x25c730?_0xcd2b('0x25'):_0xcd2b('0x26');_0x58deec[_0xcd2b('0x11')](/[ ,]+/)['forEach'](function(_0x355088){_0x355088=_0x355088['replace'](/([^:]")"+/g,'$1');_0x355088='+'+_0x355088+'*';var _0x27a180=_0x355088[_0xcd2b('0x27')](_0x527b9f);if(_0x27a180){_0x355088='\x22'+_0x355088+'\x22';}_0x3b20b5[_0xcd2b('0x28')](_0x355088);});_0x50f0b5=_0x50f0b5[_0xcd2b('0x29')](_0xcd2b('0x26'),_0x3b20b5['join']('\x20'));return _0x50f0b5;};exports[_0xcd2b('0x2a')]=function(_0x19e330,_0x58696a,_0x5bf0f3){var _0x2fc1f4={},_0x155e69={};if(_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x2c')]){_0x58696a[_0xcd2b('0x2b')]['id']=_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x2c')];delete _0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x2c')];}_0x2fc1f4[_0xcd2b('0x2d')]=_[_0xcd2b('0x12')](_0x19e330,_0xcd2b('0x2e'));_0x2fc1f4['query']=_[_0xcd2b('0x3')](_0x58696a['query']);_0x2fc1f4['filters']=_[_0xcd2b('0x2f')](_0x2fc1f4[_0xcd2b('0x2d')],_0x2fc1f4[_0xcd2b('0x2b')]);_0x155e69[_0xcd2b('0x30')]=_[_0xcd2b('0x2f')](_0x2fc1f4[_0xcd2b('0x2d')],this[_0xcd2b('0x4')](_0x58696a['query'][_0xcd2b('0x4')]));_0x155e69['attributes']=_0x155e69[_0xcd2b('0x30')][_0xcd2b('0x1d')]?_0x155e69[_0xcd2b('0x30')]:_0x2fc1f4[_0xcd2b('0x2d')];if(!_0x58696a['query'][_0xcd2b('0x21')]('nolimit')){_0x155e69[_0xcd2b('0x10')]=this[_0xcd2b('0x10')](_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x10')]);_0x155e69[_0xcd2b('0x31')]=this['offset'](_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x31')]);}_0x155e69[_0xcd2b('0x32')]=this[_0xcd2b('0x33')](_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x33')]);_0x155e69['where']=this['filters'](_[_0xcd2b('0x34')](_0x58696a[_0xcd2b('0x2b')],_0x2fc1f4[_0xcd2b('0x5')]),_0x19e330);if(_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x35')]){var _0x5b25b2=_0x19e330;var _0x5a8bf9=_0x58696a['query']['filter'];if(typeof _0x5a8bf9===_0xcd2b('0x36')){_0x5b25b2=_[_0xcd2b('0x35')](_0x19e330,function(_0x217625){return _['includes'](_0x5a8bf9[_0xcd2b('0x37')],_0x217625[_0xcd2b('0x2e')]);});_0x5a8bf9=_0x5a8bf9[_0xcd2b('0x38')];}_0x155e69[_0xcd2b('0x39')]=_[_0xcd2b('0x3a')](_0x155e69[_0xcd2b('0x39')],{'$or':_[_0xcd2b('0x12')](_0x5b25b2,function(_0x51ae28){if(_0x51ae28['type']!==_0xcd2b('0x3b')){if(_0x5bf0f3){return sequelize[_0xcd2b('0x39')](sequelize['fn']('lower',sequelize['col'](_0x51ae28['name'])),{'$like':sequelize['fn'](_0xcd2b('0x3c'),'%'+_0x58696a[_0xcd2b('0x2b')][_0xcd2b('0x35')]+'%')});}else{var _0x32f465={};_0x32f465[_0x51ae28[_0xcd2b('0x2e')]]={'$like':'%'+_0x58696a[_0xcd2b('0x2b')]['filter']+'%'};return _0x32f465;}}})});}_0x155e69=_[_0xcd2b('0x3a')]({},_0x155e69,_0x58696a[_0xcd2b('0x3d')]);return _0x155e69;};
\ No newline at end of file
+var _0x672e=['ASC','omit','isEmpty','length','isObject','isString','hasOwnProperty','isNumeric','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','$id','query','model','intersection','attributes','nolimit','order','where','pick','filter','columns','value','merge','VIRTUAL','lower','options','lodash','parse','keys','includes','fields','split','filters','forOwn','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','col','substr','cast','unsigned'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x672e,0x9b));var _0xe672=function(_0x9e3a35,_0x4c7bb1){_0x9e3a35=_0x9e3a35-0x0;var _0x36f610=_0x672e[_0x9e3a35];return _0x36f610;};'use strict';var _=require(_0xe672('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5debab){var _0x88e066=['ne'];try{var _0x59c628=JSON[_0xe672('0x1')](_0x5debab);var _0x78b6aa=Object[_0xe672('0x2')](_0x59c628)[0x0];return _0x88e066[_0xe672('0x3')](_0x78b6aa);}catch(_0x1daf67){return![];}}function getOperatorValue(_0x440b27){var _0x389022=JSON[_0xe672('0x1')](_0x440b27);var _0x296897=Object[_0xe672('0x2')](_0x389022)[0x0];var _0x280d0f=_0x389022[_0x296897];return{['$'+_0x296897]:_0x280d0f};}exports[_0xe672('0x4')]=function(_0x202487){var _0x5cf7f2=null;if(_0x202487){_0x5cf7f2=_0x202487[_0xe672('0x5')](',');}return _0x5cf7f2;};exports[_0xe672('0x6')]=function(_0x30fe78,_0x8bc621){var _0x19928e={};if(!_['isEmpty'](_0x30fe78)){_[_0xe672('0x7')](_0x30fe78,function(_0xb7396e,_0x480a56){try{if(_0x8bc621){var _0x59dee0=_['find'](_0x8bc621,{'name':_0x480a56})||{};if(hasSequelizeOperator(_0xb7396e)){_0x19928e[_0x480a56]=getOperatorValue(_0xb7396e);}else if(_0x59dee0['type']==='DATE'&&_[_0xe672('0x8')](_0xb7396e)){var _0x4fec67=JSON[_0xe672('0x1')](_0xb7396e);var _0x2b1775={'$gte':moment(moment(_0x4fec67[_0xe672('0x9')])[_0xe672('0xa')](_0xe672('0xb')))[_0xe672('0xc')]()[_0xe672('0xa')](),'$lte':moment(moment(_0x4fec67[_0xe672('0xd')])['format']('YYYY-MM-DD'))[_0xe672('0xc')]()[_0xe672('0xe')](0x1,'s')['format']()};_0x19928e[_0x480a56]=_0x2b1775;}else if(_0x59dee0[_0xe672('0xf')]===_0xe672('0x10')){_0x19928e[_0x480a56]=_0xb7396e;}else{_0x19928e[_0x480a56]=_[_0xe672('0x11')](_0xb7396e)?_0xb7396e:JSON['parse'](_0xb7396e);}}else{_0x19928e[_0x480a56]=_[_0xe672('0x11')](_0xb7396e)?_0xb7396e:JSON[_0xe672('0x1')](_0xb7396e);}}catch(_0x584433){_0x19928e[_0x480a56]=_0xb7396e[_0xe672('0x5')](',');}});}return _0x19928e;};exports[_0xe672('0x12')]=function(_0x55fc00){_0x55fc00=parseInt(_0x55fc00,0xa);if(!_0x55fc00||_0x55fc00<0x0){_0x55fc00=LIMIT_VALUE;}return _0x55fc00;};exports[_0xe672('0x13')]=function(_0x413175){_0x413175=parseInt(_0x413175,0xa);if(!_0x413175||_0x413175<0x0){_0x413175=0x0;}return _0x413175;};exports[_0xe672('0x14')]=function(_0x50683f){var _0x1b2401,_0x32f0bc=null;if(_0x50683f){_0x1b2401=_0x50683f[_0xe672('0x5')](',');_0x32f0bc=_[_0xe672('0x15')](_0x1b2401,function(_0x500cdf){if(_0x500cdf[_0xe672('0x16')]('-')===0x0){return[_0x500cdf===_0xe672('0x17')?sequelize['cast'](sequelize[_0xe672('0x18')](_0xe672('0x17')),'unsigned'):_0x500cdf[_0xe672('0x19')](0x1),'DESC'];}else{return[_0x500cdf===_0xe672('0x17')?sequelize[_0xe672('0x1a')](sequelize[_0xe672('0x18')](_0xe672('0x17')),_0xe672('0x1b')):_0x500cdf,_0xe672('0x1c')];}});}return _0x32f0bc;};exports[_0xe672('0x1d')]=function(_0x5dd9e6,_0x7110f3){if(_[_0xe672('0x1e')](_0x5dd9e6)){return _0x5dd9e6;}if(_[_0xe672('0x11')](_0x5dd9e6)){for(var _0x5a93f7=0x0;_0x5a93f7<_0x5dd9e6[_0xe672('0x1f')];_0x5a93f7+=0x1){_0x5dd9e6[_0x5a93f7]=this[_0xe672('0x1d')](_0x5dd9e6[_0x5a93f7],_0x7110f3);}return _0x5dd9e6;}if(!_[_0xe672('0x20')](_0x5dd9e6)){return _0x5dd9e6;}if(_[_0xe672('0x21')](_0x7110f3)){_0x7110f3=[_0x7110f3];}if(!_[_0xe672('0x11')](_0x7110f3)){return _0x5dd9e6;}for(var _0x2d5049=0x0;_0x2d5049<_0x7110f3[_0xe672('0x1f')];_0x2d5049+=0x1){_['unset'](_0x5dd9e6,_0x7110f3[_0x2d5049]);}for(var _0x4eeec8 in _0x5dd9e6){if(_0x5dd9e6[_0xe672('0x22')](_0x4eeec8)){_0x5dd9e6[_0x4eeec8]=this[_0xe672('0x1d')](_0x5dd9e6[_0x4eeec8],_0x7110f3);}}return _0x5dd9e6;};exports[_0xe672('0x23')]=function(_0x2ea55b){return _0x2ea55b['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x47190d){return _0x47190d[_0xe672('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xe672('0x25')]=function(_0x542f61,_0x214133){var _0x31aac4=[];var _0xc5cc4d=/[ `!@#$%^&*()_\-?~]/;var _0x4b86a5=_0x214133?_0xe672('0x26'):_0xe672('0x27');_0x542f61['split'](/[ ,]+/)[_0xe672('0x28')](function(_0x4ba729){_0x4ba729=_0x4ba729[_0xe672('0x29')](/([^:]")"+/g,'$1');_0x4ba729='+'+_0x4ba729+'*';var _0x1895d1=_0x4ba729[_0xe672('0x24')](_0xc5cc4d);if(_0x1895d1){_0x4ba729='\x22'+_0x4ba729+'\x22';}_0x31aac4[_0xe672('0x2a')](_0x4ba729);});_0x4b86a5=_0x4b86a5[_0xe672('0x29')](_0xe672('0x27'),_0x31aac4[_0xe672('0x2b')]('\x20'));return _0x4b86a5;};exports[_0xe672('0x2c')]=function(_0x3b062d,_0x216847,_0x52de2f){var _0xf28a86={},_0x108af0={};if(_0x216847['query'][_0xe672('0x2d')]){_0x216847['query']['id']=_0x216847['query'][_0xe672('0x2d')];delete _0x216847[_0xe672('0x2e')][_0xe672('0x2d')];}_0xf28a86[_0xe672('0x2f')]=_['map'](_0x3b062d,_0xe672('0xf'));_0xf28a86[_0xe672('0x2e')]=_['keys'](_0x216847[_0xe672('0x2e')]);_0xf28a86['filters']=_[_0xe672('0x30')](_0xf28a86[_0xe672('0x2f')],_0xf28a86['query']);_0x108af0[_0xe672('0x31')]=_['intersection'](_0xf28a86[_0xe672('0x2f')],this[_0xe672('0x4')](_0x216847[_0xe672('0x2e')]['fields']));_0x108af0[_0xe672('0x31')]=_0x108af0['attributes'][_0xe672('0x1f')]?_0x108af0['attributes']:_0xf28a86[_0xe672('0x2f')];if(!_0x216847[_0xe672('0x2e')]['hasOwnProperty'](_0xe672('0x32'))){_0x108af0['limit']=this['limit'](_0x216847['query'][_0xe672('0x12')]);_0x108af0['offset']=this['offset'](_0x216847['query']['offset']);}_0x108af0[_0xe672('0x33')]=this[_0xe672('0x14')](_0x216847[_0xe672('0x2e')][_0xe672('0x14')]);_0x108af0[_0xe672('0x34')]=this[_0xe672('0x6')](_[_0xe672('0x35')](_0x216847['query'],_0xf28a86['filters']),_0x3b062d);if(_0x216847[_0xe672('0x2e')][_0xe672('0x36')]){var _0x3e7b82=_0x3b062d;var _0x4c5346=_0x216847['query'][_0xe672('0x36')];if(typeof _0x4c5346==='object'){_0x3e7b82=_[_0xe672('0x36')](_0x3b062d,function(_0x2ad1e5){return _[_0xe672('0x3')](_0x4c5346[_0xe672('0x37')],_0x2ad1e5['name']);});_0x4c5346=_0x4c5346[_0xe672('0x38')];}_0x108af0[_0xe672('0x34')]=_[_0xe672('0x39')](_0x108af0['where'],{'$or':_['map'](_0x3e7b82,function(_0x3c4a36){if(_0x3c4a36['type']!==_0xe672('0x3a')){if(_0x52de2f){return sequelize[_0xe672('0x34')](sequelize['fn']('lower',sequelize['col'](_0x3c4a36[_0xe672('0xf')])),{'$like':sequelize['fn'](_0xe672('0x3b'),'%'+_0x216847[_0xe672('0x2e')][_0xe672('0x36')]+'%')});}else{var _0x431f3e={};_0x431f3e[_0x3c4a36[_0xe672('0xf')]]={'$like':'%'+_0x216847['query'][_0xe672('0x36')]+'%'};return _0x431f3e;}}})});}_0x108af0=_[_0xe672('0x39')]({},_0x108af0,_0x216847[_0xe672('0x3c')]);return _0x108af0;};
\ No newline at end of file
index ea81218..3d7ea33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534c=['DESC','ASC','fullname','substring','indexOf','internal','sort','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','mailPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','chatStatus','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','faxPause','openchannelPause','smsPause','voicePause','every','length','idle','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','then','result','merge','catch','getRealtimeAgents','unknown','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','whatsappPause','pauseType','find','globalStatus','split','fields','order','startsWith'];(function(_0x3f4aa3,_0x17b733){var _0x589c7b=function(_0x27b439){while(--_0x27b439){_0x3f4aa3['push'](_0x3f4aa3['shift']());}};_0x589c7b(++_0x17b733);}(_0x534c,0x1a5));var _0xc534=function(_0x5815bf,_0x2c4a1f){_0x5815bf=_0x5815bf-0x0;var _0x4764e6=_0x534c[_0x5815bf];return _0x4764e6;};'use strict';var _=require(_0xc534('0x0'));var jayson=require(_0xc534('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xc534('0x2')][_0xc534('0x3')]({'port':0x232a});var routingClient=jayson[_0xc534('0x2')][_0xc534('0x3')]({'port':0x232c});function isAgentPaused(_0x202294,_0x1a294e){var _0x3f1a8c=[_0x202294[_0xc534('0x4')],_0x202294[_0xc534('0x5')],_0x202294['mailPause'],_0x202294[_0xc534('0x6')],_0x202294[_0xc534('0x7')],_0x202294[_0xc534('0x8')],_0x202294['whatsappPause']];if(!_0x1a294e)return _[_0xc534('0x9')](_0x3f1a8c);var _0x317d5f=_['filter'](_0x3f1a8c);return _0x317d5f[_0xc534('0xa')]>0x0&&_0x317d5f[_0xc534('0xa')]<_0x3f1a8c[_0xc534('0xa')]?!![]:![];}function isIdle(_0xf49af){return _0xf49af===_0xc534('0xb')||_0xf49af==='unknown'||_0xf49af===_0xc534('0xc')||_0xf49af===_0xc534('0xd')||_[_0xc534('0xe')](_0xf49af);}function isAgentIdle(_0x451e0){if(_0x451e0[_0xc534('0xf')]!==_0xc534('0xb')&&_0x451e0[_0xc534('0x8')]){_0x451e0['voiceStatus']=_0xc534('0x10');return![];}return _[_0xc534('0x9')]([_0x451e0['chatStatus'],_0x451e0[_0xc534('0x11')],_0x451e0[_0xc534('0x12')],_0x451e0[_0xc534('0x13')],_0x451e0['smsStatus'],_0x451e0[_0xc534('0xf')],_0x451e0[_0xc534('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xc534('0x15')](_0xc534('0x16'),{})['then'](function(_0x4f3eea){if(_0x4f3eea['error']){throw new Error(_0xc534('0x17'));}var _0x2ed74f=_0x4f3eea['result'];return routingClient['request']('Agents',{})[_0xc534('0x18')](function(_0x8168dc){if(_0x8168dc['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x64a441=_0x8168dc[_0xc534('0x19')];return _[_0xc534('0x1a')]({},_0x2ed74f,_0x64a441);});})[_0xc534('0x1b')](function(_0x2d4f69){throw _0x2d4f69;});}exports[_0xc534('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x599e7a){var _0x38fb6e=_0xc534('0x1d');if(isAgentPaused(_0x599e7a))_0x38fb6e=_0xc534('0x10');else if(isAgentPaused(_0x599e7a,!![]))_0x38fb6e=_0xc534('0x1e');else if(isAgentIdle(_0x599e7a))_0x38fb6e='idle';else _0x38fb6e=_0xc534('0x1f');return _0x38fb6e;}exports[_0xc534('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0xe6a695,_0x5cc4ac){var _0x2850ad=_[_0xc534('0x21')](_0xe6a695)?_0xe6a695:[_0xe6a695];var _0x3aeb9e=_[_0xc534('0x22')](_0x5cc4ac)+_0xc534('0x23');var _0x30641c=_[_0xc534('0x24')](_0x2850ad,function(_0x3303e9){return db[_0x3aeb9e][_0xc534('0x25')]({'where':{'id':_0x3303e9}})[_0xc534('0x18')](function(_0x571048){if(!_0x571048)return[];return _0x571048[_0xc534('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xc534('0x27')](_0x30641c)[_0xc534('0x18')](function(_0xe1af43){var _0x16985f=_(_0xe1af43)[_0xc534('0x28')]()[_0xc534('0x24')]('id')[_0xc534('0x29')]()[_0xc534('0x2a')]();return _0x16985f;});}exports[_0xc534('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x19583c,_0x3e78ab,_0x5dec74){try{if(_0x3e78ab[_0xc534('0xa')]>0x0){_0x19583c=_0x19583c[_0xc534('0x2c')](function(_0x2c8111){return _0x3e78ab[_0xc534('0x2d')](_0x2c8111['id']);});}var _0x576eea=_0x19583c[_0xc534('0x2c')](function(_0x14a3b9){var _0x84ba4=_0xc534('0x1f');if(isAgentIdle(_0x14a3b9)){_0x84ba4=_0xc534('0xb');}return _0x84ba4===_0x5dec74;});return _[_0xc534('0x24')](_0x576eea,'id');}catch(_0x444d68){throw _0x444d68;}}exports[_0xc534('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x12f55b,_0x215c4b,_0x5b39ba){return Promise[_0xc534('0x2f')]()['then'](function(){if(_0x215c4b[_0xc534('0xa')]>0x0){_0x12f55b=_0x12f55b[_0xc534('0x2c')](function(_0x5b6276){return _0x215c4b[_0xc534('0x2d')](_0x5b6276['id']);});}return _0x12f55b;})[_0xc534('0x18')](function(){return db[_0xc534('0x30')][_0xc534('0x31')]({'attributes':['id',_0xc534('0x32'),'fullname',_0xc534('0x4'),_0xc534('0x5'),'mailPause',_0xc534('0x6'),_0xc534('0x7'),'voicePause',_0xc534('0x33'),_0xc534('0x34')],'where':{'id':{'$in':_[_0xc534('0x24')](_0x12f55b,'id')}},'raw':!![]});})['then'](function(_0x5c7c2f){return _0x5c7c2f[_0xc534('0x24')](function(_0x1a9a64){var _0x4067a8=_[_0xc534('0x35')](_0x12f55b,['id',_0x1a9a64['id']]);var _0x44a33e=filterAgentAttributes(_0x4067a8);_[_0xc534('0x1a')](_0x1a9a64,_0x44a33e);_0x1a9a64[_0xc534('0x36')]=getAgentStatus(_0x1a9a64);return _0x1a9a64;});})['then'](function(_0x2d2249){var _0x2d22cb=sortAgentsByStatus(_0x2d2249,_0x5b39ba);return _[_0xc534('0x24')](_0x2d22cb,'id');})['catch'](function(_0x3e6c65){throw _0x3e6c65;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xb3ec04){var _0x4e8f51={'fields':[],'order':null};var _0x3779b1=_0xb3ec04[_0xc534('0x37')](',');_0x4e8f51[_0xc534('0x38')]=_['filter'](_0x3779b1,function(_0x31aeaf){if(!_0x31aeaf[_0xc534('0x2d')](_0xc534('0x36'))){return!![];}_0x4e8f51[_0xc534('0x39')]=_[_0xc534('0x3a')](_0x31aeaf,'-')?_0xc534('0x3b'):_0xc534('0x3c');return![];});return _0x4e8f51;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x540793){if(_0x540793['includes'](_0xc534('0x3d'))&&!_0x540793[_0xc534('0x2d')]('internal')){var _0xdf5fa9=_0x540793[_0xc534('0x3e')](0x0,_0x540793[_0xc534('0x3f')](_0xc534('0x3d')));_0x540793+=','+_0xdf5fa9+_0xc534('0x40');}return _0x540793;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x1a944e,_0x40989b){var _0x5426d0=_0x1a944e[_0xc534('0x41')](function(_0x72afb6,_0x5e708e){if(_0x72afb6[_0xc534('0x36')]===_0x5e708e['globalStatus']){if(_0x72afb6[_0xc534('0x36')]===_0xc534('0x10')){if(_0x40989b===_0xc534('0x3b')){return(_0x72afb6[_0xc534('0x34')]||'')<(_0x5e708e[_0xc534('0x34')]||'')||_0x72afb6[_0xc534('0x3d')][_0xc534('0x42')]()>_0x5e708e[_0xc534('0x3d')][_0xc534('0x42')]()?0x1:-0x1;}else{return(_0x72afb6[_0xc534('0x34')]||'')<(_0x5e708e['pauseType']||'')||_0x72afb6[_0xc534('0x3d')][_0xc534('0x42')]()>_0x5e708e[_0xc534('0x3d')][_0xc534('0x42')]()?-0x1:0x1;}}else{if(_0x40989b==='DESC'){return _0x72afb6['fullname'][_0xc534('0x42')]()<_0x5e708e[_0xc534('0x3d')][_0xc534('0x42')]()?0x1:-0x1;}else{return _0x72afb6[_0xc534('0x3d')][_0xc534('0x42')]()<_0x5e708e[_0xc534('0x3d')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x40989b===_0xc534('0x3b')){return _0x72afb6[_0xc534('0x36')]<_0x5e708e[_0xc534('0x36')]?0x1:-0x1;}else{return _0x72afb6[_0xc534('0x36')]<_0x5e708e[_0xc534('0x36')]?-0x1:0x1;}}});return _0x5426d0;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x144df2){var _0x4d09b2=[_0xc534('0x43'),_0xc534('0x44'),_0xc534('0x45'),_0xc534('0x46'),_0xc534('0x34'),_0xc534('0x46'),_0xc534('0x40'),'address',_0xc534('0x4'),_0xc534('0x6'),_0xc534('0x47'),_0xc534('0x7'),_0xc534('0x33'),_0xc534('0x5'),_0xc534('0x8'),_0xc534('0x48'),_0xc534('0x49'),_0xc534('0x4a'),_0xc534('0x4b'),_0xc534('0x4c'),'faxCapacity','chatCurrentCapacity',_0xc534('0x4d'),_0xc534('0x4e'),_0xc534('0x4f'),'whatsappCurrentCapacity','faxCurrentCapacity',_0xc534('0x50'),_0xc534('0x13'),'mailStatus',_0xc534('0x51'),_0xc534('0x14'),_0xc534('0x11'),'voiceStatus',_0xc534('0x52'),_0xc534('0x53'),_0xc534('0x54'),_0xc534('0x55'),'whatsappStatusTime',_0xc534('0x56'),_0xc534('0x57'),'queue',_0xc534('0x58'),_0xc534('0x59'),_0xc534('0x5a'),_0xc534('0x5b'),_0xc534('0x5c')];var _0x162fc9=[_0xc534('0x4'),_0xc534('0x6'),_0xc534('0x47'),_0xc534('0x7'),_0xc534('0x33'),'faxPause',_0xc534('0x8'),'online'];var _0x2f62c7=_(_0x144df2)[_0xc534('0x5d')](_0x162fc9)[_0xc534('0x5e')](_0x4d09b2)['value']();return _0x2f62c7;}exports[_0xc534('0x5f')]=filterAgentAttributes;
\ No newline at end of file
+var _0x53da=['internal','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','*pause','busy','isArray','startCase','map','findOne','getAgents','all','flatten','uniq','value','includes','idle','getAgentIdsByStatus','resolve','User','findAll','fullname','faxPause','pauseType','globalStatus','split','fields','order','startsWith','ASC','getUpdatedSortOptions','substring','indexOf'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x53da,0x142));var _0xa53d=function(_0x4b2e62,_0x4064b6){_0x4b2e62=_0x4b2e62-0x0;var _0x8aebe6=_0x53da[_0x4b2e62];return _0x8aebe6;};'use strict';var _=require('lodash');var jayson=require(_0xa53d('0x0'));var db=require(_0xa53d('0x1'))['db'];var amiClient=jayson[_0xa53d('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xa53d('0x2')][_0xa53d('0x3')]({'port':0x232c});function isAgentPaused(_0x32df16,_0x35bbe5){var _0x17a900=[_0x32df16['chatPause'],_0x32df16['faxPause'],_0x32df16[_0xa53d('0x4')],_0x32df16[_0xa53d('0x5')],_0x32df16[_0xa53d('0x6')],_0x32df16[_0xa53d('0x7')],_0x32df16[_0xa53d('0x8')]];if(!_0x35bbe5)return _[_0xa53d('0x9')](_0x17a900);var _0x6123d9=_[_0xa53d('0xa')](_0x17a900);return _0x6123d9[_0xa53d('0xb')]>0x0&&_0x6123d9[_0xa53d('0xb')]<_0x17a900[_0xa53d('0xb')]?!![]:![];}function isIdle(_0x50b629){return _0x50b629==='idle'||_0x50b629===_0xa53d('0xc')||_0x50b629===_0xa53d('0xd')||_0x50b629===_0xa53d('0xe')||_[_0xa53d('0xf')](_0x50b629);}function isAgentIdle(_0x3af859){if(_0x3af859[_0xa53d('0x10')]!=='idle'&&_0x3af859['voicePause']){_0x3af859[_0xa53d('0x10')]=_0xa53d('0x11');return![];}return _[_0xa53d('0x9')]([_0x3af859[_0xa53d('0x12')],_0x3af859[_0xa53d('0x13')],_0x3af859[_0xa53d('0x14')],_0x3af859[_0xa53d('0x15')],_0x3af859['smsStatus'],_0x3af859[_0xa53d('0x10')],_0x3af859[_0xa53d('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa53d('0x17')](_0xa53d('0x18'),{})[_0xa53d('0x19')](function(_0x2477b0){if(_0x2477b0['error']){throw new Error(_0xa53d('0x1a'));}var _0x247357=_0x2477b0['result'];return routingClient['request'](_0xa53d('0x18'),{})[_0xa53d('0x19')](function(_0x555841){if(_0x555841[_0xa53d('0x1b')]){throw new Error(_0xa53d('0x1c'));}var _0x1dae93=_0x555841[_0xa53d('0x1d')];return _[_0xa53d('0x1e')]({},_0x247357,_0x1dae93);});})[_0xa53d('0x1f')](function(_0x947035){throw _0x947035;});}exports[_0xa53d('0x20')]=getRealtimeAgents;function getAgentStatus(_0x478e83){var _0x5f3ef8=_0xa53d('0xc');if(isAgentPaused(_0x478e83))_0x5f3ef8=_0xa53d('0x11');else if(isAgentPaused(_0x478e83,!![]))_0x5f3ef8=_0xa53d('0x21');else if(isAgentIdle(_0x478e83))_0x5f3ef8='idle';else _0x5f3ef8=_0xa53d('0x22');return _0x5f3ef8;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x1fc9f0,_0x5f3220){var _0x4bbfa1=_[_0xa53d('0x23')](_0x1fc9f0)?_0x1fc9f0:[_0x1fc9f0];var _0x267d28=_[_0xa53d('0x24')](_0x5f3220)+'Queue';var _0x36f07e=_[_0xa53d('0x25')](_0x4bbfa1,function(_0x3e35ff){return db[_0x267d28][_0xa53d('0x26')]({'where':{'id':_0x3e35ff}})['then'](function(_0x5de3d5){if(!_0x5de3d5)return[];return _0x5de3d5[_0xa53d('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa53d('0x28')](_0x36f07e)[_0xa53d('0x19')](function(_0x4c8a0f){var _0x42e04f=_(_0x4c8a0f)[_0xa53d('0x29')]()[_0xa53d('0x25')]('id')[_0xa53d('0x2a')]()[_0xa53d('0x2b')]();return _0x42e04f;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xd81ae9,_0x3fa2e8,_0x167222){try{if(_0x3fa2e8['length']>0x0){_0xd81ae9=_0xd81ae9[_0xa53d('0xa')](function(_0x2ddfad){return _0x3fa2e8[_0xa53d('0x2c')](_0x2ddfad['id']);});}var _0x1b2af2=_0xd81ae9[_0xa53d('0xa')](function(_0x4ef951){var _0x2fdbad=_0xa53d('0x22');if(isAgentIdle(_0x4ef951)){_0x2fdbad=_0xa53d('0x2d');}return _0x2fdbad===_0x167222;});return _['map'](_0x1b2af2,'id');}catch(_0x2e2609){throw _0x2e2609;}}exports[_0xa53d('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x392940,_0x3d17f4,_0x1ab5ad){return Promise[_0xa53d('0x2f')]()[_0xa53d('0x19')](function(){if(_0x3d17f4[_0xa53d('0xb')]>0x0){_0x392940=_0x392940[_0xa53d('0xa')](function(_0x339e4f){return _0x3d17f4[_0xa53d('0x2c')](_0x339e4f['id']);});}return _0x392940;})['then'](function(){return db[_0xa53d('0x30')][_0xa53d('0x31')]({'attributes':['id','name',_0xa53d('0x32'),'chatPause',_0xa53d('0x33'),_0xa53d('0x4'),_0xa53d('0x5'),_0xa53d('0x6'),_0xa53d('0x7'),_0xa53d('0x8'),_0xa53d('0x34')],'where':{'id':{'$in':_['map'](_0x392940,'id')}},'raw':!![]});})['then'](function(_0x27e26c){return _0x27e26c[_0xa53d('0x25')](function(_0x44fed4){var _0x1b7d2a=_['find'](_0x392940,['id',_0x44fed4['id']]);var _0xd819f4=filterAgentAttributes(_0x1b7d2a);_[_0xa53d('0x1e')](_0x44fed4,_0xd819f4);_0x44fed4[_0xa53d('0x35')]=getAgentStatus(_0x44fed4);return _0x44fed4;});})[_0xa53d('0x19')](function(_0x297af5){var _0x29c432=sortAgentsByStatus(_0x297af5,_0x1ab5ad);return _['map'](_0x29c432,'id');})[_0xa53d('0x1f')](function(_0x3aafb4){throw _0x3aafb4;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2e19c6){var _0x5f4680={'fields':[],'order':null};var _0x4d0045=_0x2e19c6[_0xa53d('0x36')](',');_0x5f4680[_0xa53d('0x37')]=_[_0xa53d('0xa')](_0x4d0045,function(_0x5d30af){if(!_0x5d30af['includes'](_0xa53d('0x35'))){return!![];}_0x5f4680[_0xa53d('0x38')]=_[_0xa53d('0x39')](_0x5d30af,'-')?'DESC':_0xa53d('0x3a');return![];});return _0x5f4680;}exports[_0xa53d('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x5d60b0){if(_0x5d60b0[_0xa53d('0x2c')]('fullname')&&!_0x5d60b0[_0xa53d('0x2c')]('internal')){var _0x2273d9=_0x5d60b0[_0xa53d('0x3c')](0x0,_0x5d60b0[_0xa53d('0x3d')](_0xa53d('0x32')));_0x5d60b0+=','+_0x2273d9+_0xa53d('0x3e');}return _0x5d60b0;}exports[_0xa53d('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x477781,_0x3e25c7){var _0x4c4150=_0x477781[_0xa53d('0x40')](function(_0x2b7516,_0x1d8aea){if(_0x2b7516[_0xa53d('0x35')]===_0x1d8aea[_0xa53d('0x35')]){if(_0x2b7516[_0xa53d('0x35')]==='pause'){if(_0x3e25c7===_0xa53d('0x41')){return(_0x2b7516[_0xa53d('0x34')]||'')<(_0x1d8aea['pauseType']||'')||_0x2b7516[_0xa53d('0x32')][_0xa53d('0x42')]()>_0x1d8aea['fullname'][_0xa53d('0x42')]()?0x1:-0x1;}else{return(_0x2b7516[_0xa53d('0x34')]||'')<(_0x1d8aea['pauseType']||'')||_0x2b7516[_0xa53d('0x32')]['toLowerCase']()>_0x1d8aea[_0xa53d('0x32')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3e25c7===_0xa53d('0x41')){return _0x2b7516['fullname'][_0xa53d('0x42')]()<_0x1d8aea[_0xa53d('0x32')][_0xa53d('0x42')]()?0x1:-0x1;}else{return _0x2b7516['fullname']['toLowerCase']()<_0x1d8aea[_0xa53d('0x32')][_0xa53d('0x42')]()?-0x1:0x1;}}}else{if(_0x3e25c7===_0xa53d('0x41')){return _0x2b7516[_0xa53d('0x35')]<_0x1d8aea['globalStatus']?0x1:-0x1;}else{return _0x2b7516['globalStatus']<_0x1d8aea[_0xa53d('0x35')]?-0x1:0x1;}}});return _0x4c4150;}exports[_0xa53d('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x3fa8d4){var _0x452dcd=[_0xa53d('0x44'),_0xa53d('0x45'),_0xa53d('0x46'),_0xa53d('0x47'),_0xa53d('0x34'),_0xa53d('0x47'),'internal',_0xa53d('0x48'),_0xa53d('0x49'),_0xa53d('0x5'),_0xa53d('0x4'),_0xa53d('0x6'),_0xa53d('0x8'),_0xa53d('0x33'),_0xa53d('0x7'),_0xa53d('0x4a'),_0xa53d('0x4b'),_0xa53d('0x4c'),'smsCapacity',_0xa53d('0x4d'),_0xa53d('0x4e'),_0xa53d('0x4f'),'openchannelCurrentCapacity',_0xa53d('0x50'),'smsCurrentCapacity','whatsappCurrentCapacity',_0xa53d('0x51'),_0xa53d('0x12'),_0xa53d('0x15'),_0xa53d('0x14'),_0xa53d('0x52'),_0xa53d('0x16'),_0xa53d('0x13'),_0xa53d('0x10'),_0xa53d('0x53'),_0xa53d('0x54'),_0xa53d('0x55'),_0xa53d('0x56'),'whatsappStatusTime',_0xa53d('0x57'),'voiceStatusTime',_0xa53d('0x58'),_0xa53d('0x59'),_0xa53d('0x5a'),_0xa53d('0x5b'),_0xa53d('0x5c'),_0xa53d('0x5d')];var _0x59bbe8=[_0xa53d('0x49'),_0xa53d('0x5'),'mailPause',_0xa53d('0x6'),_0xa53d('0x8'),_0xa53d('0x33'),'voicePause',_0xa53d('0x45')];var _0x3b9343=_(_0x3fa8d4)[_0xa53d('0x5e')](_0x59bbe8)['pick'](_0x452dcd)[_0xa53d('0x2b')]();return _0x3b9343;}exports[_0xa53d('0x5f')]=filterAgentAttributes;
\ No newline at end of file
index ce273cb..5a51710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf282=['erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','paused','available','talking','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','unknown','pTalking','originated','message','statusMessage','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond'];(function(_0x274db4,_0x174864){var _0x3afe58=function(_0x23c8d5){while(--_0x23c8d5){_0x274db4['push'](_0x274db4['shift']());}};_0x3afe58(++_0x174864);}(_0xf282,0x154));var _0x2f28=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xf282[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x2f28('0x0'));var jayson=require(_0x2f28('0x1'));var util=require(_0x2f28('0x2'));var amiClient=jayson[_0x2f28('0x3')][_0x2f28('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x2f28('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x2f28('0x5'),'paused',_0x2f28('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x2f28('0x7'),_0x2f28('0x8'),_0x2f28('0x9'),_0x2f28('0xa'),_0x2f28('0xb'),_0x2f28('0xc'),_0x2f28('0xd'),'ringInUse','talking','unavailable',_0x2f28('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x2f28('0xf'),_0x2f28('0x10'),_0x2f28('0x11'),_0x2f28('0x12'),'dialActive',_0x2f28('0x13'),_0x2f28('0x14'),'startPredictive',_0x2f28('0x15'),_0x2f28('0x16'),_0x2f28('0x17'),_0x2f28('0x18'),_0x2f28('0x19'),_0x2f28('0x1a'),_0x2f28('0x1b'),_0x2f28('0x1c'),_0x2f28('0x1d'),'predictiveIntervalTotalCalls',_0x2f28('0x1e'),_0x2f28('0x1f'),_0x2f28('0x20'),_0x2f28('0x21'),_0x2f28('0x22')];function getRealtimeQueues(_0x15ce37,_0x3ed550){var _0x5c12b8=_0x3ed550===_0x2f28('0x23')?amiClient:routingClient;return _0x5c12b8[_0x2f28('0x24')](_[_0x2f28('0x25')](_0x3ed550)+_0x2f28('0x26'),_0x15ce37)['then'](function(_0x372ac6){if(_0x372ac6[_0x2f28('0x27')])throw new Error(util['format'](_0x2f28('0x28'),_0x3ed550));return _0x372ac6[_0x2f28('0x29')];})['catch'](function(_0x527e62){throw _0x527e62;});}exports[_0x2f28('0x2a')]=getRealtimeQueues;function initializeQueues(_0x44b7c0,_0x477cc8,_0x3f0fc2,_0x16ef03){var _0x2fd332=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3f0fc2===_0x2f28('0x23')){if(_0x16ef03===_0x2f28('0x2b')){_0x2fd332=_0x2fd332[_0x2f28('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x16ef03===_0x2f28('0x2d')){_0x2fd332=_0x2fd332[_0x2f28('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x44b7c0['map'](function(_0x3f7bae){var _0x389df7=_0x3f7bae['get']({'plain':!![]});_0x389df7[_0x2f28('0x2e')]=0x0;_0x389df7[_0x2f28('0xa')]=0x0;_0x389df7[_0x2f28('0x5')]=0x0;_0x389df7[_0x2f28('0x2f')]=0x0;_0x389df7[_0x2f28('0x6')]=0x0;if(_0x3f0fc2===_0x2f28('0x23')){_0x389df7[_0x2f28('0x30')]=0x0;_0x389df7[_0x2f28('0x7')]=0x0;if(_0x16ef03==='outbound'){_0x389df7[_0x2f28('0xf')]=0x0;_0x389df7[_0x2f28('0x10')]=0x0;}}var _0x55f3c2=_[_0x2f28('0x31')](_0x477cc8,['id',_0x389df7['id']]);if(_0x55f3c2){_[_0x2f28('0x32')](_0x389df7,_['pick'](_0x55f3c2,_0x2fd332));}return _0x389df7;});}exports[_0x2f28('0x33')]=initializeQueues;
\ No newline at end of file
+var _0x21f6=['waiting','busy','inUse','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','get','merge','pick','jayson/promise','client','http','available','loggedIn'];(function(_0x3587c2,_0x2174b4){var _0x2c2c39=function(_0x35f6b0){while(--_0x35f6b0){_0x3587c2['push'](_0x3587c2['shift']());}};_0x2c2c39(++_0x2174b4);}(_0x21f6,0x14b));var _0x621f=function(_0x5b97e9,_0x9cb565){_0x5b97e9=_0x5b97e9-0x0;var _0x1c0a9f=_0x21f6[_0x5b97e9];return _0x1c0a9f;};'use strict';var _=require('lodash');var jayson=require(_0x621f('0x0'));var util=require('util');var amiClient=jayson[_0x621f('0x1')][_0x621f('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0x621f('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x621f('0x3'),_0x621f('0x4'),'paused',_0x621f('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x621f('0x6'),_0x621f('0x7'),'invalid','loggedInDb',_0x621f('0x8'),'onHold',_0x621f('0x9'),_0x621f('0xa'),_0x621f('0xb'),_0x621f('0xc'),_0x621f('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x621f('0xe'),_0x621f('0xf'),_0x621f('0x10'),'statusMessage',_0x621f('0x11'),_0x621f('0x12'),_0x621f('0x13'),'startPredictive',_0x621f('0x14'),_0x621f('0x15'),'erlangCallToSecond',_0x621f('0x16'),_0x621f('0x17'),_0x621f('0x18'),_0x621f('0x19'),'dialPredictiveIntervalMinThreshold',_0x621f('0x1a'),_0x621f('0x1b'),_0x621f('0x1c'),_0x621f('0x1d'),_0x621f('0x1e'),_0x621f('0x1f'),_0x621f('0x20')];function getRealtimeQueues(_0x576cbf,_0x927ebf){var _0x406a0c=_0x927ebf===_0x621f('0x21')?amiClient:routingClient;return _0x406a0c[_0x621f('0x22')](_['startCase'](_0x927ebf)+_0x621f('0x23'),_0x576cbf)[_0x621f('0x24')](function(_0x3f4e1b){if(_0x3f4e1b[_0x621f('0x25')])throw new Error(util['format'](_0x621f('0x26'),_0x927ebf));return _0x3f4e1b[_0x621f('0x27')];})['catch'](function(_0x48df81){throw _0x48df81;});}exports[_0x621f('0x28')]=getRealtimeQueues;function initializeQueues(_0x5aa578,_0x54f8a9,_0x1cafa6,_0x4eb462){var _0x26f57a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1cafa6===_0x621f('0x21')){if(_0x4eb462===_0x621f('0x29')){_0x26f57a=_0x26f57a[_0x621f('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4eb462===_0x621f('0x2b')){_0x26f57a=_0x26f57a[_0x621f('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5aa578[_0x621f('0x2c')](function(_0x2290a8){var _0x1b83aa=_0x2290a8[_0x621f('0x2d')]({'plain':!![]});_0x1b83aa['paused']=0x0;_0x1b83aa['loggedInDb']=0x0;_0x1b83aa['loggedIn']=0x0;_0x1b83aa[_0x621f('0x3')]=0x0;_0x1b83aa[_0x621f('0x5')]=0x0;if(_0x1cafa6===_0x621f('0x21')){_0x1b83aa[_0x621f('0xb')]=0x0;_0x1b83aa[_0x621f('0x6')]=0x0;if(_0x4eb462===_0x621f('0x2b')){_0x1b83aa[_0x621f('0xe')]=0x0;_0x1b83aa[_0x621f('0xf')]=0x0;}}var _0x55a3f5=_['find'](_0x54f8a9,['id',_0x1b83aa['id']]);if(_0x55a3f5){_[_0x621f('0x2e')](_0x1b83aa,_[_0x621f('0x2f')](_0x55a3f5,_0x26f57a));}return _0x1b83aa;});}exports['initializeQueues']=initializeQueues;
\ No newline at end of file
index cba16cf..6af7539 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4f02ac,_0x5b385e){var _0x463598=function(_0x1bf373){while(--_0x1bf373){_0x4f02ac['push'](_0x4f02ac['shift']());}};_0x463598(++_0x5b385e);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ No newline at end of file
+var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5e0cf5,_0x14dd1c){var _0x1f052a=function(_0x6d23f9){while(--_0x6d23f9){_0x5e0cf5['push'](_0x5e0cf5['shift']());}};_0x1f052a(++_0x14dd1c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ No newline at end of file
index b97f8b6..d9db348 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69f2=['length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','hex','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x69f2,0x191));var _0x269f=function(_0x3ee648,_0x1f2100){_0x3ee648=_0x3ee648-0x0;var _0x433f3d=_0x69f2[_0x3ee648];return _0x433f3d;};'use strict';var _=require(_0x269f('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x269f('0x1'));var exec=require(_0x269f('0x2'))[_0x269f('0x3')];var config=require('../environment');function getInterfaces(){var _0x278d36=[];var _0x21b2b4=os[_0x269f('0x4')]();var _0x2eac3b=_[_0x269f('0x5')](_[_0x269f('0x6')](_0x21b2b4));for(var _0x598fa8=0x0;_0x598fa8<_0x2eac3b[_0x269f('0x7')];_0x598fa8++){var _0x3038d1=_0x21b2b4[_0x2eac3b[_0x598fa8]][_0x269f('0x8')](function(_0x54d829){return _0x54d829[_0x269f('0x9')]===_0x269f('0xa')&&_0x54d829[_0x269f('0xb')]===![];});_0x278d36=_0x278d36[_0x269f('0xc')](_0x3038d1);}return _0x278d36;}function getFirstInterface(){var _0x2107d8=_[_0x269f('0xd')](getInterfaces());return{'macAddress':_0x2107d8&&_0x2107d8[_0x269f('0xe')]?_0x2107d8[_0x269f('0xe')]:'00:00:00:00:00:00','ipAddress':_0x2107d8&&_0x2107d8[_0x269f('0xf')]?_0x2107d8['address']:_0x269f('0x10')};}exports[_0x269f('0x11')]=getFirstInterface;function getCPUhash(){var _0x521632=_[_0x269f('0x5')](os[_0x269f('0x12')]()['map'](function(_0x47915c){return _0x47915c[_0x269f('0x13')];}))[_0x269f('0x14')](':');return crypto[_0x269f('0x15')](_0x269f('0x16'))[_0x269f('0x17')](_0x521632)['digest'](_0x269f('0x18'));}exports['getUuid']=function(){var _0x137d9a=os[_0x269f('0x19')]();var _0x30e3c7=/[0-9a-f-]{36}/;if(config[_0x269f('0x1a')]&&_0x30e3c7[_0x269f('0x1b')](config[_0x269f('0x1a')])){return config[_0x269f('0x1a')];}else if(_0x137d9a==='win32'){return exec(_0x269f('0x1c'),{'encoding':_0x269f('0x1d')})[_0x269f('0x1e')]('\x0d\x0a','');}else{var _0x5ace9a=getFirstInterface();var _0xd7f3ed=getCPUhash();var _0x38e088=_0xd7f3ed+'|'+os[_0x269f('0x1f')]()+'|'+_0x5ace9a[_0x269f('0x20')]+'|'+_0x5ace9a['ipAddress'];var _0x10a2d9=crypto[_0x269f('0x15')]('md5')[_0x269f('0x17')](_0x38e088)['digest'](_0x269f('0x18'));return _0x10a2d9[_0x269f('0x21')](0x0,0x8)+'-'+_0x10a2d9[_0x269f('0x21')](0x8,0xc)+'-'+_0x10a2d9['substring'](0xc,0x10)+'-'+_0x10a2d9[_0x269f('0x21')](0x10,0x14)+'-'+_0x10a2d9[_0x269f('0x21')](0x14);}};
\ No newline at end of file
+var _0x1026=['md5','digest','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','createHash','substring','lodash','child_process','execSync','../environment','orderBy','keys','length','filter','family','internal','concat','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','cpus','model'];(function(_0x1c6451,_0x4f55b4){var _0x446608=function(_0x3211d8){while(--_0x3211d8){_0x1c6451['push'](_0x1c6451['shift']());}};_0x446608(++_0x4f55b4);}(_0x1026,0x182));var _0x6102=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x1026[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0x6102('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x6102('0x1'))[_0x6102('0x2')];var config=require(_0x6102('0x3'));function getInterfaces(){var _0x2c6829=[];var _0x11e2b9=os['networkInterfaces']();var _0x54ba45=_[_0x6102('0x4')](_[_0x6102('0x5')](_0x11e2b9));for(var _0x3871ba=0x0;_0x3871ba<_0x54ba45[_0x6102('0x6')];_0x3871ba++){var _0x32e961=_0x11e2b9[_0x54ba45[_0x3871ba]][_0x6102('0x7')](function(_0x57a3eb){return _0x57a3eb[_0x6102('0x8')]==='IPv4'&&_0x57a3eb[_0x6102('0x9')]===![];});_0x2c6829=_0x2c6829[_0x6102('0xa')](_0x32e961);}return _0x2c6829;}function getFirstInterface(){var _0x44cab1=_['head'](getInterfaces());return{'macAddress':_0x44cab1&&_0x44cab1[_0x6102('0xb')]?_0x44cab1[_0x6102('0xb')]:_0x6102('0xc'),'ipAddress':_0x44cab1&&_0x44cab1['address']?_0x44cab1['address']:_0x6102('0xd')};}exports[_0x6102('0xe')]=getFirstInterface;function getCPUhash(){var _0x5373d8=_[_0x6102('0x4')](os[_0x6102('0xf')]()['map'](function(_0x3ca145){return _0x3ca145[_0x6102('0x10')];}))['join'](':');return crypto['createHash'](_0x6102('0x11'))['update'](_0x5373d8)[_0x6102('0x12')](_0x6102('0x13'));}exports[_0x6102('0x14')]=function(){var _0x7d06e=os[_0x6102('0x15')]();var _0x55e5c9=/[0-9a-f-]{36}/;if(config[_0x6102('0x16')]&&_0x55e5c9[_0x6102('0x17')](config[_0x6102('0x16')])){return config[_0x6102('0x16')];}else if(_0x7d06e==='win32'){return exec(_0x6102('0x18'),{'encoding':_0x6102('0x19')})[_0x6102('0x1a')]('\x0d\x0a','');}else{var _0x39a882=getFirstInterface();var _0x9fd164=getCPUhash();var _0x11bdec=_0x9fd164+'|'+os[_0x6102('0x1b')]()+'|'+_0x39a882[_0x6102('0x1c')]+'|'+_0x39a882['ipAddress'];var _0xce08e5=crypto[_0x6102('0x1d')](_0x6102('0x11'))['update'](_0x11bdec)[_0x6102('0x12')](_0x6102('0x13'));return _0xce08e5[_0x6102('0x1e')](0x0,0x8)+'-'+_0xce08e5['substring'](0x8,0xc)+'-'+_0xce08e5['substring'](0xc,0x10)+'-'+_0xce08e5[_0x6102('0x1e')](0x10,0x14)+'-'+_0xce08e5['substring'](0x14);}};
\ No newline at end of file
index b60952f..2f65dfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13fa=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','version','../../mysqldb','../../components/encryptor','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data2','data1','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed'];(function(_0x2efbfd,_0x4a089f){var _0x4f84ec=function(_0x38a6aa){while(--_0x38a6aa){_0x2efbfd['push'](_0x2efbfd['shift']());}};_0x4f84ec(++_0x4a089f);}(_0x13fa,0x1bd));var _0xa13f=function(_0x23f642,_0x3c8f66){_0x23f642=_0x23f642-0x0;var _0x4ba0d0=_0x13fa[_0x23f642];return _0x4ba0d0;};'use strict';var util=require('util');var moment=require(_0xa13f('0x0'));var rp=require(_0xa13f('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xa13f('0x2'));var db=require(_0xa13f('0x3'))['db'];var encryptor=require(_0xa13f('0x4'));var hardware=require('./hardware');var logger=require(_0xa13f('0x5'))(_0xa13f('0x6'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x54acbf){return new BPromise(function(_0x2e0a90,_0x16e119){var _0x36cd4b=util[_0xa13f('0x7')](_0xa13f('0x8'),HOST,_0x54acbf,module[_0xa13f('0x9')][_0xa13f('0x2')]);if(oldToken){_0x36cd4b=util[_0xa13f('0x7')](_0xa13f('0xa'),HOST,_0x54acbf,module[_0xa13f('0x9')][_0xa13f('0x2')],oldToken);}var _0x5a5fff={'uri':_0x36cd4b,'method':_0xa13f('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x5a5fff)['then'](function(_0x30b4f7){_0x2e0a90(_0x30b4f7);})['catch'](function(_0x38e541){_0x16e119(_0x38e541);});});}function manageLicense(_0x5f1b42,_0x10fe96){var _0x5a4c33=_0x10fe96[_0xa13f('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x5a4c33['data1']!==_0x5f1b42&&!_0x5a4c33[_0xa13f('0xd')]){oldToken=_0x5a4c33[_0xa13f('0xe')];}httpRequest(_0x5f1b42)[_0xa13f('0xf')](function(_0x3ed53e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3ed53e[_0xa13f('0x10')]){isOldTokenSent=![];if(!_0x5a4c33[_0xa13f('0x6')]&&_0x5a4c33['license']!=_0x3ed53e[_0xa13f('0x6')]||_0x5a4c33[_0xa13f('0x6')]&&_0x5a4c33['data2']){logger[_0xa13f('0x11')](_0xa13f('0x12'));}if(_0x5a4c33[_0xa13f('0x6')]&&!_0x5a4c33[_0xa13f('0xd')]&&_0x5a4c33['license']!=_0x3ed53e['license']){logger[_0xa13f('0x11')](_0xa13f('0x13'));}if(_0x5a4c33[_0xa13f('0x6')]&&!_0x5a4c33[_0xa13f('0xd')]&&_0x5a4c33[_0xa13f('0x6')]==_0x3ed53e[_0xa13f('0x6')]){return _0x10fe96;}return _0x10fe96['update']({'data1':_0x5f1b42,'data2':null,'license':_0x3ed53e[_0xa13f('0x6')]});}else{if(_0x3ed53e[_0xa13f('0x6')]||_0x5a4c33[_0xa13f('0x6')]){if(!_0x5a4c33[_0xa13f('0xd')]){if(_0x5a4c33[_0xa13f('0xe')]==_0x5f1b42){GRAY_PERIOD_REASON=_0xa13f('0x14');logger[_0xa13f('0x11')](_0xa13f('0x15'));}else{GRAY_PERIOD_REASON=_0xa13f('0x16');logger[_0xa13f('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5a4c33[_0xa13f('0xe')],_0x5f1b42);}logger[_0xa13f('0x11')](_0xa13f('0x17'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xa13f('0x7')](_0xa13f('0x18')));return _0x10fe96['update']({'data2':encryptor['encryptString'](moment()[_0xa13f('0x7')](_0xa13f('0x18')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x5a4c33[_0xa13f('0xd')]),_0xa13f('0x19'))>DAYS){logger['info'](_0xa13f('0x1a'),moment()[_0xa13f('0x7')](_0xa13f('0x18')));isOldTokenSent=![];return _0x10fe96['update']({'data1':_0x5f1b42,'data2':null,'license':null});}}}else{if(_0x5a4c33[_0xa13f('0xe')]!=_0x5f1b42){logger[_0xa13f('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5a4c33[_0xa13f('0xe')],_0x5f1b42);return _0x10fe96['update']({'data1':_0x5f1b42,'data2':null,'license':null});}}}return _0x10fe96;})[_0xa13f('0xf')](function(_0x22924a){_0x10fe96=_0x22924a;})[_0xa13f('0x1b')](function(_0x21e2b9){logger[_0xa13f('0x1c')](_0x21e2b9[_0xa13f('0x1d')]);})[_0xa13f('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0xa13f('0x1f')](),_0x10fe96);},TIME);});}function defaultLicense(){var _0xc6b00a=hardware[_0xa13f('0x1f')]();if(_0xc6b00a){return db['License'][_0xa13f('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0xc6b00a}})[_0xa13f('0x21')](function(_0x4923a6,_0x5b3c05){logger[_0xa13f('0x11')](_0xa13f('0x22'),_0xc6b00a);manageLicense(_0xc6b00a,_0x4923a6);})[_0xa13f('0x1b')](function(_0xc35e55){logger['error'](_0xc35e55[_0xa13f('0x1d')]);});}}exports[_0xa13f('0x23')]=defaultLicense;
\ No newline at end of file
+var _0x9910=['data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','../logger','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get'];(function(_0x2364c1,_0x20fc94){var _0x239fb3=function(_0x1d94da){while(--_0x1d94da){_0x2364c1['push'](_0x2364c1['shift']());}};_0x239fb3(++_0x20fc94);}(_0x9910,0x116));var _0x0991=function(_0x333958,_0x51ee7e){_0x333958=_0x333958-0x0;var _0x4312a3=_0x9910[_0x333958];return _0x4312a3;};'use strict';var util=require(_0x0991('0x0'));var moment=require(_0x0991('0x1'));var rp=require(_0x0991('0x2'));var BPromise=require(_0x0991('0x3'));var pkginfo=require('pkginfo')(module,_0x0991('0x4'));var db=require(_0x0991('0x5'))['db'];var encryptor=require(_0x0991('0x6'));var hardware=require('./hardware');var logger=require(_0x0991('0x7'))('license');var HOST=_0x0991('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x385b73){return new BPromise(function(_0x577f21,_0x184605){var _0x167128=util['format'](_0x0991('0x9'),HOST,_0x385b73,module[_0x0991('0xa')][_0x0991('0x4')]);if(oldToken){_0x167128=util[_0x0991('0xb')](_0x0991('0xc'),HOST,_0x385b73,module['exports']['version'],oldToken);}var _0x4c9f99={'uri':_0x167128,'method':_0x0991('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4c9f99)[_0x0991('0xe')](function(_0x1958b1){_0x577f21(_0x1958b1);})['catch'](function(_0x1f9bf6){_0x184605(_0x1f9bf6);});});}function manageLicense(_0x85946f,_0x21c364){var _0x408a8b=_0x21c364[_0x0991('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x408a8b[_0x0991('0x10')]!==_0x85946f&&!_0x408a8b[_0x0991('0x11')]){oldToken=_0x408a8b[_0x0991('0x10')];}httpRequest(_0x85946f)['then'](function(_0x313d69){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x313d69[_0x0991('0x12')]){isOldTokenSent=![];if(!_0x408a8b[_0x0991('0x13')]&&_0x408a8b[_0x0991('0x13')]!=_0x313d69['license']||_0x408a8b[_0x0991('0x13')]&&_0x408a8b[_0x0991('0x11')]){logger[_0x0991('0x14')](_0x0991('0x15'));}if(_0x408a8b[_0x0991('0x13')]&&!_0x408a8b[_0x0991('0x11')]&&_0x408a8b[_0x0991('0x13')]!=_0x313d69[_0x0991('0x13')]){logger[_0x0991('0x14')](_0x0991('0x16'));}if(_0x408a8b['license']&&!_0x408a8b[_0x0991('0x11')]&&_0x408a8b['license']==_0x313d69['license']){return _0x21c364;}return _0x21c364[_0x0991('0x17')]({'data1':_0x85946f,'data2':null,'license':_0x313d69[_0x0991('0x13')]});}else{if(_0x313d69[_0x0991('0x13')]||_0x408a8b['license']){if(!_0x408a8b['data2']){if(_0x408a8b['data1']==_0x85946f){GRAY_PERIOD_REASON=_0x0991('0x18');logger[_0x0991('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x0991('0x19');logger['info'](_0x0991('0x1a'),_0x408a8b[_0x0991('0x10')],_0x85946f);}logger['info'](_0x0991('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x0991('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x21c364[_0x0991('0x17')]({'data2':encryptor[_0x0991('0x1c')](moment()[_0x0991('0xb')](_0x0991('0x1d')))});}else{if(moment()[_0x0991('0x1e')](encryptor[_0x0991('0x1f')](_0x408a8b['data2']),_0x0991('0x20'))>DAYS){logger[_0x0991('0x14')](_0x0991('0x21'),moment()[_0x0991('0xb')](_0x0991('0x1d')));isOldTokenSent=![];return _0x21c364[_0x0991('0x17')]({'data1':_0x85946f,'data2':null,'license':null});}}}else{if(_0x408a8b['data1']!=_0x85946f){logger[_0x0991('0x14')](_0x0991('0x1a'),_0x408a8b[_0x0991('0x10')],_0x85946f);return _0x21c364['update']({'data1':_0x85946f,'data2':null,'license':null});}}}return _0x21c364;})[_0x0991('0xe')](function(_0x186ada){_0x21c364=_0x186ada;})[_0x0991('0x22')](function(_0x4007b6){logger[_0x0991('0x23')](_0x4007b6[_0x0991('0x24')]);})[_0x0991('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x21c364);},TIME);});}function defaultLicense(){var _0xab973a=hardware[_0x0991('0x26')]();if(_0xab973a){return db[_0x0991('0x27')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xab973a}})['spread'](function(_0x31dd79,_0x4664ea){logger[_0x0991('0x14')](_0x0991('0x28'),_0xab973a);manageLicense(_0xab973a,_0x31dd79);})['catch'](function(_0x379a7c){logger['error'](_0x379a7c['message']);});}}exports[_0x0991('0x29')]=defaultLicense;
\ No newline at end of file
index 537636e..17dc436 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe68f=['lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','gray','deadline','add','days','format','grayReason','machineUuid','disabled','message','role','COUNT','sequelize','count','admin','user','users','forEach','telephone','exports','util'];(function(_0x578de7,_0x33a5b4){var _0xaa9f4=function(_0x2290f8){while(--_0x2290f8){_0x578de7['push'](_0x578de7['shift']());}};_0xaa9f4(++_0x33a5b4);}(_0xe68f,0x10d));var _0xfe68=function(_0x33ac76,_0xa827c2){_0x33ac76=_0x33ac76-0x0;var _0x2b34e5=_0xe68f[_0x33ac76];return _0x2b34e5;};'use strict';var util=require(_0xfe68('0x0'));var _=require(_0xfe68('0x1'));var moment=require(_0xfe68('0x2'));var BPromise=require(_0xfe68('0x3'));var hardware=require(_0xfe68('0x4'));var encryptor=require(_0xfe68('0x5'));var db=require(_0xfe68('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfe68('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfe68('0x8'),'machineUuid':hardware[_0xfe68('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfe68('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xfe68('0xa'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5b7290){return new BPromise(function(_0x3fd636,_0x412fa0){return db[_0xfe68('0xb')][_0xfe68('0xc')](_[_0xfe68('0xd')](_0x5b7290,{'raw':!![],'where':{'id':0x1}}))[_0xfe68('0xe')](function(_0x142aa2){return checkLicense(_0x142aa2,null);})[_0xfe68('0xe')](function(_0xc8af2c){_0x3fd636(_0xc8af2c);return;})[_0xfe68('0xf')](function(_0x3c13aa){_0x412fa0(_0x3c13aa);});});}function checkLicense(_0x494368,_0x2813f9){if(!_0x494368){demoLicense[_0xfe68('0x10')]=_0x494368[_0xfe68('0x11')];return demoLicense;}try{var _0xd270f5=_0x2813f9||_0x494368[_0xfe68('0x12')];if(_[_0xfe68('0x13')](_0xd270f5)){throw new Error(_0xfe68('0x14'));}var _0x303c7f=_0x494368[_0xfe68('0x11')];var _0x1e17ab=_0x494368[_0xfe68('0x15')];var _0x48c4d3=_0x303c7f['split']('-')[0x4];var _0x4777cf=_0x303c7f[_0xfe68('0x16')]('-')[0x0];var _0x437f9f=encryptor[_0xfe68('0x17')](_0xd270f5,util['format'](_0xfe68('0x18'),_0x48c4d3,_0x303c7f,_0x4777cf));var _0x2123f9=JSON[_0xfe68('0x19')](_0x437f9f);_0x2123f9['demo']=![];_0x2123f9[_0xfe68('0x10')]=_0x303c7f;_0x2123f9['machineUuid']=hardware['getUuid']();if(_0x1e17ab){var _0x530a48=encryptor[_0xfe68('0x17')](_0x1e17ab);_0x2123f9[_0xfe68('0x1a')]=_0x530a48;_0x2123f9[_0xfe68('0x1b')]=moment(_0x530a48)[_0xfe68('0x1c')](0x7,_0xfe68('0x1d'))[_0xfe68('0x1e')]();_0x2123f9[_0xfe68('0x1f')]=_0x2123f9['uuid']!=_0x2123f9[_0xfe68('0x20')]?'changed':_0xfe68('0x21');}return _0x2123f9;}catch(_0x8e4020){breakingLicense[_0xfe68('0x10')]=_0x494368['data1'];breakingLicense[_0xfe68('0x22')]=_0x8e4020[_0xfe68('0x22')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x26a5a7,_0x4e263b){getLicense()['then'](function(_0x2ed844){return db['User']['findAll']({'attributes':[_0xfe68('0x23'),[db['sequelize']['fn'](_0xfe68('0x24'),db[_0xfe68('0x25')]['col']('role')),_0xfe68('0x26')]],'group':_0xfe68('0x23'),'where':{'role':{'$or':[_0xfe68('0x27'),_0xfe68('0x28'),'telephone']}},'raw':!![]})[_0xfe68('0xe')](function(_0x5d7ec2){var _0x4f42e5={'user':_0x2ed844[_0xfe68('0x29')]||0x0,'telephone':_0x2ed844['telephones']||0x0};_0x5d7ec2[_0xfe68('0x2a')](function(_0x22e60c){var _0x1c7e1d=_0x22e60c[_0xfe68('0x23')]===_0xfe68('0x27')?_0xfe68('0x28'):_0x22e60c['role'];_0x4f42e5[_0x1c7e1d]-=_0x22e60c['count'];if(_0x4f42e5[_0x1c7e1d]<0x0)_0x4f42e5[_0x1c7e1d]=0x0;});_0x26a5a7(_0x4f42e5);return;});})[_0xfe68('0xf')](function(_0x3ce28c){_0x4e263b(_0x3ce28c);});});}function checkUserLimits(_0x4236d6){return new BPromise(function(_0x938252,_0x1f0252){getLimits()[_0xfe68('0xe')](function(_0x2238bb){var _0x3b65aa=_['pick'](_['countBy'](_0x4236d6,_0xfe68('0x23')),['admin',_0xfe68('0x28'),_0xfe68('0x2b')]);var _0x369141=(_0x3b65aa[_0xfe68('0x27')]||0x0)+(_0x3b65aa['user']||0x0);var _0x3fd37e=_0x3b65aa['telephone']||0x0;if(_0x369141>_0x2238bb[_0xfe68('0x28')])return _0x1f0252('License\x20limit\x20reached\x20for\x20users');if(_0x3fd37e>_0x2238bb[_0xfe68('0x2b')])return _0x1f0252('License\x20limit\x20reached\x20for\x20telephones');return _0x938252();})[_0xfe68('0xf')](function(_0xe04e8b){_0x1f0252(_0xe04e8b);});});}module[_0xfe68('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x9c51=['util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','split','decryptString','format','%s:%s:%s','demo','machineUuid','gray','deadline','grayReason','disabled','message','User','findAll','role','sequelize','col','admin','user','telephone','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x3917c0,_0xd6a008){var _0x2be131=function(_0x57c4f1){while(--_0x57c4f1){_0x3917c0['push'](_0x3917c0['shift']());}};_0x2be131(++_0xd6a008);}(_0x9c51,0x150));var _0x19c5=function(_0x3144d5,_0x5250dd){_0x3144d5=_0x3144d5-0x0;var _0x5142f0=_0x9c51[_0x3144d5];return _0x5142f0;};'use strict';var util=require(_0x19c5('0x0'));var _=require(_0x19c5('0x1'));var moment=require(_0x19c5('0x2'));var BPromise=require('bluebird');var hardware=require(_0x19c5('0x3'));var encryptor=require(_0x19c5('0x4'));var db=require(_0x19c5('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x19c5('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x19c5('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x19c5('0x8'),'machineUuid':hardware[_0x19c5('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x270418){return new BPromise(function(_0x5fc2e9,_0x5a2490){return db[_0x19c5('0x9')][_0x19c5('0xa')](_[_0x19c5('0xb')](_0x270418,{'raw':!![],'where':{'id':0x1}}))[_0x19c5('0xc')](function(_0x22c6c3){return checkLicense(_0x22c6c3,null);})[_0x19c5('0xc')](function(_0x11cd35){_0x5fc2e9(_0x11cd35);return;})[_0x19c5('0xd')](function(_0x59e351){_0x5a2490(_0x59e351);});});}function checkLicense(_0x4d4a14,_0x15676f){if(!_0x4d4a14){demoLicense[_0x19c5('0xe')]=_0x4d4a14[_0x19c5('0xf')];return demoLicense;}try{var _0x3b6b4f=_0x15676f||_0x4d4a14[_0x19c5('0x10')];if(_[_0x19c5('0x11')](_0x3b6b4f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x37de79=_0x4d4a14['data1'];var _0x12fe42=_0x4d4a14['data2'];var _0x5ded81=_0x37de79[_0x19c5('0x12')]('-')[0x4];var _0x25e279=_0x37de79[_0x19c5('0x12')]('-')[0x0];var _0x30e429=encryptor[_0x19c5('0x13')](_0x3b6b4f,util[_0x19c5('0x14')](_0x19c5('0x15'),_0x5ded81,_0x37de79,_0x25e279));var _0x5b04fa=JSON['parse'](_0x30e429);_0x5b04fa[_0x19c5('0x16')]=![];_0x5b04fa['uuid']=_0x37de79;_0x5b04fa[_0x19c5('0x17')]=hardware[_0x19c5('0x6')]();if(_0x12fe42){var _0x135cdc=encryptor[_0x19c5('0x13')](_0x12fe42);_0x5b04fa[_0x19c5('0x18')]=_0x135cdc;_0x5b04fa[_0x19c5('0x19')]=moment(_0x135cdc)['add'](0x7,'days')[_0x19c5('0x14')]();_0x5b04fa[_0x19c5('0x1a')]=_0x5b04fa['uuid']!=_0x5b04fa['machineUuid']?'changed':_0x19c5('0x1b');}return _0x5b04fa;}catch(_0x3ef9b8){breakingLicense[_0x19c5('0xe')]=_0x4d4a14[_0x19c5('0xf')];breakingLicense[_0x19c5('0x1c')]=_0x3ef9b8['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5b7bf5,_0x155961){getLicense()['then'](function(_0x2c65e6){return db[_0x19c5('0x1d')][_0x19c5('0x1e')]({'attributes':[_0x19c5('0x1f'),[db['sequelize']['fn']('COUNT',db[_0x19c5('0x20')][_0x19c5('0x21')](_0x19c5('0x1f'))),'count']],'group':_0x19c5('0x1f'),'where':{'role':{'$or':[_0x19c5('0x22'),_0x19c5('0x23'),_0x19c5('0x24')]}},'raw':!![]})[_0x19c5('0xc')](function(_0x2fbac2){var _0xf07f2c={'user':_0x2c65e6['users']||0x0,'telephone':_0x2c65e6['telephones']||0x0};_0x2fbac2['forEach'](function(_0x314786){var _0x2bcf9a=_0x314786[_0x19c5('0x1f')]===_0x19c5('0x22')?_0x19c5('0x23'):_0x314786['role'];_0xf07f2c[_0x2bcf9a]-=_0x314786[_0x19c5('0x25')];if(_0xf07f2c[_0x2bcf9a]<0x0)_0xf07f2c[_0x2bcf9a]=0x0;});_0x5b7bf5(_0xf07f2c);return;});})[_0x19c5('0xd')](function(_0xe3ae6a){_0x155961(_0xe3ae6a);});});}function checkUserLimits(_0x5f4b6d){return new BPromise(function(_0x131c96,_0x45a9eb){getLimits()[_0x19c5('0xc')](function(_0x124898){var _0x5ad66e=_[_0x19c5('0x26')](_[_0x19c5('0x27')](_0x5f4b6d,'role'),[_0x19c5('0x22'),_0x19c5('0x23'),_0x19c5('0x24')]);var _0x5023a3=(_0x5ad66e[_0x19c5('0x22')]||0x0)+(_0x5ad66e[_0x19c5('0x23')]||0x0);var _0x49927d=_0x5ad66e['telephone']||0x0;if(_0x5023a3>_0x124898[_0x19c5('0x23')])return _0x45a9eb(_0x19c5('0x28'));if(_0x49927d>_0x124898[_0x19c5('0x24')])return _0x45a9eb(_0x19c5('0x29'));return _0x131c96();})[_0x19c5('0xd')](function(_0x5ae1a5){_0x45a9eb(_0x5ae1a5);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index e90267e..330cae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x25e7,0x1d6));var _0x725e=function(_0x2a8444,_0xb5ee31){_0x2a8444=_0x2a8444-0x0;var _0x53c724=_0x25e7[_0x2a8444];return _0x53c724;};'use strict';module[_0x725e('0x0')]={'DOMAIN':_0x725e('0x1'),'SESSION_SECRET':_0x725e('0x2'),'GOOGLE_ID':_0x725e('0x3'),'GOOGLE_SECRET':_0x725e('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0xdd4f=['exports','secret'];(function(_0x1ff689,_0x582775){var _0x464b17=function(_0x114874){while(--_0x114874){_0x1ff689['push'](_0x1ff689['shift']());}};_0x464b17(++_0x582775);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5af5a6,_0x86c3ae){_0x5af5a6=_0x5af5a6-0x0;var _0x296632=_0xdd4f[_0x5af5a6];return _0x296632;};'use strict';module[_0xfdd4('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfdd4('0x1'),'DEBUG':''};
\ No newline at end of file
index 65b5a3b..96e2801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module['exports']=fileLogger;
\ No newline at end of file
+var _0x8376=['fileLogger','../utils/loggers'];(function(_0x3c62ef,_0x4bb6ab){var _0x4d44f1=function(_0x12b12c){while(--_0x12b12c){_0x3c62ef['push'](_0x3c62ef['shift']());}};_0x4d44f1(++_0x4bb6ab);}(_0x8376,0x95));var _0x6837=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8376[_0x20a584];return _0x4b41a8;};'use strict';var fileLogger=require(_0x6837('0x0'))[_0x6837('0x1')];module['exports']=fileLogger;
\ No newline at end of file
index c5ba7b1..dd21b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf917=['resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','../../config/environment'];(function(_0x51cbf6,_0x1f3692){var _0xbac151=function(_0x1b2d16){while(--_0x1b2d16){_0x51cbf6['push'](_0x51cbf6['shift']());}};_0xbac151(++_0x1f3692);}(_0xf917,0x1c0));var _0x7f91=function(_0x19a206,_0x1d7556){_0x19a206=_0x19a206-0x0;var _0x7514ac=_0xf917[_0x19a206];return _0x7514ac;};'use strict';var path=require(_0x7f91('0x0'));var cfg=require(_0x7f91('0x1'));var env={'NODE_PATH':path[_0x7f91('0x2')](path[_0x7f91('0x3')](cfg[_0x7f91('0x4')],_0x7f91('0x5')))};var pm2config={'apps':[{'name':_0x7f91('0x6'),'script':path[_0x7f91('0x3')](__dirname,_0x7f91('0x7')),'env':env},{'name':_0x7f91('0x8'),'script':path[_0x7f91('0x3')](__dirname,_0x7f91('0x9')),'env':env},{'name':_0x7f91('0xa'),'script':path['join'](__dirname,_0x7f91('0xb')),'env':env},{'name':_0x7f91('0xc'),'script':path['join'](__dirname,_0x7f91('0xd')),'env':env},{'name':_0x7f91('0xe'),'script':path[_0x7f91('0x3')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x7f91('0xf'),'script':path[_0x7f91('0x3')](__dirname,_0x7f91('0x10')),'env':env}]};module[_0x7f91('0x11')]=pm2config;
\ No newline at end of file
+var _0xa0aa=['email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','../../config/environment','resolve','join','root','legacy-libs','express','ami','../../services/ami/index.js','../../services/agi/index.js'];(function(_0x2a47f1,_0xf86aee){var _0x458571=function(_0x4ce3d1){while(--_0x4ce3d1){_0x2a47f1['push'](_0x2a47f1['shift']());}};_0x458571(++_0xf86aee);}(_0xa0aa,0xd7));var _0xaa0a=function(_0x4a3d60,_0xb03ec4){_0x4a3d60=_0x4a3d60-0x0;var _0x3e14e5=_0xa0aa[_0x4a3d60];return _0x3e14e5;};'use strict';var path=require(_0xaa0a('0x0'));var cfg=require(_0xaa0a('0x1'));var env={'NODE_PATH':path[_0xaa0a('0x2')](path[_0xaa0a('0x3')](cfg[_0xaa0a('0x4')],_0xaa0a('0x5')))};var pm2config={'apps':[{'name':_0xaa0a('0x6'),'script':path[_0xaa0a('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xaa0a('0x7'),'script':path[_0xaa0a('0x3')](__dirname,_0xaa0a('0x8')),'env':env},{'name':'agi','script':path['join'](__dirname,_0xaa0a('0x9')),'env':env},{'name':_0xaa0a('0xa'),'script':path[_0xaa0a('0x3')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xaa0a('0xb'),'script':path[_0xaa0a('0x3')](__dirname,_0xaa0a('0xc')),'env':env},{'name':_0xaa0a('0xd'),'script':path[_0xaa0a('0x3')](__dirname,_0xaa0a('0xe')),'env':env}]};module['exports']=pm2config;
\ No newline at end of file
index 6ccdc0d..9f0b620 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12b8=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect','stop'];(function(_0x4b1291,_0x45e4da){var _0x332135=function(_0x17f187){while(--_0x17f187){_0x4b1291['push'](_0x4b1291['shift']());}};_0x332135(++_0x45e4da);}(_0x12b8,0xca));var _0x812b=function(_0x16dd98,_0x11d346){_0x16dd98=_0x16dd98-0x0;var _0xfc7fb3=_0x12b8[_0x16dd98];return _0xfc7fb3;};'use strict';var pm2=require(_0x812b('0x0'));var BPromise=require(_0x812b('0x1'));var config=require(_0x812b('0x2'));function connect(){return new BPromise(function(_0x2335dc,_0x5ba89c){return pm2['connect'](function(_0x56566b){if(_0x56566b){return _0x5ba89c(_0x56566b);}return _0x2335dc(_0x812b('0x3'));});});};exports[_0x812b('0x4')]=function(_0x1375ef){return connect()[_0x812b('0x5')](function(){return new BPromise(function(_0x5dc376,_0x3780f5){return pm2[_0x812b('0x4')](_0x1375ef,function(_0x40d227,_0x3a63d5){if(_0x40d227){return _0x3780f5(_0x40d227);}pm2[_0x812b('0x6')]();return _0x5dc376(_0x3a63d5);});});});};exports[_0x812b('0x7')]=function(_0x349054){return connect()['then'](function(){return new BPromise(function(_0x458027,_0x43d53a){return pm2[_0x812b('0x7')](_0x349054,function(_0x4209a6,_0x47584c){if(_0x4209a6){return _0x43d53a(_0x4209a6);}pm2[_0x812b('0x6')]();return _0x458027(_0x47584c);});});});};exports[_0x812b('0x8')]=function(_0x4d7647){return connect()['then'](function(){return new BPromise(function(_0x229d01,_0x432085){return pm2[_0x812b('0x8')](_0x4d7647,function(_0xc50d3a,_0x2bc9e3){if(_0xc50d3a){return _0x432085(_0xc50d3a);}pm2[_0x812b('0x6')]();return _0x229d01(_0x2bc9e3);});});});};exports[_0x812b('0x9')]=function(){return connect()[_0x812b('0x5')](function(){return new BPromise(function(_0x149261,_0x27803c){return pm2['list'](function(_0x4ef658,_0x34eb0e){if(_0x4ef658){return _0x27803c(_0x4ef658);}pm2[_0x812b('0x6')]();return _0x149261(_0x34eb0e);});});});};exports[_0x812b('0xa')]=function(_0x32c283){return connect()[_0x812b('0x5')](function(){return new BPromise(function(_0x59c680,_0x404e5d){return pm2['describe'](_0x32c283,function(_0x22a66b,_0x4cd089){if(_0x22a66b){return _0x404e5d(_0x22a66b);}pm2[_0x812b('0x6')]();return _0x59c680(_0x4cd089);});});});};exports[_0x812b('0xb')]=function(_0x2841ed){return connect()[_0x812b('0x5')](function(){return new BPromise(function(_0x181b74,_0x17ca51){return pm2[_0x812b('0xb')](_0x2841ed,function(_0x2cc736,_0x4f252a){if(_0x2cc736){return _0x17ca51(_0x2cc736);}pm2['disconnect']();return _0x181b74(_0x4f252a);});});});};exports['dump']=function(){return connect()[_0x812b('0x5')](function(){return new BPromise(function(_0x19582d,_0x4b887c){return pm2[_0x812b('0xc')](function(_0x20969b){if(_0x20969b){return _0x4b887c(_0x20969b);}return _0x19582d(_0x812b('0xd'));});});});};
\ No newline at end of file
+var _0x60e0=['start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','connected'];(function(_0x3374e,_0x466845){var _0x558137=function(_0x390136){while(--_0x390136){_0x3374e['push'](_0x3374e['shift']());}};_0x558137(++_0x466845);}(_0x60e0,0xf8));var _0x060e=function(_0x10fbc5,_0x262262){_0x10fbc5=_0x10fbc5-0x0;var _0x4ecff3=_0x60e0[_0x10fbc5];return _0x4ecff3;};'use strict';var pm2=require(_0x060e('0x0'));var BPromise=require(_0x060e('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x1550f9,_0xe0a239){return pm2[_0x060e('0x2')](function(_0x16f591){if(_0x16f591){return _0xe0a239(_0x16f591);}return _0x1550f9(_0x060e('0x3'));});});};exports[_0x060e('0x4')]=function(_0x87cf1){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x1c5b1c,_0x399523){return pm2['start'](_0x87cf1,function(_0x233e3c,_0x1e5ffe){if(_0x233e3c){return _0x399523(_0x233e3c);}pm2[_0x060e('0x6')]();return _0x1c5b1c(_0x1e5ffe);});});});};exports[_0x060e('0x7')]=function(_0x4ba65d){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x2bbc80,_0x3eb7aa){return pm2[_0x060e('0x7')](_0x4ba65d,function(_0x1195ed,_0x523a56){if(_0x1195ed){return _0x3eb7aa(_0x1195ed);}pm2['disconnect']();return _0x2bbc80(_0x523a56);});});});};exports[_0x060e('0x8')]=function(_0x322c8f){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x1056b0,_0x19f06a){return pm2[_0x060e('0x8')](_0x322c8f,function(_0x24d709,_0xadb99f){if(_0x24d709){return _0x19f06a(_0x24d709);}pm2['disconnect']();return _0x1056b0(_0xadb99f);});});});};exports[_0x060e('0x9')]=function(){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x424a69,_0x18b2c8){return pm2['list'](function(_0x3b9f06,_0x1a89ca){if(_0x3b9f06){return _0x18b2c8(_0x3b9f06);}pm2['disconnect']();return _0x424a69(_0x1a89ca);});});});};exports[_0x060e('0xa')]=function(_0x1ed4cc){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x11aab1,_0x170da1){return pm2[_0x060e('0xa')](_0x1ed4cc,function(_0x393dc5,_0xf86b77){if(_0x393dc5){return _0x170da1(_0x393dc5);}pm2[_0x060e('0x6')]();return _0x11aab1(_0xf86b77);});});});};exports['delete']=function(_0x53b979){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x1ebf55,_0x7c0591){return pm2[_0x060e('0xb')](_0x53b979,function(_0x5a049d,_0x27c8e6){if(_0x5a049d){return _0x7c0591(_0x5a049d);}pm2[_0x060e('0x6')]();return _0x1ebf55(_0x27c8e6);});});});};exports['dump']=function(){return connect()[_0x060e('0x5')](function(){return new BPromise(function(_0x5874a6,_0x26b3ec){return pm2[_0x060e('0xc')](function(_0x415a29){if(_0x415a29){return _0x26b3ec(_0x415a29);}return _0x5874a6(_0x060e('0xd'));});});});};
\ No newline at end of file
index ec37eee..b851efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc260=['timeout','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system'];(function(_0x4e7490,_0x4b26ae){var _0x3622d0=function(_0x40a2bb){while(--_0x40a2bb){_0x4e7490['push'](_0x4e7490['shift']());}};_0x3622d0(++_0x4b26ae);}(_0xc260,0xee));var _0x0c26=function(_0x4f087a,_0x137aae){_0x4f087a=_0x4f087a-0x0;var _0x250a7d=_0xc260[_0x4f087a];return _0x250a7d;};'use strict';var _=require(_0x0c26('0x0'));var moment=require(_0x0c26('0x1'));var Redis=require(_0x0c26('0x2'));var util=require(_0x0c26('0x3'));var config=require('../../config/environment');var db=require(_0x0c26('0x4'))['db'];var logger=require(_0x0c26('0x5'))(_0x0c26('0x6'));config[_0x0c26('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0c26('0x7')]));function closeInteractions(){var _0xeff21a=0x0;var _0x2191f8=[];return db[_0x0c26('0x8')][_0x0c26('0x9')]({'raw':!![],'attributes':['id',_0x0c26('0xa')],'where':{'id':0x1}})[_0x0c26('0xb')](function(_0x23e826){_0xeff21a=_0x23e826[_0x0c26('0xa')];if(_0xeff21a){return db[_0x0c26('0xc')][_0x0c26('0xd')]({'raw':!![],'attributes':['id',_0x0c26('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0c26('0xf')](_0x23e826[_0x0c26('0xa')],_0x0c26('0x10'))}}});}else{return[];}})['then'](function(_0x6cc766){if(_0x6cc766&&_0x6cc766[_0x0c26('0x11')]){_0x2191f8=_[_0x0c26('0x12')](_0x6cc766||[],'id');logger['info'](_0x0c26('0x13'),_0x2191f8[_0x0c26('0x14')]());return db[_0x0c26('0xc')][_0x0c26('0x15')]({'closeReason':_0x0c26('0x16'),'disposition':_0x0c26('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2191f8}});}})[_0x0c26('0xb')](function(){if(_0x2191f8&&_0x2191f8['length']){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x2191f8[_0x0c26('0x14')]());for(var _0x3ab93a=0x0;_0x3ab93a<_0x2191f8[_0x0c26('0x11')];_0x3ab93a++){io[_0x0c26('0x18')]('chatInteraction:update',{'id':_0x2191f8[_0x3ab93a],'closed':!![]});}}})[_0x0c26('0x19')](function(_0x29fb18){logger[_0x0c26('0x1a')](_0x0c26('0x1b'),_0x29fb18?util[_0x0c26('0x1c')](_0x29fb18,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xa7fb=['map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','schedule','defaults','redis','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7fb,0x75));var _0xba7f=function(_0x34cd17,_0x19fadb){_0x34cd17=_0x34cd17-0x0;var _0x43b81a=_0xa7fb[_0x34cd17];return _0x43b81a;};'use strict';var _=require(_0xba7f('0x0'));var moment=require(_0xba7f('0x1'));var Redis=require(_0xba7f('0x2'));var util=require('util');var config=require(_0xba7f('0x3'));var db=require(_0xba7f('0x4'))['db'];var logger=require('../logger')(_0xba7f('0x5'));config['redis']=_[_0xba7f('0x6')](config[_0xba7f('0x7')],{'host':_0xba7f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xba7f('0x7')]));function closeInteractions(){var _0x2c9432=0x0;var _0x4487a0=[];return db[_0xba7f('0x9')][_0xba7f('0xa')]({'raw':!![],'attributes':['id',_0xba7f('0xb')],'where':{'id':0x1}})[_0xba7f('0xc')](function(_0x288aa1){_0x2c9432=_0x288aa1[_0xba7f('0xb')];if(_0x2c9432){return db[_0xba7f('0xd')][_0xba7f('0xe')]({'raw':!![],'attributes':['id',_0xba7f('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xba7f('0x10')](_0x288aa1[_0xba7f('0xb')],_0xba7f('0x11'))}}});}else{return[];}})[_0xba7f('0xc')](function(_0x1431d0){if(_0x1431d0&&_0x1431d0[_0xba7f('0x12')]){_0x4487a0=_[_0xba7f('0x13')](_0x1431d0||[],'id');logger['info'](_0xba7f('0x14'),_0x4487a0[_0xba7f('0x15')]());return db['ChatInteraction'][_0xba7f('0x16')]({'closeReason':_0xba7f('0x17'),'disposition':_0xba7f('0x18'),'closed':!![],'closedAt':moment()['format'](_0xba7f('0x19'))},{'where':{'id':_0x4487a0}});}})[_0xba7f('0xc')](function(){if(_0x4487a0&&_0x4487a0[_0xba7f('0x12')]){logger[_0xba7f('0x1a')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4487a0[_0xba7f('0x15')]());for(var _0x27f401=0x0;_0x27f401<_0x4487a0[_0xba7f('0x12')];_0x27f401++){io[_0xba7f('0x1b')](_0xba7f('0x1c'),{'id':_0x4487a0[_0x27f401],'closed':!![]});}}})[_0xba7f('0x1d')](function(_0x13cfd8){logger[_0xba7f('0x1e')](_0xba7f('0x1f'),_0x13cfd8?util[_0xba7f('0x20')](_0x13cfd8,{'showHidden':![],'depth':null}):'');});}exports[_0xba7f('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index b9391f3..0cb0759 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x441a=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x2e0e12,_0x118d0a){var _0x5452cf=function(_0x4f2d60){while(--_0x4f2d60){_0x2e0e12['push'](_0x2e0e12['shift']());}};_0x5452cf(++_0x118d0a);}(_0x441a,0x7f));var _0xa441=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x441a[_0x817d9b];return _0x2752e1;};'use strict';function start(){var _0x5a44ec=require(_0xa441('0x0'));return _0x5a44ec[_0xa441('0x1')]();}module[_0xa441('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x85e1=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85e1,0x109));var _0x185e=function(_0x472b69,_0xfcd9b0){_0x472b69=_0x472b69-0x0;var _0x51fff2=_0x85e1[_0x472b69];return _0x51fff2;};'use strict';function start(){var _0x4fc0b8=require(_0x185e('0x0'));return _0x4fc0b8[_0x185e('0x1')]();}module[_0x185e('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
index 200f590..913d1eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff47=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','stringify','email\x20sent','catch','error\x20mail','data','Smtp','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','length','exists','stop','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','startAt','endAt','start','add\x20cron','deleteJob','stop\x20cron','isBetween','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','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','status','Sent'];(function(_0x59d5b8,_0x54227f){var _0x37ad1c=function(_0x486886){while(--_0x486886){_0x59d5b8['push'](_0x59d5b8['shift']());}};_0x37ad1c(++_0x54227f);}(_0xff47,0x1e8));var _0x7ff4=function(_0x3986fc,_0x41fd49){_0x3986fc=_0x3986fc-0x0;var _0x514bd1=_0xff47[_0x3986fc];return _0x514bd1;};'use strict';var fs=require('fs');var util=require(_0x7ff4('0x0'));var path=require(_0x7ff4('0x1'));var _=require(_0x7ff4('0x2'));var moment=require('moment');var CronJobManager=require(_0x7ff4('0x3'));var jayson=require(_0x7ff4('0x4'));var BPromise=require(_0x7ff4('0x5'));var logger=require(_0x7ff4('0x6'))(_0x7ff4('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x7ff4('0x8'));var client=jayson[_0x7ff4('0x9')][_0x7ff4('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2fd46a,_0x9f8df1){return function(){logger['info'](_0x7ff4('0xb'),_0x2fd46a[_0x7ff4('0xc')]);var _0x28e110=!![];var _0x5c6302=_0x2fd46a[_0x7ff4('0xd')][_0x7ff4('0xe')]();var _0x10d2bc={'account':_0x5c6302,'message':{'from':util[_0x7ff4('0xf')](_0x7ff4('0x10'),_0x2fd46a[_0x7ff4('0xd')][_0x7ff4('0x11')],_0x2fd46a[_0x7ff4('0xd')][_0x7ff4('0xc')]||_0x2fd46a['MailAccount']['Smtp']['user']),'to':_0x2fd46a['email'],'cc':_0x2fd46a['cc'],'bcc':_0x2fd46a[_0x7ff4('0x12')],'subject':util[_0x7ff4('0xf')]('Report\x20%s\x20last\x20%s\x20%s',_0x9f8df1['name'],_0x2fd46a[_0x7ff4('0x13')],_0x2fd46a['subtractUnit'])}};var _0xf2cdeb=path[_0x7ff4('0x14')](__dirname,_0x7ff4('0x15'));var _0x1fcb98=_0x9f8df1[_0x7ff4('0x16')];var _0x296f4d=util[_0x7ff4('0xf')](_0x7ff4('0x17'),path[_0x7ff4('0x18')](_0x9f8df1[_0x7ff4('0x16')],path[_0x7ff4('0x19')](_0x9f8df1['savename'])),_0x7ff4('0x1a'));var _0x1e1f26=path[_0x7ff4('0x14')](_0xf2cdeb,_0x1fcb98);var _0x29ef31=path[_0x7ff4('0x14')](_0xf2cdeb,_0x296f4d);if(fs[_0x7ff4('0x1b')](_0x1e1f26)){_0x9f8df1['status']='Sent';_0x10d2bc[_0x7ff4('0x1c')][_0x7ff4('0x1d')]=[{'filename':_0x1fcb98,'path':_0x1e1f26}];_0x10d2bc['message'][_0x7ff4('0x1e')]=util[_0x7ff4('0xf')](_0x7ff4('0x1f'),JSON['stringify'](_0x9f8df1,null,0x2));}else if(fs[_0x7ff4('0x1b')](_0x29ef31)){_0x9f8df1[_0x7ff4('0x20')]=_0x7ff4('0x21');_0x10d2bc[_0x7ff4('0x1c')][_0x7ff4('0x1d')]=[{'filename':_0x296f4d,'path':_0x29ef31}];}else{_0x10d2bc['message'][_0x7ff4('0x1e')]=_0x7ff4('0x22');if(!_0x2fd46a[_0x7ff4('0x23')]){_0x28e110=![];logger[_0x7ff4('0x24')](_0x7ff4('0x25'));}}if(_0x28e110){return client[_0x7ff4('0x26')](_0x7ff4('0x27'),_0x10d2bc)[_0x7ff4('0x28')](function(_0x4b5397){if(_0x4b5397[_0x7ff4('0x29')]){return logger[_0x7ff4('0x29')]('error\x20mail',JSON[_0x7ff4('0x2a')](_0x4b5397));}return logger[_0x7ff4('0x24')](_0x7ff4('0x2b'));})[_0x7ff4('0x2c')](function(_0x45e3c6){return logger['error'](_0x7ff4('0x2d'),JSON[_0x7ff4('0x2a')](_0x45e3c6));});}};}function handleError(){return function(_0x269671){return logger['error'](JSON[_0x7ff4('0x2a')](_0x269671));};}function handleResult(_0x51b3d7){return function(_0x4ddc90){logger[_0x7ff4('0x24')](_0x7ff4('0x2e'),JSON[_0x7ff4('0x2a')](_0x4ddc90));if(_0x51b3d7[_0x7ff4('0xd')]&&_0x51b3d7[_0x7ff4('0xd')][_0x7ff4('0x2f')]&&!_['isNil'](_0x51b3d7['email'])){setTimeout(handleSendEmail(_0x51b3d7,_0x4ddc90),0x3c*0x3e8);}};}function handleJob(_0x4bc70e){return function(){try{if(_['isNil'](_0x4bc70e['subtractNumber'])){return logger[_0x7ff4('0x24')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x7ff4('0x30')](_0x4bc70e['subtractUnit'])){return logger[_0x7ff4('0x24')](_0x7ff4('0x31'));}var _0xd9dcfe={'startDate':moment()[_0x7ff4('0x32')](_0x4bc70e[_0x7ff4('0x13')],_0x4bc70e[_0x7ff4('0x33')])[_0x7ff4('0xf')](_0x7ff4('0x34')),'endDate':moment()[_0x7ff4('0xf')](_0x7ff4('0x34')),'type':_0x7ff4('0x35'),'output':_0x4bc70e[_0x7ff4('0x36')],'name':_0x4bc70e[_0x7ff4('0x11')]};if(!_[_0x7ff4('0x30')](_0x4bc70e[_0x7ff4('0x37')])){logger[_0x7ff4('0x24')](_0x7ff4('0x38'),_0x4bc70e['DefaultReportId']);return analyticDefaultReportController[_0x7ff4('0x39')]({'id':_0x4bc70e[_0x7ff4('0x37')]},_0xd9dcfe)[_0x7ff4('0x28')](handleResult(_0x4bc70e))[_0x7ff4('0x2c')](handleError());}if(!_[_0x7ff4('0x30')](_0x4bc70e[_0x7ff4('0x3a')])){logger['info'](_0x7ff4('0x3b'),_0x4bc70e[_0x7ff4('0x3a')]);return analyticCustomReportController[_0x7ff4('0x39')]({'id':_0x4bc70e[_0x7ff4('0x3a')]},_0xd9dcfe)[_0x7ff4('0x28')](handleResult(_0x4bc70e))[_0x7ff4('0x2c')](handleError());}}catch(_0x432d61){logger[_0x7ff4('0x29')](JSON['stringify'](_0x432d61));}return logger[_0x7ff4('0x24')]('no\x20report\x20id');};}function getJobs(_0x93910e){var _0x43ca6a={};if(_0x93910e){_0x43ca6a['id']=_0x93910e;}return db[_0x7ff4('0x3c')][_0x7ff4('0x3d')]({'where':_0x43ca6a,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x7ff4('0xc')],'include':[{'model':db[_0x7ff4('0x3e')],'as':_0x7ff4('0x2f'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x7ff4('0x28')](function(_0x5a2d4c){var _0x284759=_[_0x7ff4('0x3f')](manager[_0x7ff4('0x40')]);var _0x61436b=_[_0x7ff4('0x41')](_0x5a2d4c,function(_0x330281){return _0x330281['id'][_0x7ff4('0x42')]();});var _0x214471=_[_0x7ff4('0x43')](_0x5a2d4c,function(_0x2f0b82){return _0x2f0b82['id']['toString']();});var _0xb0bf33=_0x93910e?_0x61436b:_['difference'](_0x61436b,_0x284759);var _0x2ddc37=_['intersection'](_0x61436b,_0x284759);var _0xb8c955=_['difference'](_0x284759,_0x61436b);var _0x35884c;var _0x3c675f;for(_0x35884c=0x0;_0x35884c<_0xb8c955[_0x7ff4('0x44')]&&!_0x93910e;_0x35884c+=0x1){_0x3c675f=_0xb8c955[_0x35884c][_0x7ff4('0x42')]();if(manager[_0x7ff4('0x45')](_0x3c675f)){manager[_0x7ff4('0x46')](_0x3c675f);manager['deleteJob'](_0x3c675f);logger['info'](_0x7ff4('0x47'),_0x3c675f);}}logger[_0x7ff4('0x24')](_0x7ff4('0x48'),JSON[_0x7ff4('0x2a')](_0xb0bf33));for(_0x35884c=0x0;_0x35884c<_0xb0bf33['length'];_0x35884c+=0x1){_0x3c675f=_0xb0bf33[_0x35884c][_0x7ff4('0x42')]();logger[_0x7ff4('0x24')](_0x7ff4('0x49'),_0x3c675f);if(_0x93910e){logger[_0x7ff4('0x24')](_0x7ff4('0x4a'),_0x93910e);logger[_0x7ff4('0x24')](JSON[_0x7ff4('0x2a')](_0x214471[_0x3c675f]));BPromise[_0x7ff4('0x4b')]()['then'](handleJob(_0x214471[_0x3c675f]));logger['info']('run\x20job',_0x214471[_0x3c675f][_0x7ff4('0x11')],_0x214471[_0x3c675f][_0x7ff4('0x4c')]);}else if(_0x214471[_0x3c675f][_0x7ff4('0x4c')]&&_0x214471[_0x3c675f][_0x7ff4('0x4d')]&&moment()['isBetween'](_0x214471[_0x3c675f][_0x7ff4('0x4e')],_0x214471[_0x3c675f][_0x7ff4('0x4f')])){manager['add'](_0x3c675f,_0x214471[_0x3c675f][_0x7ff4('0x4c')],handleJob(_0x214471[_0x3c675f]));manager[_0x7ff4('0x50')](_0x3c675f);logger['info'](_0x7ff4('0x51'),_0x214471[_0x3c675f][_0x7ff4('0x11')],_0x214471[_0x3c675f][_0x7ff4('0x4c')]);}else if(manager[_0x7ff4('0x45')](_0x3c675f)){manager['stop'](_0x3c675f);manager[_0x7ff4('0x52')](_0x3c675f);logger[_0x7ff4('0x24')](_0x7ff4('0x53'),_0x214471[_0x3c675f][_0x7ff4('0x11')],_0x214471[_0x3c675f][_0x7ff4('0x4c')]);}}for(_0x35884c=0x0,_0x3c675f;_0x35884c<_0x2ddc37['length']&&!_0x93910e;_0x35884c+=0x1){_0x3c675f=_0x2ddc37[_0x35884c][_0x7ff4('0x42')]();if(manager[_0x7ff4('0x45')](_0x3c675f)){if(_0x214471[_0x3c675f][_0x7ff4('0x4c')]&&_0x214471[_0x3c675f][_0x7ff4('0x4d')]&&moment()[_0x7ff4('0x54')](_0x214471[_0x3c675f][_0x7ff4('0x4e')],_0x214471[_0x3c675f][_0x7ff4('0x4f')])){manager['update'](_0x3c675f,_0x214471[_0x3c675f]['cron'],handleJob(_0x214471[_0x3c675f]));logger[_0x7ff4('0x24')](_0x7ff4('0x55'),_0x214471[_0x3c675f][_0x7ff4('0x11')],_0x214471[_0x3c675f]['cron']);}else{manager[_0x7ff4('0x46')](_0x3c675f);manager['deleteJob'](_0x3c675f);logger['info'](_0x7ff4('0x53'),_0x214471[_0x3c675f]['name'],_0x214471[_0x3c675f][_0x7ff4('0x4c')]);}}}})[_0x7ff4('0x2c')](function(_0x78a3ea){logger[_0x7ff4('0x29')](JSON['stringify'](_0x78a3ea));});}exports[_0x7ff4('0x56')]=function(_0xb05393){return getJobs(_0xb05393);};exports[_0x7ff4('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x5905=['../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','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\x20mail','email\x20sent','error','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','catch','Schedule','findAll','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller'];(function(_0x492782,_0x189c96){var _0x4a81b9=function(_0x30483d){while(--_0x30483d){_0x492782['push'](_0x492782['shift']());}};_0x4a81b9(++_0x189c96);}(_0x5905,0x163));var _0x5590=function(_0x45bf94,_0x55fa69){_0x45bf94=_0x45bf94-0x0;var _0x54d26b=_0x5905[_0x45bf94];return _0x54d26b;};'use strict';var fs=require('fs');var util=require(_0x5590('0x0'));var path=require(_0x5590('0x1'));var _=require(_0x5590('0x2'));var moment=require(_0x5590('0x3'));var CronJobManager=require(_0x5590('0x4'));var jayson=require(_0x5590('0x5'));var BPromise=require(_0x5590('0x6'));var logger=require(_0x5590('0x7'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x5590('0x8'));var analyticDefaultReportController=require(_0x5590('0x9'));var client=jayson[_0x5590('0xa')][_0x5590('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x112f57,_0x2a22d3){return function(){logger[_0x5590('0xc')](_0x5590('0xd'),_0x112f57[_0x5590('0xe')]);var _0x4965fb=!![];var _0x40a666=_0x112f57['MailAccount'][_0x5590('0xf')]();var _0x41063c={'account':_0x40a666,'message':{'from':util[_0x5590('0x10')](_0x5590('0x11'),_0x112f57[_0x5590('0x12')]['name'],_0x112f57[_0x5590('0x12')][_0x5590('0xe')]||_0x112f57[_0x5590('0x12')][_0x5590('0x13')][_0x5590('0x14')]),'to':_0x112f57[_0x5590('0xe')],'cc':_0x112f57['cc'],'bcc':_0x112f57['bcc'],'subject':util[_0x5590('0x10')](_0x5590('0x15'),_0x2a22d3['name'],_0x112f57[_0x5590('0x16')],_0x112f57[_0x5590('0x17')])}};var _0x2662b9=path[_0x5590('0x18')](__dirname,'../../files/reports');var _0xccbd82=_0x2a22d3[_0x5590('0x19')];var _0x56913f=util['format'](_0x5590('0x1a'),path[_0x5590('0x1b')](_0x2a22d3[_0x5590('0x19')],path[_0x5590('0x1c')](_0x2a22d3[_0x5590('0x19')])),_0x5590('0x1d'));var _0x467812=path['join'](_0x2662b9,_0xccbd82);var _0x1ddfd2=path['join'](_0x2662b9,_0x56913f);if(fs[_0x5590('0x1e')](_0x467812)){_0x2a22d3['status']=_0x5590('0x1f');_0x41063c[_0x5590('0x20')][_0x5590('0x21')]=[{'filename':_0xccbd82,'path':_0x467812}];_0x41063c[_0x5590('0x20')][_0x5590('0x22')]=util[_0x5590('0x10')](_0x5590('0x23'),JSON[_0x5590('0x24')](_0x2a22d3,null,0x2));}else if(fs['existsSync'](_0x1ddfd2)){_0x2a22d3[_0x5590('0x25')]=_0x5590('0x1f');_0x41063c[_0x5590('0x20')]['attachments']=[{'filename':_0x56913f,'path':_0x1ddfd2}];}else{_0x41063c[_0x5590('0x20')]['text']=_0x5590('0x26');if(!_0x112f57[_0x5590('0x27')]){_0x4965fb=![];logger[_0x5590('0xc')](_0x5590('0x28'));}}if(_0x4965fb){return client[_0x5590('0x29')](_0x5590('0x2a'),_0x41063c)[_0x5590('0x2b')](function(_0xa5a7d5){if(_0xa5a7d5['error']){return logger['error'](_0x5590('0x2c'),JSON[_0x5590('0x24')](_0xa5a7d5));}return logger[_0x5590('0xc')](_0x5590('0x2d'));})['catch'](function(_0x212b59){return logger['error'](_0x5590('0x2c'),JSON[_0x5590('0x24')](_0x212b59));});}};}function handleError(){return function(_0x6312){return logger[_0x5590('0x2e')](JSON[_0x5590('0x24')](_0x6312));};}function handleResult(_0x49f423){return function(_0x4e3792){logger[_0x5590('0xc')](_0x5590('0x2f'),JSON[_0x5590('0x24')](_0x4e3792));if(_0x49f423['MailAccount']&&_0x49f423[_0x5590('0x12')][_0x5590('0x13')]&&!_[_0x5590('0x30')](_0x49f423[_0x5590('0xe')])){setTimeout(handleSendEmail(_0x49f423,_0x4e3792),0x3c*0x3e8);}};}function handleJob(_0x281aaf){return function(){try{if(_[_0x5590('0x30')](_0x281aaf[_0x5590('0x16')])){return logger[_0x5590('0xc')](_0x5590('0x31'));}if(_['isNil'](_0x281aaf[_0x5590('0x17')])){return logger['info'](_0x5590('0x32'));}var _0x598744={'startDate':moment()[_0x5590('0x33')](_0x281aaf['subtractNumber'],_0x281aaf['subtractUnit'])[_0x5590('0x10')](_0x5590('0x34')),'endDate':moment()[_0x5590('0x10')](_0x5590('0x34')),'type':_0x5590('0x35'),'output':_0x281aaf[_0x5590('0x36')],'name':_0x281aaf[_0x5590('0x37')]};if(!_[_0x5590('0x30')](_0x281aaf[_0x5590('0x38')])){logger[_0x5590('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x281aaf[_0x5590('0x38')]);return analyticDefaultReportController[_0x5590('0x39')]({'id':_0x281aaf[_0x5590('0x38')]},_0x598744)[_0x5590('0x2b')](handleResult(_0x281aaf))['catch'](handleError());}if(!_[_0x5590('0x30')](_0x281aaf['CustomReportId'])){logger[_0x5590('0xc')](_0x5590('0x3a'),_0x281aaf[_0x5590('0x3b')]);return analyticCustomReportController['runReport']({'id':_0x281aaf[_0x5590('0x3b')]},_0x598744)[_0x5590('0x2b')](handleResult(_0x281aaf))[_0x5590('0x3c')](handleError());}}catch(_0x1f105e){logger[_0x5590('0x2e')](JSON[_0x5590('0x24')](_0x1f105e));}return logger[_0x5590('0xc')]('no\x20report\x20id');};}function getJobs(_0x377c3b){var _0x1cedab={};if(_0x377c3b){_0x1cedab['id']=_0x377c3b;}return db[_0x5590('0x3d')][_0x5590('0x3e')]({'where':_0x1cedab,'include':[{'model':db[_0x5590('0x12')],'attributes':['id',_0x5590('0x37'),_0x5590('0xe')],'include':[{'model':db['MailServerOut'],'as':_0x5590('0x13'),'include':[{'model':db[_0x5590('0x3f')],'as':'CloudProvider'}]}]}]})[_0x5590('0x2b')](function(_0x3d3bf0){var _0x3ef531=_[_0x5590('0x40')](manager[_0x5590('0x41')]);var _0x571732=_[_0x5590('0x42')](_0x3d3bf0,function(_0x1370c2){return _0x1370c2['id']['toString']();});var _0x31d981=_[_0x5590('0x43')](_0x3d3bf0,function(_0x555c7f){return _0x555c7f['id'][_0x5590('0x44')]();});var _0x2529f0=_0x377c3b?_0x571732:_[_0x5590('0x45')](_0x571732,_0x3ef531);var _0x191abe=_[_0x5590('0x46')](_0x571732,_0x3ef531);var _0x369907=_[_0x5590('0x45')](_0x3ef531,_0x571732);var _0x494c0a;var _0x55deeb;for(_0x494c0a=0x0;_0x494c0a<_0x369907[_0x5590('0x47')]&&!_0x377c3b;_0x494c0a+=0x1){_0x55deeb=_0x369907[_0x494c0a][_0x5590('0x44')]();if(manager[_0x5590('0x48')](_0x55deeb)){manager[_0x5590('0x49')](_0x55deeb);manager[_0x5590('0x4a')](_0x55deeb);logger[_0x5590('0xc')](_0x5590('0x4b'),_0x55deeb);}}logger[_0x5590('0xc')](_0x5590('0x4c'),JSON['stringify'](_0x2529f0));for(_0x494c0a=0x0;_0x494c0a<_0x2529f0['length'];_0x494c0a+=0x1){_0x55deeb=_0x2529f0[_0x494c0a]['toString']();logger[_0x5590('0xc')]('index',_0x55deeb);if(_0x377c3b){logger['info']('my\x20id',_0x377c3b);logger[_0x5590('0xc')](JSON[_0x5590('0x24')](_0x31d981[_0x55deeb]));BPromise[_0x5590('0x4d')]()[_0x5590('0x2b')](handleJob(_0x31d981[_0x55deeb]));logger[_0x5590('0xc')](_0x5590('0x4e'),_0x31d981[_0x55deeb][_0x5590('0x37')],_0x31d981[_0x55deeb][_0x5590('0x4f')]);}else if(_0x31d981[_0x55deeb]['cron']&&_0x31d981[_0x55deeb]['active']&&moment()[_0x5590('0x50')](_0x31d981[_0x55deeb][_0x5590('0x51')],_0x31d981[_0x55deeb][_0x5590('0x52')])){manager[_0x5590('0x53')](_0x55deeb,_0x31d981[_0x55deeb][_0x5590('0x4f')],handleJob(_0x31d981[_0x55deeb]));manager[_0x5590('0x54')](_0x55deeb);logger[_0x5590('0xc')](_0x5590('0x55'),_0x31d981[_0x55deeb][_0x5590('0x37')],_0x31d981[_0x55deeb][_0x5590('0x4f')]);}else if(manager['exists'](_0x55deeb)){manager[_0x5590('0x49')](_0x55deeb);manager[_0x5590('0x4a')](_0x55deeb);logger[_0x5590('0xc')](_0x5590('0x56'),_0x31d981[_0x55deeb][_0x5590('0x37')],_0x31d981[_0x55deeb][_0x5590('0x4f')]);}}for(_0x494c0a=0x0,_0x55deeb;_0x494c0a<_0x191abe['length']&&!_0x377c3b;_0x494c0a+=0x1){_0x55deeb=_0x191abe[_0x494c0a][_0x5590('0x44')]();if(manager['exists'](_0x55deeb)){if(_0x31d981[_0x55deeb][_0x5590('0x4f')]&&_0x31d981[_0x55deeb][_0x5590('0x57')]&&moment()[_0x5590('0x50')](_0x31d981[_0x55deeb][_0x5590('0x51')],_0x31d981[_0x55deeb][_0x5590('0x52')])){manager[_0x5590('0x58')](_0x55deeb,_0x31d981[_0x55deeb]['cron'],handleJob(_0x31d981[_0x55deeb]));logger[_0x5590('0xc')](_0x5590('0x59'),_0x31d981[_0x55deeb][_0x5590('0x37')],_0x31d981[_0x55deeb][_0x5590('0x4f')]);}else{manager['stop'](_0x55deeb);manager[_0x5590('0x4a')](_0x55deeb);logger[_0x5590('0xc')](_0x5590('0x56'),_0x31d981[_0x55deeb]['name'],_0x31d981[_0x55deeb][_0x5590('0x4f')]);}}}})[_0x5590('0x3c')](function(_0x1ae79f){logger[_0x5590('0x2e')](JSON['stringify'](_0x1ae79f));});}exports[_0x5590('0x5a')]=function(_0x12fae4){return getJobs(_0x12fae4);};exports[_0x5590('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index a9a8c39..0ba3ac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa2=['FailureReason','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','Neutral','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','forEach','push','catch','inspect','lodash','aws-sdk','util','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED'];(function(_0x189a72,_0x4ac342){var _0x2b457a=function(_0x151b57){while(--_0x151b57){_0x189a72['push'](_0x189a72['shift']());}};_0x2b457a(++_0x4ac342);}(_0x3aa2,0x13b));var _0x23aa=function(_0x40bc4a,_0x2f4fa6){_0x40bc4a=_0x40bc4a-0x0;var _0x497b7a=_0x3aa2[_0x40bc4a];return _0x497b7a;};var _=require(_0x23aa('0x0'));var AWS=require(_0x23aa('0x1'));var rp=require('request-promise');var util=require(_0x23aa('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x23aa('0x3'))(_0x23aa('0x4'));function getTranscriptionJob(_0x556204,_0x38c0ab,_0x5b9038,_0x34a195){return new Promise(function(_0x24a89d,_0x4868c2){var _0x461bde=new AWS[(_0x23aa('0x5'))]({'accessKeyId':_0x38c0ab,'secretAccessKey':_0x556204,'region':_0x5b9038});_0x461bde[_0x23aa('0x6')]({'TranscriptionJobName':_0x34a195},function(_0x5f3efd,_0x41bfc5){if(_0x5f3efd){return _0x4868c2(_0x5f3efd);}else{return _0x24a89d(_0x41bfc5);}});});}function sentiment(_0x3e2a05,_0x23cd87,_0x5c2595,_0x4b8b1a,_0xb70adc){return new Promise(function(_0x5100f4,_0x3f9456){var _0x155c20=new AWS[(_0x23aa('0x7'))]({'accessKeyId':_0x23cd87,'secretAccessKey':_0x3e2a05,'region':_0x5c2595});_0x155c20[_0x23aa('0x8')]({'Text':_0x4b8b1a,'LanguageCode':_0xb70adc[_0x23aa('0x9')](0x0,0x2)},function(_0x459412,_0x402b42){if(_0x459412){return _0x3f9456(_0x459412);}else{return _0x5100f4(_0x402b42);}});});}function checkTranscribeJob(_0x5ed160,_0x4fdd70,_0x4f9c72){var _0x1f71ef;return new BPromise(function(_0x1c664b,_0x109649){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0xc'),_0x5ed160['id'],_0x5ed160[_0x23aa('0xd')]));return getTranscriptionJob(_0x4f9c72[_0x23aa('0xe')],_0x4f9c72['data2'],_0x4fdd70[_0x23aa('0xf')],_0x5ed160['transcribeName'])['then'](function(_0x3cbbde){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x10'),_0x5ed160['id'],_0x5ed160[_0x23aa('0xd')],_0x3cbbde[_0x23aa('0x11')]['TranscriptionJobStatus']));if(!_0x5ed160[_0x23aa('0x12')]){switch(_0x3cbbde[_0x23aa('0x11')]['TranscriptionJobStatus']){case'COMPLETED':var _0x4d660f={'transcribeStatus':_0x3cbbde['TranscriptionJob'][_0x23aa('0x13')],'fileUri':_0x3cbbde[_0x23aa('0x11')][_0x23aa('0x14')]['TranscriptFileUri']};logger[_0x23aa('0xa')](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x5ed160['id']));return rp({'uri':_0x3cbbde[_0x23aa('0x11')][_0x23aa('0x14')][_0x23aa('0x15')],'json':!![]})[_0x23aa('0x16')](function(_0x106bde){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x17'),_0x5ed160['id']));if(_0x106bde&&_0x106bde[_0x23aa('0x18')]&&_0x106bde['results'][_0x23aa('0x19')]&&_0x106bde[_0x23aa('0x18')][_0x23aa('0x19')][_0x23aa('0x1a')]){_0x4d660f['fileText']='';for(var _0x23771b=0x0;_0x23771b<_0x106bde['results'][_0x23aa('0x19')][_0x23aa('0x1a')];_0x23771b++){_0x4d660f[_0x23aa('0x12')]+=_0x106bde['results'][_0x23aa('0x19')][_0x23771b][_0x23aa('0x1b')]+'';}}return _0x5ed160[_0x23aa('0x1c')](_0x4d660f);})[_0x23aa('0x16')](function(){logger[_0x23aa('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5ed160['id']));if(!_0x5ed160[_0x23aa('0x1d')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x20'));}if(!_0x4fdd70[_0x23aa('0x21')]||!_0x4fdd70[_0x23aa('0x22')]||!_0x4fdd70[_0x23aa('0x23')]||!_0x4fdd70[_0x23aa('0x24')]||!_0x4fdd70[_0x23aa('0x25')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x26'));}if(!_0x4d660f[_0x23aa('0x12')]){throw new Error(_0x23aa('0x27'));}if(_0x4fdd70['sentimentAccountId']===_0x4f9c72['id']){return _0x4f9c72;}else{return db['CloudProvider'][_0x23aa('0x28')]({'where':{'id':_settings[_0x23aa('0x22')]}});}})[_0x23aa('0x16')](function(_0x49f23d){if(!_0x49f23d){throw new db['Sequelize'][(_0x23aa('0x1f'))](_0x23aa('0x29'));}if(!_0x49f23d[_0x23aa('0xe')]||!_0x49f23d['data2']){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1f71ef=_0x49f23d;logger[_0x23aa('0xa')](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5ed160['id']));return sentiment(_0x1f71ef[_0x23aa('0xe')],_0x1f71ef[_0x23aa('0x2a')],_0x4fdd70['sentimentRegion'],_0x4d660f[_0x23aa('0x12')],_0x4fdd70[_0x23aa('0x24')]);})[_0x23aa('0x16')](function(_0x230a77){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x2b'),_0x5ed160['id']));return _0x5ed160['update']({'sentiment':_0x230a77[_0x23aa('0x2c')],'sPositive':_0x230a77[_0x23aa('0x2d')][_0x23aa('0x2e')],'sNegative':_0x230a77['SentimentScore']['Negative'],'sMixed':_0x230a77[_0x23aa('0x2d')][_0x23aa('0x2f')],'sNeutral':_0x230a77[_0x23aa('0x2d')]['Neutral']});})[_0x23aa('0x16')](function(){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x30'),_0x5ed160['id']));_0x1c664b();});case _0x23aa('0x31'):return _0x5ed160[_0x23aa('0x1c')]({'transcribeStatus':_0x23aa('0x31'),'failureReason':_0x3cbbde[_0x23aa('0x11')][_0x23aa('0x32')]})[_0x23aa('0x16')](function(){logger[_0x23aa('0xa')](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5ed160['id']));_0x1c664b();});default:logger['info'](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x5ed160['id']));break;}}else{return BPromise['resolve']()[_0x23aa('0x16')](function(){if(!_0x5ed160['tempSentiment']){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x20'));}if(!_0x4fdd70['sentiment']||!_0x4fdd70[_0x23aa('0x22')]||!_0x4fdd70[_0x23aa('0x23')]||!_0x4fdd70[_0x23aa('0x24')]||!_0x4fdd70[_0x23aa('0x25')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x26'));}if(!_0x5ed160['fileText']){throw new Error(_0x23aa('0x27'));}if(_0x4fdd70['sentimentAccountId']===_0x4f9c72['id']){return _0x4f9c72;}else{return db[_0x23aa('0x33')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x284b94){if(!_0x284b94){throw new db['Sequelize']['ValidationError'](_0x23aa('0x29'));}if(!_0x284b94[_0x23aa('0xe')]||!_0x284b94[_0x23aa('0x2a')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1f71ef=_0x284b94;logger['info'](util[_0x23aa('0xb')](_0x23aa('0x34'),_0x5ed160['id']));return sentiment(_0x1f71ef[_0x23aa('0xe')],_0x1f71ef['data2'],_0x4fdd70[_0x23aa('0x23')],_0x5ed160['fileText'],_0x4fdd70[_0x23aa('0x24')]);})[_0x23aa('0x16')](function(_0x26d37d){logger['info'](util[_0x23aa('0xb')](_0x23aa('0x2b'),_0x5ed160['id']));return _0x5ed160['update']({'sentiment':_0x26d37d[_0x23aa('0x2c')],'sPositive':_0x26d37d['SentimentScore'][_0x23aa('0x2e')],'sNegative':_0x26d37d[_0x23aa('0x2d')][_0x23aa('0x35')],'sMixed':_0x26d37d[_0x23aa('0x2d')][_0x23aa('0x2f')],'sNeutral':_0x26d37d['SentimentScore'][_0x23aa('0x36')],'transcribeStatus':_0x23aa('0x37')});})['then'](function(){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x30'),_0x5ed160['id']));_0x1c664b();});}})['catch'](function(_0xf69307){if(_0xf69307){if(!_0xf69307['name']||_0xf69307[_0x23aa('0x38')]!==_0x23aa('0x39')){logger[_0x23aa('0x3a')](util[_0x23aa('0xb')](_0x23aa('0x3b'),_0x5ed160['id']),util['inspect'](_0xf69307,{'showHidden':![],'depth':null}));}}_0x1c664b();});});}function checkTranscribe(){var _0x3b8ec3;var _0x72f912;var _0x5a6653;return db[_0x23aa('0x3c')][_0x23aa('0x3d')]({'where':{'transcribeStatus':_0x23aa('0x3e')}})[_0x23aa('0x16')](function(_0x29985c){if(!_0x29985c||!_0x29985c['length']){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x3f'));}_0x3b8ec3=_0x29985c;return db[_0x23aa('0x40')][_0x23aa('0x28')]({'where':{'id':0x1}});})[_0x23aa('0x16')](function(_0x318fb3){if(!_0x318fb3){throw new db[(_0x23aa('0x1e'))]['ValidationError'](_0x23aa('0x41'));}_0x72f912=_0x318fb3;if(!_0x72f912[_0x23aa('0x4')]||!_0x72f912[_0x23aa('0x42')]||!_0x72f912[_0x23aa('0xf')]||!_0x72f912['language']||!_0x72f912[_0x23aa('0x25')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x43'));}return db['CloudProvider']['findOne']({'where':{'id':_0x72f912[_0x23aa('0x42')]}});})[_0x23aa('0x16')](function(_0x3a9c00){if(!_0x3a9c00){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x29'));}if(!_0x3a9c00[_0x23aa('0xe')]||!_0x3a9c00[_0x23aa('0x2a')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x44'));}_0x5a6653=_0x3a9c00;var _0x243634=[];_0x3b8ec3[_0x23aa('0x45')](function(_0x1effd3){_0x243634[_0x23aa('0x46')](checkTranscribeJob(_0x1effd3,_0x72f912,_0x5a6653));});return BPromise['all'](_0x243634);})[_0x23aa('0x47')](function(_0x72d858){if(_0x72d858){if(!_0x72d858[_0x23aa('0x38')]||_0x72d858[_0x23aa('0x38')]!==_0x23aa('0x39')){logger[_0x23aa('0x3a')](util[_0x23aa('0x48')](_0x72d858,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x3c81=['Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Negative','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','all','start','lodash','aws-sdk','util','bluebird','TranscribeService','Comprehend','detectSentiment','substring','format','data2','transcribeName','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED'];(function(_0x103d3b,_0x1d8bed){var _0x1f65f7=function(_0x275b86){while(--_0x275b86){_0x103d3b['push'](_0x103d3b['shift']());}};_0x1f65f7(++_0x1d8bed);}(_0x3c81,0x102));var _0x13c8=function(_0xa2cd10,_0x4c1955){_0xa2cd10=_0xa2cd10-0x0;var _0x1c86fe=_0x3c81[_0xa2cd10];return _0x1c86fe;};var _=require(_0x13c8('0x0'));var AWS=require(_0x13c8('0x1'));var rp=require('request-promise');var util=require(_0x13c8('0x2'));var BPromise=require(_0x13c8('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x548599,_0x101d4f,_0x3ec886,_0x18bd0f){return new Promise(function(_0x1c16f1,_0x2a4d66){var _0x3f0bd2=new AWS[(_0x13c8('0x4'))]({'accessKeyId':_0x101d4f,'secretAccessKey':_0x548599,'region':_0x3ec886});_0x3f0bd2['getTranscriptionJob']({'TranscriptionJobName':_0x18bd0f},function(_0x17c228,_0x4905c3){if(_0x17c228){return _0x2a4d66(_0x17c228);}else{return _0x1c16f1(_0x4905c3);}});});}function sentiment(_0x380aed,_0x296463,_0x189ce6,_0x30b4d6,_0xaa58b6){return new Promise(function(_0x13c717,_0x29074d){var _0x2ce95a=new AWS[(_0x13c8('0x5'))]({'accessKeyId':_0x296463,'secretAccessKey':_0x380aed,'region':_0x189ce6});_0x2ce95a[_0x13c8('0x6')]({'Text':_0x30b4d6,'LanguageCode':_0xaa58b6[_0x13c8('0x7')](0x0,0x2)},function(_0x2468b3,_0x28417e){if(_0x2468b3){return _0x29074d(_0x2468b3);}else{return _0x13c717(_0x28417e);}});});}function checkTranscribeJob(_0x48c171,_0x5ab91d,_0x21442d){var _0x7b6da8;return new BPromise(function(_0x2304b5,_0x1f9b6f){logger['info'](util[_0x13c8('0x8')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x48c171['id'],_0x48c171['transcribeName']));return getTranscriptionJob(_0x21442d['data1'],_0x21442d[_0x13c8('0x9')],_0x5ab91d['transcribeRegion'],_0x48c171[_0x13c8('0xa')])[_0x13c8('0xb')](function(_0x23f64e){logger[_0x13c8('0xc')](util['format'](_0x13c8('0xd'),_0x48c171['id'],_0x48c171[_0x13c8('0xa')],_0x23f64e[_0x13c8('0xe')][_0x13c8('0xf')]));if(!_0x48c171[_0x13c8('0x10')]){switch(_0x23f64e[_0x13c8('0xe')][_0x13c8('0xf')]){case _0x13c8('0x11'):var _0x34fbc0={'transcribeStatus':_0x23f64e[_0x13c8('0xe')][_0x13c8('0xf')],'fileUri':_0x23f64e['TranscriptionJob'][_0x13c8('0x12')][_0x13c8('0x13')]};logger[_0x13c8('0xc')](util[_0x13c8('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x48c171['id']));return rp({'uri':_0x23f64e[_0x13c8('0xe')][_0x13c8('0x12')][_0x13c8('0x13')],'json':!![]})[_0x13c8('0xb')](function(_0x436d5d){logger[_0x13c8('0xc')](util['format'](_0x13c8('0x14'),_0x48c171['id']));if(_0x436d5d&&_0x436d5d[_0x13c8('0x15')]&&_0x436d5d[_0x13c8('0x15')][_0x13c8('0x16')]&&_0x436d5d['results'][_0x13c8('0x16')][_0x13c8('0x17')]){_0x34fbc0['fileText']='';for(var _0x49b552=0x0;_0x49b552<_0x436d5d[_0x13c8('0x15')][_0x13c8('0x16')]['length'];_0x49b552++){_0x34fbc0['fileText']+=_0x436d5d[_0x13c8('0x15')][_0x13c8('0x16')][_0x49b552]['transcript']+'';}}return _0x48c171['update'](_0x34fbc0);})[_0x13c8('0xb')](function(){logger['info'](util['format'](_0x13c8('0x18'),_0x48c171['id']));if(!_0x48c171[_0x13c8('0x19')]){throw new db[(_0x13c8('0x1a'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5ab91d[_0x13c8('0x1b')]||!_0x5ab91d[_0x13c8('0x1c')]||!_0x5ab91d[_0x13c8('0x1d')]||!_0x5ab91d[_0x13c8('0x1e')]||!_0x5ab91d[_0x13c8('0x1f')]){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x34fbc0[_0x13c8('0x10')]){throw new Error(_0x13c8('0x21'));}if(_0x5ab91d['sentimentAccountId']===_0x21442d['id']){return _0x21442d;}else{return db['CloudProvider'][_0x13c8('0x22')]({'where':{'id':_settings[_0x13c8('0x1c')]}});}})['then'](function(_0x222f55){if(!_0x222f55){throw new db[(_0x13c8('0x1a'))]['ValidationError'](_0x13c8('0x23'));}if(!_0x222f55[_0x13c8('0x24')]||!_0x222f55[_0x13c8('0x9')]){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x25'));}_0x7b6da8=_0x222f55;logger[_0x13c8('0xc')](util[_0x13c8('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x48c171['id']));return sentiment(_0x7b6da8['data1'],_0x7b6da8[_0x13c8('0x9')],_0x5ab91d[_0x13c8('0x1d')],_0x34fbc0['fileText'],_0x5ab91d[_0x13c8('0x1e')]);})['then'](function(_0x1fdf7d){logger['info'](util[_0x13c8('0x8')](_0x13c8('0x26'),_0x48c171['id']));return _0x48c171[_0x13c8('0x27')]({'sentiment':_0x1fdf7d[_0x13c8('0x28')],'sPositive':_0x1fdf7d[_0x13c8('0x29')][_0x13c8('0x2a')],'sNegative':_0x1fdf7d[_0x13c8('0x29')]['Negative'],'sMixed':_0x1fdf7d[_0x13c8('0x29')][_0x13c8('0x2b')],'sNeutral':_0x1fdf7d['SentimentScore'][_0x13c8('0x2c')]});})[_0x13c8('0xb')](function(){logger[_0x13c8('0xc')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x48c171['id']));_0x2304b5();});case'FAILED':return _0x48c171[_0x13c8('0x27')]({'transcribeStatus':_0x13c8('0x2d'),'failureReason':_0x23f64e[_0x13c8('0xe')][_0x13c8('0x2e')]})[_0x13c8('0xb')](function(){logger[_0x13c8('0xc')](util[_0x13c8('0x8')](_0x13c8('0x18'),_0x48c171['id']));_0x2304b5();});default:logger[_0x13c8('0xc')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x48c171['id']));break;}}else{return BPromise[_0x13c8('0x2f')]()[_0x13c8('0xb')](function(){if(!_0x48c171[_0x13c8('0x19')]){throw new db[(_0x13c8('0x1a'))]['ValidationError'](_0x13c8('0x30'));}if(!_0x5ab91d['sentiment']||!_0x5ab91d[_0x13c8('0x1c')]||!_0x5ab91d[_0x13c8('0x1d')]||!_0x5ab91d[_0x13c8('0x1e')]||!_0x5ab91d[_0x13c8('0x1f')]){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x31'));}if(!_0x48c171[_0x13c8('0x10')]){throw new Error(_0x13c8('0x21'));}if(_0x5ab91d[_0x13c8('0x1c')]===_0x21442d['id']){return _0x21442d;}else{return db[_0x13c8('0x32')][_0x13c8('0x22')]({'where':{'id':_settings[_0x13c8('0x1c')]}});}})[_0x13c8('0xb')](function(_0x32250a){if(!_0x32250a){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x23'));}if(!_0x32250a[_0x13c8('0x24')]||!_0x32250a[_0x13c8('0x9')]){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x25'));}_0x7b6da8=_0x32250a;logger[_0x13c8('0xc')](util[_0x13c8('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x48c171['id']));return sentiment(_0x7b6da8[_0x13c8('0x24')],_0x7b6da8[_0x13c8('0x9')],_0x5ab91d[_0x13c8('0x1d')],_0x48c171[_0x13c8('0x10')],_0x5ab91d[_0x13c8('0x1e')]);})['then'](function(_0x53b8db){logger[_0x13c8('0xc')](util[_0x13c8('0x8')](_0x13c8('0x26'),_0x48c171['id']));return _0x48c171['update']({'sentiment':_0x53b8db['Sentiment'],'sPositive':_0x53b8db['SentimentScore'][_0x13c8('0x2a')],'sNegative':_0x53b8db['SentimentScore'][_0x13c8('0x33')],'sMixed':_0x53b8db['SentimentScore'][_0x13c8('0x2b')],'sNeutral':_0x53b8db[_0x13c8('0x29')][_0x13c8('0x2c')],'transcribeStatus':_0x13c8('0x11')});})[_0x13c8('0xb')](function(){logger[_0x13c8('0xc')](util['format'](_0x13c8('0x18'),_0x48c171['id']));_0x2304b5();});}})[_0x13c8('0x34')](function(_0x47fa17){if(_0x47fa17){if(!_0x47fa17[_0x13c8('0x35')]||_0x47fa17[_0x13c8('0x35')]!==_0x13c8('0x36')){logger[_0x13c8('0x37')](util[_0x13c8('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x48c171['id']),util[_0x13c8('0x38')](_0x47fa17,{'showHidden':![],'depth':null}));}}_0x2304b5();});});}function checkTranscribe(){var _0x32914b;var _0x2e94ae;var _0x38418b;return db[_0x13c8('0x39')]['findAll']({'where':{'transcribeStatus':_0x13c8('0x3a')}})[_0x13c8('0xb')](function(_0x76c631){if(!_0x76c631||!_0x76c631[_0x13c8('0x17')]){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x3b'));}_0x32914b=_0x76c631;return db[_0x13c8('0x3c')][_0x13c8('0x22')]({'where':{'id':0x1}});})[_0x13c8('0xb')](function(_0x266f4e){if(!_0x266f4e){throw new db['Sequelize'][(_0x13c8('0x20'))](_0x13c8('0x3d'));}_0x2e94ae=_0x266f4e;if(!_0x2e94ae[_0x13c8('0x3e')]||!_0x2e94ae[_0x13c8('0x3f')]||!_0x2e94ae[_0x13c8('0x40')]||!_0x2e94ae[_0x13c8('0x1e')]||!_0x2e94ae['bucket']){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x41'));}return db['CloudProvider']['findOne']({'where':{'id':_0x2e94ae[_0x13c8('0x3f')]}});})[_0x13c8('0xb')](function(_0x55d353){if(!_0x55d353){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x55d353[_0x13c8('0x24')]||!_0x55d353['data2']){throw new db[(_0x13c8('0x1a'))][(_0x13c8('0x20'))](_0x13c8('0x25'));}_0x38418b=_0x55d353;var _0x49b2f2=[];_0x32914b[_0x13c8('0x42')](function(_0x45768f){_0x49b2f2['push'](checkTranscribeJob(_0x45768f,_0x2e94ae,_0x38418b));});return BPromise[_0x13c8('0x43')](_0x49b2f2);})['catch'](function(_0x95289e){if(_0x95289e){if(!_0x95289e[_0x13c8('0x35')]||_0x95289e[_0x13c8('0x35')]!==_0x13c8('0x36')){logger[_0x13c8('0x37')](util['inspect'](_0x95289e,{'showHidden':![],'depth':null}));}}});}exports[_0x13c8('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 226fbd2..9dfce09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7157=['WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0x7157,0x1b0));var _0x7715=function(_0x5cb93d,_0x4394e0){_0x5cb93d=_0x5cb93d-0x0;var _0x1e536a=_0x7157[_0x5cb93d];return _0x1e536a;};'use strict';var _=require(_0x7715('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x7715('0x1'));var config=require(_0x7715('0x2'));var db=require(_0x7715('0x3'))['db'];var logger=require('../logger')(_0x7715('0x4'));config[_0x7715('0x5')]=_[_0x7715('0x6')](config[_0x7715('0x5')],{'host':_0x7715('0x7'),'port':0x18eb});var io=require(_0x7715('0x8'))(new Redis(config[_0x7715('0x5')]));function closeInteractions(){var _0x7da6c1=[];return db['WhatsappInteraction'][_0x7715('0x9')]({'raw':!![],'attributes':['id',_0x7715('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7715('0xb')](0x18,_0x7715('0xc'))}}})[_0x7715('0xd')](function(_0x4af6e1){if(_0x4af6e1&&_0x4af6e1[_0x7715('0xe')]){_0x7da6c1=_[_0x7715('0xf')](_0x4af6e1||[],'id');logger[_0x7715('0x10')](_0x7715('0x11'),_0x7da6c1['join']());return db[_0x7715('0x12')][_0x7715('0x13')]({'closeReason':'system','disposition':_0x7715('0x14'),'closed':!![],'closedAt':moment()[_0x7715('0x15')](_0x7715('0x16'))},{'where':{'id':_0x7da6c1}});}})[_0x7715('0xd')](function(){if(_0x7da6c1&&_0x7da6c1['length']){logger[_0x7715('0x10')](_0x7715('0x17'),_0x7da6c1[_0x7715('0x18')]());for(var _0x3ea273=0x0;_0x3ea273<_0x7da6c1['length'];_0x3ea273++){io[_0x7715('0x19')]('whatsappInteraction:update',{'id':_0x7da6c1[_0x3ea273],'closed':!![]});}}})[_0x7715('0x1a')](function(_0x5b13b5){logger[_0x7715('0x1b')](_0x7715('0x1c'),_0x5b13b5?util[_0x7715('0x1d')](_0x5b13b5,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x799a=['../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','util'];(function(_0x3175d9,_0x15cf7c){var _0x4a29bc=function(_0x47eb5b){while(--_0x47eb5b){_0x3175d9['push'](_0x3175d9['shift']());}};_0x4a29bc(++_0x15cf7c);}(_0x799a,0xa6));var _0xa799=function(_0x22ec2b,_0x1c470b){_0x22ec2b=_0x22ec2b-0x0;var _0x43435b=_0x799a[_0x22ec2b];return _0x43435b;};'use strict';var _=require('lodash');var moment=require(_0xa799('0x0'));var Redis=require('ioredis');var util=require(_0xa799('0x1'));var config=require(_0xa799('0x2'));var db=require(_0xa799('0x3'))['db'];var logger=require(_0xa799('0x4'))('schedule');config[_0xa799('0x5')]=_['defaults'](config[_0xa799('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa799('0x6'))(new Redis(config[_0xa799('0x5')]));function closeInteractions(){var _0x18b5e2=[];return db[_0xa799('0x7')][_0xa799('0x8')]({'raw':!![],'attributes':['id',_0xa799('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa799('0xa')](0x18,_0xa799('0xb'))}}})[_0xa799('0xc')](function(_0x295318){if(_0x295318&&_0x295318['length']){_0x18b5e2=_[_0xa799('0xd')](_0x295318||[],'id');logger[_0xa799('0xe')](_0xa799('0xf'),_0x18b5e2[_0xa799('0x10')]());return db['WhatsappInteraction']['update']({'closeReason':_0xa799('0x11'),'disposition':_0xa799('0x12'),'closed':!![],'closedAt':moment()[_0xa799('0x13')](_0xa799('0x14'))},{'where':{'id':_0x18b5e2}});}})[_0xa799('0xc')](function(){if(_0x18b5e2&&_0x18b5e2[_0xa799('0x15')]){logger[_0xa799('0xe')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x18b5e2[_0xa799('0x10')]());for(var _0x5f3bae=0x0;_0x5f3bae<_0x18b5e2['length'];_0x5f3bae++){io[_0xa799('0x16')](_0xa799('0x17'),{'id':_0x18b5e2[_0x5f3bae],'closed':!![]});}}})['catch'](function(_0x1e8d48){logger[_0xa799('0x18')](_0xa799('0x19'),_0x1e8d48?util[_0xa799('0x1a')](_0x1e8d48,{'showHidden':![],'depth':null}):'');});}exports[_0xa799('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 99192b2..5c7d513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e0e=['CmHopper','destroy','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x12f42c,_0x415b84){var _0xbcf616=function(_0x242128){while(--_0x242128){_0x12f42c['push'](_0x12f42c['shift']());}};_0xbcf616(++_0x415b84);}(_0x0e0e,0x15b));var _0xe0e0=function(_0x443cef,_0x2cd289){_0x443cef=_0x443cef-0x0;var _0x147c47=_0x0e0e[_0x443cef];return _0x147c47;};'use strict';var util=require(_0xe0e0('0x0'));var db=require(_0xe0e0('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe0e0('0x2')]({'id':i,'firstName':_0xe0e0('0x3')+i,'lastName':_0xe0e0('0x4')+i,'phone':0xf879fb460+i,'email':_0xe0e0('0x5')+i+_0xe0e0('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe0e0('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe0e0('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe0e0('0x7')](),'updatedAt':Date[_0xe0e0('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe0e0('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xe0e0('0x4')+i,'phone':0xf879fb460+i,'email':_0xe0e0('0x5')+i+_0xe0e0('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe0e0('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe0e0('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe0e0('0x7')](),'updatedAt':Date[_0xe0e0('0x7')]()});}db[_0xe0e0('0x8')]['destroy']({'where':{}})[_0xe0e0('0x9')](function(){return db[_0xe0e0('0x8')][_0xe0e0('0xa')](contacts);})[_0xe0e0('0x9')](function(){console[_0xe0e0('0xb')](_0xe0e0('0xc'),_0xe0e0('0xd'));return db[_0xe0e0('0xe')][_0xe0e0('0xf')]({'where':{}});})[_0xe0e0('0x9')](function(){return db[_0xe0e0('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0xe0e0('0xb')](_0xe0e0('0xc'),'hopper1');return db[_0xe0e0('0x8')]['bulkCreate'](contacts2);})[_0xe0e0('0x9')](function(){console[_0xe0e0('0xb')](_0xe0e0('0xc'),_0xe0e0('0x10'));return db[_0xe0e0('0xe')][_0xe0e0('0xa')](hopper2);})[_0xe0e0('0x9')](function(){console[_0xe0e0('0xb')](_0xe0e0('0xc'),_0xe0e0('0x11'));})[_0xe0e0('0x12')](function(_0x7c0645){console[_0xe0e0('0xb')](_0x7c0645);});
\ No newline at end of file
+var _0x7877=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','CmHopper','hopper1','contacts2'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7877,0x9a));var _0x7787=function(_0x50d8da,_0xe56e5b){_0x50d8da=_0x50d8da-0x0;var _0x1b55bb=_0x7877[_0x50d8da];return _0x1b55bb;};'use strict';var util=require(_0x7787('0x0'));var db=require(_0x7787('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7787('0x2')]({'id':i,'firstName':_0x7787('0x3')+i,'lastName':_0x7787('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7787('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7787('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7787('0x6')](),'updatedAt':Date[_0x7787('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x7787('0x3')+i,'lastName':_0x7787('0x4')+i,'phone':0xf879fb460+i,'email':_0x7787('0x7')+i+_0x7787('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7787('0x6')](),'updatedAt':Date['now']()});}db[_0x7787('0x8')][_0x7787('0x9')]({'where':{}})[_0x7787('0xa')](function(){return db['CmContact'][_0x7787('0xb')](contacts);})[_0x7787('0xa')](function(){console[_0x7787('0xc')](_0x7787('0xd'),'contacts1');return db['CmHopper'][_0x7787('0x9')]({'where':{}});})['then'](function(){return db[_0x7787('0xe')][_0x7787('0xb')](hopper);})[_0x7787('0xa')](function(){console[_0x7787('0xc')](_0x7787('0xd'),_0x7787('0xf'));return db[_0x7787('0x8')][_0x7787('0xb')](contacts2);})[_0x7787('0xa')](function(){console[_0x7787('0xc')](_0x7787('0xd'),_0x7787('0x10'));return db['CmHopper'][_0x7787('0xb')](hopper2);})[_0x7787('0xa')](function(){console[_0x7787('0xc')](_0x7787('0xd'),_0x7787('0x11'));})[_0x7787('0x12')](function(_0x1b985a){console[_0x7787('0xc')](_0x1b985a);});
\ No newline at end of file
index f8f2071..3889557 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d4=['actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key'];(function(_0x53c009,_0x4bacdf){var _0x389962=function(_0x4960e7){while(--_0x4960e7){_0x53c009['push'](_0x53c009['shift']());}};_0x389962(++_0x4bacdf);}(_0x85d4,0xef));var _0x485d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x85d4[_0x465a0c];return _0x1e202e;};'use strict';var util=require(_0x485d('0x0'));var db=require(_0x485d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x485d('0x2')]({'name':util[_0x485d('0x3')](_0x485d('0x4'),_0x485d('0x5'),i),'fullname':util[_0x485d('0x3')](_0x485d('0x4'),'agent',i),'email':util['format']('%s%s@xcally.com',_0x485d('0x5'),i),'role':_0x485d('0x5'),'password':'password','internal':0xfa0+i,'type':_0x485d('0x6'),'transport':[_0x485d('0x7'),'ws',_0x485d('0x8')],'disallow':[_0x485d('0x9')],'allow':[_0x485d('0xa')],'defaultuser':util[_0x485d('0x3')]('%s%s',_0x485d('0x5'),i),'encryption':_0x485d('0xb'),'avpf':'yes','force_avp':_0x485d('0xb'),'icesupport':'yes','dtlsenable':_0x485d('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x485d('0xc'),'dtlssetup':_0x485d('0xd'),'callerid':util[_0x485d('0x3')](_0x485d('0xe'),util[_0x485d('0x3')](_0x485d('0x4'),_0x485d('0x5'),i),0xfa0+i)});}db[_0x485d('0xf')][_0x485d('0x10')](users)[_0x485d('0x11')](function(){console[_0x485d('0x12')](_0x485d('0x13'));})[_0x485d('0x14')](function(_0x715288){console[_0x485d('0x12')](_0x715288);});
\ No newline at end of file
+var _0x889f=['%s%s@xcally.com','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','%s%s','format','agent'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x889f,0x19a));var _0xf889=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x889f[_0x468b0f];return _0x3e74d9;};'use strict';var util=require(_0xf889('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xf889('0x1'),'agent',i),'fullname':util[_0xf889('0x2')](_0xf889('0x1'),_0xf889('0x3'),i),'email':util['format'](_0xf889('0x4'),'agent',i),'role':'agent','password':_0xf889('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xf889('0x6'),'ws',_0xf889('0x7')],'disallow':['all'],'allow':[_0xf889('0x8')],'defaultuser':util[_0xf889('0x2')](_0xf889('0x1'),'agent',i),'encryption':_0xf889('0x9'),'avpf':_0xf889('0x9'),'force_avp':_0xf889('0x9'),'icesupport':'yes','dtlsenable':_0xf889('0x9'),'dtlsverify':'no','dtlscertfile':_0xf889('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf889('0xb'),'callerid':util[_0xf889('0x2')](_0xf889('0xc'),util[_0xf889('0x2')](_0xf889('0x1'),'agent',i),0xfa0+i)});}db[_0xf889('0xd')]['bulkCreate'](users)[_0xf889('0xe')](function(){console[_0xf889('0xf')](_0xf889('0x10'));})[_0xf889('0x11')](function(_0x5d9c86){console[_0xf889('0xf')](_0x5d9c86);});
\ No newline at end of file
index f1a3f4d..1eb3d2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae3=['user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','SmsQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','mail','openchannel','telephone:%s','campaign:%s:%s','removeChatInteractions','emit','MailInteractions','removeMailInteractions','leave','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','length'];(function(_0x44faf5,_0x1f0f92){var _0x4c0a90=function(_0x46f01e){while(--_0x46f01e){_0x44faf5['push'](_0x44faf5['shift']());}};_0x4c0a90(++_0x1f0f92);}(_0xfae3,0xa1));var _0x3fae=function(_0x4a055e,_0x59b80a){_0x4a055e=_0x4a055e-0x0;var _0x328a29=_0xfae3[_0x4a055e];return _0x328a29;};'use strict';var _=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var BPromise=require(_0x3fae('0x2'));var db=require(_0x3fae('0x3'))['db'];var config=require(_0x3fae('0x4'));var queryQueues={'attributes':['id',_0x3fae('0x5')],'include':[{'as':_0x3fae('0x6'),'model':db[_0x3fae('0x7')],'attributes':['id',_0x3fae('0x5'),_0x3fae('0x8')],'raw':!![],'where':{'role':_0x3fae('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x3fae('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x3fae('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x3fae('0x5'),_0x3fae('0xb')],'where':{'type':'ivr'}};function getAssociatedResources(_0x467a88,_0x407291,_0x140ab3){return db[_0x3fae('0xc')][_0x3fae('0xd')]({'where':{'name':_0x467a88,'userProfileId':_0x407291},'raw':!![]})[_0x3fae('0xe')](function(_0x337e87){if(_0x337e87){if(_0x337e87[_0x3fae('0xf')]){switch(_0x467a88){case _0x3fae('0x10'):case _0x3fae('0x11'):case _0x3fae('0x12'):case _0x3fae('0x13'):case _0x3fae('0x14'):case'OpenchannelQueues':case _0x3fae('0x15'):return db[_0x140ab3]['findAll'](queryQueues);case _0x3fae('0x16'):return db[_0x140ab3][_0x3fae('0x17')](queryTelephones);case _0x3fae('0x18'):return db[_0x140ab3][_0x3fae('0x17')](queryTrunks);case _0x3fae('0x19'):return db[_0x140ab3][_0x3fae('0x17')](queryCampaigns);}}else{return db[_0x3fae('0x1a')][_0x3fae('0x17')]({'attributes':[_0x3fae('0x1b')],'where':{'sectionId':_0x337e87['id']},'raw':!![]})[_0x3fae('0xe')](function(_0x22fb9f){if(_0x22fb9f){var _0x20513e={'where':{'id':_[_0x3fae('0x1c')](_0x22fb9f,_0x3fae('0x1b'))},'raw':!![]};switch(_0x140ab3){case _0x3fae('0x7'):_0x20513e[_0x3fae('0x1d')][_0x3fae('0x8')]=_0x3fae('0xa');break;case _0x3fae('0x1e'):_0x20513e[_0x3fae('0x1d')]['type']='ivr';break;}return db[_0x140ab3][_0x3fae('0x17')](_0x20513e);}else{return[];}});}}else{return[];}})[_0x3fae('0xe')](function(_0xd35136){return _0xd35136;});}function joinOrLeaveQueues(_0x4e8a2e,_0x2b3397,_0x89ed35,_0x4072fa){_0x4e8a2e[_0x2b3397](util[_0x3fae('0x1f')]('%s:queue:%s',_0x89ed35,_0x4072fa['name']));if(_0x4072fa[_0x3fae('0x6')]){for(var _0x141158=0x0;_0x141158<_0x4072fa[_0x3fae('0x6')][_0x3fae('0x20')];_0x141158+=0x1){_0x4e8a2e[_0x2b3397](util[_0x3fae('0x1f')](_0x3fae('0x21'),_0x4072fa[_0x3fae('0x6')][_0x141158][_0x3fae('0x5')]));}}}function joinOrLeave(_0x213fc8,_0x25963c,_0x10b996){var _0x3a98f4;if(_0x213fc8[_0x3fae('0x22')][_0x3fae('0x23')]['id']){db['User'][_0x3fae('0x24')]({'attributes':['id',_0x3fae('0x5'),_0x3fae('0x8'),_0x3fae('0x25')],'where':{'id':_0x213fc8[_0x3fae('0x22')][_0x3fae('0x23')]['id']},'include':[{'model':db[_0x3fae('0x26')],'as':_0x3fae('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x3fae('0x28')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x3fae('0x29')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x3fae('0x2a')],'as':_0x3fae('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x3fae('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x3fae('0x2d')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x3fae('0xe')](function(_0x133a5c){if(_0x133a5c){_0x3a98f4=_0x133a5c;_0x213fc8[_0x25963c](util[_0x3fae('0x1f')](_0x3fae('0x21'),_0x133a5c[_0x3fae('0x5')]));var _0x33bb52=[];switch(_0x133a5c[_0x3fae('0x8')]){case _0x3fae('0x2e'):_0x213fc8[_0x25963c](_0x3fae('0x2f'));_0x213fc8[_0x25963c](_0x3fae('0x30'));if(queryQueues[_0x3fae('0x31')]('include')){delete queryQueues[_0x3fae('0x32')];}_0x33bb52[_0x3fae('0x33')](db[_0x3fae('0x34')][_0x3fae('0x17')](queryQueues));_0x33bb52['push'](db[_0x3fae('0x35')]['findAll'](queryQueues));_0x33bb52['push'](db[_0x3fae('0x36')]['findAll'](queryQueues));_0x33bb52['push'](db['SmsQueue'][_0x3fae('0x17')](queryQueues));_0x33bb52['push'](db[_0x3fae('0x37')][_0x3fae('0x17')](queryQueues));_0x33bb52[_0x3fae('0x33')](db[_0x3fae('0x38')][_0x3fae('0x17')](queryQueues));_0x33bb52['push'](db[_0x3fae('0x39')][_0x3fae('0x17')](queryQueues));_0x33bb52[_0x3fae('0x33')](db[_0x3fae('0x7')][_0x3fae('0x17')](queryTelephones));_0x33bb52['push'](db[_0x3fae('0x3a')][_0x3fae('0x17')](queryTrunks));_0x33bb52[_0x3fae('0x33')](db[_0x3fae('0x1e')][_0x3fae('0x17')](queryCampaigns));_0x33bb52['push'](db[_0x3fae('0x7')]['findAll'](queryAgents));break;case _0x3fae('0x3b'):_0x213fc8[_0x25963c](_0x3fae('0x2f'));_0x213fc8[_0x25963c](_0x3fae('0x30'));_0x33bb52['push'](getAssociatedResources(_0x3fae('0x10'),_0x133a5c[_0x3fae('0x25')],_0x3fae('0x34')));_0x33bb52['push'](getAssociatedResources('ChatQueues',_0x133a5c[_0x3fae('0x25')],_0x3fae('0x35')));_0x33bb52[_0x3fae('0x33')](getAssociatedResources('FaxQueues',_0x133a5c[_0x3fae('0x25')],_0x3fae('0x36')));_0x33bb52[_0x3fae('0x33')](getAssociatedResources(_0x3fae('0x13'),_0x133a5c['userProfileId'],_0x3fae('0x3c')));_0x33bb52[_0x3fae('0x33')](getAssociatedResources(_0x3fae('0x14'),_0x133a5c[_0x3fae('0x25')],'MailQueue'));_0x33bb52[_0x3fae('0x33')](getAssociatedResources(_0x3fae('0x3d'),_0x133a5c[_0x3fae('0x25')],_0x3fae('0x38')));_0x33bb52[_0x3fae('0x33')](getAssociatedResources('WhatsappQueues',_0x133a5c[_0x3fae('0x25')],_0x3fae('0x39')));_0x33bb52['push'](getAssociatedResources(_0x3fae('0x16'),_0x133a5c[_0x3fae('0x25')],'User'));_0x33bb52['push'](getAssociatedResources('Trunks',_0x133a5c[_0x3fae('0x25')],_0x3fae('0x3a')));_0x33bb52[_0x3fae('0x33')](getAssociatedResources(_0x3fae('0x19'),_0x133a5c['userProfileId'],_0x3fae('0x1e')));_0x33bb52[_0x3fae('0x33')](db[_0x3fae('0x7')]['findAll'](queryAgents));break;case _0x3fae('0x9'):_0x213fc8[_0x25963c](_0x3fae('0x2f'));_0x213fc8[_0x25963c](_0x3fae('0x30'));_0x33bb52['push'](_0x133a5c[_0x3fae('0x3e')]({'attributes':['id',_0x3fae('0x5')]}));_0x33bb52[_0x3fae('0x33')](_0x133a5c[_0x3fae('0x3f')]({'attributes':['id','name']}));_0x33bb52[_0x3fae('0x33')](_0x133a5c[_0x3fae('0x40')]({'attributes':['id',_0x3fae('0x5')]}));_0x33bb52['push'](_0x133a5c[_0x3fae('0x41')]({'attributes':['id',_0x3fae('0x5')]}));_0x33bb52[_0x3fae('0x33')](_0x133a5c[_0x3fae('0x42')]({'attributes':['id',_0x3fae('0x5')]}));_0x33bb52['push'](_0x133a5c[_0x3fae('0x43')]({'attributes':['id','name']}));_0x33bb52['push'](_0x133a5c['getWhatsappQueues']({'attributes':['id',_0x3fae('0x5')]}));break;}return BPromise[_0x3fae('0x44')](_0x33bb52);}})[_0x3fae('0xe')](function(_0x4e3f30){if(_0x4e3f30&&_0x4e3f30[_0x3fae('0x20')]){for(var _0x207ff1=0x0;_0x207ff1<_0x4e3f30['length'];_0x207ff1+=0x1){for(var _0x1ce022=0x0;_0x1ce022<_0x4e3f30[_0x207ff1][_0x3fae('0x20')];_0x1ce022+=0x1){switch(_0x207ff1){case 0x0:joinOrLeaveQueues(_0x213fc8,_0x25963c,'voice',_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x1:joinOrLeaveQueues(_0x213fc8,_0x25963c,'chat',_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x2:joinOrLeaveQueues(_0x213fc8,_0x25963c,'fax',_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x3:joinOrLeaveQueues(_0x213fc8,_0x25963c,'sms',_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x4:joinOrLeaveQueues(_0x213fc8,_0x25963c,_0x3fae('0x45'),_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x5:joinOrLeaveQueues(_0x213fc8,_0x25963c,_0x3fae('0x46'),_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x6:joinOrLeaveQueues(_0x213fc8,_0x25963c,'whatsapp',_0x4e3f30[_0x207ff1][_0x1ce022]);break;case 0x7:if(_0x3a98f4[_0x3fae('0x8')]!==_0x3fae('0x9'))_0x213fc8[_0x25963c](util[_0x3fae('0x1f')](_0x3fae('0x47'),_0x4e3f30[_0x207ff1][_0x1ce022][_0x3fae('0x5')]));break;case 0x8:if(_0x3a98f4[_0x3fae('0x8')]!==_0x3fae('0x9'))_0x213fc8[_0x25963c](util['format']('trunk:%s',_0x4e3f30[_0x207ff1][_0x1ce022]['name']));break;case 0x9:if(_0x3a98f4[_0x3fae('0x8')]!==_0x3fae('0x9'))_0x213fc8[_0x25963c](util[_0x3fae('0x1f')](_0x3fae('0x48'),_0x4e3f30[_0x207ff1][_0x1ce022][_0x3fae('0xb')],_0x4e3f30[_0x207ff1][_0x1ce022][_0x3fae('0x5')]));break;case 0xa:_0x213fc8[_0x25963c](util[_0x3fae('0x1f')](_0x3fae('0x21'),_0x4e3f30[_0x207ff1][_0x1ce022][_0x3fae('0x5')]));break;}}}}})[_0x3fae('0xe')](function(){if(_0x25963c==='leave'){var _0x406f7a=_[_0x3fae('0x1c')](_0x3a98f4['ChatInteractions'],'id');return _0x3a98f4[_0x3fae('0x49')](_0x406f7a)[_0x3fae('0xe')](function(){for(var _0x2909c1=0x0;_0x2909c1<_0x406f7a[_0x3fae('0x20')];_0x2909c1+=0x1){_0x10b996[_0x3fae('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x406f7a[_0x2909c1]),'UserId':Number(_0x3a98f4['id'])});}});}})[_0x3fae('0xe')](function(){if(_0x25963c==='leave'){var _0x229544=_[_0x3fae('0x1c')](_0x3a98f4[_0x3fae('0x4b')],'id');return _0x3a98f4[_0x3fae('0x4c')](_0x229544)[_0x3fae('0xe')](function(){for(var _0x4c6d9b=0x0;_0x4c6d9b<_0x229544['length'];_0x4c6d9b+=0x1){_0x10b996['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x229544[_0x4c6d9b]),'UserId':Number(_0x3a98f4['id'])});}});}})['then'](function(){if(_0x25963c===_0x3fae('0x4d')){var _0x4535a7=_['map'](_0x3a98f4[_0x3fae('0x4e')],'id');return _0x3a98f4[_0x3fae('0x4f')](_0x4535a7)['then'](function(){for(var _0x45be37=0x0;_0x45be37<_0x4535a7[_0x3fae('0x20')];_0x45be37+=0x1){_0x10b996[_0x3fae('0x4a')](_0x3fae('0x50'),{'FaxInteractionId':Number(_0x4535a7[_0x45be37]),'UserId':Number(_0x3a98f4['id'])});}});}})[_0x3fae('0xe')](function(){if(_0x25963c===_0x3fae('0x4d')){var _0x185bde=_['map'](_0x3a98f4['SmsInteractions'],'id');return _0x3a98f4['removeSmsInteractions'](_0x185bde)['then'](function(){for(var _0xdbd5f1=0x0;_0xdbd5f1<_0x185bde[_0x3fae('0x20')];_0xdbd5f1+=0x1){_0x10b996[_0x3fae('0x4a')](_0x3fae('0x51'),{'SmsInteractionId':Number(_0x185bde[_0xdbd5f1]),'UserId':Number(_0x3a98f4['id'])});}});}})[_0x3fae('0xe')](function(){if(_0x25963c===_0x3fae('0x4d')){var _0x10ab8a=_[_0x3fae('0x1c')](_0x3a98f4[_0x3fae('0x2c')],'id');return _0x3a98f4[_0x3fae('0x52')](_0x10ab8a)[_0x3fae('0xe')](function(){for(var _0x4d2fb7=0x0;_0x4d2fb7<_0x10ab8a['length'];_0x4d2fb7+=0x1){_0x10b996[_0x3fae('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x10ab8a[_0x4d2fb7]),'UserId':Number(_0x3a98f4['id'])});}});}})[_0x3fae('0xe')](function(){if(_0x25963c==='leave'){var _0x3d6fdf=_[_0x3fae('0x1c')](_0x3a98f4[_0x3fae('0x53')],'id');return _0x3a98f4[_0x3fae('0x54')](_0x3d6fdf)[_0x3fae('0xe')](function(){for(var _0x49f9e7=0x0;_0x49f9e7<_0x3d6fdf[_0x3fae('0x20')];_0x49f9e7+=0x1){_0x10b996['emit'](_0x3fae('0x55'),{'WhatsappInteractionId':Number(_0x3d6fdf[_0x49f9e7]),'UserId':Number(_0x3a98f4['id'])});}});}})['catch'](function(_0x581d00){_0x213fc8[_0x3fae('0x56')](_0x581d00);});}}function onDisconnect(_0x4b722d,_0x3db33e){joinOrLeave(_0x4b722d,_0x3fae('0x4d'),_0x3db33e);}function onConnect(_0x3846cb){joinOrLeave(_0x3846cb,_0x3fae('0x57'));}exports['default']=function(_0x503f25){_0x503f25['on'](_0x3fae('0x58'),function(_0x407d81){_0x407d81[_0x3fae('0x59')](0x0);_0x407d81[_0x3fae('0x5a')]=_0x407d81[_0x3fae('0x5b')][_0x3fae('0x58')][_0x3fae('0x5c')]+':'+_0x407d81[_0x3fae('0x5b')]['connection'][_0x3fae('0x5d')];_0x407d81['connectedAt']=new Date();_0x407d81[_0x3fae('0x56')]=function(_0x2f2cd8){console[_0x3fae('0x56')](_0x3fae('0x5e')+_0x407d81[_0x3fae('0x5f')]['name']+'['+_0x407d81[_0x3fae('0x5a')]+']',_0x2f2cd8);};_0x407d81['on'](_0x3fae('0x60'),function(){onDisconnect(_0x407d81,_0x503f25);_0x407d81[_0x3fae('0x56')]('DISCONNECTED');});onConnect(_0x407d81);_0x407d81[_0x3fae('0x56')]('CONNECTED');});};
\ No newline at end of file
+var _0x917f=['Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','FaxQueues','FaxQueue','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','setMaxListeners','address','request','connection','remotePort','log','nsp','disconnect','DISCONNECTED','bluebird','../mysqldb','./environment','Agents','User','role','agent','name','telephone','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x917f,0x110));var _0xf917=function(_0x16aef8,_0x10b814){_0x16aef8=_0x16aef8-0x0;var _0x258ef5=_0x917f[_0x16aef8];return _0x258ef5;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xf917('0x0'));var db=require(_0xf917('0x1'))['db'];var config=require(_0xf917('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xf917('0x3'),'model':db[_0xf917('0x4')],'attributes':['id','name',_0xf917('0x5')],'raw':!![],'where':{'role':_0xf917('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf917('0x7')],'where':{'role':_0xf917('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xf917('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0xf917('0x7')],'where':{'role':_0xf917('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xf917('0x7'),_0xf917('0x9')],'where':{'type':_0xf917('0xa')}};function getAssociatedResources(_0x4f307d,_0x41653c,_0xe13c91){return db[_0xf917('0xb')][_0xf917('0xc')]({'where':{'name':_0x4f307d,'userProfileId':_0x41653c},'raw':!![]})[_0xf917('0xd')](function(_0x3a5197){if(_0x3a5197){if(_0x3a5197['autoAssociation']){switch(_0x4f307d){case _0xf917('0xe'):case _0xf917('0xf'):case'FaxQueues':case _0xf917('0x10'):case _0xf917('0x11'):case _0xf917('0x12'):case _0xf917('0x13'):return db[_0xe13c91][_0xf917('0x14')](queryQueues);case _0xf917('0x15'):return db[_0xe13c91][_0xf917('0x14')](queryTelephones);case _0xf917('0x16'):return db[_0xe13c91][_0xf917('0x14')](queryTrunks);case _0xf917('0x17'):return db[_0xe13c91][_0xf917('0x14')](queryCampaigns);}}else{return db[_0xf917('0x18')][_0xf917('0x14')]({'attributes':[_0xf917('0x19')],'where':{'sectionId':_0x3a5197['id']},'raw':!![]})[_0xf917('0xd')](function(_0x3b197e){if(_0x3b197e){var _0x5586cc={'where':{'id':_[_0xf917('0x1a')](_0x3b197e,'resourceId')},'raw':!![]};switch(_0xe13c91){case'User':_0x5586cc[_0xf917('0x1b')][_0xf917('0x5')]=_0xf917('0x8');break;case _0xf917('0x1c'):_0x5586cc[_0xf917('0x1b')][_0xf917('0x9')]='ivr';break;}return db[_0xe13c91]['findAll'](_0x5586cc);}else{return[];}});}}else{return[];}})[_0xf917('0xd')](function(_0x5522c8){return _0x5522c8;});}function joinOrLeaveQueues(_0x31613a,_0x524faa,_0x3da071,_0x2d7553){_0x31613a[_0x524faa](util[_0xf917('0x1d')]('%s:queue:%s',_0x3da071,_0x2d7553['name']));if(_0x2d7553[_0xf917('0x3')]){for(var _0x17f5cd=0x0;_0x17f5cd<_0x2d7553[_0xf917('0x3')][_0xf917('0x1e')];_0x17f5cd+=0x1){_0x31613a[_0x524faa](util[_0xf917('0x1d')](_0xf917('0x1f'),_0x2d7553[_0xf917('0x3')][_0x17f5cd][_0xf917('0x7')]));}}}function joinOrLeave(_0x33c45c,_0x19334d,_0x8cdeeb){var _0x49eea6;if(_0x33c45c[_0xf917('0x20')][_0xf917('0x21')]['id']){db[_0xf917('0x4')][_0xf917('0x22')]({'attributes':['id',_0xf917('0x7'),'role',_0xf917('0x23')],'where':{'id':_0x33c45c[_0xf917('0x20')][_0xf917('0x21')]['id']},'include':[{'model':db[_0xf917('0x24')],'as':_0xf917('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xf917('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf917('0x27')],'as':_0xf917('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xf917('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xf917('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xf917('0xd')](function(_0x2db5d5){if(_0x2db5d5){_0x49eea6=_0x2db5d5;_0x33c45c[_0x19334d](util[_0xf917('0x1d')](_0xf917('0x1f'),_0x2db5d5['name']));var _0x2565bc=[];switch(_0x2db5d5[_0xf917('0x5')]){case _0xf917('0x2b'):_0x33c45c[_0x19334d](_0xf917('0x2c'));_0x33c45c[_0x19334d](_0xf917('0x2d'));if(queryQueues[_0xf917('0x2e')]('include')){delete queryQueues[_0xf917('0x2f')];}_0x2565bc['push'](db[_0xf917('0x30')][_0xf917('0x14')](queryQueues));_0x2565bc['push'](db[_0xf917('0x31')]['findAll'](queryQueues));_0x2565bc[_0xf917('0x32')](db['FaxQueue']['findAll'](queryQueues));_0x2565bc['push'](db[_0xf917('0x33')]['findAll'](queryQueues));_0x2565bc['push'](db['MailQueue'][_0xf917('0x14')](queryQueues));_0x2565bc[_0xf917('0x32')](db[_0xf917('0x34')][_0xf917('0x14')](queryQueues));_0x2565bc[_0xf917('0x32')](db[_0xf917('0x35')]['findAll'](queryQueues));_0x2565bc['push'](db[_0xf917('0x4')][_0xf917('0x14')](queryTelephones));_0x2565bc['push'](db[_0xf917('0x36')][_0xf917('0x14')](queryTrunks));_0x2565bc[_0xf917('0x32')](db[_0xf917('0x1c')][_0xf917('0x14')](queryCampaigns));_0x2565bc[_0xf917('0x32')](db[_0xf917('0x4')]['findAll'](queryAgents));break;case _0xf917('0x37'):_0x33c45c[_0x19334d](_0xf917('0x2c'));_0x33c45c[_0x19334d](_0xf917('0x2d'));_0x2565bc['push'](getAssociatedResources(_0xf917('0xe'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x30')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0xf'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x31')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0x38'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x39')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0x10'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x33')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0x11'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x3a')));_0x2565bc[_0xf917('0x32')](getAssociatedResources('OpenchannelQueues',_0x2db5d5['userProfileId'],_0xf917('0x34')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0x13'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x35')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0x15'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x4')));_0x2565bc['push'](getAssociatedResources(_0xf917('0x16'),_0x2db5d5[_0xf917('0x23')],_0xf917('0x36')));_0x2565bc[_0xf917('0x32')](getAssociatedResources(_0xf917('0x17'),_0x2db5d5['userProfileId'],_0xf917('0x1c')));_0x2565bc[_0xf917('0x32')](db[_0xf917('0x4')][_0xf917('0x14')](queryAgents));break;case _0xf917('0x6'):_0x33c45c[_0x19334d](_0xf917('0x2c'));_0x33c45c[_0x19334d](_0xf917('0x2d'));_0x2565bc[_0xf917('0x32')](_0x2db5d5[_0xf917('0x3b')]({'attributes':['id',_0xf917('0x7')]}));_0x2565bc[_0xf917('0x32')](_0x2db5d5[_0xf917('0x3c')]({'attributes':['id',_0xf917('0x7')]}));_0x2565bc[_0xf917('0x32')](_0x2db5d5[_0xf917('0x3d')]({'attributes':['id',_0xf917('0x7')]}));_0x2565bc[_0xf917('0x32')](_0x2db5d5[_0xf917('0x3e')]({'attributes':['id',_0xf917('0x7')]}));_0x2565bc[_0xf917('0x32')](_0x2db5d5[_0xf917('0x3f')]({'attributes':['id',_0xf917('0x7')]}));_0x2565bc[_0xf917('0x32')](_0x2db5d5[_0xf917('0x40')]({'attributes':['id',_0xf917('0x7')]}));_0x2565bc[_0xf917('0x32')](_0x2db5d5['getWhatsappQueues']({'attributes':['id',_0xf917('0x7')]}));break;}return BPromise[_0xf917('0x41')](_0x2565bc);}})[_0xf917('0xd')](function(_0x4fc8f2){if(_0x4fc8f2&&_0x4fc8f2['length']){for(var _0x188fa2=0x0;_0x188fa2<_0x4fc8f2[_0xf917('0x1e')];_0x188fa2+=0x1){for(var _0x5f2551=0x0;_0x5f2551<_0x4fc8f2[_0x188fa2][_0xf917('0x1e')];_0x5f2551+=0x1){switch(_0x188fa2){case 0x0:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x42'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x1:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x43'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x2:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x44'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x3:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x45'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x4:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x46'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x5:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x47'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x6:joinOrLeaveQueues(_0x33c45c,_0x19334d,_0xf917('0x48'),_0x4fc8f2[_0x188fa2][_0x5f2551]);break;case 0x7:if(_0x49eea6[_0xf917('0x5')]!=='agent')_0x33c45c[_0x19334d](util[_0xf917('0x1d')](_0xf917('0x49'),_0x4fc8f2[_0x188fa2][_0x5f2551][_0xf917('0x7')]));break;case 0x8:if(_0x49eea6['role']!=='agent')_0x33c45c[_0x19334d](util[_0xf917('0x1d')](_0xf917('0x4a'),_0x4fc8f2[_0x188fa2][_0x5f2551][_0xf917('0x7')]));break;case 0x9:if(_0x49eea6['role']!==_0xf917('0x6'))_0x33c45c[_0x19334d](util['format']('campaign:%s:%s',_0x4fc8f2[_0x188fa2][_0x5f2551]['type'],_0x4fc8f2[_0x188fa2][_0x5f2551][_0xf917('0x7')]));break;case 0xa:_0x33c45c[_0x19334d](util[_0xf917('0x1d')]('user:%s',_0x4fc8f2[_0x188fa2][_0x5f2551][_0xf917('0x7')]));break;}}}}})[_0xf917('0xd')](function(){if(_0x19334d===_0xf917('0x4b')){var _0x1fef8f=_[_0xf917('0x1a')](_0x49eea6[_0xf917('0x25')],'id');return _0x49eea6[_0xf917('0x4c')](_0x1fef8f)[_0xf917('0xd')](function(){for(var _0x13f0ce=0x0;_0x13f0ce<_0x1fef8f['length'];_0x13f0ce+=0x1){_0x8cdeeb[_0xf917('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1fef8f[_0x13f0ce]),'UserId':Number(_0x49eea6['id'])});}});}})[_0xf917('0xd')](function(){if(_0x19334d===_0xf917('0x4b')){var _0x3d9d13=_['map'](_0x49eea6[_0xf917('0x4e')],'id');return _0x49eea6[_0xf917('0x4f')](_0x3d9d13)[_0xf917('0xd')](function(){for(var _0xc933e0=0x0;_0xc933e0<_0x3d9d13[_0xf917('0x1e')];_0xc933e0+=0x1){_0x8cdeeb[_0xf917('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3d9d13[_0xc933e0]),'UserId':Number(_0x49eea6['id'])});}});}})[_0xf917('0xd')](function(){if(_0x19334d===_0xf917('0x4b')){var _0x2af639=_[_0xf917('0x1a')](_0x49eea6[_0xf917('0x28')],'id');return _0x49eea6[_0xf917('0x50')](_0x2af639)[_0xf917('0xd')](function(){for(var _0x4fdc01=0x0;_0x4fdc01<_0x2af639[_0xf917('0x1e')];_0x4fdc01+=0x1){_0x8cdeeb[_0xf917('0x4d')](_0xf917('0x51'),{'FaxInteractionId':Number(_0x2af639[_0x4fdc01]),'UserId':Number(_0x49eea6['id'])});}});}})[_0xf917('0xd')](function(){if(_0x19334d===_0xf917('0x4b')){var _0x42bdc9=_[_0xf917('0x1a')](_0x49eea6['SmsInteractions'],'id');return _0x49eea6[_0xf917('0x52')](_0x42bdc9)[_0xf917('0xd')](function(){for(var _0x28926c=0x0;_0x28926c<_0x42bdc9['length'];_0x28926c+=0x1){_0x8cdeeb[_0xf917('0x4d')](_0xf917('0x53'),{'SmsInteractionId':Number(_0x42bdc9[_0x28926c]),'UserId':Number(_0x49eea6['id'])});}});}})['then'](function(){if(_0x19334d===_0xf917('0x4b')){var _0x22e352=_[_0xf917('0x1a')](_0x49eea6[_0xf917('0x54')],'id');return _0x49eea6[_0xf917('0x55')](_0x22e352)[_0xf917('0xd')](function(){for(var _0x38832d=0x0;_0x38832d<_0x22e352[_0xf917('0x1e')];_0x38832d+=0x1){_0x8cdeeb['emit'](_0xf917('0x56'),{'OpenchannelInteractionId':Number(_0x22e352[_0x38832d]),'UserId':Number(_0x49eea6['id'])});}});}})[_0xf917('0xd')](function(){if(_0x19334d===_0xf917('0x4b')){var _0x5a2981=_['map'](_0x49eea6['WhatsappInteractions'],'id');return _0x49eea6[_0xf917('0x57')](_0x5a2981)['then'](function(){for(var _0x8673b=0x0;_0x8673b<_0x5a2981[_0xf917('0x1e')];_0x8673b+=0x1){_0x8cdeeb[_0xf917('0x4d')](_0xf917('0x58'),{'WhatsappInteractionId':Number(_0x5a2981[_0x8673b]),'UserId':Number(_0x49eea6['id'])});}});}})['catch'](function(_0x28010c){_0x33c45c['log'](_0x28010c);});}}function onDisconnect(_0x35cf2f,_0x5ccea2){joinOrLeave(_0x35cf2f,'leave',_0x5ccea2);}function onConnect(_0x2d124d){joinOrLeave(_0x2d124d,'join');}exports['default']=function(_0x34fc27){_0x34fc27['on']('connection',function(_0xedce8b){_0xedce8b[_0xf917('0x59')](0x0);_0xedce8b[_0xf917('0x5a')]=_0xedce8b[_0xf917('0x5b')][_0xf917('0x5c')]['remoteAddress']+':'+_0xedce8b[_0xf917('0x5b')][_0xf917('0x5c')][_0xf917('0x5d')];_0xedce8b['connectedAt']=new Date();_0xedce8b['log']=function(_0x4e4004){console[_0xf917('0x5e')]('SocketIO\x20'+_0xedce8b[_0xf917('0x5f')][_0xf917('0x7')]+'['+_0xedce8b[_0xf917('0x5a')]+']',_0x4e4004);};_0xedce8b['on'](_0xf917('0x60'),function(){onDisconnect(_0xedce8b,_0x34fc27);_0xedce8b[_0xf917('0x5e')](_0xf917('0x61'));});onConnect(_0xedce8b);_0xedce8b['log']('CONNECTED');});};
\ No newline at end of file
index fcfa904..ea526e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa45c=['model','hook','callback','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','newinteraction','closedinteraction','ChatMessage','afterCreate','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','motionChannel','event','direction','resolve','ContactId','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','get','offlineMessage','opened','undefined','AfterCreate','closed','changed','substatus','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','AfterUpdate','User','email','internal','default'];(function(_0x4f61b2,_0x3551ca){var _0x16a8e8=function(_0x27d756){while(--_0x27d756){_0x4f61b2['push'](_0x4f61b2['shift']());}};_0x16a8e8(++_0x3551ca);}(_0xa45c,0x95));var _0xca45=function(_0x27051a,_0x554935){_0x27051a=_0x27051a-0x0;var _0x3473d2=_0xa45c[_0x27051a];return _0x3473d2;};'use strict';var util=require('util');var db=require(_0xca45('0x0'))['db'];var jayson=require(_0xca45('0x1'));var logger=require(_0xca45('0x2'))(_0xca45('0x3'));var client=jayson[_0xca45('0x4')][_0xca45('0x5')]({'port':0x232a});var triggers=[{'channel':_0xca45('0x6'),'model':_0xca45('0x7'),'event':'afterCreate','condition':_0xca45('0x8'),'callback':afterCreate},{'channel':_0xca45('0x6'),'model':_0xca45('0x7'),'event':'afterUpdate','condition':_0xca45('0x9'),'callback':afterUpdate},{'channel':_0xca45('0x6'),'model':_0xca45('0xa'),'event':_0xca45('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':_0xca45('0xb'),'condition':_0xca45('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xca45('0xb'),'condition':_0xca45('0x8'),'callback':afterCreate},{'channel':_0xca45('0xd'),'model':_0xca45('0xe'),'event':_0xca45('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca45('0xd'),'model':_0xca45('0x10'),'event':_0xca45('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca45('0x11'),'model':_0xca45('0x12'),'event':_0xca45('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xca45('0x11'),'model':_0xca45('0x12'),'event':'afterUpdate','condition':_0xca45('0x9'),'callback':afterUpdate},{'channel':_0xca45('0x11'),'model':'WhatsappMessage','event':_0xca45('0xb'),'condition':_0xca45('0xc'),'callback':afterCreateMessage},{'channel':_0xca45('0x13'),'model':_0xca45('0x14'),'event':_0xca45('0xb'),'condition':_0xca45('0x8'),'callback':afterCreate},{'channel':_0xca45('0x13'),'model':_0xca45('0x14'),'event':_0xca45('0xf'),'condition':_0xca45('0x9'),'callback':afterUpdate},{'channel':_0xca45('0x13'),'model':_0xca45('0x15'),'event':_0xca45('0xb'),'condition':_0xca45('0xc'),'callback':afterCreateMessage},{'channel':_0xca45('0x16'),'model':_0xca45('0x17'),'event':'afterCreate','condition':_0xca45('0x8'),'callback':afterCreate},{'channel':_0xca45('0x16'),'model':_0xca45('0x17'),'event':_0xca45('0xf'),'condition':_0xca45('0x9'),'callback':afterUpdate},{'channel':_0xca45('0x16'),'model':_0xca45('0x18'),'event':_0xca45('0xb'),'condition':_0xca45('0xc'),'callback':afterCreateMessage},{'channel':_0xca45('0x19'),'model':_0xca45('0x1a'),'event':_0xca45('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0xca45('0x1a'),'event':_0xca45('0xf'),'condition':_0xca45('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xca45('0x1b'),'event':_0xca45('0xb'),'condition':_0xca45('0xc'),'callback':afterCreateMessage}];function request(_0x513d3e){return client[_0xca45('0x1c')](_0xca45('0x1d'),_0x513d3e)[_0xca45('0x1e')](function(_0x2b1565){logger[_0xca45('0x1f')]('Trigger,\x20%s','EventManager',_0x2b1565);if(_0x2b1565[_0xca45('0x20')]){if(_0x2b1565[_0xca45('0x20')][_0xca45('0x21')]===0x1f4){logger[_0xca45('0x20')](_0xca45('0x22'),_0xca45('0x1d'),_0x2b1565['error']);}}})[_0xca45('0x23')](function(_0xd6515c){logger[_0xca45('0x20')](_0xca45('0x22'),_0xca45('0x1d'),_0xd6515c);});}function afterCreateMessage(_0x4173c7){return function(_0x3ab485){_0x3ab485=_0x3ab485['get']({'plain':!![]});_0x3ab485['channel']=_0x4173c7;_0x3ab485[_0xca45('0x24')]=_0x4173c7;_0x3ab485[_0xca45('0x25')]=_0x3ab485[_0xca45('0x26')];Promise[_0xca45('0x27')]()['then'](function(){if(typeof _0x3ab485[_0xca45('0x28')]==='undefined')return null;var _0x973e45='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ab485['ContactId'];return db['sequelize'][_0xca45('0x29')](_0x973e45,{'type':db[_0xca45('0x2a')][_0xca45('0x2b')][_0xca45('0x2c')],'raw':!![]});})[_0xca45('0x1e')](function(_0x2c85a9){if(_0x2c85a9){_0x3ab485[_0xca45('0x2d')]=_0x2c85a9[0x0];}if(typeof _0x3ab485['UserId']==='undefined')return;return getAgent(_0x3ab485[_0xca45('0x2e')]);})[_0xca45('0x1e')](function(_0x51cc78){if(_0x51cc78){_0x3ab485[_0xca45('0x2f')]=util[_0xca45('0x30')](_0xca45('0x31'),_0x51cc78[_0xca45('0x32')]);_0x3ab485[_0xca45('0x33')]=_0x51cc78;_0x3ab485[_0xca45('0x34')]=_0x4173c7;return request({'event':_0xca45('0x35'),'message':_0x3ab485});}else{return request({'event':_0xca45('0x36'),'message':_0x3ab485});}})['catch'](function(_0x45d07c){logger[_0xca45('0x20')](_0xca45('0x22'),'AfterCreateMessage',_0x45d07c);});};}function afterCreateOfflineMessage(_0x1d1374){return function(_0x477cc1){_0x477cc1=_0x477cc1[_0xca45('0x37')]({'plain':!![]});_0x477cc1[_0xca45('0x34')]=_0x1d1374;_0x477cc1['motionChannel']=_0x1d1374;_0x477cc1[_0xca45('0x25')]=_0xca45('0x38');return request({'event':_0x477cc1[_0xca45('0x25')],'message':_0x477cc1});};}function afterCreate(_0x4dc718,_0xec4978){return function(_0x78808a){_0x78808a=_0x78808a[_0xca45('0x37')]({'plain':!![]});_0x78808a['channel']=_0x4dc718;_0x78808a[_0xca45('0x24')]=_0x4dc718;_0x78808a[_0xca45('0x25')]=_0xca45('0x39');Promise['resolve']()[_0xca45('0x1e')](function(){var _0x5dd8d4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x78808a[_0xca45('0x28')];return db['sequelize'][_0xca45('0x29')](_0x5dd8d4,{'type':db[_0xca45('0x2a')][_0xca45('0x2b')][_0xca45('0x2c')],'raw':!![]});})[_0xca45('0x1e')](function(_0x16e778){if(_0x16e778){_0x78808a[_0xca45('0x2d')]=_0x16e778[0x0];}if(typeof _0x78808a['UserId']===_0xca45('0x3a'))return;return getAgent(_0x78808a[_0xca45('0x2e')]);})[_0xca45('0x1e')](function(_0x2d5c39){if(_0x2d5c39){_0x78808a[_0xca45('0x2f')]=util[_0xca45('0x30')]('SIP/%s',_0x2d5c39[_0xca45('0x32')]);_0x78808a[_0xca45('0x33')]=_0x2d5c39;}return request({'event':_0xec4978,'message':_0x78808a});})['catch'](function(_0x4e0baf){logger['error'](_0xca45('0x22'),_0xca45('0x3b'),_0x4e0baf);});};}function afterUpdate(_0x2cec66){return function(_0x184ff4){var _0x2ae5c9=_0x184ff4['changed'](_0xca45('0x3c'))&&_0x184ff4['closed'];var _0x1f001b=_0x184ff4[_0xca45('0x3d')](_0xca45('0x3e'));if(_0x2ae5c9||_0x1f001b){var _0x3608cb=_0x2ae5c9?_0xca45('0x9'):_0xca45('0x3e');var _0x2e4101=_0x184ff4[_0xca45('0x37')]({'plain':!![]});_0x2e4101['channel']=_0x2cec66;_0x2e4101[_0xca45('0x24')]=_0x2cec66;_0x2e4101[_0xca45('0x25')]=_0x2ae5c9?_0xca45('0x3c'):_0xca45('0x3e');var _0x568cc4=_0xca45('0x3f')+_0x2e4101[_0xca45('0x28')];return db[_0xca45('0x40')][_0xca45('0x29')](_0x568cc4,{'type':db[_0xca45('0x2a')][_0xca45('0x2b')]['SELECT'],'raw':!![]})[_0xca45('0x1e')](function(_0x1c97b6){if(_0x1c97b6){_0x2e4101[_0xca45('0x2d')]=_0x1c97b6[0x0];}if(typeof _0x2e4101[_0xca45('0x2e')]==='undefined')return;return getAgent(_0x2e4101[_0xca45('0x2e')]);})[_0xca45('0x1e')](function(_0x2bcdf5){if(_0x2bcdf5){_0x2e4101[_0xca45('0x2f')]=util[_0xca45('0x30')](_0xca45('0x31'),_0x2bcdf5[_0xca45('0x32')]);_0x2e4101[_0xca45('0x33')]=_0x2bcdf5;}return request({'event':_0x3608cb,'message':_0x2e4101});})['catch'](function(_0x34f7d9){logger['error'](_0xca45('0x22'),_0xca45('0x41'),_0x34f7d9);});}};}function getAgent(_0x52b665){return db[_0xca45('0x42')]['find']({'where':{'id':_0x52b665},'attributes':['id','name','fullname',_0xca45('0x43'),_0xca45('0x44')],'raw':!![]})[_0xca45('0x1e')](function(_0x3ab435){return _0x3ab435;});}exports[_0xca45('0x45')]=function(){for(var _0x5caee9=0x0;_0x5caee9<triggers['length'];_0x5caee9+=0x1){if(db['hasOwnProperty'](triggers[_0x5caee9][_0xca45('0x46')])){db[triggers[_0x5caee9][_0xca45('0x46')]][_0xca45('0x47')](triggers[_0x5caee9]['event'],triggers[_0x5caee9][_0xca45('0x48')](triggers[_0x5caee9][_0xca45('0x34')]['toLowerCase'](),triggers[_0x5caee9]['condition']));}}};
\ No newline at end of file
+var _0x1a0c=['resolve','ContactId','undefined','query','Sequelize','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','get','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','AfterCreate','closed','changed','substatus','AfterUpdate','User','find','fullname','default','length','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','afterUpdate','newmessage','ChatOfflineMessage','SmsInteraction','newinteraction','Sms','closedinteraction','afterCreate','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','MailInteraction','Mail','Openchannel','OpenchannelInteraction','EventManager','then','Trigger,\x20%s','error','code','catch','motionChannel','event','direction'];(function(_0x46e9c8,_0x2d4f30){var _0x4b84c3=function(_0x3817e9){while(--_0x3817e9){_0x46e9c8['push'](_0x46e9c8['shift']());}};_0x4b84c3(++_0x2d4f30);}(_0x1a0c,0xb2));var _0xc1a0=function(_0x53166a,_0x43b2d3){_0x53166a=_0x53166a-0x0;var _0x2676c5=_0x1a0c[_0x53166a];return _0x2676c5;};'use strict';var util=require(_0xc1a0('0x0'));var db=require(_0xc1a0('0x1'))['db'];var jayson=require(_0xc1a0('0x2'));var logger=require(_0xc1a0('0x3'))(_0xc1a0('0x4'));var client=jayson['client'][_0xc1a0('0x5')]({'port':0x232a});var triggers=[{'channel':_0xc1a0('0x6'),'model':_0xc1a0('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xc1a0('0x6'),'model':_0xc1a0('0x7'),'event':_0xc1a0('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc1a0('0x6'),'model':'ChatMessage','event':'afterCreate','condition':_0xc1a0('0x9'),'callback':afterCreateMessage},{'channel':_0xc1a0('0x6'),'model':_0xc1a0('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xc1a0('0xb'),'event':'afterCreate','condition':_0xc1a0('0xc'),'callback':afterCreate},{'channel':_0xc1a0('0xd'),'model':_0xc1a0('0xb'),'event':_0xc1a0('0x8'),'condition':_0xc1a0('0xe'),'callback':afterUpdate},{'channel':_0xc1a0('0xd'),'model':'SmsMessage','event':_0xc1a0('0xf'),'condition':_0xc1a0('0x9'),'callback':afterCreateMessage},{'channel':_0xc1a0('0x10'),'model':_0xc1a0('0x11'),'event':_0xc1a0('0xf'),'condition':_0xc1a0('0xc'),'callback':afterCreate},{'channel':_0xc1a0('0x10'),'model':_0xc1a0('0x11'),'event':_0xc1a0('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0xc1a0('0x12'),'event':'afterCreate','condition':_0xc1a0('0x9'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xc1a0('0x13'),'event':_0xc1a0('0xf'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc1a0('0x14'),'model':_0xc1a0('0x13'),'event':_0xc1a0('0x8'),'condition':_0xc1a0('0xe'),'callback':afterUpdate},{'channel':_0xc1a0('0x14'),'model':_0xc1a0('0x15'),'event':_0xc1a0('0xf'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xc1a0('0x16'),'event':_0xc1a0('0xf'),'condition':_0xc1a0('0xc'),'callback':afterCreate},{'channel':_0xc1a0('0x17'),'model':'MailInteraction','event':_0xc1a0('0x8'),'condition':_0xc1a0('0xe'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xc1a0('0xf'),'condition':_0xc1a0('0x9'),'callback':afterCreateMessage},{'channel':_0xc1a0('0x18'),'model':_0xc1a0('0x19'),'event':_0xc1a0('0xf'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc1a0('0x18'),'model':_0xc1a0('0x19'),'event':_0xc1a0('0x8'),'condition':_0xc1a0('0xe'),'callback':afterUpdate},{'channel':_0xc1a0('0x18'),'model':'OpenchannelMessage','event':_0xc1a0('0xf'),'condition':_0xc1a0('0x9'),'callback':afterCreateMessage}];function request(_0x530ca8){return client['request'](_0xc1a0('0x1a'),_0x530ca8)[_0xc1a0('0x1b')](function(_0x7cbe7b){logger['info'](_0xc1a0('0x1c'),_0xc1a0('0x1a'),_0x7cbe7b);if(_0x7cbe7b['error']){if(_0x7cbe7b[_0xc1a0('0x1d')][_0xc1a0('0x1e')]===0x1f4){logger[_0xc1a0('0x1d')](_0xc1a0('0x1c'),_0xc1a0('0x1a'),_0x7cbe7b[_0xc1a0('0x1d')]);}}})[_0xc1a0('0x1f')](function(_0x24d9e4){logger[_0xc1a0('0x1d')]('Trigger,\x20%s','EventManager',_0x24d9e4);});}function afterCreateMessage(_0xc366c1){return function(_0x203c34){_0x203c34=_0x203c34['get']({'plain':!![]});_0x203c34['channel']=_0xc366c1;_0x203c34[_0xc1a0('0x20')]=_0xc366c1;_0x203c34[_0xc1a0('0x21')]=_0x203c34[_0xc1a0('0x22')];Promise[_0xc1a0('0x23')]()[_0xc1a0('0x1b')](function(){if(typeof _0x203c34[_0xc1a0('0x24')]===_0xc1a0('0x25'))return null;var _0xe60704='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x203c34[_0xc1a0('0x24')];return db['sequelize'][_0xc1a0('0x26')](_0xe60704,{'type':db[_0xc1a0('0x27')]['QueryTypes'][_0xc1a0('0x28')],'raw':!![]});})['then'](function(_0x4eb25c){if(_0x4eb25c){_0x203c34[_0xc1a0('0x29')]=_0x4eb25c[0x0];}if(typeof _0x203c34[_0xc1a0('0x2a')]===_0xc1a0('0x25'))return;return getAgent(_0x203c34['UserId']);})[_0xc1a0('0x1b')](function(_0x30c1fb){if(_0x30c1fb){_0x203c34[_0xc1a0('0x2b')]=util[_0xc1a0('0x2c')](_0xc1a0('0x2d'),_0x30c1fb[_0xc1a0('0x2e')]);_0x203c34[_0xc1a0('0x2f')]=_0x30c1fb;_0x203c34[_0xc1a0('0x30')]=_0xc366c1;return request({'event':_0xc1a0('0x31'),'message':_0x203c34});}else{return request({'event':_0xc1a0('0x32'),'message':_0x203c34});}})[_0xc1a0('0x1f')](function(_0x3341fa){logger[_0xc1a0('0x1d')](_0xc1a0('0x1c'),'AfterCreateMessage',_0x3341fa);});};}function afterCreateOfflineMessage(_0x4818ef){return function(_0x164af8){_0x164af8=_0x164af8[_0xc1a0('0x33')]({'plain':!![]});_0x164af8[_0xc1a0('0x30')]=_0x4818ef;_0x164af8[_0xc1a0('0x20')]=_0x4818ef;_0x164af8[_0xc1a0('0x21')]=_0xc1a0('0x34');return request({'event':_0x164af8[_0xc1a0('0x21')],'message':_0x164af8});};}function afterCreate(_0x4a3909,_0x581f07){return function(_0x4ce79e){_0x4ce79e=_0x4ce79e[_0xc1a0('0x33')]({'plain':!![]});_0x4ce79e[_0xc1a0('0x30')]=_0x4a3909;_0x4ce79e[_0xc1a0('0x20')]=_0x4a3909;_0x4ce79e[_0xc1a0('0x21')]=_0xc1a0('0x35');Promise[_0xc1a0('0x23')]()[_0xc1a0('0x1b')](function(){var _0xb450b8=_0xc1a0('0x36')+_0x4ce79e[_0xc1a0('0x24')];return db[_0xc1a0('0x37')][_0xc1a0('0x26')](_0xb450b8,{'type':db[_0xc1a0('0x27')][_0xc1a0('0x38')]['SELECT'],'raw':!![]});})[_0xc1a0('0x1b')](function(_0x333de2){if(_0x333de2){_0x4ce79e['contact']=_0x333de2[0x0];}if(typeof _0x4ce79e[_0xc1a0('0x2a')]==='undefined')return;return getAgent(_0x4ce79e[_0xc1a0('0x2a')]);})[_0xc1a0('0x1b')](function(_0x1e8594){if(_0x1e8594){_0x4ce79e[_0xc1a0('0x2b')]=util[_0xc1a0('0x2c')](_0xc1a0('0x2d'),_0x1e8594[_0xc1a0('0x2e')]);_0x4ce79e['agent']=_0x1e8594;}return request({'event':_0x581f07,'message':_0x4ce79e});})['catch'](function(_0x1a00f5){logger[_0xc1a0('0x1d')]('Trigger,\x20%s',_0xc1a0('0x39'),_0x1a00f5);});};}function afterUpdate(_0xe97861){return function(_0x53aa15){var _0xfbac4=_0x53aa15['changed']('closed')&&_0x53aa15[_0xc1a0('0x3a')];var _0x358278=_0x53aa15[_0xc1a0('0x3b')](_0xc1a0('0x3c'));if(_0xfbac4||_0x358278){var _0x3f6dd3=_0xfbac4?_0xc1a0('0xe'):_0xc1a0('0x3c');var _0x2e5e33=_0x53aa15[_0xc1a0('0x33')]({'plain':!![]});_0x2e5e33[_0xc1a0('0x30')]=_0xe97861;_0x2e5e33[_0xc1a0('0x20')]=_0xe97861;_0x2e5e33[_0xc1a0('0x21')]=_0xfbac4?_0xc1a0('0x3a'):_0xc1a0('0x3c');var _0x403f8e=_0xc1a0('0x36')+_0x2e5e33['ContactId'];return db[_0xc1a0('0x37')][_0xc1a0('0x26')](_0x403f8e,{'type':db[_0xc1a0('0x27')][_0xc1a0('0x38')][_0xc1a0('0x28')],'raw':!![]})[_0xc1a0('0x1b')](function(_0x399358){if(_0x399358){_0x2e5e33['contact']=_0x399358[0x0];}if(typeof _0x2e5e33[_0xc1a0('0x2a')]===_0xc1a0('0x25'))return;return getAgent(_0x2e5e33[_0xc1a0('0x2a')]);})[_0xc1a0('0x1b')](function(_0x5f4514){if(_0x5f4514){_0x2e5e33[_0xc1a0('0x2b')]=util['format'](_0xc1a0('0x2d'),_0x5f4514[_0xc1a0('0x2e')]);_0x2e5e33[_0xc1a0('0x2f')]=_0x5f4514;}return request({'event':_0x3f6dd3,'message':_0x2e5e33});})[_0xc1a0('0x1f')](function(_0x32e981){logger[_0xc1a0('0x1d')]('Trigger,\x20%s',_0xc1a0('0x3d'),_0x32e981);});}};}function getAgent(_0x380de6){return db[_0xc1a0('0x3e')][_0xc1a0('0x3f')]({'where':{'id':_0x380de6},'attributes':['id',_0xc1a0('0x2e'),_0xc1a0('0x40'),'email','internal'],'raw':!![]})[_0xc1a0('0x1b')](function(_0x5c525e){return _0x5c525e;});}exports[_0xc1a0('0x41')]=function(){for(var _0x3408f4=0x0;_0x3408f4<triggers[_0xc1a0('0x42')];_0x3408f4+=0x1){if(db['hasOwnProperty'](triggers[_0x3408f4]['model'])){db[triggers[_0x3408f4][_0xc1a0('0x43')]][_0xc1a0('0x44')](triggers[_0x3408f4][_0xc1a0('0x21')],triggers[_0x3408f4][_0xc1a0('0x45')](triggers[_0x3408f4]['channel']['toLowerCase'](),triggers[_0x3408f4][_0xc1a0('0x46')]));}}};
\ No newline at end of file
index 369edd3..1f37141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9c5=['sms','whatsapp','openchannel','getChannels','toLowerCase','blockedAt','updateAttributes','getLicense','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax'];(function(_0x49acd2,_0x56b47a){var _0x13b710=function(_0x356088){while(--_0x356088){_0x49acd2['push'](_0x49acd2['shift']());}};_0x13b710(++_0x56b47a);}(_0xe9c5,0x187));var _0x5e9c=function(_0x1caa86,_0x38026d){_0x1caa86=_0x1caa86-0x0;var _0x36ad99=_0xe9c5[_0x1caa86];return _0x36ad99;};'use strict';var _=require(_0x5e9c('0x0'));var BPromise=require(_0x5e9c('0x1'));var db=require(_0x5e9c('0x2'))['db'];var util=require(_0x5e9c('0x3'));var channels=[_0x5e9c('0x4'),_0x5e9c('0x5'),_0x5e9c('0x6'),_0x5e9c('0x7'),_0x5e9c('0x8'),_0x5e9c('0x9'),_0x5e9c('0xa')];exports[_0x5e9c('0xb')]=function(){return channels;};exports['isValidChannel']=function(_0x1be462){_0x1be462=_0x1be462[_0x5e9c('0xc')]();return _['includes'](channels,_0x1be462);};exports['clearBlockUser']=function(_0x98de37,_0x4fe96f,_0x3f23f1,_0x27022c){var _0x1baae7={'loginAttempts':_0x4fe96f,'blocked':_0x3f23f1};if(!_['isUndefined'](_0x27022c)){_0x1baae7[_0x5e9c('0xd')]=_0x27022c;}return _0x98de37[_0x5e9c('0xe')](_0x1baae7);};exports[_0x5e9c('0xf')]=function(_0x2fe98a){return new BPromise(function(_0x4c6937,_0x1070c9){var _0x306d5d=0x0;if(_0x2fe98a['role']!==_0x5e9c('0x10')){_0x4c6937(_0x2fe98a);}db['User']['count']({'where':{'role':_0x5e9c('0x10'),'online':!![],'id':{'$ne':_0x2fe98a['id']}}})[_0x5e9c('0x11')](function(_0xa8b918){_0x306d5d=_0xa8b918;return util['getLicense']();})['then'](function(_0x176282){if(_0x176282&&_0x176282[_0x5e9c('0x12')]&&_0x306d5d>=_0x176282[_0x5e9c('0x12')]){throw Error(_0x5e9c('0x13'));}_0x4c6937(_0x2fe98a);})[_0x5e9c('0x14')](function(_0x3ff427){_0x1070c9(_0x3ff427);});});};
\ No newline at end of file
+var _0xd25d=['./license/util','voice','mail','chat','fax','sms','openchannel','getChannels','toLowerCase','includes','isUndefined','getLicense','role','agent','User','count','then','agents','catch','lodash','../mysqldb'];(function(_0x418c6e,_0x37c5d8){var _0x2c5b40=function(_0x14af6d){while(--_0x14af6d){_0x418c6e['push'](_0x418c6e['shift']());}};_0x2c5b40(++_0x37c5d8);}(_0xd25d,0x1b7));var _0xdd25=function(_0xd85ae5,_0x4c62c3){_0xd85ae5=_0xd85ae5-0x0;var _0x37f915=_0xd25d[_0xd85ae5];return _0x37f915;};'use strict';var _=require(_0xdd25('0x0'));var BPromise=require('bluebird');var db=require(_0xdd25('0x1'))['db'];var util=require(_0xdd25('0x2'));var channels=[_0xdd25('0x3'),_0xdd25('0x4'),_0xdd25('0x5'),_0xdd25('0x6'),_0xdd25('0x7'),'whatsapp',_0xdd25('0x8')];exports[_0xdd25('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x537513){_0x537513=_0x537513[_0xdd25('0xa')]();return _[_0xdd25('0xb')](channels,_0x537513);};exports['clearBlockUser']=function(_0x5e5e1c,_0x3f53cc,_0x5f18d2,_0x350ece){var _0x4f2c43={'loginAttempts':_0x3f53cc,'blocked':_0x5f18d2};if(!_[_0xdd25('0xc')](_0x350ece)){_0x4f2c43['blockedAt']=_0x350ece;}return _0x5e5e1c['updateAttributes'](_0x4f2c43);};exports[_0xdd25('0xd')]=function(_0x8c23cf){return new BPromise(function(_0x5ee94c,_0x223ea3){var _0x52d57c=0x0;if(_0x8c23cf[_0xdd25('0xe')]!==_0xdd25('0xf')){_0x5ee94c(_0x8c23cf);}db[_0xdd25('0x10')][_0xdd25('0x11')]({'where':{'role':_0xdd25('0xf'),'online':!![],'id':{'$ne':_0x8c23cf['id']}}})[_0xdd25('0x12')](function(_0x22abf9){_0x52d57c=_0x22abf9;return util[_0xdd25('0xd')]();})[_0xdd25('0x12')](function(_0x18dbab){if(_0x18dbab&&_0x18dbab[_0xdd25('0x13')]&&_0x52d57c>=_0x18dbab['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5ee94c(_0x8c23cf);})[_0xdd25('0x14')](function(_0x5d3abc){_0x223ea3(_0x5d3abc);});});};
\ No newline at end of file
index af0bcac..6e03265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['Bad\x20Request','Not\x20Found','OutOfInterval','error','name','send','exports','util','../config/logger','api','message','Error','inherits'];(function(_0x5bf529,_0x336b59){var _0x18f779=function(_0x35e961){while(--_0x35e961){_0x5bf529['push'](_0x5bf529['shift']());}};_0x18f779(++_0x336b59);}(_0xac4a,0x13f));var _0xaac4=function(_0x479c00,_0x549823){_0x479c00=_0x479c00-0x0;var _0x5013d7=_0xac4a[_0x479c00];return _0x5013d7;};'use strict';var util=require(_0xaac4('0x0'));var logger=require(_0xaac4('0x1'))(_0xaac4('0x2'));var APIError=function(_0x132fc3,_0x38f4f4){this[_0xaac4('0x3')]=_0x132fc3||'Internal\x20Server\x20Error';this['name']=_0x38f4f4||_0xaac4('0x4');util[_0xaac4('0x5')](APIError,Error);};var APIBadRequestError=function(_0x32d34c){this['message']=_0x32d34c||_0xaac4('0x6');this['name']=_0xaac4('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1e4283){this[_0xaac4('0x3')]=_0x1e4283||'Entity\x20not\x20found';this['name']=_0xaac4('0x7');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x452573){switch(_0x452573){case'Bad\x20Request':return 0x190;case'Forbidden',_0xaac4('0x8'):return 0x193;case _0xaac4('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x38d1d0){return function(_0x5f393e){logger[_0xaac4('0x9')](_0x5f393e['stack']);var _0x508e14=getStatusCode(_0x5f393e[_0xaac4('0xa')]);if(_0x5f393e[_0xaac4('0xa')])delete _0x5f393e[_0xaac4('0xa')];return _0x38d1d0['status'](_0x508e14)[_0xaac4('0xb')](_0x5f393e);};}module[_0xaac4('0xc')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xa9e0=['message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Forbidden','OutOfInterval','Not\x20Found','status','send','util','../config/logger','api'];(function(_0x320cfb,_0x25ce4f){var _0x4d3e66=function(_0x1744a0){while(--_0x1744a0){_0x320cfb['push'](_0x320cfb['shift']());}};_0x4d3e66(++_0x25ce4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var APIError=function(_0x5dd881,_0x550fbc){this[_0x0a9e('0x3')]=_0x5dd881||'Internal\x20Server\x20Error';this[_0x0a9e('0x4')]=_0x550fbc||_0x0a9e('0x5');util[_0x0a9e('0x6')](APIError,Error);};var APIBadRequestError=function(_0x991246){this[_0x0a9e('0x3')]=_0x991246||'Bad\x20Request';this[_0x0a9e('0x4')]=_0x0a9e('0x7');util[_0x0a9e('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x5f41ea){this['message']=_0x5f41ea||_0x0a9e('0x8');this['name']='Not\x20Found';util[_0x0a9e('0x6')](APINotFoundError,APIError);};function getStatusCode(_0xf81284){switch(_0xf81284){case _0x0a9e('0x7'):return 0x190;case _0x0a9e('0x9'),_0x0a9e('0xa'):return 0x193;case _0x0a9e('0xb'):return 0x194;default:return 0x1f4;}}function handleError(_0x4a4c56){return function(_0x50dfb2){logger['error'](_0x50dfb2['stack']);var _0x273d4d=getStatusCode(_0x50dfb2[_0x0a9e('0x4')]);if(_0x50dfb2[_0x0a9e('0x4')])delete _0x50dfb2[_0x0a9e('0x4')];return _0x4a4c56[_0x0a9e('0xc')](_0x273d4d)[_0x0a9e('0xd')](_0x50dfb2);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index e69df37..0bdcff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa852=['404','status','render','send','exports'];(function(_0x41e099,_0x559f30){var _0x1588c8=function(_0x1033c4){while(--_0x1033c4){_0x41e099['push'](_0x41e099['shift']());}};_0x1588c8(++_0x559f30);}(_0xa852,0x1bc));var _0x2a85=function(_0x5e8fbd,_0x1e44fa){_0x5e8fbd=_0x5e8fbd-0x0;var _0x484f30=_0xa852[_0x5e8fbd];return _0x484f30;};'use strict';module[_0x2a85('0x0')][0x194]=function pageNotFound(_0x1b2135,_0x92b32c){var _0x1b7414=_0x2a85('0x1');var _0x4b24c7=0x194;var _0xb6fa0f={'status':_0x4b24c7};_0x92b32c[_0x2a85('0x2')](_0xb6fa0f[_0x2a85('0x2')]);_0x92b32c[_0x2a85('0x3')](_0x1b7414,{},function(_0x3a46d6,_0xffe5c4){if(_0x3a46d6){return _0x92b32c[_0x2a85('0x2')](_0xb6fa0f['status'])['json'](_0xb6fa0f);}_0x92b32c[_0x2a85('0x4')](_0xffe5c4);});};
\ No newline at end of file
+var _0x4d40=['render','json','exports','404','status'];(function(_0x268374,_0x23807d){var _0x184e1c=function(_0x18530b){while(--_0x18530b){_0x268374['push'](_0x268374['shift']());}};_0x184e1c(++_0x23807d);}(_0x4d40,0xb1));var _0x04d4=function(_0x4f2e4b,_0x2d084c){_0x4f2e4b=_0x4f2e4b-0x0;var _0x3afdbb=_0x4d40[_0x4f2e4b];return _0x3afdbb;};'use strict';module[_0x04d4('0x0')][0x194]=function pageNotFound(_0x37d8ed,_0x1ef4c6){var _0x1c20ba=_0x04d4('0x1');var _0x1fd094=0x194;var _0x4034c2={'status':_0x1fd094};_0x1ef4c6[_0x04d4('0x2')](_0x4034c2['status']);_0x1ef4c6[_0x04d4('0x3')](_0x1c20ba,{},function(_0xf153d3,_0x2c1a6d){if(_0xf153d3){return _0x1ef4c6[_0x04d4('0x2')](_0x4034c2[_0x04d4('0x2')])[_0x04d4('0x4')](_0x4034c2);}_0x1ef4c6['send'](_0x2c1a6d);});};
\ No newline at end of file
index a6ece40..5225ff5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
index 0199d91..b6b2568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6234=['/api/system','/api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','path','./errors','./config/environment','./utils/client-side-logger','default','then','use','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version'];(function(_0x2ad6b1,_0x1c89d7){var _0x33d52a=function(_0x2c336d){while(--_0x2c336d){_0x2ad6b1['push'](_0x2ad6b1['shift']());}};_0x33d52a(++_0x1c89d7);}(_0x6234,0x116));var _0x4623=function(_0x54101d,_0x5d8d3f){_0x54101d=_0x54101d-0x0;var _0x117e92=_0x6234[_0x54101d];return _0x117e92;};'use strict';var path=require(_0x4623('0x0'));var express=require('express');var errors=require(_0x4623('0x1'));var config=require(_0x4623('0x2'));var setupLoggers=require(_0x4623('0x3'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x4623('0x4')]=function(_0x7397d9){return setupLoggers(_0x7397d9)[_0x4623('0x5')](function(){_0x7397d9[_0x4623('0x6')]('/api/users',require(_0x4623('0x7')));_0x7397d9[_0x4623('0x6')](_0x4623('0x8'),require('./api/voiceChanSpy'));_0x7397d9[_0x4623('0x6')](_0x4623('0x9'),require(_0x4623('0xa')));_0x7397d9[_0x4623('0x6')]('/api/voice/extensions',require('./api/voiceExtension'));_0x7397d9['use']('/api/voice/mohs',require(_0x4623('0xb')));_0x7397d9[_0x4623('0x6')]('/api/voice/queues',require(_0x4623('0xc')));_0x7397d9[_0x4623('0x6')](_0x4623('0xd'),require('./api/voiceRecording'));_0x7397d9[_0x4623('0x6')](_0x4623('0xe'),require(_0x4623('0xf')));_0x7397d9[_0x4623('0x6')](_0x4623('0x10'),require('./api/voiceMail'));_0x7397d9[_0x4623('0x6')](_0x4623('0x11'),require('./api/voiceMailMessage'));_0x7397d9['use'](_0x4623('0x12'),require('./api/voiceCallReport'));_0x7397d9[_0x4623('0x6')](_0x4623('0x13'),require(_0x4623('0x14')));_0x7397d9[_0x4623('0x6')](_0x4623('0x15'),require('./api/voiceAgentReport'));_0x7397d9[_0x4623('0x6')](_0x4623('0x16'),require(_0x4623('0x17')));_0x7397d9[_0x4623('0x6')](_0x4623('0x18'),require('./api/memberReport'));_0x7397d9[_0x4623('0x6')](_0x4623('0x19'),require(_0x4623('0x1a')));_0x7397d9[_0x4623('0x6')](_0x4623('0x1b'),require(_0x4623('0x1c')));_0x7397d9[_0x4623('0x6')](_0x4623('0x1d'),require(_0x4623('0x1e')));_0x7397d9['use']('/api/mail/accounts',require(_0x4623('0x1f')));_0x7397d9[_0x4623('0x6')](_0x4623('0x20'),require(_0x4623('0x21')));_0x7397d9[_0x4623('0x6')]('/api/mail/substatuses',require(_0x4623('0x22')));_0x7397d9[_0x4623('0x6')](_0x4623('0x23'),require(_0x4623('0x24')));_0x7397d9[_0x4623('0x6')](_0x4623('0x25'),require(_0x4623('0x26')));_0x7397d9['use'](_0x4623('0x27'),require(_0x4623('0x28')));_0x7397d9[_0x4623('0x6')](_0x4623('0x29'),require(_0x4623('0x2a')));_0x7397d9[_0x4623('0x6')](_0x4623('0x2b'),require(_0x4623('0x2c')));_0x7397d9[_0x4623('0x6')](_0x4623('0x2d'),require(_0x4623('0x2e')));_0x7397d9['use'](_0x4623('0x2f'),require(_0x4623('0x30')));_0x7397d9[_0x4623('0x6')](_0x4623('0x31'),require('./api/faxApplication'));_0x7397d9[_0x4623('0x6')](_0x4623('0x32'),require(_0x4623('0x33')));_0x7397d9[_0x4623('0x6')]('/api/fax/messages',require(_0x4623('0x34')));_0x7397d9['use'](_0x4623('0x35'),require(_0x4623('0x36')));_0x7397d9[_0x4623('0x6')](_0x4623('0x37'),require(_0x4623('0x38')));_0x7397d9[_0x4623('0x6')](_0x4623('0x39'),require(_0x4623('0x3a')));_0x7397d9[_0x4623('0x6')]('/api/sms/applications',require(_0x4623('0x3b')));_0x7397d9[_0x4623('0x6')](_0x4623('0x3c'),require(_0x4623('0x3d')));_0x7397d9['use'](_0x4623('0x3e'),require(_0x4623('0x3f')));_0x7397d9[_0x4623('0x6')]('/api/sms/queues',require('./api/smsQueue'));_0x7397d9[_0x4623('0x6')]('/api/openchannel/accounts',require(_0x4623('0x40')));_0x7397d9[_0x4623('0x6')]('/api/openchannel/applications',require(_0x4623('0x41')));_0x7397d9['use'](_0x4623('0x42'),require('./api/openchannelInteraction'));_0x7397d9[_0x4623('0x6')]('/api/openchannel/messages',require(_0x4623('0x43')));_0x7397d9[_0x4623('0x6')]('/api/openchannel/queues',require(_0x4623('0x44')));_0x7397d9['use'](_0x4623('0x45'),require('./api/chatWebsite'));_0x7397d9[_0x4623('0x6')]('/api/openchannel/reports/queue',require(_0x4623('0x46')));_0x7397d9[_0x4623('0x6')](_0x4623('0x47'),require(_0x4623('0x48')));_0x7397d9[_0x4623('0x6')](_0x4623('0x49'),require(_0x4623('0x4a')));_0x7397d9[_0x4623('0x6')]('/api/chat/messages',require(_0x4623('0x4b')));_0x7397d9[_0x4623('0x6')](_0x4623('0x4c'),require(_0x4623('0x4d')));_0x7397d9['use'](_0x4623('0x4e'),require(_0x4623('0x4f')));_0x7397d9[_0x4623('0x6')]('/api/chat/groups',require(_0x4623('0x50')));_0x7397d9['use'](_0x4623('0x51'),require('./api/chatProactiveAction'));_0x7397d9[_0x4623('0x6')]('/api/cm/companies',require(_0x4623('0x52')));_0x7397d9['use'](_0x4623('0x53'),require(_0x4623('0x54')));_0x7397d9[_0x4623('0x6')](_0x4623('0x55'),require(_0x4623('0x56')));_0x7397d9[_0x4623('0x6')](_0x4623('0x57'),require(_0x4623('0x58')));_0x7397d9[_0x4623('0x6')](_0x4623('0x59'),require(_0x4623('0x5a')));_0x7397d9['use'](_0x4623('0x5b'),require(_0x4623('0x5c')));_0x7397d9[_0x4623('0x6')](_0x4623('0x5d'),require(_0x4623('0x5e')));_0x7397d9['use'](_0x4623('0x5f'),require('./api/action'));_0x7397d9[_0x4623('0x6')](_0x4623('0x60'),require(_0x4623('0x61')));_0x7397d9[_0x4623('0x6')](_0x4623('0x62'),require(_0x4623('0x63')));_0x7397d9[_0x4623('0x6')](_0x4623('0x64'),require(_0x4623('0x65')));_0x7397d9['use']('/api/conditions',require(_0x4623('0x66')));_0x7397d9[_0x4623('0x6')]('/api/intervals',require(_0x4623('0x67')));_0x7397d9[_0x4623('0x6')]('/api/pauses',require(_0x4623('0x68')));_0x7397d9[_0x4623('0x6')](_0x4623('0x69'),require(_0x4623('0x6a')));_0x7397d9['use'](_0x4623('0x6b'),require(_0x4623('0x6c')));_0x7397d9['use']('/api/schedules',require(_0x4623('0x6d')));_0x7397d9['use'](_0x4623('0x6e'),require(_0x4623('0x6f')));_0x7397d9[_0x4623('0x6')](_0x4623('0x70'),require(_0x4623('0x71')));_0x7397d9[_0x4623('0x6')]('/api/contact_item_types',require('./api/contactItemType'));_0x7397d9[_0x4623('0x6')](_0x4623('0x72'),require(_0x4623('0x73')));_0x7397d9[_0x4623('0x6')](_0x4623('0x74'),require('./api/cmHopperAdditionalPhone'));_0x7397d9[_0x4623('0x6')](_0x4623('0x75'),require(_0x4623('0x76')));_0x7397d9[_0x4623('0x6')]('/api/triggers',require(_0x4623('0x77')));_0x7397d9[_0x4623('0x6')](_0x4623('0x78'),require(_0x4623('0x79')));_0x7397d9['use'](_0x4623('0x7a'),require('./api/integration'));_0x7397d9[_0x4623('0x6')](_0x4623('0x7b'),require(_0x4623('0x7c')));_0x7397d9[_0x4623('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x7397d9['use'](_0x4623('0x7d'),require('./api/analyticDefaultReport'));_0x7397d9[_0x4623('0x6')]('/api/analytics/extracted_reports',require(_0x4623('0x7e')));_0x7397d9[_0x4623('0x6')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x7397d9[_0x4623('0x6')](_0x4623('0x7f'),require(_0x4623('0x80')));_0x7397d9['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x7397d9[_0x4623('0x6')](_0x4623('0x81'),require('./api/intSalesforceAccount'));_0x7397d9['use'](_0x4623('0x82'),require(_0x4623('0x83')));_0x7397d9[_0x4623('0x6')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x7397d9[_0x4623('0x6')](_0x4623('0x84'),require(_0x4623('0x85')));_0x7397d9[_0x4623('0x6')](_0x4623('0x86'),require('./api/intSugarcrmConfiguration'));_0x7397d9[_0x4623('0x6')]('/api/integrations/sugarcrm/fields',require(_0x4623('0x87')));_0x7397d9[_0x4623('0x6')](_0x4623('0x88'),require('./api/intDeskAccount'));_0x7397d9[_0x4623('0x6')](_0x4623('0x89'),require('./api/intDeskConfiguration'));_0x7397d9['use'](_0x4623('0x8a'),require('./api/intDeskField'));_0x7397d9[_0x4623('0x6')](_0x4623('0x8b'),require(_0x4623('0x8c')));_0x7397d9[_0x4623('0x6')](_0x4623('0x8d'),require('./api/intZohoConfiguration'));_0x7397d9[_0x4623('0x6')](_0x4623('0x8e'),require(_0x4623('0x8f')));_0x7397d9['use'](_0x4623('0x90'),require('./api/intZendeskAccount'));_0x7397d9['use'](_0x4623('0x91'),require(_0x4623('0x92')));_0x7397d9[_0x4623('0x6')](_0x4623('0x93'),require(_0x4623('0x94')));_0x7397d9[_0x4623('0x6')](_0x4623('0x95'),require(_0x4623('0x96')));_0x7397d9['use'](_0x4623('0x97'),require('./api/intFreshdeskConfiguration'));_0x7397d9[_0x4623('0x6')](_0x4623('0x98'),require(_0x4623('0x99')));_0x7397d9[_0x4623('0x6')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x7397d9[_0x4623('0x6')]('/api/integrations/vtiger/configurations',require(_0x4623('0x9a')));_0x7397d9[_0x4623('0x6')](_0x4623('0x9b'),require(_0x4623('0x9c')));_0x7397d9['use'](_0x4623('0x9d'),require(_0x4623('0x9e')));_0x7397d9[_0x4623('0x6')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x7397d9[_0x4623('0x6')]('/api/integrations/servicenow/fields',require(_0x4623('0x9f')));_0x7397d9['use']('/api/integrations/dynamics365/accounts',require(_0x4623('0xa0')));_0x7397d9[_0x4623('0x6')]('/api/integrations/dynamics365/configurations',require(_0x4623('0xa1')));_0x7397d9[_0x4623('0x6')](_0x4623('0xa2'),require('./api/intDynamics365Field'));_0x7397d9['use'](_0x4623('0xa3'),require(_0x4623('0xa4')));_0x7397d9['use']('/api/integrations/freshsales/configurations',require(_0x4623('0xa5')));_0x7397d9[_0x4623('0x6')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x7397d9[_0x4623('0x6')](_0x4623('0xa6'),require('./api/network'));_0x7397d9[_0x4623('0x6')](_0x4623('0xa7'),require(_0x4623('0xa8')));_0x7397d9[_0x4623('0x6')](_0x4623('0xa9'),require(_0x4623('0xaa')));_0x7397d9['use']('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x7397d9[_0x4623('0x6')](_0x4623('0xab'),require(_0x4623('0xac')));_0x7397d9[_0x4623('0x6')](_0x4623('0xad'),require(_0x4623('0xae')));_0x7397d9[_0x4623('0x6')](_0x4623('0xaf'),require(_0x4623('0xb0')));_0x7397d9['use']('/api/square/reports',require(_0x4623('0xb1')));_0x7397d9[_0x4623('0x6')]('/api/square/details/reports',require(_0x4623('0xb2')));_0x7397d9[_0x4623('0x6')]('/api/jscripty/projects',require(_0x4623('0xb3')));_0x7397d9[_0x4623('0x6')](_0x4623('0xb4'),require(_0x4623('0xb5')));_0x7397d9['use'](_0x4623('0xb6'),require(_0x4623('0xb7')));_0x7397d9[_0x4623('0x6')](_0x4623('0xb8'),require('./api/squareProject'));_0x7397d9[_0x4623('0x6')]('/api/square/recordings',require('./api/squareRecording'));_0x7397d9['use'](_0x4623('0xb9'),require(_0x4623('0xba')));_0x7397d9[_0x4623('0x6')](_0x4623('0xbb'),require(_0x4623('0xbc')));_0x7397d9['use']('/api/license',require(_0x4623('0xbd')));_0x7397d9[_0x4623('0x6')](_0x4623('0xbe'),require(_0x4623('0xbf')));_0x7397d9[_0x4623('0x6')](_0x4623('0xc0'),require(_0x4623('0xc1')));_0x7397d9[_0x4623('0x6')](_0x4623('0xc2'),require(_0x4623('0xc3')));_0x7397d9[_0x4623('0x6')]('/api/plugins',require(_0x4623('0xc4')));_0x7397d9[_0x4623('0x6')](_0x4623('0xc5'),require(_0x4623('0xc6')));_0x7397d9[_0x4623('0x6')]('/api/chat/reports/transfer',require(_0x4623('0xc7')));_0x7397d9['use']('/api/fax/reports/transfer',require(_0x4623('0xc8')));_0x7397d9['use'](_0x4623('0xc9'),require(_0x4623('0xca')));_0x7397d9[_0x4623('0x6')](_0x4623('0xcb'),require(_0x4623('0xcc')));_0x7397d9[_0x4623('0x6')](_0x4623('0xcd'),require(_0x4623('0xce')));_0x7397d9['use'](_0x4623('0xcf'),require('./api/voicePrefix'));_0x7397d9['use'](_0x4623('0xd0'),require(_0x4623('0xd1')));_0x7397d9[_0x4623('0x6')](_0x4623('0xd2'),require('./api/userProfileSection'));_0x7397d9[_0x4623('0x6')](_0x4623('0xd3'),require(_0x4623('0xd4')));_0x7397d9[_0x4623('0x6')](_0x4623('0xd5'),require(_0x4623('0xd6')));_0x7397d9['use'](_0x4623('0xd7'),require(_0x4623('0xd8')));_0x7397d9[_0x4623('0x6')]('/api/whatsapp/applications',require(_0x4623('0xd9')));_0x7397d9[_0x4623('0x6')](_0x4623('0xda'),require('./api/whatsappInteraction'));_0x7397d9[_0x4623('0x6')]('/api/whatsapp/messages',require(_0x4623('0xdb')));_0x7397d9['use'](_0x4623('0xdc'),require(_0x4623('0xdd')));_0x7397d9[_0x4623('0x6')](_0x4623('0xde'),require(_0x4623('0xdf')));_0x7397d9[_0x4623('0x6')](_0x4623('0xe0'),require(_0x4623('0xe1')));_0x7397d9['use'](_0x4623('0xe2'),require(_0x4623('0xe3')));_0x7397d9[_0x4623('0x6')]('/api/realtime',require(_0x4623('0xe4')));_0x7397d9[_0x4623('0x6')](_0x4623('0xe5'),require('./api/user-setting'));_0x7397d9[_0x4623('0x6')]('/api/auth/local',require(_0x4623('0xe6')));_0x7397d9['use'](_0x4623('0xe7'),require(_0x4623('0xe8')));_0x7397d9[_0x4623('0x6')]('/api/auth/activedirectory',require(_0x4623('0xe9')));_0x7397d9[_0x4623('0x6')](_0x4623('0xea'),require(_0x4623('0xeb')));_0x7397d9[_0x4623('0x6')](_0x4623('0xec'),require(_0x4623('0xed')));_0x7397d9[_0x4623('0x6')](_0x4623('0xee'),require(_0x4623('0xef')));_0x7397d9[_0x4623('0x6')](_0x4623('0xf0'),require('./api/system'));_0x7397d9['use'](_0x4623('0xf1'),require('./api/pm2'));_0x7397d9[_0x4623('0x6')](_0x4623('0xf2'),require('./api/webbar'));_0x7397d9[_0x4623('0x6')](_0x4623('0xf3'),clientSideLogs);_0x7397d9['use'](_0x4623('0xf4'),express[_0x4623('0xf5')](path[_0x4623('0xf6')](config[_0x4623('0xf7')],_0x4623('0xf4'))));_0x7397d9[_0x4623('0x6')](_0x4623('0xf8'),express[_0x4623('0xf5')](path[_0x4623('0xf6')](config[_0x4623('0xf7')],_0x4623('0xf8'))));_0x7397d9[_0x4623('0x6')](_0x4623('0xf9'),express['static'](path['join'](config['root'],_0x4623('0xf9'))));_0x7397d9[_0x4623('0x6')](_0x4623('0xfa'),express[_0x4623('0xf5')](path[_0x4623('0xf6')](config[_0x4623('0xf7')],'snippet',_0x4623('0xfb'))));_0x7397d9[_0x4623('0x6')](_0x4623('0xfc'),express[_0x4623('0xf5')](path['join'](config['root'],_0x4623('0xfd'))));_0x7397d9[_0x4623('0xfe')](_0x4623('0xff'))['get'](errors[0x194]);_0x7397d9[_0x4623('0xfe')]('/*')[_0x4623('0x100')](function(_0x53e0e9,_0x33997c){_0x33997c['sendFile'](path[_0x4623('0x101')](_0x7397d9[_0x4623('0x100')](_0x4623('0x102'))+'/index.html'));});return _0x7397d9;});};
\ No newline at end of file
+var _0x85b2=['/api/integrations/salesforce/accounts','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','/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/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','./api/setting','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/jira','/api/rpc','./api/rpc','/api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','root','/www','static','join','/demo','snippet','/plugins','/server/files/plugins','route','get','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/dispositions','./api/disposition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/sounds','./api/sound','/api/contact_item_types','./api/contactItemType','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports'];(function(_0x1fb09b,_0x1db08e){var _0x3574c6=function(_0x217a41){while(--_0x217a41){_0x1fb09b['push'](_0x1fb09b['shift']());}};_0x3574c6(++_0x1db08e);}(_0x85b2,0x199));var _0x285b=function(_0x4a8df7,_0x49068e){_0x4a8df7=_0x4a8df7-0x0;var _0x597827=_0x85b2[_0x4a8df7];return _0x597827;};'use strict';var path=require(_0x285b('0x0'));var express=require(_0x285b('0x1'));var errors=require(_0x285b('0x2'));var config=require(_0x285b('0x3'));var setupLoggers=require(_0x285b('0x4'))['setupLoggers'];var clientSideLogs=require(_0x285b('0x5'));exports[_0x285b('0x6')]=function(_0xa6968e){return setupLoggers(_0xa6968e)[_0x285b('0x7')](function(){_0xa6968e[_0x285b('0x8')]('/api/users',require(_0x285b('0x9')));_0xa6968e[_0x285b('0x8')](_0x285b('0xa'),require('./api/voiceChanSpy'));_0xa6968e[_0x285b('0x8')](_0x285b('0xb'),require(_0x285b('0xc')));_0xa6968e[_0x285b('0x8')]('/api/voice/extensions',require(_0x285b('0xd')));_0xa6968e[_0x285b('0x8')](_0x285b('0xe'),require('./api/voiceMusicOnHold'));_0xa6968e[_0x285b('0x8')]('/api/voice/queues',require(_0x285b('0xf')));_0xa6968e['use'](_0x285b('0x10'),require('./api/voiceRecording'));_0xa6968e['use'](_0x285b('0x11'),require(_0x285b('0x12')));_0xa6968e[_0x285b('0x8')](_0x285b('0x13'),require(_0x285b('0x14')));_0xa6968e['use'](_0x285b('0x15'),require(_0x285b('0x16')));_0xa6968e['use'](_0x285b('0x17'),require(_0x285b('0x18')));_0xa6968e[_0x285b('0x8')](_0x285b('0x19'),require(_0x285b('0x1a')));_0xa6968e[_0x285b('0x8')]('/api/voice/agents/reports',require(_0x285b('0x1b')));_0xa6968e[_0x285b('0x8')](_0x285b('0x1c'),require(_0x285b('0x1d')));_0xa6968e['use'](_0x285b('0x1e'),require('./api/memberReport'));_0xa6968e[_0x285b('0x8')](_0x285b('0x1f'),require(_0x285b('0x20')));_0xa6968e[_0x285b('0x8')](_0x285b('0x21'),require('./api/voiceTransferReport'));_0xa6968e['use'](_0x285b('0x22'),require(_0x285b('0x23')));_0xa6968e['use']('/api/mail/accounts',require(_0x285b('0x24')));_0xa6968e[_0x285b('0x8')](_0x285b('0x25'),require('./api/mailQueue'));_0xa6968e[_0x285b('0x8')](_0x285b('0x26'),require(_0x285b('0x27')));_0xa6968e[_0x285b('0x8')](_0x285b('0x28'),require(_0x285b('0x29')));_0xa6968e[_0x285b('0x8')](_0x285b('0x2a'),require('./api/mailMessage'));_0xa6968e['use'](_0x285b('0x2b'),require(_0x285b('0x2c')));_0xa6968e[_0x285b('0x8')](_0x285b('0x2d'),require(_0x285b('0x2e')));_0xa6968e['use'](_0x285b('0x2f'),require('./api/dashboard'));_0xa6968e[_0x285b('0x8')]('/api/dashboards/items',require('./api/dashboardItem'));_0xa6968e[_0x285b('0x8')](_0x285b('0x30'),require(_0x285b('0x31')));_0xa6968e[_0x285b('0x8')](_0x285b('0x32'),require(_0x285b('0x33')));_0xa6968e[_0x285b('0x8')]('/api/fax/interactions',require(_0x285b('0x34')));_0xa6968e[_0x285b('0x8')]('/api/fax/messages',require(_0x285b('0x35')));_0xa6968e[_0x285b('0x8')](_0x285b('0x36'),require(_0x285b('0x37')));_0xa6968e['use'](_0x285b('0x38'),require(_0x285b('0x39')));_0xa6968e['use'](_0x285b('0x3a'),require('./api/smsAccount'));_0xa6968e[_0x285b('0x8')](_0x285b('0x3b'),require(_0x285b('0x3c')));_0xa6968e[_0x285b('0x8')]('/api/sms/interactions',require('./api/smsInteraction'));_0xa6968e[_0x285b('0x8')](_0x285b('0x3d'),require(_0x285b('0x3e')));_0xa6968e[_0x285b('0x8')](_0x285b('0x3f'),require(_0x285b('0x40')));_0xa6968e['use'](_0x285b('0x41'),require(_0x285b('0x42')));_0xa6968e[_0x285b('0x8')](_0x285b('0x43'),require(_0x285b('0x44')));_0xa6968e[_0x285b('0x8')](_0x285b('0x45'),require(_0x285b('0x46')));_0xa6968e['use'](_0x285b('0x47'),require(_0x285b('0x48')));_0xa6968e['use'](_0x285b('0x49'),require(_0x285b('0x4a')));_0xa6968e[_0x285b('0x8')](_0x285b('0x4b'),require(_0x285b('0x4c')));_0xa6968e[_0x285b('0x8')](_0x285b('0x4d'),require(_0x285b('0x4e')));_0xa6968e[_0x285b('0x8')](_0x285b('0x4f'),require(_0x285b('0x50')));_0xa6968e[_0x285b('0x8')](_0x285b('0x51'),require(_0x285b('0x52')));_0xa6968e[_0x285b('0x8')](_0x285b('0x53'),require(_0x285b('0x54')));_0xa6968e['use'](_0x285b('0x55'),require(_0x285b('0x56')));_0xa6968e[_0x285b('0x8')]('/api/chat/queues',require(_0x285b('0x57')));_0xa6968e[_0x285b('0x8')](_0x285b('0x58'),require(_0x285b('0x59')));_0xa6968e['use'](_0x285b('0x5a'),require('./api/chatProactiveAction'));_0xa6968e['use'](_0x285b('0x5b'),require('./api/cmCompany'));_0xa6968e['use']('/api/cm/contacts',require(_0x285b('0x5c')));_0xa6968e[_0x285b('0x8')]('/api/cm/hopper',require(_0x285b('0x5d')));_0xa6968e['use']('/api/cm/hopper_black',require(_0x285b('0x5e')));_0xa6968e[_0x285b('0x8')]('/api/cm/hopper_final',require(_0x285b('0x5f')));_0xa6968e['use'](_0x285b('0x60'),require('./api/cmHopperHistory'));_0xa6968e['use'](_0x285b('0x61'),require(_0x285b('0x62')));_0xa6968e[_0x285b('0x8')](_0x285b('0x63'),require(_0x285b('0x64')));_0xa6968e[_0x285b('0x8')]('/api/automations',require(_0x285b('0x65')));_0xa6968e['use']('/api/canned_answers',require('./api/cannedAnswer'));_0xa6968e[_0x285b('0x8')](_0x285b('0x66'),require(_0x285b('0x67')));_0xa6968e['use']('/api/conditions',require('./api/condition'));_0xa6968e[_0x285b('0x8')](_0x285b('0x68'),require(_0x285b('0x69')));_0xa6968e['use'](_0x285b('0x6a'),require(_0x285b('0x6b')));_0xa6968e[_0x285b('0x8')](_0x285b('0x6c'),require('./api/cdr'));_0xa6968e['use'](_0x285b('0x6d'),require('./api/voiceQueuesLog'));_0xa6968e[_0x285b('0x8')]('/api/schedules',require('./api/schedule'));_0xa6968e[_0x285b('0x8')](_0x285b('0x6e'),require(_0x285b('0x6f')));_0xa6968e[_0x285b('0x8')]('/api/tags',require('./api/tag'));_0xa6968e[_0x285b('0x8')](_0x285b('0x70'),require(_0x285b('0x71')));_0xa6968e['use']('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0xa6968e['use'](_0x285b('0x72'),require(_0x285b('0x73')));_0xa6968e['use'](_0x285b('0x74'),require(_0x285b('0x75')));_0xa6968e[_0x285b('0x8')](_0x285b('0x76'),require('./api/trigger'));_0xa6968e[_0x285b('0x8')](_0x285b('0x77'),require(_0x285b('0x78')));_0xa6968e['use'](_0x285b('0x79'),require(_0x285b('0x7a')));_0xa6968e[_0x285b('0x8')]('/api/integrations/reports',require(_0x285b('0x7b')));_0xa6968e[_0x285b('0x8')](_0x285b('0x7c'),require(_0x285b('0x7d')));_0xa6968e[_0x285b('0x8')](_0x285b('0x7e'),require(_0x285b('0x7f')));_0xa6968e[_0x285b('0x8')](_0x285b('0x80'),require(_0x285b('0x81')));_0xa6968e[_0x285b('0x8')](_0x285b('0x82'),require(_0x285b('0x83')));_0xa6968e['use'](_0x285b('0x84'),require(_0x285b('0x85')));_0xa6968e['use'](_0x285b('0x86'),require('./api/analyticTreeReport'));_0xa6968e[_0x285b('0x8')](_0x285b('0x87'),require('./api/intSalesforceAccount'));_0xa6968e[_0x285b('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0xa6968e['use'](_0x285b('0x88'),require(_0x285b('0x89')));_0xa6968e[_0x285b('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x285b('0x8a')));_0xa6968e[_0x285b('0x8')](_0x285b('0x8b'),require(_0x285b('0x8c')));_0xa6968e[_0x285b('0x8')](_0x285b('0x8d'),require(_0x285b('0x8e')));_0xa6968e[_0x285b('0x8')](_0x285b('0x8f'),require(_0x285b('0x90')));_0xa6968e[_0x285b('0x8')]('/api/integrations/desk/configurations',require(_0x285b('0x91')));_0xa6968e[_0x285b('0x8')]('/api/integrations/desk/fields',require(_0x285b('0x92')));_0xa6968e[_0x285b('0x8')](_0x285b('0x93'),require(_0x285b('0x94')));_0xa6968e[_0x285b('0x8')](_0x285b('0x95'),require(_0x285b('0x96')));_0xa6968e[_0x285b('0x8')](_0x285b('0x97'),require(_0x285b('0x98')));_0xa6968e[_0x285b('0x8')](_0x285b('0x99'),require(_0x285b('0x9a')));_0xa6968e[_0x285b('0x8')](_0x285b('0x9b'),require(_0x285b('0x9c')));_0xa6968e[_0x285b('0x8')](_0x285b('0x9d'),require(_0x285b('0x9e')));_0xa6968e[_0x285b('0x8')](_0x285b('0x9f'),require('./api/intFreshdeskAccount'));_0xa6968e[_0x285b('0x8')](_0x285b('0xa0'),require(_0x285b('0xa1')));_0xa6968e[_0x285b('0x8')]('/api/integrations/freshdesk/fields',require(_0x285b('0xa2')));_0xa6968e[_0x285b('0x8')]('/api/integrations/vtiger/accounts',require(_0x285b('0xa3')));_0xa6968e[_0x285b('0x8')](_0x285b('0xa4'),require(_0x285b('0xa5')));_0xa6968e['use']('/api/integrations/vtiger/fields',require(_0x285b('0xa6')));_0xa6968e['use'](_0x285b('0xa7'),require('./api/intServicenowAccount'));_0xa6968e[_0x285b('0x8')](_0x285b('0xa8'),require('./api/intServicenowConfiguration'));_0xa6968e['use'](_0x285b('0xa9'),require(_0x285b('0xaa')));_0xa6968e[_0x285b('0x8')](_0x285b('0xab'),require(_0x285b('0xac')));_0xa6968e['use']('/api/integrations/dynamics365/configurations',require(_0x285b('0xad')));_0xa6968e[_0x285b('0x8')](_0x285b('0xae'),require('./api/intDynamics365Field'));_0xa6968e[_0x285b('0x8')](_0x285b('0xaf'),require('./api/intFreshsalesAccount'));_0xa6968e[_0x285b('0x8')](_0x285b('0xb0'),require(_0x285b('0xb1')));_0xa6968e[_0x285b('0x8')](_0x285b('0xb2'),require(_0x285b('0xb3')));_0xa6968e[_0x285b('0x8')](_0x285b('0xb4'),require(_0x285b('0xb5')));_0xa6968e['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0xa6968e[_0x285b('0x8')](_0x285b('0xb6'),require(_0x285b('0xb7')));_0xa6968e[_0x285b('0x8')](_0x285b('0xb8'),require(_0x285b('0xb9')));_0xa6968e[_0x285b('0x8')]('/api/jscripty/questions/reports',require(_0x285b('0xba')));_0xa6968e['use'](_0x285b('0xbb'),require(_0x285b('0xbc')));_0xa6968e[_0x285b('0x8')](_0x285b('0xbd'),require(_0x285b('0xbe')));_0xa6968e[_0x285b('0x8')](_0x285b('0xbf'),require(_0x285b('0xc0')));_0xa6968e[_0x285b('0x8')]('/api/square/details/reports',require(_0x285b('0xc1')));_0xa6968e[_0x285b('0x8')]('/api/jscripty/projects',require(_0x285b('0xc2')));_0xa6968e[_0x285b('0x8')]('/api/settings',require(_0x285b('0xc3')));_0xa6968e[_0x285b('0x8')]('/api/square/odbc',require('./api/squareOdbc'));_0xa6968e[_0x285b('0x8')]('/api/square/projects',require(_0x285b('0xc4')));_0xa6968e['use'](_0x285b('0xc5'),require(_0x285b('0xc6')));_0xa6968e['use']('/api/square/messages',require(_0x285b('0xc7')));_0xa6968e['use'](_0x285b('0xc8'),require(_0x285b('0xc9')));_0xa6968e[_0x285b('0x8')](_0x285b('0xca'),require(_0x285b('0xcb')));_0xa6968e[_0x285b('0x8')](_0x285b('0xcc'),require(_0x285b('0xcd')));_0xa6968e['use'](_0x285b('0xce'),require(_0x285b('0xcf')));_0xa6968e[_0x285b('0x8')](_0x285b('0xd0'),require(_0x285b('0xd1')));_0xa6968e[_0x285b('0x8')](_0x285b('0xd2'),require(_0x285b('0xd3')));_0xa6968e[_0x285b('0x8')](_0x285b('0xd4'),require(_0x285b('0xd5')));_0xa6968e['use']('/api/chat/reports/transfer',require(_0x285b('0xd6')));_0xa6968e[_0x285b('0x8')](_0x285b('0xd7'),require(_0x285b('0xd8')));_0xa6968e['use'](_0x285b('0xd9'),require(_0x285b('0xda')));_0xa6968e[_0x285b('0x8')](_0x285b('0xdb'),require('./api/smsTransferReport'));_0xa6968e[_0x285b('0x8')](_0x285b('0xdc'),require(_0x285b('0xdd')));_0xa6968e['use'](_0x285b('0xde'),require(_0x285b('0xdf')));_0xa6968e['use']('/api/userProfiles',require(_0x285b('0xe0')));_0xa6968e['use'](_0x285b('0xe1'),require(_0x285b('0xe2')));_0xa6968e[_0x285b('0x8')](_0x285b('0xe3'),require(_0x285b('0xe4')));_0xa6968e[_0x285b('0x8')](_0x285b('0xe5'),require('./api/userNotification'));_0xa6968e[_0x285b('0x8')](_0x285b('0xe6'),require('./api/whatsappAccount'));_0xa6968e[_0x285b('0x8')](_0x285b('0xe7'),require(_0x285b('0xe8')));_0xa6968e[_0x285b('0x8')](_0x285b('0xe9'),require(_0x285b('0xea')));_0xa6968e[_0x285b('0x8')](_0x285b('0xeb'),require(_0x285b('0xec')));_0xa6968e['use'](_0x285b('0xed'),require(_0x285b('0xee')));_0xa6968e[_0x285b('0x8')](_0x285b('0xef'),require(_0x285b('0xf0')));_0xa6968e[_0x285b('0x8')](_0x285b('0xf1'),require(_0x285b('0xf2')));_0xa6968e[_0x285b('0x8')](_0x285b('0xf3'),require(_0x285b('0xf4')));_0xa6968e[_0x285b('0x8')](_0x285b('0xf5'),require('./api/realtime'));_0xa6968e[_0x285b('0x8')](_0x285b('0xf6'),require('./api/user-setting'));_0xa6968e[_0x285b('0x8')]('/api/auth/local',require(_0x285b('0xf7')));_0xa6968e[_0x285b('0x8')](_0x285b('0xf8'),require(_0x285b('0xf9')));_0xa6968e[_0x285b('0x8')](_0x285b('0xfa'),require('./api/authActiveDirectory'));_0xa6968e['use']('/api/jira',require(_0x285b('0xfb')));_0xa6968e['use'](_0x285b('0xfc'),require(_0x285b('0xfd')));_0xa6968e[_0x285b('0x8')](_0x285b('0xfe'),require('./api/version'));_0xa6968e[_0x285b('0x8')]('/api/system',require('./api/system'));_0xa6968e['use'](_0x285b('0xff'),require(_0x285b('0x100')));_0xa6968e[_0x285b('0x8')](_0x285b('0x101'),require(_0x285b('0x102')));_0xa6968e[_0x285b('0x8')]('/api/logs',clientSideLogs);_0xa6968e[_0x285b('0x8')](_0x285b('0x103'),express['static'](path['join'](config[_0x285b('0x104')],_0x285b('0x103'))));_0xa6968e[_0x285b('0x8')](_0x285b('0x105'),express[_0x285b('0x106')](path[_0x285b('0x107')](config['root'],'/www')));_0xa6968e[_0x285b('0x8')](_0x285b('0x108'),express['static'](path[_0x285b('0x107')](config['root'],_0x285b('0x108'))));_0xa6968e[_0x285b('0x8')]('/snippet',express['static'](path[_0x285b('0x107')](config[_0x285b('0x104')],_0x285b('0x109'),'3.1.0')));_0xa6968e[_0x285b('0x8')](_0x285b('0x10a'),express[_0x285b('0x106')](path[_0x285b('0x107')](config[_0x285b('0x104')],_0x285b('0x10b'))));_0xa6968e[_0x285b('0x10c')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x285b('0x10d')](errors[0x194]);_0xa6968e[_0x285b('0x10c')]('/*')[_0x285b('0x10d')](function(_0x586e6d,_0x5b83a7){_0x5b83a7['sendFile'](path[_0x285b('0x10e')](_0xa6968e[_0x285b('0x10d')]('appPath')+_0x285b('0x10f')));});return _0xa6968e;});};
\ No newline at end of file
index 2c79882..d48b4e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b95=['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/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.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/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default'];(function(_0x1b6cf0,_0x218585){var _0x19dfe7=function(_0x1d108b){while(--_0x1d108b){_0x1b6cf0['push'](_0x1b6cf0['shift']());}};_0x19dfe7(++_0x218585);}(_0x2b95,0x1f1));var _0x52b9=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x2b95[_0x297c55];return _0x120389;};'use strict';var jayson=require(_0x52b9('0x0'));var _=require(_0x52b9('0x1'));var config=require(_0x52b9('0x2'));exports[_0x52b9('0x3')]=function(){return new Promise(function(_0xafb63f,_0x205690){var _0x333974={};_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x5')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/voiceExtension/voiceExtension.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x6')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x7')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x8')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x9')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0xa')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0xb')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0xc')));_0x333974=_['merge'](_0x333974,require('../api/trunk/trunk.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0xd')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0xe')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0xf')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x10')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/mailQueue/mailQueue.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x11')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x12')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/mailApplication/mailApplication.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x13')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x14')));_0x333974=_['merge'](_0x333974,require('../api/faxApplication/faxApplication.rpc'));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x15')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/faxMessage/faxMessage.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x16')));_0x333974=_['merge'](_0x333974,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x17')));_0x333974=_['merge'](_0x333974,require('../api/smsInteraction/smsInteraction.rpc'));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x18')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x19')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x1a')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x1b')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x1c')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x1d')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x1e')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x1f')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x20')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x21')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x22')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x23')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x24')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x25')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/interval/interval.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x26')));_0x333974=_['merge'](_0x333974,require(_0x52b9('0x27')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x28')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/template/template.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/trigger/trigger.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x29')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x2a')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x2b')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x2c')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x2d')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x2e')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x2f')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x30')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x31')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x32')));_0x333974=_['merge'](_0x333974,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x33')));_0x333974=_[_0x52b9('0x4')](_0x333974,require('../api/squareOdbc/squareOdbc.rpc'));_0x333974=_['merge'](_0x333974,require('../api/squareProject/squareProject.rpc'));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x34')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x35')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x36')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x37')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x38')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x39')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x3a')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x3b')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x3c')));_0x333974=_[_0x52b9('0x4')](_0x333974,require(_0x52b9('0x3d')));var _0x39d8d7=jayson[_0x52b9('0x3e')](_0x333974)[_0x52b9('0x3f')]();var _0x40d6bd=config[_0x52b9('0x40')]['port']||config[_0x52b9('0x41')]+0x1;var _0xcfbc50=config[_0x52b9('0x40')]['ip']||_0x52b9('0x42');_0x39d8d7['on'](_0x52b9('0x43'),function(_0x5e2a16){return _0x205690(_0x5e2a16);});_0x39d8d7['listen'](_0x40d6bd,_0xcfbc50,function(){console[_0x52b9('0x44')](_0x52b9('0x45'),_0xcfbc50,_0x40d6bd);require('../config/triggers')[_0x52b9('0x46')]();return _0xafb63f('RPC\x20listening\x20on\x20'+_0xcfbc50+':'+_0x40d6bd);});});};
\ No newline at end of file
+var _0x4c60=['log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.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','server','rpc','port','localhost','error'];(function(_0x5555fd,_0x31b11c){var _0x174889=function(_0x1afb16){while(--_0x1afb16){_0x5555fd['push'](_0x5555fd['shift']());}};_0x174889(++_0x31b11c);}(_0x4c60,0x166));var _0x04c6=function(_0x265263,_0x291a6b){_0x265263=_0x265263-0x0;var _0x2b34c9=_0x4c60[_0x265263];return _0x2b34c9;};'use strict';var jayson=require(_0x04c6('0x0'));var _=require(_0x04c6('0x1'));var config=require(_0x04c6('0x2'));exports[_0x04c6('0x3')]=function(){return new Promise(function(_0x4fa03c,_0xb730cc){var _0x59028f={};_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x4')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x6')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/voiceQueue/voiceQueue.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x7')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x8')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x9')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0xa')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0xb')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0xc')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0xd')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0xe')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0xf')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/mailAccount/mailAccount.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x10')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x11')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/mailMessage/mailMessage.rpc'));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x12')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x13')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x14')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x15')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x16')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x17')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/faxQueue/faxQueue.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x18')));_0x59028f=_['merge'](_0x59028f,require('../api/smsInteraction/smsInteraction.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/smsMessage/smsMessage.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x19')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x1a')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x1b')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x1c')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x1d')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/chatInteraction/chatInteraction.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x1e')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x1f')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x20')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x21')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x22')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x23')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x24')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x25')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x26')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x27')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x28')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x29')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x2a')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x2b')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x2c')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x2d')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x2e')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x2f')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x30')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x31')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x32')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x33')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x34')));_0x59028f=_['merge'](_0x59028f,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x35')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/squareOdbc/squareOdbc.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x36')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x37')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x38')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x39')));_0x59028f=_['merge'](_0x59028f,require('../api/attachment/attachment.rpc'));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x3a')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x3b')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x3c')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require(_0x04c6('0x3d')));_0x59028f=_['merge'](_0x59028f,require(_0x04c6('0x3e')));_0x59028f=_[_0x04c6('0x5')](_0x59028f,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4695e1=jayson[_0x04c6('0x3f')](_0x59028f)['http']();var _0x2bf19a=config[_0x04c6('0x40')]['port']||config[_0x04c6('0x41')]+0x1;var _0x80073=config[_0x04c6('0x40')]['ip']||_0x04c6('0x42');_0x4695e1['on'](_0x04c6('0x43'),function(_0xbb924a){return _0xb730cc(_0xbb924a);});_0x4695e1[_0x04c6('0x3')](_0x2bf19a,_0x80073,function(){console[_0x04c6('0x44')](_0x04c6('0x45'),_0x80073,_0x2bf19a);require(_0x04c6('0x46'))['default']();return _0x4fa03c('RPC\x20listening\x20on\x20'+_0x80073+':'+_0x2bf19a);});});};
\ No newline at end of file
index 2ac98f5..abb11e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6462=['lodash','events','EventEmitter','./error','call','setTimeout','setEncoding','utf8','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','function','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sendRequest','sync','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','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','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','label','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6462,0x11f));var _0x2646=function(_0x40dbb9,_0x498dbe){_0x40dbb9=_0x40dbb9-0x0;var _0x32af4e=_0x6462[_0x40dbb9];return _0x32af4e;};'use strict';var util=require(_0x2646('0x0'));var _=require(_0x2646('0x1'));var EventEmitter=require(_0x2646('0x2'))[_0x2646('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x2646('0x4'));function AGIChannel(_0x888ca2){var _0x1e967b=this,_0x352971=new AGIReply(),_0x34c686=![],_0x1b592f={};EventEmitter[_0x2646('0x5')](_0x1e967b);_0x888ca2['setEncoding']('utf8');_0x888ca2[_0x2646('0x6')](0x8*0x3c*0x3c*0x3e8);_0x352971[_0x2646('0x7')](_0x2646('0x8'));_0x352971['on']('headers',function(_0x22796c){for(var _0xf19960 in _0x22796c){_0x1e967b[_0xf19960]=_0x22796c[_0xf19960];}_0x1e967b[_0x2646('0x9')](_0x2646('0xa'));});_0x352971['on'](_0x2646('0xb'),function(_0x19a547){if(_0x19a547['toLowerCase']()==_0x2646('0xc')){_0x1e967b[_0x2646('0x9')]('hangup');return;}if(_0x19a547[_0x2646('0xd')](0x0,0xb)=='520-Invalid'){_0x34c686=!![];}if(_0x34c686){_0x1b592f['rx']+=_0x19a547+'\x0a';if(_0x19a547[_0x2646('0xe')](_0x2646('0xf'))!=-0x1){_0x34c686=![];}}else{_0x1b592f['rx']=_0x19a547;}if(_0x34c686){return;}if(typeof _0x1b592f['cb']==_0x2646('0x10')){var _0x3ea81f=_0x1b592f['rx']['substring'](0x0,0x3),_0x591f4c=null,_0x7c9590=null;_0x3ea81f=parseInt(_0x3ea81f);if(isNaN(_0x3ea81f)){_0x1b592f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3ea81f!=0xc8){_0x1b592f['cb'](null,{'code':_0x3ea81f,'result':-0x1,'extra':'KO'});return;}_0x591f4c=_0x1b592f['rx'][_0x2646('0xd')](0x4)['replace'](_0x2646('0x11'),'');if(_0x591f4c[_0x2646('0x12')]('\x20')!=-0x1){_0x591f4c=_0x591f4c[_0x2646('0x13')](0x0,_0x591f4c['indexOf']('\x20'));}if(_['startsWith'](_0x591f4c,'-1')){_0x591f4c=parseInt(_0x591f4c);}_0x7c9590=_0x1b592f['rx'][_0x2646('0x14')]('\x20');if(_0x7c9590[_0x2646('0x15')]==0x3){_0x7c9590=_0x7c9590[0x2]['substring'](0x1,_0x7c9590[0x2]['length']-0x1);}else if(_0x7c9590[_0x2646('0x15')]>0x3){var _0x29d0e6=/\((.+)\)/;var _0x22819e=_0x1b592f['rx'][_0x2646('0x16')](_0x29d0e6);if(_0x22819e){_0x7c9590=_0x22819e[0x1];}else{_0x7c9590=null;}}else{_0x7c9590=null;}_0x1b592f['cb'](null,{'code':_0x3ea81f,'result':_0x591f4c,'extra':_0x7c9590});}});_0x888ca2['on'](_0x2646('0x17'),function(_0x25a1a9){_0x1e967b[_0x2646('0x9')](_0x2646('0x17'),new AGIError(_0x2646('0x18'),_0x25a1a9[_0x2646('0x19')]));});_0x888ca2['on'](_0x2646('0x1a'),function(){_0x1e967b['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x888ca2['on'](_0x2646('0x1b'),function(){_0x1e967b[_0x2646('0x9')](_0x2646('0x1b'),new AGIError(_0x2646('0x1c')));_0x888ca2[_0x2646('0x1d')]();});_0x888ca2['pipe'](_0x352971);this[_0x2646('0x1e')]=function(_0x2a2207,_0x3d4c82){var _0x2a2207=_0x2a2207||'',_0x3d4c82=typeof _0x3d4c82==_0x2646('0x10')?_0x3d4c82:new Function();_0x1b592f={'tx':_0x2a2207,'rx':'','cb':_0x3d4c82};_0x888ca2[_0x2646('0x1f')](_0x2a2207+'\x0a');},this[_0x2646('0x1a')]=function(){_0x888ca2[_0x2646('0x1d')]();};}util[_0x2646('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x2646('0x21')][_0x2646('0x22')]=function(_0x228ec5){return this['command'][_0x2646('0x23')](this,_0x228ec5);};AGIChannel[_0x2646('0x21')]['answer']=function(){return this[_0x2646('0x22')]('ANSWER');};AGIChannel[_0x2646('0x21')][_0x2646('0x24')]=function(_0x34c5c9,_0x33ef5b,_0x544073){_0x34c5c9=_0x34c5c9===undefined?_0x2646('0x25'):_0x34c5c9;_0x33ef5b=_0x33ef5b===undefined?'5':_0x33ef5b;_0x544073=_0x544073===undefined?'1':_0x544073;return this[_0x2646('0x22')](util[_0x2646('0x26')](_0x2646('0x27'),_0x34c5c9,_0x33ef5b*0x3e8,_0x544073));};AGIChannel[_0x2646('0x21')][_0x2646('0x28')]=function(_0x5b3a9b){_0x5b3a9b=_0x5b3a9b||_0x2646('0x29');return this[_0x2646('0x22')](util[_0x2646('0x26')](_0x2646('0x2a'),_0x5b3a9b));};AGIChannel[_0x2646('0x21')][_0x2646('0x2b')]=function(_0x2b23c9,_0x20fb97){if(_[_0x2646('0x2c')](_0x20fb97)){return this[_0x2646('0x22')](util[_0x2646('0x26')](_0x2646('0x2d'),_0x2b23c9,_0x20fb97[_0x2646('0x2e')](',')));}return this['sendRequest'](util[_0x2646('0x26')](_0x2646('0x2d'),_0x2b23c9,_0x20fb97));};AGIChannel[_0x2646('0x21')][_0x2646('0x2f')]=function(_0x24df49){return this['sendRequest'](util[_0x2646('0x26')]('SET\x20CONTEXT\x20%s',_0x24df49));};AGIChannel[_0x2646('0x21')][_0x2646('0x30')]=function(_0x539699){return this[_0x2646('0x22')](util[_0x2646('0x26')]('SET\x20EXTENSION\x20%s',_0x539699));};AGIChannel['prototype']['setPriority']=function(_0x224373){return this[_0x2646('0x22')](util[_0x2646('0x26')](_0x2646('0x31'),_0x224373));};AGIChannel['prototype'][_0x2646('0xc')]=function(){return this[_0x2646('0x22')](_0x2646('0x32'));};AGIChannel['prototype'][_0x2646('0x33')]=function(_0x1e7288,_0x16aff2){var _0x145e84=_['isBoolean'](_0x16aff2)||_[_0x2646('0x34')](_0x16aff2)?_0x16aff2['toString']():_0x16aff2;return this[_0x2646('0x22')](util['format'](_0x2646('0x35'),_0x1e7288,_0x145e84?_0x145e84['toString']()[_0x2646('0x36')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2646('0x21')][_0x2646('0x37')]=function(_0x48988a,_0x220195){return this['sendRequest'](util[_0x2646('0x26')](_0x2646('0x38'),_0x48988a,_0x220195));};AGIChannel[_0x2646('0x21')][_0x2646('0x39')]=function(_0x5dca9a,_0x4600a6){return this[_0x2646('0x22')](util['format'](_0x2646('0x3a'),_0x5dca9a,_0x4600a6));};AGIChannel[_0x2646('0x21')][_0x2646('0x3b')]=function(_0x172781,_0x3b41d4){return this['sendRequest'](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x172781,_0x3b41d4));};AGIChannel[_0x2646('0x21')][_0x2646('0x3c')]=function(_0x2d957b,_0x3d6cbd,_0x46a2a5){_0x3d6cbd=_0x3d6cbd||this[_0x2646('0x3d')];_0x46a2a5=_0x46a2a5||0x1;this[_0x2646('0x2f')](_0x2d957b);this[_0x2646('0x30')](_0x3d6cbd);this[_0x2646('0x3e')](_0x46a2a5);return this[_0x2646('0x28')](util[_0x2646('0x26')](_0x2646('0x3f'),_0x2d957b,_0x3d6cbd,_0x46a2a5));};AGIChannel['prototype']['getVariable']=function(_0x3cd3a6){return this['sendRequest'](util[_0x2646('0x26')](_0x2646('0x40'),_0x3cd3a6));};AGIChannel[_0x2646('0x21')]['recordFile']=function(_0x20fcbc,_0x1fb449,_0x37cec9,_0x3febcd,_0x38d386,_0x554cfe){_0x1fb449=_0x1fb449||_0x2646('0x41');_0x37cec9=_0x37cec9||'';_0x3febcd=_0x3febcd===undefined?-0x1:_0x3febcd==='-1'?-0x1:_0x3febcd*0x3e8;_0x38d386=_0x38d386===undefined?'':'s='+_0x38d386;_0x554cfe=_0x554cfe?'BEEP':'';return this['sendRequest'](util[_0x2646('0x26')](_0x2646('0x42'),_0x20fcbc,_0x1fb449,_0x37cec9,_0x3febcd,_0x554cfe,_0x38d386));};AGIChannel[_0x2646('0x21')]['streamFile']=function(_0x2f1b62,_0x534d7a){_0x534d7a=_0x534d7a||'';return this[_0x2646('0x22')](util[_0x2646('0x26')](_0x2646('0x43'),_0x2f1b62,_0x534d7a));};AGIChannel['prototype'][_0x2646('0x44')]=function(_0x5d2523){return this[_0x2646('0x2b')](_0x2646('0x45'),_0x5d2523);};AGIChannel['prototype'][_0x2646('0x46')]=function(_0x52e810){return this[_0x2646('0x2b')]('WAIT',_0x52e810);};AGIChannel[_0x2646('0x21')][_0x2646('0x17')]=function(_0x35499b,_0x28a3e2){this[_0x2646('0x28')](util[_0x2646('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x35499b['id'],_0x35499b[_0x2646('0x47')],_0x28a3e2));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0x5880=['getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','length','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','close','prototype','sendRequest','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','noop','GOTO\x20%s\x20%s\x20%s'];(function(_0x364c88,_0x5039f0){var _0x1032cb=function(_0x4c5d5b){while(--_0x4c5d5b){_0x364c88['push'](_0x364c88['shift']());}};_0x1032cb(++_0x5039f0);}(_0x5880,0x186));var _0x0588=function(_0x50ac2e,_0x316214){_0x50ac2e=_0x50ac2e-0x0;var _0x1c7984=_0x5880[_0x50ac2e];return _0x1c7984;};'use strict';var util=require(_0x0588('0x0'));var _=require(_0x0588('0x1'));var EventEmitter=require(_0x0588('0x2'))[_0x0588('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x0588('0x4'));function AGIChannel(_0x280073){var _0x15f47b=this,_0x2eab9f=new AGIReply(),_0x25143e=![],_0x38819d={};EventEmitter[_0x0588('0x5')](_0x15f47b);_0x280073[_0x0588('0x6')](_0x0588('0x7'));_0x280073['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2eab9f[_0x0588('0x6')](_0x0588('0x7'));_0x2eab9f['on'](_0x0588('0x8'),function(_0x30c239){for(var _0x4b3fd3 in _0x30c239){_0x15f47b[_0x4b3fd3]=_0x30c239[_0x4b3fd3];}_0x15f47b[_0x0588('0x9')](_0x0588('0xa'));});_0x2eab9f['on'](_0x0588('0xb'),function(_0x3e478e){if(_0x3e478e[_0x0588('0xc')]()=='hangup'){_0x15f47b[_0x0588('0x9')](_0x0588('0xd'));return;}if(_0x3e478e[_0x0588('0xe')](0x0,0xb)==_0x0588('0xf')){_0x25143e=!![];}if(_0x25143e){_0x38819d['rx']+=_0x3e478e+'\x0a';if(_0x3e478e[_0x0588('0x10')](_0x0588('0x11'))!=-0x1){_0x25143e=![];}}else{_0x38819d['rx']=_0x3e478e;}if(_0x25143e){return;}if(typeof _0x38819d['cb']=='function'){var _0x39935c=_0x38819d['rx'][_0x0588('0xe')](0x0,0x3),_0x407db9=null,_0x4360da=null;_0x39935c=parseInt(_0x39935c);if(isNaN(_0x39935c)){_0x38819d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0588('0x12')});return;}if(_0x39935c!=0xc8){_0x38819d['cb'](null,{'code':_0x39935c,'result':-0x1,'extra':'KO'});return;}_0x407db9=_0x38819d['rx'][_0x0588('0xe')](0x4)[_0x0588('0x13')]('result=','');if(_0x407db9[_0x0588('0x14')]('\x20')!=-0x1){_0x407db9=_0x407db9[_0x0588('0x15')](0x0,_0x407db9[_0x0588('0x14')]('\x20'));}if(_['startsWith'](_0x407db9,'-1')){_0x407db9=parseInt(_0x407db9);}_0x4360da=_0x38819d['rx']['split']('\x20');if(_0x4360da['length']==0x3){_0x4360da=_0x4360da[0x2][_0x0588('0xe')](0x1,_0x4360da[0x2]['length']-0x1);}else if(_0x4360da[_0x0588('0x16')]>0x3){var _0x172768=/\((.+)\)/;var _0x5bac4a=_0x38819d['rx']['match'](_0x172768);if(_0x5bac4a){_0x4360da=_0x5bac4a[0x1];}else{_0x4360da=null;}}else{_0x4360da=null;}_0x38819d['cb'](null,{'code':_0x39935c,'result':_0x407db9,'extra':_0x4360da});}});_0x280073['on'](_0x0588('0x17'),function(_0x5bc729){_0x15f47b['emit'](_0x0588('0x17'),new AGIError(_0x0588('0x18'),_0x5bc729[_0x0588('0x19')]));});_0x280073['on']('close',function(){_0x15f47b['emit']('close',new AGIError(_0x0588('0x1a')));});_0x280073['on'](_0x0588('0x1b'),function(){_0x15f47b[_0x0588('0x9')](_0x0588('0x1b'),new AGIError(_0x0588('0x1c')));_0x280073[_0x0588('0x1d')]();});_0x280073[_0x0588('0x1e')](_0x2eab9f);this[_0x0588('0x1f')]=function(_0x7fbec2,_0x371c41){var _0x7fbec2=_0x7fbec2||'',_0x371c41=typeof _0x371c41=='function'?_0x371c41:new Function();_0x38819d={'tx':_0x7fbec2,'rx':'','cb':_0x371c41};_0x280073[_0x0588('0x20')](_0x7fbec2+'\x0a');},this[_0x0588('0x21')]=function(){_0x280073['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x0588('0x22')][_0x0588('0x23')]=function(_0x38712d){return this[_0x0588('0x1f')][_0x0588('0x24')](this,_0x38712d);};AGIChannel['prototype'][_0x0588('0x25')]=function(){return this[_0x0588('0x23')](_0x0588('0x26'));};AGIChannel[_0x0588('0x22')][_0x0588('0x27')]=function(_0xa141c1,_0x3dd7c7,_0x37cc78){_0xa141c1=_0xa141c1===undefined?'beep':_0xa141c1;_0x3dd7c7=_0x3dd7c7===undefined?'5':_0x3dd7c7;_0x37cc78=_0x37cc78===undefined?'1':_0x37cc78;return this['sendRequest'](util[_0x0588('0x28')](_0x0588('0x29'),_0xa141c1,_0x3dd7c7*0x3e8,_0x37cc78));};AGIChannel[_0x0588('0x22')]['noop']=function(_0x118deb){_0x118deb=_0x118deb||_0x0588('0x2a');return this['sendRequest'](util[_0x0588('0x28')]('VERBOSE\x20\x22%s\x22',_0x118deb));};AGIChannel[_0x0588('0x22')][_0x0588('0x2b')]=function(_0x4dd24f,_0x5acd5a){if(_[_0x0588('0x2c')](_0x5acd5a)){return this[_0x0588('0x23')](util[_0x0588('0x28')]('EXEC\x20%s\x20%s',_0x4dd24f,_0x5acd5a[_0x0588('0x2d')](',')));}return this[_0x0588('0x23')](util[_0x0588('0x28')](_0x0588('0x2e'),_0x4dd24f,_0x5acd5a));};AGIChannel['prototype']['setContext']=function(_0x39fd57){return this[_0x0588('0x23')](util[_0x0588('0x28')](_0x0588('0x2f'),_0x39fd57));};AGIChannel[_0x0588('0x22')][_0x0588('0x30')]=function(_0x5b42ae){return this['sendRequest'](util[_0x0588('0x28')](_0x0588('0x31'),_0x5b42ae));};AGIChannel[_0x0588('0x22')][_0x0588('0x32')]=function(_0x198c0b){return this[_0x0588('0x23')](util['format'](_0x0588('0x33'),_0x198c0b));};AGIChannel[_0x0588('0x22')][_0x0588('0xd')]=function(){return this['sendRequest'](_0x0588('0x34'));};AGIChannel[_0x0588('0x22')][_0x0588('0x35')]=function(_0x4e0b6f,_0x220405){var _0x3f036e=_['isBoolean'](_0x220405)||_[_0x0588('0x36')](_0x220405)?_0x220405[_0x0588('0x37')]():_0x220405;return this[_0x0588('0x23')](util[_0x0588('0x28')](_0x0588('0x38'),_0x4e0b6f,_0x3f036e?_0x3f036e[_0x0588('0x37')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0588('0x22')]['sayNumber']=function(_0x2be618,_0x295b37){return this[_0x0588('0x23')](util['format'](_0x0588('0x39'),_0x2be618,_0x295b37));};AGIChannel[_0x0588('0x22')][_0x0588('0x3a')]=function(_0x5d0101,_0x34c06d){return this[_0x0588('0x23')](util[_0x0588('0x28')](_0x0588('0x3b'),_0x5d0101,_0x34c06d));};AGIChannel['prototype'][_0x0588('0x3c')]=function(_0x121b79,_0x291e52){return this[_0x0588('0x23')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x121b79,_0x291e52));};AGIChannel['prototype'][_0x0588('0x3d')]=function(_0x4ccb62,_0x410d25,_0x4181ad){_0x410d25=_0x410d25||this[_0x0588('0x3e')];_0x4181ad=_0x4181ad||0x1;this[_0x0588('0x3f')](_0x4ccb62);this[_0x0588('0x30')](_0x410d25);this[_0x0588('0x32')](_0x4181ad);return this[_0x0588('0x40')](util['format'](_0x0588('0x41'),_0x4ccb62,_0x410d25,_0x4181ad));};AGIChannel[_0x0588('0x22')][_0x0588('0x42')]=function(_0x50a0ea){return this[_0x0588('0x23')](util[_0x0588('0x28')](_0x0588('0x43'),_0x50a0ea));};AGIChannel[_0x0588('0x22')][_0x0588('0x44')]=function(_0x114981,_0x345f24,_0x2f5f0c,_0x507e8a,_0x558415,_0x31dd91){_0x345f24=_0x345f24||'wav';_0x2f5f0c=_0x2f5f0c||'';_0x507e8a=_0x507e8a===undefined?-0x1:_0x507e8a==='-1'?-0x1:_0x507e8a*0x3e8;_0x558415=_0x558415===undefined?'':'s='+_0x558415;_0x31dd91=_0x31dd91?_0x0588('0x45'):'';return this[_0x0588('0x23')](util[_0x0588('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x114981,_0x345f24,_0x2f5f0c,_0x507e8a,_0x31dd91,_0x558415));};AGIChannel[_0x0588('0x22')]['streamFile']=function(_0x5f1370,_0x5a1c23){_0x5a1c23=_0x5a1c23||'';return this['sendRequest'](util[_0x0588('0x28')](_0x0588('0x46'),_0x5f1370,_0x5a1c23));};AGIChannel['prototype'][_0x0588('0x47')]=function(_0x27783f){return this[_0x0588('0x2b')]('AGI',_0x27783f);};AGIChannel['prototype']['wait']=function(_0x2996b8){return this[_0x0588('0x2b')](_0x0588('0x48'),_0x2996b8);};AGIChannel['prototype'][_0x0588('0x17')]=function(_0x2f508f,_0x594051){this[_0x0588('0x40')](util[_0x0588('0x28')](_0x0588('0x49'),_0x2f508f['id'],_0x2f508f[_0x0588('0x4a')],_0x594051));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0588('0x4b')]=AGIChannel;
\ No newline at end of file
index 91cf4a1..08d3d0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff2e=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff2e,0x196));var _0xeff2=function(_0x2d1612,_0x1a2fd8){_0x2d1612=_0x2d1612-0x0;var _0x1ab360=_0xff2e[_0x2d1612];return _0x1ab360;};'use strict';var util=require(_0xeff2('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xeff2('0x1'),'E_AGI_SERVER_ERROR':_0xeff2('0x2'),'E_AGI_SERVER_CLOSE':_0xeff2('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xeff2('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xeff2('0x5'),'E_AGI_SOCKET_ERROR':_0xeff2('0x6'),'E_AGI_SOCKET_CLOSE':_0xeff2('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xeff2('0x8'),'E_AGI_COMMAND_EMPTY':_0xeff2('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xeff2('0xa')};function AGIError(_0x3294bd){var _0x3294bd=_0x3294bd||null,_0x30161e=_0x30161e||[],_0x188422=0x1,_0x4c39d7='';if(!error[_0x3294bd]){_0x3294bd=_0xeff2('0xb');}_0x30161e['push'](error[_0x3294bd]);while(arguments[_0x188422]){_0x30161e['push'](arguments[_0x188422]);_0x188422++;}_0x4c39d7=util[_0xeff2('0xc')][_0xeff2('0xd')](util,_0x30161e);this[_0xeff2('0xe')]=_0x4c39d7;this[_0xeff2('0xf')]=_0x3294bd;}module[_0xeff2('0x10')]=AGIError;
\ No newline at end of file
+var _0xd545=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message','name'];(function(_0x2950dc,_0x3d4ad7){var _0x7dc40e=function(_0x2ef635){while(--_0x2ef635){_0x2950dc['push'](_0x2950dc['shift']());}};_0x7dc40e(++_0x3d4ad7);}(_0xd545,0x111));var _0x5d54=function(_0x542a32,_0x554515){_0x542a32=_0x542a32-0x0;var _0x2c4230=_0xd545[_0x542a32];return _0x2c4230;};'use strict';var util=require(_0x5d54('0x0'));var error={'E_AGI_UNDEFINED':_0x5d54('0x1'),'E_AGI_ARGUMENT_PORT':_0x5d54('0x2'),'E_AGI_SERVER_ERROR':_0x5d54('0x3'),'E_AGI_SERVER_CLOSE':_0x5d54('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x5d54('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x5d54('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x5d54('0x7'),'E_AGI_COMMAND_EMPTY':_0x5d54('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5d54('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x235887){var _0x235887=_0x235887||null,_0x58b673=_0x58b673||[],_0x3841c8=0x1,_0x1db56c='';if(!error[_0x235887]){_0x235887=_0x5d54('0xa');}_0x58b673[_0x5d54('0xb')](error[_0x235887]);while(arguments[_0x3841c8]){_0x58b673['push'](arguments[_0x3841c8]);_0x3841c8++;}_0x1db56c=util[_0x5d54('0xc')]['apply'](util,_0x58b673);this[_0x5d54('0xd')]=_0x1db56c;this[_0x5d54('0xe')]=_0x235887;}module[_0x5d54('0xf')]=AGIError;
\ No newline at end of file
index b47cddb..cff1215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x447e=['error','E_AGI_SERVER_ERROR','parse','projectUpdate','emit','exports','lodash','events','EventEmitter','ioredis','./error','redis','localhost','subscribe','agi'];(function(_0x45ed40,_0x547374){var _0x553167=function(_0x43ee1d){while(--_0x43ee1d){_0x45ed40['push'](_0x45ed40['shift']());}};_0x553167(++_0x547374);}(_0x447e,0x150));var _0xe447=function(_0xd4ab87,_0x44bf12){_0xd4ab87=_0xd4ab87-0x0;var _0x5cef99=_0x447e[_0xd4ab87];return _0x5cef99;};'use strict';var _=require(_0xe447('0x0'));var EventEmitter=require(_0xe447('0x1'))[_0xe447('0x2')];var Redis=require(_0xe447('0x3'));var AGIError=require(_0xe447('0x4'));var config=require('../../config/environment');config[_0xe447('0x5')]=_['defaults'](config[_0xe447('0x5')],{'host':_0xe447('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xe447('0x5')]);sub[_0xe447('0x7')](_0xe447('0x8'),function(_0x4d3eb0){if(_0x4d3eb0)return eventEmitter['emit'](_0xe447('0x9'),new AGIError(_0xe447('0xa'),_0x4d3eb0));});sub['on']('message',function(_0xb7c51e,_0x3fcb6f){if(_0xb7c51e!==_0xe447('0x8'))return;try{var _0x485a57=JSON[_0xe447('0xb')](_0x3fcb6f);eventEmitter['emit'](_0xe447('0xc'),_0x485a57);}catch(_0x41f113){eventEmitter[_0xe447('0xd')](_0xe447('0x9'),new AGIError(_0xe447('0xa'),_0x41f113));}});module[_0xe447('0xe')]={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0x8735=['E_AGI_SERVER_ERROR','lodash','events','EventEmitter','ioredis','../../config/environment','defaults','redis','localhost','subscribe','agi','emit','error','message','projectUpdate'];(function(_0x309999,_0x1a4258){var _0x31c8f8=function(_0x9e01db){while(--_0x9e01db){_0x309999['push'](_0x309999['shift']());}};_0x31c8f8(++_0x1a4258);}(_0x8735,0x187));var _0x5873=function(_0x1bf9a2,_0x467b67){_0x1bf9a2=_0x1bf9a2-0x0;var _0x1e474a=_0x8735[_0x1bf9a2];return _0x1e474a;};'use strict';var _=require(_0x5873('0x0'));var EventEmitter=require(_0x5873('0x1'))[_0x5873('0x2')];var Redis=require(_0x5873('0x3'));var AGIError=require('./error');var config=require(_0x5873('0x4'));config['redis']=_[_0x5873('0x5')](config[_0x5873('0x6')],{'host':_0x5873('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x5873('0x8')](_0x5873('0x9'),function(_0x4d9492){if(_0x4d9492)return eventEmitter[_0x5873('0xa')](_0x5873('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x4d9492));});sub['on'](_0x5873('0xc'),function(_0x6799d,_0x279336){if(_0x6799d!=='agi')return;try{var _0x45f1d1=JSON['parse'](_0x279336);eventEmitter['emit'](_0x5873('0xd'),_0x45f1d1);}catch(_0x4cc89e){eventEmitter[_0x5873('0xa')](_0x5873('0xb'),new AGIError(_0x5873('0xe'),_0x4cc89e));}});module['exports']={'EventEmitter':eventEmitter};
\ No newline at end of file
index 4a4b62e..b347d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdda4=['push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','condition','agicommand','vswitch','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge'];(function(_0x3b2e8b,_0x586691){var _0x40c766=function(_0x33ed9e){while(--_0x33ed9e){_0x3b2e8b['push'](_0x3b2e8b['shift']());}};_0x40c766(++_0x586691);}(_0xdda4,0x1a6));var _0x4dda=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0xdda4[_0x1385dc];return _0x2f6469;};'use strict';var _=require('lodash');var logger=require(_0x4dda('0x0'))('agi');var verticesWithRetry=[_0x4dda('0x1'),_0x4dda('0x2'),_0x4dda('0x3')];var Graph=function(){this[_0x4dda('0x4')]={};this[_0x4dda('0x5')]={};this[_0x4dda('0x6')]=0x0;};Graph[_0x4dda('0x7')][_0x4dda('0x8')]=function(_0x1538f6){this[_0x4dda('0x4')][_0x1538f6['id']]=_0x1538f6;this[_0x4dda('0x5')][_0x1538f6['id']]=[];};Graph[_0x4dda('0x7')][_0x4dda('0x9')]=function(_0x199afc,_0x296f64,_0x3d3ab6){this['edges'][_0x199afc][_0x4dda('0xa')]({'target':_0x296f64,'condition':_0x3d3ab6});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x4dda('0xb')]=function(){return _[_0x4dda('0xb')](this[_0x4dda('0x4')]);};Graph[_0x4dda('0x7')][_0x4dda('0xc')]=function(){return this[_0x4dda('0x6')];};Graph[_0x4dda('0x7')][_0x4dda('0xd')]=function(_0x518111){return this[_0x4dda('0x4')][_0x518111];};Graph[_0x4dda('0x7')][_0x4dda('0xe')]=function(_0x49f411,_0x47f39c){if(!this[_0x4dda('0x4')][_0x49f411]){return logger[_0x4dda('0xf')]('no\x20vertex\x20found');}var _0x13b7c7=_0x47f39c(this['vertices'][_0x49f411]);if(!_0x13b7c7){return logger[_0x4dda('0xf')](_0x4dda('0x10'));}if(this['edges'][_0x49f411][_0x4dda('0x11')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x215f92=0x0,_0x19a464=[],_0x355375=![];_0x215f92<this[_0x4dda('0x5')][_0x49f411][_0x4dda('0x11')];_0x215f92+=0x1){if(this[_0x4dda('0x5')][_0x49f411][_0x215f92][_0x4dda('0x12')]){_0x19a464=this[_0x4dda('0x5')][_0x49f411][_0x215f92][_0x4dda('0x12')]['split'](',');for(var _0x4a9ca1=0x0;_0x4a9ca1<_0x19a464[_0x4dda('0x11')];_0x4a9ca1+=0x1){if(this['vertices'][_0x49f411][_0x4dda('0x13')]===_0x4dda('0x14')&&_0x19a464[_0x4a9ca1]==='-'){_0x355375=this['edges'][_0x49f411][_0x215f92][_0x4dda('0x15')];logger[_0x4dda('0xf')]('default',_0x19a464[_0x4a9ca1],this[_0x4dda('0x5')][_0x49f411][_0x215f92][_0x4dda('0x15')]);}else if(this['vertices'][_0x49f411][_0x4dda('0x13')]===_0x4dda('0x1')&&_0x19a464[_0x4a9ca1]==='i'){_0x355375=this[_0x4dda('0x5')][_0x49f411][_0x215f92][_0x4dda('0x15')];logger[_0x4dda('0xf')](_0x4dda('0x16'),_0x19a464[_0x4a9ca1],this[_0x4dda('0x5')][_0x49f411][_0x215f92][_0x4dda('0x15')]);}if(_0x19a464[_0x4a9ca1]===_0x13b7c7){return this['traverseBFS'](this['edges'][_0x49f411][_0x215f92]['target'],_0x47f39c);}}}else{return this[_0x4dda('0xe')](this[_0x4dda('0x5')][_0x49f411][_0x215f92][_0x4dda('0x15')],_0x47f39c);}}if(_0x19a464[_0x4dda('0x11')]){if(this[_0x4dda('0x4')][_0x49f411]['agicommand']===_0x4dda('0x14')){if(_0x355375){return this[_0x4dda('0xe')](_0x355375,_0x47f39c);}return logger[_0x4dda('0xf')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x4dda('0x17')](verticesWithRetry,this[_0x4dda('0x4')][_0x49f411]['agicommand'])){if(_0x13b7c7==='-'){return logger[_0x4dda('0xf')](_0x4dda('0x18'));}if(_0x355375&&_0x13b7c7!=='t'){return this[_0x4dda('0xe')](_0x355375,_0x47f39c);}return this['traverseBFS'](_0x49f411,_0x47f39c);}return logger[_0x4dda('0xf')](_0x4dda('0x19'));}};module[_0x4dda('0x1a')]=Graph;
\ No newline at end of file
+var _0xa279=['agi','menu','getsecretdigits','edges','numberOfEdges','prototype','addVertex','vertices','push','size','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa279,0xa6));var _0x9a27=function(_0x5ca94b,_0x5c2e8f){_0x5ca94b=_0x5ca94b-0x0;var _0x31951b=_0xa279[_0x5ca94b];return _0x31951b;};'use strict';var _=require(_0x9a27('0x0'));var logger=require(_0x9a27('0x1'))(_0x9a27('0x2'));var verticesWithRetry=[_0x9a27('0x3'),'getdigits',_0x9a27('0x4')];var Graph=function(){this['vertices']={};this[_0x9a27('0x5')]={};this[_0x9a27('0x6')]=0x0;};Graph[_0x9a27('0x7')][_0x9a27('0x8')]=function(_0x403b8e){this[_0x9a27('0x9')][_0x403b8e['id']]=_0x403b8e;this[_0x9a27('0x5')][_0x403b8e['id']]=[];};Graph[_0x9a27('0x7')]['addEdge']=function(_0x5ec809,_0x5854e0,_0x412a33){this[_0x9a27('0x5')][_0x5ec809][_0x9a27('0xa')]({'target':_0x5854e0,'condition':_0x412a33});this[_0x9a27('0x6')]+=0x1;};Graph[_0x9a27('0x7')][_0x9a27('0xb')]=function(){return _[_0x9a27('0xb')](this[_0x9a27('0x9')]);};Graph[_0x9a27('0x7')]['relations']=function(){return this[_0x9a27('0x6')];};Graph[_0x9a27('0x7')]['getVertex']=function(_0x59490f){return this[_0x9a27('0x9')][_0x59490f];};Graph['prototype'][_0x9a27('0xc')]=function(_0x46bacc,_0x2bcd){if(!this['vertices'][_0x46bacc]){return logger[_0x9a27('0xd')]('no\x20vertex\x20found');}var _0x3ffdcb=_0x2bcd(this[_0x9a27('0x9')][_0x46bacc]);if(!_0x3ffdcb){return logger[_0x9a27('0xd')](_0x9a27('0xe'));}if(this[_0x9a27('0x5')][_0x46bacc][_0x9a27('0xf')]===0x0){return logger[_0x9a27('0xd')](_0x9a27('0x10'));}for(var _0x4dabf6=0x0,_0x24dd61=[],_0xbe8db9=![];_0x4dabf6<this['edges'][_0x46bacc][_0x9a27('0xf')];_0x4dabf6+=0x1){if(this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6][_0x9a27('0x11')]){_0x24dd61=this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6][_0x9a27('0x11')][_0x9a27('0x12')](',');for(var _0x21ea68=0x0;_0x21ea68<_0x24dd61[_0x9a27('0xf')];_0x21ea68+=0x1){if(this[_0x9a27('0x9')][_0x46bacc][_0x9a27('0x13')]==='vswitch'&&_0x24dd61[_0x21ea68]==='-'){_0xbe8db9=this['edges'][_0x46bacc][_0x4dabf6][_0x9a27('0x14')];logger[_0x9a27('0xd')](_0x9a27('0x15'),_0x24dd61[_0x21ea68],this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6][_0x9a27('0x14')]);}else if(this[_0x9a27('0x9')][_0x46bacc][_0x9a27('0x13')]==='menu'&&_0x24dd61[_0x21ea68]==='i'){_0xbe8db9=this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6][_0x9a27('0x14')];logger[_0x9a27('0xd')](_0x9a27('0x16'),_0x24dd61[_0x21ea68],this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6][_0x9a27('0x14')]);}if(_0x24dd61[_0x21ea68]===_0x3ffdcb){return this[_0x9a27('0xc')](this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6][_0x9a27('0x14')],_0x2bcd);}}}else{return this['traverseBFS'](this[_0x9a27('0x5')][_0x46bacc][_0x4dabf6]['target'],_0x2bcd);}}if(_0x24dd61[_0x9a27('0xf')]){if(this[_0x9a27('0x9')][_0x46bacc][_0x9a27('0x13')]===_0x9a27('0x17')){if(_0xbe8db9){return this[_0x9a27('0xc')](_0xbe8db9,_0x2bcd);}return logger[_0x9a27('0xd')](_0x9a27('0x18'));}else if(_[_0x9a27('0x19')](verticesWithRetry,this[_0x9a27('0x9')][_0x46bacc]['agicommand'])){if(_0x3ffdcb==='-'){return logger['info'](_0x9a27('0x1a'));}if(_0xbe8db9&&_0x3ffdcb!=='t'){return this[_0x9a27('0xc')](_0xbe8db9,_0x2bcd);}return this[_0x9a27('0xc')](_0x46bacc,_0x2bcd);}return logger[_0x9a27('0xd')](_0x9a27('0x1b'));}};module['exports']=Graph;
\ No newline at end of file
index 5c24d56..518db33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd77=['[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','finally','./server','listening','connection','lodash','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','EventEmitter','127.0.0.1','projectUpdate','stack','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','error','format','[%s]\x20%s','message','[ERROR]\x20%s','arg_1','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','then','agi_','debug','stringify'];(function(_0x34883a,_0x3e0171){var _0x1b5bc2=function(_0x342a95){while(--_0x342a95){_0x34883a['push'](_0x34883a['shift']());}};_0x1b5bc2(++_0x3e0171);}(_0xdd77,0x1a4));var _0x7dd7=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xdd77[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7dd7('0x0'));var syncho=require(_0x7dd7('0x1'));var util=require('util');var config=require(_0x7dd7('0x2'));var logger=require(_0x7dd7('0x3'))(_0x7dd7('0x4'));var utilLicense=require(_0x7dd7('0x5'));var rpc=require(_0x7dd7('0x6'));var Project=require(_0x7dd7('0x7'));var AGIEmitter=require('./events')[_0x7dd7('0x8')];var projects=[];config[_0x7dd7('0x4')]=_['defaults'](config[_0x7dd7('0x4')],{'ip':_0x7dd7('0x9'),'port':0x11dd});AGIEmitter['on'](_0x7dd7('0xa'),projectUpdateHandler);function connectionHandler(_0x1022b2){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1022b2);agiHandler(_0x1022b2);}catch(_0x4b18a5){logger['error'](_0x4b18a5[_0x7dd7('0xb')]);}});});}function projectUpdateHandler(_0x3f6690){try{var _0x3beb8d=_['findIndex'](projects,['id',_0x3f6690['id']]);if(_0x3beb8d>-0x1){if(_0x3f6690['deleted']===!![]){projects[_0x7dd7('0xc')](_0x3beb8d,0x1);}else{projects[_0x3beb8d]=_0x3f6690;}}else{projects[_0x7dd7('0xd')](_0x3f6690);}}catch(_0x49d1a8){logger['error'](_0x49d1a8['stack']);}}function listeningHandler(){console[_0x7dd7('0xe')](_0x7dd7('0xf'),config['agi']['port']);logger[_0x7dd7('0x10')](util['format'](_0x7dd7('0x11'),config[_0x7dd7('0x4')]['ip'],config[_0x7dd7('0x4')][_0x7dd7('0x12')]));}function errorHandler(_0xe92778){if(_0xe92778&&_0xe92778[_0x7dd7('0x13')]&&_0xe92778['message']){logger[_0x7dd7('0x14')](util[_0x7dd7('0x15')](_0x7dd7('0x16'),_0xe92778[_0x7dd7('0x13')],_0xe92778[_0x7dd7('0x17')]));}else{logger['error'](util[_0x7dd7('0x15')](_0x7dd7('0x18'),_0xe92778[_0x7dd7('0xb')]));}}function closeHandler(){logger[_0x7dd7('0x10')](util[_0x7dd7('0x15')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7dd7('0x19')],this['calleridname'],this[_0x7dd7('0x1a')],this['dnid'],this[_0x7dd7('0x1b')]));try{createSquareReport(this);}catch(_0x1c9bc0){logger[_0x7dd7('0x14')](_0x1c9bc0[_0x7dd7('0xb')]);}}function timeoutHandler(){logger[_0x7dd7('0x10')](util[_0x7dd7('0x15')](_0x7dd7('0x1c'),this[_0x7dd7('0x19')],this[_0x7dd7('0x1d')],this[_0x7dd7('0x1a')],this[_0x7dd7('0x1e')],this[_0x7dd7('0x1b')]));}function hangupHandler(){logger['info'](util[_0x7dd7('0x15')](_0x7dd7('0x1f'),this[_0x7dd7('0x19')],this['calleridname'],this[_0x7dd7('0x1a')],this[_0x7dd7('0x1e')],this[_0x7dd7('0x1b')]));this['evtHangup']=!![];}function createSquareReport(_0x4b6ceb,_0x409faa){rpc['createSquareReport'](_0x4b6ceb)[_0x7dd7('0x20')](function(_0x4231de){if(_0x409faa){_0x409faa(null,_0x4231de);}})['catch'](function(_0x4d61de){if(_0x409faa){_0x409faa(null,_0x4d61de);}});}function setChannelVariables(_0x573701){for(var _0x4d4027 in _0x573701){if(_0x573701['hasOwnProperty'](_0x4d4027)){if(_0x4d4027['indexOf'](_0x7dd7('0x21'))===0x0){_0x573701[_0x4d4027['substring'](0x4)]=_0x573701[_0x4d4027];delete _0x573701[_0x4d4027];}}}}function agiHandler(_0xd74914){logger[_0x7dd7('0x22')]('variables',JSON[_0x7dd7('0x23')](_0xd74914,null,0x2));logger[_0x7dd7('0x10')](util[_0x7dd7('0x15')](_0x7dd7('0x24'),_0xd74914['arg_1'],_0xd74914[_0x7dd7('0x1d')],_0xd74914[_0x7dd7('0x1a')],_0xd74914[_0x7dd7('0x1e')],_0xd74914[_0x7dd7('0x1b')]));_0xd74914['on'](_0x7dd7('0x14'),errorHandler);_0xd74914['on'](_0x7dd7('0x25'),closeHandler);_0xd74914['on']('timeout',timeoutHandler);_0xd74914[_0x7dd7('0x26')]=![];_0xd74914['on'](_0x7dd7('0x27'),hangupHandler);var _0x49b2a3=_[_0x7dd7('0x28')](projects,[_0x7dd7('0x13'),_0xd74914[_0x7dd7('0x19')]]);if(!_0x49b2a3)return Project[_0x7dd7('0x29')](_0xd74914);if(!_0x49b2a3[_0x7dd7('0x2a')])return Project[_0x7dd7('0x2b')](_0xd74914);return Project[_0x7dd7('0x2c')](_0x49b2a3,_0xd74914);}function main(){var _0x5d3b20;return utilLicense[_0x7dd7('0x2d')]()['then'](function(_0x1640ac){if(!_0x1640ac)return;if(_0x1640ac[_0x7dd7('0x2e')]){if(_0x1640ac[_0x7dd7('0x2f')]&&_0x1640ac['callysquare']>0x0){logger[_0x7dd7('0x10')](util[_0x7dd7('0x15')](_0x7dd7('0x30'),_0x1640ac[_0x7dd7('0x2f')]));_0x5d3b20=_0x1640ac[_0x7dd7('0x2f')];}else{logger[_0x7dd7('0x10')](_0x7dd7('0x31'));}}else{logger['info'](_0x7dd7('0x32'));_0x5d3b20=-0x1;}})[_0x7dd7('0x20')](function(){return Project['getAll']();})[_0x7dd7('0x20')](function(_0x536267){projects=_0x536267;return;})[_0x7dd7('0x33')](function(_0x340561){logger[_0x7dd7('0x14')](_0x7dd7('0x34'),_0x340561['stack']);})[_0x7dd7('0x35')](function(){var _0x4586f5=require(_0x7dd7('0x36'))(config[_0x7dd7('0x4')]['port'],config[_0x7dd7('0x4')]['ip'],_0x5d3b20);_0x4586f5['on'](_0x7dd7('0x14'),errorHandler);_0x4586f5['on'](_0x7dd7('0x37'),listeningHandler);_0x4586f5['on'](_0x7dd7('0x38'),connectionHandler);_0x4586f5['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0x03e9=['stack','findIndex','deleted','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','handleNotFound','production','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','getAll','[LICENSE]','finally','./server','listening','util','../../config/environment','../../config/license/util','./project','./events','agi','127.0.0.1','projectUpdate','nextTick'];(function(_0x401619,_0x27d8ba){var _0x7d7436=function(_0x1bf1f1){while(--_0x1bf1f1){_0x401619['push'](_0x401619['shift']());}};_0x7d7436(++_0x27d8ba);}(_0x03e9,0x1ef));var _0x903e=function(_0x179d1f,_0x1bcb55){_0x179d1f=_0x179d1f-0x0;var _0x3f7902=_0x03e9[_0x179d1f];return _0x3f7902;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x903e('0x0'));var config=require(_0x903e('0x1'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x903e('0x2'));var rpc=require('./rpc');var Project=require(_0x903e('0x3'));var AGIEmitter=require(_0x903e('0x4'))['EventEmitter'];var projects=[];config['agi']=_['defaults'](config[_0x903e('0x5')],{'ip':_0x903e('0x6'),'port':0x11dd});AGIEmitter['on'](_0x903e('0x7'),projectUpdateHandler);function connectionHandler(_0x3d11ac){process[_0x903e('0x8')](function(){syncho(function(){try{setChannelVariables(_0x3d11ac);agiHandler(_0x3d11ac);}catch(_0xef98c5){logger['error'](_0xef98c5[_0x903e('0x9')]);}});});}function projectUpdateHandler(_0x399fbe){try{var _0x2c4358=_[_0x903e('0xa')](projects,['id',_0x399fbe['id']]);if(_0x2c4358>-0x1){if(_0x399fbe[_0x903e('0xb')]===!![]){projects[_0x903e('0xc')](_0x2c4358,0x1);}else{projects[_0x2c4358]=_0x399fbe;}}else{projects[_0x903e('0xd')](_0x399fbe);}}catch(_0x376e7a){logger[_0x903e('0xe')](_0x376e7a[_0x903e('0x9')]);}}function listeningHandler(){console[_0x903e('0xf')](_0x903e('0x10'),config[_0x903e('0x5')][_0x903e('0x11')]);logger['info'](util[_0x903e('0x12')](_0x903e('0x13'),config['agi']['ip'],config['agi'][_0x903e('0x11')]));}function errorHandler(_0x24dc70){if(_0x24dc70&&_0x24dc70['name']&&_0x24dc70[_0x903e('0x14')]){logger[_0x903e('0xe')](util[_0x903e('0x12')](_0x903e('0x15'),_0x24dc70[_0x903e('0x16')],_0x24dc70[_0x903e('0x14')]));}else{logger[_0x903e('0xe')](util[_0x903e('0x12')](_0x903e('0x17'),_0x24dc70[_0x903e('0x9')]));}}function closeHandler(){logger[_0x903e('0x18')](util['format'](_0x903e('0x19'),this[_0x903e('0x1a')],this[_0x903e('0x1b')],this[_0x903e('0x1c')],this['dnid'],this[_0x903e('0x1d')]));try{createSquareReport(this);}catch(_0x90c7fd){logger[_0x903e('0xe')](_0x90c7fd[_0x903e('0x9')]);}}function timeoutHandler(){logger['info'](util[_0x903e('0x12')](_0x903e('0x1e'),this[_0x903e('0x1a')],this[_0x903e('0x1b')],this[_0x903e('0x1c')],this['dnid'],this[_0x903e('0x1d')]));}function hangupHandler(){logger[_0x903e('0x18')](util[_0x903e('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x903e('0x1b')],this[_0x903e('0x1c')],this[_0x903e('0x1f')],this[_0x903e('0x1d')]));this[_0x903e('0x20')]=!![];}function createSquareReport(_0x131a67,_0x468e9c){rpc[_0x903e('0x21')](_0x131a67)[_0x903e('0x22')](function(_0x3291a2){if(_0x468e9c){_0x468e9c(null,_0x3291a2);}})[_0x903e('0x23')](function(_0x2bfd48){if(_0x468e9c){_0x468e9c(null,_0x2bfd48);}});}function setChannelVariables(_0x12a9bc){for(var _0x3bda9d in _0x12a9bc){if(_0x12a9bc[_0x903e('0x24')](_0x3bda9d)){if(_0x3bda9d[_0x903e('0x25')]('agi_')===0x0){_0x12a9bc[_0x3bda9d[_0x903e('0x26')](0x4)]=_0x12a9bc[_0x3bda9d];delete _0x12a9bc[_0x3bda9d];}}}}function agiHandler(_0x506e79){logger[_0x903e('0x27')](_0x903e('0x28'),JSON[_0x903e('0x29')](_0x506e79,null,0x2));logger[_0x903e('0x18')](util['format'](_0x903e('0x2a'),_0x506e79[_0x903e('0x1a')],_0x506e79[_0x903e('0x1b')],_0x506e79[_0x903e('0x1c')],_0x506e79[_0x903e('0x1f')],_0x506e79['uniqueid']));_0x506e79['on'](_0x903e('0xe'),errorHandler);_0x506e79['on'](_0x903e('0x2b'),closeHandler);_0x506e79['on']('timeout',timeoutHandler);_0x506e79[_0x903e('0x20')]=![];_0x506e79['on']('hangup',hangupHandler);var _0x3dd6be=_['find'](projects,[_0x903e('0x16'),_0x506e79['arg_1']]);if(!_0x3dd6be)return Project[_0x903e('0x2c')](_0x506e79);if(!_0x3dd6be[_0x903e('0x2d')])return Project['handleUnpublished'](_0x506e79);return Project[_0x903e('0x2e')](_0x3dd6be,_0x506e79);}function main(){var _0x4360e6;return utilLicense[_0x903e('0x2f')]()[_0x903e('0x22')](function(_0x2a1613){if(!_0x2a1613)return;if(_0x2a1613[_0x903e('0x30')]){if(_0x2a1613[_0x903e('0x31')]&&_0x2a1613[_0x903e('0x31')]>0x0){logger[_0x903e('0x18')](util['format'](_0x903e('0x32'),_0x2a1613[_0x903e('0x31')]));_0x4360e6=_0x2a1613[_0x903e('0x31')];}else{logger[_0x903e('0x18')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x4360e6=-0x1;}})['then'](function(){return Project[_0x903e('0x33')]();})[_0x903e('0x22')](function(_0x241cdb){projects=_0x241cdb;return;})[_0x903e('0x23')](function(_0x4c380d){logger[_0x903e('0xe')](_0x903e('0x34'),_0x4c380d[_0x903e('0x9')]);})[_0x903e('0x35')](function(){var _0x27da88=require(_0x903e('0x36'))(config['agi']['port'],config[_0x903e('0x5')]['ip'],_0x4360e6);_0x27da88['on'](_0x903e('0xe'),errorHandler);_0x27da88['on'](_0x903e('0x37'),listeningHandler);_0x27da88['on']('connection',connectionHandler);_0x27da88['on'](_0x903e('0x2b'),closeHandler);});}main();
\ No newline at end of file
index ce3ac0c..c7ceb82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cc2=['request','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cc2,0x1ae));var _0x25cc=function(_0x480f16,_0x11a65a){_0x480f16=_0x480f16-0x0;var _0x3e6d06=_0x5cc2[_0x480f16];return _0x3e6d06;};'use strict';var BPromise=require(_0x25cc('0x0'));var jayson=require(_0x25cc('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x2a7534,_0x8f2fcf){return new BPromise(function(_0x34dee9,_0xe8839c){return client[_0x25cc('0x2')](_0x2a7534,_0x8f2fcf)['then'](function(_0x11604a){if(_0x11604a[_0x25cc('0x3')]){return _0xe8839c(_0x11604a[_0x25cc('0x3')][_0x25cc('0x4')]);}else{return _0x34dee9(_0x11604a[_0x25cc('0x5')]);}})[_0x25cc('0x6')](function(_0x198b61){return _0xe8839c(_0x198b61);});});}exports[_0x25cc('0x7')]=function(_0x4b8090,_0x4be948){return request(_0x25cc('0x8'),{'account':_0x4b8090,'message':_0x4be948});};
\ No newline at end of file
+var _0x920e=['error','message','catch','bluebird','client','http','request','then'];(function(_0x2347f2,_0x23cdba){var _0x2692e0=function(_0x183533){while(--_0x183533){_0x2347f2['push'](_0x2347f2['shift']());}};_0x2692e0(++_0x23cdba);}(_0x920e,0x153));var _0xe920=function(_0x122c30,_0xb53ae9){_0x122c30=_0x122c30-0x0;var _0x137b08=_0x920e[_0x122c30];return _0x137b08;};'use strict';var BPromise=require(_0xe920('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xe920('0x1')][_0xe920('0x2')]({'port':0x232b});function request(_0x883394,_0x199be5){return new BPromise(function(_0x3e4b97,_0x2934e0){return client[_0xe920('0x3')](_0x883394,_0x199be5)[_0xe920('0x4')](function(_0x339edf){if(_0x339edf[_0xe920('0x5')]){return _0x2934e0(_0x339edf[_0xe920('0x5')][_0xe920('0x6')]);}else{return _0x3e4b97(_0x339edf['result']);}})[_0xe920('0x7')](function(_0x1d1b4d){return _0x2934e0(_0x1d1b4d);});});}exports['sendMailMessage']=function(_0x359894,_0x39afa2){return request('SendMail',{'account':_0x359894,'message':_0x39afa2});};
\ No newline at end of file
index d81b515..545705f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5df6=['getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','maxRetry','mxCell','isArray','length','source','addEdge','target','value','toJson','root','inspect','start','debug','stringify','joinAt','format','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','agicommand\x20not\x20found','stack','arg_1','finally','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','exports','lodash','moment','../../config/logger','./rpc','./mailRpc','./graph','./vertices'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5df6,0x161));var _0x65df=function(_0x36b4c3,_0xd165fc){_0x36b4c3=_0x36b4c3-0x0;var _0x6416f=_0x5df6[_0x36b4c3];return _0x6416f;};'use strict';var _=require(_0x65df('0x0'));var moment=require(_0x65df('0x1'));var parser=require('xml2json');var util=require('util');var logger=require(_0x65df('0x2'))('agi');var rpc=require(_0x65df('0x3'));var mailRpc=require(_0x65df('0x4'));var Graph=require(_0x65df('0x5'));var Vertices=require(_0x65df('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x65df('0x7')]()[_0x65df('0x8')](function(_0x30923e){logger[_0x65df('0x9')](_0x65df('0xa'),_0x30923e['stack']);return[];});}function addVertex(_0x52dedd,_0x1cd96e,_0x1ac9c2){_0x1cd96e[_0x65df('0xb')]=_0x1ac9c2;if(_0x1cd96e[_0x65df('0xc')](_0x65df('0xd'))){_0x1cd96e[_0x65df('0xe')]=parseInt(_0x1cd96e[_0x65df('0xd')],0xa);}_0x52dedd['addVertex'](_['omit'](_0x1cd96e,_0x65df('0xf')));}function initGraph(_0x5cd826,_0x12b136){var _0x39cb59=new Graph();for(var _0x3f0be0 in _0x5cd826){if(_0x5cd826[_0x65df('0xc')](_0x3f0be0)){if(_[_0x65df('0x10')](_0x5cd826[_0x3f0be0])){for(var _0x311903=0x0;_0x311903<_0x5cd826[_0x3f0be0][_0x65df('0x11')];_0x311903+=0x1){addVertex(_0x39cb59,_0x5cd826[_0x3f0be0][_0x311903],_0x3f0be0);}}else{addVertex(_0x39cb59,_0x5cd826[_0x3f0be0],_0x3f0be0);}}}for(var _0x471e99=0x0;_0x471e99<_0x12b136[_0x65df('0x11')];_0x471e99+=0x1){if(_0x12b136[_0x471e99][_0x65df('0x12')]&&_0x12b136[_0x471e99]['target']){_0x39cb59[_0x65df('0x13')](_0x12b136[_0x471e99]['source'],_0x12b136[_0x471e99][_0x65df('0x14')],_0x12b136[_0x471e99][_0x65df('0x15')]);}}return _0x39cb59;}function getRoot(_0x2bd815){return parser[_0x65df('0x16')](_0x2bd815,{'object':!![]})['mxGraphModel'][_0x65df('0x17')];}function inspect(_0x3790b1){return util[_0x65df('0x18')](_0x3790b1,{'showHidden':![],'depth':null});}function initialize(_0x459c5f,_0x1d1b1c){var _0x2ff660=getRoot(_0x459c5f['production']);if(!_0x2ff660||!_0x2ff660[_0x65df('0x19')])return;var _0x49d3df,_0x349c9d,_0x1231ca;logger[_0x65df('0x1a')](_0x65df('0x17'),JSON[_0x65df('0x1b')](_0x2ff660,null,0x2));_0x1d1b1c[_0x65df('0x1c')]=moment()[_0x65df('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x49d3df=initGraph(_[_0x65df('0x1e')](_0x2ff660,_0x65df('0xf')),_0x2ff660[_0x65df('0xf')]);_0x349c9d=new Vertices(_0x1d1b1c,rpc,mailRpc);logger[_0x65df('0x1f')](util['format'](_0x65df('0x20'),_0x1d1b1c['arg_1'],_0x1d1b1c[_0x65df('0x21')],_0x1d1b1c[_0x65df('0x22')],_0x1d1b1c[_0x65df('0x23')],_0x1d1b1c[_0x65df('0x24')]));_0x49d3df[_0x65df('0x25')](_0x2ff660['start']['id'],function(_0xdfc550){try{_0xdfc550=_0x349c9d[_0x65df('0x26')](_0xdfc550);logger[_0x65df('0x1a')](_0x65df('0x27'),JSON['stringify'](_0xdfc550,null,0x2));if(_0xdfc550[_0x65df('0xb')]===_0x65df('0x28')){logger[_0x65df('0x1f')](_0x65df('0x29'));_0x1d1b1c['context']=_0xdfc550[_0x65df('0x2a')]||_0x1d1b1c[_0x65df('0x2a')];_0x1d1b1c[_0x65df('0x2b')]=_0xdfc550[_0x65df('0x2b')];_0x1d1b1c[_0x65df('0x2c')]=_0xdfc550[_0x65df('0x2c')]?_0xdfc550[_0x65df('0x2c')]-0x1:0x1;return null;}else if(_0xdfc550&&_0x349c9d[_0xdfc550[_0x65df('0xb')]]){_0x1231ca=_0x349c9d[_0xdfc550[_0x65df('0xb')]](_0xdfc550);logger[_0x65df('0x1f')](_0x65df('0x2d'),JSON['stringify'](_0x1231ca,null,0x2));if(_0x1231ca&&_0x1231ca[_0x65df('0x2e')]===AGI_CODE_SUCCESS&&_0x1231ca[_0x65df('0x2f')]!==AGI_RESULT_ERROR&&!_0x1d1b1c[_0x65df('0x30')]){logger[_0x65df('0x1a')](_0x65df('0x2d'),inspect(_0x1231ca));return _[_0x65df('0x31')](_0x1231ca[_0x65df('0x2f')])?null:_0x1231ca[_0x65df('0x2f')]['toString']();}else{logger['error']('response',inspect(_0x1231ca));return null;}}else{logger['error'](_0x65df('0x32'));return null;}}catch(_0x40afc8){logger[_0x65df('0x9')](_0x40afc8[_0x65df('0x33')]);return null;}});if(_0x2ff660['finally']){logger['info'](util[_0x65df('0x1d')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1d1b1c[_0x65df('0x34')],_0x1d1b1c[_0x65df('0x21')],_0x1d1b1c[_0x65df('0x22')],_0x1d1b1c[_0x65df('0x23')],_0x1d1b1c[_0x65df('0x24')]));_0x49d3df['traverseBFS'](_0x2ff660[_0x65df('0x35')]['id'],function(_0x4dec66){try{_0x4dec66=_0x349c9d['clear'](_0x4dec66);logger[_0x65df('0x1a')](_0x65df('0x27'),JSON['stringify'](_0x4dec66,null,0x2));if(_0x4dec66&&_0x349c9d[_0x4dec66['agicommand']]){_0x1231ca=_0x349c9d[_0x4dec66[_0x65df('0xb')]](_0x4dec66);if(_0x1231ca){logger[_0x65df('0x1a')](_0x65df('0x2d'),inspect(_0x1231ca));return _[_0x65df('0x31')](_0x1231ca[_0x65df('0x2f')])?null:_0x1231ca['result'][_0x65df('0x36')]();}else{logger[_0x65df('0x9')]('response',inspect(_0x1231ca));return null;}}else{logger[_0x65df('0x9')](_0x65df('0x32'));return null;}}catch(_0xa9485b){logger[_0x65df('0x9')](_0xa9485b[_0x65df('0x33')]);return null;}});}logger[_0x65df('0x1f')](util[_0x65df('0x1d')](_0x65df('0x37'),_0x1d1b1c[_0x65df('0x34')],_0x1d1b1c[_0x65df('0x21')],_0x1d1b1c['callerid'],_0x1d1b1c[_0x65df('0x23')],_0x1d1b1c['uniqueid']));logger[_0x65df('0x1f')](util[_0x65df('0x1d')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1d1b1c[_0x65df('0x2a')],_0x1d1b1c[_0x65df('0x2b')],parseInt(_0x1d1b1c['priority'],0xa)+0x1));_0x1d1b1c[_0x65df('0x38')](_0x1d1b1c[_0x65df('0x2a')],_0x1d1b1c['extension'],parseInt(_0x1d1b1c[_0x65df('0x2c')],0xa)+0x1);_0x1d1b1c[_0x65df('0x39')]();}function handleNotFound(_0x34dec8){logger[_0x65df('0x9')](util[_0x65df('0x1d')](_0x65df('0x3a'),_0x34dec8['arg_1']));_0x34dec8[_0x65df('0x38')](_0x34dec8[_0x65df('0x2a')],_0x34dec8[_0x65df('0x2b')],parseInt(_0x34dec8[_0x65df('0x2c')],0xa)+0x1);_0x34dec8['close']();}function handleUnpublished(_0x2a73ad){logger[_0x65df('0x9')](util[_0x65df('0x1d')]('Project\x20%s\x20not\x20published',_0x2a73ad[_0x65df('0x34')]));_0x2a73ad[_0x65df('0x38')](_0x2a73ad[_0x65df('0x2a')],_0x2a73ad[_0x65df('0x2b')],parseInt(_0x2a73ad[_0x65df('0x2c')],0xa)+0x1);_0x2a73ad[_0x65df('0x39')]();}module[_0x65df('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x175b=['agicommand','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','value','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','evtHangup','response','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','finally','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','exports','lodash','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack'];(function(_0x304586,_0x24ea28){var _0x3f61f3=function(_0x577127){while(--_0x577127){_0x304586['push'](_0x304586['shift']());}};_0x3f61f3(++_0x24ea28);}(_0x175b,0x1db));var _0xb175=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x175b[_0x2a238a];return _0xeef802;};'use strict';var _=require(_0xb175('0x0'));var moment=require('moment');var parser=require(_0xb175('0x1'));var util=require(_0xb175('0x2'));var logger=require(_0xb175('0x3'))(_0xb175('0x4'));var rpc=require(_0xb175('0x5'));var mailRpc=require(_0xb175('0x6'));var Graph=require(_0xb175('0x7'));var Vertices=require(_0xb175('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xb175('0x9')](function(_0x30852a){logger[_0xb175('0xa')](_0xb175('0xb'),_0x30852a[_0xb175('0xc')]);return[];});}function addVertex(_0x5d8789,_0x1a13a4,_0x10ba3a){_0x1a13a4[_0xb175('0xd')]=_0x10ba3a;if(_0x1a13a4['hasOwnProperty'](_0xb175('0xe'))){_0x1a13a4['maxRetry']=parseInt(_0x1a13a4[_0xb175('0xe')],0xa);}_0x5d8789[_0xb175('0xf')](_[_0xb175('0x10')](_0x1a13a4,_0xb175('0x11')));}function initGraph(_0x2c5f9e,_0x4a4643){var _0x7895d3=new Graph();for(var _0x134106 in _0x2c5f9e){if(_0x2c5f9e[_0xb175('0x12')](_0x134106)){if(_[_0xb175('0x13')](_0x2c5f9e[_0x134106])){for(var _0x227d12=0x0;_0x227d12<_0x2c5f9e[_0x134106][_0xb175('0x14')];_0x227d12+=0x1){addVertex(_0x7895d3,_0x2c5f9e[_0x134106][_0x227d12],_0x134106);}}else{addVertex(_0x7895d3,_0x2c5f9e[_0x134106],_0x134106);}}}for(var _0x46e069=0x0;_0x46e069<_0x4a4643[_0xb175('0x14')];_0x46e069+=0x1){if(_0x4a4643[_0x46e069][_0xb175('0x15')]&&_0x4a4643[_0x46e069]['target']){_0x7895d3[_0xb175('0x16')](_0x4a4643[_0x46e069][_0xb175('0x15')],_0x4a4643[_0x46e069][_0xb175('0x17')],_0x4a4643[_0x46e069][_0xb175('0x18')]);}}return _0x7895d3;}function getRoot(_0xba443e){return parser[_0xb175('0x19')](_0xba443e,{'object':!![]})[_0xb175('0x1a')][_0xb175('0x1b')];}function inspect(_0x5cf0a4){return util['inspect'](_0x5cf0a4,{'showHidden':![],'depth':null});}function initialize(_0x35d03e,_0x835d86){var _0x5d846f=getRoot(_0x35d03e[_0xb175('0x1c')]);if(!_0x5d846f||!_0x5d846f[_0xb175('0x1d')])return;var _0x3e4442,_0x199bea,_0x22dcb3;logger[_0xb175('0x1e')](_0xb175('0x1b'),JSON[_0xb175('0x1f')](_0x5d846f,null,0x2));_0x835d86[_0xb175('0x20')]=moment()[_0xb175('0x21')](_0xb175('0x22'));_0x3e4442=initGraph(_['omit'](_0x5d846f,_0xb175('0x11')),_0x5d846f[_0xb175('0x11')]);_0x199bea=new Vertices(_0x835d86,rpc,mailRpc);logger[_0xb175('0x23')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x835d86[_0xb175('0x24')],_0x835d86[_0xb175('0x25')],_0x835d86[_0xb175('0x26')],_0x835d86[_0xb175('0x27')],_0x835d86['uniqueid']));_0x3e4442[_0xb175('0x28')](_0x5d846f[_0xb175('0x1d')]['id'],function(_0x542c20){try{_0x542c20=_0x199bea[_0xb175('0x29')](_0x542c20);logger[_0xb175('0x1e')](_0xb175('0x2a'),JSON[_0xb175('0x1f')](_0x542c20,null,0x2));if(_0x542c20[_0xb175('0xd')]===_0xb175('0x2b')){logger[_0xb175('0x23')](_0xb175('0x2c'));_0x835d86[_0xb175('0x2d')]=_0x542c20[_0xb175('0x2d')]||_0x835d86[_0xb175('0x2d')];_0x835d86[_0xb175('0x2e')]=_0x542c20['extension'];_0x835d86[_0xb175('0x2f')]=_0x542c20[_0xb175('0x2f')]?_0x542c20['priority']-0x1:0x1;return null;}else if(_0x542c20&&_0x199bea[_0x542c20['agicommand']]){_0x22dcb3=_0x199bea[_0x542c20[_0xb175('0xd')]](_0x542c20);logger[_0xb175('0x23')]('response',JSON[_0xb175('0x1f')](_0x22dcb3,null,0x2));if(_0x22dcb3&&_0x22dcb3['code']===AGI_CODE_SUCCESS&&_0x22dcb3[_0xb175('0x30')]!==AGI_RESULT_ERROR&&!_0x835d86[_0xb175('0x31')]){logger['debug'](_0xb175('0x32'),inspect(_0x22dcb3));return _['isUndefined'](_0x22dcb3[_0xb175('0x30')])?null:_0x22dcb3[_0xb175('0x30')]['toString']();}else{logger[_0xb175('0xa')]('response',inspect(_0x22dcb3));return null;}}else{logger[_0xb175('0xa')](_0xb175('0x33'));return null;}}catch(_0x38bb6d){logger[_0xb175('0xa')](_0x38bb6d['stack']);return null;}});if(_0x5d846f['finally']){logger[_0xb175('0x23')](util[_0xb175('0x21')](_0xb175('0x34'),_0x835d86[_0xb175('0x24')],_0x835d86['calleridname'],_0x835d86[_0xb175('0x26')],_0x835d86[_0xb175('0x27')],_0x835d86[_0xb175('0x35')]));_0x3e4442[_0xb175('0x28')](_0x5d846f[_0xb175('0x36')]['id'],function(_0x31a0b8){try{_0x31a0b8=_0x199bea[_0xb175('0x29')](_0x31a0b8);logger['debug'](_0xb175('0x2a'),JSON[_0xb175('0x1f')](_0x31a0b8,null,0x2));if(_0x31a0b8&&_0x199bea[_0x31a0b8[_0xb175('0xd')]]){_0x22dcb3=_0x199bea[_0x31a0b8[_0xb175('0xd')]](_0x31a0b8);if(_0x22dcb3){logger['debug'](_0xb175('0x32'),inspect(_0x22dcb3));return _[_0xb175('0x37')](_0x22dcb3[_0xb175('0x30')])?null:_0x22dcb3[_0xb175('0x30')]['toString']();}else{logger[_0xb175('0xa')](_0xb175('0x32'),inspect(_0x22dcb3));return null;}}else{logger[_0xb175('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x472cb1){logger[_0xb175('0xa')](_0x472cb1[_0xb175('0xc')]);return null;}});}logger['info'](util[_0xb175('0x21')](_0xb175('0x38'),_0x835d86[_0xb175('0x24')],_0x835d86[_0xb175('0x25')],_0x835d86[_0xb175('0x26')],_0x835d86[_0xb175('0x27')],_0x835d86[_0xb175('0x35')]));logger[_0xb175('0x23')](util[_0xb175('0x21')](_0xb175('0x39'),_0x835d86[_0xb175('0x2d')],_0x835d86['extension'],parseInt(_0x835d86[_0xb175('0x2f')],0xa)+0x1));_0x835d86[_0xb175('0x3a')](_0x835d86[_0xb175('0x2d')],_0x835d86['extension'],parseInt(_0x835d86[_0xb175('0x2f')],0xa)+0x1);_0x835d86[_0xb175('0x3b')]();}function handleNotFound(_0x1537f9){logger[_0xb175('0xa')](util[_0xb175('0x21')]('Project\x20%s\x20not\x20found',_0x1537f9[_0xb175('0x24')]));_0x1537f9[_0xb175('0x3a')](_0x1537f9[_0xb175('0x2d')],_0x1537f9[_0xb175('0x2e')],parseInt(_0x1537f9[_0xb175('0x2f')],0xa)+0x1);_0x1537f9[_0xb175('0x3b')]();}function handleUnpublished(_0x52b718){logger['error'](util[_0xb175('0x21')]('Project\x20%s\x20not\x20published',_0x52b718[_0xb175('0x24')]));_0x52b718['continueAt'](_0x52b718[_0xb175('0x2d')],_0x52b718[_0xb175('0x2e')],parseInt(_0x52b718['priority'],0xa)+0x1);_0x52b718[_0xb175('0x3b')]();}module[_0xb175('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index ab8eb12..fa2cff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0be=['util','stream','Transform','call','_localBuffer','_inBody','inherits','toString','indexOf','substring','split','slice','trim','length','emit','exports'];(function(_0x5ac1b9,_0x347e47){var _0x22f845=function(_0x1fd306){while(--_0x1fd306){_0x5ac1b9['push'](_0x5ac1b9['shift']());}};_0x22f845(++_0x347e47);}(_0xd0be,0x1a0));var _0xed0b=function(_0x5cfb75,_0x224a85){_0x5cfb75=_0x5cfb75-0x0;var _0x2613d6=_0xd0be[_0x5cfb75];return _0x2613d6;};'use strict';var util=require(_0xed0b('0x0'));var Transform=require(_0xed0b('0x1'))[_0xed0b('0x2')];function AGIReply(_0xce0e11){Transform[_0xed0b('0x3')](this,_0xce0e11);this[_0xed0b('0x4')]='';this[_0xed0b('0x5')]=![];}util[_0xed0b('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x52161d,_0x28c679,_0x12e73f){var _0x160d7a='\x0a',_0x234dcd=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x20c99d=-0x1,_0x3b8c09=-0x1,_0xa4213d='',_0x1848f4=0x0,_0x592358='',_0x2dda9a='';this[_0xed0b('0x4')]+=_0x52161d[_0xed0b('0x7')]();_0x592358=this[_0xed0b('0x4')];if(!this[_0xed0b('0x5')]){_0x1848f4=0x0;while(_0x234dcd[_0x1848f4]){while((_0x3b8c09=_0x592358[_0xed0b('0x8')](_0x234dcd[_0x1848f4]))!=-0x1){_0xa4213d=_0x234dcd[_0x1848f4];_0x2dda9a=_0x592358[_0xed0b('0x9')](0x0,_0x3b8c09);_0x592358=_0x592358[_0xed0b('0x9')](_0x3b8c09+_0xa4213d['length']);var _0x5b7721=_0x2dda9a[_0xed0b('0xa')](_0x160d7a),_0x40f964=0x0,_0x2ad414={},_0x5645d3='',_0x5a2e10='',_0x299574=-0x1;while(_0x5b7721[_0x40f964]){_0x299574=_0x5b7721[_0x40f964][_0xed0b('0x8')](':');if(_0x299574!=-0x1){_0x5645d3=_0x5b7721[_0x40f964][_0xed0b('0xb')](0x0,_0x299574)[_0xed0b('0xc')]();_0x5a2e10=_0x5b7721[_0x40f964]['slice'](_0x299574+0x1)['trim']();if(_0x5645d3[_0xed0b('0xd')]>0x0){_0x2ad414[_0x5645d3]=_0x5a2e10;}}else{}_0x40f964++;}this[_0xed0b('0xe')]('headers',_0x2ad414);this[_0xed0b('0x5')]=!![];}_0x1848f4++;}this[_0xed0b('0x4')]=_0x592358;}else{while((_0x20c99d=_0x592358[_0xed0b('0x8')](_0x160d7a))!=-0x1){_0x2dda9a=_0x592358[_0xed0b('0x9')](0x0,_0x20c99d);this[_0xed0b('0xe')]('line',_0x2dda9a);_0x592358=_0x592358['substring'](_0x20c99d+_0x160d7a[_0xed0b('0xd')]);}this[_0xed0b('0x4')]=_0x592358;}_0x12e73f();};module[_0xed0b('0xf')]=AGIReply;
\ No newline at end of file
+var _0xc61f=['exports','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim','emit','headers','line'];(function(_0x331b1d,_0x21736e){var _0x4831db=function(_0x41bee9){while(--_0x41bee9){_0x331b1d['push'](_0x331b1d['shift']());}};_0x4831db(++_0x21736e);}(_0xc61f,0x65));var _0xfc61=function(_0x2af445,_0x2622cc){_0x2af445=_0x2af445-0x0;var _0x1e1204=_0xc61f[_0x2af445];return _0x1e1204;};'use strict';var util=require('util');var Transform=require(_0xfc61('0x0'))[_0xfc61('0x1')];function AGIReply(_0x1d332e){Transform[_0xfc61('0x2')](this,_0x1d332e);this[_0xfc61('0x3')]='';this[_0xfc61('0x4')]=![];}util[_0xfc61('0x5')](AGIReply,Transform);AGIReply[_0xfc61('0x6')][_0xfc61('0x7')]=function(_0x2e70ed,_0x2acd8b,_0x4b7d26){var _0x2e63de='\x0a',_0x3460c9=['\x0a\x0a',_0xfc61('0x8')],_0x41c800=-0x1,_0xb5e97a=-0x1,_0x5656be='',_0x5c6cc9=0x0,_0x11a78d='',_0x41e2c5='';this[_0xfc61('0x3')]+=_0x2e70ed[_0xfc61('0x9')]();_0x11a78d=this[_0xfc61('0x3')];if(!this['_inBody']){_0x5c6cc9=0x0;while(_0x3460c9[_0x5c6cc9]){while((_0xb5e97a=_0x11a78d['indexOf'](_0x3460c9[_0x5c6cc9]))!=-0x1){_0x5656be=_0x3460c9[_0x5c6cc9];_0x41e2c5=_0x11a78d[_0xfc61('0xa')](0x0,_0xb5e97a);_0x11a78d=_0x11a78d[_0xfc61('0xa')](_0xb5e97a+_0x5656be[_0xfc61('0xb')]);var _0x4e5198=_0x41e2c5[_0xfc61('0xc')](_0x2e63de),_0x3ca880=0x0,_0x4f5127={},_0xdadc6a='',_0x1ff85a='',_0x456fd7=-0x1;while(_0x4e5198[_0x3ca880]){_0x456fd7=_0x4e5198[_0x3ca880][_0xfc61('0xd')](':');if(_0x456fd7!=-0x1){_0xdadc6a=_0x4e5198[_0x3ca880][_0xfc61('0xe')](0x0,_0x456fd7)[_0xfc61('0xf')]();_0x1ff85a=_0x4e5198[_0x3ca880][_0xfc61('0xe')](_0x456fd7+0x1)[_0xfc61('0xf')]();if(_0xdadc6a['length']>0x0){_0x4f5127[_0xdadc6a]=_0x1ff85a;}}else{}_0x3ca880++;}this[_0xfc61('0x10')](_0xfc61('0x11'),_0x4f5127);this[_0xfc61('0x4')]=!![];}_0x5c6cc9++;}this[_0xfc61('0x3')]=_0x11a78d;}else{while((_0x41c800=_0x11a78d[_0xfc61('0xd')](_0x2e63de))!=-0x1){_0x41e2c5=_0x11a78d[_0xfc61('0xa')](0x0,_0x41c800);this['emit'](_0xfc61('0x12'),_0x41e2c5);_0x11a78d=_0x11a78d[_0xfc61('0xa')](_0x41c800+_0x2e63de['length']);}this[_0xfc61('0x3')]=_0x11a78d;}_0x4b7d26();};module[_0xfc61('0x13')]=AGIReply;
\ No newline at end of file
index 03f8004..49bdc18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x255f=['GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','getSquareProjects','name','production','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone'];(function(_0x3e6793,_0x48ec08){var _0x5277f0=function(_0x590cc7){while(--_0x590cc7){_0x3e6793['push'](_0x3e6793['shift']());}};_0x5277f0(++_0x48ec08);}(_0x255f,0x185));var _0xf255=function(_0x1ea19f,_0x347c72){_0x1ea19f=_0x1ea19f-0x0;var _0x4f74b7=_0x255f[_0x1ea19f];return _0x4f74b7;};'use strict';var _=require(_0xf255('0x0'));var moment=require('moment');var jayson=require(_0xf255('0x1'));var client=jayson[_0xf255('0x2')][_0xf255('0x3')]({'port':0x2329});function request(_0x4fae55,_0x3984f5){return new Promise(function(_0x3d90e8,_0x474ac5){return client[_0xf255('0x4')](_0x4fae55,_0x3984f5)[_0xf255('0x5')](function(_0x674218){if(_0x674218[_0xf255('0x6')]){return _0x474ac5(_0x674218['error'][_0xf255('0x7')]);}else{return _0x3d90e8(_0x674218['result']);}})['catch'](function(_0x4a533f){return _0x474ac5(_0x4a533f);});});}exports[_0xf255('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xf255('0x9'),_0xf255('0xa')]}});};exports['getSquareProject']=function(_0x2bd7a6){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2bd7a6},'attributes':[_0xf255('0xa')]}});};exports[_0xf255('0xb')]=function(_0xfbfff3){return request(_0xf255('0xc'),{'options':{'raw':![],'where':{'id':_0xfbfff3},'include':[{'model':_0xf255('0xd'),'as':'Smtp','include':[{'model':_0xf255('0xe'),'as':_0xf255('0xe')}]}],'attributes':['id',_0xf255('0x9'),'email'],'smtp':!![]}});};exports[_0xf255('0xf')]=function(_0x139e90){return request('ShowSquareProject',{'options':{'where':{'id':_0x139e90},'attributes':[_0xf255('0x9')]}});};exports[_0xf255('0x10')]=function(_0x233853){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x233853},'attributes':[_0xf255('0x9')]}});};exports[_0xf255('0x11')]=function(_0x4b8c8){return request(_0xf255('0x12'),{'options':{'where':{'id':_0x4b8c8},'attributes':[_0xf255('0x9')]}});};exports[_0xf255('0x13')]=function(_0x4edad2){return request(_0xf255('0x14'),{'options':{'where':{'id':_0x4edad2},'attributes':['dsn']}});};exports[_0xf255('0x15')]=function(_0x516b16){return request(_0xf255('0x16'),{'options':{'where':{'id':_0x516b16},'attributes':[_0xf255('0x9')]}});};exports[_0xf255('0x17')]=function(_0x43902c){return request(_0xf255('0x18'),{'options':{'where':{'phone':_0x43902c[_0xf255('0x19')]},'attributes':['id']}});};exports[_0xf255('0x1a')]=function(_0x422a19){return request(_0xf255('0x1b'),{'options':{'where':{'id':_0x422a19},'attributes':[_0xf255('0x9')]}});};exports[_0xf255('0x1c')]=function(_0x4e05e3){return request(_0xf255('0x1d'),{'options':{'where':{'id':_0x4e05e3},'attributes':[_0xf255('0x1e')]}});};exports[_0xf255('0x1f')]=function(_0x2c5fbc){return request(_0xf255('0x20'),{'options':{'raw':![],'where':{'id':_0x2c5fbc},'include':[{'model':_0xf255('0x21'),'as':_0xf255('0x22')}]}});};exports['getSmsAccountById']=function(_0x25d910){return request(_0xf255('0x23'),{'options':{'where':{'id':_0x25d910},'attributes':['id',_0xf255('0x9')]}});};exports[_0xf255('0x24')]=function(_0x325ee8){return request(_0xf255('0x25'),{'body':_0x325ee8});};exports[_0xf255('0x26')]=function(_0x4b1bef){return request(_0xf255('0x27'),{'body':_0x4b1bef});};exports['createSquareReport']=function(_0x4db833){return request(_0xf255('0x28'),{'body':_[_0xf255('0x29')](_0x4db833,{'project_name':_0x4db833[_0xf255('0x2a')],'prev_project_name':_0x4db833[_0xf255('0x2b')]||'','is_subproject':_0x4db833[_0xf255('0x2b')]?!![]:![],'leaveAt':moment()['format'](_0xf255('0x2c'))})});};exports[_0xf255('0x2d')]=function(_0xdeaf7e){return request('CreateSquareRecording',{'body':_0xdeaf7e});};exports[_0xf255('0x2e')]=function(_0x3527fb){return request(_0xf255('0x2f'),{'body':_0x3527fb});};exports['createCmContact']=function(_0xa1827e){return request(_0xf255('0x30'),{'options':{'raw':![],'where':{'phone':_0xa1827e[_0xf255('0x19')],'ListId':_0xa1827e[_0xf255('0x31')]}}})[_0xf255('0x5')](function(_0x1ca07f){if(_0x1ca07f){return _0x1ca07f;}return request(_0xf255('0x32'),{'body':_0xa1827e});});};exports[_0xf255('0x33')]=function(_0x6f0de2){return request(_0xf255('0x34'),{'options':{'where':{'id':_0x6f0de2},'attributes':['name']}});};exports[_0xf255('0x35')]=function(_0x415299,_0x17856a){return request(_0xf255('0x36'),{'body':{'interface':_0x17856a},'options':{'where':_0x415299}});};exports[_0xf255('0x37')]=function(_0x3e4c5a,_0x2855a2,_0xf9e1d1){return request('PauseUser',{'body':{'type':_0x2855a2,'uniqueid':_0xf9e1d1},'options':{'where':_0x3e4c5a}});};exports[_0xf255('0x38')]=function(_0x5d467a){return request('UnpauseUser',{'body':{},'options':{'where':_0x5d467a}});};exports[_0xf255('0x39')]=function(_0x90d5e0){return request(_0xf255('0x3a'),{'body':{},'options':{'where':_0x90d5e0}});};
\ No newline at end of file
+var _0x6ddd=['jayson/promise','client','http','request','error','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','ShowTrunk','getSoundById','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6ddd,0xae));var _0xd6dd=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6ddd[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0xd6dd('0x0'));var client=jayson[_0xd6dd('0x1')][_0xd6dd('0x2')]({'port':0x2329});function request(_0x250900,_0x5283c5){return new Promise(function(_0x3651aa,_0x5aebd8){return client[_0xd6dd('0x3')](_0x250900,_0x5283c5)['then'](function(_0x43c57e){if(_0x43c57e[_0xd6dd('0x4')]){return _0x5aebd8(_0x43c57e[_0xd6dd('0x4')]['message']);}else{return _0x3651aa(_0x43c57e[_0xd6dd('0x5')]);}})[_0xd6dd('0x6')](function(_0x12f605){return _0x5aebd8(_0x12f605);});});}exports[_0xd6dd('0x7')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xd6dd('0x8'),_0xd6dd('0x9')]}});};exports[_0xd6dd('0xa')]=function(_0x3f39b1){return request(_0xd6dd('0xb'),{'options':{'raw':![],'where':{'name':_0x3f39b1},'attributes':[_0xd6dd('0x9')]}});};exports[_0xd6dd('0xc')]=function(_0x399823){return request(_0xd6dd('0xd'),{'options':{'raw':![],'where':{'id':_0x399823},'include':[{'model':_0xd6dd('0xe'),'as':_0xd6dd('0xf'),'include':[{'model':_0xd6dd('0x10'),'as':'CloudProvider'}]}],'attributes':['id',_0xd6dd('0x8'),_0xd6dd('0x11')],'smtp':!![]}});};exports[_0xd6dd('0x12')]=function(_0x19bdc1){return request(_0xd6dd('0xb'),{'options':{'where':{'id':_0x19bdc1},'attributes':[_0xd6dd('0x8')]}});};exports[_0xd6dd('0x13')]=function(_0x550953){return request(_0xd6dd('0x14'),{'options':{'where':{'id':_0x550953},'attributes':[_0xd6dd('0x8')]}});};exports[_0xd6dd('0x15')]=function(_0x40febd){return request(_0xd6dd('0x16'),{'options':{'where':{'id':_0x40febd},'attributes':[_0xd6dd('0x8')]}});};exports[_0xd6dd('0x17')]=function(_0x6056e7){return request(_0xd6dd('0x18'),{'options':{'where':{'id':_0x6056e7},'attributes':[_0xd6dd('0x19')]}});};exports[_0xd6dd('0x1a')]=function(_0x289865){return request('ShowUser',{'options':{'where':{'id':_0x289865},'attributes':[_0xd6dd('0x8')]}});};exports[_0xd6dd('0x1b')]=function(_0x3941d3){return request(_0xd6dd('0x1c'),{'options':{'where':{'phone':_0x3941d3['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x84a5d4){return request(_0xd6dd('0x1d'),{'options':{'where':{'id':_0x84a5d4},'attributes':['name']}});};exports[_0xd6dd('0x1e')]=function(_0x336679){return request('ShowSound',{'options':{'where':{'id':_0x336679},'attributes':[_0xd6dd('0x1f')]}});};exports[_0xd6dd('0x20')]=function(_0x1786c8){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1786c8},'include':[{'model':_0xd6dd('0x21'),'as':_0xd6dd('0x22')}]}});};exports[_0xd6dd('0x23')]=function(_0x4b2275){return request(_0xd6dd('0x24'),{'options':{'where':{'id':_0x4b2275},'attributes':['id',_0xd6dd('0x8')]}});};exports[_0xd6dd('0x25')]=function(_0x1b9275){return request(_0xd6dd('0x26'),{'body':_0x1b9275});};exports[_0xd6dd('0x27')]=function(_0x25817b){return request('CreateSquareDetailsReport',{'body':_0x25817b});};exports['createSquareReport']=function(_0x284a95){return request('CreateSquareReport',{'body':_['merge'](_0x284a95,{'project_name':_0x284a95['arg_1'],'prev_project_name':_0x284a95[_0xd6dd('0x28')]||'','is_subproject':_0x284a95['arg_2']?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xd6dd('0x29')]=function(_0x17bed4){return request(_0xd6dd('0x2a'),{'body':_0x17bed4});};exports[_0xd6dd('0x2b')]=function(_0x2229a7){return request(_0xd6dd('0x2c'),{'body':_0x2229a7});};exports['createCmContact']=function(_0x108c10){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x108c10[_0xd6dd('0x2d')],'ListId':_0x108c10[_0xd6dd('0x2e')]}}})[_0xd6dd('0x2f')](function(_0x115c9f){if(_0x115c9f){return _0x115c9f;}return request(_0xd6dd('0x30'),{'body':_0x108c10});});};exports[_0xd6dd('0x31')]=function(_0x394ac2){return request(_0xd6dd('0x32'),{'options':{'where':{'id':_0x394ac2},'attributes':[_0xd6dd('0x8')]}});};exports[_0xd6dd('0x33')]=function(_0x5aa9c0,_0x357a80){return request(_0xd6dd('0x34'),{'body':{'interface':_0x357a80},'options':{'where':_0x5aa9c0}});};exports[_0xd6dd('0x35')]=function(_0x3c72e0,_0x2a5a73,_0x5ef0bc){return request('PauseUser',{'body':{'type':_0x2a5a73,'uniqueid':_0x5ef0bc},'options':{'where':_0x3c72e0}});};exports[_0xd6dd('0x36')]=function(_0x31a93d){return request(_0xd6dd('0x37'),{'body':{},'options':{'where':_0x31a93d}});};exports[_0xd6dd('0x38')]=function(_0x2f1322){return request(_0xd6dd('0x39'),{'body':{},'options':{'where':_0x2f1322}});};
\ No newline at end of file
index 6e32e80..28cfe96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18b2=['exports','./lex'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x18b2,0x85));var _0x218b=function(_0x316a11,_0x49fd65){_0x316a11=_0x316a11-0x0;var _0x324d00=_0x18b2[_0x316a11];return _0x324d00;};var polly=require('./polly');var lex=require(_0x218b('0x0'));module[_0x218b('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
index e2c47c3..997a603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['exports'];(function(_0x20dbe3,_0x2cc5b3){var _0x57b693=function(_0x462771){while(--_0x462771){_0x20dbe3['push'](_0x20dbe3['shift']());}};_0x57b693(++_0x2cc5b3);}(_0x91a7,0xe7));var _0x791a=function(_0x3a322f,_0x3614f8){_0x3a322f=_0x3a322f-0x0;var _0x1a3724=_0x91a7[_0x3a322f];return _0x1a3724;};'use strict';var lex=require('./lib/api');module[_0x791a('0x0')]=function(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392){return lex(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392);};
\ No newline at end of file
+var _0xaa88=['exports','./lib/api'];(function(_0xaaa6c3,_0x49421f){var _0x10adcb=function(_0x14004a){while(--_0x14004a){_0xaaa6c3['push'](_0xaaa6c3['shift']());}};_0x10adcb(++_0x49421f);}(_0xaa88,0x137));var _0x8aa8=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xaa88[_0x46f1a6];return _0x38429a;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);};
\ No newline at end of file
index 3288d5d..3a91524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x5784b6,_0x2e119c){var _0x2e7b8c=function(_0x162942){while(--_0x162942){_0x5784b6['push'](_0x5784b6['shift']());}};_0x2e7b8c(++_0x2e119c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x47c4f1,_0x1c5182){var _0x524053=function(_0x6a7e7f){while(--_0x6a7e7f){_0x47c4f1['push'](_0x47c4f1['shift']());}};_0x524053(++_0x1c5182);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 7cd6fae..2a0d261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295e=['./lib/api','exports'];(function(_0x3a49d1,_0x5a57ed){var _0x2df955=function(_0x371e15){while(--_0x371e15){_0x3a49d1['push'](_0x3a49d1['shift']());}};_0x2df955(++_0x5a57ed);}(_0x295e,0xd4));var _0xe295=function(_0x355819,_0x4f660b){_0x355819=_0x355819-0x0;var _0x410478=_0x295e[_0x355819];return _0x410478;};'use strict';var polly=require(_0xe295('0x0'));module[_0xe295('0x1')]=function(_0x5228b5,_0x2f3496,_0x4bb761,_0x1674a6,_0x11222a,_0x2afebe,_0x190568){return polly(_0x5228b5,_0x2f3496,_0x4bb761,_0x1674a6,_0x11222a,_0x2afebe,_0x190568);};
\ No newline at end of file
+var _0x76fd=['exports'];(function(_0x34b9b4,_0x109f44){var _0x6a2f11=function(_0x4159bd){while(--_0x4159bd){_0x34b9b4['push'](_0x34b9b4['shift']());}};_0x6a2f11(++_0x109f44);}(_0x76fd,0x15a));var _0xd76f=function(_0x1ee5ef,_0x38d42b){_0x1ee5ef=_0x1ee5ef-0x0;var _0x448ab8=_0x76fd[_0x1ee5ef];return _0x448ab8;};'use strict';var polly=require('./lib/api');module[_0xd76f('0x0')]=function(_0xe84e4d,_0x37a7c2,_0x16e16b,_0x35690e,_0x348424,_0x507b78,_0x5f053c){return polly(_0xe84e4d,_0x37a7c2,_0x16e16b,_0x35690e,_0x348424,_0x507b78,_0x5f053c);};
\ No newline at end of file
index 8752554..4ce3fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x665b=['mp3','path','bluebird','randomstring','aws-sdk','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x665b,0xbf));var _0xb665=function(_0x270fc9,_0x349fac){_0x270fc9=_0x270fc9-0x0;var _0x52d18a=_0x665b[_0x270fc9];return _0x52d18a;};'use strict';var fs=require('fs');var path=require(_0xb665('0x0'));var BPromise=require(_0xb665('0x1'));var rs=require(_0xb665('0x2'));var AWS=require(_0xb665('0x3'));function pollyResult(_0x224532,_0x3fd45e,_0x4db706){return new BPromise(function(_0x3608bc,_0x5217cc){_0x224532['synthesizeSpeech'](_0x3fd45e,function(_0x5ea5cf,_0xbf5a8a){if(_0x5ea5cf){_0x5217cc(_0x5ea5cf);}else if(_0xbf5a8a){if(_0xbf5a8a[_0xb665('0x4')]instanceof Buffer){fs['writeFile'](_0x4db706,_0xbf5a8a[_0xb665('0x4')],function(_0x240621){if(_0x240621){_0x5217cc(_0x240621);}else{_0x3608bc();}});}else{_0x5217cc(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x5217cc(new Error(_0xb665('0x5')));}});});}module[_0xb665('0x6')]=function(_0x55ab7,_0x388fa0,_0x3adb60,_0x7f0642,_0x105731,_0x378216,_0x1e61e1){var _0x1f745c=new AWS[(_0xb665('0x7'))]({'accessKeyId':_0x55ab7,'secretAccessKey':_0x388fa0,'region':_0x3adb60});var _0x89c864={'Text':_0x105731,'TextType':_0x378216||_0xb665('0x8'),'OutputFormat':_0xb665('0x9'),'VoiceId':_0x7f0642};return pollyResult(_0x1f745c,_0x89c864,_0x1e61e1);};
\ No newline at end of file
+var _0x1c4e=['mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c4e,0x169));var _0xe1c4=function(_0x443111,_0x3c94ae){_0x443111=_0x443111-0x0;var _0x3056c5=_0x1c4e[_0x443111];return _0x3056c5;};'use strict';var fs=require('fs');var path=require(_0xe1c4('0x0'));var BPromise=require(_0xe1c4('0x1'));var rs=require('randomstring');var AWS=require(_0xe1c4('0x2'));function pollyResult(_0x48f4a2,_0x197b8b,_0x5aabdb){return new BPromise(function(_0x461e53,_0x24c059){_0x48f4a2[_0xe1c4('0x3')](_0x197b8b,function(_0x334c94,_0x4b84c2){if(_0x334c94){_0x24c059(_0x334c94);}else if(_0x4b84c2){if(_0x4b84c2[_0xe1c4('0x4')]instanceof Buffer){fs[_0xe1c4('0x5')](_0x5aabdb,_0x4b84c2[_0xe1c4('0x4')],function(_0xf439bd){if(_0xf439bd){_0x24c059(_0xf439bd);}else{_0x461e53();}});}else{_0x24c059(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x24c059(new Error(_0xe1c4('0x6')));}});});}module[_0xe1c4('0x7')]=function(_0x1773fc,_0x312d34,_0x2c8a77,_0x2076a8,_0x3fa795,_0x3c972d,_0x2a596f){var _0x8c0f85=new AWS['Polly']({'accessKeyId':_0x1773fc,'secretAccessKey':_0x312d34,'region':_0x2c8a77});var _0x58158e={'Text':_0x3fa795,'TextType':_0x3c972d||'text','OutputFormat':_0xe1c4('0x8'),'VoiceId':_0x2076a8};return pollyResult(_0x8c0f85,_0x58158e,_0x2a596f);};
\ No newline at end of file
index 1db96ae..50e8510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5747=['exports','./lib/api'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5747,0x77));var _0x7574=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x5747[_0x4d8ed9];return _0x1e2140;};'use strict';var asr=require(_0x7574('0x0'));module[_0x7574('0x1')]=function(_0x4d587c,_0x23504f,_0x11a17d,_0x315a0d){return asr(_0x4d587c,_0x23504f,_0x11a17d);};
\ No newline at end of file
+var _0x69c4=['./lib/api'];(function(_0xcda7d2,_0x366a8a){var _0x3439a4=function(_0xc9bb66){while(--_0xc9bb66){_0xcda7d2['push'](_0xcda7d2['shift']());}};_0x3439a4(++_0x366a8a);}(_0x69c4,0x1af));var _0x469c=function(_0x4783d8,_0x121810){_0x4783d8=_0x4783d8-0x0;var _0x1ca75a=_0x69c4[_0x4783d8];return _0x1ca75a;};'use strict';var asr=require(_0x469c('0x0'));module['exports']=function(_0x1eebb2,_0x93d3d8,_0x59f24e,_0x435fd9){return asr(_0x1eebb2,_0x93d3d8,_0x59f24e);};
\ No newline at end of file
index 47123ca..73b6331 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc73e=['length','filepath\x20should\x20be\x20a\x20string','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','url','bluebird','exports'];(function(_0x416f4e,_0x46a4b1){var _0x230028=function(_0x5a17ea){while(--_0x5a17ea){_0x416f4e['push'](_0x416f4e['shift']());}};_0x230028(++_0x46a4b1);}(_0xc73e,0x1e9));var _0xec73=function(_0x4bbdfb,_0x2da728){_0x4bbdfb=_0x4bbdfb-0x0;var _0x515103=_0xc73e[_0x4bbdfb];return _0x515103;};'use strict';var url=require(_0xec73('0x0'));var BPromise=require(_0xec73('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xec73('0x2')]=function(_0x39de1c,_0x4b88fa,_0x5e5526){return new BPromise(function(_0x494c49,_0x36ed48){var _0x3b35a2;if(typeof _0x39de1c!=='string'||_0x39de1c[_0xec73('0x3')]===0x0){return _0x36ed48(_0xec73('0x4'));}if(typeof _0x4b88fa!==_0xec73('0x5')||_0x4b88fa[_0xec73('0x3')]===0x0){return _0x36ed48('key\x20should\x20be\x20a\x20string');}if(typeof _0x5e5526!==_0xec73('0x6')&&(typeof _0x5e5526!=='string'||_0x5e5526[_0xec73('0x3')]===0x0)){return _0x36ed48(_0xec73('0x7'));}try{_0x3b35a2=fs[_0xec73('0x8')](_0x39de1c)[_0xec73('0x9')]('base64');}catch(_0x4a35c9){return _0x36ed48(_0x4a35c9);}return _0x494c49({'method':_0xec73('0xa'),'uri':host+_0xec73('0xb')+_0x4b88fa,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x5e5526},'audio':{'content':_0x3b35a2}},'json':!![]});});};
\ No newline at end of file
+var _0x55ea=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','key\x20should\x20be\x20a\x20string','undefined','length'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0x55ea,0xc9));var _0xa55e=function(_0x59334a,_0x4ba158){_0x59334a=_0x59334a-0x0;var _0x277642=_0x55ea[_0x59334a];return _0x277642;};'use strict';var url=require(_0xa55e('0x0'));var BPromise=require(_0xa55e('0x1'));var fs=require('fs');var host=_0xa55e('0x2');module['exports']=function(_0x2b5bc7,_0x26b2ef,_0x17dd4d){return new BPromise(function(_0x1325cc,_0x95af3d){var _0x54f178;if(typeof _0x2b5bc7!==_0xa55e('0x3')||_0x2b5bc7['length']===0x0){return _0x95af3d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x26b2ef!=='string'||_0x26b2ef['length']===0x0){return _0x95af3d(_0xa55e('0x4'));}if(typeof _0x17dd4d!==_0xa55e('0x5')&&(typeof _0x17dd4d!==_0xa55e('0x3')||_0x17dd4d[_0xa55e('0x6')]===0x0)){return _0x95af3d(_0xa55e('0x7'));}try{_0x54f178=fs[_0xa55e('0x8')](_0x2b5bc7)[_0xa55e('0x9')](_0xa55e('0xa'));}catch(_0xe58ede){return _0x95af3d(_0xe58ede);}return _0x1325cc({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x26b2ef,'body':{'config':{'encoding':_0xa55e('0xb'),'sampleRateHertz':_0xa55e('0xc'),'languageCode':_0x17dd4d},'audio':{'content':_0x54f178}},'json':!![]});});};
\ No newline at end of file
index d29b2f8..78174ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x858d=['exports'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x858d,0x1d9));var _0xd858=function(_0x1c417b,_0x381d5f){_0x1c417b=_0x1c417b-0x0;var _0x21bdd0=_0x858d[_0x1c417b];return _0x21bdd0;};var asr=require('./asr');module[_0xd858('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x1a52=['exports','./asr'];(function(_0x2fd4ba,_0x212dd4){var _0x2fae76=function(_0x232a7c){while(--_0x232a7c){_0x2fd4ba['push'](_0x2fd4ba['shift']());}};_0x2fae76(++_0x212dd4);}(_0x1a52,0xe7));var _0x21a5=function(_0x10fd63,_0x30ad07){_0x10fd63=_0x10fd63-0x0;var _0x275c52=_0x1a52[_0x10fd63];return _0x275c52;};var asr=require(_0x21a5('0x0'));module[_0x21a5('0x1')]={'asr':asr};
\ No newline at end of file
index 974e015..590532c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f87=['confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','responseId','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','querystring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','finish\x20download\x20file','error','unlink','pipe','end','https:','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','resolve','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','uri','results','alternatives','transcript','join','map'];(function(_0x422465,_0x4c5776){var _0x4116bd=function(_0xeb31a7){while(--_0xeb31a7){_0x422465['push'](_0x422465['shift']());}};_0x4116bd(++_0x4c5776);}(_0x1f87,0xc3));var _0x71f8=function(_0x262f44,_0x3847ba){_0x262f44=_0x262f44-0x0;var _0x33b27c=_0x1f87[_0x262f44];return _0x33b27c;};'use strict';var apiai=require(_0x71f8('0x0'));var BPromise=require(_0x71f8('0x1'));var dialogflow=require(_0x71f8('0x2'));var fs=require('fs');var http=require(_0x71f8('0x3'));var https=require('https');var md5=require(_0x71f8('0x4'));var path=require(_0x71f8('0x5'));var querystring=require(_0x71f8('0x6'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x71f8('0x7'));var tts=require(_0x71f8('0x8'));var urlParse=require(_0x71f8('0x9'))[_0x71f8('0xa')];var util=require(_0x71f8('0xb'));var aws=require(_0x71f8('0xc'));var google=require(_0x71f8('0xd'));var sestek=require(_0x71f8('0xe'));var tilde=require('./tilde');var logger=require(_0x71f8('0xf'))(_0x71f8('0x10'));var ISPEECH_API=_0x71f8('0x11');function downloadFile(_0x4b7b3f,_0x2b3705){return new BPromise(function(_0x449591,_0x332ee8){var _0x50b359=urlParse(_0x4b7b3f);var _0x335858=_0x50b359[_0x71f8('0x12')]==='https:'?https:http;var _0x2a54fa={'host':_0x50b359[_0x71f8('0x13')],'path':_0x50b359['path'],'headers':{'user-agent':_0x71f8('0x14')}};_0x335858['get'](_0x2a54fa,function(_0x1bd70b){if(_0x1bd70b[_0x71f8('0x15')]!==0xc8){logger['error'](_0x71f8('0x16')+_0x4b7b3f+'\x20failed,\x20status\x20code\x20=\x20'+_0x1bd70b[_0x71f8('0x15')]+'\x20('+_0x1bd70b[_0x71f8('0x17')]+')');_0x332ee8(new Error(_0x71f8('0x16')+_0x4b7b3f+_0x71f8('0x18')+_0x1bd70b[_0x71f8('0x15')]+'\x20('+_0x1bd70b[_0x71f8('0x17')]+')'));return;}var _0x5f3067=fs[_0x71f8('0x19')](_0x2b3705);_0x5f3067['on']('finish',function(){logger[_0x71f8('0x1a')](_0x71f8('0x1b'));_0x5f3067['close'](_0x449591);});_0x5f3067['on'](_0x71f8('0x1c'),function(_0x4d6cda){fs[_0x71f8('0x1d')](_0x2b3705);logger[_0x71f8('0x1c')]('download\x20error',_0x4d6cda);_0x332ee8(_0x4d6cda);});_0x1bd70b[_0x71f8('0x1e')](_0x5f3067);})['on'](_0x71f8('0x1c'),function(_0x3d622b){logger[_0x71f8('0x1c')](_0x3d622b);_0x332ee8(_0x3d622b);})[_0x71f8('0x1f')]();});}function uploadFile(_0x5f7163){return new BPromise(function(_0x3b716b,_0x3b7f77){var _0x543e4d=urlParse(_0x5f7163);var _0xe2aeab=_0x543e4d[_0x71f8('0x12')]===_0x71f8('0x20')?https:http;var _0x18152a={'host':_0x543e4d[_0x71f8('0x13')],'path':_0x543e4d[_0x71f8('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0xe2aeab[_0x71f8('0x21')](_0x18152a,function(_0x129a99){if(_0x129a99[_0x71f8('0x15')]!==0xc8){_0x3b7f77(new Error(_0x71f8('0x16')+_0x5f7163+_0x71f8('0x18')+_0x129a99[_0x71f8('0x15')]+'\x20('+_0x129a99[_0x71f8('0x17')]+')'));return;}var _0x54e1ae='';_0x129a99['on'](_0x71f8('0x22'),function(_0x32d098){_0x54e1ae+=_0x32d098;});_0x129a99['on'](_0x71f8('0x1f'),function(){_0x3b716b(_0x54e1ae);});})['on']('error',function(_0x539c94){_0x3b7f77(_0x539c94);})['end']();});}function convertFile(_0x302caf,_0x540b68){return new BPromise(function(_0x102d83,_0x5bb6b3){var _0x1984c2=sox[_0x71f8('0x23')](_0x302caf,_0x540b68,{'sampleRate':0x1f40,'format':_0x71f8('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1984c2['on'](_0x71f8('0x1c'),function(_0x47f693){logger[_0x71f8('0x1c')](_0x71f8('0x25'),_0x47f693);_0x5bb6b3(_0x47f693);});_0x1984c2['on'](_0x71f8('0x1f'),function(){logger[_0x71f8('0x1a')](_0x71f8('0x26'));_0x102d83();});_0x1984c2[_0x71f8('0x27')]();});}function base64Decode(_0x26dcbb,_0x46188b){var _0x22fad3=path['resolve'](__dirname,_0x71f8('0x28'),rs[_0x71f8('0x29')](0x4)+_0x71f8('0x2a'));fs[_0x71f8('0x2b')](_0x22fad3,_0x26dcbb,_0x71f8('0x2c'));return convertFile(_0x22fad3,_0x46188b)[_0x71f8('0x2d')](function(){try{fs[_0x71f8('0x1d')](_0x22fad3);fs[_0x71f8('0x2e')](_0x46188b,_0x71f8('0x2f'));}catch(_0x2cad2a){logger[_0x71f8('0x1c')](_0x2cad2a);}return _0x46188b[_0x71f8('0x30')]('.')[0x0];});}function base64Encode(_0x194faa){var _0x12b583=fs[_0x71f8('0x31')](_0x194faa);return new Buffer(_0x12b583)[_0x71f8('0x32')](_0x71f8('0x2c'));}exports[_0x71f8('0x33')]=function(_0x52ae7a,_0x4a3248,_0x162be3,_0x5e4a74,_0x194e49,_0x47df15){var _0x3a1397,_0xdc4e65;var _0x17dde5=_0x71f8('0x34');var _0x2f823d=_0x71f8('0x35')+_0x52ae7a;var _0x1439ed={};if(_0x4a3248==='ssml'){_0x1439ed[_0x71f8('0x36')]={'ssml':_0x162be3};}else{_0x1439ed[_0x71f8('0x36')]={'text':_0x162be3};};_0x1439ed[_0x71f8('0x37')]={'languageCode':_0x5e4a74,'ssmlGender':_0x194e49};_0x1439ed[_0x71f8('0x38')]={'audioEncoding':_0x71f8('0x39'),'sampleRateHertz':0x1f40};var _0x563216={'url':_0x17dde5+_0x71f8('0x3a')+_0x2f823d,'method':_0x71f8('0x3b'),'json':!![],'body':_0x1439ed};return rp(_0x563216)['then'](function(_0x59856e){return new BPromise(function(_0x3ee171,_0x3d8e09){_0x3a1397=path['resolve'](__dirname,_0x71f8('0x28'),rs[_0x71f8('0x29')](0x4)+'.mp3');var _0x12d8d6=Buffer[_0x71f8('0x3c')](_0x59856e[_0x71f8('0x3d')],_0x71f8('0x2c'));return fs[_0x71f8('0x3e')](_0x3a1397,_0x12d8d6,function(_0x5d76a9){_0x3d8e09(_0x5d76a9);},function(_0x26fa3e){fs[_0x71f8('0x2e')](_0x3a1397,_0x71f8('0x2f'));_0x3ee171(_0x26fa3e);});});})[_0x71f8('0x2d')](function(_0x58a779){_0xdc4e65=path[_0x71f8('0x3f')](__dirname,'tmp',rs['generate'](0x4)+_0x71f8('0x2a'));return convertFile(_0x3a1397,_0xdc4e65);})['then'](function(){try{fs[_0x71f8('0x1d')](_0x3a1397);fs[_0x71f8('0x2e')](_0xdc4e65,'777');}catch(_0x9b60c5){logger[_0x71f8('0x1c')](_0x9b60c5);}logger[_0x71f8('0x1a')](_0x71f8('0x40'),_0xdc4e65[_0x71f8('0x30')]('.')[0x0]);return _0xdc4e65[_0x71f8('0x30')]('.')[0x0];});};exports['googleTTS']=function(_0x162933,_0x35dcec){var _0x1039b9=_0x71f8('0x41');var _0x3fc8aa,_0x34b785;var _0x169360;var _0x2d55a2={'encoding':'utf8','method':_0x71f8('0x3b'),'timeout':0x2710,'url':_0x1039b9,'headers':{'Content-Type':_0x71f8('0x42')},'body':_0x71f8('0x43')+encodeURIComponent(JSON[_0x71f8('0x44')]([[[_0x71f8('0x45'),JSON[_0x71f8('0x44')]([_0x162933,_0x35dcec||'en',![],'null']),null,_0x71f8('0x46')]]]))};return rp(_0x2d55a2)[_0x71f8('0x2d')](function(_0x4a131c){try{_0x169360=eval(_0x4a131c[_0x71f8('0x47')](0x5))[0x0][0x2];}catch(_0x5f0c2d){throw new Error(_0x71f8('0x48')+_0x4a131c['data']);}if(!_0x169360){if(_0x162933[_0x71f8('0x49')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x71f8('0x4a')+_0x35dcec+_0x71f8('0x4b'));}}try{_0x169360=eval(_0x169360)[0x0];}catch(_0x47f1f0){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x71f8('0x22')]);}const _0x36c083=_0x169360;_0x3fc8aa=path['resolve'](__dirname,_0x71f8('0x28'),rs['generate'](0x4)+_0x71f8('0x4c'));fs['writeFileSync'](_0x3fc8aa,_0x169360,{'encoding':_0x71f8('0x2c')});_0x34b785=path[_0x71f8('0x3f')](__dirname,_0x71f8('0x28'),rs[_0x71f8('0x29')](0x4)+'.wav');return convertFile(_0x3fc8aa,_0x34b785);})[_0x71f8('0x2d')](function(){try{fs[_0x71f8('0x1d')](_0x3fc8aa);fs[_0x71f8('0x2e')](_0x34b785,'777');}catch(_0x5a9bd6){logger['error'](_0x5a9bd6);}logger['info'](_0x71f8('0x4d'),_0x34b785['split']('.')[0x0]);return _0x34b785['split']('.')[0x0];});};exports[_0x71f8('0x4e')]=function(_0x2e930d,_0x2dade5,_0x72e63){return google['asr'](_0x2e930d,_0x2dade5,_0x72e63)['then'](function(_0x561fe1){logger[_0x71f8('0x1a')](_0x561fe1[_0x71f8('0x4f')]);return rp(_0x561fe1);})[_0x71f8('0x2d')](function(_0x3834f2){var _0x28e1a5='';var _0x17992a=0x0;try{fs[_0x71f8('0x1d')](_0x2e930d);}catch(_0x3548d5){logger[_0x71f8('0x1c')](_0x3548d5);}if(_0x3834f2&&_0x3834f2[_0x71f8('0x50')]){_0x28e1a5=_0x3834f2[_0x71f8('0x50')]['map'](function(_0x3f8245){return _0x3f8245&&_0x3f8245[_0x71f8('0x51')][0x0]&&_0x3f8245['alternatives'][0x0]['transcript']?_0x3f8245[_0x71f8('0x51')][0x0][_0x71f8('0x52')]:'';})[_0x71f8('0x53')]('\x0a');_0x17992a=_0x3834f2['results'][_0x71f8('0x54')](function(_0x4d9e00){return _0x4d9e00&&_0x4d9e00[_0x71f8('0x51')][0x0]&&_0x4d9e00[_0x71f8('0x51')][0x0][_0x71f8('0x55')]?_0x4d9e00['alternatives'][0x0][_0x71f8('0x55')]:0x0;})[_0x71f8('0x53')]('\x0a');}logger['info'](_0x71f8('0x56'),_0x28e1a5);logger['info'](_0x71f8('0x57'),_0x17992a);return{'transcript':_0x28e1a5,'confidence':_0x17992a};})[_0x71f8('0x58')](function(_0x188803){logger[_0x71f8('0x1c')]('[%s]\x20%s:%s',_0x188803[_0x71f8('0x15')],_0x188803[_0x71f8('0x59')],_0x188803['message']);});};exports[_0x71f8('0x5a')]=function(_0x2c66e3,_0x43f405,_0x4a5447,_0x35ea84){var _0x51d51e=apiai(_0x43f405,{'language':_0x35ea84||'en'});return _0x51d51e[_0x71f8('0x5b')](_0x4a5447,{'sessionId':md5(_0x2c66e3)})[_0x71f8('0x2d')](function(_0x258d40){logger['info'](JSON['stringify'](_0x258d40));return{'source':_0x258d40[_0x71f8('0x5c')]['source'],'resolvedQuery':_0x258d40['result'][_0x71f8('0x5d')],'action':_0x258d40['result']['action'],'actionIncomplete':_0x258d40[_0x71f8('0x5c')][_0x71f8('0x5e')],'speech':_0x258d40[_0x71f8('0x5c')][_0x71f8('0x5f')][_0x71f8('0x60')],'score':_0x258d40[_0x71f8('0x5c')]['score'],'statusCode':_0x258d40[_0x71f8('0x61')][_0x71f8('0x62')],'endConversation':_0x258d40['result'][_0x71f8('0x63')][_0x71f8('0x64')]||![],'isFallbackIntent':_0x258d40[_0x71f8('0x5c')][_0x71f8('0x63')][_0x71f8('0x65')]};});};exports[_0x71f8('0x66')]=function(_0x19ae3a,_0x5071cc,_0x227920,_0x133ff7,_0x14bdaf,_0x5f5c82){var _0x4b36d9=_0x133ff7[_0x71f8('0x67')](/\\n/g,'\x0a');var _0xf77a9b={'credentials':{'private_key':_0x4b36d9,'client_email':_0x227920}};var _0x29fe3c=new dialogflow['SessionsClient'](_0xf77a9b);var _0x3d8dce=_0x29fe3c['sessionPath'](_0x5071cc,md5(_0x19ae3a));var _0x1dbc6b={'session':_0x3d8dce,'queryInput':{'text':{'text':_0x14bdaf,'languageCode':_0x5f5c82}}};return _0x29fe3c[_0x71f8('0x68')](_0x1dbc6b)['then'](function(_0x54f6b5){if(_0x54f6b5&&_0x54f6b5[_0x71f8('0x49')]){logger['info'](_0x71f8('0x69'),JSON['stringify'](_0x54f6b5));var _0x4806a1=_0x54f6b5[0x0];if(_0x4806a1){var _0x4fc2cc={'action':_0x4806a1[_0x71f8('0x6a')][_0x71f8('0x6b')],'allRequiredParamsPresent':_0x4806a1[_0x71f8('0x6a')][_0x71f8('0x6c')],'endConversation':_0x4806a1[_0x71f8('0x6a')]['diagnosticInfo']&&_0x4806a1['queryResult'][_0x71f8('0x6d')][_0x71f8('0x6e')]?_0x4806a1[_0x71f8('0x6a')][_0x71f8('0x6d')][_0x71f8('0x6e')][_0x71f8('0x6f')][_0x71f8('0x70')]:![],'fulfillmentText':_0x4806a1['queryResult']['fulfillmentText'],'intentName':_0x4806a1['queryResult'][_0x71f8('0x71')][_0x71f8('0x59')],'intentDisplayName':_0x4806a1['queryResult'][_0x71f8('0x71')][_0x71f8('0x72')],'isFallbackIntent':_0x4806a1[_0x71f8('0x6a')][_0x71f8('0x71')][_0x71f8('0x73')],'languageCode':_0x4806a1[_0x71f8('0x6a')]['languageCode'],'queryText':_0x4806a1['queryResult']['queryText'],'responseId':_0x4806a1[_0x71f8('0x74')],'score':_0x4806a1[_0x71f8('0x6a')]['intentDetectionConfidence'],'speech':_0x4806a1[_0x71f8('0x6a')][_0x71f8('0x75')],'providerResponse':JSON['stringify'](_0x54f6b5)};return _0x4fc2cc;}}});};exports[_0x71f8('0x76')]=function(_0x256709,_0x4980b7,_0x32c558,_0x3e439e){return tilde[_0x71f8('0x77')](_0x256709,_0x4980b7,_0x32c558,_0x3e439e)[_0x71f8('0x2d')](function(_0x6dddec){try{fs[_0x71f8('0x1d')](_0x256709);}catch(_0x1c1912){logger[_0x71f8('0x1c')](_0x1c1912);}logger[_0x71f8('0x1a')](_0x71f8('0x78'),_0x6dddec['transcript']);logger[_0x71f8('0x1a')](_0x71f8('0x79'),_0x6dddec[_0x71f8('0x55')]);return _0x6dddec;});};exports[_0x71f8('0x7a')]=function(_0x428a0e,_0x44cbb7,_0x1b0427,_0x58c9ff,_0x2ee0c6,_0x3c3eea){var _0xebd7=path[_0x71f8('0x3f')](__dirname,_0x71f8('0x28'),rs[_0x71f8('0x29')](0x4)+'.mp3');var _0x1407ab;return aws[_0x71f8('0x7b')](_0x428a0e,_0x44cbb7,_0x1b0427,_0x58c9ff,_0x2ee0c6,_0x3c3eea,_0xebd7)[_0x71f8('0x2d')](function(){_0x1407ab=path[_0x71f8('0x3f')](__dirname,_0x71f8('0x28'),rs[_0x71f8('0x29')](0x4)+_0x71f8('0x2a'));return convertFile(_0xebd7,_0x1407ab);})[_0x71f8('0x2d')](function(){try{fs[_0x71f8('0x1d')](_0xebd7);fs['chmodSync'](_0x1407ab,_0x71f8('0x2f'));}catch(_0x55051b){logger[_0x71f8('0x1c')](_0x55051b);}return _0x1407ab[_0x71f8('0x30')]('.')[0x0];});};exports[_0x71f8('0x7c')]=function(_0x5a5ba9,_0x1ce95a,_0x5048b6,_0x30839b,_0x318a16,_0x42b720){return aws[_0x71f8('0x7d')](_0x5a5ba9,_0x1ce95a,_0x5048b6,_0x30839b,_0x318a16,_0x42b720)[_0x71f8('0x2d')](function(_0x3d2bb0){logger[_0x71f8('0x1a')](JSON[_0x71f8('0x44')](_0x3d2bb0));return _0x3d2bb0;});};exports[_0x71f8('0x7e')]=function(_0x5b8578,_0x2e7ad6,_0x3713cd,_0x45922f){var _0x46de3c=util['format'](_0x71f8('0x7f'),ISPEECH_API,_0x5b8578,encodeURIComponent(_0x2e7ad6),_0x3713cd,_0x45922f);var _0x3e0674=path[_0x71f8('0x3f')](__dirname,'tmp',rs[_0x71f8('0x29')](0x4)+_0x71f8('0x4c'));var _0x249c57;return downloadFile(_0x46de3c,_0x3e0674)['then'](function(){_0x249c57=path['resolve'](__dirname,_0x71f8('0x28'),rs[_0x71f8('0x29')](0x4)+'.wav');return convertFile(_0x3e0674,_0x249c57);})[_0x71f8('0x2d')](function(){try{fs[_0x71f8('0x1d')](_0x3e0674);fs[_0x71f8('0x2e')](_0x249c57,_0x71f8('0x2f'));}catch(_0x342800){logger[_0x71f8('0x1c')](_0x342800);}return _0x249c57[_0x71f8('0x30')]('.')[0x0];});};exports['ispeechASR']=function(_0x481d75,_0x545a3b,_0x48d14a,_0x2d3444){var _0x4efea2=util['format'](_0x71f8('0x80'),ISPEECH_API,_0x545a3b,_0x48d14a,base64Encode(_0x481d75),_0x2d3444?util[_0x71f8('0x81')]('model=%s',encodeURIComponent(_0x2d3444)):_0x71f8('0x82'));return uploadFile(_0x4efea2)['then'](function(_0x52ee36){return querystring['parse'](_0x52ee36);});};exports[_0x71f8('0x83')]=function(_0x61aa73,_0x12b2f7){return sestek[_0x71f8('0x84')](_0x61aa73,_0x12b2f7)[_0x71f8('0x2d')](function(_0x173fae){logger['info'](JSON['stringify'](_0x173fae));var _0x54236a={'speech':_0x173fae[_0x71f8('0x85')],'action':_0x173fae[_0x71f8('0x86')]?_0x173fae['channelData']['CustomAction']:undefined,'actiondata':_0x173fae[_0x71f8('0x86')]?_0x173fae[_0x71f8('0x86')][_0x71f8('0x87')]:undefined};if(_0x173fae['channelData']&&_0x173fae[_0x71f8('0x86')][_0x71f8('0x88')]){return base64Decode(_0x173fae['channelData']['AudioFromTts'][_0x71f8('0x89')],path[_0x71f8('0x3f')](__dirname,_0x71f8('0x28'),rs['generate'](0x4)+_0x71f8('0x2a')))[_0x71f8('0x2d')](function(_0x2f1de5){_0x54236a[_0x71f8('0x8a')]=_0x2f1de5;return _0x54236a;});}return _0x54236a;});};exports[_0x71f8('0x8b')]=function(){return __dirname;};
\ No newline at end of file
+var _0x669d=['base64','then','unlink','readFileSync','toString','googleCloudTTS','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','chmodSync','777','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','resolve','.mp3','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','languageCode','queryText','responseId','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','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','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','path','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','download\x20error','pipe','end','host','WHAT_EVER','request\x20to\x20','transcode','wav','error\x20convert','start','tmp','generate','.wav'];(function(_0x311963,_0x478eaa){var _0x278a8e=function(_0xd375c9){while(--_0xd375c9){_0x311963['push'](_0x311963['shift']());}};_0x278a8e(++_0x478eaa);}(_0x669d,0x168));var _0xd669=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x669d[_0x502c7d];return _0x30b7ed;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd669('0x0'));var dialogflow=require(_0xd669('0x1'));var fs=require('fs');var http=require(_0xd669('0x2'));var https=require(_0xd669('0x3'));var md5=require('md5');var path=require(_0xd669('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require('sox');var tts=require(_0xd669('0x5'));var urlParse=require(_0xd669('0x6'))['parse'];var util=require(_0xd669('0x7'));var aws=require(_0xd669('0x8'));var google=require(_0xd669('0x9'));var sestek=require(_0xd669('0xa'));var tilde=require(_0xd669('0xb'));var logger=require(_0xd669('0xc'))(_0xd669('0xd'));var ISPEECH_API=_0xd669('0xe');function downloadFile(_0x516f29,_0x45d706){return new BPromise(function(_0x58e242,_0x25edee){var _0x254796=urlParse(_0x516f29);var _0x426676=_0x254796[_0xd669('0xf')]===_0xd669('0x10')?https:http;var _0x1465e7={'host':_0x254796['host'],'path':_0x254796[_0xd669('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x426676[_0xd669('0x11')](_0x1465e7,function(_0x6f7023){if(_0x6f7023[_0xd669('0x12')]!==0xc8){logger[_0xd669('0x13')]('request\x20to\x20'+_0x516f29+_0xd669('0x14')+_0x6f7023[_0xd669('0x12')]+'\x20('+_0x6f7023[_0xd669('0x15')]+')');_0x25edee(new Error('request\x20to\x20'+_0x516f29+_0xd669('0x14')+_0x6f7023[_0xd669('0x12')]+'\x20('+_0x6f7023[_0xd669('0x15')]+')'));return;}var _0x472655=fs[_0xd669('0x16')](_0x45d706);_0x472655['on'](_0xd669('0x17'),function(){logger[_0xd669('0x18')]('finish\x20download\x20file');_0x472655[_0xd669('0x19')](_0x58e242);});_0x472655['on'](_0xd669('0x13'),function(_0x550cee){fs['unlink'](_0x45d706);logger[_0xd669('0x13')](_0xd669('0x1a'),_0x550cee);_0x25edee(_0x550cee);});_0x6f7023[_0xd669('0x1b')](_0x472655);})['on'](_0xd669('0x13'),function(_0x51fb04){logger[_0xd669('0x13')](_0x51fb04);_0x25edee(_0x51fb04);})[_0xd669('0x1c')]();});}function uploadFile(_0x2914a6){return new BPromise(function(_0x1983d,_0xc0fef8){var _0xbc34e2=urlParse(_0x2914a6);var _0x5baf19=_0xbc34e2[_0xd669('0xf')]===_0xd669('0x10')?https:http;var _0x3a0686={'host':_0xbc34e2[_0xd669('0x1d')],'path':_0xbc34e2[_0xd669('0x4')],'headers':{'user-agent':_0xd669('0x1e')}};_0x5baf19[_0xd669('0x11')](_0x3a0686,function(_0x3edcad){if(_0x3edcad['statusCode']!==0xc8){_0xc0fef8(new Error(_0xd669('0x1f')+_0x2914a6+_0xd669('0x14')+_0x3edcad['statusCode']+'\x20('+_0x3edcad[_0xd669('0x15')]+')'));return;}var _0xa752c1='';_0x3edcad['on']('data',function(_0x465b07){_0xa752c1+=_0x465b07;});_0x3edcad['on'](_0xd669('0x1c'),function(){_0x1983d(_0xa752c1);});})['on'](_0xd669('0x13'),function(_0x180faf){_0xc0fef8(_0x180faf);})[_0xd669('0x1c')]();});}function convertFile(_0x4919fd,_0x52bc45){return new BPromise(function(_0x5162ab,_0x2a22f7){var _0x24fb64=sox[_0xd669('0x20')](_0x4919fd,_0x52bc45,{'sampleRate':0x1f40,'format':_0xd669('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x24fb64['on'](_0xd669('0x13'),function(_0x2b1b89){logger['error'](_0xd669('0x22'),_0x2b1b89);_0x2a22f7(_0x2b1b89);});_0x24fb64['on'](_0xd669('0x1c'),function(){logger[_0xd669('0x18')]('finish\x20to\x20convert');_0x5162ab();});_0x24fb64[_0xd669('0x23')]();});}function base64Decode(_0x343842,_0x14b164){var _0x144c5f=path['resolve'](__dirname,_0xd669('0x24'),rs[_0xd669('0x25')](0x4)+_0xd669('0x26'));fs['writeFileSync'](_0x144c5f,_0x343842,_0xd669('0x27'));return convertFile(_0x144c5f,_0x14b164)[_0xd669('0x28')](function(){try{fs[_0xd669('0x29')](_0x144c5f);fs['chmodSync'](_0x14b164,'777');}catch(_0x4cb250){logger[_0xd669('0x13')](_0x4cb250);}return _0x14b164['split']('.')[0x0];});}function base64Encode(_0x2e0478){var _0x2c0580=fs[_0xd669('0x2a')](_0x2e0478);return new Buffer(_0x2c0580)[_0xd669('0x2b')]('base64');}exports[_0xd669('0x2c')]=function(_0x3c8bbf,_0x279c44,_0x443c48,_0x34888d,_0x5b4195,_0x1f0a67){var _0x1d3624,_0x9fca62;var _0x5e4380='https://texttospeech.googleapis.com/v1/';var _0x4c073c='?key='+_0x3c8bbf;var _0x4bcb00={};if(_0x279c44==='ssml'){_0x4bcb00['input']={'ssml':_0x443c48};}else{_0x4bcb00['input']={'text':_0x443c48};};_0x4bcb00[_0xd669('0x2d')]={'languageCode':_0x34888d,'ssmlGender':_0x5b4195};_0x4bcb00[_0xd669('0x2e')]={'audioEncoding':_0xd669('0x2f'),'sampleRateHertz':0x1f40};var _0x9d496e={'url':_0x5e4380+_0xd669('0x30')+_0x4c073c,'method':_0xd669('0x31'),'json':!![],'body':_0x4bcb00};return rp(_0x9d496e)['then'](function(_0x263e9e){return new BPromise(function(_0x42234f,_0x21dbb5){_0x1d3624=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x5f4a0f=Buffer[_0xd669('0x32')](_0x263e9e[_0xd669('0x33')],_0xd669('0x27'));return fs['writeFile'](_0x1d3624,_0x5f4a0f,function(_0xca29b1){_0x21dbb5(_0xca29b1);},function(_0x3ad94f){fs['chmodSync'](_0x1d3624,'777');_0x42234f(_0x3ad94f);});});})[_0xd669('0x28')](function(_0x2d36f3){_0x9fca62=path['resolve'](__dirname,_0xd669('0x24'),rs[_0xd669('0x25')](0x4)+_0xd669('0x26'));return convertFile(_0x1d3624,_0x9fca62);})['then'](function(){try{fs['unlink'](_0x1d3624);fs[_0xd669('0x34')](_0x9fca62,_0xd669('0x35'));}catch(_0x29efd7){logger[_0xd669('0x13')](_0x29efd7);}logger[_0xd669('0x18')](_0xd669('0x36'),_0x9fca62[_0xd669('0x37')]('.')[0x0]);return _0x9fca62['split']('.')[0x0];});};exports['googleTTS']=function(_0x1a916b,_0x40652e){var _0x53b4cd=_0xd669('0x38');var _0x41be36,_0x44edbc;var _0x4e0360;var _0x5b93e9={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x53b4cd,'headers':{'Content-Type':_0xd669('0x39')},'body':'f.req='+encodeURIComponent(JSON[_0xd669('0x3a')]([[[_0xd669('0x3b'),JSON['stringify']([_0x1a916b,_0x40652e||'en',![],'null']),null,_0xd669('0x3c')]]]))};return rp(_0x5b93e9)[_0xd669('0x28')](function(_0x466b56){try{_0x4e0360=eval(_0x466b56[_0xd669('0x3d')](0x5))[0x0][0x2];}catch(_0x1228a9){throw new Error(_0xd669('0x3e')+_0x466b56[_0xd669('0x3f')]);}if(!_0x4e0360){if(_0x1a916b[_0xd669('0x40')]>0xc8){throw new Error(_0xd669('0x41'));}else{throw new Error('lang\x20\x22'+_0x40652e+'\x22\x20might\x20not\x20exist');}}try{_0x4e0360=eval(_0x4e0360)[0x0];}catch(_0x21f9e1){throw new Error(_0xd669('0x3e')+res[_0xd669('0x3f')]);}const _0x19fd58=_0x4e0360;_0x41be36=path[_0xd669('0x42')](__dirname,_0xd669('0x24'),rs[_0xd669('0x25')](0x4)+_0xd669('0x43'));fs[_0xd669('0x44')](_0x41be36,_0x4e0360,{'encoding':_0xd669('0x27')});_0x44edbc=path[_0xd669('0x42')](__dirname,_0xd669('0x24'),rs[_0xd669('0x25')](0x4)+_0xd669('0x26'));return convertFile(_0x41be36,_0x44edbc);})[_0xd669('0x28')](function(){try{fs['unlink'](_0x41be36);fs[_0xd669('0x34')](_0x44edbc,_0xd669('0x35'));}catch(_0x1b8ddd){logger[_0xd669('0x13')](_0x1b8ddd);}logger['info'](_0xd669('0x45'),_0x44edbc[_0xd669('0x37')]('.')[0x0]);return _0x44edbc[_0xd669('0x37')]('.')[0x0];});};exports[_0xd669('0x46')]=function(_0x27e026,_0x329da4,_0x2af1cc){return google['asr'](_0x27e026,_0x329da4,_0x2af1cc)[_0xd669('0x28')](function(_0x141fcd){logger[_0xd669('0x18')](_0x141fcd[_0xd669('0x47')]);return rp(_0x141fcd);})[_0xd669('0x28')](function(_0x411fd2){var _0x1c690b='';var _0x5696df=0x0;try{fs[_0xd669('0x29')](_0x27e026);}catch(_0x479c32){logger['error'](_0x479c32);}if(_0x411fd2&&_0x411fd2[_0xd669('0x48')]){_0x1c690b=_0x411fd2['results'][_0xd669('0x49')](function(_0x26a537){return _0x26a537&&_0x26a537[_0xd669('0x4a')][0x0]&&_0x26a537[_0xd669('0x4a')][0x0][_0xd669('0x4b')]?_0x26a537['alternatives'][0x0][_0xd669('0x4b')]:'';})[_0xd669('0x4c')]('\x0a');_0x5696df=_0x411fd2[_0xd669('0x48')][_0xd669('0x49')](function(_0x4b20a4){return _0x4b20a4&&_0x4b20a4['alternatives'][0x0]&&_0x4b20a4['alternatives'][0x0][_0xd669('0x4d')]?_0x4b20a4['alternatives'][0x0][_0xd669('0x4d')]:0x0;})['join']('\x0a');}logger['info'](_0xd669('0x4e'),_0x1c690b);logger[_0xd669('0x18')](_0xd669('0x4f'),_0x5696df);return{'transcript':_0x1c690b,'confidence':_0x5696df};})[_0xd669('0x50')](function(_0x272c5d){logger['error']('[%s]\x20%s:%s',_0x272c5d['statusCode'],_0x272c5d[_0xd669('0x51')],_0x272c5d['message']);});};exports[_0xd669('0x52')]=function(_0x4beadb,_0x43ccc2,_0x15808a,_0x4d1412){var _0xd8a90b=apiai(_0x43ccc2,{'language':_0x4d1412||'en'});return _0xd8a90b[_0xd669('0x53')](_0x15808a,{'sessionId':md5(_0x4beadb)})[_0xd669('0x28')](function(_0x218497){logger['info'](JSON[_0xd669('0x3a')](_0x218497));return{'source':_0x218497[_0xd669('0x54')]['source'],'resolvedQuery':_0x218497[_0xd669('0x54')][_0xd669('0x55')],'action':_0x218497[_0xd669('0x54')][_0xd669('0x56')],'actionIncomplete':_0x218497[_0xd669('0x54')][_0xd669('0x57')],'speech':_0x218497[_0xd669('0x54')][_0xd669('0x58')][_0xd669('0x59')],'score':_0x218497[_0xd669('0x54')]['score'],'statusCode':_0x218497[_0xd669('0x5a')]['code'],'endConversation':_0x218497[_0xd669('0x54')]['metadata'][_0xd669('0x5b')]||![],'isFallbackIntent':_0x218497[_0xd669('0x54')][_0xd669('0x5c')][_0xd669('0x5d')]};});};exports[_0xd669('0x5e')]=function(_0x1608a7,_0x587ea4,_0xc576b8,_0x2a1a62,_0x550bd9,_0x56622f){var _0x2b5949=_0x2a1a62[_0xd669('0x5f')](/\\n/g,'\x0a');var _0x4c3e34={'credentials':{'private_key':_0x2b5949,'client_email':_0xc576b8}};var _0x422f1a=new dialogflow['SessionsClient'](_0x4c3e34);var _0x1fd5f5=_0x422f1a[_0xd669('0x60')](_0x587ea4,md5(_0x1608a7));var _0x4000ba={'session':_0x1fd5f5,'queryInput':{'text':{'text':_0x550bd9,'languageCode':_0x56622f}}};return _0x422f1a[_0xd669('0x61')](_0x4000ba)[_0xd669('0x28')](function(_0x58f24d){if(_0x58f24d&&_0x58f24d[_0xd669('0x40')]){logger['info'](_0xd669('0x62'),JSON['stringify'](_0x58f24d));var _0x57acb1=_0x58f24d[0x0];if(_0x57acb1){var _0x28b571={'action':_0x57acb1[_0xd669('0x63')][_0xd669('0x56')],'allRequiredParamsPresent':_0x57acb1[_0xd669('0x63')][_0xd669('0x64')],'endConversation':_0x57acb1[_0xd669('0x63')][_0xd669('0x65')]&&_0x57acb1[_0xd669('0x63')][_0xd669('0x65')][_0xd669('0x66')]?_0x57acb1[_0xd669('0x63')][_0xd669('0x65')][_0xd669('0x66')][_0xd669('0x67')][_0xd669('0x68')]:![],'fulfillmentText':_0x57acb1['queryResult']['fulfillmentText'],'intentName':_0x57acb1[_0xd669('0x63')][_0xd669('0x69')][_0xd669('0x51')],'intentDisplayName':_0x57acb1['queryResult'][_0xd669('0x69')][_0xd669('0x6a')],'isFallbackIntent':_0x57acb1[_0xd669('0x63')][_0xd669('0x69')]['isFallback'],'languageCode':_0x57acb1[_0xd669('0x63')][_0xd669('0x6b')],'queryText':_0x57acb1['queryResult'][_0xd669('0x6c')],'responseId':_0x57acb1[_0xd669('0x6d')],'score':_0x57acb1['queryResult']['intentDetectionConfidence'],'speech':_0x57acb1[_0xd669('0x63')][_0xd669('0x6e')],'providerResponse':JSON['stringify'](_0x58f24d)};return _0x28b571;}}});};exports['tildeASR']=function(_0x5341cf,_0x60dea7,_0x8731c3,_0x5e25cd){return tilde['asr'](_0x5341cf,_0x60dea7,_0x8731c3,_0x5e25cd)['then'](function(_0x4c3b06){try{fs[_0xd669('0x29')](_0x5341cf);}catch(_0x30cad0){logger[_0xd669('0x13')](_0x30cad0);}logger[_0xd669('0x18')](_0xd669('0x6f'),_0x4c3b06[_0xd669('0x4b')]);logger[_0xd669('0x18')](_0xd669('0x70'),_0x4c3b06[_0xd669('0x4d')]);return _0x4c3b06;});};exports[_0xd669('0x71')]=function(_0x20e6ba,_0x5ce839,_0x6e28c0,_0xb8f70b,_0x2421db,_0x14bc19){var _0xddcc89=path[_0xd669('0x42')](__dirname,'tmp',rs[_0xd669('0x25')](0x4)+_0xd669('0x43'));var _0x21ae11;return aws[_0xd669('0x72')](_0x20e6ba,_0x5ce839,_0x6e28c0,_0xb8f70b,_0x2421db,_0x14bc19,_0xddcc89)[_0xd669('0x28')](function(){_0x21ae11=path['resolve'](__dirname,'tmp',rs[_0xd669('0x25')](0x4)+'.wav');return convertFile(_0xddcc89,_0x21ae11);})[_0xd669('0x28')](function(){try{fs[_0xd669('0x29')](_0xddcc89);fs[_0xd669('0x34')](_0x21ae11,_0xd669('0x35'));}catch(_0x320b31){logger[_0xd669('0x13')](_0x320b31);}return _0x21ae11[_0xd669('0x37')]('.')[0x0];});};exports[_0xd669('0x73')]=function(_0x48b984,_0x165b14,_0x8e9000,_0xcc5b7f,_0x4d2f4f,_0xdfe9f8){return aws[_0xd669('0x74')](_0x48b984,_0x165b14,_0x8e9000,_0xcc5b7f,_0x4d2f4f,_0xdfe9f8)[_0xd669('0x28')](function(_0x584327){logger['info'](JSON[_0xd669('0x3a')](_0x584327));return _0x584327;});};exports['ispeechTTS']=function(_0x4bada4,_0x3fe833,_0x374c66,_0x39971a){var _0x381125=util[_0xd669('0x75')](_0xd669('0x76'),ISPEECH_API,_0x4bada4,encodeURIComponent(_0x3fe833),_0x374c66,_0x39971a);var _0x1422d0=path[_0xd669('0x42')](__dirname,_0xd669('0x24'),rs[_0xd669('0x25')](0x4)+_0xd669('0x43'));var _0x62d902;return downloadFile(_0x381125,_0x1422d0)[_0xd669('0x28')](function(){_0x62d902=path[_0xd669('0x42')](__dirname,_0xd669('0x24'),rs['generate'](0x4)+_0xd669('0x26'));return convertFile(_0x1422d0,_0x62d902);})[_0xd669('0x28')](function(){try{fs['unlink'](_0x1422d0);fs[_0xd669('0x34')](_0x62d902,'777');}catch(_0x4a80eb){logger[_0xd669('0x13')](_0x4a80eb);}return _0x62d902[_0xd669('0x37')]('.')[0x0];});};exports[_0xd669('0x77')]=function(_0x363589,_0x1dd818,_0x3116e9,_0x4e5247){var _0x71dc63=util['format'](_0xd669('0x78'),ISPEECH_API,_0x1dd818,_0x3116e9,base64Encode(_0x363589),_0x4e5247?util['format']('model=%s',encodeURIComponent(_0x4e5247)):_0xd669('0x79'));return uploadFile(_0x71dc63)[_0xd669('0x28')](function(_0x5ed0aa){return querystring[_0xd669('0x7a')](_0x5ed0aa);});};exports[_0xd669('0x7b')]=function(_0x38520f,_0x1425f3){return sestek[_0xd669('0x7c')](_0x38520f,_0x1425f3)[_0xd669('0x28')](function(_0x58c145){logger['info'](JSON[_0xd669('0x3a')](_0x58c145));var _0x20a54b={'speech':_0x58c145[_0xd669('0x7d')],'action':_0x58c145[_0xd669('0x7e')]?_0x58c145[_0xd669('0x7e')][_0xd669('0x7f')]:undefined,'actiondata':_0x58c145['channelData']?_0x58c145[_0xd669('0x7e')][_0xd669('0x80')]:undefined};if(_0x58c145[_0xd669('0x7e')]&&_0x58c145[_0xd669('0x7e')][_0xd669('0x81')]){return base64Decode(_0x58c145[_0xd669('0x7e')][_0xd669('0x81')][_0xd669('0x82')],path[_0xd669('0x42')](__dirname,_0xd669('0x24'),rs[_0xd669('0x25')](0x4)+'.wav'))[_0xd669('0x28')](function(_0x17b818){_0x20a54b[_0xd669('0x83')]=_0x17b818;return _0x20a54b;});}return _0x20a54b;});};exports[_0xd669('0x84')]=function(){return __dirname;};
\ No newline at end of file
index 8f34e03..079ff03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var nda=require('./nda');module['exports']={'nda':nda};
\ No newline at end of file
+var _0x1162=['./nda'];(function(_0x3af80c,_0x38f0e5){var _0x1603a9=function(_0x27f786){while(--_0x27f786){_0x3af80c['push'](_0x3af80c['shift']());}};_0x1603a9(++_0x38f0e5);}(_0x1162,0x161));var _0x2116=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1162[_0x2d7f0e];return _0x110b07;};var nda=require(_0x2116('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index 128931e..c7500e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e5=['calleridname','extension','Bearer\x20','access_token','project','body','channelData','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','agi','exports','resolve','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid'];(function(_0x175f46,_0x94c9a2){var _0x2c1c5d=function(_0x356e6e){while(--_0x356e6e){_0x175f46['push'](_0x175f46['shift']());}};_0x2c1c5d(++_0x94c9a2);}(_0x98e5,0x8a));var _0x598e=function(_0x1182ae,_0x4b1516){_0x1182ae=_0x1182ae-0x0;var _0x24047a=_0x98e5[_0x1182ae];return _0x24047a;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require('../../../../../config/logger')(_0x598e('0x0'));module[_0x598e('0x1')]=function(_0x5207d0,_0x196f8a){var _0xc090ec={'method':'POST','uri':url[_0x598e('0x2')](_0x196f8a['ndauth_url'],'/token'),'form':{'grant_type':_0x598e('0x3'),'username':_0x196f8a['username'],'password':_0x196f8a[_0x598e('0x3')]},'json':!![]};return rp(_0xc090ec)[_0x598e('0x4')](function(_0x10bf8e){var _0x3e0212={'method':_0x598e('0x5'),'uri':url[_0x598e('0x2')](_0x196f8a[_0x598e('0x6')],_0x598e('0x7')),'body':{'type':_0x196f8a[_0x598e('0x8')]||_0x598e('0x9'),'channelId':_0x598e('0xa'),'conversation':{'id':_0x5207d0['uniqueid']},'from':{'id':_0x5207d0[_0x598e('0xb')],'name':_0x5207d0[_0x598e('0xc')]},'recipient':{'id':_0x5207d0['dnid'],'name':_0x5207d0[_0x598e('0xd')]},'text':_0x196f8a['text'],'channelData':{}},'headers':{'Authorization':_0x598e('0xe')+_0x10bf8e[_0x598e('0xf')]},'json':!![]};if(_0x196f8a[_0x598e('0x10')]){_0x3e0212[_0x598e('0x11')][_0x598e('0x12')]['ProjectName']=_0x196f8a[_0x598e('0x10')];}if(_0x196f8a['ndagenerate_audio']=='1'){_0x3e0212[_0x598e('0x11')][_0x598e('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x598e('0x13')};}if(_0x196f8a[_0x598e('0x14')]){_0x3e0212[_0x598e('0x11')][_0x598e('0x12')][_0x598e('0x15')]=_0x196f8a[_0x598e('0x14')];if(_0x196f8a[_0x598e('0x16')]){_0x3e0212['body'][_0x598e('0x12')][_0x598e('0x17')]=_0x196f8a[_0x598e('0x16')];}}logger[_0x598e('0x18')](JSON['stringify'](_0x3e0212));return rp(_0x3e0212);});};
\ No newline at end of file
+var _0xe739=['request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','calleridname','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','info'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xe739,0x105));var _0x9e73=function(_0x6a8dbb,_0x2bf2fc){_0x6a8dbb=_0x6a8dbb-0x0;var _0x4cb380=_0xe739[_0x6a8dbb];return _0x4cb380;};'use strict';var rp=require(_0x9e73('0x0'));var url=require('url');var logger=require(_0x9e73('0x1'))(_0x9e73('0x2'));module[_0x9e73('0x3')]=function(_0x508042,_0x54a986){var _0x594f94={'method':_0x9e73('0x4'),'uri':url[_0x9e73('0x5')](_0x54a986[_0x9e73('0x6')],_0x9e73('0x7')),'form':{'grant_type':'password','username':_0x54a986[_0x9e73('0x8')],'password':_0x54a986[_0x9e73('0x9')]},'json':!![]};return rp(_0x594f94)[_0x9e73('0xa')](function(_0x5e46e7){var _0xa49f86={'method':_0x9e73('0x4'),'uri':url[_0x9e73('0x5')](_0x54a986[_0x9e73('0xb')],_0x9e73('0xc')),'body':{'type':_0x54a986[_0x9e73('0xd')]||'message','channelId':_0x9e73('0xe'),'conversation':{'id':_0x508042['uniqueid']},'from':{'id':_0x508042['callerid'],'name':_0x508042[_0x9e73('0xf')]},'recipient':{'id':_0x508042['dnid'],'name':_0x508042[_0x9e73('0x10')]},'text':_0x54a986[_0x9e73('0x11')],'channelData':{}},'headers':{'Authorization':_0x9e73('0x12')+_0x5e46e7['access_token']},'json':!![]};if(_0x54a986[_0x9e73('0x13')]){_0xa49f86[_0x9e73('0x14')][_0x9e73('0x15')][_0x9e73('0x16')]=_0x54a986['project'];}if(_0x54a986[_0x9e73('0x17')]=='1'){_0xa49f86[_0x9e73('0x14')][_0x9e73('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9e73('0x18')};}if(_0x54a986[_0x9e73('0x19')]){_0xa49f86['body'][_0x9e73('0x15')][_0x9e73('0x1a')]=_0x54a986[_0x9e73('0x19')];if(_0x54a986['custom_action_data']){_0xa49f86[_0x9e73('0x14')]['channelData'][_0x9e73('0x1b')]=_0x54a986['custom_action_data'];}}logger[_0x9e73('0x1c')](JSON['stringify'](_0xa49f86));return rp(_0xa49f86);});};
\ No newline at end of file
index 0a82459..495961d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71b0=['./lib/api','exports'];(function(_0x1c591c,_0x358f3f){var _0xd6846c=function(_0x2c0695){while(--_0x2c0695){_0x1c591c['push'](_0x1c591c['shift']());}};_0xd6846c(++_0x358f3f);}(_0x71b0,0x1ba));var _0x071b=function(_0x3baaa5,_0x3bfa64){_0x3baaa5=_0x3baaa5-0x0;var _0x33ac3d=_0x71b0[_0x3baaa5];return _0x33ac3d;};'use strict';var asr=require(_0x071b('0x0'));module[_0x071b('0x1')]=function(_0x3fe39e,_0x562627,_0x5c13a8,_0x54fd1d){return asr(_0x3fe39e,_0x562627,_0x5c13a8,_0x54fd1d);};
\ No newline at end of file
+var _0x59d2=['exports'];(function(_0x26c3b3,_0x4f7c64){var _0x4cc66e=function(_0x336a13){while(--_0x336a13){_0x26c3b3['push'](_0x26c3b3['shift']());}};_0x4cc66e(++_0x4f7c64);}(_0x59d2,0x1f0));var _0x259d=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x59d2[_0x4ae625];return _0x31accf;};'use strict';var asr=require('./lib/api');module[_0x259d('0x0')]=function(_0x21661a,_0x3cd1cb,_0x2d7ad5,_0x5bcb79){return asr(_0x21661a,_0x3cd1cb,_0x2d7ad5,_0x5bcb79);};
\ No newline at end of file
index 60a887b..819b037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f57=['status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','stringify','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','crypto','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x3f57,0x1b3));var _0x73f5=function(_0x5743f3,_0x5bfa13){_0x5743f3=_0x5743f3-0x0;var _0x323f74=_0x3f57[_0x5743f3];return _0x323f74;};'use strict';var BPromise=require(_0x73f5('0x0'));var _=require(_0x73f5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x73f5('0x2'));var logger=require('../../../../../../config/logger')(_0x73f5('0x3'));module[_0x73f5('0x4')]=function(_0x4ccff8,_0x144b6a,_0x1f478b,_0x26e6c7){return new BPromise(function(_0xe46c67,_0x21064e){logger['info']('Tilde\x20URI',_0x26e6c7||_0x73f5('0x5'));var _0x288d74=new WebSocket(_0x26e6c7||_0x73f5('0x5'),{'perMessageDeflate':![]});var _0x54fa14='';var _0x1af546='0';var _0x64d9b4='1';var _0xa8f118=_0x73f5('0x6');function _0x407ef6(_0x2b4d36){var _0x2973ed=crypto[_0x73f5('0x7')](_0x73f5('0x8'));_0x2973ed[_0x73f5('0x9')](_0x2b4d36);return _0x2973ed[_0x73f5('0xa')](_0x73f5('0xb'));}function _0x2ac4b7(){try{logger[_0x73f5('0xc')](_0x73f5('0xd'));var _0x55e900=moment()['unix']();var _0x217c34=_0x407ef6(_0x55e900+_0x144b6a+_0x1f478b);_0x288d74[_0x73f5('0xe')](JSON['stringify']({'appID':_0x144b6a,'timestamp':_0x55e900,'appKey':_0x217c34}));var _0x4fd101=fs[_0x73f5('0xf')](_0x4ccff8);_0x4fd101['on']('data',function(_0x518555){_0x288d74[_0x73f5('0xe')](_0x518555);});_0x4fd101['on'](_0x73f5('0x10'),function(){_0x288d74[_0x73f5('0xe')](_0x73f5('0x11'));});}catch(_0x291b9f){logger['error'](_0x73f5('0x12'),JSON['stringify'](_0x291b9f));_0x288d74[_0x73f5('0x13')]();}}function _0x38406e(_0x389762){try{if(_0x389762){var _0x2d3f62=JSON[_0x73f5('0x14')](_0x389762);switch(_0x2d3f62[_0x73f5('0x15')]){case 0x0:if(_0x2d3f62['result']){if(_0x2d3f62[_0x73f5('0x16')][_0x73f5('0x17')]){logger[_0x73f5('0xc')](_0x73f5('0x18'),JSON['stringify'](_0x2d3f62[_0x73f5('0x16')][_0x73f5('0x19')]));_0x54fa14=_0x2d3f62[_0x73f5('0x16')]['hypotheses'][0x0]['transcript'];_0x1af546=_0x2d3f62[_0x73f5('0x16')][_0x73f5('0x19')][0x0][_0x73f5('0x1a')];_0x64d9b4='0';_0xa8f118=_0x73f5('0x1b');_0x288d74['terminate']();}}break;case 0x1:logger[_0x73f5('0xc')](_0x73f5('0x6'));_0x64d9b4='1';_0xa8f118='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x73f5('0xc')](_0x73f5('0x1c'));_0x64d9b4='2';_0xa8f118='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x73f5('0xc')](_0x73f5('0x1d'));_0x64d9b4='9';_0xa8f118='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x73f5('0xc')]('Authentication\x20failed.');_0x64d9b4='10';_0xa8f118='Authentication\x20failed.';break;case 0xb:logger[_0x73f5('0xc')](_0x73f5('0x1e'));_0x64d9b4='11';_0xa8f118=_0x73f5('0x1e');}}}catch(_0x484a75){logger[_0x73f5('0x1f')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x73f5('0x20')](_0x484a75));_0x288d74['terminate']();}}function _0x2014b0(){logger[_0x73f5('0xc')](_0x73f5('0x21'));_0xe46c67({'transcript':_0x54fa14,'confidence':_0x1af546,'status':_0x64d9b4,'status_message':_0xa8f118});}function _0x98775c(_0x1100cd){logger[_0x73f5('0x1f')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x73f5('0x22')](_0x1100cd)){logger['error'](_[_0x73f5('0x23')](_0x1100cd)?JSON[_0x73f5('0x20')](_0x1100cd):_0x1100cd);}}_0x288d74['on'](_0x73f5('0x24'),_0x2ac4b7);_0x288d74['on'](_0x73f5('0x25'),_0x38406e);_0x288d74['on'](_0x73f5('0x10'),_0x2014b0);_0x288d74['on']('error',_0x98775c);});};
\ No newline at end of file
+var _0xf0f6=['lodash','moment','crypto','agi','exports','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','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message'];(function(_0x3dfc53,_0x2813cb){var _0x34b8eb=function(_0x542c34){while(--_0x542c34){_0x3dfc53['push'](_0x3dfc53['shift']());}};_0x34b8eb(++_0x2813cb);}(_0xf0f6,0x186));var _0x6f0f=function(_0x363785,_0x36438e){_0x363785=_0x363785-0x0;var _0x414b63=_0xf0f6[_0x363785];return _0x414b63;};'use strict';var BPromise=require('bluebird');var _=require(_0x6f0f('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6f0f('0x1'));var crypto=require(_0x6f0f('0x2'));var logger=require('../../../../../../config/logger')(_0x6f0f('0x3'));module[_0x6f0f('0x4')]=function(_0x686ed5,_0x3cf431,_0x2fdce9,_0x48c5f6){return new BPromise(function(_0x17522f,_0x48de3e){logger['info'](_0x6f0f('0x5'),_0x48c5f6||_0x6f0f('0x6'));var _0x5262df=new WebSocket(_0x48c5f6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1cd91a='';var _0x29310c='0';var _0x393df5='1';var _0x338f26=_0x6f0f('0x7');function _0x2eb026(_0x4f1de1){var _0x2c5ae5=crypto[_0x6f0f('0x8')]('sha1');_0x2c5ae5['update'](_0x4f1de1);return _0x2c5ae5[_0x6f0f('0x9')]('hex');}function _0x1153c4(){try{logger[_0x6f0f('0xa')](_0x6f0f('0xb'));var _0x49e914=moment()[_0x6f0f('0xc')]();var _0x551ca7=_0x2eb026(_0x49e914+_0x3cf431+_0x2fdce9);_0x5262df[_0x6f0f('0xd')](JSON[_0x6f0f('0xe')]({'appID':_0x3cf431,'timestamp':_0x49e914,'appKey':_0x551ca7}));var _0x42a75b=fs[_0x6f0f('0xf')](_0x686ed5);_0x42a75b['on']('data',function(_0x1dc28d){_0x5262df[_0x6f0f('0xd')](_0x1dc28d);});_0x42a75b['on'](_0x6f0f('0x10'),function(){_0x5262df[_0x6f0f('0xd')]('EOS');});}catch(_0x3a7f87){logger['error'](_0x6f0f('0x11'),JSON[_0x6f0f('0xe')](_0x3a7f87));_0x5262df[_0x6f0f('0x12')]();}}function _0x2c2a1d(_0x2d5719){try{if(_0x2d5719){var _0x13b63b=JSON[_0x6f0f('0x13')](_0x2d5719);switch(_0x13b63b[_0x6f0f('0x14')]){case 0x0:if(_0x13b63b['result']){if(_0x13b63b[_0x6f0f('0x15')][_0x6f0f('0x16')]){logger[_0x6f0f('0xa')]('Tilde\x20ASR\x20hypoteses',JSON[_0x6f0f('0xe')](_0x13b63b[_0x6f0f('0x15')][_0x6f0f('0x17')]));_0x1cd91a=_0x13b63b['result'][_0x6f0f('0x17')][0x0][_0x6f0f('0x18')];_0x29310c=_0x13b63b[_0x6f0f('0x15')][_0x6f0f('0x17')][0x0][_0x6f0f('0x19')];_0x393df5='0';_0x338f26=_0x6f0f('0x1a');_0x5262df[_0x6f0f('0x12')]();}}break;case 0x1:logger[_0x6f0f('0xa')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x393df5='1';_0x338f26=_0x6f0f('0x7');break;case 0x2:logger[_0x6f0f('0xa')](_0x6f0f('0x1b'));_0x393df5='2';_0x338f26=_0x6f0f('0x1b');break;case 0x9:logger[_0x6f0f('0xa')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x393df5='9';_0x338f26=_0x6f0f('0x1c');break;case 0xa:logger[_0x6f0f('0xa')]('Authentication\x20failed.');_0x393df5='10';_0x338f26=_0x6f0f('0x1d');break;case 0xb:logger[_0x6f0f('0xa')](_0x6f0f('0x1e'));_0x393df5='11';_0x338f26=_0x6f0f('0x1e');}}}catch(_0x107340){logger[_0x6f0f('0x1f')](_0x6f0f('0x20'),JSON[_0x6f0f('0xe')](_0x107340));_0x5262df[_0x6f0f('0x12')]();}}function _0x3e28de(){logger[_0x6f0f('0xa')](_0x6f0f('0x21'));_0x17522f({'transcript':_0x1cd91a,'confidence':_0x29310c,'status':_0x393df5,'status_message':_0x338f26});}function _0x58c1d8(_0x141639){logger['error'](_0x6f0f('0x22'));if(!_[_0x6f0f('0x23')](_0x141639)){logger[_0x6f0f('0x1f')](_[_0x6f0f('0x24')](_0x141639)?JSON[_0x6f0f('0xe')](_0x141639):_0x141639);}}_0x5262df['on'](_0x6f0f('0x25'),_0x1153c4);_0x5262df['on'](_0x6f0f('0x26'),_0x2c2a1d);_0x5262df['on'](_0x6f0f('0x10'),_0x3e28de);_0x5262df['on']('error',_0x58c1d8);});};
\ No newline at end of file
index a29678e..970b393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f62=['exports'];(function(_0x5d6186,_0x4f97be){var _0x41c962=function(_0x5d12ca){while(--_0x5d12ca){_0x5d6186['push'](_0x5d6186['shift']());}};_0x41c962(++_0x4f97be);}(_0x6f62,0x188));var _0x26f6=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x6f62[_0xfbdff6];return _0x4cb9be;};var asr=require('./asr');module[_0x26f6('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x4984=['exports','./asr'];(function(_0x4f58a7,_0x13aec8){var _0x83e376=function(_0x139495){while(--_0x139495){_0x4f58a7['push'](_0x4f58a7['shift']());}};_0x83e376(++_0x13aec8);}(_0x4984,0xe3));var _0x4498=function(_0x277776,_0x3206b1){_0x277776=_0x277776-0x0;var _0x308ac2=_0x4984[_0x277776];return _0x308ac2;};var asr=require(_0x4498('0x0'));module[_0x4498('0x1')]={'asr':asr};
\ No newline at end of file
index 9b060b0..37b12c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);};
\ No newline at end of file
+var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x409682,_0x370090){var _0x1ee901=function(_0xe93c56){while(--_0xe93c56){_0x409682['push'](_0x409682['shift']());}};_0x1ee901(++_0x370090);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);};
\ No newline at end of file
index 1066dca..3b10270 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d7=['extension','priority','dnid','arg_1','file','createSquareMessage','createCmContact','callback_','random','lastName','isNil','phone','list_id','scheduledAt','toString','callback_priority','getPause','agentPause','agentUnpause','agentLogout','agent','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','headers','computedVariables','sync','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','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_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','length','%s.%s','setVariable','split','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','isConfigured','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','variable\x20%s\x20set','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','condition','true','false','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','isEmpty','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','recordingFormat','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','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','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','getVariable','name','catch','prototype','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','createSquareRecording','callerid','calleridname','context'];(function(_0x2e5dc4,_0x22c961){var _0xc77573=function(_0x48c80b){while(--_0x48c80b){_0x2e5dc4['push'](_0x2e5dc4['shift']());}};_0xc77573(++_0x22c961);}(_0x92d7,0x17b));var _0x792d=function(_0x3ca711,_0x1c6bdf){_0x3ca711=_0x3ca711-0x0;var _0x230a33=_0x92d7[_0x3ca711];return _0x230a33;};'use strict';var fs=require('fs');var util=require(_0x792d('0x0'));var _=require('lodash');var sh=require(_0x792d('0x1'));var odbc=require(_0x792d('0x2'))();var rs=require(_0x792d('0x3'));var moment=require(_0x792d('0x4'));var Mustache=require(_0x792d('0x5'));var rp=require(_0x792d('0x6'));var logger=require(_0x792d('0x7'))(_0x792d('0x8'));var config=require(_0x792d('0x9'));var shared=require(_0x792d('0xa'));var scripts=require('./scripts');var FILES_PATH=_0x792d('0xb');var recursiveMapAttributes=[_0x792d('0xc'),_0x792d('0xd')];var verticesWithRetry=[_0x792d('0xe'),'getdigits',_0x792d('0xf')];var AGIVertices=function(_0x3a0a49,_0x149bea,_0xe14801){this[_0x792d('0x10')]=_0x3a0a49;this[_0x792d('0x11')]=_0x149bea;this[_0x792d('0x12')]=_0xe14801;};AGIVertices['prototype'][_0x792d('0x13')]=function(_0x4fb7cb,_0x120779){this[_0x792d('0x11')]['getVariableById'](_0x4fb7cb)['then'](function(_0x121ab1){_0x120779(null,_0x121ab1?_0x121ab1[_0x792d('0x14')]:![]);})[_0x792d('0x15')](function(_0x551214){_0x120779(_0x551214);});};AGIVertices[_0x792d('0x16')][_0x792d('0x17')]=function(_0x276236,_0x2003c1){this[_0x792d('0x11')][_0x792d('0x18')](_0x276236)[_0x792d('0x19')](function(_0x2e32d3){_0x2003c1(null,_0x2e32d3?_0x2e32d3[_0x792d('0x14')]:![]);})[_0x792d('0x15')](function(_0x2d238f){_0x2003c1(_0x2d238f);});};AGIVertices[_0x792d('0x16')][_0x792d('0x1a')]=function(_0x2f15a9,_0x45b458){this['rpc'][_0x792d('0x1b')](_0x2f15a9)[_0x792d('0x19')](function(_0x451f0d){_0x45b458(null,_0x451f0d?_0x451f0d[_0x792d('0x14')]:![]);})['catch'](function(_0x78ed2c){_0x45b458(_0x78ed2c);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x5260e7,_0x5764de){this[_0x792d('0x11')][_0x792d('0x1c')](_0x5260e7)[_0x792d('0x19')](function(_0x14794c){_0x5764de(null,_0x14794c?_0x14794c['dsn']:![]);})['catch'](function(_0x12a5f1){_0x5764de(_0x12a5f1);});};AGIVertices[_0x792d('0x16')][_0x792d('0x1d')]=function(_0x3f1f84,_0x1f3708){this[_0x792d('0x11')][_0x792d('0x1e')](_0x3f1f84)[_0x792d('0x19')](function(_0x77a89f){_0x1f3708(null,_0x77a89f?_0x77a89f[_0x792d('0x14')]:![]);})[_0x792d('0x15')](function(_0x101a5c){_0x1f3708(_0x101a5c);});};AGIVertices[_0x792d('0x16')][_0x792d('0x1f')]=function(_0x7cd3fb,_0x390060){this['rpc'][_0x792d('0x20')](_0x7cd3fb)['then'](function(_0x2f3c49){_0x390060(null,_0x2f3c49?_0x2f3c49['name']:![]);})['catch'](function(_0x3c1d5a){_0x390060(_0x3c1d5a);});};AGIVertices['prototype'][_0x792d('0x21')]=function(_0x4e55df,_0x13f00b){var _0x1f6438=this;this[_0x792d('0x11')]['getSoundById'](_0x4e55df)[_0x792d('0x19')](function(_0x2783ab){_0x13f00b(null,_0x2783ab?_0x1f6438[_0x792d('0x22')](_0x2783ab[_0x792d('0x23')]):![]);})[_0x792d('0x15')](function(_0x36db8b){_0x13f00b(_0x36db8b);});};AGIVertices[_0x792d('0x16')]['getMailAccount']=function(_0x276a5d,_0xce423e){this[_0x792d('0x11')]['getMailAccountById'](_0x276a5d)[_0x792d('0x19')](function(_0x485463){_0xce423e(null,_0x485463?_0x485463:![]);})[_0x792d('0x15')](function(_0x143ae9){_0xce423e(_0x143ae9);});};AGIVertices[_0x792d('0x16')][_0x792d('0x24')]=function(_0xc2d3f4,_0x167a42,_0x44cd71){this['mailRpc']['sendMailMessage'](_0xc2d3f4,_0x167a42)[_0x792d('0x19')](function(){_0x44cd71(null);})[_0x792d('0x15')](function(_0x58928b){_0x44cd71(_0x58928b);});};AGIVertices[_0x792d('0x16')][_0x792d('0x25')]=function(_0x3055a0,_0x302536){this[_0x792d('0x11')][_0x792d('0x26')](_0x3055a0)[_0x792d('0x19')](function(_0x250388){if(_0x250388){if(_0x250388[_0x792d('0x27')]){_0x302536(null,[_0x250388[_0x792d('0x28')]]);}else{_0x302536(null,_[_0x792d('0x29')](_0x250388[_0x792d('0x2a')],_0x792d('0x28')));}}else{_0x302536(null,![]);}})[_0x792d('0x15')](function(_0x5915ef){_0x302536(_0x5915ef);});};AGIVertices[_0x792d('0x16')][_0x792d('0x22')]=function(_0x42b18e){return util[_0x792d('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0x42b18e);};AGIVertices[_0x792d('0x16')][_0x792d('0x2c')]=function(_0x46e860,_0xda8588,_0x4e6e7c){odbc[_0x792d('0x2d')](_0x46e860,function(_0x3393ef){if(_0x3393ef){logger[_0x792d('0x2e')](_0x792d('0x2f'),_0x3393ef);_0x4e6e7c(_0x3393ef);}else{logger['info'](_0x792d('0x30'));odbc[_0x792d('0x31')](_0xda8588,function(_0x12019e,_0x4f1288){if(_0x12019e){logger[_0x792d('0x32')]('Error\x20executing\x20query\x20%s',_0xda8588);_0x4e6e7c(_0x12019e);}else{logger[_0x792d('0x32')](_0x792d('0x33'),_0xda8588);odbc['close'](function(_0x77ed91){if(_0x77ed91){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x77ed91);}_0x4e6e7c(null,_0x4f1288);});}});}});};AGIVertices[_0x792d('0x16')][_0x792d('0x34')]=function(_0x48a951,_0x49d824){this[_0x792d('0x11')][_0x792d('0x35')](_0x48a951)[_0x792d('0x19')](function(_0x1ce4dc){_0x49d824(null,_0x1ce4dc?_0x1ce4dc:![]);})[_0x792d('0x15')](function(_0x5b0bf8){_0x49d824(_0x5b0bf8);});};AGIVertices[_0x792d('0x16')]['createSmsMessage']=function(_0x594b0e,_0x5f45ae){this[_0x792d('0x11')]['createSmsMessage'](_0x594b0e)[_0x792d('0x19')](function(_0x49296b){_0x5f45ae(null,_0x49296b);})['catch'](function(_0x2d9ae8){_0x5f45ae(_0x2d9ae8);});};AGIVertices[_0x792d('0x16')][_0x792d('0x36')]=function(_0x356c19,_0x2b2fb2,_0x1387c0){this[_0x792d('0x11')][_0x792d('0x36')]({'uniqueid':this[_0x792d('0x10')][_0x792d('0x37')],'node':_0x356c19[_0x792d('0x38')],'application':_0x356c19[_0x792d('0x39')],'data':_0x2b2fb2||null,'project_name':this[_0x792d('0x10')]['arg_1'],'callerid':this[_0x792d('0x10')]['callerid']})[_0x792d('0x19')](function(_0x1975ee){if(_0x1387c0){_0x1387c0(null,_0x1975ee);}})['catch'](function(_0x4b9fba){if(_0x1387c0){_0x1387c0(_0x4b9fba);}});};AGIVertices[_0x792d('0x16')]['createSquareRecording']=function(_0x8c156c,_0x49c7e7,_0x26392b,_0xdda41b){this[_0x792d('0x11')][_0x792d('0x3a')]({'uniqueid':this[_0x792d('0x10')]['uniqueid'],'callerid':this[_0x792d('0x10')][_0x792d('0x3b')],'calleridname':this[_0x792d('0x10')][_0x792d('0x3c')],'context':this[_0x792d('0x10')][_0x792d('0x3d')],'extension':this['channel'][_0x792d('0x3e')],'priority':this[_0x792d('0x10')][_0x792d('0x3f')],'accountcode':this['channel']['accountcode'],'dnid':this[_0x792d('0x10')][_0x792d('0x40')],'projectName':this[_0x792d('0x10')][_0x792d('0x41')],'saveName':_0x49c7e7,'filename':_0x8c156c[_0x792d('0x42')]||_0x49c7e7,'savePath':_0x26392b})[_0x792d('0x19')](function(_0xcab23c){_0xdda41b(null,_0xcab23c);})['catch'](function(_0x48e7b8){_0xdda41b(_0x48e7b8);});};AGIVertices[_0x792d('0x16')][_0x792d('0x43')]=function(_0x1a4682,_0x56f2ef,_0x1267b3,_0x33526d,_0x28b68c){this[_0x792d('0x11')]['createSquareMessage']({'uniqueid':this[_0x792d('0x10')]['uniqueid'],'body':_0x1a4682,'direction':_0x56f2ef,'providerName':_0x1267b3,'providerResponse':_0x33526d})[_0x792d('0x19')](function(_0x576069){if(_0x28b68c){_0x28b68c(null,_0x576069);}})[_0x792d('0x15')](function(_0x3487a1){if(_0x28b68c){_0x28b68c(_0x3487a1);}});};AGIVertices['prototype'][_0x792d('0x44')]=function(_0x5262f1,_0x1dd200){this['rpc'][_0x792d('0x44')]({'firstName':_['isEmpty'](_0x5262f1[_0x792d('0x14')])||_['isNil'](_0x5262f1[_0x792d('0x14')])?_0x792d('0x45')+Math[_0x792d('0x46')]():_0x5262f1[_0x792d('0x14')],'lastName':_['isEmpty'](_0x5262f1[_0x792d('0x47')])||_[_0x792d('0x48')](_0x5262f1['lastName'])?null:_0x5262f1['lastName'],'phone':_0x5262f1[_0x792d('0x49')],'ListId':_0x5262f1[_0x792d('0x4a')],'scheduledat':_0x5262f1[_0x792d('0x4b')],'callbackUniqueid':this[_0x792d('0x10')][_0x792d('0x37')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x5262f1['scheduledAt'][_0x792d('0x4c')](),'priority':_0x5262f1[_0x792d('0x4d')]})[_0x792d('0x19')](function(_0x37d434){_0x1dd200(null,_0x37d434);})[_0x792d('0x15')](function(_0x5c9d80){_0x1dd200(_0x5c9d80);});};AGIVertices['prototype'][_0x792d('0x4e')]=function(_0x3ec7aa,_0x337356){this[_0x792d('0x11')]['getPauseById'](_0x3ec7aa)['then'](function(_0x9481c){_0x337356(null,_0x9481c?_0x9481c[_0x792d('0x14')]:![]);})[_0x792d('0x15')](function(_0x8786e9){_0x337356(_0x8786e9);});};AGIVertices[_0x792d('0x16')][_0x792d('0x4f')]=function(_0x1f0ffd,_0x40936f,_0xdbc769){var _0x2ddc71={'role':'agent'};_0x2ddc71[_0x1f0ffd]=this[_0x792d('0x10')][_0x792d('0x3b')];this[_0x792d('0x11')][_0x792d('0x4f')](_0x2ddc71,_0x40936f,this['channel'][_0x792d('0x37')])[_0x792d('0x19')](function(_0x2294a8){_0xdbc769(null,_[_0x792d('0x48')](_0x2294a8)?![]:!![]);})[_0x792d('0x15')](function(_0x24e626){logger[_0x792d('0x2e')](_0x24e626);_0xdbc769(null,![]);});};AGIVertices[_0x792d('0x16')][_0x792d('0x50')]=function(_0x383827,_0x3ee721){var _0x328fe1={'role':'agent'};_0x328fe1[_0x383827]=this[_0x792d('0x10')][_0x792d('0x3b')];this['rpc'][_0x792d('0x50')](_0x328fe1)[_0x792d('0x19')](function(_0x4e378d){_0x3ee721(null,_[_0x792d('0x48')](_0x4e378d)?![]:!![]);})[_0x792d('0x15')](function(_0x41e932){logger[_0x792d('0x2e')](_0x41e932);_0x3ee721(null,![]);});};AGIVertices[_0x792d('0x16')][_0x792d('0x51')]=function(_0x2ae591,_0x3caca0){var _0x1a183c={'role':_0x792d('0x52')};_0x1a183c[_0x2ae591]=this[_0x792d('0x10')][_0x792d('0x3b')];this['rpc'][_0x792d('0x51')](_0x1a183c)[_0x792d('0x19')](function(_0x6999e3){_0x3caca0(null,_[_0x792d('0x48')](_0x6999e3)?![]:!![]);})[_0x792d('0x15')](function(_0x4e666e){logger['error'](_0x4e666e);_0x3caca0(null,![]);});};AGIVertices[_0x792d('0x16')]['agentLogin']=function(_0x3f6289,_0x178949){var _0x22c5b2={'role':_0x792d('0x52')};_0x22c5b2[_0x3f6289]=this['channel'][_0x792d('0x3b')];var _0x289b29=_0x3f6289!=_0x792d('0x53')?util[_0x792d('0x2b')](_0x792d('0x54'),'LOCAL',this[_0x792d('0x10')]['callerid']):undefined;this[_0x792d('0x11')][_0x792d('0x55')](_0x22c5b2,_0x289b29)['then'](function(_0x4bc042){_0x178949(null,_[_0x792d('0x48')](_0x4bc042)?![]:!![]);})[_0x792d('0x15')](function(_0x58d41f){logger[_0x792d('0x2e')](_0x58d41f);_0x178949(null,![]);});};AGIVertices[_0x792d('0x16')][_0x792d('0x56')]=function(_0x51278b,_0xd7015c){sh[_0x792d('0x57')](_[_0x792d('0x58')](_0x51278b),function(_0x1cac4a,_0xfe01ed){var _0x270a75=_0xfe01ed[_0x792d('0x59')](/(\r\n|\n|\r)/gm,'');_0xd7015c(null,_0x270a75);});};AGIVertices[_0x792d('0x16')]['googleCloudTTS']=function(_0x38be4a,_0xb3554d){scripts[_0x792d('0x5a')](_0x38be4a[_0x792d('0x5b')],_0x38be4a['google_cloud_tts_text_type']||'text',_0x38be4a[_0x792d('0x5c')],_0x38be4a['languageCode']||_0x792d('0x5d'),_0x38be4a[_0x792d('0x5e')]||_0x792d('0x5f'),_0x38be4a['audioEncoding']||_0x792d('0x60'))[_0x792d('0x19')](function(_0x18c448){_0xb3554d(null,_0x18c448);})[_0x792d('0x15')](function(_0x173ba2){_0xb3554d(_0x173ba2);});};AGIVertices[_0x792d('0x16')][_0x792d('0x61')]=function(_0x167ff4,_0x5dd4cc){scripts[_0x792d('0x61')](_0x167ff4[_0x792d('0x5c')],_0x167ff4[_0x792d('0x62')]||'en',0x1)['then'](function(_0x5b84f4){_0x5dd4cc(null,_0x5b84f4);})['catch'](function(_0x1d22b7){_0x5dd4cc(_0x1d22b7);});};AGIVertices[_0x792d('0x16')][_0x792d('0x63')]=function(_0x34a53e,_0x7c7cc4){var _0x3e27b8={'uri':_0x34a53e[_0x792d('0x64')],'method':_0x34a53e[_0x792d('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x34a53e[_0x792d('0x66')])==='number'&&parseInt(_0x34a53e[_0x792d('0x66')])>=0x1?parseInt(_0x34a53e[_0x792d('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x792d('0x67')]([_0x792d('0x68'),_0x792d('0x69')],_0x3e27b8[_0x792d('0x65')][_0x792d('0x6a')]())){try{_0x3e27b8[_0x792d('0x6b')]=_0x34a53e[_0x792d('0xd')]?JSON[_0x792d('0x6c')](_0x34a53e[_0x792d('0xd')]):{};}catch(_0x15d594){logger[_0x792d('0x2e')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x15d594);}}try{_0x3e27b8[_0x792d('0x6d')]=_0x34a53e[_0x792d('0xc')]?JSON[_0x792d('0x6c')](_0x34a53e[_0x792d('0xc')]):{};}catch(_0x232a6a){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x232a6a);}if(_0x34a53e['computedVariables']){try{var _0x3aadc6=require(_0x34a53e[_0x792d('0x6e')])[_0x792d('0x6f')](this,_0x3e27b8);_0x3e27b8['uri']=Mustache[_0x792d('0x70')](_0x34a53e[_0x792d('0x64')],_0x3aadc6,{},['$$','$$']);if(_0x3e27b8[_0x792d('0x6d')]){_0x3e27b8[_0x792d('0x6d')]=JSON[_0x792d('0x6c')](Mustache[_0x792d('0x70')](JSON[_0x792d('0x71')](_0x3e27b8[_0x792d('0x6d')]),_0x3aadc6,{},['$$','$$']));}if(_0x3e27b8[_0x792d('0x6b')]){_0x3e27b8[_0x792d('0x6b')]=JSON[_0x792d('0x6c')](Mustache['render'](JSON[_0x792d('0x71')](_0x3e27b8[_0x792d('0x6b')]),_0x3aadc6,{},['$$','$$']));}}catch(_0x53473c){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x53473c);}}rp(_0x3e27b8)[_0x792d('0x19')](function(_0x54f14a){var _0x538353={'statusCode':_0x54f14a[_0x792d('0x72')]||0xc8,'statusMessage':_0x54f14a[_0x792d('0x73')]||'OK','headers':_0x54f14a[_0x792d('0x6d')]||{},'body':_0x54f14a[_0x792d('0x6b')]||{}};_0x7c7cc4(null,_0x538353);})[_0x792d('0x15')](function(_0x393761){var _0x1f8803={'statusCode':_0x393761['statusCode']||0x1f4,'statusMessage':_0x393761[_0x792d('0x74')]||_0x792d('0x75'),'headers':_0x393761[_0x792d('0x76')][_0x792d('0x6d')]||{},'body':_0x393761['options']['body']||{}};_0x7c7cc4(null,_0x1f8803);});};AGIVertices[_0x792d('0x16')]['googleDialogflow']=function(_0x12e419,_0x558e71){scripts[_0x792d('0x77')](this[_0x792d('0x10')]['uniqueid'],_0x12e419[_0x792d('0x78')],_0x12e419[_0x792d('0x5c')],_0x12e419[_0x792d('0x79')]||'en')[_0x792d('0x19')](function(_0x4bd5e8){_0x558e71(null,_0x4bd5e8);})[_0x792d('0x15')](function(_0x3180f9){_0x558e71(_0x3180f9);});};AGIVertices[_0x792d('0x16')]['googleDialogflowV2']=function(_0x57c779,_0x102ad2){scripts[_0x792d('0x7a')](this[_0x792d('0x10')][_0x792d('0x37')],_0x57c779['dialogflowV2_project_id'],_0x57c779[_0x792d('0x7b')],_0x57c779[_0x792d('0x7c')],_0x57c779[_0x792d('0x5c')],_0x57c779[_0x792d('0x7d')]||'en')[_0x792d('0x19')](function(_0x210f7c){_0x102ad2(null,_0x210f7c);})[_0x792d('0x15')](function(_0x4564c2){_0x102ad2(_0x4564c2);});};AGIVertices[_0x792d('0x16')][_0x792d('0x7e')]=function(_0x1eecd9,_0x1f573d){scripts[_0x792d('0x7e')](this[_0x792d('0x10')],_0x1eecd9)[_0x792d('0x19')](function(_0x2cb7db){_0x1f573d(null,_0x2cb7db);})[_0x792d('0x15')](function(_0x14188e){_0x1f573d(_0x14188e);});};AGIVertices[_0x792d('0x16')][_0x792d('0x7f')]=function(_0x3c9a16,_0x356479){scripts[_0x792d('0x7f')](_0x3c9a16[_0x792d('0x78')],_0x3c9a16[_0x792d('0x5c')],_0x3c9a16[_0x792d('0x80')]||_0x792d('0x5d'),_0x3c9a16[_0x792d('0x81')])[_0x792d('0x19')](function(_0x3fdae6){_0x356479(null,_0x3fdae6);})[_0x792d('0x15')](function(_0x43ab11){_0x356479(_0x43ab11);});};AGIVertices[_0x792d('0x16')][_0x792d('0x82')]=function(_0x387174,_0x51dba5,_0x57b8e3){scripts[_0x792d('0x82')](_0x51dba5,_0x387174[_0x792d('0x78')],_0x387174[_0x792d('0x83')]||_0x792d('0x5d'),this['isConfigured'](_0x387174[_0x792d('0x84')])?_0x387174[_0x792d('0x84')]:undefined)[_0x792d('0x19')](function(_0x45e9c1){_0x57b8e3(null,_0x45e9c1);})[_0x792d('0x15')](function(_0x19497e){_0x57b8e3(_0x19497e);});};AGIVertices[_0x792d('0x16')][_0x792d('0x85')]=function(_0x5a3480,_0x3c47ad){scripts['awsPolly'](_0x5a3480[_0x792d('0x86')],_0x5a3480[_0x792d('0x87')],_0x5a3480[_0x792d('0x88')],_0x5a3480[_0x792d('0x89')]||_0x792d('0x8a'),_0x5a3480['text'],_0x5a3480[_0x792d('0x8b')]||_0x792d('0x5c'))[_0x792d('0x19')](function(_0x2d22c4){_0x3c47ad(null,_0x2d22c4);})[_0x792d('0x15')](function(_0x2a4a31){_0x3c47ad(_0x2a4a31);});};AGIVertices['prototype'][_0x792d('0x8c')]=function(_0x4535ef,_0x58b7c6){scripts['awsLex'](this[_0x792d('0x10')][_0x792d('0x37')],_0x4535ef['aws_access_key_id'],_0x4535ef[_0x792d('0x87')],_0x4535ef[_0x792d('0x8d')],_0x4535ef[_0x792d('0x5c')],_0x4535ef[_0x792d('0x8e')])[_0x792d('0x19')](function(_0x18b15e){_0x58b7c6(null,_0x18b15e);})[_0x792d('0x15')](function(_0x4f55ee){_0x58b7c6(_0x4f55ee);});};AGIVertices['prototype'][_0x792d('0x8f')]=function(_0x364048,_0x1faf0b,_0x1eaded){scripts[_0x792d('0x8f')](_0x1faf0b,_0x364048[_0x792d('0x78')],_0x364048[_0x792d('0x90')]||_0x792d('0x5d'))['then'](function(_0xf02fca){_0x1eaded(null,_0xf02fca);})[_0x792d('0x15')](function(_0x120511){_0x1eaded(_0x120511);});};AGIVertices[_0x792d('0x16')]['tildeASR']=function(_0x52b6e1,_0x2efe47,_0x1fe05b){scripts[_0x792d('0x91')](_0x2efe47,_0x52b6e1[_0x792d('0x92')],_0x52b6e1[_0x792d('0x93')],_0x52b6e1[_0x792d('0x94')])[_0x792d('0x19')](function(_0x550cc7){_0x1fe05b(null,_0x550cc7);})[_0x792d('0x15')](function(_0x29bcd4){_0x1fe05b(_0x29bcd4);});};AGIVertices[_0x792d('0x16')][_0x792d('0x95')]=function(_0x4eec46){var _0x4b33ff=_[_0x792d('0x67')](verticesWithRetry,_0x4eec46[_0x792d('0x39')])?_0x4eec46:_['clone'](_0x4eec46);for(var _0x1d7534 in _0x4b33ff){if(_0x4b33ff[_0x792d('0x96')](_0x1d7534)){if(_0x4b33ff[_0x1d7534]&&_[_0x792d('0x97')](_0x4b33ff[_0x1d7534])){if(_['includes'](recursiveMapAttributes,_0x1d7534)){_0x4b33ff[_0x1d7534]=this[_0x792d('0x98')](_0x4b33ff[_0x1d7534]);}else{_0x4b33ff[_0x1d7534]=this[_0x792d('0x99')](_0x4b33ff[_0x1d7534]);}}}}return _0x4b33ff;};AGIVertices[_0x792d('0x16')][_0x792d('0x9a')]=function(_0x53dbf7){for(var _0x26f21e in _0x53dbf7){if(_0x53dbf7[_0x792d('0x96')](_0x26f21e)){if(_[_0x792d('0x9b')](_0x53dbf7[_0x26f21e])){this[_0x792d('0x9a')](_0x53dbf7[_0x26f21e]);}else if(_[_0x792d('0x9c')](_0x53dbf7[_0x26f21e])){for(var _0x340acc=0x0;_0x340acc<_0x53dbf7[_0x26f21e]['length'];_0x340acc++){this[_0x792d('0x9a')](_0x53dbf7[_0x26f21e][_0x340acc]);}}else if(_[_0x792d('0x97')](_0x53dbf7[_0x26f21e])){_0x53dbf7[_0x26f21e]=this['replaceAllVariables'](_0x53dbf7[_0x26f21e]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x345517,_0x1b4973){for(var _0x34068a in _0x345517){if(_0x345517[_0x792d('0x96')](_0x34068a)){if(_[_0x792d('0x9b')](_0x345517[_0x34068a])){if(!_['isEmpty'](_0x345517[_0x34068a])){this[_0x792d('0x9d')](_0x345517[_0x34068a],util[_0x792d('0x2b')]('%s.%s',_0x1b4973,_0x34068a));}}else if(_['isArray'](_0x345517[_0x34068a])){for(var _0x141217=0x0;_0x141217<_0x345517[_0x34068a][_0x792d('0x9e')];_0x141217++){this[_0x792d('0x9d')](_0x345517[_0x34068a][_0x141217],util[_0x792d('0x2b')](_0x792d('0x9f'),_0x1b4973,_0x34068a+'['+_0x141217+']'));}}else{if(!_[_0x792d('0x48')](_0x345517[_0x34068a])){this['channel'][_0x792d('0xa0')](util[_0x792d('0x2b')]('%s.%s',_0x1b4973,_0x34068a),_0x345517[_0x34068a]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x388320){try{var _0xd761b6=JSON[_0x792d('0x6c')](_0x388320);this[_0x792d('0x9a')](_0xd761b6);return JSON[_0x792d('0x71')](_0xd761b6);}catch(_0x1d0de9){return this[_0x792d('0x99')](_0x388320);}};AGIVertices[_0x792d('0x16')][_0x792d('0x99')]=function(_0x2ea4cf){var _0x45326f=_0x2ea4cf[_0x792d('0xa1')]('{');for(var _0x42129c=0x1;_0x42129c<_0x45326f[_0x792d('0x9e')];_0x42129c+=0x1){var _0x1f245f=_0x45326f[_0x42129c][_0x792d('0xa1')]('}');if(_0x1f245f[_0x792d('0x9e')]>0x1){_0x2ea4cf=_0x2ea4cf['replaceAll']('{'+_0x1f245f[0x0]+'}',this[_0x792d('0x10')]['getVariable'](_0x1f245f[0x0])[_0x792d('0xa2')]||_0x1f245f[0x0]);}}if(_0x45326f[_0x792d('0x9e')]===0x1){return _0x2ea4cf[_0x792d('0x4c')]();}return this['replaceAllVariables'](_0x2ea4cf);};AGIVertices[_0x792d('0x16')]['getAndSetVariable']=function(_0x5c7943,_0x3b36bf){var _0x3dfea4=this[_0x792d('0x10')]['getVariable'](_0x5c7943);if(_0x3dfea4[_0x792d('0xa3')]===-0x1){return _0x3dfea4;}logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xa4'),_0x3b36bf,_0x3dfea4[_0x792d('0xa2')]));return this[_0x792d('0x10')]['setVariable'](_0x3b36bf,_0x3dfea4[_0x792d('0xa2')]);};AGIVertices['prototype']['isConfigured']=function(_0x7838a4){return _0x7838a4&&_0x7838a4!=='0'&&_0x7838a4!=='-1'&&_0x7838a4!=='';};AGIVertices[_0x792d('0x16')][_0x792d('0xa5')]=function(_0xce4ee9){this['createSquareDetailsReport']['sync'](this,_0xce4ee9,'-');_0xce4ee9[_0x792d('0xa6')]=_0xce4ee9['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x792d('0x16')][_0x792d('0xa7')]=function(_0x3ec4af){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xa8'),_0x3ec4af['label']));if(!this['isConfigured'](_0x3ec4af[_0x792d('0x5c')])){return this[_0x792d('0x10')]['noop'](_0x792d('0xa9'));}var _0x554d3d='\x22'+_0x3ec4af[_0x792d('0x5c')]+'\x22';if(this['isConfigured'](_0x3ec4af[_0x792d('0x76')])){_0x554d3d+=','+_0x3ec4af['options'];}var _0xb385fd=this[_0x792d('0x10')][_0x792d('0x57')]('MRCPSynth',_0x554d3d);if(_0xb385fd[_0x792d('0xa3')]===-0x1){return _0xb385fd;}return this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0xab'),_0x554d3d));};AGIVertices[_0x792d('0x16')][_0x792d('0xac')]=function(_0x16c25a){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xad'),_0x16c25a[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x16c25a[_0x792d('0xaf')])){return this[_0x792d('0x10')]['noop'](_0x792d('0xb0'));}var _0x85af6d=_0x16c25a[_0x792d('0xaf')];if(this[_0x792d('0xae')](_0x16c25a[_0x792d('0x76')])){_0x85af6d+=','+_0x16c25a['options'];}var _0x2a0213=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0xb1'),_0x85af6d);if(_0x2a0213[_0x792d('0xa3')]===-0x1){return _0x2a0213;}var _0x379780=this[_0x792d('0xb2')](_0x792d('0xb3'),_0x792d('0xb4'));if(_0x379780[_0x792d('0xa3')]===-0x1){return _0x379780;}var _0x209c74=this[_0x792d('0xb2')](_0x792d('0xb5'),_0x792d('0xb6'));if(_0x209c74['result']===-0x1){return _0x209c74;}var _0xfa5702=this[_0x792d('0xb2')](_0x792d('0xb7'),_0x792d('0xb8'));if(_0xfa5702[_0x792d('0xa3')]===-0x1){return _0xfa5702;}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xb9'),_0x85af6d));};AGIVertices['prototype'][_0x792d('0x8')]=function(_0x143c23){logger[_0x792d('0x32')](util['format'](_0x792d('0xba'),_0x143c23['label']));return this[_0x792d('0x10')][_0x792d('0x8')]([_0x143c23['command'],_0x143c23[_0x792d('0xbb')]]);};AGIVertices[_0x792d('0x16')][_0x792d('0xbc')]=function(_0xb4d198){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xbd'),_0xb4d198[_0x792d('0x38')]));if(this[_0x792d('0xae')](_0xb4d198['timeout'])){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xbe'),_0xb4d198[_0x792d('0x66')]));var _0x40a70b=this[_0x792d('0x10')][_0x792d('0xbf')](_0xb4d198[_0x792d('0x66')]);if(_0x40a70b[_0x792d('0xa3')]===-0x1){return _0x40a70b;}}return this[_0x792d('0x10')]['answer']();};AGIVertices['prototype'][_0x792d('0xc0')]=function(_0x2de5de){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xc1'),_0x2de5de[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x2de5de[_0x792d('0x4a')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x2de5de,_0x792d('0xc2'));}_0x2de5de['scheduledAt']=moment();if(this[_0x792d('0xae')](_0x2de5de['delay'])){_0x2de5de['scheduledAt']=moment()[_0x792d('0xc3')](_0x2de5de[_0x792d('0xc4')],_0x792d('0xc5'));}if(!this[_0x792d('0xae')](_0x2de5de['callback_priority'])){_0x2de5de['callback_priority']=0x2;}this[_0x792d('0x44')][_0x792d('0x6f')](this,_0x2de5de);return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2de5de['phone'],_0x2de5de[_0x792d('0x4a')],_0x2de5de[_0x792d('0x4b')]));};AGIVertices[_0x792d('0x16')][_0x792d('0xc6')]=function(_0x68c4eb){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xc7'),_0x68c4eb[_0x792d('0x38')]));var _0x3df8a4=this[_0x792d('0x10')][_0x792d('0x57')](_0x68c4eb['application'],_0x68c4eb[_0x792d('0x76')]);if(_0x3df8a4[_0x792d('0xa3')]===-0x1){return _0x3df8a4;}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xc8'),_0x68c4eb['application'],_0x68c4eb[_0x792d('0x76')]));};AGIVertices[_0x792d('0x16')][_0x792d('0xc9')]=function(_0x2ed4b5){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2ed4b5[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x2ed4b5[_0x792d('0x5c')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xa9'));}var _0x1ffa3b='\x22'+_0x2ed4b5['text']+'\x22';if(this['isConfigured'](_0x2ed4b5['options'])){_0x1ffa3b+=','+_0x2ed4b5['options'];}var _0x352ba2=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0xca'),_0x1ffa3b);if(_0x352ba2['result']===-0x1){return _0x352ba2;}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xab'),_0x1ffa3b));};AGIVertices[_0x792d('0x16')]['sestektts']=function(_0x28561e){logger['info'](util[_0x792d('0x2b')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x28561e[_0x792d('0x38')]));if(!this['isConfigured'](_0x28561e['text'])){return this['channel']['noop'](_0x792d('0xa9'));}var _0x2f4b37='\x22'+_0x28561e['text']+'\x22';if(this[_0x792d('0xae')](_0x28561e['options'])){_0x2f4b37+=','+_0x28561e[_0x792d('0x76')];}var _0x343288=this['channel'][_0x792d('0x57')](_0x792d('0xca'),_0x2f4b37);if(_0x343288[_0x792d('0xa3')]===-0x1){return _0x343288;}return this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0xab'),_0x2f4b37));};AGIVertices[_0x792d('0x16')][_0x792d('0xcb')]=function(_0x123788){logger[_0x792d('0x32')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x123788[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x123788[_0x792d('0xaf')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xb0'));}var _0x244b55=_0x123788[_0x792d('0xaf')];if(this[_0x792d('0xae')](_0x123788['options'])){_0x244b55+=','+_0x123788[_0x792d('0x76')];}var _0x1d950c=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0xb1'),_0x244b55);if(_0x1d950c[_0x792d('0xa3')]===-0x1){return _0x1d950c;}var _0x261832=this[_0x792d('0xb2')](_0x792d('0xb3'),_0x792d('0xcc'));if(_0x261832[_0x792d('0xa3')]===-0x1){return _0x261832;}var _0x507ecc=this['getAndSetVariable']('RECOG_INPUT()',_0x792d('0xcd'));if(_0x507ecc[_0x792d('0xa3')]===-0x1){return _0x507ecc;}var _0x4e2102=this[_0x792d('0xb2')](_0x792d('0xb7'),'LUMENVOX_ASR_INSTANCE');if(_0x4e2102[_0x792d('0xa3')]===-0x1){return _0x4e2102;}return this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0xb9'),_0x244b55));};AGIVertices[_0x792d('0x16')][_0x792d('0xce')]=function(_0x22d1bf){logger['info'](util['format'](_0x792d('0xcf'),_0x22d1bf[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x22d1bf[_0x792d('0xaf')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xb0'));}var _0x5cd82e=_0x22d1bf[_0x792d('0xaf')];if(this['isConfigured'](_0x22d1bf[_0x792d('0x76')])){_0x5cd82e+=','+_0x22d1bf['options'];}var _0x3f9fcb=this[_0x792d('0x10')][_0x792d('0x57')]('MRCPRecog',_0x5cd82e);if(_0x3f9fcb[_0x792d('0xa3')]===-0x1){return _0x3f9fcb;}var _0xd4b33d=this[_0x792d('0xb2')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0xd4b33d['result']===-0x1){return _0xd4b33d;}var _0x293d76=this[_0x792d('0xb2')]('RECOG_INPUT()',_0x792d('0xd0'));if(_0x293d76['result']===-0x1){return _0x293d76;}var _0x4272f6=this[_0x792d('0xb2')]('RECOG_INSTANCE()',_0x792d('0xd1'));if(_0x4272f6[_0x792d('0xa3')]===-0x1){return _0x4272f6;}return this['channel'][_0x792d('0xaa')](util['format'](_0x792d('0xb9'),_0x5cd82e));};AGIVertices[_0x792d('0x16')][_0x792d('0xd2')]=function(_0x3b4375){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0xd3'),_0x3b4375['label']));if(!this['isConfigured'](_0x3b4375['odbc_id'])){return this['channel'][_0x792d('0x2e')](_0x3b4375,_0x792d('0xd4'));}var _0x50faa2=this[_0x792d('0xd5')]['sync'](this,_0x3b4375[_0x792d('0xd6')]);if(!_0x50faa2){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x3b4375,_0x792d('0xd7'));}if(!this[_0x792d('0xae')](_0x3b4375[_0x792d('0x31')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x3b4375,'no\x20query\x20configured');}var _0xf40097=_0x3b4375['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x792d('0x10')][_0x792d('0xaa')](util['format']('query:\x20%s',_0xf40097));var _0x5a1e2f=this['getQueryOdbc'][_0x792d('0x6f')](this,_0x50faa2,_0xf40097);this['createSquareDetailsReport']['sync'](this,_0x3b4375,_0xf40097);if(!this['isConfigured'](_0x3b4375[_0x792d('0xd8')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xd9'));}var _0x25bfcc=this[_0x792d('0x13')][_0x792d('0x6f')](this,_0x3b4375['variable_id']);if(!_0x25bfcc){return this['channel'][_0x792d('0x2e')](_0x3b4375,'no\x20variable\x20found');}var _0xb4c0a8=this;_0x5a1e2f[_0x792d('0xda')](function(_0x5349ce,_0x3ba8d0){Object['keys'](_0x5349ce)[_0x792d('0xda')](function(_0x3b2a99){_0xb4c0a8[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')](_0x792d('0xdb'),_0x25bfcc,_0x3ba8d0,_0x3b2a99),_0x5349ce[_0x3b2a99]);});});this[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')]('%s_ROWS_COUNT',_0x25bfcc),_0x5a1e2f[_0x792d('0x9e')]);return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xdc'),_0x25bfcc));};AGIVertices[_0x792d('0x16')]['dial']=function(_0x12596a){logger['debug'](util[_0x792d('0x2b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x12596a[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x12596a['sip_id'])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x12596a,_0x792d('0xdd'));}var _0x3cb3b5=this[_0x792d('0x1d')][_0x792d('0x6f')](this,_0x12596a[_0x792d('0xde')]);if(!_0x3cb3b5){return this[_0x792d('0x10')]['error'](_0x12596a,_0x792d('0xdf'));}var _0x4741e5=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0xe0'),[util['format'](_0x792d('0xe1'),_0x3cb3b5),_0x12596a['timeout'],_0x12596a['opts'],_0x12596a[_0x792d('0x64')]]);if(_0x4741e5[_0x792d('0xa3')]===-0x1){return _0x4741e5;}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xe2'),_0x792d('0xe0')));};AGIVertices['prototype'][_0x792d('0xe3')]=function(_0xa3b377){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xa3b377[_0x792d('0x38')]));if(!this['isConfigured'](_0xa3b377[_0x792d('0x78')])){return this['channel'][_0x792d('0xaa')](_0x792d('0xe4'));}if(!this['isConfigured'](_0xa3b377[_0x792d('0x5c')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xa9'));}this[_0x792d('0x10')][_0x792d('0xe5')]=!![];this[_0x792d('0x36')](_0xa3b377);this[_0x792d('0x43')](_0xa3b377[_0x792d('0x5c')],'in','','');this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xe6'),_0xa3b377['text']));var _0x1924d8=this[_0x792d('0x77')]['sync'](this,_0xa3b377);if(_0x1924d8){for(var _0x13b8b0 in _0x1924d8){if(_0x1924d8[_0x792d('0x96')](_0x13b8b0)){this[_0x792d('0x10')]['setVariable'](util['format'](_0x792d('0xe7'),_0x13b8b0[_0x792d('0x6a')]()),_0x1924d8[_0x13b8b0]);}}this['createSquareMessage'](_0x1924d8[_0x792d('0xe8')],'out',_0x792d('0xe3'),'');return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('Dialogflow\x20Result\x20%s',_0x1924d8['speech']));}return this[_0x792d('0x10')][_0x792d('0x2e')](_0xa3b377,_0x792d('0xe9'));};AGIVertices[_0x792d('0x16')][_0x792d('0xea')]=function(_0x3abc0c){logger['info'](util[_0x792d('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3abc0c['label']));if(!this['isConfigured'](_0x3abc0c[_0x792d('0xeb')])){return this[_0x792d('0x10')]['noop'](_0x792d('0xec'));}if(!this['isConfigured'](_0x3abc0c[_0x792d('0x7b')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xed'));}if(!this['isConfigured'](_0x3abc0c[_0x792d('0x7c')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xee'));}if(!this[_0x792d('0xae')](_0x3abc0c[_0x792d('0x7d')])){return this[_0x792d('0x10')]['noop'](_0x792d('0xef'));}if(!this[_0x792d('0xae')](_0x3abc0c[_0x792d('0x5c')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xa9'));}this[_0x792d('0x10')][_0x792d('0xe5')]=!![];this[_0x792d('0x36')](_0x3abc0c);this[_0x792d('0x43')](_0x3abc0c[_0x792d('0x5c')],'in','','');this['channel'][_0x792d('0xaa')](util['format'](_0x792d('0xf0'),_0x3abc0c['text']));var _0x5d291f=this[_0x792d('0x7a')]['sync'](this,_0x3abc0c);if(_0x5d291f){for(var _0x53d9ec in _0x5d291f){if(_0x5d291f[_0x792d('0x96')](_0x53d9ec)){if(_0x53d9ec!=='providerResponse'){this[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')]('DIALOGFLOW_%s',_0x53d9ec['toUpperCase']()),_0x5d291f[_0x53d9ec]);}}}this[_0x792d('0x43')](_0x5d291f[_0x792d('0xe8')],'out','dialogflowV2',_0x5d291f[_0x792d('0xf1')]);return this['channel'][_0x792d('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x5d291f[_0x792d('0xe8')]));}return this['channel'][_0x792d('0x2e')](_0x3abc0c,_0x792d('0xf2'));};AGIVertices[_0x792d('0x16')]['sesteknda']=function(_0x225ccc){logger['info'](util['format'](_0x792d('0xf3'),_0x225ccc['label']));if(!this['isConfigured'](_0x225ccc[_0x792d('0xf4')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xf5'));}if(!this['isConfigured'](_0x225ccc['username'])){return this[_0x792d('0x10')][_0x792d('0xaa')]('no\x20username\x20configured');}if(!this[_0x792d('0xae')](_0x225ccc[_0x792d('0xf6')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xf7'));}if(!this[_0x792d('0xae')](_0x225ccc[_0x792d('0xf8')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xa9'));}this['channel'][_0x792d('0xe5')]=!![];this[_0x792d('0x36')](_0x225ccc);this[_0x792d('0x43')](_0x225ccc['text'],'in','','');this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0xf9'),_0x225ccc['text']));var _0x3900eb=this[_0x792d('0x7e')][_0x792d('0x6f')](this,_0x225ccc);if(_0x3900eb){for(var _0x383252 in _0x3900eb){if(_0x3900eb['hasOwnProperty'](_0x383252)){this[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')](_0x792d('0xfa'),_0x383252['toUpperCase']()),_0x3900eb[_0x383252]);}}this['createSquareMessage'](_0x3900eb['speech'],_0x792d('0xfb'),'sesteknda','');if(_0x3900eb[_0x792d('0xfc')]){this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0xfd'),_0x3900eb[_0x792d('0xfc')]));var _0x36ea4c=this[_0x792d('0x10')][_0x792d('0xfe')](_0x3900eb['audiofile']);try{fs[_0x792d('0xff')](_0x3900eb[_0x792d('0xfc')]+_0x792d('0x100'));}catch(_0x17fb35){logger[_0x792d('0x2e')](_0x17fb35);}return _0x36ea4c;}else{return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x101'),_0x3900eb[_0x792d('0xe8')]));}}return this[_0x792d('0x10')]['error'](_0x225ccc,_0x792d('0x102'));};AGIVertices[_0x792d('0x16')][_0x792d('0x103')]=function(_0x5c3239){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5c3239[_0x792d('0x38')]));return this[_0x792d('0x10')][_0x792d('0xaa')]('end');};AGIVertices[_0x792d('0x16')][_0x792d('0x104')]=function(_0x566677){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x105'),_0x566677[_0x792d('0x38')]));var _0xfdea4f='';if(_0x566677[_0x792d('0x106')]){if(!this[_0x792d('0xae')](_0x566677[_0x792d('0x106')])){return this[_0x792d('0x10')]['error'](_0x566677,'no\x20trunk\x20selected');}else{var _0x1492f9=parseInt(_0x566677[_0x792d('0x106')],0xa);if(isNaN(_0x1492f9)){_0xfdea4f=_0x566677[_0x792d('0x106')];}else{_0xfdea4f=this[_0x792d('0x1f')][_0x792d('0x6f')](this,_0x566677[_0x792d('0x106')]);if(!_0xfdea4f){return this['channel']['error'](_0x566677,'no\x20trunk\x20found');}}}}else if(_0x566677[_0x792d('0x107')]){_0xfdea4f=_0x566677[_0x792d('0x107')];}else{return this['channel']['error'](_0x566677,'no\x20trunk\x20selected');}var _0x26aeaf=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0xe0'),[util[_0x792d('0x2b')](_0x792d('0x108'),_0xfdea4f,_0x566677['phone']),_0x566677['timeout'],_0x566677[_0x792d('0x109')],_0x566677[_0x792d('0x64')]]);if(_0x26aeaf[_0x792d('0xa3')]===-0x1){return _0x26aeaf;}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xe2'),'DIAL'));};AGIVertices[_0x792d('0x16')][_0x792d('0x10a')]=function(_0x31bc3c){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x10b'),_0x31bc3c[_0x792d('0x38')]));return this[_0x792d('0x10')]['noop'](_0x792d('0x10a'));};AGIVertices[_0x792d('0x16')][_0x792d('0x10c')]=function(_0x411a40){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x10d'),_0x411a40[_0x792d('0x38')]));if(_0x411a40['retry']===0x0){return this[_0x792d('0xa5')](_0x411a40);}_0x411a40[_0x792d('0xa6')]-=0x1;if(!this[_0x792d('0xae')](_0x411a40[_0x792d('0x10e')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x411a40,_0x792d('0x10f'));}var _0x56b27a=this['getSound'][_0x792d('0x6f')](this,_0x411a40[_0x792d('0x10e')]);if(!_0x56b27a){return this['channel']['error'](_0x411a40,_0x792d('0x110'));}if(!this['isConfigured'](_0x411a40['variable_id'])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x792d('0xd9'));}var _0x131896=this[_0x792d('0x10')][_0x792d('0x111')](_0x56b27a,_0x411a40[_0x792d('0x112')],_0x411a40[_0x792d('0x113')]);var _0x5d0f75=_0x131896[_0x792d('0xa3')]?_0x131896['result']['toString']():'';logger['info'](_0x792d('0x114'),JSON[_0x792d('0x71')](_0x131896));if(_0x131896[_0x792d('0xa3')]===-0x1){this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x411a40,_0x5d0f75);return _0x131896;}else if(_0x131896[_0x792d('0xa2')]===_0x792d('0x66')){_0x131896['result']=_0x5d0f75['length']>=parseInt(_0x411a40[_0x792d('0x115')])?'x':'i';}else{_0x131896['result']=_0x5d0f75['length']>=parseInt(_0x411a40[_0x792d('0x115')])&&_0x5d0f75[_0x792d('0x9e')]<=parseInt(_0x411a40[_0x792d('0x113')])?'x':'i';}var _0x2827a2=this['getVariable'][_0x792d('0x6f')](this,_0x411a40['variable_id']);if(!_0x2827a2){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x411a40,_0x792d('0x116'));}this['channel'][_0x792d('0xa0')](_0x2827a2,_0x5d0f75);if(this[_0x792d('0xae')](_0x411a40[_0x792d('0x117')])){var _0x5b4fbb=parseInt(_0x411a40[_0x792d('0x117')],0xa);var _0x2d7adb=rs[_0x792d('0x118')]({'charset':'*','length':_0x5b4fbb});var _0x4b4efa=_0x5d0f75[_0x792d('0x9e')];if(_0x4b4efa>0x0){if(_0x4b4efa>_0x5b4fbb){this['createSquareDetailsReport']['sync'](this,_0x411a40,_0x411a40[_0x792d('0x119')]===_0x792d('0x11a')?_0x2d7adb+_0x5d0f75[_0x792d('0x11b')](_0x5b4fbb):_0x5d0f75['substr'](0x0,_0x4b4efa-_0x5b4fbb)+_0x2d7adb);}else{this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x411a40,rs[_0x792d('0x118')]({'charset':'*','length':_0x4b4efa}));}}else{this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x411a40,'');}}else{this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x411a40,_0x5d0f75);}return _0x131896;};AGIVertices[_0x792d('0x16')]['getsecretdigits']=function(_0x20069d){logger[_0x792d('0x32')](util['format'](_0x792d('0x11c'),_0x20069d[_0x792d('0x38')]));return this[_0x792d('0x10c')](_0x20069d);};AGIVertices[_0x792d('0x16')][_0x792d('0x11d')]=function(_0x507370){logger['info'](util[_0x792d('0x2b')](_0x792d('0x11e'),_0x507370[_0x792d('0x38')]));this[_0x792d('0x36')]['sync'](this,_0x507370,_0x507370[_0x792d('0x11f')]);return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x120'),_0x507370[_0x792d('0x11f')]));};AGIVertices[_0x792d('0x16')][_0x792d('0x121')]=function(_0x391d2d){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x122'),_0x391d2d['label']));if(!this[_0x792d('0xae')](_0x391d2d[_0x792d('0x86')])||!this[_0x792d('0xae')](_0x391d2d[_0x792d('0x87')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x123'));}if(!this[_0x792d('0xae')](_0x391d2d[_0x792d('0x5c')])){return this[_0x792d('0x10')][_0x792d('0xaa')]('no\x20text\x20configured');}this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0x124'),_0x391d2d['text']));var _0x15372f=this[_0x792d('0x85')][_0x792d('0x6f')](this,_0x391d2d);if(_0x15372f){this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('aws\x20Polly\x20%s\x20file\x20created',_0x15372f));var _0x2da6b1=this['channel']['streamFile'](_0x15372f);try{fs[_0x792d('0xff')](_0x15372f+_0x792d('0x100'));}catch(_0x2fad0d){logger[_0x792d('0x2e')](_0x2fad0d);}return _0x2da6b1;}return this['channel'][_0x792d('0x2e')](_0x391d2d,_0x792d('0x125'));};AGIVertices[_0x792d('0x16')][_0x792d('0x126')]=function(_0x4b1cd9){logger[_0x792d('0x32')](util['format'](_0x792d('0x127'),_0x4b1cd9[_0x792d('0x38')]));if(!this['isConfigured'](_0x4b1cd9[_0x792d('0x86')])||!this[_0x792d('0xae')](_0x4b1cd9[_0x792d('0x87')])){return this[_0x792d('0x10')]['noop'](_0x792d('0x123'));}if(!this[_0x792d('0xae')](_0x4b1cd9[_0x792d('0x8e')])){return this[_0x792d('0x10')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x4b1cd9[_0x792d('0x5c')])){return this['channel'][_0x792d('0xaa')]('no\x20text\x20configured');}this['channel'][_0x792d('0xe5')]=!![];this[_0x792d('0x36')](_0x4b1cd9);this[_0x792d('0x43')](_0x4b1cd9[_0x792d('0x5c')],'in','','');this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x128'),_0x4b1cd9[_0x792d('0x5c')]));var _0x5a674a=this[_0x792d('0x8c')][_0x792d('0x6f')](this,_0x4b1cd9);if(_0x5a674a){for(var _0x321ec2 in _0x5a674a){if(_0x5a674a['hasOwnProperty'](_0x321ec2)&&_['isString'](_0x5a674a[_0x321ec2])){this[_0x792d('0x10')][_0x792d('0xa0')](util['format'](_0x792d('0x129'),_0x321ec2[_0x792d('0x6a')]()),_0x5a674a[_0x321ec2]);}}if(_[_0x792d('0x48')](_0x5a674a[_0x792d('0x74')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x12a'));}else{this[_0x792d('0x43')](_0x5a674a[_0x792d('0x74')],_0x792d('0xfb'),_0x792d('0x12b'),'');return this['channel'][_0x792d('0xaa')](util['format'](_0x792d('0x12c'),_0x5a674a['message']));}}return this['channel'][_0x792d('0x2e')](_0x4b1cd9,_0x792d('0x12d'));};AGIVertices['prototype'][_0x792d('0x12e')]=function(_0x1587a2){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x12f'),_0x1587a2[_0x792d('0x38')],_0x1587a2['timeout']));if(!this[_0x792d('0xae')](_0x1587a2[_0x792d('0x78')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xe4'));}var _0x5d17a9=_0x792d('0x130');var _0x3fdfe9=util['format'](_0x792d('0x131'),FILES_PATH,rs[_0x792d('0x118')](0x4));var _0xb564c3=util[_0x792d('0x2b')](_0x792d('0x9f'),_0x3fdfe9,_0x5d17a9);var _0x32f5e2=!![];if(_0x1587a2['beep']===_0x792d('0x132')){_0x32f5e2=![];}var _0x3f3ecf=this[_0x792d('0x10')]['recordFile'](_0x3fdfe9,_0x5d17a9,_0x1587a2[_0x792d('0x133')],_0x1587a2['timeout'],undefined,_0x32f5e2);if(_0x3f3ecf['result']!==-0x1){this['channel']['noop'](util[_0x792d('0x2b')](_0x792d('0x134'),_0xb564c3));var _0x37c90a=this['googleASR'][_0x792d('0x6f')](this,_0x1587a2,_0xb564c3);if(_0x37c90a){for(var _0x43a3ff in _0x37c90a){if(_0x37c90a[_0x792d('0x96')](_0x43a3ff)){this[_0x792d('0x10')][_0x792d('0xa0')](util['format'](_0x792d('0x135'),_0x43a3ff[_0x792d('0x6a')]()),_0x37c90a[_0x43a3ff]);}}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x136'),JSON[_0x792d('0x71')](_0x37c90a)));}}return _0x3f3ecf;};AGIVertices[_0x792d('0x16')][_0x792d('0x137')]=function(_0x5dac07){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x138'),_0x5dac07[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x5dac07[_0x792d('0x92')])){return this['channel'][_0x792d('0xaa')](_0x792d('0x139'));}if(!this[_0x792d('0xae')](_0x5dac07['appsecret'])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x13a'));}var _0xa76279=_0x792d('0x130');var _0x5052b6=util['format'](_0x792d('0x131'),FILES_PATH,rs[_0x792d('0x118')](0x4));var _0x29e81f=util[_0x792d('0x2b')](_0x792d('0x9f'),_0x5052b6,_0xa76279);var _0x29d556=!![];if(_0x5dac07[_0x792d('0x13b')]===_0x792d('0x132')){_0x29d556=![];}var _0x4cb106=this[_0x792d('0x10')][_0x792d('0x13c')](_0x5052b6,_0xa76279,_0x5dac07[_0x792d('0x133')],_0x5dac07['timeout'],undefined,_0x29d556);if(_0x4cb106[_0x792d('0xa3')]!==-0x1){this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0x13d'),_0x29e81f));var _0x562dca=this[_0x792d('0x91')]['sync'](this,_0x5dac07,_0x29e81f);if(_0x562dca){for(var _0x40065a in _0x562dca){if(_0x562dca[_0x792d('0x96')](_0x40065a)){this['channel'][_0x792d('0xa0')](util[_0x792d('0x2b')](_0x792d('0x13e'),_0x40065a['toUpperCase']()),_0x562dca[_0x40065a]);}}return this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0x13f'),JSON[_0x792d('0x71')](_0x562dca)));}}return _0x4cb106;};AGIVertices[_0x792d('0x16')][_0x792d('0x140')]=function(_0xd18238){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x141'),_0xd18238['label']));return this[_0x792d('0x10')][_0x792d('0x142')](_0xd18238[_0x792d('0x3d')],_0xd18238[_0x792d('0x3e')],_0xd18238[_0x792d('0x3f')]);};AGIVertices['prototype']['gotoif']=function(_0x531c20){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x531c20['label']));if(!this[_0x792d('0xae')](_0x531c20[_0x792d('0x143')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x531c20,'no\x20condition\x20configured');}try{var _0x2c5332=eval(_0x531c20[_0x792d('0x143')])?_0x792d('0x144'):_0x792d('0x145');this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('EVAL\x20CONDITION\x20%s\x20%s',_0x531c20[_0x792d('0x143')],_0x2c5332));return{'code':0xc8,'result':_0x2c5332};}catch(_0x100be9){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x792d('0x16')]['gotoiftime']=function(_0x2b56b3){logger[_0x792d('0x32')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2b56b3[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x2b56b3['interval_id'])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x2b56b3,'no\x20interval\x20configured');}var _0x719bb0=this[_0x792d('0x25')][_0x792d('0x6f')](this,_0x2b56b3['interval_id']);if(!_0x719bb0){return this['channel'][_0x792d('0x2e')](_0x2b56b3,'no\x20intervals\x20found');}for(var _0x361d20=0x0;_0x361d20<_0x719bb0['length'];_0x361d20+=0x1){var _0x31daea=this[_0x792d('0x10')]['getVariable'](util[_0x792d('0x2b')](_0x792d('0x146'),_0x719bb0[_0x361d20]));if(_0x31daea['result']===-0x1){return _0x31daea;}logger['info'](util[_0x792d('0x2b')](_0x792d('0x147'),_0x719bb0[_0x361d20],_0x31daea[_0x792d('0xa2')]));if(_0x31daea[_0x792d('0xa2')]===_0x792d('0x144')){logger['info'](util['format'](_0x792d('0x147'),_0x719bb0[_0x361d20],_0x792d('0x144')));this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')]('IFTIME\x20%s\x20%s',_0x719bb0[_0x361d20],_0x792d('0x144')));return{'code':0xc8,'result':_0x792d('0x144')};}else{logger[_0x792d('0x32')](util[_0x792d('0x2b')]('IFTIME\x20%s\x20%s',_0x719bb0[_0x361d20],'false'));this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')]('IFTIME\x20%s\x20%s',_0x719bb0[_0x361d20],_0x792d('0x145')));}}return{'code':0xc8,'result':_0x792d('0x145')};};AGIVertices[_0x792d('0x16')][_0x792d('0x148')]=function(_0x9c9c64){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x9c9c64['label']));return this[_0x792d('0x10')][_0x792d('0x148')]();};AGIVertices[_0x792d('0x16')][_0x792d('0x149')]=function(_0x5c3616){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x14a'),_0x5c3616['label']));if(!this['isConfigured'](_0x5c3616[_0x792d('0x78')])){return this['channel'][_0x792d('0xaa')](_0x792d('0xe4'));}var _0xb9cc33=_0x792d('0x130');var _0x4b6cb5=util[_0x792d('0x2b')](_0x792d('0x131'),FILES_PATH,rs[_0x792d('0x118')](0x4));var _0x34beb5=util[_0x792d('0x2b')](_0x792d('0x9f'),_0x4b6cb5,_0xb9cc33);var _0x379c83=!![];if(_0x5c3616[_0x792d('0x13b')]==='NOBEEP'){_0x379c83=![];}var _0xc65328=this[_0x792d('0x10')][_0x792d('0x13c')](_0x4b6cb5,_0xb9cc33,_0x5c3616[_0x792d('0x133')],_0x5c3616['timeout'],undefined,_0x379c83);if(_0xc65328[_0x792d('0xa3')]!==-0x1){this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('ispeech\x20%s\x20file\x20created',_0x34beb5));var _0xa59056=this['ispeechASR'][_0x792d('0x6f')](this,_0x5c3616,_0x34beb5);if(_0xa59056){for(var _0x17f410 in _0xa59056){if(_0xa59056[_0x792d('0x96')](_0x17f410)){this[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')](_0x792d('0x14b'),_0x17f410['toUpperCase']()),_0xa59056[_0x17f410]);}}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0x792d('0x71')](_0xa59056)));}}return _0xc65328;};AGIVertices[_0x792d('0x16')]['ispeechtts']=function(_0x1d035d){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x14c'),_0x1d035d[_0x792d('0x38')]));if(!this['isConfigured'](_0x1d035d[_0x792d('0x78')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xe4'));}if(!this[_0x792d('0xae')](_0x1d035d[_0x792d('0x5c')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xa9'));}this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x14d'),_0x1d035d[_0x792d('0x5c')]));var _0x16de3d=this[_0x792d('0x7f')]['sync'](this,_0x1d035d);if(_0x16de3d){this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x14e'),_0x16de3d));var _0x5098fc=this[_0x792d('0x10')]['streamFile'](_0x16de3d,_0x1d035d[_0x792d('0x133')]);try{fs[_0x792d('0xff')](_0x16de3d+_0x792d('0x100'));}catch(_0x31be3d){logger[_0x792d('0x2e')](_0x31be3d);}return _0x5098fc;}return this[_0x792d('0x10')][_0x792d('0x2e')](_0x1d035d,_0x792d('0x14f'));};AGIVertices['prototype'][_0x792d('0x150')]=function(_0x5d6eda){logger['info'](util[_0x792d('0x2b')](_0x792d('0x151'),_0x5d6eda[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x5d6eda[_0x792d('0x152')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x5d6eda,_0x792d('0x153'));}logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x154'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x5d6eda['findBy']));var _0x3b1c39=this[_0x792d('0x55')][_0x792d('0x6f')](this,_0x5d6eda[_0x792d('0x152')]);if(_0x3b1c39){logger[_0x792d('0x32')](util['format'](_0x792d('0x155'),this['channel'][_0x792d('0x3b')],_0x5d6eda[_0x792d('0x152')]));this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0x155'),this['channel'][_0x792d('0x3b')],_0x5d6eda[_0x792d('0x152')]));return{'code':0xc8,'result':_0x792d('0x156')};}else{logger['info'](util[_0x792d('0x2b')](_0x792d('0x157'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x5d6eda[_0x792d('0x152')]));this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0x157'),this['channel'][_0x792d('0x3b')],_0x5d6eda[_0x792d('0x152')]));return{'code':0xc8,'result':_0x792d('0x158')};}};AGIVertices['prototype'][_0x792d('0x159')]=function(_0x5bc8fe){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x15a'),_0x5bc8fe[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x5bc8fe[_0x792d('0x152')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x5bc8fe,_0x792d('0x153'));}logger[_0x792d('0x32')](util['format'](_0x792d('0x154'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x5bc8fe[_0x792d('0x152')]));var _0x1c02b0=this[_0x792d('0x51')]['sync'](this,_0x5bc8fe[_0x792d('0x152')]);if(_0x1c02b0){logger[_0x792d('0x32')](util['format'](_0x792d('0x155'),this['channel'][_0x792d('0x3b')],_0x5bc8fe[_0x792d('0x152')]));this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x792d('0x10')][_0x792d('0x3b')],_0x5bc8fe[_0x792d('0x152')]));return{'code':0xc8,'result':_0x792d('0x156')};}else{logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x157'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x5bc8fe[_0x792d('0x152')]));this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0x157'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x5bc8fe[_0x792d('0x152')]));return{'code':0xc8,'result':_0x792d('0x158')};}};AGIVertices[_0x792d('0x16')][_0x792d('0x15b')]=function(_0x3481c0){logger['info'](util['format'](_0x792d('0x15c'),_0x3481c0[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x3481c0['operation'])){return this[_0x792d('0x10')]['error'](_0x3481c0,_0x792d('0x15d'));}this[_0x792d('0x10')]['noop'](util[_0x792d('0x2b')](_0x792d('0x15e'),_0x3481c0[_0x792d('0x15f')]));var _0x7b37b4=eval(_0x3481c0['operation']);if(!this[_0x792d('0xae')](_0x3481c0[_0x792d('0xd8')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0xd9'));}var _0x590205=this[_0x792d('0x13')][_0x792d('0x6f')](this,_0x3481c0[_0x792d('0xd8')]);if(!_0x590205){return this['channel'][_0x792d('0x2e')](_0x3481c0,_0x792d('0x116'));}if(_['isArray'](_0x7b37b4)){var _0x3683bb=this;_0x7b37b4[_0x792d('0xda')](function(_0x5c9ce1,_0x4bbb60){_0x3683bb[_0x792d('0x10')]['setVariable'](util[_0x792d('0x2b')]('%s[%s]',_0x590205,_0x4bbb60),_0x5c9ce1);});return this['channel']['noop'](util[_0x792d('0x2b')]('variable\x20%s[key]\x20set',_0x590205));}else{return this[_0x792d('0x10')][_0x792d('0xa0')](_0x590205,_0x7b37b4);}};AGIVertices[_0x792d('0x16')][_0x792d('0xe')]=function(_0x190533){logger[_0x792d('0x32')](util['format'](_0x792d('0x160'),_0x190533['label']));if(_0x190533[_0x792d('0xa6')]===0x0){return this[_0x792d('0xa5')](_0x190533);}_0x190533[_0x792d('0xa6')]-=0x1;if(!this['isConfigured'](_0x190533[_0x792d('0x10e')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x190533,_0x792d('0x10f'));}var _0x5e8e3c=this['getSound'][_0x792d('0x6f')](this,_0x190533[_0x792d('0x10e')]);if(!_0x5e8e3c){return this[_0x792d('0x10')]['error'](_0x190533,'no\x20file\x20audio\x20found');}var _0x2d788d=this[_0x792d('0x10')][_0x792d('0x111')](_0x5e8e3c,_0x190533['response'],_0x190533['digit']);var _0x164265=_0x2d788d[_0x792d('0xa3')];if(_0x2d788d[_0x792d('0xa3')]===-0x1){this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x190533,'-1');return _0x2d788d;}else if(_0x2d788d[_0x792d('0xa2')]==='timeout'){_0x2d788d[_0x792d('0xa3')]=_0x2d788d[_0x792d('0xa3')][_0x792d('0x9e')]>0x0?_0x2d788d[_0x792d('0xa3')]:'t';}else if(_[_0x792d('0x161')](_0x2d788d[_0x792d('0xa3')])){_0x2d788d['result']='#';_0x164265='#';}if(!this[_0x792d('0xae')](_0x190533[_0x792d('0xd8')])){this['channel'][_0x792d('0xaa')](_0x792d('0xd9'));}else{var _0x119c20=this['getVariable'][_0x792d('0x6f')](this,_0x190533[_0x792d('0xd8')]);if(!_0x119c20){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x190533,'no\x20variable\x20found');}this['channel'][_0x792d('0xa0')](_0x119c20,_0x164265);}this[_0x792d('0x36')]['sync'](this,_0x190533,_0x164265);return _0x2d788d;};AGIVertices[_0x792d('0x16')][_0x792d('0xaa')]=function(_0x5197f3){logger['info'](util[_0x792d('0x2b')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5197f3['label']));return this['channel'][_0x792d('0xaa')](_0x5197f3['output']||_0x5197f3[_0x792d('0x38')]);};AGIVertices[_0x792d('0x16')][_0x792d('0x162')]=function(_0x17ed66){logger[_0x792d('0x32')](util['format'](_0x792d('0x163'),_0x17ed66[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x17ed66[_0x792d('0x152')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x17ed66,_0x792d('0x153'));}logger['info'](util[_0x792d('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x792d('0x10')]['callerid'],_0x17ed66[_0x792d('0x152')]));var _0x37a778=this[_0x792d('0x4e')][_0x792d('0x6f')](this,_0x17ed66[_0x792d('0x164')]);var _0x12368f=this[_0x792d('0x4f')][_0x792d('0x6f')](this,_0x17ed66['findBy'],_0x37a778);if(_0x12368f){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x155'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x17ed66[_0x792d('0x152')]));this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x155'),this['channel']['callerid'],_0x17ed66['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x157'),this[_0x792d('0x10')]['callerid'],_0x17ed66[_0x792d('0x152')]));this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x155'),this[_0x792d('0x10')]['callerid'],_0x17ed66[_0x792d('0x152')]));return{'code':0xc8,'result':_0x792d('0x158')};}};AGIVertices[_0x792d('0x16')][_0x792d('0x165')]=function(_0x353848){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x353848[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x353848['file_id'])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x353848,_0x792d('0x10f'));}var _0x1a18fd=this[_0x792d('0x21')][_0x792d('0x6f')](this,_0x353848[_0x792d('0x10e')]);if(!_0x1a18fd){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x353848,'no\x20file\x20audio\x20found');}var _0x56be97=this['channel'][_0x792d('0x57')](_0x792d('0x166'),[_0x1a18fd,_0x353848[_0x792d('0x109')]]);if(_0x56be97['result']===-0x1){return _0x56be97;}return this['channel'][_0x792d('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0x792d('0x166'),_0x1a18fd));};AGIVertices[_0x792d('0x16')][_0x792d('0x167')]=function(_0x14ce8f){logger[_0x792d('0x32')](util['format'](_0x792d('0x168'),_0x14ce8f[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x14ce8f['queue_id'])){return this['channel'][_0x792d('0x2e')](_0x14ce8f,_0x792d('0x169'));}var _0x3f70fb='';var _0x444f65=parseInt(_0x14ce8f['queue_id'],0xa);if(isNaN(_0x444f65)){_0x3f70fb=_0x14ce8f['queue_id'];}else{_0x3f70fb=this[_0x792d('0x17')][_0x792d('0x6f')](this,_0x14ce8f[_0x792d('0x16a')]);if(!_0x3f70fb){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x14ce8f,_0x792d('0x16b'));}}var _0x5241ac='';if(this[_0x792d('0xae')](_0x14ce8f['file_id'])){var _0x4ff027=this['getSound']['sync'](this,_0x14ce8f[_0x792d('0x10e')]);if(_0x4ff027){_0x5241ac=_0x4ff027;}}this['createSquareDetailsReport'][_0x792d('0x6f')](this,_0x14ce8f,_0x3f70fb);if(_0x14ce8f[_0x792d('0x109')][_0x792d('0x16c')]('x')<0x0){_0x14ce8f['opts']+='x';}if(_0x14ce8f[_0x792d('0x109')][_0x792d('0x16c')]('X')<0x0){_0x14ce8f[_0x792d('0x109')]+='X';}this[_0x792d('0x10')][_0x792d('0xa0')](_0x792d('0x16d'),_0x3f70fb?_0x3f70fb[_0x792d('0x16e')]():'');var _0x288a4a=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0x16f'),[_0x3f70fb,_0x14ce8f['opts'],_0x14ce8f[_0x792d('0x64')],_0x5241ac,_0x14ce8f[_0x792d('0x66')],_0x14ce8f[_0x792d('0x8')],_0x14ce8f['macro'],_0x14ce8f[_0x792d('0x170')],'',_0x14ce8f[_0x792d('0x171')]]);if(_0x288a4a[_0x792d('0xa3')]===-0x1){return _0x288a4a;}return this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0xc8'),_0x792d('0x16f'),_0x3f70fb));};AGIVertices[_0x792d('0x16')][_0x792d('0x172')]=function(_0x2b4d76){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2b4d76[_0x792d('0x38')]));var _0xc79030=_0x2b4d76[_0x792d('0x173')]||_0x792d('0x130');var _0x4cce9d=util[_0x792d('0x2b')]('%s_%s',this[_0x792d('0x10')]['uniqueid'],rs[_0x792d('0x118')](0x5));var _0x52d3d7=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x4cce9d,_0xc79030);var _0x4a2191=util[_0x792d('0x2b')](_0x792d('0x131'),FILES_PATH,_0x4cce9d);this[_0x792d('0x3a')]['sync'](this,_0x2b4d76,_0x4cce9d,_0x52d3d7);this['channel'][_0x792d('0xa0')]('RECORDING_SAVENAME',_0x4cce9d);logger[_0x792d('0x32')](_0x792d('0x174'),_0x4a2191,_0xc79030,_0x2b4d76['escape_digits'],_0x2b4d76[_0x792d('0x66')]);return this[_0x792d('0x10')][_0x792d('0x13c')](_0x4a2191,_0xc79030,_0x2b4d76[_0x792d('0x175')],_0x2b4d76[_0x792d('0x66')],undefined,!![]);};AGIVertices['prototype'][_0x792d('0x176')]=function(_0x12db92){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x177'),_0x12db92[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x12db92[_0x792d('0x64')])){return this[_0x792d('0x10')][_0x792d('0xaa')]('no\x20url\x20configured');}var _0x43c77d=this['restAPI']['sync'](this,_0x12db92);logger['info'](util[_0x792d('0x2b')](_0x792d('0x178'),util[_0x792d('0x179')](_0x43c77d,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x12db92['variable_id'])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x17a'));}var _0x3a928f=this[_0x792d('0x13')]['sync'](this,_0x12db92[_0x792d('0xd8')]);if(!_0x3a928f){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x12db92,_0x792d('0x116'));}this[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')](_0x792d('0x17b'),_0x3a928f),_0x43c77d['statusCode']?_0x43c77d[_0x792d('0x72')]:_0x792d('0x17c'));this[_0x792d('0x10')][_0x792d('0xa0')](util[_0x792d('0x2b')]('%s_STATUS_MESSAGE',_0x3a928f),_0x43c77d[_0x792d('0x73')]?_0x43c77d[_0x792d('0x73')]:'OK');if(_0x43c77d['body']){try{this[_0x792d('0x9d')](_0x43c77d[_0x792d('0x6b')],_0x3a928f);}catch(_0x4ebfcf){logger[_0x792d('0x2e')](util['format'](_0x792d('0x17d'),_0x3a928f));}}return this['channel'][_0x792d('0xaa')](util['format'](_0x792d('0xdc'),_0x3a928f));};AGIVertices[_0x792d('0x16')]['saydigits']=function(_0x1f816e){logger[_0x792d('0x32')](util['format'](_0x792d('0x17e'),_0x1f816e['label']));return this[_0x792d('0x10')]['sayDigits'](_0x1f816e['digits']['replace'](/\s+/g,''),_0x1f816e[_0x792d('0x175')]);};AGIVertices[_0x792d('0x16')][_0x792d('0x17f')]=function(_0x1200d8){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x180'),_0x1200d8['label']));return this[_0x792d('0x10')]['sayNumber'](_0x1200d8['number'][_0x792d('0x59')](/\s+/g,''),_0x1200d8[_0x792d('0x175')]);};AGIVertices[_0x792d('0x16')]['sayphonetic']=function(_0x199e75){logger['info'](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x199e75[_0x792d('0x38')]));return this[_0x792d('0x10')]['sayPhonetic'](_0x199e75['text'],_0x199e75[_0x792d('0x175')]);};AGIVertices[_0x792d('0x16')][_0x792d('0x181')]=function(_0x3aae37){logger['info'](util[_0x792d('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3aae37[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x3aae37[_0x792d('0x182')])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x183'));}var _0x4ee339=this[_0x792d('0x184')][_0x792d('0x6f')](this,_0x3aae37['account_id']);if(!_0x4ee339||!_0x4ee339[_0x792d('0x185')]){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x3aae37,_0x792d('0x186'));}var _0xbfc12={'from':util[_0x792d('0x2b')]('\x22%s\x22\x20<%s>',_0x4ee339[_0x792d('0x14')],_0x4ee339[_0x792d('0x187')]||_0x4ee339[_0x792d('0x185')][_0x792d('0x188')]),'to':_0x3aae37['to']||'','cc':_0x3aae37['cc']||'','bcc':_0x3aae37['bcc']||'','subject':_0x3aae37['subject'],'html':_0x3aae37['text'],'text':_0x3aae37[_0x792d('0x5c')]};if(this[_0x792d('0xae')](_0x3aae37[_0x792d('0x189')])){}logger[_0x792d('0x18a')]('sendMail\x20message',JSON[_0x792d('0x71')](_0xbfc12));this[_0x792d('0x36')]['sync'](this,_0x3aae37,_0x3aae37[_0x792d('0x182')]);this[_0x792d('0x10')]['noop'](util['format'](_0x792d('0x18b'),_0x4ee339[_0x792d('0x14')]));this['sendMailMessage'][_0x792d('0x6f')](this,_0x4ee339[_0x792d('0x18c')],_0xbfc12);return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x18d'));};AGIVertices[_0x792d('0x16')]['sendFax']=function(_0x2c7e21){logger[_0x792d('0x32')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2c7e21[_0x792d('0x38')]));return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x18e'));};AGIVertices[_0x792d('0x16')][_0x792d('0x18f')]=function(_0x11992d){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x190'),_0x11992d[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x11992d['sms_account_id'])){return this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x191'));}var _0xac4088=this[_0x792d('0x34')][_0x792d('0x6f')](this,_0x11992d[_0x792d('0x192')]);if(!_0xac4088){return this[_0x792d('0x10')]['error'](_0x11992d,'no\x20sms\x20account\x20found');}var _0x50df55={'body':_0x11992d['sms_text'],'phone':_0x11992d['to']||'','SmsAccountId':_0xac4088['id']};logger[_0x792d('0x18a')]('sendSMS\x20message',JSON[_0x792d('0x71')](_0x50df55));this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x11992d,_0x11992d[_0x792d('0x192')]);this['channel'][_0x792d('0xaa')](util['format'](_0x792d('0x193'),_0xac4088[_0x792d('0x14')]));this[_0x792d('0x194')][_0x792d('0x6f')](this,_0x50df55);return this['channel'][_0x792d('0xaa')](_0x792d('0x195'));};AGIVertices[_0x792d('0x16')]['set']=function(_0x5c3cc6){logger[_0x792d('0x32')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x5c3cc6[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x5c3cc6[_0x792d('0xd8')])){return this[_0x792d('0x10')]['error'](_0x5c3cc6,_0x792d('0x196'));}var _0x351603=this[_0x792d('0x13')][_0x792d('0x6f')](this,_0x5c3cc6[_0x792d('0xd8')]);if(!_0x351603){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x5c3cc6,_0x792d('0x116'));}return this[_0x792d('0x10')]['setVariable'](_0x351603,_0x5c3cc6[_0x792d('0x197')]);};AGIVertices[_0x792d('0x16')][_0x792d('0x198')]=function(_0x36f573){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x199'),_0x36f573[_0x792d('0x38')]));this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x19a'));if(_0x36f573['answer']===_0x792d('0x19b')){this[_0x792d('0x10')][_0x792d('0xaa')](_0x792d('0x19c'));return this[_0x792d('0x10')]['answer']();}return this['channel'][_0x792d('0xaa')](_0x792d('0x19d'));};AGIVertices[_0x792d('0x16')][_0x792d('0x19e')]=function(_0x548f19){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x19f'),_0x548f19[_0x792d('0x38')]));if(!this[_0x792d('0xae')](_0x548f19[_0x792d('0x1a0')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x548f19,'no\x20subproject\x20selected');}var _0x4b34b1=this[_0x792d('0x1a')][_0x792d('0x6f')](this,_0x548f19['project_id']);if(!this[_0x792d('0xae')](_0x4b34b1)){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x548f19,util[_0x792d('0x2b')](_0x792d('0x1a1'),_0x548f19[_0x792d('0x1a0')]));}if(_0x4b34b1===this['channel']['arg_1']){return this['channel'][_0x792d('0x2e')](_0x548f19,_0x792d('0x1a2'));}this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x548f19,_0x4b34b1);var _0x9747ee=this[_0x792d('0x10')]['exec'](_0x792d('0x1a3'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x792d('0x8')][_0x792d('0x1a4')]||'127.0.0.1',_0x4b34b1,this[_0x792d('0x10')][_0x792d('0x41')]));if(_0x9747ee['result']===-0x1){return _0x9747ee;}return this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0xc8'),_0x792d('0x1a3'),_0x4b34b1));};AGIVertices[_0x792d('0x16')][_0x792d('0x1a5')]=function(_0x5bf8f6){logger[_0x792d('0x32')](util['format'](_0x792d('0x1a6'),_0x5bf8f6[_0x792d('0x38')]));var _0x2ea241=this[_0x792d('0x56')][_0x792d('0x6f')](this,_0x5bf8f6['command']);this[_0x792d('0x36')][_0x792d('0x6f')](this,_0x5bf8f6,_0x5bf8f6[_0x792d('0x1a7')]);if(this['isConfigured'](_0x5bf8f6[_0x792d('0xd8')])){var _0x22a36c=this['getVariable']['sync'](this,_0x5bf8f6[_0x792d('0xd8')]);if(_0x22a36c){this[_0x792d('0x10')][_0x792d('0xa0')](_0x22a36c,_0x2ea241);return this[_0x792d('0x10')]['noop'](util['format'](_0x792d('0x1a8'),_0x5bf8f6[_0x792d('0x1a7')],_0x22a36c));}}return this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x1a9'),_0x5bf8f6['command']));};AGIVertices[_0x792d('0x16')][_0x792d('0x1aa')]=function(_0x387c70){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x1ab'),_0x387c70[_0x792d('0x38')]));_0x387c70[_0x792d('0x5c')]=_0x387c70[_0x792d('0x5c')][_0x792d('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x792d('0xae')](_0x387c70[_0x792d('0x5b')])){return this[_0x792d('0x10')][_0x792d('0xaa')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x387c70[_0x792d('0x5c')])){return this[_0x792d('0x10')][_0x792d('0xaa')]('no\x20text\x20configured');}this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x1ac'),_0x387c70[_0x792d('0x5c')]));var _0xecaf2c=this['googleCloudTTS']['sync'](this,_0x387c70);if(_0xecaf2c){this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')](_0x792d('0x1ad'),_0xecaf2c));var _0xa6062e=this[_0x792d('0x10')][_0x792d('0xfe')](_0xecaf2c);try{fs['unlink'](_0xecaf2c+_0x792d('0x100'));}catch(_0x10be26){logger[_0x792d('0x2e')](_0x10be26);}return _0xa6062e;}return this[_0x792d('0x10')][_0x792d('0x2e')](_0x387c70,_0x792d('0x1ae'));};AGIVertices[_0x792d('0x16')][_0x792d('0x1af')]=function(_0x186f04){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x1b0'),_0x186f04['label']));_0x186f04[_0x792d('0x5c')]=_0x186f04['text'][_0x792d('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x792d('0xae')](_0x186f04['text'])){return this[_0x792d('0x10')][_0x792d('0xaa')]('no\x20text\x20configured');}this['channel']['noop'](util[_0x792d('0x2b')](_0x792d('0x1b1'),_0x186f04[_0x792d('0x5c')]));var _0x3fb666=this[_0x792d('0x61')][_0x792d('0x6f')](this,_0x186f04);if(_0x3fb666){this['channel'][_0x792d('0xaa')](util[_0x792d('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x3fb666));var _0x570b01=this[_0x792d('0x10')][_0x792d('0xfe')](_0x3fb666);try{fs[_0x792d('0xff')](_0x3fb666+_0x792d('0x100'));}catch(_0x7f8014){logger[_0x792d('0x2e')](_0x7f8014);}return _0x570b01;}return this[_0x792d('0x10')][_0x792d('0x2e')](_0x186f04,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x792d('0x16')]['unpause']=function(_0x184b22){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x184b22['label']));if(!this['isConfigured'](_0x184b22[_0x792d('0x152')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x184b22,_0x792d('0x153'));}logger['info'](util[_0x792d('0x2b')](_0x792d('0x154'),this[_0x792d('0x10')]['callerid'],_0x184b22[_0x792d('0x152')]));var _0x37ad7b=this['agentUnpause'][_0x792d('0x6f')](this,_0x184b22[_0x792d('0x152')]);if(_0x37ad7b){logger[_0x792d('0x32')](util[_0x792d('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x792d('0x3b')],_0x184b22[_0x792d('0x152')]));this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x792d('0x10')]['callerid'],_0x184b22[_0x792d('0x152')]));return{'code':0xc8,'result':_0x792d('0x156')};}else{logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x157'),this[_0x792d('0x10')][_0x792d('0x3b')],_0x184b22['findBy']));this[_0x792d('0x10')][_0x792d('0xaa')](util[_0x792d('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x792d('0x10')][_0x792d('0x3b')],_0x184b22[_0x792d('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x792d('0x16')][_0x792d('0x1b2')]=function(_0x4e0f6b){logger[_0x792d('0x32')](util[_0x792d('0x2b')](_0x792d('0x1b3'),_0x4e0f6b[_0x792d('0x38')]));var _0x31c417=this[_0x792d('0x10')][_0x792d('0x57')](_0x792d('0x1b4'),[_0x4e0f6b[_0x792d('0x1b5')],_0x4e0f6b[_0x792d('0x76')]]);if(_0x31c417[_0x792d('0xa3')]===-0x1){return _0x31c417;}return this[_0x792d('0x10')][_0x792d('0xaa')](util['format'](_0x792d('0xc8'),_0x792d('0x1b4'),_0x4e0f6b['mailbox']));};AGIVertices['prototype'][_0x792d('0x1b6')]=function(_0x5c0994){logger['info'](util[_0x792d('0x2b')](_0x792d('0x1b7'),_0x5c0994['label']));if(!this[_0x792d('0xae')](_0x5c0994[_0x792d('0xd8')])){return this[_0x792d('0x10')][_0x792d('0x2e')](_0x5c0994,_0x792d('0x196'));}var _0x5cf48b=this[_0x792d('0x13')][_0x792d('0x6f')](this,_0x5c0994[_0x792d('0xd8')]);if(!_0x5cf48b){return this[_0x792d('0x10')]['error'](_0x5c0994,_0x792d('0x116'));}var _0x569de8=this[_0x792d('0x10')][_0x792d('0x13')](_0x5cf48b);return{'code':0xc8,'result':_0x569de8[_0x792d('0xa2')]?_0x569de8[_0x792d('0xa2')]:'-'};};String[_0x792d('0x16')][_0x792d('0x1b8')]=function(_0x585676,_0x519143){return this[_0x792d('0xa1')](_0x585676)['join'](_0x519143);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0xdfe9=['finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','generate','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','subject','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','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\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','split','exports','util','shelljs','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','name','getVoiceQueue','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','prototype','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','replaceAll','extra','getAndSetVariable','maxRetry','mrcpsynth','label','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','callback_priority','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\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','forEach','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','url'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x223f05,_0x51614b){_0x223f05=_0x223f05-0x0;var _0x58ddbc=_0xdfe9[_0x223f05];return _0x58ddbc;};'use strict';var fs=require('fs');var util=require(_0x9dfe('0x0'));var _=require('lodash');var sh=require(_0x9dfe('0x1'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x9dfe('0x2'));var Mustache=require(_0x9dfe('0x3'));var rp=require(_0x9dfe('0x4'));var logger=require(_0x9dfe('0x5'))(_0x9dfe('0x6'));var config=require(_0x9dfe('0x7'));var shared=require(_0x9dfe('0x8'));var scripts=require(_0x9dfe('0x9'));var FILES_PATH=_0x9dfe('0xa');var recursiveMapAttributes=[_0x9dfe('0xb'),_0x9dfe('0xc')];var verticesWithRetry=['menu',_0x9dfe('0xd'),_0x9dfe('0xe')];var AGIVertices=function(_0x24f572,_0x411842,_0xcd9ecb){this[_0x9dfe('0xf')]=_0x24f572;this[_0x9dfe('0x10')]=_0x411842;this[_0x9dfe('0x11')]=_0xcd9ecb;};AGIVertices['prototype'][_0x9dfe('0x12')]=function(_0x3eaba2,_0x25c2e9){this[_0x9dfe('0x10')]['getVariableById'](_0x3eaba2)['then'](function(_0x825165){_0x25c2e9(null,_0x825165?_0x825165[_0x9dfe('0x13')]:![]);})['catch'](function(_0x547ae1){_0x25c2e9(_0x547ae1);});};AGIVertices['prototype'][_0x9dfe('0x14')]=function(_0x28d035,_0x2a7734){this[_0x9dfe('0x10')][_0x9dfe('0x15')](_0x28d035)[_0x9dfe('0x16')](function(_0x4449a6){_0x2a7734(null,_0x4449a6?_0x4449a6[_0x9dfe('0x13')]:![]);})[_0x9dfe('0x17')](function(_0x56c864){_0x2a7734(_0x56c864);});};AGIVertices['prototype'][_0x9dfe('0x18')]=function(_0x4be792,_0x1a7cbe){this[_0x9dfe('0x10')][_0x9dfe('0x19')](_0x4be792)[_0x9dfe('0x16')](function(_0x15e32b){_0x1a7cbe(null,_0x15e32b?_0x15e32b[_0x9dfe('0x13')]:![]);})['catch'](function(_0x270796){_0x1a7cbe(_0x270796);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x1b')]=function(_0x145e4d,_0x2ebbc4){this[_0x9dfe('0x10')][_0x9dfe('0x1c')](_0x145e4d)[_0x9dfe('0x16')](function(_0x439cd4){_0x2ebbc4(null,_0x439cd4?_0x439cd4[_0x9dfe('0x1d')]:![]);})[_0x9dfe('0x17')](function(_0x2971b){_0x2ebbc4(_0x2971b);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x1e')]=function(_0x54ee52,_0x484f22){this[_0x9dfe('0x10')][_0x9dfe('0x1f')](_0x54ee52)[_0x9dfe('0x16')](function(_0x12ef2a){_0x484f22(null,_0x12ef2a?_0x12ef2a[_0x9dfe('0x13')]:![]);})[_0x9dfe('0x17')](function(_0x3354b7){_0x484f22(_0x3354b7);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x20')]=function(_0xf7fc28,_0x3bcbe8){this['rpc']['getTrunkById'](_0xf7fc28)[_0x9dfe('0x16')](function(_0x18c158){_0x3bcbe8(null,_0x18c158?_0x18c158['name']:![]);})[_0x9dfe('0x17')](function(_0x332020){_0x3bcbe8(_0x332020);});};AGIVertices[_0x9dfe('0x1a')]['getSound']=function(_0x2fba44,_0xac36fc){var _0x2bd599=this;this[_0x9dfe('0x10')][_0x9dfe('0x21')](_0x2fba44)['then'](function(_0x409711){_0xac36fc(null,_0x409711?_0x2bd599['getSoundPath'](_0x409711[_0x9dfe('0x22')]):![]);})[_0x9dfe('0x17')](function(_0x796981){_0xac36fc(_0x796981);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x23')]=function(_0x10c2d4,_0x3bf281){this[_0x9dfe('0x10')]['getMailAccountById'](_0x10c2d4)['then'](function(_0x458521){_0x3bf281(null,_0x458521?_0x458521:![]);})['catch'](function(_0x236ef9){_0x3bf281(_0x236ef9);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x24')]=function(_0x5e6557,_0x202896,_0x3f8a6a){this['mailRpc']['sendMailMessage'](_0x5e6557,_0x202896)[_0x9dfe('0x16')](function(){_0x3f8a6a(null);})[_0x9dfe('0x17')](function(_0x1383d1){_0x3f8a6a(_0x1383d1);});};AGIVertices[_0x9dfe('0x1a')]['getIntervals']=function(_0x429905,_0x1bb285){this[_0x9dfe('0x10')][_0x9dfe('0x25')](_0x429905)[_0x9dfe('0x16')](function(_0x54796d){if(_0x54796d){if(_0x54796d[_0x9dfe('0x26')]){_0x1bb285(null,[_0x54796d[_0x9dfe('0x27')]]);}else{_0x1bb285(null,_[_0x9dfe('0x28')](_0x54796d[_0x9dfe('0x29')],_0x9dfe('0x27')));}}else{_0x1bb285(null,![]);}})[_0x9dfe('0x17')](function(_0xd56269){_0x1bb285(_0xd56269);});};AGIVertices['prototype'][_0x9dfe('0x2a')]=function(_0x18fe71){return util[_0x9dfe('0x2b')](_0x9dfe('0x2c'),FILES_PATH,_0x18fe71);};AGIVertices[_0x9dfe('0x1a')]['getQueryOdbc']=function(_0x31db7f,_0x153868,_0x547c93){odbc[_0x9dfe('0x2d')](_0x31db7f,function(_0x598629){if(_0x598629){logger[_0x9dfe('0x2e')](_0x9dfe('0x2f'),_0x598629);_0x547c93(_0x598629);}else{logger[_0x9dfe('0x30')](_0x9dfe('0x31'));odbc[_0x9dfe('0x32')](_0x153868,function(_0x56ed23,_0x5184bd){if(_0x56ed23){logger[_0x9dfe('0x30')](_0x9dfe('0x33'),_0x153868);_0x547c93(_0x56ed23);}else{logger['info'](_0x9dfe('0x34'),_0x153868);odbc['close'](function(_0x1d4146){if(_0x1d4146){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1d4146);}_0x547c93(null,_0x5184bd);});}});}});};AGIVertices['prototype'][_0x9dfe('0x35')]=function(_0x4fa232,_0x4a1c6f){this[_0x9dfe('0x10')]['getSmsAccountById'](_0x4fa232)[_0x9dfe('0x16')](function(_0x17391e){_0x4a1c6f(null,_0x17391e?_0x17391e:![]);})[_0x9dfe('0x17')](function(_0x207454){_0x4a1c6f(_0x207454);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x36')]=function(_0x5c6446,_0x2e5c8f){this[_0x9dfe('0x10')][_0x9dfe('0x36')](_0x5c6446)[_0x9dfe('0x16')](function(_0x10a870){_0x2e5c8f(null,_0x10a870);})[_0x9dfe('0x17')](function(_0x42d51e){_0x2e5c8f(_0x42d51e);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x37')]=function(_0x5dfa4b,_0x895592,_0x3e4716){this[_0x9dfe('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x9dfe('0x38')],'node':_0x5dfa4b['label'],'application':_0x5dfa4b['agicommand'],'data':_0x895592||null,'project_name':this[_0x9dfe('0xf')][_0x9dfe('0x39')],'callerid':this[_0x9dfe('0xf')][_0x9dfe('0x3a')]})[_0x9dfe('0x16')](function(_0x44e8ac){if(_0x3e4716){_0x3e4716(null,_0x44e8ac);}})[_0x9dfe('0x17')](function(_0x19ea17){if(_0x3e4716){_0x3e4716(_0x19ea17);}});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x3b')]=function(_0x5f425d,_0x2e9072,_0x254bb0,_0x43781b){this[_0x9dfe('0x10')][_0x9dfe('0x3b')]({'uniqueid':this[_0x9dfe('0xf')]['uniqueid'],'callerid':this[_0x9dfe('0xf')][_0x9dfe('0x3a')],'calleridname':this[_0x9dfe('0xf')][_0x9dfe('0x3c')],'context':this[_0x9dfe('0xf')][_0x9dfe('0x3d')],'extension':this['channel'][_0x9dfe('0x3e')],'priority':this[_0x9dfe('0xf')][_0x9dfe('0x3f')],'accountcode':this[_0x9dfe('0xf')][_0x9dfe('0x40')],'dnid':this[_0x9dfe('0xf')][_0x9dfe('0x41')],'projectName':this[_0x9dfe('0xf')][_0x9dfe('0x39')],'saveName':_0x2e9072,'filename':_0x5f425d[_0x9dfe('0x42')]||_0x2e9072,'savePath':_0x254bb0})[_0x9dfe('0x16')](function(_0x323ac3){_0x43781b(null,_0x323ac3);})[_0x9dfe('0x17')](function(_0x474fa9){_0x43781b(_0x474fa9);});};AGIVertices[_0x9dfe('0x1a')]['createSquareMessage']=function(_0x2c9c7a,_0x26cd05,_0x5cfd37,_0x5e3ff6,_0x11cf64){this[_0x9dfe('0x10')]['createSquareMessage']({'uniqueid':this['channel']['uniqueid'],'body':_0x2c9c7a,'direction':_0x26cd05,'providerName':_0x5cfd37,'providerResponse':_0x5e3ff6})[_0x9dfe('0x16')](function(_0x3e6678){if(_0x11cf64){_0x11cf64(null,_0x3e6678);}})[_0x9dfe('0x17')](function(_0x3db0b6){if(_0x11cf64){_0x11cf64(_0x3db0b6);}});};AGIVertices['prototype'][_0x9dfe('0x43')]=function(_0x3b6f0c,_0x1fa0e1){this[_0x9dfe('0x10')][_0x9dfe('0x43')]({'firstName':_['isEmpty'](_0x3b6f0c[_0x9dfe('0x13')])||_[_0x9dfe('0x44')](_0x3b6f0c['name'])?_0x9dfe('0x45')+Math[_0x9dfe('0x46')]():_0x3b6f0c['name'],'lastName':_[_0x9dfe('0x47')](_0x3b6f0c[_0x9dfe('0x48')])||_[_0x9dfe('0x44')](_0x3b6f0c['lastName'])?null:_0x3b6f0c[_0x9dfe('0x48')],'phone':_0x3b6f0c[_0x9dfe('0x49')],'ListId':_0x3b6f0c['list_id'],'scheduledat':_0x3b6f0c['scheduledAt'],'callbackUniqueid':this[_0x9dfe('0xf')]['uniqueid'],'tags':'callback','description':_0x9dfe('0x4a')+_0x3b6f0c[_0x9dfe('0x4b')][_0x9dfe('0x4c')](),'priority':_0x3b6f0c['callback_priority']})['then'](function(_0x15e6e0){_0x1fa0e1(null,_0x15e6e0);})[_0x9dfe('0x17')](function(_0x40b179){_0x1fa0e1(_0x40b179);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x4d')]=function(_0x314bc9,_0x33fdfe){this['rpc'][_0x9dfe('0x4e')](_0x314bc9)[_0x9dfe('0x16')](function(_0x36f855){_0x33fdfe(null,_0x36f855?_0x36f855['name']:![]);})[_0x9dfe('0x17')](function(_0x599097){_0x33fdfe(_0x599097);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x4f')]=function(_0x3d38d9,_0x76d361,_0x351ec7){var _0x535979={'role':_0x9dfe('0x50')};_0x535979[_0x3d38d9]=this[_0x9dfe('0xf')][_0x9dfe('0x3a')];this[_0x9dfe('0x10')][_0x9dfe('0x4f')](_0x535979,_0x76d361,this[_0x9dfe('0xf')][_0x9dfe('0x38')])[_0x9dfe('0x16')](function(_0x12b44c){_0x351ec7(null,_[_0x9dfe('0x44')](_0x12b44c)?![]:!![]);})[_0x9dfe('0x17')](function(_0x5d70fc){logger[_0x9dfe('0x2e')](_0x5d70fc);_0x351ec7(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x27191a,_0x21d2da){var _0x46b622={'role':'agent'};_0x46b622[_0x27191a]=this['channel'][_0x9dfe('0x3a')];this[_0x9dfe('0x10')][_0x9dfe('0x51')](_0x46b622)[_0x9dfe('0x16')](function(_0x33624c){_0x21d2da(null,_[_0x9dfe('0x44')](_0x33624c)?![]:!![]);})[_0x9dfe('0x17')](function(_0x5c281e){logger[_0x9dfe('0x2e')](_0x5c281e);_0x21d2da(null,![]);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x52')]=function(_0x78c8d4,_0x54f59e){var _0x5a9508={'role':_0x9dfe('0x50')};_0x5a9508[_0x78c8d4]=this[_0x9dfe('0xf')][_0x9dfe('0x3a')];this[_0x9dfe('0x10')][_0x9dfe('0x52')](_0x5a9508)[_0x9dfe('0x16')](function(_0x3b2745){_0x54f59e(null,_[_0x9dfe('0x44')](_0x3b2745)?![]:!![]);})[_0x9dfe('0x17')](function(_0x14cb3d){logger[_0x9dfe('0x2e')](_0x14cb3d);_0x54f59e(null,![]);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x53')]=function(_0x598b11,_0x54e57e){var _0x3aeab2={'role':_0x9dfe('0x50')};_0x3aeab2[_0x598b11]=this[_0x9dfe('0xf')]['callerid'];var _0x55e2f8=_0x598b11!=_0x9dfe('0x54')?util['format'](_0x9dfe('0x55'),_0x9dfe('0x56'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')]):undefined;this[_0x9dfe('0x10')][_0x9dfe('0x53')](_0x3aeab2,_0x55e2f8)[_0x9dfe('0x16')](function(_0x9be71f){_0x54e57e(null,_[_0x9dfe('0x44')](_0x9be71f)?![]:!![]);})[_0x9dfe('0x17')](function(_0x47131f){logger['error'](_0x47131f);_0x54e57e(null,![]);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x57')]=function(_0x4914f0,_0x567c27){sh[_0x9dfe('0x58')](_[_0x9dfe('0x59')](_0x4914f0),function(_0x1f1ae0,_0x201020){var _0x1586b0=_0x201020[_0x9dfe('0x5a')](/(\r\n|\n|\r)/gm,'');_0x567c27(null,_0x1586b0);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x3681b7,_0x149769){scripts[_0x9dfe('0x5b')](_0x3681b7[_0x9dfe('0x5c')],_0x3681b7[_0x9dfe('0x5d')]||_0x9dfe('0x5e'),_0x3681b7[_0x9dfe('0x5e')],_0x3681b7['languageCode']||_0x9dfe('0x5f'),_0x3681b7['ssmlGender']||'MALE',_0x3681b7[_0x9dfe('0x60')]||_0x9dfe('0x61'))[_0x9dfe('0x16')](function(_0x5f4443){_0x149769(null,_0x5f4443);})['catch'](function(_0x2dde65){_0x149769(_0x2dde65);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x62')]=function(_0x4d4ba5,_0x15d876){scripts[_0x9dfe('0x62')](_0x4d4ba5[_0x9dfe('0x5e')],_0x4d4ba5[_0x9dfe('0x63')]||'en',0x1)['then'](function(_0x13b790){_0x15d876(null,_0x13b790);})[_0x9dfe('0x17')](function(_0x220128){_0x15d876(_0x220128);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x64')]=function(_0x55deca,_0x534dab){var _0x4b43f1={'uri':_0x55deca['url'],'method':_0x55deca['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x55deca[_0x9dfe('0x65')])===_0x9dfe('0x66')&&parseInt(_0x55deca[_0x9dfe('0x65')])>=0x1?parseInt(_0x55deca[_0x9dfe('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x9dfe('0x67')]([_0x9dfe('0x68'),_0x9dfe('0x69')],_0x4b43f1[_0x9dfe('0x6a')][_0x9dfe('0x6b')]())){try{_0x4b43f1[_0x9dfe('0x6c')]=_0x55deca[_0x9dfe('0xc')]?JSON[_0x9dfe('0x6d')](_0x55deca[_0x9dfe('0xc')]):{};}catch(_0x2afd38){logger['error'](_0x9dfe('0x6e'),_0x2afd38);}}try{_0x4b43f1['headers']=_0x55deca[_0x9dfe('0xb')]?JSON[_0x9dfe('0x6d')](_0x55deca[_0x9dfe('0xb')]):{};}catch(_0xf3ad56){logger[_0x9dfe('0x2e')](_0x9dfe('0x6f'),_0xf3ad56);}if(_0x55deca[_0x9dfe('0x70')]){try{var _0x17f493=require(_0x55deca['computedVariables'])[_0x9dfe('0x71')](this,_0x4b43f1);_0x4b43f1[_0x9dfe('0x72')]=Mustache[_0x9dfe('0x73')](_0x55deca['url'],_0x17f493,{},['$$','$$']);if(_0x4b43f1[_0x9dfe('0x74')]){_0x4b43f1[_0x9dfe('0x74')]=JSON[_0x9dfe('0x6d')](Mustache['render'](JSON[_0x9dfe('0x75')](_0x4b43f1['headers']),_0x17f493,{},['$$','$$']));}if(_0x4b43f1[_0x9dfe('0x6c')]){_0x4b43f1['body']=JSON['parse'](Mustache[_0x9dfe('0x73')](JSON[_0x9dfe('0x75')](_0x4b43f1[_0x9dfe('0x6c')]),_0x17f493,{},['$$','$$']));}}catch(_0x19411a){logger[_0x9dfe('0x2e')](_0x9dfe('0x76'),_0x19411a);}}rp(_0x4b43f1)[_0x9dfe('0x16')](function(_0xc88949){var _0x425c86={'statusCode':_0xc88949[_0x9dfe('0x77')]||0xc8,'statusMessage':_0xc88949[_0x9dfe('0x78')]||'OK','headers':_0xc88949[_0x9dfe('0x74')]||{},'body':_0xc88949[_0x9dfe('0x6c')]||{}};_0x534dab(null,_0x425c86);})[_0x9dfe('0x17')](function(_0x448215){var _0x5cbc41={'statusCode':_0x448215[_0x9dfe('0x77')]||0x1f4,'statusMessage':_0x448215['message']||_0x9dfe('0x79'),'headers':_0x448215[_0x9dfe('0x7a')]['headers']||{},'body':_0x448215['options'][_0x9dfe('0x6c')]||{}};_0x534dab(null,_0x5cbc41);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x7b')]=function(_0xe64439,_0x251ee5){scripts[_0x9dfe('0x7b')](this[_0x9dfe('0xf')][_0x9dfe('0x38')],_0xe64439['key'],_0xe64439[_0x9dfe('0x5e')],_0xe64439[_0x9dfe('0x7c')]||'en')['then'](function(_0x4d9bff){_0x251ee5(null,_0x4d9bff);})[_0x9dfe('0x17')](function(_0x427c0){_0x251ee5(_0x427c0);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x7d')]=function(_0x62b1ce,_0x4ba806){scripts[_0x9dfe('0x7d')](this['channel']['uniqueid'],_0x62b1ce[_0x9dfe('0x7e')],_0x62b1ce[_0x9dfe('0x7f')],_0x62b1ce[_0x9dfe('0x80')],_0x62b1ce[_0x9dfe('0x5e')],_0x62b1ce[_0x9dfe('0x81')]||'en')['then'](function(_0x5352ba){_0x4ba806(null,_0x5352ba);})[_0x9dfe('0x17')](function(_0x33ed6a){_0x4ba806(_0x33ed6a);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x82')]=function(_0x3812b3,_0x3c7f86){scripts[_0x9dfe('0x82')](this[_0x9dfe('0xf')],_0x3812b3)[_0x9dfe('0x16')](function(_0x4bee0d){_0x3c7f86(null,_0x4bee0d);})[_0x9dfe('0x17')](function(_0x270b59){_0x3c7f86(_0x270b59);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x83')]=function(_0x2ffadd,_0x2b8594){scripts[_0x9dfe('0x83')](_0x2ffadd['key'],_0x2ffadd[_0x9dfe('0x5e')],_0x2ffadd[_0x9dfe('0x84')]||_0x9dfe('0x5f'),_0x2ffadd['speed'])[_0x9dfe('0x16')](function(_0x8482fe){_0x2b8594(null,_0x8482fe);})['catch'](function(_0x24377b){_0x2b8594(_0x24377b);});};AGIVertices['prototype'][_0x9dfe('0x85')]=function(_0x39345d,_0xf8633b,_0x2e0b7c){scripts['ispeechASR'](_0xf8633b,_0x39345d[_0x9dfe('0x86')],_0x39345d['ispeech_asr_language']||_0x9dfe('0x5f'),this[_0x9dfe('0x87')](_0x39345d[_0x9dfe('0x88')])?_0x39345d[_0x9dfe('0x88')]:undefined)['then'](function(_0x18c43f){_0x2e0b7c(null,_0x18c43f);})[_0x9dfe('0x17')](function(_0x5b00c8){_0x2e0b7c(_0x5b00c8);});};AGIVertices['prototype']['awsPolly']=function(_0x4f4150,_0x496fba){scripts[_0x9dfe('0x89')](_0x4f4150[_0x9dfe('0x8a')],_0x4f4150['aws_secret_access_key'],_0x4f4150[_0x9dfe('0x8b')],_0x4f4150['aws_polly_voice']||_0x9dfe('0x8c'),_0x4f4150[_0x9dfe('0x5e')],_0x4f4150[_0x9dfe('0x8d')]||_0x9dfe('0x5e'))[_0x9dfe('0x16')](function(_0x2dc66e){_0x496fba(null,_0x2dc66e);})[_0x9dfe('0x17')](function(_0x6f802f){_0x496fba(_0x6f802f);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x8e')]=function(_0xcdc19e,_0xb48d3b){scripts['awsLex'](this[_0x9dfe('0xf')]['uniqueid'],_0xcdc19e[_0x9dfe('0x8a')],_0xcdc19e[_0x9dfe('0x8f')],_0xcdc19e['aws_lex_region'],_0xcdc19e[_0x9dfe('0x5e')],_0xcdc19e[_0x9dfe('0x90')])[_0x9dfe('0x16')](function(_0x4572a0){_0xb48d3b(null,_0x4572a0);})[_0x9dfe('0x17')](function(_0x5e954e){_0xb48d3b(_0x5e954e);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x91')]=function(_0x25780c,_0x325e48,_0x5cd134){scripts['googleASR'](_0x325e48,_0x25780c[_0x9dfe('0x86')],_0x25780c['google_asr_language']||_0x9dfe('0x5f'))['then'](function(_0x478375){_0x5cd134(null,_0x478375);})[_0x9dfe('0x17')](function(_0x4b7567){_0x5cd134(_0x4b7567);});};AGIVertices['prototype'][_0x9dfe('0x92')]=function(_0x40f3d0,_0x43bc73,_0x2c43d3){scripts[_0x9dfe('0x92')](_0x43bc73,_0x40f3d0['appid'],_0x40f3d0[_0x9dfe('0x93')],_0x40f3d0[_0x9dfe('0x72')])[_0x9dfe('0x16')](function(_0x398b03){_0x2c43d3(null,_0x398b03);})[_0x9dfe('0x17')](function(_0x2e61c9){_0x2c43d3(_0x2e61c9);});};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x94')]=function(_0x1aa176){var _0x4c0978=_[_0x9dfe('0x67')](verticesWithRetry,_0x1aa176['agicommand'])?_0x1aa176:_['clone'](_0x1aa176);for(var _0x139440 in _0x4c0978){if(_0x4c0978[_0x9dfe('0x95')](_0x139440)){if(_0x4c0978[_0x139440]&&_[_0x9dfe('0x96')](_0x4c0978[_0x139440])){if(_[_0x9dfe('0x67')](recursiveMapAttributes,_0x139440)){_0x4c0978[_0x139440]=this[_0x9dfe('0x97')](_0x4c0978[_0x139440]);}else{_0x4c0978[_0x139440]=this[_0x9dfe('0x98')](_0x4c0978[_0x139440]);}}}}return _0x4c0978;};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x99')]=function(_0x54ea0b){for(var _0x25ceae in _0x54ea0b){if(_0x54ea0b[_0x9dfe('0x95')](_0x25ceae)){if(_['isPlainObject'](_0x54ea0b[_0x25ceae])){this[_0x9dfe('0x99')](_0x54ea0b[_0x25ceae]);}else if(_[_0x9dfe('0x9a')](_0x54ea0b[_0x25ceae])){for(var _0x56f10e=0x0;_0x56f10e<_0x54ea0b[_0x25ceae][_0x9dfe('0x9b')];_0x56f10e++){this[_0x9dfe('0x99')](_0x54ea0b[_0x25ceae][_0x56f10e]);}}else if(_[_0x9dfe('0x96')](_0x54ea0b[_0x25ceae])){_0x54ea0b[_0x25ceae]=this[_0x9dfe('0x98')](_0x54ea0b[_0x25ceae]);}}}};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x9c')]=function(_0x14ae96,_0x2fb106){for(var _0x4a913e in _0x14ae96){if(_0x14ae96[_0x9dfe('0x95')](_0x4a913e)){if(_[_0x9dfe('0x9d')](_0x14ae96[_0x4a913e])){if(!_['isEmpty'](_0x14ae96[_0x4a913e])){this[_0x9dfe('0x9c')](_0x14ae96[_0x4a913e],util[_0x9dfe('0x2b')](_0x9dfe('0x9e'),_0x2fb106,_0x4a913e));}}else if(_[_0x9dfe('0x9a')](_0x14ae96[_0x4a913e])){for(var _0x5ce4e3=0x0;_0x5ce4e3<_0x14ae96[_0x4a913e][_0x9dfe('0x9b')];_0x5ce4e3++){this[_0x9dfe('0x9c')](_0x14ae96[_0x4a913e][_0x5ce4e3],util[_0x9dfe('0x2b')]('%s.%s',_0x2fb106,_0x4a913e+'['+_0x5ce4e3+']'));}}else{if(!_['isNil'](_0x14ae96[_0x4a913e])){this['channel'][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0x9e'),_0x2fb106,_0x4a913e),_0x14ae96[_0x4a913e]);}}}}};AGIVertices[_0x9dfe('0x1a')]['replaceObjectAllVariables']=function(_0x4ba9d3){try{var _0x49b5d4=JSON[_0x9dfe('0x6d')](_0x4ba9d3);this['recursiveNodeIndex'](_0x49b5d4);return JSON['stringify'](_0x49b5d4);}catch(_0x2a4631){return this['replaceAllVariables'](_0x4ba9d3);}};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x98')]=function(_0x23ecb9){var _0x3f11f8=_0x23ecb9['split']('{');for(var _0x469d13=0x1;_0x469d13<_0x3f11f8[_0x9dfe('0x9b')];_0x469d13+=0x1){var _0x481dd9=_0x3f11f8[_0x469d13]['split']('}');if(_0x481dd9[_0x9dfe('0x9b')]>0x1){_0x23ecb9=_0x23ecb9[_0x9dfe('0xa0')]('{'+_0x481dd9[0x0]+'}',this[_0x9dfe('0xf')]['getVariable'](_0x481dd9[0x0])[_0x9dfe('0xa1')]||_0x481dd9[0x0]);}}if(_0x3f11f8[_0x9dfe('0x9b')]===0x1){return _0x23ecb9[_0x9dfe('0x4c')]();}return this['replaceAllVariables'](_0x23ecb9);};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xa2')]=function(_0x46aa59,_0x15e64f){var _0x464e5a=this[_0x9dfe('0xf')][_0x9dfe('0x12')](_0x46aa59);if(_0x464e5a['result']===-0x1){return _0x464e5a;}logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x15e64f,_0x464e5a[_0x9dfe('0xa1')]));return this[_0x9dfe('0xf')][_0x9dfe('0x9f')](_0x15e64f,_0x464e5a[_0x9dfe('0xa1')]);};AGIVertices['prototype']['isConfigured']=function(_0x557bc3){return _0x557bc3&&_0x557bc3!=='0'&&_0x557bc3!=='-1'&&_0x557bc3!=='';};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xa3')]=function(_0x3b28b1){this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0x3b28b1,'-');_0x3b28b1['retry']=_0x3b28b1[_0x9dfe('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xa4')]=function(_0x137c14){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x137c14[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x137c14['text'])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}var _0x1c194b='\x22'+_0x137c14['text']+'\x22';if(this['isConfigured'](_0x137c14[_0x9dfe('0x7a')])){_0x1c194b+=','+_0x137c14['options'];}var _0x38cd80=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x9dfe('0xa8'),_0x1c194b);if(_0x38cd80[_0x9dfe('0xa9')]===-0x1){return _0x38cd80;}return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')](_0x9dfe('0xaa'),_0x1c194b));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xab')]=function(_0x1cdbdc){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1cdbdc[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x1cdbdc[_0x9dfe('0xac')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xad'));}var _0xe42ee8=_0x1cdbdc[_0x9dfe('0xac')];if(this[_0x9dfe('0x87')](_0x1cdbdc[_0x9dfe('0x7a')])){_0xe42ee8+=','+_0x1cdbdc[_0x9dfe('0x7a')];}var _0x336112=this[_0x9dfe('0xf')][_0x9dfe('0x58')]('MRCPRecog',_0xe42ee8);if(_0x336112[_0x9dfe('0xa9')]===-0x1){return _0x336112;}var _0x29e1df=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9dfe('0xae'));if(_0x29e1df[_0x9dfe('0xa9')]===-0x1){return _0x29e1df;}var _0x234fd4=this['getAndSetVariable'](_0x9dfe('0xaf'),_0x9dfe('0xb0'));if(_0x234fd4[_0x9dfe('0xa9')]===-0x1){return _0x234fd4;}var _0x58ea59=this['getAndSetVariable']('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x58ea59['result']===-0x1){return _0x58ea59;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0xb1'),_0xe42ee8));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x6')]=function(_0x382d5d){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0xb2'),_0x382d5d[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')]['agi']([_0x382d5d[_0x9dfe('0xb3')],_0x382d5d[_0x9dfe('0xb4')]]);};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xb5')]=function(_0x40aa89){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xb6'),_0x40aa89['label']));if(this[_0x9dfe('0x87')](_0x40aa89[_0x9dfe('0x65')])){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xb7'),_0x40aa89['timeout']));var _0x279c98=this['channel'][_0x9dfe('0xb8')](_0x40aa89[_0x9dfe('0x65')]);if(_0x279c98[_0x9dfe('0xa9')]===-0x1){return _0x279c98;}}return this[_0x9dfe('0xf')][_0x9dfe('0xb5')]();};AGIVertices['prototype'][_0x9dfe('0xb9')]=function(_0x129370){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xba'),_0x129370['label']));if(!this[_0x9dfe('0x87')](_0x129370[_0x9dfe('0xbb')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x129370,_0x9dfe('0xbc'));}_0x129370['scheduledAt']=moment();if(this['isConfigured'](_0x129370[_0x9dfe('0xbd')])){_0x129370[_0x9dfe('0x4b')]=moment()[_0x9dfe('0xbe')](_0x129370[_0x9dfe('0xbd')],_0x9dfe('0xbf'));}if(!this[_0x9dfe('0x87')](_0x129370[_0x9dfe('0xc0')])){_0x129370['callback_priority']=0x2;}this[_0x9dfe('0x43')][_0x9dfe('0x71')](this,_0x129370);return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')](_0x9dfe('0xc1'),_0x129370[_0x9dfe('0x49')],_0x129370[_0x9dfe('0xbb')],_0x129370[_0x9dfe('0x4b')]));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xc2')]=function(_0x56e7bf){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xc3'),_0x56e7bf[_0x9dfe('0xa5')]));var _0x2bcadd=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x56e7bf['application'],_0x56e7bf[_0x9dfe('0x7a')]);if(_0x2bcadd[_0x9dfe('0xa9')]===-0x1){return _0x2bcadd;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('Executed\x20command\x20%s\x20%s',_0x56e7bf[_0x9dfe('0xc4')],_0x56e7bf[_0x9dfe('0x7a')]));};AGIVertices['prototype'][_0x9dfe('0xc5')]=function(_0x36cab0){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x36cab0[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x36cab0[_0x9dfe('0x5e')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}var _0x533933='\x22'+_0x36cab0['text']+'\x22';if(this[_0x9dfe('0x87')](_0x36cab0[_0x9dfe('0x7a')])){_0x533933+=','+_0x36cab0[_0x9dfe('0x7a')];}var _0xe7add8=this[_0x9dfe('0xf')][_0x9dfe('0x58')]('MRCPSynth',_0x533933);if(_0xe7add8[_0x9dfe('0xa9')]===-0x1){return _0xe7add8;}return this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0xaa'),_0x533933));};AGIVertices[_0x9dfe('0x1a')]['sestektts']=function(_0x2dbb36){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0xc6'),_0x2dbb36['label']));if(!this[_0x9dfe('0x87')](_0x2dbb36[_0x9dfe('0x5e')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}var _0x440b34='\x22'+_0x2dbb36[_0x9dfe('0x5e')]+'\x22';if(this['isConfigured'](_0x2dbb36[_0x9dfe('0x7a')])){_0x440b34+=','+_0x2dbb36[_0x9dfe('0x7a')];}var _0xb65030=this['channel'][_0x9dfe('0x58')](_0x9dfe('0xa8'),_0x440b34);if(_0xb65030[_0x9dfe('0xa9')]===-0x1){return _0xb65030;}return this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x440b34));};AGIVertices[_0x9dfe('0x1a')]['lumenvoxasr']=function(_0xbb9ac5){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xc7'),_0xbb9ac5[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0xbb9ac5[_0x9dfe('0xac')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0xad'));}var _0x315e69=_0xbb9ac5[_0x9dfe('0xac')];if(this[_0x9dfe('0x87')](_0xbb9ac5[_0x9dfe('0x7a')])){_0x315e69+=','+_0xbb9ac5['options'];}var _0x4a6512=this['channel'][_0x9dfe('0x58')](_0x9dfe('0xc8'),_0x315e69);if(_0x4a6512[_0x9dfe('0xa9')]===-0x1){return _0x4a6512;}var _0xee53d9=this[_0x9dfe('0xa2')](_0x9dfe('0xc9'),_0x9dfe('0xca'));if(_0xee53d9[_0x9dfe('0xa9')]===-0x1){return _0xee53d9;}var _0x43214d=this[_0x9dfe('0xa2')](_0x9dfe('0xaf'),_0x9dfe('0xcb'));if(_0x43214d['result']===-0x1){return _0x43214d;}var _0x2627c7=this[_0x9dfe('0xa2')](_0x9dfe('0xcc'),_0x9dfe('0xcd'));if(_0x2627c7[_0x9dfe('0xa9')]===-0x1){return _0x2627c7;}return this[_0x9dfe('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x315e69));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xce')]=function(_0x45dd8e){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xcf'),_0x45dd8e[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x45dd8e[_0x9dfe('0xac')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0xad'));}var _0x132801=_0x45dd8e[_0x9dfe('0xac')];if(this[_0x9dfe('0x87')](_0x45dd8e[_0x9dfe('0x7a')])){_0x132801+=','+_0x45dd8e[_0x9dfe('0x7a')];}var _0x51716b=this['channel'][_0x9dfe('0x58')](_0x9dfe('0xc8'),_0x132801);if(_0x51716b[_0x9dfe('0xa9')]===-0x1){return _0x51716b;}var _0x363c54=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9dfe('0xd0'));if(_0x363c54[_0x9dfe('0xa9')]===-0x1){return _0x363c54;}var _0x313660=this['getAndSetVariable']('RECOG_INPUT()',_0x9dfe('0xd1'));if(_0x313660[_0x9dfe('0xa9')]===-0x1){return _0x313660;}var _0x2b659f=this[_0x9dfe('0xa2')](_0x9dfe('0xcc'),_0x9dfe('0xd2'));if(_0x2b659f[_0x9dfe('0xa9')]===-0x1){return _0x2b659f;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0xb1'),_0x132801));};AGIVertices[_0x9dfe('0x1a')]['database']=function(_0x247cbb){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xd3'),_0x247cbb[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x247cbb[_0x9dfe('0xd4')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x247cbb,_0x9dfe('0xd5'));}var _0x4a75ea=this[_0x9dfe('0x1b')]['sync'](this,_0x247cbb[_0x9dfe('0xd4')]);if(!_0x4a75ea){return this['channel'][_0x9dfe('0x2e')](_0x247cbb,_0x9dfe('0xd6'));}if(!this[_0x9dfe('0x87')](_0x247cbb[_0x9dfe('0x32')])){return this['channel']['error'](_0x247cbb,_0x9dfe('0xd7'));}var _0x521eef=_0x247cbb[_0x9dfe('0x32')][_0x9dfe('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0xd8'),_0x521eef));var _0x2625c2=this[_0x9dfe('0xd9')][_0x9dfe('0x71')](this,_0x4a75ea,_0x521eef);this[_0x9dfe('0x37')]['sync'](this,_0x247cbb,_0x521eef);if(!this['isConfigured'](_0x247cbb[_0x9dfe('0xda')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xdb'));}var _0xe54859=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x247cbb[_0x9dfe('0xda')]);if(!_0xe54859){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x247cbb,'no\x20variable\x20found');}var _0x215782=this;_0x2625c2['forEach'](function(_0x183242,_0x585fca){Object[_0x9dfe('0xdc')](_0x183242)[_0x9dfe('0xdd')](function(_0x21a804){_0x215782[_0x9dfe('0xf')][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')]('%s[%s][%s]',_0xe54859,_0x585fca,_0x21a804),_0x183242[_0x21a804]);});});this[_0x9dfe('0xf')][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0xde'),_0xe54859),_0x2625c2['length']);return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')]('variable\x20%s\x20set',_0xe54859));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xdf')]=function(_0x2fd76d){logger['debug'](util[_0x9dfe('0x2b')](_0x9dfe('0xe0'),_0x2fd76d[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x2fd76d[_0x9dfe('0xe1')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x2fd76d,'no\x20user\x20selected');}var _0x32ccee=this[_0x9dfe('0x1e')][_0x9dfe('0x71')](this,_0x2fd76d[_0x9dfe('0xe1')]);if(!_0x32ccee){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x2fd76d,_0x9dfe('0xe2'));}var _0x12dc4c=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x9dfe('0xe3'),[util[_0x9dfe('0x2b')](_0x9dfe('0xe4'),_0x32ccee),_0x2fd76d['timeout'],_0x2fd76d[_0x9dfe('0xe5')],_0x2fd76d['url']]);if(_0x12dc4c[_0x9dfe('0xa9')]===-0x1){return _0x12dc4c;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format'](_0x9dfe('0xe6'),_0x9dfe('0xe3')));};AGIVertices['prototype'][_0x9dfe('0xe7')]=function(_0x35e515){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xe8'),_0x35e515[_0x9dfe('0xa5')]));if(!this['isConfigured'](_0x35e515[_0x9dfe('0x86')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xe9'));}if(!this[_0x9dfe('0x87')](_0x35e515[_0x9dfe('0x5e')])){return this['channel'][_0x9dfe('0xa6')]('no\x20text\x20configured');}this[_0x9dfe('0xf')][_0x9dfe('0xea')]=!![];this['createSquareDetailsReport'](_0x35e515);this[_0x9dfe('0xeb')](_0x35e515[_0x9dfe('0x5e')],'in','','');this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0xec'),_0x35e515[_0x9dfe('0x5e')]));var _0x264879=this['googleDialogflow'][_0x9dfe('0x71')](this,_0x35e515);if(_0x264879){for(var _0x2abfeb in _0x264879){if(_0x264879[_0x9dfe('0x95')](_0x2abfeb)){this[_0x9dfe('0xf')]['setVariable'](util['format'](_0x9dfe('0xed'),_0x2abfeb['toUpperCase']()),_0x264879[_0x2abfeb]);}}this[_0x9dfe('0xeb')](_0x264879['speech'],_0x9dfe('0xee'),'dialogflow','');return this['channel'][_0x9dfe('0xa6')](util['format'](_0x9dfe('0xef'),_0x264879[_0x9dfe('0xf0')]));}return this['channel'][_0x9dfe('0x2e')](_0x35e515,_0x9dfe('0xf1'));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xf2')]=function(_0x908f4b){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x908f4b[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x908f4b['dialogflowV2_project_id'])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x908f4b['client_email'])){return this[_0x9dfe('0xf')]['noop'](_0x9dfe('0xf3'));}if(!this[_0x9dfe('0x87')](_0x908f4b['private_key'])){return this[_0x9dfe('0xf')]['noop'](_0x9dfe('0xf4'));}if(!this[_0x9dfe('0x87')](_0x908f4b['dialogflowV2_language'])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xf5'));}if(!this[_0x9dfe('0x87')](_0x908f4b['text'])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}this[_0x9dfe('0xf')][_0x9dfe('0xea')]=!![];this[_0x9dfe('0x37')](_0x908f4b);this[_0x9dfe('0xeb')](_0x908f4b[_0x9dfe('0x5e')],'in','','');this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0xf6'),_0x908f4b[_0x9dfe('0x5e')]));var _0x4bcda5=this[_0x9dfe('0x7d')][_0x9dfe('0x71')](this,_0x908f4b);if(_0x4bcda5){for(var _0xf85cc3 in _0x4bcda5){if(_0x4bcda5[_0x9dfe('0x95')](_0xf85cc3)){if(_0xf85cc3!==_0x9dfe('0xf7')){this[_0x9dfe('0xf')][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')]('DIALOGFLOW_%s',_0xf85cc3[_0x9dfe('0x6b')]()),_0x4bcda5[_0xf85cc3]);}}}this[_0x9dfe('0xeb')](_0x4bcda5[_0x9dfe('0xf0')],'out',_0x9dfe('0xf2'),_0x4bcda5[_0x9dfe('0xf7')]);return this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('DialogflowV2\x20Result\x20%s',_0x4bcda5['speech']));}return this['channel'][_0x9dfe('0x2e')](_0x908f4b,_0x9dfe('0xf8'));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xf9')]=function(_0xb232c5){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0xfa'),_0xb232c5[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0xb232c5[_0x9dfe('0xfb')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0xfc'));}if(!this['isConfigured'](_0xb232c5[_0x9dfe('0xfd')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xfe'));}if(!this[_0x9dfe('0x87')](_0xb232c5[_0x9dfe('0xff')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0x100'));}if(!this[_0x9dfe('0x87')](_0xb232c5[_0x9dfe('0x101')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')]('no\x20text\x20configured');}this[_0x9dfe('0xf')][_0x9dfe('0xea')]=!![];this['createSquareDetailsReport'](_0xb232c5);this[_0x9dfe('0xeb')](_0xb232c5[_0x9dfe('0x5e')],'in','','');this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x102'),_0xb232c5['text']));var _0x566ab7=this[_0x9dfe('0x82')][_0x9dfe('0x71')](this,_0xb232c5);if(_0x566ab7){for(var _0x2dbc55 in _0x566ab7){if(_0x566ab7[_0x9dfe('0x95')](_0x2dbc55)){this[_0x9dfe('0xf')][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0x103'),_0x2dbc55[_0x9dfe('0x6b')]()),_0x566ab7[_0x2dbc55]);}}this[_0x9dfe('0xeb')](_0x566ab7[_0x9dfe('0xf0')],_0x9dfe('0xee'),_0x9dfe('0xf9'),'');if(_0x566ab7[_0x9dfe('0x104')]){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x566ab7[_0x9dfe('0x104')]));var _0x17c7d3=this[_0x9dfe('0xf')]['streamFile'](_0x566ab7['audiofile']);try{fs['unlink'](_0x566ab7[_0x9dfe('0x104')]+_0x9dfe('0x105'));}catch(_0x276bf3){logger[_0x9dfe('0x2e')](_0x276bf3);}return _0x17c7d3;}else{return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format']('SestekNDA\x20Result\x20%s',_0x566ab7['speech']));}}return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0xb232c5,_0x9dfe('0x106'));};AGIVertices['prototype'][_0x9dfe('0x107')]=function(_0x27a709){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x108'),_0x27a709[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x107'));};AGIVertices['prototype'][_0x9dfe('0x109')]=function(_0x5cdf94){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x10a'),_0x5cdf94[_0x9dfe('0xa5')]));var _0x29591f='';if(_0x5cdf94[_0x9dfe('0x10b')]){if(!this['isConfigured'](_0x5cdf94[_0x9dfe('0x10b')])){return this['channel'][_0x9dfe('0x2e')](_0x5cdf94,'no\x20trunk\x20selected');}else{var _0xbe7118=parseInt(_0x5cdf94['trunk_id'],0xa);if(isNaN(_0xbe7118)){_0x29591f=_0x5cdf94[_0x9dfe('0x10b')];}else{_0x29591f=this['getTrunk'][_0x9dfe('0x71')](this,_0x5cdf94[_0x9dfe('0x10b')]);if(!_0x29591f){return this['channel']['error'](_0x5cdf94,_0x9dfe('0x10c'));}}}}else if(_0x5cdf94['trunk_name']){_0x29591f=_0x5cdf94[_0x9dfe('0x10d')];}else{return this[_0x9dfe('0xf')]['error'](_0x5cdf94,_0x9dfe('0x10e'));}var _0xa43e2=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x9dfe('0xe3'),[util['format'](_0x9dfe('0x10f'),_0x29591f,_0x5cdf94[_0x9dfe('0x49')]),_0x5cdf94[_0x9dfe('0x65')],_0x5cdf94[_0x9dfe('0xe5')],_0x5cdf94[_0x9dfe('0x110')]]);if(_0xa43e2['result']===-0x1){return _0xa43e2;}return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')](_0x9dfe('0xe6'),_0x9dfe('0xe3')));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x111')]=function(_0xfc14a9){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x112'),_0xfc14a9[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x111'));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xd')]=function(_0x27cee3){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x113'),_0x27cee3[_0x9dfe('0xa5')]));if(_0x27cee3[_0x9dfe('0x114')]===0x0){return this[_0x9dfe('0xa3')](_0x27cee3);}_0x27cee3[_0x9dfe('0x114')]-=0x1;if(!this['isConfigured'](_0x27cee3[_0x9dfe('0x115')])){return this['channel'][_0x9dfe('0x2e')](_0x27cee3,_0x9dfe('0x116'));}var _0x35054e=this[_0x9dfe('0x117')]['sync'](this,_0x27cee3[_0x9dfe('0x115')]);if(!_0x35054e){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x27cee3,_0x9dfe('0x118'));}if(!this[_0x9dfe('0x87')](_0x27cee3['variable_id'])){return this['channel'][_0x9dfe('0x2e')](_0x9dfe('0xdb'));}var _0x1822b0=this[_0x9dfe('0xf')][_0x9dfe('0x119')](_0x35054e,_0x27cee3[_0x9dfe('0x11a')],_0x27cee3[_0x9dfe('0x11b')]);var _0x2fa014=_0x1822b0['result']?_0x1822b0[_0x9dfe('0xa9')][_0x9dfe('0x4c')]():'';logger[_0x9dfe('0x30')](_0x9dfe('0x11c'),JSON[_0x9dfe('0x75')](_0x1822b0));if(_0x1822b0['result']===-0x1){this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0x27cee3,_0x2fa014);return _0x1822b0;}else if(_0x1822b0['extra']===_0x9dfe('0x65')){_0x1822b0[_0x9dfe('0xa9')]=_0x2fa014[_0x9dfe('0x9b')]>=parseInt(_0x27cee3[_0x9dfe('0x11d')])?'x':'i';}else{_0x1822b0[_0x9dfe('0xa9')]=_0x2fa014[_0x9dfe('0x9b')]>=parseInt(_0x27cee3['mindigit'])&&_0x2fa014[_0x9dfe('0x9b')]<=parseInt(_0x27cee3[_0x9dfe('0x11b')])?'x':'i';}var _0x7f3fe=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x27cee3[_0x9dfe('0xda')]);if(!_0x7f3fe){return this[_0x9dfe('0xf')]['error'](_0x27cee3,'no\x20variable\x20found');}this[_0x9dfe('0xf')][_0x9dfe('0x9f')](_0x7f3fe,_0x2fa014);if(this[_0x9dfe('0x87')](_0x27cee3[_0x9dfe('0x11e')])){var _0x43287c=parseInt(_0x27cee3['hiddendigitsnum'],0xa);var _0x2953e2=rs['generate']({'charset':'*','length':_0x43287c});var _0x55acf5=_0x2fa014[_0x9dfe('0x9b')];if(_0x55acf5>0x0){if(_0x55acf5>_0x43287c){this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0x27cee3,_0x27cee3[_0x9dfe('0x11f')]===_0x9dfe('0x120')?_0x2953e2+_0x2fa014[_0x9dfe('0x121')](_0x43287c):_0x2fa014[_0x9dfe('0x121')](0x0,_0x55acf5-_0x43287c)+_0x2953e2);}else{this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0x27cee3,rs['generate']({'charset':'*','length':_0x55acf5}));}}else{this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0x27cee3,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x27cee3,_0x2fa014);}return _0x1822b0;};AGIVertices[_0x9dfe('0x1a')]['getsecretdigits']=function(_0x2b87cb){logger[_0x9dfe('0x30')](util['format'](_0x9dfe('0x122'),_0x2b87cb[_0x9dfe('0xa5')]));return this[_0x9dfe('0xd')](_0x2b87cb);};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x123')]=function(_0xa44259){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xa44259[_0x9dfe('0xa5')]));this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0xa44259,_0xa44259[_0x9dfe('0x124')]);return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x125'),_0xa44259[_0x9dfe('0x124')]));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x126')]=function(_0x407ffc){logger[_0x9dfe('0x30')](util['format'](_0x9dfe('0x127'),_0x407ffc[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x407ffc[_0x9dfe('0x8a')])||!this[_0x9dfe('0x87')](_0x407ffc[_0x9dfe('0x8f')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x9dfe('0x87')](_0x407ffc[_0x9dfe('0x5e')])){return this['channel'][_0x9dfe('0xa6')]('no\x20text\x20configured');}this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('Trying\x20aws\x20Polly\x20%s',_0x407ffc[_0x9dfe('0x5e')]));var _0x56d54f=this[_0x9dfe('0x89')][_0x9dfe('0x71')](this,_0x407ffc);if(_0x56d54f){this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x128'),_0x56d54f));var _0xe4bf05=this[_0x9dfe('0xf')][_0x9dfe('0x129')](_0x56d54f);try{fs[_0x9dfe('0x12a')](_0x56d54f+_0x9dfe('0x105'));}catch(_0x5a6ea0){logger[_0x9dfe('0x2e')](_0x5a6ea0);}return _0xe4bf05;}return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x407ffc,_0x9dfe('0x12b'));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x12c')]=function(_0x32cc9d){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x12d'),_0x32cc9d[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x32cc9d[_0x9dfe('0x8a')])||!this[_0x9dfe('0x87')](_0x32cc9d[_0x9dfe('0x8f')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x12e'));}if(!this[_0x9dfe('0x87')](_0x32cc9d[_0x9dfe('0x90')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0x12f'));}if(!this[_0x9dfe('0x87')](_0x32cc9d[_0x9dfe('0x5e')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}this[_0x9dfe('0xf')][_0x9dfe('0xea')]=!![];this[_0x9dfe('0x37')](_0x32cc9d);this[_0x9dfe('0xeb')](_0x32cc9d['text'],'in','','');this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('Trying\x20Amazon\x20Lex:\x20%s',_0x32cc9d[_0x9dfe('0x5e')]));var _0x2da1bd=this[_0x9dfe('0x8e')]['sync'](this,_0x32cc9d);if(_0x2da1bd){for(var _0x1f3f1e in _0x2da1bd){if(_0x2da1bd[_0x9dfe('0x95')](_0x1f3f1e)&&_[_0x9dfe('0x96')](_0x2da1bd[_0x1f3f1e])){this['channel'][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0x130'),_0x1f3f1e[_0x9dfe('0x6b')]()),_0x2da1bd[_0x1f3f1e]);}}if(_[_0x9dfe('0x44')](_0x2da1bd[_0x9dfe('0x131')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x132'));}else{this['createSquareMessage'](_0x2da1bd[_0x9dfe('0x131')],_0x9dfe('0xee'),_0x9dfe('0x133'),'');return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x2da1bd[_0x9dfe('0x131')]));}}return this[_0x9dfe('0xf')]['error'](_0x32cc9d,_0x9dfe('0x134'));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x135')]=function(_0xdbbb70){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x136'),_0xdbbb70['label'],_0xdbbb70[_0x9dfe('0x65')]));if(!this[_0x9dfe('0x87')](_0xdbbb70[_0x9dfe('0x86')])){return this['channel']['noop'](_0x9dfe('0xe9'));}var _0x31bd3a=_0x9dfe('0x137');var _0x5242ef=util[_0x9dfe('0x2b')](_0x9dfe('0x138'),FILES_PATH,rs[_0x9dfe('0x139')](0x4));var _0x3b2aa7=util[_0x9dfe('0x2b')](_0x9dfe('0x9e'),_0x5242ef,_0x31bd3a);var _0x561793=!![];if(_0xdbbb70[_0x9dfe('0x13a')]===_0x9dfe('0x13b')){_0x561793=![];}var _0x1dba61=this[_0x9dfe('0xf')][_0x9dfe('0x13c')](_0x5242ef,_0x31bd3a,_0xdbbb70[_0x9dfe('0x13d')],_0xdbbb70[_0x9dfe('0x65')],undefined,_0x561793);if(_0x1dba61[_0x9dfe('0xa9')]!==-0x1){this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x13e'),_0x3b2aa7));var _0x38129f=this[_0x9dfe('0x91')][_0x9dfe('0x71')](this,_0xdbbb70,_0x3b2aa7);if(_0x38129f){for(var _0x1bbbfe in _0x38129f){if(_0x38129f[_0x9dfe('0x95')](_0x1bbbfe)){this[_0x9dfe('0xf')][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0x13f'),_0x1bbbfe[_0x9dfe('0x6b')]()),_0x38129f[_0x1bbbfe]);}}return this['channel']['noop'](util['format'](_0x9dfe('0x140'),JSON['stringify'](_0x38129f)));}}return _0x1dba61;};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x141')]=function(_0x2cd28e){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x142'),_0x2cd28e[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x2cd28e[_0x9dfe('0x143')])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0x144'));}if(!this[_0x9dfe('0x87')](_0x2cd28e[_0x9dfe('0x93')])){return this[_0x9dfe('0xf')]['noop'](_0x9dfe('0x145'));}var _0x2a9357=_0x9dfe('0x137');var _0x2311a5=util[_0x9dfe('0x2b')](_0x9dfe('0x138'),FILES_PATH,rs[_0x9dfe('0x139')](0x4));var _0x487c8d=util[_0x9dfe('0x2b')]('%s.%s',_0x2311a5,_0x2a9357);var _0x95bb35=!![];if(_0x2cd28e[_0x9dfe('0x13a')]==='NOBEEP'){_0x95bb35=![];}var _0x20c3a5=this['channel']['recordFile'](_0x2311a5,_0x2a9357,_0x2cd28e[_0x9dfe('0x13d')],_0x2cd28e[_0x9dfe('0x65')],undefined,_0x95bb35);if(_0x20c3a5[_0x9dfe('0xa9')]!==-0x1){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x146'),_0x487c8d));var _0x5ef56c=this['tildeASR'][_0x9dfe('0x71')](this,_0x2cd28e,_0x487c8d);if(_0x5ef56c){for(var _0x13f5d7 in _0x5ef56c){if(_0x5ef56c['hasOwnProperty'](_0x13f5d7)){this[_0x9dfe('0xf')][_0x9dfe('0x9f')](util['format'](_0x9dfe('0x147'),_0x13f5d7[_0x9dfe('0x6b')]()),_0x5ef56c[_0x13f5d7]);}}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x148'),JSON[_0x9dfe('0x75')](_0x5ef56c)));}}return _0x20c3a5;};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x149')]=function(_0x2c36e1){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x14a'),_0x2c36e1[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')][_0x9dfe('0x14b')](_0x2c36e1[_0x9dfe('0x3d')],_0x2c36e1['extension'],_0x2c36e1[_0x9dfe('0x3f')]);};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x14c')]=function(_0x44fb8b){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x14d'),_0x44fb8b[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x44fb8b['condition'])){return this['channel'][_0x9dfe('0x2e')](_0x44fb8b,_0x9dfe('0x14e'));}try{var _0x4646e5=eval(_0x44fb8b[_0x9dfe('0x14f')])?'true':_0x9dfe('0x150');this[_0x9dfe('0xf')]['noop'](util['format'](_0x9dfe('0x151'),_0x44fb8b[_0x9dfe('0x14f')],_0x4646e5));return{'code':0xc8,'result':_0x4646e5};}catch(_0x547688){return{'code':0xc8,'result':_0x9dfe('0x150')};}};AGIVertices['prototype'][_0x9dfe('0x152')]=function(_0x495269){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x153'),_0x495269[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x495269[_0x9dfe('0x154')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x495269,_0x9dfe('0x155'));}var _0x3254a1=this[_0x9dfe('0x156')][_0x9dfe('0x71')](this,_0x495269['interval_id']);if(!_0x3254a1){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x495269,_0x9dfe('0x157'));}for(var _0x4bc4cc=0x0;_0x4bc4cc<_0x3254a1['length'];_0x4bc4cc+=0x1){var _0x24d539=this[_0x9dfe('0xf')][_0x9dfe('0x12')](util[_0x9dfe('0x2b')]('IFTIME(%s?true:false)',_0x3254a1[_0x4bc4cc]));if(_0x24d539[_0x9dfe('0xa9')]===-0x1){return _0x24d539;}logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('IFTIME\x20%s\x20%s',_0x3254a1[_0x4bc4cc],_0x24d539[_0x9dfe('0xa1')]));if(_0x24d539['extra']===_0x9dfe('0x158')){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('IFTIME\x20%s\x20%s',_0x3254a1[_0x4bc4cc],_0x9dfe('0x158')));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x159'),_0x3254a1[_0x4bc4cc],_0x9dfe('0x158')));return{'code':0xc8,'result':_0x9dfe('0x158')};}else{logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x159'),_0x3254a1[_0x4bc4cc],'false'));this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x159'),_0x3254a1[_0x4bc4cc],_0x9dfe('0x150')));}}return{'code':0xc8,'result':_0x9dfe('0x150')};};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x15a')]=function(_0x506a62){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x15b'),_0x506a62['label']));return this[_0x9dfe('0xf')][_0x9dfe('0x15a')]();};AGIVertices[_0x9dfe('0x1a')]['ispeechasr']=function(_0x39d910){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x15c'),_0x39d910[_0x9dfe('0xa5')]));if(!this['isConfigured'](_0x39d910[_0x9dfe('0x86')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xe9'));}var _0x1eec5f=_0x9dfe('0x137');var _0x2a2904=util[_0x9dfe('0x2b')](_0x9dfe('0x138'),FILES_PATH,rs[_0x9dfe('0x139')](0x4));var _0x3fdd26=util[_0x9dfe('0x2b')](_0x9dfe('0x9e'),_0x2a2904,_0x1eec5f);var _0x489a9c=!![];if(_0x39d910['beep']===_0x9dfe('0x13b')){_0x489a9c=![];}var _0x3b03ee=this[_0x9dfe('0xf')]['recordFile'](_0x2a2904,_0x1eec5f,_0x39d910[_0x9dfe('0x13d')],_0x39d910['timeout'],undefined,_0x489a9c);if(_0x3b03ee[_0x9dfe('0xa9')]!==-0x1){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format']('ispeech\x20%s\x20file\x20created',_0x3fdd26));var _0x237099=this[_0x9dfe('0x85')]['sync'](this,_0x39d910,_0x3fdd26);if(_0x237099){for(var _0x4d9589 in _0x237099){if(_0x237099[_0x9dfe('0x95')](_0x4d9589)){this[_0x9dfe('0xf')][_0x9dfe('0x9f')](util['format'](_0x9dfe('0x15d'),_0x4d9589[_0x9dfe('0x6b')]()),_0x237099[_0x4d9589]);}}return this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x15e'),JSON['stringify'](_0x237099)));}}return _0x3b03ee;};AGIVertices[_0x9dfe('0x1a')]['ispeechtts']=function(_0x4b5045){logger['info'](util['format'](_0x9dfe('0x15f'),_0x4b5045[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x4b5045[_0x9dfe('0x86')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xe9'));}if(!this['isConfigured'](_0x4b5045[_0x9dfe('0x5e')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x160'),_0x4b5045['text']));var _0x46a7ea=this[_0x9dfe('0x83')]['sync'](this,_0x4b5045);if(_0x46a7ea){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('ispeech\x20%s\x20file\x20created',_0x46a7ea));var _0x5a2c23=this['channel'][_0x9dfe('0x129')](_0x46a7ea,_0x4b5045[_0x9dfe('0x13d')]);try{fs['unlink'](_0x46a7ea+_0x9dfe('0x105'));}catch(_0x251fa6){logger['error'](_0x251fa6);}return _0x5a2c23;}return this[_0x9dfe('0xf')]['error'](_0x4b5045,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x9dfe('0x161')]=function(_0x27efeb){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x162'),_0x27efeb[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x27efeb[_0x9dfe('0x163')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x27efeb,_0x9dfe('0x164'));}logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x27efeb[_0x9dfe('0x163')]));var _0x107577=this[_0x9dfe('0x53')][_0x9dfe('0x71')](this,_0x27efeb['findBy']);if(_0x107577){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x165'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x27efeb[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x165'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x27efeb[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x166')};}else{logger['info'](util[_0x9dfe('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x27efeb[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x27efeb[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x167')};}};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x168')]=function(_0x30eb1f){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x30eb1f[_0x9dfe('0xa5')]));if(!this['isConfigured'](_0x30eb1f[_0x9dfe('0x163')])){return this[_0x9dfe('0xf')]['error'](_0x30eb1f,_0x9dfe('0x164'));}logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x169'),this['channel'][_0x9dfe('0x3a')],_0x30eb1f[_0x9dfe('0x163')]));var _0x3a1289=this['agentLogout'][_0x9dfe('0x71')](this,_0x30eb1f['findBy']);if(_0x3a1289){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x165'),this['channel'][_0x9dfe('0x3a')],_0x30eb1f[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x30eb1f[_0x9dfe('0x163')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9dfe('0x30')](util['format'](_0x9dfe('0x16a'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x30eb1f[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x16a'),this[_0x9dfe('0xf')]['callerid'],_0x30eb1f[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x167')};}};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x16b')]=function(_0x113a77){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x113a77['label']));if(!this[_0x9dfe('0x87')](_0x113a77[_0x9dfe('0x16c')])){return this['channel'][_0x9dfe('0x2e')](_0x113a77,_0x9dfe('0x16d'));}this['channel'][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x16e'),_0x113a77[_0x9dfe('0x16c')]));var _0x2dd955=eval(_0x113a77['operation']);if(!this[_0x9dfe('0x87')](_0x113a77[_0x9dfe('0xda')])){return this['channel']['noop'](_0x9dfe('0xdb'));}var _0x37da63=this[_0x9dfe('0x12')]['sync'](this,_0x113a77[_0x9dfe('0xda')]);if(!_0x37da63){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x113a77,_0x9dfe('0x16f'));}if(_['isArray'](_0x2dd955)){var _0xfeda92=this;_0x2dd955['forEach'](function(_0x56a65c,_0x45c0aa){_0xfeda92[_0x9dfe('0xf')][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0x170'),_0x37da63,_0x45c0aa),_0x56a65c);});return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('variable\x20%s[key]\x20set',_0x37da63));}else{return this[_0x9dfe('0xf')][_0x9dfe('0x9f')](_0x37da63,_0x2dd955);}};AGIVertices['prototype']['menu']=function(_0x3eb134){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x171'),_0x3eb134[_0x9dfe('0xa5')]));if(_0x3eb134['retry']===0x0){return this[_0x9dfe('0xa3')](_0x3eb134);}_0x3eb134[_0x9dfe('0x114')]-=0x1;if(!this['isConfigured'](_0x3eb134['file_id'])){return this[_0x9dfe('0xf')]['error'](_0x3eb134,_0x9dfe('0x116'));}var _0x2da74c=this[_0x9dfe('0x117')][_0x9dfe('0x71')](this,_0x3eb134['file_id']);if(!_0x2da74c){return this[_0x9dfe('0xf')]['error'](_0x3eb134,_0x9dfe('0x118'));}var _0x5aa392=this[_0x9dfe('0xf')][_0x9dfe('0x119')](_0x2da74c,_0x3eb134[_0x9dfe('0x11a')],_0x3eb134[_0x9dfe('0x172')]);var _0x22f386=_0x5aa392[_0x9dfe('0xa9')];if(_0x5aa392[_0x9dfe('0xa9')]===-0x1){this[_0x9dfe('0x37')][_0x9dfe('0x71')](this,_0x3eb134,'-1');return _0x5aa392;}else if(_0x5aa392['extra']===_0x9dfe('0x65')){_0x5aa392[_0x9dfe('0xa9')]=_0x5aa392[_0x9dfe('0xa9')][_0x9dfe('0x9b')]>0x0?_0x5aa392['result']:'t';}else if(_['isEmpty'](_0x5aa392[_0x9dfe('0xa9')])){_0x5aa392[_0x9dfe('0xa9')]='#';_0x22f386='#';}if(!this[_0x9dfe('0x87')](_0x3eb134[_0x9dfe('0xda')])){this['channel'][_0x9dfe('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xa33eaf=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x3eb134[_0x9dfe('0xda')]);if(!_0xa33eaf){return this['channel'][_0x9dfe('0x2e')](_0x3eb134,_0x9dfe('0x16f'));}this[_0x9dfe('0xf')][_0x9dfe('0x9f')](_0xa33eaf,_0x22f386);}this['createSquareDetailsReport'][_0x9dfe('0x71')](this,_0x3eb134,_0x22f386);return _0x5aa392;};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0xa6')]=function(_0x2b041b){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x173'),_0x2b041b[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x2b041b[_0x9dfe('0x174')]||_0x2b041b['label']);};AGIVertices['prototype'][_0x9dfe('0x175')]=function(_0x272ec7){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x176'),_0x272ec7['label']));if(!this[_0x9dfe('0x87')](_0x272ec7[_0x9dfe('0x163')])){return this['channel'][_0x9dfe('0x2e')](_0x272ec7,_0x9dfe('0x164'));}logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x169'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x272ec7[_0x9dfe('0x163')]));var _0x20a1f3=this[_0x9dfe('0x4d')]['sync'](this,_0x272ec7[_0x9dfe('0x177')]);var _0x3f3972=this[_0x9dfe('0x4f')]['sync'](this,_0x272ec7[_0x9dfe('0x163')],_0x20a1f3);if(_0x3f3972){logger[_0x9dfe('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x272ec7[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x165'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x272ec7[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x166')};}else{logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x16a'),this['channel'][_0x9dfe('0x3a')],_0x272ec7[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x272ec7[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x167')};}};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x178')]=function(_0x6ac0ff){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x179'),_0x6ac0ff[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x6ac0ff[_0x9dfe('0x115')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x6ac0ff,'no\x20file\x20audio\x20selected');}var _0x43a2f5=this[_0x9dfe('0x117')][_0x9dfe('0x71')](this,_0x6ac0ff[_0x9dfe('0x115')]);if(!_0x43a2f5){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x6ac0ff,_0x9dfe('0x118'));}var _0x7ca58d=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x9dfe('0x17a'),[_0x43a2f5,_0x6ac0ff[_0x9dfe('0xe5')]]);if(_0x7ca58d[_0x9dfe('0xa9')]===-0x1){return _0x7ca58d;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')]('Executed\x20command\x20%s\x20%s',_0x9dfe('0x17a'),_0x43a2f5));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x17b')]=function(_0x584209){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x17c'),_0x584209['label']));if(!this[_0x9dfe('0x87')](_0x584209['queue_id'])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x584209,'no\x20queue\x20selected');}var _0x3e03c4='';var _0x53a1a7=parseInt(_0x584209[_0x9dfe('0x17d')],0xa);if(isNaN(_0x53a1a7)){_0x3e03c4=_0x584209['queue_id'];}else{_0x3e03c4=this[_0x9dfe('0x14')][_0x9dfe('0x71')](this,_0x584209[_0x9dfe('0x17d')]);if(!_0x3e03c4){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x584209,_0x9dfe('0x17e'));}}var _0x2eb3d6='';if(this[_0x9dfe('0x87')](_0x584209['file_id'])){var _0x19c9bd=this['getSound'][_0x9dfe('0x71')](this,_0x584209[_0x9dfe('0x115')]);if(_0x19c9bd){_0x2eb3d6=_0x19c9bd;}}this[_0x9dfe('0x37')]['sync'](this,_0x584209,_0x3e03c4);if(_0x584209[_0x9dfe('0xe5')][_0x9dfe('0x17f')]('x')<0x0){_0x584209[_0x9dfe('0xe5')]+='x';}if(_0x584209[_0x9dfe('0xe5')][_0x9dfe('0x17f')]('X')<0x0){_0x584209['opts']+='X';}this[_0x9dfe('0xf')]['setVariable']('XMCS-QUEUE',_0x3e03c4?_0x3e03c4['toLowerCase']():'');var _0x3f2fd9=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x9dfe('0x180'),[_0x3e03c4,_0x584209[_0x9dfe('0xe5')],_0x584209['url'],_0x2eb3d6,_0x584209[_0x9dfe('0x65')],_0x584209['agi'],_0x584209[_0x9dfe('0x181')],_0x584209[_0x9dfe('0x182')],'',_0x584209[_0x9dfe('0x183')]]);if(_0x3f2fd9[_0x9dfe('0xa9')]===-0x1){return _0x3f2fd9;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x184'),_0x9dfe('0x180'),_0x3e03c4));};AGIVertices['prototype'][_0x9dfe('0x185')]=function(_0x13f9a9){logger['info'](util['format'](_0x9dfe('0x186'),_0x13f9a9[_0x9dfe('0xa5')]));var _0x1870d7=_0x13f9a9['recordingFormat']||_0x9dfe('0x137');var _0x19e3b3=util[_0x9dfe('0x2b')](_0x9dfe('0x187'),this[_0x9dfe('0xf')][_0x9dfe('0x38')],rs['generate'](0x5));var _0x220b6f=util[_0x9dfe('0x2b')](_0x9dfe('0x188'),FILES_PATH,_0x19e3b3,_0x1870d7);var _0x22d96d=util[_0x9dfe('0x2b')](_0x9dfe('0x138'),FILES_PATH,_0x19e3b3);this[_0x9dfe('0x3b')]['sync'](this,_0x13f9a9,_0x19e3b3,_0x220b6f);this[_0x9dfe('0xf')]['setVariable'](_0x9dfe('0x189'),_0x19e3b3);logger[_0x9dfe('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x22d96d,_0x1870d7,_0x13f9a9['escape_digits'],_0x13f9a9[_0x9dfe('0x65')]);return this[_0x9dfe('0xf')][_0x9dfe('0x13c')](_0x22d96d,_0x1870d7,_0x13f9a9[_0x9dfe('0x18a')],_0x13f9a9[_0x9dfe('0x65')],undefined,!![]);};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x18b')]=function(_0x13408e){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x18c'),_0x13408e['label']));if(!this[_0x9dfe('0x87')](_0x13408e[_0x9dfe('0x110')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')]('no\x20url\x20configured');}var _0xebe3=this[_0x9dfe('0x64')]['sync'](this,_0x13408e);logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x18d'),util[_0x9dfe('0x18e')](_0xebe3,{'showHidden':![],'depth':null})));if(!this[_0x9dfe('0x87')](_0x13408e[_0x9dfe('0xda')])){return this[_0x9dfe('0xf')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x5e851e=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x13408e[_0x9dfe('0xda')]);if(!_0x5e851e){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x13408e,_0x9dfe('0x16f'));}this['channel'][_0x9dfe('0x9f')](util[_0x9dfe('0x2b')](_0x9dfe('0x18f'),_0x5e851e),_0xebe3['statusCode']?_0xebe3['statusCode']:_0x9dfe('0x190'));this['channel']['setVariable'](util[_0x9dfe('0x2b')]('%s_STATUS_MESSAGE',_0x5e851e),_0xebe3[_0x9dfe('0x78')]?_0xebe3[_0x9dfe('0x78')]:'OK');if(_0xebe3['body']){try{this[_0x9dfe('0x9c')](_0xebe3[_0x9dfe('0x6c')],_0x5e851e);}catch(_0x26a7b6){logger[_0x9dfe('0x2e')](util[_0x9dfe('0x2b')](_0x9dfe('0x191'),_0x5e851e));}}return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')](_0x9dfe('0x192'),_0x5e851e));};AGIVertices[_0x9dfe('0x1a')]['saydigits']=function(_0x4521c4){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x193'),_0x4521c4[_0x9dfe('0xa5')]));return this['channel']['sayDigits'](_0x4521c4[_0x9dfe('0x194')][_0x9dfe('0x5a')](/\s+/g,''),_0x4521c4['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x50773f){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x50773f['label']));return this[_0x9dfe('0xf')][_0x9dfe('0x195')](_0x50773f[_0x9dfe('0x66')][_0x9dfe('0x5a')](/\s+/g,''),_0x50773f[_0x9dfe('0x18a')]);};AGIVertices[_0x9dfe('0x1a')]['sayphonetic']=function(_0x212a4b){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x196'),_0x212a4b[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')][_0x9dfe('0x197')](_0x212a4b[_0x9dfe('0x5e')],_0x212a4b[_0x9dfe('0x18a')]);};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x198')]=function(_0x5e5434){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x5e5434['label']));if(!this['isConfigured'](_0x5e5434['account_id'])){return this['channel'][_0x9dfe('0xa6')](_0x9dfe('0x199'));}var _0x540413=this[_0x9dfe('0x23')][_0x9dfe('0x71')](this,_0x5e5434[_0x9dfe('0x19a')]);if(!_0x540413||!_0x540413[_0x9dfe('0x19b')]){return this['channel'][_0x9dfe('0x2e')](_0x5e5434,_0x9dfe('0x19c'));}var _0x4e4848={'from':util[_0x9dfe('0x2b')](_0x9dfe('0x19d'),_0x540413[_0x9dfe('0x13')],_0x540413['email']||_0x540413[_0x9dfe('0x19b')]['user']),'to':_0x5e5434['to']||'','cc':_0x5e5434['cc']||'','bcc':_0x5e5434[_0x9dfe('0x19e')]||'','subject':_0x5e5434[_0x9dfe('0x19f')],'html':_0x5e5434['text'],'text':_0x5e5434[_0x9dfe('0x5e')]};if(this[_0x9dfe('0x87')](_0x5e5434[_0x9dfe('0x1a0')])){}logger[_0x9dfe('0x1a1')]('sendMail\x20message',JSON[_0x9dfe('0x75')](_0x4e4848));this['createSquareDetailsReport'][_0x9dfe('0x71')](this,_0x5e5434,_0x5e5434[_0x9dfe('0x19a')]);this['channel'][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x1a2'),_0x540413[_0x9dfe('0x13')]));this[_0x9dfe('0x24')][_0x9dfe('0x71')](this,_0x540413[_0x9dfe('0x1a3')],_0x4e4848);return this[_0x9dfe('0xf')][_0x9dfe('0xa6')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x1a4')]=function(_0x228e2a){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x228e2a[_0x9dfe('0xa5')]));return this[_0x9dfe('0xf')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x9dfe('0x1a5')]=function(_0x583657){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x583657[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x583657['sms_account_id'])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x1a6'));}var _0x5540f8=this[_0x9dfe('0x35')][_0x9dfe('0x71')](this,_0x583657[_0x9dfe('0x1a7')]);if(!_0x5540f8){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x583657,_0x9dfe('0x1a8'));}var _0x1f93f5={'body':_0x583657[_0x9dfe('0x1a9')],'phone':_0x583657['to']||'','SmsAccountId':_0x5540f8['id']};logger[_0x9dfe('0x1a1')]('sendSMS\x20message',JSON[_0x9dfe('0x75')](_0x1f93f5));this['createSquareDetailsReport'][_0x9dfe('0x71')](this,_0x583657,_0x583657['sms_account_id']);this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x1aa'),_0x5540f8[_0x9dfe('0x13')]));this['createSmsMessage']['sync'](this,_0x1f93f5);return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x1ab'));};AGIVertices['prototype'][_0x9dfe('0x1ac')]=function(_0x362343){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x1ad'),_0x362343[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x362343[_0x9dfe('0xda')])){return this['channel'][_0x9dfe('0x2e')](_0x362343,_0x9dfe('0x1ae'));}var _0x1e3471=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x362343[_0x9dfe('0xda')]);if(!_0x1e3471){return this[_0x9dfe('0xf')]['error'](_0x362343,'no\x20variable\x20found');}return this[_0x9dfe('0xf')][_0x9dfe('0x9f')](_0x1e3471,_0x362343[_0x9dfe('0x1af')]);};AGIVertices[_0x9dfe('0x1a')]['start']=function(_0x5f447e){logger[_0x9dfe('0x30')](util['format'](_0x9dfe('0x1b0'),_0x5f447e[_0x9dfe('0xa5')]));this['channel']['noop'](_0x9dfe('0x1b1'));if(_0x5f447e['answer']===_0x9dfe('0x1b2')){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x1b3'));return this[_0x9dfe('0xf')][_0x9dfe('0xb5')]();}return this[_0x9dfe('0xf')]['noop'](_0x9dfe('0x1b4'));};AGIVertices['prototype'][_0x9dfe('0x1b5')]=function(_0x3b841b){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x1b6'),_0x3b841b['label']));if(!this[_0x9dfe('0x87')](_0x3b841b[_0x9dfe('0x1b7')])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x3b841b,_0x9dfe('0x1b8'));}var _0x284c50=this[_0x9dfe('0x18')][_0x9dfe('0x71')](this,_0x3b841b[_0x9dfe('0x1b7')]);if(!this['isConfigured'](_0x284c50)){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x3b841b,util['format'](_0x9dfe('0x1b9'),_0x3b841b[_0x9dfe('0x1b7')]));}if(_0x284c50===this['channel'][_0x9dfe('0x39')]){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x3b841b,_0x9dfe('0x1ba'));}this['createSquareDetailsReport'][_0x9dfe('0x71')](this,_0x3b841b,_0x284c50);var _0x4114b7=this[_0x9dfe('0xf')][_0x9dfe('0x58')](_0x9dfe('0x1bb'),util[_0x9dfe('0x2b')](_0x9dfe('0x1bc'),config[_0x9dfe('0x6')][_0x9dfe('0x1bd')]||_0x9dfe('0x1be'),_0x284c50,this[_0x9dfe('0xf')][_0x9dfe('0x39')]));if(_0x4114b7['result']===-0x1){return _0x4114b7;}return this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x184'),_0x9dfe('0x1bb'),_0x284c50));};AGIVertices['prototype']['system']=function(_0x3169bd){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x1bf'),_0x3169bd[_0x9dfe('0xa5')]));var _0x260a40=this[_0x9dfe('0x57')]['sync'](this,_0x3169bd[_0x9dfe('0xb3')]);this['createSquareDetailsReport'][_0x9dfe('0x71')](this,_0x3169bd,_0x3169bd[_0x9dfe('0xb3')]);if(this[_0x9dfe('0x87')](_0x3169bd[_0x9dfe('0xda')])){var _0xe4d973=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x3169bd[_0x9dfe('0xda')]);if(_0xe4d973){this[_0x9dfe('0xf')][_0x9dfe('0x9f')](_0xe4d973,_0x260a40);return this['channel']['noop'](util[_0x9dfe('0x2b')](_0x9dfe('0x1c0'),_0x3169bd[_0x9dfe('0xb3')],_0xe4d973));}}return this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3169bd['command']));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x1c1')]=function(_0x1ce108){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x1c2'),_0x1ce108[_0x9dfe('0xa5')]));_0x1ce108['text']=_0x1ce108['text'][_0x9dfe('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1ce108[_0x9dfe('0x5c')])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0x1c3'));}if(!this[_0x9dfe('0x87')](_0x1ce108['text'])){return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](_0x9dfe('0xa7'));}this['channel'][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x1c4'),_0x1ce108['text']));var _0x1cf382=this[_0x9dfe('0x5b')]['sync'](this,_0x1ce108);if(_0x1cf382){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x1c5'),_0x1cf382));var _0x474add=this['channel'][_0x9dfe('0x129')](_0x1cf382);try{fs['unlink'](_0x1cf382+_0x9dfe('0x105'));}catch(_0x341556){logger[_0x9dfe('0x2e')](_0x341556);}return _0x474add;}return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x1ce108,_0x9dfe('0x1c6'));};AGIVertices['prototype'][_0x9dfe('0x1c7')]=function(_0x42ec7b){logger[_0x9dfe('0x30')](util['format'](_0x9dfe('0x1c8'),_0x42ec7b[_0x9dfe('0xa5')]));_0x42ec7b['text']=_0x42ec7b['text'][_0x9dfe('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9dfe('0x87')](_0x42ec7b[_0x9dfe('0x5e')])){return this['channel']['noop'](_0x9dfe('0xa7'));}this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x1c9'),_0x42ec7b[_0x9dfe('0x5e')]));var _0x530cea=this[_0x9dfe('0x62')][_0x9dfe('0x71')](this,_0x42ec7b);if(_0x530cea){this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x530cea));var _0x70f0c2=this['channel'][_0x9dfe('0x129')](_0x530cea);try{fs[_0x9dfe('0x12a')](_0x530cea+_0x9dfe('0x105'));}catch(_0x210260){logger[_0x9dfe('0x2e')](_0x210260);}return _0x70f0c2;}return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x42ec7b,_0x9dfe('0x1ca'));};AGIVertices[_0x9dfe('0x1a')][_0x9dfe('0x1cb')]=function(_0x552cc6){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x1cc'),_0x552cc6[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x552cc6['findBy'])){return this[_0x9dfe('0xf')]['error'](_0x552cc6,_0x9dfe('0x164'));}logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x552cc6['findBy']));var _0x4394c1=this[_0x9dfe('0x51')]['sync'](this,_0x552cc6[_0x9dfe('0x163')]);if(_0x4394c1){logger['info'](util[_0x9dfe('0x2b')](_0x9dfe('0x165'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x552cc6[_0x9dfe('0x163')]));this[_0x9dfe('0xf')]['noop'](util[_0x9dfe('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x552cc6[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x166')};}else{logger[_0x9dfe('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x552cc6[_0x9dfe('0x163')]));this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util[_0x9dfe('0x2b')](_0x9dfe('0x16a'),this[_0x9dfe('0xf')][_0x9dfe('0x3a')],_0x552cc6[_0x9dfe('0x163')]));return{'code':0xc8,'result':_0x9dfe('0x167')};}};AGIVertices['prototype']['voicemail']=function(_0x5dd067){logger[_0x9dfe('0x30')](util[_0x9dfe('0x2b')](_0x9dfe('0x1cd'),_0x5dd067[_0x9dfe('0xa5')]));var _0x3608b9=this['channel'][_0x9dfe('0x58')](_0x9dfe('0x1ce'),[_0x5dd067[_0x9dfe('0x1cf')],_0x5dd067[_0x9dfe('0x7a')]]);if(_0x3608b9['result']===-0x1){return _0x3608b9;}return this[_0x9dfe('0xf')][_0x9dfe('0xa6')](util['format'](_0x9dfe('0x184'),_0x9dfe('0x1ce'),_0x5dd067['mailbox']));};AGIVertices['prototype'][_0x9dfe('0x1d0')]=function(_0x5d6479){logger['info'](util['format'](_0x9dfe('0x1d1'),_0x5d6479[_0x9dfe('0xa5')]));if(!this[_0x9dfe('0x87')](_0x5d6479['variable_id'])){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x5d6479,_0x9dfe('0x1ae'));}var _0x3543b3=this[_0x9dfe('0x12')][_0x9dfe('0x71')](this,_0x5d6479[_0x9dfe('0xda')]);if(!_0x3543b3){return this[_0x9dfe('0xf')][_0x9dfe('0x2e')](_0x5d6479,_0x9dfe('0x16f'));}var _0x45aa3b=this[_0x9dfe('0xf')]['getVariable'](_0x3543b3);return{'code':0xc8,'result':_0x45aa3b[_0x9dfe('0xa1')]?_0x45aa3b['extra']:'-'};};String[_0x9dfe('0x1a')][_0x9dfe('0xa0')]=function(_0x28a9c7,_0x471722){return this[_0x9dfe('0x1d2')](_0x28a9c7)['join'](_0x471722);};module[_0x9dfe('0x1d3')]=AGIVertices;
\ No newline at end of file
index fd581f6..5b07009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa036=['syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','mandatoryDispositionPause','name','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20%s','message','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','syncHangupRequest','syncHangup','agentringnoanswer'];(function(_0x4b2d2b,_0x29988f){var _0x29f31c=function(_0x245b97){while(--_0x245b97){_0x4b2d2b['push'](_0x4b2d2b['shift']());}};_0x29f31c(++_0x29988f);}(_0xa036,0x99));var _0x6a03=function(_0x4e0e49,_0x13359d){_0x4e0e49=_0x4e0e49-0x0;var _0x171f90=_0xa036[_0x4e0e49];return _0x171f90;};'use strict';var _=require('lodash');var moment=require(_0x6a03('0x0'));var ami=require(_0x6a03('0x1'));var logger=require(_0x6a03('0x2'))('acw');var RpcUser=require(_0x6a03('0x3'));var RpcVoiceAgentReport=require(_0x6a03('0x4'));function Acw(_0x2ca693){this['voiceQueues']=_0x2ca693[_0x6a03('0x5')];this[_0x6a03('0x6')]=_0x2ca693[_0x6a03('0x6')];this[_0x6a03('0x7')]=_0x2ca693[_0x6a03('0x7')];this['channels']={};ami['on']('agentconnect',this[_0x6a03('0x8')][_0x6a03('0x9')](this));ami['on']('hanguprequest',this[_0x6a03('0xa')][_0x6a03('0x9')](this));ami['on']('hangup',this[_0x6a03('0xb')][_0x6a03('0x9')](this));ami['on'](_0x6a03('0xc'),this[_0x6a03('0xd')][_0x6a03('0x9')](this));ami['on'](_0x6a03('0xe'),this[_0x6a03('0xf')][_0x6a03('0x9')](this));ami['on'](_0x6a03('0x10'),this[_0x6a03('0x11')][_0x6a03('0x9')](this));ami['on'](_0x6a03('0x12'),this[_0x6a03('0x13')][_0x6a03('0x9')](this));}function getDiff(_0xffccdd){var _0x1729a1=moment()[_0x6a03('0x14')](0x0);var _0x461126=moment(_0xffccdd)['milliseconds'](0x0);return _0x1729a1[_0x6a03('0x15')](_0x461126,_0x6a03('0x16'));}Acw[_0x6a03('0x17')][_0x6a03('0x18')]=function(_0x16c4a6){try{var _0x1c8584=this;var _0x574d59=this[_0x6a03('0x19')][_0x16c4a6][_0x6a03('0x1a')];var _0x366390=this['channels'][_0x16c4a6][_0x6a03('0x1b')];var _0x40daac=this[_0x6a03('0x5')][_0x366390];var _0x51fa67=![];var _0x39fe91='ACW';if(_0x40daac['mandatoryDisposition']){if(_0x40daac[_0x6a03('0x1c')][_0x6a03('0x1d')]){_0x51fa67=!![];_0x39fe91=_0x40daac[_0x6a03('0x1c')][_0x6a03('0x1d')];}}return ami['Action']({'action':_0x6a03('0x1e'),'interface':_0x574d59,'paused':!![],'reason':_0x39fe91})[_0x6a03('0x1f')](function(){if(_0x1c8584['agents'][_0x574d59]){return RpcUser['getAgent'](_0x1c8584[_0x6a03('0x6')][_0x574d59]['id'])[_0x6a03('0x1f')](function(_0x4891a8){if(_0x4891a8&&!_0x4891a8[_0x6a03('0x20')]){logger[_0x6a03('0x21')](_0x6a03('0x22'),_0x16c4a6,_0x574d59,_0x366390);var _0x269538=_0x1c8584[_0x6a03('0x19')][_0x16c4a6][_0x6a03('0x23')]&&_0x1c8584[_0x6a03('0x19')][_0x16c4a6][_0x6a03('0x24')]?_0x1c8584[_0x6a03('0x19')][_0x16c4a6][_0x6a03('0x24')]:_0x16c4a6;return RpcUser[_0x6a03('0x25')](_0x1c8584[_0x6a03('0x6')][_0x574d59],_0x39fe91,_0x269538)['then'](function(){if(!_0x51fa67){_0x1c8584[_0x6a03('0x7')][_0x574d59]={};logger['info'](_0x6a03('0x26'),_0x16c4a6,_0x1c8584[_0x6a03('0x5')][_0x366390][_0x6a03('0x27')],_0x574d59,_0x366390);_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x28')]=setTimeout(_0x1c8584['stopAcw'][_0x6a03('0x9')](_0x1c8584,_0x574d59),_0x1c8584[_0x6a03('0x5')][_0x366390]['acwTimeout']*0x3e8);_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x29')]=moment()[_0x6a03('0x2a')](_0x6a03('0x2b'));_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x2c')]=_0x16c4a6;_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x1b')]=_0x366390;_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x2d')]=function(){var _0x4aa328=getDiff(_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x29')]);clearTimeout(_0x1c8584['timers'][_0x574d59][_0x6a03('0x28')]);_0x1c8584['timers'][_0x574d59]['timer']=![];RpcVoiceAgentReport[_0x6a03('0x2e')]({'acwtime':_0x4aa328},_0x1c8584[_0x6a03('0x7')][_0x574d59][_0x6a03('0x2c')],_0x574d59)[_0x6a03('0x1f')](function(_0x5d1d46){logger[_0x6a03('0x21')](_0x6a03('0x2f'),_0x16c4a6,_0x4aa328,_0x5d1d46);})[_0x6a03('0x30')](function(_0xa82f6a){logger[_0x6a03('0x31')](_0x6a03('0x32'),_0x16c4a6,_0xa82f6a);});delete _0x1c8584[_0x6a03('0x7')][_0x574d59];};}});}else{logger[_0x6a03('0x21')](_0x6a03('0x33'),_0x16c4a6,_0x574d59,_0x366390);}});}})['catch'](function(){logger['error'](_0x6a03('0x26'),_0x16c4a6,_0x1c8584[_0x6a03('0x5')][_0x366390][_0x6a03('0x27')],_0x574d59,_0x366390);})[_0x6a03('0x34')](function(){delete _0x1c8584[_0x6a03('0x19')][_0x16c4a6];});}catch(_0x389240){logger[_0x6a03('0x31')]('[ACW][START]\x20%s',_0x389240['message']);}};Acw[_0x6a03('0x17')]['stopAcw']=function(_0x350054){try{var _0x3ac9ff=this;if(_0x3ac9ff['timers'][_0x350054]){_0x3ac9ff[_0x6a03('0x7')][_0x350054][_0x6a03('0x28')]=![];var _0x1fe922=_0x3ac9ff['timers'][_0x350054]['uniqueid'];var _0x3f4d8e=_0x3ac9ff[_0x6a03('0x7')][_0x350054][_0x6a03('0x1b')];var _0x3f6ceb=_0x3ac9ff[_0x6a03('0x5')][_0x3f4d8e][_0x6a03('0x27')];logger[_0x6a03('0x21')](_0x6a03('0x35'),_0x1fe922,_0x350054);RpcUser[_0x6a03('0x36')](this[_0x6a03('0x6')][_0x350054]);RpcVoiceAgentReport[_0x6a03('0x2e')]({'acwtime':_0x3f6ceb,'agentacw':!![]},_0x1fe922,_0x350054)['then'](function(_0x1aefca){logger[_0x6a03('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x1fe922,_0x3f6ceb,_0x1aefca);})['catch'](function(_0x3c1397){logger[_0x6a03('0x31')](_0x6a03('0x32'),_0x1fe922,_0x3c1397);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x350054);if(_0x3ac9ff[_0x6a03('0x7')]){logger[_0x6a03('0x21')]('[ACW][TIMERS]',JSON['stringify'](_0x3ac9ff[_0x6a03('0x7')]));}}}catch(_0x5ad6f3){logger[_0x6a03('0x31')](_0x6a03('0x37'),_0x5ad6f3[_0x6a03('0x38')]);}};Acw[_0x6a03('0x17')][_0x6a03('0x8')]=function(_0xddcf3b){try{if(this['voiceQueues'][_0xddcf3b[_0x6a03('0x1b')]]&&(this[_0x6a03('0x5')][_0xddcf3b[_0x6a03('0x1b')]]['acw']||this[_0x6a03('0x5')][_0xddcf3b[_0x6a03('0x1b')]][_0x6a03('0x39')])){if(this[_0x6a03('0x6')][_0xddcf3b[_0x6a03('0x1a')]]){this[_0x6a03('0x19')][_0xddcf3b['uniqueid']]={'queue':_0xddcf3b['queue'],'interface':_0xddcf3b[_0x6a03('0x1a')],'destlinkedid':_0xddcf3b[_0x6a03('0x24')]};}}}catch(_0x2473d4){logger[_0x6a03('0x31')](_0x6a03('0x3a'),_0x2473d4[_0x6a03('0x38')]);}};Acw['prototype'][_0x6a03('0x13')]=function(_0x47e8a8){try{if(this[_0x6a03('0x5')][_0x47e8a8[_0x6a03('0x1b')]]&&(this[_0x6a03('0x5')][_0x47e8a8['queue']][_0x6a03('0x3b')]||this[_0x6a03('0x5')][_0x47e8a8[_0x6a03('0x1b')]][_0x6a03('0x39')])){if(this[_0x6a03('0x6')][_0x47e8a8[_0x6a03('0x1a')]]){this[_0x6a03('0x19')][_0x47e8a8[_0x6a03('0x2c')]]={'queue':_0x47e8a8[_0x6a03('0x1b')],'interface':_0x47e8a8[_0x6a03('0x1a')]};}}}catch(_0x190763){logger[_0x6a03('0x31')](_0x6a03('0x3c'),_0x190763['message']);}};Acw[_0x6a03('0x17')][_0x6a03('0xa')]=function(_0x5b27a1){try{if(this[_0x6a03('0x19')][_0x5b27a1[_0x6a03('0x2c')]]&&_[_0x6a03('0x3d')](this[_0x6a03('0x19')][_0x5b27a1[_0x6a03('0x2c')]]['attended'])){logger[_0x6a03('0x21')](_0x6a03('0x3e'),_0x5b27a1[_0x6a03('0x2c')]);this[_0x6a03('0x18')](_0x5b27a1[_0x6a03('0x2c')]);}else if(this[_0x6a03('0x19')][_0x5b27a1[_0x6a03('0x3f')]]&&_[_0x6a03('0x3d')](this[_0x6a03('0x19')][_0x5b27a1[_0x6a03('0x3f')]][_0x6a03('0x23')])){logger[_0x6a03('0x21')](_0x6a03('0x40'),_0x5b27a1[_0x6a03('0x3f')]);this[_0x6a03('0x18')](_0x5b27a1[_0x6a03('0x3f')]);}}catch(_0x518ed5){logger[_0x6a03('0x31')](_0x6a03('0x41'),_0x518ed5[_0x6a03('0x38')]);}};Acw[_0x6a03('0x17')][_0x6a03('0xb')]=function(_0x498d45){try{if(this[_0x6a03('0x19')][_0x498d45[_0x6a03('0x2c')]]&&this[_0x6a03('0x19')][_0x498d45[_0x6a03('0x2c')]]['attended']){logger[_0x6a03('0x21')](_0x6a03('0x42'),_0x498d45[_0x6a03('0x2c')]);this[_0x6a03('0x18')](_0x498d45[_0x6a03('0x2c')]);}else if(this['channels'][_0x498d45[_0x6a03('0x3f')]]&&this[_0x6a03('0x19')][_0x498d45[_0x6a03('0x3f')]][_0x6a03('0x23')]){logger['info'](_0x6a03('0x43'),_0x498d45[_0x6a03('0x3f')]);this['startAcw'](_0x498d45[_0x6a03('0x3f')]);}}catch(_0x3d66ce){logger[_0x6a03('0x31')](_0x6a03('0x44'),_0x3d66ce['message']);}};Acw[_0x6a03('0x17')]['syncAttendedTransfer']=function(_0x490be2){try{if(!_['isNil'](this[_0x6a03('0x19')][_0x490be2[_0x6a03('0x45')]])){this[_0x6a03('0x18')](_0x490be2[_0x6a03('0x45')]);if(this[_0x6a03('0x19')][_0x490be2[_0x6a03('0x46')]]){this[_0x6a03('0x19')][_0x490be2[_0x6a03('0x46')]]['attended']=!![];this[_0x6a03('0x19')][_0x490be2[_0x6a03('0x47')]]=this[_0x6a03('0x19')][_0x490be2['secondtransfereruniqueid']];delete this['channels'][_0x490be2[_0x6a03('0x46')]];}}else if(!_[_0x6a03('0x48')](this['channels'][_0x490be2[_0x6a03('0x47')]])){this[_0x6a03('0x18')](_0x490be2[_0x6a03('0x47')]);if(this['channels'][_0x490be2['origtransfereruniqueid']]){this[_0x6a03('0x19')][_0x490be2[_0x6a03('0x49')]]['attended']=!![];this['channels'][_0x490be2['transfereeuniqueid']]=this[_0x6a03('0x19')][_0x490be2[_0x6a03('0x49')]];delete this[_0x6a03('0x19')][_0x490be2['origtransfereruniqueid']];}}}catch(_0x3036ea){logger[_0x6a03('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0x3036ea[_0x6a03('0x38')]);}};Acw[_0x6a03('0x17')][_0x6a03('0x11')]=function(_0x479d33){try{if(this[_0x6a03('0x19')][_0x479d33['transfereruniqueid']]){logger[_0x6a03('0x21')](_0x6a03('0x4a'),JSON[_0x6a03('0x4b')](_0x479d33[_0x6a03('0x4c')]));this[_0x6a03('0x18')](_0x479d33[_0x6a03('0x4c')]);}else if(this['channels'][_0x479d33[_0x6a03('0x4d')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x479d33['transfererlinkedid']));this[_0x6a03('0x18')](_0x479d33[_0x6a03('0x4d')]);}}catch(_0x320833){logger['error'](_0x6a03('0x4e'),_0x320833[_0x6a03('0x38')]);}};Acw[_0x6a03('0x17')]['syncAgentRingNoAnswer']=function(_0x1b77a3){try{if(this[_0x6a03('0x5')][_0x1b77a3[_0x6a03('0x1b')]]&&this[_0x6a03('0x5')][_0x1b77a3[_0x6a03('0x1b')]][_0x6a03('0x4f')]==='all'){if(this['agents'][_0x1b77a3['interface']]){logger[_0x6a03('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1b77a3[_0x6a03('0x2c')],_0x1b77a3[_0x6a03('0x1a')],_0x1b77a3[_0x6a03('0x1b')]);return RpcUser[_0x6a03('0x25')](this[_0x6a03('0x6')][_0x1b77a3['interface']],_0x6a03('0x50'),_0x1b77a3[_0x6a03('0x2c')]);}}}catch(_0x35c9f1){logger[_0x6a03('0x31')](_0x6a03('0x51'),_0x35c9f1['message']);}};module[_0x6a03('0x52')]=Acw;
\ No newline at end of file
+var _0x621f=['lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','timer','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x621f,0x1ca));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0xf621('0x0'));var ami=require('../ami');var logger=require(_0xf621('0x1'))(_0xf621('0x2'));var RpcUser=require(_0xf621('0x3'));var RpcVoiceAgentReport=require(_0xf621('0x4'));function Acw(_0x412321){this[_0xf621('0x5')]=_0x412321[_0xf621('0x5')];this[_0xf621('0x6')]=_0x412321[_0xf621('0x6')];this[_0xf621('0x7')]=_0x412321[_0xf621('0x7')];this[_0xf621('0x8')]={};ami['on'](_0xf621('0x9'),this[_0xf621('0xa')]['bind'](this));ami['on']('hanguprequest',this[_0xf621('0xb')][_0xf621('0xc')](this));ami['on'](_0xf621('0xd'),this[_0xf621('0xe')][_0xf621('0xc')](this));ami['on'](_0xf621('0xf'),this[_0xf621('0x10')][_0xf621('0xc')](this));ami['on'](_0xf621('0x11'),this[_0xf621('0x12')][_0xf621('0xc')](this));ami['on'](_0xf621('0x13'),this[_0xf621('0x14')]['bind'](this));ami['on'](_0xf621('0x15'),this[_0xf621('0x16')][_0xf621('0xc')](this));}function getDiff(_0x2d1376){var _0x5daa27=moment()[_0xf621('0x17')](0x0);var _0x150f65=moment(_0x2d1376)[_0xf621('0x17')](0x0);return _0x5daa27['diff'](_0x150f65,'seconds');}Acw[_0xf621('0x18')]['startAcw']=function(_0xfe54b3){try{var _0x61dadf=this;var _0x424a8d=this[_0xf621('0x8')][_0xfe54b3]['interface'];var _0x28d6d4=this[_0xf621('0x8')][_0xfe54b3][_0xf621('0x19')];var _0x45f63a=this[_0xf621('0x5')][_0x28d6d4];var _0x517ac2=![];var _0x161cc2=_0xf621('0x1a');if(_0x45f63a[_0xf621('0x1b')]){if(_0x45f63a[_0xf621('0x1c')][_0xf621('0x1d')]){_0x517ac2=!![];_0x161cc2=_0x45f63a['mandatoryDispositionPause']['name'];}}return ami[_0xf621('0x1e')]({'action':_0xf621('0x1f'),'interface':_0x424a8d,'paused':!![],'reason':_0x161cc2})[_0xf621('0x20')](function(){if(_0x61dadf[_0xf621('0x6')][_0x424a8d]){return RpcUser[_0xf621('0x21')](_0x61dadf[_0xf621('0x6')][_0x424a8d]['id'])['then'](function(_0x2d27e6){if(_0x2d27e6&&!_0x2d27e6[_0xf621('0x22')]){logger[_0xf621('0x23')](_0xf621('0x24'),_0xfe54b3,_0x424a8d,_0x28d6d4);var _0x2cc035=_0x61dadf[_0xf621('0x8')][_0xfe54b3][_0xf621('0x25')]&&_0x61dadf[_0xf621('0x8')][_0xfe54b3]['destlinkedid']?_0x61dadf[_0xf621('0x8')][_0xfe54b3][_0xf621('0x26')]:_0xfe54b3;return RpcUser[_0xf621('0x27')](_0x61dadf[_0xf621('0x6')][_0x424a8d],_0x161cc2,_0x2cc035)[_0xf621('0x20')](function(){if(!_0x517ac2){_0x61dadf[_0xf621('0x7')][_0x424a8d]={};logger[_0xf621('0x23')](_0xf621('0x28'),_0xfe54b3,_0x61dadf['voiceQueues'][_0x28d6d4][_0xf621('0x29')],_0x424a8d,_0x28d6d4);_0x61dadf[_0xf621('0x7')][_0x424a8d]['timer']=setTimeout(_0x61dadf[_0xf621('0x2a')][_0xf621('0xc')](_0x61dadf,_0x424a8d),_0x61dadf[_0xf621('0x5')][_0x28d6d4][_0xf621('0x29')]*0x3e8);_0x61dadf[_0xf621('0x7')][_0x424a8d]['lastPauseAt']=moment()[_0xf621('0x2b')](_0xf621('0x2c'));_0x61dadf[_0xf621('0x7')][_0x424a8d][_0xf621('0x2d')]=_0xfe54b3;_0x61dadf[_0xf621('0x7')][_0x424a8d][_0xf621('0x19')]=_0x28d6d4;_0x61dadf['timers'][_0x424a8d]['updateAcw']=function(){var _0x487db9=getDiff(_0x61dadf[_0xf621('0x7')][_0x424a8d][_0xf621('0x2e')]);clearTimeout(_0x61dadf[_0xf621('0x7')][_0x424a8d]['timer']);_0x61dadf['timers'][_0x424a8d]['timer']=![];RpcVoiceAgentReport[_0xf621('0x2f')]({'acwtime':_0x487db9},_0x61dadf['timers'][_0x424a8d][_0xf621('0x2d')],_0x424a8d)[_0xf621('0x20')](function(_0x5b82d3){logger[_0xf621('0x23')](_0xf621('0x30'),_0xfe54b3,_0x487db9,_0x5b82d3);})[_0xf621('0x31')](function(_0x1fc522){logger['error'](_0xf621('0x32'),_0xfe54b3,_0x1fc522);});delete _0x61dadf[_0xf621('0x7')][_0x424a8d];};}});}else{logger[_0xf621('0x23')](_0xf621('0x33'),_0xfe54b3,_0x424a8d,_0x28d6d4);}});}})[_0xf621('0x31')](function(){logger[_0xf621('0x34')](_0xf621('0x28'),_0xfe54b3,_0x61dadf['voiceQueues'][_0x28d6d4][_0xf621('0x29')],_0x424a8d,_0x28d6d4);})[_0xf621('0x35')](function(){delete _0x61dadf[_0xf621('0x8')][_0xfe54b3];});}catch(_0x17e3c8){logger[_0xf621('0x34')](_0xf621('0x36'),_0x17e3c8[_0xf621('0x37')]);}};Acw[_0xf621('0x18')][_0xf621('0x2a')]=function(_0x1739a2){try{var _0x2641df=this;if(_0x2641df[_0xf621('0x7')][_0x1739a2]){_0x2641df['timers'][_0x1739a2][_0xf621('0x38')]=![];var _0x1c5445=_0x2641df[_0xf621('0x7')][_0x1739a2][_0xf621('0x2d')];var _0x1071ba=_0x2641df[_0xf621('0x7')][_0x1739a2][_0xf621('0x19')];var _0x25ccbe=_0x2641df[_0xf621('0x5')][_0x1071ba][_0xf621('0x29')];logger[_0xf621('0x23')](_0xf621('0x39'),_0x1c5445,_0x1739a2);RpcUser['saveUnpause'](this[_0xf621('0x6')][_0x1739a2]);RpcVoiceAgentReport['update']({'acwtime':_0x25ccbe,'agentacw':!![]},_0x1c5445,_0x1739a2)[_0xf621('0x20')](function(_0x4ed825){logger['info'](_0xf621('0x30'),_0x1c5445,_0x25ccbe,_0x4ed825);})[_0xf621('0x31')](function(_0x45fd15){logger[_0xf621('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x1c5445,_0x45fd15);});}else{logger[_0xf621('0x34')](_0xf621('0x3a'),_0x1739a2);if(_0x2641df['timers']){logger[_0xf621('0x23')]('[ACW][TIMERS]',JSON['stringify'](_0x2641df['timers']));}}}catch(_0x52a6e1){logger[_0xf621('0x34')](_0xf621('0x3b'),_0x52a6e1[_0xf621('0x37')]);}};Acw[_0xf621('0x18')][_0xf621('0xa')]=function(_0x47c23e){try{if(this[_0xf621('0x5')][_0x47c23e[_0xf621('0x19')]]&&(this[_0xf621('0x5')][_0x47c23e[_0xf621('0x19')]][_0xf621('0x2')]||this[_0xf621('0x5')][_0x47c23e[_0xf621('0x19')]][_0xf621('0x1b')])){if(this['agents'][_0x47c23e[_0xf621('0x3c')]]){this[_0xf621('0x8')][_0x47c23e['uniqueid']]={'queue':_0x47c23e[_0xf621('0x19')],'interface':_0x47c23e[_0xf621('0x3c')],'destlinkedid':_0x47c23e[_0xf621('0x26')]};}}}catch(_0x21a484){logger[_0xf621('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x21a484[_0xf621('0x37')]);}};Acw[_0xf621('0x18')][_0xf621('0x16')]=function(_0x21f7c4){try{if(this['voiceQueues'][_0x21f7c4['queue']]&&(this[_0xf621('0x5')][_0x21f7c4[_0xf621('0x19')]]['acw']||this[_0xf621('0x5')][_0x21f7c4['queue']][_0xf621('0x1b')])){if(this[_0xf621('0x6')][_0x21f7c4[_0xf621('0x3c')]]){this[_0xf621('0x8')][_0x21f7c4[_0xf621('0x2d')]]={'queue':_0x21f7c4[_0xf621('0x19')],'interface':_0x21f7c4[_0xf621('0x3c')]};}}}catch(_0x57259c){logger[_0xf621('0x34')](_0xf621('0x3d'),_0x57259c[_0xf621('0x37')]);}};Acw[_0xf621('0x18')]['syncHangupRequest']=function(_0x40e132){try{if(this[_0xf621('0x8')][_0x40e132['uniqueid']]&&_[_0xf621('0x3e')](this[_0xf621('0x8')][_0x40e132['uniqueid']][_0xf621('0x25')])){logger['info'](_0xf621('0x3f'),_0x40e132['uniqueid']);this[_0xf621('0x40')](_0x40e132[_0xf621('0x2d')]);}else if(this[_0xf621('0x8')][_0x40e132[_0xf621('0x41')]]&&_[_0xf621('0x3e')](this[_0xf621('0x8')][_0x40e132[_0xf621('0x41')]][_0xf621('0x25')])){logger[_0xf621('0x23')]('[%s][HANGUP:LINKEDID]',_0x40e132[_0xf621('0x41')]);this[_0xf621('0x40')](_0x40e132[_0xf621('0x41')]);}}catch(_0x4d11d8){logger['error'](_0xf621('0x42'),_0x4d11d8[_0xf621('0x37')]);}};Acw['prototype'][_0xf621('0xe')]=function(_0x4ee428){try{if(this[_0xf621('0x8')][_0x4ee428['uniqueid']]&&this[_0xf621('0x8')][_0x4ee428['uniqueid']][_0xf621('0x25')]){logger[_0xf621('0x23')](_0xf621('0x43'),_0x4ee428[_0xf621('0x2d')]);this['startAcw'](_0x4ee428[_0xf621('0x2d')]);}else if(this[_0xf621('0x8')][_0x4ee428[_0xf621('0x41')]]&&this[_0xf621('0x8')][_0x4ee428[_0xf621('0x41')]][_0xf621('0x25')]){logger[_0xf621('0x23')](_0xf621('0x44'),_0x4ee428[_0xf621('0x41')]);this[_0xf621('0x40')](_0x4ee428['linkedid']);}}catch(_0x3bc98e){logger[_0xf621('0x34')]('[ACW][syncHangup]\x20%s',_0x3bc98e[_0xf621('0x37')]);}};Acw[_0xf621('0x18')][_0xf621('0x12')]=function(_0x4b0d8b){try{if(!_[_0xf621('0x45')](this[_0xf621('0x8')][_0x4b0d8b['transfereeuniqueid']])){this[_0xf621('0x40')](_0x4b0d8b[_0xf621('0x46')]);if(this[_0xf621('0x8')][_0x4b0d8b['secondtransfereruniqueid']]){this['channels'][_0x4b0d8b[_0xf621('0x47')]]['attended']=!![];this[_0xf621('0x8')][_0x4b0d8b['transfertargetuniqueid']]=this[_0xf621('0x8')][_0x4b0d8b[_0xf621('0x47')]];delete this['channels'][_0x4b0d8b[_0xf621('0x47')]];}}else if(!_[_0xf621('0x45')](this[_0xf621('0x8')][_0x4b0d8b[_0xf621('0x48')]])){this['startAcw'](_0x4b0d8b[_0xf621('0x48')]);if(this[_0xf621('0x8')][_0x4b0d8b[_0xf621('0x49')]]){this[_0xf621('0x8')][_0x4b0d8b['origtransfereruniqueid']][_0xf621('0x25')]=!![];this['channels'][_0x4b0d8b[_0xf621('0x46')]]=this[_0xf621('0x8')][_0x4b0d8b[_0xf621('0x49')]];delete this[_0xf621('0x8')][_0x4b0d8b[_0xf621('0x49')]];}}}catch(_0x55ea29){logger[_0xf621('0x34')](_0xf621('0x4a'),_0x55ea29[_0xf621('0x37')]);}};Acw['prototype'][_0xf621('0x14')]=function(_0x5a8a25){try{if(this[_0xf621('0x8')][_0x5a8a25['transfereruniqueid']]){logger[_0xf621('0x23')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf621('0x4b')](_0x5a8a25[_0xf621('0x4c')]));this[_0xf621('0x40')](_0x5a8a25[_0xf621('0x4c')]);}else if(this[_0xf621('0x8')][_0x5a8a25[_0xf621('0x4d')]]){logger[_0xf621('0x23')](_0xf621('0x4e'),JSON['stringify'](_0x5a8a25[_0xf621('0x4d')]));this['startAcw'](_0x5a8a25['transfererlinkedid']);}}catch(_0x11e903){logger['error'](_0xf621('0x4f'),_0x11e903[_0xf621('0x37')]);}};Acw[_0xf621('0x18')]['syncAgentRingNoAnswer']=function(_0x57a5c7){try{if(this[_0xf621('0x5')][_0x57a5c7[_0xf621('0x19')]]&&this[_0xf621('0x5')][_0x57a5c7[_0xf621('0x19')]][_0xf621('0x50')]==='all'){if(this[_0xf621('0x6')][_0x57a5c7[_0xf621('0x3c')]]){logger[_0xf621('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x57a5c7[_0xf621('0x2d')],_0x57a5c7[_0xf621('0x3c')],_0x57a5c7['queue']);return RpcUser[_0xf621('0x27')](this[_0xf621('0x6')][_0x57a5c7[_0xf621('0x3c')]],_0xf621('0x51'),_0x57a5c7[_0xf621('0x2d')]);}}}catch(_0x153b3a){logger['error'](_0xf621('0x52'),_0x153b3a[_0xf621('0x37')]);}};module[_0xf621('0x53')]=Acw;
\ No newline at end of file
index 65b42c1..b56e7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc76=['actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','error','close','connect','fullybooted','resolve','then','actionCoreShowChannels','catch','[ami.js][fullybooted]','util','ami','../../config/environment','asterisk','username','password','keepConnected','Action','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect'];(function(_0x3564f2,_0x36f865){var _0x4a8597=function(_0x1a63bb){while(--_0x1a63bb){_0x3564f2['push'](_0x3564f2['shift']());}};_0x4a8597(++_0x36f865);}(_0xfc76,0x67));var _0x6fc7=function(_0x285612,_0x122bc1){_0x285612=_0x285612-0x0;var _0x30b5c8=_0xfc76[_0x285612];return _0x30b5c8;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0x6fc7('0x0'));var logger=require('../../config/logger')(_0x6fc7('0x1'));var config=require(_0x6fc7('0x2'));var ami=new Manager(config[_0x6fc7('0x3')]['port'],config[_0x6fc7('0x3')]['ip'],config[_0x6fc7('0x3')][_0x6fc7('0x4')],config[_0x6fc7('0x3')][_0x6fc7('0x5')],!![]);ami[_0x6fc7('0x6')]();ami[_0x6fc7('0x7')]=BPromise['promisify'](ami[_0x6fc7('0x8')]);function error(_0x40bad3){logger['error'](util[_0x6fc7('0x9')](_0x6fc7('0xa'),config[_0x6fc7('0x3')][_0x6fc7('0x4')],config[_0x6fc7('0x3')]['ip'],config[_0x6fc7('0x3')][_0x6fc7('0xb')],util[_0x6fc7('0xc')](_0x40bad3,![],null)));}function close(){logger['error'](util[_0x6fc7('0x9')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x6fc7('0x3')][_0x6fc7('0x4')],config[_0x6fc7('0x3')]['ip'],config[_0x6fc7('0x3')][_0x6fc7('0xb')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x6fc7('0x7')]({'action':'sipshowregistry'});};};ami[_0x6fc7('0xd')]=function(){return function(){return ami[_0x6fc7('0x7')]({'action':'devicestatelist'});};};ami[_0x6fc7('0xe')]=function(){return function(){return ami[_0x6fc7('0x7')]({'action':_0x6fc7('0xf')});};};ami[_0x6fc7('0x10')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x6fc7('0x7')]({'action':'coreshowchannels'});};};function connect(){logger[_0x6fc7('0x11')](util[_0x6fc7('0x9')](_0x6fc7('0x12'),config[_0x6fc7('0x3')][_0x6fc7('0x4')],config[_0x6fc7('0x3')]['ip'],config[_0x6fc7('0x3')]['port']));ami[_0x6fc7('0x13')](_0x6fc7('0x14'),error);ami['once'](_0x6fc7('0x15'),close);}ami['on'](_0x6fc7('0x16'),connect);ami['on']('shutdown',function(_0x3e4efe){logger[_0x6fc7('0x11')](util[_0x6fc7('0x9')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x6fc7('0x3')][_0x6fc7('0x4')],config[_0x6fc7('0x3')]['ip'],config[_0x6fc7('0x3')][_0x6fc7('0xb')],util[_0x6fc7('0xc')](_0x3e4efe,![],null)));});ami['on'](_0x6fc7('0x17'),function(){logger[_0x6fc7('0x11')](util[_0x6fc7('0x9')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0x6fc7('0x4')],config['asterisk']['ip'],config[_0x6fc7('0x3')][_0x6fc7('0xb')]));return Promise[_0x6fc7('0x18')]()[_0x6fc7('0x19')](ami['actionSipShowRegistry']())['then'](ami[_0x6fc7('0xd')]())[_0x6fc7('0x19')](ami[_0x6fc7('0xe')]())[_0x6fc7('0x19')](ami['actionQueueSummary']())[_0x6fc7('0x19')](ami[_0x6fc7('0x1a')]())[_0x6fc7('0x1b')](function(_0x58aef3){logger[_0x6fc7('0x14')](_0x6fc7('0x1c'),util[_0x6fc7('0xc')](_0x58aef3,{'showHidden':![],'depth':null}));});});ami[_0x6fc7('0x13')](_0x6fc7('0x14'),error);ami[_0x6fc7('0x13')]('close',close);module['exports']=ami;
\ No newline at end of file
+var _0xcafb=['fullybooted','resolve','then','actionSipPeerStatus','actionQueueSummary','catch','inspect','exports','asterisk-manager','bluebird','util','ami','../../config/environment','asterisk','port','username','password','keepConnected','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','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close'];(function(_0x49448d,_0x144746){var _0x1b4b54=function(_0x13aabb){while(--_0x13aabb){_0x49448d['push'](_0x49448d['shift']());}};_0x1b4b54(++_0x144746);}(_0xcafb,0xda));var _0xbcaf=function(_0x254f72,_0x23a9cc){_0x254f72=_0x254f72-0x0;var _0x4576aa=_0xcafb[_0x254f72];return _0x4576aa;};'use strict';var Manager=require(_0xbcaf('0x0'));var BPromise=require(_0xbcaf('0x1'));var util=require(_0xbcaf('0x2'));var logger=require('../../config/logger')(_0xbcaf('0x3'));var config=require(_0xbcaf('0x4'));var ami=new Manager(config[_0xbcaf('0x5')][_0xbcaf('0x6')],config[_0xbcaf('0x5')]['ip'],config[_0xbcaf('0x5')][_0xbcaf('0x7')],config['asterisk'][_0xbcaf('0x8')],!![]);ami[_0xbcaf('0x9')]();ami[_0xbcaf('0xa')]=BPromise[_0xbcaf('0xb')](ami[_0xbcaf('0xc')]);function error(_0x582c84){logger[_0xbcaf('0xd')](util[_0xbcaf('0xe')](_0xbcaf('0xf'),config[_0xbcaf('0x5')][_0xbcaf('0x7')],config['asterisk']['ip'],config[_0xbcaf('0x5')]['port'],util['inspect'](_0x582c84,![],null)));}function close(){logger[_0xbcaf('0xd')](util[_0xbcaf('0xe')](_0xbcaf('0x10'),config[_0xbcaf('0x5')][_0xbcaf('0x7')],config[_0xbcaf('0x5')]['ip'],config[_0xbcaf('0x5')]['port']));}ami[_0xbcaf('0x11')]=function(){return function(){return ami[_0xbcaf('0xa')]({'action':_0xbcaf('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xbcaf('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xbcaf('0xa')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xbcaf('0xa')]({'action':_0xbcaf('0x14')});};};ami[_0xbcaf('0x15')]=function(){return function(){return ami['Action']({'action':_0xbcaf('0x16')});};};function connect(){logger[_0xbcaf('0x17')](util[_0xbcaf('0xe')](_0xbcaf('0x18'),config['asterisk']['username'],config[_0xbcaf('0x5')]['ip'],config[_0xbcaf('0x5')][_0xbcaf('0x6')]));ami['once']('error',error);ami[_0xbcaf('0x19')](_0xbcaf('0x1a'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x1e72ba){logger['info'](util[_0xbcaf('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xbcaf('0x5')][_0xbcaf('0x7')],config[_0xbcaf('0x5')]['ip'],config[_0xbcaf('0x5')][_0xbcaf('0x6')],util['inspect'](_0x1e72ba,![],null)));});ami['on'](_0xbcaf('0x1b'),function(){logger[_0xbcaf('0x17')](util[_0xbcaf('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xbcaf('0x5')][_0xbcaf('0x7')],config['asterisk']['ip'],config['asterisk'][_0xbcaf('0x6')]));return Promise[_0xbcaf('0x1c')]()[_0xbcaf('0x1d')](ami['actionSipShowRegistry']())[_0xbcaf('0x1d')](ami['actionDeviceStateList']())[_0xbcaf('0x1d')](ami[_0xbcaf('0x1e')]())['then'](ami[_0xbcaf('0x1f')]())[_0xbcaf('0x1d')](ami[_0xbcaf('0x15')]())[_0xbcaf('0x20')](function(_0x4e2fa0){logger[_0xbcaf('0xd')]('[ami.js][fullybooted]',util[_0xbcaf('0x21')](_0x4e2fa0,{'showHidden':![],'depth':null}));});});ami[_0xbcaf('0x19')]('error',error);ami['once'](_0xbcaf('0x1a'),close);module[_0xbcaf('0x22')]=ami;
\ No newline at end of file
index 24f37eb..0897ed8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'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
+var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5a25d0,_0x58d9ae){_0x5a25d0=_0x5a25d0-0x0;var _0x25fe95=_0x9bde[_0x5a25d0];return _0x25fe95;};'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
index 70c4efb..4f15628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a81=['NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','assign','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','TrunkBackup','originatecalleridname','extractCalleridName','dialPrefix','dialCutDigit','substring','trim','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','[CatchErlangB]','predictiveIntervalAvgTalktime','predictiveIntervalPauses','outboundQueuePauses','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','getContactDialer','countReScheduled','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','Interval:\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]','Umin\x20=\x20','exports','util','lodash','uuid','ioredis','./utils','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','debug','startPredictive\x20value\x20cleared','handlePredictive','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','\x20NOT\x20Active','campaign:ivr:%s','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','Trunk','TRUNK_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','command','content','indexOf','true','catch','push','iftime\x20%s,%s','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','sendMessageOneNotActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','queue','uniqueid','uniqueId','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','verifyAdditionalPhones','dialAbandonedMaxRetry','queueCallerAbandonCreateState','dialAbandonedRetryFrequency','Abandoned','actions','channel','actionid','strategy','rrmemory','roundrobin','locked','paused','stateinterface','isNil','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','pick','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','AMD','buildObj','amd','saveInDb','[syncHangupInAMD]','Machine','membername','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineRetryFrequency','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','Unknow','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22'];(function(_0x41e675,_0xe9ae4a){var _0x16cbe7=function(_0x4d1d56){while(--_0x4d1d56){_0x41e675['push'](_0x41e675['shift']());}};_0x16cbe7(++_0xe9ae4a);}(_0x2a81,0xba));var _0x12a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a81[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x12a8('0x0'));var _=require(_0x12a8('0x1'));var uuid=require(_0x12a8('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x12a8('0x3'));var utils=require(_0x12a8('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x12a8('0x5'));var config=require('../../../config/environment/');var logger=require(_0x12a8('0x6'))(_0x12a8('0x7'));var loggerBooked=require(_0x12a8('0x6'))(_0x12a8('0x8'));var loggerPredictive=require('../../../config/logger')(_0x12a8('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x12a8('0xa'));var loggerSyncQueueSummary=require(_0x12a8('0x6'))(_0x12a8('0xb'));var ami=require(_0x12a8('0xc'));config[_0x12a8('0xd')]=_[_0x12a8('0xe')](config[_0x12a8('0xd')],{'host':_0x12a8('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x12a8('0x10'));var voiceQueueRt=require(_0x12a8('0x11'));var RpcSetting=require(_0x12a8('0x12'));var Interval=require('../rpc/interval');var Action=require(_0x12a8('0x13'));var History=require('./models/history');var Final=require(_0x12a8('0x14'));var AgentComplete=require(_0x12a8('0x15'));var QueueCallerAbandon=require(_0x12a8('0x16'));var Hangup=require(_0x12a8('0x17'));var ipAgi=process['env'][_0x12a8('0x18')]||_0x12a8('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x12a8('0x1a')][_0x12a8('0x1b')]=function(_0x2dc106){this[_0x12a8('0x1c')]=this[_0x12a8('0x1c')]?this['tail']['finally'](_0x2dc106):_0x2dc106();};function Dialer(_0x3bde80,_0x49f8d0){this[_0x12a8('0x1d')]=new Sequence();this[_0x12a8('0x1e')]=_0x49f8d0;this[_0x12a8('0x1f')]=_0x3bde80[_0x12a8('0x1f')];this[_0x12a8('0x20')]=_0x3bde80[_0x12a8('0x20')];this[_0x12a8('0x21')]=_0x3bde80[_0x12a8('0x21')];this[_0x12a8('0x22')]=_0x3bde80[_0x12a8('0x22')];this[_0x12a8('0x23')]=config[_0x12a8('0x23')]||0x2;this['channels']={};this['actions']={};this[_0x12a8('0x24')]={};this['uniqueId']={};this[_0x12a8('0x25')]={};this[_0x12a8('0x26')]={};this[_0x12a8('0x27')]={};this[_0x12a8('0x28')]={};this[_0x12a8('0x29')]={};this['queueBookedRR']={};this['queuesSummary']={};ami['on']('agentconnect',this[_0x12a8('0x2a')][_0x12a8('0x2b')](this));ami['on']('queuecallerabandon',this[_0x12a8('0x2c')][_0x12a8('0x2b')](this));ami['on'](_0x12a8('0x2d'),this[_0x12a8('0x2e')][_0x12a8('0x2b')](this));ami['on'](_0x12a8('0x2f'),this[_0x12a8('0x30')][_0x12a8('0x2b')](this));ami['on'](_0x12a8('0x31'),this[_0x12a8('0xb')][_0x12a8('0x2b')](this));ami['on'](_0x12a8('0x32'),this[_0x12a8('0x33')]['bind'](this));ami['on'](_0x12a8('0x34'),this['syncHangup'][_0x12a8('0x2b')](this));ami['on']('newexten',this[_0x12a8('0x35')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x12a8('0x2b')](this));ami['on'](_0x12a8('0x36'),this[_0x12a8('0x37')][_0x12a8('0x2b')](this));ami['on'](_0x12a8('0x38'),this[_0x12a8('0x39')][_0x12a8('0x2b')](this));this[_0x12a8('0x3a')]();this[_0x12a8('0x3b')]();RpcSetting['getSettings']()[_0x12a8('0x3c')](function(_0x5d7667){previewRecallmeReminderInterval=_0x5d7667[_0x12a8('0x3d')];});}function isNotNull(_0x1ca8c9){return _0x1ca8c9!==null&&!_[_0x12a8('0x3e')](_0x1ca8c9);}function msgResponse(_0xeecea6,_0x202881,_0x39d59e){return{'action':_0xeecea6,'response':_0x202881,'message':_0x39d59e,'stack':_0x39d59e};}function emit(_0x15829d,_0x2a9820,_0xe843b3){io['to'](_0x15829d)[_0x12a8('0x3f')](_0x2a9820,_0xe843b3);}function emitOutboundVoiceQueueSummary(_0x4f7794){if(_0x4f7794[_0x12a8('0x40')]==='outbound'){logger['debug'](_0x12a8('0x41'),util[_0x12a8('0x42')](_0x4f7794,{'showHidden':![],'depth':null}));emit(util[_0x12a8('0x43')](_0x12a8('0x44'),_0x4f7794[_0x12a8('0x45')]),_0x12a8('0x46'),_0x4f7794);}}function checkGetDataPredictive(_0x162819){if(isNotNull(_0x162819)&&!_[_0x12a8('0x47')](_0x162819)){loggerPredictive[_0x12a8('0x48')](_0x12a8('0x49'));loggerPredictive[_0x12a8('0x48')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x162819[_0x12a8('0x4a')]);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x4b'),_0x162819['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x4c'),_0x162819[_0x12a8('0x4d')]);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x4e'),_0x162819[_0x12a8('0x4f')]);loggerPredictive[_0x12a8('0x48')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x162819['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x50'),_0x162819['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x12a8('0x51'));if(_0x162819['predictiveIntervalTotalCalls']>0x0){if(!_[_0x12a8('0x3e')](_0x162819['predictiveIntervalAvgTalktime'])&&_0x162819['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x12a8('0x48')](_0x12a8('0x52'));if(!_[_0x12a8('0x3e')](_0x162819[_0x12a8('0x53')])&&_0x162819[_0x12a8('0x53')]>0x0){return!![];}loggerPredictive['info'](_0x12a8('0x54'));}else{loggerPredictive[_0x12a8('0x48')](_0x12a8('0x55'));}}else{loggerPredictive[_0x12a8('0x48')](_0x12a8('0x56'));}return![];}function mergeDataErlangB(_0x290368){return function(_0x14358b){loggerPredictive['info'](_0x12a8('0x57'));loggerPredictive[_0x12a8('0x48')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14358b[_0x12a8('0x58')]);loggerPredictive[_0x12a8('0x48')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14358b[_0x12a8('0x59')]);loggerPredictive[_0x12a8('0x48')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14358b[_0x12a8('0x5a')]);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x5b'),_0x14358b[_0x12a8('0x5c')]);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x5d'),_0x14358b['erlangAbandonmentRate']);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x51'));_[_0x12a8('0x5e')](_0x290368,_0x14358b);};}function ifInterval(_0x5a0ec7,_0x410e3b){if(_[_0x12a8('0x3e')](_0x410e3b)){return![];}return utils[_0x12a8('0x5f')](undefined,_0x410e3b)<_0x5a0ec7*0x3c;}function clearPredictiveAttributes(_0xbe1232){if(_0xbe1232[_0x12a8('0x27')]){_0xbe1232[_0x12a8('0x27')]=undefined;loggerPredictive[_0x12a8('0x60')](_0xbe1232[_0x12a8('0x45')],'startProgressive\x20value\x20cleared');}if(_0xbe1232[_0x12a8('0x26')]){_0xbe1232['startPredictive']=undefined;loggerPredictive[_0x12a8('0x60')](_0xbe1232[_0x12a8('0x45')],_0x12a8('0x61'));}if(_0xbe1232[_0x12a8('0x62')]){clearInterval(_0xbe1232['handlePredictive']);_0xbe1232[_0x12a8('0x62')]=undefined;loggerPredictive['debug'](_0xbe1232[_0x12a8('0x45')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x1510c7,_0x3bebf8){return function(_0x222cdc){loggerPredictive[_0x12a8('0x63')](_0x3bebf8[_0x12a8('0x45')],_0x1510c7);loggerPredictive[_0x12a8('0x63')](_0x222cdc['stack']);clearPredictiveAttributes(_0x3bebf8);};}function loggerCatch(_0x574278){return function(_0xc2ab6e){logger['error'](_0x574278,util['inspect'](_0xc2ab6e,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x53fc5d,_0x217051,_0x40d736){return function(_0x43db88){utils[_0x12a8('0x64')](_0x217051,_0x40d736,0x0);logger[_0x12a8('0x63')](_0x53fc5d,util['inspect'](_0x43db88,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x57d07a){return function(_0x1a8d7a){if(isNotNull(_0x1a8d7a)&&isNotNull(_0x1a8d7a[0x0])){if(_0x1a8d7a[0x0][_0x12a8('0x65')]>0x0){_0x57d07a[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x68')];logger[_0x12a8('0x48')]('[getContactDialer2][ReScheduled]'+_0x57d07a[_0x12a8('0x45')],_0x1a8d7a[0x0][_0x12a8('0x65')],_0x12a8('0x69'));}else{_0x57d07a[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x6a')];logger[_0x12a8('0x48')]('[getContactDialer2][Empty]'+_0x57d07a[_0x12a8('0x45')]);}}};}function createObjHistory(_0x169fda,_0x1184c3,_0x491ca8,_0x1231fd,_0xf4380){_0x169fda[_0x12a8('0x66')]=_0x491ca8;var _0x870427=new Action(_0x169fda,_0x1184c3);var _0x39eabb=new History(_0x870427);_0x39eabb[_0x12a8('0x6b')]=_0x1231fd;_0x39eabb[_0x12a8('0x6c')]=_0xf4380;_0x39eabb[_0x12a8('0x6d')]=_0x870427['starttime'];return _0x39eabb;}function unlockQueueStatus(_0x46425e,_0x2b2e59){setTimeout(function(){if(_[_0x12a8('0x3e')](_0x46425e['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x2b2e59);}_0x46425e[_0x12a8('0x6e')]=!![];loggerBooked[_0x12a8('0x48')](_0x12a8('0x6f'),_0x2b2e59,JSON[_0x12a8('0x70')](_['pick'](_0x46425e,[_0x12a8('0x45'),_0x12a8('0x6e')])));},0x1f3);}function checkInterval(_0xb13fac){return function(){if(!isNotNull(_0xb13fac[_0x12a8('0x71')])){_0xb13fac[_0x12a8('0x66')]=utils[_0x12a8('0x67')]['NULL_INTERVAL'];throw _0xb13fac[_0x12a8('0x45')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xb13fac['Interval']['Intervals'])){_0xb13fac[_0x12a8('0x66')]=utils['CAMPAIGN_STATUS'][_0x12a8('0x72')];throw _0xb13fac['name']+_0x12a8('0x73');}if(!isNotNull(_['isEmpty'](_0xb13fac[_0x12a8('0x71')][_0x12a8('0x74')]))){_0xb13fac[_0x12a8('0x66')]=utils[_0x12a8('0x67')]['NULL_INTERVAL'];throw _0xb13fac[_0x12a8('0x45')]+_0x12a8('0x73');}};}function checkIsIVRCampaignActive(_0x31cfae){return function(){if(!utils['isIVRCampaignActive'](_0x31cfae)){_0x31cfae['message']=utils[_0x12a8('0x67')]['INACTIVE'];throw _0x31cfae[_0x12a8('0x45')]+_0x12a8('0x75');}};}function emitCampaignSummary(_0x48c8c4){if(utils['isIVRCampaign'](_0x48c8c4)){emit(util[_0x12a8('0x43')](_0x12a8('0x76'),_0x48c8c4[_0x12a8('0x45')]),'campaign:save',_0x48c8c4);}}function loggerCatchQueueSummary(_0x462fe1,_0x55101a){return function(_0x58f12a){clearPredictiveAttributes(_0x55101a);emitCampaignSummary(_0x55101a);loggerSyncQueueSummary[_0x12a8('0x60')](_0x462fe1,util[_0x12a8('0x42')](_0x58f12a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2b66f5){if(_0x2b66f5['sendMessageOneNotActive']){if(_0x2b66f5[_0x12a8('0x77')]===0x0){_0x2b66f5['sendMessageOneNotActive']=![];_0x2b66f5[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x78')];loggerSyncQueueSummary['debug'](_0x12a8('0x79'),_0x2b66f5[_0x12a8('0x45')],'is\x20not\x20active');}else{_0x2b66f5[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x7a')];loggerSyncQueueSummary[_0x12a8('0x60')](_0x12a8('0x79'),_0x2b66f5[_0x12a8('0x45')],_0x12a8('0x7b'));}emitCampaignSummary(_0x2b66f5);}}function myreject(_0x72491e){return function(_0x1807f3){return _0x72491e(msgResponse(_0x12a8('0x7c'),_0x12a8('0x7d'),JSON[_0x12a8('0x70')](_0x1807f3)));};}Dialer['prototype'][_0x12a8('0x7e')]=function(_0x18a1c7){return!_[_0x12a8('0x3e')](_0x18a1c7)&&_0x18a1c7&&!_['isUndefined'](_0x18a1c7[_0x12a8('0x45')])&&!_['isUndefined'](_0x18a1c7[_0x12a8('0x7f')])&&_0x18a1c7[_0x12a8('0x7f')]&&(this[_0x12a8('0x22')][util[_0x12a8('0x43')](_0x12a8('0x80'),_0x18a1c7['name'])][_0x12a8('0x81')]==='reachable'||this[_0x12a8('0x22')][util[_0x12a8('0x43')](_0x12a8('0x80'),_0x18a1c7['name'])][_0x12a8('0x81')]==='unmonitored');};Dialer['prototype']['checkIsTrunkReachable']=function(_0xb00684){var _0xd44c6f=this;return function(){if(!_0xd44c6f['isTrunkReachable'](_0xb00684[_0x12a8('0x82')])){if(!_0xd44c6f['isTrunkReachable'](_0xb00684['TrunkBackup'])){_0xb00684['message']=utils[_0x12a8('0x67')][_0x12a8('0x83')];throw _0xb00684[_0x12a8('0x45')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x12a8('0x1a')][_0x12a8('0x84')]=function(_0x4bcfe5,_0x381d04,_0xd5ff41,_0x241ece){var _0x3f9f67=this;return function(){var _0x20bb03=!![];return _0x3f9f67['ifTimeIvr'](_0x4bcfe5,_0x381d04,_0xd5ff41,_0x241ece,_0x20bb03);};};Dialer[_0x12a8('0x1a')][_0x12a8('0x85')]=function(_0x546f86,_0x3221c8,_0x3318e4,_0x5c64b2){var _0x5280df=this;return function(){var _0x1e4ed0=![];return _0x5280df[_0x12a8('0x86')](_0x546f86[_0x12a8('0x74')],_0x3221c8,_0x3318e4,_0x5c64b2,_0x1e4ed0);};};Dialer['prototype'][_0x12a8('0x86')]=function(_0x11089c,_0x527ca9,_0x1045e0,_0x46130e,_0x5b9881){var _0x7a0b57=[];return new Promise(function(_0x5adc6b,_0x5dbf30){if(!isNotNull(_0x11089c)){_0x46130e['message']=utils[_0x12a8('0x67')][_0x12a8('0x72')];return _0x5dbf30(msgResponse(_0x12a8('0x87'),_0x12a8('0x88'),_0x1045e0+_0x12a8('0x89')));}if(_['isEmpty'](_0x11089c)){_0x46130e['message']=utils[_0x12a8('0x67')][_0x12a8('0x8a')];return _0x5dbf30(msgResponse('ifTime',_0x12a8('0x88'),_0x1045e0+_0x12a8('0x8b')));}if(_0x527ca9&&_[_0x12a8('0x3e')](config[_0x12a8('0x8c')][_0x527ca9])){_0x46130e[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x8d')];return _0x5dbf30(msgResponse(_0x12a8('0x87'),_0x12a8('0x88'),_0x1045e0+_0x12a8('0x8e')+_0x527ca9));}if(_[_0x12a8('0x8f')](_0x11089c)){for(var _0x12e5d6=0x0;_0x12e5d6<_0x11089c[_0x12a8('0x90')];_0x12e5d6+=0x1){_0x7a0b57['push'](ami[_0x12a8('0x91')]({'action':_0x12a8('0x92'),'command':util[_0x12a8('0x43')]('iftime\x20%s,%s',_0x11089c[_0x12e5d6]['interval'],!_[_0x12a8('0x3e')](config[_0x12a8('0x8c')][_0x527ca9])?_0x527ca9:'')})[_0x12a8('0x3c')](function(_0xdaacda){return _0xdaacda[_0x12a8('0x93')][_0x12a8('0x94')](_0x12a8('0x95'))>=0x0;})[_0x12a8('0x96')](myreject(_0x5dbf30)));}}else{_0x7a0b57[_0x12a8('0x97')](ami['Action']({'action':_0x12a8('0x92'),'command':util[_0x12a8('0x43')](_0x12a8('0x98'),_0x11089c,!_[_0x12a8('0x3e')](config[_0x12a8('0x8c')][_0x527ca9])?_0x527ca9:'')})[_0x12a8('0x3c')](function(_0x301e97){return _0x301e97[_0x12a8('0x93')]['indexOf'](_0x12a8('0x95'))>=0x0;})[_0x12a8('0x96')](myreject(_0x5dbf30)));}Promise['all'](_0x7a0b57)[_0x12a8('0x3c')](function(_0x517888){var _0x520ee9=_['some'](_0x517888);if(_0x520ee9){return _0x5adc6b(_0x520ee9);}else{_0x46130e[_0x12a8('0x66')]=_0x5b9881?utils[_0x12a8('0x67')][_0x12a8('0x99')]:utils[_0x12a8('0x67')]['OVERTIME_INTERVAL'];return _0x5dbf30(msgResponse(_0x12a8('0x9a'),_0x12a8('0x88'),_0x12a8('0x9b')+_0x5b9881+'\x20'+_0x1045e0+_0x12a8('0x9c')+util[_0x12a8('0x42')](_0x11089c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x527ca9));}})[_0x12a8('0x96')](function(_0x509bf2){return _0x5dbf30(msgResponse(_0x12a8('0x87'),_0x12a8('0x88'),JSON['stringify'](_0x509bf2)));});});};Dialer[_0x12a8('0x1a')][_0x12a8('0x3a')]=function(){var _0x195f6b=this;return cmHopper[_0x12a8('0x9d')]({'active':![]},{'where':{'active':!![]}})[_0x12a8('0x3c')](function(){setInterval(function(){_0x195f6b[_0x12a8('0x9e')]();},0x3e8);});};Dialer[_0x12a8('0x1a')][_0x12a8('0x9e')]=function(){var _0x5eafbc=this;var _0x4cddfc;for(var _0x8bb0f0 in this['campaigns']){if(typeof this[_0x12a8('0x20')][_0x8bb0f0]!==_0x12a8('0x9f')){_0x4cddfc=this[_0x12a8('0x20')][_0x8bb0f0];if(utils['isIVRCampaign'](_0x4cddfc)&&utils[_0x12a8('0xa0')](_0x4cddfc)){_0x4cddfc[_0x12a8('0xa1')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x4cddfc))[_0x12a8('0x3c')](checkInterval(_0x4cddfc))[_0x12a8('0x3c')](_0x5eafbc[_0x12a8('0xa2')](_0x4cddfc))[_0x12a8('0x3c')](_0x5eafbc[_0x12a8('0x84')](_0x4cddfc[_0x12a8('0xa3')],_0x4cddfc[_0x12a8('0xa4')],_0x4cddfc[_0x12a8('0x45')],_0x4cddfc))[_0x12a8('0x3c')](_0x5eafbc[_0x12a8('0x85')](_0x4cddfc['Interval'],_0x4cddfc[_0x12a8('0xa4')],_0x4cddfc[_0x12a8('0x45')],_0x4cddfc))['then'](_0x5eafbc[_0x12a8('0xa5')](_0x4cddfc))['catch'](loggerCatchQueueSummary(_0x12a8('0xa6'),_0x4cddfc));}else{notSendMessagesCampaign(_0x4cddfc);}}}};Dialer[_0x12a8('0x1a')][_0x12a8('0xa7')]=function(_0x5828c0){if(_0x5828c0[_0x12a8('0xa8')]!==_0x12a8('0x9')){clearPredictiveAttributes(_0x5828c0);}switch(_0x5828c0[_0x12a8('0xa8')]){case _0x12a8('0xa9'):this[_0x12a8('0xaa')](_0x5828c0,0x1);break;case _0x12a8('0xab'):this[_0x12a8('0xaa')](_0x5828c0,_0x5828c0[_0x12a8('0xac')]);break;case _0x12a8('0x9'):this[_0x12a8('0x9')](_0x5828c0);break;case _0x12a8('0x8'):this['handlePower'](_0x5828c0,0x1);break;default:logger[_0x12a8('0x63')]('Queue',_0x5828c0[_0x12a8('0x45')],_0x12a8('0xad'));}};Dialer[_0x12a8('0x1a')][_0x12a8('0x87')]=function(_0x2ca482,_0x1afd35){var _0x3e95c9=_0x2ca482[_0x12a8('0xa4')];var _0x11f098=_0x1afd35?_0x2ca482[_0x12a8('0xa3')]:_0x2ca482[_0x12a8('0x71')]['Intervals'];logger[_0x12a8('0xae')](_0x12a8('0xaf'),_0x11f098,_0x3e95c9,_0x2ca482[_0x12a8('0x45')],util['format'](_0x12a8('0xb0'),_0x2ca482[_0x12a8('0x45')],_0x2ca482['id']));var _0x1d7ac2=null;return Interval[_0x12a8('0xb1')](_0x11f098,_0x3e95c9)[_0x12a8('0x3c')](function(_0x4bc9b1){if(_0x4bc9b1===!![]){return _0x4bc9b1;}else{_0x2ca482[_0x12a8('0x66')]=_0x1afd35?utils[_0x12a8('0x67')][_0x12a8('0x99')]:utils[_0x12a8('0x67')][_0x12a8('0xb2')];_0x1d7ac2=msgResponse(_0x12a8('0x9a'),_0x12a8('0x88'),_0x12a8('0x9b')+_0x1afd35+'\x20'+_0x2ca482[_0x12a8('0x45')]+_0x12a8('0x9c')+util[_0x12a8('0x42')](_0x11f098,{'showHidden':![],'depth':null})+_0x12a8('0xb3')+_0x3e95c9);}if(_0x1d7ac2!==null){logger[_0x12a8('0xae')](_0x12a8('0xb4'),_0x1d7ac2);_0x1d7ac2['isGlobal']=_0x1afd35;throw _0x1d7ac2;}})[_0x12a8('0x96')](function(_0x5b8c6c){logger[_0x12a8('0x63')]('AMI\x20IfTime',_0x5b8c6c);throw msgResponse('[ifTime][Action]','Error',util['inspect'](_0x5b8c6c,{'showHidden':![],'depth':null}));});};Dialer[_0x12a8('0x1a')]['syncAgentConnect']=function(_0x128709){if(this[_0x12a8('0x1f')][_0x128709[_0x12a8('0xb5')]]){if(this['uniqueId'][_0x128709[_0x12a8('0xb6')]]&&this[_0x12a8('0xb7')][_0x128709[_0x12a8('0xb6')]]['type']!==_0x12a8('0xb8')){this[_0x12a8('0xb9')](this[_0x12a8('0x1f')][_0x128709[_0x12a8('0xb5')]]);this['uniqueId'][_0x128709['uniqueid']][_0x12a8('0xba')]=moment()['format'](_0x12a8('0xbb'));}}};Dialer[_0x12a8('0x1a')][_0x12a8('0x30')]=function(_0x1d5f29){var _0x33e163=this[_0x12a8('0xb7')][_0x1d5f29[_0x12a8('0xb6')]];if(this['voiceQueues'][_0x1d5f29['queue']]){if(_0x33e163&&_0x33e163[_0x12a8('0x40')]!=='ivr'){delete this[_0x12a8('0xb7')][_0x1d5f29[_0x12a8('0xb6')]];this['voiceQueues'][_0x1d5f29[_0x12a8('0xb5')]][_0x12a8('0xbc')]+=0x1;var _0x394f9c=new AgentComplete(_0x33e163,_0x1d5f29);if(_0x1d5f29[_0x12a8('0xbd')]===_0x12a8('0xbe')){_0x394f9c[_0x12a8('0xbf')]=this[_0x12a8('0x1f')][_0x1d5f29['queue']]['dialQueueProject2']&&this['voiceQueues'][_0x1d5f29[_0x12a8('0xb5')]][_0x12a8('0xc0')]?moment()[_0x12a8('0x43')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x12a8('0xc1')](_0x394f9c)[_0x12a8('0x96')](loggerCatch(_0x12a8('0xc2')));hopperUtils[_0x12a8('0xc3')](_0x394f9c)[_0x12a8('0x96')](loggerCatch(_0x12a8('0xc4')));}}};Dialer[_0x12a8('0x1a')][_0x12a8('0x2c')]=function(_0x1ee582){var _0x2556b8=this[_0x12a8('0xb7')][_0x1ee582['uniqueid']];var _0x1321c2=this;var _0x5eed5d=![];var _0x3ee03d;var _0x51ce07;if(this[_0x12a8('0x1f')][_0x1ee582['queue']]){if(_0x2556b8&&_0x2556b8[_0x12a8('0x40')]!==_0x12a8('0xb8')){delete this[_0x12a8('0xb7')][_0x1ee582[_0x12a8('0xb6')]];this['updateOriginated'](this['voiceQueues'][_0x1ee582[_0x12a8('0xb5')]]);_0x2556b8[_0x12a8('0xc5')]=moment()[_0x12a8('0x43')](_0x12a8('0xbb'));var _0x3e6a90=new QueueCallerAbandon(_0x2556b8,_0x1ee582);if(utils['getSeconds'](_0x2556b8[_0x12a8('0xc5')],_0x2556b8[_0x12a8('0xc6')])>=_0x2556b8['dialQueueTimeout']){this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0x4d')]+=0x1;this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xc7')]+=0x1;this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xc8')]+=0x1;_0x3e6a90[_0x12a8('0x6b')]=0xa;_0x3e6a90['statedesc']=_0x12a8('0xc9');_0x3e6a90[_0x12a8('0xca')]=_0x12a8('0xcb');_0x3e6a90[_0x12a8('0xbf')]=this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xcc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x3e6a90[_0x12a8('0xcd')]+=0x1;_0x3e6a90[_0x12a8('0xce')]+=0x1;_0x3ee03d=this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xcf')];_0x51ce07=this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xd0')];hopperUtils['verifyAdditionalPhones'](_0x3e6a90,_0x3e6a90[_0x12a8('0x6b')],_0x2556b8[_0x12a8('0xd1')])['then'](function(_0x20e543){_0x5eed5d=_0x20e543[_0x12a8('0xd2')]==0x1;if(_0x3e6a90[_0x12a8('0xcd')]>=_0x1321c2[_0x12a8('0x1f')][_0x1ee582['queue']][_0x12a8('0xd3')]){_0x1321c2['queueCallerAbandonCreateState'](_0x3e6a90,_0x20e543[_0x12a8('0xd2')]);}else{hopperUtils[_0x12a8('0xd4')]({'active':![],'countdropretry':_0x3e6a90[_0x12a8('0xcd')],'scheduledat':moment()[_0x12a8('0xd5')](_0x1321c2['voiceQueues'][_0x1ee582[_0x12a8('0xb5')]]['dialDropRetryFrequency'],_0x12a8('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2556b8[_0x12a8('0xd7')],'ListId':_0x2556b8[_0x12a8('0xd8')],'VoiceQueueId':_0x2556b8[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2556b8[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0xdb')));var _0x2fcb28=new History(_0x3e6a90);_0x2fcb28[_0x12a8('0x6b')]=0xa;_0x2fcb28[_0x12a8('0x6c')]='Drop';_0x2fcb28[_0x12a8('0xdc')]=moment()[_0x12a8('0x43')](_0x12a8('0xbb'));_0x2fcb28['endtime']=_0x2fcb28[_0x12a8('0xdc')];_0x2fcb28[_0x12a8('0xdd')]=_0x3e6a90[_0x12a8('0xdd')];_0x2fcb28['calleridnum']=_0x3e6a90[_0x12a8('0xde')];hopperUtils[_0x12a8('0xc1')](_0x2fcb28)[_0x12a8('0x96')](loggerCatch(_0x12a8('0xdf')));}})[_0x12a8('0x3c')](function(){if(_0x5eed5d)hopperUtils[_0x12a8('0xe0')](_0x3e6a90,_0x3ee03d,_0x51ce07)[_0x12a8('0x3c')](function(){return 0x1;});});}else{this['voiceQueues'][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0x4f')]+=0x1;this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xe1')]+=0x1;_0x3e6a90[_0x12a8('0x6b')]=0xb;_0x3e6a90[_0x12a8('0x6c')]='Abandoned';_0x3e6a90[_0x12a8('0xca')]=_0x12a8('0xe2');_0x3e6a90[_0x12a8('0xe3')]+=0x1;_0x3e6a90[_0x12a8('0xce')]+=0x1;_0x3ee03d=this[_0x12a8('0x1f')][_0x1ee582['queue']]['dialAbandonedRetryFrequency'];_0x51ce07=this[_0x12a8('0x1f')][_0x1ee582[_0x12a8('0xb5')]][_0x12a8('0xd0')];hopperUtils[_0x12a8('0xe4')](_0x3e6a90,_0x3e6a90[_0x12a8('0x6b')],_0x2556b8[_0x12a8('0xd1')])['then'](function(_0x2d5bf2){if(_0x3e6a90['countabandonedretry']>=_0x1321c2[_0x12a8('0x1f')][_0x1ee582['queue']][_0x12a8('0xe5')]){_0x1321c2[_0x12a8('0xe6')](_0x3e6a90,_0x2d5bf2[_0x12a8('0xd2')]);}else{hopperUtils[_0x12a8('0xd4')]({'active':![],'countabandonedretry':_0x3e6a90[_0x12a8('0xe3')],'scheduledat':moment()[_0x12a8('0xd5')](_0x1321c2[_0x12a8('0x1f')][_0x1ee582['queue']][_0x12a8('0xe7')],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2556b8[_0x12a8('0xd7')],'ListId':_0x2556b8['ListId'],'VoiceQueueId':_0x2556b8[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2556b8[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x4a69c4=new History(_0x3e6a90);_0x4a69c4[_0x12a8('0x6b')]=0xb;_0x4a69c4['statedesc']=_0x12a8('0xe8');_0x4a69c4[_0x12a8('0xdc')]=moment()[_0x12a8('0x43')](_0x12a8('0xbb'));_0x4a69c4['endtime']=_0x4a69c4[_0x12a8('0xdc')];_0x4a69c4[_0x12a8('0xdd')]=_0x3e6a90[_0x12a8('0xdd')];_0x4a69c4[_0x12a8('0xde')]=_0x3e6a90[_0x12a8('0xde')];hopperUtils['createHistory'](_0x4a69c4)[_0x12a8('0x96')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x12a8('0x3c')](function(){if(_0x5eed5d)hopperUtils[_0x12a8('0xe0')](_0x3e6a90,_0x3ee03d,_0x51ce07)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0x12a8('0x35')]=function(_0xae056c){if(this[_0x12a8('0xe9')][_0xae056c['uniqueid']]){this[_0x12a8('0xe9')][_0xae056c[_0x12a8('0xb6')]][_0x12a8('0xea')]=_0xae056c['channel'];}if(this[_0x12a8('0xb7')][_0xae056c['uniqueid']]){this[_0x12a8('0xb7')][_0xae056c[_0x12a8('0xb6')]]['channel']=_0xae056c[_0x12a8('0xea')];}};Dialer[_0x12a8('0x1a')][_0x12a8('0x37')]=function(_0x1fd667){if(!this['actions'][_0x1fd667[_0x12a8('0xeb')]]){return;}var _0x5b6da7=this[_0x12a8('0x1f')][this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]][_0x12a8('0xb5')]][_0x12a8('0xec')]||_0x12a8('0xed');if(_0x5b6da7===_0x12a8('0xee')){if(this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]]&&_['isNil'](this['actions'][_0x1fd667[_0x12a8('0xeb')]][_0x12a8('0xef')])&&_0x1fd667[_0x12a8('0x81')]==='1'&&_0x1fd667[_0x12a8('0xf0')]==='0'){if(this[_0x12a8('0x21')][_0x1fd667[_0x12a8('0xf1')]]){if(!this['agents'][_0x1fd667[_0x12a8('0xf1')]][_0x12a8('0xef')]){this[_0x12a8('0x21')][_0x1fd667[_0x12a8('0xf1')]]['locked']=!![];this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]][_0x12a8('0xef')]=!![];this[_0x12a8('0xe9')][_0x1fd667['actionid']]['stateinterface']=_0x1fd667['stateinterface'];}}}}else if(_0x5b6da7==='rrmemory'){if(this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]]){if(this[_0x12a8('0x21')][_0x1fd667['stateinterface']]){this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]]['stateinterface']=_0x1fd667[_0x12a8('0xf1')];if(_[_0x12a8('0xf2')](this[_0x12a8('0x29')][this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]]['queue']])){this['queueBooked'][this[_0x12a8('0xe9')][_0x1fd667[_0x12a8('0xeb')]][_0x12a8('0xb5')]]=[];}this['queueBooked'][this['actions'][_0x1fd667[_0x12a8('0xeb')]][_0x12a8('0xb5')]][_0x12a8('0x97')](_[_0x12a8('0x5e')](_['pick'](this['actions'][_0x1fd667[_0x12a8('0xeb')]],[_0x12a8('0xf3'),_0x12a8('0xf1')]),{'status':_0x1fd667['status'],'paused':_0x1fd667[_0x12a8('0xf0')]}));}}}};Dialer['prototype'][_0x12a8('0x39')]=function(_0xf81764){if(!this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]){return;}var _0x142aa5=this;var _0x33c238=this['voiceQueues'][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['queue']];var _0x15b256=_0x33c238[_0x12a8('0xec')]||_0x12a8('0xed');if(_0x15b256==='roundrobin'){if(this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]&&this[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xf1')]){this[_0x12a8('0x1e')]['run'](this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xf3')],this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xf1')])[_0x12a8('0x96')](function(_0x5abe18){logger[_0x12a8('0x63')](_0x12a8('0xf4'),util[_0x12a8('0x42')](_0x5abe18,{'showHidden':![],'depth':null}));})[_0x12a8('0xf5')](function(){_0x142aa5[_0x12a8('0xb9')](_0x142aa5[_0x12a8('0x1f')][_0x142aa5['actions'][_0xf81764[_0x12a8('0xeb')]]['queue']]);_0x142aa5[_0x12a8('0x21')][_0x142aa5[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xf1')]][_0x12a8('0xef')]=![];delete _0x142aa5[_0x12a8('0xe9')][_0xf81764['actionid']];unlockQueueStatus(_0x33c238);});}else{this[_0x12a8('0xb9')](this['voiceQueues'][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd7')],'ListId':this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd8')],'VoiceQueueId':this[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xd9')]||undefined,'CampaignId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]];unlockQueueStatus(_0x33c238);}}else if(_0x15b256===_0x12a8('0xed')){var _0x4251dd;if(this[_0x12a8('0xe9')][_0xf81764['actionid']]&&!_[_0x12a8('0x47')](this[_0x12a8('0x29')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['queue']])){if(this[_0x12a8('0xf6')][_0x142aa5[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]]){this[_0x12a8('0xf6')][_0x142aa5['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]]=this[_0x12a8('0xf6')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]]?this[_0x12a8('0xf6')][this[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xb5')]]:this[_0x12a8('0x29')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['queue']]?this[_0x12a8('0x29')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]][_0x12a8('0xf7')]||0x0:0x0;}this[_0x12a8('0x29')][this['actions'][_0xf81764[_0x12a8('0xeb')]]['queue']]['_rr']=this[_0x12a8('0xf6')][this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]];for(var _0x36e8ee=0x0;_0x36e8ee<this[_0x12a8('0x29')][this[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xb5')]][_0x12a8('0x90')];_0x36e8ee+=0x1){_0x4251dd=rr(this[_0x12a8('0x29')][this['actions'][_0xf81764['actionid']][_0x12a8('0xb5')]]);this[_0x12a8('0xf6')][_0x142aa5[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]]=this[_0x12a8('0x29')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]][_0x12a8('0xf7')];if(_0x4251dd[_0x12a8('0x81')]==='1'&&_0x4251dd[_0x12a8('0xf0')]==='0'){break;}}if(!_[_0x12a8('0xf2')](_0x4251dd)){this[_0x12a8('0x21')][_0x4251dd[_0x12a8('0xf1')]][_0x12a8('0xf8')]=_[_0x12a8('0x3e')](this['agents'][_0x4251dd[_0x12a8('0xf1')]][_0x12a8('0xf8')])?!![]:this['agents'][_0x4251dd[_0x12a8('0xf1')]]['unlockRR'];}loggerBooked[_0x12a8('0x48')](_0x12a8('0xf9'),_0xf81764[_0x12a8('0xeb')],_0x12a8('0xfa'),JSON[_0x12a8('0x70')](_[_0x12a8('0xfb')](this[_0x12a8('0x21')][_0x4251dd['stateinterface']],[_0x12a8('0x45'),'unlockRR'])),_0x12a8('0xfc'),JSON[_0x12a8('0x70')](_0x4251dd[_0x12a8('0xf3')]));if(!_[_0x12a8('0xf2')](_0x4251dd)&&_0x4251dd[_0x12a8('0x81')]==='1'&&_0x4251dd['paused']==='0'&&this[_0x12a8('0x21')][_0x4251dd[_0x12a8('0xf1')]][_0x12a8('0xf8')]){this['agents'][_0x4251dd['stateinterface']]['unlockRR']=![];this[_0x12a8('0x29')][_0x142aa5[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xb5')]]=[];this[_0x12a8('0x1e')][_0x12a8('0xfd')](_0x4251dd[_0x12a8('0xf3')],_0x4251dd[_0x12a8('0xf1')])[_0x12a8('0x96')](function(_0x112e37){logger[_0x12a8('0x63')](_0x12a8('0xf4'),util['inspect'](_0x112e37,{'showHidden':![],'depth':null}));})['finally'](function(){_0x142aa5[_0x12a8('0xb9')](_0x142aa5[_0x12a8('0x1f')][_0x142aa5[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['queue']]);setTimeout(function(){_0x142aa5[_0x12a8('0x21')][_0x4251dd[_0x12a8('0xf1')]][_0x12a8('0xf8')]=!![];loggerBooked[_0x12a8('0x48')](_0x12a8('0xfe'),_0xf81764[_0x12a8('0xeb')],'Agent:\x20',JSON[_0x12a8('0x70')](_[_0x12a8('0xfb')](_0x142aa5[_0x12a8('0x21')][_0x4251dd[_0x12a8('0xf1')]],['name','unlockRR'])),_0x12a8('0xfc'),JSON[_0x12a8('0x70')](_0x4251dd[_0x12a8('0xf3')]));},0xc7);delete _0x142aa5[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]];unlockQueueStatus(_0x33c238,_0xf81764['actionid']);});}else{loggerBooked['info']('[booked][unlock]');this[_0x12a8('0xb9')](this[_0x12a8('0x1f')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]]);hopperUtils[_0x12a8('0xd4')]({'active':![],'ContactId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd7')],'ListId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd8')],'VoiceQueueId':this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd9')]||undefined,'CampaignId':this[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xda')]||undefined})['catch'](loggerCatch(_0x12a8('0xff')));delete this['actions'][_0xf81764[_0x12a8('0xeb')]];unlockQueueStatus(_0x33c238);}}else{loggerBooked[_0x12a8('0x48')](_0x12a8('0x100'));this[_0x12a8('0xb9')](this[_0x12a8('0x1f')][this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]]['ContactId'],'ListId':this['actions'][_0xf81764['actionid']]['ListId'],'VoiceQueueId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd9')]||undefined,'CampaignId':this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x101')));delete this['actions'][_0xf81764[_0x12a8('0xeb')]];unlockQueueStatus(_0x33c238);}}else{loggerBooked['info'](_0x12a8('0x102'));this[_0x12a8('0xb9')](this[_0x12a8('0x1f')][this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xb5')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd7')],'ListId':this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]][_0x12a8('0xd8')],'VoiceQueueId':this['actions'][_0xf81764[_0x12a8('0xeb')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x12a8('0xe9')][_0xf81764['actionid']][_0x12a8('0xda')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x12a8('0xe9')][_0xf81764[_0x12a8('0xeb')]];unlockQueueStatus(_0x33c238);}};Dialer[_0x12a8('0x1a')][_0x12a8('0x2e')]=function(_0x33ff25){var _0x1cc5d8=this[_0x12a8('0xe9')][_0x33ff25[_0x12a8('0xeb')]];if(_0x1cc5d8){delete this['actions'][_0x33ff25[_0x12a8('0xeb')]];_0x1cc5d8[_0x12a8('0xc6')]=moment()[_0x12a8('0x43')](_0x12a8('0xbb'));var _0xb2768e=_0x1cc5d8[_0x12a8('0x40')]===_0x12a8('0xb8')?this[_0x12a8('0x20')][_0x1cc5d8['queue']]:this[_0x12a8('0x1f')][_0x1cc5d8[_0x12a8('0x103')]()];if(_0x33ff25['response']!==_0x12a8('0x104')){this[_0x12a8('0xb9')](_0xb2768e);return this[_0x12a8('0x105')](_0x1cc5d8,_0xb2768e,_0x33ff25)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x106')));}this[_0x12a8('0xb7')][_0x33ff25[_0x12a8('0xb6')]]=_0x1cc5d8;}};Dialer[_0x12a8('0x1a')][_0x12a8('0x107')]=function(_0x294723){var _0x3f412c=this;var _0x141e50=this[_0x12a8('0xb7')][_0x294723[_0x12a8('0xb6')]];var _0x497bb4;if(!_[_0x12a8('0xf2')](_0x294723)&&!_[_0x12a8('0xf2')](_0x294723[_0x12a8('0x108')])&&!_[_0x12a8('0xf2')](_0x294723[_0x12a8('0x108')]['amdstatus'])&&_0x294723[_0x12a8('0x109')]===_0x12a8('0x10a')&&_0x141e50){if(_0x141e50[_0x12a8('0x40')]!==_0x12a8('0xb8')&&this['voiceQueues'][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0x10b')]&&_0x294723[_0x12a8('0x10c')]===_0x12a8('0x10d')){delete this[_0x12a8('0xb7')][_0x294723['uniqueid']];this[_0x12a8('0xb9')](this[_0x12a8('0x1f')][_0x141e50[_0x12a8('0xb5')]]);this['voiceQueues'][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0xbc')]+=0x1;this[_0x12a8('0x1f')][_0x141e50['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x497bb4=new Hangup(_0x141e50,_0x294723);_0x497bb4[_0x12a8('0x6b')]=0x12;_0x497bb4[_0x12a8('0x6c')]='HangupInAMD';_0x497bb4['membername']=_0x12a8('0x10e');ami[_0x12a8('0x3f')]('custom:amd',ut[_0x12a8('0x10f')](_0x497bb4,_0x12a8('0x110')));this[_0x12a8('0x111')](_0x497bb4,'[syncHangupInAMD][createHistory]',_0x12a8('0x112'));}if(_0x141e50[_0x12a8('0x40')]!=='ivr'&&this[_0x12a8('0x1f')][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0x10b')]&&_0x294723['value']==='MACHINE'){return new Promise(function(_0x5b6b0c,_0x5f3056){delete _0x3f412c[_0x12a8('0xb7')][_0x294723['uniqueid']];_0x3f412c[_0x12a8('0xb9')](_0x3f412c[_0x12a8('0x1f')][_0x141e50[_0x12a8('0xb5')]]);_0x3f412c[_0x12a8('0x1f')][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0xbc')]+=0x1;_0x3f412c[_0x12a8('0x1f')][_0x141e50[_0x12a8('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x423521=_0x3f412c[_0x12a8('0x1f')][_0x141e50[_0x12a8('0xb5')]];var _0x5b07e5=new Hangup(_0x141e50,_0x294723);_0x5b07e5[_0x12a8('0x6b')]=0x13;_0x5b07e5['statedesc']=_0x12a8('0x113');_0x5b07e5[_0x12a8('0x114')]=_0x12a8('0x10e');_0x5b07e5['countmachineretry']+=0x1;_0x5b07e5[_0x12a8('0xce')]+=0x1;_0x5b07e5[_0x12a8('0x110')]=!![];ami[_0x12a8('0x3f')](_0x12a8('0x115'),ut[_0x12a8('0x10f')](_0x5b07e5,'amd'));hopperUtils['createHistory'](_0x5b07e5)['catch'](loggerCatch(_0x12a8('0x116')));if(_0x5b07e5[_0x12a8('0x117')]+_0x5b07e5[_0x12a8('0x118')]+_0x5b07e5[_0x12a8('0x119')]+_0x5b07e5[_0x12a8('0x11a')]+_0x5b07e5[_0x12a8('0xcd')]+_0x5b07e5[_0x12a8('0xe3')]+_0x5b07e5['countmachineretry']+_0x5b07e5[_0x12a8('0x11b')]>=_0x423521['dialGlobalMaxRetry']){_0x3f412c[_0x12a8('0x11c')](_0x5b07e5,_0x5b6b0c,_0x5f3056,_0x12a8('0x11d'));}else{if(_0x5b07e5[_0x12a8('0x11e')]>=_0x423521['dialMachineMaxRetry']){_0x3f412c['createStateFinal'](_0x5b07e5,_0x5b6b0c,_0x5f3056,'reason\x2019\x20machine....');}else{hopperUtils[_0x12a8('0xd4')]({'active':![],'countmachineretry':_0x5b07e5['countmachineretry'],'scheduledat':moment()[_0x12a8('0xd5')](_0x423521[_0x12a8('0x11f')],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x5b07e5[_0x12a8('0xd7')],'ListId':_0x5b07e5['ListId'],'VoiceQueueId':_0x5b07e5[_0x12a8('0xd9')]||undefined,'CampaignId':_0x5b07e5[_0x12a8('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x5b6b0c({'reschedule':0x1});}}});}if(_0x141e50['type']===_0x12a8('0xb8')&&this[_0x12a8('0x20')][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0x10b')]&&_0x294723[_0x12a8('0x10c')]===_0x12a8('0x10d')){delete this[_0x12a8('0xb7')][_0x294723[_0x12a8('0xb6')]];this[_0x12a8('0xb9')](this[_0x12a8('0x20')][_0x141e50[_0x12a8('0xb5')]]);_0x497bb4=new Hangup(_0x141e50,_0x294723);_0x497bb4[_0x12a8('0x6b')]=0x12;_0x497bb4[_0x12a8('0x6c')]=_0x12a8('0x120');_0x497bb4[_0x12a8('0x114')]=_0x12a8('0x10e');ami[_0x12a8('0x3f')](_0x12a8('0x115'),ut['buildObj'](_0x497bb4,_0x12a8('0x110')));this['saveInDb'](_0x497bb4,_0x12a8('0x121'),_0x12a8('0x122'));}if(_0x141e50[_0x12a8('0x40')]==='ivr'&&this['campaigns'][_0x141e50['queue']]['dialAMDActive']&&_0x294723['value']==='MACHINE'){return new Promise(function(_0x58c345,_0x3c940d){delete _0x3f412c[_0x12a8('0xb7')][_0x294723['uniqueid']];_0x3f412c[_0x12a8('0xb9')](_0x3f412c[_0x12a8('0x20')][_0x141e50['queue']]);_0x3f412c['campaigns'][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0xbc')]+=0x1;_0x3f412c[_0x12a8('0x20')][_0x141e50[_0x12a8('0xb5')]][_0x12a8('0x123')]+=0x1;var _0x47c8ff=_0x3f412c[_0x12a8('0x20')][_0x141e50[_0x12a8('0xb5')]];var _0x31fe1e=new Hangup(_0x141e50,_0x294723);_0x31fe1e[_0x12a8('0x6b')]=0x13;_0x31fe1e['statedesc']=_0x12a8('0x113');_0x31fe1e[_0x12a8('0x114')]=_0x12a8('0x10e');_0x31fe1e[_0x12a8('0x11e')]+=0x1;_0x31fe1e[_0x12a8('0xce')]+=0x1;_0x31fe1e[_0x12a8('0x110')]=!![];ami[_0x12a8('0x3f')](_0x12a8('0x115'),ut['buildObj'](_0x31fe1e,_0x12a8('0x110')));hopperUtils[_0x12a8('0xc1')](_0x31fe1e)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x116')));if(_0x31fe1e['countbusyretry']+_0x31fe1e[_0x12a8('0x118')]+_0x31fe1e['countnoanswerretry']+_0x31fe1e[_0x12a8('0x11a')]+_0x31fe1e[_0x12a8('0xcd')]+_0x31fe1e[_0x12a8('0xe3')]+_0x31fe1e[_0x12a8('0x11e')]+_0x31fe1e[_0x12a8('0x11b')]>=_0x47c8ff[_0x12a8('0x124')]){_0x3f412c[_0x12a8('0x11c')](_0x31fe1e,_0x58c345,_0x3c940d,'reason19\x20machine....');}else{if(_0x31fe1e[_0x12a8('0x11e')]>=_0x47c8ff[_0x12a8('0x125')]){_0x3f412c[_0x12a8('0x126')](_0x31fe1e,_0x58c345,_0x3c940d,_0x12a8('0x127'));}else{hopperUtils[_0x12a8('0xd4')]({'active':![],'countmachineretry':_0x31fe1e[_0x12a8('0x11e')],'scheduledat':moment()[_0x12a8('0xd5')](_0x47c8ff['dialMachineRetryFrequency'],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x31fe1e[_0x12a8('0xd7')],'ListId':_0x31fe1e[_0x12a8('0xd8')],'VoiceQueueId':_0x31fe1e[_0x12a8('0xd9')]||undefined,'CampaignId':_0x31fe1e[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x128')));_0x58c345({'reschedule':0x1});}}});}}};Dialer[_0x12a8('0x1a')][_0x12a8('0x129')]=function(_0x5aa393){var _0x3dc968=this[_0x12a8('0xb7')][_0x5aa393['uniqueid']];var _0x316b28;if(_0x3dc968&&_0x3dc968['type']==='ivr'){delete this[_0x12a8('0xb7')][_0x5aa393[_0x12a8('0xb6')]];this[_0x12a8('0xb9')](this[_0x12a8('0x20')][_0x3dc968[_0x12a8('0xb5')]]);this['campaigns'][_0x3dc968['queue']][_0x12a8('0x12a')]+=0x1;_0x316b28=new Hangup(_0x3dc968,_0x5aa393);hopperUtils[_0x12a8('0xc1')](_0x316b28)['catch'](loggerCatch(_0x12a8('0x12b')));hopperUtils[_0x12a8('0xc3')](_0x316b28)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x12c')));}if(_0x3dc968&&_0x3dc968[_0x12a8('0x40')]!==_0x12a8('0xb8')&&isNotNull(this[_0x12a8('0x1f')][_0x3dc968[_0x12a8('0xb5')]][_0x12a8('0x12d')])){delete this[_0x12a8('0xb7')][_0x5aa393['uniqueid']];this[_0x12a8('0xb9')](this['voiceQueues'][_0x3dc968[_0x12a8('0xb5')]]);this['voiceQueues'][_0x3dc968[_0x12a8('0xb5')]][_0x12a8('0xbc')]+=0x1;this[_0x12a8('0x1f')][_0x3dc968['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x316b28=new Hangup(_0x3dc968,_0x5aa393);_0x316b28['state']=0x10;_0x316b28[_0x12a8('0x6c')]=_0x12a8('0x12e');_0x316b28[_0x12a8('0x114')]=_0x12a8('0x12f');hopperUtils['createHistory'](_0x316b28)['catch'](loggerCatch(_0x12a8('0x12b')));hopperUtils[_0x12a8('0xc3')](_0x316b28)['catch'](loggerCatch(_0x12a8('0x12c')));}if(_0x3dc968&&_0x3dc968[_0x12a8('0x40')]!==_0x12a8('0xb8')&&!isNotNull(this[_0x12a8('0x1f')][_0x3dc968[_0x12a8('0xb5')]]['dialQueueProject'])){delete this[_0x12a8('0xb7')][_0x5aa393[_0x12a8('0xb6')]];this[_0x12a8('0xb9')](this[_0x12a8('0x1f')][_0x3dc968[_0x12a8('0xb5')]]);this[_0x12a8('0x1f')][_0x3dc968['queue']][_0x12a8('0x130')]+=0x1;_0x316b28=new Hangup(_0x3dc968,_0x5aa393);_0x316b28[_0x12a8('0x6b')]=0xc;_0x316b28[_0x12a8('0x6c')]=_0x5aa393['cause-txt'];_0x316b28[_0x12a8('0x114')]=_0x12a8('0x131');hopperUtils[_0x12a8('0xc1')](_0x316b28)['catch'](loggerCatch(_0x12a8('0x12b')));hopperUtils[_0x12a8('0xc3')](_0x316b28)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x12c')));}};Dialer[_0x12a8('0x1a')][_0x12a8('0xb')]=function(_0x201055){var _0x82f354=this;if(!_0x82f354[_0x12a8('0x132')][_0x201055['name']]){_0x82f354[_0x12a8('0x132')][_0x201055[_0x12a8('0x45')]]={'running':![]};}else if(_0x82f354[_0x12a8('0x132')][_0x201055[_0x12a8('0x45')]][_0x12a8('0x133')]===!![]){return;}else if(_0x82f354[_0x12a8('0x132')][_0x201055['name']]['running']===![]){_0x82f354[_0x12a8('0x132')][_0x201055[_0x12a8('0x45')]][_0x12a8('0x133')]=!![];}var _0x27c158=_0x82f354[_0x12a8('0x1f')][_0x201055['name']];var _0x359d02=_0x27c158[_0x12a8('0x66')]!==utils[_0x12a8('0x67')][_0x12a8('0x78')];var _0x3e39a6=utils[_0x12a8('0x134')](_0x27c158);_0x27c158[_0x12a8('0x135')]=utils[_0x12a8('0x136')](_0x27c158,_0x82f354[_0x12a8('0x22')]);Promise[_0x12a8('0x137')]()[_0x12a8('0x3c')](function(){if(_0x27c158[_0x12a8('0x135')]===utils[_0x12a8('0x67')][_0x12a8('0x78')]){if(_0x359d02){clearPredictiveAttributes(_0x27c158);_0x201055['startPredictive']=undefined;_0x201055[_0x12a8('0x27')]=undefined;}if(_0x27c158[_0x12a8('0x135')]===utils[_0x12a8('0x67')]['INACTIVE']){_0x201055[_0x12a8('0x138')]=0x0;_0x201055[_0x12a8('0xf0')]=0x0;_0x201055['inUse']=0x0;_0x201055[_0x12a8('0x139')]=0x0;_0x201055[_0x12a8('0x13a')]=0x0;}}else if(_0x27c158[_0x12a8('0x135')]===utils['CAMPAIGN_STATUS'][_0x12a8('0x13b')]&&!_0x3e39a6){return _0x82f354[_0x12a8('0x87')](_0x27c158,!![])[_0x12a8('0x3c')](function(){return _0x82f354[_0x12a8('0x87')](_0x27c158,![]);})[_0x12a8('0x3c')](function(){return _0x82f354[_0x12a8('0xa7')](_0x27c158);})['catch'](function(_0x132ab9){loggerSyncQueueSummary[_0x12a8('0x60')](_0x12a8('0x13c'),util[_0x12a8('0x42')](_0x132ab9,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x27c158);});}else{clearPredictiveAttributes(_0x27c158);}})[_0x12a8('0x3c')](function(){var _0xbcce6d=_0x201055['compareToOutboundQueue'](_0x27c158);if(_0xbcce6d||_0x27c158[_0x12a8('0x13d')]){_0x27c158[_0x12a8('0x13d')]=![];_0x201055['updateReportFromOutboundQueue'](_0x27c158);Object['assign'](_0x27c158,_0x201055);emitOutboundVoiceQueueSummary(_0x201055);}_0x82f354['queuesSummary'][_0x27c158[_0x12a8('0x45')]][_0x12a8('0x133')]=![];})[_0x12a8('0x96')](function(_0x135d28){logger[_0x12a8('0x63')]('[syncQueueSummary]',util[_0x12a8('0x42')](_0x135d28,{'showHidden':![],'depth':null}));_0x82f354['queuesSummary'][_0x27c158['name']]['running']=![];});};Dialer[_0x12a8('0x1a')][_0x12a8('0x33')]=_[_0x12a8('0x13e')](function(){var _0x3d75dd=_[_0x12a8('0x13f')](this[_0x12a8('0x1f')],function(_0x234e85){return _0x234e85[_0x12a8('0x140')];});var _0x537e2e=_['filter'](this[_0x12a8('0x21')],function(_0x8c997c){return _0x8c997c[_0x12a8('0x141')]&&_0x8c997c[_0x12a8('0x81')]==='reachable';});if(_0x3d75dd[_0x12a8('0x90')]>0x0&&_0x537e2e[_0x12a8('0x90')]>0x0){return Promise[_0x12a8('0x137')]()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x12a8('0x142')](_0x3d75dd,'id'),previewRecallmeReminderInterval,_['map'](_0x537e2e,'id')))[_0x12a8('0x3c')](function(_0xa44a59){for(var _0x534613=0x0;_0x534613<_0xa44a59[_0x12a8('0x90')];_0x534613++){var _0x34adfe=_0xa44a59[_0x534613][_0x12a8('0x143')][_0x12a8('0x45')];if(_0x34adfe)io['to'](util[_0x12a8('0x43')](_0x12a8('0x144'),_0x34adfe))[_0x12a8('0x3f')](_0x12a8('0x145'),{'hopper':_0xa44a59[_0x534613]});}})[_0x12a8('0x96')](function(_0x3c4b09){logger[_0x12a8('0x63')](_0x12a8('0x146'),_0x3c4b09);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x12a8('0x1a')][_0x12a8('0x3b')]=function(){var _0x2dba59=this;setInterval(function(){_0x2dba59[_0x12a8('0x147')](_0x2dba59['uniqueId'],_0x12a8('0x148'));_0x2dba59[_0x12a8('0x147')](_0x2dba59[_0x12a8('0xe9')],'[actions]');},0x32c8);};Dialer['prototype'][_0x12a8('0x147')]=function(_0x3e150b,_0x1f8a36){var _0x1ae66c=this;for(var _0x5543ba in _0x3e150b){if(typeof _0x3e150b[_0x5543ba]!==_0x12a8('0x9f')){this[_0x12a8('0x1d')][_0x12a8('0x1b')](function(){if(!_['isNil'](_0x3e150b[_0x5543ba])){return ami[_0x12a8('0x91')]({'action':'status','channel':_0x3e150b[_0x5543ba][_0x12a8('0xea')]})[_0x12a8('0x96')](function(_0x3882fb){if(_0x3882fb[_0x12a8('0x66')]===_0x12a8('0x149')){setTimeout(function(){if(_0x3e150b[_0x5543ba]&&_0x3e150b[_0x5543ba][_0x12a8('0x40')]!=='ivr'){_0x1ae66c[_0x12a8('0xb9')](_0x1ae66c['voiceQueues'][_0x3e150b[_0x5543ba][_0x12a8('0xb5')]]);logger[_0x12a8('0x63')](_0x12a8('0x14a'),_0x1f8a36,_0x5543ba,_0x3e150b[_0x5543ba]['queue']);delete _0x3e150b[_0x5543ba];}if(_0x3e150b[_0x5543ba]&&_0x3e150b[_0x5543ba][_0x12a8('0x40')]==='ivr'){_0x1ae66c[_0x12a8('0xb9')](_0x1ae66c[_0x12a8('0x20')][_0x3e150b[_0x5543ba][_0x12a8('0xb5')]]);logger[_0x12a8('0x63')]('[Dialer][checkChannel][ivr]',_0x1f8a36,_0x5543ba,_0x3e150b[_0x5543ba][_0x12a8('0xb5')]);delete _0x3e150b[_0x5543ba];}},0x2328);}});}});}}};Dialer[_0x12a8('0x1a')]['getVoiceQueueRtPauses']=function(_0x34f69e){return Promise['resolve']()[_0x12a8('0x3c')](voiceQueueRt[_0x12a8('0x14b')](_0x34f69e))[_0x12a8('0x96')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x12a8('0xb9')]=function(_0x3c5c1a){if(!_[_0x12a8('0x3e')](_0x3c5c1a)&&_0x3c5c1a!==null){if(typeof _0x3c5c1a[_0x12a8('0x77')]!==_0x12a8('0x9f')){if(_0x3c5c1a[_0x12a8('0x77')]>0x0){_0x3c5c1a[_0x12a8('0x77')]-=0x1;}else{logger[_0x12a8('0x63')](_0x12a8('0x14c'));}}}else{logger[_0x12a8('0x63')](_0x12a8('0x14d'));}};Dialer['prototype'][_0x12a8('0x14e')]=function(_0x148d0e,_0x1d5955){var _0x36839e=this;return function(_0x2ba0af){_0x36839e[_0x12a8('0xb9')](_0x1d5955);logger[_0x12a8('0x63')](_0x148d0e,util['inspect'](_0x2ba0af,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x12a8('0x14f')]=function(_0x2a683c,_0x56392c,_0x17de23){var _0x5b482b={'state':0x19,'statedesc':_0x12a8('0x150')};this[_0x12a8('0xb9')](_0x56392c);this[_0x12a8('0x111')](_[_0x12a8('0x5e')](_0x5b482b,_[_0x12a8('0xfb')](_0x17de23,[_0x12a8('0xd7'),_0x12a8('0xd8'),_0x12a8('0x151'),_0x12a8('0xd9'),_0x12a8('0xda')])),_0x12a8('0x152'),_0x12a8('0x153'));logger[_0x12a8('0x63')](_0x2a683c);};Dialer[_0x12a8('0x1a')][_0x12a8('0x111')]=function(_0x14e680,_0x405cb7,_0x17b06b){hopperUtils[_0x12a8('0xc1')](_0x14e680)[_0x12a8('0x96')](loggerCatch(_0x405cb7));hopperUtils['moveContactManagedDialer'](_0x14e680)[_0x12a8('0x96')](loggerCatch(_0x17b06b));};Dialer[_0x12a8('0x1a')][_0x12a8('0xe6')]=function(_0x24c6b5,_0x18bf04){hopperUtils[_0x12a8('0xc1')](_0x24c6b5)[_0x12a8('0x96')](loggerCatch(_0x12a8('0xc2')));if(_0x18bf04==0x0){hopperUtils[_0x12a8('0xc3')](_0x24c6b5)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x154')));}};Dialer[_0x12a8('0x1a')]['checkPreviewRecallReminder']=function(_0x10ca3b){return Promise[_0x12a8('0x137')]()['then'](cmHopper[_0x12a8('0x155')](_0x10ca3b['id'],previewRecallmeReminderInterval))[_0x12a8('0x3c')](function(_0x128923){for(var _0x588449=0x0;_0x588449<_0x128923[_0x12a8('0x90')];_0x588449++){var _0x2f1275=_0x128923[_0x588449][_0x12a8('0x143')]['name'];if(_0x2f1275)io['to'](util[_0x12a8('0x43')]('user:%s',_0x2f1275))[_0x12a8('0x3f')](_0x12a8('0x145'),{'hopper':_0x128923[_0x588449]});}})['catch'](function(){});};Dialer[_0x12a8('0x1a')][_0x12a8('0xa5')]=function(_0xbb293){var _0x2617ae=this;return function(){_0x2617ae['handleIvr'](_0xbb293);};};Dialer[_0x12a8('0x1a')][_0x12a8('0x156')]=function(_0x11cf19,_0x4c5ddc){var _0x4d230a=this;var _0x534c00=uuid['v4']();this[_0x12a8('0xe9')][_0x534c00]=new Action(_0x11cf19,_0x4c5ddc,_0x534c00);return new Promise(function(_0x38b473,_0xd4d927){if(_[_0x12a8('0x3e')](_0x11cf19)&&typeof _0x11cf19!==_0x12a8('0x157')){return _0xd4d927(msgResponse(_0x12a8('0x158'),_0x12a8('0x88'),_0x12a8('0x159')));}if(_[_0x12a8('0x3e')](_0x4c5ddc[_0x12a8('0x15a')])||_0x4c5ddc[_0x12a8('0x15a')]===null){return _0xd4d927(msgResponse(_0x12a8('0x158'),'Failure',_0x12a8('0x15b')));}var _0x11f706={'XMD-CALLERID':_0x4d230a[_0x12a8('0xe9')][_0x534c00][_0x12a8('0x15c')](),'XMD-AGI':_0x11cf19[_0x12a8('0x12d')]?util[_0x12a8('0x43')](_0x12a8('0x15d'),ipAgi,_0x11cf19[_0x12a8('0x12d')]):_0x12a8('0x15e'),'XMD-AGIAFTER':_0x11cf19[_0x12a8('0xcc')]?util['format'](_0x12a8('0x15d'),ipAgi,_0x11cf19[_0x12a8('0xcc')]):_0x12a8('0x15e'),'XMD-QUEUE':utils[_0x12a8('0x15f')](_0x11cf19)?util[_0x12a8('0x43')](_0x12a8('0x160'),_0x11cf19[_0x12a8('0x45')],_0x11cf19['dialQueueOptions']||'',_0x11cf19[_0x12a8('0xc0')]?'c':'',_0x11cf19[_0x12a8('0x161')]||0x3):'NONE','XMD-CONTACTID':_0x4c5ddc[_0x12a8('0xd7')],'XMD-CDRTYPE':_0x12a8('0x7'),'CALLERID(all)':_0x4d230a['actions'][_0x534c00]['getCaller'](),'XMD-AMD':_0x11cf19['dialAMDActive']?_0x12a8('0x13b'):_0x12a8('0x15e'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x11cf19[_0x12a8('0x10b')]){_0x11f706[_0x12a8('0x162')]=_0x11cf19[_0x12a8('0x163')]||0x9c4;_0x11f706[_0x12a8('0x164')]=_0x11cf19['dialAMDGreeting']||0x5dc;_0x11f706[_0x12a8('0x165')]=_0x11cf19[_0x12a8('0x166')]||0x320;_0x11f706[_0x12a8('0x167')]=_0x11cf19[_0x12a8('0x168')]||0x1388;_0x11f706[_0x12a8('0x169')]=_0x11cf19[_0x12a8('0x16a')]||0x64;_0x11f706[_0x12a8('0x16b')]=_0x11cf19['dialAMDBetweenWordsSilence']||0x32;_0x11f706['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x11cf19[_0x12a8('0x16c')]||0x3;_0x11f706[_0x12a8('0x16d')]=_0x11cf19[_0x12a8('0x16e')]||0x100;_0x11f706[_0x12a8('0x16f')]=_0x11cf19[_0x12a8('0x170')]||0x1388;}if(utils['isOutboundQueue'](_0x11cf19)){_0x11f706[_0x12a8('0x171')]=_0x4c5ddc['VoiceQueueId'];}else{_0x11f706['XMD-CAMPAIGNID']=_0x4c5ddc[_0x12a8('0xda')];}var _0x3515a1=utils[_0x12a8('0x172')](_0x4c5ddc[_0x12a8('0x173')]);Object[_0x12a8('0x174')](_0x11f706,_0x3515a1);var _0x494dd7=_0x4d230a['isTrunkReachable'](_0x11cf19[_0x12a8('0x82')])?utils[_0x12a8('0x175')](_0x11cf19[_0x12a8('0x82')]['callerid'],_0x11cf19[_0x12a8('0x176')],_0x11cf19[_0x12a8('0x177')]>0x0?utils[_0x12a8('0x178')](_0x11cf19[_0x12a8('0x179')],_0x11cf19[_0x12a8('0x177')]):_0x11cf19['dialOriginateCallerIdNumber']):utils[_0x12a8('0x175')](_[_0x12a8('0xf2')](_0x11cf19['TrunkBackup'])?_0x11cf19['Trunk'][_0x12a8('0x17a')]:_0x11cf19[_0x12a8('0x17b')][_0x12a8('0x17a')],_0x11cf19[_0x12a8('0x176')],_0x11cf19[_0x12a8('0x177')]>0x0?utils[_0x12a8('0x178')](_0x11cf19[_0x12a8('0x179')],_0x11cf19[_0x12a8('0x177')]):_0x11cf19[_0x12a8('0x179')]);if(_0x494dd7){_0x11f706['XMD-ORIGINATECALLERIDNAME']=_0x4d230a[_0x12a8('0xe9')][_0x534c00][_0x12a8('0x17c')]=utils[_0x12a8('0x17d')](_0x494dd7);_0x11f706['XMD-ORIGINATECALLERIDNUM']=_0x4c5ddc[_0x12a8('0x15a')];}_0x11cf19['variables']=_0x11f706;return ami[_0x12a8('0x91')]({'actionid':_0x534c00,'action':_0x12a8('0x158'),'channel':_0x4d230a['isTrunkReachable'](_0x11cf19[_0x12a8('0x82')])?util[_0x12a8('0x43')]('SIP/%s/%s%s',_0x11cf19[_0x12a8('0x82')][_0x12a8('0x45')],isNotNull(_0x11cf19['dialPrefix'])?_0x11cf19[_0x12a8('0x17e')]['trim']()||'':'',_0x11cf19[_0x12a8('0x17f')]>0x0?_0x4c5ddc[_0x12a8('0x15a')][_0x12a8('0x180')](_0x11cf19[_0x12a8('0x17f')]):_0x4c5ddc[_0x12a8('0x15a')]):util[_0x12a8('0x43')]('SIP/%s/%s%s',_['isNil'](_0x11cf19['TrunkBackup'])?_0x11cf19[_0x12a8('0x82')][_0x12a8('0x45')]:_0x11cf19[_0x12a8('0x17b')]['name'],isNotNull(_0x11cf19[_0x12a8('0x17e')])?_0x11cf19[_0x12a8('0x17e')][_0x12a8('0x181')]()||'':'',_0x11cf19['dialCutDigit']>0x0?_0x4c5ddc[_0x12a8('0x15a')][_0x12a8('0x180')](_0x11cf19[_0x12a8('0x17f')]):_0x4c5ddc[_0x12a8('0x15a')]),'callerid':_0x494dd7,'Exten':_0x12a8('0x10a'),'Context':'from-sip','Priority':'1','variable':_0x11f706,'timeout':(_0x11cf19[_0x12a8('0x182')]||0x1e)*0x3e8,'async':!![],'channelid':_0x534c00})[_0x12a8('0x3c')](function(_0x287ef0){return _0x38b473(_0x287ef0);})['catch'](function(_0x202079){_0x11cf19[_0x12a8('0x183')]+=0x1;var _0x2c060d=new History(_0x4d230a[_0x12a8('0xe9')][_0x534c00]);logger[_0x12a8('0x63')](util['format'](_0x12a8('0x184'),JSON[_0x12a8('0x70')](_0x202079)));_0x2c060d[_0x12a8('0x6b')]=0xe;_0x2c060d['statedesc']='OriginateError';_0x2c060d[_0x12a8('0xdc')]=moment()[_0x12a8('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c060d[_0x12a8('0x6d')]=_0x2c060d[_0x12a8('0xdc')];hopperUtils[_0x12a8('0xc1')](_0x2c060d)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x185')));_0x4d230a[_0x12a8('0xc3')](_0x2c060d)['catch'](loggerCatch(_0x12a8('0x185')))[_0x12a8('0xf5')](function(){delete _0x4d230a[_0x12a8('0xe9')][_0x534c00];return _0xd4d927(msgResponse(_0x12a8('0x158'),_0x12a8('0x7d'),_0x12a8('0x186')));});});});};Dialer[_0x12a8('0x1a')][_0x12a8('0x187')]=function(_0x3b497b,_0x308c5c,_0x5e85ee){var _0x2cf167=new History(_0x308c5c);if(_0x2cf167[_0x12a8('0x117')]+_0x2cf167[_0x12a8('0x118')]+_0x2cf167[_0x12a8('0x119')]+_0x2cf167[_0x12a8('0x11a')]+_0x2cf167[_0x12a8('0xcd')]+_0x2cf167[_0x12a8('0xe3')]+_0x2cf167[_0x12a8('0x11e')]+_0x2cf167[_0x12a8('0x11b')]>=_0x5e85ee[_0x12a8('0x124')]-0x1){return!![];}switch(_0x3b497b){case 0x3:if(_0x2cf167[_0x12a8('0x119')]>=_0x5e85ee[_0x12a8('0x188')]-0x1){return!![];}hopperUtils[_0x12a8('0xd4')]({'active':![],'countnoanswerretry':_0x2cf167[_0x12a8('0x119')]+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee[_0x12a8('0x189')],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167[_0x12a8('0xd7')],'ListId':_0x2cf167['ListId'],'VoiceQueueId':_0x2cf167[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2cf167[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x18a')));break;case 0x5:if(_0x2cf167[_0x12a8('0x117')]>=_0x5e85ee[_0x12a8('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x2cf167['countbusyretry']+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee['dialBusyRetryFrequency'],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167['ContactId'],'ListId':_0x2cf167['ListId'],'VoiceQueueId':_0x2cf167[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2cf167[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x18c')));break;case 0x8:if(_0x2cf167[_0x12a8('0x118')]>=_0x5e85ee[_0x12a8('0x18d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x2cf167[_0x12a8('0x118')]+=0x1,'scheduledat':moment()['add'](_0x5e85ee[_0x12a8('0x18e')],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167['ContactId'],'ListId':_0x2cf167[_0x12a8('0xd8')],'VoiceQueueId':_0x2cf167[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2cf167[_0x12a8('0xda')]||undefined})['catch'](loggerCatch(_0x12a8('0x18f')));break;case 0x0:if(_0x2cf167['countnosuchnumberretry']>=_0x5e85ee[_0x12a8('0x190')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2cf167['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee['dialNoSuchNumberRetryFrequency'],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167[_0x12a8('0xd7')],'ListId':_0x2cf167[_0x12a8('0xd8')],'VoiceQueueId':_0x2cf167[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2cf167[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x191')));}break;case 0xa:if(_0x2cf167[_0x12a8('0xcd')]>=_0x5e85ee['dialDropMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x2cf167[_0x12a8('0xcd')]+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee[_0x12a8('0xcf')],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167[_0x12a8('0xd7')],'ListId':_0x2cf167['ListId'],'VoiceQueueId':_0x2cf167[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2cf167['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x2cf167[_0x12a8('0xe3')]>=_0x5e85ee[_0x12a8('0xe5')]-0x1){return!![];}hopperUtils[_0x12a8('0xd4')]({'active':![],'countabandonedretry':_0x2cf167['countabandonedretry']+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee['dialAbandonedRetryFrequency'],'minutes')[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167[_0x12a8('0xd7')],'ListId':_0x2cf167[_0x12a8('0xd8')],'VoiceQueueId':_0x2cf167['VoiceQueueId']||undefined,'CampaignId':_0x2cf167['CampaignId']||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x192')));break;case 0x13:if(_0x2cf167[_0x12a8('0x11e')]>=_0x5e85ee[_0x12a8('0x125')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2cf167[_0x12a8('0x11e')]+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee['dialMachineRetryFrequency'],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167['ContactId'],'ListId':_0x2cf167[_0x12a8('0xd8')],'VoiceQueueId':_0x2cf167[_0x12a8('0xd9')]||undefined,'CampaignId':_0x2cf167[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2cf167[_0x12a8('0x11b')]>=_0x5e85ee[_0x12a8('0x193')]-0x1){return!![];}hopperUtils[_0x12a8('0xd4')]({'active':![],'countagentrejectretry':_0x2cf167['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x12a8('0xd5')](_0x5e85ee[_0x12a8('0x194')],_0x12a8('0xd6'))[_0x12a8('0x43')](_0x12a8('0xbb')),'ContactId':_0x2cf167[_0x12a8('0xd7')],'ListId':_0x2cf167[_0x12a8('0xd8')],'VoiceQueueId':_0x2cf167['VoiceQueueId']||undefined,'CampaignId':_0x2cf167[_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x12a8('0x1a')][_0x12a8('0x105')]=function(_0x7025bd,_0x1681bb,_0x139102){var _0x1c2161=this;var _0xd676f6=new History(_0x7025bd);var _0x8b36bd=![];var _0x5a96a2;var _0x2ece43;return new Promise(function(_0x3a15d5,_0x472ec7){if(_[_0x12a8('0x3e')](_0x1681bb)&&typeof _0x1681bb!==_0x12a8('0x157')){return _0x472ec7(msgResponse(_0x12a8('0x195'),_0x12a8('0x88'),'entity\x20is\x20undefine'));}if(_[_0x12a8('0x3e')](_0x139102)&&typeof _0x139102!==_0x12a8('0x157')){return _0x472ec7(msgResponse(_0x12a8('0x195'),_0x12a8('0x88'),_0x12a8('0x196')));}hopperUtils[_0x12a8('0xe4')](_0xd676f6,_0x139102[_0x12a8('0xbd')],_0x1681bb)[_0x12a8('0x3c')](function(_0x264695){if(_0x264695['additional']==0x1)_0x8b36bd=!![];switch(_0x139102[_0x12a8('0xbd')]){case'0':_0x1681bb[_0x12a8('0x197')]+=0x1;_0xd676f6['state']=0x0;_0xd676f6[_0x12a8('0x6c')]='NoSuchNumber';_0xd676f6[_0x12a8('0x11a')]+=0x1;_0xd676f6['countglobal']+=0x1;ami[_0x12a8('0x3f')]('custom:agentnosuchnumber',ut[_0x12a8('0x10f')](_0x7025bd,_0x12a8('0x198')));_0x5a96a2=_0x1681bb[_0x12a8('0x199')];_0x2ece43=_0x1681bb[_0x12a8('0xd0')];hopperUtils[_0x12a8('0xc1')](_0xd676f6)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1c2161[_0x12a8('0x187')](0x0,_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6[_0x12a8('0x11a')]>=_0x1681bb[_0x12a8('0x190')]){_0x1c2161['createStateFinal'](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x19a'));}else{_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x19a'));}}break;case'3':_0x1681bb[_0x12a8('0x19b')]+=0x1;_0xd676f6[_0x12a8('0x6b')]=0x3;_0xd676f6[_0x12a8('0x6c')]=_0x12a8('0x19c');_0xd676f6['countnoanswerretry']+=0x1;_0xd676f6[_0x12a8('0xce')]+=0x1;var _0x38bd53=ut['buildNoAnswerEventPayload'](_0x7025bd,_0x1681bb);ami[_0x12a8('0x3f')](_0x12a8('0x19d'),_0x38bd53);_0x5a96a2=_0x1681bb[_0x12a8('0x189')];_0x2ece43=_0x1681bb[_0x12a8('0xd0')];hopperUtils[_0x12a8('0xc1')](_0xd676f6)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x19e')));if(_0x1c2161[_0x12a8('0x187')](0x3,_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6[_0x12a8('0x119')]>=_0x1681bb[_0x12a8('0x188')]){_0x1c2161[_0x12a8('0x126')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x19f'));}else{_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x19f'));}}break;case'5':_0x1681bb[_0x12a8('0x1a0')]+=0x1;_0xd676f6['state']=0x5;_0xd676f6[_0x12a8('0x6c')]='Busy';_0xd676f6[_0x12a8('0x117')]+=0x1;_0xd676f6[_0x12a8('0xce')]+=0x1;ami[_0x12a8('0x3f')]('custom:agentbusy',ut['buildObj'](_0x7025bd,_0x12a8('0x1a1')));_0x5a96a2=_0x1681bb[_0x12a8('0x1a2')];_0x2ece43=_0x1681bb[_0x12a8('0xd0')];hopperUtils[_0x12a8('0xc1')](_0xd676f6)[_0x12a8('0x96')](loggerCatch(_0x12a8('0x1a3')));if(_0x1c2161['checkRetriveMax'](0x5,_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6[_0x12a8('0x117')]>=_0x1681bb[_0x12a8('0x18b')]){_0x1c2161[_0x12a8('0x126')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1a4'));}else{_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1a4'));}}break;case'8':_0x1681bb[_0x12a8('0x1a5')]+=0x1;_0xd676f6['state']=0x8;_0xd676f6['statedesc']='Congestion';_0xd676f6[_0x12a8('0x118')]+=0x1;_0xd676f6['countglobal']+=0x1;_0x5a96a2=_0x1681bb[_0x12a8('0x18e')];_0x2ece43=_0x1681bb[_0x12a8('0xd0')];ami['emit'](_0x12a8('0x1a6'),ut['buildObj'](_0x7025bd,_0x12a8('0x1a7')));hopperUtils[_0x12a8('0xc1')](_0xd676f6)['catch'](loggerCatch(_0x12a8('0x1a8')));if(_0x1c2161[_0x12a8('0x187')](0x8,_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6[_0x12a8('0x118')]>=_0x1681bb[_0x12a8('0x18d')]){_0x1c2161[_0x12a8('0x126')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1a9'));}else{_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1a9'));}}break;case'11':_0x1681bb['outboundAbandonedCallsDay']+=0x1;_0xd676f6['state']=0xb;_0xd676f6[_0x12a8('0x6c')]=_0x12a8('0xe8');_0xd676f6[_0x12a8('0xe3')]+=0x1;_0xd676f6['countglobal']+=0x1;_0x5a96a2=_0x1681bb[_0x12a8('0xe7')];_0x2ece43=_0x1681bb['callAdditionalPhoneAfterMin'];hopperUtils[_0x12a8('0xc1')](_0xd676f6)['catch'](loggerCatch(_0x12a8('0x1aa')));if(_0x1c2161[_0x12a8('0x187')](0xb,_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6['countabandonedretry']>=_0x1681bb[_0x12a8('0xe5')]){_0x1c2161[_0x12a8('0x126')](_0xd676f6,_0x3a15d5,_0x472ec7,'reason\x2011\x20abandoned');}else{_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1ab'));}}break;case'20':_0x1681bb[_0x12a8('0x1ac')]+=0x1;_0xd676f6[_0x12a8('0x6b')]=0x14;_0xd676f6[_0x12a8('0x6c')]='AgentReject';_0xd676f6['countagentrejectretry']+=0x1;_0xd676f6['countglobal']+=0x1;_0x5a96a2=_0x1681bb[_0x12a8('0x194')];_0x2ece43=_0x1681bb[_0x12a8('0xd0')];ami['emit'](_0x12a8('0x1ad'),ut[_0x12a8('0x10f')](_0x7025bd,_0x12a8('0x1ae')));hopperUtils[_0x12a8('0xc1')](_0xd676f6)[_0x12a8('0x96')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1c2161[_0x12a8('0x187')](0x14,_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6[_0x12a8('0x11b')]>=_0x1681bb[_0x12a8('0x193')]){_0x1c2161[_0x12a8('0x126')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1af'));}else{_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x12a8('0x1af'));}}break;default:_0x1681bb[_0x12a8('0x130')]+=0x1;_0xd676f6[_0x12a8('0x6b')]=0xc;_0xd676f6[_0x12a8('0x6c')]=_0x139102[_0x12a8('0xbd')];_0x5a96a2=_0x1681bb[_0x12a8('0x194')];_0x2ece43=_0x1681bb[_0x12a8('0xd0')];hopperUtils[_0x12a8('0xc1')](_0xd676f6)[_0x12a8('0x96')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1c2161[_0x12a8('0x187')](_0x139102[_0x12a8('0xbd')],_0x7025bd,_0x1681bb)&&!_0x8b36bd){if(_0xd676f6[_0x12a8('0x117')]+_0xd676f6[_0x12a8('0x118')]+_0xd676f6[_0x12a8('0x119')]+_0xd676f6['countnosuchnumberretry']+_0xd676f6[_0x12a8('0xcd')]+_0xd676f6[_0x12a8('0xe3')]+_0xd676f6[_0x12a8('0x11e')]+_0xd676f6[_0x12a8('0x11b')]>=_0x1681bb[_0x12a8('0x124')]){_0x1c2161[_0x12a8('0x11c')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x139102[_0x12a8('0xbd')]);}else{_0x1c2161[_0x12a8('0x126')](_0xd676f6,_0x3a15d5,_0x472ec7,_0x139102['reason']);}}}})[_0x12a8('0x3c')](function(){if(_0x8b36bd){hopperUtils['swapAdditionalPhones'](_0xd676f6,_0x5a96a2,_0x2ece43)[_0x12a8('0x3c')](function(){return _0x3a15d5(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x112623,_0x5ea897,_0x2aa881,_0x148fcf){var _0x582dd5=new Final(_0x112623);_0x582dd5[_0x12a8('0x6b')]=0xf;_0x582dd5['statedesc']=_0x12a8('0x1b0');this['createStateFinal'](_0x582dd5,_0x5ea897,_0x2aa881,_0x148fcf);};Dialer['prototype'][_0x12a8('0x126')]=function(_0x16e937,_0x39b1cd,_0x561ba7,_0x593f33){hopperUtils[_0x12a8('0xc3')](_0x16e937)['then'](function(){return _0x39b1cd(msgResponse('[callProgressDetecting]',_0x12a8('0x104'),_0x593f33));})[_0x12a8('0x96')](function(){return _0x561ba7(msgResponse(_0x12a8('0x1b1'),_0x12a8('0x88'),_0x12a8('0x1b2')));});};Dialer[_0x12a8('0x1a')][_0x12a8('0x9')]=function(_0x2c0084){var _0x515624=_0x2c0084[_0x12a8('0x1b3')]/0x64;var _0x408e34=_0x2c0084['outboundDropCallsDayTimeout']/(_0x2c0084[_0x12a8('0xc7')]+_0x2c0084[_0x12a8('0xbc')]);var _0x4dc7ac=Math[_0x12a8('0x1b4')](_0x2c0084[_0x12a8('0x1b5')]*(_0x2c0084[_0x12a8('0x1b6')]/0x64));var _0x4903d6=Math[_0x12a8('0x1b4')](_0x2c0084['predictiveIntervalAvailable']*(_0x2c0084[_0x12a8('0x1b7')]/0x64));var _0x32f556=_0x2c0084[_0x12a8('0x138')]+_0x2c0084[_0x12a8('0x139')];var _0x68630e=Math[_0x12a8('0x1b8')](_0x2c0084['erlangCalls']*_0x2c0084[_0x12a8('0x5a')]*_0x2c0084[_0x12a8('0x1b9')]*_0x2c0084[_0x12a8('0x1ba')]);if(_['isUndefined'](_0x2c0084['startProgressive'])){if(!_[_0x12a8('0x3e')](_0x2c0084['startPredictive'])){_0x2c0084[_0x12a8('0x26')]=undefined;loggerPredictive[_0x12a8('0x63')](_0x12a8('0x1bb'),_0x12a8('0x1bc'));}if(!_[_0x12a8('0x3e')](_0x2c0084['handlePredictive'])){loggerPredictive[_0x12a8('0x63')](_0x12a8('0x1bb'),_0x12a8('0x1bd'));clearInterval(_0x2c0084['handlePredictive']);_0x2c0084[_0x12a8('0x62')]=undefined;}_0x2c0084[_0x12a8('0x27')]=moment()['format'](_0x12a8('0xbb'));loggerPredictive[_0x12a8('0x48')](_0x2c0084[_0x12a8('0x45')],_0x12a8('0x1be'),_0x2c0084[_0x12a8('0x27')]);this[_0x12a8('0xaa')](_0x2c0084,0x1);}else if(ifInterval(_0x2c0084[_0x12a8('0x1bf')],_0x2c0084[_0x12a8('0x27')])){this[_0x12a8('0xaa')](_0x2c0084,0x1);loggerPredictiveCalls[_0x12a8('0x48')](_0x12a8('0x1c0'),_0x2c0084[_0x12a8('0x27')],_0x2c0084[_0x12a8('0x45')]);_0x2c0084[_0x12a8('0x58')]=0x0;_0x2c0084['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x515624<_0x408e34&&_0x2c0084[_0x12a8('0x1c1')]==='dropRate'){clearPredictiveAttributes(_0x2c0084);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x1c2'),_0x12a8('0x1c3'),_0x408e34,'startProgressive',_0x2c0084[_0x12a8('0x45')]);}else if(_0x68630e<_0x2c0084[_0x12a8('0xc8')]&&_0x2c0084['dialPredictiveOptimization']===_0x12a8('0x1c4')){clearPredictiveAttributes(_0x2c0084);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x1c5'),'Max\x20Drop\x20',_0x68630e,_0x12a8('0x1c6'),_0x2c0084[_0x12a8('0xc8')],_0x12a8('0x27'),_0x2c0084['name']);}else if(!ifInterval(_0x2c0084[_0x12a8('0x1bf')],_0x2c0084[_0x12a8('0x27')])&&_[_0x12a8('0x3e')](_0x2c0084[_0x12a8('0x26')])&&!_[_0x12a8('0x3e')](_0x2c0084[_0x12a8('0x27')])){_0x2c0084[_0x12a8('0x26')]=moment()[_0x12a8('0x43')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x12a8('0x48')](_0x2c0084['name'],_0x12a8('0x1c7'),_0x2c0084[_0x12a8('0x26')]);hopperUtils[_0x12a8('0x1c8')](_0x2c0084[_0x12a8('0x1bf')])[_0x12a8('0x3c')](this[_0x12a8('0x1c9')](_0x2c0084))[_0x12a8('0x3c')](mergeDataErlangB(_0x2c0084))[_0x12a8('0x3c')](this['startMethodPredictive'](_0x2c0084))[_0x12a8('0x96')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c0084));}else if(!ifInterval(_0x2c0084[_0x12a8('0x1bf')],_0x2c0084[_0x12a8('0x26')])){_0x2c0084['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2c0084[_0x12a8('0x26')]=moment()[_0x12a8('0x43')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x12a8('0x48')](_0x2c0084[_0x12a8('0x45')],'recalculate\x20predictive\x20at',_0x2c0084[_0x12a8('0x26')]);clearInterval(_0x2c0084['handlePredictive']);_0x2c0084[_0x12a8('0x62')]=undefined;hopperUtils[_0x12a8('0x1c8')](_0x2c0084['dialPredictiveInterval'])[_0x12a8('0x3c')](this[_0x12a8('0x1c9')](_0x2c0084))[_0x12a8('0x3c')](mergeDataErlangB(_0x2c0084))[_0x12a8('0x3c')](this[_0x12a8('0x1ca')](_0x2c0084))[_0x12a8('0x96')](loggerCatchPredictive(_0x12a8('0x1cb'),_0x2c0084));}else if(_0x2c0084[_0x12a8('0x1b5')]&&_0x32f556<_0x2c0084[_0x12a8('0x1b5')]-_0x4903d6){clearPredictiveAttributes(_0x2c0084);loggerPredictive[_0x12a8('0x48')](_0x2c0084[_0x12a8('0x45')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x32f556,_0x12a8('0x1cc'),_0x2c0084[_0x12a8('0x1b5')],'-',_0x4903d6,'=',_0x2c0084['predictiveIntervalAvailable']-_0x4903d6,')');}else if(_0x2c0084[_0x12a8('0x1b5')]&&_0x32f556>_0x2c0084[_0x12a8('0x1b5')]+_0x4dc7ac){clearPredictiveAttributes(_0x2c0084);loggerPredictive[_0x12a8('0x48')](_0x2c0084[_0x12a8('0x45')],_0x12a8('0x1cd'),_0x32f556,_0x12a8('0x1ce'),_0x2c0084[_0x12a8('0x1b5')],'+',_0x4dc7ac,'=',_0x2c0084[_0x12a8('0x1b5')]+_0x4dc7ac,')');}};Dialer['prototype'][_0x12a8('0x1c9')]=function(_0x4a1132){var _0x31fb4f=this;return function(_0x438dfd){return new Promise(function(_0x4b266e,_0x1955fa){_['merge'](_0x4a1132,_0x438dfd[0x0]);if(checkGetDataPredictive(_0x438dfd[0x0])){var _0x1fc3c8=_0x4a1132[_0x12a8('0x1b5')]=_0x4a1132[_0x12a8('0x139')]+_0x4a1132[_0x12a8('0x138')];var _0x2c6b42=_0x4a1132[_0x12a8('0x1bf')]*0x3c;var _0x32b56f=_0x438dfd[0x0]['predictiveIntervalAvgTalktime']+_0x438dfd[0x0]['predictiveIntervalAvgHoldtime'];var _0x4e5f29=(_0x438dfd[0x0][_0x12a8('0x1cf')]+_0x438dfd[0x0][_0x12a8('0x4d')]+_0x438dfd[0x0][_0x12a8('0x4f')])/_0x438dfd[0x0][_0x12a8('0x4a')];_0x4a1132['predictiveIntervalHitRate']=_0x4e5f29>0x0?_0x4e5f29:0x1;switch(_0x4a1132[_0x12a8('0x1c1')]){case _0x12a8('0x1c4'):var _0x30a160=_0x4a1132['dialPredictiveOptimizationPercentage']/0x64;return _0x31fb4f[_0x12a8('0x1d0')](_0x1fc3c8,_0x2c6b42,_0x32b56f,_0x4e5f29,_0x30a160)[_0x12a8('0x3c')](function(_0x40fe15){return _0x4b266e(_0x40fe15);});case _0x12a8('0x1d1'):var _0x44ae4a=_0x4a1132['dialPredictiveOptimizationPercentage']/0x64;return _0x31fb4f[_0x12a8('0x1d2')](_0x1fc3c8,_0x2c6b42,_0x32b56f,_0x4e5f29,_0x44ae4a)[_0x12a8('0x3c')](function(_0x53428c){return _0x4b266e(_0x53428c);});default:return _0x1955fa(msgResponse('[getDataPredictive]',_0x12a8('0x88'),'Unknown\x20Predictive'));}}else{return _0x1955fa(msgResponse(_0x12a8('0x1d3'),'Failure',_0x12a8('0x1d4')));}});};};Dialer[_0x12a8('0x1a')]['getDataPredictiveOld']=function(_0x597f6b){var _0x584b1c=this;return function(_0x37cfc4){return new Promise(function(_0x41ba8b,_0x27ab29){_[_0x12a8('0x5e')](_0x597f6b,_0x37cfc4[0x0]);if(checkGetDataPredictive(_0x37cfc4[0x0])){loggerPredictive[_0x12a8('0x48')](JSON[_0x12a8('0x70')](_0x37cfc4[0x0]));if(_0x597f6b[_0x12a8('0x1c1')]===_0x12a8('0x1c4')){return _0x584b1c['getVoiceQueueRtPauses'](_0x597f6b['id'])[_0x12a8('0x3c')](function(_0x79874){var _0x5dc196=_0x597f6b[_0x12a8('0x1d5')]-_0x79874[0x0]['outboundQueuePauses'];var _0x2aec5d=_0x597f6b[_0x12a8('0x1bf')]*0x3c;var _0x481914=_0x37cfc4[0x0]['predictiveIntervalAvgTalktime']+_0x37cfc4[0x0][_0x12a8('0x53')];var _0x48f005=(_0x37cfc4[0x0][_0x12a8('0x1cf')]+_0x37cfc4[0x0][_0x12a8('0x4d')]+_0x37cfc4[0x0][_0x12a8('0x4f')])/_0x37cfc4[0x0]['predictiveIntervalTotalCalls'];var _0x2c0990=_0x597f6b[_0x12a8('0x1b3')]/0x64;_0x597f6b['predictiveIntervalPauses']=_0x79874[0x0]['outboundQueuePauses']||0x0;_0x597f6b['predictiveIntervalHitRate']=_0x48f005>0x0?_0x48f005:0x1;return _0x584b1c[_0x12a8('0x1d0')](_0x5dc196,_0x2aec5d,_0x481914,_0x48f005,_0x2c0990);})[_0x12a8('0x3c')](function(_0x2e8795){return _0x41ba8b(_0x2e8795);})[_0x12a8('0x96')](function(_0x53fe79){return _0x27ab29(msgResponse(_0x12a8('0x1d6'),_0x12a8('0x88'),JSON[_0x12a8('0x70')](_0x53fe79)));});}if(_0x597f6b['dialPredictiveOptimization']===_0x12a8('0x1d1')){return _0x584b1c[_0x12a8('0x14b')](_0x597f6b['id'])['then'](function(_0x36363f){var _0x407cd5=_0x597f6b[_0x12a8('0x1d5')]-_0x36363f[0x0]['outboundQueuePauses'];var _0x526a31=_0x597f6b['dialPredictiveInterval']*0x3c;var _0x176290=_0x37cfc4[0x0][_0x12a8('0x1d7')]+_0x37cfc4[0x0][_0x12a8('0x53')];var _0x192bcf=(_0x37cfc4[0x0]['predictiveIntervalAnsweredCalls']+_0x37cfc4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x37cfc4[0x0][_0x12a8('0x4f')])/_0x37cfc4[0x0]['predictiveIntervalTotalCalls'];var _0x286cd0=_0x597f6b[_0x12a8('0x1b3')]/0x64;_0x597f6b[_0x12a8('0x1d8')]=_0x36363f[0x0][_0x12a8('0x1d9')]||0x0;_0x597f6b[_0x12a8('0x1b9')]=_0x192bcf>0x0?_0x192bcf:0x1;return _0x584b1c[_0x12a8('0x1d2')](_0x407cd5,_0x526a31,_0x176290,_0x192bcf,_0x286cd0);})['then'](function(_0x3237f3){return _0x41ba8b(_0x3237f3);})[_0x12a8('0x96')](function(_0xbc6fba){return _0x27ab29(msgResponse('[CatchErlangB]','Failure',JSON[_0x12a8('0x70')](_0xbc6fba)));});}}else{return _0x27ab29(msgResponse(_0x12a8('0x1d3'),_0x12a8('0x88'),_0x12a8('0x1d4')));}});};};Dialer[_0x12a8('0x1a')][_0x12a8('0x1ca')]=function(_0x1bc419){var _0x485d1d=this;return function(){var _0x540bf7=0x0;var _0x536979=Math['floor'](_0x1bc419[_0x12a8('0x59')]*0x3e8);if(_0x536979>0x0){_0x536979=_0x536979<0x64?0x64:_0x536979;loggerPredictive[_0x12a8('0x48')](_0x1bc419['name'],_0x12a8('0x1da'),_0x536979,_0x12a8('0x1db'));_0x1bc419[_0x12a8('0x62')]=setInterval(function(){_0x485d1d[_0x12a8('0x62')](_0x1bc419);loggerPredictiveCalls[_0x12a8('0x48')](_0x12a8('0x1dc'),_0x540bf7+=0x1);},_0x536979);}else{loggerPredictive[_0x12a8('0x48')](_0x1bc419[_0x12a8('0x45')],_0x12a8('0x1dd'));}};};Dialer[_0x12a8('0x1a')]['checkContactBlack']=function(_0x8d40d8,_0x5f583f){var _0x30d037=this;return function(_0x99e8b7){if(_[_0x12a8('0x47')](_0x99e8b7)){if(_[_0x12a8('0xf2')](_0x5f583f[_0x12a8('0x151')])||!_0x5f583f[_0x12a8('0x1de')]){if(_0x8d40d8[_0x12a8('0xa8')]===_0x12a8('0x8')){_0x8d40d8[_0x12a8('0x6e')]=_[_0x12a8('0x3e')](_0x8d40d8['queueStatusComplete'])?!![]:_0x8d40d8[_0x12a8('0x6e')];var _0x228967=uuid['v4']();_0x30d037[_0x12a8('0xe9')][_0x228967]=new Action(_0x8d40d8,_0x5f583f,_0x228967);loggerBooked[_0x12a8('0x48')](_0x12a8('0x1df'),_0x228967,_0x12a8('0x1e0'),JSON[_0x12a8('0x70')](_0x8d40d8[_0x12a8('0x6e')]),_0x12a8('0x1e1'),_0x8d40d8[_0x12a8('0x45')]);if(_0x8d40d8[_0x12a8('0x6e')]){_0x8d40d8['queueStatusComplete']=![];_0x30d037[_0x12a8('0x29')][_0x30d037[_0x12a8('0xe9')][_0x228967][_0x12a8('0xb5')]]=[];ami['Action']({'actionid':_0x228967,'action':'queuestatus','queue':_0x8d40d8[_0x12a8('0x45')]})['catch'](function(){_0x30d037[_0x12a8('0xb9')](_0x8d40d8);hopperUtils[_0x12a8('0xd4')]({'active':![],'ContactId':_0x30d037[_0x12a8('0xe9')][_0x228967]['ContactId'],'ListId':_0x30d037[_0x12a8('0xe9')][_0x228967][_0x12a8('0xd8')],'VoiceQueueId':_0x30d037[_0x12a8('0xe9')][_0x228967]['VoiceQueueId']||undefined,'CampaignId':_0x30d037[_0x12a8('0xe9')][_0x228967][_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x30d037[_0x12a8('0xe9')][_0x228967];});}else{loggerBooked['info'](_0x12a8('0x1e2'),JSON[_0x12a8('0x70')](_0x8d40d8[_0x12a8('0x6e')]),_0x12a8('0x1e1'),_0x8d40d8[_0x12a8('0x45')]);_0x30d037[_0x12a8('0xb9')](_0x8d40d8);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x30d037['actions'][_0x228967]['ContactId'],'ListId':_0x30d037[_0x12a8('0xe9')][_0x228967]['ListId'],'VoiceQueueId':_0x30d037[_0x12a8('0xe9')][_0x228967][_0x12a8('0xd9')]||undefined,'CampaignId':_0x30d037[_0x12a8('0xe9')][_0x228967][_0x12a8('0xda')]||undefined})[_0x12a8('0x96')](loggerCatch(_0x12a8('0x1e3')));delete _0x30d037[_0x12a8('0xe9')][_0x228967];}}else{return _0x30d037[_0x12a8('0x156')](_0x8d40d8,_0x5f583f);}}else{if(utils[_0x12a8('0x5f')](undefined,_0x5f583f[_0x12a8('0x1e4')])<_0x8d40d8[_0x12a8('0x1e5')]*0x3c){if(_0x5f583f[_0x12a8('0x143')]&&!_0x5f583f[_0x12a8('0x143')][_0x12a8('0x1e6')]){_0x30d037['preview'][_0x12a8('0xfd')](_0x5f583f['id'])[_0x12a8('0xf5')](function(){_0x30d037['updateOriginated'](_0x8d40d8);});}else{hopperUtils[_0x12a8('0x1e7')]({'active':![]},_0x5f583f['id'],0x1)[_0x12a8('0xf5')](function(){_0x30d037[_0x12a8('0xb9')](_0x8d40d8);});}}else{_0x8d40d8[_0x12a8('0x1e8')]+=0x1;_0x30d037[_0x12a8('0xb9')](_0x8d40d8);if(_0x8d40d8['dialRecallInQueue']){hopperUtils[_0x12a8('0xd4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5f583f[_0x12a8('0xd7')],'ListId':_0x5f583f[_0x12a8('0xd8')],'VoiceQueueId':_0x5f583f['VoiceQueueId']||undefined,'CampaignId':_0x5f583f[_0x12a8('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils['createHistory'](createObjHistory(_0x8d40d8,_0x5f583f,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x12a8('0x1e9')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x30d037[_0x12a8('0x111')](createObjHistory(_0x8d40d8,_0x5f583f,utils[_0x12a8('0x67')][_0x12a8('0x1ea')],0x16,_0x12a8('0x1eb')),_0x12a8('0x1ec'),_0x12a8('0x1ed'));}}}}else{_0x8d40d8[_0x12a8('0x1ee')]+=0x1;_0x30d037['saveInDb'](createObjHistory(_0x8d40d8,_0x5f583f,utils['CAMPAIGN_STATUS'][_0x12a8('0x1ef')],0xd,_0x12a8('0x1f0')),'[Originate][historyBlacklist]',_0x12a8('0x1f1'));throw'inBlackList';}};};Dialer[_0x12a8('0x1a')]['handleIvr']=function(_0x2e4995){var _0x600578=this;var _0x51a088=_0x2e4995[_0x12a8('0x1f2')]-_0x2e4995['originated'];emitCampaignSummary(_0x2e4995);if(_0x51a088>0x0&&_0x2e4995[_0x12a8('0x1f3')]==0x0){if(_0x51a088>this[_0x12a8('0x23')]){_0x51a088=this[_0x12a8('0x23')];}_0x2e4995[_0x12a8('0x1f3')]=0x1;hopperUtils[_0x12a8('0x1f4')](_0x2e4995,_0x51a088)[_0x12a8('0x3c')](function(_0x46b1a1){_0x2e4995[_0x12a8('0x1f3')]=0x0;if(_0x46b1a1){if(!utils[_0x12a8('0x1f5')](_0x46b1a1)){_0x2e4995[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x6a')];logger[_0x12a8('0x48')]('[getContactCampaign2][Empty]'+_0x2e4995[_0x12a8('0x45')]);}else{_0x2e4995[_0x12a8('0x77')]+=_0x46b1a1['length'];_0x2e4995[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x1f6')];for(var _0x424efc=0x0;_0x424efc<_0x46b1a1['length'];_0x424efc+=0x1){_0x2e4995[_0x12a8('0x1f7')]+=0x1;if(_['isNil'](_0x46b1a1[_0x424efc])||_[_0x12a8('0xf2')](_0x46b1a1[_0x424efc][_0x12a8('0x173')])||_[_0x12a8('0xf2')](_0x46b1a1[_0x424efc][_0x12a8('0x15a')])){_0x600578[_0x12a8('0x14f')](_0x12a8('0x1f8'),_0x2e4995,_0x46b1a1[_0x424efc]);}else{hopperUtils[_0x12a8('0x1f9')](_[_0x12a8('0xfb')](_0x46b1a1[_0x424efc],[_0x12a8('0xda'),_0x12a8('0x15a')]))['then'](_0x600578['checkContactBlack'](_0x2e4995,_0x46b1a1[_0x424efc]))['catch'](_0x600578['loggerHandler'](_0x12a8('0x1fa'),_0x2e4995));}}}}})['catch'](loggerGetContactDialer(_0x12a8('0x1fb'),_0x2e4995,_0x51a088));}};Dialer[_0x12a8('0x1a')][_0x12a8('0xaa')]=function(_0x486fbc,_0x6588ca){var _0x14568d=this;var _0x335046=[];if(_0x6588ca<0x1||_0x486fbc[_0x12a8('0xa8')]===_0x12a8('0x8')){_0x6588ca=0x1;}var _0x318285=Math['floor'](_0x486fbc['available']*_0x6588ca)-_0x486fbc[_0x12a8('0x77')];if(_0x486fbc[_0x12a8('0x1fc')]>0x0){var _0x10ea0e=_0x486fbc[_0x12a8('0x1fc')]-_0x486fbc[_0x12a8('0x77')]-_0x486fbc[_0x12a8('0x139')]-_0x486fbc[_0x12a8('0x13a')];if(_0x318285>_0x10ea0e){_0x318285=_0x10ea0e;}}if(_0x318285>0x0&&_0x486fbc[_0x12a8('0x1f3')]==0x0){if(_0x486fbc[_0x12a8('0xa8')]===_0x12a8('0x8')){_0x318285=0x1;}if(_0x318285>this['maxNumberOriginate']){_0x318285=this[_0x12a8('0x23')];}for(var _0x3bcc90 in this[_0x12a8('0x21')]){if(typeof this[_0x12a8('0x21')][_0x3bcc90]!==_0x12a8('0x9f')){if(this[_0x12a8('0x21')][_0x3bcc90][_0x12a8('0x6b')]===_0x12a8('0x1fd')&&this[_0x12a8('0x21')][_0x3bcc90][_0x12a8('0x81')]===_0x12a8('0x1fe')){_0x335046[_0x12a8('0x97')](this[_0x12a8('0x21')][_0x3bcc90]['id']);}}}_0x486fbc[_0x12a8('0x1f3')]=0x1;hopperUtils[_0x12a8('0x1ff')](_0x486fbc,_0x335046,_0x318285)[_0x12a8('0x3c')](function(_0x2f98c2){_0x486fbc[_0x12a8('0x1f3')]=0x0;if(_0x2f98c2){if(!utils[_0x12a8('0x1f5')](_0x2f98c2)){hopperUtils[_0x12a8('0x200')](_0x486fbc)[_0x12a8('0x3c')](sendMessageReschedule(_0x486fbc))[_0x12a8('0x96')](loggerCatch('[countReScheduled]\x20'));}else{_0x486fbc[_0x12a8('0x77')]+=_0x2f98c2['length'];_0x486fbc[_0x12a8('0x66')]=_0x486fbc[_0x12a8('0xa8')]===_0x12a8('0x8')?utils[_0x12a8('0x67')][_0x12a8('0x13b')]:utils['CAMPAIGN_STATUS'][_0x12a8('0x1f6')];for(var _0xb66d24=0x0;_0xb66d24<_0x2f98c2[_0x12a8('0x90')];_0xb66d24+=0x1){if(_[_0x12a8('0xf2')](_0x2f98c2[_0xb66d24])||_['isNil'](_0x2f98c2[_0xb66d24][_0x12a8('0x173')])||_[_0x12a8('0xf2')](_0x2f98c2[_0xb66d24]['phone'])){_0x14568d[_0x12a8('0x14f')]('[actionOriginate]\x20',_0x486fbc,_0x2f98c2[_0xb66d24]);}else{hopperUtils['checkIsBlackList'](_[_0x12a8('0xfb')](_0x2f98c2[_0xb66d24],[_0x12a8('0xd9'),_0x12a8('0x15a')]))['then'](_0x14568d[_0x12a8('0x201')](_0x486fbc,_0x2f98c2[_0xb66d24]))[_0x12a8('0x96')](_0x14568d['loggerHandler'](_0x12a8('0x1f8'),_0x486fbc));}}}}})[_0x12a8('0x96')](loggerGetContactDialer(_0x12a8('0x202'),_0x486fbc,_0x318285));}};Dialer[_0x12a8('0x1a')]['handlePredictive']=function(_0x14a93b){if(_0x14a93b['dialLimitQueue']>0x0){var _0x9d4dac=_0x14a93b[_0x12a8('0x1fc')]-_0x14a93b['originated']-_0x14a93b['talking'];if(_0x9d4dac>0x0&&_0x14a93b[_0x12a8('0x1f3')]==0x0){this[_0x12a8('0x203')](_0x14a93b);}else{loggerPredictiveCalls[_0x12a8('0x48')](_0x12a8('0x204'));}}else{this['tryOriginatePredictive'](_0x14a93b);}};Dialer[_0x12a8('0x1a')][_0x12a8('0x203')]=function(_0x10e0a7){var _0x101abe=this;var _0x5c50e4=[];_0x10e0a7[_0x12a8('0x77')]+=0x1;for(var _0x59945c in this[_0x12a8('0x21')]){if(typeof this[_0x12a8('0x21')][_0x59945c]!==_0x12a8('0x9f')){if(this[_0x12a8('0x21')][_0x59945c]['state']==='not_inuse'&&this[_0x12a8('0x21')][_0x59945c][_0x12a8('0x81')]==='reachable'){_0x5c50e4[_0x12a8('0x97')](this[_0x12a8('0x21')][_0x59945c]['id']);}}}_0x10e0a7[_0x12a8('0x1f3')]=0x1;return this['getContactDialer'](_0x10e0a7['id'],_0x5c50e4,0x1,_0x10e0a7[_0x12a8('0x205')],_0x10e0a7)[_0x12a8('0x3c')](function(_0x4ed408){_0x10e0a7[_0x12a8('0x1f3')]=0x1;if(_0x4ed408){if(!utils['checkContactEmpty'](_0x4ed408)){utils[_0x12a8('0x64')](_0x10e0a7,0x1,0x0);return hopperUtils[_0x12a8('0x200')](_0x10e0a7)[_0x12a8('0x3c')](sendMessageReschedule(_0x10e0a7))[_0x12a8('0x96')](loggerCatch(_0x12a8('0x206')));}else{_0x10e0a7[_0x12a8('0x66')]=utils[_0x12a8('0x67')][_0x12a8('0x1f6')];if(_['isNil'](_0x4ed408[0x0])||_['isNil'](_0x4ed408[0x0][_0x12a8('0x173')])||_[_0x12a8('0xf2')](_0x4ed408[0x0][_0x12a8('0x15a')])){_0x101abe[_0x12a8('0x14f')](_0x12a8('0x1f8'),_0x10e0a7,_0x4ed408[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x12a8('0xfb')](_0x4ed408[0x0],[_0x12a8('0xd9'),_0x12a8('0x15a')]))[_0x12a8('0x3c')](_0x101abe[_0x12a8('0x201')](_0x10e0a7,_0x4ed408[0x0]))[_0x12a8('0x96')](_0x101abe[_0x12a8('0x14e')](_0x12a8('0x207'),_0x10e0a7));}}}})[_0x12a8('0x96')](loggerGetContactDialer(_0x12a8('0x208'),_0x10e0a7,0x1));};Dialer[_0x12a8('0x1a')][_0x12a8('0x1d0')]=function(_0x3d2bf3,_0x49bd6b,_0x1d6dfb,_0xff6aa0,_0x57e322,_0x2e6905){loggerPredictive[_0x12a8('0x48')](_0x12a8('0x209'));loggerPredictive[_0x12a8('0x48')](_0x12a8('0x20a'),_0x3d2bf3);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49bd6b);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x20b'),_0x1d6dfb);loggerPredictive[_0x12a8('0x48')]('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',_0xff6aa0);loggerPredictive['info'](_0x12a8('0x20c'),_0x57e322);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x51'));return new Promise(function(_0x2f5bcb,_0x270e15){if(_0x3d2bf3<=0x0||isNaN(_0x3d2bf3)){return _0x270e15(msgResponse(_0x12a8('0x20d'),_0x12a8('0x7d'),_0x12a8('0x20e')+_0x3d2bf3));}if(_0x1d6dfb<=0x0||isNaN(_0x1d6dfb)){return _0x270e15(msgResponse(_0x12a8('0x20d'),_0x12a8('0x7d'),_0x12a8('0x20f')+_0x1d6dfb));}if(_0xff6aa0<=0x0||isNaN(_0xff6aa0)){return _0x270e15(msgResponse(_0x12a8('0x20d'),_0x12a8('0x7d'),_0x12a8('0x210')+_0xff6aa0));}if(_0x49bd6b<=0x0||isNaN(_0x49bd6b)){return _0x270e15(msgResponse(_0x12a8('0x20d'),_0x12a8('0x7d'),_0x12a8('0x211')+_0x49bd6b));}if(_0x57e322<=0x0||isNaN(_0x57e322)){return _0x270e15(msgResponse(_0x12a8('0x20d'),_0x12a8('0x7d'),'Amax\x20=\x20'+_0x57e322));}_0x2e6905=_0x2e6905||0x0;var _0x3023c6=0x1/_0x1d6dfb;var _0x5f491c=0x0;var _0x5a54de=0x0;var _0x30b5ae=0x0;var _0xd16665=0x0;for(var _0x4f0aba=0x0;_0x30b5ae<_0x57e322;_0x4f0aba+=0x1){_0x5a54de=_0x4f0aba/_0x49bd6b;_0x5f491c=(_0xff6aa0*_0x5a54de+_0x2e6905)/_0x3023c6;_0x30b5ae=utils[_0x12a8('0x212')](_0x5f491c,_0x3d2bf3);_0xd16665=_0x5f491c/_0x3d2bf3*(0x1-utils['erlangb'](_0x5f491c,_0x3d2bf3));}return _0x2f5bcb({'erlangCalls':_0x4f0aba,'erlangCallToSecond':_0x49bd6b/_0x4f0aba,'erlangAbandonmentRate':_0x30b5ae,'erlangBusyFactor':_0xd16665});});};Dialer['prototype'][_0x12a8('0x1d2')]=function(_0x2340f2,_0x277b97,_0x82e48f,_0x34ba87,_0x25b2b8,_0x1c87b5){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x12a8('0x20a'),_0x2340f2);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x213'),_0x277b97);loggerPredictive[_0x12a8('0x48')]('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',_0x82e48f);loggerPredictive[_0x12a8('0x48')]('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',_0x34ba87);loggerPredictive['info'](_0x12a8('0x214'),_0x25b2b8);loggerPredictive[_0x12a8('0x48')](_0x12a8('0x51'));return new Promise(function(_0x363410,_0x2c49c1){if(_0x2340f2<=0x0||isNaN(_0x2340f2)){return _0x2c49c1(msgResponse(_0x12a8('0x215'),_0x12a8('0x7d'),'m\x20=\x20'+_0x2340f2));}if(_0x82e48f<=0x0||isNaN(_0x82e48f)){return _0x2c49c1(msgResponse(_0x12a8('0x215'),_0x12a8('0x7d'),_0x12a8('0x20f')+_0x82e48f));}if(_0x34ba87<=0x0||isNaN(_0x34ba87)){return _0x2c49c1(msgResponse('[busyFactor]','Error',_0x12a8('0x210')+_0x34ba87));}if(_0x277b97<=0x0||isNaN(_0x277b97)){return _0x2c49c1(msgResponse('[busyFactor]',_0x12a8('0x7d'),_0x12a8('0x211')+_0x277b97));}if(_0x25b2b8<=0x0||isNaN(_0x25b2b8)){return _0x2c49c1(msgResponse(_0x12a8('0x215'),_0x12a8('0x7d'),_0x12a8('0x216')+_0x25b2b8));}_0x1c87b5=_0x1c87b5||0x0;var _0x278ba1=0x1/_0x82e48f;var _0x5b8406=0x0;var _0x6db898=0x0;var _0x4c28f7=0x0;var _0x1bc7b0=0x0;for(var _0x264e6f=0x0;_0x1bc7b0<_0x25b2b8;_0x264e6f+=0x1){_0x6db898=_0x264e6f/_0x277b97;_0x5b8406=(_0x34ba87*_0x6db898+_0x1c87b5)/_0x278ba1;_0x4c28f7=utils[_0x12a8('0x212')](_0x5b8406,_0x2340f2);_0x1bc7b0=_0x5b8406/_0x2340f2*(0x1-utils[_0x12a8('0x212')](_0x5b8406,_0x2340f2));}return _0x363410({'erlangCalls':_0x264e6f,'erlangCallToSecond':_0x277b97/_0x264e6f,'erlangAbandonmentRate':_0x4c28f7,'erlangBusyFactor':_0x1bc7b0});});};module[_0x12a8('0x217')]=Dialer;
\ No newline at end of file
+var _0x3d2e=['syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','[syncHangupInAMD]','dialAMDActive','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countbusyretry','countnoanswerretry','countnosuchnumberretry','reason\x2019\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','syncQueueSummary','queuesSummary','running','isPreviewCampaign','statusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','actionOriginate','object','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','outboundNoSuchCallsDay','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[callProgressDetecting]','[moveContactManagedDialer][0]','round','predictiveIntervalAvailable','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','getContactDialer','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/agentComplete','./models/queueCallerAbandon','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','emit','debug','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','Failure','timezones','UNKNOWN_TIMEZONE','ifTime','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','then','true','catch','content','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Global:\x20','Timezone:\x20','isGlobal','AMI\x20IfTime','uniqueid','type','updateOriginated','queue','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','merge','idHopper'];(function(_0x76dd6e,_0x14dd80){var _0x35fb11=function(_0x493aaf){while(--_0x493aaf){_0x76dd6e['push'](_0x76dd6e['shift']());}};_0x35fb11(++_0x14dd80);}(_0x3d2e,0x119));var _0xe3d2=function(_0x41acc0,_0xd33f4f){_0x41acc0=_0x41acc0-0x0;var _0x309419=_0x3d2e[_0x41acc0];return _0x309419;};'use strict';var util=require(_0xe3d2('0x0'));var _=require(_0xe3d2('0x1'));var uuid=require(_0xe3d2('0x2'));var moment=require(_0xe3d2('0x3'));var rr=require('rr');var Redis=require(_0xe3d2('0x4'));var utils=require(_0xe3d2('0x5'));var hopperUtils=require(_0xe3d2('0x6'));var ut=require(_0xe3d2('0x7'));var config=require(_0xe3d2('0x8'));var logger=require(_0xe3d2('0x9'))(_0xe3d2('0xa'));var loggerBooked=require('../../../config/logger')(_0xe3d2('0xb'));var loggerPredictive=require(_0xe3d2('0x9'))(_0xe3d2('0xc'));var loggerPredictiveCalls=require('../../../config/logger')(_0xe3d2('0xd'));var loggerSyncQueueSummary=require(_0xe3d2('0x9'))('syncQueueSummary');var ami=require(_0xe3d2('0xe'));config[_0xe3d2('0xf')]=_[_0xe3d2('0x10')](config['redis'],{'host':_0xe3d2('0x11'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe3d2('0xf')]));var cmHopper=require(_0xe3d2('0x12'));var voiceQueueRt=require(_0xe3d2('0x13'));var RpcSetting=require(_0xe3d2('0x14'));var Interval=require(_0xe3d2('0x15'));var Action=require('./models/action');var History=require(_0xe3d2('0x16'));var Final=require('./models/final');var AgentComplete=require(_0xe3d2('0x17'));var QueueCallerAbandon=require(_0xe3d2('0x18'));var Hangup=require('./models/hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xe3d2('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe3d2('0x1a')][_0xe3d2('0x1b')]=function(_0x387d9f){this[_0xe3d2('0x1c')]=this[_0xe3d2('0x1c')]?this[_0xe3d2('0x1c')][_0xe3d2('0x1d')](_0x387d9f):_0x387d9f();};function Dialer(_0x4721ca,_0x241e7c){this[_0xe3d2('0x1e')]=new Sequence();this[_0xe3d2('0x1f')]=_0x241e7c;this['voiceQueues']=_0x4721ca[_0xe3d2('0x20')];this[_0xe3d2('0x21')]=_0x4721ca[_0xe3d2('0x21')];this[_0xe3d2('0x22')]=_0x4721ca['agents'];this['trunks']=_0x4721ca[_0xe3d2('0x23')];this[_0xe3d2('0x24')]=config[_0xe3d2('0x24')]||0x2;this['channels']={};this[_0xe3d2('0x25')]={};this[_0xe3d2('0x26')]={};this[_0xe3d2('0x27')]={};this[_0xe3d2('0x28')]={};this[_0xe3d2('0x29')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0xe3d2('0x2a')]={};this[_0xe3d2('0x2b')]={};this['queuesSummary']={};ami['on'](_0xe3d2('0x2c'),this[_0xe3d2('0x2d')][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x2f'),this['syncQueueCallerAbandon'][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x30'),this[_0xe3d2('0x31')][_0xe3d2('0x2e')](this));ami['on']('agentcomplete',this[_0xe3d2('0x32')][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x33'),this['syncQueueSummary'][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x34'),this[_0xe3d2('0x35')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xe3d2('0x36'),this[_0xe3d2('0x37')][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x38'),this[_0xe3d2('0x39')][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x3a'),this[_0xe3d2('0x3b')][_0xe3d2('0x2e')](this));ami['on'](_0xe3d2('0x3c'),this['syncQueueStatusComplete'][_0xe3d2('0x2e')](this));this[_0xe3d2('0x3d')]();this[_0xe3d2('0x3e')]();RpcSetting['getSettings']()['then'](function(_0xc806c3){previewRecallmeReminderInterval=_0xc806c3[_0xe3d2('0x3f')];});}function isNotNull(_0x550e75){return _0x550e75!==null&&!_[_0xe3d2('0x40')](_0x550e75);}function msgResponse(_0x25ea6a,_0x29d3e0,_0x2148a8){return{'action':_0x25ea6a,'response':_0x29d3e0,'message':_0x2148a8,'stack':_0x2148a8};}function emit(_0x15451d,_0x14a641,_0x2acbc6){io['to'](_0x15451d)[_0xe3d2('0x41')](_0x14a641,_0x2acbc6);}function emitOutboundVoiceQueueSummary(_0xa5f40a){if(_0xa5f40a['type']==='outbound'){logger[_0xe3d2('0x42')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xe3d2('0x43')](_0xa5f40a,{'showHidden':![],'depth':null}));emit(util[_0xe3d2('0x44')](_0xe3d2('0x45'),_0xa5f40a[_0xe3d2('0x46')]),_0xe3d2('0x47'),_0xa5f40a);}}function checkGetDataPredictive(_0x290744){if(isNotNull(_0x290744)&&!_[_0xe3d2('0x48')](_0x290744)){loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x4a'));loggerPredictive[_0xe3d2('0x49')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x290744[_0xe3d2('0x4b')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x4c'),_0x290744[_0xe3d2('0x4d')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x290744['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x4e'),_0x290744[_0xe3d2('0x4f')]);loggerPredictive[_0xe3d2('0x49')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x290744[_0xe3d2('0x50')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x51'),_0x290744['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0xe3d2('0x52'));if(_0x290744[_0xe3d2('0x4b')]>0x0){if(!_[_0xe3d2('0x40')](_0x290744[_0xe3d2('0x53')])&&_0x290744[_0xe3d2('0x53')]>0x0){return!![];}loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x54'));if(!_[_0xe3d2('0x40')](_0x290744[_0xe3d2('0x50')])&&_0x290744[_0xe3d2('0x50')]>0x0){return!![];}loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x55'));}else{loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x56'));}}else{loggerPredictive[_0xe3d2('0x49')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3458aa){return function(_0x390729){loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x57'));loggerPredictive[_0xe3d2('0x49')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x390729[_0xe3d2('0x58')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x59'),_0x390729[_0xe3d2('0x5a')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x5b'),_0x390729[_0xe3d2('0x5c')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x5d'),_0x390729[_0xe3d2('0x5e')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x5b'),_0x390729[_0xe3d2('0x5c')]);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x52'));_['merge'](_0x3458aa,_0x390729);};}function ifInterval(_0x16ec25,_0x451e3f){if(_[_0xe3d2('0x40')](_0x451e3f)){return![];}return utils['getSeconds'](undefined,_0x451e3f)<_0x16ec25*0x3c;}function clearPredictiveAttributes(_0x1c5110){if(_0x1c5110[_0xe3d2('0x5f')]){_0x1c5110[_0xe3d2('0x5f')]=undefined;loggerPredictive[_0xe3d2('0x42')](_0x1c5110['name'],_0xe3d2('0x60'));}if(_0x1c5110[_0xe3d2('0x29')]){_0x1c5110[_0xe3d2('0x29')]=undefined;loggerPredictive[_0xe3d2('0x42')](_0x1c5110[_0xe3d2('0x46')],_0xe3d2('0x61'));}if(_0x1c5110[_0xe3d2('0x62')]){clearInterval(_0x1c5110['handlePredictive']);_0x1c5110[_0xe3d2('0x62')]=undefined;loggerPredictive[_0xe3d2('0x42')](_0x1c5110[_0xe3d2('0x46')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x41c0ab,_0x3eab21){return function(_0x3d72ca){loggerPredictive[_0xe3d2('0x63')](_0x3eab21[_0xe3d2('0x46')],_0x41c0ab);loggerPredictive[_0xe3d2('0x63')](_0x3d72ca['stack']);clearPredictiveAttributes(_0x3eab21);};}function loggerCatch(_0x1ed11d){return function(_0x29696b){logger[_0xe3d2('0x63')](_0x1ed11d,util[_0xe3d2('0x43')](_0x29696b,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x126da6,_0xa227d3,_0xc4535a){return function(_0x261290){utils['checkContactLowerLimitOriginate'](_0xa227d3,_0xc4535a,0x0);logger[_0xe3d2('0x63')](_0x126da6,util[_0xe3d2('0x43')](_0x261290,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x292522){return function(_0x3dd3c1){if(isNotNull(_0x3dd3c1)&&isNotNull(_0x3dd3c1[0x0])){if(_0x3dd3c1[0x0][_0xe3d2('0x64')]>0x0){_0x292522[_0xe3d2('0x65')]=utils[_0xe3d2('0x66')][_0xe3d2('0x67')];logger['info'](_0xe3d2('0x68')+_0x292522['name'],_0x3dd3c1[0x0][_0xe3d2('0x64')],_0xe3d2('0x69'));}else{_0x292522[_0xe3d2('0x65')]=utils['CAMPAIGN_STATUS'][_0xe3d2('0x6a')];logger['info'](_0xe3d2('0x6b')+_0x292522[_0xe3d2('0x46')]);}}};}function createObjHistory(_0x275889,_0x1d6c54,_0x37ad73,_0x5c441d,_0x1e4865){_0x275889[_0xe3d2('0x65')]=_0x37ad73;var _0x4e0d4b=new Action(_0x275889,_0x1d6c54);var _0x404899=new History(_0x4e0d4b);_0x404899[_0xe3d2('0x6c')]=_0x5c441d;_0x404899['statedesc']=_0x1e4865;_0x404899[_0xe3d2('0x6d')]=_0x4e0d4b[_0xe3d2('0x6e')];return _0x404899;}function unlockQueueStatus(_0x1ecf8c,_0x167407){setTimeout(function(){if(_[_0xe3d2('0x40')](_0x1ecf8c[_0xe3d2('0x6f')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x167407);}_0x1ecf8c[_0xe3d2('0x6f')]=!![];loggerBooked[_0xe3d2('0x49')]('[booked][unlockQueueStatus]',_0x167407,JSON[_0xe3d2('0x70')](_[_0xe3d2('0x71')](_0x1ecf8c,[_0xe3d2('0x46'),_0xe3d2('0x6f')])));},0x1f3);}function checkInterval(_0x49a31d){return function(){if(!isNotNull(_0x49a31d[_0xe3d2('0x72')])){_0x49a31d['message']=utils[_0xe3d2('0x66')][_0xe3d2('0x73')];throw _0x49a31d['name']+_0xe3d2('0x74');}if(!isNotNull(_0x49a31d[_0xe3d2('0x72')][_0xe3d2('0x75')])){_0x49a31d[_0xe3d2('0x65')]=utils[_0xe3d2('0x66')][_0xe3d2('0x73')];throw _0x49a31d[_0xe3d2('0x46')]+_0xe3d2('0x74');}if(!isNotNull(_[_0xe3d2('0x48')](_0x49a31d['Interval'][_0xe3d2('0x75')]))){_0x49a31d[_0xe3d2('0x65')]=utils['CAMPAIGN_STATUS'][_0xe3d2('0x73')];throw _0x49a31d[_0xe3d2('0x46')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x36b633){return function(){if(!utils['isIVRCampaignActive'](_0x36b633)){_0x36b633[_0xe3d2('0x65')]=utils[_0xe3d2('0x66')][_0xe3d2('0x76')];throw _0x36b633['name']+_0xe3d2('0x77');}};}function emitCampaignSummary(_0x56f6d5){if(utils[_0xe3d2('0x78')](_0x56f6d5)){emit(util['format'](_0xe3d2('0x79'),_0x56f6d5['name']),_0xe3d2('0x7a'),_0x56f6d5);}}function loggerCatchQueueSummary(_0x5184be,_0x57c5b3){return function(_0x5e1b92){clearPredictiveAttributes(_0x57c5b3);emitCampaignSummary(_0x57c5b3);loggerSyncQueueSummary[_0xe3d2('0x42')](_0x5184be,util[_0xe3d2('0x43')](_0x5e1b92,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x25da1f){if(_0x25da1f[_0xe3d2('0x7b')]){if(_0x25da1f['originated']===0x0){_0x25da1f[_0xe3d2('0x7b')]=![];_0x25da1f['message']=utils[_0xe3d2('0x66')][_0xe3d2('0x76')];loggerSyncQueueSummary[_0xe3d2('0x42')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x25da1f[_0xe3d2('0x46')],_0xe3d2('0x7c'));}else{_0x25da1f[_0xe3d2('0x65')]=utils[_0xe3d2('0x66')][_0xe3d2('0x7d')];loggerSyncQueueSummary[_0xe3d2('0x42')](_0xe3d2('0x7e'),_0x25da1f['name'],'is\x20disactive');}emitCampaignSummary(_0x25da1f);}}function myreject(_0x23d031){return function(_0x500be5){return _0x23d031(msgResponse(_0xe3d2('0x7f'),_0xe3d2('0x80'),JSON[_0xe3d2('0x70')](_0x500be5)));};}Dialer[_0xe3d2('0x1a')][_0xe3d2('0x81')]=function(_0x431b02){return!_[_0xe3d2('0x40')](_0x431b02)&&_0x431b02&&!_['isUndefined'](_0x431b02[_0xe3d2('0x46')])&&!_['isUndefined'](_0x431b02[_0xe3d2('0x82')])&&_0x431b02[_0xe3d2('0x82')]&&(this[_0xe3d2('0x23')][util[_0xe3d2('0x44')](_0xe3d2('0x83'),_0x431b02['name'])][_0xe3d2('0x84')]===_0xe3d2('0x85')||this[_0xe3d2('0x23')][util[_0xe3d2('0x44')]('SIP/%s',_0x431b02[_0xe3d2('0x46')])][_0xe3d2('0x84')]===_0xe3d2('0x86'));};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x87')]=function(_0x38cbf9){var _0x5df007=this;return function(){if(!_0x5df007[_0xe3d2('0x81')](_0x38cbf9[_0xe3d2('0x88')])){if(!_0x5df007[_0xe3d2('0x81')](_0x38cbf9[_0xe3d2('0x89')])){_0x38cbf9[_0xe3d2('0x65')]=utils[_0xe3d2('0x66')][_0xe3d2('0x8a')];throw _0x38cbf9[_0xe3d2('0x46')]+_0xe3d2('0x8b');}}};};Dialer[_0xe3d2('0x1a')]['checkIfTime']=function(_0x2b0bff,_0x42d081,_0x394131,_0x5ef01f){var _0x3167f7=this;return function(){var _0x5809de=!![];return _0x3167f7[_0xe3d2('0x8c')](_0x2b0bff,_0x42d081,_0x394131,_0x5ef01f,_0x5809de);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x1dc1d3,_0x501011,_0x8a34a6,_0x53384c){var _0x11c9e8=this;return function(){var _0x18b94e=![];return _0x11c9e8['ifTimeIvr'](_0x1dc1d3[_0xe3d2('0x75')],_0x501011,_0x8a34a6,_0x53384c,_0x18b94e);};};Dialer['prototype'][_0xe3d2('0x8c')]=function(_0x507fa1,_0x24a9fc,_0x887667,_0x73cdcd,_0x369aaf){var _0x4e2eaf=[];return new Promise(function(_0x5d32b0,_0x2e885c){if(!isNotNull(_0x507fa1)){_0x73cdcd['message']=utils['CAMPAIGN_STATUS'][_0xe3d2('0x73')];return _0x2e885c(msgResponse('ifTime',_0xe3d2('0x8d'),_0x887667+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x507fa1)){_0x73cdcd['message']=utils['CAMPAIGN_STATUS']['EMPTY_INTERVAL'];return _0x2e885c(msgResponse('ifTime',_0xe3d2('0x8d'),_0x887667+'\x20Intervals\x20is\x20empty\x20'));}if(_0x24a9fc&&_['isUndefined'](config[_0xe3d2('0x8e')][_0x24a9fc])){_0x73cdcd[_0xe3d2('0x65')]=utils['CAMPAIGN_STATUS'][_0xe3d2('0x8f')];return _0x2e885c(msgResponse(_0xe3d2('0x90'),'Failure',_0x887667+_0xe3d2('0x91')+_0x24a9fc));}if(_[_0xe3d2('0x92')](_0x507fa1)){for(var _0x5e9da5=0x0;_0x5e9da5<_0x507fa1[_0xe3d2('0x93')];_0x5e9da5+=0x1){_0x4e2eaf[_0xe3d2('0x94')](ami[_0xe3d2('0x95')]({'action':_0xe3d2('0x96'),'command':util[_0xe3d2('0x44')](_0xe3d2('0x97'),_0x507fa1[_0x5e9da5][_0xe3d2('0x98')],!_[_0xe3d2('0x40')](config[_0xe3d2('0x8e')][_0x24a9fc])?_0x24a9fc:'')})[_0xe3d2('0x99')](function(_0x1ae121){return _0x1ae121['content']['indexOf'](_0xe3d2('0x9a'))>=0x0;})[_0xe3d2('0x9b')](myreject(_0x2e885c)));}}else{_0x4e2eaf[_0xe3d2('0x94')](ami[_0xe3d2('0x95')]({'action':_0xe3d2('0x96'),'command':util[_0xe3d2('0x44')](_0xe3d2('0x97'),_0x507fa1,!_[_0xe3d2('0x40')](config[_0xe3d2('0x8e')][_0x24a9fc])?_0x24a9fc:'')})[_0xe3d2('0x99')](function(_0x5f1c94){return _0x5f1c94[_0xe3d2('0x9c')]['indexOf'](_0xe3d2('0x9a'))>=0x0;})[_0xe3d2('0x9b')](myreject(_0x2e885c)));}Promise['all'](_0x4e2eaf)[_0xe3d2('0x99')](function(_0x5e4951){var _0x59caae=_[_0xe3d2('0x9d')](_0x5e4951);if(_0x59caae){return _0x5d32b0(_0x59caae);}else{_0x73cdcd['message']=_0x369aaf?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0xe3d2('0x66')][_0xe3d2('0x9e')];return _0x2e885c(msgResponse(_0xe3d2('0x9f'),_0xe3d2('0x8d'),'Global:\x20'+_0x369aaf+'\x20'+_0x887667+_0xe3d2('0xa0')+util['inspect'](_0x507fa1,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x24a9fc));}})[_0xe3d2('0x9b')](function(_0x15b2f2){return _0x2e885c(msgResponse('ifTime',_0xe3d2('0x8d'),JSON[_0xe3d2('0x70')](_0x15b2f2)));});});};Dialer[_0xe3d2('0x1a')]['loopCampaigns']=function(){var _0x1166d1=this;return cmHopper[_0xe3d2('0xa1')]({'active':![]},{'where':{'active':!![]}})[_0xe3d2('0x99')](function(){setInterval(function(){_0x1166d1[_0xe3d2('0xa2')]();},0x3e8);});};Dialer[_0xe3d2('0x1a')]['syncCampaigns']=function(){var _0x2df7af=this;var _0x3ba603;for(var _0x479b99 in this[_0xe3d2('0x21')]){if(typeof this['campaigns'][_0x479b99]!==_0xe3d2('0xa3')){_0x3ba603=this['campaigns'][_0x479b99];if(utils[_0xe3d2('0x78')](_0x3ba603)&&utils['isIVRCampaignActive'](_0x3ba603)){_0x3ba603['sendMessageOneNotActive']=!![];Promise[_0xe3d2('0xa4')]()['then'](checkIsIVRCampaignActive(_0x3ba603))[_0xe3d2('0x99')](checkInterval(_0x3ba603))[_0xe3d2('0x99')](_0x2df7af[_0xe3d2('0x87')](_0x3ba603))['then'](_0x2df7af[_0xe3d2('0xa5')](_0x3ba603[_0xe3d2('0xa6')],_0x3ba603[_0xe3d2('0xa7')],_0x3ba603[_0xe3d2('0x46')],_0x3ba603))[_0xe3d2('0x99')](_0x2df7af[_0xe3d2('0xa8')](_0x3ba603['Interval'],_0x3ba603[_0xe3d2('0xa7')],_0x3ba603[_0xe3d2('0x46')],_0x3ba603))[_0xe3d2('0x99')](_0x2df7af['launchHandleIvr'](_0x3ba603))[_0xe3d2('0x9b')](loggerCatchQueueSummary(_0xe3d2('0xa9'),_0x3ba603));}else{notSendMessagesCampaign(_0x3ba603);}}}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0xaa')]=function(_0x2039cb){if(_0x2039cb[_0xe3d2('0xab')]!==_0xe3d2('0xc')){clearPredictiveAttributes(_0x2039cb);}switch(_0x2039cb[_0xe3d2('0xab')]){case _0xe3d2('0xac'):this[_0xe3d2('0xad')](_0x2039cb,0x1);break;case _0xe3d2('0xae'):this[_0xe3d2('0xad')](_0x2039cb,_0x2039cb[_0xe3d2('0xaf')]);break;case _0xe3d2('0xc'):this['predictive'](_0x2039cb);break;case _0xe3d2('0xb'):this[_0xe3d2('0xad')](_0x2039cb,0x1);break;default:logger[_0xe3d2('0x63')](_0xe3d2('0xb0'),_0x2039cb[_0xe3d2('0x46')],_0xe3d2('0xb1'));}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x90')]=function(_0x4a34eb,_0x2b3f2e){var _0x5cfd90=_0x4a34eb[_0xe3d2('0xa7')];var _0x1c454a=_0x2b3f2e?_0x4a34eb['dialGlobalInterval']:_0x4a34eb[_0xe3d2('0x72')][_0xe3d2('0x75')];logger[_0xe3d2('0xb2')](_0xe3d2('0xb3'),_0x1c454a,_0x5cfd90,_0x4a34eb[_0xe3d2('0x46')],util[_0xe3d2('0x44')](_0xe3d2('0xb4'),_0x4a34eb[_0xe3d2('0x46')],_0x4a34eb['id']));var _0x4525b3=null;return Interval[_0xe3d2('0xb5')](_0x1c454a,_0x5cfd90)['then'](function(_0x2e7e87){if(_0x2e7e87===!![]){return _0x2e7e87;}else{_0x4a34eb[_0xe3d2('0x65')]=_0x2b3f2e?utils[_0xe3d2('0x66')][_0xe3d2('0xb6')]:utils[_0xe3d2('0x66')][_0xe3d2('0x9e')];_0x4525b3=msgResponse(_0xe3d2('0x9f'),_0xe3d2('0x8d'),_0xe3d2('0xb7')+_0x2b3f2e+'\x20'+_0x4a34eb['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0xe3d2('0x43')](_0x1c454a,{'showHidden':![],'depth':null})+_0xe3d2('0xb8')+_0x5cfd90);}if(_0x4525b3!==null){logger[_0xe3d2('0xb2')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4525b3);_0x4525b3[_0xe3d2('0xb9')]=_0x2b3f2e;throw _0x4525b3;}})[_0xe3d2('0x9b')](function(_0x428dc8){logger['error'](_0xe3d2('0xba'),_0x428dc8);throw msgResponse(_0xe3d2('0x7f'),_0xe3d2('0x80'),util[_0xe3d2('0x43')](_0x428dc8,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xe3d2('0x2d')]=function(_0x4a4a02){if(this['voiceQueues'][_0x4a4a02['queue']]){if(this['uniqueId'][_0x4a4a02[_0xe3d2('0xbb')]]&&this['uniqueId'][_0x4a4a02[_0xe3d2('0xbb')]][_0xe3d2('0xbc')]!=='ivr'){this[_0xe3d2('0xbd')](this['voiceQueues'][_0x4a4a02[_0xe3d2('0xbe')]]);this[_0xe3d2('0x27')][_0x4a4a02[_0xe3d2('0xbb')]]['answertime']=moment()[_0xe3d2('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x32')]=function(_0x1f5767){var _0x3312dc=this[_0xe3d2('0x27')][_0x1f5767[_0xe3d2('0xbb')]];if(this[_0xe3d2('0x20')][_0x1f5767['queue']]){if(_0x3312dc&&_0x3312dc[_0xe3d2('0xbc')]!==_0xe3d2('0xbf')){delete this[_0xe3d2('0x27')][_0x1f5767[_0xe3d2('0xbb')]];this[_0xe3d2('0x20')][_0x1f5767[_0xe3d2('0xbe')]][_0xe3d2('0xc0')]+=0x1;var _0x23d61f=new AgentComplete(_0x3312dc,_0x1f5767);if(_0x1f5767[_0xe3d2('0xc1')]===_0xe3d2('0xc2')){_0x23d61f[_0xe3d2('0xc3')]=this['voiceQueues'][_0x1f5767['queue']][_0xe3d2('0xc4')]&&this[_0xe3d2('0x20')][_0x1f5767[_0xe3d2('0xbe')]][_0xe3d2('0xc5')]?moment()[_0xe3d2('0x44')](_0xe3d2('0xc6')):undefined;}hopperUtils[_0xe3d2('0xc7')](_0x23d61f)['catch'](loggerCatch(_0xe3d2('0xc8')));hopperUtils[_0xe3d2('0xc9')](_0x23d61f)['catch'](loggerCatch(_0xe3d2('0xca')));}}};Dialer[_0xe3d2('0x1a')]['syncQueueCallerAbandon']=function(_0x367998){var _0x554af8=this[_0xe3d2('0x27')][_0x367998[_0xe3d2('0xbb')]];var _0x5056c5=this;var _0x1e1997=![];var _0x487d0c;var _0x428b92;if(this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]]){if(_0x554af8&&_0x554af8[_0xe3d2('0xbc')]!==_0xe3d2('0xbf')){delete this['uniqueId'][_0x367998[_0xe3d2('0xbb')]];this['updateOriginated'](this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]]);_0x554af8[_0xe3d2('0xcb')]=moment()[_0xe3d2('0x44')](_0xe3d2('0xc6'));var _0x355b27=new QueueCallerAbandon(_0x554af8,_0x367998);if(utils[_0xe3d2('0xcc')](_0x554af8[_0xe3d2('0xcb')],_0x554af8[_0xe3d2('0xcd')])>=_0x554af8[_0xe3d2('0xce')]){this['voiceQueues'][_0x367998['queue']][_0xe3d2('0xcf')]+=0x1;this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xd0')]+=0x1;this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xd1')]+=0x1;_0x355b27[_0xe3d2('0x6c')]=0xa;_0x355b27[_0xe3d2('0xd2')]=_0xe3d2('0xd3');_0x355b27[_0xe3d2('0xd4')]=_0xe3d2('0xd5');_0x355b27[_0xe3d2('0xc3')]=this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xc4')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x355b27[_0xe3d2('0xd6')]+=0x1;_0x355b27[_0xe3d2('0xd7')]+=0x1;_0x487d0c=this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xd8')];_0x428b92=this[_0xe3d2('0x20')][_0x367998['queue']][_0xe3d2('0xd9')];hopperUtils[_0xe3d2('0xda')](_0x355b27,_0x355b27[_0xe3d2('0x6c')],_0x554af8[_0xe3d2('0xdb')])[_0xe3d2('0x99')](function(_0x2bf8ea){_0x1e1997=_0x2bf8ea[_0xe3d2('0xdc')]==0x1;if(_0x355b27['countdropretry']>=_0x5056c5[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xdd')]){_0x5056c5[_0xe3d2('0xde')](_0x355b27,_0x2bf8ea[_0xe3d2('0xdc')]);}else{hopperUtils[_0xe3d2('0xdf')]({'active':![],'countdropretry':_0x355b27[_0xe3d2('0xd6')],'scheduledat':moment()[_0xe3d2('0xe0')](_0x5056c5[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xd8')],_0xe3d2('0xe1'))['format'](_0xe3d2('0xc6')),'ContactId':_0x554af8[_0xe3d2('0xe2')],'ListId':_0x554af8[_0xe3d2('0xe3')],'VoiceQueueId':_0x554af8[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x554af8['CampaignId']||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0xe5')));var _0x14bf83=new History(_0x355b27);_0x14bf83[_0xe3d2('0x6c')]=0xa;_0x14bf83['statedesc']='Drop';_0x14bf83[_0xe3d2('0x6e')]=moment()[_0xe3d2('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x14bf83[_0xe3d2('0x6d')]=_0x14bf83[_0xe3d2('0x6e')];_0x14bf83['calleridname']=_0x355b27['calleridname'];_0x14bf83[_0xe3d2('0xe6')]=_0x355b27[_0xe3d2('0xe6')];hopperUtils[_0xe3d2('0xc7')](_0x14bf83)['catch'](loggerCatch(_0xe3d2('0xe7')));}})['then'](function(){if(_0x1e1997)hopperUtils[_0xe3d2('0xe8')](_0x355b27,_0x487d0c,_0x428b92)[_0xe3d2('0x99')](function(){return 0x1;});});}else{this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xe9')]+=0x1;_0x355b27['state']=0xb;_0x355b27['statedesc']=_0xe3d2('0xea');_0x355b27[_0xe3d2('0xd4')]=_0xe3d2('0xeb');_0x355b27[_0xe3d2('0xec')]+=0x1;_0x355b27[_0xe3d2('0xd7')]+=0x1;_0x487d0c=this[_0xe3d2('0x20')][_0x367998['queue']][_0xe3d2('0xed')];_0x428b92=this[_0xe3d2('0x20')][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xd9')];hopperUtils['verifyAdditionalPhones'](_0x355b27,_0x355b27[_0xe3d2('0x6c')],_0x554af8[_0xe3d2('0xdb')])[_0xe3d2('0x99')](function(_0x587714){if(_0x355b27[_0xe3d2('0xec')]>=_0x5056c5['voiceQueues'][_0x367998[_0xe3d2('0xbe')]][_0xe3d2('0xee')]){_0x5056c5[_0xe3d2('0xde')](_0x355b27,_0x587714[_0xe3d2('0xdc')]);}else{hopperUtils[_0xe3d2('0xdf')]({'active':![],'countabandonedretry':_0x355b27[_0xe3d2('0xec')],'scheduledat':moment()[_0xe3d2('0xe0')](_0x5056c5['voiceQueues'][_0x367998[_0xe3d2('0xbe')]]['dialAbandonedRetryFrequency'],_0xe3d2('0xe1'))[_0xe3d2('0x44')](_0xe3d2('0xc6')),'ContactId':_0x554af8[_0xe3d2('0xe2')],'ListId':_0x554af8[_0xe3d2('0xe3')],'VoiceQueueId':_0x554af8[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x554af8[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0xf0')));var _0x5beabc=new History(_0x355b27);_0x5beabc[_0xe3d2('0x6c')]=0xb;_0x5beabc[_0xe3d2('0xd2')]='Abandoned';_0x5beabc['starttime']=moment()[_0xe3d2('0x44')](_0xe3d2('0xc6'));_0x5beabc[_0xe3d2('0x6d')]=_0x5beabc[_0xe3d2('0x6e')];_0x5beabc[_0xe3d2('0xf1')]=_0x355b27[_0xe3d2('0xf1')];_0x5beabc[_0xe3d2('0xe6')]=_0x355b27[_0xe3d2('0xe6')];hopperUtils[_0xe3d2('0xc7')](_0x5beabc)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0xf2')));}})['then'](function(){if(_0x1e1997)hopperUtils[_0xe3d2('0xe8')](_0x355b27,_0x487d0c,_0x428b92)[_0xe3d2('0x99')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x5d9d8c){if(this[_0xe3d2('0x25')][_0x5d9d8c[_0xe3d2('0xbb')]]){this[_0xe3d2('0x25')][_0x5d9d8c['uniqueid']][_0xe3d2('0xf3')]=_0x5d9d8c[_0xe3d2('0xf3')];}if(this[_0xe3d2('0x27')][_0x5d9d8c[_0xe3d2('0xbb')]]){this[_0xe3d2('0x27')][_0x5d9d8c[_0xe3d2('0xbb')]][_0xe3d2('0xf3')]=_0x5d9d8c['channel'];}};Dialer['prototype'][_0xe3d2('0x3b')]=function(_0x3f7f0d){if(!this['actions'][_0x3f7f0d['actionid']]){return;}var _0x46cd46=this[_0xe3d2('0x20')][this['actions'][_0x3f7f0d[_0xe3d2('0xf4')]]['queue']][_0xe3d2('0xf5')]||_0xe3d2('0xf6');if(_0x46cd46===_0xe3d2('0xf7')){if(this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]]&&_[_0xe3d2('0xf8')](this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]][_0xe3d2('0xf9')])&&_0x3f7f0d[_0xe3d2('0x84')]==='1'&&_0x3f7f0d[_0xe3d2('0xfa')]==='0'){if(this[_0xe3d2('0x22')][_0x3f7f0d[_0xe3d2('0xfb')]]){if(!this[_0xe3d2('0x22')][_0x3f7f0d[_0xe3d2('0xfb')]][_0xe3d2('0xf9')]){this[_0xe3d2('0x22')][_0x3f7f0d['stateinterface']][_0xe3d2('0xf9')]=!![];this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]][_0xe3d2('0xf9')]=!![];this['actions'][_0x3f7f0d['actionid']]['stateinterface']=_0x3f7f0d[_0xe3d2('0xfb')];}}}}else if(_0x46cd46===_0xe3d2('0xf6')){if(this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]]){if(this[_0xe3d2('0x22')][_0x3f7f0d[_0xe3d2('0xfb')]]){this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]][_0xe3d2('0xfb')]=_0x3f7f0d['stateinterface'];if(_[_0xe3d2('0xf8')](this[_0xe3d2('0x2a')][this['actions'][_0x3f7f0d[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]])){this['queueBooked'][this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]=[];}this[_0xe3d2('0x2a')][this[_0xe3d2('0x25')][_0x3f7f0d[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]][_0xe3d2('0x94')](_[_0xe3d2('0xfc')](_[_0xe3d2('0x71')](this[_0xe3d2('0x25')][_0x3f7f0d['actionid']],[_0xe3d2('0xfd'),_0xe3d2('0xfb')]),{'status':_0x3f7f0d['status'],'paused':_0x3f7f0d[_0xe3d2('0xfa')]}));}}}};Dialer['prototype'][_0xe3d2('0xfe')]=function(_0x595c58){if(!this['actions'][_0x595c58[_0xe3d2('0xf4')]]){return;}var _0xfcbf38=this;var _0x2d414c=this['voiceQueues'][this[_0xe3d2('0x25')][_0x595c58['actionid']]['queue']];var _0xeab7f7=_0x2d414c[_0xe3d2('0xf5')]||'rrmemory';if(_0xeab7f7===_0xe3d2('0xf7')){if(this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]&&this['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xfb')]){this['preview'][_0xe3d2('0xff')](this['actions'][_0x595c58[_0xe3d2('0xf4')]]['idHopper'],this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xfb')])[_0xe3d2('0x9b')](function(_0x169720){logger[_0xe3d2('0x63')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x169720,{'showHidden':![],'depth':null}));})['finally'](function(){_0xfcbf38[_0xe3d2('0xbd')](_0xfcbf38[_0xe3d2('0x20')][_0xfcbf38[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]['queue']]);_0xfcbf38[_0xe3d2('0x22')][_0xfcbf38[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xfb')]][_0xe3d2('0xf9')]=![];delete _0xfcbf38[_0xe3d2('0x25')][_0x595c58['actionid']];unlockQueueStatus(_0x2d414c);});}else{this[_0xe3d2('0xbd')](this['voiceQueues'][this['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe2')],'ListId':this['actions'][_0x595c58['actionid']][_0xe3d2('0xe3')],'VoiceQueueId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe4')]||undefined,'CampaignId':this['actions'][_0x595c58[_0xe3d2('0xf4')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xe3d2('0x100')));delete this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]];unlockQueueStatus(_0x2d414c);}}else if(_0xeab7f7===_0xe3d2('0xf6')){var _0x2e1a29;if(this['actions'][_0x595c58[_0xe3d2('0xf4')]]&&!_[_0xe3d2('0x48')](this[_0xe3d2('0x2a')][this[_0xe3d2('0x25')][_0x595c58['actionid']][_0xe3d2('0xbe')]])){if(this[_0xe3d2('0x2b')][_0xfcbf38[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]){this['queueBookedRR'][_0xfcbf38['actions'][_0x595c58['actionid']][_0xe3d2('0xbe')]]=this[_0xe3d2('0x2b')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]['queue']]?this[_0xe3d2('0x2b')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]['queue']]:this['queueBooked'][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]?this[_0xe3d2('0x2a')][this['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]['_rr']||0x0:0x0;}this[_0xe3d2('0x2a')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]][_0xe3d2('0x101')]=this[_0xe3d2('0x2b')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]];for(var _0x4b906c=0x0;_0x4b906c<this['queueBooked'][this['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]][_0xe3d2('0x93')];_0x4b906c+=0x1){_0x2e1a29=rr(this['queueBooked'][this['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]);this[_0xe3d2('0x2b')][_0xfcbf38[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]['queue']]=this['queueBooked'][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]['queue']][_0xe3d2('0x101')];if(_0x2e1a29[_0xe3d2('0x84')]==='1'&&_0x2e1a29[_0xe3d2('0xfa')]==='0'){break;}}if(!_[_0xe3d2('0xf8')](_0x2e1a29)){this['agents'][_0x2e1a29[_0xe3d2('0xfb')]][_0xe3d2('0x102')]=_[_0xe3d2('0x40')](this[_0xe3d2('0x22')][_0x2e1a29[_0xe3d2('0xfb')]][_0xe3d2('0x102')])?!![]:this[_0xe3d2('0x22')][_0x2e1a29[_0xe3d2('0xfb')]][_0xe3d2('0x102')];}loggerBooked[_0xe3d2('0x49')](_0xe3d2('0x103'),_0x595c58[_0xe3d2('0xf4')],'Agent:\x20',JSON['stringify'](_[_0xe3d2('0x71')](this['agents'][_0x2e1a29['stateinterface']],[_0xe3d2('0x46'),_0xe3d2('0x102')])),_0xe3d2('0x104'),JSON[_0xe3d2('0x70')](_0x2e1a29[_0xe3d2('0xfd')]));if(!_[_0xe3d2('0xf8')](_0x2e1a29)&&_0x2e1a29['status']==='1'&&_0x2e1a29[_0xe3d2('0xfa')]==='0'&&this['agents'][_0x2e1a29[_0xe3d2('0xfb')]][_0xe3d2('0x102')]){this[_0xe3d2('0x22')][_0x2e1a29[_0xe3d2('0xfb')]][_0xe3d2('0x102')]=![];this[_0xe3d2('0x2a')][_0xfcbf38[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]=[];this[_0xe3d2('0x1f')]['run'](_0x2e1a29['idHopper'],_0x2e1a29['stateinterface'])[_0xe3d2('0x9b')](function(_0x3924f3){logger[_0xe3d2('0x63')](_0xe3d2('0x105'),util['inspect'](_0x3924f3,{'showHidden':![],'depth':null}));})['finally'](function(){_0xfcbf38[_0xe3d2('0xbd')](_0xfcbf38['voiceQueues'][_0xfcbf38['actions'][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]);setTimeout(function(){_0xfcbf38['agents'][_0x2e1a29[_0xe3d2('0xfb')]][_0xe3d2('0x102')]=!![];loggerBooked[_0xe3d2('0x49')]('[booked][RR][finaly]',_0x595c58[_0xe3d2('0xf4')],_0xe3d2('0x106'),JSON[_0xe3d2('0x70')](_[_0xe3d2('0x71')](_0xfcbf38[_0xe3d2('0x22')][_0x2e1a29[_0xe3d2('0xfb')]],['name','unlockRR'])),_0xe3d2('0x104'),JSON[_0xe3d2('0x70')](_0x2e1a29[_0xe3d2('0xfd')]));},0xc7);delete _0xfcbf38['actions'][_0x595c58[_0xe3d2('0xf4')]];unlockQueueStatus(_0x2d414c,_0x595c58[_0xe3d2('0xf4')]);});}else{loggerBooked['info'](_0xe3d2('0x107'));this[_0xe3d2('0xbd')](this[_0xe3d2('0x20')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]]['queue']]);hopperUtils[_0xe3d2('0xdf')]({'active':![],'ContactId':this[_0xe3d2('0x25')][_0x595c58['actionid']][_0xe3d2('0xe2')],'ListId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe3')],'VoiceQueueId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe4')]||undefined,'CampaignId':this['actions'][_0x595c58[_0xe3d2('0xf4')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xe3d2('0x25')][_0x595c58['actionid']];unlockQueueStatus(_0x2d414c);}}else{loggerBooked['info'](_0xe3d2('0x108'));this[_0xe3d2('0xbd')](this[_0xe3d2('0x20')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]);hopperUtils[_0xe3d2('0xdf')]({'active':![],'ContactId':this[_0xe3d2('0x25')][_0x595c58['actionid']][_0xe3d2('0xe2')],'ListId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe3')],'VoiceQueueId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe4')]||undefined,'CampaignId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x109')));delete this[_0xe3d2('0x25')][_0x595c58['actionid']];unlockQueueStatus(_0x2d414c);}}else{loggerBooked[_0xe3d2('0x49')](_0xe3d2('0x10a'));this[_0xe3d2('0xbd')](this[_0xe3d2('0x20')][this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0xe3d2('0x25')][_0x595c58['actionid']][_0xe3d2('0xe2')],'ListId':this[_0xe3d2('0x25')][_0x595c58['actionid']][_0xe3d2('0xe3')],'VoiceQueueId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xe4')]||undefined,'CampaignId':this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]][_0xe3d2('0xef')]||undefined})['catch'](loggerCatch(_0xe3d2('0x10b')));delete this[_0xe3d2('0x25')][_0x595c58[_0xe3d2('0xf4')]];unlockQueueStatus(_0x2d414c);}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x31')]=function(_0x1cd562){var _0x57496e=this[_0xe3d2('0x25')][_0x1cd562['actionid']];if(_0x57496e){delete this[_0xe3d2('0x25')][_0x1cd562[_0xe3d2('0xf4')]];_0x57496e['responsetime']=moment()[_0xe3d2('0x44')](_0xe3d2('0xc6'));var _0x3e0e26=_0x57496e[_0xe3d2('0xbc')]==='ivr'?this['campaigns'][_0x57496e[_0xe3d2('0xbe')]]:this['voiceQueues'][_0x57496e[_0xe3d2('0x10c')]()];if(_0x1cd562[_0xe3d2('0x10d')]!==_0xe3d2('0x10e')){this['updateOriginated'](_0x3e0e26);return this['callProgressDetecting'](_0x57496e,_0x3e0e26,_0x1cd562)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x10f')));}this[_0xe3d2('0x27')][_0x1cd562[_0xe3d2('0xbb')]]=_0x57496e;}};Dialer['prototype'][_0xe3d2('0x39')]=function(_0x23d593){var _0x20dd10=this;var _0x2c8797=this['uniqueId'][_0x23d593[_0xe3d2('0xbb')]];var _0x2bcf49;if(!_[_0xe3d2('0xf8')](_0x23d593)&&!_['isNil'](_0x23d593[_0xe3d2('0x110')])&&!_[_0xe3d2('0xf8')](_0x23d593[_0xe3d2('0x110')][_0xe3d2('0x111')])&&_0x23d593[_0xe3d2('0x112')]===_0xe3d2('0x113')&&_0x2c8797){if(_0x2c8797['type']!==_0xe3d2('0xbf')&&this[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]]['dialAMDActive']&&_0x23d593[_0xe3d2('0x114')]===_0xe3d2('0x115')){delete this[_0xe3d2('0x27')][_0x23d593[_0xe3d2('0xbb')]];this[_0xe3d2('0xbd')](this[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]]);this[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]][_0xe3d2('0xc0')]+=0x1;this[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]][_0xe3d2('0x116')]+=0x1;_0x2bcf49=new Hangup(_0x2c8797,_0x23d593);_0x2bcf49['state']=0x12;_0x2bcf49[_0xe3d2('0xd2')]=_0xe3d2('0x117');_0x2bcf49[_0xe3d2('0x118')]=_0xe3d2('0x119');ami['emit']('custom:amd',ut[_0xe3d2('0x11a')](_0x2bcf49,_0xe3d2('0x11b')));this[_0xe3d2('0x11c')](_0x2bcf49,'[syncHangupInAMD][createHistory]',_0xe3d2('0x11d'));}if(_0x2c8797[_0xe3d2('0xbc')]!=='ivr'&&this[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]][_0xe3d2('0x11e')]&&_0x23d593[_0xe3d2('0x114')]==='MACHINE'){return new Promise(function(_0x2d58f9,_0x240be1){delete _0x20dd10['uniqueId'][_0x23d593[_0xe3d2('0xbb')]];_0x20dd10[_0xe3d2('0xbd')](_0x20dd10[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]]);_0x20dd10['voiceQueues'][_0x2c8797[_0xe3d2('0xbe')]][_0xe3d2('0xc0')]+=0x1;_0x20dd10[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]][_0xe3d2('0x116')]+=0x1;var _0x514fc6=_0x20dd10[_0xe3d2('0x20')][_0x2c8797[_0xe3d2('0xbe')]];var _0x58cfeb=new Hangup(_0x2c8797,_0x23d593);_0x58cfeb['state']=0x13;_0x58cfeb['statedesc']=_0xe3d2('0x11f');_0x58cfeb['membername']=_0xe3d2('0x119');_0x58cfeb[_0xe3d2('0x120')]+=0x1;_0x58cfeb[_0xe3d2('0xd7')]+=0x1;_0x58cfeb[_0xe3d2('0x11b')]=!![];ami[_0xe3d2('0x41')](_0xe3d2('0x121'),ut['buildObj'](_0x58cfeb,_0xe3d2('0x11b')));hopperUtils[_0xe3d2('0xc7')](_0x58cfeb)['catch'](loggerCatch(_0xe3d2('0x122')));if(_0x58cfeb['countbusyretry']+_0x58cfeb[_0xe3d2('0x123')]+_0x58cfeb['countnoanswerretry']+_0x58cfeb['countnosuchnumberretry']+_0x58cfeb[_0xe3d2('0xd6')]+_0x58cfeb[_0xe3d2('0xec')]+_0x58cfeb[_0xe3d2('0x120')]+_0x58cfeb[_0xe3d2('0x124')]>=_0x514fc6[_0xe3d2('0x125')]){_0x20dd10[_0xe3d2('0x126')](_0x58cfeb,_0x2d58f9,_0x240be1,'reason19\x20machine....');}else{if(_0x58cfeb[_0xe3d2('0x120')]>=_0x514fc6[_0xe3d2('0x127')]){_0x20dd10[_0xe3d2('0x128')](_0x58cfeb,_0x2d58f9,_0x240be1,'reason\x2019\x20machine....');}else{hopperUtils[_0xe3d2('0xdf')]({'active':![],'countmachineretry':_0x58cfeb[_0xe3d2('0x120')],'scheduledat':moment()[_0xe3d2('0xe0')](_0x514fc6[_0xe3d2('0x129')],_0xe3d2('0xe1'))[_0xe3d2('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x58cfeb[_0xe3d2('0xe2')],'ListId':_0x58cfeb[_0xe3d2('0xe3')],'VoiceQueueId':_0x58cfeb[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x58cfeb['CampaignId']||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x12a')));_0x2d58f9({'reschedule':0x1});}}});}if(_0x2c8797[_0xe3d2('0xbc')]===_0xe3d2('0xbf')&&this['campaigns'][_0x2c8797[_0xe3d2('0xbe')]]['dialAMDActive']&&_0x23d593[_0xe3d2('0x114')]==='HANGUP'){delete this['uniqueId'][_0x23d593[_0xe3d2('0xbb')]];this[_0xe3d2('0xbd')](this[_0xe3d2('0x21')][_0x2c8797['queue']]);_0x2bcf49=new Hangup(_0x2c8797,_0x23d593);_0x2bcf49[_0xe3d2('0x6c')]=0x12;_0x2bcf49[_0xe3d2('0xd2')]=_0xe3d2('0x117');_0x2bcf49[_0xe3d2('0x118')]=_0xe3d2('0x119');ami[_0xe3d2('0x41')]('custom:amd',ut[_0xe3d2('0x11a')](_0x2bcf49,_0xe3d2('0x11b')));this[_0xe3d2('0x11c')](_0x2bcf49,_0xe3d2('0x12b'),_0xe3d2('0x12c'));}if(_0x2c8797['type']===_0xe3d2('0xbf')&&this['campaigns'][_0x2c8797['queue']][_0xe3d2('0x11e')]&&_0x23d593['value']===_0xe3d2('0x12d')){return new Promise(function(_0x593eff,_0x1e84b3){delete _0x20dd10[_0xe3d2('0x27')][_0x23d593[_0xe3d2('0xbb')]];_0x20dd10[_0xe3d2('0xbd')](_0x20dd10[_0xe3d2('0x21')][_0x2c8797[_0xe3d2('0xbe')]]);_0x20dd10[_0xe3d2('0x21')][_0x2c8797['queue']]['outboundAnswerCallsDay']+=0x1;_0x20dd10['campaigns'][_0x2c8797['queue']][_0xe3d2('0x116')]+=0x1;var _0x38ab2c=_0x20dd10[_0xe3d2('0x21')][_0x2c8797[_0xe3d2('0xbe')]];var _0x2c8b8f=new Hangup(_0x2c8797,_0x23d593);_0x2c8b8f['state']=0x13;_0x2c8b8f[_0xe3d2('0xd2')]=_0xe3d2('0x11f');_0x2c8b8f[_0xe3d2('0x118')]='AMD';_0x2c8b8f[_0xe3d2('0x120')]+=0x1;_0x2c8b8f[_0xe3d2('0xd7')]+=0x1;_0x2c8b8f[_0xe3d2('0x11b')]=!![];ami['emit'](_0xe3d2('0x121'),ut[_0xe3d2('0x11a')](_0x2c8b8f,'amd'));hopperUtils['createHistory'](_0x2c8b8f)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2c8b8f[_0xe3d2('0x12e')]+_0x2c8b8f[_0xe3d2('0x123')]+_0x2c8b8f[_0xe3d2('0x12f')]+_0x2c8b8f[_0xe3d2('0x130')]+_0x2c8b8f[_0xe3d2('0xd6')]+_0x2c8b8f[_0xe3d2('0xec')]+_0x2c8b8f['countmachineretry']+_0x2c8b8f[_0xe3d2('0x124')]>=_0x38ab2c[_0xe3d2('0x125')]){_0x20dd10[_0xe3d2('0x126')](_0x2c8b8f,_0x593eff,_0x1e84b3,'reason19\x20machine....');}else{if(_0x2c8b8f[_0xe3d2('0x120')]>=_0x38ab2c[_0xe3d2('0x127')]){_0x20dd10['createStateFinal'](_0x2c8b8f,_0x593eff,_0x1e84b3,_0xe3d2('0x131'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2c8b8f[_0xe3d2('0x120')],'scheduledat':moment()[_0xe3d2('0xe0')](_0x38ab2c[_0xe3d2('0x129')],_0xe3d2('0xe1'))['format'](_0xe3d2('0xc6')),'ContactId':_0x2c8b8f[_0xe3d2('0xe2')],'ListId':_0x2c8b8f[_0xe3d2('0xe3')],'VoiceQueueId':_0x2c8b8f[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x2c8b8f[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x12a')));_0x593eff({'reschedule':0x1});}}});}}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x132')]=function(_0x1a4889){var _0x539be1=this['uniqueId'][_0x1a4889[_0xe3d2('0xbb')]];var _0x8aa64;if(_0x539be1&&_0x539be1['type']==='ivr'){delete this[_0xe3d2('0x27')][_0x1a4889[_0xe3d2('0xbb')]];this[_0xe3d2('0xbd')](this[_0xe3d2('0x21')][_0x539be1[_0xe3d2('0xbe')]]);this['campaigns'][_0x539be1[_0xe3d2('0xbe')]][_0xe3d2('0x133')]+=0x1;_0x8aa64=new Hangup(_0x539be1,_0x1a4889);hopperUtils[_0xe3d2('0xc7')](_0x8aa64)[_0xe3d2('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x8aa64)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x134')));}if(_0x539be1&&_0x539be1[_0xe3d2('0xbc')]!==_0xe3d2('0xbf')&&isNotNull(this[_0xe3d2('0x20')][_0x539be1[_0xe3d2('0xbe')]][_0xe3d2('0x135')])){delete this[_0xe3d2('0x27')][_0x1a4889['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x539be1[_0xe3d2('0xbe')]]);this[_0xe3d2('0x20')][_0x539be1[_0xe3d2('0xbe')]]['outboundAnswerCallsDay']+=0x1;this[_0xe3d2('0x20')][_0x539be1[_0xe3d2('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;_0x8aa64=new Hangup(_0x539be1,_0x1a4889);_0x8aa64[_0xe3d2('0x6c')]=0x10;_0x8aa64[_0xe3d2('0xd2')]='AnswerAGI';_0x8aa64[_0xe3d2('0x118')]=_0xe3d2('0x136');hopperUtils['createHistory'](_0x8aa64)[_0xe3d2('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xe3d2('0xc9')](_0x8aa64)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x134')));}if(_0x539be1&&_0x539be1[_0xe3d2('0xbc')]!==_0xe3d2('0xbf')&&!isNotNull(this['voiceQueues'][_0x539be1['queue']][_0xe3d2('0x135')])){delete this[_0xe3d2('0x27')][_0x1a4889['uniqueid']];this[_0xe3d2('0xbd')](this[_0xe3d2('0x20')][_0x539be1[_0xe3d2('0xbe')]]);this['voiceQueues'][_0x539be1[_0xe3d2('0xbe')]][_0xe3d2('0x137')]+=0x1;_0x8aa64=new Hangup(_0x539be1,_0x1a4889);_0x8aa64[_0xe3d2('0x6c')]=0xc;_0x8aa64[_0xe3d2('0xd2')]=_0x1a4889[_0xe3d2('0x138')];_0x8aa64[_0xe3d2('0x118')]='Unknow';hopperUtils[_0xe3d2('0xc7')](_0x8aa64)[_0xe3d2('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xe3d2('0xc9')](_0x8aa64)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x134')));}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x139')]=function(_0x441062){var _0x33b2a8=this;if(!_0x33b2a8['queuesSummary'][_0x441062[_0xe3d2('0x46')]]){_0x33b2a8[_0xe3d2('0x13a')][_0x441062[_0xe3d2('0x46')]]={'running':![]};}else if(_0x33b2a8['queuesSummary'][_0x441062[_0xe3d2('0x46')]]['running']===!![]){return;}else if(_0x33b2a8['queuesSummary'][_0x441062['name']][_0xe3d2('0x13b')]===![]){_0x33b2a8['queuesSummary'][_0x441062[_0xe3d2('0x46')]][_0xe3d2('0x13b')]=!![];}var _0x3f61a6=_0x33b2a8['voiceQueues'][_0x441062['name']];var _0x114e22=_0x3f61a6[_0xe3d2('0x65')]!==utils[_0xe3d2('0x66')][_0xe3d2('0x76')];var _0x1f48ab=utils[_0xe3d2('0x13c')](_0x3f61a6);_0x3f61a6[_0xe3d2('0x13d')]=utils['getQueueCampaignStatusMessage'](_0x3f61a6,_0x33b2a8['trunks']);Promise['resolve']()['then'](function(){if(_0x3f61a6[_0xe3d2('0x13d')]===utils[_0xe3d2('0x66')]['INACTIVE']){if(_0x114e22){clearPredictiveAttributes(_0x3f61a6);_0x441062[_0xe3d2('0x29')]=undefined;_0x441062['startProgressive']=undefined;}if(_0x3f61a6[_0xe3d2('0x13d')]===utils[_0xe3d2('0x66')][_0xe3d2('0x76')]){_0x441062[_0xe3d2('0x13e')]=0x0;_0x441062[_0xe3d2('0xfa')]=0x0;_0x441062['inUse']=0x0;_0x441062[_0xe3d2('0x13f')]=0x0;_0x441062[_0xe3d2('0x140')]=0x0;}}else if(_0x3f61a6['statusMessage']===utils[_0xe3d2('0x66')][_0xe3d2('0x141')]&&!_0x1f48ab){return _0x33b2a8['ifTime'](_0x3f61a6,!![])['then'](function(){return _0x33b2a8[_0xe3d2('0x90')](_0x3f61a6,![]);})['then'](function(){return _0x33b2a8[_0xe3d2('0xaa')](_0x3f61a6);})[_0xe3d2('0x9b')](function(_0x256974){loggerSyncQueueSummary[_0xe3d2('0x42')](_0xe3d2('0x142'),util[_0xe3d2('0x43')](_0x256974,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3f61a6);});}else{clearPredictiveAttributes(_0x3f61a6);}})[_0xe3d2('0x99')](function(){var _0x5e9642=_0x441062['compareToOutboundQueue'](_0x3f61a6);if(_0x5e9642||_0x3f61a6[_0xe3d2('0x143')]){_0x3f61a6['queueSummaryCountersUpdated']=![];_0x441062[_0xe3d2('0x144')](_0x3f61a6);Object[_0xe3d2('0x145')](_0x3f61a6,_0x441062);emitOutboundVoiceQueueSummary(_0x441062);}_0x33b2a8[_0xe3d2('0x13a')][_0x3f61a6[_0xe3d2('0x46')]][_0xe3d2('0x13b')]=![];})[_0xe3d2('0x9b')](function(_0x1a5300){logger[_0xe3d2('0x63')](_0xe3d2('0x142'),util[_0xe3d2('0x43')](_0x1a5300,{'showHidden':![],'depth':null}));_0x33b2a8['queuesSummary'][_0x3f61a6[_0xe3d2('0x46')]]['running']=![];});};Dialer['prototype'][_0xe3d2('0x35')]=_['throttle'](function(){var _0x2342e1=_[_0xe3d2('0x146')](this['voiceQueues'],function(_0x1f8b66){return _0x1f8b66['dialPreviewRecallmeReminder'];});var _0x23d07f=_[_0xe3d2('0x146')](this[_0xe3d2('0x22')],function(_0x3165cd){return _0x3165cd[_0xe3d2('0x147')]&&_0x3165cd[_0xe3d2('0x84')]==='reachable';});if(_0x2342e1[_0xe3d2('0x93')]>0x0&&_0x23d07f['length']>0x0){return Promise['resolve']()[_0xe3d2('0x99')](cmHopper[_0xe3d2('0x148')](_[_0xe3d2('0x149')](_0x2342e1,'id'),previewRecallmeReminderInterval,_[_0xe3d2('0x149')](_0x23d07f,'id')))['then'](function(_0x1cce86){for(var _0x5bb537=0x0;_0x5bb537<_0x1cce86[_0xe3d2('0x93')];_0x5bb537++){var _0x4619e6=_0x1cce86[_0x5bb537][_0xe3d2('0x14a')]['name'];if(_0x4619e6)io['to'](util[_0xe3d2('0x44')](_0xe3d2('0x14b'),_0x4619e6))[_0xe3d2('0x41')]('user:dialPreviewRecallReminder',{'hopper':_0x1cce86[_0x5bb537]});}})[_0xe3d2('0x9b')](function(_0x5c590f){logger['error'](_0xe3d2('0x14c'),_0x5c590f);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xe3d2('0x3e')]=function(){var _0x4ce218=this;setInterval(function(){_0x4ce218[_0xe3d2('0x14d')](_0x4ce218['uniqueId'],'[uniqueid]');_0x4ce218[_0xe3d2('0x14d')](_0x4ce218[_0xe3d2('0x25')],'[actions]');},0x32c8);};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x14d')]=function(_0x688f2,_0x4d7329){var _0xf7362b=this;for(var _0x2399bd in _0x688f2){if(typeof _0x688f2[_0x2399bd]!=='undefined'){this[_0xe3d2('0x1e')][_0xe3d2('0x1b')](function(){if(!_['isNil'](_0x688f2[_0x2399bd])){return ami[_0xe3d2('0x95')]({'action':_0xe3d2('0x84'),'channel':_0x688f2[_0x2399bd][_0xe3d2('0xf3')]})['catch'](function(_0x25605b){if(_0x25605b[_0xe3d2('0x65')]===_0xe3d2('0x14e')){setTimeout(function(){if(_0x688f2[_0x2399bd]&&_0x688f2[_0x2399bd][_0xe3d2('0xbc')]!==_0xe3d2('0xbf')){_0xf7362b['updateOriginated'](_0xf7362b[_0xe3d2('0x20')][_0x688f2[_0x2399bd][_0xe3d2('0xbe')]]);logger[_0xe3d2('0x63')](_0xe3d2('0x14f'),_0x4d7329,_0x2399bd,_0x688f2[_0x2399bd]['queue']);delete _0x688f2[_0x2399bd];}if(_0x688f2[_0x2399bd]&&_0x688f2[_0x2399bd][_0xe3d2('0xbc')]===_0xe3d2('0xbf')){_0xf7362b[_0xe3d2('0xbd')](_0xf7362b[_0xe3d2('0x21')][_0x688f2[_0x2399bd][_0xe3d2('0xbe')]]);logger[_0xe3d2('0x63')]('[Dialer][checkChannel][ivr]',_0x4d7329,_0x2399bd,_0x688f2[_0x2399bd]['queue']);delete _0x688f2[_0x2399bd];}},0x2328);}});}});}}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x150')]=function(_0x5a9ce4){return Promise['resolve']()[_0xe3d2('0x99')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5a9ce4))[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x151')));};Dialer[_0xe3d2('0x1a')]['updateOriginated']=function(_0x2cc582){if(!_[_0xe3d2('0x40')](_0x2cc582)&&_0x2cc582!==null){if(typeof _0x2cc582[_0xe3d2('0x152')]!==_0xe3d2('0xa3')){if(_0x2cc582['originated']>0x0){_0x2cc582[_0xe3d2('0x152')]-=0x1;}else{logger['error'](_0xe3d2('0x153'));}}}else{logger[_0xe3d2('0x63')](_0xe3d2('0x154'));}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x155')]=function(_0x55536a,_0x81833e){var _0x26b5c8=this;return function(_0x4d716a){_0x26b5c8['updateOriginated'](_0x81833e);logger[_0xe3d2('0x63')](_0x55536a,util['inspect'](_0x4d716a,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xe3d2('0x156')]=function(_0x35baea,_0x3f85ff,_0x4b5864){var _0x42e7de={'state':0x19,'statedesc':_0xe3d2('0x157')};this[_0xe3d2('0xbd')](_0x3f85ff);this[_0xe3d2('0x11c')](_[_0xe3d2('0xfc')](_0x42e7de,_[_0xe3d2('0x71')](_0x4b5864,[_0xe3d2('0xe2'),_0xe3d2('0xe3'),_0xe3d2('0x158'),_0xe3d2('0xe4'),'CampaignId'])),_0xe3d2('0x159'),_0xe3d2('0x15a'));logger['error'](_0x35baea);};Dialer['prototype']['saveInDb']=function(_0x56fae2,_0x54712b,_0x206934){hopperUtils['createHistory'](_0x56fae2)[_0xe3d2('0x9b')](loggerCatch(_0x54712b));hopperUtils[_0xe3d2('0xc9')](_0x56fae2)[_0xe3d2('0x9b')](loggerCatch(_0x206934));};Dialer['prototype'][_0xe3d2('0xde')]=function(_0x2b8788,_0x3a410e){hopperUtils[_0xe3d2('0xc7')](_0x2b8788)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0xc8')));if(_0x3a410e==0x0){hopperUtils[_0xe3d2('0xc9')](_0x2b8788)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x15b')));}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x14c')]=function(_0x1e0569){return Promise[_0xe3d2('0xa4')]()[_0xe3d2('0x99')](cmHopper['handlePreviewRecallNotifications'](_0x1e0569['id'],previewRecallmeReminderInterval))[_0xe3d2('0x99')](function(_0x15b1a0){for(var _0x5bbc2a=0x0;_0x5bbc2a<_0x15b1a0[_0xe3d2('0x93')];_0x5bbc2a++){var _0x5122af=_0x15b1a0[_0x5bbc2a][_0xe3d2('0x14a')][_0xe3d2('0x46')];if(_0x5122af)io['to'](util['format'](_0xe3d2('0x14b'),_0x5122af))[_0xe3d2('0x41')](_0xe3d2('0x15c'),{'hopper':_0x15b1a0[_0x5bbc2a]});}})[_0xe3d2('0x9b')](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x5e8c9d){var _0x14556b=this;return function(){_0x14556b['handleIvr'](_0x5e8c9d);};};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x15d')]=function(_0x2a73c8,_0x4ee7a8){var _0x382a55=this;var _0x4352e0=uuid['v4']();this[_0xe3d2('0x25')][_0x4352e0]=new Action(_0x2a73c8,_0x4ee7a8,_0x4352e0);return new Promise(function(_0x137f71,_0x41c2d7){if(_['isUndefined'](_0x2a73c8)&&typeof _0x2a73c8!==_0xe3d2('0x15e')){return _0x41c2d7(msgResponse(_0xe3d2('0x15f'),_0xe3d2('0x8d'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x4ee7a8['phone'])||_0x4ee7a8[_0xe3d2('0x160')]===null){return _0x41c2d7(msgResponse(_0xe3d2('0x15f'),_0xe3d2('0x8d'),_0xe3d2('0x161')));}var _0x3c41a4={'XMD-CALLERID':_0x382a55['actions'][_0x4352e0]['getCaller'](),'XMD-AGI':_0x2a73c8[_0xe3d2('0x135')]?util[_0xe3d2('0x44')](_0xe3d2('0x162'),ipAgi,_0x2a73c8[_0xe3d2('0x135')]):'NONE','XMD-AGIAFTER':_0x2a73c8[_0xe3d2('0xc4')]?util[_0xe3d2('0x44')](_0xe3d2('0x162'),ipAgi,_0x2a73c8['dialQueueProject2']):_0xe3d2('0x163'),'XMD-QUEUE':utils['isOutboundQueue'](_0x2a73c8)?util[_0xe3d2('0x44')](_0xe3d2('0x164'),_0x2a73c8['name'],_0x2a73c8[_0xe3d2('0x165')]||'',_0x2a73c8[_0xe3d2('0xc5')]?'c':'',_0x2a73c8[_0xe3d2('0xce')]||0x3):'NONE','XMD-CONTACTID':_0x4ee7a8[_0xe3d2('0xe2')],'XMD-CDRTYPE':_0xe3d2('0xa'),'CALLERID(all)':_0x382a55['actions'][_0x4352e0][_0xe3d2('0x166')](),'XMD-AMD':_0x2a73c8[_0xe3d2('0x11e')]?_0xe3d2('0x141'):_0xe3d2('0x163'),'XMD-DESTINATION':_0xe3d2('0x113')};if(_0x2a73c8['dialAMDActive']){_0x3c41a4[_0xe3d2('0x167')]=_0x2a73c8[_0xe3d2('0x168')]||0x9c4;_0x3c41a4['XMD-AMDGREETING']=_0x2a73c8['dialAMDGreeting']||0x5dc;_0x3c41a4['XMD-AMDAFTERGREETINGSILENCE']=_0x2a73c8[_0xe3d2('0x169')]||0x320;_0x3c41a4['XMD-AMDTOTALANALYSISTIME']=_0x2a73c8[_0xe3d2('0x16a')]||0x1388;_0x3c41a4['XMD-AMDMINWORDLENGTH']=_0x2a73c8[_0xe3d2('0x16b')]||0x64;_0x3c41a4[_0xe3d2('0x16c')]=_0x2a73c8['dialAMDBetweenWordsSilence']||0x32;_0x3c41a4[_0xe3d2('0x16d')]=_0x2a73c8[_0xe3d2('0x16e')]||0x3;_0x3c41a4[_0xe3d2('0x16f')]=_0x2a73c8[_0xe3d2('0x170')]||0x100;_0x3c41a4[_0xe3d2('0x171')]=_0x2a73c8[_0xe3d2('0x172')]||0x1388;}if(utils[_0xe3d2('0x173')](_0x2a73c8)){_0x3c41a4[_0xe3d2('0x174')]=_0x4ee7a8[_0xe3d2('0xe4')];}else{_0x3c41a4['XMD-CAMPAIGNID']=_0x4ee7a8[_0xe3d2('0xef')];}for(var _0x2f79ad in _0x4ee7a8[_0xe3d2('0x175')]){if(typeof _0x4ee7a8[_0xe3d2('0x175')][_0x2f79ad]!==_0xe3d2('0xa3')){if(isNotNull(_0x4ee7a8[_0xe3d2('0x175')][_0x2f79ad])&&_0x2f79ad!=='id'&&_0x2f79ad!==_0xe3d2('0x176')&&_0x2f79ad!==_0xe3d2('0x177')&&_0x2f79ad!==_0xe3d2('0x178')){_0x3c41a4[util[_0xe3d2('0x44')](_0xe3d2('0x179'),_0xe3d2('0x17a'),_[_0xe3d2('0x17b')](_0x2f79ad))]=_0x4ee7a8[_0xe3d2('0x175')][_0x2f79ad];}}}var _0x2e36e1=_0x382a55[_0xe3d2('0x81')](_0x2a73c8[_0xe3d2('0x88')])?utils['getCallerId'](_0x2a73c8[_0xe3d2('0x88')][_0xe3d2('0x17c')],_0x2a73c8[_0xe3d2('0x17d')],_0x2a73c8[_0xe3d2('0x17e')]>0x0?utils[_0xe3d2('0x17f')](_0x2a73c8[_0xe3d2('0x180')],_0x2a73c8[_0xe3d2('0x17e')]):_0x2a73c8[_0xe3d2('0x180')]):utils['getCallerId'](_[_0xe3d2('0xf8')](_0x2a73c8[_0xe3d2('0x89')])?_0x2a73c8[_0xe3d2('0x88')][_0xe3d2('0x17c')]:_0x2a73c8[_0xe3d2('0x89')][_0xe3d2('0x17c')],_0x2a73c8[_0xe3d2('0x17d')],_0x2a73c8[_0xe3d2('0x17e')]>0x0?utils[_0xe3d2('0x17f')](_0x2a73c8[_0xe3d2('0x180')],_0x2a73c8[_0xe3d2('0x17e')]):_0x2a73c8[_0xe3d2('0x180')]);if(_0x2e36e1){_0x3c41a4[_0xe3d2('0x181')]=_0x382a55[_0xe3d2('0x25')][_0x4352e0][_0xe3d2('0x182')]=utils[_0xe3d2('0x183')](_0x2e36e1);_0x3c41a4[_0xe3d2('0x184')]=_0x4ee7a8[_0xe3d2('0x160')];}_0x2a73c8[_0xe3d2('0x185')]=_0x3c41a4;return ami[_0xe3d2('0x95')]({'actionid':_0x4352e0,'action':_0xe3d2('0x15f'),'channel':_0x382a55['isTrunkReachable'](_0x2a73c8['Trunk'])?util['format']('SIP/%s/%s%s',_0x2a73c8[_0xe3d2('0x88')][_0xe3d2('0x46')],isNotNull(_0x2a73c8[_0xe3d2('0x186')])?_0x2a73c8[_0xe3d2('0x186')][_0xe3d2('0x187')]()||'':'',_0x2a73c8[_0xe3d2('0x188')]>0x0?_0x4ee7a8['phone'][_0xe3d2('0x189')](_0x2a73c8[_0xe3d2('0x188')]):_0x4ee7a8[_0xe3d2('0x160')]):util['format'](_0xe3d2('0x18a'),_['isNil'](_0x2a73c8['TrunkBackup'])?_0x2a73c8[_0xe3d2('0x88')][_0xe3d2('0x46')]:_0x2a73c8['TrunkBackup']['name'],isNotNull(_0x2a73c8[_0xe3d2('0x186')])?_0x2a73c8[_0xe3d2('0x186')][_0xe3d2('0x187')]()||'':'',_0x2a73c8[_0xe3d2('0x188')]>0x0?_0x4ee7a8[_0xe3d2('0x160')][_0xe3d2('0x189')](_0x2a73c8[_0xe3d2('0x188')]):_0x4ee7a8[_0xe3d2('0x160')]),'callerid':_0x2e36e1,'Exten':_0xe3d2('0x113'),'Context':_0xe3d2('0x18b'),'Priority':'1','variable':_0x3c41a4,'timeout':(_0x2a73c8[_0xe3d2('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4352e0})[_0xe3d2('0x99')](function(_0x394782){return _0x137f71(_0x394782);})[_0xe3d2('0x9b')](function(_0x719e9c){_0x2a73c8[_0xe3d2('0x18d')]+=0x1;var _0x28a663=new History(_0x382a55['actions'][_0x4352e0]);logger[_0xe3d2('0x63')](util['format'](_0xe3d2('0x18e'),JSON[_0xe3d2('0x70')](_0x719e9c)));_0x28a663['state']=0xe;_0x28a663[_0xe3d2('0xd2')]=_0xe3d2('0x18f');_0x28a663['starttime']=moment()[_0xe3d2('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x28a663[_0xe3d2('0x6d')]=_0x28a663[_0xe3d2('0x6e')];hopperUtils['createHistory'](_0x28a663)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x190')));_0x382a55['moveContactManagedDialer'](_0x28a663)[_0xe3d2('0x9b')](loggerCatch('[originate][error]'))[_0xe3d2('0x1d')](function(){delete _0x382a55[_0xe3d2('0x25')][_0x4352e0];return _0x41c2d7(msgResponse(_0xe3d2('0x15f'),_0xe3d2('0x80'),'originate\x20action\x20Error'));});});});};Dialer[_0xe3d2('0x1a')]['checkRetriveMax']=function(_0x5aeebb,_0x28435f,_0x1f105e){var _0x14b87b=new History(_0x28435f);if(_0x14b87b[_0xe3d2('0x12e')]+_0x14b87b[_0xe3d2('0x123')]+_0x14b87b[_0xe3d2('0x12f')]+_0x14b87b['countnosuchnumberretry']+_0x14b87b[_0xe3d2('0xd6')]+_0x14b87b['countabandonedretry']+_0x14b87b[_0xe3d2('0x120')]+_0x14b87b[_0xe3d2('0x124')]>=_0x1f105e[_0xe3d2('0x125')]-0x1){return!![];}switch(_0x5aeebb){case 0x3:if(_0x14b87b['countnoanswerretry']>=_0x1f105e[_0xe3d2('0x191')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x14b87b[_0xe3d2('0x12f')]+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0x192')],_0xe3d2('0xe1'))[_0xe3d2('0x44')](_0xe3d2('0xc6')),'ContactId':_0x14b87b[_0xe3d2('0xe2')],'ListId':_0x14b87b[_0xe3d2('0xe3')],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b['CampaignId']||undefined})[_0xe3d2('0x9b')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x14b87b[_0xe3d2('0x12e')]>=_0x1f105e[_0xe3d2('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x14b87b['countbusyretry']+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0x194')],'minutes')[_0xe3d2('0x44')](_0xe3d2('0xc6')),'ContactId':_0x14b87b['ContactId'],'ListId':_0x14b87b[_0xe3d2('0xe3')],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x14b87b[_0xe3d2('0x123')]>=_0x1f105e['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x14b87b[_0xe3d2('0x123')]+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0x195')],_0xe3d2('0xe1'))['format'](_0xe3d2('0xc6')),'ContactId':_0x14b87b['ContactId'],'ListId':_0x14b87b[_0xe3d2('0xe3')],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b[_0xe3d2('0xef')]||undefined})['catch'](loggerCatch(_0xe3d2('0x196')));break;case 0x0:if(_0x14b87b[_0xe3d2('0x130')]>=_0x1f105e[_0xe3d2('0x197')]-0x1){return!![];}else{hopperUtils[_0xe3d2('0xdf')]({'active':![],'countnosuchnumberretry':_0x14b87b[_0xe3d2('0x130')]+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0x198')],_0xe3d2('0xe1'))[_0xe3d2('0x44')](_0xe3d2('0xc6')),'ContactId':_0x14b87b[_0xe3d2('0xe2')],'ListId':_0x14b87b['ListId'],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x199')));}break;case 0xa:if(_0x14b87b[_0xe3d2('0xd6')]>=_0x1f105e['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xe3d2('0xdf')]({'active':![],'countdropretry':_0x14b87b[_0xe3d2('0xd6')]+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0xd8')],'minutes')['format'](_0xe3d2('0xc6')),'ContactId':_0x14b87b[_0xe3d2('0xe2')],'ListId':_0x14b87b['ListId'],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b['CampaignId']||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0xe5')));break;case 0xb:if(_0x14b87b[_0xe3d2('0xec')]>=_0x1f105e[_0xe3d2('0xee')]-0x1){return!![];}hopperUtils[_0xe3d2('0xdf')]({'active':![],'countabandonedretry':_0x14b87b[_0xe3d2('0xec')]+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e['dialAbandonedRetryFrequency'],_0xe3d2('0xe1'))[_0xe3d2('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14b87b[_0xe3d2('0xe2')],'ListId':_0x14b87b['ListId'],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x14b87b[_0xe3d2('0x120')]>=_0x1f105e[_0xe3d2('0x127')]-0x1){return!![];}hopperUtils[_0xe3d2('0xdf')]({'active':![],'countmachineretry':_0x14b87b[_0xe3d2('0x120')]+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0x129')],_0xe3d2('0xe1'))[_0xe3d2('0x44')](_0xe3d2('0xc6')),'ContactId':_0x14b87b[_0xe3d2('0xe2')],'ListId':_0x14b87b['ListId'],'VoiceQueueId':_0x14b87b['VoiceQueueId']||undefined,'CampaignId':_0x14b87b[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x12a')));break;case 0x14:if(_0x14b87b[_0xe3d2('0x124')]>=_0x1f105e[_0xe3d2('0x19a')]-0x1){return!![];}hopperUtils[_0xe3d2('0xdf')]({'active':![],'countagentrejectretry':_0x14b87b['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xe3d2('0xe0')](_0x1f105e[_0xe3d2('0x19b')],_0xe3d2('0xe1'))[_0xe3d2('0x44')](_0xe3d2('0xc6')),'ContactId':_0x14b87b[_0xe3d2('0xe2')],'ListId':_0x14b87b[_0xe3d2('0xe3')],'VoiceQueueId':_0x14b87b[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x14b87b[_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x19c')));break;default:return!![];}};Dialer[_0xe3d2('0x1a')]['callProgressDetecting']=function(_0x242d0c,_0x19a4c9,_0xd3cf2c){var _0x505a09=this;var _0x4d74d1=new History(_0x242d0c);var _0x560666=![];var _0x27adf0;var _0x4957f5;return new Promise(function(_0x1c76cf,_0x24adb1){if(_[_0xe3d2('0x40')](_0x19a4c9)&&typeof _0x19a4c9!=='object'){return _0x24adb1(msgResponse('[callProgressDetecting]',_0xe3d2('0x8d'),_0xe3d2('0x19d')));}if(_[_0xe3d2('0x40')](_0xd3cf2c)&&typeof _0xd3cf2c!==_0xe3d2('0x15e')){return _0x24adb1(msgResponse('[callProgressDetecting]','Failure','evt\x20is\x20undefine'));}hopperUtils[_0xe3d2('0xda')](_0x4d74d1,_0xd3cf2c[_0xe3d2('0xc1')],_0x19a4c9)['then'](function(_0x41085e){if(_0x41085e[_0xe3d2('0xdc')]==0x1)_0x560666=!![];switch(_0xd3cf2c['reason']){case'0':_0x19a4c9[_0xe3d2('0x19e')]+=0x1;_0x4d74d1[_0xe3d2('0x6c')]=0x0;_0x4d74d1['statedesc']='NoSuchNumber';_0x4d74d1[_0xe3d2('0x130')]+=0x1;_0x4d74d1[_0xe3d2('0xd7')]+=0x1;ami[_0xe3d2('0x41')]('custom:agentnosuchnumber',ut[_0xe3d2('0x11a')](_0x242d0c,'nosuchnumber'));_0x27adf0=_0x19a4c9['dialNoSuchNumberRetryFrequency'];_0x4957f5=_0x19a4c9[_0xe3d2('0xd9')];hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x122')));if(_0x505a09[_0xe3d2('0x19f')](0x0,_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1[_0xe3d2('0x130')]>=_0x19a4c9[_0xe3d2('0x197')]){_0x505a09[_0xe3d2('0x128')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1a0'));}else{_0x505a09[_0xe3d2('0x126')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1a0'));}}break;case'3':_0x19a4c9[_0xe3d2('0x1a1')]+=0x1;_0x4d74d1[_0xe3d2('0x6c')]=0x3;_0x4d74d1[_0xe3d2('0xd2')]='NoAnswer';_0x4d74d1[_0xe3d2('0x12f')]+=0x1;_0x4d74d1[_0xe3d2('0xd7')]+=0x1;var _0x163a99=ut['buildNoAnswerEventPayload'](_0x242d0c,_0x19a4c9);ami[_0xe3d2('0x41')](_0xe3d2('0x1a2'),_0x163a99);_0x27adf0=_0x19a4c9[_0xe3d2('0x192')];_0x4957f5=_0x19a4c9['callAdditionalPhoneAfterMin'];hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x1a3')));if(_0x505a09[_0xe3d2('0x19f')](0x3,_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1['countnoanswerretry']>=_0x19a4c9[_0xe3d2('0x191')]){_0x505a09[_0xe3d2('0x128')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1a4'));}else{_0x505a09[_0xe3d2('0x126')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1a4'));}}break;case'5':_0x19a4c9['outboundBusyCallsDay']+=0x1;_0x4d74d1[_0xe3d2('0x6c')]=0x5;_0x4d74d1[_0xe3d2('0xd2')]=_0xe3d2('0x1a5');_0x4d74d1[_0xe3d2('0x12e')]+=0x1;_0x4d74d1[_0xe3d2('0xd7')]+=0x1;ami[_0xe3d2('0x41')](_0xe3d2('0x1a6'),ut[_0xe3d2('0x11a')](_0x242d0c,_0xe3d2('0x1a7')));_0x27adf0=_0x19a4c9[_0xe3d2('0x194')];_0x4957f5=_0x19a4c9[_0xe3d2('0xd9')];hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x505a09['checkRetriveMax'](0x5,_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1[_0xe3d2('0x12e')]>=_0x19a4c9['dialBusyMaxRetry']){_0x505a09[_0xe3d2('0x128')](_0x4d74d1,_0x1c76cf,_0x24adb1,'reason\x205\x20busy');}else{_0x505a09[_0xe3d2('0x126')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1a8'));}}break;case'8':_0x19a4c9[_0xe3d2('0x1a9')]+=0x1;_0x4d74d1[_0xe3d2('0x6c')]=0x8;_0x4d74d1[_0xe3d2('0xd2')]=_0xe3d2('0x1aa');_0x4d74d1['countcongestionretry']+=0x1;_0x4d74d1[_0xe3d2('0xd7')]+=0x1;_0x27adf0=_0x19a4c9[_0xe3d2('0x195')];_0x4957f5=_0x19a4c9[_0xe3d2('0xd9')];ami[_0xe3d2('0x41')](_0xe3d2('0x1ab'),ut[_0xe3d2('0x11a')](_0x242d0c,'congestion'));hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)['catch'](loggerCatch(_0xe3d2('0x1ac')));if(_0x505a09[_0xe3d2('0x19f')](0x8,_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1[_0xe3d2('0x123')]>=_0x19a4c9['dialCongestionMaxRetry']){_0x505a09[_0xe3d2('0x128')](_0x4d74d1,_0x1c76cf,_0x24adb1,'reason\x208\x20congestion');}else{_0x505a09[_0xe3d2('0x126')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1ad'));}}break;case'11':_0x19a4c9[_0xe3d2('0x1ae')]+=0x1;_0x4d74d1[_0xe3d2('0x6c')]=0xb;_0x4d74d1[_0xe3d2('0xd2')]=_0xe3d2('0xea');_0x4d74d1['countabandonedretry']+=0x1;_0x4d74d1[_0xe3d2('0xd7')]+=0x1;_0x27adf0=_0x19a4c9['dialAbandonedRetryFrequency'];_0x4957f5=_0x19a4c9[_0xe3d2('0xd9')];hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0xf2')));if(_0x505a09[_0xe3d2('0x19f')](0xb,_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1[_0xe3d2('0xec')]>=_0x19a4c9[_0xe3d2('0xee')]){_0x505a09[_0xe3d2('0x128')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1af'));}else{_0x505a09[_0xe3d2('0x126')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1af'));}}break;case'20':_0x19a4c9[_0xe3d2('0x1b0')]+=0x1;_0x4d74d1['state']=0x14;_0x4d74d1[_0xe3d2('0xd2')]=_0xe3d2('0x1b1');_0x4d74d1['countagentrejectretry']+=0x1;_0x4d74d1[_0xe3d2('0xd7')]+=0x1;_0x27adf0=_0x19a4c9[_0xe3d2('0x19b')];_0x4957f5=_0x19a4c9[_0xe3d2('0xd9')];ami[_0xe3d2('0x41')](_0xe3d2('0x1b2'),ut['buildObj'](_0x242d0c,_0xe3d2('0x1b3')));hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)[_0xe3d2('0x9b')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x505a09['checkRetriveMax'](0x14,_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1[_0xe3d2('0x124')]>=_0x19a4c9[_0xe3d2('0x19a')]){_0x505a09[_0xe3d2('0x128')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1b4'));}else{_0x505a09[_0xe3d2('0x126')](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xe3d2('0x1b4'));}}break;default:_0x19a4c9[_0xe3d2('0x137')]+=0x1;_0x4d74d1[_0xe3d2('0x6c')]=0xc;_0x4d74d1[_0xe3d2('0xd2')]=_0xd3cf2c[_0xe3d2('0xc1')];_0x27adf0=_0x19a4c9['dialAgentRejectRetryFrequency'];_0x4957f5=_0x19a4c9['callAdditionalPhoneAfterMin'];hopperUtils[_0xe3d2('0xc7')](_0x4d74d1)[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x1b5')));if(_0x505a09[_0xe3d2('0x19f')](_0xd3cf2c['reason'],_0x242d0c,_0x19a4c9)&&!_0x560666){if(_0x4d74d1['countbusyretry']+_0x4d74d1[_0xe3d2('0x123')]+_0x4d74d1[_0xe3d2('0x12f')]+_0x4d74d1[_0xe3d2('0x130')]+_0x4d74d1[_0xe3d2('0xd6')]+_0x4d74d1['countabandonedretry']+_0x4d74d1['countmachineretry']+_0x4d74d1['countagentrejectretry']>=_0x19a4c9['dialGlobalMaxRetry']){_0x505a09['stateGlobal'](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xd3cf2c[_0xe3d2('0xc1')]);}else{_0x505a09['createStateFinal'](_0x4d74d1,_0x1c76cf,_0x24adb1,_0xd3cf2c[_0xe3d2('0xc1')]);}}}})[_0xe3d2('0x99')](function(){if(_0x560666){hopperUtils[_0xe3d2('0xe8')](_0x4d74d1,_0x27adf0,_0x4957f5)[_0xe3d2('0x99')](function(){return _0x1c76cf(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0xaaaece,_0x3cf02b,_0x4106a0,_0x11a452){var _0x58475a=new Final(_0xaaaece);_0x58475a[_0xe3d2('0x6c')]=0xf;_0x58475a[_0xe3d2('0xd2')]='Global';this[_0xe3d2('0x128')](_0x58475a,_0x3cf02b,_0x4106a0,_0x11a452);};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x128')]=function(_0x454baa,_0x451bfc,_0x3fa8a3,_0x336712){hopperUtils['moveContactManagedDialer'](_0x454baa)['then'](function(){return _0x451bfc(msgResponse(_0xe3d2('0x1b6'),_0xe3d2('0x10e'),_0x336712));})[_0xe3d2('0x9b')](function(){return _0x3fa8a3(msgResponse(_0xe3d2('0x1b7'),_0xe3d2('0x8d'),'contact\x20not\x20moved'));});};Dialer[_0xe3d2('0x1a')][_0xe3d2('0xc')]=function(_0x3f3b51){var _0x30f006=_0x3f3b51['dialPredictiveOptimizationPercentage']/0x64;var _0x2652ad=_0x3f3b51[_0xe3d2('0xd0')]/(_0x3f3b51[_0xe3d2('0xd0')]+_0x3f3b51[_0xe3d2('0xc0')]);var _0x25bbbe=Math[_0xe3d2('0x1b8')](_0x3f3b51[_0xe3d2('0x1b9')]*(_0x3f3b51['predictiveIntervalMaxThreshold']/0x64));var _0x34f8ed=Math[_0xe3d2('0x1b8')](_0x3f3b51[_0xe3d2('0x1b9')]*(_0x3f3b51['predictiveIntervalMinThreshold']/0x64));var _0x2766ef=_0x3f3b51[_0xe3d2('0x13e')]+_0x3f3b51['talking'];var _0x6ec9f5=Math[_0xe3d2('0x1ba')](_0x3f3b51[_0xe3d2('0x58')]*_0x3f3b51['erlangAbandonmentRate']*_0x3f3b51[_0xe3d2('0x1bb')]*_0x3f3b51['predictiveIntervalMultiplicativeFactor']);if(_[_0xe3d2('0x40')](_0x3f3b51[_0xe3d2('0x5f')])){if(!_[_0xe3d2('0x40')](_0x3f3b51['startPredictive'])){_0x3f3b51['startPredictive']=undefined;loggerPredictive[_0xe3d2('0x63')](_0xe3d2('0x1bc'),_0xe3d2('0x1bd'));}if(!_[_0xe3d2('0x40')](_0x3f3b51[_0xe3d2('0x62')])){loggerPredictive[_0xe3d2('0x63')](_0xe3d2('0x1bc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3f3b51[_0xe3d2('0x62')]);_0x3f3b51[_0xe3d2('0x62')]=undefined;}_0x3f3b51[_0xe3d2('0x5f')]=moment()[_0xe3d2('0x44')](_0xe3d2('0xc6'));loggerPredictive['info'](_0x3f3b51['name'],_0xe3d2('0x1be'),_0x3f3b51[_0xe3d2('0x5f')]);this[_0xe3d2('0xad')](_0x3f3b51,0x1);}else if(ifInterval(_0x3f3b51[_0xe3d2('0x1bf')],_0x3f3b51[_0xe3d2('0x5f')])){this[_0xe3d2('0xad')](_0x3f3b51,0x1);loggerPredictiveCalls[_0xe3d2('0x49')](_0xe3d2('0x1c0'),_0x3f3b51['startProgressive'],_0x3f3b51[_0xe3d2('0x46')]);_0x3f3b51['erlangCalls']=0x0;_0x3f3b51['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x30f006<_0x2652ad&&_0x3f3b51[_0xe3d2('0x1c1')]==='dropRate'){clearPredictiveAttributes(_0x3f3b51);loggerPredictive[_0xe3d2('0x49')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xe3d2('0x1c2'),_0x2652ad,_0xe3d2('0x5f'),_0x3f3b51[_0xe3d2('0x46')]);}else if(_0x6ec9f5<_0x3f3b51['predictiveIntervalErlangCallsDroppedCalls']&&_0x3f3b51[_0xe3d2('0x1c1')]===_0xe3d2('0x1c3')){clearPredictiveAttributes(_0x3f3b51);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x1c4'),_0xe3d2('0x1c5'),_0x6ec9f5,'Drop\x20in\x20this\x20interval',_0x3f3b51[_0xe3d2('0xd1')],'startProgressive',_0x3f3b51[_0xe3d2('0x46')]);}else if(!ifInterval(_0x3f3b51['dialPredictiveInterval'],_0x3f3b51[_0xe3d2('0x5f')])&&_['isUndefined'](_0x3f3b51[_0xe3d2('0x29')])&&!_[_0xe3d2('0x40')](_0x3f3b51[_0xe3d2('0x5f')])){_0x3f3b51[_0xe3d2('0x29')]=moment()[_0xe3d2('0x44')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3f3b51[_0xe3d2('0x46')],_0xe3d2('0x1c6'),_0x3f3b51[_0xe3d2('0x29')]);hopperUtils[_0xe3d2('0x1c7')](_0x3f3b51[_0xe3d2('0x1bf')])[_0xe3d2('0x99')](this['getDataPredictive'](_0x3f3b51))[_0xe3d2('0x99')](mergeDataErlangB(_0x3f3b51))[_0xe3d2('0x99')](this[_0xe3d2('0x1c8')](_0x3f3b51))[_0xe3d2('0x9b')](loggerCatchPredictive(_0xe3d2('0x1c9'),_0x3f3b51));}else if(!ifInterval(_0x3f3b51[_0xe3d2('0x1bf')],_0x3f3b51['startPredictive'])){_0x3f3b51[_0xe3d2('0xd1')]=0x0;_0x3f3b51['startPredictive']=moment()[_0xe3d2('0x44')](_0xe3d2('0xc6'));loggerPredictive[_0xe3d2('0x49')](_0x3f3b51[_0xe3d2('0x46')],'recalculate\x20predictive\x20at',_0x3f3b51[_0xe3d2('0x29')]);clearInterval(_0x3f3b51[_0xe3d2('0x62')]);_0x3f3b51['handlePredictive']=undefined;hopperUtils[_0xe3d2('0x1c7')](_0x3f3b51[_0xe3d2('0x1bf')])[_0xe3d2('0x99')](this[_0xe3d2('0x1ca')](_0x3f3b51))[_0xe3d2('0x99')](mergeDataErlangB(_0x3f3b51))['then'](this[_0xe3d2('0x1c8')](_0x3f3b51))[_0xe3d2('0x9b')](loggerCatchPredictive(_0xe3d2('0x1cb'),_0x3f3b51));}else if(_0x3f3b51[_0xe3d2('0x1b9')]&&_0x2766ef<_0x3f3b51['predictiveIntervalAvailable']-_0x34f8ed){clearPredictiveAttributes(_0x3f3b51);loggerPredictive['info'](_0x3f3b51[_0xe3d2('0x46')],_0xe3d2('0x1cc'),_0x2766ef,_0xe3d2('0x1cd'),_0x3f3b51['predictiveIntervalAvailable'],'-',_0x34f8ed,'=',_0x3f3b51['predictiveIntervalAvailable']-_0x34f8ed,')');}else if(_0x3f3b51[_0xe3d2('0x1b9')]&&_0x2766ef>_0x3f3b51[_0xe3d2('0x1b9')]+_0x25bbbe){clearPredictiveAttributes(_0x3f3b51);loggerPredictive[_0xe3d2('0x49')](_0x3f3b51[_0xe3d2('0x46')],_0xe3d2('0x1cc'),_0x2766ef,_0xe3d2('0x1ce'),_0x3f3b51[_0xe3d2('0x1b9')],'+',_0x25bbbe,'=',_0x3f3b51[_0xe3d2('0x1b9')]+_0x25bbbe,')');}};Dialer[_0xe3d2('0x1a')]['getDataPredictive']=function(_0x45ccdb){var _0x15d067=this;return function(_0x533355){return new Promise(function(_0x59c852,_0x26887a){_[_0xe3d2('0xfc')](_0x45ccdb,_0x533355[0x0]);if(checkGetDataPredictive(_0x533355[0x0])){var _0x532627=_0x45ccdb[_0xe3d2('0x1b9')]=_0x45ccdb['talking']+_0x45ccdb[_0xe3d2('0x13e')];var _0x2a8c60=_0x45ccdb[_0xe3d2('0x1bf')]*0x3c;var _0x2e98df=_0x533355[0x0]['predictiveIntervalAvgTalktime']+_0x533355[0x0][_0xe3d2('0x50')];var _0x4b8d9e=(_0x533355[0x0][_0xe3d2('0x4d')]+_0x533355[0x0][_0xe3d2('0xcf')]+_0x533355[0x0][_0xe3d2('0x4f')])/_0x533355[0x0][_0xe3d2('0x4b')];_0x45ccdb[_0xe3d2('0x1bb')]=_0x4b8d9e>0x0?_0x4b8d9e:0x1;switch(_0x45ccdb[_0xe3d2('0x1c1')]){case _0xe3d2('0x1c3'):var _0xab6cc6=_0x45ccdb[_0xe3d2('0x1cf')]/0x64;return _0x15d067[_0xe3d2('0x1d0')](_0x532627,_0x2a8c60,_0x2e98df,_0x4b8d9e,_0xab6cc6)[_0xe3d2('0x99')](function(_0x6116ed){return _0x59c852(_0x6116ed);});case _0xe3d2('0x1d1'):var _0x27b79c=_0x45ccdb[_0xe3d2('0x1cf')]/0x64;return _0x15d067[_0xe3d2('0x1d2')](_0x532627,_0x2a8c60,_0x2e98df,_0x4b8d9e,_0x27b79c)[_0xe3d2('0x99')](function(_0x28cdfe){return _0x59c852(_0x28cdfe);});default:return _0x26887a(msgResponse('[getDataPredictive]',_0xe3d2('0x8d'),_0xe3d2('0x1d3')));}}else{return _0x26887a(msgResponse(_0xe3d2('0x1d4'),_0xe3d2('0x8d'),'check\x20failure'));}});};};Dialer['prototype'][_0xe3d2('0x1d5')]=function(_0x558bf5){var _0x2f0aa2=this;return function(_0x5acd70){return new Promise(function(_0x1d5cbc,_0x2695da){_[_0xe3d2('0xfc')](_0x558bf5,_0x5acd70[0x0]);if(checkGetDataPredictive(_0x5acd70[0x0])){loggerPredictive['info'](JSON['stringify'](_0x5acd70[0x0]));if(_0x558bf5[_0xe3d2('0x1c1')]===_0xe3d2('0x1c3')){return _0x2f0aa2[_0xe3d2('0x150')](_0x558bf5['id'])[_0xe3d2('0x99')](function(_0x4f75dd){var _0x38cfea=_0x558bf5[_0xe3d2('0x1d6')]-_0x4f75dd[0x0][_0xe3d2('0x1d7')];var _0x1ff7a9=_0x558bf5[_0xe3d2('0x1bf')]*0x3c;var _0xc90a08=_0x5acd70[0x0]['predictiveIntervalAvgTalktime']+_0x5acd70[0x0][_0xe3d2('0x50')];var _0x5b150a=(_0x5acd70[0x0][_0xe3d2('0x4d')]+_0x5acd70[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5acd70[0x0][_0xe3d2('0x4f')])/_0x5acd70[0x0][_0xe3d2('0x4b')];var _0x59e5d9=_0x558bf5[_0xe3d2('0x1cf')]/0x64;_0x558bf5[_0xe3d2('0x1d8')]=_0x4f75dd[0x0][_0xe3d2('0x1d7')]||0x0;_0x558bf5[_0xe3d2('0x1bb')]=_0x5b150a>0x0?_0x5b150a:0x1;return _0x2f0aa2[_0xe3d2('0x1d0')](_0x38cfea,_0x1ff7a9,_0xc90a08,_0x5b150a,_0x59e5d9);})['then'](function(_0x366092){return _0x1d5cbc(_0x366092);})[_0xe3d2('0x9b')](function(_0x98511){return _0x2695da(msgResponse(_0xe3d2('0x1d9'),_0xe3d2('0x8d'),JSON[_0xe3d2('0x70')](_0x98511)));});}if(_0x558bf5['dialPredictiveOptimization']===_0xe3d2('0x1d1')){return _0x2f0aa2['getVoiceQueueRtPauses'](_0x558bf5['id'])[_0xe3d2('0x99')](function(_0x5bfb5b){var _0x2ef1e6=_0x558bf5[_0xe3d2('0x1d6')]-_0x5bfb5b[0x0][_0xe3d2('0x1d7')];var _0x1850b6=_0x558bf5[_0xe3d2('0x1bf')]*0x3c;var _0x368680=_0x5acd70[0x0][_0xe3d2('0x53')]+_0x5acd70[0x0]['predictiveIntervalAvgHoldtime'];var _0x29e257=(_0x5acd70[0x0][_0xe3d2('0x4d')]+_0x5acd70[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5acd70[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5acd70[0x0]['predictiveIntervalTotalCalls'];var _0x2e39f7=_0x558bf5['dialPredictiveOptimizationPercentage']/0x64;_0x558bf5[_0xe3d2('0x1d8')]=_0x5bfb5b[0x0]['outboundQueuePauses']||0x0;_0x558bf5[_0xe3d2('0x1bb')]=_0x29e257>0x0?_0x29e257:0x1;return _0x2f0aa2[_0xe3d2('0x1d2')](_0x2ef1e6,_0x1850b6,_0x368680,_0x29e257,_0x2e39f7);})['then'](function(_0x2ac6df){return _0x1d5cbc(_0x2ac6df);})['catch'](function(_0x5174e4){return _0x2695da(msgResponse('[CatchErlangB]',_0xe3d2('0x8d'),JSON[_0xe3d2('0x70')](_0x5174e4)));});}}else{return _0x2695da(msgResponse(_0xe3d2('0x1d4'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0xe3d2('0x1c8')]=function(_0x37b216){var _0x2efe85=this;return function(){var _0x376ea1=0x0;var _0x24c783=Math[_0xe3d2('0x1ba')](_0x37b216[_0xe3d2('0x5a')]*0x3e8);if(_0x24c783>0x0){_0x24c783=_0x24c783<0x64?0x64:_0x24c783;loggerPredictive[_0xe3d2('0x49')](_0x37b216[_0xe3d2('0x46')],_0xe3d2('0x1da'),_0x24c783,'milliseconds');_0x37b216[_0xe3d2('0x62')]=setInterval(function(){_0x2efe85[_0xe3d2('0x62')](_0x37b216);loggerPredictiveCalls['info'](_0xe3d2('0x1db'),_0x376ea1+=0x1);},_0x24c783);}else{loggerPredictive[_0xe3d2('0x49')](_0x37b216[_0xe3d2('0x46')],_0xe3d2('0x1dc'));}};};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x1dd')]=function(_0x29d5cf,_0x589448){var _0x548a4e=this;return function(_0x15058a){if(_[_0xe3d2('0x48')](_0x15058a)){if(_[_0xe3d2('0xf8')](_0x589448[_0xe3d2('0x158')])||!_0x589448['recallme']){if(_0x29d5cf[_0xe3d2('0xab')]===_0xe3d2('0xb')){_0x29d5cf[_0xe3d2('0x6f')]=_[_0xe3d2('0x40')](_0x29d5cf['queueStatusComplete'])?!![]:_0x29d5cf[_0xe3d2('0x6f')];var _0x92243c=uuid['v4']();_0x548a4e[_0xe3d2('0x25')][_0x92243c]=new Action(_0x29d5cf,_0x589448,_0x92243c);loggerBooked[_0xe3d2('0x49')](_0xe3d2('0x1de'),_0x92243c,_0xe3d2('0x1df'),JSON[_0xe3d2('0x70')](_0x29d5cf[_0xe3d2('0x6f')]),_0xe3d2('0x1e0'),_0x29d5cf[_0xe3d2('0x46')]);if(_0x29d5cf['queueStatusComplete']){_0x29d5cf[_0xe3d2('0x6f')]=![];_0x548a4e[_0xe3d2('0x2a')][_0x548a4e['actions'][_0x92243c]['queue']]=[];ami[_0xe3d2('0x95')]({'actionid':_0x92243c,'action':_0xe3d2('0x1e1'),'queue':_0x29d5cf[_0xe3d2('0x46')]})['catch'](function(){_0x548a4e['updateOriginated'](_0x29d5cf);hopperUtils[_0xe3d2('0xdf')]({'active':![],'ContactId':_0x548a4e[_0xe3d2('0x25')][_0x92243c]['ContactId'],'ListId':_0x548a4e[_0xe3d2('0x25')][_0x92243c][_0xe3d2('0xe3')],'VoiceQueueId':_0x548a4e[_0xe3d2('0x25')][_0x92243c][_0xe3d2('0xe4')]||undefined,'CampaignId':_0x548a4e[_0xe3d2('0x25')][_0x92243c][_0xe3d2('0xef')]||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x1e2')));delete _0x548a4e[_0xe3d2('0x25')][_0x92243c];});}else{loggerBooked[_0xe3d2('0x49')](_0xe3d2('0x1e3'),JSON[_0xe3d2('0x70')](_0x29d5cf['queueStatusComplete']),_0xe3d2('0x1e0'),_0x29d5cf[_0xe3d2('0x46')]);_0x548a4e[_0xe3d2('0xbd')](_0x29d5cf);hopperUtils[_0xe3d2('0xdf')]({'active':![],'ContactId':_0x548a4e[_0xe3d2('0x25')][_0x92243c][_0xe3d2('0xe2')],'ListId':_0x548a4e[_0xe3d2('0x25')][_0x92243c][_0xe3d2('0xe3')],'VoiceQueueId':_0x548a4e['actions'][_0x92243c]['VoiceQueueId']||undefined,'CampaignId':_0x548a4e[_0xe3d2('0x25')][_0x92243c]['CampaignId']||undefined})[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x1e2')));delete _0x548a4e[_0xe3d2('0x25')][_0x92243c];}}else{return _0x548a4e[_0xe3d2('0x15d')](_0x29d5cf,_0x589448);}}else{if(utils['getSeconds'](undefined,_0x589448['scheduledat'])<_0x29d5cf[_0xe3d2('0x1e4')]*0x3c){if(_0x589448[_0xe3d2('0x14a')]&&!_0x589448[_0xe3d2('0x14a')]['voicePause']){_0x548a4e[_0xe3d2('0x1f')][_0xe3d2('0xff')](_0x589448['id'])[_0xe3d2('0x1d')](function(){_0x548a4e['updateOriginated'](_0x29d5cf);});}else{hopperUtils[_0xe3d2('0x1e5')]({'active':![]},_0x589448['id'],0x1)[_0xe3d2('0x1d')](function(){_0x548a4e['updateOriginated'](_0x29d5cf);});}}else{_0x29d5cf[_0xe3d2('0x1e6')]+=0x1;_0x548a4e['updateOriginated'](_0x29d5cf);if(_0x29d5cf[_0xe3d2('0x1e7')]){hopperUtils[_0xe3d2('0xdf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x589448[_0xe3d2('0xe2')],'ListId':_0x589448[_0xe3d2('0xe3')],'VoiceQueueId':_0x589448[_0xe3d2('0xe4')]||undefined,'CampaignId':_0x589448[_0xe3d2('0xef')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xe3d2('0xc7')](createObjHistory(_0x29d5cf,_0x589448,utils[_0xe3d2('0x66')][_0xe3d2('0x1e8')],0x17,_0xe3d2('0x1e9')))['catch'](loggerCatch(_0xe3d2('0x1ea')));}else{_0x548a4e[_0xe3d2('0x11c')](createObjHistory(_0x29d5cf,_0x589448,utils[_0xe3d2('0x66')]['RECALL_TIMEOUT'],0x16,_0xe3d2('0x1eb')),_0xe3d2('0x1ec'),_0xe3d2('0x1ed'));}}}}else{_0x29d5cf[_0xe3d2('0x1ee')]+=0x1;_0x548a4e['saveInDb'](createObjHistory(_0x29d5cf,_0x589448,utils[_0xe3d2('0x66')][_0xe3d2('0x1ef')],0xd,'Blacklist'),_0xe3d2('0x1f0'),_0xe3d2('0x1f1'));throw'inBlackList';}};};Dialer[_0xe3d2('0x1a')]['handleIvr']=function(_0x41eefb){var _0x115e53=this;var _0x129f91=_0x41eefb[_0xe3d2('0x1f2')]-_0x41eefb[_0xe3d2('0x152')]-_0x41eefb['temp'];emitCampaignSummary(_0x41eefb);if(_0x129f91>0x0){if(_0x129f91>this[_0xe3d2('0x24')]){_0x129f91=this[_0xe3d2('0x24')];}_0x41eefb[_0xe3d2('0x1f3')]+=_0x129f91;hopperUtils[_0xe3d2('0x1f4')](_0x41eefb,_0x129f91)[_0xe3d2('0x99')](function(_0xcaa2ac){_0x41eefb[_0xe3d2('0x1f3')]-=_0x129f91;_0x41eefb[_0xe3d2('0x1f3')]=_0x41eefb[_0xe3d2('0x1f3')]>0x0?_0x41eefb[_0xe3d2('0x1f3')]:0x0;if(!utils[_0xe3d2('0x1f5')](_0xcaa2ac)){_0x41eefb['message']=utils[_0xe3d2('0x66')][_0xe3d2('0x6a')];logger[_0xe3d2('0x49')](_0xe3d2('0x1f6')+_0x41eefb[_0xe3d2('0x46')]);}else{_0x41eefb['originated']+=_0xcaa2ac['length'];_0x41eefb[_0xe3d2('0x65')]=utils[_0xe3d2('0x66')][_0xe3d2('0x1f7')];for(var _0xf8a88=0x0;_0xf8a88<_0xcaa2ac[_0xe3d2('0x93')];_0xf8a88+=0x1){_0x41eefb[_0xe3d2('0x1f8')]+=0x1;if(_[_0xe3d2('0xf8')](_0xcaa2ac[_0xf8a88])||_[_0xe3d2('0xf8')](_0xcaa2ac[_0xf8a88][_0xe3d2('0x175')])||_['isNil'](_0xcaa2ac[_0xf8a88][_0xe3d2('0x160')])){_0x115e53[_0xe3d2('0x156')]('[actionOriginate]\x20',_0x41eefb,_0xcaa2ac[_0xf8a88]);}else{hopperUtils[_0xe3d2('0x1f9')](_['pick'](_0xcaa2ac[_0xf8a88],[_0xe3d2('0xef'),_0xe3d2('0x160')]))['then'](_0x115e53[_0xe3d2('0x1dd')](_0x41eefb,_0xcaa2ac[_0xf8a88]))[_0xe3d2('0x9b')](_0x115e53['loggerHandler'](_0xe3d2('0x1fa'),_0x41eefb));}}}})[_0xe3d2('0x9b')](loggerGetContactDialer('[getContactCampaign2]',_0x41eefb,_0x129f91));}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0xad')]=function(_0x3b55d9,_0x99efd3){var _0x4f0a74=this;var _0x45f14d=[];if(_0x99efd3<0x1||_0x3b55d9[_0xe3d2('0xab')]===_0xe3d2('0xb')){_0x99efd3=0x1;}var _0x10d85e=Math[_0xe3d2('0x1ba')](_0x3b55d9[_0xe3d2('0x13e')]*_0x99efd3)-_0x3b55d9[_0xe3d2('0x152')]-_0x3b55d9['temp'];if(_0x3b55d9['dialLimitQueue']>0x0){var _0x1ffef4=_0x3b55d9[_0xe3d2('0x1fb')]-_0x3b55d9['originated']-_0x3b55d9['talking']-_0x3b55d9[_0xe3d2('0x1f3')]-_0x3b55d9[_0xe3d2('0x140')];if(_0x10d85e>_0x1ffef4){_0x10d85e=_0x1ffef4;}}if(_0x10d85e>0x0){if(_0x3b55d9[_0xe3d2('0xab')]==='booked'){_0x10d85e=0x1;}if(_0x10d85e>this[_0xe3d2('0x24')]){_0x10d85e=this[_0xe3d2('0x24')];}_0x3b55d9[_0xe3d2('0x1f3')]+=_0x10d85e;for(var _0x1052aa in this['agents']){if(typeof this[_0xe3d2('0x22')][_0x1052aa]!=='undefined'){if(this['agents'][_0x1052aa][_0xe3d2('0x6c')]===_0xe3d2('0x1fc')&&this['agents'][_0x1052aa][_0xe3d2('0x84')]===_0xe3d2('0x85')){_0x45f14d[_0xe3d2('0x94')](this[_0xe3d2('0x22')][_0x1052aa]['id']);}}}hopperUtils['getContactDialer'](_0x3b55d9,_0x45f14d,_0x10d85e)['then'](function(_0x25b644){_0x3b55d9[_0xe3d2('0x1f3')]-=_0x10d85e;_0x3b55d9[_0xe3d2('0x1f3')]=_0x3b55d9[_0xe3d2('0x1f3')]>0x0?_0x3b55d9['temp']:0x0;if(!utils[_0xe3d2('0x1f5')](_0x25b644)){hopperUtils[_0xe3d2('0x1fd')](_0x3b55d9)[_0xe3d2('0x99')](sendMessageReschedule(_0x3b55d9))[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x1fe')));}else{_0x3b55d9[_0xe3d2('0x152')]+=_0x25b644['length'];_0x3b55d9[_0xe3d2('0x65')]=_0x3b55d9['dialMethod']===_0xe3d2('0xb')?utils[_0xe3d2('0x66')][_0xe3d2('0x141')]:utils[_0xe3d2('0x66')][_0xe3d2('0x1f7')];for(var _0x13583e=0x0;_0x13583e<_0x25b644['length'];_0x13583e+=0x1){if(_[_0xe3d2('0xf8')](_0x25b644[_0x13583e])||_[_0xe3d2('0xf8')](_0x25b644[_0x13583e][_0xe3d2('0x175')])||_[_0xe3d2('0xf8')](_0x25b644[_0x13583e][_0xe3d2('0x160')])){_0x4f0a74[_0xe3d2('0x156')](_0xe3d2('0x1ff'),_0x3b55d9,_0x25b644[_0x13583e]);}else{hopperUtils[_0xe3d2('0x200')](_['pick'](_0x25b644[_0x13583e],['VoiceQueueId','phone']))[_0xe3d2('0x99')](_0x4f0a74[_0xe3d2('0x1dd')](_0x3b55d9,_0x25b644[_0x13583e]))[_0xe3d2('0x9b')](_0x4f0a74[_0xe3d2('0x155')](_0xe3d2('0x1ff'),_0x3b55d9));}}}})[_0xe3d2('0x9b')](loggerGetContactDialer(_0xe3d2('0x201'),_0x3b55d9,_0x10d85e));}};Dialer[_0xe3d2('0x1a')]['handlePredictive']=function(_0x4d68ef){if(_0x4d68ef['dialLimitQueue']>0x0){var _0x202ce5=_0x4d68ef['dialLimitQueue']-_0x4d68ef[_0xe3d2('0x152')]-_0x4d68ef[_0xe3d2('0x13f')];if(_0x202ce5>0x0){this['tryOriginatePredictive'](_0x4d68ef);}else{loggerPredictiveCalls[_0xe3d2('0x49')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x4d68ef);}};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x202')]=function(_0x3b1241){var _0xff75d=this;var _0x465419=[];_0x3b1241[_0xe3d2('0x152')]+=0x1;for(var _0x50f41e in this[_0xe3d2('0x22')]){if(typeof this[_0xe3d2('0x22')][_0x50f41e]!=='undefined'){if(this[_0xe3d2('0x22')][_0x50f41e][_0xe3d2('0x6c')]===_0xe3d2('0x1fc')&&this[_0xe3d2('0x22')][_0x50f41e][_0xe3d2('0x84')]==='reachable'){_0x465419[_0xe3d2('0x94')](this['agents'][_0x50f41e]['id']);}}}return this[_0xe3d2('0x203')](_0x3b1241['id'],_0x465419,0x1,_0x3b1241[_0xe3d2('0x204')],_0x3b1241)[_0xe3d2('0x99')](function(_0x2a628f){if(!utils[_0xe3d2('0x1f5')](_0x2a628f)){utils['checkContactLowerLimitOriginate'](_0x3b1241,0x1,0x0);return hopperUtils[_0xe3d2('0x1fd')](_0x3b1241)[_0xe3d2('0x99')](sendMessageReschedule(_0x3b1241))[_0xe3d2('0x9b')](loggerCatch(_0xe3d2('0x1fe')));}else{_0x3b1241[_0xe3d2('0x65')]=utils['CAMPAIGN_STATUS'][_0xe3d2('0x1f7')];if(_[_0xe3d2('0xf8')](_0x2a628f[0x0])||_[_0xe3d2('0xf8')](_0x2a628f[0x0][_0xe3d2('0x175')])||_[_0xe3d2('0xf8')](_0x2a628f[0x0][_0xe3d2('0x160')])){_0xff75d[_0xe3d2('0x156')](_0xe3d2('0x1ff'),_0x3b1241,_0x2a628f[0x0]);}else{return hopperUtils[_0xe3d2('0x200')](_['pick'](_0x2a628f[0x0],[_0xe3d2('0xe4'),_0xe3d2('0x160')]))['then'](_0xff75d[_0xe3d2('0x1dd')](_0x3b1241,_0x2a628f[0x0]))[_0xe3d2('0x9b')](_0xff75d[_0xe3d2('0x155')](_0xe3d2('0x205'),_0x3b1241));}}})[_0xe3d2('0x9b')](loggerGetContactDialer(_0xe3d2('0x206'),_0x3b1241,0x1));};Dialer[_0xe3d2('0x1a')][_0xe3d2('0x1d0')]=function(_0x1a532f,_0x476329,_0x14d95a,_0x20744e,_0x469302,_0x2d0e67){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x207'),_0x1a532f);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x208'),_0x476329);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x209'),_0x14d95a);loggerPredictive['info'](_0xe3d2('0x20a'),_0x20744e);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x20b'),_0x469302);loggerPredictive[_0xe3d2('0x49')]('---------------------------');return new Promise(function(_0x3ca287,_0x289b8b){if(_0x1a532f<=0x0||isNaN(_0x1a532f)){return _0x289b8b(msgResponse(_0xe3d2('0x20c'),_0xe3d2('0x80'),_0xe3d2('0x20d')+_0x1a532f));}if(_0x14d95a<=0x0||isNaN(_0x14d95a)){return _0x289b8b(msgResponse('[abandonmentRate]',_0xe3d2('0x80'),'Ts\x20=\x20'+_0x14d95a));}if(_0x20744e<=0x0||isNaN(_0x20744e)){return _0x289b8b(msgResponse(_0xe3d2('0x20c'),'Error',_0xe3d2('0x20e')+_0x20744e));}if(_0x476329<=0x0||isNaN(_0x476329)){return _0x289b8b(msgResponse(_0xe3d2('0x20c'),'Error','interval\x20=\x20'+_0x476329));}if(_0x469302<=0x0||isNaN(_0x469302)){return _0x289b8b(msgResponse(_0xe3d2('0x20c'),'Error',_0xe3d2('0x20f')+_0x469302));}_0x2d0e67=_0x2d0e67||0x0;var _0x32a7b2=0x1/_0x14d95a;var _0x5ecd73=0x0;var _0x17cb53=0x0;var _0x16f1c0=0x0;var _0xd0bd14=0x0;for(var _0x40ce97=0x0;_0x16f1c0<_0x469302;_0x40ce97+=0x1){_0x17cb53=_0x40ce97/_0x476329;_0x5ecd73=(_0x20744e*_0x17cb53+_0x2d0e67)/_0x32a7b2;_0x16f1c0=utils[_0xe3d2('0x210')](_0x5ecd73,_0x1a532f);_0xd0bd14=_0x5ecd73/_0x1a532f*(0x1-utils['erlangb'](_0x5ecd73,_0x1a532f));}return _0x3ca287({'erlangCalls':_0x40ce97,'erlangCallToSecond':_0x476329/_0x40ce97,'erlangAbandonmentRate':_0x16f1c0,'erlangBusyFactor':_0xd0bd14});});};Dialer['prototype'][_0xe3d2('0x1d2')]=function(_0x1f87a4,_0x447391,_0x42e10a,_0x58b2a1,_0x587283,_0x30d1cc){loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x211'));loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x207'),_0x1f87a4);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x208'),_0x447391);loggerPredictive['info'](_0xe3d2('0x209'),_0x42e10a);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x20a'),_0x58b2a1);loggerPredictive[_0xe3d2('0x49')](_0xe3d2('0x212'),_0x587283);loggerPredictive['info'](_0xe3d2('0x52'));return new Promise(function(_0x205efd,_0x58313b){if(_0x1f87a4<=0x0||isNaN(_0x1f87a4)){return _0x58313b(msgResponse(_0xe3d2('0x213'),_0xe3d2('0x80'),_0xe3d2('0x20d')+_0x1f87a4));}if(_0x42e10a<=0x0||isNaN(_0x42e10a)){return _0x58313b(msgResponse(_0xe3d2('0x213'),_0xe3d2('0x80'),'Ts\x20=\x20'+_0x42e10a));}if(_0x58b2a1<=0x0||isNaN(_0x58b2a1)){return _0x58313b(msgResponse(_0xe3d2('0x213'),_0xe3d2('0x80'),_0xe3d2('0x20e')+_0x58b2a1));}if(_0x447391<=0x0||isNaN(_0x447391)){return _0x58313b(msgResponse('[busyFactor]',_0xe3d2('0x80'),_0xe3d2('0x214')+_0x447391));}if(_0x587283<=0x0||isNaN(_0x587283)){return _0x58313b(msgResponse(_0xe3d2('0x213'),'Error',_0xe3d2('0x215')+_0x587283));}_0x30d1cc=_0x30d1cc||0x0;var _0x11a2f6=0x1/_0x42e10a;var _0x3f9b28=0x0;var _0x5538da=0x0;var _0x1aa477=0x0;var _0xe75aa3=0x0;for(var _0x46d6eb=0x0;_0xe75aa3<_0x587283;_0x46d6eb+=0x1){_0x5538da=_0x46d6eb/_0x447391;_0x3f9b28=(_0x58b2a1*_0x5538da+_0x30d1cc)/_0x11a2f6;_0x1aa477=utils[_0xe3d2('0x210')](_0x3f9b28,_0x1f87a4);_0xe75aa3=_0x3f9b28/_0x1f87a4*(0x1-utils[_0xe3d2('0x210')](_0x3f9b28,_0x1f87a4));}return _0x205efd({'erlangCalls':_0x46d6eb,'erlangCallToSecond':_0x447391/_0x46d6eb,'erlangAbandonmentRate':_0x1aa477,'erlangBusyFactor':_0xe75aa3});});};module[_0xe3d2('0x216')]=Dialer;
\ No newline at end of file
index cb25494..03307b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7fa=['exports','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xe7fa,0xf7));var _0xae7f=function(_0x200836,_0x2be114){_0x200836=_0x200836-0x0;var _0x151242=_0xe7fa[_0x200836];return _0x151242;};'use strict';var util=require('util');var _=require(_0xae7f('0x0'));var moment=require('moment');function checkNameSurname(_0x1130f2,_0x416b48,_0x1a23d5){var _0x2259b9='';if(!_[_0xae7f('0x1')](_0x416b48)&&_0xae7f('0x2')===typeof _0x416b48){_0x2259b9+=_0x416b48;}if(!_['isNil'](_0x1a23d5)&&_0xae7f('0x2')===typeof _0x1a23d5){_0x2259b9+='\x20'+_0x1a23d5;}if(_0x2259b9!==''){return _0x2259b9;}return _0x1130f2;}function Action(_0x26d31c,_0x38e9fe,_0x187b16){this[_0xae7f('0x3')]=_0x26d31c;this[_0xae7f('0x4')]=_0x187b16||undefined;this[_0xae7f('0x5')]=checkNameSurname(_0x38e9fe[_0xae7f('0x6')][_0xae7f('0x7')],_0x38e9fe[_0xae7f('0x6')][_0xae7f('0x8')],_0x38e9fe[_0xae7f('0x6')][_0xae7f('0x9')]);this[_0xae7f('0xa')]=_0x38e9fe[_0xae7f('0x7')];this[_0xae7f('0xb')]=_0x26d31c[_0xae7f('0x5')];this['active']=_0x38e9fe[_0xae7f('0xc')]||![];this[_0xae7f('0xd')]=_0x26d31c[_0xae7f('0xd')];this[_0xae7f('0xe')]=_0x26d31c[_0xae7f('0xe')]||0x3;this['scheduledat']=_0x38e9fe['scheduledat'];this[_0xae7f('0xf')]=_0x38e9fe[_0xae7f('0xf')];this['countcongestionretry']=_0x38e9fe[_0xae7f('0x10')];this[_0xae7f('0x11')]=_0x38e9fe['countnoanswerretry'];this[_0xae7f('0x12')]=_0x38e9fe[_0xae7f('0x12')];this[_0xae7f('0x13')]=_0x38e9fe[_0xae7f('0x13')];this[_0xae7f('0x14')]=_0x38e9fe[_0xae7f('0x14')];this[_0xae7f('0x15')]=_0x38e9fe['countmachineretry'];this[_0xae7f('0x16')]=_0x38e9fe[_0xae7f('0x16')];this[_0xae7f('0x17')]=_0x38e9fe[_0xae7f('0x17')];this['ListId']=_0x38e9fe[_0xae7f('0x18')];this[_0xae7f('0x19')]=_0x38e9fe['UserId'];this[_0xae7f('0x1a')]=_0x38e9fe[_0xae7f('0x1a')];this[_0xae7f('0x1b')]=_0x38e9fe['CampaignId'];this['idHopper']=_0x38e9fe['id'];this['ContactFirstName']=_0x38e9fe[_0xae7f('0x6')][_0xae7f('0x8')]||'';this['starttime']=moment()[_0xae7f('0x1c')](_0xae7f('0x1d'));this[_0xae7f('0x1e')]=_0x38e9fe[_0xae7f('0x1e')];this[_0xae7f('0x1f')]=_0x38e9fe[_0xae7f('0x1f')];this[_0xae7f('0x20')]=_0x38e9fe[_0xae7f('0x20')];this['recallme']=_0x38e9fe['recallme'];this[_0xae7f('0x21')]='';this[_0xae7f('0x22')]='';}Action[_0xae7f('0x23')][_0xae7f('0x24')]=function(){return util[_0xae7f('0x1c')](_0xae7f('0x25'),this['name'],this[_0xae7f('0x3')][_0xae7f('0x26')]>0x0?this['number'][_0xae7f('0x27')](this['voiceQueue']['dialCutDigit']):this[_0xae7f('0xa')]);};Action[_0xae7f('0x23')]['getQueue']=function(){return this[_0xae7f('0xb')];};module[_0xae7f('0x28')]=Action;
\ No newline at end of file
+var _0xd81f=['getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','voiceQueue','getQueue','queue','exports','util','lodash','moment','isNil','string','phone','Contact','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype'];(function(_0x40dcf8,_0x5aa0b0){var _0x476ff7=function(_0x5d8f2b){while(--_0x5d8f2b){_0x40dcf8['push'](_0x40dcf8['shift']());}};_0x476ff7(++_0x5aa0b0);}(_0xd81f,0x161));var _0xfd81=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xd81f[_0x9cfe28];return _0x54a1d0;};'use strict';var util=require(_0xfd81('0x0'));var _=require(_0xfd81('0x1'));var moment=require(_0xfd81('0x2'));function checkNameSurname(_0x3866e3,_0x488bfa,_0x4fe74b){var _0xdbcea8='';if(!_[_0xfd81('0x3')](_0x488bfa)&&_0xfd81('0x4')===typeof _0x488bfa){_0xdbcea8+=_0x488bfa;}if(!_[_0xfd81('0x3')](_0x4fe74b)&&_0xfd81('0x4')===typeof _0x4fe74b){_0xdbcea8+='\x20'+_0x4fe74b;}if(_0xdbcea8!==''){return _0xdbcea8;}return _0x3866e3;}function Action(_0x1d02c0,_0x4e90a2,_0x4b77c8){this['voiceQueue']=_0x1d02c0;this['uniqueid']=_0x4b77c8||undefined;this['name']=checkNameSurname(_0x4e90a2['Contact'][_0xfd81('0x5')],_0x4e90a2[_0xfd81('0x6')]['firstName'],_0x4e90a2[_0xfd81('0x6')][_0xfd81('0x7')]);this['number']=_0x4e90a2[_0xfd81('0x5')];this['queue']=_0x1d02c0['name'];this[_0xfd81('0x8')]=_0x4e90a2[_0xfd81('0x8')]||![];this[_0xfd81('0x9')]=_0x1d02c0[_0xfd81('0x9')];this[_0xfd81('0xa')]=_0x1d02c0['dialQueueTimeout']||0x3;this[_0xfd81('0xb')]=_0x4e90a2[_0xfd81('0xb')];this[_0xfd81('0xc')]=_0x4e90a2[_0xfd81('0xc')];this[_0xfd81('0xd')]=_0x4e90a2[_0xfd81('0xd')];this['countnoanswerretry']=_0x4e90a2[_0xfd81('0xe')];this[_0xfd81('0xf')]=_0x4e90a2['countnosuchnumberretry'];this[_0xfd81('0x10')]=_0x4e90a2[_0xfd81('0x10')];this[_0xfd81('0x11')]=_0x4e90a2[_0xfd81('0x11')];this['countmachineretry']=_0x4e90a2['countmachineretry'];this[_0xfd81('0x12')]=_0x4e90a2['countagentrejectretry'];this[_0xfd81('0x13')]=_0x4e90a2[_0xfd81('0x13')];this['ListId']=_0x4e90a2[_0xfd81('0x14')];this[_0xfd81('0x15')]=_0x4e90a2[_0xfd81('0x15')];this[_0xfd81('0x16')]=_0x4e90a2[_0xfd81('0x16')];this[_0xfd81('0x17')]=_0x4e90a2[_0xfd81('0x17')];this[_0xfd81('0x18')]=_0x4e90a2['id'];this[_0xfd81('0x19')]=_0x4e90a2[_0xfd81('0x6')]['firstName']||'';this['starttime']=moment()[_0xfd81('0x1a')](_0xfd81('0x1b'));this[_0xfd81('0x1c')]=_0x4e90a2[_0xfd81('0x1c')];this[_0xfd81('0x1d')]=_0x4e90a2[_0xfd81('0x1d')];this[_0xfd81('0x1e')]=_0x4e90a2[_0xfd81('0x1e')];this['recallme']=_0x4e90a2[_0xfd81('0x1f')];this['originatecalleridnum']='';this[_0xfd81('0x20')]='';}Action[_0xfd81('0x21')][_0xfd81('0x22')]=function(){return util['format'](_0xfd81('0x23'),this['name'],this['voiceQueue'][_0xfd81('0x24')]>0x0?this[_0xfd81('0x25')][_0xfd81('0x26')](this[_0xfd81('0x27')][_0xfd81('0x24')]):this['number']);};Action[_0xfd81('0x21')][_0xfd81('0x28')]=function(){return this[_0xfd81('0x29')];};module[_0xfd81('0x2a')]=Action;
\ No newline at end of file
index 1eb02eb..e43aacc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe08f=['name','calleridnum','number','starttime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','responsetime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname'];(function(_0x5b0ac7,_0x22fd0e){var _0x3c1c4b=function(_0x541bd9){while(--_0x541bd9){_0x5b0ac7['push'](_0x5b0ac7['shift']());}};_0x3c1c4b(++_0x22fd0e);}(_0xe08f,0x129));var _0xfe08=function(_0x2e030f,_0x1f7b78){_0x2e030f=_0x2e030f-0x0;var _0x1ac4a8=_0xe08f[_0x2e030f];return _0x1ac4a8;};'use strict';var moment=require(_0xfe08('0x0'));var utils=require(_0xfe08('0x1'));function AgentComplete(_0x54f1ba,_0x1aab4b){this[_0xfe08('0x2')]=0x4;this[_0xfe08('0x3')]='Answer';this[_0xfe08('0x4')]=_0x54f1ba[_0xfe08('0x4')];this['type']=_0x54f1ba[_0xfe08('0x5')];this['campaigntype']=_0x54f1ba[_0xfe08('0x5')]===_0xfe08('0x6')?_0xfe08('0x7'):_0x54f1ba[_0xfe08('0x5')];this[_0xfe08('0x8')]=_0x54f1ba['countbusyretry'];this[_0xfe08('0x9')]=_0x54f1ba[_0xfe08('0x9')];this[_0xfe08('0xa')]=_0x54f1ba[_0xfe08('0xa')];this['countglobal']=_0x54f1ba[_0xfe08('0x8')]+_0x54f1ba[_0xfe08('0x9')]+_0x54f1ba[_0xfe08('0xa')]+_0x54f1ba['countnosuchnumberretry']+_0x54f1ba[_0xfe08('0xb')]+_0x54f1ba[_0xfe08('0xc')]+_0x54f1ba[_0xfe08('0xd')]+_0x54f1ba[_0xfe08('0xe')];this[_0xfe08('0xf')]=_0x54f1ba[_0xfe08('0xf')];this[_0xfe08('0xb')]=_0x54f1ba[_0xfe08('0xb')];this[_0xfe08('0xc')]=_0x54f1ba[_0xfe08('0xc')];this['countmachineretry']=_0x54f1ba[_0xfe08('0xd')];this[_0xfe08('0xe')]=_0x54f1ba[_0xfe08('0xe')];this[_0xfe08('0x10')]=_0x1aab4b[_0xfe08('0x10')];this[_0xfe08('0x11')]=_0x54f1ba[_0xfe08('0x12')];this[_0xfe08('0x13')]=_0x54f1ba[_0xfe08('0x14')];this[_0xfe08('0x15')]=_0x54f1ba[_0xfe08('0x15')];this['responsetime']=_0x54f1ba['responsetime'];this[_0xfe08('0x16')]=_0x54f1ba[_0xfe08('0x16')];this[_0xfe08('0x17')]=moment()['format'](_0xfe08('0x18'));this[_0xfe08('0x19')]=utils[_0xfe08('0x1a')](_0x54f1ba['responsetime'],_0x54f1ba['starttime']);this[_0xfe08('0x1b')]=utils[_0xfe08('0x1a')](_0x54f1ba[_0xfe08('0x16')],_0x54f1ba[_0xfe08('0x1c')]);this[_0xfe08('0x1d')]=utils[_0xfe08('0x1a')](this[_0xfe08('0x17')],_0x54f1ba[_0xfe08('0x16')]);this['queue']=_0x1aab4b[_0xfe08('0x7')];this[_0xfe08('0x1e')]=_0x1aab4b[_0xfe08('0x1e')];this['reason']=_0x1aab4b[_0xfe08('0x1f')];this[_0xfe08('0x20')]=_0x54f1ba[_0xfe08('0x20')];this[_0xfe08('0x21')]=_0x54f1ba[_0xfe08('0x21')];this[_0xfe08('0x22')]=_0x54f1ba[_0xfe08('0x22')];this[_0xfe08('0x23')]=_0x54f1ba[_0xfe08('0x23')];this[_0xfe08('0x24')]=_0x54f1ba[_0xfe08('0x24')];this[_0xfe08('0x25')]=_0x54f1ba[_0xfe08('0x25')];this[_0xfe08('0x26')]=_0x54f1ba['UserId'];this[_0xfe08('0x27')]=_0x54f1ba[_0xfe08('0x27')];this[_0xfe08('0x28')]=_0x54f1ba[_0xfe08('0x28')];this[_0xfe08('0x29')]=_0x54f1ba[_0xfe08('0x29')]||'';this[_0xfe08('0x2a')]=_0x54f1ba[_0xfe08('0x2a')]||'';this[_0xfe08('0x2b')]=_0x54f1ba[_0xfe08('0x2b')];}module[_0xfe08('0x2c')]=AgentComplete;
\ No newline at end of file
+var _0x0c5a=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x0c5a,0x101));var _0xa0c5=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0x0c5a[_0x1d5458];return _0x9bf6f;};'use strict';var moment=require(_0xa0c5('0x0'));var utils=require('../utils');function AgentComplete(_0x5d1b5d,_0x1e22da){this['state']=0x4;this[_0xa0c5('0x1')]=_0xa0c5('0x2');this[_0xa0c5('0x3')]=_0x5d1b5d['scheduledat'];this[_0xa0c5('0x4')]=_0x5d1b5d[_0xa0c5('0x4')];this[_0xa0c5('0x5')]=_0x5d1b5d['type']===_0xa0c5('0x6')?_0xa0c5('0x7'):_0x5d1b5d['type'];this[_0xa0c5('0x8')]=_0x5d1b5d['countbusyretry'];this['countcongestionretry']=_0x5d1b5d[_0xa0c5('0x9')];this[_0xa0c5('0xa')]=_0x5d1b5d[_0xa0c5('0xa')];this['countglobal']=_0x5d1b5d[_0xa0c5('0x8')]+_0x5d1b5d[_0xa0c5('0x9')]+_0x5d1b5d[_0xa0c5('0xa')]+_0x5d1b5d[_0xa0c5('0xb')]+_0x5d1b5d[_0xa0c5('0xc')]+_0x5d1b5d[_0xa0c5('0xd')]+_0x5d1b5d[_0xa0c5('0xe')]+_0x5d1b5d[_0xa0c5('0xf')];this[_0xa0c5('0xb')]=_0x5d1b5d['countnosuchnumberretry'];this['countdropretry']=_0x5d1b5d[_0xa0c5('0xc')];this[_0xa0c5('0xd')]=_0x5d1b5d[_0xa0c5('0xd')];this[_0xa0c5('0xe')]=_0x5d1b5d[_0xa0c5('0xe')];this[_0xa0c5('0xf')]=_0x5d1b5d[_0xa0c5('0xf')];this['uniqueid']=_0x1e22da[_0xa0c5('0x10')];this[_0xa0c5('0x11')]=_0x5d1b5d[_0xa0c5('0x12')];this[_0xa0c5('0x13')]=_0x5d1b5d[_0xa0c5('0x14')];this[_0xa0c5('0x15')]=_0x5d1b5d[_0xa0c5('0x15')];this[_0xa0c5('0x16')]=_0x5d1b5d['responsetime'];this[_0xa0c5('0x17')]=_0x5d1b5d[_0xa0c5('0x17')];this[_0xa0c5('0x18')]=moment()[_0xa0c5('0x19')](_0xa0c5('0x1a'));this[_0xa0c5('0x1b')]=utils[_0xa0c5('0x1c')](_0x5d1b5d['responsetime'],_0x5d1b5d['starttime']);this['holdtime']=utils[_0xa0c5('0x1c')](_0x5d1b5d['answertime'],_0x5d1b5d[_0xa0c5('0x16')]);this[_0xa0c5('0x1d')]=utils[_0xa0c5('0x1c')](this[_0xa0c5('0x18')],_0x5d1b5d[_0xa0c5('0x17')]);this['queue']=_0x1e22da[_0xa0c5('0x7')];this[_0xa0c5('0x1e')]=_0x1e22da[_0xa0c5('0x1e')];this['reason']=_0x1e22da[_0xa0c5('0x1f')];this[_0xa0c5('0x20')]=_0x5d1b5d[_0xa0c5('0x20')];this[_0xa0c5('0x21')]=_0x5d1b5d[_0xa0c5('0x21')];this[_0xa0c5('0x22')]=_0x5d1b5d[_0xa0c5('0x22')];this[_0xa0c5('0x23')]=_0x5d1b5d[_0xa0c5('0x23')];this['ContactId']=_0x5d1b5d[_0xa0c5('0x24')];this[_0xa0c5('0x25')]=_0x5d1b5d['ListId'];this['UserId']=_0x5d1b5d[_0xa0c5('0x26')];this[_0xa0c5('0x27')]=_0x5d1b5d[_0xa0c5('0x27')];this[_0xa0c5('0x28')]=_0x5d1b5d[_0xa0c5('0x28')];this[_0xa0c5('0x29')]=_0x5d1b5d['originatecalleridnum']||'';this[_0xa0c5('0x2a')]=_0x5d1b5d['originatecalleridname']||'';this['agiafterat']=_0x5d1b5d[_0xa0c5('0x2b')];}module[_0xa0c5('0x2c')]=AgentComplete;
\ No newline at end of file
index 63579df..4675f39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff0=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type'];(function(_0xd6df63,_0x4c0e41){var _0x250596=function(_0x47bd0c){while(--_0x47bd0c){_0xd6df63['push'](_0xd6df63['shift']());}};_0x250596(++_0x4c0e41);}(_0xcff0,0x1e7));var _0x0cff=function(_0x3174ab,_0x264be1){_0x3174ab=_0x3174ab-0x0;var _0xf40128=_0xcff0[_0x3174ab];return _0xf40128;};'use strict';function Final(_0x209d5a){this[_0x0cff('0x0')]=_0x209d5a[_0x0cff('0x0')];this['scheduledat']=_0x209d5a[_0x0cff('0x1')];this[_0x0cff('0x2')]=_0x209d5a['type'];this['campaigntype']=_0x209d5a[_0x0cff('0x2')]==='outbound'?_0x0cff('0x3'):_0x209d5a['type'];this['countbusyretry']=_0x209d5a[_0x0cff('0x4')];this[_0x0cff('0x5')]=_0x209d5a['countcongestionretry'];this[_0x0cff('0x6')]=_0x209d5a['countnoanswerretry'];this[_0x0cff('0x7')]=_0x209d5a[_0x0cff('0x4')]+_0x209d5a[_0x0cff('0x5')]+_0x209d5a[_0x0cff('0x6')]+_0x209d5a[_0x0cff('0x8')]+_0x209d5a[_0x0cff('0x9')]+_0x209d5a[_0x0cff('0xa')]+_0x209d5a[_0x0cff('0xb')]+_0x209d5a[_0x0cff('0xc')];this[_0x0cff('0x8')]=_0x209d5a['countnosuchnumberretry'];this[_0x0cff('0x9')]=_0x209d5a['countdropretry'];this[_0x0cff('0xa')]=_0x209d5a[_0x0cff('0xa')];this[_0x0cff('0xb')]=_0x209d5a['countmachineretry'];this[_0x0cff('0xc')]=_0x209d5a['countagentrejectretry'];this[_0x0cff('0x3')]=_0x209d5a[_0x0cff('0x3')];this[_0x0cff('0xd')]=_0x209d5a[_0x0cff('0xd')];this[_0x0cff('0xe')]=_0x209d5a[_0x0cff('0xe')];this[_0x0cff('0xf')]=_0x209d5a[_0x0cff('0xf')];this[_0x0cff('0x10')]=_0x209d5a[_0x0cff('0x10')];this[_0x0cff('0x11')]=_0x209d5a[_0x0cff('0x10')];this[_0x0cff('0x12')]=_0x209d5a['ringtime']||0x0;this['holdtime']=_0x209d5a[_0x0cff('0x13')]||0x0;this[_0x0cff('0x14')]=_0x209d5a[_0x0cff('0x14')]||0x0;this[_0x0cff('0x15')]=_0x209d5a[_0x0cff('0x15')];this[_0x0cff('0x16')]=_0x209d5a[_0x0cff('0x16')];this['callbackat']=_0x209d5a[_0x0cff('0x17')];this['recallme']=_0x209d5a[_0x0cff('0x18')];this[_0x0cff('0x19')]=_0x209d5a[_0x0cff('0x19')];this[_0x0cff('0x1a')]=_0x209d5a['ListId'];this[_0x0cff('0x1b')]=_0x209d5a[_0x0cff('0x1b')];this[_0x0cff('0x1c')]=_0x209d5a[_0x0cff('0x1c')];this[_0x0cff('0x1d')]=_0x209d5a[_0x0cff('0x1d')];this['originatecalleridnum']=_0x209d5a[_0x0cff('0x1e')]||'';this[_0x0cff('0x1f')]=_0x209d5a['originatecalleridname']||'';this[_0x0cff('0x20')]=_0x209d5a[_0x0cff('0x20')];this[_0x0cff('0x21')]=_0x209d5a['statedesc'];}module[_0x0cff('0x22')]=Final;
\ No newline at end of file
+var _0xceda=['countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x2770a0,_0x2465ec){var _0xe524c8=function(_0x5b9db8){while(--_0x5b9db8){_0x2770a0['push'](_0x2770a0['shift']());}};_0xe524c8(++_0x2465ec);}(_0xceda,0x86));var _0xaced=function(_0x426d83,_0x2da946){_0x426d83=_0x426d83-0x0;var _0x28825d=_0xceda[_0x426d83];return _0x28825d;};'use strict';function Final(_0x66cde5){this[_0xaced('0x0')]=_0x66cde5[_0xaced('0x0')];this[_0xaced('0x1')]=_0x66cde5[_0xaced('0x1')];this[_0xaced('0x2')]=_0x66cde5[_0xaced('0x2')];this[_0xaced('0x3')]=_0x66cde5['type']===_0xaced('0x4')?_0xaced('0x5'):_0x66cde5['type'];this[_0xaced('0x6')]=_0x66cde5[_0xaced('0x6')];this['countcongestionretry']=_0x66cde5[_0xaced('0x7')];this[_0xaced('0x8')]=_0x66cde5['countnoanswerretry'];this['countglobal']=_0x66cde5[_0xaced('0x6')]+_0x66cde5[_0xaced('0x7')]+_0x66cde5[_0xaced('0x8')]+_0x66cde5[_0xaced('0x9')]+_0x66cde5['countdropretry']+_0x66cde5['countabandonedretry']+_0x66cde5[_0xaced('0xa')]+_0x66cde5['countagentrejectretry'];this[_0xaced('0x9')]=_0x66cde5[_0xaced('0x9')];this[_0xaced('0xb')]=_0x66cde5['countdropretry'];this['countabandonedretry']=_0x66cde5[_0xaced('0xc')];this[_0xaced('0xa')]=_0x66cde5[_0xaced('0xa')];this[_0xaced('0xd')]=_0x66cde5['countagentrejectretry'];this[_0xaced('0x5')]=_0x66cde5[_0xaced('0x5')];this[_0xaced('0xe')]=_0x66cde5[_0xaced('0xe')];this[_0xaced('0xf')]=_0x66cde5[_0xaced('0xf')];this[_0xaced('0x10')]=_0x66cde5[_0xaced('0x10')];this['responsetime']=_0x66cde5['responsetime'];this[_0xaced('0x11')]=_0x66cde5[_0xaced('0x12')];this[_0xaced('0x13')]=_0x66cde5[_0xaced('0x13')]||0x0;this[_0xaced('0x14')]=_0x66cde5[_0xaced('0x14')]||0x0;this['talktime']=_0x66cde5[_0xaced('0x15')]||0x0;this[_0xaced('0x16')]=_0x66cde5[_0xaced('0x16')];this[_0xaced('0x17')]=_0x66cde5['callbackuniqueid'];this[_0xaced('0x18')]=_0x66cde5[_0xaced('0x18')];this[_0xaced('0x19')]=_0x66cde5['recallme'];this[_0xaced('0x1a')]=_0x66cde5[_0xaced('0x1a')];this[_0xaced('0x1b')]=_0x66cde5['ListId'];this[_0xaced('0x1c')]=_0x66cde5[_0xaced('0x1c')];this[_0xaced('0x1d')]=_0x66cde5[_0xaced('0x1d')];this[_0xaced('0x1e')]=_0x66cde5['CampaignId'];this[_0xaced('0x1f')]=_0x66cde5[_0xaced('0x1f')]||'';this['originatecalleridname']=_0x66cde5[_0xaced('0x20')]||'';this[_0xaced('0x21')]=_0x66cde5[_0xaced('0x21')];this[_0xaced('0x22')]=_0x66cde5[_0xaced('0x22')];}module[_0xaced('0x23')]=Final;
\ No newline at end of file
index 4af7b6e..11bd923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f4=['countdropretry','countmachineretry','countagentrejectretry','uniqueid','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','state','statedesc','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry'];(function(_0x18e621,_0x1e1838){var _0x799227=function(_0x41eb27){while(--_0x41eb27){_0x18e621['push'](_0x18e621['shift']());}};_0x799227(++_0x1e1838);}(_0x68f4,0x1de));var _0x468f=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x68f4[_0x111e94];return _0x3de107;};'use strict';var moment=require('moment');var utils=require('../utils');function Hangup(_0x44818b,_0x4f7a0e){this[_0x468f('0x0')]=0x4;this[_0x468f('0x1')]=_0x468f('0x2');this[_0x468f('0x3')]=_0x44818b['scheduledat'];this[_0x468f('0x4')]=_0x44818b[_0x468f('0x4')];this[_0x468f('0x5')]=_0x44818b[_0x468f('0x4')]==='outbound'?_0x468f('0x6'):_0x44818b[_0x468f('0x4')];this[_0x468f('0x7')]=_0x44818b[_0x468f('0x7')]||![];this[_0x468f('0x8')]=_0x44818b[_0x468f('0x8')];this['countcongestionretry']=_0x44818b[_0x468f('0x9')];this[_0x468f('0xa')]=_0x44818b['countnoanswerretry'];this[_0x468f('0xb')]=_0x44818b[_0x468f('0x8')]+_0x44818b[_0x468f('0x9')]+_0x44818b[_0x468f('0xa')]+_0x44818b[_0x468f('0xc')]+_0x44818b['countdropretry']+_0x44818b[_0x468f('0xd')]+_0x44818b['countmachineretry']+_0x44818b['countagentrejectretry'];this['countnosuchnumberretry']=_0x44818b[_0x468f('0xc')];this['countdropretry']=_0x44818b[_0x468f('0xe')];this[_0x468f('0xd')]=_0x44818b[_0x468f('0xd')];this[_0x468f('0xf')]=_0x44818b[_0x468f('0xf')];this['countagentrejectretry']=_0x44818b[_0x468f('0x10')];this[_0x468f('0x11')]=_0x4f7a0e[_0x468f('0x11')];this['calleridname']=_0x44818b['name'];this['calleridnum']=_0x44818b[_0x468f('0x12')];this[_0x468f('0x13')]=_0x44818b['starttime'];this[_0x468f('0x14')]=_0x44818b['responsetime'];this['endtime']=moment()[_0x468f('0x15')](_0x468f('0x16'));this[_0x468f('0x17')]=utils['getSeconds'](_0x44818b[_0x468f('0x14')],_0x44818b[_0x468f('0x13')]);this[_0x468f('0x18')]=0x0;this[_0x468f('0x19')]=utils[_0x468f('0x1a')](this[_0x468f('0x1b')],_0x44818b[_0x468f('0x14')]);this[_0x468f('0x6')]=_0x44818b[_0x468f('0x6')];this[_0x468f('0x1c')]=_0x468f('0x1d');this[_0x468f('0x1e')]=_0x4f7a0e[_0x468f('0x1f')];this[_0x468f('0x20')]=_0x44818b['callback'];this[_0x468f('0x21')]=_0x44818b['callbackuniqueid'];this[_0x468f('0x22')]=_0x44818b[_0x468f('0x22')];this['recallme']=_0x44818b[_0x468f('0x23')];this[_0x468f('0x24')]=_0x44818b[_0x468f('0x24')];this[_0x468f('0x25')]=_0x44818b['ListId'];this[_0x468f('0x26')]=_0x44818b[_0x468f('0x26')];this[_0x468f('0x27')]=_0x44818b[_0x468f('0x27')];this[_0x468f('0x28')]=_0x44818b[_0x468f('0x28')];}module['exports']=Hangup;
\ No newline at end of file
+var _0x8fdc=['type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat'];(function(_0x218ca6,_0x217c29){var _0x4ba2a6=function(_0x2d8e23){while(--_0x2d8e23){_0x218ca6['push'](_0x218ca6['shift']());}};_0x4ba2a6(++_0x217c29);}(_0x8fdc,0x16a));var _0xc8fd=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x8fdc[_0x1b5aea];return _0x51cae9;};'use strict';var moment=require(_0xc8fd('0x0'));var utils=require(_0xc8fd('0x1'));function Hangup(_0xbe31e3,_0x33bf3e){this[_0xc8fd('0x2')]=0x4;this[_0xc8fd('0x3')]=_0xc8fd('0x4');this['scheduledat']=_0xbe31e3[_0xc8fd('0x5')];this[_0xc8fd('0x6')]=_0xbe31e3[_0xc8fd('0x6')];this[_0xc8fd('0x7')]=_0xbe31e3['type']==='outbound'?_0xc8fd('0x8'):_0xbe31e3[_0xc8fd('0x6')];this[_0xc8fd('0x9')]=_0xbe31e3[_0xc8fd('0x9')]||![];this[_0xc8fd('0xa')]=_0xbe31e3[_0xc8fd('0xa')];this[_0xc8fd('0xb')]=_0xbe31e3[_0xc8fd('0xb')];this[_0xc8fd('0xc')]=_0xbe31e3[_0xc8fd('0xc')];this[_0xc8fd('0xd')]=_0xbe31e3[_0xc8fd('0xa')]+_0xbe31e3[_0xc8fd('0xb')]+_0xbe31e3[_0xc8fd('0xc')]+_0xbe31e3['countnosuchnumberretry']+_0xbe31e3[_0xc8fd('0xe')]+_0xbe31e3[_0xc8fd('0xf')]+_0xbe31e3[_0xc8fd('0x10')]+_0xbe31e3[_0xc8fd('0x11')];this[_0xc8fd('0x12')]=_0xbe31e3[_0xc8fd('0x12')];this[_0xc8fd('0xe')]=_0xbe31e3[_0xc8fd('0xe')];this[_0xc8fd('0xf')]=_0xbe31e3[_0xc8fd('0xf')];this['countmachineretry']=_0xbe31e3['countmachineretry'];this[_0xc8fd('0x11')]=_0xbe31e3[_0xc8fd('0x11')];this[_0xc8fd('0x13')]=_0x33bf3e['uniqueid'];this[_0xc8fd('0x14')]=_0xbe31e3[_0xc8fd('0x15')];this[_0xc8fd('0x16')]=_0xbe31e3[_0xc8fd('0x17')];this[_0xc8fd('0x18')]=_0xbe31e3[_0xc8fd('0x18')];this['responsetime']=_0xbe31e3[_0xc8fd('0x19')];this[_0xc8fd('0x1a')]=moment()['format'](_0xc8fd('0x1b'));this[_0xc8fd('0x1c')]=utils[_0xc8fd('0x1d')](_0xbe31e3[_0xc8fd('0x19')],_0xbe31e3[_0xc8fd('0x18')]);this[_0xc8fd('0x1e')]=0x0;this[_0xc8fd('0x1f')]=utils[_0xc8fd('0x1d')](this['endtime'],_0xbe31e3[_0xc8fd('0x19')]);this['queue']=_0xbe31e3[_0xc8fd('0x8')];this[_0xc8fd('0x20')]=_0xc8fd('0x21');this[_0xc8fd('0x22')]=_0x33bf3e[_0xc8fd('0x23')];this[_0xc8fd('0x24')]=_0xbe31e3['callback'];this[_0xc8fd('0x25')]=_0xbe31e3['callbackuniqueid'];this[_0xc8fd('0x26')]=_0xbe31e3[_0xc8fd('0x26')];this[_0xc8fd('0x27')]=_0xbe31e3['recallme'];this[_0xc8fd('0x28')]=_0xbe31e3[_0xc8fd('0x28')];this['ListId']=_0xbe31e3[_0xc8fd('0x29')];this[_0xc8fd('0x2a')]=_0xbe31e3[_0xc8fd('0x2a')];this[_0xc8fd('0x2b')]=_0xbe31e3['VoiceQueueId'];this['CampaignId']=_0xbe31e3[_0xc8fd('0x2c')];}module[_0xc8fd('0x2d')]=Hangup;
\ No newline at end of file
index e491f14..e3a6a01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ec=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x54233c,_0x30b6a8){var _0x42409d=function(_0x2cf62b){while(--_0x2cf62b){_0x54233c['push'](_0x54233c['shift']());}};_0x42409d(++_0x30b6a8);}(_0xc5ec,0x17e));var _0xcc5e=function(_0x1f4c0f,_0x27e10e){_0x1f4c0f=_0x1f4c0f-0x0;var _0x46ee44=_0xc5ec[_0x1f4c0f];return _0x46ee44;};'use strict';var utils=require(_0xcc5e('0x0'));function History(_0x1f20d8){this[_0xcc5e('0x1')]=_0x1f20d8[_0xcc5e('0x1')];this[_0xcc5e('0x2')]=_0x1f20d8[_0xcc5e('0x2')]||undefined;this[_0xcc5e('0x3')]=_0x1f20d8['type'];this['campaigntype']=_0x1f20d8['type']==='outbound'?_0xcc5e('0x4'):_0x1f20d8[_0xcc5e('0x3')];this[_0xcc5e('0x5')]=_0x1f20d8[_0xcc5e('0x5')];this[_0xcc5e('0x6')]=_0x1f20d8[_0xcc5e('0x6')];this['countnoanswerretry']=_0x1f20d8[_0xcc5e('0x7')];this[_0xcc5e('0x8')]=_0x1f20d8[_0xcc5e('0x5')]+_0x1f20d8[_0xcc5e('0x6')]+_0x1f20d8[_0xcc5e('0x7')]+_0x1f20d8[_0xcc5e('0x9')]+_0x1f20d8[_0xcc5e('0xa')]+_0x1f20d8[_0xcc5e('0xb')]+_0x1f20d8[_0xcc5e('0xc')]+_0x1f20d8[_0xcc5e('0xd')];this[_0xcc5e('0x9')]=_0x1f20d8[_0xcc5e('0x9')];this[_0xcc5e('0xa')]=_0x1f20d8['countdropretry'];this[_0xcc5e('0xb')]=_0x1f20d8[_0xcc5e('0xb')];this[_0xcc5e('0xc')]=_0x1f20d8[_0xcc5e('0xc')];this[_0xcc5e('0xd')]=_0x1f20d8[_0xcc5e('0xd')];this['queue']=_0x1f20d8[_0xcc5e('0x4')];this[_0xcc5e('0xe')]=_0x1f20d8[_0xcc5e('0xf')];this[_0xcc5e('0x10')]=_0x1f20d8[_0xcc5e('0x11')];this['starttime']=_0x1f20d8[_0xcc5e('0x12')];this['responsetime']=_0x1f20d8[_0xcc5e('0x13')];this[_0xcc5e('0x14')]=_0x1f20d8[_0xcc5e('0x13')];this[_0xcc5e('0x15')]=utils[_0xcc5e('0x16')](_0x1f20d8[_0xcc5e('0x13')],_0x1f20d8[_0xcc5e('0x12')]);this[_0xcc5e('0x17')]=0x0;this[_0xcc5e('0x18')]=0x0;this[_0xcc5e('0x19')]=_0x1f20d8['callback'];this['callbackuniqueid']=_0x1f20d8[_0xcc5e('0x1a')];this['callbackat']=_0x1f20d8[_0xcc5e('0x1b')];this[_0xcc5e('0x1c')]=_0x1f20d8[_0xcc5e('0x1c')];this[_0xcc5e('0x1d')]=_0x1f20d8[_0xcc5e('0x1d')];this[_0xcc5e('0x1e')]=_0x1f20d8[_0xcc5e('0x1e')];this[_0xcc5e('0x1f')]=_0x1f20d8[_0xcc5e('0x1f')];this[_0xcc5e('0x20')]=_0x1f20d8[_0xcc5e('0x20')];this['CampaignId']=_0x1f20d8[_0xcc5e('0x21')];this[_0xcc5e('0x22')]=_0x1f20d8[_0xcc5e('0x22')]||'';this['originatecalleridname']=_0x1f20d8[_0xcc5e('0x23')]||'';this[_0xcc5e('0x24')]=_0x1f20d8['state'];this[_0xcc5e('0x25')]=_0x1f20d8[_0xcc5e('0x25')];}module[_0xcc5e('0x26')]=History;
\ No newline at end of file
+var _0x862b=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','number','starttime','responsetime','getSeconds','holdtime','callback','callbackuniqueid','callbackat'];(function(_0x48b66b,_0xcc6e64){var _0x4bb0e4=function(_0x136782){while(--_0x136782){_0x48b66b['push'](_0x48b66b['shift']());}};_0x4bb0e4(++_0xcc6e64);}(_0x862b,0x17d));var _0xb862=function(_0x462ca0,_0x327ca7){_0x462ca0=_0x462ca0-0x0;var _0x42fa5d=_0x862b[_0x462ca0];return _0x42fa5d;};'use strict';var utils=require(_0xb862('0x0'));function History(_0x4334ca){this['uniqueid']=_0x4334ca[_0xb862('0x1')];this[_0xb862('0x2')]=_0x4334ca[_0xb862('0x2')]||undefined;this[_0xb862('0x3')]=_0x4334ca['type'];this[_0xb862('0x4')]=_0x4334ca[_0xb862('0x3')]===_0xb862('0x5')?_0xb862('0x6'):_0x4334ca[_0xb862('0x3')];this[_0xb862('0x7')]=_0x4334ca[_0xb862('0x7')];this[_0xb862('0x8')]=_0x4334ca['countcongestionretry'];this[_0xb862('0x9')]=_0x4334ca[_0xb862('0x9')];this[_0xb862('0xa')]=_0x4334ca[_0xb862('0x7')]+_0x4334ca[_0xb862('0x8')]+_0x4334ca[_0xb862('0x9')]+_0x4334ca[_0xb862('0xb')]+_0x4334ca[_0xb862('0xc')]+_0x4334ca[_0xb862('0xd')]+_0x4334ca['countmachineretry']+_0x4334ca[_0xb862('0xe')];this['countnosuchnumberretry']=_0x4334ca[_0xb862('0xb')];this[_0xb862('0xc')]=_0x4334ca[_0xb862('0xc')];this['countabandonedretry']=_0x4334ca['countabandonedretry'];this[_0xb862('0xf')]=_0x4334ca[_0xb862('0xf')];this['countagentrejectretry']=_0x4334ca[_0xb862('0xe')];this[_0xb862('0x6')]=_0x4334ca[_0xb862('0x6')];this[_0xb862('0x10')]=_0x4334ca['name'];this[_0xb862('0x11')]=_0x4334ca[_0xb862('0x12')];this[_0xb862('0x13')]=_0x4334ca[_0xb862('0x13')];this[_0xb862('0x14')]=_0x4334ca[_0xb862('0x14')];this['endtime']=_0x4334ca[_0xb862('0x14')];this['ringtime']=utils[_0xb862('0x15')](_0x4334ca[_0xb862('0x14')],_0x4334ca['starttime']);this[_0xb862('0x16')]=0x0;this['talktime']=0x0;this[_0xb862('0x17')]=_0x4334ca['callback'];this['callbackuniqueid']=_0x4334ca[_0xb862('0x18')];this[_0xb862('0x19')]=_0x4334ca[_0xb862('0x19')];this[_0xb862('0x1a')]=_0x4334ca[_0xb862('0x1a')];this[_0xb862('0x1b')]=_0x4334ca['ContactId'];this[_0xb862('0x1c')]=_0x4334ca[_0xb862('0x1c')];this['UserId']=_0x4334ca[_0xb862('0x1d')];this[_0xb862('0x1e')]=_0x4334ca[_0xb862('0x1e')];this[_0xb862('0x1f')]=_0x4334ca[_0xb862('0x1f')];this[_0xb862('0x20')]=_0x4334ca[_0xb862('0x20')]||'';this['originatecalleridname']=_0x4334ca[_0xb862('0x21')]||'';this[_0xb862('0x22')]=_0x4334ca[_0xb862('0x22')];this[_0xb862('0x23')]=_0x4334ca[_0xb862('0x23')];}module[_0xb862('0x24')]=History;
\ No newline at end of file
index 2cf6cb2..9fa57c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2206=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','talktime','queue','connectedlinename','callback','callbackuniqueid','callbackat'];(function(_0x21eeb9,_0x30a865){var _0x4d3a7e=function(_0x8c586d){while(--_0x8c586d){_0x21eeb9['push'](_0x21eeb9['shift']());}};_0x4d3a7e(++_0x30a865);}(_0x2206,0xb4));var _0x6220=function(_0x11a372,_0x26d3da){_0x11a372=_0x11a372-0x0;var _0x2943be=_0x2206[_0x11a372];return _0x2943be;};'use strict';var utils=require(_0x6220('0x0'));function QueueCallerAbandon(_0x3dc52c,_0x203734){this[_0x6220('0x1')]=_0x3dc52c['scheduledat'];this[_0x6220('0x2')]=_0x3dc52c[_0x6220('0x2')];this[_0x6220('0x3')]=_0x3dc52c[_0x6220('0x2')]==='outbound'?'queue':_0x3dc52c[_0x6220('0x2')];this[_0x6220('0x4')]=_0x3dc52c[_0x6220('0x4')];this[_0x6220('0x5')]=_0x3dc52c[_0x6220('0x5')];this[_0x6220('0x6')]=_0x3dc52c[_0x6220('0x6')];this['countglobal']=_0x3dc52c[_0x6220('0x4')]+_0x3dc52c['countcongestionretry']+_0x3dc52c[_0x6220('0x6')]+_0x3dc52c[_0x6220('0x7')]+_0x3dc52c[_0x6220('0x8')]+_0x3dc52c['countabandonedretry']+_0x3dc52c['countmachineretry']+_0x3dc52c[_0x6220('0x9')];this['countnosuchnumberretry']=_0x3dc52c[_0x6220('0x7')];this['countdropretry']=_0x3dc52c[_0x6220('0x8')];this[_0x6220('0xa')]=_0x3dc52c[_0x6220('0xa')];this['countmachineretry']=_0x3dc52c[_0x6220('0xb')];this['countagentrejectretry']=_0x3dc52c['countagentrejectretry'];this[_0x6220('0xc')]=_0x203734[_0x6220('0xc')];this[_0x6220('0xd')]=_0x3dc52c[_0x6220('0xe')];this[_0x6220('0xf')]=_0x3dc52c[_0x6220('0x10')];this[_0x6220('0x11')]=_0x3dc52c['starttime'];this[_0x6220('0x12')]=_0x3dc52c[_0x6220('0x12')];this['droptime']=_0x3dc52c[_0x6220('0x13')];this[_0x6220('0x14')]=_0x3dc52c[_0x6220('0x14')];this[_0x6220('0x15')]=this['droptime'];this[_0x6220('0x16')]=utils['getSeconds'](_0x3dc52c['responsetime'],_0x3dc52c[_0x6220('0x11')]);this[_0x6220('0x17')]=utils['getSeconds'](this[_0x6220('0x13')],_0x3dc52c[_0x6220('0x12')]);this[_0x6220('0x18')]=0x0;this[_0x6220('0x19')]=_0x203734[_0x6220('0x19')];this['membername']=_0x203734[_0x6220('0x1a')];this['reason']=_0x203734['reason'];this[_0x6220('0x1b')]=_0x3dc52c[_0x6220('0x1b')];this[_0x6220('0x1c')]=_0x3dc52c[_0x6220('0x1c')];this[_0x6220('0x1d')]=_0x3dc52c[_0x6220('0x1d')];this[_0x6220('0x1e')]=_0x3dc52c[_0x6220('0x1e')];this[_0x6220('0x1f')]=_0x3dc52c[_0x6220('0x1f')];this['ListId']=_0x3dc52c[_0x6220('0x20')];this[_0x6220('0x21')]=_0x3dc52c[_0x6220('0x21')];this[_0x6220('0x22')]=_0x3dc52c[_0x6220('0x22')];this['CampaignId']=_0x3dc52c[_0x6220('0x23')];this['originatecalleridnum']=_0x3dc52c[_0x6220('0x24')]||'';this[_0x6220('0x25')]=_0x3dc52c[_0x6220('0x25')]||'';this[_0x6220('0x26')]=_0x3dc52c[_0x6220('0x26')];this['state']=_0x3dc52c[_0x6220('0x27')];this[_0x6220('0x28')]=_0x3dc52c[_0x6220('0x28')];}module[_0x6220('0x29')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xade2=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid'];(function(_0x1a150e,_0x3778c6){var _0x2f1a7b=function(_0x51fac0){while(--_0x51fac0){_0x1a150e['push'](_0x1a150e['shift']());}};_0x2f1a7b(++_0x3778c6);}(_0xade2,0xe9));var _0x2ade=function(_0x2f47be,_0x1ba49e){_0x2f47be=_0x2f47be-0x0;var _0x81431=_0xade2[_0x2f47be];return _0x81431;};'use strict';var utils=require(_0x2ade('0x0'));function QueueCallerAbandon(_0x32cc46,_0x5428d4){this['scheduledat']=_0x32cc46[_0x2ade('0x1')];this[_0x2ade('0x2')]=_0x32cc46[_0x2ade('0x2')];this['campaigntype']=_0x32cc46[_0x2ade('0x2')]===_0x2ade('0x3')?_0x2ade('0x4'):_0x32cc46[_0x2ade('0x2')];this['countbusyretry']=_0x32cc46['countbusyretry'];this[_0x2ade('0x5')]=_0x32cc46[_0x2ade('0x5')];this['countnoanswerretry']=_0x32cc46[_0x2ade('0x6')];this[_0x2ade('0x7')]=_0x32cc46[_0x2ade('0x8')]+_0x32cc46['countcongestionretry']+_0x32cc46['countnoanswerretry']+_0x32cc46[_0x2ade('0x9')]+_0x32cc46[_0x2ade('0xa')]+_0x32cc46['countabandonedretry']+_0x32cc46[_0x2ade('0xb')]+_0x32cc46['countagentrejectretry'];this[_0x2ade('0x9')]=_0x32cc46[_0x2ade('0x9')];this[_0x2ade('0xa')]=_0x32cc46[_0x2ade('0xa')];this[_0x2ade('0xc')]=_0x32cc46[_0x2ade('0xc')];this[_0x2ade('0xb')]=_0x32cc46[_0x2ade('0xb')];this[_0x2ade('0xd')]=_0x32cc46['countagentrejectretry'];this[_0x2ade('0xe')]=_0x5428d4[_0x2ade('0xe')];this[_0x2ade('0xf')]=_0x32cc46[_0x2ade('0x10')];this[_0x2ade('0x11')]=_0x32cc46[_0x2ade('0x12')];this[_0x2ade('0x13')]=_0x32cc46[_0x2ade('0x13')];this[_0x2ade('0x14')]=_0x32cc46[_0x2ade('0x14')];this[_0x2ade('0x15')]=_0x32cc46['droptime'];this[_0x2ade('0x16')]=_0x32cc46['dropreason'];this['endtime']=this[_0x2ade('0x15')];this[_0x2ade('0x17')]=utils[_0x2ade('0x18')](_0x32cc46[_0x2ade('0x14')],_0x32cc46['starttime']);this[_0x2ade('0x19')]=utils[_0x2ade('0x18')](this[_0x2ade('0x15')],_0x32cc46[_0x2ade('0x14')]);this['talktime']=0x0;this[_0x2ade('0x4')]=_0x5428d4[_0x2ade('0x4')];this[_0x2ade('0x1a')]=_0x5428d4[_0x2ade('0x1b')];this[_0x2ade('0x1c')]=_0x5428d4[_0x2ade('0x1c')];this['callback']=_0x32cc46[_0x2ade('0x1d')];this[_0x2ade('0x1e')]=_0x32cc46[_0x2ade('0x1e')];this[_0x2ade('0x1f')]=_0x32cc46[_0x2ade('0x1f')];this['recallme']=_0x32cc46[_0x2ade('0x20')];this['ContactId']=_0x32cc46[_0x2ade('0x21')];this[_0x2ade('0x22')]=_0x32cc46['ListId'];this[_0x2ade('0x23')]=_0x32cc46[_0x2ade('0x23')];this[_0x2ade('0x24')]=_0x32cc46[_0x2ade('0x24')];this[_0x2ade('0x25')]=_0x32cc46[_0x2ade('0x25')];this[_0x2ade('0x26')]=_0x32cc46[_0x2ade('0x26')]||'';this[_0x2ade('0x27')]=_0x32cc46[_0x2ade('0x27')]||'';this['agiafterat']=_0x32cc46[_0x2ade('0x28')];this[_0x2ade('0x29')]=_0x32cc46['state'];this[_0x2ade('0x2a')]=_0x32cc46['statedesc'];}module[_0x2ade('0x2b')]=QueueCallerAbandon;
\ No newline at end of file
index 2c25216..2ee0212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['util','../../../../config/logger','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialerIvr','countReScheduled','catch','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[avgHandleTime]','createHistory','[createHistory]'];(function(_0x5caf54,_0xae2380){var _0xa31488=function(_0x432ffb){while(--_0x432ffb){_0x5caf54['push'](_0x5caf54['shift']());}};_0xa31488(++_0xae2380);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0xd781('0x0'));var logger=require(_0xd781('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0xd781('0x2'));var cmHopperBlack=require(_0xd781('0x3'));var cmHopperHistory=require(_0xd781('0x4'));function inspectError(_0x1a9f94){return util[_0xd781('0x5')](_0x1a9f94,{'showHidden':![],'depth':null});}function getContactDialer(_0x42258e,_0x446534,_0x1d4f4e){return cmHopper[_0xd781('0x6')](_0x42258e['id'],_0x446534,_0x1d4f4e,_0x42258e[_0xd781('0x7')])['catch'](function(_0x133509){_0x42258e[_0xd781('0x8')]=0x0;logger[_0xd781('0x9')](_0xd781('0xa'),inspectError(_0x133509));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x1e7779,_0x5c18c8){return cmHopper[_0xd781('0xb')](_0x1e7779['id'],_0x5c18c8,_0x1e7779[_0xd781('0x7')])['catch'](function(_0x346756){_0x1e7779[_0xd781('0x8')]=0x0;logger['error']('[getContactDialerIvr]',inspectError(_0x346756));});}exports[_0xd781('0xb')]=getContactDialerIvr;function countReScheduled(_0x28b74c){return cmHopper[_0xd781('0xc')](_0x28b74c)[_0xd781('0xd')](function(_0xbea78b){logger[_0xd781('0x9')](_0xd781('0xe'),inspectError(_0xbea78b));});}exports[_0xd781('0xc')]=countReScheduled;function rescheduleContact(_0xb895a1){return cmHopper[_0xd781('0xf')](_0xb895a1)[_0xd781('0xd')](function(_0x587953){logger[_0xd781('0x9')](_0xd781('0x10'),inspectError(_0x587953));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x3a1f48,_0x48bffc,_0x294e5a){return cmHopper[_0xd781('0x11')](_0x3a1f48,_0x48bffc,_0x294e5a)[_0xd781('0xd')](function(_0x1409dd){logger[_0xd781('0x9')](_0xd781('0x12'),inspectError(_0x1409dd));});}exports[_0xd781('0x11')]=unlockContact;function moveContactManagedDialer(_0x5770b0){return cmHopper[_0xd781('0x13')](_0x5770b0)[_0xd781('0xd')](function(_0x395d9c){logger[_0xd781('0x9')](_0xd781('0x14'),inspectError(_0x395d9c));});}exports[_0xd781('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x260aa8){return cmHopperBlack[_0xd781('0x15')](_0x260aa8)['catch'](function(_0x32e15e){logger[_0xd781('0x9')](_0xd781('0x16'),inspectError(_0x32e15e));});}exports[_0xd781('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x36d320){return cmHopperBlack[_0xd781('0x17')](_0x36d320)[_0xd781('0xd')](function(_0x5dd1f0){logger[_0xd781('0x9')]('[checkIsBlackListIvr]',inspectError(_0x5dd1f0));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x187a5a,_0x568001,_0x175ba6){return cmHopperAdditionalPhone[_0xd781('0x18')](_0x187a5a,_0x568001,_0x175ba6)[_0xd781('0xd')](function(_0x31bf57){logger[_0xd781('0x9')](_0xd781('0x19'),inspectError(_0x31bf57));});}exports[_0xd781('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x316d43,_0x10940b,_0x5662db){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x316d43,_0x10940b,_0x5662db)[_0xd781('0xd')](function(_0x849587){logger[_0xd781('0x9')]('[swapAdditionalPhone]',inspectError(_0x849587));});}exports[_0xd781('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x5a431b){return cmHopperHistory['avgHandleTime'](_0x5a431b)[_0xd781('0xd')](function(_0x54fe00){logger[_0xd781('0x9')](_0xd781('0x1b'),inspectError(_0x54fe00));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x5b6b9d){return cmHopperHistory[_0xd781('0x1c')](_0x5b6b9d)['catch'](function(_0x296a0b){logger['error'](_0xd781('0x1d'),inspectError(_0x296a0b));});}exports[_0xd781('0x1c')]=createHistory;
\ No newline at end of file
+var _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x51fd3d,_0x248833){var _0x3b8346=function(_0x5b7a2b){while(--_0x5b7a2b){_0x51fd3d['push'](_0x51fd3d['shift']());}};_0x3b8346(++_0x248833);}(_0xb10b,0x12a));var _0xbb10=function(_0x12f036,_0x27e401){_0x12f036=_0x12f036-0x0;var _0xf0be1b=_0xb10b[_0x12f036];return _0xf0be1b;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=createHistory;
\ No newline at end of file
index 80d4213..d283894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c63=['string','isEmpty','\x22%s\x22\x20<%s>','getCallerId','pow','format','replace','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','includes','XMD-','setXMDContactVariables','lodash','util','../../../../config/logger','../../../../config/environment/shared','timezones','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RUNNING','TIMEZONE_UNKNOW','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','message','available','loggedIn','loggedInDb','paused','talking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','status','INACTIVE','pTalking','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined'];(function(_0x59326c,_0x3c1748){var _0x131742=function(_0x4afbbe){while(--_0x4afbbe){_0x59326c['push'](_0x59326c['shift']());}};_0x131742(++_0x3c1748);}(_0x7c63,0x69));var _0x37c6=function(_0x26e25a,_0x58b209){_0x26e25a=_0x26e25a-0x0;var _0x221d17=_0x7c63[_0x26e25a];return _0x221d17;};'use strict';var _=require(_0x37c6('0x0'));var moment=require('moment');var util=require(_0x37c6('0x1'));var logger=require(_0x37c6('0x2'))('dialer');var timezones=require(_0x37c6('0x3'))[_0x37c6('0x4')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x37c6('0x5'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x37c6('0x6'),'DISACTIVED':_0x37c6('0x7'),'EMPTY_INTERVAL':_0x37c6('0x8'),'INACTIVE':_0x37c6('0x9'),'NO_AGENTS_LOGGED':_0x37c6('0xa'),'NO_AVAILABLE_CONTACTS':_0x37c6('0xb'),'NULL_INTERVAL':_0x37c6('0xc'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x37c6('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x37c6('0xe'),'UNKNOWN_TIMEZONE':_0x37c6('0xf'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0xf586fc){return _0xf586fc[_0x37c6('0x10')]===_0x37c6('0x11');}exports[_0x37c6('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x4639ab){return _0x4639ab[_0x37c6('0x13')]===_0x37c6('0x14');}exports[_0x37c6('0x15')]=isIVRCampaign;function isOutboundQueue(_0x197036){return _0x197036[_0x37c6('0x13')]===_0x37c6('0x16');}exports[_0x37c6('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x480386){return _0x480386['dialActive'];}exports[_0x37c6('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4a232f){return _0x4a232f['active'];}exports[_0x37c6('0x19')]=isIVRCampaignActive;function getSeconds(_0x230aa5,_0x4c794d){var _0x82788a=moment(_0x230aa5)['milliseconds'](0x0);var _0x21d6e9=moment(_0x4c794d)[_0x37c6('0x1a')](0x0);return _0x82788a['diff'](_0x21d6e9,_0x37c6('0x1b'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x121ea2,_0x499d46){var _0x7e4880=![];var _0xdc9f23=_0x121ea2[_0x37c6('0x10')]!==_0x499d46[_0x37c6('0x10')]||_0x121ea2['dialActive']!==_0x499d46['dialActive']||_0x121ea2[_0x37c6('0x1c')]!==_0x499d46['message'];var _0x474a84=_0x121ea2[_0x37c6('0x1d')]!==_0x499d46[_0x37c6('0x1d')]||_0x121ea2['loggedIn']!==_0x499d46[_0x37c6('0x1e')]||_0x121ea2[_0x37c6('0x1f')]!==_0x499d46[_0x37c6('0x1f')]||_0x121ea2['paused']!==_0x499d46[_0x37c6('0x20')]||_0x121ea2[_0x37c6('0x21')]!==_0x499d46[_0x37c6('0x21')]||_0x121ea2['pTalking']!==_0x499d46['pTalking']||_0x121ea2['waiting']!==_0x499d46[_0x37c6('0x22')]||_0x121ea2[_0x37c6('0x23')]!==_0x499d46[_0x37c6('0x23')]||_0x121ea2[_0x37c6('0x24')]!==_0x499d46[_0x37c6('0x24')];if(_0x121ea2[_0x37c6('0x25')]&&_0x499d46[_0x37c6('0x25')]){_0x7e4880=_0x121ea2[_0x37c6('0x25')][_0x37c6('0x26')]!==_0x499d46['Trunk'][_0x37c6('0x26')]||_0x121ea2[_0x37c6('0x25')][_0x37c6('0x27')]!==_0x499d46[_0x37c6('0x25')][_0x37c6('0x27')];}return _0xdc9f23||_0x474a84||_0x7e4880;}exports[_0x37c6('0x28')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x185f20){var _0x3523a8=null;var _0x4d2a8d=_0x185f20[_0x37c6('0x29')];if(_[_0x37c6('0x2a')](_0x185f20[_0x37c6('0x2b')])||_[_0x37c6('0x2a')](_0x185f20['Interval'])||_[_0x37c6('0x2a')](_0x185f20[_0x37c6('0x2c')][_0x37c6('0x2d')])){_0x3523a8=CAMPAIGN_STATUS[_0x37c6('0x2e')];}else if(_['isEmpty'](_0x185f20[_0x37c6('0x2b')])||_['isEmpty'](_0x185f20[_0x37c6('0x2c')][_0x37c6('0x2d')])){_0x3523a8=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x4d2a8d&&!timezones[_0x4d2a8d]){_0x3523a8=CAMPAIGN_STATUS[_0x37c6('0x2f')];}return _0x3523a8;}function checkAnyValidTrunk(_0x1da0f1,_0x211abe){var _0x479423=null;var _0x56f632=_0x37c6('0x30');var _0x564676=[_0x37c6('0x31'),_0x37c6('0x32')];var _0x3161f4=!![];if(_0x1da0f1[_0x37c6('0x25')]&&_0x1da0f1[_0x37c6('0x25')]['active']){_0x56f632+=_0x1da0f1[_0x37c6('0x25')][_0x37c6('0x26')];_0x479423=_0x211abe[_0x56f632];_0x3161f4=_0x564676['includes'](_0x479423['status']);}else if(_0x1da0f1[_0x37c6('0x33')]&&_0x1da0f1[_0x37c6('0x33')][_0x37c6('0x27')]){_0x56f632+=_0x1da0f1[_0x37c6('0x33')][_0x37c6('0x26')];_0x479423=_0x211abe[_0x56f632];_0x3161f4=_0x564676['includes'](_0x479423[_0x37c6('0x34')]);}return _0x3161f4;}function getQueueCampaignStatusMessage(_0x222c0b,_0x4b725b){var _0x129e8a=CAMPAIGN_STATUS['ACTIVE'];var _0x40db76=isPreviewCampaign(_0x222c0b);if(!isQueueCampaignActive(_0x222c0b)){if(_0x40db76){_0x129e8a=CAMPAIGN_STATUS[_0x37c6('0x35')];}else{if(_0x222c0b[_0x37c6('0x24')]===0x0&&_0x222c0b[_0x37c6('0x21')]===0x0&&_0x222c0b['waiting']===0x0&&(_0x222c0b[_0x37c6('0x36')]||0x0)===0x0){_0x129e8a=CAMPAIGN_STATUS[_0x37c6('0x35')];}else{_0x129e8a=CAMPAIGN_STATUS[_0x37c6('0x37')];}}}else if(_0x222c0b['loggedIn']===0x0){_0x129e8a=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x222c0b,_0x4b725b)){_0x129e8a=CAMPAIGN_STATUS[_0x37c6('0x38')];}else if(!isPreviewCampaign(_0x222c0b)){var _0x183042=checkAnyValidQueueCampaignInterval(_0x222c0b);if(_0x183042){_0x129e8a=_0x183042;}}return _0x129e8a;}exports[_0x37c6('0x39')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x21c892){var _0x4d78c4=CAMPAIGN_STATUS[_0x37c6('0x37')];if(_0x21c892['originated']===0x0&&_0x21c892[_0x37c6('0x21')]===0x0&&_0x21c892[_0x37c6('0x22')]===0x0&&(_0x21c892[_0x37c6('0x36')]||0x0)===0x0){_0x4d78c4=CAMPAIGN_STATUS['INACTIVE'];}return _0x4d78c4;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x327aa9){var _0x16810a=_0x327aa9[_0x37c6('0x3a')](/"(.*?)"/);return _0x16810a?_0x16810a[0x1]:_0x327aa9;}exports[_0x37c6('0x3b')]=extractCalleridName;function getCallerId(_0x572304,_0x2480eb,_0x244f4d){if(!_[_0x37c6('0x3c')](_0x244f4d)&&typeof _0x244f4d===_0x37c6('0x3d')&&!_[_0x37c6('0x3e')](_0x244f4d)){if(!_['isUndefined'](_0x2480eb)&&typeof _0x2480eb===_0x37c6('0x3d')&&!_[_0x37c6('0x3e')](_0x2480eb)){return util['format'](_0x37c6('0x3f'),_0x2480eb,_0x244f4d);}return util['format']('\x22%s\x22\x20<%s>',_0x244f4d,_0x244f4d);}if(!_['isUndefined'](_0x572304)&&typeof _0x572304===_0x37c6('0x3d')&&!_[_0x37c6('0x3e')](_0x572304)){return _0x572304;}return'\x22\x22\x20<>';}exports[_0x37c6('0x40')]=getCallerId;function getCallerIdRandom(_0x13e419,_0x518ee7){var _0x5c734c;var _0x3dcbf0;var _0x47aec0;if(_0x518ee7<=0x0){_0x518ee7=0x1;}_0x5c734c=new RegExp('\x5cw{0,'+_0x518ee7+'}$');_0x3dcbf0=Math[_0x37c6('0x41')](0xa,_0x518ee7-0x1);_0x47aec0=Math[_0x37c6('0x41')](0xa,_0x518ee7)-0x1;return util[_0x37c6('0x42')]('%s',_[_0x37c6('0x43')](_0x13e419,_0x5c734c,_[_0x37c6('0x44')](_0x3dcbf0,_0x47aec0)['toString']()));}exports[_0x37c6('0x45')]=getCallerIdRandom;function decrementOriginate(_0x1f2621){if(_0x1f2621[_0x37c6('0x24')]&&_0x1f2621[_0x37c6('0x24')]>0x0){_0x1f2621[_0x37c6('0x24')]-=0x1;}else{logger[_0x37c6('0x46')](_0x37c6('0x47'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0xb0e849){return _0xb0e849&&_0xb0e849[_0x37c6('0x48')]>0x0;}exports[_0x37c6('0x49')]=checkContactEmpty;function erlangb(_0x42bcad,_0x42369b){if(_0x42369b===0x0){return 0x0;}var _0x1ac6da=0x1;for(var _0x1ccde4=0x1;_0x1ccde4<=_0x42369b;_0x1ccde4+=0x1){_0x1ac6da=0x1+_0x1ac6da*_0x1ccde4/_0x42bcad;}return 0x1/_0x1ac6da;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x1523fd,_0x31976b,_0x1cfc90){if(_0x31976b>_0x1cfc90){for(var _0x10b52b=0x0;_0x10b52b<_0x31976b-_0x1cfc90;_0x10b52b+=0x1){decrementOriginate(_0x1523fd);}}}exports[_0x37c6('0x4a')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x45c7d4){var _0x101bff={};var _0xb0af22=['id',_0x37c6('0x4b'),_0x37c6('0x4c'),_0x37c6('0x4d'),_0x37c6('0x4e')];if(_0x45c7d4){for(var _0x4d1727 in _0x45c7d4){if(typeof _0x45c7d4[_0x4d1727]!==_0x37c6('0x4f')){if(!_[_0x37c6('0x2a')](_0x45c7d4[_0x4d1727])&&!_0xb0af22[_0x37c6('0x50')](_0x4d1727)){_0x101bff[util['format']('%s%s',_0x37c6('0x51'),_0x4d1727['toUpperCase']())]=_0x45c7d4[_0x4d1727];}}}}return _0x101bff;}exports[_0x37c6('0x52')]=setXMDContactVariables;
\ No newline at end of file
+var _0xd1e2=['AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','status','TrunkBackup','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','NOT_ACTIVE','AGENTS_NOT_LOGGED'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0xd1e2,0x1e6));var _0x2d1e=function(_0x5b7cd1,_0x130457){_0x5b7cd1=_0x5b7cd1-0x0;var _0x25cc75=_0xd1e2[_0x5b7cd1];return _0x25cc75;};'use strict';var _=require(_0x2d1e('0x0'));var moment=require('moment');var util=require(_0x2d1e('0x1'));var logger=require(_0x2d1e('0x2'))(_0x2d1e('0x3'));var timezones=require(_0x2d1e('0x4'))[_0x2d1e('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x2d1e('0x6'),'BLACKLIST':_0x2d1e('0x7'),'CONTACTS_RESCHEDULED':_0x2d1e('0x8'),'DEACTIVATED':_0x2d1e('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x2d1e('0xa'),'NO_AGENTS_LOGGED':_0x2d1e('0xb'),'NO_AVAILABLE_CONTACTS':_0x2d1e('0xc'),'NULL_INTERVAL':_0x2d1e('0xd'),'OVERTIME_INTERVAL':_0x2d1e('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x2d1e('0xf'),'QUEUE_RECALL':_0x2d1e('0x10'),'RECALL_TIMEOUT':_0x2d1e('0x11'),'RUNNING':_0x2d1e('0x12'),'UNKNOWN_TIMEZONE':_0x2d1e('0x13'),'UNREACHABLE_TRUNK':_0x2d1e('0x14')};exports[_0x2d1e('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x206273){return _0x206273[_0x2d1e('0x16')]===_0x2d1e('0x17');}exports[_0x2d1e('0x18')]=isPreviewCampaign;function isIVRCampaign(_0x5a2185){return _0x5a2185[_0x2d1e('0x19')]==='ivr';}exports[_0x2d1e('0x1a')]=isIVRCampaign;function isOutboundQueue(_0x12dce2){return _0x12dce2[_0x2d1e('0x19')]===_0x2d1e('0x1b');}exports[_0x2d1e('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x4b2868){return _0x4b2868[_0x2d1e('0x1d')];}exports[_0x2d1e('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0x177428){return _0x177428[_0x2d1e('0x1f')];}exports[_0x2d1e('0x20')]=isIVRCampaignActive;function getSeconds(_0x80143,_0x3cce87){var _0x24e280=moment(_0x80143)[_0x2d1e('0x21')](0x0);var _0x1d9ef7=moment(_0x3cce87)[_0x2d1e('0x21')](0x0);return _0x24e280[_0x2d1e('0x22')](_0x1d9ef7,_0x2d1e('0x23'));}exports[_0x2d1e('0x24')]=getSeconds;function hasQueueCampaignDataChanged(_0x1db7e7,_0x31f68a){var _0x1fb25d=![];var _0xdf40c9=_0x1db7e7[_0x2d1e('0x16')]!==_0x31f68a['dialMethod']||_0x1db7e7[_0x2d1e('0x1d')]!==_0x31f68a['dialActive']||_0x1db7e7[_0x2d1e('0x25')]!==_0x31f68a[_0x2d1e('0x25')];var _0x4e9b6f=_0x1db7e7[_0x2d1e('0x26')]!==_0x31f68a[_0x2d1e('0x26')]||_0x1db7e7['loggedIn']!==_0x31f68a[_0x2d1e('0x27')]||_0x1db7e7[_0x2d1e('0x28')]!==_0x31f68a['loggedInDb']||_0x1db7e7['paused']!==_0x31f68a[_0x2d1e('0x29')]||_0x1db7e7[_0x2d1e('0x2a')]!==_0x31f68a[_0x2d1e('0x2a')]||_0x1db7e7[_0x2d1e('0x2b')]!==_0x31f68a[_0x2d1e('0x2b')]||_0x1db7e7[_0x2d1e('0x2c')]!==_0x31f68a[_0x2d1e('0x2c')]||_0x1db7e7[_0x2d1e('0x2d')]!==_0x31f68a[_0x2d1e('0x2d')]||_0x1db7e7[_0x2d1e('0x2e')]!==_0x31f68a[_0x2d1e('0x2e')];if(_0x1db7e7[_0x2d1e('0x2f')]&&_0x31f68a[_0x2d1e('0x2f')]){_0x1fb25d=_0x1db7e7[_0x2d1e('0x2f')][_0x2d1e('0x30')]!==_0x31f68a['Trunk']['name']||_0x1db7e7['Trunk']['active']!==_0x31f68a[_0x2d1e('0x2f')][_0x2d1e('0x1f')];}return _0xdf40c9||_0x4e9b6f||_0x1fb25d;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3a546e){var _0x3dcda0=null;var _0x1381bd=_0x3a546e[_0x2d1e('0x31')];if(_[_0x2d1e('0x32')](_0x3a546e[_0x2d1e('0x33')])||_[_0x2d1e('0x32')](_0x3a546e[_0x2d1e('0x34')])||_[_0x2d1e('0x32')](_0x3a546e[_0x2d1e('0x34')]['Intervals'])){_0x3dcda0=CAMPAIGN_STATUS[_0x2d1e('0x35')];}else if(_['isEmpty'](_0x3a546e['dialGlobalInterval'])||_['isEmpty'](_0x3a546e[_0x2d1e('0x34')]['Intervals'])){_0x3dcda0=CAMPAIGN_STATUS[_0x2d1e('0x36')];}else if(_0x1381bd&&!timezones[_0x1381bd]){_0x3dcda0=CAMPAIGN_STATUS[_0x2d1e('0x37')];}return _0x3dcda0;}function checkAnyValidTrunk(_0x12660d,_0x5b9fe6){var _0x5a96a1=null;var _0x4a291a=_0x2d1e('0x38');var _0x5e7c6d=['reachable',_0x2d1e('0x39')];var _0x151daf=!![];if(_0x12660d[_0x2d1e('0x2f')]&&_0x12660d[_0x2d1e('0x2f')][_0x2d1e('0x1f')]){_0x4a291a+=_0x12660d[_0x2d1e('0x2f')]['name'];_0x5a96a1=_0x5b9fe6[_0x4a291a];_0x151daf=_0x5e7c6d['includes'](_0x5a96a1[_0x2d1e('0x3a')]);}else if(_0x12660d[_0x2d1e('0x3b')]&&_0x12660d['TrunkBackup'][_0x2d1e('0x1f')]){_0x4a291a+=_0x12660d['TrunkBackup']['name'];_0x5a96a1=_0x5b9fe6[_0x4a291a];_0x151daf=_0x5e7c6d['includes'](_0x5a96a1[_0x2d1e('0x3a')]);}return _0x151daf;}function getQueueCampaignStatusMessage(_0x59b06f,_0x2af122){var _0x4fc533=CAMPAIGN_STATUS[_0x2d1e('0x6')];var _0x3dd421=isPreviewCampaign(_0x59b06f);if(!isQueueCampaignActive(_0x59b06f)){if(_0x3dd421){_0x4fc533=CAMPAIGN_STATUS[_0x2d1e('0x3c')];}else{if(_0x59b06f['originated']===0x0&&_0x59b06f[_0x2d1e('0x2a')]===0x0&&_0x59b06f['waiting']===0x0&&(_0x59b06f[_0x2d1e('0x2b')]||0x0)===0x0){_0x4fc533=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4fc533=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x59b06f['loggedIn']===0x0){_0x4fc533=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x59b06f,_0x2af122)){_0x4fc533=CAMPAIGN_STATUS[_0x2d1e('0x3d')];}else if(!isPreviewCampaign(_0x59b06f)){var _0x4f83e7=checkAnyValidQueueCampaignInterval(_0x59b06f);if(_0x4f83e7){_0x4fc533=_0x4f83e7;}}return _0x4fc533;}exports[_0x2d1e('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x32993c){var _0x44c10d=CAMPAIGN_STATUS[_0x2d1e('0x3f')];if(_0x32993c[_0x2d1e('0x2e')]===0x0&&_0x32993c[_0x2d1e('0x2a')]===0x0&&_0x32993c[_0x2d1e('0x2c')]===0x0&&(_0x32993c[_0x2d1e('0x2b')]||0x0)===0x0){_0x44c10d=CAMPAIGN_STATUS['INACTIVE'];}return _0x44c10d;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x56a499){var _0x147931=_0x56a499[_0x2d1e('0x40')](/"(.*?)"/);return _0x147931?_0x147931[0x1]:_0x56a499;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x4660b1,_0x1ea57a,_0x24b13b){if(!_[_0x2d1e('0x41')](_0x24b13b)&&typeof _0x24b13b==='string'&&!_[_0x2d1e('0x42')](_0x24b13b)){if(!_[_0x2d1e('0x41')](_0x1ea57a)&&typeof _0x1ea57a===_0x2d1e('0x43')&&!_[_0x2d1e('0x42')](_0x1ea57a)){return util['format']('\x22%s\x22\x20<%s>',_0x1ea57a,_0x24b13b);}return util[_0x2d1e('0x44')](_0x2d1e('0x45'),_0x24b13b,_0x24b13b);}if(!_[_0x2d1e('0x41')](_0x4660b1)&&typeof _0x4660b1===_0x2d1e('0x43')&&!_['isEmpty'](_0x4660b1)){return _0x4660b1;}return'\x22\x22\x20<>';}exports[_0x2d1e('0x46')]=getCallerId;function getCallerIdRandom(_0x5651aa,_0x33f2c9){var _0xbafc3a;var _0x55b9b1;var _0x3c2741;if(_0x33f2c9<=0x0){_0x33f2c9=0x1;}_0xbafc3a=new RegExp(_0x2d1e('0x47')+_0x33f2c9+'}$');_0x55b9b1=Math['pow'](0xa,_0x33f2c9-0x1);_0x3c2741=Math[_0x2d1e('0x48')](0xa,_0x33f2c9)-0x1;return util['format']('%s',_[_0x2d1e('0x49')](_0x5651aa,_0xbafc3a,_[_0x2d1e('0x4a')](_0x55b9b1,_0x3c2741)[_0x2d1e('0x4b')]()));}exports[_0x2d1e('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x7bff60){if(_0x7bff60[_0x2d1e('0x2e')]&&_0x7bff60[_0x2d1e('0x2e')]>0x0){_0x7bff60[_0x2d1e('0x2e')]-=0x1;}else{logger[_0x2d1e('0x4d')](_0x2d1e('0x4e'));}}exports[_0x2d1e('0x4f')]=decrementOriginate;function checkContactEmpty(_0x475e2c){return _0x475e2c&&_0x475e2c['length']>0x0;}exports[_0x2d1e('0x50')]=checkContactEmpty;function erlangb(_0xadca9,_0x3ab9d9){if(_0x3ab9d9===0x0){return 0x0;}var _0x495710=0x1;for(var _0xd744a3=0x1;_0xd744a3<=_0x3ab9d9;_0xd744a3+=0x1){_0x495710=0x1+_0x495710*_0xd744a3/_0xadca9;}return 0x1/_0x495710;}exports[_0x2d1e('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x3ae70f,_0x155466,_0x239a19){if(_0x155466>_0x239a19){for(var _0x4c997a=0x0;_0x4c997a<_0x155466-_0x239a19;_0x4c997a+=0x1){decrementOriginate(_0x3ae70f);}}}exports[_0x2d1e('0x52')]=checkContactLowerLimitOriginate;
\ No newline at end of file
index f62ad32..feaf70e 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(_0x281383,_0x142017){var _0x1eae7d=function(_0x59af44){while(--_0x59af44){_0x281383['push'](_0x281383['shift']());}};_0x1eae7d(++_0x142017);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x146c16,_0x48baf4){var _0x4c38de=function(_0x5d0cfe){while(--_0x5d0cfe){_0x146c16['push'](_0x146c16['shift']());}};_0x4c38de(++_0x48baf4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 e770b83..61f41d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f4f=['then','fax','catch','error','\x20notify\x20','stringify','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','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','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','moment','tiff2pdf','./util/gs','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','newchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','actions','variable','value','channelstatedesc','hasOwnProperty','operation','status','filename','info','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf'];(function(_0x5fe69a,_0x5484f5){var _0x3f1aee=function(_0x54387f){while(--_0x54387f){_0x5fe69a['push'](_0x5fe69a['shift']());}};_0x3f1aee(++_0x5484f5);}(_0x6f4f,0x187));var _0xf6f4=function(_0x1530d8,_0x3cda66){_0x1530d8=_0x1530d8-0x0;var _0x11a128=_0x6f4f[_0x1530d8];return _0x11a128;};'use strict';var util=require(_0xf6f4('0x0'));var _=require(_0xf6f4('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xf6f4('0x2'));var path=require('path');var tiff2pdf=require(_0xf6f4('0x3'));var gs=require(_0xf6f4('0x4'));var logger=require('../../../config/logger')('fax');var ami=require('../ami');var rpcDb=require(_0xf6f4('0x5'));var Channel=require(_0xf6f4('0x6'));var ut=require('./util/util');var Action=require(_0xf6f4('0x7'));var faxAccount=require(_0xf6f4('0x8'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xf6f4('0x9'));function Fax(_0x4af406){this['channels']={};this['faxAccounts']=_0x4af406[_0xf6f4('0xa')];this[_0xf6f4('0xb')]=_0x4af406[_0xf6f4('0xb')];this['actions']={};ami['on'](_0xf6f4('0xc'),this['syncNewchannel'][_0xf6f4('0xd')](this));ami['on']('varset',this[_0xf6f4('0xe')][_0xf6f4('0xd')](this));ami['on'](_0xf6f4('0xf'),this[_0xf6f4('0x10')][_0xf6f4('0xd')](this));ami['on'](_0xf6f4('0x11'),this[_0xf6f4('0x12')][_0xf6f4('0xd')](this));ami['on'](_0xf6f4('0x13'),this[_0xf6f4('0x14')]['bind'](this));ami['on']('receivefax',this[_0xf6f4('0x15')][_0xf6f4('0xd')](this));ami['on'](_0xf6f4('0x16'),this['syncHangup'][_0xf6f4('0xd')](this));ami['on'](_0xf6f4('0x17'),this[_0xf6f4('0x18')]['bind'](this));}Fax[_0xf6f4('0x19')][_0xf6f4('0x1a')]=function(_0x20d692){if(_0x20d692[_0xf6f4('0x1b')]===_0xf6f4('0x1c')){for(var _0x2409fc in this[_0xf6f4('0xa')]){if(this['faxAccounts']['hasOwnProperty'](_0x2409fc)){if(_0x20d692[_0xf6f4('0x1d')]===this[_0xf6f4('0xa')][_0x2409fc][_0xf6f4('0x1e')]){this[_0xf6f4('0x1f')][_0x20d692['uniqueid']]={};this['channels'][_0x20d692[_0xf6f4('0x20')]][_0xf6f4('0x21')]=_0x20d692[_0xf6f4('0x21')];this['channels'][_0x20d692[_0xf6f4('0x20')]]['id']=this[_0xf6f4('0xa')][_0x2409fc]['id'];this['channels'][_0x20d692['uniqueid']][_0xf6f4('0x22')]=this[_0xf6f4('0xa')][_0x2409fc][_0xf6f4('0x22')];logger['info'](_0x20d692['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xf6f4('0x23')][_0x20d692[_0xf6f4('0x20')]]){this[_0xf6f4('0x1f')][_0x20d692[_0xf6f4('0x20')]]={};this['channels'][_0x20d692['uniqueid']][_0xf6f4('0x21')]=_0x20d692['channel'];logger['info'](_0x20d692[_0xf6f4('0x20')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0xf6f4('0xe')]=function(_0x6b71d){if(this[_0xf6f4('0x1f')][_0x6b71d[_0xf6f4('0x20')]]){for(var _0x2bf2db in _0x6b71d[_0xf6f4('0x24')]){if(_0x6b71d[_0xf6f4('0x24')]['hasOwnProperty'](_0x2bf2db)){this['channels'][_0x6b71d[_0xf6f4('0x20')]][_0x2bf2db]=_0x6b71d[_0xf6f4('0x25')];}}}};Fax[_0xf6f4('0x19')][_0xf6f4('0x10')]=function(_0x19ec9b){if(this[_0xf6f4('0x1f')][_0x19ec9b[_0xf6f4('0x20')]]){this[_0xf6f4('0x1f')][_0x19ec9b[_0xf6f4('0x20')]]['channelstate']=_0x19ec9b['channelstate'];this[_0xf6f4('0x1f')][_0x19ec9b[_0xf6f4('0x20')]][_0xf6f4('0x26')]=_0x19ec9b[_0xf6f4('0x26')];}};Fax[_0xf6f4('0x19')]['syncNewExten']=function(_0x1abdf5){if(this['channels'][_0x1abdf5[_0xf6f4('0x20')]]){for(var _0x2bd38a in _0x1abdf5[_0xf6f4('0x24')]){if(_0x1abdf5[_0xf6f4('0x24')][_0xf6f4('0x27')](_0x2bd38a)){this[_0xf6f4('0x1f')][_0x1abdf5['uniqueid']][_0x2bd38a]=_0x1abdf5[_0xf6f4('0x25')];}}}};Fax[_0xf6f4('0x19')][_0xf6f4('0x14')]=function(_0xf8694){if(this[_0xf6f4('0x1f')][_0xf8694[_0xf6f4('0x20')]]){this[_0xf6f4('0x1f')][_0xf8694[_0xf6f4('0x20')]][_0xf6f4('0x28')]=_0xf8694['operation'];this[_0xf6f4('0x1f')][_0xf8694[_0xf6f4('0x20')]][_0xf6f4('0x29')]=_0xf8694[_0xf6f4('0x29')];this[_0xf6f4('0x1f')][_0xf8694[_0xf6f4('0x20')]][_0xf6f4('0x1e')]=_0xf8694['localstationid'];this[_0xf6f4('0x1f')][_0xf8694[_0xf6f4('0x20')]]['filename']=_0xf8694[_0xf6f4('0x2a')];logger[_0xf6f4('0x2b')](_0xf8694[_0xf6f4('0x20')],_0xf6f4('0x2c'));}};Fax[_0xf6f4('0x19')][_0xf6f4('0x15')]=function(_0x38b6cd){var _0x4ad111=this;if(this[_0xf6f4('0x1f')][_0x38b6cd['uniqueid']]){var _0x5be748=this['channels'][_0x38b6cd['uniqueid']]['id'];this['channels'][_0x38b6cd[_0xf6f4('0x20')]][_0xf6f4('0x2d')]=_0x38b6cd[_0xf6f4('0x2d')];this[_0xf6f4('0x1f')][_0x38b6cd[_0xf6f4('0x20')]][_0xf6f4('0x2e')]=_0x38b6cd[_0xf6f4('0x2e')];this[_0xf6f4('0x1f')][_0x38b6cd['uniqueid']]['localstationid']=_0x38b6cd['localstationid'];this[_0xf6f4('0x1f')][_0x38b6cd[_0xf6f4('0x20')]][_0xf6f4('0x2f')]=_0x38b6cd[_0xf6f4('0x2f')];this[_0xf6f4('0x1f')][_0x38b6cd[_0xf6f4('0x20')]][_0xf6f4('0x30')]=_0x38b6cd[_0xf6f4('0x30')];this[_0xf6f4('0x1f')][_0x38b6cd[_0xf6f4('0x20')]][_0xf6f4('0x2a')]=_0x38b6cd['filename'];this[_0xf6f4('0x1f')][_0x38b6cd[_0xf6f4('0x20')]][_0xf6f4('0x31')]=_0x38b6cd[_0xf6f4('0x31')];if(this[_0xf6f4('0x1f')][_0x38b6cd['uniqueid']][_0xf6f4('0x2e')]>0x0){tiff2pdf(_0x38b6cd[_0xf6f4('0x2a')],_0xf6f4('0x32'),function(_0x29b276){logger[_0xf6f4('0x2b')](_0x38b6cd['uniqueid'],_0xf6f4('0x33'),_0x29b276[_0xf6f4('0x34')]);attachment[_0xf6f4('0x35')]({'name':path[_0xf6f4('0x36')](_0x38b6cd[_0xf6f4('0x2a')])['name'],'basename':path[_0xf6f4('0x36')](_0x38b6cd[_0xf6f4('0x2a')])['name']+_0xf6f4('0x37'),'type':_0xf6f4('0x38')})[_0xf6f4('0x39')](function(_0x204b91){faxAccount['notify'](_0x5be748,{'from':_0x38b6cd[_0xf6f4('0x31')],'mapKey':_0xf6f4('0x3a'),'body':path[_0xf6f4('0x36')](_0x38b6cd['filename'])['name']+_0xf6f4('0x37'),'AttachmentId':_0x204b91['id']})[_0xf6f4('0x3b')](function(_0x3309a3){logger[_0xf6f4('0x3c')](_0x38b6cd['uniqueid'],_0xf6f4('0x3d'),JSON['stringify'](_0x3309a3));});})['catch'](function(_0x117417){logger['error'](_0x38b6cd[_0xf6f4('0x20')],'\x20receiveFax\x20',JSON[_0xf6f4('0x3e')](_0x117417));});});}logger[_0xf6f4('0x2b')](_0x38b6cd[_0xf6f4('0x20')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x121c9d){if(this[_0xf6f4('0x23')][_0x121c9d[_0xf6f4('0x20')]]){_[_0xf6f4('0x3f')](this[_0xf6f4('0x1f')][_0x121c9d['uniqueid']],_[_0xf6f4('0x40')](_0x121c9d,[_0xf6f4('0x41'),'reason']));}};function updateStatus(_0x77d78e){if(_0x77d78e[_0xf6f4('0x42')]){faxMessage[_0xf6f4('0x43')](_0x77d78e[_0xf6f4('0x42')],{'failMessage':_0xf6f4('0x44')})[_0xf6f4('0x39')](function(_0x6712b5){ut[_0xf6f4('0x45')](_0xf6f4('0x46'),_0x6712b5);})[_0xf6f4('0x3b')](function(_0x6b3317){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x6b3317);});}else{ut[_0xf6f4('0x45')](_0xf6f4('0x47'));}}Fax[_0xf6f4('0x19')][_0xf6f4('0x48')]=function(_0xe8c842,_0x12edc3,_0xa03cd7){var _0x4be94f=this;var _0x328c5c={};if(_0x12edc3){_0x328c5c={'read':_0x12edc3};}else{_0x328c5c={'failMessage':_0xa03cd7};}if(this['actions'][_0xe8c842][_0xf6f4('0x42')]){faxMessage['update'](this[_0xf6f4('0x23')][_0xe8c842][_0xf6f4('0x42')],_0x328c5c)[_0xf6f4('0x39')](function(_0x55c0d3){ut[_0xf6f4('0x45')]('[Fax][Message][Updated]',_0x55c0d3);})[_0xf6f4('0x3b')](function(_0x1e2ee1){ut[_0xf6f4('0x45')](_0xf6f4('0x49'),_0x1e2ee1);})[_0xf6f4('0x4a')](function(){delete _0x4be94f['channels'][_0xe8c842];delete _0x4be94f[_0xf6f4('0x23')][_0xe8c842];});}else{ut[_0xf6f4('0x45')](_0xf6f4('0x4b'));delete this[_0xf6f4('0x1f')][_0xe8c842];delete this['actions'][_0xe8c842];}};Fax['prototype'][_0xf6f4('0x4c')]=function(_0x511dc6){var _0x3097d6=this;if(this['channels'][_0x511dc6[_0xf6f4('0x20')]]){if(this[_0xf6f4('0x23')][_0x511dc6[_0xf6f4('0x20')]]){this[_0xf6f4('0x1f')][_0x511dc6['uniqueid']]['id']=this[_0xf6f4('0x23')][_0x511dc6[_0xf6f4('0x20')]]['id'];this[_0xf6f4('0x1f')][_0x511dc6[_0xf6f4('0x20')]][_0xf6f4('0x22')]=this['actions'][_0x511dc6['uniqueid']]['name'];}logger[_0xf6f4('0x2b')](_0x511dc6[_0xf6f4('0x20')],this[_0xf6f4('0x23')][_0x511dc6['uniqueid']]?_0xf6f4('0x4d'):_0xf6f4('0x4e'),JSON[_0xf6f4('0x3e')](this[_0xf6f4('0x1f')][_0x511dc6[_0xf6f4('0x20')]]));if(this[_0xf6f4('0x23')][_0x511dc6['uniqueid']]){if(this['channels'][_0x511dc6[_0xf6f4('0x20')]][_0xf6f4('0x4f')]>0x0&&this[_0xf6f4('0x1f')][_0x511dc6[_0xf6f4('0x20')]]['faxstatus']===_0xf6f4('0x50')){this[_0xf6f4('0x48')](_0x511dc6[_0xf6f4('0x20')],!![]);}else{this[_0xf6f4('0x48')](_0x511dc6[_0xf6f4('0x20')],![],this[_0xf6f4('0x1f')][_0x511dc6[_0xf6f4('0x20')]][_0xf6f4('0x51')]?'SENDING\x20FAILED:\x20'+this[_0xf6f4('0x1f')][_0x511dc6['uniqueid']][_0xf6f4('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0xf6f4('0x19')][_0xf6f4('0x52')]=function(_0x30ca0b){var _0x2043c4=this;return new BPromise(function(_0x3274cc,_0x524789){_0x2043c4['execOriginate'](_0x30ca0b,_0x2043c4[_0xf6f4('0xa')][_0x30ca0b['FaxAccountId']])[_0xf6f4('0x39')](function(_0x2fefb3){ut[_0xf6f4('0x45')](_0xf6f4('0x53'),_0x2fefb3);_0x3274cc(ut[_0xf6f4('0x34')](_0xf6f4('0x54')));})[_0xf6f4('0x3b')](function(_0x294548){ut['logger'](_0xf6f4('0x55'),_0x294548);updateStatus(_0x30ca0b);_0x524789(ut[_0xf6f4('0x34')](_0xf6f4('0x56')));});});};Fax[_0xf6f4('0x19')][_0xf6f4('0x57')]=function(_0x1ba17a){var _0x33cd51=this;return new BPromise(function(_0x569e95,_0x2f7b3d){var _0x26faa0=_0x33cd51['checkTrunk'](_0x33cd51[_0xf6f4('0xa')][_0x1ba17a[_0xf6f4('0x58')]]['Trunk'],_0x1ba17a);if(_0x26faa0[_0xf6f4('0x59')]){_0x569e95(ut[_0xf6f4('0x34')](_0xf6f4('0x5a')));}else{_0x2f7b3d(ut['message'](_0x26faa0[_0xf6f4('0x34')]));}});};function originate(_0x594fd1,_0x54295d,_0x4abc2a){return new BPromise(function(_0x534568,_0xef807a){if(_0x4abc2a){var _0xe46b10=util[_0xf6f4('0x5b')](_0xf6f4('0x5c'),path[_0xf6f4('0x36')](_0x594fd1['path'])[_0xf6f4('0x22')],_0x594fd1[_0xf6f4('0x5d')]);gs[_0xf6f4('0x5e')](_0xe46b10)['then'](function(){_0x594fd1['path']=util[_0xf6f4('0x5b')](_0xf6f4('0x5f'),path['parse'](_0x594fd1[_0xf6f4('0x5d')])[_0xf6f4('0x60')],path[_0xf6f4('0x36')](_0x594fd1[_0xf6f4('0x5d')])[_0xf6f4('0x22')]);_0x54295d[_0xf6f4('0x61')]=_0x594fd1[_0xf6f4('0x5d')];ut[_0xf6f4('0x45')](_0xf6f4('0x62'),'');ami['Action'](ut[_0xf6f4('0x63')](_0x594fd1,_0x54295d))[_0xf6f4('0x39')](function(_0x4e89ff){_0x534568(_0x4e89ff);})['catch'](function(_0x2beeb7){_0xef807a(_0x2beeb7);});})[_0xf6f4('0x3b')](function(_0x3f2815){_0xef807a(_0x3f2815);});}else{ami[_0xf6f4('0x64')](ut[_0xf6f4('0x63')](_0x594fd1,_0x54295d))[_0xf6f4('0x39')](function(_0x476f3c){_0x534568(_0x476f3c);})[_0xf6f4('0x3b')](function(_0x1a2111){_0xef807a(_0x1a2111);});}});}Fax[_0xf6f4('0x19')]['execOriginate']=function(_0x3b00d4,_0x205e4b){var _0x4acf37=this;return new BPromise(function(_0x55fbc7,_0x24066c){var _0x14578b=uuid['v4']();var _0x1f0524=ut['addVariables'](_0x3b00d4,_0x205e4b);_0x4acf37[_0xf6f4('0x23')][_0x14578b]=new Action(_0x14578b,_0x205e4b,_0x3b00d4);var _0x4e6ece=_0x4acf37[_0xf6f4('0x23')][_0x14578b];if(path[_0xf6f4('0x36')](_0x3b00d4['path'])[_0xf6f4('0x65')]==='.pdf'){originate(_0x4e6ece,_0x1f0524,!![])[_0xf6f4('0x39')](function(_0x56184e){_0x55fbc7(_0x56184e);})[_0xf6f4('0x3b')](function(_0x1e12b0){_0x24066c(_0x1e12b0);});}else{originate(_0x4e6ece,_0x1f0524,![])[_0xf6f4('0x39')](function(_0x1aaafd){_0x55fbc7(_0x1aaafd);})[_0xf6f4('0x3b')](function(_0x3c88b8){_0x24066c(_0x3c88b8);});}});};Fax[_0xf6f4('0x19')][_0xf6f4('0x66')]=function(_0x2bf96f){return!_[_0xf6f4('0x67')](_0x2bf96f)&&!_[_0xf6f4('0x67')](_0x2bf96f['name'])&&!_[_0xf6f4('0x67')](_0x2bf96f[_0xf6f4('0x68')])&&_0x2bf96f['active']&&!_[_0xf6f4('0x67')](this[_0xf6f4('0xb')][util[_0xf6f4('0x5b')](_0xf6f4('0x69'),_0x2bf96f[_0xf6f4('0x22')])])&&!_[_0xf6f4('0x67')](this[_0xf6f4('0xb')][util[_0xf6f4('0x5b')](_0xf6f4('0x69'),_0x2bf96f[_0xf6f4('0x22')])][_0xf6f4('0x29')])&&(this[_0xf6f4('0xb')][util[_0xf6f4('0x5b')](_0xf6f4('0x69'),_0x2bf96f[_0xf6f4('0x22')])]['status']==='reachable'||this[_0xf6f4('0xb')][util[_0xf6f4('0x5b')](_0xf6f4('0x69'),_0x2bf96f[_0xf6f4('0x22')])][_0xf6f4('0x29')]===_0xf6f4('0x6a'));};Fax['prototype'][_0xf6f4('0x6b')]=function(_0x55bb5a,_0x270b80){if(!this[_0xf6f4('0x66')](_0x55bb5a)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xf6f4('0x67')](_0x55bb5a)?'':_0x55bb5a[_0xf6f4('0x22')]+_0xf6f4('0x6c'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xf6f4('0x67')](_0x270b80[_0xf6f4('0x3a')])){ut[_0xf6f4('0x45')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x270b80));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xf6f4('0x67')](_0x270b80['path'])){ut[_0xf6f4('0x45')](_0xf6f4('0x6d'),JSON[_0xf6f4('0x3e')](_0x270b80));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xf6f4('0x6e')};};module[_0xf6f4('0x6f')]=Fax;
\ No newline at end of file
+var _0x1ea1=['../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','localstationid','pagestransferred','resolution','transferrate','filename','calleridnum','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','Is\x20Valid','lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','fax'];(function(_0x1f3052,_0x145e8c){var _0x3ca339=function(_0x168c3e){while(--_0x168c3e){_0x1f3052['push'](_0x1f3052['shift']());}};_0x3ca339(++_0x145e8c);}(_0x1ea1,0xe2));var _0x11ea=function(_0x29d815,_0xea440){_0x29d815=_0x29d815-0x0;var _0x2e54b1=_0x1ea1[_0x29d815];return _0x2e54b1;};'use strict';var util=require('util');var _=require(_0x11ea('0x0'));var BPromise=require('bluebird');var uuid=require(_0x11ea('0x1'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x11ea('0x2'));var gs=require(_0x11ea('0x3'));var logger=require(_0x11ea('0x4'))(_0x11ea('0x5'));var ami=require(_0x11ea('0x6'));var rpcDb=require(_0x11ea('0x7'));var Channel=require(_0x11ea('0x8'));var ut=require(_0x11ea('0x9'));var Action=require(_0x11ea('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x11ea('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x56e72a){this['channels']={};this[_0x11ea('0xc')]=_0x56e72a[_0x11ea('0xc')];this[_0x11ea('0xd')]=_0x56e72a['trunks'];this['actions']={};ami['on'](_0x11ea('0xe'),this[_0x11ea('0xf')]['bind'](this));ami['on'](_0x11ea('0x10'),this[_0x11ea('0x11')][_0x11ea('0x12')](this));ami['on'](_0x11ea('0x13'),this[_0x11ea('0x14')][_0x11ea('0x12')](this));ami['on'](_0x11ea('0x15'),this[_0x11ea('0x16')][_0x11ea('0x12')](this));ami['on'](_0x11ea('0x17'),this[_0x11ea('0x18')][_0x11ea('0x12')](this));ami['on'](_0x11ea('0x19'),this[_0x11ea('0x1a')][_0x11ea('0x12')](this));ami['on'](_0x11ea('0x1b'),this['syncHangup'][_0x11ea('0x12')](this));ami['on'](_0x11ea('0x1c'),this[_0x11ea('0x1d')][_0x11ea('0x12')](this));}Fax[_0x11ea('0x1e')][_0x11ea('0xf')]=function(_0x2a2851){if(_0x2a2851[_0x11ea('0x1f')]==='from-voip-provider'){for(var _0x2cadc8 in this[_0x11ea('0xc')]){if(this[_0x11ea('0xc')][_0x11ea('0x20')](_0x2cadc8)){if(_0x2a2851[_0x11ea('0x21')]===this['faxAccounts'][_0x2cadc8]['localstationid']){this[_0x11ea('0x22')][_0x2a2851['uniqueid']]={};this['channels'][_0x2a2851[_0x11ea('0x23')]][_0x11ea('0x24')]=_0x2a2851['channel'];this[_0x11ea('0x22')][_0x2a2851[_0x11ea('0x23')]]['id']=this[_0x11ea('0xc')][_0x2cadc8]['id'];this[_0x11ea('0x22')][_0x2a2851[_0x11ea('0x23')]][_0x11ea('0x25')]=this[_0x11ea('0xc')][_0x2cadc8][_0x11ea('0x25')];logger[_0x11ea('0x26')](_0x2a2851['uniqueid'],_0x11ea('0x27'));}}}}if(this[_0x11ea('0x28')][_0x2a2851[_0x11ea('0x23')]]){this[_0x11ea('0x22')][_0x2a2851[_0x11ea('0x23')]]={};this[_0x11ea('0x22')][_0x2a2851[_0x11ea('0x23')]][_0x11ea('0x24')]=_0x2a2851[_0x11ea('0x24')];logger[_0x11ea('0x26')](_0x2a2851[_0x11ea('0x23')],_0x11ea('0x27'));}};Fax[_0x11ea('0x1e')]['syncVarSet']=function(_0x1e3880){if(this[_0x11ea('0x22')][_0x1e3880[_0x11ea('0x23')]]){for(var _0x28291e in _0x1e3880[_0x11ea('0x29')]){if(_0x1e3880['variable'][_0x11ea('0x20')](_0x28291e)){this['channels'][_0x1e3880[_0x11ea('0x23')]][_0x28291e]=_0x1e3880[_0x11ea('0x2a')];}}}};Fax[_0x11ea('0x1e')][_0x11ea('0x14')]=function(_0x37d51f){if(this[_0x11ea('0x22')][_0x37d51f[_0x11ea('0x23')]]){this[_0x11ea('0x22')][_0x37d51f[_0x11ea('0x23')]][_0x11ea('0x2b')]=_0x37d51f[_0x11ea('0x2b')];this[_0x11ea('0x22')][_0x37d51f[_0x11ea('0x23')]][_0x11ea('0x2c')]=_0x37d51f[_0x11ea('0x2c')];}};Fax[_0x11ea('0x1e')][_0x11ea('0x16')]=function(_0x47b12e){if(this[_0x11ea('0x22')][_0x47b12e['uniqueid']]){for(var _0x2d5bc5 in _0x47b12e['variable']){if(_0x47b12e[_0x11ea('0x29')][_0x11ea('0x20')](_0x2d5bc5)){this[_0x11ea('0x22')][_0x47b12e[_0x11ea('0x23')]][_0x2d5bc5]=_0x47b12e[_0x11ea('0x2a')];}}}};Fax[_0x11ea('0x1e')][_0x11ea('0x18')]=function(_0x5ea96d){if(this[_0x11ea('0x22')][_0x5ea96d['uniqueid']]){this[_0x11ea('0x22')][_0x5ea96d[_0x11ea('0x23')]][_0x11ea('0x2d')]=_0x5ea96d[_0x11ea('0x2d')];this['channels'][_0x5ea96d['uniqueid']][_0x11ea('0x2e')]=_0x5ea96d[_0x11ea('0x2e')];this['channels'][_0x5ea96d[_0x11ea('0x23')]][_0x11ea('0x2f')]=_0x5ea96d['localstationid'];this[_0x11ea('0x22')][_0x5ea96d[_0x11ea('0x23')]]['filename']=_0x5ea96d['filename'];logger[_0x11ea('0x26')](_0x5ea96d[_0x11ea('0x23')],'\x20syncFaxStatus\x20');}};Fax['prototype']['syncReceiveFax']=function(_0x908ee6){var _0x5bd378=this;if(this[_0x11ea('0x22')][_0x908ee6[_0x11ea('0x23')]]){var _0xb7a7f0=this[_0x11ea('0x22')][_0x908ee6[_0x11ea('0x23')]]['id'];this[_0x11ea('0x22')][_0x908ee6[_0x11ea('0x23')]]['remotestationid']=_0x908ee6['remotestationid'];this[_0x11ea('0x22')][_0x908ee6[_0x11ea('0x23')]][_0x11ea('0x30')]=_0x908ee6[_0x11ea('0x30')];this[_0x11ea('0x22')][_0x908ee6['uniqueid']][_0x11ea('0x2f')]=_0x908ee6[_0x11ea('0x2f')];this[_0x11ea('0x22')][_0x908ee6[_0x11ea('0x23')]][_0x11ea('0x31')]=_0x908ee6[_0x11ea('0x31')];this['channels'][_0x908ee6['uniqueid']][_0x11ea('0x32')]=_0x908ee6[_0x11ea('0x32')];this[_0x11ea('0x22')][_0x908ee6[_0x11ea('0x23')]][_0x11ea('0x33')]=_0x908ee6[_0x11ea('0x33')];this[_0x11ea('0x22')][_0x908ee6['uniqueid']]['calleridnum']=_0x908ee6[_0x11ea('0x34')];if(this[_0x11ea('0x22')][_0x908ee6['uniqueid']][_0x11ea('0x30')]>0x0){tiff2pdf(_0x908ee6[_0x11ea('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0x886d71){logger[_0x11ea('0x26')](_0x908ee6[_0x11ea('0x23')],'\x20result\x20conversion\x20file\x20',_0x886d71['message']);attachment[_0x11ea('0x35')]({'name':path[_0x11ea('0x36')](_0x908ee6['filename'])[_0x11ea('0x25')],'basename':path[_0x11ea('0x36')](_0x908ee6[_0x11ea('0x33')])['name']+_0x11ea('0x37'),'type':'application/pdf'})['then'](function(_0x202c31){faxAccount[_0x11ea('0x38')](_0xb7a7f0,{'from':_0x908ee6[_0x11ea('0x34')],'mapKey':_0x11ea('0x5'),'body':path[_0x11ea('0x36')](_0x908ee6[_0x11ea('0x33')])['name']+'.pdf','AttachmentId':_0x202c31['id']})[_0x11ea('0x39')](function(_0x187824){logger[_0x11ea('0x3a')](_0x908ee6[_0x11ea('0x23')],_0x11ea('0x3b'),JSON[_0x11ea('0x3c')](_0x187824));});})[_0x11ea('0x39')](function(_0x271788){logger[_0x11ea('0x3a')](_0x908ee6[_0x11ea('0x23')],_0x11ea('0x3d'),JSON[_0x11ea('0x3c')](_0x271788));});});}logger[_0x11ea('0x26')](_0x908ee6[_0x11ea('0x23')],_0x11ea('0x3d'));}};Fax['prototype'][_0x11ea('0x1d')]=function(_0x526594){if(this[_0x11ea('0x28')][_0x526594['uniqueid']]){_[_0x11ea('0x3e')](this['channels'][_0x526594['uniqueid']],_['pick'](_0x526594,[_0x11ea('0x3f'),'reason']));}};function updateStatus(_0x137fe5){if(_0x137fe5['AttachmentId']){faxMessage[_0x11ea('0x40')](_0x137fe5[_0x11ea('0x41')],{'failMessage':_0x11ea('0x42')})[_0x11ea('0x43')](function(_0x4c1108){ut[_0x11ea('0x44')](_0x11ea('0x45'),_0x4c1108);})['catch'](function(_0x89a078){ut['logger'](_0x11ea('0x46'),_0x89a078);});}else{ut['logger'](_0x11ea('0x47'));}}Fax[_0x11ea('0x1e')][_0x11ea('0x48')]=function(_0x2dc2e3,_0x403053,_0x34affc){var _0x1a8073=this;var _0x43bfbe={};if(_0x403053){_0x43bfbe={'read':_0x403053};}else{_0x43bfbe={'failMessage':_0x34affc};}if(this[_0x11ea('0x28')][_0x2dc2e3]['AttachmentId']){faxMessage['update'](this[_0x11ea('0x28')][_0x2dc2e3][_0x11ea('0x41')],_0x43bfbe)[_0x11ea('0x43')](function(_0x11c302){ut[_0x11ea('0x44')](_0x11ea('0x49'),_0x11c302);})[_0x11ea('0x39')](function(_0x34a3ee){ut[_0x11ea('0x44')](_0x11ea('0x4a'),_0x34a3ee);})[_0x11ea('0x4b')](function(){delete _0x1a8073[_0x11ea('0x22')][_0x2dc2e3];delete _0x1a8073[_0x11ea('0x28')][_0x2dc2e3];});}else{ut[_0x11ea('0x44')](_0x11ea('0x4c'));delete this[_0x11ea('0x22')][_0x2dc2e3];delete this[_0x11ea('0x28')][_0x2dc2e3];}};Fax[_0x11ea('0x1e')][_0x11ea('0x4d')]=function(_0x4575a1){var _0x47a6ed=this;if(this[_0x11ea('0x22')][_0x4575a1['uniqueid']]){if(this[_0x11ea('0x28')][_0x4575a1[_0x11ea('0x23')]]){this[_0x11ea('0x22')][_0x4575a1[_0x11ea('0x23')]]['id']=this['actions'][_0x4575a1['uniqueid']]['id'];this[_0x11ea('0x22')][_0x4575a1[_0x11ea('0x23')]]['name']=this[_0x11ea('0x28')][_0x4575a1[_0x11ea('0x23')]]['name'];}logger['info'](_0x4575a1['uniqueid'],this[_0x11ea('0x28')][_0x4575a1[_0x11ea('0x23')]]?'\x20hangup\x20sendFile\x20':_0x11ea('0x4e'),JSON[_0x11ea('0x3c')](this['channels'][_0x4575a1[_0x11ea('0x23')]]));if(this[_0x11ea('0x28')][_0x4575a1[_0x11ea('0x23')]]){if(this['channels'][_0x4575a1[_0x11ea('0x23')]][_0x11ea('0x4f')]>0x0&&this[_0x11ea('0x22')][_0x4575a1[_0x11ea('0x23')]]['faxstatus']===_0x11ea('0x50')){this[_0x11ea('0x48')](_0x4575a1[_0x11ea('0x23')],!![]);}else{this[_0x11ea('0x48')](_0x4575a1[_0x11ea('0x23')],![],this[_0x11ea('0x22')][_0x4575a1['uniqueid']][_0x11ea('0x51')]?_0x11ea('0x52')+this[_0x11ea('0x22')][_0x4575a1[_0x11ea('0x23')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x11ea('0x1e')][_0x11ea('0x53')]=function(_0x2a8b56){var _0x8a0c79=this;return new BPromise(function(_0x14c372,_0x2e34d1){_0x8a0c79[_0x11ea('0x54')](_0x2a8b56,_0x8a0c79[_0x11ea('0xc')][_0x2a8b56['FaxAccountId']])['then'](function(_0xc4fffe){ut[_0x11ea('0x44')](_0x11ea('0x55'),_0xc4fffe);_0x14c372(ut[_0x11ea('0x56')](_0x11ea('0x57')));})[_0x11ea('0x39')](function(_0x582e75){ut[_0x11ea('0x44')](_0x11ea('0x58'),_0x582e75);updateStatus(_0x2a8b56);_0x2e34d1(ut['message'](_0x11ea('0x59')));});});};Fax[_0x11ea('0x1e')][_0x11ea('0x5a')]=function(_0x120660){var _0x9d1b8f=this;return new BPromise(function(_0x4939d3,_0x56b0e3){var _0x3130e9=_0x9d1b8f[_0x11ea('0x5b')](_0x9d1b8f[_0x11ea('0xc')][_0x120660[_0x11ea('0x5c')]][_0x11ea('0x5d')],_0x120660);if(_0x3130e9['isValid']){_0x4939d3(ut[_0x11ea('0x56')]('Trunk\x20Reachable'));}else{_0x56b0e3(ut[_0x11ea('0x56')](_0x3130e9[_0x11ea('0x56')]));}});};function originate(_0x417dcd,_0x40eaae,_0x1ca6e1){return new BPromise(function(_0x2fe8b4,_0x1a96e5){if(_0x1ca6e1){var _0x479755=util[_0x11ea('0x5e')](_0x11ea('0x5f'),path[_0x11ea('0x36')](_0x417dcd[_0x11ea('0x60')])[_0x11ea('0x25')],_0x417dcd[_0x11ea('0x60')]);gs[_0x11ea('0x61')](_0x479755)[_0x11ea('0x43')](function(){_0x417dcd['path']=util['format'](_0x11ea('0x62'),path[_0x11ea('0x36')](_0x417dcd[_0x11ea('0x60')])[_0x11ea('0x63')],path['parse'](_0x417dcd[_0x11ea('0x60')])[_0x11ea('0x25')]);_0x40eaae[_0x11ea('0x64')]=_0x417dcd['path'];ut[_0x11ea('0x44')](_0x11ea('0x65'),'');ami[_0x11ea('0x66')](ut[_0x11ea('0x67')](_0x417dcd,_0x40eaae))[_0x11ea('0x43')](function(_0x2dd48a){_0x2fe8b4(_0x2dd48a);})[_0x11ea('0x39')](function(_0x19ff5c){_0x1a96e5(_0x19ff5c);});})[_0x11ea('0x39')](function(_0x45a577){_0x1a96e5(_0x45a577);});}else{ami[_0x11ea('0x66')](ut['variablesAction'](_0x417dcd,_0x40eaae))['then'](function(_0xb87438){_0x2fe8b4(_0xb87438);})[_0x11ea('0x39')](function(_0x4169ce){_0x1a96e5(_0x4169ce);});}});}Fax['prototype']['execOriginate']=function(_0x1a9ee7,_0x235180){var _0x6ff305=this;return new BPromise(function(_0x4407ec,_0x18ad0d){var _0x18f436=uuid['v4']();var _0x1358e7=ut[_0x11ea('0x68')](_0x1a9ee7,_0x235180);_0x6ff305[_0x11ea('0x28')][_0x18f436]=new Action(_0x18f436,_0x235180,_0x1a9ee7);var _0x5cce87=_0x6ff305[_0x11ea('0x28')][_0x18f436];if(path['parse'](_0x1a9ee7[_0x11ea('0x60')])[_0x11ea('0x69')]==='.pdf'){originate(_0x5cce87,_0x1358e7,!![])[_0x11ea('0x43')](function(_0x44fd35){_0x4407ec(_0x44fd35);})['catch'](function(_0x4d52a5){_0x18ad0d(_0x4d52a5);});}else{originate(_0x5cce87,_0x1358e7,![])[_0x11ea('0x43')](function(_0x134324){_0x4407ec(_0x134324);})['catch'](function(_0x25ed7a){_0x18ad0d(_0x25ed7a);});}});};Fax[_0x11ea('0x1e')][_0x11ea('0x6a')]=function(_0x44e3bf){return!_['isNil'](_0x44e3bf)&&!_[_0x11ea('0x6b')](_0x44e3bf['name'])&&!_[_0x11ea('0x6b')](_0x44e3bf[_0x11ea('0x6c')])&&_0x44e3bf['active']&&!_[_0x11ea('0x6b')](this[_0x11ea('0xd')][util['format']('SIP/%s',_0x44e3bf['name'])])&&!_[_0x11ea('0x6b')](this['trunks'][util[_0x11ea('0x5e')](_0x11ea('0x6d'),_0x44e3bf[_0x11ea('0x25')])][_0x11ea('0x2e')])&&(this[_0x11ea('0xd')][util[_0x11ea('0x5e')](_0x11ea('0x6d'),_0x44e3bf[_0x11ea('0x25')])][_0x11ea('0x2e')]==='reachable'||this[_0x11ea('0xd')][util[_0x11ea('0x5e')]('SIP/%s',_0x44e3bf[_0x11ea('0x25')])][_0x11ea('0x2e')]==='unmonitored');};Fax[_0x11ea('0x1e')]['checkTrunk']=function(_0x41a425,_0x33530a){if(!this[_0x11ea('0x6a')](_0x41a425)){ut[_0x11ea('0x44')](_0x11ea('0x6e'),_['isNil'](_0x41a425)?'':_0x41a425[_0x11ea('0x25')]+_0x11ea('0x6f'));return{'isValid':![],'message':_0x11ea('0x70')};}if(_[_0x11ea('0x6b')](_0x33530a[_0x11ea('0x5')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x11ea('0x3c')](_0x33530a));return{'isValid':![],'message':_0x11ea('0x71')};}if(_['isNil'](_0x33530a['path'])){ut[_0x11ea('0x44')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x33530a));return{'isValid':![],'message':_0x11ea('0x72')};}return{'isValid':!![],'message':_0x11ea('0x73')};};module['exports']=Fax;
\ No newline at end of file
index f9ad70d..087bb18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['preview','lodash','../rpc/faxAccount','error','notify','resolve','catch','util'];(function(_0x149f22,_0x4af198){var _0x5a6c05=function(_0x5bf312){while(--_0x5bf312){_0x149f22['push'](_0x149f22['shift']());}};_0x5a6c05(++_0x4af198);}(_0x7880,0x147));var _0x0788=function(_0x22d2ff,_0x56a793){_0x22d2ff=_0x22d2ff-0x0;var _0x4a50b6=_0x7880[_0x22d2ff];return _0x4a50b6;};'use strict';var util=require(_0x0788('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x0788('0x1'));var _=require(_0x0788('0x2'));var faxAccount=require(_0x0788('0x3'));function loggerCatch(_0x400ea8){return function(_0x786f9b){logger[_0x0788('0x4')](_0x400ea8,util['inspect'](_0x786f9b,{'showHidden':![],'depth':null}));};}exports[_0x0788('0x5')]=function(_0x2b0db8,_0x4b3288){return BPromise[_0x0788('0x6')]()['then'](faxAccount['notify'](_0x2b0db8,_0x4b3288))[_0x0788('0x7')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x16c6=['inspect','notify','catch','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x45fb76,_0x35fd5d){var _0x338556=function(_0x526a58){while(--_0x526a58){_0x45fb76['push'](_0x45fb76['shift']());}};_0x338556(++_0x35fd5d);}(_0x16c6,0xc1));var _0x616c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x16c6[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x616c('0x0'));var BPromise=require(_0x616c('0x1'));var logger=require(_0x616c('0x2'))(_0x616c('0x3'));var _=require(_0x616c('0x4'));var faxAccount=require(_0x616c('0x5'));function loggerCatch(_0x41be78){return function(_0x5f1676){logger[_0x616c('0x6')](_0x41be78,util[_0x616c('0x7')](_0x5f1676,{'showHidden':![],'depth':null}));};}exports[_0x616c('0x8')]=function(_0x3eca2d,_0x28a10b){return BPromise['resolve']()['then'](faxAccount[_0x616c('0x8')](_0x3eca2d,_0x28a10b))[_0x616c('0x9')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index 250fe75..f9a8368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15ed=['fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x15ed,0x8f));var _0xd15e=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x15ed[_0x5e709a];return _0x57401a;};'use strict';var util=require('util');var logger=require(_0xd15e('0x0'))(_0xd15e('0x1'));var BPromise=require(_0xd15e('0x2'));var exec=require(_0xd15e('0x3'))['exec'];exports[_0xd15e('0x4')]=function(_0x5edbeb){return new BPromise(function(_0x55fe21,_0x5651f4){exec(_0x5edbeb,function(_0x5e4fc1,_0x4e0fcc,_0x3538db){logger[_0xd15e('0x5')]('Exec\x20gs',_0x4e0fcc);if(_0x5e4fc1){logger[_0xd15e('0x5')](_0xd15e('0x6'),_0xd15e('0x7'),util[_0xd15e('0x8')](_0x5e4fc1,{'showHidden':![],'depth':null}),_0x4e0fcc,_0x3538db);_0x5651f4(_0x5e4fc1);}_0x55fe21(_0x4e0fcc);});});};
\ No newline at end of file
+var _0x7b23=['exec','execute','info','Exec\x20gs','inspect','util','../../../../config/logger','bluebird','child_process'];(function(_0x4c7a41,_0x18da94){var _0x3b6b86=function(_0xd9c01b){while(--_0xd9c01b){_0x4c7a41['push'](_0x4c7a41['shift']());}};_0x3b6b86(++_0x18da94);}(_0x7b23,0x149));var _0x37b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7b23[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x37b2('0x0'));var logger=require(_0x37b2('0x1'))('fax');var BPromise=require(_0x37b2('0x2'));var exec=require(_0x37b2('0x3'))[_0x37b2('0x4')];exports[_0x37b2('0x5')]=function(_0x5ace70){return new BPromise(function(_0x16489c,_0x69a02){exec(_0x5ace70,function(_0xc6d98e,_0x1d6593,_0x1cd1a0){logger[_0x37b2('0x6')](_0x37b2('0x7'),_0x1d6593);if(_0xc6d98e){logger[_0x37b2('0x6')](_0x37b2('0x7'),'\x20Error\x20:',util[_0x37b2('0x8')](_0xc6d98e,{'showHidden':![],'depth':null}),_0x1d6593,_0x1cd1a0);_0x69a02(_0xc6d98e);}_0x16489c(_0x1d6593);});});};
\ No newline at end of file
index fdcec30..89093ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cd9=['addVariables','minrate','maxrate','\x22%s\x22','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','message','logger','inspect'];(function(_0x350203,_0xcef80b){var _0x1481bc=function(_0x1a6ec0){while(--_0x1a6ec0){_0x350203['push'](_0x350203['shift']());}};_0x1481bc(++_0xcef80b);}(_0x8cd9,0x1c7));var _0x98cd=function(_0x429e92,_0x5be6b9){_0x429e92=_0x429e92-0x0;var _0x32c5e7=_0x8cd9[_0x429e92];return _0x32c5e7;};'use strict';var util=require(_0x98cd('0x0'));var _=require(_0x98cd('0x1'));var moment=require(_0x98cd('0x2'));var logger=require(_0x98cd('0x3'))('fax');exports[_0x98cd('0x4')]=function(_0x363408){return{'message':_0x363408};};exports[_0x98cd('0x5')]=function(_0x927fd8,_0x14bfd7){logger['info'](_0x927fd8,util[_0x98cd('0x6')](_0x14bfd7,{'showHidden':![],'depth':null}));};exports[_0x98cd('0x7')]=function(_0x589bbd,_0x5a557e){var _0x1499da={'XMF-ECM':_0x5a557e['ecm'],'XMF-HEADERINFO':_0x5a557e['headerinfo'],'XMF-MINRATE':_0x5a557e[_0x98cd('0x8')],'XMF-MAXRATE':_0x5a557e[_0x98cd('0x9')],'XMF-MODEM':util['format'](_0x98cd('0xa'),_0x5a557e['modem']),'XMF-GATEWAY':_0x5a557e[_0x98cd('0xb')],'XMF-FAXDETECT':_0x5a557e[_0x98cd('0xc')],'XMF-T38TIMEOUT':_0x5a557e['t38timeout'],'XMF-LOCALSTATIONID':_0x5a557e[_0x98cd('0xd')],'XMF-PATH':_0x589bbd[_0x98cd('0xe')]};return _0x1499da;};exports[_0x98cd('0xf')]=function(_0x385b6b,_0x2ac399){return{'actionid':_0x385b6b[_0x98cd('0x10')],'action':_0x98cd('0x11'),'channel':_0x385b6b[_0x98cd('0x12')],'Exten':_0x98cd('0x13'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x98cd('0x14'),_0x385b6b['headerinfo']?_0x385b6b[_0x98cd('0x15')]:'',_0x385b6b[_0x98cd('0xd')]),'variable':_0x2ac399,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x385b6b[_0x98cd('0x10')]};};
\ No newline at end of file
+var _0xdfdf=['xcally-motion-fax','from-sip','format','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','path','variablesAction','uniqueid','originate','channel'];(function(_0x411069,_0x16ae05){var _0x68c645=function(_0x55d1c8){while(--_0x55d1c8){_0x411069['push'](_0x411069['shift']());}};_0x68c645(++_0x16ae05);}(_0xdfdf,0x1b8));var _0xfdfd=function(_0x279b5a,_0x57cf37){_0x279b5a=_0x279b5a-0x0;var _0x2eb11c=_0xdfdf[_0x279b5a];return _0x2eb11c;};'use strict';var util=require(_0xfdfd('0x0'));var _=require(_0xfdfd('0x1'));var moment=require(_0xfdfd('0x2'));var logger=require(_0xfdfd('0x3'))(_0xfdfd('0x4'));exports[_0xfdfd('0x5')]=function(_0xfb4f9){return{'message':_0xfb4f9};};exports[_0xfdfd('0x6')]=function(_0x15ad6d,_0x2c020f){logger[_0xfdfd('0x7')](_0x15ad6d,util['inspect'](_0x2c020f,{'showHidden':![],'depth':null}));};exports[_0xfdfd('0x8')]=function(_0x48a5b0,_0x3d78b4){var _0x59e2b8={'XMF-ECM':_0x3d78b4['ecm'],'XMF-HEADERINFO':_0x3d78b4[_0xfdfd('0x9')],'XMF-MINRATE':_0x3d78b4[_0xfdfd('0xa')],'XMF-MAXRATE':_0x3d78b4[_0xfdfd('0xb')],'XMF-MODEM':util['format'](_0xfdfd('0xc'),_0x3d78b4[_0xfdfd('0xd')]),'XMF-GATEWAY':_0x3d78b4['gateway'],'XMF-FAXDETECT':_0x3d78b4[_0xfdfd('0xe')],'XMF-T38TIMEOUT':_0x3d78b4['t38timeout'],'XMF-LOCALSTATIONID':_0x3d78b4['localstationid'],'XMF-PATH':_0x48a5b0[_0xfdfd('0xf')]};return _0x59e2b8;};exports[_0xfdfd('0x10')]=function(_0x1ab3d8,_0x2fa335){return{'actionid':_0x1ab3d8[_0xfdfd('0x11')],'action':_0xfdfd('0x12'),'channel':_0x1ab3d8[_0xfdfd('0x13')],'Exten':_0xfdfd('0x14'),'Context':_0xfdfd('0x15'),'Priority':'1','callerid':util[_0xfdfd('0x16')]('\x22%s\x22\x20<%s>',_0x1ab3d8[_0xfdfd('0x9')]?_0x1ab3d8[_0xfdfd('0x9')]:'',_0x1ab3d8['localstationid']),'variable':_0x2fa335,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1ab3d8[_0xfdfd('0x11')]};};
\ No newline at end of file
index 3732385..cfe3f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fe9=['getAgents','initAgents','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./realtime','./report','./trigger','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','resolve'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x6fe9,0x1cf));var _0x96fe=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x6fe9[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require(_0x96fe('0x0'));var moment=require(_0x96fe('0x1'));var server=require('./server');var Realtime=require(_0x96fe('0x2'));var Report=require(_0x96fe('0x3'));var Acw=require('./acw');var Trigger=require(_0x96fe('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x96fe('0x5'));var user=require(_0x96fe('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x96fe('0x7'));var voiceCallReport=require(_0x96fe('0x8'));var trunk=require(_0x96fe('0x9'));var trigger=require(_0x96fe('0xa'));var template=require(_0x96fe('0xb'));var cmHopperHistory=require(_0x96fe('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x96fe('0xd'));var faxAccount=require(_0x96fe('0xe'));var zendesk=require(_0x96fe('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x96fe('0x10'));var freshdesk=require(_0x96fe('0x11'));var desk=require(_0x96fe('0x12'));var zoho=require(_0x96fe('0x13'));var vtiger=require(_0x96fe('0x14'));var freshsales=require(_0x96fe('0x15'));var servicenow=require(_0x96fe('0x16'));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('../../config/logger')(_0x96fe('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x96fe('0x18')](_0x96fe('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x96fe('0x1a')]()['then'](user[_0x96fe('0x1b')]())['then'](realtime[_0x96fe('0x1c')]())[_0x96fe('0x1d')](user[_0x96fe('0x1e')]())['then'](realtime['initTelephones']())[_0x96fe('0x1d')](trunk['getTrunks']())[_0x96fe('0x1d')](realtime[_0x96fe('0x1f')]())[_0x96fe('0x1d')](voiceQueue[_0x96fe('0x20')]())['then'](realtime[_0x96fe('0x21')]())[_0x96fe('0x1d')](trigger[_0x96fe('0x22')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x23')]())[_0x96fe('0x1d')](template[_0x96fe('0x24')]())['then'](realtime[_0x96fe('0x25')]())['then'](zendesk[_0x96fe('0x26')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x27')]())[_0x96fe('0x1d')](salesforce[_0x96fe('0x28')]())[_0x96fe('0x1d')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x96fe('0x29')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x2a')]())[_0x96fe('0x1d')](freshdesk[_0x96fe('0x2b')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x2c')]())[_0x96fe('0x1d')](desk[_0x96fe('0x2d')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x2e')]())[_0x96fe('0x1d')](zoho['getZohoAccounts']())['then'](realtime[_0x96fe('0x2f')]())['then'](vtiger[_0x96fe('0x30')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x31')]())[_0x96fe('0x1d')](freshsales[_0x96fe('0x32')]())['then'](realtime[_0x96fe('0x33')]())[_0x96fe('0x1d')](servicenow['getServicenowAccounts']())[_0x96fe('0x1d')](realtime['initServicenowAccounts']())[_0x96fe('0x1d')](dynamics365['getDynamics365Accounts']())[_0x96fe('0x1d')](realtime['initDynamics365Accounts']())[_0x96fe('0x1d')](campaign[_0x96fe('0x34')]())[_0x96fe('0x1d')](realtime['initCampaigns']())[_0x96fe('0x1d')](voiceExtension[_0x96fe('0x35')]())[_0x96fe('0x1d')](realtime['initVoiceExtensions']())[_0x96fe('0x1d')](faxAccount[_0x96fe('0x36')]())['then'](realtime[_0x96fe('0x37')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x96fe('0x1a')]()[_0x96fe('0x1d')](voiceQueueReport[_0x96fe('0x38')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x39')]())['then'](cmHopperHistory[_0x96fe('0x3a')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x3b')]())['then'](cmHopperHistory[_0x96fe('0x3c')]())[_0x96fe('0x1d')](realtime[_0x96fe('0x3d')]())[_0x96fe('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x96fe('0x1d')](realtime[_0x96fe('0x3e')]())[_0x96fe('0x3f')](function(_0xbba550){logger[_0x96fe('0x40')](_0x96fe('0x41'),util[_0x96fe('0x42')](_0xbba550,{'showHidden':![],'depth':null}));});}function main(){return server[_0x96fe('0x43')](realtime,preview,fax)[_0x96fe('0x1d')](function(){return initRealtime();})[_0x96fe('0x1d')](function(){return initParams();})[_0x96fe('0x1d')](function(){report[_0x96fe('0x44')]();setInterval(initRealtime,0x1388);})[_0x96fe('0x3f')](function(_0x37d777){logger[_0x96fe('0x40')](_0x96fe('0x45'),util['inspect'](_0x37d777,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0xa662=['initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','util','./server','./realtime','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','then','getAgents','initAgents'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa662,0xb6));var _0x2a66=function(_0x445c78,_0x3254ea){_0x445c78=_0x445c78-0x0;var _0x3f43f2=_0xa662[_0x445c78];return _0x3f43f2;};'use strict';var util=require(_0x2a66('0x0'));var moment=require('moment');var server=require(_0x2a66('0x1'));var Realtime=require(_0x2a66('0x2'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x2a66('0x3'));var Dialer=require(_0x2a66('0x4'));var Preview=require('./preview');var Fax=require(_0x2a66('0x5'));var user=require(_0x2a66('0x6'));var voiceQueue=require(_0x2a66('0x7'));var voiceQueueReport=require(_0x2a66('0x8'));var voiceCallReport=require(_0x2a66('0x9'));var trunk=require(_0x2a66('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x2a66('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x2a66('0xc'));var voiceExtension=require(_0x2a66('0xd'));var faxAccount=require(_0x2a66('0xe'));var zendesk=require(_0x2a66('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x2a66('0x10'));var freshdesk=require(_0x2a66('0x11'));var desk=require(_0x2a66('0x12'));var zoho=require(_0x2a66('0x13'));var vtiger=require(_0x2a66('0x14'));var freshsales=require(_0x2a66('0x15'));var servicenow=require(_0x2a66('0x16'));var dynamics365=require(_0x2a66('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x2a66('0x18'))(_0x2a66('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x2a66('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2a66('0x1b')](_0x2a66('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x2a66('0x1c')](user[_0x2a66('0x1d')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x1e')]())[_0x2a66('0x1c')](user['getTelephones']())[_0x2a66('0x1c')](realtime[_0x2a66('0x1f')]())[_0x2a66('0x1c')](trunk['getTrunks']())[_0x2a66('0x1c')](realtime[_0x2a66('0x20')]())['then'](voiceQueue[_0x2a66('0x21')]())['then'](realtime[_0x2a66('0x22')]())[_0x2a66('0x1c')](trigger[_0x2a66('0x23')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x24')]())['then'](template[_0x2a66('0x25')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x26')]())[_0x2a66('0x1c')](zendesk['getZendeskAccounts']())['then'](realtime[_0x2a66('0x27')]())[_0x2a66('0x1c')](salesforce['getSalesforceAccounts']())[_0x2a66('0x1c')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x2a66('0x28')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x29')]())[_0x2a66('0x1c')](freshdesk[_0x2a66('0x2a')]())[_0x2a66('0x1c')](realtime['initFreshdeskAccounts']())[_0x2a66('0x1c')](desk[_0x2a66('0x2b')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x2c')]())[_0x2a66('0x1c')](zoho[_0x2a66('0x2d')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x2e')]())[_0x2a66('0x1c')](vtiger[_0x2a66('0x2f')]())[_0x2a66('0x1c')](realtime['initVtigerAccounts']())[_0x2a66('0x1c')](freshsales['getFreshsalesAccounts']())[_0x2a66('0x1c')](realtime['initFreshsalesAccounts']())[_0x2a66('0x1c')](servicenow[_0x2a66('0x30')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x31')]())['then'](dynamics365[_0x2a66('0x32')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x33')]())['then'](campaign[_0x2a66('0x34')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x35')]())[_0x2a66('0x1c')](voiceExtension[_0x2a66('0x36')]())['then'](realtime[_0x2a66('0x37')]())['then'](faxAccount[_0x2a66('0x38')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x39')]())[_0x2a66('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x2a66('0x3a')]()[_0x2a66('0x1c')](voiceQueueReport[_0x2a66('0x3b')]())['then'](realtime[_0x2a66('0x3c')]())[_0x2a66('0x1c')](cmHopperHistory[_0x2a66('0x3d')]())['then'](realtime[_0x2a66('0x3e')]())['then'](cmHopperHistory[_0x2a66('0x3f')]())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x2a66('0x40')]())[_0x2a66('0x1c')](realtime[_0x2a66('0x41')]())[_0x2a66('0x42')](function(_0x496c01){logger[_0x2a66('0x43')]('[index.js][initParams]',util[_0x2a66('0x44')](_0x496c01,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2a66('0x45')](realtime,preview,fax)[_0x2a66('0x1c')](function(){return initRealtime();})[_0x2a66('0x1c')](function(){return initParams();})[_0x2a66('0x1c')](function(){report[_0x2a66('0x46')]();setInterval(initRealtime,0x1388);})[_0x2a66('0x42')](function(_0x2e49f5){logger[_0x2a66('0x43')]('[index.js][main]',util['inspect'](_0x2e49f5,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index d56a3d2..c03dae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd5=['state','unknown','status','address','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','stateTime','stringify','user:%s','emit','user:presence','exports','lodash','util','moment','md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname'];(function(_0x9f4964,_0x8ad523){var _0x6f7f9a=function(_0x51e5d4){while(--_0x51e5d4){_0x9f4964['push'](_0x9f4964['shift']());}};_0x6f7f9a(++_0x8ad523);}(_0x4fd5,0x13b));var _0x54fd=function(_0x196f42,_0x4c7bb0){_0x196f42=_0x196f42-0x0;var _0x420714=_0x4fd5[_0x196f42];return _0x420714;};'use strict';var _=require(_0x54fd('0x0'));var util=require(_0x54fd('0x1'));var moment=require(_0x54fd('0x2'));var md5=require(_0x54fd('0x3'));var Redis=require(_0x54fd('0x4'));var config=require('../../../config/environment');config['redis']=_[_0x54fd('0x5')](config[_0x54fd('0x6')],{'host':_0x54fd('0x7'),'port':0x18eb});var io=require(_0x54fd('0x8'))(new Redis(config[_0x54fd('0x6')]));function Agent(_0x2d06c5){this['id']=_0x2d06c5['id']||0x0;this[_0x54fd('0x9')]=_0x2d06c5[_0x54fd('0x9')]||'';this[_0x54fd('0xa')]=_0x2d06c5[_0x54fd('0xa')]||'';this[_0x54fd('0xb')]=_0x2d06c5[_0x54fd('0xb')]||'';this[_0x54fd('0xc')]=_0x2d06c5[_0x54fd('0xc')]||'';this[_0x54fd('0xd')]=_0x54fd('0xe');this['stateTime']=0x0;this[_0x54fd('0xf')]=_0x54fd('0xe');this[_0x54fd('0x10')]='';this[_0x54fd('0x11')]='';this['mobile']='';this[_0x54fd('0x12')]='';this[_0x54fd('0x13')]=_0x2d06c5[_0x54fd('0x13')]||![];this[_0x54fd('0x14')]=_0x54fd('0xe');this[_0x54fd('0x15')]=0x0;this[_0x54fd('0x16')]='';this[_0x54fd('0x17')]='';this[_0x54fd('0x18')]=![];this[_0x54fd('0x19')]=![];this['md5']='';}Agent[_0x54fd('0x1a')][_0x54fd('0x1b')]=function(_0x11cdb0){var _0x1633ae;if(_0x11cdb0&&_0x11cdb0[_0x54fd('0xd')]){_0x1633ae=_0x11cdb0[_0x54fd('0xd')][_0x54fd('0x1c')]();switch(_0x1633ae){case _0x54fd('0x1d'):_0x1633ae=_0x54fd('0x1e');break;case'inuse':_0x1633ae=_0x54fd('0x1f');break;}}if(_0x1633ae&&this[_0x54fd('0x14')]!==_0x1633ae||_0x11cdb0[_0x54fd('0x20')]){this[_0x54fd('0x15')]=_[_0x54fd('0x21')](moment()[_0x54fd('0x22')]('x'));}if(_0x1633ae){this[_0x54fd('0x14')]=_0x1633ae;}var _0x3acb47={'id':this['id'],'name':this[_0x54fd('0x9')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x54fd('0xc')],'state':this['state'],'stateTime':this[_0x54fd('0x23')],'status':this[_0x54fd('0xf')],'address':this[_0x54fd('0x10')],'online':this[_0x54fd('0x13')],'voiceStatus':this[_0x54fd('0x14')],'voiceStatusTime':this[_0x54fd('0x15')],'voiceStatusCallerIdNumber':this[_0x54fd('0x16')],'voiceStatusQueue':this[_0x54fd('0x17')],'interface':this[_0x54fd('0x12')],'onhold':this[_0x54fd('0x18')]};var _0x50348d=md5(JSON[_0x54fd('0x24')](_0x3acb47));if(this['md5']!==_0x50348d){this[_0x54fd('0x3')]=_0x50348d;io['to'](util[_0x54fd('0x22')](_0x54fd('0x25'),_0x3acb47[_0x54fd('0x9')]))[_0x54fd('0x26')]('user:save',_0x3acb47);io[_0x54fd('0x26')](_0x54fd('0x27'),_0x3acb47);}};module[_0x54fd('0x28')]=Agent;
\ No newline at end of file
+var _0x648e=['mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','statePause','format','stateTime','stringify','emit','lodash','util','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','address','phone'];(function(_0x169089,_0x423d29){var _0x26a4a8=function(_0x17c844){while(--_0x17c844){_0x169089['push'](_0x169089['shift']());}};_0x26a4a8(++_0x423d29);}(_0x648e,0xa3));var _0xe648=function(_0x4f8aef,_0x38a6a6){_0x4f8aef=_0x4f8aef-0x0;var _0x315bc2=_0x648e[_0x4f8aef];return _0x315bc2;};'use strict';var _=require(_0xe648('0x0'));var util=require(_0xe648('0x1'));var moment=require('moment');var md5=require(_0xe648('0x2'));var Redis=require('ioredis');var config=require(_0xe648('0x3'));config[_0xe648('0x4')]=_[_0xe648('0x5')](config[_0xe648('0x4')],{'host':_0xe648('0x6'),'port':0x18eb});var io=require(_0xe648('0x7'))(new Redis(config[_0xe648('0x4')]));function Agent(_0x385ad9){this['id']=_0x385ad9['id']||0x0;this[_0xe648('0x8')]=_0x385ad9[_0xe648('0x8')]||'';this[_0xe648('0x9')]=_0x385ad9[_0xe648('0x9')]||'';this[_0xe648('0xa')]=_0x385ad9[_0xe648('0xa')]||'';this[_0xe648('0xb')]=_0x385ad9['fullname']||'';this[_0xe648('0xc')]=_0xe648('0xd');this['stateTime']=0x0;this[_0xe648('0xe')]='unknown';this[_0xe648('0xf')]='';this[_0xe648('0x10')]='';this[_0xe648('0x11')]='';this[_0xe648('0x12')]='';this[_0xe648('0x13')]=_0x385ad9[_0xe648('0x13')]||![];this[_0xe648('0x14')]=_0xe648('0xd');this[_0xe648('0x15')]=0x0;this[_0xe648('0x16')]='';this[_0xe648('0x17')]='';this['onhold']=![];this[_0xe648('0x18')]=![];this[_0xe648('0x2')]='';}Agent[_0xe648('0x19')][_0xe648('0x1a')]=function(_0x12bb7e){var _0x8b33a1;if(_0x12bb7e&&_0x12bb7e[_0xe648('0xc')]){_0x8b33a1=_0x12bb7e[_0xe648('0xc')][_0xe648('0x1b')]();switch(_0x8b33a1){case _0xe648('0x1c'):_0x8b33a1=_0xe648('0x1d');break;case _0xe648('0x1e'):_0x8b33a1='talking';break;}}if(_0x8b33a1&&this[_0xe648('0x14')]!==_0x8b33a1||_0x12bb7e[_0xe648('0x1f')]){this[_0xe648('0x15')]=_['toNumber'](moment()[_0xe648('0x20')]('x'));}if(_0x8b33a1){this[_0xe648('0x14')]=_0x8b33a1;}var _0x5a6063={'id':this['id'],'name':this[_0xe648('0x8')],'email':this[_0xe648('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xe648('0xb')],'state':this[_0xe648('0xc')],'stateTime':this[_0xe648('0x21')],'status':this[_0xe648('0xe')],'address':this[_0xe648('0xf')],'online':this[_0xe648('0x13')],'voiceStatus':this[_0xe648('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xe648('0x16')],'voiceStatusQueue':this[_0xe648('0x17')],'interface':this[_0xe648('0x12')],'onhold':this['onhold']};var _0x78b2db=md5(JSON[_0xe648('0x22')](_0x5a6063));if(this[_0xe648('0x2')]!==_0x78b2db){this[_0xe648('0x2')]=_0x78b2db;io['to'](util[_0xe648('0x20')]('user:%s',_0x5a6063[_0xe648('0x8')]))[_0xe648('0x23')]('user:save',_0x5a6063);io['emit']('user:presence',_0x5a6063);}};module['exports']=Agent;
\ No newline at end of file
index e7377b1..0cb648e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc126=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xc126,0x1e7));var _0x6c12=function(_0x3641c8,_0x40efaa){_0x3641c8=_0x3641c8-0x0;var _0x587558=_0xc126[_0x3641c8];return _0x587558;};'use strict';function Campaign(_0x5385ba){this['id']=_0x5385ba['id']||0x0;this[_0x6c12('0x0')]=_0x5385ba[_0x6c12('0x0')]||'';this[_0x6c12('0x1')]=_0x5385ba[_0x6c12('0x1')]||_0x6c12('0x2');this[_0x6c12('0x3')]=0x0;this[_0x6c12('0x4')]=0x0;this[_0x6c12('0x5')]=0x0;this[_0x6c12('0x6')]=0x0;this['message']='';this[_0x6c12('0x7')]=!![];this['active']=_0x5385ba['active'];this[_0x6c12('0x8')]=_0x5385ba['limitCalls'];this[_0x6c12('0x9')]=_0x5385ba[_0x6c12('0x9')]||null;this[_0x6c12('0xa')]=_0x5385ba['dialGlobalInterval']?_0x5385ba[_0x6c12('0xa')]:null;this[_0x6c12('0xb')]=_0x5385ba[_0x6c12('0xb')];this['dialOriginateCallerIdNumber']=_0x5385ba[_0x6c12('0xc')];this[_0x6c12('0xd')]=_0x5385ba[_0x6c12('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x5385ba['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x5385ba[_0x6c12('0xe')];this[_0x6c12('0xf')]=_0x5385ba['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x5385ba[_0x6c12('0x10')];this['dialNoAnswerMaxRetry']=_0x5385ba['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x5385ba['dialNoAnswerRetryFrequency'];this[_0x6c12('0x11')]=_0x5385ba[_0x6c12('0x11')];this['dialNoSuchNumberMaxRetry']=_0x5385ba[_0x6c12('0x12')]||0x3;this[_0x6c12('0x13')]=_0x5385ba['dialNoSuchNumberRetryFrequency']||0x96;this[_0x6c12('0x14')]=_0x5385ba[_0x6c12('0x14')]||0x3;this[_0x6c12('0x15')]=_0x5385ba[_0x6c12('0x15')]||0x96;this[_0x6c12('0x16')]=_0x5385ba[_0x6c12('0x16')]||0x3;this[_0x6c12('0x17')]=_0x5385ba[_0x6c12('0x17')]||0x96;this[_0x6c12('0x18')]=_0x5385ba[_0x6c12('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x5385ba['dialMachineRetryFrequency']||0x96;this[_0x6c12('0x19')]=_0x5385ba['dialAgentRejectMaxRetry']||0x3;this[_0x6c12('0x1a')]=_0x5385ba['dialAgentRejectRetryFrequency']||0x96;this[_0x6c12('0x1b')]=_0x5385ba['dialOrderByScheduledAt']||_0x6c12('0x1c');this['dialPrefix']=_0x5385ba['dialPrefix']||undefined;this[_0x6c12('0x1d')]=_0x5385ba[_0x6c12('0x1d')]||undefined;this[_0x6c12('0x1e')]=_0x5385ba[_0x6c12('0x1e')]||undefined;this['TrunkBackup']=_0x5385ba[_0x6c12('0x1f')]?_0x5385ba[_0x6c12('0x1f')]:undefined;this[_0x6c12('0x20')]=_0x5385ba[_0x6c12('0x20')]?_0x5385ba[_0x6c12('0x20')]:undefined;this['Interval']=_0x5385ba['Interval']?_0x5385ba[_0x6c12('0x21')]:undefined;this[_0x6c12('0x22')]=_0x5385ba[_0x6c12('0x22')]?_0x5385ba[_0x6c12('0x22')]:undefined;this[_0x6c12('0x23')]=_0x5385ba[_0x6c12('0x22')]?_0x5385ba[_0x6c12('0x22')][_0x6c12('0x0')]:undefined;this['dialAMDActive']=_0x5385ba[_0x6c12('0x24')]||![];this[_0x6c12('0x25')]=_0x5385ba['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x5385ba[_0x6c12('0x26')];this[_0x6c12('0x27')]=_0x5385ba['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x5385ba[_0x6c12('0x28')];this[_0x6c12('0x29')]=_0x5385ba[_0x6c12('0x29')];this[_0x6c12('0x2a')]=_0x5385ba[_0x6c12('0x2a')];this[_0x6c12('0x2b')]=_0x5385ba['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5385ba[_0x6c12('0x2c')];this[_0x6c12('0x2d')]=_0x5385ba[_0x6c12('0x2d')];}module['exports']=Campaign;
\ No newline at end of file
+var _0xa94e=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x3736c6,_0x14a9bc){var _0x586482=function(_0x3e2e42){while(--_0x3e2e42){_0x3736c6['push'](_0x3736c6['shift']());}};_0x586482(++_0x14a9bc);}(_0xa94e,0x1f2));var _0xea94=function(_0x1e92cd,_0x3058e5){_0x1e92cd=_0x1e92cd-0x0;var _0x388e6b=_0xa94e[_0x1e92cd];return _0x388e6b;};'use strict';function Campaign(_0x348d81){this['id']=_0x348d81['id']||0x0;this[_0xea94('0x0')]=_0x348d81[_0xea94('0x0')]||'';this[_0xea94('0x1')]=_0x348d81[_0xea94('0x1')]||_0xea94('0x2');this['originated']=0x0;this['temp']=0x0;this[_0xea94('0x3')]=0x0;this[_0xea94('0x4')]=0x0;this[_0xea94('0x5')]='';this[_0xea94('0x6')]=!![];this[_0xea94('0x7')]=_0x348d81['active'];this[_0xea94('0x8')]=_0x348d81[_0xea94('0x8')];this['dialTimezone']=_0x348d81['dialTimezone']||null;this['dialGlobalInterval']=_0x348d81[_0xea94('0x9')]?_0x348d81['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x348d81[_0xea94('0xa')];this['dialOriginateCallerIdNumber']=_0x348d81[_0xea94('0xb')];this[_0xea94('0xc')]=_0x348d81[_0xea94('0xc')]||0x1e;this[_0xea94('0xd')]=_0x348d81[_0xea94('0xd')];this['dialCongestionRetryFrequency']=_0x348d81[_0xea94('0xe')];this[_0xea94('0xf')]=_0x348d81['dialBusyMaxRetry'];this[_0xea94('0x10')]=_0x348d81[_0xea94('0x10')];this[_0xea94('0x11')]=_0x348d81[_0xea94('0x11')];this[_0xea94('0x12')]=_0x348d81[_0xea94('0x12')];this['dialGlobalMaxRetry']=_0x348d81[_0xea94('0x13')];this[_0xea94('0x14')]=_0x348d81[_0xea94('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x348d81[_0xea94('0x15')]||0x96;this[_0xea94('0x16')]=_0x348d81['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x348d81[_0xea94('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x348d81[_0xea94('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x348d81[_0xea94('0x19')]||0x96;this[_0xea94('0x1a')]=_0x348d81[_0xea94('0x1a')]||0x3;this[_0xea94('0x1b')]=_0x348d81['dialMachineRetryFrequency']||0x96;this[_0xea94('0x1c')]=_0x348d81['dialAgentRejectMaxRetry']||0x3;this[_0xea94('0x1d')]=_0x348d81['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x348d81['dialOrderByScheduledAt']||_0xea94('0x1e');this[_0xea94('0x1f')]=_0x348d81[_0xea94('0x1f')]||undefined;this[_0xea94('0x20')]=_0x348d81[_0xea94('0x20')]||undefined;this[_0xea94('0x21')]=_0x348d81[_0xea94('0x21')]||undefined;this['TrunkBackup']=_0x348d81[_0xea94('0x22')]?_0x348d81['TrunkBackup']:undefined;this['Trunk']=_0x348d81['Trunk']?_0x348d81[_0xea94('0x23')]:undefined;this[_0xea94('0x24')]=_0x348d81[_0xea94('0x24')]?_0x348d81['Interval']:undefined;this[_0xea94('0x25')]=_0x348d81[_0xea94('0x25')]?_0x348d81[_0xea94('0x25')]:undefined;this['dialQueueProject']=_0x348d81[_0xea94('0x25')]?_0x348d81['SquareProject'][_0xea94('0x0')]:undefined;this[_0xea94('0x26')]=_0x348d81[_0xea94('0x26')]||![];this[_0xea94('0x27')]=_0x348d81[_0xea94('0x27')];this[_0xea94('0x28')]=_0x348d81[_0xea94('0x28')];this[_0xea94('0x29')]=_0x348d81['dialAMDAfterGreetingSilence'];this[_0xea94('0x2a')]=_0x348d81[_0xea94('0x2a')];this[_0xea94('0x2b')]=_0x348d81[_0xea94('0x2b')];this[_0xea94('0x2c')]=_0x348d81[_0xea94('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x348d81['dialAMDMaximumNumberOfWords'];this[_0xea94('0x2d')]=_0x348d81['dialAMDSilenceThreshold'];this[_0xea94('0x2e')]=_0x348d81[_0xea94('0x2e')];}module['exports']=Campaign;
\ No newline at end of file
index 97e76e3..afe99f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa413=['mohtime','exports','starttime','destinationchannel','calleridname','connectedlinenum','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','disposition','monitorFilename','monitors','transfercalleridnum','transferType'];(function(_0x4ef3db,_0x204a1e){var _0x2ab29e=function(_0x3e3277){while(--_0x3e3277){_0x4ef3db['push'](_0x4ef3db['shift']());}};_0x2ab29e(++_0x204a1e);}(_0xa413,0x1e5));var _0x3a41=function(_0x364e16,_0x150d8f){_0x364e16=_0x364e16-0x0;var _0x24bf8a=_0xa413[_0x364e16];return _0x24bf8a;};'use strict';function Channel(){this[_0x3a41('0x0')]=null;this['channel']='';this[_0x3a41('0x1')]='';this['calleridnum']=0x0;this[_0x3a41('0x2')]='';this[_0x3a41('0x3')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x3a41('0x4')]='';this[_0x3a41('0x5')]=0x0;this[_0x3a41('0x6')]=0x0;this[_0x3a41('0x7')]=0x0;this[_0x3a41('0x8')]=![];this[_0x3a41('0x9')]=null;this[_0x3a41('0xa')]=null;this[_0x3a41('0xb')]=![];this[_0x3a41('0xc')]=![];this[_0x3a41('0xd')]='';this[_0x3a41('0xe')]='';this['duration']=0x0;this[_0x3a41('0xf')]=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0x3a41('0x10')]=null;this['monitor']=![];this[_0x3a41('0x11')]=null;this['queue']=null;this[_0x3a41('0x12')]=[];this[_0x3a41('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x3a41('0x14')]=undefined;this[_0x3a41('0x15')]=0x0;}module[_0x3a41('0x16')]=Channel;
\ No newline at end of file
+var _0x9666=['unmanaged','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','answertime','endtime'];(function(_0x4fdb94,_0xbe2f70){var _0x24d2c5=function(_0x587147){while(--_0x587147){_0x4fdb94['push'](_0x4fdb94['shift']());}};_0x24d2c5(++_0xbe2f70);}(_0x9666,0x17a));var _0x6966=function(_0x22ac21,_0x4c5608){_0x22ac21=_0x22ac21-0x0;var _0x46d706=_0x9666[_0x22ac21];return _0x46d706;};'use strict';function Channel(){this[_0x6966('0x0')]=null;this[_0x6966('0x1')]='';this[_0x6966('0x2')]='';this[_0x6966('0x3')]=0x0;this['calleridname']='';this[_0x6966('0x4')]=undefined;this[_0x6966('0x5')]=undefined;this[_0x6966('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x6966('0x7')]=0x0;this[_0x6966('0x8')]=0x0;this[_0x6966('0x9')]=![];this[_0x6966('0xa')]=null;this[_0x6966('0xb')]=null;this[_0x6966('0xc')]=![];this['abandoned']=![];this[_0x6966('0xd')]='';this[_0x6966('0xe')]='';this[_0x6966('0xf')]=0x0;this['billableseconds']=0x0;this[_0x6966('0x10')]=0x0;this[_0x6966('0x11')]=null;this[_0x6966('0x12')]=null;this[_0x6966('0x13')]=null;this[_0x6966('0x14')]=![];this[_0x6966('0x15')]=null;this[_0x6966('0x16')]=null;this[_0x6966('0x17')]=[];this[_0x6966('0x18')]=undefined;this[_0x6966('0x19')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module['exports']=Channel;
\ No newline at end of file
index bb45007..335027f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb133=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x4b3d0b,_0x590e4f){var _0x4def9c=function(_0x128878){while(--_0x128878){_0x4b3d0b['push'](_0x4b3d0b['shift']());}};_0x4def9c(++_0x590e4f);}(_0xb133,0x18a));var _0x3b13=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xb133[_0x7e2eb0];return _0xd92de4;};'use strict';function DeskAccount(_0x3f1f67){this['id']=_0x3f1f67['id']||0x0;this[_0x3b13('0x0')]=_0x3f1f67[_0x3b13('0x0')]||'';this[_0x3b13('0x1')]=_0x3f1f67['username']||'';this['remoteUri']=_0x3f1f67['remoteUri']||'';this[_0x3b13('0x2')]=_0x3f1f67[_0x3b13('0x2')]||'';this[_0x3b13('0x3')]=_0x3f1f67[_0x3b13('0x3')]||'';this['consumerKey']=_0x3f1f67[_0x3b13('0x4')]||'';this['consumerSecret']=_0x3f1f67[_0x3b13('0x5')]||'';this[_0x3b13('0x6')]=_0x3f1f67[_0x3b13('0x6')]||'';this[_0x3b13('0x7')]=_0x3f1f67[_0x3b13('0x7')]||'';this['type']=_0x3f1f67[_0x3b13('0x8')]||'';this[_0x3b13('0x9')]=_0x3f1f67['serverUrl']||'';this['Configurations']=_0x3f1f67[_0x3b13('0xa')]||{};}module[_0x3b13('0xb')]=DeskAccount;
\ No newline at end of file
+var _0x1e0d=['username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x42253f,_0x5d243b){var _0x34aaa1=function(_0x112373){while(--_0x112373){_0x42253f['push'](_0x42253f['shift']());}};_0x34aaa1(++_0x5d243b);}(_0x1e0d,0xc5));var _0xd1e0=function(_0x42626f,_0x454892){_0x42626f=_0x42626f-0x0;var _0x49e6bc=_0x1e0d[_0x42626f];return _0x49e6bc;};'use strict';function DeskAccount(_0x490388){this['id']=_0x490388['id']||0x0;this['name']=_0x490388[_0xd1e0('0x0')]||'';this['username']=_0x490388[_0xd1e0('0x1')]||'';this['remoteUri']=_0x490388['remoteUri']||'';this['authType']=_0x490388[_0xd1e0('0x2')]||'';this['password']=_0x490388[_0xd1e0('0x3')]||'';this[_0xd1e0('0x4')]=_0x490388['consumerKey']||'';this[_0xd1e0('0x5')]=_0x490388[_0xd1e0('0x5')]||'';this['token']=_0x490388[_0xd1e0('0x6')]||'';this['tokenSecret']=_0x490388[_0xd1e0('0x7')]||'';this[_0xd1e0('0x8')]=_0x490388[_0xd1e0('0x8')]||'';this[_0xd1e0('0x9')]=_0x490388[_0xd1e0('0x9')]||'';this[_0xd1e0('0xa')]=_0x490388[_0xd1e0('0xa')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 9cc8634..4157fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf274=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x1349be,_0x50d323){var _0x49c99a=function(_0x59502a){while(--_0x59502a){_0x1349be['push'](_0x1349be['shift']());}};_0x49c99a(++_0x50d323);}(_0xf274,0x17f));var _0x4f27=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xf274[_0x39e84d];return _0x1991bc;};'use strict';function Dynamics365Account(_0x93830b){this['id']=_0x93830b['id']||0x0;this[_0x4f27('0x0')]=_0x93830b[_0x4f27('0x0')]||'';this[_0x4f27('0x1')]=_0x93830b['username']||'';this[_0x4f27('0x2')]=_0x93830b['password']||'';this[_0x4f27('0x3')]=_0x93830b[_0x4f27('0x3')]||'';this[_0x4f27('0x4')]=_0x93830b[_0x4f27('0x4')]||'';this[_0x4f27('0x5')]=_0x93830b[_0x4f27('0x5')]||'';this[_0x4f27('0x6')]=_0x93830b['clientSecret']||{};this[_0x4f27('0x7')]=_0x93830b[_0x4f27('0x7')]||'';this[_0x4f27('0x8')]=_0x93830b[_0x4f27('0x8')]||![];this['Configurations']=_0x93830b[_0x4f27('0x9')]||{};this['CloudProvider']=_0x93830b[_0x4f27('0xa')]||{};}module[_0x4f27('0xb')]=Dynamics365Account;
\ No newline at end of file
+var _0x8214=['username','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x47a204,_0x24b906){var _0x5623fc=function(_0x4404ac){while(--_0x4404ac){_0x47a204['push'](_0x47a204['shift']());}};_0x5623fc(++_0x24b906);}(_0x8214,0x6c));var _0x4821=function(_0x360aa5,_0x16eefd){_0x360aa5=_0x360aa5-0x0;var _0x14f919=_0x8214[_0x360aa5];return _0x14f919;};'use strict';function Dynamics365Account(_0x54fa27){this['id']=_0x54fa27['id']||0x0;this['name']=_0x54fa27['name']||'';this[_0x4821('0x0')]=_0x54fa27[_0x4821('0x0')]||'';this['password']=_0x54fa27['password']||'';this['remoteUri']=_0x54fa27['remoteUri']||'';this[_0x4821('0x1')]=_0x54fa27[_0x4821('0x1')]||'';this[_0x4821('0x2')]=_0x54fa27[_0x4821('0x2')]||'';this['clientSecret']=_0x54fa27[_0x4821('0x3')]||{};this[_0x4821('0x4')]=_0x54fa27['serverUrl']||'';this[_0x4821('0x5')]=_0x54fa27['modernAuthentication']||![];this[_0x4821('0x6')]=_0x54fa27[_0x4821('0x6')]||{};this[_0x4821('0x7')]=_0x54fa27[_0x4821('0x7')]||{};}module[_0x4821('0x8')]=Dynamics365Account;
\ No newline at end of file
index 2c30872..e2be482 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc584=['headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0xb24c95,_0xb764f0){var _0x4b6612=function(_0x4a318b){while(--_0x4a318b){_0xb24c95['push'](_0xb24c95['shift']());}};_0x4b6612(++_0xb764f0);}(_0xc584,0xdd));var _0x4c58=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xc584[_0x202c61];return _0x540691;};'use strict';function FaxAccount(_0x19fdeb){this['id']=_0x19fdeb['id']||0x0;this['name']=_0x19fdeb[_0x4c58('0x0')]||'';this[_0x4c58('0x1')]=_0x19fdeb['description'];this[_0x4c58('0x2')]=_0x19fdeb[_0x4c58('0x2')];this[_0x4c58('0x3')]=_0x19fdeb[_0x4c58('0x3')];this[_0x4c58('0x4')]=_0x19fdeb[_0x4c58('0x4')];this[_0x4c58('0x5')]=_0x19fdeb[_0x4c58('0x5')]||0x960;this[_0x4c58('0x6')]=_0x19fdeb[_0x4c58('0x6')]||0x3840;this['modem']=_0x19fdeb[_0x4c58('0x7')]||'v17,v27,v29';this[_0x4c58('0x8')]=_0x19fdeb[_0x4c58('0x8')]||'no';this[_0x4c58('0x9')]=_0x19fdeb[_0x4c58('0x9')]||'no';this[_0x4c58('0xa')]=_0x19fdeb[_0x4c58('0xa')]||0x1388;this['tech']=_0x19fdeb['tech']||_0x4c58('0xb');this[_0x4c58('0xc')]=_0x19fdeb[_0x4c58('0xc')]?_0x19fdeb[_0x4c58('0xc')]:undefined;this[_0x4c58('0xd')]=_0x19fdeb[_0x4c58('0xd')];this[_0x4c58('0xe')]=_0x19fdeb[_0x4c58('0xe')];}module[_0x4c58('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x1843=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1843,0x83));var _0x3184=function(_0x1b5f4d,_0x7c42cc){_0x1b5f4d=_0x1b5f4d-0x0;var _0x556a66=_0x1843[_0x1b5f4d];return _0x556a66;};'use strict';function FaxAccount(_0x4a6c02){this['id']=_0x4a6c02['id']||0x0;this[_0x3184('0x0')]=_0x4a6c02['name']||'';this[_0x3184('0x1')]=_0x4a6c02[_0x3184('0x1')];this['ecm']=_0x4a6c02[_0x3184('0x2')];this['headerinfo']=_0x4a6c02[_0x3184('0x3')];this['localstationid']=_0x4a6c02[_0x3184('0x4')];this['minrate']=_0x4a6c02[_0x3184('0x5')]||0x960;this[_0x3184('0x6')]=_0x4a6c02['maxrate']||0x3840;this[_0x3184('0x7')]=_0x4a6c02[_0x3184('0x7')]||_0x3184('0x8');this[_0x3184('0x9')]=_0x4a6c02['gateway']||'no';this[_0x3184('0xa')]=_0x4a6c02[_0x3184('0xa')]||'no';this[_0x3184('0xb')]=_0x4a6c02[_0x3184('0xb')]||0x1388;this[_0x3184('0xc')]=_0x4a6c02[_0x3184('0xc')]||_0x3184('0xd');this['Trunk']=_0x4a6c02[_0x3184('0xe')]?_0x4a6c02['Trunk']:undefined;this[_0x3184('0xf')]=_0x4a6c02[_0x3184('0xf')];this[_0x3184('0x10')]=_0x4a6c02['key'];}module[_0x3184('0x11')]=FaxAccount;
\ No newline at end of file
index b2bdf76..5d59652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38e6=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x47bc2c,_0x5f5cbf){var _0x36abea=function(_0x3d5aaf){while(--_0x3d5aaf){_0x47bc2c['push'](_0x47bc2c['shift']());}};_0x36abea(++_0x5f5cbf);}(_0x38e6,0x1e3));var _0x638e=function(_0x4abba8,_0x14fdbd){_0x4abba8=_0x4abba8-0x0;var _0x3a23a5=_0x38e6[_0x4abba8];return _0x3a23a5;};'use strict';function FreshdeskAccount(_0x2d1475){this['id']=_0x2d1475['id']||0x0;this[_0x638e('0x0')]=_0x2d1475[_0x638e('0x0')]||'';this['username']=_0x2d1475[_0x638e('0x1')]||'';this['apiKey']=_0x2d1475[_0x638e('0x2')]||'';this[_0x638e('0x3')]=_0x2d1475[_0x638e('0x3')]||'';this[_0x638e('0x4')]=_0x2d1475[_0x638e('0x4')]||'';this[_0x638e('0x5')]=_0x2d1475[_0x638e('0x5')]||{};}module[_0x638e('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x16d9=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x5ecbe8,_0x42522f){var _0x1c6e21=function(_0x593f92){while(--_0x593f92){_0x5ecbe8['push'](_0x5ecbe8['shift']());}};_0x1c6e21(++_0x42522f);}(_0x16d9,0x90));var _0x916d=function(_0x4e294f,_0x14d4d9){_0x4e294f=_0x4e294f-0x0;var _0xb92bf7=_0x16d9[_0x4e294f];return _0xb92bf7;};'use strict';function FreshdeskAccount(_0x544f54){this['id']=_0x544f54['id']||0x0;this['name']=_0x544f54[_0x916d('0x0')]||'';this[_0x916d('0x1')]=_0x544f54[_0x916d('0x1')]||'';this[_0x916d('0x2')]=_0x544f54['token']||'';this['remoteUri']=_0x544f54[_0x916d('0x3')]||'';this[_0x916d('0x4')]=_0x544f54[_0x916d('0x4')]||'';this[_0x916d('0x5')]=_0x544f54['Configurations']||{};}module[_0x916d('0x6')]=FreshdeskAccount;
\ No newline at end of file
index 8076318..befb281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1793=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x57e3b3,_0x37e645){var _0xbe800b=function(_0x319d96){while(--_0x319d96){_0x57e3b3['push'](_0x57e3b3['shift']());}};_0xbe800b(++_0x37e645);}(_0x1793,0x1ce));var _0x3179=function(_0x1010ab,_0x26aa57){_0x1010ab=_0x1010ab-0x0;var _0x251870=_0x1793[_0x1010ab];return _0x251870;};'use strict';function FreshsalesAccount(_0x2b990b){this['id']=_0x2b990b['id']||0x0;this[_0x3179('0x0')]=_0x2b990b[_0x3179('0x0')]||'';this[_0x3179('0x1')]=_0x2b990b['username']||'';this[_0x3179('0x2')]=_0x2b990b[_0x3179('0x3')]||'';this[_0x3179('0x4')]=_0x2b990b[_0x3179('0x4')]||'';this[_0x3179('0x5')]=_0x2b990b['serverUrl']||'';this['Configurations']=_0x2b990b[_0x3179('0x6')]||{};}module[_0x3179('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x22ed=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x23bed6,_0x45f84f){var _0x1f9d5b=function(_0x96df66){while(--_0x96df66){_0x23bed6['push'](_0x23bed6['shift']());}};_0x1f9d5b(++_0x45f84f);}(_0x22ed,0x1a9));var _0xd22e=function(_0x1814cd,_0x13f4a0){_0x1814cd=_0x1814cd-0x0;var _0xd1b3ff=_0x22ed[_0x1814cd];return _0xd1b3ff;};'use strict';function FreshsalesAccount(_0x16827b){this['id']=_0x16827b['id']||0x0;this[_0xd22e('0x0')]=_0x16827b[_0xd22e('0x0')]||'';this[_0xd22e('0x1')]=_0x16827b[_0xd22e('0x1')]||'';this[_0xd22e('0x2')]=_0x16827b[_0xd22e('0x3')]||'';this[_0xd22e('0x4')]=_0x16827b[_0xd22e('0x4')]||'';this[_0xd22e('0x5')]=_0x16827b[_0xd22e('0x5')]||'';this[_0xd22e('0x6')]=_0x16827b['Configurations']||{};}module[_0xd22e('0x7')]=FreshsalesAccount;
\ No newline at end of file
index 0ec6cb7..fb44b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07cf=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','motionChannel','routealias','mohtime','variables','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','position','count'];(function(_0x5338b6,_0x554be3){var _0x23c375=function(_0xdf428d){while(--_0xdf428d){_0x5338b6['push'](_0x5338b6['shift']());}};_0x23c375(++_0x554be3);}(_0x07cf,0x1a8));var _0xf07c=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x07cf[_0x37ffea];return _0x2e2615;};'use strict';function QueueReport(){this[_0xf07c('0x0')]=_0xf07c('0x1');this['uniqueid']='';this[_0xf07c('0x2')]='';this[_0xf07c('0x3')]='';this[_0xf07c('0x4')]='';this[_0xf07c('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xf07c('0x6')]=0x1;this[_0xf07c('0x7')]=0x1;this[_0xf07c('0x8')]=![];this[_0xf07c('0x9')]=null;this[_0xf07c('0xa')]=![];this[_0xf07c('0xb')]=null;this[_0xf07c('0xc')]=![];this[_0xf07c('0xd')]=null;this[_0xf07c('0xe')]=0x1;this[_0xf07c('0xf')]='';this[_0xf07c('0x10')]='';this[_0xf07c('0x11')]='';this[_0xf07c('0x12')]='';this['context']='';this[_0xf07c('0x13')]='';this[_0xf07c('0x14')]='';this[_0xf07c('0x15')]=0x0;this[_0xf07c('0x16')]=![];this['lastAssignedTo']='';this[_0xf07c('0x17')]='voice';this[_0xf07c('0x18')]=null;this[_0xf07c('0x19')]=0x0;this[_0xf07c('0x1a')]={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0x9342=['motionChannel','routealias','mohtime','variables','exports','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename','accountcode','context','exten','assigned'];(function(_0x507b48,_0x336239){var _0x3b93cb=function(_0x1d7222){while(--_0x1d7222){_0x507b48['push'](_0x507b48['shift']());}};_0x3b93cb(++_0x336239);}(_0x9342,0x1a7));var _0x2934=function(_0x4f3f19,_0x590c3a){_0x4f3f19=_0x4f3f19-0x0;var _0x5f4a5d=_0x9342[_0x4f3f19];return _0x5f4a5d;};'use strict';function QueueReport(){this['type']='inbound';this[_0x2934('0x0')]='';this[_0x2934('0x1')]='';this[_0x2934('0x2')]='';this['queue']='';this[_0x2934('0x3')]=null;this[_0x2934('0x4')]=null;this['position']=0x1;this[_0x2934('0x5')]=0x1;this[_0x2934('0x6')]=![];this['queuecallerabandonAt']=null;this[_0x2934('0x7')]=![];this[_0x2934('0x8')]=null;this[_0x2934('0x9')]=![];this[_0x2934('0xa')]=null;this['originalposition']=0x1;this[_0x2934('0xb')]='';this['connectedlinenum']='';this[_0x2934('0xc')]='';this[_0x2934('0xd')]='';this[_0x2934('0xe')]='';this[_0x2934('0xf')]='';this['priority']='';this['holdtime']=0x0;this[_0x2934('0x10')]=![];this['lastAssignedTo']='';this[_0x2934('0x11')]='voice';this[_0x2934('0x12')]=null;this[_0x2934('0x13')]=0x0;this[_0x2934('0x14')]={};}module[_0x2934('0x15')]=QueueReport;
\ No newline at end of file
index c6a9a5c..c88caac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6d4=['password','clientId','clientSecret','securityToken','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xa6d4,0x1dd));var _0x4a6d=function(_0x3308c5,_0x8117be){_0x3308c5=_0x3308c5-0x0;var _0x475132=_0xa6d4[_0x3308c5];return _0x475132;};'use strict';function SalesforceAccount(_0x2bace0){this['id']=_0x2bace0['id']||0x0;this[_0x4a6d('0x0')]=_0x2bace0[_0x4a6d('0x0')]||'';this[_0x4a6d('0x1')]=_0x2bace0[_0x4a6d('0x1')]||'';this[_0x4a6d('0x2')]=_0x2bace0[_0x4a6d('0x2')]||'';this[_0x4a6d('0x3')]=_0x2bace0[_0x4a6d('0x3')]||'';this[_0x4a6d('0x4')]=_0x2bace0[_0x4a6d('0x4')]||'';this[_0x4a6d('0x5')]=_0x2bace0['clientSecret']||'';this[_0x4a6d('0x6')]=_0x2bace0[_0x4a6d('0x6')]||'';this['type']=_0x2bace0['type']||'integrationTab';this['serverUrl']=_0x2bace0[_0x4a6d('0x7')]||'';this[_0x4a6d('0x8')]=_0x2bace0['Configurations']||{};}module[_0x4a6d('0x9')]=SalesforceAccount;
\ No newline at end of file
+var _0xc366=['username','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0x3116b4,_0x40f54c){var _0x41afb9=function(_0x41eb76){while(--_0x41eb76){_0x3116b4['push'](_0x3116b4['shift']());}};_0x41afb9(++_0x40f54c);}(_0xc366,0x10d));var _0x6c36=function(_0x13878c,_0x47be70){_0x13878c=_0x13878c-0x0;var _0x53bf02=_0xc366[_0x13878c];return _0x53bf02;};'use strict';function SalesforceAccount(_0x4de8fa){this['id']=_0x4de8fa['id']||0x0;this[_0x6c36('0x0')]=_0x4de8fa[_0x6c36('0x0')]||'';this[_0x6c36('0x1')]=_0x4de8fa['username']||'';this['remoteUri']=_0x4de8fa['remoteUri']||'';this[_0x6c36('0x2')]=_0x4de8fa[_0x6c36('0x2')]||'';this[_0x6c36('0x3')]=_0x4de8fa['clientId']||'';this[_0x6c36('0x4')]=_0x4de8fa[_0x6c36('0x4')]||'';this['securityToken']=_0x4de8fa[_0x6c36('0x5')]||'';this[_0x6c36('0x6')]=_0x4de8fa[_0x6c36('0x6')]||'integrationTab';this[_0x6c36('0x7')]=_0x4de8fa[_0x6c36('0x7')]||'';this[_0x6c36('0x8')]=_0x4de8fa[_0x6c36('0x8')]||{};}module[_0x6c36('0x9')]=SalesforceAccount;
\ No newline at end of file
index c73cc25..096b586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bd6=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5335ea,_0x2a612d){var _0x40a7da=function(_0x28023c){while(--_0x28023c){_0x5335ea['push'](_0x5335ea['shift']());}};_0x40a7da(++_0x2a612d);}(_0x3bd6,0xeb));var _0x63bd=function(_0x488845,_0x2e0d55){_0x488845=_0x488845-0x0;var _0x5e6cbd=_0x3bd6[_0x488845];return _0x5e6cbd;};'use strict';function ServicenowAccount(_0x145cae){this['id']=_0x145cae['id']||0x0;this[_0x63bd('0x0')]=_0x145cae[_0x63bd('0x0')]||'';this[_0x63bd('0x1')]=_0x145cae[_0x63bd('0x1')]||'';this['password']=_0x145cae[_0x63bd('0x2')]||'';this[_0x63bd('0x3')]=_0x145cae[_0x63bd('0x3')]||'';this['serverUrl']=_0x145cae[_0x63bd('0x4')]||'';this['Configurations']=_0x145cae[_0x63bd('0x5')]||{};}module[_0x63bd('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x1133=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1aef4b,_0x1e049f){var _0x877704=function(_0x3cbeef){while(--_0x3cbeef){_0x1aef4b['push'](_0x1aef4b['shift']());}};_0x877704(++_0x1e049f);}(_0x1133,0x80));var _0x3113=function(_0x47f17f,_0x2cace7){_0x47f17f=_0x47f17f-0x0;var _0x5edff0=_0x1133[_0x47f17f];return _0x5edff0;};'use strict';function ServicenowAccount(_0x41c22b){this['id']=_0x41c22b['id']||0x0;this[_0x3113('0x0')]=_0x41c22b[_0x3113('0x0')]||'';this[_0x3113('0x1')]=_0x41c22b['username']||'';this['password']=_0x41c22b[_0x3113('0x2')]||'';this['remoteUri']=_0x41c22b[_0x3113('0x3')]||'';this[_0x3113('0x4')]=_0x41c22b[_0x3113('0x4')]||'';this[_0x3113('0x5')]=_0x41c22b['Configurations']||{};}module[_0x3113('0x6')]=ServicenowAccount;
\ No newline at end of file
index fb8316c..36cf3c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f92=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x21a438,_0x2acd07){var _0x276722=function(_0x35da3b){while(--_0x35da3b){_0x21a438['push'](_0x21a438['shift']());}};_0x276722(++_0x2acd07);}(_0x1f92,0x1db));var _0x21f9=function(_0x32bdd3,_0xe4894d){_0x32bdd3=_0x32bdd3-0x0;var _0x2149e1=_0x1f92[_0x32bdd3];return _0x2149e1;};'use strict';function SugarcrmAccount(_0xf54527){this['id']=_0xf54527['id']||0x0;this[_0x21f9('0x0')]=_0xf54527[_0x21f9('0x0')]||'';this[_0x21f9('0x1')]=_0xf54527[_0x21f9('0x1')]||'';this['password']=_0xf54527[_0x21f9('0x2')]||'';this[_0x21f9('0x3')]=_0xf54527['remoteUri']||'';this[_0x21f9('0x4')]=_0xf54527[_0x21f9('0x4')]||'';this['Configurations']=_0xf54527[_0x21f9('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0x534b=['name','username','password','remoteUri','serverUrl','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x534b,0x1da));var _0xb534=function(_0x15a287,_0x4169a0){_0x15a287=_0x15a287-0x0;var _0x9c89fc=_0x534b[_0x15a287];return _0x9c89fc;};'use strict';function SugarcrmAccount(_0x1ebab8){this['id']=_0x1ebab8['id']||0x0;this[_0xb534('0x0')]=_0x1ebab8[_0xb534('0x0')]||'';this[_0xb534('0x1')]=_0x1ebab8['username']||'';this[_0xb534('0x2')]=_0x1ebab8[_0xb534('0x2')]||'';this[_0xb534('0x3')]=_0x1ebab8['remoteUri']||'';this[_0xb534('0x4')]=_0x1ebab8[_0xb534('0x4')]||'';this['Configurations']=_0x1ebab8['Configurations']||{};}module[_0xb534('0x5')]=SugarcrmAccount;
\ No newline at end of file
index 933e096..90883e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d80=['name','accountcode','state','unknown','status','address','exports'];(function(_0x42a6fb,_0x54c899){var _0x38afbf=function(_0x564ffa){while(--_0x564ffa){_0x42a6fb['push'](_0x42a6fb['shift']());}};_0x38afbf(++_0x54c899);}(_0x7d80,0x17a));var _0x07d8=function(_0xba7395,_0x456780){_0xba7395=_0xba7395-0x0;var _0x67a857=_0x7d80[_0xba7395];return _0x67a857;};'use strict';function Telephone(_0x1e2677){this['id']=_0x1e2677['id']||0x0;this[_0x07d8('0x0')]=_0x1e2677[_0x07d8('0x0')]||'';this[_0x07d8('0x1')]=_0x1e2677[_0x07d8('0x1')]||'';this[_0x07d8('0x2')]=_0x07d8('0x3');this['stateTime']=0x0;this[_0x07d8('0x4')]='unknown';this[_0x07d8('0x5')]='';}module[_0x07d8('0x6')]=Telephone;
\ No newline at end of file
+var _0x71f4=['unknown','status','address','name','accountcode','state'];(function(_0x23fec1,_0x5dcc60){var _0x1fb67b=function(_0xa4858a){while(--_0xa4858a){_0x23fec1['push'](_0x23fec1['shift']());}};_0x1fb67b(++_0x5dcc60);}(_0x71f4,0xf9));var _0x471f=function(_0x4ed9e4,_0x167c81){_0x4ed9e4=_0x4ed9e4-0x0;var _0x50d90f=_0x71f4[_0x4ed9e4];return _0x50d90f;};'use strict';function Telephone(_0x358938){this['id']=_0x358938['id']||0x0;this['name']=_0x358938[_0x471f('0x0')]||'';this[_0x471f('0x1')]=_0x358938[_0x471f('0x1')]||'';this[_0x471f('0x2')]=_0x471f('0x3');this['stateTime']=0x0;this[_0x471f('0x4')]='unknown';this[_0x471f('0x5')]='';}module['exports']=Telephone;
\ No newline at end of file
index 7231ed2..10dbb80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x5a85f1,_0x147ea8){var _0x3ce815=function(_0x54786f){while(--_0x54786f){_0x5a85f1['push'](_0x5a85f1['shift']());}};_0x3ce815(++_0x147ea8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 _0xa9e0=['exports','name'];(function(_0x5be0c8,_0x2ac0d1){var _0x58d9e=function(_0x3e499b){while(--_0x3e499b){_0x5be0c8['push'](_0x5be0c8['shift']());}};_0x58d9e(++_0x2ac0d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 9d1395e..8f475d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1a85,0x178));var _0x51a8=function(_0x9ace37,_0x4d1159){_0x9ace37=_0x9ace37-0x0;var _0x23ecc0=_0x1a85[_0x9ace37];return _0x23ecc0;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x5b7665,_0x2f1170){var _0x4fad4a=function(_0x124618){while(--_0x124618){_0x5b7665['push'](_0x5b7665['shift']());}};_0x4fad4a(++_0x2f1170);}(_0xda2d,0x102));var _0xdda2=function(_0x409f78,_0x5f4063){_0x409f78=_0x409f78-0x0;var _0x5d488a=_0xda2d[_0x409f78];return _0x5d488a;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger;
\ No newline at end of file
index 9803e6f..872a1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc2d=['refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domainport'];(function(_0x225cce,_0x4bc45e){var _0x1897af=function(_0x56d128){while(--_0x56d128){_0x225cce['push'](_0x225cce['shift']());}};_0x1897af(++_0x4bc45e);}(_0xdc2d,0x1e1));var _0xddc2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdc2d[_0x126558];return _0x1f6d14;};'use strict';function Trunk(_0x22a222){this['id']=_0x22a222['id']||0x0;this[_0xddc2('0x0')]=_0x22a222['active']||![];this[_0xddc2('0x1')]=_0x22a222[_0xddc2('0x1')]||'';this[_0xddc2('0x2')]=_0xddc2('0x3');this[_0xddc2('0x4')]=0x0;this[_0xddc2('0x5')]=_0xddc2('0x3');this['registry']=_0x22a222[_0xddc2('0x6')]&&_0x22a222['registry'][_0xddc2('0x7')](':')?_0x22a222[_0xddc2('0x6')][_0xddc2('0x8')](':')[0x0]:'';this[_0xddc2('0x9')]='';this[_0xddc2('0xa')]='';this['domain']='';this[_0xddc2('0xb')]='';this[_0xddc2('0xc')]='';this[_0xddc2('0xd')]=_0xddc2('0x3');this[_0xddc2('0xe')]='';this['address']='';this[_0xddc2('0xf')]=_0x22a222['defaultuser']||'';}module[_0xddc2('0x10')]=Trunk;
\ No newline at end of file
+var _0x76c8=['name','state','unknown','status','registry','indexOf','split','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x76c8,0x1d1));var _0x876c=function(_0x38e579,_0x5982f9){_0x38e579=_0x38e579-0x0;var _0x2af70a=_0x76c8[_0x38e579];return _0x2af70a;};'use strict';function Trunk(_0x22d404){this['id']=_0x22d404['id']||0x0;this['active']=_0x22d404['active']||![];this[_0x876c('0x0')]=_0x22d404[_0x876c('0x0')]||'';this[_0x876c('0x1')]=_0x876c('0x2');this['stateTime']=0x0;this[_0x876c('0x3')]='unknown';this[_0x876c('0x4')]=_0x22d404['registry']&&_0x22d404[_0x876c('0x4')][_0x876c('0x5')](':')?_0x22d404[_0x876c('0x4')][_0x876c('0x6')](':')[0x0]:'';this['host']='';this[_0x876c('0x7')]='';this[_0x876c('0x8')]='';this[_0x876c('0x9')]='';this[_0x876c('0xa')]='';this[_0x876c('0xb')]='unknown';this[_0x876c('0xc')]='';this[_0x876c('0xd')]='';this['defaultuser']=_0x22d404[_0x876c('0xe')]||'';}module['exports']=Trunk;
\ No newline at end of file
index ce4e12a..a85532b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93cd=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x25ee60,_0x233ab0){var _0x2ce0e7=function(_0x266fa5){while(--_0x266fa5){_0x25ee60['push'](_0x25ee60['shift']());}};_0x2ce0e7(++_0x233ab0);}(_0x93cd,0x6a));var _0xd93c=function(_0x49a1a0,_0x48f776){_0x49a1a0=_0x49a1a0-0x0;var _0x518a4f=_0x93cd[_0x49a1a0];return _0x518a4f;};'use strict';function voiceExtension(_0x439584){this['id']=_0x439584['id']||0x0;this['exten']=_0x439584[_0xd93c('0x0')]||'';this['recordingFormat']=_0x439584[_0xd93c('0x1')]||_0xd93c('0x2');this[_0xd93c('0x3')]=_0x439584[_0xd93c('0x3')]||![];}module[_0xd93c('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x6afe=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6afe,0x129));var _0xe6af=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0x6afe[_0x470f63];return _0x4f09e2;};'use strict';function voiceExtension(_0x188213){this['id']=_0x188213['id']||0x0;this[_0xe6af('0x0')]=_0x188213[_0xe6af('0x0')]||'';this[_0xe6af('0x1')]=_0x188213[_0xe6af('0x1')]||_0xe6af('0x2');this[_0xe6af('0x3')]=_0x188213[_0xe6af('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
index 33c5c1f..fd02edb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27af=['outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','leastrecent','linear','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x27af,0x199));var _0xf27a=function(_0x5dcad2,_0x22108f){_0x5dcad2=_0x5dcad2-0x0;var _0x20768f=_0x27af[_0x5dcad2];return _0x20768f;};'use strict';var monitorFormat={'wav':_0xf27a('0x0'),'wav49':_0xf27a('0x1'),'gsm':_0xf27a('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xf27a('0x3'),'linear':_0xf27a('0x4'),'random':'random','ringall':'ringall','rr':_0xf27a('0x5'),'rrmemory':_0xf27a('0x6'),'rrordered':_0xf27a('0x7'),'wrandom':_0xf27a('0x8')};function VoiceQueue(_0x2a8645){this['id']=_0x2a8645['id']||0x0;this[_0xf27a('0x9')]=_0x2a8645[_0xf27a('0x9')]||'';this[_0xf27a('0xa')]=_0x2a8645['monitor_format']||'';this['type']=_0x2a8645[_0xf27a('0xb')]||_0xf27a('0xc');this[_0xf27a('0xd')]=0x0;this[_0xf27a('0xe')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xf27a('0xf')]=0x0;this[_0xf27a('0x10')]=0x0;this[_0xf27a('0x11')]=0x0;this[_0xf27a('0x12')]=0x0;this[_0xf27a('0x13')]=0x0;this[_0xf27a('0x14')]=0x0;this[_0xf27a('0x15')]=0x0;this[_0xf27a('0x16')]=0x0;this[_0xf27a('0x17')]=0x0;this[_0xf27a('0x18')]=0x0;this[_0xf27a('0x19')]=0x0;this[_0xf27a('0x1a')]=0x0;this['ringing']=0x0;this[_0xf27a('0x1b')]=0x0;this['talking']=0x0;this[_0xf27a('0x1c')]=0x0;this[_0xf27a('0x1d')]=0x0;this['acw']=_0x2a8645[_0xf27a('0x1e')]||![];this[_0xf27a('0x1f')]=_0x2a8645['acwTimeout']||0xa;this['autopause']=_0x2a8645[_0xf27a('0x20')]||'no';this['sendMessageOneNotActive']=!![];this[_0xf27a('0x21')]='';this['statusMessage']='';this['originated']=0x0;this[_0xf27a('0x22')]=0x0;this['dialTimezone']=_0x2a8645[_0xf27a('0x23')]||null;this[_0xf27a('0x24')]=_0x2a8645['dialGlobalInterval']?_0x2a8645[_0xf27a('0x24')]:null;this[_0xf27a('0x25')]=_0x2a8645[_0xf27a('0x25')];this['dialMethod']=_0x2a8645['dialMethod']||_0xf27a('0x26');this[_0xf27a('0x27')]=_0x2a8645['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x2a8645[_0xf27a('0x28')]||0x0;this[_0xf27a('0x29')]=_0x2a8645[_0xf27a('0x29')]||0x1;this['dialPredictiveOptimization']=_0x2a8645['dialPredictiveOptimization']||_0xf27a('0x2a');this['dialPredictiveOptimizationPercentage']=_0x2a8645[_0xf27a('0x2b')]||0.03;this[_0xf27a('0x2c')]=_0x2a8645['dialPredictiveInterval']||0x258;this[_0xf27a('0x2d')]=_0x2a8645[_0xf27a('0x2d')]||_0xf27a('0x2e');this[_0xf27a('0x2f')]=_0x2a8645[_0xf27a('0x2f')]||_0xf27a('0x2e');this[_0xf27a('0x30')]=_0x2a8645['dialOriginateTimeout']||0x1e;this[_0xf27a('0x31')]=_0x2a8645[_0xf27a('0x31')]||_0xf27a('0x32');this[_0xf27a('0x33')]=_0x2a8645[_0xf27a('0x33')]||0x3;this['dialQueueProject']=_0x2a8645[_0xf27a('0x34')]||undefined;this['dialCongestionMaxRetry']=_0x2a8645['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x2a8645['dialCongestionRetryFrequency']||0x96;this[_0xf27a('0x35')]=_0x2a8645[_0xf27a('0x35')]||0x3;this[_0xf27a('0x36')]=_0x2a8645[_0xf27a('0x36')]||0x96;this[_0xf27a('0x37')]=_0x2a8645['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x2a8645[_0xf27a('0x38')]||0x96;this[_0xf27a('0x39')]=_0x2a8645['dialNoSuchNumberMaxRetry']||0x3;this[_0xf27a('0x3a')]=_0x2a8645[_0xf27a('0x3a')]||0x96;this[_0xf27a('0x3b')]=_0x2a8645[_0xf27a('0x3b')]||0x3;this[_0xf27a('0x3c')]=_0x2a8645[_0xf27a('0x3c')]||0x96;this['dialAbandonedMaxRetry']=_0x2a8645['dialAbandonedMaxRetry']||0x3;this[_0xf27a('0x3d')]=_0x2a8645[_0xf27a('0x3d')]||0x96;this[_0xf27a('0x3e')]=_0x2a8645[_0xf27a('0x3e')]||0x3;this[_0xf27a('0x3f')]=_0x2a8645['dialMachineRetryFrequency']||0x96;this[_0xf27a('0x40')]=_0x2a8645[_0xf27a('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2a8645['dialAgentRejectRetryFrequency']||0x96;this[_0xf27a('0x41')]=_0x2a8645[_0xf27a('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x2a8645[_0xf27a('0x42')]||0x4;this[_0xf27a('0x43')]=_0x2a8645['Trunk']?_0x2a8645['Trunk']:undefined;this[_0xf27a('0x44')]=_0x2a8645[_0xf27a('0x44')]?_0x2a8645[_0xf27a('0x44')]:undefined;this[_0xf27a('0x45')]=_0x2a8645['dialPrefix']||undefined;this['Interval']=_0x2a8645[_0xf27a('0x46')]?_0x2a8645['Interval']:undefined;this[_0xf27a('0x47')]=_0x2a8645['dialOrderByScheduledAt']||_0xf27a('0x48');this[_0xf27a('0x49')]=_0x2a8645[_0xf27a('0x49')]||undefined;this[_0xf27a('0x4a')]=_0x2a8645[_0xf27a('0x4a')]||undefined;this[_0xf27a('0x4b')]=strategy[_0x2a8645[_0xf27a('0x4b')]];this[_0xf27a('0x4c')]=!![];this[_0xf27a('0x4d')]=_0x2a8645['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2a8645['dialAMDInitialSilence'];this[_0xf27a('0x4e')]=_0x2a8645[_0xf27a('0x4e')];this[_0xf27a('0x4f')]=_0x2a8645[_0xf27a('0x4f')];this[_0xf27a('0x50')]=_0x2a8645[_0xf27a('0x50')];this[_0xf27a('0x51')]=_0x2a8645[_0xf27a('0x51')];this[_0xf27a('0x52')]=_0x2a8645[_0xf27a('0x52')];this[_0xf27a('0x53')]=_0x2a8645[_0xf27a('0x53')];this[_0xf27a('0x54')]=_0x2a8645['dialAMDSilenceThreshold'];this[_0xf27a('0x55')]=_0x2a8645['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xf27a('0x56')]=0x0;this[_0xf27a('0x57')]=_0x2a8645['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xf27a('0x58')]=0x0;this[_0xf27a('0x59')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xf27a('0x5a')]=0x0;this[_0xf27a('0x5b')]=0x0;this[_0xf27a('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xf27a('0x5d')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xf27a('0x5e')]=0x0;this[_0xf27a('0x5f')]=0x0;this[_0xf27a('0x60')]=0x0;this[_0xf27a('0x61')]=0x0;this['startProgressive']=undefined;this[_0xf27a('0x62')]=undefined;this['handlePredictive']=undefined;this[_0xf27a('0x63')]=1.05;this[_0xf27a('0x64')]=0x0;this[_0xf27a('0x65')]=0x0;this[_0xf27a('0x66')]=0x0;this[_0xf27a('0x67')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xf27a('0x68')]=0x0;this[_0xf27a('0x69')]=0x0;this[_0xf27a('0x6a')]=0x0;this[_0xf27a('0x6b')]=_0x2a8645['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xf27a('0x6c')]=_0x2a8645[_0xf27a('0x6d')]||0xa;this[_0xf27a('0x6e')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xf27a('0x6f')]=0x1;this['erlangCalls']=0x0;this[_0xf27a('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xf27a('0x71')]=0x0;this[_0xf27a('0x72')]=_0x2a8645[_0xf27a('0x72')]||0x1e;this[_0xf27a('0x73')]=_0x2a8645['dialRecallInQueue']||![];this[_0xf27a('0x74')]=!!_0x2a8645[_0xf27a('0x74')]||![];this['dialPreviewRecallmeReminder']=!!_0x2a8645[_0xf27a('0x75')]||![];this[_0xf27a('0x76')]=_0x2a8645['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x2a8645[_0xf27a('0x77')]||![];this[_0xf27a('0x78')]=_0x2a8645[_0xf27a('0x78')]||![];this[_0xf27a('0xa')]=monitorFormat[_0x2a8645[_0xf27a('0xa')]]?monitorFormat[_0x2a8645[_0xf27a('0xa')]]:undefined;this[_0xf27a('0x79')]=_0x2a8645[_0xf27a('0x79')]||![];this[_0xf27a('0x7a')]=_0x2a8645[_0xf27a('0x7a')]?_0x2a8645['mandatoryDispositionPause']:undefined;this[_0xf27a('0x7b')]=![];}module[_0xf27a('0x7c')]=VoiceQueue;
\ No newline at end of file
+var _0x64e0=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerAgiCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','random','ringall','name','monitor_format','type','inbound','total','answered','sumDuration','sumBillable','abandoned','available','inUse','invalid','loggedIn','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0x64e0,0xb1));var _0x064e=function(_0x5e6fe1,_0x8f80ad){_0x5e6fe1=_0x5e6fe1-0x0;var _0x5a6018=_0x64e0[_0x5e6fe1];return _0x5a6018;};'use strict';var monitorFormat={'wav':_0x064e('0x0'),'wav49':_0x064e('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x064e('0x2'),'leastrecent':_0x064e('0x3'),'linear':'linear','random':_0x064e('0x4'),'ringall':_0x064e('0x5'),'rr':'roundrobin','rrmemory':'rrmemory','rrordered':'rrordered','wrandom':'wrandom'};function VoiceQueue(_0x23e18d){this['id']=_0x23e18d['id']||0x0;this[_0x064e('0x6')]=_0x23e18d[_0x064e('0x6')]||'';this[_0x064e('0x7')]=_0x23e18d[_0x064e('0x7')]||'';this[_0x064e('0x8')]=_0x23e18d[_0x064e('0x8')]||_0x064e('0x9');this['waiting']=0x0;this[_0x064e('0xa')]=0x0;this[_0x064e('0xb')]=0x0;this[_0x064e('0xc')]=0x0;this['sumHoldTime']=0x0;this[_0x064e('0xd')]=0x0;this['unmanaged']=0x0;this[_0x064e('0xe')]=0x0;this[_0x064e('0xf')]=0x0;this['busy']=0x0;this[_0x064e('0x10')]=0x0;this[_0x064e('0x11')]=0x0;this[_0x064e('0x12')]=0x0;this['notInUse']=0x0;this[_0x064e('0x13')]=0x0;this[_0x064e('0x14')]=0x0;this[_0x064e('0x15')]=0x0;this[_0x064e('0x16')]=0x0;this['talking']=0x0;this[_0x064e('0x17')]=0x0;this[_0x064e('0x18')]=0x0;this[_0x064e('0x19')]=_0x23e18d['acw']||![];this[_0x064e('0x1a')]=_0x23e18d[_0x064e('0x1a')]||0xa;this[_0x064e('0x1b')]=_0x23e18d[_0x064e('0x1b')]||'no';this[_0x064e('0x1c')]=!![];this['message']='';this[_0x064e('0x1d')]='';this['originated']=0x0;this[_0x064e('0x1e')]=0x0;this[_0x064e('0x1f')]=_0x23e18d['dialTimezone']||null;this['dialGlobalInterval']=_0x23e18d[_0x064e('0x20')]?_0x23e18d['dialGlobalInterval']:null;this[_0x064e('0x21')]=_0x23e18d['dialActive'];this[_0x064e('0x22')]=_0x23e18d[_0x064e('0x22')]||_0x064e('0x23');this[_0x064e('0x24')]=_0x23e18d[_0x064e('0x24')]||0x0;this[_0x064e('0x25')]=_0x23e18d[_0x064e('0x25')]||0x0;this[_0x064e('0x26')]=_0x23e18d[_0x064e('0x26')]||0x1;this[_0x064e('0x27')]=_0x23e18d[_0x064e('0x27')]||_0x064e('0x28');this[_0x064e('0x29')]=_0x23e18d[_0x064e('0x29')]||0.03;this[_0x064e('0x2a')]=_0x23e18d[_0x064e('0x2a')]||0x258;this[_0x064e('0x2b')]=_0x23e18d[_0x064e('0x2b')]||_0x064e('0x2c');this['dialOriginateCallerIdNumber']=_0x23e18d[_0x064e('0x2d')]||_0x064e('0x2c');this[_0x064e('0x2e')]=_0x23e18d[_0x064e('0x2e')]||0x1e;this[_0x064e('0x2f')]=_0x23e18d[_0x064e('0x2f')]||_0x064e('0x30');this[_0x064e('0x31')]=_0x23e18d[_0x064e('0x31')]||0x3;this[_0x064e('0x32')]=_0x23e18d[_0x064e('0x32')]||undefined;this[_0x064e('0x33')]=_0x23e18d[_0x064e('0x33')]||0x3;this[_0x064e('0x34')]=_0x23e18d[_0x064e('0x34')]||0x96;this[_0x064e('0x35')]=_0x23e18d[_0x064e('0x35')]||0x3;this['dialBusyRetryFrequency']=_0x23e18d[_0x064e('0x36')]||0x96;this[_0x064e('0x37')]=_0x23e18d[_0x064e('0x37')]||0x3;this[_0x064e('0x38')]=_0x23e18d[_0x064e('0x38')]||0x96;this[_0x064e('0x39')]=_0x23e18d[_0x064e('0x39')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x23e18d['dialNoSuchNumberRetryFrequency']||0x96;this[_0x064e('0x3a')]=_0x23e18d['dialDropMaxRetry']||0x3;this[_0x064e('0x3b')]=_0x23e18d[_0x064e('0x3b')]||0x96;this[_0x064e('0x3c')]=_0x23e18d[_0x064e('0x3c')]||0x3;this[_0x064e('0x3d')]=_0x23e18d['dialAbandonedRetryFrequency']||0x96;this[_0x064e('0x3e')]=_0x23e18d[_0x064e('0x3e')]||0x3;this['dialMachineRetryFrequency']=_0x23e18d[_0x064e('0x3f')]||0x96;this[_0x064e('0x40')]=_0x23e18d[_0x064e('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x23e18d['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x23e18d[_0x064e('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x23e18d['dialGlobalMaxRetry']||0x4;this[_0x064e('0x42')]=_0x23e18d[_0x064e('0x42')]?_0x23e18d[_0x064e('0x42')]:undefined;this[_0x064e('0x43')]=_0x23e18d['TrunkBackup']?_0x23e18d[_0x064e('0x43')]:undefined;this[_0x064e('0x44')]=_0x23e18d[_0x064e('0x44')]||undefined;this[_0x064e('0x45')]=_0x23e18d[_0x064e('0x45')]?_0x23e18d[_0x064e('0x45')]:undefined;this[_0x064e('0x46')]=_0x23e18d[_0x064e('0x46')]||_0x064e('0x47');this[_0x064e('0x48')]=_0x23e18d['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x064e('0x49')]=_0x23e18d['dialCutDigit']||undefined;this[_0x064e('0x4a')]=strategy[_0x23e18d[_0x064e('0x4a')]];this[_0x064e('0x4b')]=!![];this[_0x064e('0x4c')]=_0x23e18d[_0x064e('0x4c')]||![];this['dialAMDInitialSilence']=_0x23e18d[_0x064e('0x4d')];this[_0x064e('0x4e')]=_0x23e18d[_0x064e('0x4e')];this['dialAMDAfterGreetingSilence']=_0x23e18d['dialAMDAfterGreetingSilence'];this[_0x064e('0x4f')]=_0x23e18d[_0x064e('0x4f')];this[_0x064e('0x50')]=_0x23e18d[_0x064e('0x50')];this['dialAMDBetweenWordsSilence']=_0x23e18d[_0x064e('0x51')];this['dialAMDMaximumNumberOfWords']=_0x23e18d[_0x064e('0x52')];this[_0x064e('0x53')]=_0x23e18d[_0x064e('0x53')];this[_0x064e('0x54')]=_0x23e18d['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0x064e('0x55')]=_0x23e18d[_0x064e('0x55')];this['outboundAnswerCallsDay']=0x0;this[_0x064e('0x56')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x064e('0x57')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x064e('0x58')]=0x0;this[_0x064e('0x59')]=0x0;this[_0x064e('0x5a')]=0x0;this[_0x064e('0x5b')]=0x0;this[_0x064e('0x5c')]=0x0;this[_0x064e('0x5d')]=0x0;this[_0x064e('0x5e')]=undefined;this[_0x064e('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0x064e('0x60')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x064e('0x61')]=0x0;this[_0x064e('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x064e('0x63')]=0x0;this[_0x064e('0x64')]=0x0;this[_0x064e('0x65')]=0x0;this[_0x064e('0x66')]=_0x23e18d[_0x064e('0x67')]||0x14;this[_0x064e('0x68')]=_0x23e18d[_0x064e('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x064e('0x69')]=0x0;this[_0x064e('0x6a')]=0x1;this[_0x064e('0x6b')]=0x0;this[_0x064e('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x064e('0x6d')]=_0x23e18d[_0x064e('0x6d')]||0x1e;this['dialRecallInQueue']=_0x23e18d['dialRecallInQueue']||![];this[_0x064e('0x6e')]=!!_0x23e18d[_0x064e('0x6e')]||![];this[_0x064e('0x6f')]=!!_0x23e18d['dialPreviewRecallmeReminder']||![];this[_0x064e('0x70')]=_0x23e18d[_0x064e('0x70')]||undefined;this['dialAgiAfterHangupClient']=_0x23e18d[_0x064e('0x71')]||![];this[_0x064e('0x72')]=_0x23e18d['dialAgiAfterHangupAgent']||![];this[_0x064e('0x7')]=monitorFormat[_0x23e18d[_0x064e('0x7')]]?monitorFormat[_0x23e18d[_0x064e('0x7')]]:undefined;this[_0x064e('0x73')]=_0x23e18d[_0x064e('0x73')]||![];this[_0x064e('0x74')]=_0x23e18d[_0x064e('0x74')]?_0x23e18d[_0x064e('0x74')]:undefined;this[_0x064e('0x75')]=![];}module[_0x064e('0x76')]=VoiceQueue;
\ No newline at end of file
index 10528c1..a1b7c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadf0=['sumBillable','total','name','strategy','abandoned','answered','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','loggedin','callers','length','status','booked','keys','compareToInboundQueue','some','compareToOutboundQueue','active','outboundAbandonedCallsDay','loggedIn','loggedInDb','paused','ringing','talking','waiting','available','inUse','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking'];(function(_0x3893da,_0x22bffb){var _0x1c3533=function(_0x1a882c){while(--_0x1a882c){_0x3893da['push'](_0x3893da['shift']());}};_0x1c3533(++_0x22bffb);}(_0xadf0,0x12d));var _0x0adf=function(_0x21559b,_0x847ca3){_0x21559b=_0x21559b-0x0;var _0x14232d=_0xadf0[_0x21559b];return _0x14232d;};'use strict';var INBOUND_COUNTERS=['available',_0x0adf('0x0'),_0x0adf('0x1'),_0x0adf('0x2'),_0x0adf('0x3'),_0x0adf('0x4'),_0x0adf('0x5')];var OUTBOUND_COUNTERS=[_0x0adf('0x6'),'answered',_0x0adf('0x7'),'loggedIn','loggedInDb','originated','outboundAbandonedCallsDay',_0x0adf('0x8'),_0x0adf('0x9'),'outboundBusyCallsDay','outboundCongestionCallsDay',_0x0adf('0xa'),_0x0adf('0xb'),'outboundReCallsDay',_0x0adf('0xc'),_0x0adf('0xd'),'paused',_0x0adf('0xe'),_0x0adf('0x4'),_0x0adf('0xf'),'sumDuration',_0x0adf('0x10'),_0x0adf('0x5')];function VoiceQueueSummary(_0x456ac8){this['id']=_0x456ac8['id'];this[_0x0adf('0x11')]=_0x456ac8[_0x0adf('0x11')];this['strategy']=_0x456ac8[_0x0adf('0x12')];this[_0x0adf('0x13')]=_0x456ac8['abandoned']||0x0;this[_0x0adf('0x14')]=_0x456ac8['answered']||0x0;this[_0x0adf('0x6')]=_0x456ac8['available']||0x0;this[_0x0adf('0x15')]=_0x456ac8[_0x0adf('0x15')]||0x0;this[_0x0adf('0x7')]=_0x456ac8[_0x0adf('0x7')]||0x0;this[_0x0adf('0x16')]=_0x456ac8[_0x0adf('0x16')]||0x0;this[_0x0adf('0x0')]=_0x456ac8[_0x0adf('0x0')]||0x0;this['loggedInDb']=_0x456ac8[_0x0adf('0x1')]||0x0;this[_0x0adf('0x17')]=_0x456ac8['onHold']||0x0;this[_0x0adf('0x18')]=_0x456ac8['notInUse']||0x0;this[_0x0adf('0x2')]=_0x456ac8[_0x0adf('0x2')]||0x0;this[_0x0adf('0x3')]=_0x456ac8[_0x0adf('0x3')]||0x0;this['ringInUse']=_0x456ac8[_0x0adf('0x19')];this[_0x0adf('0xf')]=_0x456ac8[_0x0adf('0xf')];this[_0x0adf('0x1a')]=_0x456ac8[_0x0adf('0x1a')];this[_0x0adf('0x1b')]=_0x456ac8['sumHoldTime']||0x0;this[_0x0adf('0x4')]=_0x456ac8[_0x0adf('0x4')]||0x0;this[_0x0adf('0x10')]=_0x456ac8[_0x0adf('0x10')]||0x0;this['type']=_0x456ac8[_0x0adf('0x1c')];this[_0x0adf('0x1d')]=_0x456ac8[_0x0adf('0x1d')]||0x0;this['unknown']=_0x456ac8[_0x0adf('0x1e')]||0x0;this[_0x0adf('0x1f')]=_0x456ac8[_0x0adf('0x1f')]||0x0;this[_0x0adf('0x5')]=_0x456ac8[_0x0adf('0x5')]||0x0;if(_0x456ac8[_0x0adf('0x1c')]==='outbound'){this[_0x0adf('0xe')]=_0x456ac8[_0x0adf('0xe')]||0x0;this[_0x0adf('0x20')]=_0x456ac8[_0x0adf('0x20')];this[_0x0adf('0x21')]=_0x456ac8[_0x0adf('0x21')];this['dialOriginateCallerIdName']=_0x456ac8[_0x0adf('0x22')];this[_0x0adf('0x23')]=_0x456ac8[_0x0adf('0x23')];this['dialOriginateTimeout']=_0x456ac8['dialOriginateTimeout'];this['dialPrefix']=_0x456ac8[_0x0adf('0x24')];this[_0x0adf('0x25')]=_0x456ac8[_0x0adf('0x25')];this[_0x0adf('0x26')]=_0x456ac8[_0x0adf('0x26')];this[_0x0adf('0x8')]=_0x456ac8[_0x0adf('0x8')];this[_0x0adf('0x9')]=_0x456ac8[_0x0adf('0x9')];this[_0x0adf('0x27')]=_0x456ac8[_0x0adf('0x27')];this[_0x0adf('0x28')]=_0x456ac8[_0x0adf('0x28')];this[_0x0adf('0x29')]=_0x456ac8[_0x0adf('0x29')];this['outboundDropCallsDayCallersExit']=_0x456ac8[_0x0adf('0x2a')];this[_0x0adf('0x2b')]=_0x456ac8[_0x0adf('0x2b')];this[_0x0adf('0xa')]=_0x456ac8[_0x0adf('0xa')];this[_0x0adf('0xb')]=_0x456ac8[_0x0adf('0xb')];this['outboundOriginateFailureCallsDay']=_0x456ac8[_0x0adf('0x2c')];this['outboundReCallsDay']=_0x456ac8[_0x0adf('0x2d')];this[_0x0adf('0xc')]=_0x456ac8[_0x0adf('0xc')];this[_0x0adf('0xd')]=_0x456ac8[_0x0adf('0xd')];this[_0x0adf('0x2e')]=_0x456ac8[_0x0adf('0x2e')];this[_0x0adf('0x2f')]=_0x456ac8[_0x0adf('0x2f')];this['predictiveIntervalAvgTalktime']=_0x456ac8[_0x0adf('0x30')];this[_0x0adf('0x31')]=_0x456ac8[_0x0adf('0x31')];this[_0x0adf('0x32')]=_0x456ac8[_0x0adf('0x32')];this['predictiveIntervalErlangCalls']=_0x456ac8[_0x0adf('0x33')];this[_0x0adf('0x34')]=_0x456ac8[_0x0adf('0x34')];this[_0x0adf('0x35')]=_0x456ac8['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x456ac8[_0x0adf('0x36')];this[_0x0adf('0x37')]=_0x456ac8[_0x0adf('0x37')];this[_0x0adf('0x38')]=_0x456ac8[_0x0adf('0x38')];this['predictiveIntervalTotalCalls']=_0x456ac8['predictiveIntervalTotalCalls'];this[_0x0adf('0x39')]=_0x456ac8[_0x0adf('0x39')];this['erlangCalls']=_0x456ac8['erlangCalls'];this[_0x0adf('0x3a')]=_0x456ac8[_0x0adf('0x3a')];this[_0x0adf('0x3b')]=_0x456ac8[_0x0adf('0x3b')];this[_0x0adf('0x3c')]=_0x456ac8[_0x0adf('0x3c')];this[_0x0adf('0x3d')]=_0x456ac8[_0x0adf('0x3d')];this['startProgressive']=_0x456ac8[_0x0adf('0x3e')];this['message']=_0x456ac8[_0x0adf('0x3f')];this[_0x0adf('0x40')]=_0x456ac8[_0x0adf('0x40')];}if(_0x456ac8[_0x0adf('0x41')]){this['Trunk']={'id':_0x456ac8[_0x0adf('0x41')]['id'],'name':_0x456ac8[_0x0adf('0x41')][_0x0adf('0x11')],'active':_0x456ac8[_0x0adf('0x41')]['active'],'callerid':_0x456ac8[_0x0adf('0x41')][_0x0adf('0x42')]};}}VoiceQueueSummary[_0x0adf('0x43')]['createReport']=function(_0x5eab19,_0x1c7104,_0x28c8fb,_0x1c30b5){this[_0x0adf('0x1')]=0x0;this[_0x0adf('0x4')]=0x0;this[_0x0adf('0x2')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x0adf('0x7')]=0x0;this[_0x0adf('0x15')]=0x0;this[_0x0adf('0x16')]=0x0;this['unavailable']=0x0;this[_0x0adf('0x3')]=0x0;this['ringInUse']=0x0;this[_0x0adf('0x17')]=0x0;if(_0x28c8fb){if(_0x28c8fb['available']){this[_0x0adf('0x6')]=Number(_0x28c8fb[_0x0adf('0x6')]);}if(_0x28c8fb[_0x0adf('0x44')]){this[_0x0adf('0x0')]=Number(_0x28c8fb[_0x0adf('0x44')]);}if(_0x28c8fb[_0x0adf('0x45')]){this[_0x0adf('0x5')]=Number(_0x28c8fb[_0x0adf('0x45')]);}}for(var _0xcc81e0=0x0;_0xcc81e0<_0x5eab19[_0x0adf('0x46')];_0xcc81e0++){var _0x43859d=_0x1c7104['SIP/'+_0x5eab19[_0xcc81e0]['name']];if(_0x43859d&&_0x43859d['online']){this['loggedInDb']+=0x1;}if(_0x5eab19[_0xcc81e0]['incall']==='1'){this[_0x0adf('0x4')]+=0x1;}if(_0x5eab19[_0xcc81e0]['paused']==='1'&&!['2','7','8']['includes'](_0x5eab19[_0xcc81e0][_0x0adf('0x47')])){this[_0x0adf('0x2')]+=0x1;}switch(_0x5eab19[_0xcc81e0][_0x0adf('0x47')]){case'0':this[_0x0adf('0x1e')]+=0x1;break;case'1':this[_0x0adf('0x18')]+=0x1;break;case'2':this[_0x0adf('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x0adf('0x16')]+=0x1;break;case'5':this[_0x0adf('0x1d')]+=0x1;break;case'6':this[_0x0adf('0x3')]+=0x1;break;case'7':this[_0x0adf('0x19')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x0adf('0x21')]===_0x0adf('0x48')){var _0x374d6b=Object[_0x0adf('0x49')](_0x1c30b5);for(var _0xa24c50=0x0;_0xa24c50<_0x374d6b[_0x0adf('0x46')];_0xa24c50++){var _0x4f2088=_0x374d6b[_0xa24c50];var _0x36bc4b=_0x1c30b5[_0x4f2088];if(_0x36bc4b['queue']===this['name']&&_0x36bc4b[_0x0adf('0x1c')]==='dialer'&&_0x36bc4b['exten']==='xcally-motion-preview'){this[_0x0adf('0x4')]+=0x1;}}if(this[_0x0adf('0x4')]>this[_0x0adf('0x7')]){this[_0x0adf('0x4')]=this[_0x0adf('0x7')];}this[_0x0adf('0xe')]=0x0;}return this;};VoiceQueueSummary[_0x0adf('0x43')][_0x0adf('0x4a')]=function(_0x13374f){var _0x461c20=![];if(_0x13374f){_0x461c20=INBOUND_COUNTERS[_0x0adf('0x4b')](function(_0xf89cbc){return this[_0xf89cbc]!==_0x13374f[_0xf89cbc];},this);}return _0x461c20;};VoiceQueueSummary[_0x0adf('0x43')][_0x0adf('0x4c')]=function(_0x2c3b60){var _0x213738=![];var _0x10c945=![];var _0x5905d6=![];if(_0x2c3b60){_0x213738=this['dialMethod']!==_0x2c3b60[_0x0adf('0x21')]||this[_0x0adf('0x20')]!==_0x2c3b60[_0x0adf('0x20')]||this[_0x0adf('0x3f')]!==_0x2c3b60[_0x0adf('0x3f')]||this[_0x0adf('0x40')]!==_0x2c3b60['statusMessage'];_0x10c945=OUTBOUND_COUNTERS['some'](function(_0x369f91){return this[_0x369f91]!==_0x2c3b60[_0x369f91];},this);if(this[_0x0adf('0x41')]&&_0x2c3b60[_0x0adf('0x41')]){_0x5905d6=this[_0x0adf('0x41')][_0x0adf('0x11')]!==_0x2c3b60['Trunk'][_0x0adf('0x11')]||this['Trunk'][_0x0adf('0x4d')]!==_0x2c3b60[_0x0adf('0x41')]['active'];}}return _0x213738||_0x10c945||_0x5905d6;};VoiceQueueSummary[_0x0adf('0x43')]['updateReportFromOutboundQueue']=function(_0x10f793){this['answered']=_0x10f793[_0x0adf('0x14')];this[_0x0adf('0x3f')]=_0x10f793[_0x0adf('0x3f')];this[_0x0adf('0x40')]=_0x10f793[_0x0adf('0x40')];this[_0x0adf('0x39')]=_0x10f793[_0x0adf('0x39')];this[_0x0adf('0x4e')]=_0x10f793[_0x0adf('0x4e')];this['outboundAnswerCallsDay']=_0x10f793['outboundAnswerCallsDay'];this[_0x0adf('0x9')]=_0x10f793['outboundBlacklistCallsDay'];this[_0x0adf('0x27')]=_0x10f793[_0x0adf('0x27')];this[_0x0adf('0x28')]=_0x10f793[_0x0adf('0x28')];this['outboundNoAnswerCallsDay']=_0x10f793[_0x0adf('0xa')];this[_0x0adf('0xb')]=_0x10f793['outboundNoSuchCallsDay'];this[_0x0adf('0x2d')]=_0x10f793[_0x0adf('0x2d')];this[_0x0adf('0xc')]=_0x10f793[_0x0adf('0xc')];this[_0x0adf('0xd')]=_0x10f793[_0x0adf('0xd')];this[_0x0adf('0xf')]=_0x10f793['sumBillable'];this[_0x0adf('0x1a')]=_0x10f793[_0x0adf('0x1a')];this[_0x0adf('0x10')]=_0x10f793[_0x0adf('0x10')];if(this['dialMethod']==='preview'){this[_0x0adf('0xe')]=_0x10f793[_0x0adf('0xe')];}};module['exports']=VoiceQueueSummary;
\ No newline at end of file
+var _0x9fd4=['ringing','talking','waiting','answered','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','ringInUse','loggedin','callers','length','SIP/','online','incall','includes','status','keys','queue','dialer','exten','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','outboundRejectCallsDay','preview','exports','available','loggedIn','loggedInDb','paused'];(function(_0x4c82d2,_0x3456f8){var _0x57b37f=function(_0x322778){while(--_0x322778){_0x4c82d2['push'](_0x4c82d2['shift']());}};_0x57b37f(++_0x3456f8);}(_0x9fd4,0x16c));var _0x49fd=function(_0x1c78dd,_0x117d6e){_0x1c78dd=_0x1c78dd-0x0;var _0x927903=_0x9fd4[_0x1c78dd];return _0x927903;};'use strict';var INBOUND_COUNTERS=[_0x49fd('0x0'),_0x49fd('0x1'),_0x49fd('0x2'),_0x49fd('0x3'),_0x49fd('0x4'),_0x49fd('0x5'),_0x49fd('0x6')];var OUTBOUND_COUNTERS=[_0x49fd('0x0'),_0x49fd('0x7'),'inUse','loggedIn',_0x49fd('0x2'),_0x49fd('0x8'),_0x49fd('0x9'),_0x49fd('0xa'),'outboundBlacklistCallsDay',_0x49fd('0xb'),_0x49fd('0xc'),_0x49fd('0xd'),_0x49fd('0xe'),_0x49fd('0xf'),'outboundRejectCallsDay',_0x49fd('0x10'),_0x49fd('0x3'),_0x49fd('0x11'),_0x49fd('0x5'),_0x49fd('0x12'),_0x49fd('0x13'),_0x49fd('0x14'),'waiting'];function VoiceQueueSummary(_0x70933e){this['id']=_0x70933e['id'];this[_0x49fd('0x15')]=_0x70933e[_0x49fd('0x15')];this[_0x49fd('0x16')]=_0x70933e[_0x49fd('0x16')];this[_0x49fd('0x17')]=_0x70933e[_0x49fd('0x17')]||0x0;this[_0x49fd('0x7')]=_0x70933e[_0x49fd('0x7')]||0x0;this[_0x49fd('0x0')]=_0x70933e[_0x49fd('0x0')]||0x0;this[_0x49fd('0x18')]=_0x70933e[_0x49fd('0x18')]||0x0;this[_0x49fd('0x19')]=_0x70933e[_0x49fd('0x19')]||0x0;this[_0x49fd('0x1a')]=_0x70933e[_0x49fd('0x1a')]||0x0;this[_0x49fd('0x1')]=_0x70933e[_0x49fd('0x1')]||0x0;this[_0x49fd('0x2')]=_0x70933e[_0x49fd('0x2')]||0x0;this[_0x49fd('0x1b')]=_0x70933e[_0x49fd('0x1b')]||0x0;this[_0x49fd('0x1c')]=_0x70933e[_0x49fd('0x1c')]||0x0;this[_0x49fd('0x3')]=_0x70933e['paused']||0x0;this[_0x49fd('0x4')]=_0x70933e[_0x49fd('0x4')]||0x0;this['ringInUse']=_0x70933e['ringInUse'];this[_0x49fd('0x12')]=_0x70933e['sumBillable'];this[_0x49fd('0x13')]=_0x70933e[_0x49fd('0x13')];this['sumHoldTime']=_0x70933e[_0x49fd('0x1d')]||0x0;this[_0x49fd('0x5')]=_0x70933e['talking']||0x0;this[_0x49fd('0x14')]=_0x70933e[_0x49fd('0x14')]||0x0;this[_0x49fd('0x1e')]=_0x70933e[_0x49fd('0x1e')];this[_0x49fd('0x1f')]=_0x70933e[_0x49fd('0x1f')]||0x0;this['unknown']=_0x70933e[_0x49fd('0x20')]||0x0;this[_0x49fd('0x21')]=_0x70933e[_0x49fd('0x21')]||0x0;this['waiting']=_0x70933e[_0x49fd('0x6')]||0x0;if(_0x70933e[_0x49fd('0x1e')]===_0x49fd('0x22')){this['pTalking']=_0x70933e['pTalking']||0x0;this['dialActive']=_0x70933e[_0x49fd('0x23')];this[_0x49fd('0x24')]=_0x70933e[_0x49fd('0x24')];this[_0x49fd('0x25')]=_0x70933e[_0x49fd('0x25')];this[_0x49fd('0x26')]=_0x70933e[_0x49fd('0x26')];this[_0x49fd('0x27')]=_0x70933e['dialOriginateTimeout'];this[_0x49fd('0x28')]=_0x70933e['dialPrefix'];this[_0x49fd('0x29')]=_0x70933e[_0x49fd('0x29')];this['outboundAnswerAgiCallsDay']=_0x70933e[_0x49fd('0x2a')];this[_0x49fd('0xa')]=_0x70933e[_0x49fd('0xa')];this[_0x49fd('0x2b')]=_0x70933e[_0x49fd('0x2b')];this[_0x49fd('0xb')]=_0x70933e[_0x49fd('0xb')];this[_0x49fd('0xc')]=_0x70933e['outboundCongestionCallsDay'];this[_0x49fd('0x2c')]=_0x70933e['outboundDropCallsDayACS'];this[_0x49fd('0x2d')]=_0x70933e['outboundDropCallsDayCallersExit'];this[_0x49fd('0x2e')]=_0x70933e[_0x49fd('0x2e')];this[_0x49fd('0xd')]=_0x70933e['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x70933e['outboundNoSuchCallsDay'];this[_0x49fd('0x2f')]=_0x70933e[_0x49fd('0x2f')];this['outboundReCallsDay']=_0x70933e[_0x49fd('0xf')];this['outboundRejectCallsDay']=_0x70933e['outboundRejectCallsDay'];this[_0x49fd('0x10')]=_0x70933e[_0x49fd('0x10')];this[_0x49fd('0x30')]=_0x70933e[_0x49fd('0x30')];this[_0x49fd('0x31')]=_0x70933e['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x70933e[_0x49fd('0x32')];this[_0x49fd('0x33')]=_0x70933e[_0x49fd('0x33')];this[_0x49fd('0x34')]=_0x70933e['predictiveIntervalDroppedCallsTimeout'];this[_0x49fd('0x35')]=_0x70933e[_0x49fd('0x35')];this[_0x49fd('0x36')]=_0x70933e[_0x49fd('0x36')];this[_0x49fd('0x37')]=_0x70933e[_0x49fd('0x37')];this[_0x49fd('0x38')]=_0x70933e[_0x49fd('0x38')];this[_0x49fd('0x39')]=_0x70933e[_0x49fd('0x39')];this[_0x49fd('0x3a')]=_0x70933e['predictiveIntervalAvailable'];this[_0x49fd('0x3b')]=_0x70933e[_0x49fd('0x3b')];this[_0x49fd('0x8')]=_0x70933e[_0x49fd('0x8')];this[_0x49fd('0x3c')]=_0x70933e[_0x49fd('0x3c')];this[_0x49fd('0x3d')]=_0x70933e[_0x49fd('0x3d')];this[_0x49fd('0x3e')]=_0x70933e['erlangAbandonmentRate'];this[_0x49fd('0x3f')]=_0x70933e['erlangBusyFactor'];this[_0x49fd('0x40')]=_0x70933e[_0x49fd('0x40')];this['startProgressive']=_0x70933e[_0x49fd('0x41')];this[_0x49fd('0x42')]=_0x70933e['message'];this[_0x49fd('0x43')]=_0x70933e['statusMessage'];}if(_0x70933e['Trunk']){this['Trunk']={'id':_0x70933e[_0x49fd('0x44')]['id'],'name':_0x70933e[_0x49fd('0x44')][_0x49fd('0x15')],'active':_0x70933e[_0x49fd('0x44')]['active'],'callerid':_0x70933e[_0x49fd('0x44')][_0x49fd('0x45')]};}}VoiceQueueSummary[_0x49fd('0x46')][_0x49fd('0x47')]=function(_0x115c5a,_0x28d7ea,_0x26a0c7,_0x1f5c18){this['loggedInDb']=0x0;this[_0x49fd('0x5')]=0x0;this[_0x49fd('0x3')]=0x0;this['unknown']=0x0;this[_0x49fd('0x1c')]=0x0;this[_0x49fd('0x19')]=0x0;this['busy']=0x0;this[_0x49fd('0x1a')]=0x0;this['unavailable']=0x0;this[_0x49fd('0x4')]=0x0;this[_0x49fd('0x48')]=0x0;this[_0x49fd('0x1b')]=0x0;if(_0x26a0c7){if(_0x26a0c7[_0x49fd('0x0')]){this['available']=Number(_0x26a0c7['available']);}if(_0x26a0c7[_0x49fd('0x49')]){this['loggedIn']=Number(_0x26a0c7[_0x49fd('0x49')]);}if(_0x26a0c7[_0x49fd('0x4a')]){this[_0x49fd('0x6')]=Number(_0x26a0c7[_0x49fd('0x4a')]);}}for(var _0x5d32d7=0x0;_0x5d32d7<_0x115c5a[_0x49fd('0x4b')];_0x5d32d7++){var _0x29bcbf=_0x28d7ea[_0x49fd('0x4c')+_0x115c5a[_0x5d32d7][_0x49fd('0x15')]];if(_0x29bcbf&&_0x29bcbf[_0x49fd('0x4d')]){this[_0x49fd('0x2')]+=0x1;}if(_0x115c5a[_0x5d32d7][_0x49fd('0x4e')]==='1'){this[_0x49fd('0x5')]+=0x1;}if(_0x115c5a[_0x5d32d7][_0x49fd('0x3')]==='1'&&!['2','7','8'][_0x49fd('0x4f')](_0x115c5a[_0x5d32d7][_0x49fd('0x50')])){this[_0x49fd('0x3')]+=0x1;}switch(_0x115c5a[_0x5d32d7][_0x49fd('0x50')]){case'0':this[_0x49fd('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x49fd('0x18')]+=0x1;break;case'4':this[_0x49fd('0x1a')]+=0x1;break;case'5':this[_0x49fd('0x1f')]+=0x1;break;case'6':this[_0x49fd('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x49fd('0x1b')]+=0x1;break;}}if(this[_0x49fd('0x24')]==='booked'){var _0x341728=Object[_0x49fd('0x51')](_0x1f5c18);for(var _0xaac56f=0x0;_0xaac56f<_0x341728[_0x49fd('0x4b')];_0xaac56f++){var _0x1316cb=_0x341728[_0xaac56f];var _0x3c6070=_0x1f5c18[_0x1316cb];if(_0x3c6070[_0x49fd('0x52')]===this[_0x49fd('0x15')]&&_0x3c6070[_0x49fd('0x1e')]===_0x49fd('0x53')&&_0x3c6070[_0x49fd('0x54')]==='xcally-motion-preview'){this[_0x49fd('0x5')]+=0x1;}}if(this[_0x49fd('0x5')]>this[_0x49fd('0x19')]){this[_0x49fd('0x5')]=this[_0x49fd('0x19')];}this[_0x49fd('0x11')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x436a03){var _0x765bca=![];if(_0x436a03){_0x765bca=INBOUND_COUNTERS[_0x49fd('0x55')](function(_0x5c34c0){return this[_0x5c34c0]!==_0x436a03[_0x5c34c0];},this);}return _0x765bca;};VoiceQueueSummary[_0x49fd('0x46')][_0x49fd('0x56')]=function(_0x5d5dd5){var _0x501a05=![];var _0x5c3268=![];var _0x49c53b=![];if(_0x5d5dd5){_0x501a05=this['dialMethod']!==_0x5d5dd5['dialMethod']||this['dialActive']!==_0x5d5dd5[_0x49fd('0x23')]||this[_0x49fd('0x42')]!==_0x5d5dd5[_0x49fd('0x42')]||this[_0x49fd('0x43')]!==_0x5d5dd5[_0x49fd('0x43')];_0x5c3268=OUTBOUND_COUNTERS[_0x49fd('0x55')](function(_0x39a2a5){return this[_0x39a2a5]!==_0x5d5dd5[_0x39a2a5];},this);if(this[_0x49fd('0x44')]&&_0x5d5dd5[_0x49fd('0x44')]){_0x49c53b=this[_0x49fd('0x44')]['name']!==_0x5d5dd5[_0x49fd('0x44')][_0x49fd('0x15')]||this[_0x49fd('0x44')][_0x49fd('0x57')]!==_0x5d5dd5[_0x49fd('0x44')][_0x49fd('0x57')];}}return _0x501a05||_0x5c3268||_0x49c53b;};VoiceQueueSummary['prototype'][_0x49fd('0x58')]=function(_0x40f18c){this['answered']=_0x40f18c['answered'];this[_0x49fd('0x42')]=_0x40f18c['message'];this[_0x49fd('0x43')]=_0x40f18c['statusMessage'];this[_0x49fd('0x8')]=_0x40f18c['originated'];this[_0x49fd('0x9')]=_0x40f18c[_0x49fd('0x9')];this['outboundAnswerCallsDay']=_0x40f18c[_0x49fd('0xa')];this[_0x49fd('0x2b')]=_0x40f18c[_0x49fd('0x2b')];this[_0x49fd('0xb')]=_0x40f18c[_0x49fd('0xb')];this[_0x49fd('0xc')]=_0x40f18c[_0x49fd('0xc')];this[_0x49fd('0xd')]=_0x40f18c['outboundNoAnswerCallsDay'];this[_0x49fd('0xe')]=_0x40f18c[_0x49fd('0xe')];this[_0x49fd('0xf')]=_0x40f18c['outboundReCallsDay'];this[_0x49fd('0x59')]=_0x40f18c[_0x49fd('0x59')];this[_0x49fd('0x10')]=_0x40f18c[_0x49fd('0x10')];this[_0x49fd('0x12')]=_0x40f18c[_0x49fd('0x12')];this[_0x49fd('0x13')]=_0x40f18c[_0x49fd('0x13')];this[_0x49fd('0x14')]=_0x40f18c['total'];if(this[_0x49fd('0x24')]===_0x49fd('0x5a')){this['pTalking']=_0x40f18c[_0x49fd('0x11')];}};module[_0x49fd('0x5b')]=VoiceQueueSummary;
\ No newline at end of file
index 946134b..830dbeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff3=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x1437e8,_0x17200a){var _0x5ca4a3=function(_0x1ff9da){while(--_0x1ff9da){_0x1437e8['push'](_0x1437e8['shift']());}};_0x5ca4a3(++_0x17200a);}(_0x8ff3,0x72));var _0x38ff=function(_0x201d02,_0x16330b){_0x201d02=_0x201d02-0x0;var _0x549a99=_0x8ff3[_0x201d02];return _0x549a99;};'use strict';function VtigerAccount(_0x507bab){this['id']=_0x507bab['id']||0x0;this[_0x38ff('0x0')]=_0x507bab['name']||'';this[_0x38ff('0x1')]=_0x507bab[_0x38ff('0x1')]||'';this[_0x38ff('0x2')]=_0x507bab[_0x38ff('0x2')]||'';this[_0x38ff('0x3')]=_0x507bab['remoteUri']||'';this['serverUrl']=_0x507bab[_0x38ff('0x4')]||'';this['Configurations']=_0x507bab[_0x38ff('0x5')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0x4f75=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xf75641,_0x3c3bdb){var _0x52b22e=function(_0x52edf3){while(--_0x52edf3){_0xf75641['push'](_0xf75641['shift']());}};_0x52b22e(++_0x3c3bdb);}(_0x4f75,0xbb));var _0x54f7=function(_0x5e746e,_0x124af8){_0x5e746e=_0x5e746e-0x0;var _0x12b75a=_0x4f75[_0x5e746e];return _0x12b75a;};'use strict';function VtigerAccount(_0x5ed774){this['id']=_0x5ed774['id']||0x0;this[_0x54f7('0x0')]=_0x5ed774['name']||'';this[_0x54f7('0x1')]=_0x5ed774[_0x54f7('0x1')]||'';this['accessKey']=_0x5ed774[_0x54f7('0x2')]||'';this[_0x54f7('0x3')]=_0x5ed774[_0x54f7('0x3')]||'';this[_0x54f7('0x4')]=_0x5ed774[_0x54f7('0x4')]||'';this[_0x54f7('0x5')]=_0x5ed774['Configurations']||{};}module[_0x54f7('0x6')]=VtigerAccount;
\ No newline at end of file
index 1c81344..d13ff56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b0=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x1b4878,_0x4bd5e8){var _0x1829dc=function(_0x58400d){while(--_0x58400d){_0x1b4878['push'](_0x1b4878['shift']());}};_0x1829dc(++_0x4bd5e8);}(_0xb0b0,0x17d));var _0x0b0b=function(_0x598475,_0x4405d2){_0x598475=_0x598475-0x0;var _0x304ec2=_0xb0b0[_0x598475];return _0x304ec2;};'use strict';function ZendeskAccount(_0x5a8a09){this['id']=_0x5a8a09['id']||0x0;this[_0x0b0b('0x0')]=_0x5a8a09[_0x0b0b('0x0')]||'';this[_0x0b0b('0x1')]=_0x5a8a09['username']||'';this['password']=_0x5a8a09[_0x0b0b('0x2')]||'';this[_0x0b0b('0x3')]=_0x5a8a09[_0x0b0b('0x3')]||'';this[_0x0b0b('0x4')]=_0x5a8a09['remoteUri']||'';this[_0x0b0b('0x5')]=_0x5a8a09[_0x0b0b('0x5')]||'';this[_0x0b0b('0x6')]=_0x5a8a09['type']||'integrationTab';this[_0x0b0b('0x7')]=_0x5a8a09[_0x0b0b('0x7')]||'';this[_0x0b0b('0x8')]=_0x5a8a09[_0x0b0b('0x8')]||{};}module[_0x0b0b('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0xd41e=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xd41e,0x90));var _0xed41=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xd41e[_0x3b2244];return _0x2dcc14;};'use strict';function ZendeskAccount(_0x597272){this['id']=_0x597272['id']||0x0;this[_0xed41('0x0')]=_0x597272[_0xed41('0x0')]||'';this[_0xed41('0x1')]=_0x597272[_0xed41('0x1')]||'';this['password']=_0x597272[_0xed41('0x2')]||'';this[_0xed41('0x3')]=_0x597272[_0xed41('0x3')]||'';this[_0xed41('0x4')]=_0x597272['remoteUri']||'';this['authType']=_0x597272[_0xed41('0x5')]||'';this['type']=_0x597272['type']||_0xed41('0x6');this[_0xed41('0x7')]=_0x597272[_0xed41('0x7')]||'';this[_0xed41('0x8')]=_0x597272['Configurations']||{};}module[_0xed41('0x9')]=ZendeskAccount;
\ No newline at end of file
index 2158b05..cfff748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c9=['refreshToken','Configurations','exports','name','description','host','zone','clientSecret','serverUrl','code'];(function(_0x2558b9,_0x11beba){var _0xaa88e6=function(_0x58b674){while(--_0x58b674){_0x2558b9['push'](_0x2558b9['shift']());}};_0xaa88e6(++_0x11beba);}(_0xe0c9,0xcb));var _0x9e0c=function(_0x236784,_0x475f23){_0x236784=_0x236784-0x0;var _0x394338=_0xe0c9[_0x236784];return _0x394338;};'use strict';function ZohoAccount(_0x1c5d28){this['id']=_0x1c5d28['id']||0x0;this[_0x9e0c('0x0')]=_0x1c5d28[_0x9e0c('0x0')]||'';this[_0x9e0c('0x1')]=_0x1c5d28[_0x9e0c('0x1')]||'';this[_0x9e0c('0x2')]=_0x1c5d28[_0x9e0c('0x2')]||'';this[_0x9e0c('0x3')]=_0x1c5d28[_0x9e0c('0x3')]||'';this['clientId']=_0x1c5d28['clientId']||'';this[_0x9e0c('0x4')]=_0x1c5d28[_0x9e0c('0x4')]||'';this[_0x9e0c('0x5')]=_0x1c5d28[_0x9e0c('0x5')]||'';this[_0x9e0c('0x6')]=_0x1c5d28[_0x9e0c('0x6')]||'';this[_0x9e0c('0x7')]=_0x1c5d28['refreshToken']||'';this['Configurations']=_0x1c5d28[_0x9e0c('0x8')]||{};}module[_0x9e0c('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0xde8b=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x451dfd,_0x1c51ff){var _0x3e88f1=function(_0x671370){while(--_0x671370){_0x451dfd['push'](_0x451dfd['shift']());}};_0x3e88f1(++_0x1c51ff);}(_0xde8b,0x7b));var _0xbde8=function(_0xb74c43,_0x2495b0){_0xb74c43=_0xb74c43-0x0;var _0xf2eb4=_0xde8b[_0xb74c43];return _0xf2eb4;};'use strict';function ZohoAccount(_0x30f4a3){this['id']=_0x30f4a3['id']||0x0;this[_0xbde8('0x0')]=_0x30f4a3[_0xbde8('0x0')]||'';this[_0xbde8('0x1')]=_0x30f4a3[_0xbde8('0x1')]||'';this[_0xbde8('0x2')]=_0x30f4a3['host']||'';this[_0xbde8('0x3')]=_0x30f4a3['zone']||'';this[_0xbde8('0x4')]=_0x30f4a3[_0xbde8('0x4')]||'';this[_0xbde8('0x5')]=_0x30f4a3[_0xbde8('0x5')]||'';this[_0xbde8('0x6')]=_0x30f4a3[_0xbde8('0x6')]||'';this[_0xbde8('0x7')]=_0x30f4a3[_0xbde8('0x7')]||'';this[_0xbde8('0x8')]=_0x30f4a3[_0xbde8('0x8')]||'';this[_0xbde8('0x9')]=_0x30f4a3[_0xbde8('0x9')]||{};}module[_0xbde8('0xa')]=ZohoAccount;
\ No newline at end of file
index 7bf735e..140a87c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['name','type','campaigntype','dialAnswer','Agent','membername','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x486ceb,_0x4dd1a7){var _0x62734b=function(_0x3326aa){while(--_0x3326aa){_0x486ceb['push'](_0x486ceb['shift']());}};_0x62734b(++_0x4dd1a7);}(_0x57ca,0x108));var _0xa57c=function(_0x3fcf87,_0x7aa200){_0x3fcf87=_0x3fcf87-0x0;var _0x21c82a=_0x57ca[_0x3fcf87];return _0x21c82a;};'use strict';var util=require('util');var _=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));function checkNameSurname(_0x4b1712,_0x3a7394,_0x396613){var _0x1d38e7='';if(!_[_0xa57c('0x2')](_0x3a7394)&&_0xa57c('0x3')===typeof _0x3a7394){_0x1d38e7+=_0x3a7394;}if(!_['isNil'](_0x396613)&&_0xa57c('0x3')===typeof _0x396613){_0x1d38e7+='\x20'+_0x396613;}if(_0x1d38e7!==''){return _0x1d38e7;}return _0x4b1712;}function Action(_0x1c3e31,_0x113dcf,_0x19473f,_0xbdfffb,_0x314574){this[_0xa57c('0x4')]=_0x19473f||undefined;this[_0xa57c('0x5')]=_0x1c3e31['id'];this['queue']=_0x113dcf[_0xa57c('0x6')];this['type']=_0x113dcf[_0xa57c('0x7')];this[_0xa57c('0x8')]='queue';this[_0xa57c('0x9')]=![];this['membername']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?undefined:_0x1c3e31['Agent'][_0xa57c('0x6')];this['channelAgent']=this[_0xa57c('0xb')]?util[_0xa57c('0xc')](_0xa57c('0xd'),this[_0xa57c('0xb')]):_0xbdfffb||undefined;this[_0xa57c('0xe')]=checkNameSurname(_0x1c3e31['Contact'][_0xa57c('0xf')],_0x1c3e31['Contact'][_0xa57c('0x10')],_0x1c3e31[_0xa57c('0x11')][_0xa57c('0x12')]);this[_0xa57c('0x13')]=_0x1c3e31[_0xa57c('0x13')]||![];this[_0xa57c('0x14')]=_0x1c3e31[_0xa57c('0xf')];this['scheduledat']=_0x1c3e31[_0xa57c('0x15')];this[_0xa57c('0x16')]=_0x1c3e31[_0xa57c('0x16')]||0x0;this['countcongestionretry']=_0x1c3e31[_0xa57c('0x17')]||0x0;this['countnoanswerretry']=_0x1c3e31[_0xa57c('0x18')]||0x0;this[_0xa57c('0x19')]=(_0x1c3e31[_0xa57c('0x16')]||0x0)+(_0x1c3e31[_0xa57c('0x17')]||0x0)+(_0x1c3e31[_0xa57c('0x18')]||0x0)+(_0x1c3e31[_0xa57c('0x1a')]||0x0)+(_0x1c3e31[_0xa57c('0x1b')]||0x0)+(_0x1c3e31[_0xa57c('0x1c')]||0x0)+(_0x1c3e31['countmachineretry']||0x0)+(_0x1c3e31[_0xa57c('0x1d')]||0x0);this['countnosuchnumberretry']=_0x1c3e31['countnosuchnumberretry']||0x0;this[_0xa57c('0x1b')]=_0x1c3e31[_0xa57c('0x1b')]||0x0;this[_0xa57c('0x1c')]=_0x1c3e31[_0xa57c('0x1c')]||0x0;this['countmachineretry']=_0x1c3e31[_0xa57c('0x1e')]||0x0;this[_0xa57c('0x1d')]=_0x1c3e31[_0xa57c('0x1d')]||0x0;this[_0xa57c('0x1f')]=_0x1c3e31[_0xa57c('0x1f')];this[_0xa57c('0x20')]=_0x1c3e31[_0xa57c('0x20')];this[_0xa57c('0x21')]=_0x1c3e31[_0xa57c('0x21')];this[_0xa57c('0x22')]=_0x1c3e31[_0xa57c('0x22')];this[_0xa57c('0x23')]=_0x1c3e31[_0xa57c('0x23')];this[_0xa57c('0x24')]=_0x1c3e31[_0xa57c('0x24')];this['UserId']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?_0x1c3e31[_0xa57c('0x25')]:_0x1c3e31[_0xa57c('0xa')]['id'];this[_0xa57c('0x26')]=_0x1c3e31[_0xa57c('0x26')];this[_0xa57c('0x27')]='';this[_0xa57c('0x28')]='';}Action[_0xa57c('0x29')][_0xa57c('0x2a')]=function(){return util['format'](_0xa57c('0x2b'),this['calleridname'],this['number']);};module[_0xa57c('0x2c')]=Action;
\ No newline at end of file
+var _0x1893=['type','queue','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','idContact','name'];(function(_0x2dc43f,_0x23af70){var _0x443201=function(_0x5cd1a7){while(--_0x5cd1a7){_0x2dc43f['push'](_0x2dc43f['shift']());}};_0x443201(++_0x23af70);}(_0x1893,0xa2));var _0x3189=function(_0x1fc735,_0x11db60){_0x1fc735=_0x1fc735-0x0;var _0x574095=_0x1893[_0x1fc735];return _0x574095;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3189('0x0'));function checkNameSurname(_0x3aec2b,_0x1b12ad,_0x106df4){var _0x10c189='';if(!_[_0x3189('0x1')](_0x1b12ad)&&_0x3189('0x2')===typeof _0x1b12ad){_0x10c189+=_0x1b12ad;}if(!_['isNil'](_0x106df4)&&_0x3189('0x2')===typeof _0x106df4){_0x10c189+='\x20'+_0x106df4;}if(_0x10c189!==''){return _0x10c189;}return _0x3aec2b;}function Action(_0x4faebf,_0x2333e6,_0x4080a9,_0x77c566,_0x118970){this[_0x3189('0x3')]=_0x4080a9||undefined;this[_0x3189('0x4')]=_0x4faebf['id'];this['queue']=_0x2333e6[_0x3189('0x5')];this['type']=_0x2333e6[_0x3189('0x6')];this['campaigntype']=_0x3189('0x7');this[_0x3189('0x8')]=![];this[_0x3189('0x9')]=_[_0x3189('0x1')](_0x4faebf['Agent'])?undefined:_0x4faebf[_0x3189('0xa')][_0x3189('0x5')];this[_0x3189('0xb')]=this[_0x3189('0x9')]?util[_0x3189('0xc')]('SIP/%s',this[_0x3189('0x9')]):_0x77c566||undefined;this[_0x3189('0xd')]=checkNameSurname(_0x4faebf[_0x3189('0xe')][_0x3189('0xf')],_0x4faebf[_0x3189('0xe')][_0x3189('0x10')],_0x4faebf[_0x3189('0xe')][_0x3189('0x11')]);this['active']=_0x4faebf[_0x3189('0x12')]||![];this[_0x3189('0x13')]=_0x4faebf[_0x3189('0xf')];this[_0x3189('0x14')]=_0x4faebf['scheduledat'];this[_0x3189('0x15')]=_0x4faebf['countbusyretry']||0x0;this['countcongestionretry']=_0x4faebf[_0x3189('0x16')]||0x0;this['countnoanswerretry']=_0x4faebf[_0x3189('0x17')]||0x0;this[_0x3189('0x18')]=(_0x4faebf[_0x3189('0x15')]||0x0)+(_0x4faebf[_0x3189('0x16')]||0x0)+(_0x4faebf['countnoanswerretry']||0x0)+(_0x4faebf[_0x3189('0x19')]||0x0)+(_0x4faebf[_0x3189('0x1a')]||0x0)+(_0x4faebf[_0x3189('0x1b')]||0x0)+(_0x4faebf['countmachineretry']||0x0)+(_0x4faebf[_0x3189('0x1c')]||0x0);this[_0x3189('0x19')]=_0x4faebf[_0x3189('0x19')]||0x0;this[_0x3189('0x1a')]=_0x4faebf[_0x3189('0x1a')]||0x0;this['countabandonedretry']=_0x4faebf[_0x3189('0x1b')]||0x0;this[_0x3189('0x1d')]=_0x4faebf[_0x3189('0x1d')]||0x0;this['countagentrejectretry']=_0x4faebf[_0x3189('0x1c')]||0x0;this['callback']=_0x4faebf[_0x3189('0x1e')];this[_0x3189('0x1f')]=_0x4faebf[_0x3189('0x1f')];this[_0x3189('0x20')]=_0x4faebf[_0x3189('0x20')];this[_0x3189('0x21')]=_0x4faebf['recallme'];this['ContactId']=_0x4faebf[_0x3189('0x22')];this[_0x3189('0x23')]=_0x4faebf[_0x3189('0x23')];this[_0x3189('0x24')]=_[_0x3189('0x1')](_0x4faebf[_0x3189('0xa')])?_0x4faebf[_0x3189('0x24')]:_0x4faebf[_0x3189('0xa')]['id'];this[_0x3189('0x25')]=_0x4faebf[_0x3189('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0x3189('0x26')]=function(){return util[_0x3189('0xc')](_0x3189('0x27'),this[_0x3189('0xd')],this[_0x3189('0x28')]);};module[_0x3189('0x29')]=Action;
\ No newline at end of file
index 6d2b67c..64c7d26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x547e=['pTalking','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[action]','getContactRecallMe','agentReadyId','length','getDiff','dialRecallMeTimeout','Agent','run','then','logger2','catch','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','emit','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','pTalking:\x20','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','countbusyretry','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','disableContact','getContactPreview','recallme','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','addVariables','setXMDContactVariables','Contact','assign','starttime','variables','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variable','keys','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','moment','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','campaignsPreview','clockClearZombieChannels','hasOwnProperty','dialMethod','preview','booked','outbound','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','Queue','actions','originated:\x20','queue'];(function(_0x5b6ea8,_0x339684){var _0x4929ac=function(_0x1e012f){while(--_0x1e012f){_0x5b6ea8['push'](_0x5b6ea8['shift']());}};_0x4929ac(++_0x339684);}(_0x547e,0xfd));var _0xe547=function(_0x45aed7,_0x4d4d09){_0x45aed7=_0x45aed7-0x0;var _0xe9c874=_0x547e[_0x45aed7];return _0xe9c874;};'use strict';var util=require(_0xe547('0x0'));var _=require('lodash');var uuid=require(_0xe547('0x1'));var moment=require(_0xe547('0x2'));var Redis=require('ioredis');var config=require(_0xe547('0x3'));var logger=require(_0xe547('0x4'))('preview');var loggerAction=require(_0xe547('0x4'))(_0xe547('0x5'));var ami=require('../ami');var rpcDb=require(_0xe547('0x6'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xe547('0x7'));var ut=require(_0xe547('0x8'));var utils=require('../dialer/utils');config[_0xe547('0x9')]=_[_0xe547('0xa')](config[_0xe547('0x9')],{'host':_0xe547('0xb'),'port':0x18eb});var io=require(_0xe547('0xc'))(new Redis(config[_0xe547('0x9')]));var Sequence=function(){};Sequence[_0xe547('0xd')][_0xe547('0xe')]=function(_0x3097e9){this[_0xe547('0xf')]=this[_0xe547('0xf')]?this[_0xe547('0xf')]['finally'](_0x3097e9):_0x3097e9();};function Preview(_0x726832){this[_0xe547('0x10')]=new Sequence();this['campaignsPreview']=_0x726832[_0xe547('0x11')];this[_0xe547('0x12')]=_0x726832['trunks'];this['actions']={};this[_0xe547('0x13')]=_0x726832['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xe547('0x14'),this[_0xe547('0x15')][_0xe547('0x16')](this));ami['on'](_0xe547('0x17'),this['syncHangup'][_0xe547('0x16')](this));ami['on']('hanguprequest',this[_0xe547('0x18')]['bind'](this));ami['on'](_0xe547('0x19'),this[_0xe547('0x1a')][_0xe547('0x16')](this));ami['on'](_0xe547('0x1b'),this[_0xe547('0x1c')][_0xe547('0x16')](this));ami['on'](_0xe547('0x1d'),this['syncVarSet'][_0xe547('0x16')](this));ami['on'](_0xe547('0x1e'),this[_0xe547('0x1f')][_0xe547('0x16')](this));ami['on'](_0xe547('0x20'),this[_0xe547('0x21')][_0xe547('0x16')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x272bd8,_0x5c9856,_0x2e59cc){io['to'](_0x272bd8)['emit'](_0x5c9856,_0x2e59cc);}function emitVoiceQueueChannelRemove(_0x30e2ce){logger['info'](_0xe547('0x22'),JSON[_0xe547('0x23')](_0x30e2ce));emit(util['format']('voice:queue:%s',_0x30e2ce[_0xe547('0x24')]),_0xe547('0x25'),_0x30e2ce);io['emit'](_0xe547('0x26'),_0x30e2ce);}function notSendMessagesQueue(_0x259644){if(_0x259644[_0xe547('0x27')]){if(_0x259644[_0xe547('0x28')]===0x0&&_0x259644['pTalking']===0x0){_0x259644[_0xe547('0x27')]=![];_0x259644[_0xe547('0x29')]=0x0;_0x259644[_0xe547('0x2a')]=0x0;_0x259644[_0xe547('0x2b')]=utils[_0xe547('0x2c')][_0xe547('0x2d')];ut[_0xe547('0x2e')](_0xe547('0x2f'),_0x259644['name']+'\x20is\x20not\x20active');}else{_0x259644[_0xe547('0x2b')]=utils[_0xe547('0x2c')][_0xe547('0x30')];ut[_0xe547('0x2e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x259644['name']+_0xe547('0x31'));}}}Preview[_0xe547('0xd')][_0xe547('0x32')]=function(){var _0x2c97a5=this;setInterval(function(){_0x2c97a5[_0xe547('0x33')]();},0x7cf);};Preview[_0xe547('0xd')]['syncCampaigns']=function(){var _0x4a23a6=this[_0xe547('0x34')];this[_0xe547('0x35')]+=0x1;for(var _0x588cf9 in _0x4a23a6){if(_0x4a23a6[_0xe547('0x36')](_0x588cf9)&&(_0x4a23a6[_0x588cf9][_0xe547('0x37')]===_0xe547('0x38')||_0x4a23a6[_0x588cf9]['dialMethod']===_0xe547('0x39'))&&_0x4a23a6[_0x588cf9]['type']===_0xe547('0x3a')){if(this[_0xe547('0x35')]>0x7){this[_0xe547('0x35')]=0x0;this['clearZombieChannels']();}}if(_0x4a23a6['hasOwnProperty'](_0x588cf9)&&_0x4a23a6[_0x588cf9][_0xe547('0x37')]===_0xe547('0x38')&&_0x4a23a6[_0x588cf9]['type']==='outbound'){if(_0x4a23a6[_0x588cf9][_0xe547('0x3b')]){this[_0xe547('0x3c')](_0x4a23a6[_0x588cf9]);if(_0x4a23a6[_0x588cf9][_0xe547('0x3d')])this[_0xe547('0x3e')](_0x4a23a6[_0x588cf9]);}else{notSendMessagesQueue(_0x4a23a6[_0x588cf9]);}}}};Preview[_0xe547('0xd')][_0xe547('0x3f')]=function(_0x2eb357){var _0x53c020=this;this[_0xe547('0x10')][_0xe547('0xe')](function(){if(!_[_0xe547('0x40')](_0x53c020['actions'][_0x2eb357])){loggerAction[_0xe547('0x41')]('[clearZombieChannels][talking]',_0x2eb357,_0xe547('0x42'),_0x53c020[_0xe547('0x43')][_0x2eb357]['queue'],_0xe547('0x44'),JSON[_0xe547('0x23')](_0x53c020[_0xe547('0x34')][_0x53c020['actions'][_0x2eb357][_0xe547('0x45')]][_0xe547('0x28')]),'pTalking:\x20',JSON[_0xe547('0x23')](_0x53c020[_0xe547('0x34')][_0x53c020[_0xe547('0x43')][_0x2eb357][_0xe547('0x45')]][_0xe547('0x46')]),JSON[_0xe547('0x23')](_0x53c020['actions'][_0x2eb357]['dialAnswer']),JSON[_0xe547('0x23')](_[_0xe547('0x47')](_0x53c020['actions'][_0x2eb357],[_0xe547('0x48'),_0xe547('0x49'),_0xe547('0x4a'),_0xe547('0x4b')])));return ami['Action']({'action':_0xe547('0x4c'),'channel':_0x53c020[_0xe547('0x43')][_0x2eb357][_0xe547('0x4d')]})['catch'](function(_0x348780){if(_0x348780[_0xe547('0x2b')]===_0xe547('0x4e')){setTimeout(function(){if(_0x53c020[_0xe547('0x43')][_0x2eb357]){ut['updateOriginated'](_0x53c020[_0xe547('0x34')][_0x53c020[_0xe547('0x43')][_0x2eb357][_0xe547('0x45')]],_0xe547('0x4f'));if(_0x53c020[_0xe547('0x43')][_0x2eb357][_0xe547('0x50')]===!![]){ut[_0xe547('0x51')](_0x53c020[_0xe547('0x34')][_0x53c020[_0xe547('0x43')][_0x2eb357]['queue']],_0xe547('0x4f'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x2eb357,_0x53c020[_0xe547('0x43')][_0x2eb357][_0xe547('0x45')]);}ut[_0xe547('0x52')]('[Dialer][checkChannel][Preview]'+_0x2eb357,_0x53c020[_0xe547('0x43')][_0x2eb357][_0xe547('0x45')]);delete _0x53c020[_0xe547('0x43')][_0x2eb357];}},0x2328);}});}});};Preview[_0xe547('0xd')]['clearZombieChannels']=function(){var _0x4e73ad=this;loggerAction[_0xe547('0x41')](_0xe547('0x53'),_['size'](this['actions']));for(var _0x1e48b9 in this[_0xe547('0x43')]){if(_0x4e73ad[_0xe547('0x43')][_0xe547('0x36')](_0x1e48b9)){_0x4e73ad[_0xe547('0x3f')](_0x1e48b9);}}};Preview['prototype'][_0xe547('0x3e')]=function(_0x3de609){var _0x104961=this;rpcDb[_0xe547('0x54')](_0x3de609['id'],ut[_0xe547('0x55')](this['agents']))['then'](function(_0x3e6f16){if(!_[_0xe547('0x40')](_0x3e6f16)){for(var _0x5caa7b=0x0;_0x5caa7b<_0x3e6f16[_0xe547('0x56')];_0x5caa7b+=0x1){if(ut[_0xe547('0x57')](_0x3e6f16[_0x5caa7b]['scheduledat'])<_0x3de609[_0xe547('0x58')]*0x3c){if(_0x3e6f16[_0x5caa7b][_0xe547('0x59')]&&!_0x3e6f16[_0x5caa7b][_0xe547('0x59')]['voicePause']){_0x104961[_0xe547('0x5a')](_0x3e6f16[_0x5caa7b]['id'])[_0xe547('0x5b')](ut[_0xe547('0x5c')]('[RecallMe]'))[_0xe547('0x5d')](ut[_0xe547('0x5c')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x3e6f16[_0x5caa7b]['id']);}}else{var _0x4f17bf=new Action(_0x3e6f16[_0x5caa7b],_0x3de609);_0x4f17bf['starttime']=moment()[_0xe547('0x5e')](_0xe547('0x5f'));_0x3de609[_0xe547('0x60')]+=0x1;ut[_0xe547('0x61')](_0x4f17bf,0x17,_0xe547('0x62'));if(_0x3de609['dialRecallInQueue']){rpcDb[_0xe547('0x63')](ut[_0xe547('0x64')](_0x3e6f16[_0x5caa7b]));rpcDb[_0xe547('0x65')](_0x4f17bf,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xe547('0x61')](_0x4f17bf,0x16,_0xe547('0x66'));rpcDb['createCustomerHistory'](_0x4f17bf,'[HistoryRecallClose]');rpcDb[_0xe547('0x67')](_0x4f17bf,_0xe547('0x68'));}}}}})['catch'](ut[_0xe547('0x5c')](_0xe547('0x69')));};Preview[_0xe547('0xd')][_0xe547('0x3c')]=function(_0x44eaa8){_0x44eaa8[_0xe547('0x27')]=!![];if(ut[_0xe547('0x6a')](_0x44eaa8[_0xe547('0x6b')])){_0x44eaa8[_0xe547('0x2b')]=utils[_0xe547('0x2c')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xe547('0x6c')](_0x44eaa8['dialActive'])){_0x44eaa8[_0xe547('0x2b')]=utils[_0xe547('0x2c')]['INACTIVE'];}else if(!this[_0xe547('0x6d')](_0x44eaa8[_0xe547('0x6e')])){if(!this[_0xe547('0x6d')](_0x44eaa8[_0xe547('0x6f')])){_0x44eaa8[_0xe547('0x2b')]=utils['CAMPAIGN_STATUS'][_0xe547('0x70')];}else{_0x44eaa8[_0xe547('0x2b')]=utils['CAMPAIGN_STATUS'][_0xe547('0x71')];}}else{_0x44eaa8['message']=utils['CAMPAIGN_STATUS'][_0xe547('0x71')];}};Preview[_0xe547('0xd')][_0xe547('0x72')]=function(_0x46ee84,_0x4c509d,_0x2c593c){var _0x3e5f17=this;var _0x363318=this[_0xe547('0x43')][_0x4c509d];var _0x2b9359=this[_0xe547('0x34')][_0x363318[_0xe547('0x45')]];var _0x2b0162;var _0x5843f2=![];var _0x59e769=0x2;var _0x1d7de8=0x3;if(_0x2b9359){switch(_0x2c593c){case'1':_0x2b9359[_0xe547('0x73')]+=0x1;_0x363318[_0xe547('0x74')]+=0x1;_0x363318[_0xe547('0x75')]=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0x0,_0xe547('0x77'));ami[_0xe547('0x78')]('custom:agentnosuchnumber',ut[_0xe547('0x79')](_0x363318,_0xe547('0x7a')));rpcDb[_0xe547('0x65')](_0x363318,_0xe547('0x7b'));_0x3e5f17[_0xe547('0x7c')](_0x363318,'0',_0x2b9359)[_0xe547('0x5b')](function(_0x10a3ef){_0x5843f2=_0x10a3ef[_0xe547('0x7d')]==0x1;_0x59e769=_0x2b9359[_0xe547('0x7e')];_0x1d7de8=_0x2b9359[_0xe547('0x7f')];if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359['dialGlobalMaxRetry']){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0xf,_0xe547('0x81'));rpcDb[_0xe547('0x67')](_0x2b0162,_0xe547('0x82'));}else{if(_0x363318[_0xe547('0x74')]>=_0x2b9359[_0xe547('0x83')]){rpcDb[_0xe547('0x67')](_0x363318,_0xe547('0x82'));}else{rpcDb[_0xe547('0x84')](ut[_0xe547('0x85')](_0x363318,_0xe547('0x74'),_0x2b9359[_0xe547('0x7e')]),_0x363318[_0xe547('0x86')],_0x363318[_0xe547('0x87')]);}}delete this[_0xe547('0x43')][_0x46ee84[_0xe547('0x88')]];}else{_0x363318[_0xe547('0x74')]++;logger[_0xe547('0x41')](_0xe547('0x89'),_0x363318[_0xe547('0x74')]);logger[_0xe547('0x41')]('id',_0x363318[_0xe547('0x8a')]);_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318[_0xe547('0x8a')],'field':{'countnosuchnumberretry':_0x363318[_0xe547('0x74')]}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});});}});break;case'ANSWER':var _0x168c85=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x363318['responsetime']=_0x168c85;_0x363318[_0xe547('0x8d')]=_0x168c85;_0x363318[_0xe547('0x50')]=!![];_0x2b9359[_0xe547('0x46')]+=0x1;logger[_0xe547('0x41')](_0xe547('0x8e'),_0x363318[_0xe547('0x8f')],_0xe547('0x90'),_0x2b9359['name'],'pTalking:\x20',_0x2b9359[_0xe547('0x46')]);ami[_0xe547('0x78')](_0xe547('0x91'),ut[_0xe547('0x79')](_0x363318,_0xe547('0x92'),this['campaignsPreview'][_0x363318[_0xe547('0x45')]]));if(_0x2b9359[_0xe547('0x93')]){ami['emit'](_0xe547('0x94'),ut[_0xe547('0x95')](_0x363318));}break;case'16':ami[_0xe547('0x78')](_0xe547('0x96'),ut[_0xe547('0x79')](_0x363318,_0xe547('0x97'),this[_0xe547('0x34')][_0x363318['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x363318,_0xe547('0x97')));_0x2b9359['outboundAnswerCallsDay']+=0x1;_0x2b9359[_0xe547('0x98')]+=0x1;_0x2b9359[_0xe547('0x99')]+=0x1;ut[_0xe547('0x51')](_0x2b9359,_0xe547('0x9a'));_0x363318[_0xe547('0x75')]=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0x4,_0xe547('0x9b'));rpcDb[_0xe547('0x65')](_0x363318,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x363318,_0xe547('0x9c'));rpcDb[_0xe547('0x9d')](_0x363318);_0x2b9359[_0xe547('0x9e')]+=_0x363318['talktime'];_0x2b9359['sumBillable']+=_0x363318[_0xe547('0x9f')];logger[_0xe547('0x41')]('[syncHangup][talking][decrement]',_0x363318[_0xe547('0x8f')],_0xe547('0x90'),_0x2b9359['name'],_0xe547('0xa0'),_0x2b9359['pTalking']);delete this[_0xe547('0x43')][_0x46ee84[_0xe547('0x88')]];break;case _0xe547('0xa1'):_0x2b9359[_0xe547('0xa2')]+=0x1;_0x363318['countbusyretry']+=0x1;_0x363318[_0xe547('0x75')]=ut['totalGlobal'](_0x363318);ut[_0xe547('0x61')](_0x363318,0x5,_0xe547('0xa3'));_0x59e769=_0x2b9359['dialBusyRetryFrequency'];_0x1d7de8=_0x2b9359[_0xe547('0x7f')];ami[_0xe547('0x78')](_0xe547('0xa4'),ut[_0xe547('0x79')](_0x363318,_0xe547('0xa5')));rpcDb[_0xe547('0x65')](_0x363318,_0xe547('0xa6'));_0x3e5f17[_0xe547('0x7c')](_0x363318,'5',_0x2b9359)[_0xe547('0x5b')](function(_0x24e357){_0x5843f2=_0x24e357['additional']==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359[_0xe547('0xa7')]){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0xf,_0xe547('0x81'));rpcDb['createCustomerFinal'](_0x2b0162,_0xe547('0xa8'));}else{if(_0x363318['countbusyretry']>=_0x2b9359[_0xe547('0xa9')]){rpcDb[_0xe547('0x67')](_0x363318,_0xe547('0xa6'));}else{rpcDb[_0xe547('0x84')](ut['scheduledAt'](_0x363318,'countbusyretry',_0x2b9359[_0xe547('0xaa')]),_0x363318[_0xe547('0x86')],_0x363318[_0xe547('0x87')]);}}}else{_0x363318[_0xe547('0xab')]++;_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318[_0xe547('0x8a')],'field':{'countbusyretry':_0x363318[_0xe547('0xab')]}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)['then'](function(){});});}});break;case _0xe547('0xac'):_0x2b9359[_0xe547('0xad')]+=0x1;_0x363318[_0xe547('0xae')]+=0x1;_0x363318[_0xe547('0x75')]=ut[_0xe547('0x76')](_0x363318);ut['logCustomer'](_0x363318,0x3,_0xe547('0xaf'));_0x59e769=_0x2b9359[_0xe547('0xb0')];_0x1d7de8=_0x2b9359['callAdditionalPhoneAfterMin'];var _0x26c554=ut[_0xe547('0xb1')](_0x363318,_0x2b9359);ami[_0xe547('0x78')](_0xe547('0xb2'),_0x26c554);rpcDb[_0xe547('0x65')](_0x363318,'[callProgressDetectingCustomer][logNoAnswer]');_0x3e5f17[_0xe547('0x7c')](_0x363318,'3',_0x2b9359)[_0xe547('0x5b')](function(_0x43e061){_0x5843f2=_0x43e061[_0xe547('0x7d')]==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359['dialGlobalMaxRetry']){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0xf,'Global');rpcDb[_0xe547('0x67')](_0x2b0162,_0xe547('0xb3'));}else{if(_0x363318[_0xe547('0xae')]>=_0x2b9359['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x363318,_0xe547('0xb4'));}else{rpcDb[_0xe547('0x84')](ut['scheduledAt'](_0x363318,_0xe547('0xae'),_0x2b9359[_0xe547('0xb0')]),_0x363318[_0xe547('0x86')],_0x363318['activeContact']);}}}else{_0x363318['countnoanswerretry']++;_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318['idContact'],'field':{'countnoanswerretry':_0x363318[_0xe547('0xae')]}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});});}});break;case _0xe547('0xb5'):_0x2b9359[_0xe547('0xb6')]+=0x1;_0x363318[_0xe547('0xb7')]+=0x1;_0x363318['countglobal']=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0x8,_0xe547('0xb8'));_0x59e769=_0x2b9359[_0xe547('0xb9')];_0x1d7de8=_0x2b9359[_0xe547('0x7f')];ami[_0xe547('0x78')](_0xe547('0xba'),ut[_0xe547('0x79')](_0x363318,'congestion'));rpcDb[_0xe547('0x65')](_0x363318,_0xe547('0xbb'));_0x3e5f17['verifyAdditionalPhones'](_0x363318,'8',_0x2b9359)['then'](function(_0x318a2a){_0x5843f2=_0x318a2a[_0xe547('0x7d')]==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359['dialGlobalMaxRetry']){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0xf,_0xe547('0x81'));rpcDb[_0xe547('0x67')](_0x2b0162,_0xe547('0xbc'));}else{if(_0x363318[_0xe547('0xb7')]>=_0x2b9359[_0xe547('0xbd')]){rpcDb[_0xe547('0x67')](_0x363318,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xe547('0x84')](ut[_0xe547('0x85')](_0x363318,_0xe547('0xb7'),_0x2b9359[_0xe547('0xaa')]),_0x363318[_0xe547('0x86')],_0x363318['activeContact']);}}}else{_0x363318[_0xe547('0xb7')]++;_0x3e5f17['incrementPreviewCounters']({'id':_0x363318['idContact'],'field':{'countcongestionretry':_0x363318[_0xe547('0xb7')]}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)['then'](function(){});});}});break;case _0xe547('0xbe'):_0x2b9359[_0xe547('0xbf')]+=0x1;_0x363318[_0xe547('0xc0')]+=0x1;_0x363318[_0xe547('0x75')]=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0x14,_0xe547('0xc1'));_0x59e769=_0x2b9359[_0xe547('0xc2')];_0x1d7de8=_0x2b9359[_0xe547('0x7f')];ami[_0xe547('0x78')](_0xe547('0xc3'),ut[_0xe547('0x79')](_0x363318,_0xe547('0xc4')));rpcDb[_0xe547('0x65')](_0x363318,'[syncHangupRequest][logAgentReject]');_0x3e5f17[_0xe547('0x7c')](_0x363318,'20',_0x2b9359)[_0xe547('0x5b')](function(_0x16c949){_0x5843f2=_0x16c949[_0xe547('0x7d')]==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359[_0xe547('0xa7')]){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0x14,_0xe547('0xc1'));rpcDb['createCustomerFinal'](_0x2b0162,_0xe547('0xc5'));}else{if(_0x363318[_0xe547('0xc0')]>=_0x2b9359[_0xe547('0xc6')]){rpcDb[_0xe547('0x67')](_0x363318,_0xe547('0xc5'));}else{rpcDb[_0xe547('0x84')](ut[_0xe547('0x85')](_0x363318,_0xe547('0xc0'),_0x2b9359[_0xe547('0xc2')]),_0x363318['unlockAgent'],_0x363318['activeContact']);}}}else{_0x363318[_0xe547('0xae')]++;_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318['idContact'],'field':{'countnoanswerretry':_0x363318['countnoanswerretry']}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});});}});break;case'ABANDONED':_0x2b9359['outboundAbandonedCallsDay']+=0x1;_0x363318[_0xe547('0xc7')]+=0x1;_0x363318['countglobal']=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0xb,_0xe547('0xc8'));rpcDb['createCustomerHistory'](_0x363318,_0xe547('0xc9'));_0x3e5f17[_0xe547('0x7c')](_0x363318,'11',_0x2b9359)[_0xe547('0x5b')](function(_0x1d308d){_0x5843f2=_0x1d308d['additional']==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359[_0xe547('0xa7')]){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0xf,_0xe547('0x81'));rpcDb[_0xe547('0x67')](_0x2b0162,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x363318[_0xe547('0xca')]>=_0x2b9359[_0xe547('0xcb')]){rpcDb[_0xe547('0x67')](_0x363318,_0xe547('0xc9'));}else{rpcDb[_0xe547('0x84')](ut[_0xe547('0x85')](_0x363318,'countabandonedretry',_0x2b9359[_0xe547('0xcc')]),_0x363318['unlockAgent'],_0x363318[_0xe547('0x87')]);}}}else{_0x363318['countnoanswerretry']++;_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318[_0xe547('0x8a')],'field':{'countnoanswerretry':_0x363318[_0xe547('0xae')]}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});});}});break;case'18':_0x2b9359[_0xe547('0xcd')]+=0x1;_0x363318[_0xe547('0xce')]+=0x1;_0x363318[_0xe547('0x75')]=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0x12,_0x46ee84[_0xe547('0xcf')]||_0x46ee84[_0xe547('0xd0')]);ami[_0xe547('0x78')]('custom:amd',ut['buildObj'](_0x363318,_0xe547('0xd1')));rpcDb[_0xe547('0x65')](_0x363318,_0xe547('0xd2'));_0x3e5f17[_0xe547('0x7c')](_0x363318,'18',_0x2b9359)[_0xe547('0x5b')](function(_0x1f50e1){_0x5843f2=_0x1f50e1['additional']==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359[_0xe547('0xa7')]){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0x12,_0xe547('0x81'));rpcDb['createCustomerFinal'](_0x2b0162,_0xe547('0xd2'));}else{rpcDb[_0xe547('0x67')](_0x363318,_0xe547('0xd2'));}}else{_0x363318[_0xe547('0xae')]++;_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318['idContact'],'field':{'countnoanswerretry':_0x363318['countnoanswerretry']}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});});}});delete this['actions'][_0x46ee84['linkedid']];break;case'19':_0x2b9359[_0xe547('0xcd')]+=0x1;_0x363318[_0xe547('0x75')]=ut['totalGlobal'](_0x363318);ut[_0xe547('0x61')](_0x363318,0x13,_0x46ee84[_0xe547('0xcf')]||_0x46ee84['dialstatus']);ami[_0xe547('0x78')]('custom:amd',ut['buildObj'](_0x363318,'amd'));rpcDb[_0xe547('0x65')](_0x363318,_0xe547('0xd3'));_0x3e5f17['verifyAdditionalPhones'](_0x363318,'18',_0x2b9359)['then'](function(_0xd9b9f7){_0x5843f2=_0xd9b9f7[_0xe547('0x7d')]==0x1;if(!_0x5843f2){if(ut['totalGlobal'](_0x363318)>=_0x2b9359['dialGlobalMaxRetry']){_0x2b0162=ut[_0xe547('0x80')](_0x363318,0xf,_0xe547('0x81'));rpcDb[_0xe547('0x67')](_0x2b0162,_0xe547('0xd3'));}else{rpcDb[_0xe547('0x67')](_0x363318,_0xe547('0xd3'));}}else{_0x363318[_0xe547('0xae')]++;_0x3e5f17[_0xe547('0x8b')]({'id':_0x363318[_0xe547('0x8a')],'field':{'countnoanswerretry':_0x363318[_0xe547('0xae')]}})[_0xe547('0x5b')](function(){_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});});}});delete this[_0xe547('0x43')][_0x46ee84[_0xe547('0x88')]];break;default:if(_0x363318['dialAnswer']){ut['decrementTalkink'](_0x2b9359,_0xe547('0xd4'));ut['loggerError'](_0xe547('0xd5')+_0x2b9359[_0xe547('0x24')],_0x46ee84);}_0x2b9359[_0xe547('0xcd')]+=0x1;_0x363318[_0xe547('0x75')]=ut[_0xe547('0x76')](_0x363318);ut[_0xe547('0x61')](_0x363318,0xc,_0x46ee84[_0xe547('0xcf')]||_0x46ee84[_0xe547('0xd0')]);_0x59e769=_0x2b9359['dialAgentRejectRetryFrequency'];_0x1d7de8=_0x2b9359[_0xe547('0x7f')];rpcDb[_0xe547('0x65')](_0x363318,_0xe547('0xd6'));_0x3e5f17['verifyAdditionalPhones'](_0x363318,'20',_0x2b9359)['then'](function(_0x28fc09){_0x5843f2=_0x28fc09[_0xe547('0x7d')]==0x1;if(!_0x5843f2){if(ut[_0xe547('0x76')](_0x363318)>=_0x2b9359[_0xe547('0xa7')]){_0x2b0162=ut['cloneAction'](_0x363318,0xf,_0xe547('0x81'));rpcDb['createCustomerFinal'](_0x2b0162,_0xe547('0xd7'));}else{rpcDb[_0xe547('0x67')](_0x363318,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe547('0x43')][_0x46ee84['linkedid']];}else{_0x3e5f17[_0xe547('0x8c')](_0x363318,_0x59e769,_0x1d7de8)[_0xe547('0x5b')](function(){});}});}if(!(_0x363318[_0xe547('0x50')]&&_0x2c593c==='16')){ut['updateOriginated'](_0x2b9359,_0xe547('0xd8'));logger['info'](_0xe547('0xd9'),_0x363318[_0xe547('0x8f')],_0xe547('0x90'),_0x2b9359[_0xe547('0x24')],_0xe547('0x44'),_0x2b9359[_0xe547('0x28')]);}if(_0x2c593c!==_0xe547('0xda')){delete this[_0xe547('0x43')][_0x46ee84['linkedid']];delete this[_0xe547('0x43')][_0x46ee84[_0xe547('0xdb')]];}_0x2b9359['queueSummaryCountersUpdated']=!![];}};Preview[_0xe547('0xd')]['callProgressDetectingAgent']=function(_0x1b412f,_0x5480b6,_0x3b4737){if(_[_0xe547('0xdc')](_0x5480b6)&&_0xe547('0xdd')!==typeof _0x5480b6){return;}if(_[_0xe547('0xdc')](_0x3b4737)&&_0xe547('0xdd')!==typeof _0x3b4737){return;}switch(_0x3b4737[_0xe547('0xde')]){case'0':ut['logAgent'](_0x1b412f,0x0,_0xe547('0x77'));rpcDb[_0xe547('0xdf')](_0x1b412f,_0xe547('0xe0'));break;case'3':ut[_0xe547('0xe1')](_0x1b412f,0x3,_0xe547('0xaf'));rpcDb[_0xe547('0xdf')](_0x1b412f,_0xe547('0xe2'));break;case'5':ut[_0xe547('0xe1')](_0x1b412f,0x5,_0xe547('0xa3'));rpcDb['createAgentHistory'](_0x1b412f,_0xe547('0xe3'));break;case'8':ut[_0xe547('0xe1')](_0x1b412f,0x8,_0xe547('0xb8'));rpcDb[_0xe547('0xdf')](_0x1b412f,_0xe547('0xe4'));break;case'22':ut[_0xe547('0xe1')](_0x1b412f,0x16,_0xe547('0xe5'));rpcDb['createAgentHistory'](_0x1b412f,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xe547('0xe1')](_0x1b412f,0xc,_0x3b4737[_0xe547('0xde')]);rpcDb[_0xe547('0xdf')](_0x1b412f,_0xe547('0xe4'));}ut[_0xe547('0xe6')](_0x5480b6,_0xe547('0xe7'));logger[_0xe547('0x41')](_0xe547('0xe8'),_0x1b412f[_0xe547('0x8f')],'\x20Queue',_0x5480b6['name'],_0xe547('0x44'),_0x5480b6[_0xe547('0x28')]);delete this[_0xe547('0x43')][_0x1b412f['uniqueid']];};Preview[_0xe547('0xd')][_0xe547('0x7c')]=function(_0x2dcad1,_0x531894,_0x23a624){return cmHopperAdditionalPhone[_0xe547('0x7c')](_0x2dcad1,_0x531894,_0x23a624)[_0xe547('0x5d')](logger[_0xe547('0x41')](_0xe547('0xe9')));};Preview[_0xe547('0xd')][_0xe547('0x8c')]=function(_0x42415b,_0x27d4e0,_0x433c0d){return cmHopperAdditionalPhone[_0xe547('0x8c')](_0x42415b,_0x27d4e0,_0x433c0d)[_0xe547('0x5d')](logger[_0xe547('0x41')](_0xe547('0xea')));};Preview[_0xe547('0xd')][_0xe547('0x8b')]=function(_0x2596f0){return Promise[_0xe547('0xeb')]()[_0xe547('0x5b')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x2596f0))[_0xe547('0x5d')](logger[_0xe547('0x41')]('[incrementPreviewCounters]\x20'));};Preview[_0xe547('0xd')][_0xe547('0xec')]=function(_0x3541b1,_0x5b9836,_0x89e2fc,_0x13bdc5,_0x5a20dc){var _0x39c613=this;return new Promise(function(_0xef5cf6,_0x5ed64d){if(_[_0xe547('0x40')](_0x5b9836)||_[_0xe547('0x40')](_0x5b9836['Contact'])||_[_0xe547('0x40')](_0x5b9836[_0xe547('0xed')])||_[_0xe547('0x40')](_0x5b9836[_0xe547('0x4a')])){_0x5ed64d(ut['message']('Contact\x20is\x20undefined',_0x13bdc5,_0x5a20dc));return;}var _0x3a12fb=uuid['v4']();var _0xd161b9=_0x39c613[_0xe547('0x34')][_0x5b9836[_0xe547('0x42')][_0xe547('0x24')]];var _0x25c12d=_0x89e2fc?_0x39c613[_0xe547('0x13')][_0x89e2fc]['id']:undefined;_0x39c613[_0xe547('0x43')][_0x3a12fb]=new Action(_0x5b9836,_0xd161b9,_0x3a12fb,_0x89e2fc,_0x25c12d);var _0x3edd85=_0x39c613['actions'][_0x3a12fb];_0x3edd85[_0xe547('0x86')]=_0x13bdc5;_0x3edd85[_0xe547('0x87')]=_0x5a20dc;_0x3edd85[_0xe547('0xee')]=_0x89e2fc;if(_[_0xe547('0xef')](_0x3541b1)){_0x39c613[_0xe547('0xf0')](_0x3edd85,_0xd161b9,_0x5b9836,_0x89e2fc)[_0xe547('0x5b')](function(_0x4d0fec){logger['info'](_0xe547('0xf1'),_0xe547('0xf2')+_0x3edd85[_0xe547('0x45')]+_0xe547('0xf3')+_0x3edd85[_0xe547('0x8a')],JSON[_0xe547('0x23')](_0x4d0fec));ami['emit'](_0xe547('0xf4'),ut['buildObj'](_0x3edd85,_0xe547('0xf5'),_0x39c613[_0xe547('0x34')][_0x3edd85[_0xe547('0x45')]]));_0xef5cf6(ut[_0xe547('0x2b')](_0xe547('0xf6')));})[_0xe547('0x5d')](function(_0x2f9d77){ut[_0xe547('0x2e')](_0xe547('0xf7'),_0x2f9d77);_0x5ed64d(ut[_0xe547('0x2b')](_0xe547('0xf8'),_0x13bdc5,_0x5a20dc));});}else{_0xd161b9[_0xe547('0xf9')]+=0x1;ut[_0xe547('0xfa')](_0x3edd85);rpcDb[_0xe547('0xfb')](_0x3edd85,_0xe547('0xfc'));delete _0x39c613[_0xe547('0x43')][_0x3a12fb];_0x5ed64d(ut[_0xe547('0x2b')](_0xe547('0xfd'),_0x13bdc5,_0x5a20dc));}});};Preview[_0xe547('0xd')][_0xe547('0x6d')]=function(_0xa853f2){return!_[_0xe547('0x40')](_0xa853f2)&&!_[_0xe547('0x40')](_0xa853f2[_0xe547('0x24')])&&!_[_0xe547('0x40')](_0xa853f2[_0xe547('0xfe')])&&_0xa853f2[_0xe547('0xfe')]&&!_['isNil'](this[_0xe547('0x12')][util['format'](_0xe547('0xff'),_0xa853f2[_0xe547('0x24')])])&&!_[_0xe547('0x40')](this['trunks'][util['format'](_0xe547('0xff'),_0xa853f2[_0xe547('0x24')])]['status'])&&(this[_0xe547('0x12')][util[_0xe547('0x5e')](_0xe547('0xff'),_0xa853f2['name'])][_0xe547('0x4c')]==='reachable'||this['trunks'][util[_0xe547('0x5e')](_0xe547('0xff'),_0xa853f2[_0xe547('0x24')])]['status']===_0xe547('0x100'));};Preview[_0xe547('0xd')]['run']=function(_0x2d2d5a,_0x4be9d5){return this[_0xe547('0x101')](_0x2d2d5a,_0x4be9d5)[_0xe547('0x5b')](function(_0x45a00b){return _[_0xe547('0x47')](_0x45a00b,[_0xe547('0x2b')]);})[_0xe547('0x5d')](function(_0x202ab3){if(_0x202ab3['unlock']){rpcDb[_0xe547('0x102')](_0x2d2d5a);}if(_0x202ab3[_0xe547('0xfe')]){rpcDb[_0xe547('0x103')](_0x2d2d5a);}throw _['pick'](_0x202ab3,[_0xe547('0x2b')]);});};Preview[_0xe547('0xd')][_0xe547('0x101')]=function(_0x57172d,_0x3ce55d){var _0x521c45=this;var _0xf5ad54,_0x1eca75;return rpcDb[_0xe547('0x104')](_0x57172d)[_0xe547('0x5b')](function(_0x157118){if(!_[_0xe547('0x40')](_0x157118[0x0])){_0x1eca75=_0x157118[0x0][_0xe547('0x105')]?![]:!![];_0xf5ad54=_0x157118[0x0][_0xe547('0x105')]?!![]:![];_0xf5ad54=_0x3ce55d?!![]:_0xf5ad54;}var _0x21e451=_0x521c45['validateContact'](_0x157118);if(_0x21e451['isValid']){rpcDb[_0xe547('0x106')](_['pick'](_0x157118[0x0],[_0xe547('0x4a'),_0xe547('0xed')]))['then'](function(_0x355615){_0x521c45[_0xe547('0xec')](_0x355615,_0x157118[0x0],_0x3ce55d,_0x1eca75,_0xf5ad54)[_0xe547('0x5b')](function(_0x499f1c){return _0x499f1c;})[_0xe547('0x5d')](function(_0x43721a){throw _0x43721a;});})['catch'](function(_0x19691b){ut[_0xe547('0x2e')](_0xe547('0x107'),_0x19691b);throw ut[_0xe547('0x2b')](_0xe547('0x108'),_0x1eca75,_0xf5ad54);});}else{throw ut['message'](_0x21e451['message'],_0x1eca75,_0xf5ad54);}})[_0xe547('0x5d')](function(_0x4fa0ac){ut[_0xe547('0x2e')](_0xe547('0x109'),_0x4fa0ac);throw ut[_0xe547('0x2b')](_0xe547('0x108'),![],!![]);});};Preview[_0xe547('0xd')][_0xe547('0x10a')]=function(_0xa9fb8d){if(_[_0xe547('0x40')](_0xa9fb8d)||_[_0xe547('0xef')](_0xa9fb8d)||!_['isNil'](_0xa9fb8d[0x0][_0xe547('0x59')])&&_[_0xe547('0x40')](_0xa9fb8d[0x0][_0xe547('0x59')][_0xe547('0x24')])){ut['logger'](_0xe547('0x10b'),_0xa9fb8d);return{'isValid':![],'message':_0xe547('0x10c')};}var _0x9ca1e2=this[_0xe547('0x34')][_0xa9fb8d[0x0]['Queue'][_0xe547('0x24')]];_0x9ca1e2[_0xe547('0x2b')]=utils[_0xe547('0x2c')]['ACTIVE'];if(_['isNil'](_0x9ca1e2)){ut[_0xe547('0x2e')](_0xe547('0x10d'),_0x9ca1e2);return{'isValid':![],'message':_0xe547('0x10e')};}if(!this['isTrunkReachable'](_0x9ca1e2['Trunk'])){ut['logger'](_0xe547('0x10f'),'campaign\x20Name:\x20'+_0x9ca1e2[_0xe547('0x24')]+_0xe547('0x110'));if(!this[_0xe547('0x6d')](_0x9ca1e2['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x9ca1e2[_0xe547('0x24')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe547('0x111')};}}if(!ut[_0xe547('0x6c')](_0x9ca1e2[_0xe547('0x3b')])){ut[_0xe547('0x2e')](_0xe547('0x112'),_0x9ca1e2[_0xe547('0x24')]+_0xe547('0x113'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x9ca1e2['name']+_0xe547('0x113')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0xe547('0xf0')]=function(_0x155ab6,_0x45c6a7,_0x34e85d,_0x34c633){var _0x360566=this;return new Promise(function(_0x11cae9,_0x19a782){var _0x3fb73f=_0x155ab6['uniqueid'];var _0x2deb21=_0x360566['isTrunkReachable'](_0x45c6a7[_0xe547('0x6e')])?util[_0xe547('0x5e')](_0xe547('0x114'),_0x45c6a7['Trunk'][_0xe547('0x24')],_['isNil'](_0x45c6a7[_0xe547('0x115')])?'':_0x45c6a7[_0xe547('0x115')][_0xe547('0x116')]()||'',_0x45c6a7[_0xe547('0x117')]>0x0?_0x34e85d['phone']['substring'](_0x45c6a7[_0xe547('0x117')]):_0x34e85d['phone']):util[_0xe547('0x5e')](_0xe547('0x114'),_[_0xe547('0x40')](_0x45c6a7[_0xe547('0x6f')])?_0x45c6a7['Trunk'][_0xe547('0x24')]:_0x45c6a7[_0xe547('0x6f')][_0xe547('0x24')],_[_0xe547('0x40')](_0x45c6a7[_0xe547('0x115')])?'':_0x45c6a7[_0xe547('0x115')][_0xe547('0x116')]()||'',_0x45c6a7[_0xe547('0x117')]>0x0?_0x34e85d[_0xe547('0xed')][_0xe547('0x118')](_0x45c6a7[_0xe547('0x117')]):_0x34e85d[_0xe547('0xed')]);var _0x390bb7=_0x360566[_0xe547('0x6d')](_0x45c6a7[_0xe547('0x6e')])?ut[_0xe547('0x119')](_0x45c6a7['Trunk'][_0xe547('0x11a')],_0x45c6a7[_0xe547('0x11b')],_0x45c6a7[_0xe547('0x11c')]>0x0?ut[_0xe547('0x11d')](_0x45c6a7[_0xe547('0x11e')],_0x45c6a7[_0xe547('0x11c')]):_0x45c6a7[_0xe547('0x11e')]):ut[_0xe547('0x119')](_[_0xe547('0x40')](_0x45c6a7[_0xe547('0x6f')])?_0x45c6a7[_0xe547('0x6e')][_0xe547('0x11a')]:_0x45c6a7[_0xe547('0x6f')][_0xe547('0x11a')],_0x45c6a7[_0xe547('0x11b')],_0x45c6a7[_0xe547('0x11c')]>0x0?ut[_0xe547('0x11d')](_0x45c6a7[_0xe547('0x11e')],_0x45c6a7[_0xe547('0x11c')]):_0x45c6a7[_0xe547('0x11e')]);if(_0x390bb7){_0x155ab6['originatecalleridname']=ut[_0xe547('0x11f')](_0x390bb7);_0x155ab6[_0xe547('0x120')]=ut['extractCalleridNumber'](_0x390bb7);}var _0x1fb850=ut[_0xe547('0x121')](_0x45c6a7,_0x34e85d,_0x2deb21,_0x390bb7,_0x3fb73f,_0x155ab6);var _0x1bb5f4=utils[_0xe547('0x122')](_0x34e85d[_0xe547('0x123')]);Object[_0xe547('0x124')](_0x1fb850,_0x1bb5f4);_['merge'](_0x155ab6,ut['toLowerVariables'](_0x1fb850));_0x155ab6[_0xe547('0x125')]=moment()['format'](_0xe547('0x5f'));_0x45c6a7[_0xe547('0x126')]=_0x1fb850;var _0x3121d3=ut['variablesAction'](_0x155ab6,_0x45c6a7,_0x1fb850,_0x155ab6['activeContact'],_0x34c633);return ami[_0xe547('0x127')](_0x3121d3)[_0xe547('0x5b')](function(_0x2ef6cb){_0x45c6a7['originated']+=0x1;logger[_0xe547('0x41')](_0xe547('0x128'),_0x3fb73f,_0xe547('0x90'),_0x45c6a7[_0xe547('0x24')],'originated:\x20',_0x45c6a7['originated']);_0x11cae9(_0x2ef6cb);})[_0xe547('0x5d')](function(_0x366e9c){ut['logAgent'](_0x155ab6,0xe,_0xe547('0x129'));rpcDb[_0xe547('0xdf')](_0x155ab6,_0xe547('0x12a'));_0x19a782(_0x366e9c);});});};Preview[_0xe547('0xd')][_0xe547('0x1c')]=function(_0x27e270){if(this[_0xe547('0x43')][_0x27e270[_0xe547('0x88')]]){this[_0xe547('0x43')][_0x27e270[_0xe547('0x88')]][_0xe547('0x4d')]=_0x27e270[_0xe547('0x4d')];}};Preview[_0xe547('0xd')][_0xe547('0x15')]=function(_0x3b43b9){var _0x5a7b2e=this;var _0x2a68f4=this[_0xe547('0x43')][_0x3b43b9[_0xe547('0x12b')]];if(_0x2a68f4){if(_0x2a68f4[_0xe547('0xee')]&&this[_0xe547('0x13')][_0x2a68f4['lookAgent']]){ut[_0xe547('0x12c')](_0x2a68f4,this['agents'][_0x2a68f4[_0xe547('0xee')]][_0xe547('0x24')],this['agents'][_0x2a68f4['lookAgent']]['id']);}var _0x4fac5a=_[_0xe547('0x12d')](_0x2a68f4);_0x4fac5a['responsetime']=moment()[_0xe547('0x5e')](_0xe547('0x5f'));var _0x32eac9=_0x5a7b2e['campaignsPreview'][_0x2a68f4[_0xe547('0x45')]];if(ut[_0xe547('0x12e')](_0x3b43b9['response'])){if(_0x2a68f4[_0xe547('0x86')]){rpcDb[_0xe547('0x102')](_0x2a68f4[_0xe547('0x8a')]);}if(_0x2a68f4['activeContact']){rpcDb[_0xe547('0x103')](_0x2a68f4[_0xe547('0x8a')]);}ami[_0xe547('0x78')](_0xe547('0x12f'),ut[_0xe547('0x79')](_0x2a68f4,_0xe547('0x130'),this[_0xe547('0x34')][_0x2a68f4[_0xe547('0x45')]]));this[_0xe547('0x131')](_0x4fac5a,_0x32eac9,_0x3b43b9);}else{_0x2a68f4[_0xe547('0x125')]=moment()[_0xe547('0x5e')](_0xe547('0x5f'));ut['logAgent'](_0x4fac5a,0x4,_0xe547('0x9b'));rpcDb[_0xe547('0xdf')](_0x4fac5a,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0xe547('0x132')]=function(_0x2b678a){var _0x222741=this[_0xe547('0x43')][_0x2b678a[_0xe547('0x88')]];var _0x29d042;if(_0x222741){_0x29d042=this['campaignsPreview'][_0x222741[_0xe547('0x45')]];logger['info'](_0xe547('0x133'),_0x2b678a[_0xe547('0x88')],_0xe547('0x90'),_0x29d042[_0xe547('0x24')],_0xe547('0xa0'),_0x29d042[_0xe547('0x46')]);}if(this[_0xe547('0x43')][_0x2b678a[_0xe547('0x88')]]&&_0x2b678a[_0xe547('0x88')]!==_0x2b678a[_0xe547('0x8f')]){if(_0x2b678a[_0xe547('0x134')]==='16'&&this[_0xe547('0x43')][_0x2b678a['linkedid']][_0xe547('0x50')]){this['callProgressDetectingCustomer'](_0x2b678a,_0x2b678a[_0xe547('0x88')],_0x2b678a[_0xe547('0x134')]);}else if(this['actions'][_0x2b678a[_0xe547('0x88')]]['dialAnswer']){logger['info'](_0xe547('0x135'),_0x2b678a[_0xe547('0x88')],_0x2b678a[_0xe547('0x134')],'\x20Queue',_0x29d042['name'],_0xe547('0xa0'),_0x29d042[_0xe547('0x46')]);this[_0xe547('0x72')](_0x2b678a,_0x2b678a[_0xe547('0x88')],_0x2b678a[_0xe547('0x134')]);}}else if(_0x222741&&_[_0xe547('0x40')](_0x222741[_0xe547('0x136')])&&_0x29d042[_0xe547('0x137')]&&_0x2b678a[_0xe547('0x88')]===_0x2b678a['uniqueid']&&_[_0xe547('0x40')](_0x2b678a[_0xe547('0xde')])&&_0x2b678a[_0xe547('0x134')]==='16'&&_0x2b678a[_0xe547('0x138')]==='6'&&_[_0xe547('0xdc')](_0x222741[_0xe547('0x139')])){if(_0x222741[_0xe547('0x86')]){rpcDb[_0xe547('0x102')](_0x222741['idContact']);}if(_0x222741[_0xe547('0x87')]){rpcDb[_0xe547('0x103')](_0x222741[_0xe547('0x8a')]);}_0x2b678a[_0xe547('0xde')]='22';this[_0xe547('0x131')](_0x222741,_0x29d042,_0x2b678a);}else if(_0x222741&&_0x222741['transfer']){if(_0x2b678a[_0xe547('0x134')]==='16'&&this[_0xe547('0x43')][_0x2b678a[_0xe547('0x88')]]['dialAnswer']){logger[_0xe547('0x41')]('[syncHangup][talking][transfer]',_0x2b678a[_0xe547('0x88')],_0x2b678a[_0xe547('0x134')],_0xe547('0x90'),_0x29d042[_0xe547('0x24')],_0xe547('0xa0'),_0x29d042['pTalking']);this[_0xe547('0x72')](_0x2b678a,_0x2b678a['linkedid'],_0x2b678a[_0xe547('0x134')]);}else if(this['actions'][_0x2b678a[_0xe547('0x88')]][_0xe547('0x50')]){logger[_0xe547('0x41')]('[syncHangup][talking][cause]',_0x2b678a[_0xe547('0x88')],_0x2b678a['cause'],_0xe547('0x90'),_0x29d042[_0xe547('0x24')],'pTalking:\x20',_0x29d042['pTalking']);this[_0xe547('0x72')](_0x2b678a,_0x2b678a[_0xe547('0x88')],_0x2b678a['cause']);}}};Preview[_0xe547('0xd')][_0xe547('0x1a')]=function(_0x4578bf){if(this[_0xe547('0x43')][_0x4578bf[_0xe547('0xdb')]]&&_0x4578bf[_0xe547('0xdb')]!==_0x4578bf[_0xe547('0x13a')]){this[_0xe547('0x72')](_0x4578bf,_0x4578bf[_0xe547('0xdb')],_0x4578bf[_0xe547('0xd0')]);}};Preview[_0xe547('0xd')][_0xe547('0x18')]=function(_0x2dd18d){if(this[_0xe547('0x43')][_0x2dd18d['linkedid']]&&_0x2dd18d[_0xe547('0x88')]!==_0x2dd18d['uniqueid']&&!this[_0xe547('0x43')][_0x2dd18d['linkedid']]['dialAnswer']){if(_0x2dd18d[_0xe547('0x134')]==='1'){this['callProgressDetectingCustomer'](_0x2dd18d,_0x2dd18d[_0xe547('0x88')],_0x2dd18d[_0xe547('0x134')]);}}};Preview[_0xe547('0xd')][_0xe547('0x13b')]=function(_0x38eff2,_0x2c287d,_0x4106aa){if(this[_0xe547('0x43')][_0x38eff2]){if(_['isNil'](this['actions'][_0x38eff2]['variables'])){this[_0xe547('0x43')][_0x38eff2]['variables']={};}this['actions'][_0x38eff2][_0xe547('0x126')][_0x2c287d]=_0x4106aa;}};Preview['prototype']['syncVarSet']=function(_0x592f6c){try{if(!_[_0xe547('0x40')](_0x592f6c)){if(ut['filterKey'](_['keys'](_0x592f6c[_0xe547('0x13c')])[0x0])){this[_0xe547('0x13b')](_0x592f6c[_0xe547('0x8f')],_[_0xe547('0x13d')](_0x592f6c['variable'])[0x0],_0x592f6c['value']);}}}catch(_0xc2c132){logger[_0xe547('0x13e')](_0xe547('0x13f'),util['inspect'](_0xc2c132,{'showHidden':![],'depth':null}));}};Preview[_0xe547('0xd')][_0xe547('0x1f')]=function(_0x57c5ca){if(_0x57c5ca){if(this[_0xe547('0x43')][_0x57c5ca[_0xe547('0x140')]]){this[_0xe547('0x43')][_0x57c5ca[_0xe547('0x140')]][_0xe547('0x139')]=!![];}}};Preview[_0xe547('0xd')][_0xe547('0x21')]=function(_0x4c35bc){if(_0x4c35bc){if(this[_0xe547('0x43')][_0x4c35bc[_0xe547('0x141')]]){this[_0xe547('0x43')][_0x4c35bc[_0xe547('0x141')]][_0xe547('0x139')]=!![];}}};module[_0xe547('0x142')]=Preview;
\ No newline at end of file
+var _0xa41a=['logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','checkInBlack','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logger','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','pick','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','dialActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','merge','toLowerVariables','starttime','variablesAction','Action','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','lookAgent','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','available','CAMPAIGN_STATUS','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','message','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','VoiceQueueId','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','INACTIVE','Trunk','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','countbusyretry','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','isUndefined','object','reason'];(function(_0x2a4104,_0x511892){var _0x91a5a7=function(_0x48a68f){while(--_0x48a68f){_0x2a4104['push'](_0x2a4104['shift']());}};_0x91a5a7(++_0x511892);}(_0xa41a,0x6b));var _0xaa41=function(_0x4e8bd,_0x54cbf3){_0x4e8bd=_0x4e8bd-0x0;var _0x1e77f8=_0xa41a[_0x4e8bd];return _0x1e77f8;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var uuid=require('uuid');var moment=require(_0xaa41('0x2'));var Redis=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var logger=require(_0xaa41('0x5'))(_0xaa41('0x6'));var loggerAction=require(_0xaa41('0x5'))(_0xaa41('0x7'));var ami=require(_0xaa41('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xaa41('0x9'));var Action=require(_0xaa41('0xa'));var ut=require('./util/util');var utils=require('../dialer/utils');config[_0xaa41('0xb')]=_[_0xaa41('0xc')](config['redis'],{'host':_0xaa41('0xd'),'port':0x18eb});var io=require(_0xaa41('0xe'))(new Redis(config[_0xaa41('0xb')]));var Sequence=function(){};Sequence[_0xaa41('0xf')][_0xaa41('0x10')]=function(_0x38d930){this[_0xaa41('0x11')]=this[_0xaa41('0x11')]?this[_0xaa41('0x11')]['finally'](_0x38d930):_0x38d930();};function Preview(_0x1d3aac){this[_0xaa41('0x12')]=new Sequence();this['campaignsPreview']=_0x1d3aac['voiceQueues'];this[_0xaa41('0x13')]=_0x1d3aac['trunks'];this[_0xaa41('0x14')]={};this[_0xaa41('0x15')]=_0x1d3aac[_0xaa41('0x15')];this[_0xaa41('0x16')]=0x0;ami['on'](_0xaa41('0x17'),this['syncOriginateResponse'][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x19'),this[_0xaa41('0x1a')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x1b'),this[_0xaa41('0x1c')][_0xaa41('0x18')](this));ami['on']('dialend',this[_0xaa41('0x1d')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x1e'),this[_0xaa41('0x1f')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x20'),this[_0xaa41('0x21')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xaa41('0x23'),this[_0xaa41('0x24')][_0xaa41('0x18')](this));this['loopCampaigns'](this[_0xaa41('0x25')]);}function emit(_0x1f692b,_0x4e768e,_0x513c61){io['to'](_0x1f692b)[_0xaa41('0x26')](_0x4e768e,_0x513c61);}function emitVoiceQueueChannelRemove(_0x5d4374){logger[_0xaa41('0x27')](_0xaa41('0x28'),JSON[_0xaa41('0x29')](_0x5d4374));emit(util[_0xaa41('0x2a')](_0xaa41('0x2b'),_0x5d4374['name']),_0xaa41('0x2c'),_0x5d4374);io[_0xaa41('0x26')](_0xaa41('0x2d'),_0x5d4374);}function notSendMessagesQueue(_0x21f596){if(_0x21f596[_0xaa41('0x2e')]){if(_0x21f596[_0xaa41('0x2f')]===0x0&&_0x21f596['pTalking']===0x0){_0x21f596['sendMessageOneNotActive']=![];_0x21f596[_0xaa41('0x30')]=0x0;_0x21f596['paused']=0x0;_0x21f596['message']=utils[_0xaa41('0x31')]['INACTIVE'];ut['logger'](_0xaa41('0x32'),_0x21f596[_0xaa41('0x33')]+_0xaa41('0x34'));}else{_0x21f596[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x36')];ut['logger'](_0xaa41('0x32'),_0x21f596[_0xaa41('0x33')]+_0xaa41('0x37'));}}}Preview[_0xaa41('0xf')][_0xaa41('0x38')]=function(){var _0x4466a3=this;setInterval(function(){_0x4466a3[_0xaa41('0x39')]();},0x7cf);};Preview[_0xaa41('0xf')]['syncCampaigns']=function(){var _0x377add=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x714537 in _0x377add){if(_0x377add[_0xaa41('0x3a')](_0x714537)&&(_0x377add[_0x714537]['dialMethod']===_0xaa41('0x6')||_0x377add[_0x714537][_0xaa41('0x3b')]==='booked')&&_0x377add[_0x714537]['type']==='outbound'){if(this[_0xaa41('0x16')]>0x7){this[_0xaa41('0x16')]=0x0;this[_0xaa41('0x3c')]();}}if(_0x377add[_0xaa41('0x3a')](_0x714537)&&_0x377add[_0x714537]['dialMethod']===_0xaa41('0x6')&&_0x377add[_0x714537][_0xaa41('0x3d')]===_0xaa41('0x3e')){if(_0x377add[_0x714537]['dialActive']){this[_0xaa41('0x3f')](_0x377add[_0x714537]);if(_0x377add[_0x714537][_0xaa41('0x40')])this[_0xaa41('0x41')](_0x377add[_0x714537]);}else{notSendMessagesQueue(_0x377add[_0x714537]);}}}};Preview['prototype'][_0xaa41('0x42')]=function(_0x374117){var _0x57fe1d=this;this[_0xaa41('0x12')][_0xaa41('0x10')](function(){if(!_[_0xaa41('0x43')](_0x57fe1d['actions'][_0x374117])){loggerAction[_0xaa41('0x27')]('[clearZombieChannels][talking]',_0x374117,_0xaa41('0x44'),_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')],'originated:\x20',JSON['stringify'](_0x57fe1d['campaignsPreview'][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]][_0xaa41('0x2f')]),_0xaa41('0x46'),JSON['stringify'](_0x57fe1d['campaignsPreview'][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]][_0xaa41('0x47')]),JSON[_0xaa41('0x29')](_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x48')]),JSON[_0xaa41('0x29')](_['pick'](_0x57fe1d[_0xaa41('0x14')][_0x374117],[_0xaa41('0x49'),_0xaa41('0x4a'),_0xaa41('0x4b'),'ListId'])));return ami['Action']({'action':_0xaa41('0x4c'),'channel':_0x57fe1d[_0xaa41('0x14')][_0x374117]['channel']})[_0xaa41('0x4d')](function(_0x563687){if(_0x563687[_0xaa41('0x35')]===_0xaa41('0x4e')){setTimeout(function(){if(_0x57fe1d[_0xaa41('0x14')][_0x374117]){ut[_0xaa41('0x4f')](_0x57fe1d[_0xaa41('0x25')][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]],_0xaa41('0x50'));if(_0x57fe1d['actions'][_0x374117][_0xaa41('0x48')]===!![]){ut[_0xaa41('0x51')](_0x57fe1d[_0xaa41('0x25')][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]],_0xaa41('0x50'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x374117,_0x57fe1d[_0xaa41('0x14')][_0x374117]['queue']);}ut[_0xaa41('0x52')](_0xaa41('0x53')+_0x374117,_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]);delete _0x57fe1d[_0xaa41('0x14')][_0x374117];}},0x2328);}});}});};Preview[_0xaa41('0xf')][_0xaa41('0x3c')]=function(){var _0x5ee74c=this;loggerAction[_0xaa41('0x27')]('[action]',_['size'](this[_0xaa41('0x14')]));for(var _0x5ee127 in this['actions']){if(_0x5ee74c['actions'][_0xaa41('0x3a')](_0x5ee127)){_0x5ee74c['clearZombieChannel'](_0x5ee127);}}};Preview[_0xaa41('0xf')][_0xaa41('0x41')]=function(_0x4a6882){var _0x576f81=this;rpcDb[_0xaa41('0x54')](_0x4a6882['id'],ut[_0xaa41('0x55')](this[_0xaa41('0x15')]))[_0xaa41('0x56')](function(_0x3fe1a9){if(!_[_0xaa41('0x43')](_0x3fe1a9)){for(var _0x258096=0x0;_0x258096<_0x3fe1a9[_0xaa41('0x57')];_0x258096+=0x1){if(ut[_0xaa41('0x58')](_0x3fe1a9[_0x258096]['scheduledat'])<_0x4a6882[_0xaa41('0x59')]*0x3c){if(_0x3fe1a9[_0x258096][_0xaa41('0x5a')]&&!_0x3fe1a9[_0x258096][_0xaa41('0x5a')][_0xaa41('0x5b')]){_0x576f81[_0xaa41('0x5c')](_0x3fe1a9[_0x258096]['id'])[_0xaa41('0x56')](ut['logger2'](_0xaa41('0x5d')))[_0xaa41('0x4d')](ut[_0xaa41('0x5e')](_0xaa41('0x5d')));}else{rpcDb['disableContact'](_0x3fe1a9[_0x258096]['id']);}}else{var _0x23bc61=new Action(_0x3fe1a9[_0x258096],_0x4a6882);_0x23bc61['starttime']=moment()['format'](_0xaa41('0x5f'));_0x4a6882[_0xaa41('0x60')]+=0x1;ut[_0xaa41('0x61')](_0x23bc61,0x17,'RecallInQueue');if(_0x4a6882[_0xaa41('0x62')]){rpcDb[_0xaa41('0x63')](ut[_0xaa41('0x64')](_0x3fe1a9[_0x258096]));rpcDb['createCustomerHistory'](_0x23bc61,_0xaa41('0x65'));}else{ut[_0xaa41('0x61')](_0x23bc61,0x16,_0xaa41('0x66'));rpcDb[_0xaa41('0x67')](_0x23bc61,_0xaa41('0x68'));rpcDb[_0xaa41('0x69')](_0x23bc61,_0xaa41('0x68'));}}}}})[_0xaa41('0x4d')](ut['logger2'](_0xaa41('0x6a')));};Preview['prototype']['setMessage']=function(_0x1bdcd6){_0x1bdcd6[_0xaa41('0x2e')]=!![];if(ut[_0xaa41('0x6b')](_0x1bdcd6[_0xaa41('0x6c')])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x6d')];}else if(!ut[_0xaa41('0x6e')](_0x1bdcd6['dialActive'])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x6f')];}else if(!this['isTrunkReachable'](_0x1bdcd6[_0xaa41('0x70')])){if(!this[_0xaa41('0x71')](_0x1bdcd6['TrunkBackup'])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x72')];}else{_0x1bdcd6['message']=utils[_0xaa41('0x31')][_0xaa41('0x73')];}}else{_0x1bdcd6['message']=utils['CAMPAIGN_STATUS'][_0xaa41('0x73')];}};Preview[_0xaa41('0xf')][_0xaa41('0x74')]=function(_0x4d20c6,_0x5a76b9,_0x137f3f){var _0x1746b4=this;var _0x32f2b4=this[_0xaa41('0x14')][_0x5a76b9];var _0x5ccdc5=this[_0xaa41('0x25')][_0x32f2b4['queue']];var _0x555186;var _0x3ba305=![];var _0x52ae7f=0x2;var _0x3621c0=0x3;if(_0x5ccdc5){switch(_0x137f3f){case'1':_0x5ccdc5[_0xaa41('0x75')]+=0x1;_0x32f2b4[_0xaa41('0x76')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x0,_0xaa41('0x78'));ami[_0xaa41('0x26')](_0xaa41('0x79'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0x7b')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0x7c'));_0x1746b4['verifyAdditionalPhones'](_0x32f2b4,'0',_0x5ccdc5)[_0xaa41('0x56')](function(_0x40cdfc){_0x3ba305=_0x40cdfc[_0xaa41('0x7d')]==0x1;_0x52ae7f=_0x5ccdc5['dialNoSuchNumberRetryFrequency'];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0x82'));}else{if(_0x32f2b4['countnosuchnumberretry']>=_0x5ccdc5['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x32f2b4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x32f2b4,_0xaa41('0x76'),_0x5ccdc5['dialNoSuchNumberRetryFrequency']),_0x32f2b4['unlockAgent'],_0x32f2b4[_0xaa41('0x83')]);}}delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];}else{_0x32f2b4[_0xaa41('0x76')]++;logger['info'](_0xaa41('0x85'),_0x32f2b4[_0xaa41('0x76')]);logger[_0xaa41('0x27')]('id',_0x32f2b4[_0xaa41('0x86')]);_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnosuchnumberretry':_0x32f2b4[_0xaa41('0x76')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)['then'](function(){});});}});break;case _0xaa41('0x89'):var _0x2d2af8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32f2b4['responsetime']=_0x2d2af8;_0x32f2b4[_0xaa41('0x8a')]=_0x2d2af8;_0x32f2b4['dialAnswer']=!![];_0x5ccdc5[_0xaa41('0x47')]+=0x1;logger['info'](_0xaa41('0x8b'),_0x32f2b4[_0xaa41('0x8c')],'\x20Queue',_0x5ccdc5[_0xaa41('0x33')],_0xaa41('0x46'),_0x5ccdc5[_0xaa41('0x47')]);ami[_0xaa41('0x26')]('custom:agentconnect',ut['buildObj'](_0x32f2b4,_0xaa41('0x8d'),this[_0xaa41('0x25')][_0x32f2b4['queue']]));if(_0x5ccdc5['acw']){ami[_0xaa41('0x26')](_0xaa41('0x8e'),ut[_0xaa41('0x8f')](_0x32f2b4));}break;case'16':ami[_0xaa41('0x26')](_0xaa41('0x90'),ut['buildObj'](_0x32f2b4,_0xaa41('0x91'),this['campaignsPreview'][_0x32f2b4['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x32f2b4,_0xaa41('0x91')));_0x5ccdc5[_0xaa41('0x92')]+=0x1;_0x5ccdc5[_0xaa41('0x93')]+=0x1;_0x5ccdc5['answered']+=0x1;ut[_0xaa41('0x51')](_0x5ccdc5,_0xaa41('0x94'));_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x4,_0xaa41('0x96'));rpcDb[_0xaa41('0x67')](_0x32f2b4,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0x97'));rpcDb[_0xaa41('0x98')](_0x32f2b4);_0x5ccdc5[_0xaa41('0x99')]+=_0x32f2b4['talktime'];_0x5ccdc5[_0xaa41('0x9a')]+=_0x32f2b4['talktime'];logger[_0xaa41('0x27')](_0xaa41('0x9b'),_0x32f2b4[_0xaa41('0x8c')],_0xaa41('0x9c'),_0x5ccdc5['name'],_0xaa41('0x46'),_0x5ccdc5[_0xaa41('0x47')]);delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];break;case'BUSY':_0x5ccdc5[_0xaa41('0x9d')]+=0x1;_0x32f2b4['countbusyretry']+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0x5,_0xaa41('0x9e'));_0x52ae7f=_0x5ccdc5[_0xaa41('0x9f')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xa0'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xa1')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xa2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'5',_0x5ccdc5)[_0xaa41('0x56')](function(_0x59a30b){_0x3ba305=_0x59a30b[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut['cloneAction'](_0x32f2b4,0xf,'Global');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xa4'));}else{if(_0x32f2b4['countbusyretry']>=_0x5ccdc5[_0xaa41('0xa5')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,_0xaa41('0xa8'),_0x5ccdc5[_0xaa41('0x9f')]),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4[_0xaa41('0xa8')]++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4['idContact'],'field':{'countbusyretry':_0x32f2b4['countbusyretry']}})[_0xaa41('0x56')](function(){_0x1746b4['swapAdditionalPhones'](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xaa'):_0x5ccdc5[_0xaa41('0xab')]+=0x1;_0x32f2b4['countnoanswerretry']+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x3,'NoAnswer');_0x52ae7f=_0x5ccdc5[_0xaa41('0xac')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];var _0x5bd574=ut[_0xaa41('0xad')](_0x32f2b4,_0x5ccdc5);ami['emit']('custom:agentnoanswer',_0x5bd574);rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xae'));_0x1746b4['verifyAdditionalPhones'](_0x32f2b4,'3',_0x5ccdc5)['then'](function(_0x241e1a){_0x3ba305=_0x241e1a[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut['cloneAction'](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xaf'));}else{if(_0x32f2b4['countnoanswerretry']>=_0x5ccdc5[_0xaa41('0xb0')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xae'));}else{rpcDb['rescheduleContact'](ut[_0xaa41('0xa7')](_0x32f2b4,'countnoanswerretry',_0x5ccdc5['dialNoAnswerRetryFrequency']),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})['then'](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xb2'):_0x5ccdc5[_0xaa41('0xb3')]+=0x1;_0x32f2b4[_0xaa41('0xb4')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0x8,_0xaa41('0xb5'));_0x52ae7f=_0x5ccdc5[_0xaa41('0xb6')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xb7'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xb8')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xb9'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'8',_0x5ccdc5)[_0xaa41('0x56')](function(_0x58ad21){_0x3ba305=_0x58ad21[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,'Global');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xba'));}else{if(_0x32f2b4[_0xaa41('0xb4')]>=_0x5ccdc5[_0xaa41('0xbb')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xb9'));}else{rpcDb[_0xaa41('0xa6')](ut['scheduledAt'](_0x32f2b4,_0xaa41('0xb4'),_0x5ccdc5[_0xaa41('0x9f')]),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countcongestionretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4['idContact'],'field':{'countcongestionretry':_0x32f2b4[_0xaa41('0xb4')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xbc'):_0x5ccdc5['outboundRejectCallsDay']+=0x1;_0x32f2b4[_0xaa41('0xbd')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut['totalGlobal'](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x14,_0xaa41('0xbe'));_0x52ae7f=_0x5ccdc5[_0xaa41('0xbf')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xc0'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xc1')));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xc2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'20',_0x5ccdc5)[_0xaa41('0x56')](function(_0x78265){_0x3ba305=_0x78265[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut['cloneAction'](_0x32f2b4,0x14,'AgentReject');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xc3'));}else{if(_0x32f2b4['countagentrejectretry']>=_0x5ccdc5[_0xaa41('0xc4')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,_0xaa41('0xbd'),_0x5ccdc5[_0xaa41('0xbf')]),_0x32f2b4['unlockAgent'],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xc5'):_0x5ccdc5[_0xaa41('0xc6')]+=0x1;_0x32f2b4[_0xaa41('0xc7')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0xb,_0xaa41('0xc8'));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xc9'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'11',_0x5ccdc5)[_0xaa41('0x56')](function(_0x408d95){_0x3ba305=_0x408d95[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xc9'));}else{if(_0x32f2b4['countabandonedetry']>=_0x5ccdc5[_0xaa41('0xca')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xc9'));}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,'countabandonedretry',_0x5ccdc5['dialAbandonedRetryFrequency']),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4['countnoanswerretry']}})['then'](function(){_0x1746b4['swapAdditionalPhones'](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case'18':_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4[_0xaa41('0xcc')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x12,_0x4d20c6[_0xaa41('0xcd')]||_0x4d20c6[_0xaa41('0xce')]);ami[_0xaa41('0x26')](_0xaa41('0xcf'),ut[_0xaa41('0x7a')](_0x32f2b4,'amd'));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xd0'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'18',_0x5ccdc5)['then'](function(_0x30e8cb){_0x3ba305=_0x30e8cb['additional']==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0x12,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd0'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd0'));}}else{_0x32f2b4[_0xaa41('0xb1')]++;_0x1746b4['incrementPreviewCounters']({'id':_0x32f2b4['idContact'],'field':{'countnoanswerretry':_0x32f2b4['countnoanswerretry']}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)['then'](function(){});});}});delete this['actions'][_0x4d20c6[_0xaa41('0x84')]];break;case'19':_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4['countglobal']=ut['totalGlobal'](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x13,_0x4d20c6['cause-txt']||_0x4d20c6[_0xaa41('0xce')]);ami[_0xaa41('0x26')](_0xaa41('0xcf'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xd1')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xd2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'18',_0x5ccdc5)[_0xaa41('0x56')](function(_0x573889){_0x3ba305=_0x573889['additional']==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd2'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd2'));}}else{_0x32f2b4[_0xaa41('0xb1')]++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});delete this['actions'][_0x4d20c6[_0xaa41('0x84')]];break;default:if(_0x32f2b4['dialAnswer']){ut[_0xaa41('0x51')](_0x5ccdc5,_0xaa41('0xd3'));ut[_0xaa41('0x52')](_0xaa41('0xd4')+_0x5ccdc5[_0xaa41('0x33')],_0x4d20c6);}_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0xc,_0x4d20c6[_0xaa41('0xcd')]||_0x4d20c6[_0xaa41('0xce')]);_0x52ae7f=_0x5ccdc5[_0xaa41('0xbf')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xd5'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'20',_0x5ccdc5)[_0xaa41('0x56')](function(_0x1b5933){_0x3ba305=_0x1b5933[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut['totalGlobal'](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd6'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd6'));}delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];}else{_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});}});}if(!(_0x32f2b4['dialAnswer']&&_0x137f3f==='16')){ut['updateOriginated'](_0x5ccdc5,_0xaa41('0xd7'));logger[_0xaa41('0x27')]('[originated][decrement][callProgressDetectingCustomer]',_0x32f2b4[_0xaa41('0x8c')],'\x20Queue',_0x5ccdc5[_0xaa41('0x33')],_0xaa41('0xd8'),_0x5ccdc5['originated']);}if(_0x137f3f!=='ANSWER'){delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];delete this[_0xaa41('0x14')][_0x4d20c6['destlinkedid']];}_0x5ccdc5['queueSummaryCountersUpdated']=!![];}};Preview[_0xaa41('0xf')]['callProgressDetectingAgent']=function(_0x94423a,_0x59d6cf,_0x37dc6f){if(_[_0xaa41('0xd9')](_0x59d6cf)&&_0xaa41('0xda')!==typeof _0x59d6cf){return;}if(_[_0xaa41('0xd9')](_0x37dc6f)&&_0xaa41('0xda')!==typeof _0x37dc6f){return;}switch(_0x37dc6f[_0xaa41('0xdb')]){case'0':ut[_0xaa41('0xdc')](_0x94423a,0x0,'NoSuchNumber');rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xde'));break;case'3':ut['logAgent'](_0x94423a,0x3,_0xaa41('0xdf'));rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe0'));break;case'5':ut[_0xaa41('0xdc')](_0x94423a,0x5,'Busy');rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe1'));break;case'8':ut[_0xaa41('0xdc')](_0x94423a,0x8,_0xaa41('0xb5'));rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe2'));break;case'22':ut[_0xaa41('0xdc')](_0x94423a,0x16,_0xaa41('0xe3'));rpcDb[_0xaa41('0xdd')](_0x94423a,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x94423a,0xc,_0x37dc6f[_0xaa41('0xdb')]);rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe2'));}ut[_0xaa41('0x4f')](_0x59d6cf,_0xaa41('0xe4'));logger[_0xaa41('0x27')]('[originated][decrement][callProgressDetectingAgent]',_0x94423a[_0xaa41('0x8c')],_0xaa41('0x9c'),_0x59d6cf[_0xaa41('0x33')],_0xaa41('0xd8'),_0x59d6cf[_0xaa41('0x2f')]);delete this[_0xaa41('0x14')][_0x94423a['uniqueid']];};Preview[_0xaa41('0xf')][_0xaa41('0xa3')]=function(_0x13ddbe,_0x4cf0c5,_0x1ddfe5){return cmHopperAdditionalPhone[_0xaa41('0xa3')](_0x13ddbe,_0x4cf0c5,_0x1ddfe5)[_0xaa41('0x4d')](logger[_0xaa41('0x27')](_0xaa41('0xe5')));};Preview[_0xaa41('0xf')][_0xaa41('0x88')]=function(_0x943973,_0xe17579,_0x1a6de8){return cmHopperAdditionalPhone[_0xaa41('0x88')](_0x943973,_0xe17579,_0x1a6de8)[_0xaa41('0x4d')](logger[_0xaa41('0x27')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xaa41('0x87')]=function(_0xb9d685){return Promise[_0xaa41('0xe6')]()[_0xaa41('0x56')](cmHopperAdditionalPhone[_0xaa41('0x87')](_0xb9d685))[_0xaa41('0x4d')](logger[_0xaa41('0x27')]('[incrementPreviewCounters]\x20'));};Preview[_0xaa41('0xf')][_0xaa41('0xe7')]=function(_0xa3687e,_0x7e0e69,_0x361819,_0x377e17,_0x1e879d){var _0x1a7527=this;return new Promise(function(_0x1aac0c,_0x1a5a7a){if(_[_0xaa41('0x43')](_0x7e0e69)||_[_0xaa41('0x43')](_0x7e0e69['Contact'])||_[_0xaa41('0x43')](_0x7e0e69[_0xaa41('0xe8')])||_['isNil'](_0x7e0e69[_0xaa41('0x4b')])){_0x1a5a7a(ut[_0xaa41('0x35')](_0xaa41('0xe9'),_0x377e17,_0x1e879d));return;}var _0x400fb7=uuid['v4']();var _0x5c0c5c=_0x1a7527[_0xaa41('0x25')][_0x7e0e69[_0xaa41('0x44')][_0xaa41('0x33')]];var _0x3a223c=_0x361819?_0x1a7527[_0xaa41('0x15')][_0x361819]['id']:undefined;_0x1a7527['actions'][_0x400fb7]=new Action(_0x7e0e69,_0x5c0c5c,_0x400fb7,_0x361819,_0x3a223c);var _0xc59a12=_0x1a7527['actions'][_0x400fb7];_0xc59a12['unlockAgent']=_0x377e17;_0xc59a12[_0xaa41('0x83')]=_0x1e879d;_0xc59a12['lookAgent']=_0x361819;if(_['isEmpty'](_0xa3687e)){_0x1a7527[_0xaa41('0xea')](_0xc59a12,_0x5c0c5c,_0x7e0e69,_0x361819)[_0xaa41('0x56')](function(_0x5b241e){logger['info'](_0xaa41('0xeb'),_0xaa41('0xec')+_0xc59a12[_0xaa41('0x45')]+_0xaa41('0xed')+_0xc59a12[_0xaa41('0x86')],JSON[_0xaa41('0x29')](_0x5b241e));ami[_0xaa41('0x26')](_0xaa41('0xee'),ut['buildObj'](_0xc59a12,_0xaa41('0xef'),_0x1a7527[_0xaa41('0x25')][_0xc59a12[_0xaa41('0x45')]]));_0x1aac0c(ut[_0xaa41('0x35')](_0xaa41('0xf0')));})['catch'](function(_0x519843){ut[_0xaa41('0xf1')](_0xaa41('0xf2'),_0x519843);_0x1a5a7a(ut[_0xaa41('0x35')](_0xaa41('0xf3'),_0x377e17,_0x1e879d));});}else{_0x5c0c5c[_0xaa41('0xf4')]+=0x1;ut[_0xaa41('0xf5')](_0xc59a12);rpcDb['createHistory'](_0xc59a12,_0xaa41('0xf6'));delete _0x1a7527[_0xaa41('0x14')][_0x400fb7];_0x1a5a7a(ut['message'](_0xaa41('0xf7'),_0x377e17,_0x1e879d));}});};Preview[_0xaa41('0xf')][_0xaa41('0x71')]=function(_0x27149e){return!_[_0xaa41('0x43')](_0x27149e)&&!_[_0xaa41('0x43')](_0x27149e[_0xaa41('0x33')])&&!_['isNil'](_0x27149e[_0xaa41('0xf8')])&&_0x27149e[_0xaa41('0xf8')]&&!_['isNil'](this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])])&&!_['isNil'](this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])][_0xaa41('0x4c')])&&(this['trunks'][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e['name'])]['status']===_0xaa41('0xfa')||this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])][_0xaa41('0x4c')]==='unmonitored');};Preview['prototype'][_0xaa41('0x5c')]=function(_0x2ff3fb,_0x566832){return this['execRun'](_0x2ff3fb,_0x566832)[_0xaa41('0x56')](function(_0x44dea3){return _[_0xaa41('0xfb')](_0x44dea3,['message']);})['catch'](function(_0x1d609e){if(_0x1d609e[_0xaa41('0xfc')]){rpcDb[_0xaa41('0xfd')](_0x2ff3fb);}if(_0x1d609e['active']){rpcDb[_0xaa41('0xfe')](_0x2ff3fb);}throw _[_0xaa41('0xfb')](_0x1d609e,['message']);});};Preview['prototype'][_0xaa41('0xff')]=function(_0x561447,_0x4679e5){var _0x3fb6f0=this;var _0xdf9297,_0x10252a;return rpcDb[_0xaa41('0x100')](_0x561447)[_0xaa41('0x56')](function(_0x2b083a){if(!_['isNil'](_0x2b083a[0x0])){_0x10252a=_0x2b083a[0x0][_0xaa41('0x101')]?![]:!![];_0xdf9297=_0x2b083a[0x0][_0xaa41('0x101')]?!![]:![];_0xdf9297=_0x4679e5?!![]:_0xdf9297;}var _0x5534ef=_0x3fb6f0[_0xaa41('0x102')](_0x2b083a);if(_0x5534ef[_0xaa41('0x103')]){rpcDb[_0xaa41('0x104')](_[_0xaa41('0xfb')](_0x2b083a[0x0],[_0xaa41('0x4b'),_0xaa41('0xe8')]))['then'](function(_0xa2d55d){_0x3fb6f0[_0xaa41('0xe7')](_0xa2d55d,_0x2b083a[0x0],_0x4679e5,_0x10252a,_0xdf9297)[_0xaa41('0x56')](function(_0x2fa831){return _0x2fa831;})[_0xaa41('0x4d')](function(_0xf8f3e1){throw _0xf8f3e1;});})[_0xaa41('0x4d')](function(_0x5083ff){ut[_0xaa41('0xf1')](_0xaa41('0x105'),_0x5083ff);throw ut[_0xaa41('0x35')]('Call\x20unsuccessful',_0x10252a,_0xdf9297);});}else{throw ut['message'](_0x5534ef['message'],_0x10252a,_0xdf9297);}})[_0xaa41('0x4d')](function(_0x1331f8){ut[_0xaa41('0xf1')](_0xaa41('0x106'),_0x1331f8);throw ut[_0xaa41('0x35')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xaa41('0xf')][_0xaa41('0x102')]=function(_0x1fe1e3){if(_[_0xaa41('0x43')](_0x1fe1e3)||_[_0xaa41('0x107')](_0x1fe1e3)||!_[_0xaa41('0x43')](_0x1fe1e3[0x0][_0xaa41('0x5a')])&&_['isNil'](_0x1fe1e3[0x0][_0xaa41('0x5a')][_0xaa41('0x33')])){ut[_0xaa41('0xf1')]('[Preview][validateContact][Empty\x20Contact]',_0x1fe1e3);return{'isValid':![],'message':_0xaa41('0x108')};}var _0x53a519=this['campaignsPreview'][_0x1fe1e3[0x0][_0xaa41('0x44')]['name']];_0x53a519[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x73')];if(_[_0xaa41('0x43')](_0x53a519)){ut[_0xaa41('0xf1')](_0xaa41('0x109'),_0x53a519);return{'isValid':![],'message':_0xaa41('0x10a')};}if(!this['isTrunkReachable'](_0x53a519[_0xaa41('0x70')])){ut[_0xaa41('0xf1')](_0xaa41('0x10b'),_0xaa41('0x10c')+_0x53a519[_0xaa41('0x33')]+_0xaa41('0x10d'));if(!this[_0xaa41('0x71')](_0x53a519[_0xaa41('0x10e')])){ut[_0xaa41('0xf1')](_0xaa41('0x10b'),_0x53a519[_0xaa41('0x33')]+_0xaa41('0x10f'));return{'isValid':![],'message':_0xaa41('0x110')};}}if(!ut[_0xaa41('0x6e')](_0x53a519[_0xaa41('0x111')])){ut[_0xaa41('0xf1')]('[Preview][validateContact][Campaign\x20Active]',_0x53a519[_0xaa41('0x33')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x53a519['name']+_0xaa41('0x112')};}return{'isValid':!![],'message':_0xaa41('0x113')};};Preview['prototype'][_0xaa41('0xea')]=function(_0x356256,_0x1e86cc,_0x15bb60,_0x232732){var _0x34d857=this;return new Promise(function(_0x239f1b,_0x445925){var _0x1e8591=_0x356256[_0xaa41('0x8c')];var _0x347d0c=_0x34d857[_0xaa41('0x71')](_0x1e86cc[_0xaa41('0x70')])?util[_0xaa41('0x2a')](_0xaa41('0x114'),_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x33')],_['isNil'](_0x1e86cc[_0xaa41('0x115')])?'':_0x1e86cc[_0xaa41('0x115')][_0xaa41('0x116')]()||'',_0x1e86cc[_0xaa41('0x117')]>0x0?_0x15bb60['phone'][_0xaa41('0x118')](_0x1e86cc[_0xaa41('0x117')]):_0x15bb60['phone']):util[_0xaa41('0x2a')](_0xaa41('0x114'),_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x10e')])?_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x33')]:_0x1e86cc[_0xaa41('0x10e')][_0xaa41('0x33')],_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x115')])?'':_0x1e86cc['dialPrefix'][_0xaa41('0x116')]()||'',_0x1e86cc[_0xaa41('0x117')]>0x0?_0x15bb60[_0xaa41('0xe8')][_0xaa41('0x118')](_0x1e86cc[_0xaa41('0x117')]):_0x15bb60[_0xaa41('0xe8')]);var _0x53dea3=_0x34d857[_0xaa41('0x71')](_0x1e86cc['Trunk'])?ut[_0xaa41('0x119')](_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x11a')],_0x1e86cc[_0xaa41('0x11b')],_0x1e86cc[_0xaa41('0x11c')]>0x0?ut['getCallerIdRandom'](_0x1e86cc[_0xaa41('0x11d')],_0x1e86cc[_0xaa41('0x11c')]):_0x1e86cc['dialOriginateCallerIdNumber']):ut[_0xaa41('0x119')](_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x10e')])?_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x11a')]:_0x1e86cc[_0xaa41('0x10e')][_0xaa41('0x11a')],_0x1e86cc[_0xaa41('0x11b')],_0x1e86cc[_0xaa41('0x11c')]>0x0?ut[_0xaa41('0x11e')](_0x1e86cc['dialOriginateCallerIdNumber'],_0x1e86cc[_0xaa41('0x11c')]):_0x1e86cc[_0xaa41('0x11d')]);if(_0x53dea3){_0x356256[_0xaa41('0x11f')]=ut['extractCalleridName'](_0x53dea3);_0x356256['originatecalleridnum']=ut[_0xaa41('0x120')](_0x53dea3);}var _0x5aee9b=ut['addVariables'](_0x1e86cc,_0x15bb60,_0x347d0c,_0x53dea3,_0x1e8591,_0x356256);_[_0xaa41('0x121')](_0x356256,ut[_0xaa41('0x122')](_0x5aee9b));_0x356256[_0xaa41('0x123')]=moment()[_0xaa41('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e86cc['variables']=_0x5aee9b;var _0xa63e60=ut[_0xaa41('0x124')](_0x356256,_0x1e86cc,_0x5aee9b,_0x356256[_0xaa41('0x83')],_0x232732);return ami[_0xaa41('0x125')](_0xa63e60)[_0xaa41('0x56')](function(_0x5e3bb2){_0x1e86cc[_0xaa41('0x2f')]+=0x1;logger[_0xaa41('0x27')]('[originated][increment]',_0x1e8591,_0xaa41('0x9c'),_0x1e86cc[_0xaa41('0x33')],'originated:\x20',_0x1e86cc[_0xaa41('0x2f')]);_0x239f1b(_0x5e3bb2);})[_0xaa41('0x4d')](function(_0x58a5e5){ut[_0xaa41('0xdc')](_0x356256,0xe,_0xaa41('0x126'));rpcDb['createAgentHistory'](_0x356256,_0xaa41('0x127'));_0x445925(_0x58a5e5);});});};Preview['prototype']['syncNewExten']=function(_0x1ffee2){if(this[_0xaa41('0x14')][_0x1ffee2[_0xaa41('0x84')]]){this[_0xaa41('0x14')][_0x1ffee2[_0xaa41('0x84')]]['channel']=_0x1ffee2[_0xaa41('0x128')];}};Preview['prototype']['syncOriginateResponse']=function(_0x25548d){var _0x28685a=this;var _0x2f62f6=this[_0xaa41('0x14')][_0x25548d[_0xaa41('0x129')]];if(_0x2f62f6){if(_0x2f62f6[_0xaa41('0x12a')]&&this[_0xaa41('0x15')][_0x2f62f6['lookAgent']]){ut[_0xaa41('0x12b')](_0x2f62f6,this[_0xaa41('0x15')][_0x2f62f6[_0xaa41('0x12a')]][_0xaa41('0x33')],this[_0xaa41('0x15')][_0x2f62f6[_0xaa41('0x12a')]]['id']);}var _0x3aafe6=_[_0xaa41('0x12c')](_0x2f62f6);_0x3aafe6[_0xaa41('0x12d')]=moment()[_0xaa41('0x2a')](_0xaa41('0x5f'));var _0x2e8c8f=_0x28685a['campaignsPreview'][_0x2f62f6['queue']];if(ut[_0xaa41('0x12e')](_0x25548d[_0xaa41('0x12f')])){if(_0x2f62f6[_0xaa41('0xa9')]){rpcDb['unlockContact'](_0x2f62f6[_0xaa41('0x86')]);}if(_0x2f62f6[_0xaa41('0x83')]){rpcDb[_0xaa41('0xfe')](_0x2f62f6[_0xaa41('0x86')]);}ami[_0xaa41('0x26')](_0xaa41('0x130'),ut[_0xaa41('0x7a')](_0x2f62f6,_0xaa41('0x131'),this[_0xaa41('0x25')][_0x2f62f6[_0xaa41('0x45')]]));this[_0xaa41('0x132')](_0x3aafe6,_0x2e8c8f,_0x25548d);}else{_0x2f62f6[_0xaa41('0x123')]=moment()[_0xaa41('0x2a')](_0xaa41('0x5f'));ut[_0xaa41('0xdc')](_0x3aafe6,0x4,'Answer');rpcDb[_0xaa41('0xdd')](_0x3aafe6,_0xaa41('0x133'));}}};Preview[_0xaa41('0xf')]['syncHangup']=function(_0x125efb){var _0xfc1e24=this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]];var _0x21c0c6;if(_0xfc1e24){_0x21c0c6=this[_0xaa41('0x25')][_0xfc1e24[_0xaa41('0x45')]];logger[_0xaa41('0x27')]('[syncHangup][talking]',_0x125efb[_0xaa41('0x84')],_0xaa41('0x9c'),_0x21c0c6[_0xaa41('0x33')],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);}if(this['actions'][_0x125efb[_0xaa41('0x84')]]&&_0x125efb['linkedid']!==_0x125efb[_0xaa41('0x8c')]){if(_0x125efb[_0xaa41('0x134')]==='16'&&this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){this[_0xaa41('0x74')](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}else if(this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){logger[_0xaa41('0x27')]('[syncHangup][talking][cause]',_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')],_0xaa41('0x9c'),_0x21c0c6[_0xaa41('0x33')],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this[_0xaa41('0x74')](_0x125efb,_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')]);}}else if(_0xfc1e24&&_['isNil'](_0xfc1e24[_0xaa41('0x135')])&&_0x21c0c6[_0xaa41('0x136')]&&_0x125efb[_0xaa41('0x84')]===_0x125efb[_0xaa41('0x8c')]&&_[_0xaa41('0x43')](_0x125efb[_0xaa41('0xdb')])&&_0x125efb['cause']==='16'&&_0x125efb['channelstate']==='6'&&_[_0xaa41('0xd9')](_0xfc1e24['transfer'])){if(_0xfc1e24[_0xaa41('0xa9')]){rpcDb[_0xaa41('0xfd')](_0xfc1e24[_0xaa41('0x86')]);}if(_0xfc1e24[_0xaa41('0x83')]){rpcDb[_0xaa41('0xfe')](_0xfc1e24[_0xaa41('0x86')]);}_0x125efb[_0xaa41('0xdb')]='22';this[_0xaa41('0x132')](_0xfc1e24,_0x21c0c6,_0x125efb);}else if(_0xfc1e24&&_0xfc1e24[_0xaa41('0x137')]){if(_0x125efb[_0xaa41('0x134')]==='16'&&this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){logger[_0xaa41('0x27')]('[syncHangup][talking][transfer]',_0x125efb[_0xaa41('0x84')],_0x125efb['cause'],_0xaa41('0x9c'),_0x21c0c6['name'],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this[_0xaa41('0x74')](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}else if(this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]]['dialAnswer']){logger[_0xaa41('0x27')]('[syncHangup][talking][cause]',_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')],_0xaa41('0x9c'),_0x21c0c6['name'],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this['callProgressDetectingCustomer'](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}}};Preview[_0xaa41('0xf')]['syncDialEnd']=function(_0x3ecde6){if(this['actions'][_0x3ecde6[_0xaa41('0x138')]]&&_0x3ecde6[_0xaa41('0x138')]!==_0x3ecde6[_0xaa41('0x139')]){this[_0xaa41('0x74')](_0x3ecde6,_0x3ecde6['destlinkedid'],_0x3ecde6[_0xaa41('0xce')]);}};Preview[_0xaa41('0xf')][_0xaa41('0x1c')]=function(_0x49e4a5){if(this[_0xaa41('0x14')][_0x49e4a5[_0xaa41('0x84')]]&&_0x49e4a5[_0xaa41('0x84')]!==_0x49e4a5[_0xaa41('0x8c')]&&!this[_0xaa41('0x14')][_0x49e4a5[_0xaa41('0x84')]][_0xaa41('0x48')]){if(_0x49e4a5[_0xaa41('0x134')]==='1'){this['callProgressDetectingCustomer'](_0x49e4a5,_0x49e4a5[_0xaa41('0x84')],_0x49e4a5['cause']);}}};Preview[_0xaa41('0xf')][_0xaa41('0x13a')]=function(_0x1fa855,_0x272f3f,_0x36cdd2){if(this[_0xaa41('0x14')][_0x1fa855]){if(_[_0xaa41('0x43')](this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')])){this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')]={};}this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')][_0x272f3f]=_0x36cdd2;}};Preview['prototype'][_0xaa41('0x21')]=function(_0x366b1c){try{if(!_[_0xaa41('0x43')](_0x366b1c)){if(ut[_0xaa41('0x13c')](_[_0xaa41('0x13d')](_0x366b1c[_0xaa41('0x13e')])[0x0])){this[_0xaa41('0x13a')](_0x366b1c[_0xaa41('0x8c')],_[_0xaa41('0x13d')](_0x366b1c['variable'])[0x0],_0x366b1c[_0xaa41('0x13f')]);}}}catch(_0x30a438){logger[_0xaa41('0x140')](_0xaa41('0x141'),util[_0xaa41('0x142')](_0x30a438,{'showHidden':![],'depth':null}));}};Preview[_0xaa41('0xf')][_0xaa41('0x143')]=function(_0x3f1b1a){if(_0x3f1b1a){if(this[_0xaa41('0x14')][_0x3f1b1a[_0xaa41('0x144')]]){this['actions'][_0x3f1b1a['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xaa41('0xf')][_0xaa41('0x24')]=function(_0x5ccba6){if(_0x5ccba6){if(this[_0xaa41('0x14')][_0x5ccba6[_0xaa41('0x145')]]){this['actions'][_0x5ccba6[_0xaa41('0x145')]]['transfer']=!![];}}};module[_0xaa41('0x146')]=Preview;
\ No newline at end of file
index f391a7d..550b66e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d4=['checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','error','inspect','createHistory','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x86d4,0x100));var _0x486d=function(_0x29c6e6,_0x195afb){_0x29c6e6=_0x29c6e6-0x0;var _0x326fd7=_0x86d4[_0x29c6e6];return _0x326fd7;};'use strict';var util=require(_0x486d('0x0'));var BPromise=require(_0x486d('0x1'));var logger=require('../../../config/logger')(_0x486d('0x2'));var cmHopper=require(_0x486d('0x3'));var cmHopperHistory=require(_0x486d('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x486d('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2f5376){return function(_0x50d63b){logger[_0x486d('0x6')](_0x2f5376,util[_0x486d('0x7')](_0x50d63b,{'showHidden':![],'depth':null}));};}function create(_0x539821){return cmHopperHistory[_0x486d('0x8')](_0x539821)[_0x486d('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x14ad92){return BPromise[_0x486d('0xa')]()['then'](agentReportPreview[_0x486d('0x8')](_0x14ad92))['catch'](loggerCatch(_0x486d('0xb')));}function moveContact(_0xcc60a7){return cmHopper[_0x486d('0xc')](_0xcc60a7,!![])[_0x486d('0x9')](loggerCatch(_0x486d('0xd')));}exports[_0x486d('0xe')]=function(_0x2b8782){return cmHopperBlack[_0x486d('0xe')](_0x2b8782)[_0x486d('0x9')](loggerCatch(_0x486d('0xf')));};exports[_0x486d('0x10')]=function(_0x291ad8){return BPromise['resolve']()[_0x486d('0x11')](cmHopper[_0x486d('0x10')](_0x291ad8))['catch'](loggerCatch(_0x486d('0x12')));};exports['createHistory']=function(_0x293d96,_0x574568){create(_0x293d96)[_0x486d('0x9')](loggerCatch(_0x574568));moveContact(_0x293d96)[_0x486d('0x9')](loggerCatch(_0x574568));};exports['createAgentHistory']=function(_0x59f323,_0x2d7062){createAgent(_0x59f323)[_0x486d('0x9')](loggerCatch(_0x2d7062));};exports['createCustomerHistory']=function(_0x1feca3,_0x5af194){create(_0x1feca3)[_0x486d('0x9')](loggerCatch(_0x5af194));};exports[_0x486d('0x13')]=function(_0x43ced2,_0x34d2fa){moveContact(_0x43ced2)['catch'](loggerCatch(_0x34d2fa));};exports[_0x486d('0x14')]=function(_0x4fb7e4,_0x42bb66,_0x26ce42){if(_0x42bb66){_0x4fb7e4[_0x486d('0x15')]=null;}if(_0x26ce42){_0x4fb7e4[_0x486d('0x16')]=![];}return cmHopper[_0x486d('0x14')](_0x4fb7e4)['catch'](loggerCatch(_0x486d('0x17')));};exports[_0x486d('0x18')]=function(_0x4b5d58){return cmHopper[_0x486d('0x18')](_0x4b5d58)[_0x486d('0x9')](loggerCatch(_0x486d('0x19')));};exports[_0x486d('0x1a')]=function(_0x355aa3){return cmHopper[_0x486d('0x1a')]({'UserId':null},_0x355aa3,0x1)[_0x486d('0x9')](loggerCatch(_0x486d('0x1b')));};exports[_0x486d('0x1c')]=function(_0xcde597){return cmHopper[_0x486d('0x1a')]({'active':![]},_0xcde597,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x486d('0x1d')]=function(_0x96b126){var _0x1f5132={};_0x1f5132[_0x486d('0x1e')]=_0x96b126[_0x486d('0x1e')];_0x1f5132['uniqueid']=_0x96b126[_0x486d('0x1f')];_0x1f5132['calleridnum']=_0x96b126[_0x486d('0x20')];_0x1f5132[_0x486d('0x21')]=_0x96b126[_0x486d('0x21')];_0x1f5132[_0x486d('0x22')]=_0x96b126[_0x486d('0x22')];_0x1f5132[_0x486d('0x23')]=_0x96b126[_0x486d('0x24')];_0x1f5132[_0x486d('0x25')]=_0x96b126[_0x486d('0x24')];_0x1f5132[_0x486d('0x26')]=0x1;_0x1f5132[_0x486d('0x27')]=_0x96b126[_0x486d('0x28')];_0x1f5132[_0x486d('0x29')]=_0x96b126[_0x486d('0x2a')];_0x1f5132[_0x486d('0x2b')]=_0x486d('0x2c');_0x1f5132[_0x486d('0x2d')]=_0x486d('0x2e');_0x1f5132[_0x486d('0x2f')]=0x0;_0x1f5132[_0x486d('0x30')]=0x1;_0x1f5132[_0x486d('0x31')]=_0x96b126[_0x486d('0x2a')];_0x1f5132['queuecallerexitreason']='COMPLETED';return BPromise[_0x486d('0xa')]()[_0x486d('0x11')](voiceQueueReport[_0x486d('0x32')](_0x1f5132))[_0x486d('0x9')](loggerCatch(_0x486d('0x33')));};exports['getContactRecallMe']=function(_0x943280,_0x185d52){return BPromise[_0x486d('0xa')]()[_0x486d('0x11')](cmHopper[_0x486d('0x34')](_0x943280,_0x185d52))['catch'](loggerCatch(_0x486d('0x35')));};exports['rescheduleContactInQueue']=function(_0x1e4506){return cmHopper[_0x486d('0x14')](_0x1e4506,!![],!![])[_0x486d('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0x401c=['endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x401c,0x81));var _0xc401=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x401c[_0x237f8b];return _0x423f94;};'use strict';var util=require('util');var BPromise=require(_0xc401('0x0'));var logger=require(_0xc401('0x1'))(_0xc401('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc401('0x3'));var agentReportPreview=require(_0xc401('0x4'));var voiceQueueReport=require(_0xc401('0x5'));function loggerCatch(_0x426aa0){return function(_0xe2693e){logger[_0xc401('0x6')](_0x426aa0,util[_0xc401('0x7')](_0xe2693e,{'showHidden':![],'depth':null}));};}function create(_0x28aefa){return cmHopperHistory['createHistory'](_0x28aefa)[_0xc401('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x27a91c){return BPromise[_0xc401('0x9')]()['then'](agentReportPreview['createHistory'](_0x27a91c))[_0xc401('0x8')](loggerCatch(_0xc401('0xa')));}function moveContact(_0x3f416b){return cmHopper[_0xc401('0xb')](_0x3f416b,!![])[_0xc401('0x8')](loggerCatch(_0xc401('0xc')));}exports[_0xc401('0xd')]=function(_0x58746c){return cmHopperBlack['checkIsBlackList'](_0x58746c)[_0xc401('0x8')](loggerCatch(_0xc401('0xe')));};exports[_0xc401('0xf')]=function(_0x3e20f9){return BPromise[_0xc401('0x9')]()[_0xc401('0x10')](cmHopper[_0xc401('0xf')](_0x3e20f9))[_0xc401('0x8')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x5df7fb,_0xf068b4){create(_0x5df7fb)[_0xc401('0x8')](loggerCatch(_0xf068b4));moveContact(_0x5df7fb)[_0xc401('0x8')](loggerCatch(_0xf068b4));};exports[_0xc401('0x11')]=function(_0x5b0b0a,_0x4ac724){createAgent(_0x5b0b0a)[_0xc401('0x8')](loggerCatch(_0x4ac724));};exports[_0xc401('0x12')]=function(_0x5dcf3f,_0x3f1f89){create(_0x5dcf3f)[_0xc401('0x8')](loggerCatch(_0x3f1f89));};exports[_0xc401('0x13')]=function(_0x150fb7,_0x27a1a2){moveContact(_0x150fb7)[_0xc401('0x8')](loggerCatch(_0x27a1a2));};exports[_0xc401('0x14')]=function(_0xff1694,_0x236fd5,_0x3de75b){if(_0x236fd5){_0xff1694[_0xc401('0x15')]=null;}if(_0x3de75b){_0xff1694['active']=![];}return cmHopper[_0xc401('0x14')](_0xff1694)[_0xc401('0x8')](loggerCatch(_0xc401('0x16')));};exports[_0xc401('0x17')]=function(_0x490f87){return cmHopper[_0xc401('0x17')](_0x490f87)['catch'](loggerCatch(_0xc401('0x18')));};exports[_0xc401('0x19')]=function(_0x351e2f){return cmHopper[_0xc401('0x19')]({'UserId':null},_0x351e2f,0x1)[_0xc401('0x8')](loggerCatch(_0xc401('0x1a')));};exports['disableContact']=function(_0x3e5835){return cmHopper[_0xc401('0x19')]({'active':![]},_0x3e5835,0x1)[_0xc401('0x8')](loggerCatch(_0xc401('0x1b')));};exports[_0xc401('0x1c')]=function(_0x44c53c){var _0x29452a={};_0x29452a['type']=_0x44c53c[_0xc401('0x1d')];_0x29452a[_0xc401('0x1e')]=_0x44c53c[_0xc401('0x1e')];_0x29452a[_0xc401('0x1f')]=_0x44c53c['calleridnum'];_0x29452a['calleridname']=_0x44c53c[_0xc401('0x20')];_0x29452a[_0xc401('0x21')]=_0x44c53c[_0xc401('0x21')];_0x29452a[_0xc401('0x22')]=_0x44c53c[_0xc401('0x23')];_0x29452a[_0xc401('0x24')]=_0x44c53c[_0xc401('0x23')];_0x29452a[_0xc401('0x25')]=0x1;_0x29452a[_0xc401('0x26')]=_0x44c53c[_0xc401('0x27')];_0x29452a[_0xc401('0x28')]=_0x44c53c[_0xc401('0x29')];_0x29452a[_0xc401('0x2a')]=_0xc401('0x2b');_0x29452a[_0xc401('0x2c')]=_0xc401('0x2d');_0x29452a[_0xc401('0x2e')]=0x0;_0x29452a[_0xc401('0x2f')]=0x1;_0x29452a[_0xc401('0x30')]=_0x44c53c['membername'];_0x29452a[_0xc401('0x31')]='COMPLETED';return BPromise[_0xc401('0x9')]()[_0xc401('0x10')](voiceQueueReport[_0xc401('0x32')](_0x29452a))[_0xc401('0x8')](loggerCatch(_0xc401('0x33')));};exports[_0xc401('0x34')]=function(_0x26377e,_0x2056e8){return BPromise[_0xc401('0x9')]()[_0xc401('0x10')](cmHopper[_0xc401('0x34')](_0x26377e,_0x2056e8))[_0xc401('0x8')](loggerCatch(_0xc401('0x35')));};exports[_0xc401('0x36')]=function(_0x2f1f12){return cmHopper[_0xc401('0x14')](_0x2f1f12,!![],!![])[_0xc401('0x8')](loggerCatch(_0xc401('0x37')));};
\ No newline at end of file
index 3dc6d32..396ba6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eff=['hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','logLookAgent','membername','logCustomer','getSeconds','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','dialAnswer','scheduledat','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-contactid','xmd-callerid','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','../../dialer/utils','logger','info','inspect','loggerError','error','logger2','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','format','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','toLower','updateOriginated'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x6eff,0xf1));var _0xf6ef=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x6eff[_0x4ae829];return _0x256b31;};'use strict';var util=require(_0xf6ef('0x0'));var _=require(_0xf6ef('0x1'));var moment=require(_0xf6ef('0x2'));var logger=require(_0xf6ef('0x3'))(_0xf6ef('0x4'));var ipAgi=process[_0xf6ef('0x5')]['XCALLY_IP_AGI']||_0xf6ef('0x6');var utils=require(_0xf6ef('0x7'));exports['loggerCatch']=function(_0x38d7fa){return function(_0x10c49d){logger['error'](_0x38d7fa,util['inspect'](_0x10c49d,{'showHidden':![],'depth':null}));};};exports[_0xf6ef('0x8')]=function(_0x43457e,_0x15a8ec){logger[_0xf6ef('0x9')](_0x43457e,util[_0xf6ef('0xa')](_0x15a8ec,{'showHidden':![],'depth':null}));};exports[_0xf6ef('0xb')]=function(_0x1512fb,_0x86f61c){logger[_0xf6ef('0xc')](_0x1512fb,util[_0xf6ef('0xa')](_0x86f61c,{'showHidden':![],'depth':null}));};exports[_0xf6ef('0xd')]=function(_0xf9c373){return function(_0x230b41){logger['info'](_0xf9c373,util['inspect'](_0x230b41,{'showHidden':![],'depth':null}));};};exports[_0xf6ef('0xe')]=function(_0x34ffdb,_0x1bd79e,_0x2ce021){return{'message':_0x34ffdb,'unlock':_0x1bd79e,'active':_0x2ce021};};exports['getCallerId']=function(_0x64c093,_0x10ed13,_0x2701d7){if(!_[_0xf6ef('0xf')](_0x2701d7)&&_0xf6ef('0x10')===typeof _0x2701d7&&!_[_0xf6ef('0x11')](_0x2701d7)){if(!_[_0xf6ef('0xf')](_0x10ed13)&&_0xf6ef('0x10')===typeof _0x10ed13&&!_[_0xf6ef('0x11')](_0x10ed13)){return util['format'](_0xf6ef('0x12'),_0x10ed13,_0x2701d7);}return util['format'](_0xf6ef('0x12'),_0x2701d7,_0x2701d7);}if(!_[_0xf6ef('0xf')](_0x64c093)&&_0xf6ef('0x10')===typeof _0x64c093&&!_[_0xf6ef('0x11')](_0x64c093)){return _0x64c093;}return _0xf6ef('0x13');};exports[_0xf6ef('0x14')]=function(_0x1e4e41){if(_[_0xf6ef('0x15')](_0x1e4e41)){return![];}return _0x1e4e41;};exports['addVariables']=function(_0x48eaeb,_0x1339e7,_0x379eba,_0x5bc111,_0x24cd75,_0x1c5006){var _0x14d9c8={'XMD-QUEUE':_0x1339e7[_0xf6ef('0x16')]?_0x1339e7[_0xf6ef('0x16')][_0xf6ef('0x17')]:'','XMD-CALLERID':_0x5bc111,'XMD-CALLERID-PREVIEW':_0x1c5006?util[_0xf6ef('0x18')](_0xf6ef('0x12'),_0x1c5006['calleridname'],_0x1c5006[_0xf6ef('0x19')]):_0x5bc111,'XMD-DIALID':_0x24cd75,'XMD-CONTACTID':_0x1339e7['ContactId'],'XMD-CDRTYPE':_0xf6ef('0x1a'),'CALLERID(all)':_0x5bc111,'XMD-VOICEQUEUEID':_0x1339e7[_0xf6ef('0x1b')],'XMD-DIALCHANNEL':_0x379eba,'XMD-DIALTIMEOUT':_0x48eaeb[_0xf6ef('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x48eaeb[_0xf6ef('0x1d')]?'g':'',_['isEmpty'](_0x48eaeb[_0xf6ef('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x48eaeb[_0xf6ef('0x1f')]||'','XMD-AGI':_0x48eaeb[_0xf6ef('0x20')]?util[_0xf6ef('0x18')](_0xf6ef('0x21'),ipAgi,_0x48eaeb[_0xf6ef('0x20')]):_0xf6ef('0x22'),'XMD-AGIAFTER':_0x48eaeb[_0xf6ef('0x1d')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x48eaeb[_0xf6ef('0x1d')]):_0xf6ef('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x1c5006?_0x1c5006[_0xf6ef('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x1c5006?_0x1c5006[_0xf6ef('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xf6ef('0x11')](_0x48eaeb[_0xf6ef('0x1e')])){_0x14d9c8[util[_0xf6ef('0x18')]('%s',_0xf6ef('0x25'))]=_0x48eaeb[_0xf6ef('0x1e')];_0x14d9c8[util[_0xf6ef('0x18')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x24cd75;}return _0x14d9c8;};exports[_0xf6ef('0x26')]=function(_0x431ec1){var _0x430175={};for(var _0xd3dfa in _0x431ec1){if(_0x431ec1['hasOwnProperty'](_0xd3dfa)){_0x430175[util['format']('%s',_[_0xf6ef('0x27')](_0xd3dfa))]=_0x431ec1[_0xd3dfa];}}return{'variables':_0x430175};};exports[_0xf6ef('0x28')]=function(_0x5ca4ec,_0x3e0446){if(!_['isNil'](_0x5ca4ec)){if(_0x5ca4ec[_0xf6ef('0x29')]('originated')){if(_0x5ca4ec[_0xf6ef('0x2a')]>0x0){_0x5ca4ec['originated']-=0x1;}else{logger[_0xf6ef('0xc')](_0xf6ef('0x2b'),_0x3e0446);}}}else{logger[_0xf6ef('0xc')](_0xf6ef('0x2c'),_0x3e0446);}};exports[_0xf6ef('0x2d')]=function(_0x206e90){var _0x9403e1=moment()[_0xf6ef('0x18')]('YYYY-MM-DD\x20HH:mm:ss');_0x206e90[_0xf6ef('0x2e')]=0xd;_0x206e90['statedesc']=_0xf6ef('0x2f');_0x206e90[_0xf6ef('0x30')]=_0x9403e1;_0x206e90[_0xf6ef('0x31')]=_0x9403e1;_0x206e90[_0xf6ef('0x32')]=_0x9403e1;};exports[_0xf6ef('0x33')]=function(_0x23e7f4,_0x41408b,_0x43e03c){var _0x32f3c9=moment()['format'](_0xf6ef('0x34'));_0x23e7f4[_0xf6ef('0x2e')]=_0x41408b;_0x23e7f4[_0xf6ef('0x35')]=_0x43e03c;_0x23e7f4[_0xf6ef('0x31')]=_0x32f3c9;_0x23e7f4[_0xf6ef('0x36')]=utils['getSeconds'](_0x23e7f4[_0xf6ef('0x31')],_0x23e7f4[_0xf6ef('0x30')]);};exports[_0xf6ef('0x37')]=function(_0xdc3da1,_0x4eee22,_0x397e9f){_0xdc3da1[_0xf6ef('0x38')]=_0x4eee22;_0xdc3da1['UserId']=_0x397e9f;};exports[_0xf6ef('0x39')]=function(_0x34742d,_0x52cd28,_0x480250){var _0x3473af=moment()[_0xf6ef('0x18')](_0xf6ef('0x34'));_0x34742d[_0xf6ef('0x2e')]=_0x52cd28;_0x34742d[_0xf6ef('0x35')]=_0x480250;_0x34742d[_0xf6ef('0x31')]=_0x34742d['responsetime']?_0x34742d['responsetime']:_0x3473af;_0x34742d[_0xf6ef('0x32')]=_0x34742d[_0xf6ef('0x32')]?_0x34742d[_0xf6ef('0x32')]:_0x3473af;_0x34742d[_0xf6ef('0x36')]=utils[_0xf6ef('0x3a')](_0x34742d[_0xf6ef('0x31')]||0x0,_0x34742d[_0xf6ef('0x30')]||0x0);_0x34742d[_0xf6ef('0x3b')]=_0x34742d[_0xf6ef('0x3c')]?utils[_0xf6ef('0x3a')](_0x34742d[_0xf6ef('0x32')],_0x34742d['answertime']):0x0;};exports[_0xf6ef('0x3d')]=function(_0x2d6cba){return _0x2d6cba===_0xf6ef('0x3e');};exports[_0xf6ef('0x3f')]=function(_0x1e771f,_0x4ab5cc,_0x18e4a2,_0x43c4e9,_0x50d956){var _0x4fc89b=_0x43c4e9?_0xf6ef('0x40'):_0x1e771f[_0xf6ef('0x41')];_0x4fc89b=_0x50d956?_0xf6ef('0x42'):_0x4fc89b;return{'actionid':_0x1e771f[_0xf6ef('0x43')],'action':'originate','channel':_0x1e771f[_0xf6ef('0x44')],'callerid':util['format'](_0xf6ef('0x12'),_0x4fc89b,_0x1e771f[_0xf6ef('0x19')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x18e4a2,'timeout':(_0x4ab5cc['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1e771f[_0xf6ef('0x43')]};};exports[_0xf6ef('0x45')]=function(_0x12c630){return _0x12c630[_0xf6ef('0x46')]+_0x12c630[_0xf6ef('0x47')]+_0x12c630['countnoanswerretry']+_0x12c630['countagentrejectretry']+_0x12c630[_0xf6ef('0x48')];};exports[_0xf6ef('0x49')]=function(_0x40adc3){var _0x206d1b=_[_0xf6ef('0x4a')](_0x40adc3);_0x206d1b[_0xf6ef('0x2e')]=0xf;_0x206d1b['statedesc']='Global';return _0x206d1b;};exports[_0xf6ef('0x4b')]=function(_0x182145,_0x400088,_0x46d308){var _0x49a316={};_0x49a316[_0x400088]=_0x182145[_0x400088];_0x49a316[_0xf6ef('0x4c')]=![];_0x49a316['scheduledat']=moment()['add'](_0x46d308,_0xf6ef('0x4d'))[_0xf6ef('0x18')]('YYYY-MM-DD\x20HH:mm:ss');_0x49a316[_0xf6ef('0x4e')]=_0x182145['ContactId'];_0x49a316[_0xf6ef('0x4f')]=_0x182145[_0xf6ef('0x4f')];_0x49a316['VoiceQueueId']=_0x182145[_0xf6ef('0x1b')]||undefined;return _0x49a316;};exports[_0xf6ef('0x50')]=function(_0x281365,_0x356a7e){if(!_['isNil'](_0x281365)){if(_0x281365[_0xf6ef('0x51')]>0x0){_0x281365[_0xf6ef('0x51')]-=0x1;}else{logger['error'](_0x356a7e,_0xf6ef('0x52'));}}else{logger['error'](_0x356a7e,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xf6ef('0x53')]=function(_0x303144){if(_0x303144<=0x0){return!![];}return![];};function buildObj(_0x1a305f,_0x276eb6,_0x45da55){_0x1a305f[_0xf6ef('0x54')]=_0x276eb6;_0x1a305f['name']=_0x1a305f[_0xf6ef('0x55')];_0x1a305f[_0xf6ef('0x56')]=_0x1a305f[_0xf6ef('0x44')];_0x1a305f[_0xf6ef('0x57')]='voice';if(_0x45da55){_0x1a305f[_0xf6ef('0x58')]=_0x45da55[_0xf6ef('0x58')];}return _0x1a305f;}exports[_0xf6ef('0x59')]=buildObj;exports[_0xf6ef('0x5a')]=function(_0x1becd2){var _0xa4096d={};_0xa4096d['queue']=_0x1becd2[_0xf6ef('0x55')];_0xa4096d[_0xf6ef('0x56')]=_0x1becd2['channelAgent'];_0xa4096d[_0xf6ef('0x43')]=_0x1becd2['uniqueid'];return _0xa4096d;};exports['agentReadyId']=function(_0x3da3f3){var _0x73a530=[];for(var _0x1c96ea in _0x3da3f3){if(_0x3da3f3[_0xf6ef('0x29')](_0x1c96ea)){if(!_[_0xf6ef('0x15')](_0x3da3f3[_0x1c96ea])&&_0x3da3f3[_0x1c96ea][_0xf6ef('0x2e')]==='not_inuse'&&_0x3da3f3[_0x1c96ea][_0xf6ef('0x5b')]===_0xf6ef('0x5c')){_0x73a530[_0xf6ef('0x5d')](_0x3da3f3[_0x1c96ea]['id']);}}}return _0x73a530;};exports[_0xf6ef('0x5e')]=function(_0x57e5a8){var _0x527078=moment()[_0xf6ef('0x5f')](0x0);var _0x37e3c6=moment(_0x57e5a8)[_0xf6ef('0x5f')](0x0);return _0x527078[_0xf6ef('0x60')](_0x37e3c6,_0xf6ef('0x61'));};exports[_0xf6ef('0x62')]=function(_0x4fa06a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fa06a[_0xf6ef('0x4e')],'ListId':_0x4fa06a['ListId'],'VoiceQueueId':_0x4fa06a['VoiceQueueId']||undefined,'CampaignId':_0x4fa06a[_0xf6ef('0x63')]||undefined};};exports[_0xf6ef('0x64')]=function(_0x184493){if(_0x184493===_0xf6ef('0x43')||_0x184493==='idContact'||_0x184493===_0xf6ef('0x55')||_0x184493===_0xf6ef('0x65')||_0x184493==='campaigntype'||_0x184493===_0xf6ef('0x66')||_0x184493===_0xf6ef('0x38')||_0x184493===_0xf6ef('0x44')||_0x184493===_0xf6ef('0x41')||_0x184493===_0xf6ef('0x4c')||_0x184493==='calleridnum'||_0x184493===_0xf6ef('0x67')||_0x184493===_0xf6ef('0x46')||_0x184493===_0xf6ef('0x47')||_0x184493===_0xf6ef('0x68')||_0x184493===_0xf6ef('0x69')||_0x184493===_0xf6ef('0x6a')||_0x184493===_0xf6ef('0x6b')||_0x184493===_0xf6ef('0x6c')||_0x184493===_0xf6ef('0x6d')||_0x184493===_0xf6ef('0x4e')||_0x184493==='ListId'||_0x184493===_0xf6ef('0x6e')||_0x184493==='VoiceQueueId'||_0x184493===_0xf6ef('0x6f')||_0x184493===_0xf6ef('0x70')||_0x184493===_0xf6ef('0x71')||_0x184493===_0xf6ef('0x72')||_0x184493===_0xf6ef('0x73')||_0x184493===_0xf6ef('0x74')||_0x184493==='xmd-dialtimeout'||_0x184493==='xmd-dialoptions'||_0x184493===_0xf6ef('0x75')||_0x184493==='xmd-dialchannel'||_0x184493===_0xf6ef('0x76')||_0x184493==='xmd-cdrtype'||_0x184493===_0xf6ef('0x77')||_0x184493==='xmd-agiafter'||_0x184493==='xmd-agi'||_0x184493==='rtpaudioqos'||_0x184493===_0xf6ef('0x78')||_0x184493==='rtpaudioqosjitter'||_0x184493===_0xf6ef('0x79')||_0x184493===_0xf6ef('0x7a')||_0x184493==='rtpaudioqoslossbridged'||_0x184493===_0xf6ef('0x7b')||_0x184493==='rtpaudioqosrttbridged'||_0x184493===_0xf6ef('0x7c')||_0x184493===_0xf6ef('0x78')||_0x184493===_0xf6ef('0x7d')||_0x184493===_0xf6ef('0x79')||_0x184493==='rtpaudioqosloss'||_0x184493===_0xf6ef('0x7e')||_0x184493===_0xf6ef('0x7b')||_0x184493===_0xf6ef('0x7f')||_0x184493===_0xf6ef('0x80')||_0x184493===_0xf6ef('0x81')||_0x184493==='state'||_0x184493===_0xf6ef('0x35')){return![];}return!![];};exports[_0xf6ef('0x82')]=function(_0x58e3ce,_0x1299c0){var _0x3b8831,_0x19f5a0,_0x142121;if(_0x1299c0<=0x0){_0x1299c0=0x1;}_0x3b8831=new RegExp(_0xf6ef('0x83')+_0x1299c0+'}$');_0x19f5a0=Math[_0xf6ef('0x84')](0xa,_0x1299c0-0x1);_0x142121=Math['pow'](0xa,_0x1299c0)-0x1;return util[_0xf6ef('0x18')]('%s',_[_0xf6ef('0x85')](_0x58e3ce,_0x3b8831,_['random'](_0x19f5a0,_0x142121)));};exports[_0xf6ef('0x86')]=function(_0x360644){var _0x216067=_0x360644[_0xf6ef('0x87')](/"(.*?)"/);return _0x216067?_0x216067[0x1]:_0x360644;};exports[_0xf6ef('0x88')]=function(_0x3be534){var _0x4fbea9=_0x3be534['match'](/<(.*?)>/);return _0x4fbea9?_0x4fbea9[0x1]:_0x3be534;};function buildNoAnswerEventPayload(_0x2334f8,_0x539d21){var _0x145171=buildObj(_0x2334f8,_0xf6ef('0x89'));if(!_[_0xf6ef('0x11')](_0x539d21['variables'])){Object['keys'](_0x539d21[_0xf6ef('0x8a')])[_0xf6ef('0x8b')](function(_0x2fbcd1){_0x145171[_0x2fbcd1[_0xf6ef('0x8c')]()]=_0x539d21['variables'][_0x2fbcd1];});}return _0x145171;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0xdb61=['\x5cw{0,','pow','random','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','logger','inspect','loggerError','logger2','info','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','statedesc','endtime','talktime','answertime','getSeconds','isFailure','Failure','RECALL','originate','channelAgent','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','not_inuse','reachable','getDiff','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','getCallerIdRandom'];(function(_0x105e4d,_0x44d52e){var _0x4ae676=function(_0x126a9b){while(--_0x126a9b){_0x105e4d['push'](_0x105e4d['shift']());}};_0x4ae676(++_0x44d52e);}(_0xdb61,0x1ca));var _0x1db6=function(_0x2b4a90,_0x2ae989){_0x2b4a90=_0x2b4a90-0x0;var _0x4e1b7a=_0xdb61[_0x2b4a90];return _0x4e1b7a;};'use strict';var util=require(_0x1db6('0x0'));var _=require('lodash');var moment=require(_0x1db6('0x1'));var logger=require(_0x1db6('0x2'))(_0x1db6('0x3'));var ipAgi=process[_0x1db6('0x4')][_0x1db6('0x5')]||_0x1db6('0x6');var utils=require(_0x1db6('0x7'));exports[_0x1db6('0x8')]=function(_0x3d79c0){return function(_0x581c60){logger[_0x1db6('0x9')](_0x3d79c0,util['inspect'](_0x581c60,{'showHidden':![],'depth':null}));};};exports[_0x1db6('0xa')]=function(_0x2303cd,_0x11458d){logger['info'](_0x2303cd,util[_0x1db6('0xb')](_0x11458d,{'showHidden':![],'depth':null}));};exports[_0x1db6('0xc')]=function(_0x15af2e,_0x2ec9ca){logger['error'](_0x15af2e,util[_0x1db6('0xb')](_0x2ec9ca,{'showHidden':![],'depth':null}));};exports[_0x1db6('0xd')]=function(_0x388fc1){return function(_0x4fb62c){logger[_0x1db6('0xe')](_0x388fc1,util[_0x1db6('0xb')](_0x4fb62c,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x392600,_0x7047f,_0x504a9c){return{'message':_0x392600,'unlock':_0x7047f,'active':_0x504a9c};};exports[_0x1db6('0xf')]=function(_0xdd09ec,_0xc600a2,_0x2bc923){if(!_[_0x1db6('0x10')](_0x2bc923)&&_0x1db6('0x11')===typeof _0x2bc923&&!_['isEmpty'](_0x2bc923)){if(!_[_0x1db6('0x10')](_0xc600a2)&&_0x1db6('0x11')===typeof _0xc600a2&&!_['isEmpty'](_0xc600a2)){return util['format']('\x22%s\x22\x20<%s>',_0xc600a2,_0x2bc923);}return util[_0x1db6('0x12')](_0x1db6('0x13'),_0x2bc923,_0x2bc923);}if(!_[_0x1db6('0x10')](_0xdd09ec)&&_0x1db6('0x11')===typeof _0xdd09ec&&!_[_0x1db6('0x14')](_0xdd09ec)){return _0xdd09ec;}return _0x1db6('0x15');};exports[_0x1db6('0x16')]=function(_0x2a97ee){if(_[_0x1db6('0x17')](_0x2a97ee)){return![];}return _0x2a97ee;};exports['addVariables']=function(_0x5b8a30,_0x78b317,_0x500c38,_0x4d4060,_0x5f4f5f,_0x1fa560){var _0x8bc20f={'XMD-QUEUE':_0x78b317[_0x1db6('0x18')]?_0x78b317['Queue'][_0x1db6('0x19')]:'','XMD-CALLERID':_0x4d4060,'XMD-CALLERID-PREVIEW':_0x1fa560?util[_0x1db6('0x12')](_0x1db6('0x13'),_0x1fa560[_0x1db6('0x1a')],_0x1fa560[_0x1db6('0x1b')]):_0x4d4060,'XMD-DIALID':_0x5f4f5f,'XMD-CONTACTID':_0x78b317[_0x1db6('0x1c')],'XMD-CDRTYPE':_0x1db6('0x1d'),'CALLERID(all)':_0x4d4060,'XMD-VOICEQUEUEID':_0x78b317[_0x1db6('0x1e')],'XMD-DIALCHANNEL':_0x500c38,'XMD-DIALTIMEOUT':_0x5b8a30[_0x1db6('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x1db6('0x20'),_0x5b8a30[_0x1db6('0x21')]?'g':'',_[_0x1db6('0x14')](_0x5b8a30['monitor_format'])?'':_0x1db6('0x22')),'XMD-DIALURL':_0x5b8a30[_0x1db6('0x23')]||'','XMD-AGI':_0x5b8a30['dialQueueProject']?util[_0x1db6('0x12')](_0x1db6('0x24'),ipAgi,_0x5b8a30['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x5b8a30[_0x1db6('0x21')]?util[_0x1db6('0x12')](_0x1db6('0x24'),ipAgi,_0x5b8a30[_0x1db6('0x21')]):_0x1db6('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x1fa560?_0x1fa560[_0x1db6('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x1fa560?_0x1fa560[_0x1db6('0x27')]:'','XMD-DESTINATION':_0x1db6('0x28'),'SIPADDHEADER':_0x1db6('0x29')};if(!_[_0x1db6('0x14')](_0x5b8a30[_0x1db6('0x2a')])){_0x8bc20f[util[_0x1db6('0x12')]('%s',_0x1db6('0x2b'))]=_0x5b8a30[_0x1db6('0x2a')];_0x8bc20f[util[_0x1db6('0x12')]('%s',_0x1db6('0x2c'))]=_0x5f4f5f;}if(_0x78b317&&_0x78b317['Contact']){for(var _0x5c7876 in _0x78b317[_0x1db6('0x2d')]){if(_0x78b317[_0x1db6('0x2d')]['hasOwnProperty'](_0x5c7876)){if(!_[_0x1db6('0x17')](_0x78b317['Contact'][_0x5c7876])&&_0x5c7876!=='id'&&_0x5c7876!=='tags'&&_0x5c7876!==_0x1db6('0x2e')&&_0x5c7876!==_0x1db6('0x2f')){_0x8bc20f[util[_0x1db6('0x12')](_0x1db6('0x30'),_0x1db6('0x31'),_[_0x1db6('0x32')](_0x5c7876))]=_0x78b317[_0x1db6('0x2d')][_0x5c7876];}}}}return _0x8bc20f;};exports[_0x1db6('0x33')]=function(_0x41f906){var _0x2f16c2={};for(var _0x41c9eb in _0x41f906){if(_0x41f906[_0x1db6('0x34')](_0x41c9eb)){_0x2f16c2[util[_0x1db6('0x12')]('%s',_[_0x1db6('0x35')](_0x41c9eb))]=_0x41f906[_0x41c9eb];}}return{'variables':_0x2f16c2};};exports['updateOriginated']=function(_0x16a5a9,_0x35beb7){if(!_[_0x1db6('0x17')](_0x16a5a9)){if(_0x16a5a9[_0x1db6('0x34')](_0x1db6('0x36'))){if(_0x16a5a9['originated']>0x0){_0x16a5a9[_0x1db6('0x36')]-=0x1;}else{logger['error'](_0x1db6('0x37'),_0x35beb7);}}}else{logger[_0x1db6('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x35beb7);}};exports[_0x1db6('0x38')]=function(_0x24d5af){var _0x152242=moment()[_0x1db6('0x12')](_0x1db6('0x39'));_0x24d5af[_0x1db6('0x3a')]=0xd;_0x24d5af['statedesc']='Blacklist';_0x24d5af[_0x1db6('0x3b')]=_0x152242;_0x24d5af[_0x1db6('0x3c')]=_0x152242;_0x24d5af['endtime']=_0x152242;};exports[_0x1db6('0x3d')]=function(_0x34f5f8,_0x273831,_0x5b72d5){var _0x1d97db=moment()[_0x1db6('0x12')](_0x1db6('0x39'));_0x34f5f8[_0x1db6('0x3a')]=_0x273831;_0x34f5f8['statedesc']=_0x5b72d5;_0x34f5f8[_0x1db6('0x3c')]=_0x1d97db;_0x34f5f8[_0x1db6('0x3e')]=utils['getSeconds'](_0x34f5f8[_0x1db6('0x3c')],_0x34f5f8[_0x1db6('0x3b')]);};exports[_0x1db6('0x3f')]=function(_0x4bc59c,_0x223843,_0x2f1275){_0x4bc59c[_0x1db6('0x40')]=_0x223843;_0x4bc59c[_0x1db6('0x41')]=_0x2f1275;};exports[_0x1db6('0x42')]=function(_0x179712,_0x1461c4,_0x4fc3d3){var _0x5afe9d=moment()[_0x1db6('0x12')](_0x1db6('0x39'));_0x179712['state']=_0x1461c4;_0x179712[_0x1db6('0x43')]=_0x4fc3d3;_0x179712[_0x1db6('0x3c')]=_0x179712[_0x1db6('0x3c')]?_0x179712['responsetime']:_0x5afe9d;_0x179712[_0x1db6('0x44')]=_0x179712[_0x1db6('0x44')]?_0x179712[_0x1db6('0x44')]:_0x5afe9d;_0x179712[_0x1db6('0x3e')]=utils['getSeconds'](_0x179712[_0x1db6('0x3c')]||0x0,_0x179712[_0x1db6('0x3b')]||0x0);_0x179712[_0x1db6('0x45')]=_0x179712[_0x1db6('0x46')]?utils[_0x1db6('0x47')](_0x179712['endtime'],_0x179712[_0x1db6('0x46')]):0x0;};exports[_0x1db6('0x48')]=function(_0x4d3dc7){return _0x4d3dc7===_0x1db6('0x49');};exports['variablesAction']=function(_0x8168fc,_0x4de7d6,_0x357901,_0x445746,_0x3b95ef){var _0xe0b2d6=_0x445746?_0x1db6('0x4a'):_0x8168fc[_0x1db6('0x1a')];_0xe0b2d6=_0x3b95ef?'BOOKED':_0xe0b2d6;return{'actionid':_0x8168fc['uniqueid'],'action':_0x1db6('0x4b'),'channel':_0x8168fc[_0x1db6('0x4c')],'callerid':util['format'](_0x1db6('0x13'),_0xe0b2d6,_0x8168fc['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x357901,'timeout':(_0x4de7d6[_0x1db6('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x8168fc[_0x1db6('0x4e')]};};exports[_0x1db6('0x4f')]=function(_0x1e2c28){return _0x1e2c28[_0x1db6('0x50')]+_0x1e2c28['countcongestionretry']+_0x1e2c28[_0x1db6('0x51')]+_0x1e2c28['countagentrejectretry']+_0x1e2c28[_0x1db6('0x52')];};exports[_0x1db6('0x53')]=function(_0x520828){var _0x22db34=_[_0x1db6('0x54')](_0x520828);_0x22db34[_0x1db6('0x3a')]=0xf;_0x22db34[_0x1db6('0x43')]=_0x1db6('0x55');return _0x22db34;};exports[_0x1db6('0x56')]=function(_0x50663f,_0x220ce7,_0x4d8aad){var _0x3fb284={};_0x3fb284[_0x220ce7]=_0x50663f[_0x220ce7];_0x3fb284[_0x1db6('0x57')]=![];_0x3fb284[_0x1db6('0x58')]=moment()[_0x1db6('0x59')](_0x4d8aad,_0x1db6('0x5a'))[_0x1db6('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fb284[_0x1db6('0x1c')]=_0x50663f[_0x1db6('0x1c')];_0x3fb284['ListId']=_0x50663f[_0x1db6('0x5b')];_0x3fb284['VoiceQueueId']=_0x50663f['VoiceQueueId']||undefined;return _0x3fb284;};exports['decrementTalkink']=function(_0x555a69,_0xcc8d32){if(!_[_0x1db6('0x17')](_0x555a69)){if(_0x555a69[_0x1db6('0x5c')]>0x0){_0x555a69['pTalking']-=0x1;}else{logger[_0x1db6('0x9')](_0xcc8d32,_0x1db6('0x5d'));}}else{logger['error'](_0xcc8d32,_0x1db6('0x5e'));}};exports[_0x1db6('0x5f')]=function(_0x26e2eb){if(_0x26e2eb<=0x0){return!![];}return![];};function buildObj(_0x3ce091,_0x2e22af,_0x52f741){_0x3ce091[_0x1db6('0x60')]=_0x2e22af;_0x3ce091[_0x1db6('0x19')]=_0x3ce091[_0x1db6('0x61')];_0x3ce091[_0x1db6('0x62')]=_0x3ce091[_0x1db6('0x4c')];_0x3ce091[_0x1db6('0x63')]=_0x1db6('0x64');if(_0x52f741){_0x3ce091[_0x1db6('0x65')]=_0x52f741[_0x1db6('0x65')];}return _0x3ce091;}exports['buildObj']=buildObj;exports[_0x1db6('0x66')]=function(_0x5d3dd2){var _0x1ea33a={};_0x1ea33a['queue']=_0x5d3dd2['queue'];_0x1ea33a[_0x1db6('0x62')]=_0x5d3dd2['channelAgent'];_0x1ea33a[_0x1db6('0x4e')]=_0x5d3dd2[_0x1db6('0x4e')];return _0x1ea33a;};exports['agentReadyId']=function(_0x189af5){var _0x650440=[];for(var _0xbbe705 in _0x189af5){if(_0x189af5['hasOwnProperty'](_0xbbe705)){if(!_[_0x1db6('0x17')](_0x189af5[_0xbbe705])&&_0x189af5[_0xbbe705][_0x1db6('0x3a')]===_0x1db6('0x67')&&_0x189af5[_0xbbe705]['status']===_0x1db6('0x68')){_0x650440['push'](_0x189af5[_0xbbe705]['id']);}}}return _0x650440;};exports[_0x1db6('0x69')]=function(_0x2a64c9){var _0x2dda44=moment()[_0x1db6('0x6a')](0x0);var _0x1395d9=moment(_0x2a64c9)[_0x1db6('0x6a')](0x0);return _0x2dda44['diff'](_0x1395d9,'seconds');};exports[_0x1db6('0x6b')]=function(_0x121ea3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x121ea3[_0x1db6('0x1c')],'ListId':_0x121ea3['ListId'],'VoiceQueueId':_0x121ea3[_0x1db6('0x1e')]||undefined,'CampaignId':_0x121ea3[_0x1db6('0x6c')]||undefined};};exports[_0x1db6('0x6d')]=function(_0x1987df){if(_0x1987df===_0x1db6('0x4e')||_0x1987df===_0x1db6('0x6e')||_0x1987df===_0x1db6('0x61')||_0x1987df===_0x1db6('0x6f')||_0x1987df===_0x1db6('0x70')||_0x1987df===_0x1db6('0x71')||_0x1987df===_0x1db6('0x40')||_0x1987df===_0x1db6('0x4c')||_0x1987df==='calleridname'||_0x1987df===_0x1db6('0x57')||_0x1987df==='calleridnum'||_0x1987df===_0x1db6('0x58')||_0x1987df===_0x1db6('0x50')||_0x1987df===_0x1db6('0x72')||_0x1987df===_0x1db6('0x51')||_0x1987df==='countglobal'||_0x1987df==='callback'||_0x1987df===_0x1db6('0x73')||_0x1987df===_0x1db6('0x74')||_0x1987df===_0x1db6('0x75')||_0x1987df===_0x1db6('0x1c')||_0x1987df==='ListId'||_0x1987df===_0x1db6('0x41')||_0x1987df==='VoiceQueueId'||_0x1987df==='sipcallid'||_0x1987df===_0x1db6('0x76')||_0x1987df==='xmd-queue'||_0x1987df===_0x1db6('0x77')||_0x1987df===_0x1db6('0x78')||_0x1987df===_0x1db6('0x79')||_0x1987df===_0x1db6('0x7a')||_0x1987df===_0x1db6('0x7b')||_0x1987df==='xmd-dialid'||_0x1987df===_0x1db6('0x7c')||_0x1987df===_0x1db6('0x7d')||_0x1987df===_0x1db6('0x7e')||_0x1987df==='xmd-callerid'||_0x1987df===_0x1db6('0x7f')||_0x1987df===_0x1db6('0x80')||_0x1987df===_0x1db6('0x81')||_0x1987df==='rtpaudioqosbridged'||_0x1987df===_0x1db6('0x82')||_0x1987df===_0x1db6('0x83')||_0x1987df===_0x1db6('0x84')||_0x1987df==='rtpaudioqoslossbridged'||_0x1987df===_0x1db6('0x85')||_0x1987df===_0x1db6('0x86')||_0x1987df===_0x1db6('0x81')||_0x1987df===_0x1db6('0x87')||_0x1987df==='rtpaudioqosjitter'||_0x1987df===_0x1db6('0x83')||_0x1987df===_0x1db6('0x84')||_0x1987df==='rtpaudioqoslossbridged'||_0x1987df===_0x1db6('0x85')||_0x1987df===_0x1db6('0x86')||_0x1987df===_0x1db6('0x88')||_0x1987df==='bridgepvtcallid'||_0x1987df===_0x1db6('0x3a')||_0x1987df===_0x1db6('0x43')){return![];}return!![];};exports[_0x1db6('0x89')]=function(_0x4732a4,_0x1f0e6){var _0xdb24de,_0x16d80c,_0x580104;if(_0x1f0e6<=0x0){_0x1f0e6=0x1;}_0xdb24de=new RegExp(_0x1db6('0x8a')+_0x1f0e6+'}$');_0x16d80c=Math[_0x1db6('0x8b')](0xa,_0x1f0e6-0x1);_0x580104=Math[_0x1db6('0x8b')](0xa,_0x1f0e6)-0x1;return util[_0x1db6('0x12')]('%s',_['replace'](_0x4732a4,_0xdb24de,_[_0x1db6('0x8c')](_0x16d80c,_0x580104)));};exports['extractCalleridName']=function(_0x11d186){var _0x4b0bb9=_0x11d186[_0x1db6('0x8d')](/"(.*?)"/);return _0x4b0bb9?_0x4b0bb9[0x1]:_0x11d186;};exports[_0x1db6('0x8e')]=function(_0x141c97){var _0x3b319a=_0x141c97[_0x1db6('0x8d')](/<(.*?)>/);return _0x3b319a?_0x3b319a[0x1]:_0x141c97;};function buildNoAnswerEventPayload(_0x23bd24,_0x247a9b){var _0x5c109a=buildObj(_0x23bd24,_0x1db6('0x8f'));if(!_[_0x1db6('0x14')](_0x247a9b[_0x1db6('0x90')])){Object[_0x1db6('0x91')](_0x247a9b[_0x1db6('0x90')])[_0x1db6('0x92')](function(_0x1896f7){_0x5c109a[_0x1896f7[_0x1db6('0x93')]()]=_0x247a9b[_0x1db6('0x90')][_0x1896f7];});}return _0x5c109a;}exports[_0x1db6('0x94')]=buildNoAnswerEventPayload;
\ No newline at end of file
index ec42f10..7026e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dd7=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload'];(function(_0x902400,_0x3ea93f){var _0x214cd2=function(_0x203ed2){while(--_0x203ed2){_0x902400['push'](_0x902400['shift']());}};_0x214cd2(++_0x3ea93f);}(_0x3dd7,0x102));var _0x73dd=function(_0x214dba,_0x320a44){_0x214dba=_0x214dba-0x0;var _0x43ba39=_0x3dd7[_0x214dba];return _0x43ba39;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x73dd('0x0'),'required':!![]},'membername':{'type':_0x73dd('0x0'),'required':!![]},'penalty':{'type':_0x73dd('0x1'),'required':![]},'paused':{'type':_0x73dd('0x2'),'required':![]}};exports[_0x73dd('0x3')]={'queue':{'type':_0x73dd('0x0'),'required':!![]},'interface':{'type':_0x73dd('0x0'),'required':!![]}};exports[_0x73dd('0x4')]={'interface':{'type':_0x73dd('0x0'),'required':!![]},'paused':{'type':_0x73dd('0x2')},'reason':{'type':_0x73dd('0x0'),'required':![]}};exports[_0x73dd('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x73dd('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x73dd('0x0'),'required':!![]},'filename':{'type':_0x73dd('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x73dd('0x0')}};exports[_0x73dd('0x6')]={'uniqueid':{'type':_0x73dd('0x0'),'required':!![]}};exports[_0x73dd('0x7')]={'uniqueid':{'type':_0x73dd('0x0'),'required':!![]},'exten':{'type':_0x73dd('0x0'),'required':!![]},'context':{'type':_0x73dd('0x0')}};
\ No newline at end of file
+var _0xefb7=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xefb7,0xf8));var _0x7efb=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xefb7[_0x2fc012];return _0x2891f9;};'use strict';exports[_0x7efb('0x0')]={'queue':{'type':_0x7efb('0x1'),'required':!![]},'interface':{'type':_0x7efb('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x7efb('0x2'),'required':![]}};exports[_0x7efb('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7efb('0x1'),'required':!![]}};exports[_0x7efb('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x7efb('0x2')},'reason':{'type':_0x7efb('0x1'),'required':![]}};exports[_0x7efb('0x5')]={'module':{'type':'string','required':![]}};exports[_0x7efb('0x6')]={'uniqueid':{'type':_0x7efb('0x1'),'required':!![]}};exports[_0x7efb('0x7')]={'uniqueid':{'type':_0x7efb('0x1'),'required':!![]},'filename':{'type':_0x7efb('0x1')},'format':{'type':_0x7efb('0x1')},'mixmonitorid':{'type':_0x7efb('0x1')}};exports[_0x7efb('0x8')]={'uniqueid':{'type':_0x7efb('0x1'),'required':!![]}};exports[_0x7efb('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x7efb('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 8d22856..69e9d4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x4fbec2,_0x32fc77){var _0x44c1dd=function(_0x2a21aa){while(--_0x2a21aa){_0x4fbec2['push'](_0x4fbec2['shift']());}};_0x44c1dd(++_0x32fc77);}(_0xdb28,0x106));var _0x8db2=function(_0x42a74f,_0x48052d){_0x42a74f=_0x42a74f-0x0;var _0x4d908b=_0xdb28[_0x42a74f];return _0x4d908b;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime;
\ No newline at end of file
+var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2032,0xd9));var _0x2203=function(_0x117fad,_0x2d2e91){_0x117fad=_0x117fad-0x0;var _0x95edc9=_0x2032[_0x117fad];return _0x95edc9;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime;
\ No newline at end of file
index e8906e3..f9877fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9ec=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb9ec,0x1d5));var _0xcb9e=function(_0x40539d,_0x49ea35){_0x40539d=_0x40539d-0x0;var _0x48d2e7=_0xb9ec[_0x40539d];return _0x48d2e7;};'use strict';function mergeDBDataToRealtime(_0x5979ea,_0x2f0f7d){var _0x34e17d=Object[_0xcb9e('0x0')]({},_0x5979ea);for(var _0x5f3d8b in _0x2f0f7d){if(_0x34e17d[_0xcb9e('0x1')](_0x5f3d8b)){_0x34e17d[_0x5f3d8b]=_0x2f0f7d[_0x5f3d8b];}}return _0x34e17d;}exports[_0xcb9e('0x2')]=mergeDBDataToRealtime;
\ No newline at end of file
+var _0x4df7=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x1dc4cd,_0xc9de54){var _0x5d0662=function(_0x4b1193){while(--_0x4b1193){_0x1dc4cd['push'](_0x1dc4cd['shift']());}};_0x5d0662(++_0xc9de54);}(_0x4df7,0x1ee));var _0x74df=function(_0x728a0d,_0x44ca89){_0x728a0d=_0x728a0d-0x0;var _0xc575ed=_0x4df7[_0x728a0d];return _0xc575ed;};'use strict';function mergeDBDataToRealtime(_0x1a3a13,_0x1a2b87){var _0x5dde90=Object['assign']({},_0x1a3a13);for(var _0x146ef9 in _0x1a2b87){if(_0x5dde90[_0x74df('0x0')](_0x146ef9)){_0x5dde90[_0x146ef9]=_0x1a2b87[_0x146ef9];}}return _0x5dde90;}exports[_0x74df('0x1')]=mergeDBDataToRealtime;
\ No newline at end of file
index c242941..8808d40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55fa=['agents','accountcode','name','interface','SIP/%s','length','connectedlinenum','lastAssignedTo','isNil','queuecallercomplete','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','originatecalleridnum','destinationchannel','calleridpreview','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','telephones','prototype','sync','realtime','xdr','disabled','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find'];(function(_0x33b365,_0x11e31e){var _0x38fd59=function(_0x614917){while(--_0x614917){_0x33b365['push'](_0x33b365['shift']());}};_0x38fd59(++_0x11e31e);}(_0x55fa,0x14e));var _0xa55f=function(_0x361cbb,_0x1db2f9){_0x361cbb=_0x361cbb-0x0;var _0x54cde9=_0x55fa[_0x361cbb];return _0x54cde9;};'use strict';var _=require(_0xa55f('0x0'));var moment=require(_0xa55f('0x1'));var util=require(_0xa55f('0x2'));var config=require(_0xa55f('0x3'));var ami=require(_0xa55f('0x4'));var RpcVoiceAgentReport=require(_0xa55f('0x5'));var RpcVoiceCallReport=require(_0xa55f('0x6'));var RpcVoiceDialReport=require(_0xa55f('0x7'));var RpcMemberReport=require(_0xa55f('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xa55f('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa55f('0xa'));var VoiceDialReport=require(_0xa55f('0xb'));var UserReport=require('./userReport');function Report(_0x2f2aa4){this['realtime']=_0x2f2aa4;this['agents']=_0x2f2aa4['agents'];this[_0xa55f('0xc')]=_0x2f2aa4[_0xa55f('0xc')];}Report[_0xa55f('0xd')][_0xa55f('0xe')]=function(_0x31a105){var _0x1c8d5f=new VoiceQueueReport(this[_0xa55f('0xf')]);var _0x4090ad=new VoiceAgentReport(this[_0xa55f('0xf')]);var _0x310672=new VoiceDialReport(this[_0xa55f('0xf')]);var _0x13234e=new VoiceCallReport(this[_0xa55f('0xf')]);var _0x283d08=new UserReport(this['realtime']);if(config['xdr']&&config[_0xa55f('0x10')][_0xa55f('0x11')]){ami['on']('custom:voiceQueueReport',this[_0xa55f('0x12')]['bind'](this));ami['on'](_0xa55f('0x13'),this[_0xa55f('0x14')][_0xa55f('0x15')](this));ami['on'](_0xa55f('0x16'),this[_0xa55f('0x17')][_0xa55f('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xa55f('0x18')][_0xa55f('0x15')](this));ami['on'](_0xa55f('0x19'),this['blindTransfer'][_0xa55f('0x15')](this));ami['on'](_0xa55f('0x1a'),this[_0xa55f('0x1b')][_0xa55f('0x15')](this));}};Report[_0xa55f('0xd')][_0xa55f('0x1c')]=function(_0x531f9a){var _0x21dd8e;_0x21dd8e=_[_0xa55f('0x1d')](this[_0xa55f('0x1e')],function(_0x2c472f){return _0x2c472f[_0xa55f('0x1f')]==_0x531f9a||_0x2c472f[_0xa55f('0x20')]==_0x531f9a;});if(_['isNil'](_0x21dd8e)){var _0x5ca7a3=_['find'](this[_0xa55f('0xc')],function(_0x1b150a){return _0x1b150a['accountcode']==_0x531f9a||_0x1b150a['name']==_0x531f9a;});if(_0x5ca7a3){_0x21dd8e=_[_0xa55f('0x1d')](this[_0xa55f('0x1e')],function(_0x24d876){return _0x24d876[_0xa55f('0x21')]==util['format'](_0xa55f('0x22'),_0x5ca7a3['name']);});}}return _0x21dd8e;};Report['prototype'][_0xa55f('0x12')]=function(_0x722efe){for(var _0x389d12=0x0;_0x389d12<_0x722efe[_0xa55f('0x23')];_0x389d12+=0x1){var _0x4edf6c=this[_0xa55f('0x1c')](_0x722efe[_0x389d12][_0xa55f('0x24')]);if(_0x4edf6c){_0x722efe[_0x389d12][_0xa55f('0x1f')]=_0x4edf6c[_0xa55f('0x1f')];_0x722efe[_0x389d12]['assigned']=!![];_0x722efe[_0x389d12][_0xa55f('0x25')]=_0x4edf6c[_0xa55f('0x20')];_0x722efe[_0x389d12][_0xa55f('0x21')]=_[_0xa55f('0x26')](_0x4edf6c[_0xa55f('0x21')])?util['format'](_0xa55f('0x22'),_0x4edf6c['name']):_0x4edf6c[_0xa55f('0x21')];if(_0x722efe[_0x389d12][_0xa55f('0x27')]){_0x722efe[_0x389d12]['queuecallercompleteAt']=moment()[_0xa55f('0x28')](_0xa55f('0x29'));}if(_0x722efe[_0x389d12][_0xa55f('0x2a')]){_0x722efe[_0x389d12][_0xa55f('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x722efe[_0x389d12]);}RpcVoiceQueueReport[_0xa55f('0x2c')](_0x722efe[_0x389d12]);}};function extractCalleridNumber(_0x2d7148){var _0x503872=_0x2d7148['match'](/<(.*?)>/);return _0x503872?_0x503872[0x1]:_0x2d7148;}Report[_0xa55f('0xd')][_0xa55f('0x2d')]=function(_0x2738a0){for(var _0x3dcb46=0x0;_0x3dcb46<Object['keys'](this['agents'])[_0xa55f('0x23')];_0x3dcb46++){var _0x38bfaa=Object[_0xa55f('0x2e')](this[_0xa55f('0x1e')])[_0x3dcb46];var _0x41c78f=this[_0xa55f('0x1e')][_0x38bfaa];if(_0x41c78f[_0xa55f('0x1f')]===Number(_0x2738a0))return _0x41c78f;}return null;};Report[_0xa55f('0xd')][_0xa55f('0x2f')]=function(_0x32c9c2){var _0x3c4b04=_0x32c9c2[_0xa55f('0x30')][_0xa55f('0x31')]('-')[0x0];var _0x441cc5=this[_0xa55f('0x1e')][_0x3c4b04];if(!_0x441cc5)_0x441cc5=this['getAgentByInternal'](_0x32c9c2[_0xa55f('0x32')]);return!_0x441cc5?_0xa55f('0x33'):'internal';};Report[_0xa55f('0xd')][_0xa55f('0x14')]=function(_0x9ed718){_0x9ed718[_0xa55f('0x34')]=_0x9ed718['destination']||_0x9ed718[_0xa55f('0x35')];if(_0x9ed718[_0xa55f('0x36')]==_0xa55f('0x37')){_0x9ed718[_0xa55f('0x38')]=_0xa55f('0x39');_0x9ed718[_0xa55f('0x3a')]=_0x9ed718[_0xa55f('0x39')];if(_0x9ed718[_0xa55f('0x3b')]==_0xa55f('0x3c')){_0x9ed718[_0xa55f('0x1f')]='';_0x9ed718['destination']=extractCalleridNumber(_0x9ed718[_0xa55f('0x3d')]);}else if(_0x9ed718[_0xa55f('0x3b')]==_0xa55f('0x3e')){if(_0x9ed718[_0xa55f('0x34')]=='xcally-motion-preview'){_0x9ed718['destination']=extractCalleridNumber(_0x9ed718['calleridpreview']);_0x9ed718[_0xa55f('0x32')]=_0x9ed718[_0xa55f('0x3f')];_0x9ed718[_0xa55f('0x40')]=[_0x9ed718[_0xa55f('0x30')],_0x9ed718[_0xa55f('0x30')]=_0x9ed718[_0xa55f('0x40')]][0x0];_0x9ed718[_0xa55f('0x3d')]=_0x9ed718[_0xa55f('0x41')];}else{_0x9ed718[_0xa55f('0x34')]=_0x9ed718[_0xa55f('0x32')];_0x9ed718[_0xa55f('0x32')]=_0x9ed718[_0xa55f('0x3f')];if(_0x9ed718['disposition']==_0xa55f('0x42')){_0x9ed718[_0xa55f('0x1f')]=_0x9ed718[_0xa55f('0x24')];}else{_0x9ed718[_0xa55f('0x1f')]='';}}}}else{_0x9ed718['callerid']=util[_0xa55f('0x28')](_0xa55f('0x43'),_0x9ed718[_0xa55f('0x44')],_0x9ed718[_0xa55f('0x32')]);}if(RpcVoiceTransferReport[_0xa55f('0x45')][_0x9ed718[_0xa55f('0x46')]]){var _0x1db0b8=RpcVoiceTransferReport[_0xa55f('0x45')][_0x9ed718[_0xa55f('0x46')]];_0x1db0b8[_0xa55f('0x47')]=_0x9ed718[_0xa55f('0x48')];RpcVoiceTransferReport[_0xa55f('0x49')](_0x1db0b8);delete RpcVoiceTransferReport[_0xa55f('0x45')][_0x9ed718[_0xa55f('0x46')]];}if(_[_0xa55f('0x26')](_0x9ed718[_0xa55f('0x36')])){_0x9ed718['type']=this[_0xa55f('0x2f')](_0x9ed718);}if(_[_0xa55f('0x26')](_0x9ed718[_0xa55f('0x4a')])){var _0xad599d=_0x9ed718[_0xa55f('0x30')]['split']('-')[0x0];var _0x2453d1=this[_0xa55f('0x1e')][_0xad599d];if(!_0x2453d1)_0x2453d1=this['getAgentByInternal'](_0x9ed718[_0xa55f('0x1f')]);if(_0x2453d1){_0x9ed718[_0xa55f('0x4a')]=_0x2453d1['id'];_0x9ed718[_0xa55f('0x4b')]=_0x2453d1[_0xa55f('0x20')];}}RpcVoiceCallReport[_0xa55f('0x2c')](_0x9ed718);if(_0x9ed718[_0xa55f('0x4c')]){for(var _0x1c82ba=0x0;_0x1c82ba<_0x9ed718[_0xa55f('0x4d')]['length'];_0x1c82ba+=0x1){_0x9ed718['monitorFilename']=_0x9ed718['monitors'][_0x1c82ba]['filename'];_0x9ed718[_0xa55f('0x4e')]=_0x9ed718[_0xa55f('0x4d')][_0x1c82ba][_0xa55f('0x4e')];if(_0x9ed718[_0xa55f('0x35')]==_0xa55f('0x4f')){_0x9ed718[_0xa55f('0x32')]=_0x9ed718[_0xa55f('0x24')];_0x9ed718[_0xa55f('0x44')]=_0x9ed718[_0xa55f('0x50')];_0x9ed718['connectedlinenum']=_0x9ed718['accountcode'];_0x9ed718['connectedlinename']=_0x9ed718[_0xa55f('0x4b')];_0x9ed718[_0xa55f('0x35')]=_0x9ed718['originatecalleridnum'];}else if(_0x9ed718['exten']==_0xa55f('0x51')){_0x9ed718['calleridnum']=_0x9ed718[_0xa55f('0x34')];_0x9ed718[_0xa55f('0x35')]=_0x9ed718[_0xa55f('0x3f')];}RpcVoiceRecording[_0xa55f('0x2c')](_0x9ed718);}}};Report[_0xa55f('0xd')][_0xa55f('0x17')]=function(_0x1c2648){if(_[_0xa55f('0x52')](_0x1c2648)){_0x1c2648[_0xa55f('0x53')](function(_0x3651ad){RpcVoiceAgentReport['create'](_0x3651ad);});}else{RpcVoiceAgentReport[_0xa55f('0x2c')](_0x1c2648);}};Report['prototype'][_0xa55f('0x18')]=function(_0x34d93a){RpcVoiceDialReport[_0xa55f('0x2c')](_0x34d93a);var _0x204bf5;var _0x1b3f25;var _0xb2c2af=_0x34d93a['channel'];if(_[_0xa55f('0x54')](_0xb2c2af,_0xa55f('0x55'))){_0x1b3f25=_0xb2c2af[_0xa55f('0x56')](_0xb2c2af[_0xa55f('0x57')]('/')+0x1,_0xb2c2af[_0xa55f('0x57')]('@'));_0x204bf5=_[_0xa55f('0x1d')](this[_0xa55f('0x1e')],function(_0x5ebd11){return _0x5ebd11[_0xa55f('0x58')]==_0x1b3f25||_0x5ebd11['phone']==_0x1b3f25||_0x5ebd11['accountcode']==_0x1b3f25;});}else{_0x1b3f25=_0xb2c2af[_0xa55f('0x56')](_0xb2c2af[_0xa55f('0x57')]('/')+0x1,_0xb2c2af[_0xa55f('0x59')]('-'));_0x204bf5=this[_0xa55f('0x1c')](_0x1b3f25);}if(_0x204bf5){_0x34d93a[_0xa55f('0x21')]=_[_0xa55f('0x26')](_0x204bf5[_0xa55f('0x21')])?util[_0xa55f('0x28')](_0xa55f('0x22'),_0x204bf5[_0xa55f('0x20')]):_0x204bf5[_0xa55f('0x21')];_0x34d93a[_0xa55f('0x4b')]=_0x204bf5[_0xa55f('0x20')];_0x34d93a['accountcode']=_0x204bf5[_0xa55f('0x1f')];RpcMemberReport[_0xa55f('0x18')](_0x34d93a);}};Report[_0xa55f('0xd')][_0xa55f('0x49')]=function(_0x1e6891){RpcVoiceTransferReport[_0xa55f('0x45')][_0x1e6891[_0xa55f('0x5a')]]=_0x1e6891;};Report[_0xa55f('0xd')][_0xa55f('0x1b')]=function(_0x2441ea){RpcVoiceTransferReport[_0xa55f('0x1b')](_0x2441ea);};module['exports']=Report;
\ No newline at end of file
+var _0x977d=['queuecallerexit','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','internal','destination','exten','type','dialer','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','monitor','monitors','monitorFilename','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','lodash','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','name','isNil','find','accountcode','SIP/%s','prototype','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercompleteAt','format'];(function(_0x4c0340,_0x38c201){var _0x4adfaf=function(_0x445ed7){while(--_0x445ed7){_0x4c0340['push'](_0x4c0340['shift']());}};_0x4adfaf(++_0x38c201);}(_0x977d,0x8b));var _0xd977=function(_0x1e40b9,_0x4108b1){_0x1e40b9=_0x1e40b9-0x0;var _0x5c03cc=_0x977d[_0x1e40b9];return _0x5c03cc;};'use strict';var _=require(_0xd977('0x0'));var moment=require('moment');var util=require(_0xd977('0x1'));var config=require(_0xd977('0x2'));var ami=require(_0xd977('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xd977('0x4'));var RpcVoiceDialReport=require(_0xd977('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xd977('0x6'));var RpcVoiceTransferReport=require(_0xd977('0x7'));var VoiceQueueReport=require(_0xd977('0x8'));var VoiceCallReport=require(_0xd977('0x9'));var VoiceAgentReport=require(_0xd977('0xa'));var VoiceDialReport=require(_0xd977('0xb'));var UserReport=require(_0xd977('0xc'));function Report(_0x12830d){this['realtime']=_0x12830d;this[_0xd977('0xd')]=_0x12830d['agents'];this['telephones']=_0x12830d['telephones'];}Report['prototype'][_0xd977('0xe')]=function(_0x12ff9d){var _0x456c83=new VoiceQueueReport(this[_0xd977('0xf')]);var _0x5b722b=new VoiceAgentReport(this['realtime']);var _0x5c338c=new VoiceDialReport(this['realtime']);var _0x1882a7=new VoiceCallReport(this['realtime']);var _0x516f2a=new UserReport(this[_0xd977('0xf')]);if(config[_0xd977('0x10')]&&config['xdr'][_0xd977('0x11')]){ami['on'](_0xd977('0x12'),this[_0xd977('0x13')]['bind'](this));ami['on'](_0xd977('0x14'),this[_0xd977('0x15')][_0xd977('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0xd977('0x17')][_0xd977('0x16')](this));ami['on'](_0xd977('0x18'),this[_0xd977('0x19')][_0xd977('0x16')](this));ami['on'](_0xd977('0x1a'),this[_0xd977('0x1b')][_0xd977('0x16')](this));ami['on']('attendedtransfer',this[_0xd977('0x1c')]['bind'](this));}};Report['prototype'][_0xd977('0x1d')]=function(_0x1675aa){var _0x340365;_0x340365=_['find'](this[_0xd977('0xd')],function(_0x21cf21){return _0x21cf21['accountcode']==_0x1675aa||_0x21cf21[_0xd977('0x1e')]==_0x1675aa;});if(_[_0xd977('0x1f')](_0x340365)){var _0x515260=_[_0xd977('0x20')](this['telephones'],function(_0x12c4ca){return _0x12c4ca[_0xd977('0x21')]==_0x1675aa||_0x12c4ca['name']==_0x1675aa;});if(_0x515260){_0x340365=_[_0xd977('0x20')](this['agents'],function(_0x4f2b53){return _0x4f2b53['interface']==util['format'](_0xd977('0x22'),_0x515260['name']);});}}return _0x340365;};Report[_0xd977('0x23')][_0xd977('0x13')]=function(_0x15e483){for(var _0x57a4ff=0x0;_0x57a4ff<_0x15e483[_0xd977('0x24')];_0x57a4ff+=0x1){var _0x25560d=this['findAgent'](_0x15e483[_0x57a4ff][_0xd977('0x25')]);if(_0x25560d){_0x15e483[_0x57a4ff][_0xd977('0x21')]=_0x25560d['accountcode'];_0x15e483[_0x57a4ff][_0xd977('0x26')]=!![];_0x15e483[_0x57a4ff][_0xd977('0x27')]=_0x25560d['name'];_0x15e483[_0x57a4ff][_0xd977('0x28')]=_[_0xd977('0x1f')](_0x25560d['interface'])?util['format']('SIP/%s',_0x25560d[_0xd977('0x1e')]):_0x25560d[_0xd977('0x28')];if(_0x15e483[_0x57a4ff]['queuecallercomplete']){_0x15e483[_0x57a4ff][_0xd977('0x29')]=moment()[_0xd977('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x15e483[_0x57a4ff][_0xd977('0x2b')]){_0x15e483[_0x57a4ff]['queuecallerexitAt']=moment()[_0xd977('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x15e483[_0x57a4ff]);}RpcVoiceQueueReport[_0xd977('0x2c')](_0x15e483[_0x57a4ff]);}};function extractCalleridNumber(_0x19859d){var _0x5125af=_0x19859d[_0xd977('0x2d')](/<(.*?)>/);return _0x5125af?_0x5125af[0x1]:_0x19859d;}Report[_0xd977('0x23')][_0xd977('0x2e')]=function(_0x29abbf){for(var _0x2ccf56=0x0;_0x2ccf56<Object[_0xd977('0x2f')](this['agents'])[_0xd977('0x24')];_0x2ccf56++){var _0x6aeff7=Object[_0xd977('0x2f')](this[_0xd977('0xd')])[_0x2ccf56];var _0x214f38=this[_0xd977('0xd')][_0x6aeff7];if(_0x214f38['accountcode']===Number(_0x29abbf))return _0x214f38;}return null;};Report[_0xd977('0x23')][_0xd977('0x30')]=function(_0xeab323){var _0x5d40f7=_0xeab323[_0xd977('0x31')]['split']('-')[0x0];var _0x7713d4=this[_0xd977('0xd')][_0x5d40f7];if(!_0x7713d4)_0x7713d4=this['getAgentByInternal'](_0xeab323[_0xd977('0x32')]);return!_0x7713d4?_0xd977('0x33'):_0xd977('0x34');};Report[_0xd977('0x23')][_0xd977('0x15')]=function(_0x4330a5){_0x4330a5[_0xd977('0x35')]=_0x4330a5[_0xd977('0x35')]||_0x4330a5[_0xd977('0x36')];if(_0x4330a5[_0xd977('0x37')]==_0xd977('0x38')){_0x4330a5['lastapplication']=_0xd977('0x39');_0x4330a5[_0xd977('0x3a')]=_0x4330a5[_0xd977('0x39')];if(_0x4330a5[_0xd977('0x3b')]=='from-voip-provider'){_0x4330a5['accountcode']='';_0x4330a5[_0xd977('0x35')]=extractCalleridNumber(_0x4330a5[_0xd977('0x3c')]);}else if(_0x4330a5[_0xd977('0x3b')]==_0xd977('0x3d')){if(_0x4330a5[_0xd977('0x35')]==_0xd977('0x3e')){_0x4330a5[_0xd977('0x35')]=extractCalleridNumber(_0x4330a5['calleridpreview']);_0x4330a5['calleridnum']=_0x4330a5[_0xd977('0x3f')];_0x4330a5[_0xd977('0x40')]=[_0x4330a5[_0xd977('0x31')],_0x4330a5[_0xd977('0x31')]=_0x4330a5[_0xd977('0x40')]][0x0];_0x4330a5[_0xd977('0x3c')]=_0x4330a5[_0xd977('0x41')];}else{_0x4330a5[_0xd977('0x35')]=_0x4330a5['calleridnum'];_0x4330a5[_0xd977('0x32')]=_0x4330a5[_0xd977('0x3f')];if(_0x4330a5[_0xd977('0x42')]==_0xd977('0x43')){_0x4330a5[_0xd977('0x21')]=_0x4330a5[_0xd977('0x25')];}else{_0x4330a5[_0xd977('0x21')]='';}}}}else{_0x4330a5['callerid']=util[_0xd977('0x2a')](_0xd977('0x44'),_0x4330a5[_0xd977('0x45')],_0x4330a5['calleridnum']);}if(RpcVoiceTransferReport[_0xd977('0x46')][_0x4330a5['linkedid']]){var _0x571c00=RpcVoiceTransferReport['transfers'][_0x4330a5[_0xd977('0x47')]];_0x571c00[_0xd977('0x48')]=_0x4330a5[_0xd977('0x49')];RpcVoiceTransferReport[_0xd977('0x1b')](_0x571c00);delete RpcVoiceTransferReport[_0xd977('0x46')][_0x4330a5[_0xd977('0x47')]];}if(_['isNil'](_0x4330a5[_0xd977('0x37')])){_0x4330a5['type']=this[_0xd977('0x30')](_0x4330a5);}if(_['isNil'](_0x4330a5[_0xd977('0x4a')])){var _0x39b3e8=_0x4330a5[_0xd977('0x31')][_0xd977('0x4b')]('-')[0x0];var _0x562f4c=this[_0xd977('0xd')][_0x39b3e8];if(!_0x562f4c)_0x562f4c=this[_0xd977('0x2e')](_0x4330a5[_0xd977('0x21')]);if(_0x562f4c){_0x4330a5[_0xd977('0x4a')]=_0x562f4c['id'];_0x4330a5['membername']=_0x562f4c[_0xd977('0x1e')];}}RpcVoiceCallReport[_0xd977('0x2c')](_0x4330a5);if(_0x4330a5[_0xd977('0x4c')]){for(var _0x2a24c7=0x0;_0x2a24c7<_0x4330a5[_0xd977('0x4d')]['length'];_0x2a24c7+=0x1){_0x4330a5[_0xd977('0x4e')]=_0x4330a5[_0xd977('0x4d')][_0x2a24c7]['filename'];_0x4330a5['createdAt']=_0x4330a5[_0xd977('0x4d')][_0x2a24c7]['createdAt'];if(_0x4330a5[_0xd977('0x36')]==_0xd977('0x3e')){_0x4330a5[_0xd977('0x32')]=_0x4330a5[_0xd977('0x25')];_0x4330a5[_0xd977('0x45')]=_0x4330a5[_0xd977('0x4f')];_0x4330a5['connectedlinenum']=_0x4330a5[_0xd977('0x21')];_0x4330a5['connectedlinename']=_0x4330a5[_0xd977('0x50')];_0x4330a5[_0xd977('0x36')]=_0x4330a5['originatecalleridnum'];}else if(_0x4330a5[_0xd977('0x36')]==_0xd977('0x51')){_0x4330a5['calleridnum']=_0x4330a5[_0xd977('0x35')];_0x4330a5[_0xd977('0x36')]=_0x4330a5[_0xd977('0x3f')];}RpcVoiceRecording[_0xd977('0x2c')](_0x4330a5);}}};Report['prototype'][_0xd977('0x17')]=function(_0xf7c6ed){if(_[_0xd977('0x52')](_0xf7c6ed)){_0xf7c6ed[_0xd977('0x53')](function(_0x4500f8){RpcVoiceAgentReport[_0xd977('0x2c')](_0x4500f8);});}else{RpcVoiceAgentReport[_0xd977('0x2c')](_0xf7c6ed);}};Report[_0xd977('0x23')]['voiceDialReport']=function(_0x2594bd){RpcVoiceDialReport['create'](_0x2594bd);var _0x5bf137;var _0x3a9c7f;var _0x223c0b=_0x2594bd[_0xd977('0x31')];if(_[_0xd977('0x54')](_0x223c0b,_0xd977('0x55'))){_0x3a9c7f=_0x223c0b[_0xd977('0x56')](_0x223c0b[_0xd977('0x57')]('/')+0x1,_0x223c0b[_0xd977('0x57')]('@'));_0x5bf137=_['find'](this[_0xd977('0xd')],function(_0x17d33c){return _0x17d33c[_0xd977('0x58')]==_0x3a9c7f||_0x17d33c['phone']==_0x3a9c7f||_0x17d33c[_0xd977('0x21')]==_0x3a9c7f;});}else{_0x3a9c7f=_0x223c0b[_0xd977('0x56')](_0x223c0b['indexOf']('/')+0x1,_0x223c0b[_0xd977('0x59')]('-'));_0x5bf137=this[_0xd977('0x1d')](_0x3a9c7f);}if(_0x5bf137){_0x2594bd['interface']=_[_0xd977('0x1f')](_0x5bf137[_0xd977('0x28')])?util['format']('SIP/%s',_0x5bf137[_0xd977('0x1e')]):_0x5bf137['interface'];_0x2594bd[_0xd977('0x50')]=_0x5bf137[_0xd977('0x1e')];_0x2594bd[_0xd977('0x21')]=_0x5bf137[_0xd977('0x21')];RpcMemberReport[_0xd977('0x19')](_0x2594bd);}};Report[_0xd977('0x23')][_0xd977('0x1b')]=function(_0x1b10a7){RpcVoiceTransferReport[_0xd977('0x46')][_0x1b10a7[_0xd977('0x5a')]]=_0x1b10a7;};Report['prototype'][_0xd977('0x1c')]=function(_0x57f0ba){RpcVoiceTransferReport[_0xd977('0x1c')](_0x57f0ba);};module['exports']=Report;
\ No newline at end of file
index d341165..db9bae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd971=['[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','find','stateRegistry','state','merge','omit','event','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][registry]','device','local','toLowerCase','stateTime','updateStatusRealtime','toNumber','telephone:%s','name','telephone:save','startsWith','Local','substring','indexOf','mobile','phone','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','bind','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','resolve','[userReport][devicestatelist]','actionSipPeerStatus'];(function(_0x454a8e,_0x40b82c){var _0x3b9fcb=function(_0x28ea40){while(--_0x28ea40){_0x454a8e['push'](_0x454a8e['shift']());}};_0x3b9fcb(++_0x40b82c);}(_0xd971,0x1e2));var _0x1d97=function(_0x28d231,_0x55888a){_0x28d231=_0x28d231-0x0;var _0x3814c5=_0xd971[_0x28d231];return _0x3814c5;};'use strict';var _=require('lodash');var moment=require(_0x1d97('0x0'));var util=require(_0x1d97('0x1'));var Redis=require('ioredis');var BPromise=require(_0x1d97('0x2'));var config=require(_0x1d97('0x3'));var logger=require(_0x1d97('0x4'))(_0x1d97('0x5'));var ami=require(_0x1d97('0x6'));config[_0x1d97('0x7')]=_[_0x1d97('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1d97('0x9'))(new Redis(config['redis']));function UserReport(_0x3e2470){this[_0x1d97('0xa')]=_0x3e2470[_0x1d97('0xa')];this[_0x1d97('0xb')]=_0x3e2470[_0x1d97('0xb')];this['telephones']=_0x3e2470[_0x1d97('0xc')];ami['on'](_0x1d97('0xd'),this['syncRegistry'][_0x1d97('0xe')](this));ami['on']('registry',this[_0x1d97('0xf')][_0x1d97('0xe')](this));ami['on'](_0x1d97('0x10'),this[_0x1d97('0x11')]['bind'](this));ami['on'](_0x1d97('0x12'),this['syncPeerStatus'][_0x1d97('0xe')](this));return this[_0x1d97('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0x1d97('0x14')](ami[_0x1d97('0x15')]())[_0x1d97('0x16')](function(_0x338a91){logger[_0x1d97('0x17')](_0x1d97('0x18'),util[_0x1d97('0x19')](_0x338a91,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x1d97('0x1a')]()[_0x1d97('0x14')](ami['actionDeviceStateList']())[_0x1d97('0x16')](function(_0x527b5b){logger[_0x1d97('0x17')](_0x1d97('0x1b'),util[_0x1d97('0x19')](_0x527b5b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x1d97('0x1a')]()[_0x1d97('0x14')](ami[_0x1d97('0x1c')]())[_0x1d97('0x16')](function(_0x20531c){logger[_0x1d97('0x17')](_0x1d97('0x1d'),util['inspect'](_0x20531c,{'showHidden':![],'depth':null}));});}UserReport[_0x1d97('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x1d97('0x1a')]()[_0x1d97('0x14')](showSipRegistrations())[_0x1d97('0x14')](listDeviceStates())[_0x1d97('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x1d97('0x1e')][_0x1d97('0x1f')]=function(_0x9037e2){return _0x9037e2!==null&&!_[_0x1d97('0x20')](_0x9037e2);};UserReport[_0x1d97('0x1e')][_0x1d97('0x21')]=function(_0x264c1c,_0x1296d9,_0x3550df){io['to'](_0x264c1c)[_0x1d97('0x21')](_0x1296d9,_0x3550df);};UserReport[_0x1d97('0x1e')][_0x1d97('0xf')]=function(_0xbe1f76){try{if(this[_0x1d97('0x1f')](_0xbe1f76)){logger[_0x1d97('0x22')](_0x1d97('0x23'),_0xbe1f76[_0x1d97('0x24')],_0xbe1f76['state']);logger['debug']('[userReport][registry]',util[_0x1d97('0x19')](_0xbe1f76,{'showHidden':![],'depth':null}));var _0x2611bd=_[_0x1d97('0x25')](this[_0x1d97('0xa')],{'defaultuser':_0xbe1f76[_0x1d97('0x24')]});if(_0x2611bd){_0xbe1f76[_0x1d97('0x26')]=_0xbe1f76[_0x1d97('0x27')];_[_0x1d97('0x28')](_0x2611bd,_[_0x1d97('0x29')](_0xbe1f76,[_0x1d97('0x2a'),'actionid',_0x1d97('0x24'),_0x1d97('0x27')]));logger[_0x1d97('0x2b')](_0x1d97('0x2c'),util['inspect'](_0x2611bd,{'showHidden':![],'depth':null}));this[_0x1d97('0x21')](util[_0x1d97('0x2d')](_0x1d97('0x2e'),_0x2611bd['name']),_0x1d97('0x2f'),_0x2611bd);}}}catch(_0x5e1b71){logger['error'](_0x1d97('0x30'),util[_0x1d97('0x19')](_0x5e1b71,{'showHidden':![],'depth':null}));}};UserReport[_0x1d97('0x1e')][_0x1d97('0x11')]=function(_0x41d8dd){try{if(this[_0x1d97('0x1f')](_0x41d8dd)){logger[_0x1d97('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x41d8dd[_0x1d97('0x31')],_0x41d8dd[_0x1d97('0x27')]);logger[_0x1d97('0x2b')]('[userReport][devicestatechange]',util['inspect'](_0x41d8dd,{'showHidden':![],'depth':null}));if(this[_0x1d97('0xb')][_0x41d8dd[_0x1d97('0x31')]]){if(!this[_0x1d97('0xb')][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x32')]||_0x41d8dd[_0x1d97('0x27')]['toLowerCase']()=='inuse'){this[_0x1d97('0xb')][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x32')]=![];if(this['agents'][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x27')]!==_0x41d8dd[_0x1d97('0x27')][_0x1d97('0x33')]()){this['agents'][_0x41d8dd['device']][_0x1d97('0x34')]=_['toNumber'](moment()[_0x1d97('0x2d')]('x'));}this[_0x1d97('0xb')][_0x41d8dd[_0x1d97('0x31')]]['state']=_0x41d8dd[_0x1d97('0x27')]['toLowerCase']();this[_0x1d97('0xb')][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x35')](_0x41d8dd);}}else if(this[_0x1d97('0xc')][_0x41d8dd['device']]){if(this[_0x1d97('0xc')][_0x41d8dd['device']][_0x1d97('0x27')]!==_0x41d8dd[_0x1d97('0x27')][_0x1d97('0x33')]()){this[_0x1d97('0xc')][_0x41d8dd['device']][_0x1d97('0x34')]=_[_0x1d97('0x36')](moment()[_0x1d97('0x2d')]('x'));}this[_0x1d97('0xc')][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x27')]=_0x41d8dd[_0x1d97('0x27')]['toLowerCase']();logger[_0x1d97('0x2b')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x1d97('0x19')](this['telephones'][_0x41d8dd['device']],{'showHidden':![],'depth':null}));this[_0x1d97('0x21')](util[_0x1d97('0x2d')](_0x1d97('0x37'),this['telephones'][_0x41d8dd['device']][_0x1d97('0x38')]),_0x1d97('0x39'),this[_0x1d97('0xc')][_0x41d8dd[_0x1d97('0x31')]]);}else if(this['trunks'][_0x41d8dd[_0x1d97('0x31')]]){if(this['trunks'][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x27')]!==_0x41d8dd[_0x1d97('0x27')][_0x1d97('0x33')]()){this[_0x1d97('0xa')][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x34')]=_[_0x1d97('0x36')](moment()['format']('x'));}this[_0x1d97('0xa')][_0x41d8dd[_0x1d97('0x31')]]['state']=_0x41d8dd[_0x1d97('0x27')][_0x1d97('0x33')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x41d8dd[_0x1d97('0x31')]],{'showHidden':![],'depth':null}));this[_0x1d97('0x21')](util[_0x1d97('0x2d')](_0x1d97('0x2e'),this[_0x1d97('0xa')][_0x41d8dd[_0x1d97('0x31')]][_0x1d97('0x38')]),_0x1d97('0x2f'),this[_0x1d97('0xa')][_0x41d8dd[_0x1d97('0x31')]]);}else if(_[_0x1d97('0x3a')](_0x41d8dd[_0x1d97('0x31')],_0x1d97('0x3b'))){var _0x105937=_0x41d8dd[_0x1d97('0x31')];var _0x32cbe8=_0x105937[_0x1d97('0x3c')](_0x105937[_0x1d97('0x3d')]('/')+0x1,_0x105937[_0x1d97('0x3d')]('@'));var _0x298f2d=_[_0x1d97('0x25')](this[_0x1d97('0xb')],function(_0x57342f){return _0x57342f[_0x1d97('0x3e')]==_0x32cbe8||_0x57342f[_0x1d97('0x3f')]==_0x32cbe8||_0x57342f['accountcode']==_0x32cbe8;});if(_0x298f2d){if(_0x298f2d[_0x1d97('0x27')]!==_0x41d8dd[_0x1d97('0x27')]['toLowerCase']()){_0x298f2d[_0x1d97('0x34')]=_[_0x1d97('0x36')](moment()[_0x1d97('0x2d')]('x'));}_0x298f2d['state']=_0x41d8dd[_0x1d97('0x27')][_0x1d97('0x33')]();_0x298f2d[_0x1d97('0x32')]=!![];_0x298f2d[_0x1d97('0x35')](_0x41d8dd);}}}}catch(_0x496eb5){logger[_0x1d97('0x17')]('[userReport][devicestatechange]',util['inspect'](_0x496eb5,{'showHidden':![],'depth':null}));}};UserReport[_0x1d97('0x1e')][_0x1d97('0x40')]=function(_0x574b5c){try{if(this[_0x1d97('0x1f')](_0x574b5c)&&this[_0x1d97('0x1f')](_0x574b5c[_0x1d97('0x12')])){logger[_0x1d97('0x22')](_0x1d97('0x41'),_0x574b5c[_0x1d97('0x42')],_0x574b5c[_0x1d97('0x43')],_0x574b5c[_0x1d97('0x12')]);logger[_0x1d97('0x2b')](_0x1d97('0x44'),util[_0x1d97('0x19')](_0x574b5c,{'showHidden':![],'depth':null}));if(this[_0x1d97('0xb')][_0x574b5c[_0x1d97('0x42')]]){if(!this[_0x1d97('0xb')][_0x574b5c[_0x1d97('0x42')]]['local']||_0x574b5c[_0x1d97('0x12')][_0x1d97('0x33')]()=='registered'){this['agents'][_0x574b5c['peer']][_0x1d97('0x32')]=![];this[_0x1d97('0xb')][_0x574b5c[_0x1d97('0x42')]][_0x1d97('0x45')]=_0x574b5c[_0x1d97('0x12')][_0x1d97('0x33')]();this[_0x1d97('0xb')][_0x574b5c[_0x1d97('0x42')]][_0x1d97('0x43')]=_0x574b5c[_0x1d97('0x43')];this[_0x1d97('0xb')][_0x574b5c[_0x1d97('0x42')]]['updateStatusRealtime'](_0x574b5c);}}else if(this['telephones'][_0x574b5c[_0x1d97('0x42')]]){this[_0x1d97('0xc')][_0x574b5c['peer']][_0x1d97('0x45')]=_0x574b5c[_0x1d97('0x12')]['toLowerCase']();this[_0x1d97('0xc')][_0x574b5c['peer']][_0x1d97('0x43')]=_0x574b5c[_0x1d97('0x43')];logger[_0x1d97('0x2b')](_0x1d97('0x46'),util[_0x1d97('0x19')](this[_0x1d97('0xc')][_0x574b5c['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x1d97('0x2d')](_0x1d97('0x37'),this[_0x1d97('0xc')][_0x574b5c['peer']][_0x1d97('0x38')]),_0x1d97('0x39'),this[_0x1d97('0xc')][_0x574b5c[_0x1d97('0x42')]]);}else if(this[_0x1d97('0xa')][_0x574b5c['peer']]){this[_0x1d97('0xa')][_0x574b5c[_0x1d97('0x42')]][_0x1d97('0x45')]=_0x574b5c[_0x1d97('0x12')][_0x1d97('0x33')]();this[_0x1d97('0xa')][_0x574b5c[_0x1d97('0x42')]][_0x1d97('0x43')]=_0x574b5c['address'];logger[_0x1d97('0x2b')](_0x1d97('0x47'),util[_0x1d97('0x19')](this[_0x1d97('0xa')][_0x574b5c[_0x1d97('0x42')]],{'showHidden':![],'depth':null}));this[_0x1d97('0x21')](util[_0x1d97('0x2d')](_0x1d97('0x2e'),this[_0x1d97('0xa')][_0x574b5c[_0x1d97('0x42')]]['name']),'trunk:save',this['trunks'][_0x574b5c[_0x1d97('0x42')]]);}}}catch(_0x4dda51){logger[_0x1d97('0x17')](_0x1d97('0x44'),util['inspect'](_0x4dda51,{'showHidden':![],'depth':null}));}};module[_0x1d97('0x48')]=UserReport;
\ No newline at end of file
+var _0x6b14=['[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','resolve','isNotNull','isUndefined','emit','info','username','state','[userReport][registry]','find','stateRegistry','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','telephone:save','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','syncRealtimeShow','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','then','catch'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6b14,0xcd));var _0x46b1=function(_0x49bae3,_0x20159e){_0x49bae3=_0x49bae3-0x0;var _0x408bf8=_0x6b14[_0x49bae3];return _0x408bf8;};'use strict';var _=require(_0x46b1('0x0'));var moment=require(_0x46b1('0x1'));var util=require('util');var Redis=require(_0x46b1('0x2'));var BPromise=require(_0x46b1('0x3'));var config=require(_0x46b1('0x4'));var logger=require(_0x46b1('0x5'))(_0x46b1('0x6'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x46b1('0x7')],{'host':_0x46b1('0x8'),'port':0x18eb});var io=require(_0x46b1('0x9'))(new Redis(config[_0x46b1('0x7')]));function UserReport(_0x479ed1){this[_0x46b1('0xa')]=_0x479ed1[_0x46b1('0xa')];this[_0x46b1('0xb')]=_0x479ed1['agents'];this[_0x46b1('0xc')]=_0x479ed1[_0x46b1('0xc')];ami['on'](_0x46b1('0xd'),this[_0x46b1('0xe')]['bind'](this));ami['on'](_0x46b1('0xf'),this[_0x46b1('0xe')][_0x46b1('0x10')](this));ami['on'](_0x46b1('0x11'),this[_0x46b1('0x12')][_0x46b1('0x10')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));return this[_0x46b1('0x13')]();}function showSipRegistrations(){Promise['resolve']()['then'](ami[_0x46b1('0x14')]())['catch'](function(_0x283c1e){logger[_0x46b1('0x15')](_0x46b1('0x16'),util[_0x46b1('0x17')](_0x283c1e,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x46b1('0x18')](ami['actionDeviceStateList']())[_0x46b1('0x19')](function(_0x26233f){logger[_0x46b1('0x15')](_0x46b1('0x1a'),util[_0x46b1('0x17')](_0x26233f,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()['then'](ami[_0x46b1('0x1b')]())[_0x46b1('0x19')](function(_0x2ae9c1){logger['error'](_0x46b1('0x1c'),util[_0x46b1('0x17')](_0x2ae9c1,{'showHidden':![],'depth':null}));});}UserReport[_0x46b1('0x1d')][_0x46b1('0x13')]=function(){setInterval(function(){BPromise[_0x46b1('0x1e')]()[_0x46b1('0x18')](showSipRegistrations())['then'](listDeviceStates())[_0x46b1('0x18')](showPeersStatus());},0x32c8);};UserReport[_0x46b1('0x1d')][_0x46b1('0x1f')]=function(_0x4f7912){return _0x4f7912!==null&&!_[_0x46b1('0x20')](_0x4f7912);};UserReport[_0x46b1('0x1d')][_0x46b1('0x21')]=function(_0x271262,_0x27121b,_0x1c6f68){io['to'](_0x271262)[_0x46b1('0x21')](_0x27121b,_0x1c6f68);};UserReport[_0x46b1('0x1d')]['syncRegistry']=function(_0x5bf705){try{if(this[_0x46b1('0x1f')](_0x5bf705)){logger[_0x46b1('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5bf705[_0x46b1('0x23')],_0x5bf705[_0x46b1('0x24')]);logger['debug'](_0x46b1('0x25'),util[_0x46b1('0x17')](_0x5bf705,{'showHidden':![],'depth':null}));var _0xa31ab8=_[_0x46b1('0x26')](this[_0x46b1('0xa')],{'defaultuser':_0x5bf705[_0x46b1('0x23')]});if(_0xa31ab8){_0x5bf705[_0x46b1('0x27')]=_0x5bf705['state'];_['merge'](_0xa31ab8,_[_0x46b1('0x28')](_0x5bf705,[_0x46b1('0x29'),_0x46b1('0x2a'),'username',_0x46b1('0x24')]));logger[_0x46b1('0x2b')](_0x46b1('0x2c'),util[_0x46b1('0x17')](_0xa31ab8,{'showHidden':![],'depth':null}));this[_0x46b1('0x21')](util[_0x46b1('0x2d')](_0x46b1('0x2e'),_0xa31ab8[_0x46b1('0x2f')]),_0x46b1('0x30'),_0xa31ab8);}}}catch(_0x579dba){logger[_0x46b1('0x15')](_0x46b1('0x25'),util[_0x46b1('0x17')](_0x579dba,{'showHidden':![],'depth':null}));}};UserReport[_0x46b1('0x1d')]['syncDeviceState']=function(_0x4ca228){try{if(this['isNotNull'](_0x4ca228)){logger['info'](_0x46b1('0x31'),_0x4ca228[_0x46b1('0x32')],_0x4ca228[_0x46b1('0x24')]);logger[_0x46b1('0x2b')](_0x46b1('0x33'),util[_0x46b1('0x17')](_0x4ca228,{'showHidden':![],'depth':null}));if(this[_0x46b1('0xb')][_0x4ca228[_0x46b1('0x32')]]){if(!this[_0x46b1('0xb')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x34')]||_0x4ca228[_0x46b1('0x24')][_0x46b1('0x35')]()==_0x46b1('0x36')){this['agents'][_0x4ca228[_0x46b1('0x32')]]['local']=![];if(this[_0x46b1('0xb')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x24')]!==_0x4ca228[_0x46b1('0x24')]['toLowerCase']()){this[_0x46b1('0xb')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x37')]=_[_0x46b1('0x38')](moment()[_0x46b1('0x2d')]('x'));}this[_0x46b1('0xb')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x24')]=_0x4ca228['state']['toLowerCase']();this['agents'][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x39')](_0x4ca228);}}else if(this[_0x46b1('0xc')][_0x4ca228[_0x46b1('0x32')]]){if(this[_0x46b1('0xc')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x24')]!==_0x4ca228[_0x46b1('0x24')]['toLowerCase']()){this[_0x46b1('0xc')][_0x4ca228['device']][_0x46b1('0x37')]=_[_0x46b1('0x38')](moment()[_0x46b1('0x2d')]('x'));}this[_0x46b1('0xc')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x24')]=_0x4ca228[_0x46b1('0x24')][_0x46b1('0x35')]();logger[_0x46b1('0x2b')](_0x46b1('0x3a'),util[_0x46b1('0x17')](this['telephones'][_0x4ca228[_0x46b1('0x32')]],{'showHidden':![],'depth':null}));this[_0x46b1('0x21')](util['format'](_0x46b1('0x3b'),this['telephones'][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x2f')]),'telephone:save',this[_0x46b1('0xc')][_0x4ca228[_0x46b1('0x32')]]);}else if(this[_0x46b1('0xa')][_0x4ca228['device']]){if(this['trunks'][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x24')]!==_0x4ca228[_0x46b1('0x24')][_0x46b1('0x35')]()){this['trunks'][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x37')]=_['toNumber'](moment()[_0x46b1('0x2d')]('x'));}this[_0x46b1('0xa')][_0x4ca228[_0x46b1('0x32')]][_0x46b1('0x24')]=_0x4ca228['state'][_0x46b1('0x35')]();logger[_0x46b1('0x2b')](_0x46b1('0x3c'),util[_0x46b1('0x17')](this[_0x46b1('0xa')][_0x4ca228[_0x46b1('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x46b1('0x2e'),this[_0x46b1('0xa')][_0x4ca228['device']][_0x46b1('0x2f')]),_0x46b1('0x30'),this['trunks'][_0x4ca228['device']]);}else if(_[_0x46b1('0x3d')](_0x4ca228[_0x46b1('0x32')],'Local')){var _0x51b38f=_0x4ca228[_0x46b1('0x32')];var _0x1e38b1=_0x51b38f[_0x46b1('0x3e')](_0x51b38f[_0x46b1('0x3f')]('/')+0x1,_0x51b38f[_0x46b1('0x3f')]('@'));var _0x960958=_['find'](this[_0x46b1('0xb')],function(_0x220f97){return _0x220f97[_0x46b1('0x40')]==_0x1e38b1||_0x220f97[_0x46b1('0x41')]==_0x1e38b1||_0x220f97[_0x46b1('0x42')]==_0x1e38b1;});if(_0x960958){if(_0x960958[_0x46b1('0x24')]!==_0x4ca228[_0x46b1('0x24')][_0x46b1('0x35')]()){_0x960958[_0x46b1('0x37')]=_[_0x46b1('0x38')](moment()[_0x46b1('0x2d')]('x'));}_0x960958[_0x46b1('0x24')]=_0x4ca228[_0x46b1('0x24')][_0x46b1('0x35')]();_0x960958[_0x46b1('0x34')]=!![];_0x960958[_0x46b1('0x39')](_0x4ca228);}}}}catch(_0x3089ea){logger['error'](_0x46b1('0x33'),util[_0x46b1('0x17')](_0x3089ea,{'showHidden':![],'depth':null}));}};UserReport[_0x46b1('0x1d')][_0x46b1('0x43')]=function(_0xefddb1){try{if(this[_0x46b1('0x1f')](_0xefddb1)&&this[_0x46b1('0x1f')](_0xefddb1[_0x46b1('0x44')])){logger[_0x46b1('0x22')](_0x46b1('0x45'),_0xefddb1[_0x46b1('0x46')],_0xefddb1[_0x46b1('0x47')],_0xefddb1[_0x46b1('0x44')]);logger['debug'](_0x46b1('0x48'),util['inspect'](_0xefddb1,{'showHidden':![],'depth':null}));if(this[_0x46b1('0xb')][_0xefddb1[_0x46b1('0x46')]]){if(!this[_0x46b1('0xb')][_0xefddb1['peer']][_0x46b1('0x34')]||_0xefddb1['peerstatus'][_0x46b1('0x35')]()==_0x46b1('0x49')){this['agents'][_0xefddb1[_0x46b1('0x46')]]['local']=![];this[_0x46b1('0xb')][_0xefddb1[_0x46b1('0x46')]][_0x46b1('0x4a')]=_0xefddb1[_0x46b1('0x44')][_0x46b1('0x35')]();this[_0x46b1('0xb')][_0xefddb1['peer']][_0x46b1('0x47')]=_0xefddb1['address'];this[_0x46b1('0xb')][_0xefddb1[_0x46b1('0x46')]][_0x46b1('0x39')](_0xefddb1);}}else if(this[_0x46b1('0xc')][_0xefddb1['peer']]){this[_0x46b1('0xc')][_0xefddb1[_0x46b1('0x46')]]['status']=_0xefddb1['peerstatus']['toLowerCase']();this[_0x46b1('0xc')][_0xefddb1[_0x46b1('0x46')]][_0x46b1('0x47')]=_0xefddb1[_0x46b1('0x47')];logger[_0x46b1('0x2b')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x46b1('0x17')](this[_0x46b1('0xc')][_0xefddb1[_0x46b1('0x46')]],{'showHidden':![],'depth':null}));this[_0x46b1('0x21')](util[_0x46b1('0x2d')](_0x46b1('0x3b'),this['telephones'][_0xefddb1[_0x46b1('0x46')]]['name']),_0x46b1('0x4b'),this['telephones'][_0xefddb1[_0x46b1('0x46')]]);}else if(this[_0x46b1('0xa')][_0xefddb1[_0x46b1('0x46')]]){this[_0x46b1('0xa')][_0xefddb1[_0x46b1('0x46')]]['status']=_0xefddb1[_0x46b1('0x44')][_0x46b1('0x35')]();this[_0x46b1('0xa')][_0xefddb1[_0x46b1('0x46')]]['address']=_0xefddb1['address'];logger[_0x46b1('0x2b')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x46b1('0x17')](this[_0x46b1('0xa')][_0xefddb1[_0x46b1('0x46')]],{'showHidden':![],'depth':null}));this[_0x46b1('0x21')](util[_0x46b1('0x2d')]('trunk:%s',this[_0x46b1('0xa')][_0xefddb1[_0x46b1('0x46')]][_0x46b1('0x2f')]),'trunk:save',this[_0x46b1('0xa')][_0xefddb1['peer']]);}}}catch(_0x5e02a9){logger['error']('[userReport][peerstatus]',util['inspect'](_0x5e02a9,{'showHidden':![],'depth':null}));}};module[_0x46b1('0x4c')]=UserReport;
\ No newline at end of file
index 016c4f5..17c0848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd676=['[%s][voiceAgentReport][agentcomplete]\x20event:','complete','transfer','agent','talktime','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','onhold','lodash','moment','ioredis','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','voiceChannels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','channels','interface','destuniqueid','queue','variables','format','YYYY-MM-DD\x20HH:mm:ss','called','type','inbound','voice','assign','omit','event','privilege','debug','custom:agentcalled','calleridnum','membername','user:called','error','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','user:%s','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswer','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon'];(function(_0xa1abe5,_0xf68000){var _0x5d660d=function(_0x54231d){while(--_0x54231d){_0xa1abe5['push'](_0xa1abe5['shift']());}};_0x5d660d(++_0xf68000);}(_0xd676,0xd7));var _0x6d67=function(_0x39868e,_0x4b6da9){_0x39868e=_0x39868e-0x0;var _0x4eadec=_0xd676[_0x39868e];return _0x4eadec;};'use strict';var _=require(_0x6d67('0x0'));var moment=require(_0x6d67('0x1'));var util=require('util');var Redis=require(_0x6d67('0x2'));var config=require(_0x6d67('0x3'));var logger=require('../../../config/logger')(_0x6d67('0x4'));var ami=require(_0x6d67('0x5'));config['redis']=_[_0x6d67('0x6')](config[_0x6d67('0x7')],{'host':_0x6d67('0x8'),'port':0x18eb});var io=require(_0x6d67('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x3c8539){this['channels']={};this[_0x6d67('0xa')]=_0x3c8539['channels'];this[_0x6d67('0xb')]=_0x3c8539[_0x6d67('0xb')];this[_0x6d67('0xc')]=_0x3c8539[_0x6d67('0xc')];this['variables']={};ami['on'](_0x6d67('0xd'),this[_0x6d67('0xe')][_0x6d67('0xf')](this));ami['on']('agentconnect',this[_0x6d67('0x10')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x6d67('0xf')](this));ami['on']('queuecallerabandon',this[_0x6d67('0x11')][_0x6d67('0xf')](this));ami['on'](_0x6d67('0x12'),this[_0x6d67('0x13')][_0x6d67('0xf')](this));ami['on'](_0x6d67('0x14'),this['syncVarSet'][_0x6d67('0xf')](this));ami['on'](_0x6d67('0x15'),this[_0x6d67('0x16')][_0x6d67('0xf')](this));ami['on'](_0x6d67('0x17'),this[_0x6d67('0x18')][_0x6d67('0xf')](this));ami['on'](_0x6d67('0x19'),this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this[_0x6d67('0x1a')][_0x6d67('0xf')](this));ami['on'](_0x6d67('0x1b'),this[_0x6d67('0x1c')][_0x6d67('0xf')](this));}VoiceAgentReport['prototype'][_0x6d67('0x1d')]=function(_0x659052,_0x15f717,_0x1adbe8){io['to'](_0x659052)[_0x6d67('0x1d')](_0x15f717,_0x1adbe8);};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x1f')]=function(_0x497d6a){return _0x497d6a!==null&&!_[_0x6d67('0x20')](_0x497d6a);};VoiceAgentReport[_0x6d67('0x1e')]['syncAgentCalled']=function(_0x1b92be){try{if(this[_0x6d67('0x1f')](_0x1b92be)){logger[_0x6d67('0x21')](_0x6d67('0x22'),_0x1b92be[_0x6d67('0x23')],_0x1b92be['membername'],_0x1b92be['destuniqueid']);logger['debug'](_0x6d67('0x24'),_0x1b92be[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x1b92be,{'showHidden':![],'depth':null}));if(_[_0x6d67('0x20')](this[_0x6d67('0x26')][_0x1b92be[_0x6d67('0x23')]])){this['channels'][_0x1b92be[_0x6d67('0x23')]]={};}var _0xa6cee1=this[_0x6d67('0xc')][_0x1b92be[_0x6d67('0x27')]];var _0x4c0c34=this[_0x6d67('0x26')][_0x1b92be[_0x6d67('0x23')]][_0x1b92be[_0x6d67('0x28')]];var _0x2e165c=this[_0x6d67('0xb')][_0x1b92be[_0x6d67('0x29')]];var _0x43d899=this[_0x6d67('0x2a')][_0x1b92be[_0x6d67('0x23')]];if(_[_0x6d67('0x20')](_0x4c0c34)){_0x4c0c34={'agentcalledAt':moment()[_0x6d67('0x2b')](_0x6d67('0x2c')),'lastevent':_0x6d67('0x2d'),'mandatoryDisposition':_0x2e165c&&_0x2e165c['mandatoryDisposition']?_0x2e165c['mandatoryDisposition']:![],'type':_0x2e165c&&_0x2e165c[_0x6d67('0x2e')]?_0x2e165c[_0x6d67('0x2e')]:_0x6d67('0x2f'),'variables':_0x43d899,'motionChannel':_0x6d67('0x30')};}Object[_0x6d67('0x31')](_0x4c0c34,_[_0x6d67('0x32')](_0x1b92be,[_0x6d67('0x33'),_0x6d67('0x34')]));this[_0x6d67('0x26')][_0x1b92be[_0x6d67('0x23')]][_0x1b92be[_0x6d67('0x28')]]=_0x4c0c34;logger[_0x6d67('0x35')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x1b92be[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x4c0c34,{'showHidden':![],'depth':null}));ami[_0x6d67('0x1d')](_0x6d67('0x36'),_0x4c0c34);var _0x164d0b={'id':_0xa6cee1['id'],'calleridnum':_0x4c0c34[_0x6d67('0x37')],'queue':_0x4c0c34[_0x6d67('0x29')],'variables':_0x4c0c34[_0x6d67('0x2a')],'uniqueid':_0x1b92be[_0x6d67('0x23')]};logger[_0x6d67('0x35')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x1b92be[_0x6d67('0x23')],util['inspect'](_0x164d0b,{'showHidden':![],'depth':null}));this[_0x6d67('0x1d')](util[_0x6d67('0x2b')]('user:%s',_0x1b92be[_0x6d67('0x38')]),_0x6d67('0x39'),_0x164d0b);}}catch(_0x3361c9){logger[_0x6d67('0x3a')]('[%s][voiceAgentReport][agentcalled]',_0x1b92be['uniqueid'],util[_0x6d67('0x25')](_0x3361c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x10')]=function(_0x2b5ecb){try{if(this[_0x6d67('0x1f')](_0x2b5ecb)){if(this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]]){for(var _0x1da77a in this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]]){if(this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]]['hasOwnProperty'](_0x1da77a)){if(_0x2b5ecb[_0x6d67('0x28')]===_0x1da77a){logger[_0x6d67('0x21')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2b5ecb['uniqueid'],_0x2b5ecb[_0x6d67('0x38')],_0x2b5ecb['destuniqueid']);this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x3b')]=moment()[_0x6d67('0x2b')](_0x6d67('0x2c'));this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x3c')]=_0x2b5ecb[_0x6d67('0x3c')];this['channels'][_0x2b5ecb['uniqueid']][_0x1da77a][_0x6d67('0x3d')]=_0x2b5ecb[_0x6d67('0x3d')];this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x3e')]=_0x2b5ecb[_0x6d67('0x3e')];this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x3f')]=_0x2b5ecb[_0x6d67('0x3f')];this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a]['holdtime']=_0x2b5ecb[_0x6d67('0x40')];this['channels'][_0x2b5ecb['uniqueid']][_0x1da77a][_0x6d67('0x41')]=_0x6d67('0x42');if(this[_0x6d67('0xa')][this[_0x6d67('0x26')][_0x2b5ecb['uniqueid']][_0x1da77a][_0x6d67('0x23')]]){var _0x42a680=this[_0x6d67('0xa')][this['channels'][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x23')]][_0x6d67('0x43')];this['channels'][_0x2b5ecb['uniqueid']][_0x1da77a][_0x6d67('0x43')]=_0x42a680;_0x2b5ecb[_0x6d67('0x43')]=_0x42a680;}_[_0x6d67('0x44')](this[_0x6d67('0xc')][_0x2b5ecb[_0x6d67('0x27')]],_[_0x6d67('0x45')](_0x2b5ecb,[_0x6d67('0x29'),_0x6d67('0x46'),'routealias']));var _0x4434c2=this['agents'][_0x2b5ecb[_0x6d67('0x27')]];var _0x69067f={'id':_0x4434c2['id'],'name':_0x4434c2[_0x6d67('0x47')],'agentconnected':!![],'destaccountcode':_0x4434c2[_0x6d67('0x48')],'destconnectedlinenum':this['channels'][_0x2b5ecb[_0x6d67('0x23')]][_0x2b5ecb[_0x6d67('0x28')]][_0x6d67('0x49')],'queue':this['channels'][_0x2b5ecb['uniqueid']][_0x2b5ecb['destuniqueid']][_0x6d67('0x29')],'routealias':this['channels'][_0x2b5ecb[_0x6d67('0x23')]][_0x2b5ecb['destuniqueid']][_0x6d67('0x43')],'uniqueid':this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x2b5ecb['destuniqueid']]['uniqueid']};ami[_0x6d67('0x1d')](_0x6d67('0x4a'),this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x2b5ecb[_0x6d67('0x28')]]);this[_0x6d67('0x1d')](util['format'](_0x6d67('0x4b'),_0x2b5ecb[_0x6d67('0x38')]),'user:agentconnect',_0x69067f);}else if(!this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a]['agentringnoanswer']&&!this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x12')]){logger[_0x6d67('0x21')](_0x6d67('0x4c'),_0x2b5ecb[_0x6d67('0x23')],this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x38')],_0x1da77a);this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x4d')]=!![];this[_0x6d67('0x26')][_0x2b5ecb['uniqueid']][_0x1da77a][_0x6d67('0x4e')]=moment()['format'](_0x6d67('0x2c'));this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x4f')]=_0x2b5ecb[_0x6d67('0x28')];this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a]['answeredelsewheremembername']=_0x2b5ecb[_0x6d67('0x38')];this['channels'][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a][_0x6d67('0x41')]=_0x6d67('0x50');this['channels'][_0x2b5ecb['uniqueid']][_0x1da77a]['reason']=_0x6d67('0x50');logger[_0x6d67('0x35')](_0x6d67('0x51'),_0x2b5ecb[_0x6d67('0x23')],util[_0x6d67('0x25')](this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a],{'showHidden':![],'depth':null}));ami[_0x6d67('0x1d')](_0x6d67('0x52'),this[_0x6d67('0x26')][_0x2b5ecb[_0x6d67('0x23')]][_0x1da77a]);}else{logger[_0x6d67('0x35')]('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0x2b5ecb[_0x6d67('0x23')]);}}}}}}catch(_0x4c8c65){logger[_0x6d67('0x3a')](_0x6d67('0x53'),_0x2b5ecb['uniqueid'],util[_0x6d67('0x25')](_0x4c8c65,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x54')]=function(_0x2e3a0e){try{if(this[_0x6d67('0x1f')](_0x2e3a0e)){logger[_0x6d67('0x35')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x2e3a0e['uniqueid'],util[_0x6d67('0x25')](_0x2e3a0e,{'showHidden':![],'depth':null}));if(this[_0x6d67('0x26')][_0x2e3a0e[_0x6d67('0x23')]]&&this[_0x6d67('0x26')][_0x2e3a0e[_0x6d67('0x23')]][_0x2e3a0e[_0x6d67('0x28')]]){logger[_0x6d67('0x21')](_0x6d67('0x55'),_0x2e3a0e['uniqueid'],_0x2e3a0e[_0x6d67('0x38')],_0x2e3a0e[_0x6d67('0x28')]);var _0x24f966=this[_0x6d67('0xc')][_0x2e3a0e[_0x6d67('0x27')]];var _0x49ac0f=this[_0x6d67('0x26')][_0x2e3a0e[_0x6d67('0x23')]][_0x2e3a0e[_0x6d67('0x28')]];_0x49ac0f[_0x6d67('0x4d')]=!![];_0x49ac0f[_0x6d67('0x4e')]=moment()[_0x6d67('0x2b')](_0x6d67('0x2c'));_0x49ac0f['lastevent']=_0x6d67('0x56');_0x49ac0f[_0x6d67('0x57')]=_0x6d67('0x56');var _0x5cad43={'id':_0x24f966['id'],'name':_0x24f966['name'],'queue':_0x49ac0f[_0x6d67('0x29')],'uniqueid':_0x49ac0f[_0x6d67('0x23')]};logger['debug'](_0x6d67('0x58'),_0x2e3a0e['uniqueid'],util[_0x6d67('0x25')](_0x5cad43,{'showHidden':![],'depth':null}));this[_0x6d67('0x1d')](util[_0x6d67('0x2b')](_0x6d67('0x4b'),_0x24f966[_0x6d67('0x47')]),_0x6d67('0x59'),_0x5cad43);ami[_0x6d67('0x1d')](_0x6d67('0x5a'),_0x49ac0f);this[_0x6d67('0x26')][_0x2e3a0e[_0x6d67('0x23')]][_0x2e3a0e[_0x6d67('0x28')]]=Object[_0x6d67('0x31')]({},_0x49ac0f);}}}catch(_0x41afbd){logger['error'](_0x6d67('0x5b'),_0x2e3a0e[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x41afbd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x11')]=function(_0x1f4a5b){try{if(this['isNotNull'](_0x1f4a5b)){logger[_0x6d67('0x35')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x1f4a5b['uniqueid'],util[_0x6d67('0x25')](_0x1f4a5b,{'showHidden':![],'depth':null}));if(this[_0x6d67('0x26')][_0x1f4a5b[_0x6d67('0x23')]]){for(var _0x1f8d77 in this[_0x6d67('0x26')][_0x1f4a5b['uniqueid']]){if(this[_0x6d67('0x26')][_0x1f4a5b[_0x6d67('0x23')]][_0x6d67('0x5c')](_0x1f8d77)&&!this['channels'][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77][_0x6d67('0x4d')]&&!this[_0x6d67('0x26')][_0x1f4a5b['uniqueid']][_0x1f8d77][_0x6d67('0x12')]){logger['info'](_0x6d67('0x5d'),_0x1f4a5b[_0x6d67('0x23')],this[_0x6d67('0x26')][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77][_0x6d67('0x38')],_0x1f8d77);this['channels'][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77][_0x6d67('0x4d')]=!![];this[_0x6d67('0x26')][_0x1f4a5b['uniqueid']][_0x1f8d77][_0x6d67('0x4e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6d67('0x26')][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77]['lastevent']=_0x6d67('0x5e');this[_0x6d67('0x26')][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77][_0x6d67('0x57')]='abandoned';logger[_0x6d67('0x35')](_0x6d67('0x5f'),_0x1f4a5b[_0x6d67('0x23')],util['inspect'](this[_0x6d67('0x26')][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77],{'showHidden':![],'depth':null}));ami['emit'](_0x6d67('0x60'),this['channels'][_0x1f4a5b[_0x6d67('0x23')]][_0x1f8d77]);}}}}}catch(_0x2f6690){logger[_0x6d67('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]',_0x1f4a5b[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x2f6690,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x13')]=function(_0x430166){try{if(this[_0x6d67('0x1f')](_0x430166)){logger[_0x6d67('0x35')](_0x6d67('0x61'),_0x430166['uniqueid'],util['inspect'](_0x430166,{'showHidden':![],'depth':null}));if(this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]]){for(var _0x535958 in this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]]){if(this['channels'][_0x430166[_0x6d67('0x23')]]['hasOwnProperty'](_0x535958)){if(this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x3b')]&&!this[_0x6d67('0x26')][_0x430166['uniqueid']][_0x535958][_0x6d67('0x12')]){logger[_0x6d67('0x21')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x430166['uniqueid'],this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x38')],_0x535958);this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x12')]=!![];this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]][_0x535958]['agentcompleteAt']=moment()[_0x6d67('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]][_0x535958]['lastevent']=_0x6d67('0x62');this['channels'][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x57')]=_0x430166[_0x6d67('0x57')]==_0x6d67('0x63')?_0x6d67('0x64'):_0x430166[_0x6d67('0x57')];this['channels'][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x65')]=_0x430166[_0x6d67('0x65')];if(this['voiceQueues'][_0x430166[_0x6d67('0x29')]]&&this[_0x6d67('0xb')][_0x430166[_0x6d67('0x29')]]['acw']){this['channels'][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x66')]=this['voiceQueues'][_0x430166[_0x6d67('0x29')]]['acwTimeout'];this[_0x6d67('0x26')][_0x430166[_0x6d67('0x23')]][_0x535958][_0x6d67('0x67')]=!![];}this[_0x6d67('0xc')][_0x430166['interface']]=_[_0x6d67('0x32')](this[_0x6d67('0xc')][_0x430166[_0x6d67('0x27')]],[_0x6d67('0x29'),_0x6d67('0x46')]);logger[_0x6d67('0x35')](_0x6d67('0x68'),_0x430166['uniqueid'],util[_0x6d67('0x25')](this['channels'][_0x430166['uniqueid']][_0x535958],{'showHidden':![],'depth':null}));ami[_0x6d67('0x1d')]('custom:agentcomplete',this['channels'][_0x430166['uniqueid']][_0x535958]);logger[_0x6d67('0x35')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x430166[_0x6d67('0x23')],util[_0x6d67('0x25')]({'id':this[_0x6d67('0xc')][_0x430166['interface']]['id'],'destaccountcode':_0x430166[_0x6d67('0x69')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',_0x430166[_0x6d67('0x38')]),_0x6d67('0x6a'),{'id':this['agents'][_0x430166[_0x6d67('0x27')]]['id'],'destaccountcode':Number(_0x430166[_0x6d67('0x69')])});}}}}}}catch(_0x38530d){logger['error'](_0x6d67('0x6b'),_0x430166[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x38530d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x6c')]=function(_0x300135){try{if(this['isNotNull'](_0x300135)){logger[_0x6d67('0x35')](_0x6d67('0x6d'),_0x300135[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x300135,{'showHidden':![],'depth':null}));this[_0x6d67('0x6e')](_0x300135['uniqueid'],_['keys'](_0x300135[_0x6d67('0x6f')])[0x0],_0x300135['value']);if(this[_0x6d67('0x26')][_0x300135[_0x6d67('0x23')]]){for(var _0xd12d17 in this['channels'][_0x300135[_0x6d67('0x23')]]){if(this['channels'][_0x300135[_0x6d67('0x23')]][_0x6d67('0x5c')](_0xd12d17)){logger[_0x6d67('0x21')](_0x6d67('0x70'),_0x300135['uniqueid'],_0xd12d17,_[_0x6d67('0x71')](_0x300135[_0x6d67('0x6f')])[0x0],_0x300135[_0x6d67('0x72')]);if(_['isUndefined'](this[_0x6d67('0x26')][_0x300135[_0x6d67('0x23')]][_0xd12d17][_0x6d67('0x2a')])){this[_0x6d67('0x26')][_0x300135[_0x6d67('0x23')]][_0xd12d17][_0x6d67('0x2a')]={};}this[_0x6d67('0x26')][_0x300135['uniqueid']][_0xd12d17][_0x6d67('0x2a')]=this['variables'][_0x300135[_0x6d67('0x23')]];}}}}}catch(_0x5a2daa){logger['error'](_0x6d67('0x73'),_0x300135[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x5a2daa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x6e')]=function(_0x276194,_0x3ce3cd,_0xcf1bb9){var _0x2e7287=[_0x6d67('0x74'),_0x6d67('0x75'),'rtpaudioqosjitter',_0x6d67('0x76'),_0x6d67('0x77'),_0x6d67('0x78'),'rtpaudioqosrtt',_0x6d67('0x79'),'sipcallid',_0x6d67('0x7a'),_0x6d67('0x7b'),_0x6d67('0x7c'),'membercalls',_0x6d67('0x7d'),_0x6d67('0x7e'),_0x6d67('0x7f'),_0x6d67('0x38'),'memberpenalty',_0x6d67('0x80')];if(!_[_0x6d67('0x81')](_0x3ce3cd)&&!_['includes'](_0x2e7287,_0x3ce3cd)){if(_[_0x6d67('0x20')](this[_0x6d67('0x2a')][_0x276194])){this['variables'][_0x276194]={};}this[_0x6d67('0x2a')][_0x276194][_0x3ce3cd]=_0xcf1bb9;}};VoiceAgentReport[_0x6d67('0x1e')]['syncHangup']=function(_0xb15ba5){try{if(this[_0x6d67('0x1f')](_0xb15ba5)){logger[_0x6d67('0x35')](_0x6d67('0x82'),_0xb15ba5[_0x6d67('0x23')],util[_0x6d67('0x25')](_0xb15ba5,{'showHidden':![],'depth':null}));if(this[_0x6d67('0x26')][_0xb15ba5['uniqueid']]){for(var _0xf48572 in this['channels'][_0xb15ba5[_0x6d67('0x23')]]){if(this[_0x6d67('0x26')][_0xb15ba5[_0x6d67('0x23')]][_0x6d67('0x5c')](_0xf48572)){if(this[_0x6d67('0x26')][_0xb15ba5[_0x6d67('0x23')]][_0xf48572][_0x6d67('0x57')]==_0x6d67('0x63')&&this[_0x6d67('0x26')][_0xb15ba5[_0x6d67('0x23')]][_0xf48572][_0x6d67('0x12')]){logger[_0x6d67('0x21')](_0x6d67('0x83'),_0xb15ba5[_0x6d67('0x23')],_0xf48572);this[_0x6d67('0x26')][_0xb15ba5[_0x6d67('0x23')]][_0xf48572]['agentcompleteAt']=moment()[_0x6d67('0x2b')](_0x6d67('0x2c'));}}}logger[_0x6d67('0x35')](_0x6d67('0x84'),_0xb15ba5[_0x6d67('0x23')],util['inspect'](_[_0x6d67('0x85')](this[_0x6d67('0x26')][_0xb15ba5[_0x6d67('0x23')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x6d67('0x86'),_[_0x6d67('0x85')](this['channels'][_0xb15ba5[_0x6d67('0x23')]]));delete this[_0x6d67('0x26')][_0xb15ba5[_0x6d67('0x23')]];}if(this[_0x6d67('0x2a')][_0xb15ba5[_0x6d67('0x23')]]){delete this['variables'][_0xb15ba5['uniqueid']];}}}catch(_0x7508c4){logger[_0x6d67('0x3a')]('[%s][voiceAgentReport][hangup]',_0xb15ba5[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x7508c4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')]['syncAttendedTransfer']=function(_0x24fc82){try{if(this['isNotNull'](_0x24fc82)){logger[_0x6d67('0x35')](_0x6d67('0x87'),_0x24fc82[_0x6d67('0x23')],util[_0x6d67('0x25')](_0x24fc82,{'showHidden':![],'depth':null}));if(this['channels'][_0x24fc82[_0x6d67('0x88')]]){for(var _0x55f721 in this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]]){if(this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]][_0x6d67('0x5c')](_0x55f721)){if(_0x24fc82[_0x6d67('0x89')]===_0x55f721){logger[_0x6d67('0x21')](_0x6d67('0x8a'),_0x24fc82[_0x6d67('0x23')],this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]][_0x55f721][_0x6d67('0x38')],_0x55f721);var _0x14ad73=moment();this[_0x6d67('0x26')][_0x24fc82['transfereeuniqueid']][_0x55f721][_0x6d67('0x12')]=!![];this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]][_0x55f721][_0x6d67('0x8b')]=moment()[_0x6d67('0x2b')](_0x6d67('0x2c'));this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]][_0x55f721]['lastevent']=_0x6d67('0x62');this['channels'][_0x24fc82[_0x6d67('0x88')]][_0x55f721][_0x6d67('0x57')]=_0x6d67('0x63');this[_0x6d67('0x26')][_0x24fc82['transfereeuniqueid']][_0x55f721][_0x6d67('0x65')]=_0x14ad73[_0x6d67('0x8c')](this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]][_0x55f721][_0x6d67('0x3b')],_0x6d67('0x8d'));}}}}if(this[_0x6d67('0x26')][_0x24fc82['secondtransfereruniqueid']]){var _0x3188cc=this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x8e')]];this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x8e')]]=this[_0x6d67('0x26')][_0x24fc82[_0x6d67('0x88')]];this[_0x6d67('0x26')][_0x24fc82['transfereeuniqueid']]=_0x3188cc;}}}catch(_0x123e1b){logger[_0x6d67('0x3a')](_0x6d67('0x8f'),_0x24fc82[_0x6d67('0x23')],util['inspect'](_0x123e1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6d67('0x1c')]=function(_0x5a3c6e){try{if(this['isNotNull'](_0x5a3c6e)){logger[_0x6d67('0x35')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x5a3c6e['uniqueid'],util[_0x6d67('0x25')](_0x5a3c6e,{'showHidden':![],'depth':null}));if(this['channels'][_0x5a3c6e[_0x6d67('0x88')]]){for(var _0x30a74e in this['channels'][_0x5a3c6e['transfereeuniqueid']]){if(this[_0x6d67('0x26')][_0x5a3c6e[_0x6d67('0x88')]][_0x6d67('0x5c')](_0x30a74e)){if(_0x5a3c6e[_0x6d67('0x90')]===_0x30a74e){logger[_0x6d67('0x21')](_0x6d67('0x91'),_0x5a3c6e[_0x6d67('0x23')],this[_0x6d67('0x26')][_0x5a3c6e[_0x6d67('0x88')]][_0x30a74e][_0x6d67('0x38')],_0x30a74e);var _0x9b6234=moment();this['channels'][_0x5a3c6e[_0x6d67('0x88')]][_0x30a74e][_0x6d67('0x12')]=!![];this[_0x6d67('0x26')][_0x5a3c6e['transfereeuniqueid']][_0x30a74e][_0x6d67('0x8b')]=_0x9b6234;this[_0x6d67('0x26')][_0x5a3c6e[_0x6d67('0x88')]][_0x30a74e]['lastevent']=_0x6d67('0x62');this['channels'][_0x5a3c6e[_0x6d67('0x88')]][_0x30a74e][_0x6d67('0x57')]='transfer';this[_0x6d67('0x26')][_0x5a3c6e[_0x6d67('0x88')]][_0x30a74e][_0x6d67('0x65')]=_0x9b6234['diff'](this['channels'][_0x5a3c6e[_0x6d67('0x88')]][_0x30a74e][_0x6d67('0x3b')],_0x6d67('0x8d'));}}}}}}catch(_0x56ed8f){logger['error'](_0x6d67('0x92'),_0x5a3c6e['uniqueid'],util[_0x6d67('0x25')](_0x56ed8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')]['syncMusicOnHoldStart']=function(_0x1fe411){var _0x36fc56='';try{if(this[_0x6d67('0x1f')](_0x1fe411)){logger[_0x6d67('0x35')](_0x6d67('0x93'),_0x1fe411['uniqueid'],util[_0x6d67('0x25')](_0x1fe411,{'showHidden':![],'depth':null}));if(_0x1fe411[_0x6d67('0x94')]){_0x36fc56=_0x1fe411[_0x6d67('0x94')][_0x6d67('0x95')](0x0,_0x1fe411['channel']['lastIndexOf']('-'));if(this[_0x6d67('0xc')][_0x36fc56]){logger['info'](_0x6d67('0x96'),_0x1fe411[_0x6d67('0x23')],_0x36fc56);this[_0x6d67('0xc')][_0x36fc56]['onhold']=!![];}}}}catch(_0xd52ba9){logger[_0x6d67('0x3a')](_0x6d67('0x97'),_0x1fe411[_0x6d67('0x23')],util[_0x6d67('0x25')](_0xd52ba9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6d67('0x1e')][_0x6d67('0x98')]=function(_0x2be338){var _0x443608='';try{if(this[_0x6d67('0x1f')](_0x2be338)){logger[_0x6d67('0x35')](_0x6d67('0x99'),_0x2be338['uniqueid'],util[_0x6d67('0x25')](_0x2be338,{'showHidden':![],'depth':null}));if(_0x2be338[_0x6d67('0x94')]){_0x443608=_0x2be338[_0x6d67('0x94')][_0x6d67('0x95')](0x0,_0x2be338[_0x6d67('0x94')][_0x6d67('0x9a')]('-'));if(this['agents'][_0x443608]){logger[_0x6d67('0x21')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x2be338[_0x6d67('0x23')],_0x443608);this['agents'][_0x443608][_0x6d67('0x9b')]=![];}}}}catch(_0x5618ea){logger[_0x6d67('0x3a')]('[%s][voiceAgentReport][musiconholdstop]',_0x2be338['uniqueid'],util[_0x6d67('0x25')](_0x5618ea,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0x3b33=['uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','assign','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','emit','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','destchannelstate','destchannelstatedesc','connect','routealias','merge','pick','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','user:%s','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','lastevent','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','agentcomplete','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','seconds','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','util','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x3b33,0x113));var _0x33b3=function(_0x189b29,_0x1a5498){_0x189b29=_0x189b29-0x0;var _0x342c0d=_0x3b33[_0x189b29];return _0x342c0d;};'use strict';var _=require(_0x33b3('0x0'));var moment=require('moment');var util=require(_0x33b3('0x1'));var Redis=require('ioredis');var config=require(_0x33b3('0x2'));var logger=require('../../../config/logger')(_0x33b3('0x3'));var ami=require(_0x33b3('0x4'));config['redis']=_[_0x33b3('0x5')](config[_0x33b3('0x6')],{'host':_0x33b3('0x7'),'port':0x18eb});var io=require(_0x33b3('0x8'))(new Redis(config[_0x33b3('0x6')]));function VoiceAgentReport(_0x20213a){this[_0x33b3('0x9')]={};this[_0x33b3('0xa')]=_0x20213a['channels'];this['voiceQueues']=_0x20213a[_0x33b3('0xb')];this[_0x33b3('0xc')]=_0x20213a['agents'];this[_0x33b3('0xd')]={};ami['on'](_0x33b3('0xe'),this[_0x33b3('0xf')]['bind'](this));ami['on'](_0x33b3('0x10'),this[_0x33b3('0x11')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x33b3('0x12')](this));ami['on'](_0x33b3('0x13'),this[_0x33b3('0x14')][_0x33b3('0x12')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x33b3('0x12')](this));ami['on'](_0x33b3('0x15'),this[_0x33b3('0x16')]['bind'](this));ami['on'](_0x33b3('0x17'),this[_0x33b3('0x18')][_0x33b3('0x12')](this));ami['on'](_0x33b3('0x19'),this[_0x33b3('0x1a')]['bind'](this));ami['on'](_0x33b3('0x1b'),this[_0x33b3('0x1c')]['bind'](this));ami['on'](_0x33b3('0x1d'),this[_0x33b3('0x1e')][_0x33b3('0x12')](this));ami['on'](_0x33b3('0x1f'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x33b3('0x20')]['emit']=function(_0x193766,_0x59e180,_0x413b92){io['to'](_0x193766)['emit'](_0x59e180,_0x413b92);};VoiceAgentReport[_0x33b3('0x20')][_0x33b3('0x21')]=function(_0x313cd8){return _0x313cd8!==null&&!_[_0x33b3('0x22')](_0x313cd8);};VoiceAgentReport['prototype'][_0x33b3('0xf')]=function(_0xabfc){try{if(this[_0x33b3('0x21')](_0xabfc)){logger[_0x33b3('0x23')](_0x33b3('0x24'),_0xabfc[_0x33b3('0x25')],_0xabfc[_0x33b3('0x26')],_0xabfc[_0x33b3('0x27')]);logger[_0x33b3('0x28')](_0x33b3('0x29'),_0xabfc[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0xabfc,{'showHidden':![],'depth':null}));if(_[_0x33b3('0x22')](this[_0x33b3('0x9')][_0xabfc['uniqueid']])){this[_0x33b3('0x9')][_0xabfc[_0x33b3('0x25')]]={};}var _0xa586d0=this[_0x33b3('0xc')][_0xabfc[_0x33b3('0x2b')]];var _0x181893=this[_0x33b3('0x9')][_0xabfc[_0x33b3('0x25')]][_0xabfc[_0x33b3('0x27')]];var _0x597757=this[_0x33b3('0xb')][_0xabfc[_0x33b3('0x2c')]];var _0x5afe81=this[_0x33b3('0xd')][_0xabfc['uniqueid']];if(_[_0x33b3('0x22')](_0x181893)){_0x181893={'agentcalledAt':moment()['format'](_0x33b3('0x2d')),'lastevent':_0x33b3('0x2e'),'mandatoryDisposition':_0x597757&&_0x597757[_0x33b3('0x2f')]?_0x597757['mandatoryDisposition']:![],'type':_0x597757&&_0x597757[_0x33b3('0x30')]?_0x597757['type']:_0x33b3('0x31'),'variables':_0x5afe81,'motionChannel':_0x33b3('0x32')};}Object[_0x33b3('0x33')](_0x181893,_[_0x33b3('0x34')](_0xabfc,[_0x33b3('0x35'),_0x33b3('0x36')]));this['channels'][_0xabfc[_0x33b3('0x25')]][_0xabfc[_0x33b3('0x27')]]=_0x181893;logger['debug'](_0x33b3('0x37'),_0xabfc['uniqueid'],util['inspect'](_0x181893,{'showHidden':![],'depth':null}));ami[_0x33b3('0x38')](_0x33b3('0x39'),_0x181893);var _0x1eca76={'id':_0xa586d0['id'],'calleridnum':_0x181893[_0x33b3('0x3a')],'queue':_0x181893[_0x33b3('0x2c')],'variables':_0x181893[_0x33b3('0xd')],'uniqueid':_0xabfc[_0x33b3('0x25')]};logger[_0x33b3('0x28')](_0x33b3('0x3b'),_0xabfc[_0x33b3('0x25')],util['inspect'](_0x1eca76,{'showHidden':![],'depth':null}));this['emit'](util[_0x33b3('0x3c')]('user:%s',_0xabfc[_0x33b3('0x26')]),_0x33b3('0x3d'),_0x1eca76);}}catch(_0x704c1a){logger[_0x33b3('0x3e')](_0x33b3('0x3f'),_0xabfc[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x704c1a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x44c3f2){try{if(this[_0x33b3('0x21')](_0x44c3f2)){if(this[_0x33b3('0x9')][_0x44c3f2['uniqueid']]){for(var _0x31c02f in this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]]){if(this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x33b3('0x40')](_0x31c02f)){if(_0x44c3f2[_0x33b3('0x27')]===_0x31c02f){logger[_0x33b3('0x23')](_0x33b3('0x41'),_0x44c3f2['uniqueid'],_0x44c3f2[_0x33b3('0x26')],_0x44c3f2[_0x33b3('0x27')]);this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x42')]=moment()[_0x33b3('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x31c02f][_0x33b3('0x43')]=_0x44c3f2[_0x33b3('0x43')];this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['connectedlinenum']=_0x44c3f2['connectedlinenum'];this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x31c02f][_0x33b3('0x44')]=_0x44c3f2[_0x33b3('0x44')];this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['destchannelstatedesc']=_0x44c3f2[_0x33b3('0x45')];this['channels'][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['holdtime']=_0x44c3f2['holdtime'];this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['lastevent']=_0x33b3('0x46');if(this[_0x33b3('0xa')][this['channels'][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x25')]]){var _0x46cce0=this[_0x33b3('0xa')][this['channels'][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x25')]][_0x33b3('0x47')];this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x47')]=_0x46cce0;_0x44c3f2[_0x33b3('0x47')]=_0x46cce0;}_[_0x33b3('0x48')](this[_0x33b3('0xc')][_0x44c3f2[_0x33b3('0x2b')]],_[_0x33b3('0x49')](_0x44c3f2,[_0x33b3('0x2c'),_0x33b3('0x4a'),'routealias']));var _0x3d036c=this[_0x33b3('0xc')][_0x44c3f2[_0x33b3('0x2b')]];var _0x32365a={'id':_0x3d036c['id'],'name':_0x3d036c[_0x33b3('0x4b')],'agentconnected':!![],'destaccountcode':_0x3d036c[_0x33b3('0x4c')],'destconnectedlinenum':this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x44c3f2[_0x33b3('0x27')]][_0x33b3('0x4d')],'queue':this['channels'][_0x44c3f2[_0x33b3('0x25')]][_0x44c3f2['destuniqueid']][_0x33b3('0x2c')],'routealias':this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x44c3f2[_0x33b3('0x27')]][_0x33b3('0x47')],'uniqueid':this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x44c3f2[_0x33b3('0x27')]][_0x33b3('0x25')]};ami[_0x33b3('0x38')](_0x33b3('0x4e'),this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x44c3f2[_0x33b3('0x27')]]);this[_0x33b3('0x38')](util[_0x33b3('0x3c')](_0x33b3('0x4f'),_0x44c3f2[_0x33b3('0x26')]),'user:agentconnect',_0x32365a);}else if(!this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x31c02f][_0x33b3('0x50')]&&!this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['agentcomplete']){logger[_0x33b3('0x23')](_0x33b3('0x51'),_0x44c3f2[_0x33b3('0x25')],this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['membername'],_0x31c02f);this['channels'][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x50')]=!![];this[_0x33b3('0x9')][_0x44c3f2['uniqueid']][_0x31c02f][_0x33b3('0x52')]=moment()[_0x33b3('0x3c')](_0x33b3('0x2d'));this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]['answeredelsewheredestinationuniqueid']=_0x44c3f2['destuniqueid'];this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x53')]=_0x44c3f2[_0x33b3('0x26')];this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x54')]='answered_elsewhere';this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f][_0x33b3('0x55')]=_0x33b3('0x56');logger[_0x33b3('0x28')](_0x33b3('0x57'),_0x44c3f2['uniqueid'],util['inspect'](this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f],{'showHidden':![],'depth':null}));ami[_0x33b3('0x38')](_0x33b3('0x58'),this[_0x33b3('0x9')][_0x44c3f2[_0x33b3('0x25')]][_0x31c02f]);}else{logger[_0x33b3('0x28')](_0x33b3('0x59'),_0x44c3f2[_0x33b3('0x25')]);}}}}}}catch(_0x18525a){logger['error'](_0x33b3('0x5a'),_0x44c3f2[_0x33b3('0x25')],util['inspect'](_0x18525a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x33b3('0x20')][_0x33b3('0x5b')]=function(_0x2a9655){try{if(this[_0x33b3('0x21')](_0x2a9655)){logger[_0x33b3('0x28')](_0x33b3('0x5c'),_0x2a9655[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x2a9655,{'showHidden':![],'depth':null}));if(this[_0x33b3('0x9')][_0x2a9655[_0x33b3('0x25')]]&&this[_0x33b3('0x9')][_0x2a9655[_0x33b3('0x25')]][_0x2a9655['destuniqueid']]){logger[_0x33b3('0x23')](_0x33b3('0x5d'),_0x2a9655[_0x33b3('0x25')],_0x2a9655['membername'],_0x2a9655[_0x33b3('0x27')]);var _0x598a00=this[_0x33b3('0xc')][_0x2a9655[_0x33b3('0x2b')]];var _0x5c5e78=this['channels'][_0x2a9655['uniqueid']][_0x2a9655['destuniqueid']];_0x5c5e78[_0x33b3('0x50')]=!![];_0x5c5e78['agentringnoanswerAt']=moment()[_0x33b3('0x3c')](_0x33b3('0x2d'));_0x5c5e78['lastevent']='rejected';_0x5c5e78[_0x33b3('0x55')]=_0x33b3('0x5e');var _0x546bf8={'id':_0x598a00['id'],'name':_0x598a00[_0x33b3('0x4b')],'queue':_0x5c5e78['queue'],'uniqueid':_0x5c5e78['uniqueid']};logger[_0x33b3('0x28')](_0x33b3('0x5f'),_0x2a9655[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x546bf8,{'showHidden':![],'depth':null}));this['emit'](util[_0x33b3('0x3c')](_0x33b3('0x4f'),_0x598a00['name']),_0x33b3('0x60'),_0x546bf8);ami[_0x33b3('0x38')]('custom:agentringnoanswer',_0x5c5e78);this[_0x33b3('0x9')][_0x2a9655[_0x33b3('0x25')]][_0x2a9655['destuniqueid']]=Object[_0x33b3('0x33')]({},_0x5c5e78);}}}catch(_0x358cbd){logger[_0x33b3('0x3e')](_0x33b3('0x61'),_0x2a9655[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x358cbd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x33b3('0x20')][_0x33b3('0x14')]=function(_0x10170f){try{if(this[_0x33b3('0x21')](_0x10170f)){logger[_0x33b3('0x28')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x10170f[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x10170f,{'showHidden':![],'depth':null}));if(this['channels'][_0x10170f[_0x33b3('0x25')]]){for(var _0x19bab4 in this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]]){if(this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x33b3('0x40')](_0x19bab4)&&!this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x19bab4][_0x33b3('0x50')]&&!this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x19bab4][_0x33b3('0x62')]){logger['info'](_0x33b3('0x63'),_0x10170f[_0x33b3('0x25')],this[_0x33b3('0x9')][_0x10170f['uniqueid']][_0x19bab4][_0x33b3('0x26')],_0x19bab4);this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x19bab4]['agentringnoanswer']=!![];this[_0x33b3('0x9')][_0x10170f['uniqueid']][_0x19bab4][_0x33b3('0x52')]=moment()[_0x33b3('0x3c')](_0x33b3('0x2d'));this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x19bab4][_0x33b3('0x54')]=_0x33b3('0x64');this[_0x33b3('0x9')][_0x10170f['uniqueid']][_0x19bab4][_0x33b3('0x55')]='abandoned';logger[_0x33b3('0x28')](_0x33b3('0x65'),_0x10170f[_0x33b3('0x25')],util[_0x33b3('0x2a')](this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x19bab4],{'showHidden':![],'depth':null}));ami[_0x33b3('0x38')]('custom:agentqueuecallerabandon',this[_0x33b3('0x9')][_0x10170f[_0x33b3('0x25')]][_0x19bab4]);}}}}}catch(_0x36e923){logger[_0x33b3('0x3e')]('[%s][voiceAgentReport][queuecallerabandon]',_0x10170f['uniqueid'],util[_0x33b3('0x2a')](_0x36e923,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x33b3('0x66')]=function(_0x231a97){try{if(this['isNotNull'](_0x231a97)){logger[_0x33b3('0x28')](_0x33b3('0x67'),_0x231a97[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x231a97,{'showHidden':![],'depth':null}));if(this[_0x33b3('0x9')][_0x231a97['uniqueid']]){for(var _0x3cb9f9 in this['channels'][_0x231a97[_0x33b3('0x25')]]){if(this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]]['hasOwnProperty'](_0x3cb9f9)){if(this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x42')]&&!this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x62')]){logger[_0x33b3('0x23')](_0x33b3('0x68'),_0x231a97[_0x33b3('0x25')],this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x26')],_0x3cb9f9);this['channels'][_0x231a97['uniqueid']][_0x3cb9f9]['agentcomplete']=!![];this[_0x33b3('0x9')][_0x231a97['uniqueid']][_0x3cb9f9][_0x33b3('0x69')]=moment()[_0x33b3('0x3c')](_0x33b3('0x2d'));this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x54')]=_0x33b3('0x6a');this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x55')]=_0x231a97[_0x33b3('0x55')]=='transfer'?_0x33b3('0x6b'):_0x231a97['reason'];this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x6c')]=_0x231a97['talktime'];if(this['voiceQueues'][_0x231a97['queue']]&&this['voiceQueues'][_0x231a97[_0x33b3('0x2c')]]['acw']){this[_0x33b3('0x9')][_0x231a97['uniqueid']][_0x3cb9f9][_0x33b3('0x6d')]=this[_0x33b3('0xb')][_0x231a97['queue']]['acwTimeout'];this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9][_0x33b3('0x6e')]=!![];}this[_0x33b3('0xc')][_0x231a97[_0x33b3('0x2b')]]=_[_0x33b3('0x34')](this[_0x33b3('0xc')][_0x231a97['interface']],[_0x33b3('0x2c'),_0x33b3('0x4a')]);logger['debug'](_0x33b3('0x6f'),_0x231a97[_0x33b3('0x25')],util['inspect'](this[_0x33b3('0x9')][_0x231a97[_0x33b3('0x25')]][_0x3cb9f9],{'showHidden':![],'depth':null}));ami[_0x33b3('0x38')](_0x33b3('0x70'),this[_0x33b3('0x9')][_0x231a97['uniqueid']][_0x3cb9f9]);logger[_0x33b3('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x231a97['uniqueid'],util[_0x33b3('0x2a')]({'id':this[_0x33b3('0xc')][_0x231a97[_0x33b3('0x2b')]]['id'],'destaccountcode':_0x231a97[_0x33b3('0x71')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x33b3('0x3c')]('user:%s',_0x231a97[_0x33b3('0x26')]),_0x33b3('0x72'),{'id':this[_0x33b3('0xc')][_0x231a97[_0x33b3('0x2b')]]['id'],'destaccountcode':Number(_0x231a97[_0x33b3('0x71')])});}}}}}}catch(_0x1343df){logger[_0x33b3('0x3e')](_0x33b3('0x73'),_0x231a97[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x1343df,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x1eaa5a){try{if(this['isNotNull'](_0x1eaa5a)){logger[_0x33b3('0x28')](_0x33b3('0x74'),_0x1eaa5a[_0x33b3('0x25')],util['inspect'](_0x1eaa5a,{'showHidden':![],'depth':null}));this['addVariable'](_0x1eaa5a[_0x33b3('0x25')],_[_0x33b3('0x75')](_0x1eaa5a[_0x33b3('0x76')])[0x0],_0x1eaa5a['value']);if(this[_0x33b3('0x9')][_0x1eaa5a[_0x33b3('0x25')]]){for(var _0x1ab011 in this[_0x33b3('0x9')][_0x1eaa5a[_0x33b3('0x25')]]){if(this['channels'][_0x1eaa5a[_0x33b3('0x25')]]['hasOwnProperty'](_0x1ab011)){logger[_0x33b3('0x23')](_0x33b3('0x77'),_0x1eaa5a[_0x33b3('0x25')],_0x1ab011,_[_0x33b3('0x75')](_0x1eaa5a[_0x33b3('0x76')])[0x0],_0x1eaa5a['value']);if(_['isUndefined'](this['channels'][_0x1eaa5a[_0x33b3('0x25')]][_0x1ab011][_0x33b3('0xd')])){this[_0x33b3('0x9')][_0x1eaa5a[_0x33b3('0x25')]][_0x1ab011]['variables']={};}this[_0x33b3('0x9')][_0x1eaa5a[_0x33b3('0x25')]][_0x1ab011][_0x33b3('0xd')]=this['variables'][_0x1eaa5a['uniqueid']];}}}}}catch(_0x4da27d){logger['error']('[%s][voiceAgentReport][varset]',_0x1eaa5a[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x4da27d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x2a4dcf,_0x2db58a,_0x19faab){var _0x48cde2=['rtpaudioqos',_0x33b3('0x78'),'rtpaudioqosjitter',_0x33b3('0x79'),_0x33b3('0x7a'),_0x33b3('0x7b'),_0x33b3('0x7c'),_0x33b3('0x7d'),_0x33b3('0x7e'),'sipuri',_0x33b3('0x7f'),_0x33b3('0x80'),_0x33b3('0x81'),_0x33b3('0x82'),_0x33b3('0x83'),_0x33b3('0x84'),_0x33b3('0x26'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x2db58a)&&!_[_0x33b3('0x85')](_0x48cde2,_0x2db58a)){if(_[_0x33b3('0x22')](this[_0x33b3('0xd')][_0x2a4dcf])){this['variables'][_0x2a4dcf]={};}this[_0x33b3('0xd')][_0x2a4dcf][_0x2db58a]=_0x19faab;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x15d068){try{if(this['isNotNull'](_0x15d068)){logger[_0x33b3('0x28')](_0x33b3('0x86'),_0x15d068[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x15d068,{'showHidden':![],'depth':null}));if(this['channels'][_0x15d068[_0x33b3('0x25')]]){for(var _0x1cebd6 in this['channels'][_0x15d068[_0x33b3('0x25')]]){if(this[_0x33b3('0x9')][_0x15d068['uniqueid']][_0x33b3('0x40')](_0x1cebd6)){if(this[_0x33b3('0x9')][_0x15d068[_0x33b3('0x25')]][_0x1cebd6][_0x33b3('0x55')]==_0x33b3('0x87')&&this['channels'][_0x15d068[_0x33b3('0x25')]][_0x1cebd6][_0x33b3('0x62')]){logger['info'](_0x33b3('0x88'),_0x15d068[_0x33b3('0x25')],_0x1cebd6);this[_0x33b3('0x9')][_0x15d068[_0x33b3('0x25')]][_0x1cebd6]['agentcompleteAt']=moment()['format'](_0x33b3('0x2d'));}}}logger[_0x33b3('0x28')](_0x33b3('0x89'),_0x15d068[_0x33b3('0x25')],util['inspect'](_[_0x33b3('0x8a')](this[_0x33b3('0x9')][_0x15d068[_0x33b3('0x25')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x33b3('0x8b'),_[_0x33b3('0x8a')](this[_0x33b3('0x9')][_0x15d068['uniqueid']]));delete this[_0x33b3('0x9')][_0x15d068['uniqueid']];}if(this[_0x33b3('0xd')][_0x15d068[_0x33b3('0x25')]]){delete this[_0x33b3('0xd')][_0x15d068['uniqueid']];}}}catch(_0x3df26d){logger[_0x33b3('0x3e')](_0x33b3('0x8c'),_0x15d068[_0x33b3('0x25')],util['inspect'](_0x3df26d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x33b3('0x20')][_0x33b3('0x1e')]=function(_0x25f3c6){try{if(this[_0x33b3('0x21')](_0x25f3c6)){logger[_0x33b3('0x28')](_0x33b3('0x8d'),_0x25f3c6[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x25f3c6,{'showHidden':![],'depth':null}));if(this['channels'][_0x25f3c6['transfereeuniqueid']]){for(var _0x35f8b9 in this[_0x33b3('0x9')][_0x25f3c6['transfereeuniqueid']]){if(this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x8e')]][_0x33b3('0x40')](_0x35f8b9)){if(_0x25f3c6[_0x33b3('0x8f')]===_0x35f8b9){logger[_0x33b3('0x23')](_0x33b3('0x90'),_0x25f3c6[_0x33b3('0x25')],this[_0x33b3('0x9')][_0x25f3c6['transfereeuniqueid']][_0x35f8b9][_0x33b3('0x26')],_0x35f8b9);var _0x58491b=moment();this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x8e')]][_0x35f8b9][_0x33b3('0x62')]=!![];this['channels'][_0x25f3c6[_0x33b3('0x8e')]][_0x35f8b9][_0x33b3('0x69')]=moment()[_0x33b3('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x33b3('0x9')][_0x25f3c6['transfereeuniqueid']][_0x35f8b9][_0x33b3('0x54')]=_0x33b3('0x6a');this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x8e')]][_0x35f8b9][_0x33b3('0x55')]=_0x33b3('0x87');this['channels'][_0x25f3c6[_0x33b3('0x8e')]][_0x35f8b9][_0x33b3('0x6c')]=_0x58491b['diff'](this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x8e')]][_0x35f8b9]['agentconnectAt'],'seconds');}}}}if(this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x91')]]){var _0x855122=this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x91')]];this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x91')]]=this[_0x33b3('0x9')][_0x25f3c6[_0x33b3('0x8e')]];this['channels'][_0x25f3c6[_0x33b3('0x8e')]]=_0x855122;}}}catch(_0x19ea3c){logger[_0x33b3('0x3e')](_0x33b3('0x92'),_0x25f3c6['uniqueid'],util[_0x33b3('0x2a')](_0x19ea3c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x32972c){try{if(this[_0x33b3('0x21')](_0x32972c)){logger[_0x33b3('0x28')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x32972c['uniqueid'],util[_0x33b3('0x2a')](_0x32972c,{'showHidden':![],'depth':null}));if(this[_0x33b3('0x9')][_0x32972c[_0x33b3('0x8e')]]){for(var _0x4c3dfe in this[_0x33b3('0x9')][_0x32972c['transfereeuniqueid']]){if(this['channels'][_0x32972c[_0x33b3('0x8e')]][_0x33b3('0x40')](_0x4c3dfe)){if(_0x32972c['transfereruniqueid']===_0x4c3dfe){logger[_0x33b3('0x23')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x32972c['uniqueid'],this[_0x33b3('0x9')][_0x32972c[_0x33b3('0x8e')]][_0x4c3dfe][_0x33b3('0x26')],_0x4c3dfe);var _0x2bad40=moment();this[_0x33b3('0x9')][_0x32972c['transfereeuniqueid']][_0x4c3dfe][_0x33b3('0x62')]=!![];this[_0x33b3('0x9')][_0x32972c['transfereeuniqueid']][_0x4c3dfe]['agentcompleteAt']=_0x2bad40;this['channels'][_0x32972c[_0x33b3('0x8e')]][_0x4c3dfe]['lastevent']=_0x33b3('0x6a');this['channels'][_0x32972c[_0x33b3('0x8e')]][_0x4c3dfe][_0x33b3('0x55')]=_0x33b3('0x87');this[_0x33b3('0x9')][_0x32972c[_0x33b3('0x8e')]][_0x4c3dfe][_0x33b3('0x6c')]=_0x2bad40['diff'](this[_0x33b3('0x9')][_0x32972c['transfereeuniqueid']][_0x4c3dfe][_0x33b3('0x42')],_0x33b3('0x93'));}}}}}}catch(_0x4668bf){logger[_0x33b3('0x3e')]('[%s][voiceAgentReport][blindtransfer]',_0x32972c[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x4668bf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x33b3('0x20')][_0x33b3('0x1a')]=function(_0x7e804d){var _0x1256a7='';try{if(this['isNotNull'](_0x7e804d)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x7e804d[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x7e804d,{'showHidden':![],'depth':null}));if(_0x7e804d[_0x33b3('0x94')]){_0x1256a7=_0x7e804d[_0x33b3('0x94')][_0x33b3('0x95')](0x0,_0x7e804d['channel'][_0x33b3('0x96')]('-'));if(this['agents'][_0x1256a7]){logger[_0x33b3('0x23')](_0x33b3('0x97'),_0x7e804d[_0x33b3('0x25')],_0x1256a7);this['agents'][_0x1256a7][_0x33b3('0x98')]=!![];}}}}catch(_0x2c1215){logger[_0x33b3('0x3e')](_0x33b3('0x99'),_0x7e804d[_0x33b3('0x25')],util['inspect'](_0x2c1215,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x33b3('0x1c')]=function(_0x3e0357){var _0x5e8282='';try{if(this[_0x33b3('0x21')](_0x3e0357)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x3e0357[_0x33b3('0x25')],util[_0x33b3('0x2a')](_0x3e0357,{'showHidden':![],'depth':null}));if(_0x3e0357[_0x33b3('0x94')]){_0x5e8282=_0x3e0357[_0x33b3('0x94')][_0x33b3('0x95')](0x0,_0x3e0357[_0x33b3('0x94')][_0x33b3('0x96')]('-'));if(this[_0x33b3('0xc')][_0x5e8282]){logger[_0x33b3('0x23')](_0x33b3('0x9a'),_0x3e0357[_0x33b3('0x25')],_0x5e8282);this['agents'][_0x5e8282][_0x33b3('0x98')]=![];}}}}catch(_0x16d828){logger[_0x33b3('0x3e')]('[%s][voiceAgentReport][musiconholdstop]',_0x3e0357['uniqueid'],util[_0x33b3('0x2a')](_0x16d828,{'showHidden':![],'depth':null}));}};module[_0x33b3('0x9b')]=VoiceAgentReport;
\ No newline at end of file
index 8f94e11..740f8f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x602f=['lastapplication','lastdata','cdr(','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','starttime','holdtime','diff','UserId','membername','connectedlinename','destinationchannel','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','isEmpty','getSettings','stopRecordingOnTransfer','StopMixMonitor','Action','catch','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','path','../../../config/logger','ami','../rpc/setting','set','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','merge','pick','context','channel','exten','xcally-motion-preview','split','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','toLowerCase','subtract','duration','seconds','keys'];(function(_0x1deff2,_0x4a9388){var _0x5a651c=function(_0x502f06){while(--_0x502f06){_0x1deff2['push'](_0x1deff2['shift']());}};_0x5a651c(++_0x4a9388);}(_0x602f,0x143));var _0xf602=function(_0x3661f8,_0x39eeaa){_0x3661f8=_0x3661f8-0x0;var _0x160c1b=_0x602f[_0x3661f8];return _0x160c1b;};'use strict';var _=require(_0xf602('0x0'));var moment=require(_0xf602('0x1'));var util=require('util');var path=require(_0xf602('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xf602('0x3'))(_0xf602('0x4'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require(_0xf602('0x5'));var applications=[_0xf602('0x6'),_0xf602('0x7'),_0xf602('0x8'),'dial',_0xf602('0x9'),_0xf602('0xa')];var dispositions=[_0xf602('0xb'),_0xf602('0xc'),_0xf602('0xc'),_0xf602('0xb'),_0xf602('0xb'),_0xf602('0xb'),_0xf602('0xd'),_0xf602('0xe'),_0xf602('0xc'),_0xf602('0xc'),_0xf602('0xc')];config[_0xf602('0xf')]=_[_0xf602('0x10')](config[_0xf602('0xf')],{'host':'localhost','port':0x18eb});var io=require(_0xf602('0x11'))(new Redis(config[_0xf602('0xf')]));function VoiceCallReport(_0x20a517){this[_0xf602('0x12')]=_0x20a517[_0xf602('0x12')];this[_0xf602('0x13')]=_0x20a517[_0xf602('0x13')];this[_0xf602('0x14')]={};ami['on'](_0xf602('0x15'),this[_0xf602('0x16')][_0xf602('0x17')](this));ami['on'](_0xf602('0x18'),this['syncNewExten'][_0xf602('0x17')](this));ami['on'](_0xf602('0x19'),this[_0xf602('0x1a')][_0xf602('0x17')](this));ami['on'](_0xf602('0x1b'),this[_0xf602('0x1c')][_0xf602('0x17')](this));ami['on']('varset',this[_0xf602('0x1d')]['bind'](this));ami['on'](_0xf602('0x1e'),this['syncHangup']['bind'](this));ami['on'](_0xf602('0x1f'),this['syncNewCallerId'][_0xf602('0x17')](this));ami['on'](_0xf602('0x20'),this[_0xf602('0x21')][_0xf602('0x17')](this));ami['on'](_0xf602('0x22'),this[_0xf602('0x23')][_0xf602('0x17')](this));ami['on'](_0xf602('0x24'),this[_0xf602('0x25')][_0xf602('0x17')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xf602('0x17')](this));try{logger[_0xf602('0x26')](_0xf602('0x27'));ami[_0xf602('0x28')]();}catch(_0x4b2679){logger[_0xf602('0x29')](_0xf602('0x2a'),util[_0xf602('0x2b')](_0x4b2679,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf602('0x2c')]['isNotNull']=function(_0x1f13b3){return _0x1f13b3!==null&&!_[_0xf602('0x2d')](_0x1f13b3);};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x2e')]=function(_0xdfbcdd,_0x51ed69,_0x9ed772){io['to'](_0xdfbcdd)[_0xf602('0x2e')](_0x51ed69,_0x9ed772);};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x2f')]=function(_0x17ceab){try{if(this['isNotNull'](_0x17ceab)){logger[_0xf602('0x26')](_0xf602('0x30'),_0x17ceab[_0xf602('0x31')],_0x17ceab[_0xf602('0x32')],_0x17ceab[_0xf602('0x33')]);logger[_0xf602('0x34')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x17ceab['uniqueid'],util[_0xf602('0x2b')](_0x17ceab,{'showHidden':![],'depth':null}));if(_0x17ceab[_0xf602('0x31')]===_0x17ceab['linkedid']){if(!_[_0xf602('0x2d')](this[_0xf602('0x12')][_0x17ceab[_0xf602('0x31')]])){_[_0xf602('0x35')](this[_0xf602('0x12')][_0x17ceab['uniqueid']],_[_0xf602('0x36')](_0x17ceab,_['keys'](this[_0xf602('0x12')][_0x17ceab[_0xf602('0x31')]])));}}if(_0x17ceab[_0xf602('0x37')]==='from-sip'){if(this[_0xf602('0x13')][_0x17ceab[_0xf602('0x38')]['split']('-')[0x0]]){if(_0x17ceab[_0xf602('0x39')]==_0xf602('0x3a')){this[_0xf602('0x13')][_0x17ceab[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]][_0xf602('0x3c')]=_0x17ceab[_0xf602('0x3d')];this['emit'](util[_0xf602('0x3e')](_0xf602('0x3f'),this[_0xf602('0x13')][_0x17ceab[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]][_0xf602('0x40')]),_0xf602('0x41'),{'destaccountcode':this[_0xf602('0x13')][_0x17ceab[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]][_0xf602('0x42')],'destconnectedlinenum':_0x17ceab[_0xf602('0x3d')]});}}}}}catch(_0xa041e5){logger[_0xf602('0x29')]('[%s][voiceCallReport][newcallerid]',_0x17ceab['uniqueid'],util[_0xf602('0x2b')](_0xa041e5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')]['syncNewChannel']=function(_0x586a94){try{if(this[_0xf602('0x43')](_0x586a94)){logger[_0xf602('0x34')](_0xf602('0x44'),_0x586a94[_0xf602('0x31')],util[_0xf602('0x2b')](_0x586a94,{'showHidden':![],'depth':null}));if(this[_0xf602('0x12')][_0x586a94[_0xf602('0x31')]]){return;}if(_0x586a94[_0xf602('0x38')]===_0xf602('0x45')){return;}if(_0x586a94[_0xf602('0x31')]!==_0x586a94[_0xf602('0x46')]&&!this['blindTransfers'][_0x586a94['linkedid']]){return;}logger[_0xf602('0x26')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x586a94[_0xf602('0x31')],_0x586a94[_0xf602('0x37')],_0x586a94[_0xf602('0x39')]);this[_0xf602('0x12')][_0x586a94[_0xf602('0x31')]]=new Channel();this['channels'][_0x586a94[_0xf602('0x31')]]['starttime']=moment()['format'](_0xf602('0x47'));this[_0xf602('0x12')][_0x586a94[_0xf602('0x31')]][_0xf602('0x48')]=dispositions[_[_0xf602('0x49')](_0x586a94[_0xf602('0x4a')])];_[_0xf602('0x35')](this[_0xf602('0x12')][_0x586a94[_0xf602('0x31')]],_[_0xf602('0x36')](_0x586a94,_['keys'](this[_0xf602('0x12')][_0x586a94[_0xf602('0x31')]])));if(_0x586a94['context']==='from-sip'){var _0x5a197b=this['agents'][_0x586a94['channel'][_0xf602('0x3b')]('-')[0x0]];if(_0x5a197b&&typeof _0x5a197b['destconnectedlinenum']===_0xf602('0x4b')){_0x5a197b[_0xf602('0x3c')]=_0x586a94[_0xf602('0x39')];logger['debug'](_0xf602('0x4c'),_0x586a94[_0xf602('0x31')],util['inspect']({'id':_0x5a197b['id'],'destaccountcode':_0x5a197b[_0xf602('0x42')],'destconnectedlinenum':_0x586a94[_0xf602('0x39')]},{'showHidden':![],'depth':null}));this[_0xf602('0x2e')](util[_0xf602('0x3e')](_0xf602('0x3f'),_0x5a197b['name']),_0xf602('0x41'),{'id':_0x5a197b['id'],'destaccountcode':_0x5a197b[_0xf602('0x42')],'destconnectedlinenum':_0x586a94['exten']});}}}}catch(_0x5063d5){logger[_0xf602('0x29')](_0xf602('0x4d'),_0x586a94['uniqueid'],util[_0xf602('0x2b')](_0x5063d5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x16')]=function(_0x55fd0c){try{if(this[_0xf602('0x43')](_0x55fd0c)){logger[_0xf602('0x34')](_0xf602('0x4e'),_0x55fd0c[_0xf602('0x31')],util['inspect'](_0x55fd0c,{'showHidden':![],'depth':null}));if(_0x55fd0c[_0xf602('0x38')]===_0xf602('0x45')||_0x55fd0c[_0xf602('0x39')]==='h')return;if(_0x55fd0c[_0xf602('0x31')]===_0x55fd0c[_0xf602('0x46')]||this['blindTransfers'][_0x55fd0c['linkedid']]){_0x55fd0c[_0xf602('0x4f')]=_0x55fd0c[_0xf602('0x4f')]?_0x55fd0c[_0xf602('0x4f')]['toLowerCase']():undefined;_0x55fd0c[_0xf602('0x50')]=_0x55fd0c['appdata']||_0x55fd0c[_0xf602('0x50')];if(_0x55fd0c[_0xf602('0x51')]&&!_0x55fd0c[_0xf602('0x51')][_0xf602('0x52')](_0xf602('0x53'))&&_0x55fd0c[_0xf602('0x4f')]!==_0xf602('0x7')){_0x55fd0c[_0xf602('0x50')]=_0x55fd0c[_0xf602('0x50')][_0xf602('0x54')]();}logger[_0xf602('0x26')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x55fd0c[_0xf602('0x31')],_0x55fd0c[_0xf602('0x4f')],_0x55fd0c['applicationdata']);if(_[_0xf602('0x2d')](this[_0xf602('0x12')][_0x55fd0c['uniqueid']])){this[_0xf602('0x12')][_0x55fd0c[_0xf602('0x31')]]=new Channel();this[_0xf602('0x12')][_0x55fd0c[_0xf602('0x31')]]['starttime']=_0x55fd0c['duration']?moment()[_0xf602('0x55')](moment[_0xf602('0x56')](_0x55fd0c[_0xf602('0x56')])[_0xf602('0x57')](),_0xf602('0x57'))[_0xf602('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xf602('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf602('0x12')][_0x55fd0c['uniqueid']][_0xf602('0x48')]=_0xf602('0xb');}_[_0xf602('0x35')](this[_0xf602('0x12')][_0x55fd0c[_0xf602('0x31')]],_['pick'](_0x55fd0c,_[_0xf602('0x58')](this[_0xf602('0x12')][_0x55fd0c['uniqueid']])));if(_['includes'](applications,_0x55fd0c[_0xf602('0x4f')])){this[_0xf602('0x12')][_0x55fd0c[_0xf602('0x31')]][_0xf602('0x59')]=_0x55fd0c[_0xf602('0x4f')];this[_0xf602('0x12')][_0x55fd0c[_0xf602('0x31')]][_0xf602('0x5a')]=_0x55fd0c[_0xf602('0x50')];if(_0x55fd0c[_0xf602('0x4f')]===_0xf602('0x6')&&_[_0xf602('0x52')](_0x55fd0c[_0xf602('0x50')][_0xf602('0x54')](),_0xf602('0x5b'))){var _0x177467=_0x55fd0c['applicationdata']['split']('=');var _0x38eb33=_0x177467[0x0][_0xf602('0x54')]()['match'](/cdr\((.*)\)/);if(_0x38eb33){if(_0x38eb33[0x1]===_0xf602('0x5c')&&!_[_0xf602('0x5d')](this['channels'][_0x55fd0c['uniqueid']][_0x38eb33[0x1]]))return;this[_0xf602('0x12')][_0x55fd0c['uniqueid']][_0x38eb33[0x1]]=_0x177467[0x1];}}else if(_0x55fd0c['application']===_0xf602('0x7')){this[_0xf602('0x12')][_0x55fd0c['uniqueid']]['queue']=_0x55fd0c[_0xf602('0x50')]['split'](',')[0x0];}}}}}catch(_0x4fa717){logger[_0xf602('0x29')](_0xf602('0x5e'),_0x55fd0c[_0xf602('0x31')],util['inspect'](_0x4fa717,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf602('0x1c')]=function(_0x44c9e0){try{if(this['isNotNull'](_0x44c9e0)){logger['info'](_0xf602('0x5f'),_0x44c9e0['uniqueid'],_0x44c9e0['linkedid'],_0x44c9e0['calleridname'],_0x44c9e0['calleridnum']);logger[_0xf602('0x34')]('[%s][voiceCallReport][newstate]\x20event:',_0x44c9e0['uniqueid'],util['inspect'](_0x44c9e0,{'showHidden':![],'depth':null}));if(_0x44c9e0[_0xf602('0x4a')]!=='6')return;var _0x3122e7=this['agents'][_0x44c9e0[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]];if(_0x44c9e0['uniqueid']!==_0x44c9e0[_0xf602('0x46')]){var _0x4fa8a2=moment();if(this[_0xf602('0x12')][_0x44c9e0['linkedid']]){if(!this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]]['answered']){this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x60')]=!![];this['channels'][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x61')]=_0x4fa8a2[_0xf602('0x3e')](_0xf602('0x47'));if(this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x62')]){this['channels'][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x63')]=_0x4fa8a2[_0xf602('0x64')](this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x62')],_0xf602('0x57'));}}this['channels'][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x46')]=_0x44c9e0['uniqueid'];if(_0x44c9e0[_0xf602('0x33')]!=='xcally-motion-preview'){this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]]['connectedlinenum']=_0x44c9e0[_0xf602('0x33')];}this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]]['connectedlinename']=_0x44c9e0[_0xf602('0x32')];this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]]['destinationchannel']=_0x44c9e0['channel'];this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x48')]=dispositions[_[_0xf602('0x49')](_0x44c9e0[_0xf602('0x4a')])];if(_0x3122e7){this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x65')]=_0x3122e7['id'];this['channels'][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x66')]=_0x3122e7[_0xf602('0x40')];}}if(this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]){if(!this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]['answered']){this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x60')]=!![];this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]['answertime']=_0x4fa8a2[_0xf602('0x3e')](_0xf602('0x47'));if(this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]['starttime']){this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x63')]=_0x4fa8a2['diff'](this['channels'][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x62')],'seconds');}}if(_0x44c9e0[_0xf602('0x33')]!=='xcally-motion-preview'){this[_0xf602('0x12')][_0x44c9e0['uniqueid']][_0xf602('0x3d')]=_0x44c9e0['calleridnum'];}this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x67')]=_0x44c9e0[_0xf602('0x32')];this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x68')]=_0x44c9e0[_0xf602('0x38')];this['channels'][_0x44c9e0['uniqueid']]['disposition']=dispositions[_['toNumber'](_0x44c9e0[_0xf602('0x4a')])];}}else{if(this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]){if(_0x3122e7){this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]['UserId']=_0x3122e7['id'];this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]['membername']=_0x3122e7[_0xf602('0x40')];}}}if(_0x44c9e0[_0xf602('0x37')]==='from-sip'){if(_0x3122e7){_0x3122e7['destconnectedlinenum']=_0x44c9e0[_0xf602('0x39')];var _0x18fe18,_0x432c9f;if(this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]]){_0x18fe18=this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x69')];_0x432c9f=this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x31')]][_0xf602('0x7')];}else if(this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]]){_0x18fe18=this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]][_0xf602('0x69')];_0x432c9f=this[_0xf602('0x12')][_0x44c9e0[_0xf602('0x46')]]['queue'];}_0x3122e7[_0xf602('0x7')]=_0x432c9f;_0x3122e7['routealias']=_0x18fe18;var _0x19ea65={'id':_0x3122e7['id'],'name':_0x3122e7[_0xf602('0x40')],'agentconnected':!![],'destaccountcode':_0x3122e7[_0xf602('0x42')],'destconnectedlinenum':_0x44c9e0[_0xf602('0x39')],'queue':_0x432c9f||undefined,'routealias':_0x18fe18,'uniqueid':_0x44c9e0['linkedid']};logger['debug'](_0xf602('0x6a'),_0x44c9e0[_0xf602('0x31')],util['inspect'](_0x19ea65,{'showHidden':![],'depth':null}));this['emit'](util[_0xf602('0x3e')]('user:%s',_0x3122e7[_0xf602('0x40')]),_0xf602('0x41'),_0x19ea65);}}}}catch(_0x242eb4){logger[_0xf602('0x29')](_0xf602('0x6b'),_0x44c9e0['uniqueid'],util['inspect'](_0x242eb4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf602('0x6c')]=function(_0x2c8b7f,_0x27e4b7){try{if(this[_0xf602('0x12')][_0x2c8b7f]){logger[_0xf602('0x26')](_0xf602('0x6d'),_0x2c8b7f,_0x27e4b7);this[_0xf602('0x12')][_0x2c8b7f][_0xf602('0x6e')]=!![];if(_['endsWith'](_0x27e4b7,_0xf602('0x6f'))){_0x27e4b7=_0x27e4b7['replace'](_0xf602('0x6f'),_0xf602('0x70'));}this[_0xf602('0x12')][_0x2c8b7f][_0xf602('0x71')]=_0x27e4b7;var _0x45086f=_[_0xf602('0x72')](this[_0xf602('0x12')][_0x2c8b7f][_0xf602('0x73')],{'filename':_0x27e4b7});if(_[_0xf602('0x5d')](_0x45086f)){this[_0xf602('0x12')][_0x2c8b7f][_0xf602('0x73')][_0xf602('0x74')]({'filename':_0x27e4b7,'createdAt':moment()['format'](_0xf602('0x47')),'mixmonitorid':'','status':_0xf602('0x75')});}}}catch(_0x3a4e41){logger[_0xf602('0x29')](_0xf602('0x76'),_0x2c8b7f,util[_0xf602('0x2b')](_0x3a4e41,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x1d')]=function(_0xaa8371){try{if(this[_0xf602('0x43')](_0xaa8371)){logger[_0xf602('0x34')]('[%s][voiceCallReport][varset]\x20event:',_0xaa8371['uniqueid'],util[_0xf602('0x2b')](_0xaa8371,{'showHidden':![],'depth':null}));if(this[_0xf602('0x12')][_0xaa8371['uniqueid']]&&_0xaa8371['channel']!=_0xf602('0x45')){if(this['isNotNull'](_0xaa8371[_0xf602('0x77')])){if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')][_0xf602('0x78')])){logger[_0xf602('0x26')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0xaa8371['uniqueid'],_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x6c')](_0xaa8371['uniqueid'],_0xaa8371[_0xf602('0x79')]);}else if(this[_0xf602('0x43')](_0xaa8371['variable']['xmd-phone'])){logger[_0xf602('0x26')](_0xf602('0x7a'),_0xaa8371['uniqueid'],_0xaa8371['value']);this[_0xf602('0x12')][_0xaa8371[_0xf602('0x31')]][_0xf602('0x33')]=_0xaa8371[_0xf602('0x79')];}else if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')][_0xf602('0x7b')])){logger[_0xf602('0x26')](_0xf602('0x7c'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]);this['channels'][_0xaa8371[_0xf602('0x31')]][_0xf602('0x7d')]=_0xaa8371['value'];}else if(this['isNotNull'](_0xaa8371[_0xf602('0x77')][_0xf602('0x7e')])){logger[_0xf602('0x26')](_0xf602('0x7f'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x12')][_0xaa8371[_0xf602('0x31')]][_0xf602('0x5c')]=_0xaa8371['value'];}else if(this['isNotNull'](_0xaa8371[_0xf602('0x77')][_0xf602('0x80')])){logger['info'](_0xf602('0x81'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]['split'](',')[0x0]);this[_0xf602('0x12')][_0xaa8371[_0xf602('0x31')]]['queue']=_0xaa8371[_0xf602('0x79')][_0xf602('0x3b')](',')[0x0];}else if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')][_0xf602('0x82')])){logger['info'](_0xf602('0x83'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x12')][_0xaa8371[_0xf602('0x31')]][_0xf602('0x84')]=_0xaa8371[_0xf602('0x79')];}else if(this['isNotNull'](_0xaa8371[_0xf602('0x77')][_0xf602('0x85')])){logger[_0xf602('0x26')](_0xf602('0x86'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x12')][_0xaa8371['uniqueid']][_0xf602('0x87')]=_0xaa8371['value'];}else if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')][_0xf602('0x88')])){logger[_0xf602('0x26')](_0xf602('0x89'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]);this['channels'][_0xaa8371[_0xf602('0x31')]][_0xf602('0x8a')]=_0xaa8371[_0xf602('0x79')];}else if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')][_0xf602('0x8b')])){logger[_0xf602('0x26')](_0xf602('0x8c'),_0xaa8371['uniqueid'],_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x12')][_0xaa8371[_0xf602('0x31')]][_0xf602('0x7')]=_0xaa8371[_0xf602('0x79')];}else if(this[_0xf602('0x43')](_0xaa8371['variable'][_0xf602('0x8d')])){logger[_0xf602('0x26')](_0xf602('0x8e'),_0xaa8371[_0xf602('0x31')],_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x12')][_0xaa8371[_0xf602('0x31')]][_0xf602('0x8f')]=_0xaa8371[_0xf602('0x79')];}}}else if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')]['mixmonitor_filename'])){if(_0xaa8371[_0xf602('0x79')]){var _0x4769fc=path[_0xf602('0x90')](_0xaa8371[_0xf602('0x79')])[_0xf602('0x40')];logger[_0xf602('0x26')](_0xf602('0x91'),_0x4769fc,_0xaa8371[_0xf602('0x79')]);this[_0xf602('0x6c')](_0x4769fc,_0xaa8371['value']);}}else if(this[_0xf602('0x12')][_0xaa8371[_0xf602('0x46')]]){if(this[_0xf602('0x43')](_0xaa8371[_0xf602('0x77')])){if(this['isNotNull'](_0xaa8371[_0xf602('0x77')][_0xf602('0x8d')])){logger['info'](_0xf602('0x8e'),_0xaa8371[_0xf602('0x46')],_0xaa8371[_0xf602('0x79')]);this['channels'][_0xaa8371[_0xf602('0x46')]][_0xf602('0x92')]=_0xaa8371['value'];}}}}}catch(_0xdbe90c){logger[_0xf602('0x29')](_0xf602('0x93'),_0xaa8371[_0xf602('0x31')],util['inspect'](_0xdbe90c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x94')]=function(_0x56b1ca){try{if(this['isNotNull'](_0x56b1ca)){logger['debug'](_0xf602('0x95'),_0x56b1ca[_0xf602('0x31')],util[_0xf602('0x2b')](_0x56b1ca,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x56b1ca[_0xf602('0x46')]]){if(this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x46')]]){this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x46')]][_0xf602('0x31')]=_0x56b1ca['uniqueid'];this['channels'][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]]['linkedid']][_0xf602('0x60')]=this[_0xf602('0x12')][_0x56b1ca['uniqueid']][_0xf602('0x60')];this['channels'][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x46')]]['answertime']=this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x61')];this[_0xf602('0x12')][this['blindTransfers'][_0x56b1ca['linkedid']][_0xf602('0x46')]]['destinationchannel']=this['channels'][this['blindTransfers'][_0x56b1ca['linkedid']][_0xf602('0x46')]][_0xf602('0x38')];this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x46')]]['disposition']=this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x48')];this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]]=this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x46')]];delete this[_0xf602('0x12')][this['blindTransfers'][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x46')]];}else if(this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x31')]]){this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca['linkedid']][_0xf602('0x31')]]['uniqueid']=[this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca['linkedid']][_0xf602('0x31')]][_0xf602('0x46')],this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]]['uniqueid']]['linkedid']=this['channels'][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x31')]]['uniqueid']][0x0];this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca['linkedid']]['uniqueid']]['answered']=this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x60')];this[_0xf602('0x12')][this['blindTransfers'][_0x56b1ca['linkedid']]['uniqueid']][_0xf602('0x61')]=this['channels'][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x61')];this[_0xf602('0x12')][this[_0xf602('0x14')][_0x56b1ca['linkedid']][_0xf602('0x31')]][_0xf602('0x68')]=this[_0xf602('0x12')][this['blindTransfers'][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x31')]][_0xf602('0x38')];this['channels'][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]]['uniqueid']][_0xf602('0x48')]=this[_0xf602('0x12')][_0x56b1ca['uniqueid']]['disposition'];this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]]=this[_0xf602('0x12')][this['blindTransfers'][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x31')]];delete this['channels'][this[_0xf602('0x14')][_0x56b1ca[_0xf602('0x46')]][_0xf602('0x31')]];}}if(this['channels'][_0x56b1ca['uniqueid']]){logger[_0xf602('0x26')](_0xf602('0x96'),_0x56b1ca[_0xf602('0x31')],_0x56b1ca[_0xf602('0x97')]);var _0x37eee5=moment();this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x98')]=_0x37eee5[_0xf602('0x3e')](_0xf602('0x47'));this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x56')]=_0x37eee5[_0xf602('0x64')](this['channels'][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x62')],'seconds');if(this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]]['answered']){this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x99')]=_0x37eee5[_0xf602('0x64')](this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x61')],'seconds');this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x63')]=this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]]['duration']-this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x99')];}if(_0x56b1ca[_0xf602('0x37')]==='from-sip'){if(this[_0xf602('0x13')][_0x56b1ca[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]]){this['agents'][_0x56b1ca['channel'][_0xf602('0x3b')]('-')[0x0]]=_[_0xf602('0x9a')](this[_0xf602('0x13')][_0x56b1ca['channel'][_0xf602('0x3b')]('-')[0x0]],[_0xf602('0x3c')]);logger[_0xf602('0x34')](_0xf602('0x9b'),_0x56b1ca[_0xf602('0x31')],util[_0xf602('0x2b')]({'id':this[_0xf602('0x13')][_0x56b1ca['channel'][_0xf602('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x56b1ca[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0xf602('0x2e')](util[_0xf602('0x3e')]('user:%s',this[_0xf602('0x13')][_0x56b1ca[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]][_0xf602('0x40')]),_0xf602('0x9c'),{'id':this[_0xf602('0x13')][_0x56b1ca[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0xf602('0x13')][_0x56b1ca[_0xf602('0x38')][_0xf602('0x3b')]('-')[0x0]][_0xf602('0x42')]});for(var _0x5460d2=0x0;_0x5460d2<Object[_0xf602('0x58')](this['agents'])[_0xf602('0x9d')];_0x5460d2++){var _0x30990c=Object[_0xf602('0x58')](this[_0xf602('0x13')])[_0x5460d2];var _0x1872dc=this[_0xf602('0x13')][_0x30990c];if(_0x1872dc[_0xf602('0x42')]===Number(this['channels'][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x3d')])){this[_0xf602('0x2e')](util['format'](_0xf602('0x3f'),_0x1872dc[_0xf602('0x40')]),_0xf602('0x9c'),{'id':_0x1872dc['id'],'destaccountcode':_0x1872dc[_0xf602('0x42')],'transfer':this[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x9e')]});break;}}}}var _0x1caf5a=this;Promise[_0xf602('0x9f')]()[_0xf602('0xa0')](function(){var _0x594c05=_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]];if(typeof _0x594c05[_0xf602('0x9e')]==='undefined')return;if(_[_0xf602('0xa1')](_0x594c05[_0xf602('0x73')]))return;return RpcSetting[_0xf602('0xa2')]()[_0xf602('0xa0')](function(_0x2dd4a8){if(!_0x2dd4a8[_0xf602('0xa3')])return;return Promise['resolve']()[_0xf602('0xa0')](function(){return ami['Action']({'action':_0xf602('0xa4'),'channel':_0x594c05[_0xf602('0x38')]})['catch'](function(){});})[_0xf602('0xa0')](function(){return ami[_0xf602('0xa5')]({'action':_0xf602('0xa4'),'channel':_0x594c05[_0xf602('0x68')]})[_0xf602('0xa6')](function(){})[_0xf602('0xa7')](function(){var _0x582dd5=_0x1caf5a[_0xf602('0x13')][_0x594c05[_0xf602('0x68')][_0xf602('0x3b')]('-')[0x0]];if(!_0x582dd5)return;io[_0xf602('0x2e')](_0xf602('0xa8'),{'agentId':_0x582dd5['id'],'uniqueid':_0x594c05[_0xf602('0x31')]});});});});})[_0xf602('0xa0')](function(){if(_0x56b1ca[_0xf602('0xa9')]===_0xf602('0xaa')){_0x1caf5a[_0xf602('0x14')][_0x56b1ca[_0xf602('0x31')]]=_0x56b1ca;}else{if(_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x5c')]==='outbound'&&_0x1caf5a[_0xf602('0x14')][_0x56b1ca[_0xf602('0x31')]]){_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x31')]=[_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]]['linkedid'],_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]][_0xf602('0x46')]=_0x1caf5a[_0xf602('0x12')][_0x56b1ca['uniqueid']][_0xf602('0x31')]][0x0];delete _0x1caf5a[_0xf602('0x14')][_0x56b1ca[_0xf602('0x31')]];}}logger[_0xf602('0x34')](_0xf602('0xab'),_0x56b1ca['uniqueid'],util[_0xf602('0x2b')](_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]],{'showHidden':![],'depth':null}));ami[_0xf602('0x2e')](_0xf602('0xac'),_0x1caf5a[_0xf602('0x12')][_0x56b1ca[_0xf602('0x31')]]);delete _0x1caf5a[_0xf602('0x12')][_0x56b1ca['uniqueid']];});}}}catch(_0x415725){logger[_0xf602('0x29')](_0xf602('0xad'),_0x56b1ca['uniqueid'],util[_0xf602('0x2b')](_0x415725,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x21')]=function(_0x32883f){try{if(this[_0xf602('0x43')](_0x32883f)){logger[_0xf602('0x26')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x32883f['uniqueid'],_0x32883f[_0xf602('0xae')],_0x32883f[_0xf602('0xaf')]);logger[_0xf602('0x34')](_0xf602('0xb0'),_0x32883f[_0xf602('0x31')],util[_0xf602('0x2b')](_0x32883f,{'showHidden':![],'depth':null}));var _0x3b60de;if(this[_0xf602('0x12')][_0x32883f[_0xf602('0xb1')]]){this['channels'][_0x32883f[_0xf602('0xb1')]][_0xf602('0xb2')]=_0x32883f[_0xf602('0xae')];this[_0xf602('0x12')][_0x32883f[_0xf602('0xb1')]][_0xf602('0xb3')]=_0x32883f[_0xf602('0xaf')];if(this[_0xf602('0x12')][_0x32883f['secondtransfereruniqueid']]){_0x3b60de=this[_0xf602('0x12')][_0x32883f[_0xf602('0xb4')]];this[_0xf602('0x12')][_0x32883f[_0xf602('0xb4')]]=this[_0xf602('0x12')][_0x32883f['transfereeuniqueid']];this[_0xf602('0x12')][_0x32883f[_0xf602('0xb1')]]=_0x3b60de;}this[_0xf602('0x12')][_0x32883f[_0xf602('0xb4')]][_0xf602('0x9e')]=_0xf602('0xb5');}else if(this['channels'][_0x32883f['transfertargetuniqueid']]){this[_0xf602('0x12')][_0x32883f[_0xf602('0xb6')]][_0xf602('0xb2')]=_0x32883f['origtransferercalleridnum'];this[_0xf602('0x12')][_0x32883f['transfertargetuniqueid']][_0xf602('0xb3')]=_0x32883f[_0xf602('0xaf')];if(this['channels'][_0x32883f[_0xf602('0xb7')]]){_0x3b60de=this[_0xf602('0x12')][_0x32883f['origtransfereruniqueid']];this['channels'][_0x32883f[_0xf602('0xb7')]]=this[_0xf602('0x12')][_0x32883f[_0xf602('0xb6')]];this['channels'][_0x32883f[_0xf602('0xb6')]]=_0x3b60de;}this[_0xf602('0x12')][_0x32883f[_0xf602('0xb6')]][_0xf602('0x9e')]=_0xf602('0xb5');}if((this[_0xf602('0x12')][_0x32883f['origtransfereruniqueid']]||this[_0xf602('0x12')][_0x32883f[_0xf602('0xb8')]])&&this[_0xf602('0x12')][_0x32883f[_0xf602('0xb4')]]){var _0x4d1108=_[_0xf602('0xb9')]([this[_0xf602('0x12')][_0x32883f[_0xf602('0xb7')]],this[_0xf602('0x12')][_0x32883f[_0xf602('0xb8')]],this[_0xf602('0x12')][_0x32883f[_0xf602('0xb4')]]],function(_0x45b6bf){return _0x45b6bf&&_0x45b6bf[_0xf602('0x5c')]===_0xf602('0xba')&&_0x45b6bf[_0xf602('0xbb')];});if(_0x4d1108){if(this['channels'][_0x32883f[_0xf602('0xb7')]])this[_0xf602('0x12')][_0x32883f['origtransfereruniqueid']][_0xf602('0x9e')]=_0xf602('0xb5');if(this[_0xf602('0x12')][_0x32883f[_0xf602('0xb8')]])this['channels'][_0x32883f['origtransfererlinkedid']][_0xf602('0x9e')]=_0xf602('0xb5');this['channels'][_0x32883f[_0xf602('0xb4')]]['transferType']=_0xf602('0xb5');}}}}catch(_0x50b06d){logger[_0xf602('0x29')](_0xf602('0xbc'),_0x32883f[_0xf602('0x31')],util[_0xf602('0x2b')](_0x50b06d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')][_0xf602('0x23')]=function(_0x1ae880){try{if(this[_0xf602('0x43')](_0x1ae880)){logger[_0xf602('0x26')](_0xf602('0xbd'),_0x1ae880[_0xf602('0x31')],_0x1ae880['transfereecalleridnum'],_0x1ae880[_0xf602('0xbe')]);logger['debug'](_0xf602('0xbf'),_0x1ae880[_0xf602('0x31')],util[_0xf602('0x2b')](_0x1ae880,{'showHidden':![],'depth':null}));if(this[_0xf602('0x12')][_0x1ae880[_0xf602('0xb1')]]){this[_0xf602('0x12')][_0x1ae880[_0xf602('0xb1')]][_0xf602('0xb2')]=_0x1ae880[_0xf602('0xc0')];this['channels'][_0x1ae880[_0xf602('0xb1')]]['transferconnectedlinenum']=_0x1ae880[_0xf602('0xbe')];this[_0xf602('0x12')][_0x1ae880[_0xf602('0xb1')]][_0xf602('0x9e')]=_0xf602('0xc1');this[_0xf602('0x94')]({'event':_0xf602('0xaa'),'uniqueid':_0x1ae880[_0xf602('0xb1')],'linkedid':_0x1ae880[_0xf602('0xc2')],'context':_0x1ae880['context'],'channel':_0x1ae880[_0xf602('0xc3')]});}else{this['channels'][_0x1ae880[_0xf602('0xc2')]][_0xf602('0x9e')]=_0xf602('0xc1');this['syncHangup']({'event':_0xf602('0xaa'),'uniqueid':_0x1ae880['transfereruniqueid'],'linkedid':_0x1ae880[_0xf602('0xb1')],'context':_0x1ae880[_0xf602('0x37')],'channel':_0x1ae880['transfererchannel']});}}}catch(_0x42233c){logger['error'](_0xf602('0xc4'),_0x1ae880[_0xf602('0x31')],util[_0xf602('0x2b')](_0x42233c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf602('0x25')]=function(_0x43061b){try{if(this[_0xf602('0x43')](_0x43061b)){logger[_0xf602('0x34')](_0xf602('0xc5'),_0x43061b[_0xf602('0x31')],util[_0xf602('0x2b')](_0x43061b,{'showHidden':![],'depth':null}));if(this[_0xf602('0x12')][_0x43061b[_0xf602('0x31')]]){if(!_[_0xf602('0x5d')](this['channels'][_0x43061b[_0xf602('0x31')]][_0xf602('0x61')])){this[_0xf602('0x12')][_0x43061b[_0xf602('0x31')]]['mohstarttime']=moment()[_0xf602('0x3e')](_0xf602('0x47'));logger[_0xf602('0x26')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x43061b[_0xf602('0x31')],this[_0xf602('0x12')][_0x43061b[_0xf602('0x31')]][_0xf602('0xc6')]);}}}}catch(_0x134ed6){logger[_0xf602('0x29')](_0xf602('0xc7'),_0x43061b['uniqueid'],util[_0xf602('0x2b')](_0x134ed6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf602('0x2c')][_0xf602('0xc8')]=function(_0x465dd5){try{if(this[_0xf602('0x43')](_0x465dd5)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x465dd5[_0xf602('0x31')],util['inspect'](_0x465dd5,{'showHidden':![],'depth':null}));if(this[_0xf602('0x12')][_0x465dd5['uniqueid']]){if(!_[_0xf602('0x5d')](this[_0xf602('0x12')][_0x465dd5['uniqueid']]['mohstarttime'])){this[_0xf602('0x12')][_0x465dd5[_0xf602('0x31')]][_0xf602('0xc9')]+=moment()[_0xf602('0xca')](0x0)[_0xf602('0x64')](this[_0xf602('0x12')][_0x465dd5[_0xf602('0x31')]][_0xf602('0xc6')],_0xf602('0x57'));logger[_0xf602('0x26')](_0xf602('0xcb'),_0x465dd5[_0xf602('0x31')],this[_0xf602('0x12')][_0x465dd5[_0xf602('0x31')]]['mohtime']);delete this[_0xf602('0x12')][_0x465dd5['uniqueid']][_0xf602('0xc6')];}}}}catch(_0x2473fc){logger[_0xf602('0x29')](_0xf602('0xcc'),_0x465dd5[_0xf602('0x31')],util[_0xf602('0x2b')](_0x2473fc,{'showHidden':![],'depth':null}));}};module[_0xf602('0xcd')]=VoiceCallReport;
\ No newline at end of file
+var _0xa75a=['exports','lodash','moment','util','path','ioredis','../../../config/logger','ami','../ami','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','undefined','user:%s','name','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','disposition','lastdata','cdr(','match','type','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','calleridname','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transferconnectedlinenum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xa75a,0x193));var _0xaa75=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa75a[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xaa75('0x0'));var moment=require(_0xaa75('0x1'));var util=require(_0xaa75('0x2'));var path=require(_0xaa75('0x3'));var Redis=require(_0xaa75('0x4'));var config=require('../../../config/environment');var logger=require(_0xaa75('0x5'))(_0xaa75('0x6'));var ami=require(_0xaa75('0x7'));var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var applications=[_0xaa75('0x8'),'queue',_0xaa75('0x9'),_0xaa75('0xa'),_0xaa75('0xb'),_0xaa75('0xc')];var dispositions=[_0xaa75('0xd'),_0xaa75('0xe'),_0xaa75('0xe'),_0xaa75('0xd'),_0xaa75('0xd'),_0xaa75('0xd'),_0xaa75('0xf'),_0xaa75('0x10'),'FAILED',_0xaa75('0xe'),_0xaa75('0xe')];config['redis']=_['defaults'](config[_0xaa75('0x11')],{'host':_0xaa75('0x12'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x5dbe93){this[_0xaa75('0x13')]=_0x5dbe93[_0xaa75('0x13')];this[_0xaa75('0x14')]=_0x5dbe93[_0xaa75('0x14')];this[_0xaa75('0x15')]={};ami['on'](_0xaa75('0x16'),this[_0xaa75('0x17')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x19'),this[_0xaa75('0x17')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x1a'),this[_0xaa75('0x1b')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x1c'),this[_0xaa75('0x1d')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x1e'),this[_0xaa75('0x1f')]['bind'](this));ami['on']('hangup',this[_0xaa75('0x20')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x21'),this[_0xaa75('0x22')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x23'),this[_0xaa75('0x24')][_0xaa75('0x18')](this));ami['on']('blindtransfer',this[_0xaa75('0x25')]['bind'](this));ami['on'](_0xaa75('0x26'),this[_0xaa75('0x27')][_0xaa75('0x18')](this));ami['on'](_0xaa75('0x28'),this[_0xaa75('0x29')][_0xaa75('0x18')](this));try{logger[_0xaa75('0x2a')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xaa75('0x2b')]();}catch(_0x29d78e){logger[_0xaa75('0x2c')]('[voiceCallReport][coreshowchannels]',util[_0xaa75('0x2d')](_0x29d78e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xaa75('0x2e')]['isNotNull']=function(_0x460bea){return _0x460bea!==null&&!_[_0xaa75('0x2f')](_0x460bea);};VoiceCallReport['prototype'][_0xaa75('0x30')]=function(_0x1acc84,_0xd0b250,_0x5513bc){io['to'](_0x1acc84)['emit'](_0xd0b250,_0x5513bc);};VoiceCallReport['prototype'][_0xaa75('0x22')]=function(_0x1fe4c8){try{if(this[_0xaa75('0x31')](_0x1fe4c8)){logger[_0xaa75('0x2a')](_0xaa75('0x32'),_0x1fe4c8[_0xaa75('0x33')],_0x1fe4c8['calleridname'],_0x1fe4c8[_0xaa75('0x34')]);logger[_0xaa75('0x35')](_0xaa75('0x36'),_0x1fe4c8['uniqueid'],util[_0xaa75('0x2d')](_0x1fe4c8,{'showHidden':![],'depth':null}));if(_0x1fe4c8[_0xaa75('0x33')]===_0x1fe4c8[_0xaa75('0x37')]){if(!_[_0xaa75('0x2f')](this[_0xaa75('0x13')][_0x1fe4c8[_0xaa75('0x33')]])){_[_0xaa75('0x38')](this[_0xaa75('0x13')][_0x1fe4c8[_0xaa75('0x33')]],_[_0xaa75('0x39')](_0x1fe4c8,_[_0xaa75('0x3a')](this[_0xaa75('0x13')][_0x1fe4c8[_0xaa75('0x33')]])));}}if(_0x1fe4c8[_0xaa75('0x3b')]===_0xaa75('0x3c')){if(this[_0xaa75('0x14')][_0x1fe4c8[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]]){if(_0x1fe4c8[_0xaa75('0x3f')]==_0xaa75('0x40')){this[_0xaa75('0x14')][_0x1fe4c8[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]][_0xaa75('0x41')]=_0x1fe4c8[_0xaa75('0x42')];this[_0xaa75('0x30')](util[_0xaa75('0x43')]('user:%s',this[_0xaa75('0x14')][_0x1fe4c8[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x1fe4c8['channel'][_0xaa75('0x3e')]('-')[0x0]][_0xaa75('0x44')],'destconnectedlinenum':_0x1fe4c8[_0xaa75('0x42')]});}}}}}catch(_0x596b55){logger[_0xaa75('0x2c')](_0xaa75('0x45'),_0x1fe4c8[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x596b55,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')][_0xaa75('0x1b')]=function(_0x1bbcc1){try{if(this[_0xaa75('0x31')](_0x1bbcc1)){logger[_0xaa75('0x35')](_0xaa75('0x46'),_0x1bbcc1[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x1bbcc1,{'showHidden':![],'depth':null}));if(this['channels'][_0x1bbcc1['uniqueid']]){return;}if(_0x1bbcc1['channel']===_0xaa75('0x47')){return;}if(_0x1bbcc1[_0xaa75('0x33')]!==_0x1bbcc1[_0xaa75('0x37')]&&!this[_0xaa75('0x15')][_0x1bbcc1[_0xaa75('0x37')]]){return;}logger[_0xaa75('0x2a')](_0xaa75('0x48'),_0x1bbcc1[_0xaa75('0x33')],_0x1bbcc1[_0xaa75('0x3b')],_0x1bbcc1['exten']);this[_0xaa75('0x13')][_0x1bbcc1['uniqueid']]=new Channel();this[_0xaa75('0x13')][_0x1bbcc1[_0xaa75('0x33')]][_0xaa75('0x49')]=moment()[_0xaa75('0x43')](_0xaa75('0x4a'));this[_0xaa75('0x13')][_0x1bbcc1['uniqueid']]['disposition']=dispositions[_[_0xaa75('0x4b')](_0x1bbcc1[_0xaa75('0x4c')])];_[_0xaa75('0x38')](this[_0xaa75('0x13')][_0x1bbcc1[_0xaa75('0x33')]],_[_0xaa75('0x39')](_0x1bbcc1,_[_0xaa75('0x3a')](this['channels'][_0x1bbcc1[_0xaa75('0x33')]])));if(_0x1bbcc1[_0xaa75('0x3b')]===_0xaa75('0x3c')){var _0x2c60ac=this['agents'][_0x1bbcc1[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]];if(_0x2c60ac&&typeof _0x2c60ac[_0xaa75('0x41')]===_0xaa75('0x4d')){_0x2c60ac[_0xaa75('0x41')]=_0x1bbcc1['exten'];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x1bbcc1[_0xaa75('0x33')],util[_0xaa75('0x2d')]({'id':_0x2c60ac['id'],'destaccountcode':_0x2c60ac['accountcode'],'destconnectedlinenum':_0x1bbcc1[_0xaa75('0x3f')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xaa75('0x43')](_0xaa75('0x4e'),_0x2c60ac[_0xaa75('0x4f')]),'user:agentconnect',{'id':_0x2c60ac['id'],'destaccountcode':_0x2c60ac['accountcode'],'destconnectedlinenum':_0x1bbcc1[_0xaa75('0x3f')]});}}}}catch(_0x40d8f4){logger['error']('[%s][voiceCallReport][newchannel]',_0x1bbcc1[_0xaa75('0x33')],util['inspect'](_0x40d8f4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaa75('0x17')]=function(_0x378a8b){try{if(this[_0xaa75('0x31')](_0x378a8b)){logger[_0xaa75('0x35')]('[%s][voiceCallReport][newexten]\x20event:',_0x378a8b[_0xaa75('0x33')],util['inspect'](_0x378a8b,{'showHidden':![],'depth':null}));if(_0x378a8b[_0xaa75('0x3d')]==='OutgoingSpoolFailed'||_0x378a8b[_0xaa75('0x3f')]==='h')return;if(_0x378a8b['uniqueid']===_0x378a8b[_0xaa75('0x37')]||this['blindTransfers'][_0x378a8b[_0xaa75('0x37')]]){_0x378a8b['application']=_0x378a8b[_0xaa75('0x50')]?_0x378a8b[_0xaa75('0x50')][_0xaa75('0x51')]():undefined;_0x378a8b[_0xaa75('0x52')]=_0x378a8b[_0xaa75('0x53')]||_0x378a8b[_0xaa75('0x52')];if(_0x378a8b[_0xaa75('0x53')]&&!_0x378a8b[_0xaa75('0x53')][_0xaa75('0x54')](_0xaa75('0x55'))&&_0x378a8b[_0xaa75('0x50')]!==_0xaa75('0x56')){_0x378a8b[_0xaa75('0x52')]=_0x378a8b[_0xaa75('0x52')][_0xaa75('0x51')]();}logger['info'](_0xaa75('0x57'),_0x378a8b[_0xaa75('0x33')],_0x378a8b[_0xaa75('0x50')],_0x378a8b['applicationdata']);if(_[_0xaa75('0x2f')](this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]])){this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]]=new Channel();this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]][_0xaa75('0x49')]=_0x378a8b[_0xaa75('0x58')]?moment()[_0xaa75('0x59')](moment[_0xaa75('0x58')](_0x378a8b[_0xaa75('0x58')])[_0xaa75('0x5a')](),'seconds')[_0xaa75('0x43')](_0xaa75('0x4a')):moment()[_0xaa75('0x43')](_0xaa75('0x4a'));this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]][_0xaa75('0x5b')]=_0xaa75('0xd');}_[_0xaa75('0x38')](this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]],_[_0xaa75('0x39')](_0x378a8b,_['keys'](this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]])));if(_['includes'](applications,_0x378a8b[_0xaa75('0x50')])){this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]]['lastapplication']=_0x378a8b[_0xaa75('0x50')];this[_0xaa75('0x13')][_0x378a8b['uniqueid']][_0xaa75('0x5c')]=_0x378a8b[_0xaa75('0x52')];if(_0x378a8b['application']===_0xaa75('0x8')&&_[_0xaa75('0x54')](_0x378a8b[_0xaa75('0x52')][_0xaa75('0x51')](),_0xaa75('0x5d'))){var _0x1c124d=_0x378a8b[_0xaa75('0x52')][_0xaa75('0x3e')]('=');var _0x5e3fdf=_0x1c124d[0x0]['toLowerCase']()[_0xaa75('0x5e')](/cdr\((.*)\)/);if(_0x5e3fdf){if(_0x5e3fdf[0x1]===_0xaa75('0x5f')&&!_['isNil'](this['channels'][_0x378a8b[_0xaa75('0x33')]][_0x5e3fdf[0x1]]))return;this[_0xaa75('0x13')][_0x378a8b[_0xaa75('0x33')]][_0x5e3fdf[0x1]]=_0x1c124d[0x1];}}else if(_0x378a8b[_0xaa75('0x50')]===_0xaa75('0x56')){this['channels'][_0x378a8b[_0xaa75('0x33')]][_0xaa75('0x56')]=_0x378a8b['applicationdata'][_0xaa75('0x3e')](',')[0x0];}}}}}catch(_0x1b931f){logger[_0xaa75('0x2c')](_0xaa75('0x60'),_0x378a8b['uniqueid'],util[_0xaa75('0x2d')](_0x1b931f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')][_0xaa75('0x1d')]=function(_0x267269){try{if(this[_0xaa75('0x31')](_0x267269)){logger[_0xaa75('0x2a')](_0xaa75('0x61'),_0x267269['uniqueid'],_0x267269['linkedid'],_0x267269['calleridname'],_0x267269['calleridnum']);logger[_0xaa75('0x35')](_0xaa75('0x62'),_0x267269[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x267269,{'showHidden':![],'depth':null}));if(_0x267269['channelstate']!=='6')return;var _0x2b6db6=this[_0xaa75('0x14')][_0x267269[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]];if(_0x267269[_0xaa75('0x33')]!==_0x267269[_0xaa75('0x37')]){var _0x48ecff=moment();if(this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]]){if(!this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]][_0xaa75('0x63')]){this[_0xaa75('0x13')][_0x267269['linkedid']][_0xaa75('0x63')]=!![];this[_0xaa75('0x13')][_0x267269['linkedid']][_0xaa75('0x64')]=_0x48ecff[_0xaa75('0x43')](_0xaa75('0x4a'));if(this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]][_0xaa75('0x49')]){this['channels'][_0x267269[_0xaa75('0x37')]][_0xaa75('0x65')]=_0x48ecff[_0xaa75('0x66')](this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]][_0xaa75('0x49')],_0xaa75('0x5a'));}}this[_0xaa75('0x13')][_0x267269['linkedid']][_0xaa75('0x37')]=_0x267269[_0xaa75('0x33')];if(_0x267269[_0xaa75('0x34')]!==_0xaa75('0x40')){this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]][_0xaa75('0x42')]=_0x267269['calleridnum'];}this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]][_0xaa75('0x67')]=_0x267269['calleridname'];this['channels'][_0x267269[_0xaa75('0x37')]][_0xaa75('0x68')]=_0x267269['channel'];this[_0xaa75('0x13')][_0x267269['linkedid']][_0xaa75('0x5b')]=dispositions[_[_0xaa75('0x4b')](_0x267269[_0xaa75('0x4c')])];if(_0x2b6db6){this[_0xaa75('0x13')][_0x267269['linkedid']][_0xaa75('0x69')]=_0x2b6db6['id'];this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]]['membername']=_0x2b6db6[_0xaa75('0x4f')];}}if(this['channels'][_0x267269['uniqueid']]){if(!this['channels'][_0x267269['uniqueid']][_0xaa75('0x63')]){this['channels'][_0x267269[_0xaa75('0x33')]][_0xaa75('0x63')]=!![];this['channels'][_0x267269[_0xaa75('0x33')]][_0xaa75('0x64')]=_0x48ecff['format'](_0xaa75('0x4a'));if(this[_0xaa75('0x13')][_0x267269['uniqueid']][_0xaa75('0x49')]){this['channels'][_0x267269['uniqueid']][_0xaa75('0x65')]=_0x48ecff[_0xaa75('0x66')](this['channels'][_0x267269[_0xaa75('0x33')]][_0xaa75('0x49')],_0xaa75('0x5a'));}}if(_0x267269[_0xaa75('0x34')]!==_0xaa75('0x40')){this[_0xaa75('0x13')][_0x267269[_0xaa75('0x33')]][_0xaa75('0x42')]=_0x267269[_0xaa75('0x34')];}this[_0xaa75('0x13')][_0x267269['uniqueid']][_0xaa75('0x67')]=_0x267269[_0xaa75('0x6a')];this[_0xaa75('0x13')][_0x267269['uniqueid']][_0xaa75('0x68')]=_0x267269[_0xaa75('0x3d')];this[_0xaa75('0x13')][_0x267269[_0xaa75('0x33')]]['disposition']=dispositions[_[_0xaa75('0x4b')](_0x267269['channelstate'])];}}else{if(this[_0xaa75('0x13')][_0x267269[_0xaa75('0x33')]]){if(_0x2b6db6){this['channels'][_0x267269[_0xaa75('0x33')]][_0xaa75('0x69')]=_0x2b6db6['id'];this[_0xaa75('0x13')][_0x267269[_0xaa75('0x33')]][_0xaa75('0x6b')]=_0x2b6db6[_0xaa75('0x4f')];}}}if(_0x267269['context']===_0xaa75('0x3c')){if(_0x2b6db6){_0x2b6db6[_0xaa75('0x41')]=_0x267269[_0xaa75('0x3f')];var _0x2bdb02,_0x3ad4c8;if(this[_0xaa75('0x13')][_0x267269[_0xaa75('0x33')]]){_0x2bdb02=this[_0xaa75('0x13')][_0x267269[_0xaa75('0x33')]][_0xaa75('0x6c')];_0x3ad4c8=this[_0xaa75('0x13')][_0x267269['uniqueid']]['queue'];}else if(this[_0xaa75('0x13')][_0x267269[_0xaa75('0x37')]]){_0x2bdb02=this[_0xaa75('0x13')][_0x267269['linkedid']][_0xaa75('0x6c')];_0x3ad4c8=this['channels'][_0x267269[_0xaa75('0x37')]][_0xaa75('0x56')];}_0x2b6db6[_0xaa75('0x56')]=_0x3ad4c8;_0x2b6db6[_0xaa75('0x6c')]=_0x2bdb02;var _0x267ed5={'id':_0x2b6db6['id'],'name':_0x2b6db6[_0xaa75('0x4f')],'agentconnected':!![],'destaccountcode':_0x2b6db6[_0xaa75('0x44')],'destconnectedlinenum':_0x267269[_0xaa75('0x3f')],'queue':_0x3ad4c8||undefined,'routealias':_0x2bdb02,'uniqueid':_0x267269[_0xaa75('0x37')]};logger[_0xaa75('0x35')](_0xaa75('0x6d'),_0x267269[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x267ed5,{'showHidden':![],'depth':null}));this[_0xaa75('0x30')](util[_0xaa75('0x43')](_0xaa75('0x4e'),_0x2b6db6[_0xaa75('0x4f')]),'user:agentconnect',_0x267ed5);}}}}catch(_0x239326){logger[_0xaa75('0x2c')](_0xaa75('0x6e'),_0x267269[_0xaa75('0x33')],util['inspect'](_0x239326,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')]['syncMixMonitorFilename']=function(_0x5e5f2b,_0x202e73){try{if(this[_0xaa75('0x13')][_0x5e5f2b]){logger[_0xaa75('0x2a')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5e5f2b,_0x202e73);this[_0xaa75('0x13')][_0x5e5f2b]['monitor']=!![];if(_[_0xaa75('0x6f')](_0x202e73,_0xaa75('0x70'))){_0x202e73=_0x202e73[_0xaa75('0x71')](_0xaa75('0x70'),_0xaa75('0x72'));}this[_0xaa75('0x13')][_0x5e5f2b][_0xaa75('0x73')]=_0x202e73;var _0x4d63c2=_[_0xaa75('0x74')](this[_0xaa75('0x13')][_0x5e5f2b][_0xaa75('0x75')],{'filename':_0x202e73});if(_[_0xaa75('0x76')](_0x4d63c2)){this['channels'][_0x5e5f2b][_0xaa75('0x75')][_0xaa75('0x77')]({'filename':_0x202e73,'createdAt':moment()[_0xaa75('0x43')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xaa75('0x78')});}}}catch(_0x3360ad){logger[_0xaa75('0x2c')](_0xaa75('0x79'),_0x5e5f2b,util['inspect'](_0x3360ad,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaa75('0x1f')]=function(_0x3e8ef7){try{if(this[_0xaa75('0x31')](_0x3e8ef7)){logger[_0xaa75('0x35')](_0xaa75('0x7a'),_0x3e8ef7[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x3e8ef7,{'showHidden':![],'depth':null}));if(this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]]&&_0x3e8ef7[_0xaa75('0x3d')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x3e8ef7['variable'])){if(this['isNotNull'](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x7c')])){logger[_0xaa75('0x2a')](_0xaa75('0x7d'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]);this[_0xaa75('0x7f')](_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]);}else if(this[_0xaa75('0x31')](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x80')])){logger[_0xaa75('0x2a')](_0xaa75('0x81'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]);this['channels'][_0x3e8ef7['uniqueid']]['calleridnum']=_0x3e8ef7['value'];}else if(this[_0xaa75('0x31')](_0x3e8ef7['variable']['xmd-callerid'])){logger[_0xaa75('0x2a')](_0xaa75('0x82'),_0x3e8ef7['uniqueid'],_0x3e8ef7[_0xaa75('0x7e')]);this['channels'][_0x3e8ef7[_0xaa75('0x33')]]['callerid']=_0x3e8ef7[_0xaa75('0x7e')];}else if(this['isNotNull'](_0x3e8ef7[_0xaa75('0x7b')]['xmd-cdrtype'])){logger[_0xaa75('0x2a')](_0xaa75('0x83'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7['value']);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]][_0xaa75('0x5f')]=_0x3e8ef7['value'];}else if(this[_0xaa75('0x31')](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x84')])){logger[_0xaa75('0x2a')](_0xaa75('0x85'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]['split'](',')[0x0]);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]][_0xaa75('0x56')]=_0x3e8ef7[_0xaa75('0x7e')][_0xaa75('0x3e')](',')[0x0];}else if(this['isNotNull'](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x86')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]]['originatecalleridnum']=_0x3e8ef7['value'];}else if(this[_0xaa75('0x31')](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x87')])){logger[_0xaa75('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]][_0xaa75('0x88')]=_0x3e8ef7[_0xaa75('0x7e')];}else if(this[_0xaa75('0x31')](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x89')])){logger[_0xaa75('0x2a')](_0xaa75('0x8a'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7[_0xaa75('0x7e')]);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]]['calleridpreview']=_0x3e8ef7[_0xaa75('0x7e')];}else if(this['isNotNull'](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x8b')])){logger['info'](_0xaa75('0x8c'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7['value']);this[_0xaa75('0x13')][_0x3e8ef7['uniqueid']][_0xaa75('0x56')]=_0x3e8ef7[_0xaa75('0x7e')];}else if(this[_0xaa75('0x31')](_0x3e8ef7['variable'][_0xaa75('0x8d')])){logger[_0xaa75('0x2a')](_0xaa75('0x8e'),_0x3e8ef7[_0xaa75('0x33')],_0x3e8ef7['value']);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x33')]]['sipcalluniqueid']=_0x3e8ef7[_0xaa75('0x7e')];}}}else if(this['isNotNull'](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x7c')])){if(_0x3e8ef7[_0xaa75('0x7e')]){var _0x3d6844=path['parse'](_0x3e8ef7[_0xaa75('0x7e')])[_0xaa75('0x4f')];logger[_0xaa75('0x2a')](_0xaa75('0x7d'),_0x3d6844,_0x3e8ef7[_0xaa75('0x7e')]);this['syncMixMonitorFilename'](_0x3d6844,_0x3e8ef7[_0xaa75('0x7e')]);}}else if(this[_0xaa75('0x13')][_0x3e8ef7['linkedid']]){if(this['isNotNull'](_0x3e8ef7[_0xaa75('0x7b')])){if(this[_0xaa75('0x31')](_0x3e8ef7[_0xaa75('0x7b')][_0xaa75('0x8d')])){logger[_0xaa75('0x2a')](_0xaa75('0x8e'),_0x3e8ef7['linkedid'],_0x3e8ef7[_0xaa75('0x7e')]);this[_0xaa75('0x13')][_0x3e8ef7[_0xaa75('0x37')]][_0xaa75('0x8f')]=_0x3e8ef7[_0xaa75('0x7e')];}}}}}catch(_0x317925){logger[_0xaa75('0x2c')](_0xaa75('0x90'),_0x3e8ef7[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x317925,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')][_0xaa75('0x20')]=function(_0x5cce15){try{if(this[_0xaa75('0x31')](_0x5cce15)){logger['debug'](_0xaa75('0x91'),_0x5cce15['uniqueid'],util['inspect'](_0x5cce15,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x5cce15[_0xaa75('0x37')]]){if(this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x37')]]){this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x37')]]['uniqueid']=_0x5cce15[_0xaa75('0x33')];this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15['linkedid']][_0xaa75('0x37')]][_0xaa75('0x63')]=this['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x63')];this[_0xaa75('0x13')][this['blindTransfers'][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x37')]]['answertime']=this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]]['answertime'];this['channels'][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x37')]][_0xaa75('0x68')]=this[_0xaa75('0x13')][this['blindTransfers'][_0x5cce15['linkedid']]['linkedid']][_0xaa75('0x3d')];this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x37')]]['disposition']=this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x5b')];this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]]=this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15['linkedid']][_0xaa75('0x37')]];delete this[_0xaa75('0x13')][this['blindTransfers'][_0x5cce15['linkedid']]['linkedid']];}else if(this[_0xaa75('0x13')][this['blindTransfers'][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]]){this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15['linkedid']]['uniqueid']][_0xaa75('0x33')]=[this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15['linkedid']][_0xaa75('0x33')]][_0xaa75('0x37')],this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15['linkedid']]['uniqueid']][_0xaa75('0x37')]=this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]]['uniqueid']][_0xaa75('0x33')]][0x0];this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]][_0xaa75('0x63')]=this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x63')];this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]]['answertime']=this['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x64')];this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]][_0xaa75('0x68')]=this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]]['channel'];this['channels'][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]][_0xaa75('0x5b')]=this['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x5b')];this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]]=this['channels'][this['blindTransfers'][_0x5cce15['linkedid']]['uniqueid']];delete this[_0xaa75('0x13')][this[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x37')]][_0xaa75('0x33')]];}}if(this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]]){logger['info'](_0xaa75('0x92'),_0x5cce15[_0xaa75('0x33')],_0x5cce15[_0xaa75('0x93')]);var _0x1a7c30=moment();this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x94')]=_0x1a7c30[_0xaa75('0x43')](_0xaa75('0x4a'));this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x58')]=_0x1a7c30[_0xaa75('0x66')](this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x49')],_0xaa75('0x5a'));if(this['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x63')]){this['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x95')]=_0x1a7c30[_0xaa75('0x66')](this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x64')],'seconds');this['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x65')]=this['channels'][_0x5cce15['uniqueid']]['duration']-this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]]['billableseconds'];}if(_0x5cce15[_0xaa75('0x3b')]===_0xaa75('0x3c')){if(this[_0xaa75('0x14')][_0x5cce15[_0xaa75('0x3d')]['split']('-')[0x0]]){this[_0xaa75('0x14')][_0x5cce15['channel']['split']('-')[0x0]]=_[_0xaa75('0x96')](this[_0xaa75('0x14')][_0x5cce15[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]],[_0xaa75('0x41')]);logger['debug'](_0xaa75('0x97'),_0x5cce15['uniqueid'],util[_0xaa75('0x2d')]({'id':this[_0xaa75('0x14')][_0x5cce15['channel'][_0xaa75('0x3e')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5cce15[_0xaa75('0x3d')][_0xaa75('0x3e')]('-')[0x0]][_0xaa75('0x44')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xaa75('0x4e'),this['agents'][_0x5cce15[_0xaa75('0x3d')]['split']('-')[0x0]]['name']),_0xaa75('0x98'),{'id':this[_0xaa75('0x14')][_0x5cce15[_0xaa75('0x3d')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xaa75('0x14')][_0x5cce15['channel'][_0xaa75('0x3e')]('-')[0x0]][_0xaa75('0x44')]});for(var _0x16373f=0x0;_0x16373f<Object[_0xaa75('0x3a')](this['agents'])[_0xaa75('0x99')];_0x16373f++){var _0x3097d6=Object[_0xaa75('0x3a')](this[_0xaa75('0x14')])[_0x16373f];var _0x990e38=this['agents'][_0x3097d6];if(_0x990e38[_0xaa75('0x44')]===Number(this['channels'][_0x5cce15['uniqueid']]['connectedlinenum'])){this[_0xaa75('0x30')](util[_0xaa75('0x43')](_0xaa75('0x4e'),_0x990e38['name']),_0xaa75('0x98'),{'id':_0x990e38['id'],'destaccountcode':_0x990e38['accountcode'],'transfer':this[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x9a')]});break;}}}}var _0x819496=this;Promise[_0xaa75('0x9b')]()[_0xaa75('0x9c')](function(){var _0x4d29e7=_0x819496[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]];if(typeof _0x4d29e7[_0xaa75('0x9a')]===_0xaa75('0x4d'))return;if(_[_0xaa75('0x9d')](_0x4d29e7[_0xaa75('0x75')]))return;return RpcSetting[_0xaa75('0x9e')]()['then'](function(_0x59f14e){if(!_0x59f14e[_0xaa75('0x9f')])return;return Promise[_0xaa75('0x9b')]()['then'](function(){return ami[_0xaa75('0xa0')]({'action':_0xaa75('0xa1'),'channel':_0x4d29e7['channel']})[_0xaa75('0xa2')](function(){});})[_0xaa75('0x9c')](function(){return ami[_0xaa75('0xa0')]({'action':'StopMixMonitor','channel':_0x4d29e7['destinationchannel']})[_0xaa75('0xa2')](function(){})[_0xaa75('0xa3')](function(){var _0x139212=_0x819496[_0xaa75('0x14')][_0x4d29e7[_0xaa75('0x68')][_0xaa75('0x3e')]('-')[0x0]];if(!_0x139212)return;io['emit']('webbar:stopmonitors',{'agentId':_0x139212['id'],'uniqueid':_0x4d29e7[_0xaa75('0x33')]});});});});})[_0xaa75('0x9c')](function(){if(_0x5cce15[_0xaa75('0xa4')]===_0xaa75('0xa5')){_0x819496[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x33')]]=_0x5cce15;}else{if(_0x819496[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x5f')]===_0xaa75('0xa6')&&_0x819496[_0xaa75('0x15')][_0x5cce15[_0xaa75('0x33')]]){_0x819496[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x33')]=[_0x819496['channels'][_0x5cce15[_0xaa75('0x33')]][_0xaa75('0x37')],_0x819496[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]]['linkedid']=_0x819496[_0xaa75('0x13')][_0x5cce15['uniqueid']]['uniqueid']][0x0];delete _0x819496['blindTransfers'][_0x5cce15[_0xaa75('0x33')]];}}logger[_0xaa75('0x35')](_0xaa75('0xa7'),_0x5cce15[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x819496['channels'][_0x5cce15[_0xaa75('0x33')]],{'showHidden':![],'depth':null}));ami[_0xaa75('0x30')](_0xaa75('0xa8'),_0x819496[_0xaa75('0x13')][_0x5cce15['uniqueid']]);delete _0x819496[_0xaa75('0x13')][_0x5cce15[_0xaa75('0x33')]];});}}}catch(_0x24bb18){logger[_0xaa75('0x2c')]('[%s][voiceCallReport][hangup]',_0x5cce15[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x24bb18,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')][_0xaa75('0x24')]=function(_0x430f7f){try{if(this[_0xaa75('0x31')](_0x430f7f)){logger[_0xaa75('0x2a')](_0xaa75('0xa9'),_0x430f7f['uniqueid'],_0x430f7f[_0xaa75('0xaa')],_0x430f7f[_0xaa75('0xab')]);logger[_0xaa75('0x35')](_0xaa75('0xac'),_0x430f7f[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x430f7f,{'showHidden':![],'depth':null}));var _0x44d93f;if(this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xad')]]){this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xad')]]['transfercalleridnum']=_0x430f7f[_0xaa75('0xaa')];this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xad')]]['transferconnectedlinenum']=_0x430f7f[_0xaa75('0xab')];if(this[_0xaa75('0x13')][_0x430f7f['secondtransfereruniqueid']]){_0x44d93f=this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xae')]];this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xae')]]=this['channels'][_0x430f7f[_0xaa75('0xad')]];this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xad')]]=_0x44d93f;}this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xae')]][_0xaa75('0x9a')]=_0xaa75('0xaf');}else if(this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb0')]]){this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb0')]][_0xaa75('0xb1')]=_0x430f7f[_0xaa75('0xaa')];this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb0')]]['transferconnectedlinenum']=_0x430f7f['transfertargetcalleridnum'];if(this['channels'][_0x430f7f[_0xaa75('0xb2')]]){_0x44d93f=this['channels'][_0x430f7f[_0xaa75('0xb2')]];this[_0xaa75('0x13')][_0x430f7f['origtransfereruniqueid']]=this[_0xaa75('0x13')][_0x430f7f['transfertargetuniqueid']];this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb0')]]=_0x44d93f;}this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb0')]][_0xaa75('0x9a')]=_0xaa75('0xaf');}if((this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb2')]]||this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb3')]])&&this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xae')]]){var _0x3487b6=_[_0xaa75('0xb4')]([this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb2')]],this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb3')]],this['channels'][_0x430f7f[_0xaa75('0xae')]]],function(_0x349259){return _0x349259&&_0x349259[_0xaa75('0x5f')]===_0xaa75('0xa6')&&_0x349259[_0xaa75('0xb5')];});if(_0x3487b6){if(this[_0xaa75('0x13')][_0x430f7f['origtransfereruniqueid']])this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb2')]][_0xaa75('0x9a')]=_0xaa75('0xaf');if(this[_0xaa75('0x13')][_0x430f7f['origtransfererlinkedid']])this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xb3')]][_0xaa75('0x9a')]=_0xaa75('0xaf');this[_0xaa75('0x13')][_0x430f7f[_0xaa75('0xae')]]['transferType']='ATTENDED';}}}}catch(_0x9d3bbf){logger['error'](_0xaa75('0xb6'),_0x430f7f[_0xaa75('0x33')],util['inspect'](_0x9d3bbf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')][_0xaa75('0x25')]=function(_0x36c242){try{if(this[_0xaa75('0x31')](_0x36c242)){logger[_0xaa75('0x2a')](_0xaa75('0xb7'),_0x36c242[_0xaa75('0x33')],_0x36c242[_0xaa75('0xb8')],_0x36c242[_0xaa75('0xb9')]);logger[_0xaa75('0x35')](_0xaa75('0xba'),_0x36c242['uniqueid'],util[_0xaa75('0x2d')](_0x36c242,{'showHidden':![],'depth':null}));if(this[_0xaa75('0x13')][_0x36c242[_0xaa75('0xad')]]){this[_0xaa75('0x13')][_0x36c242['transfereeuniqueid']][_0xaa75('0xb1')]=_0x36c242[_0xaa75('0xb8')];this[_0xaa75('0x13')][_0x36c242[_0xaa75('0xad')]][_0xaa75('0xbb')]=_0x36c242['extension'];this['channels'][_0x36c242[_0xaa75('0xad')]][_0xaa75('0x9a')]=_0xaa75('0xbc');this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x36c242[_0xaa75('0xad')],'linkedid':_0x36c242[_0xaa75('0xbd')],'context':_0x36c242[_0xaa75('0x3b')],'channel':_0x36c242['transfererchannel']});}else{this[_0xaa75('0x13')][_0x36c242[_0xaa75('0xbd')]]['transferType']=_0xaa75('0xbc');this[_0xaa75('0x20')]({'event':_0xaa75('0xa5'),'uniqueid':_0x36c242[_0xaa75('0xbd')],'linkedid':_0x36c242[_0xaa75('0xad')],'context':_0x36c242[_0xaa75('0x3b')],'channel':_0x36c242[_0xaa75('0xbe')]});}}}catch(_0x471f89){logger[_0xaa75('0x2c')](_0xaa75('0xbf'),_0x36c242[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x471f89,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')]['syncMusicOnHoldStart']=function(_0x23c36d){try{if(this[_0xaa75('0x31')](_0x23c36d)){logger[_0xaa75('0x35')](_0xaa75('0xc0'),_0x23c36d[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x23c36d,{'showHidden':![],'depth':null}));if(this[_0xaa75('0x13')][_0x23c36d['uniqueid']]){if(!_[_0xaa75('0x76')](this[_0xaa75('0x13')][_0x23c36d['uniqueid']][_0xaa75('0x64')])){this[_0xaa75('0x13')][_0x23c36d[_0xaa75('0x33')]]['mohstarttime']=moment()[_0xaa75('0x43')](_0xaa75('0x4a'));logger['info'](_0xaa75('0xc1'),_0x23c36d[_0xaa75('0x33')],this[_0xaa75('0x13')][_0x23c36d[_0xaa75('0x33')]][_0xaa75('0xc2')]);}}}}catch(_0x4aa2e4){logger[_0xaa75('0x2c')](_0xaa75('0xc3'),_0x23c36d[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x4aa2e4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaa75('0x2e')][_0xaa75('0x29')]=function(_0x2142a9){try{if(this['isNotNull'](_0x2142a9)){logger[_0xaa75('0x35')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x2142a9['uniqueid'],util[_0xaa75('0x2d')](_0x2142a9,{'showHidden':![],'depth':null}));if(this[_0xaa75('0x13')][_0x2142a9[_0xaa75('0x33')]]){if(!_['isNil'](this[_0xaa75('0x13')][_0x2142a9[_0xaa75('0x33')]]['mohstarttime'])){this[_0xaa75('0x13')][_0x2142a9[_0xaa75('0x33')]]['mohtime']+=moment()[_0xaa75('0xc4')](0x0)[_0xaa75('0x66')](this[_0xaa75('0x13')][_0x2142a9['uniqueid']][_0xaa75('0xc2')],'seconds');logger[_0xaa75('0x2a')](_0xaa75('0xc5'),_0x2142a9[_0xaa75('0x33')],this[_0xaa75('0x13')][_0x2142a9[_0xaa75('0x33')]][_0xaa75('0xc6')]);delete this[_0xaa75('0x13')][_0x2142a9[_0xaa75('0x33')]][_0xaa75('0xc2')];}}}}catch(_0x22cfb7){logger[_0xaa75('0x2c')](_0xaa75('0xc7'),_0x2142a9[_0xaa75('0x33')],util[_0xaa75('0x2d')](_0x22cfb7,{'showHidden':![],'depth':null}));}};module[_0xaa75('0xc8')]=VoiceCallReport;
\ No newline at end of file
index 8f72e3c..c04920e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1883=['addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','starttime','lastevent','complete','total','answertime','answered','holdtime','diff','seconds','billableseconds','sumHoldTime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','dialbegin','bind','dialend','syncDialEnd','syncVarSet','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','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','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','variable','value','outboundrouteid','variables','voice','keys'];(function(_0x30bf81,_0x4c00c5){var _0x148a30=function(_0x320430){while(--_0x320430){_0x30bf81['push'](_0x30bf81['shift']());}};_0x148a30(++_0x4c00c5);}(_0x1883,0xab));var _0x3188=function(_0x455b2a,_0x2a368c){_0x455b2a=_0x455b2a-0x0;var _0x2ed193=_0x1883[_0x455b2a];return _0x2ed193;};'use strict';var _=require(_0x3188('0x0'));var moment=require(_0x3188('0x1'));var util=require(_0x3188('0x2'));var Redis=require(_0x3188('0x3'));var config=require(_0x3188('0x4'));var logger=require(_0x3188('0x5'))(_0x3188('0x6'));var ami=require(_0x3188('0x7'));config[_0x3188('0x8')]=_[_0x3188('0x9')](config[_0x3188('0x8')],{'host':_0x3188('0xa'),'port':0x18eb});var io=require(_0x3188('0xb'))(new Redis(config[_0x3188('0x8')]));function VoiceDialReport(_0x24f2f1){this[_0x3188('0xc')]=_0x24f2f1[_0x3188('0xd')];this['outbound']=_0x24f2f1[_0x3188('0xe')];this[_0x3188('0xf')]={};this['variables']={};ami['on'](_0x3188('0x10'),this['syncDialBegin'][_0x3188('0x11')](this));ami['on'](_0x3188('0x12'),this[_0x3188('0x13')][_0x3188('0x11')](this));ami['on']('varset',this[_0x3188('0x14')][_0x3188('0x11')](this));ami['on']('hangup',this['syncHangup'][_0x3188('0x11')](this));}VoiceDialReport[_0x3188('0x15')][_0x3188('0x16')]=function(_0x3ae228){return _0x3ae228!==null&&!_[_0x3188('0x17')](_0x3ae228);};VoiceDialReport[_0x3188('0x15')]['emit']=function(_0x276d69,_0x5e0044,_0x4a2f36){io['to'](_0x276d69)[_0x3188('0x18')](_0x5e0044,_0x4a2f36);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x32c239){try{if(this[_0x3188('0x16')](_0x32c239)){logger[_0x3188('0x19')](_0x3188('0x1a'),_0x32c239[_0x3188('0x1b')],util[_0x3188('0x1c')](_0x32c239,{'showHidden':![],'depth':null}));if(this['channels'][_0x32c239[_0x3188('0x1b')]]){_[_0x3188('0x1d')](this[_0x3188('0xc')][_0x32c239[_0x3188('0x1b')]],{'starttime':moment()[_0x3188('0x1e')](_0x3188('0x1f')),'lastevent':_0x3188('0x20'),'interface':_0x32c239[_0x3188('0x21')]['substring'](0x0,_0x32c239[_0x3188('0x21')][_0x3188('0x22')]('-')),'membername':_0x32c239['channel']['substring'](_0x32c239['channel'][_0x3188('0x22')]('/')+0x1,_0x32c239[_0x3188('0x21')][_0x3188('0x22')]('-'))},_['omit'](_0x32c239,['event',_0x3188('0x23')]));logger[_0x3188('0x24')](_0x3188('0x25'),_0x32c239[_0x3188('0x1b')],this[_0x3188('0xc')][_0x32c239['uniqueid']][_0x3188('0x26')],this[_0x3188('0xc')][_0x32c239['uniqueid']][_0x3188('0x27')]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x32c239[_0x3188('0x1b')],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x32c239[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x3188('0xf')][_0x32c239[_0x3188('0x1b')]])_[_0x3188('0x1d')](this[_0x3188('0xc')][_0x32c239['uniqueid']],this[_0x3188('0xf')][_0x32c239[_0x3188('0x1b')]]);this['emit'](_0x3188('0x28'),_0x3188('0x29'),this[_0x3188('0xc')][_0x32c239[_0x3188('0x1b')]]);logger[_0x3188('0x19')](_0x3188('0x2a'),_0x32c239[_0x3188('0x1b')],util[_0x3188('0x1c')](this['channels'][_0x32c239[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3188('0x2b'),this['channels'][_0x32c239[_0x3188('0x1b')]]);}}}catch(_0x80f9a8){logger[_0x3188('0x2c')](_0x3188('0x2d'),_0x32c239[_0x3188('0x1b')],util[_0x3188('0x1c')](_0x80f9a8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3188('0x15')][_0x3188('0x13')]=function(_0x3188a1){try{if(this[_0x3188('0x16')](_0x3188a1)){logger[_0x3188('0x19')](_0x3188('0x2e'),_0x3188a1[_0x3188('0x1b')],util[_0x3188('0x1c')](_0x3188a1,{'showHidden':![],'depth':null}));if(this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]]){this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]]['dialstatus']=_0x3188a1[_0x3188('0x2f')];if(_0x3188a1['dialstatus']===_0x3188('0x30')){this[_0x3188('0xc')][_0x3188a1['uniqueid']][_0x3188('0x31')]=_0x3188a1[_0x3188('0x31')];this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]][_0x3188('0x32')]=_0x3188a1[_0x3188('0x32')];this[_0x3188('0xc')][_0x3188a1['uniqueid']]['answertime']=moment()[_0x3188('0x1e')](_0x3188('0x1f'));this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]]['lastevent']=_0x3188('0x33');logger[_0x3188('0x24')](_0x3188('0x34'),_0x3188a1[_0x3188('0x1b')],_0x3188a1['channel'][_0x3188('0x35')](_0x3188a1['channel'][_0x3188('0x22')]('/')+0x1,_0x3188a1['channel'][_0x3188('0x22')]('-')));logger[_0x3188('0x19')](_0x3188('0x36'),_0x3188a1[_0x3188('0x1b')],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x3188('0x18')](_0x3188('0x37'),this[_0x3188('0xc')][_0x3188a1['uniqueid']]);}logger[_0x3188('0x19')](_0x3188('0x38'),_0x3188a1[_0x3188('0x1b')],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x3188('0x28'),'voice_outbound_channel:save',this[_0x3188('0xc')][_0x3188a1[_0x3188('0x1b')]]);}}}catch(_0xb9a025){logger[_0x3188('0x2c')](_0x3188('0x39'),_0x3188a1['uniqueid'],util['inspect'](_0xb9a025,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x4b9ed3){try{if(this[_0x3188('0x16')](_0x4b9ed3)){logger[_0x3188('0x19')](_0x3188('0x3a'),_0x4b9ed3[_0x3188('0x1b')],util[_0x3188('0x1c')](_0x4b9ed3,{'showHidden':![],'depth':null}));this['addVariable'](_0x4b9ed3[_0x3188('0x1b')],_['keys'](_0x4b9ed3[_0x3188('0x3b')])[0x0],_0x4b9ed3[_0x3188('0x3c')]);if(this[_0x3188('0x16')](_0x4b9ed3[_0x3188('0x3b')])&&this['isNotNull'](_0x4b9ed3[_0x3188('0x3b')][_0x3188('0x3d')])){if(_[_0x3188('0x17')](this[_0x3188('0xc')][_0x4b9ed3[_0x3188('0x1b')]])){this['channels'][_0x4b9ed3['uniqueid']]={'routeId':_0x4b9ed3[_0x3188('0x3c')],'variables':this[_0x3188('0x3e')][_0x4b9ed3['uniqueid']],'motionChannel':_0x3188('0x3f')};logger[_0x3188('0x24')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x4b9ed3[_0x3188('0x1b')],_0x4b9ed3[_0x3188('0x3b')][_0x3188('0x3d')],_[_0x3188('0x40')](_0x4b9ed3[_0x3188('0x3b')])[0x0],_0x4b9ed3['value']);logger[_0x3188('0x19')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4b9ed3[_0x3188('0x1b')],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x4b9ed3[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3188('0x18')](_0x3188('0x28'),_0x3188('0x29'),this[_0x3188('0xc')][_0x4b9ed3[_0x3188('0x1b')]]);}}}}catch(_0xf21263){logger[_0x3188('0x2c')]('[%s][voiceDialReport][varset]',_0x4b9ed3['uniqueid'],util[_0x3188('0x1c')](_0xf21263,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x3188('0x41')]=function(_0x3efc29,_0x4e643f,_0x3abc6b){var _0x16417a=[_0x3188('0x42'),_0x3188('0x43'),_0x3188('0x44'),_0x3188('0x45'),_0x3188('0x46'),_0x3188('0x47'),'rtpaudioqosrtt',_0x3188('0x48'),_0x3188('0x49'),'sipuri',_0x3188('0x4a'),'bridgepvtcallid',_0x3188('0x4b'),_0x3188('0x4c'),_0x3188('0x4d'),'memberlastcall','membername','memberpenalty','memberrealtime'];if(!_['isNil'](_0x4e643f)&&!_[_0x3188('0x4e')](_0x16417a,_0x4e643f)){if(_[_0x3188('0x17')](this['variables'][_0x3efc29])){this[_0x3188('0x3e')][_0x3efc29]={};}this[_0x3188('0x3e')][_0x3efc29][_0x4e643f]=_0x3abc6b;}};VoiceDialReport['prototype']['syncHangup']=function(_0x53d604){try{if(this['isNotNull'](_0x53d604)){logger['debug'](_0x3188('0x4f'),_0x53d604[_0x3188('0x1b')],util[_0x3188('0x1c')](_0x53d604,{'showHidden':![],'depth':null}));if(this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]]){logger['info'](_0x3188('0x50'),_0x53d604[_0x3188('0x1b')],_0x53d604['cause-txt']);this['channels'][_0x53d604['uniqueid']][_0x3188('0x51')]=moment()[_0x3188('0x1e')](_0x3188('0x1f'));this['channels'][_0x53d604[_0x3188('0x1b')]][_0x3188('0x52')]=moment(this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x51')])['diff'](this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x53')],'seconds');this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x54')]=_0x3188('0x55');this['outbound'][_0x3188('0x56')]+=0x1;if(this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x57')]){this[_0x3188('0xe')][_0x3188('0x58')]+=0x1;this[_0x3188('0xc')][_0x53d604['uniqueid']][_0x3188('0x59')]=moment(this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x57')])[_0x3188('0x5a')](this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]]['starttime'],_0x3188('0x5b'));this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x5c')]=moment(this[_0x3188('0xc')][_0x53d604['uniqueid']][_0x3188('0x51')])[_0x3188('0x5a')](this['channels'][_0x53d604['uniqueid']][_0x3188('0x57')],_0x3188('0x5b'));this[_0x3188('0xe')][_0x3188('0x5d')]+=this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]][_0x3188('0x59')]||0x0;this[_0x3188('0xe')][_0x3188('0x5e')]+=this[_0x3188('0xc')][_0x53d604['uniqueid']][_0x3188('0x5c')];}this['outbound']['sumDuration']+=this[_0x3188('0xc')][_0x53d604['uniqueid']][_0x3188('0x52')];logger[_0x3188('0x19')](_0x3188('0x5f'),_0x53d604[_0x3188('0x1b')],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x53d604['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x3188('0x18')](_0x3188('0x60'),this['channels'][_0x53d604[_0x3188('0x1b')]]);logger[_0x3188('0x19')](_0x3188('0x61'),_0x53d604[_0x3188('0x1b')],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x53d604['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x3188('0x18')](_0x3188('0x62'),this['channels'][_0x53d604[_0x3188('0x1b')]]);logger[_0x3188('0x19')](_0x3188('0x63'),_0x53d604['uniqueid'],util[_0x3188('0x1c')](this[_0x3188('0xc')][_0x53d604[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3188('0x18')](_0x3188('0x28'),_0x3188('0x64'),this[_0x3188('0xe')]);logger['info']('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this['channels'][_0x53d604[_0x3188('0x1b')]]));logger[_0x3188('0x19')](_0x3188('0x65'),_0x53d604[_0x3188('0x1b')],util[_0x3188('0x1c')](this['channels'][_0x53d604[_0x3188('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x3188('0x28'),_0x3188('0x66'),this['channels'][_0x53d604[_0x3188('0x1b')]]);delete this['channels'][_0x53d604[_0x3188('0x1b')]];}else if(this[_0x3188('0xc')][_0x53d604['linkedid']]){this[_0x3188('0xc')][_0x53d604['linkedid']][_0x3188('0x1b')]=this[_0x3188('0xc')][_0x53d604[_0x3188('0x67')]][_0x3188('0x68')];}if(this[_0x3188('0x3e')][_0x53d604['uniqueid']]){delete this[_0x3188('0x3e')][_0x53d604[_0x3188('0x1b')]];}}}catch(_0x562449){logger[_0x3188('0x2c')](_0x3188('0x69'),_0x53d604['uniqueid'],util['inspect'](_0x562449,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3188('0x15')][_0x3188('0x6a')]=function(_0x1c98d1){try{if(this[_0x3188('0x16')](_0x1c98d1)){logger[_0x3188('0x19')](_0x3188('0x6b'),_0x1c98d1['uniqueid'],util[_0x3188('0x1c')](_0x1c98d1,{'showHidden':![],'depth':null}));if(_0x1c98d1[_0x3188('0x6c')][_0x3188('0x6d')]()==='set'){_0x1c98d1[_0x3188('0x6e')]=(_0x1c98d1[_0x3188('0x6f')]||_0x1c98d1[_0x3188('0x6e')])[_0x3188('0x6d')]();if(_[_0x3188('0x70')](_0x1c98d1[_0x3188('0x6e')],'cdr(')){if(_['isUndefined'](this['applications'][_0x1c98d1[_0x3188('0x1b')]]))this[_0x3188('0xf')][_0x1c98d1['uniqueid']]={};logger[_0x3188('0x24')](_0x3188('0x71'),_0x1c98d1[_0x3188('0x1b')],_0x1c98d1[_0x3188('0x6c')],_0x1c98d1[_0x3188('0x6e')]);var _0x2604ef=_0x1c98d1['applicationdata'][_0x3188('0x72')]('=');var _0x7216ab=_0x2604ef[0x0][_0x3188('0x73')](/cdr\((.*)\)/);if(_0x7216ab)this[_0x3188('0xf')][_0x1c98d1[_0x3188('0x1b')]][_0x7216ab[0x1]]=_0x2604ef[0x1];}}}}catch(_0x3849c3){logger[_0x3188('0x2c')](_0x3188('0x74'),_0x1c98d1[_0x3188('0x1b')],util[_0x3188('0x1c')](_0x3849c3,{'showHidden':![],'depth':null}));}};module[_0x3188('0x75')]=VoiceDialReport;
\ No newline at end of file
+var _0xe14b=['total','answered','holdtime','answertime','billableseconds','endtime','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','application','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','info','membername','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','[%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][dialend]','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','format','duration','diff','starttime','seconds','complete','outbound'];(function(_0x1da6ea,_0xfe563a){var _0x5d046b=function(_0x2b4788){while(--_0x2b4788){_0x1da6ea['push'](_0x1da6ea['shift']());}};_0x5d046b(++_0xfe563a);}(_0xe14b,0x93));var _0xbe14=function(_0x4f58a3,_0x4cc273){_0x4f58a3=_0x4f58a3-0x0;var _0x1412a1=_0xe14b[_0x4f58a3];return _0x1412a1;};'use strict';var _=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xbe14('0x2'));var logger=require(_0xbe14('0x3'))('ami');var ami=require(_0xbe14('0x4'));config['redis']=_['defaults'](config[_0xbe14('0x5')],{'host':_0xbe14('0x6'),'port':0x18eb});var io=require(_0xbe14('0x7'))(new Redis(config[_0xbe14('0x5')]));function VoiceDialReport(_0x1d9ade){this[_0xbe14('0x8')]=_0x1d9ade[_0xbe14('0x9')];this['outbound']=_0x1d9ade['outbound'];this['applications']={};this[_0xbe14('0xa')]={};ami['on'](_0xbe14('0xb'),this[_0xbe14('0xc')][_0xbe14('0xd')](this));ami['on']('dialend',this['syncDialEnd'][_0xbe14('0xd')](this));ami['on'](_0xbe14('0xe'),this['syncVarSet'][_0xbe14('0xd')](this));ami['on'](_0xbe14('0xf'),this[_0xbe14('0x10')][_0xbe14('0xd')](this));}VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x12')]=function(_0x23a730){return _0x23a730!==null&&!_[_0xbe14('0x13')](_0x23a730);};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x14')]=function(_0x1e4826,_0x33fd54,_0x813399){io['to'](_0x1e4826)['emit'](_0x33fd54,_0x813399);};VoiceDialReport['prototype'][_0xbe14('0xc')]=function(_0x3dc4a9){try{if(this[_0xbe14('0x12')](_0x3dc4a9)){logger[_0xbe14('0x15')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x3dc4a9,{'showHidden':![],'depth':null}));if(this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]]){_[_0xbe14('0x18')](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],{'starttime':moment()['format'](_0xbe14('0x19')),'lastevent':_0xbe14('0x1a'),'interface':_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1c')](0x0,_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1d')]('-')),'membername':_0x3dc4a9['channel'][_0xbe14('0x1c')](_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1d')]('/')+0x1,_0x3dc4a9[_0xbe14('0x1b')][_0xbe14('0x1d')]('-'))},_['omit'](_0x3dc4a9,[_0xbe14('0x1e'),'privilege']));logger[_0xbe14('0x1f')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x3dc4a9[_0xbe14('0x16')],this['channels'][_0x3dc4a9[_0xbe14('0x16')]][_0xbe14('0x20')],this['channels'][_0x3dc4a9[_0xbe14('0x16')]]['interface']);logger[_0xbe14('0x15')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));if(this[_0xbe14('0x21')][_0x3dc4a9[_0xbe14('0x16')]])_['merge'](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],this[_0xbe14('0x21')][_0x3dc4a9[_0xbe14('0x16')]]);this['emit'](_0xbe14('0x22'),_0xbe14('0x23'),this['channels'][_0x3dc4a9[_0xbe14('0x16')]]);logger[_0xbe14('0x15')](_0xbe14('0x24'),_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x25'),this[_0xbe14('0x8')][_0x3dc4a9[_0xbe14('0x16')]]);}}}catch(_0x3bf43c){logger[_0xbe14('0x26')](_0xbe14('0x27'),_0x3dc4a9[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x3bf43c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x28')]=function(_0x29e76a){try{if(this[_0xbe14('0x12')](_0x29e76a)){logger['debug'](_0xbe14('0x29'),_0x29e76a['uniqueid'],util['inspect'](_0x29e76a,{'showHidden':![],'depth':null}));if(this[_0xbe14('0x8')][_0x29e76a['uniqueid']]){this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]]['dialstatus']=_0x29e76a['dialstatus'];if(_0x29e76a['dialstatus']===_0xbe14('0x2a')){this[_0xbe14('0x8')][_0x29e76a['uniqueid']][_0xbe14('0x2b')]=_0x29e76a[_0xbe14('0x2b')];this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]][_0xbe14('0x2c')]=_0x29e76a['connectedlinename'];this['channels'][_0x29e76a[_0xbe14('0x16')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]][_0xbe14('0x2d')]=_0xbe14('0x2e');logger[_0xbe14('0x1f')](_0xbe14('0x2f'),_0x29e76a[_0xbe14('0x16')],_0x29e76a[_0xbe14('0x1b')][_0xbe14('0x1c')](_0x29e76a[_0xbe14('0x1b')][_0xbe14('0x1d')]('/')+0x1,_0x29e76a[_0xbe14('0x1b')]['lastIndexOf']('-')));logger['debug'](_0xbe14('0x30'),_0x29e76a[_0xbe14('0x16')],util[_0xbe14('0x17')](this['channels'][_0x29e76a[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x31'),this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]]);}logger[_0xbe14('0x15')](_0xbe14('0x32'),_0x29e76a[_0xbe14('0x16')],util[_0xbe14('0x17')](this['channels'][_0x29e76a[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x23'),this[_0xbe14('0x8')][_0x29e76a[_0xbe14('0x16')]]);}}}catch(_0x548d17){logger[_0xbe14('0x26')](_0xbe14('0x33'),_0x29e76a[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x548d17,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x38611d){try{if(this[_0xbe14('0x12')](_0x38611d)){logger[_0xbe14('0x15')]('[%s][voiceDialReport][varset]\x20event:',_0x38611d['uniqueid'],util[_0xbe14('0x17')](_0x38611d,{'showHidden':![],'depth':null}));this['addVariable'](_0x38611d['uniqueid'],_[_0xbe14('0x34')](_0x38611d[_0xbe14('0x35')])[0x0],_0x38611d[_0xbe14('0x36')]);if(this['isNotNull'](_0x38611d['variable'])&&this['isNotNull'](_0x38611d[_0xbe14('0x35')][_0xbe14('0x37')])){if(_[_0xbe14('0x13')](this['channels'][_0x38611d[_0xbe14('0x16')]])){this[_0xbe14('0x8')][_0x38611d[_0xbe14('0x16')]]={'routeId':_0x38611d[_0xbe14('0x36')],'variables':this['variables'][_0x38611d['uniqueid']],'motionChannel':_0xbe14('0x38')};logger[_0xbe14('0x1f')](_0xbe14('0x39'),_0x38611d[_0xbe14('0x16')],_0x38611d[_0xbe14('0x35')]['outboundrouteid'],_['keys'](_0x38611d[_0xbe14('0x35')])[0x0],_0x38611d[_0xbe14('0x36')]);logger[_0xbe14('0x15')](_0xbe14('0x3a'),_0x38611d['uniqueid'],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x38611d['uniqueid']],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x23'),this[_0xbe14('0x8')][_0x38611d['uniqueid']]);}}}}catch(_0x594f65){logger[_0xbe14('0x26')](_0xbe14('0x3b'),_0x38611d['uniqueid'],util['inspect'](_0x594f65,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x3c')]=function(_0x3f7f5b,_0x1a8a3d,_0xdbc6e1){var _0xd04fd5=[_0xbe14('0x3d'),'rtpaudioqosbridged',_0xbe14('0x3e'),_0xbe14('0x3f'),_0xbe14('0x40'),_0xbe14('0x41'),_0xbe14('0x42'),'rtpaudioqosrttbridged',_0xbe14('0x43'),_0xbe14('0x44'),_0xbe14('0x45'),_0xbe14('0x46'),_0xbe14('0x47'),_0xbe14('0x48'),'memberinterface','memberlastcall',_0xbe14('0x20'),_0xbe14('0x49'),_0xbe14('0x4a')];if(!_['isNil'](_0x1a8a3d)&&!_['includes'](_0xd04fd5,_0x1a8a3d)){if(_[_0xbe14('0x13')](this[_0xbe14('0xa')][_0x3f7f5b])){this['variables'][_0x3f7f5b]={};}this[_0xbe14('0xa')][_0x3f7f5b][_0x1a8a3d]=_0xdbc6e1;}};VoiceDialReport[_0xbe14('0x11')]['syncHangup']=function(_0x28f995){try{if(this['isNotNull'](_0x28f995)){logger[_0xbe14('0x15')](_0xbe14('0x4b'),_0x28f995[_0xbe14('0x16')],util['inspect'](_0x28f995,{'showHidden':![],'depth':null}));if(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]){logger['info'](_0xbe14('0x4c'),_0x28f995[_0xbe14('0x16')],_0x28f995[_0xbe14('0x4d')]);this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]['endtime']=moment()[_0xbe14('0x4e')](_0xbe14('0x19'));this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x4f')]=moment(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]['endtime'])[_0xbe14('0x50')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x51')],_0xbe14('0x52'));this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x2d')]=_0xbe14('0x53');this[_0xbe14('0x54')][_0xbe14('0x55')]+=0x1;if(this['channels'][_0x28f995['uniqueid']]['answertime']){this[_0xbe14('0x54')][_0xbe14('0x56')]+=0x1;this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x57')]=moment(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x58')])[_0xbe14('0x50')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x51')],_0xbe14('0x52'));this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x59')]=moment(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x5a')])[_0xbe14('0x50')](this['channels'][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x58')],_0xbe14('0x52'));this[_0xbe14('0x54')][_0xbe14('0x5b')]+=this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x57')]||0x0;this[_0xbe14('0x54')][_0xbe14('0x5c')]+=this['channels'][_0x28f995[_0xbe14('0x16')]][_0xbe14('0x59')];}this[_0xbe14('0x54')][_0xbe14('0x5d')]+=this[_0xbe14('0x8')][_0x28f995['uniqueid']][_0xbe14('0x4f')];logger[_0xbe14('0x15')](_0xbe14('0x5e'),_0x28f995[_0xbe14('0x16')],util[_0xbe14('0x17')](this['channels'][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x5f'),this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]);logger[_0xbe14('0x15')](_0xbe14('0x60'),_0x28f995[_0xbe14('0x16')],util['inspect'](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));ami[_0xbe14('0x14')](_0xbe14('0x61'),this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]);logger[_0xbe14('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x28f995['uniqueid'],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x62'),this[_0xbe14('0x54')]);logger[_0xbe14('0x1f')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]]));logger[_0xbe14('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x28f995[_0xbe14('0x16')],util[_0xbe14('0x17')](this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]],{'showHidden':![],'depth':null}));this[_0xbe14('0x14')](_0xbe14('0x22'),_0xbe14('0x63'),this['channels'][_0x28f995[_0xbe14('0x16')]]);delete this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x16')]];}else if(this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x64')]]){this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x64')]]['uniqueid']=this[_0xbe14('0x8')][_0x28f995[_0xbe14('0x64')]][_0xbe14('0x65')];}if(this[_0xbe14('0xa')][_0x28f995[_0xbe14('0x16')]]){delete this[_0xbe14('0xa')][_0x28f995[_0xbe14('0x16')]];}}}catch(_0xd756b2){logger['error'](_0xbe14('0x66'),_0x28f995[_0xbe14('0x16')],util[_0xbe14('0x17')](_0xd756b2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe14('0x11')][_0xbe14('0x67')]=function(_0x17576b){try{if(this['isNotNull'](_0x17576b)){logger[_0xbe14('0x15')](_0xbe14('0x68'),_0x17576b[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x17576b,{'showHidden':![],'depth':null}));if(_0x17576b['application'][_0xbe14('0x69')]()===_0xbe14('0x6a')){_0x17576b[_0xbe14('0x6b')]=(_0x17576b[_0xbe14('0x6c')]||_0x17576b[_0xbe14('0x6b')])[_0xbe14('0x69')]();if(_[_0xbe14('0x6d')](_0x17576b['applicationdata'],_0xbe14('0x6e'))){if(_['isUndefined'](this[_0xbe14('0x21')][_0x17576b['uniqueid']]))this[_0xbe14('0x21')][_0x17576b[_0xbe14('0x16')]]={};logger[_0xbe14('0x1f')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x17576b[_0xbe14('0x16')],_0x17576b[_0xbe14('0x6f')],_0x17576b[_0xbe14('0x6b')]);var _0x546f22=_0x17576b[_0xbe14('0x6b')][_0xbe14('0x70')]('=');var _0x1737a8=_0x546f22[0x0][_0xbe14('0x71')](/cdr\((.*)\)/);if(_0x1737a8)this['applications'][_0x17576b[_0xbe14('0x16')]][_0x1737a8[0x1]]=_0x546f22[0x1];}}}}catch(_0x39bc54){logger[_0xbe14('0x26')](_0xbe14('0x72'),_0x17576b[_0xbe14('0x16')],util[_0xbe14('0x17')](_0x39bc54,{'showHidden':![],'depth':null}));}};module[_0xbe14('0x73')]=VoiceDialReport;
\ No newline at end of file
index d33d136..ad9c75e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ab=['queueReports','realtime','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','waiting','queuecallerexit','queuecallercomplete','clearZombieChannels','switch','isNil','Action','status','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','summary','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','queue','voice_queue_channel:save','queuecallerexitreason','format','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','compareToInboundQueue','assign','inbound','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','pick','keys','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','lastAssignedTo','info','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','channel','local/','linkedid','add','seconds','transfertype','transferexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','handleHangup','length','sumHoldTime','diff','sumDuration','milliseconds','ATTENDEDTRANSFER','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','cause-txt','cause','transferid','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','application','toLowerCase','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','defaults','localhost','redis','prototype','enqueue','tail','finally','sequence'];(function(_0x359ca5,_0x1d8f9a){var _0x238f4c=function(_0x3ba1fc){while(--_0x3ba1fc){_0x359ca5['push'](_0x359ca5['shift']());}};_0x238f4c(++_0x1d8f9a);}(_0x04ab,0x1d5));var _0xb04a=function(_0x9fe312,_0x374172){_0x9fe312=_0x9fe312-0x0;var _0x554349=_0x04ab[_0x9fe312];return _0x554349;};'use strict';var _=require(_0xb04a('0x0'));var moment=require('moment');var util=require(_0xb04a('0x1'));var Redis=require(_0xb04a('0x2'));var config=require(_0xb04a('0x3'));var logger=require(_0xb04a('0x4'))(_0xb04a('0x5'));var ami=require(_0xb04a('0x6'));var QueueReport=require(_0xb04a('0x7'));var VoiceQueueSummary=require(_0xb04a('0x8'));config['redis']=_[_0xb04a('0x9')](config['redis'],{'host':_0xb04a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb04a('0xb')]));var Sequence=function(){};Sequence[_0xb04a('0xc')][_0xb04a('0xd')]=function(_0x257868){this['tail']=this[_0xb04a('0xe')]?this[_0xb04a('0xe')][_0xb04a('0xf')](_0x257868):_0x257868();};function VoiceQueueReport(_0x56d4ee){this[_0xb04a('0x10')]=new Sequence();this[_0xb04a('0x11')]={};this[_0xb04a('0x12')]=_0x56d4ee;this[_0xb04a('0x13')]=_0x56d4ee[_0xb04a('0x13')];this[_0xb04a('0x14')]=_0x56d4ee[_0xb04a('0x15')];this[_0xb04a('0x16')]=_0x56d4ee['voiceQueues'];this[_0xb04a('0x17')]=_0x56d4ee[_0xb04a('0x17')];this['summary']=initializeSummary();this[_0xb04a('0x18')]={};ami['on'](_0xb04a('0x19'),this[_0xb04a('0x1a')]['bind'](this));ami['on'](_0xb04a('0x1b'),this[_0xb04a('0x1c')][_0xb04a('0x1d')](this));ami['on']('queuemember',this[_0xb04a('0x1e')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x1f'),this[_0xb04a('0x20')]['bind'](this));ami['on']('queuecallerjoin',this[_0xb04a('0x21')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x22'),this[_0xb04a('0x23')]['bind'](this));ami['on'](_0xb04a('0x24'),this[_0xb04a('0x25')]['bind'](this));ami['on'](_0xb04a('0x26'),this['syncAgentComplete'][_0xb04a('0x1d')](this));ami['on']('agentconnect',this[_0xb04a('0x27')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x28'),this[_0xb04a('0x29')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x2a'),this[_0xb04a('0x2b')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x2c'),this[_0xb04a('0x2d')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x2e'),this[_0xb04a('0x2f')][_0xb04a('0x1d')](this));ami['on']('musiconholdstop',this[_0xb04a('0x30')][_0xb04a('0x1d')](this));ami['on'](_0xb04a('0x31'),this[_0xb04a('0x32')]['bind'](this));ami['on'](_0xb04a('0x33'),this[_0xb04a('0x34')][_0xb04a('0x1d')](this));this[_0xb04a('0x35')]();this[_0xb04a('0x36')]();}function clearChannels(_0x2130ac){if(!_['isEmpty'](_0x2130ac)){for(var _0x558b52 in _0x2130ac){if(_0x2130ac[_0xb04a('0x37')](_0x558b52)){delete _0x2130ac[_0x558b52];}}}}function clearCampaigns(_0x3c39b8){if(!_['isEmpty'](_0x3c39b8)){for(var _0x8bd2d0 in _0x3c39b8){if(_0x3c39b8[_0xb04a('0x37')](_0x8bd2d0)){_0x3c39b8[_0x8bd2d0]['originated']=0x0;}}}}function clearVoiceQueues(_0x23f7d1){if(!_[_0xb04a('0x38')](_0x23f7d1)){for(var _0x4cfff6 in _0x23f7d1){if(_0x23f7d1[_0xb04a('0x37')](_0x4cfff6)){_0x23f7d1[_0x4cfff6][_0xb04a('0x39')]=0x0;_0x23f7d1[_0x4cfff6][_0xb04a('0x3a')]=0x0;_0x23f7d1[_0x4cfff6]['pTalking']=0x0;_0x23f7d1[_0x4cfff6][_0xb04a('0x3b')]=0x0;_0x23f7d1[_0x4cfff6]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x1939ea){if(!_[_0xb04a('0x38')](_0x1939ea)){for(var _0x2e60bc in _0x1939ea){if(_0x1939ea[_0xb04a('0x37')](_0x2e60bc)){_0x1939ea[_0x2e60bc]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x10bfec){return _0x10bfec[_0xb04a('0x3c')]||_0x10bfec['queuecallerabandon']||_0x10bfec[_0xb04a('0x3d')];}VoiceQueueReport['prototype'][_0xb04a('0x3e')]=function(){var _0x2a021c=this;for(var _0x3f399c in this[_0xb04a('0x14')]){if(this[_0xb04a('0x14')][_0xb04a('0x37')](_0x3f399c)&&!this['channels'][_0x3f399c][_0xb04a('0x3f')]){this[_0xb04a('0x10')][_0xb04a('0xd')](function(){if(!_[_0xb04a('0x40')](_0x2a021c['channels'][_0x3f399c])){return ami[_0xb04a('0x41')]({'action':_0xb04a('0x42'),'channel':_0x2a021c[_0xb04a('0x14')][_0x3f399c]['channel']})[_0xb04a('0x43')](function(_0x1ad815){if(_0x1ad815[_0xb04a('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2a021c[_0xb04a('0x14')][_0x3f399c]){delete _0x2a021c[_0xb04a('0x14')][_0x3f399c];logger[_0xb04a('0x45')](_0xb04a('0x46'),_0x3f399c,util[_0xb04a('0x47')](_0x1ad815,{'showHidden':![],'depth':null}));}if(_0x2a021c[_0xb04a('0x11')][_0x3f399c]){delete _0x2a021c[_0xb04a('0x11')][_0x3f399c];logger[_0xb04a('0x45')](_0xb04a('0x48'),_0x3f399c,util[_0xb04a('0x47')](_0x1ad815,{'showHidden':![],'depth':null}));}if(_0x2a021c[_0xb04a('0x18')][_0x3f399c]){delete _0x2a021c[_0xb04a('0x18')][_0x3f399c];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x3f399c,util[_0xb04a('0x47')](_0x1ad815,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x2d')]=function(){logger[_0xb04a('0x45')](_0xb04a('0x49'));clearChannels(this['channels']);this[_0xb04a('0x4a')](this['queueReports']);clearAgentBooked(this[_0xb04a('0x13')]);clearVoiceQueues(this[_0xb04a('0x16')]);clearCampaigns(this[_0xb04a('0x17')]);this[_0xb04a('0x4b')]=initializeSummary();};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x4a')]=function(_0x91eacb){var _0x25951f=this;if(!_[_0xb04a('0x38')](_0x91eacb)){for(var _0x103b08 in _0x91eacb){if(_0x91eacb[_0xb04a('0x37')](_0x103b08)){_0x25951f[_0xb04a('0x4c')](_0x91eacb[_0x103b08],_0xb04a('0x4d'));delete _0x91eacb[_0x103b08];}}}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x4e')]=function(_0x5c6c6a,_0x33d3b5,_0x4a68ef){io['to'](_0x5c6c6a)[_0xb04a('0x4e')](_0x33d3b5,_0x4a68ef);};VoiceQueueReport[_0xb04a('0xc')]['emitVoiceQueueChannelSave']=function(_0x4c4bf2,_0x214f2b){logger[_0xb04a('0x4f')](_0xb04a('0x50')+_0x214f2b+_0xb04a('0x51'),_0x4c4bf2[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x4c4bf2,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xb04a('0x53'),_0x4c4bf2[_0xb04a('0x54')]),_0xb04a('0x55'),_0x4c4bf2);io[_0xb04a('0x4e')]('voice_queue_presence:save',_0x4c4bf2);};VoiceQueueReport[_0xb04a('0xc')]['emitVoiceQueueChannelRemove']=function(_0x4bd1bc,_0x3694ba){logger[_0xb04a('0x4f')](_0xb04a('0x50')+_0x3694ba+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x4bd1bc['uniqueid'],util[_0xb04a('0x47')](_0x4bd1bc,{'showHidden':![],'depth':null}));if(_0x4bd1bc[_0xb04a('0x56')]==='ATTENDEDTRANSFER'){return;}this[_0xb04a('0x4e')](util[_0xb04a('0x57')](_0xb04a('0x53'),_0x4bd1bc[_0xb04a('0x54')]),_0xb04a('0x58'),_0x4bd1bc);io[_0xb04a('0x4e')](_0xb04a('0x59'),_0x4bd1bc);};VoiceQueueReport['prototype'][_0xb04a('0x5a')]=function(_0x511c31){if(_0x511c31[_0xb04a('0x5b')]==='inbound'){logger[_0xb04a('0x4f')](_0xb04a('0x5c'),util[_0xb04a('0x47')](_0x511c31,{'showHidden':![],'depth':null}));this[_0xb04a('0x4e')](util[_0xb04a('0x57')](_0xb04a('0x53'),_0x511c31[_0xb04a('0x5d')]),_0xb04a('0x5e'),_0x511c31);}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x5f')]=function(_0x36f3f2){return _0x36f3f2!==null&&!_[_0xb04a('0x60')](_0x36f3f2);};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x36')]=function(){var _0x4c3c39=this;setInterval(function(){_0x4c3c39[_0xb04a('0x3e')]();ami['Action']({'action':_0xb04a('0x61')})[_0xb04a('0x43')](function(_0x2fe595){logger[_0xb04a('0x45')](_0xb04a('0x62'),util[_0xb04a('0x47')](_0x2fe595,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xb04a('0xc')]['loopQueueSummary']=function(){var _0x3ee4f5=this;setInterval(function(){if(!_0x3ee4f5[_0xb04a('0x4b')]['isRunning']){return ami[_0xb04a('0x41')]({'action':_0xb04a('0x19')})[_0xb04a('0x63')](function(_0x45622b){_0x3ee4f5['summary']['id']=_0x45622b[_0xb04a('0x64')];_0x3ee4f5[_0xb04a('0x4b')]['isRunning']=!![];_0x3ee4f5[_0xb04a('0x4b')][_0xb04a('0x65')][_0x45622b[_0xb04a('0x64')]]={};})['catch'](function(_0x5b60af){logger[_0xb04a('0x45')](_0xb04a('0x66'),util[_0xb04a('0x47')](_0x5b60af,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xb04a('0x67')]=function(_0x354eb0,_0xb3541c){var _0x4aaad6=this[_0xb04a('0x4b')][_0xb04a('0x61')][_0x354eb0[_0xb04a('0x5d')]][_0xb04a('0x68')];var _0x263be8=new VoiceQueueSummary(_0x354eb0);return _0x263be8[_0xb04a('0x69')](_0xb3541c[_0xb04a('0x13')],this[_0xb04a('0x13')],_0x4aaad6,this[_0xb04a('0x12')][_0xb04a('0x14')]);};VoiceQueueReport['prototype']['handleInboundQueueSummaryReport']=function(_0x9bab4,_0x2757e4){var _0x16e144=this[_0xb04a('0x67')](_0x9bab4,_0x2757e4);var _0x5d7ba9=![];_0x5d7ba9=_0x16e144[_0xb04a('0x6a')](_0x9bab4);if(_0x5d7ba9){Object[_0xb04a('0x6b')](_0x9bab4,_0x16e144);this[_0xb04a('0x12')]['voiceQueues'][_0x9bab4[_0xb04a('0x5d')]]=_0x9bab4;this[_0xb04a('0x5a')](_0x16e144);}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x20')]=function(_0x1b8634){var _0x41822b=null;var _0x203fa6=this['summary']['id'];if(this['summary'][_0xb04a('0x65')][_0x203fa6]){_0x41822b=this[_0xb04a('0x4b')][_0xb04a('0x65')][_0x203fa6][_0x1b8634['actionid']];}if(!_0x41822b){this[_0xb04a('0x4b')]=initializeSummary();return;}var _0x4b251b=this[_0xb04a('0x16')][_0x41822b['queue']];if(_0x4b251b['type']===_0xb04a('0x6c')){this[_0xb04a('0x6d')](_0x4b251b,_0x41822b);}else if(_0x4b251b[_0xb04a('0x5b')]===_0xb04a('0x6e')){var _0x29c1f8=this['createQueueSummaryReport'](_0x4b251b,_0x41822b);ami[_0xb04a('0x4e')](_0xb04a('0x6f'),_0x29c1f8);}this['summary'][_0xb04a('0x70')]-=0x1;var _0x42e7b8=this[_0xb04a('0x4b')][_0xb04a('0x70')]>0x0?!![]:![];if(!_0x42e7b8){return this[_0xb04a('0x1c')](this[_0xb04a('0x4b')][_0xb04a('0x71')]);}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x1e')]=function(_0x554cbd){var _0x196b35=this['summary']['id'];if(this[_0xb04a('0x4b')][_0xb04a('0x65')][_0x196b35]&&this['summary'][_0xb04a('0x65')][_0x196b35][_0x554cbd['actionid']]){this[_0xb04a('0x4b')]['queuestatus'][_0x196b35][_0x554cbd[_0xb04a('0x64')]]['agents'][_0xb04a('0x72')](_0x554cbd);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x306b46){var _0x4e634f=this;try{if(this[_0xb04a('0x5f')](_0x306b46)&&this[_0xb04a('0x5f')](_0x306b46[_0xb04a('0x54')])){logger[_0xb04a('0x4f')](_0xb04a('0x73'),util[_0xb04a('0x47')](_0x306b46,{'showHidden':![],'depth':null}));var _0x421ca5=this['voiceQueues'][_0x306b46[_0xb04a('0x54')]];if(_0x421ca5){logger[_0xb04a('0x4f')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x421ca5[_0xb04a('0x5d')]);this[_0xb04a('0x4b')][_0xb04a('0x61')][_0x421ca5[_0xb04a('0x5d')]]={'summaryEvent':_0x306b46};this['summary'][_0xb04a('0x70')]+=0x1;return ami[_0xb04a('0x41')]({'action':'queuestatus','queue':_0x421ca5[_0xb04a('0x5d')]})[_0xb04a('0x63')](function(_0x12ca8f){if(!_0x4e634f['summary'][_0xb04a('0x65')][_0x306b46[_0xb04a('0x64')]]){_0x4e634f[_0xb04a('0x4b')][_0xb04a('0x65')][_0x306b46[_0xb04a('0x64')]]={};}_0x4e634f[_0xb04a('0x4b')]['queuestatus'][_0x306b46['actionid']][_0x12ca8f[_0xb04a('0x64')]]={'queue':_0x421ca5[_0xb04a('0x5d')],'agents':[]};})[_0xb04a('0x43')](function(_0x4c57ec){throw _0x4c57ec;});}}}catch(_0x4e9ac1){logger[_0xb04a('0x45')]('[voiceQueueReport][queuesummary]',util[_0xb04a('0x47')](_0x4e9ac1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')]['syncQueueSummaryComplete']=function(_0x437d7e){if(this[_0xb04a('0x4b')]['statusRequests']>0x0){this[_0xb04a('0x4b')]['completeEvent']=_0x437d7e;return;}logger[_0xb04a('0x4f')](_0xb04a('0x74'),util[_0xb04a('0x47')](_0x437d7e,{'showHidden':![],'depth':null}));this[_0xb04a('0x4b')]=initializeSummary();ami[_0xb04a('0x4e')](_0xb04a('0x75'),{});};VoiceQueueReport['prototype'][_0xb04a('0x21')]=function(_0x39d9f8){try{if(this[_0xb04a('0x5f')](_0x39d9f8)){logger[_0xb04a('0x4f')](_0xb04a('0x76'),_0x39d9f8['uniqueid'],util[_0xb04a('0x47')](_0x39d9f8,{'showHidden':![],'depth':null}));if(_[_0xb04a('0x60')](this[_0xb04a('0x11')][_0x39d9f8[_0xb04a('0x52')]])){this[_0xb04a('0x11')][_0x39d9f8[_0xb04a('0x52')]]=[];}if(_[_0xb04a('0x60')](this[_0xb04a('0x14')][_0x39d9f8[_0xb04a('0x52')]])){this['channels'][_0x39d9f8[_0xb04a('0x52')]]={};}var _0x1686fd=new QueueReport();_0x1686fd[_0xb04a('0x54')]=_0x39d9f8[_0xb04a('0x54')];_0x1686fd[_0xb04a('0x5b')]=this['voiceQueues'][_0x1686fd[_0xb04a('0x54')]]&&this['voiceQueues'][_0x1686fd[_0xb04a('0x54')]][_0xb04a('0x5b')]?this[_0xb04a('0x16')][_0x1686fd[_0xb04a('0x54')]][_0xb04a('0x5b')]||_0xb04a('0x6c'):_0xb04a('0x6c');_0x1686fd[_0xb04a('0x77')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));_0x1686fd[_0xb04a('0x79')]=_0x39d9f8['position'];_0x1686fd[_0xb04a('0x7a')]=_0x39d9f8[_0xb04a('0x7a')];_0x1686fd[_0xb04a('0x52')]=_0x39d9f8['uniqueid'];_0x1686fd['routealias']=this[_0xb04a('0x14')][_0x39d9f8[_0xb04a('0x52')]][_0xb04a('0x7b')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1686fd['queue'],_0x1686fd[_0xb04a('0x5b')]);Object[_0xb04a('0x6b')](_0x1686fd,_[_0xb04a('0x7c')](_0x39d9f8,_[_0xb04a('0x7d')](_0x1686fd)));this[_0xb04a('0x11')][_0x39d9f8[_0xb04a('0x52')]][_0xb04a('0x72')](_0x1686fd);this[_0xb04a('0x14')][_0x39d9f8[_0xb04a('0x52')]]=_0x1686fd;this['emitVoiceQueueChannelSave'](_0x1686fd,_0xb04a('0x7e'));}}catch(_0x36c4b0){logger[_0xb04a('0x45')](_0xb04a('0x76'),_0x39d9f8[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x36c4b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x23')]=function(_0x453b2d){try{if(this['isNotNull'](_0x453b2d)){logger['debug'](_0xb04a('0x7f'),_0x453b2d[_0xb04a('0x52')],util['inspect'](_0x453b2d,{'showHidden':![],'depth':null}));if(this[_0xb04a('0x11')][_0x453b2d['uniqueid']]){var _0x2a93a7=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x453b2d[_0xb04a('0x52')]]);_0x2a93a7[_0xb04a('0x3d')]=![];_0x2a93a7[_0xb04a('0x81')]=null;_0x2a93a7[_0xb04a('0x82')]=_0x453b2d[_0xb04a('0x82')];_0x2a93a7[_0xb04a('0x83')]=_0x453b2d[_0xb04a('0x83')];_0x2a93a7[_0xb04a('0x22')]=!![];_0x2a93a7[_0xb04a('0x84')]=moment()['format'](_0xb04a('0x78'));_0x2a93a7[_0xb04a('0x56')]='ABANDONED';_0x2a93a7[_0xb04a('0x85')]=null;logger[_0xb04a('0x86')](_0xb04a('0x87'),_0x2a93a7[_0xb04a('0x54')],_0x2a93a7[_0xb04a('0x5b')]);this[_0xb04a('0x14')][_0x453b2d[_0xb04a('0x52')]]=_0x2a93a7;this['emitVoiceQueueChannelRemove'](_0x2a93a7,_0xb04a('0x22'));}}}catch(_0x5acc16){logger[_0xb04a('0x45')](_0xb04a('0x7f'),_0x453b2d[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x5acc16,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')]['syncQueueCallerLeave']=function(_0x59269f){try{if(this[_0xb04a('0x5f')](_0x59269f)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x59269f[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x59269f,{'showHidden':![],'depth':null}));if(this[_0xb04a('0x11')][_0x59269f['uniqueid']]){var _0x198c39=_['last'](this[_0xb04a('0x11')][_0x59269f['uniqueid']]);_0x198c39[_0xb04a('0x88')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));_0x198c39['connectedlinenum']=_0x59269f[_0xb04a('0x89')];_0x198c39[_0xb04a('0x8a')]=_0x59269f[_0xb04a('0x8a')];logger[_0xb04a('0x86')](_0xb04a('0x8b'),_0x198c39['queue'],_0x198c39['type'],_0x59269f[_0xb04a('0x89')],_0x59269f[_0xb04a('0x8a')]);this[_0xb04a('0x14')][_0x59269f[_0xb04a('0x52')]]=_0x198c39;this[_0xb04a('0x8c')](_0x198c39,'queuecallerleave');}}}catch(_0x3bb271){logger[_0xb04a('0x45')](_0xb04a('0x8d'),_0x59269f[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x3bb271,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x27')]=function(_0x506b3a){try{if(this[_0xb04a('0x5f')](_0x506b3a)){logger[_0xb04a('0x4f')](_0xb04a('0x8e'),_0x506b3a[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x506b3a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x506b3a['uniqueid']]){var _0x184994=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x506b3a[_0xb04a('0x52')]]);_0x184994[_0xb04a('0x3d')]=!![];_0x184994[_0xb04a('0x56')]=_0xb04a('0x8f');logger[_0xb04a('0x86')](_0xb04a('0x90'),_0x184994['queue'],_0x184994[_0xb04a('0x5b')]);}}}catch(_0x5655ad){logger[_0xb04a('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x506b3a[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x5655ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb04a('0x91')]=function(_0x1b7bf5){try{if(this['isNotNull'](_0x1b7bf5)){logger[_0xb04a('0x4f')](_0xb04a('0x92'),_0x1b7bf5[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x1b7bf5,{'showHidden':![],'depth':null}));if(this[_0xb04a('0x11')][_0x1b7bf5[_0xb04a('0x52')]]){var _0x441c33=_['last'](this['queueReports'][_0x1b7bf5[_0xb04a('0x52')]]);_0x441c33[_0xb04a('0x22')]=![];_0x441c33[_0xb04a('0x84')]=null;_0x441c33[_0xb04a('0x93')]=!![];_0x441c33[_0xb04a('0x85')]=_0x1b7bf5[_0xb04a('0x94')];_0x441c33[_0xb04a('0x82')]=_0x1b7bf5[_0xb04a('0x82')];_0x441c33[_0xb04a('0x3d')]=!![];_0x441c33[_0xb04a('0x3c')]=![];_0x441c33[_0xb04a('0x95')]=null;if(!_0x441c33[_0xb04a('0x96')]){if(_0x1b7bf5[_0xb04a('0x97')]==_0xb04a('0x96')){_0x441c33[_0xb04a('0x56')]=_0xb04a('0x98');logger[_0xb04a('0x86')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x441c33['queue'],_0x441c33['type']);}else{if(_[_0xb04a('0x99')](_0x1b7bf5[_0xb04a('0x9a')]['toLowerCase'](),_0xb04a('0x9b'))){if(this[_0xb04a('0x11')][_0x1b7bf5[_0xb04a('0x9c')]]){var _0x1179d4=_[_0xb04a('0x80')](this['queueReports'][_0x1b7bf5[_0xb04a('0x9c')]]);_0x1179d4[_0xb04a('0x3d')]=![];_0x1179d4[_0xb04a('0x3c')]=!![];_0x1179d4[_0xb04a('0x95')]=moment(_0x441c33['queuecallerjoinAt'])[_0xb04a('0x9d')](_0x1b7bf5[_0xb04a('0x82')],_0xb04a('0x9e'))['format'](_0xb04a('0x78'));_0x1179d4['queuecallerexitreason']='FORWARDTRANSFER';_0x1179d4[_0xb04a('0x96')]=!![];_0x1179d4[_0xb04a('0x9f')]='FORWARD';_0x1179d4[_0xb04a('0xa0')]=_0x1b7bf5['destexten'];_0x1179d4[_0xb04a('0xa1')]=_0x1b7bf5[_0xb04a('0x52')];logger[_0xb04a('0x86')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1179d4['queue'],_0x1179d4[_0xb04a('0x5b')]);var _0x3916c9=this[_0xb04a('0x11')][_0x1b7bf5[_0xb04a('0x9c')]];this[_0xb04a('0x11')][_0x1b7bf5[_0xb04a('0x9c')]]=this[_0xb04a('0x11')][_0x1b7bf5['uniqueid']];this['queueReports'][_0x1b7bf5[_0xb04a('0x52')]]=_0x3916c9;}}else{_0x441c33['queuecallerexitreason']=_0xb04a('0xa2')+_0x1b7bf5['reason'][_0xb04a('0xa3')]();logger['info'](_0xb04a('0xa4'),_0x441c33[_0xb04a('0x54')],_0x441c33[_0xb04a('0x5b')],_0x441c33[_0xb04a('0x56')]);}}}this[_0xb04a('0x14')][_0x1b7bf5['uniqueid']]=_0x441c33;}}}catch(_0x576104){logger[_0xb04a('0x45')](_0xb04a('0x92'),_0x1b7bf5[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x576104,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb04a('0x29')]=function(_0x34d32d){try{if(this[_0xb04a('0x5f')](_0x34d32d)){logger[_0xb04a('0x4f')](_0xb04a('0xa5'),_0x34d32d[_0xb04a('0x52')],util['inspect'](_0x34d32d,{'showHidden':![],'depth':null}));this[_0xb04a('0xa6')](_0x34d32d['uniqueid'],_[_0xb04a('0x7d')](_0x34d32d[_0xb04a('0xa7')])[0x0],_0x34d32d['value']);if(this[_0xb04a('0x11')][_0x34d32d[_0xb04a('0x52')]]){var _0x432979=_['last'](this[_0xb04a('0x11')][_0x34d32d['uniqueid']]);if(_0x432979){if(this[_0xb04a('0x5f')](_0x34d32d[_0xb04a('0xa7')])&&this[_0xb04a('0x5f')](_0x34d32d[_0xb04a('0xa7')][_0xb04a('0x65')])){switch(_0x34d32d[_0xb04a('0xa8')]){case _0xb04a('0xa9'):_0x432979[_0xb04a('0x3c')]=![];_0x432979[_0xb04a('0x95')]=null;break;case _0xb04a('0xaa'):_0x432979[_0xb04a('0xab')]='timeout';_0x432979[_0xb04a('0x3c')]=!![];_0x432979[_0xb04a('0x95')]=moment()[_0xb04a('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x432979[_0xb04a('0x88')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x34d32d['uniqueid'],util[_0xb04a('0x47')](_0x432979,{'showHidden':![],'depth':null}));ami[_0xb04a('0x4e')](_0xb04a('0xac'),_0x432979);break;default:_0x432979[_0xb04a('0x3c')]=!![];_0x432979[_0xb04a('0x95')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));_0x432979[_0xb04a('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x432979['queuecallerabandon']=![];_0x432979[_0xb04a('0x84')]=null;_0x432979[_0xb04a('0x56')]=_0x34d32d[_0xb04a('0xa8')];this[_0xb04a('0x14')][_0x34d32d['uniqueid']]=_0x432979;this[_0xb04a('0x4c')](_0x432979,_0xb04a('0x28'));}else if(this['isNotNull'](_0x34d32d['variable'])&&this[_0xb04a('0x5f')](_0x34d32d[_0xb04a('0xa7')][_0xb04a('0xad')])){if(!_0x432979[_0xb04a('0x22')]){_0x432979['queuecallerexit']=!![];_0x432979[_0xb04a('0x95')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));_0x432979[_0xb04a('0x56')]=_0xb04a('0xae');_0x432979[_0xb04a('0x88')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));this['channels'][_0x34d32d[_0xb04a('0x52')]]=_0x432979;}}logger[_0xb04a('0x86')](_0xb04a('0xaf'),_0x34d32d[_0xb04a('0x52')],_0x432979[_0xb04a('0x54')],_0x432979[_0xb04a('0x5b')],_[_0xb04a('0x7d')](_0x34d32d['variable'])[0x0],_0x34d32d[_0xb04a('0xa8')]);_0x432979['variables']=this[_0xb04a('0x18')][_0x34d32d['uniqueid']];}}}}catch(_0x49edea){logger[_0xb04a('0x45')](_0xb04a('0xa5'),_0x34d32d['uniqueid'],util[_0xb04a('0x47')](_0x49edea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')]['addVariable']=function(_0x3bd905,_0x150be6,_0x190f34){var _0x33b659=['rtpaudioqos',_0xb04a('0xb0'),_0xb04a('0xb1'),'rtpaudioqosjitterbridged',_0xb04a('0xb2'),'rtpaudioqoslossbridged',_0xb04a('0xb3'),_0xb04a('0xb4'),_0xb04a('0xb5'),'sipuri',_0xb04a('0xb6'),_0xb04a('0xb7'),_0xb04a('0xb8'),_0xb04a('0xb9'),_0xb04a('0xba'),_0xb04a('0xbb'),'membername',_0xb04a('0xbc'),_0xb04a('0xbd')];if(!_[_0xb04a('0x40')](_0x150be6)&&!_['includes'](_0x33b659,_0x150be6)){if(_[_0xb04a('0x60')](this[_0xb04a('0x18')][_0x3bd905])){this[_0xb04a('0x18')][_0x3bd905]={};}this['variables'][_0x3bd905][_0x150be6]=_0x190f34;}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0xbe')]=function(_0x6c952b,_0x2bc46a,_0x503558){var _0x1bef02={};for(var _0x234638=0x0;_0x234638<this[_0xb04a('0x11')][_0x6c952b][_0xb04a('0xbf')];_0x234638+=0x1){_0x1bef02=this['queueReports'][_0x6c952b][_0x234638];var _0x402825=this[_0xb04a('0x16')][_0x1bef02[_0xb04a('0x54')]];if(_0x402825){_0x402825[_0xb04a('0xc0')]+=moment(_0x1bef02[_0xb04a('0x88')])[_0xb04a('0xc1')](_0x1bef02[_0xb04a('0x77')],_0xb04a('0x9e'))||0x0;if(_0x503558&&_0x1bef02[_0xb04a('0x56')]==='ATTENDEDTRANSFER'){_0x1bef02[_0xb04a('0x56')]=_0xb04a('0x8f');}if(_0x234638===this[_0xb04a('0x11')][_0x6c952b][_0xb04a('0xbf')]-0x1){_0x402825[_0xb04a('0xc2')]+=moment()[_0xb04a('0xc3')](0x0)[_0xb04a('0xc1')](_0x1bef02['queuecallerjoinAt'],'seconds');if(hasCallerLeftTheQueue(_0x1bef02)&&_0x1bef02[_0xb04a('0x56')]!==_0xb04a('0xc4')){_0x402825[_0xb04a('0xc5')]+=0x1;}if(_0x1bef02[_0xb04a('0x3d')]){_0x402825[_0xb04a('0xc6')]+=0x1;_0x402825[_0xb04a('0xc7')]+=moment()[_0xb04a('0xc3')](0x0)[_0xb04a('0xc1')](_0x1bef02['queuecallerleaveAt'],_0xb04a('0x9e'));_0x1bef02[_0xb04a('0x81')]=moment()[_0xb04a('0x57')](_0xb04a('0x78'));_0x1bef02[_0xb04a('0x3c')]=![];_0x1bef02[_0xb04a('0x95')]=null;}if(_0x1bef02['queuecallerexit']&&_0x1bef02[_0xb04a('0x96')]!=!![]){_0x402825[_0xb04a('0xc8')]+=0x1;_0x1bef02[_0xb04a('0xab')]=_0xb04a('0xc8');logger[_0xb04a('0x4f')](_0xb04a('0xc9'),_0x6c952b,util[_0xb04a('0x47')](_0x1bef02,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x1bef02);}if(_0x1bef02[_0xb04a('0x22')]){_0x402825['abandoned']+=0x1;_0x1bef02['lastevent']='abandoned';logger[_0xb04a('0x4f')](_0xb04a('0xca'),_0x6c952b,util[_0xb04a('0x47')](_0x1bef02,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x1bef02);}}else{_0x402825[_0xb04a('0xc2')]+=_0x402825[_0xb04a('0xc0')];}logger['info'](_0xb04a('0xcb'),_0x6c952b,_0x1bef02[_0xb04a('0x54')],_0x1bef02[_0xb04a('0x5b')],_0x2bc46a);this[_0xb04a('0x14')][_0x6c952b]=_0x1bef02;Object[_0xb04a('0x6b')](this[_0xb04a('0x16')][_0x1bef02[_0xb04a('0x54')]],_0x402825);if(_0x1bef02[_0xb04a('0x88')]){this[_0xb04a('0x4c')](_0x1bef02,_0xb04a('0x2a'));}}}logger[_0xb04a('0x4f')](_0xb04a('0xcc'),_0x6c952b,util[_0xb04a('0x47')](this[_0xb04a('0x11')][_0x6c952b],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x1bef02)&&_0x1bef02['queuecallerexitreason']!=='ATTENDEDTRANSFER'){ami[_0xb04a('0x4e')](_0xb04a('0xcd'),this['queueReports'][_0x6c952b]);delete this[_0xb04a('0x11')][_0x6c952b];delete this[_0xb04a('0x14')][_0x6c952b];if(this[_0xb04a('0x18')][_0x6c952b]){delete this[_0xb04a('0x18')][_0x6c952b];}}};VoiceQueueReport['prototype'][_0xb04a('0x2b')]=function(_0x57ae6e){try{if(this[_0xb04a('0x5f')](_0x57ae6e)){logger[_0xb04a('0x4f')]('[%s][voiceQueueReport][hangup]',_0x57ae6e[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x57ae6e,{'showHidden':![],'depth':null}));if(this[_0xb04a('0x11')][_0x57ae6e[_0xb04a('0x52')]]){return this['handleHangup'](_0x57ae6e[_0xb04a('0x52')],_0x57ae6e[_0xb04a('0xce')],![]);}if(this[_0xb04a('0x11')][_0x57ae6e[_0xb04a('0x9c')]]){if(_0x57ae6e[_0xb04a('0xcf')]==='21'){return;}return this[_0xb04a('0xbe')](_0x57ae6e[_0xb04a('0x9c')],_0x57ae6e[_0xb04a('0xce')],!![]);}var _0x4be963=Object[_0xb04a('0x7d')](this[_0xb04a('0x11')]);for(var _0x32ca75=0x0;_0x32ca75<_0x4be963['length'];_0x32ca75++){var _0x331468=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x4be963[_0x32ca75]]);if(_0x331468&&_0x331468[_0xb04a('0xd0')]===_0x57ae6e[_0xb04a('0x52')]){return this[_0xb04a('0xbe')](_0x331468['uniqueid'],_0x57ae6e['cause-txt'],!![]);}}}}catch(_0x3381c6){logger['error'](_0xb04a('0xd1'),_0x57ae6e[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x3381c6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb04a('0x32')]=function(_0x33cafe){try{if(this[_0xb04a('0x5f')](_0x33cafe)){logger['debug']('[%s][voiceQueueReport][attendedtransfer]',_0x33cafe[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x33cafe,{'showHidden':![],'depth':null}));var _0x49dc5f;var _0x1780e0;var _0x3ea717;if(this[_0xb04a('0x11')][_0x33cafe['transfereeuniqueid']]){_0x49dc5f=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd2')]]);_0x49dc5f[_0xb04a('0xa0')]=_0x33cafe[_0xb04a('0xd3')];_0x49dc5f[_0xb04a('0xa1')]=_0x33cafe[_0xb04a('0xd4')];_0x49dc5f['queuecallerexitreason']=_0xb04a('0xc4');_0x49dc5f['transfer']=!![];_0x49dc5f[_0xb04a('0x9f')]=_0xb04a('0xd5');if(this[_0xb04a('0x11')][_0x33cafe['secondtransfereruniqueid']]){_0x3ea717=this['queueReports'][_0x33cafe[_0xb04a('0xd4')]];this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd4')]]=this[_0xb04a('0x11')][_0x33cafe['transfereeuniqueid']];this[_0xb04a('0x11')][_0x33cafe['transfereeuniqueid']]=_0x3ea717;_0x1780e0=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd2')]]);_0x1780e0[_0xb04a('0x3f')]=!![];}logger[_0xb04a('0x86')](_0xb04a('0xd6'),_0x33cafe[_0xb04a('0x52')],_0x49dc5f[_0xb04a('0x54')],_0x49dc5f[_0xb04a('0x5b')],_0x49dc5f[_0xb04a('0xa0')],_0x49dc5f[_0xb04a('0xa1')]);}else if(this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd7')]]){_0x49dc5f=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd7')]]);_0x49dc5f['transferexten']=_0x33cafe['origtransfererexten'];_0x49dc5f[_0xb04a('0xa1')]=_0x33cafe['origtransfereruniqueid'];_0x49dc5f[_0xb04a('0x56')]=_0xb04a('0xc4');_0x49dc5f[_0xb04a('0x96')]=!![];_0x49dc5f['transfertype']=_0xb04a('0xd5');if(this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd8')]]){_0x3ea717=this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd8')]];this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd8')]]=this['queueReports'][_0x33cafe['transfertargetuniqueid']];this['queueReports'][_0x33cafe[_0xb04a('0xd7')]]=_0x3ea717;_0x1780e0=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd7')]]);_0x1780e0[_0xb04a('0x3f')]=!![];}logger['info'](_0xb04a('0xd6'),_0x33cafe['uniqueid'],_0x49dc5f['queue'],_0x49dc5f[_0xb04a('0x5b')],_0x49dc5f['transferexten'],_0x49dc5f['transferuniqueid']);}else if(this['queueReports'][_0x33cafe[_0xb04a('0xd8')]]){_0x49dc5f=_['last'](this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd8')]]);_0x49dc5f[_0xb04a('0xa0')]=_0x33cafe['origtransfererexten'];_0x49dc5f[_0xb04a('0xa1')]=_0x33cafe[_0xb04a('0xd8')];_0x49dc5f['queuecallerexitreason']='ATTENDEDTRANSFER';_0x49dc5f[_0xb04a('0x96')]=!![];_0x49dc5f['transfertype']=_0xb04a('0xd5');_0x49dc5f[_0xb04a('0x3f')]=!![];_0x49dc5f[_0xb04a('0xd0')]=_0x33cafe[_0xb04a('0xd2')];}else if(this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd4')]]){_0x49dc5f=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x33cafe[_0xb04a('0xd4')]]);_0x49dc5f['transferexten']=_0x33cafe[_0xb04a('0xd3')];_0x49dc5f[_0xb04a('0xa1')]=_0x33cafe[_0xb04a('0xd4')];_0x49dc5f[_0xb04a('0x56')]=_0xb04a('0xc4');_0x49dc5f[_0xb04a('0x96')]=!![];_0x49dc5f[_0xb04a('0x9f')]=_0xb04a('0xd5');_0x49dc5f[_0xb04a('0x3f')]=!![];_0x49dc5f[_0xb04a('0xd0')]=_0x33cafe['transfertargetuniqueid'];}}}catch(_0x405997){logger[_0xb04a('0x45')](_0xb04a('0xd9'),_0x33cafe[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x405997,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x34')]=function(_0x539759){try{if(this[_0xb04a('0x5f')](_0x539759)){logger[_0xb04a('0x4f')](_0xb04a('0xda'),_0x539759['uniqueid'],util[_0xb04a('0x47')](_0x539759,{'showHidden':![],'depth':null}));if(this[_0xb04a('0x11')][_0x539759[_0xb04a('0xd2')]]){var _0x2ead6a=_[_0xb04a('0x80')](this['queueReports'][_0x539759[_0xb04a('0xd2')]]);_0x2ead6a[_0xb04a('0x56')]=_0xb04a('0xdb');_0x2ead6a['transfer']=!![];_0x2ead6a[_0xb04a('0x9f')]=_0xb04a('0xdc');_0x2ead6a[_0xb04a('0xa0')]=_0x539759[_0xb04a('0xdd')];_0x2ead6a[_0xb04a('0xa1')]=_0x539759['transfereeuniqueid'];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x539759[_0xb04a('0x52')],_0x2ead6a[_0xb04a('0x54')],_0x2ead6a['type'],_0x2ead6a[_0xb04a('0xa0')],_0x2ead6a[_0xb04a('0xa1')]);this[_0xb04a('0x2b')]({'event':_0xb04a('0xde'),'uniqueid':_0x539759[_0xb04a('0xd2')],'context':_0x539759[_0xb04a('0xdf')],'channel':_0x539759[_0xb04a('0xe0')]});}}}catch(_0x460a3c){logger[_0xb04a('0x45')](_0xb04a('0xda'),_0x539759['uniqueid'],util[_0xb04a('0x47')](_0x460a3c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x2f')]=function(_0x7fd46f){try{if(this[_0xb04a('0x5f')](_0x7fd46f)){logger[_0xb04a('0x4f')](_0xb04a('0xe1'),_0x7fd46f[_0xb04a('0x52')],util[_0xb04a('0x47')](_0x7fd46f,{'showHidden':![],'depth':null}));if(this[_0xb04a('0x11')][_0x7fd46f['uniqueid']]){var _0x4b3a85=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x7fd46f['uniqueid']]);if(!_[_0xb04a('0x40')](_0x4b3a85[_0xb04a('0x88')])){_0x4b3a85[_0xb04a('0xe2')]=moment()[_0xb04a('0x57')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xb04a('0x86')](_0xb04a('0xe3'),_0x7fd46f[_0xb04a('0x52')],_0x4b3a85['mohstarttime']);}}}}catch(_0x14277e){logger[_0xb04a('0x45')]('[%s][voiceQueueReport][musiconholdstart]',_0x7fd46f[_0xb04a('0x52')],util['inspect'](_0x14277e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0x30')]=function(_0x149592){try{if(this['isNotNull'](_0x149592)){logger['debug'](_0xb04a('0xe4'),_0x149592[_0xb04a('0x52')],util['inspect'](_0x149592,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x149592[_0xb04a('0x52')]]){var _0x1a7542=_[_0xb04a('0x80')](this[_0xb04a('0x11')][_0x149592[_0xb04a('0x52')]]);if(!_[_0xb04a('0x40')](_0x1a7542[_0xb04a('0xe2')])){_0x1a7542[_0xb04a('0xe5')]+=moment()[_0xb04a('0xc3')](0x0)['diff'](_0x1a7542[_0xb04a('0xe2')],_0xb04a('0x9e'));logger[_0xb04a('0x86')](_0xb04a('0xe6'),_0x149592[_0xb04a('0x52')],_0x1a7542[_0xb04a('0xe5')]);delete _0x1a7542['mohstarttime'];}}}}catch(_0x56a84a){logger[_0xb04a('0x45')](_0xb04a('0xe4'),_0x149592['uniqueid'],util[_0xb04a('0x47')](_0x56a84a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb04a('0xc')][_0xb04a('0xe7')]=function(_0x1f3431){try{if(this[_0xb04a('0x5f')](_0x1f3431)){logger[_0xb04a('0x4f')]('[%s][voiceQueueReport][newexten]\x20event:',_0x1f3431[_0xb04a('0x52')],util['inspect'](_0x1f3431,{'showHidden':![],'depth':null}));if(_0x1f3431[_0xb04a('0xe8')][_0xb04a('0xe9')]()===_0xb04a('0xea')){_0x1f3431[_0xb04a('0xeb')]=_0x1f3431[_0xb04a('0xec')]&&_0x1f3431[_0xb04a('0xec')][_0xb04a('0x99')](_0xb04a('0xed'))?_0x1f3431[_0xb04a('0xec')]:(_0x1f3431[_0xb04a('0xec')]||_0x1f3431['applicationdata'])[_0xb04a('0xe9')]();if(_[_0xb04a('0x99')](_0x1f3431[_0xb04a('0xeb')]['toLowerCase'](),_0xb04a('0xee'))){logger[_0xb04a('0x86')](_0xb04a('0xef'),_0x1f3431[_0xb04a('0x52')],_0x1f3431[_0xb04a('0xe8')],_0x1f3431[_0xb04a('0xeb')]);if(_[_0xb04a('0x60')](this[_0xb04a('0x14')][_0x1f3431['uniqueid']]))this['channels'][_0x1f3431[_0xb04a('0x52')]]={};var _0x5d6975=_0x1f3431[_0xb04a('0xeb')][_0xb04a('0xf0')]('=');var _0x455c0b=_0x5d6975[0x0][_0xb04a('0xe9')]()['match'](/cdr\((.*)\)/);if(_0x455c0b)this[_0xb04a('0x14')][_0x1f3431[_0xb04a('0x52')]][_0x455c0b[0x1]]=_0x5d6975[0x1];}}}}catch(_0x5c6dac){logger[_0xb04a('0x45')](_0xb04a('0xf1'),_0x1f3431[_0xb04a('0x52')],util['inspect'](_0x5c6dac,{'showHidden':![],'depth':null}));}};module[_0xb04a('0xf2')]=VoiceQueueReport;
\ No newline at end of file
+var _0x18c4=['ATTENDEDTRANSFER','voice:queue:%s','queue','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','actionid','isRunning','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','createReport','handleInboundQueueSummaryReport','compareToInboundQueue','assign','type','outbound','statusRequests','completeEvent','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','then','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','keys','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','last','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','emitVoiceQueueChannelRemove','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','handleHangup','length','sumHoldTime','sumDuration','total','milliseconds','diff','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','cause-txt','cause','transferid','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','isNil','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','set','applicationdata','appdata','CDR(routeAlias)','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../model/queueReport','redis','defaults','localhost','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','queuesummary','bind','syncQueueSummaryComplete','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','talking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallerabandon','queuecallercomplete','switch','status','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','syncFullyBooted','clearQueueReport','clearqueuereport','emit','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x18c4,0x190));var _0x418c=function(_0x327fb0,_0x387a15){_0x327fb0=_0x327fb0-0x0;var _0x13b762=_0x18c4[_0x327fb0];return _0x13b762;};'use strict';var _=require(_0x418c('0x0'));var moment=require(_0x418c('0x1'));var util=require(_0x418c('0x2'));var Redis=require(_0x418c('0x3'));var config=require(_0x418c('0x4'));var logger=require(_0x418c('0x5'))('ami');var ami=require('../ami');var QueueReport=require(_0x418c('0x6'));var VoiceQueueSummary=require('../model/voiceQueueSummary');config[_0x418c('0x7')]=_[_0x418c('0x8')](config[_0x418c('0x7')],{'host':_0x418c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x418c('0x7')]));var Sequence=function(){};Sequence[_0x418c('0xa')][_0x418c('0xb')]=function(_0x450b25){this['tail']=this[_0x418c('0xc')]?this[_0x418c('0xc')][_0x418c('0xd')](_0x450b25):_0x450b25();};function VoiceQueueReport(_0x428c71){this[_0x418c('0xe')]=new Sequence();this[_0x418c('0xf')]={};this[_0x418c('0x10')]=_0x428c71;this[_0x418c('0x11')]=_0x428c71['agents'];this[_0x418c('0x12')]=_0x428c71[_0x418c('0x13')];this[_0x418c('0x14')]=_0x428c71['voiceQueues'];this[_0x418c('0x15')]=_0x428c71['campaigns'];this[_0x418c('0x16')]=initializeSummary();this['variables']={};ami['on'](_0x418c('0x17'),this['syncQueueSummary'][_0x418c('0x18')](this));ami['on']('queuesummarycomplete',this[_0x418c('0x19')]['bind'](this));ami['on'](_0x418c('0x1a'),this[_0x418c('0x1b')][_0x418c('0x18')](this));ami['on'](_0x418c('0x1c'),this[_0x418c('0x1d')][_0x418c('0x18')](this));ami['on'](_0x418c('0x1e'),this['syncQueueCallerJoin'][_0x418c('0x18')](this));ami['on']('queuecallerabandon',this[_0x418c('0x1f')][_0x418c('0x18')](this));ami['on'](_0x418c('0x20'),this[_0x418c('0x21')]['bind'](this));ami['on'](_0x418c('0x22'),this['syncAgentComplete']['bind'](this));ami['on'](_0x418c('0x23'),this[_0x418c('0x24')][_0x418c('0x18')](this));ami['on'](_0x418c('0x25'),this[_0x418c('0x26')][_0x418c('0x18')](this));ami['on']('hangup',this[_0x418c('0x27')][_0x418c('0x18')](this));ami['on'](_0x418c('0x28'),this['syncFullyBooted'][_0x418c('0x18')](this));ami['on'](_0x418c('0x29'),this['syncMusicOnHoldStart'][_0x418c('0x18')](this));ami['on'](_0x418c('0x2a'),this[_0x418c('0x2b')][_0x418c('0x18')](this));ami['on']('attendedtransfer',this[_0x418c('0x2c')][_0x418c('0x18')](this));ami['on']('blindtransfer',this[_0x418c('0x2d')][_0x418c('0x18')](this));this[_0x418c('0x2e')]();this[_0x418c('0x2f')]();}function clearChannels(_0x6cb4ac){if(!_[_0x418c('0x30')](_0x6cb4ac)){for(var _0x3fb932 in _0x6cb4ac){if(_0x6cb4ac[_0x418c('0x31')](_0x3fb932)){delete _0x6cb4ac[_0x3fb932];}}}}function clearCampaigns(_0xaa50c){if(!_[_0x418c('0x30')](_0xaa50c)){for(var _0x18d372 in _0xaa50c){if(_0xaa50c[_0x418c('0x31')](_0x18d372)){_0xaa50c[_0x18d372]['originated']=0x0;}}}}function clearVoiceQueues(_0x5c31cc){if(!_[_0x418c('0x30')](_0x5c31cc)){for(var _0x4396bc in _0x5c31cc){if(_0x5c31cc[_0x418c('0x31')](_0x4396bc)){_0x5c31cc[_0x4396bc]['originated']=0x0;_0x5c31cc[_0x4396bc][_0x418c('0x32')]=0x0;_0x5c31cc[_0x4396bc]['pTalking']=0x0;_0x5c31cc[_0x4396bc][_0x418c('0x33')]=0x0;_0x5c31cc[_0x4396bc][_0x418c('0x34')]=!![];}}}}function clearAgentBooked(_0x50fbd5){if(!_[_0x418c('0x30')](_0x50fbd5)){for(var _0x14987a in _0x50fbd5){if(_0x50fbd5[_0x418c('0x31')](_0x14987a)){_0x50fbd5[_0x14987a][_0x418c('0x35')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x58b813){return _0x58b813[_0x418c('0x36')]||_0x58b813[_0x418c('0x37')]||_0x58b813[_0x418c('0x38')];}VoiceQueueReport[_0x418c('0xa')]['clearZombieChannels']=function(){var _0x41f37a=this;for(var _0x3b2126 in this[_0x418c('0x12')]){if(this['channels'][_0x418c('0x31')](_0x3b2126)&&!this['channels'][_0x3b2126][_0x418c('0x39')]){this[_0x418c('0xe')][_0x418c('0xb')](function(){if(!_['isNil'](_0x41f37a['channels'][_0x3b2126])){return ami['Action']({'action':_0x418c('0x3a'),'channel':_0x41f37a[_0x418c('0x12')][_0x3b2126]['channel']})[_0x418c('0x3b')](function(_0x38bcc6){if(_0x38bcc6['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x41f37a[_0x418c('0x12')][_0x3b2126]){delete _0x41f37a[_0x418c('0x12')][_0x3b2126];logger[_0x418c('0x3c')](_0x418c('0x3d'),_0x3b2126,util[_0x418c('0x3e')](_0x38bcc6,{'showHidden':![],'depth':null}));}if(_0x41f37a['queueReports'][_0x3b2126]){delete _0x41f37a[_0x418c('0xf')][_0x3b2126];logger['error'](_0x418c('0x3f'),_0x3b2126,util[_0x418c('0x3e')](_0x38bcc6,{'showHidden':![],'depth':null}));}if(_0x41f37a[_0x418c('0x40')][_0x3b2126]){delete _0x41f37a[_0x418c('0x40')][_0x3b2126];logger[_0x418c('0x3c')]('[%s][voiceQueueReport][checkVariables]',_0x3b2126,util['inspect'](_0x38bcc6,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x41')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x418c('0x12')]);this[_0x418c('0x42')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x418c('0x14')]);clearCampaigns(this[_0x418c('0x15')]);this[_0x418c('0x16')]=initializeSummary();};VoiceQueueReport['prototype'][_0x418c('0x42')]=function(_0x3f0d70){var _0x4bab43=this;if(!_['isEmpty'](_0x3f0d70)){for(var _0x22c703 in _0x3f0d70){if(_0x3f0d70[_0x418c('0x31')](_0x22c703)){_0x4bab43['emitVoiceQueueChannelRemove'](_0x3f0d70[_0x22c703],_0x418c('0x43'));delete _0x3f0d70[_0x22c703];}}}};VoiceQueueReport['prototype'][_0x418c('0x44')]=function(_0x10766f,_0x36f453,_0x81c10d){io['to'](_0x10766f)[_0x418c('0x44')](_0x36f453,_0x81c10d);};VoiceQueueReport[_0x418c('0xa')]['emitVoiceQueueChannelSave']=function(_0x136e40,_0xab3970){logger[_0x418c('0x45')]('[%s][voiceQueueReport]['+_0xab3970+_0x418c('0x46'),_0x136e40[_0x418c('0x47')],util[_0x418c('0x3e')](_0x136e40,{'showHidden':![],'depth':null}));this[_0x418c('0x44')](util[_0x418c('0x48')]('voice:queue:%s',_0x136e40['queue']),'voice_queue_channel:save',_0x136e40);io['emit'](_0x418c('0x49'),_0x136e40);};VoiceQueueReport[_0x418c('0xa')]['emitVoiceQueueChannelRemove']=function(_0x506911,_0x5c5bc3){logger[_0x418c('0x45')](_0x418c('0x4a')+_0x5c5bc3+_0x418c('0x4b'),_0x506911[_0x418c('0x47')],util[_0x418c('0x3e')](_0x506911,{'showHidden':![],'depth':null}));if(_0x506911['queuecallerexitreason']===_0x418c('0x4c')){return;}this[_0x418c('0x44')](util[_0x418c('0x48')](_0x418c('0x4d'),_0x506911[_0x418c('0x4e')]),_0x418c('0x4f'),_0x506911);io[_0x418c('0x44')](_0x418c('0x50'),_0x506911);};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x51')]=function(_0xcb3b37){if(_0xcb3b37['type']===_0x418c('0x52')){logger[_0x418c('0x45')](_0x418c('0x53'),util['inspect'](_0xcb3b37,{'showHidden':![],'depth':null}));this[_0x418c('0x44')](util[_0x418c('0x48')]('voice:queue:%s',_0xcb3b37[_0x418c('0x54')]),_0x418c('0x55'),_0xcb3b37);}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x56')]=function(_0x3effcc){return _0x3effcc!==null&&!_['isUndefined'](_0x3effcc);};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x2f')]=function(){var _0x44d3f6=this;setInterval(function(){_0x44d3f6[_0x418c('0x57')]();ami[_0x418c('0x58')]({'action':_0x418c('0x59')})[_0x418c('0x3b')](function(_0x49a25f){logger[_0x418c('0x3c')](_0x418c('0x5a'),util[_0x418c('0x3e')](_0x49a25f,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x418c('0x2e')]=function(){var _0x68b280=this;setInterval(function(){if(!_0x68b280[_0x418c('0x16')]['isRunning']){return ami['Action']({'action':_0x418c('0x17')})['then'](function(_0x48be2e){_0x68b280[_0x418c('0x16')]['id']=_0x48be2e[_0x418c('0x5b')];_0x68b280['summary'][_0x418c('0x5c')]=!![];_0x68b280['summary'][_0x418c('0x5d')][_0x48be2e[_0x418c('0x5b')]]={};})['catch'](function(_0x33e99f){logger[_0x418c('0x3c')](_0x418c('0x5e'),util[_0x418c('0x3e')](_0x33e99f,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x5f')]=function(_0x23bf25,_0x12ef95){var _0x3b7815=this[_0x418c('0x16')][_0x418c('0x59')][_0x23bf25[_0x418c('0x54')]]['summaryEvent'];var _0x1341e6=new VoiceQueueSummary(_0x23bf25);return _0x1341e6[_0x418c('0x60')](_0x12ef95[_0x418c('0x11')],this[_0x418c('0x11')],_0x3b7815,this['realtime'][_0x418c('0x12')]);};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x61')]=function(_0x3812ba,_0x4337a7){var _0x2b9bc7=this[_0x418c('0x5f')](_0x3812ba,_0x4337a7);var _0x3df0cf=![];_0x3df0cf=_0x2b9bc7[_0x418c('0x62')](_0x3812ba);if(_0x3df0cf){Object[_0x418c('0x63')](_0x3812ba,_0x2b9bc7);this['realtime'][_0x418c('0x14')][_0x3812ba[_0x418c('0x54')]]=_0x3812ba;this[_0x418c('0x51')](_0x2b9bc7);}};VoiceQueueReport['prototype'][_0x418c('0x1d')]=function(_0x1182c4){var _0x1c1d53=null;var _0x1458f0=this[_0x418c('0x16')]['id'];if(this[_0x418c('0x16')][_0x418c('0x5d')][_0x1458f0]){_0x1c1d53=this[_0x418c('0x16')][_0x418c('0x5d')][_0x1458f0][_0x1182c4[_0x418c('0x5b')]];}if(!_0x1c1d53){this[_0x418c('0x16')]=initializeSummary();return;}var _0x496cef=this['voiceQueues'][_0x1c1d53[_0x418c('0x4e')]];if(_0x496cef[_0x418c('0x64')]===_0x418c('0x52')){this[_0x418c('0x61')](_0x496cef,_0x1c1d53);}else if(_0x496cef[_0x418c('0x64')]===_0x418c('0x65')){var _0xdd4128=this['createQueueSummaryReport'](_0x496cef,_0x1c1d53);ami['emit']('custom:queuesummary',_0xdd4128);}this[_0x418c('0x16')][_0x418c('0x66')]-=0x1;var _0x21990e=this[_0x418c('0x16')][_0x418c('0x66')]>0x0?!![]:![];if(!_0x21990e){return this[_0x418c('0x19')](this['summary'][_0x418c('0x67')]);}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x1b')]=function(_0x3216ab){var _0x554da8=this[_0x418c('0x16')]['id'];if(this[_0x418c('0x16')][_0x418c('0x5d')][_0x554da8]&&this[_0x418c('0x16')][_0x418c('0x5d')][_0x554da8][_0x3216ab[_0x418c('0x5b')]]){this[_0x418c('0x16')][_0x418c('0x5d')][_0x554da8][_0x3216ab['actionid']][_0x418c('0x11')]['push'](_0x3216ab);}};VoiceQueueReport[_0x418c('0xa')]['syncQueueSummary']=function(_0x56908c){var _0x1141eb=this;try{if(this[_0x418c('0x56')](_0x56908c)&&this[_0x418c('0x56')](_0x56908c[_0x418c('0x4e')])){logger['debug'](_0x418c('0x68'),util[_0x418c('0x3e')](_0x56908c,{'showHidden':![],'depth':null}));var _0x4f88f8=this[_0x418c('0x14')][_0x56908c['queue']];if(_0x4f88f8){logger[_0x418c('0x45')](_0x418c('0x69'),_0x4f88f8[_0x418c('0x54')]);this[_0x418c('0x16')]['queues'][_0x4f88f8[_0x418c('0x54')]]={'summaryEvent':_0x56908c};this['summary'][_0x418c('0x66')]+=0x1;return ami['Action']({'action':_0x418c('0x5d'),'queue':_0x4f88f8['name']})[_0x418c('0x6a')](function(_0x4a240d){if(!_0x1141eb[_0x418c('0x16')]['queuestatus'][_0x56908c[_0x418c('0x5b')]]){_0x1141eb[_0x418c('0x16')][_0x418c('0x5d')][_0x56908c[_0x418c('0x5b')]]={};}_0x1141eb[_0x418c('0x16')][_0x418c('0x5d')][_0x56908c[_0x418c('0x5b')]][_0x4a240d[_0x418c('0x5b')]]={'queue':_0x4f88f8[_0x418c('0x54')],'agents':[]};})[_0x418c('0x3b')](function(_0x27e70e){throw _0x27e70e;});}}}catch(_0xff7e66){logger['error'](_0x418c('0x5e'),util['inspect'](_0xff7e66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x19')]=function(_0x21c0cf){if(this[_0x418c('0x16')]['statusRequests']>0x0){this[_0x418c('0x16')]['completeEvent']=_0x21c0cf;return;}logger[_0x418c('0x45')](_0x418c('0x6b'),util[_0x418c('0x3e')](_0x21c0cf,{'showHidden':![],'depth':null}));this[_0x418c('0x16')]=initializeSummary();ami['emit'](_0x418c('0x6c'),{});};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x6d')]=function(_0x4f1f70){try{if(this[_0x418c('0x56')](_0x4f1f70)){logger[_0x418c('0x45')](_0x418c('0x6e'),_0x4f1f70['uniqueid'],util['inspect'](_0x4f1f70,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x418c('0xf')][_0x4f1f70['uniqueid']])){this[_0x418c('0xf')][_0x4f1f70[_0x418c('0x47')]]=[];}if(_[_0x418c('0x6f')](this['channels'][_0x4f1f70[_0x418c('0x47')]])){this[_0x418c('0x12')][_0x4f1f70['uniqueid']]={};}var _0x30ea39=new QueueReport();_0x30ea39[_0x418c('0x4e')]=_0x4f1f70[_0x418c('0x4e')];_0x30ea39[_0x418c('0x64')]=this['voiceQueues'][_0x30ea39[_0x418c('0x4e')]]&&this[_0x418c('0x14')][_0x30ea39[_0x418c('0x4e')]][_0x418c('0x64')]?this[_0x418c('0x14')][_0x30ea39['queue']][_0x418c('0x64')]||_0x418c('0x52'):_0x418c('0x52');_0x30ea39[_0x418c('0x70')]=moment()[_0x418c('0x48')](_0x418c('0x71'));_0x30ea39[_0x418c('0x72')]=_0x4f1f70[_0x418c('0x72')];_0x30ea39[_0x418c('0x73')]=_0x4f1f70['count'];_0x30ea39[_0x418c('0x47')]=_0x4f1f70[_0x418c('0x47')];_0x30ea39[_0x418c('0x74')]=this[_0x418c('0x12')][_0x4f1f70[_0x418c('0x47')]]['routealias'];logger[_0x418c('0x75')](_0x418c('0x76'),_0x30ea39[_0x418c('0x4e')],_0x30ea39[_0x418c('0x64')]);Object[_0x418c('0x63')](_0x30ea39,_['pick'](_0x4f1f70,_[_0x418c('0x77')](_0x30ea39)));this['queueReports'][_0x4f1f70[_0x418c('0x47')]]['push'](_0x30ea39);this['channels'][_0x4f1f70[_0x418c('0x47')]]=_0x30ea39;this['emitVoiceQueueChannelSave'](_0x30ea39,_0x418c('0x1e'));}}catch(_0x2f6065){logger['error'](_0x418c('0x6e'),_0x4f1f70[_0x418c('0x47')],util[_0x418c('0x3e')](_0x2f6065,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')]['syncQueueCallerAbandon']=function(_0x175203){try{if(this[_0x418c('0x56')](_0x175203)){logger[_0x418c('0x45')](_0x418c('0x78'),_0x175203[_0x418c('0x47')],util[_0x418c('0x3e')](_0x175203,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x175203[_0x418c('0x47')]]){var _0x2668ed=_['last'](this['queueReports'][_0x175203[_0x418c('0x47')]]);_0x2668ed[_0x418c('0x38')]=![];_0x2668ed[_0x418c('0x79')]=null;_0x2668ed[_0x418c('0x7a')]=_0x175203['holdtime'];_0x2668ed['originalposition']=_0x175203[_0x418c('0x7b')];_0x2668ed[_0x418c('0x37')]=!![];_0x2668ed[_0x418c('0x7c')]=moment()[_0x418c('0x48')](_0x418c('0x71'));_0x2668ed[_0x418c('0x7d')]=_0x418c('0x7e');_0x2668ed[_0x418c('0x7f')]=null;logger[_0x418c('0x75')](_0x418c('0x80'),_0x2668ed[_0x418c('0x4e')],_0x2668ed['type']);this['channels'][_0x175203['uniqueid']]=_0x2668ed;this['emitVoiceQueueChannelRemove'](_0x2668ed,_0x418c('0x37'));}}}catch(_0x13f060){logger[_0x418c('0x3c')](_0x418c('0x78'),_0x175203['uniqueid'],util[_0x418c('0x3e')](_0x13f060,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x21')]=function(_0x3b3b26){try{if(this[_0x418c('0x56')](_0x3b3b26)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x3b3b26['uniqueid'],util[_0x418c('0x3e')](_0x3b3b26,{'showHidden':![],'depth':null}));if(this[_0x418c('0xf')][_0x3b3b26[_0x418c('0x47')]]){var _0x5504e3=_[_0x418c('0x81')](this['queueReports'][_0x3b3b26[_0x418c('0x47')]]);_0x5504e3['queuecallerleaveAt']=moment()[_0x418c('0x48')](_0x418c('0x71'));_0x5504e3[_0x418c('0x82')]=_0x3b3b26[_0x418c('0x82')];_0x5504e3[_0x418c('0x83')]=_0x3b3b26['connectedlinename'];logger[_0x418c('0x75')](_0x418c('0x84'),_0x5504e3[_0x418c('0x4e')],_0x5504e3[_0x418c('0x64')],_0x3b3b26[_0x418c('0x82')],_0x3b3b26[_0x418c('0x83')]);this['channels'][_0x3b3b26[_0x418c('0x47')]]=_0x5504e3;this['emitVoiceQueueChannelSave'](_0x5504e3,'queuecallerleave');}}}catch(_0x8c4f38){logger[_0x418c('0x3c')](_0x418c('0x85'),_0x3b3b26[_0x418c('0x47')],util[_0x418c('0x3e')](_0x8c4f38,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x24')]=function(_0x945b3b){try{if(this[_0x418c('0x56')](_0x945b3b)){logger[_0x418c('0x45')](_0x418c('0x86'),_0x945b3b['uniqueid'],util[_0x418c('0x3e')](_0x945b3b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x945b3b[_0x418c('0x47')]]){var _0x4fbaac=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x945b3b[_0x418c('0x47')]]);_0x4fbaac['queuecallercomplete']=!![];_0x4fbaac[_0x418c('0x7d')]=_0x418c('0x87');logger[_0x418c('0x75')](_0x418c('0x88'),_0x4fbaac[_0x418c('0x4e')],_0x4fbaac[_0x418c('0x64')]);}}}catch(_0x33dc53){logger['error'](_0x418c('0x86'),_0x945b3b['uniqueid'],util[_0x418c('0x3e')](_0x33dc53,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x5a0e02){try{if(this[_0x418c('0x56')](_0x5a0e02)){logger[_0x418c('0x45')](_0x418c('0x89'),_0x5a0e02[_0x418c('0x47')],util[_0x418c('0x3e')](_0x5a0e02,{'showHidden':![],'depth':null}));if(this[_0x418c('0xf')][_0x5a0e02[_0x418c('0x47')]]){var _0x1abf75=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x5a0e02[_0x418c('0x47')]]);_0x1abf75[_0x418c('0x37')]=![];_0x1abf75[_0x418c('0x7c')]=null;_0x1abf75[_0x418c('0x8a')]=!![];_0x1abf75['lastAssignedTo']=_0x5a0e02[_0x418c('0x8b')];_0x1abf75[_0x418c('0x7a')]=_0x5a0e02[_0x418c('0x7a')];_0x1abf75[_0x418c('0x38')]=!![];_0x1abf75[_0x418c('0x36')]=![];_0x1abf75[_0x418c('0x8c')]=null;if(!_0x1abf75[_0x418c('0x8d')]){if(_0x5a0e02['reason']==_0x418c('0x8d')){_0x1abf75['queuecallerexitreason']='COMPLETED';logger['info'](_0x418c('0x8e'),_0x1abf75[_0x418c('0x4e')],_0x1abf75['type']);}else{if(_[_0x418c('0x8f')](_0x5a0e02[_0x418c('0x90')][_0x418c('0x91')](),'local/')){if(this[_0x418c('0xf')][_0x5a0e02[_0x418c('0x92')]]){var _0x33e956=_[_0x418c('0x81')](this['queueReports'][_0x5a0e02[_0x418c('0x92')]]);_0x33e956['queuecallercomplete']=![];_0x33e956['queuecallerexit']=!![];_0x33e956[_0x418c('0x8c')]=moment(_0x1abf75[_0x418c('0x70')])[_0x418c('0x93')](_0x5a0e02[_0x418c('0x7a')],_0x418c('0x94'))[_0x418c('0x48')](_0x418c('0x71'));_0x33e956[_0x418c('0x7d')]=_0x418c('0x95');_0x33e956[_0x418c('0x8d')]=!![];_0x33e956[_0x418c('0x96')]='FORWARD';_0x33e956[_0x418c('0x97')]=_0x5a0e02[_0x418c('0x98')];_0x33e956[_0x418c('0x99')]=_0x5a0e02['uniqueid'];logger['info'](_0x418c('0x9a'),_0x33e956[_0x418c('0x4e')],_0x33e956[_0x418c('0x64')]);var _0x5ce371=this[_0x418c('0xf')][_0x5a0e02[_0x418c('0x92')]];this['queueReports'][_0x5a0e02[_0x418c('0x92')]]=this[_0x418c('0xf')][_0x5a0e02[_0x418c('0x47')]];this[_0x418c('0xf')][_0x5a0e02[_0x418c('0x47')]]=_0x5ce371;}}else{_0x1abf75[_0x418c('0x7d')]='COMPLETEDBY'+_0x5a0e02['reason'][_0x418c('0x9b')]();logger[_0x418c('0x75')](_0x418c('0x9c'),_0x1abf75[_0x418c('0x4e')],_0x1abf75[_0x418c('0x64')],_0x1abf75[_0x418c('0x7d')]);}}}this[_0x418c('0x12')][_0x5a0e02[_0x418c('0x47')]]=_0x1abf75;}}}catch(_0x402d65){logger[_0x418c('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x5a0e02[_0x418c('0x47')],util['inspect'](_0x402d65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x26')]=function(_0xe2e496){try{if(this[_0x418c('0x56')](_0xe2e496)){logger[_0x418c('0x45')](_0x418c('0x9d'),_0xe2e496[_0x418c('0x47')],util['inspect'](_0xe2e496,{'showHidden':![],'depth':null}));this[_0x418c('0x9e')](_0xe2e496[_0x418c('0x47')],_[_0x418c('0x77')](_0xe2e496[_0x418c('0x9f')])[0x0],_0xe2e496[_0x418c('0xa0')]);if(this['queueReports'][_0xe2e496[_0x418c('0x47')]]){var _0x2cd901=_[_0x418c('0x81')](this['queueReports'][_0xe2e496[_0x418c('0x47')]]);if(_0x2cd901){if(this[_0x418c('0x56')](_0xe2e496['variable'])&&this[_0x418c('0x56')](_0xe2e496['variable']['queuestatus'])){switch(_0xe2e496['value']){case _0x418c('0xa1'):_0x2cd901[_0x418c('0x36')]=![];_0x2cd901['queuecallerexitAt']=null;break;case _0x418c('0xa2'):_0x2cd901[_0x418c('0xa3')]='timeout';_0x2cd901['queuecallerexit']=!![];_0x2cd901[_0x418c('0x8c')]=moment()['format'](_0x418c('0x71'));_0x2cd901[_0x418c('0xa4')]=moment()[_0x418c('0x48')](_0x418c('0x71'));logger[_0x418c('0x45')](_0x418c('0xa5'),_0xe2e496['uniqueid'],util[_0x418c('0x3e')](_0x2cd901,{'showHidden':![],'depth':null}));ami[_0x418c('0x44')](_0x418c('0xa6'),_0x2cd901);break;default:_0x2cd901[_0x418c('0x36')]=!![];_0x2cd901[_0x418c('0x8c')]=moment()[_0x418c('0x48')](_0x418c('0x71'));_0x2cd901['queuecallerleaveAt']=moment()[_0x418c('0x48')](_0x418c('0x71'));}_0x2cd901[_0x418c('0x37')]=![];_0x2cd901[_0x418c('0x7c')]=null;_0x2cd901[_0x418c('0x7d')]=_0xe2e496[_0x418c('0xa0')];this[_0x418c('0x12')][_0xe2e496[_0x418c('0x47')]]=_0x2cd901;this[_0x418c('0xa7')](_0x2cd901,'varset');}else if(this['isNotNull'](_0xe2e496['variable'])&&this[_0x418c('0x56')](_0xe2e496[_0x418c('0x9f')][_0x418c('0xa8')])){if(!_0x2cd901[_0x418c('0x37')]){_0x2cd901[_0x418c('0x36')]=!![];_0x2cd901[_0x418c('0x8c')]=moment()['format'](_0x418c('0x71'));_0x2cd901[_0x418c('0x7d')]=_0x418c('0xa9');_0x2cd901[_0x418c('0xa4')]=moment()[_0x418c('0x48')](_0x418c('0x71'));this['channels'][_0xe2e496[_0x418c('0x47')]]=_0x2cd901;}}logger['info'](_0x418c('0xaa'),_0xe2e496[_0x418c('0x47')],_0x2cd901['queue'],_0x2cd901[_0x418c('0x64')],_[_0x418c('0x77')](_0xe2e496[_0x418c('0x9f')])[0x0],_0xe2e496[_0x418c('0xa0')]);_0x2cd901[_0x418c('0x40')]=this[_0x418c('0x40')][_0xe2e496[_0x418c('0x47')]];}}}}catch(_0x1615b8){logger['error']('[%s][voiceQueueReport][varset]',_0xe2e496[_0x418c('0x47')],util[_0x418c('0x3e')](_0x1615b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x9e')]=function(_0x4cc42f,_0x5d2403,_0x2bf245){var _0x38aca8=[_0x418c('0xab'),_0x418c('0xac'),_0x418c('0xad'),'rtpaudioqosjitterbridged',_0x418c('0xae'),'rtpaudioqoslossbridged',_0x418c('0xaf'),_0x418c('0xb0'),_0x418c('0xb1'),_0x418c('0xb2'),_0x418c('0xb3'),_0x418c('0xb4'),_0x418c('0xb5'),_0x418c('0xb6'),_0x418c('0xb7'),_0x418c('0xb8'),'membername','memberpenalty',_0x418c('0xb9')];if(!_['isNil'](_0x5d2403)&&!_[_0x418c('0xba')](_0x38aca8,_0x5d2403)){if(_[_0x418c('0x6f')](this[_0x418c('0x40')][_0x4cc42f])){this['variables'][_0x4cc42f]={};}this['variables'][_0x4cc42f][_0x5d2403]=_0x2bf245;}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0xbb')]=function(_0x191584,_0x5ba4ea,_0x3aac6a){var _0x1f2131={};for(var _0x1fbaf8=0x0;_0x1fbaf8<this[_0x418c('0xf')][_0x191584][_0x418c('0xbc')];_0x1fbaf8+=0x1){_0x1f2131=this[_0x418c('0xf')][_0x191584][_0x1fbaf8];var _0x3f7e26=this['voiceQueues'][_0x1f2131[_0x418c('0x4e')]];if(_0x3f7e26){_0x3f7e26[_0x418c('0xbd')]+=moment(_0x1f2131['queuecallerleaveAt'])['diff'](_0x1f2131[_0x418c('0x70')],_0x418c('0x94'))||0x0;if(_0x3aac6a&&_0x1f2131[_0x418c('0x7d')]===_0x418c('0x4c')){_0x1f2131[_0x418c('0x7d')]=_0x418c('0x87');}if(_0x1fbaf8===this[_0x418c('0xf')][_0x191584][_0x418c('0xbc')]-0x1){_0x3f7e26[_0x418c('0xbe')]+=moment()['milliseconds'](0x0)['diff'](_0x1f2131['queuecallerjoinAt'],'seconds');if(hasCallerLeftTheQueue(_0x1f2131)&&_0x1f2131[_0x418c('0x7d')]!==_0x418c('0x4c')){_0x3f7e26[_0x418c('0xbf')]+=0x1;}if(_0x1f2131[_0x418c('0x38')]){_0x3f7e26['answered']+=0x1;_0x3f7e26['sumBillable']+=moment()[_0x418c('0xc0')](0x0)[_0x418c('0xc1')](_0x1f2131[_0x418c('0xa4')],_0x418c('0x94'));_0x1f2131[_0x418c('0x79')]=moment()[_0x418c('0x48')](_0x418c('0x71'));_0x1f2131[_0x418c('0x36')]=![];_0x1f2131[_0x418c('0x8c')]=null;}if(_0x1f2131[_0x418c('0x36')]&&_0x1f2131[_0x418c('0x8d')]!=!![]){_0x3f7e26[_0x418c('0xc2')]+=0x1;_0x1f2131['lastevent']=_0x418c('0xc2');logger['debug'](_0x418c('0xc3'),_0x191584,util[_0x418c('0x3e')](_0x1f2131,{'showHidden':![],'depth':null}));ami['emit'](_0x418c('0xc4'),_0x1f2131);}if(_0x1f2131['queuecallerabandon']){_0x3f7e26['abandoned']+=0x1;_0x1f2131[_0x418c('0xa3')]=_0x418c('0xc5');logger[_0x418c('0x45')](_0x418c('0xc6'),_0x191584,util[_0x418c('0x3e')](_0x1f2131,{'showHidden':![],'depth':null}));ami[_0x418c('0x44')](_0x418c('0xc7'),_0x1f2131);}}else{_0x3f7e26[_0x418c('0xbe')]+=_0x3f7e26[_0x418c('0xbd')];}logger[_0x418c('0x75')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x191584,_0x1f2131[_0x418c('0x4e')],_0x1f2131[_0x418c('0x64')],_0x5ba4ea);this['channels'][_0x191584]=_0x1f2131;Object[_0x418c('0x63')](this[_0x418c('0x14')][_0x1f2131[_0x418c('0x4e')]],_0x3f7e26);if(_0x1f2131[_0x418c('0xa4')]){this[_0x418c('0xa7')](_0x1f2131,'hangup');}}}logger[_0x418c('0x45')](_0x418c('0xc8'),_0x191584,util[_0x418c('0x3e')](this[_0x418c('0xf')][_0x191584],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x1f2131)&&_0x1f2131[_0x418c('0x7d')]!==_0x418c('0x4c')){ami['emit'](_0x418c('0xc9'),this[_0x418c('0xf')][_0x191584]);delete this[_0x418c('0xf')][_0x191584];delete this[_0x418c('0x12')][_0x191584];if(this['variables'][_0x191584]){delete this['variables'][_0x191584];}}};VoiceQueueReport['prototype'][_0x418c('0x27')]=function(_0x13f2a2){try{if(this[_0x418c('0x56')](_0x13f2a2)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x13f2a2[_0x418c('0x47')],util[_0x418c('0x3e')](_0x13f2a2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x13f2a2[_0x418c('0x47')]]){return this['handleHangup'](_0x13f2a2[_0x418c('0x47')],_0x13f2a2[_0x418c('0xca')],![]);}if(this[_0x418c('0xf')][_0x13f2a2[_0x418c('0x92')]]){if(_0x13f2a2[_0x418c('0xcb')]==='21'){return;}return this['handleHangup'](_0x13f2a2[_0x418c('0x92')],_0x13f2a2[_0x418c('0xca')],!![]);}var _0xbda06b=Object['keys'](this['queueReports']);for(var _0x46944b=0x0;_0x46944b<_0xbda06b['length'];_0x46944b++){var _0x4dcc95=_[_0x418c('0x81')](this[_0x418c('0xf')][_0xbda06b[_0x46944b]]);if(_0x4dcc95&&_0x4dcc95[_0x418c('0xcc')]===_0x13f2a2[_0x418c('0x47')]){return this[_0x418c('0xbb')](_0x4dcc95[_0x418c('0x47')],_0x13f2a2['cause-txt'],!![]);}}}}catch(_0x3f52ac){logger[_0x418c('0x3c')]('[%s][voiceQueueReport][hangup]',_0x13f2a2[_0x418c('0x47')],util[_0x418c('0x3e')](_0x3f52ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')]['syncAttendedTransfer']=function(_0x2d8fa6){try{if(this[_0x418c('0x56')](_0x2d8fa6)){logger[_0x418c('0x45')]('[%s][voiceQueueReport][attendedtransfer]',_0x2d8fa6[_0x418c('0x47')],util['inspect'](_0x2d8fa6,{'showHidden':![],'depth':null}));var _0x1435ca;var _0x1b64f0;var _0x8eb464;if(this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xcd')]]){_0x1435ca=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xcd')]]);_0x1435ca[_0x418c('0x97')]=_0x2d8fa6[_0x418c('0xce')];_0x1435ca[_0x418c('0x99')]=_0x2d8fa6[_0x418c('0xcf')];_0x1435ca[_0x418c('0x7d')]='ATTENDEDTRANSFER';_0x1435ca[_0x418c('0x8d')]=!![];_0x1435ca[_0x418c('0x96')]=_0x418c('0xd0');if(this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xcf')]]){_0x8eb464=this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xcf')]];this['queueReports'][_0x2d8fa6[_0x418c('0xcf')]]=this['queueReports'][_0x2d8fa6[_0x418c('0xcd')]];this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xcd')]]=_0x8eb464;_0x1b64f0=_['last'](this['queueReports'][_0x2d8fa6[_0x418c('0xcd')]]);_0x1b64f0['switch']=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2d8fa6['uniqueid'],_0x1435ca['queue'],_0x1435ca[_0x418c('0x64')],_0x1435ca[_0x418c('0x97')],_0x1435ca[_0x418c('0x99')]);}else if(this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd1')]]){_0x1435ca=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x2d8fa6['transfertargetuniqueid']]);_0x1435ca[_0x418c('0x97')]=_0x2d8fa6[_0x418c('0xd2')];_0x1435ca[_0x418c('0x99')]=_0x2d8fa6['origtransfereruniqueid'];_0x1435ca[_0x418c('0x7d')]=_0x418c('0x4c');_0x1435ca[_0x418c('0x8d')]=!![];_0x1435ca[_0x418c('0x96')]=_0x418c('0xd0');if(this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd3')]]){_0x8eb464=this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd3')]];this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd3')]]=this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd1')]];this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd1')]]=_0x8eb464;_0x1b64f0=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd1')]]);_0x1b64f0['switch']=!![];}logger[_0x418c('0x75')](_0x418c('0xd4'),_0x2d8fa6[_0x418c('0x47')],_0x1435ca[_0x418c('0x4e')],_0x1435ca['type'],_0x1435ca[_0x418c('0x97')],_0x1435ca[_0x418c('0x99')]);}else if(this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd3')]]){_0x1435ca=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xd3')]]);_0x1435ca['transferexten']=_0x2d8fa6[_0x418c('0xd2')];_0x1435ca[_0x418c('0x99')]=_0x2d8fa6[_0x418c('0xd3')];_0x1435ca[_0x418c('0x7d')]='ATTENDEDTRANSFER';_0x1435ca[_0x418c('0x8d')]=!![];_0x1435ca[_0x418c('0x96')]=_0x418c('0xd0');_0x1435ca[_0x418c('0x39')]=!![];_0x1435ca['transferid']=_0x2d8fa6[_0x418c('0xcd')];}else if(this[_0x418c('0xf')][_0x2d8fa6[_0x418c('0xcf')]]){_0x1435ca=_['last'](this[_0x418c('0xf')][_0x2d8fa6['secondtransfereruniqueid']]);_0x1435ca[_0x418c('0x97')]=_0x2d8fa6['secondtransfererexten'];_0x1435ca[_0x418c('0x99')]=_0x2d8fa6[_0x418c('0xcf')];_0x1435ca['queuecallerexitreason']=_0x418c('0x4c');_0x1435ca[_0x418c('0x8d')]=!![];_0x1435ca[_0x418c('0x96')]='ATTENDED';_0x1435ca[_0x418c('0x39')]=!![];_0x1435ca[_0x418c('0xcc')]=_0x2d8fa6[_0x418c('0xd1')];}}}catch(_0x4caa21){logger[_0x418c('0x3c')](_0x418c('0xd5'),_0x2d8fa6['uniqueid'],util[_0x418c('0x3e')](_0x4caa21,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x418c('0x2d')]=function(_0x499487){try{if(this[_0x418c('0x56')](_0x499487)){logger[_0x418c('0x45')](_0x418c('0xd6'),_0x499487[_0x418c('0x47')],util['inspect'](_0x499487,{'showHidden':![],'depth':null}));if(this[_0x418c('0xf')][_0x499487['transfereeuniqueid']]){var _0x5842c6=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x499487[_0x418c('0xcd')]]);_0x5842c6[_0x418c('0x7d')]=_0x418c('0xd7');_0x5842c6['transfer']=!![];_0x5842c6['transfertype']=_0x418c('0xd8');_0x5842c6['transferexten']=_0x499487[_0x418c('0xd9')];_0x5842c6[_0x418c('0x99')]=_0x499487[_0x418c('0xcd')];logger['info'](_0x418c('0xda'),_0x499487[_0x418c('0x47')],_0x5842c6['queue'],_0x5842c6['type'],_0x5842c6[_0x418c('0x97')],_0x5842c6[_0x418c('0x99')]);this[_0x418c('0x27')]({'event':'BlindTransfer','uniqueid':_0x499487[_0x418c('0xcd')],'context':_0x499487[_0x418c('0xdb')],'channel':_0x499487[_0x418c('0xdc')]});}}}catch(_0x3961b0){logger['error'](_0x418c('0xd6'),_0x499487[_0x418c('0x47')],util[_0x418c('0x3e')](_0x3961b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')]['syncMusicOnHoldStart']=function(_0x2f0d3e){try{if(this[_0x418c('0x56')](_0x2f0d3e)){logger['debug']('[%s][voiceQueueReport][musiconholdstart]',_0x2f0d3e[_0x418c('0x47')],util[_0x418c('0x3e')](_0x2f0d3e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2f0d3e['uniqueid']]){var _0x39bd02=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x2f0d3e[_0x418c('0x47')]]);if(!_['isNil'](_0x39bd02[_0x418c('0xa4')])){_0x39bd02[_0x418c('0xdd')]=moment()[_0x418c('0x48')](_0x418c('0x71'));logger['info'](_0x418c('0xde'),_0x2f0d3e[_0x418c('0x47')],_0x39bd02[_0x418c('0xdd')]);}}}}catch(_0x4971ae){logger['error'](_0x418c('0xdf'),_0x2f0d3e['uniqueid'],util[_0x418c('0x3e')](_0x4971ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')][_0x418c('0x2b')]=function(_0x52b127){try{if(this[_0x418c('0x56')](_0x52b127)){logger[_0x418c('0x45')]('[%s][voiceQueueReport][musiconholdstop]',_0x52b127[_0x418c('0x47')],util[_0x418c('0x3e')](_0x52b127,{'showHidden':![],'depth':null}));if(this[_0x418c('0xf')][_0x52b127[_0x418c('0x47')]]){var _0x49e246=_[_0x418c('0x81')](this[_0x418c('0xf')][_0x52b127['uniqueid']]);if(!_[_0x418c('0xe0')](_0x49e246['mohstarttime'])){_0x49e246['mohtime']+=moment()[_0x418c('0xc0')](0x0)[_0x418c('0xc1')](_0x49e246['mohstarttime'],_0x418c('0x94'));logger['info'](_0x418c('0xe1'),_0x52b127[_0x418c('0x47')],_0x49e246[_0x418c('0xe2')]);delete _0x49e246[_0x418c('0xdd')];}}}}catch(_0x4c1c74){logger[_0x418c('0x3c')](_0x418c('0xe3'),_0x52b127[_0x418c('0x47')],util[_0x418c('0x3e')](_0x4c1c74,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x418c('0xa')]['syncNewExten']=function(_0x43f184){try{if(this[_0x418c('0x56')](_0x43f184)){logger[_0x418c('0x45')](_0x418c('0xe4'),_0x43f184[_0x418c('0x47')],util[_0x418c('0x3e')](_0x43f184,{'showHidden':![],'depth':null}));if(_0x43f184['application']['toLowerCase']()===_0x418c('0xe5')){_0x43f184[_0x418c('0xe6')]=_0x43f184[_0x418c('0xe7')]&&_0x43f184[_0x418c('0xe7')][_0x418c('0x8f')](_0x418c('0xe8'))?_0x43f184[_0x418c('0xe7')]:(_0x43f184[_0x418c('0xe7')]||_0x43f184[_0x418c('0xe6')])[_0x418c('0x91')]();if(_[_0x418c('0x8f')](_0x43f184[_0x418c('0xe6')][_0x418c('0x91')](),'cdr(')){logger[_0x418c('0x75')](_0x418c('0xe9'),_0x43f184[_0x418c('0x47')],_0x43f184['application'],_0x43f184[_0x418c('0xe6')]);if(_[_0x418c('0x6f')](this['channels'][_0x43f184[_0x418c('0x47')]]))this[_0x418c('0x12')][_0x43f184[_0x418c('0x47')]]={};var _0x1c52cd=_0x43f184['applicationdata'][_0x418c('0xea')]('=');var _0x529146=_0x1c52cd[0x0][_0x418c('0x91')]()[_0x418c('0xeb')](/cdr\((.*)\)/);if(_0x529146)this['channels'][_0x43f184[_0x418c('0x47')]][_0x529146[0x1]]=_0x1c52cd[0x1];}}}}catch(_0x4744e1){logger['error'](_0x418c('0xec'),_0x43f184[_0x418c('0x47')],util[_0x418c('0x3e')](_0x4744e1,{'showHidden':![],'depth':null}));}};module[_0x418c('0xed')]=VoiceQueueReport;
\ No newline at end of file
index 4fbe4fe..2d9c615 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdca=['campaign','Request','CreateReportAgentPreview'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0xfdca,0xbd));var _0xafdc=function(_0x582ad7,_0x525043){_0x582ad7=_0x582ad7-0x0;var _0xf6a48a=_0xfdca[_0x582ad7];return _0xf6a48a;};'use strict';var client=require('../client');exports['createHistory']=function(_0x4a2b66){return function(){_0x4a2b66[_0xafdc('0x0')]=_0x4a2b66['queue'];return client[_0xafdc('0x1')](_0xafdc('0x2'),{'body':_0x4a2b66,'log':_0xafdc('0x2')});};};
\ No newline at end of file
+var _0xc160=['../client','createHistory','campaign','queue','Request','CreateReportAgentPreview'];(function(_0x427bc1,_0x46698c){var _0x293edc=function(_0x86f7f7){while(--_0x86f7f7){_0x427bc1['push'](_0x427bc1['shift']());}};_0x293edc(++_0x46698c);}(_0xc160,0x102));var _0x0c16=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0xc160[_0x4ad0f7];return _0x30f5c8;};'use strict';var client=require(_0x0c16('0x0'));exports[_0x0c16('0x1')]=function(_0x48bef5){return function(){_0x48bef5[_0x0c16('0x2')]=_0x48bef5[_0x0c16('0x3')];return client[_0x0c16('0x4')]('CreateReportAgentPreview',{'body':_0x48bef5,'log':_0x0c16('0x5')});};};
\ No newline at end of file
index 97b7907..461da05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f9=['CreateAttachment','../client','create','Request'];(function(_0x4323bb,_0x3a3a72){var _0x2c9272=function(_0x113c06){while(--_0x113c06){_0x4323bb['push'](_0x4323bb['shift']());}};_0x2c9272(++_0x3a3a72);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x46bfda,_0x5f0b5c){_0x46bfda=_0x46bfda-0x0;var _0x3696df=_0xf1f9[_0x46bfda];return _0x3696df;};'use strict';var client=require(_0x9f1f('0x0'));exports[_0x9f1f('0x1')]=function(_0x25f8ee){return client[_0x9f1f('0x2')](_0x9f1f('0x3'),{'body':_0x25f8ee,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x79b5=['CreateAttachment','../client','create','Request'];(function(_0x456a40,_0x70273d){var _0x47b828=function(_0x18d46b){while(--_0x18d46b){_0x456a40['push'](_0x456a40['shift']());}};_0x47b828(++_0x70273d);}(_0x79b5,0x1bd));var _0x579b=function(_0x7d653b,_0x3f3341){_0x7d653b=_0x7d653b-0x0;var _0x3a30e7=_0x79b5[_0x7d653b];return _0x3a30e7;};'use strict';var client=require(_0x579b('0x0'));exports[_0x579b('0x1')]=function(_0x427520){return client[_0x579b('0x2')]('CreateAttachment',{'body':_0x427520,'log':_0x579b('0x3')});};
\ No newline at end of file
index 7ebaad6..1afdc62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x2ef3,0xba));var _0x32ef=function(_0x40f15f,_0x17a98b){_0x40f15f=_0x40f15f-0x0;var _0x43f753=_0x2ef3[_0x40f15f];return _0x43f753;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ 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(_0xe442d4,_0xc52815){var _0x5cb8ae=function(_0x31a24b){while(--_0x31a24b){_0xe442d4['push'](_0xe442d4['shift']());}};_0x5cb8ae(++_0xc52815);}(_0x1261,0x144));var _0x1126=function(_0x31f7c5,_0x3bf428){_0x31f7c5=_0x31f7c5-0x0;var _0x19fabc=_0x1261[_0x31f7c5];return _0x19fabc;};'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 0707a36..06cf5ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd562=['getContacts','GetCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd562,0xf8));var _0x2d56=function(_0x51b214,_0x463e42){_0x51b214=_0x51b214-0x0;var _0x57bc84=_0xd562[_0x51b214];return _0x57bc84;};'use strict';var client=require(_0x2d56('0x0'));exports[_0x2d56('0x1')]=function(_0x224e80){return function(){return client[_0x2d56('0x2')](_0x2d56('0x3'),{'body':_0x224e80,'log':_0x2d56('0x3')});};};exports[_0x2d56('0x4')]=function(_0xa1a42d){return function(){return client[_0x2d56('0x2')](_0x2d56('0x5'),{'options':_0xa1a42d,'log':_0x2d56('0x5')});};};
\ No newline at end of file
+var _0x3a7a=['../client','createContact','Request','CreateCmContact','getContacts','GetCmContact'];(function(_0x425cab,_0x38a6ad){var _0x105290=function(_0x26251d){while(--_0x26251d){_0x425cab['push'](_0x425cab['shift']());}};_0x105290(++_0x38a6ad);}(_0x3a7a,0x72));var _0xa3a7=function(_0x2822b3,_0x49842b){_0x2822b3=_0x2822b3-0x0;var _0x4b9178=_0x3a7a[_0x2822b3];return _0x4b9178;};'use strict';var client=require(_0xa3a7('0x0'));exports[_0xa3a7('0x1')]=function(_0x1be574){return function(){return client[_0xa3a7('0x2')](_0xa3a7('0x3'),{'body':_0x1be574,'log':_0xa3a7('0x3')});};};exports[_0xa3a7('0x4')]=function(_0x3bf964){return function(){return client['Request']('GetCmContact',{'options':_0x3bf964,'log':_0xa3a7('0x5')});};};
\ No newline at end of file
index 82c7887..b626a4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x644f=['campaign','queue','MoveContactManagedDialer','CampaignId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','name','VoiceQueue','Queue','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','moment','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','rescheduleContact','ContactId','ListId','VoiceQueueId','destroyContact','DestroyCmHopper','getContactDialer','DESC','ASC','GetContactDialer','getContactDialerIvr','priority','scheduledat','GetContactDialerIvr','moveContactManagedDialer'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x644f,0x177));var _0xf644=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x644f[_0xac0de1];return _0x1c1995;};'use strict';var client=require('../client');var moment=require(_0xf644('0x0'));exports[_0xf644('0x1')]=function(_0x43a46e,_0x1d1a65){return function(){return client[_0xf644('0x2')](_0xf644('0x3'),{'options':{'where':{'VoiceQueueId':_0x43a46e},'include':[{'model':_0xf644('0x4'),'as':_0xf644('0x5')}],'limit':_0x1d1a65,'raw':![]},'log':_0xf644('0x6')});};};exports['updateContacts']=function(_0x48173a,_0x23cd49,_0x16e2f2){return function(){return client[_0xf644('0x2')]('UpdateCmHopper',{'body':_0x48173a,'options':{'where':{'VoiceQueueId':_0x23cd49,'scheduledat':{'$lte':moment()[_0xf644('0x7')](_0xf644('0x8'))}},'limit':_0x16e2f2},'log':_0xf644('0x9')});};};exports[_0xf644('0xa')]=function(_0x129a88){return client['Request'](_0xf644('0x9'),{'body':_0x129a88,'options':{'where':{'ContactId':_0x129a88[_0xf644('0xb')],'ListId':_0x129a88[_0xf644('0xc')],'VoiceQueueId':_0x129a88[_0xf644('0xd')],'CampaignId':_0x129a88['CampaignId']}},'log':'rescheduleContact'});};exports[_0xf644('0xe')]=function(_0x517447,_0x5914c8,_0x3520e3){return function(){return client[_0xf644('0x2')](_0xf644('0xf'),{'options':{'where':{'VoiceQueueId':_0x517447,'ListId':_0x5914c8,'ContactId':_0x3520e3}},'log':'DestroyCmHopper'});};};exports[_0xf644('0x10')]=function(_0x19ace3,_0x27af2a,_0x41f6eb,_0x2df351){return client['Request']('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x19ace3,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x27af2a}}]},'order':[['priority',_0xf644('0x11')],['scheduledat',_0x2df351],['id',_0xf644('0x12')]],'raw':!![],'limit':_0x41f6eb},'log':_0xf644('0x13')});};exports[_0xf644('0x14')]=function(_0x14bd99,_0x2d5fc8,_0x50df3a){return client['Request'](_0xf644('0x13'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x14bd99,'active':![],'scheduledat':{'$lte':moment()[_0xf644('0x7')](_0xf644('0x8'))}},'include':[{'model':_0xf644('0x4'),'as':_0xf644('0x5')}],'order':[[_0xf644('0x15'),_0xf644('0x11')],[_0xf644('0x16'),_0x50df3a],['id',_0xf644('0x12')]],'raw':!![],'limit':_0x2d5fc8},'log':_0xf644('0x17')});};exports[_0xf644('0x18')]=function(_0x567c1d,_0x10aaba){_0x567c1d[_0xf644('0x19')]=_0x567c1d[_0xf644('0x1a')];return client[_0xf644('0x2')](_0xf644('0x1b'),{'body':_0x567c1d,'options':{'where':{'ContactId':_0x567c1d['ContactId'],'ListId':_0x567c1d[_0xf644('0xc')],'VoiceQueueId':_0x567c1d[_0xf644('0xd')],'CampaignId':_0x567c1d[_0xf644('0x1c')],'active':_0x10aaba?undefined:!![]}},'log':_0xf644('0x1b')});};exports[_0xf644('0x1d')]=function(_0x560033){return client[_0xf644('0x2')](_0xf644('0x1e'),{'options':{'where':{'VoiceQueueId':_0x560033['id']?_0x560033['id']||null:null}},'log':_0xf644('0x1d')});};exports[_0xf644('0x1f')]=function(_0x55c8d0){return function(){return client['Request'](_0xf644('0x20'),{'options':{'where':{'id':_0x55c8d0},'include':[{'model':_0xf644('0x4'),'as':_0xf644('0x5')},{'model':'User','as':'Agent','attributes':['id',_0xf644('0x21')]},{'model':_0xf644('0x22'),'as':_0xf644('0x23'),'attributes':['id','name']}],'raw':!![]},'log':_0xf644('0x6')});};};exports['unlockContact']=function(_0x3c3005,_0x319fc1,_0x450b0a){return client[_0xf644('0x2')](_0xf644('0x9'),{'body':_0x3c3005,'options':{'where':{'id':_0x319fc1},'limit':_0x450b0a},'log':'UpdateCmHopper'});};exports['getContactRecallMe']=function(_0x44366a,_0x1cd792){return function(){return client[_0xf644('0x2')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x44366a,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xf644('0x7')](_0xf644('0x8'))},'UserId':{'$in':_0x1cd792}},'order':[[_0xf644('0x15'),_0xf644('0x11')],[_0xf644('0x16'),'DESC'],['id',_0xf644('0x12')]],'include':[{'model':_0xf644('0x4'),'as':_0xf644('0x5')},{'model':'User','as':'Agent','attributes':['id',_0xf644('0x21'),'voicePause']}],'group':_0xf644('0x24'),'raw':!![]},'log':_0xf644('0x13')});};};exports[_0xf644('0x25')]=function(_0x32e73b,_0x441a7e){return client[_0xf644('0x2')](_0xf644('0x26'),{'body':_0x32e73b,'options':_0x441a7e||{},'log':_0xf644('0x26')});};exports['handlePreviewRecallNotifications']=function(_0x4fc88a,_0xbd45d1,_0x4d2ef1){return function(){return client[_0xf644('0x2')](_0xf644('0x27'),{'body':{'where':{'voiceQueueIds':_0x4fc88a,'interval':_0xbd45d1,'availableAgentsIds':_0x4d2ef1}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
+var _0xff22=['CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','DestroyCmHopper','getContactDialer','GetContactDialer','priority','scheduledat','ASC','getContactDialerIvr','DESC','GetContactDialerIvr','moveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','Request','GetCmHopper'];(function(_0x4ff200,_0x357846){var _0x425fe2=function(_0x67ad3c){while(--_0x67ad3c){_0x4ff200['push'](_0x4ff200['shift']());}};_0x425fe2(++_0x357846);}(_0xff22,0x1a0));var _0x2ff2=function(_0x2e2cf2,_0x2b7328){_0x2e2cf2=_0x2e2cf2-0x0;var _0x1cdfff=_0xff22[_0x2e2cf2];return _0x1cdfff;};'use strict';var client=require(_0x2ff2('0x0'));var moment=require(_0x2ff2('0x1'));exports['getContacts']=function(_0x296971,_0x41445f){return function(){return client[_0x2ff2('0x2')](_0x2ff2('0x3'),{'options':{'where':{'VoiceQueueId':_0x296971},'include':[{'model':_0x2ff2('0x4'),'as':_0x2ff2('0x5')}],'limit':_0x41445f,'raw':![]},'log':_0x2ff2('0x6')});};};exports[_0x2ff2('0x7')]=function(_0x10bd59,_0x47906b,_0x21f303){return function(){return client[_0x2ff2('0x2')](_0x2ff2('0x8'),{'body':_0x10bd59,'options':{'where':{'VoiceQueueId':_0x47906b,'scheduledat':{'$lte':moment()[_0x2ff2('0x9')](_0x2ff2('0xa'))}},'limit':_0x21f303},'log':_0x2ff2('0x8')});};};exports[_0x2ff2('0xb')]=function(_0x5375c7){return client[_0x2ff2('0x2')](_0x2ff2('0x8'),{'body':_0x5375c7,'options':{'where':{'ContactId':_0x5375c7[_0x2ff2('0xc')],'ListId':_0x5375c7[_0x2ff2('0xd')],'VoiceQueueId':_0x5375c7[_0x2ff2('0xe')],'CampaignId':_0x5375c7['CampaignId']}},'log':'rescheduleContact'});};exports['destroyContact']=function(_0x421472,_0x3d504e,_0x484e93){return function(){return client[_0x2ff2('0x2')](_0x2ff2('0xf'),{'options':{'where':{'VoiceQueueId':_0x421472,'ListId':_0x3d504e,'ContactId':_0x484e93}},'log':_0x2ff2('0xf')});};};exports[_0x2ff2('0x10')]=function(_0x590e8e,_0xd6d578,_0x3ff99d,_0x1c95d6){return client[_0x2ff2('0x2')](_0x2ff2('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x590e8e,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0xd6d578}}]},'order':[[_0x2ff2('0x12'),'DESC'],[_0x2ff2('0x13'),_0x1c95d6],['id',_0x2ff2('0x14')]],'raw':!![],'limit':_0x3ff99d},'log':_0x2ff2('0x11')});};exports[_0x2ff2('0x15')]=function(_0x15c2af,_0x2f2476,_0xca38d7){return client['Request'](_0x2ff2('0x11'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x15c2af,'active':![],'scheduledat':{'$lte':moment()['format'](_0x2ff2('0xa'))}},'include':[{'model':_0x2ff2('0x4'),'as':_0x2ff2('0x5')}],'order':[[_0x2ff2('0x12'),_0x2ff2('0x16')],[_0x2ff2('0x13'),_0xca38d7],['id',_0x2ff2('0x14')]],'raw':!![],'limit':_0x2f2476},'log':_0x2ff2('0x17')});};exports[_0x2ff2('0x18')]=function(_0x506ddb,_0x4a0c0a){_0x506ddb['campaign']=_0x506ddb['queue'];return client[_0x2ff2('0x2')]('MoveContactManagedDialer',{'body':_0x506ddb,'options':{'where':{'ContactId':_0x506ddb[_0x2ff2('0xc')],'ListId':_0x506ddb['ListId'],'VoiceQueueId':_0x506ddb[_0x2ff2('0xe')],'CampaignId':_0x506ddb['CampaignId'],'active':_0x4a0c0a?undefined:!![]}},'log':'MoveContactManagedDialer'});};exports[_0x2ff2('0x19')]=function(_0x239d65){return client[_0x2ff2('0x2')](_0x2ff2('0x1a'),{'options':{'where':{'VoiceQueueId':_0x239d65['id']?_0x239d65['id']||null:null}},'log':_0x2ff2('0x19')});};exports[_0x2ff2('0x1b')]=function(_0x50db1a){return function(){return client['Request'](_0x2ff2('0x1c'),{'options':{'where':{'id':_0x50db1a},'include':[{'model':_0x2ff2('0x4'),'as':'Contact'},{'model':_0x2ff2('0x1d'),'as':_0x2ff2('0x1e'),'attributes':['id',_0x2ff2('0x1f')]},{'model':_0x2ff2('0x20'),'as':_0x2ff2('0x21'),'attributes':['id',_0x2ff2('0x1f')]}],'raw':!![]},'log':_0x2ff2('0x6')});};};exports[_0x2ff2('0x22')]=function(_0x5e3dec,_0x2a72c8,_0x568883){return client[_0x2ff2('0x2')]('UpdateCmHopper',{'body':_0x5e3dec,'options':{'where':{'id':_0x2a72c8},'limit':_0x568883},'log':_0x2ff2('0x8')});};exports[_0x2ff2('0x23')]=function(_0x1b8202,_0xadd615){return function(){return client[_0x2ff2('0x2')](_0x2ff2('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1b8202,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x2ff2('0x9')](_0x2ff2('0xa'))},'UserId':{'$in':_0xadd615}},'order':[['priority',_0x2ff2('0x16')],['scheduledat','DESC'],['id','ASC']],'include':[{'model':_0x2ff2('0x4'),'as':'Contact'},{'model':_0x2ff2('0x1d'),'as':'Agent','attributes':['id','name',_0x2ff2('0x25')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':'GetContactDialer'});};};exports[_0x2ff2('0x26')]=function(_0x12a6a2,_0x3f0c89){return client['Request'](_0x2ff2('0x27'),{'body':_0x12a6a2,'options':_0x3f0c89||{},'log':_0x2ff2('0x27')});};exports[_0x2ff2('0x28')]=function(_0x3b9dda,_0x34161d,_0x3d8f5b){return function(){return client[_0x2ff2('0x2')](_0x2ff2('0x29'),{'body':{'where':{'voiceQueueIds':_0x3b9dda,'interval':_0x34161d,'availableAgentsIds':_0x3d8f5b}},'log':_0x2ff2('0x28')});};};
\ No newline at end of file
index bc6368a..1647c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x736b=['VerifyAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x736b,0x1d2));var _0xb736=function(_0x20d3eb,_0x40f094){_0x20d3eb=_0x20d3eb-0x0;var _0x4a7577=_0x736b[_0x20d3eb];return _0x4a7577;};'use strict';var client=require(_0xb736('0x0'));exports[_0xb736('0x1')]=function(_0x1f93c0,_0x58b210,_0x4d827d){return client[_0xb736('0x2')](_0xb736('0x3'),{'body':_0x1f93c0,'reason':_0x58b210,'entity':_0x4d827d,'log':_0xb736('0x3')});};exports['swapAdditionalPhones']=function(_0x139d5a,_0x2975f5,_0x2dc296){return client['Request']('SwapAdditionalPhones',{'body':_0x139d5a,'duration':_0x2975f5,'waitTime':_0x2dc296,'log':_0xb736('0x4')});};exports[_0xb736('0x5')]=function(_0xb9cdf0){return function(){return client['Request'](_0xb736('0x6'),{'body':_0xb9cdf0,'log':'IncrementPreviewCounters'});};};
\ No newline at end of file
+var _0xe90f=['Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones'];(function(_0x533ca6,_0x4ed3fb){var _0x34f0bd=function(_0x2cc877){while(--_0x2cc877){_0x533ca6['push'](_0x533ca6['shift']());}};_0x34f0bd(++_0x4ed3fb);}(_0xe90f,0x9e));var _0xfe90=function(_0x339b2f,_0xf4081c){_0x339b2f=_0x339b2f-0x0;var _0x203fa2=_0xe90f[_0x339b2f];return _0x203fa2;};'use strict';var client=require(_0xfe90('0x0'));exports[_0xfe90('0x1')]=function(_0x1c1232,_0x3a276b,_0xaa32fd){return client[_0xfe90('0x2')](_0xfe90('0x3'),{'body':_0x1c1232,'reason':_0x3a276b,'entity':_0xaa32fd,'log':_0xfe90('0x3')});};exports[_0xfe90('0x4')]=function(_0x2b608e,_0x41e9af,_0x588389){return client[_0xfe90('0x2')]('SwapAdditionalPhones',{'body':_0x2b608e,'duration':_0x41e9af,'waitTime':_0x588389,'log':_0xfe90('0x5')});};exports[_0xfe90('0x6')]=function(_0x20a187){return function(){return client[_0xfe90('0x2')](_0xfe90('0x7'),{'body':_0x20a187,'log':_0xfe90('0x7')});};};
\ No newline at end of file
index ff943ea..7fd7b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac0=['phone','GetCmHopperBlackIvr','checkIsBlackList','Request','VoiceQueueId','GetCmHopperBlack','checkIsBlackListIvr'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9ac0,0x1c9));var _0x09ac=function(_0x144b8a,_0xb25827){_0x144b8a=_0x144b8a-0x0;var _0x3e5a09=_0x9ac0[_0x144b8a];return _0x3e5a09;};'use strict';var client=require('../client');exports[_0x09ac('0x0')]=function(_0x41a881){return client[_0x09ac('0x1')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x41a881[_0x09ac('0x2')],'phone':_0x41a881['phone']},'raw':![]},'log':_0x09ac('0x3')});};exports[_0x09ac('0x4')]=function(_0x2088ed){return client[_0x09ac('0x1')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x2088ed['CampaignId'],'phone':_0x2088ed[_0x09ac('0x5')]},'raw':![]},'log':_0x09ac('0x6')});};
\ No newline at end of file
+var _0xf3e8=['VoiceQueueId','phone','checkIsBlackListIvr','CampaignId','checkIsBlackList','Request','GetCmHopperBlack'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf3e8,0x90));var _0x8f3e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf3e8[_0x4e676e];return _0x336a3c;};'use strict';var client=require('../client');exports[_0x8f3e('0x0')]=function(_0x58b40d){return client[_0x8f3e('0x1')](_0x8f3e('0x2'),{'options':{'where':{'VoiceQueueId':_0x58b40d[_0x8f3e('0x3')],'phone':_0x58b40d[_0x8f3e('0x4')]},'raw':![]},'log':_0x8f3e('0x2')});};exports[_0x8f3e('0x5')]=function(_0x459187){return client['Request'](_0x8f3e('0x2'),{'options':{'where':{'CampaignId':_0x459187[_0x8f3e('0x6')],'phone':_0x459187[_0x8f3e('0x4')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};
\ No newline at end of file
index 4d3c59d..dd3d717 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b81=['createContact','queue','Request','CreateCmHopperFinal','../client'];(function(_0x54d074,_0x47429c){var _0x27cb41=function(_0x25fbdb){while(--_0x25fbdb){_0x54d074['push'](_0x54d074['shift']());}};_0x27cb41(++_0x47429c);}(_0x1b81,0x81));var _0x11b8=function(_0x10a76b,_0x2efea5){_0x10a76b=_0x10a76b-0x0;var _0x392b8d=_0x1b81[_0x10a76b];return _0x392b8d;};'use strict';var client=require(_0x11b8('0x0'));exports[_0x11b8('0x1')]=function(_0x225a25){return function(){_0x225a25['campaign']=_0x225a25[_0x11b8('0x2')];return client[_0x11b8('0x3')](_0x11b8('0x4'),{'body':_0x225a25,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0xbccb=['Request','CreateCmHopperFinal','../client','createContact','campaign','queue'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xbccb,0x1b8));var _0xbbcc=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0xbccb[_0x3f25b2];return _0xd8caeb;};'use strict';var client=require(_0xbbcc('0x0'));exports[_0xbbcc('0x1')]=function(_0x41cf51){return function(){_0x41cf51[_0xbbcc('0x2')]=_0x41cf51[_0xbbcc('0x3')];return client[_0xbbcc('0x4')]('CreateCmHopperFinal',{'body':_0x41cf51,'log':_0xbbcc('0x5')});};};
\ No newline at end of file
index 5b61eeb..0f3d6a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8544=['moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','format','endOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x8544,0x1cd));var _0x4854=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x8544[_0x725b8e];return _0x43ac45;};'use strict';var client=require(_0x4854('0x0'));var moment=require(_0x4854('0x1'));exports[_0x4854('0x2')]=function(_0x3c57cd){_0x3c57cd[_0x4854('0x3')]=_0x3c57cd[_0x4854('0x4')];return client[_0x4854('0x5')](_0x4854('0x6'),{'body':_0x3c57cd,'log':_0x4854('0x6')});};exports[_0x4854('0x7')]=function(_0x22ec72){return client[_0x4854('0x5')](_0x4854('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0x4854('0x9')](_0x22ec72,_0x4854('0xa'))['format'](_0x4854('0xb')),moment()['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0x4854('0xc')});};exports[_0x4854('0xd')]=function(){return function(){return client[_0x4854('0x5')](_0x4854('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x4854('0xf')]('day')[_0x4854('0x10')](_0x4854('0xb')),moment()[_0x4854('0x11')](_0x4854('0x12'))[_0x4854('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x4854('0x4')},'raw':![]},'log':_0x4854('0xe')});};};exports[_0x4854('0x13')]=function(){return function(){return client[_0x4854('0x5')](_0x4854('0x14'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x4854('0x12'))[_0x4854('0x10')](_0x4854('0xb')),moment()[_0x4854('0x11')](_0x4854('0x12'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x4854('0x15')},'raw':![]},'log':_0x4854('0x14')});};};
\ No newline at end of file
+var _0x6623=['avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client','moment','createHistory','queue','Request','CreateCmHopperHistory'];(function(_0x33c154,_0x434888){var _0x55730a=function(_0x48364b){while(--_0x48364b){_0x33c154['push'](_0x33c154['shift']());}};_0x55730a(++_0x434888);}(_0x6623,0xa5));var _0x3662=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x6623[_0x4dbaad];return _0x226c72;};'use strict';var client=require(_0x3662('0x0'));var moment=require(_0x3662('0x1'));exports[_0x3662('0x2')]=function(_0x5c3b55){_0x5c3b55['campaign']=_0x5c3b55[_0x3662('0x3')];return client[_0x3662('0x4')](_0x3662('0x5'),{'body':_0x5c3b55,'log':_0x3662('0x5')});};exports[_0x3662('0x6')]=function(_0x59ac23){return client['Request'](_0x3662('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x3662('0x8')](_0x59ac23,_0x3662('0x9'))[_0x3662('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x3662('0xa')](_0x3662('0xb'))]}},'raw':![]},'log':'GetCmHopperHistory'});};exports[_0x3662('0xc')]=function(){return function(){return client[_0x3662('0x4')](_0x3662('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3662('0xe')](_0x3662('0xf'))['format'](_0x3662('0xb')),moment()['endOf']('day')[_0x3662('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x3662('0x3')},'raw':![]},'log':_0x3662('0xd')});};};exports[_0x3662('0x10')]=function(){return function(){return client[_0x3662('0x4')](_0x3662('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3662('0xe')](_0x3662('0xf'))[_0x3662('0xa')](_0x3662('0xb')),moment()['endOf'](_0x3662('0xf'))['format'](_0x3662('0xb'))]},'campaigntype':_0x3662('0x12')},'raw':![]},'log':_0x3662('0x11')});};};
\ No newline at end of file
index 67a76f7..597c61d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2faf=['TrunkId','ListId','key','Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','name','description','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','tech'];(function(_0x548eae,_0xad69de){var _0x5b1a01=function(_0x358051){while(--_0x358051){_0x548eae['push'](_0x548eae['shift']());}};_0x5b1a01(++_0xad69de);}(_0x2faf,0xb0));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xf2fa('0x0'));exports[_0xf2fa('0x1')]=function(){return function(){return client[_0xf2fa('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xf2fa('0x3'),_0xf2fa('0x4'),'ecm',_0xf2fa('0x5'),_0xf2fa('0x6'),_0xf2fa('0x7'),_0xf2fa('0x8'),_0xf2fa('0x9'),_0xf2fa('0xa'),_0xf2fa('0xb'),'t38timeout',_0xf2fa('0xc'),_0xf2fa('0xd'),_0xf2fa('0xe'),_0xf2fa('0xf')],'include':[{'model':'Trunk','as':_0xf2fa('0x10'),'attributes':['id','name',_0xf2fa('0x11'),'active']}]},'log':_0xf2fa('0x12')});};};exports[_0xf2fa('0x13')]=function(_0x4640a6,_0x404cd5){return client[_0xf2fa('0x2')](_0xf2fa('0x14'),{'account':{'id':_0x4640a6},'body':_0x404cd5,'log':_0xf2fa('0x14')});};
\ No newline at end of file
+var _0xbff2=['Request','GetFaxAccount','name','description','ecm','headerinfo','localstationid','maxrate','modem','tech','TrunkId','key','notify','NotifyFaxAccount','../client','getFaxAccounts'];(function(_0xdf6c2,_0xcc8ffe){var _0x14e73d=function(_0x2e1036){while(--_0x2e1036){_0xdf6c2['push'](_0xdf6c2['shift']());}};_0x14e73d(++_0xcc8ffe);}(_0xbff2,0x10e));var _0x2bff=function(_0x3d0035,_0x1bbcab){_0x3d0035=_0x3d0035-0x0;var _0x20efb3=_0xbff2[_0x3d0035];return _0x20efb3;};'use strict';var client=require(_0x2bff('0x0'));exports[_0x2bff('0x1')]=function(){return function(){return client[_0x2bff('0x2')](_0x2bff('0x3'),{'options':{'raw':![],'attributes':['id',_0x2bff('0x4'),_0x2bff('0x5'),_0x2bff('0x6'),_0x2bff('0x7'),_0x2bff('0x8'),'minrate',_0x2bff('0x9'),_0x2bff('0xa'),'gateway','faxdetect','t38timeout',_0x2bff('0xb'),_0x2bff('0xc'),'ListId',_0x2bff('0xd')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x2bff('0x4'),'callerid','active']}]},'log':'getFaxAccount'});};};exports[_0x2bff('0xe')]=function(_0x4d820b,_0x24c83f){return client[_0x2bff('0x2')]('NotifyFaxAccount',{'account':{'id':_0x4d820b},'body':_0x24c83f,'log':_0x2bff('0xf')});};
\ No newline at end of file
index 9c5861e..0f79e7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2805=['update','Request','UpdateFaxMessage','../client'];(function(_0x403b2a,_0x158fb0){var _0x55d798=function(_0x4985e2){while(--_0x4985e2){_0x403b2a['push'](_0x403b2a['shift']());}};_0x55d798(++_0x158fb0);}(_0x2805,0x15f));var _0x5280=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x2805[_0x31ced5];return _0x10d9e5;};'use strict';var client=require(_0x5280('0x0'));exports[_0x5280('0x1')]=function(_0xd01034,_0x28341f){return client[_0x5280('0x2')](_0x5280('0x3'),{'body':_0x28341f,'options':{'where':{'AttachmentId':_0xd01034}},'log':_0x5280('0x3')});};
\ No newline at end of file
+var _0xb0e7=['UpdateFaxMessage','../client','update','Request'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xb0e7,0x145));var _0x7b0e=function(_0x2fe1f1,_0x49bd47){_0x2fe1f1=_0x2fe1f1-0x0;var _0x1f987b=_0xb0e7[_0x2fe1f1];return _0x1f987b;};'use strict';var client=require(_0x7b0e('0x0'));exports[_0x7b0e('0x1')]=function(_0x11e8aa,_0xe086be){return client[_0x7b0e('0x2')](_0x7b0e('0x3'),{'body':_0xe086be,'options':{'where':{'AttachmentId':_0x11e8aa}},'log':_0x7b0e('0x3')});};
\ No newline at end of file
index dde7f65..ca4969b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db3=['remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','content','Variable','DeskField','Descriptions','keyType','keyContent','variableName','Fields','idField','nameField','customField','Tag','Tags','getDeskAccounts','GetDeskAccount','name','description','username'];(function(_0x3a53cd,_0x12e821){var _0x241e57=function(_0x1e63a8){while(--_0x1e63a8){_0x3a53cd['push'](_0x3a53cd['shift']());}};_0x241e57(++_0x12e821);}(_0x6db3,0xbb));var _0x36db=function(_0x5167d8,_0x1e841d){_0x5167d8=_0x5167d8-0x0;var _0x273082=_0x6db3[_0x5167d8];return _0x273082;};'use strict';var client=require('../../client');exports[_0x36db('0x0')]=function(){return function(_0x22b5a8){return client['Request'](_0x36db('0x1'),{'options':{'raw':![],'attributes':['id',_0x36db('0x2'),_0x36db('0x3'),_0x36db('0x4'),'password',_0x36db('0x5'),_0x36db('0x6'),_0x36db('0x7'),_0x36db('0x8')],'include':[{'model':_0x36db('0x9'),'as':_0x36db('0xa'),'attributes':['id',_0x36db('0x2')],'include':[{'model':'DeskField','as':'Subjects','attributes':['id',_0x36db('0x7'),_0x36db('0xb'),'variableName'],'include':[{'model':_0x36db('0xc'),'as':_0x36db('0xc'),'attributes':['id',_0x36db('0x2')]}]},{'model':_0x36db('0xd'),'as':_0x36db('0xe'),'attributes':['id','type',_0x36db('0xb'),'key',_0x36db('0xf'),_0x36db('0x10'),_0x36db('0x11')],'include':[{'model':_0x36db('0xc'),'as':_0x36db('0xc'),'attributes':['id',_0x36db('0x2')]}]},{'model':_0x36db('0xd'),'as':_0x36db('0x12'),'attributes':['id',_0x36db('0x7'),_0x36db('0xb'),_0x36db('0x13'),_0x36db('0x14'),_0x36db('0x15'),_0x36db('0x11')],'include':[{'model':_0x36db('0xc'),'as':_0x36db('0xc'),'attributes':['id',_0x36db('0x2')]}]},{'model':_0x36db('0x16'),'as':_0x36db('0x17'),'attributes':['id',_0x36db('0x2')]}]}]},'log':_0x36db('0x1')});};};
\ No newline at end of file
+var _0x8afe=['variableName','Variable','Descriptions','content','key','keyType','idField','nameField','customField','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','name','DeskField','Subjects'];(function(_0x26bfb0,_0x5b0ffc){var _0x4454b3=function(_0x2e7c5f){while(--_0x2e7c5f){_0x26bfb0['push'](_0x26bfb0['shift']());}};_0x4454b3(++_0x5b0ffc);}(_0x8afe,0x1a1));var _0xe8af=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8afe[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xe8af('0x0'));exports[_0xe8af('0x1')]=function(){return function(_0xa79b69){return client[_0xe8af('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id','name',_0xe8af('0x3'),_0xe8af('0x4'),_0xe8af('0x5'),_0xe8af('0x6'),_0xe8af('0x7'),_0xe8af('0x8'),_0xe8af('0x9')],'include':[{'model':_0xe8af('0xa'),'as':_0xe8af('0xb'),'attributes':['id',_0xe8af('0xc')],'include':[{'model':_0xe8af('0xd'),'as':_0xe8af('0xe'),'attributes':['id',_0xe8af('0x8'),'content',_0xe8af('0xf')],'include':[{'model':_0xe8af('0x10'),'as':_0xe8af('0x10'),'attributes':['id',_0xe8af('0xc')]}]},{'model':_0xe8af('0xd'),'as':_0xe8af('0x11'),'attributes':['id',_0xe8af('0x8'),_0xe8af('0x12'),_0xe8af('0x13'),_0xe8af('0x14'),'keyContent',_0xe8af('0xf')],'include':[{'model':'Variable','as':_0xe8af('0x10'),'attributes':['id',_0xe8af('0xc')]}]},{'model':_0xe8af('0xd'),'as':'Fields','attributes':['id',_0xe8af('0x8'),_0xe8af('0x12'),_0xe8af('0x15'),_0xe8af('0x16'),_0xe8af('0x17'),_0xe8af('0xf')],'include':[{'model':'Variable','as':_0xe8af('0x10'),'attributes':['id',_0xe8af('0xc')]}]},{'model':_0xe8af('0x18'),'as':_0xe8af('0x19'),'attributes':['id',_0xe8af('0xc')]}]}]},'log':_0xe8af('0x1a')});};};
\ No newline at end of file
index 970922e..8c67273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4e=['description','modernAuthentication','Dynamics365Configuration','ticketType','moduleCreate','openNewTab','Dynamics365Field','Subjects','content','Variable','Descriptions','type','key','variableName','idField','nameField','customField','CloudProvider','data5','data7','../../client','getDynamics365Accounts','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0xf11472,_0x48b20e){var _0xa5778=function(_0x1979f3){while(--_0x1979f3){_0xf11472['push'](_0xf11472['shift']());}};_0xa5778(++_0x48b20e);}(_0xee4e,0x122));var _0xeee4=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xee4e[_0x580576];return _0x3f55a0;};'use strict';var client=require(_0xeee4('0x0'));exports[_0xeee4('0x1')]=function(){return function(_0x6ba261){return client['Request'](_0xeee4('0x2'),{'options':{'raw':![],'attributes':['id',_0xeee4('0x3'),_0xeee4('0x4'),_0xeee4('0x5'),_0xeee4('0x6'),_0xeee4('0x7'),_0xeee4('0x8'),_0xeee4('0x9'),'serverUrl',_0xeee4('0xa'),_0xeee4('0xb')],'include':[{'model':_0xeee4('0xc'),'as':'Configurations','attributes':['id',_0xeee4('0x3'),_0xeee4('0xd'),_0xeee4('0xe'),'additionalSearchContact',_0xeee4('0xf')],'include':[{'model':_0xeee4('0x10'),'as':_0xeee4('0x11'),'attributes':['id','type',_0xeee4('0x12'),'variableName'],'include':[{'model':_0xeee4('0x13'),'as':_0xeee4('0x13'),'attributes':['id',_0xeee4('0x3')]}]},{'model':'Dynamics365Field','as':_0xeee4('0x14'),'attributes':['id',_0xeee4('0x15'),_0xeee4('0x12'),_0xeee4('0x16'),'keyType','keyContent',_0xeee4('0x17')],'include':[{'model':_0xeee4('0x13'),'as':_0xeee4('0x13'),'attributes':['id',_0xeee4('0x3')]}]},{'model':_0xeee4('0x10'),'as':'Fields','attributes':['id','type',_0xeee4('0x12'),_0xeee4('0x18'),_0xeee4('0x19'),_0xeee4('0x1a'),_0xeee4('0x17')],'include':[{'model':_0xeee4('0x13'),'as':'Variable','attributes':['id',_0xeee4('0x3')]}]}]},{'model':'CloudProvider','as':_0xeee4('0x1b'),'attributes':['id','data2',_0xeee4('0x1c'),_0xeee4('0x1d')]}]},'log':_0xeee4('0x2')});};};
\ No newline at end of file
+var _0x351d=['moduleCreate','Dynamics365Field','type','content','Variable','key','keyType','keyContent','Fields','idField','customField','CloudProvider','data2','data7','../../client','Request','GetDynamics365Account','username','remoteUri','tenantId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType'];(function(_0x254cd4,_0x37a74c){var _0x58ad92=function(_0x56cfa6){while(--_0x56cfa6){_0x254cd4['push'](_0x254cd4['shift']());}};_0x58ad92(++_0x37a74c);}(_0x351d,0x90));var _0xd351=function(_0x471bb1,_0x4ffa8f){_0x471bb1=_0x471bb1-0x0;var _0x5590b1=_0x351d[_0x471bb1];return _0x5590b1;};'use strict';var client=require(_0xd351('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x109108){return client[_0xd351('0x1')](_0xd351('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd351('0x3'),'password',_0xd351('0x4'),_0xd351('0x5'),'clientId',_0xd351('0x6'),_0xd351('0x7'),_0xd351('0x8'),'modernAuthentication'],'include':[{'model':_0xd351('0x9'),'as':_0xd351('0xa'),'attributes':['id','name',_0xd351('0xb'),_0xd351('0xc'),'additionalSearchContact','openNewTab'],'include':[{'model':_0xd351('0xd'),'as':'Subjects','attributes':['id',_0xd351('0xe'),_0xd351('0xf'),'variableName'],'include':[{'model':_0xd351('0x10'),'as':_0xd351('0x10'),'attributes':['id','name']}]},{'model':_0xd351('0xd'),'as':'Descriptions','attributes':['id','type',_0xd351('0xf'),_0xd351('0x11'),_0xd351('0x12'),_0xd351('0x13'),'variableName'],'include':[{'model':_0xd351('0x10'),'as':_0xd351('0x10'),'attributes':['id','name']}]},{'model':_0xd351('0xd'),'as':_0xd351('0x14'),'attributes':['id',_0xd351('0xe'),_0xd351('0xf'),_0xd351('0x15'),'nameField',_0xd351('0x16'),'variableName'],'include':[{'model':'Variable','as':_0xd351('0x10'),'attributes':['id','name']}]}]},{'model':_0xd351('0x17'),'as':_0xd351('0x17'),'attributes':['id',_0xd351('0x18'),'data5',_0xd351('0x19')]}]},'log':_0xd351('0x2')});};};
\ No newline at end of file
index b224034..004a9fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a5c=['customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','Configurations','Tag','FreshdeskField','Subjects','type','content','Variable','key','keyContent','variableName','Fields','idField','nameField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x1a5c[_0x432fca];return _0x3adba4;};'use strict';var client=require(_0xc1a5('0x0'));exports[_0xc1a5('0x1')]=function(){return function(_0x59696){return client[_0xc1a5('0x2')](_0xc1a5('0x3'),{'options':{'raw':![],'attributes':['id',_0xc1a5('0x4'),_0xc1a5('0x5'),_0xc1a5('0x6'),_0xc1a5('0x7'),_0xc1a5('0x8')],'include':[{'model':'FreshdeskConfiguration','as':_0xc1a5('0x9'),'attributes':['id',_0xc1a5('0x4')],'include':[{'model':_0xc1a5('0xa'),'attributes':['id',_0xc1a5('0x4')]},{'model':_0xc1a5('0xb'),'as':_0xc1a5('0xc'),'attributes':['id',_0xc1a5('0xd'),_0xc1a5('0xe'),'variableName'],'include':[{'model':_0xc1a5('0xf'),'as':_0xc1a5('0xf'),'attributes':['id','name']}]},{'model':_0xc1a5('0xb'),'as':'Descriptions','attributes':['id','type',_0xc1a5('0xe'),_0xc1a5('0x10'),'keyType',_0xc1a5('0x11'),_0xc1a5('0x12')],'include':[{'model':_0xc1a5('0xf'),'as':_0xc1a5('0xf'),'attributes':['id',_0xc1a5('0x4')]}]},{'model':'FreshdeskField','as':_0xc1a5('0x13'),'attributes':['id',_0xc1a5('0xd'),_0xc1a5('0xe'),_0xc1a5('0x14'),_0xc1a5('0x15'),_0xc1a5('0x16'),_0xc1a5('0x12')],'include':[{'model':_0xc1a5('0xf'),'as':_0xc1a5('0xf'),'attributes':['id','name']}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
+var _0xd1d3=['remoteUri','FreshdeskConfiguration','Configurations','Tag','Subjects','type','content','variableName','Variable','FreshdeskField','Descriptions','key','keyType','keyContent','idField','nameField','customField','../../client','GetFreshdeskAccount','name','username','apiKey'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x38b64f,_0x5846aa){_0x38b64f=_0x38b64f-0x0;var _0x47a5d9=_0xd1d3[_0x38b64f];return _0x47a5d9;};'use strict';var client=require(_0x3d1d('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x31335e){return client['Request'](_0x3d1d('0x1'),{'options':{'raw':![],'attributes':['id',_0x3d1d('0x2'),_0x3d1d('0x3'),_0x3d1d('0x4'),_0x3d1d('0x5'),'serverUrl'],'include':[{'model':_0x3d1d('0x6'),'as':_0x3d1d('0x7'),'attributes':['id','name'],'include':[{'model':_0x3d1d('0x8'),'attributes':['id',_0x3d1d('0x2')]},{'model':'FreshdeskField','as':_0x3d1d('0x9'),'attributes':['id',_0x3d1d('0xa'),_0x3d1d('0xb'),_0x3d1d('0xc')],'include':[{'model':_0x3d1d('0xd'),'as':_0x3d1d('0xd'),'attributes':['id',_0x3d1d('0x2')]}]},{'model':_0x3d1d('0xe'),'as':_0x3d1d('0xf'),'attributes':['id',_0x3d1d('0xa'),_0x3d1d('0xb'),_0x3d1d('0x10'),_0x3d1d('0x11'),_0x3d1d('0x12'),_0x3d1d('0xc')],'include':[{'model':_0x3d1d('0xd'),'as':_0x3d1d('0xd'),'attributes':['id',_0x3d1d('0x2')]}]},{'model':_0x3d1d('0xe'),'as':'Fields','attributes':['id',_0x3d1d('0xa'),_0x3d1d('0xb'),_0x3d1d('0x13'),_0x3d1d('0x14'),_0x3d1d('0x15'),_0x3d1d('0xc')],'include':[{'model':_0x3d1d('0xd'),'as':_0x3d1d('0xd'),'attributes':['id','name']}]}]}]},'log':_0x3d1d('0x1')});};};
\ No newline at end of file
index 1381352..032ddca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f44=['Configurations','FreshsalesField','Subjects','type','Variable','key','keyType','keyContent','variableName','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6f44,0x1ea));var _0x46f4=function(_0x3cfa48,_0x6d07cd){_0x3cfa48=_0x3cfa48-0x0;var _0xac3169=_0x6f44[_0x3cfa48];return _0xac3169;};'use strict';var client=require(_0x46f4('0x0'));exports[_0x46f4('0x1')]=function(){return function(_0x50acb0){return client[_0x46f4('0x2')](_0x46f4('0x3'),{'options':{'raw':![],'attributes':['id',_0x46f4('0x4'),_0x46f4('0x5'),_0x46f4('0x6'),_0x46f4('0x7'),_0x46f4('0x8')],'include':[{'model':_0x46f4('0x9'),'as':_0x46f4('0xa'),'attributes':['id','name'],'include':[{'model':_0x46f4('0xb'),'as':_0x46f4('0xc'),'attributes':['id',_0x46f4('0xd'),'content','variableName'],'include':[{'model':_0x46f4('0xe'),'as':_0x46f4('0xe'),'attributes':['id','name']}]},{'model':_0x46f4('0xb'),'as':'Descriptions','attributes':['id',_0x46f4('0xd'),'content',_0x46f4('0xf'),_0x46f4('0x10'),_0x46f4('0x11'),_0x46f4('0x12')],'include':[{'model':_0x46f4('0xe'),'as':_0x46f4('0xe'),'attributes':['id',_0x46f4('0x4')]}]}]}]},'log':_0x46f4('0x13')});};};
\ No newline at end of file
+var _0xe2fe=['serverUrl','Configurations','Subjects','type','variableName','Variable','Descriptions','GetFreshsalesccount','../../client','Request','name','username','apiKey','remoteUri'];(function(_0x242152,_0x2f7b09){var _0x167a0d=function(_0x569821){while(--_0x569821){_0x242152['push'](_0x242152['shift']());}};_0x167a0d(++_0x2f7b09);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xee2f('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x521787){return client[_0xee2f('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0xee2f('0x2'),_0xee2f('0x3'),_0xee2f('0x4'),_0xee2f('0x5'),_0xee2f('0x6')],'include':[{'model':'FreshsalesConfiguration','as':_0xee2f('0x7'),'attributes':['id',_0xee2f('0x2')],'include':[{'model':'FreshsalesField','as':_0xee2f('0x8'),'attributes':['id',_0xee2f('0x9'),'content',_0xee2f('0xa')],'include':[{'model':'Variable','as':_0xee2f('0xb'),'attributes':['id',_0xee2f('0x2')]}]},{'model':'FreshsalesField','as':_0xee2f('0xc'),'attributes':['id',_0xee2f('0x9'),'content','key','keyType','keyContent',_0xee2f('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':_0xee2f('0xd')});};};
\ No newline at end of file
index eedcfb1..fd60eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4547=['GetSalesforceAccount','username','password','remoteUri','clientId','clientSecret','securityToken','serverUrl','SalesforceConfiguration','name','moduleCreate','leadId','additionalSearchAccount','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request'];(function(_0x3b4ccb,_0x5a3660){var _0x4adfc1=function(_0x2cc733){while(--_0x2cc733){_0x3b4ccb['push'](_0x3b4ccb['shift']());}};_0x4adfc1(++_0x5a3660);}(_0x4547,0x11b));var _0x7454=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0x4547[_0x20aadb];return _0x520018;};'use strict';var client=require(_0x7454('0x0'));exports[_0x7454('0x1')]=function(){return function(_0x54b669){return client[_0x7454('0x2')](_0x7454('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7454('0x4'),_0x7454('0x5'),_0x7454('0x6'),_0x7454('0x7'),_0x7454('0x8'),_0x7454('0x9'),_0x7454('0xa'),'type'],'include':[{'model':_0x7454('0xb'),'as':'Configurations','attributes':['id',_0x7454('0xc'),'moduleSearch',_0x7454('0xd'),'ticketType',_0x7454('0xe'),_0x7454('0xf'),'additionalSearchContact',_0x7454('0x10')],'include':[{'model':_0x7454('0x11'),'as':_0x7454('0x12'),'include':[{'model':_0x7454('0x13'),'as':_0x7454('0x13'),'attributes':['id',_0x7454('0xc')]}]},{'model':'SalesforceField','as':_0x7454('0x14'),'include':[{'model':_0x7454('0x13'),'as':_0x7454('0x13'),'attributes':['id','name']}]},{'model':'SalesforceField','as':_0x7454('0x15'),'include':[{'model':_0x7454('0x13'),'as':_0x7454('0x13'),'attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x306e=['Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','remoteUri','clientId','securityToken','serverUrl','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects'];(function(_0xf404ce,_0x15c813){var _0x41d349=function(_0xfb0e50){while(--_0xfb0e50){_0xf404ce['push'](_0xf404ce['shift']());}};_0x41d349(++_0x15c813);}(_0x306e,0x13b));var _0xe306=function(_0x2964aa,_0x217131){_0x2964aa=_0x2964aa-0x0;var _0x452c31=_0x306e[_0x2964aa];return _0x452c31;};'use strict';var client=require(_0xe306('0x0'));exports[_0xe306('0x1')]=function(){return function(_0x4de7ed){return client[_0xe306('0x2')](_0xe306('0x3'),{'options':{'raw':![],'attributes':['id',_0xe306('0x4'),_0xe306('0x5'),_0xe306('0x6'),_0xe306('0x7'),_0xe306('0x8'),'clientSecret',_0xe306('0x9'),_0xe306('0xa'),'type'],'include':[{'model':_0xe306('0xb'),'as':_0xe306('0xc'),'attributes':['id',_0xe306('0x4'),_0xe306('0xd'),_0xe306('0xe'),_0xe306('0xf'),_0xe306('0x10'),_0xe306('0x11'),_0xe306('0x12'),'additionalSearchLead'],'include':[{'model':_0xe306('0x13'),'as':_0xe306('0x14'),'include':[{'model':_0xe306('0x15'),'as':_0xe306('0x15'),'attributes':['id',_0xe306('0x4')]}]},{'model':_0xe306('0x13'),'as':_0xe306('0x16'),'include':[{'model':'Variable','as':_0xe306('0x15'),'attributes':['id','name']}]},{'model':_0xe306('0x13'),'as':_0xe306('0x17'),'include':[{'model':_0xe306('0x15'),'as':_0xe306('0x15'),'attributes':['id',_0xe306('0x4')]}]}]}]},'log':_0xe306('0x3')});};};
\ No newline at end of file
index 235dd88..900b1d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['password','email','ServicenowConfiguration','name','Subjects','type','content','Variable','ServicenowField','Descriptions','key','keyType','keyContent','variableName','Fields','idField','nameField','../../client','getServicenowAccounts','Request','GetServicenowAccount','username'];(function(_0x13e763,_0x3097ab){var _0x50a51f=function(_0x3f3748){while(--_0x3f3748){_0x13e763['push'](_0x13e763['shift']());}};_0x50a51f(++_0x3097ab);}(_0xabce,0x103));var _0xeabc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xabce[_0x54d4fe];return _0x1ab5bb;};'use strict';var client=require(_0xeabc('0x0'));exports[_0xeabc('0x1')]=function(){return function(_0x357cda){return client[_0xeabc('0x2')](_0xeabc('0x3'),{'options':{'raw':![],'attributes':['id','name','description',_0xeabc('0x4'),_0xeabc('0x5'),_0xeabc('0x6'),'remoteUri','serverUrl'],'include':[{'model':_0xeabc('0x7'),'as':'Configurations','attributes':['id',_0xeabc('0x8')],'include':[{'model':'ServicenowField','as':_0xeabc('0x9'),'attributes':['id',_0xeabc('0xa'),_0xeabc('0xb'),'variableName'],'include':[{'model':_0xeabc('0xc'),'as':_0xeabc('0xc'),'attributes':['id',_0xeabc('0x8')]}]},{'model':_0xeabc('0xd'),'as':_0xeabc('0xe'),'attributes':['id',_0xeabc('0xa'),_0xeabc('0xb'),_0xeabc('0xf'),_0xeabc('0x10'),_0xeabc('0x11'),_0xeabc('0x12')],'include':[{'model':_0xeabc('0xc'),'as':_0xeabc('0xc'),'attributes':['id',_0xeabc('0x8')]}]},{'model':_0xeabc('0xd'),'as':_0xeabc('0x13'),'attributes':['id','type',_0xeabc('0xb'),_0xeabc('0x14'),_0xeabc('0x15'),'customField','variableName'],'include':[{'model':_0xeabc('0xc'),'as':_0xeabc('0xc'),'attributes':['id',_0xeabc('0x8')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
+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(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5ee134,_0x183cfb){_0x5ee134=_0x5ee134-0x0;var _0x39d21f=_0xc6ac[_0x5ee134];return _0x39d21f;};'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
index fdfb79d..2609f96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['serverUrl','SugarcrmConfiguration','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','remoteUri'];(function(_0x5dcb12,_0x47cba1){var _0x145c04=function(_0x473397){while(--_0x473397){_0x5dcb12['push'](_0x5dcb12['shift']());}};_0x145c04(++_0x47cba1);}(_0x1967,0x173));var _0x7196=function(_0x16eeae,_0x257876){_0x16eeae=_0x16eeae-0x0;var _0x420cb2=_0x1967[_0x16eeae];return _0x420cb2;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7')],'include':[{'model':_0x7196('0x8'),'as':'Configurations','attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd')],'include':[{'model':'Variable','as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0xb'),'content','key',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0x12'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0x13'),'nameField',_0x7196('0x14'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x2')});};};
\ No newline at end of file
+var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xda2d,0x102));var _0xdda2=function(_0x2ec790,_0xc1df4a){_0x2ec790=_0x2ec790-0x0;var _0x51053e=_0xda2d[_0x2ec790];return _0x51053e;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
index 104ffd9..57a7e0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f0f=['Fields','nameField','customField','getVtigerAccounts','GetVtigerAccount','accessKey','remoteUri','serverUrl','name','type','content','variableName','Variable','VtigerField','Descriptions','key','keyType','keyContent'];(function(_0x11b093,_0x5c103a){var _0x1feb89=function(_0x49fba1){while(--_0x49fba1){_0x11b093['push'](_0x11b093['shift']());}};_0x1feb89(++_0x5c103a);}(_0x2f0f,0x81));var _0xf2f0=function(_0x141e5f,_0x216927){_0x141e5f=_0x141e5f-0x0;var _0x5bea96=_0x2f0f[_0x141e5f];return _0x5bea96;};'use strict';var client=require('../../client');exports[_0xf2f0('0x0')]=function(){return function(_0x355e57){return client['Request'](_0xf2f0('0x1'),{'options':{'raw':![],'attributes':['id','name','description','username',_0xf2f0('0x2'),_0xf2f0('0x3'),_0xf2f0('0x4')],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id',_0xf2f0('0x5')],'include':[{'model':'VtigerField','as':'Subjects','attributes':['id',_0xf2f0('0x6'),_0xf2f0('0x7'),_0xf2f0('0x8')],'include':[{'model':_0xf2f0('0x9'),'as':_0xf2f0('0x9'),'attributes':['id',_0xf2f0('0x5')]}]},{'model':_0xf2f0('0xa'),'as':_0xf2f0('0xb'),'attributes':['id',_0xf2f0('0x6'),_0xf2f0('0x7'),_0xf2f0('0xc'),_0xf2f0('0xd'),_0xf2f0('0xe'),'variableName'],'include':[{'model':_0xf2f0('0x9'),'as':_0xf2f0('0x9'),'attributes':['id',_0xf2f0('0x5')]}]},{'model':_0xf2f0('0xa'),'as':_0xf2f0('0xf'),'attributes':['id',_0xf2f0('0x6'),'content','idField',_0xf2f0('0x10'),_0xf2f0('0x11'),'variableName'],'include':[{'model':'Variable','as':_0xf2f0('0x9'),'attributes':['id','name']}]}]}]},'log':_0xf2f0('0x1')});};};
\ No newline at end of file
+var _0xc4fb=['idField','nameField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','name','VtigerField','Subjects','type','variableName','Variable','Descriptions','content','key'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xc4fb,0x18f));var _0xbc4f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4fb[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0xbc4f('0x0'));exports[_0xbc4f('0x1')]=function(){return function(_0x47b3b5){return client[_0xbc4f('0x2')](_0xbc4f('0x3'),{'options':{'raw':![],'attributes':['id','name','description',_0xbc4f('0x4'),_0xbc4f('0x5'),_0xbc4f('0x6'),_0xbc4f('0x7')],'include':[{'model':_0xbc4f('0x8'),'as':_0xbc4f('0x9'),'attributes':['id',_0xbc4f('0xa')],'include':[{'model':_0xbc4f('0xb'),'as':_0xbc4f('0xc'),'attributes':['id',_0xbc4f('0xd'),'content',_0xbc4f('0xe')],'include':[{'model':_0xbc4f('0xf'),'as':_0xbc4f('0xf'),'attributes':['id',_0xbc4f('0xa')]}]},{'model':_0xbc4f('0xb'),'as':_0xbc4f('0x10'),'attributes':['id',_0xbc4f('0xd'),_0xbc4f('0x11'),_0xbc4f('0x12'),'keyType','keyContent',_0xbc4f('0xe')],'include':[{'model':_0xbc4f('0xf'),'as':'Variable','attributes':['id','name']}]},{'model':_0xbc4f('0xb'),'as':'Fields','attributes':['id',_0xbc4f('0xd'),_0xbc4f('0x11'),_0xbc4f('0x13'),_0xbc4f('0x14'),_0xbc4f('0x15'),'variableName'],'include':[{'model':_0xbc4f('0xf'),'as':_0xbc4f('0xf'),'attributes':['id',_0xbc4f('0xa')]}]}]}]},'log':_0xbc4f('0x3')});};};
\ No newline at end of file
index 8578333..427ecec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42c6=['../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','serverUrl','type','ZendeskConfiguration','Configurations','Tag','Subjects','content','Variable','ZendeskField','Descriptions','keyType','keyContent','variableName','Fields','idField','nameField','customField'];(function(_0xa290da,_0x31610a){var _0xe6dbe3=function(_0x216caf){while(--_0x216caf){_0xa290da['push'](_0xa290da['shift']());}};_0xe6dbe3(++_0x31610a);}(_0x42c6,0x12c));var _0x642c=function(_0x2961cb,_0x5eb2e6){_0x2961cb=_0x2961cb-0x0;var _0x339f13=_0x42c6[_0x2961cb];return _0x339f13;};'use strict';var client=require(_0x642c('0x0'));exports[_0x642c('0x1')]=function(){return function(_0x4317ec){return client[_0x642c('0x2')](_0x642c('0x3'),{'options':{'raw':![],'attributes':['id',_0x642c('0x4'),_0x642c('0x5'),_0x642c('0x6'),_0x642c('0x7'),'remoteUri','authType',_0x642c('0x8'),_0x642c('0x9')],'include':[{'model':_0x642c('0xa'),'as':_0x642c('0xb'),'attributes':['id',_0x642c('0x4')],'include':[{'model':_0x642c('0xc'),'attributes':['id',_0x642c('0x4')]},{'model':'ZendeskField','as':_0x642c('0xd'),'attributes':['id',_0x642c('0x9'),_0x642c('0xe'),'variableName'],'include':[{'model':_0x642c('0xf'),'as':_0x642c('0xf'),'attributes':['id',_0x642c('0x4')]}]},{'model':_0x642c('0x10'),'as':_0x642c('0x11'),'attributes':['id',_0x642c('0x9'),_0x642c('0xe'),'key',_0x642c('0x12'),_0x642c('0x13'),_0x642c('0x14')],'include':[{'model':_0x642c('0xf'),'as':'Variable','attributes':['id',_0x642c('0x4')]}]},{'model':_0x642c('0x10'),'as':_0x642c('0x15'),'attributes':['id',_0x642c('0x9'),_0x642c('0xe'),_0x642c('0x16'),_0x642c('0x17'),_0x642c('0x18'),_0x642c('0x14')],'include':[{'model':_0x642c('0xf'),'as':_0x642c('0xf'),'attributes':['id','name']}]}]}]},'log':_0x642c('0x3')});};};
\ No newline at end of file
+var _0x0336=['ZendeskConfiguration','Configurations','Tag','Subjects','type','variableName','Variable','ZendeskField','content','key','keyType','keyContent','Fields','nameField','getZendeskAccounts','Request','GetZendeskAccount','name','password','token','remoteUri','authType'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x0336,0xd4));var _0x6033=function(_0x3bf989,_0x312165){_0x3bf989=_0x3bf989-0x0;var _0x387a20=_0x0336[_0x3bf989];return _0x387a20;};'use strict';var client=require('../../client');exports[_0x6033('0x0')]=function(){return function(_0x55adef){return client[_0x6033('0x1')](_0x6033('0x2'),{'options':{'raw':![],'attributes':['id',_0x6033('0x3'),'username',_0x6033('0x4'),_0x6033('0x5'),_0x6033('0x6'),_0x6033('0x7'),'serverUrl','type'],'include':[{'model':_0x6033('0x8'),'as':_0x6033('0x9'),'attributes':['id',_0x6033('0x3')],'include':[{'model':_0x6033('0xa'),'attributes':['id','name']},{'model':'ZendeskField','as':_0x6033('0xb'),'attributes':['id',_0x6033('0xc'),'content',_0x6033('0xd')],'include':[{'model':'Variable','as':_0x6033('0xe'),'attributes':['id',_0x6033('0x3')]}]},{'model':_0x6033('0xf'),'as':'Descriptions','attributes':['id','type',_0x6033('0x10'),_0x6033('0x11'),_0x6033('0x12'),_0x6033('0x13'),_0x6033('0xd')],'include':[{'model':_0x6033('0xe'),'as':_0x6033('0xe'),'attributes':['id',_0x6033('0x3')]}]},{'model':_0x6033('0xf'),'as':_0x6033('0x14'),'attributes':['id','type',_0x6033('0x10'),'idField',_0x6033('0x15'),'customField','variableName'],'include':[{'model':_0x6033('0xe'),'as':'Variable','attributes':['id',_0x6033('0x3')]}]}]}]},'log':_0x6033('0x2')});};};
\ No newline at end of file
index 7e188f4..ee696ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1e1=['zone','clientSecret','code','refreshToken','Configurations','description','ZohoField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','idField','nameField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name','host'];(function(_0x4e35d7,_0x134c0b){var _0x5ebe7f=function(_0x3baeb7){while(--_0x3baeb7){_0x4e35d7['push'](_0x4e35d7['shift']());}};_0x5ebe7f(++_0x134c0b);}(_0xb1e1,0x10d));var _0x1b1e=function(_0x2e33bc,_0x52af7f){_0x2e33bc=_0x2e33bc-0x0;var _0x49dd62=_0xb1e1[_0x2e33bc];return _0x49dd62;};'use strict';var client=require(_0x1b1e('0x0'));exports[_0x1b1e('0x1')]=function(){return function(_0x54917d){return client[_0x1b1e('0x2')](_0x1b1e('0x3'),{'options':{'raw':![],'attributes':['id',_0x1b1e('0x4'),'description',_0x1b1e('0x5'),_0x1b1e('0x6'),'clientId',_0x1b1e('0x7'),'serverUrl',_0x1b1e('0x8'),_0x1b1e('0x9')],'include':[{'model':'ZohoConfiguration','as':_0x1b1e('0xa'),'attributes':['id',_0x1b1e('0x4'),'moduleCreate','moduleSearch',_0x1b1e('0xb')],'include':[{'model':_0x1b1e('0xc'),'as':_0x1b1e('0xd'),'attributes':['id','type',_0x1b1e('0xe'),_0x1b1e('0xf')],'include':[{'model':_0x1b1e('0x10'),'as':'Variable','attributes':['id',_0x1b1e('0x4')]}]},{'model':_0x1b1e('0xc'),'as':_0x1b1e('0x11'),'attributes':['id',_0x1b1e('0x12'),_0x1b1e('0xe'),_0x1b1e('0x13'),_0x1b1e('0x14'),_0x1b1e('0x15'),'variableName'],'include':[{'model':'Variable','as':_0x1b1e('0x10'),'attributes':['id',_0x1b1e('0x4')]}]},{'model':_0x1b1e('0xc'),'as':'Fields','attributes':['id',_0x1b1e('0x12'),'content',_0x1b1e('0x16'),_0x1b1e('0x17'),_0x1b1e('0x18'),_0x1b1e('0xf')],'include':[{'model':_0x1b1e('0x10'),'as':_0x1b1e('0x10'),'attributes':['id','name']}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0x285a=['serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','Variable','Descriptions','key','keyType','variableName','Fields','idField','nameField','customField','../../client','Request','GetZohoAccount','name','description','zone','clientId','clientSecret'];(function(_0x498ccc,_0x1b7dd4){var _0xbaf470=function(_0x358227){while(--_0x358227){_0x498ccc['push'](_0x498ccc['shift']());}};_0xbaf470(++_0x1b7dd4);}(_0x285a,0x1d4));var _0xa285=function(_0x5bd5e1,_0x1df092){_0x5bd5e1=_0x5bd5e1-0x0;var _0x3e9931=_0x285a[_0x5bd5e1];return _0x3e9931;};'use strict';var client=require(_0xa285('0x0'));exports['getZohoAccounts']=function(){return function(_0x66cd19){return client[_0xa285('0x1')](_0xa285('0x2'),{'options':{'raw':![],'attributes':['id',_0xa285('0x3'),_0xa285('0x4'),'host',_0xa285('0x5'),_0xa285('0x6'),_0xa285('0x7'),_0xa285('0x8'),_0xa285('0x9'),_0xa285('0xa')],'include':[{'model':_0xa285('0xb'),'as':_0xa285('0xc'),'attributes':['id','name',_0xa285('0xd'),_0xa285('0xe'),_0xa285('0x4')],'include':[{'model':_0xa285('0xf'),'as':_0xa285('0x10'),'attributes':['id',_0xa285('0x11'),_0xa285('0x12'),'variableName'],'include':[{'model':_0xa285('0x13'),'as':_0xa285('0x13'),'attributes':['id',_0xa285('0x3')]}]},{'model':_0xa285('0xf'),'as':_0xa285('0x14'),'attributes':['id',_0xa285('0x11'),'content',_0xa285('0x15'),_0xa285('0x16'),'keyContent',_0xa285('0x17')],'include':[{'model':_0xa285('0x13'),'as':_0xa285('0x13'),'attributes':['id',_0xa285('0x3')]}]},{'model':_0xa285('0xf'),'as':_0xa285('0x18'),'attributes':['id',_0xa285('0x11'),'content',_0xa285('0x19'),_0xa285('0x1a'),_0xa285('0x1b'),_0xa285('0x17')],'include':[{'model':'Variable','as':_0xa285('0x13'),'attributes':['id',_0xa285('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
index 1b921be..d5c5aeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x570c=['dialer','stack','replace','silly','isArray','length','resolve','every','number','string','map','interval','concat','Request','../../../config/logger'];(function(_0xdf0a3f,_0x3fa529){var _0x15ce77=function(_0x4f018e){while(--_0x4f018e){_0xdf0a3f['push'](_0xdf0a3f['shift']());}};_0x15ce77(++_0x3fa529);}(_0x570c,0x68));var _0xc570=function(_0x424e33,_0x30f86c){_0x424e33=_0x424e33-0x0;var _0x84f78c=_0x570c[_0x424e33];return _0x84f78c;};var logger=require(_0xc570('0x0'))(_0xc570('0x1'));var client=require('../client');function intervalIftime(_0x447976,_0x421ac1){const _0x378e06=new Error()[_0xc570('0x2')][_0xc570('0x3')](/^Error/,'')['trim']();logger[_0xc570('0x4')]('intervalIftime\x20called\x20with',_0x447976,_0x421ac1,_0x378e06);const _0x5a91fd=Array[_0xc570('0x5')](_0x447976);if(!_0x447976||_0x5a91fd&&_0x447976[_0xc570('0x6')]===0x0){return Promise[_0xc570('0x7')](![]);}else{var _0x40a6ab=[];var _0x3cf04d=[];var _0x5c7731=_0x5a91fd?_0x447976:[_0x447976];var _0x296e2d=_0x5c7731[_0xc570('0x8')](function(_0x47f8f7){return typeof _0x47f8f7===_0xc570('0x9');});var _0x2018bb=_0x5c7731[_0xc570('0x8')](function(_0x4bcfae){return typeof _0x4bcfae===_0xc570('0xa');});if(!_0x296e2d&&!_0x2018bb){_0x40a6ab=_0x5c7731[_0xc570('0xb')](function(_0x12643e){return _0x12643e['id'];});if(_0x40a6ab[_0xc570('0x6')]===0x0){_0x3cf04d=_0x5c7731['map'](function(_0x5f00bd){return _0x5f00bd[_0xc570('0xc')];});}}else{if(_0x296e2d){_0x40a6ab=_0x40a6ab[_0xc570('0xd')](_0x5c7731);}if(_0x2018bb){_0x3cf04d=_0x3cf04d[_0xc570('0xd')](_0x5c7731);}}return client[_0xc570('0xe')]('IntervalIftime',{'intervalIds':_0x40a6ab,'intervals':_0x3cf04d,'timezone':_0x421ac1,'log':'IntervalIftime'});}}exports['intervalIftime']=intervalIftime;
\ No newline at end of file
+var _0xd3fb=['../client','stack','replace','trim','silly','intervalIftime\x20called\x20with','isArray','every','number','map','interval','concat','Request','IntervalIftime','../../../config/logger'];(function(_0x16d5ed,_0x496f84){var _0xd7e99d=function(_0x568909){while(--_0x568909){_0x16d5ed['push'](_0x16d5ed['shift']());}};_0xd7e99d(++_0x496f84);}(_0xd3fb,0x10d));var _0xbd3f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd3fb[_0x19e35c];return _0x3e1fe8;};var logger=require(_0xbd3f('0x0'))('dialer');var client=require(_0xbd3f('0x1'));function intervalIftime(_0x1db3cd,_0x26c54b){const _0x148dab=new Error()[_0xbd3f('0x2')][_0xbd3f('0x3')](/^Error/,'')[_0xbd3f('0x4')]();logger[_0xbd3f('0x5')](_0xbd3f('0x6'),_0x1db3cd,_0x26c54b,_0x148dab);const _0x2c8574=Array[_0xbd3f('0x7')](_0x1db3cd);if(!_0x1db3cd||_0x2c8574&&_0x1db3cd['length']===0x0){return Promise['resolve'](![]);}else{var _0x2a88d1=[];var _0x6d85b=[];var _0x6e9afc=_0x2c8574?_0x1db3cd:[_0x1db3cd];var _0x1bd172=_0x6e9afc[_0xbd3f('0x8')](function(_0x49269e){return typeof _0x49269e===_0xbd3f('0x9');});var _0x37b825=_0x6e9afc[_0xbd3f('0x8')](function(_0x1070b2){return typeof _0x1070b2==='string';});if(!_0x1bd172&&!_0x37b825){_0x2a88d1=_0x6e9afc[_0xbd3f('0xa')](function(_0x461f03){return _0x461f03['id'];});if(_0x2a88d1['length']===0x0){_0x6d85b=_0x6e9afc['map'](function(_0x30e30e){return _0x30e30e[_0xbd3f('0xb')];});}}else{if(_0x1bd172){_0x2a88d1=_0x2a88d1['concat'](_0x6e9afc);}if(_0x37b825){_0x6d85b=_0x6d85b[_0xbd3f('0xc')](_0x6e9afc);}}return client[_0xbd3f('0xd')]('IntervalIftime',{'intervalIds':_0x2a88d1,'intervals':_0x6d85b,'timezone':_0x26c54b,'log':_0xbd3f('0xe')});}}exports['intervalIftime']=intervalIftime;
\ No newline at end of file
index ca6fd7a..3370d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x273e=['../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','diff','seconds','inbound','calleridnum','exten','queue','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','outbound','accountcode','dialstring','agent','toNumber'];(function(_0x23a8ba,_0xab5848){var _0x468389=function(_0x5ea5f4){while(--_0x5ea5f4){_0x23a8ba['push'](_0x23a8ba['shift']());}};_0x468389(++_0xab5848);}(_0x273e,0x74));var _0xe273=function(_0x4e58e6,_0x59e7a4){_0x4e58e6=_0x4e58e6-0x0;var _0x1ce97b=_0x273e[_0x4e58e6];return _0x1ce97b;};'use strict';var moment=require('moment');var _=require('lodash');var util=require('util');var client=require(_0xe273('0x0'));exports[_0xe273('0x1')]=function(_0xeb79f2){var _0x117349=_0xeb79f2[_0xe273('0x2')]||_0xeb79f2[_0xe273('0x3')];return client[_0xe273('0x4')](_0xe273('0x5'),{'body':{'channel':_0xe273('0x6'),'membername':_0xeb79f2[_0xe273('0x7')],'interface':_[_0xe273('0x8')](_0xeb79f2[_0xe273('0x9')])?util[_0xe273('0xa')](_0xe273('0xb'),_0xeb79f2['lastAssignedTo']):_0xeb79f2[_0xe273('0x9')],'type':'TALKING','enterAt':_0xeb79f2['queuecallerleaveAt'],'exitAt':_0x117349,'duration':moment(_0x117349)[_0xe273('0xc')](_0xeb79f2['queuecallerleaveAt'],_0xe273('0xd')),'data1':_0xe273('0xe'),'data2':_0xeb79f2[_0xe273('0xf')],'data3':_0xeb79f2[_0xe273('0x10')],'data4':null,'data5':_0xeb79f2[_0xe273('0x11')],'role':'agent','internal':_0xeb79f2['accountcode']?_['toNumber'](_0xeb79f2['accountcode']):undefined,'uniqueid':_0xeb79f2[_0xe273('0x12')]},'log':_0xe273('0x5')});};exports[_0xe273('0x13')]=function(_0x4aa39f){return client[_0xe273('0x4')](_0xe273('0x5'),{'body':{'channel':'voice','membername':_0x4aa39f[_0xe273('0x14')],'interface':_0x4aa39f['interface'],'type':_0xe273('0x15'),'enterAt':_0x4aa39f[_0xe273('0x16')],'exitAt':_0x4aa39f[_0xe273('0x17')],'duration':moment(_0x4aa39f[_0xe273('0x17')])['diff'](_0x4aa39f['starttime'],'seconds')>=0x0?moment(_0x4aa39f['endtime'])['diff'](_0x4aa39f[_0xe273('0x16')],_0xe273('0xd')):null,'data1':_0xe273('0x18'),'data2':_0x4aa39f[_0xe273('0x19')],'data3':_0x4aa39f['exten'],'data4':_0x4aa39f[_0xe273('0x1a')]||null,'role':_0xe273('0x1b'),'internal':_0x4aa39f[_0xe273('0x19')]?_[_0xe273('0x1c')](_0x4aa39f[_0xe273('0x19')]):undefined,'uniqueid':_0x4aa39f[_0xe273('0x12')]},'log':_0xe273('0x5')});};
\ No newline at end of file
+var _0x635d=['queue','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','agent','moment','lodash','util','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','TALKING','diff','queuecallerleaveAt','seconds','calleridnum','exten'];(function(_0x52b6b0,_0x514095){var _0x4a0d4b=function(_0x4d6dac){while(--_0x4d6dac){_0x52b6b0['push'](_0x52b6b0['shift']());}};_0x4a0d4b(++_0x514095);}(_0x635d,0x10c));var _0xd635=function(_0x32754f,_0x596a8b){_0x32754f=_0x32754f-0x0;var _0x4aa71d=_0x635d[_0x32754f];return _0x4aa71d;};'use strict';var moment=require(_0xd635('0x0'));var _=require(_0xd635('0x1'));var util=require(_0xd635('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x255dcd){var _0x217b88=_0x255dcd[_0xd635('0x3')]||_0x255dcd[_0xd635('0x4')];return client[_0xd635('0x5')](_0xd635('0x6'),{'body':{'channel':_0xd635('0x7'),'membername':_0x255dcd[_0xd635('0x8')],'interface':_[_0xd635('0x9')](_0x255dcd[_0xd635('0xa')])?util[_0xd635('0xb')]('SIP/%s',_0x255dcd[_0xd635('0x8')]):_0x255dcd[_0xd635('0xa')],'type':_0xd635('0xc'),'enterAt':_0x255dcd['queuecallerleaveAt'],'exitAt':_0x217b88,'duration':moment(_0x217b88)[_0xd635('0xd')](_0x255dcd[_0xd635('0xe')],_0xd635('0xf')),'data1':'inbound','data2':_0x255dcd[_0xd635('0x10')],'data3':_0x255dcd[_0xd635('0x11')],'data4':null,'data5':_0x255dcd[_0xd635('0x12')],'role':'agent','internal':_0x255dcd[_0xd635('0x13')]?_[_0xd635('0x14')](_0x255dcd['accountcode']):undefined,'uniqueid':_0x255dcd[_0xd635('0x15')]},'log':_0xd635('0x6')});};exports[_0xd635('0x16')]=function(_0x3f0985){return client[_0xd635('0x5')](_0xd635('0x6'),{'body':{'channel':_0xd635('0x7'),'membername':_0x3f0985['membername'],'interface':_0x3f0985[_0xd635('0xa')],'type':_0xd635('0xc'),'enterAt':_0x3f0985[_0xd635('0x17')],'exitAt':_0x3f0985[_0xd635('0x18')],'duration':moment(_0x3f0985['endtime'])[_0xd635('0xd')](_0x3f0985[_0xd635('0x17')],_0xd635('0xf'))>=0x0?moment(_0x3f0985[_0xd635('0x18')])['diff'](_0x3f0985[_0xd635('0x17')],_0xd635('0xf')):null,'data1':'outbound','data2':_0x3f0985[_0xd635('0x13')],'data3':_0x3f0985[_0xd635('0x11')],'data4':_0x3f0985['dialstring']||null,'role':_0xd635('0x19'),'internal':_0x3f0985[_0xd635('0x13')]?_[_0xd635('0x14')](_0x3f0985[_0xd635('0x13')]):undefined,'uniqueid':_0x3f0985[_0xd635('0x15')]},'log':_0xd635('0x6')});};
\ No newline at end of file
index 5386328..b311166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8286=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x8286,0x66));var _0x6828=function(_0x52857c,_0x2a6bdd){_0x52857c=_0x52857c-0x0;var _0x3ce8fc=_0x8286[_0x52857c];return _0x3ce8fc;};'use strict';var client=require(_0x6828('0x0'));exports[_0x6828('0x1')]=function(){return client[_0x6828('0x2')](_0x6828('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6828('0x4'),_0x6828('0x5')]},'log':_0x6828('0x6')});};
\ No newline at end of file
+var _0x145d=['GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x4d77b8,_0x208e64){var _0x82da62=function(_0x30f96){while(--_0x30f96){_0x4d77b8['push'](_0x4d77b8['shift']());}};_0x82da62(++_0x208e64);}(_0x145d,0xc9));var _0xd145=function(_0x10bed3,_0x51f4bc){_0x10bed3=_0x10bed3-0x0;var _0x1c7ce5=_0x145d[_0x10bed3];return _0x1c7ce5;};'use strict';var client=require('../client');exports[_0xd145('0x0')]=function(){return client[_0xd145('0x1')](_0xd145('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd145('0x3'),'previewRecallmeReminderInterval']},'log':_0xd145('0x4')});};
\ No newline at end of file
index 6da3608..3470a0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed27=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0xed27,0x183));var _0x7ed2=function(_0x50da62,_0x20323f){_0x50da62=_0x50da62-0x0;var _0x5b224b=_0xed27[_0x50da62];return _0x5b224b;};'use strict';var client=require(_0x7ed2('0x0'));exports[_0x7ed2('0x1')]=function(_0x1ba5f6){return function(_0x4f8d36){return client[_0x7ed2('0x2')](_0x7ed2('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7ed2('0x4'),_0x7ed2('0x5')]},'log':_0x7ed2('0x3')});};};
\ No newline at end of file
+var _0xafbf=['Request','GetTemplate','name','html','../client'];(function(_0x206381,_0x4db24f){var _0x26c424=function(_0x1b9391){while(--_0x1b9391){_0x206381['push'](_0x206381['shift']());}};_0x26c424(++_0x4db24f);}(_0xafbf,0x130));var _0xfafb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xafbf[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xfafb('0x0'));exports['getTemplates']=function(_0x2037a6){return function(_0x2be1a1){return client[_0xfafb('0x1')](_0xfafb('0x2'),{'options':{'raw':!![],'attributes':['id',_0xfafb('0x3'),_0xfafb('0x4')]},'log':_0xfafb('0x2')});};};
\ No newline at end of file
index 93caa2d..8357179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af2=['data3','data4','data5','data7','../client','Request','status','Condition','field','operator','value','Actions','action','data1','data2'];(function(_0x548d0f,_0x5aab64){var _0x418a05=function(_0x390264){while(--_0x390264){_0x548d0f['push'](_0x548d0f['shift']());}};_0x418a05(++_0x5aab64);}(_0x5af2,0x16c));var _0x25af=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5af2[_0x82129b];return _0x2ae5dc;};'use strict';var client=require(_0x25af('0x0'));exports['getTriggers']=function(_0x485dbf){return function(_0x49e336){return client[_0x25af('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel',_0x25af('0x2')],'include':[{'model':_0x25af('0x3'),'as':'AllConditions','attributes':['id',_0x25af('0x4'),_0x25af('0x5'),'value']},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x25af('0x4'),'operator',_0x25af('0x6')]},{'model':'Action','as':_0x25af('0x7'),'attributes':['id',_0x25af('0x8'),_0x25af('0x9'),_0x25af('0xa'),_0x25af('0xb'),_0x25af('0xc'),_0x25af('0xd'),'data6',_0x25af('0xe')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xef14=['GetTrigger','channel','status','field','operator','value','Condition','AnyConditions','Action','data1','data2','data3','data5','data6','data7','../client','getTriggers','Request'];(function(_0x38b37d,_0x2bb2ab){var _0x19b0cb=function(_0x9d8b41){while(--_0x9d8b41){_0x38b37d['push'](_0x38b37d['shift']());}};_0x19b0cb(++_0x2bb2ab);}(_0xef14,0x1ad));var _0x4ef1=function(_0x33aaa3,_0x11f65a){_0x33aaa3=_0x33aaa3-0x0;var _0x5e1037=_0xef14[_0x33aaa3];return _0x5e1037;};'use strict';var client=require(_0x4ef1('0x0'));exports[_0x4ef1('0x1')]=function(_0x914423){return function(_0x5a225c){return client[_0x4ef1('0x2')](_0x4ef1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4ef1('0x4'),_0x4ef1('0x5')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x4ef1('0x6'),_0x4ef1('0x7'),_0x4ef1('0x8')]},{'model':_0x4ef1('0x9'),'as':_0x4ef1('0xa'),'attributes':['id',_0x4ef1('0x6'),_0x4ef1('0x7'),_0x4ef1('0x8')]},{'model':_0x4ef1('0xb'),'as':'Actions','attributes':['id','action',_0x4ef1('0xc'),_0x4ef1('0xd'),_0x4ef1('0xe'),'data4',_0x4ef1('0xf'),_0x4ef1('0x10'),_0x4ef1('0x11')]}]},'log':_0x4ef1('0x3')});};};
\ No newline at end of file
index ccf74c0..ee4f7a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d7=['getTrunks','Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x4c517b,_0x2eecbf){var _0x53bbb1=function(_0x7c3a4f){while(--_0x7c3a4f){_0x4c517b['push'](_0x4c517b['shift']());}};_0x53bbb1(++_0x2eecbf);}(_0x86d7,0x8b));var _0x786d=function(_0xd0652d,_0x3b0eec){_0xd0652d=_0xd0652d-0x0;var _0x536138=_0x86d7[_0xd0652d];return _0x536138;};'use strict';var client=require(_0x786d('0x0'));exports[_0x786d('0x1')]=function(_0x3af5cb){return function(_0xe33629){return client[_0x786d('0x2')](_0x786d('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x786d('0x4'),_0x786d('0x5'),_0x786d('0x6')]},'log':_0x786d('0x3')});};};
\ No newline at end of file
+var _0xa990=['GetTrunk','name','registry','../client','getTrunks','Request'];(function(_0x5124b4,_0x37f8ed){var _0x2a283a=function(_0x422977){while(--_0x422977){_0x5124b4['push'](_0x5124b4['shift']());}};_0x2a283a(++_0x37f8ed);}(_0xa990,0xc9));var _0x0a99=function(_0x1c7100,_0x2eccbe){_0x1c7100=_0x1c7100-0x0;var _0x26c9fd=_0xa990[_0x1c7100];return _0x26c9fd;};'use strict';var client=require(_0x0a99('0x0'));exports[_0x0a99('0x1')]=function(_0x422a05){return function(_0x1270a9){return client[_0x0a99('0x2')](_0x0a99('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0a99('0x4'),_0x0a99('0x5'),'defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
index f4a2225..ecd95dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x10e966,_0x37ba97){var _0x57f40d=function(_0x4d000f){while(--_0x4d000f){_0x10e966['push'](_0x10e966['shift']());}};_0x57f40d(++_0x37ba97);}(_0x70e0,0x17b));var _0x070e=function(_0x26a13c,_0x13eb68){_0x26a13c=_0x26a13c-0x0;var _0xe68a11=_0x70e0[_0x26a13c];return _0xe68a11;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});};
\ No newline at end of file
index dc93ab4..177942a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9f6=['Request','update','UpdateVoiceAgentReport'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0xc9f6,0xb1));var _0x6c9f=function(_0x15ce0e,_0x4d6826){_0x15ce0e=_0x15ce0e-0x0;var _0x4da771=_0xc9f6[_0x15ce0e];return _0x4da771;};'use strict';var client=require('../client');exports['create']=function(_0x1d7cc0){return client[_0x6c9f('0x0')]('CreateVoiceAgentReport',{'body':_0x1d7cc0,'log':'CreateVoiceAgentReport'});};exports[_0x6c9f('0x1')]=function(_0x50e8f1,_0x3860e2,_0xaf9bf){return client[_0x6c9f('0x0')](_0x6c9f('0x2'),{'body':_0x50e8f1,'options':{'where':{'uniqueid':_0x3860e2,'interface':_0xaf9bf,'agentcomplete':!![]}},'log':_0x6c9f('0x2')});};
\ No newline at end of file
+var _0xce0a=['Request','CreateVoiceAgentReport','update','../client'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xce0a,0xf3));var _0xace0=function(_0x21c068,_0x369d6a){_0x21c068=_0x21c068-0x0;var _0x5cf199=_0xce0a[_0x21c068];return _0x5cf199;};'use strict';var client=require(_0xace0('0x0'));exports['create']=function(_0x3a2256){return client[_0xace0('0x1')](_0xace0('0x2'),{'body':_0x3a2256,'log':_0xace0('0x2')});};exports[_0xace0('0x3')]=function(_0x403bc0,_0x3f4899,_0x20add9){return client[_0xace0('0x1')]('UpdateVoiceAgentReport',{'body':_0x403bc0,'options':{'where':{'uniqueid':_0x3f4899,'interface':_0x20add9,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index cdac027..4b1555a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2699=['day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','GetVoiceCallReports','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','outbound','startOf'];(function(_0x54f8c3,_0x15e392){var _0x2cd1cc=function(_0x6f2ea4){while(--_0x6f2ea4){_0x54f8c3['push'](_0x54f8c3['shift']());}};_0x2cd1cc(++_0x15e392);}(_0x2699,0x185));var _0x9269=function(_0x4342f0,_0x3009c8){_0x4342f0=_0x4342f0-0x0;var _0x5ce9f0=_0x2699[_0x4342f0];return _0x5ce9f0;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x9269('0x0'));var client=require(_0x9269('0x1'));exports['create']=function(_0x5c0c14){return client[_0x9269('0x2')](_0x9269('0x3'),{'body':_[_0x9269('0x4')](_0x5c0c14,{'source':_0x5c0c14[_0x9269('0x5')],'destinationcontext':_0x5c0c14['context'],'callerid':_0x5c0c14[_0x9269('0x6')],'amaflags':'DOCUMENTATION'}),'log':_0x9269('0x3')});};exports[_0x9269('0x7')]=function(){return function(){return client[_0x9269('0x2')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x9269('0x8')],'createdAt':{'$between':[moment()[_0x9269('0x9')](_0x9269('0xa'))['format'](_0x9269('0xb')),moment()[_0x9269('0xc')]('day')[_0x9269('0xd')](_0x9269('0xb'))]}},'attributes':[_0x9269('0xe'),_0x9269('0xf'),_0x9269('0x10'),_0x9269('0x11')]},'log':_0x9269('0x12')});};};
\ No newline at end of file
+var _0x7e8b=['callerid','DOCUMENTATION','getVoiceCallReports','outbound','day','YYYY-MM-DD\x20HH:mm:ss','format','type','disposition','duration','billableseconds','GetVoiceCallReports','lodash','create','Request','CreateVoiceCallReport','calleridnum','context'];(function(_0x3179e9,_0x5993a0){var _0x51c770=function(_0x5e0a1b){while(--_0x5e0a1b){_0x3179e9['push'](_0x3179e9['shift']());}};_0x51c770(++_0x5993a0);}(_0x7e8b,0x162));var _0xb7e8=function(_0x11a7c9,_0x2de6e8){_0x11a7c9=_0x11a7c9-0x0;var _0x2bf3d8=_0x7e8b[_0x11a7c9];return _0x2bf3d8;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xb7e8('0x0'));var client=require('../client');exports[_0xb7e8('0x1')]=function(_0x11a60f){return client[_0xb7e8('0x2')](_0xb7e8('0x3'),{'body':_['merge'](_0x11a60f,{'source':_0x11a60f[_0xb7e8('0x4')],'destinationcontext':_0x11a60f[_0xb7e8('0x5')],'callerid':_0x11a60f[_0xb7e8('0x6')],'amaflags':_0xb7e8('0x7')}),'log':_0xb7e8('0x3')});};exports[_0xb7e8('0x8')]=function(){return function(){return client[_0xb7e8('0x2')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xb7e8('0x9')],'createdAt':{'$between':[moment()['startOf'](_0xb7e8('0xa'))['format'](_0xb7e8('0xb')),moment()['endOf'](_0xb7e8('0xa'))[_0xb7e8('0xc')](_0xb7e8('0xb'))]}},'attributes':[_0xb7e8('0xd'),_0xb7e8('0xe'),_0xb7e8('0xf'),_0xb7e8('0x10')]},'log':_0xb7e8('0x11')});};};
\ No newline at end of file
index e184959..44598d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fc=['CreateVoiceDialReport','../client','create','Request'];(function(_0x358881,_0x1b748c){var _0x76792d=function(_0x322bb8){while(--_0x322bb8){_0x358881['push'](_0x358881['shift']());}};_0x76792d(++_0x1b748c);}(_0xe2fc,0x7d));var _0xce2f=function(_0x20a21f,_0x13dea1){_0x20a21f=_0x20a21f-0x0;var _0x272028=_0xe2fc[_0x20a21f];return _0x272028;};'use strict';var client=require(_0xce2f('0x0'));exports[_0xce2f('0x1')]=function(_0x30a21d){return client[_0xce2f('0x2')]('CreateVoiceDialReport',{'body':_0x30a21d,'log':_0xce2f('0x3')});};
\ No newline at end of file
+var _0x042c=['../client','Request','CreateVoiceDialReport'];(function(_0x2d8857,_0x275b69){var _0x1f94e2=function(_0x474d22){while(--_0x474d22){_0x2d8857['push'](_0x2d8857['shift']());}};_0x1f94e2(++_0x275b69);}(_0x042c,0xc0));var _0xc042=function(_0x1f2514,_0x18e401){_0x1f2514=_0x1f2514-0x0;var _0x5d5c4b=_0x042c[_0x1f2514];return _0x5d5c4b;};'use strict';var client=require(_0xc042('0x0'));exports['create']=function(_0xbbea95){return client[_0xc042('0x1')](_0xc042('0x2'),{'body':_0xbbea95,'log':_0xc042('0x2')});};
\ No newline at end of file
index 327e413..6b68bfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c2=['../client','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x31c2,0x98));var _0x231c=function(_0x37255c,_0x8ce01e){_0x37255c=_0x37255c-0x0;var _0x28e3e1=_0x31c2[_0x37255c];return _0x28e3e1;};'use strict';var client=require(_0x231c('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x231c('0x1'),{'options':{'raw':!![],'attributes':['id',_0x231c('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x231c('0x3')});};};
\ No newline at end of file
+var _0xb332=['recordingFormat','../client','Request','GetVoiceExtension'];(function(_0x4f290d,_0x1f2385){var _0x54331e=function(_0x170e2b){while(--_0x170e2b){_0x4f290d['push'](_0x4f290d['shift']());}};_0x54331e(++_0x1f2385);}(_0xb332,0xd9));var _0x2b33=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0xb332[_0x3005d5];return _0x547c7e;};'use strict';var client=require(_0x2b33('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x2b33('0x1')](_0x2b33('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x2b33('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index 5eecf2b..4e37d40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x549f=['dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence'];(function(_0x1b4311,_0x44c7f7){var _0x40adc3=function(_0x17e87a){while(--_0x17e87a){_0x1b4311['push'](_0x1b4311['shift']());}};_0x40adc3(++_0x44c7f7);}(_0x549f,0xf7));var _0xf549=function(_0x8f6f9d,_0x20f5c6){_0x8f6f9d=_0x8f6f9d-0x0;var _0x2a15f9=_0x549f[_0x8f6f9d];return _0x2a15f9;};'use strict';var client=require(_0xf549('0x0'));exports[_0xf549('0x1')]=function(){return function(){return client['Request'](_0xf549('0x2'),{'options':{'raw':![],'attributes':['id',_0xf549('0x3'),_0xf549('0x4'),_0xf549('0x5'),_0xf549('0x6'),'monitor_format','type',_0xf549('0x7'),_0xf549('0x8'),_0xf549('0x9'),_0xf549('0xa'),'dialPowerLevel',_0xf549('0xb'),_0xf549('0xc'),_0xf549('0xd'),'dialOriginateCallerIdName',_0xf549('0xe'),_0xf549('0xf'),_0xf549('0x10'),_0xf549('0x11'),_0xf549('0x12'),_0xf549('0x13'),_0xf549('0x14'),'dialBusyMaxRetry',_0xf549('0x15'),'dialNoAnswerMaxRetry',_0xf549('0x16'),_0xf549('0x17'),_0xf549('0x18'),_0xf549('0x19'),'dialPrefix',_0xf549('0x1a'),_0xf549('0x1b'),_0xf549('0x1c'),_0xf549('0x1d'),'dialAMDAfterGreetingSilence',_0xf549('0x1e'),'dialAMDMinWordLength',_0xf549('0x1f'),_0xf549('0x20'),_0xf549('0x21'),_0xf549('0x22'),_0xf549('0x23'),_0xf549('0x24'),_0xf549('0x25'),_0xf549('0x26'),_0xf549('0x27'),_0xf549('0x28'),_0xf549('0x29'),_0xf549('0x2a'),_0xf549('0x2b'),_0xf549('0x2c'),'dialCutDigit',_0xf549('0x2d'),_0xf549('0x2e'),_0xf549('0x2f'),_0xf549('0x30'),_0xf549('0x31'),_0xf549('0x32'),_0xf549('0x33'),_0xf549('0x34'),_0xf549('0x35'),_0xf549('0x36'),_0xf549('0x37'),_0xf549('0x38'),_0xf549('0x39'),_0xf549('0x3a'),_0xf549('0x3b')],'include':[{'model':_0xf549('0x3c'),'as':_0xf549('0x3c'),'attributes':['id',_0xf549('0x3'),_0xf549('0x3d'),_0xf549('0x3e')]},{'model':_0xf549('0x3f'),'as':_0xf549('0x40'),'attributes':['id',_0xf549('0x3')]},{'model':_0xf549('0x3c'),'as':_0xf549('0x41'),'attributes':['id','name',_0xf549('0x3d'),'active']},{'model':_0xf549('0x42'),'as':_0xf549('0x42'),'attributes':['id',_0xf549('0x3')],'include':[{'model':_0xf549('0x42'),'as':_0xf549('0x43'),'attributes':['id','name',_0xf549('0x44')]}]}]},'log':_0xf549('0x1')});};};
\ No newline at end of file
+var _0xea5f=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea5f,0x1b3));var _0xfea5=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xea5f[_0x53ccf2];return _0x5a2964;};'use strict';var client=require(_0xfea5('0x0'));exports[_0xfea5('0x1')]=function(){return function(){return client[_0xfea5('0x2')](_0xfea5('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xfea5('0x4'),_0xfea5('0x5'),_0xfea5('0x6'),_0xfea5('0x7'),_0xfea5('0x8'),'dialActive',_0xfea5('0x9'),_0xfea5('0xa'),_0xfea5('0xb'),'dialPowerLevel',_0xfea5('0xc'),_0xfea5('0xd'),_0xfea5('0xe'),'dialOriginateCallerIdName',_0xfea5('0xf'),_0xfea5('0x10'),'dialQueueOptions',_0xfea5('0x11'),_0xfea5('0x12'),_0xfea5('0x13'),_0xfea5('0x14'),_0xfea5('0x15'),'dialBusyRetryFrequency',_0xfea5('0x16'),'dialNoAnswerRetryFrequency',_0xfea5('0x17'),_0xfea5('0x18'),_0xfea5('0x19'),_0xfea5('0x1a'),'dialCheckDuplicateType',_0xfea5('0x1b'),_0xfea5('0x1c'),_0xfea5('0x1d'),_0xfea5('0x1e'),_0xfea5('0x1f'),_0xfea5('0x20'),_0xfea5('0x21'),_0xfea5('0x22'),_0xfea5('0x23'),_0xfea5('0x24'),_0xfea5('0x25'),_0xfea5('0x26'),_0xfea5('0x27'),_0xfea5('0x28'),_0xfea5('0x29'),_0xfea5('0x2a'),_0xfea5('0x2b'),_0xfea5('0x7'),_0xfea5('0x2c'),_0xfea5('0x2d'),_0xfea5('0x2e'),_0xfea5('0x2f'),'dialNoSuchNumberRetryFrequency',_0xfea5('0x30'),_0xfea5('0x31'),_0xfea5('0x32'),_0xfea5('0x33'),_0xfea5('0x34'),_0xfea5('0x35'),_0xfea5('0x36'),_0xfea5('0x37'),_0xfea5('0x38'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xfea5('0x39'),_0xfea5('0x3a')],'include':[{'model':_0xfea5('0x3b'),'as':_0xfea5('0x3b'),'attributes':['id',_0xfea5('0x3c'),_0xfea5('0x3d'),_0xfea5('0x3e')]},{'model':'Pause','as':_0xfea5('0x3f'),'attributes':['id',_0xfea5('0x3c')]},{'model':'Trunk','as':_0xfea5('0x40'),'attributes':['id',_0xfea5('0x3c'),_0xfea5('0x3d'),_0xfea5('0x3e')]},{'model':_0xfea5('0x41'),'as':_0xfea5('0x41'),'attributes':['id',_0xfea5('0x3c')],'include':[{'model':_0xfea5('0x41'),'as':_0xfea5('0x42'),'attributes':['id','name','interval']}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index 5996dc9..4df68e3 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(_0x522cd8,_0x313304){var _0x41238a=function(_0x5d81ec){while(--_0x5d81ec){_0x522cd8['push'](_0x522cd8['shift']());}};_0x41238a(++_0x313304);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x1291bb,_0x5549c6){var _0x3cb45c=function(_0x55b3f9){while(--_0x55b3f9){_0x1291bb['push'](_0x1291bb['shift']());}};_0x3cb45c(++_0x5549c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 8edcec1..d3ac9e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67bf=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x217bba,_0x53dec1){var _0x533ca5=function(_0x4606ba){while(--_0x4606ba){_0x217bba['push'](_0x217bba['shift']());}};_0x533ca5(++_0x53dec1);}(_0x67bf,0x109));var _0xf67b=function(_0x13c183,_0x2d916a){_0x13c183=_0x13c183-0x0;var _0x55796f=_0x67bf[_0x13c183];return _0x55796f;};'use strict';var client=require(_0xf67b('0x0'));exports[_0xf67b('0x1')]=function(_0x38303d){return function(){return client[_0xf67b('0x2')](_0xf67b('0x3'),{'options':{'where':{'VoiceQueueId':_0x38303d,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
+var _0x9b2b=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x22c3a1,_0x5ee097){var _0x358ac6=function(_0x53eacf){while(--_0x53eacf){_0x22c3a1['push'](_0x22c3a1['shift']());}};_0x358ac6(++_0x5ee097);}(_0x9b2b,0x119));var _0xb9b2=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0x9b2b[_0x35d3a8];return _0x182378;};'use strict';var client=require(_0xb9b2('0x0'));exports[_0xb9b2('0x1')]=function(_0x7d6f6f){return function(){return client[_0xb9b2('0x2')](_0xb9b2('0x3'),{'options':{'where':{'VoiceQueueId':_0x7d6f6f,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 566d655..f96d7fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1c4a64,_0x4d2548){var _0x49dbd2=function(_0x50fcd1){while(--_0x50fcd1){_0x1c4a64['push'](_0x1c4a64['shift']());}};_0x49dbd2(++_0x4d2548);}(_0x7a54,0x106));var _0x47a5=function(_0x5166d8,_0x32bcb2){_0x5166d8=_0x5166d8-0x0;var _0x499b15=_0x7a54[_0x5166d8];return _0x499b15;};'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
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x32ffd4,_0x499ebc){var _0x41ede0=function(_0x305b9a){while(--_0x305b9a){_0x32ffd4['push'](_0x32ffd4['shift']());}};_0x41ede0(++_0x499ebc);}(_0x7a54,0x106));var _0x47a5=function(_0x51ba20,_0x198b45){_0x51ba20=_0x51ba20-0x0;var _0x393028=_0x7a54[_0x51ba20];return _0x393028;};'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 4c46898..29650c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfebe=['transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext'];(function(_0x34a8f0,_0xc8ea3f){var _0x3bfafb=function(_0x454e55){while(--_0x454e55){_0x34a8f0['push'](_0x34a8f0['shift']());}};_0x3bfafb(++_0xc8ea3f);}(_0xfebe,0x1d9));var _0xefeb=function(_0x11500e,_0x457be0){_0x11500e=_0x11500e-0x0;var _0x135e1a=_0xfebe[_0x11500e];return _0x135e1a;};'use strict';var client=require(_0xefeb('0x0'));exports[_0xefeb('0x1')]={};exports['blindTransfer']=function(_0x5560d8){return client[_0xefeb('0x2')](_0xefeb('0x3'),{'body':{'result':_0x5560d8[_0xefeb('0x4')],'transfererchannel':_0x5560d8[_0xefeb('0x5')],'transferercalleridnum':_0x5560d8[_0xefeb('0x6')],'transferercalleridname':_0x5560d8[_0xefeb('0x7')],'transfererconnectedlinenum':_0x5560d8[_0xefeb('0x8')],'transfererconnectedlinename':_0x5560d8[_0xefeb('0x9')],'transfereraccountcode':_0x5560d8['transfereraccountcode'],'transferercontext':_0x5560d8['transferercontext'],'transfererexten':_0x5560d8[_0xefeb('0xa')],'transfererlinkedid':_0x5560d8[_0xefeb('0xb')],'transfereechannel':_0x5560d8[_0xefeb('0xc')],'transfereecalleridnum':_0x5560d8['transfereecalleridnum'],'transfereecalleridname':_0x5560d8[_0xefeb('0xd')],'transfereeconnectedlinenum':_0x5560d8[_0xefeb('0xe')],'transfereeconnectedlinename':_0x5560d8['transfereeconnectedlinename'],'transfereeaccountcode':_0x5560d8[_0xefeb('0xf')],'transfereecontext':_0x5560d8[_0xefeb('0x10')],'transfereeexten':_0x5560d8['transfereeexten'],'transfereelinkedid':_0x5560d8[_0xefeb('0x11')],'isexternal':_0x5560d8[_0xefeb('0x12')],'context':_0x5560d8[_0xefeb('0x13')],'extension':_0x5560d8[_0xefeb('0x14')],'type':'blind'},'log':_0xefeb('0x3')});};exports[_0xefeb('0x15')]=function(_0x2e3bed){return client[_0xefeb('0x2')](_0xefeb('0x3'),{'body':{'result':_0x2e3bed[_0xefeb('0x4')],'transfererchannel':_0x2e3bed[_0xefeb('0x16')],'transferercalleridnum':_0x2e3bed[_0xefeb('0x17')],'transferercalleridname':_0x2e3bed[_0xefeb('0x18')],'transfererconnectedlinenum':_0x2e3bed['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2e3bed['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2e3bed['origtransfereraccountcode'],'transferercontext':_0x2e3bed['secondtransferercontext'],'transfererexten':_0x2e3bed['secondtransfererexten'],'transfererlinkedid':_0x2e3bed[_0xefeb('0x19')],'transfereechannel':_0x2e3bed[_0xefeb('0x1a')],'transfereecalleridnum':_0x2e3bed[_0xefeb('0x1b')],'transfereecalleridname':_0x2e3bed['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2e3bed[_0xefeb('0x1c')],'transfereeconnectedlinename':_0x2e3bed[_0xefeb('0x1d')],'transfereeaccountcode':_0x2e3bed[_0xefeb('0x1e')],'transfereecontext':_0x2e3bed['transfertargetcontext'],'transfereeexten':_0x2e3bed[_0xefeb('0x1f')],'transfereelinkedid':_0x2e3bed['transfertargetlinkedid'],'isexternal':_0x2e3bed[_0xefeb('0x12')],'context':_0x2e3bed[_0xefeb('0x20')],'extension':_0x2e3bed[_0xefeb('0x21')],'type':_0xefeb('0x22')},'log':_0xefeb('0x3')});};
\ No newline at end of file
+var _0xaf0a=['result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xaf0a,0x11a));var _0xaaf0=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xaf0a[_0x2aea9e];return _0x430b92;};'use strict';var client=require(_0xaaf0('0x0'));exports[_0xaaf0('0x1')]={};exports[_0xaaf0('0x2')]=function(_0x25923b){return client[_0xaaf0('0x3')](_0xaaf0('0x4'),{'body':{'result':_0x25923b[_0xaaf0('0x5')],'transfererchannel':_0x25923b[_0xaaf0('0x6')],'transferercalleridnum':_0x25923b[_0xaaf0('0x7')],'transferercalleridname':_0x25923b[_0xaaf0('0x8')],'transfererconnectedlinenum':_0x25923b['transfererconnectedlinenum'],'transfererconnectedlinename':_0x25923b[_0xaaf0('0x9')],'transfereraccountcode':_0x25923b[_0xaaf0('0xa')],'transferercontext':_0x25923b[_0xaaf0('0xb')],'transfererexten':_0x25923b[_0xaaf0('0xc')],'transfererlinkedid':_0x25923b[_0xaaf0('0xd')],'transfereechannel':_0x25923b[_0xaaf0('0xe')],'transfereecalleridnum':_0x25923b[_0xaaf0('0xf')],'transfereecalleridname':_0x25923b[_0xaaf0('0x10')],'transfereeconnectedlinenum':_0x25923b[_0xaaf0('0x11')],'transfereeconnectedlinename':_0x25923b[_0xaaf0('0x12')],'transfereeaccountcode':_0x25923b['transfereeaccountcode'],'transfereecontext':_0x25923b[_0xaaf0('0x13')],'transfereeexten':_0x25923b[_0xaaf0('0x14')],'transfereelinkedid':_0x25923b['transfereelinkedid'],'isexternal':_0x25923b[_0xaaf0('0x15')],'context':_0x25923b[_0xaaf0('0x16')],'extension':_0x25923b['extension'],'type':'blind'},'log':_0xaaf0('0x4')});};exports['attendedTransfer']=function(_0x49e5cb){return client[_0xaaf0('0x3')](_0xaaf0('0x4'),{'body':{'result':_0x49e5cb[_0xaaf0('0x5')],'transfererchannel':_0x49e5cb['origtransfererchannel'],'transferercalleridnum':_0x49e5cb[_0xaaf0('0x17')],'transferercalleridname':_0x49e5cb[_0xaaf0('0x18')],'transfererconnectedlinenum':_0x49e5cb[_0xaaf0('0x19')],'transfererconnectedlinename':_0x49e5cb[_0xaaf0('0x1a')],'transfereraccountcode':_0x49e5cb[_0xaaf0('0x1b')],'transferercontext':_0x49e5cb['secondtransferercontext'],'transfererexten':_0x49e5cb['secondtransfererexten'],'transfererlinkedid':_0x49e5cb[_0xaaf0('0x1c')],'transfereechannel':_0x49e5cb[_0xaaf0('0x1d')],'transfereecalleridnum':_0x49e5cb[_0xaaf0('0x1e')],'transfereecalleridname':_0x49e5cb[_0xaaf0('0x1f')],'transfereeconnectedlinenum':_0x49e5cb[_0xaaf0('0x20')],'transfereeconnectedlinename':_0x49e5cb[_0xaaf0('0x21')],'transfereeaccountcode':_0x49e5cb[_0xaaf0('0x22')],'transfereecontext':_0x49e5cb[_0xaaf0('0x23')],'transfereeexten':_0x49e5cb[_0xaaf0('0x24')],'transfereelinkedid':_0x49e5cb[_0xaaf0('0x25')],'isexternal':_0x49e5cb['isexternal'],'context':_0x49e5cb[_0xaaf0('0x26')],'extension':_0x49e5cb[_0xaaf0('0x27')],'type':_0xaaf0('0x28')},'log':_0xaaf0('0x4')});};
\ No newline at end of file
index 632df7b..3f54922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b1=['validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','reload','module','action','Reload','message','catch','pick','Command','Action','then','content','voiceQueues','hasOwnProperty','push','find','omit','undefined','values','channels','length','voicechannel','map','uniqueid','MixMonitor','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','queueChannels','type','inbound','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise'];(function(_0x22e61b,_0xf83efb){var _0x36a528=function(_0x56b75d){while(--_0x56b75d){_0x22e61b['push'](_0x22e61b['shift']());}};_0x36a528(++_0xf83efb);}(_0x72b1,0x16e));var _0x172b=function(_0x129af6,_0x418674){_0x129af6=_0x129af6-0x0;var _0x2c8157=_0x72b1[_0x129af6];return _0x2c8157;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var jayson=require(_0x172b('0x1'));var schema=require(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var config=require(_0x172b('0x4'));var properties=require(_0x172b('0x5'));var ami=require(_0x172b('0x6'));var VoiceQueueSummary=require(_0x172b('0x7'));exports['listen']=function(_0x3781f3,_0x40c72e,_0x475fd6){return new Promise(function(_0x222624,_0x571994){var _0x345e5e={'QueuePause':function(_0x517363){return new Promise(function(_0x1f98e9){var _0x531b10=util[_0x172b('0x8')](_0x172b('0x9'),_0x172b('0xa'),_0x517363[_0x172b('0xb')]);if(_0x3781f3['timers']&&_0x3781f3[_0x172b('0xc')][_0x531b10]&&_0x3781f3[_0x172b('0xc')][_0x531b10][_0x172b('0xd')]){_0x3781f3[_0x172b('0xc')][_0x531b10][_0x172b('0xe')]();}if(_0x3781f3[_0x172b('0xf')][_0x531b10]){_0x3781f3[_0x172b('0xf')][_0x531b10]['updateStatusRealtime']({'statePause':_0x517363[_0x172b('0x10')]?!![]:![]});}_0x1f98e9({'code':0xc8,'message':_0x172b('0x11')});});},'Reload':function(_0xdf832e){var _0x4970f8=this;return new Promise(function(_0x289040,_0x4a98e2){if(ami[_0x172b('0x12')]()==![]){return _0x4a98e2(_0x4970f8[_0x172b('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x172b('0x14')][_0x172b('0x15')],_0x172b('0x16')][_0x172b('0x17')]('\x20')));}_0xdf832e=_['pick'](_0xdf832e,_['keys'](properties[_0x172b('0x18')][_0x172b('0x19')]));_0xdf832e[_0x172b('0x1a')]=_0x172b('0x1b');return ami['Action'](_0xdf832e)['then'](function(_0x10c80b){_0x289040({'code':0xc8,'message':_0x10c80b[_0x172b('0x1c')]});})[_0x172b('0x1d')](function(_0xba7825){_0x4a98e2(_0x4970f8[_0x172b('0x13')](0x1f5,_0xba7825['message']));});});},'Command':function(_0x304b96){var _0x2d24f9=this;return new Promise(function(_0x2bedae,_0x33c62c){if(ami[_0x172b('0x12')]()==![]){return _0x33c62c(_0x2d24f9[_0x172b('0x13')](0x1f4,[config[_0x172b('0x14')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}_0x304b96=_[_0x172b('0x1e')](_0x304b96,'command');_0x304b96[_0x172b('0x1a')]=_0x172b('0x1f');return ami[_0x172b('0x20')](_0x304b96)[_0x172b('0x21')](function(_0x32419a){_0x2bedae({'code':0xc8,'message':_0x32419a[_0x172b('0x22')]});})[_0x172b('0x1d')](function(_0x1cefd1){_0x33c62c(_0x2d24f9[_0x172b('0x13')](0x1f5,_0x1cefd1['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x3858fc){var _0x3ed885=[];for(var _0x3df490 in _0x3781f3[_0x172b('0x23')]){if(_0x3781f3[_0x172b('0x23')][_0x172b('0x24')](_0x3df490)){var _0x39bdc5=_0x3781f3['voiceQueues'][_0x3df490];var _0x1deb7e=new VoiceQueueSummary(_0x39bdc5);_0x3ed885[_0x172b('0x25')](_0x1deb7e);}}_0x3858fc({'count':_0x3ed885['length'],'rows':_0x3ed885});});},'UpdateVoiceQueue':function(_0x4263a1){return new Promise(function(_0x320253,_0x3909b1){var _0xa58782=_[_0x172b('0x26')](_0x3781f3['voiceQueues'],{'id':parseInt(_0x4263a1['id'])});var _0x9624f5=_[_0x172b('0x27')](_0x4263a1,['id']);if(_0xa58782){for(var _0x596b4c in _0x9624f5){if(typeof _0x9624f5[_0x596b4c]!=='undefined'&&typeof _0xa58782[_0x596b4c]!==_0x172b('0x28')){_0xa58782[_0x596b4c]=_0x9624f5[_0x596b4c];}}_0x320253(_0xa58782);}else{_0x3909b1();}});},'VoiceChannels':function(){return new Promise(function(_0xe923f1){var _0x1a80d6=_[_0x172b('0x29')](_0x3781f3[_0x172b('0x2a')]);_0xe923f1({'count':_0x1a80d6[_0x172b('0x2b')],'rows':_0x1a80d6});});},'VoiceChannelMixMonitor':function(_0x3345bd){var _0xd4a668=this;return new Promise(function(_0x34b4ec,_0x239161){if(ami[_0x172b('0x12')]()==![]){return _0x239161(_0xd4a668[_0x172b('0x13')](0x1f4,[config[_0x172b('0x14')]['ip'],config[_0x172b('0x14')][_0x172b('0x15')],_0x172b('0x16')][_0x172b('0x17')]('\x20')));}var _0x2afcd5=schema(properties[_0x172b('0x2c')])[_0x172b('0x2')](_0x3345bd);if(_0x2afcd5[_0x172b('0x2b')]>0x0){return _0x239161(_0xd4a668[_0x172b('0x13')](0x1f4,_[_0x172b('0x2d')](_0x2afcd5,_0x172b('0x1c'))[_0x172b('0x17')](',\x20')));}var _0x5d211b=_[_0x172b('0x26')](_0x3781f3[_0x172b('0x2a')],{'uniqueid':_0x3345bd[_0x172b('0x2e')]});if(_0x5d211b&&_0x5d211b['channel']){var _0x2c20a5=util['format']('%s.%s',_0x3345bd['filename']||_0x3345bd[_0x172b('0x2e')],_0x3345bd['format']||'wav');return ami[_0x172b('0x20')]({'action':_0x172b('0x2f'),'channel':_0x5d211b[_0x172b('0x30')],'file':_0x2c20a5,'options':'ai(mixmonitorid)'})[_0x172b('0x21')](function(_0x1f5516){var _0x3ff036=_[_0x172b('0x26')](_0x5d211b[_0x172b('0x31')],{'filename':_0x172b('0x32')+_0x2c20a5[_0x172b('0x33')]()});if(_[_0x172b('0x34')](_0x3ff036)){_0x5d211b[_0x172b('0x31')][_0x172b('0x25')]({'filename':_0x172b('0x32')+_0x2c20a5[_0x172b('0x33')](),'createdAt':moment()[_0x172b('0x8')](_0x172b('0x35')),'mixmonitorid':_0x1f5516[_0x172b('0x36')],'status':_0x172b('0x37')});}else{_0x3ff036[_0x172b('0x36')]=_0x1f5516[_0x172b('0x36')];_0x3ff036[_0x172b('0x38')]='rec';}_0x34b4ec({'code':0xc8,'message':[_0x3345bd['uniqueid'],_0x172b('0x39'),_0x1f5516['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x1f5516['mixmonitorid']});})[_0x172b('0x1d')](function(_0x186555){_0x239161(_0xd4a668[_0x172b('0x13')](0x1f5,[_0x3345bd['uniqueid'],_0x186555[_0x172b('0x1c')][_0x172b('0x33')]()][_0x172b('0x17')]('\x20')));});}else{return _0x239161(_0xd4a668['error'](0x1f5,_0x172b('0x3a')));}});},'VoiceChannelStopMixMonitor':function(_0x5b2454){var _0x1a3fce=this;return new Promise(function(_0x4a05da,_0x362f83){if(ami[_0x172b('0x12')]()==![]){return _0x362f83(_0x1a3fce[_0x172b('0x13')](0x1f4,[config[_0x172b('0x14')]['ip'],config[_0x172b('0x14')]['username'],_0x172b('0x16')][_0x172b('0x17')]('\x20')));}var _0x370045=schema(properties[_0x172b('0x2c')])[_0x172b('0x2')](_0x5b2454);if(_0x370045[_0x172b('0x2b')]>0x0){return _0x362f83(_0x1a3fce['error'](0x1f4,_['map'](_0x370045,_0x172b('0x1c'))['join'](',\x20')));}var _0x5c2eb2=_['find'](_0x3781f3[_0x172b('0x2a')],{'uniqueid':_0x5b2454[_0x172b('0x2e')]});if(_0x5c2eb2){return Promise[_0x172b('0x3b')]()[_0x172b('0x21')](function(){if(_0x5c2eb2['channel']){return ami[_0x172b('0x20')]({'action':_0x172b('0x3c'),'channel':_0x5c2eb2[_0x172b('0x30')],'mixmonitorid':_0x5b2454[_0x172b('0x36')]})[_0x172b('0x1d')](function(){});}})[_0x172b('0x21')](function(){if(_0x5c2eb2[_0x172b('0x3d')]){return ami[_0x172b('0x20')]({'action':_0x172b('0x3c'),'channel':_0x5c2eb2[_0x172b('0x3d')],'mixmonitorid':_0x5b2454[_0x172b('0x36')]})[_0x172b('0x1d')](function(){});}})['then'](function(){var _0x28e97d=_[_0x172b('0x26')](_0x5c2eb2['monitors'],{'mixmonitorid':_0x5b2454['mixmonitorid']});if(_0x28e97d){_0x28e97d[_0x172b('0x38')]=_0x172b('0x3e');}})[_0x172b('0x21')](function(){var _0x571504=util[_0x172b('0x8')]('%s.%s',_0x5b2454['filename']||_0x5b2454[_0x172b('0x2e')],_0x5b2454[_0x172b('0x8')]||_0x172b('0x3f'));var _0x3941d4=_[_0x172b('0x26')](_0x5c2eb2[_0x172b('0x31')],{'filename':_0x172b('0x32')+_0x571504[_0x172b('0x33')]()});if(_0x3941d4){_0x3941d4[_0x172b('0x38')]=_0x172b('0x3e');}})['then'](function(){_0x4a05da({'code':0xc8,'message':[_0x5b2454['uniqueid'],_0x172b('0x40')][_0x172b('0x17')]('\x20')});})['catch'](function(_0x51b8d9){_0x362f83(_0x1a3fce[_0x172b('0x13')](0x1f5,[_0x5b2454[_0x172b('0x2e')],_0x51b8d9[_0x172b('0x1c')][_0x172b('0x33')]()][_0x172b('0x17')]('\x20')));});}else{return _0x362f83(_0x1a3fce[_0x172b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x28ffa1){var _0x5f29d4=this;return new Promise(function(_0x5f22eb){var _0x221cd7=_[_0x172b('0x29')](_0x3781f3[_0x172b('0x41')]);var _0x4fa9ac={'count':_0x221cd7[_0x172b('0x2b')],'rows':_0x221cd7};if(_0x28ffa1&&_0x28ffa1[_0x172b('0x42')]){if(![_0x172b('0x43'),'outbound']['includes'](_0x28ffa1[_0x172b('0x42')])){return _0x571994(_0x5f29d4[_0x172b('0x13')](0x190,_0x172b('0x44')));}var _0x28cea5=_[_0x172b('0x45')](_0x221cd7,function(_0x2f7684){return _0x2f7684[_0x172b('0x42')]===_0x28ffa1[_0x172b('0x42')];});_0x4fa9ac['count']=_0x28cea5[_0x172b('0x2b')];_0x4fa9ac['rows']=_0x28cea5;}_0x5f22eb(_0x4fa9ac);});},'VoiceQueuesChannel':function(_0x47ff1b){var _0x308332=this;return new Promise(function(_0x47f381,_0x1a979a){var _0x3e3a33=schema(properties[_0x172b('0x46')])['validate'](_0x47ff1b);if(_0x3e3a33[_0x172b('0x2b')]>0x0){return _0x1a979a(_0x308332['error'](0x1f4,_[_0x172b('0x2d')](_0x3e3a33,_0x172b('0x1c'))['join'](',\x20')));}var _0x30d200=_['find'](_0x3781f3[_0x172b('0x41')],{'uniqueid':_0x47ff1b[_0x172b('0x2e')]});if(_0x30d200){_0x47f381(_0x30d200);}else{return _0x1a979a(_0x308332[_0x172b('0x13')](0x1f5,_0x172b('0x3a')));}});},'VoiceQueuesChannelHangup':function(_0x1831b7){var _0x47e2bf=this;return new Promise(function(_0x41f595,_0x151b3b){if(ami[_0x172b('0x12')]()==![]){return _0x151b3b(_0x47e2bf[_0x172b('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x172b('0x14')]['username'],_0x172b('0x16')][_0x172b('0x17')]('\x20')));}var _0xccaac0=schema(properties[_0x172b('0x47')])[_0x172b('0x2')](_0x1831b7);if(_0xccaac0[_0x172b('0x2b')]>0x0){return _0x151b3b(_0x47e2bf['error'](0x1f4,_[_0x172b('0x2d')](_0xccaac0,_0x172b('0x1c'))[_0x172b('0x17')](',\x20')));}var _0x50146b=_[_0x172b('0x26')](_0x3781f3['queueChannels'],{'uniqueid':_0x1831b7['uniqueid']});if(_0x50146b&&_0x50146b[_0x172b('0x30')]){return ami[_0x172b('0x20')]({'action':_0x172b('0x48'),'channel':_0x50146b[_0x172b('0x30')]})[_0x172b('0x21')](function(_0x1dc49b){_0x41f595({'code':0xc8,'message':[_0x1831b7[_0x172b('0x2e')],_0x1dc49b[_0x172b('0x1c')][_0x172b('0x33')]()][_0x172b('0x17')]('\x20')});})['catch'](function(_0x3aa5d5){_0x151b3b(_0x47e2bf[_0x172b('0x13')](0x1f5,[_0x1831b7[_0x172b('0x2e')],_0x3aa5d5[_0x172b('0x1c')][_0x172b('0x33')]()][_0x172b('0x17')]('\x20')));});}else{return _0x151b3b(_0x47e2bf[_0x172b('0x13')](0x1f5,_0x172b('0x3a')));}});},'VoiceQueuesChannelRedirect':function(_0x29d2e5){var _0x3a4a00=this;return new Promise(function(_0x290ecd,_0x5894a2){if(ami[_0x172b('0x12')]()==![]){return _0x5894a2(_0x3a4a00[_0x172b('0x13')](0x1f4,[config[_0x172b('0x14')]['ip'],config[_0x172b('0x14')][_0x172b('0x15')],_0x172b('0x16')]['join']('\x20')));}var _0x575269=schema(properties[_0x172b('0x49')])[_0x172b('0x2')](_0x29d2e5);if(_0x575269[_0x172b('0x2b')]>0x0){return _0x5894a2(_0x3a4a00[_0x172b('0x13')](0x1f4,_[_0x172b('0x2d')](_0x575269,_0x172b('0x1c'))[_0x172b('0x17')](',\x20')));}var _0x54d6b3=_[_0x172b('0x26')](_0x3781f3[_0x172b('0x41')],{'uniqueid':_0x29d2e5[_0x172b('0x2e')]});if(_0x54d6b3&&_0x54d6b3[_0x172b('0x30')]){return ami[_0x172b('0x20')]({'action':'Redirect','channel':_0x54d6b3[_0x172b('0x30')],'exten':_0x29d2e5[_0x172b('0x4a')],'context':_0x29d2e5['context']||_0x54d6b3[_0x172b('0x4b')],'priority':0x1})[_0x172b('0x21')](function(_0x49cb5b){_0x290ecd({'code':0xc8,'message':[_0x29d2e5[_0x172b('0x2e')],_0x49cb5b[_0x172b('0x1c')][_0x172b('0x33')]()][_0x172b('0x17')]('\x20')});})['catch'](function(_0x7c8047){_0x5894a2(_0x3a4a00[_0x172b('0x13')](0x1f5,[_0x29d2e5['uniqueid'],_0x7c8047[_0x172b('0x1c')]['toLowerCase']()][_0x172b('0x17')]('\x20')));});}else{return _0x5894a2(_0x3a4a00[_0x172b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0xc173d9){return new Promise(function(_0x1527f9){var _0xcb5849=_[_0x172b('0x29')](_0x3781f3[_0x172b('0xf')]);if(_0xc173d9&&_0xc173d9['id']){var _0x5d3b38=_[_0x172b('0x26')](_0xcb5849,function(_0x2eab04){return _0x2eab04['id']===_0xc173d9['id'];});_0x1527f9(_0x5d3b38);}else{_0x1527f9({'count':_0xcb5849['length'],'rows':_0xcb5849});}});},'Telephones':function(){return new Promise(function(_0x58fb67){var _0x7ed93=_[_0x172b('0x29')](_0x3781f3['telephones']);_0x58fb67({'count':_0x7ed93[_0x172b('0x2b')],'rows':_0x7ed93});});},'Trunks':function(){return new Promise(function(_0x2a2a1c){var _0xa8f957=_[_0x172b('0x29')](_0x3781f3[_0x172b('0x4c')]);_0x2a2a1c({'count':_0xa8f957['length'],'rows':_0xa8f957});});},'OutboundChannels':function(){return new Promise(function(_0x5ceeee){var _0x5a84eb=_['values'](_0x3781f3['outboundChannels']);_0x5ceeee({'count':_0x5a84eb[_0x172b('0x2b')],'rows':_0x5a84eb});});},'Outbound':function(){return new Promise(function(_0x3fae32){_0x3fae32(_0x3781f3['outbound']);});},'Campaigns':function(){return new Promise(function(_0x2ef2b4){var _0x10d665=_[_0x172b('0x29')](_0x3781f3[_0x172b('0x4d')]);_0x2ef2b4({'count':_0x10d665[_0x172b('0x2b')],'rows':_0x10d665});});},'VoiceQueuesPreview':function(_0x21e7cb){var _0x5aca7f=this;return new Promise(function(_0x9c4108,_0x3781e4){_0x40c72e[_0x172b('0x4e')](_0x21e7cb['id'])[_0x172b('0x21')](function(_0x130be7){_0x9c4108({'code':0xc8,'message':_0x130be7[_0x172b('0x1c')]});})['catch'](function(_0x2b1d80){_0x3781e4(_0x5aca7f[_0x172b('0x13')](0x1f4,_0x2b1d80[_0x172b('0x1c')]));});});},'EventManager':function(_0x3cca24){var _0x48cd9e=this;return new Promise(function(_0x3dfd3c,_0x4e5873){if(!_0x3cca24[_0x172b('0x4f')]){return _0x4e5873(_0x48cd9e[_0x172b('0x13')](0x1f4,_0x172b('0x50')));}ami[_0x172b('0x51')](_0x172b('0x52')+_0x3cca24[_0x172b('0x4f')],_0x3cca24[_0x172b('0x1c')]);_0x3dfd3c({'code':0xc8,'message':_0x3cca24});});},'FaxAccounts':function(){return new Promise(function(_0x327571){var _0x18d283=_['values'](_0x3781f3[_0x172b('0x53')]);_0x327571({'count':_0x18d283['length'],'rows':_0x18d283});});},'SendFax':function(_0x14b45a){var _0x42b132=this;return new Promise(function(_0x36b458,_0x330182){_0x475fd6[_0x172b('0x54')](_0x14b45a)['then'](function(_0x41e701){_0x36b458({'code':0xc8,'message':_0x41e701[_0x172b('0x1c')]});})['catch'](function(_0x43b671){_0x330182(_0x42b132[_0x172b('0x13')](0x1f4,_0x43b671[_0x172b('0x1c')]));});});},'CheckAfterSend':function(_0x4bb59f){var _0x280774=this;return new Promise(function(_0xcb81a3,_0x1d9449){_0x475fd6[_0x172b('0x55')](_0x4bb59f)[_0x172b('0x21')](function(_0x297a90){_0xcb81a3({'code':0xc8,'message':_0x297a90[_0x172b('0x1c')]});})['catch'](function(_0x3b7b82){_0x1d9449(_0x280774[_0x172b('0x13')](0x1f4,_0x3b7b82[_0x172b('0x1c')]));});});}};var _0x2ee7f3=jayson[_0x172b('0x56')](_0x345e5e)[_0x172b('0x57')]();_0x2ee7f3['on'](_0x172b('0x13'),function(_0x4074fa){return _0x571994(_0x4074fa);});_0x2ee7f3['listen'](0x232a,_0x172b('0x58'),function(){console[_0x172b('0x59')](_0x172b('0x5a'),0x232a);return _0x222624(_0x172b('0x5b')+0x232a);});});};
\ No newline at end of file
+var _0xeff8=['/var/spool/asterisk/monitor/','isNil','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','voicequeuechannel','map','queueChannels','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','format','%s/%s','timers','updateAcw','agents','updateStatusRealtime','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','reload','module','action','Reload','then','message','catch','error','Action','content','voiceQueues','hasOwnProperty','length','find','omit','undefined','values','channels','uniqueid','%s.%s','filename','wav','channel','monitors'];(function(_0x4bc5fe,_0x318a9b){var _0xe6e931=function(_0x48e43f){while(--_0x48e43f){_0x4bc5fe['push'](_0x4bc5fe['shift']());}};_0xe6e931(++_0x318a9b);}(_0xeff8,0x186));var _0x8eff=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xeff8[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var jayson=require('jayson/promise');var schema=require(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var config=require(_0x8eff('0x4'));var properties=require('../properties');var ami=require(_0x8eff('0x5'));var VoiceQueueSummary=require(_0x8eff('0x6'));exports[_0x8eff('0x7')]=function(_0x2911b1,_0x4ac51c,_0x469641){return new Promise(function(_0xb54063,_0x3409bc){var _0x323b2={'QueuePause':function(_0x491f01){return new Promise(function(_0x3fb9ee){var _0x19557f=util[_0x8eff('0x8')](_0x8eff('0x9'),'SIP',_0x491f01['name']);if(_0x2911b1[_0x8eff('0xa')]&&_0x2911b1[_0x8eff('0xa')][_0x19557f]&&_0x2911b1[_0x8eff('0xa')][_0x19557f]['timer']){_0x2911b1[_0x8eff('0xa')][_0x19557f][_0x8eff('0xb')]();}if(_0x2911b1['agents'][_0x19557f]){_0x2911b1[_0x8eff('0xc')][_0x19557f][_0x8eff('0xd')]({'statePause':_0x491f01['pause']?!![]:![]});}_0x3fb9ee({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x45f280){var _0x43c914=this;return new Promise(function(_0xfa12bb,_0x42fb24){if(ami[_0x8eff('0xe')]()==![]){return _0x42fb24(_0x43c914['error'](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],_0x8eff('0x11')][_0x8eff('0x12')]('\x20')));}_0x45f280=_[_0x8eff('0x13')](_0x45f280,_[_0x8eff('0x14')](properties[_0x8eff('0x15')][_0x8eff('0x16')]));_0x45f280[_0x8eff('0x17')]=_0x8eff('0x18');return ami['Action'](_0x45f280)[_0x8eff('0x19')](function(_0x38fb15){_0xfa12bb({'code':0xc8,'message':_0x38fb15[_0x8eff('0x1a')]});})[_0x8eff('0x1b')](function(_0x2cd7c5){_0x42fb24(_0x43c914[_0x8eff('0x1c')](0x1f5,_0x2cd7c5[_0x8eff('0x1a')]));});});},'Command':function(_0x399d96){var _0x1b003c=this;return new Promise(function(_0x198ee9,_0x453c7a){if(ami[_0x8eff('0xe')]()==![]){return _0x453c7a(_0x1b003c[_0x8eff('0x1c')](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],'ami\x20disconnected'][_0x8eff('0x12')]('\x20')));}_0x399d96=_[_0x8eff('0x13')](_0x399d96,'command');_0x399d96[_0x8eff('0x17')]='Command';return ami[_0x8eff('0x1d')](_0x399d96)[_0x8eff('0x19')](function(_0x1ccc79){_0x198ee9({'code':0xc8,'message':_0x1ccc79[_0x8eff('0x1e')]});})[_0x8eff('0x1b')](function(_0x4e891c){_0x453c7a(_0x1b003c[_0x8eff('0x1c')](0x1f5,_0x4e891c[_0x8eff('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x50784c){var _0x15b66f=[];for(var _0x5ec3d7 in _0x2911b1[_0x8eff('0x1f')]){if(_0x2911b1[_0x8eff('0x1f')][_0x8eff('0x20')](_0x5ec3d7)){var _0x41324b=_0x2911b1[_0x8eff('0x1f')][_0x5ec3d7];var _0x2e8067=new VoiceQueueSummary(_0x41324b);_0x15b66f['push'](_0x2e8067);}}_0x50784c({'count':_0x15b66f[_0x8eff('0x21')],'rows':_0x15b66f});});},'UpdateVoiceQueue':function(_0x323ffa){return new Promise(function(_0x15083c,_0xb88ce9){var _0x45803c=_[_0x8eff('0x22')](_0x2911b1['voiceQueues'],{'id':parseInt(_0x323ffa['id'])});var _0x4ed3b8=_[_0x8eff('0x23')](_0x323ffa,['id']);if(_0x45803c){for(var _0x472b19 in _0x4ed3b8){if(typeof _0x4ed3b8[_0x472b19]!==_0x8eff('0x24')&&typeof _0x45803c[_0x472b19]!=='undefined'){_0x45803c[_0x472b19]=_0x4ed3b8[_0x472b19];}}_0x15083c(_0x45803c);}else{_0xb88ce9();}});},'VoiceChannels':function(){return new Promise(function(_0x2ebf3a){var _0x2f8ad9=_[_0x8eff('0x25')](_0x2911b1[_0x8eff('0x26')]);_0x2ebf3a({'count':_0x2f8ad9[_0x8eff('0x21')],'rows':_0x2f8ad9});});},'VoiceChannelMixMonitor':function(_0x2c5727){var _0x141bd7=this;return new Promise(function(_0x1c6efa,_0x36a613){if(ami[_0x8eff('0xe')]()==![]){return _0x36a613(_0x141bd7[_0x8eff('0x1c')](0x1f4,[config[_0x8eff('0xf')]['ip'],config['asterisk'][_0x8eff('0x10')],_0x8eff('0x11')][_0x8eff('0x12')]('\x20')));}var _0x7da1fb=schema(properties['voicechannel'])[_0x8eff('0x2')](_0x2c5727);if(_0x7da1fb[_0x8eff('0x21')]>0x0){return _0x36a613(_0x141bd7['error'](0x1f4,_['map'](_0x7da1fb,_0x8eff('0x1a'))[_0x8eff('0x12')](',\x20')));}var _0x565b83=_['find'](_0x2911b1['channels'],{'uniqueid':_0x2c5727[_0x8eff('0x27')]});if(_0x565b83&&_0x565b83['channel']){var _0x45d9d4=util['format'](_0x8eff('0x28'),_0x2c5727[_0x8eff('0x29')]||_0x2c5727[_0x8eff('0x27')],_0x2c5727[_0x8eff('0x8')]||_0x8eff('0x2a'));return ami[_0x8eff('0x1d')]({'action':'MixMonitor','channel':_0x565b83[_0x8eff('0x2b')],'file':_0x45d9d4,'options':'ai(mixmonitorid)'})[_0x8eff('0x19')](function(_0x5beed4){var _0x2fe45d=_[_0x8eff('0x22')](_0x565b83[_0x8eff('0x2c')],{'filename':_0x8eff('0x2d')+_0x45d9d4['toLowerCase']()});if(_[_0x8eff('0x2e')](_0x2fe45d)){_0x565b83[_0x8eff('0x2c')][_0x8eff('0x2f')]({'filename':'/var/spool/asterisk/monitor/'+_0x45d9d4[_0x8eff('0x30')](),'createdAt':moment()[_0x8eff('0x8')](_0x8eff('0x31')),'mixmonitorid':_0x5beed4[_0x8eff('0x32')],'status':_0x8eff('0x33')});}else{_0x2fe45d[_0x8eff('0x32')]=_0x5beed4[_0x8eff('0x32')];_0x2fe45d[_0x8eff('0x34')]=_0x8eff('0x33');}_0x1c6efa({'code':0xc8,'message':[_0x2c5727['uniqueid'],'MixMonitor\x20Success',_0x5beed4[_0x8eff('0x32')]][_0x8eff('0x12')]('\x20'),'mixmonitorid':_0x5beed4[_0x8eff('0x32')]});})[_0x8eff('0x1b')](function(_0x429c31){_0x36a613(_0x141bd7[_0x8eff('0x1c')](0x1f5,[_0x2c5727[_0x8eff('0x27')],_0x429c31['message'][_0x8eff('0x30')]()][_0x8eff('0x12')]('\x20')));});}else{return _0x36a613(_0x141bd7['error'](0x1f5,_0x8eff('0x35')));}});},'VoiceChannelStopMixMonitor':function(_0x1ad6b3){var _0x241b33=this;return new Promise(function(_0x18309b,_0xdc5e2f){if(ami[_0x8eff('0xe')]()==![]){return _0xdc5e2f(_0x241b33[_0x8eff('0x1c')](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')]['username'],_0x8eff('0x11')][_0x8eff('0x12')]('\x20')));}var _0x3f8a85=schema(properties[_0x8eff('0x36')])[_0x8eff('0x2')](_0x1ad6b3);if(_0x3f8a85['length']>0x0){return _0xdc5e2f(_0x241b33[_0x8eff('0x1c')](0x1f4,_['map'](_0x3f8a85,_0x8eff('0x1a'))[_0x8eff('0x12')](',\x20')));}var _0x1e9d99=_[_0x8eff('0x22')](_0x2911b1['channels'],{'uniqueid':_0x1ad6b3[_0x8eff('0x27')]});if(_0x1e9d99){return Promise[_0x8eff('0x37')]()[_0x8eff('0x19')](function(){if(_0x1e9d99['channel']){return ami['Action']({'action':_0x8eff('0x38'),'channel':_0x1e9d99[_0x8eff('0x2b')],'mixmonitorid':_0x1ad6b3[_0x8eff('0x32')]})[_0x8eff('0x1b')](function(){});}})[_0x8eff('0x19')](function(){if(_0x1e9d99['destinationchannel']){return ami[_0x8eff('0x1d')]({'action':'StopMixMonitor','channel':_0x1e9d99[_0x8eff('0x39')],'mixmonitorid':_0x1ad6b3[_0x8eff('0x32')]})['catch'](function(){});}})['then'](function(){var _0x47ecff=_['find'](_0x1e9d99['monitors'],{'mixmonitorid':_0x1ad6b3['mixmonitorid']});if(_0x47ecff){_0x47ecff[_0x8eff('0x34')]=_0x8eff('0x3a');}})[_0x8eff('0x19')](function(){var _0x1b5fda=util[_0x8eff('0x8')](_0x8eff('0x28'),_0x1ad6b3[_0x8eff('0x29')]||_0x1ad6b3[_0x8eff('0x27')],_0x1ad6b3[_0x8eff('0x8')]||_0x8eff('0x2a'));var _0x4c7013=_[_0x8eff('0x22')](_0x1e9d99['monitors'],{'filename':_0x8eff('0x2d')+_0x1b5fda[_0x8eff('0x30')]()});if(_0x4c7013){_0x4c7013[_0x8eff('0x34')]=_0x8eff('0x3a');}})[_0x8eff('0x19')](function(){_0x18309b({'code':0xc8,'message':[_0x1ad6b3[_0x8eff('0x27')],_0x8eff('0x3b')][_0x8eff('0x12')]('\x20')});})[_0x8eff('0x1b')](function(_0x19bff6){_0xdc5e2f(_0x241b33[_0x8eff('0x1c')](0x1f5,[_0x1ad6b3[_0x8eff('0x27')],_0x19bff6['message'][_0x8eff('0x30')]()][_0x8eff('0x12')]('\x20')));});}else{return _0xdc5e2f(_0x241b33[_0x8eff('0x1c')](0x1f5,_0x8eff('0x35')));}});},'VoiceQueuesChannels':function(_0x3de247){var _0x2de7fd=this;return new Promise(function(_0x16473d){var _0x9eb0b9=_[_0x8eff('0x25')](_0x2911b1['queueChannels']);var _0x54154a={'count':_0x9eb0b9[_0x8eff('0x21')],'rows':_0x9eb0b9};if(_0x3de247&&_0x3de247[_0x8eff('0x3c')]){if(![_0x8eff('0x3d'),_0x8eff('0x3e')][_0x8eff('0x3f')](_0x3de247[_0x8eff('0x3c')])){return _0x3409bc(_0x2de7fd['error'](0x190,_0x8eff('0x40')));}var _0x1ca203=_[_0x8eff('0x41')](_0x9eb0b9,function(_0x4caf8b){return _0x4caf8b[_0x8eff('0x3c')]===_0x3de247[_0x8eff('0x3c')];});_0x54154a[_0x8eff('0x42')]=_0x1ca203[_0x8eff('0x21')];_0x54154a['rows']=_0x1ca203;}_0x16473d(_0x54154a);});},'VoiceQueuesChannel':function(_0x40de1d){var _0x161f89=this;return new Promise(function(_0x19da18,_0x244a96){var _0x1d56ce=schema(properties[_0x8eff('0x43')])[_0x8eff('0x2')](_0x40de1d);if(_0x1d56ce['length']>0x0){return _0x244a96(_0x161f89[_0x8eff('0x1c')](0x1f4,_[_0x8eff('0x44')](_0x1d56ce,_0x8eff('0x1a'))[_0x8eff('0x12')](',\x20')));}var _0x2079f6=_['find'](_0x2911b1[_0x8eff('0x45')],{'uniqueid':_0x40de1d[_0x8eff('0x27')]});if(_0x2079f6){_0x19da18(_0x2079f6);}else{return _0x244a96(_0x161f89[_0x8eff('0x1c')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x2c4c38){var _0x4aca10=this;return new Promise(function(_0x3f387a,_0x172c6c){if(ami[_0x8eff('0xe')]()==![]){return _0x172c6c(_0x4aca10[_0x8eff('0x1c')](0x1f4,[config[_0x8eff('0xf')]['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],'ami\x20disconnected']['join']('\x20')));}var _0x32b05e=schema(properties['voicequeuechannelhangup'])[_0x8eff('0x2')](_0x2c4c38);if(_0x32b05e[_0x8eff('0x21')]>0x0){return _0x172c6c(_0x4aca10[_0x8eff('0x1c')](0x1f4,_[_0x8eff('0x44')](_0x32b05e,_0x8eff('0x1a'))['join'](',\x20')));}var _0x4064bd=_[_0x8eff('0x22')](_0x2911b1[_0x8eff('0x45')],{'uniqueid':_0x2c4c38[_0x8eff('0x27')]});if(_0x4064bd&&_0x4064bd[_0x8eff('0x2b')]){return ami[_0x8eff('0x1d')]({'action':'Hangup','channel':_0x4064bd[_0x8eff('0x2b')]})['then'](function(_0x2e45c2){_0x3f387a({'code':0xc8,'message':[_0x2c4c38[_0x8eff('0x27')],_0x2e45c2['message'][_0x8eff('0x30')]()][_0x8eff('0x12')]('\x20')});})[_0x8eff('0x1b')](function(_0x980379){_0x172c6c(_0x4aca10[_0x8eff('0x1c')](0x1f5,[_0x2c4c38[_0x8eff('0x27')],_0x980379[_0x8eff('0x1a')][_0x8eff('0x30')]()]['join']('\x20')));});}else{return _0x172c6c(_0x4aca10[_0x8eff('0x1c')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x57878e){var _0x1a748f=this;return new Promise(function(_0x47626e,_0x487cf2){if(ami[_0x8eff('0xe')]()==![]){return _0x487cf2(_0x1a748f[_0x8eff('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0x8eff('0xf')][_0x8eff('0x10')],'ami\x20disconnected'][_0x8eff('0x12')]('\x20')));}var _0x1c6ee1=schema(properties[_0x8eff('0x46')])[_0x8eff('0x2')](_0x57878e);if(_0x1c6ee1[_0x8eff('0x21')]>0x0){return _0x487cf2(_0x1a748f[_0x8eff('0x1c')](0x1f4,_[_0x8eff('0x44')](_0x1c6ee1,'message')['join'](',\x20')));}var _0x3d34c0=_[_0x8eff('0x22')](_0x2911b1[_0x8eff('0x45')],{'uniqueid':_0x57878e[_0x8eff('0x27')]});if(_0x3d34c0&&_0x3d34c0[_0x8eff('0x2b')]){return ami[_0x8eff('0x1d')]({'action':_0x8eff('0x47'),'channel':_0x3d34c0['channel'],'exten':_0x57878e['exten'],'context':_0x57878e[_0x8eff('0x48')]||_0x3d34c0['context'],'priority':0x1})['then'](function(_0x4946a9){_0x47626e({'code':0xc8,'message':[_0x57878e[_0x8eff('0x27')],_0x4946a9[_0x8eff('0x1a')][_0x8eff('0x30')]()][_0x8eff('0x12')]('\x20')});})[_0x8eff('0x1b')](function(_0x436f93){_0x487cf2(_0x1a748f[_0x8eff('0x1c')](0x1f5,[_0x57878e[_0x8eff('0x27')],_0x436f93['message'][_0x8eff('0x30')]()]['join']('\x20')));});}else{return _0x487cf2(_0x1a748f[_0x8eff('0x1c')](0x1f5,_0x8eff('0x35')));}});},'Agents':function(_0x12ebd1){return new Promise(function(_0x225703){var _0x2eca0f=_[_0x8eff('0x25')](_0x2911b1['agents']);if(_0x12ebd1&&_0x12ebd1['id']){var _0x3db0d8=_['find'](_0x2eca0f,function(_0x1d8d8f){return _0x1d8d8f['id']===_0x12ebd1['id'];});_0x225703(_0x3db0d8);}else{_0x225703({'count':_0x2eca0f[_0x8eff('0x21')],'rows':_0x2eca0f});}});},'Telephones':function(){return new Promise(function(_0x3057f7){var _0x465575=_[_0x8eff('0x25')](_0x2911b1[_0x8eff('0x49')]);_0x3057f7({'count':_0x465575[_0x8eff('0x21')],'rows':_0x465575});});},'Trunks':function(){return new Promise(function(_0x122032){var _0x268397=_['values'](_0x2911b1[_0x8eff('0x4a')]);_0x122032({'count':_0x268397[_0x8eff('0x21')],'rows':_0x268397});});},'OutboundChannels':function(){return new Promise(function(_0x1299b5){var _0x3eba9e=_[_0x8eff('0x25')](_0x2911b1[_0x8eff('0x4b')]);_0x1299b5({'count':_0x3eba9e[_0x8eff('0x21')],'rows':_0x3eba9e});});},'Outbound':function(){return new Promise(function(_0x2f6b5d){_0x2f6b5d(_0x2911b1[_0x8eff('0x3e')]);});},'Campaigns':function(){return new Promise(function(_0x123673){var _0x4ef11d=_['values'](_0x2911b1['campaigns']);_0x123673({'count':_0x4ef11d['length'],'rows':_0x4ef11d});});},'VoiceQueuesPreview':function(_0x4642d3){var _0x16221f=this;return new Promise(function(_0x2a15ba,_0x47435f){_0x4ac51c[_0x8eff('0x4c')](_0x4642d3['id'])[_0x8eff('0x19')](function(_0x2e9b26){_0x2a15ba({'code':0xc8,'message':_0x2e9b26['message']});})[_0x8eff('0x1b')](function(_0x3e4212){_0x47435f(_0x16221f[_0x8eff('0x1c')](0x1f4,_0x3e4212[_0x8eff('0x1a')]));});});},'EventManager':function(_0x5b1f67){var _0x447698=this;return new Promise(function(_0x34ca22,_0x4f6a75){if(!_0x5b1f67[_0x8eff('0x4d')]){return _0x4f6a75(_0x447698[_0x8eff('0x1c')](0x1f4,_0x8eff('0x4e')));}ami['emit']('custom:'+_0x5b1f67['event'],_0x5b1f67[_0x8eff('0x1a')]);_0x34ca22({'code':0xc8,'message':_0x5b1f67});});},'FaxAccounts':function(){return new Promise(function(_0x1c5280){var _0x40c3da=_[_0x8eff('0x25')](_0x2911b1[_0x8eff('0x4f')]);_0x1c5280({'count':_0x40c3da[_0x8eff('0x21')],'rows':_0x40c3da});});},'SendFax':function(_0x283f26){var _0x5a329b=this;return new Promise(function(_0x131ff8,_0x103a50){_0x469641[_0x8eff('0x50')](_0x283f26)['then'](function(_0x2527ec){_0x131ff8({'code':0xc8,'message':_0x2527ec['message']});})[_0x8eff('0x1b')](function(_0x3410bd){_0x103a50(_0x5a329b['error'](0x1f4,_0x3410bd[_0x8eff('0x1a')]));});});},'CheckAfterSend':function(_0x536b6f){var _0x35cb3b=this;return new Promise(function(_0x1f1f3c,_0x26ebce){_0x469641[_0x8eff('0x51')](_0x536b6f)[_0x8eff('0x19')](function(_0x4a4603){_0x1f1f3c({'code':0xc8,'message':_0x4a4603[_0x8eff('0x1a')]});})[_0x8eff('0x1b')](function(_0xd5edc5){_0x26ebce(_0x35cb3b[_0x8eff('0x1c')](0x1f4,_0xd5edc5[_0x8eff('0x1a')]));});});}};var _0x7a4bfd=jayson[_0x8eff('0x52')](_0x323b2)[_0x8eff('0x53')]();_0x7a4bfd['on'](_0x8eff('0x1c'),function(_0x452b90){return _0x3409bc(_0x452b90);});_0x7a4bfd[_0x8eff('0x7')](0x232a,'127.0.0.1',function(){console[_0x8eff('0x54')](_0x8eff('0x55'),0x232a);return _0xb54063(_0x8eff('0x56')+0x232a);});});};
\ No newline at end of file
index b99eda6..d2a8aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01cc=['info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','calleridnum','firstName','lastName','fax','scheduledAt','updatedAt','union','resolve','then','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','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','routeId','push','format','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','localhost','socket.io-emitter'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x01cc,0x109));var _0xc01c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x01cc[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xc01c('0x0'));var BPromise=require(_0xc01c('0x1'));var Redis=require(_0xc01c('0x2'));var util=require(_0xc01c('0x3'));var config=require(_0xc01c('0x4'));var logger=require(_0xc01c('0x5'))('trigger');var cmContactRpc=require(_0xc01c('0x6'));config[_0xc01c('0x7')]=_['defaults'](config[_0xc01c('0x7')],{'host':_0xc01c('0x8'),'port':0x18eb});var io=require(_0xc01c('0x9'))(new Redis(config[_0xc01c('0x7')]));function emit(_0x4efe72,_0x45d2a6,_0x558fbf,_0x5dd994,_0x473dc9){logger[_0xc01c('0xa')](_0xc01c('0xb'),_0x4efe72,_0x45d2a6['id'],_0x558fbf,_0x5dd994,JSON[_0xc01c('0xc')](_0x473dc9));io['to'](_0x558fbf)[_0xc01c('0xd')](_0x5dd994,_0x473dc9);}exports[_0xc01c('0xe')]=function(_0x3d5b5e,_0x33c537,_0x1d29fa,_0x54bd99){var _0x58b11c,_0x2e6c24;var _0x52cb4d={};var _0x3fab94;var _0x4e9cb9=Number(_0x1d29fa[_0xc01c('0xf')]);var _0x3226d7=_0x1d29fa[_0xc01c('0x10')]?Boolean(Number(_0x1d29fa[_0xc01c('0x10')])):![];var _0x42e028;var _0x3baef8=![];if(!_[_0xc01c('0x11')](_0x1d29fa[_0xc01c('0x12')])){if(_0x1d29fa['data5']=='1')_0x3baef8=!![];}if(!_0x3baef8){if(_0x54bd99[_0xc01c('0x13')]){_0x52cb4d['id']=_0x54bd99[_0xc01c('0x13')];}}if(!_0x52cb4d['id']){_0x52cb4d[_0xc01c('0x14')]=_0x4e9cb9;_0x42e028=_0x1d29fa[_0xc01c('0x15')]&&_0x1d29fa[_0xc01c('0x15')]!=='0'?_0x1d29fa['data3'][_0xc01c('0x16')](','):[_0xc01c('0x17')];_0x52cb4d['$or']=_[_0xc01c('0x18')](_0x42e028,function(_0xcedca6){var _0x378a9d={};_0x378a9d[_0xcedca6]=_0x54bd99['routeId']?_0x54bd99[_0xc01c('0x19')]:_0x54bd99[_0xc01c('0x1a')];return _0x378a9d;});_0x3fab94=_0x54bd99['routeId']?_0x54bd99[_0xc01c('0x19')]:_0x54bd99['calleridnum'];}var _0x7f052a=['id',_0xc01c('0x1b'),_0xc01c('0x1c'),'phone','mobile',_0xc01c('0x1d'),_0xc01c('0x14'),'createdAt',_0xc01c('0x1e'),_0xc01c('0x1f')];var _0x3d3c2f=_[_0xc01c('0x20')](_0x7f052a,_0x42e028);BPromise[_0xc01c('0x21')]()[_0xc01c('0x22')](cmContactRpc['getContacts']({'attributes':_0x3d3c2f,'where':_0x52cb4d,'phone':_0x3fab94}))[_0xc01c('0x22')](function(_0x451aa4){_0x2e6c24=_0x451aa4;if(!_[_0xc01c('0x23')](_0x2e6c24)){if(_0x2e6c24[_0xc01c('0x24')]===0x1){_0x58b11c=_0x2e6c24[0x0];logger[_0xc01c('0xa')](_0xc01c('0x25'),_0x54bd99[_0xc01c('0x26')],_0x33c537['id'],_0x58b11c['id']);}else{logger['info'](_0xc01c('0x27'),_0x54bd99[_0xc01c('0x26')],_0x33c537['id'],_[_0xc01c('0x18')](_0x2e6c24,'id')[_0xc01c('0x28')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x54bd99['uniqueid'],_0x33c537['id']);var _0x10a0de={'ListId':_0x4e9cb9};var _0x1dab78=_0x1d29fa[_0xc01c('0x29')]&&_0x1d29fa[_0xc01c('0x29')]!=='0'?_0x1d29fa[_0xc01c('0x29')]:_0xc01c('0x17');if(_0x3226d7){logger[_0xc01c('0xa')](_0xc01c('0x2a'),_0x54bd99[_0xc01c('0x26')],_0x33c537['id']);_0x10a0de[_0x1dab78]=_[_0xc01c('0x11')](_0x54bd99['routeId'])?_0x54bd99['calleridnum']:_0x54bd99[_0xc01c('0x19')];if(_[_0xc01c('0x11')](_0x54bd99['routeId'])){_0x10a0de[_0xc01c('0x1b')]=_0x54bd99[_0xc01c('0x2b')]&&_0x54bd99[_0xc01c('0x2b')]!==_0xc01c('0x2c')?_0x54bd99['calleridname']:_0xc01c('0x2d');}else{_0x10a0de[_0xc01c('0x1b')]=_0x54bd99['destcalleridname']&&_0x54bd99[_0xc01c('0x2e')]!==_0xc01c('0x2c')?_0x54bd99[_0xc01c('0x2e')]:_0xc01c('0x2d');}return BPromise[_0xc01c('0x21')]()[_0xc01c('0x22')](cmContactRpc[_0xc01c('0x2f')](_0x10a0de))[_0xc01c('0x22')](function(_0x5b93aa){_0x58b11c=_0x5b93aa;_0x2e6c24['push'](_0x5b93aa);if(_0x58b11c){logger['info'](_0xc01c('0x30'),_0x54bd99['uniqueid'],_0x33c537['id'],_0x58b11c['id']);}return;});}else{logger[_0xc01c('0xa')](_0xc01c('0x31'),_0x54bd99[_0xc01c('0x26')],_0x33c537['id']);_0x10a0de[_0x1dab78]=_[_0xc01c('0x11')](_0x54bd99['routeId'])?_0x54bd99[_0xc01c('0x1a')]:_0x54bd99[_0xc01c('0x19')];if(_[_0xc01c('0x11')](_0x54bd99[_0xc01c('0x32')])){_0x10a0de[_0xc01c('0x1b')]=_0x54bd99[_0xc01c('0x2b')]&&_0x54bd99['calleridname']!=='<unknown>'?_0x54bd99['calleridname']:_0xc01c('0x2d');}else{_0x10a0de[_0xc01c('0x1b')]=_0x54bd99['destcalleridname']&&_0x54bd99[_0xc01c('0x2e')]!==_0xc01c('0x2c')?_0x54bd99[_0xc01c('0x2e')]:_0xc01c('0x2d');}_0x58b11c=_0x10a0de;_0x2e6c24[_0xc01c('0x33')](_0x10a0de);return;}}})[_0xc01c('0x22')](function(){if(_0x3d5b5e){emit(_0x54bd99[_0xc01c('0x26')],_0x33c537,util['format']('user:%s',_0x3d5b5e['name']),util[_0xc01c('0x34')]('trigger:%s',_0x1d29fa['action'][_0xc01c('0x35')]()),{'evt':_[_0xc01c('0x36')](_0x54bd99,{'autoCreate':_0x3226d7}),'contact':_0x58b11c===undefined?{}:_0x58b11c,'contacts':_0x2e6c24['length']===0x0?undefined:_0x2e6c24});}});};
\ No newline at end of file
+var _0x54c6=['push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','format','user:%s','name','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','map','routeId','destcalleridnum','lastName','createdAt','scheduledAt','updatedAt','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','<unknown>','calleridname','Unknown','destcalleridname','then','createContact'];(function(_0x6f41f,_0x46768b){var _0xd4040a=function(_0xef7613){while(--_0xef7613){_0x6f41f['push'](_0x6f41f['shift']());}};_0xd4040a(++_0x46768b);}(_0x54c6,0x7b));var _0x654c=function(_0x344208,_0x1da247){_0x344208=_0x344208-0x0;var _0x5a801a=_0x54c6[_0x344208];return _0x5a801a;};'use strict';var _=require(_0x654c('0x0'));var BPromise=require(_0x654c('0x1'));var Redis=require('ioredis');var util=require(_0x654c('0x2'));var config=require(_0x654c('0x3'));var logger=require(_0x654c('0x4'))(_0x654c('0x5'));var cmContactRpc=require(_0x654c('0x6'));config[_0x654c('0x7')]=_[_0x654c('0x8')](config[_0x654c('0x7')],{'host':_0x654c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x654c('0x7')]));function emit(_0x3abec6,_0x55aab5,_0x15d8a7,_0x4fb589,_0x1cb682){logger[_0x654c('0xa')](_0x654c('0xb'),_0x3abec6,_0x55aab5['id'],_0x15d8a7,_0x4fb589,JSON[_0x654c('0xc')](_0x1cb682));io['to'](_0x15d8a7)[_0x654c('0xd')](_0x4fb589,_0x1cb682);}exports[_0x654c('0xe')]=function(_0x16b86c,_0x2ad493,_0x383c85,_0x2302be){var _0xbcd722,_0x26b649;var _0x51e929={};var _0x2be557;var _0x4f212a=Number(_0x383c85[_0x654c('0xf')]);var _0x101428=_0x383c85[_0x654c('0x10')]?Boolean(Number(_0x383c85['data2'])):![];var _0x33ef86;var _0x49de7e=![];if(!_[_0x654c('0x11')](_0x383c85[_0x654c('0x12')])){if(_0x383c85[_0x654c('0x12')]=='1')_0x49de7e=!![];}if(!_0x49de7e){if(_0x2302be[_0x654c('0x13')]){_0x51e929['id']=_0x2302be[_0x654c('0x13')];}}if(!_0x51e929['id']){_0x51e929[_0x654c('0x14')]=_0x4f212a;_0x33ef86=_0x383c85['data3']&&_0x383c85['data3']!=='0'?_0x383c85[_0x654c('0x15')]['split'](','):[_0x654c('0x16')];_0x51e929['$or']=_[_0x654c('0x17')](_0x33ef86,function(_0x29b325){var _0x4dcc0a={};_0x4dcc0a[_0x29b325]=_0x2302be[_0x654c('0x18')]?_0x2302be['destcalleridnum']:_0x2302be['calleridnum'];return _0x4dcc0a;});_0x2be557=_0x2302be[_0x654c('0x18')]?_0x2302be[_0x654c('0x19')]:_0x2302be['calleridnum'];}var _0x27107d=['id','firstName',_0x654c('0x1a'),_0x654c('0x16'),'mobile','fax',_0x654c('0x14'),_0x654c('0x1b'),_0x654c('0x1c'),_0x654c('0x1d')];var _0x18c17a=_['union'](_0x27107d,_0x33ef86);BPromise[_0x654c('0x1e')]()['then'](cmContactRpc[_0x654c('0x1f')]({'attributes':_0x18c17a,'where':_0x51e929,'phone':_0x2be557}))['then'](function(_0x2f8a47){_0x26b649=_0x2f8a47;if(!_[_0x654c('0x20')](_0x26b649)){if(_0x26b649[_0x654c('0x21')]===0x1){_0xbcd722=_0x26b649[0x0];logger[_0x654c('0xa')](_0x654c('0x22'),_0x2302be[_0x654c('0x23')],_0x2ad493['id'],_0xbcd722['id']);}else{logger['info'](_0x654c('0x24'),_0x2302be[_0x654c('0x23')],_0x2ad493['id'],_['map'](_0x26b649,'id')[_0x654c('0x25')](','));}return;}else{logger['info'](_0x654c('0x26'),_0x2302be[_0x654c('0x23')],_0x2ad493['id']);var _0x5a826a={'ListId':_0x4f212a};var _0x38e171=_0x383c85[_0x654c('0x27')]&&_0x383c85[_0x654c('0x27')]!=='0'?_0x383c85[_0x654c('0x27')]:_0x654c('0x16');if(_0x101428){logger[_0x654c('0xa')](_0x654c('0x28'),_0x2302be['uniqueid'],_0x2ad493['id']);_0x5a826a[_0x38e171]=_[_0x654c('0x11')](_0x2302be[_0x654c('0x18')])?_0x2302be['calleridnum']:_0x2302be['destcalleridnum'];if(_[_0x654c('0x11')](_0x2302be['routeId'])){_0x5a826a[_0x654c('0x29')]=_0x2302be['calleridname']&&_0x2302be['calleridname']!==_0x654c('0x2a')?_0x2302be[_0x654c('0x2b')]:_0x654c('0x2c');}else{_0x5a826a[_0x654c('0x29')]=_0x2302be[_0x654c('0x2d')]&&_0x2302be[_0x654c('0x2d')]!==_0x654c('0x2a')?_0x2302be['destcalleridname']:_0x654c('0x2c');}return BPromise['resolve']()[_0x654c('0x2e')](cmContactRpc[_0x654c('0x2f')](_0x5a826a))['then'](function(_0x12f5ed){_0xbcd722=_0x12f5ed;_0x26b649[_0x654c('0x30')](_0x12f5ed);if(_0xbcd722){logger[_0x654c('0xa')](_0x654c('0x31'),_0x2302be[_0x654c('0x23')],_0x2ad493['id'],_0xbcd722['id']);}return;});}else{logger[_0x654c('0xa')](_0x654c('0x32'),_0x2302be['uniqueid'],_0x2ad493['id']);_0x5a826a[_0x38e171]=_['isNil'](_0x2302be[_0x654c('0x18')])?_0x2302be[_0x654c('0x33')]:_0x2302be[_0x654c('0x19')];if(_[_0x654c('0x11')](_0x2302be['routeId'])){_0x5a826a[_0x654c('0x29')]=_0x2302be[_0x654c('0x2b')]&&_0x2302be[_0x654c('0x2b')]!==_0x654c('0x2a')?_0x2302be['calleridname']:_0x654c('0x2c');}else{_0x5a826a[_0x654c('0x29')]=_0x2302be[_0x654c('0x2d')]&&_0x2302be[_0x654c('0x2d')]!==_0x654c('0x2a')?_0x2302be[_0x654c('0x2d')]:_0x654c('0x2c');}_0xbcd722=_0x5a826a;_0x26b649[_0x654c('0x30')](_0x5a826a);return;}}})[_0x654c('0x2e')](function(){if(_0x16b86c){emit(_0x2302be['uniqueid'],_0x2ad493,util[_0x654c('0x34')](_0x654c('0x35'),_0x16b86c[_0x654c('0x36')]),util[_0x654c('0x34')]('trigger:%s',_0x383c85['action'][_0x654c('0x37')]()),{'evt':_[_0x654c('0x38')](_0x2302be,{'autoCreate':_0x101428}),'contact':_0xbcd722===undefined?{}:_0xbcd722,'contacts':_0x26b649[_0x654c('0x21')]===0x0?undefined:_0x26b649});}});};
\ No newline at end of file
index a822dca..06a099c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c7d=['data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','queue','routeId','urlforward','script','query','search','AllConditions','channel','some','AnyConditions','checkTrigger:\x20trigger','inspect','evt','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','membername','lastevent','null','substatus','offlineMessage','created','equals','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','custom:agentcalled','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','syncCustomEvent','custom:agentnosuchnumber','custom:agentbusy','custom:agentreject','custom:amd','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','debug','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','windowHeight'];(function(_0x4651d0,_0x1ac929){var _0x1dcc7e=function(_0x46e071){while(--_0x46e071){_0x4651d0['push'](_0x4651d0['shift']());}};_0x1dcc7e(++_0x1ac929);}(_0x9c7d,0x1ba));var _0xd9c7=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x9c7d[_0x3826ad];return _0x17b900;};'use strict';var util=require(_0xd9c7('0x0'));var _=require(_0xd9c7('0x1'));var url=require(_0xd9c7('0x2'));var Mustache=require(_0xd9c7('0x3'));var Redis=require(_0xd9c7('0x4'));var urlforward=require(_0xd9c7('0x5'));var integration=require(_0xd9c7('0x6'));var cmContact=require(_0xd9c7('0x7'));var script=require('./script');var config=require(_0xd9c7('0x8'));var logger=require(_0xd9c7('0x9'))(_0xd9c7('0xa'));var ami=require(_0xd9c7('0xb'));config[_0xd9c7('0xc')]=_['defaults'](config[_0xd9c7('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xd9c7('0xd'))(new Redis(config[_0xd9c7('0xc')]));var operators={'equals':function(_0x50e039,_0x3f3395){return _0x50e039==_0x3f3395;},'not_equals':function(_0x456567,_0x2573ce){return _0x456567!=_0x2573ce;}};var barAndWebActions=[_0xd9c7('0xe'),'url',_0xd9c7('0xf')];function Trigger(_0x43cac6){this[_0xd9c7('0x10')]=_0x43cac6[_0xd9c7('0x10')];this[_0xd9c7('0x11')]=_0x43cac6[_0xd9c7('0x11')];this['voiceQueues']=_0x43cac6[_0xd9c7('0x12')];this[_0xd9c7('0x13')]=_0x43cac6[_0xd9c7('0x13')];this[_0xd9c7('0x14')]=_0x43cac6[_0xd9c7('0x14')];this['zendeskAccounts']=_0x43cac6[_0xd9c7('0x15')];this[_0xd9c7('0x16')]=_0x43cac6['freshdeskAccounts'];this['salesforceAccounts']=_0x43cac6[_0xd9c7('0x17')];this['sugarcrmAccounts']=_0x43cac6['sugarcrmAccounts'];this[_0xd9c7('0x18')]=_0x43cac6[_0xd9c7('0x18')];this[_0xd9c7('0x19')]=_0x43cac6[_0xd9c7('0x19')];this[_0xd9c7('0x1a')]=_0x43cac6[_0xd9c7('0x1a')];this['servicenowAccounts']=_0x43cac6[_0xd9c7('0x1b')];this[_0xd9c7('0x1c')]=_0x43cac6['dynamics365Accounts'];this[_0xd9c7('0x1d')]=_0x43cac6[_0xd9c7('0x1d')];this[_0xd9c7('0x1e')]={'zendesk':this[_0xd9c7('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xd9c7('0x16')],'sugarcrm':this[_0xd9c7('0x1f')],'zoho':this[_0xd9c7('0x18')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xd9c7('0x1c')],'freshsales':this[_0xd9c7('0x1d')],'servicenow':this['servicenowAccounts']};ami['on'](_0xd9c7('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0xd9c7('0x21'),this['syncCustomEvent'][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x23'),this['syncCustomEvent']['bind'](this));ami['on'](_0xd9c7('0x24'),this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x26'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnoanswer',this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x27'),this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on']('custom:agentcongestion',this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x28'),this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x29'),this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on']('custom:queuecallerabandon',this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x2a'),this[_0xd9c7('0x2b')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x2c'),this['syncAgentDial'][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x2d'),this['syncAgentDial'][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x2e'),this[_0xd9c7('0x25')]['bind'](this));ami['on'](_0xd9c7('0x2f'),this['syncCustomEvent'][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x30'),this[_0xd9c7('0x25')]['bind'](this));ami['on'](_0xd9c7('0x31'),this['syncCustomEvent'][_0xd9c7('0x22')](this));ami['on']('custom:outgoingmessage',this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x32'),this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x33'),this[_0xd9c7('0x25')][_0xd9c7('0x22')](this));ami['on'](_0xd9c7('0x34'),this['syncCustomEvent'][_0xd9c7('0x22')](this));}Trigger[_0xd9c7('0x35')][_0xd9c7('0x36')]=function(_0x2c0c73,_0x452af2,_0x13ec05){logger[_0xd9c7('0x37')](_0x2c0c73,_0x452af2,JSON[_0xd9c7('0x38')](_0x13ec05));io['to'](_0x2c0c73)[_0xd9c7('0x36')](_0x452af2,_0x13ec05);};Trigger['prototype'][_0xd9c7('0x25')]=function(_0x2720b6){var _0x1b6fbf=_[_0xd9c7('0x39')](_0x2720b6);if(typeof _0x1b6fbf[_0xd9c7('0x3a')]===_0xd9c7('0x3b')){_0x1b6fbf['motionChannel']=_0xd9c7('0x3c');}logger[_0xd9c7('0x3d')]('syncCustomEvent',util['inspect'](_0x1b6fbf,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x1b6fbf);};Trigger[_0xd9c7('0x35')][_0xd9c7('0x2b')]=function(_0x4c079f){if(this[_0xd9c7('0x11')][_0x4c079f[_0xd9c7('0x3e')]]){this['syncCustomEvent'](_0x4c079f);}};Trigger[_0xd9c7('0x35')][_0xd9c7('0x3f')]=function(_0x25b77e){var _0x29a387;for(var _0x4ad8cb in this['triggers']){if(this['triggers'][_0xd9c7('0x40')](_0x4ad8cb)){if(this[_0xd9c7('0x10')][_0x4ad8cb][_0xd9c7('0x41')]){_0x29a387=this[_0xd9c7('0x42')](this[_0xd9c7('0x10')][_0x4ad8cb],_0x25b77e);if(_0x29a387){_[_0xd9c7('0x43')](_0x25b77e,_0x25b77e[_0xd9c7('0x44')]);for(var _0x59effc=0x0,_0x775c13,_0x46a344,_0x44e4ea;_0x59effc<this[_0xd9c7('0x10')][_0x4ad8cb]['Actions'][_0xd9c7('0x45')];_0x59effc+=0x1){_0x775c13=this[_0xd9c7('0x10')][_0x4ad8cb]['Actions'][_0x59effc];if(this[_0xd9c7('0x11')][_0x25b77e[_0xd9c7('0x3e')]]){switch(_0x775c13[_0xd9c7('0x46')][_0xd9c7('0x47')]()){case _0xd9c7('0x48'):break;case _0xd9c7('0x49'):case _0xd9c7('0x4a'):var _0x5cb561={};switch(barAndWebActions[_0x775c13[_0xd9c7('0x4b')]]){case _0xd9c7('0xe'):_0x5cb561[_0xd9c7('0x4c')]=_0x775c13[_0xd9c7('0x4d')];_0x5cb561[_0xd9c7('0x4e')]=this[_0xd9c7('0x13')][_0x775c13['data2']]?Mustache[_0xd9c7('0x4f')](this[_0xd9c7('0x13')][_0x775c13[_0xd9c7('0x4d')]][_0xd9c7('0x4e')],_0x25b77e):_0xd9c7('0x50');break;case _0xd9c7('0x2'):_0x5cb561[_0xd9c7('0x51')]=this[_0xd9c7('0x52')](_0x775c13[_0xd9c7('0x4d')],_0x25b77e,_[_0xd9c7('0x53')](_0x775c13['data3'])?!![]:parseInt(_0x775c13[_0xd9c7('0x54')],0xa));if(_['isNil'](_0x775c13[_0xd9c7('0x55')])){_0x5cb561[_0xd9c7('0x56')]='0';}else{_0x5cb561[_0xd9c7('0x57')]=_0x775c13['data4'];_0x5cb561['windowWidth']=_[_0xd9c7('0x53')](_0x775c13[_0xd9c7('0x58')])?'800':_0x775c13[_0xd9c7('0x58')];_0x5cb561[_0xd9c7('0x59')]=_[_0xd9c7('0x53')](_0x775c13[_0xd9c7('0x5a')])?_0xd9c7('0x5b'):_0x775c13[_0xd9c7('0x5a')];}break;case _0xd9c7('0xf'):_0x5cb561[_0xd9c7('0x5c')]=_0x775c13[_0xd9c7('0x4d')]?Mustache[_0xd9c7('0x4f')](_0x775c13[_0xd9c7('0x4d')],_0x25b77e):'';_0x5cb561[_0xd9c7('0x5d')]=_0x775c13['data3']?Mustache[_0xd9c7('0x4f')](_0x775c13[_0xd9c7('0x54')],_0x25b77e):'';break;}this[_0xd9c7('0x36')](util[_0xd9c7('0x5e')](_0xd9c7('0x5f'),this['agents'][_0x25b77e[_0xd9c7('0x3e')]][_0xd9c7('0x60')]),util[_0xd9c7('0x5e')](_0xd9c7('0x61'),_0x775c13[_0xd9c7('0x46')]['toLowerCase'](),barAndWebActions[_0x775c13['data1']]),_[_0xd9c7('0x43')](_0x5cb561,_0x25b77e));break;case _0xd9c7('0x62'):this[_0xd9c7('0x36')](util[_0xd9c7('0x5e')]('user:%s',this['agents'][_0x25b77e['interface']][_0xd9c7('0x60')]),util[_0xd9c7('0x5e')](_0xd9c7('0x63'),_0x775c13[_0xd9c7('0x46')][_0xd9c7('0x47')]()),_[_0xd9c7('0x43')]({'ProjectId':parseInt(_0x775c13[_0xd9c7('0x4b')],0xa)},_0x25b77e));break;default:this[_0xd9c7('0x36')](util['format'](_0xd9c7('0x5f'),this[_0xd9c7('0x11')][_0x25b77e[_0xd9c7('0x3e')]][_0xd9c7('0x60')]),util[_0xd9c7('0x5e')]('trigger:%s',_0x775c13[_0xd9c7('0x46')][_0xd9c7('0x47')]()),_['merge']({},_0x775c13,_0x25b77e));}}switch(_0x775c13[_0xd9c7('0x46')][_0xd9c7('0x47')]()){case'contactmanager':cmContact[_0xd9c7('0x64')](this[_0xd9c7('0x11')][_0x25b77e[_0xd9c7('0x3e')]],this[_0xd9c7('0x10')][_0x4ad8cb],_0x775c13,_0x25b77e);break;case'integration':integration[_0xd9c7('0x64')](_0x775c13,_0x25b77e,this[_0xd9c7('0x1e')],this[_0xd9c7('0x11')][_0x25b77e[_0xd9c7('0x3e')]],this['voiceQueues'][_0x25b77e[_0xd9c7('0x65')]],this[_0xd9c7('0x14')][_0x25b77e[_0xd9c7('0x66')]]);break;case _0xd9c7('0x67'):urlforward[_0xd9c7('0x64')](_0x775c13,_0x25b77e);break;case _0xd9c7('0x68'):script[_0xd9c7('0x64')](_0x775c13,_0x25b77e);break;}}}}}}};Trigger[_0xd9c7('0x35')][_0xd9c7('0x52')]=function(_0x26f838,_0x4c3df9,_0xacd55c){var _0x5bc19a=url['parse'](Mustache[_0xd9c7('0x4f')](_0x26f838,_0x4c3df9),!![]);if(_0xacd55c){_[_0xd9c7('0x43')](_0x5bc19a[_0xd9c7('0x69')],_0x4c3df9);}delete _0x5bc19a[_0xd9c7('0x6a')];var _0x2083df=url[_0xd9c7('0x5e')](_0x5bc19a);_0x2083df=_0x2083df['replace'](/\/\?/g,'?');return _0x2083df;};Trigger[_0xd9c7('0x35')]['checkTrigger']=function(_0x5f584e,_0x11ecb2){var _0x462af1=!![];var _0x58694e=!![];var _0x164dd5=![];if(_0x5f584e['channel']===_0x11ecb2[_0xd9c7('0x3a')]){_0x164dd5=!![];}if(_0x5f584e[_0xd9c7('0x6b')][_0xd9c7('0x45')]){_0x462af1=_['every'](_0x5f584e[_0xd9c7('0x6b')],this['checkConditions'](_0x11ecb2,_0x5f584e[_0xd9c7('0x6c')]));}if(_0x5f584e['AnyConditions'][_0xd9c7('0x45')]){_0x58694e=_[_0xd9c7('0x6d')](_0x5f584e[_0xd9c7('0x6e')],this['checkConditions'](_0x11ecb2,_0x5f584e[_0xd9c7('0x6c')]));}var _0x2413ab=_0x164dd5&&_0x462af1&&_0x58694e;logger[_0xd9c7('0x3d')](_0xd9c7('0x6f'),util[_0xd9c7('0x70')](_0x5f584e,{'showHidden':!![],'depth':null}),_0xd9c7('0x71'),util[_0xd9c7('0x70')](_0x11ecb2,{'showHidden':!![],'depth':null}),_0x164dd5,_0x462af1,_0x58694e);return _0x2413ab;};Trigger[_0xd9c7('0x35')][_0xd9c7('0x72')]=function(_0x4fe9a2,_0x33f271){return function(_0x582597){switch(_0x582597[_0xd9c7('0x73')]){case _0xd9c7('0x74'):if(_0x4fe9a2['channel']===_0x33f271){if(_0x33f271===_0xd9c7('0x75')){return _0x4fe9a2[_0xd9c7('0x76')]?operators[_0x582597[_0xd9c7('0x77')]](Number(_0x582597[_0xd9c7('0x78')]),_0x4fe9a2[_0xd9c7('0x76')]):![];}else{return _0x4fe9a2[_[_0xd9c7('0x79')](_0x33f271)+_0xd9c7('0x7a')]?operators[_0x582597[_0xd9c7('0x77')]](Number(_0x582597['value']),_0x4fe9a2[_[_0xd9c7('0x79')](_0x33f271)+_0xd9c7('0x7a')]):![];}}break;case'interaction':case _0xd9c7('0x7b'):if(_0x4fe9a2['channel']===_0x33f271){return _0x4fe9a2[_0xd9c7('0x7c')]?operators[_0x582597[_0xd9c7('0x77')]](_0x582597[_0xd9c7('0x78')],_0x4fe9a2[_0xd9c7('0x7c')]):![];}break;case _0xd9c7('0x65'):return _0x4fe9a2[_0xd9c7('0x65')]?operators[_0x582597[_0xd9c7('0x77')]](_0x582597[_0xd9c7('0x78')],_0x4fe9a2['queue']):![];case _0xd9c7('0x7d'):return _0x4fe9a2[_0xd9c7('0x7e')]?operators[_0x582597[_0xd9c7('0x77')]](_0x582597[_0xd9c7('0x78')],_0x4fe9a2['membername']):![];case _0xd9c7('0x7f'):return _0x4fe9a2['lastevent']?operators[_0x582597['operator']](_0x582597['value'],_0x4fe9a2[_0xd9c7('0x7f')]):![];case _0xd9c7('0x66'):return _0x4fe9a2[_0xd9c7('0x66')]?operators[_0x582597[_0xd9c7('0x77')]](_0x582597[_0xd9c7('0x78')],_0x4fe9a2[_0xd9c7('0x66')]):![];case'mailSubstatus':if(_0x582597[_0xd9c7('0x78')]===_0xd9c7('0x80'))_0x582597[_0xd9c7('0x78')]=null;return typeof _0x4fe9a2[_0xd9c7('0x81')]!=='undefined'?operators[_0x582597['operator']](_0x582597['value'],_0x4fe9a2[_0xd9c7('0x81')]):![];case _0xd9c7('0x82'):if(_0x4fe9a2[_0xd9c7('0x6c')]===_0x33f271){return _0x582597['value']===_0xd9c7('0x83')&&_0x582597[_0xd9c7('0x77')]===_0xd9c7('0x84')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0xad7c=['render','template\x20not\x20found','uri','buildUri','data3','isNil','location','uriLocation','data4','data5','windowHeight','data6','600','winApplication','winArguments','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','length','AnyConditions','debug','evt','field','account','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','message','event','queue','agent','lastevent','substatus','offlineMessage','equals','url','ioredis','./integration','./script','../../../config/environment','trigger','../ami','defaults','redis','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','deskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:timeout','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','inspect','checkTriggers','agents','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html'];(function(_0x3d64be,_0x5b46df){var _0x15d170=function(_0x46f364){while(--_0x46f364){_0x3d64be['push'](_0x3d64be['shift']());}};_0x15d170(++_0x5b46df);}(_0xad7c,0xae));var _0xcad7=function(_0x172f1f,_0x4a6cd2){_0x172f1f=_0x172f1f-0x0;var _0x5b413c=_0xad7c[_0x172f1f];return _0x5b413c;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xcad7('0x0'));var Mustache=require('mustache');var Redis=require(_0xcad7('0x1'));var urlforward=require('./urlforward');var integration=require(_0xcad7('0x2'));var cmContact=require('./cmContact');var script=require(_0xcad7('0x3'));var config=require(_0xcad7('0x4'));var logger=require('../../../config/logger')(_0xcad7('0x5'));var ami=require(_0xcad7('0x6'));config['redis']=_[_0xcad7('0x7')](config[_0xcad7('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x3dc032,_0x365e41){return _0x3dc032==_0x365e41;},'not_equals':function(_0x22e522,_0x34e282){return _0x22e522!=_0x34e282;}};var barAndWebActions=[_0xcad7('0x9'),_0xcad7('0x0'),_0xcad7('0xa')];function Trigger(_0x39b339){this[_0xcad7('0xb')]=_0x39b339[_0xcad7('0xb')];this['agents']=_0x39b339['agents'];this[_0xcad7('0xc')]=_0x39b339[_0xcad7('0xc')];this[_0xcad7('0xd')]=_0x39b339[_0xcad7('0xd')];this[_0xcad7('0xe')]=_0x39b339[_0xcad7('0xe')];this[_0xcad7('0xf')]=_0x39b339[_0xcad7('0xf')];this['freshdeskAccounts']=_0x39b339[_0xcad7('0x10')];this[_0xcad7('0x11')]=_0x39b339[_0xcad7('0x11')];this['sugarcrmAccounts']=_0x39b339['sugarcrmAccounts'];this[_0xcad7('0x12')]=_0x39b339['zohoAccounts'];this['deskAccounts']=_0x39b339['deskAccounts'];this[_0xcad7('0x13')]=_0x39b339[_0xcad7('0x13')];this['servicenowAccounts']=_0x39b339[_0xcad7('0x14')];this['dynamics365Accounts']=_0x39b339[_0xcad7('0x15')];this[_0xcad7('0x16')]=_0x39b339[_0xcad7('0x16')];this[_0xcad7('0x17')]={'zendesk':this[_0xcad7('0xf')],'salesforce':this[_0xcad7('0x11')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xcad7('0x18')],'zoho':this[_0xcad7('0x12')],'desk':this[_0xcad7('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xcad7('0x15')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xcad7('0x14')]};ami['on'](_0xcad7('0x1a'),this[_0xcad7('0x1b')]['bind'](this));ami['on']('custom:agentconnect',this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x1d'),this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on']('custom:agentcomplete',this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x1e'),this['syncCustomEvent'][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x1f'),this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x20'),this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on']('custom:agentreject',this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x21'),this[_0xcad7('0x1b')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x22'),this['syncCustomEvent'][_0xcad7('0x1c')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x23'),this[_0xcad7('0x24')][_0xcad7('0x1c')](this));ami['on']('custom:dialend',this[_0xcad7('0x24')][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x25'),this['syncCustomEvent'][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0xcad7('0x27'),this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on']('custom:incomingmessage',this[_0xcad7('0x1b')]['bind'](this));ami['on'](_0xcad7('0x28'),this[_0xcad7('0x1b')]['bind'](this));ami['on'](_0xcad7('0x29'),this['syncCustomEvent'][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x2a'),this[_0xcad7('0x1b')][_0xcad7('0x1c')](this));ami['on'](_0xcad7('0x2b'),this[_0xcad7('0x1b')]['bind'](this));}Trigger[_0xcad7('0x2c')][_0xcad7('0x2d')]=function(_0x3c299c,_0x561e5b,_0x16282e){logger['info'](_0x3c299c,_0x561e5b,JSON[_0xcad7('0x2e')](_0x16282e));io['to'](_0x3c299c)[_0xcad7('0x2d')](_0x561e5b,_0x16282e);};Trigger[_0xcad7('0x2c')][_0xcad7('0x1b')]=function(_0x1b6bb1){var _0x106c8c=_[_0xcad7('0x2f')](_0x1b6bb1);if(typeof _0x106c8c[_0xcad7('0x30')]===_0xcad7('0x31')){_0x106c8c[_0xcad7('0x30')]=_0xcad7('0x32');}logger['debug'](_0xcad7('0x1b'),util[_0xcad7('0x33')](_0x106c8c,{'showHidden':!![],'depth':null}));this[_0xcad7('0x34')](_0x106c8c);};Trigger[_0xcad7('0x2c')][_0xcad7('0x24')]=function(_0x1df83e){if(this[_0xcad7('0x35')][_0x1df83e[_0xcad7('0x36')]]){this[_0xcad7('0x1b')](_0x1df83e);}};Trigger[_0xcad7('0x2c')][_0xcad7('0x34')]=function(_0x42a307){var _0x59cc15;for(var _0x32fdf0 in this['triggers']){if(this[_0xcad7('0xb')][_0xcad7('0x37')](_0x32fdf0)){if(this[_0xcad7('0xb')][_0x32fdf0][_0xcad7('0x38')]){_0x59cc15=this[_0xcad7('0x39')](this['triggers'][_0x32fdf0],_0x42a307);if(_0x59cc15){_[_0xcad7('0x3a')](_0x42a307,_0x42a307[_0xcad7('0x3b')]);for(var _0x1638d6=0x0,_0x2e4912,_0x275060,_0x6298a;_0x1638d6<this[_0xcad7('0xb')][_0x32fdf0][_0xcad7('0x3c')]['length'];_0x1638d6+=0x1){_0x2e4912=this[_0xcad7('0xb')][_0x32fdf0][_0xcad7('0x3c')][_0x1638d6];if(this[_0xcad7('0x35')][_0x42a307[_0xcad7('0x36')]]){switch(_0x2e4912[_0xcad7('0x3d')][_0xcad7('0x3e')]()){case _0xcad7('0x3f'):break;case _0xcad7('0x40'):case _0xcad7('0x41'):var _0x5094c8={};switch(barAndWebActions[_0x2e4912[_0xcad7('0x42')]]){case _0xcad7('0x9'):_0x5094c8[_0xcad7('0x43')]=_0x2e4912[_0xcad7('0x44')];_0x5094c8[_0xcad7('0x45')]=this[_0xcad7('0xd')][_0x2e4912[_0xcad7('0x44')]]?Mustache[_0xcad7('0x46')](this[_0xcad7('0xd')][_0x2e4912[_0xcad7('0x44')]][_0xcad7('0x45')],_0x42a307):_0xcad7('0x47');break;case'url':_0x5094c8[_0xcad7('0x48')]=this[_0xcad7('0x49')](_0x2e4912['data2'],_0x42a307,_['isNil'](_0x2e4912[_0xcad7('0x4a')])?!![]:parseInt(_0x2e4912[_0xcad7('0x4a')],0xa));if(_[_0xcad7('0x4b')](_0x2e4912['data4'])){_0x5094c8[_0xcad7('0x4c')]='0';}else{_0x5094c8[_0xcad7('0x4d')]=_0x2e4912[_0xcad7('0x4e')];_0x5094c8['windowWidth']=_[_0xcad7('0x4b')](_0x2e4912[_0xcad7('0x4f')])?'800':_0x2e4912['data5'];_0x5094c8[_0xcad7('0x50')]=_['isNil'](_0x2e4912[_0xcad7('0x51')])?_0xcad7('0x52'):_0x2e4912[_0xcad7('0x51')];}break;case _0xcad7('0xa'):_0x5094c8[_0xcad7('0x53')]=_0x2e4912[_0xcad7('0x44')]?Mustache['render'](_0x2e4912[_0xcad7('0x44')],_0x42a307):'';_0x5094c8[_0xcad7('0x54')]=_0x2e4912[_0xcad7('0x4a')]?Mustache['render'](_0x2e4912['data3'],_0x42a307):'';break;}this[_0xcad7('0x2d')](util[_0xcad7('0x55')]('user:%s',this[_0xcad7('0x35')][_0x42a307[_0xcad7('0x36')]][_0xcad7('0x56')]),util[_0xcad7('0x55')](_0xcad7('0x57'),_0x2e4912['action']['toLowerCase'](),barAndWebActions[_0x2e4912[_0xcad7('0x42')]]),_[_0xcad7('0x3a')](_0x5094c8,_0x42a307));break;case _0xcad7('0x58'):this[_0xcad7('0x2d')](util['format'](_0xcad7('0x59'),this[_0xcad7('0x35')][_0x42a307[_0xcad7('0x36')]]['name']),util['format'](_0xcad7('0x5a'),_0x2e4912[_0xcad7('0x3d')][_0xcad7('0x3e')]()),_[_0xcad7('0x3a')]({'ProjectId':parseInt(_0x2e4912['data1'],0xa)},_0x42a307));break;default:this[_0xcad7('0x2d')](util[_0xcad7('0x55')](_0xcad7('0x59'),this[_0xcad7('0x35')][_0x42a307[_0xcad7('0x36')]][_0xcad7('0x56')]),util[_0xcad7('0x55')](_0xcad7('0x5a'),_0x2e4912[_0xcad7('0x3d')][_0xcad7('0x3e')]()),_[_0xcad7('0x3a')]({},_0x2e4912,_0x42a307));}}switch(_0x2e4912[_0xcad7('0x3d')]['toLowerCase']()){case _0xcad7('0x3f'):cmContact[_0xcad7('0x5b')](this[_0xcad7('0x35')][_0x42a307[_0xcad7('0x36')]],this[_0xcad7('0xb')][_0x32fdf0],_0x2e4912,_0x42a307);break;case'integration':integration[_0xcad7('0x5b')](_0x2e4912,_0x42a307,this[_0xcad7('0x17')],this[_0xcad7('0x35')][_0x42a307[_0xcad7('0x36')]],this[_0xcad7('0xc')][_0x42a307['queue']],this['voiceExtensions'][_0x42a307[_0xcad7('0x5c')]]);break;case _0xcad7('0x5d'):urlforward[_0xcad7('0x5b')](_0x2e4912,_0x42a307);break;case _0xcad7('0x5e'):script[_0xcad7('0x5b')](_0x2e4912,_0x42a307);break;}}}}}}};Trigger[_0xcad7('0x2c')][_0xcad7('0x49')]=function(_0x42aa12,_0x4983d0,_0x4c0120){var _0x5360b3=url[_0xcad7('0x5f')](Mustache[_0xcad7('0x46')](_0x42aa12,_0x4983d0),!![]);if(_0x4c0120){_[_0xcad7('0x3a')](_0x5360b3[_0xcad7('0x60')],_0x4983d0);}delete _0x5360b3[_0xcad7('0x61')];var _0x1c2659=url[_0xcad7('0x55')](_0x5360b3);_0x1c2659=_0x1c2659[_0xcad7('0x62')](/\/\?/g,'?');return _0x1c2659;};Trigger['prototype'][_0xcad7('0x39')]=function(_0x5185b0,_0x5a770a){var _0x4bc5ec=!![];var _0x266fe6=!![];var _0x59f313=![];if(_0x5185b0[_0xcad7('0x63')]===_0x5a770a[_0xcad7('0x30')]){_0x59f313=!![];}if(_0x5185b0[_0xcad7('0x64')]['length']){_0x4bc5ec=_[_0xcad7('0x65')](_0x5185b0[_0xcad7('0x64')],this['checkConditions'](_0x5a770a,_0x5185b0[_0xcad7('0x63')]));}if(_0x5185b0['AnyConditions'][_0xcad7('0x66')]){_0x266fe6=_['some'](_0x5185b0[_0xcad7('0x67')],this['checkConditions'](_0x5a770a,_0x5185b0[_0xcad7('0x63')]));}var _0x2a55f6=_0x59f313&&_0x4bc5ec&&_0x266fe6;logger[_0xcad7('0x68')]('checkTrigger:\x20trigger',util['inspect'](_0x5185b0,{'showHidden':!![],'depth':null}),_0xcad7('0x69'),util[_0xcad7('0x33')](_0x5a770a,{'showHidden':!![],'depth':null}),_0x59f313,_0x4bc5ec,_0x266fe6);return _0x2a55f6;};Trigger[_0xcad7('0x2c')]['checkConditions']=function(_0x56a941,_0x42829d){return function(_0x16243e){switch(_0x16243e[_0xcad7('0x6a')]){case _0xcad7('0x6b'):if(_0x56a941['channel']===_0x42829d){if(_0x42829d==='chat'){return _0x56a941[_0xcad7('0x6c')]?operators[_0x16243e['operator']](Number(_0x16243e[_0xcad7('0x6d')]),_0x56a941['ChatWebsiteId']):![];}else{return _0x56a941[_[_0xcad7('0x6e')](_0x42829d)+_0xcad7('0x6f')]?operators[_0x16243e[_0xcad7('0x70')]](Number(_0x16243e[_0xcad7('0x6d')]),_0x56a941[_[_0xcad7('0x6e')](_0x42829d)+_0xcad7('0x6f')]):![];}}break;case _0xcad7('0x71'):case _0xcad7('0x72'):if(_0x56a941[_0xcad7('0x63')]===_0x42829d){return _0x56a941[_0xcad7('0x73')]?operators[_0x16243e[_0xcad7('0x70')]](_0x16243e['value'],_0x56a941[_0xcad7('0x73')]):![];}break;case'queue':return _0x56a941[_0xcad7('0x74')]?operators[_0x16243e[_0xcad7('0x70')]](_0x16243e[_0xcad7('0x6d')],_0x56a941['queue']):![];case _0xcad7('0x75'):return _0x56a941['membername']?operators[_0x16243e[_0xcad7('0x70')]](_0x16243e[_0xcad7('0x6d')],_0x56a941['membername']):![];case _0xcad7('0x76'):return _0x56a941[_0xcad7('0x76')]?operators[_0x16243e[_0xcad7('0x70')]](_0x16243e[_0xcad7('0x6d')],_0x56a941[_0xcad7('0x76')]):![];case'routeId':return _0x56a941[_0xcad7('0x5c')]?operators[_0x16243e[_0xcad7('0x70')]](_0x16243e[_0xcad7('0x6d')],_0x56a941[_0xcad7('0x5c')]):![];case'mailSubstatus':if(_0x16243e['value']==='null')_0x16243e[_0xcad7('0x6d')]=null;return typeof _0x56a941[_0xcad7('0x77')]!==_0xcad7('0x31')?operators[_0x16243e[_0xcad7('0x70')]](_0x16243e['value'],_0x56a941['substatus']):![];case _0xcad7('0x78'):if(_0x56a941[_0xcad7('0x63')]===_0x42829d){return _0x16243e['value']==='created'&&_0x16243e[_0xcad7('0x70')]===_0xcad7('0x79')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 210c3d4..a4a9d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0x5fc3[_0x2d460c];return _0xf6fc4c;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});};
\ No newline at end of file
+var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x38172d,_0x1531c0){var _0xb73ef1=function(_0x5a6218){while(--_0x5a6218){_0x38172d['push'](_0x38172d['shift']());}};_0xb73ef1(++_0x1531c0);}(_0x55ca,0x126));var _0xa55c=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x55ca[_0x5ed54b];return _0x4b58c7;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});};
\ No newline at end of file
index d2792d1..e6912c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3017=['picklist','customField','idField','indexOf','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','phonecalls','odata-entityid','ticketId','catch','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name','Error\x20running\x20Dynamics365\x20integration','lodash','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','data7','tenantId','CloudProvider','data2','resolve','data5','POST','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','value','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','systemuserid','toLowerCase','outbound','contacts','/systemusers(','4.0','body','headers','substring','lastIndexOf','enduserId','destcalleridnum','calleridnum','telephone1','GET','&$filter=','\x20eq\x20\x27','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes'];(function(_0x5d6ab8,_0x417177){var _0x2b6665=function(_0x28b331){while(--_0x28b331){_0x5d6ab8['push'](_0x5d6ab8['shift']());}};_0x2b6665(++_0x417177);}(_0x3017,0x96));var _0x7301=function(_0x2142a4,_0xb46d67){_0x2142a4=_0x2142a4-0x0;var _0x4c987d=_0x3017[_0x2142a4];return _0x4c987d;};'use strict';var _=require(_0x7301('0x0'));var rp=require('request-promise');var util=require(_0x7301('0x1'));var intUtil=require('./util');var md5=require(_0x7301('0x2'));var Redis=require(_0x7301('0x3'));var logger=require(_0x7301('0x4'))('dynamics365');var config=require(_0x7301('0x5'));config[_0x7301('0x6')]=_[_0x7301('0x7')](config[_0x7301('0x6')],{'host':_0x7301('0x8'),'port':0x18eb});var io=require(_0x7301('0x9'))(new Redis(config['redis']));function getAuthToken(_0x3ec527,_0x49f647,_0x42699c){if(_0x3ec527[_0x7301('0xa')]){_0x3ec527['remoteUri']=_0x3ec527['CloudProvider'][_0x7301('0xb')];_0x3ec527[_0x7301('0xc')]=_0x3ec527[_0x7301('0xd')][_0x7301('0xe')];return Promise[_0x7301('0xf')](_0x3ec527[_0x7301('0xd')][_0x7301('0x10')]);}var _0x43a441={'method':_0x7301('0x11'),'uri':_0x49f647,'form':{'client_id':_0x3ec527['clientId'],'resource':_0x3ec527[_0x7301('0x12')],'username':_0x3ec527[_0x7301('0x13')],'password':_0x3ec527[_0x7301('0x14')],'grant_type':'password','client_secret':_0x3ec527[_0x7301('0x15')]},'json':!![]};return rp(_0x43a441)[_0x7301('0x16')](function(_0x23bd3f){return _0x23bd3f[_0x7301('0x17')];})['catch'](function(_0x58444a){logger[_0x7301('0x18')]('['+[_0x42699c[_0x7301('0x19')]()]+_0x7301('0x1a'));return _0x58444a[_0x7301('0x1b')];});}function getUser(_0x5f5dc9,_0x3927bb,_0x12ce76,_0x124de2,_0x4aecd2,_0x5eada2){return new Promise(function(_0x139c19,_0x556517){return getAuthToken(_0x3927bb,_0x124de2,_0x5eada2)[_0x7301('0x16')](function(_0x1cc895){var _0x7503ad={'method':'GET','uri':_0x4aecd2+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x7301('0x1c')+_0x1cc895,'OData-Version':'4.0'},'json':!![]};return rp(_0x7503ad);})[_0x7301('0x16')](function(_0xa16ef){var _0x37bd69=_0xa16ef[_0x7301('0x1d')];var _0xd201bb=![];var _0x17dff9=null;if(!_['isNil'](_0x12ce76)){if(intUtil[_0x7301('0x1e')](_0x12ce76[_0x7301('0x1f')])){_0x5f5dc9[_0x7301('0x20')]=_0x12ce76[_0x7301('0x1f')];for(_0x17dff9=0x0;_0x17dff9<_0x37bd69[_0x7301('0x21')];_0x17dff9++){if(_0x37bd69[_0x17dff9]['internalemailaddress']===_0x12ce76[_0x7301('0x1f')]&&!_0x37bd69[_0x17dff9][_0x7301('0x22')]){_0xd201bb=!![];logger[_0x7301('0x23')]('['+[_0x5eada2[_0x7301('0x19')]()]+_0x7301('0x24')+_0x37bd69[_0x17dff9]['systemuserid']+'!');_0x5f5dc9['userId']=_0x37bd69[_0x17dff9]['systemuserid'];}}}}if(!_0xd201bb){logger[_0x7301('0x23')]('['+[_0x5eada2[_0x7301('0x19')]()]+_0x7301('0x25'));_0x5f5dc9['userEmail']=_0x3927bb['username'];for(_0x17dff9=0x0;_0x17dff9<_0x37bd69[_0x7301('0x21')];_0x17dff9++){if(_0x37bd69[_0x17dff9][_0x7301('0x26')]===_0x3927bb[_0x7301('0x13')]){_0x5f5dc9[_0x7301('0x27')]=_0x37bd69[_0x17dff9][_0x7301('0x28')];}}}_0x139c19(_0x5f5dc9);})['catch'](function(_0x34a57b){_0x556517(_0x34a57b[_0x7301('0x1b')]);});});}function createEndUser(_0x278b00,_0x20406f,_0x155efe,_0x4243ed,_0x1e28a6,_0x3bf441,_0x2a5e27){return new Promise(function(_0x898435,_0x38dcce){return getAuthToken(_0x20406f,_0x155efe,_0x3bf441)[_0x7301('0x16')](function(_0x51069e){var _0x3f3d23=_0x3bf441[_0x7301('0x29')]()===_0x7301('0x2a')?_0x1e28a6['destcalleridnum']:_0x1e28a6['calleridnum'];var _0x4b3f25={'method':_0x7301('0x11'),'uri':_0x4243ed+_0x7301('0x2b'),'body':{'fullname':_0x3f3d23,'firstname':_0x3f3d23,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7301('0x2c')+_0x278b00[_0x7301('0x27')]+')'},'headers':{'Authorization':_0x7301('0x1c')+_0x51069e,'OData-Version':_0x7301('0x2d')},'json':!![],'resolveWithFullResponse':!![]};_0x4b3f25[_0x7301('0x2e')][_0x2a5e27]=_0x3f3d23;return rp(_0x4b3f25);})[_0x7301('0x16')](function(_0x710ce1){var _0x3a7359=_0x710ce1[_0x7301('0x2f')]['odata-entityid'];var _0x2eec56=_0x3a7359[_0x7301('0x30')](_0x3a7359[_0x7301('0x31')]('(')+0x1,_0x3a7359[_0x7301('0x31')](')'));_0x278b00[_0x7301('0x32')]=_0x2eec56;_0x898435(_0x278b00);})['catch'](function(_0x351642){_0x38dcce(_0x351642[_0x7301('0x1b')]);});});}function getEndUser(_0x396923,_0x4a3aa2,_0x8a2e7d,_0x566c20,_0x15392f,_0xdf7023,_0x214263,_0x19713d){var _0xab08a2=_0xdf7023[_0x7301('0x29')]()===_0x7301('0x2a')?_0x15392f[_0x7301('0x33')]:_0x15392f[_0x7301('0x34')];return getAuthToken(_0x4a3aa2,_0x8a2e7d,_0xdf7023)[_0x7301('0x16')](function(_0x29594b){_0x19713d=_0x19713d?_0x19713d:_0x7301('0x35');var _0x1a8ade={'method':_0x7301('0x36'),'uri':_0x566c20+'contacts?$select='+_0x19713d+_0x7301('0x37')+_0x19713d+_0x7301('0x38')+_0xab08a2['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x7301('0x1c')+_0x29594b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a8ade);})[_0x7301('0x16')](function(_0x21114a){var _0x59e957=![];if(!_0x21114a)return _0x59e957;var _0x39be98=_0x21114a[_0x7301('0x1d')];for(var _0x421563=0x0;_0x421563<_0x39be98['length'];_0x421563++){if(_0x39be98[_0x421563][_0x19713d]===_0xab08a2){_0x59e957=!![];_0x396923['enduserId']=_0x39be98[_0x421563][_0x7301('0x39')];}}return _0x59e957;})[_0x7301('0x16')](function(_0xed1ed8){if(_0xed1ed8)return _0x396923;if(_0x214263==='nothing'){logger[_0x7301('0x23')]('['+[_0xdf7023['toUpperCase']()]+_0x7301('0x3a'));return _0x396923;}return createEndUser(_0x396923,_0x4a3aa2,_0x8a2e7d,_0x566c20,_0x15392f,_0xdf7023,_0x19713d)[_0x7301('0x16')](function(_0x387f11){logger[_0x7301('0x23')]('['+[_0xdf7023['toUpperCase']()]+']\x20Enduser\x20created!',_0x387f11[_0x7301('0x32')]);return _0x387f11;});});}function getCustomFields(_0x2245fe,_0xd81f3e,_0x5b8f66){var _0xdd56eb={};if(_0x2245fe[_0x7301('0x21')]>0x0){_['forEach'](_0x2245fe,function(_0x446ee1){if(_[_0x7301('0x3b')](['string',_0x7301('0x3c')],_0x446ee1['type'])&&_0x446ee1['nameField']&&!_0x446ee1[_0x7301('0x3d')]){var _0x3a5dc5=_0x446ee1[_0x7301('0x3e')][_0x7301('0x29')]();var _0x16eaef=_0x3a5dc5[_0x7301('0x30')](0x0,_0x3a5dc5[_0x7301('0x3f')]('_'));var _0x354d2e=_0x3a5dc5[_0x7301('0x30')](_0x3a5dc5[_0x7301('0x3f')]('_')+0x1);if(_0x16eaef===_0x5b8f66){_0xdd56eb[_0x354d2e]=_0x446ee1['content'];}}});}return _0xdd56eb;}function getTicket(_0x2aab17,_0x506d3c,_0x27e3fb,_0x59949e,_0x2b54b4,_0x59fe25,_0x4f8f19){return new Promise(function(_0x2f8b94,_0x4c8dfb){var _0x2c7ab4;return getAuthToken(_0x506d3c,_0x27e3fb,_0x4f8f19)[_0x7301('0x16')](function(_0x5337b1){if(_0x59fe25['ticketType']===_0x7301('0x40')){_0x2c7ab4={'method':_0x7301('0x11'),'uri':_0x59949e+_0x7301('0x41'),'body':Object[_0x7301('0x42')]({},{'title':intUtil['getString'](_0x59fe25[_0x7301('0x43')],_0x2b54b4,'\x20'),'description':intUtil[_0x7301('0x44')](_0x59fe25[_0x7301('0x45')],_0x2b54b4,'\x0a'),'customerid_contact@odata.bind':_0x2aab17[_0x7301('0x32')]?_0x7301('0x46')+_0x2aab17['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2aab17[_0x7301('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x59fe25[_0x7301('0x47')],_0x2b54b4,_0x59fe25['ticketType'])),'headers':{'Authorization':_0x7301('0x1c')+_0x5337b1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x59fe25[_0x7301('0x48')]==='phonecall'){var _0x411acf=_0x2aab17[_0x7301('0x32')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2aab17[_0x7301('0x27')]+')','participationtypemask':_0x2aab17[_0x7301('0x49')]===_0x7301('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2aab17[_0x7301('0x32')]+')','participationtypemask':_0x2aab17[_0x7301('0x49')]===_0x7301('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x7301('0x2c')+_0x2aab17['userId']+')','participationtypemask':_0x2aab17[_0x7301('0x49')]==='queue'?0x2:0x1}];_0x2c7ab4={'method':_0x7301('0x11'),'uri':_0x59949e+_0x7301('0x4b'),'body':Object[_0x7301('0x42')]({},{'subject':intUtil[_0x7301('0x44')](_0x59fe25[_0x7301('0x43')],_0x2b54b4,'\x20'),'phonenumber':String(_0x2b54b4[_0x7301('0x34')]),'description':intUtil[_0x7301('0x44')](_0x59fe25[_0x7301('0x45')],_0x2b54b4,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2aab17[_0x7301('0x32')]?_0x7301('0x46')+_0x2aab17[_0x7301('0x32')]+')':undefined,'ownerid@odata.bind':_0x7301('0x2c')+_0x2aab17[_0x7301('0x27')]+')','directioncode':_0x2aab17[_0x7301('0x49')]==='queue'?![]:!![],'phonecall_activity_parties':_0x411acf},getCustomFields(_0x59fe25[_0x7301('0x47')],_0x2b54b4,_0x59fe25[_0x7301('0x48')])),'headers':{'Authorization':'Bearer\x20'+_0x5337b1,'OData-Version':_0x7301('0x2d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2c7ab4);})[_0x7301('0x16')](function(_0x282e27){var _0x24d0df=_0x282e27[_0x7301('0x2f')][_0x7301('0x4c')];var _0x325a1d=_0x24d0df[_0x7301('0x30')](_0x24d0df[_0x7301('0x31')]('(')+0x1,_0x24d0df[_0x7301('0x31')](')'));_0x2aab17[_0x7301('0x4d')]=_0x325a1d;_0x2f8b94(_0x2aab17);})[_0x7301('0x4e')](function(_0x20121a){_0x4c8dfb(_0x20121a[_0x7301('0x1b')]);});});}function emit(_0x122fe5,_0x2998b4,_0x460830,_0x15a6ad){var _0x1fcf14={'uri':util[_0x7301('0x4f')](_0x7301('0x50'),_0x122fe5,_0x460830,_0x15a6ad)};io['to'](util[_0x7301('0x4f')](_0x7301('0x51'),_0x2998b4))[_0x7301('0x52')](_0x7301('0x53'),_0x1fcf14);}exports['cs']=function(_0x14392c,_0x4e0e0c,_0x492d21,_0x92fdf6,_0x3246d0,_0x1cbfd7,_0x1740c6,_0x5529b9){var _0x2bcb06={};_0x1cbfd7[_0x7301('0x12')]=_0x1cbfd7[_0x7301('0xa')]?intUtil['stripTrailingSlash'](_0x1cbfd7['CloudProvider'][_0x7301('0xb')]):intUtil[_0x7301('0x54')](_0x1cbfd7[_0x7301('0x12')]);_0x1cbfd7[_0x7301('0x55')]=intUtil['stripTrailingSlash'](_0x1cbfd7[_0x7301('0x55')]);_0x2bcb06[_0x7301('0x49')]=_0x5529b9==='queue'||_0x5529b9===_0x7301('0x56')?_0x7301('0x4a'):_0x7301('0x2a');var _0x464951=_0x1cbfd7[_0x7301('0xa')]?util[_0x7301('0x4f')](_0x7301('0x57'),_0x1cbfd7[_0x7301('0xd')]['data7']):util['format'](_0x7301('0x57'),_0x1cbfd7['remoteUri']);var _0x54776c=util['format'](_0x7301('0x58'),_0x1cbfd7[_0x7301('0xc')]);var _0x4e86f8=util[_0x7301('0x4f')](_0x7301('0x59'),_0x1cbfd7['serverUrl'],_0x4e0e0c[_0x7301('0x5a')],md5(_0x4e0e0c[_0x7301('0x5a')]));if(_0x3246d0&&_0x3246d0['monitor_format']){logger['info']('[QUEUE]',_0x7301('0x5b'));_0x4e0e0c[_0x7301('0x5c')]=_0x4e86f8;}else if(_0x1740c6&&_0x1740c6[_0x7301('0x5d')]&&_0x1740c6[_0x7301('0x5d')]!==_0x7301('0x5e')){logger['info']('[OUTBOUND]',_0x7301('0x5b'));_0x4e0e0c['recordingURL']=_0x4e86f8;}else{_0x4e0e0c[_0x7301('0x5c')]='';}return getUser(_0x2bcb06,_0x1cbfd7,_0x92fdf6,_0x54776c,_0x464951,_0x5529b9)[_0x7301('0x16')](function(_0x5007e3){logger['info']('['+_0x5529b9[_0x7301('0x19')]()+_0x7301('0x5f'),_0x5007e3[_0x7301('0x27')]);logger[_0x7301('0x23')]('['+_0x5529b9[_0x7301('0x19')]()+_0x7301('0x60'),_0x5007e3['userEmail']);return getEndUser(_0x5007e3,_0x1cbfd7,_0x54776c,_0x464951,_0x4e0e0c,_0x5529b9,_0x492d21['moduleCreate'],_0x492d21[_0x7301('0x61')]);})['then'](function(_0x4fdd2b){logger[_0x7301('0x23')]('['+_0x5529b9['toUpperCase']()+_0x7301('0x62'),_0x4fdd2b[_0x7301('0x32')]);logger['info']('['+_0x5529b9[_0x7301('0x19')]()+_0x7301('0x63'),_0x4e0e0c['calleridnum']);return getTicket(_0x4fdd2b,_0x1cbfd7,_0x54776c,_0x464951,_0x4e0e0c,_0x492d21,_0x5529b9);})[_0x7301('0x16')](function(_0x2d1c98){logger[_0x7301('0x23')](util[_0x7301('0x4f')]('['+_0x5529b9['toUpperCase']()+_0x7301('0x64'),_0x492d21[_0x7301('0x48')],_0x2d1c98[_0x7301('0x4d')]));logger['info'](util[_0x7301('0x4f')]('['+_0x5529b9[_0x7301('0x19')]()+_0x7301('0x65'),_0x5529b9));if(_0x5529b9!=='unmanaged'&&_0x492d21[_0x7301('0x66')]){logger[_0x7301('0x23')]('['+_0x5529b9['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1cbfd7[_0x7301('0x12')],_0x92fdf6[_0x7301('0x67')],_0x492d21[_0x7301('0x48')],_0x2d1c98[_0x7301('0x4d')]);}})[_0x7301('0x4e')](function(_0x2ba955){logger['error']('['+_0x5529b9[_0x7301('0x19')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2ba955[_0x7301('0x1b')]);console[_0x7301('0x18')](_0x7301('0x68'),_0x2ba955);});};
\ No newline at end of file
+var _0x953a=['enduserId','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','customField','idField','content','ticketType','incidents','getString','Subjects','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','assign','Descriptions','headers','format','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf'];(function(_0x2c7780,_0x100f4a){var _0x580bc8=function(_0x3d435c){while(--_0x3d435c){_0x2c7780['push'](_0x2c7780['shift']());}};_0x580bc8(++_0x100f4a);}(_0x953a,0x112));var _0xa953=function(_0x260192,_0x424853){_0x260192=_0x260192-0x0;var _0x50abad=_0x953a[_0x260192];return _0x50abad;};'use strict';var _=require(_0xa953('0x0'));var rp=require(_0xa953('0x1'));var util=require(_0xa953('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xa953('0x3'));var logger=require(_0xa953('0x4'))(_0xa953('0x5'));var config=require(_0xa953('0x6'));config[_0xa953('0x7')]=_[_0xa953('0x8')](config[_0xa953('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa953('0x9'))(new Redis(config[_0xa953('0x7')]));function getAuthToken(_0xa4196a,_0x382ab8,_0x380819){if(_0xa4196a['modernAuthentication']){_0xa4196a[_0xa953('0xa')]=_0xa4196a[_0xa953('0xb')][_0xa953('0xc')];_0xa4196a[_0xa953('0xd')]=_0xa4196a[_0xa953('0xb')]['data2'];return Promise[_0xa953('0xe')](_0xa4196a[_0xa953('0xb')][_0xa953('0xf')]);}var _0x53455b={'method':_0xa953('0x10'),'uri':_0x382ab8,'form':{'client_id':_0xa4196a[_0xa953('0x11')],'resource':_0xa4196a[_0xa953('0xa')],'username':_0xa4196a[_0xa953('0x12')],'password':_0xa4196a[_0xa953('0x13')],'grant_type':_0xa953('0x13'),'client_secret':_0xa4196a['clientSecret']},'json':!![]};return rp(_0x53455b)[_0xa953('0x14')](function(_0x384a09){return _0x384a09[_0xa953('0x15')];})[_0xa953('0x16')](function(_0xbcca1d){logger[_0xa953('0x17')]('['+[_0x380819[_0xa953('0x18')]()]+_0xa953('0x19'));return _0xbcca1d[_0xa953('0x1a')];});}function getUser(_0x2f6be5,_0x162cff,_0x2a9906,_0x542a76,_0x44a9ad,_0x3cbccd){return new Promise(function(_0x1489df,_0x587698){return getAuthToken(_0x162cff,_0x542a76,_0x3cbccd)[_0xa953('0x14')](function(_0x1fb2ad){var _0x4bf13={'method':'GET','uri':_0x44a9ad+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xa953('0x1b')+_0x1fb2ad,'OData-Version':_0xa953('0x1c')},'json':!![]};return rp(_0x4bf13);})['then'](function(_0x17ca7f){var _0x2fc2bc=_0x17ca7f[_0xa953('0x1d')];var _0x3d77ed=![];var _0x3f8d28=null;if(!_[_0xa953('0x1e')](_0x2a9906)){if(intUtil[_0xa953('0x1f')](_0x2a9906[_0xa953('0x20')])){_0x2f6be5[_0xa953('0x21')]=_0x2a9906[_0xa953('0x20')];for(_0x3f8d28=0x0;_0x3f8d28<_0x2fc2bc['length'];_0x3f8d28++){if(_0x2fc2bc[_0x3f8d28][_0xa953('0x22')]===_0x2a9906['email']&&!_0x2fc2bc[_0x3f8d28][_0xa953('0x23')]){_0x3d77ed=!![];logger['info']('['+[_0x3cbccd[_0xa953('0x18')]()]+_0xa953('0x24')+_0x2fc2bc[_0x3f8d28][_0xa953('0x25')]+'!');_0x2f6be5[_0xa953('0x26')]=_0x2fc2bc[_0x3f8d28][_0xa953('0x25')];}}}}if(!_0x3d77ed){logger[_0xa953('0x27')]('['+[_0x3cbccd[_0xa953('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2f6be5[_0xa953('0x21')]=_0x162cff[_0xa953('0x12')];for(_0x3f8d28=0x0;_0x3f8d28<_0x2fc2bc[_0xa953('0x28')];_0x3f8d28++){if(_0x2fc2bc[_0x3f8d28][_0xa953('0x22')]===_0x162cff[_0xa953('0x12')]){_0x2f6be5[_0xa953('0x26')]=_0x2fc2bc[_0x3f8d28]['systemuserid'];}}}_0x1489df(_0x2f6be5);})[_0xa953('0x16')](function(_0x4ad292){_0x587698(_0x4ad292[_0xa953('0x1a')]);});});}function createEndUser(_0x40c5df,_0x435c02,_0x49508c,_0x10c87f,_0x343bee,_0x53badd,_0x14ccbd){return new Promise(function(_0xe433a1,_0x58dbb8){return getAuthToken(_0x435c02,_0x49508c,_0x53badd)[_0xa953('0x14')](function(_0x2d7ecd){var _0x2bd2c1=_0x53badd[_0xa953('0x29')]()===_0xa953('0x2a')?_0x343bee[_0xa953('0x2b')]:_0x343bee[_0xa953('0x2c')];var _0xe162c5={'method':_0xa953('0x10'),'uri':_0x10c87f+_0xa953('0x2d'),'body':{'fullname':_0x2bd2c1,'firstname':_0x2bd2c1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa953('0x2e')+_0x40c5df['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x2d7ecd,'OData-Version':_0xa953('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0xe162c5['body'][_0x14ccbd]=_0x2bd2c1;return rp(_0xe162c5);})[_0xa953('0x14')](function(_0x151928){var _0x5ca66c=_0x151928['headers'][_0xa953('0x2f')];var _0x3b36eb=_0x5ca66c[_0xa953('0x30')](_0x5ca66c[_0xa953('0x31')]('(')+0x1,_0x5ca66c[_0xa953('0x31')](')'));_0x40c5df[_0xa953('0x32')]=_0x3b36eb;_0xe433a1(_0x40c5df);})['catch'](function(_0x11e20d){_0x58dbb8(_0x11e20d['message']);});});}function getEndUser(_0xee2dde,_0x1a06bb,_0x54ad99,_0x4301f2,_0x52227d,_0x36a933,_0x2e3834,_0x494fe8){var _0x180521=_0x36a933[_0xa953('0x29')]()===_0xa953('0x2a')?_0x52227d[_0xa953('0x2b')]:_0x52227d[_0xa953('0x2c')];return getAuthToken(_0x1a06bb,_0x54ad99,_0x36a933)[_0xa953('0x14')](function(_0x3d6505){_0x494fe8=_0x494fe8?_0x494fe8:_0xa953('0x33');var _0x341480={'method':'GET','uri':_0x4301f2+'contacts?$select='+_0x494fe8+_0xa953('0x34')+_0x494fe8+_0xa953('0x35')+_0x180521[_0xa953('0x36')]('+',_0xa953('0x37'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3d6505,'If-None-Match':null,'OData-Version':_0xa953('0x1c')},'json':!![]};return rp(_0x341480);})['then'](function(_0x226015){var _0x453333=![];if(!_0x226015)return _0x453333;var _0x3be59b=_0x226015[_0xa953('0x1d')];for(var _0x35a47f=0x0;_0x35a47f<_0x3be59b[_0xa953('0x28')];_0x35a47f++){if(_0x3be59b[_0x35a47f][_0x494fe8]===_0x180521){_0x453333=!![];_0xee2dde['enduserId']=_0x3be59b[_0x35a47f][_0xa953('0x38')];}}return _0x453333;})[_0xa953('0x14')](function(_0x2f52e4){if(_0x2f52e4)return _0xee2dde;if(_0x2e3834===_0xa953('0x39')){logger[_0xa953('0x27')]('['+[_0x36a933[_0xa953('0x18')]()]+_0xa953('0x3a'));return _0xee2dde;}return createEndUser(_0xee2dde,_0x1a06bb,_0x54ad99,_0x4301f2,_0x52227d,_0x36a933,_0x494fe8)[_0xa953('0x14')](function(_0x38f3a0){logger[_0xa953('0x27')]('['+[_0x36a933['toUpperCase']()]+']\x20Enduser\x20created!',_0x38f3a0['enduserId']);return _0x38f3a0;});});}function getCustomFields(_0x5965d5,_0x208936,_0x10bc6c){var _0x2ec0e4={};if(_0x5965d5[_0xa953('0x28')]>0x0){_[_0xa953('0x3b')](_0x5965d5,function(_0x438e71){if(_[_0xa953('0x3c')]([_0xa953('0x3d'),_0xa953('0x3e')],_0x438e71[_0xa953('0x3f')])&&_0x438e71[_0xa953('0x40')]&&!_0x438e71[_0xa953('0x41')]){var _0x5a2c0a=_0x438e71[_0xa953('0x42')][_0xa953('0x29')]();var _0x234794=_0x5a2c0a[_0xa953('0x30')](0x0,_0x5a2c0a['indexOf']('_'));var _0x5c16f9=_0x5a2c0a[_0xa953('0x30')](_0x5a2c0a['indexOf']('_')+0x1);if(_0x234794===_0x10bc6c){_0x2ec0e4[_0x5c16f9]=_0x438e71[_0xa953('0x43')];}}});}return _0x2ec0e4;}function getTicket(_0x2a6513,_0x45f0ac,_0x3f713b,_0x1cc361,_0x71b87,_0x33960f,_0x139112){return new Promise(function(_0x2f6157,_0x130b3d){var _0x152a5f;return getAuthToken(_0x45f0ac,_0x3f713b,_0x139112)[_0xa953('0x14')](function(_0x1cf8fc){if(_0x33960f[_0xa953('0x44')]==='incident'){_0x152a5f={'method':_0xa953('0x10'),'uri':_0x1cc361+_0xa953('0x45'),'body':Object['assign']({},{'title':intUtil[_0xa953('0x46')](_0x33960f[_0xa953('0x47')],_0x71b87,'\x20'),'description':intUtil[_0xa953('0x46')](_0x33960f['Descriptions'],_0x71b87,'\x0a'),'customerid_contact@odata.bind':_0x2a6513['enduserId']?_0xa953('0x48')+_0x2a6513[_0xa953('0x32')]+')':undefined,'ownerid@odata.bind':_0xa953('0x2e')+_0x2a6513[_0xa953('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x33960f[_0xa953('0x49')],_0x71b87,_0x33960f[_0xa953('0x44')])),'headers':{'Authorization':_0xa953('0x1b')+_0x1cf8fc,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x33960f[_0xa953('0x44')]===_0xa953('0x4a')){var _0x4ee5b3=_0x2a6513[_0xa953('0x32')]?[{'partyid_systemuser@odata.bind':_0xa953('0x2e')+_0x2a6513[_0xa953('0x26')]+')','participationtypemask':_0x2a6513[_0xa953('0x4b')]===_0xa953('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xa953('0x48')+_0x2a6513[_0xa953('0x32')]+')','participationtypemask':_0x2a6513[_0xa953('0x4b')]===_0xa953('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xa953('0x2e')+_0x2a6513[_0xa953('0x26')]+')','participationtypemask':_0x2a6513[_0xa953('0x4b')]===_0xa953('0x4c')?0x2:0x1}];_0x152a5f={'method':_0xa953('0x10'),'uri':_0x1cc361+_0xa953('0x4d'),'body':Object[_0xa953('0x4e')]({},{'subject':intUtil[_0xa953('0x46')](_0x33960f[_0xa953('0x47')],_0x71b87,'\x20'),'phonenumber':String(_0x71b87['calleridnum']),'description':intUtil[_0xa953('0x46')](_0x33960f[_0xa953('0x4f')],_0x71b87,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2a6513[_0xa953('0x32')]?_0xa953('0x48')+_0x2a6513[_0xa953('0x32')]+')':undefined,'ownerid@odata.bind':_0xa953('0x2e')+_0x2a6513[_0xa953('0x26')]+')','directioncode':_0x2a6513['callDirection']===_0xa953('0x4c')?![]:!![],'phonecall_activity_parties':_0x4ee5b3},getCustomFields(_0x33960f[_0xa953('0x49')],_0x71b87,_0x33960f['ticketType'])),'headers':{'Authorization':_0xa953('0x1b')+_0x1cf8fc,'OData-Version':_0xa953('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x152a5f);})['then'](function(_0x4d1f3d){var _0x1ea363=_0x4d1f3d[_0xa953('0x50')]['odata-entityid'];var _0x54e653=_0x1ea363[_0xa953('0x30')](_0x1ea363[_0xa953('0x31')]('(')+0x1,_0x1ea363[_0xa953('0x31')](')'));_0x2a6513['ticketId']=_0x54e653;_0x2f6157(_0x2a6513);})[_0xa953('0x16')](function(_0x56c88e){_0x130b3d(_0x56c88e[_0xa953('0x1a')]);});});}function emit(_0x46ad93,_0x3e1a41,_0x29915d,_0x10e1ca){var _0xf848da={'uri':util[_0xa953('0x51')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x46ad93,_0x29915d,_0x10e1ca)};io['to'](util[_0xa953('0x51')]('user:%s',_0x3e1a41))[_0xa953('0x52')](_0xa953('0x53'),_0xf848da);}exports['cs']=function(_0x4dbd8a,_0xa4b196,_0xbe5c3,_0xfa9b9b,_0x88906,_0x4dc418,_0x36d2ea,_0x52b74a){var _0x31e0aa={};_0x4dc418[_0xa953('0xa')]=_0x4dc418[_0xa953('0x54')]?intUtil[_0xa953('0x55')](_0x4dc418[_0xa953('0xb')][_0xa953('0xc')]):intUtil['stripTrailingSlash'](_0x4dc418['remoteUri']);_0x4dc418[_0xa953('0x56')]=intUtil[_0xa953('0x55')](_0x4dc418['serverUrl']);_0x31e0aa[_0xa953('0x4b')]=_0x52b74a===_0xa953('0x4c')||_0x52b74a===_0xa953('0x57')?_0xa953('0x4c'):_0xa953('0x2a');var _0x44790c=_0x4dc418[_0xa953('0x54')]?util[_0xa953('0x51')](_0xa953('0x58'),_0x4dc418[_0xa953('0xb')][_0xa953('0xc')]):util[_0xa953('0x51')]('%s/api/data/v9.0/',_0x4dc418[_0xa953('0xa')]);var _0x595c15=util[_0xa953('0x51')](_0xa953('0x59'),_0x4dc418[_0xa953('0xd')]);var _0x49cc04=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dc418[_0xa953('0x56')],_0xa4b196[_0xa953('0x5a')],md5(_0xa4b196[_0xa953('0x5a')]));if(_0x88906&&_0x88906['monitor_format']){logger[_0xa953('0x27')](_0xa953('0x5b'),_0xa953('0x5c'));_0xa4b196[_0xa953('0x5d')]=_0x49cc04;}else if(_0x36d2ea&&_0x36d2ea[_0xa953('0x5e')]&&_0x36d2ea[_0xa953('0x5e')]!=='none'){logger[_0xa953('0x27')](_0xa953('0x5f'),_0xa953('0x5c'));_0xa4b196['recordingURL']=_0x49cc04;}else{_0xa4b196[_0xa953('0x5d')]='';}return getUser(_0x31e0aa,_0x4dc418,_0xfa9b9b,_0x595c15,_0x44790c,_0x52b74a)[_0xa953('0x14')](function(_0x48e928){logger['info']('['+_0x52b74a[_0xa953('0x18')]()+_0xa953('0x60'),_0x48e928[_0xa953('0x26')]);logger[_0xa953('0x27')]('['+_0x52b74a[_0xa953('0x18')]()+_0xa953('0x61'),_0x48e928[_0xa953('0x21')]);return getEndUser(_0x48e928,_0x4dc418,_0x595c15,_0x44790c,_0xa4b196,_0x52b74a,_0xbe5c3[_0xa953('0x62')],_0xbe5c3[_0xa953('0x63')]);})[_0xa953('0x14')](function(_0x5c9760){logger[_0xa953('0x27')]('['+_0x52b74a['toUpperCase']()+_0xa953('0x64'),_0x5c9760[_0xa953('0x32')]);logger[_0xa953('0x27')]('['+_0x52b74a[_0xa953('0x18')]()+_0xa953('0x65'),_0xa4b196[_0xa953('0x2c')]);return getTicket(_0x5c9760,_0x4dc418,_0x595c15,_0x44790c,_0xa4b196,_0xbe5c3,_0x52b74a);})[_0xa953('0x14')](function(_0x52eb78){logger[_0xa953('0x27')](util[_0xa953('0x51')]('['+_0x52b74a[_0xa953('0x18')]()+_0xa953('0x66'),_0xbe5c3[_0xa953('0x44')],_0x52eb78['ticketId']));logger[_0xa953('0x27')](util['format']('['+_0x52b74a[_0xa953('0x18')]()+_0xa953('0x67'),_0x52b74a));if(_0x52b74a!=='unmanaged'&&_0xbe5c3[_0xa953('0x68')]){logger[_0xa953('0x27')]('['+_0x52b74a[_0xa953('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4dc418[_0xa953('0xa')],_0xfa9b9b['name'],_0xbe5c3[_0xa953('0x44')],_0x52eb78[_0xa953('0x69')]);}})[_0xa953('0x16')](function(_0x4c3db3){logger[_0xa953('0x17')]('['+_0x52b74a['toUpperCase']()+_0xa953('0x6a'),_0x4c3db3[_0xa953('0x1a')]);console['error'](_0xa953('0x6b'),_0x4c3db3);});};
\ No newline at end of file
index 4887ffe..6cc0d2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b60=['Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','info','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','type','nameField','toLowerCase','customField','push','idField','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','Ticket\x20created!','lastevent','lodash','request-promise','util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','Tags','name'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9b60,0x104));var _0x09b6=function(_0x26495c,_0x46f032){_0x26495c=_0x26495c-0x0;var _0x5a2045=_0x9b60[_0x26495c];return _0x5a2045;};'use strict';var _=require(_0x09b6('0x0'));var rp=require(_0x09b6('0x1'));var md5=require('md5');var util=require(_0x09b6('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x09b6('0x3'));var logger=require(_0x09b6('0x4'))(_0x09b6('0x5'));config[_0x09b6('0x6')]=_[_0x09b6('0x7')](config[_0x09b6('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x09b6('0x8'))(new Redis(config[_0x09b6('0x6')]));var headers={'Content-Type':_0x09b6('0x9'),'Accept':_0x09b6('0x9')};function emit(_0x55063d,_0x2fedb8,_0x49d9a7){io['to'](_0x55063d)['emit'](_0x2fedb8,_0x49d9a7);}function getTicket(_0x330799,_0x3383c8,_0x3adb6a,_0x4fd0b2,_0x19da14){logger['info'](_0x09b6('0xa'));var _0x35a28b=_[_0x09b6('0xb')]({'responder_id':_0x3383c8['id'],'requester_id':_0x3adb6a['id'],'name':util[_0x09b6('0xc')](_0x09b6('0xd'),_0x19da14['calleridname']),'phone':_0x19da14['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x09b6('0xe')](_0x4fd0b2[_0x09b6('0xf')],_0x19da14,'\x20'),'description':intUtil[_0x09b6('0xe')](_0x4fd0b2[_0x09b6('0x10')],_0x19da14,'<br>'),'tags':getTags(_0x4fd0b2[_0x09b6('0x11')],_0x09b6('0x12'))},getCustomFields(_0x4fd0b2[_0x09b6('0x13')],_0x19da14));_0x35a28b[_0x09b6('0x14')]=_[_0x09b6('0x15')](_[_0x09b6('0x16')](_0x35a28b['custom_fields'],'id'),_0x09b6('0x17'));return request({'uri':util[_0x09b6('0xc')](_0x09b6('0x18'),_0x330799[_0x09b6('0x19')]),'method':_0x09b6('0x1a'),'body':_0x35a28b})[_0x09b6('0x1b')](function(_0x982b06){logger['info']('Ticket\x20created!');return _0x982b06;});}function getUser(_0x48aed7,_0x4c07d3){if(intUtil[_0x09b6('0x1c')](_0x4c07d3)){return request({'uri':util[_0x09b6('0xc')](_0x09b6('0x1d'),_0x48aed7[_0x09b6('0x19')]),'qs':{'email':_0x4c07d3}})[_0x09b6('0x1b')](function(_0xf3d77b){if(_0xf3d77b['length']){logger[_0x09b6('0x1e')](_0x09b6('0x1f'));return _[_0x09b6('0x20')](_0xf3d77b,function(_0x4d72d7){return _0x4d72d7[_0x09b6('0x21')][_0x09b6('0x22')]===_0x4c07d3;});}else{logger[_0x09b6('0x1e')](_0x09b6('0x23'));return request({'uri':util[_0x09b6('0xc')](_0x09b6('0x24'),_0x48aed7[_0x09b6('0x19')])})[_0x09b6('0x1b')](function(_0x4fa81e){logger[_0x09b6('0x1e')](_0x09b6('0x25'));return _0x4fa81e;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x09b6('0xc')](_0x09b6('0x24'),_0x48aed7['remoteUri'])})[_0x09b6('0x1b')](function(_0x292870){logger[_0x09b6('0x1e')](_0x09b6('0x25'));return _0x292870;});}}function getEndUser(_0x11ce38,_0x4058c1,_0x4f4f50){logger[_0x09b6('0x1e')]('Searching\x20enduser\x20with\x20phone',_0x4f4f50);return request({'uri':util['format']('%s/api/v2/contacts',_0x11ce38[_0x09b6('0x19')]),'qs':{'phone':_0x4f4f50}})['then'](function(_0x58f5d6){if(_0x58f5d6[_0x09b6('0x26')]){logger['info'](_0x09b6('0x27'));return _[_0x09b6('0x20')](_0x58f5d6,{'phone':_0x4f4f50});}else{logger['info'](_0x09b6('0x28'));return request({'uri':util[_0x09b6('0xc')](_0x09b6('0x29'),_0x11ce38[_0x09b6('0x19')]),'method':_0x09b6('0x1a'),'body':{'name':_0x4058c1,'phone':_0x4f4f50}})[_0x09b6('0x1b')](function(_0x2fdd64){logger[_0x09b6('0x1e')](_0x09b6('0x2a'));return _0x2fdd64;});}});}function getAuth(_0x327f11){return util[_0x09b6('0xc')]('Basic\x20%s',new Buffer(_0x327f11[_0x09b6('0x2b')]+':X')[_0x09b6('0x2c')](_0x09b6('0x2d')));}function request(_0x21686e){logger[_0x09b6('0x2e')](_0x09b6('0x2f'),JSON[_0x09b6('0x30')](_0x21686e));return rp(_[_0x09b6('0x7')](_0x21686e,{'method':_0x09b6('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3681ed,_0x1b2d45){var _0x1580eb=[];if(_0x3681ed&&_0x3681ed['length']>0x0){_0x1580eb=_[_0x09b6('0x32')](_0x3681ed,_0x1b2d45);}return _0x1580eb;}function getCustomFields(_0x18c808,_0x4ecf30){var _0xc1e2df=[];var _0x39d84f={'custom_fields':[]};if(_0x18c808['length']>0x0){_['forEach'](_0x18c808,function(_0x3d821b){if(_[_0x09b6('0x33')]([_0x09b6('0x34'),'picklist'],_0x3d821b[_0x09b6('0x35')])&&_0x3d821b['nameField']&&!_0x3d821b['customField']){_0x39d84f[_0x3d821b[_0x09b6('0x36')][_0x09b6('0x37')]()]=_0x3d821b['content']['toString']();}else if(_[_0x09b6('0x33')]([_0x09b6('0x34'),'picklist'],_0x3d821b[_0x09b6('0x35')])&&_0x3d821b['idField']&&_0x3d821b[_0x09b6('0x38')]){_0x39d84f[_0x09b6('0x14')][_0x09b6('0x39')]({'id':_0x3d821b[_0x09b6('0x3a')],'value':_0x3d821b[_0x09b6('0x3b')]['toString']()});}else if(_0x3d821b[_0x09b6('0x35')]===_0x09b6('0x3c')&&_0x3d821b[_0x09b6('0x3d')]&&_0x3d821b[_0x09b6('0x3a')]&&_0x3d821b['customField']){_0x4ecf30[_0x3d821b['variableName']]&&_0x39d84f['custom_fields'][_0x09b6('0x39')]({'id':_0x3d821b[_0x09b6('0x3a')],'value':_0x4ecf30[_0x3d821b['variableName']][_0x09b6('0x2c')]()});}else if(_0x3d821b[_0x09b6('0x35')]===_0x09b6('0x3e')&&_0x3d821b[_0x09b6('0x3f')]&&_0x3d821b['Variable'][_0x09b6('0x12')]&&_0x3d821b[_0x09b6('0x3a')]&&_0x3d821b[_0x09b6('0x38')]){_0x4ecf30[_0x3d821b[_0x09b6('0x3f')][_0x09b6('0x12')]['toLowerCase']()]&&_0x39d84f[_0x09b6('0x14')][_0x09b6('0x39')]({'id':_0x3d821b[_0x09b6('0x3a')],'value':_0x4ecf30[_0x3d821b[_0x09b6('0x3f')][_0x09b6('0x12')][_0x09b6('0x37')]()]['toString']()});}});}return _0x39d84f;}exports[_0x09b6('0x40')]=function(_0x4b608f,_0xb9c2b9,_0x54e7dc,_0x53b583,_0xac255f,_0x3e2e2b){var _0x5ec9ba,_0x2e6fd1;_0x3e2e2b[_0x09b6('0x19')]=intUtil[_0x09b6('0x41')](_0x3e2e2b['remoteUri']);_0x3e2e2b['serverUrl']=intUtil[_0x09b6('0x41')](_0x3e2e2b[_0x09b6('0x42')]);if(_0xac255f&&_0xac255f[_0x09b6('0x43')]){logger[_0x09b6('0x1e')](_0x09b6('0x44'),_0x09b6('0x45'));_0xb9c2b9[_0x09b6('0x46')]=util['format'](_0x09b6('0x47'),_0x3e2e2b[_0x09b6('0x42')],_0xb9c2b9[_0x09b6('0x48')],md5(_0xb9c2b9['uniqueid']));}else{_0xb9c2b9['recordingURL']='';}headers[_0x09b6('0x49')]=getAuth(_0x3e2e2b);return getUser(_0x3e2e2b,_0x53b583[_0x09b6('0x22')])['then'](function(_0x25a908){_0x5ec9ba=_0x25a908;logger[_0x09b6('0x1e')](_0x09b6('0x4a'),_0x5ec9ba['id']);return getEndUser(_0x3e2e2b,_0xb9c2b9[_0x09b6('0x4b')],_0xb9c2b9[_0x09b6('0x4c')]);})['then'](function(_0x3a603b){_0x2e6fd1=_0x3a603b;logger[_0x09b6('0x1e')](_0x09b6('0x4d'),_0x2e6fd1['id']);return getTicket(_0x3e2e2b,_0x5ec9ba,_0x2e6fd1,_0x54e7dc,_0xb9c2b9);})[_0x09b6('0x1b')](function(_0x537c05){if(_0x537c05&&_0x537c05['id']){logger[_0x09b6('0x1e')]('Ticket\x20created!');logger[_0x09b6('0x1e')](_0x09b6('0x4e'),_0x537c05['id']);logger['info'](_0x09b6('0x44'),_0x09b6('0x4f'));emit(util[_0x09b6('0xc')]('user:%s',_0x53b583[_0x09b6('0x12')]),'trigger:browser:url',{'uri':util['format'](_0x09b6('0x50'),_0x3e2e2b[_0x09b6('0x19')],_0x537c05['id'])});}})[_0x09b6('0x51')](function(_0x16649f){logger[_0x09b6('0x52')](_0x09b6('0x44'),JSON['stringify'](_0x16649f));});};exports[_0x09b6('0x53')]=function(_0x335cf2,_0x469c5f,_0x42e935,_0x2c640e,_0x1e03cc,_0x1c9de8,_0x443e5b){var _0x29ae07,_0x547116;_0x1c9de8[_0x09b6('0x19')]=intUtil['stripTrailingSlash'](_0x1c9de8[_0x09b6('0x19')]);_0x1c9de8['serverUrl']=intUtil[_0x09b6('0x41')](_0x1c9de8[_0x09b6('0x42')]);if(_0x443e5b&&_0x443e5b[_0x09b6('0x54')]&&_0x443e5b[_0x09b6('0x54')]!=='none'){logger[_0x09b6('0x1e')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x469c5f[_0x09b6('0x46')]=util[_0x09b6('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c9de8[_0x09b6('0x42')],_0x469c5f[_0x09b6('0x48')],md5(_0x469c5f[_0x09b6('0x48')]));}headers[_0x09b6('0x49')]=getAuth(_0x1c9de8);return getUser(_0x1c9de8,_0x2c640e[_0x09b6('0x22')])[_0x09b6('0x1b')](function(_0x4cdae8){_0x29ae07=_0x4cdae8;logger[_0x09b6('0x1e')](_0x09b6('0x4a'),_0x29ae07['id']);return getEndUser(_0x1c9de8,_0x469c5f[_0x09b6('0x55')],_0x469c5f[_0x09b6('0x56')]);})[_0x09b6('0x1b')](function(_0x28e81b){_0x547116=_0x28e81b;logger[_0x09b6('0x1e')](_0x09b6('0x4d'),_0x547116['id']);return getTicket(_0x1c9de8,_0x29ae07,_0x547116,_0x42e935,_0x469c5f);})[_0x09b6('0x1b')](function(_0x5130ce){if(_0x5130ce&&_0x5130ce['id']){logger[_0x09b6('0x1e')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5130ce['id']);logger[_0x09b6('0x1e')](_0x09b6('0x57'),_0x09b6('0x4f'));emit(util[_0x09b6('0xc')]('user:%s',_0x2c640e[_0x09b6('0x12')]),_0x09b6('0x58'),{'uri':util[_0x09b6('0xc')](_0x09b6('0x50'),_0x1c9de8[_0x09b6('0x19')],_0x5130ce['id'])});}})[_0x09b6('0x51')](function(_0x4e4f1e){logger[_0x09b6('0x52')](_0x09b6('0x57'),JSON[_0x09b6('0x30')](_0x4e4f1e));});};exports[_0x09b6('0x59')]=function(_0x1b4c36,_0x722b50,_0x7567b6,_0x32a2f9,_0x1a109c,_0x5c85c2){var _0x49a680,_0x2d4e2f;_0x5c85c2[_0x09b6('0x19')]=intUtil[_0x09b6('0x41')](_0x5c85c2['remoteUri']);_0x5c85c2[_0x09b6('0x42')]=intUtil[_0x09b6('0x41')](_0x5c85c2[_0x09b6('0x42')]);if(_0x1a109c&&_0x1a109c[_0x09b6('0x43')]){logger['info']('['+_0x722b50['lastevent'][_0x09b6('0x5a')]()+']',_0x09b6('0x45'));_0x722b50[_0x09b6('0x46')]=util[_0x09b6('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c85c2['serverUrl'],_0x722b50['uniqueid'],md5(_0x722b50[_0x09b6('0x48')]));}else{_0x722b50[_0x09b6('0x46')]='';}headers[_0x09b6('0x49')]=getAuth(_0x5c85c2);return getUser(_0x5c85c2,'')['then'](function(_0x3f41e7){_0x49a680=_0x3f41e7;logger[_0x09b6('0x1e')](_0x09b6('0x4a'),_0x49a680['id']);return getEndUser(_0x5c85c2,_0x722b50[_0x09b6('0x4b')],_0x722b50[_0x09b6('0x4c')]);})[_0x09b6('0x1b')](function(_0x3ab627){_0x2d4e2f=_0x3ab627;logger[_0x09b6('0x1e')](_0x09b6('0x4d'),_0x2d4e2f['id']);return getTicket(_0x5c85c2,_0x49a680,_0x2d4e2f,_0x7567b6,_0x722b50);})[_0x09b6('0x1b')](function(_0x3a8863){if(_0x3a8863){logger[_0x09b6('0x1e')](_0x09b6('0x5b'));logger[_0x09b6('0x1e')](_0x09b6('0x4e'),_0x3a8863['id']);}})[_0x09b6('0x51')](function(_0x44af36){logger[_0x09b6('0x52')]('['+_0x722b50[_0x09b6('0x5c')][_0x09b6('0x5a')]()+']',JSON[_0x09b6('0x30')](_0x44af36));});};
\ No newline at end of file
+var _0xe81f=['defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Descriptions','name','mapValues','custom_fields','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','stringify','map','forEach','includes','string','nameField','customField','toLowerCase','content','picklist','idField','variableName','customVariable','Variable','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe81f,0xfc));var _0xfe81=function(_0x11ac24,_0x19b340){_0x11ac24=_0x11ac24-0x0;var _0x2f054b=_0xe81f[_0x11ac24];return _0x2f054b;};'use strict';var _=require(_0xfe81('0x0'));var rp=require(_0xfe81('0x1'));var md5=require(_0xfe81('0x2'));var util=require(_0xfe81('0x3'));var Redis=require('ioredis');var intUtil=require(_0xfe81('0x4'));var config=require(_0xfe81('0x5'));var logger=require(_0xfe81('0x6'))(_0xfe81('0x7'));config[_0xfe81('0x8')]=_[_0xfe81('0x9')](config[_0xfe81('0x8')],{'host':_0xfe81('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfe81('0x8')]));var headers={'Content-Type':_0xfe81('0xb'),'Accept':_0xfe81('0xb')};function emit(_0x48c106,_0x238dd6,_0x4ff97c){io['to'](_0x48c106)[_0xfe81('0xc')](_0x238dd6,_0x4ff97c);}function getTicket(_0x4e455f,_0x5c1eba,_0x5e4c39,_0x2919ca,_0x439bcf){logger[_0xfe81('0xd')](_0xfe81('0xe'));var _0x1003f9=_[_0xfe81('0xf')]({'responder_id':_0x5c1eba['id'],'requester_id':_0x5e4c39['id'],'name':util[_0xfe81('0x10')]('Caller\x20-\x20%s',_0x439bcf['calleridname']),'phone':_0x439bcf[_0xfe81('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfe81('0x12')](_0x2919ca['Subjects'],_0x439bcf,'\x20'),'description':intUtil[_0xfe81('0x12')](_0x2919ca[_0xfe81('0x13')],_0x439bcf,'<br>'),'tags':getTags(_0x2919ca['Tags'],_0xfe81('0x14'))},getCustomFields(_0x2919ca['Fields'],_0x439bcf));_0x1003f9['custom_fields']=_[_0xfe81('0x15')](_['keyBy'](_0x1003f9[_0xfe81('0x16')],'id'),_0xfe81('0x17'));return request({'uri':util['format']('%s/api/v2/tickets',_0x4e455f[_0xfe81('0x18')]),'method':_0xfe81('0x19'),'body':_0x1003f9})[_0xfe81('0x1a')](function(_0x35f477){logger[_0xfe81('0xd')](_0xfe81('0x1b'));return _0x35f477;});}function getUser(_0x1f2381,_0x43014f){if(intUtil[_0xfe81('0x1c')](_0x43014f)){return request({'uri':util[_0xfe81('0x10')]('%s/api/v2/agents',_0x1f2381[_0xfe81('0x18')]),'qs':{'email':_0x43014f}})['then'](function(_0x5255b7){if(_0x5255b7['length']){logger['info']('Agent\x20found!');return _[_0xfe81('0x1d')](_0x5255b7,function(_0x3cd97e){return _0x3cd97e[_0xfe81('0x1e')][_0xfe81('0x1f')]===_0x43014f;});}else{logger[_0xfe81('0xd')](_0xfe81('0x20'));return request({'uri':util[_0xfe81('0x10')]('%s/api/v2/agents/me',_0x1f2381[_0xfe81('0x18')])})['then'](function(_0xf01586){logger[_0xfe81('0xd')](_0xfe81('0x21'));return _0xf01586;});}});}else{logger['info'](_0xfe81('0x22'));return request({'uri':util[_0xfe81('0x10')](_0xfe81('0x23'),_0x1f2381['remoteUri'])})[_0xfe81('0x1a')](function(_0x268239){logger[_0xfe81('0xd')](_0xfe81('0x21'));return _0x268239;});}}function getEndUser(_0x5024ac,_0xefef15,_0x2e1933){logger['info'](_0xfe81('0x24'),_0x2e1933);return request({'uri':util[_0xfe81('0x10')](_0xfe81('0x25'),_0x5024ac[_0xfe81('0x18')]),'qs':{'phone':_0x2e1933}})[_0xfe81('0x1a')](function(_0x55034e){if(_0x55034e[_0xfe81('0x26')]){logger[_0xfe81('0xd')](_0xfe81('0x27'));return _[_0xfe81('0x1d')](_0x55034e,{'phone':_0x2e1933});}else{logger[_0xfe81('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xfe81('0x10')](_0xfe81('0x25'),_0x5024ac['remoteUri']),'method':_0xfe81('0x19'),'body':{'name':_0xefef15,'phone':_0x2e1933}})['then'](function(_0x270ba8){logger[_0xfe81('0xd')](_0xfe81('0x28'));return _0x270ba8;});}});}function getAuth(_0x5a3b1b){return util[_0xfe81('0x10')](_0xfe81('0x29'),new Buffer(_0x5a3b1b[_0xfe81('0x2a')]+':X')[_0xfe81('0x2b')](_0xfe81('0x2c')));}function request(_0x531757){logger['debug']('[HTTP]',JSON[_0xfe81('0x2d')](_0x531757));return rp(_['defaults'](_0x531757,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x496939,_0xde0e32){var _0xa0ece0=[];if(_0x496939&&_0x496939[_0xfe81('0x26')]>0x0){_0xa0ece0=_[_0xfe81('0x2e')](_0x496939,_0xde0e32);}return _0xa0ece0;}function getCustomFields(_0x417815,_0x54c61a){var _0x5c6612=[];var _0x205d67={'custom_fields':[]};if(_0x417815[_0xfe81('0x26')]>0x0){_[_0xfe81('0x2f')](_0x417815,function(_0x439b3c){if(_[_0xfe81('0x30')]([_0xfe81('0x31'),'picklist'],_0x439b3c['type'])&&_0x439b3c[_0xfe81('0x32')]&&!_0x439b3c[_0xfe81('0x33')]){_0x205d67[_0x439b3c[_0xfe81('0x32')][_0xfe81('0x34')]()]=_0x439b3c[_0xfe81('0x35')][_0xfe81('0x2b')]();}else if(_['includes'](['string',_0xfe81('0x36')],_0x439b3c['type'])&&_0x439b3c[_0xfe81('0x37')]&&_0x439b3c[_0xfe81('0x33')]){_0x205d67[_0xfe81('0x16')]['push']({'id':_0x439b3c[_0xfe81('0x37')],'value':_0x439b3c['content'][_0xfe81('0x2b')]()});}else if(_0x439b3c['type']==='variable'&&_0x439b3c[_0xfe81('0x38')]&&_0x439b3c[_0xfe81('0x37')]&&_0x439b3c['customField']){_0x54c61a[_0x439b3c[_0xfe81('0x38')]]&&_0x205d67[_0xfe81('0x16')]['push']({'id':_0x439b3c[_0xfe81('0x37')],'value':_0x54c61a[_0x439b3c[_0xfe81('0x38')]][_0xfe81('0x2b')]()});}else if(_0x439b3c['type']===_0xfe81('0x39')&&_0x439b3c[_0xfe81('0x3a')]&&_0x439b3c[_0xfe81('0x3a')][_0xfe81('0x14')]&&_0x439b3c[_0xfe81('0x37')]&&_0x439b3c['customField']){_0x54c61a[_0x439b3c[_0xfe81('0x3a')][_0xfe81('0x14')][_0xfe81('0x34')]()]&&_0x205d67['custom_fields'][_0xfe81('0x3b')]({'id':_0x439b3c[_0xfe81('0x37')],'value':_0x54c61a[_0x439b3c[_0xfe81('0x3a')][_0xfe81('0x14')]['toLowerCase']()][_0xfe81('0x2b')]()});}});}return _0x205d67;}exports['queue']=function(_0x116acd,_0x134d4e,_0x27be97,_0x3c64ad,_0x4b8319,_0x2cfc0a){var _0x35744d,_0x206737;_0x2cfc0a['remoteUri']=intUtil[_0xfe81('0x3c')](_0x2cfc0a[_0xfe81('0x18')]);_0x2cfc0a['serverUrl']=intUtil[_0xfe81('0x3c')](_0x2cfc0a[_0xfe81('0x3d')]);if(_0x4b8319&&_0x4b8319[_0xfe81('0x3e')]){logger['info'](_0xfe81('0x3f'),_0xfe81('0x40'));_0x134d4e[_0xfe81('0x41')]=util[_0xfe81('0x10')](_0xfe81('0x42'),_0x2cfc0a[_0xfe81('0x3d')],_0x134d4e['uniqueid'],md5(_0x134d4e['uniqueid']));}else{_0x134d4e['recordingURL']='';}headers[_0xfe81('0x43')]=getAuth(_0x2cfc0a);return getUser(_0x2cfc0a,_0x3c64ad['email'])[_0xfe81('0x1a')](function(_0x5580de){_0x35744d=_0x5580de;logger[_0xfe81('0xd')](_0xfe81('0x44'),_0x35744d['id']);return getEndUser(_0x2cfc0a,_0x134d4e[_0xfe81('0x45')],_0x134d4e[_0xfe81('0x11')]);})[_0xfe81('0x1a')](function(_0x4cc255){_0x206737=_0x4cc255;logger['info'](_0xfe81('0x46'),_0x206737['id']);return getTicket(_0x2cfc0a,_0x35744d,_0x206737,_0x27be97,_0x134d4e);})[_0xfe81('0x1a')](function(_0x2a4535){if(_0x2a4535&&_0x2a4535['id']){logger[_0xfe81('0xd')](_0xfe81('0x1b'));logger[_0xfe81('0xd')](_0xfe81('0x47'),_0x2a4535['id']);logger[_0xfe81('0xd')](_0xfe81('0x3f'),_0xfe81('0x48'));emit(util['format'](_0xfe81('0x49'),_0x3c64ad[_0xfe81('0x14')]),_0xfe81('0x4a'),{'uri':util[_0xfe81('0x10')](_0xfe81('0x4b'),_0x2cfc0a[_0xfe81('0x18')],_0x2a4535['id'])});}})[_0xfe81('0x4c')](function(_0x595f48){logger[_0xfe81('0x4d')](_0xfe81('0x3f'),JSON[_0xfe81('0x2d')](_0x595f48));});};exports[_0xfe81('0x4e')]=function(_0xd74b84,_0x4c6808,_0x35e892,_0x42593f,_0x3ecbb1,_0x17dbcd,_0x2bd7b6){var _0x3cd97a,_0x23657f;_0x17dbcd[_0xfe81('0x18')]=intUtil['stripTrailingSlash'](_0x17dbcd[_0xfe81('0x18')]);_0x17dbcd[_0xfe81('0x3d')]=intUtil['stripTrailingSlash'](_0x17dbcd['serverUrl']);if(_0x2bd7b6&&_0x2bd7b6[_0xfe81('0x4f')]&&_0x2bd7b6['recordingFormat']!=='none'){logger[_0xfe81('0xd')](_0xfe81('0x50'),_0xfe81('0x40'));_0x4c6808[_0xfe81('0x41')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17dbcd[_0xfe81('0x3d')],_0x4c6808[_0xfe81('0x51')],md5(_0x4c6808[_0xfe81('0x51')]));}headers[_0xfe81('0x43')]=getAuth(_0x17dbcd);return getUser(_0x17dbcd,_0x42593f[_0xfe81('0x1f')])[_0xfe81('0x1a')](function(_0x534b8a){_0x3cd97a=_0x534b8a;logger[_0xfe81('0xd')]('The\x20User\x20ID\x20is:',_0x3cd97a['id']);return getEndUser(_0x17dbcd,_0x4c6808[_0xfe81('0x52')],_0x4c6808[_0xfe81('0x53')]);})[_0xfe81('0x1a')](function(_0x2a4c90){_0x23657f=_0x2a4c90;logger[_0xfe81('0xd')](_0xfe81('0x46'),_0x23657f['id']);return getTicket(_0x17dbcd,_0x3cd97a,_0x23657f,_0x35e892,_0x4c6808);})[_0xfe81('0x1a')](function(_0x165067){if(_0x165067&&_0x165067['id']){logger[_0xfe81('0xd')](_0xfe81('0x1b'));logger[_0xfe81('0xd')](_0xfe81('0x47'),_0x165067['id']);logger['info'](_0xfe81('0x50'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfe81('0x10')](_0xfe81('0x49'),_0x42593f[_0xfe81('0x14')]),_0xfe81('0x4a'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x17dbcd[_0xfe81('0x18')],_0x165067['id'])});}})['catch'](function(_0x1ac954){logger[_0xfe81('0x4d')]('[OUTBOUND]',JSON['stringify'](_0x1ac954));});};exports[_0xfe81('0x54')]=function(_0x2c4988,_0x16e066,_0x422856,_0x34cf6b,_0x547b58,_0x1583dd){var _0x32b9e0,_0x2502c4;_0x1583dd[_0xfe81('0x18')]=intUtil[_0xfe81('0x3c')](_0x1583dd[_0xfe81('0x18')]);_0x1583dd['serverUrl']=intUtil[_0xfe81('0x3c')](_0x1583dd[_0xfe81('0x3d')]);if(_0x547b58&&_0x547b58[_0xfe81('0x3e')]){logger[_0xfe81('0xd')]('['+_0x16e066[_0xfe81('0x55')][_0xfe81('0x56')]()+']',_0xfe81('0x40'));_0x16e066[_0xfe81('0x41')]=util['format'](_0xfe81('0x42'),_0x1583dd[_0xfe81('0x3d')],_0x16e066['uniqueid'],md5(_0x16e066[_0xfe81('0x51')]));}else{_0x16e066[_0xfe81('0x41')]='';}headers[_0xfe81('0x43')]=getAuth(_0x1583dd);return getUser(_0x1583dd,'')[_0xfe81('0x1a')](function(_0x4649e3){_0x32b9e0=_0x4649e3;logger['info'](_0xfe81('0x44'),_0x32b9e0['id']);return getEndUser(_0x1583dd,_0x16e066[_0xfe81('0x45')],_0x16e066[_0xfe81('0x11')]);})[_0xfe81('0x1a')](function(_0x4f07eb){_0x2502c4=_0x4f07eb;logger[_0xfe81('0xd')](_0xfe81('0x46'),_0x2502c4['id']);return getTicket(_0x1583dd,_0x32b9e0,_0x2502c4,_0x422856,_0x16e066);})[_0xfe81('0x1a')](function(_0x39074d){if(_0x39074d){logger[_0xfe81('0xd')](_0xfe81('0x1b'));logger['info'](_0xfe81('0x47'),_0x39074d['id']);}})['catch'](function(_0x430e2c){logger[_0xfe81('0x4d')]('['+_0x16e066[_0xfe81('0x55')][_0xfe81('0x56')]()+']',JSON[_0xfe81('0x2d')](_0x430e2c));});};
\ No newline at end of file
index 3e86a35..2d8fe27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb31=['calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','then','users','length','email','info','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','adminEmail','/api/lookup?q=','&entities=contact','find','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum'];(function(_0x2237bb,_0x46a955){var _0xdb379b=function(_0xc4c394){while(--_0xc4c394){_0x2237bb['push'](_0x2237bb['shift']());}};_0xdb379b(++_0x46a955);}(_0xcb31,0x1bd));var _0x1cb3=function(_0x45b5be,_0x521627){_0x45b5be=_0x45b5be-0x0;var _0x198565=_0xcb31[_0x45b5be];return _0x198565;};'use strict';var _=require(_0x1cb3('0x0'));var rp=require(_0x1cb3('0x1'));var md5=require(_0x1cb3('0x2'));var util=require(_0x1cb3('0x3'));var moment=require(_0x1cb3('0x4'));var Promise=require(_0x1cb3('0x5'));var Redis=require(_0x1cb3('0x6'));var intUtil=require(_0x1cb3('0x7'));var config=require(_0x1cb3('0x8'));var logger=require(_0x1cb3('0x9'))(_0x1cb3('0xa'));config[_0x1cb3('0xb')]=_[_0x1cb3('0xc')](config['redis'],{'host':_0x1cb3('0xd'),'port':0x18eb});var io=require(_0x1cb3('0xe'))(new Redis(config['redis']));function getAdminId(_0x3244e4,_0x1cc219,_0x45b360,_0x28afd7){return new Promise(function(_0x514a87,_0x2b77f4){var _0xf3b585=![];var _0x493a89={'method':_0x1cb3('0xf'),'uri':_0x28afd7+_0x1cb3('0x10'),'json':!![]};_0x493a89[_0x1cb3('0x11')]=_0x45b360;logger['info']('Getting\x20admin\x20information');return rp(_0x493a89)[_0x1cb3('0x12')](function(_0x401500){if(_0x401500){var _0x384fae=_0x401500[_0x1cb3('0x13')];var _0x24e1cb=null;for(_0x24e1cb=0x0;_0x24e1cb<_0x384fae[_0x1cb3('0x14')];_0x24e1cb++){if(_0x384fae[_0x24e1cb][_0x1cb3('0x15')]===_0x3244e4['adminEmail']){_0x3244e4['adminId']=_0x384fae[_0x24e1cb]['id'];_0xf3b585=!![];}}if(_0xf3b585){logger[_0x1cb3('0x16')]('Admin\x20found:',_0x3244e4[_0x1cb3('0x17')]);_0x514a87(_0x3244e4);}else{_0x2b77f4({'statusCode':0x194,'message':_0x1cb3('0x18')});}}else{_0x2b77f4({'statusCode':0x194,'message':_0x1cb3('0x18')});}})['catch'](function(_0x5c1ce1){logger[_0x1cb3('0x19')]('['+[_0x1cc219[_0x1cb3('0x1a')]()]+']',_0x5c1ce1[_0x1cb3('0x1b')]);_0x2b77f4(_0x5c1ce1);});});}function getUser(_0xe88115,_0x1c139a,_0x49e681){return function(_0x428474){return new Promise(function(_0x4431dd,_0x323099){var _0x25d9dc={'method':_0x1cb3('0xf'),'uri':_0x49e681+_0x1cb3('0x10'),'json':!![]};_0x25d9dc[_0x1cb3('0x11')]=_0x1c139a;logger[_0x1cb3('0x16')]('Getting\x20user\x20list');return rp(_0x25d9dc)[_0x1cb3('0x12')](function(_0x5c83a6){if(_0x5c83a6){var _0x597090=_0x5c83a6[_0x1cb3('0x13')];var _0x4c89d8=![];var _0x465872=null;if(_0x428474[_0x1cb3('0x1c')]!==null){logger['info'](_0x1cb3('0x1d'),_0x428474[_0x1cb3('0x1c')]);_0x428474['userEmail']=_0x428474[_0x1cb3('0x1c')];for(_0x465872=0x0;_0x465872<_0x597090[_0x1cb3('0x14')];_0x465872++){if(_0x597090[_0x465872][_0x1cb3('0x15')]===_0x428474['agentEmail']){_0x4c89d8=!![];_0x428474[_0x1cb3('0x1e')]=_0x597090[_0x465872]['id'];logger[_0x1cb3('0x16')](_0x1cb3('0x1f'),_0x428474[_0x1cb3('0x1e')]);}}}if(!_0x4c89d8){logger[_0x1cb3('0x16')](_0x1cb3('0x20'));_0x428474['userEmail']=_0x428474[_0x1cb3('0x21')];_0x428474[_0x1cb3('0x1e')]=_0x428474['adminId'];_0x4c89d8=!![];}if(_0x4c89d8){_0x4431dd(_0x428474);}else{_0x323099({'statusCode':0x194,'message':_0x1cb3('0x18')});}}else{_0x323099({'statusCode':0x194,'message':_0x1cb3('0x18')});}})['catch'](function(_0x3e6376){logger[_0x1cb3('0x19')]('['+[_0xe88115[_0x1cb3('0x1a')]()]+']',_0x3e6376[_0x1cb3('0x1b')]);_0x323099(_0x3e6376);});});};}function searchContact(_0x3c0f02,_0x1bbedd,_0x2408a8,_0x593c2b){return new Promise(function(_0x40de16,_0x50958e){var _0x39e470={'method':'GET','headers':_0x1bbedd,'uri':_0x3c0f02+_0x1cb3('0x22')+_0x593c2b+'&f='+_0x2408a8+_0x1cb3('0x23'),'json':!![]};rp(_0x39e470)[_0x1cb3('0x12')](function(_0x4231a1){var _0x787e8e=_[_0x1cb3('0x24')](_0x4231a1[_0x1cb3('0x25')][_0x1cb3('0x25')],[_0x2408a8,_0x593c2b]);_0x40de16(_0x787e8e);})[_0x1cb3('0x26')](function(_0x5be6fb){_0x50958e(_0x5be6fb);});});}function getEndUser(_0x2670d3,_0x31fd27,_0x954f){return function(_0x55940f){return new Promise(function(_0x524c54,_0x3f6f04){logger[_0x1cb3('0x16')](util[_0x1cb3('0x27')](_0x1cb3('0x28'),_0x55940f[_0x1cb3('0x29')]));searchContact(_0x954f,_0x31fd27,_0x1cb3('0x2a'),_0x55940f['contactNumber'])['then'](function(_0x4bc24e){if(_0x4bc24e){_0x55940f[_0x1cb3('0x2b')]=_0x4bc24e['id'];logger[_0x1cb3('0x16')](_0x1cb3('0x2c'),_0x55940f[_0x1cb3('0x2b')]);return _0x524c54(_0x55940f);}searchContact(_0x954f,_0x31fd27,_0x1cb3('0x2d'),_0x55940f[_0x1cb3('0x29')])[_0x1cb3('0x12')](function(_0x6cfd1f){if(_0x6cfd1f){_0x55940f[_0x1cb3('0x2b')]=_0x6cfd1f['id'];logger[_0x1cb3('0x16')]('Contact\x20found\x20work_number:',_0x55940f[_0x1cb3('0x2b')]);return _0x524c54(_0x55940f);}createEndUser(_0x55940f,_0x2670d3,_0x31fd27,_0x954f)[_0x1cb3('0x12')](function(_0x333d34){logger['info']('Contact\x20created:',_0x333d34[_0x1cb3('0x2b')]);return _0x524c54(_0x333d34);});});})[_0x1cb3('0x26')](function(_0x3499b6){_0x3f6f04(_0x3499b6);});});};}function createEndUser(_0x5b1225,_0x90f7b8,_0x3d7261,_0x4287d9){return new Promise(function(_0x108886,_0x340bb8){var _0x5694be=moment();var _0x3c5b32={'method':_0x1cb3('0x2e'),'uri':_0x4287d9+_0x1cb3('0x2f'),'body':{'contact':{'last_name':_0x5b1225['contactNumber'],'work_number':_0x5b1225[_0x1cb3('0x29')],'mobile_number':_0x5b1225['contactNumber'],'owner_id':_0x5b1225[_0x1cb3('0x1e')],'created_at':_0x5694be['format'](_0x1cb3('0x30'))}},'json':!![]};_0x3c5b32[_0x1cb3('0x11')]=_0x3d7261;logger[_0x1cb3('0x16')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3c5b32)['then'](function(_0x4cf602){_0x5b1225['endUserId']=_0x4cf602[_0x1cb3('0x31')]['id'];_0x108886(_0x5b1225);})[_0x1cb3('0x26')](function(_0x1849cb){logger[_0x1cb3('0x19')]('['+[_0x90f7b8[_0x1cb3('0x1a')]()]+']',_0x1849cb[_0x1cb3('0x1b')]);_0x340bb8(_0x1849cb[_0x1cb3('0x1b')]);});});}function getTicket(_0x21b698,_0x15402e,_0x52b0bd,_0xd01602,_0x25a9af){return function(_0x24c1ad){logger[_0x1cb3('0x16')](_0x1cb3('0x32'));return new Promise(function(_0x264887,_0x2633af){var _0x3f70a1=moment();var _0x1c38b2={'method':_0x1cb3('0x2e'),'uri':_0x52b0bd+'/api/tasks','body':{'title':intUtil[_0x1cb3('0x33')](_0xd01602[_0x1cb3('0x34')],_0x25a9af,'\x20'),'description':intUtil[_0x1cb3('0x33')](_0xd01602[_0x1cb3('0x35')],_0x25a9af,'\x0a'),'owner_id':_0x24c1ad['userId'],'creater_id':_0x24c1ad['adminId'],'targetable_id':_0x24c1ad[_0x1cb3('0x2b')],'targetable_type':_0x1cb3('0x36'),'created_at':_0x3f70a1[_0x1cb3('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3f70a1[_0x1cb3('0x37')](0x1e,'m')[_0x1cb3('0x27')](_0x1cb3('0x30'))},'json':!![]};_0x1c38b2[_0x1cb3('0x11')]=_0x15402e;return rp(_0x1c38b2)[_0x1cb3('0x12')](function(_0x40def4){_0x24c1ad['ticketId']=_0x40def4[_0x1cb3('0x38')]['id'];logger['info'](_0x1cb3('0x39'),_0x24c1ad[_0x1cb3('0x3a')]);_0x264887(_0x24c1ad);})[_0x1cb3('0x26')](function(_0x4a5f54){logger[_0x1cb3('0x19')]('['+[_0x21b698[_0x1cb3('0x1a')]()]+']',_0x4a5f54[_0x1cb3('0x1b')]);_0x2633af(_0x4a5f54['message']);});});};}function emit(_0xdd7833,_0x202ab9,_0xcf7f15){var _0x2ee546={'uri':_0xdd7833+_0x1cb3('0x3b')+_0xcf7f15};io['to'](util[_0x1cb3('0x27')](_0x1cb3('0x3c'),_0x202ab9))[_0x1cb3('0x3d')](_0x1cb3('0x3e'),_0x2ee546);}exports['cs']=function(_0x309742,_0x553c4a,_0x58bcef,_0x1c4c7e,_0x11946a,_0x3fd582,_0x92fe30,_0x50861f){var _0x2f37de={};var _0x5316c3={'Authorization':_0x1cb3('0x3f')+_0x3fd582[_0x1cb3('0x40')]};_0x3fd582[_0x1cb3('0x41')]=intUtil[_0x1cb3('0x42')](_0x3fd582['remoteUri']);_0x3fd582[_0x1cb3('0x43')]=intUtil['stripTrailingSlash'](_0x3fd582[_0x1cb3('0x43')]);var _0x3eb7c8=_0x3fd582[_0x1cb3('0x41')];_0x2f37de['adminEmail']=_0x3fd582['username'];_0x2f37de['contactNumber']=_0x50861f[_0x1cb3('0x44')]()===_0x1cb3('0x45')?_0x553c4a[_0x1cb3('0x46')]:_0x553c4a[_0x1cb3('0x47')];_0x2f37de['callDirection']=_0x50861f===_0x1cb3('0x48')||_0x50861f===_0x1cb3('0x49')?'queue':_0x1cb3('0x45');if(_0x1c4c7e){_0x2f37de[_0x1cb3('0x1c')]=_0x1c4c7e['email'];}var _0x4afb2c=util[_0x1cb3('0x27')](_0x1cb3('0x4a'),_0x3fd582[_0x1cb3('0x43')],_0x553c4a[_0x1cb3('0x4b')],md5(_0x553c4a[_0x1cb3('0x4b')]));if(_0x11946a&&_0x11946a[_0x1cb3('0x4c')]){logger['info'](_0x1cb3('0x4d'),_0x1cb3('0x4e'));_0x553c4a[_0x1cb3('0x4f')]=_0x4afb2c;}else if(_0x92fe30&&_0x92fe30[_0x1cb3('0x50')]&&_0x92fe30[_0x1cb3('0x50')]!==_0x1cb3('0x51')){logger[_0x1cb3('0x16')](_0x1cb3('0x52'),'Recording\x20is\x20enabled!');_0x553c4a[_0x1cb3('0x4f')]=_0x4afb2c;}else{_0x553c4a[_0x1cb3('0x4f')]='';}return getAdminId(_0x2f37de,_0x50861f,_0x5316c3,_0x3eb7c8)[_0x1cb3('0x12')](getUser(_0x50861f,_0x5316c3,_0x3eb7c8))['then'](getEndUser(_0x50861f,_0x5316c3,_0x3eb7c8))['then'](getTicket(_0x50861f,_0x5316c3,_0x3eb7c8,_0x58bcef,_0x553c4a))['then'](function(_0x5f0e94){logger[_0x1cb3('0x16')](util[_0x1cb3('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5f0e94[_0x1cb3('0x3a')]));if(_0x50861f!==_0x1cb3('0x49')){logger[_0x1cb3('0x16')]('['+[_0x50861f[_0x1cb3('0x1a')]()]+']',_0x1cb3('0x53'));emit(_0x3eb7c8,_0x1c4c7e[_0x1cb3('0x54')],_0x5f0e94[_0x1cb3('0x2b')]);}})[_0x1cb3('0x26')](function(_0x1b7c06){logger[_0x1cb3('0x19')]('['+[_0x50861f[_0x1cb3('0x1a')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x1cb3('0x55')](_0x1b7c06,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xf0ae=['queue','unmanaged','email','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','catch','error','toUpperCase','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','message','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection'];(function(_0x4f02e,_0x4ac328){var _0x5a09cd=function(_0x358155){while(--_0x358155){_0x4f02e['push'](_0x4f02e['shift']());}};_0x5a09cd(++_0x4ac328);}(_0xf0ae,0x169));var _0xef0a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xf0ae[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xef0a('0x0'));var rp=require(_0xef0a('0x1'));var md5=require(_0xef0a('0x2'));var util=require(_0xef0a('0x3'));var moment=require(_0xef0a('0x4'));var Promise=require(_0xef0a('0x5'));var Redis=require(_0xef0a('0x6'));var intUtil=require(_0xef0a('0x7'));var config=require(_0xef0a('0x8'));var logger=require('../../../../config/logger')('freshsales');config[_0xef0a('0x9')]=_[_0xef0a('0xa')](config[_0xef0a('0x9')],{'host':_0xef0a('0xb'),'port':0x18eb});var io=require(_0xef0a('0xc'))(new Redis(config[_0xef0a('0x9')]));function getAdminId(_0x3cc68b,_0x26be1e,_0x2ca6a4,_0x55236d){return new Promise(function(_0x164a67,_0x13fd1a){var _0x3c4697=![];var _0x59003a={'method':_0xef0a('0xd'),'uri':_0x55236d+'/api/selector/owners','json':!![]};_0x59003a[_0xef0a('0xe')]=_0x2ca6a4;logger[_0xef0a('0xf')](_0xef0a('0x10'));return rp(_0x59003a)[_0xef0a('0x11')](function(_0x3dddea){if(_0x3dddea){var _0x2a0f27=_0x3dddea[_0xef0a('0x12')];var _0x5a2856=null;for(_0x5a2856=0x0;_0x5a2856<_0x2a0f27[_0xef0a('0x13')];_0x5a2856++){if(_0x2a0f27[_0x5a2856]['email']===_0x3cc68b[_0xef0a('0x14')]){_0x3cc68b[_0xef0a('0x15')]=_0x2a0f27[_0x5a2856]['id'];_0x3c4697=!![];}}if(_0x3c4697){logger[_0xef0a('0xf')]('Admin\x20found:',_0x3cc68b['adminId']);_0x164a67(_0x3cc68b);}else{_0x13fd1a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x13fd1a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xef0a('0x16')](function(_0x167d35){logger[_0xef0a('0x17')]('['+[_0x26be1e[_0xef0a('0x18')]()]+']',_0x167d35['message']);_0x13fd1a(_0x167d35);});});}function getUser(_0x4933e3,_0x136b0b,_0x5107f7){return function(_0x218b0d){return new Promise(function(_0x36cb42,_0x1e83c2){var _0x121e8a={'method':'GET','uri':_0x5107f7+_0xef0a('0x19'),'json':!![]};_0x121e8a[_0xef0a('0xe')]=_0x136b0b;logger['info'](_0xef0a('0x1a'));return rp(_0x121e8a)[_0xef0a('0x11')](function(_0x586558){if(_0x586558){var _0x637c41=_0x586558[_0xef0a('0x12')];var _0x521fa6=![];var _0x6b825e=null;if(_0x218b0d[_0xef0a('0x1b')]!==null){logger[_0xef0a('0xf')](_0xef0a('0x1c'),_0x218b0d[_0xef0a('0x1b')]);_0x218b0d[_0xef0a('0x1d')]=_0x218b0d['agentEmail'];for(_0x6b825e=0x0;_0x6b825e<_0x637c41[_0xef0a('0x13')];_0x6b825e++){if(_0x637c41[_0x6b825e]['email']===_0x218b0d[_0xef0a('0x1b')]){_0x521fa6=!![];_0x218b0d[_0xef0a('0x1e')]=_0x637c41[_0x6b825e]['id'];logger['info'](_0xef0a('0x1f'),_0x218b0d[_0xef0a('0x1e')]);}}}if(!_0x521fa6){logger['info'](_0xef0a('0x20'));_0x218b0d[_0xef0a('0x1d')]=_0x218b0d['adminEmail'];_0x218b0d[_0xef0a('0x1e')]=_0x218b0d[_0xef0a('0x15')];_0x521fa6=!![];}if(_0x521fa6){_0x36cb42(_0x218b0d);}else{_0x1e83c2({'statusCode':0x194,'message':_0xef0a('0x21')});}}else{_0x1e83c2({'statusCode':0x194,'message':_0xef0a('0x21')});}})['catch'](function(_0x28efd2){logger[_0xef0a('0x17')]('['+[_0x4933e3[_0xef0a('0x18')]()]+']',_0x28efd2[_0xef0a('0x22')]);_0x1e83c2(_0x28efd2);});});};}function searchContact(_0x1dff21,_0x31db5e,_0x4df9bd,_0xc7ea20){return new Promise(function(_0x35cf9f,_0x3e41f4){var _0x126b04={'method':_0xef0a('0xd'),'headers':_0x31db5e,'uri':_0x1dff21+_0xef0a('0x23')+_0xc7ea20+'&f='+_0x4df9bd+_0xef0a('0x24'),'json':!![]};rp(_0x126b04)[_0xef0a('0x11')](function(_0x370434){var _0xd47639=_[_0xef0a('0x25')](_0x370434[_0xef0a('0x26')][_0xef0a('0x26')],[_0x4df9bd,_0xc7ea20]);_0x35cf9f(_0xd47639);})[_0xef0a('0x16')](function(_0x4ed9c9){_0x3e41f4(_0x4ed9c9);});});}function getEndUser(_0x325d7d,_0x24837f,_0x4388dd){return function(_0x10cd0e){return new Promise(function(_0x37e6a1,_0x35744b){logger['info'](util[_0xef0a('0x27')](_0xef0a('0x28'),_0x10cd0e[_0xef0a('0x29')]));searchContact(_0x4388dd,_0x24837f,_0xef0a('0x2a'),_0x10cd0e[_0xef0a('0x29')])[_0xef0a('0x11')](function(_0x3c8fda){if(_0x3c8fda){_0x10cd0e[_0xef0a('0x2b')]=_0x3c8fda['id'];logger[_0xef0a('0xf')](_0xef0a('0x2c'),_0x10cd0e[_0xef0a('0x2b')]);return _0x37e6a1(_0x10cd0e);}searchContact(_0x4388dd,_0x24837f,_0xef0a('0x2d'),_0x10cd0e[_0xef0a('0x29')])['then'](function(_0x55bbc6){if(_0x55bbc6){_0x10cd0e['endUserId']=_0x55bbc6['id'];logger[_0xef0a('0xf')](_0xef0a('0x2e'),_0x10cd0e['endUserId']);return _0x37e6a1(_0x10cd0e);}createEndUser(_0x10cd0e,_0x325d7d,_0x24837f,_0x4388dd)[_0xef0a('0x11')](function(_0x17d3c9){logger[_0xef0a('0xf')](_0xef0a('0x2f'),_0x17d3c9[_0xef0a('0x2b')]);return _0x37e6a1(_0x17d3c9);});});})['catch'](function(_0x34ae25){_0x35744b(_0x34ae25);});});};}function createEndUser(_0x4f4cb6,_0x35aba0,_0x2d8bae,_0x4a9ba4){return new Promise(function(_0x25b327,_0x4107f5){var _0x2e5661=moment();var _0xf05c9={'method':_0xef0a('0x30'),'uri':_0x4a9ba4+_0xef0a('0x31'),'body':{'contact':{'last_name':_0x4f4cb6[_0xef0a('0x29')],'work_number':_0x4f4cb6['contactNumber'],'mobile_number':_0x4f4cb6[_0xef0a('0x29')],'owner_id':_0x4f4cb6['userId'],'created_at':_0x2e5661[_0xef0a('0x27')](_0xef0a('0x32'))}},'json':!![]};_0xf05c9[_0xef0a('0xe')]=_0x2d8bae;logger[_0xef0a('0xf')](_0xef0a('0x33'));return rp(_0xf05c9)[_0xef0a('0x11')](function(_0xd8b29e){_0x4f4cb6[_0xef0a('0x2b')]=_0xd8b29e['contact']['id'];_0x25b327(_0x4f4cb6);})[_0xef0a('0x16')](function(_0x41dc66){logger[_0xef0a('0x17')]('['+[_0x35aba0['toUpperCase']()]+']',_0x41dc66[_0xef0a('0x22')]);_0x4107f5(_0x41dc66[_0xef0a('0x22')]);});});}function getTicket(_0x3a28e2,_0x3ea750,_0x4eee25,_0x45eeb5,_0x52a492){return function(_0x520a8f){logger[_0xef0a('0xf')](_0xef0a('0x34'));return new Promise(function(_0x18ea1f,_0x2c03ca){var _0x2c2e9b=moment();var _0x2bcb35={'method':_0xef0a('0x30'),'uri':_0x4eee25+_0xef0a('0x35'),'body':{'title':intUtil[_0xef0a('0x36')](_0x45eeb5[_0xef0a('0x37')],_0x52a492,'\x20'),'description':intUtil[_0xef0a('0x36')](_0x45eeb5[_0xef0a('0x38')],_0x52a492,'\x0a'),'owner_id':_0x520a8f[_0xef0a('0x1e')],'creater_id':_0x520a8f[_0xef0a('0x15')],'targetable_id':_0x520a8f[_0xef0a('0x2b')],'targetable_type':'Contact','created_at':_0x2c2e9b[_0xef0a('0x27')](_0xef0a('0x32')),'due_date':_0x2c2e9b['add'](0x1e,'m')[_0xef0a('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x2bcb35[_0xef0a('0xe')]=_0x3ea750;return rp(_0x2bcb35)[_0xef0a('0x11')](function(_0x37557a){_0x520a8f[_0xef0a('0x39')]=_0x37557a[_0xef0a('0x3a')]['id'];logger[_0xef0a('0xf')](_0xef0a('0x3b'),_0x520a8f[_0xef0a('0x39')]);_0x18ea1f(_0x520a8f);})[_0xef0a('0x16')](function(_0x3f9b21){logger[_0xef0a('0x17')]('['+[_0x3a28e2[_0xef0a('0x18')]()]+']',_0x3f9b21[_0xef0a('0x22')]);_0x2c03ca(_0x3f9b21[_0xef0a('0x22')]);});});};}function emit(_0x410532,_0x53c509,_0x2d402f){var _0x2c8199={'uri':_0x410532+_0xef0a('0x3c')+_0x2d402f};io['to'](util['format'](_0xef0a('0x3d'),_0x53c509))[_0xef0a('0x3e')](_0xef0a('0x3f'),_0x2c8199);}exports['cs']=function(_0x769e42,_0x3b6f6e,_0x58a419,_0x3596cd,_0x44736b,_0x5f320b,_0x38ce2d,_0x102388){var _0x1b487f={};var _0x3e686c={'Authorization':_0xef0a('0x40')+_0x5f320b[_0xef0a('0x41')]};_0x5f320b[_0xef0a('0x42')]=intUtil[_0xef0a('0x43')](_0x5f320b[_0xef0a('0x42')]);_0x5f320b[_0xef0a('0x44')]=intUtil[_0xef0a('0x43')](_0x5f320b[_0xef0a('0x44')]);var _0x46f5ef=_0x5f320b[_0xef0a('0x42')];_0x1b487f[_0xef0a('0x14')]=_0x5f320b[_0xef0a('0x45')];_0x1b487f[_0xef0a('0x29')]=_0x102388[_0xef0a('0x46')]()==='outbound'?_0x3b6f6e[_0xef0a('0x47')]:_0x3b6f6e[_0xef0a('0x48')];_0x1b487f[_0xef0a('0x49')]=_0x102388===_0xef0a('0x4a')||_0x102388===_0xef0a('0x4b')?'queue':'outbound';if(_0x3596cd){_0x1b487f[_0xef0a('0x1b')]=_0x3596cd[_0xef0a('0x4c')];}var _0xe0973c=util[_0xef0a('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f320b['serverUrl'],_0x3b6f6e[_0xef0a('0x4d')],md5(_0x3b6f6e[_0xef0a('0x4d')]));if(_0x44736b&&_0x44736b[_0xef0a('0x4e')]){logger[_0xef0a('0xf')]('[QUEUE]',_0xef0a('0x4f'));_0x3b6f6e['recordingURL']=_0xe0973c;}else if(_0x38ce2d&&_0x38ce2d[_0xef0a('0x50')]&&_0x38ce2d[_0xef0a('0x50')]!==_0xef0a('0x51')){logger['info'](_0xef0a('0x52'),_0xef0a('0x4f'));_0x3b6f6e[_0xef0a('0x53')]=_0xe0973c;}else{_0x3b6f6e['recordingURL']='';}return getAdminId(_0x1b487f,_0x102388,_0x3e686c,_0x46f5ef)[_0xef0a('0x11')](getUser(_0x102388,_0x3e686c,_0x46f5ef))[_0xef0a('0x11')](getEndUser(_0x102388,_0x3e686c,_0x46f5ef))[_0xef0a('0x11')](getTicket(_0x102388,_0x3e686c,_0x46f5ef,_0x58a419,_0x3b6f6e))[_0xef0a('0x11')](function(_0xdfaf80){logger[_0xef0a('0xf')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0xdfaf80[_0xef0a('0x39')]));if(_0x102388!=='unmanaged'){logger['info']('['+[_0x102388[_0xef0a('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x46f5ef,_0x3596cd[_0xef0a('0x54')],_0xdfaf80[_0xef0a('0x2b')]);}})[_0xef0a('0x16')](function(_0xd9cce9){logger['error']('['+[_0x102388[_0xef0a('0x18')]()]+_0xef0a('0x55'),util[_0xef0a('0x56')](_0xd9cce9,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index a20a563..10f22af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc726=['unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','servicenow'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc726,0xd7));var _0x6c72=function(_0x131712,_0x2ed068){_0x131712=_0x131712-0x0;var _0x292b97=_0xc726[_0x131712];return _0x292b97;};'use strict';var _=require(_0x6c72('0x0'));var util=require(_0x6c72('0x1'));var zendesk=require(_0x6c72('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x6c72('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x6c72('0x4'));var desk=require('./desk');var vtiger=require(_0x6c72('0x5'));var servicenow=require(_0x6c72('0x6'));var dynamics365=require(_0x6c72('0x7'));var freshsales=require('./freshsales');var integrations=[_0x6c72('0x8'),_0x6c72('0x9'),_0x6c72('0xa'),_0x6c72('0xb'),_0x6c72('0xc'),_0x6c72('0xd'),_0x6c72('0xe'),'dynamics365',_0x6c72('0xf'),'servicenow'];exports[_0x6c72('0x10')]=function(_0x3e35c0,_0xd726f8,_0x282d30,_0x30a67b,_0x333b4e,_0x17a878){if(_0x282d30){if(_['includes'](integrations,_0x3e35c0[_0x6c72('0x11')][_0x6c72('0x12')]())){try{var _0x4b4d65=null;var _0x381839='';var _0x5d1503=_0x282d30[_0x3e35c0[_0x6c72('0x11')]['toLowerCase']()];if(_0x5d1503){var _0x26c39a=_0x5d1503[_0x3e35c0[_0x6c72('0x13')]];if(_0x26c39a){var _0x47a1a2=_[_0x6c72('0x14')](_0x26c39a[_0x6c72('0x15')],{'id':parseInt(_0x3e35c0[_0x6c72('0x16')],0xa)});if(_0x47a1a2){if(_0x30a67b){if(_0x333b4e&&_0xd726f8['queue']){_0x381839=_0x6c72('0x17');}else if(_0xd726f8[_0x6c72('0x18')]){_0x381839=_0x6c72('0x19');}else{console[_0x6c72('0x1a')](_0x6c72('0x1b'),_0xd726f8);}}else{_0x381839=_0x6c72('0x1c');}switch(_0x3e35c0[_0x6c72('0x11')][_0x6c72('0x12')]()){case _0x6c72('0x8'):zendesk[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case _0x6c72('0x9'):salesforce[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case _0x6c72('0xa'):sugarcrm[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case _0x6c72('0xb'):freshdesk[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case _0x6c72('0xc'):zoho[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case'desk':desk[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case _0x6c72('0xe'):vtiger[_0x381839](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878);break;case _0x6c72('0xf'):freshsales['cs'](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878,_0x381839);break;case _0x6c72('0x1d'):servicenow['cs'](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878,_0x381839);break;case'dynamics365':dynamics365['cs'](_0x3e35c0,_0xd726f8,_0x47a1a2,_0x30a67b,_0x333b4e,_0x26c39a,_0x17a878,_0x381839);break;default:console[_0x6c72('0x1a')](_0x6c72('0x1e'));}}else{_0x4b4d65=require(_0x6c72('0x1f'))(_0x3e35c0[_0x6c72('0x11')][_0x6c72('0x12')]());_0x4b4d65[_0x6c72('0x20')]('[EXEC]',util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x3e35c0[_0x6c72('0x11')][_0x6c72('0x12')](),_0x3e35c0[_0x6c72('0x16')]));}}else{_0x4b4d65=require(_0x6c72('0x1f'))(_0x3e35c0[_0x6c72('0x11')][_0x6c72('0x12')]());_0x4b4d65[_0x6c72('0x20')](_0x6c72('0x21'),util['format'](_0x6c72('0x22'),_0x3e35c0[_0x6c72('0x11')][_0x6c72('0x12')](),_0x3e35c0['data2']));}}else{}}catch(_0x58183d){console[_0x6c72('0x20')](_0x58183d);}}}};
\ No newline at end of file
+var _0x4649=['vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','queue','routeId','outbound','log','zendesk','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk'];(function(_0x364450,_0x5e764a){var _0x11a3c4=function(_0x2d2e78){while(--_0x2d2e78){_0x364450['push'](_0x364450['shift']());}};_0x11a3c4(++_0x5e764a);}(_0x4649,0x135));var _0x9464=function(_0xdb26d9,_0x444344){_0xdb26d9=_0xdb26d9-0x0;var _0x48a67d=_0x4649[_0xdb26d9];return _0x48a67d;};'use strict';var _=require('lodash');var util=require(_0x9464('0x0'));var zendesk=require(_0x9464('0x1'));var salesforce=require(_0x9464('0x2'));var sugarcrm=require(_0x9464('0x3'));var freshdesk=require(_0x9464('0x4'));var zoho=require(_0x9464('0x5'));var desk=require(_0x9464('0x6'));var vtiger=require(_0x9464('0x7'));var servicenow=require(_0x9464('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x9464('0x9'));var integrations=['zendesk',_0x9464('0xa'),_0x9464('0xb'),_0x9464('0xc'),_0x9464('0xd'),_0x9464('0xe'),_0x9464('0xf'),'dynamics365',_0x9464('0x10'),_0x9464('0x11')];exports[_0x9464('0x12')]=function(_0x1ab5e8,_0x59848d,_0x3bfabf,_0xccdacf,_0x23b453,_0x24acc6){if(_0x3bfabf){if(_[_0x9464('0x13')](integrations,_0x1ab5e8[_0x9464('0x14')][_0x9464('0x15')]())){try{var _0x29ee5d=null;var _0x3bcb27='';var _0x34a39f=_0x3bfabf[_0x1ab5e8[_0x9464('0x14')]['toLowerCase']()];if(_0x34a39f){var _0x385934=_0x34a39f[_0x1ab5e8[_0x9464('0x16')]];if(_0x385934){var _0x45218d=_['find'](_0x385934[_0x9464('0x17')],{'id':parseInt(_0x1ab5e8['data3'],0xa)});if(_0x45218d){if(_0xccdacf){if(_0x23b453&&_0x59848d[_0x9464('0x18')]){_0x3bcb27=_0x9464('0x18');}else if(_0x59848d[_0x9464('0x19')]){_0x3bcb27=_0x9464('0x1a');}else{console[_0x9464('0x1b')]('EVENT\x20UNKNOWN',_0x59848d);}}else{_0x3bcb27='unmanaged';}switch(_0x1ab5e8[_0x9464('0x14')][_0x9464('0x15')]()){case _0x9464('0x1c'):zendesk[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case _0x9464('0xa'):salesforce[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case _0x9464('0xb'):sugarcrm[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case _0x9464('0xc'):freshdesk[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case'zoho':zoho[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case _0x9464('0xe'):desk[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case _0x9464('0xf'):vtiger[_0x3bcb27](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6);break;case _0x9464('0x10'):freshsales['cs'](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6,_0x3bcb27);break;case _0x9464('0x11'):servicenow['cs'](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6,_0x3bcb27);break;case'dynamics365':dynamics365['cs'](_0x1ab5e8,_0x59848d,_0x45218d,_0xccdacf,_0x23b453,_0x385934,_0x24acc6,_0x3bcb27);break;default:console['log'](_0x9464('0x1d'));}}else{_0x29ee5d=require(_0x9464('0x1e'))(_0x1ab5e8['data1'][_0x9464('0x15')]());_0x29ee5d[_0x9464('0x1f')]('[EXEC]',util[_0x9464('0x20')](_0x9464('0x21'),_0x1ab5e8[_0x9464('0x14')][_0x9464('0x15')](),_0x1ab5e8['data3']));}}else{_0x29ee5d=require(_0x9464('0x1e'))(_0x1ab5e8[_0x9464('0x14')][_0x9464('0x15')]());_0x29ee5d[_0x9464('0x1f')](_0x9464('0x22'),util[_0x9464('0x20')](_0x9464('0x23'),_0x1ab5e8[_0x9464('0x14')][_0x9464('0x15')](),_0x1ab5e8['data2']));}}else{}}catch(_0x35d2f5){console[_0x9464('0x1f')](_0x35d2f5);}}}};
\ No newline at end of file
index b4c94ff..29c808a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe693=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','uniqueid','calleridnum','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','Subjects','getString','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','info','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','account_contact_lead','additionalSearchAccount','sobject','Account','Contact','additionalSearchLead','Lead','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.','<unknown>','format','LastName','No\x20Company','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','Variable','name','password','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat'];(function(_0x24c610,_0x50dc68){var _0x14b58a=function(_0x20f0a9){while(--_0x20f0a9){_0x24c610['push'](_0x24c610['shift']());}};_0x14b58a(++_0x50dc68);}(_0xe693,0x112));var _0x3e69=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xe693[_0x230e39];return _0xa804e;};'use strict';var _=require(_0x3e69('0x0'));var rp=require(_0x3e69('0x1'));var moment=require(_0x3e69('0x2'));var BPromise=require(_0x3e69('0x3'));var md5=require(_0x3e69('0x4'));var jsforce=require(_0x3e69('0x5'));var util=require(_0x3e69('0x6'));var Redis=require(_0x3e69('0x7'));var intUtil=require(_0x3e69('0x8'));var config=require(_0x3e69('0x9'));var logger=require(_0x3e69('0xa'))(_0x3e69('0xb'));config[_0x3e69('0xc')]=_[_0x3e69('0xd')](config[_0x3e69('0xc')],{'host':_0x3e69('0xe'),'port':0x18eb});var io=require(_0x3e69('0xf'))(new Redis(config[_0x3e69('0xc')]));function emit(_0x5a463b,_0x579a17,_0x11e09e){io['to'](_0x5a463b)['emit'](_0x579a17,_0x11e09e);}function getTicket(_0x5f103e,_0x5a5e43,_0x42b786,_0x1a30c2,_0x28bad7,_0x3aa9a9,_0x48babd,_0x49774a){var _0x2287ee=Object[_0x3e69('0x10')]({},{'OwnerId':_0x5a5e43['id'],'Subject':intUtil['getString'](_0x1a30c2[_0x3e69('0x11')],_0x28bad7,'\x20'),'Description':intUtil[_0x3e69('0x12')](_0x1a30c2['Descriptions'],_0x28bad7,'\x0a')},getCustomFields(_0x3aa9a9,_0x28bad7));if(_0x42b786){if(_0x1a30c2[_0x3e69('0x13')]===_0x3e69('0x14')){_0x2287ee['ActivityDate']=moment[_0x3e69('0x15')]();_0x2287ee[_0x3e69('0x16')]=![];_0x2287ee[_0x3e69('0x17')]=![];if(_0x42b786[_0x3e69('0x18')]==='contact'||_0x42b786[_0x3e69('0x18')]===_0x3e69('0x19')){_0x2287ee[_0x3e69('0x1a')]=_0x42b786['id'];}else if(_0x42b786[_0x3e69('0x18')]===_0x3e69('0x1b')){_0x2287ee[_0x3e69('0x1c')]=_0x42b786['id'];}}else if(_0x1a30c2[_0x3e69('0x13')]===_0x3e69('0x1d')){if(_0x42b786[_0x3e69('0x18')]===_0x3e69('0x1e')){_0x2287ee[_0x3e69('0x1f')]=_0x42b786['id'];}else if(_0x42b786[_0x3e69('0x18')]===_0x3e69('0x1b')){_0x2287ee[_0x3e69('0x20')]=_0x42b786['id'];}else if(_0x42b786[_0x3e69('0x18')]===_0x3e69('0x19')&&_0x1a30c2['leadId']){_0x2287ee[_0x1a30c2[_0x3e69('0x21')]]=_0x42b786['id'];}else{logger['info'](_0x3e69('0x22'));}}}return _0x48babd['sobject'](_0x1a30c2['ticketType'])['create'](_0x2287ee);}function getUser(_0x1c08fd,_0x3dcac1,_0xe1cb38){if(!_[_0x3e69('0x23')](_0x3dcac1)&&intUtil['validateEmail'](_0x3dcac1)){var _0x3c67b6={'Email':_0x3dcac1};var _0x4fa74c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xe1cb38['sobject'](_0x3e69('0x24'))[_0x3e69('0x25')](_0x3c67b6,_0x4fa74c)[_0x3e69('0x26')]()[_0x3e69('0x27')](function(_0xf9766f){if(_0xf9766f[_0x3e69('0x28')]){var _0x24d6a6=_[_0x3e69('0x25')](_0xf9766f,function(_0x53125f){return _0x53125f[_0x3e69('0x29')]===_0x3dcac1;});if(_0x24d6a6){logger['info'](_0x3e69('0x2a'),_0x3dcac1);return BPromise[_0x3e69('0x2b')]({'id':_0x24d6a6['Id'],'name':_0x24d6a6[_0x3e69('0x2c')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3dcac1);return _0xe1cb38[_0x3e69('0x2d')]()[_0x3e69('0x27')](function(_0x5c1f17){return BPromise[_0x3e69('0x2b')]({'id':_0x5c1f17[_0x3e69('0x2e')],'name':_0x5c1f17[_0x3e69('0x2f')]});});}});}else{logger[_0x3e69('0x30')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3dcac1);return _0xe1cb38[_0x3e69('0x2d')]()[_0x3e69('0x27')](function(_0x47a1a8){return BPromise[_0x3e69('0x2b')]({'id':_0x47a1a8[_0x3e69('0x2e')],'name':_0x47a1a8[_0x3e69('0x2f')]});});}}function getEndUser(_0x5e7d08,_0x1a03f2,_0x258d82,_0x24291b,_0x35d617){var _0x515599={'$or':{'Phone':_0x24291b}};var _0xf225cf={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3e69('0x2b')]()[_0x3e69('0x27')](function(){logger[_0x3e69('0x30')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x24291b,_0x1a03f2[_0x3e69('0x31')]);switch(_0x1a03f2['moduleSearch']){case'contact_lead':var _0x31975f=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2[_0x3e69('0x33')]){var _0x405dcf={};_0x405dcf[_0x1a03f2['additionalSearchContact']]=_0x24291b;_[_0x3e69('0x34')](_0x31975f[_0x3e69('0x35')],_0x405dcf);}return _0x35d617['sobject']('Contact')['find'](_0x31975f,_0xf225cf)[_0x3e69('0x26')]()[_0x3e69('0x27')](function(_0x4c35a8){if(_0x4c35a8&&_0x4c35a8[_0x3e69('0x28')]){return _0x4c35a8;}else{var _0x324f12=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2['additionalSearchLead']){var _0x21cec9={};_0x21cec9[_0x1a03f2['additionalSearchLead']]=_0x24291b;_['merge'](_0x324f12[_0x3e69('0x35')],_0x21cec9);}return _0x35d617['sobject']('Lead')[_0x3e69('0x25')](_0x324f12,_0xf225cf);}});case _0x3e69('0x36'):var _0x5e75dd=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2['additionalSearchAccount']){var _0x405dcf={};_0x405dcf[_0x1a03f2[_0x3e69('0x37')]]=_0x24291b;_[_0x3e69('0x34')](_0x5e75dd[_0x3e69('0x35')],_0x405dcf);}return _0x35d617[_0x3e69('0x38')](_0x3e69('0x39'))[_0x3e69('0x25')](_0x5e75dd,_0xf225cf)[_0x3e69('0x26')]()['then'](function(_0x7d1dd8){if(_0x7d1dd8&&_0x7d1dd8[_0x3e69('0x28')]){return _0x7d1dd8;}else{var _0x15e621=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2['additionalSearchContact']){var _0x21dd29={};_0x21dd29[_0x1a03f2[_0x3e69('0x33')]]=_0x24291b;_['merge'](_0x15e621[_0x3e69('0x35')],_0x21dd29);}return _0x35d617[_0x3e69('0x38')](_0x3e69('0x3a'))['find'](_0x15e621,_0xf225cf)[_0x3e69('0x27')](function(_0x597859){if(_0x597859&&_0x597859['length']){return _0x597859;}else{var _0x471a7a=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2[_0x3e69('0x3b')]){var _0x338b22={};_0x338b22[_0x1a03f2[_0x3e69('0x3b')]]=_0x24291b;_['merge'](_0x471a7a[_0x3e69('0x35')],_0x338b22);}return _0x35d617['sobject'](_0x3e69('0x3c'))['find'](_0x471a7a,_0xf225cf);}});}});case _0x3e69('0x1e'):var _0x31975f=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2[_0x3e69('0x33')]){var _0x405dcf={};_0x405dcf[_0x1a03f2[_0x3e69('0x33')]]=_0x24291b;_[_0x3e69('0x34')](_0x31975f[_0x3e69('0x35')],_0x405dcf);}return _0x35d617[_0x3e69('0x38')](_0x3e69('0x3a'))['find'](_0x31975f,_0xf225cf)[_0x3e69('0x26')]();case _0x3e69('0x19'):var _0x479e2=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2[_0x3e69('0x3b')]){var _0x405dcf={};_0x405dcf[_0x1a03f2[_0x3e69('0x3b')]]=_0x24291b;_['merge'](_0x479e2[_0x3e69('0x35')],_0x405dcf);}return _0x35d617[_0x3e69('0x38')](_0x3e69('0x3c'))[_0x3e69('0x25')](_0x479e2,_0xf225cf);case _0x3e69('0x1b'):var _0x5e75dd=_[_0x3e69('0x32')](_0x515599);if(_0x1a03f2[_0x3e69('0x37')]){var _0x405dcf={};_0x405dcf[_0x1a03f2[_0x3e69('0x37')]]=_0x24291b;_['merge'](_0x5e75dd[_0x3e69('0x35')],_0x405dcf);}return _0x35d617[_0x3e69('0x38')](_0x3e69('0x39'))['find'](_0x5e75dd,_0xf225cf);default:return null;}})[_0x3e69('0x27')](function(_0x22ef83){if(_0x22ef83&&_0x22ef83[_0x3e69('0x28')]){var _0x40d289=_['first'](_0x22ef83);if(_0x40d289){return BPromise[_0x3e69('0x2b')]({'id':_0x40d289['Id'],'name':_0x40d289['Name'],'phone':_0x40d289[_0x3e69('0x3d')],'endUserType':_0x40d289[_0x3e69('0x3e')][_0x3e69('0x3f')][_0x3e69('0x40')]()});}}})[_0x3e69('0x27')](function(_0x3cbbfc){if(_0x3cbbfc){logger[_0x3e69('0x30')](_0x3e69('0x41'),_0x3cbbfc[_0x3e69('0x18')],_0x24291b);return BPromise[_0x3e69('0x2b')](_0x3cbbfc);}else{logger['info'](_0x3e69('0x42'),_0x24291b);var _0x3dcfbf={'Phone':_0x24291b};if(_0x1a03f2[_0x3e69('0x43')]){if(_0x1a03f2['moduleCreate']===_0x3e69('0x1e')){logger[_0x3e69('0x30')](_0x3e69('0x44'),_0x24291b,_0x1a03f2[_0x3e69('0x43')]);_0x3dcfbf['LastName']=_0x258d82!==_0x3e69('0x45')?_0x258d82:util[_0x3e69('0x46')]('Caller\x20-\x20%s',_0x24291b);}else if(_0x1a03f2['moduleCreate']==='lead'){logger['info'](_0x3e69('0x44'),_0x24291b,_0x1a03f2[_0x3e69('0x43')]);_0x3dcfbf[_0x3e69('0x47')]=_0x258d82!==_0x3e69('0x45')?_0x258d82:util[_0x3e69('0x46')]('Caller\x20-\x20%s',_0x24291b);_0x3dcfbf['Company']=_0x3e69('0x48');}else if(_0x1a03f2['moduleCreate']===_0x3e69('0x1b')){logger['info'](_0x3e69('0x44'),_0x24291b,_0x1a03f2[_0x3e69('0x43')]);_0x3dcfbf[_0x3e69('0x2c')]=_0x258d82!==_0x3e69('0x45')?_0x258d82:util[_0x3e69('0x46')](_0x3e69('0x49'),_0x24291b);}else{return null;}}return _0x35d617[_0x3e69('0x38')](_[_0x3e69('0x4a')](_0x1a03f2[_0x3e69('0x43')]))['create'](_0x3dcfbf)[_0x3e69('0x27')](function(_0x2ee0cd){return BPromise[_0x3e69('0x2b')]({'id':_0x2ee0cd['id'],'endUserType':_0x1a03f2[_0x3e69('0x43')]});});}});}function getCustomFields(_0x4a45bd,_0x22ba05){var _0x29ff04={};if(_0x4a45bd['length']>0x0){_[_0x3e69('0x4b')](_0x4a45bd,function(_0x9b321a){if(_[_0x3e69('0x4c')]([_0x3e69('0x4d'),_0x3e69('0x4e')],_0x9b321a[_0x3e69('0x3f')])&&_0x9b321a[_0x3e69('0x4f')]){_0x29ff04[_0x9b321a[_0x3e69('0x4f')]]=_0x9b321a[_0x3e69('0x50')][_0x3e69('0x51')]();}else if(_0x9b321a['type']==='variable'&&_0x9b321a[_0x3e69('0x52')]&&_0x9b321a[_0x3e69('0x4f')]){_0x22ba05[_0x9b321a['variableName']]&&(_0x29ff04[_0x9b321a[_0x3e69('0x4f')]]=_0x22ba05[_0x9b321a[_0x3e69('0x52')]][_0x3e69('0x51')]());}else if(_0x9b321a[_0x3e69('0x3f')]==='customVariable'&&_0x9b321a[_0x3e69('0x53')]&&_0x9b321a[_0x3e69('0x53')]['name']&&_0x9b321a[_0x3e69('0x4f')]){_0x22ba05[_0x9b321a[_0x3e69('0x53')]['name'][_0x3e69('0x40')]()]&&(_0x29ff04[_0x9b321a[_0x3e69('0x4f')]]=_0x22ba05[_0x9b321a[_0x3e69('0x53')][_0x3e69('0x54')][_0x3e69('0x40')]()][_0x3e69('0x51')]());}});}return _0x29ff04;}function getConnection(_0x3d3843){var _0x49276b=_0x3d3843[_0x3e69('0x55')]['concat'](_0x3d3843[_0x3e69('0x56')]);var _0x3fc749=new jsforce[(_0x3e69('0x57'))]({'oauth2':{'loginUrl':_0x3d3843['remoteUri']||_0x3e69('0x58'),'clientId':_0x3d3843[_0x3e69('0x59')],'clientSecret':_0x3d3843[_0x3e69('0x5a')]}});return _0x3fc749['login'](_0x3d3843[_0x3e69('0x5b')],_0x49276b)[_0x3e69('0x27')](function(){logger[_0x3e69('0x30')](_0x3e69('0x5c'));return _0x3fc749;});}exports[_0x3e69('0x5d')]=function(_0x17b19b,_0x31e28d,_0x19dc43,_0x56c606,_0x216156,_0x217cb6){var _0x4177e7,_0x51022f,_0x3463c7,_0xa81feb;_0x217cb6['serverUrl']=intUtil[_0x3e69('0x5e')](_0x217cb6['serverUrl']);_0x217cb6['remoteUri']=intUtil['stripTrailingSlash'](_0x217cb6[_0x3e69('0x5f')]);if(_0x216156&&_0x216156[_0x3e69('0x60')]){logger['info'](_0x3e69('0x61'),_0x3e69('0x62'));_0x31e28d[_0x3e69('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x217cb6[_0x3e69('0x64')],_0x31e28d['uniqueid'],md5(_0x31e28d['uniqueid']));}else{_0x31e28d[_0x3e69('0x63')]='';}return getConnection(_0x217cb6)[_0x3e69('0x27')](function(_0x2ab9c3){_0xa81feb=_0x2ab9c3;return getUser(_0x217cb6,_0x56c606['email'],_0xa81feb);})['then'](function(_0x1484b7){_0x4177e7=_0x1484b7;return getEndUser(_0x217cb6,_0x19dc43,_0x31e28d[_0x3e69('0x65')],_0x31e28d['calleridnum'],_0xa81feb);})['then'](function(_0x1b6973){_0x51022f=_0x1b6973;return getTicket(_0x217cb6,_0x4177e7,_0x51022f,_0x19dc43,_0x31e28d,_0x19dc43[_0x3e69('0x66')],_0xa81feb,_0x3e69('0x5d'));})[_0x3e69('0x27')](function(_0x4f6f0c){_0x3463c7=_0x4f6f0c;logger[_0x3e69('0x30')](_0x3e69('0x67'),_0x3463c7['id']);logger[_0x3e69('0x30')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3463c7['id'],_0x56c606[_0x3e69('0x54')],_0x217cb6['type']);switch(_0x217cb6[_0x3e69('0x3f')]){case'integrationTab':emit(util[_0x3e69('0x46')](_0x3e69('0x68'),_0x56c606[_0x3e69('0x54')]),_0x3e69('0x69'),{'recordId':_0x3463c7['id']});break;case _0x3e69('0x6a'):emit(util['format'](_0x3e69('0x68'),_0x56c606['name']),'trigger:browser:url',{'uri':util[_0x3e69('0x46')](_0x3e69('0x6b'),_0xa81feb[_0x3e69('0x6c')],_0x3463c7['id'])});break;default:logger[_0x3e69('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x3e69('0x6e')](function(_0x7056c3){logger[_0x3e69('0x6d')]('[QUEUE]',_0x7056c3);});};exports[_0x3e69('0x6f')]=function(_0x2fb113,_0xcc8b70,_0x4702be,_0x2aabc9,_0x534a6a,_0x5b3e2c,_0x32652d){var _0x40b185,_0x542e6e,_0x379430,_0x360aa7;_0x5b3e2c[_0x3e69('0x64')]=intUtil[_0x3e69('0x5e')](_0x5b3e2c['serverUrl']);_0x5b3e2c[_0x3e69('0x5f')]=intUtil[_0x3e69('0x5e')](_0x5b3e2c[_0x3e69('0x5f')]);if(_0x32652d&&_0x32652d[_0x3e69('0x70')]&&_0x32652d[_0x3e69('0x70')]!=='none'){logger[_0x3e69('0x30')]('[OUTBOUND]',_0x3e69('0x62'));_0xcc8b70[_0x3e69('0x63')]=util[_0x3e69('0x46')](_0x3e69('0x71'),_0x5b3e2c[_0x3e69('0x64')],_0xcc8b70['uniqueid'],md5(_0xcc8b70['uniqueid']));}return getConnection(_0x5b3e2c)[_0x3e69('0x27')](function(_0x3f41d0){_0x360aa7=_0x3f41d0;return getUser(_0x5b3e2c,_0x2aabc9[_0x3e69('0x72')],_0x360aa7);})['then'](function(_0x214ad3){_0x40b185=_0x214ad3;return getEndUser(_0x5b3e2c,_0x4702be,_0xcc8b70[_0x3e69('0x73')],_0xcc8b70['destcalleridnum'],_0x360aa7);})['then'](function(_0x4895b6){_0x542e6e=_0x4895b6;return getTicket(_0x5b3e2c,_0x40b185,_0x542e6e,_0x4702be,_0xcc8b70,_0x4702be['Fields'],_0x360aa7,'outbound');})['then'](function(_0xe37473){_0x379430=_0xe37473;logger[_0x3e69('0x30')](_0x3e69('0x74'),_0x379430['id']);logger[_0x3e69('0x30')](_0x3e69('0x75'),_0x379430['id'],_0x2aabc9[_0x3e69('0x54')],_0x5b3e2c[_0x3e69('0x3f')]);switch(_0x5b3e2c[_0x3e69('0x3f')]){case _0x3e69('0x76'):emit(util[_0x3e69('0x46')](_0x3e69('0x68'),_0x2aabc9[_0x3e69('0x54')]),_0x3e69('0x69'),{'recordId':_0x379430['id']});break;case _0x3e69('0x6a'):emit(util['format']('user:%s',_0x2aabc9['name']),_0x3e69('0x77'),{'uri':util['format']('%s/%s/e',_0x360aa7[_0x3e69('0x6c')],_0x379430['id'])});break;default:logger[_0x3e69('0x6d')]('[OUTBOUND]',_0x3e69('0x78'));}})[_0x3e69('0x6e')](function(_0x5239e9){logger[_0x3e69('0x6d')](_0x3e69('0x79'),_0x5239e9);});};exports[_0x3e69('0x7a')]=function(_0x3c499b,_0x1e9ffd,_0x5b4a2c,_0x467f62,_0x5e0b48,_0x218ab4){var _0x95b331,_0xfc34a8,_0x465d34,_0x2204d1;_0x218ab4['serverUrl']=intUtil[_0x3e69('0x5e')](_0x218ab4[_0x3e69('0x64')]);_0x218ab4[_0x3e69('0x5f')]=intUtil[_0x3e69('0x5e')](_0x218ab4[_0x3e69('0x5f')]);if(_0x5e0b48&&_0x5e0b48[_0x3e69('0x60')]){logger[_0x3e69('0x30')]('['+_0x1e9ffd['lastevent']['toUpperCase']()+']',_0x3e69('0x62'));_0x1e9ffd['recordingURL']=util[_0x3e69('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x218ab4[_0x3e69('0x64')],_0x1e9ffd['uniqueid'],md5(_0x1e9ffd[_0x3e69('0x7b')]));}else{_0x1e9ffd['recordingURL']='';}return getConnection(_0x218ab4)[_0x3e69('0x27')](function(_0x476e93){_0x2204d1=_0x476e93;if(!_[_0x3e69('0x23')](_0x467f62)){return getUser(_0x218ab4,_0x467f62[_0x3e69('0x54')],_0x2204d1);}else{return getUser(_0x218ab4,null,_0x2204d1);}})['then'](function(_0x5cac6f){_0x95b331=_0x5cac6f;return getEndUser(_0x218ab4,_0x5b4a2c,_0x1e9ffd['calleridname'],_0x1e9ffd[_0x3e69('0x7c')],_0x2204d1);})[_0x3e69('0x27')](function(_0x33c35b){_0xfc34a8=_0x33c35b;return getTicket(_0x218ab4,_0x95b331,_0xfc34a8,_0x5b4a2c,_0x1e9ffd,_0x5b4a2c['Fields'],_0x2204d1);})[_0x3e69('0x27')](function(_0x5bfb24){_0x465d34=_0x5bfb24;logger['info']('['+_0x1e9ffd[_0x3e69('0x7d')][_0x3e69('0x7e')]()+_0x3e69('0x7f'),_0x465d34['id']);logger[_0x3e69('0x30')]('['+_0x1e9ffd[_0x3e69('0x7d')]['toUpperCase']()+_0x3e69('0x80'),_0x218ab4[_0x3e69('0x3f')]);})[_0x3e69('0x6e')](function(_0x1b83b4){logger[_0x3e69('0x6d')]('['+_0x1e9ffd[_0x3e69('0x7d')]['toUpperCase']()+']',_0x1b83b4);});};
\ No newline at end of file
+var _0x547d=['Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','sobject','create','validateEmail','User','length','find','Email','resolve','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','execute','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','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.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','idField','content','toString','variable','variableName','Variable','name','toLowerCase','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum'];(function(_0x4f53d2,_0x373000){var _0x1587db=function(_0x4d2c4c){while(--_0x4d2c4c){_0x4f53d2['push'](_0x4f53d2['shift']());}};_0x1587db(++_0x373000);}(_0x547d,0x10c));var _0xd547=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x547d[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0xd547('0x0'));var rp=require('request-promise');var moment=require(_0xd547('0x1'));var BPromise=require(_0xd547('0x2'));var md5=require(_0xd547('0x3'));var jsforce=require('jsforce');var util=require(_0xd547('0x4'));var Redis=require(_0xd547('0x5'));var intUtil=require(_0xd547('0x6'));var config=require('../../../../config/environment');var logger=require(_0xd547('0x7'))(_0xd547('0x8'));config[_0xd547('0x9')]=_[_0xd547('0xa')](config[_0xd547('0x9')],{'host':_0xd547('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd547('0x9')]));function emit(_0x30320b,_0x4ece32,_0x32d518){io['to'](_0x30320b)[_0xd547('0xc')](_0x4ece32,_0x32d518);}function getTicket(_0x4d2817,_0x1ed5a6,_0x9f7bf4,_0x4976ab,_0x5ebb5f,_0x4efe27,_0x3acf5e,_0x18cd82){var _0x3775ab=Object[_0xd547('0xd')]({},{'OwnerId':_0x1ed5a6['id'],'Subject':intUtil[_0xd547('0xe')](_0x4976ab[_0xd547('0xf')],_0x5ebb5f,'\x20'),'Description':intUtil['getString'](_0x4976ab[_0xd547('0x10')],_0x5ebb5f,'\x0a')},getCustomFields(_0x4efe27,_0x5ebb5f));if(_0x9f7bf4){if(_0x4976ab[_0xd547('0x11')]==='Task'){_0x3775ab[_0xd547('0x12')]=moment[_0xd547('0x13')]();_0x3775ab[_0xd547('0x14')]=![];_0x3775ab[_0xd547('0x15')]=![];if(_0x9f7bf4[_0xd547('0x16')]===_0xd547('0x17')||_0x9f7bf4[_0xd547('0x16')]===_0xd547('0x18')){_0x3775ab[_0xd547('0x19')]=_0x9f7bf4['id'];}else if(_0x9f7bf4['endUserType']==='account'){_0x3775ab[_0xd547('0x1a')]=_0x9f7bf4['id'];}}else if(_0x4976ab[_0xd547('0x11')]===_0xd547('0x1b')){if(_0x9f7bf4['endUserType']===_0xd547('0x17')){_0x3775ab[_0xd547('0x1c')]=_0x9f7bf4['id'];}else if(_0x9f7bf4[_0xd547('0x16')]===_0xd547('0x1d')){_0x3775ab[_0xd547('0x1e')]=_0x9f7bf4['id'];}else if(_0x9f7bf4[_0xd547('0x16')]===_0xd547('0x18')&&_0x4976ab[_0xd547('0x1f')]){_0x3775ab[_0x4976ab[_0xd547('0x1f')]]=_0x9f7bf4['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3acf5e[_0xd547('0x20')](_0x4976ab[_0xd547('0x11')])[_0xd547('0x21')](_0x3775ab);}function getUser(_0x230dfe,_0x555d82,_0x3e1bdb){if(!_['isNil'](_0x555d82)&&intUtil[_0xd547('0x22')](_0x555d82)){var _0x448a64={'Email':_0x555d82};var _0x5c5510={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3e1bdb[_0xd547('0x20')](_0xd547('0x23'))['find'](_0x448a64,_0x5c5510)['execute']()['then'](function(_0x32ff73){if(_0x32ff73[_0xd547('0x24')]){var _0x52c8c2=_[_0xd547('0x25')](_0x32ff73,function(_0x191f72){return _0x191f72[_0xd547('0x26')]===_0x555d82;});if(_0x52c8c2){logger['info']('Agent\x20%s\x20found.',_0x555d82);return BPromise[_0xd547('0x27')]({'id':_0x52c8c2['Id'],'name':_0x52c8c2['Name']});}}else{logger[_0xd547('0x28')](_0xd547('0x29'),_0x555d82);return _0x3e1bdb[_0xd547('0x2a')]()[_0xd547('0x2b')](function(_0x5a9799){return BPromise['resolve']({'id':_0x5a9799[_0xd547('0x2c')],'name':_0x5a9799[_0xd547('0x2d')]});});}});}else{logger[_0xd547('0x28')](_0xd547('0x29'),_0x555d82);return _0x3e1bdb[_0xd547('0x2a')]()[_0xd547('0x2b')](function(_0x40dd96){return BPromise['resolve']({'id':_0x40dd96[_0xd547('0x2c')],'name':_0x40dd96[_0xd547('0x2d')]});});}}function getEndUser(_0x40bf99,_0x5766ca,_0x4c83cb,_0x518b6a,_0xbda441){var _0xc8468e={'$or':{'Phone':_0x518b6a}};var _0x23d1bb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xd547('0x2b')](function(){logger[_0xd547('0x28')](_0xd547('0x2e'),_0x518b6a,_0x5766ca[_0xd547('0x2f')]);switch(_0x5766ca[_0xd547('0x2f')]){case _0xd547('0x30'):var _0x1ac274=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x32')]){var _0x39adb6={};_0x39adb6[_0x5766ca[_0xd547('0x32')]]=_0x518b6a;_['merge'](_0x1ac274['$or'],_0x39adb6);}return _0xbda441[_0xd547('0x20')](_0xd547('0x33'))['find'](_0x1ac274,_0x23d1bb)[_0xd547('0x34')]()[_0xd547('0x2b')](function(_0x51e3f6){if(_0x51e3f6&&_0x51e3f6[_0xd547('0x24')]){return _0x51e3f6;}else{var _0xa317f6=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x35')]){var _0x9bf07={};_0x9bf07[_0x5766ca['additionalSearchLead']]=_0x518b6a;_[_0xd547('0x36')](_0xa317f6[_0xd547('0x37')],_0x9bf07);}return _0xbda441[_0xd547('0x20')](_0xd547('0x38'))[_0xd547('0x25')](_0xa317f6,_0x23d1bb);}});case _0xd547('0x39'):var _0x200aad=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x3a')]){var _0x39adb6={};_0x39adb6[_0x5766ca['additionalSearchAccount']]=_0x518b6a;_[_0xd547('0x36')](_0x200aad[_0xd547('0x37')],_0x39adb6);}return _0xbda441[_0xd547('0x20')](_0xd547('0x3b'))[_0xd547('0x25')](_0x200aad,_0x23d1bb)[_0xd547('0x34')]()[_0xd547('0x2b')](function(_0x390ee2){if(_0x390ee2&&_0x390ee2[_0xd547('0x24')]){return _0x390ee2;}else{var _0x39453a=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca['additionalSearchContact']){var _0x4bd113={};_0x4bd113[_0x5766ca[_0xd547('0x32')]]=_0x518b6a;_['merge'](_0x39453a[_0xd547('0x37')],_0x4bd113);}return _0xbda441[_0xd547('0x20')](_0xd547('0x33'))['find'](_0x39453a,_0x23d1bb)[_0xd547('0x2b')](function(_0xa7ec2f){if(_0xa7ec2f&&_0xa7ec2f[_0xd547('0x24')]){return _0xa7ec2f;}else{var _0x219a2=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x35')]){var _0x26b63a={};_0x26b63a[_0x5766ca['additionalSearchLead']]=_0x518b6a;_[_0xd547('0x36')](_0x219a2[_0xd547('0x37')],_0x26b63a);}return _0xbda441[_0xd547('0x20')](_0xd547('0x38'))[_0xd547('0x25')](_0x219a2,_0x23d1bb);}});}});case _0xd547('0x17'):var _0x1ac274=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x32')]){var _0x39adb6={};_0x39adb6[_0x5766ca[_0xd547('0x32')]]=_0x518b6a;_['merge'](_0x1ac274[_0xd547('0x37')],_0x39adb6);}return _0xbda441['sobject'](_0xd547('0x33'))['find'](_0x1ac274,_0x23d1bb)[_0xd547('0x34')]();case'lead':var _0x37cf29=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x35')]){var _0x39adb6={};_0x39adb6[_0x5766ca[_0xd547('0x35')]]=_0x518b6a;_['merge'](_0x37cf29[_0xd547('0x37')],_0x39adb6);}return _0xbda441[_0xd547('0x20')]('Lead')[_0xd547('0x25')](_0x37cf29,_0x23d1bb);case _0xd547('0x1d'):var _0x200aad=_[_0xd547('0x31')](_0xc8468e);if(_0x5766ca[_0xd547('0x3a')]){var _0x39adb6={};_0x39adb6[_0x5766ca[_0xd547('0x3a')]]=_0x518b6a;_['merge'](_0x200aad['$or'],_0x39adb6);}return _0xbda441[_0xd547('0x20')](_0xd547('0x3b'))['find'](_0x200aad,_0x23d1bb);default:return null;}})[_0xd547('0x2b')](function(_0x7a5afe){if(_0x7a5afe&&_0x7a5afe[_0xd547('0x24')]){var _0x52f8ca=_[_0xd547('0x3c')](_0x7a5afe);if(_0x52f8ca){return BPromise['resolve']({'id':_0x52f8ca['Id'],'name':_0x52f8ca[_0xd547('0x3d')],'phone':_0x52f8ca['Phone'],'endUserType':_0x52f8ca[_0xd547('0x3e')][_0xd547('0x3f')]['toLowerCase']()});}}})[_0xd547('0x2b')](function(_0x3b60d8){if(_0x3b60d8){logger[_0xd547('0x28')](_0xd547('0x40'),_0x3b60d8[_0xd547('0x16')],_0x518b6a);return BPromise[_0xd547('0x27')](_0x3b60d8);}else{logger[_0xd547('0x28')](_0xd547('0x41'),_0x518b6a);var _0x1938d9={'Phone':_0x518b6a};if(_0x5766ca[_0xd547('0x42')]){if(_0x5766ca[_0xd547('0x42')]===_0xd547('0x17')){logger['info'](_0xd547('0x43'),_0x518b6a,_0x5766ca[_0xd547('0x42')]);_0x1938d9[_0xd547('0x44')]=_0x4c83cb!==_0xd547('0x45')?_0x4c83cb:util[_0xd547('0x46')](_0xd547('0x47'),_0x518b6a);}else if(_0x5766ca['moduleCreate']===_0xd547('0x18')){logger[_0xd547('0x28')](_0xd547('0x43'),_0x518b6a,_0x5766ca[_0xd547('0x42')]);_0x1938d9[_0xd547('0x44')]=_0x4c83cb!==_0xd547('0x45')?_0x4c83cb:util[_0xd547('0x46')](_0xd547('0x47'),_0x518b6a);_0x1938d9[_0xd547('0x48')]=_0xd547('0x49');}else if(_0x5766ca[_0xd547('0x42')]===_0xd547('0x1d')){logger[_0xd547('0x28')](_0xd547('0x43'),_0x518b6a,_0x5766ca[_0xd547('0x42')]);_0x1938d9[_0xd547('0x3d')]=_0x4c83cb!==_0xd547('0x45')?_0x4c83cb:util[_0xd547('0x46')](_0xd547('0x47'),_0x518b6a);}else{return null;}}return _0xbda441[_0xd547('0x20')](_[_0xd547('0x4a')](_0x5766ca[_0xd547('0x42')]))[_0xd547('0x21')](_0x1938d9)[_0xd547('0x2b')](function(_0x148d38){return BPromise[_0xd547('0x27')]({'id':_0x148d38['id'],'endUserType':_0x5766ca[_0xd547('0x42')]});});}});}function getCustomFields(_0x2aeffb,_0x29dcc9){var _0x16dc45={};if(_0x2aeffb[_0xd547('0x24')]>0x0){_['forEach'](_0x2aeffb,function(_0x34a361){if(_['includes'](['string','picklist'],_0x34a361['type'])&&_0x34a361[_0xd547('0x4b')]){_0x16dc45[_0x34a361['idField']]=_0x34a361[_0xd547('0x4c')][_0xd547('0x4d')]();}else if(_0x34a361[_0xd547('0x3f')]===_0xd547('0x4e')&&_0x34a361[_0xd547('0x4f')]&&_0x34a361['idField']){_0x29dcc9[_0x34a361[_0xd547('0x4f')]]&&(_0x16dc45[_0x34a361[_0xd547('0x4b')]]=_0x29dcc9[_0x34a361[_0xd547('0x4f')]][_0xd547('0x4d')]());}else if(_0x34a361[_0xd547('0x3f')]==='customVariable'&&_0x34a361[_0xd547('0x50')]&&_0x34a361['Variable'][_0xd547('0x51')]&&_0x34a361[_0xd547('0x4b')]){_0x29dcc9[_0x34a361[_0xd547('0x50')][_0xd547('0x51')][_0xd547('0x52')]()]&&(_0x16dc45[_0x34a361['idField']]=_0x29dcc9[_0x34a361[_0xd547('0x50')][_0xd547('0x51')]['toLowerCase']()]['toString']());}});}return _0x16dc45;}function getConnection(_0x4a0177){var _0x91470f=_0x4a0177['password'][_0xd547('0x53')](_0x4a0177['securityToken']);var _0x47011d=new jsforce[(_0xd547('0x54'))]({'oauth2':{'loginUrl':_0x4a0177[_0xd547('0x55')]||_0xd547('0x56'),'clientId':_0x4a0177[_0xd547('0x57')],'clientSecret':_0x4a0177[_0xd547('0x58')]}});return _0x47011d[_0xd547('0x59')](_0x4a0177['username'],_0x91470f)['then'](function(){logger[_0xd547('0x28')](_0xd547('0x5a'));return _0x47011d;});}exports['queue']=function(_0x2188ef,_0x5a9cf8,_0x486939,_0x4aeb4f,_0x9ec659,_0x144340){var _0x37139e,_0x3aaaf1,_0x3d629b,_0x59dc2c;_0x144340[_0xd547('0x5b')]=intUtil[_0xd547('0x5c')](_0x144340[_0xd547('0x5b')]);_0x144340[_0xd547('0x55')]=intUtil['stripTrailingSlash'](_0x144340[_0xd547('0x55')]);if(_0x9ec659&&_0x9ec659['monitor_format']){logger[_0xd547('0x28')]('[QUEUE]',_0xd547('0x5d'));_0x5a9cf8['recordingURL']=util[_0xd547('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x144340['serverUrl'],_0x5a9cf8[_0xd547('0x5e')],md5(_0x5a9cf8[_0xd547('0x5e')]));}else{_0x5a9cf8[_0xd547('0x5f')]='';}return getConnection(_0x144340)['then'](function(_0x4dc56b){_0x59dc2c=_0x4dc56b;return getUser(_0x144340,_0x4aeb4f[_0xd547('0x60')],_0x59dc2c);})[_0xd547('0x2b')](function(_0x444f4f){_0x37139e=_0x444f4f;return getEndUser(_0x144340,_0x486939,_0x5a9cf8[_0xd547('0x61')],_0x5a9cf8[_0xd547('0x62')],_0x59dc2c);})[_0xd547('0x2b')](function(_0x90d43d){_0x3aaaf1=_0x90d43d;return getTicket(_0x144340,_0x37139e,_0x3aaaf1,_0x486939,_0x5a9cf8,_0x486939['Fields'],_0x59dc2c,_0xd547('0x63'));})[_0xd547('0x2b')](function(_0x47577e){_0x3d629b=_0x47577e;logger['info'](_0xd547('0x64'),_0x3d629b['id']);logger[_0xd547('0x28')](_0xd547('0x65'),_0x3d629b['id'],_0x4aeb4f['name'],_0x144340[_0xd547('0x3f')]);switch(_0x144340[_0xd547('0x3f')]){case'integrationTab':emit(util[_0xd547('0x46')](_0xd547('0x66'),_0x4aeb4f[_0xd547('0x51')]),_0xd547('0x67'),{'recordId':_0x3d629b['id']});break;case _0xd547('0x68'):emit(util[_0xd547('0x46')](_0xd547('0x66'),_0x4aeb4f['name']),'trigger:browser:url',{'uri':util[_0xd547('0x46')](_0xd547('0x69'),_0x59dc2c['instanceUrl'],_0x3d629b['id'])});break;default:logger[_0xd547('0x6a')](_0xd547('0x6b'));}})[_0xd547('0x6c')](function(_0x1e9a8f){logger[_0xd547('0x6a')](_0xd547('0x6d'),_0x1e9a8f);});};exports[_0xd547('0x6e')]=function(_0x554dce,_0x4f13ac,_0x1ea1b7,_0x1f3ad8,_0x440538,_0x46f6bc,_0xab691b){var _0x4905a1,_0x5ef72f,_0x3d5713,_0x108151;_0x46f6bc[_0xd547('0x5b')]=intUtil[_0xd547('0x5c')](_0x46f6bc[_0xd547('0x5b')]);_0x46f6bc[_0xd547('0x55')]=intUtil[_0xd547('0x5c')](_0x46f6bc['remoteUri']);if(_0xab691b&&_0xab691b[_0xd547('0x6f')]&&_0xab691b['recordingFormat']!==_0xd547('0x70')){logger[_0xd547('0x28')](_0xd547('0x71'),_0xd547('0x5d'));_0x4f13ac[_0xd547('0x5f')]=util[_0xd547('0x46')](_0xd547('0x72'),_0x46f6bc['serverUrl'],_0x4f13ac['uniqueid'],md5(_0x4f13ac[_0xd547('0x5e')]));}return getConnection(_0x46f6bc)['then'](function(_0x105e84){_0x108151=_0x105e84;return getUser(_0x46f6bc,_0x1f3ad8[_0xd547('0x60')],_0x108151);})[_0xd547('0x2b')](function(_0x58938b){_0x4905a1=_0x58938b;return getEndUser(_0x46f6bc,_0x1ea1b7,_0x4f13ac['destcalleridname'],_0x4f13ac[_0xd547('0x73')],_0x108151);})[_0xd547('0x2b')](function(_0x243f6e){_0x5ef72f=_0x243f6e;return getTicket(_0x46f6bc,_0x4905a1,_0x5ef72f,_0x1ea1b7,_0x4f13ac,_0x1ea1b7[_0xd547('0x74')],_0x108151,_0xd547('0x6e'));})[_0xd547('0x2b')](function(_0xe3fdad){_0x3d5713=_0xe3fdad;logger[_0xd547('0x28')](_0xd547('0x75'),_0x3d5713['id']);logger[_0xd547('0x28')](_0xd547('0x76'),_0x3d5713['id'],_0x1f3ad8['name'],_0x46f6bc[_0xd547('0x3f')]);switch(_0x46f6bc['type']){case _0xd547('0x77'):emit(util[_0xd547('0x46')](_0xd547('0x66'),_0x1f3ad8[_0xd547('0x51')]),'trigger:salesforce:display',{'recordId':_0x3d5713['id']});break;case _0xd547('0x68'):emit(util[_0xd547('0x46')](_0xd547('0x66'),_0x1f3ad8[_0xd547('0x51')]),_0xd547('0x78'),{'uri':util['format'](_0xd547('0x69'),_0x108151[_0xd547('0x79')],_0x3d5713['id'])});break;default:logger['error'](_0xd547('0x71'),_0xd547('0x7a'));}})['catch'](function(_0x360c35){logger[_0xd547('0x6a')](_0xd547('0x71'),_0x360c35);});};exports['unmanaged']=function(_0xcb70cd,_0x5cfeb1,_0x45f2ff,_0x13c02c,_0x2ed3be,_0x9cb167){var _0x46ccb5,_0xe8b710,_0x12d0c2,_0x219b18;_0x9cb167[_0xd547('0x5b')]=intUtil[_0xd547('0x5c')](_0x9cb167['serverUrl']);_0x9cb167[_0xd547('0x55')]=intUtil[_0xd547('0x5c')](_0x9cb167[_0xd547('0x55')]);if(_0x2ed3be&&_0x2ed3be['monitor_format']){logger[_0xd547('0x28')]('['+_0x5cfeb1[_0xd547('0x7b')][_0xd547('0x7c')]()+']',_0xd547('0x5d'));_0x5cfeb1[_0xd547('0x5f')]=util[_0xd547('0x46')](_0xd547('0x72'),_0x9cb167[_0xd547('0x5b')],_0x5cfeb1[_0xd547('0x5e')],md5(_0x5cfeb1['uniqueid']));}else{_0x5cfeb1['recordingURL']='';}return getConnection(_0x9cb167)[_0xd547('0x2b')](function(_0x448cb3){_0x219b18=_0x448cb3;if(!_[_0xd547('0x7d')](_0x13c02c)){return getUser(_0x9cb167,_0x13c02c[_0xd547('0x51')],_0x219b18);}else{return getUser(_0x9cb167,null,_0x219b18);}})['then'](function(_0x410a5a){_0x46ccb5=_0x410a5a;return getEndUser(_0x9cb167,_0x45f2ff,_0x5cfeb1[_0xd547('0x61')],_0x5cfeb1[_0xd547('0x62')],_0x219b18);})['then'](function(_0x262a17){_0xe8b710=_0x262a17;return getTicket(_0x9cb167,_0x46ccb5,_0xe8b710,_0x45f2ff,_0x5cfeb1,_0x45f2ff['Fields'],_0x219b18);})[_0xd547('0x2b')](function(_0x55f2a6){_0x12d0c2=_0x55f2a6;logger[_0xd547('0x28')]('['+_0x5cfeb1[_0xd547('0x7b')][_0xd547('0x7c')]()+_0xd547('0x7e'),_0x12d0c2['id']);logger[_0xd547('0x28')]('['+_0x5cfeb1['lastevent']['toUpperCase']()+_0xd547('0x7f'),_0x9cb167[_0xd547('0x3f')]);})[_0xd547('0x6c')](function(_0x43168a){logger[_0xd547('0x6a')]('['+_0x5cfeb1[_0xd547('0x7b')]['toUpperCase']()+']',_0x43168a);});};
\ No newline at end of file
index d306591..734fa1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9425=['getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','GET','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','nameField','customField','toLowerCase','content','toString','string','type','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign'];(function(_0x399486,_0x5319d4){var _0x381361=function(_0x1b90de){while(--_0x1b90de){_0x399486['push'](_0x399486['shift']());}};_0x381361(++_0x5319d4);}(_0x9425,0x1cb));var _0x5942=function(_0x4d2579,_0x4742ba){_0x4d2579=_0x4d2579-0x0;var _0x5c6f85=_0x9425[_0x4d2579];return _0x5c6f85;};'use strict';var _=require(_0x5942('0x0'));var Promise=require(_0x5942('0x1'));var rp=require('request-promise');var util=require(_0x5942('0x2'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x5942('0x3'));var config=require(_0x5942('0x4'));var logger=require(_0x5942('0x5'))(_0x5942('0x6'));config[_0x5942('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5942('0x7')]));function getAdminUser(_0x515940,_0x13a987,_0x19f06c,_0x9d7172,_0x275319,_0x25bf8a){return new Promise(function(_0x66de5c,_0x277551){var _0x4cb4ce={'method':_0x5942('0x8'),'uri':_0x9d7172+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x275319+'&'+_0x25bf8a,'auth':_0x13a987,'json':!![]};return rp(_0x4cb4ce)[_0x5942('0x9')](function(_0x1dafb6){if(_0x1dafb6[_0x5942('0xa')][_0x5942('0xb')]>0x0){_0x19f06c[_0x5942('0xc')]=_0x1dafb6[_0x5942('0xa')][0x0][_0x5942('0xd')];}logger[_0x5942('0xe')]('['+[_0x515940['toUpperCase']()]+_0x5942('0xf'),_0x19f06c);_0x66de5c(_0x19f06c);})[_0x5942('0x10')](function(_0x3d47e3){logger[_0x5942('0x11')]('['+[_0x515940[_0x5942('0x12')]()]+']',_0x3d47e3[_0x5942('0x13')]);_0x277551(_0x3d47e3['message']);});});}function getUser(_0x5eae6c,_0x20b88b,_0x411da4,_0x4c7b7d,_0xf712f0){return function(_0x80f786){logger[_0x5942('0xe')]('['+[_0x5eae6c[_0x5942('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x80f786);return new Promise(function(_0x5cb058,_0x68e6b2){if(intUtil[_0x5942('0x14')](_0x80f786['userEmail'])){var _0x39c234={'method':_0x5942('0x8'),'uri':_0x411da4+_0x5942('0x15')+_0x80f786[_0x5942('0x16')]+'&'+_0x4c7b7d+'&'+_0xf712f0,'auth':_0x20b88b,'json':!![]};logger[_0x5942('0xe')]('['+[_0x5eae6c[_0x5942('0x12')]()]+_0x5942('0x17'),_0x39c234);return rp(_0x39c234)['then'](function(_0x4834a7){logger['info']('['+[_0x5eae6c[_0x5942('0x12')]()]+'],\x20getUser\x20entity',_0x4834a7);if(_0x4834a7[_0x5942('0xa')][_0x5942('0xb')]>0x0&&String(_0x4834a7[_0x5942('0xa')][0x0][_0x5942('0x18')])===_0x5942('0x19')){_0x80f786[_0x5942('0x1a')]=_0x4834a7['result'][0x0][_0x5942('0xd')];}else{_0x80f786[_0x5942('0x1a')]=_0x80f786[_0x5942('0xc')];_0x80f786[_0x5942('0x16')]=_0x80f786[_0x5942('0x1b')];}logger[_0x5942('0xe')]('['+[_0x5eae6c[_0x5942('0x12')]()]+_0x5942('0x1c'),_0x80f786);_0x5cb058(_0x80f786);})[_0x5942('0x10')](function(_0x5dd2c5){logger[_0x5942('0x11')]('['+[_0x5eae6c[_0x5942('0x12')]()]+']',_0x5dd2c5['message']);_0x68e6b2(_0x5dd2c5[_0x5942('0x13')]);});}else{logger[_0x5942('0xe')]('['+[_0x5eae6c[_0x5942('0x12')]()]+_0x5942('0x1d'));_0x80f786[_0x5942('0x1a')]=_0x80f786[_0x5942('0xc')];_0x80f786['userEmail']=_0x80f786['adminEmail'];_0x5cb058(_0x80f786);}});};}function createEndUser(_0x522a38,_0x50fc15,_0x47605f,_0x4cef5f,_0x54711a){logger[_0x5942('0xe')]('['+[_0x522a38[_0x5942('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x47605f);return new Promise(function(_0x53b52d,_0x328bd0){var _0x2b3d52={'method':_0x5942('0x1e'),'uri':_0x4cef5f+'sys_user?'+_0x54711a,'body':{'user_name':_0x47605f[_0x5942('0x1f')],'roles':_0x5942('0x20'),'first_name':_0x47605f[_0x5942('0x1f')],'active':_0x5942('0x19'),'date_format':'System','phone':_0x47605f[_0x5942('0x1f')]},'auth':_0x50fc15,'json':!![]};return rp(_0x2b3d52)[_0x5942('0x9')](function(_0x5ba792){logger[_0x5942('0xe')]('['+[_0x522a38['toUpperCase']()]+_0x5942('0x21'),_0x5ba792[_0x5942('0xa')]);_0x47605f[_0x5942('0x22')]=_0x5ba792[_0x5942('0xa')][_0x5942('0xd')];_0x53b52d(_0x47605f);})[_0x5942('0x10')](function(_0x1dc48e){logger[_0x5942('0x11')]('['+[_0x522a38[_0x5942('0x12')]()]+']',_0x1dc48e['message']);_0x328bd0(_0x1dc48e['message']);});});}function getEndUser(_0x55ecfc,_0x10d5db,_0x4cbbb7,_0x4f2cdf,_0x2bf250){return function(_0x57b008){logger[_0x5942('0xe')]('['+[_0x55ecfc[_0x5942('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x57b008);return new Promise(function(_0x1652ce,_0xa0f8b3){var _0x12fc94={'method':_0x5942('0x8'),'uri':_0x4cbbb7+_0x5942('0x23')+_0x57b008[_0x5942('0x1f')]+'&'+_0x4f2cdf+'&'+_0x2bf250,'auth':_0x10d5db,'json':!![]};return rp(_0x12fc94)['then'](function(_0x1553a2){if(_0x1553a2[_0x5942('0xa')][_0x5942('0xb')]>0x0){_0x57b008[_0x5942('0x22')]=_0x1553a2[_0x5942('0xa')][0x0][_0x5942('0xd')];logger[_0x5942('0xe')]('['+[_0x55ecfc[_0x5942('0x12')]()]+_0x5942('0x24'),_0x57b008);_0x1652ce(_0x57b008);}else{return createEndUser(_0x55ecfc,_0x10d5db,_0x57b008,_0x4cbbb7,_0x4f2cdf)[_0x5942('0x9')](function(_0xce3ee3){logger[_0x5942('0xe')]('['+[_0x55ecfc['toUpperCase']()]+_0x5942('0x25'),_0xce3ee3);_0x1652ce(_0xce3ee3);});}})[_0x5942('0x10')](function(_0x225c9c){logger[_0x5942('0x11')]('['+[_0x55ecfc['toUpperCase']()]+']',_0x225c9c[_0x5942('0x13')]);_0xa0f8b3(_0x225c9c['message']);});});};}function getCustomFields(_0x5477e1,_0x1658af){var _0x4c6c77={};if(_0x5477e1['length']>0x0){_[_0x5942('0x26')](_0x5477e1,function(_0x52f981){if(_[_0x5942('0x27')](['string',_0x5942('0x28')],_0x52f981['type'])&&_0x52f981[_0x5942('0x29')]&&!_0x52f981[_0x5942('0x2a')]){_0x4c6c77[_0x52f981[_0x5942('0x29')][_0x5942('0x2b')]()]=_0x52f981[_0x5942('0x2c')][_0x5942('0x2d')]();}else if(_[_0x5942('0x27')]([_0x5942('0x2e'),_0x5942('0x28')],_0x52f981[_0x5942('0x2f')])&&_0x52f981[_0x5942('0x30')]&&_0x52f981[_0x5942('0x2a')]){_0x4c6c77[_0x52f981['idField'][_0x5942('0x2b')]()]=_0x52f981[_0x5942('0x2c')][_0x5942('0x2d')]();}else if(_0x52f981[_0x5942('0x2f')]===_0x5942('0x31')&&_0x52f981[_0x5942('0x32')]&&_0x52f981[_0x5942('0x30')]&&_0x52f981['customField']){_0x4c6c77[_0x52f981[_0x5942('0x30')][_0x5942('0x2b')]()]=_0x1658af[_0x52f981['variableName']][_0x5942('0x2d')]();}else if(_0x52f981[_0x5942('0x2f')]==='customVariable'&&_0x52f981['Variable']&&_0x52f981[_0x5942('0x33')][_0x5942('0x34')]&&_0x52f981[_0x5942('0x30')]&&_0x52f981[_0x5942('0x2a')]){_0x4c6c77[_0x52f981[_0x5942('0x30')][_0x5942('0x2b')]()]=_0x1658af[_0x52f981[_0x5942('0x33')][_0x5942('0x34')][_0x5942('0x2b')]()]['toString']();}});}return _0x4c6c77;}function getTicket(_0x17be86,_0x5901e0,_0x1a8887,_0x2263af,_0x413c1b,_0x3ecb6e){return function(_0x33a5f9){logger[_0x5942('0xe')]('['+[_0x17be86['toUpperCase']()]+_0x5942('0x35'),_0x33a5f9);return new Promise(function(_0x2de171,_0x4fd806){var _0x5a069f=_0x17be86[_0x5942('0x2b')]()==='outbound'?_0x33a5f9[_0x5942('0x1a')]:_0x33a5f9[_0x5942('0x22')];var _0x29e416={'method':'POST','uri':_0x1a8887+_0x5942('0x36')+'?'+_0x3ecb6e,'body':Object[_0x5942('0x37')]({},{'active':'true','caller_id':_0x5a069f,'assigned_to':_0x33a5f9[_0x5942('0x1a')],'short_description':intUtil[_0x5942('0x38')](_0x2263af[_0x5942('0x39')],_0x413c1b,'\x20'),'description':intUtil[_0x5942('0x38')](_0x2263af[_0x5942('0x3a')],_0x413c1b,'\x0a')},getCustomFields(_0x2263af[_0x5942('0x3b')],_0x413c1b)),'auth':_0x5901e0,'json':!![]};return rp(_0x29e416)[_0x5942('0x9')](function(_0x3faeff){logger[_0x5942('0xe')]('['+[_0x17be86[_0x5942('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x3faeff['result']);_0x33a5f9[_0x5942('0x3c')]=_0x3faeff[_0x5942('0xa')]['sys_id'];_0x33a5f9[_0x5942('0x3d')]=_0x3faeff[_0x5942('0xa')][_0x5942('0x3e')];logger['info']('['+[_0x17be86[_0x5942('0x12')]()]+']\x20getTicket\x20crm',_0x33a5f9);_0x2de171(_0x33a5f9);})[_0x5942('0x10')](function(_0x504322){logger[_0x5942('0x11')]('['+[_0x17be86[_0x5942('0x12')]()]+']',_0x504322[_0x5942('0x13')]);_0x4fd806(_0x504322[_0x5942('0x13')]);});});};}function createRemoteTag(_0x4840f8,_0x3ee7f5,_0x3e5531,_0x5b85a7){return new Promise(function(_0x19dff2,_0x5b4efb){var _0x226ad8={'method':_0x5942('0x1e'),'uri':_0x3e5531+_0x5942('0x3f')+'?'+_0x5b85a7,'body':{'short_description':_0x4840f8,'global':!![],'active':!![],'name':_0x4840f8},'auth':_0x3ee7f5,'json':!![]};return rp(_0x226ad8)[_0x5942('0x9')](function(_0xd61ea){var _0x569ec5=_0xd61ea[_0x5942('0xa')][_0x5942('0xd')];_0x19dff2(_0x569ec5);});});}function getRemoteTag(_0x46eaad,_0x39b4ee,_0x29b985,_0x45ed5f,_0x2cf3d3){return new Promise(function(_0x1a0328,_0x1ec400){var _0x384022={'method':_0x5942('0x8'),'uri':_0x29b985+'label'+_0x5942('0x40')+_0x46eaad+'&'+_0x45ed5f,'auth':_0x39b4ee,'json':!![]};return rp(_0x384022)['then'](function(_0x5abf93){if(_0x5abf93[_0x5942('0xa')][_0x5942('0xb')]>0x0){var _0x39d140=_0x5abf93['result'][0x0][_0x5942('0xd')];_0x1a0328(_0x39d140);}else{return createRemoteTag(_0x46eaad,_0x39b4ee,_0x29b985,_0x45ed5f)['then'](function(_0x155768){_0x1a0328(_0x155768);});}});});}function assignTagToIncident(_0x2c5a1f,_0x57aec3,_0xe03caa,_0x3e2bb9,_0x2c3d3e){return new Promise(function(_0x1de0b4,_0x1d2e30){var _0x1f4c8f={'method':'POST','uri':_0xe03caa+_0x5942('0x41')+'?'+_0x2c3d3e,'body':{'label':_0x2c5a1f,'table':_0x5942('0x36'),'id_type':_0x5942('0x42'),'table_key':_0x3e2bb9[_0x5942('0x3c')],'title':_0x5942('0x43')+_0x3e2bb9['ticketNumber'],'id_display':_0x3e2bb9[_0x5942('0x3d')]},'auth':_0x57aec3,'json':!![]};return rp(_0x1f4c8f)[_0x5942('0x9')](function(_0x1a2012){_0x1de0b4();})[_0x5942('0x10')](function(){_0x1de0b4();});});}function manageTags(_0x1f6779,_0x30f5c2,_0x51b1a2,_0x538120,_0x49a68c,_0x2c7f2a,_0x3f5ddb){return new Promise(function(_0x32c972,_0x5a15f5){var _0x2a221c=[];_0x30f5c2[_0x5942('0x26')](function(_0x4ecd61){_0x2a221c[_0x5942('0x44')](getRemoteTag(_0x4ecd61,_0x51b1a2,_0x538120,_0x2c7f2a,_0x3f5ddb));});return Promise[_0x5942('0x45')](_0x2a221c)['then'](function(_0x2ec67b){if(_0x2ec67b['length']){logger[_0x5942('0xe')]('['+[_0x1f6779[_0x5942('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2ec67b);var _0x67e1d8=[];_0x2ec67b[_0x5942('0x26')](function(_0x5c6ca0){_0x67e1d8['push'](assignTagToIncident(_0x5c6ca0,_0x51b1a2,_0x538120,_0x49a68c,_0x2c7f2a));});return Promise['all'](_0x67e1d8)['then'](function(){_0x32c972();})[_0x5942('0x10')](function(){_0x32c972();});}else{_0x32c972();}});});}function getTags(_0x33a91d,_0x2ed1d4,_0x47acd4,_0x3a2514,_0x6b07a,_0x582872){return function(_0x4cd899){return new Promise(function(_0x56bfe3,_0x165f75){var _0x3d896b=[];var _0x50cfc3=_0x3a2514[_0x5942('0x46')];if(_0x50cfc3&&_0x50cfc3[_0x5942('0xb')]>0x0){_0x3d896b=_['map'](_0x50cfc3,_0x5942('0x34'));}if(_0x3d896b[_0x5942('0xb')]>0x0){return manageTags(_0x33a91d,_0x3d896b,_0x2ed1d4,_0x47acd4,_0x4cd899,_0x6b07a,_0x582872)[_0x5942('0x9')](function(){_0x56bfe3(_0x4cd899);});}else{_0x56bfe3(_0x4cd899);}});};}function emit(_0x252c78,_0x562a6b,_0x4a4fa2){var _0xda1bc9='%26sysparm_record_target%3Dincident'+_0x5942('0x47')+_0x5942('0x48')+_0x5942('0x49');var _0x20962a={'uri':_0x252c78+_0x5942('0x4a')+_0x4a4fa2+_0xda1bc9};io['to'](util[_0x5942('0x4b')](_0x5942('0x4c'),_0x562a6b))[_0x5942('0x4d')](_0x5942('0x4e'),_0x20962a);}exports['cs']=function(_0x548fb8,_0x1aa461,_0x3d9938,_0x226b3b,_0x54ed21,_0x3c82a7,_0x729aec,_0x405c18){var _0x247911={};var _0x4b8932={'user':_0x3c82a7['username'],'pass':_0x3c82a7[_0x5942('0x4f')]};var _0xe9ee1e=_0x5942('0x50');var _0x4282eb=_0x5942('0x51');_0x3c82a7[_0x5942('0x52')]=intUtil[_0x5942('0x53')](_0x3c82a7[_0x5942('0x52')]);_0x3c82a7[_0x5942('0x54')]=intUtil[_0x5942('0x53')](_0x3c82a7[_0x5942('0x54')]);var _0x425e8e=util[_0x5942('0x4b')](_0x5942('0x55'),_0x3c82a7['remoteUri']);_0x247911[_0x5942('0x16')]=!_[_0x5942('0x56')](_0x226b3b)?_0x226b3b['email']:null;_0x247911[_0x5942('0x1b')]=_0x3c82a7[_0x5942('0x57')];_0x247911[_0x5942('0x1f')]=_0x405c18[_0x5942('0x2b')]()===_0x5942('0x58')?_0x1aa461['destcalleridnum']:_0x1aa461['calleridnum'];_0x247911[_0x5942('0x59')]=_0x405c18==='queue'||_0x405c18==='unmanaged'?_0x5942('0x5a'):_0x5942('0x58');var _0x53ed8b=util[_0x5942('0x4b')](_0x5942('0x5b'),_0x3c82a7[_0x5942('0x54')],_0x1aa461[_0x5942('0x5c')],md5(_0x1aa461[_0x5942('0x5c')]));if(_0x54ed21&&_0x54ed21[_0x5942('0x5d')]){logger[_0x5942('0xe')](_0x5942('0x5e'),_0x5942('0x5f'));_0x1aa461[_0x5942('0x60')]=_0x53ed8b;}else if(_0x729aec&&_0x729aec[_0x5942('0x61')]&&_0x729aec[_0x5942('0x61')]!==_0x5942('0x62')){logger[_0x5942('0xe')](_0x5942('0x63'),_0x5942('0x5f'));_0x1aa461[_0x5942('0x60')]=_0x53ed8b;}else{_0x1aa461[_0x5942('0x60')]='';}return getAdminUser(_0x405c18,_0x4b8932,_0x247911,_0x425e8e,_0x4282eb,_0xe9ee1e)['then'](getUser(_0x405c18,_0x4b8932,_0x425e8e,_0x4282eb,_0xe9ee1e))[_0x5942('0x9')](getEndUser(_0x405c18,_0x4b8932,_0x425e8e,_0x4282eb,_0xe9ee1e))[_0x5942('0x9')](getTicket(_0x405c18,_0x4b8932,_0x425e8e,_0x3d9938,_0x1aa461,_0x4282eb))[_0x5942('0x9')](function(_0x4e419b){logger[_0x5942('0xe')](util[_0x5942('0x4b')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4e419b[_0x5942('0x3c')]));logger[_0x5942('0xe')](util[_0x5942('0x4b')](_0x5942('0x64'),_0x405c18));if(_0x405c18!=='unmanaged'){logger[_0x5942('0xe')]('['+[_0x405c18['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3c82a7[_0x5942('0x52')],_0x226b3b[_0x5942('0x34')],_0x4e419b[_0x5942('0x3c')]);}})[_0x5942('0x10')](function(_0x373f68){logger['error']('['+[_0x405c18[_0x5942('0x12')]()]+_0x5942('0x65'),util[_0x5942('0x66')](_0x373f68,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x45f9=['userEmail','GET','sys_user?sysparm_query=email%3D','active','userId','],\x20getUser\x20crm','catch','error','message',']\x20using\x20admin\x20profile','adminEmail','POST','sys_user?','endUserNumber','user','true','System','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','content','toString','picklist','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail'];(function(_0x25c796,_0x4d0100){var _0x7a4fea=function(_0x518ebe){while(--_0x518ebe){_0x25c796['push'](_0x25c796['shift']());}};_0x7a4fea(++_0x4d0100);}(_0x45f9,0x1a6));var _0x945f=function(_0x40c0f4,_0x60aa5d){_0x40c0f4=_0x40c0f4-0x0;var _0x4ecdaf=_0x45f9[_0x40c0f4];return _0x4ecdaf;};'use strict';var _=require(_0x945f('0x0'));var Promise=require(_0x945f('0x1'));var rp=require(_0x945f('0x2'));var util=require(_0x945f('0x3'));var md5=require(_0x945f('0x4'));var Redis=require('ioredis');var intUtil=require(_0x945f('0x5'));var config=require(_0x945f('0x6'));var logger=require(_0x945f('0x7'))(_0x945f('0x8'));config[_0x945f('0x9')]=_[_0x945f('0xa')](config['redis'],{'host':_0x945f('0xb'),'port':0x18eb});var io=require(_0x945f('0xc'))(new Redis(config[_0x945f('0x9')]));function getAdminUser(_0x5e84d6,_0x4f5207,_0x415d30,_0x551410,_0x4b4737,_0x584cdb){return new Promise(function(_0x2e6058,_0x11c8d7){var _0x458d80={'method':'GET','uri':_0x551410+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x4b4737+'&'+_0x584cdb,'auth':_0x4f5207,'json':!![]};return rp(_0x458d80)[_0x945f('0xd')](function(_0x202469){if(_0x202469[_0x945f('0xe')][_0x945f('0xf')]>0x0){_0x415d30[_0x945f('0x10')]=_0x202469[_0x945f('0xe')][0x0][_0x945f('0x11')];}logger[_0x945f('0x12')]('['+[_0x5e84d6[_0x945f('0x13')]()]+'],\x20getAdminUser\x20crm',_0x415d30);_0x2e6058(_0x415d30);})['catch'](function(_0x3791d5){logger['error']('['+[_0x5e84d6[_0x945f('0x13')]()]+']',_0x3791d5['message']);_0x11c8d7(_0x3791d5['message']);});});}function getUser(_0x48cef5,_0x2c4334,_0x99f70c,_0x461c65,_0x225003){return function(_0x14f3b8){logger['info']('['+[_0x48cef5['toUpperCase']()]+_0x945f('0x14'),_0x14f3b8);return new Promise(function(_0x5d6b15,_0x292de7){if(intUtil[_0x945f('0x15')](_0x14f3b8[_0x945f('0x16')])){var _0x2800a1={'method':_0x945f('0x17'),'uri':_0x99f70c+_0x945f('0x18')+_0x14f3b8['userEmail']+'&'+_0x461c65+'&'+_0x225003,'auth':_0x2c4334,'json':!![]};logger['info']('['+[_0x48cef5['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x2800a1);return rp(_0x2800a1)[_0x945f('0xd')](function(_0x25df33){logger[_0x945f('0x12')]('['+[_0x48cef5[_0x945f('0x13')]()]+'],\x20getUser\x20entity',_0x25df33);if(_0x25df33['result'][_0x945f('0xf')]>0x0&&String(_0x25df33[_0x945f('0xe')][0x0][_0x945f('0x19')])==='true'){_0x14f3b8[_0x945f('0x1a')]=_0x25df33[_0x945f('0xe')][0x0][_0x945f('0x11')];}else{_0x14f3b8[_0x945f('0x1a')]=_0x14f3b8[_0x945f('0x10')];_0x14f3b8['userEmail']=_0x14f3b8['adminEmail'];}logger[_0x945f('0x12')]('['+[_0x48cef5[_0x945f('0x13')]()]+_0x945f('0x1b'),_0x14f3b8);_0x5d6b15(_0x14f3b8);})[_0x945f('0x1c')](function(_0x3326c){logger[_0x945f('0x1d')]('['+[_0x48cef5[_0x945f('0x13')]()]+']',_0x3326c[_0x945f('0x1e')]);_0x292de7(_0x3326c[_0x945f('0x1e')]);});}else{logger[_0x945f('0x12')]('['+[_0x48cef5[_0x945f('0x13')]()]+_0x945f('0x1f'));_0x14f3b8['userId']=_0x14f3b8['adminId'];_0x14f3b8[_0x945f('0x16')]=_0x14f3b8[_0x945f('0x20')];_0x5d6b15(_0x14f3b8);}});};}function createEndUser(_0x45bff2,_0x57375e,_0x2976de,_0x42d216,_0x7427e1){logger[_0x945f('0x12')]('['+[_0x45bff2[_0x945f('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x2976de);return new Promise(function(_0x4b73c7,_0x9caf75){var _0x524321={'method':_0x945f('0x21'),'uri':_0x42d216+_0x945f('0x22')+_0x7427e1,'body':{'user_name':_0x2976de[_0x945f('0x23')],'roles':_0x945f('0x24'),'first_name':_0x2976de['endUserNumber'],'active':_0x945f('0x25'),'date_format':_0x945f('0x26'),'phone':_0x2976de[_0x945f('0x23')]},'auth':_0x57375e,'json':!![]};return rp(_0x524321)['then'](function(_0x4c16dc){logger[_0x945f('0x12')]('['+[_0x45bff2[_0x945f('0x13')]()]+'],\x20EndUser\x20schema',_0x4c16dc[_0x945f('0xe')]);_0x2976de['endUserId']=_0x4c16dc[_0x945f('0xe')][_0x945f('0x11')];_0x4b73c7(_0x2976de);})[_0x945f('0x1c')](function(_0x23c3d0){logger['error']('['+[_0x45bff2[_0x945f('0x13')]()]+']',_0x23c3d0[_0x945f('0x1e')]);_0x9caf75(_0x23c3d0[_0x945f('0x1e')]);});});}function getEndUser(_0x270987,_0x2b4022,_0x581d1d,_0x6ba543,_0x583928){return function(_0x130922){logger[_0x945f('0x12')]('['+[_0x270987[_0x945f('0x13')]()]+_0x945f('0x27'),_0x130922);return new Promise(function(_0x555811,_0x42b1cc){var _0x4bcbeb={'method':_0x945f('0x17'),'uri':_0x581d1d+_0x945f('0x28')+_0x130922[_0x945f('0x23')]+'&'+_0x6ba543+'&'+_0x583928,'auth':_0x2b4022,'json':!![]};return rp(_0x4bcbeb)[_0x945f('0xd')](function(_0x4a06f7){if(_0x4a06f7[_0x945f('0xe')][_0x945f('0xf')]>0x0){_0x130922[_0x945f('0x29')]=_0x4a06f7[_0x945f('0xe')][0x0][_0x945f('0x11')];logger[_0x945f('0x12')]('['+[_0x270987[_0x945f('0x13')]()]+_0x945f('0x2a'),_0x130922);_0x555811(_0x130922);}else{return createEndUser(_0x270987,_0x2b4022,_0x130922,_0x581d1d,_0x6ba543)['then'](function(_0x4fd3c5){logger['info']('['+[_0x270987[_0x945f('0x13')]()]+_0x945f('0x2b'),_0x4fd3c5);_0x555811(_0x4fd3c5);});}})[_0x945f('0x1c')](function(_0x2b5fc2){logger[_0x945f('0x1d')]('['+[_0x270987[_0x945f('0x13')]()]+']',_0x2b5fc2[_0x945f('0x1e')]);_0x42b1cc(_0x2b5fc2['message']);});});};}function getCustomFields(_0x160284,_0xf4562){var _0x40ccb8={};if(_0x160284[_0x945f('0xf')]>0x0){_[_0x945f('0x2c')](_0x160284,function(_0x5d3ddd){if(_[_0x945f('0x2d')]([_0x945f('0x2e'),'picklist'],_0x5d3ddd[_0x945f('0x2f')])&&_0x5d3ddd[_0x945f('0x30')]&&!_0x5d3ddd[_0x945f('0x31')]){_0x40ccb8[_0x5d3ddd[_0x945f('0x30')]['toLowerCase']()]=_0x5d3ddd[_0x945f('0x32')][_0x945f('0x33')]();}else if(_['includes']([_0x945f('0x2e'),_0x945f('0x34')],_0x5d3ddd['type'])&&_0x5d3ddd['idField']&&_0x5d3ddd[_0x945f('0x31')]){_0x40ccb8[_0x5d3ddd[_0x945f('0x35')][_0x945f('0x36')]()]=_0x5d3ddd[_0x945f('0x32')]['toString']();}else if(_0x5d3ddd['type']===_0x945f('0x37')&&_0x5d3ddd[_0x945f('0x38')]&&_0x5d3ddd['idField']&&_0x5d3ddd['customField']){_0x40ccb8[_0x5d3ddd[_0x945f('0x35')]['toLowerCase']()]=_0xf4562[_0x5d3ddd[_0x945f('0x38')]]['toString']();}else if(_0x5d3ddd[_0x945f('0x2f')]===_0x945f('0x39')&&_0x5d3ddd[_0x945f('0x3a')]&&_0x5d3ddd[_0x945f('0x3a')][_0x945f('0x3b')]&&_0x5d3ddd['idField']&&_0x5d3ddd[_0x945f('0x31')]){_0x40ccb8[_0x5d3ddd[_0x945f('0x35')]['toLowerCase']()]=_0xf4562[_0x5d3ddd[_0x945f('0x3a')]['name'][_0x945f('0x36')]()][_0x945f('0x33')]();}});}return _0x40ccb8;}function getTicket(_0x1d7421,_0xabbd78,_0x52437a,_0x2f9c00,_0x216b5d,_0x2fd920){return function(_0x308dbe){logger[_0x945f('0x12')]('['+[_0x1d7421[_0x945f('0x13')]()]+_0x945f('0x3c'),_0x308dbe);return new Promise(function(_0x27e8b8,_0x439c80){var _0x6de5aa=_0x1d7421[_0x945f('0x36')]()===_0x945f('0x3d')?_0x308dbe['userId']:_0x308dbe[_0x945f('0x29')];var _0x319c1d={'method':_0x945f('0x21'),'uri':_0x52437a+_0x945f('0x3e')+'?'+_0x2fd920,'body':Object[_0x945f('0x3f')]({},{'active':_0x945f('0x25'),'caller_id':_0x6de5aa,'assigned_to':_0x308dbe[_0x945f('0x1a')],'short_description':intUtil[_0x945f('0x40')](_0x2f9c00['Subjects'],_0x216b5d,'\x20'),'description':intUtil[_0x945f('0x40')](_0x2f9c00[_0x945f('0x41')],_0x216b5d,'\x0a')},getCustomFields(_0x2f9c00[_0x945f('0x42')],_0x216b5d)),'auth':_0xabbd78,'json':!![]};return rp(_0x319c1d)['then'](function(_0x2013c6){logger['info']('['+[_0x1d7421['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x2013c6[_0x945f('0xe')]);_0x308dbe['ticketId']=_0x2013c6[_0x945f('0xe')]['sys_id'];_0x308dbe[_0x945f('0x43')]=_0x2013c6['result'][_0x945f('0x44')];logger['info']('['+[_0x1d7421[_0x945f('0x13')]()]+_0x945f('0x45'),_0x308dbe);_0x27e8b8(_0x308dbe);})[_0x945f('0x1c')](function(_0x4b9b56){logger[_0x945f('0x1d')]('['+[_0x1d7421[_0x945f('0x13')]()]+']',_0x4b9b56['message']);_0x439c80(_0x4b9b56['message']);});});};}function createRemoteTag(_0x242858,_0x55cca6,_0x501a9e,_0x2ab3e5){return new Promise(function(_0x51c74b,_0x5e7e0f){var _0x538808={'method':_0x945f('0x21'),'uri':_0x501a9e+_0x945f('0x46')+'?'+_0x2ab3e5,'body':{'short_description':_0x242858,'global':!![],'active':!![],'name':_0x242858},'auth':_0x55cca6,'json':!![]};return rp(_0x538808)[_0x945f('0xd')](function(_0x4edc7b){var _0x235c11=_0x4edc7b[_0x945f('0xe')]['sys_id'];_0x51c74b(_0x235c11);});});}function getRemoteTag(_0x50fb33,_0x5cfdca,_0x425fbd,_0x338410,_0x4b0ce4){return new Promise(function(_0x55d1ee,_0x51f15d){var _0xebc4c={'method':_0x945f('0x17'),'uri':_0x425fbd+'label'+_0x945f('0x47')+_0x50fb33+'&'+_0x338410,'auth':_0x5cfdca,'json':!![]};return rp(_0xebc4c)[_0x945f('0xd')](function(_0x110a0b){if(_0x110a0b[_0x945f('0xe')][_0x945f('0xf')]>0x0){var _0x2f48eb=_0x110a0b[_0x945f('0xe')][0x0]['sys_id'];_0x55d1ee(_0x2f48eb);}else{return createRemoteTag(_0x50fb33,_0x5cfdca,_0x425fbd,_0x338410)[_0x945f('0xd')](function(_0x53b655){_0x55d1ee(_0x53b655);});}});});}function assignTagToIncident(_0x495000,_0x4eee81,_0x4a774f,_0x2cb7b,_0x2d8235){return new Promise(function(_0x271619,_0x3e57eb){var _0x52e7cf={'method':_0x945f('0x21'),'uri':_0x4a774f+'label_entry'+'?'+_0x2d8235,'body':{'label':_0x495000,'table':_0x945f('0x3e'),'id_type':_0x945f('0x48'),'table_key':_0x2cb7b['ticketId'],'title':_0x945f('0x49')+_0x2cb7b[_0x945f('0x43')],'id_display':_0x2cb7b[_0x945f('0x43')]},'auth':_0x4eee81,'json':!![]};return rp(_0x52e7cf)[_0x945f('0xd')](function(_0x193207){_0x271619();})[_0x945f('0x1c')](function(){_0x271619();});});}function manageTags(_0x14cf5d,_0x42198b,_0x9c989d,_0x4c3dce,_0x46eb65,_0x4be365,_0x4cc1a8){return new Promise(function(_0x3bb476,_0x42ec50){var _0x14b262=[];_0x42198b[_0x945f('0x2c')](function(_0x30005d){_0x14b262[_0x945f('0x4a')](getRemoteTag(_0x30005d,_0x9c989d,_0x4c3dce,_0x4be365,_0x4cc1a8));});return Promise[_0x945f('0x4b')](_0x14b262)[_0x945f('0xd')](function(_0x3dea39){if(_0x3dea39[_0x945f('0xf')]){logger['info']('['+[_0x14cf5d[_0x945f('0x13')]()]+_0x945f('0x4c'),_0x3dea39);var _0xb168eb=[];_0x3dea39[_0x945f('0x2c')](function(_0xcdb5f){_0xb168eb[_0x945f('0x4a')](assignTagToIncident(_0xcdb5f,_0x9c989d,_0x4c3dce,_0x46eb65,_0x4be365));});return Promise[_0x945f('0x4b')](_0xb168eb)[_0x945f('0xd')](function(){_0x3bb476();})['catch'](function(){_0x3bb476();});}else{_0x3bb476();}});});}function getTags(_0x5064dd,_0x27f15c,_0x5227ac,_0x33c03e,_0x450ccb,_0x5bea4c){return function(_0x4f7dd2){return new Promise(function(_0x4ecac,_0x43da3c){var _0x1e5c15=[];var _0x31a310=_0x33c03e[_0x945f('0x4d')];if(_0x31a310&&_0x31a310[_0x945f('0xf')]>0x0){_0x1e5c15=_[_0x945f('0x4e')](_0x31a310,_0x945f('0x3b'));}if(_0x1e5c15[_0x945f('0xf')]>0x0){return manageTags(_0x5064dd,_0x1e5c15,_0x27f15c,_0x5227ac,_0x4f7dd2,_0x450ccb,_0x5bea4c)[_0x945f('0xd')](function(){_0x4ecac(_0x4f7dd2);});}else{_0x4ecac(_0x4f7dd2);}});};}function emit(_0x29e4fe,_0x4017e1,_0x5423d3){var _0x4215c0=_0x945f('0x4f')+_0x945f('0x50')+_0x945f('0x51')+_0x945f('0x52');var _0x3b88a6={'uri':_0x29e4fe+_0x945f('0x53')+_0x5423d3+_0x4215c0};io['to'](util[_0x945f('0x54')]('user:%s',_0x4017e1))[_0x945f('0x55')]('trigger:browser:url',_0x3b88a6);}exports['cs']=function(_0x1fa3b6,_0x4d1fab,_0x4b4e2a,_0x1c529d,_0x427b58,_0x5e5b45,_0x4bd6ea,_0x162782){var _0x521277={};var _0x3b3071={'user':_0x5e5b45[_0x945f('0x56')],'pass':_0x5e5b45[_0x945f('0x57')]};var _0x107e00=_0x945f('0x58');var _0x3528a9='sysparm_display_value=true';_0x5e5b45[_0x945f('0x59')]=intUtil[_0x945f('0x5a')](_0x5e5b45[_0x945f('0x59')]);_0x5e5b45[_0x945f('0x5b')]=intUtil[_0x945f('0x5a')](_0x5e5b45[_0x945f('0x5b')]);var _0x18c6e4=util['format'](_0x945f('0x5c'),_0x5e5b45[_0x945f('0x59')]);_0x521277[_0x945f('0x16')]=!_['isNil'](_0x1c529d)?_0x1c529d[_0x945f('0x5d')]:null;_0x521277[_0x945f('0x20')]=_0x5e5b45[_0x945f('0x5d')];_0x521277['endUserNumber']=_0x162782[_0x945f('0x36')]()===_0x945f('0x3d')?_0x4d1fab[_0x945f('0x5e')]:_0x4d1fab[_0x945f('0x5f')];_0x521277[_0x945f('0x60')]=_0x162782==='queue'||_0x162782==='unmanaged'?_0x945f('0x61'):_0x945f('0x3d');var _0x131ade=util[_0x945f('0x54')](_0x945f('0x62'),_0x5e5b45['serverUrl'],_0x4d1fab['uniqueid'],md5(_0x4d1fab[_0x945f('0x63')]));if(_0x427b58&&_0x427b58['monitor_format']){logger[_0x945f('0x12')]('[QUEUE]',_0x945f('0x64'));_0x4d1fab[_0x945f('0x65')]=_0x131ade;}else if(_0x4bd6ea&&_0x4bd6ea[_0x945f('0x66')]&&_0x4bd6ea[_0x945f('0x66')]!=='none'){logger['info'](_0x945f('0x67'),'Recording\x20is\x20enabled!');_0x4d1fab[_0x945f('0x65')]=_0x131ade;}else{_0x4d1fab['recordingURL']='';}return getAdminUser(_0x162782,_0x3b3071,_0x521277,_0x18c6e4,_0x3528a9,_0x107e00)['then'](getUser(_0x162782,_0x3b3071,_0x18c6e4,_0x3528a9,_0x107e00))[_0x945f('0xd')](getEndUser(_0x162782,_0x3b3071,_0x18c6e4,_0x3528a9,_0x107e00))['then'](getTicket(_0x162782,_0x3b3071,_0x18c6e4,_0x4b4e2a,_0x4d1fab,_0x3528a9))[_0x945f('0xd')](function(_0x358d20){logger['info'](util[_0x945f('0x54')](_0x945f('0x68'),_0x358d20['ticketId']));logger[_0x945f('0x12')](util[_0x945f('0x54')](_0x945f('0x69'),_0x162782));if(_0x162782!==_0x945f('0x6a')){logger['info']('['+[_0x162782[_0x945f('0x13')]()]+']',_0x945f('0x6b'));emit(_0x5e5b45[_0x945f('0x59')],_0x1c529d[_0x945f('0x3b')],_0x358d20[_0x945f('0x6c')]);}})[_0x945f('0x1c')](function(_0x4d14c8){logger['error']('['+[_0x162782[_0x945f('0x13')]()]+_0x945f('0x6d'),util[_0x945f('0x6e')](_0x4d14c8,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0e5bca5..da0da08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7212=['set_entry','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','nameField','customField','content','custom_fields','type','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','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','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','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','trigger:browser:url','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','users','version','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','name','Subjects','assigned_user_id','date_start','toISOString','slice','duration_hours','duration_minutes','parent_type','parent_name','direction','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','length','find','entry_list','name_value_list','user_name','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x2de10e,_0x1cf25a){var _0x5244c7=function(_0x3b8920){while(--_0x3b8920){_0x2de10e['push'](_0x2de10e['shift']());}};_0x5244c7(++_0x1cf25a);}(_0x7212,0xb0));var _0x2721=function(_0x4adb2b,_0x1b139d){_0x4adb2b=_0x4adb2b-0x0;var _0x1dcef6=_0x7212[_0x4adb2b];return _0x1dcef6;};'use strict';var _=require(_0x2721('0x0'));var rp=require(_0x2721('0x1'));var BPromise=require(_0x2721('0x2'));var md5=require(_0x2721('0x3'));var util=require(_0x2721('0x4'));var Redis=require(_0x2721('0x5'));var intUtil=require(_0x2721('0x6'));var config=require(_0x2721('0x7'));var logger=require(_0x2721('0x8'))(_0x2721('0x9'));config[_0x2721('0xa')]=_[_0x2721('0xb')](config[_0x2721('0xa')],{'host':_0x2721('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2721('0xa')]));var def={'method':_0x2721('0xd'),'json':!![]};function emit(_0x36436d,_0x4ad936,_0x4f0320){io['to'](_0x36436d)[_0x2721('0xe')](_0x4ad936,_0x4f0320);}function getTicket(_0x114a22,_0x4ef082,_0x4919cd,_0x447c97,_0x394c78,_0x52235d,_0x5eda2a,_0x13505a){logger['info']('Creating\x20new\x20ticket...');var _0x26053e=new Date();var _0x3d67c1=[{'name':_0x2721('0xf'),'value':intUtil['getString'](_0x447c97[_0x2721('0x10')],_0x394c78,'\x20')},{'name':_0x2721('0x11'),'value':_0x4ef082['id']},{'name':'created_by','value':_0x4ef082['id']},{'name':'description','value':intUtil['getString'](_0x447c97['Descriptions'],_0x394c78,'\x0a')},{'name':_0x2721('0x12'),'value':_0x26053e[_0x2721('0x13')]()[_0x2721('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x2721('0x15'),'value':'0'},{'name':_0x2721('0x16'),'value':'15'},{'name':'parent_id','value':_0x4919cd['id']},{'name':_0x2721('0x17'),'value':'Contacts'},{'name':_0x2721('0x18'),'value':_0x4919cd[_0x2721('0xf')]},{'name':_0x2721('0x19'),'value':_0x13505a}];if(_0x52235d['length']){_[_0x2721('0x1a')](_0x52235d,function(_0x2f01ec){if(_0x394c78[_0x2f01ec[_0x2721('0x1b')]]){_0x3d67c1[_0x2721('0x1c')]({'name':_0x2f01ec[_0x2721('0x1d')],'value':_0x394c78[_0x2f01ec[_0x2721('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x2721('0x1e'),'response_type':_0x2721('0x1e'),'rest_data':JSON[_0x2721('0x1f')]({'session':_0x5eda2a['id'],'module_name':_0x2721('0x20'),'name_value_list':_0x3d67c1})}});}function getAuth(_0x4374a0){return util[_0x2721('0x21')](_0x2721('0x22'),new Buffer(_0x4374a0[_0x2721('0x23')]+':X')[_0x2721('0x24')](_0x2721('0x25')));}function getServerInfo(_0x21e12a){return request({'form':{'method':_0x2721('0x26'),'input_type':_0x2721('0x1e'),'response_type':_0x2721('0x1e'),'rest_data':JSON[_0x2721('0x1f')]({'session':_0x21e12a['id']})}});}function getUser(_0x957548,_0x30df9a,_0x500a0b){if(!_[_0x2721('0x27')](_0x30df9a)){logger[_0x2721('0x28')](_0x2721('0x29'),_0x30df9a);return request({'form':{'method':_0x2721('0x2a'),'input_type':_0x2721('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x500a0b['id'],'module_name':_0x2721('0x2b'),'query':util[_0x2721('0x21')](_0x2721('0x2c'),_0x30df9a),'order_by':'','offset':'0','select_fields':['id',_0x2721('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2721('0x2d')](function(_0x5075a1){if(_0x5075a1['entry_list'][_0x2721('0x2e')]){var _0x570596=_[_0x2721('0x2f')](_0x5075a1[_0x2721('0x30')],function(_0x4eac40){return _0x4eac40[_0x2721('0x31')][_0x2721('0x32')][_0x2721('0x33')]===_0x30df9a;});if(_0x570596){logger[_0x2721('0x28')]('Agent\x20found!');return BPromise[_0x2721('0x34')]({'id':_0x570596['name_value_list']['id']['value'],'name':_0x570596[_0x2721('0x31')][_0x2721('0xf')][_0x2721('0x33')]});}}logger[_0x2721('0x28')](_0x2721('0x35'));return BPromise[_0x2721('0x34')]({'id':_0x500a0b[_0x2721('0x31')][_0x2721('0x36')][_0x2721('0x33')],'name':_0x500a0b[_0x2721('0x31')]['user_name']['value']});});}else{logger[_0x2721('0x28')](_0x2721('0x37'));return BPromise[_0x2721('0x34')]({'id':_0x500a0b['name_value_list'][_0x2721('0x36')][_0x2721('0x33')],'name':_0x500a0b[_0x2721('0x31')][_0x2721('0x32')][_0x2721('0x33')]});}}function getEndUser(_0x5b2f22,_0x24af42,_0x392e48,_0x3912ec){logger[_0x2721('0x28')](_0x2721('0x38'),_0x392e48);return request({'form':{'method':_0x2721('0x2a'),'input_type':'JSON','response_type':_0x2721('0x1e'),'rest_data':JSON[_0x2721('0x1f')]({'session':_0x3912ec['id'],'module_name':_0x2721('0x39'),'query':util[_0x2721('0x21')](_0x2721('0x3a'),_0x392e48),'order_by':'','offset':'0','select_fields':['id',_0x2721('0xf'),_0x2721('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2721('0x2d')](function(_0x522f73){if(_0x522f73[_0x2721('0x30')]['length']){var _0x31e1de=_[_0x2721('0x2f')](_0x522f73[_0x2721('0x30')],function(_0x4b7557){return _0x4b7557[_0x2721('0x31')][_0x2721('0x3b')][_0x2721('0x33')]===_0x392e48;});if(_0x31e1de){logger['info'](_0x2721('0x3c'));return BPromise[_0x2721('0x34')]({'id':_0x31e1de[_0x2721('0x31')]['id']['value'],'name':_0x31e1de[_0x2721('0x31')][_0x2721('0xf')][_0x2721('0x33')],'phone':_0x31e1de[_0x2721('0x31')]['phone_home'][_0x2721('0x33')]});}}else{logger['info'](_0x2721('0x3d'));return request({'form':{'method':_0x2721('0x3e'),'input_type':_0x2721('0x1e'),'response_type':_0x2721('0x1e'),'rest_data':JSON[_0x2721('0x1f')]({'session':_0x3912ec['id'],'module_name':_0x2721('0x39'),'name_value_list':[{'name':'first_name','value':_0x24af42!=='<unknown>'?_0x24af42:util[_0x2721('0x21')](_0x2721('0x3f'),_0x392e48)},{'name':_0x2721('0x3b'),'value':_0x392e48}]})}})[_0x2721('0x2d')](function(_0x27775b){logger[_0x2721('0x28')](_0x2721('0x40'));return BPromise[_0x2721('0x34')]({'id':_0x27775b['id'],'name':_0x27775b[_0x2721('0x30')]['first_name'][_0x2721('0x33')],'phone':_0x27775b[_0x2721('0x30')][_0x2721('0x3b')]['value']});});}});}function request(_0x535ab9){logger[_0x2721('0x41')](_0x2721('0x42'),JSON['stringify'](_0x535ab9));return rp(_['merge'](def,_0x535ab9));}function getTags(_0x1968b9,_0x3e61dc){var _0x6979e0=[];if(_0x1968b9&&_0x1968b9[_0x2721('0x2e')]>0x0){_0x6979e0=_['map'](_0x1968b9,_0x3e61dc);}return _0x6979e0;}function getCustomFields(_0x3d40bf,_0xc305dd){var _0x4c0305=[];var _0x2e6192={'custom_fields':[]};if(_0x3d40bf['length']>0x0){_[_0x2721('0x1a')](_0x3d40bf,function(_0x2b4175){if(_0x2b4175['type']==='string'&&_0x2b4175[_0x2721('0x43')]&&!_0x2b4175[_0x2721('0x44')]){_0x2e6192[_0x2b4175[_0x2721('0x43')]['toLowerCase']()]=_0x2b4175[_0x2721('0x45')][_0x2721('0x24')]();}else if(_0x2b4175['type']==='string'&&_0x2b4175[_0x2721('0x1d')]&&_0x2b4175[_0x2721('0x44')]){_0x2e6192[_0x2721('0x46')][_0x2721('0x1c')]({'id':_0x2b4175[_0x2721('0x1d')],'value':_0x2b4175[_0x2721('0x45')]['toString']()});}else if(_0x2b4175[_0x2721('0x47')]===_0x2721('0x48')&&_0x2b4175[_0x2721('0x1b')]&&_0x2b4175[_0x2721('0x1d')]&&_0x2b4175['customField']){_0xc305dd[_0x2b4175['variableName']]&&_0x2e6192[_0x2721('0x46')][_0x2721('0x1c')]({'id':_0x2b4175['idField'],'value':_0xc305dd[_0x2b4175[_0x2721('0x1b')]][_0x2721('0x24')]()});}else if(_0x2b4175[_0x2721('0x47')]===_0x2721('0x49')&&_0x2b4175['Variable']&&_0x2b4175[_0x2721('0x4a')][_0x2721('0xf')]&&_0x2b4175[_0x2721('0x1d')]&&_0x2b4175[_0x2721('0x44')]){_0xc305dd[_0x2b4175[_0x2721('0x4a')][_0x2721('0xf')][_0x2721('0x4b')]()]&&_0x2e6192['custom_fields']['push']({'id':_0x2b4175[_0x2721('0x1d')],'value':_0xc305dd[_0x2b4175[_0x2721('0x4a')][_0x2721('0xf')][_0x2721('0x4b')]()][_0x2721('0x24')]()});}});}return _0x2e6192;}function getConnection(_0x4395de){return request({'method':_0x2721('0xd'),'form':{'method':_0x2721('0x4c'),'input_type':_0x2721('0x1e'),'response_type':_0x2721('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4395de[_0x2721('0x4d')],'password':_0x4395de[_0x2721('0x4e')],'encryption':_0x2721('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x2721('0x2d')](function(_0x211ea8){var _0x179cc8=_0x211ea8;if(_0x179cc8['id']){def[_0x2721('0x50')]=_0x179cc8['id'];return BPromise[_0x2721('0x34')](_0x179cc8);}else{throw new Error(util['format'](_0x2721('0x51'),_0x4395de['id']));}});}function setRelationship(_0x14bed9,_0x4e3a4c,_0x59136c,_0x49573b){return request({'form':{'method':'set_relationship','input_type':_0x2721('0x1e'),'response_type':_0x2721('0x1e'),'rest_data':JSON[_0x2721('0x1f')]({'session':_0x14bed9['id'],'module_name':_0x2721('0x20'),'module_id':_0x59136c['id'],'link_field_name':_0x49573b,'related_ids':[_0x4e3a4c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2721('0x52')]=function(_0x277722,_0x24542c,_0x494d35,_0x41f227,_0x2f4450,_0x30fb1a){var _0x3f91a4,_0x354b7b,_0xb45397,_0x24b9a0;_0x30fb1a[_0x2721('0x53')]=intUtil['stripTrailingSlash'](_0x30fb1a['remoteUri']);_0x30fb1a[_0x2721('0x54')]=intUtil[_0x2721('0x55')](_0x30fb1a[_0x2721('0x54')]);def[_0x2721('0x56')]=util['format'](_0x2721('0x57'),_0x30fb1a['remoteUri']);if(_0x2f4450&&_0x2f4450['monitor_format']){logger[_0x2721('0x28')](_0x2721('0x58'),_0x2721('0x59'));_0x24542c[_0x2721('0x5a')]=util[_0x2721('0x21')](_0x2721('0x5b'),_0x30fb1a['serverUrl'],_0x24542c[_0x2721('0x5c')],md5(_0x24542c[_0x2721('0x5c')]));}else{_0x24542c['recordingURL']='';}return getConnection(_0x30fb1a)[_0x2721('0x2d')](function(_0x17c43f){_0x24b9a0=_0x17c43f;return getUser(_0x30fb1a,_0x41f227['name'],_0x24b9a0);})[_0x2721('0x2d')](function(_0x244d84){_0x3f91a4=_0x244d84;logger['info'](_0x2721('0x5d'),_0x3f91a4['id']);return getEndUser(_0x30fb1a,_0x24542c[_0x2721('0x5e')],_0x24542c['calleridnum'],_0x24b9a0);})[_0x2721('0x2d')](function(_0xb407ad){_0x354b7b=_0xb407ad;logger['info'](_0x2721('0x5f'),_0x354b7b['id']);return getTicket(_0x30fb1a,_0x3f91a4,_0x354b7b,_0x494d35,_0x24542c,_0x494d35[_0x2721('0x60')],_0x24b9a0,_0x2721('0x61'));})[_0x2721('0x2d')](function(_0x31c290){_0xb45397=_0x31c290;logger[_0x2721('0x28')](_0x2721('0x62'));logger[_0x2721('0x28')](_0x2721('0x63'),_0xb45397['id']);return setRelationship(_0x24b9a0,_0x3f91a4,_0xb45397,'users');})['then'](function(){return setRelationship(_0x24b9a0,_0x354b7b,_0xb45397,_0x2721('0x64'));})['then'](function(){return getServerInfo(_0x24b9a0);})['then'](function(_0x4931ff){var _0x811bc6=parseInt(_0x4931ff['version'][_0x2721('0x65')](0x0));var _0x4e20cd=util[_0x2721('0x21')](_0x2721('0x66'),_0x30fb1a[_0x2721('0x53')],_0xb45397['id']);if(_0x811bc6>0x6){_0x4e20cd=util[_0x2721('0x21')](_0x2721('0x67'),_0x30fb1a[_0x2721('0x53')],_0xb45397['id']);}logger['info']('[QUEUE]',_0x2721('0x68'));emit(util[_0x2721('0x21')](_0x2721('0x69'),_0x41f227[_0x2721('0xf')]),_0x2721('0x6a'),{'uri':_0x4e20cd});})['catch'](function(_0x4cab9f){logger[_0x2721('0x6b')](_0x2721('0x58'),JSON[_0x2721('0x1f')](_0x4cab9f));});};exports['outbound']=function(_0x43c43c,_0x11af12,_0x3143fd,_0x153a00,_0x11f82d,_0x56bd37,_0x4b7903){var _0x3cf8d3,_0x465608,_0x4e401d,_0x47dcbd;_0x56bd37[_0x2721('0x53')]=intUtil['stripTrailingSlash'](_0x56bd37[_0x2721('0x53')]);_0x56bd37[_0x2721('0x54')]=intUtil[_0x2721('0x55')](_0x56bd37[_0x2721('0x54')]);def[_0x2721('0x56')]=util[_0x2721('0x21')]('%s/service/v4_1/rest.php',_0x56bd37[_0x2721('0x53')]);if(_0x4b7903&&_0x4b7903[_0x2721('0x6c')]&&_0x4b7903[_0x2721('0x6c')]!==_0x2721('0x6d')){logger['info'](_0x2721('0x6e'),'Recording\x20is\x20enabled!');_0x11af12[_0x2721('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56bd37[_0x2721('0x54')],_0x11af12[_0x2721('0x5c')],md5(_0x11af12[_0x2721('0x5c')]));}return getConnection(_0x56bd37)[_0x2721('0x2d')](function(_0x1d6ced){_0x47dcbd=_0x1d6ced;return getUser(_0x56bd37,_0x153a00[_0x2721('0xf')],_0x47dcbd);})[_0x2721('0x2d')](function(_0x349e8a){_0x3cf8d3=_0x349e8a;logger[_0x2721('0x28')](_0x2721('0x5d'),_0x3cf8d3['id']);return getEndUser(_0x56bd37,_0x11af12[_0x2721('0x6f')],_0x11af12[_0x2721('0x70')],_0x47dcbd);})['then'](function(_0x3e547e){_0x465608=_0x3e547e;logger[_0x2721('0x28')](_0x2721('0x5f'),_0x465608['id']);return getTicket(_0x56bd37,_0x3cf8d3,_0x465608,_0x3143fd,_0x11af12,_0x3143fd[_0x2721('0x60')],_0x47dcbd,'Outbound');})[_0x2721('0x2d')](function(_0x5c1ecf){_0x4e401d=_0x5c1ecf;logger['info'](_0x2721('0x62'));logger[_0x2721('0x28')]('The\x20Ticket\x20ID\x20is:',_0x4e401d['id']);return setRelationship(_0x47dcbd,_0x3cf8d3,_0x4e401d,_0x2721('0x71'));})['then'](function(){return setRelationship(_0x47dcbd,_0x465608,_0x4e401d,_0x2721('0x64'));})[_0x2721('0x2d')](function(){return getServerInfo(_0x47dcbd);})[_0x2721('0x2d')](function(_0x410f05){var _0x427529=parseInt(_0x410f05[_0x2721('0x72')][_0x2721('0x65')](0x0));var _0x1e9b2f=util[_0x2721('0x21')](_0x2721('0x66'),_0x56bd37['remoteUri'],_0x4e401d['id']);if(_0x427529>0x6){_0x1e9b2f=util[_0x2721('0x21')](_0x2721('0x67'),_0x56bd37[_0x2721('0x53')],_0x4e401d['id']);}logger[_0x2721('0x28')](_0x2721('0x6e'),_0x2721('0x68'));emit(util[_0x2721('0x21')](_0x2721('0x69'),_0x153a00[_0x2721('0xf')]),_0x2721('0x6a'),{'uri':_0x1e9b2f});})[_0x2721('0x73')](function(_0xa35c92){logger[_0x2721('0x6b')]('[OUTBOUND]',JSON[_0x2721('0x1f')](_0xa35c92));});};exports[_0x2721('0x74')]=function(_0x12ad64,_0x45fe75,_0x5deecf,_0x441d1e,_0x448beb,_0x91bbad){var _0x7ebe3a,_0x172d27,_0x209c63,_0x4ced9d;_0x91bbad[_0x2721('0x53')]=intUtil[_0x2721('0x55')](_0x91bbad[_0x2721('0x53')]);_0x91bbad[_0x2721('0x54')]=intUtil[_0x2721('0x55')](_0x91bbad[_0x2721('0x54')]);def[_0x2721('0x56')]=util[_0x2721('0x21')](_0x2721('0x57'),_0x91bbad[_0x2721('0x53')]);if(_0x448beb&&_0x448beb['monitor_format']){logger[_0x2721('0x28')]('['+_0x45fe75[_0x2721('0x75')][_0x2721('0x76')]()+']','Recording\x20is\x20enabled!');_0x45fe75[_0x2721('0x5a')]=util[_0x2721('0x21')](_0x2721('0x5b'),_0x91bbad[_0x2721('0x54')],_0x45fe75[_0x2721('0x5c')],md5(_0x45fe75[_0x2721('0x5c')]));}else{_0x45fe75['recordingURL']='';}return getConnection(_0x91bbad)[_0x2721('0x2d')](function(_0xb20792){_0x4ced9d=_0xb20792;if(!_[_0x2721('0x27')](_0x441d1e)){return getUser(_0x91bbad,_0x441d1e[_0x2721('0xf')],_0x4ced9d);}else{return getUser(_0x91bbad,null,_0x4ced9d);}})['then'](function(_0x5db2ab){_0x7ebe3a=_0x5db2ab;logger['info'](_0x2721('0x5d'),_0x7ebe3a['id']);return getEndUser(_0x91bbad,_0x45fe75['calleridname'],_0x45fe75['calleridnum'],_0x4ced9d);})[_0x2721('0x2d')](function(_0x1fefbb){_0x172d27=_0x1fefbb;logger[_0x2721('0x28')](_0x2721('0x5f'),_0x172d27['id']);return getTicket(_0x91bbad,_0x7ebe3a,_0x172d27,_0x5deecf,_0x45fe75,_0x5deecf[_0x2721('0x60')],_0x4ced9d,_0x2721('0x61'));})[_0x2721('0x2d')](function(_0x5a1e4b){_0x209c63=_0x5a1e4b;logger[_0x2721('0x28')](_0x2721('0x62'));logger[_0x2721('0x28')](_0x2721('0x63'),_0x209c63['id']);return setRelationship(_0x4ced9d,_0x7ebe3a,_0x209c63,_0x2721('0x71'));})[_0x2721('0x2d')](function(){return setRelationship(_0x4ced9d,_0x172d27,_0x209c63,_0x2721('0x64'));})['then'](function(){return getServerInfo(_0x4ced9d);})['catch'](function(_0x28f7d4){logger['error']('['+_0x45fe75[_0x2721('0x75')][_0x2721('0x76')]()+']',JSON[_0x2721('0x1f')](_0x28f7d4));});};
\ No newline at end of file
+var _0x8cda=['resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','format','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','toLowerCase','content','customField','custom_fields','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','lastevent','calleridnum','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','sugarcrm','redis','localhost','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','date_start','toISOString','replace','duration_hours','parent_id','parent_type','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','get_server_info','isNil','stringify','Employees','user_name','then','entry_list','length','find','value','info','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x8cda,0x1ae));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa8cd('0x0'));var rp=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var md5=require(_0xa8cd('0x3'));var util=require('util');var Redis=require(_0xa8cd('0x4'));var intUtil=require(_0xa8cd('0x5'));var config=require(_0xa8cd('0x6'));var logger=require('../../../../config/logger')(_0xa8cd('0x7'));config[_0xa8cd('0x8')]=_['defaults'](config[_0xa8cd('0x8')],{'host':_0xa8cd('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa8cd('0x8')]));var def={'method':_0xa8cd('0xa'),'json':!![]};function emit(_0x58ecf5,_0xc94384,_0x4a3234){io['to'](_0x58ecf5)[_0xa8cd('0xb')](_0xc94384,_0x4a3234);}function getTicket(_0x2e386d,_0xff55f4,_0x27706e,_0x21e734,_0x5a146f,_0x4ccf21,_0x4bfa6d,_0x2451e7){logger['info'](_0xa8cd('0xc'));var _0x32e8b5=new Date();var _0xd5a177=[{'name':_0xa8cd('0xd'),'value':intUtil[_0xa8cd('0xe')](_0x21e734[_0xa8cd('0xf')],_0x5a146f,'\x20')},{'name':_0xa8cd('0x10'),'value':_0xff55f4['id']},{'name':_0xa8cd('0x11'),'value':_0xff55f4['id']},{'name':'description','value':intUtil['getString'](_0x21e734['Descriptions'],_0x5a146f,'\x0a')},{'name':_0xa8cd('0x12'),'value':_0x32e8b5[_0xa8cd('0x13')]()['slice'](0x0,0x13)[_0xa8cd('0x14')]('T','\x20')},{'name':_0xa8cd('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xa8cd('0x16'),'value':_0x27706e['id']},{'name':_0xa8cd('0x17'),'value':'Contacts'},{'name':_0xa8cd('0x18'),'value':_0x27706e[_0xa8cd('0xd')]},{'name':_0xa8cd('0x19'),'value':_0x2451e7}];if(_0x4ccf21['length']){_[_0xa8cd('0x1a')](_0x4ccf21,function(_0x3a17ab){if(_0x5a146f[_0x3a17ab[_0xa8cd('0x1b')]]){_0xd5a177[_0xa8cd('0x1c')]({'name':_0x3a17ab[_0xa8cd('0x1d')],'value':_0x5a146f[_0x3a17ab[_0xa8cd('0x1b')]]});}});}return request({'form':{'method':_0xa8cd('0x1e'),'input_type':_0xa8cd('0x1f'),'response_type':_0xa8cd('0x1f'),'rest_data':JSON['stringify']({'session':_0x4bfa6d['id'],'module_name':_0xa8cd('0x20'),'name_value_list':_0xd5a177})}});}function getAuth(_0x177ab9){return util['format'](_0xa8cd('0x21'),new Buffer(_0x177ab9[_0xa8cd('0x22')]+':X')[_0xa8cd('0x23')]('base64'));}function getServerInfo(_0x2b3d67){return request({'form':{'method':_0xa8cd('0x24'),'input_type':_0xa8cd('0x1f'),'response_type':_0xa8cd('0x1f'),'rest_data':JSON['stringify']({'session':_0x2b3d67['id']})}});}function getUser(_0x51acfa,_0x290ccf,_0x420634){if(!_[_0xa8cd('0x25')](_0x290ccf)){logger['info']('Getting\x20agent\x20with\x20name',_0x290ccf);return request({'form':{'method':'get_entry_list','input_type':_0xa8cd('0x1f'),'response_type':_0xa8cd('0x1f'),'rest_data':JSON[_0xa8cd('0x26')]({'session':_0x420634['id'],'module_name':_0xa8cd('0x27'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x290ccf),'order_by':'','offset':'0','select_fields':['id','name',_0xa8cd('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa8cd('0x29')](function(_0x13f8e3){if(_0x13f8e3[_0xa8cd('0x2a')][_0xa8cd('0x2b')]){var _0x5989a2=_[_0xa8cd('0x2c')](_0x13f8e3[_0xa8cd('0x2a')],function(_0x1bc31a){return _0x1bc31a['name_value_list'][_0xa8cd('0x28')][_0xa8cd('0x2d')]===_0x290ccf;});if(_0x5989a2){logger[_0xa8cd('0x2e')](_0xa8cd('0x2f'));return BPromise['resolve']({'id':_0x5989a2[_0xa8cd('0x30')]['id'][_0xa8cd('0x2d')],'name':_0x5989a2[_0xa8cd('0x30')]['name'][_0xa8cd('0x2d')]});}}logger[_0xa8cd('0x2e')](_0xa8cd('0x31'));return BPromise[_0xa8cd('0x32')]({'id':_0x420634[_0xa8cd('0x30')][_0xa8cd('0x33')][_0xa8cd('0x2d')],'name':_0x420634['name_value_list']['user_name'][_0xa8cd('0x2d')]});});}else{logger['info'](_0xa8cd('0x34'));return BPromise[_0xa8cd('0x32')]({'id':_0x420634[_0xa8cd('0x30')]['user_id'][_0xa8cd('0x2d')],'name':_0x420634[_0xa8cd('0x30')][_0xa8cd('0x28')][_0xa8cd('0x2d')]});}}function getEndUser(_0x2df015,_0x16d258,_0x216897,_0xeee1bd){logger[_0xa8cd('0x2e')](_0xa8cd('0x35'),_0x216897);return request({'form':{'method':'get_entry_list','input_type':_0xa8cd('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa8cd('0x26')]({'session':_0xeee1bd['id'],'module_name':_0xa8cd('0x36'),'query':util[_0xa8cd('0x37')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x216897),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa8cd('0x29')](function(_0x137a22){if(_0x137a22[_0xa8cd('0x2a')][_0xa8cd('0x2b')]){var _0x2e87ea=_[_0xa8cd('0x2c')](_0x137a22['entry_list'],function(_0x1d8d79){return _0x1d8d79[_0xa8cd('0x30')][_0xa8cd('0x38')][_0xa8cd('0x2d')]===_0x216897;});if(_0x2e87ea){logger[_0xa8cd('0x2e')](_0xa8cd('0x39'));return BPromise['resolve']({'id':_0x2e87ea['name_value_list']['id'][_0xa8cd('0x2d')],'name':_0x2e87ea[_0xa8cd('0x30')][_0xa8cd('0xd')]['value'],'phone':_0x2e87ea['name_value_list'][_0xa8cd('0x38')][_0xa8cd('0x2d')]});}}else{logger[_0xa8cd('0x2e')](_0xa8cd('0x3a'));return request({'form':{'method':_0xa8cd('0x1e'),'input_type':_0xa8cd('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa8cd('0x26')]({'session':_0xeee1bd['id'],'module_name':_0xa8cd('0x36'),'name_value_list':[{'name':_0xa8cd('0x3b'),'value':_0x16d258!==_0xa8cd('0x3c')?_0x16d258:util['format'](_0xa8cd('0x3d'),_0x216897)},{'name':_0xa8cd('0x38'),'value':_0x216897}]})}})[_0xa8cd('0x29')](function(_0x56eb00){logger[_0xa8cd('0x2e')](_0xa8cd('0x3e'));return BPromise[_0xa8cd('0x32')]({'id':_0x56eb00['id'],'name':_0x56eb00[_0xa8cd('0x2a')][_0xa8cd('0x3b')][_0xa8cd('0x2d')],'phone':_0x56eb00['entry_list'][_0xa8cd('0x38')]['value']});});}});}function request(_0x2e1c33){logger[_0xa8cd('0x3f')](_0xa8cd('0x40'),JSON[_0xa8cd('0x26')](_0x2e1c33));return rp(_['merge'](def,_0x2e1c33));}function getTags(_0x9b1cf3,_0x101d0a){var _0x6648d8=[];if(_0x9b1cf3&&_0x9b1cf3['length']>0x0){_0x6648d8=_[_0xa8cd('0x41')](_0x9b1cf3,_0x101d0a);}return _0x6648d8;}function getCustomFields(_0x2196be,_0x352f69){var _0x3c9bf1=[];var _0x28f0a8={'custom_fields':[]};if(_0x2196be[_0xa8cd('0x2b')]>0x0){_[_0xa8cd('0x1a')](_0x2196be,function(_0x2da721){if(_0x2da721[_0xa8cd('0x42')]===_0xa8cd('0x43')&&_0x2da721[_0xa8cd('0x44')]&&!_0x2da721['customField']){_0x28f0a8[_0x2da721['nameField'][_0xa8cd('0x45')]()]=_0x2da721[_0xa8cd('0x46')]['toString']();}else if(_0x2da721['type']===_0xa8cd('0x43')&&_0x2da721['idField']&&_0x2da721[_0xa8cd('0x47')]){_0x28f0a8[_0xa8cd('0x48')]['push']({'id':_0x2da721[_0xa8cd('0x1d')],'value':_0x2da721[_0xa8cd('0x46')]['toString']()});}else if(_0x2da721['type']==='variable'&&_0x2da721['variableName']&&_0x2da721[_0xa8cd('0x1d')]&&_0x2da721[_0xa8cd('0x47')]){_0x352f69[_0x2da721[_0xa8cd('0x1b')]]&&_0x28f0a8[_0xa8cd('0x48')][_0xa8cd('0x1c')]({'id':_0x2da721['idField'],'value':_0x352f69[_0x2da721[_0xa8cd('0x1b')]][_0xa8cd('0x23')]()});}else if(_0x2da721[_0xa8cd('0x42')]===_0xa8cd('0x49')&&_0x2da721['Variable']&&_0x2da721[_0xa8cd('0x4a')][_0xa8cd('0xd')]&&_0x2da721[_0xa8cd('0x1d')]&&_0x2da721[_0xa8cd('0x47')]){_0x352f69[_0x2da721[_0xa8cd('0x4a')][_0xa8cd('0xd')]['toLowerCase']()]&&_0x28f0a8[_0xa8cd('0x48')][_0xa8cd('0x1c')]({'id':_0x2da721[_0xa8cd('0x1d')],'value':_0x352f69[_0x2da721[_0xa8cd('0x4a')][_0xa8cd('0xd')][_0xa8cd('0x45')]()][_0xa8cd('0x23')]()});}});}return _0x28f0a8;}function getConnection(_0x2c51df){return request({'method':_0xa8cd('0xa'),'form':{'method':_0xa8cd('0x4b'),'input_type':_0xa8cd('0x1f'),'response_type':_0xa8cd('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2c51df[_0xa8cd('0x4c')],'password':_0x2c51df[_0xa8cd('0x4d')],'encryption':'PLAIN'},'application':_0xa8cd('0x4e')})}})[_0xa8cd('0x29')](function(_0xf878f9){var _0x15f7f0=_0xf878f9;if(_0x15f7f0['id']){def[_0xa8cd('0x4f')]=_0x15f7f0['id'];return BPromise[_0xa8cd('0x32')](_0x15f7f0);}else{throw new Error(util['format'](_0xa8cd('0x50'),_0x2c51df['id']));}});}function setRelationship(_0x28903d,_0x379d05,_0x56153a,_0xd0edd0){return request({'form':{'method':_0xa8cd('0x51'),'input_type':_0xa8cd('0x1f'),'response_type':_0xa8cd('0x1f'),'rest_data':JSON[_0xa8cd('0x26')]({'session':_0x28903d['id'],'module_name':'Calls','module_id':_0x56153a['id'],'link_field_name':_0xd0edd0,'related_ids':[_0x379d05['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa8cd('0x52')]=function(_0x3336ad,_0x2519cb,_0x148f5f,_0x4d4cf7,_0x3bb4f7,_0x54dd4e){var _0x1bf9b9,_0x47a0fc,_0x195f32,_0xbb86d1;_0x54dd4e[_0xa8cd('0x53')]=intUtil['stripTrailingSlash'](_0x54dd4e[_0xa8cd('0x53')]);_0x54dd4e[_0xa8cd('0x54')]=intUtil[_0xa8cd('0x55')](_0x54dd4e[_0xa8cd('0x54')]);def[_0xa8cd('0x56')]=util[_0xa8cd('0x37')]('%s/service/v4_1/rest.php',_0x54dd4e[_0xa8cd('0x53')]);if(_0x3bb4f7&&_0x3bb4f7[_0xa8cd('0x57')]){logger[_0xa8cd('0x2e')](_0xa8cd('0x58'),'Recording\x20is\x20enabled!');_0x2519cb['recordingURL']=util['format'](_0xa8cd('0x59'),_0x54dd4e[_0xa8cd('0x54')],_0x2519cb[_0xa8cd('0x5a')],md5(_0x2519cb[_0xa8cd('0x5a')]));}else{_0x2519cb[_0xa8cd('0x5b')]='';}return getConnection(_0x54dd4e)[_0xa8cd('0x29')](function(_0x412bd8){_0xbb86d1=_0x412bd8;return getUser(_0x54dd4e,_0x4d4cf7['name'],_0xbb86d1);})[_0xa8cd('0x29')](function(_0x40e0fb){_0x1bf9b9=_0x40e0fb;logger[_0xa8cd('0x2e')]('The\x20User\x20ID\x20is:',_0x1bf9b9['id']);return getEndUser(_0x54dd4e,_0x2519cb[_0xa8cd('0x5c')],_0x2519cb['calleridnum'],_0xbb86d1);})['then'](function(_0x4667ae){_0x47a0fc=_0x4667ae;logger['info'](_0xa8cd('0x5d'),_0x47a0fc['id']);return getTicket(_0x54dd4e,_0x1bf9b9,_0x47a0fc,_0x148f5f,_0x2519cb,_0x148f5f[_0xa8cd('0x5e')],_0xbb86d1,_0xa8cd('0x5f'));})['then'](function(_0x109a49){_0x195f32=_0x109a49;logger[_0xa8cd('0x2e')](_0xa8cd('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x195f32['id']);return setRelationship(_0xbb86d1,_0x1bf9b9,_0x195f32,_0xa8cd('0x61'));})['then'](function(){return setRelationship(_0xbb86d1,_0x47a0fc,_0x195f32,_0xa8cd('0x62'));})['then'](function(){return getServerInfo(_0xbb86d1);})[_0xa8cd('0x29')](function(_0x9eab97){var _0x497895=parseInt(_0x9eab97[_0xa8cd('0x63')][_0xa8cd('0x64')](0x0));var _0x3f85e9=util[_0xa8cd('0x37')](_0xa8cd('0x65'),_0x54dd4e[_0xa8cd('0x53')],_0x195f32['id']);if(_0x497895>0x6){_0x3f85e9=util[_0xa8cd('0x37')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x54dd4e[_0xa8cd('0x53')],_0x195f32['id']);}logger['info'](_0xa8cd('0x58'),_0xa8cd('0x66'));emit(util[_0xa8cd('0x37')](_0xa8cd('0x67'),_0x4d4cf7[_0xa8cd('0xd')]),'trigger:browser:url',{'uri':_0x3f85e9});})[_0xa8cd('0x68')](function(_0x1341a2){logger[_0xa8cd('0x69')](_0xa8cd('0x58'),JSON[_0xa8cd('0x26')](_0x1341a2));});};exports[_0xa8cd('0x6a')]=function(_0x218222,_0x10cea0,_0x12085a,_0x43c96a,_0x306ec6,_0x584b9b,_0x4298cd){var _0x145862,_0x39233c,_0x5156b8,_0x4917d9;_0x584b9b[_0xa8cd('0x53')]=intUtil[_0xa8cd('0x55')](_0x584b9b[_0xa8cd('0x53')]);_0x584b9b['serverUrl']=intUtil[_0xa8cd('0x55')](_0x584b9b[_0xa8cd('0x54')]);def['uri']=util[_0xa8cd('0x37')](_0xa8cd('0x6b'),_0x584b9b['remoteUri']);if(_0x4298cd&&_0x4298cd[_0xa8cd('0x6c')]&&_0x4298cd[_0xa8cd('0x6c')]!==_0xa8cd('0x6d')){logger[_0xa8cd('0x2e')]('[OUTBOUND]',_0xa8cd('0x6e'));_0x10cea0[_0xa8cd('0x5b')]=util[_0xa8cd('0x37')](_0xa8cd('0x59'),_0x584b9b[_0xa8cd('0x54')],_0x10cea0[_0xa8cd('0x5a')],md5(_0x10cea0['uniqueid']));}return getConnection(_0x584b9b)[_0xa8cd('0x29')](function(_0x3bcc89){_0x4917d9=_0x3bcc89;return getUser(_0x584b9b,_0x43c96a[_0xa8cd('0xd')],_0x4917d9);})[_0xa8cd('0x29')](function(_0x27e91a){_0x145862=_0x27e91a;logger['info'](_0xa8cd('0x6f'),_0x145862['id']);return getEndUser(_0x584b9b,_0x10cea0[_0xa8cd('0x70')],_0x10cea0[_0xa8cd('0x71')],_0x4917d9);})[_0xa8cd('0x29')](function(_0x597acc){_0x39233c=_0x597acc;logger[_0xa8cd('0x2e')](_0xa8cd('0x5d'),_0x39233c['id']);return getTicket(_0x584b9b,_0x145862,_0x39233c,_0x12085a,_0x10cea0,_0x12085a[_0xa8cd('0x5e')],_0x4917d9,_0xa8cd('0x72'));})[_0xa8cd('0x29')](function(_0x3d329e){_0x5156b8=_0x3d329e;logger[_0xa8cd('0x2e')](_0xa8cd('0x60'));logger['info'](_0xa8cd('0x73'),_0x5156b8['id']);return setRelationship(_0x4917d9,_0x145862,_0x5156b8,_0xa8cd('0x61'));})['then'](function(){return setRelationship(_0x4917d9,_0x39233c,_0x5156b8,_0xa8cd('0x62'));})[_0xa8cd('0x29')](function(){return getServerInfo(_0x4917d9);})[_0xa8cd('0x29')](function(_0x5992d3){var _0x11dddb=parseInt(_0x5992d3[_0xa8cd('0x63')][_0xa8cd('0x64')](0x0));var _0x199180=util[_0xa8cd('0x37')](_0xa8cd('0x65'),_0x584b9b[_0xa8cd('0x53')],_0x5156b8['id']);if(_0x11dddb>0x6){_0x199180=util[_0xa8cd('0x37')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x584b9b[_0xa8cd('0x53')],_0x5156b8['id']);}logger['info'](_0xa8cd('0x74'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x43c96a[_0xa8cd('0xd')]),'trigger:browser:url',{'uri':_0x199180});})[_0xa8cd('0x68')](function(_0x50ba66){logger['error'](_0xa8cd('0x74'),JSON[_0xa8cd('0x26')](_0x50ba66));});};exports[_0xa8cd('0x75')]=function(_0x502547,_0xd4d686,_0x33cf89,_0x50d633,_0x3e57fb,_0x243529){var _0x2a5eef,_0x21c8e8,_0x5a3ffa,_0x3480bd;_0x243529['remoteUri']=intUtil[_0xa8cd('0x55')](_0x243529[_0xa8cd('0x53')]);_0x243529[_0xa8cd('0x54')]=intUtil[_0xa8cd('0x55')](_0x243529[_0xa8cd('0x54')]);def[_0xa8cd('0x56')]=util[_0xa8cd('0x37')](_0xa8cd('0x6b'),_0x243529[_0xa8cd('0x53')]);if(_0x3e57fb&&_0x3e57fb['monitor_format']){logger[_0xa8cd('0x2e')]('['+_0xd4d686[_0xa8cd('0x76')]['toUpperCase']()+']',_0xa8cd('0x6e'));_0xd4d686[_0xa8cd('0x5b')]=util[_0xa8cd('0x37')](_0xa8cd('0x59'),_0x243529[_0xa8cd('0x54')],_0xd4d686['uniqueid'],md5(_0xd4d686[_0xa8cd('0x5a')]));}else{_0xd4d686[_0xa8cd('0x5b')]='';}return getConnection(_0x243529)['then'](function(_0x2d743f){_0x3480bd=_0x2d743f;if(!_['isNil'](_0x50d633)){return getUser(_0x243529,_0x50d633[_0xa8cd('0xd')],_0x3480bd);}else{return getUser(_0x243529,null,_0x3480bd);}})['then'](function(_0x38a712){_0x2a5eef=_0x38a712;logger[_0xa8cd('0x2e')]('The\x20User\x20ID\x20is:',_0x2a5eef['id']);return getEndUser(_0x243529,_0xd4d686[_0xa8cd('0x5c')],_0xd4d686[_0xa8cd('0x77')],_0x3480bd);})[_0xa8cd('0x29')](function(_0x53ee46){_0x21c8e8=_0x53ee46;logger[_0xa8cd('0x2e')](_0xa8cd('0x5d'),_0x21c8e8['id']);return getTicket(_0x243529,_0x2a5eef,_0x21c8e8,_0x33cf89,_0xd4d686,_0x33cf89[_0xa8cd('0x5e')],_0x3480bd,_0xa8cd('0x5f'));})[_0xa8cd('0x29')](function(_0x163d67){_0x5a3ffa=_0x163d67;logger[_0xa8cd('0x2e')](_0xa8cd('0x60'));logger[_0xa8cd('0x2e')](_0xa8cd('0x73'),_0x5a3ffa['id']);return setRelationship(_0x3480bd,_0x2a5eef,_0x5a3ffa,'users');})[_0xa8cd('0x29')](function(){return setRelationship(_0x3480bd,_0x21c8e8,_0x5a3ffa,_0xa8cd('0x62'));})['then'](function(){return getServerInfo(_0x3480bd);})[_0xa8cd('0x68')](function(_0x5920c6){logger[_0xa8cd('0x69')]('['+_0xd4d686[_0xa8cd('0x76')]['toUpperCase']()+']',JSON[_0xa8cd('0x26')](_0x5920c6));});};
\ No newline at end of file
index 6accec2..c40942d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5217=['lodash','getString','length','sortBy','type','push','content','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','variable','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test'];(function(_0x3811e5,_0x5cf3af){var _0x5262c0=function(_0x42b4f1){while(--_0x42b4f1){_0x3811e5['push'](_0x3811e5['shift']());}};_0x5262c0(++_0x5cf3af);}(_0x5217,0x1a0));var _0x7521=function(_0x4f53f5,_0x56a3f2){_0x4f53f5=_0x4f53f5-0x0;var _0x357a4a=_0x5217[_0x4f53f5];return _0x357a4a;};'use strict';var _=require(_0x7521('0x0'));var util=require('util');exports[_0x7521('0x1')]=function(_0x2f5791,_0x58d480,_0x3ef24a){var _0x523797=[];if(_0x2f5791[_0x7521('0x2')]>0x0){var _0x5191bc=_[_0x7521('0x3')](_0x2f5791,['id']);for(var _0x6f9a28=0x0;_0x6f9a28<_0x5191bc[_0x7521('0x2')];_0x6f9a28++){var _0x5b028b=_0x5191bc[_0x6f9a28];if(_0x5b028b[_0x7521('0x4')]==='string'){_0x523797[_0x7521('0x5')](_0x5b028b[_0x7521('0x6')]);}else if(_0x5b028b['type']==='variable'&&_0x5b028b[_0x7521('0x7')]){_0x58d480[_0x5b028b[_0x7521('0x7')]]&&_0x523797[_0x7521('0x5')](_0x58d480[_0x5b028b['variableName']][_0x7521('0x8')]());}else if(_0x5b028b[_0x7521('0x4')]==='customVariable'&&_0x5b028b[_0x7521('0x9')]&&_0x5b028b[_0x7521('0x9')][_0x7521('0xa')]){_0x58d480[_0x5b028b[_0x7521('0x9')][_0x7521('0xa')][_0x7521('0xb')]()]&&_0x523797[_0x7521('0x5')](_0x58d480[_0x5b028b[_0x7521('0x9')][_0x7521('0xa')]['toLowerCase']()][_0x7521('0x8')]());}else if(_0x5b028b['type']===_0x7521('0xc')){if(_0x5b028b[_0x7521('0xd')]===_0x7521('0xe')&&_0x5b028b[_0x7521('0xf')]){_0x523797['push'](util[_0x7521('0x10')](_0x7521('0x11'),_0x5b028b[_0x7521('0xf')],_0x5b028b['keyContent']));}else if(_0x5b028b[_0x7521('0xd')]===_0x7521('0x12')&&_0x5b028b[_0x7521('0x7')]&&_0x5b028b['key']){_0x58d480[_0x5b028b['variableName']]&&_0x523797[_0x7521('0x5')](util[_0x7521('0x10')]('%s:\x20%s',_0x5b028b[_0x7521('0xf')],_0x58d480[_0x5b028b[_0x7521('0x7')]]));}else if(_0x5b028b['keyType']==='customVariable'&&_0x5b028b[_0x7521('0x9')]&&_0x5b028b[_0x7521('0x9')]['name']&&_0x5b028b[_0x7521('0xf')]){_0x58d480[_0x5b028b[_0x7521('0x9')][_0x7521('0xa')][_0x7521('0xb')]()]&&_0x523797['push'](util[_0x7521('0x10')](_0x7521('0x11'),_0x5b028b['key'],_0x58d480[_0x5b028b[_0x7521('0x9')]['name'][_0x7521('0xb')]()]));}}}}return _0x523797[_0x7521('0x13')](_0x3ef24a);};exports[_0x7521('0x14')]=function(_0x6a82a2){var _0x556fc4=_0x6a82a2[_0x7521('0x15')](-0x1);if(_0x556fc4==='/'){_0x6a82a2=_0x6a82a2['substring'](0x0,_0x6a82a2[_0x7521('0x16')](_0x556fc4));}return _0x6a82a2;};exports[_0x7521('0x17')]=function(_0x293704){if(!_[_0x7521('0x18')](_0x293704)&&_0x293704!==''){var _0x5155ef=/^(([^<>()\[\]\\.,;:\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 _0x5155ef[_0x7521('0x19')](String(_0x293704)[_0x7521('0xb')]());}else{return![];}};
\ No newline at end of file
+var _0xde41=['util','getString','sortBy','length','string','push','content','type','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','variable','join','stripTrailingSlash','substring','validateEmail','isNil','test','lodash'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0xde41,0x1ed));var _0x1de4=function(_0x310f8d,_0x1596b8){_0x310f8d=_0x310f8d-0x0;var _0x19469c=_0xde41[_0x310f8d];return _0x19469c;};'use strict';var _=require(_0x1de4('0x0'));var util=require(_0x1de4('0x1'));exports[_0x1de4('0x2')]=function(_0x40afd1,_0x32738c,_0x12ee7c){var _0xa4c899=[];if(_0x40afd1['length']>0x0){var _0x20f65c=_[_0x1de4('0x3')](_0x40afd1,['id']);for(var _0x56db1d=0x0;_0x56db1d<_0x20f65c[_0x1de4('0x4')];_0x56db1d++){var _0x24a4c4=_0x20f65c[_0x56db1d];if(_0x24a4c4['type']===_0x1de4('0x5')){_0xa4c899[_0x1de4('0x6')](_0x24a4c4[_0x1de4('0x7')]);}else if(_0x24a4c4[_0x1de4('0x8')]==='variable'&&_0x24a4c4['variableName']){_0x32738c[_0x24a4c4[_0x1de4('0x9')]]&&_0xa4c899[_0x1de4('0x6')](_0x32738c[_0x24a4c4[_0x1de4('0x9')]][_0x1de4('0xa')]());}else if(_0x24a4c4[_0x1de4('0x8')]==='customVariable'&&_0x24a4c4[_0x1de4('0xb')]&&_0x24a4c4[_0x1de4('0xb')][_0x1de4('0xc')]){_0x32738c[_0x24a4c4[_0x1de4('0xb')]['name'][_0x1de4('0xd')]()]&&_0xa4c899[_0x1de4('0x6')](_0x32738c[_0x24a4c4[_0x1de4('0xb')][_0x1de4('0xc')][_0x1de4('0xd')]()][_0x1de4('0xa')]());}else if(_0x24a4c4[_0x1de4('0x8')]===_0x1de4('0xe')){if(_0x24a4c4[_0x1de4('0xf')]===_0x1de4('0x5')&&_0x24a4c4[_0x1de4('0x10')]){_0xa4c899[_0x1de4('0x6')](util[_0x1de4('0x11')](_0x1de4('0x12'),_0x24a4c4[_0x1de4('0x10')],_0x24a4c4['keyContent']));}else if(_0x24a4c4['keyType']===_0x1de4('0x13')&&_0x24a4c4[_0x1de4('0x9')]&&_0x24a4c4[_0x1de4('0x10')]){_0x32738c[_0x24a4c4[_0x1de4('0x9')]]&&_0xa4c899['push'](util[_0x1de4('0x11')](_0x1de4('0x12'),_0x24a4c4['key'],_0x32738c[_0x24a4c4[_0x1de4('0x9')]]));}else if(_0x24a4c4[_0x1de4('0xf')]==='customVariable'&&_0x24a4c4[_0x1de4('0xb')]&&_0x24a4c4[_0x1de4('0xb')][_0x1de4('0xc')]&&_0x24a4c4[_0x1de4('0x10')]){_0x32738c[_0x24a4c4[_0x1de4('0xb')][_0x1de4('0xc')][_0x1de4('0xd')]()]&&_0xa4c899['push'](util[_0x1de4('0x11')](_0x1de4('0x12'),_0x24a4c4[_0x1de4('0x10')],_0x32738c[_0x24a4c4[_0x1de4('0xb')][_0x1de4('0xc')][_0x1de4('0xd')]()]));}}}}return _0xa4c899[_0x1de4('0x14')](_0x12ee7c);};exports[_0x1de4('0x15')]=function(_0x3182aa){var _0x42bb7d=_0x3182aa['slice'](-0x1);if(_0x42bb7d==='/'){_0x3182aa=_0x3182aa[_0x1de4('0x16')](0x0,_0x3182aa['lastIndexOf'](_0x42bb7d));}return _0x3182aa;};exports[_0x1de4('0x17')]=function(_0x328e92){if(!_[_0x1de4('0x18')](_0x328e92)&&_0x328e92!==''){var _0x4633cd=/^(([^<>()\[\]\\.,;:\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 _0x4633cd[_0x1de4('0x19')](String(_0x328e92)[_0x1de4('0xd')]());}else{return![];}};
\ No newline at end of file
index c7e2b59..174c375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x151a93,_0x55d68e){var _0x1c45e4=function(_0x453ad2){while(--_0x453ad2){_0x151a93['push'](_0x151a93['shift']());}};_0x1c45e4(++_0x55d68e);}(_0xe706,0xa3));var _0x6e70=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0xe706[_0x408b34];return _0x1182aa;};'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
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index 327385a..9fd8e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2ed=['%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','then','ticket','validateEmail','%s/search.json','count','Agent\x20found!','find','results','agent','user','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','%s/users.json','Caller\x20-\x20%s','authType','password','%s/token:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','includes','string','nameField','customField','toLowerCase','picklist','type','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0xb2ed,0x1c3));var _0xdb2e=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0xb2ed[_0x20aae1];return _0x510601;};'use strict';var _=require(_0xdb2e('0x0'));var rp=require(_0xdb2e('0x1'));var md5=require(_0xdb2e('0x2'));var util=require(_0xdb2e('0x3'));var Redis=require(_0xdb2e('0x4'));var intUtil=require('./util');var config=require(_0xdb2e('0x5'));var logger=require(_0xdb2e('0x6'))('zendesk');config[_0xdb2e('0x7')]=_[_0xdb2e('0x8')](config[_0xdb2e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xdb2e('0x9'))(new Redis(config[_0xdb2e('0x7')]));function emit(_0x373873,_0x261c70,_0x21504e){io['to'](_0x373873)[_0xdb2e('0xa')](_0x261c70,_0x21504e);}var headers={'Content-Type':'application/json','Accept':_0xdb2e('0xb')};function getTicket(_0x4ca89e,_0x2d909a,_0x36bdda,_0x2e76c6,_0x175258){logger[_0xdb2e('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xdb2e('0xd')](_0xdb2e('0xe'),_0x4ca89e[_0xdb2e('0xf')]),'method':_0xdb2e('0x10'),'body':{'ticket':_[_0xdb2e('0x11')]({'requester_id':_0x36bdda['id'],'submitter_id':_0x2d909a?_0x2d909a['id']:undefined,'assignee_id':_0x2d909a?_0x2d909a['id']:undefined,'tags':getTags(_0x2e76c6['Tags'],_0xdb2e('0x12')),'subject':intUtil[_0xdb2e('0x13')](_0x2e76c6[_0xdb2e('0x14')],_0x175258,'\x20'),'description':intUtil[_0xdb2e('0x13')](_0x2e76c6[_0xdb2e('0x15')],_0x175258,'\x0a'),'comment':{'public':![],'body':intUtil[_0xdb2e('0x13')](_0x2e76c6[_0xdb2e('0x15')],_0x175258,'\x0a')}},getCustomFields(_0x2e76c6['Fields'],_0x175258))}})[_0xdb2e('0x16')](function(_0x218978){logger[_0xdb2e('0xc')]('Ticket\x20created!');return _0x218978[_0xdb2e('0x17')];});}function getUser(_0x2135dd,_0x5ed866){if(intUtil[_0xdb2e('0x18')](_0x5ed866)){logger['info']('Getting\x20agent\x20with\x20email',_0x5ed866);return request({'uri':util['format'](_0xdb2e('0x19'),_0x2135dd[_0xdb2e('0xf')]),'qs':{'query':util[_0xdb2e('0xd')]('type:user\x20role:agent\x20email:%s',_0x5ed866)}})[_0xdb2e('0x16')](function(_0x33a806){if(_0x33a806[_0xdb2e('0x1a')]){logger[_0xdb2e('0xc')](_0xdb2e('0x1b'));return _[_0xdb2e('0x1c')](_0x33a806[_0xdb2e('0x1d')],{'email':_0x5ed866,'role':_0xdb2e('0x1e')});}else{logger[_0xdb2e('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdb2e('0xd')]('%s/users/me.json',_0x2135dd[_0xdb2e('0xf')])})[_0xdb2e('0x16')](function(_0x17aef3){logger[_0xdb2e('0xc')]('Admin\x20account\x20selected.');return _0x17aef3[_0xdb2e('0x1f')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdb2e('0xd')](_0xdb2e('0x20'),_0x2135dd[_0xdb2e('0xf')])})[_0xdb2e('0x16')](function(_0x33f434){logger[_0xdb2e('0xc')](_0xdb2e('0x21'));return _0x33f434[_0xdb2e('0x1f')];});}}function getEndUser(_0xce1e07,_0x93672a,_0x38242d){logger[_0xdb2e('0xc')](_0xdb2e('0x22'),_0x38242d);return request({'uri':util[_0xdb2e('0xd')](_0xdb2e('0x19'),_0xce1e07['remoteUri']),'qs':{'query':util[_0xdb2e('0xd')](_0xdb2e('0x23'),_0x38242d)}})[_0xdb2e('0x16')](function(_0x2398be){var _0x167ea0;if(_0x2398be[_0xdb2e('0x1d')][_0xdb2e('0x24')]){_0x2398be[_0xdb2e('0x1d')]=_[_0xdb2e('0x25')](_0x2398be[_0xdb2e('0x1d')],{'suspended':![],'role':_0xdb2e('0x26')});if(_0x2398be[_0xdb2e('0x1d')][_0xdb2e('0x24')]){_0x167ea0=_[_0xdb2e('0x27')](_0x2398be[_0xdb2e('0x1d')]);}}if(_0x167ea0){logger[_0xdb2e('0xc')]('Enduser\x20found!');return _0x167ea0;}else{logger[_0xdb2e('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xdb2e('0xd')](_0xdb2e('0x28'),_0xce1e07[_0xdb2e('0xf')]),'method':_0xdb2e('0x10'),'body':{'user':{'role':'end-user','name':util['format'](_0xdb2e('0x29'),_0x93672a||_0x38242d),'phone':_0x38242d}}})['then'](function(_0x1bae6e){logger[_0xdb2e('0xc')]('Enduser\x20created.');return _0x1bae6e[_0xdb2e('0x1f')];});}});}function getAuth(_0x2807f0){var _0x17ad21;if(_0x2807f0[_0xdb2e('0x2a')]===_0xdb2e('0x2b')){_0x17ad21=util[_0xdb2e('0xd')]('%s:%s',_0x2807f0['username'],_0x2807f0['password']);}else if(_0x2807f0['authType']==='token'){_0x17ad21=util[_0xdb2e('0xd')](_0xdb2e('0x2c'),_0x2807f0[_0xdb2e('0x2d')],_0x2807f0[_0xdb2e('0x2e')]);}return util[_0xdb2e('0xd')](_0xdb2e('0x2f'),new Buffer(_0x17ad21)[_0xdb2e('0x30')](_0xdb2e('0x31')));}function request(_0x5870a2){logger[_0xdb2e('0x32')](_0xdb2e('0x33'),JSON[_0xdb2e('0x34')](_0x5870a2));return rp(_['defaults'](_0x5870a2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x544ab3,_0x14c493){var _0x284471=[];if(_0x544ab3&&_0x544ab3[_0xdb2e('0x24')]>0x0){_0x284471=_[_0xdb2e('0x35')](_0x544ab3,_0x14c493);}return _0x284471;}function getCustomFields(_0x28c71f,_0x3e6fd5){var _0x335698=[];var _0x51a31f={'custom_fields':[]};if(_0x28c71f[_0xdb2e('0x24')]>0x0){_['forEach'](_0x28c71f,function(_0x48e2ff){if(_[_0xdb2e('0x36')]([_0xdb2e('0x37'),'picklist'],_0x48e2ff['type'])&&_0x48e2ff[_0xdb2e('0x38')]&&!_0x48e2ff[_0xdb2e('0x39')]){_0x51a31f[_0x48e2ff[_0xdb2e('0x38')][_0xdb2e('0x3a')]()]=_0x48e2ff['content'][_0xdb2e('0x30')]();}else if(_[_0xdb2e('0x36')](['string',_0xdb2e('0x3b')],_0x48e2ff[_0xdb2e('0x3c')])&&_0x48e2ff[_0xdb2e('0x3d')]&&_0x48e2ff['customField']){_0x51a31f[_0xdb2e('0x3e')][_0xdb2e('0x3f')]({'id':_0x48e2ff[_0xdb2e('0x3d')],'value':_0x48e2ff[_0xdb2e('0x40')]['toString']()});}else if(_0x48e2ff[_0xdb2e('0x3c')]===_0xdb2e('0x41')&&_0x48e2ff['variableName']&&_0x48e2ff[_0xdb2e('0x3d')]&&_0x48e2ff['customField']){_0x3e6fd5[_0x48e2ff[_0xdb2e('0x42')]]&&_0x51a31f[_0xdb2e('0x3e')][_0xdb2e('0x3f')]({'id':_0x48e2ff['idField'],'value':_0x3e6fd5[_0x48e2ff['variableName']][_0xdb2e('0x30')]()});}else if(_0x48e2ff[_0xdb2e('0x3c')]===_0xdb2e('0x43')&&_0x48e2ff[_0xdb2e('0x44')]&&_0x48e2ff['Variable']['name']&&_0x48e2ff['idField']&&_0x48e2ff[_0xdb2e('0x39')]){_0x3e6fd5[_0x48e2ff[_0xdb2e('0x44')][_0xdb2e('0x12')][_0xdb2e('0x3a')]()]&&_0x51a31f[_0xdb2e('0x3e')][_0xdb2e('0x3f')]({'id':_0x48e2ff['idField'],'value':_0x3e6fd5[_0x48e2ff[_0xdb2e('0x44')][_0xdb2e('0x12')][_0xdb2e('0x3a')]()][_0xdb2e('0x30')]()});}});}return _0x51a31f;}exports[_0xdb2e('0x45')]=function(_0x338868,_0xd17a2c,_0x2686f3,_0xde1d99,_0xa8b3f1,_0x4ee0e9){var _0x308ee4,_0x4cbb32;_0x4ee0e9[_0xdb2e('0xf')]=intUtil['stripTrailingSlash'](_0x4ee0e9['remoteUri']);_0x4ee0e9['serverUrl']=intUtil[_0xdb2e('0x46')](_0x4ee0e9[_0xdb2e('0x47')]);if(_0xa8b3f1&&_0xa8b3f1[_0xdb2e('0x48')]){logger['info'](_0xdb2e('0x49'),_0xdb2e('0x4a'));_0xd17a2c[_0xdb2e('0x4b')]=util[_0xdb2e('0xd')](_0xdb2e('0x4c'),_0x4ee0e9[_0xdb2e('0x47')],_0xd17a2c['uniqueid'],md5(_0xd17a2c[_0xdb2e('0x4d')]));}else{_0xd17a2c[_0xdb2e('0x4b')]='';}headers[_0xdb2e('0x4e')]=getAuth(_0x4ee0e9);return getUser(_0x4ee0e9,_0xde1d99[_0xdb2e('0x4f')])[_0xdb2e('0x16')](function(_0x9e2583){_0x308ee4=_0x9e2583;logger[_0xdb2e('0xc')](_0xdb2e('0x50'),_0x308ee4['id']);return getEndUser(_0x4ee0e9,_0xd17a2c['calleridname'],_0xd17a2c['calleridnum']);})[_0xdb2e('0x16')](function(_0x179657){_0x4cbb32=_0x179657;logger['info'](_0xdb2e('0x51'),_0x4cbb32['id']);return getTicket(_0x4ee0e9,_0x308ee4,_0x4cbb32,_0x2686f3,_0xd17a2c);})['then'](function(_0x4c7183){if(_0x4c7183){logger[_0xdb2e('0xc')](_0xdb2e('0x52'),_0x4c7183['id']);switch(_0x4ee0e9[_0xdb2e('0x3c')]){case _0xdb2e('0x53'):logger[_0xdb2e('0xc')](_0xdb2e('0x49'),_0xdb2e('0x54'));return request({'uri':util[_0xdb2e('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4ee0e9[_0xdb2e('0xf')],_0x308ee4['id'],_0x4c7183['id']),'method':_0xdb2e('0x10')});case _0xdb2e('0x55'):logger[_0xdb2e('0xc')](_0xdb2e('0x49'),_0xdb2e('0x56'));emit(util[_0xdb2e('0xd')](_0xdb2e('0x57'),_0xde1d99[_0xdb2e('0x12')]),_0xdb2e('0x58'),{'uri':util[_0xdb2e('0xd')](_0xdb2e('0x59'),_0x4ee0e9[_0xdb2e('0xf')][_0xdb2e('0x5a')](_0xdb2e('0x5b'),''),_0x4c7183['id'])});break;default:logger[_0xdb2e('0x5c')](_0xdb2e('0x49'),_0xdb2e('0x5d'));}}})[_0xdb2e('0x5e')](function(_0x2c07bb){logger['error'](_0xdb2e('0x5f'),util[_0xdb2e('0x60')](_0x2c07bb,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x515797,_0x244377,_0x4f4f7a,_0x564da0,_0x9a4acb,_0x6e0d34,_0x761e66){var _0x16a8fa,_0x5d0f98;_0x6e0d34[_0xdb2e('0xf')]=intUtil['stripTrailingSlash'](_0x6e0d34[_0xdb2e('0xf')]);_0x6e0d34[_0xdb2e('0x47')]=intUtil[_0xdb2e('0x46')](_0x6e0d34[_0xdb2e('0x47')]);if(_0x761e66&&_0x761e66[_0xdb2e('0x61')]&&_0x761e66[_0xdb2e('0x61')]!=='none'){logger['info']('[OUTBOUND]',_0xdb2e('0x4a'));_0x244377[_0xdb2e('0x4b')]=util[_0xdb2e('0xd')](_0xdb2e('0x4c'),_0x6e0d34[_0xdb2e('0x47')],_0x244377[_0xdb2e('0x4d')],md5(_0x244377[_0xdb2e('0x4d')]));}headers[_0xdb2e('0x4e')]=getAuth(_0x6e0d34);return getUser(_0x6e0d34,_0x564da0[_0xdb2e('0x4f')])[_0xdb2e('0x16')](function(_0x4d9256){_0x16a8fa=_0x4d9256;logger[_0xdb2e('0xc')](_0xdb2e('0x50'),_0x16a8fa['id']);return getEndUser(_0x6e0d34,_0x244377[_0xdb2e('0x62')],_0x244377[_0xdb2e('0x63')]);})[_0xdb2e('0x16')](function(_0x57963d){_0x5d0f98=_0x57963d;logger[_0xdb2e('0xc')](_0xdb2e('0x51'),_0x5d0f98['id']);return getTicket(_0x6e0d34,_0x16a8fa,_0x5d0f98,_0x4f4f7a,_0x244377);})[_0xdb2e('0x16')](function(_0x3590a2){if(_0x3590a2){logger['info'](_0xdb2e('0x52'),_0x3590a2['id']);switch(_0x6e0d34[_0xdb2e('0x3c')]){case _0xdb2e('0x53'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xdb2e('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x6e0d34['remoteUri'],_0x16a8fa['id'],_0x3590a2['id']),'method':_0xdb2e('0x10')});case _0xdb2e('0x55'):logger[_0xdb2e('0xc')]('[OUTBOUND]',_0xdb2e('0x56'));emit(util[_0xdb2e('0xd')](_0xdb2e('0x57'),_0x564da0[_0xdb2e('0x12')]),_0xdb2e('0x58'),{'uri':util[_0xdb2e('0xd')](_0xdb2e('0x59'),_0x6e0d34[_0xdb2e('0xf')][_0xdb2e('0x5a')](_0xdb2e('0x5b'),''),_0x3590a2['id'])});break;default:logger['error'](_0xdb2e('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdb2e('0x5e')](function(_0x5d50b7){logger[_0xdb2e('0x5c')](_0xdb2e('0x65'),util['inspect'](_0x5d50b7,{'showHidden':!![],'depth':null}));});};exports[_0xdb2e('0x66')]=function(_0x29e365,_0x31c940,_0x26e144,_0x227385,_0x6fb026,_0x3383dc){var _0x5d0a4f,_0x1ebda5;_0x3383dc[_0xdb2e('0xf')]=intUtil[_0xdb2e('0x46')](_0x3383dc['remoteUri']);_0x3383dc[_0xdb2e('0x47')]=intUtil[_0xdb2e('0x46')](_0x3383dc[_0xdb2e('0x47')]);if(_0x6fb026&&_0x6fb026['monitor_format']){logger[_0xdb2e('0xc')]('['+_0x31c940[_0xdb2e('0x67')][_0xdb2e('0x68')]()+']',_0xdb2e('0x4a'));_0x31c940[_0xdb2e('0x4b')]=util[_0xdb2e('0xd')](_0xdb2e('0x4c'),_0x3383dc[_0xdb2e('0x47')],_0x31c940[_0xdb2e('0x4d')],md5(_0x31c940['uniqueid']));}else{_0x31c940[_0xdb2e('0x4b')]='';}headers[_0xdb2e('0x4e')]=getAuth(_0x3383dc);return getUser(_0x3383dc)['then'](function(_0xe7dda){_0x5d0a4f=_0xe7dda;logger[_0xdb2e('0xc')]('The\x20User\x20ID\x20is:',_0x5d0a4f['id']);return getEndUser(_0x3383dc,_0x31c940[_0xdb2e('0x69')],_0x31c940[_0xdb2e('0x6a')]);})['then'](function(_0x5f5050){_0x1ebda5=_0x5f5050;logger[_0xdb2e('0xc')](_0xdb2e('0x51'),_0x1ebda5['id']);return getTicket(_0x3383dc,_0x5d0a4f,_0x1ebda5,_0x26e144,_0x31c940);})[_0xdb2e('0x16')](function(_0x3a9a66){if(_0x3a9a66){logger[_0xdb2e('0xc')](_0xdb2e('0x52'),_0x3a9a66['id']);}})['catch'](function(_0x543775){logger[_0xdb2e('0x5c')]('['+_0x31c940[_0xdb2e('0x67')][_0xdb2e('0x68')]()+']'+_0xdb2e('0x6b'),util[_0xdb2e('0x60')](_0x543775,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc675=['redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','password','%s/token:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger'];(function(_0x38407e,_0x3cc58f){var _0x960322=function(_0x3a9cf1){while(--_0x3a9cf1){_0x38407e['push'](_0x38407e['shift']());}};_0x960322(++_0x3cc58f);}(_0xc675,0xdf));var _0x5c67=function(_0x1ef82b,_0x37041e){_0x1ef82b=_0x1ef82b-0x0;var _0x4a96d0=_0xc675[_0x1ef82b];return _0x4a96d0;};'use strict';var _=require(_0x5c67('0x0'));var rp=require(_0x5c67('0x1'));var md5=require(_0x5c67('0x2'));var util=require('util');var Redis=require(_0x5c67('0x3'));var intUtil=require(_0x5c67('0x4'));var config=require(_0x5c67('0x5'));var logger=require(_0x5c67('0x6'))('zendesk');config[_0x5c67('0x7')]=_[_0x5c67('0x8')](config[_0x5c67('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5c67('0x9'))(new Redis(config[_0x5c67('0x7')]));function emit(_0x3eaaf0,_0x45a8e3,_0x40de2d){io['to'](_0x3eaaf0)['emit'](_0x45a8e3,_0x40de2d);}var headers={'Content-Type':_0x5c67('0xa'),'Accept':_0x5c67('0xa')};function getTicket(_0x5a8ad1,_0x1cbf93,_0x263dde,_0x3919bd,_0x3e2b1f){logger['info'](_0x5c67('0xb'));return request({'uri':util[_0x5c67('0xc')](_0x5c67('0xd'),_0x5a8ad1['remoteUri']),'method':_0x5c67('0xe'),'body':{'ticket':_[_0x5c67('0xf')]({'requester_id':_0x263dde['id'],'submitter_id':_0x1cbf93?_0x1cbf93['id']:undefined,'assignee_id':_0x1cbf93?_0x1cbf93['id']:undefined,'tags':getTags(_0x3919bd[_0x5c67('0x10')],_0x5c67('0x11')),'subject':intUtil[_0x5c67('0x12')](_0x3919bd['Subjects'],_0x3e2b1f,'\x20'),'description':intUtil[_0x5c67('0x12')](_0x3919bd[_0x5c67('0x13')],_0x3e2b1f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5c67('0x12')](_0x3919bd[_0x5c67('0x13')],_0x3e2b1f,'\x0a')}},getCustomFields(_0x3919bd[_0x5c67('0x14')],_0x3e2b1f))}})[_0x5c67('0x15')](function(_0x3e8be7){logger[_0x5c67('0x16')](_0x5c67('0x17'));return _0x3e8be7[_0x5c67('0x18')];});}function getUser(_0x2206b5,_0x49f267){if(intUtil[_0x5c67('0x19')](_0x49f267)){logger[_0x5c67('0x16')](_0x5c67('0x1a'),_0x49f267);return request({'uri':util[_0x5c67('0xc')]('%s/search.json',_0x2206b5[_0x5c67('0x1b')]),'qs':{'query':util[_0x5c67('0xc')]('type:user\x20role:agent\x20email:%s',_0x49f267)}})[_0x5c67('0x15')](function(_0x169843){if(_0x169843['count']){logger[_0x5c67('0x16')]('Agent\x20found!');return _[_0x5c67('0x1c')](_0x169843[_0x5c67('0x1d')],{'email':_0x49f267,'role':_0x5c67('0x1e')});}else{logger[_0x5c67('0x16')](_0x5c67('0x1f'));return request({'uri':util[_0x5c67('0xc')]('%s/users/me.json',_0x2206b5[_0x5c67('0x1b')])})[_0x5c67('0x15')](function(_0x2c5457){logger[_0x5c67('0x16')](_0x5c67('0x20'));return _0x2c5457[_0x5c67('0x21')];});}});}else{logger[_0x5c67('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x5c67('0x22'),_0x2206b5[_0x5c67('0x1b')])})[_0x5c67('0x15')](function(_0x1b3289){logger[_0x5c67('0x16')](_0x5c67('0x20'));return _0x1b3289[_0x5c67('0x21')];});}}function getEndUser(_0x48e34b,_0x37d911,_0x5ab5df){logger[_0x5c67('0x16')](_0x5c67('0x23'),_0x5ab5df);return request({'uri':util['format'](_0x5c67('0x24'),_0x48e34b[_0x5c67('0x1b')]),'qs':{'query':util['format'](_0x5c67('0x25'),_0x5ab5df)}})[_0x5c67('0x15')](function(_0x2f39f8){var _0x39f754;if(_0x2f39f8['results'][_0x5c67('0x26')]){_0x2f39f8[_0x5c67('0x1d')]=_[_0x5c67('0x27')](_0x2f39f8[_0x5c67('0x1d')],{'suspended':![],'role':_0x5c67('0x28')});if(_0x2f39f8['results']['length']){_0x39f754=_[_0x5c67('0x29')](_0x2f39f8['results']);}}if(_0x39f754){logger[_0x5c67('0x16')](_0x5c67('0x2a'));return _0x39f754;}else{logger[_0x5c67('0x16')](_0x5c67('0x2b'));return request({'uri':util[_0x5c67('0xc')](_0x5c67('0x2c'),_0x48e34b['remoteUri']),'method':_0x5c67('0xe'),'body':{'user':{'role':'end-user','name':util['format'](_0x5c67('0x2d'),_0x37d911||_0x5ab5df),'phone':_0x5ab5df}}})[_0x5c67('0x15')](function(_0x54a451){logger['info'](_0x5c67('0x2e'));return _0x54a451['user'];});}});}function getAuth(_0x5d7fc2){var _0x5abdce;if(_0x5d7fc2[_0x5c67('0x2f')]==='password'){_0x5abdce=util[_0x5c67('0xc')](_0x5c67('0x30'),_0x5d7fc2['username'],_0x5d7fc2[_0x5c67('0x31')]);}else if(_0x5d7fc2[_0x5c67('0x2f')]==='token'){_0x5abdce=util[_0x5c67('0xc')](_0x5c67('0x32'),_0x5d7fc2[_0x5c67('0x33')],_0x5d7fc2[_0x5c67('0x34')]);}return util['format'](_0x5c67('0x35'),new Buffer(_0x5abdce)[_0x5c67('0x36')](_0x5c67('0x37')));}function request(_0x4c5d1e){logger[_0x5c67('0x38')](_0x5c67('0x39'),JSON[_0x5c67('0x3a')](_0x4c5d1e));return rp(_[_0x5c67('0x8')](_0x4c5d1e,{'method':_0x5c67('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x3a043a,_0x180723){var _0x291be0=[];if(_0x3a043a&&_0x3a043a[_0x5c67('0x26')]>0x0){_0x291be0=_['map'](_0x3a043a,_0x180723);}return _0x291be0;}function getCustomFields(_0x4ea973,_0x405794){var _0x4537e6=[];var _0x183555={'custom_fields':[]};if(_0x4ea973[_0x5c67('0x26')]>0x0){_[_0x5c67('0x3c')](_0x4ea973,function(_0xb7c8b3){if(_[_0x5c67('0x3d')](['string',_0x5c67('0x3e')],_0xb7c8b3[_0x5c67('0x3f')])&&_0xb7c8b3[_0x5c67('0x40')]&&!_0xb7c8b3[_0x5c67('0x41')]){_0x183555[_0xb7c8b3[_0x5c67('0x40')][_0x5c67('0x42')]()]=_0xb7c8b3[_0x5c67('0x43')][_0x5c67('0x36')]();}else if(_['includes'](['string',_0x5c67('0x3e')],_0xb7c8b3[_0x5c67('0x3f')])&&_0xb7c8b3[_0x5c67('0x44')]&&_0xb7c8b3[_0x5c67('0x41')]){_0x183555[_0x5c67('0x45')][_0x5c67('0x46')]({'id':_0xb7c8b3[_0x5c67('0x44')],'value':_0xb7c8b3[_0x5c67('0x43')][_0x5c67('0x36')]()});}else if(_0xb7c8b3[_0x5c67('0x3f')]===_0x5c67('0x47')&&_0xb7c8b3[_0x5c67('0x48')]&&_0xb7c8b3[_0x5c67('0x44')]&&_0xb7c8b3[_0x5c67('0x41')]){_0x405794[_0xb7c8b3['variableName']]&&_0x183555[_0x5c67('0x45')][_0x5c67('0x46')]({'id':_0xb7c8b3['idField'],'value':_0x405794[_0xb7c8b3[_0x5c67('0x48')]][_0x5c67('0x36')]()});}else if(_0xb7c8b3[_0x5c67('0x3f')]===_0x5c67('0x49')&&_0xb7c8b3['Variable']&&_0xb7c8b3[_0x5c67('0x4a')][_0x5c67('0x11')]&&_0xb7c8b3['idField']&&_0xb7c8b3[_0x5c67('0x41')]){_0x405794[_0xb7c8b3['Variable']['name'][_0x5c67('0x42')]()]&&_0x183555[_0x5c67('0x45')][_0x5c67('0x46')]({'id':_0xb7c8b3['idField'],'value':_0x405794[_0xb7c8b3[_0x5c67('0x4a')]['name'][_0x5c67('0x42')]()][_0x5c67('0x36')]()});}});}return _0x183555;}exports[_0x5c67('0x4b')]=function(_0x2d889a,_0x99adc2,_0x28e400,_0x3f3ebb,_0x39021b,_0x4f1929){var _0x570a3f,_0x395d7f;_0x4f1929[_0x5c67('0x1b')]=intUtil[_0x5c67('0x4c')](_0x4f1929[_0x5c67('0x1b')]);_0x4f1929[_0x5c67('0x4d')]=intUtil[_0x5c67('0x4c')](_0x4f1929['serverUrl']);if(_0x39021b&&_0x39021b[_0x5c67('0x4e')]){logger['info'](_0x5c67('0x4f'),'Recording\x20is\x20enabled!');_0x99adc2[_0x5c67('0x50')]=util[_0x5c67('0xc')](_0x5c67('0x51'),_0x4f1929[_0x5c67('0x4d')],_0x99adc2[_0x5c67('0x52')],md5(_0x99adc2[_0x5c67('0x52')]));}else{_0x99adc2[_0x5c67('0x50')]='';}headers['Authorization']=getAuth(_0x4f1929);return getUser(_0x4f1929,_0x3f3ebb[_0x5c67('0x53')])[_0x5c67('0x15')](function(_0x50a327){_0x570a3f=_0x50a327;logger[_0x5c67('0x16')](_0x5c67('0x54'),_0x570a3f['id']);return getEndUser(_0x4f1929,_0x99adc2[_0x5c67('0x55')],_0x99adc2['calleridnum']);})[_0x5c67('0x15')](function(_0x406cec){_0x395d7f=_0x406cec;logger['info'](_0x5c67('0x56'),_0x395d7f['id']);return getTicket(_0x4f1929,_0x570a3f,_0x395d7f,_0x28e400,_0x99adc2);})[_0x5c67('0x15')](function(_0x21cca5){if(_0x21cca5){logger[_0x5c67('0x16')]('The\x20Ticket\x20ID\x20is:',_0x21cca5['id']);switch(_0x4f1929[_0x5c67('0x3f')]){case _0x5c67('0x57'):logger[_0x5c67('0x16')](_0x5c67('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5c67('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4f1929[_0x5c67('0x1b')],_0x570a3f['id'],_0x21cca5['id']),'method':'POST'});case'newTab':logger[_0x5c67('0x16')](_0x5c67('0x4f'),_0x5c67('0x58'));emit(util[_0x5c67('0xc')](_0x5c67('0x59'),_0x3f3ebb[_0x5c67('0x11')]),_0x5c67('0x5a'),{'uri':util[_0x5c67('0xc')]('%s/agent/tickets/%s',_0x4f1929[_0x5c67('0x1b')][_0x5c67('0x5b')]('/api/v2',''),_0x21cca5['id'])});break;default:logger[_0x5c67('0x5c')](_0x5c67('0x4f'),_0x5c67('0x5d'));}}})[_0x5c67('0x5e')](function(_0x494cdf){logger[_0x5c67('0x5c')](_0x5c67('0x5f'),util['inspect'](_0x494cdf,{'showHidden':!![],'depth':null}));});};exports[_0x5c67('0x60')]=function(_0x470e91,_0x143f4a,_0x30f82c,_0x2a7087,_0x537ba6,_0x24da96,_0x18c8bf){var _0xceaa34,_0x4b926f;_0x24da96[_0x5c67('0x1b')]=intUtil[_0x5c67('0x4c')](_0x24da96[_0x5c67('0x1b')]);_0x24da96['serverUrl']=intUtil['stripTrailingSlash'](_0x24da96[_0x5c67('0x4d')]);if(_0x18c8bf&&_0x18c8bf[_0x5c67('0x61')]&&_0x18c8bf[_0x5c67('0x61')]!==_0x5c67('0x62')){logger[_0x5c67('0x16')](_0x5c67('0x63'),_0x5c67('0x64'));_0x143f4a[_0x5c67('0x50')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24da96['serverUrl'],_0x143f4a['uniqueid'],md5(_0x143f4a['uniqueid']));}headers[_0x5c67('0x65')]=getAuth(_0x24da96);return getUser(_0x24da96,_0x2a7087[_0x5c67('0x53')])[_0x5c67('0x15')](function(_0xac74fe){_0xceaa34=_0xac74fe;logger['info'](_0x5c67('0x54'),_0xceaa34['id']);return getEndUser(_0x24da96,_0x143f4a[_0x5c67('0x66')],_0x143f4a[_0x5c67('0x67')]);})[_0x5c67('0x15')](function(_0x3917c0){_0x4b926f=_0x3917c0;logger[_0x5c67('0x16')](_0x5c67('0x56'),_0x4b926f['id']);return getTicket(_0x24da96,_0xceaa34,_0x4b926f,_0x30f82c,_0x143f4a);})[_0x5c67('0x15')](function(_0x51b529){if(_0x51b529){logger[_0x5c67('0x16')](_0x5c67('0x68'),_0x51b529['id']);switch(_0x24da96[_0x5c67('0x3f')]){case _0x5c67('0x57'):logger[_0x5c67('0x16')](_0x5c67('0x63'),_0x5c67('0x69'));return request({'uri':util['format'](_0x5c67('0x6a'),_0x24da96[_0x5c67('0x1b')],_0xceaa34['id'],_0x51b529['id']),'method':_0x5c67('0xe')});case _0x5c67('0x6b'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5c67('0xc')](_0x5c67('0x59'),_0x2a7087[_0x5c67('0x11')]),_0x5c67('0x5a'),{'uri':util['format']('%s/agent/tickets/%s',_0x24da96[_0x5c67('0x1b')]['replace'](_0x5c67('0x6c'),''),_0x51b529['id'])});break;default:logger[_0x5c67('0x5c')](_0x5c67('0x63'),_0x5c67('0x5d'));}}})[_0x5c67('0x5e')](function(_0xe060d7){logger[_0x5c67('0x5c')](_0x5c67('0x6d'),util[_0x5c67('0x6e')](_0xe060d7,{'showHidden':!![],'depth':null}));});};exports[_0x5c67('0x6f')]=function(_0x28d699,_0x189eeb,_0x524c09,_0x17a3f9,_0x541f11,_0x34ddf8){var _0x4c30c0,_0x15cf57;_0x34ddf8['remoteUri']=intUtil['stripTrailingSlash'](_0x34ddf8['remoteUri']);_0x34ddf8[_0x5c67('0x4d')]=intUtil[_0x5c67('0x4c')](_0x34ddf8[_0x5c67('0x4d')]);if(_0x541f11&&_0x541f11[_0x5c67('0x4e')]){logger['info']('['+_0x189eeb[_0x5c67('0x70')]['toUpperCase']()+']',_0x5c67('0x64'));_0x189eeb['recordingURL']=util[_0x5c67('0xc')](_0x5c67('0x51'),_0x34ddf8[_0x5c67('0x4d')],_0x189eeb[_0x5c67('0x52')],md5(_0x189eeb[_0x5c67('0x52')]));}else{_0x189eeb[_0x5c67('0x50')]='';}headers[_0x5c67('0x65')]=getAuth(_0x34ddf8);return getUser(_0x34ddf8)[_0x5c67('0x15')](function(_0x3803b5){_0x4c30c0=_0x3803b5;logger[_0x5c67('0x16')]('The\x20User\x20ID\x20is:',_0x4c30c0['id']);return getEndUser(_0x34ddf8,_0x189eeb[_0x5c67('0x55')],_0x189eeb[_0x5c67('0x71')]);})['then'](function(_0x42d3ce){_0x15cf57=_0x42d3ce;logger[_0x5c67('0x16')](_0x5c67('0x56'),_0x15cf57['id']);return getTicket(_0x34ddf8,_0x4c30c0,_0x15cf57,_0x524c09,_0x189eeb);})[_0x5c67('0x15')](function(_0x1db60c){if(_0x1db60c){logger['info'](_0x5c67('0x68'),_0x1db60c['id']);}})[_0x5c67('0x5e')](function(_0x2ceac9){logger['error']('['+_0x189eeb[_0x5c67('0x70')]['toUpperCase']()+']'+_0x5c67('0x72'),util[_0x5c67('0x6e')](_0x2ceac9,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 2179c25..b41a710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe295=['Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','calleridname','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','uri','Creating\x20new\x20call...','Owner','Subjects','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','talktime','format','answertime','endtime','Call_Duration','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Inbound','merge','Fields','err','host','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:'];(function(_0x4d93c9,_0x4775ae){var _0x48536d=function(_0x4d1e28){while(--_0x4d1e28){_0x4d93c9['push'](_0x4d93c9['shift']());}};_0x48536d(++_0x4775ae);}(_0xe295,0x141));var _0x5e29=function(_0x463376,_0x13871c){_0x463376=_0x463376-0x0;var _0x336ccd=_0xe295[_0x463376];return _0x336ccd;};'use strict';var _=require(_0x5e29('0x0'));var rp=require(_0x5e29('0x1'));var md5=require(_0x5e29('0x2'));var util=require('util');var intUtil=require(_0x5e29('0x3'));var moment=require(_0x5e29('0x4'));var Redis=require(_0x5e29('0x5'));var BPromise=require(_0x5e29('0x6'));var config=require(_0x5e29('0x7'));var logger=require(_0x5e29('0x8'))(_0x5e29('0x9'));config[_0x5e29('0xa')]=_[_0x5e29('0xb')](config[_0x5e29('0xa')],{'host':_0x5e29('0xc'),'port':0x18eb});var io=require(_0x5e29('0xd'))(new Redis(config['redis']));function emit(_0x133531,_0x26502b,_0x38cfa5){io['to'](_0x133531)[_0x5e29('0xe')](_0x26502b,_0x38cfa5);}function request(_0x371fc3){logger[_0x5e29('0xf')](_0x5e29('0x10'),JSON[_0x5e29('0x11')](_0x371fc3));return rp(_0x371fc3);}function getCustomFields(_0x4fb527,_0x11e4d0){var _0x16ae8c={};if(_0x4fb527[_0x5e29('0x12')]>0x0){_['forEach'](_0x4fb527,function(_0x2a2587){if(_['includes'](['string','picklist'],_0x2a2587[_0x5e29('0x13')])&&_0x2a2587[_0x5e29('0x14')]){_0x16ae8c[_0x2a2587[_0x5e29('0x14')]]=_0x2a2587['content'][_0x5e29('0x15')]();}else if(_0x2a2587[_0x5e29('0x13')]===_0x5e29('0x16')&&_0x2a2587[_0x5e29('0x17')]&&_0x2a2587[_0x5e29('0x14')]&&_0x11e4d0[_0x2a2587[_0x5e29('0x17')]]){_0x16ae8c[_0x2a2587[_0x5e29('0x14')]]=_0x11e4d0[_0x2a2587['variableName']][_0x5e29('0x15')]();}else if(_0x2a2587[_0x5e29('0x13')]===_0x5e29('0x18')&&_0x2a2587[_0x5e29('0x19')]&&_0x2a2587[_0x5e29('0x19')]['name']&&_0x2a2587[_0x5e29('0x14')]&&_0x11e4d0[_0x2a2587[_0x5e29('0x19')][_0x5e29('0x1a')][_0x5e29('0x1b')]()]){_0x16ae8c[_0x2a2587[_0x5e29('0x14')]]=_0x11e4d0[_0x2a2587['Variable'][_0x5e29('0x1a')][_0x5e29('0x1b')]()][_0x5e29('0x15')]();}});}return _0x16ae8c;}function getName(_0x1bf33c){if(_0x1bf33c[_0x5e29('0x1c')]('\x20')>0x0){var _0x52e11d=_0x1bf33c[_0x5e29('0x1d')](/ (.+)/);if(_0x52e11d[0x1]){return _0x52e11d;}}return[_0x1bf33c,_0x1bf33c];}var accountsTokens={};function getAccessToken(_0x41ee1e){return new Promise(function(_0x2c4b62,_0x241409){if(!_['isNil'](accountsTokens[_0x41ee1e['id']])&&!_[_0x5e29('0x1e')](accountsTokens[_0x41ee1e['id']][_0x5e29('0x1f')])){if(moment()[_0x5e29('0x20')](accountsTokens[_0x41ee1e['id']][_0x5e29('0x21')])){_0x2c4b62(accountsTokens[_0x41ee1e['id']][_0x5e29('0x1f')]);}}var _0x57a308;switch(_0x41ee1e[_0x5e29('0x22')]){case'US':_0x57a308=_0x5e29('0x23');break;case'AU':_0x57a308=_0x5e29('0x24');break;case'EU':_0x57a308=_0x5e29('0x25');break;case'IN':_0x57a308=_0x5e29('0x26');break;case'CN':_0x57a308='https://accounts.zoho.com.cn';break;default:_0x57a308=_0x5e29('0x25');break;}var _0x1e5556={'method':_0x5e29('0x27'),'uri':_0x57a308+_0x5e29('0x28'),'qs':{'refresh_token':_0x41ee1e[_0x5e29('0x29')],'client_id':_0x41ee1e[_0x5e29('0x2a')],'client_secret':_0x41ee1e[_0x5e29('0x2b')],'grant_type':_0x5e29('0x2c')},'json':!![]};return rp(_0x1e5556)['then'](function(_0x1c5862){accountsTokens[_0x41ee1e['id']]={'access_token':_0x1c5862[_0x5e29('0x1f')],'expires_in':moment()['add'](_0x1c5862['expires_in'],_0x5e29('0x2d'))};_0x2c4b62(_0x1c5862[_0x5e29('0x1f')]);})[_0x5e29('0x2e')](function(_0x41897f){logger[_0x5e29('0x2f')](_0x5e29('0x30'),_0x41897f[_0x5e29('0x31')]);_0x241409(_0x41897f);});});}function getUser(_0x4f2892,_0xee2137,_0x3b064e,_0xbb4c93){logger['info'](_0x5e29('0x32'));return request({'method':_0x5e29('0x33'),'uri':util['format'](_0x5e29('0x34'),_0xee2137),'qs':{'type':_0x5e29('0x35')},'headers':{'Authorization':_0x5e29('0x36')+_0x4f2892},'json':!![]})[_0x5e29('0x37')](function(_0x49d32f){if(_0x49d32f[_0x5e29('0x38')]){var _0x3d640a=-0x1;if(_[_0x5e29('0x39')](_0x49d32f[_0x5e29('0x38')])){if(!_['isNil'](_0xbb4c93)){_0x3d640a=_[_0x5e29('0x3a')](_0x49d32f['users'],function(_0x50e0e9){return _0x50e0e9[_0x5e29('0x3b')]===_0xbb4c93;});}if(_0x3d640a>=0x0){logger[_0x5e29('0x3c')](_0x5e29('0x3d'));}else{logger['info'](_0x5e29('0x3e'));_0x3d640a=_[_0x5e29('0x3a')](_0x49d32f['users'],function(_0x1a7d9f){return _0x1a7d9f[_0x5e29('0x3f')][_0x5e29('0x1a')]===_0x5e29('0x40');});}return _0x49d32f[_0x5e29('0x38')][_0x3d640a];}else{if(_0x49d32f[_0x5e29('0x41')]['profile'][_0x5e29('0x1a')]===_0x5e29('0x40')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x49d32f[_0x5e29('0x41')];return user;}else{logger[_0x5e29('0x2f')]('The\x20failing\x20result\x20is',JSON[_0x5e29('0x11')](_0x49d32f));throw new Error(_0x5e29('0x42')+JSON[_0x5e29('0x11')](_0x49d32f));}}}else{logger[_0x5e29('0x2f')](_0x5e29('0x43'),JSON['stringify'](_0x49d32f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x5e29('0x11')](_0x49d32f));}})[_0x5e29('0x2e')](function(_0x4d16ae){console['error'](_0x4d16ae);});}function getZohoUser(_0x2e49d4,_0x40b6e3){return new BPromise(function(_0x54d6ac,_0x180198){request(_0x2e49d4)[_0x5e29('0x37')](function(_0x1562d6){var _0x509644=null;if(_0x1562d6){_0x509644=_0x1562d6[_0x5e29('0x44')][0x0];_0x509644[_0x5e29('0x45')]=_0x40b6e3;}_0x54d6ac(_0x509644);})[_0x5e29('0x2e')](function(_0x5e03d6){_0x180198(_0x5e03d6);});});}function createEndUser(_0x4c4660,_0x2cb87b,_0x3fdbaf,_0xdc0f91,_0x4ea89d,_0x1bd78c){var _0x3fdbaf=getName(_0x3fdbaf);return request({'method':_0x5e29('0x27'),'uri':_0x5e29('0x46')+_0x2cb87b+'/crm/v2/'+_[_0x5e29('0x47')](_0x1bd78c[_0x5e29('0x48')])+'s','body':{'data':[{'Last_Name':_0x3fdbaf[0x1],'First_Name':_0x3fdbaf[0x0],'Phone':_0xdc0f91,'Owner':{'name':!_[_0x5e29('0x1e')](_0x4ea89d[_0x5e29('0x49')]['name'])?_0x4ea89d[_0x5e29('0x49')][_0x5e29('0x1a')]:!_[_0x5e29('0x1e')](_0x4ea89d[_0x5e29('0x4a')])?_0x4ea89d[_0x5e29('0x4a')]+'\x20'+_0x4ea89d[_0x5e29('0x4b')]:_0x4ea89d['last_name'],'id':_0x4ea89d['id']}}]},'headers':{'Authorization':_0x5e29('0x36')+_0x4c4660},'json':!![]})[_0x5e29('0x37')](function(_0x5adacb){if(_0x5adacb&&_0x5adacb[_0x5e29('0x44')][0x0][_0x5e29('0x4c')]===_0x5e29('0x4d')){var _0x7bf722=_0x5adacb['data'][0x0][_0x5e29('0x4e')];_0x7bf722[_0x5e29('0x45')]=_[_0x5e29('0x47')](_0x1bd78c['moduleCreate'])+'s';return _0x7bf722;}logger[_0x5e29('0x2f')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x5e29('0x4f')+JSON['stringify'](data));})[_0x5e29('0x2e')](function(_0x2068bc){console['log'](_0x5e29('0x50'),_0x2068bc);});}function getEndUser(_0x40640b,_0x11ca98,_0x1074e5,_0x1faf83,_0x3d4ba7,_0x22b196,_0x38ee3f){var _0x471d0a={'method':_0x5e29('0x33'),'uri':'','headers':{'Authorization':_0x5e29('0x36')+_0x40640b},'json':!![]};switch(_0x38ee3f[_0x5e29('0x51')]){case _0x5e29('0x52'):_0x471d0a['uri']=_0x5e29('0x46')+_0x11ca98+_0x5e29('0x53')+_0x3d4ba7+'))';return getZohoUser(_0x471d0a,_0x5e29('0x54'))[_0x5e29('0x37')](function(_0x4369ca){if(_0x4369ca)return _0x4369ca;_0x471d0a['uri']='https://www.zohoapis.'+_0x11ca98+_0x5e29('0x55')+_0x3d4ba7+'))';return getZohoUser(_0x471d0a,_0x5e29('0x56'))[_0x5e29('0x37')](function(_0xf9a31b){if(_0xf9a31b)return _0xf9a31b;if(_0x38ee3f['moduleCreate']!='nothing'){return createEndUser(_0x40640b,_0x11ca98,_0x1faf83,_0x3d4ba7,_0x22b196,_0x38ee3f);}else{return{};}});});break;case _0x5e29('0x57'):_0x471d0a['uri']='https://www.zohoapis.'+_0x11ca98+_0x5e29('0x53')+_0x3d4ba7+'))';return getZohoUser(_0x471d0a,'Contacts')[_0x5e29('0x37')](function(_0x932fd){if(_0x932fd)return _0x932fd;if(_0x38ee3f[_0x5e29('0x48')]!=_0x5e29('0x58')){return createEndUser(_0x40640b,_0x11ca98,_0x1faf83,_0x3d4ba7,_0x22b196,_0x38ee3f);}else{return{};}});break;case _0x5e29('0x59'):_0x471d0a[_0x5e29('0x5a')]='https://www.zohoapis.'+_0x11ca98+_0x5e29('0x55')+_0x3d4ba7+'))';return getZohoUser(_0x471d0a,_0x5e29('0x56'))[_0x5e29('0x37')](function(_0x4e1f62){if(_0x4e1f62)return _0x4e1f62;if(_0x38ee3f['moduleCreate']!=_0x5e29('0x58')){return createEndUser(_0x40640b,_0x11ca98,_0x1faf83,_0x3d4ba7,_0x22b196,_0x38ee3f);}else{return{};}});break;}}function getCall(_0x553b7c,_0x58aa1c,_0x580580,_0x5b31f3,_0x1f9bb7,_0x3ef1d4,_0x46d5b4,_0x45cb81){logger[_0x5e29('0x3c')](_0x5e29('0x5b'));var _0x27d112={};_0x27d112[_0x5e29('0x5c')]={'name':!_[_0x5e29('0x1e')](_0x5b31f3['role'][_0x5e29('0x1a')])&&!_[_0x5e29('0x1e')](_0x5b31f3[_0x5e29('0x3f')][_0x5e29('0x1a')])&&_0x5b31f3['profile']['name']==='administrator'?_0x5b31f3['role'][_0x5e29('0x1a')]:!_['isNil'](_0x5b31f3['first_name'])?_0x5b31f3[_0x5e29('0x4a')]+'\x20'+_0x5b31f3[_0x5e29('0x4b')]:_0x5b31f3['last_name'],'id':_0x5b31f3['id']};_0x27d112['Subject']=intUtil['getString'](_0x3ef1d4[_0x5e29('0x5d')],_0x46d5b4,'\x20');_0x27d112['Description']=intUtil[_0x5e29('0x5e')](_0x3ef1d4['Descriptions'],_0x46d5b4,'\x0a');if(_0x1f9bb7['enduserType']===_0x5e29('0x54')){_0x27d112[_0x5e29('0x5f')]={'name':!_['isNil'](_0x1f9bb7[_0x5e29('0x60')])?_0x1f9bb7[_0x5e29('0x60')]:!_[_0x5e29('0x1e')](_0x1f9bb7['First_Name'])?_0x1f9bb7[_0x5e29('0x61')]+'\x20'+_0x1f9bb7['Last_Name']:_0x1f9bb7[_0x5e29('0x62')],'id':_0x1f9bb7['id']};}if(_0x1f9bb7['enduserType']===_0x5e29('0x56')){_0x27d112[_0x5e29('0x63')]={'name':!_[_0x5e29('0x1e')](_0x1f9bb7[_0x5e29('0x60')])?_0x1f9bb7[_0x5e29('0x60')]:!_[_0x5e29('0x1e')](_0x1f9bb7[_0x5e29('0x61')])?_0x1f9bb7['First_Name']+'\x20'+_0x1f9bb7[_0x5e29('0x62')]:_0x1f9bb7[_0x5e29('0x62')],'id':_0x1f9bb7['id']};_0x27d112[_0x5e29('0x64')]=_[_0x5e29('0x47')](_0x1f9bb7[_0x5e29('0x45')]);}if(_0x46d5b4['talktime']){_0x27d112['Call_Duration']=moment[_0x5e29('0x65')](parseInt(_0x46d5b4[_0x5e29('0x66')])*0x3e8)[_0x5e29('0x67')]('mm:ss');}else if(_0x46d5b4[_0x5e29('0x68')]&&_0x46d5b4[_0x5e29('0x69')]){_0x27d112[_0x5e29('0x6a')]=moment['utc'](moment(_0x46d5b4['endtime'],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x46d5b4[_0x5e29('0x6b')],'YYYY-MM-DDTHH:mm:ss')))[_0x5e29('0x67')](_0x5e29('0x6c'));}switch(_0x46d5b4[_0x5e29('0x6d')]){case _0x5e29('0x6e'):_0x27d112[_0x5e29('0x6f')]=_0x5e29('0x70');break;case _0x5e29('0x71'):case _0x5e29('0x72'):_0x27d112[_0x5e29('0x6f')]=_0x5e29('0x73');break;case'rejected':_0x27d112['Call_Result']=_0x5e29('0x74');break;case _0x5e29('0x75'):_0x27d112[_0x5e29('0x6f')]=_0x5e29('0x76');break;case _0x5e29('0x77'):_0x27d112[_0x5e29('0x6f')]=_0x5e29('0x78');default:}_0x27d112['Call_Start_Time']=(_0x45cb81==='outbound'?moment(_0x46d5b4[_0x5e29('0x6b')])[_0x5e29('0x67')](_0x5e29('0x79')):moment(_0x46d5b4[_0x5e29('0x7a')])[_0x5e29('0x67')](_0x5e29('0x79')))||moment()[_0x5e29('0x67')](_0x5e29('0x79'));_0x27d112['Call_Type']=_0x45cb81||_0x5e29('0x7b');_0x27d112=_[_0x5e29('0x7c')](_0x27d112,getCustomFields(_0x3ef1d4[_0x5e29('0x7d')],_0x46d5b4));return request({'method':_0x5e29('0x27'),'uri':_0x5e29('0x46')+_0x58aa1c+'/crm/v2/Calls','headers':{'Authorization':_0x5e29('0x36')+_0x553b7c},'body':{'data':[_0x27d112]},'json':!![]})[_0x5e29('0x37')](function(_0xca624b){if(_0xca624b&&_0xca624b['data'][0x0][_0x5e29('0x4c')]===_0x5e29('0x4d')){logger[_0x5e29('0x3c')]('Call\x20created!');return{'id':_0xca624b['data'][0x0][_0x5e29('0x4e')]['id']};}})[_0x5e29('0x2e')](function(_0x3aa029){logger[_0x5e29('0x3c')](_0x5e29('0x7e'),_0x3aa029[_0x5e29('0x31')]);console['log'](_0x5e29('0x7e'),_0x3aa029);});}exports['queue']=function(_0x4ea6ab,_0x1ccf0d,_0x3f9ec6,_0x1b7b36,_0x48ba28,_0x5dfa64){var _0x2ef99c,_0x211818,_0x3c361a;_0x5dfa64[_0x5e29('0x7f')]=intUtil['stripTrailingSlash'](_0x5dfa64[_0x5e29('0x7f')]);_0x5dfa64['serverUrl']=intUtil[_0x5e29('0x80')](_0x5dfa64['serverUrl']);if(_0x48ba28&&_0x48ba28['monitor_format']){logger[_0x5e29('0x3c')](_0x5e29('0x81'),_0x5e29('0x82'));_0x1ccf0d[_0x5e29('0x83')]=_0x5dfa64['serverUrl']+_0x5e29('0x84')+_0x1ccf0d[_0x5e29('0x85')]+_0x5e29('0x86')+md5(_0x1ccf0d[_0x5e29('0x85')]);}else{_0x1ccf0d['recordingURL']='';}var _0xed12d=_0x5dfa64[_0x5e29('0x7f')]===_0x5e29('0x87')?'eu':_0x5e29('0x88');return getAccessToken(_0x5dfa64)[_0x5e29('0x37')](function(_0xdd76a0){_0x3c361a=_0xdd76a0;return getUser(_0x3c361a,_0xed12d,_0x5dfa64,_0x1b7b36[_0x5e29('0x3b')]);})[_0x5e29('0x37')](function(_0x398445){_0x2ef99c=_0x398445;logger['info'](_0x5e29('0x89'),_0x2ef99c['id']);return getEndUser(_0x3c361a,_0xed12d,_0x5dfa64,_0x1ccf0d['calleridname'],_0x1ccf0d['calleridnum'],_0x2ef99c,_0x3f9ec6);})[_0x5e29('0x37')](function(_0x49b349){_0x211818=_0x49b349;return getCall(_0x3c361a,_0xed12d,_0x5dfa64,_0x2ef99c,_0x211818,_0x3f9ec6,_0x1ccf0d,_0x5e29('0x7b'));})['then'](function(_0xd6b69e){if(_0xd6b69e){logger[_0x5e29('0x3c')]('The\x20Call\x20ID\x20is:',_0xd6b69e['id']);logger[_0x5e29('0x3c')](_0x5e29('0x81'),_0x5e29('0x8a'));emit(util[_0x5e29('0x67')]('user:%s',_0x1b7b36[_0x5e29('0x1a')]),_0x5e29('0x8b'),{'uri':_0x5e29('0x8c')+_0x5dfa64[_0x5e29('0x7f')]+_0x5e29('0x8d')+_0xd6b69e['id']});}})[_0x5e29('0x2e')](function(_0x562eaf){logger[_0x5e29('0x2f')]('[QUEUE]',JSON[_0x5e29('0x11')](_0x562eaf));});};exports[_0x5e29('0x8e')]=function(_0x3458e2,_0x398abf,_0x1b6b47,_0x3241e1,_0x44ee38,_0x1bce53,_0x181ff8){var _0x2349f9,_0xb6cf34,_0x5be0d4;_0x1bce53[_0x5e29('0x7f')]=intUtil[_0x5e29('0x80')](_0x1bce53[_0x5e29('0x7f')]);_0x1bce53[_0x5e29('0x8f')]=intUtil[_0x5e29('0x80')](_0x1bce53[_0x5e29('0x8f')]);if(_0x181ff8&&_0x181ff8[_0x5e29('0x90')]&&_0x181ff8[_0x5e29('0x90')]!==_0x5e29('0x91')){logger['info'](_0x5e29('0x92'),_0x5e29('0x82'));_0x398abf[_0x5e29('0x83')]=_0x1bce53[_0x5e29('0x8f')]+_0x5e29('0x84')+_0x398abf[_0x5e29('0x85')]+_0x5e29('0x86')+md5(_0x398abf[_0x5e29('0x85')]);}var _0x22c197=_0x1bce53['host']===_0x5e29('0x87')?'eu':_0x5e29('0x88');return getAccessToken(_0x1bce53)[_0x5e29('0x37')](function(_0x2a2b4b){_0x5be0d4=_0x2a2b4b;return getUser(_0x5be0d4,_0x22c197,_0x1bce53,_0x3241e1['email']);})[_0x5e29('0x37')](function(_0xb3abda){_0x2349f9=_0xb3abda;logger[_0x5e29('0x3c')](_0x5e29('0x89'),_0x2349f9['id']);return getEndUser(_0x5be0d4,_0x22c197,_0x1bce53,_0x398abf[_0x5e29('0x93')],_0x398abf[_0x5e29('0x94')],_0x2349f9,_0x1b6b47);})[_0x5e29('0x37')](function(_0x39ad28){_0xb6cf34=_0x39ad28;return getCall(_0x5be0d4,_0x22c197,_0x1bce53,_0x2349f9,_0xb6cf34,_0x1b6b47,_0x398abf,_0x5e29('0x95'));})[_0x5e29('0x37')](function(_0xddc314){if(_0xddc314){logger[_0x5e29('0x3c')](_0x5e29('0x96'),_0xddc314['id']);logger[_0x5e29('0x3c')](_0x5e29('0x92'),_0x5e29('0x8a'));emit(util[_0x5e29('0x67')]('user:%s',_0x3241e1[_0x5e29('0x1a')]),'trigger:browser:url',{'uri':_0x5e29('0x8c')+_0x1bce53['host']+_0x5e29('0x8d')+_0xddc314['id']});}})[_0x5e29('0x2e')](function(_0x3da6f4){logger[_0x5e29('0x2f')](_0x5e29('0x92'),JSON['stringify'](_0x3da6f4));});};exports['unmanaged']=function(_0x12477d,_0x118cba,_0xf10579,_0x4b8d99,_0x305c48,_0x247876){var _0x59cb2f,_0xd7c939,_0x2792a8;_0x247876[_0x5e29('0x7f')]=intUtil['stripTrailingSlash'](_0x247876[_0x5e29('0x7f')]);_0x247876[_0x5e29('0x8f')]=intUtil[_0x5e29('0x80')](_0x247876['serverUrl']);if(_0x305c48&&_0x305c48['monitor_format']){logger[_0x5e29('0x3c')]('['+_0x118cba[_0x5e29('0x6d')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x118cba[_0x5e29('0x83')]=_0x247876[_0x5e29('0x8f')]+_0x5e29('0x84')+_0x118cba[_0x5e29('0x85')]+_0x5e29('0x86')+md5(_0x118cba[_0x5e29('0x85')]);}else{_0x118cba[_0x5e29('0x83')]='';}var _0x2ae024=_0x247876['host']==='zoho.eu'?'eu':_0x5e29('0x88');return getAccessToken(_0x247876)[_0x5e29('0x37')](function(_0x3f1448){_0x2792a8=_0x3f1448;return getUser(_0x2792a8,_0x2ae024,_0x247876);})[_0x5e29('0x37')](function(_0x37826b){_0x59cb2f=_0x37826b;logger[_0x5e29('0x3c')](_0x5e29('0x89'),_0x59cb2f['id']);return getEndUser(_0x2792a8,_0x2ae024,_0x247876,_0x118cba[_0x5e29('0x97')],_0x118cba['calleridnum'],_0x59cb2f,_0xf10579);})[_0x5e29('0x37')](function(_0x32c9f4){_0xd7c939=_0x32c9f4;return getCall(_0x2792a8,_0x2ae024,_0x247876,_0x59cb2f,_0xd7c939,_0xf10579,_0x118cba,'Inbound');})['then'](function(_0x35410c){if(_0x35410c){logger[_0x5e29('0x3c')](_0x5e29('0x96'),_0x35410c['id']);}})[_0x5e29('0x2e')](function(_0x4c10f5){logger[_0x5e29('0x2f')]('['+_0x118cba[_0x5e29('0x6d')][_0x5e29('0x98')]()+']',JSON['stringify'](_0x4c10f5));});};
\ No newline at end of file
+var _0x298c=['error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','Agent\x20found!','profile','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','role','first_name','last_name','code','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','https://www.zohoapis.','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','complete','connect','Call_Result','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','[QUEUE]','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','unmanaged','toUpperCase','calleridnum','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','then','add','seconds','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x298c,0x106));var _0xc298=function(_0x187cf8,_0x1e4c13){_0x187cf8=_0x187cf8-0x0;var _0x597845=_0x298c[_0x187cf8];return _0x597845;};'use strict';var _=require(_0xc298('0x0'));var rp=require(_0xc298('0x1'));var md5=require(_0xc298('0x2'));var util=require('util');var intUtil=require(_0xc298('0x3'));var moment=require(_0xc298('0x4'));var Redis=require(_0xc298('0x5'));var BPromise=require(_0xc298('0x6'));var config=require(_0xc298('0x7'));var logger=require(_0xc298('0x8'))('zoho');config[_0xc298('0x9')]=_[_0xc298('0xa')](config[_0xc298('0x9')],{'host':_0xc298('0xb'),'port':0x18eb});var io=require(_0xc298('0xc'))(new Redis(config[_0xc298('0x9')]));function emit(_0x4af34d,_0x46de8b,_0x13382d){io['to'](_0x4af34d)[_0xc298('0xd')](_0x46de8b,_0x13382d);}function request(_0x379419){logger[_0xc298('0xe')](_0xc298('0xf'),JSON[_0xc298('0x10')](_0x379419));return rp(_0x379419);}function getCustomFields(_0x4f0395,_0x579e0b){var _0x472386={};if(_0x4f0395[_0xc298('0x11')]>0x0){_[_0xc298('0x12')](_0x4f0395,function(_0x1ad67b){if(_[_0xc298('0x13')]([_0xc298('0x14'),_0xc298('0x15')],_0x1ad67b['type'])&&_0x1ad67b['idField']){_0x472386[_0x1ad67b[_0xc298('0x16')]]=_0x1ad67b[_0xc298('0x17')]['toString']();}else if(_0x1ad67b[_0xc298('0x18')]===_0xc298('0x19')&&_0x1ad67b['variableName']&&_0x1ad67b['idField']&&_0x579e0b[_0x1ad67b['variableName']]){_0x472386[_0x1ad67b[_0xc298('0x16')]]=_0x579e0b[_0x1ad67b[_0xc298('0x1a')]][_0xc298('0x1b')]();}else if(_0x1ad67b[_0xc298('0x18')]===_0xc298('0x1c')&&_0x1ad67b[_0xc298('0x1d')]&&_0x1ad67b[_0xc298('0x1d')][_0xc298('0x1e')]&&_0x1ad67b[_0xc298('0x16')]&&_0x579e0b[_0x1ad67b[_0xc298('0x1d')][_0xc298('0x1e')][_0xc298('0x1f')]()]){_0x472386[_0x1ad67b[_0xc298('0x16')]]=_0x579e0b[_0x1ad67b[_0xc298('0x1d')]['name'][_0xc298('0x1f')]()][_0xc298('0x1b')]();}});}return _0x472386;}function getName(_0x37d4b8){if(_0x37d4b8[_0xc298('0x20')]('\x20')>0x0){var _0x177008=_0x37d4b8[_0xc298('0x21')](/ (.+)/);if(_0x177008[0x1]){return _0x177008;}}return[_0x37d4b8,_0x37d4b8];}var accountsTokens={};function getAccessToken(_0x12ba99){return new Promise(function(_0x4821da,_0x358456){if(!_[_0xc298('0x22')](accountsTokens[_0x12ba99['id']])&&!_['isNil'](accountsTokens[_0x12ba99['id']][_0xc298('0x23')])){if(moment()['isBefore'](accountsTokens[_0x12ba99['id']][_0xc298('0x24')])){_0x4821da(accountsTokens[_0x12ba99['id']][_0xc298('0x23')]);}}var _0x382c6c;switch(_0x12ba99[_0xc298('0x25')]){case'US':_0x382c6c=_0xc298('0x26');break;case'AU':_0x382c6c=_0xc298('0x27');break;case'EU':_0x382c6c=_0xc298('0x28');break;case'IN':_0x382c6c='https://accounts.zoho.in';break;case'CN':_0x382c6c=_0xc298('0x29');break;default:_0x382c6c=_0xc298('0x28');break;}var _0x20769e={'method':_0xc298('0x2a'),'uri':_0x382c6c+_0xc298('0x2b'),'qs':{'refresh_token':_0x12ba99[_0xc298('0x2c')],'client_id':_0x12ba99[_0xc298('0x2d')],'client_secret':_0x12ba99['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x20769e)[_0xc298('0x2e')](function(_0x2ed9fd){accountsTokens[_0x12ba99['id']]={'access_token':_0x2ed9fd[_0xc298('0x23')],'expires_in':moment()[_0xc298('0x2f')](_0x2ed9fd[_0xc298('0x24')],_0xc298('0x30'))};_0x4821da(_0x2ed9fd[_0xc298('0x23')]);})[_0xc298('0x31')](function(_0x3d9ac){logger[_0xc298('0x32')](_0xc298('0x33'),_0x3d9ac[_0xc298('0x34')]);_0x358456(_0x3d9ac);});});}function getUser(_0x58c7ab,_0x4b9f38,_0x5d2401,_0x4c4ddd){logger[_0xc298('0x35')](_0xc298('0x36'));return request({'method':_0xc298('0x37'),'uri':util[_0xc298('0x38')]('https://www.zohoapis.%s/crm/v2/users',_0x4b9f38),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xc298('0x39')+_0x58c7ab},'json':!![]})[_0xc298('0x2e')](function(_0x55a440){if(_0x55a440['users']){var _0x39dfc7=-0x1;if(_[_0xc298('0x3a')](_0x55a440['users'])){if(!_[_0xc298('0x22')](_0x4c4ddd)){_0x39dfc7=_[_0xc298('0x3b')](_0x55a440[_0xc298('0x3c')],function(_0x1c0445){return _0x1c0445[_0xc298('0x3d')]===_0x4c4ddd;});}if(_0x39dfc7>=0x0){logger[_0xc298('0x35')](_0xc298('0x3e'));}else{logger[_0xc298('0x35')]('Using\x20the\x20admin\x20account!');_0x39dfc7=_['findIndex'](_0x55a440[_0xc298('0x3c')],function(_0x3f83d6){return _0x3f83d6[_0xc298('0x3f')]['name']==='Administrator';});}return _0x55a440[_0xc298('0x3c')][_0x39dfc7];}else{if(_0x55a440[_0xc298('0x40')][_0xc298('0x3f')]['name']==='Administrator'){logger[_0xc298('0x35')](_0xc298('0x41'));user=_0x55a440[_0xc298('0x40')];return user;}else{logger[_0xc298('0x32')](_0xc298('0x42'),JSON['stringify'](_0x55a440));throw new Error(_0xc298('0x43')+JSON[_0xc298('0x10')](_0x55a440));}}}else{logger['error'](_0xc298('0x42'),JSON[_0xc298('0x10')](_0x55a440));throw new Error(_0xc298('0x43')+JSON[_0xc298('0x10')](_0x55a440));}})[_0xc298('0x31')](function(_0xa209f3){console[_0xc298('0x32')](_0xa209f3);});}function getZohoUser(_0x501786,_0x3cf349){return new BPromise(function(_0x707740,_0x2c3007){request(_0x501786)[_0xc298('0x2e')](function(_0x25df3c){var _0x33c862=null;if(_0x25df3c){_0x33c862=_0x25df3c[_0xc298('0x44')][0x0];_0x33c862['enduserType']=_0x3cf349;}_0x707740(_0x33c862);})[_0xc298('0x31')](function(_0x4d0a6d){_0x2c3007(_0x4d0a6d);});});}function createEndUser(_0x1bdecb,_0x55e83c,_0x3ec279,_0x4aeef6,_0x4de93e,_0x2a6fff){var _0x3ec279=getName(_0x3ec279);return request({'method':_0xc298('0x2a'),'uri':'https://www.zohoapis.'+_0x55e83c+_0xc298('0x45')+_[_0xc298('0x46')](_0x2a6fff['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3ec279[0x1],'First_Name':_0x3ec279[0x0],'Phone':_0x4aeef6,'Owner':{'name':!_[_0xc298('0x22')](_0x4de93e[_0xc298('0x47')][_0xc298('0x1e')])?_0x4de93e[_0xc298('0x47')][_0xc298('0x1e')]:!_[_0xc298('0x22')](_0x4de93e['first_name'])?_0x4de93e[_0xc298('0x48')]+'\x20'+_0x4de93e[_0xc298('0x49')]:_0x4de93e[_0xc298('0x49')],'id':_0x4de93e['id']}}]},'headers':{'Authorization':_0xc298('0x39')+_0x1bdecb},'json':!![]})[_0xc298('0x2e')](function(_0x4fbcc9){if(_0x4fbcc9&&_0x4fbcc9[_0xc298('0x44')][0x0][_0xc298('0x4a')]==='SUCCESS'){var _0x4a7288=_0x4fbcc9[_0xc298('0x44')][0x0][_0xc298('0x4b')];_0x4a7288[_0xc298('0x4c')]=_[_0xc298('0x46')](_0x2a6fff[_0xc298('0x4d')])+'s';return _0x4a7288;}logger[_0xc298('0x32')](_0xc298('0x42'),JSON[_0xc298('0x10')](data));throw new Error(_0xc298('0x4e')+JSON[_0xc298('0x10')](data));})[_0xc298('0x31')](function(_0x574d60){console[_0xc298('0x4f')](_0xc298('0x50'),_0x574d60);});}function getEndUser(_0x306e1e,_0x3d2a1d,_0x2cb90d,_0x19adef,_0x3124a6,_0x191377,_0x54711b){var _0x45e899={'method':_0xc298('0x37'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x306e1e},'json':!![]};switch(_0x54711b[_0xc298('0x51')]){case _0xc298('0x52'):_0x45e899[_0xc298('0x53')]='https://www.zohoapis.'+_0x3d2a1d+_0xc298('0x54')+_0x3124a6+'))';return getZohoUser(_0x45e899,'Contacts')[_0xc298('0x2e')](function(_0x4234a8){if(_0x4234a8)return _0x4234a8;_0x45e899[_0xc298('0x53')]=_0xc298('0x55')+_0x3d2a1d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3124a6+'))';return getZohoUser(_0x45e899,_0xc298('0x56'))['then'](function(_0x442eba){if(_0x442eba)return _0x442eba;if(_0x54711b[_0xc298('0x4d')]!=_0xc298('0x57')){return createEndUser(_0x306e1e,_0x3d2a1d,_0x19adef,_0x3124a6,_0x191377,_0x54711b);}else{return{};}});});break;case _0xc298('0x58'):_0x45e899['uri']='https://www.zohoapis.'+_0x3d2a1d+_0xc298('0x54')+_0x3124a6+'))';return getZohoUser(_0x45e899,'Contacts')[_0xc298('0x2e')](function(_0xc603c3){if(_0xc603c3)return _0xc603c3;if(_0x54711b[_0xc298('0x4d')]!=_0xc298('0x57')){return createEndUser(_0x306e1e,_0x3d2a1d,_0x19adef,_0x3124a6,_0x191377,_0x54711b);}else{return{};}});break;case _0xc298('0x59'):_0x45e899[_0xc298('0x53')]=_0xc298('0x55')+_0x3d2a1d+_0xc298('0x5a')+_0x3124a6+'))';return getZohoUser(_0x45e899,'Leads')[_0xc298('0x2e')](function(_0x44f046){if(_0x44f046)return _0x44f046;if(_0x54711b['moduleCreate']!=_0xc298('0x57')){return createEndUser(_0x306e1e,_0x3d2a1d,_0x19adef,_0x3124a6,_0x191377,_0x54711b);}else{return{};}});break;}}function getCall(_0x1dc6f0,_0x3c4e86,_0x11d072,_0x54c611,_0x11a22f,_0x5aae9f,_0x29de35,_0x2dc779){logger[_0xc298('0x35')](_0xc298('0x5b'));var _0x5e3028={};_0x5e3028[_0xc298('0x5c')]={'name':!_[_0xc298('0x22')](_0x54c611['role'][_0xc298('0x1e')])&&!_[_0xc298('0x22')](_0x54c611[_0xc298('0x3f')][_0xc298('0x1e')])&&_0x54c611[_0xc298('0x3f')][_0xc298('0x1e')]===_0xc298('0x5d')?_0x54c611[_0xc298('0x47')][_0xc298('0x1e')]:!_[_0xc298('0x22')](_0x54c611[_0xc298('0x48')])?_0x54c611[_0xc298('0x48')]+'\x20'+_0x54c611[_0xc298('0x49')]:_0x54c611['last_name'],'id':_0x54c611['id']};_0x5e3028[_0xc298('0x5e')]=intUtil[_0xc298('0x5f')](_0x5aae9f[_0xc298('0x60')],_0x29de35,'\x20');_0x5e3028[_0xc298('0x61')]=intUtil['getString'](_0x5aae9f[_0xc298('0x62')],_0x29de35,'\x0a');if(_0x11a22f[_0xc298('0x4c')]===_0xc298('0x63')){_0x5e3028[_0xc298('0x64')]={'name':!_[_0xc298('0x22')](_0x11a22f['Full_Name'])?_0x11a22f[_0xc298('0x65')]:!_['isNil'](_0x11a22f[_0xc298('0x66')])?_0x11a22f['First_Name']+'\x20'+_0x11a22f[_0xc298('0x67')]:_0x11a22f[_0xc298('0x67')],'id':_0x11a22f['id']};}if(_0x11a22f[_0xc298('0x4c')]==='Leads'){_0x5e3028[_0xc298('0x68')]={'name':!_['isNil'](_0x11a22f[_0xc298('0x65')])?_0x11a22f['Full_Name']:!_[_0xc298('0x22')](_0x11a22f[_0xc298('0x66')])?_0x11a22f[_0xc298('0x66')]+'\x20'+_0x11a22f[_0xc298('0x67')]:_0x11a22f[_0xc298('0x67')],'id':_0x11a22f['id']};_0x5e3028['$se_module']=_[_0xc298('0x46')](_0x11a22f['enduserType']);}if(_0x29de35[_0xc298('0x69')]){_0x5e3028[_0xc298('0x6a')]=moment[_0xc298('0x6b')](parseInt(_0x29de35[_0xc298('0x69')])*0x3e8)[_0xc298('0x38')]('mm:ss');}else if(_0x29de35['answertime']&&_0x29de35[_0xc298('0x6c')]){_0x5e3028['Call_Duration']=moment[_0xc298('0x6b')](moment(_0x29de35[_0xc298('0x6c')],_0xc298('0x6d'))['diff'](moment(_0x29de35[_0xc298('0x6e')],_0xc298('0x6d'))))[_0xc298('0x38')]('mm:ss');}switch(_0x29de35[_0xc298('0x6f')]){case'called':_0x5e3028['Call_Result']='Called';break;case _0xc298('0x70'):case _0xc298('0x71'):_0x5e3028[_0xc298('0x72')]=_0xc298('0x73');break;case _0xc298('0x74'):_0x5e3028['Call_Result']='Rejected';break;case _0xc298('0x75'):_0x5e3028[_0xc298('0x72')]='Abandoned';break;case _0xc298('0x76'):_0x5e3028['Call_Result']=_0xc298('0x77');default:}_0x5e3028[_0xc298('0x78')]=(_0x2dc779==='outbound'?moment(_0x29de35['starttime'])[_0xc298('0x38')](_0xc298('0x6d')):moment(_0x29de35[_0xc298('0x79')])['format'](_0xc298('0x6d')))||moment()[_0xc298('0x38')]('YYYY-MM-DDTHH:mm:ss');_0x5e3028['Call_Type']=_0x2dc779||_0xc298('0x7a');_0x5e3028=_[_0xc298('0x7b')](_0x5e3028,getCustomFields(_0x5aae9f[_0xc298('0x7c')],_0x29de35));return request({'method':'POST','uri':_0xc298('0x55')+_0x3c4e86+_0xc298('0x7d'),'headers':{'Authorization':_0xc298('0x39')+_0x1dc6f0},'body':{'data':[_0x5e3028]},'json':!![]})['then'](function(_0x3fe3bb){if(_0x3fe3bb&&_0x3fe3bb[_0xc298('0x44')][0x0][_0xc298('0x4a')]===_0xc298('0x7e')){logger['info'](_0xc298('0x7f'));return{'id':_0x3fe3bb[_0xc298('0x44')][0x0]['details']['id']};}})[_0xc298('0x31')](function(_0x194a7f){logger[_0xc298('0x35')]('err',_0x194a7f[_0xc298('0x34')]);console[_0xc298('0x4f')](_0xc298('0x80'),_0x194a7f);});}exports[_0xc298('0x81')]=function(_0x4de812,_0x42be0e,_0x18af2b,_0x2fbd69,_0x5b8e7f,_0x5334d3){var _0x23c0a7,_0x486f1f,_0x17099f;_0x5334d3[_0xc298('0x82')]=intUtil[_0xc298('0x83')](_0x5334d3['host']);_0x5334d3[_0xc298('0x84')]=intUtil['stripTrailingSlash'](_0x5334d3['serverUrl']);if(_0x5b8e7f&&_0x5b8e7f['monitor_format']){logger[_0xc298('0x35')]('[QUEUE]',_0xc298('0x85'));_0x42be0e[_0xc298('0x86')]=_0x5334d3[_0xc298('0x84')]+_0xc298('0x87')+_0x42be0e[_0xc298('0x88')]+_0xc298('0x89')+md5(_0x42be0e['uniqueid']);}else{_0x42be0e[_0xc298('0x86')]='';}var _0x3dd45d=_0x5334d3['host']===_0xc298('0x8a')?'eu':'com';return getAccessToken(_0x5334d3)[_0xc298('0x2e')](function(_0x30040e){_0x17099f=_0x30040e;return getUser(_0x17099f,_0x3dd45d,_0x5334d3,_0x2fbd69['email']);})['then'](function(_0x56afa0){_0x23c0a7=_0x56afa0;logger[_0xc298('0x35')](_0xc298('0x8b'),_0x23c0a7['id']);return getEndUser(_0x17099f,_0x3dd45d,_0x5334d3,_0x42be0e[_0xc298('0x8c')],_0x42be0e['calleridnum'],_0x23c0a7,_0x18af2b);})['then'](function(_0xc6f640){_0x486f1f=_0xc6f640;return getCall(_0x17099f,_0x3dd45d,_0x5334d3,_0x23c0a7,_0x486f1f,_0x18af2b,_0x42be0e,'Inbound');})['then'](function(_0x58fdb1){if(_0x58fdb1){logger[_0xc298('0x35')]('The\x20Call\x20ID\x20is:',_0x58fdb1['id']);logger['info'](_0xc298('0x8d'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xc298('0x8e'),_0x2fbd69[_0xc298('0x1e')]),_0xc298('0x8f'),{'uri':_0xc298('0x90')+_0x5334d3[_0xc298('0x82')]+_0xc298('0x91')+_0x58fdb1['id']});}})['catch'](function(_0x238f97){logger['error']('[QUEUE]',JSON[_0xc298('0x10')](_0x238f97));});};exports[_0xc298('0x92')]=function(_0x33cd0b,_0x5e1e0d,_0x2b71df,_0x5b976a,_0xe96a29,_0x2cc2e6,_0x1847db){var _0x3719a7,_0x3824d9,_0x52b0a3;_0x2cc2e6[_0xc298('0x82')]=intUtil['stripTrailingSlash'](_0x2cc2e6[_0xc298('0x82')]);_0x2cc2e6['serverUrl']=intUtil[_0xc298('0x83')](_0x2cc2e6[_0xc298('0x84')]);if(_0x1847db&&_0x1847db[_0xc298('0x93')]&&_0x1847db[_0xc298('0x93')]!==_0xc298('0x94')){logger[_0xc298('0x35')](_0xc298('0x95'),_0xc298('0x85'));_0x5e1e0d[_0xc298('0x86')]=_0x2cc2e6[_0xc298('0x84')]+_0xc298('0x87')+_0x5e1e0d[_0xc298('0x88')]+_0xc298('0x89')+md5(_0x5e1e0d[_0xc298('0x88')]);}var _0x5c58e7=_0x2cc2e6[_0xc298('0x82')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x2cc2e6)[_0xc298('0x2e')](function(_0x551b04){_0x52b0a3=_0x551b04;return getUser(_0x52b0a3,_0x5c58e7,_0x2cc2e6,_0x5b976a['email']);})[_0xc298('0x2e')](function(_0x231034){_0x3719a7=_0x231034;logger[_0xc298('0x35')](_0xc298('0x8b'),_0x3719a7['id']);return getEndUser(_0x52b0a3,_0x5c58e7,_0x2cc2e6,_0x5e1e0d[_0xc298('0x96')],_0x5e1e0d['destcalleridnum'],_0x3719a7,_0x2b71df);})[_0xc298('0x2e')](function(_0x26b54e){_0x3824d9=_0x26b54e;return getCall(_0x52b0a3,_0x5c58e7,_0x2cc2e6,_0x3719a7,_0x3824d9,_0x2b71df,_0x5e1e0d,_0xc298('0x97'));})[_0xc298('0x2e')](function(_0x241061){if(_0x241061){logger['info']('The\x20Call\x20ID\x20is:',_0x241061['id']);logger[_0xc298('0x35')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc298('0x38')](_0xc298('0x8e'),_0x5b976a[_0xc298('0x1e')]),_0xc298('0x8f'),{'uri':'https://crm.'+_0x2cc2e6['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x241061['id']});}})[_0xc298('0x31')](function(_0x37a622){logger[_0xc298('0x32')](_0xc298('0x95'),JSON['stringify'](_0x37a622));});};exports[_0xc298('0x98')]=function(_0x11d6b5,_0x31d1a1,_0x39032a,_0x6cdd99,_0x5b1eb1,_0x423691){var _0x2b2153,_0x585675,_0x43031b;_0x423691[_0xc298('0x82')]=intUtil[_0xc298('0x83')](_0x423691[_0xc298('0x82')]);_0x423691[_0xc298('0x84')]=intUtil[_0xc298('0x83')](_0x423691[_0xc298('0x84')]);if(_0x5b1eb1&&_0x5b1eb1['monitor_format']){logger[_0xc298('0x35')]('['+_0x31d1a1['lastevent'][_0xc298('0x99')]()+']',_0xc298('0x85'));_0x31d1a1[_0xc298('0x86')]=_0x423691[_0xc298('0x84')]+'/api/voice/recordings/'+_0x31d1a1[_0xc298('0x88')]+_0xc298('0x89')+md5(_0x31d1a1[_0xc298('0x88')]);}else{_0x31d1a1[_0xc298('0x86')]='';}var _0x2dfe33=_0x423691['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x423691)[_0xc298('0x2e')](function(_0x20f28c){_0x43031b=_0x20f28c;return getUser(_0x43031b,_0x2dfe33,_0x423691);})[_0xc298('0x2e')](function(_0x2a212d){_0x2b2153=_0x2a212d;logger[_0xc298('0x35')]('The\x20User\x20ID\x20is:',_0x2b2153['id']);return getEndUser(_0x43031b,_0x2dfe33,_0x423691,_0x31d1a1['calleridname'],_0x31d1a1[_0xc298('0x9a')],_0x2b2153,_0x39032a);})[_0xc298('0x2e')](function(_0x508de8){_0x585675=_0x508de8;return getCall(_0x43031b,_0x2dfe33,_0x423691,_0x2b2153,_0x585675,_0x39032a,_0x31d1a1,_0xc298('0x7a'));})[_0xc298('0x2e')](function(_0x27a8f9){if(_0x27a8f9){logger[_0xc298('0x35')](_0xc298('0x9b'),_0x27a8f9['id']);}})['catch'](function(_0x1296fc){logger[_0xc298('0x32')]('['+_0x31d1a1[_0xc298('0x6f')][_0xc298('0x99')]()+']',JSON[_0xc298('0x10')](_0x1296fc));});};
\ No newline at end of file
index b1d94a0..936a92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878a=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','trigger','exec','data2','Script','render','data3','error','format','info'];(function(_0x33f34e,_0x4fde5b){var _0x58dc01=function(_0x36e155){while(--_0x36e155){_0x33f34e['push'](_0x33f34e['shift']());}};_0x58dc01(++_0x4fde5b);}(_0x878a,0xc1));var _0xa878=function(_0x9cf537,_0x41ccb4){_0x9cf537=_0x9cf537-0x0;var _0x5282c2=_0x878a[_0x9cf537];return _0x5282c2;};'use strict';var util=require('util');var sh=require(_0xa878('0x0'));var Mustache=require(_0xa878('0x1'));var logger=require('../../../../config/logger')(_0xa878('0x2'));exports[_0xa878('0x3')]=function(_0x2322c1,_0x161095){var _0xdaaf0d=_0x2322c1[_0xa878('0x4')]?_0x2322c1[_0xa878('0x4')]:_0xa878('0x5');var _0x5d19a6=_0x2322c1['data3']?Mustache[_0xa878('0x6')](_0x2322c1[_0xa878('0x7')],_0x161095):_0x161095;sh[_0xa878('0x3')](_0x5d19a6,function(_0x6111cd,_0x5b1b6d,_0x50e34a){if(_0x6111cd!==0x0){logger[_0xa878('0x8')](util[_0xa878('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xdaaf0d,_0x5d19a6,_0x6111cd,_0x50e34a));}else{logger[_0xa878('0xa')](util[_0xa878('0x9')](_0xa878('0xb'),_0xdaaf0d,_0x5d19a6,_0x5b1b6d));}});};
\ No newline at end of file
+var _0x5838=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','../../../../config/logger','trigger','data2','Script','render','exec'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5838,0x9a));var _0x8583=function(_0x1c6868,_0x558aeb){_0x1c6868=_0x1c6868-0x0;var _0x51a5b1=_0x5838[_0x1c6868];return _0x51a5b1;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x8583('0x0'))(_0x8583('0x1'));exports['exec']=function(_0x1ea48e,_0x1594fb){var _0x4219bf=_0x1ea48e[_0x8583('0x2')]?_0x1ea48e[_0x8583('0x2')]:_0x8583('0x3');var _0x4a9202=_0x1ea48e['data3']?Mustache[_0x8583('0x4')](_0x1ea48e['data3'],_0x1594fb):_0x1594fb;sh[_0x8583('0x5')](_0x4a9202,function(_0x2e9546,_0x28c5ee,_0x2990a9){if(_0x2e9546!==0x0){logger[_0x8583('0x6')](util['format'](_0x8583('0x7'),_0x4219bf,_0x4a9202,_0x2e9546,_0x2990a9));}else{logger['info'](util[_0x8583('0x8')](_0x8583('0x9'),_0x4219bf,_0x4a9202,_0x28c5ee));}});};
\ No newline at end of file
index 42e07f8..3714462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f78=['data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','data2','stringify',',\x20request\x20body:\x20','info','format','statusCode','catch','name','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data5','headers','data6','parse','error','GET','DELETE','POST'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x2f78,0x1cb));var _0x82f7=function(_0x1b675e,_0x4233be){_0x1b675e=_0x1b675e-0x0;var _0x5549a7=_0x2f78[_0x1b675e];return _0x5549a7;};'use strict';var rp=require(_0x82f7('0x0'));var util=require(_0x82f7('0x1'));var _=require(_0x82f7('0x2'));var Mustache=require(_0x82f7('0x3'));var logger=require(_0x82f7('0x4'))('trigger');exports[_0x82f7('0x5')]=function(_0x5c0205,_0x4df403){var _0x422b93,_0x40c142;var _0x5da908={'method':_0x5c0205[_0x82f7('0x6')][_0x82f7('0x7')](),'uri':Mustache[_0x82f7('0x8')](_0x5c0205['data2'],_0x4df403),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5c0205['data5'])==='number'&&parseInt(_0x5c0205['data5'])>=0x1&&parseInt(_0x5c0205[_0x82f7('0x9')])<=0xa?parseInt(_0x5c0205[_0x82f7('0x9')])*0x3e8:0x5*0x3e8};try{_0x5da908[_0x82f7('0xa')]=_0x5c0205[_0x82f7('0xb')]?JSON[_0x82f7('0xc')](Mustache[_0x82f7('0x8')](_0x5c0205[_0x82f7('0xb')],_0x4df403)):{};}catch(_0x281c8e){logger[_0x82f7('0xd')](_0x281c8e['stack']);}switch(_0x5c0205[_0x82f7('0x6')][_0x82f7('0x7')]()){case _0x82f7('0xe'):case _0x82f7('0xf'):_0x422b93=null;_0x5da908['qs']=_0x4df403;break;case _0x82f7('0x10'):case'PUT':if(_0x5c0205[_0x82f7('0x11')]){try{_0x422b93=JSON[_0x82f7('0xc')](Mustache[_0x82f7('0x8')](_0x5c0205['data7'],_0x4df403));_0x5da908['body']=_0x422b93;}catch(_0x1686e7){logger[_0x82f7('0xd')](_0x1686e7['stack']);logger[_0x82f7('0xd')](_0x82f7('0x12'));}}else{_0x422b93=_0x4df403;_0x5da908[_0x82f7('0x13')]=_0x422b93;}break;}logger['info'](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5c0205['data1'],_0x5c0205[_0x82f7('0x14')],JSON[_0x82f7('0x15')](_0x5da908)));rp(_0x5da908)['then'](function(_0x568274){_0x422b93=!_['isNil'](_0x422b93)?_0x82f7('0x16')+_0x422b93:'';_0x40c142=typeof _0x568274[_0x82f7('0x13')]==='object'?JSON[_0x82f7('0x15')](_0x568274[_0x82f7('0x13')]):_0x568274['body'];logger[_0x82f7('0x17')](util[_0x82f7('0x18')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x5c0205[_0x82f7('0x6')],_0x5c0205['data2'],_0x568274[_0x82f7('0x19')],_0x40c142));})[_0x82f7('0x1a')](function(_0x99b0ff){logger['error'](util[_0x82f7('0x18')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5c0205['data1'],_0x5c0205[_0x82f7('0x14')],_0x99b0ff[_0x82f7('0x19')],_0x99b0ff[_0x82f7('0x1b')],_0x99b0ff['message']));});};
\ No newline at end of file
+var _0x7899=['data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','lodash','mustache','../../../../config/logger','exec','data1','render','data5','number','data6','parse','error','stack','DELETE','POST','PUT'];(function(_0x5d45a7,_0x39766c){var _0x14ff8e=function(_0x1cea01){while(--_0x1cea01){_0x5d45a7['push'](_0x5d45a7['shift']());}};_0x14ff8e(++_0x39766c);}(_0x7899,0xf1));var _0x9789=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x7899[_0x263a74];return _0x2aa86c;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x9789('0x0'));var Mustache=require(_0x9789('0x1'));var logger=require(_0x9789('0x2'))('trigger');exports[_0x9789('0x3')]=function(_0x4f49b7,_0x434b68){var _0x4f0e99,_0x59d224;var _0x5d098d={'method':_0x4f49b7[_0x9789('0x4')]['toUpperCase'](),'uri':Mustache[_0x9789('0x5')](_0x4f49b7['data2'],_0x434b68),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4f49b7[_0x9789('0x6')])===_0x9789('0x7')&&parseInt(_0x4f49b7[_0x9789('0x6')])>=0x1&&parseInt(_0x4f49b7[_0x9789('0x6')])<=0xa?parseInt(_0x4f49b7['data5'])*0x3e8:0x5*0x3e8};try{_0x5d098d['headers']=_0x4f49b7[_0x9789('0x8')]?JSON[_0x9789('0x9')](Mustache[_0x9789('0x5')](_0x4f49b7['data6'],_0x434b68)):{};}catch(_0x298f25){logger[_0x9789('0xa')](_0x298f25[_0x9789('0xb')]);}switch(_0x4f49b7[_0x9789('0x4')]['toUpperCase']()){case'GET':case _0x9789('0xc'):_0x4f0e99=null;_0x5d098d['qs']=_0x434b68;break;case _0x9789('0xd'):case _0x9789('0xe'):if(_0x4f49b7[_0x9789('0xf')]){try{_0x4f0e99=JSON['parse'](Mustache[_0x9789('0x5')](_0x4f49b7[_0x9789('0xf')],_0x434b68));_0x5d098d['body']=_0x4f0e99;}catch(_0x3bc8c8){logger[_0x9789('0xa')](_0x3bc8c8[_0x9789('0xb')]);logger[_0x9789('0xa')](_0x9789('0x10'));}}else{_0x4f0e99=_0x434b68;_0x5d098d[_0x9789('0x11')]=_0x4f0e99;}break;}logger[_0x9789('0x12')](util[_0x9789('0x13')](_0x9789('0x14'),_0x4f49b7[_0x9789('0x4')],_0x4f49b7[_0x9789('0x15')],JSON[_0x9789('0x16')](_0x5d098d)));rp(_0x5d098d)[_0x9789('0x17')](function(_0x2c9f5f){_0x4f0e99=!_['isNil'](_0x4f0e99)?_0x9789('0x18')+_0x4f0e99:'';_0x59d224=typeof _0x2c9f5f[_0x9789('0x11')]===_0x9789('0x19')?JSON[_0x9789('0x16')](_0x2c9f5f[_0x9789('0x11')]):_0x2c9f5f[_0x9789('0x11')];logger['info'](util[_0x9789('0x13')](_0x9789('0x1a'),_0x4f49b7[_0x9789('0x4')],_0x4f49b7[_0x9789('0x15')],_0x2c9f5f['statusCode'],_0x59d224));})[_0x9789('0x1b')](function(_0xff1251){logger['error'](util['format'](_0x9789('0x1c'),_0x4f49b7[_0x9789('0x4')],_0x4f49b7['data2'],_0xff1251[_0x9789('0x1d')],_0xff1251[_0x9789('0x1e')],_0xff1251[_0x9789('0x1f')]));});};
\ No newline at end of file
index a4433d1..af912b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40b1=['../../config/logger','routing','client','http','then','rpc','error','message','result'];(function(_0x631f54,_0x137894){var _0x15a3d7=function(_0x1ba148){while(--_0x1ba148){_0x631f54['push'](_0x631f54['shift']());}};_0x15a3d7(++_0x137894);}(_0x40b1,0x1e6));var _0x140b=function(_0x1f1621,_0x194f1d){_0x1f1621=_0x1f1621-0x0;var _0x4a8ec2=_0x40b1[_0x1f1621];return _0x4a8ec2;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x140b('0x0'))(_0x140b('0x1'));var client=jayson[_0x140b('0x2')][_0x140b('0x3')]({'port':0x2329});client['Request']=function(_0x93970a,_0x4a37f8){return new BPromise(function(_0x13c25d,_0x31d24a){return client['request'](_0x93970a,_0x4a37f8)[_0x140b('0x4')](function(_0x14dce2){logger['debug'](_0x140b('0x5'),_0x140b('0x1'),_0x93970a,_0x4a37f8,_0x14dce2);if(_0x14dce2['error']){logger[_0x140b('0x6')](_0x140b('0x5'),_0x140b('0x1'),_0x93970a,_0x14dce2[_0x140b('0x6')]['message'],_0x4a37f8);return _0x31d24a(_0x14dce2[_0x140b('0x6')][_0x140b('0x7')]);}else{return _0x13c25d(_0x14dce2[_0x140b('0x8')]);}})['catch'](function(_0x20b3f1){logger['error']('rpc',_0x140b('0x1'),_0x93970a,_0x20b3f1,_0x4a37f8);return _0x31d24a(_0x20b3f1);});});};module['exports']=client;
\ No newline at end of file
+var _0x7a5a=['message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request','error','rpc'];(function(_0x107e44,_0x41f7a6){var _0x1d2118=function(_0x425775){while(--_0x425775){_0x107e44['push'](_0x107e44['shift']());}};_0x1d2118(++_0x41f7a6);}(_0x7a5a,0x13c));var _0xa7a5=function(_0x9921b9,_0x45806c){_0x9921b9=_0x9921b9-0x0;var _0x3d6990=_0x7a5a[_0x9921b9];return _0x3d6990;};'use strict';var jayson=require(_0xa7a5('0x0'));var BPromise=require(_0xa7a5('0x1'));var logger=require('../../config/logger')(_0xa7a5('0x2'));var client=jayson[_0xa7a5('0x3')][_0xa7a5('0x4')]({'port':0x2329});client[_0xa7a5('0x5')]=function(_0x391fb4,_0x576208){return new BPromise(function(_0x542d57,_0xabb6a5){return client[_0xa7a5('0x6')](_0x391fb4,_0x576208)['then'](function(_0x3b1fcc){logger['debug']('rpc',_0xa7a5('0x2'),_0x391fb4,_0x576208,_0x3b1fcc);if(_0x3b1fcc[_0xa7a5('0x7')]){logger['error'](_0xa7a5('0x8'),'routing',_0x391fb4,_0x3b1fcc[_0xa7a5('0x7')][_0xa7a5('0x9')],_0x576208);return _0xabb6a5(_0x3b1fcc['error'][_0xa7a5('0x9')]);}else{return _0x542d57(_0x3b1fcc[_0xa7a5('0xa')]);}})[_0xa7a5('0xb')](function(_0x581114){logger[_0xa7a5('0x7')](_0xa7a5('0x8'),_0xa7a5('0x2'),_0x391fb4,_0x581114,_0x576208);return _0xabb6a5(_0x581114);});});};module[_0xa7a5('0xc')]=client;
\ No newline at end of file
index 717723e..d33b649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a30=['then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./rpc/mailAccount','email','resolve'];(function(_0x47b60c,_0x2e3106){var _0x5d1289=function(_0x595055){while(--_0x595055){_0x47b60c['push'](_0x47b60c['shift']());}};_0x5d1289(++_0x2e3106);}(_0x0a30,0x189));var _0x00a3=function(_0x4361b1,_0x39fd80){_0x4361b1=_0x4361b1-0x0;var _0x4f4707=_0x0a30[_0x4361b1];return _0x4f4707;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x00a3('0x0'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x00a3('0x1'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x00a3('0x2')]()[_0x00a3('0x3')](mailAccount[_0x00a3('0x4')]())['then'](realtime[_0x00a3('0x5')]())[_0x00a3('0x3')](function(){email['refresh'](realtime[_0x00a3('0x6')]);return realtime;});}function main(){return server[_0x00a3('0x7')](realtime,email)['then'](function(){return initRealtime();})[_0x00a3('0x3')](function(){return setting[_0x00a3('0x8')]();})[_0x00a3('0x3')](function(_0x497e52){return setInterval(initRealtime,_0x497e52[_0x00a3('0x9')]*0x3e8);})['catch'](function(_0x2c329a){logger[_0x00a3('0xa')](_0x00a3('0xb'),_0x2c329a);});}main();
\ No newline at end of file
+var _0x946b=['Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount','./rpc/setting','email','getMailAccounts','then','refresh','mailAccounts','listen','getSettings'];(function(_0x88f5b7,_0x332e58){var _0x129c87=function(_0x57dc2c){while(--_0x57dc2c){_0x88f5b7['push'](_0x88f5b7['shift']());}};_0x129c87(++_0x332e58);}(_0x946b,0x91));var _0xb946=function(_0x44996c,_0x4522b4){_0x44996c=_0x44996c-0x0;var _0x224422=_0x946b[_0x44996c];return _0x224422;};'use strict';var server=require(_0xb946('0x0'));var Realtime=require(_0xb946('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xb946('0x2'));var setting=require(_0xb946('0x3'));var logger=require('../../config/logger')(_0xb946('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0xb946('0x5')]())[_0xb946('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xb946('0x7')](realtime[_0xb946('0x8')]);return realtime;});}function main(){return server[_0xb946('0x9')](realtime,email)[_0xb946('0x6')](function(){return initRealtime();})[_0xb946('0x6')](function(){return setting[_0xb946('0xa')]();})[_0xb946('0x6')](function(_0x296e27){return setInterval(initRealtime,_0x296e27['loginMailFrequency']*0x3e8);})['catch'](function(_0x5d9b70){logger['error'](_0xb946('0xb'),_0x5d9b70);});}main();
\ No newline at end of file
index 931852b..ed815b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ef1=['notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','smtp','send','Smtp','verify','verified','exports','lodash','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','active','Imap','status','messageStatus','stringify','mailAccount:update','prototype','hasOwnProperty','service','custom','box','handleImapBox','handleImapEmail','end','handleImapEnd','bind','error','isNil','disabled','connected','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x5ef1,0x15d));var _0x15ef=function(_0x107d38,_0x12fc9e){_0x107d38=_0x107d38-0x0;var _0x51397c=_0x5ef1[_0x107d38];return _0x51397c;};'use strict';var _=require(_0x15ef('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x15ef('0x1'));var Redis=require(_0x15ef('0x2'));var config=require(_0x15ef('0x3'));var logger=require('../../../config/logger')(_0x15ef('0x4'));config[_0x15ef('0x5')]=_[_0x15ef('0x6')](config[_0x15ef('0x5')],{'host':_0x15ef('0x7'),'port':0x18eb});var io=require(_0x15ef('0x8'))(new Redis(config[_0x15ef('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x15ef('0x9'));var mailAccount=require(_0x15ef('0xa'));var md5Accounts={};function EmailChannel(_0x49d9d6){logger['info'](_0x15ef('0xb'));this[_0x15ef('0xc')]=_0x49d9d6[_0x15ef('0xc')];this[_0x15ef('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x15ef('0xe')]=function(_0x29966f){var _0x33f907=this[_0x15ef('0xc')][_0x29966f];var _0x2bf590={'id':_0x33f907['id'],'name':_0x33f907[_0x15ef('0xf')],'key':_0x33f907[_0x15ef('0x10')],'active':_0x33f907[_0x15ef('0x11')],'Imap':{'status':_0x33f907[_0x15ef('0x12')][_0x15ef('0x13')],'messageStatus':_0x33f907[_0x15ef('0x12')][_0x15ef('0x14')],'total':_0x33f907['Imap']['total']}};if(_['isNil'](md5Accounts[_0x29966f])){md5Accounts[_0x29966f]={};}var _0x442070=md5(JSON[_0x15ef('0x15')](_0x2bf590));if(md5Accounts[_0x29966f][_0x15ef('0x1')]!==_0x442070){md5Accounts[_0x29966f]['md5']=_0x442070;io[_0x15ef('0xe')](_0x15ef('0x16'),_0x2bf590);}};EmailChannel[_0x15ef('0x17')]['refresh']=function(_0x2e1069){for(var _0x4c00dc in _0x2e1069){if(_0x2e1069[_0x15ef('0x18')](_0x4c00dc)){if(_0x2e1069[_0x4c00dc][_0x15ef('0x12')]&&_0x2e1069[_0x4c00dc][_0x15ef('0x11')]){var _0x46011c=_0x2e1069[_0x4c00dc][_0x15ef('0x12')];if(!_0x46011c[_0x15ef('0x19')]&&_0x2e1069[_0x4c00dc]['provider']!==_0x15ef('0x1a'))_0x46011c[_0x15ef('0x19')]=_0x2e1069[_0x4c00dc]['provider'];if(!this[_0x15ef('0xd')][_0x15ef('0x18')](_0x46011c['id'])){this[_0x15ef('0xd')][_0x46011c['id']]=new EmailImap(_0x46011c,_0x2e1069[_0x4c00dc]['email']);this[_0x15ef('0xd')][_0x46011c['id']]['on'](_0x15ef('0x1b'),this[_0x15ef('0x1c')]['bind'](this,_0x4c00dc));this[_0x15ef('0xd')][_0x46011c['id']]['on'](_0x15ef('0x4'),this[_0x15ef('0x1d')]['bind'](this,_0x4c00dc));this[_0x15ef('0xd')][_0x46011c['id']]['on'](_0x15ef('0x1e'),this[_0x15ef('0x1f')][_0x15ef('0x20')](this,_0x4c00dc));this[_0x15ef('0xd')][_0x46011c['id']]['on'](_0x15ef('0x21'),this['handleImapError'][_0x15ef('0x20')](this,_0x4c00dc));}}else{if(_[_0x15ef('0x22')](this[_0x15ef('0xc')][_0x4c00dc][_0x15ef('0x12')])){this['mailAccounts'][_0x4c00dc][_0x15ef('0x12')]={};}this[_0x15ef('0xc')][_0x4c00dc]['Imap'][_0x15ef('0x13')]=_0x15ef('0x23');this[_0x15ef('0xc')][_0x4c00dc][_0x15ef('0x12')][_0x15ef('0x14')]='';this['emit'](_0x4c00dc);}}}};EmailChannel[_0x15ef('0x17')]['handleImapBox']=function(_0x3e9ed9,_0x8bd819){if(this[_0x15ef('0xc')][_0x3e9ed9]){this[_0x15ef('0xc')][_0x3e9ed9][_0x15ef('0x12')][_0x15ef('0x13')]=_0x15ef('0x24');this[_0x15ef('0xc')][_0x3e9ed9][_0x15ef('0x12')][_0x15ef('0x14')]=_0x8bd819[_0x15ef('0xf')];if(_0x8bd819[_0x15ef('0x25')]){this[_0x15ef('0xc')][_0x3e9ed9]['Imap'][_0x15ef('0x26')]=_0x8bd819['messages'][_0x15ef('0x26')];}return this[_0x15ef('0xe')](_0x3e9ed9);}};EmailChannel['prototype'][_0x15ef('0x1d')]=function(_0x2d32a6,_0x2b807b){logger[_0x15ef('0x27')](_0x15ef('0x28'),_0x2b807b['firstName'],_0x2b807b[_0x15ef('0x29')],_0x2b807b[_0x15ef('0x2a')],_0x2d32a6);if(this[_0x15ef('0xc')][_0x2d32a6]){return mailAccount[_0x15ef('0x2b')](_0x2d32a6,_0x2b807b)[_0x15ef('0x2c')](function(_0x2af37f){if(_0x2af37f){logger['info'](_0x15ef('0x2d'));}})[_0x15ef('0x2e')](function(_0x283351){logger[_0x15ef('0x21')](_0x15ef('0x2f'),JSON[_0x15ef('0x15')](_0x283351));});}};EmailChannel[_0x15ef('0x17')][_0x15ef('0x1f')]=function(_0x4f8873){if(this['mailAccounts'][_0x4f8873]&&this[_0x15ef('0xc')][_0x4f8873][_0x15ef('0x12')]){if(this[_0x15ef('0xd')][this['mailAccounts'][_0x4f8873][_0x15ef('0x12')]['id']]){delete this[_0x15ef('0xd')][this['mailAccounts'][_0x4f8873][_0x15ef('0x12')]['id']];}this[_0x15ef('0xc')][_0x4f8873][_0x15ef('0x12')][_0x15ef('0x30')]=moment();this[_0x15ef('0xe')](_0x4f8873);}};EmailChannel[_0x15ef('0x17')][_0x15ef('0x31')]=function(_0x4ae93a,_0x175610){if(this[_0x15ef('0xc')][_0x4ae93a]){this[_0x15ef('0xc')][_0x4ae93a][_0x15ef('0x12')][_0x15ef('0x13')]=_0x15ef('0x21');this['mailAccounts'][_0x4ae93a][_0x15ef('0x12')][_0x15ef('0x14')]=_0x175610;return this[_0x15ef('0xe')](_0x4ae93a);}};EmailChannel[_0x15ef('0x17')]['sendMail']=function(_0x474fa8,_0x5e4912){return this[_0x15ef('0x32')][_0x15ef('0x33')](_0x474fa8,_0x5e4912);};EmailChannel[_0x15ef('0x17')]['verifySmtp']=function(_0x4149f6){var _0xc82747=this;if(this['mailAccounts'][_0x4149f6['id']]){if(_[_0x15ef('0x22')](this[_0x15ef('0xc')][_0x4149f6['id']]['Smtp'])){this[_0x15ef('0xc')][_0x4149f6['id']][_0x15ef('0x34')]={};}this[_0x15ef('0xc')][_0x4149f6['id']][_0x15ef('0x34')][_0x15ef('0x30')]=moment();return new BPromise(function(_0x5cc016,_0x19d341){return _0xc82747[_0x15ef('0x32')][_0x15ef('0x35')](_0x4149f6)[_0x15ef('0x2c')](function(_0x56da69){_0xc82747[_0x15ef('0xc')][_0x4149f6['id']][_0x15ef('0x34')]['status']=_0x15ef('0x36');_0xc82747[_0x15ef('0xc')][_0x4149f6['id']][_0x15ef('0x34')][_0x15ef('0x14')]='';_0xc82747[_0x15ef('0xe')](_0x4149f6['id']);_0x5cc016(_0x56da69);})[_0x15ef('0x2e')](function(_0x26ec79){_0xc82747[_0x15ef('0xc')][_0x4149f6['id']][_0x15ef('0x34')][_0x15ef('0x13')]=_0x15ef('0x21');_0xc82747['mailAccounts'][_0x4149f6['id']][_0x15ef('0x34')][_0x15ef('0x14')]=_0x26ec79;_0xc82747[_0x15ef('0xe')](_0x4149f6['id']);_0x19d341(_0x26ec79);});});}return this[_0x15ef('0x32')][_0x15ef('0x35')](_0x4149f6);};module[_0x15ef('0x37')]=EmailChannel;
\ No newline at end of file
+var _0x4dbd=['handleImapBox','connected','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','isNil','stringify','md5','refresh','hasOwnProperty','service','custom','box','bind','handleImapEmail','end','handleImapEnd','error','disabled'];(function(_0x3f192e,_0x1cd39e){var _0x2b55ff=function(_0x3edbc9){while(--_0x3edbc9){_0x3f192e['push'](_0x3f192e['shift']());}};_0x2b55ff(++_0x1cd39e);}(_0x4dbd,0xc3));var _0xd4db=function(_0x259955,_0x106314){_0x259955=_0x259955-0x0;var _0x25e7a7=_0x4dbd[_0x259955];return _0x25e7a7;};'use strict';var _=require(_0xd4db('0x0'));var moment=require(_0xd4db('0x1'));var BPromise=require(_0xd4db('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xd4db('0x3'))(_0xd4db('0x4'));config[_0xd4db('0x5')]=_[_0xd4db('0x6')](config['redis'],{'host':_0xd4db('0x7'),'port':0x18eb});var io=require(_0xd4db('0x8'))(new Redis(config[_0xd4db('0x5')]));var EmailImap=require(_0xd4db('0x9'));var EmailSmtp=require(_0xd4db('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x364b99){logger['info'](_0xd4db('0xb'));this[_0xd4db('0xc')]=_0x364b99['mailAccounts'];this[_0xd4db('0xd')]={};this[_0xd4db('0xe')]=new EmailSmtp();}EmailChannel[_0xd4db('0xf')][_0xd4db('0x10')]=function(_0x2abb7d){var _0x119a58=this[_0xd4db('0xc')][_0x2abb7d];var _0x453002={'id':_0x119a58['id'],'name':_0x119a58[_0xd4db('0x11')],'key':_0x119a58[_0xd4db('0x12')],'active':_0x119a58[_0xd4db('0x13')],'Imap':{'status':_0x119a58['Imap'][_0xd4db('0x14')],'messageStatus':_0x119a58[_0xd4db('0x15')][_0xd4db('0x16')],'total':_0x119a58[_0xd4db('0x15')]['total']}};if(_[_0xd4db('0x17')](md5Accounts[_0x2abb7d])){md5Accounts[_0x2abb7d]={};}var _0x43ccf8=md5(JSON[_0xd4db('0x18')](_0x453002));if(md5Accounts[_0x2abb7d][_0xd4db('0x19')]!==_0x43ccf8){md5Accounts[_0x2abb7d]['md5']=_0x43ccf8;io[_0xd4db('0x10')]('mailAccount:update',_0x453002);}};EmailChannel[_0xd4db('0xf')][_0xd4db('0x1a')]=function(_0x5018e8){for(var _0xc8ba12 in _0x5018e8){if(_0x5018e8[_0xd4db('0x1b')](_0xc8ba12)){if(_0x5018e8[_0xc8ba12][_0xd4db('0x15')]&&_0x5018e8[_0xc8ba12][_0xd4db('0x13')]){var _0x7095c0=_0x5018e8[_0xc8ba12][_0xd4db('0x15')];if(!_0x7095c0[_0xd4db('0x1c')]&&_0x5018e8[_0xc8ba12]['provider']!==_0xd4db('0x1d'))_0x7095c0[_0xd4db('0x1c')]=_0x5018e8[_0xc8ba12]['provider'];if(!this[_0xd4db('0xd')][_0xd4db('0x1b')](_0x7095c0['id'])){this[_0xd4db('0xd')][_0x7095c0['id']]=new EmailImap(_0x7095c0,_0x5018e8[_0xc8ba12][_0xd4db('0x4')]);this['imapAccounts'][_0x7095c0['id']]['on'](_0xd4db('0x1e'),this['handleImapBox'][_0xd4db('0x1f')](this,_0xc8ba12));this['imapAccounts'][_0x7095c0['id']]['on'](_0xd4db('0x4'),this[_0xd4db('0x20')][_0xd4db('0x1f')](this,_0xc8ba12));this[_0xd4db('0xd')][_0x7095c0['id']]['on'](_0xd4db('0x21'),this[_0xd4db('0x22')]['bind'](this,_0xc8ba12));this[_0xd4db('0xd')][_0x7095c0['id']]['on'](_0xd4db('0x23'),this['handleImapError'][_0xd4db('0x1f')](this,_0xc8ba12));}}else{if(_['isNil'](this[_0xd4db('0xc')][_0xc8ba12][_0xd4db('0x15')])){this['mailAccounts'][_0xc8ba12][_0xd4db('0x15')]={};}this['mailAccounts'][_0xc8ba12][_0xd4db('0x15')][_0xd4db('0x14')]=_0xd4db('0x24');this[_0xd4db('0xc')][_0xc8ba12]['Imap'][_0xd4db('0x16')]='';this['emit'](_0xc8ba12);}}}};EmailChannel['prototype'][_0xd4db('0x25')]=function(_0x127b47,_0x11231d){if(this[_0xd4db('0xc')][_0x127b47]){this['mailAccounts'][_0x127b47][_0xd4db('0x15')][_0xd4db('0x14')]=_0xd4db('0x26');this[_0xd4db('0xc')][_0x127b47][_0xd4db('0x15')][_0xd4db('0x16')]=_0x11231d[_0xd4db('0x11')];if(_0x11231d[_0xd4db('0x27')]){this[_0xd4db('0xc')][_0x127b47][_0xd4db('0x15')]['total']=_0x11231d[_0xd4db('0x27')][_0xd4db('0x28')];}return this[_0xd4db('0x10')](_0x127b47);}};EmailChannel[_0xd4db('0xf')]['handleImapEmail']=function(_0x2d00e3,_0x507c65){logger[_0xd4db('0x29')](_0xd4db('0x2a'),_0x507c65[_0xd4db('0x2b')],_0x507c65[_0xd4db('0x2c')],_0x507c65[_0xd4db('0x2d')],_0x2d00e3);if(this[_0xd4db('0xc')][_0x2d00e3]){return mailAccount[_0xd4db('0x2e')](_0x2d00e3,_0x507c65)[_0xd4db('0x2f')](function(_0x2f59d0){if(_0x2f59d0){logger[_0xd4db('0x29')](_0xd4db('0x30'));}})[_0xd4db('0x31')](function(_0xb53cf2){logger['error'](_0xd4db('0x32'),JSON[_0xd4db('0x18')](_0xb53cf2));});}};EmailChannel[_0xd4db('0xf')][_0xd4db('0x22')]=function(_0x1c58bd){if(this[_0xd4db('0xc')][_0x1c58bd]&&this[_0xd4db('0xc')][_0x1c58bd][_0xd4db('0x15')]){if(this[_0xd4db('0xd')][this[_0xd4db('0xc')][_0x1c58bd][_0xd4db('0x15')]['id']]){delete this[_0xd4db('0xd')][this[_0xd4db('0xc')][_0x1c58bd][_0xd4db('0x15')]['id']];}this[_0xd4db('0xc')][_0x1c58bd][_0xd4db('0x15')][_0xd4db('0x33')]=moment();this[_0xd4db('0x10')](_0x1c58bd);}};EmailChannel[_0xd4db('0xf')][_0xd4db('0x34')]=function(_0x4c8af3,_0x3a2b09){if(this[_0xd4db('0xc')][_0x4c8af3]){this[_0xd4db('0xc')][_0x4c8af3][_0xd4db('0x15')][_0xd4db('0x14')]=_0xd4db('0x23');this[_0xd4db('0xc')][_0x4c8af3]['Imap'][_0xd4db('0x16')]=_0x3a2b09;return this['emit'](_0x4c8af3);}};EmailChannel[_0xd4db('0xf')]['sendMail']=function(_0x23c886,_0x32eda7){return this[_0xd4db('0xe')][_0xd4db('0x35')](_0x23c886,_0x32eda7);};EmailChannel['prototype'][_0xd4db('0x36')]=function(_0x32a7e4){var _0x1d9e61=this;if(this[_0xd4db('0xc')][_0x32a7e4['id']]){if(_['isNil'](this[_0xd4db('0xc')][_0x32a7e4['id']][_0xd4db('0x37')])){this['mailAccounts'][_0x32a7e4['id']]['Smtp']={};}this[_0xd4db('0xc')][_0x32a7e4['id']][_0xd4db('0x37')]['lastSync']=moment();return new BPromise(function(_0x282363,_0x447491){return _0x1d9e61[_0xd4db('0xe')][_0xd4db('0x38')](_0x32a7e4)[_0xd4db('0x2f')](function(_0x28bce6){_0x1d9e61['mailAccounts'][_0x32a7e4['id']][_0xd4db('0x37')][_0xd4db('0x14')]='verified';_0x1d9e61[_0xd4db('0xc')][_0x32a7e4['id']][_0xd4db('0x37')][_0xd4db('0x16')]='';_0x1d9e61['emit'](_0x32a7e4['id']);_0x282363(_0x28bce6);})[_0xd4db('0x31')](function(_0x59605c){_0x1d9e61[_0xd4db('0xc')][_0x32a7e4['id']][_0xd4db('0x37')][_0xd4db('0x14')]=_0xd4db('0x23');_0x1d9e61['mailAccounts'][_0x32a7e4['id']]['Smtp'][_0xd4db('0x16')]=_0x59605c;_0x1d9e61['emit'](_0x32a7e4['id']);_0x447491(_0x59605c);});});}return this[_0xd4db('0xe')][_0xd4db('0x38')](_0x32a7e4);};module[_0xd4db('0x39')]=EmailChannel;
\ No newline at end of file
index 5fad915..c505a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd01=['body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleCloseBox','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','events','./utils','../../../config/logger','email','mailbox','account','getAccount','once','handleReady','end','handleEnd','bind','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','search','handleReadUnseen','fetch','message','error','handleFetchEnd','closeBox','handleFetchMessage'];(function(_0xa36327,_0x3c7411){var _0xa097e4=function(_0x1af3d2){while(--_0x1af3d2){_0xa36327['push'](_0xa36327['shift']());}};_0xa097e4(++_0x3c7411);}(_0xfd01,0x86));var _0x1fd0=function(_0x1cd9ca,_0x18fe7f){_0x1cd9ca=_0x1cd9ca-0x0;var _0x43380d=_0xfd01[_0x1cd9ca];return _0x43380d;};'use strict';var _=require(_0x1fd0('0x0'));var util=require('util');var Imap=require(_0x1fd0('0x1'));var simpleParser=require(_0x1fd0('0x2'))[_0x1fd0('0x3')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x1fd0('0x4'))['EventEmitter'];var utils=require(_0x1fd0('0x5'));var logger=require(_0x1fd0('0x6'))(_0x1fd0('0x7'));function EmailImap(_0x5a3d8f,_0x440c51){this[_0x1fd0('0x8')]=_0x5a3d8f[_0x1fd0('0x8')];this[_0x1fd0('0x9')]=this[_0x1fd0('0xa')](_0x5a3d8f,_0x440c51);this[_0x1fd0('0x1')]=new Imap(this[_0x1fd0('0x9')]);this[_0x1fd0('0x1')][_0x1fd0('0xb')]('ready',this[_0x1fd0('0xc')]['bind'](this));this[_0x1fd0('0x1')]['once'](_0x1fd0('0xd'),this[_0x1fd0('0xe')][_0x1fd0('0xf')](this));this['imap']['on']('error',this[_0x1fd0('0x10')]['bind'](this));this['imap'][_0x1fd0('0x11')]();}util[_0x1fd0('0x12')](EmailImap,EventEmitter);EmailImap[_0x1fd0('0x13')][_0x1fd0('0xa')]=function(_0x322e18,_0x35c4b9){var _0x30dd5f={'connTimeout':_0x322e18[_0x1fd0('0x14')]?_0x322e18[_0x1fd0('0x14')]*0x3e8:0x2710,'authTimeout':_0x322e18['authTimeout']?_0x322e18[_0x1fd0('0x15')]*0x3e8:0x1388};if(_0x322e18['service']){_0x30dd5f[_0x1fd0('0x16')]=_0x322e18[_0x1fd0('0x16')];if(_0x322e18['modernAuthentication']){_0x30dd5f[_0x1fd0('0x17')]=utils[_0x1fd0('0x18')](_0x322e18[_0x1fd0('0x19')][_0x1fd0('0x1a')],_0x322e18['user']);}else{_0x30dd5f[_0x1fd0('0x1b')]=_0x322e18[_0x1fd0('0x1b')];}}else{if(_0x322e18[_0x1fd0('0x1c')]){_0x30dd5f['user']=_0x322e18[_0x1fd0('0x16')];_0x30dd5f[_0x1fd0('0x1b')]=_0x322e18[_0x1fd0('0x1b')];}}_0x30dd5f[_0x1fd0('0x7')]=_0x35c4b9||_0x322e18[_0x1fd0('0x16')]||_0x1fd0('0x1d');_0x30dd5f[_0x1fd0('0x1e')]=_0x322e18[_0x1fd0('0x1e')];_0x30dd5f[_0x1fd0('0x1f')]=_0x322e18[_0x1fd0('0x1f')]||0x3e1;if(_0x322e18[_0x1fd0('0x20')]){_0x30dd5f[_0x1fd0('0x20')]=!![];}else{_0x30dd5f[_0x1fd0('0x20')]=![];_0x30dd5f[_0x1fd0('0x21')]=_0x1fd0('0x22');}return _0x30dd5f;};EmailImap['prototype'][_0x1fd0('0xc')]=function(){this[_0x1fd0('0x1')][_0x1fd0('0x23')](this['mailbox'],![],this[_0x1fd0('0x24')][_0x1fd0('0xf')](this));};EmailImap[_0x1fd0('0x13')][_0x1fd0('0x24')]=function(_0x4079c5,_0x4f4a9a){if(_0x4079c5){this[_0x1fd0('0x10')](_0x4079c5,!![]);}else{this[_0x1fd0('0x25')]('box',_0x4f4a9a);this['readUnseen']();}};EmailImap[_0x1fd0('0x13')]['handleCloseBox']=function(_0x5c197a){if(_0x5c197a){this['handleError'](_0x5c197a,!![]);}else{this[_0x1fd0('0x1')][_0x1fd0('0xd')]();}};EmailImap[_0x1fd0('0x13')]['readUnseen']=function(){this[_0x1fd0('0x1')][_0x1fd0('0x26')](['UNSEEN'],this[_0x1fd0('0x27')][_0x1fd0('0xf')](this));};EmailImap['prototype'][_0x1fd0('0x27')]=function(_0x2163d8,_0x51bc41){if(_0x2163d8){this[_0x1fd0('0x10')](_0x2163d8,!![]);}else{if(_0x51bc41['length']){try{var _0xfc999c=this['imap'][_0x1fd0('0x28')](_0x51bc41,{'bodies':'','markSeen':!![]});_0xfc999c['on'](_0x1fd0('0x29'),this['handleFetchMessage']['bind'](this));_0xfc999c[_0x1fd0('0xb')](_0x1fd0('0x2a'),this['handleFetchError'][_0x1fd0('0xf')](this));_0xfc999c[_0x1fd0('0xb')](_0x1fd0('0xd'),this[_0x1fd0('0x2b')][_0x1fd0('0xf')](this));}catch(_0xf9319c){logger[_0x1fd0('0x2a')](_0xf9319c);}}else{this[_0x1fd0('0x1')][_0x1fd0('0x2c')](!![],this['handleCloseBox'][_0x1fd0('0xf')](this));}}};EmailImap[_0x1fd0('0x13')][_0x1fd0('0x2d')]=function(_0x89b412){_0x89b412['on'](_0x1fd0('0x2e'),this[_0x1fd0('0x2f')][_0x1fd0('0xf')](this));_0x89b412[_0x1fd0('0xb')](_0x1fd0('0x30'),this[_0x1fd0('0x31')][_0x1fd0('0xf')](this));_0x89b412['once']('end',this[_0x1fd0('0x32')][_0x1fd0('0xf')](this));};EmailImap[_0x1fd0('0x13')]['handleMessageBody']=function(_0x10aa29){simpleParser(_0x10aa29,{'Iconv':Iconv},this[_0x1fd0('0x33')][_0x1fd0('0xf')](this));};EmailImap[_0x1fd0('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x1fd0('0x13')][_0x1fd0('0x32')]=function(){};EmailImap[_0x1fd0('0x13')][_0x1fd0('0x33')]=function(_0x1af67a,_0x51413f){if(_0x1af67a){logger[_0x1fd0('0x2a')](_0x1af67a);}else{var _0x1d7ee9=this;utils[_0x1fd0('0x34')](this[_0x1fd0('0x9')],_0x51413f,function(_0x10e572){_0x1d7ee9[_0x1fd0('0x25')](_0x1fd0('0x7'),_0x10e572);});}};EmailImap['prototype'][_0x1fd0('0x2b')]=function(){this[_0x1fd0('0x1')][_0x1fd0('0x2c')](!![],this[_0x1fd0('0x35')]['bind'](this));};EmailImap[_0x1fd0('0x13')][_0x1fd0('0x36')]=function(_0x46e701){this[_0x1fd0('0x10')](_0x46e701);this[_0x1fd0('0x1')][_0x1fd0('0x2c')](!![],this[_0x1fd0('0x35')]['bind'](this));};EmailImap[_0x1fd0('0x13')][_0x1fd0('0xe')]=function(){this['emit'](_0x1fd0('0xd'));};EmailImap[_0x1fd0('0x13')][_0x1fd0('0x10')]=function(_0x50092b,_0x3bf45b){logger[_0x1fd0('0x2a')](_0x1fd0('0x10'),this[_0x1fd0('0x9')][_0x1fd0('0x7')],JSON[_0x1fd0('0x37')](_0x50092b));var _0x4bfb44='';if(_0x50092b){if(_0x50092b['textCode']){_0x4bfb44=_0x50092b[_0x1fd0('0x38')];}else{for(var _0x1eb5bb in _0x50092b){if(_0x50092b[_0x1fd0('0x39')](_0x1eb5bb)){_0x4bfb44+=_[_0x1fd0('0x3a')](_0x1eb5bb)+':\x20'+_0x50092b[_0x1eb5bb]+'\x0a';}}}}if(_0x3bf45b){this[_0x1fd0('0x1')]['end']();}else{this[_0x1fd0('0x25')](_0x1fd0('0x2a'),_0x4bfb44);this[_0x1fd0('0x25')]('end');}};module[_0x1fd0('0x3b')]=EmailImap;
\ No newline at end of file
+var _0x65fc=['body','handleMessageBody','attributes','handleMessageAttributes','end','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','events','email','mailbox','account','getAccount','once','ready','handleReady','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox'];(function(_0x5bc681,_0x692cb9){var _0x28223d=function(_0x494d92){while(--_0x494d92){_0x5bc681['push'](_0x5bc681['shift']());}};_0x28223d(++_0x692cb9);}(_0x65fc,0x92));var _0xc65f=function(_0x17c283,_0x587fcc){_0x17c283=_0x17c283-0x0;var _0x4e0800=_0x65fc[_0x17c283];return _0x4e0800;};'use strict';var _=require(_0xc65f('0x0'));var util=require(_0xc65f('0x1'));var Imap=require(_0xc65f('0x2'));var simpleParser=require('mailparser')[_0xc65f('0x3')];var Iconv=require(_0xc65f('0x4'))[_0xc65f('0x5')];var EventEmitter=require(_0xc65f('0x6'))['EventEmitter'];var utils=require('./utils');var logger=require('../../../config/logger')(_0xc65f('0x7'));function EmailImap(_0x4f4713,_0x3f5b36){this[_0xc65f('0x8')]=_0x4f4713[_0xc65f('0x8')];this[_0xc65f('0x9')]=this[_0xc65f('0xa')](_0x4f4713,_0x3f5b36);this[_0xc65f('0x2')]=new Imap(this['account']);this['imap'][_0xc65f('0xb')](_0xc65f('0xc'),this[_0xc65f('0xd')][_0xc65f('0xe')](this));this[_0xc65f('0x2')][_0xc65f('0xb')]('end',this[_0xc65f('0xf')][_0xc65f('0xe')](this));this[_0xc65f('0x2')]['on'](_0xc65f('0x10'),this[_0xc65f('0x11')]['bind'](this));this[_0xc65f('0x2')][_0xc65f('0x12')]();}util[_0xc65f('0x13')](EmailImap,EventEmitter);EmailImap[_0xc65f('0x14')][_0xc65f('0xa')]=function(_0x3a90e4,_0x23d26e){var _0x3e79f8={'connTimeout':_0x3a90e4[_0xc65f('0x15')]?_0x3a90e4[_0xc65f('0x15')]*0x3e8:0x2710,'authTimeout':_0x3a90e4[_0xc65f('0x16')]?_0x3a90e4[_0xc65f('0x16')]*0x3e8:0x1388};if(_0x3a90e4[_0xc65f('0x17')]){_0x3e79f8[_0xc65f('0x18')]=_0x3a90e4[_0xc65f('0x18')];if(_0x3a90e4[_0xc65f('0x19')]){_0x3e79f8[_0xc65f('0x1a')]=utils[_0xc65f('0x1b')](_0x3a90e4[_0xc65f('0x1c')]['data5'],_0x3a90e4['user']);}else{_0x3e79f8[_0xc65f('0x1d')]=_0x3a90e4[_0xc65f('0x1d')];}}else{if(_0x3a90e4[_0xc65f('0x1e')]){_0x3e79f8[_0xc65f('0x18')]=_0x3a90e4[_0xc65f('0x18')];_0x3e79f8[_0xc65f('0x1d')]=_0x3a90e4[_0xc65f('0x1d')];}}_0x3e79f8['email']=_0x23d26e||_0x3a90e4[_0xc65f('0x18')]||_0xc65f('0x1f');_0x3e79f8[_0xc65f('0x20')]=_0x3a90e4[_0xc65f('0x20')];_0x3e79f8[_0xc65f('0x21')]=_0x3a90e4['port']||0x3e1;if(_0x3a90e4['tls']){_0x3e79f8[_0xc65f('0x22')]=!![];}else{_0x3e79f8[_0xc65f('0x22')]=![];_0x3e79f8[_0xc65f('0x23')]=_0xc65f('0x24');}return _0x3e79f8;};EmailImap['prototype']['handleReady']=function(){this[_0xc65f('0x2')][_0xc65f('0x25')](this[_0xc65f('0x8')],![],this[_0xc65f('0x26')][_0xc65f('0xe')](this));};EmailImap['prototype'][_0xc65f('0x26')]=function(_0x5f20e7,_0x2a1383){if(_0x5f20e7){this[_0xc65f('0x11')](_0x5f20e7,!![]);}else{this[_0xc65f('0x27')](_0xc65f('0x28'),_0x2a1383);this[_0xc65f('0x29')]();}};EmailImap[_0xc65f('0x14')][_0xc65f('0x2a')]=function(_0x2c85d0){if(_0x2c85d0){this[_0xc65f('0x11')](_0x2c85d0,!![]);}else{this[_0xc65f('0x2')]['end']();}};EmailImap[_0xc65f('0x14')][_0xc65f('0x29')]=function(){this[_0xc65f('0x2')][_0xc65f('0x2b')]([_0xc65f('0x2c')],this[_0xc65f('0x2d')][_0xc65f('0xe')](this));};EmailImap[_0xc65f('0x14')][_0xc65f('0x2d')]=function(_0x4efc3b,_0x21f049){if(_0x4efc3b){this[_0xc65f('0x11')](_0x4efc3b,!![]);}else{if(_0x21f049[_0xc65f('0x2e')]){try{var _0x4f2f00=this[_0xc65f('0x2')][_0xc65f('0x2f')](_0x21f049,{'bodies':'','markSeen':!![]});_0x4f2f00['on'](_0xc65f('0x30'),this[_0xc65f('0x31')][_0xc65f('0xe')](this));_0x4f2f00[_0xc65f('0xb')](_0xc65f('0x10'),this['handleFetchError'][_0xc65f('0xe')](this));_0x4f2f00['once']('end',this[_0xc65f('0x32')]['bind'](this));}catch(_0x3690dc){logger[_0xc65f('0x10')](_0x3690dc);}}else{this[_0xc65f('0x2')][_0xc65f('0x33')](!![],this[_0xc65f('0x2a')]['bind'](this));}}};EmailImap['prototype'][_0xc65f('0x31')]=function(_0xcbcc09){_0xcbcc09['on'](_0xc65f('0x34'),this[_0xc65f('0x35')]['bind'](this));_0xcbcc09['once'](_0xc65f('0x36'),this[_0xc65f('0x37')][_0xc65f('0xe')](this));_0xcbcc09[_0xc65f('0xb')](_0xc65f('0x38'),this[_0xc65f('0x39')]['bind'](this));};EmailImap[_0xc65f('0x14')][_0xc65f('0x35')]=function(_0x42e3ce){simpleParser(_0x42e3ce,{'Iconv':Iconv},this[_0xc65f('0x3a')][_0xc65f('0xe')](this));};EmailImap[_0xc65f('0x14')][_0xc65f('0x37')]=function(){};EmailImap['prototype'][_0xc65f('0x39')]=function(){};EmailImap[_0xc65f('0x14')][_0xc65f('0x3a')]=function(_0x45f1bb,_0x583860){if(_0x45f1bb){logger[_0xc65f('0x10')](_0x45f1bb);}else{var _0x236805=this;utils[_0xc65f('0x3b')](this[_0xc65f('0x9')],_0x583860,function(_0x5e877d){_0x236805[_0xc65f('0x27')](_0xc65f('0x7'),_0x5e877d);});}};EmailImap['prototype'][_0xc65f('0x32')]=function(){this[_0xc65f('0x2')][_0xc65f('0x33')](!![],this['handleCloseBox'][_0xc65f('0xe')](this));};EmailImap[_0xc65f('0x14')][_0xc65f('0x3c')]=function(_0x4ed2a1){this[_0xc65f('0x11')](_0x4ed2a1);this[_0xc65f('0x2')]['closeBox'](!![],this[_0xc65f('0x2a')][_0xc65f('0xe')](this));};EmailImap[_0xc65f('0x14')][_0xc65f('0xf')]=function(){this[_0xc65f('0x27')](_0xc65f('0x38'));};EmailImap[_0xc65f('0x14')][_0xc65f('0x11')]=function(_0x5a3f99,_0x358ed8){logger[_0xc65f('0x10')](_0xc65f('0x11'),this['account']['email'],JSON[_0xc65f('0x3d')](_0x5a3f99));var _0x154304='';if(_0x5a3f99){if(_0x5a3f99[_0xc65f('0x3e')]){_0x154304=_0x5a3f99[_0xc65f('0x3e')];}else{for(var _0x39672e in _0x5a3f99){if(_0x5a3f99[_0xc65f('0x3f')](_0x39672e)){_0x154304+=_[_0xc65f('0x40')](_0x39672e)+':\x20'+_0x5a3f99[_0x39672e]+'\x0a';}}}}if(_0x358ed8){this['imap'][_0xc65f('0x38')]();}else{this[_0xc65f('0x27')](_0xc65f('0x10'),_0x154304);this[_0xc65f('0x27')](_0xc65f('0x38'));}};module[_0xc65f('0x41')]=EmailImap;
\ No newline at end of file
index fc44d4e..cd9edc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6f0=['compile','sendMail','toString','verify','createTransport','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x4d150a,_0x25f904){var _0x885bd4=function(_0x552a7d){while(--_0x552a7d){_0x4d150a['push'](_0x4d150a['shift']());}};_0x885bd4(++_0x25f904);}(_0xa6f0,0x1a6));var _0x0a6f=function(_0x212e57,_0x54d9c1){_0x212e57=_0x212e57-0x0;var _0x45beae=_0xa6f0[_0x212e57];return _0x45beae;};'use strict';var nodemailer=require(_0x0a6f('0x0'));var inlineBase64=require(_0x0a6f('0x1'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x38256c,_0xd94ca8){return new Promise(function(_0x96f05d,_0x530604){var _0x190e76=nodemailer['createTransport'](_0x38256c);_0x190e76['use'](_0x0a6f('0x2'),inlineBase64());_0x190e76[_0x0a6f('0x3')](_0xd94ca8,function(_0x178aac,_0x5129d7){if(_0x178aac){_0x530604(_0x178aac[_0x0a6f('0x4')]());}else{_0x96f05d(_0x5129d7);}});});};EmailSmtp['prototype'][_0x0a6f('0x5')]=function(_0x182a13){return new Promise(function(_0x79d8b1,_0x4ac808){var _0x74cb6=nodemailer[_0x0a6f('0x6')](_0x182a13);_0x74cb6[_0x0a6f('0x5')](function(_0x9d74f,_0x21a1ec){if(_0x9d74f){_0x4ac808(_0x9d74f[_0x0a6f('0x4')]());}else{if(_0x21a1ec){_0x79d8b1(_0x21a1ec);}else{_0x4ac808('Not\x20verifired');}}});});};module[_0x0a6f('0x7')]=EmailSmtp;
\ No newline at end of file
+var _0x120b=['createTransport','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use','compile','sendMail','toString'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0x120b,0x116));var _0xb120=function(_0x4a2f85,_0x6983d2){_0x4a2f85=_0x4a2f85-0x0;var _0x4d5117=_0x120b[_0x4a2f85];return _0x4d5117;};'use strict';var nodemailer=require(_0xb120('0x0'));var inlineBase64=require(_0xb120('0x1'));function EmailSmtp(){}EmailSmtp[_0xb120('0x2')][_0xb120('0x3')]=function(_0xa7c134,_0x2411d5){return new Promise(function(_0x556815,_0x3a942b){var _0x279338=nodemailer['createTransport'](_0xa7c134);_0x279338[_0xb120('0x4')](_0xb120('0x5'),inlineBase64());_0x279338[_0xb120('0x6')](_0x2411d5,function(_0x4fbbb1,_0x3a4bf7){if(_0x4fbbb1){_0x3a942b(_0x4fbbb1[_0xb120('0x7')]());}else{_0x556815(_0x3a4bf7);}});});};EmailSmtp[_0xb120('0x2')]['verify']=function(_0x44229d){return new Promise(function(_0x4752a8,_0x55a788){var _0x8bd2fd=nodemailer[_0xb120('0x8')](_0x44229d);_0x8bd2fd[_0xb120('0x9')](function(_0x39b447,_0x6d4ee8){if(_0x39b447){_0x55a788(_0x39b447['toString']());}else{if(_0x6d4ee8){_0x4752a8(_0x6d4ee8);}else{_0x55a788(_0xb120('0xa'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index b66c75c..257178e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5990=['bcc','attach','type','filename','attachment-','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','parser','from','subject','messageId','inReplyTo','date','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','<p>Empty\x20message</p>','Attachments','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','generate','test','html','replace','includes','<img','attachments','push','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','isEmpty'];(function(_0x4cbcd4,_0x1cba2e){var _0x2cbd42=function(_0x35a04d){while(--_0x35a04d){_0x4cbcd4['push'](_0x4cbcd4['shift']());}};_0x2cbd42(++_0x1cba2e);}(_0x5990,0x6b));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require(_0x0599('0x0'));var random=require(_0x0599('0x1'));var fs=require('fs');var path=require(_0x0599('0x2'));var util=require(_0x0599('0x3'));var tnef=require(_0x0599('0x4'));var logger=require(_0x0599('0x5'))(_0x0599('0x6'));var config=require(_0x0599('0x7'));function getAddress(_0x30a824){var _0x3733ab=_[_0x0599('0x8')](_0x30a824[_0x0599('0x9')]);return _0x3733ab&&_0x3733ab[_0x0599('0xa')]?_0x3733ab[_0x0599('0xa')]:_0x0599('0xb')+random['generate'](0x6)+_0x0599('0xc');}function getFirstName(_0x4d5c64){var _0x1763c0=_[_0x0599('0x8')](_0x4d5c64[_0x0599('0x9')]);if(_0x1763c0&&_0x1763c0[_0x0599('0xd')]){if(_0x1763c0[_0x0599('0xd')]==_0x1763c0[_0x0599('0xa')]){return _0x1763c0[_0x0599('0xd')][_0x0599('0xe')](0x0,_0x1763c0[_0x0599('0xd')][_0x0599('0xf')]('@'));}var _0x334dc2=_0x1763c0[_0x0599('0xd')][_0x0599('0x10')](/\s+/);return _0x334dc2[_0x0599('0x11')]>0x1?_0x334dc2[_0x0599('0x12')](0x0,-0x1)[_0x0599('0x13')]('\x20'):_0x1763c0[_0x0599('0xd')];}return _0x0599('0x14');}function getLastName(_0x323455){var _0x5a92bf=_['head'](_0x323455[_0x0599('0x9')]);if(_0x5a92bf&&_0x5a92bf[_0x0599('0xd')]){var _0x24775e=_0x5a92bf[_0x0599('0xd')][_0x0599('0x10')](/\s+/);return _0x24775e[_0x0599('0x11')]>0x1?_0x24775e[_0x0599('0x15')]():'';}return'';}function getMails(_0x30bb0c,_0x3f679f){var _0x41986a='';for(var _0x48fae5=0x0;_0x48fae5<_0x3f679f[_0x0599('0x9')]['length'];_0x48fae5+=0x1){if(_0x3f679f[_0x0599('0x9')][_0x48fae5][_0x0599('0xa')]!==_0x30bb0c){if(!_['isEmpty'](_0x41986a)){_0x41986a+=',';}_0x41986a+=_0x3f679f[_0x0599('0x9')][_0x48fae5][_0x0599('0xd')]||_0x3f679f[_0x0599('0x9')][_0x48fae5][_0x0599('0xa')]||'';_0x41986a+='\x20<';_0x41986a+=_0x3f679f['value'][_0x48fae5][_0x0599('0xa')]?_0x3f679f[_0x0599('0x9')][_0x48fae5][_0x0599('0xa')]:'anonymous'+random[_0x0599('0x16')](0x6)+_0x0599('0xc');_0x41986a+='>';}}return _0x41986a;}function parseEmail(_0x455b48,_0x133da6,_0x743530){if(_0x133da6['html']){var _0x5eeb80=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5eeb80[_0x0599('0x17')](_0x133da6[_0x0599('0x18')])){_0x133da6['html']=_0x133da6['html'][_0x0599('0x19')](_0x5eeb80,'');}if(_0x133da6['html'][_0x0599('0x1a')](_0x0599('0x1b'))){var _0xa67fe0=[];_0x133da6[_0x0599('0x1c')]['forEach'](_0x1273a2=>{_0xa67fe0[_0x0599('0x1d')](_0x1273a2['filename']);});var _0x3d9763=/<img.*? _SRC(.*?)[^>]+>/g;var _0x295b9e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x472b25=_0x133da6[_0x0599('0x18')][_0x0599('0x19')](_0x295b9e,_0x0599('0x1e'));var _0x733ef9=_0x472b25[_0x0599('0x19')](_0x3d9763,'_IMG');for(let _0x5d09fd=0x0;_0x5d09fd<_0xa67fe0[_0x0599('0x11')];_0x5d09fd++){var _0x5b70e3=_0x733ef9['replace'](_0x0599('0x1f'),_0x0599('0x20')+_0xa67fe0[_0x5d09fd]+'\x20]</span>');_0x733ef9=_0x5b70e3;}_0x133da6[_0x0599('0x18')]=_0x733ef9;}_0x743530[_0x0599('0x21')]=_0x133da6[_0x0599('0x18')];}else{_0x743530[_0x0599('0x21')]=_0x133da6[_0x0599('0x22')];}if(_0x743530[_0x0599('0x21')]){_0x743530['body']=_0x743530['body'][_0x0599('0x19')](/<a\s+/gi,_0x0599('0x23'));}if(_0x133da6['to']){_0x743530[_0x0599('0x24')]['originTo']=getMails(null,_0x133da6['to']);var _0x13039c=getMails(_0x455b48['email'],_0x133da6['to']);if(!_['isEmpty'](_0x13039c)){_0x743530['message']['cc']+=_0x13039c;}}if(_0x133da6['cc']){_0x743530[_0x0599('0x24')][_0x0599('0x25')]=getMails(null,_0x133da6['cc']);var _0xfb9b47=getMails(_0x455b48[_0x0599('0x6')],_0x133da6['cc']);if(!_[_0x0599('0x26')](_0xfb9b47)){if(!_[_0x0599('0x26')](_0x743530[_0x0599('0x24')]['cc'])){_0x743530[_0x0599('0x24')]['cc']+=',';}_0x743530[_0x0599('0x24')]['cc']+=_0xfb9b47;}}if(!_[_0x0599('0x1a')](_0x743530[_0x0599('0x24')]['originTo'],_0x455b48[_0x0599('0x6')])&&!_['includes'](_0x743530[_0x0599('0x24')][_0x0599('0x25')],_0x455b48[_0x0599('0x6')])){_0x743530['message'][_0x0599('0x27')]=_0x455b48[_0x0599('0x6')];}if(_0x133da6[_0x0599('0x1c')]&&_0x133da6['attachments']['length']){_0x743530[_0x0599('0x24')][_0x0599('0x28')]=_0x133da6[_0x0599('0x1c')][_0x0599('0x11')];for(var _0x5ccf57=0x0,_0x2da25d,_0x234884,_0x42138b;_0x5ccf57<_0x133da6[_0x0599('0x1c')]['length'];_0x5ccf57+=0x1){if(_0x133da6[_0x0599('0x1c')][_0x5ccf57][_0x0599('0x29')]==='attachment'){_0x42138b=_0x133da6[_0x0599('0x1c')][_0x5ccf57][_0x0599('0x2a')]||_0x0599('0x2b')+_0x5ccf57;_0x2da25d=util['format'](_0x0599('0x2c'),Date[_0x0599('0x2d')](),_0x42138b);_0x234884=path[_0x0599('0x13')](config[_0x0599('0x2e')],_0x0599('0x2f'),_0x2da25d);fs[_0x0599('0x30')](_0x234884,_0x133da6[_0x0599('0x1c')][_0x5ccf57][_0x0599('0x31')]);_0x743530['message']['attachments']['push']({'name':_0x42138b,'basename':_0x2da25d,'type':_0x133da6['attachments'][_0x5ccf57][_0x0599('0x32')],'filepath':_0x234884});}}}if(_0x133da6[_0x0599('0x33')]&&_0x133da6[_0x0599('0x33')][_0x0599('0x11')]>0x0){var _0x538571=[_0x0599('0x34'),_0x0599('0x35'),_0x0599('0x36')];for(var _0x59b1a6=0x0;_0x59b1a6<_0x133da6[_0x0599('0x33')][_0x0599('0x11')];_0x59b1a6++){var _0x598392=_[_0x0599('0xf')](_0x538571,_0x133da6[_0x0599('0x33')][_0x59b1a6]['line']);if(_0x598392>=0x0){_0x743530[_0x0599('0x37')]=!![];}}}return _0x743530;}exports[_0x0599('0x38')]=function(_0x44f87a,_0x1b3880,_0xb59e4f){var _0x58cd6c={'from':getAddress(_0x1b3880[_0x0599('0x39')]),'firstName':getFirstName(_0x1b3880[_0x0599('0x39')]),'lastName':getLastName(_0x1b3880[_0x0599('0x39')]),'mapKey':_0x0599('0x6'),'message':{'from':getMails(_0x44f87a[_0x0599('0x6')],_0x1b3880[_0x0599('0x39')]),'to':_0x44f87a[_0x0599('0x6')],'cc':'','subject':_0x1b3880[_0x0599('0x3a')]||'','messageId':_0x1b3880[_0x0599('0x3b')],'inReplyTo':_0x1b3880[_0x0599('0x3c')],'sentAt':moment(_0x1b3880[_0x0599('0x3d')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x1b3880[_0x0599('0x18')]&&!_0x1b3880[_0x0599('0x22')]){var _0x3b8a2b=_[_0x0599('0x3e')](_0x1b3880['attachments'],{'contentType':'application/ms-tnef'});if(_0x3b8a2b[_0x0599('0x11')]){logger['info'](util['format'](_0x0599('0x3f'),_0x1b3880[_0x0599('0x3b')]));tnef[_0x0599('0x40')](_[_0x0599('0x41')](_0x3b8a2b)['content'],function(_0x107901,_0x377183){if(_0x377183){_0x1b3880[_0x0599('0x18')]=_0x377183['BodyHTML']||_0x0599('0x42');if(_0x377183[_0x0599('0x43')]){for(var _0x394321=0x0;_0x394321<_0x377183[_0x0599('0x43')][_0x0599('0x11')];_0x394321++){var _0x4d26a9=_0x377183[_0x0599('0x43')][_0x394321];_0x58cd6c[_0x0599('0x24')][_0x0599('0x1c')]['push']({'filename':_0x4d26a9['Title'],'content':Buffer[_0x0599('0x39')](_0x4d26a9[_0x0599('0x44')])});}}}_0xb59e4f(parseEmail(_0x44f87a,_0x1b3880,_0x58cd6c));});}else{_0x1b3880['html']=_0x0599('0x42');_0xb59e4f(parseEmail(_0x44f87a,_0x1b3880,_0x58cd6c));}}else{_0xb59e4f(parseEmail(_0x44f87a,_0x1b3880,_0x58cd6c));}};exports[_0x0599('0x45')]=function(_0x25c648,_0x1f0a30){var _0x480e65=['user='+(_0x1f0a30||''),_0x0599('0x46')+_0x25c648,'',''];return Buffer[_0x0599('0x39')](_0x480e65[_0x0599('0x13')]('\ 1'),_0x0599('0x47'))[_0x0599('0x48')]('base64');};
\ No newline at end of file
+var _0x730c=['<img','push','filename','_SRC','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','originTo','bcc','attachments','attach','type','attachment','attachment-','format','%s-%s','root','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','isAutoreply','parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','BodyHTML','Attachments','Title','Data','<p>Empty\x20message</p>','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous','@xcally.com','head','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','generate','html','replace','includes'];(function(_0x3d81e7,_0xc5b4c0){var _0x21bd16=function(_0x786c39){while(--_0x786c39){_0x3d81e7['push'](_0x3d81e7['shift']());}};_0x21bd16(++_0xc5b4c0);}(_0x730c,0x106));var _0xc730=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x730c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc730('0x0'));var moment=require(_0xc730('0x1'));var random=require(_0xc730('0x2'));var fs=require('fs');var path=require(_0xc730('0x3'));var util=require(_0xc730('0x4'));var tnef=require(_0xc730('0x5'));var logger=require('../../../config/logger')(_0xc730('0x6'));var config=require(_0xc730('0x7'));function getAddress(_0x6b2ba){var _0x3346df=_['head'](_0x6b2ba[_0xc730('0x8')]);return _0x3346df&&_0x3346df['address']?_0x3346df[_0xc730('0x9')]:_0xc730('0xa')+random['generate'](0x6)+_0xc730('0xb');}function getFirstName(_0x47a39a){var _0x58a50e=_[_0xc730('0xc')](_0x47a39a[_0xc730('0x8')]);if(_0x58a50e&&_0x58a50e[_0xc730('0xd')]){if(_0x58a50e[_0xc730('0xd')]==_0x58a50e[_0xc730('0x9')]){return _0x58a50e[_0xc730('0xd')][_0xc730('0xe')](0x0,_0x58a50e[_0xc730('0xd')][_0xc730('0xf')]('@'));}var _0x1d366f=_0x58a50e[_0xc730('0xd')][_0xc730('0x10')](/\s+/);return _0x1d366f[_0xc730('0x11')]>0x1?_0x1d366f['slice'](0x0,-0x1)[_0xc730('0x12')]('\x20'):_0x58a50e[_0xc730('0xd')];}return _0xc730('0x13');}function getLastName(_0x1d8eb5){var _0x1a7b91=_[_0xc730('0xc')](_0x1d8eb5[_0xc730('0x8')]);if(_0x1a7b91&&_0x1a7b91[_0xc730('0xd')]){var _0x1b13e5=_0x1a7b91[_0xc730('0xd')][_0xc730('0x10')](/\s+/);return _0x1b13e5[_0xc730('0x11')]>0x1?_0x1b13e5[_0xc730('0x14')]():'';}return'';}function getMails(_0x2e8bd2,_0x1360cc){var _0x4592d5='';for(var _0x6eab4b=0x0;_0x6eab4b<_0x1360cc['value'][_0xc730('0x11')];_0x6eab4b+=0x1){if(_0x1360cc[_0xc730('0x8')][_0x6eab4b]['address']!==_0x2e8bd2){if(!_[_0xc730('0x15')](_0x4592d5)){_0x4592d5+=',';}_0x4592d5+=_0x1360cc['value'][_0x6eab4b][_0xc730('0xd')]||_0x1360cc[_0xc730('0x8')][_0x6eab4b]['address']||'';_0x4592d5+='\x20<';_0x4592d5+=_0x1360cc['value'][_0x6eab4b][_0xc730('0x9')]?_0x1360cc[_0xc730('0x8')][_0x6eab4b][_0xc730('0x9')]:_0xc730('0xa')+random[_0xc730('0x16')](0x6)+'@xcally.com';_0x4592d5+='>';}}return _0x4592d5;}function parseEmail(_0x2968e0,_0x589e8f,_0x33d9b9){if(_0x589e8f[_0xc730('0x17')]){var _0x2ebb3f=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x2ebb3f['test'](_0x589e8f['html'])){_0x589e8f[_0xc730('0x17')]=_0x589e8f[_0xc730('0x17')][_0xc730('0x18')](_0x2ebb3f,'');}if(_0x589e8f[_0xc730('0x17')][_0xc730('0x19')](_0xc730('0x1a'))){var _0x29fdae=[];_0x589e8f['attachments']['forEach'](_0x2206a5=>{_0x29fdae[_0xc730('0x1b')](_0x2206a5[_0xc730('0x1c')]);});var _0x59ffde=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1da71b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x19658b=_0x589e8f[_0xc730('0x17')][_0xc730('0x18')](_0x1da71b,_0xc730('0x1d'));var _0x53cd20=_0x19658b['replace'](_0x59ffde,'_IMG');for(let _0x1523fb=0x0;_0x1523fb<_0x29fdae[_0xc730('0x11')];_0x1523fb++){var _0x1eddf7=_0x53cd20['replace']('_IMG',_0xc730('0x1e')+_0x29fdae[_0x1523fb]+_0xc730('0x1f'));_0x53cd20=_0x1eddf7;}_0x589e8f['html']=_0x53cd20;}_0x33d9b9[_0xc730('0x20')]=_0x589e8f[_0xc730('0x17')];}else{_0x33d9b9[_0xc730('0x20')]=_0x589e8f[_0xc730('0x21')];}if(_0x33d9b9['body']){_0x33d9b9[_0xc730('0x20')]=_0x33d9b9[_0xc730('0x20')]['replace'](/<a\s+/gi,_0xc730('0x22'));}if(_0x589e8f['to']){_0x33d9b9[_0xc730('0x23')]['originTo']=getMails(null,_0x589e8f['to']);var _0xd8458c=getMails(_0x2968e0[_0xc730('0x6')],_0x589e8f['to']);if(!_[_0xc730('0x15')](_0xd8458c)){_0x33d9b9[_0xc730('0x23')]['cc']+=_0xd8458c;}}if(_0x589e8f['cc']){_0x33d9b9[_0xc730('0x23')][_0xc730('0x24')]=getMails(null,_0x589e8f['cc']);var _0x406dc1=getMails(_0x2968e0[_0xc730('0x6')],_0x589e8f['cc']);if(!_[_0xc730('0x15')](_0x406dc1)){if(!_[_0xc730('0x15')](_0x33d9b9['message']['cc'])){_0x33d9b9['message']['cc']+=',';}_0x33d9b9[_0xc730('0x23')]['cc']+=_0x406dc1;}}if(!_[_0xc730('0x19')](_0x33d9b9[_0xc730('0x23')][_0xc730('0x25')],_0x2968e0[_0xc730('0x6')])&&!_[_0xc730('0x19')](_0x33d9b9[_0xc730('0x23')][_0xc730('0x24')],_0x2968e0[_0xc730('0x6')])){_0x33d9b9[_0xc730('0x23')][_0xc730('0x26')]=_0x2968e0['email'];}if(_0x589e8f[_0xc730('0x27')]&&_0x589e8f[_0xc730('0x27')][_0xc730('0x11')]){_0x33d9b9[_0xc730('0x23')][_0xc730('0x28')]=_0x589e8f[_0xc730('0x27')][_0xc730('0x11')];for(var _0x4e5b42=0x0,_0x1bb8f3,_0xdc38ab,_0x1052ea;_0x4e5b42<_0x589e8f[_0xc730('0x27')][_0xc730('0x11')];_0x4e5b42+=0x1){if(_0x589e8f[_0xc730('0x27')][_0x4e5b42][_0xc730('0x29')]===_0xc730('0x2a')){_0x1052ea=_0x589e8f['attachments'][_0x4e5b42]['filename']||_0xc730('0x2b')+_0x4e5b42;_0x1bb8f3=util[_0xc730('0x2c')](_0xc730('0x2d'),Date['now'](),_0x1052ea);_0xdc38ab=path[_0xc730('0x12')](config[_0xc730('0x2e')],'server/files/attachments/',_0x1bb8f3);fs['writeFileSync'](_0xdc38ab,_0x589e8f[_0xc730('0x27')][_0x4e5b42]['content']);_0x33d9b9[_0xc730('0x23')]['attachments'][_0xc730('0x1b')]({'name':_0x1052ea,'basename':_0x1bb8f3,'type':_0x589e8f[_0xc730('0x27')][_0x4e5b42][_0xc730('0x2f')],'filepath':_0xdc38ab});}}}if(_0x589e8f[_0xc730('0x30')]&&_0x589e8f[_0xc730('0x30')][_0xc730('0x11')]>0x0){var _0x2abdd1=[_0xc730('0x31'),'X-Auto-Response-Suppress:\x20All',_0xc730('0x32')];for(var _0x355063=0x0;_0x355063<_0x589e8f[_0xc730('0x30')][_0xc730('0x11')];_0x355063++){var _0xf22e86=_[_0xc730('0xf')](_0x2abdd1,_0x589e8f['headerLines'][_0x355063]['line']);if(_0xf22e86>=0x0){_0x33d9b9[_0xc730('0x33')]=!![];}}}return _0x33d9b9;}exports[_0xc730('0x34')]=function(_0x41918d,_0x13a010,_0x2af1ba){var _0x44bc06={'from':getAddress(_0x13a010[_0xc730('0x35')]),'firstName':getFirstName(_0x13a010[_0xc730('0x35')]),'lastName':getLastName(_0x13a010[_0xc730('0x35')]),'mapKey':_0xc730('0x6'),'message':{'from':getMails(_0x41918d[_0xc730('0x6')],_0x13a010[_0xc730('0x35')]),'to':_0x41918d[_0xc730('0x6')],'cc':'','subject':_0x13a010['subject']||'','messageId':_0x13a010['messageId'],'inReplyTo':_0x13a010[_0xc730('0x36')],'sentAt':moment(_0x13a010[_0xc730('0x37')])[_0xc730('0x2c')](_0xc730('0x38')),'attach':![],'attachments':[]}};if(!_0x13a010[_0xc730('0x17')]&&!_0x13a010['textAsHtml']){var _0x5b58cd=_[_0xc730('0x39')](_0x13a010[_0xc730('0x27')],{'contentType':_0xc730('0x3a')});if(_0x5b58cd[_0xc730('0x11')]){logger[_0xc730('0x3b')](util[_0xc730('0x2c')](_0xc730('0x3c'),_0x13a010[_0xc730('0x3d')]));tnef['parseBuffer'](_[_0xc730('0x3e')](_0x5b58cd)['content'],function(_0x38524f,_0x315bca){if(_0x315bca){_0x13a010['html']=_0x315bca[_0xc730('0x3f')]||'<p>Empty\x20message</p>';if(_0x315bca[_0xc730('0x40')]){for(var _0x24c9dc=0x0;_0x24c9dc<_0x315bca[_0xc730('0x40')][_0xc730('0x11')];_0x24c9dc++){var _0x51ad69=_0x315bca['Attachments'][_0x24c9dc];_0x44bc06[_0xc730('0x23')][_0xc730('0x27')]['push']({'filename':_0x51ad69[_0xc730('0x41')],'content':Buffer[_0xc730('0x35')](_0x51ad69[_0xc730('0x42')])});}}}_0x2af1ba(parseEmail(_0x41918d,_0x13a010,_0x44bc06));});}else{_0x13a010[_0xc730('0x17')]=_0xc730('0x43');_0x2af1ba(parseEmail(_0x41918d,_0x13a010,_0x44bc06));}}else{_0x2af1ba(parseEmail(_0x41918d,_0x13a010,_0x44bc06));}};exports[_0xc730('0x44')]=function(_0xfab10a,_0x2976cf){var _0x6a8610=['user='+(_0x2976cf||''),_0xc730('0x45')+_0xfab10a,'',''];return Buffer[_0xc730('0x35')](_0x6a8610[_0xc730('0x12')]('\ 1'),_0xc730('0x46'))['toString'](_0xc730('0x47'));};
\ No newline at end of file
index 7abad3c..453d8b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38b3=['key','active','Imap','Smtp','exports','name','Service'];(function(_0x32eff1,_0x5eca26){var _0x2987d2=function(_0x3cfee7){while(--_0x3cfee7){_0x32eff1['push'](_0x32eff1['shift']());}};_0x2987d2(++_0x5eca26);}(_0x38b3,0x8a));var _0x338b=function(_0x451ca0,_0x5825da){_0x451ca0=_0x451ca0-0x0;var _0x128d5b=_0x38b3[_0x451ca0];return _0x128d5b;};'use strict';var _=require('lodash');function MailAccount(_0x2cd291){this['id']=_0x2cd291['id']||0x0;this[_0x338b('0x0')]=_0x2cd291[_0x338b('0x0')]||_0x338b('0x1');this[_0x338b('0x2')]=_0x2cd291[_0x338b('0x2')]||'SERV';this[_0x338b('0x3')]=_0x2cd291[_0x338b('0x3')]||![];this[_0x338b('0x4')]=_0x2cd291[_0x338b('0x4')]||[];this[_0x338b('0x5')]=_0x2cd291[_0x338b('0x5')]||[];}module[_0x338b('0x6')]=MailAccount;
\ No newline at end of file
+var _0x1e73=['active','Smtp','lodash','name','Service','key','SERV'];(function(_0x45d2e6,_0x331a39){var _0x2a30d1=function(_0x3e4f05){while(--_0x3e4f05){_0x45d2e6['push'](_0x45d2e6['shift']());}};_0x2a30d1(++_0x331a39);}(_0x1e73,0x11a));var _0x31e7=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x1e73[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x31e7('0x0'));function MailAccount(_0x109827){this['id']=_0x109827['id']||0x0;this[_0x31e7('0x1')]=_0x109827[_0x31e7('0x1')]||_0x31e7('0x2');this[_0x31e7('0x3')]=_0x109827[_0x31e7('0x3')]||_0x31e7('0x4');this[_0x31e7('0x5')]=_0x109827[_0x31e7('0x5')]||![];this['Imap']=_0x109827['Imap']||[];this[_0x31e7('0x6')]=_0x109827[_0x31e7('0x6')]||[];}module['exports']=MailAccount;
\ No newline at end of file
index 89656ec..9bb8619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8754=['mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8754,0x194));var _0x4875=function(_0x419db5,_0x524634){_0x419db5=_0x419db5-0x0;var _0x5ea474=_0x8754[_0x419db5];return _0x5ea474;};'use strict';var _=require(_0x4875('0x0'));var MailAccount=require(_0x4875('0x1'));var Realtime=function(){this[_0x4875('0x2')]={};};function freeIsNotKey(_0x546ae9,_0x4cd7c9,_0x911b72){var _0x5af0bf=_[_0x4875('0x3')](_0x546ae9,function(_0x56ae37,_0x21ab88){return _0x56ae37[_0x911b72];});for(var _0x1352cc in _0x4cd7c9){if(_0x4cd7c9[_0x4875('0x4')](_0x1352cc)){if(!_0x5af0bf[_0x1352cc]){delete _0x4cd7c9[_0x1352cc];}}}}Realtime['prototype'][_0x4875('0x5')]=function(_0x261c43,_0xaa6597){for(var _0x29bb02 in _0xaa6597){if(_0x261c43[_0x4875('0x4')](_0x29bb02)){_0x261c43[_0x29bb02]=_0xaa6597[_0x29bb02];}}};Realtime[_0x4875('0x6')][_0x4875('0x7')]=function(){var _0x3aba51=this;return function(_0x473630){if(_0x473630){freeIsNotKey(_0x473630,_0x3aba51['mailAccounts'],'id');for(var _0x70ca60=0x0,_0xea98fa={},_0x2091ee={};_0x70ca60<_0x473630['length'];_0x70ca60+=0x1){_0xea98fa=_0x473630[_0x70ca60];if(_[_0x4875('0x8')](_0x3aba51[_0x4875('0x2')][_0xea98fa['id']])){_0x3aba51['mailAccounts'][_0xea98fa['id']]=new MailAccount(_0xea98fa);}else{_[_0x4875('0x9')](_0x3aba51[_0x4875('0x2')][_0xea98fa['id']],_0xea98fa);}}}return _0x3aba51[_0x4875('0x2')];};};module[_0x4875('0xa')]=Realtime;
\ No newline at end of file
+var _0x8ac9=['exports','../model/mailAccount','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','mailAccounts','length','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ac9,0x14b));var _0x98ac=function(_0x54997a,_0x275891){_0x54997a=_0x54997a-0x0;var _0x3a7340=_0x8ac9[_0x54997a];return _0x3a7340;};'use strict';var _=require('lodash');var MailAccount=require(_0x98ac('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x4c8b87,_0x20c822,_0x3a2bbb){var _0x1f11eb=_[_0x98ac('0x1')](_0x4c8b87,function(_0x5aba81,_0x2c33fd){return _0x5aba81[_0x3a2bbb];});for(var _0x41a937 in _0x20c822){if(_0x20c822['hasOwnProperty'](_0x41a937)){if(!_0x1f11eb[_0x41a937]){delete _0x20c822[_0x41a937];}}}}Realtime[_0x98ac('0x2')][_0x98ac('0x3')]=function(_0x4d702c,_0x4dee10){for(var _0xda595c in _0x4dee10){if(_0x4d702c[_0x98ac('0x4')](_0xda595c)){_0x4d702c[_0xda595c]=_0x4dee10[_0xda595c];}}};Realtime['prototype'][_0x98ac('0x5')]=function(){var _0x49447e=this;return function(_0x4c1788){if(_0x4c1788){freeIsNotKey(_0x4c1788,_0x49447e[_0x98ac('0x6')],'id');for(var _0x2bc5be=0x0,_0x104f33={},_0x3aefdc={};_0x2bc5be<_0x4c1788[_0x98ac('0x7')];_0x2bc5be+=0x1){_0x104f33=_0x4c1788[_0x2bc5be];if(_['isUndefined'](_0x49447e[_0x98ac('0x6')][_0x104f33['id']])){_0x49447e['mailAccounts'][_0x104f33['id']]=new MailAccount(_0x104f33);}else{_[_0x98ac('0x8')](_0x49447e[_0x98ac('0x6')][_0x104f33['id']],_0x104f33);}}}return _0x49447e[_0x98ac('0x6')];};};module[_0x98ac('0x9')]=Realtime;
\ No newline at end of file
index e68d78a..24b7c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2905=['Smtp','CloudProvider','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider','service','email','active','ListId','TemplateId','MailServerIn','type','MailServerOut'];(function(_0x1038a7,_0x35cc15){var _0x3f9d71=function(_0x1ef1a0){while(--_0x1ef1a0){_0x1038a7['push'](_0x1038a7['shift']());}};_0x3f9d71(++_0x35cc15);}(_0x2905,0x19c));var _0x5290=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2905[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x5290('0x0'));exports[_0x5290('0x1')]=function(){return function(){return client[_0x5290('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x5290('0x3'),_0x5290('0x4'),_0x5290('0x5'),_0x5290('0x6'),_0x5290('0x7'),'key',_0x5290('0x8'),_0x5290('0x9')],'raw':![],'include':[{'model':_0x5290('0xa'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x5290('0x3'),_0x5290('0x5'),_0x5290('0xb'),'data5'],'as':'CloudProvider'}]},{'model':_0x5290('0xc'),'as':_0x5290('0xd'),'include':[{'model':_0x5290('0xe'),'attributes':['id','name',_0x5290('0x5'),'type','data5'],'as':_0x5290('0xe')}]}]},'log':'getMailAccount'});};};exports[_0x5290('0xf')]=function(_0x4bcd65,_0x2cc138){return client[_0x5290('0x2')](_0x5290('0x10'),{'account':{'id':_0x4bcd65},'body':_0x2cc138,'log':_0x5290('0x10')});};
\ No newline at end of file
+var _0x9c63=['MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','../client','getMailAccounts','Request','GetMailAccount','name','service','email','ListId','TemplateId'];(function(_0x3cbfaa,_0x55a0b5){var _0x25e3ff=function(_0x39bf07){while(--_0x39bf07){_0x3cbfaa['push'](_0x3cbfaa['shift']());}};_0x25e3ff(++_0x55a0b5);}(_0x9c63,0x1a7));var _0x39c6=function(_0x22f16b,_0x2f1530){_0x22f16b=_0x22f16b-0x0;var _0x2cd0bf=_0x9c63[_0x22f16b];return _0x2cd0bf;};'use strict';var client=require(_0x39c6('0x0'));exports[_0x39c6('0x1')]=function(){return function(){return client[_0x39c6('0x2')](_0x39c6('0x3'),{'options':{'attributes':['id',_0x39c6('0x4'),'provider',_0x39c6('0x5'),_0x39c6('0x6'),'active','key',_0x39c6('0x7'),_0x39c6('0x8')],'raw':![],'include':[{'model':_0x39c6('0x9'),'as':_0x39c6('0xa'),'include':[{'model':_0x39c6('0xb'),'attributes':['id',_0x39c6('0x4'),'service',_0x39c6('0xc'),_0x39c6('0xd')],'as':_0x39c6('0xb')}]},{'model':_0x39c6('0xe'),'as':_0x39c6('0xf'),'include':[{'model':'CloudProvider','attributes':['id',_0x39c6('0x4'),'service',_0x39c6('0xc'),'data5'],'as':_0x39c6('0xb')}]}]},'log':_0x39c6('0x10')});};};exports[_0x39c6('0x11')]=function(_0x231669,_0x47f33b){return client[_0x39c6('0x2')]('NotifyMailAccount',{'account':{'id':_0x231669},'body':_0x47f33b,'log':'NotifyMailAccount'});};
\ No newline at end of file
index 26be961..b99f10f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12df=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x12df,0x15b));var _0xf12d=function(_0x27b3b8,_0x43190a){_0x27b3b8=_0x27b3b8-0x0;var _0x1e85a2=_0x12df[_0x27b3b8];return _0x1e85a2;};'use strict';var client=require(_0xf12d('0x0'));exports['getSettings']=function(){return client[_0xf12d('0x1')](_0xf12d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xf12d('0x3')]},'log':_0xf12d('0x4')});};
\ No newline at end of file
+var _0xdd1c=['GetSettings','Request'];(function(_0x4fea57,_0x22d52d){var _0x3661bb=function(_0x3e81c4){while(--_0x3e81c4){_0x4fea57['push'](_0x4fea57['shift']());}};_0x3661bb(++_0x22d52d);}(_0xdd1c,0x17d));var _0xcdd1=function(_0x4f067e,_0x406536){_0x4f067e=_0x4f067e-0x0;var _0x3930d1=_0xdd1c[_0x4f067e];return _0x3930d1;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xcdd1('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xcdd1('0x1')});};
\ No newline at end of file
index 01f2b17..2c137aa 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 40a105a..20a9a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cf7=['default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','../../config/environment','createServer','listen','port','socket.io','redis','defaults','localhost','adapter','../../config/socketio','../../config/express'];(function(_0x529920,_0x32123b){var _0x2c2fae=function(_0x1a6bc0){while(--_0x1a6bc0){_0x529920['push'](_0x529920['shift']());}};_0x2c2fae(++_0x32123b);}(_0x6cf7,0x181));var _0x76cf=function(_0x4180c6,_0x642cf3){_0x4180c6=_0x4180c6-0x0;var _0xe0e5aa=_0x6cf7[_0x4180c6];return _0xe0e5aa;};'use strict';var _=require('lodash');var http=require(_0x76cf('0x0'));var express=require(_0x76cf('0x1'));var sticky=require(_0x76cf('0x2'));var Redis=require('ioredis');var config=require(_0x76cf('0x3'));var app=express();var server=http[_0x76cf('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x76cf('0x5')](server,config[_0x76cf('0x6')])){var socketio=require(_0x76cf('0x7'))(server,{'transports':['websocket','polling']});config[_0x76cf('0x8')]=_[_0x76cf('0x9')](config['redis'],{'host':_0x76cf('0xa'),'port':0x18eb});socketio[_0x76cf('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0x76cf('0x8')]),'subClient':new Redis(config[_0x76cf('0x8')])}));require('../../config/triggers')['default']();require(_0x76cf('0xc'))['default'](socketio);require(_0x76cf('0xd'))[_0x76cf('0xe')](app);require(_0x76cf('0xf'))[_0x76cf('0xe')](app);}else{server[_0x76cf('0x10')](_0x76cf('0x11'),function(){console[_0x76cf('0x12')](_0x76cf('0x13'),config[_0x76cf('0x6')]);});}exports=module[_0x76cf('0x14')]=app;
\ No newline at end of file
+var _0x8bf3=['adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','timeout','listen','port','websocket','polling','redis','defaults'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x8bf3,0x17b));var _0x38bf=function(_0x348550,_0x53500f){_0x348550=_0x348550-0x0;var _0x4bd175=_0x8bf3[_0x348550];return _0x4bd175;};'use strict';var _=require(_0x38bf('0x0'));var http=require(_0x38bf('0x1'));var express=require('express');var sticky=require(_0x38bf('0x2'));var Redis=require(_0x38bf('0x3'));var config=require(_0x38bf('0x4'));var app=express();var server=http['createServer'](app);server[_0x38bf('0x5')]=0xdbba0;if(sticky[_0x38bf('0x6')](server,config[_0x38bf('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0x38bf('0x8'),_0x38bf('0x9')]});config[_0x38bf('0xa')]=_[_0x38bf('0xb')](config[_0x38bf('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x38bf('0xc')](require(_0x38bf('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x38bf('0xa')])}));require('../../config/triggers')[_0x38bf('0xe')]();require(_0x38bf('0xf'))[_0x38bf('0xe')](socketio);require(_0x38bf('0x10'))[_0x38bf('0xe')](app);require(_0x38bf('0x11'))[_0x38bf('0xe')](app);}else{server[_0x38bf('0x12')](_0x38bf('0x13'),function(){console[_0x38bf('0x14')](_0x38bf('0x15'),config[_0x38bf('0x7')]);});}exports=module[_0x38bf('0x16')]=app;
\ No newline at end of file
index 8419f67..231eb4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5667=['error','message','result','bluebird','../../config/logger','routing','client','http','request','then','rpc'];(function(_0x882e1b,_0x22592d){var _0x47a64a=function(_0x29320a){while(--_0x29320a){_0x882e1b['push'](_0x882e1b['shift']());}};_0x47a64a(++_0x22592d);}(_0x5667,0x163));var _0x7566=function(_0x17ed80,_0xb560ff){_0x17ed80=_0x17ed80-0x0;var _0x4f20f1=_0x5667[_0x17ed80];return _0x4f20f1;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7566('0x0'));var logger=require(_0x7566('0x1'))(_0x7566('0x2'));var client=jayson[_0x7566('0x3')][_0x7566('0x4')]({'port':0x2329});client['Request']=function(_0x3e7c0c,_0x222fcf){return new BPromise(function(_0x52ed6a,_0x4e4c7e){return client[_0x7566('0x5')](_0x3e7c0c,_0x222fcf)[_0x7566('0x6')](function(_0xafe028){logger['debug'](_0x7566('0x7'),_0x7566('0x2'),_0x3e7c0c,_0x222fcf,_0xafe028);if(_0xafe028[_0x7566('0x8')]){logger[_0x7566('0x8')](_0x7566('0x7'),'routing',_0x3e7c0c,_0xafe028['error'][_0x7566('0x9')],_0x222fcf);return _0x4e4c7e(_0xafe028['error'][_0x7566('0x9')]);}else{return _0x52ed6a(_0xafe028[_0x7566('0xa')]);}})['catch'](function(_0x1fb521){logger[_0x7566('0x8')]('rpc',_0x7566('0x2'),_0x3e7c0c,_0x1fb521,_0x222fcf);return _0x4e4c7e(_0x1fb521);});});};module['exports']=client;
\ No newline at end of file
+var _0x563b=['catch','exports','jayson/promise','bluebird','routing','client','Request','request','then','debug','rpc','error','message'];(function(_0x383aff,_0x164361){var _0x5c9270=function(_0x5d34b2){while(--_0x5d34b2){_0x383aff['push'](_0x383aff['shift']());}};_0x5c9270(++_0x164361);}(_0x563b,0x6a));var _0xb563=function(_0x88d48e,_0x3c4c5d){_0x88d48e=_0x88d48e-0x0;var _0x3745ca=_0x563b[_0x88d48e];return _0x3745ca;};'use strict';var jayson=require(_0xb563('0x0'));var BPromise=require(_0xb563('0x1'));var logger=require('../../config/logger')(_0xb563('0x2'));var client=jayson[_0xb563('0x3')]['http']({'port':0x2329});client[_0xb563('0x4')]=function(_0x186f67,_0x5e799a){return new BPromise(function(_0xa88c44,_0xbbb1be){return client[_0xb563('0x5')](_0x186f67,_0x5e799a)[_0xb563('0x6')](function(_0x387f46){logger[_0xb563('0x7')](_0xb563('0x8'),_0xb563('0x2'),_0x186f67,_0x5e799a,_0x387f46);if(_0x387f46[_0xb563('0x9')]){logger[_0xb563('0x9')](_0xb563('0x8'),_0xb563('0x2'),_0x186f67,_0x387f46[_0xb563('0x9')][_0xb563('0xa')],_0x5e799a);return _0xbbb1be(_0x387f46['error'][_0xb563('0xa')]);}else{return _0xa88c44(_0x387f46['result']);}})[_0xb563('0xb')](function(_0x447e57){logger[_0xb563('0x9')](_0xb563('0x8'),_0xb563('0x2'),_0x186f67,_0x447e57,_0x5e799a);return _0xbbb1be(_0x447e57);});});};module[_0xb563('0xc')]=client;
\ No newline at end of file
index e0301b4..b42b783 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd4d=['initMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0xfd4d,0xd8));var _0xdfd4=function(_0x458c8f,_0x74a988){_0x458c8f=_0x458c8f-0x0;var _0x4fd9b4=_0xfd4d[_0x458c8f];return _0x4fd9b4;};'use strict';var BPromise=require(_0xdfd4('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0xdfd4('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xdfd4('0x2'));var smsQueue=require(_0xdfd4('0x3'));var mailQueue=require(_0xdfd4('0x4'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xdfd4('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xdfd4('0x6')]()[_0xdfd4('0x7')](user[_0xdfd4('0x8')]())[_0xdfd4('0x7')](realtime['initAgents']())[_0xdfd4('0x7')](interval[_0xdfd4('0x9')]())[_0xdfd4('0x7')](realtime['initIntervals']())[_0xdfd4('0x7')](openchannelQueue[_0xdfd4('0xa')]())[_0xdfd4('0x7')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xdfd4('0xb')]())[_0xdfd4('0x7')](realtime[_0xdfd4('0xc')]())[_0xdfd4('0x7')](smsQueue['getSmsQueues']())['then'](realtime[_0xdfd4('0xd')]())[_0xdfd4('0x7')](mailQueue[_0xdfd4('0xe')]())['then'](realtime[_0xdfd4('0xf')]())[_0xdfd4('0x7')](faxQueue[_0xdfd4('0x10')]())[_0xdfd4('0x7')](realtime['initFaxQueues']())[_0xdfd4('0x7')](whatsappQueue[_0xdfd4('0x11')]())[_0xdfd4('0x7')](realtime['initWhatsappQueues']())[_0xdfd4('0x7')](function(){return realtime;});}function main(){return server[_0xdfd4('0x12')](realtime)['then'](function(_0x19fab3){return initRealtime();})[_0xdfd4('0x7')](function(_0x575daa){return setInterval(initRealtime,0x1388);})[_0xdfd4('0x13')](function(_0x525038){console[_0xdfd4('0x14')](_0x525038);});}main();
\ No newline at end of file
+var _0xdfb6=['./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','./server'];(function(_0x9dd260,_0x12fad4){var _0x4d1f5c=function(_0x3e72c8){while(--_0x3e72c8){_0x9dd260['push'](_0x9dd260['shift']());}};_0x4d1f5c(++_0x12fad4);}(_0xdfb6,0xfc));var _0x6dfb=function(_0x1783d2,_0x25e57d){_0x1783d2=_0x1783d2-0x0;var _0x5aa88a=_0xdfb6[_0x1783d2];return _0x5aa88a;};'use strict';var BPromise=require('bluebird');var server=require(_0x6dfb('0x0'));var Realtime=require(_0x6dfb('0x1'));var user=require(_0x6dfb('0x2'));var interval=require(_0x6dfb('0x3'));var openchannelQueue=require(_0x6dfb('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x6dfb('0x5'));var mailQueue=require(_0x6dfb('0x6'));var faxQueue=require(_0x6dfb('0x7'));var whatsappQueue=require(_0x6dfb('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x6dfb('0x9')](user[_0x6dfb('0xa')]())['then'](realtime[_0x6dfb('0xb')]())['then'](interval[_0x6dfb('0xc')]())[_0x6dfb('0x9')](realtime[_0x6dfb('0xd')]())[_0x6dfb('0x9')](openchannelQueue['getOpenchannelQueues']())['then'](realtime['initOpenchannelQueues']())[_0x6dfb('0x9')](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())[_0x6dfb('0x9')](smsQueue[_0x6dfb('0xe')]())[_0x6dfb('0x9')](realtime[_0x6dfb('0xf')]())[_0x6dfb('0x9')](mailQueue['getMailQueues']())[_0x6dfb('0x9')](realtime[_0x6dfb('0x10')]())[_0x6dfb('0x9')](faxQueue[_0x6dfb('0x11')]())[_0x6dfb('0x9')](realtime[_0x6dfb('0x12')]())[_0x6dfb('0x9')](whatsappQueue[_0x6dfb('0x13')]())[_0x6dfb('0x9')](realtime[_0x6dfb('0x14')]())['then'](function(){return realtime;});}function main(){return server[_0x6dfb('0x15')](realtime)[_0x6dfb('0x9')](function(_0x294b3a){return initRealtime();})[_0x6dfb('0x9')](function(_0x3d2365){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5991bc){console[_0x6dfb('0x16')](_0x5991bc);});}main();
\ No newline at end of file
index 969a504..16af22e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x5ce2e3,_0x3dc503){var _0x3b53ab=function(_0x1efe66){while(--_0x1efe66){_0x5ce2e3['push'](_0x5ce2e3['shift']());}};_0x3b53ab(++_0x3dc503);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x5fc3[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x432dcb,_0x3ab4dc){var _0x6e792e=function(_0x30515b){while(--_0x30515b){_0x432dcb['push'](_0x432dcb['shift']());}};_0x6e792e(++_0x3ab4dc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine;
\ No newline at end of file
index 1b05da7..10a9a73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7908=['error','catch','sendMailMessage','bluebird','jayson/promise','client','http','then'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x7908,0x173));var _0x8790=function(_0x22cbeb,_0x42672a){_0x22cbeb=_0x22cbeb-0x0;var _0x329912=_0x7908[_0x22cbeb];return _0x329912;};'use strict';var BPromise=require(_0x8790('0x0'));var jayson=require(_0x8790('0x1'));var client=jayson[_0x8790('0x2')][_0x8790('0x3')]({'port':0x232b});function request(_0x410f63,_0x3aecc5){return new BPromise(function(_0x545f80,_0x2de14a){return client['request'](_0x410f63,_0x3aecc5)[_0x8790('0x4')](function(_0x4ef94b){if(_0x4ef94b[_0x8790('0x5')]){return _0x2de14a(_0x4ef94b[_0x8790('0x5')]['message']);}else{return _0x545f80(_0x4ef94b['result']);}})[_0x8790('0x6')](function(_0x23ad8a){return _0x2de14a(_0x23ad8a);});});}exports[_0x8790('0x7')]=function(_0x246e32,_0x50b1be){return request('SendMail',{'account':_0x246e32,'message':_0x50b1be});};
\ No newline at end of file
+var _0x280f=['bluebird','client','http','request','then','message','result','catch','sendMailMessage'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x280f,0xe1));var _0xf280=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x280f[_0x1762b4];return _0x29beda;};'use strict';var BPromise=require(_0xf280('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xf280('0x1')][_0xf280('0x2')]({'port':0x232b});function request(_0x11b921,_0x20fe43){return new BPromise(function(_0x3dda3e,_0x1533ac){return client[_0xf280('0x3')](_0x11b921,_0x20fe43)[_0xf280('0x4')](function(_0x1456ec){if(_0x1456ec['error']){return _0x1533ac(_0x1456ec['error'][_0xf280('0x5')]);}else{return _0x3dda3e(_0x1456ec[_0xf280('0x6')]);}})[_0xf280('0x7')](function(_0x10f6b5){return _0x1533ac(_0x10f6b5);});});}exports[_0xf280('0x8')]=function(_0x3d7b7f,_0x52e1c9){return request('SendMail',{'account':_0x3d7b7f,'message':_0x52e1c9});};
\ No newline at end of file
index 56410ed..1cedfcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47fc=['mailStatusTime','mailCapacity','mailCurrentCapacity','unknown','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','fax','sms','whatsapp','length','Status','toNumber','format','chatCurrentCapacity','faxStatus','faxStatusTime','smsCapacity','whatsappCurrentCapacity','openchannelCurrentCapacity','busy','faxWaitingInteractions','mailWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailStatus'];(function(_0x2b18b5,_0x3c4d7b){var _0x1cbe11=function(_0x4a044d){while(--_0x4a044d){_0x2b18b5['push'](_0x2b18b5['shift']());}};_0x1cbe11(++_0x3c4d7b);}(_0x47fc,0x73));var _0xc47f=function(_0x5d6398,_0x4933de){_0x5d6398=_0x5d6398-0x0;var _0x4cb639=_0x47fc[_0x5d6398];return _0x4cb639;};'use strict';var _=require(_0xc47f('0x0'));var moment=require(_0xc47f('0x1'));var md5=require(_0xc47f('0x2'));var Redis=require(_0xc47f('0x3'));var config=require(_0xc47f('0x4'));config['redis']=_[_0xc47f('0x5')](config[_0xc47f('0x6')],{'host':_0xc47f('0x7'),'port':0x18eb});var io=require(_0xc47f('0x8'))(new Redis(config[_0xc47f('0x6')]));function Agent(_0x10be38){this['id']=_0x10be38['id']||0x0;this['name']=_0x10be38[_0xc47f('0x9')]||'';this['online']=_0x10be38[_0xc47f('0xa')]||!![];this[_0xc47f('0xb')]=_0x10be38[_0xc47f('0xb')]||![];this[_0xc47f('0xc')]=_0x10be38[_0xc47f('0xc')]||![];this['mailPause']=_0x10be38[_0xc47f('0xd')]||![];this[_0xc47f('0xe')]=_0x10be38[_0xc47f('0xe')]||![];this[_0xc47f('0xf')]=_0x10be38[_0xc47f('0xf')]||![];this[_0xc47f('0x10')]=_0x10be38[_0xc47f('0x10')]||![];this[_0xc47f('0x11')]='unknown';this[_0xc47f('0x12')]=0x0;this['chatCapacity']=_0x10be38[_0xc47f('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xc47f('0x14')]='unknown';this[_0xc47f('0x15')]=0x0;this[_0xc47f('0x16')]=_0x10be38[_0xc47f('0x16')]||0x0;this[_0xc47f('0x17')]=0x0;this['faxStatus']=_0xc47f('0x18');this['faxStatusTime']=0x0;this[_0xc47f('0x19')]=_0x10be38[_0xc47f('0x19')]||0x0;this[_0xc47f('0x1a')]=0x0;this[_0xc47f('0x1b')]=_0xc47f('0x18');this[_0xc47f('0x1c')]=0x0;this['smsCapacity']=_0x10be38['smsCapacity']||0x0;this[_0xc47f('0x1d')]=0x0;this[_0xc47f('0x1e')]=_0xc47f('0x18');this[_0xc47f('0x1f')]=0x0;this['whatsappCapacity']=_0x10be38[_0xc47f('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xc47f('0x21')]='unknown';this[_0xc47f('0x22')]=0x0;this[_0xc47f('0x23')]=_0x10be38[_0xc47f('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0xc47f('0x24')]=undefined;this[_0xc47f('0x2')]='';this['chatWaitingInteractions']={};this['faxWaitingInteractions']={};this['mailWaitingInteractions']={};this[_0xc47f('0x25')]={};this[_0xc47f('0x26')]={};this[_0xc47f('0x27')]={};this[_0xc47f('0x28')]();}Agent[_0xc47f('0x29')][_0xc47f('0x2a')]=function(_0x2af4de){if(this[_0x2af4de+_0xc47f('0x2b')]>0x0){if(this[_0x2af4de+_0xc47f('0x2c')]>0x0&&this[_0x2af4de+_0xc47f('0x2b')]>=this[_0x2af4de+'Capacity']){return _0xc47f('0x2d');}else{return'working';}}else{return _0xc47f('0x2e');}};Agent[_0xc47f('0x29')][_0xc47f('0x28')]=function(){var _0x3be7ad=[_0xc47f('0x2f'),'chat','openchannel',_0xc47f('0x30'),_0xc47f('0x31'),_0xc47f('0x32')];for(var _0x155043=0x0;_0x155043<_0x3be7ad[_0xc47f('0x33')];_0x155043+=0x1){var _0x3e7f4d=this[_0xc47f('0x2a')](_0x3be7ad[_0x155043]);if(this[_0x3be7ad[_0x155043]+_0xc47f('0x34')]!==_0x3e7f4d){this[_0x3be7ad[_0x155043]+'StatusTime']=_[_0xc47f('0x35')](moment()[_0xc47f('0x36')]('x'));}this[_0x3be7ad[_0x155043]+'Status']=_0x3e7f4d;}var _0x3bd3cb={'id':this['id'],'name':this[_0xc47f('0x9')],'online':this[_0xc47f('0xa')],'voicePause':this[_0xc47f('0xb')],'chatPause':this['chatPause'],'mailPause':this[_0xc47f('0xd')],'smsPause':this[_0xc47f('0xf')],'faxPause':this[_0xc47f('0xe')],'openchannelPause':this[_0xc47f('0x10')],'chatStatus':this[_0xc47f('0x11')],'chatStatusTime':this[_0xc47f('0x12')],'chatCapacity':this[_0xc47f('0x13')],'chatCurrentCapacity':this[_0xc47f('0x37')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xc47f('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xc47f('0x17')],'faxStatus':this[_0xc47f('0x38')],'faxStatusTime':this[_0xc47f('0x39')],'faxCapacity':this[_0xc47f('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xc47f('0x1c')],'smsCapacity':this[_0xc47f('0x3a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xc47f('0x1e')],'whatsappStatusTime':this[_0xc47f('0x1f')],'whatsappCapacity':this[_0xc47f('0x20')],'whatsappCurrentCapacity':this[_0xc47f('0x3b')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xc47f('0x22')],'openchannelCapacity':this[_0xc47f('0x23')],'openchannelCurrentCapacity':this[_0xc47f('0x3c')],'busy':this[_0xc47f('0x3d')],'busyQueue':this[_0xc47f('0x24')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0xc47f('0x3e')],'mailWaitingInteractions':this[_0xc47f('0x3f')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xc47f('0x26')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x445bf0=md5(JSON[_0xc47f('0x40')](_0x3bd3cb));if(this[_0xc47f('0x2')]!==_0x445bf0){this['md5']=_0x445bf0;io[_0xc47f('0x41')](_0xc47f('0x42'),_0x3bd3cb);}};module[_0xc47f('0x43')]=Agent;
\ No newline at end of file
+var _0x76e5=['localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','smsStatus','smsStatusTime','smsCapacity','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','mailWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','StatusTime','format','Status','voicePause','chatStatus','chatCurrentCapacity','faxStatusTime','faxCapacity','whatsappStatus','whatsappStatusTime','whatsappCurrentCapacity','busy','chatWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','redis','defaults'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x76e5,0x149));var _0x576e=function(_0x3fd368,_0x49769a){_0x3fd368=_0x3fd368-0x0;var _0x37fa47=_0x76e5[_0x3fd368];return _0x37fa47;};'use strict';var _=require('lodash');var moment=require(_0x576e('0x0'));var md5=require(_0x576e('0x1'));var Redis=require(_0x576e('0x2'));var config=require(_0x576e('0x3'));config[_0x576e('0x4')]=_[_0x576e('0x5')](config[_0x576e('0x4')],{'host':_0x576e('0x6'),'port':0x18eb});var io=require(_0x576e('0x7'))(new Redis(config[_0x576e('0x4')]));function Agent(_0x561692){this['id']=_0x561692['id']||0x0;this[_0x576e('0x8')]=_0x561692['name']||'';this[_0x576e('0x9')]=_0x561692[_0x576e('0x9')]||!![];this['voicePause']=_0x561692['voicePause']||![];this['chatPause']=_0x561692[_0x576e('0xa')]||![];this[_0x576e('0xb')]=_0x561692[_0x576e('0xb')]||![];this[_0x576e('0xc')]=_0x561692[_0x576e('0xc')]||![];this['smsPause']=_0x561692[_0x576e('0xd')]||![];this[_0x576e('0xe')]=_0x561692[_0x576e('0xe')]||![];this['chatStatus']=_0x576e('0xf');this['chatStatusTime']=0x0;this[_0x576e('0x10')]=_0x561692[_0x576e('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x576e('0x11')]=_0x576e('0xf');this[_0x576e('0x12')]=0x0;this[_0x576e('0x13')]=_0x561692[_0x576e('0x13')]||0x0;this[_0x576e('0x14')]=0x0;this[_0x576e('0x15')]=_0x576e('0xf');this['faxStatusTime']=0x0;this['faxCapacity']=_0x561692['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x576e('0x16')]=_0x576e('0xf');this[_0x576e('0x17')]=0x0;this[_0x576e('0x18')]=_0x561692[_0x576e('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x576e('0xf');this['whatsappStatusTime']=0x0;this[_0x576e('0x19')]=_0x561692[_0x576e('0x19')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x576e('0x1a')]=_0x576e('0xf');this[_0x576e('0x1b')]=0x0;this['openchannelCapacity']=_0x561692[_0x576e('0x1c')]||0x0;this[_0x576e('0x1d')]=0x0;this['busy']=![];this[_0x576e('0x1e')]=undefined;this[_0x576e('0x1')]='';this['chatWaitingInteractions']={};this[_0x576e('0x1f')]={};this[_0x576e('0x20')]={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this[_0x576e('0x21')]={};this[_0x576e('0x22')]();}Agent[_0x576e('0x23')][_0x576e('0x24')]=function(_0x582ebc){if(this[_0x582ebc+'CurrentCapacity']>0x0){if(this[_0x582ebc+_0x576e('0x25')]>0x0&&this[_0x582ebc+_0x576e('0x26')]>=this[_0x582ebc+_0x576e('0x25')]){return _0x576e('0x27');}else{return _0x576e('0x28');}}else{return _0x576e('0x29');}};Agent[_0x576e('0x23')]['updateRealtime']=function(){var _0x7920a0=[_0x576e('0x2a'),_0x576e('0x2b'),'openchannel',_0x576e('0x2c'),_0x576e('0x2d'),_0x576e('0x2e')];for(var _0x15e198=0x0;_0x15e198<_0x7920a0[_0x576e('0x2f')];_0x15e198+=0x1){var _0x3d96c6=this[_0x576e('0x24')](_0x7920a0[_0x15e198]);if(this[_0x7920a0[_0x15e198]+'Status']!==_0x3d96c6){this[_0x7920a0[_0x15e198]+_0x576e('0x30')]=_['toNumber'](moment()[_0x576e('0x31')]('x'));}this[_0x7920a0[_0x15e198]+_0x576e('0x32')]=_0x3d96c6;}var _0x416837={'id':this['id'],'name':this[_0x576e('0x8')],'online':this[_0x576e('0x9')],'voicePause':this[_0x576e('0x33')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x576e('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0x576e('0xe')],'chatStatus':this[_0x576e('0x34')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x576e('0x10')],'chatCurrentCapacity':this[_0x576e('0x35')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x576e('0x12')],'mailCapacity':this[_0x576e('0x13')],'mailCurrentCapacity':this[_0x576e('0x14')],'faxStatus':this[_0x576e('0x15')],'faxStatusTime':this[_0x576e('0x36')],'faxCapacity':this[_0x576e('0x37')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x576e('0x17')],'smsCapacity':this[_0x576e('0x18')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x576e('0x38')],'whatsappStatusTime':this[_0x576e('0x39')],'whatsappCapacity':this[_0x576e('0x19')],'whatsappCurrentCapacity':this[_0x576e('0x3a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x576e('0x1c')],'openchannelCurrentCapacity':this[_0x576e('0x1d')],'busy':this[_0x576e('0x3b')],'busyQueue':this[_0x576e('0x1e')],'chatWaitingInteractions':this[_0x576e('0x3c')],'faxWaitingInteractions':this[_0x576e('0x1f')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x576e('0x3d')],'smsWaitingInteractions':this[_0x576e('0x3e')],'whatsappWaitingInteractions':this[_0x576e('0x21')]};var _0x55ae4f=md5(JSON[_0x576e('0x3f')](_0x416837));if(this['md5']!==_0x55ae4f){this[_0x576e('0x1')]=_0x55ae4f;io[_0x576e('0x40')](_0x576e('0x41'),_0x416837);}};module[_0x576e('0x42')]=Agent;
\ No newline at end of file
index 905e003..1c8fcc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe73e=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','paused','length','loggedIn','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5'];(function(_0x400c6e,_0x274fd6){var _0x3f8a47=function(_0x1a8a03){while(--_0x1a8a03){_0x400c6e['push'](_0x400c6e['shift']());}};_0x3f8a47(++_0x274fd6);}(_0xe73e,0x94));var _0xee73=function(_0x8a14f8,_0x21fe6f){_0x8a14f8=_0x8a14f8-0x0;var _0x476793=_0xe73e[_0x8a14f8];return _0x476793;};'use strict';var _=require(_0xee73('0x0'));var md5=require(_0xee73('0x1'));var util=require('util');var Redis=require(_0xee73('0x2'));var config=require(_0xee73('0x3'));config[_0xee73('0x4')]=_[_0xee73('0x5')](config[_0xee73('0x4')],{'host':_0xee73('0x6'),'port':0x18eb});var io=require(_0xee73('0x7'))(new Redis(config['redis']));function ChatQueue(_0xc380c9){this['id']=_0xc380c9['id']||0x0;this[_0xee73('0x8')]=_0xc380c9[_0xee73('0x8')]||'';this[_0xee73('0x9')]=_0xc380c9[_0xee73('0x9')]||0xa;this['strategy']=_0xc380c9[_0xee73('0xa')]||'beepall';this[_0xee73('0xb')]=_0xc380c9[_0xee73('0xb')];this[_0xee73('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xee73('0xd')]();this['updateRealtime']();}ChatQueue['prototype'][_0xee73('0xd')]=function(){var _0x15745e=this[_0xee73('0xc')][_0xee73('0xe')];this[_0xee73('0xc')]=_[_0xee73('0xf')](this[_0xee73('0xb')],'id');this[_0xee73('0xc')][_0xee73('0xe')]=_0x15745e;};ChatQueue[_0xee73('0x10')][_0xee73('0x11')]=function(){this['loggedIn']=0x0;this[_0xee73('0x12')]=0x0;for(var _0x2a0b08=0x0;_0x2a0b08<this[_0xee73('0xb')][_0xee73('0x13')];_0x2a0b08+=0x1){if(this[_0xee73('0xb')][_0x2a0b08]['online']){this[_0xee73('0x14')]+=0x1;}if(this[_0xee73('0xb')][_0x2a0b08][_0xee73('0x15')]){this[_0xee73('0x12')]+=0x1;}}this[_0xee73('0x16')]=this[_0xee73('0x14')]-this[_0xee73('0x12')];this['available']=this['available']>=0x0?this[_0xee73('0x16')]:0x0;var _0x334d4a={'id':this['id'],'available':this[_0xee73('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xee73('0x8')],'paused':this['paused'],'waiting':this[_0xee73('0x17')]};var _0x39ed5c=md5(JSON[_0xee73('0x18')](_0x334d4a));if(this['md5']!==_0x39ed5c){this[_0xee73('0x1')]=_0x39ed5c;io['to'](util[_0xee73('0x19')](_0xee73('0x1a'),_0x334d4a[_0xee73('0x8')]))[_0xee73('0x1b')](_0xee73('0x1c'),_0x334d4a);}};module[_0xee73('0x1d')]=ChatQueue;
\ No newline at end of file
+var _0x9284=['defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','exports','md5','util','ioredis','../../../config/environment'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0x9284,0x176));var _0x4928=function(_0x191cf4,_0x354dc9){_0x191cf4=_0x191cf4-0x0;var _0x396ee4=_0x9284[_0x191cf4];return _0x396ee4;};'use strict';var _=require('lodash');var md5=require(_0x4928('0x0'));var util=require(_0x4928('0x1'));var Redis=require(_0x4928('0x2'));var config=require(_0x4928('0x3'));config['redis']=_[_0x4928('0x4')](config[_0x4928('0x5')],{'host':_0x4928('0x6'),'port':0x18eb});var io=require(_0x4928('0x7'))(new Redis(config[_0x4928('0x5')]));function ChatQueue(_0x153b63){this['id']=_0x153b63['id']||0x0;this[_0x4928('0x8')]=_0x153b63[_0x4928('0x8')]||'';this['timeout']=_0x153b63[_0x4928('0x9')]||0xa;this[_0x4928('0xa')]=_0x153b63[_0x4928('0xa')]||_0x4928('0xb');this[_0x4928('0xc')]=_0x153b63[_0x4928('0xc')];this[_0x4928('0xd')]={};this['waiting']=0x0;this[_0x4928('0x0')]='';this[_0x4928('0xe')]();this[_0x4928('0xf')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x3acfa2=this[_0x4928('0xd')][_0x4928('0x10')];this[_0x4928('0xd')]=_['map'](this[_0x4928('0xc')],'id');this[_0x4928('0xd')]['_rr']=_0x3acfa2;};ChatQueue['prototype'][_0x4928('0xf')]=function(){this[_0x4928('0x11')]=0x0;this[_0x4928('0x12')]=0x0;for(var _0x555033=0x0;_0x555033<this['Agents'][_0x4928('0x13')];_0x555033+=0x1){if(this['Agents'][_0x555033][_0x4928('0x14')]){this[_0x4928('0x11')]+=0x1;}if(this['Agents'][_0x555033][_0x4928('0x15')]){this['paused']+=0x1;}}this[_0x4928('0x16')]=this[_0x4928('0x11')]-this[_0x4928('0x12')];this[_0x4928('0x16')]=this[_0x4928('0x16')]>=0x0?this[_0x4928('0x16')]:0x0;var _0x1be680={'id':this['id'],'available':this[_0x4928('0x16')],'loggedIn':this[_0x4928('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x5a0097=md5(JSON[_0x4928('0x17')](_0x1be680));if(this[_0x4928('0x0')]!==_0x5a0097){this[_0x4928('0x0')]=_0x5a0097;io['to'](util[_0x4928('0x18')](_0x4928('0x19'),_0x1be680[_0x4928('0x8')]))['emit']('chat_queue:save',_0x1be680);}};module[_0x4928('0x1a')]=ChatQueue;
\ No newline at end of file
index 0dc94f5..2af7a4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e2c=['updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','stringify','md5','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x2db301,_0x32545d){var _0x3bd419=function(_0x1f59a3){while(--_0x1f59a3){_0x2db301['push'](_0x2db301['shift']());}};_0x3bd419(++_0x32545d);}(_0x1e2c,0x127));var _0xc1e2=function(_0x406ecb,_0x2cd3f8){_0x406ecb=_0x406ecb-0x0;var _0x5957df=_0x1e2c[_0x406ecb];return _0x5957df;};'use strict';var _=require(_0xc1e2('0x0'));var md5=require('md5');var util=require(_0xc1e2('0x1'));var Redis=require(_0xc1e2('0x2'));var config=require(_0xc1e2('0x3'));config[_0xc1e2('0x4')]=_[_0xc1e2('0x5')](config[_0xc1e2('0x4')],{'host':_0xc1e2('0x6'),'port':0x18eb});var io=require(_0xc1e2('0x7'))(new Redis(config['redis']));function FaxQueue(_0x1b9fca){this['id']=_0x1b9fca['id']||0x0;this[_0xc1e2('0x8')]=_0x1b9fca[_0xc1e2('0x8')]||'';this['timeout']=_0x1b9fca[_0xc1e2('0x9')]||0xa;this[_0xc1e2('0xa')]=_0x1b9fca[_0xc1e2('0xa')]||_0xc1e2('0xb');this[_0xc1e2('0xc')]=_0x1b9fca[_0xc1e2('0xc')];this[_0xc1e2('0xd')]={};this[_0xc1e2('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0xc1e2('0xf')]();}FaxQueue[_0xc1e2('0x10')]['updateRouting']=function(){var _0x54bd1f=this[_0xc1e2('0xd')]['_rr'];this[_0xc1e2('0xd')]=_[_0xc1e2('0x11')](this['Agents'],'id');this[_0xc1e2('0xd')][_0xc1e2('0x12')]=_0x54bd1f;};FaxQueue[_0xc1e2('0x10')][_0xc1e2('0xf')]=function(){this[_0xc1e2('0x13')]=0x0;this[_0xc1e2('0x14')]=0x0;for(var _0x102d0e=0x0;_0x102d0e<this[_0xc1e2('0xc')][_0xc1e2('0x15')];_0x102d0e+=0x1){if(this[_0xc1e2('0xc')][_0x102d0e][_0xc1e2('0x16')]){this['loggedIn']+=0x1;}if(this[_0xc1e2('0xc')][_0x102d0e][_0xc1e2('0x17')]){this[_0xc1e2('0x14')]+=0x1;}}this[_0xc1e2('0x18')]=this['loggedIn']-this[_0xc1e2('0x14')];this[_0xc1e2('0x18')]=this[_0xc1e2('0x18')]>=0x0?this['available']:0x0;var _0x50591e={'id':this['id'],'available':this[_0xc1e2('0x18')],'loggedIn':this[_0xc1e2('0x13')],'name':this[_0xc1e2('0x8')],'paused':this[_0xc1e2('0x14')],'waiting':this[_0xc1e2('0xe')]};var _0x26eb58=md5(JSON[_0xc1e2('0x19')](_0x50591e));if(this[_0xc1e2('0x1a')]!==_0x26eb58){this[_0xc1e2('0x1a')]=_0x26eb58;io['to'](util['format'](_0xc1e2('0x1b'),_0x50591e['name']))[_0xc1e2('0x1c')](_0xc1e2('0x1d'),_0x50591e);}};module[_0xc1e2('0x1e')]=FaxQueue;
\ No newline at end of file
+var _0xc5b5=['online','available','paused','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length'];(function(_0x2fc8a8,_0x71c3a2){var _0x3597b4=function(_0x41c345){while(--_0x41c345){_0x2fc8a8['push'](_0x2fc8a8['shift']());}};_0x3597b4(++_0x71c3a2);}(_0xc5b5,0xd4));var _0x5c5b=function(_0x2401fc,_0xbc7845){_0x2401fc=_0x2401fc-0x0;var _0x23bb42=_0xc5b5[_0x2401fc];return _0x23bb42;};'use strict';var _=require(_0x5c5b('0x0'));var md5=require(_0x5c5b('0x1'));var util=require(_0x5c5b('0x2'));var Redis=require(_0x5c5b('0x3'));var config=require('../../../config/environment');config[_0x5c5b('0x4')]=_['defaults'](config[_0x5c5b('0x4')],{'host':_0x5c5b('0x5'),'port':0x18eb});var io=require(_0x5c5b('0x6'))(new Redis(config[_0x5c5b('0x4')]));function FaxQueue(_0x406291){this['id']=_0x406291['id']||0x0;this[_0x5c5b('0x7')]=_0x406291[_0x5c5b('0x7')]||'';this['timeout']=_0x406291[_0x5c5b('0x8')]||0xa;this['strategy']=_0x406291['strategy']||_0x5c5b('0x9');this[_0x5c5b('0xa')]=_0x406291[_0x5c5b('0xa')];this[_0x5c5b('0xb')]={};this[_0x5c5b('0xc')]=0x0;this[_0x5c5b('0x1')]='';this[_0x5c5b('0xd')]();this[_0x5c5b('0xe')]();}FaxQueue[_0x5c5b('0xf')]['updateRouting']=function(){var _0x22d749=this['mapAgentsId'][_0x5c5b('0x10')];this[_0x5c5b('0xb')]=_[_0x5c5b('0x11')](this[_0x5c5b('0xa')],'id');this['mapAgentsId']['_rr']=_0x22d749;};FaxQueue[_0x5c5b('0xf')][_0x5c5b('0xe')]=function(){this[_0x5c5b('0x12')]=0x0;this['paused']=0x0;for(var _0x39215c=0x0;_0x39215c<this[_0x5c5b('0xa')][_0x5c5b('0x13')];_0x39215c+=0x1){if(this[_0x5c5b('0xa')][_0x39215c][_0x5c5b('0x14')]){this[_0x5c5b('0x12')]+=0x1;}if(this[_0x5c5b('0xa')][_0x39215c]['faxPause']){this['paused']+=0x1;}}this[_0x5c5b('0x15')]=this[_0x5c5b('0x12')]-this[_0x5c5b('0x16')];this[_0x5c5b('0x15')]=this[_0x5c5b('0x15')]>=0x0?this[_0x5c5b('0x15')]:0x0;var _0xbe047e={'id':this['id'],'available':this[_0x5c5b('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x5c5b('0x7')],'paused':this['paused'],'waiting':this[_0x5c5b('0xc')]};var _0x263ea0=md5(JSON[_0x5c5b('0x17')](_0xbe047e));if(this[_0x5c5b('0x1')]!==_0x263ea0){this['md5']=_0x263ea0;io['to'](util[_0x5c5b('0x18')](_0x5c5b('0x19'),_0xbe047e[_0x5c5b('0x7')]))[_0x5c5b('0x1a')](_0x5c5b('0x1b'),_0xbe047e);}};module[_0x5c5b('0x1c')]=FaxQueue;
\ No newline at end of file
index e2fda05..35e1ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa10=['name','Intervals','exports'];(function(_0x54a1bc,_0x2c81ed){var _0x1bc38d=function(_0x25deeb){while(--_0x25deeb){_0x54a1bc['push'](_0x54a1bc['shift']());}};_0x1bc38d(++_0x2c81ed);}(_0xfa10,0x108));var _0x0fa1=function(_0xe666ed,_0x38d09b){_0xe666ed=_0xe666ed-0x0;var _0x2cea15=_0xfa10[_0xe666ed];return _0x2cea15;};'use strict';function Interval(_0x3879a1){this['id']=_0x3879a1['id']||0x0;this[_0x0fa1('0x0')]=_0x3879a1[_0x0fa1('0x0')]||'';this[_0x0fa1('0x1')]=_0x3879a1[_0x0fa1('0x1')]||{};}module[_0x0fa1('0x2')]=Interval;
\ No newline at end of file
+var _0x8134=['exports','name'];(function(_0x36062d,_0x1be5f4){var _0x3bf622=function(_0x3c5b4a){while(--_0x3c5b4a){_0x36062d['push'](_0x36062d['shift']());}};_0x3bf622(++_0x1be5f4);}(_0x8134,0xf5));var _0x4813=function(_0x140d1a,_0x31ec8b){_0x140d1a=_0x140d1a-0x0;var _0x4b1443=_0x8134[_0x140d1a];return _0x4b1443;};'use strict';function Interval(_0x55fb15){this['id']=_0x55fb15['id']||0x0;this[_0x4813('0x0')]=_0x55fb15[_0x4813('0x0')]||'';this['Intervals']=_0x55fb15['Intervals']||{};}module[_0x4813('0x1')]=Interval;
\ No newline at end of file
index d46be1a..12402c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9767=['name','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','available','stringify','emit','mail_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter'];(function(_0x40f0c3,_0x4bc017){var _0x4e12cf=function(_0x2485dd){while(--_0x2485dd){_0x40f0c3['push'](_0x40f0c3['shift']());}};_0x4e12cf(++_0x4bc017);}(_0x9767,0x18a));var _0x7976=function(_0x28ab24,_0x2182ac){_0x28ab24=_0x28ab24-0x0;var _0x163336=_0x9767[_0x28ab24];return _0x163336;};'use strict';var _=require('lodash');var md5=require(_0x7976('0x0'));var util=require('util');var Redis=require(_0x7976('0x1'));var config=require(_0x7976('0x2'));config[_0x7976('0x3')]=_[_0x7976('0x4')](config[_0x7976('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7976('0x5'))(new Redis(config['redis']));function MailQueue(_0xe6b5ff){this['id']=_0xe6b5ff['id']||0x0;this[_0x7976('0x6')]=_0xe6b5ff[_0x7976('0x6')]||'';this['timeout']=_0xe6b5ff['timeout']||0xa;this[_0x7976('0x7')]=_0xe6b5ff[_0x7976('0x7')]||'beepall';this[_0x7976('0x8')]=_0xe6b5ff[_0x7976('0x8')];this[_0x7976('0x9')]={};this[_0x7976('0xa')]=0x0;this[_0x7976('0x0')]='';this[_0x7976('0xb')]();this['updateRealtime']();}MailQueue[_0x7976('0xc')][_0x7976('0xb')]=function(){var _0x2c7878=this[_0x7976('0x9')][_0x7976('0xd')];this[_0x7976('0x9')]=_[_0x7976('0xe')](this[_0x7976('0x8')],'id');this['mapAgentsId'][_0x7976('0xd')]=_0x2c7878;};MailQueue[_0x7976('0xc')][_0x7976('0xf')]=function(){this[_0x7976('0x10')]=0x0;this[_0x7976('0x11')]=0x0;for(var _0x4135c3=0x0;_0x4135c3<this[_0x7976('0x8')][_0x7976('0x12')];_0x4135c3+=0x1){if(this[_0x7976('0x8')][_0x4135c3][_0x7976('0x13')]){this[_0x7976('0x10')]+=0x1;}if(this['Agents'][_0x4135c3]['mailPause']){this[_0x7976('0x11')]+=0x1;}}this[_0x7976('0x14')]=this['loggedIn']-this['paused'];this[_0x7976('0x14')]=this['available']>=0x0?this[_0x7976('0x14')]:0x0;var _0x3ad24a={'id':this['id'],'available':this[_0x7976('0x14')],'loggedIn':this[_0x7976('0x10')],'name':this[_0x7976('0x6')],'paused':this[_0x7976('0x11')],'waiting':this['waiting']};var _0x1cd208=md5(JSON[_0x7976('0x15')](_0x3ad24a));if(this[_0x7976('0x0')]!==_0x1cd208){this[_0x7976('0x0')]=_0x1cd208;io['to'](util['format']('mail:queue:%s',_0x3ad24a['name']))[_0x7976('0x16')](_0x7976('0x17'),_0x3ad24a);}};module[_0x7976('0x18')]=MailQueue;
\ No newline at end of file
+var _0x1f30=['available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','updateRealtime','loggedIn','length','online','paused'];(function(_0x2a6f78,_0x57aee6){var _0x37f15e=function(_0x154ef8){while(--_0x154ef8){_0x2a6f78['push'](_0x2a6f78['shift']());}};_0x37f15e(++_0x57aee6);}(_0x1f30,0x1ba));var _0x01f3=function(_0x45311e,_0x59be38){_0x45311e=_0x45311e-0x0;var _0x4c5e8a=_0x1f30[_0x45311e];return _0x4c5e8a;};'use strict';var _=require('lodash');var md5=require(_0x01f3('0x0'));var util=require(_0x01f3('0x1'));var Redis=require(_0x01f3('0x2'));var config=require('../../../config/environment');config[_0x01f3('0x3')]=_[_0x01f3('0x4')](config[_0x01f3('0x3')],{'host':_0x01f3('0x5'),'port':0x18eb});var io=require(_0x01f3('0x6'))(new Redis(config[_0x01f3('0x3')]));function MailQueue(_0x3e80d0){this['id']=_0x3e80d0['id']||0x0;this[_0x01f3('0x7')]=_0x3e80d0[_0x01f3('0x7')]||'';this['timeout']=_0x3e80d0[_0x01f3('0x8')]||0xa;this[_0x01f3('0x9')]=_0x3e80d0[_0x01f3('0x9')]||_0x01f3('0xa');this['Agents']=_0x3e80d0[_0x01f3('0xb')];this[_0x01f3('0xc')]={};this[_0x01f3('0xd')]=0x0;this[_0x01f3('0x0')]='';this[_0x01f3('0xe')]();this['updateRealtime']();}MailQueue['prototype'][_0x01f3('0xe')]=function(){var _0x1684f0=this[_0x01f3('0xc')][_0x01f3('0xf')];this[_0x01f3('0xc')]=_[_0x01f3('0x10')](this[_0x01f3('0xb')],'id');this[_0x01f3('0xc')][_0x01f3('0xf')]=_0x1684f0;};MailQueue['prototype'][_0x01f3('0x11')]=function(){this[_0x01f3('0x12')]=0x0;this['paused']=0x0;for(var _0x14d55e=0x0;_0x14d55e<this['Agents'][_0x01f3('0x13')];_0x14d55e+=0x1){if(this[_0x01f3('0xb')][_0x14d55e][_0x01f3('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x14d55e]['mailPause']){this[_0x01f3('0x15')]+=0x1;}}this[_0x01f3('0x16')]=this['loggedIn']-this[_0x01f3('0x15')];this[_0x01f3('0x16')]=this[_0x01f3('0x16')]>=0x0?this[_0x01f3('0x16')]:0x0;var _0x563c2e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x01f3('0x7')],'paused':this[_0x01f3('0x15')],'waiting':this['waiting']};var _0x39121a=md5(JSON[_0x01f3('0x17')](_0x563c2e));if(this[_0x01f3('0x0')]!==_0x39121a){this[_0x01f3('0x0')]=_0x39121a;io['to'](util[_0x01f3('0x18')](_0x01f3('0x19'),_0x563c2e['name']))[_0x01f3('0x1a')](_0x01f3('0x1b'),_0x563c2e);}};module[_0x01f3('0x1c')]=MailQueue;
\ No newline at end of file
index f078764..25162e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x326f,0xd1));var _0xf326=function(_0x3a0543,_0x59ac6a){_0x3a0543=_0x3a0543-0x0;var _0x223f67=_0x326f[_0x3a0543];return _0x223f67;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483<this[_0xf326('0xf')]['length'];_0x5c8483+=0x1){if(this['Agents'][_0x5c8483][_0xf326('0x13')]){this[_0xf326('0x11')]+=0x1;}if(this[_0xf326('0xf')][_0x5c8483][_0xf326('0x14')]){this[_0xf326('0x12')]+=0x1;}}this[_0xf326('0x15')]=this[_0xf326('0x11')]-this[_0xf326('0x12')];this['available']=this[_0xf326('0x15')]>=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue;
\ No newline at end of file
+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(_0x2fc892,_0x50a908){var _0xca0d10=function(_0x3a9b85){while(--_0x3a9b85){_0x2fc892['push'](_0x2fc892['shift']());}};_0xca0d10(++_0x50a908);}(_0x814b,0x1a2));var _0xb814=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x814b[_0x5a6de2];return _0x2c0525;};'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 75ea682..ff09a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c4=['waiting','prototype','updateRouting','_rr','updateRealtime','loggedIn','online','smsPause','paused','available','stringify','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId'];(function(_0x2a4fe2,_0x3ec53a){var _0x225c4a=function(_0x1eccfa){while(--_0x1eccfa){_0x2a4fe2['push'](_0x2a4fe2['shift']());}};_0x225c4a(++_0x3ec53a);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x175e8b,_0x3238ee){_0x175e8b=_0x175e8b-0x0;var _0x15e4b0=_0xc1c4[_0x175e8b];return _0x15e4b0;};'use strict';var _=require(_0x4c1c('0x0'));var md5=require(_0x4c1c('0x1'));var util=require(_0x4c1c('0x2'));var Redis=require(_0x4c1c('0x3'));var config=require(_0x4c1c('0x4'));config[_0x4c1c('0x5')]=_[_0x4c1c('0x6')](config['redis'],{'host':_0x4c1c('0x7'),'port':0x18eb});var io=require(_0x4c1c('0x8'))(new Redis(config[_0x4c1c('0x5')]));function SmsQueue(_0x44d953){this['id']=_0x44d953['id']||0x0;this['name']=_0x44d953[_0x4c1c('0x9')]||'';this['timeout']=_0x44d953['timeout']||0xa;this[_0x4c1c('0xa')]=_0x44d953[_0x4c1c('0xa')]||'beepall';this[_0x4c1c('0xb')]=_0x44d953[_0x4c1c('0xb')];this[_0x4c1c('0xc')]={};this[_0x4c1c('0xd')]=0x0;this[_0x4c1c('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x4c1c('0xe')][_0x4c1c('0xf')]=function(){var _0x41278a=this[_0x4c1c('0xc')][_0x4c1c('0x10')];this[_0x4c1c('0xc')]=_['map'](this['Agents'],'id');this[_0x4c1c('0xc')][_0x4c1c('0x10')]=_0x41278a;};SmsQueue[_0x4c1c('0xe')][_0x4c1c('0x11')]=function(){this[_0x4c1c('0x12')]=0x0;this['paused']=0x0;for(var _0x160ee0=0x0;_0x160ee0<this[_0x4c1c('0xb')]['length'];_0x160ee0+=0x1){if(this[_0x4c1c('0xb')][_0x160ee0][_0x4c1c('0x13')]){this[_0x4c1c('0x12')]+=0x1;}if(this[_0x4c1c('0xb')][_0x160ee0][_0x4c1c('0x14')]){this[_0x4c1c('0x15')]+=0x1;}}this[_0x4c1c('0x16')]=this[_0x4c1c('0x12')]-this[_0x4c1c('0x15')];this[_0x4c1c('0x16')]=this[_0x4c1c('0x16')]>=0x0?this['available']:0x0;var _0x1fad89={'id':this['id'],'available':this[_0x4c1c('0x16')],'loggedIn':this[_0x4c1c('0x12')],'name':this[_0x4c1c('0x9')],'paused':this[_0x4c1c('0x15')],'waiting':this[_0x4c1c('0xd')]};var _0x22b52a=md5(JSON[_0x4c1c('0x17')](_0x1fad89));if(this[_0x4c1c('0x1')]!==_0x22b52a){this[_0x4c1c('0x1')]=_0x22b52a;io['to'](util['format']('sms:queue:%s',_0x1fad89[_0x4c1c('0x9')]))['emit'](_0x4c1c('0x18'),_0x1fad89);}};module[_0x4c1c('0x19')]=SmsQueue;
\ No newline at end of file
+var _0xb90d=['sms_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','length','loggedIn','available','paused','stringify','format','sms:queue:%s','emit'];(function(_0x567e56,_0xc21586){var _0x7d07ad=function(_0x8a0c84){while(--_0x8a0c84){_0x567e56['push'](_0x567e56['shift']());}};_0x7d07ad(++_0xc21586);}(_0xb90d,0x17a));var _0xdb90=function(_0x2145c0,_0x549319){_0x2145c0=_0x2145c0-0x0;var _0x4c613a=_0xb90d[_0x2145c0];return _0x4c613a;};'use strict';var _=require('lodash');var md5=require(_0xdb90('0x0'));var util=require(_0xdb90('0x1'));var Redis=require(_0xdb90('0x2'));var config=require(_0xdb90('0x3'));config[_0xdb90('0x4')]=_[_0xdb90('0x5')](config['redis'],{'host':_0xdb90('0x6'),'port':0x18eb});var io=require(_0xdb90('0x7'))(new Redis(config[_0xdb90('0x4')]));function SmsQueue(_0x532dbc){this['id']=_0x532dbc['id']||0x0;this['name']=_0x532dbc[_0xdb90('0x8')]||'';this[_0xdb90('0x9')]=_0x532dbc[_0xdb90('0x9')]||0xa;this[_0xdb90('0xa')]=_0x532dbc['strategy']||_0xdb90('0xb');this[_0xdb90('0xc')]=_0x532dbc[_0xdb90('0xc')];this['mapAgentsId']={};this[_0xdb90('0xd')]=0x0;this[_0xdb90('0x0')]='';this[_0xdb90('0xe')]();this[_0xdb90('0xf')]();}SmsQueue[_0xdb90('0x10')]['updateRouting']=function(){var _0x597572=this['mapAgentsId'][_0xdb90('0x11')];this[_0xdb90('0x12')]=_[_0xdb90('0x13')](this[_0xdb90('0xc')],'id');this[_0xdb90('0x12')][_0xdb90('0x11')]=_0x597572;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x569d40=0x0;_0x569d40<this['Agents'][_0xdb90('0x14')];_0x569d40+=0x1){if(this[_0xdb90('0xc')][_0x569d40]['online']){this[_0xdb90('0x15')]+=0x1;}if(this[_0xdb90('0xc')][_0x569d40]['smsPause']){this['paused']+=0x1;}}this[_0xdb90('0x16')]=this[_0xdb90('0x15')]-this[_0xdb90('0x17')];this['available']=this[_0xdb90('0x16')]>=0x0?this[_0xdb90('0x16')]:0x0;var _0xd50abd={'id':this['id'],'available':this[_0xdb90('0x16')],'loggedIn':this[_0xdb90('0x15')],'name':this[_0xdb90('0x8')],'paused':this[_0xdb90('0x17')],'waiting':this[_0xdb90('0xd')]};var _0x19e1bf=md5(JSON[_0xdb90('0x18')](_0xd50abd));if(this['md5']!==_0x19e1bf){this['md5']=_0x19e1bf;io['to'](util[_0xdb90('0x19')](_0xdb90('0x1a'),_0xd50abd[_0xdb90('0x8')]))[_0xdb90('0x1b')](_0xdb90('0x1c'),_0xd50abd);}};module['exports']=SmsQueue;
\ No newline at end of file
index 8fb3953..642bd7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd482=['ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','available','stringify','format','whatsapp:queue:%s','exports','lodash','md5','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd482,0x69));var _0x2d48=function(_0x5e6b5a,_0x407233){_0x5e6b5a=_0x5e6b5a-0x0;var _0x36d83a=_0xd482[_0x5e6b5a];return _0x36d83a;};'use strict';var _=require(_0x2d48('0x0'));var md5=require(_0x2d48('0x1'));var util=require(_0x2d48('0x2'));var Redis=require(_0x2d48('0x3'));var config=require('../../../config/environment');config[_0x2d48('0x4')]=_[_0x2d48('0x5')](config[_0x2d48('0x4')],{'host':_0x2d48('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d48('0x4')]));function WhatsappQueue(_0x6b61b5){this['id']=_0x6b61b5['id']||0x0;this[_0x2d48('0x7')]=_0x6b61b5[_0x2d48('0x7')]||'';this[_0x2d48('0x8')]=_0x6b61b5[_0x2d48('0x8')]||0xa;this[_0x2d48('0x9')]=_0x6b61b5[_0x2d48('0x9')]||_0x2d48('0xa');this[_0x2d48('0xb')]=_0x6b61b5[_0x2d48('0xb')];this[_0x2d48('0xc')]={};this[_0x2d48('0xd')]=0x0;this[_0x2d48('0x1')]='';this['updateRouting']();this[_0x2d48('0xe')]();}WhatsappQueue[_0x2d48('0xf')]['updateRouting']=function(){var _0x3379fb=this['mapAgentsId'][_0x2d48('0x10')];this['mapAgentsId']=_[_0x2d48('0x11')](this[_0x2d48('0xb')],'id');this['mapAgentsId'][_0x2d48('0x10')]=_0x3379fb;};WhatsappQueue[_0x2d48('0xf')][_0x2d48('0xe')]=function(){this['loggedIn']=0x0;this[_0x2d48('0x12')]=0x0;for(var _0x93f3eb=0x0;_0x93f3eb<this[_0x2d48('0xb')][_0x2d48('0x13')];_0x93f3eb+=0x1){if(this[_0x2d48('0xb')][_0x93f3eb][_0x2d48('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x93f3eb]['whatsappPause']){this[_0x2d48('0x12')]+=0x1;}}this['available']=this[_0x2d48('0x15')]-this[_0x2d48('0x12')];this[_0x2d48('0x16')]=this[_0x2d48('0x16')]>=0x0?this['available']:0x0;var _0xc84ed2={'id':this['id'],'available':this[_0x2d48('0x16')],'loggedIn':this[_0x2d48('0x15')],'name':this[_0x2d48('0x7')],'paused':this[_0x2d48('0x12')],'waiting':this[_0x2d48('0xd')]};var _0x40a9a9=md5(JSON[_0x2d48('0x17')](_0xc84ed2));if(this[_0x2d48('0x1')]!==_0x40a9a9){this[_0x2d48('0x1')]=_0x40a9a9;io['to'](util[_0x2d48('0x18')](_0x2d48('0x19'),_0xc84ed2['name']))['emit']('whatsapp_queue:save',_0xc84ed2);}};module[_0x2d48('0x1a')]=WhatsappQueue;
\ No newline at end of file
+var _0xf5ae=['prototype','updateRouting','_rr','map','paused','length','online','loggedIn','whatsappPause','available','waiting','format','whatsapp:queue:%s','emit','exports','lodash','md5','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime'];(function(_0xad8860,_0x57d7d7){var _0x2e273f=function(_0x26095f){while(--_0x26095f){_0xad8860['push'](_0xad8860['shift']());}};_0x2e273f(++_0x57d7d7);}(_0xf5ae,0x127));var _0xef5a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf5ae[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xef5a('0x0'));var md5=require(_0xef5a('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xef5a('0x2')](config[_0xef5a('0x3')],{'host':_0xef5a('0x4'),'port':0x18eb});var io=require(_0xef5a('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x494181){this['id']=_0x494181['id']||0x0;this[_0xef5a('0x6')]=_0x494181[_0xef5a('0x6')]||'';this['timeout']=_0x494181[_0xef5a('0x7')]||0xa;this['strategy']=_0x494181[_0xef5a('0x8')]||_0xef5a('0x9');this[_0xef5a('0xa')]=_0x494181[_0xef5a('0xa')];this[_0xef5a('0xb')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0xef5a('0xc')]();}WhatsappQueue[_0xef5a('0xd')][_0xef5a('0xe')]=function(){var _0x38700d=this[_0xef5a('0xb')][_0xef5a('0xf')];this[_0xef5a('0xb')]=_[_0xef5a('0x10')](this[_0xef5a('0xa')],'id');this[_0xef5a('0xb')]['_rr']=_0x38700d;};WhatsappQueue[_0xef5a('0xd')][_0xef5a('0xc')]=function(){this['loggedIn']=0x0;this[_0xef5a('0x11')]=0x0;for(var _0x49558a=0x0;_0x49558a<this[_0xef5a('0xa')][_0xef5a('0x12')];_0x49558a+=0x1){if(this['Agents'][_0x49558a][_0xef5a('0x13')]){this[_0xef5a('0x14')]+=0x1;}if(this['Agents'][_0x49558a][_0xef5a('0x15')]){this[_0xef5a('0x11')]+=0x1;}}this[_0xef5a('0x16')]=this[_0xef5a('0x14')]-this[_0xef5a('0x11')];this[_0xef5a('0x16')]=this[_0xef5a('0x16')]>=0x0?this[_0xef5a('0x16')]:0x0;var _0x3f02ba={'id':this['id'],'available':this[_0xef5a('0x16')],'loggedIn':this[_0xef5a('0x14')],'name':this[_0xef5a('0x6')],'paused':this['paused'],'waiting':this[_0xef5a('0x17')]};var _0x2febe7=md5(JSON['stringify'](_0x3f02ba));if(this['md5']!==_0x2febe7){this[_0xef5a('0x1')]=_0x2febe7;io['to'](util[_0xef5a('0x18')](_0xef5a('0x19'),_0x3f02ba[_0xef5a('0x6')]))[_0xef5a('0x1a')]('whatsapp_queue:save',_0x3f02ba);}};module[_0xef5a('0x1b')]=WhatsappQueue;
\ No newline at end of file
index be9bd02..cb3ccff 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(_0x2e2806,_0x565949){var _0x2965f0=function(_0x57e692){while(--_0x57e692){_0x2e2806['push'](_0x2e2806['shift']());}};_0x2965f0(++_0x565949);}(_0xb10b,0x12a));var _0xbb10=function(_0x23fcec,_0x48ec4c){_0x23fcec=_0x23fcec-0x0;var _0x447567=_0xb10b[_0x23fcec];return _0x447567;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 31c7327..5c27c61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5667=['UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x4ef7bc,_0x1e8207){var _0x30a74f=function(_0x5c728e){while(--_0x5c728e){_0x4ef7bc['push'](_0x4ef7bc['shift']());}};_0x30a74f(++_0x1e8207);}(_0x5667,0x1ba));var _0x7566=function(_0x1c7656,_0xd88ebf){_0x1c7656=_0x1c7656-0x0;var _0x71cfed=_0x5667[_0x1c7656];return _0x71cfed;};'use strict';var client=require(_0x7566('0x0'));exports['update']=function(_0x48ea78,_0x366d3e){return client[_0x7566('0x1')](_0x7566('0x2'),{'body':_0x366d3e,'options':{'where':{'id':_0x48ea78}},'log':'updateChatInteraction'});};exports[_0x7566('0x3')]=function(_0x118432,_0x5676ee){return client['Request'](_0x7566('0x4'),{'body':_0x5676ee,'options':{'where':{'id':_0x118432}},'log':_0x7566('0x5')});};
\ No newline at end of file
+var _0xe0d7=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','addTagsToChatInteraction'];(function(_0x4eff4b,_0x2e75a3){var _0xe03a6e=function(_0x975d42){while(--_0x975d42){_0x4eff4b['push'](_0x4eff4b['shift']());}};_0xe03a6e(++_0x2e75a3);}(_0xe0d7,0xfc));var _0x7e0d=function(_0x2aeeb1,_0x92e412){_0x2aeeb1=_0x2aeeb1-0x0;var _0x12e777=_0xe0d7[_0x2aeeb1];return _0x12e777;};'use strict';var client=require(_0x7e0d('0x0'));exports[_0x7e0d('0x1')]=function(_0x58cd3f,_0x565008){return client[_0x7e0d('0x2')](_0x7e0d('0x3'),{'body':_0x565008,'options':{'where':{'id':_0x58cd3f}},'log':_0x7e0d('0x4')});};exports[_0x7e0d('0x5')]=function(_0x4d5ced,_0x468a28){return client['Request']('AddTagsToChatInteraction',{'body':_0x468a28,'options':{'where':{'id':_0x4d5ced}},'log':_0x7e0d('0x6')});};
\ No newline at end of file
index 3550087..35d5a3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bd0=['createChatMessage','../client','create','Request'];(function(_0xf767a8,_0x2a5f9e){var _0x1e2247=function(_0x22fce2){while(--_0x22fce2){_0xf767a8['push'](_0xf767a8['shift']());}};_0x1e2247(++_0x2a5f9e);}(_0x3bd0,0xbd));var _0x03bd=function(_0x3767ef,_0x29c168){_0x3767ef=_0x3767ef-0x0;var _0x14c673=_0x3bd0[_0x3767ef];return _0x14c673;};'use strict';var client=require(_0x03bd('0x0'));exports[_0x03bd('0x1')]=function(_0x2995d5){return client[_0x03bd('0x2')]('CreateChatMessage',{'body':_0x2995d5,'log':_0x03bd('0x3')});};
\ No newline at end of file
+var _0xb1bf=['CreateChatMessage','../client','Request'];(function(_0x777c0d,_0x263046){var _0x4b9aaf=function(_0xbf3ab6){while(--_0xbf3ab6){_0x777c0d['push'](_0x777c0d['shift']());}};_0x4b9aaf(++_0x263046);}(_0xb1bf,0x181));var _0xfb1b=function(_0x161757,_0x2f29af){_0x161757=_0x161757-0x0;var _0x4a6adc=_0xb1bf[_0x161757];return _0x4a6adc;};'use strict';var client=require(_0xfb1b('0x0'));exports['create']=function(_0x3e23d3){return client[_0xfb1b('0x1')](_0xfb1b('0x2'),{'body':_0x3e23d3,'log':'createChatMessage'});};
\ No newline at end of file
index 1a8b059..dffde75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4dc=['online','chatPause','../client','getChatQueues','name','timeout','strategy','User','Agents'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xa4dc,0x16a));var _0xca4d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa4dc[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0xca4d('0x0'));exports[_0xca4d('0x1')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xca4d('0x2'),_0xca4d('0x3'),_0xca4d('0x4')],'include':[{'model':_0xca4d('0x5'),'as':_0xca4d('0x6'),'attributes':['id','name',_0xca4d('0x7'),_0xca4d('0x8')]}]},'log':_0xca4d('0x1')});};};
\ No newline at end of file
+var _0xe9e7=['online','../client','getChatQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x587e1a,_0x331e8f){var _0x240094=function(_0x15d173){while(--_0x15d173){_0x587e1a['push'](_0x587e1a['shift']());}};_0x240094(++_0x331e8f);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x4a43bd,_0x5a2620){_0x4a43bd=_0x4a43bd-0x0;var _0x5becfc=_0xe9e7[_0x4a43bd];return _0x5becfc;};'use strict';var client=require(_0x7e9e('0x0'));exports[_0x7e9e('0x1')]=function(){return function(){return client[_0x7e9e('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x7e9e('0x3'),_0x7e9e('0x4'),_0x7e9e('0x5')],'include':[{'model':_0x7e9e('0x6'),'as':_0x7e9e('0x7'),'attributes':['id',_0x7e9e('0x3'),_0x7e9e('0x8'),'chatPause']}]},'log':_0x7e9e('0x1')});};};
\ No newline at end of file
index 8ae308b..2630362 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3667=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport','update'];(function(_0xadc7a0,_0x175356){var _0x113f84=function(_0x3d5e76){while(--_0x3d5e76){_0xadc7a0['push'](_0xadc7a0['shift']());}};_0x113f84(++_0x175356);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7366('0x0'));exports[_0x7366('0x1')]=function(_0x33dd4e){return client[_0x7366('0x2')](_0x7366('0x3'),{'body':_0x33dd4e,'log':'CreateChatQueueReport'});};exports[_0x7366('0x4')]=function(_0x1cfcc9,_0x4b32a7){return client[_0x7366('0x2')](_0x7366('0x5'),{'body':_0x4b32a7,'options':{'where':{'uniqueid':_0x1cfcc9},'order':[['id',_0x7366('0x6')]],'limit':0x1},'log':_0x7366('0x5')});};
\ No newline at end of file
+var _0x3308=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport','update'];(function(_0x125a8f,_0x44d062){var _0x5b3a61=function(_0x17c638){while(--_0x17c638){_0x125a8f['push'](_0x125a8f['shift']());}};_0x5b3a61(++_0x44d062);}(_0x3308,0x12e));var _0x8330=function(_0x379041,_0x1f761a){_0x379041=_0x379041-0x0;var _0x55db70=_0x3308[_0x379041];return _0x55db70;};'use strict';var client=require('../client');exports['create']=function(_0x4f0007){return client[_0x8330('0x0')](_0x8330('0x1'),{'body':_0x4f0007,'log':_0x8330('0x1')});};exports[_0x8330('0x2')]=function(_0x508fce,_0x5f52e6){return client[_0x8330('0x0')](_0x8330('0x3'),{'body':_0x5f52e6,'options':{'where':{'uniqueid':_0x508fce},'order':[['id',_0x8330('0x4')]],'limit':0x1},'log':_0x8330('0x3')});};
\ No newline at end of file
index 009cf1f..43e140f 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(_0x169471,_0x456797){var _0xe9233c=function(_0x572397){while(--_0x572397){_0x169471['push'](_0x169471['shift']());}};_0xe9233c(++_0x456797);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x7a54,0x106));var _0x47a5=function(_0x5bd824,_0x32aff7){_0x5bd824=_0x5bd824-0x0;var _0x3403ec=_0x7a54[_0x5bd824];return _0x3403ec;};'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 aab7f8e..3f4dbc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdb3=['Request','createFaxMessage'];(function(_0x68dfbb,_0x31479d){var _0x2d0777=function(_0xb2e3a5){while(--_0xb2e3a5){_0x68dfbb['push'](_0x68dfbb['shift']());}};_0x2d0777(++_0x31479d);}(_0xcdb3,0xbe));var _0x3cdb=function(_0x1d6dc8,_0x195bf5){_0x1d6dc8=_0x1d6dc8-0x0;var _0x9a808a=_0xcdb3[_0x1d6dc8];return _0x9a808a;};'use strict';var client=require('../client');exports['create']=function(_0x3b6894){return client[_0x3cdb('0x0')]('CreateFaxMessage',{'body':_0x3b6894,'log':_0x3cdb('0x1')});};
\ No newline at end of file
+var _0x2566=['CreateFaxMessage','createFaxMessage','Request'];(function(_0x19c236,_0x231e32){var _0x5af07f=function(_0x5903a5){while(--_0x5903a5){_0x19c236['push'](_0x19c236['shift']());}};_0x5af07f(++_0x231e32);}(_0x2566,0xe9));var _0x6256=function(_0x2f7467,_0x109926){_0x2f7467=_0x2f7467-0x0;var _0x4508f9=_0x2566[_0x2f7467];return _0x4508f9;};'use strict';var client=require('../client');exports['create']=function(_0x48a38f){return client[_0x6256('0x0')](_0x6256('0x1'),{'body':_0x48a38f,'log':_0x6256('0x2')});};
\ No newline at end of file
index ba46708..74320b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc483=['Request','GetFaxQueue','name','timeout','User','Agents','online','faxPause','getFaxQueues'];(function(_0x2cbe63,_0x2b371f){var _0x37e8b9=function(_0x3e3ce4){while(--_0x3e3ce4){_0x2cbe63['push'](_0x2cbe63['shift']());}};_0x37e8b9(++_0x2b371f);}(_0xc483,0x1b0));var _0x3c48=function(_0x1cf511,_0x11c3d1){_0x1cf511=_0x1cf511-0x0;var _0x29be99=_0xc483[_0x1cf511];return _0x29be99;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x3c48('0x0')](_0x3c48('0x1'),{'options':{'raw':![],'attributes':['id',_0x3c48('0x2'),_0x3c48('0x3'),'strategy'],'include':[{'model':_0x3c48('0x4'),'as':_0x3c48('0x5'),'attributes':['id',_0x3c48('0x2'),_0x3c48('0x6'),_0x3c48('0x7')]}]},'log':_0x3c48('0x8')});};};
\ No newline at end of file
+var _0xa167=['online','faxPause','getFaxQueues','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x46533d,_0x3d13e1){var _0x35d74e=function(_0x3b6550){while(--_0x3b6550){_0x46533d['push'](_0x46533d['shift']());}};_0x35d74e(++_0x3d13e1);}(_0xa167,0x6e));var _0x7a16=function(_0x57ae31,_0x4f69f8){_0x57ae31=_0x57ae31-0x0;var _0x3eeca4=_0xa167[_0x57ae31];return _0x3eeca4;};'use strict';var client=require('../client');exports[_0x7a16('0x0')]=function(){return function(){return client['Request'](_0x7a16('0x1'),{'options':{'raw':![],'attributes':['id',_0x7a16('0x2'),_0x7a16('0x3'),_0x7a16('0x4')],'include':[{'model':_0x7a16('0x5'),'as':_0x7a16('0x6'),'attributes':['id','name',_0x7a16('0x7'),_0x7a16('0x8')]}]},'log':_0x7a16('0x0')});};};
\ No newline at end of file
index a97ba74..16eeb93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95e2=['Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client'];(function(_0x5474b4,_0x5027aa){var _0x33a0b5=function(_0x41fd6b){while(--_0x41fd6b){_0x5474b4['push'](_0x5474b4['shift']());}};_0x33a0b5(++_0x5027aa);}(_0x95e2,0x125));var _0x295e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e2[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x295e('0x0'));exports['create']=function(_0x349fe7){return client[_0x295e('0x1')](_0x295e('0x2'),{'body':_0x349fe7,'log':_0x295e('0x2')});};exports[_0x295e('0x3')]=function(_0x59b307,_0x34866d){return client[_0x295e('0x1')]('UpdateFaxQueueReport',{'body':_0x34866d,'options':{'where':{'uniqueid':_0x59b307},'order':[['id',_0x295e('0x4')]],'limit':0x1},'log':_0x295e('0x5')});};
\ No newline at end of file
+var _0xbefb=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x448f93,_0x214cd4){var _0x5da717=function(_0x54cada){while(--_0x54cada){_0x448f93['push'](_0x448f93['shift']());}};_0x5da717(++_0x214cd4);}(_0xbefb,0x137));var _0xbbef=function(_0x40fbdd,_0x11ebaa){_0x40fbdd=_0x40fbdd-0x0;var _0x51ce54=_0xbefb[_0x40fbdd];return _0x51ce54;};'use strict';var client=require(_0xbbef('0x0'));exports[_0xbbef('0x1')]=function(_0xef1746){return client[_0xbbef('0x2')]('CreateFaxQueueReport',{'body':_0xef1746,'log':_0xbbef('0x3')});};exports['update']=function(_0x39d952,_0x209570){return client[_0xbbef('0x2')](_0xbbef('0x4'),{'body':_0x209570,'options':{'where':{'uniqueid':_0x39d952},'order':[['id',_0xbbef('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index fdd776a..c568340 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda35=['getIntervals','Request','GetInterval','Interval','name','interval','../client'];(function(_0x577925,_0x11a01f){var _0x2d9ae0=function(_0x52aa74){while(--_0x52aa74){_0x577925['push'](_0x577925['shift']());}};_0x2d9ae0(++_0x11a01f);}(_0xda35,0x109));var _0x5da3=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0xda35[_0x403fc7];return _0x5d0827;};'use strict';var client=require(_0x5da3('0x0'));exports[_0x5da3('0x1')]=function(){return function(){return client[_0x5da3('0x2')](_0x5da3('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x5da3('0x4'),'as':'Intervals','attributes':['id',_0x5da3('0x5'),_0x5da3('0x6')]}]},'log':_0x5da3('0x1')});};};
\ No newline at end of file
+var _0xebec=['Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xebec,0x9c));var _0xcebe=function(_0x1b049a,_0x4e8530){_0x1b049a=_0x1b049a-0x0;var _0x31928e=_0xebec[_0x1b049a];return _0x31928e;};'use strict';var client=require(_0xcebe('0x0'));exports[_0xcebe('0x1')]=function(){return function(){return client[_0xcebe('0x2')](_0xcebe('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xcebe('0x4')],'include':[{'model':'Interval','as':_0xcebe('0x5'),'attributes':['id',_0xcebe('0x4'),_0xcebe('0x6')]}]},'log':_0xcebe('0x1')});};};
\ No newline at end of file
index d6d4793..8b00c86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0424=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x23e697,_0x273908){var _0x5b62e7=function(_0x3acbce){while(--_0x3acbce){_0x23e697['push'](_0x23e697['shift']());}};_0x5b62e7(++_0x273908);}(_0x0424,0x159));var _0x4042=function(_0x185334,_0x4630ac){_0x185334=_0x185334-0x0;var _0xf2e59a=_0x0424[_0x185334];return _0xf2e59a;};'use strict';var client=require('../client');exports['update']=function(_0x27e499,_0x28e024){return client[_0x4042('0x0')](_0x4042('0x1'),{'body':_0x28e024,'options':{'where':{'id':_0x27e499}},'log':'updateMailInteraction'});};exports[_0x4042('0x2')]=function(_0x519987,_0x491eae){return client[_0x4042('0x0')](_0x4042('0x3'),{'body':_0x491eae,'options':{'where':{'id':_0x519987}},'log':_0x4042('0x4')});};
\ No newline at end of file
+var _0xeb3b=['../client','update','Request','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x4d0af1,_0x511dc8){var _0x435347=function(_0x2d3405){while(--_0x2d3405){_0x4d0af1['push'](_0x4d0af1['shift']());}};_0x435347(++_0x511dc8);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0xeb3b[_0x1df473];return _0x1bdd49;};'use strict';var client=require(_0xbeb3('0x0'));exports[_0xbeb3('0x1')]=function(_0xc5aaa3,_0x33e049){return client[_0xbeb3('0x2')]('UpdateMailInteraction',{'body':_0x33e049,'options':{'where':{'id':_0xc5aaa3}},'log':'updateMailInteraction'});};exports[_0xbeb3('0x3')]=function(_0x5b0e3b,_0x2e8ce3){return client['Request'](_0xbeb3('0x4'),{'body':_0x2e8ce3,'options':{'where':{'id':_0x5b0e3b}},'log':_0xbeb3('0x5')});};
\ No newline at end of file
index 68f4492..cdf1cc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3032=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x716044,_0xdec0c2){var _0x26cc9c=function(_0x2d8a7e){while(--_0x2d8a7e){_0x716044['push'](_0x716044['shift']());}};_0x26cc9c(++_0xdec0c2);}(_0x3032,0x127));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2303('0x0'));exports[_0x2303('0x1')]=function(_0x3b8aab){return client[_0x2303('0x2')](_0x2303('0x3'),{'body':_0x3b8aab,'log':_0x2303('0x4')});};
\ No newline at end of file
+var _0xe270=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0x2af162,_0xe6b806){var _0x304a9c=function(_0x366a78){while(--_0x366a78){_0x2af162['push'](_0x2af162['shift']());}};_0x304a9c(++_0xe6b806);}(_0xe270,0x1c9));var _0x0e27=function(_0x2acf8c,_0x46a3cb){_0x2acf8c=_0x2acf8c-0x0;var _0x373fd1=_0xe270[_0x2acf8c];return _0x373fd1;};'use strict';var client=require(_0x0e27('0x0'));exports['create']=function(_0xbc2d2f){return client[_0x0e27('0x1')](_0x0e27('0x2'),{'body':_0xbc2d2f,'log':_0x0e27('0x3')});};
\ No newline at end of file
index cfb00ab..eecff47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2f9=['mailPause','../client','getMailQueues','Request','name','timeout','User','Agents'];(function(_0x337a5e,_0x148b47){var _0x380f5f=function(_0x8b7b5b){while(--_0x8b7b5b){_0x337a5e['push'](_0x337a5e['shift']());}};_0x380f5f(++_0x148b47);}(_0xc2f9,0x121));var _0x9c2f=function(_0x1ea7ee,_0x3c0078){_0x1ea7ee=_0x1ea7ee-0x0;var _0xba2abe=_0xc2f9[_0x1ea7ee];return _0xba2abe;};'use strict';var client=require(_0x9c2f('0x0'));exports[_0x9c2f('0x1')]=function(){return function(){return client[_0x9c2f('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x9c2f('0x3'),_0x9c2f('0x4'),'strategy'],'include':[{'model':_0x9c2f('0x5'),'as':_0x9c2f('0x6'),'attributes':['id',_0x9c2f('0x3'),'online',_0x9c2f('0x7')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x86ea=['getMailQueues','../client','GetMailQueue','timeout','User','Agents','name'];(function(_0x4bc087,_0x4cbb9d){var _0x3732ba=function(_0x392f11){while(--_0x392f11){_0x4bc087['push'](_0x4bc087['shift']());}};_0x3732ba(++_0x4cbb9d);}(_0x86ea,0x86));var _0xa86e=function(_0x1e7287,_0x33a9d5){_0x1e7287=_0x1e7287-0x0;var _0x2d799b=_0x86ea[_0x1e7287];return _0x2d799b;};'use strict';var client=require(_0xa86e('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0xa86e('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xa86e('0x2'),'strategy'],'include':[{'model':_0xa86e('0x3'),'as':_0xa86e('0x4'),'attributes':['id',_0xa86e('0x5'),'online','mailPause']}]},'log':_0xa86e('0x6')});};};
\ No newline at end of file
index 4e8cc72..896c3ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7a=['Request','DESC','UpdateMailQueueReport','CreateMailQueueReport','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfa7a,0x1ca));var _0xafa7=function(_0xac3935,_0x553f12){_0xac3935=_0xac3935-0x0;var _0x391cea=_0xfa7a[_0xac3935];return _0x391cea;};'use strict';var client=require('../client');exports['create']=function(_0x298972){return client['Request']('CreateMailQueueReport',{'body':_0x298972,'log':_0xafa7('0x0')});};exports[_0xafa7('0x1')]=function(_0x55ede7,_0xc83c18){return client[_0xafa7('0x2')]('UpdateMailQueueReport',{'body':_0xc83c18,'options':{'where':{'uniqueid':_0x55ede7},'order':[['id',_0xafa7('0x3')]],'limit':0x1},'log':_0xafa7('0x4')});};
\ No newline at end of file
+var _0xe2d0=['UpdateMailQueueReport','../client','create','CreateMailQueueReport','Request','DESC'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xe2d0,0x13f));var _0x0e2d=function(_0x603fe7,_0x34c073){_0x603fe7=_0x603fe7-0x0;var _0x2124ac=_0xe2d0[_0x603fe7];return _0x2124ac;};'use strict';var client=require(_0x0e2d('0x0'));exports[_0x0e2d('0x1')]=function(_0x2a392a){return client['Request'](_0x0e2d('0x2'),{'body':_0x2a392a,'log':_0x0e2d('0x2')});};exports['update']=function(_0x521fe3,_0x5234a1){return client[_0x0e2d('0x3')]('UpdateMailQueueReport',{'body':_0x5234a1,'options':{'where':{'uniqueid':_0x521fe3},'order':[['id',_0x0e2d('0x4')]],'limit':0x1},'log':_0x0e2d('0x5')});};
\ No newline at end of file
index 32eb57a..164b298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1daf=['Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x483cc8,_0x28e632){var _0x1b98a3=function(_0x2ab3b9){while(--_0x2ab3b9){_0x483cc8['push'](_0x483cc8['shift']());}};_0x1b98a3(++_0x28e632);}(_0x1daf,0x71));var _0xf1da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1daf[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports[_0xf1da('0x0')]=function(_0x2c7e1e,_0x597c0b){return client[_0xf1da('0x1')](_0xf1da('0x2'),{'body':_0x597c0b,'options':{'where':{'id':_0x2c7e1e}},'log':'updateOpenchannelInteraction'});};exports[_0xf1da('0x3')]=function(_0x40b9d2,_0x45c4d7){return client[_0xf1da('0x1')](_0xf1da('0x4'),{'body':_0x45c4d7,'options':{'where':{'id':_0x40b9d2}},'log':_0xf1da('0x5')});};
\ No newline at end of file
+var _0x9f9c=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x2f2ee5,_0x2a91f0){var _0xd3afb7=function(_0x240291){while(--_0x240291){_0x2f2ee5['push'](_0x2f2ee5['shift']());}};_0xd3afb7(++_0x2a91f0);}(_0x9f9c,0x190));var _0xc9f9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9f9c[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xc9f9('0x0'));exports[_0xc9f9('0x1')]=function(_0xd54d28,_0x42d53b){return client[_0xc9f9('0x2')]('UpdateOpenchannelInteraction',{'body':_0x42d53b,'options':{'where':{'id':_0xd54d28}},'log':_0xc9f9('0x3')});};exports[_0xc9f9('0x4')]=function(_0x38d3b2,_0x1484d2){return client[_0xc9f9('0x2')](_0xc9f9('0x5'),{'body':_0x1484d2,'options':{'where':{'id':_0x38d3b2}},'log':_0xc9f9('0x6')});};
\ No newline at end of file
index 495629d..96b1e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x707b=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x8bbd12,_0x4cfe4f){var _0x8f9c4e=function(_0x78d3b3){while(--_0x78d3b3){_0x8bbd12['push'](_0x8bbd12['shift']());}};_0x8f9c4e(++_0x4cfe4f);}(_0x707b,0x1c2));var _0xb707=function(_0x2820fc,_0x481318){_0x2820fc=_0x2820fc-0x0;var _0x1e1508=_0x707b[_0x2820fc];return _0x1e1508;};'use strict';var client=require(_0xb707('0x0'));exports[_0xb707('0x1')]=function(_0x6f1985){return client['Request'](_0xb707('0x2'),{'body':_0x6f1985,'log':_0xb707('0x3')});};
\ No newline at end of file
+var _0xd940=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xd940,0x1c3));var _0x0d94=function(_0x292423,_0x1759b7){_0x292423=_0x292423-0x0;var _0x2801cb=_0xd940[_0x292423];return _0x2801cb;};'use strict';var client=require(_0x0d94('0x0'));exports[_0x0d94('0x1')]=function(_0x1778c9){return client[_0x0d94('0x2')](_0x0d94('0x3'),{'body':_0x1778c9,'log':_0x0d94('0x4')});};
\ No newline at end of file
index a8be3d1..821ae1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e15=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','Request'];(function(_0x49646e,_0x3f45b0){var _0x10ddc1=function(_0x17c6cb){while(--_0x17c6cb){_0x49646e['push'](_0x49646e['shift']());}};_0x10ddc1(++_0x3f45b0);}(_0x7e15,0x1ad));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x57e1('0x0')](_0x57e1('0x1'),{'options':{'raw':![],'attributes':['id',_0x57e1('0x2'),_0x57e1('0x3'),_0x57e1('0x4')],'include':[{'model':_0x57e1('0x5'),'as':_0x57e1('0x6'),'attributes':['id','name',_0x57e1('0x7'),_0x57e1('0x8')]}]},'log':_0x57e1('0x9')});};};
\ No newline at end of file
+var _0x10dc=['getOpenchannelQueues','Request','GetOpenchannelQueue','Agents','name','online','openchannelPause','../client'];(function(_0x287d74,_0x25fb55){var _0x6f15fd=function(_0x49214c){while(--_0x49214c){_0x287d74['push'](_0x287d74['shift']());}};_0x6f15fd(++_0x25fb55);}(_0x10dc,0x13f));var _0xc10d=function(_0x55fa5c,_0x30bd41){_0x55fa5c=_0x55fa5c-0x0;var _0xea802f=_0x10dc[_0x55fa5c];return _0xea802f;};'use strict';var client=require(_0xc10d('0x0'));exports[_0xc10d('0x1')]=function(){return function(){return client[_0xc10d('0x2')](_0xc10d('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0xc10d('0x4'),'attributes':['id',_0xc10d('0x5'),_0xc10d('0x6'),_0xc10d('0x7')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index 00d90f9..e37f050 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8731=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x573a01,_0x25fc37){var _0x3e1ce0=function(_0x2dfa6a){while(--_0x2dfa6a){_0x573a01['push'](_0x573a01['shift']());}};_0x3e1ce0(++_0x25fc37);}(_0x8731,0xcd));var _0x1873=function(_0x466431,_0x377205){_0x466431=_0x466431-0x0;var _0x539709=_0x8731[_0x466431];return _0x539709;};'use strict';var client=require('../client');exports[_0x1873('0x0')]=function(_0x2c0367){return client[_0x1873('0x1')]('CreateOpenchannelQueueReport',{'body':_0x2c0367,'log':_0x1873('0x2')});};exports[_0x1873('0x3')]=function(_0x583403,_0x2dcef5){return client[_0x1873('0x1')](_0x1873('0x4'),{'body':_0x2dcef5,'options':{'where':{'uniqueid':_0x583403},'order':[['id',_0x1873('0x5')]],'limit':0x1},'log':_0x1873('0x4')});};
\ No newline at end of file
+var _0x2d58=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x133443,_0x30d26a){var _0x523d42=function(_0x1b832b){while(--_0x1b832b){_0x133443['push'](_0x133443['shift']());}};_0x523d42(++_0x30d26a);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x82d5('0x0'));exports[_0x82d5('0x1')]=function(_0xf6fe8){return client['Request'](_0x82d5('0x2'),{'body':_0xf6fe8,'log':'CreateOpenchannelQueueReport'});};exports[_0x82d5('0x3')]=function(_0xf0b739,_0x19fd57){return client[_0x82d5('0x4')](_0x82d5('0x5'),{'body':_0x19fd57,'options':{'where':{'uniqueid':_0xf0b739},'order':[['id',_0x82d5('0x6')]],'limit':0x1},'log':_0x82d5('0x5')});};
\ No newline at end of file
index 454bd41..dfffc54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19da=['UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x21e6b2,_0x3f1105){var _0x4d0fc1=function(_0x1d6a3b){while(--_0x1d6a3b){_0x21e6b2['push'](_0x21e6b2['shift']());}};_0x4d0fc1(++_0x3f1105);}(_0x19da,0x9f));var _0xa19d=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0x19da[_0x2440fe];return _0x5cf734;};'use strict';var client=require('../client');exports[_0xa19d('0x0')]=function(_0x57832c,_0x45747d){return client['Request'](_0xa19d('0x1'),{'body':_0x45747d,'options':{'where':{'id':_0x57832c}},'log':_0xa19d('0x2')});};exports['addTags']=function(_0x179db7,_0x28ec9a){return client['Request'](_0xa19d('0x3'),{'body':_0x28ec9a,'options':{'where':{'id':_0x179db7}},'log':_0xa19d('0x4')});};
\ No newline at end of file
+var _0xb1d3=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x79b53e,_0x108f8d){var _0x2d4d6c=function(_0x256d7f){while(--_0x256d7f){_0x79b53e['push'](_0x79b53e['shift']());}};_0x2d4d6c(++_0x108f8d);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x1ac098,_0x43ef78){_0x1ac098=_0x1ac098-0x0;var _0x5de3a3=_0xb1d3[_0x1ac098];return _0x5de3a3;};'use strict';var client=require(_0x3b1d('0x0'));exports['update']=function(_0x499823,_0x593753){return client[_0x3b1d('0x1')](_0x3b1d('0x2'),{'body':_0x593753,'options':{'where':{'id':_0x499823}},'log':_0x3b1d('0x3')});};exports[_0x3b1d('0x4')]=function(_0x5b94ab,_0x18e301){return client[_0x3b1d('0x1')](_0x3b1d('0x5'),{'body':_0x18e301,'options':{'where':{'id':_0x5b94ab}},'log':_0x3b1d('0x6')});};
\ No newline at end of file
index 7610999..5d7ca75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3491=['../client','create','CreateSmsMessage'];(function(_0x25be54,_0x96d64){var _0x4af904=function(_0x4b05e0){while(--_0x4b05e0){_0x25be54['push'](_0x25be54['shift']());}};_0x4af904(++_0x96d64);}(_0x3491,0xe1));var _0x1349=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3491[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x1349('0x0'));exports[_0x1349('0x1')]=function(_0x40df64){return client['Request'](_0x1349('0x2'),{'body':_0x40df64,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x3d6a=['Request','../client'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0x3d6a,0x121));var _0xa3d6=function(_0x2bb0ef,_0x4713e2){_0x2bb0ef=_0x2bb0ef-0x0;var _0x4679cc=_0x3d6a[_0x2bb0ef];return _0x4679cc;};'use strict';var client=require(_0xa3d6('0x0'));exports['create']=function(_0x1318f7){return client[_0xa3d6('0x1')]('CreateSmsMessage',{'body':_0x1318f7,'log':'createSmsMessage'});};
\ No newline at end of file
index cc7ca81..78b4979 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(_0x4068df,_0x1880c6){var _0x47a6b7=function(_0x548cb1){while(--_0x548cb1){_0x4068df['push'](_0x4068df['shift']());}};_0x47a6b7(++_0x1880c6);}(_0x70e0,0x17b));var _0x070e=function(_0x4b9d9d,_0x2f6f0b){_0x4b9d9d=_0x4b9d9d-0x0;var _0x218c03=_0x70e0[_0x4b9d9d];return _0x218c03;};'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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x1e553b,_0x36ea5c){var _0x42c436=function(_0x20dbec){while(--_0x20dbec){_0x1e553b['push'](_0x1e553b['shift']());}};_0x42c436(++_0x36ea5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
index 4e9f9e5..5deb8cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x106daf,_0x570fb6){var _0x2b4a7d=function(_0x57d2a5){while(--_0x57d2a5){_0x106daf['push'](_0x106daf['shift']());}};_0x2b4a7d(++_0x570fb6);}(_0x70e0,0x17b));var _0x070e=function(_0x217245,_0x52341d){_0x217245=_0x217245-0x0;var _0x530738=_0x70e0[_0x217245];return _0x530738;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});};
\ No newline at end of file
+var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0xe6e92f,_0x3f5d01){var _0x38e110=function(_0x16761a){while(--_0x16761a){_0xe6e92f['push'](_0xe6e92f['shift']());}};_0x38e110(++_0x3f5d01);}(_0x55ca,0x126));var _0xa55c=function(_0x4af856,_0x3990fd){_0x4af856=_0x4af856-0x0;var _0xdb6d15=_0x55ca[_0x4af856];return _0xdb6d15;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});};
\ No newline at end of file
index de26184..08dba53 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(_0x11a172,_0x1165ca){var _0x3d8d96=function(_0x456763){while(--_0x456763){_0x11a172['push'](_0x11a172['shift']());}};_0x3d8d96(++_0x1165ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x13ed8a,_0x5120f8){var _0x22cb4b=function(_0x50167a){while(--_0x50167a){_0x13ed8a['push'](_0x13ed8a['shift']());}};_0x22cb4b(++_0x5120f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 aff061f..7a589f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc65=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x2147e3,_0x753c88){_0x2147e3=_0x2147e3-0x0;var _0x525e29=_0xfc65[_0x2147e3];return _0x525e29;};'use strict';var client=require(_0x5fc6('0x0'));exports['update']=function(_0x5807aa,_0x3dd3a9){return client[_0x5fc6('0x1')](_0x5fc6('0x2'),{'body':_0x3dd3a9,'options':{'where':{'id':_0x5807aa}},'log':_0x5fc6('0x3')});};exports[_0x5fc6('0x4')]=function(_0x34b758,_0x22a8ad){return client[_0x5fc6('0x1')](_0x5fc6('0x5'),{'body':_0x22a8ad,'options':{'where':{'id':_0x34b758}},'log':_0x5fc6('0x6')});};
\ No newline at end of file
+var _0xf8af=['Request','UpdateWhatsappInteraction','addTags','../client'];(function(_0x1d58bf,_0x67ab3f){var _0x1a1ad5=function(_0x22c148){while(--_0x22c148){_0x1d58bf['push'](_0x1d58bf['shift']());}};_0x1a1ad5(++_0x67ab3f);}(_0xf8af,0x8b));var _0xff8a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf8af[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xff8a('0x0'));exports['update']=function(_0x873efc,_0x3991a6){return client[_0xff8a('0x1')](_0xff8a('0x2'),{'body':_0x3991a6,'options':{'where':{'id':_0x873efc}},'log':'updateWhatsappInteraction'});};exports[_0xff8a('0x3')]=function(_0x460bf6,_0x11cfa2){return client[_0xff8a('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x11cfa2,'options':{'where':{'id':_0x460bf6}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index 58d74af..6fe8b39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f8c=['createWhatsappMessage','../client','CreateWhatsappMessage'];(function(_0x206711,_0x4125b4){var _0x4fe02b=function(_0x27dc45){while(--_0x27dc45){_0x206711['push'](_0x206711['shift']());}};_0x4fe02b(++_0x4125b4);}(_0x0f8c,0x11b));var _0xc0f8=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0x0f8c[_0x3c487b];return _0x1d65f6;};'use strict';var client=require(_0xc0f8('0x0'));exports['create']=function(_0x28c1ca){return client['Request'](_0xc0f8('0x1'),{'body':_0x28c1ca,'log':_0xc0f8('0x2')});};
\ No newline at end of file
+var _0x4575=['create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x4575,0x158));var _0x5457=function(_0x1716ac,_0x245897){_0x1716ac=_0x1716ac-0x0;var _0xa54aaa=_0x4575[_0x1716ac];return _0xa54aaa;};'use strict';var client=require('../client');exports[_0x5457('0x0')]=function(_0x5e5544){return client[_0x5457('0x1')](_0x5457('0x2'),{'body':_0x5e5544,'log':_0x5457('0x3')});};
\ No newline at end of file
index 76c5640..fc8814d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa420=['../client','getWhatsappQueues','GetWhatsappQueue','strategy','User','Agents','name'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xa420,0x134));var _0x0a42=function(_0x2b3277,_0x242386){_0x2b3277=_0x2b3277-0x0;var _0x1e93e9=_0xa420[_0x2b3277];return _0x1e93e9;};'use strict';var client=require(_0x0a42('0x0'));exports[_0x0a42('0x1')]=function(){return function(){return client['Request'](_0x0a42('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x0a42('0x3')],'include':[{'model':_0x0a42('0x4'),'as':_0x0a42('0x5'),'attributes':['id',_0x0a42('0x6'),'online','whatsappPause']}]},'log':_0x0a42('0x1')});};};
\ No newline at end of file
+var _0x3c19=['../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User','Agents','whatsappPause'];(function(_0x377743,_0x584cab){var _0x30ae30=function(_0x5dde9b){while(--_0x5dde9b){_0x377743['push'](_0x377743['shift']());}};_0x30ae30(++_0x584cab);}(_0x3c19,0x1dd));var _0x93c1=function(_0x42cb25,_0x41c802){_0x42cb25=_0x42cb25-0x0;var _0x10a296=_0x3c19[_0x42cb25];return _0x10a296;};'use strict';var client=require(_0x93c1('0x0'));exports[_0x93c1('0x1')]=function(){return function(){return client['Request'](_0x93c1('0x2'),{'options':{'raw':![],'attributes':['id',_0x93c1('0x3'),_0x93c1('0x4'),_0x93c1('0x5')],'include':[{'model':_0x93c1('0x6'),'as':_0x93c1('0x7'),'attributes':['id','name','online',_0x93c1('0x8')]}]},'log':_0x93c1('0x1')});};};
\ No newline at end of file
index a634e6f..78a5410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x26c999,_0x16af11){var _0x55ca23=function(_0x13e6fc){while(--_0x13e6fc){_0x26c999['push'](_0x26c999['shift']());}};_0x55ca23(++_0x16af11);}(_0xac4a,0x72));var _0xaac4=function(_0x27e2f,_0x8388b8){_0x27e2f=_0x27e2f-0x0;var _0x227aa5=_0xac4a[_0x27e2f];return _0x227aa5;};'use strict';var client=require(_0xaac4('0x0'));exports['create']=function(_0x5321c1){return client[_0xaac4('0x1')]('CreateWhatsappQueueReport',{'body':_0x5321c1,'log':_0xaac4('0x2')});};exports[_0xaac4('0x3')]=function(_0x3a2731,_0x13a7b8){return client[_0xaac4('0x1')](_0xaac4('0x4'),{'body':_0x13a7b8,'options':{'where':{'uniqueid':_0x3a2731},'order':[['id',_0xaac4('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
+var _0xedb4=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','create','Request'];(function(_0x24d91d,_0x371d0d){var _0xaef225=function(_0x2e936b){while(--_0x2e936b){_0x24d91d['push'](_0x24d91d['shift']());}};_0xaef225(++_0x371d0d);}(_0xedb4,0x8f));var _0x4edb=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xedb4[_0xcd5a3d];return _0xd43207;};'use strict';var client=require('../client');exports[_0x4edb('0x0')]=function(_0x5a5f57){return client[_0x4edb('0x1')]('CreateWhatsappQueueReport',{'body':_0x5a5f57,'log':_0x4edb('0x2')});};exports[_0x4edb('0x3')]=function(_0x4afc85,_0x2222f0){return client[_0x4edb('0x1')](_0x4edb('0x4'),{'body':_0x2222f0,'options':{'where':{'uniqueid':_0x4afc85},'order':[['id','DESC']],'limit':0x1},'log':_0x4edb('0x4')});};
\ No newline at end of file
index cfcc64a..badb899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf5=['find','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','[%s][AGENT]\x20%s','message','stop'];(function(_0x37f4d8,_0x4ec257){var _0x10ebd8=function(_0x189b79){while(--_0x189b79){_0x37f4d8['push'](_0x37f4d8['shift']());}};_0x10ebd8(++_0x4ec257);}(_0xacf5,0x128));var _0x5acf=function(_0x2eb0cb,_0x29eaac){_0x2eb0cb=_0x2eb0cb-0x0;var _0x2c5cdb=_0xacf5[_0x2eb0cb];return _0x2c5cdb;};'use strict';var schema=require(_0x5acf('0x0'));var _=require(_0x5acf('0x1'));var util=require(_0x5acf('0x2'));var seqqueue=require(_0x5acf('0x3'));var logger=require(_0x5acf('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x5acf('0x5')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4a75aa,_0x5ee488,_0x3fd928){return logger[_0x5acf('0x6')](util[_0x5acf('0x7')](_0x5acf('0x8'),_0x4a75aa,_0x5ee488['name'],_0x3fd928));}function handleFindAgent(_0x397647){return function(_0xaffeed){return _0xaffeed[_0x5acf('0x9')]['toLowerCase']()===_0x397647[_0x5acf('0xa')]();};}exports['consequence']=function(_0x55c152,_0x2973b8,_0x1ca9f8,_0x201716){return function(_0x5a86a){try{var _0x51ebd8={'name':_0x2973b8[0x0],'timeout':_0x2973b8[0x1]};var _0xe413bf=queue[_0x5acf('0x0')](_0x51ebd8,{'typecast':!![]});if(_0xe413bf['length']){logger['error'](_0x5acf('0xb'),_0x55c152,_['map'](_0xe413bf,_0x5acf('0xc'))['join'](',\x20'));_0x5a86a[_0x5acf('0xd')]();}else{var _0x464a38=_[_0x5acf('0xe')](_0x1ca9f8['agents'],handleFindAgent(_0x51ebd8['name']));if(_0x464a38){var _0x498db9=(_0x51ebd8[_0x5acf('0xf')]||0xa)*0x3e8;var _0x4b3472,_0xca1b7c;var _0x518540=seqqueue[_0x5acf('0x10')](_0x498db9);_0x518540['id']=_0x55c152;_0x518540[_0x5acf('0x11')]=_0x498db9;_0x518540['channel']=_0x201716[_0x5acf('0x12')];writeLog(_0x55c152,_0x464a38,util['format'](_0x5acf('0x13'),_0x498db9));_0x1ca9f8[_0x5acf('0x14')][_0x55c152]['on'](_0x5acf('0x15'),function(){logger[_0x5acf('0x6')](_0x5acf('0x16'),_0x55c152);clearTimeout(_0xca1b7c);_0xca1b7c=undefined;_0x518540[_0x5acf('0x17')]();if(_0x1ca9f8[_0x5acf('0x14')][_0x55c152]){delete _0x1ca9f8[_0x5acf('0x14')][_0x55c152];}_0x5a86a[_0x5acf('0xd')]();});_0x1ca9f8['rules'][_0x55c152]['on'](_0x5acf('0x18'),function(){if(_0x1ca9f8[_0x5acf('0x14')][_0x55c152]){delete _0x1ca9f8[_0x5acf('0x14')][_0x55c152];}});_0xca1b7c=setTimeout(function(){logger[_0x5acf('0x6')](_0x5acf('0x19'),_0x55c152);clearTimeout(_0xca1b7c);_0x518540[_0x5acf('0x17')]();_0x5a86a['next']();},_0x498db9);strategy['agent'](_0x518540,_0x464a38,_0x1ca9f8,_0x201716);}else{logger[_0x5acf('0x1a')](_0x5acf('0x1b'),_0x55c152,_0x51ebd8[_0x5acf('0x9')]);_0x5a86a[_0x5acf('0xd')]();}}}catch(_0x251449){console[_0x5acf('0x1c')](_0x251449);logger['error'](_0x5acf('0x1d'),_0x55c152,_0x251449[_0x5acf('0x1e')]);_0x5a86a[_0x5acf('0xd')]();}};};
\ No newline at end of file
+var _0xac39=['../../../../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','consequence','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue'];(function(_0x337e4d,_0x33e36a){var _0x105746=function(_0x43f627){while(--_0x43f627){_0x337e4d['push'](_0x337e4d['shift']());}};_0x105746(++_0x33e36a);}(_0xac39,0x11c));var _0x9ac3=function(_0x193b5f,_0x3f582d){_0x193b5f=_0x193b5f-0x0;var _0x1d8271=_0xac39[_0x193b5f];return _0x1d8271;};'use strict';var schema=require(_0x9ac3('0x0'));var _=require(_0x9ac3('0x1'));var util=require(_0x9ac3('0x2'));var seqqueue=require(_0x9ac3('0x3'));var logger=require(_0x9ac3('0x4'))(_0x9ac3('0x5'));var strategy=require(_0x9ac3('0x6'));var queue=schema({'name':{'type':_0x9ac3('0x7'),'required':!![],'message':_0x9ac3('0x8')},'timeout':{'type':_0x9ac3('0x9'),'message':_0x9ac3('0xa')}});function writeLog(_0x1fd896,_0x39b115,_0x4285f6){return logger[_0x9ac3('0xb')](util['format'](_0x9ac3('0xc'),_0x1fd896,_0x39b115[_0x9ac3('0xd')],_0x4285f6));}function handleFindAgent(_0x33cff7){return function(_0x323964){return _0x323964['name']['toLowerCase']()===_0x33cff7['toLowerCase']();};}exports[_0x9ac3('0xe')]=function(_0x75a3d1,_0x565546,_0x4c4901,_0x43f688){return function(_0x2c1301){try{var _0x21b0da={'name':_0x565546[0x0],'timeout':_0x565546[0x1]};var _0x5044d1=queue[_0x9ac3('0x0')](_0x21b0da,{'typecast':!![]});if(_0x5044d1['length']){logger[_0x9ac3('0xf')](_0x9ac3('0x10'),_0x75a3d1,_['map'](_0x5044d1,_0x9ac3('0x11'))[_0x9ac3('0x12')](',\x20'));_0x2c1301[_0x9ac3('0x13')]();}else{var _0xb232c9=_[_0x9ac3('0x14')](_0x4c4901[_0x9ac3('0x15')],handleFindAgent(_0x21b0da['name']));if(_0xb232c9){var _0x57df9e=(_0x21b0da[_0x9ac3('0x16')]||0xa)*0x3e8;var _0x57f776,_0x3d6c06;var _0x289760=seqqueue['createQueue'](_0x57df9e);_0x289760['id']=_0x75a3d1;_0x289760['atimeout']=_0x57df9e;_0x289760[_0x9ac3('0x17')]=_0x43f688[_0x9ac3('0x17')];writeLog(_0x75a3d1,_0xb232c9,util[_0x9ac3('0x18')](_0x9ac3('0x19'),_0x57df9e));_0x4c4901[_0x9ac3('0x1a')][_0x75a3d1]['on'](_0x9ac3('0x1b'),function(){logger[_0x9ac3('0xb')](_0x9ac3('0x1c'),_0x75a3d1);clearTimeout(_0x3d6c06);_0x3d6c06=undefined;_0x289760['close']();if(_0x4c4901['rules'][_0x75a3d1]){delete _0x4c4901[_0x9ac3('0x1a')][_0x75a3d1];}_0x2c1301[_0x9ac3('0x13')]();});_0x4c4901['rules'][_0x75a3d1]['on'](_0x9ac3('0x1d'),function(){if(_0x4c4901[_0x9ac3('0x1a')][_0x75a3d1]){delete _0x4c4901[_0x9ac3('0x1a')][_0x75a3d1];}});_0x3d6c06=setTimeout(function(){logger[_0x9ac3('0xb')]('[%s][AGENT]\x20ROUTING\x20END',_0x75a3d1);clearTimeout(_0x3d6c06);_0x289760['close']();_0x2c1301[_0x9ac3('0x1e')]();},_0x57df9e);strategy[_0x9ac3('0x1f')](_0x289760,_0xb232c9,_0x4c4901,_0x43f688);}else{logger[_0x9ac3('0xf')](_0x9ac3('0x20'),_0x75a3d1,_0x21b0da[_0x9ac3('0xd')]);_0x2c1301[_0x9ac3('0x13')]();}}}catch(_0x5778e7){console[_0x9ac3('0x21')](_0x5778e7);logger[_0x9ac3('0xf')](_0x9ac3('0x22'),_0x75a3d1,_0x5778e7[_0x9ac3('0x23')]);_0x2c1301[_0x9ac3('0x13')]();}};};
\ No newline at end of file
index 3b7c571..7f0ed53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdecf=['finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','toString','postText','providerName','amazonlex','providerResponse','Failed','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','InteractionId','created','Message','create','then','body','catch','error','stringify'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0xdecf,0x6d));var _0xfdec=function(_0x2f9f1b,_0x12d225){_0x2f9f1b=_0x2f9f1b-0x0;var _0x359e86=_0xdecf[_0x2f9f1b];return _0x359e86;};'use strict';var _=require(_0xfdec('0x0'));var moment=require('moment');var AWS=require(_0xfdec('0x1'));var utils=require(_0xfdec('0x2'));var logger=require(_0xfdec('0x3'))(_0xfdec('0x4'));var rpc={'chatMessage':require(_0xfdec('0x5')),'openchannelMessage':require(_0xfdec('0x6')),'mailMessage':require(_0xfdec('0x7')),'smsMessage':require(_0xfdec('0x8')),'faxMessage':require(_0xfdec('0x9')),'whatsappMessage':require(_0xfdec('0xa'))};exports[_0xfdec('0xb')]=function(_0x3641e6,_0x524d52){return function(_0x4b37c8){try{if(!_[_0xfdec('0xc')](this[_0xfdec('0xd')][_0xfdec('0xe')])){logger[_0xfdec('0xf')](_0xfdec('0x10'),_0x3641e6,_0xfdec('0x11'));return _0x4b37c8[_0xfdec('0x12')]();}var _0x53528b={'ContactId':this[_0xfdec('0x13')]['id'],'sentAt':moment()[_0xfdec('0x14')](_0xfdec('0x15')),'direction':'out'};if(this[_0xfdec('0x16')]===_0xfdec('0x17')||this[_0xfdec('0x16')]===_0xfdec('0x18')){_0x53528b['phone']=this[_0xfdec('0xd')][_0xfdec('0x19')];}var _0x4c8a4d=this[_0xfdec('0x16')];if(_0x4c8a4d==='chat'){_0x53528b[_0xfdec('0x1a')]=this[_0xfdec('0x1b')]['id'];}else{_0x53528b[_[_0xfdec('0x1c')](_0x4c8a4d)+'AccountId']=this['account']['id'];}_0x53528b[_[_0xfdec('0x1c')](_0x4c8a4d)+_0xfdec('0x1d')]=this[_0xfdec('0xd')]['id'];if(this[_0xfdec('0xd')][_0xfdec('0x1e')]){var _0x4c9fc8=_0x524d52[0x4];if(!_['isEmpty'](_0x4c9fc8)){_0x53528b['body']=utils['getMustacheRender'](_0x4c9fc8,this);return rpc[_0x4c8a4d+_0xfdec('0x1f')][_0xfdec('0x20')](_0x53528b)[_0xfdec('0x21')](function(_0x4d5f60){logger['info'](_0xfdec('0x10'),_0x3641e6,_0x53528b[_0xfdec('0x22')]);})[_0xfdec('0x23')](function(_0x5ca736){logger[_0xfdec('0x24')](_0xfdec('0x10'),_0x3641e6,JSON[_0xfdec('0x25')](_0x5ca736));})[_0xfdec('0x26')](function(){logger[_0xfdec('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3641e6);_0x4b37c8['stop']();});}else{logger['info'](_0xfdec('0x27'),_0x3641e6);_0x4b37c8[_0xfdec('0x28')]();}}else{var _0x41764c=this;var _0x43175a=new AWS[(_0xfdec('0x29'))]({'accessKeyId':_0x524d52[0x0],'secretAccessKey':_0x524d52[0x1],'region':_0x524d52[0x2]});var _0x342129={'botAlias':'$LATEST','botName':_0x524d52[0x3],'inputText':this[_0xfdec('0x2a')][_0xfdec('0x22')],'userId':this[_0xfdec('0x16')]+':'+this[_0xfdec('0xd')]['id'][_0xfdec('0x2b')]()};_0x43175a[_0xfdec('0x2c')](_0x342129,function(_0x12a47c,_0x21c6ab){if(_0x12a47c){logger[_0xfdec('0x24')]('[%s][AMAZONLEX]\x20%s',_0x3641e6,_0x12a47c[_0xfdec('0x2a')]);_0x4b37c8[_0xfdec('0x12')]();}else if(_0x21c6ab&&_0x21c6ab[_0xfdec('0x2a')]){_0x41764c['body']['amazonlex']=_0x21c6ab;_0x53528b[_0xfdec('0x22')]=_0x21c6ab['message'];_0x53528b[_0xfdec('0x2d')]=_0xfdec('0x2e');_0x53528b[_0xfdec('0x2f')]=JSON[_0xfdec('0x25')](_0x21c6ab);return rpc[_0x4c8a4d+'Message'][_0xfdec('0x20')](_0x53528b)[_0xfdec('0x21')](function(_0xe1c654){logger['info'](_0xfdec('0x10'),_0x3641e6,_0x53528b[_0xfdec('0x22')]);if(_0x21c6ab['dialogState']==_0xfdec('0x30')){_0x4b37c8[_0xfdec('0x12')]();}else{_0x4b37c8['stop']();}})['catch'](function(_0x24c1ca){logger['error'](_0xfdec('0x10'),_0x3641e6,JSON[_0xfdec('0x25')](_0x24c1ca));_0x4b37c8[_0xfdec('0x12')]();});}else{_0x4b37c8['next']();}});}}catch(_0xd0bae8){logger[_0xfdec('0x24')](_0xfdec('0x10'),_0x3641e6,JSON[_0xfdec('0x25')](_0xd0bae8));_0x4b37c8['stop']();}};};
\ No newline at end of file
+var _0x44f1=['account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','toString','amazonlex','providerResponse','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','sms','phone','chat','ChatWebsiteId'];(function(_0x33481a,_0x5d4316){var _0x408ab9=function(_0x16762a){while(--_0x16762a){_0x33481a['push'](_0x33481a['shift']());}};_0x408ab9(++_0x5d4316);}(_0x44f1,0xdc));var _0x144f=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x44f1[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var moment=require(_0x144f('0x0'));var AWS=require(_0x144f('0x1'));var utils=require(_0x144f('0x2'));var logger=require(_0x144f('0x3'))(_0x144f('0x4'));var rpc={'chatMessage':require(_0x144f('0x5')),'openchannelMessage':require(_0x144f('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x144f('0x7')),'faxMessage':require(_0x144f('0x8')),'whatsappMessage':require(_0x144f('0x9'))};exports[_0x144f('0xa')]=function(_0xa173e,_0x228b7d){return function(_0x2b966a){try{if(!_[_0x144f('0xb')](this[_0x144f('0xc')][_0x144f('0xd')])){logger[_0x144f('0xe')](_0x144f('0xf'),_0xa173e,_0x144f('0x10'));return _0x2b966a[_0x144f('0x11')]();}var _0x274b43={'ContactId':this[_0x144f('0x12')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x144f('0x13')};if(this[_0x144f('0x14')]===_0x144f('0x15')||this[_0x144f('0x14')]==='whatsapp'){_0x274b43[_0x144f('0x16')]=this[_0x144f('0xc')][_0x144f('0x16')];}var _0x56c891=this[_0x144f('0x14')];if(_0x56c891===_0x144f('0x17')){_0x274b43[_0x144f('0x18')]=this[_0x144f('0x19')]['id'];}else{_0x274b43[_['upperFirst'](_0x56c891)+_0x144f('0x1a')]=this[_0x144f('0x19')]['id'];}_0x274b43[_['upperFirst'](_0x56c891)+_0x144f('0x1b')]=this[_0x144f('0xc')]['id'];if(this[_0x144f('0xc')][_0x144f('0x1c')]){var _0x202e5c=_0x228b7d[0x4];if(!_[_0x144f('0x1d')](_0x202e5c)){_0x274b43[_0x144f('0x1e')]=utils[_0x144f('0x1f')](_0x202e5c,this);return rpc[_0x56c891+_0x144f('0x20')][_0x144f('0x21')](_0x274b43)[_0x144f('0x22')](function(_0x1ce694){logger[_0x144f('0xe')]('[%s][AMAZONLEX]\x20%s',_0xa173e,_0x274b43[_0x144f('0x1e')]);})[_0x144f('0x23')](function(_0x1ab4f8){logger[_0x144f('0x24')](_0x144f('0xf'),_0xa173e,JSON[_0x144f('0x25')](_0x1ab4f8));})[_0x144f('0x26')](function(){logger[_0x144f('0xe')](_0x144f('0x27'),_0xa173e);_0x2b966a['stop']();});}else{logger[_0x144f('0xe')](_0x144f('0x28'),_0xa173e);_0x2b966a[_0x144f('0x29')]();}}else{var _0x1838dc=this;var _0x5db21a=new AWS[(_0x144f('0x2a'))]({'accessKeyId':_0x228b7d[0x0],'secretAccessKey':_0x228b7d[0x1],'region':_0x228b7d[0x2]});var _0x56356e={'botAlias':'$LATEST','botName':_0x228b7d[0x3],'inputText':this[_0x144f('0x2b')][_0x144f('0x1e')],'userId':this[_0x144f('0x14')]+':'+this[_0x144f('0xc')]['id'][_0x144f('0x2c')]()};_0x5db21a['postText'](_0x56356e,function(_0x19f77c,_0x36c77a){if(_0x19f77c){logger[_0x144f('0x24')](_0x144f('0xf'),_0xa173e,_0x19f77c[_0x144f('0x2b')]);_0x2b966a[_0x144f('0x11')]();}else if(_0x36c77a&&_0x36c77a[_0x144f('0x2b')]){_0x1838dc[_0x144f('0x1e')][_0x144f('0x2d')]=_0x36c77a;_0x274b43[_0x144f('0x1e')]=_0x36c77a[_0x144f('0x2b')];_0x274b43['providerName']=_0x144f('0x2d');_0x274b43[_0x144f('0x2e')]=JSON[_0x144f('0x25')](_0x36c77a);return rpc[_0x56c891+'Message']['create'](_0x274b43)[_0x144f('0x22')](function(_0x2d0b55){logger[_0x144f('0xe')]('[%s][AMAZONLEX]\x20%s',_0xa173e,_0x274b43[_0x144f('0x1e')]);if(_0x36c77a[_0x144f('0x2f')]==_0x144f('0x30')){_0x2b966a['next']();}else{_0x2b966a['stop']();}})[_0x144f('0x23')](function(_0x110c35){logger[_0x144f('0x24')](_0x144f('0xf'),_0xa173e,JSON[_0x144f('0x25')](_0x110c35));_0x2b966a[_0x144f('0x11')]();});}else{_0x2b966a['next']();}});}}catch(_0x24538f){logger[_0x144f('0x24')]('[%s][AMAZONLEX]\x20%s',_0xa173e,JSON['stringify'](_0x24538f));_0x2b966a[_0x144f('0x29')]();}};};
\ No newline at end of file
index 856479b..fd53afd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba48=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','mail','message','from','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','lodash','moment','./utils'];(function(_0x41ba41,_0x145412){var _0x22d385=function(_0x571d2a){while(--_0x571d2a){_0x41ba41['push'](_0x41ba41['shift']());}};_0x22d385(++_0x145412);}(_0xba48,0xfd));var _0x8ba4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xba48[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x8ba4('0x0'));var moment=require(_0x8ba4('0x1'));var utils=require(_0x8ba4('0x2'));var logger=require(_0x8ba4('0x3'))(_0x8ba4('0x4'));var rpc={'chatMessage':require(_0x8ba4('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8ba4('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8ba4('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x8ba4('0x8')),'openchannelInteraction':require(_0x8ba4('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x8ba4('0xa')),'faxInteraction':require(_0x8ba4('0xb')),'whatsappInteraction':require(_0x8ba4('0xc'))};var mailRpc=require('../../mailRpc');exports[_0x8ba4('0xd')]=function(_0x4c9e81,_0x584120,_0x1a7e86,_0x2437dd){return function(_0x5933de){try{var _0x74a802=this[_0x8ba4('0xe')];if(_0x74a802==='mail'&&_0x2437dd[_0x8ba4('0xf')][_0x8ba4('0x10')]){logger['info'](_0x8ba4('0x11'),_0x4c9e81,_0x8ba4('0x12'));return _0x5933de[_0x8ba4('0x13')]();}if(_0x584120[0x0]==='1'&&(_['isNil'](this[_0x8ba4('0x14')][_0x8ba4('0x15')])||!this[_0x8ba4('0x14')][_0x8ba4('0x15')])){logger[_0x8ba4('0x16')](_0x8ba4('0x11'),_0x4c9e81,_0x8ba4('0x17'));return _0x5933de['next']();}if(_0x584120[0x0]==='2'&&this[_0x8ba4('0x14')]['autoreplyExecuted']){logger[_0x8ba4('0x16')](_0x8ba4('0x18'),_0x4c9e81,_0x8ba4('0x19'));return _0x5933de[_0x8ba4('0x13')]();}var _0x5c048f={'ContactId':this[_0x8ba4('0x1a')]['id'],'sentAt':moment()[_0x8ba4('0x1b')](_0x8ba4('0x1c')),'direction':'out'};if(this['channel']===_0x8ba4('0x1d')){_0x5c048f['body']=utils['getMustacheRender'](_0x584120[0x2],this);}else{_0x5c048f[_0x8ba4('0xf')]=utils['getMustacheRender'](_0x584120[0x1],this);}if(this['message']){_0x5c048f['to']=this[_0x8ba4('0x1e')][_0x8ba4('0x1f')]||'';if(this[_0x8ba4('0xe')]===_0x8ba4('0x1d')&&_0x584120[0x1]==='1'){_0x5c048f['cc']=this[_0x8ba4('0x1e')]['cc']||'';}_0x5c048f['from']=this[_0x8ba4('0x1e')]['to']||'';_0x5c048f['phone']=this[_0x8ba4('0x1e')]['phone']||'';_0x5c048f[_0x8ba4('0x20')]=!![];if(this[_0x8ba4('0x1e')][_0x8ba4('0x21')]){_0x5c048f[_0x8ba4('0x21')]='';_0x5c048f[_0x8ba4('0x21')]+=_[_0x8ba4('0x22')](this[_0x8ba4('0x1e')][_0x8ba4('0x21')],'Re:')?'':_0x8ba4('0x23');_0x5c048f[_0x8ba4('0x21')]+=this[_0x8ba4('0x1e')][_0x8ba4('0x21')];}}if(this[_0x8ba4('0xe')]===_0x8ba4('0x24')){_0x5c048f[_0x8ba4('0x25')]=this[_0x8ba4('0x26')]['id'];}else{_0x5c048f[_[_0x8ba4('0x27')](this['channel'])+_0x8ba4('0x28')]=this['account']['id'];}_0x5c048f[_[_0x8ba4('0x27')](this['channel'])+'InteractionId']=this[_0x8ba4('0x14')]['id'];var _0x5f4de3=this[_0x8ba4('0x14')];if(rpc[this['channel']+_0x8ba4('0x29')]){if(this[_0x8ba4('0xe')]==='mail'){_0x5c048f[_0x8ba4('0x2a')]=this[_0x8ba4('0x1e')][_0x8ba4('0x2b')];_0x5c048f[_0x8ba4('0x2c')]='<div\x20id=\x22xm-mail-content\x22>'+_['replace'](_0x5c048f['body'],_0x8ba4('0x2d'),'<div')+'</div>';_0x5c048f[_0x8ba4('0x2e')]={'Auto-Submitted':_0x8ba4('0x2f'),'X-Auto-Response-Suppress':_0x8ba4('0x30'),'Precedence':_0x8ba4('0x31')};return mailRpc[_0x8ba4('0x32')](this[_0x8ba4('0x26')][_0x8ba4('0x33')],_0x5c048f)['then'](function(_0x5c393b){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x4c9e81);_0x5c048f[_0x8ba4('0x2b')]=_0x5c393b[_0x8ba4('0x1e')][_0x8ba4('0x2b')];return rpc[_0x74a802+_0x8ba4('0x29')][_0x8ba4('0x34')](_0x5c048f);})[_0x8ba4('0x35')](function(_0x439777){logger[_0x8ba4('0x16')]('[%s][AUTOREPLY]\x20%s',_0x4c9e81,JSON[_0x8ba4('0x36')](_0x439777));})['catch'](function(_0x1893e8){logger[_0x8ba4('0x37')](_0x8ba4('0x38'),_0x4c9e81,JSON[_0x8ba4('0x36')](_0x1893e8));})[_0x8ba4('0x39')](function(){Promise[_0x8ba4('0x3a')]()[_0x8ba4('0x35')](function(){if(_0x584120[0x0]!=='2'||_0x5f4de3[_0x8ba4('0x3b')])return;return rpc[_0x74a802+'Interaction'][_0x8ba4('0x3c')](_0x5f4de3['id'],{'autoreplyExecuted':!![]})[_0x8ba4('0x35')](function(_0x5b0f9e){logger[_0x8ba4('0x16')](_0x8ba4('0x18'),_0x4c9e81,JSON['stringify'](_0x5b0f9e));})[_0x8ba4('0x3d')](function(_0x23a238){logger[_0x8ba4('0x37')](_0x8ba4('0x3e'),_0x4c9e81,JSON['stringify'](_0x23a238));});})[_0x8ba4('0x35')](function(){_0x5933de[_0x8ba4('0x13')]();});});}else{return rpc[this[_0x8ba4('0xe')]+_0x8ba4('0x29')][_0x8ba4('0x34')](_0x5c048f)[_0x8ba4('0x35')](function(){logger['info'](_0x8ba4('0x11'),_0x4c9e81,_0x5c048f['body']);})[_0x8ba4('0x3d')](function(_0x38b55b){logger[_0x8ba4('0x37')](_0x8ba4('0x11'),_0x4c9e81,JSON[_0x8ba4('0x36')](_0x38b55b));})[_0x8ba4('0x39')](function(){Promise['resolve']()[_0x8ba4('0x35')](function(){if(_0x584120[0x0]!=='2'||_0x5f4de3['autoreplyExecuted'])return;return rpc[_0x74a802+_0x8ba4('0x3f')][_0x8ba4('0x3c')](_0x5f4de3['id'],{'autoreplyExecuted':!![]})['then'](function(_0x375323){logger[_0x8ba4('0x16')](_0x8ba4('0x18'),_0x4c9e81,JSON[_0x8ba4('0x36')](_0x375323));})[_0x8ba4('0x3d')](function(_0xcc8240){logger[_0x8ba4('0x37')](_0x8ba4('0x3e'),_0x4c9e81,JSON[_0x8ba4('0x36')](_0xcc8240));});})['then'](function(){_0x5933de[_0x8ba4('0x13')]();});});}}}catch(_0x570f5d){logger['error'](_0x8ba4('0x11'),_0x4c9e81,JSON[_0x8ba4('0x36')](_0x570f5d));_0x5933de['stop']();}};};
\ No newline at end of file
+var _0x774b=['[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','read','subject','startsWith','Re:','chat','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','auto_reply','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted'];(function(_0x47767c,_0x3f8280){var _0x4a0d87=function(_0x51f9c7){while(--_0x51f9c7){_0x47767c['push'](_0x47767c['shift']());}};_0x4a0d87(++_0x3f8280);}(_0x774b,0x6a));var _0xb774=function(_0x5208b0,_0x2a86b6){_0x5208b0=_0x5208b0-0x0;var _0x1020f1=_0x774b[_0x5208b0];return _0x1020f1;};'use strict';var _=require(_0xb774('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0xb774('0x1'))(_0xb774('0x2'));var rpc={'chatMessage':require(_0xb774('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb774('0x4')),'smsMessage':require(_0xb774('0x5')),'faxMessage':require(_0xb774('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xb774('0x7')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xb774('0x8')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xb774('0x9')]=function(_0x22c60f,_0x535af6,_0x52a0fb,_0x5c1a65){return function(_0xc3c55b){try{var _0x5872ef=this['channel'];if(_0x5872ef===_0xb774('0xa')&&_0x5c1a65[_0xb774('0xb')][_0xb774('0xc')]){logger[_0xb774('0xd')](_0xb774('0xe'),_0x22c60f,_0xb774('0xf'));return _0xc3c55b['next']();}if(_0x535af6[0x0]==='1'&&(_[_0xb774('0x10')](this[_0xb774('0x11')]['created'])||!this[_0xb774('0x11')][_0xb774('0x12')])){logger[_0xb774('0xd')](_0xb774('0xe'),_0x22c60f,_0xb774('0x13'));return _0xc3c55b[_0xb774('0x14')]();}if(_0x535af6[0x0]==='2'&&this[_0xb774('0x11')][_0xb774('0x15')]){logger[_0xb774('0xd')](_0xb774('0x16'),_0x22c60f,_0xb774('0x17'));return _0xc3c55b['next']();}var _0x3154bb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xb774('0x18')),'direction':_0xb774('0x19')};if(this[_0xb774('0x1a')]===_0xb774('0xa')){_0x3154bb['body']=utils[_0xb774('0x1b')](_0x535af6[0x2],this);}else{_0x3154bb[_0xb774('0xb')]=utils[_0xb774('0x1b')](_0x535af6[0x1],this);}if(this[_0xb774('0x1c')]){_0x3154bb['to']=this[_0xb774('0x1c')][_0xb774('0x1d')]||'';if(this[_0xb774('0x1a')]===_0xb774('0xa')&&_0x535af6[0x1]==='1'){_0x3154bb['cc']=this['message']['cc']||'';}_0x3154bb[_0xb774('0x1d')]=this[_0xb774('0x1c')]['to']||'';_0x3154bb['phone']=this[_0xb774('0x1c')]['phone']||'';_0x3154bb[_0xb774('0x1e')]=!![];if(this[_0xb774('0x1c')][_0xb774('0x1f')]){_0x3154bb[_0xb774('0x1f')]='';_0x3154bb[_0xb774('0x1f')]+=_[_0xb774('0x20')](this[_0xb774('0x1c')][_0xb774('0x1f')],_0xb774('0x21'))?'':'Re:\x20';_0x3154bb[_0xb774('0x1f')]+=this[_0xb774('0x1c')][_0xb774('0x1f')];}}if(this[_0xb774('0x1a')]===_0xb774('0x22')){_0x3154bb['ChatWebsiteId']=this[_0xb774('0x23')]['id'];}else{_0x3154bb[_[_0xb774('0x24')](this[_0xb774('0x1a')])+_0xb774('0x25')]=this['account']['id'];}_0x3154bb[_[_0xb774('0x24')](this['channel'])+_0xb774('0x26')]=this[_0xb774('0x11')]['id'];var _0x37686f=this[_0xb774('0x11')];if(rpc[this[_0xb774('0x1a')]+_0xb774('0x27')]){if(this['channel']==='mail'){_0x3154bb[_0xb774('0x28')]=this[_0xb774('0x1c')][_0xb774('0x29')];_0x3154bb[_0xb774('0x2a')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0xb774('0x2b')](_0x3154bb[_0xb774('0xb')],_0xb774('0x2c'),_0xb774('0x2d'))+_0xb774('0x2e');_0x3154bb[_0xb774('0x2f')]={'Auto-Submitted':_0xb774('0x30'),'X-Auto-Response-Suppress':_0xb774('0x31'),'Precedence':_0xb774('0x32')};return mailRpc['sendMailMessage'](this[_0xb774('0x23')][_0xb774('0x33')],_0x3154bb)['then'](function(_0x248f94){logger[_0xb774('0xd')](_0xb774('0x34'),_0x22c60f);_0x3154bb[_0xb774('0x29')]=_0x248f94['message']['messageId'];return rpc[_0x5872ef+_0xb774('0x27')]['create'](_0x3154bb);})[_0xb774('0x35')](function(_0x2a7428){logger[_0xb774('0xd')](_0xb774('0xe'),_0x22c60f,JSON[_0xb774('0x36')](_0x2a7428));})[_0xb774('0x37')](function(_0x1f09ab){logger[_0xb774('0x38')](_0xb774('0x39'),_0x22c60f,JSON['stringify'](_0x1f09ab));})[_0xb774('0x3a')](function(){Promise[_0xb774('0x3b')]()[_0xb774('0x35')](function(){if(_0x535af6[0x0]!=='2'||_0x37686f[_0xb774('0x15')])return;return rpc[_0x5872ef+_0xb774('0x3c')][_0xb774('0x3d')](_0x37686f['id'],{'autoreplyExecuted':!![]})['then'](function(_0x42ea07){logger[_0xb774('0xd')](_0xb774('0x16'),_0x22c60f,JSON[_0xb774('0x36')](_0x42ea07));})[_0xb774('0x37')](function(_0x104060){logger[_0xb774('0x38')](_0xb774('0x3e'),_0x22c60f,JSON[_0xb774('0x36')](_0x104060));});})[_0xb774('0x35')](function(){_0xc3c55b['next']();});});}else{return rpc[this[_0xb774('0x1a')]+'Message'][_0xb774('0x3f')](_0x3154bb)[_0xb774('0x35')](function(){logger[_0xb774('0xd')](_0xb774('0xe'),_0x22c60f,_0x3154bb['body']);})[_0xb774('0x37')](function(_0x3e9900){logger['error'](_0xb774('0xe'),_0x22c60f,JSON[_0xb774('0x36')](_0x3e9900));})[_0xb774('0x3a')](function(){Promise[_0xb774('0x3b')]()[_0xb774('0x35')](function(){if(_0x535af6[0x0]!=='2'||_0x37686f[_0xb774('0x15')])return;return rpc[_0x5872ef+_0xb774('0x3c')][_0xb774('0x3d')](_0x37686f['id'],{'autoreplyExecuted':!![]})['then'](function(_0x278177){logger[_0xb774('0xd')](_0xb774('0x16'),_0x22c60f,JSON[_0xb774('0x36')](_0x278177));})[_0xb774('0x37')](function(_0x11ad1a){logger[_0xb774('0x38')](_0xb774('0x3e'),_0x22c60f,JSON['stringify'](_0x11ad1a));});})['then'](function(){_0xc3c55b[_0xb774('0x14')]();});});}}}catch(_0x4c1941){logger[_0xb774('0x38')](_0xb774('0xe'),_0x22c60f,JSON[_0xb774('0x36')](_0x4c1941));_0xc3c55b['stop']();}};};
\ No newline at end of file
index 8368a53..732ad50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd382=['system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x9ef4cf,_0x446ce7){var _0x16aa1d=function(_0x559a9f){while(--_0x559a9f){_0x9ef4cf['push'](_0x9ef4cf['shift']());}};_0x16aa1d(++_0x446ce7);}(_0xd382,0x8f));var _0x2d38=function(_0x8ffb3f,_0x4a4727){_0x8ffb3f=_0x8ffb3f-0x0;var _0x1d57fa=_0xd382[_0x8ffb3f];return _0x1d57fa;};'use strict';var moment=require(_0x2d38('0x0'));var logger=require(_0x2d38('0x1'))(_0x2d38('0x2'));var rpc={'chatInteraction':require(_0x2d38('0x3')),'openchannelInteraction':require(_0x2d38('0x4')),'smsInteraction':require(_0x2d38('0x5')),'mailInteraction':require(_0x2d38('0x6')),'faxInteraction':require(_0x2d38('0x7')),'whatsappInteraction':require(_0x2d38('0x8'))};exports[_0x2d38('0x9')]=function(_0x2e39a3,_0x5513b6,_0x1f2b3f,_0x16d5b3){return function(_0x5d855d){try{logger[_0x2d38('0xa')](_0x2d38('0xb'),_0x2e39a3,_0x5513b6[0x0]);var _0xd3dbd0={'closed':0x1,'closedAt':moment()['format'](_0x2d38('0xc')),'closeReason':_0x2d38('0xd'),'disposition':_0x5513b6[0x0]};if(rpc[_0x16d5b3[_0x2d38('0xe')]+_0x2d38('0xf')]){rpc[_0x16d5b3[_0x2d38('0xe')]+'Interaction'][_0x2d38('0x10')](_0x16d5b3[_0x2d38('0x11')]['id'],_0xd3dbd0)[_0x2d38('0x12')](function(_0x5ca8fd){logger['info'](_0x2d38('0x13'),_0x2e39a3,_0x16d5b3[_0x2d38('0x11')]['id']);})[_0x2d38('0x14')](function(_0x3db728){logger[_0x2d38('0x15')](_0x2d38('0x16'),_0x2e39a3,JSON['stringify'](_0x3db728));})[_0x2d38('0x17')](function(){_0x5d855d['stop']();});}}catch(_0x103049){logger[_0x2d38('0x15')](_0x2d38('0x16'),_0x2e39a3,JSON[_0x2d38('0x18')](_0x103049));_0x5d855d[_0x2d38('0x19')]();}};};
\ No newline at end of file
+var _0x9fba=['[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','catch','error','stringify','finally','stop'];(function(_0x2dd27f,_0x4034a8){var _0x232f58=function(_0x418cef){while(--_0x418cef){_0x2dd27f['push'](_0x2dd27f['shift']());}};_0x232f58(++_0x4034a8);}(_0x9fba,0x13c));var _0xa9fb=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x9fba[_0x2aa0e7];return _0x1472c0;};'use strict';var moment=require(_0xa9fb('0x0'));var logger=require(_0xa9fb('0x1'))(_0xa9fb('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xa9fb('0x3')),'smsInteraction':require(_0xa9fb('0x4')),'mailInteraction':require(_0xa9fb('0x5')),'faxInteraction':require(_0xa9fb('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x4ffc98,_0x2b358d,_0x43fb35,_0x456aa6){return function(_0x12c366){try{logger[_0xa9fb('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x4ffc98,_0x2b358d[0x0]);var _0x1edfdf={'closed':0x1,'closedAt':moment()[_0xa9fb('0x8')](_0xa9fb('0x9')),'closeReason':_0xa9fb('0xa'),'disposition':_0x2b358d[0x0]};if(rpc[_0x456aa6[_0xa9fb('0xb')]+_0xa9fb('0xc')]){rpc[_0x456aa6[_0xa9fb('0xb')]+_0xa9fb('0xc')][_0xa9fb('0xd')](_0x456aa6[_0xa9fb('0xe')]['id'],_0x1edfdf)['then'](function(_0x5357cc){logger[_0xa9fb('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4ffc98,_0x456aa6[_0xa9fb('0xe')]['id']);})[_0xa9fb('0xf')](function(_0x285673){logger[_0xa9fb('0x10')]('[%s][CLOSE]\x20%s',_0x4ffc98,JSON[_0xa9fb('0x11')](_0x285673));})[_0xa9fb('0x12')](function(){_0x12c366[_0xa9fb('0x13')]();});}}catch(_0x3a6097){logger[_0xa9fb('0x10')](_0xa9fb('0x14'),_0x4ffc98,JSON[_0xa9fb('0x11')](_0x3a6097));_0x12c366['stop']();}};};
\ No newline at end of file
index 93a50c9..d9b4a19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9432=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','getMustacheRender','create','catch','stringify','finally','stop','textRequest','body','then','dialogflow','result','speech','providerName','providerResponse','metadata','endConversation','next','error','lodash','moment','md5','./utils','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0x9432,0x1e3));var _0x2943=function(_0x52c62f,_0x523e68){_0x52c62f=_0x52c62f-0x0;var _0x46f249=_0x9432[_0x52c62f];return _0x46f249;};'use strict';var _=require(_0x2943('0x0'));var moment=require(_0x2943('0x1'));var apiai=require('apiai-promise');var md5=require(_0x2943('0x2'));var utils=require(_0x2943('0x3'));var logger=require('../../../../config/logger')(_0x2943('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2943('0x5')),'smsMessage':require(_0x2943('0x6')),'faxMessage':require(_0x2943('0x7')),'whatsappMessage':require(_0x2943('0x8'))};exports[_0x2943('0x9')]=function(_0x56f65f,_0x317fdc){return function(_0x111824){try{if(!_[_0x2943('0xa')](this[_0x2943('0xb')]['UserId'])){logger[_0x2943('0xc')](_0x2943('0xd'),_0x56f65f,_0x2943('0xe'));return _0x111824['next']();}var _0x3a749b={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2943('0xf')](_0x2943('0x10')),'direction':_0x2943('0x11')};if(this[_0x2943('0x12')]===_0x2943('0x13')||this[_0x2943('0x12')]===_0x2943('0x14')){_0x3a749b[_0x2943('0x15')]=this[_0x2943('0xb')][_0x2943('0x15')];}var _0x257936=this[_0x2943('0x12')];if(_0x257936===_0x2943('0x16')){_0x3a749b['ChatWebsiteId']=this[_0x2943('0x17')]['id'];}else{_0x3a749b[_[_0x2943('0x18')](_0x257936)+_0x2943('0x19')]=this[_0x2943('0x17')]['id'];}_0x3a749b[_[_0x2943('0x18')](_0x257936)+_0x2943('0x1a')]=this[_0x2943('0xb')]['id'];if(this['interaction']['created']){var _0x1c7e5c=_0x317fdc[0x2];if(!_['isEmpty'](_0x1c7e5c)){_0x3a749b['body']=utils[_0x2943('0x1b')](_0x1c7e5c,this);return rpc[_0x257936+'Message'][_0x2943('0x1c')](_0x3a749b)['then'](function(_0x1019ab){logger[_0x2943('0xc')](_0x2943('0xd'),_0x56f65f,_0x3a749b['body']);})[_0x2943('0x1d')](function(_0x30c471){logger['error'](_0x2943('0xd'),_0x56f65f,JSON[_0x2943('0x1e')](_0x30c471));})[_0x2943('0x1f')](function(){logger[_0x2943('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x56f65f);_0x111824[_0x2943('0x20')]();});}else{logger[_0x2943('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x56f65f);_0x111824[_0x2943('0x20')]();}}else{var _0x2a17a9=this;var _0x12864c=apiai(_0x317fdc[0x0],{'language':_0x317fdc[0x1]||'en'});return _0x12864c[_0x2943('0x21')](this['message'][_0x2943('0x22')],{'sessionId':md5(this[_0x2943('0xb')]['id'])})[_0x2943('0x23')](function(_0x222946){_0x2a17a9['body'][_0x2943('0x24')]=_0x222946;_0x3a749b['body']=_0x222946[_0x2943('0x25')]['fulfillment'][_0x2943('0x26')];_0x3a749b[_0x2943('0x27')]=_0x2943('0x24');_0x3a749b[_0x2943('0x28')]=JSON[_0x2943('0x1e')](_0x222946);return rpc[_0x257936+'Message'][_0x2943('0x1c')](_0x3a749b)[_0x2943('0x23')](function(_0x2b35a9){logger['info'](_0x2943('0xd'),_0x56f65f,_0x3a749b[_0x2943('0x22')]);if(_0x222946[_0x2943('0x25')][_0x2943('0x29')][_0x2943('0x2a')]){_0x111824[_0x2943('0x2b')]();}else{_0x111824[_0x2943('0x20')]();}})[_0x2943('0x1d')](function(_0x539ad2){logger[_0x2943('0x2c')](_0x2943('0xd'),_0x56f65f,JSON[_0x2943('0x1e')](_0x539ad2));_0x111824[_0x2943('0x2b')]();});})[_0x2943('0x1d')](function(_0xebd9a0){logger[_0x2943('0x2c')](_0x2943('0xd'),_0x56f65f,_0xebd9a0['message']);_0x111824[_0x2943('0x2b')]();});}}catch(_0x2a3ab0){logger[_0x2943('0x2c')](_0x2943('0xd'),_0x56f65f,JSON[_0x2943('0x1e')](_0x2a3ab0));_0x111824[_0x2943('0x20')]();}};};
\ No newline at end of file
+var _0x2d95=['textRequest','message','result','fulfillment','speech','providerName','metadata','endConversation','catch','next','lodash','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','body','Message','create','then','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop'];(function(_0xbc116e,_0x2ea8c6){var _0x1a6f17=function(_0x12872c){while(--_0x12872c){_0xbc116e['push'](_0xbc116e['shift']());}};_0x1a6f17(++_0x2ea8c6);}(_0x2d95,0xca));var _0x52d9=function(_0xd11bdb,_0x5e18bb){_0xd11bdb=_0xd11bdb-0x0;var _0x25bba9=_0x2d95[_0xd11bdb];return _0x25bba9;};'use strict';var _=require(_0x52d9('0x0'));var moment=require('moment');var apiai=require(_0x52d9('0x1'));var md5=require('md5');var utils=require(_0x52d9('0x2'));var logger=require(_0x52d9('0x3'))(_0x52d9('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x52d9('0x5')),'mailMessage':require(_0x52d9('0x6')),'smsMessage':require(_0x52d9('0x7')),'faxMessage':require(_0x52d9('0x8')),'whatsappMessage':require(_0x52d9('0x9'))};exports[_0x52d9('0xa')]=function(_0x3b3202,_0x8fa664){return function(_0x27d7cd){try{if(!_[_0x52d9('0xb')](this[_0x52d9('0xc')][_0x52d9('0xd')])){logger[_0x52d9('0xe')](_0x52d9('0xf'),_0x3b3202,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x27d7cd['next']();}var _0x5a2ec3={'ContactId':this[_0x52d9('0x10')]['id'],'sentAt':moment()[_0x52d9('0x11')](_0x52d9('0x12')),'direction':_0x52d9('0x13')};if(this[_0x52d9('0x14')]==='sms'||this[_0x52d9('0x14')]===_0x52d9('0x15')){_0x5a2ec3[_0x52d9('0x16')]=this[_0x52d9('0xc')]['phone'];}var _0x5856fc=this[_0x52d9('0x14')];if(_0x5856fc===_0x52d9('0x17')){_0x5a2ec3[_0x52d9('0x18')]=this[_0x52d9('0x19')]['id'];}else{_0x5a2ec3[_[_0x52d9('0x1a')](_0x5856fc)+_0x52d9('0x1b')]=this['account']['id'];}_0x5a2ec3[_[_0x52d9('0x1a')](_0x5856fc)+_0x52d9('0x1c')]=this[_0x52d9('0xc')]['id'];if(this[_0x52d9('0xc')]['created']){var _0x305e3b=_0x8fa664[0x2];if(!_['isEmpty'](_0x305e3b)){_0x5a2ec3[_0x52d9('0x1d')]=utils['getMustacheRender'](_0x305e3b,this);return rpc[_0x5856fc+_0x52d9('0x1e')][_0x52d9('0x1f')](_0x5a2ec3)[_0x52d9('0x20')](function(_0x2bb1ae){logger[_0x52d9('0xe')](_0x52d9('0xf'),_0x3b3202,_0x5a2ec3[_0x52d9('0x1d')]);})['catch'](function(_0x1c3c37){logger[_0x52d9('0x21')](_0x52d9('0xf'),_0x3b3202,JSON[_0x52d9('0x22')](_0x1c3c37));})['finally'](function(){logger[_0x52d9('0xe')](_0x52d9('0x23'),_0x3b3202);_0x27d7cd['stop']();});}else{logger[_0x52d9('0xe')](_0x52d9('0x24'),_0x3b3202);_0x27d7cd[_0x52d9('0x25')]();}}else{var _0x5ef1ae=this;var _0x58c57a=apiai(_0x8fa664[0x0],{'language':_0x8fa664[0x1]||'en'});return _0x58c57a[_0x52d9('0x26')](this[_0x52d9('0x27')][_0x52d9('0x1d')],{'sessionId':md5(this[_0x52d9('0xc')]['id'])})[_0x52d9('0x20')](function(_0x3ccff9){_0x5ef1ae['body']['dialogflow']=_0x3ccff9;_0x5a2ec3[_0x52d9('0x1d')]=_0x3ccff9[_0x52d9('0x28')][_0x52d9('0x29')][_0x52d9('0x2a')];_0x5a2ec3[_0x52d9('0x2b')]='dialogflow';_0x5a2ec3['providerResponse']=JSON['stringify'](_0x3ccff9);return rpc[_0x5856fc+'Message'][_0x52d9('0x1f')](_0x5a2ec3)['then'](function(_0x15aa0a){logger['info'](_0x52d9('0xf'),_0x3b3202,_0x5a2ec3['body']);if(_0x3ccff9[_0x52d9('0x28')][_0x52d9('0x2c')][_0x52d9('0x2d')]){_0x27d7cd['next']();}else{_0x27d7cd[_0x52d9('0x25')]();}})[_0x52d9('0x2e')](function(_0x2574e9){logger[_0x52d9('0x21')](_0x52d9('0xf'),_0x3b3202,JSON[_0x52d9('0x22')](_0x2574e9));_0x27d7cd[_0x52d9('0x2f')]();});})[_0x52d9('0x2e')](function(_0x43b8b6){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x3b3202,_0x43b8b6[_0x52d9('0x27')]);_0x27d7cd['next']();});}}catch(_0x342f5f){logger[_0x52d9('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x3b3202,JSON[_0x52d9('0x22')](_0x342f5f));_0x27d7cd[_0x52d9('0x25')]();}};};
\ No newline at end of file
index 90dd302..01b15f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8399=['next','stack','dialogflow','moment','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','create','then','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','info','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','push','all'];(function(_0x9e1992,_0x2336a5){var _0x117d8a=function(_0x3ca5c9){while(--_0x3ca5c9){_0x9e1992['push'](_0x9e1992['shift']());}};_0x117d8a(++_0x2336a5);}(_0x8399,0x19a));var _0x9839=function(_0x4bb7d0,_0x5459bc){_0x4bb7d0=_0x4bb7d0-0x0;var _0x169dab=_0x8399[_0x4bb7d0];return _0x169dab;};'use strict';var _=require('lodash');var dialogflow=require(_0x9839('0x0'));var md5=require('md5');var moment=require(_0x9839('0x1'));var Promise=require(_0x9839('0x2'));var logger=require(_0x9839('0x3'))(_0x9839('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9839('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9839('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x9839('0x7'))};function createMessage(_0x12f6b2,_0x4a050a,_0x1bb054,_0x30b94f){return new Promise(function(_0x248dff,_0xd4c08a){var _0x3aba49=_['clone'](_0x1bb054);_0x3aba49[_0x9839('0x8')]=_0x30b94f;return rpc[_0x4a050a+_0x9839('0x9')][_0x9839('0xa')](_0x3aba49)[_0x9839('0xb')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x12f6b2,_0x3aba49['body']);_0x248dff();})[_0x9839('0xc')](function(_0x4f27d6){logger[_0x9839('0xd')](_0x9839('0xe'),_0x12f6b2,JSON[_0x9839('0xf')](_0x4f27d6));_0xd4c08a(_0x4f27d6);});});}exports[_0x9839('0x10')]=function(_0x3a5697,_0x4e5a59){return function(_0x2426b9){try{if(!_[_0x9839('0x11')](this['interaction']['UserId'])){logger['info'](_0x9839('0xe'),_0x3a5697,_0x9839('0x12'));return _0x2426b9['next']();}var _0x30be99={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9839('0x13')](_0x9839('0x14')),'direction':_0x9839('0x15')};if(this[_0x9839('0x16')]==='sms'||this[_0x9839('0x16')]===_0x9839('0x17')){_0x30be99[_0x9839('0x18')]=this[_0x9839('0x19')][_0x9839('0x18')];}var _0xae1f09=this[_0x9839('0x16')];if(_0xae1f09===_0x9839('0x1a')){_0x30be99[_0x9839('0x1b')]=this[_0x9839('0x1c')]['id'];}else{_0x30be99[_[_0x9839('0x1d')](_0xae1f09)+'AccountId']=this[_0x9839('0x1c')]['id'];}_0x30be99[_['upperFirst'](_0xae1f09)+_0x9839('0x1e')]=this[_0x9839('0x19')]['id'];if(this[_0x9839('0x19')][_0x9839('0x1f')]){var _0x40654e=_0x4e5a59[0x4];if(!_[_0x9839('0x20')](_0x40654e)){_0x30be99['body']=utils[_0x9839('0x21')](_0x40654e,this);return rpc[_0xae1f09+'Message'][_0x9839('0xa')](_0x30be99)[_0x9839('0xb')](function(_0x41d00d){logger[_0x9839('0x22')](_0x9839('0xe'),_0x3a5697,_0x30be99[_0x9839('0x8')]);})[_0x9839('0xc')](function(_0x2ce174){logger[_0x9839('0xd')](_0x9839('0xe'),_0x3a5697,JSON[_0x9839('0xf')](_0x2ce174));})[_0x9839('0x23')](function(){logger[_0x9839('0x22')](_0x9839('0x24'),_0x3a5697);_0x2426b9[_0x9839('0x25')]();});}else{logger[_0x9839('0x22')](_0x9839('0x26'),_0x3a5697);_0x2426b9['stop']();}}else{var _0x25eb4c=this;var _0x9a8695=_0x4e5a59[0x2]['replace'](/\\n/g,'\x0a');var _0xc859b0={'credentials':{'private_key':_0x9a8695,'client_email':_0x4e5a59[0x1]}};var _0x3fc2ee=new dialogflow['SessionsClient'](_0xc859b0);var _0x517de9=_0x3fc2ee[_0x9839('0x27')](_0x4e5a59[0x0],md5(_0x25eb4c['interaction']['id']));var _0x29982d={'session':_0x517de9,'queryInput':{'text':{'text':_0x25eb4c[_0x9839('0x28')][_0x9839('0x8')],'languageCode':_0x4e5a59[0x3]||'en'}}};return _0x3fc2ee['detectIntent'](_0x29982d)[_0x9839('0xb')](function(_0x55d385){if(_0x55d385&&_0x55d385['length']){_0x25eb4c[_0x9839('0x8')][_0x9839('0x29')]=_0x55d385;var _0x1e5cc=_0x55d385[0x0];var _0x57634a=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x2b')]&&_0x1e5cc[_0x9839('0x2a')][_0x9839('0x2b')][_0x9839('0x2c')]?_0x1e5cc[_0x9839('0x2a')][_0x9839('0x2b')][_0x9839('0x2c')][_0x9839('0x2d')][_0x9839('0x2e')]:![];_0x25eb4c[_0x9839('0x8')][_0x9839('0x2f')]=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x30')];_0x25eb4c[_0x9839('0x8')][_0x9839('0x31')]=_0x1e5cc[_0x9839('0x2a')]['allRequiredParamsPresent'];_0x25eb4c[_0x9839('0x8')][_0x9839('0x32')]=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x2b')]&&_0x1e5cc[_0x9839('0x2a')]['diagnosticInfo'][_0x9839('0x2c')]?_0x1e5cc['queryResult']['diagnosticInfo'][_0x9839('0x2c')][_0x9839('0x2d')][_0x9839('0x2e')]:![];_0x25eb4c[_0x9839('0x8')][_0x9839('0x33')]=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x34')][_0x9839('0x35')];_0x25eb4c[_0x9839('0x8')][_0x9839('0x36')]=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x34')][_0x9839('0x37')];_0x25eb4c[_0x9839('0x8')][_0x9839('0x38')]=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x34')]['isFallback'];_0x25eb4c[_0x9839('0x8')][_0x9839('0x39')]=_0x1e5cc[_0x9839('0x2a')][_0x9839('0x3a')];_0x25eb4c['body'][_0x9839('0x3b')]=_0x1e5cc['queryResult']['queryText'];_0x25eb4c[_0x9839('0x8')][_0x9839('0x3c')]=_0x1e5cc['queryResult'][_0x9839('0x3d')];_0x30be99[_0x9839('0x3e')]='dialogflowV2';_0x30be99[_0x9839('0x3f')]=JSON['stringify'](_0x55d385);var _0x3a1689=[];for(var _0x2439dd=0x0;_0x2439dd<_0x55d385['length'];_0x2439dd++){var _0x25ef0d=_0x55d385[_0x2439dd];if(_0x25ef0d&&_0x25ef0d['queryResult']&&_0x25ef0d[_0x9839('0x2a')]['fulfillmentText']){_0x3a1689[_0x9839('0x40')](createMessage(_0x3a5697,_0xae1f09,_0x30be99,_0x25ef0d[_0x9839('0x2a')]['fulfillmentText']));}}return Promise[_0x9839('0x41')](_0x3a1689)[_0x9839('0xb')](function(){if(_0x57634a){_0x2426b9[_0x9839('0x42')]();}else{_0x2426b9[_0x9839('0x25')]();}})[_0x9839('0xc')](function(_0x4b34ce){logger[_0x9839('0xd')](_0x9839('0xe'),_0x3a5697,JSON[_0x9839('0xf')](_0x4b34ce));_0x2426b9[_0x9839('0x42')]();});}})[_0x9839('0xc')](function(_0x54c766){logger['error'](_0x9839('0xe'),_0x3a5697,_0x54c766['message'],_0x54c766[_0x9839('0x43')]);_0x2426b9[_0x9839('0x42')]();});}}catch(_0x39df50){logger[_0x9839('0xd')](_0x9839('0xe'),_0x3a5697,JSON['stringify'](_0x39df50));_0x2426b9[_0x9839('0x25')]();}};};
\ No newline at end of file
+var _0x44dc=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','message','detectIntent','length','dialogflowV2','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','queryResult','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','stack','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils'];(function(_0x4fe5bf,_0x4dc889){var _0x588ca2=function(_0x359610){while(--_0x359610){_0x4fe5bf['push'](_0x4fe5bf['shift']());}};_0x588ca2(++_0x4dc889);}(_0x44dc,0x170));var _0xc44d=function(_0x2db4b2,_0x5a978b){_0x2db4b2=_0x2db4b2-0x0;var _0x1e993b=_0x44dc[_0x2db4b2];return _0x1e993b;};'use strict';var _=require(_0xc44d('0x0'));var dialogflow=require(_0xc44d('0x1'));var md5=require('md5');var moment=require(_0xc44d('0x2'));var Promise=require(_0xc44d('0x3'));var logger=require(_0xc44d('0x4'))(_0xc44d('0x5'));var utils=require(_0xc44d('0x6'));var rpc={'chatMessage':require(_0xc44d('0x7')),'openchannelMessage':require(_0xc44d('0x8')),'mailMessage':require(_0xc44d('0x9')),'smsMessage':require(_0xc44d('0xa')),'faxMessage':require(_0xc44d('0xb')),'whatsappMessage':require(_0xc44d('0xc'))};function createMessage(_0xb93c1e,_0x17fcc0,_0x7ed6bc,_0x226749){return new Promise(function(_0x2ed176,_0xd56b9e){var _0x12ad34=_['clone'](_0x7ed6bc);_0x12ad34[_0xc44d('0xd')]=_0x226749;return rpc[_0x17fcc0+'Message'][_0xc44d('0xe')](_0x12ad34)[_0xc44d('0xf')](function(){logger[_0xc44d('0x10')](_0xc44d('0x11'),_0xb93c1e,_0x12ad34[_0xc44d('0xd')]);_0x2ed176();})['catch'](function(_0x1111c6){logger[_0xc44d('0x12')](_0xc44d('0x11'),_0xb93c1e,JSON[_0xc44d('0x13')](_0x1111c6));_0xd56b9e(_0x1111c6);});});}exports[_0xc44d('0x14')]=function(_0xebb455,_0x263350){return function(_0x17f986){try{if(!_['isNil'](this[_0xc44d('0x15')]['UserId'])){logger[_0xc44d('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xebb455,_0xc44d('0x16'));return _0x17f986[_0xc44d('0x17')]();}var _0xb43a4b={'ContactId':this[_0xc44d('0x18')]['id'],'sentAt':moment()[_0xc44d('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xc44d('0x1a')};if(this[_0xc44d('0x1b')]===_0xc44d('0x1c')||this[_0xc44d('0x1b')]===_0xc44d('0x1d')){_0xb43a4b[_0xc44d('0x1e')]=this[_0xc44d('0x15')][_0xc44d('0x1e')];}var _0x5d7497=this[_0xc44d('0x1b')];if(_0x5d7497==='chat'){_0xb43a4b[_0xc44d('0x1f')]=this['account']['id'];}else{_0xb43a4b[_[_0xc44d('0x20')](_0x5d7497)+'AccountId']=this['account']['id'];}_0xb43a4b[_[_0xc44d('0x20')](_0x5d7497)+_0xc44d('0x21')]=this[_0xc44d('0x15')]['id'];if(this['interaction'][_0xc44d('0x22')]){var _0x320551=_0x263350[0x4];if(!_[_0xc44d('0x23')](_0x320551)){_0xb43a4b[_0xc44d('0xd')]=utils[_0xc44d('0x24')](_0x320551,this);return rpc[_0x5d7497+_0xc44d('0x25')]['create'](_0xb43a4b)[_0xc44d('0xf')](function(_0x49c573){logger[_0xc44d('0x10')](_0xc44d('0x11'),_0xebb455,_0xb43a4b[_0xc44d('0xd')]);})[_0xc44d('0x26')](function(_0x4aa954){logger[_0xc44d('0x12')](_0xc44d('0x11'),_0xebb455,JSON[_0xc44d('0x13')](_0x4aa954));})[_0xc44d('0x27')](function(){logger[_0xc44d('0x10')](_0xc44d('0x28'),_0xebb455);_0x17f986[_0xc44d('0x29')]();});}else{logger[_0xc44d('0x10')](_0xc44d('0x2a'),_0xebb455);_0x17f986[_0xc44d('0x29')]();}}else{var _0x1f2336=this;var _0x23cfa6=_0x263350[0x2][_0xc44d('0x2b')](/\\n/g,'\x0a');var _0x5a4dd8={'credentials':{'private_key':_0x23cfa6,'client_email':_0x263350[0x1]}};var _0x50a3fe=new dialogflow[(_0xc44d('0x2c'))](_0x5a4dd8);var _0x4440e5=_0x50a3fe['sessionPath'](_0x263350[0x0],md5(_0x1f2336['interaction']['id']));var _0x43651d={'session':_0x4440e5,'queryInput':{'text':{'text':_0x1f2336[_0xc44d('0x2d')][_0xc44d('0xd')],'languageCode':_0x263350[0x3]||'en'}}};return _0x50a3fe[_0xc44d('0x2e')](_0x43651d)[_0xc44d('0xf')](function(_0x3167b4){if(_0x3167b4&&_0x3167b4[_0xc44d('0x2f')]){_0x1f2336[_0xc44d('0xd')][_0xc44d('0x30')]=_0x3167b4;var _0x4b6abf=_0x3167b4[0x0];var _0x2b4404=_0x4b6abf['queryResult']['diagnosticInfo']&&_0x4b6abf['queryResult'][_0xc44d('0x31')][_0xc44d('0x32')]?_0x4b6abf['queryResult'][_0xc44d('0x31')][_0xc44d('0x32')][_0xc44d('0x33')]['boolValue']:![];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x34')]=_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x36')];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x37')]=_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x38')];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x39')]=_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x31')]&&_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x31')][_0xc44d('0x32')]?_0x4b6abf[_0xc44d('0x35')]['diagnosticInfo'][_0xc44d('0x32')][_0xc44d('0x33')][_0xc44d('0x3a')]:![];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x3b')]=_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x3c')][_0xc44d('0x3d')];_0x1f2336['body'][_0xc44d('0x3e')]=_0x4b6abf['queryResult'][_0xc44d('0x3c')][_0xc44d('0x3f')];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x40')]=_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x3c')]['isFallback'];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x41')]=_0x4b6abf['queryResult'][_0xc44d('0x42')];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x43')]=_0x4b6abf[_0xc44d('0x35')][_0xc44d('0x44')];_0x1f2336[_0xc44d('0xd')][_0xc44d('0x45')]=_0x4b6abf['queryResult'][_0xc44d('0x46')];_0xb43a4b[_0xc44d('0x47')]=_0xc44d('0x30');_0xb43a4b[_0xc44d('0x48')]=JSON[_0xc44d('0x13')](_0x3167b4);var _0x19f812=[];for(var _0x5f2b9c=0x0;_0x5f2b9c<_0x3167b4['length'];_0x5f2b9c++){var _0x2b0260=_0x3167b4[_0x5f2b9c];if(_0x2b0260&&_0x2b0260[_0xc44d('0x35')]&&_0x2b0260[_0xc44d('0x35')][_0xc44d('0x49')]){_0x19f812['push'](createMessage(_0xebb455,_0x5d7497,_0xb43a4b,_0x2b0260[_0xc44d('0x35')]['fulfillmentText']));}}return Promise['all'](_0x19f812)[_0xc44d('0xf')](function(){if(_0x2b4404){_0x17f986[_0xc44d('0x17')]();}else{_0x17f986[_0xc44d('0x29')]();}})[_0xc44d('0x26')](function(_0x48fedf){logger[_0xc44d('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0xebb455,JSON['stringify'](_0x48fedf));_0x17f986[_0xc44d('0x17')]();});}})[_0xc44d('0x26')](function(_0x3fa044){logger[_0xc44d('0x12')](_0xc44d('0x11'),_0xebb455,_0x3fa044[_0xc44d('0x2d')],_0x3fa044[_0xc44d('0x4a')]);_0x17f986[_0xc44d('0x17')]();});}}catch(_0x1c4fc6){logger['error'](_0xc44d('0x11'),_0xebb455,JSON['stringify'](_0x1c4fc6));_0x17f986[_0xc44d('0x29')]();}};};
\ No newline at end of file
index 9ebed90..3e8604e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x432a=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','message','error','stringify','lodash','html-to-text','./utils','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','replace','length','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x309c8d,_0x1e124a){var _0x299d36=function(_0x5c586d){while(--_0x5c586d){_0x309c8d['push'](_0x309c8d['shift']());}};_0x299d36(++_0x1e124a);}(_0x432a,0x18c));var _0xa432=function(_0x2f1b5a,_0x2c19f0){_0x2f1b5a=_0x2f1b5a-0x0;var _0x3da9cd=_0x432a[_0x2f1b5a];return _0x3da9cd;};'use strict';var schema=require('validate');var _=require(_0xa432('0x0'));var htmlToText=require(_0xa432('0x1'));var utils=require(_0xa432('0x2'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0xa432('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xa432('0x4'),'message':_0xa432('0x5')},'priorityFalse':{'type':'number','message':_0xa432('0x6')}});exports['consequence']=function(_0x3da201,_0x4e1887){return function(_0x5b7eb5){try{var _0x3db02e={'condition':htmlToText[_0xa432('0x7')](utils['getMustacheRender'](_0x4e1887[0x0],this),{'wordwrap':![]})[_0xa432('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4e1887[0x1],'priorityFalse':_0x4e1887[0x2]};var _0x256ed1=gotoif['validate'](_0x3db02e,{'typecast':!![]});if(_0x256ed1[_0xa432('0x9')]){logger['error'](_0xa432('0xa'),_0x3da201,_[_0xa432('0xb')](_0x256ed1,'message')[_0xa432('0xc')](',\x20'));_0x5b7eb5[_0xa432('0xd')]();}else{try{var _0x571e12=eval('('+_0x3db02e[_0xa432('0xe')]+')');var _0x1ec4c3=_0x571e12?_0x3db02e[_0xa432('0xf')]:_0x3db02e['priorityFalse'];logger[_0xa432('0x10')](_0xa432('0x11'),_0x3da201,_0x3db02e[_0xa432('0xe')],_0x571e12,_0x1ec4c3||_0xa432('0x12'));if(_0x1ec4c3){var _0x57e4fa=_[_0xa432('0x13')](_0x5b7eb5[_0xa432('0x14')](),{'p':_0x1ec4c3});if(_0x57e4fa>=0x0){logger[_0xa432('0x10')](_0xa432('0x15'),_0x3da201,_0x1ec4c3||_0xa432('0x12'),_0x57e4fa);_0x5b7eb5[_0xa432('0x12')](_0x57e4fa);}else{logger[_0xa432('0x10')](_0xa432('0x16'),_0x3da201,_0x1ec4c3||_0xa432('0x12'));_0x5b7eb5[_0xa432('0xd')]();}}else{_0x5b7eb5[_0xa432('0x12')]();}}catch(_0xfc4f04){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3da201,_0xfc4f04[_0xa432('0x17')]);_0x5b7eb5['stop']();}}}catch(_0x2a430c){logger[_0xa432('0x18')](_0xa432('0xa'),_0x3da201,JSON[_0xa432('0x19')](_0x2a430c));_0x5b7eb5[_0xa432('0xd')]();}};};
\ No newline at end of file
+var _0xdfbb=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','join','stop','priorityFalse'];(function(_0x4c6f7e,_0xad2dfa){var _0x49ba40=function(_0x33645b){while(--_0x33645b){_0x4c6f7e['push'](_0x4c6f7e['shift']());}};_0x49ba40(++_0xad2dfa);}(_0xdfbb,0x117));var _0xbdfb=function(_0x59b3a5,_0x1264ec){_0x59b3a5=_0x59b3a5-0x0;var _0x10270a=_0xdfbb[_0x59b3a5];return _0x10270a;};'use strict';var schema=require(_0xbdfb('0x0'));var _=require(_0xbdfb('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xbdfb('0x2'));var logger=require(_0xbdfb('0x3'))(_0xbdfb('0x4'));var gotoif=schema({'condition':{'type':_0xbdfb('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xbdfb('0x6'),'message':_0xbdfb('0x7')},'priorityFalse':{'type':_0xbdfb('0x6'),'message':_0xbdfb('0x8')}});exports[_0xbdfb('0x9')]=function(_0xbcd35f,_0x28fafa){return function(_0x4b3d79){try{var _0x884322={'condition':htmlToText[_0xbdfb('0xa')](utils[_0xbdfb('0xb')](_0x28fafa[0x0],this),{'wordwrap':![]})[_0xbdfb('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x28fafa[0x1],'priorityFalse':_0x28fafa[0x2]};var _0x4f6a03=gotoif[_0xbdfb('0x0')](_0x884322,{'typecast':!![]});if(_0x4f6a03[_0xbdfb('0xd')]){logger['error'](_0xbdfb('0xe'),_0xbcd35f,_['map'](_0x4f6a03,'message')[_0xbdfb('0xf')](',\x20'));_0x4b3d79[_0xbdfb('0x10')]();}else{try{var _0xabdf94=eval('('+_0x884322['condition']+')');var _0x2676a1=_0xabdf94?_0x884322['priorityTrue']:_0x884322[_0xbdfb('0x11')];logger[_0xbdfb('0x12')](_0xbdfb('0x13'),_0xbcd35f,_0x884322['condition'],_0xabdf94,_0x2676a1||_0xbdfb('0x14'));if(_0x2676a1){var _0x1d0706=_[_0xbdfb('0x15')](_0x4b3d79['rules'](),{'p':_0x2676a1});if(_0x1d0706>=0x0){logger[_0xbdfb('0x12')](_0xbdfb('0x16'),_0xbcd35f,_0x2676a1||'next',_0x1d0706);_0x4b3d79[_0xbdfb('0x14')](_0x1d0706);}else{logger['info'](_0xbdfb('0x17'),_0xbcd35f,_0x2676a1||_0xbdfb('0x14'));_0x4b3d79[_0xbdfb('0x10')]();}}else{_0x4b3d79[_0xbdfb('0x14')]();}}catch(_0x73d0ab){logger[_0xbdfb('0x18')](_0xbdfb('0x19'),_0xbcd35f,_0x73d0ab['message']);_0x4b3d79[_0xbdfb('0x10')]();}}}catch(_0x3f43ee){logger[_0xbdfb('0x18')]('[%s][GOTOIF]\x20%s',_0xbcd35f,JSON[_0xbdfb('0x1a')](_0x3f43ee));_0x4b3d79['stop']();}};};
\ No newline at end of file
index 2105ca1..c884b18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x320d=['info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','length','error','join','stop'];(function(_0x307fd8,_0x25d8ac){var _0xd3f818=function(_0x2eba75){while(--_0x2eba75){_0x307fd8['push'](_0x307fd8['shift']());}};_0xd3f818(++_0x25d8ac);}(_0x320d,0x1ca));var _0xd320=function(_0x37c061,_0x5932c9){_0x37c061=_0x37c061-0x0;var _0x474066=_0x320d[_0x37c061];return _0x474066;};'use strict';var schema=require(_0xd320('0x0'));var _=require('lodash');var logger=require(_0xd320('0x1'))(_0xd320('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x4dc7f2,_0x30b172){return function(_0x5660b5){try{var _0x3f5f80={'priority':_0x30b172[0x0]};var _0x5c2f79=gotop[_0xd320('0x0')](_0x3f5f80,{'typecast':!![]});if(_0x5c2f79[_0xd320('0x3')]){logger[_0xd320('0x4')]('[%s][GOTOP]\x20%s',_0x4dc7f2,_['map'](_0x5c2f79,'message')[_0xd320('0x5')](',\x20'));_0x5660b5[_0xd320('0x6')]();}else{logger[_0xd320('0x7')]('[%s][GOTOP]\x20priority\x20%s',_0x4dc7f2,_0x3f5f80[_0xd320('0x8')]);if(_0x3f5f80['priority']){var _0x494a5d=_[_0xd320('0x9')](_0x5660b5['rules'](),{'p':_0x3f5f80['priority']});if(_0x494a5d>=0x0){logger[_0xd320('0x7')](_0xd320('0xa'),_0x4dc7f2,_0x3f5f80[_0xd320('0x8')]||_0xd320('0xb'),_0x494a5d);_0x5660b5[_0xd320('0xb')](_0x494a5d);}else{logger[_0xd320('0x7')](_0xd320('0xc'),_0x4dc7f2,_0x3f5f80[_0xd320('0x8')]||_0xd320('0xb'));_0x5660b5[_0xd320('0x6')]();}}else{_0x5660b5['next']();}}}catch(_0x26620f){logger[_0xd320('0x4')](_0xd320('0xd'),_0x4dc7f2,JSON[_0xd320('0xe')](_0x26620f));_0x5660b5[_0xd320('0x6')]();}};};
\ No newline at end of file
+var _0x8a64=['length','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','error','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x8a64,0xa4));var _0x48a6=function(_0x1f41ed,_0x5d084f){_0x1f41ed=_0x1f41ed-0x0;var _0x5ea2a1=_0x8a64[_0x1f41ed];return _0x5ea2a1;};'use strict';var schema=require(_0x48a6('0x0'));var _=require(_0x48a6('0x1'));var logger=require(_0x48a6('0x2'))(_0x48a6('0x3'));var gotop=schema({'priority':{'type':_0x48a6('0x4'),'required':!![],'message':_0x48a6('0x5')}});exports[_0x48a6('0x6')]=function(_0x38d4bf,_0xb6acc){return function(_0x2e5c76){try{var _0x2efb8d={'priority':_0xb6acc[0x0]};var _0x27cb35=gotop[_0x48a6('0x0')](_0x2efb8d,{'typecast':!![]});if(_0x27cb35[_0x48a6('0x7')]){logger['error']('[%s][GOTOP]\x20%s',_0x38d4bf,_['map'](_0x27cb35,_0x48a6('0x8'))[_0x48a6('0x9')](',\x20'));_0x2e5c76[_0x48a6('0xa')]();}else{logger[_0x48a6('0xb')](_0x48a6('0xc'),_0x38d4bf,_0x2efb8d[_0x48a6('0xd')]);if(_0x2efb8d[_0x48a6('0xd')]){var _0x3fe044=_['findIndex'](_0x2e5c76[_0x48a6('0xe')](),{'p':_0x2efb8d[_0x48a6('0xd')]});if(_0x3fe044>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x38d4bf,_0x2efb8d[_0x48a6('0xd')]||'next',_0x3fe044);_0x2e5c76[_0x48a6('0xf')](_0x3fe044);}else{logger[_0x48a6('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x38d4bf,_0x2efb8d[_0x48a6('0xd')]||'next');_0x2e5c76[_0x48a6('0xa')]();}}else{_0x2e5c76[_0x48a6('0xf')]();}}}catch(_0x5608e1){logger[_0x48a6('0x10')](_0x48a6('0x11'),_0x38d4bf,JSON[_0x48a6('0x12')](_0x5608e1));_0x2e5c76[_0x48a6('0xa')]();}};};
\ No newline at end of file
index 697622d..a1cf1c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ae=['stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error'];(function(_0x2cef5f,_0x158b6c){var _0x33aa5e=function(_0xe9471b){while(--_0xe9471b){_0x2cef5f['push'](_0x2cef5f['shift']());}};_0x33aa5e(++_0x158b6c);}(_0x48ae,0xd2));var _0xe48a=function(_0x2e069e,_0x11e579){_0x2e069e=_0x2e069e-0x0;var _0x27afa3=_0x48ae[_0x2e069e];return _0x27afa3;};'use strict';var _=require(_0xe48a('0x0'));var utils=require(_0xe48a('0x1'));var logger=require(_0xe48a('0x2'))(_0xe48a('0x3'));var rpc={'chatMessage':require(_0xe48a('0x4')),'openchannelMessage':require(_0xe48a('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe48a('0x6')),'faxMessage':require(_0xe48a('0x7')),'whatsappMessage':require(_0xe48a('0x8'))};exports['consequence']=function(_0x401642,_0x258166){return function(_0x2a1ea3){try{var _0xc233d9={'body':utils['getMustacheRender'](_0x258166[0x0],this),'ContactId':this['contact']['id']};if(this[_0xe48a('0x9')]===_0xe48a('0xa')){_0xc233d9[_0xe48a('0xb')]=this['account']['id'];}else{_0xc233d9[_[_0xe48a('0xc')](this[_0xe48a('0x9')])+_0xe48a('0xd')]=this['account']['id'];}_0xc233d9[_[_0xe48a('0xc')](this['channel'])+_0xe48a('0xe')]=this[_0xe48a('0xf')]['id'];if(rpc[this['channel']+_0xe48a('0x10')]){return rpc[this[_0xe48a('0x9')]+_0xe48a('0x10')][_0xe48a('0x11')](_0xc233d9)[_0xe48a('0x12')](function(_0x543e76){logger[_0xe48a('0x13')](_0xe48a('0x14'),_0x401642,_0xc233d9['body']);_0x2a1ea3[_0xe48a('0x15')]();})[_0xe48a('0x16')](function(_0x584dc8){logger[_0xe48a('0x17')](_0xe48a('0x14'),_0x401642,JSON[_0xe48a('0x18')](_0x584dc8));_0x2a1ea3[_0xe48a('0x19')]();});}}catch(_0x6bbbe0){logger['error'](_0xe48a('0x14'),_0x401642,JSON[_0xe48a('0x18')](_0x6bbbe0));_0x2a1ea3[_0xe48a('0x19')]();}};};
\ No newline at end of file
+var _0xf394=['stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','[%s][MESSAGE]\x20%s','body','next','error','stringify'];(function(_0x1edd1e,_0xcd5f62){var _0x105b24=function(_0x1c904b){while(--_0x1c904b){_0x1edd1e['push'](_0x1edd1e['shift']());}};_0x105b24(++_0xcd5f62);}(_0xf394,0xa9));var _0x4f39=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf394[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x4f39('0x0'));var utils=require(_0x4f39('0x1'));var logger=require(_0x4f39('0x2'))(_0x4f39('0x3'));var rpc={'chatMessage':require(_0x4f39('0x4')),'openchannelMessage':require(_0x4f39('0x5')),'mailMessage':require(_0x4f39('0x6')),'smsMessage':require(_0x4f39('0x7')),'faxMessage':require(_0x4f39('0x8')),'whatsappMessage':require(_0x4f39('0x9'))};exports[_0x4f39('0xa')]=function(_0x27411d,_0x564deb){return function(_0x39b932){try{var _0xf316a5={'body':utils[_0x4f39('0xb')](_0x564deb[0x0],this),'ContactId':this['contact']['id']};if(this[_0x4f39('0xc')]===_0x4f39('0xd')){_0xf316a5[_0x4f39('0xe')]=this[_0x4f39('0xf')]['id'];}else{_0xf316a5[_[_0x4f39('0x10')](this['channel'])+_0x4f39('0x11')]=this[_0x4f39('0xf')]['id'];}_0xf316a5[_['upperFirst'](this[_0x4f39('0xc')])+_0x4f39('0x12')]=this[_0x4f39('0x13')]['id'];if(rpc[this['channel']+_0x4f39('0x14')]){return rpc[this[_0x4f39('0xc')]+_0x4f39('0x14')][_0x4f39('0x15')](_0xf316a5)['then'](function(_0x3f1456){logger['info'](_0x4f39('0x16'),_0x27411d,_0xf316a5[_0x4f39('0x17')]);_0x39b932[_0x4f39('0x18')]();})['catch'](function(_0x31c6f7){logger[_0x4f39('0x19')](_0x4f39('0x16'),_0x27411d,JSON[_0x4f39('0x1a')](_0x31c6f7));_0x39b932['stop']();});}}catch(_0x22f61e){logger[_0x4f39('0x19')]('[%s][MESSAGE]\x20%s',_0x27411d,JSON[_0x4f39('0x1a')](_0x22f61e));_0x39b932[_0x4f39('0x1b')]();}};};
\ No newline at end of file
index 7e57ff6..ddb9f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4022=['next','error','./utils','../../../../config/logger','routing'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4022,0x16a));var _0x2402=function(_0x28f33e,_0x52f22d){_0x28f33e=_0x28f33e-0x0;var _0x419944=_0x4022[_0x28f33e];return _0x419944;};'use strict';var utils=require(_0x2402('0x0'));var logger=require(_0x2402('0x1'))(_0x2402('0x2'));exports['consequence']=function(_0x24173e,_0x4aac94){return function(_0xddbc9e){try{logger['info']('[%s][NOOP]\x20%s',_0x24173e,utils['getMustacheRender'](_0x4aac94[0x0],this));_0xddbc9e[_0x2402('0x3')]();}catch(_0x4ea67c){logger[_0x2402('0x4')]('[%s][NOOP]\x20%s',_0x24173e,JSON['stringify'](_0x4ea67c));_0xddbc9e['stop']();}};};
\ No newline at end of file
+var _0xfd1b=['stop','./utils','../../../../config/logger','routing','consequence','info','next','error','[%s][NOOP]\x20%s','stringify'];(function(_0x149c7d,_0xa2ee84){var _0x2abdc3=function(_0x52b141){while(--_0x52b141){_0x149c7d['push'](_0x149c7d['shift']());}};_0x2abdc3(++_0xa2ee84);}(_0xfd1b,0xe7));var _0xbfd1=function(_0x120ebd,_0x506076){_0x120ebd=_0x120ebd-0x0;var _0x18083f=_0xfd1b[_0x120ebd];return _0x18083f;};'use strict';var utils=require(_0xbfd1('0x0'));var logger=require(_0xbfd1('0x1'))(_0xbfd1('0x2'));exports[_0xbfd1('0x3')]=function(_0x5a4042,_0x37ed87){return function(_0x4fb59a){try{logger[_0xbfd1('0x4')]('[%s][NOOP]\x20%s',_0x5a4042,utils['getMustacheRender'](_0x37ed87[0x0],this));_0x4fb59a[_0xbfd1('0x5')]();}catch(_0x5c54c3){logger[_0xbfd1('0x6')](_0xbfd1('0x7'),_0x5a4042,JSON[_0xbfd1('0x8')](_0x5c54c3));_0x4fb59a[_0xbfd1('0x9')]();}};};
\ No newline at end of file
index 0f2ddec..4728507 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa157=['validate','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','emit','clone','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','from','contact','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','update\x20queue\x20report','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s'];(function(_0x3342e4,_0x5363a6){var _0x3389bf=function(_0x17ef9c){while(--_0x17ef9c){_0x3342e4['push'](_0x3342e4['shift']());}};_0x3389bf(++_0x5363a6);}(_0xa157,0x128));var _0x7a15=function(_0x2b6e3a,_0x5b53af){_0x2b6e3a=_0x2b6e3a-0x0;var _0x4c2137=_0xa157[_0x2b6e3a];return _0x4c2137;};'use strict';var schema=require(_0x7a15('0x0'));var _=require('lodash');var util=require(_0x7a15('0x1'));var seqqueue=require(_0x7a15('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x7a15('0x3'));var logger=require(_0x7a15('0x4'))(_0x7a15('0x5'));var strategy=require(_0x7a15('0x6'));config[_0x7a15('0x7')]=_[_0x7a15('0x8')](config[_0x7a15('0x7')],{'host':_0x7a15('0x9'),'port':0x18eb});var io=require(_0x7a15('0xa'))(new Redis(config[_0x7a15('0x7')]));var attributes=['id','queue_id',_0x7a15('0xb'),_0x7a15('0xc'),'from','joinAt'];function emit(_0x2fa121,_0x22dad3,_0x308c17){io['to'](_0x2fa121)[_0x7a15('0xd')](_0x22dad3,_0x308c17);}function emitChannelQueueInteraction(_0x5654d6,_0x6fa18,_0xd24ed6,_0x4d6042,_0x5c3328,_0x5e2cff,_0x2aba4a,_0x10546e){var _0x8bfe82=_[_0x7a15('0xe')](_0xd24ed6);_0x8bfe82[_0x7a15('0xf')]=_0x10546e;_0x8bfe82['queue']=_0x6fa18;_0x8bfe82[_0x7a15('0xb')]=_0x4d6042;_0x8bfe82['id']=_0x5c3328;if(_0x5e2cff){attributes[_0x7a15('0x10')](_[_0x7a15('0x11')](_0x5654d6)+_0x7a15('0x12'));_0x2aba4a[util[_0x7a15('0x13')](_0x7a15('0x14'),_0x5654d6)][_0x5c3328]=_[_0x7a15('0x15')](_0x8bfe82,attributes);}else{delete _0x2aba4a[util[_0x7a15('0x13')](_0x7a15('0x14'),_0x5654d6)][_0x5c3328];}emit(util[_0x7a15('0x13')]('%s:queue:%s',_0x5654d6,_0x6fa18),util[_0x7a15('0x13')](_0x7a15('0x16'),_0x5654d6,_0x5e2cff?'save':'remove'),_[_0x7a15('0x15')](_0x8bfe82,attributes));}var rpc={'openchannelQueueReport':require(_0x7a15('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x7a15('0x18')),'faxQueueReport':require(_0x7a15('0x19')),'whatsappQueueReport':require(_0x7a15('0x1a'))};var queue=schema({'name':{'type':_0x7a15('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x7a15('0x1c'),'message':_0x7a15('0x1d')}});function startRouting(_0x4542ef,_0x456ec1,_0xbd00e9,_0x4ebe7e){if(_0x4542ef&&_0x456ec1&&_0xbd00e9){_0x456ec1[_0x7a15('0x1e')]+=0x1;var _0xe5d5f2={'uniqueid':_0x4542ef,'from':_0xbd00e9[_0x7a15('0x1f')]?_0xbd00e9[_0x7a15('0x1f')][_0x7a15('0x20')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xbd00e9[_0x7a15('0x21')]?_0xbd00e9[_0x7a15('0x21')]['id']:null,'ListId':_0xbd00e9['list']?_0xbd00e9['list']['id']:null};_0xe5d5f2[_[_0x7a15('0x22')](_0xbd00e9[_0x7a15('0x23')])+_0x7a15('0x24')]=_0x456ec1['id']||null;_0xe5d5f2[_[_0x7a15('0x22')](_0xbd00e9[_0x7a15('0x23')])+_0x7a15('0x12')]=_0xbd00e9['interaction']?_0xbd00e9[_0x7a15('0x25')]['id']:null;_0xe5d5f2[_[_0x7a15('0x22')](_0xbd00e9[_0x7a15('0x23')])+_0x7a15('0x26')]=_0xbd00e9['message']?_0xbd00e9[_0x7a15('0x27')]['id']:null;_0xe5d5f2[_[_0x7a15('0x22')](_0xbd00e9[_0x7a15('0x23')])+(_0xbd00e9[_0x7a15('0x23')]!==_0x7a15('0x28')?_0x7a15('0x29'):_0x7a15('0x2a'))]=_0xbd00e9['account']?_0xbd00e9[_0x7a15('0xb')]['id']:null;logger[_0x7a15('0x2b')](util[_0x7a15('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x4542ef,_0x456ec1[_0x7a15('0x2c')]));emitChannelQueueInteraction(_0xbd00e9['channel'],_0x456ec1[_0x7a15('0x2c')],_0xe5d5f2,_0xbd00e9['account'][_0x7a15('0x2c')],_0xbd00e9[_0x7a15('0x27')]['id'],!![],_0x4ebe7e,_0x456ec1['id']);if(rpc[_0xbd00e9['channel']+_0x7a15('0x2d')]){return rpc[_0xbd00e9[_0x7a15('0x23')]+_0x7a15('0x2d')]['create'](_0xe5d5f2)[_0x7a15('0x2e')](function(_0x11de19){logger[_0x7a15('0x2f')](_0x7a15('0x30'));});}}}function stopRouting(_0x441d29,_0x3522ac,_0x4d2fd0,_0x286d0d){if(_0x441d29&&_0x3522ac){_0x3522ac[_0x7a15('0x1e')]-=0x1;var _0x16396b={'leaveAt':moment()['format'](_0x7a15('0x31')),'acceptAt':moment()[_0x7a15('0x13')](_0x7a15('0x31')),'reason':_0x7a15('0x32')};logger[_0x7a15('0x2b')](util[_0x7a15('0x13')](_0x7a15('0x33'),_0x441d29,_0x3522ac['name']));emitChannelQueueInteraction(_0x4d2fd0[_0x7a15('0x23')],_0x3522ac[_0x7a15('0x2c')],_0x4d2fd0[_0x7a15('0x1f')],_0x4d2fd0[_0x7a15('0xb')][_0x7a15('0x2c')],_0x4d2fd0[_0x7a15('0x27')]['id'],![],_0x286d0d,_0x3522ac['id']);if(rpc[_0x4d2fd0[_0x7a15('0x23')]+_0x7a15('0x2d')]){return rpc[_0x4d2fd0['channel']+'QueueReport'][_0x7a15('0x34')](_0x441d29,_0x16396b)[_0x7a15('0x2e')](function(_0x275c6c){logger[_0x7a15('0x2f')]('update\x20queue\x20report');});}}}function endRouting(_0x5bd090,_0x55a3b4,_0x2271c1,_0x3aad32){if(_0x5bd090&&_0x55a3b4){_0x55a3b4[_0x7a15('0x1e')]-=0x1;var _0xd8977b={'leaveAt':moment()[_0x7a15('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x7a15('0x31')),'reason':_0x7a15('0x35')};logger[_0x7a15('0x2b')](util[_0x7a15('0x13')]('[%s][END:QUEUE][NAME:%s]',_0x5bd090,_0x55a3b4[_0x7a15('0x2c')]));emitChannelQueueInteraction(_0x2271c1[_0x7a15('0x23')],_0x55a3b4[_0x7a15('0x2c')],_0x2271c1['body'],_0x2271c1[_0x7a15('0xb')][_0x7a15('0x2c')],_0x2271c1[_0x7a15('0x27')]['id'],![],_0x3aad32);if(rpc[_0x2271c1['channel']+_0x7a15('0x2d')]){return rpc[_0x2271c1['channel']+'QueueReport']['update'](_0x5bd090,_0xd8977b)[_0x7a15('0x2e')](function(_0x21770f){logger[_0x7a15('0x2f')](_0x7a15('0x36'));});}}}function handleFindQueue(_0x4871ef){return function(_0xb7c32a){return _0xb7c32a[_0x7a15('0x2c')][_0x7a15('0x37')]()===_0x4871ef[_0x7a15('0x37')]();};}exports['consequence']=function(_0x2e1890,_0x414265,_0x27f482,_0x9c180b){return function(_0x406f6a){try{var _0x2eb59d={'name':_0x414265[0x0],'timeout':_0x414265[0x1]};var _0x14e9f0=queue[_0x7a15('0x0')](_0x2eb59d,{'typecast':!![]});if(_0x14e9f0['length']){logger[_0x7a15('0x2f')](_0x7a15('0x38'),_0x2e1890,_[_0x7a15('0x39')](_0x14e9f0,_0x7a15('0x27'))[_0x7a15('0x3a')](',\x20'));_0x406f6a[_0x7a15('0x3b')]();}else{var _0x6837f3=_[_0x7a15('0x3c')](_0x27f482[_0x9c180b[_0x7a15('0x23')]+'Queues'],handleFindQueue(_0x2eb59d[_0x7a15('0x2c')]));if(_0x6837f3){startRouting(_0x2e1890,_0x6837f3,_0x9c180b,_0x27f482);var _0x45a849=(_0x6837f3[_0x7a15('0x35')]||0xa)*0x3e8;var _0x9f6e4a=(_0x2eb59d[_0x7a15('0x35')]||0x14)*0x3e8;var _0x572371;if(_0x45a849>_0x9f6e4a){_0x9f6e4a=_0x45a849;}var _0x25f27f=seqqueue[_0x7a15('0x3d')](_0x45a849);_0x25f27f['id']=_0x2e1890;_0x25f27f[_0x7a15('0x3e')]=_0x45a849;_0x25f27f[_0x7a15('0x3f')]=_0x9f6e4a;_0x25f27f[_0x7a15('0x23')]=_0x9c180b[_0x7a15('0x23')];_0x27f482[_0x7a15('0x40')][_0x2e1890]['on'](_0x7a15('0x41'),function(){logger[_0x7a15('0x2b')](_0x7a15('0x42'),_0x2e1890);stopRouting(_0x2e1890,_0x6837f3,_0x9c180b,_0x27f482);clearTimeout(_0x572371);_0x572371=undefined;_0x25f27f[_0x7a15('0x43')](!![]);if(_0x27f482[_0x7a15('0x40')][_0x2e1890]){delete _0x27f482[_0x7a15('0x40')][_0x2e1890];}_0x406f6a[_0x7a15('0x3b')]();});_0x27f482[_0x7a15('0x40')][_0x2e1890]['on'](_0x7a15('0x44'),function(){if(_0x27f482[_0x7a15('0x40')][_0x2e1890]){delete _0x27f482[_0x7a15('0x40')][_0x2e1890];}});_0x572371=setTimeout(function(){logger[_0x7a15('0x2b')](_0x7a15('0x45'),_0x2e1890);endRouting(_0x2e1890,_0x6837f3,_0x9c180b,_0x27f482);clearTimeout(_0x572371);_0x25f27f[_0x7a15('0x43')](!![]);_0x406f6a[_0x7a15('0x46')]();},_0x9f6e4a);switch(_0x6837f3['strategy']){case _0x7a15('0x47'):strategy[_0x7a15('0x47')](_0x25f27f,_0x6837f3,_0x27f482,_0x9c180b);break;default:strategy[_0x7a15('0x48')](_0x25f27f,_0x6837f3,_0x27f482,_0x9c180b);}}else{logger['error'](_0x7a15('0x49'),_0x2e1890,_0x2eb59d['name']);_0x406f6a[_0x7a15('0x3b')]();}}}catch(_0x3bf3fc){console['log'](_0x3bf3fc);logger[_0x7a15('0x2f')](_0x7a15('0x38'),_0x2e1890,_0x3bf3fc['stack']);_0x406f6a[_0x7a15('0x3b')]();}};};
\ No newline at end of file
+var _0x265b=['InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','QueueReport','error','accepted','[%s][STOP:QUEUE][NAME:%s]','name','update','catch','toLowerCase','consequence','validate','length','map','join','stop','timeout','createQueue','atimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','queue','joinAt','emit','account','push','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel'];(function(_0x1c47b0,_0x19e61c){var _0x5ae2e3=function(_0x2243ae){while(--_0x2243ae){_0x1c47b0['push'](_0x1c47b0['shift']());}};_0x5ae2e3(++_0x19e61c);}(_0x265b,0x195));var _0xb265=function(_0x1ede59,_0x34bb56){_0x1ede59=_0x1ede59-0x0;var _0x5b5ef3=_0x265b[_0x1ede59];return _0x5b5ef3;};'use strict';var schema=require('validate');var _=require(_0xb265('0x0'));var util=require(_0xb265('0x1'));var seqqueue=require(_0xb265('0x2'));var moment=require(_0xb265('0x3'));var Redis=require(_0xb265('0x4'));var config=require('../../../../config/environment');var logger=require(_0xb265('0x5'))(_0xb265('0x6'));var strategy=require(_0xb265('0x7'));config[_0xb265('0x8')]=_[_0xb265('0x9')](config['redis'],{'host':_0xb265('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xb265('0xb'),'account',_0xb265('0xc'),'from',_0xb265('0xd')];function emit(_0xbf3640,_0xb67900,_0x530858){io['to'](_0xbf3640)[_0xb265('0xe')](_0xb67900,_0x530858);}function emitChannelQueueInteraction(_0x50d0b3,_0x1715ac,_0x1032c2,_0x541485,_0x4466f4,_0xfff540,_0x18d0c1,_0x316fc2){var _0x8b0855=_['clone'](_0x1032c2);_0x8b0855[_0xb265('0xb')]=_0x316fc2;_0x8b0855[_0xb265('0xc')]=_0x1715ac;_0x8b0855[_0xb265('0xf')]=_0x541485;_0x8b0855['id']=_0x4466f4;if(_0xfff540){attributes[_0xb265('0x10')](_[_0xb265('0x11')](_0x50d0b3)+'InteractionId');_0x18d0c1[util[_0xb265('0x12')](_0xb265('0x13'),_0x50d0b3)][_0x4466f4]=_[_0xb265('0x14')](_0x8b0855,attributes);}else{delete _0x18d0c1[util[_0xb265('0x12')]('%sQueuesWaitingInteractions',_0x50d0b3)][_0x4466f4];}emit(util[_0xb265('0x12')](_0xb265('0x15'),_0x50d0b3,_0x1715ac),util[_0xb265('0x12')]('%s_queue_waiting_interaction:%s',_0x50d0b3,_0xfff540?'save':'remove'),_[_0xb265('0x14')](_0x8b0855,attributes));}var rpc={'openchannelQueueReport':require(_0xb265('0x16')),'mailQueueReport':require(_0xb265('0x17')),'chatQueueReport':require(_0xb265('0x18')),'smsQueueReport':require(_0xb265('0x19')),'faxQueueReport':require(_0xb265('0x1a')),'whatsappQueueReport':require(_0xb265('0x1b'))};var queue=schema({'name':{'type':_0xb265('0x1c'),'required':!![],'message':_0xb265('0x1d')},'timeout':{'type':_0xb265('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4dd145,_0x27868c,_0x39f3b8,_0x1c509a){if(_0x4dd145&&_0x27868c&&_0x39f3b8){_0x27868c[_0xb265('0x1f')]+=0x1;var _0xb3c81a={'uniqueid':_0x4dd145,'from':_0x39f3b8[_0xb265('0x20')]?_0x39f3b8['body'][_0xb265('0x21')]:'','joinAt':moment()['format'](_0xb265('0x22')),'ContactId':_0x39f3b8[_0xb265('0x23')]?_0x39f3b8['contact']['id']:null,'ListId':_0x39f3b8[_0xb265('0x24')]?_0x39f3b8[_0xb265('0x24')]['id']:null};_0xb3c81a[_[_0xb265('0x25')](_0x39f3b8[_0xb265('0x26')])+'QueueId']=_0x27868c['id']||null;_0xb3c81a[_['upperFirst'](_0x39f3b8[_0xb265('0x26')])+_0xb265('0x27')]=_0x39f3b8[_0xb265('0x28')]?_0x39f3b8[_0xb265('0x28')]['id']:null;_0xb3c81a[_[_0xb265('0x25')](_0x39f3b8[_0xb265('0x26')])+_0xb265('0x29')]=_0x39f3b8['message']?_0x39f3b8[_0xb265('0x2a')]['id']:null;_0xb3c81a[_[_0xb265('0x25')](_0x39f3b8['channel'])+(_0x39f3b8['channel']!==_0xb265('0x2b')?_0xb265('0x2c'):_0xb265('0x2d'))]=_0x39f3b8[_0xb265('0xf')]?_0x39f3b8[_0xb265('0xf')]['id']:null;logger[_0xb265('0x2e')](util[_0xb265('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x4dd145,_0x27868c['name']));emitChannelQueueInteraction(_0x39f3b8[_0xb265('0x26')],_0x27868c['name'],_0xb3c81a,_0x39f3b8[_0xb265('0xf')]['name'],_0x39f3b8['message']['id'],!![],_0x1c509a,_0x27868c['id']);if(rpc[_0x39f3b8['channel']+_0xb265('0x2f')]){return rpc[_0x39f3b8[_0xb265('0x26')]+_0xb265('0x2f')]['create'](_0xb3c81a)['catch'](function(_0x33900b){logger[_0xb265('0x30')]('create\x20queue\x20report');});}}}function stopRouting(_0x1187cf,_0x20ebbc,_0x5e49db,_0x421ee7){if(_0x1187cf&&_0x20ebbc){_0x20ebbc[_0xb265('0x1f')]-=0x1;var _0x377092={'leaveAt':moment()[_0xb265('0x12')](_0xb265('0x22')),'acceptAt':moment()[_0xb265('0x12')](_0xb265('0x22')),'reason':_0xb265('0x31')};logger[_0xb265('0x2e')](util[_0xb265('0x12')](_0xb265('0x32'),_0x1187cf,_0x20ebbc[_0xb265('0x33')]));emitChannelQueueInteraction(_0x5e49db[_0xb265('0x26')],_0x20ebbc[_0xb265('0x33')],_0x5e49db[_0xb265('0x20')],_0x5e49db[_0xb265('0xf')][_0xb265('0x33')],_0x5e49db[_0xb265('0x2a')]['id'],![],_0x421ee7,_0x20ebbc['id']);if(rpc[_0x5e49db[_0xb265('0x26')]+_0xb265('0x2f')]){return rpc[_0x5e49db[_0xb265('0x26')]+_0xb265('0x2f')][_0xb265('0x34')](_0x1187cf,_0x377092)[_0xb265('0x35')](function(_0x1a8322){logger[_0xb265('0x30')]('update\x20queue\x20report');});}}}function endRouting(_0x4fcd99,_0x3efe0e,_0x2d626e,_0x43530e){if(_0x4fcd99&&_0x3efe0e){_0x3efe0e[_0xb265('0x1f')]-=0x1;var _0x5b30b8={'leaveAt':moment()[_0xb265('0x12')](_0xb265('0x22')),'exitAt':moment()[_0xb265('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util[_0xb265('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x4fcd99,_0x3efe0e[_0xb265('0x33')]));emitChannelQueueInteraction(_0x2d626e[_0xb265('0x26')],_0x3efe0e['name'],_0x2d626e[_0xb265('0x20')],_0x2d626e['account']['name'],_0x2d626e[_0xb265('0x2a')]['id'],![],_0x43530e);if(rpc[_0x2d626e[_0xb265('0x26')]+_0xb265('0x2f')]){return rpc[_0x2d626e['channel']+_0xb265('0x2f')]['update'](_0x4fcd99,_0x5b30b8)[_0xb265('0x35')](function(_0x539693){logger[_0xb265('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x166300){return function(_0x4ad0d5){return _0x4ad0d5[_0xb265('0x33')][_0xb265('0x36')]()===_0x166300[_0xb265('0x36')]();};}exports[_0xb265('0x37')]=function(_0x481f49,_0x4d439e,_0x115a63,_0x43a97a){return function(_0x17a62b){try{var _0x2f9240={'name':_0x4d439e[0x0],'timeout':_0x4d439e[0x1]};var _0x2ce4c5=queue[_0xb265('0x38')](_0x2f9240,{'typecast':!![]});if(_0x2ce4c5[_0xb265('0x39')]){logger[_0xb265('0x30')]('[%s][QUEUE]\x20%s',_0x481f49,_[_0xb265('0x3a')](_0x2ce4c5,_0xb265('0x2a'))[_0xb265('0x3b')](',\x20'));_0x17a62b[_0xb265('0x3c')]();}else{var _0x1c04e4=_['find'](_0x115a63[_0x43a97a['channel']+'Queues'],handleFindQueue(_0x2f9240[_0xb265('0x33')]));if(_0x1c04e4){startRouting(_0x481f49,_0x1c04e4,_0x43a97a,_0x115a63);var _0x3f515a=(_0x1c04e4[_0xb265('0x3d')]||0xa)*0x3e8;var _0x3c2b32=(_0x2f9240[_0xb265('0x3d')]||0x14)*0x3e8;var _0xbe899b;if(_0x3f515a>_0x3c2b32){_0x3c2b32=_0x3f515a;}var _0x36f9d8=seqqueue[_0xb265('0x3e')](_0x3f515a);_0x36f9d8['id']=_0x481f49;_0x36f9d8[_0xb265('0x3f')]=_0x3f515a;_0x36f9d8['qtimeout']=_0x3c2b32;_0x36f9d8[_0xb265('0x26')]=_0x43a97a['channel'];_0x115a63['rules'][_0x481f49]['on']('end',function(){logger[_0xb265('0x2e')](_0xb265('0x40'),_0x481f49);stopRouting(_0x481f49,_0x1c04e4,_0x43a97a,_0x115a63);clearTimeout(_0xbe899b);_0xbe899b=undefined;_0x36f9d8[_0xb265('0x41')](!![]);if(_0x115a63[_0xb265('0x42')][_0x481f49]){delete _0x115a63[_0xb265('0x42')][_0x481f49];}_0x17a62b[_0xb265('0x3c')]();});_0x115a63[_0xb265('0x42')][_0x481f49]['on']('complete',function(){if(_0x115a63[_0xb265('0x42')][_0x481f49]){delete _0x115a63[_0xb265('0x42')][_0x481f49];}});_0xbe899b=setTimeout(function(){logger[_0xb265('0x2e')](_0xb265('0x43'),_0x481f49);endRouting(_0x481f49,_0x1c04e4,_0x43a97a,_0x115a63);clearTimeout(_0xbe899b);_0x36f9d8['close'](!![]);_0x17a62b[_0xb265('0x44')]();},_0x3c2b32);switch(_0x1c04e4[_0xb265('0x45')]){case _0xb265('0x46'):strategy[_0xb265('0x46')](_0x36f9d8,_0x1c04e4,_0x115a63,_0x43a97a);break;default:strategy[_0xb265('0x47')](_0x36f9d8,_0x1c04e4,_0x115a63,_0x43a97a);}}else{logger[_0xb265('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x481f49,_0x2f9240[_0xb265('0x33')]);_0x17a62b['stop']();}}}catch(_0x122479){console['log'](_0x122479);logger[_0xb265('0x30')](_0xb265('0x48'),_0x481f49,_0x122479[_0xb265('0x49')]);_0x17a62b[_0xb265('0x3c')]();}};};
\ No newline at end of file
index 8f9448f..228b7fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busy','busyQueue','saveWaitingNotification','channel','showNotification','writeLog','forcedOwnership',':FORCED','isNil'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14d,0x1ee));var _0xde14=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xe14d[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xde14('0x0'));var uuid=require(_0xde14('0x1'));var util=require(_0xde14('0x2'));var logger=require(_0xde14('0x3'))('routing');var Agent=function(_0x1c5b4,_0x28965b,_0x4b20e2,_0x1c3e94){this[_0xde14('0x4')]=uuid['v4']();this[_0xde14('0x5')]=_0x1c5b4;this[_0xde14('0x6')]=_0x28965b;this[_0xde14('0x7')]=_0x4b20e2;this[_0xde14('0x8')]=_0x1c3e94;this['squeue']['push'](this[_0xde14('0x9')][_0xde14('0xa')](this),this[_0xde14('0xb')][_0xde14('0xa')](this));this[_0xde14('0x5')]['on'](_0xde14('0xc'),this[_0xde14('0xb')][_0xde14('0xa')](this));this['squeue']['on'](_0xde14('0xd'),this[_0xde14('0xe')][_0xde14('0xa')](this));};Agent[_0xde14('0xf')][_0xde14('0x10')]=function(){this[_0xde14('0x5')][_0xde14('0x10')](this[_0xde14('0x9')][_0xde14('0xa')](this),this[_0xde14('0xb')][_0xde14('0xa')](this));};Agent[_0xde14('0xf')][_0xde14('0xe')]=function(){this[_0xde14('0xb')](!![]);};Agent[_0xde14('0xf')]['handleRun']=function(){logger['debug'](_0xde14('0x11'),this[_0xde14('0x5')]['id'],this[_0xde14('0x6')]['id']);if(_['isNil'](this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']])){logger[_0xde14('0x13')](_0xde14('0x14'),this[_0xde14('0x5')]['id'],this[_0xde14('0x6')]['id']);setTimeout(this[_0xde14('0x10')][_0xde14('0xa')](this),0x3e8);}else{if(this[_0xde14('0x8')]['forcedOwnership']||util[_0xde14('0x15')](this[_0xde14('0x5')]['id'],this[_0xde14('0x7')][_0xde14('0x12')][this['agent']['id']],this[_0xde14('0x5')]['channel'],![])){this[_0xde14('0x7')]['agents'][this[_0xde14('0x6')]['id']][_0xde14('0x16')]=!![];this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']][_0xde14('0x17')]=undefined;util[_0xde14('0x18')](this[_0xde14('0x7')],this[_0xde14('0x8')],this[_0xde14('0x6')],this[_0xde14('0x5')][_0xde14('0x19')]);util[_0xde14('0x1a')](this['notificationId'],this[_0xde14('0x5')]['id'],this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']],null,this[_0xde14('0x8')]);util[_0xde14('0x1b')](this[_0xde14('0x5')]['id'],this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']],'RINGING'+(this[_0xde14('0x8')][_0xde14('0x1c')]?_0xde14('0x1d'):''));}else{logger[_0xde14('0x13')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xde14('0x5')]['id'],this[_0xde14('0x6')]['id']);setTimeout(this[_0xde14('0x10')]['bind'](this),0x3e8);}}};Agent[_0xde14('0xf')]['handleTimeout']=function(_0x2760f9){if(_[_0xde14('0x1e')](this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']])){return logger[_0xde14('0x13')](_0xde14('0x14'),this[_0xde14('0x5')]['id'],this['agent']['id']);}else{logger[_0xde14('0x13')](_0xde14('0x1f'),this['squeue']['id'],this[_0xde14('0x6')]['id']);util['hideNotification'](this[_0xde14('0x4')],this[_0xde14('0x5')]['id'],this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']],null,this['routing']);this[_0xde14('0x7')][_0xde14('0x12')][this['agent']['id']][_0xde14('0x16')]=![];this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']][_0xde14('0x17')]=undefined;util[_0xde14('0x20')](this[_0xde14('0x7')],this[_0xde14('0x8')],this[_0xde14('0x6')],this['squeue']['channel']);util[_0xde14('0x1b')](this[_0xde14('0x5')]['id'],this[_0xde14('0x7')][_0xde14('0x12')][this[_0xde14('0x6')]['id']],_0x2760f9?_0xde14('0x21'):_0xde14('0x22'));}if(!_0x2760f9){setTimeout(this[_0xde14('0x10')][_0xde14('0xa')](this),0x3e8);}};function agent(_0x4e33e0,_0x1854d3,_0x48c043,_0x4a363c){return new Agent(_0x4e33e0,_0x1854d3,_0x48c043,_0x4a363c);}module['exports']=agent;
\ No newline at end of file
+var _0x55ca=['handleTimeout','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','lodash','uuid','notificationId','squeue','agent','realtime','routing','handleRun','bind','drained','handleDrained','prototype','push','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busyQueue','saveWaitingNotification','channel','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available'];(function(_0x33e864,_0x2d8439){var _0x1787d7=function(_0x12b679){while(--_0x12b679){_0x33e864['push'](_0x33e864['shift']());}};_0x1787d7(++_0x2d8439);}(_0x55ca,0x126));var _0xa55c=function(_0x409d34,_0x400f1d){_0x409d34=_0x409d34-0x0;var _0x1a38bc=_0x55ca[_0x409d34];return _0x1a38bc;};'use strict';var _=require(_0xa55c('0x0'));var uuid=require(_0xa55c('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x1c6ec3,_0x267ea0,_0x5dc716,_0x3b478a){this[_0xa55c('0x2')]=uuid['v4']();this[_0xa55c('0x3')]=_0x1c6ec3;this[_0xa55c('0x4')]=_0x267ea0;this[_0xa55c('0x5')]=_0x5dc716;this[_0xa55c('0x6')]=_0x3b478a;this[_0xa55c('0x3')]['push'](this[_0xa55c('0x7')][_0xa55c('0x8')](this),this['handleTimeout'][_0xa55c('0x8')](this));this[_0xa55c('0x3')]['on']('timeout',this['handleTimeout'][_0xa55c('0x8')](this));this[_0xa55c('0x3')]['on'](_0xa55c('0x9'),this[_0xa55c('0xa')][_0xa55c('0x8')](this));};Agent[_0xa55c('0xb')][_0xa55c('0xc')]=function(){this[_0xa55c('0x3')][_0xa55c('0xc')](this[_0xa55c('0x7')]['bind'](this),this['handleTimeout'][_0xa55c('0x8')](this));};Agent['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0xa55c('0xb')][_0xa55c('0x7')]=function(){logger[_0xa55c('0xd')](_0xa55c('0xe'),this[_0xa55c('0x3')]['id'],this[_0xa55c('0x4')]['id']);if(_['isNil'](this[_0xa55c('0x5')][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']])){logger[_0xa55c('0xd')](_0xa55c('0x10'),this[_0xa55c('0x3')]['id'],this[_0xa55c('0x4')]['id']);setTimeout(this[_0xa55c('0xc')][_0xa55c('0x8')](this),0x3e8);}else{if(this['routing'][_0xa55c('0x11')]||util[_0xa55c('0x12')](this[_0xa55c('0x3')]['id'],this[_0xa55c('0x5')][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']],this['squeue']['channel'],![])){this[_0xa55c('0x5')][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']]['busy']=!![];this[_0xa55c('0x5')][_0xa55c('0xf')][this['agent']['id']][_0xa55c('0x13')]=undefined;util[_0xa55c('0x14')](this[_0xa55c('0x5')],this[_0xa55c('0x6')],this[_0xa55c('0x4')],this['squeue'][_0xa55c('0x15')]);util['showNotification'](this['notificationId'],this['squeue']['id'],this[_0xa55c('0x5')]['agents'][this[_0xa55c('0x4')]['id']],null,this[_0xa55c('0x6')]);util[_0xa55c('0x16')](this[_0xa55c('0x3')]['id'],this[_0xa55c('0x5')][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']],_0xa55c('0x17')+(this[_0xa55c('0x6')][_0xa55c('0x11')]?_0xa55c('0x18'):''));}else{logger['debug'](_0xa55c('0x19'),this[_0xa55c('0x3')]['id'],this[_0xa55c('0x4')]['id']);setTimeout(this[_0xa55c('0xc')]['bind'](this),0x3e8);}}};Agent[_0xa55c('0xb')][_0xa55c('0x1a')]=function(_0x1b8388){if(_[_0xa55c('0x1b')](this[_0xa55c('0x5')][_0xa55c('0xf')][this['agent']['id']])){return logger[_0xa55c('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xa55c('0x3')]['id'],this[_0xa55c('0x4')]['id']);}else{logger[_0xa55c('0xd')](_0xa55c('0x1c'),this['squeue']['id'],this[_0xa55c('0x4')]['id']);util[_0xa55c('0x1d')](this[_0xa55c('0x2')],this[_0xa55c('0x3')]['id'],this[_0xa55c('0x5')][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']],null,this[_0xa55c('0x6')]);this[_0xa55c('0x5')][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']]['busy']=![];this['realtime'][_0xa55c('0xf')][this[_0xa55c('0x4')]['id']]['busyQueue']=undefined;util[_0xa55c('0x1e')](this[_0xa55c('0x5')],this[_0xa55c('0x6')],this[_0xa55c('0x4')],this[_0xa55c('0x3')][_0xa55c('0x15')]);util[_0xa55c('0x16')](this[_0xa55c('0x3')]['id'],this[_0xa55c('0x5')]['agents'][this['agent']['id']],_0x1b8388?'STOP':_0xa55c('0x1f'));}if(!_0x1b8388){setTimeout(this[_0xa55c('0xc')][_0xa55c('0x8')](this),0x3e8);}};function agent(_0x5802e4,_0x768408,_0x547930,_0x119220){return new Agent(_0x5802e4,_0x768408,_0x547930,_0x119220);}module['exports']=agent;
\ No newline at end of file
index fcfecbb..edab4f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8331=['name','showNotification','debug','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','busyQueue','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','handleTimeout','timeout','drained','prototype','push','handleDrained','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING','busy'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x8331,0xff));var _0x1833=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0x8331[_0x60286b];return _0x5dff69;};'use strict';var _=require(_0x1833('0x0'));var uuid=require('uuid');var util=require(_0x1833('0x1'));var logger=require(_0x1833('0x2'))(_0x1833('0x3'));var Beepall=function(_0x521055,_0x4f8ddc,_0x3d1c4d,_0x34e698){this[_0x1833('0x4')]=uuid['v4']();this[_0x1833('0x5')]=_0x521055;this[_0x1833('0x6')]=_0x4f8ddc;this[_0x1833('0x7')]=_0x3d1c4d;this['routing']=_0x34e698;this[_0x1833('0x5')]['push'](this[_0x1833('0x8')][_0x1833('0x9')](this),this[_0x1833('0xa')][_0x1833('0x9')](this));this[_0x1833('0x5')]['on'](_0x1833('0xb'),this[_0x1833('0xa')][_0x1833('0x9')](this));this[_0x1833('0x5')]['on'](_0x1833('0xc'),this['handleDrained'][_0x1833('0x9')](this));};Beepall[_0x1833('0xd')][_0x1833('0xe')]=function(){this[_0x1833('0x5')][_0x1833('0xe')](this['handleRun'][_0x1833('0x9')](this),this[_0x1833('0xa')][_0x1833('0x9')](this));};Beepall[_0x1833('0xd')][_0x1833('0xf')]=function(){this['handleTimeout'](!![]);};Beepall[_0x1833('0xd')][_0x1833('0x8')]=function(){var _0x251691=!![];if(!_['isNil'](this['queue'])&&!_[_0x1833('0x10')](this[_0x1833('0x6')][_0x1833('0x11')])&&this[_0x1833('0x6')]['Agents']['length']>0x0){for(var _0x1aa1f9=0x0,_0x4c843b;_0x1aa1f9<this['queue'][_0x1833('0x11')][_0x1833('0x12')];_0x1aa1f9+=0x1){_0x4c843b=this[_0x1833('0x6')]['Agents'][_0x1aa1f9]['id'];if(_[_0x1833('0x10')](this[_0x1833('0x7')][_0x1833('0x13')][_0x4c843b])){logger['debug']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1833('0x5')]['id'],_0x4c843b);}else{if(util[_0x1833('0x14')](this[_0x1833('0x5')]['id'],this[_0x1833('0x7')][_0x1833('0x13')][_0x4c843b],this[_0x1833('0x5')][_0x1833('0x15')],!![])){_0x251691=![];util[_0x1833('0x16')](this[_0x1833('0x5')]['id'],this['realtime'][_0x1833('0x13')][_0x4c843b],_0x1833('0x17'));this[_0x1833('0x7')][_0x1833('0x13')][_0x4c843b][_0x1833('0x18')]=!![];this[_0x1833('0x7')][_0x1833('0x13')][_0x4c843b]['busyQueue']=this[_0x1833('0x6')][_0x1833('0x19')];util['saveWaitingNotification'](this['realtime'],this[_0x1833('0x3')],this[_0x1833('0x6')][_0x1833('0x11')][_0x1aa1f9],this['squeue']['channel']);util[_0x1833('0x1a')](this[_0x1833('0x4')],this[_0x1833('0x5')]['id'],this[_0x1833('0x7')][_0x1833('0x13')][_0x4c843b],this[_0x1833('0x6')],this[_0x1833('0x3')]);}}}if(_0x251691){logger[_0x1833('0x1b')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x1833('0x5')]['id']);setTimeout(this[_0x1833('0xe')][_0x1833('0x9')](this),0x3e8);}}else{logger[_0x1833('0x1b')](_0x1833('0x1c'),this[_0x1833('0x5')]['id']);setTimeout(this[_0x1833('0xe')][_0x1833('0x9')](this),0x3e8);}};Beepall[_0x1833('0xd')][_0x1833('0xa')]=function(_0x3ad2f2){if(!_['isNil'](this['queue'])&&!_[_0x1833('0x10')](this[_0x1833('0x6')]['Agents'])){for(var _0x1d6b81=0x0,_0x26adda;_0x1d6b81<this['queue'][_0x1833('0x11')][_0x1833('0x12')];_0x1d6b81+=0x1){_0x26adda=this[_0x1833('0x6')][_0x1833('0x11')][_0x1d6b81]['id'];if(_[_0x1833('0x10')](this['realtime']['agents'][_0x26adda])){logger['debug'](_0x1833('0x1d'),this[_0x1833('0x5')]['id'],_0x26adda);}else{util[_0x1833('0x1e')](this[_0x1833('0x4')],this[_0x1833('0x5')]['id'],this[_0x1833('0x7')][_0x1833('0x13')][_0x26adda],this['queue'],this['routing']);util[_0x1833('0x16')](this[_0x1833('0x5')]['id'],this[_0x1833('0x7')]['agents'][_0x26adda],_0x3ad2f2?_0x1833('0x1f'):'TIMEOUT');this[_0x1833('0x7')][_0x1833('0x13')][_0x26adda][_0x1833('0x18')]=![];this[_0x1833('0x7')]['agents'][_0x26adda][_0x1833('0x20')]=undefined;util[_0x1833('0x21')](this[_0x1833('0x7')],this['routing'],this['realtime'][_0x1833('0x13')][_0x26adda],this[_0x1833('0x5')][_0x1833('0x15')]);}}}if(!_0x3ad2f2){setTimeout(this[_0x1833('0xe')]['bind'](this),0x3e8);}};function beepall(_0x3bff25,_0xd14d17,_0x1f59b0,_0x269ba9){return new Beepall(_0x3bff25,_0xd14d17,_0x1f59b0,_0x269ba9);}module[_0x1833('0x22')]=beepall;
\ No newline at end of file
+var _0x914c=['routing','notificationId','queue','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','busyQueue','removeWaitingNotification','exports','lodash','uuid','./util'];(function(_0x27cb96,_0x4eb42e){var _0x58ceaf=function(_0x3b391d){while(--_0x3b391d){_0x27cb96['push'](_0x27cb96['shift']());}};_0x58ceaf(++_0x4eb42e);}(_0x914c,0xa2));var _0xc914=function(_0x315add,_0x5e9ace){_0x315add=_0x315add-0x0;var _0x40956b=_0x914c[_0x315add];return _0x40956b;};'use strict';var _=require(_0xc914('0x0'));var uuid=require(_0xc914('0x1'));var util=require(_0xc914('0x2'));var logger=require('../../../../../config/logger')(_0xc914('0x3'));var Beepall=function(_0x451eca,_0x24fe0a,_0x502e14,_0x4cf1bc){this[_0xc914('0x4')]=uuid['v4']();this['squeue']=_0x451eca;this[_0xc914('0x5')]=_0x24fe0a;this[_0xc914('0x6')]=_0x502e14;this['routing']=_0x4cf1bc;this[_0xc914('0x7')][_0xc914('0x8')](this[_0xc914('0x9')][_0xc914('0xa')](this),this[_0xc914('0xb')][_0xc914('0xa')](this));this[_0xc914('0x7')]['on'](_0xc914('0xc'),this[_0xc914('0xb')]['bind'](this));this[_0xc914('0x7')]['on'](_0xc914('0xd'),this['handleDrained'][_0xc914('0xa')](this));};Beepall['prototype'][_0xc914('0x8')]=function(){this[_0xc914('0x7')]['push'](this[_0xc914('0x9')][_0xc914('0xa')](this),this[_0xc914('0xb')]['bind'](this));};Beepall[_0xc914('0xe')][_0xc914('0xf')]=function(){this[_0xc914('0xb')](!![]);};Beepall[_0xc914('0xe')][_0xc914('0x9')]=function(){var _0x1be6f2=!![];if(!_[_0xc914('0x10')](this['queue'])&&!_[_0xc914('0x10')](this[_0xc914('0x5')]['Agents'])&&this[_0xc914('0x5')]['Agents']['length']>0x0){for(var _0xa923ee=0x0,_0x5b4dd0;_0xa923ee<this[_0xc914('0x5')][_0xc914('0x11')][_0xc914('0x12')];_0xa923ee+=0x1){_0x5b4dd0=this['queue']['Agents'][_0xa923ee]['id'];if(_['isNil'](this['realtime'][_0xc914('0x13')][_0x5b4dd0])){logger[_0xc914('0x14')](_0xc914('0x15'),this[_0xc914('0x7')]['id'],_0x5b4dd0);}else{if(util[_0xc914('0x16')](this[_0xc914('0x7')]['id'],this[_0xc914('0x6')][_0xc914('0x13')][_0x5b4dd0],this[_0xc914('0x7')][_0xc914('0x17')],!![])){_0x1be6f2=![];util[_0xc914('0x18')](this[_0xc914('0x7')]['id'],this[_0xc914('0x6')][_0xc914('0x13')][_0x5b4dd0],_0xc914('0x19'));this['realtime'][_0xc914('0x13')][_0x5b4dd0][_0xc914('0x1a')]=!![];this[_0xc914('0x6')][_0xc914('0x13')][_0x5b4dd0]['busyQueue']=this['queue']['name'];util['saveWaitingNotification'](this[_0xc914('0x6')],this['routing'],this[_0xc914('0x5')][_0xc914('0x11')][_0xa923ee],this[_0xc914('0x7')][_0xc914('0x17')]);util['showNotification'](this[_0xc914('0x4')],this[_0xc914('0x7')]['id'],this[_0xc914('0x6')][_0xc914('0x13')][_0x5b4dd0],this[_0xc914('0x5')],this[_0xc914('0x3')]);}}}if(_0x1be6f2){logger[_0xc914('0x14')](_0xc914('0x1b'),this['squeue']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}else{logger['debug']('[%s][QUEUE]\x20EMPTY',this[_0xc914('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}};Beepall[_0xc914('0xe')][_0xc914('0xb')]=function(_0x3e6993){if(!_[_0xc914('0x10')](this[_0xc914('0x5')])&&!_[_0xc914('0x10')](this[_0xc914('0x5')][_0xc914('0x11')])){for(var _0x37c59b=0x0,_0x26abbe;_0x37c59b<this[_0xc914('0x5')][_0xc914('0x11')][_0xc914('0x12')];_0x37c59b+=0x1){_0x26abbe=this['queue'][_0xc914('0x11')][_0x37c59b]['id'];if(_[_0xc914('0x10')](this[_0xc914('0x6')][_0xc914('0x13')][_0x26abbe])){logger[_0xc914('0x14')](_0xc914('0x15'),this[_0xc914('0x7')]['id'],_0x26abbe);}else{util[_0xc914('0x1c')](this[_0xc914('0x4')],this[_0xc914('0x7')]['id'],this[_0xc914('0x6')]['agents'][_0x26abbe],this[_0xc914('0x5')],this[_0xc914('0x3')]);util[_0xc914('0x18')](this['squeue']['id'],this['realtime'][_0xc914('0x13')][_0x26abbe],_0x3e6993?'STOP':_0xc914('0x1d'));this[_0xc914('0x6')][_0xc914('0x13')][_0x26abbe][_0xc914('0x1a')]=![];this[_0xc914('0x6')][_0xc914('0x13')][_0x26abbe][_0xc914('0x1e')]=undefined;util[_0xc914('0x1f')](this['realtime'],this[_0xc914('0x3')],this[_0xc914('0x6')]['agents'][_0x26abbe],this[_0xc914('0x7')][_0xc914('0x17')]);}}}if(!_0x3e6993){setTimeout(this[_0xc914('0x8')][_0xc914('0xa')](this),0x3e8);}};function beepall(_0x3c5f7f,_0xf7a8b6,_0x385987,_0x378e2a){return new Beepall(_0x3c5f7f,_0xf7a8b6,_0x385987,_0x378e2a);}module[_0xc914('0x20')]=beepall;
\ No newline at end of file
index 5cc00c1..8a3113d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a2c=['./agent','exports','./rrmemory'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5a2c,0x190));var _0xc5a2=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x5a2c[_0x1064bc];return _0x5edc45;};'use strict';module[_0xc5a2('0x0')]={'rrmemory':require(_0xc5a2('0x1')),'beepall':require('./beepall'),'agent':require(_0xc5a2('0x2'))};
\ No newline at end of file
+var _0x84bf=['./beepall','./agent','./rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84bf,0xfe));var _0xf84b=function(_0x249f0b,_0x48568d){_0x249f0b=_0x249f0b-0x0;var _0x2d7eee=_0x84bf[_0x249f0b];return _0x2d7eee;};'use strict';module['exports']={'rrmemory':require(_0xf84b('0x0')),'beepall':require(_0xf84b('0x1')),'agent':require(_0xf84b('0x2'))};
\ No newline at end of file
index 5105d53..7902fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f9d=['handleCheckReject','debug','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','busyQueue','exports','lodash','uuid','routing','notificationId','squeue','intervals','push','bind','handleTimeout','module','timeout','drained','handleDrained','handleRun','prototype','isAgentAvailable','realtime','agents','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s','done','queue','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','name','saveWaitingNotification','showNotification','writeLog','RINGING'];(function(_0x3dc8e5,_0x57d886){var _0x490a14=function(_0x384188){while(--_0x384188){_0x3dc8e5['push'](_0x3dc8e5['shift']());}};_0x490a14(++_0x57d886);}(_0x2f9d,0x7f));var _0xd2f9=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x2f9d[_0x3b5250];return _0xc844a1;};'use strict';var rr=require('rr');var _=require(_0xd2f9('0x0'));var uuid=require(_0xd2f9('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xd2f9('0x2'));var RRMemory=function(_0x39d46a,_0x4111b9,_0x5d6afc,_0x2c32c8){this[_0xd2f9('0x3')]=uuid['v4']();this[_0xd2f9('0x4')]=_0x39d46a;this['queue']=_0x4111b9;this['realtime']=_0x5d6afc;this[_0xd2f9('0x2')]=_0x2c32c8;this[_0xd2f9('0x5')]={};this[_0xd2f9('0x4')][_0xd2f9('0x6')](this['handleRun'][_0xd2f9('0x7')](this),this[_0xd2f9('0x8')][_0xd2f9('0x7')](this),this[_0xd2f9('0x9')]);this[_0xd2f9('0x4')]['on'](_0xd2f9('0xa'),this[_0xd2f9('0x8')][_0xd2f9('0x7')](this));this[_0xd2f9('0x4')]['on'](_0xd2f9('0xb'),this[_0xd2f9('0xc')]['bind'](this));};RRMemory['prototype'][_0xd2f9('0x6')]=function(){this[_0xd2f9('0x4')][_0xd2f9('0x6')](this[_0xd2f9('0xd')][_0xd2f9('0x7')](this),this[_0xd2f9('0x8')][_0xd2f9('0x7')](this));};RRMemory[_0xd2f9('0xe')][_0xd2f9('0xc')]=function(){this[_0xd2f9('0x8')](!![]);};RRMemory['prototype']['handleCheckReject']=function(_0x2996ec){if(util[_0xd2f9('0xf')](this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]],this[_0xd2f9('0x4')][_0xd2f9('0x13')],!![])){logger['debug'](_0xd2f9('0x14'),this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x12')]);clearInterval(this[_0xd2f9('0x5')][this[_0xd2f9('0x12')]]);_0x2996ec[_0xd2f9('0x15')]();setTimeout(this[_0xd2f9('0x6')][_0xd2f9('0x7')](this),0x3e8);}};RRMemory[_0xd2f9('0xe')][_0xd2f9('0xd')]=function(_0x223785){this[_0xd2f9('0x12')]=rr(this[_0xd2f9('0x16')][_0xd2f9('0x17')]);logger['debug'](_0xd2f9('0x18'),this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x12')]);if(_[_0xd2f9('0x19')](this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]])){logger['debug'](_0xd2f9('0x1a'),this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x12')]);_0x223785['done']();setTimeout(this[_0xd2f9('0x6')][_0xd2f9('0x7')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]],this[_0xd2f9('0x4')][_0xd2f9('0x13')],!![])){this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]][_0xd2f9('0x1b')]=!![];this['realtime'][_0xd2f9('0x11')][this[_0xd2f9('0x12')]]['busyQueue']=this[_0xd2f9('0x16')][_0xd2f9('0x1c')];util[_0xd2f9('0x1d')](this[_0xd2f9('0x10')],this[_0xd2f9('0x2')],this['realtime'][_0xd2f9('0x11')][this[_0xd2f9('0x12')]],this[_0xd2f9('0x4')][_0xd2f9('0x13')]);util[_0xd2f9('0x1e')](this[_0xd2f9('0x3')],this[_0xd2f9('0x4')]['id'],this['realtime'][_0xd2f9('0x11')][this['agentId']],this[_0xd2f9('0x16')],this[_0xd2f9('0x2')]);util[_0xd2f9('0x1f')](this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x10')]['agents'][this[_0xd2f9('0x12')]],_0xd2f9('0x20'));this[_0xd2f9('0x5')][this[_0xd2f9('0x12')]]=setInterval(this[_0xd2f9('0x21')][_0xd2f9('0x7')](this,_0x223785),0x3e8);}else{logger[_0xd2f9('0x22')](_0xd2f9('0x23'),this['squeue']['id'],this[_0xd2f9('0x12')]);_0x223785[_0xd2f9('0x15')]();setTimeout(this[_0xd2f9('0x6')][_0xd2f9('0x7')](this),0x3e8);}}};RRMemory[_0xd2f9('0xe')]['handleTimeout']=function(_0xabaacd){logger[_0xd2f9('0x22')](_0xd2f9('0x24'),this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x12')]);if(_[_0xd2f9('0x19')](this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]])){logger['debug'](_0xd2f9('0x1a'),this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x12')]);}else{clearInterval(this['intervals'][this[_0xd2f9('0x12')]]);util[_0xd2f9('0x25')](this['notificationId'],this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]],this['queue'],this['routing']);util[_0xd2f9('0x1f')](this[_0xd2f9('0x4')]['id'],this[_0xd2f9('0x10')][_0xd2f9('0x11')][this[_0xd2f9('0x12')]],'TIMEOUT');this[_0xd2f9('0x10')][_0xd2f9('0x11')][this['agentId']]['busy']=![];this[_0xd2f9('0x10')]['agents'][this[_0xd2f9('0x12')]][_0xd2f9('0x26')]=undefined;util['removeWaitingNotification'](this[_0xd2f9('0x10')],this['routing'],this['realtime'][_0xd2f9('0x11')][this[_0xd2f9('0x12')]],this[_0xd2f9('0x4')][_0xd2f9('0x13')]);}if(!_0xabaacd){setTimeout(this[_0xd2f9('0x6')][_0xd2f9('0x7')](this),0x3e8);}};function rrmemory(_0xc42f17,_0x5a68db,_0x8a13dc,_0x34c1dc){return new RRMemory(_0xc42f17,_0x5a68db,_0x8a13dc,_0x34c1dc);}module[_0xd2f9('0x27')]=rrmemory;
\ No newline at end of file
+var _0xdab7=['RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','intervals','squeue','push','bind','handleTimeout','module','timeout','drained','handleDrained','prototype','handleRun','handleCheckReject','isAgentAvailable','agentId','channel','debug','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','done','busy','name','saveWaitingNotification','showNotification','writeLog'];(function(_0x307966,_0x320afd){var _0x480544=function(_0x1b0aec){while(--_0x1b0aec){_0x307966['push'](_0x307966['shift']());}};_0x480544(++_0x320afd);}(_0xdab7,0xd9));var _0x7dab=function(_0x54e5f6,_0x2c89ce){_0x54e5f6=_0x54e5f6-0x0;var _0x45a130=_0xdab7[_0x54e5f6];return _0x45a130;};'use strict';var rr=require('rr');var _=require(_0x7dab('0x0'));var uuid=require(_0x7dab('0x1'));var util=require(_0x7dab('0x2'));var logger=require(_0x7dab('0x3'))(_0x7dab('0x4'));var RRMemory=function(_0x482afa,_0x1e230f,_0x435a00,_0x5ae5a0){this[_0x7dab('0x5')]=uuid['v4']();this['squeue']=_0x482afa;this[_0x7dab('0x6')]=_0x1e230f;this[_0x7dab('0x7')]=_0x435a00;this[_0x7dab('0x4')]=_0x5ae5a0;this[_0x7dab('0x8')]={};this[_0x7dab('0x9')][_0x7dab('0xa')](this['handleRun'][_0x7dab('0xb')](this),this[_0x7dab('0xc')]['bind'](this),this[_0x7dab('0xd')]);this[_0x7dab('0x9')]['on'](_0x7dab('0xe'),this[_0x7dab('0xc')][_0x7dab('0xb')](this));this['squeue']['on'](_0x7dab('0xf'),this[_0x7dab('0x10')][_0x7dab('0xb')](this));};RRMemory[_0x7dab('0x11')][_0x7dab('0xa')]=function(){this['squeue'][_0x7dab('0xa')](this[_0x7dab('0x12')][_0x7dab('0xb')](this),this[_0x7dab('0xc')]['bind'](this));};RRMemory[_0x7dab('0x11')]['handleDrained']=function(){this[_0x7dab('0xc')](!![]);};RRMemory[_0x7dab('0x11')][_0x7dab('0x13')]=function(_0x3a3c73){if(util[_0x7dab('0x14')](this[_0x7dab('0x9')]['id'],this['realtime']['agents'][this[_0x7dab('0x15')]],this[_0x7dab('0x9')][_0x7dab('0x16')],!![])){logger[_0x7dab('0x17')]('[%s][QUEUE]\x20available\x20again\x20%s',this[_0x7dab('0x9')]['id'],this[_0x7dab('0x15')]);clearInterval(this[_0x7dab('0x8')][this[_0x7dab('0x15')]]);_0x3a3c73['done']();setTimeout(this[_0x7dab('0xa')][_0x7dab('0xb')](this),0x3e8);}};RRMemory[_0x7dab('0x11')]['handleRun']=function(_0x3cbb5d){this[_0x7dab('0x15')]=rr(this[_0x7dab('0x6')][_0x7dab('0x18')]);logger['debug'](_0x7dab('0x19'),this[_0x7dab('0x9')]['id'],this[_0x7dab('0x15')]);if(_[_0x7dab('0x1a')](this[_0x7dab('0x7')][_0x7dab('0x1b')][this[_0x7dab('0x15')]])){logger[_0x7dab('0x17')](_0x7dab('0x1c'),this['squeue']['id'],this['agentId']);_0x3cbb5d[_0x7dab('0x1d')]();setTimeout(this['push']['bind'](this),0x3e8);}else{if(util[_0x7dab('0x14')](this[_0x7dab('0x9')]['id'],this[_0x7dab('0x7')][_0x7dab('0x1b')][this[_0x7dab('0x15')]],this[_0x7dab('0x9')][_0x7dab('0x16')],!![])){this[_0x7dab('0x7')][_0x7dab('0x1b')][this[_0x7dab('0x15')]][_0x7dab('0x1e')]=!![];this['realtime']['agents'][this[_0x7dab('0x15')]]['busyQueue']=this['queue'][_0x7dab('0x1f')];util[_0x7dab('0x20')](this[_0x7dab('0x7')],this[_0x7dab('0x4')],this[_0x7dab('0x7')][_0x7dab('0x1b')][this['agentId']],this[_0x7dab('0x9')][_0x7dab('0x16')]);util[_0x7dab('0x21')](this[_0x7dab('0x5')],this[_0x7dab('0x9')]['id'],this[_0x7dab('0x7')]['agents'][this['agentId']],this['queue'],this[_0x7dab('0x4')]);util[_0x7dab('0x22')](this['squeue']['id'],this['realtime'][_0x7dab('0x1b')][this[_0x7dab('0x15')]],_0x7dab('0x23'));this[_0x7dab('0x8')][this[_0x7dab('0x15')]]=setInterval(this[_0x7dab('0x13')][_0x7dab('0xb')](this,_0x3cbb5d),0x3e8);}else{logger[_0x7dab('0x17')](_0x7dab('0x24'),this[_0x7dab('0x9')]['id'],this[_0x7dab('0x15')]);_0x3cbb5d['done']();setTimeout(this[_0x7dab('0xa')][_0x7dab('0xb')](this),0x3e8);}}};RRMemory[_0x7dab('0x11')]['handleTimeout']=function(_0x438b84){logger[_0x7dab('0x17')](_0x7dab('0x25'),this[_0x7dab('0x9')]['id'],this[_0x7dab('0x15')]);if(_[_0x7dab('0x1a')](this[_0x7dab('0x7')][_0x7dab('0x1b')][this[_0x7dab('0x15')]])){logger[_0x7dab('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x7dab('0x9')]['id'],this[_0x7dab('0x15')]);}else{clearInterval(this[_0x7dab('0x8')][this['agentId']]);util[_0x7dab('0x26')](this[_0x7dab('0x5')],this[_0x7dab('0x9')]['id'],this['realtime']['agents'][this['agentId']],this[_0x7dab('0x6')],this['routing']);util[_0x7dab('0x22')](this[_0x7dab('0x9')]['id'],this[_0x7dab('0x7')][_0x7dab('0x1b')][this[_0x7dab('0x15')]],'TIMEOUT');this[_0x7dab('0x7')][_0x7dab('0x1b')][this['agentId']][_0x7dab('0x1e')]=![];this[_0x7dab('0x7')][_0x7dab('0x1b')][this['agentId']][_0x7dab('0x27')]=undefined;util[_0x7dab('0x28')](this[_0x7dab('0x7')],this['routing'],this[_0x7dab('0x7')][_0x7dab('0x1b')][this[_0x7dab('0x15')]],this[_0x7dab('0x9')][_0x7dab('0x16')]);}if(!_0x438b84){setTimeout(this[_0x7dab('0xa')][_0x7dab('0xb')](this),0x3e8);}};function rrmemory(_0x4df039,_0x44abc1,_0x4c1652,_0x40c138){return new RRMemory(_0x4df039,_0x44abc1,_0x4c1652,_0x40c138);}module[_0x7dab('0x29')]=rrmemory;
\ No newline at end of file
index 619aee3..bad0aa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71f8=['hideNotification','checkWaitingNotifications','interaction','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','name','user:save','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','message','emit','notification:%s','save','remove','debug','isAgentAvailable','busy','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x71f8,0x71));var _0x871f=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0x71f8[_0x565fed];return _0x3e018f;};'use strict';var _=require('lodash');var util=require(_0x871f('0x0'));var utils=require(_0x871f('0x1'));var Redis=require(_0x871f('0x2'));var config=require(_0x871f('0x3'));var logger=require(_0x871f('0x4'))('routing');config[_0x871f('0x5')]=_[_0x871f('0x6')](config[_0x871f('0x5')],{'host':_0x871f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x871f('0x5')]));function sendNotification(_0x58525b,_0x410ea8,_0x28b80b,_0x11ced3,_0x24a4ad,_0xee411e){io['to'](util['format']('user:%s',_0x11ced3[_0x871f('0x8')]))['emit'](_0x871f('0x9'),_0x11ced3);var _0xc9d3fe=_0xee411e||{};var _0x3af524=_0x28b80b['split']('.');var _0x1ad7e5={'uniqueid':_0x410ea8,'channel':_0x3af524[0x0],'id':_0x3af524[0x1],'title':_0x3af524[0x0]+'\x20interaction','interactionId':_0x3af524[0x2],'queue':_0x24a4ad?_0x24a4ad['name']:null,'sound':_0xc9d3fe[_0x871f('0xa')][_0x871f('0xb')],'shake':_0xc9d3fe['account'][_0x871f('0xc')]};try{if(!_0xc9d3fe['body']){_0xc9d3fe[_0x871f('0xd')]={};}if(_0x24a4ad){_0xc9d3fe['body']['queue']=_0x24a4ad;}else if(_0xc9d3fe['body'][_0x871f('0xe')]){delete _0xc9d3fe[_0x871f('0xd')][_0x871f('0xe')];}_0x1ad7e5['msg']=utils[_0x871f('0xf')](_0xc9d3fe[_0x871f('0xa')][_0x871f('0x10')],_0xc9d3fe);}catch(_0x574ef5){_0x1ad7e5[_0x871f('0x11')]=_0x871f('0x12');logger[_0x871f('0x13')](util[_0x871f('0x14')]('[%s][QUEUE]\x20%s',_0x410ea8,_0x574ef5[_0x871f('0x15')]));}io['to'](util[_0x871f('0x14')]('user:%s',_0x11ced3['name']))[_0x871f('0x16')](util[_0x871f('0x14')](_0x871f('0x17'),_0x58525b?_0x871f('0x18'):_0x871f('0x19')),_0x1ad7e5);}function writeLog(_0x3f3746,_0x305adb,_0x3e5b64){return logger[_0x871f('0x1a')](util[_0x871f('0x14')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3f3746,_0x305adb[_0x871f('0x8')],_0x3e5b64));}exports[_0x871f('0x1b')]=function(_0x12dfe7,_0x5bf308,_0x531f5a,_0x1f9b23){if(_0x5bf308[_0x871f('0x1c')]){writeLog(_0x12dfe7,_0x5bf308,'BUSY');return![];}if(!_0x5bf308['online']){writeLog(_0x12dfe7,_0x5bf308,_0x871f('0x1d'));return![];}if(_0x5bf308[_0x531f5a+_0x871f('0x1e')]){writeLog(_0x12dfe7,_0x5bf308,_0x871f('0x1f'));return![];}if(_0x1f9b23&&_0x5bf308[_0x871f('0x20')](_0x531f5a+_0x871f('0x21'))&&_0x5bf308[_0x871f('0x20')](_0x531f5a+_0x871f('0x22'))){if(_0x5bf308[_0x531f5a+_0x871f('0x21')]>0x0&&_0x5bf308[_0x531f5a+_0x871f('0x22')]>=_0x5bf308[_0x531f5a+_0x871f('0x21')]){writeLog(_0x12dfe7,_0x5bf308,_0x531f5a[_0x871f('0x23')]()+_0x871f('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x1bccbf,_0x9c5e0d,_0xeaa065,_0x2bf30a,_0x266cf1){return sendNotification(!![],_0x1bccbf,_0x9c5e0d,_0xeaa065,_0x2bf30a,_0x266cf1);};exports[_0x871f('0x25')]=function(_0x495de0,_0x409c11,_0x4c1338,_0x35604d,_0x2d50af){return sendNotification(![],_0x495de0,_0x409c11,_0x4c1338,_0x35604d,_0x2d50af);};exports[_0x871f('0x26')]=function(_0x1d98b5,_0x4c1005,_0x384c7d){var _0x4be634=_0x4c1005[_0x871f('0x27')]['UserId'];if(!_0x4be634&&_0x384c7d){_0x4be634=_0x384c7d['id'];}var _0x3de603=_[_0x871f('0x28')](_0x1d98b5[_0x4c1005[_0x871f('0x29')]+_0x871f('0x2a')],function(_0xecf469){var _0x4d5231=_[_0x871f('0x2b')](_0x4c1005[_0x871f('0x29')])+_0x871f('0x2c');return _0xecf469[_0x4d5231]===_0x4c1005[_0x871f('0x27')]['id'];});if(!_0x3de603&&_0x4be634){_0x3de603=_[_0x871f('0x28')](_0x1d98b5[_0x871f('0x2d')][_0x4be634][_0x4c1005[_0x871f('0x29')]+_0x871f('0x2e')],function(_0x27870d){return _0x27870d['id']===_0x4c1005['interaction']['id'];});}return _0x3de603;};exports[_0x871f('0x2f')]=function(_0x5a3e69,_0x3c293f,_0xf29a87,_0x46e50a){_0x5a3e69['agents'][_0xf29a87['id']][_0x46e50a+_0x871f('0x2e')][_0x3c293f['message']['id']]={'id':_0x3c293f[_0x871f('0x27')]['id']};};exports[_0x871f('0x30')]=function(_0x22b5ee,_0x51fdfc,_0x69171e,_0x2dc0e1){delete _0x22b5ee[_0x871f('0x2d')][_0x69171e['id']][_0x2dc0e1+_0x871f('0x2e')][_0x51fdfc[_0x871f('0x15')]['id']];};exports[_0x871f('0x31')]=writeLog;
\ No newline at end of file
+var _0xae83=['channel','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','localhost','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','showNotification','hideNotification','interaction','UserId','some','QueuesWaitingInteractions','capitalize'];(function(_0x2f16cf,_0x4edd3f){var _0x140968=function(_0x45d954){while(--_0x45d954){_0x2f16cf['push'](_0x2f16cf['shift']());}};_0x140968(++_0x4edd3f);}(_0xae83,0xa0));var _0x3ae8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xae83[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x3ae8('0x0'));var util=require('util');var utils=require(_0x3ae8('0x1'));var Redis=require(_0x3ae8('0x2'));var config=require(_0x3ae8('0x3'));var logger=require(_0x3ae8('0x4'))('routing');config[_0x3ae8('0x5')]=_['defaults'](config[_0x3ae8('0x5')],{'host':_0x3ae8('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3ae8('0x5')]));function sendNotification(_0x38ea05,_0x271170,_0x273760,_0x390c04,_0x1f7b64,_0x167787){io['to'](util[_0x3ae8('0x7')](_0x3ae8('0x8'),_0x390c04[_0x3ae8('0x9')]))[_0x3ae8('0xa')](_0x3ae8('0xb'),_0x390c04);var _0x4d512d=_0x167787||{};var _0x30297a=_0x273760[_0x3ae8('0xc')]('.');var _0x5b693d={'uniqueid':_0x271170,'channel':_0x30297a[0x0],'id':_0x30297a[0x1],'title':_0x30297a[0x0]+_0x3ae8('0xd'),'interactionId':_0x30297a[0x2],'queue':_0x1f7b64?_0x1f7b64[_0x3ae8('0x9')]:null,'sound':_0x4d512d[_0x3ae8('0xe')]['notificationSound'],'shake':_0x4d512d[_0x3ae8('0xe')][_0x3ae8('0xf')]};try{if(!_0x4d512d[_0x3ae8('0x10')]){_0x4d512d[_0x3ae8('0x10')]={};}if(_0x1f7b64){_0x4d512d[_0x3ae8('0x10')][_0x3ae8('0x11')]=_0x1f7b64;}else if(_0x4d512d[_0x3ae8('0x10')][_0x3ae8('0x11')]){delete _0x4d512d[_0x3ae8('0x10')][_0x3ae8('0x11')];}_0x5b693d['msg']=utils[_0x3ae8('0x12')](_0x4d512d[_0x3ae8('0xe')][_0x3ae8('0x13')],_0x4d512d);}catch(_0x45950f){_0x5b693d['msg']=_0x3ae8('0x14');logger['error'](util[_0x3ae8('0x7')](_0x3ae8('0x15'),_0x271170,_0x45950f[_0x3ae8('0x16')]));}io['to'](util['format'](_0x3ae8('0x8'),_0x390c04[_0x3ae8('0x9')]))[_0x3ae8('0xa')](util[_0x3ae8('0x7')](_0x3ae8('0x17'),_0x38ea05?_0x3ae8('0x18'):_0x3ae8('0x19')),_0x5b693d);}function writeLog(_0x3eb058,_0x5ed883,_0xee3097){return logger[_0x3ae8('0x1a')](util[_0x3ae8('0x7')](_0x3ae8('0x1b'),_0x3eb058,_0x5ed883[_0x3ae8('0x9')],_0xee3097));}exports[_0x3ae8('0x1c')]=function(_0x95353e,_0x2f5c7f,_0x29aac6,_0x1e37ec){if(_0x2f5c7f[_0x3ae8('0x1d')]){writeLog(_0x95353e,_0x2f5c7f,_0x3ae8('0x1e'));return![];}if(!_0x2f5c7f[_0x3ae8('0x1f')]){writeLog(_0x95353e,_0x2f5c7f,_0x3ae8('0x20'));return![];}if(_0x2f5c7f[_0x29aac6+_0x3ae8('0x21')]){writeLog(_0x95353e,_0x2f5c7f,'PAUSE');return![];}if(_0x1e37ec&&_0x2f5c7f[_0x3ae8('0x22')](_0x29aac6+_0x3ae8('0x23'))&&_0x2f5c7f['hasOwnProperty'](_0x29aac6+_0x3ae8('0x24'))){if(_0x2f5c7f[_0x29aac6+_0x3ae8('0x23')]>0x0&&_0x2f5c7f[_0x29aac6+_0x3ae8('0x24')]>=_0x2f5c7f[_0x29aac6+_0x3ae8('0x23')]){writeLog(_0x95353e,_0x2f5c7f,_0x29aac6['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3ae8('0x25')]=function(_0xf2e2c1,_0x4a1ee2,_0xdabcf,_0x34f981,_0x564136){return sendNotification(!![],_0xf2e2c1,_0x4a1ee2,_0xdabcf,_0x34f981,_0x564136);};exports[_0x3ae8('0x26')]=function(_0x3bf5cb,_0x25fb07,_0x5178db,_0x3970de,_0x4a737a){return sendNotification(![],_0x3bf5cb,_0x25fb07,_0x5178db,_0x3970de,_0x4a737a);};exports['checkWaitingNotifications']=function(_0x4ca601,_0x438008,_0x31362c){var _0xa34274=_0x438008[_0x3ae8('0x27')][_0x3ae8('0x28')];if(!_0xa34274&&_0x31362c){_0xa34274=_0x31362c['id'];}var _0x4776e6=_[_0x3ae8('0x29')](_0x4ca601[_0x438008['channel']+_0x3ae8('0x2a')],function(_0x302e60){var _0x4f624e=_[_0x3ae8('0x2b')](_0x438008[_0x3ae8('0x2c')])+_0x3ae8('0x2d');return _0x302e60[_0x4f624e]===_0x438008[_0x3ae8('0x27')]['id'];});if(!_0x4776e6&&_0xa34274){_0x4776e6=_[_0x3ae8('0x29')](_0x4ca601[_0x3ae8('0x2e')][_0xa34274][_0x438008[_0x3ae8('0x2c')]+_0x3ae8('0x2f')],function(_0x424608){return _0x424608['id']===_0x438008[_0x3ae8('0x27')]['id'];});}return _0x4776e6;};exports[_0x3ae8('0x30')]=function(_0x492f20,_0x330d49,_0x53898b,_0x4f5fc0){_0x492f20[_0x3ae8('0x2e')][_0x53898b['id']][_0x4f5fc0+_0x3ae8('0x2f')][_0x330d49[_0x3ae8('0x16')]['id']]={'id':_0x330d49[_0x3ae8('0x27')]['id']};};exports[_0x3ae8('0x31')]=function(_0x1e4179,_0x1fe06c,_0x4626f9,_0xe09833){delete _0x1e4179['agents'][_0x4626f9['id']][_0xe09833+_0x3ae8('0x2f')][_0x1fe06c[_0x3ae8('0x16')]['id']];};exports[_0x3ae8('0x32')]=writeLog;
\ No newline at end of file
index 0df2b8e..4cf33bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd16=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','stringify','next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string'];(function(_0x2b3654,_0x2b4e0d){var _0x5f30dc=function(_0xbe4513){while(--_0xbe4513){_0x2b3654['push'](_0x2b3654['shift']());}};_0x5f30dc(++_0x2b4e0d);}(_0xcd16,0x13e));var _0x6cd1=function(_0x20ec10,_0x4613b3){_0x20ec10=_0x20ec10-0x0;var _0x40539e=_0xcd16[_0x20ec10];return _0x40539e;};'use strict';var schema=require(_0x6cd1('0x0'));var sh=require(_0x6cd1('0x1'));var _=require(_0x6cd1('0x2'));var utils=require(_0x6cd1('0x3'));var logger=require(_0x6cd1('0x4'))(_0x6cd1('0x5'));var system=schema({'command':{'type':_0x6cd1('0x6'),'required':!![],'message':_0x6cd1('0x7')}});exports[_0x6cd1('0x8')]=function(_0x1e08f3,_0x1be859){return function(_0x14d4c4){try{var _0x6113be={'command':_0x1be859[0x0]};var _0x418c07=system[_0x6cd1('0x0')](_0x6113be,{'typecast':!![]});if(_0x418c07[_0x6cd1('0x9')]){logger[_0x6cd1('0xa')](_0x6cd1('0xb'),_0x1e08f3,_[_0x6cd1('0xc')](_0x418c07,'message')[_0x6cd1('0xd')](',\x20'));logger[_0x6cd1('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1e08f3);_0x14d4c4['next']();}else{var _0x22b6b2=this;var _0x26b2e9=utils[_0x6cd1('0xf')](_0x1be859[0x0],this);logger[_0x6cd1('0xe')](_0x6cd1('0x10'),_0x1e08f3,_0x26b2e9);sh['exec'](_[_0x6cd1('0x11')](_0x26b2e9),function(_0x16d611,_0x5a274f){logger[_0x6cd1('0xe')](_0x6cd1('0x12'),_0x1e08f3,_0x16d611);if(_0x16d611==0x0){var _0x429562=_0x5a274f['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x6cd1('0x13')](_0x1be859[0x1])||_[_0x6cd1('0x14')](_0x1be859[0x1])){logger[_0x6cd1('0xe')](_0x6cd1('0x15'),_0x1e08f3);_0x22b6b2[_0x6cd1('0x16')][_0x1be859[0x1]]=_0x429562;}else{logger[_0x6cd1('0xe')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x1e08f3,_0x1be859[0x1],_0x429562);_0x22b6b2['body'][_0x1be859[0x1]]=_0x429562;}}_0x14d4c4['next']();});}}catch(_0x228153){logger[_0x6cd1('0xa')](_0x6cd1('0xb'),_0x1e08f3,_['isObject'](_0x228153)?JSON[_0x6cd1('0x17')](_0x228153):_0x228153);logger[_0x6cd1('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1e08f3);_0x14d4c4[_0x6cd1('0x18')]();}};};
\ No newline at end of file
+var _0x62e9=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','string','length','error','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x4ae9c2,_0xf1d633){var _0x1de2b0=function(_0x1914f0){while(--_0x1914f0){_0x4ae9c2['push'](_0x4ae9c2['shift']());}};_0x1de2b0(++_0xf1d633);}(_0x62e9,0x1e6));var _0x962e=function(_0x963eee,_0x5ac2c0){_0x963eee=_0x963eee-0x0;var _0x349a57=_0x62e9[_0x963eee];return _0x349a57;};'use strict';var schema=require(_0x962e('0x0'));var sh=require(_0x962e('0x1'));var _=require(_0x962e('0x2'));var utils=require(_0x962e('0x3'));var logger=require(_0x962e('0x4'))('routing');var system=schema({'command':{'type':_0x962e('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x4300f8,_0x289182){return function(_0x44b98a){try{var _0x273a28={'command':_0x289182[0x0]};var _0x35213d=system[_0x962e('0x0')](_0x273a28,{'typecast':!![]});if(_0x35213d[_0x962e('0x6')]){logger[_0x962e('0x7')](_0x962e('0x8'),_0x4300f8,_[_0x962e('0x9')](_0x35213d,'message')['join'](',\x20'));logger[_0x962e('0xa')](_0x962e('0xb'),_0x4300f8);_0x44b98a[_0x962e('0xc')]();}else{var _0x1d78c4=this;var _0x557612=utils[_0x962e('0xd')](_0x289182[0x0],this);logger[_0x962e('0xa')](_0x962e('0xe'),_0x4300f8,_0x557612);sh[_0x962e('0xf')](_[_0x962e('0x10')](_0x557612),function(_0x3ffd5d,_0x1bd926){logger[_0x962e('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4300f8,_0x3ffd5d);if(_0x3ffd5d==0x0){var _0x168b97=_0x1bd926[_0x962e('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x962e('0x12')](_0x289182[0x1])||_[_0x962e('0x13')](_0x289182[0x1])){logger[_0x962e('0xa')](_0x962e('0x14'),_0x4300f8);_0x1d78c4[_0x962e('0x15')][_0x289182[0x1]]=_0x168b97;}else{logger[_0x962e('0xa')](_0x962e('0x16'),_0x4300f8,_0x289182[0x1],_0x168b97);_0x1d78c4[_0x962e('0x15')][_0x289182[0x1]]=_0x168b97;}}_0x44b98a[_0x962e('0xc')]();});}}catch(_0x2b87bb){logger['error'](_0x962e('0x8'),_0x4300f8,_[_0x962e('0x17')](_0x2b87bb)?JSON[_0x962e('0x18')](_0x2b87bb):_0x2b87bb);logger[_0x962e('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4300f8);_0x44b98a[_0x962e('0xc')]();}};};
\ No newline at end of file
index 80deaf1..3057e3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9261=['../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','validate','length','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','info','error','next','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x4e206f,_0x3dc9b5){var _0x201db1=function(_0x54c5f1){while(--_0x54c5f1){_0x4e206f['push'](_0x4e206f['shift']());}};_0x201db1(++_0x3dc9b5);}(_0x9261,0x168));var _0x1926=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0x9261[_0xae1a83];return _0xdb9da8;};'use strict';var schema=require('validate');var _=require(_0x1926('0x0'));var rpc={'chatInteraction':require(_0x1926('0x1')),'openchannelInteraction':require(_0x1926('0x2')),'smsInteraction':require(_0x1926('0x3')),'mailInteraction':require(_0x1926('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1926('0x5'))};var logger=require(_0x1926('0x6'))(_0x1926('0x7'));var tag=schema({'tag':{'type':_0x1926('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x1926('0x9')]=function(_0x193ab6,_0x189260,_0x46edc5,_0x500f95){return function(_0x24286f){try{var _0x155d04={'tag':_0x189260[0x0]};var _0x405acf=tag[_0x1926('0xa')](_0x155d04,{'typecast':!![]});if(_0x405acf[_0x1926('0xb')]){logger['error'](_0x1926('0xc'),_0x193ab6,_[_0x1926('0xd')](_0x405acf,_0x1926('0xe'))[_0x1926('0xf')](',\x20'));logger['info'](_0x1926('0x10'),_0x193ab6);_0x24286f['next']();}else{var _0x89d08={'ids':[_0x189260[0x0]]};if(rpc[_0x500f95[_0x1926('0x11')]+_0x1926('0x12')]){rpc[_0x500f95[_0x1926('0x11')]+_0x1926('0x12')][_0x1926('0x13')](_0x500f95[_0x1926('0x14')]['id'],_0x89d08)['then'](function(_0x59d702){logger[_0x1926('0x15')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x193ab6,_0x189260[0x1],_0x500f95['channel'],_0x500f95[_0x1926('0x14')]['id']);})['catch'](function(_0x1064e6){logger[_0x1926('0x16')](_0x1926('0xc'),_0x193ab6,JSON['stringify'](_0x1064e6));logger[_0x1926('0x15')](_0x1926('0x10'),_0x193ab6);})['finally'](function(){_0x24286f[_0x1926('0x17')]();});}}}catch(_0x3f0d55){logger[_0x1926('0x16')]('[%s][TAG]\x20%s',_0x193ab6,_[_0x1926('0x18')](_0x3f0d55)?JSON[_0x1926('0x19')](_0x3f0d55):_0x3f0d55);logger['info'](_0x1926('0x10'),_0x193ab6);_0x24286f['next']();}};};
\ No newline at end of file
+var _0xa6d8=['isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','interaction','then','catch','stringify','finally'];(function(_0x431569,_0x4d3a6f){var _0x5303d5=function(_0x24521f){while(--_0x24521f){_0x431569['push'](_0x431569['shift']());}};_0x5303d5(++_0x4d3a6f);}(_0xa6d8,0x16e));var _0x8a6d=function(_0x2237be,_0x2ed5c1){_0x2237be=_0x2237be-0x0;var _0x3312ab=_0xa6d8[_0x2237be];return _0x3312ab;};'use strict';var schema=require('validate');var _=require(_0x8a6d('0x0'));var rpc={'chatInteraction':require(_0x8a6d('0x1')),'openchannelInteraction':require(_0x8a6d('0x2')),'smsInteraction':require(_0x8a6d('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8a6d('0x4')),'whatsappInteraction':require(_0x8a6d('0x5'))};var logger=require('../../../../config/logger')(_0x8a6d('0x6'));var tag=schema({'tag':{'type':_0x8a6d('0x7'),'required':!![],'message':_0x8a6d('0x8')}});exports[_0x8a6d('0x9')]=function(_0x56ef11,_0x12c70d,_0x12f2c9,_0x4fe9c7){return function(_0x5abcea){try{var _0x306dea={'tag':_0x12c70d[0x0]};var _0x364db7=tag[_0x8a6d('0xa')](_0x306dea,{'typecast':!![]});if(_0x364db7['length']){logger[_0x8a6d('0xb')](_0x8a6d('0xc'),_0x56ef11,_[_0x8a6d('0xd')](_0x364db7,_0x8a6d('0xe'))[_0x8a6d('0xf')](',\x20'));logger[_0x8a6d('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x56ef11);_0x5abcea[_0x8a6d('0x11')]();}else{var _0x460422={'ids':[_0x12c70d[0x0]]};if(rpc[_0x4fe9c7[_0x8a6d('0x12')]+_0x8a6d('0x13')]){rpc[_0x4fe9c7[_0x8a6d('0x12')]+_0x8a6d('0x13')][_0x8a6d('0x14')](_0x4fe9c7[_0x8a6d('0x15')]['id'],_0x460422)[_0x8a6d('0x16')](function(_0x256d02){logger[_0x8a6d('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x56ef11,_0x12c70d[0x1],_0x4fe9c7['channel'],_0x4fe9c7['interaction']['id']);})[_0x8a6d('0x17')](function(_0x2e19a4){logger[_0x8a6d('0xb')](_0x8a6d('0xc'),_0x56ef11,JSON[_0x8a6d('0x18')](_0x2e19a4));logger[_0x8a6d('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x56ef11);})[_0x8a6d('0x19')](function(){_0x5abcea['next']();});}}}catch(_0x272fac){logger[_0x8a6d('0xb')](_0x8a6d('0xc'),_0x56ef11,_[_0x8a6d('0x1a')](_0x272fac)?JSON['stringify'](_0x272fac):_0x272fac);logger[_0x8a6d('0x10')](_0x8a6d('0x1b'),_0x56ef11);_0x5abcea[_0x8a6d('0x11')]();}};};
\ No newline at end of file
index 097daba..af4200f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a64=['lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stop','catch','[%s][TVOX]\x20%s','info','next','request-promise','routing'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x8a64,0x1de));var _0x48a6=function(_0x176b8d,_0x5ce17a){_0x176b8d=_0x176b8d-0x0;var _0x529e62=_0x8a64[_0x176b8d];return _0x529e62;};'use strict';var rp=require(_0x48a6('0x0'));var logger=require('../../../../config/logger')(_0x48a6('0x1'));var _=require(_0x48a6('0x2'));var arr=[];exports[_0x48a6('0x3')]=function(_0x5cdb12,_0x2dd286){return function(_0x3a6500){var _0x13d401=_0x2dd286[0xa];var _0x1637ce=_0x2dd286[0xb];var _0x12c9d7=_0x2dd286[0xc];var _0x4afb22=_0x2dd286[0xd];var _0x24d510=_0x2dd286[0xe];var _0x3b5184=_0x2dd286[0xf][_0x48a6('0x4')](/\n/g,_0x48a6('0x5'));var _0x97a498=_0x2dd286[0x10][_0x48a6('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x1637ce)){arr[_0x48a6('0x6')](_0x1637ce);var _0x438c97=_0x2dd286[0x3];var _0x288749=_0x2dd286[0x4];var _0x3a182f=_0x2dd286[0x1];var _0x44e37f=_0x2dd286[0x0];var _0x2cdb1a={};_0x2cdb1a[_0x48a6('0x7')]=_0x2dd286[0x8]+_0x48a6('0x8')+_0x12c9d7+'|'+_0x13d401+'|'+_0x4afb22+'|'+_0x1637ce+'|'+_0x24d510;_0x2cdb1a[_0x48a6('0x9')]=_0x2dd286[0x7]+'?params='+_0x12c9d7+'|'+_0x13d401+'|'+_0x4afb22+'|'+_0x1637ce+'|'+_0x24d510+'|'+_0x3b5184+'|'+_0x97a498;_0x2cdb1a[_0x48a6('0xa')]=_0x2dd286[0x9];var _0x3ec13a={};_0x3ec13a['jsonrpc']=_0x48a6('0xb');_0x3ec13a[_0x48a6('0xc')]=_0x48a6('0xd');var _0x102176=[];_0x102176[_0x48a6('0x6')](_0x2dd286[0x2]);_0x102176[_0x48a6('0x6')](_0x2dd286[0x5]);_0x102176['push'](_0x2dd286[0x6]);_0x3ec13a[_0x48a6('0xe')]=_0x102176;_0x3ec13a['id']=0x1;var _0x782c15=JSON[_0x48a6('0xf')](_0x3ec13a);var _0x327cff={'encoding':_0x48a6('0x10'),'method':_0x48a6('0x11'),'timeout':0x2710,'url':_0x438c97,'headers':{'Content-Type':_0x48a6('0x12')},'body':_0x782c15};return rp(_0x327cff)[_0x48a6('0x13')](function(_0x54d4e0){const _0x64a292=JSON['parse'](_0x54d4e0);if(!_0x64a292[_0x48a6('0x14')][_0x48a6('0x15')]){throw new Error(_0x48a6('0x16'));}var _0xbcd43=_0x1637ce;var _0x15f2b1=_0x48a6('0x17')+_0x3a182f+_0x48a6('0x18')+_0x44e37f+_0x48a6('0x19')+_0xbcd43+_0x48a6('0x1a')+JSON[_0x48a6('0xf')](_0x2cdb1a);var _0xe86e54=_0x288749+'?'+_0x15f2b1;return rp(_0xe86e54);})[_0x48a6('0x13')](function(_0x2b3b81){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5cdb12,_0x2b3b81);_0x3a6500[_0x48a6('0x1b')]();})[_0x48a6('0x1c')](function(_0x50e695){logger['error'](_0x48a6('0x1d'),_0x5cdb12,_['isObject'](_0x50e695)?JSON[_0x48a6('0xf')](_0x50e695):_0x50e695);_0x3a6500[_0x48a6('0x1b')]();});}else{logger[_0x48a6('0x1e')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5cdb12);_0x3a6500[_0x48a6('0x1f')]();}};};
\ No newline at end of file
+var _0x1ce0=['stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','urlOnRing','?params=','title','2.0','method','params','utf8','POST','application/json-rpc','then','result','channelId=','&serviceId=','&sessionId=','&data='];(function(_0x593f45,_0x5953d3){var _0x155e20=function(_0x119beb){while(--_0x119beb){_0x593f45['push'](_0x593f45['shift']());}};_0x155e20(++_0x5953d3);}(_0x1ce0,0xae));var _0x01ce=function(_0x6d7f08,_0x9e8c3b){_0x6d7f08=_0x6d7f08-0x0;var _0x35e5e1=_0x1ce0[_0x6d7f08];return _0x35e5e1;};'use strict';var rp=require(_0x01ce('0x0'));var logger=require(_0x01ce('0x1'))(_0x01ce('0x2'));var _=require('lodash');var arr=[];exports[_0x01ce('0x3')]=function(_0x13829d,_0x451f80){return function(_0xd352a0){var _0x33e81a=_0x451f80[0xa];var _0x35614f=_0x451f80[0xb];var _0x4cc321=_0x451f80[0xc];var _0x8e855d=_0x451f80[0xd];var _0x1c2ef6=_0x451f80[0xe];var _0x24972c=_0x451f80[0xf]['replace'](/\n/g,_0x01ce('0x4'));var _0x2daf62=_0x451f80[0x10][_0x01ce('0x5')](/\n/g,'\x20');if(!arr[_0x01ce('0x6')](_0x35614f)){arr[_0x01ce('0x7')](_0x35614f);var _0x5b6e7f=_0x451f80[0x3];var _0x5638aa=_0x451f80[0x4];var _0x3e15b1=_0x451f80[0x1];var _0x57cbb9=_0x451f80[0x0];var _0x26a666={};_0x26a666[_0x01ce('0x8')]=_0x451f80[0x8]+'?params='+_0x4cc321+'|'+_0x33e81a+'|'+_0x8e855d+'|'+_0x35614f+'|'+_0x1c2ef6;_0x26a666[_0x01ce('0x9')]=_0x451f80[0x7]+_0x01ce('0xa')+_0x4cc321+'|'+_0x33e81a+'|'+_0x8e855d+'|'+_0x35614f+'|'+_0x1c2ef6+'|'+_0x24972c+'|'+_0x2daf62;_0x26a666[_0x01ce('0xb')]=_0x451f80[0x9];var _0x2405ee={};_0x2405ee['jsonrpc']=_0x01ce('0xc');_0x2405ee[_0x01ce('0xd')]='login';var _0x48a0c4=[];_0x48a0c4[_0x01ce('0x7')](_0x451f80[0x2]);_0x48a0c4[_0x01ce('0x7')](_0x451f80[0x5]);_0x48a0c4[_0x01ce('0x7')](_0x451f80[0x6]);_0x2405ee[_0x01ce('0xe')]=_0x48a0c4;_0x2405ee['id']=0x1;var _0x19511b=JSON['stringify'](_0x2405ee);var _0xe2af26={'encoding':_0x01ce('0xf'),'method':_0x01ce('0x10'),'timeout':0x2710,'url':_0x5b6e7f,'headers':{'Content-Type':_0x01ce('0x11')},'body':_0x19511b};return rp(_0xe2af26)[_0x01ce('0x12')](function(_0xbef8ad){const _0x5e7e88=JSON['parse'](_0xbef8ad);if(!_0x5e7e88[_0x01ce('0x13')]['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x19b393=_0x35614f;var _0x427995=_0x01ce('0x14')+_0x3e15b1+_0x01ce('0x15')+_0x57cbb9+_0x01ce('0x16')+_0x19b393+_0x01ce('0x17')+JSON[_0x01ce('0x18')](_0x26a666);var _0x1521b6=_0x5638aa+'?'+_0x427995;return rp(_0x1521b6);})[_0x01ce('0x12')](function(_0x57b18e){logger['info'](_0x01ce('0x19'),_0x13829d,_0x57b18e);_0xd352a0['stop']();})[_0x01ce('0x1a')](function(_0x2a2164){logger[_0x01ce('0x1b')](_0x01ce('0x1c'),_0x13829d,_[_0x01ce('0x1d')](_0x2a2164)?JSON[_0x01ce('0x18')](_0x2a2164):_0x2a2164);_0xd352a0[_0x01ce('0x1e')]();});}else{logger[_0x01ce('0x1f')](_0x01ce('0x20'),_0x13829d);_0xd352a0['next']();}};};
\ No newline at end of file
index 82caff2..f666a63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x45b174,_0x5ccb45){var _0x59b987=function(_0x5557a8){while(--_0x5557a8){_0x45b174['push'](_0x45b174['shift']());}};_0x59b987(++_0x5ccb45);}(_0xe706,0xa3));var _0x6e70=function(_0x24f1ff,_0x4014c9){_0x24f1ff=_0x24f1ff-0x0;var _0x349109=_0xe706[_0x24f1ff];return _0x349109;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x42a937,_0x34182b){var _0x48a613=function(_0x1f5107){while(--_0x1f5107){_0x42a937['push'](_0x42a937['shift']());}};_0x48a613(++_0x34182b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index 23d40bc..c1dc597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8483=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflowv2','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','matchPath','emit','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','values'];(function(_0x4b5b86,_0x23c37a){var _0xd965ac=function(_0x51f2cb){while(--_0x51f2cb){_0x4b5b86['push'](_0x4b5b86['shift']());}};_0xd965ac(++_0x23c37a);}(_0x8483,0x69));var _0x3848=function(_0x11331e,_0x2cd04b){_0x11331e=_0x11331e-0x0;var _0x375037=_0x8483[_0x11331e];return _0x375037;};'use strict';var _=require(_0x3848('0x0'));var util=require(_0x3848('0x1'));var path=require(_0x3848('0x2'));var fs=require('fs');var jayson=require(_0x3848('0x3'));var BPromise=require(_0x3848('0x4'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require(_0x3848('0x5'))(_0x3848('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x3848('0x7')),'chatQueueReport':require(_0x3848('0x8')),'smsQueueReport':require(_0x3848('0x9')),'faxQueueReport':require(_0x3848('0xa')),'whatsappQueueReport':require(_0x3848('0xb'))};var RuleEngine=require(_0x3848('0xc'));function getId(_0x51ace9,_0x35a1fd,_0x3bf66e){return util[_0x3848('0xd')](_0x3848('0xe'),_0x51ace9,_0x35a1fd||0x0,_0x3bf66e||0x0);}function getIntervals(_0x585184,_0x48c4eb){var _0x463143=[];if(!_[_0x3848('0xf')](_0x48c4eb[_0x3848('0x10')])&&!_[_0x3848('0xf')](_0x585184[_0x48c4eb['IntervalId']])&&!_[_0x3848('0xf')](_0x585184[_0x48c4eb[_0x3848('0x10')]][_0x3848('0x11')])){_0x463143=_[_0x3848('0x12')](_0x585184[_0x48c4eb[_0x3848('0x10')]][_0x3848('0x11')],_0x3848('0x13'));}else if(!_[_0x3848('0xf')](_0x48c4eb[_0x3848('0x13')])){_0x463143=[_0x48c4eb[_0x3848('0x13')]];}return _0x463143;}exports[_0x3848('0x14')]=function(_0x9248a4){_0x9248a4[_0x3848('0x15')]={};return new BPromise(function(_0x1cfc3c,_0x504806){var _0x2fd16b={'Start':function(_0x3f5631){var _0x3b9bef=this;return new Promise(function(_0x3b6be4,_0x4cf43c){if(_0x3f5631){try{var _0x460b6e=[];var _0x1f102b=getId(_0x3f5631[_0x3848('0x16')],_0x3f5631[_0x3848('0x17')]?_0x3f5631[_0x3848('0x17')]['id']:0x0,_0x3f5631[_0x3848('0x18')]?_0x3f5631['interaction']['id']:0x0);var _0x12fc0b=sUtils['checkWaitingNotifications'](_0x9248a4,_0x3f5631);if(!_0x12fc0b&&_0x3f5631[_0x3848('0x19')]&&_[_0x3848('0x1a')](_0x3f5631[_0x3848('0x19')])&&_0x3f5631[_0x3848('0x19')][_0x3848('0x1b')]){for(var _0x483636=0x0;_0x483636<_0x3f5631[_0x3848('0x19')][_0x3848('0x1b')];_0x483636+=0x1){var _0x322338=_0x3f5631[_0x3848('0x19')][_0x483636];if(fs['existsSync'](path[_0x3848('0x1c')](__dirname,'applications',_0x322338[_0x3848('0x1d')]+_0x3848('0x1e')))){var _0x11a47f=[];switch(_0x322338['app'][_0x3848('0x1f')]()){case _0x3848('0x20'):var _0x542640=_0x322338[_0x3848('0x21')][_0x3848('0x22')](',');if(_0x3f5631[_0x3848('0x16')]==='mail'){_0x11a47f['push'](_0x542640[0x0]);_0x11a47f[_0x3848('0x23')](_0x542640[0x1]);_0x11a47f[_0x3848('0x23')](_0x542640[_0x3848('0x24')](0x2,_0x542640[_0x3848('0x1b')])[_0x3848('0x1c')](','));}else{_0x11a47f[_0x3848('0x23')](_0x542640[0x0]);_0x11a47f[_0x3848('0x23')](_0x542640[_0x3848('0x24')](0x1,_0x542640[_0x3848('0x1b')])[_0x3848('0x1c')](','));}break;case'dialogflow':var _0x199d56=_0x322338[_0x3848('0x21')][_0x3848('0x22')](',');_0x11a47f['push'](_0x199d56[0x0]);_0x11a47f[_0x3848('0x23')](_0x199d56[0x1]);_0x11a47f['push'](_0x199d56[_0x3848('0x24')](0x2,_0x199d56[_0x3848('0x1b')])[_0x3848('0x1c')](','));break;case _0x3848('0x25'):var _0x2add70=_0x322338['appdata'][_0x3848('0x22')](',');_0x11a47f[_0x3848('0x23')](_0x2add70[0x0]);_0x11a47f[_0x3848('0x23')](_0x2add70[0x1]);_0x11a47f[_0x3848('0x23')](_0x2add70[0x2]);_0x11a47f[_0x3848('0x23')](_0x2add70[0x3]);_0x11a47f[_0x3848('0x23')](_0x2add70[_0x3848('0x24')](0x4,_0x2add70[_0x3848('0x1b')])['join'](','));break;case _0x3848('0x26'):var _0xcb0954=_0x322338['appdata'][_0x3848('0x22')](',');_0x11a47f[_0x3848('0x23')](_0xcb0954[0x0]);_0x11a47f[_0x3848('0x23')](_0xcb0954[0x1]);_0x11a47f[_0x3848('0x23')](_0xcb0954[0x2]);_0x11a47f['push'](_0xcb0954[0x3]);_0x11a47f[_0x3848('0x23')](_0xcb0954[_0x3848('0x24')](0x4,_0xcb0954[_0x3848('0x1b')])[_0x3848('0x1c')](','));break;case _0x3848('0x17'):_0x11a47f[_0x3848('0x23')](_0x322338[_0x3848('0x21')]);break;case _0x3848('0x27'):_0x11a47f['push'](_0x322338['TagId']);_0x11a47f[_0x3848('0x23')](_0x322338[_0x3848('0x21')]);break;case _0x3848('0x28'):var _0xf3dfa0=utils['getMustacheRender'](_0x3f5631[_0x3848('0x29')][_0x3848('0x2a')],_0x3f5631);var _0xbebfa6=_0x322338[_0x3848('0x21')]['split'](',');_0x11a47f['push'](_0xbebfa6[0x0]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x1]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x2]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x3]);_0x11a47f['push'](_0xbebfa6[0x4]);_0x11a47f['push'](_0xbebfa6[0x5]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x6]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x7]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x8]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0x9]);_0x11a47f[_0x3848('0x23')](_0xbebfa6[0xa]);_0x11a47f[_0x3848('0x23')](_0x3f5631[_0x3848('0x18')]['id']);_0x11a47f[_0x3848('0x23')](_0x3f5631[_0x3848('0x17')]['id']);_0x11a47f[_0x3848('0x23')](_0x322338[_0x3848('0x2b')]);_0x11a47f[_0x3848('0x23')](_0x3f5631[_0x3848('0x18')][_0x3848('0x2c')]);_0x11a47f[_0x3848('0x23')](_0x3f5631[_0x3848('0x2d')][_0x3848('0x2d')]);_0x11a47f[_0x3848('0x23')](_0xf3dfa0);break;default:_0x11a47f=_['isNil'](_0x322338[_0x3848('0x21')])?[]:_0x322338[_0x3848('0x21')][_0x3848('0x22')](',');}var _0x5c0b66={'id':util['format']('%s:%s:%s',_0x1f102b,_0x322338['id'],_0x322338[_0x3848('0x1d')]),'condition':require(_0x3848('0x2e'))['condition'](_0x1f102b,getIntervals(_0x9248a4[_0x3848('0x2f')],_0x322338),_0x9248a4),'consequence':require('./applications/'+_0x322338['app'])[_0x3848('0x30')](_0x1f102b,_0x11a47f,_0x9248a4,_0x3f5631),'p':_0x322338[_0x3848('0x31')]||0x0};logger[_0x3848('0x32')](_0x3848('0x33'),_0x5c0b66['id'],_0x3848('0x34'),getIntervals(_0x9248a4[_0x3848('0x2f')],_0x322338)[_0x3848('0x1c')]('\x20|\x20'));_0x460b6e[_0x3848('0x23')](_0x5c0b66);}else{logger[_0x3848('0x35')](_0x3848('0x36'),path[_0x3848('0x1c')](__dirname,_0x3848('0x19'),_0x322338[_0x3848('0x1d')]+'.js'));}}_0x9248a4[_0x3848('0x15')][_0x1f102b]=new RuleEngine(_0x460b6e);_0x9248a4[_0x3848('0x15')][_0x1f102b]['execute'](_0x3f5631,function(_0xd2e8c9){logger[_0x3848('0x32')](_0x3848('0x37'),JSON['stringify'](_0xd2e8c9[_0x3848('0x38')]));if(_0x9248a4[_0x3848('0x15')][_0x1f102b]){_0x9248a4[_0x3848('0x15')][_0x1f102b][_0x3848('0x39')]('complete');}});return _0x3b6be4({'code':0xc8,'message':_0x3f5631});}else{if(_0x12fc0b){logger[_0x3848('0x32')](util[_0x3848('0xd')](_0x3848('0x3a'),_0x1f102b));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x3b6be4({'code':0xc8,'message':_0x3f5631});}}catch(_0x511002){logger[_0x3848('0x35')](_0x511002[_0x3848('0x3b')]);return _0x4cf43c(_0x3b9bef[_0x3848('0x35')](0x1f4,_0x511002));}}return _0x4cf43c(_0x3848('0x3c'));});},'AcceptMessage':function(_0x3cc6b3){var _0x244a63=this;return new Promise(function(_0x48e01b,_0x578516){if(_0x3cc6b3['agent']&&_0x3cc6b3[_0x3848('0x3d')]['id']){if(_0x9248a4[_0x3848('0x3e')][_0x3cc6b3[_0x3848('0x3d')]['id']]){_0x9248a4[_0x3848('0x3e')][_0x3cc6b3['agent']['id']][_0x3848('0x3f')]=![];_0x9248a4[_0x3848('0x3e')][_0x3cc6b3[_0x3848('0x3d')]['id']][_0x3848('0x40')]=undefined;}}if(_0x3cc6b3['message']&&_0x3cc6b3[_0x3848('0x17')]['id']){try{var _0x252ff2=getId(_0x3cc6b3[_0x3848('0x16')],_0x3cc6b3[_0x3848('0x17')]?_0x3cc6b3[_0x3848('0x17')]['id']:0x0,_0x3cc6b3[_0x3848('0x18')]?_0x3cc6b3[_0x3848('0x18')]['id']:0x0);if(_0x9248a4['rules'][_0x252ff2]){_0x9248a4[_0x3848('0x15')][_0x252ff2][_0x3848('0x39')](_0x3848('0x41'));if(rpc[_0x3cc6b3[_0x3848('0x16')]+_0x3848('0x42')]){rpc[_0x3cc6b3[_0x3848('0x16')]+_0x3848('0x42')]['update'](_0x252ff2,{'UserId':_0x3cc6b3[_0x3848('0x17')][_0x3848('0x43')]})[_0x3848('0x44')](function(){logger['error'](_0x3848('0x45'));});}}return _0x48e01b({'code':0xc8,'message':_0x3cc6b3});}catch(_0x211551){logger[_0x3848('0x35')](_0x211551[_0x3848('0x3b')]);return _0x578516(_0x244a63[_0x3848('0x35')](0x1f4,_0x211551));}}logger[_0x3848('0x35')](_0x3848('0x46'));return _0x578516(_0x244a63[_0x3848('0x35')](0x1f4,_0x3848('0x46')));});},'RejectMessage':function(_0x38bba7){var _0x7496ce=this;return new Promise(function(_0x469d52,_0x5b0ca1){if(_0x38bba7[_0x3848('0x3d')]&&_0x38bba7[_0x3848('0x3d')]['id']){try{if(_0x9248a4['agents'][_0x38bba7[_0x3848('0x3d')]['id']]){_0x9248a4['agents'][_0x38bba7[_0x3848('0x3d')]['id']][_0x3848('0x3f')]=![];_0x9248a4[_0x3848('0x3e')][_0x38bba7[_0x3848('0x3d')]['id']]['busyQueue']=undefined;}return _0x469d52({'code':0xc8,'message':_0x38bba7});}catch(_0x31fe93){logger[_0x3848('0x35')](_0x31fe93[_0x3848('0x3b')]);return _0x5b0ca1(_0x7496ce[_0x3848('0x35')](0x1f4,_0x31fe93));}}logger[_0x3848('0x35')](_0x3848('0x46'));return _0x5b0ca1(_0x7496ce[_0x3848('0x35')](0x1f4,_0x3848('0x46')));});},'AbandonInteraction':function(_0x502c30){var _0x129851=this;return new Promise(function(_0x10fcf9,_0x1fa75a){if(_0x502c30[_0x3848('0x16')]&&_0x502c30[_0x3848('0x18')]&&_0x502c30['interaction']['id']){try{var _0x276907=getId(_0x502c30['channel'],_0x502c30[_0x3848('0x17')]?_0x502c30[_0x3848('0x17')]['id']:0x0,_0x502c30[_0x3848('0x18')]?_0x502c30[_0x3848('0x18')]['id']:0x0);if(_0x9248a4['rules'][_0x276907]){_0x9248a4[_0x3848('0x15')][_0x276907][_0x3848('0x39')](_0x3848('0x41'));}return _0x10fcf9({'code':0xc8,'message':_0x502c30});}catch(_0x334ed5){logger['error'](_0x334ed5['stack']);return _0x1fa75a(_0x129851[_0x3848('0x35')](0x1f4,_0x334ed5));}}logger['error']('message\x20is\x20empty');return _0x1fa75a(_0x129851['error'](0x1f4,_0x3848('0x46')));});},'AgentCapacity':function(_0x5c8f2c){var _0x4487a4=this;return new Promise(function(_0x1f20da,_0x3f49eb){if(_0x9248a4['agents'][_0x3848('0x47')](_0x5c8f2c['id'])){for(var _0x1ac27c in _0x5c8f2c[_0x3848('0x48')]){if(_0x5c8f2c[_0x3848('0x48')]['hasOwnProperty'](_0x1ac27c)){if(_0x9248a4[_0x3848('0x3e')][_0x5c8f2c['id']][_0x3848('0x47')](_0x1ac27c+'CurrentCapacity')){_0x9248a4[_0x3848('0x3e')][_0x5c8f2c['id']][_0x1ac27c+_0x3848('0x49')]=parseInt(_0x5c8f2c[_0x3848('0x48')][_0x1ac27c],0xa);}}}_0x9248a4[_0x3848('0x3e')][_0x5c8f2c['id']][_0x3848('0x4a')]();return _0x1f20da({'code':0xc8,'message':_0x9248a4[_0x3848('0x3e')][_0x5c8f2c['id']]});}else{return _0x3f49eb(_0x4487a4[_0x3848('0x35')](0x1f4,_0x3848('0x4b')));}});},'Agents':function(_0x3b9c68){return new Promise(function(_0x2cb7be){var _0x4dabc2=_['values'](_0x9248a4[_0x3848('0x3e')]);if(_0x3b9c68&&_0x3b9c68['id']){var _0x3c10dc=_[_0x3848('0x4c')](_0x4dabc2,function(_0x4ebbc0){return _0x4ebbc0['id']===_0x3b9c68['id'];});_0x2cb7be(_0x3c10dc);}else{_0x2cb7be({'count':_0x4dabc2[_0x3848('0x1b')],'rows':_0x4dabc2});}});},'ChatQueues':function(){return new Promise(function(_0x2cde6c){var _0x29b817=[];for(var _0x25c749 in _0x9248a4['chatQueues']){if(_0x9248a4[_0x3848('0x4d')][_0x3848('0x47')](_0x25c749)){var _0x168917=_0x9248a4[_0x3848('0x4d')][_0x25c749];var _0x13b663={'id':_0x168917['id'],'available':_0x168917[_0x3848('0x4e')],'loggedIn':_0x168917[_0x3848('0x4f')],'name':_0x168917[_0x3848('0x50')],'paused':_0x168917[_0x3848('0x51')],'waiting':_0x168917['waiting']};_0x29b817[_0x3848('0x23')](_0x13b663);}}_0x2cde6c({'count':_0x29b817[_0x3848('0x1b')],'rows':_0x29b817});});},'MailQueues':function(){return new Promise(function(_0x28f4c2){var _0x38f4c6=[];for(var _0x4edf67 in _0x9248a4['mailQueues']){if(_0x9248a4[_0x3848('0x52')][_0x3848('0x47')](_0x4edf67)){var _0x377782=_0x9248a4[_0x3848('0x52')][_0x4edf67];var _0x16445e={'id':_0x377782['id'],'available':_0x377782[_0x3848('0x4e')],'loggedIn':_0x377782[_0x3848('0x4f')],'name':_0x377782['name'],'paused':_0x377782[_0x3848('0x51')],'waiting':_0x377782['waiting']};_0x38f4c6[_0x3848('0x23')](_0x16445e);}}_0x28f4c2({'count':_0x38f4c6[_0x3848('0x1b')],'rows':_0x38f4c6});});},'OpenchannelQueues':function(){return new Promise(function(_0x4b8d81){var _0x4bcea5=[];for(var _0x3c7f7f in _0x9248a4[_0x3848('0x53')]){if(_0x9248a4[_0x3848('0x53')]['hasOwnProperty'](_0x3c7f7f)){var _0x48d724=_0x9248a4['openchannelQueues'][_0x3c7f7f];var _0x39e24b={'id':_0x48d724['id'],'available':_0x48d724[_0x3848('0x4e')],'loggedIn':_0x48d724[_0x3848('0x4f')],'name':_0x48d724['name'],'paused':_0x48d724[_0x3848('0x51')],'waiting':_0x48d724[_0x3848('0x54')]};_0x4bcea5[_0x3848('0x23')](_0x39e24b);}}_0x4b8d81({'count':_0x4bcea5[_0x3848('0x1b')],'rows':_0x4bcea5});});},'SmsQueues':function(){return new Promise(function(_0x4f72bf){var _0x56e0b8=[];for(var _0x55784f in _0x9248a4[_0x3848('0x55')]){if(_0x9248a4['smsQueues'][_0x3848('0x47')](_0x55784f)){var _0x3a007c=_0x9248a4[_0x3848('0x55')][_0x55784f];var _0x163923={'id':_0x3a007c['id'],'available':_0x3a007c['available'],'loggedIn':_0x3a007c[_0x3848('0x4f')],'name':_0x3a007c['name'],'paused':_0x3a007c[_0x3848('0x51')],'waiting':_0x3a007c['waiting']};_0x56e0b8[_0x3848('0x23')](_0x163923);}}_0x4f72bf({'count':_0x56e0b8[_0x3848('0x1b')],'rows':_0x56e0b8});});},'FaxQueues':function(){return new Promise(function(_0x5ee733){var _0x250c41=[];for(var _0x591524 in _0x9248a4[_0x3848('0x56')]){if(_0x9248a4[_0x3848('0x56')][_0x3848('0x47')](_0x591524)){var _0x5002ba=_0x9248a4['faxQueues'][_0x591524];var _0x2ea5b7={'id':_0x5002ba['id'],'available':_0x5002ba['available'],'loggedIn':_0x5002ba[_0x3848('0x4f')],'name':_0x5002ba[_0x3848('0x50')],'paused':_0x5002ba['paused'],'waiting':_0x5002ba[_0x3848('0x54')]};_0x250c41[_0x3848('0x23')](_0x2ea5b7);}}_0x5ee733({'count':_0x250c41[_0x3848('0x1b')],'rows':_0x250c41});});},'WhatsappQueues':function(){return new Promise(function(_0x129aa5){var _0x5357ec=[];for(var _0x1846ce in _0x9248a4[_0x3848('0x57')]){if(_0x9248a4['whatsappQueues'][_0x3848('0x47')](_0x1846ce)){var _0x3d2841=_0x9248a4[_0x3848('0x57')][_0x1846ce];var _0x644135={'id':_0x3d2841['id'],'available':_0x3d2841['available'],'loggedIn':_0x3d2841[_0x3848('0x4f')],'name':_0x3d2841[_0x3848('0x50')],'paused':_0x3d2841[_0x3848('0x51')],'waiting':_0x3d2841['waiting']};_0x5357ec[_0x3848('0x23')](_0x644135);}}_0x129aa5({'count':_0x5357ec['length'],'rows':_0x5357ec});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x46fc2e){var _0x5254ce=_[_0x3848('0x58')](_0x9248a4[_0x3848('0x59')]);_0x46fc2e({'count':_0x5254ce[_0x3848('0x1b')],'rows':_0x5254ce});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x479b21){var _0x4e7aed=_[_0x3848('0x58')](_0x9248a4[_0x3848('0x5a')]);_0x479b21({'count':_0x4e7aed[_0x3848('0x1b')],'rows':_0x4e7aed});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4af469){var _0x29fbe8=_[_0x3848('0x58')](_0x9248a4[_0x3848('0x5b')]);_0x4af469({'count':_0x29fbe8['length'],'rows':_0x29fbe8});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4b271d){var _0x9458e4=_[_0x3848('0x58')](_0x9248a4[_0x3848('0x5c')]);_0x4b271d({'count':_0x9458e4[_0x3848('0x1b')],'rows':_0x9458e4});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x346a69){var _0x4ee8ff=_[_0x3848('0x58')](_0x9248a4[_0x3848('0x5d')]);_0x346a69({'count':_0x4ee8ff['length'],'rows':_0x4ee8ff});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x14ab5e){var _0x387c0a=_[_0x3848('0x58')](_0x9248a4['whatsappQueuesWaitingInteractions']);_0x14ab5e({'count':_0x387c0a[_0x3848('0x1b')],'rows':_0x387c0a});});}};var _0x59523b=jayson['server'](_0x2fd16b)[_0x3848('0x5e')]();_0x59523b['on'](_0x3848('0x35'),function(_0x1fa278){logger[_0x3848('0x35')](JSON['stringify'](_0x1fa278));return _0x504806(_0x1fa278);});_0x59523b[_0x3848('0x14')](0x232c,'127.0.0.1',function(){console[_0x3848('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1cfc3c(_0x3848('0x60')+0x232c);});});};
\ No newline at end of file
+var _0x0a72=['../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','existsSync','join','app','.js','toLowerCase','autoreply','appdata','mail','push','slice','length','split','dialogflowv2','amazonlex','tvox','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','emit','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','name','paused','mailQueues','waiting','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport'];(function(_0xb3790d,_0x16df40){var _0x53deae=function(_0x28bf01){while(--_0x28bf01){_0xb3790d['push'](_0xb3790d['shift']());}};_0x53deae(++_0x16df40);}(_0x0a72,0x1e0));var _0x20a7=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x0a72[_0x220dbb];return _0x2b77de;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x20a7('0x0'));var fs=require('fs');var jayson=require(_0x20a7('0x1'));var BPromise=require(_0x20a7('0x2'));var utils=require(_0x20a7('0x3'));var sUtils=require(_0x20a7('0x4'));var logger=require(_0x20a7('0x5'))(_0x20a7('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x20a7('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x20a7('0x8')),'faxQueueReport':require(_0x20a7('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x20a7('0xa'));function getId(_0x446fbd,_0x18dcce,_0x2b538e){return util['format'](_0x20a7('0xb'),_0x446fbd,_0x18dcce||0x0,_0x2b538e||0x0);}function getIntervals(_0x2d13c1,_0x599032){var _0x53f9a1=[];if(!_[_0x20a7('0xc')](_0x599032[_0x20a7('0xd')])&&!_['isNil'](_0x2d13c1[_0x599032[_0x20a7('0xd')]])&&!_['isNil'](_0x2d13c1[_0x599032[_0x20a7('0xd')]][_0x20a7('0xe')])){_0x53f9a1=_[_0x20a7('0xf')](_0x2d13c1[_0x599032[_0x20a7('0xd')]][_0x20a7('0xe')],_0x20a7('0x10'));}else if(!_[_0x20a7('0xc')](_0x599032[_0x20a7('0x10')])){_0x53f9a1=[_0x599032[_0x20a7('0x10')]];}return _0x53f9a1;}exports[_0x20a7('0x11')]=function(_0x2009f4){_0x2009f4[_0x20a7('0x12')]={};return new BPromise(function(_0x5d5400,_0x3e4e1b){var _0x11ccf0={'Start':function(_0x15eb48){var _0x34e2f9=this;return new Promise(function(_0x378d65,_0xab5d9f){if(_0x15eb48){try{var _0xea6a37=[];var _0xf56e07=getId(_0x15eb48[_0x20a7('0x13')],_0x15eb48[_0x20a7('0x14')]?_0x15eb48['message']['id']:0x0,_0x15eb48[_0x20a7('0x15')]?_0x15eb48[_0x20a7('0x15')]['id']:0x0);var _0x310474=sUtils[_0x20a7('0x16')](_0x2009f4,_0x15eb48);if(!_0x310474&&_0x15eb48[_0x20a7('0x17')]&&_['isArray'](_0x15eb48[_0x20a7('0x17')])&&_0x15eb48[_0x20a7('0x17')]['length']){for(var _0x30768d=0x0;_0x30768d<_0x15eb48['applications']['length'];_0x30768d+=0x1){var _0x45cc36=_0x15eb48[_0x20a7('0x17')][_0x30768d];if(fs[_0x20a7('0x18')](path[_0x20a7('0x19')](__dirname,'applications',_0x45cc36[_0x20a7('0x1a')]+_0x20a7('0x1b')))){var _0x119c11=[];switch(_0x45cc36[_0x20a7('0x1a')][_0x20a7('0x1c')]()){case _0x20a7('0x1d'):var _0x555446=_0x45cc36[_0x20a7('0x1e')]['split'](',');if(_0x15eb48['channel']===_0x20a7('0x1f')){_0x119c11[_0x20a7('0x20')](_0x555446[0x0]);_0x119c11[_0x20a7('0x20')](_0x555446[0x1]);_0x119c11[_0x20a7('0x20')](_0x555446[_0x20a7('0x21')](0x2,_0x555446['length'])[_0x20a7('0x19')](','));}else{_0x119c11[_0x20a7('0x20')](_0x555446[0x0]);_0x119c11[_0x20a7('0x20')](_0x555446[_0x20a7('0x21')](0x1,_0x555446[_0x20a7('0x22')])[_0x20a7('0x19')](','));}break;case'dialogflow':var _0x21863b=_0x45cc36[_0x20a7('0x1e')][_0x20a7('0x23')](',');_0x119c11[_0x20a7('0x20')](_0x21863b[0x0]);_0x119c11[_0x20a7('0x20')](_0x21863b[0x1]);_0x119c11[_0x20a7('0x20')](_0x21863b['slice'](0x2,_0x21863b[_0x20a7('0x22')])[_0x20a7('0x19')](','));break;case _0x20a7('0x24'):var _0x5452b3=_0x45cc36[_0x20a7('0x1e')][_0x20a7('0x23')](',');_0x119c11[_0x20a7('0x20')](_0x5452b3[0x0]);_0x119c11[_0x20a7('0x20')](_0x5452b3[0x1]);_0x119c11[_0x20a7('0x20')](_0x5452b3[0x2]);_0x119c11[_0x20a7('0x20')](_0x5452b3[0x3]);_0x119c11['push'](_0x5452b3[_0x20a7('0x21')](0x4,_0x5452b3[_0x20a7('0x22')])[_0x20a7('0x19')](','));break;case _0x20a7('0x25'):var _0x25b0d5=_0x45cc36[_0x20a7('0x1e')][_0x20a7('0x23')](',');_0x119c11[_0x20a7('0x20')](_0x25b0d5[0x0]);_0x119c11[_0x20a7('0x20')](_0x25b0d5[0x1]);_0x119c11['push'](_0x25b0d5[0x2]);_0x119c11[_0x20a7('0x20')](_0x25b0d5[0x3]);_0x119c11['push'](_0x25b0d5['slice'](0x4,_0x25b0d5[_0x20a7('0x22')])[_0x20a7('0x19')](','));break;case _0x20a7('0x14'):_0x119c11[_0x20a7('0x20')](_0x45cc36[_0x20a7('0x1e')]);break;case'tag':_0x119c11['push'](_0x45cc36['TagId']);_0x119c11[_0x20a7('0x20')](_0x45cc36['appdata']);break;case _0x20a7('0x26'):var _0x22f1a4=utils['getMustacheRender'](_0x15eb48['account'][_0x20a7('0x27')],_0x15eb48);var _0x332fd8=_0x45cc36[_0x20a7('0x1e')][_0x20a7('0x23')](',');_0x119c11['push'](_0x332fd8[0x0]);_0x119c11[_0x20a7('0x20')](_0x332fd8[0x1]);_0x119c11['push'](_0x332fd8[0x2]);_0x119c11[_0x20a7('0x20')](_0x332fd8[0x3]);_0x119c11[_0x20a7('0x20')](_0x332fd8[0x4]);_0x119c11[_0x20a7('0x20')](_0x332fd8[0x5]);_0x119c11['push'](_0x332fd8[0x6]);_0x119c11['push'](_0x332fd8[0x7]);_0x119c11[_0x20a7('0x20')](_0x332fd8[0x8]);_0x119c11[_0x20a7('0x20')](_0x332fd8[0x9]);_0x119c11['push'](_0x332fd8[0xa]);_0x119c11[_0x20a7('0x20')](_0x15eb48[_0x20a7('0x15')]['id']);_0x119c11[_0x20a7('0x20')](_0x15eb48[_0x20a7('0x14')]['id']);_0x119c11[_0x20a7('0x20')](_0x45cc36[_0x20a7('0x28')]);_0x119c11['push'](_0x15eb48[_0x20a7('0x15')][_0x20a7('0x29')]);_0x119c11[_0x20a7('0x20')](_0x15eb48[_0x20a7('0x2a')][_0x20a7('0x2a')]);_0x119c11['push'](_0x22f1a4);break;default:_0x119c11=_[_0x20a7('0xc')](_0x45cc36[_0x20a7('0x1e')])?[]:_0x45cc36[_0x20a7('0x1e')][_0x20a7('0x23')](',');}var _0x1237e6={'id':util[_0x20a7('0x2b')](_0x20a7('0x2c'),_0xf56e07,_0x45cc36['id'],_0x45cc36[_0x20a7('0x1a')]),'condition':require(_0x20a7('0x2d'))['condition'](_0xf56e07,getIntervals(_0x2009f4[_0x20a7('0x2e')],_0x45cc36),_0x2009f4),'consequence':require(_0x20a7('0x2f')+_0x45cc36[_0x20a7('0x1a')])[_0x20a7('0x30')](_0xf56e07,_0x119c11,_0x2009f4,_0x15eb48),'p':_0x45cc36['priority']||0x0};logger[_0x20a7('0x31')](_0x20a7('0x32'),_0x1237e6['id'],_0x20a7('0x33'),getIntervals(_0x2009f4['intervals'],_0x45cc36)['join'](_0x20a7('0x34')));_0xea6a37[_0x20a7('0x20')](_0x1237e6);}else{logger[_0x20a7('0x35')](_0x20a7('0x36'),path[_0x20a7('0x19')](__dirname,_0x20a7('0x17'),_0x45cc36['app']+_0x20a7('0x1b')));}}_0x2009f4[_0x20a7('0x12')][_0xf56e07]=new RuleEngine(_0xea6a37);_0x2009f4[_0x20a7('0x12')][_0xf56e07]['execute'](_0x15eb48,function(_0x4d7232){logger[_0x20a7('0x31')](_0x20a7('0x37'),JSON[_0x20a7('0x38')](_0x4d7232[_0x20a7('0x39')]));if(_0x2009f4[_0x20a7('0x12')][_0xf56e07]){_0x2009f4[_0x20a7('0x12')][_0xf56e07]['emit'](_0x20a7('0x3a'));}});return _0x378d65({'code':0xc8,'message':_0x15eb48});}else{if(_0x310474){logger['info'](util['format']('Skipped\x20routing\x20for\x20%s',_0xf56e07));}else{logger[_0x20a7('0x31')](_0x20a7('0x3b'));}return _0x378d65({'code':0xc8,'message':_0x15eb48});}}catch(_0x17898b){logger[_0x20a7('0x35')](_0x17898b[_0x20a7('0x3c')]);return _0xab5d9f(_0x34e2f9[_0x20a7('0x35')](0x1f4,_0x17898b));}}return _0xab5d9f(_0x20a7('0x3d'));});},'AcceptMessage':function(_0x2b64a5){var _0x234186=this;return new Promise(function(_0x329f9e,_0x78fe69){if(_0x2b64a5[_0x20a7('0x3e')]&&_0x2b64a5[_0x20a7('0x3e')]['id']){if(_0x2009f4[_0x20a7('0x3f')][_0x2b64a5[_0x20a7('0x3e')]['id']]){_0x2009f4[_0x20a7('0x3f')][_0x2b64a5[_0x20a7('0x3e')]['id']]['busy']=![];_0x2009f4['agents'][_0x2b64a5[_0x20a7('0x3e')]['id']][_0x20a7('0x40')]=undefined;}}if(_0x2b64a5[_0x20a7('0x14')]&&_0x2b64a5[_0x20a7('0x14')]['id']){try{var _0x972e1f=getId(_0x2b64a5['channel'],_0x2b64a5['message']?_0x2b64a5['message']['id']:0x0,_0x2b64a5[_0x20a7('0x15')]?_0x2b64a5['interaction']['id']:0x0);if(_0x2009f4['rules'][_0x972e1f]){_0x2009f4[_0x20a7('0x12')][_0x972e1f][_0x20a7('0x41')](_0x20a7('0x42'));if(rpc[_0x2b64a5['channel']+_0x20a7('0x43')]){rpc[_0x2b64a5[_0x20a7('0x13')]+_0x20a7('0x43')][_0x20a7('0x44')](_0x972e1f,{'UserId':_0x2b64a5[_0x20a7('0x14')]['UserId']})['catch'](function(){logger[_0x20a7('0x35')](_0x20a7('0x45'));});}}return _0x329f9e({'code':0xc8,'message':_0x2b64a5});}catch(_0x3b0d4b){logger[_0x20a7('0x35')](_0x3b0d4b[_0x20a7('0x3c')]);return _0x78fe69(_0x234186[_0x20a7('0x35')](0x1f4,_0x3b0d4b));}}logger[_0x20a7('0x35')]('message\x20is\x20empty');return _0x78fe69(_0x234186[_0x20a7('0x35')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2a63ba){var _0x327371=this;return new Promise(function(_0x52be30,_0x5e16fa){if(_0x2a63ba[_0x20a7('0x3e')]&&_0x2a63ba[_0x20a7('0x3e')]['id']){try{if(_0x2009f4[_0x20a7('0x3f')][_0x2a63ba[_0x20a7('0x3e')]['id']]){_0x2009f4['agents'][_0x2a63ba[_0x20a7('0x3e')]['id']]['busy']=![];_0x2009f4[_0x20a7('0x3f')][_0x2a63ba[_0x20a7('0x3e')]['id']][_0x20a7('0x40')]=undefined;}return _0x52be30({'code':0xc8,'message':_0x2a63ba});}catch(_0x2a7901){logger[_0x20a7('0x35')](_0x2a7901[_0x20a7('0x3c')]);return _0x5e16fa(_0x327371[_0x20a7('0x35')](0x1f4,_0x2a7901));}}logger[_0x20a7('0x35')](_0x20a7('0x46'));return _0x5e16fa(_0x327371[_0x20a7('0x35')](0x1f4,_0x20a7('0x46')));});},'AbandonInteraction':function(_0x39f744){var _0x5e0ab8=this;return new Promise(function(_0x4ff1df,_0x4fa4a4){if(_0x39f744[_0x20a7('0x13')]&&_0x39f744[_0x20a7('0x15')]&&_0x39f744[_0x20a7('0x15')]['id']){try{var _0x3d689f=getId(_0x39f744['channel'],_0x39f744[_0x20a7('0x14')]?_0x39f744[_0x20a7('0x14')]['id']:0x0,_0x39f744[_0x20a7('0x15')]?_0x39f744[_0x20a7('0x15')]['id']:0x0);if(_0x2009f4[_0x20a7('0x12')][_0x3d689f]){_0x2009f4[_0x20a7('0x12')][_0x3d689f][_0x20a7('0x41')](_0x20a7('0x42'));}return _0x4ff1df({'code':0xc8,'message':_0x39f744});}catch(_0x1a7845){logger[_0x20a7('0x35')](_0x1a7845[_0x20a7('0x3c')]);return _0x4fa4a4(_0x5e0ab8['error'](0x1f4,_0x1a7845));}}logger[_0x20a7('0x35')](_0x20a7('0x46'));return _0x4fa4a4(_0x5e0ab8[_0x20a7('0x35')](0x1f4,_0x20a7('0x46')));});},'AgentCapacity':function(_0x46ac08){var _0x2c3c4d=this;return new Promise(function(_0x109293,_0x324061){if(_0x2009f4[_0x20a7('0x3f')]['hasOwnProperty'](_0x46ac08['id'])){for(var _0x416383 in _0x46ac08['capacity']){if(_0x46ac08[_0x20a7('0x47')][_0x20a7('0x48')](_0x416383)){if(_0x2009f4['agents'][_0x46ac08['id']][_0x20a7('0x48')](_0x416383+_0x20a7('0x49'))){_0x2009f4[_0x20a7('0x3f')][_0x46ac08['id']][_0x416383+_0x20a7('0x49')]=parseInt(_0x46ac08[_0x20a7('0x47')][_0x416383],0xa);}}}_0x2009f4[_0x20a7('0x3f')][_0x46ac08['id']][_0x20a7('0x4a')]();return _0x109293({'code':0xc8,'message':_0x2009f4['agents'][_0x46ac08['id']]});}else{return _0x324061(_0x2c3c4d[_0x20a7('0x35')](0x1f4,_0x20a7('0x4b')));}});},'Agents':function(_0x11ae77){return new Promise(function(_0x5516ac){var _0x3f967b=_['values'](_0x2009f4[_0x20a7('0x3f')]);if(_0x11ae77&&_0x11ae77['id']){var _0x1b0558=_[_0x20a7('0x4c')](_0x3f967b,function(_0x39d6b9){return _0x39d6b9['id']===_0x11ae77['id'];});_0x5516ac(_0x1b0558);}else{_0x5516ac({'count':_0x3f967b['length'],'rows':_0x3f967b});}});},'ChatQueues':function(){return new Promise(function(_0x162d01){var _0x24bb33=[];for(var _0x37ef77 in _0x2009f4[_0x20a7('0x4d')]){if(_0x2009f4[_0x20a7('0x4d')][_0x20a7('0x48')](_0x37ef77)){var _0x367a5f=_0x2009f4[_0x20a7('0x4d')][_0x37ef77];var _0x2264a1={'id':_0x367a5f['id'],'available':_0x367a5f[_0x20a7('0x4e')],'loggedIn':_0x367a5f['loggedIn'],'name':_0x367a5f[_0x20a7('0x4f')],'paused':_0x367a5f[_0x20a7('0x50')],'waiting':_0x367a5f['waiting']};_0x24bb33[_0x20a7('0x20')](_0x2264a1);}}_0x162d01({'count':_0x24bb33[_0x20a7('0x22')],'rows':_0x24bb33});});},'MailQueues':function(){return new Promise(function(_0x470f1c){var _0x409931=[];for(var _0x3d205f in _0x2009f4['mailQueues']){if(_0x2009f4[_0x20a7('0x51')][_0x20a7('0x48')](_0x3d205f)){var _0xb9d00d=_0x2009f4[_0x20a7('0x51')][_0x3d205f];var _0xc2155a={'id':_0xb9d00d['id'],'available':_0xb9d00d[_0x20a7('0x4e')],'loggedIn':_0xb9d00d['loggedIn'],'name':_0xb9d00d[_0x20a7('0x4f')],'paused':_0xb9d00d[_0x20a7('0x50')],'waiting':_0xb9d00d[_0x20a7('0x52')]};_0x409931[_0x20a7('0x20')](_0xc2155a);}}_0x470f1c({'count':_0x409931['length'],'rows':_0x409931});});},'OpenchannelQueues':function(){return new Promise(function(_0x24a33a){var _0x7171af=[];for(var _0x3ee02d in _0x2009f4[_0x20a7('0x53')]){if(_0x2009f4[_0x20a7('0x53')][_0x20a7('0x48')](_0x3ee02d)){var _0x40841a=_0x2009f4[_0x20a7('0x53')][_0x3ee02d];var _0x4e6594={'id':_0x40841a['id'],'available':_0x40841a[_0x20a7('0x4e')],'loggedIn':_0x40841a[_0x20a7('0x54')],'name':_0x40841a['name'],'paused':_0x40841a['paused'],'waiting':_0x40841a[_0x20a7('0x52')]};_0x7171af[_0x20a7('0x20')](_0x4e6594);}}_0x24a33a({'count':_0x7171af['length'],'rows':_0x7171af});});},'SmsQueues':function(){return new Promise(function(_0x1b0175){var _0x53d103=[];for(var _0x2474f9 in _0x2009f4[_0x20a7('0x55')]){if(_0x2009f4[_0x20a7('0x55')][_0x20a7('0x48')](_0x2474f9)){var _0x542ce6=_0x2009f4[_0x20a7('0x55')][_0x2474f9];var _0x5935d6={'id':_0x542ce6['id'],'available':_0x542ce6[_0x20a7('0x4e')],'loggedIn':_0x542ce6[_0x20a7('0x54')],'name':_0x542ce6[_0x20a7('0x4f')],'paused':_0x542ce6[_0x20a7('0x50')],'waiting':_0x542ce6[_0x20a7('0x52')]};_0x53d103[_0x20a7('0x20')](_0x5935d6);}}_0x1b0175({'count':_0x53d103[_0x20a7('0x22')],'rows':_0x53d103});});},'FaxQueues':function(){return new Promise(function(_0x5c3794){var _0x27d4b6=[];for(var _0x57e5aa in _0x2009f4[_0x20a7('0x56')]){if(_0x2009f4['faxQueues'][_0x20a7('0x48')](_0x57e5aa)){var _0x9975af=_0x2009f4[_0x20a7('0x56')][_0x57e5aa];var _0xa5be={'id':_0x9975af['id'],'available':_0x9975af[_0x20a7('0x4e')],'loggedIn':_0x9975af[_0x20a7('0x54')],'name':_0x9975af[_0x20a7('0x4f')],'paused':_0x9975af[_0x20a7('0x50')],'waiting':_0x9975af[_0x20a7('0x52')]};_0x27d4b6['push'](_0xa5be);}}_0x5c3794({'count':_0x27d4b6[_0x20a7('0x22')],'rows':_0x27d4b6});});},'WhatsappQueues':function(){return new Promise(function(_0x464810){var _0x4bcd46=[];for(var _0x893cfb in _0x2009f4[_0x20a7('0x57')]){if(_0x2009f4['whatsappQueues'][_0x20a7('0x48')](_0x893cfb)){var _0x3cb35c=_0x2009f4[_0x20a7('0x57')][_0x893cfb];var _0x25e1e0={'id':_0x3cb35c['id'],'available':_0x3cb35c['available'],'loggedIn':_0x3cb35c[_0x20a7('0x54')],'name':_0x3cb35c[_0x20a7('0x4f')],'paused':_0x3cb35c[_0x20a7('0x50')],'waiting':_0x3cb35c[_0x20a7('0x52')]};_0x4bcd46[_0x20a7('0x20')](_0x25e1e0);}}_0x464810({'count':_0x4bcd46[_0x20a7('0x22')],'rows':_0x4bcd46});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x151cda){var _0x11ab64=_[_0x20a7('0x58')](_0x2009f4[_0x20a7('0x59')]);_0x151cda({'count':_0x11ab64[_0x20a7('0x22')],'rows':_0x11ab64});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x32ee04){var _0x4a24d4=_[_0x20a7('0x58')](_0x2009f4[_0x20a7('0x5a')]);_0x32ee04({'count':_0x4a24d4['length'],'rows':_0x4a24d4});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x37bb71){var _0x3be5a0=_['values'](_0x2009f4[_0x20a7('0x5b')]);_0x37bb71({'count':_0x3be5a0['length'],'rows':_0x3be5a0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x54ade1){var _0x467830=_[_0x20a7('0x58')](_0x2009f4['smsQueuesWaitingInteractions']);_0x54ade1({'count':_0x467830[_0x20a7('0x22')],'rows':_0x467830});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x543bf3){var _0x257cb3=_[_0x20a7('0x58')](_0x2009f4[_0x20a7('0x5c')]);_0x543bf3({'count':_0x257cb3[_0x20a7('0x22')],'rows':_0x257cb3});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1d4fac){var _0x4eba67=_[_0x20a7('0x58')](_0x2009f4[_0x20a7('0x5d')]);_0x1d4fac({'count':_0x4eba67[_0x20a7('0x22')],'rows':_0x4eba67});});}};var _0x51d024=jayson[_0x20a7('0x5e')](_0x11ccf0)['http']();_0x51d024['on'](_0x20a7('0x35'),function(_0x159f3a){logger[_0x20a7('0x35')](JSON['stringify'](_0x159f3a));return _0x3e4e1b(_0x159f3a);});_0x51d024[_0x20a7('0x11')](0x232c,_0x20a7('0x5f'),function(){console[_0x20a7('0x60')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5d5400(_0x20a7('0x61')+0x232c);});});};
\ No newline at end of file
index 9336b6e..c3a0d1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb4a=['indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','then'];(function(_0x45870a,_0x5c6ff0){var _0x4ec553=function(_0x41cb67){while(--_0x41cb67){_0x45870a['push'](_0x45870a['shift']());}};_0x4ec553(++_0x5c6ff0);}(_0xbb4a,0x12a));var _0xabb4=function(_0x3e250c,_0x11a4f5){_0x3e250c=_0x3e250c-0x0;var _0x517285=_0xbb4a[_0x3e250c];return _0x517285;};'use strict';var util=require('util');var BPromise=require(_0xabb4('0x0'));var jayson=require(_0xabb4('0x1'));var _=require(_0xabb4('0x2'));var logger=require(_0xabb4('0x3'))('routing');var client=jayson[_0xabb4('0x4')][_0xabb4('0x5')]({'port':0x232a});function request(_0x7bc486,_0xbfb824){return new BPromise(function(_0xa0d5d,_0x431064){return client[_0xabb4('0x6')](_0x7bc486,_0xbfb824)['then'](function(_0x9012b3){if(_0x9012b3['error']){return _0x431064(_0x9012b3[_0xabb4('0x7')][_0xabb4('0x8')]);}else{return _0xa0d5d(_0x9012b3[_0xabb4('0x9')]);}})[_0xabb4('0xa')](function(_0x43cb99){return _0x431064(_0x43cb99);});});}exports[_0xabb4('0xb')]=function(_0x58f7f4,_0x599cd6,_0xc2aa40){return function(_0x16b6b9){if(_0xc2aa40[_0xabb4('0xc')]&&!_0xc2aa40[_0xabb4('0xc')][_0x58f7f4]){logger[_0xabb4('0xd')](_0xabb4('0xe'),_0x58f7f4);return _0x16b6b9[_0xabb4('0xf')]();}var _0x431fc5=[];for(var _0x35ca5e=0x0;_0x35ca5e<_0x599cd6[_0xabb4('0x10')];_0x35ca5e+=0x1){_0x431fc5[_0xabb4('0x11')](request('Command',{'command':util[_0xabb4('0x12')](_0xabb4('0x13'),_0x599cd6[_0x35ca5e])})[_0xabb4('0x14')](function(_0x158bb4){return _0x158bb4&&_0x158bb4[_0xabb4('0x8')]&&_0x158bb4[_0xabb4('0x8')][_0xabb4('0x15')](_0xabb4('0x16'))>=0x0?!![]:![];})[_0xabb4('0xa')](function(_0x10bd3f){logger['error'](_0xabb4('0x17'),_0x58f7f4,_0x599cd6[_0x35ca5e]);}));}BPromise['all'](_0x431fc5)[_0xabb4('0x14')](function(_0x11fee4){var _0x7228ce=_[_0xabb4('0x18')](_0x11fee4);logger[_0xabb4('0xd')](_0xabb4('0x19'),_0x58f7f4,_0x599cd6[_0xabb4('0x1a')](_0xabb4('0x1b')),_0x7228ce);_0x16b6b9['when'](_0x7228ce);})['catch'](function(_0x3cc305){console[_0xabb4('0x1c')](_0x3cc305);logger['error'](_0xabb4('0x19'),_0x58f7f4,_0x599cd6[_0xabb4('0x1a')](_0xabb4('0x1b')),_0x3cc305['stack']);_0x16b6b9[_0xabb4('0xf')]();});};};
\ No newline at end of file
+var _0x4a08=['jayson/promise','lodash','routing','request','then','error','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','message','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','stack','bluebird'];(function(_0x2d86f3,_0x25775f){var _0x1ca140=function(_0x46e379){while(--_0x46e379){_0x2d86f3['push'](_0x2d86f3['shift']());}};_0x1ca140(++_0x25775f);}(_0x4a08,0x90));var _0x84a0=function(_0x121a1c,_0x409e77){_0x121a1c=_0x121a1c-0x0;var _0x2d44fc=_0x4a08[_0x121a1c];return _0x2d44fc;};'use strict';var util=require('util');var BPromise=require(_0x84a0('0x0'));var jayson=require(_0x84a0('0x1'));var _=require(_0x84a0('0x2'));var logger=require('../../../config/logger')(_0x84a0('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x3629a6,_0x42b66a){return new BPromise(function(_0x13bdc2,_0x599377){return client[_0x84a0('0x4')](_0x3629a6,_0x42b66a)[_0x84a0('0x5')](function(_0xf56e34){if(_0xf56e34[_0x84a0('0x6')]){return _0x599377(_0xf56e34[_0x84a0('0x6')]['message']);}else{return _0x13bdc2(_0xf56e34[_0x84a0('0x7')]);}})['catch'](function(_0x5912cd){return _0x599377(_0x5912cd);});});}exports[_0x84a0('0x8')]=function(_0x4f44d9,_0x952511,_0xc2bf0b){return function(_0x2e6628){if(_0xc2bf0b[_0x84a0('0x9')]&&!_0xc2bf0b[_0x84a0('0x9')][_0x4f44d9]){logger[_0x84a0('0xa')](_0x84a0('0xb'),_0x4f44d9);return _0x2e6628[_0x84a0('0xc')]();}var _0xb79452=[];for(var _0x4a4c9b=0x0;_0x4a4c9b<_0x952511['length'];_0x4a4c9b+=0x1){_0xb79452[_0x84a0('0xd')](request(_0x84a0('0xe'),{'command':util[_0x84a0('0xf')](_0x84a0('0x10'),_0x952511[_0x4a4c9b])})[_0x84a0('0x5')](function(_0x490440){return _0x490440&&_0x490440[_0x84a0('0x11')]&&_0x490440[_0x84a0('0x11')][_0x84a0('0x12')](_0x84a0('0x13'))>=0x0?!![]:![];})[_0x84a0('0x14')](function(_0x2b4259){logger[_0x84a0('0x6')](_0x84a0('0x15'),_0x4f44d9,_0x952511[_0x4a4c9b]);}));}BPromise[_0x84a0('0x16')](_0xb79452)[_0x84a0('0x5')](function(_0x50ae5f){var _0x5bba16=_[_0x84a0('0x17')](_0x50ae5f);logger[_0x84a0('0xa')](_0x84a0('0x18'),_0x4f44d9,_0x952511[_0x84a0('0x19')]('\x20|\x20'),_0x5bba16);_0x2e6628[_0x84a0('0x1a')](_0x5bba16);})[_0x84a0('0x14')](function(_0x5e3ad5){console[_0x84a0('0x1b')](_0x5e3ad5);logger['error'](_0x84a0('0x18'),_0x4f44d9,_0x952511[_0x84a0('0x19')]('\x20|\x20'),_0x5e3ad5[_0x84a0('0x1c')]);_0x2e6628['stop']();});};};
\ No newline at end of file
index 60bf749..48a8605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','diffTime','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','isNil','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone'];(function(_0x576ffd,_0x51a414){var _0x4a37f5=function(_0xbe373f){while(--_0xbe373f){_0x576ffd['push'](_0x576ffd['shift']());}};_0x4a37f5(++_0x51a414);}(_0x087b,0x11a));var _0xb087=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x087b[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f3606,_0x40e6d6){utils['info'](util[_0xb087('0x2')](_0xb087('0x3'),_0x5f3606[_0xb087('0x4')],_0x5f3606[_0xb087('0x5')],_0x5f3606[_0xb087('0x6')],_0x5f3606[_0xb087('0x7')],_0x5f3606[_0xb087('0x8')],_0x5f3606[_0xb087('0x9')],_0x5f3606[_0xb087('0xa')],_0x5f3606[_0xb087('0xb')]));if(_0x5f3606[_0xb087('0x6')]){utils[_0xb087('0xc')](_0x5f3606[_0xb087('0x6')])[_0xb087('0xd')](function(_0x2f14bc){if(_0x2f14bc){_0x5f3606[_0xb087('0xe')]=_0x2f14bc[_0xb087('0xe')];_0x5f3606['agentacw']=_0x5f3606[_0xb087('0xf')]?_0x2f14bc[_0xb087('0x10')]:![];_0x5f3606[_0xb087('0x11')]=_0x5f3606[_0xb087('0x12')]?_0x2f14bc[_0xb087('0x13')]:0x0;}utils[_0xb087('0x14')](_0xb087('0x15'),_0x5f3606);});}else{utils['request'](_0xb087('0x15'),_0x5f3606);}if(_0x40e6d6){delete transfers[_0x5f3606[_0xb087('0x4')]];}else{delete agents[_0x5f3606[_0xb087('0x16')]];}}exports['agentcalled']=function(_0x3001e3){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3[_0xb087('0x4')]),_0x3001e3);agents[_0x3001e3[_0xb087('0x16')]]=_0x3001e3;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x19')]=utils[_0xb087('0x1a')]();agents[_0x3001e3[_0xb087('0x16')]]['lastevent']=_0xb087('0x1b');agents[_0x3001e3[_0xb087('0x16')]]['connectedlinenum']=null;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x1c')]=null;utils[_0xb087('0x1d')](util['format'](_0xb087('0x1e'),_0x3001e3[_0xb087('0x4')],agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x7')],_0x3001e3['destuniqueid']));}catch(_0x13d534){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3['uniqueid']),_0x13d534);}};exports['agentringnoanswer']=function(_0x5ea3dc){try{if(!_['isNil'](agents[_0x5ea3dc[_0xb087('0x16')]])){utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc[_0xb087('0x4')]),_0x5ea3dc);utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5ea3dc[_0xb087('0x4')],agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x7')],_0x5ea3dc[_0xb087('0x16')]));agents[_0x5ea3dc[_0xb087('0x16')]]['agentringnoanswer']=!![];agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x21')]=utils['now']();agents[_0x5ea3dc['destuniqueid']]['lastevent']='timeout';agents[_0x5ea3dc['destuniqueid']][_0xb087('0x22')]=_0xb087('0x23');agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x24')]=_0x5ea3dc[_0xb087('0x25')]?parseInt(_0x5ea3dc[_0xb087('0x25')])/0x3e8:0x0;agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x26')]=0x0;unanswered[_0xb087('0x27')](_0x5ea3dc[_0xb087('0x16')]);}}catch(_0x18058c){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc['uniqueid']),_0x18058c);}};exports[_0xb087('0x28')]=function(_0x1335d9){try{_[_0xb087('0x29')](agents,function(_0x15c9ac,_0x22d441){if(_0x15c9ac[_0xb087('0x4')]==_0x1335d9[_0xb087('0x4')]&&!_[_0xb087('0x2a')](unanswered,_0x15c9ac['destuniqueid'])){utils['debug'](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9['uniqueid']),_0x1335d9);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x2c'),_0x1335d9[_0xb087('0x4')],_0x15c9ac[_0xb087('0x7')],_0x15c9ac[_0xb087('0x16')]));_0x15c9ac[_0xb087('0x2d')]=!![];_0x15c9ac[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0x15c9ac[_0xb087('0xb')]=_0xb087('0x2e');_0x15c9ac[_0xb087('0x22')]='abandoned';_0x15c9ac[_0xb087('0x24')]=_0x1335d9['holdtime'];_0x15c9ac[_0xb087('0x26')]=0x0;writeDB(_0x15c9ac);}});}catch(_0x296e9b){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9[_0xb087('0x4')]),_0x296e9b);}};exports[_0xb087('0x2f')]=function(_0x29df58){try{if(agents[_0x29df58[_0xb087('0x16')]]){utils['debug'](util['format'](_0xb087('0x30'),_0x29df58[_0xb087('0x4')]),_0x29df58);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x31'),_0x29df58['uniqueid'],agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x7')],_0x29df58['destuniqueid']));agents[_0x29df58['destuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();agents[_0x29df58[_0xb087('0x16')]]['connectedlinenum']=_0x29df58[_0xb087('0xa')];agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x1c')]=_0x29df58[_0xb087('0x1c')];agents[_0x29df58[_0xb087('0x16')]]['holdtime']=_0x29df58[_0xb087('0x25')];agents[_0x29df58['destuniqueid']][_0xb087('0xb')]='connect';_[_0xb087('0x29')](agents,function(_0xc9f9e9,_0x513332){if(_0xc9f9e9[_0xb087('0x16')]!=_0x29df58['destuniqueid']&&_0xc9f9e9[_0xb087('0x4')]==_0x29df58['uniqueid']){_0xc9f9e9[_0xb087('0x26')]=0x0;_0xc9f9e9[_0xb087('0x24')]=_0x29df58[_0xb087('0x25')];_0xc9f9e9[_0xb087('0x2d')]=!![];_0xc9f9e9[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0xc9f9e9[_0xb087('0xb')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x22')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x33')]=_0x29df58[_0xb087('0x16')];_0xc9f9e9['answeredelsewheremembername']=_0x29df58[_0xb087('0x7')];writeDB(_0xc9f9e9);}});}}catch(_0x45dc6f){utils[_0xb087('0x1f')](util['format'](_0xb087('0x30'),_0x29df58['uniqueid']),_0x45dc6f);}};exports[_0xb087('0xf')]=function(_0x32b9d3){try{if(!_['isNil'](agents[_0x32b9d3[_0xb087('0x16')]])){utils[_0xb087('0x17')](util['format'](_0xb087('0x34'),_0x32b9d3[_0xb087('0x4')]),_0x32b9d3);utils['info'](util[_0xb087('0x2')](_0xb087('0x35'),_0x32b9d3[_0xb087('0x4')],agents[_0x32b9d3[_0xb087('0x16')]]['membername'],_0x32b9d3['destuniqueid']));agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0xf')]=!![];agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x36')]=utils[_0xb087('0x1a')]();agents[_0x32b9d3[_0xb087('0x16')]]['talktime']=utils['diffTime'](agents[_0x32b9d3[_0xb087('0x16')]]['agentcompleteAt'],agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x32')]);agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x22')]=_0x32b9d3['reason'];agents[_0x32b9d3[_0xb087('0x16')]]['lastevent']=_0xb087('0x37');writeDB(agents[_0x32b9d3[_0xb087('0x16')]]);}}catch(_0xcb56c7){utils[_0xb087('0x1f')](util[_0xb087('0x2')]('[%s][agents][agentcomplete]',_0x32b9d3[_0xb087('0x4')]),_0xcb56c7);}};exports[_0xb087('0x38')]=function(_0x588d96){try{if(!_['isNil'](agents[_0x588d96[_0xb087('0x39')]])){utils['debug'](util['format'](_0xb087('0x3a'),_0x588d96[_0xb087('0x4')]),_0x588d96);utils['info'](util[_0xb087('0x2')](_0xb087('0x3b'),_0x588d96[_0xb087('0x4')],agents[_0x588d96['transfereruniqueid']]['membername'],agents[_0x588d96[_0xb087('0x39')]]['uniqueid']));agents[_0x588d96['transfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3d')]=_0xb087('0x3e');agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3f')]=_0x588d96[_0xb087('0x40')];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x41')]=agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x4')];}}catch(_0x2cfc44){utils['error'](util[_0xb087('0x2')](_0xb087('0x3a'),_0x588d96['uniqueid']),_0x2cfc44);}};exports[_0xb087('0x42')]=function(_0x458301){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x458301);if(_0x458301[_0xb087('0x44')]==_0x458301[_0xb087('0x45')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x47')]])){utils[_0xb087('0x1d')](util['format'](_0xb087('0x48'),_0x458301['origtransfereruniqueid'],agents[_0x458301[_0xb087('0x47')]]['membername']));agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3c')]=!![];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3d')]=_0xb087('0x49');agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3f')]=_0x458301[_0xb087('0x4a')];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x41')]=_0x458301[_0xb087('0x44')];}if(_0x458301[_0xb087('0x4b')]&&agents[_0x458301[_0xb087('0x4b')]]){agents[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x1;transfers[_0x458301[_0xb087('0x4b')]]=_[_0xb087('0x4d')](agents[_0x458301[_0xb087('0x4b')]]);transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x9')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x9')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x4e')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x19')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfereeuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301[_0xb087('0x4b')]]['holdtime']=0x0;transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x2;}}else if(_0x458301[_0xb087('0x47')]==_0x458301[_0xb087('0x4f')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x44')]])){utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x458301[_0xb087('0x44')],agents[_0x458301[_0xb087('0x44')]][_0xb087('0x7')]));agents[_0x458301['origtransfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x458301['origtransfereruniqueid']]['transfertype']=_0xb087('0x49');agents[_0x458301[_0xb087('0x44')]]['transferexten']=_0x458301[_0xb087('0x50')];agents[_0x458301['origtransfereruniqueid']][_0xb087('0x41')]=_0x458301[_0xb087('0x47')];}if(_0x458301['transfertargetuniqueid']&&agents[_0x458301['transfertargetuniqueid']]){agents[_0x458301[_0xb087('0x51')]]['agententerreason']=0x1;transfers[_0x458301['transfertargetuniqueid']]=_[_0xb087('0x4d')](agents[_0x458301['transfertargetuniqueid']]);transfers[_0x458301[_0xb087('0x51')]]['calleridnum']=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x9')];transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x4e')];transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x19')]=utils['now']();transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x24')]=0x0;transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x4c')]=0x2;}}}catch(_0x3784f7){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x3784f7);}};exports['hangup']=function(_0x245d68){try{utils[_0xb087('0x17')](util['format'](_0xb087('0x52'),_0x245d68['uniqueid']),_0x245d68);if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]===_0xb087('0x23')){if(_0x245d68[_0xb087('0x53')]==='21'){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x54');agents[_0x245d68['uniqueid']]['lastevent']='rejected';}utils[_0xb087('0x1d')](util['format'](_0xb087('0x55'),_0x245d68['uniqueid'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],agents[_0x245d68['uniqueid']][_0xb087('0xb')]));writeDB(agents[_0x245d68['uniqueid']]);var _0x185102=unanswered[_0xb087('0x56')](_0x245d68[_0xb087('0x4')]);if(_0x185102>-0x1){unanswered[_0xb087('0x57')](_0x185102,0x1);}}if(transfers[_0x245d68['uniqueid']]){transfers[_0x245d68['uniqueid']][_0xb087('0xf')]=!![];transfers[_0x245d68['uniqueid']][_0xb087('0x36')]=utils[_0xb087('0x1a')]();transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils['diffTime'](transfers[_0x245d68['uniqueid']][_0xb087('0x36')],transfers[_0x245d68['uniqueid']][_0xb087('0x32')]);transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x58');transfers[_0x245d68[_0xb087('0x4')]]['lastevent']=_0xb087('0x37');utils[_0xb087('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x245d68['uniqueid'],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(transfers[_0x245d68['uniqueid']],!![]);}if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x32')]){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xf')]=!![];agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x36')]=utils['now']();agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils[_0xb087('0x59')](agents[_0x245d68['uniqueid']][_0xb087('0x36')],agents[_0x245d68['uniqueid']][_0xb087('0x32')]);agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x3c')]?_0xb087('0x3c'):'agent';agents[_0x245d68['uniqueid']][_0xb087('0xb')]=_0xb087('0x37');utils['info'](util[_0xb087('0x2')](_0xb087('0x55'),_0x245d68[_0xb087('0x4')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]]['reason'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(agents[_0x245d68[_0xb087('0x4')]]);}}catch(_0x3114ce){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x52'),_0x245d68[_0xb087('0x4')]),_0x3114ce);}};
\ No newline at end of file
+var _0xa571=['calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','agententerreason'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa571,0x107));var _0x1a57=function(_0x3631b4,_0x487377){_0x3631b4=_0x3631b4-0x0;var _0x43b393=_0xa571[_0x3631b4];return _0x43b393;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var utils=require(_0x1a57('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1067d9,_0x48485e){utils[_0x1a57('0x3')](util[_0x1a57('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1067d9['uniqueid'],_0x1067d9[_0x1a57('0x5')],_0x1067d9['queue'],_0x1067d9[_0x1a57('0x6')],_0x1067d9[_0x1a57('0x7')],_0x1067d9[_0x1a57('0x8')],_0x1067d9[_0x1a57('0x9')],_0x1067d9[_0x1a57('0xa')]));if(_0x1067d9[_0x1a57('0xb')]){utils['getVoiceQueueByName'](_0x1067d9[_0x1a57('0xb')])[_0x1a57('0xc')](function(_0x3631d6){if(_0x3631d6){_0x1067d9['type']=_0x3631d6[_0x1a57('0xd')];_0x1067d9[_0x1a57('0xe')]=_0x1067d9[_0x1a57('0xf')]?_0x3631d6[_0x1a57('0x10')]:![];_0x1067d9[_0x1a57('0x11')]=_0x1067d9[_0x1a57('0xe')]?_0x3631d6[_0x1a57('0x12')]:0x0;}utils[_0x1a57('0x13')]('CreateVoiceAgentReport',_0x1067d9);});}else{utils['request'](_0x1a57('0x14'),_0x1067d9);}if(_0x48485e){delete transfers[_0x1067d9[_0x1a57('0x15')]];}else{delete agents[_0x1067d9[_0x1a57('0x16')]];}}exports['agentcalled']=function(_0x3de36a){try{utils[_0x1a57('0x17')](util['format'](_0x1a57('0x18'),_0x3de36a['uniqueid']),_0x3de36a);agents[_0x3de36a[_0x1a57('0x16')]]=_0x3de36a;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();agents[_0x3de36a['destuniqueid']][_0x1a57('0xa')]='called';agents[_0x3de36a['destuniqueid']][_0x1a57('0x9')]=null;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x1b')]=null;utils['info'](util[_0x1a57('0x4')](_0x1a57('0x1c'),_0x3de36a[_0x1a57('0x15')],agents[_0x3de36a['destuniqueid']][_0x1a57('0x6')],_0x3de36a[_0x1a57('0x16')]));}catch(_0x451b34){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentcalled]',_0x3de36a['uniqueid']),_0x451b34);}};exports[_0x1a57('0x1e')]=function(_0x21e811){try{if(!_[_0x1a57('0x1f')](agents[_0x21e811['destuniqueid']])){utils['debug'](util['format'](_0x1a57('0x20'),_0x21e811[_0x1a57('0x15')]),_0x21e811);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x21'),_0x21e811[_0x1a57('0x15')],agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x6')],_0x21e811[_0x1a57('0x16')]));agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x1e')]=!![];agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x22')]=utils[_0x1a57('0x1a')]();agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x24')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x25')]=_0x21e811['ringtime']?parseInt(_0x21e811['ringtime'])/0x3e8:0x0;agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x26')]=0x0;unanswered['push'](_0x21e811[_0x1a57('0x16')]);}}catch(_0x54f6a5){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentringnoanswer]',_0x21e811[_0x1a57('0x15')]),_0x54f6a5);}};exports[_0x1a57('0x27')]=function(_0x30527c){try{_[_0x1a57('0x28')](agents,function(_0x492b90,_0x366d5f){if(_0x492b90[_0x1a57('0x15')]==_0x30527c[_0x1a57('0x15')]&&!_[_0x1a57('0x29')](unanswered,_0x492b90['destuniqueid'])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0x30527c);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x2b'),_0x30527c[_0x1a57('0x15')],_0x492b90[_0x1a57('0x6')],_0x492b90['destuniqueid']));_0x492b90[_0x1a57('0x1e')]=!![];_0x492b90[_0x1a57('0x22')]=utils['now']();_0x492b90['lastevent']=_0x1a57('0x2c');_0x492b90[_0x1a57('0x24')]=_0x1a57('0x2c');_0x492b90[_0x1a57('0x25')]=_0x30527c[_0x1a57('0x25')];_0x492b90[_0x1a57('0x26')]=0x0;writeDB(_0x492b90);}});}catch(_0xe80d94){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0xe80d94);}};exports[_0x1a57('0x2d')]=function(_0x12f3a7){try{if(agents[_0x12f3a7[_0x1a57('0x16')]]){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x12f3a7);utils['info'](util[_0x1a57('0x4')](_0x1a57('0x2f'),_0x12f3a7[_0x1a57('0x15')],agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x6')],_0x12f3a7[_0x1a57('0x16')]));agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();agents[_0x12f3a7['destuniqueid']]['connectedlinenum']=_0x12f3a7['connectedlinenum'];agents[_0x12f3a7['destuniqueid']][_0x1a57('0x1b')]=_0x12f3a7[_0x1a57('0x1b')];agents[_0x12f3a7[_0x1a57('0x16')]]['holdtime']=_0x12f3a7[_0x1a57('0x31')];agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x32');_['forIn'](agents,function(_0x1be254,_0x5e79f0){if(_0x1be254[_0x1a57('0x16')]!=_0x12f3a7[_0x1a57('0x16')]&&_0x1be254[_0x1a57('0x15')]==_0x12f3a7['uniqueid']){_0x1be254[_0x1a57('0x26')]=0x0;_0x1be254[_0x1a57('0x25')]=_0x12f3a7[_0x1a57('0x31')];_0x1be254[_0x1a57('0x1e')]=!![];_0x1be254[_0x1a57('0x22')]=utils['now']();_0x1be254[_0x1a57('0xa')]='answered_elsewhere';_0x1be254['reason']=_0x1a57('0x33');_0x1be254['answeredelsewheredestinationuniqueid']=_0x12f3a7[_0x1a57('0x16')];_0x1be254[_0x1a57('0x34')]=_0x12f3a7[_0x1a57('0x6')];writeDB(_0x1be254);}});}}catch(_0x59abb1){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x59abb1);}};exports['agentcomplete']=function(_0xc7bab4){try{if(!_[_0x1a57('0x1f')](agents[_0xc7bab4['destuniqueid']])){utils[_0x1a57('0x17')](util['format']('[%s][agents][agentcomplete]',_0xc7bab4[_0x1a57('0x15')]),_0xc7bab4);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x35'),_0xc7bab4['uniqueid'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x6')],_0xc7bab4[_0x1a57('0x16')]));agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xf')]=!![];agents[_0xc7bab4['destuniqueid']][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x26')]=utils['diffTime'](agents[_0xc7bab4[_0x1a57('0x16')]]['agentcompleteAt'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x30')]);agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x24')]=_0xc7bab4[_0x1a57('0x24')];agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x37');writeDB(agents[_0xc7bab4[_0x1a57('0x16')]]);}}catch(_0x424065){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x38'),_0xc7bab4['uniqueid']),_0x424065);}};exports[_0x1a57('0x39')]=function(_0x480aff){try{if(!_[_0x1a57('0x1f')](agents[_0x480aff[_0x1a57('0x3a')]])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x480aff);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x3c'),_0x480aff['uniqueid'],agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x6')],agents[_0x480aff['transfereruniqueid']][_0x1a57('0x15')]));agents[_0x480aff[_0x1a57('0x3a')]]['transfer']=!![];agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x3d')]='blind';agents[_0x480aff['transfereruniqueid']]['transferexten']=_0x480aff[_0x1a57('0x3e')];agents[_0x480aff[_0x1a57('0x3a')]]['transferuniqueid']=agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x15')];}}catch(_0x572202){utils['error'](util['format'](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x572202);}};exports[_0x1a57('0x3f')]=function(_0x31be00){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x31be00);if(_0x31be00['origtransfereruniqueid']==_0x31be00['origtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00['secondtransfereruniqueid']])){utils['info'](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x6')]));agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x44')]=!![];agents[_0x31be00[_0x1a57('0x43')]]['transfertype']='ATTENDED';agents[_0x31be00['secondtransfereruniqueid']][_0x1a57('0x45')]=_0x31be00['origtransfererexten'];agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x41')];}if(_0x31be00[_0x1a57('0x47')]&&agents[_0x31be00[_0x1a57('0x47')]]){agents[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x48')]=0x1;transfers[_0x31be00['transfereeuniqueid']]=_['clone'](agents[_0x31be00['transfereeuniqueid']]);transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x49')]=agents[_0x31be00[_0x1a57('0x43')]]['calleridname'];transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]]['holdtime']=0x0;transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x48')]=0x2;}}else if(_0x31be00[_0x1a57('0x43')]==_0x31be00['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00[_0x1a57('0x41')]])){utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x6')]));agents[_0x31be00['origtransfereruniqueid']]['transfer']=!![];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x3d')]=_0x1a57('0x4a');agents[_0x31be00[_0x1a57('0x41')]]['transferexten']=_0x31be00[_0x1a57('0x4b')];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x43')];}if(_0x31be00[_0x1a57('0x4c')]&&agents[_0x31be00['transfertargetuniqueid']]){agents[_0x31be00['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x31be00[_0x1a57('0x4c')]]=_[_0x1a57('0x4d')](agents[_0x31be00[_0x1a57('0x4c')]]);transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x4c')]]['calleridname']=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x49')];transfers[_0x31be00['transfertargetuniqueid']]['agentcalledAt']=utils[_0x1a57('0x1a')]();transfers[_0x31be00['transfertargetuniqueid']][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x25')]=0x0;transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x48')]=0x2;}}}catch(_0x213576){utils[_0x1a57('0x1d')](util['format'](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x213576);}};exports['hangup']=function(_0x24b56c){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')]('[%s][agents][hangup]',_0x24b56c['uniqueid']),_0x24b56c);if(agents[_0x24b56c[_0x1a57('0x15')]]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]===_0x1a57('0x23')){if(_0x24b56c['cause']==='21'){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]=_0x1a57('0x4e');agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]='rejected';}utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x6')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);var _0x48a10e=unanswered[_0x1a57('0x50')](_0x24b56c[_0x1a57('0x15')]);if(_0x48a10e>-0x1){unanswered['splice'](_0x48a10e,0x1);}}if(transfers[_0x24b56c[_0x1a57('0x15')]]){transfers[_0x24b56c[_0x1a57('0x15')]]['agentcomplete']=!![];transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x26')]=utils[_0x1a57('0x51')](transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],transfers[_0x24b56c['uniqueid']][_0x1a57('0x30')]);transfers[_0x24b56c[_0x1a57('0x15')]]['reason']=_0x1a57('0x52');transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]=_0x1a57('0x37');utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],transfers[_0x24b56c[_0x1a57('0x15')]]['membername'],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(transfers[_0x24b56c[_0x1a57('0x15')]],!![]);}if(agents[_0x24b56c['uniqueid']]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x30')]){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xf')]=!![];agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0x24b56c[_0x1a57('0x15')]]['talktime']=utils[_0x1a57('0x51')](agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],agents[_0x24b56c[_0x1a57('0x15')]]['agentconnectAt']);agents[_0x24b56c['uniqueid']]['reason']=agents[_0x24b56c['uniqueid']]['transfer']?_0x1a57('0x44'):_0x1a57('0x52');agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]=_0x1a57('0x37');utils['info'](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]]['membername'],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);}}catch(_0x42d41e){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x53'),_0x24b56c[_0x1a57('0x15')]),_0x42d41e);}};
\ No newline at end of file
index 3625d29..d6bd1e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b7=['xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','lastIndexOf','hangup','noop','gotoif','[%s][calls][newexten]','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','format','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','channelstate','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','billableseconds','attendedtransfer','origtransfereruniqueid','localtwolinkedid','secondtransfererchannel','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable'];(function(_0x4102ff,_0x40e032){var _0x46990f=function(_0x59abde){while(--_0x59abde){_0x4102ff['push'](_0x4102ff['shift']());}};_0x46990f(++_0x40e032);}(_0x29b7,0x17d));var _0x729b=function(_0x4cef93,_0xad914f){_0x4cef93=_0x4cef93-0x0;var _0x21ddb4=_0x29b7[_0x4cef93];return _0x21ddb4;};'use strict';var _=require('lodash');var util=require(_0x729b('0x0'));var utils=require(_0x729b('0x1'));var transfers=require(_0x729b('0x2'));var dispositions=[_0x729b('0x3'),_0x729b('0x4'),_0x729b('0x4'),_0x729b('0x3'),_0x729b('0x3'),'NO\x20ANSWER',_0x729b('0x5'),_0x729b('0x6'),'FAILED',_0x729b('0x4'),_0x729b('0x4')];var channels={};function writeDB(_0xf72e6d){var _0x2c4252;if(transfers['blinds'][_0xf72e6d[_0x729b('0x7')]]){_0x2c4252=_0xf72e6d[_0x729b('0x7')];_0xf72e6d[_0x729b('0x7')]=transfers[_0x729b('0x8')][_0xf72e6d[_0x729b('0x7')]][_0x729b('0x9')];}utils['info'](util[_0x729b('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xf72e6d[_0x729b('0x7')],_0xf72e6d[_0x729b('0xb')],_0xf72e6d[_0x729b('0xc')],_0xf72e6d['membername'],_0xf72e6d[_0x729b('0xd')],_0xf72e6d[_0x729b('0xe')],_0xf72e6d[_0x729b('0xf')],_0xf72e6d[_0x729b('0x10')]));if(_0xf72e6d[_0x729b('0x11')]){utils['getUserByInternal'](_0xf72e6d[_0x729b('0x11')])[_0x729b('0x12')](function(_0x56883a){if(_0x56883a){_0xf72e6d[_0x729b('0x13')]=_0x56883a['id'];}utils[_0x729b('0x14')](_0x729b('0x15'),_0xf72e6d);});}else{utils[_0x729b('0x14')](_0x729b('0x15'),_0xf72e6d);}if(channels[_0xf72e6d['uniqueid']]){delete channels[_0xf72e6d['uniqueid']];}else if(_0x2c4252&&channels[_0x2c4252]){if(!transfers[_0x729b('0x8')][_0x2c4252][_0x729b('0x16')])delete transfers[_0x729b('0x8')][_0x2c4252];delete channels[_0x2c4252];}}exports[_0x729b('0x17')]=function(_0x584c7d){try{utils[_0x729b('0x18')](util[_0x729b('0xa')]('[%s][calls][newchannel]',_0x584c7d[_0x729b('0x7')]),_0x584c7d);if(_0x584c7d[_0x729b('0x7')]==_0x584c7d[_0x729b('0x19')]&&_0x584c7d[_0x729b('0xb')]!=_0x729b('0x1a')){utils['info'](util[_0x729b('0xa')](_0x729b('0x1b'),_0x584c7d['uniqueid'],_0x584c7d[_0x729b('0x1c')],_0x584c7d[_0x729b('0x1d')]));channels[_0x584c7d['uniqueid']]={'uniqueid':_0x584c7d['uniqueid'],'accountcode':_0x584c7d[_0x729b('0x11')],'source':_0x584c7d[_0x729b('0xe')],'destination':_0x584c7d[_0x729b('0x1d')],'destinationcontext':_0x584c7d[_0x729b('0x1c')],'channel':_0x584c7d[_0x729b('0xb')],'starttime':utils[_0x729b('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x729b('0x3'),'amaflags':_0x729b('0x1f')};}}catch(_0x5d2a27){utils[_0x729b('0x20')](util[_0x729b('0xa')](_0x729b('0x21'),_0x584c7d[_0x729b('0x7')]),_0x5d2a27);}};exports[_0x729b('0x22')]=function(_0x51608f){try{utils[_0x729b('0x18')](util[_0x729b('0xa')]('[%s][calls][newstate]',_0x51608f[_0x729b('0x7')]),_0x51608f);if(!_['isNil'](channels[_0x51608f['uniqueid']])&&_0x51608f[_0x729b('0x23')]==0x6){utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x25'),_0x51608f[_0x729b('0x7')],_0x51608f['context'],_0x51608f[_0x729b('0xb')]));if(_[_0x729b('0x26')](channels[_0x51608f[_0x729b('0x7')]][_0x729b('0x27')])){channels[_0x51608f[_0x729b('0x7')]][_0x729b('0x27')]=utils[_0x729b('0x1e')]();}}else if(!_[_0x729b('0x26')](channels[_0x51608f['linkedid']])&&_0x51608f[_0x729b('0x23')]==0x6&&_0x51608f[_0x729b('0x1c')]!=_0x729b('0x28')){utils['info'](util[_0x729b('0xa')](_0x729b('0x29'),_0x51608f[_0x729b('0x7')],_0x51608f['linkedid'],_0x51608f[_0x729b('0x1c')],_0x51608f[_0x729b('0xb')]));channels[_0x51608f['linkedid']][_0x729b('0x11')]=_0x51608f['accountcode'];channels[_0x51608f[_0x729b('0x19')]][_0x729b('0x2a')]=_0x51608f['channel'];if(_[_0x729b('0x26')](channels[_0x51608f[_0x729b('0x19')]][_0x729b('0x2b')])){channels[_0x51608f[_0x729b('0x19')]][_0x729b('0x2b')]=utils[_0x729b('0x1e')]();}channels[_0x51608f['linkedid']][_0x729b('0x2c')]=dispositions[_[_0x729b('0x2d')](_0x51608f[_0x729b('0x23')])]||_0x729b('0x5');}}catch(_0x260adf){utils[_0x729b('0x20')](util['format'](_0x729b('0x2e'),_0x51608f[_0x729b('0x7')]),_0x260adf);}};exports['hangup']=function(_0x372c9e){try{if(!_[_0x729b('0x26')](channels[_0x372c9e['uniqueid']])){utils[_0x729b('0x18')](util[_0x729b('0xa')](_0x729b('0x2f'),_0x372c9e[_0x729b('0x7')]),_0x372c9e);if(_[_0x729b('0x26')](channels[_0x372c9e[_0x729b('0x7')]][_0x729b('0x30')])){channels[_0x372c9e[_0x729b('0x7')]][_0x729b('0x30')]=_0x372c9e[_0x729b('0x31')]+'\x20<'+_0x372c9e['calleridnum']+'>';}utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x32'),_0x372c9e[_0x729b('0x7')],channels[_0x372c9e['uniqueid']][_0x729b('0x30')],_0x372c9e[_0x729b('0x33')]));channels[_0x372c9e[_0x729b('0x7')]]['endtime']=utils['now']();channels[_0x372c9e[_0x729b('0x7')]][_0x729b('0x34')]=utils['diffTime'](channels[_0x372c9e[_0x729b('0x7')]][_0x729b('0x35')],channels[_0x372c9e[_0x729b('0x7')]][_0x729b('0x36')]);channels[_0x372c9e['uniqueid']][_0x729b('0x37')]=channels[_0x372c9e[_0x729b('0x7')]][_0x729b('0x2b')]?utils['diffTime'](channels[_0x372c9e['uniqueid']][_0x729b('0x35')],channels[_0x372c9e[_0x729b('0x7')]]['answertime']):0x0;writeDB(channels[_0x372c9e[_0x729b('0x7')]]);}}catch(_0x2a3316){utils[_0x729b('0x20')](util['format'](_0x729b('0x2f'),_0x372c9e['uniqueid']),_0x2a3316);}};exports[_0x729b('0x38')]=function(_0x363a7e){try{if(!_[_0x729b('0x26')](channels[_0x363a7e['localtwolinkedid']])){utils[_0x729b('0x18')](util[_0x729b('0xa')]('[%s][calls][attendedtransfer]',_0x363a7e[_0x729b('0x39')]),_0x363a7e);if(channels[_0x363a7e[_0x729b('0x3a')]][_0x729b('0xb')]==_0x363a7e['transfereechannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x363a7e[_0x729b('0x39')],_0x363a7e[_0x729b('0x3a')],_0x363a7e[_0x729b('0x3b')]));channels[_0x363a7e['localtwolinkedid']]['destinationchannel']=_0x363a7e[_0x729b('0x3b')];channels[_0x363a7e[_0x729b('0x3a')]]['userfield']=_0x729b('0x3c');}else if(channels[_0x363a7e[_0x729b('0x3a')]][_0x729b('0xb')]=_0x363a7e['transfertargetchannel']){utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x3d'),_0x363a7e[_0x729b('0x39')],_0x363a7e[_0x729b('0x3a')],_0x363a7e[_0x729b('0x3e')]));channels[_0x363a7e[_0x729b('0x3a')]][_0x729b('0x2a')]=_0x363a7e[_0x729b('0x3e')];channels[_0x363a7e[_0x729b('0x3a')]]['userfield']=_0x729b('0x3c');}}}catch(_0x2ed092){utils['error'](util['format'](_0x729b('0x3f'),_0x363a7e['origtransfereruniqueid']),_0x2ed092);}};exports['musiconholdstart']=function(_0x83a3de){try{if(!_[_0x729b('0x26')](channels[_0x83a3de[_0x729b('0x7')]])){utils['debug'](util['format'](_0x729b('0x40'),_0x83a3de[_0x729b('0x7')]),_0x83a3de);channels[_0x83a3de[_0x729b('0x7')]][_0x729b('0x41')]=utils[_0x729b('0x1e')]();utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x42'),_0x83a3de[_0x729b('0x7')],channels[_0x83a3de[_0x729b('0x7')]][_0x729b('0x41')]));}}catch(_0x32ba0b){utils['error'](util[_0x729b('0xa')](_0x729b('0x40'),_0x83a3de[_0x729b('0x7')]),_0x32ba0b);}};exports[_0x729b('0x43')]=function(_0x30b05b){try{if(!_['isNil'](channels[_0x30b05b[_0x729b('0x7')]])){utils[_0x729b('0x18')](util['format'](_0x729b('0x44'),_0x30b05b[_0x729b('0x7')]),_0x30b05b);if(!_[_0x729b('0x26')](channels[_0x30b05b[_0x729b('0x7')]][_0x729b('0x41')])){channels[_0x30b05b[_0x729b('0x7')]]['mohtime']+=utils[_0x729b('0x45')](utils['now'](),channels[_0x30b05b[_0x729b('0x7')]][_0x729b('0x41')]);utils['info'](util['format'](_0x729b('0x46'),_0x30b05b[_0x729b('0x7')],channels[_0x30b05b[_0x729b('0x7')]][_0x729b('0x47')]));delete channels[_0x30b05b[_0x729b('0x7')]]['musiconholdstartAt'];}}}catch(_0x565ab1){utils[_0x729b('0x20')](util[_0x729b('0xa')]('[%s][calls][musiconholdstop]',_0x30b05b[_0x729b('0x7')]),_0x565ab1);}};exports[_0x729b('0x48')]=function(_0x5ca1e2){try{if(!_[_0x729b('0x26')](channels[_0x5ca1e2[_0x729b('0x7')]])){utils[_0x729b('0x18')](util[_0x729b('0xa')](_0x729b('0x49'),_0x5ca1e2[_0x729b('0x7')]),_0x5ca1e2);if(!_[_0x729b('0x26')](_0x5ca1e2['variable'][_0x729b('0x4a')])){utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x4b'),_0x5ca1e2[_0x729b('0x7')],_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2['uniqueid']][_0x729b('0x4d')]=_0x5ca1e2[_0x729b('0x4c')];}if(!_['isNil'](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x4f')])){utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x50'),_0x5ca1e2[_0x729b('0x7')],_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2[_0x729b('0x7')]][_0x729b('0x51')]=_0x5ca1e2['value'];channels[_0x5ca1e2[_0x729b('0x7')]][_0x729b('0x30')]='\x22'+_0x5ca1e2[_0x729b('0x4c')]+_0x729b('0x52')+_0x5ca1e2['value']+'>';}if(!_['isNil'](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x53')])||!_[_0x729b('0x26')](_0x5ca1e2['variable']['xmd-callerid'])){utils['info'](util['format'](_0x729b('0x54'),_0x5ca1e2['uniqueid'],!_[_0x729b('0x26')](_0x5ca1e2['variable'][_0x729b('0x53')])?_0x729b('0x53'):_0x729b('0x55'),_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2['uniqueid']][_0x729b('0x30')]=_0x5ca1e2[_0x729b('0x4c')];}if(!_['isNil'](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x56')])||!_['isNil'](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x57')])){utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x54'),_0x5ca1e2[_0x729b('0x7')],!_[_0x729b('0x26')](_0x5ca1e2['variable'][_0x729b('0x56')])?_0x729b('0x56'):_0x729b('0x57'),_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2['uniqueid']][_0x729b('0x58')]=_0x729b('0x59');channels[_0x5ca1e2[_0x729b('0x7')]][_0x729b('0x5a')]=_0x5ca1e2[_0x729b('0x4c')];channels[_0x5ca1e2[_0x729b('0x7')]][_0x729b('0xc')]=!![];}if(!_[_0x729b('0x26')](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x5b')])){utils[_0x729b('0x24')](util[_0x729b('0xa')](_0x729b('0x5c'),_0x5ca1e2['uniqueid'],_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2['uniqueid']][_0x729b('0x5d')]=_0x5ca1e2[_0x729b('0x4c')];}if(!_[_0x729b('0x26')](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x5e')])){utils['info'](util[_0x729b('0xa')](_0x729b('0x5f'),_0x5ca1e2[_0x729b('0x7')],_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2['uniqueid']][_0x729b('0x60')]=_0x5ca1e2[_0x729b('0x4c')];}if(!_[_0x729b('0x26')](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x61')])){utils[_0x729b('0x24')](util['format'](_0x729b('0x62'),_0x5ca1e2[_0x729b('0x7')],_0x5ca1e2['value']));channels[_0x5ca1e2['uniqueid']][_0x729b('0x63')]=_0x5ca1e2[_0x729b('0x4c')];}if(!_[_0x729b('0x26')](_0x5ca1e2[_0x729b('0x4e')][_0x729b('0x64')])){utils['info'](util['format'](_0x729b('0x65'),_0x5ca1e2[_0x729b('0x7')],_0x5ca1e2[_0x729b('0x4c')]));channels[_0x5ca1e2[_0x729b('0x7')]]['sipcallid']=_0x5ca1e2[_0x729b('0x4c')];}}}catch(_0x5cfdd8){utils[_0x729b('0x20')](util[_0x729b('0xa')]('[%s][calls][varset]',_0x5ca1e2[_0x729b('0x7')]),_0x5cfdd8);}};exports[_0x729b('0x66')]=function(_0x147075){try{if(!_[_0x729b('0x26')](channels[_0x147075[_0x729b('0x7')]])){utils[_0x729b('0x18')](util[_0x729b('0xa')]('[%s][calls][newexten]',_0x147075[_0x729b('0x7')]),_0x147075);utils['info'](util[_0x729b('0xa')](_0x729b('0x67'),_0x147075['uniqueid'],_0x147075[_0x729b('0x68')],_0x147075[_0x729b('0x69')]));if(_0x147075[_0x729b('0x68')]['toLowerCase']()==_0x729b('0x6a')&&_[_0x729b('0x6b')](_0x147075[_0x729b('0x69')][_0x729b('0x6c')](),_0x729b('0x6d'))){var _0x3d2b37=_0x147075['appdata']['split']('=');var _0xf5987f=_0x3d2b37[0x0]['substring'](_0x3d2b37[0x0]['lastIndexOf']('(')+0x1,_0x3d2b37[0x0][_0x729b('0x6e')](')'));var _0x538a74=_0x3d2b37[0x1];channels[_0x147075[_0x729b('0x7')]][_0xf5987f]=_0x538a74;}if(!_['includes']([_0x729b('0x6f'),_0x729b('0x70'),'execif',_0x729b('0x6a'),_0x729b('0x71')],_0x147075[_0x729b('0x68')][_0x729b('0x6c')]())){channels[_0x147075[_0x729b('0x7')]][_0x729b('0x58')]=_0x147075[_0x729b('0x68')];channels[_0x147075[_0x729b('0x7')]][_0x729b('0x5a')]=_0x147075[_0x729b('0x69')];}}}catch(_0x42118e){utils[_0x729b('0x20')](util[_0x729b('0xa')](_0x729b('0x72'),_0x147075[_0x729b('0x7')]),_0x42118e);}};
\ No newline at end of file
+var _0x9de1=['[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','now','DOCUMENTATION','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','lastIndexOf','includes','noop','execif','set','lastapplication','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','connectedlinenum','accountcode','then','CreateVoiceCallReport','request','newchannel','channel'];(function(_0x178eb3,_0x3e99ab){var _0x399a6e=function(_0x4ae2f2){while(--_0x4ae2f2){_0x178eb3['push'](_0x178eb3['shift']());}};_0x399a6e(++_0x3e99ab);}(_0x9de1,0xc4));var _0x19de=function(_0x58b196,_0x2aaec0){_0x58b196=_0x58b196-0x0;var _0x55332e=_0x9de1[_0x58b196];return _0x55332e;};'use strict';var _=require('lodash');var util=require(_0x19de('0x0'));var utils=require(_0x19de('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x19de('0x2'),_0x19de('0x3'),_0x19de('0x3'),_0x19de('0x2'),'NO\x20ANSWER',_0x19de('0x2'),_0x19de('0x4'),'BUSY','FAILED','FAILED','FAILED'];var channels={};function writeDB(_0x47691d){var _0x5427a6;if(transfers['blinds'][_0x47691d[_0x19de('0x5')]]){_0x5427a6=_0x47691d['uniqueid'];_0x47691d[_0x19de('0x5')]=transfers[_0x19de('0x6')][_0x47691d[_0x19de('0x5')]]['transfereeuniqueid'];}utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x9'),_0x47691d[_0x19de('0x5')],_0x47691d['channel'],_0x47691d[_0x19de('0xa')],_0x47691d[_0x19de('0xb')],_0x47691d[_0x19de('0xc')],_0x47691d['calleridnum'],_0x47691d[_0x19de('0xd')],_0x47691d['lastevent']));if(_0x47691d[_0x19de('0xe')]){utils['getUserByInternal'](_0x47691d['accountcode'])[_0x19de('0xf')](function(_0x4cc20e){if(_0x4cc20e){_0x47691d['UserId']=_0x4cc20e['id'];}utils['request'](_0x19de('0x10'),_0x47691d);});}else{utils[_0x19de('0x11')](_0x19de('0x10'),_0x47691d);}if(channels[_0x47691d[_0x19de('0x5')]]){delete channels[_0x47691d[_0x19de('0x5')]];}else if(_0x5427a6&&channels[_0x5427a6]){if(!transfers[_0x19de('0x6')][_0x5427a6]['recording'])delete transfers[_0x19de('0x6')][_0x5427a6];delete channels[_0x5427a6];}}exports[_0x19de('0x12')]=function(_0x1bffa1){try{utils['debug'](util[_0x19de('0x8')]('[%s][calls][newchannel]',_0x1bffa1[_0x19de('0x5')]),_0x1bffa1);if(_0x1bffa1[_0x19de('0x5')]==_0x1bffa1['linkedid']&&_0x1bffa1[_0x19de('0x13')]!='OutgoingSpoolFailed'){utils['info'](util[_0x19de('0x8')](_0x19de('0x14'),_0x1bffa1[_0x19de('0x5')],_0x1bffa1[_0x19de('0x15')],_0x1bffa1['exten']));channels[_0x1bffa1[_0x19de('0x5')]]={'uniqueid':_0x1bffa1[_0x19de('0x5')],'accountcode':_0x1bffa1['accountcode'],'source':_0x1bffa1[_0x19de('0x16')],'destination':_0x1bffa1[_0x19de('0x17')],'destinationcontext':_0x1bffa1[_0x19de('0x15')],'channel':_0x1bffa1['channel'],'starttime':utils[_0x19de('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x19de('0x2'),'amaflags':_0x19de('0x19')};}}catch(_0x169002){utils['error'](util['format']('[%s][calls][newchannel]',_0x1bffa1[_0x19de('0x5')]),_0x169002);}};exports[_0x19de('0x1a')]=function(_0x46727b){try{utils[_0x19de('0x1b')](util[_0x19de('0x8')]('[%s][calls][newstate]',_0x46727b[_0x19de('0x5')]),_0x46727b);if(!_[_0x19de('0x1c')](channels[_0x46727b[_0x19de('0x5')]])&&_0x46727b[_0x19de('0x1d')]==0x6){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x1e'),_0x46727b[_0x19de('0x5')],_0x46727b[_0x19de('0x15')],_0x46727b['channel']));if(_[_0x19de('0x1c')](channels[_0x46727b[_0x19de('0x5')]][_0x19de('0x1f')])){channels[_0x46727b['uniqueid']][_0x19de('0x1f')]=utils[_0x19de('0x18')]();}}else if(!_[_0x19de('0x1c')](channels[_0x46727b['linkedid']])&&_0x46727b[_0x19de('0x1d')]==0x6&&_0x46727b[_0x19de('0x15')]!=_0x19de('0x20')){utils['info'](util[_0x19de('0x8')](_0x19de('0x21'),_0x46727b['uniqueid'],_0x46727b[_0x19de('0x22')],_0x46727b[_0x19de('0x15')],_0x46727b[_0x19de('0x13')]));channels[_0x46727b['linkedid']][_0x19de('0xe')]=_0x46727b[_0x19de('0xe')];channels[_0x46727b[_0x19de('0x22')]][_0x19de('0x23')]=_0x46727b[_0x19de('0x13')];if(_[_0x19de('0x1c')](channels[_0x46727b[_0x19de('0x22')]][_0x19de('0x24')])){channels[_0x46727b[_0x19de('0x22')]][_0x19de('0x24')]=utils[_0x19de('0x18')]();}channels[_0x46727b[_0x19de('0x22')]][_0x19de('0x25')]=dispositions[_[_0x19de('0x26')](_0x46727b[_0x19de('0x1d')])]||_0x19de('0x4');}}catch(_0x304fef){utils[_0x19de('0x27')](util[_0x19de('0x8')]('[%s][calls][newstate]',_0x46727b[_0x19de('0x5')]),_0x304fef);}};exports[_0x19de('0x28')]=function(_0x12e91c){try{if(!_[_0x19de('0x1c')](channels[_0x12e91c[_0x19de('0x5')]])){utils[_0x19de('0x1b')](util['format'](_0x19de('0x29'),_0x12e91c[_0x19de('0x5')]),_0x12e91c);if(_[_0x19de('0x1c')](channels[_0x12e91c[_0x19de('0x5')]]['callerid'])){channels[_0x12e91c[_0x19de('0x5')]][_0x19de('0x2a')]=_0x12e91c[_0x19de('0x2b')]+'\x20<'+_0x12e91c[_0x19de('0x16')]+'>';}utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x2c'),_0x12e91c['uniqueid'],channels[_0x12e91c[_0x19de('0x5')]][_0x19de('0x2a')],_0x12e91c[_0x19de('0x2d')]));channels[_0x12e91c[_0x19de('0x5')]]['endtime']=utils[_0x19de('0x18')]();channels[_0x12e91c[_0x19de('0x5')]][_0x19de('0x2e')]=utils['diffTime'](channels[_0x12e91c[_0x19de('0x5')]][_0x19de('0x2f')],channels[_0x12e91c[_0x19de('0x5')]][_0x19de('0x30')]);channels[_0x12e91c[_0x19de('0x5')]][_0x19de('0x31')]=channels[_0x12e91c[_0x19de('0x5')]]['answertime']?utils[_0x19de('0x32')](channels[_0x12e91c[_0x19de('0x5')]]['endtime'],channels[_0x12e91c[_0x19de('0x5')]]['answertime']):0x0;writeDB(channels[_0x12e91c[_0x19de('0x5')]]);}}catch(_0x3c45e7){utils[_0x19de('0x27')](util['format'](_0x19de('0x29'),_0x12e91c[_0x19de('0x5')]),_0x3c45e7);}};exports[_0x19de('0x33')]=function(_0x4c7643){try{if(!_[_0x19de('0x1c')](channels[_0x4c7643['localtwolinkedid']])){utils[_0x19de('0x1b')](util[_0x19de('0x8')]('[%s][calls][attendedtransfer]',_0x4c7643[_0x19de('0x34')]),_0x4c7643);if(channels[_0x4c7643[_0x19de('0x35')]]['channel']==_0x4c7643[_0x19de('0x36')]){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x37'),_0x4c7643[_0x19de('0x34')],_0x4c7643[_0x19de('0x35')],_0x4c7643['secondtransfererchannel']));channels[_0x4c7643[_0x19de('0x35')]][_0x19de('0x23')]=_0x4c7643['secondtransfererchannel'];channels[_0x4c7643[_0x19de('0x35')]]['userfield']=_0x19de('0x38');}else if(channels[_0x4c7643[_0x19de('0x35')]]['channel']=_0x4c7643[_0x19de('0x39')]){utils[_0x19de('0x7')](util[_0x19de('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4c7643[_0x19de('0x34')],_0x4c7643[_0x19de('0x35')],_0x4c7643[_0x19de('0x3a')]));channels[_0x4c7643['localtwolinkedid']][_0x19de('0x23')]=_0x4c7643[_0x19de('0x3a')];channels[_0x4c7643[_0x19de('0x35')]][_0x19de('0x3b')]=_0x19de('0x38');}}}catch(_0xa1c9f0){utils[_0x19de('0x27')](util[_0x19de('0x8')](_0x19de('0x3c'),_0x4c7643['origtransfereruniqueid']),_0xa1c9f0);}};exports[_0x19de('0x3d')]=function(_0x139723){try{if(!_[_0x19de('0x1c')](channels[_0x139723[_0x19de('0x5')]])){utils['debug'](util[_0x19de('0x8')](_0x19de('0x3e'),_0x139723[_0x19de('0x5')]),_0x139723);channels[_0x139723[_0x19de('0x5')]][_0x19de('0x3f')]=utils[_0x19de('0x18')]();utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x40'),_0x139723[_0x19de('0x5')],channels[_0x139723['uniqueid']][_0x19de('0x3f')]));}}catch(_0x52fac9){utils['error'](util[_0x19de('0x8')](_0x19de('0x3e'),_0x139723[_0x19de('0x5')]),_0x52fac9);}};exports['musiconholdstop']=function(_0x54ed57){try{if(!_['isNil'](channels[_0x54ed57[_0x19de('0x5')]])){utils[_0x19de('0x1b')](util[_0x19de('0x8')](_0x19de('0x41'),_0x54ed57[_0x19de('0x5')]),_0x54ed57);if(!_[_0x19de('0x1c')](channels[_0x54ed57['uniqueid']]['musiconholdstartAt'])){channels[_0x54ed57[_0x19de('0x5')]][_0x19de('0x42')]+=utils['diffTime'](utils[_0x19de('0x18')](),channels[_0x54ed57[_0x19de('0x5')]][_0x19de('0x3f')]);utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x43'),_0x54ed57[_0x19de('0x5')],channels[_0x54ed57[_0x19de('0x5')]][_0x19de('0x42')]));delete channels[_0x54ed57['uniqueid']][_0x19de('0x3f')];}}}catch(_0x31e416){utils[_0x19de('0x27')](util[_0x19de('0x8')](_0x19de('0x41'),_0x54ed57['uniqueid']),_0x31e416);}};exports[_0x19de('0x44')]=function(_0x5ecf2d){try{if(!_[_0x19de('0x1c')](channels[_0x5ecf2d[_0x19de('0x5')]])){utils[_0x19de('0x1b')](util[_0x19de('0x8')](_0x19de('0x45'),_0x5ecf2d['uniqueid']),_0x5ecf2d);if(!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x47')])){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x48'),_0x5ecf2d[_0x19de('0x5')],_0x5ecf2d['value']));channels[_0x5ecf2d['uniqueid']][_0x19de('0x49')]=_0x5ecf2d[_0x19de('0x4a')];}if(!_[_0x19de('0x1c')](_0x5ecf2d['variable'][_0x19de('0x4b')])){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x4c'),_0x5ecf2d[_0x19de('0x5')],_0x5ecf2d[_0x19de('0x4a')]));channels[_0x5ecf2d[_0x19de('0x5')]][_0x19de('0x4d')]=_0x5ecf2d[_0x19de('0x4a')];channels[_0x5ecf2d[_0x19de('0x5')]]['callerid']='\x22'+_0x5ecf2d[_0x19de('0x4a')]+'\x22\x20<'+_0x5ecf2d['value']+'>';}if(!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x4e')])||!_[_0x19de('0x1c')](_0x5ecf2d['variable'][_0x19de('0x4f')])){utils[_0x19de('0x7')](util[_0x19de('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5ecf2d[_0x19de('0x5')],!_['isNil'](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x4e')])?_0x19de('0x4e'):_0x19de('0x4f'),_0x5ecf2d['value']));channels[_0x5ecf2d[_0x19de('0x5')]]['callerid']=_0x5ecf2d[_0x19de('0x4a')];}if(!_['isNil'](_0x5ecf2d[_0x19de('0x46')]['xmd-queue'])||!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x50')])){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x51'),_0x5ecf2d[_0x19de('0x5')],!_['isNil'](_0x5ecf2d['variable'][_0x19de('0x52')])?'xmd-queue':_0x19de('0x50'),_0x5ecf2d[_0x19de('0x4a')]));channels[_0x5ecf2d[_0x19de('0x5')]]['lastapplication']='Queue';channels[_0x5ecf2d['uniqueid']][_0x19de('0x53')]=_0x5ecf2d[_0x19de('0x4a')];channels[_0x5ecf2d[_0x19de('0x5')]]['queue']=!![];}if(!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x54')])){utils[_0x19de('0x7')](util[_0x19de('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x5ecf2d[_0x19de('0x5')],_0x5ecf2d[_0x19de('0x4a')]));channels[_0x5ecf2d[_0x19de('0x5')]][_0x19de('0x55')]=_0x5ecf2d[_0x19de('0x4a')];}if(!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x56')])){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x57'),_0x5ecf2d[_0x19de('0x5')],_0x5ecf2d[_0x19de('0x4a')]));channels[_0x5ecf2d[_0x19de('0x5')]][_0x19de('0x58')]=_0x5ecf2d[_0x19de('0x4a')];}if(!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x59')])){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x5a'),_0x5ecf2d[_0x19de('0x5')],_0x5ecf2d[_0x19de('0x4a')]));channels[_0x5ecf2d['uniqueid']][_0x19de('0x5b')]=_0x5ecf2d[_0x19de('0x4a')];}if(!_[_0x19de('0x1c')](_0x5ecf2d[_0x19de('0x46')][_0x19de('0x5c')])){utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x5d'),_0x5ecf2d['uniqueid'],_0x5ecf2d[_0x19de('0x4a')]));channels[_0x5ecf2d[_0x19de('0x5')]]['sipcallid']=_0x5ecf2d[_0x19de('0x4a')];}}}catch(_0x2fbf7e){utils[_0x19de('0x27')](util['format'](_0x19de('0x45'),_0x5ecf2d[_0x19de('0x5')]),_0x2fbf7e);}};exports[_0x19de('0x5e')]=function(_0x6e260e){try{if(!_[_0x19de('0x1c')](channels[_0x6e260e['uniqueid']])){utils[_0x19de('0x1b')](util[_0x19de('0x8')](_0x19de('0x5f'),_0x6e260e[_0x19de('0x5')]),_0x6e260e);utils[_0x19de('0x7')](util[_0x19de('0x8')](_0x19de('0x60'),_0x6e260e[_0x19de('0x5')],_0x6e260e[_0x19de('0x61')],_0x6e260e[_0x19de('0x62')]));if(_0x6e260e['application'][_0x19de('0x63')]()=='set'&&_[_0x19de('0x64')](_0x6e260e[_0x19de('0x62')][_0x19de('0x63')](),'cdr')){var _0x16fc30=_0x6e260e[_0x19de('0x62')][_0x19de('0x65')]('=');var _0x562bc7=_0x16fc30[0x0]['substring'](_0x16fc30[0x0]['lastIndexOf']('(')+0x1,_0x16fc30[0x0][_0x19de('0x66')](')'));var _0x2dbece=_0x16fc30[0x1];channels[_0x6e260e['uniqueid']][_0x562bc7]=_0x2dbece;}if(!_[_0x19de('0x67')](['hangup',_0x19de('0x68'),_0x19de('0x69'),_0x19de('0x6a'),'gotoif'],_0x6e260e[_0x19de('0x61')][_0x19de('0x63')]())){channels[_0x6e260e[_0x19de('0x5')]][_0x19de('0x6b')]=_0x6e260e[_0x19de('0x61')];channels[_0x6e260e[_0x19de('0x5')]][_0x19de('0x53')]=_0x6e260e[_0x19de('0x62')];}}}catch(_0x5759a0){utils[_0x19de('0x27')](util[_0x19de('0x8')](_0x19de('0x5f'),_0x6e260e[_0x19de('0x5')]),_0x5759a0);}};
\ No newline at end of file
index 0f5ea22..03355c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae74=['info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent'];(function(_0x44e8fb,_0x23e56a){var _0x1d5476=function(_0x26779b){while(--_0x26779b){_0x44e8fb['push'](_0x44e8fb['shift']());}};_0x1d5476(++_0x23e56a);}(_0xae74,0x88));var _0x4ae7=function(_0x25c760,_0x450723){_0x25c760=_0x25c760-0x0;var _0x333345=_0xae74[_0x25c760];return _0x333345;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x4ae7('0x0')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x4ae7('0x0')](_0x4ae7('0x1'));};exports[_0x4ae7('0x2')]=function(){utils[_0x4ae7('0x0')](_0x4ae7('0x3'));};exports['error']=function(_0x2be51e){utils[_0x4ae7('0x4')](_0x4ae7('0x5'),_0x2be51e);};exports['close']=function(){utils['info'](_0x4ae7('0x6'));};exports[_0x4ae7('0x7')]=function(_0x217351){};
\ No newline at end of file
+var _0x96cd=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0xc84590,_0x267aca){var _0x28441f=function(_0x59ddb8){while(--_0x59ddb8){_0xc84590['push'](_0xc84590['shift']());}};_0x28441f(++_0x267aca);}(_0x96cd,0x10e));var _0xd96c=function(_0x4a2ec6,_0x23eea3){_0x4a2ec6=_0x4a2ec6-0x0;var _0x5bfeee=_0x96cd[_0x4a2ec6];return _0x5bfeee;};'use strict';var utils=require(_0xd96c('0x0'));exports['connect']=function(){utils[_0xd96c('0x1')](_0xd96c('0x2'));};exports[_0xd96c('0x3')]=function(){utils['info'](_0xd96c('0x4'));};exports[_0xd96c('0x5')]=function(){utils[_0xd96c('0x1')](_0xd96c('0x6'));};exports[_0xd96c('0x7')]=function(_0x30d725){utils[_0xd96c('0x7')](_0xd96c('0x8'),_0x30d725);};exports[_0xd96c('0x9')]=function(){utils['info'](_0xd96c('0xa'));};exports[_0xd96c('0xb')]=function(_0x162ab8){};
\ No newline at end of file
index 6e97ec1..f464f75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7b=['diffTime','endtime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','[%s][dials][newexten]','varset','debug','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','assign','complete','holdtime'];(function(_0x14e2f1,_0x403697){var _0x10cc21=function(_0x5eb12e){while(--_0x5eb12e){_0x14e2f1['push'](_0x14e2f1['shift']());}};_0x10cc21(++_0x403697);}(_0xfa7b,0x101));var _0xbfa7=function(_0x1cdaaf,_0x32ba6e){_0x1cdaaf=_0x1cdaaf-0x0;var _0x48f2d4=_0xfa7b[_0x1cdaaf];return _0x48f2d4;};'use strict';var _=require(_0xbfa7('0x0'));var util=require(_0xbfa7('0x1'));var utils=require(_0xbfa7('0x2'));var dials={};function writeDB(_0x28254d){utils[_0xbfa7('0x3')](util['format'](_0xbfa7('0x4'),_0x28254d[_0xbfa7('0x5')],_0x28254d[_0xbfa7('0x6')],_0x28254d[_0xbfa7('0x7')],_0x28254d[_0xbfa7('0x8')],_0x28254d[_0xbfa7('0x9')],_0x28254d[_0xbfa7('0xa')]));utils['request'](_0xbfa7('0xb'),_0x28254d);delete dials[_0x28254d[_0xbfa7('0x5')]];}exports[_0xbfa7('0xc')]=function(_0x37131d){try{utils['debug'](util[_0xbfa7('0xd')]('[%s][dials][newexten]',_0x37131d['uniqueid']),_0x37131d);utils['info'](util[_0xbfa7('0xd')](_0xbfa7('0xe'),_0x37131d['uniqueid'],_0x37131d[_0xbfa7('0xf')],_0x37131d[_0xbfa7('0x10')]));if(_0x37131d['application']['toLowerCase']()==_0xbfa7('0x11')&&_[_0xbfa7('0x12')](_0x37131d[_0xbfa7('0x10')][_0xbfa7('0x13')](),_0xbfa7('0x14'))){var _0x34bdc3=_0x37131d[_0xbfa7('0x10')][_0xbfa7('0x15')]('=');dials[_0x37131d[_0xbfa7('0x5')]]={'routeId':_0x34bdc3[0x1]};}}catch(_0x40f424){utils[_0xbfa7('0x16')](util[_0xbfa7('0xd')](_0xbfa7('0x17'),_0x37131d[_0xbfa7('0x5')]),_0x40f424);}};exports[_0xbfa7('0x18')]=function(_0x420c47){try{utils[_0xbfa7('0x19')](util[_0xbfa7('0xd')]('[%s][dials][varset]',_0x420c47[_0xbfa7('0x5')]),_0x420c47);if(!_[_0xbfa7('0x1a')](_0x420c47[_0xbfa7('0x1b')]['outboundrouteid'])){utils[_0xbfa7('0x3')](util['format'](_0xbfa7('0x1c'),_0x420c47[_0xbfa7('0x5')],_0x420c47[_0xbfa7('0x1d')]));dials[_0x420c47[_0xbfa7('0x5')]]={'routeId':_0x420c47['value']};}}catch(_0x3e78b5){utils[_0xbfa7('0x16')](util[_0xbfa7('0xd')](_0xbfa7('0x1e'),_0x420c47[_0xbfa7('0x5')]),_0x3e78b5);}};exports[_0xbfa7('0x1f')]=function(_0x2f28cf){try{if(!_[_0xbfa7('0x1a')](dials[_0x2f28cf[_0xbfa7('0x5')]])){utils[_0xbfa7('0x19')](util[_0xbfa7('0xd')](_0xbfa7('0x20'),_0x2f28cf['uniqueid']),_0x2f28cf);dials[_0x2f28cf[_0xbfa7('0x5')]]=_['assign'](dials[_0x2f28cf[_0xbfa7('0x5')]],_0x2f28cf);dials[_0x2f28cf[_0xbfa7('0x5')]][_0xbfa7('0x21')]=utils[_0xbfa7('0x22')]();dials[_0x2f28cf[_0xbfa7('0x5')]][_0xbfa7('0x23')]=_0xbfa7('0x24');utils[_0xbfa7('0x3')](util['format'](_0xbfa7('0x25'),_0x2f28cf['uniqueid'],dials[_0x2f28cf['uniqueid']]['starttime']));}}catch(_0x5b6f39){utils[_0xbfa7('0x16')](util[_0xbfa7('0xd')](_0xbfa7('0x20'),_0x2f28cf[_0xbfa7('0x5')]),_0x5b6f39);}};exports[_0xbfa7('0x26')]=function(_0x8696e8){try{if(!_[_0xbfa7('0x1a')](dials[_0x8696e8[_0xbfa7('0x5')]])){utils['debug'](util[_0xbfa7('0xd')](_0xbfa7('0x27'),_0x8696e8[_0xbfa7('0x5')]),_0x8696e8);dials[_0x8696e8['uniqueid']]['dialstatus']=_0x8696e8[_0xbfa7('0xa')];if(_0x8696e8[_0xbfa7('0xa')]==_0xbfa7('0x28')){dials[_0x8696e8[_0xbfa7('0x5')]]=_['assign'](dials[_0x8696e8[_0xbfa7('0x5')]],_0x8696e8);dials[_0x8696e8[_0xbfa7('0x5')]][_0xbfa7('0x29')]=utils[_0xbfa7('0x22')]();dials[_0x8696e8['uniqueid']][_0xbfa7('0x23')]=_0xbfa7('0x2a');utils[_0xbfa7('0x3')](util[_0xbfa7('0xd')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x8696e8['uniqueid'],_0x8696e8[_0xbfa7('0xa')],dials[_0x8696e8[_0xbfa7('0x5')]][_0xbfa7('0x29')]));}else{utils['info'](util[_0xbfa7('0xd')](_0xbfa7('0x2b'),_0x8696e8[_0xbfa7('0x5')],_0x8696e8[_0xbfa7('0xa')]));}}}catch(_0x430926){utils[_0xbfa7('0x16')](util[_0xbfa7('0xd')](_0xbfa7('0x27'),_0x8696e8[_0xbfa7('0x5')]),_0x430926);}};exports['hangup']=function(_0x4241cb){try{if(!_[_0xbfa7('0x1a')](dials[_0x4241cb['uniqueid']])){utils[_0xbfa7('0x19')](util['format'](_0xbfa7('0x2c'),_0x4241cb[_0xbfa7('0x5')]),_0x4241cb);utils[_0xbfa7('0x3')](util['format'](_0xbfa7('0x2d'),_0x4241cb[_0xbfa7('0x5')],_0x4241cb['calleridnum'],_0x4241cb['calleridname'],_0x4241cb['cause-txt']));dials[_0x4241cb[_0xbfa7('0x5')]]=_[_0xbfa7('0x2e')](dials[_0x4241cb[_0xbfa7('0x5')]],{'endtime':utils[_0xbfa7('0x22')](),'lastevent':_0xbfa7('0x2f')});dials[_0x4241cb[_0xbfa7('0x5')]]['duration']=utils['diffTime'](dials[_0x4241cb[_0xbfa7('0x5')]]['endtime'],dials[_0x4241cb[_0xbfa7('0x5')]]['starttime']);dials[_0x4241cb[_0xbfa7('0x5')]][_0xbfa7('0x30')]=utils[_0xbfa7('0x31')](dials[_0x4241cb['uniqueid']]['answertime']||dials[_0x4241cb['uniqueid']]['endtime'],dials[_0x4241cb[_0xbfa7('0x5')]][_0xbfa7('0x21')]);dials[_0x4241cb[_0xbfa7('0x5')]]['billableseconds']=dials[_0x4241cb[_0xbfa7('0x5')]][_0xbfa7('0x29')]?utils['diffTime'](dials[_0x4241cb[_0xbfa7('0x5')]][_0xbfa7('0x32')],dials[_0x4241cb['uniqueid']][_0xbfa7('0x29')]):0x0;writeDB(dials[_0x4241cb[_0xbfa7('0x5')]]);}}catch(_0x3d52a6){utils[_0xbfa7('0x16')](util['format'](_0xbfa7('0x2c'),_0x4241cb[_0xbfa7('0x5')]),_0x3d52a6);}};
\ No newline at end of file
+var _0x5600=['util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','[%s][dials][dialend]','ANSWER','answertime','connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','holdtime','diffTime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5600,0x1b0));var _0x0560=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x5600[_0x4b2cc6];return _0x3e0b08;};'use strict';var _=require('lodash');var util=require(_0x0560('0x0'));var utils=require(_0x0560('0x1'));var dials={};function writeDB(_0x43de1c){utils[_0x0560('0x2')](util[_0x0560('0x3')](_0x0560('0x4'),_0x43de1c[_0x0560('0x5')],_0x43de1c[_0x0560('0x6')],_0x43de1c[_0x0560('0x7')],_0x43de1c[_0x0560('0x8')],_0x43de1c[_0x0560('0x9')],_0x43de1c[_0x0560('0xa')]));utils[_0x0560('0xb')](_0x0560('0xc'),_0x43de1c);delete dials[_0x43de1c[_0x0560('0x5')]];}exports[_0x0560('0xd')]=function(_0x212f73){try{utils[_0x0560('0xe')](util[_0x0560('0x3')](_0x0560('0xf'),_0x212f73[_0x0560('0x5')]),_0x212f73);utils[_0x0560('0x2')](util[_0x0560('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x212f73[_0x0560('0x5')],_0x212f73[_0x0560('0x10')],_0x212f73[_0x0560('0x11')]));if(_0x212f73[_0x0560('0x10')]['toLowerCase']()==_0x0560('0x12')&&_[_0x0560('0x13')](_0x212f73[_0x0560('0x11')][_0x0560('0x14')](),_0x0560('0x15'))){var _0x57d22e=_0x212f73['appdata'][_0x0560('0x16')]('=');dials[_0x212f73[_0x0560('0x5')]]={'routeId':_0x57d22e[0x1]};}}catch(_0x316410){utils[_0x0560('0x17')](util[_0x0560('0x3')](_0x0560('0xf'),_0x212f73[_0x0560('0x5')]),_0x316410);}};exports['varset']=function(_0x390a74){try{utils[_0x0560('0xe')](util[_0x0560('0x3')](_0x0560('0x18'),_0x390a74['uniqueid']),_0x390a74);if(!_[_0x0560('0x19')](_0x390a74[_0x0560('0x1a')]['outboundrouteid'])){utils[_0x0560('0x2')](util['format'](_0x0560('0x1b'),_0x390a74[_0x0560('0x5')],_0x390a74[_0x0560('0x1c')]));dials[_0x390a74[_0x0560('0x5')]]={'routeId':_0x390a74['value']};}}catch(_0x57c02a){utils[_0x0560('0x17')](util[_0x0560('0x3')](_0x0560('0x18'),_0x390a74[_0x0560('0x5')]),_0x57c02a);}};exports['dialbegin']=function(_0x5d6011){try{if(!_[_0x0560('0x19')](dials[_0x5d6011[_0x0560('0x5')]])){utils['debug'](util[_0x0560('0x3')]('[%s][dials][dialbegin]',_0x5d6011[_0x0560('0x5')]),_0x5d6011);dials[_0x5d6011['uniqueid']]=_[_0x0560('0x1d')](dials[_0x5d6011['uniqueid']],_0x5d6011);dials[_0x5d6011[_0x0560('0x5')]][_0x0560('0x1e')]=utils[_0x0560('0x1f')]();dials[_0x5d6011['uniqueid']][_0x0560('0x20')]='called';utils['info'](util[_0x0560('0x3')](_0x0560('0x21'),_0x5d6011[_0x0560('0x5')],dials[_0x5d6011[_0x0560('0x5')]]['starttime']));}}catch(_0x5e14e4){utils[_0x0560('0x17')](util['format'](_0x0560('0x22'),_0x5d6011[_0x0560('0x5')]),_0x5e14e4);}};exports['dialend']=function(_0x3672c2){try{if(!_[_0x0560('0x19')](dials[_0x3672c2[_0x0560('0x5')]])){utils[_0x0560('0xe')](util[_0x0560('0x3')](_0x0560('0x23'),_0x3672c2[_0x0560('0x5')]),_0x3672c2);dials[_0x3672c2[_0x0560('0x5')]]['dialstatus']=_0x3672c2[_0x0560('0xa')];if(_0x3672c2['dialstatus']==_0x0560('0x24')){dials[_0x3672c2[_0x0560('0x5')]]=_[_0x0560('0x1d')](dials[_0x3672c2[_0x0560('0x5')]],_0x3672c2);dials[_0x3672c2['uniqueid']][_0x0560('0x25')]=utils[_0x0560('0x1f')]();dials[_0x3672c2[_0x0560('0x5')]][_0x0560('0x20')]=_0x0560('0x26');utils[_0x0560('0x2')](util[_0x0560('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3672c2[_0x0560('0x5')],_0x3672c2[_0x0560('0xa')],dials[_0x3672c2['uniqueid']][_0x0560('0x25')]));}else{utils[_0x0560('0x2')](util[_0x0560('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3672c2[_0x0560('0x5')],_0x3672c2['dialstatus']));}}}catch(_0x536774){utils[_0x0560('0x17')](util['format'](_0x0560('0x23'),_0x3672c2['uniqueid']),_0x536774);}};exports[_0x0560('0x27')]=function(_0x531b89){try{if(!_[_0x0560('0x19')](dials[_0x531b89[_0x0560('0x5')]])){utils['debug'](util['format'](_0x0560('0x28'),_0x531b89[_0x0560('0x5')]),_0x531b89);utils[_0x0560('0x2')](util['format'](_0x0560('0x29'),_0x531b89[_0x0560('0x5')],_0x531b89[_0x0560('0x8')],_0x531b89[_0x0560('0x2a')],_0x531b89['cause-txt']));dials[_0x531b89[_0x0560('0x5')]]=_[_0x0560('0x1d')](dials[_0x531b89['uniqueid']],{'endtime':utils[_0x0560('0x1f')](),'lastevent':_0x0560('0x2b')});dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x2c')]=utils['diffTime'](dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x2d')],dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x1e')]);dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x2e')]=utils['diffTime'](dials[_0x531b89[_0x0560('0x5')]]['answertime']||dials[_0x531b89['uniqueid']]['endtime'],dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x1e')]);dials[_0x531b89[_0x0560('0x5')]]['billableseconds']=dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x25')]?utils[_0x0560('0x2f')](dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x2d')],dials[_0x531b89[_0x0560('0x5')]][_0x0560('0x25')]):0x0;writeDB(dials[_0x531b89['uniqueid']]);}}catch(_0x36197c){utils[_0x0560('0x17')](util['format'](_0x0560('0x28'),_0x531b89[_0x0560('0x5')]),_0x36197c);}};
\ No newline at end of file
index b0b63f4..f4ef212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5f1=['./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','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]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','xdr','disabled','env','production','port','username','password','keepConnected','info','XDR\x20DISABLED','./recordings.controller'];(function(_0x377272,_0x43a62d){var _0x51d09c=function(_0x262fce){while(--_0x262fce){_0x377272['push'](_0x377272['shift']());}};_0x51d09c(++_0x43a62d);}(_0xc5f1,0x148));var _0x1c5f=function(_0x9c9ca7,_0x429e07){_0x9c9ca7=_0x9c9ca7-0x0;var _0x34f4e8=_0xc5f1[_0x9c9ca7];return _0x34f4e8;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x1c5f('0x0'));var util=require('util');var isXDREnabled=config['xdr']&&config[_0x1c5f('0x1')][_0x1c5f('0x2')]?!config[_0x1c5f('0x1')][_0x1c5f('0x2')]:!![];var isProduction=config[_0x1c5f('0x3')]===_0x1c5f('0x4')||![];var isLocalAsterisk=config[_0x1c5f('0x1')]&&config[_0x1c5f('0x1')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x1c5f('0x5')],config['asterisk']['ip'],config['asterisk'][_0x1c5f('0x6')],config['asterisk'][_0x1c5f('0x7')],!![]);ami[_0x1c5f('0x8')]();if(!isXDREnabled){utils[_0x1c5f('0x9')](_0x1c5f('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1c5f('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x1c5f('0xb'));var members=require(_0x1c5f('0xc'));var dials=require(_0x1c5f('0xd'));var transfers=require(_0x1c5f('0xe'));var core=require(_0x1c5f('0xf'));ami['on'](_0x1c5f('0x10'),core[_0x1c5f('0x10')]);ami['on'](_0x1c5f('0x11'),core['shutdown']);ami['on'](_0x1c5f('0x12'),core[_0x1c5f('0x12')]);ami['on'](_0x1c5f('0x13'),core[_0x1c5f('0x13')]);ami['on'](_0x1c5f('0x14'),core[_0x1c5f('0x14')]);ami['on'](_0x1c5f('0x15'),core[_0x1c5f('0x15')]);ami['on'](_0x1c5f('0x16'),function(_0xe72f77){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')]('[%s][index][devicestatechange]',_0xe72f77[_0x1c5f('0x19')]),_0xe72f77);members[_0x1c5f('0x16')](_0xe72f77);}catch(_0x84fac3){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x1a'),_0xe72f77[_0x1c5f('0x19')]),_0x84fac3);}});ami['on'](_0x1c5f('0x1b'),function(_0xf69a43){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x1c'),_0xf69a43['uniqueid']),_0xf69a43);agents['agentcalled'](_0xf69a43);}catch(_0x51487e){utils['error'](util[_0x1c5f('0x18')](_0x1c5f('0x1c'),_0xf69a43[_0x1c5f('0x1d')]),_0x51487e);}});ami['on']('agentringnoanswer',function(_0x2207be){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x1e'),_0x2207be['uniqueid']),_0x2207be);agents[_0x1c5f('0x1f')](_0x2207be);}catch(_0x7e2fa3){utils['error'](util[_0x1c5f('0x18')](_0x1c5f('0x1e'),_0x2207be[_0x1c5f('0x1d')]),_0x7e2fa3);}});ami['on']('agentconnect',function(_0x3c5d5c){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x20'),_0x3c5d5c['uniqueid']),_0x3c5d5c);agents[_0x1c5f('0x21')](_0x3c5d5c);queues['agentconnect'](_0x3c5d5c);}catch(_0x520074){utils['error'](util[_0x1c5f('0x18')]('[%s][index][agentconnect]',_0x3c5d5c[_0x1c5f('0x1d')]),_0x520074);}});ami['on'](_0x1c5f('0x22'),function(_0x20776d){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')]('[%s][index][agentcomplete]',_0x20776d['uniqueid']),_0x20776d);agents['agentcomplete'](_0x20776d);queues['agentcomplete'](_0x20776d);members[_0x1c5f('0x22')](_0x20776d);}catch(_0x9c39f7){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x23'),_0x20776d[_0x1c5f('0x1d')]),_0x9c39f7);}});ami['on'](_0x1c5f('0x24'),function(_0x8cf1db){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x25'),_0x8cf1db[_0x1c5f('0x1d')]),_0x8cf1db);agents['queuecallerabandon'](_0x8cf1db);queues[_0x1c5f('0x24')](_0x8cf1db);}catch(_0x443c32){utils[_0x1c5f('0x13')](util['format'](_0x1c5f('0x25'),_0x8cf1db[_0x1c5f('0x1d')]),_0x443c32);}});ami['on'](_0x1c5f('0x26'),function(_0x14ec64){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x27'),_0x14ec64[_0x1c5f('0x1d')]),_0x14ec64);queues[_0x1c5f('0x26')](_0x14ec64);recordings[_0x1c5f('0x26')](_0x14ec64);}catch(_0x12f954){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x27'),_0x14ec64['uniqueid']),_0x12f954);}});ami['on'](_0x1c5f('0x28'),function(_0x2ba1ac){try{utils[_0x1c5f('0x17')](util['format'](_0x1c5f('0x29'),_0x2ba1ac['uniqueid']),_0x2ba1ac);queues[_0x1c5f('0x28')](_0x2ba1ac);}catch(_0x5915b0){utils['error'](util[_0x1c5f('0x18')]('[%s][index][queuecallerleave]',_0x2ba1ac[_0x1c5f('0x1d')]),_0x5915b0);}});ami['on'](_0x1c5f('0x2a'),function(_0x2242cb){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x2b'),_0x2242cb['uniqueid']),_0x2242cb);queues['musiconholdstart'](_0x2242cb);calls['musiconholdstart'](_0x2242cb);}catch(_0x17c728){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x2b'),_0x2242cb[_0x1c5f('0x1d')]),_0x17c728);}});ami['on']('musiconholdstop',function(_0x44e03f){try{utils[_0x1c5f('0x17')](util['format'](_0x1c5f('0x2c'),_0x44e03f[_0x1c5f('0x1d')]),_0x44e03f);queues[_0x1c5f('0x2d')](_0x44e03f);calls[_0x1c5f('0x2d')](_0x44e03f);}catch(_0x2a1d26){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x2c'),_0x44e03f[_0x1c5f('0x1d')]),_0x2a1d26);}});ami['on']('newstate',function(_0x1e572d){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x2e'),_0x1e572d[_0x1c5f('0x1d')]),_0x1e572d);calls[_0x1c5f('0x2f')](_0x1e572d);recordings[_0x1c5f('0x2f')](_0x1e572d);}catch(_0x2d03e8){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x2e'),_0x1e572d[_0x1c5f('0x1d')]),_0x2d03e8);}});ami['on'](_0x1c5f('0x30'),function(_0x3f472f){try{utils['debug'](util[_0x1c5f('0x18')](_0x1c5f('0x31'),_0x3f472f[_0x1c5f('0x1d')]),_0x3f472f);calls[_0x1c5f('0x30')](_0x3f472f);recordings['hangup'](_0x3f472f);dials[_0x1c5f('0x30')](_0x3f472f);agents[_0x1c5f('0x30')](_0x3f472f);queues['hangup'](_0x3f472f);}catch(_0x38b552){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')]('[%s][index][hangup]',_0x3f472f[_0x1c5f('0x1d')]),_0x38b552);}});ami['on'](_0x1c5f('0x32'),function(_0x2b32e7){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x33'),_0x2b32e7['uniqueid']),_0x2b32e7);members[_0x1c5f('0x32')](_0x2b32e7);}catch(_0x3d8955){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x33'),_0x2b32e7[_0x1c5f('0x1d')]),_0x3d8955);}});ami['on']('blindtransfer',function(_0x39fb90){try{utils[_0x1c5f('0x17')](util['format'](_0x1c5f('0x34'),_0x39fb90[_0x1c5f('0x1d')]),_0x39fb90);queues[_0x1c5f('0x35')](_0x39fb90);agents[_0x1c5f('0x35')](_0x39fb90);transfers[_0x1c5f('0x35')](_0x39fb90);recordings[_0x1c5f('0x35')](_0x39fb90);}catch(_0x16871f){utils['error'](util[_0x1c5f('0x18')]('[%s][index][blindtransfer]',_0x39fb90['uniqueid']),_0x16871f);}});ami['on']('attendedtransfer',function(_0x350ff2){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x36'),_0x350ff2[_0x1c5f('0x37')]),_0x350ff2);queues['attendedtransfer'](_0x350ff2);transfers[_0x1c5f('0x38')](_0x350ff2);agents[_0x1c5f('0x38')](_0x350ff2);calls['attendedtransfer'](_0x350ff2);}catch(_0x2c6476){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')]('[%s][index][attendedtransfer]',_0x350ff2['origtransfereruniqueid']),_0x2c6476);}});ami['on'](_0x1c5f('0x39'),function(_0x39f081){try{utils[_0x1c5f('0x17')](util['format']('[%s][index][varset]',_0x39f081['uniqueid']),_0x39f081);queues[_0x1c5f('0x39')](_0x39f081);recordings[_0x1c5f('0x39')](_0x39f081);calls[_0x1c5f('0x39')](_0x39f081);dials['varset'](_0x39f081);}catch(_0xdeecf9){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x3a'),_0x39f081['uniqueid']),_0xdeecf9);}});ami['on'](_0x1c5f('0x3b'),function(_0x198eeb){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x3c'),_0x198eeb['uniqueid']),_0x198eeb);calls[_0x1c5f('0x3b')](_0x198eeb);recordings[_0x1c5f('0x3b')](_0x198eeb);dials[_0x1c5f('0x3b')](_0x198eeb);}catch(_0x4b87ca){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x3c'),_0x198eeb[_0x1c5f('0x1d')]),_0x4b87ca);}});ami['on']('newchannel',function(_0x1afcdd){try{utils[_0x1c5f('0x17')](util['format'](_0x1c5f('0x3d'),_0x1afcdd[_0x1c5f('0x1d')]),_0x1afcdd);calls['newchannel'](_0x1afcdd);recordings[_0x1c5f('0x3e')](_0x1afcdd);}catch(_0x35cddb){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x3d'),_0x1afcdd[_0x1c5f('0x1d')]),_0x35cddb);}});ami['on']('dialbegin',function(_0x1a8ca9){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x3f'),_0x1a8ca9[_0x1c5f('0x1d')]),_0x1a8ca9);dials[_0x1c5f('0x40')](_0x1a8ca9);}catch(_0x313dc8){utils['error'](util[_0x1c5f('0x18')](_0x1c5f('0x41'),_0x1a8ca9['uniqueid']),_0x313dc8);}});ami['on'](_0x1c5f('0x42'),function(_0x3766db){try{utils[_0x1c5f('0x17')](util[_0x1c5f('0x18')](_0x1c5f('0x43'),_0x3766db[_0x1c5f('0x1d')]),_0x3766db);dials[_0x1c5f('0x42')](_0x3766db);}catch(_0x5bea46){utils[_0x1c5f('0x13')](util[_0x1c5f('0x18')](_0x1c5f('0x43'),_0x3766db['uniqueid']),_0x5bea46);}});}
\ No newline at end of file
+var _0xc852=['attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','newexten','newchannel','[%s][index][newchannel]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]'];(function(_0x4c3270,_0x15a87d){var _0x37617e=function(_0x4d4756){while(--_0x4d4756){_0x4c3270['push'](_0x4c3270['shift']());}};_0x37617e(++_0x15a87d);}(_0xc852,0x10a));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};var AsteriskManager=require(_0x2c85('0x0'));var config=require(_0x2c85('0x1'));var utils=require(_0x2c85('0x2'));var util=require('util');var isXDREnabled=config[_0x2c85('0x3')]&&config['xdr'][_0x2c85('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x2c85('0x5')]===_0x2c85('0x6')||![];var isLocalAsterisk=config[_0x2c85('0x3')]&&config[_0x2c85('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x2c85('0x7')][_0x2c85('0x8')],config[_0x2c85('0x7')]['ip'],config[_0x2c85('0x7')][_0x2c85('0x9')],config['asterisk'][_0x2c85('0xa')],!![]);ami[_0x2c85('0xb')]();if(!isXDREnabled){utils[_0x2c85('0xc')](_0x2c85('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x2c85('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x2c85('0xe'));var calls=require('./calls.controller');var queues=require(_0x2c85('0xf'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x2c85('0x10'));var core=require('./core.controller');ami['on'](_0x2c85('0x11'),core[_0x2c85('0x11')]);ami['on'](_0x2c85('0x12'),core[_0x2c85('0x12')]);ami['on'](_0x2c85('0x13'),core[_0x2c85('0x13')]);ami['on'](_0x2c85('0x14'),core[_0x2c85('0x14')]);ami['on'](_0x2c85('0x15'),core[_0x2c85('0x15')]);ami['on'](_0x2c85('0x16'),core['managerevent']);ami['on'](_0x2c85('0x17'),function(_0x259400){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x1a'),_0x259400['device']),_0x259400);members['devicestatechange'](_0x259400);}catch(_0x32a7ac){utils[_0x2c85('0x14')](util[_0x2c85('0x19')]('[%s][index][devicestatechange]',_0x259400[_0x2c85('0x1b')]),_0x32a7ac);}});ami['on'](_0x2c85('0x1c'),function(_0x4ee58a){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')]('[%s][index][agentcalled]',_0x4ee58a[_0x2c85('0x1d')]),_0x4ee58a);agents['agentcalled'](_0x4ee58a);}catch(_0x20f454){utils['error'](util['format'](_0x2c85('0x1e'),_0x4ee58a[_0x2c85('0x1d')]),_0x20f454);}});ami['on']('agentringnoanswer',function(_0x3e63f9){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x1f'),_0x3e63f9[_0x2c85('0x1d')]),_0x3e63f9);agents[_0x2c85('0x20')](_0x3e63f9);}catch(_0x46097e){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x1f'),_0x3e63f9[_0x2c85('0x1d')]),_0x46097e);}});ami['on'](_0x2c85('0x21'),function(_0x4f5c6f){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')]('[%s][index][agentconnect]',_0x4f5c6f[_0x2c85('0x1d')]),_0x4f5c6f);agents[_0x2c85('0x21')](_0x4f5c6f);queues['agentconnect'](_0x4f5c6f);}catch(_0x40fe4b){utils['error'](util['format'](_0x2c85('0x22'),_0x4f5c6f['uniqueid']),_0x40fe4b);}});ami['on'](_0x2c85('0x23'),function(_0x259710){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x24'),_0x259710['uniqueid']),_0x259710);agents[_0x2c85('0x23')](_0x259710);queues['agentcomplete'](_0x259710);members['agentcomplete'](_0x259710);}catch(_0x5efa2e){utils[_0x2c85('0x14')](util[_0x2c85('0x19')]('[%s][index][agentcomplete]',_0x259710[_0x2c85('0x1d')]),_0x5efa2e);}});ami['on'](_0x2c85('0x25'),function(_0x4ea518){try{utils['debug'](util[_0x2c85('0x19')](_0x2c85('0x26'),_0x4ea518[_0x2c85('0x1d')]),_0x4ea518);agents[_0x2c85('0x25')](_0x4ea518);queues[_0x2c85('0x25')](_0x4ea518);}catch(_0x1bd003){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x26'),_0x4ea518['uniqueid']),_0x1bd003);}});ami['on'](_0x2c85('0x27'),function(_0x5215d7){try{utils['debug'](util[_0x2c85('0x19')](_0x2c85('0x28'),_0x5215d7[_0x2c85('0x1d')]),_0x5215d7);queues['queuecallerjoin'](_0x5215d7);recordings[_0x2c85('0x27')](_0x5215d7);}catch(_0x36bfc3){utils[_0x2c85('0x14')](util['format'](_0x2c85('0x28'),_0x5215d7[_0x2c85('0x1d')]),_0x36bfc3);}});ami['on'](_0x2c85('0x29'),function(_0x2d1e01){try{utils['debug'](util[_0x2c85('0x19')]('[%s][index][queuecallerleave]',_0x2d1e01['uniqueid']),_0x2d1e01);queues[_0x2c85('0x29')](_0x2d1e01);}catch(_0x3e185e){utils['error'](util['format'](_0x2c85('0x2a'),_0x2d1e01['uniqueid']),_0x3e185e);}});ami['on'](_0x2c85('0x2b'),function(_0x57367a){try{utils['debug'](util[_0x2c85('0x19')]('[%s][index][musiconholdstart]',_0x57367a[_0x2c85('0x1d')]),_0x57367a);queues[_0x2c85('0x2b')](_0x57367a);calls[_0x2c85('0x2b')](_0x57367a);}catch(_0x264bc1){utils['error'](util[_0x2c85('0x19')](_0x2c85('0x2c'),_0x57367a[_0x2c85('0x1d')]),_0x264bc1);}});ami['on']('musiconholdstop',function(_0x10ba74){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x2d'),_0x10ba74['uniqueid']),_0x10ba74);queues[_0x2c85('0x2e')](_0x10ba74);calls[_0x2c85('0x2e')](_0x10ba74);}catch(_0x5bb919){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x2d'),_0x10ba74[_0x2c85('0x1d')]),_0x5bb919);}});ami['on'](_0x2c85('0x2f'),function(_0x19f0b4){try{utils['debug'](util[_0x2c85('0x19')](_0x2c85('0x30'),_0x19f0b4['uniqueid']),_0x19f0b4);calls[_0x2c85('0x2f')](_0x19f0b4);recordings[_0x2c85('0x2f')](_0x19f0b4);}catch(_0x1434e7){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x30'),_0x19f0b4[_0x2c85('0x1d')]),_0x1434e7);}});ami['on'](_0x2c85('0x31'),function(_0x1526ca){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')]('[%s][index][hangup]',_0x1526ca[_0x2c85('0x1d')]),_0x1526ca);calls['hangup'](_0x1526ca);recordings[_0x2c85('0x31')](_0x1526ca);dials[_0x2c85('0x31')](_0x1526ca);agents[_0x2c85('0x31')](_0x1526ca);queues[_0x2c85('0x31')](_0x1526ca);}catch(_0x4aa064){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x32'),_0x1526ca[_0x2c85('0x1d')]),_0x4aa064);}});ami['on']('cdr',function(_0x58b0d5){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x33'),_0x58b0d5[_0x2c85('0x1d')]),_0x58b0d5);members['cdr'](_0x58b0d5);}catch(_0x333fd9){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x33'),_0x58b0d5[_0x2c85('0x1d')]),_0x333fd9);}});ami['on'](_0x2c85('0x34'),function(_0x563978){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x35'),_0x563978[_0x2c85('0x1d')]),_0x563978);queues[_0x2c85('0x34')](_0x563978);agents['blindtransfer'](_0x563978);transfers[_0x2c85('0x34')](_0x563978);recordings[_0x2c85('0x34')](_0x563978);}catch(_0x48aa17){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x35'),_0x563978[_0x2c85('0x1d')]),_0x48aa17);}});ami['on'](_0x2c85('0x36'),function(_0x23ef6d){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')]('[%s][index][attendedtransfer]',_0x23ef6d['origtransfereruniqueid']),_0x23ef6d);queues[_0x2c85('0x36')](_0x23ef6d);transfers[_0x2c85('0x36')](_0x23ef6d);agents[_0x2c85('0x36')](_0x23ef6d);calls[_0x2c85('0x36')](_0x23ef6d);}catch(_0x4658a5){utils['error'](util[_0x2c85('0x19')]('[%s][index][attendedtransfer]',_0x23ef6d[_0x2c85('0x37')]),_0x4658a5);}});ami['on']('varset',function(_0x98c870){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x38'),_0x98c870[_0x2c85('0x1d')]),_0x98c870);queues['varset'](_0x98c870);recordings[_0x2c85('0x39')](_0x98c870);calls[_0x2c85('0x39')](_0x98c870);dials[_0x2c85('0x39')](_0x98c870);}catch(_0x44cf4b){utils[_0x2c85('0x14')](util['format']('[%s][index][varset]',_0x98c870['uniqueid']),_0x44cf4b);}});ami['on'](_0x2c85('0x3a'),function(_0xf70ba8){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')]('[%s][index][newexten]',_0xf70ba8[_0x2c85('0x1d')]),_0xf70ba8);calls[_0x2c85('0x3a')](_0xf70ba8);recordings[_0x2c85('0x3a')](_0xf70ba8);dials[_0x2c85('0x3a')](_0xf70ba8);}catch(_0x4f6a7d){utils['error'](util[_0x2c85('0x19')]('[%s][index][newexten]',_0xf70ba8[_0x2c85('0x1d')]),_0x4f6a7d);}});ami['on'](_0x2c85('0x3b'),function(_0xfe10b7){try{utils['debug'](util[_0x2c85('0x19')](_0x2c85('0x3c'),_0xfe10b7['uniqueid']),_0xfe10b7);calls[_0x2c85('0x3b')](_0xfe10b7);recordings[_0x2c85('0x3b')](_0xfe10b7);}catch(_0x3ffce7){utils[_0x2c85('0x14')](util['format'](_0x2c85('0x3c'),_0xfe10b7['uniqueid']),_0x3ffce7);}});ami['on'](_0x2c85('0x3d'),function(_0x1876a5){try{utils['debug'](util['format']('[%s][index][dialbegin]',_0x1876a5[_0x2c85('0x1d')]),_0x1876a5);dials[_0x2c85('0x3d')](_0x1876a5);}catch(_0x3ccae1){utils[_0x2c85('0x14')](util[_0x2c85('0x19')]('[%s]dialbegin',_0x1876a5['uniqueid']),_0x3ccae1);}});ami['on'](_0x2c85('0x3e'),function(_0x14295f){try{utils[_0x2c85('0x18')](util[_0x2c85('0x19')](_0x2c85('0x3f'),_0x14295f[_0x2c85('0x1d')]),_0x14295f);dials['dialend'](_0x14295f);}catch(_0x5b1b36){utils[_0x2c85('0x14')](util[_0x2c85('0x19')](_0x2c85('0x3f'),_0x14295f[_0x2c85('0x1d')]),_0x5b1b36);}});}
\ No newline at end of file
index 972fd01..dec00f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77a4=['./utils','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','interface','getUserByInterface','then','internal','CreateMemberReport','getUserByName','split','name','catch','format','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x77a4,0x155));var _0x477a=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x77a4[_0x1778e1];return _0x2bc4c6;};'use strict';var _=require(_0x477a('0x0'));var util=require(_0x477a('0x1'));var utils=require(_0x477a('0x2'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x332514){utils['info'](util['format'](_0x477a('0x3'),_0x332514[_0x477a('0x4')],_0x332514['interface'],_0x332514[_0x477a('0x5')],_0x332514['data2'],_0x332514[_0x477a('0x6')],_0x332514[_0x477a('0x7')]));if(_0x332514[_0x477a('0x8')]){utils[_0x477a('0x9')](_0x332514[_0x477a('0x8')])[_0x477a('0xa')](function(_0x1590c3){if(_0x1590c3){_0x332514[_0x477a('0x6')]=_0x1590c3['name'];_0x332514[_0x477a('0xb')]=_0x1590c3[_0x477a('0xb')];utils['request'](_0x477a('0xc'),_0x332514);}else{utils[_0x477a('0xd')](_0x332514[_0x477a('0x8')][_0x477a('0xe')]('/')[0x1])[_0x477a('0xa')](function(_0x3b85b2){if(_0x3b85b2){_0x332514[_0x477a('0x6')]=_0x3b85b2[_0x477a('0xf')];_0x332514[_0x477a('0xb')]=_0x3b85b2[_0x477a('0xb')];utils['request'](_0x477a('0xc'),_0x332514);}});}})[_0x477a('0x10')](function(_0x5b83e0){utils['error'](util[_0x477a('0x11')](_0x477a('0x12'),_0x332514[_0x477a('0x4')]),_0x5b83e0);});}delete members[_0x332514[_0x477a('0x8')]];}function startsWith(_0xb713e6,_0x203aa1){return _[_0x477a('0x13')](_0xb713e6,function(_0x213f7f){return _[_0x477a('0x14')](_0x203aa1,_0x213f7f);});}exports['devicestatechange']=function(_0x1fa947){try{utils[_0x477a('0x15')](util[_0x477a('0x11')](_0x477a('0x16'),members[_0x1fa947['device']]?members[_0x1fa947['device']]['uniqueid']:_0x1fa947[_0x477a('0x17')]),_0x1fa947);utils[_0x477a('0x18')](util[_0x477a('0x11')](_0x477a('0x19'),members[_0x1fa947[_0x477a('0x17')]]?members[_0x1fa947[_0x477a('0x17')]]['uniqueid']:_0x1fa947[_0x477a('0x17')],_0x1fa947[_0x477a('0x1a')],_0x1fa947[_0x477a('0x17')]));switch(_0x1fa947[_0x477a('0x1a')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x1fa947[_0x477a('0x17')])){members[_0x1fa947[_0x477a('0x17')]]={'channel':_0x477a('0x1b'),'interface':_0x1fa947[_0x477a('0x17')],'type':'TALKING','enterAt':utils[_0x477a('0x1c')](),'role':'agent'};}break;case _0x477a('0x1d'):if(!_[_0x477a('0x1e')](members[_0x1fa947['device']])){members[_0x1fa947['device']][_0x477a('0x1f')]=utils['now']();members[_0x1fa947[_0x477a('0x17')]][_0x477a('0x20')]=utils[_0x477a('0x21')](members[_0x1fa947[_0x477a('0x17')]][_0x477a('0x1f')],members[_0x1fa947[_0x477a('0x17')]][_0x477a('0x22')]);if(members[_0x1fa947[_0x477a('0x17')]][_0x477a('0x4')]){writeDB(members[_0x1fa947['device']]);}}break;default:break;}}catch(_0x32d026){utils[_0x477a('0x23')](util[_0x477a('0x11')](_0x477a('0x16'),members[_0x1fa947[_0x477a('0x17')]]?members[_0x1fa947['device']]['uniqueid']:_0x1fa947[_0x477a('0x17')]),_0x32d026);}};exports[_0x477a('0x24')]=function(_0x2d2940){try{if(!_[_0x477a('0x1e')](members[_0x2d2940[_0x477a('0x8')]])){utils[_0x477a('0x15')](util[_0x477a('0x11')](_0x477a('0x25'),_0x2d2940[_0x477a('0x4')]),_0x2d2940);utils['info'](util[_0x477a('0x11')](_0x477a('0x26'),_0x2d2940[_0x477a('0x4')],_0x2d2940['interface'],_0x2d2940[_0x477a('0x27')]));members[_0x2d2940[_0x477a('0x8')]]=_[_0x477a('0x28')](members[_0x2d2940[_0x477a('0x8')]],{'data4':_0x2d2940[_0x477a('0x27')],'uniqueid':_0x2d2940[_0x477a('0x4')]});}}catch(_0x22c1c5){utils['error'](util[_0x477a('0x11')](_0x477a('0x25'),_0x2d2940[_0x477a('0x4')]),_0x22c1c5);}};exports[_0x477a('0x29')]=function(_0x78bf71){try{utils[_0x477a('0x15')](util['format'](_0x477a('0x2a'),_0x78bf71[_0x477a('0x4')]),_0x78bf71);if(_0x78bf71[_0x477a('0x5')]){var _0x18a976=_0x78bf71[_0x477a('0x5')][_0x477a('0xe')]('-')[0x0];if(!_[_0x477a('0x1e')](members[_0x18a976])){members[_0x18a976]=_[_0x477a('0x28')](members[_0x18a976],{'data1':members[_0x18a976][_0x477a('0x2b')]||_0x78bf71[_0x477a('0x7')],'data2':members[_0x18a976][_0x477a('0x2c')]||_0x78bf71[_0x477a('0x2d')],'data3':members[_0x18a976][_0x477a('0x2e')]||_0x78bf71['destination'],'uniqueid':members[_0x18a976][_0x477a('0x4')]||_0x78bf71['uniqueid']});utils[_0x477a('0x18')](util[_0x477a('0x11')](_0x477a('0x2f'),_0x78bf71['uniqueid'],members[_0x18a976]['data1'],members[_0x18a976]['data2'],members[_0x18a976][_0x477a('0x2e')]));if(members[_0x18a976][_0x477a('0x1f')]){writeDB(members[_0x18a976]);}}}if(_0x78bf71[_0x477a('0x30')]){var _0x448585=_0x78bf71[_0x477a('0x30')][_0x477a('0xe')]('-')[0x0];if(!_[_0x477a('0x1e')](members[_0x448585])){members[_0x448585]=_[_0x477a('0x28')](members[_0x448585],{'data1':members[_0x448585]['data1']||_0x78bf71[_0x477a('0x7')],'data2':members[_0x448585]['data2']||_0x78bf71[_0x477a('0x2d')],'data3':members[_0x448585][_0x477a('0x2e')]||_0x78bf71['destination'],'uniqueid':members[_0x448585]['uniqueid']||_0x78bf71[_0x477a('0x4')]});utils[_0x477a('0x18')](util[_0x477a('0x11')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x78bf71[_0x477a('0x4')],members[_0x448585][_0x477a('0x2b')],members[_0x448585][_0x477a('0x2c')],members[_0x448585][_0x477a('0x2e')]));if(members[_0x448585]['exitAt']){writeDB(members[_0x448585]);}}}}catch(_0xfc6827){utils[_0x477a('0x23')](util['format']('[%s][members][cdr]',_0x78bf71[_0x477a('0x4')]),_0xfc6827);}};
\ No newline at end of file
+var _0x04e5=['internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','queue','assign','cdr','source','data3','destination','destinationchannel','data1','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','Queue:','info','interface','channel','data2','membername','type','getUserByInterface','then','name'];(function(_0x2caebd,_0x56853a){var _0xc913af=function(_0x41727a){while(--_0x41727a){_0x2caebd['push'](_0x2caebd['shift']());}};_0xc913af(++_0x56853a);}(_0x04e5,0x1e8));var _0x504e=function(_0x391abc,_0x41e9a6){_0x391abc=_0x391abc-0x0;var _0x20a945=_0x04e5[_0x391abc];return _0x20a945;};'use strict';var _=require(_0x504e('0x0'));var util=require(_0x504e('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0x504e('0x2')];function writeDB(_0x112cd5){utils[_0x504e('0x3')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x112cd5['uniqueid'],_0x112cd5[_0x504e('0x4')],_0x112cd5[_0x504e('0x5')],_0x112cd5[_0x504e('0x6')],_0x112cd5[_0x504e('0x7')],_0x112cd5[_0x504e('0x8')]));if(_0x112cd5['interface']){utils[_0x504e('0x9')](_0x112cd5['interface'])[_0x504e('0xa')](function(_0x5dc29f){if(_0x5dc29f){_0x112cd5[_0x504e('0x7')]=_0x5dc29f[_0x504e('0xb')];_0x112cd5['internal']=_0x5dc29f[_0x504e('0xc')];utils[_0x504e('0xd')](_0x504e('0xe'),_0x112cd5);}else{utils[_0x504e('0xf')](_0x112cd5[_0x504e('0x4')][_0x504e('0x10')]('/')[0x1])[_0x504e('0xa')](function(_0x4aad54){if(_0x4aad54){_0x112cd5[_0x504e('0x7')]=_0x4aad54[_0x504e('0xb')];_0x112cd5[_0x504e('0xc')]=_0x4aad54[_0x504e('0xc')];utils['request'](_0x504e('0xe'),_0x112cd5);}});}})['catch'](function(_0xdcde7a){utils[_0x504e('0x11')](util[_0x504e('0x12')](_0x504e('0x13'),_0x112cd5[_0x504e('0x14')]),_0xdcde7a);});}delete members[_0x112cd5['interface']];}function startsWith(_0x4c5909,_0x375847){return _[_0x504e('0x15')](_0x4c5909,function(_0x344b67){return _[_0x504e('0x16')](_0x375847,_0x344b67);});}exports[_0x504e('0x17')]=function(_0x251878){try{utils['debug'](util['format'](_0x504e('0x18'),members[_0x251878['device']]?members[_0x251878[_0x504e('0x19')]][_0x504e('0x14')]:_0x251878[_0x504e('0x19')]),_0x251878);utils['info'](util[_0x504e('0x12')](_0x504e('0x1a'),members[_0x251878[_0x504e('0x19')]]?members[_0x251878[_0x504e('0x19')]][_0x504e('0x14')]:_0x251878[_0x504e('0x19')],_0x251878[_0x504e('0x1b')],_0x251878[_0x504e('0x19')]));switch(_0x251878['state']){case _0x504e('0x1c'):case _0x504e('0x1d'):if(!startsWith(exclude,_0x251878['device'])){members[_0x251878['device']]={'channel':'voice','interface':_0x251878['device'],'type':'TALKING','enterAt':utils[_0x504e('0x1e')](),'role':_0x504e('0x1f')};}break;case _0x504e('0x20'):if(!_[_0x504e('0x21')](members[_0x251878[_0x504e('0x19')]])){members[_0x251878['device']][_0x504e('0x22')]=utils[_0x504e('0x1e')]();members[_0x251878[_0x504e('0x19')]][_0x504e('0x23')]=utils['diffTime'](members[_0x251878[_0x504e('0x19')]][_0x504e('0x22')],members[_0x251878[_0x504e('0x19')]][_0x504e('0x24')]);if(members[_0x251878[_0x504e('0x19')]]['uniqueid']){writeDB(members[_0x251878[_0x504e('0x19')]]);}}break;default:break;}}catch(_0x8a0746){utils[_0x504e('0x11')](util[_0x504e('0x12')](_0x504e('0x18'),members[_0x251878[_0x504e('0x19')]]?members[_0x251878['device']]['uniqueid']:_0x251878[_0x504e('0x19')]),_0x8a0746);}};exports[_0x504e('0x25')]=function(_0x4c4932){try{if(!_[_0x504e('0x21')](members[_0x4c4932['interface']])){utils[_0x504e('0x26')](util['format'](_0x504e('0x27'),_0x4c4932[_0x504e('0x14')]),_0x4c4932);utils[_0x504e('0x3')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x4c4932[_0x504e('0x14')],_0x4c4932[_0x504e('0x4')],_0x4c4932[_0x504e('0x28')]));members[_0x4c4932[_0x504e('0x4')]]=_[_0x504e('0x29')](members[_0x4c4932['interface']],{'data4':_0x4c4932[_0x504e('0x28')],'uniqueid':_0x4c4932[_0x504e('0x14')]});}}catch(_0x43995d){utils[_0x504e('0x11')](util[_0x504e('0x12')](_0x504e('0x27'),_0x4c4932[_0x504e('0x14')]),_0x43995d);}};exports[_0x504e('0x2a')]=function(_0x4926b0){try{utils[_0x504e('0x26')](util[_0x504e('0x12')]('[%s][members][cdr]',_0x4926b0[_0x504e('0x14')]),_0x4926b0);if(_0x4926b0[_0x504e('0x5')]){var _0x554949=_0x4926b0[_0x504e('0x5')][_0x504e('0x10')]('-')[0x0];if(!_[_0x504e('0x21')](members[_0x554949])){members[_0x554949]=_['assign'](members[_0x554949],{'data1':members[_0x554949]['data1']||_0x4926b0[_0x504e('0x8')],'data2':members[_0x554949]['data2']||_0x4926b0[_0x504e('0x2b')],'data3':members[_0x554949][_0x504e('0x2c')]||_0x4926b0[_0x504e('0x2d')],'uniqueid':members[_0x554949][_0x504e('0x14')]||_0x4926b0['uniqueid']});utils[_0x504e('0x3')](util[_0x504e('0x12')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4926b0[_0x504e('0x14')],members[_0x554949]['data1'],members[_0x554949]['data2'],members[_0x554949][_0x504e('0x2c')]));if(members[_0x554949][_0x504e('0x22')]){writeDB(members[_0x554949]);}}}if(_0x4926b0[_0x504e('0x2e')]){var _0x1f271e=_0x4926b0[_0x504e('0x2e')][_0x504e('0x10')]('-')[0x0];if(!_['isNil'](members[_0x1f271e])){members[_0x1f271e]=_[_0x504e('0x29')](members[_0x1f271e],{'data1':members[_0x1f271e][_0x504e('0x2f')]||_0x4926b0[_0x504e('0x8')],'data2':members[_0x1f271e][_0x504e('0x6')]||_0x4926b0[_0x504e('0x2b')],'data3':members[_0x1f271e][_0x504e('0x2c')]||_0x4926b0[_0x504e('0x2d')],'uniqueid':members[_0x1f271e][_0x504e('0x14')]||_0x4926b0[_0x504e('0x14')]});utils[_0x504e('0x3')](util['format'](_0x504e('0x30'),_0x4926b0[_0x504e('0x14')],members[_0x1f271e][_0x504e('0x2f')],members[_0x1f271e][_0x504e('0x6')],members[_0x1f271e][_0x504e('0x2c')]));if(members[_0x1f271e][_0x504e('0x22')]){writeDB(members[_0x1f271e]);}}}}catch(_0x3b6f1b){utils[_0x504e('0x11')](util['format'](_0x504e('0x31'),_0x4926b0[_0x504e('0x14')]),_0x3b6f1b);}};
\ No newline at end of file
index 5964662..c9f8f34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7857=['origtransfererlinkedid','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitreason','value','queueposition','EXITWITHKEY','error','[%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','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','membername','destaccountcode','queuecallerexitAt','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','extension','transferuniqueid','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','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x265326,_0x137b09){var _0x149833=function(_0x5f0f27){while(--_0x5f0f27){_0x265326['push'](_0x265326['shift']());}};_0x149833(++_0x137b09);}(_0x7857,0x1a2));var _0x7785=function(_0x2ef565,_0x3a8ee1){_0x2ef565=_0x2ef565-0x0;var _0x1bf396=_0x7857[_0x2ef565];return _0x1bf396;};'use strict';var _=require(_0x7785('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0xdb4905){utils[_0x7785('0x1')](util['format'](_0x7785('0x2'),_0xdb4905[_0x7785('0x3')],_0xdb4905[_0x7785('0x4')],_0xdb4905[_0x7785('0x5')],_0xdb4905[_0x7785('0x6')],_0xdb4905[_0x7785('0x7')],_0xdb4905[_0x7785('0x8')],_0xdb4905['queuecallerexitreason']));if(_0xdb4905[_0x7785('0x5')]){utils[_0x7785('0x9')](_0xdb4905[_0x7785('0x5')])['then'](function(_0x8f8e7d){if(_0x8f8e7d){_0xdb4905[_0x7785('0xa')]=_0x8f8e7d['type'];}utils[_0x7785('0xb')]('CreateVoiceQueueReport',_0xdb4905);});}else{utils[_0x7785('0xb')](_0x7785('0xc'),_0xdb4905);}if(_0xdb4905[_0x7785('0xd')]){delete queues[_0xdb4905[_0x7785('0xd')]];}else{delete queues[_0xdb4905[_0x7785('0x3')]];}}exports[_0x7785('0xe')]=function(_0x123264){try{utils[_0x7785('0xf')](util[_0x7785('0x10')](_0x7785('0x11'),_0x123264['uniqueid']),_0x123264);utils[_0x7785('0x1')](util[_0x7785('0x10')](_0x7785('0x12'),_0x123264[_0x7785('0x3')],_0x123264[_0x7785('0x5')],_0x123264['position']));queues[_0x123264[_0x7785('0x3')]]=_[_0x7785('0x13')](_0x123264,{'originalposition':_0x123264[_0x7785('0x14')],'queuecallerjoinAt':utils[_0x7785('0x15')](),'mohtime':0x0});}catch(_0x403f8a){utils['error'](util[_0x7785('0x10')]('[%s][queues][queuecallerjoin]',_0x123264[_0x7785('0x3')]),_0x403f8a);}};exports['hangup']=function(_0x3da0b6){try{if(!_[_0x7785('0x16')](queues[_0x3da0b6['uniqueid']])){utils['debug'](util[_0x7785('0x10')](_0x7785('0x17'),_0x3da0b6[_0x7785('0x3')]),_0x3da0b6);if(queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0x18')]){if(!queues[_0x3da0b6[_0x7785('0x3')]]['queuecallerabandon']&&!queues[_0x3da0b6['uniqueid']]['queuecallerexit']){queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0x19')]=!![];queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0x1a')]=utils[_0x7785('0x15')]();queues[_0x3da0b6[_0x7785('0x3')]]['queuecallerexitreason']=_0x7785('0x1b');}utils[_0x7785('0x1')](util['format'](_0x7785('0x1c'),_0x3da0b6[_0x7785('0x3')],queues[_0x3da0b6['uniqueid']][_0x7785('0x1d')],queues[_0x3da0b6[_0x7785('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x3da0b6['uniqueid']]);}else if(queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0xd')]){utils[_0x7785('0x1')](util[_0x7785('0x10')](_0x7785('0x1e'),_0x3da0b6[_0x7785('0x3')],queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0x1d')],queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0xd')]));queues[queues[_0x3da0b6['uniqueid']]['transfereduniqueid']]=queues[_0x3da0b6[_0x7785('0x3')]];queues[queues[_0x3da0b6[_0x7785('0x3')]][_0x7785('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x3da0b6[_0x7785('0x3')]];}}}catch(_0x477138){utils['error'](util['format'](_0x7785('0x17'),_0x3da0b6[_0x7785('0x3')]),_0x477138);}};exports[_0x7785('0x1f')]=function(_0x4de516){try{utils[_0x7785('0xf')](util[_0x7785('0x10')](_0x7785('0x20'),_0x4de516[_0x7785('0x3')]),_0x4de516);if(!_[_0x7785('0x16')](_0x4de516[_0x7785('0x21')][_0x7785('0x22')])&&_0x4de516['value'][_0x7785('0x23')]()!==_0x7785('0x24')){if(!_['isNil'](queues[_0x4de516[_0x7785('0x3')]])){queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x25')]=![];queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x26')]=null;queues[_0x4de516['uniqueid']][_0x7785('0x27')]=!![];queues[_0x4de516[_0x7785('0x3')]]['queuecallerexitAt']=utils[_0x7785('0x15')]();queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x28')]=_0x4de516[_0x7785('0x29')][_0x7785('0x23')]();utils[_0x7785('0x1')](util[_0x7785('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4de516[_0x7785('0x3')],queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x1d')],_0x4de516[_0x7785('0x29')],queues[_0x4de516['uniqueid']][_0x7785('0x28')]));writeDB(queues[_0x4de516[_0x7785('0x3')]]);}}else if(!_[_0x7785('0x16')](_0x4de516[_0x7785('0x21')][_0x7785('0x2a')])){if(!_['isNil'](queues[_0x4de516[_0x7785('0x3')]])&&!queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x25')]){queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x25')]=![];queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x26')]=null;queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x27')]=!![];queues[_0x4de516[_0x7785('0x3')]]['queuecallerexitAt']=utils['now']();queues[_0x4de516[_0x7785('0x3')]]['queuecallerexitreason']=_0x7785('0x2b');utils['info'](util[_0x7785('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4de516[_0x7785('0x3')],queues[_0x4de516['uniqueid']][_0x7785('0x1d')],_0x4de516[_0x7785('0x29')],queues[_0x4de516[_0x7785('0x3')]][_0x7785('0x28')]));}}}catch(_0x1b84e3){utils[_0x7785('0x2c')](util[_0x7785('0x10')](_0x7785('0x20'),_0x4de516[_0x7785('0x3')]),_0x1b84e3);}};exports[_0x7785('0x25')]=function(_0x3aaa92){try{if(!_['isNil'](queues[_0x3aaa92[_0x7785('0x3')]])){utils['debug'](util[_0x7785('0x10')](_0x7785('0x2d'),_0x3aaa92['uniqueid']),_0x3aaa92);queues[_0x3aaa92['uniqueid']][_0x7785('0x27')]=![];queues[_0x3aaa92[_0x7785('0x3')]]['queuecallerexitAt']=null;queues[_0x3aaa92[_0x7785('0x3')]]['queuecallerabandon']=!![];queues[_0x3aaa92['uniqueid']][_0x7785('0x26')]=utils[_0x7785('0x15')]();queues[_0x3aaa92['uniqueid']][_0x7785('0x28')]=_0x7785('0x2e');utils[_0x7785('0x1')](util[_0x7785('0x10')](_0x7785('0x2f'),_0x3aaa92['uniqueid'],queues[_0x3aaa92[_0x7785('0x3')]]['name'],queues[_0x3aaa92[_0x7785('0x3')]][_0x7785('0x28')]));}}catch(_0x552976){utils[_0x7785('0x2c')](util[_0x7785('0x10')]('[%s][queues][queuecallerabandon]',_0x3aaa92[_0x7785('0x3')]),_0x552976);}};exports[_0x7785('0x30')]=function(_0x4ffde5){try{if(!_['isNil'](queues[_0x4ffde5[_0x7785('0x3')]])){utils[_0x7785('0xf')](util[_0x7785('0x10')](_0x7785('0x31'),_0x4ffde5['uniqueid']),_0x4ffde5);utils[_0x7785('0x1')](util['format'](_0x7785('0x32'),_0x4ffde5['uniqueid'],queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x1d')],_0x4ffde5[_0x7785('0x33')],_0x4ffde5['connectedlinename']));queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x30')]=!![];queues[_0x4ffde5[_0x7785('0x3')]]['queuecallerleaveAt']=utils[_0x7785('0x15')]();queues[_0x4ffde5[_0x7785('0x3')]]['holdtime']=utils[_0x7785('0x34')](queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x18')],queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x35')]);queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x14')]=_0x4ffde5[_0x7785('0x14')];queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x36')]=_0x4ffde5[_0x7785('0x36')];queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x33')]=_0x4ffde5[_0x7785('0x33')];queues[_0x4ffde5[_0x7785('0x3')]][_0x7785('0x37')]=_0x4ffde5[_0x7785('0x37')];}}catch(_0x3d1599){utils['error'](util[_0x7785('0x10')]('[%s][queues][queuecallerleave]',_0x4ffde5[_0x7785('0x3')]),_0x3d1599);}};exports[_0x7785('0x38')]=function(_0x3d3b83){try{if(!_[_0x7785('0x16')](queues[_0x3d3b83[_0x7785('0x3')]])){utils['debug'](util[_0x7785('0x10')]('[%s][queues][agentconnect]',_0x3d3b83['uniqueid']),_0x3d3b83);utils[_0x7785('0x1')](util[_0x7785('0x10')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3d3b83[_0x7785('0x3')],queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x1d')],_0x3d3b83[_0x7785('0x39')],_0x3d3b83[_0x7785('0x3a')]));queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x25')]=![];queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x25')]=![];queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x26')]=null;queues[_0x3d3b83['uniqueid']][_0x7785('0x27')]=![];queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x28')]=null;queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x3b')]=null;queues[_0x3d3b83[_0x7785('0x3')]]['assigned']=!![];queues[_0x3d3b83['uniqueid']][_0x7785('0x8')]=_0x3d3b83[_0x7785('0x3a')];queues[_0x3d3b83[_0x7785('0x3')]][_0x7785('0x6')]=_0x3d3b83[_0x7785('0x39')];}}catch(_0x20de2a){utils[_0x7785('0x2c')](util[_0x7785('0x10')](_0x7785('0x3c'),_0x3d3b83[_0x7785('0x3')]),_0x20de2a);}};exports[_0x7785('0x3d')]=function(_0xc7d74e){try{if(!_[_0x7785('0x16')](queues[_0xc7d74e[_0x7785('0x3')]])){if(queues[_0xc7d74e[_0x7785('0x3')]][_0x7785('0x18')]){utils[_0x7785('0xf')](util['format'](_0x7785('0x3e'),_0xc7d74e[_0x7785('0x3')]),_0xc7d74e);queues[_0xc7d74e['uniqueid']]['queuecallerabandon']=![];queues[_0xc7d74e[_0x7785('0x3')]][_0x7785('0x25')]=![];queues[_0xc7d74e['uniqueid']][_0x7785('0x26')]=null;queues[_0xc7d74e[_0x7785('0x3')]]['queuecallerexit']=![];queues[_0xc7d74e['uniqueid']][_0x7785('0x3b')]=null;queues[_0xc7d74e[_0x7785('0x3')]]['assigned']=!![];queues[_0xc7d74e[_0x7785('0x3')]][_0x7785('0x6')]=_0xc7d74e['membername'];queues[_0xc7d74e['uniqueid']][_0x7785('0x19')]=!![];queues[_0xc7d74e[_0x7785('0x3')]][_0x7785('0x1a')]=utils[_0x7785('0x15')]();if(_0xc7d74e[_0x7785('0x3f')]==_0x7785('0x40')){if(!queues[_0xc7d74e['uniqueid']][_0x7785('0x40')]){queues[_0xc7d74e['uniqueid']]['queuecallerexitreason']=_0x7785('0x41');}}else{queues[_0xc7d74e[_0x7785('0x3')]][_0x7785('0x28')]=_0x7785('0x42')+_0xc7d74e[_0x7785('0x3f')][_0x7785('0x23')]();}utils[_0x7785('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xc7d74e[_0x7785('0x3')],queues[_0xc7d74e[_0x7785('0x3')]][_0x7785('0x1d')],_0xc7d74e[_0x7785('0x39')],queues[_0xc7d74e['uniqueid']][_0x7785('0x28')]));writeDB(queues[_0xc7d74e['uniqueid']]);}}}catch(_0xa61b6b){utils['error'](util[_0x7785('0x10')](_0x7785('0x3e'),_0xc7d74e[_0x7785('0x3')]),_0xa61b6b);}};exports['blindtransfer']=function(_0x15cb1e){try{if(!_[_0x7785('0x16')](queues[_0x15cb1e[_0x7785('0x43')]])){utils[_0x7785('0xf')](util[_0x7785('0x10')](_0x7785('0x44'),_0x15cb1e[_0x7785('0x3')]),_0x15cb1e);queues[_0x15cb1e['transfereeuniqueid']][_0x7785('0x40')]=!![];queues[_0x15cb1e[_0x7785('0x43')]][_0x7785('0x45')]='BLIND';queues[_0x15cb1e[_0x7785('0x43')]]['transferexten']=_0x15cb1e[_0x7785('0x46')];queues[_0x15cb1e['transfereeuniqueid']][_0x7785('0x47')]=_0x15cb1e[_0x7785('0x43')];queues[_0x15cb1e[_0x7785('0x43')]][_0x7785('0x28')]=_0x7785('0x48');utils['info'](util[_0x7785('0x10')](_0x7785('0x49'),_0x15cb1e[_0x7785('0x3')],queues[_0x15cb1e[_0x7785('0x43')]][_0x7785('0x1d')],_0x15cb1e[_0x7785('0x43')],_0x15cb1e[_0x7785('0x46')]));}}catch(_0x49328a){utils[_0x7785('0x2c')](util[_0x7785('0x10')](_0x7785('0x44'),_0x15cb1e[_0x7785('0x3')]),_0x49328a);}};exports[_0x7785('0x4a')]=function(_0x34c4b2){try{utils[_0x7785('0xf')](util[_0x7785('0x10')](_0x7785('0x4b'),_0x34c4b2[_0x7785('0x4c')]),_0x34c4b2);if(_0x34c4b2[_0x7785('0x4c')]==_0x34c4b2['origtransfererlinkedid']){if(!_[_0x7785('0x16')](queues[_0x34c4b2[_0x7785('0x4d')]])){utils['info'](util[_0x7785('0x10')](_0x7785('0x4e'),_0x34c4b2['origtransfereruniqueid'],queues[_0x34c4b2['secondtransfererlinkedid']][_0x7785('0x1d')],_0x34c4b2[_0x7785('0x4f')]));queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x40')]=!![];queues[_0x34c4b2[_0x7785('0x4d')]]['transfertype']=_0x7785('0x50');queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x51')]=_0x34c4b2['origtransfererexten'];queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x47')]=_0x34c4b2[_0x7785('0x4c')];queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x28')]=_0x7785('0x52');}if(!_[_0x7785('0x16')](queues[_0x34c4b2['origtransfererlinkedid']])){if(_0x34c4b2[_0x7785('0x53')]&&queues[_0x34c4b2[_0x7785('0x53')]]){queues[_0x34c4b2[_0x7785('0x53')]][_0x7785('0x54')]=0x1;queues[_0x34c4b2[_0x7785('0x43')]]=_[_0x7785('0x55')](queues[_0x34c4b2[_0x7785('0x53')]]);queues[_0x34c4b2[_0x7785('0x43')]]['transfereduniqueid']=_0x34c4b2[_0x7785('0x56')];queues[_0x34c4b2[_0x7785('0x43')]][_0x7785('0x54')]=0x2;queues[_0x34c4b2['transfereeuniqueid']][_0x7785('0x7')]=queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x7')];queues[_0x34c4b2[_0x7785('0x43')]]['calleridname']=queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x57')];queues[_0x34c4b2['transfereeuniqueid']][_0x7785('0x35')]=utils[_0x7785('0x15')]();queues[_0x34c4b2[_0x7785('0x43')]][_0x7785('0x18')]=utils['now']();queues[_0x34c4b2[_0x7785('0x43')]][_0x7785('0x58')]=0x0;queues[_0x34c4b2[_0x7785('0x43')]][_0x7785('0x59')]=0x0;utils[_0x7785('0x1')](util[_0x7785('0x10')](_0x7785('0x5a'),_0x34c4b2['origtransfereruniqueid'],queues[_0x34c4b2['transfereeuniqueid']][_0x7785('0x1d')],queues[_0x34c4b2[_0x7785('0x43')]][_0x7785('0x7')],queues[_0x34c4b2['transfereeuniqueid']][_0x7785('0x57')]));}else{utils[_0x7785('0x1')](util[_0x7785('0x10')](_0x7785('0x5b'),_0x34c4b2[_0x7785('0x4c')],queues[_0x34c4b2['origtransfererlinkedid']][_0x7785('0x1d')],_0x34c4b2[_0x7785('0x4d')]));queues[_0x34c4b2[_0x7785('0x5c')]][_0x7785('0xd')]=_0x34c4b2[_0x7785('0x4d')];}}}else if(_0x34c4b2[_0x7785('0x5d')]==_0x34c4b2['secondtransfererlinkedid']){if(!_[_0x7785('0x16')](queues[_0x34c4b2['origtransfererlinkedid']])){utils['info'](util[_0x7785('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x34c4b2['origtransfereruniqueid'],queues[_0x34c4b2[_0x7785('0x5c')]][_0x7785('0x1d')],_0x34c4b2[_0x7785('0x5d')],_0x34c4b2[_0x7785('0x5e')]));queues[_0x34c4b2[_0x7785('0x5c')]][_0x7785('0x40')]=!![];queues[_0x34c4b2[_0x7785('0x5c')]]['transfertype']=_0x7785('0x50');queues[_0x34c4b2['origtransfererlinkedid']][_0x7785('0x51')]=_0x34c4b2[_0x7785('0x5e')];queues[_0x34c4b2['origtransfererlinkedid']][_0x7785('0x47')]=_0x34c4b2[_0x7785('0x5d')];queues[_0x34c4b2[_0x7785('0x5c')]][_0x7785('0x28')]=_0x7785('0x52');}if(!_[_0x7785('0x16')](queues[_0x34c4b2[_0x7785('0x4d')]])){if(_0x34c4b2[_0x7785('0x5f')]&&queues[_0x34c4b2[_0x7785('0x5f')]]){queues[_0x34c4b2[_0x7785('0x5f')]][_0x7785('0x54')]=0x1;queues[_0x34c4b2[_0x7785('0x56')]]=_[_0x7785('0x55')](queues[_0x34c4b2[_0x7785('0x5f')]]);queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0xd')]=_0x34c4b2[_0x7785('0x56')];queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x54')]=0x2;queues[_0x34c4b2['transfertargetuniqueid']][_0x7785('0x7')]=queues[_0x34c4b2[_0x7785('0x5c')]]['calleridnum'];queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x57')]=queues[_0x34c4b2[_0x7785('0x5c')]][_0x7785('0x57')];queues[_0x34c4b2['transfertargetuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x18')]=utils[_0x7785('0x15')]();queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x58')]=0x0;queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x59')]=0x0;utils[_0x7785('0x1')](util[_0x7785('0x10')](_0x7785('0x60'),_0x34c4b2[_0x7785('0x4c')],queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x1d')],queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0xd')],queues[_0x34c4b2['transfertargetuniqueid']][_0x7785('0x7')],queues[_0x34c4b2[_0x7785('0x56')]][_0x7785('0x57')]));}else{utils['info'](util[_0x7785('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x34c4b2[_0x7785('0x4c')],queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0x1d')],_0x34c4b2[_0x7785('0x5c')]));queues[_0x34c4b2[_0x7785('0x4d')]][_0x7785('0xd')]=_0x34c4b2[_0x7785('0x5c')];}}}}catch(_0x585b2d){utils[_0x7785('0x2c')](util[_0x7785('0x10')](_0x7785('0x4b'),_0x34c4b2[_0x7785('0x4c')]),_0x585b2d);}};exports['musiconholdstart']=function(_0x2f645a){try{if(!_[_0x7785('0x16')](queues[_0x2f645a['uniqueid']])){utils['debug'](util['format'](_0x7785('0x61'),_0x2f645a[_0x7785('0x3')]),_0x2f645a);queues[_0x2f645a[_0x7785('0x3')]][_0x7785('0x62')]=utils[_0x7785('0x15')]();utils['info'](util[_0x7785('0x10')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2f645a[_0x7785('0x3')],queues[_0x2f645a[_0x7785('0x3')]]['name'],queues[_0x2f645a[_0x7785('0x3')]]['musiconholdstartAt']));}}catch(_0x2c6878){utils[_0x7785('0x2c')](util['format'](_0x7785('0x61'),_0x2f645a[_0x7785('0x3')]),_0x2c6878);}};exports[_0x7785('0x63')]=function(_0x53ad8a){try{if(!_[_0x7785('0x16')](queues[_0x53ad8a['uniqueid']])){if(!_[_0x7785('0x16')](queues[_0x53ad8a[_0x7785('0x3')]][_0x7785('0x62')])){utils[_0x7785('0xf')](util[_0x7785('0x10')](_0x7785('0x64'),_0x53ad8a['uniqueid']),_0x53ad8a);queues[_0x53ad8a[_0x7785('0x3')]][_0x7785('0x59')]+=utils[_0x7785('0x34')](utils[_0x7785('0x15')](),queues[_0x53ad8a[_0x7785('0x3')]][_0x7785('0x62')]);utils[_0x7785('0x1')](util['format'](_0x7785('0x65'),_0x53ad8a['uniqueid'],queues[_0x53ad8a[_0x7785('0x3')]][_0x7785('0x1d')],queues[_0x53ad8a[_0x7785('0x3')]]['mohtime']));delete queues[_0x53ad8a[_0x7785('0x3')]][_0x7785('0x62')];}}}catch(_0x3c1762){utils[_0x7785('0x2c')](util['format'](_0x7785('0x64'),_0x53ad8a[_0x7785('0x3')]),_0x3c1762);}};
\ No newline at end of file
+var _0xad02=['lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','COMPLETEDBY','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','./utils','uniqueid','queue','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','queueposition','queuecallerabandonAt','queuecallerexit','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','accountcode'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xad02,0x1c0));var _0x2ad0=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xad02[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0x2ad0('0x0'));var util=require('util');var utils=require(_0x2ad0('0x1'));var queues={};function writeDB(_0x5a3a5d){utils['info'](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5a3a5d[_0x2ad0('0x2')],_0x5a3a5d['channel'],_0x5a3a5d[_0x2ad0('0x3')],_0x5a3a5d['lastAssignedTo'],_0x5a3a5d[_0x2ad0('0x4')],_0x5a3a5d['accountcode'],_0x5a3a5d[_0x2ad0('0x5')]));if(_0x5a3a5d[_0x2ad0('0x3')]){utils[_0x2ad0('0x6')](_0x5a3a5d[_0x2ad0('0x3')])[_0x2ad0('0x7')](function(_0x765e67){if(_0x765e67){_0x5a3a5d[_0x2ad0('0x8')]=_0x765e67[_0x2ad0('0x8')];}utils[_0x2ad0('0x9')](_0x2ad0('0xa'),_0x5a3a5d);});}else{utils[_0x2ad0('0x9')](_0x2ad0('0xa'),_0x5a3a5d);}if(_0x5a3a5d[_0x2ad0('0xb')]){delete queues[_0x5a3a5d[_0x2ad0('0xb')]];}else{delete queues[_0x5a3a5d[_0x2ad0('0x2')]];}}exports['queuecallerjoin']=function(_0x3ea447){try{utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0xe'),_0x3ea447[_0x2ad0('0x2')]),_0x3ea447);utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x10'),_0x3ea447[_0x2ad0('0x2')],_0x3ea447[_0x2ad0('0x3')],_0x3ea447['position']));queues[_0x3ea447['uniqueid']]=_[_0x2ad0('0x11')](_0x3ea447,{'originalposition':_0x3ea447[_0x2ad0('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x1f7533){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0xe'),_0x3ea447[_0x2ad0('0x2')]),_0x1f7533);}};exports[_0x2ad0('0x14')]=function(_0x2c9632){try{if(!_[_0x2ad0('0x15')](queues[_0x2c9632[_0x2ad0('0x2')]])){utils[_0x2ad0('0xc')](util['format'](_0x2ad0('0x16'),_0x2c9632['uniqueid']),_0x2c9632);if(queues[_0x2c9632['uniqueid']][_0x2ad0('0x17')]){if(!queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0x18')]&&!queues[_0x2c9632['uniqueid']]['queuecallerexit']){queues[_0x2c9632[_0x2ad0('0x2')]]['queuecallercomplete']=!![];queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0x19')]=utils[_0x2ad0('0x1a')]();queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0x5')]=_0x2ad0('0x1b');}utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x1c'),_0x2c9632['uniqueid'],queues[_0x2c9632['uniqueid']][_0x2ad0('0x1d')],queues[_0x2c9632[_0x2ad0('0x2')]]['queuecallerexitreason']));writeDB(queues[_0x2c9632[_0x2ad0('0x2')]]);}else if(queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0xb')]){utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x1e'),_0x2c9632['uniqueid'],queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0x1d')],queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0xb')]));queues[queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0xb')]]=queues[_0x2c9632[_0x2ad0('0x2')]];queues[queues[_0x2c9632[_0x2ad0('0x2')]][_0x2ad0('0xb')]][_0x2ad0('0x1f')]=0x2;delete queues[_0x2c9632[_0x2ad0('0x2')]];}}}catch(_0x45edf4){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0x16'),_0x2c9632[_0x2ad0('0x2')]),_0x45edf4);}};exports[_0x2ad0('0x20')]=function(_0x495f26){try{utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0x21'),_0x495f26[_0x2ad0('0x2')]),_0x495f26);if(!_[_0x2ad0('0x15')](_0x495f26[_0x2ad0('0x22')][_0x2ad0('0x23')])&&_0x495f26[_0x2ad0('0x24')][_0x2ad0('0x25')]()!==_0x2ad0('0x26')){if(!_[_0x2ad0('0x15')](queues[_0x495f26[_0x2ad0('0x2')]])){queues[_0x495f26[_0x2ad0('0x2')]][_0x2ad0('0x18')]=![];queues[_0x495f26[_0x2ad0('0x2')]]['queuecallerabandonAt']=null;queues[_0x495f26[_0x2ad0('0x2')]]['queuecallerexit']=!![];queues[_0x495f26[_0x2ad0('0x2')]][_0x2ad0('0x27')]=utils[_0x2ad0('0x1a')]();queues[_0x495f26[_0x2ad0('0x2')]][_0x2ad0('0x5')]=_0x495f26['value'][_0x2ad0('0x25')]();utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x495f26[_0x2ad0('0x2')],queues[_0x495f26[_0x2ad0('0x2')]]['name'],_0x495f26[_0x2ad0('0x24')],queues[_0x495f26['uniqueid']][_0x2ad0('0x5')]));writeDB(queues[_0x495f26['uniqueid']]);}}else if(!_[_0x2ad0('0x15')](_0x495f26[_0x2ad0('0x22')][_0x2ad0('0x28')])){if(!_[_0x2ad0('0x15')](queues[_0x495f26[_0x2ad0('0x2')]])&&!queues[_0x495f26[_0x2ad0('0x2')]][_0x2ad0('0x18')]){queues[_0x495f26[_0x2ad0('0x2')]][_0x2ad0('0x18')]=![];queues[_0x495f26[_0x2ad0('0x2')]][_0x2ad0('0x29')]=null;queues[_0x495f26['uniqueid']][_0x2ad0('0x2a')]=!![];queues[_0x495f26['uniqueid']][_0x2ad0('0x27')]=utils[_0x2ad0('0x1a')]();queues[_0x495f26['uniqueid']][_0x2ad0('0x5')]=_0x2ad0('0x2b');utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x2c'),_0x495f26['uniqueid'],queues[_0x495f26[_0x2ad0('0x2')]]['name'],_0x495f26[_0x2ad0('0x24')],queues[_0x495f26['uniqueid']][_0x2ad0('0x5')]));}}}catch(_0x3ddd38){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')]('[%s][queues][varset]',_0x495f26['uniqueid']),_0x3ddd38);}};exports[_0x2ad0('0x18')]=function(_0x4ab2ba){try{if(!_[_0x2ad0('0x15')](queues[_0x4ab2ba[_0x2ad0('0x2')]])){utils[_0x2ad0('0xc')](util['format']('[%s][queues][queuecallerabandon]',_0x4ab2ba[_0x2ad0('0x2')]),_0x4ab2ba);queues[_0x4ab2ba[_0x2ad0('0x2')]][_0x2ad0('0x2a')]=![];queues[_0x4ab2ba['uniqueid']]['queuecallerexitAt']=null;queues[_0x4ab2ba[_0x2ad0('0x2')]][_0x2ad0('0x18')]=!![];queues[_0x4ab2ba[_0x2ad0('0x2')]][_0x2ad0('0x29')]=utils[_0x2ad0('0x1a')]();queues[_0x4ab2ba['uniqueid']][_0x2ad0('0x5')]=_0x2ad0('0x2d');utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x4ab2ba[_0x2ad0('0x2')],queues[_0x4ab2ba[_0x2ad0('0x2')]]['name'],queues[_0x4ab2ba[_0x2ad0('0x2')]]['queuecallerexitreason']));}}catch(_0x4f14bc){utils['error'](util[_0x2ad0('0xd')](_0x2ad0('0x2e'),_0x4ab2ba['uniqueid']),_0x4f14bc);}};exports[_0x2ad0('0x2f')]=function(_0x2c9a7a){try{if(!_[_0x2ad0('0x15')](queues[_0x2c9a7a['uniqueid']])){utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0x30'),_0x2c9a7a['uniqueid']),_0x2c9a7a);utils['info'](util[_0x2ad0('0xd')](_0x2ad0('0x31'),_0x2c9a7a[_0x2ad0('0x2')],queues[_0x2c9a7a['uniqueid']][_0x2ad0('0x1d')],_0x2c9a7a[_0x2ad0('0x32')],_0x2c9a7a[_0x2ad0('0x33')]));queues[_0x2c9a7a[_0x2ad0('0x2')]]['queuecallerleave']=!![];queues[_0x2c9a7a['uniqueid']][_0x2ad0('0x17')]=utils['now']();queues[_0x2c9a7a[_0x2ad0('0x2')]][_0x2ad0('0x34')]=utils[_0x2ad0('0x35')](queues[_0x2c9a7a['uniqueid']][_0x2ad0('0x17')],queues[_0x2c9a7a[_0x2ad0('0x2')]][_0x2ad0('0x36')]);queues[_0x2c9a7a[_0x2ad0('0x2')]]['position']=_0x2c9a7a[_0x2ad0('0x12')];queues[_0x2c9a7a[_0x2ad0('0x2')]][_0x2ad0('0x37')]=_0x2c9a7a[_0x2ad0('0x37')];queues[_0x2c9a7a[_0x2ad0('0x2')]][_0x2ad0('0x32')]=_0x2c9a7a[_0x2ad0('0x32')];queues[_0x2c9a7a[_0x2ad0('0x2')]][_0x2ad0('0x33')]=_0x2c9a7a[_0x2ad0('0x33')];}}catch(_0x454b76){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0x30'),_0x2c9a7a['uniqueid']),_0x454b76);}};exports[_0x2ad0('0x38')]=function(_0x27867d){try{if(!_[_0x2ad0('0x15')](queues[_0x27867d['uniqueid']])){utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0x39'),_0x27867d['uniqueid']),_0x27867d);utils[_0x2ad0('0xf')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x27867d[_0x2ad0('0x2')],queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x1d')],_0x27867d[_0x2ad0('0x3a')],_0x27867d[_0x2ad0('0x3b')]));queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x18')]=![];queues[_0x27867d['uniqueid']]['queuecallerabandon']=![];queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x29')]=null;queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x2a')]=![];queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x5')]=null;queues[_0x27867d['uniqueid']][_0x2ad0('0x27')]=null;queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x3c')]=!![];queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x3d')]=_0x27867d[_0x2ad0('0x3b')];queues[_0x27867d[_0x2ad0('0x2')]][_0x2ad0('0x3e')]=_0x27867d[_0x2ad0('0x3a')];}}catch(_0x4088d8){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0x39'),_0x27867d[_0x2ad0('0x2')]),_0x4088d8);}};exports[_0x2ad0('0x3f')]=function(_0x371102){try{if(!_[_0x2ad0('0x15')](queues[_0x371102[_0x2ad0('0x2')]])){if(queues[_0x371102[_0x2ad0('0x2')]][_0x2ad0('0x17')]){utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0x40'),_0x371102[_0x2ad0('0x2')]),_0x371102);queues[_0x371102[_0x2ad0('0x2')]][_0x2ad0('0x18')]=![];queues[_0x371102['uniqueid']][_0x2ad0('0x18')]=![];queues[_0x371102[_0x2ad0('0x2')]][_0x2ad0('0x29')]=null;queues[_0x371102[_0x2ad0('0x2')]]['queuecallerexit']=![];queues[_0x371102['uniqueid']][_0x2ad0('0x27')]=null;queues[_0x371102[_0x2ad0('0x2')]]['assigned']=!![];queues[_0x371102[_0x2ad0('0x2')]][_0x2ad0('0x3e')]=_0x371102['membername'];queues[_0x371102[_0x2ad0('0x2')]][_0x2ad0('0x41')]=!![];queues[_0x371102['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x371102[_0x2ad0('0x42')]==_0x2ad0('0x43')){if(!queues[_0x371102['uniqueid']][_0x2ad0('0x43')]){queues[_0x371102['uniqueid']][_0x2ad0('0x5')]='TRANSFER';}}else{queues[_0x371102['uniqueid']][_0x2ad0('0x5')]=_0x2ad0('0x44')+_0x371102[_0x2ad0('0x42')][_0x2ad0('0x25')]();}utils['info'](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x371102[_0x2ad0('0x2')],queues[_0x371102[_0x2ad0('0x2')]][_0x2ad0('0x1d')],_0x371102[_0x2ad0('0x3a')],queues[_0x371102['uniqueid']][_0x2ad0('0x5')]));writeDB(queues[_0x371102['uniqueid']]);}}}catch(_0x431c4d){utils[_0x2ad0('0x13')](util['format'](_0x2ad0('0x40'),_0x371102[_0x2ad0('0x2')]),_0x431c4d);}};exports[_0x2ad0('0x45')]=function(_0x19051d){try{if(!_[_0x2ad0('0x15')](queues[_0x19051d['transfereeuniqueid']])){utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0x46'),_0x19051d[_0x2ad0('0x2')]),_0x19051d);queues[_0x19051d[_0x2ad0('0x47')]]['transfer']=!![];queues[_0x19051d[_0x2ad0('0x47')]][_0x2ad0('0x48')]=_0x2ad0('0x49');queues[_0x19051d[_0x2ad0('0x47')]][_0x2ad0('0x4a')]=_0x19051d[_0x2ad0('0x4b')];queues[_0x19051d[_0x2ad0('0x47')]]['transferuniqueid']=_0x19051d[_0x2ad0('0x47')];queues[_0x19051d[_0x2ad0('0x47')]][_0x2ad0('0x5')]='BLINDTRANSFER';utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x19051d[_0x2ad0('0x2')],queues[_0x19051d[_0x2ad0('0x47')]][_0x2ad0('0x1d')],_0x19051d[_0x2ad0('0x47')],_0x19051d[_0x2ad0('0x4b')]));}}catch(_0x48c0ee){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0x46'),_0x19051d[_0x2ad0('0x2')]),_0x48c0ee);}};exports[_0x2ad0('0x4c')]=function(_0x1b5399){try{utils[_0x2ad0('0xc')](util[_0x2ad0('0xd')](_0x2ad0('0x4d'),_0x1b5399['origtransfereruniqueid']),_0x1b5399);if(_0x1b5399[_0x2ad0('0x4e')]==_0x1b5399[_0x2ad0('0x4f')]){if(!_[_0x2ad0('0x15')](queues[_0x1b5399[_0x2ad0('0x50')]])){utils[_0x2ad0('0xf')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1b5399[_0x2ad0('0x4e')],queues[_0x1b5399['secondtransfererlinkedid']][_0x2ad0('0x1d')],_0x1b5399[_0x2ad0('0x51')]));queues[_0x1b5399[_0x2ad0('0x50')]][_0x2ad0('0x43')]=!![];queues[_0x1b5399[_0x2ad0('0x50')]][_0x2ad0('0x48')]='ATTENDED';queues[_0x1b5399['secondtransfererlinkedid']]['transferexten']=_0x1b5399[_0x2ad0('0x51')];queues[_0x1b5399[_0x2ad0('0x50')]][_0x2ad0('0x52')]=_0x1b5399[_0x2ad0('0x4e')];queues[_0x1b5399[_0x2ad0('0x50')]]['queuecallerexitreason']=_0x2ad0('0x53');}if(!_[_0x2ad0('0x15')](queues[_0x1b5399[_0x2ad0('0x4f')]])){if(_0x1b5399[_0x2ad0('0x54')]&&queues[_0x1b5399[_0x2ad0('0x54')]]){queues[_0x1b5399['transfereelinkedid']][_0x2ad0('0x1f')]=0x1;queues[_0x1b5399[_0x2ad0('0x47')]]=_[_0x2ad0('0x55')](queues[_0x1b5399[_0x2ad0('0x54')]]);queues[_0x1b5399[_0x2ad0('0x47')]][_0x2ad0('0xb')]=_0x1b5399[_0x2ad0('0x56')];queues[_0x1b5399[_0x2ad0('0x47')]]['queuecallerenterreason']=0x2;queues[_0x1b5399[_0x2ad0('0x47')]][_0x2ad0('0x4')]=queues[_0x1b5399['secondtransfererlinkedid']][_0x2ad0('0x4')];queues[_0x1b5399[_0x2ad0('0x47')]][_0x2ad0('0x57')]=queues[_0x1b5399[_0x2ad0('0x50')]]['calleridname'];queues[_0x1b5399[_0x2ad0('0x47')]]['queuecallerjoinAt']=utils[_0x2ad0('0x1a')]();queues[_0x1b5399[_0x2ad0('0x47')]]['queuecallerleaveAt']=utils[_0x2ad0('0x1a')]();queues[_0x1b5399[_0x2ad0('0x47')]]['holdtime']=0x0;queues[_0x1b5399['transfereeuniqueid']][_0x2ad0('0x58')]=0x0;utils['info'](util[_0x2ad0('0xd')](_0x2ad0('0x59'),_0x1b5399[_0x2ad0('0x4e')],queues[_0x1b5399[_0x2ad0('0x47')]][_0x2ad0('0x1d')],queues[_0x1b5399[_0x2ad0('0x47')]][_0x2ad0('0x4')],queues[_0x1b5399[_0x2ad0('0x47')]][_0x2ad0('0x57')]));}else{utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x5a'),_0x1b5399['origtransfereruniqueid'],queues[_0x1b5399[_0x2ad0('0x4f')]]['name'],_0x1b5399[_0x2ad0('0x50')]));queues[_0x1b5399['origtransfererlinkedid']]['transfereduniqueid']=_0x1b5399[_0x2ad0('0x50')];}}}else if(_0x1b5399[_0x2ad0('0x5b')]==_0x1b5399['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x1b5399[_0x2ad0('0x4f')]])){utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x5c'),_0x1b5399[_0x2ad0('0x4e')],queues[_0x1b5399[_0x2ad0('0x4f')]]['name'],_0x1b5399[_0x2ad0('0x5b')],_0x1b5399[_0x2ad0('0x5d')]));queues[_0x1b5399[_0x2ad0('0x4f')]]['transfer']=!![];queues[_0x1b5399[_0x2ad0('0x4f')]][_0x2ad0('0x48')]=_0x2ad0('0x5e');queues[_0x1b5399[_0x2ad0('0x4f')]][_0x2ad0('0x4a')]=_0x1b5399[_0x2ad0('0x5d')];queues[_0x1b5399[_0x2ad0('0x4f')]][_0x2ad0('0x52')]=_0x1b5399[_0x2ad0('0x5b')];queues[_0x1b5399[_0x2ad0('0x4f')]][_0x2ad0('0x5')]=_0x2ad0('0x53');}if(!_['isNil'](queues[_0x1b5399[_0x2ad0('0x50')]])){if(_0x1b5399['transfertargetlinkedid']&&queues[_0x1b5399[_0x2ad0('0x5f')]]){queues[_0x1b5399[_0x2ad0('0x5f')]][_0x2ad0('0x1f')]=0x1;queues[_0x1b5399['transfertargetuniqueid']]=_['clone'](queues[_0x1b5399[_0x2ad0('0x5f')]]);queues[_0x1b5399['transfertargetuniqueid']][_0x2ad0('0xb')]=_0x1b5399[_0x2ad0('0x56')];queues[_0x1b5399[_0x2ad0('0x56')]][_0x2ad0('0x1f')]=0x2;queues[_0x1b5399[_0x2ad0('0x56')]]['calleridnum']=queues[_0x1b5399[_0x2ad0('0x4f')]][_0x2ad0('0x4')];queues[_0x1b5399[_0x2ad0('0x56')]][_0x2ad0('0x57')]=queues[_0x1b5399[_0x2ad0('0x4f')]][_0x2ad0('0x57')];queues[_0x1b5399[_0x2ad0('0x56')]][_0x2ad0('0x36')]=utils[_0x2ad0('0x1a')]();queues[_0x1b5399['transfertargetuniqueid']][_0x2ad0('0x17')]=utils[_0x2ad0('0x1a')]();queues[_0x1b5399[_0x2ad0('0x56')]][_0x2ad0('0x34')]=0x0;queues[_0x1b5399[_0x2ad0('0x56')]][_0x2ad0('0x58')]=0x0;utils[_0x2ad0('0xf')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1b5399[_0x2ad0('0x4e')],queues[_0x1b5399[_0x2ad0('0x56')]]['name'],queues[_0x1b5399[_0x2ad0('0x56')]]['transfereduniqueid'],queues[_0x1b5399['transfertargetuniqueid']][_0x2ad0('0x4')],queues[_0x1b5399[_0x2ad0('0x56')]]['calleridname']));}else{utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1b5399[_0x2ad0('0x4e')],queues[_0x1b5399['secondtransfererlinkedid']]['name'],_0x1b5399[_0x2ad0('0x4f')]));queues[_0x1b5399[_0x2ad0('0x50')]][_0x2ad0('0xb')]=_0x1b5399['origtransfererlinkedid'];}}}}catch(_0x3d3a17){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0x4d'),_0x1b5399['origtransfereruniqueid']),_0x3d3a17);}};exports[_0x2ad0('0x60')]=function(_0x4862b6){try{if(!_[_0x2ad0('0x15')](queues[_0x4862b6['uniqueid']])){utils['debug'](util['format'](_0x2ad0('0x61'),_0x4862b6[_0x2ad0('0x2')]),_0x4862b6);queues[_0x4862b6[_0x2ad0('0x2')]]['musiconholdstartAt']=utils[_0x2ad0('0x1a')]();utils[_0x2ad0('0xf')](util[_0x2ad0('0xd')](_0x2ad0('0x62'),_0x4862b6[_0x2ad0('0x2')],queues[_0x4862b6[_0x2ad0('0x2')]][_0x2ad0('0x1d')],queues[_0x4862b6[_0x2ad0('0x2')]]['musiconholdstartAt']));}}catch(_0x1e7228){utils[_0x2ad0('0x13')](util['format']('[%s][queues][musiconholdstart]',_0x4862b6[_0x2ad0('0x2')]),_0x1e7228);}};exports[_0x2ad0('0x63')]=function(_0x2568d1){try{if(!_[_0x2ad0('0x15')](queues[_0x2568d1['uniqueid']])){if(!_[_0x2ad0('0x15')](queues[_0x2568d1[_0x2ad0('0x2')]][_0x2ad0('0x64')])){utils[_0x2ad0('0xc')](util['format']('[%s][queues][musiconholdstop]',_0x2568d1[_0x2ad0('0x2')]),_0x2568d1);queues[_0x2568d1[_0x2ad0('0x2')]][_0x2ad0('0x58')]+=utils[_0x2ad0('0x35')](utils[_0x2ad0('0x1a')](),queues[_0x2568d1[_0x2ad0('0x2')]]['musiconholdstartAt']);utils['info'](util[_0x2ad0('0xd')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2568d1[_0x2ad0('0x2')],queues[_0x2568d1[_0x2ad0('0x2')]][_0x2ad0('0x1d')],queues[_0x2568d1[_0x2ad0('0x2')]][_0x2ad0('0x58')]));delete queues[_0x2568d1[_0x2ad0('0x2')]][_0x2ad0('0x64')];}}}catch(_0x47ffcc){utils[_0x2ad0('0x13')](util[_0x2ad0('0xd')](_0x2ad0('0x65'),_0x2568d1[_0x2ad0('0x2')]),_0x47ffcc);}};
\ No newline at end of file
index 2928051..f10f8f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb33=['linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','variable','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','application','startsWith','appdata','toLowerCase','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s'];(function(_0x1f23b1,_0x57c83f){var _0x3c9197=function(_0x2f6e4a){while(--_0x2f6e4a){_0x1f23b1['push'](_0x1f23b1['shift']());}};_0x3c9197(++_0x57c83f);}(_0xeb33,0xff));var _0x3eb3=function(_0x1045cf,_0x3d5e3e){_0x1045cf=_0x1045cf-0x0;var _0xa04932=_0xeb33[_0x1045cf];return _0xa04932;};'use strict';var _=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var utils=require('./utils');var transfers=require(_0x3eb3('0x2'));var recordings={};function writeDB(_0x5664d6){var _0x4b10d6;utils[_0x3eb3('0x3')](util[_0x3eb3('0x4')](_0x3eb3('0x5'),_0x5664d6['uniqueid']));if(transfers[_0x3eb3('0x6')][_0x5664d6[_0x3eb3('0x7')]]){_0x4b10d6=_0x5664d6[_0x3eb3('0x7')];_0x5664d6[_0x3eb3('0x7')]=transfers[_0x3eb3('0x6')][_0x5664d6[_0x3eb3('0x7')]][_0x3eb3('0x8')];}if(_0x5664d6[_0x3eb3('0x9')]){utils[_0x3eb3('0xa')](_0x5664d6['accountcode'])[_0x3eb3('0xb')](function(_0xf2a73a){if(_0xf2a73a){_0x5664d6[_0x3eb3('0xc')]=_0xf2a73a[_0x3eb3('0xd')];_0x5664d6['UserId']=_0xf2a73a['id'];}utils[_0x3eb3('0xe')](_0x3eb3('0xf'),_0x5664d6);});}else{utils[_0x3eb3('0xe')](_0x3eb3('0xf'),_0x5664d6);}if(_0x4b10d6)delete transfers[_0x3eb3('0x6')][_0x4b10d6];}exports[_0x3eb3('0x10')]=function(_0x1919e5){try{utils['debug'](util[_0x3eb3('0x4')]('[%s][recordings][newchannel]',_0x1919e5[_0x3eb3('0x7')]),_0x1919e5);if(_0x1919e5[_0x3eb3('0x7')]==_0x1919e5['linkedid']){utils['info'](util[_0x3eb3('0x4')](_0x3eb3('0x11'),_0x1919e5[_0x3eb3('0x7')],_0x1919e5[_0x3eb3('0x12')],_0x1919e5[_0x3eb3('0x13')]));recordings[_0x1919e5[_0x3eb3('0x7')]]={'uniqueid':_0x1919e5[_0x3eb3('0x7')],'accountcode':_0x1919e5[_0x3eb3('0x9')],'exten':_0x1919e5[_0x3eb3('0x13')],'context':_0x1919e5['context'],'channel':_0x1919e5[_0x3eb3('0x14')],'monitors':[]};}}catch(_0x34a366){utils[_0x3eb3('0x15')](util['format']('[%s][recordings][newchannel]',_0x1919e5['uniqueid']),_0x34a366);}};exports['newstate']=function(_0x2a8dcf){try{utils['debug'](util[_0x3eb3('0x4')](_0x3eb3('0x16'),_0x2a8dcf[_0x3eb3('0x7')]),_0x2a8dcf);if(!_['isNil'](recordings[_0x2a8dcf[_0x3eb3('0x7')]])&&_0x2a8dcf[_0x3eb3('0x17')]==0x6){utils['info'](util[_0x3eb3('0x4')](_0x3eb3('0x18'),_0x2a8dcf[_0x3eb3('0x7')],_0x2a8dcf['context'],_0x2a8dcf[_0x3eb3('0x14')]));}else if(!_['isNil'](recordings[_0x2a8dcf[_0x3eb3('0x19')]])&&_0x2a8dcf[_0x3eb3('0x17')]==0x6&&_0x2a8dcf[_0x3eb3('0x12')]!=_0x3eb3('0x1a')){utils[_0x3eb3('0x3')](util[_0x3eb3('0x4')](_0x3eb3('0x1b'),_0x2a8dcf[_0x3eb3('0x7')],_0x2a8dcf[_0x3eb3('0x19')],_0x2a8dcf['context'],_0x2a8dcf['channel']));recordings[_0x2a8dcf[_0x3eb3('0x19')]][_0x3eb3('0x9')]=_0x2a8dcf[_0x3eb3('0x9')];}}catch(_0x5cccac){utils[_0x3eb3('0x15')](util[_0x3eb3('0x4')](_0x3eb3('0x16'),_0x2a8dcf[_0x3eb3('0x7')]),_0x5cccac);}};exports[_0x3eb3('0x1c')]=function(_0x17b685){try{if(!_[_0x3eb3('0x1d')](_0x17b685['variable'])&&!_[_0x3eb3('0x1d')](_0x17b685[_0x3eb3('0x1e')][_0x3eb3('0x1f')])){utils[_0x3eb3('0x20')](util[_0x3eb3('0x4')](_0x3eb3('0x21'),_0x17b685['uniqueid']),_0x17b685);utils[_0x3eb3('0x3')](util['format'](_0x3eb3('0x22'),_0x17b685['uniqueid'],_0x17b685[_0x3eb3('0x1e')],_0x17b685[_0x3eb3('0x23')]));if(_[_0x3eb3('0x24')](_0x17b685[_0x3eb3('0x23')],_0x3eb3('0x25'))){_0x17b685[_0x3eb3('0x23')]=_0x17b685['value'][_0x3eb3('0x26')](_0x3eb3('0x25'),'.WAV');}if(recordings[_0x17b685[_0x3eb3('0x19')]]){var _0x362782=_[_0x3eb3('0x27')](recordings[_0x17b685[_0x3eb3('0x19')]]['monitors'],{'value':_0x17b685[_0x3eb3('0x23')]});if(_[_0x3eb3('0x1d')](_0x362782)){recordings[_0x17b685[_0x3eb3('0x19')]][_0x3eb3('0x28')]['push']({'value':_0x17b685[_0x3eb3('0x23')]});}}}}catch(_0xdf3d94){utils[_0x3eb3('0x15')](util[_0x3eb3('0x4')](_0x3eb3('0x21'),_0x17b685[_0x3eb3('0x7')]),_0xdf3d94);}};exports[_0x3eb3('0x29')]=function(_0x412761){try{if(!_[_0x3eb3('0x1d')](recordings[_0x412761[_0x3eb3('0x7')]])){utils[_0x3eb3('0x20')](util['format'](_0x3eb3('0x2a'),_0x412761[_0x3eb3('0x7')]),_0x412761);utils[_0x3eb3('0x3')](util[_0x3eb3('0x4')](_0x3eb3('0x2b'),_0x412761['uniqueid'],_0x412761[_0x3eb3('0x2c')],_0x412761[_0x3eb3('0x2d')],_0x412761['cause-txt']));recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x2c')]=_0x412761[_0x3eb3('0x2c')];recordings[_0x412761['uniqueid']][_0x3eb3('0x2d')]=_0x412761[_0x3eb3('0x2d')];recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x2e')]=_0x412761['connectedlinenum'];recordings[_0x412761['uniqueid']][_0x3eb3('0x2f')]=_0x412761[_0x3eb3('0x2f')];if(recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x30')]==_0x3eb3('0x31')&&recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x9')]){recordings[_0x412761['uniqueid']][_0x3eb3('0x2e')]=recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x9')];recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x2f')]='';}recordings[_0x412761[_0x3eb3('0x7')]][_0x3eb3('0x28')][_0x3eb3('0x32')](function(_0x11348f){var _0x2088a4=_[_0x3eb3('0x33')](recordings[_0x412761['uniqueid']]);_0x2088a4['value']=_0x11348f[_0x3eb3('0x23')];writeDB(_0x2088a4);});delete recordings[_0x412761['uniqueid']];}}catch(_0x2b9d83){utils[_0x3eb3('0x15')](util[_0x3eb3('0x4')](_0x3eb3('0x2a'),_0x412761[_0x3eb3('0x7')]),_0x2b9d83);}};exports['newexten']=function(_0x484560){try{if(!_[_0x3eb3('0x1d')](recordings[_0x484560[_0x3eb3('0x7')]])){utils[_0x3eb3('0x20')](util['format'](_0x3eb3('0x34'),_0x484560[_0x3eb3('0x7')]),_0x484560);utils[_0x3eb3('0x3')](util[_0x3eb3('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x484560['uniqueid'],_0x484560['application'],_0x484560['appdata']));if(_0x484560[_0x3eb3('0x35')]['toLowerCase']()=='set'&&_[_0x3eb3('0x36')](_0x484560[_0x3eb3('0x37')][_0x3eb3('0x38')](),_0x3eb3('0x39'))){var _0x1fb54d=_0x484560['appdata']['split']('=');var _0x8f5277=_0x1fb54d[0x0]['substring'](_0x1fb54d[0x0][_0x3eb3('0x3a')]('(')+0x1,_0x1fb54d[0x0][_0x3eb3('0x3a')](')'));var _0xa9ed5e=_0x1fb54d[0x1];recordings[_0x484560[_0x3eb3('0x7')]][_0x8f5277]=_0xa9ed5e;}}}catch(_0x1b1fb4){utils[_0x3eb3('0x15')](util['format'](_0x3eb3('0x34'),_0x484560[_0x3eb3('0x7')]),_0x1b1fb4);}};exports[_0x3eb3('0x3b')]=function(_0x485ea4){try{if(!_['isNil'](recordings[_0x485ea4[_0x3eb3('0x7')]])){utils[_0x3eb3('0x20')](util[_0x3eb3('0x4')](_0x3eb3('0x3c'),_0x485ea4[_0x3eb3('0x7')]),_0x485ea4);utils[_0x3eb3('0x3')](util[_0x3eb3('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x485ea4[_0x3eb3('0x7')],_0x485ea4[_0x3eb3('0x3d')]));recordings[_0x485ea4[_0x3eb3('0x7')]]['queue']=_0x485ea4[_0x3eb3('0x3d')];}}catch(_0x272089){utils[_0x3eb3('0x15')](util[_0x3eb3('0x4')](_0x3eb3('0x3c'),_0x485ea4[_0x3eb3('0x7')]),_0x272089);}};exports[_0x3eb3('0x3e')]=function(_0x5c88d3){try{utils[_0x3eb3('0x20')](util[_0x3eb3('0x4')]('[%s][recordings][blindtransfer]',_0x5c88d3[_0x3eb3('0x7')]),_0x5c88d3);utils['info'](util[_0x3eb3('0x4')](_0x3eb3('0x3f'),_0x5c88d3[_0x3eb3('0x7')],_0x5c88d3[_0x3eb3('0x40')],_0x5c88d3[_0x3eb3('0x41')],_0x5c88d3[_0x3eb3('0x42')],_0x5c88d3[_0x3eb3('0x43')]));if(recordings[_0x5c88d3[_0x3eb3('0x44')]]&&transfers[_0x3eb3('0x6')][_0x5c88d3[_0x3eb3('0x44')]]){transfers[_0x3eb3('0x6')][_0x5c88d3[_0x3eb3('0x44')]]['recording']=!![];}}catch(_0x1475f9){utils[_0x3eb3('0x15')](util[_0x3eb3('0x4')](_0x3eb3('0x45'),_0x5c88d3[_0x3eb3('0x7')]),_0x1475f9);}};
\ No newline at end of file
+var _0x0385=['substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','format','exten','context','channel','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split'];(function(_0x10905e,_0x16f95c){var _0x537230=function(_0x4545bc){while(--_0x4545bc){_0x10905e['push'](_0x10905e['shift']());}};_0x537230(++_0x16f95c);}(_0x0385,0x1c9));var _0x5038=function(_0x4adfd8,_0x3d0ed4){_0x4adfd8=_0x4adfd8-0x0;var _0x567440=_0x0385[_0x4adfd8];return _0x567440;};'use strict';var _=require(_0x5038('0x0'));var util=require(_0x5038('0x1'));var utils=require(_0x5038('0x2'));var transfers=require(_0x5038('0x3'));var recordings={};function writeDB(_0x799979){var _0x2c82e1;utils[_0x5038('0x4')](util['format'](_0x5038('0x5'),_0x799979[_0x5038('0x6')]));if(transfers[_0x5038('0x7')][_0x799979[_0x5038('0x6')]]){_0x2c82e1=_0x799979['uniqueid'];_0x799979[_0x5038('0x6')]=transfers[_0x5038('0x7')][_0x799979[_0x5038('0x6')]][_0x5038('0x8')];}if(_0x799979['accountcode']){utils[_0x5038('0x9')](_0x799979[_0x5038('0xa')])['then'](function(_0xad4598){if(_0xad4598){_0x799979['membername']=_0xad4598[_0x5038('0xb')];_0x799979[_0x5038('0xc')]=_0xad4598['id'];}utils[_0x5038('0xd')](_0x5038('0xe'),_0x799979);});}else{utils[_0x5038('0xd')](_0x5038('0xe'),_0x799979);}if(_0x2c82e1)delete transfers['blinds'][_0x2c82e1];}exports[_0x5038('0xf')]=function(_0x2ea09e){try{utils[_0x5038('0x10')](util['format']('[%s][recordings][newchannel]',_0x2ea09e[_0x5038('0x6')]),_0x2ea09e);if(_0x2ea09e['uniqueid']==_0x2ea09e[_0x5038('0x11')]){utils[_0x5038('0x4')](util[_0x5038('0x12')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2ea09e[_0x5038('0x6')],_0x2ea09e['context'],_0x2ea09e[_0x5038('0x13')]));recordings[_0x2ea09e[_0x5038('0x6')]]={'uniqueid':_0x2ea09e[_0x5038('0x6')],'accountcode':_0x2ea09e[_0x5038('0xa')],'exten':_0x2ea09e[_0x5038('0x13')],'context':_0x2ea09e[_0x5038('0x14')],'channel':_0x2ea09e[_0x5038('0x15')],'monitors':[]};}}catch(_0xbdb9c6){utils['error'](util['format'](_0x5038('0x16'),_0x2ea09e[_0x5038('0x6')]),_0xbdb9c6);}};exports['newstate']=function(_0x5b1a33){try{utils[_0x5038('0x10')](util[_0x5038('0x12')](_0x5038('0x17'),_0x5b1a33[_0x5038('0x6')]),_0x5b1a33);if(!_[_0x5038('0x18')](recordings[_0x5b1a33[_0x5038('0x6')]])&&_0x5b1a33[_0x5038('0x19')]==0x6){utils[_0x5038('0x4')](util[_0x5038('0x12')](_0x5038('0x1a'),_0x5b1a33[_0x5038('0x6')],_0x5b1a33[_0x5038('0x14')],_0x5b1a33[_0x5038('0x15')]));}else if(!_['isNil'](recordings[_0x5b1a33[_0x5038('0x11')]])&&_0x5b1a33[_0x5038('0x19')]==0x6&&_0x5b1a33[_0x5038('0x14')]!=_0x5038('0x1b')){utils[_0x5038('0x4')](util['format'](_0x5038('0x1c'),_0x5b1a33[_0x5038('0x6')],_0x5b1a33['linkedid'],_0x5b1a33[_0x5038('0x14')],_0x5b1a33[_0x5038('0x15')]));recordings[_0x5b1a33[_0x5038('0x11')]][_0x5038('0xa')]=_0x5b1a33[_0x5038('0xa')];}}catch(_0x5429dc){utils[_0x5038('0x1d')](util['format'](_0x5038('0x17'),_0x5b1a33[_0x5038('0x6')]),_0x5429dc);}};exports[_0x5038('0x1e')]=function(_0x1a186a){try{if(!_[_0x5038('0x18')](_0x1a186a[_0x5038('0x1f')])&&!_[_0x5038('0x18')](_0x1a186a['variable'][_0x5038('0x20')])){utils[_0x5038('0x10')](util[_0x5038('0x12')](_0x5038('0x21'),_0x1a186a[_0x5038('0x6')]),_0x1a186a);utils['info'](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1a186a[_0x5038('0x6')],_0x1a186a['variable'],_0x1a186a[_0x5038('0x22')]));if(_[_0x5038('0x23')](_0x1a186a[_0x5038('0x22')],_0x5038('0x24'))){_0x1a186a[_0x5038('0x22')]=_0x1a186a[_0x5038('0x22')][_0x5038('0x25')](_0x5038('0x24'),_0x5038('0x26'));}if(recordings[_0x1a186a[_0x5038('0x11')]]){var _0x4eea16=_[_0x5038('0x27')](recordings[_0x1a186a[_0x5038('0x11')]][_0x5038('0x28')],{'value':_0x1a186a[_0x5038('0x22')]});if(_['isNil'](_0x4eea16)){recordings[_0x1a186a[_0x5038('0x11')]][_0x5038('0x28')][_0x5038('0x29')]({'value':_0x1a186a[_0x5038('0x22')]});}}}}catch(_0xadfe95){utils['error'](util[_0x5038('0x12')]('[%s][recordings][varset]',_0x1a186a[_0x5038('0x6')]),_0xadfe95);}};exports[_0x5038('0x2a')]=function(_0x55c046){try{if(!_[_0x5038('0x18')](recordings[_0x55c046[_0x5038('0x6')]])){utils[_0x5038('0x10')](util['format'](_0x5038('0x2b'),_0x55c046[_0x5038('0x6')]),_0x55c046);utils[_0x5038('0x4')](util[_0x5038('0x12')](_0x5038('0x2c'),_0x55c046[_0x5038('0x6')],_0x55c046[_0x5038('0x2d')],_0x55c046[_0x5038('0x2e')],_0x55c046[_0x5038('0x2f')]));recordings[_0x55c046[_0x5038('0x6')]][_0x5038('0x2d')]=_0x55c046['calleridnum'];recordings[_0x55c046[_0x5038('0x6')]]['calleridname']=_0x55c046[_0x5038('0x2e')];recordings[_0x55c046['uniqueid']][_0x5038('0x30')]=_0x55c046[_0x5038('0x30')];recordings[_0x55c046[_0x5038('0x6')]][_0x5038('0x31')]=_0x55c046[_0x5038('0x31')];if(recordings[_0x55c046[_0x5038('0x6')]]['type']=='outbound'&&recordings[_0x55c046['uniqueid']]['accountcode']){recordings[_0x55c046['uniqueid']][_0x5038('0x30')]=recordings[_0x55c046[_0x5038('0x6')]]['accountcode'];recordings[_0x55c046['uniqueid']][_0x5038('0x31')]='';}recordings[_0x55c046['uniqueid']]['monitors'][_0x5038('0x32')](function(_0x309672){var _0x37989d=_[_0x5038('0x33')](recordings[_0x55c046['uniqueid']]);_0x37989d[_0x5038('0x22')]=_0x309672[_0x5038('0x22')];writeDB(_0x37989d);});delete recordings[_0x55c046['uniqueid']];}}catch(_0x588f92){utils[_0x5038('0x1d')](util[_0x5038('0x12')]('[%s][recordings][hangup]',_0x55c046[_0x5038('0x6')]),_0x588f92);}};exports['newexten']=function(_0x5d2846){try{if(!_[_0x5038('0x18')](recordings[_0x5d2846[_0x5038('0x6')]])){utils[_0x5038('0x10')](util[_0x5038('0x12')](_0x5038('0x34'),_0x5d2846['uniqueid']),_0x5d2846);utils[_0x5038('0x4')](util['format'](_0x5038('0x35'),_0x5d2846[_0x5038('0x6')],_0x5d2846[_0x5038('0x36')],_0x5d2846['appdata']));if(_0x5d2846[_0x5038('0x36')][_0x5038('0x37')]()==_0x5038('0x38')&&_[_0x5038('0x39')](_0x5d2846[_0x5038('0x3a')][_0x5038('0x37')](),_0x5038('0x3b'))){var _0x361c21=_0x5d2846[_0x5038('0x3a')][_0x5038('0x3c')]('=');var _0xa0fff=_0x361c21[0x0][_0x5038('0x3d')](_0x361c21[0x0][_0x5038('0x3e')]('(')+0x1,_0x361c21[0x0][_0x5038('0x3e')](')'));var _0x484c7a=_0x361c21[0x1];recordings[_0x5d2846[_0x5038('0x6')]][_0xa0fff]=_0x484c7a;}}}catch(_0x3f601c){utils[_0x5038('0x1d')](util[_0x5038('0x12')](_0x5038('0x34'),_0x5d2846[_0x5038('0x6')]),_0x3f601c);}};exports[_0x5038('0x3f')]=function(_0x247ac9){try{if(!_[_0x5038('0x18')](recordings[_0x247ac9[_0x5038('0x6')]])){utils['debug'](util[_0x5038('0x12')](_0x5038('0x40'),_0x247ac9[_0x5038('0x6')]),_0x247ac9);utils[_0x5038('0x4')](util[_0x5038('0x12')](_0x5038('0x41'),_0x247ac9[_0x5038('0x6')],_0x247ac9[_0x5038('0x42')]));recordings[_0x247ac9['uniqueid']][_0x5038('0x42')]=_0x247ac9['queue'];}}catch(_0x42c649){utils[_0x5038('0x1d')](util[_0x5038('0x12')](_0x5038('0x40'),_0x247ac9['uniqueid']),_0x42c649);}};exports[_0x5038('0x43')]=function(_0x428fcc){try{utils[_0x5038('0x10')](util[_0x5038('0x12')]('[%s][recordings][blindtransfer]',_0x428fcc[_0x5038('0x6')]),_0x428fcc);utils[_0x5038('0x4')](util[_0x5038('0x12')](_0x5038('0x44'),_0x428fcc['uniqueid'],_0x428fcc[_0x5038('0x45')],_0x428fcc[_0x5038('0x46')],_0x428fcc[_0x5038('0x47')],_0x428fcc[_0x5038('0x48')]));if(recordings[_0x428fcc[_0x5038('0x49')]]&&transfers[_0x5038('0x7')][_0x428fcc[_0x5038('0x49')]]){transfers['blinds'][_0x428fcc['transfereruniqueid']]['recording']=!![];}}catch(_0x32bfda){utils[_0x5038('0x1d')](util['format']('[%s][recordings][blindtransfer]',_0x428fcc[_0x5038('0x6')]),_0x32bfda);}};
\ No newline at end of file
index 67c3ef5..b2e3f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f0f=['attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error'];(function(_0x47e4bd,_0x38c255){var _0x268676=function(_0x455545){while(--_0x455545){_0x47e4bd['push'](_0x47e4bd['shift']());}};_0x268676(++_0x38c255);}(_0x2f0f,0xc2));var _0xf2f0=function(_0x20a137,_0x4d9549){_0x20a137=_0x20a137-0x0;var _0x3dc414=_0x2f0f[_0x20a137];return _0x3dc414;};'use strict';var _=require('lodash');var util=require(_0xf2f0('0x0'));var utils=require(_0xf2f0('0x1'));function writeDB(_0x491144){utils['info'](util[_0xf2f0('0x2')](_0xf2f0('0x3'),_0x491144[_0xf2f0('0x4')]===_0xf2f0('0x5')?_0x491144[_0xf2f0('0x6')]:_0x491144[_0xf2f0('0x7')],_0x491144[_0xf2f0('0x4')]));utils[_0xf2f0('0x8')](_0xf2f0('0x9'),_0x491144);}exports[_0xf2f0('0xa')]={};exports[_0xf2f0('0xb')]=function(_0x52bcd1){try{utils['debug'](util[_0xf2f0('0x2')](_0xf2f0('0xc'),_0x52bcd1['uniqueid']),_0x52bcd1);utils[_0xf2f0('0xd')](util['format'](_0xf2f0('0xe'),_0x52bcd1[_0xf2f0('0x7')],_0x52bcd1['transferercalleridnum'],_0x52bcd1[_0xf2f0('0xf')],_0x52bcd1[_0xf2f0('0x10')],_0x52bcd1[_0xf2f0('0x11')]));_0x52bcd1[_0xf2f0('0x4')]=_0xf2f0('0x12');exports[_0xf2f0('0xa')][_0x52bcd1[_0xf2f0('0x13')]]=_0x52bcd1;writeDB(_0x52bcd1);}catch(_0x49ec06){utils[_0xf2f0('0x14')](util[_0xf2f0('0x2')](_0xf2f0('0xc'),_0x52bcd1[_0xf2f0('0x7')]),_0x49ec06);}};exports[_0xf2f0('0x15')]=function(_0x9b6fd6){try{utils[_0xf2f0('0x16')](util[_0xf2f0('0x2')]('[%s][transfers][attendedtransfer]',_0x9b6fd6[_0xf2f0('0x6')]),_0x9b6fd6);utils[_0xf2f0('0xd')](util[_0xf2f0('0x2')](_0xf2f0('0x17'),_0x9b6fd6[_0xf2f0('0x6')],_0x9b6fd6['origtransferercalleridnum'],_0x9b6fd6[_0xf2f0('0x18')],_0x9b6fd6[_0xf2f0('0x19')],_0x9b6fd6[_0xf2f0('0x1a')]));_0x9b6fd6=_['assign'](_0x9b6fd6,{'transfererchannel':_0x9b6fd6['origtransfererchannel'],'transferercalleridnum':_0x9b6fd6[_0xf2f0('0x1b')],'transferercalleridname':_0x9b6fd6[_0xf2f0('0x18')],'transfererconnectedlinenum':_0x9b6fd6[_0xf2f0('0x1c')],'transfererconnectedlinename':_0x9b6fd6[_0xf2f0('0x1d')],'transfereraccountcode':_0x9b6fd6[_0xf2f0('0x1e')],'transferercontext':_0x9b6fd6[_0xf2f0('0x1f')],'transfererexten':_0x9b6fd6[_0xf2f0('0x20')],'transfererlinkedid':_0x9b6fd6[_0xf2f0('0x21')],'context':_0x9b6fd6['origtransferercontext'],'extension':_0x9b6fd6['origtransfererexten'],'type':_0xf2f0('0x5')});if(_[_0xf2f0('0x22')](_0x9b6fd6[_0xf2f0('0x23')])){_0x9b6fd6=_[_0xf2f0('0x24')](_0x9b6fd6,{'transfereechannel':_0x9b6fd6[_0xf2f0('0x25')],'transfereecalleridnum':_0x9b6fd6['transfertargetcalleridnum'],'transfereecalleridname':_0x9b6fd6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x9b6fd6[_0xf2f0('0x26')],'transfereeconnectedlinename':_0x9b6fd6[_0xf2f0('0x27')],'transfereeaccountcode':_0x9b6fd6[_0xf2f0('0x28')],'transfereecontext':_0x9b6fd6['transfertargetcontext'],'transfereeexten':_0x9b6fd6[_0xf2f0('0x29')],'transfereelinkedid':_0x9b6fd6[_0xf2f0('0x2a')]});}writeDB(_0x9b6fd6);}catch(_0x4d1c0d){utils[_0xf2f0('0x14')](util[_0xf2f0('0x2')]('[%s][transfers][attendedtransfer]',_0x9b6fd6[_0xf2f0('0x6')]),_0x4d1c0d);}};
\ No newline at end of file
+var _0x8689=['origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','blinds','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','blind','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x423e46,_0x503b4b){var _0x38a26f=function(_0x420884){while(--_0x420884){_0x423e46['push'](_0x423e46['shift']());}};_0x38a26f(++_0x503b4b);}(_0x8689,0x160));var _0x9868=function(_0x55964e,_0x3940b7){_0x55964e=_0x55964e-0x0;var _0x4676ee=_0x8689[_0x55964e];return _0x4676ee;};'use strict';var _=require(_0x9868('0x0'));var util=require(_0x9868('0x1'));var utils=require(_0x9868('0x2'));function writeDB(_0x2974a3){utils[_0x9868('0x3')](util[_0x9868('0x4')](_0x9868('0x5'),_0x2974a3[_0x9868('0x6')]==='attended'?_0x2974a3[_0x9868('0x7')]:_0x2974a3[_0x9868('0x8')],_0x2974a3[_0x9868('0x6')]));utils['request']('CreateVoiceTransferReport',_0x2974a3);}exports[_0x9868('0x9')]={};exports['blindtransfer']=function(_0x3bddfd){try{utils['debug'](util[_0x9868('0x4')](_0x9868('0xa'),_0x3bddfd[_0x9868('0x8')]),_0x3bddfd);utils[_0x9868('0x3')](util[_0x9868('0x4')](_0x9868('0xb'),_0x3bddfd[_0x9868('0x8')],_0x3bddfd['transferercalleridnum'],_0x3bddfd[_0x9868('0xc')],_0x3bddfd['transfereecalleridnum'],_0x3bddfd[_0x9868('0xd')]));_0x3bddfd[_0x9868('0x6')]=_0x9868('0xe');exports['blinds'][_0x3bddfd['transfereruniqueid']]=_0x3bddfd;writeDB(_0x3bddfd);}catch(_0x380634){utils[_0x9868('0xf')](util[_0x9868('0x4')](_0x9868('0xa'),_0x3bddfd[_0x9868('0x8')]),_0x380634);}};exports['attendedtransfer']=function(_0x9f24df){try{utils[_0x9868('0x10')](util['format'](_0x9868('0x11'),_0x9f24df[_0x9868('0x7')]),_0x9f24df);utils[_0x9868('0x3')](util[_0x9868('0x4')](_0x9868('0x12'),_0x9f24df[_0x9868('0x7')],_0x9f24df['origtransferercalleridnum'],_0x9f24df[_0x9868('0x13')],_0x9f24df[_0x9868('0x14')],_0x9f24df[_0x9868('0x15')]));_0x9f24df=_[_0x9868('0x16')](_0x9f24df,{'transfererchannel':_0x9f24df[_0x9868('0x17')],'transferercalleridnum':_0x9f24df[_0x9868('0x18')],'transferercalleridname':_0x9f24df[_0x9868('0x13')],'transfererconnectedlinenum':_0x9f24df[_0x9868('0x19')],'transfererconnectedlinename':_0x9f24df[_0x9868('0x1a')],'transfereraccountcode':_0x9f24df[_0x9868('0x1b')],'transferercontext':_0x9f24df['secondtransferercontext'],'transfererexten':_0x9f24df['secondtransfererexten'],'transfererlinkedid':_0x9f24df[_0x9868('0x1c')],'context':_0x9f24df[_0x9868('0x1d')],'extension':_0x9f24df[_0x9868('0x1e')],'type':'attended'});if(_[_0x9868('0x1f')](_0x9f24df[_0x9868('0x20')])){_0x9f24df=_[_0x9868('0x16')](_0x9f24df,{'transfereechannel':_0x9f24df[_0x9868('0x21')],'transfereecalleridnum':_0x9f24df[_0x9868('0x14')],'transfereecalleridname':_0x9f24df[_0x9868('0x15')],'transfereeconnectedlinenum':_0x9f24df[_0x9868('0x22')],'transfereeconnectedlinename':_0x9f24df[_0x9868('0x23')],'transfereeaccountcode':_0x9f24df['transfertargetaccountcode'],'transfereecontext':_0x9f24df[_0x9868('0x24')],'transfereeexten':_0x9f24df['transfertargetexten'],'transfereelinkedid':_0x9f24df[_0x9868('0x25')]});}writeDB(_0x9f24df);}catch(_0x5b4c8e){utils[_0x9868('0xf')](util[_0x9868('0x4')]('[%s][transfers][attendedtransfer]',_0x9f24df[_0x9868('0x7')]),_0x5b4c8e);}};
\ No newline at end of file
index 1c1e8b5..e557074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb96d=['diffTime','diff','now','isAfter','isBefore','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format'];(function(_0x3a4130,_0x1e4977){var _0x402627=function(_0x9ebdd4){while(--_0x9ebdd4){_0x3a4130['push'](_0x3a4130['shift']());}};_0x402627(++_0x1e4977);}(_0xb96d,0x9e));var _0xdb96=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xb96d[_0x5b6cf1];return _0x46278c;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var util=require(_0xdb96('0x2'));var client=jayson['client'][_0xdb96('0x3')]({'port':0x2329});var logger=require(_0xdb96('0x4'))(_0xdb96('0x5'));exports['info']=function(_0x4af3cf,_0x291c6a){logger[_0xdb96('0x6')](_0x4af3cf,_0x291c6a?util[_0xdb96('0x7')](_0x291c6a,{'showHidden':![],'depth':null}):'');};exports[_0xdb96('0x8')]=function(_0x4f5e6f,_0x294084){logger[_0xdb96('0x8')](_0x4f5e6f,_0x294084?util['inspect'](_0x294084,{'showHidden':![],'depth':null}):'');};exports[_0xdb96('0x9')]=function(_0x57b792,_0x3a4984){logger[_0xdb96('0x9')](_0x57b792,_0x3a4984?util['inspect'](_0x3a4984,{'showHidden':![],'depth':null}):'');};exports[_0xdb96('0xa')]=function(_0x446431,_0x58b9ce){return client[_0xdb96('0xa')](_0x446431,{'body':_0x58b9ce})[_0xdb96('0xb')](function(_0x2e78b6){logger[_0xdb96('0x8')]('[utils][request]\x20name:%s',_0x446431,_0x2e78b6?util[_0xdb96('0x7')](_0x2e78b6,{'showHidden':![],'depth':null}):'');})[_0xdb96('0xc')](function(_0x33e478){logger['error'](_0xdb96('0xd'),_0x446431,_0x33e478?util[_0xdb96('0x7')](_0x33e478,{'showHidden':![],'depth':null}):'');});};function getUser(_0x20102d){return client[_0xdb96('0xa')](_0xdb96('0xe'),{'options':{'raw':!![],'attributes':['id',_0xdb96('0xf'),_0xdb96('0x10'),_0xdb96('0x11')],'where':_0x20102d,'limit':0x1}})[_0xdb96('0xb')](function(_0x745780){logger[_0xdb96('0x8')](_0xdb96('0x12'),JSON[_0xdb96('0x13')](_0x20102d),_0x745780?util['inspect'](_0x745780,{'showHidden':![],'depth':null}):'');return _0x745780[_0xdb96('0x14')][_0xdb96('0x15')]?_0x745780[_0xdb96('0x14')][0x0]:null;});}exports[_0xdb96('0x16')]=function(_0x56dfd9){return new BPromise(function(_0x27fa8e,_0x33ec8f){if(_0x56dfd9){return getUser({'internal':_0x56dfd9})[_0xdb96('0xb')](function(_0x5946d5){logger['info'](_0xdb96('0x17'),_0x56dfd9,_0x5946d5?'found':'notfound');return _0x27fa8e(_0x5946d5);})[_0xdb96('0xc')](function(_0x195a01){logger[_0xdb96('0x9')](_0xdb96('0x18'),_0x195a01?util['inspect'](_0x195a01,{'showHidden':![],'depth':null}):'');return _0x27fa8e(null);});}return _0x27fa8e(null);});};exports[_0xdb96('0x19')]=function(_0x5afff3){return new BPromise(function(_0x22b3aa,_0x467a5d){if(_0x5afff3){return getUser({'interface':_0x5afff3})['then'](function(_0x111673){logger[_0xdb96('0x6')](_0xdb96('0x1a'),_0x5afff3,_0x111673?_0xdb96('0x1b'):_0xdb96('0x1c'));return _0x22b3aa(_0x111673);})[_0xdb96('0xc')](function(_0x25834a){logger['error'](_0xdb96('0x1d'),_0x25834a?util[_0xdb96('0x7')](_0x25834a,{'showHidden':![],'depth':null}):'');return _0x22b3aa(null);});}return _0x22b3aa(null);});};exports[_0xdb96('0x1e')]=function(_0x47a99a){return new BPromise(function(_0x302596,_0x2348d4){if(_0x47a99a){return getUser({'name':_0x47a99a})[_0xdb96('0xb')](function(_0x41eb65){logger[_0xdb96('0x6')](_0xdb96('0x1f'),_0x47a99a,_0x41eb65?_0xdb96('0x1b'):_0xdb96('0x1c'));return _0x302596(_0x41eb65);})[_0xdb96('0xc')](function(_0x5efe23){logger[_0xdb96('0x9')](_0xdb96('0x20'),_0x5efe23?util['inspect'](_0x5efe23,{'showHidden':![],'depth':null}):'');return _0x302596(null);});}return _0x302596(null);});};exports[_0xdb96('0x21')]=function(_0x1f020c){return new BPromise(function(_0x59f07e,_0x32eabc){if(_0x1f020c){return client[_0xdb96('0xa')](_0xdb96('0x22'),{'options':{'raw':!![],'attributes':['id',_0xdb96('0x10'),_0xdb96('0x23'),_0xdb96('0x24'),_0xdb96('0x25')],'where':{'name':_0x1f020c},'limit':0x1}})['then'](function(_0x37c180){logger[_0xdb96('0x8')](_0xdb96('0x26'),_0x1f020c,_0x37c180?util[_0xdb96('0x7')](_0x37c180,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1f020c,_0x37c180?_0xdb96('0x1b'):_0xdb96('0x1c'));return _0x59f07e(_0x37c180['result'][_0xdb96('0x15')]?_0x37c180['result'][0x0]:null);})['catch'](function(_0x5765ad){logger['error'](_0xdb96('0x27'),_0x5765ad?util['inspect'](_0x5765ad,{'showHidden':![],'depth':null}):'');return _0x59f07e(null);});}return _0x59f07e(null);});};exports['addTime']=function(_0x3568e4,_0xc9a2a){return moment(_0x3568e4)[_0xdb96('0x28')](_0xc9a2a,_0xdb96('0x29'))['format'](_0xdb96('0x2a'));};exports[_0xdb96('0x2b')]=function(_0x29e9ad,_0x105207){return moment(_0x29e9ad)[_0xdb96('0x2c')](_0x105207,'seconds')[_0xdb96('0x2d')](_0xdb96('0x2a'));};exports[_0xdb96('0x2e')]=function(_0x35a5cb,_0x67d895){return moment(_0x35a5cb)[_0xdb96('0x2f')](moment(_0x67d895),_0xdb96('0x29'));};exports['sumTime']=function(_0x5d3a3c,_0x5dff49){return parseInt(_0x5d3a3c,0xa)+parseInt(_0x5dff49,0xa);};exports[_0xdb96('0x30')]=function(){return moment()[_0xdb96('0x2d')](_0xdb96('0x2a'));};exports[_0xdb96('0x31')]=function(_0x496e99,_0x23ac66){if(_0x23ac66){return moment(_0x496e99)['isAfter'](_0x23ac66);}return!![];};exports['isBefore']=function(_0x3e75e5,_0x1d6752){if(_0x1d6752){return moment(_0x3e75e5)[_0xdb96('0x32')](_0x1d6752);}else if(_0x3e75e5){return!![];}return![];};
\ No newline at end of file
+var _0x140b=['internal','name','interface','stringify','result','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','sumTime','now','isAfter','isBefore','moment','client','http','../../config/logger','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser'];(function(_0x35db4d,_0x233b4a){var _0x45df10=function(_0x3ac982){while(--_0x3ac982){_0x35db4d['push'](_0x35db4d['shift']());}};_0x45df10(++_0x233b4a);}(_0x140b,0x6f));var _0xb140=function(_0x504a94,_0x55eb08){_0x504a94=_0x504a94-0x0;var _0x388833=_0x140b[_0x504a94];return _0x388833;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xb140('0x0'));var util=require('util');var client=jayson[_0xb140('0x1')][_0xb140('0x2')]({'port':0x2329});var logger=require(_0xb140('0x3'))('xdr');exports[_0xb140('0x4')]=function(_0x18496d,_0x394fac){logger[_0xb140('0x4')](_0x18496d,_0x394fac?util[_0xb140('0x5')](_0x394fac,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0xe5c500,_0x166cf5){logger[_0xb140('0x6')](_0xe5c500,_0x166cf5?util[_0xb140('0x5')](_0x166cf5,{'showHidden':![],'depth':null}):'');};exports[_0xb140('0x7')]=function(_0xa4767b,_0x1ddcf4){logger[_0xb140('0x7')](_0xa4767b,_0x1ddcf4?util[_0xb140('0x5')](_0x1ddcf4,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3494af,_0x88b3f3){return client[_0xb140('0x8')](_0x3494af,{'body':_0x88b3f3})['then'](function(_0x2de0f1){logger['debug']('[utils][request]\x20name:%s',_0x3494af,_0x2de0f1?util[_0xb140('0x5')](_0x2de0f1,{'showHidden':![],'depth':null}):'');})[_0xb140('0x9')](function(_0x185c47){logger[_0xb140('0x7')](_0xb140('0xa'),_0x3494af,_0x185c47?util['inspect'](_0x185c47,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3de305){return client[_0xb140('0x8')](_0xb140('0xb'),{'options':{'raw':!![],'attributes':['id',_0xb140('0xc'),_0xb140('0xd'),_0xb140('0xe')],'where':_0x3de305,'limit':0x1}})['then'](function(_0x442801){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xb140('0xf')](_0x3de305),_0x442801?util['inspect'](_0x442801,{'showHidden':![],'depth':null}):'');return _0x442801[_0xb140('0x10')]['length']?_0x442801['result'][0x0]:null;});}exports[_0xb140('0x11')]=function(_0x4f7362){return new BPromise(function(_0x54f935,_0x5c6049){if(_0x4f7362){return getUser({'internal':_0x4f7362})[_0xb140('0x12')](function(_0x425ae6){logger[_0xb140('0x4')](_0xb140('0x13'),_0x4f7362,_0x425ae6?_0xb140('0x14'):_0xb140('0x15'));return _0x54f935(_0x425ae6);})[_0xb140('0x9')](function(_0x3d588a){logger[_0xb140('0x7')](_0xb140('0x16'),_0x3d588a?util['inspect'](_0x3d588a,{'showHidden':![],'depth':null}):'');return _0x54f935(null);});}return _0x54f935(null);});};exports['getUserByInterface']=function(_0x58582f){return new BPromise(function(_0x516aa2,_0x38c424){if(_0x58582f){return getUser({'interface':_0x58582f})[_0xb140('0x12')](function(_0x16d651){logger['info'](_0xb140('0x17'),_0x58582f,_0x16d651?_0xb140('0x14'):_0xb140('0x15'));return _0x516aa2(_0x16d651);})['catch'](function(_0x364519){logger['error']('[utils][getUserByInterface]',_0x364519?util[_0xb140('0x5')](_0x364519,{'showHidden':![],'depth':null}):'');return _0x516aa2(null);});}return _0x516aa2(null);});};exports[_0xb140('0x18')]=function(_0x182584){return new BPromise(function(_0x2664d,_0x4706d0){if(_0x182584){return getUser({'name':_0x182584})[_0xb140('0x12')](function(_0x329c2d){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x182584,_0x329c2d?_0xb140('0x14'):_0xb140('0x15'));return _0x2664d(_0x329c2d);})[_0xb140('0x9')](function(_0x24af00){logger[_0xb140('0x7')](_0xb140('0x19'),_0x24af00?util[_0xb140('0x5')](_0x24af00,{'showHidden':![],'depth':null}):'');return _0x2664d(null);});}return _0x2664d(null);});};exports['getVoiceQueueByName']=function(_0x268227){return new BPromise(function(_0x741351,_0xc2d4ea){if(_0x268227){return client['request'](_0xb140('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xb140('0xd'),_0xb140('0x1b'),'acw',_0xb140('0x1c')],'where':{'name':_0x268227},'limit':0x1}})[_0xb140('0x12')](function(_0x1f2e61){logger['debug'](_0xb140('0x1d'),_0x268227,_0x1f2e61?util[_0xb140('0x5')](_0x1f2e61,{'showHidden':![],'depth':null}):'');logger[_0xb140('0x4')](_0xb140('0x1e'),_0x268227,_0x1f2e61?'found':_0xb140('0x15'));return _0x741351(_0x1f2e61[_0xb140('0x10')][_0xb140('0x1f')]?_0x1f2e61[_0xb140('0x10')][0x0]:null);})['catch'](function(_0x2711dc){logger['error']('[utils][getVoiceQueueByName]',_0x2711dc?util[_0xb140('0x5')](_0x2711dc,{'showHidden':![],'depth':null}):'');return _0x741351(null);});}return _0x741351(null);});};exports['addTime']=function(_0xf86eea,_0x7788c9){return moment(_0xf86eea)['add'](_0x7788c9,_0xb140('0x20'))['format'](_0xb140('0x21'));};exports[_0xb140('0x22')]=function(_0x28eb7c,_0x77fac2){return moment(_0x28eb7c)['subtract'](_0x77fac2,_0xb140('0x20'))[_0xb140('0x23')](_0xb140('0x21'));};exports[_0xb140('0x24')]=function(_0x68b7cf,_0x52afb4){return moment(_0x68b7cf)['diff'](moment(_0x52afb4),'seconds');};exports[_0xb140('0x25')]=function(_0xba786,_0x5069b5){return parseInt(_0xba786,0xa)+parseInt(_0x5069b5,0xa);};exports[_0xb140('0x26')]=function(){return moment()[_0xb140('0x23')](_0xb140('0x21'));};exports['isAfter']=function(_0x596fe8,_0xe847be){if(_0xe847be){return moment(_0x596fe8)[_0xb140('0x27')](_0xe847be);}return!![];};exports[_0xb140('0x28')]=function(_0x4ccf2d,_0x287325){if(_0x287325){return moment(_0x4ccf2d)['isBefore'](_0x287325);}else if(_0x4ccf2d){return!![];}return![];};
\ No newline at end of file
index d1e3e5a..9efc18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a6=['use','logger','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','agent_name','test','fs-extra','express-winston','path','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','user','then','no-user','timestamp','catch','error','api','auth','client-side-logger'];(function(_0x2b314a,_0x12f80d){var _0x763b29=function(_0x50052c){while(--_0x50052c){_0x2b314a['push'](_0x2b314a['shift']());}};_0x763b29(++_0x12f80d);}(_0xc2a6,0x10f));var _0x6c2a=function(_0x4c87aa,_0xad7d67){_0x4c87aa=_0x4c87aa-0x0;var _0x3f24f2=_0xc2a6[_0x4c87aa];return _0x3f24f2;};var fs=require(_0x6c2a('0x0'));var _=require('lodash');var ewinston=require(_0x6c2a('0x1'));var path=require(_0x6c2a('0x2'));var util=require('util');var fileLogger=require(_0x6c2a('0x3'))[_0x6c2a('0x4')];var safeTemplate=require('./safe-template')[_0x6c2a('0x5')];var maskSensitiveData=require(_0x6c2a('0x6'))[_0x6c2a('0x7')];function ClientSideLogger(){function _0x204968(_0x66d55f){var _0x2b696b=path[_0x6c2a('0x8')](_0x6c2a('0x9'),_0x6c2a('0xa'),_0x6c2a('0xb'));var _0x27d947=path[_0x6c2a('0x8')](_0x6c2a('0xc'),_0x66d55f[_0x6c2a('0xd')]+'-'+_0x66d55f['name']);return fs['ensureDir'](path[_0x6c2a('0x8')](_0x2b696b,_0x27d947))['then'](function(){var _0x4ca666=fileLogger(_0x6c2a('0xc'),path[_0x6c2a('0x8')](_0x2b696b,_0x27d947));return _0x4ca666;})['catch'](function(_0x45f79c){throw _0x45f79c;});}this[_0x6c2a('0xa')]=function(_0x4fc450,_0x4d5fed,_0x4128bd,_0x3d3c44){return _0x204968(_0x4fc450[_0x6c2a('0xe')])[_0x6c2a('0xf')](function(_0x39eeeb){var _0x4ecc1f=_0x39eeeb[_0x4d5fed];return _0x4ecc1f;})[_0x6c2a('0xf')](function(_0x1c1b30){var _0x28ab10=_0x4fc450[_0x6c2a('0xe')]?_0x4fc450[_0x6c2a('0xe')]['id']:_0x6c2a('0x10');var _0x2a3552=_0x3d3c44['data'];var _0x4a050e=_0x3d3c44[_0x6c2a('0x11')];var _0x112540=new Date(Number(_0x4a050e));return _0x1c1b30(_0x28ab10,_0x112540,_0x4128bd,_0x2a3552);})[_0x6c2a('0x12')](function(_0x251b84){fileLogger('client')[_0x6c2a('0x13')](_0x251b84);});};}function setupLoggers(_0x54d752){return new Promise(function(_0x1de208){var _0x500cb3=new ClientSideLogger();var _0x2a3320=fileLogger(_0x6c2a('0x14'));var _0xe87a30=fileLogger(_0x6c2a('0x15'));_0x54d752['set'](_0x6c2a('0x16'),_0x500cb3);_0x54d752[_0x6c2a('0x17')](ewinston[_0x6c2a('0x18')]({'winstonInstance':_0x2a3320,'meta':![],'statusLevels':!![],'msg':function(_0x153d4b,_0x46f7f3){var _0x129300='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x6c2a('0x19')](_0x153d4b[_0x6c2a('0x1a')])){_0x129300+=_0x6c2a('0x1b');var _0x4d6076=_0x153d4b[_0x6c2a('0x1a')];maskSensitiveData(_0x4d6076);}return safeTemplate(util[_0x6c2a('0x1c')](_0x129300,_0x153d4b[_0x6c2a('0x1d')],_0x153d4b['headers'][_0x6c2a('0x1e')]?_0x153d4b[_0x6c2a('0x1f')][_0x6c2a('0x1e')]:_0x153d4b[_0x6c2a('0x20')][_0x6c2a('0x21')]||_0x153d4b['ip'],_0x153d4b[_0x6c2a('0x22')],_0x46f7f3[_0x6c2a('0x23')],_0x46f7f3[_0x6c2a('0x24')],_0x153d4b['user']?_0x153d4b['user']['id']:null,_0x153d4b[_0x6c2a('0xe')]?_0x153d4b['user'][_0x6c2a('0x25')]:null,_0x153d4b['user']?_0x153d4b[_0x6c2a('0xe')]['role']:null,_0x4d6076?util['inspect'](_0x4d6076,![],null):''));}}));_0x54d752[_0x6c2a('0x17')](ewinston[_0x6c2a('0x18')]({'winstonInstance':_0xe87a30,'meta':![],'statusLevels':!![],'msg':function(_0x39354a,_0x5160b5){var _0x3a429b=_0x6c2a('0x26');if(_0x39354a['body']&&_0x39354a['body']['device']&&_0x39354a[_0x6c2a('0x1a')][_0x6c2a('0x27')]){_0x3a429b='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x3a429b,_0x39354a[_0x6c2a('0x1d')],_0x39354a['headers'][_0x6c2a('0x1e')]?_0x39354a[_0x6c2a('0x1f')]['x-forwarded-for']:_0x39354a['connection'][_0x6c2a('0x21')]||_0x39354a['ip'],_0x39354a[_0x6c2a('0x22')],_0x5160b5[_0x6c2a('0x23')],_0x5160b5[_0x6c2a('0x24')],_0x39354a[_0x6c2a('0xe')]?_0x39354a[_0x6c2a('0xe')]['id']:null,_0x39354a[_0x6c2a('0xe')]?_0x39354a[_0x6c2a('0xe')][_0x6c2a('0x25')]:null,_0x39354a[_0x6c2a('0xe')]?_0x39354a[_0x6c2a('0xe')]['role']:null,_0x39354a[_0x6c2a('0x1a')]&&_0x39354a['body']['device']?_0x39354a['body']['device']:'other',_0x39354a['body']&&_0x39354a[_0x6c2a('0x1a')][_0x6c2a('0x27')]?_0x39354a[_0x6c2a('0x1a')]['agent_id']:'',_0x39354a[_0x6c2a('0x1a')]&&_0x39354a['body'][_0x6c2a('0x28')]?_0x39354a[_0x6c2a('0x1a')][_0x6c2a('0x28')]:'');},'ignoreRoute':function(_0x5e5d38){var _0x8d9e7a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x8d9e7a[_0x6c2a('0x29')](_0x5e5d38[_0x6c2a('0x22')]);}}));return _0x1de208();});}exports['setupLoggers']=setupLoggers;
\ No newline at end of file
+var _0xaffa=['lodash','express-winston','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','xcally','join','role','name','then','catch','log','user','no-user','data','client','api','auth','client-side-logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_id','agent_name','setupLoggers','fs-extra'];(function(_0x11273e,_0x3821a6){var _0x1e8616=function(_0x439d86){while(--_0x439d86){_0x11273e['push'](_0x11273e['shift']());}};_0x1e8616(++_0x3821a6);}(_0xaffa,0xbb));var _0xaaff=function(_0x486efc,_0x1cca6a){_0x486efc=_0x486efc-0x0;var _0x42ae7e=_0xaffa[_0x486efc];return _0x42ae7e;};var fs=require(_0xaaff('0x0'));var _=require(_0xaaff('0x1'));var ewinston=require(_0xaaff('0x2'));var path=require(_0xaaff('0x3'));var util=require(_0xaaff('0x4'));var fileLogger=require(_0xaaff('0x5'))['fileLogger'];var safeTemplate=require(_0xaaff('0x6'))[_0xaaff('0x7')];var maskSensitiveData=require(_0xaaff('0x8'))[_0xaaff('0x9')];function ClientSideLogger(){function _0x8c4561(_0x424b89){var _0x4089e2=path['join'](_0xaaff('0xa'),'log',_0xaaff('0xb'));var _0x41adc3=path[_0xaaff('0xc')]('client',_0x424b89[_0xaaff('0xd')]+'-'+_0x424b89[_0xaaff('0xe')]);return fs['ensureDir'](path[_0xaaff('0xc')](_0x4089e2,_0x41adc3))[_0xaaff('0xf')](function(){var _0x1016c7=fileLogger('client',path[_0xaaff('0xc')](_0x4089e2,_0x41adc3));return _0x1016c7;})[_0xaaff('0x10')](function(_0x899bf){throw _0x899bf;});}this[_0xaaff('0x11')]=function(_0x2b67c4,_0x17372f,_0x5decbd,_0x167196){return _0x8c4561(_0x2b67c4[_0xaaff('0x12')])[_0xaaff('0xf')](function(_0x187092){var _0x460144=_0x187092[_0x17372f];return _0x460144;})['then'](function(_0x5868c9){var _0x39120d=_0x2b67c4[_0xaaff('0x12')]?_0x2b67c4[_0xaaff('0x12')]['id']:_0xaaff('0x13');var _0x2470cf=_0x167196[_0xaaff('0x14')];var _0x58ba31=_0x167196['timestamp'];var _0x376565=new Date(Number(_0x58ba31));return _0x5868c9(_0x39120d,_0x376565,_0x5decbd,_0x2470cf);})['catch'](function(_0x53fc5f){fileLogger(_0xaaff('0x15'))['error'](_0x53fc5f);});};}function setupLoggers(_0x5c0782){return new Promise(function(_0x31f71d){var _0x4b4712=new ClientSideLogger();var _0x5779fd=fileLogger(_0xaaff('0x16'));var _0xfd767d=fileLogger(_0xaaff('0x17'));_0x5c0782['set'](_0xaaff('0x18'),_0x4b4712);_0x5c0782['use'](ewinston['logger']({'winstonInstance':_0x5779fd,'meta':![],'statusLevels':!![],'msg':function(_0x5e01d7,_0xe3d5c4){var _0x254bc3=_0xaaff('0x19');if(!_[_0xaaff('0x1a')](_0x5e01d7[_0xaaff('0x1b')])){_0x254bc3+=_0xaaff('0x1c');var _0x5b41a2=_0x5e01d7[_0xaaff('0x1b')];maskSensitiveData(_0x5b41a2);}return safeTemplate(util[_0xaaff('0x1d')](_0x254bc3,_0x5e01d7[_0xaaff('0x1e')],_0x5e01d7[_0xaaff('0x1f')]['x-forwarded-for']?_0x5e01d7[_0xaaff('0x1f')][_0xaaff('0x20')]:_0x5e01d7[_0xaaff('0x21')][_0xaaff('0x22')]||_0x5e01d7['ip'],_0x5e01d7[_0xaaff('0x23')],_0xe3d5c4[_0xaaff('0x24')],_0xe3d5c4[_0xaaff('0x25')],_0x5e01d7[_0xaaff('0x12')]?_0x5e01d7['user']['id']:null,_0x5e01d7[_0xaaff('0x12')]?_0x5e01d7[_0xaaff('0x12')]['name']:null,_0x5e01d7[_0xaaff('0x12')]?_0x5e01d7[_0xaaff('0x12')][_0xaaff('0xd')]:null,_0x5b41a2?util['inspect'](_0x5b41a2,![],null):''));}}));_0x5c0782[_0xaaff('0x26')](ewinston[_0xaaff('0x27')]({'winstonInstance':_0xfd767d,'meta':![],'statusLevels':!![],'msg':function(_0x3b3fbd,_0x5f4d7f){var _0x59889f=_0xaaff('0x28');if(_0x3b3fbd[_0xaaff('0x1b')]&&_0x3b3fbd['body'][_0xaaff('0x29')]&&_0x3b3fbd[_0xaaff('0x1b')]['agent_id']){_0x59889f=_0xaaff('0x2a');}return util['format'](_0x59889f,_0x3b3fbd[_0xaaff('0x1e')],_0x3b3fbd['headers'][_0xaaff('0x20')]?_0x3b3fbd[_0xaaff('0x1f')][_0xaaff('0x20')]:_0x3b3fbd[_0xaaff('0x21')]['remoteAddress']||_0x3b3fbd['ip'],_0x3b3fbd['url'],_0x5f4d7f[_0xaaff('0x24')],_0x5f4d7f[_0xaaff('0x25')],_0x3b3fbd['user']?_0x3b3fbd[_0xaaff('0x12')]['id']:null,_0x3b3fbd[_0xaaff('0x12')]?_0x3b3fbd[_0xaaff('0x12')][_0xaaff('0xe')]:null,_0x3b3fbd[_0xaaff('0x12')]?_0x3b3fbd[_0xaaff('0x12')][_0xaaff('0xd')]:null,_0x3b3fbd[_0xaaff('0x1b')]&&_0x3b3fbd[_0xaaff('0x1b')]['device']?_0x3b3fbd[_0xaaff('0x1b')][_0xaaff('0x29')]:_0xaaff('0x2b'),_0x3b3fbd[_0xaaff('0x1b')]&&_0x3b3fbd[_0xaaff('0x1b')][_0xaaff('0x2c')]?_0x3b3fbd['body'][_0xaaff('0x2c')]:'',_0x3b3fbd[_0xaaff('0x1b')]&&_0x3b3fbd[_0xaaff('0x1b')]['agent_name']?_0x3b3fbd[_0xaaff('0x1b')][_0xaaff('0x2d')]:'');},'ignoreRoute':function(_0x280ac6){var _0x233edd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x233edd['test'](_0x280ac6[_0xaaff('0x23')]);}}));return _0x31f71d();});}exports[_0xaaff('0x2e')]=setupLoggers;
\ No newline at end of file
index 6df80d7..4d747ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b80=['exports','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','ddd','dowCompare','date','min','max','domCompare','format','MMM','includes','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat'];(function(_0x305551,_0x868339){var _0x115ce2=function(_0x49265b){while(--_0x49265b){_0x305551['push'](_0x305551['shift']());}};_0x115ce2(++_0x868339);}(_0x4b80,0x164));var _0x04b8=function(_0x13381c,_0x1d6b39){_0x13381c=_0x13381c-0x0;var _0x3c4d1f=_0x4b80[_0x13381c];return _0x3c4d1f;};var _=require(_0x04b8('0x0'));var moment=require(_0x04b8('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x04b8('0x2')](function(_0x3741e9){return _0x3741e9['source'];})[_0x04b8('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x04b8('0x4');var EINVALID_DATE=_0x04b8('0x5');function throwIfDateNotValid(_0x52c339){if(!_0x52c339[_0x04b8('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2b3a62){var _0x4ef9c7=_0x2b3a62[_0x04b8('0x7')](':')[_0x04b8('0x2')](function(_0x268278){return parseInt(_0x268278,0xa);});var _0x58785b=_0x4ef9c7[0x0];var _0x21eac2=_0x4ef9c7[0x1];if(_0x58785b<0x0||_0x58785b>0x17||_0x21eac2<0x0||_0x21eac2>0x3b){throw new Error(EINVALID_DATE);}return[_0x58785b,_0x21eac2];}function circularDoWInterval(_0x56136a,_0x5daf28){if(_0x56136a===_0x5daf28){return[_0x56136a];}else{var _0x160b2b=moment['locale']();moment[_0x04b8('0x8')]('en');var _0x30cd78=moment['weekdaysShort']()['map'](function(_0xad6d72){return _0xad6d72[_0x04b8('0x9')]();});moment[_0x04b8('0x8')](_0x160b2b);var _0x5b7ae4=_0x30cd78['indexOf'](_0x56136a);var _0x405c72=_0x30cd78[_0x04b8('0xa')](_0x5daf28);if(_0x405c72>_0x5b7ae4){return _0x30cd78[_0x04b8('0xb')](_0x5b7ae4,_0x405c72+0x1);}else{var _0x14289d=_0x30cd78[_0x04b8('0xb')](0x0,_0x405c72+0x1);var _0x1941e3=_0x30cd78[_0x04b8('0xb')](_0x5b7ae4);return _0x1941e3[_0x04b8('0xc')](_0x14289d);}}}module[_0x04b8('0xd')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x12fa37,_0x2081de){if(_0x12fa37===_0x2081de){return[_0x12fa37];}else{var _0x767355=moment[_0x04b8('0x8')]();moment[_0x04b8('0x8')]('en');var _0x44cc18=moment[_0x04b8('0xe')]()[_0x04b8('0x2')](function(_0x2b3391){return _0x2b3391[_0x04b8('0x9')]();});moment[_0x04b8('0x8')](_0x767355);var _0x53d419=_0x44cc18[_0x04b8('0xa')](_0x12fa37);var _0x1db5b8=_0x44cc18[_0x04b8('0xa')](_0x2081de);if(_0x1db5b8>_0x53d419){return _0x44cc18[_0x04b8('0xb')](_0x53d419,_0x1db5b8+0x1);}else{var _0x17645a=_0x44cc18[_0x04b8('0xb')](0x0,_0x1db5b8+0x1);var _0x1c79ea=_0x44cc18[_0x04b8('0xb')](_0x53d419);return _0x1c79ea[_0x04b8('0xc')](_0x17645a);}}}module[_0x04b8('0xd')][_0x04b8('0xf')]=circularMonthInterval;function parseDom(_0x1c34e8){var _0x58d0bf=parseInt(_0x1c34e8,0xa);if(_0x58d0bf<0x1||_0x58d0bf>0x1f){throw new Error(EINVALID_DATE);}return _0x58d0bf;}function timeCompare(_0x1600dc,_0xd95091,_0x550d81){var _0x326d27=_0x1600dc['clone']();var _0x173073=extractTime(_0xd95091);var _0x149427=_0x173073[0x0];var _0x88e906=_0x173073[0x1];var _0x10a396=_0x1600dc[_0x04b8('0x10')]()[_0x04b8('0x11')](_0x149427)['minutes'](_0x88e906);throwIfDateNotValid(_0x10a396);var _0x268fe6=extractTime(_0x550d81);var _0x5490c7=_0x268fe6[0x0];var _0x43518d=_0x268fe6[0x1];var _0x4d5197=_0x1600dc[_0x04b8('0x10')]()[_0x04b8('0x11')](_0x5490c7)[_0x04b8('0x12')](_0x43518d);throwIfDateNotValid(_0x4d5197);if(_0x4d5197[_0x04b8('0x13')](_0x10a396)){var _0x21c616=_0x326d27[_0x04b8('0x10')]()[_0x04b8('0x14')](_0x04b8('0x15'));var _0x59d2d5=_0x326d27['clone']()[_0x04b8('0x16')](_0x04b8('0x15'));return _0x326d27[_0x04b8('0x17')](_0x10a396,_0x59d2d5,undefined,'[]')||_0x326d27['isBetween'](_0x21c616,_0x4d5197,undefined,'[]');}else{return _0x326d27[_0x04b8('0x17')](_0x10a396,_0x4d5197,undefined,'[]');}}module[_0x04b8('0xd')][_0x04b8('0x18')]=timeCompare;function dowCompare(_0x2c3a0d,_0x3965d3,_0x539de3){var _0x537921=_0x2c3a0d[_0x04b8('0x8')]('en')['format'](_0x04b8('0x19'))['toLowerCase']();return circularDoWInterval(_0x3965d3,_0x539de3)['includes'](_0x537921);}module[_0x04b8('0xd')][_0x04b8('0x1a')]=dowCompare;function domCompare(_0xae070b,_0x267571,_0x10a3d7){var _0x167c6a=_0xae070b[_0x04b8('0x1b')]();if(_0x267571===_0x10a3d7){return _0x167c6a===_0x267571;}else{var _0x9ac39d=_0xae070b['daysInMonth']();var _0x2cda5e=_0x267571<_0x10a3d7;let _0x323f02=![];var _0x34edb1=0x0;var _0x1b8704=0x0;if(_0x2cda5e){_0x34edb1=Math['max'](0x1,_0x267571);_0x1b8704=Math[_0x04b8('0x1c')](_0x10a3d7,_0x9ac39d);_0x323f02=_0x167c6a>=_0x34edb1&&_0x167c6a<=_0x1b8704;}else{_0x34edb1=Math[_0x04b8('0x1c')](_0x267571,_0x9ac39d);_0x1b8704=Math[_0x04b8('0x1d')](0x1,_0x10a3d7);_0x323f02=_0x167c6a>=_0x34edb1||_0x167c6a<=_0x1b8704;}return _0x323f02;}}module[_0x04b8('0xd')][_0x04b8('0x1e')]=domCompare;function monthCompare(_0x194ec0,_0x1507a9,_0x234cc9){var _0x37723d=_0x194ec0['locale']('en')[_0x04b8('0x1f')](_0x04b8('0x20'))['toLowerCase']();return circularMonthInterval(_0x1507a9,_0x234cc9)[_0x04b8('0x21')](_0x37723d);}module[_0x04b8('0xd')][_0x04b8('0x22')]=monthCompare;function iftime(_0x163c99,_0x5b2424=moment['tz'][_0x04b8('0x23')](),_0x1c868c=moment()){if(!validateRx[_0x04b8('0x24')](_0x163c99)){throw new Error(EINVALID_STRING);}else{var _0x5a2d48=(moment[_0x04b8('0x25')](_0x1c868c)?_0x1c868c[_0x04b8('0x10')]():moment(_0x1c868c))['tz'](_0x5b2424)['locale']('en');throwIfDateNotValid(_0x5a2d48);var _0x323a4f=_0x163c99[_0x04b8('0x7')](',');var _0x5de29f=_0x323a4f[0x0];var _0x6a34b4=_0x323a4f[0x1];var _0x59fbc1=_0x323a4f[0x2];var _0x922775=_0x323a4f[0x3];let _0x31ae74=!![];if(_0x5de29f!=='*'){var _0x5534f9=_0x5de29f[_0x04b8('0x7')]('-');var _0xd97d4b=_[_0x04b8('0x26')](_0x5534f9[0x0],0x5,'0');var _0x35546b=_0x5534f9[_0x04b8('0x27')]===0x2?_[_0x04b8('0x26')](_0x5534f9[0x1],0x5,'0'):_0xd97d4b;_0x31ae74=timeCompare(_0x5a2d48,_0xd97d4b,_0x35546b);}let _0x4fe21d=!![];if(_0x6a34b4!=='*'){var _0x5e140d=_0x6a34b4[_0x04b8('0x7')]('-');var _0x2c90f7=_0x5e140d[0x0];var _0x10b668=_0x5e140d[_0x04b8('0x27')]===0x2?_0x5e140d[0x1]:_0x2c90f7;_0x4fe21d=dowCompare(_0x5a2d48,_0x2c90f7,_0x10b668);}let _0x3952e5=!![];if(_0x59fbc1!=='*'){var _0x13b993=_0x59fbc1[_0x04b8('0x7')]('-');var _0x2286d1=parseDom(_0x13b993[0x0]);var _0xabb7af=_0x13b993['length']===0x2?parseDom(_0x13b993[0x1]):_0x2286d1;_0x3952e5=domCompare(_0x5a2d48,_0x2286d1,_0xabb7af);}let _0x52077d=!![];if(_0x922775!=='*'){var _0x189a0f=_0x922775[_0x04b8('0x7')]('-');var _0x599020=_0x189a0f[0x0];var _0x20121d=_0x189a0f[_0x04b8('0x27')]===0x2?_0x189a0f[0x1]:_0x189a0f[0x0];_0x52077d=monthCompare(_0x5a2d48,_0x599020,_0x20121d);}return _0x31ae74&&_0x4fe21d&&_0x3952e5&&_0x52077d;}}module[_0x04b8('0xd')][_0x04b8('0x28')]=iftime;
\ No newline at end of file
+var _0x585b=['clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','dowCompare','date','daysInMonth','min','max','domCompare','MMM','includes','monthCompare','guess','test','isMoment','split','padStart','length','moment-timezone','map','source','Interval\x20string\x20not\x20valid','isValid','locale','weekdaysShort','indexOf','slice','exports','circularDoWInterval','toLowerCase','concat'];(function(_0x2820b3,_0x4caa81){var _0x99d2c2=function(_0x48afd1){while(--_0x48afd1){_0x2820b3['push'](_0x2820b3['shift']());}};_0x99d2c2(++_0x4caa81);}(_0x585b,0xb6));var _0xb585=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x585b[_0x47aa64];return _0x549c7a;};var _=require('lodash');var moment=require(_0xb585('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xb585('0x1')](function(_0x773def){return _0x773def[_0xb585('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xb585('0x3');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x51a146){if(!_0x51a146[_0xb585('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2b8ca2){var _0x2f1f2c=_0x2b8ca2['split'](':')[_0xb585('0x1')](function(_0x435c2c){return parseInt(_0x435c2c,0xa);});var _0x56123b=_0x2f1f2c[0x0];var _0x202c39=_0x2f1f2c[0x1];if(_0x56123b<0x0||_0x56123b>0x17||_0x202c39<0x0||_0x202c39>0x3b){throw new Error(EINVALID_DATE);}return[_0x56123b,_0x202c39];}function circularDoWInterval(_0x1d538a,_0x4e4ef1){if(_0x1d538a===_0x4e4ef1){return[_0x1d538a];}else{var _0x4847ca=moment[_0xb585('0x5')]();moment[_0xb585('0x5')]('en');var _0x344257=moment[_0xb585('0x6')]()[_0xb585('0x1')](function(_0x5085bb){return _0x5085bb['toLowerCase']();});moment['locale'](_0x4847ca);var _0x1099b9=_0x344257[_0xb585('0x7')](_0x1d538a);var _0x783b30=_0x344257['indexOf'](_0x4e4ef1);if(_0x783b30>_0x1099b9){return _0x344257[_0xb585('0x8')](_0x1099b9,_0x783b30+0x1);}else{var _0x47f47a=_0x344257[_0xb585('0x8')](0x0,_0x783b30+0x1);var _0x1890ed=_0x344257[_0xb585('0x8')](_0x1099b9);return _0x1890ed['concat'](_0x47f47a);}}}module[_0xb585('0x9')][_0xb585('0xa')]=circularDoWInterval;function circularMonthInterval(_0x1cf8fd,_0x427713){if(_0x1cf8fd===_0x427713){return[_0x1cf8fd];}else{var _0x3164d1=moment[_0xb585('0x5')]();moment['locale']('en');var _0x299d06=moment['monthsShort']()[_0xb585('0x1')](function(_0x10ddad){return _0x10ddad[_0xb585('0xb')]();});moment[_0xb585('0x5')](_0x3164d1);var _0x329c7f=_0x299d06['indexOf'](_0x1cf8fd);var _0x10ae74=_0x299d06['indexOf'](_0x427713);if(_0x10ae74>_0x329c7f){return _0x299d06[_0xb585('0x8')](_0x329c7f,_0x10ae74+0x1);}else{var _0x12dd66=_0x299d06[_0xb585('0x8')](0x0,_0x10ae74+0x1);var _0x84a39f=_0x299d06[_0xb585('0x8')](_0x329c7f);return _0x84a39f[_0xb585('0xc')](_0x12dd66);}}}module[_0xb585('0x9')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x39b138){var _0x5224c8=parseInt(_0x39b138,0xa);if(_0x5224c8<0x1||_0x5224c8>0x1f){throw new Error(EINVALID_DATE);}return _0x5224c8;}function timeCompare(_0xc9c829,_0x7d76d2,_0x2e879b){var _0x4989fe=_0xc9c829[_0xb585('0xd')]();var _0x268212=extractTime(_0x7d76d2);var _0x2e52e5=_0x268212[0x0];var _0x1da1b0=_0x268212[0x1];var _0x56b257=_0xc9c829[_0xb585('0xd')]()[_0xb585('0xe')](_0x2e52e5)[_0xb585('0xf')](_0x1da1b0);throwIfDateNotValid(_0x56b257);var _0x5bb9d1=extractTime(_0x2e879b);var _0xd88fa2=_0x5bb9d1[0x0];var _0x226712=_0x5bb9d1[0x1];var _0x27d259=_0xc9c829['clone']()[_0xb585('0xe')](_0xd88fa2)[_0xb585('0xf')](_0x226712);throwIfDateNotValid(_0x27d259);if(_0x27d259[_0xb585('0x10')](_0x56b257)){var _0x2aad40=_0x4989fe[_0xb585('0xd')]()[_0xb585('0x11')](_0xb585('0x12'));var _0x147a17=_0x4989fe[_0xb585('0xd')]()[_0xb585('0x13')](_0xb585('0x12'));return _0x4989fe[_0xb585('0x14')](_0x56b257,_0x147a17,undefined,'[]')||_0x4989fe[_0xb585('0x14')](_0x2aad40,_0x27d259,undefined,'[]');}else{return _0x4989fe[_0xb585('0x14')](_0x56b257,_0x27d259,undefined,'[]');}}module[_0xb585('0x9')][_0xb585('0x15')]=timeCompare;function dowCompare(_0x21cbe5,_0x3a7cf4,_0x291a74){var _0x4e4dcb=_0x21cbe5[_0xb585('0x5')]('en')[_0xb585('0x16')](_0xb585('0x17'))[_0xb585('0xb')]();return circularDoWInterval(_0x3a7cf4,_0x291a74)['includes'](_0x4e4dcb);}module[_0xb585('0x9')][_0xb585('0x18')]=dowCompare;function domCompare(_0x18fada,_0x7d076d,_0x3e9e67){var _0x2e8662=_0x18fada[_0xb585('0x19')]();if(_0x7d076d===_0x3e9e67){return _0x2e8662===_0x7d076d;}else{var _0x2adf74=_0x18fada[_0xb585('0x1a')]();var _0x420f61=_0x7d076d<_0x3e9e67;let _0x2213d3=![];var _0x36968e=0x0;var _0x2c6ab8=0x0;if(_0x420f61){_0x36968e=Math['max'](0x1,_0x7d076d);_0x2c6ab8=Math[_0xb585('0x1b')](_0x3e9e67,_0x2adf74);_0x2213d3=_0x2e8662>=_0x36968e&&_0x2e8662<=_0x2c6ab8;}else{_0x36968e=Math[_0xb585('0x1b')](_0x7d076d,_0x2adf74);_0x2c6ab8=Math[_0xb585('0x1c')](0x1,_0x3e9e67);_0x2213d3=_0x2e8662>=_0x36968e||_0x2e8662<=_0x2c6ab8;}return _0x2213d3;}}module[_0xb585('0x9')][_0xb585('0x1d')]=domCompare;function monthCompare(_0x43d777,_0x29cd0b,_0x51e7ce){var _0x25bd39=_0x43d777[_0xb585('0x5')]('en')[_0xb585('0x16')](_0xb585('0x1e'))[_0xb585('0xb')]();return circularMonthInterval(_0x29cd0b,_0x51e7ce)[_0xb585('0x1f')](_0x25bd39);}module[_0xb585('0x9')][_0xb585('0x20')]=monthCompare;function iftime(_0x436022,_0x250905=moment['tz'][_0xb585('0x21')](),_0xe28b3c=moment()){if(!validateRx[_0xb585('0x22')](_0x436022)){throw new Error(EINVALID_STRING);}else{var _0x37dafa=(moment[_0xb585('0x23')](_0xe28b3c)?_0xe28b3c[_0xb585('0xd')]():moment(_0xe28b3c))['tz'](_0x250905)[_0xb585('0x5')]('en');throwIfDateNotValid(_0x37dafa);var _0x2a4602=_0x436022[_0xb585('0x24')](',');var _0x256338=_0x2a4602[0x0];var _0x3f126d=_0x2a4602[0x1];var _0x323fdc=_0x2a4602[0x2];var _0x44ee1b=_0x2a4602[0x3];let _0x41dd3f=!![];if(_0x256338!=='*'){var _0x8950a6=_0x256338[_0xb585('0x24')]('-');var _0x454414=_['padStart'](_0x8950a6[0x0],0x5,'0');var _0x5b887b=_0x8950a6['length']===0x2?_[_0xb585('0x25')](_0x8950a6[0x1],0x5,'0'):_0x454414;_0x41dd3f=timeCompare(_0x37dafa,_0x454414,_0x5b887b);}let _0x27318a=!![];if(_0x3f126d!=='*'){var _0x26eca8=_0x3f126d[_0xb585('0x24')]('-');var _0x40566=_0x26eca8[0x0];var _0x4324ff=_0x26eca8[_0xb585('0x26')]===0x2?_0x26eca8[0x1]:_0x40566;_0x27318a=dowCompare(_0x37dafa,_0x40566,_0x4324ff);}let _0x496e1f=!![];if(_0x323fdc!=='*'){var _0x34197f=_0x323fdc[_0xb585('0x24')]('-');var _0x48a81b=parseDom(_0x34197f[0x0]);var _0x5666b1=_0x34197f[_0xb585('0x26')]===0x2?parseDom(_0x34197f[0x1]):_0x48a81b;_0x496e1f=domCompare(_0x37dafa,_0x48a81b,_0x5666b1);}let _0x47f172=!![];if(_0x44ee1b!=='*'){var _0x1d89d0=_0x44ee1b[_0xb585('0x24')]('-');var _0x4da9d2=_0x1d89d0[0x0];var _0x34f5d1=_0x1d89d0['length']===0x2?_0x1d89d0[0x1]:_0x1d89d0[0x0];_0x47f172=monthCompare(_0x37dafa,_0x4da9d2,_0x34f5d1);}return _0x41dd3f&&_0x27318a&&_0x496e1f&&_0x47f172;}}module['exports']['iftime']=iftime;
\ No newline at end of file
index 34a585f..61d32ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814d=['}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','path','moment','winston','../config/environment','debugLevel','info','redBG\x20white','white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','%s-%s.log','message','replace'];(function(_0x14351b,_0x297fd5){var _0x38d449=function(_0x3ee4dd){while(--_0x3ee4dd){_0x14351b['push'](_0x14351b['shift']());}};_0x38d449(++_0x297fd5);}(_0x814d,0x185));var _0xd814=function(_0x341609,_0x5240db){_0x341609=_0x341609-0x0;var _0x38ccbd=_0x814d[_0x341609];return _0x38ccbd;};'use strict';var path=require(_0xd814('0x0'));var util=require('util');var moment=require(_0xd814('0x1'));var winston=require(_0xd814('0x2'));var config=require(_0xd814('0x3'));var debugLevel=config[_0xd814('0x4')]?config[_0xd814('0x4')]['toLowerCase']():_0xd814('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':_0xd814('0x6'),'error':'red','warn':'bold\x20yellow','info':_0xd814('0x7'),'print':_0xd814('0x8'),'success':_0xd814('0x9'),'http':_0xd814('0xa'),'verbose':'bold\x20magenta','debug':_0xd814('0xb'),'silly':_0xd814('0xc')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x365844,_0x48e7fb,_0x2fea1e){var _0x4eb86b=_0x365844||_0xd814('0xd');return path[_0xd814('0xe')](_0x4eb86b,util['format'](_0xd814('0xf'),_0x48e7fb,_0x2fea1e));}function formatter(_0x4d9329,_0x119564){_0x119564[_0xd814('0x10')]=_0x119564['message'][_0xd814('0x11')](/@@{/g,'{{{')[_0xd814('0x11')](/}@@/g,_0xd814('0x12'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xd814('0x13')](_0xd814('0x14'),moment()[_0xd814('0x13')](_0xd814('0x15')),_0x119564[_0xd814('0x16')][_0xd814('0x17')](),_0x4d9329,_0x119564['message']);}function fileFormat(_0xf19325,_0x41e7c2){_0x41e7c2[_0xd814('0x10')]=_0x41e7c2[_0xd814('0x10')][_0xd814('0x11')](/@@{/g,_0xd814('0x18'))['replace'](/}@@/g,_0xd814('0x12'))[_0xd814('0x11')](/@{/g,'{{')[_0xd814('0x11')](/}@/g,'}}');var _0x119594=_0x41e7c2[_0xd814('0x19')]&&Object[_0xd814('0x1a')](_0x41e7c2[_0xd814('0x19')])[_0xd814('0x1b')]?'\x0a\x09'+JSON['stringify'](_0x41e7c2[_0xd814('0x19')]):'';return util['format'](_0xd814('0x1c'),moment()['format'](_0xd814('0x15')),_0x41e7c2[_0xd814('0x16')][_0xd814('0x17')](),_0xf19325,_0x41e7c2[_0xd814('0x10')],_0x119594);}function consoleLogger(){var _0x1ddaac=new winston[(_0xd814('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd814('0x1e'))][(_0xd814('0x1f'))]({'level':_0xd814('0x20'),'json':![],'formatter':function(_0x596dcd){return formatter('',_0x596dcd);}})]});return _0x1ddaac;}function fileLogger(_0x875384,_0x415760){var _0x1841ba=new winston[(_0xd814('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd814('0x1e'))][(_0xd814('0x21'))]({'name':util['format'](_0xd814('0x22'),_0x875384,_0xd814('0x23')),'filename':getLogFileName(_0x415760,_0x875384,_0xd814('0x23')),'level':_0xd814('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xc340c3){return fileFormat(_0x875384,_0xc340c3);}}),new winston[(_0xd814('0x1e'))][(_0xd814('0x21'))]({'name':util[_0xd814('0x13')](_0xd814('0x22'),_0x875384,debugLevel),'filename':getLogFileName(_0x415760,_0x875384,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4467c0){return fileFormat(_0x875384,_0x4467c0);}}),new winston['transports'][(_0xd814('0x1f'))]({'level':_0xd814('0x20'),'json':![],'formatter':function(_0x20f48c){return fileFormat(_0x875384,_0x20f48c);}})]});return _0x1841ba;}exports[_0xd814('0x24')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0xf7ed=['warn','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','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','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console'];(function(_0xe884b0,_0x27e06d){var _0x3e4d79=function(_0x3d7642){while(--_0x3d7642){_0xe884b0['push'](_0xe884b0['shift']());}};_0x3e4d79(++_0x27e06d);}(_0xf7ed,0x12d));var _0xdf7e=function(_0x89a1e7,_0x242359){_0x89a1e7=_0x89a1e7-0x0;var _0x16c5e3=_0xf7ed[_0x89a1e7];return _0x16c5e3;};'use strict';var path=require(_0xdf7e('0x0'));var util=require(_0xdf7e('0x1'));var moment=require(_0xdf7e('0x2'));var winston=require(_0xdf7e('0x3'));var config=require(_0xdf7e('0x4'));var debugLevel=config[_0xdf7e('0x5')]?config[_0xdf7e('0x5')][_0xdf7e('0x6')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xdf7e('0x7'),'error':_0xdf7e('0x8'),'warn':_0xdf7e('0x9'),'info':'white','print':_0xdf7e('0xa'),'success':_0xdf7e('0xb'),'http':_0xdf7e('0xc'),'verbose':'bold\x20magenta','debug':_0xdf7e('0xd'),'silly':_0xdf7e('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x37ea5f,_0x3f3c21,_0x31865e){var _0x353699=_0x37ea5f||'/var/log/xcally';return path[_0xdf7e('0xf')](_0x353699,util[_0xdf7e('0x10')](_0xdf7e('0x11'),_0x3f3c21,_0x31865e));}function formatter(_0x4e9a60,_0x56d1e3){_0x56d1e3[_0xdf7e('0x12')]=_0x56d1e3['message'][_0xdf7e('0x13')](/@@{/g,_0xdf7e('0x14'))[_0xdf7e('0x13')](/}@@/g,_0xdf7e('0x15'))['replace'](/@{/g,'{{')[_0xdf7e('0x13')](/}@/g,'}}');return util[_0xdf7e('0x10')](_0xdf7e('0x16'),moment()[_0xdf7e('0x10')](_0xdf7e('0x17')),_0x56d1e3[_0xdf7e('0x18')]['toUpperCase'](),_0x4e9a60,_0x56d1e3['message']);}function fileFormat(_0x15ab11,_0x37d0e4){_0x37d0e4[_0xdf7e('0x12')]=_0x37d0e4['message'][_0xdf7e('0x13')](/@@{/g,_0xdf7e('0x14'))['replace'](/}@@/g,_0xdf7e('0x15'))[_0xdf7e('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x874a4c=_0x37d0e4[_0xdf7e('0x19')]&&Object['keys'](_0x37d0e4[_0xdf7e('0x19')])[_0xdf7e('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x37d0e4[_0xdf7e('0x19')]):'';return util[_0xdf7e('0x10')](_0xdf7e('0x1b'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x37d0e4[_0xdf7e('0x18')][_0xdf7e('0x1c')](),_0x15ab11,_0x37d0e4[_0xdf7e('0x12')],_0x874a4c);}function consoleLogger(){var _0x2a7eda=new winston[(_0xdf7e('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdf7e('0x1e'))][(_0xdf7e('0x1f'))]({'level':_0xdf7e('0x20'),'json':![],'formatter':function(_0x3abaaf){return formatter('',_0x3abaaf);}})]});return _0x2a7eda;}function fileLogger(_0x578f7e,_0x163bb2){var _0x3b26b2=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0xdf7e('0x10')](_0xdf7e('0x21'),_0x578f7e,_0xdf7e('0x22')),'filename':getLogFileName(_0x163bb2,_0x578f7e,_0xdf7e('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xadb851){return fileFormat(_0x578f7e,_0xadb851);}}),new winston[(_0xdf7e('0x1e'))]['File']({'name':util[_0xdf7e('0x10')](_0xdf7e('0x21'),_0x578f7e,debugLevel),'filename':getLogFileName(_0x163bb2,_0x578f7e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x16cffa){return fileFormat(_0x578f7e,_0x16cffa);}}),new winston[(_0xdf7e('0x1e'))][(_0xdf7e('0x1f'))]({'level':'warn','json':![],'formatter':function(_0xf2c5bb){return fileFormat(_0x578f7e,_0xf2c5bb);}})]});return _0x3b26b2;}exports[_0xdf7e('0x23')]=consoleLogger;exports[_0xdf7e('0x24')]=fileLogger;
\ No newline at end of file
index 1caf863..ef32041 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(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x4975,0x86));var _0x5497=function(_0xdec583,_0x26ac72){_0xdec583=_0xdec583-0x0;var _0x55e635=_0x4975[_0xdec583];return _0x55e635;};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 _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x2a99a4,_0x5b6b84){var _0x457690=function(_0x328fea){while(--_0x328fea){_0x2a99a4['push'](_0x2a99a4['shift']());}};_0x457690(++_0x5b6b84);}(_0x66fa,0x117));var _0xa66f=function(_0x193371,_0x42e69c){_0x193371=_0x193371-0x0;var _0x2a581d=_0x66fa[_0x193371];return _0x2a581d;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData;
\ No newline at end of file
index 15beffb..e24c629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb4=['keys','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x2ce447,_0x5b7967){var _0x39f532=function(_0x13d9bb){while(--_0x13d9bb){_0x2ce447['push'](_0x2ce447['shift']());}};_0x39f532(++_0x5b7967);}(_0x6cb4,0xff));var _0x46cb=function(_0x56193b,_0x3ef024){_0x56193b=_0x56193b-0x0;var _0x3507f3=_0x6cb4[_0x56193b];return _0x3507f3;};var _=require(_0x46cb('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x338f2b){return _0x338f2b==='{{'?_0x46cb('0x1'):_0x46cb('0x2');}function safeTemplate(_0x375bef){var _0x36add6=_0x375bef;if(typeof _0x375bef===_0x46cb('0x3')){_0x36add6=_0x375bef[_0x46cb('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x46cb('0x5')](_0x375bef)){_0x36add6=_0x375bef['map'](function(_0x1a3fe4){return safeTemplate(_0x1a3fe4);});}else if(_['isPlainObject'](_0x375bef)){_0x36add6=Object[_0x46cb('0x6')](_0x375bef)['reduce'](function(_0x11262d,_0x148d0f){_0x11262d[_0x148d0f]=safeTemplate(_0x375bef[_0x148d0f]);return _0x11262d;},{});}return _0x36add6;}module[_0x46cb('0x7')][_0x46cb('0x8')]=safeTemplate;
\ No newline at end of file
+var _0x36ee=['replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','string'];(function(_0x1e3461,_0x21150f){var _0x55a43a=function(_0x3c6a83){while(--_0x3c6a83){_0x1e3461['push'](_0x1e3461['shift']());}};_0x55a43a(++_0x21150f);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4889d8){return _0x4889d8==='{{'?_0xe36e('0x0'):'\x20}\x20}';}function safeTemplate(_0xf6b517){var _0x4018bf=_0xf6b517;if(typeof _0xf6b517===_0xe36e('0x1')){_0x4018bf=_0xf6b517[_0xe36e('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe36e('0x3')](_0xf6b517)){_0x4018bf=_0xf6b517[_0xe36e('0x4')](function(_0x29e692){return safeTemplate(_0x29e692);});}else if(_[_0xe36e('0x5')](_0xf6b517)){_0x4018bf=Object[_0xe36e('0x6')](_0xf6b517)[_0xe36e('0x7')](function(_0x21be0b,_0x1aa596){_0x21be0b[_0x1aa596]=safeTemplate(_0xf6b517[_0x1aa596]);return _0x21be0b;},{});}return _0x4018bf;}module['exports'][_0xe36e('0x8')]=safeTemplate;
\ No newline at end of file
index 1316b4a..9800f67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x018f=['findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','updated','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','legacy-libs','isArray','apps'];(function(_0x59fe6d,_0x330b2a){var _0x78e39d=function(_0x2f09ba){while(--_0x2f09ba){_0x59fe6d['push'](_0x59fe6d['shift']());}};_0x78e39d(++_0x330b2a);}(_0x018f,0x124));var _0xf018=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x018f[_0x15b399];return _0x199f2d;};var fs=require(_0xf018('0x0'));var path=require(_0xf018('0x1'));var config=require(_0xf018('0x2'));var root=config[_0xf018('0x3')];var APP_JSON_PATH=path[_0xf018('0x4')](root,'server/app.json');var NODEPATH=path[_0xf018('0x4')](root,_0xf018('0x5'));function setLegacyLibsNodeEnvPath(_0x341ed9){let _0x2b74b3=![];if(Array[_0xf018('0x6')](_0x341ed9[_0xf018('0x7')])){var _0x47d790=_0x341ed9[_0xf018('0x7')][_0xf018('0x8')](function(_0x50c0a3){return _0x50c0a3[_0xf018('0x9')]===_0xf018('0xa');});if(_0x47d790>-0x1){var _0x83854e=_0x341ed9['apps'][_0x47d790];if(typeof _0x83854e[_0xf018('0xb')][_0xf018('0xc')]!==_0xf018('0xd')){_0x83854e[_0xf018('0xb')]['NODE_PATH']=NODEPATH;_0x2b74b3=!![];}}return{'appConfig':_0x341ed9,'updated':_0x2b74b3};}}function updateAppConfig(_0x525e53){return fs[_0xf018('0xe')](APP_JSON_PATH)['then'](function(_0x591927){if(_0x591927){return fs['readJSON'](APP_JSON_PATH)[_0xf018('0xf')](function(_0x502d54){var _0x30e321=setLegacyLibsNodeEnvPath(_0x502d54);if(_0x30e321[_0xf018('0x10')]){_0x525e53['info'](_0xf018('0x11'));return fs[_0xf018('0x12')](APP_JSON_PATH,_0x502d54,{'spaces':0x2});}else{return Promise[_0xf018('0x4')]();}});}else{return Promise['resolve']();}});}module[_0xf018('0x13')]=updateAppConfig;
\ No newline at end of file
+var _0x57d8=['isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','Updating\x20app.json','fs-extra','path','../config/environment','resolve','legacy-libs'];(function(_0x4f5c2a,_0x465535){var _0x1b2e6e=function(_0x39efb2){while(--_0x39efb2){_0x4f5c2a['push'](_0x4f5c2a['shift']());}};_0x1b2e6e(++_0x465535);}(_0x57d8,0x1bd));var _0x857d=function(_0x3e7a9c,_0x2585eb){_0x3e7a9c=_0x3e7a9c-0x0;var _0x250efc=_0x57d8[_0x3e7a9c];return _0x250efc;};var fs=require(_0x857d('0x0'));var path=require(_0x857d('0x1'));var config=require(_0x857d('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,'server/app.json');var NODEPATH=path[_0x857d('0x3')](root,_0x857d('0x4'));function setLegacyLibsNodeEnvPath(_0x374410){let _0x520b99=![];if(Array[_0x857d('0x5')](_0x374410[_0x857d('0x6')])){var _0x334b56=_0x374410[_0x857d('0x6')][_0x857d('0x7')](function(_0x4ebdcf){return _0x4ebdcf[_0x857d('0x8')]===_0x857d('0x9');});if(_0x334b56>-0x1){var _0x1f3b51=_0x374410[_0x857d('0x6')][_0x334b56];if(typeof _0x1f3b51[_0x857d('0xa')][_0x857d('0xb')]!==_0x857d('0xc')){_0x1f3b51[_0x857d('0xa')]['NODE_PATH']=NODEPATH;_0x520b99=!![];}}return{'appConfig':_0x374410,'updated':_0x520b99};}}function updateAppConfig(_0x3ca4b7){return fs[_0x857d('0xd')](APP_JSON_PATH)[_0x857d('0xe')](function(_0x4b830e){if(_0x4b830e){return fs[_0x857d('0xf')](APP_JSON_PATH)[_0x857d('0xe')](function(_0x5636a8){var _0x2a8d66=setLegacyLibsNodeEnvPath(_0x5636a8);if(_0x2a8d66[_0x857d('0x10')]){_0x3ca4b7['info'](_0x857d('0x11'));return fs['writeJSON'](APP_JSON_PATH,_0x5636a8,{'spaces':0x2});}else{return Promise[_0x857d('0x3')]();}});}else{return Promise['resolve']();}});}module['exports']=updateAppConfig;
\ No newline at end of file